From 0cd53acb4aee5b657d5f96baf683353b2179a845 Mon Sep 17 00:00:00 2001 From: kylebuilds Date: Sun, 29 Oct 2023 16:28:25 -0700 Subject: [PATCH 1/4] stripe actions/triggers --- packages/pieces/stripe/src/index.ts | 58 ++- .../src/lib/actions/create-subscription.ts | 49 ++ .../stripe/src/lib/actions/search-charge.ts | 31 ++ .../stripe/src/lib/actions/search-customer.ts | 71 +-- .../stripe/src/lib/actions/search-invoice.ts | 31 ++ .../pieces/stripe/src/lib/common/index.ts | 118 +++-- .../pieces/stripe/src/lib/common/samples.ts | 493 ++++++++++++++++++ .../src/lib/trigger/canceled-subscription.ts | 42 ++ .../lib/trigger/checkout-session-complete.ts | 42 ++ .../src/lib/trigger/invoice-payment-failed.ts | 42 ++ .../stripe/src/lib/trigger/new-customer.ts | 46 +- .../stripe/src/lib/trigger/new-dispute.ts | 42 ++ .../stripe/src/lib/trigger/new-invoice.ts | 39 ++ .../stripe/src/lib/trigger/new-payment.ts | 111 +--- .../stripe/src/lib/trigger/new-refund.ts | 39 ++ .../src/lib/trigger/new-subscription.ts | 185 ++----- .../stripe/src/lib/trigger/payment-failed.ts | 190 +------ .../src/lib/trigger/updated-subscription.ts | 42 ++ 18 files changed, 1134 insertions(+), 537 deletions(-) create mode 100644 packages/pieces/stripe/src/lib/actions/create-subscription.ts create mode 100644 packages/pieces/stripe/src/lib/actions/search-charge.ts create mode 100644 packages/pieces/stripe/src/lib/actions/search-invoice.ts create mode 100644 packages/pieces/stripe/src/lib/common/samples.ts create mode 100644 packages/pieces/stripe/src/lib/trigger/canceled-subscription.ts create mode 100644 packages/pieces/stripe/src/lib/trigger/checkout-session-complete.ts create mode 100644 packages/pieces/stripe/src/lib/trigger/invoice-payment-failed.ts create mode 100644 packages/pieces/stripe/src/lib/trigger/new-dispute.ts create mode 100644 packages/pieces/stripe/src/lib/trigger/new-invoice.ts create mode 100644 packages/pieces/stripe/src/lib/trigger/new-refund.ts create mode 100644 packages/pieces/stripe/src/lib/trigger/updated-subscription.ts diff --git a/packages/pieces/stripe/src/index.ts b/packages/pieces/stripe/src/index.ts index 0262a035fd..99a676bd23 100644 --- a/packages/pieces/stripe/src/index.ts +++ b/packages/pieces/stripe/src/index.ts @@ -1,25 +1,53 @@ import { PieceAuth, createPiece } from '@activepieces/pieces-framework'; -import {stripeNewPayment} from "./lib/trigger/new-payment"; -import {stripeNewCustomer} from "./lib/trigger/new-customer"; -import {stripePaymentFailed} from "./lib/trigger/payment-failed"; +import { stripeNewPayment } from './lib/trigger/new-payment'; +import { stripeNewCustomer } from './lib/trigger/new-customer'; +import { stripePaymentFailed } from './lib/trigger/payment-failed'; import { stripeNewSubscription } from './lib/trigger/new-subscription'; import { stripeCreateCustomer } from './lib/actions/create-customer'; import { stripeCreateInvoice } from './lib/actions/create-invoice'; import { stripeSearchCustomer } from './lib/actions/search-customer'; - +import { stripeCreateSubscription } from './lib/actions/create-subscription'; +import { stripeSearchCharge } from './lib/actions/search-charge'; +import { stripeSearchInvoice } from './lib/actions/search-invoice'; +import { stripeCanceledSubscription } from './lib/trigger/canceled-subscription'; +import { stripeCheckoutSessionComplete } from './lib/trigger/checkout-session-complete'; +import { stripeInvoicePaymentFailed } from './lib/trigger/invoice-payment-failed'; +import { stripeNewDispute } from './lib/trigger/new-dispute'; +import { stripeNewInvoice } from './lib/trigger/new-invoice'; +import { stripeNewRefund } from './lib/trigger/new-refund'; +import { stripeUpdatedSubscription } from './lib/trigger/updated-subscription'; export const stripeAuth = PieceAuth.SecretText({ - displayName:"Secret API Key", - required:true, - description:"Secret key acquired from your Stripe dashboard" -}) + displayName: 'Secret API Key', + required: true, + description: 'Secret key acquired from your Stripe dashboard', +}); export const stripe = createPiece({ - displayName: "Stripe", - minimumSupportedRelease: '0.5.0', - logoUrl: 'https://cdn.activepieces.com/pieces/stripe.png', - authors: ['ashrafsamhouri', 'lldiegon'], - auth: stripeAuth, - actions: [stripeCreateCustomer, stripeCreateInvoice, stripeSearchCustomer], - triggers: [stripeNewPayment, stripeNewCustomer, stripePaymentFailed, stripeNewSubscription], + displayName: 'Stripe', + minimumSupportedRelease: '0.5.0', + logoUrl: 'https://cdn.activepieces.com/pieces/stripe.png', + authors: ['ashrafsamhouri', 'lldiegon', 'TaskMagicKyle'], + auth: stripeAuth, + actions: [ + stripeCreateCustomer, + stripeCreateInvoice, + stripeSearchCustomer, + stripeCreateSubscription, + stripeSearchCharge, + stripeSearchInvoice, + ], + triggers: [ + stripeNewPayment, + stripeNewCustomer, + stripePaymentFailed, + stripeNewSubscription, + stripeCanceledSubscription, + stripeCheckoutSessionComplete, + stripeInvoicePaymentFailed, + stripeNewDispute, + stripeNewInvoice, + stripeNewRefund, + stripeUpdatedSubscription, + ], }); diff --git a/packages/pieces/stripe/src/lib/actions/create-subscription.ts b/packages/pieces/stripe/src/lib/actions/create-subscription.ts new file mode 100644 index 0000000000..807f267b57 --- /dev/null +++ b/packages/pieces/stripe/src/lib/actions/create-subscription.ts @@ -0,0 +1,49 @@ +import { createAction, Property } from '@activepieces/pieces-framework'; +import { httpClient, HttpMethod } from '@activepieces/pieces-common'; +import { stripeAuth } from '../..'; +import { stripeCommon } from '../common'; + +export const stripeCreateSubscription = createAction({ + name: 'create_subscription', + auth: stripeAuth, + displayName: 'Create Subscription', + description: 'Create a subscription in stripe', + props: { + customer_id: Property.ShortText({ + displayName: 'Customer ID', + description: 'Stripe Customer ID', + required: true, + }), + price_id: stripeCommon.prices, + quantity: Property.Number({ + displayName: 'Quantity', + description: 'Quantity of the subscription', + required: true, + }), + }, + async run(context) { + const subscription = { + customer: context.propsValue.customer_id, + items: [ + { + price: context.propsValue.price_id, + quantity: context.propsValue.quantity, + }, + ], + }; + + const response = await httpClient.sendRequest({ + method: HttpMethod.POST, + url: 'https://api.stripe.com/v1/invoices', + headers: { + Authorization: 'Bearer ' + context.auth, + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: { + customer: subscription.customer, + items: subscription.items, + }, + }); + return response.body; + }, +}); diff --git a/packages/pieces/stripe/src/lib/actions/search-charge.ts b/packages/pieces/stripe/src/lib/actions/search-charge.ts new file mode 100644 index 0000000000..91215c190a --- /dev/null +++ b/packages/pieces/stripe/src/lib/actions/search-charge.ts @@ -0,0 +1,31 @@ +import { createAction, Property } from '@activepieces/pieces-framework'; +import { httpClient, HttpMethod } from '@activepieces/pieces-common'; +import { stripeAuth } from '../..'; + +export const stripeSearchCharge = createAction({ + name: 'search_charge', + auth: stripeAuth, + displayName: 'Search Charge', + description: 'Search for a charge in stripe by ID', + props: { + charge_id: Property.ShortText({ + displayName: 'Charge ID', + description: undefined, + required: true, + }), + }, + async run(context) { + const charge = { + id: context.propsValue.charge_id, + }; + const response = await httpClient.sendRequest({ + method: HttpMethod.GET, + url: 'https://api.stripe.com/v1/charges/' + charge.id, + headers: { + Authorization: 'Bearer ' + context.auth, + 'Content-Type': 'application/x-www-form-urlencoded', + }, + }); + return response.body; + }, +}); diff --git a/packages/pieces/stripe/src/lib/actions/search-customer.ts b/packages/pieces/stripe/src/lib/actions/search-customer.ts index a2a1e183bc..67ad1623ee 100644 --- a/packages/pieces/stripe/src/lib/actions/search-customer.ts +++ b/packages/pieces/stripe/src/lib/actions/search-customer.ts @@ -1,34 +1,41 @@ -import { createAction, Property } from "@activepieces/pieces-framework"; -import { httpClient, HttpMethod } from "@activepieces/pieces-common"; -import { stripeAuth } from "../.."; +import { createAction, Property } from '@activepieces/pieces-framework'; +import { httpClient, HttpMethod } from '@activepieces/pieces-common'; +import { stripeAuth } from '../..'; export const stripeSearchCustomer = createAction({ - name: 'search_customer', - auth: stripeAuth, - displayName:'Search Customer', - description: 'Search for a customer in stripe by email', - props: { - email: Property.ShortText({ - displayName: 'Email', - description: undefined, - required: true, - }), - }, - async run(context) { - const customer = { - email: context.propsValue.email, - } - const response = await httpClient.sendRequest({ - method: HttpMethod.GET, - url: 'https://api.stripe.com/v1/customers/search', - headers: { - "Authorization": 'Bearer ' + context.auth, - "Content-Type": "application/x-www-form-urlencoded", - }, - body: { - "query": "email:" + "'" + customer.email + "'", - } - }) - return response.body; - } -}) \ No newline at end of file + name: 'search_customer', + auth: stripeAuth, + displayName: 'Search Customer', + description: 'Search for a customer in stripe by email or ID', + props: { + email: Property.ShortText({ + displayName: 'Email or ID', + description: "Enter the customer's email or ID", + required: true, + }), + }, + async run(context) { + const emailOrId = context.propsValue.email; + let query = ''; + + if (emailOrId.startsWith('cus_')) { + // Assume it’s an ID if it starts with "cus_" + query = `id:"${emailOrId}"`; + } else { + query = `email:"${emailOrId}"`; + } + + const response = await httpClient.sendRequest({ + method: HttpMethod.GET, + url: 'https://api.stripe.com/v1/customers/search', + headers: { + Authorization: 'Bearer ' + context.auth, + 'Content-Type': 'application/x-www-form-urlencoded', + }, + queryParams: { + query: query, + }, + }); + return response.body; + }, +}); diff --git a/packages/pieces/stripe/src/lib/actions/search-invoice.ts b/packages/pieces/stripe/src/lib/actions/search-invoice.ts new file mode 100644 index 0000000000..96ae09ef22 --- /dev/null +++ b/packages/pieces/stripe/src/lib/actions/search-invoice.ts @@ -0,0 +1,31 @@ +import { createAction, Property } from '@activepieces/pieces-framework'; +import { httpClient, HttpMethod } from '@activepieces/pieces-common'; +import { stripeAuth } from '../..'; + +export const stripeSearchInvoice = createAction({ + name: 'search_invoice', + auth: stripeAuth, + displayName: 'Search Invoice', + description: 'Search for an invoice in stripe by ID', + props: { + invoice_id: Property.ShortText({ + displayName: 'Invoice ID', + description: undefined, + required: true, + }), + }, + async run(context) { + const invoice = { + id: context.propsValue.invoice_id, + }; + const response = await httpClient.sendRequest({ + method: HttpMethod.GET, + url: 'https://api.stripe.com/v1/invoices/' + invoice.id, + headers: { + Authorization: 'Bearer ' + context.auth, + 'Content-Type': 'application/x-www-form-urlencoded', + }, + }); + return response.body; + }, +}); diff --git a/packages/pieces/stripe/src/lib/common/index.ts b/packages/pieces/stripe/src/lib/common/index.ts index 9cccd62edd..66176d8f01 100644 --- a/packages/pieces/stripe/src/lib/common/index.ts +++ b/packages/pieces/stripe/src/lib/common/index.ts @@ -1,42 +1,88 @@ import { HttpRequest, HttpMethod, AuthenticationType, httpClient } from "@activepieces/pieces-common"; +import { samples } from './samples'; +import { Property } from '@activepieces/pieces-framework'; export const stripeCommon = { - baseUrl: "https://api.stripe.com/v1", - subscribeWebhook: async (eventName: string, webhookUrl: string, apiKey: string) => { - const request: HttpRequest = { - method: HttpMethod.POST, - url: `${stripeCommon.baseUrl}/webhook_endpoints`, - headers: { - "Content-Type": "application/x-www-form-urlencoded" - }, - body: { - enabled_events: [ - eventName - ], - url: webhookUrl - }, - authentication: { - type: AuthenticationType.BEARER_TOKEN, - token: apiKey, - }, - queryParams: {}, + samples, + baseUrl: 'https://api.stripe.com/v1', + subscribeWebhook: async ( + eventName: string, + webhookUrl: string, + apiKey: string + ) => { + const request: HttpRequest = { + method: HttpMethod.POST, + url: `${stripeCommon.baseUrl}/webhook_endpoints`, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body: { + enabled_events: [eventName], + url: webhookUrl, + }, + authentication: { + type: AuthenticationType.BEARER_TOKEN, + token: apiKey, + }, + queryParams: {}, + }; + + const { body: webhook } = await httpClient.sendRequest<{ id: string }>( + request + ); + return webhook; + }, + unsubscribeWebhook: async (webhookId: string, apiKey: string) => { + const request: HttpRequest = { + method: HttpMethod.DELETE, + url: `${stripeCommon.baseUrl}/webhook_endpoints/${webhookId}`, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + authentication: { + type: AuthenticationType.BEARER_TOKEN, + token: apiKey, + }, + }; + return await httpClient.sendRequest(request); + }, + prices: Property.Dropdown({ + displayName: 'Prices', + description: 'List of Prices', + required: true, + refreshers: [], + options: async ({ auth }) => { + if (!auth) { + return { + disabled: true, + options: [], + placeholder: 'Please connect your account first', }; + } + + const response = await httpClient.sendRequest({ + method: HttpMethod.GET, + url: 'https://api.stripe.com/v1/prices', + headers: { + Authorization: 'Bearer ' + auth, + 'Content-Type': 'application/x-www-form-urlencoded', + }, + }); + + const prices = response.body.data.map((price: StripePrice) => ({ + label: price.nickname, + value: price.id, + })); - const { body: webhook } = await httpClient.sendRequest<{ id: string }>(request); - return webhook; + return { + disabled: false, + options: prices, + }; }, - unsubscribeWebhook: async (webhookId: string, apiKey: string) => { - const request: HttpRequest = { - method: HttpMethod.DELETE, - url: `${stripeCommon.baseUrl}/webhook_endpoints/${webhookId}`, - headers: { - "Content-Type": "application/x-www-form-urlencoded" - }, - authentication: { - type: AuthenticationType.BEARER_TOKEN, - token: apiKey, - }, - }; - return await httpClient.sendRequest(request); - } -} + }), +}; + +type StripePrice = { + id: string; + nickname: string; +}; \ No newline at end of file diff --git a/packages/pieces/stripe/src/lib/common/samples.ts b/packages/pieces/stripe/src/lib/common/samples.ts new file mode 100644 index 0000000000..898936fda3 --- /dev/null +++ b/packages/pieces/stripe/src/lib/common/samples.ts @@ -0,0 +1,493 @@ +export const samples = { + charge: { + id: 'ch_3MWM7aKZ0dZfsfLEK1soCKVrq', + object: 'charge', + amount: 10000, + amount_captured: 10000, + amount_refunded: 0, + application: null, + application_fee: null, + application_fee_amount: null, + balance_transaction: 'txn_3MWM7afqwfZRqLEK1VyE8QH1', + billing_details: { + address: { + city: null, + country: 'DE', + line1: null, + line2: null, + postal_code: null, + state: null, + }, + email: 'test@gmail.com', + name: 'Test user', + phone: null, + }, + calculated_statement_descriptor: 'WWW.ACTIVEPIECES.COM', + captured: true, + created: 1675180355, + currency: 'usd', + customer: 'cus_NGtvUQ18FJXcGI', + description: 'Subscription creation', + destination: null, + dispute: null, + disputed: false, + failure_balance_transaction: null, + failure_code: null, + failure_message: null, + fraud_details: {}, + invoice: 'in_1MWM7ZKZ0dZRqLEKQbrgSBnh', + livemode: false, + metadata: {}, + on_behalf_of: null, + order: null, + outcome: { + network_status: 'approved_by_network', + reason: null, + risk_level: 'normal', + risk_score: 64, + seller_message: 'Payment complete.', + type: 'authorized', + }, + paid: true, + payment_intent: 'pi_3MWM7aKZ0dZRqLEK1BsblcVI', + payment_method: 'pm_1MWM8MKZ0dZRqLEKnIH41f76', + payment_method_details: { + card: { + brand: 'visa', + checks: { + address_line1_check: null, + address_postal_code_check: null, + cvc_check: 'pass', + }, + country: 'US', + exp_month: 12, + exp_year: 2034, + fingerprint: 't8SMsmS4h2vvODpN', + funding: 'credit', + installments: null, + last4: '4242', + mandate: null, + network: 'visa', + three_d_secure: null, + wallet: null, + }, + type: 'card', + }, + receipt_email: null, + receipt_number: null, + receipt_url: + 'https://pay.stripe.com/receipts/invoices/CAcaFwoVYWNjdF8xS214ZEtLWjBkWlJxTEVLKMXy5J4GMgZcuppYWF06LBZEoiAhZ6H7EoJ3bN-BMHCXdaW-_i-ywhSIG9wPGTmtE0CdpD75s1hIyprK?s=ap', + refunded: false, + refunds: { + object: 'list', + data: [], + has_more: false, + total_count: 0, + url: '/v1/charges/ch_3MWM7aKZ0dZRqLEK1soCKVrq/refunds', + }, + review: null, + shipping: null, + source: null, + source_transfer: null, + statement_descriptor: null, + statement_descriptor_suffix: null, + status: 'succeeded', + transfer_data: null, + transfer_group: null, + }, + customer: { + id: 'cus_MsFoYp7ZRonwC0', + object: 'customer', + address: { + city: null, + country: 'US', + line1: null, + line2: null, + postal_code: '98003', + state: null, + }, + balance: 0, + created: 1669495757, + currency: 'usd', + default_source: null, + delinquent: false, + description: null, + discount: null, + email: 'john@example.com', + invoice_prefix: '71EC8566', + invoice_settings: { + custom_fields: null, + default_payment_method: null, + footer: null, + rendering_options: null, + }, + livemode: false, + metadata: {}, + name: 'john smith', + next_invoice_sequence: 1, + phone: null, + preferred_locales: ['en-US'], + shipping: null, + tax_exempt: 'none', + test_clock: null, + }, + event: { + id: 'evt_1O6LszDdpvdpdjBQGH6CVCMm', + object: 'event', + api_version: '2017-04-06', + created: 1698535544, + data: { + object: { + id: 'cs_live_a1Qfuv15qZnhMudJVwMQkwxlYpcttldpe9E56Qbc9D4rNsTfImwz0ctedr', + object: 'checkout.session', + after_expiration: null, + allow_promotion_codes: null, + amount_subtotal: 2900, + amount_total: 1450, + automatic_tax: { + enabled: false, + status: null, + }, + billing_address_collection: null, + cancel_url: 'https://www.example.com/paywall', + client_reference_id: 'checkout_1698535415305', + client_secret: null, + consent: null, + consent_collection: null, + created: 1698535420, + currency: 'usd', + currency_conversion: null, + custom_fields: [], + custom_text: { + shipping_address: null, + submit: null, + terms_of_service_acceptance: null, + }, + customer: 'cus_O9AD3Sc5Bq39Pm', + customer_creation: 'always', + customer_details: { + address: { + city: null, + country: 'US', + line1: null, + line2: null, + postal_code: '30328', + state: null, + }, + email: 'test@example.com', + name: 'John Smith', + phone: '+1234567890', + tax_exempt: 'none', + tax_ids: [], + }, + customer_email: 'John Smith', + expires_at: 1698621820, + invoice: 'in_1O6LsmDdpv0pdjBQ2pENKxfu', + invoice_creation: null, + livemode: true, + locale: null, + metadata: { + quantity: '1', + email: 'test@example.com', + price_id: 'price_1NoHq7Ddpv0fdjBQJPCILkZs', + }, + mode: 'subscription', + payment_intent: null, + payment_link: null, + payment_method_collection: 'always', + payment_method_configuration_details: { + id: 'pmc_1KeuGWDdpkeudjBQxk9I9xgd', + parent: null, + }, + payment_method_options: null, + payment_method_types: ['card'], + payment_status: 'paid', + phone_number_collection: { + enabled: true, + }, + recovered_from: null, + setup_intent: null, + shipping: null, + shipping_address_collection: null, + shipping_options: [], + shipping_rate: null, + status: 'complete', + submit_type: null, + subscription: 'sub_1O6Lsmfdpv0pdjBQOYlUdVgC', + success_url: 'https://example.com', + total_details: { + amount_discount: 50, + amount_shipping: 0, + amount_tax: 0, + }, + ui_mode: 'hosted', + url: null, + }, + }, + livemode: true, + pending_webhooks: 0, + request: null, + type: 'checkout.session.completed', + }, + invoice: { + id: 'in_1O6hPoDdpv0pdjBQqPuCEZo8', + object: 'invoice', + account_country: 'US', + account_name: 'Example, Inc', + account_tax_ids: null, + amount_due: 99700, + amount_paid: 0, + amount_remaining: 99700, + amount_shipping: 0, + application: null, + application_fee_amount: null, + attempt_count: 0, + attempted: false, + auto_advance: false, + automatic_tax: { + enabled: false, + status: null, + }, + billing_reason: 'manual', + charge: null, + collection_method: 'charge_automatically', + created: 1698618304, + currency: 'usd', + custom_fields: null, + customer: 'cus_MsFoYp7ZRonwC0', + customer_address: { + city: null, + country: 'US', + line1: null, + line2: null, + postal_code: '98003', + state: null, + }, + customer_email: 'john@example.com', + customer_name: 'john smith', + customer_phone: null, + customer_shipping: null, + customer_tax_exempt: 'none', + customer_tax_ids: [], + default_payment_method: null, + default_source: null, + default_tax_rates: [], + description: null, + discount: null, + discounts: [], + due_date: null, + effective_at: null, + ending_balance: null, + footer: null, + from_invoice: null, + hosted_invoice_url: null, + invoice_pdf: null, + last_finalization_error: null, + latest_revision: null, + lines: { + object: 'list', + data: [ + { + id: 'il_1O6hPoDdpv0pdjBQlyXUUMEJ', + object: 'line_item', + amount: 99700, + amount_excluding_tax: 99700, + currency: 'usd', + description: 'My First Invoice Item (created for API docs)', + discount_amounts: [], + discountable: true, + discounts: [], + invoice_item: 'ii_1O6hPoDdpv0pdjBQVpJr9tLY', + livemode: false, + metadata: {}, + period: { + end: 1698618304, + start: 1698618304, + }, + price: { + id: 'price_1NHZqYDdpv0pdjBQ4Uoy9QjK', + object: 'price', + active: true, + billing_scheme: 'per_unit', + created: 1686434482, + currency: 'usd', + custom_unit_amount: null, + livemode: false, + lookup_key: null, + metadata: {}, + nickname: null, + product: 'prod_O3hFuqVcnH50y3', + recurring: null, + tax_behavior: 'unspecified', + tiers_mode: null, + transform_quantity: null, + type: 'one_time', + unit_amount: 99700, + unit_amount_decimal: '99700', + }, + proration: false, + proration_details: { + credited_items: null, + }, + quantity: 1, + subscription: null, + tax_amounts: [], + tax_rates: [], + type: 'invoiceitem', + unit_amount_excluding_tax: '99700', + }, + ], + has_more: false, + url: '/v1/invoices/in_1O6hPoDdpv0pdjBQqPuCEZo8/lines', + }, + livemode: false, + metadata: {}, + next_payment_attempt: null, + number: '71EC8566-DRAFT', + on_behalf_of: null, + paid: false, + paid_out_of_band: false, + payment_intent: null, + payment_settings: { + default_mandate: null, + payment_method_options: null, + payment_method_types: null, + }, + period_end: 1698618304, + period_start: 1698618304, + post_payment_credit_notes_amount: 0, + pre_payment_credit_notes_amount: 0, + quote: null, + receipt_number: null, + rendering: null, + shipping_cost: null, + shipping_details: null, + starting_balance: 0, + statement_descriptor: null, + status: 'draft', + status_transitions: { + finalized_at: null, + marked_uncollectible_at: null, + paid_at: null, + voided_at: null, + }, + subscription: null, + subscription_details: { + metadata: null, + }, + subtotal: 99700, + subtotal_excluding_tax: 99700, + tax: null, + test_clock: null, + total: 99700, + total_discount_amounts: [], + total_excluding_tax: 99700, + total_tax_amounts: [], + transfer_data: null, + webhooks_delivered_at: null, + }, + subscription: { + id: 'sub_1O6hZeDdpv0pdjBQnbL6OqZR', + object: 'subscription', + application: null, + application_fee_percent: null, + automatic_tax: { + enabled: false, + }, + billing_cycle_anchor: 1698618914, + billing_thresholds: null, + cancel_at: null, + cancel_at_period_end: false, + canceled_at: null, + cancellation_details: { + comment: null, + feedback: null, + reason: null, + }, + collection_method: 'charge_automatically', + created: 1698618914, + currency: 'usd', + current_period_end: 1701297314, + current_period_start: 1698618914, + customer: 'cus_MsFoYp7ZRonwC0', + days_until_due: null, + default_payment_method: null, + default_source: null, + default_tax_rates: [], + description: null, + discount: null, + ended_at: null, + items: { + object: 'list', + data: [ + { + id: 'si_OuWcdWKpdakza4', + object: 'subscription_item', + billing_thresholds: null, + created: 1698618915, + metadata: {}, + price: { + id: 'price_1MARreDdpv0pdjBQ6RTfEitN', + object: 'price', + active: true, + billing_scheme: 'per_unit', + created: 1669959166, + currency: 'usd', + custom_unit_amount: null, + livemode: false, + lookup_key: null, + metadata: {}, + nickname: null, + product: 'prod_MuGO2A9gFuDEJ2', + recurring: { + aggregate_usage: null, + interval: 'month', + interval_count: 1, + usage_type: 'licensed', + }, + tax_behavior: 'unspecified', + tiers_mode: null, + transform_quantity: { + divide_by: 4, + round: 'up', + }, + type: 'recurring', + unit_amount: 2900, + unit_amount_decimal: '2900', + }, + quantity: 1, + subscription: 'sub_1O6hZeDdpv0pdjBQnbL6OqZR', + tax_rates: [], + }, + ], + has_more: false, + url: '/v1/subscription_items?subscription=sub_1O6hZeDdpv0pdjBQnbL6OqZR', + }, + latest_invoice: null, + livemode: false, + metadata: {}, + next_pending_invoice_item_invoice: null, + on_behalf_of: null, + pause_collection: null, + payment_settings: { + payment_method_options: null, + payment_method_types: null, + save_default_payment_method: null, + }, + pending_invoice_item_interval: null, + pending_setup_intent: null, + pending_update: null, + schedule: null, + start_date: 1698618914, + status: 'active', + test_clock: null, + transfer_data: null, + trial_end: null, + trial_settings: { + end_behavior: { + missing_payment_method: 'create_invoice', + }, + }, + trial_start: null, + }, +}; diff --git a/packages/pieces/stripe/src/lib/trigger/canceled-subscription.ts b/packages/pieces/stripe/src/lib/trigger/canceled-subscription.ts new file mode 100644 index 0000000000..e3eaf53efc --- /dev/null +++ b/packages/pieces/stripe/src/lib/trigger/canceled-subscription.ts @@ -0,0 +1,42 @@ +import { createTrigger } from '@activepieces/pieces-framework'; +import { TriggerStrategy } from '@activepieces/pieces-framework'; +import { stripeCommon } from '../common'; +import { stripeAuth } from '../..'; + +export const stripeCanceledSubscription = createTrigger({ + auth: stripeAuth, + name: 'canceled_subscription', + displayName: 'Canceled Subscription', + description: 'Triggers when a subscription is canceled', + props: {}, + sampleData: stripeCommon.samples.subscription, + type: TriggerStrategy.WEBHOOK, + async onEnable(context) { + const webhook = await stripeCommon.subscribeWebhook( + 'customer.subscription.deleted', + context.webhookUrl, + context.auth + ); + await context.store.put( + '_canceled_subscription_trigger', + { + webhookId: webhook.id, + } + ); + }, + async onDisable(context) { + const response = await context.store?.get( + '_canceled_subscription_trigger' + ); + if (response !== null && response !== undefined) { + await stripeCommon.unsubscribeWebhook(response.webhookId, context.auth); + } + }, + async run(context) { + return [context.payload.body.data.object]; + }, +}); + +interface WebhookInformation { + webhookId: string; +} diff --git a/packages/pieces/stripe/src/lib/trigger/checkout-session-complete.ts b/packages/pieces/stripe/src/lib/trigger/checkout-session-complete.ts new file mode 100644 index 0000000000..a69e048bcb --- /dev/null +++ b/packages/pieces/stripe/src/lib/trigger/checkout-session-complete.ts @@ -0,0 +1,42 @@ +import { createTrigger } from '@activepieces/pieces-framework'; +import { TriggerStrategy } from '@activepieces/pieces-framework'; +import { stripeCommon } from '../common'; +import { stripeAuth } from '../..'; + +export const stripeCheckoutSessionComplete = createTrigger({ + auth: stripeAuth, + name: 'checkout_session_complete', + displayName: 'Checkout Session Complete', + description: 'Triggers when a checkout session is completed', + props: {}, + sampleData: stripeCommon.samples.event, + type: TriggerStrategy.WEBHOOK, + async onEnable(context) { + const webhook = await stripeCommon.subscribeWebhook( + 'checkout.session.completed', + context.webhookUrl, + context.auth + ); + await context.store.put( + '_checkout_session_complete_trigger', + { + webhookId: webhook.id, + } + ); + }, + async onDisable(context) { + const response = await context.store?.get( + '_checkout_session_complete_trigger' + ); + if (response !== null && response !== undefined) { + await stripeCommon.unsubscribeWebhook(response.webhookId, context.auth); + } + }, + async run(context) { + return [context.payload.body.data.object]; + }, +}); + +interface WebhookInformation { + webhookId: string; +} diff --git a/packages/pieces/stripe/src/lib/trigger/invoice-payment-failed.ts b/packages/pieces/stripe/src/lib/trigger/invoice-payment-failed.ts new file mode 100644 index 0000000000..fe05ffaefe --- /dev/null +++ b/packages/pieces/stripe/src/lib/trigger/invoice-payment-failed.ts @@ -0,0 +1,42 @@ +import { createTrigger } from '@activepieces/pieces-framework'; +import { TriggerStrategy } from '@activepieces/pieces-framework'; +import { stripeCommon } from '../common'; +import { stripeAuth } from '../..'; + +export const stripeInvoicePaymentFailed = createTrigger({ + auth: stripeAuth, + name: 'invoice_payment_failed', + displayName: 'Invoice Payment Failed', + description: 'Triggers when an invoice payment fails', + props: {}, + sampleData: stripeCommon.samples.event, + type: TriggerStrategy.WEBHOOK, + async onEnable(context) { + const webhook = await stripeCommon.subscribeWebhook( + 'invoice.payment_failed', + context.webhookUrl, + context.auth + ); + await context.store?.put( + '_invoice_payment_failed_trigger', + { + webhookId: webhook.id, + } + ); + }, + async onDisable(context) { + const response = await context.store?.get( + '_invoice_payment_failed_trigger' + ); + if (response !== null && response !== undefined) { + await stripeCommon.unsubscribeWebhook(response.webhookId, context.auth); + } + }, + async run(context) { + return [context.payload.body.data.object]; + }, +}); + +interface WebhookInformation { + webhookId: string; +} diff --git a/packages/pieces/stripe/src/lib/trigger/new-customer.ts b/packages/pieces/stripe/src/lib/trigger/new-customer.ts index 735b1e735f..24ae9d329a 100644 --- a/packages/pieces/stripe/src/lib/trigger/new-customer.ts +++ b/packages/pieces/stripe/src/lib/trigger/new-customer.ts @@ -8,47 +8,23 @@ export const stripeNewCustomer = createTrigger({ name: 'new_customer', displayName: 'New Customer', description: 'Triggers when a new customer is created', - props: { - }, - sampleData: { - "id": "cus_NGtyEf4hNGTj3p", - "object": "customer", - "address": null, - "balance": 0, - "created": 1675180509, - "currency": null, - "default_currency": null, - "default_source": null, - "delinquent": false, - "description": null, - "discount": null, - "email": "jane@example.com", - "invoice_prefix": "B7162248", - "invoice_settings": { - "custom_fields": null, - "default_payment_method": null, - "footer": null, - "rendering_options": null - }, - "livemode": false, - "metadata": {}, - "name": "John Doe", - "next_invoice_sequence": 1, - "phone": null, - "preferred_locales": [], - "shipping": null, - "tax_exempt": "none", - "test_clock": null - }, + props: {}, + sampleData: stripeCommon.samples.customer, type: TriggerStrategy.WEBHOOK, async onEnable(context) { - const webhook = await stripeCommon.subscribeWebhook('customer.created', context.webhookUrl, context.auth); + const webhook = await stripeCommon.subscribeWebhook( + 'customer.created', + context.webhookUrl, + context.auth + ); await context.store.put('_new_customer_trigger', { - webhookId: webhook.id + webhookId: webhook.id, }); }, async onDisable(context) { - const response = await context.store?.get('_new_customer_trigger'); + const response = await context.store?.get( + '_new_customer_trigger' + ); if (response !== null && response !== undefined) { await stripeCommon.unsubscribeWebhook(response.webhookId, context.auth); } diff --git a/packages/pieces/stripe/src/lib/trigger/new-dispute.ts b/packages/pieces/stripe/src/lib/trigger/new-dispute.ts new file mode 100644 index 0000000000..ace5ba1f30 --- /dev/null +++ b/packages/pieces/stripe/src/lib/trigger/new-dispute.ts @@ -0,0 +1,42 @@ +import { createTrigger } from '@activepieces/pieces-framework'; +import { TriggerStrategy } from '@activepieces/pieces-framework'; +import { stripeCommon } from '../common'; +import { stripeAuth } from '../..'; + +export const stripeNewDispute = createTrigger({ + auth: stripeAuth, + name: 'new_dispute', + displayName: 'New Dispute', + description: 'Triggers when a new dispute is created', + props: {}, + type: TriggerStrategy.WEBHOOK, + sampleData: stripeCommon.samples.charge, + async onEnable(context) { + const webhook = await stripeCommon.subscribeWebhook( + 'charge.dispute.created', + context.webhookUrl!, + context.auth + ); + await context.store?.put( + '_charge_dispute_created_trigger', + { + webhookId: webhook.id, + } + ); + }, + async onDisable(context) { + const response = await context.store?.get( + '_charge_dispute_created_trigger' + ); + if (response !== null && response !== undefined) { + await stripeCommon.unsubscribeWebhook(response.webhookId, context.auth); + } + }, + async run(context) { + return [context.payload.body.data.object]; + }, +}); + +interface WebhookInformation { + webhookId: string; +} diff --git a/packages/pieces/stripe/src/lib/trigger/new-invoice.ts b/packages/pieces/stripe/src/lib/trigger/new-invoice.ts new file mode 100644 index 0000000000..4303fbe8b7 --- /dev/null +++ b/packages/pieces/stripe/src/lib/trigger/new-invoice.ts @@ -0,0 +1,39 @@ +import { createTrigger } from '@activepieces/pieces-framework'; +import { TriggerStrategy } from '@activepieces/pieces-framework'; +import { stripeCommon } from '../common'; +import { stripeAuth } from '../..'; + +export const stripeNewInvoice = createTrigger({ + auth: stripeAuth, + name: 'new_invoice', + displayName: 'New Invoice', + description: 'Triggers when a new invoice is made', + props: {}, + type: TriggerStrategy.WEBHOOK, + sampleData: stripeCommon.samples.invoice, + async onEnable(context) { + const webhook = await stripeCommon.subscribeWebhook( + 'invoice.created', + context.webhookUrl!, + context.auth + ); + await context.store?.put('_new_invoice_trigger', { + webhookId: webhook.id, + }); + }, + async onDisable(context) { + const response = await context.store?.get( + '_new_invoice_trigger' + ); + if (response !== null && response !== undefined) { + await stripeCommon.unsubscribeWebhook(response.webhookId, context.auth); + } + }, + async run(context) { + return [context.payload.body.data.object]; + }, +}); + +interface WebhookInformation { + webhookId: string; +} diff --git a/packages/pieces/stripe/src/lib/trigger/new-payment.ts b/packages/pieces/stripe/src/lib/trigger/new-payment.ts index 27ecbef2d6..71d33a323d 100644 --- a/packages/pieces/stripe/src/lib/trigger/new-payment.ts +++ b/packages/pieces/stripe/src/lib/trigger/new-payment.ts @@ -8,112 +8,23 @@ export const stripeNewPayment = createTrigger({ name: 'new_payment', displayName: 'New Payment', description: 'Triggers when a new payment is made', - props: { - }, + props: {}, type: TriggerStrategy.WEBHOOK, - sampleData: { - "id": "ch_3MWM7aKZ0dZRqLEK1soCKVrq", - "object": "charge", - "amount": 10000, - "amount_captured": 10000, - "amount_refunded": 0, - "application": null, - "application_fee": null, - "application_fee_amount": null, - "balance_transaction": "txn_3MWM7aKZ0dZRqLEK1VyE8QH1", - "billing_details": { - "address": { - "city": null, - "country": "DE", - "line1": null, - "line2": null, - "postal_code": null, - "state": null - }, - "email": "test@gmail.com", - "name": "Test user", - "phone": null - }, - "calculated_statement_descriptor": "WWW.ACTIVEPIECES.COM", - "captured": true, - "created": 1675180355, - "currency": "usd", - "customer": "cus_NGtvUQ18FJXcGI", - "description": "Subscription creation", - "destination": null, - "dispute": null, - "disputed": false, - "failure_balance_transaction": null, - "failure_code": null, - "failure_message": null, - "fraud_details": {}, - "invoice": "in_1MWM7ZKZ0dZRqLEKQbrgSBnh", - "livemode": false, - "metadata": {}, - "on_behalf_of": null, - "order": null, - "outcome": { - "network_status": "approved_by_network", - "reason": null, - "risk_level": "normal", - "risk_score": 64, - "seller_message": "Payment complete.", - "type": "authorized" - }, - "paid": true, - "payment_intent": "pi_3MWM7aKZ0dZRqLEK1BsblcVI", - "payment_method": "pm_1MWM8MKZ0dZRqLEKnIH41f76", - "payment_method_details": { - "card": { - "brand": "visa", - "checks": { - "address_line1_check": null, - "address_postal_code_check": null, - "cvc_check": "pass" - }, - "country": "US", - "exp_month": 12, - "exp_year": 2034, - "fingerprint": "t8SMsmS4h2vvODpN", - "funding": "credit", - "installments": null, - "last4": "4242", - "mandate": null, - "network": "visa", - "three_d_secure": null, - "wallet": null - }, - "type": "card" - }, - "receipt_email": null, - "receipt_number": null, - "receipt_url": "https://pay.stripe.com/receipts/invoices/CAcaFwoVYWNjdF8xS214ZEtLWjBkWlJxTEVLKMXy5J4GMgZcuppYWF06LBZEoiAhZ6H7EoJ3bN-BMHCXdaW-_i-ywhSIG9wPGTmtE0CdpD75s1hIyprK?s=ap", - "refunded": false, - "refunds": { - "object": "list", - "data": [], - "has_more": false, - "total_count": 0, - "url": "/v1/charges/ch_3MWM7aKZ0dZRqLEK1soCKVrq/refunds" - }, - "review": null, - "shipping": null, - "source": null, - "source_transfer": null, - "statement_descriptor": null, - "statement_descriptor_suffix": null, - "status": "succeeded", - "transfer_data": null, - "transfer_group": null - }, + sampleData: stripeCommon.samples.charge, async onEnable(context) { - const webhook = await stripeCommon.subscribeWebhook('charge.succeeded', context.webhookUrl!, context.auth); + const webhook = await stripeCommon.subscribeWebhook( + 'charge.succeeded', + context.webhookUrl!, + context.auth + ); await context.store?.put('_new_payment_trigger', { - webhookId: webhook.id + webhookId: webhook.id, }); }, async onDisable(context) { - const response = await context.store?.get('_new_payment_trigger'); + const response = await context.store?.get( + '_new_payment_trigger' + ); if (response !== null && response !== undefined) { await stripeCommon.unsubscribeWebhook(response.webhookId, context.auth); } diff --git a/packages/pieces/stripe/src/lib/trigger/new-refund.ts b/packages/pieces/stripe/src/lib/trigger/new-refund.ts new file mode 100644 index 0000000000..b777b150dd --- /dev/null +++ b/packages/pieces/stripe/src/lib/trigger/new-refund.ts @@ -0,0 +1,39 @@ +import { createTrigger } from '@activepieces/pieces-framework'; +import { TriggerStrategy } from '@activepieces/pieces-framework'; +import { stripeCommon } from '../common'; +import { stripeAuth } from '../..'; + +export const stripeNewRefund = createTrigger({ + auth: stripeAuth, + name: 'new_refund', + displayName: 'New Refund', + description: 'Triggers when a new refund is created', + props: {}, + type: TriggerStrategy.WEBHOOK, + sampleData: stripeCommon.samples.charge, + async onEnable(context) { + const webhook = await stripeCommon.subscribeWebhook( + 'charge.refunded', + context.webhookUrl!, + context.auth + ); + await context.store?.put('_charge_refunded_trigger', { + webhookId: webhook.id, + }); + }, + async onDisable(context) { + const response = await context.store?.get( + '_charge_refunded_trigger' + ); + if (response !== null && response !== undefined) { + await stripeCommon.unsubscribeWebhook(response.webhookId, context.auth); + } + }, + async run(context) { + return [context.payload.body.data.object]; + }, +}); + +interface WebhookInformation { + webhookId: string; +} diff --git a/packages/pieces/stripe/src/lib/trigger/new-subscription.ts b/packages/pieces/stripe/src/lib/trigger/new-subscription.ts index f1102ab688..ecdf8f8614 100644 --- a/packages/pieces/stripe/src/lib/trigger/new-subscription.ts +++ b/packages/pieces/stripe/src/lib/trigger/new-subscription.ts @@ -5,163 +5,36 @@ import { stripeAuth } from '../..'; export const stripeNewSubscription = createTrigger({ auth: stripeAuth, - name: 'new_subscription', - displayName: 'New Subscription', - description: 'Triggers when a new subscription is made', - props: { - }, - type: TriggerStrategy.WEBHOOK, - sampleData: { - "id": "sub_1MWMJXKZ0dZRqLEKJX80JXfv", - "object": "subscription", - "application": null, - "application_fee_percent": null, - "automatic_tax": { - "enabled": true - }, - "billing_cycle_anchor": 1675181047, - "billing_thresholds": null, - "cancel_at": null, - "cancel_at_period_end": false, - "canceled_at": null, - "collection_method": "charge_automatically", - "created": 1675181047, - "currency": "usd", - "current_period_end": 1677600247, - "current_period_start": 1675181047, - "customer": "cus_NGtvUQ18FJXcGI", - "days_until_due": null, - "default_payment_method": "pm_1MWM8MKZ0dZRqLEKnIH41f76", - "default_source": null, - "default_tax_rates": [], - "description": null, - "discount": null, - "ended_at": null, - "items": { - "object": "list", - "data": [ - { - "id": "si_NGu7pb7hS3Rps3", - "object": "subscription_item", - "billing_thresholds": null, - "created": 1675181048, - "metadata": {}, - "plan": { - "id": "price_1MWLz3KZ0dZRqLEK06gRMHCF", - "object": "plan", - "active": true, - "aggregate_usage": null, - "amount": 10000, - "amount_decimal": "10000", - "billing_scheme": "per_unit", - "created": 1675179777, - "currency": "usd", - "interval": "month", - "interval_count": 1, - "livemode": false, - "metadata": {}, - "nickname": null, - "product": "prod_NGtm3AlvaGjaLN", - "tiers_mode": null, - "transform_usage": null, - "trial_period_days": null, - "usage_type": "licensed" - }, - "price": { - "id": "price_1MWLz3KZ0dZRqLEK06gRMHCF", - "object": "price", - "active": true, - "billing_scheme": "per_unit", - "created": 1675179777, - "currency": "usd", - "custom_unit_amount": null, - "livemode": false, - "lookup_key": null, - "metadata": {}, - "nickname": null, - "product": "prod_NGtm3AlvaGjaLN", - "recurring": { - "aggregate_usage": null, - "interval": "month", - "interval_count": 1, - "trial_period_days": null, - "usage_type": "licensed" - }, - "tax_behavior": "exclusive", - "tiers_mode": null, - "transform_quantity": null, - "type": "recurring", - "unit_amount": 10000, - "unit_amount_decimal": "10000" - }, - "quantity": 1, - "subscription": "sub_1MWMJXKZ0dZRqLEKJX80JXfv", - "tax_rates": [] - } - ], - "has_more": false, - "total_count": 1, - "url": "/v1/subscription_items?subscription=sub_1MWMJXKZ0dZRqLEKJX80JXfv" - }, - "latest_invoice": "in_1MWMJXKZ0dZRqLEKIu4a51u7", - "livemode": false, - "metadata": {}, - "next_pending_invoice_item_invoice": null, - "on_behalf_of": null, - "pause_collection": null, - "payment_settings": { - "payment_method_options": null, - "payment_method_types": null, - "save_default_payment_method": "off" - }, - "pending_invoice_item_interval": null, - "pending_setup_intent": null, - "pending_update": null, - "plan": { - "id": "price_1MWLz3KZ0dZRqLEK06gRMHCF", - "object": "plan", - "active": true, - "aggregate_usage": null, - "amount": 10000, - "amount_decimal": "10000", - "billing_scheme": "per_unit", - "created": 1675179777, - "currency": "usd", - "interval": "month", - "interval_count": 1, - "livemode": false, - "metadata": {}, - "nickname": null, - "product": "prod_NGtm3AlvaGjaLN", - "tiers_mode": null, - "transform_usage": null, - "trial_period_days": null, - "usage_type": "licensed" - }, - "quantity": 1, - "schedule": null, - "start_date": 1675181047, - "status": "active", - "test_clock": null, - "transfer_data": null, - "trial_end": null, - "trial_start": null - }, - async onEnable(context) { - const webhook = await stripeCommon.subscribeWebhook('customer.subscription.created', context.webhookUrl!, context.auth); - await context.store?.put('_new_customer_subscription_trigger', { - webhookId: webhook.id - }); - }, - async onDisable(context) { - const response = await context.store?.get('_new_customer_subscription_trigger'); - if (response !== null && response !== undefined) { - await stripeCommon.unsubscribeWebhook(response.webhookId, context.auth); + name: 'new_subscription', + displayName: 'New Subscription', + description: 'Triggers when a new subscription is made', + props: {}, + type: TriggerStrategy.WEBHOOK, + sampleData: stripeCommon.samples.subscription, + async onEnable(context) { + const webhook = await stripeCommon.subscribeWebhook( + 'customer.subscription.created', + context.webhookUrl!, + context.auth + ); + await context.store?.put( + '_new_customer_subscription_trigger', + { + webhookId: webhook.id, } - }, - async run(context) { - return [context.payload.body.data.object]; - }, + ); + }, + async onDisable(context) { + const response = await context.store?.get( + '_new_customer_subscription_trigger' + ); + if (response !== null && response !== undefined) { + await stripeCommon.unsubscribeWebhook(response.webhookId, context.auth); + } + }, + async run(context) { + return [context.payload.body.data.object]; + }, }); interface WebhookInformation { diff --git a/packages/pieces/stripe/src/lib/trigger/payment-failed.ts b/packages/pieces/stripe/src/lib/trigger/payment-failed.ts index 1cbdbceeb4..2b58e71ae2 100644 --- a/packages/pieces/stripe/src/lib/trigger/payment-failed.ts +++ b/packages/pieces/stripe/src/lib/trigger/payment-failed.ts @@ -5,169 +5,33 @@ import { stripeAuth } from '../..'; export const stripePaymentFailed = createTrigger({ auth: stripeAuth, - name: 'payment_failed', - displayName: 'Payment Failed', - description: 'Triggers when a payment fails', - props: { - }, - sampleData: { - "id": "ch_3MWMPQKZ0dZRqLEK063rxD7q", - "object": "charge", - "amount": 100000, - "amount_captured": 0, - "amount_refunded": 0, - "application": null, - "application_fee": null, - "application_fee_amount": null, - "balance_transaction": null, - "billing_details": { - "address": { - "city": null, - "country": null, - "line1": null, - "line2": null, - "postal_code": "12321", - "state": null - }, - "email": null, - "name": null, - "phone": null - }, - "calculated_statement_descriptor": "WWW.ACTIVEPIECES.COM", - "captured": false, - "created": 1675181413, - "currency": "usd", - "customer": "cus_NGtvUQ18FJXcGI", - "description": "Failed Payment", - "destination": null, - "dispute": null, - "disputed": false, - "failure_balance_transaction": null, - "failure_code": "card_declined", - "failure_message": "Your card was declined.", - "fraud_details": {}, - "invoice": null, - "livemode": false, - "metadata": {}, - "on_behalf_of": null, - "order": null, - "outcome": { - "network_status": "declined_by_network", - "reason": "generic_decline", - "risk_level": "normal", - "risk_score": 60, - "seller_message": "The bank did not return any further details with this decline.", - "type": "issuer_declined" - }, - "paid": false, - "payment_intent": "pi_3MWMPQKZ0dZRqLEK0Nsc6WhL", - "payment_method": "src_1MWMPQKZ0dZRqLEKuQ83wmZI", - "payment_method_details": { - "card": { - "brand": "visa", - "checks": { - "address_line1_check": null, - "address_postal_code_check": "pass", - "cvc_check": "pass" - }, - "country": "US", - "exp_month": 12, - "exp_year": 2031, - "fingerprint": "mtYxM2Q4edpEt8Pw", - "funding": "credit", - "installments": null, - "last4": "0341", - "mandate": null, - "network": "visa", - "three_d_secure": null, - "wallet": null - }, - "type": "card" - }, - "receipt_email": null, - "receipt_number": null, - "receipt_url": null, - "refunded": false, - "refunds": { - "object": "list", - "data": [], - "has_more": false, - "total_count": 0, - "url": "/v1/charges/ch_3MWMPQKZ0dZRqLEK063rxD7q/refunds" - }, - "review": null, - "shipping": null, - "source": { - "id": "src_1MWMPQKZ0dZRqLEKuQ83wmZI", - "object": "source", - "amount": null, - "card": { - "exp_month": 12, - "exp_year": 2031, - "last4": "0341", - "country": "US", - "brand": "Visa", - "address_zip_check": "pass", - "cvc_check": "pass", - "funding": "credit", - "fingerprint": "mtYxM2Q4edpEt8Pw", - "three_d_secure": "optional", - "name": null, - "address_line1_check": null, - "tokenization_method": null, - "dynamic_last4": null - }, - "client_secret": "src_client_secret_TlLkl6IvhCvmbx8Cz12YNDVb", - "created": 1675181413, - "currency": null, - "flow": "none", - "livemode": false, - "metadata": {}, - "owner": { - "address": { - "city": null, - "country": null, - "line1": null, - "line2": null, - "postal_code": "12321", - "state": null - }, - "email": null, - "name": null, - "phone": null, - "verified_address": null, - "verified_email": null, - "verified_name": null, - "verified_phone": null - }, - "statement_descriptor": null, - "status": "chargeable", - "type": "card", - "usage": "reusable" - }, - "source_transfer": null, - "statement_descriptor": "www.activepieces.com", - "statement_descriptor_suffix": null, - "status": "failed", - "transfer_data": null, - "transfer_group": null - }, - type: TriggerStrategy.WEBHOOK, - async onEnable(context) { - const webhook = await stripeCommon.subscribeWebhook('charge.failed', context.webhookUrl, context.auth); - await context.store?.put('_payment_failed_trigger', { - webhookId: webhook.id - }); - }, - async onDisable(context) { - const response = await context.store?.get('_payment_failed_trigger'); - if (response !== null && response !== undefined) { - await stripeCommon.unsubscribeWebhook(response.webhookId, context.auth); - } - }, - async run(context) { - return [context.payload.body.data.object]; - }, + name: 'payment_failed', + displayName: 'Payment Failed', + description: 'Triggers when a payment fails', + props: {}, + sampleData: stripeCommon.samples.charge, + type: TriggerStrategy.WEBHOOK, + async onEnable(context) { + const webhook = await stripeCommon.subscribeWebhook( + 'charge.failed', + context.webhookUrl, + context.auth + ); + await context.store?.put('_payment_failed_trigger', { + webhookId: webhook.id, + }); + }, + async onDisable(context) { + const response = await context.store?.get( + '_payment_failed_trigger' + ); + if (response !== null && response !== undefined) { + await stripeCommon.unsubscribeWebhook(response.webhookId, context.auth); + } + }, + async run(context) { + return [context.payload.body.data.object]; + }, }); interface WebhookInformation { diff --git a/packages/pieces/stripe/src/lib/trigger/updated-subscription.ts b/packages/pieces/stripe/src/lib/trigger/updated-subscription.ts new file mode 100644 index 0000000000..519e6f2260 --- /dev/null +++ b/packages/pieces/stripe/src/lib/trigger/updated-subscription.ts @@ -0,0 +1,42 @@ +import { createTrigger } from '@activepieces/pieces-framework'; +import { TriggerStrategy } from '@activepieces/pieces-framework'; +import { stripeCommon } from '../common'; +import { stripeAuth } from '../..'; + +export const stripeUpdatedSubscription = createTrigger({ + auth: stripeAuth, + name: 'updated_subscription', + displayName: 'Updated Subscription', + description: 'Triggers when a subscription is updated', + props: {}, + sampleData: stripeCommon.samples.subscription, + type: TriggerStrategy.WEBHOOK, + async onEnable(context) { + const webhook = await stripeCommon.subscribeWebhook( + 'customer.subscription.updated', + context.webhookUrl, + context.auth + ); + await context.store.put( + '_updated_subscription_trigger', + { + webhookId: webhook.id, + } + ); + }, + async onDisable(context) { + const response = await context.store?.get( + '_updated_subscription_trigger' + ); + if (response !== null && response !== undefined) { + await stripeCommon.unsubscribeWebhook(response.webhookId, context.auth); + } + }, + async run(context) { + return [context.payload.body.data.object]; + }, +}); + +interface WebhookInformation { + webhookId: string; +} From 0bb16783d1f46fa81bcb1263c1694f34f9194e7f Mon Sep 17 00:00:00 2001 From: kylebuilds Date: Sun, 29 Oct 2023 17:04:42 -0700 Subject: [PATCH 2/4] targets --- packages/pieces/shopify/src/index.ts | 4 +- .../src/lib/actions/create-customer.ts | 149 +++++++ .../shopify/src/lib/actions/create-order.ts | 0 .../shopify/src/lib/actions/create-product.ts | 0 .../src/lib/actions/create-variant-product.ts | 0 .../shopify/src/lib/actions/find-customer.ts | 0 .../src/lib/actions/find-product-by-title.ts | 0 .../actions/find-product-variant-by-title.ts | 0 .../src/lib/actions/update-customer.ts | 0 .../lib/actions/update-inventory-quantity.ts | 0 .../src/lib/actions/update-product-variant.ts | 0 .../shopify/src/lib/actions/update-product.ts | 0 .../shopify/src/lib/triggers/new-dispute.ts | 22 + .../shopify/src/lib/triggers/new-product.ts | 85 ++++ .../src/lib/triggers/updated-customer.ts | 36 ++ .../shopify/src/lib/triggers/updated-order.ts | 401 ++++++++++++++++++ 16 files changed, 695 insertions(+), 2 deletions(-) create mode 100644 packages/pieces/shopify/src/lib/actions/create-customer.ts create mode 100644 packages/pieces/shopify/src/lib/actions/create-order.ts create mode 100644 packages/pieces/shopify/src/lib/actions/create-product.ts create mode 100644 packages/pieces/shopify/src/lib/actions/create-variant-product.ts create mode 100644 packages/pieces/shopify/src/lib/actions/find-customer.ts create mode 100644 packages/pieces/shopify/src/lib/actions/find-product-by-title.ts create mode 100644 packages/pieces/shopify/src/lib/actions/find-product-variant-by-title.ts create mode 100644 packages/pieces/shopify/src/lib/actions/update-customer.ts create mode 100644 packages/pieces/shopify/src/lib/actions/update-inventory-quantity.ts create mode 100644 packages/pieces/shopify/src/lib/actions/update-product-variant.ts create mode 100644 packages/pieces/shopify/src/lib/actions/update-product.ts create mode 100644 packages/pieces/shopify/src/lib/triggers/new-dispute.ts create mode 100644 packages/pieces/shopify/src/lib/triggers/new-product.ts create mode 100644 packages/pieces/shopify/src/lib/triggers/updated-customer.ts create mode 100644 packages/pieces/shopify/src/lib/triggers/updated-order.ts diff --git a/packages/pieces/shopify/src/index.ts b/packages/pieces/shopify/src/index.ts index b22e301d23..9ffcde4c7f 100644 --- a/packages/pieces/shopify/src/index.ts +++ b/packages/pieces/shopify/src/index.ts @@ -14,13 +14,13 @@ To Obtain an Admin Token, follow these steps: 3. Click on Develop apps 4. Create an App 5. Fill the app name -6. Click on Configure Admin API Scopes (Select the following scopes 'read_orders', 'read_customers') +6. Click on Configure Admin API Scopes (Select the following scopes 'read_orders', 'read_customers') Note: Some steps may require more sensitive scopes 7. Click on Install app 8. Copy the Admin Access Token **Shop Name** 1- You can find your shop name in the url For example, if the URL is https://example.myshopify.com/admin, then your shop name is **example**. -` +`; export const shopifyAuth = PieceAuth.CustomAuth({ description: markdown, diff --git a/packages/pieces/shopify/src/lib/actions/create-customer.ts b/packages/pieces/shopify/src/lib/actions/create-customer.ts new file mode 100644 index 0000000000..ec34a2aee5 --- /dev/null +++ b/packages/pieces/shopify/src/lib/actions/create-customer.ts @@ -0,0 +1,149 @@ +import { + createAction, + Property, + Validators, +} from '@activepieces/pieces-framework'; +import { httpClient, HttpMethod } from '@activepieces/pieces-common'; +import { shopifyAuth } from '../..'; + +export const createCustomer = createAction({ + auth: shopifyAuth, + name: 'create_customer', + displayName: 'Create Customer', + description: 'Creates a customer.', + + props: { + email: Property.ShortText({ + displayName: 'Email', + required: true, + }), + firstName: Property.ShortText({ + displayName: 'First Name', + required: true, + }), + lastName: Property.ShortText({ + displayName: 'Last Name', + required: true, + }), + company: Property.ShortText({ + displayName: 'Company', + required: false, + }), + street_address: Property.ShortText({ + displayName: 'Street Address', + required: false, + }), + + street_address_2: Property.ShortText({ + displayName: 'Street Address 2', + required: false, + }), + city: Property.ShortText({ + displayName: 'City', + required: false, + }), + state: Property.ShortText({ + displayName: 'State/Province code', + required: false, + }), + country: Property.ShortText({ + displayName: 'Country code', + required: false, + }), + zipcode: Property.ShortText({ + displayName: 'Zip Code', + required: false, + }), + + mark_email_as_verified: Property.Checkbox({ + displayName: 'Mark Email as Verified', + required: true, + }), + phone: Property.ShortText({ + displayName: 'Phone', + required: false, + }), + tags: Property.ShortText({ + displayName: 'Tags', + required: false, + }), + note: Property.LongText({ + displayName: 'Note', + required: false, + }), + accepts_marketing: Property.Checkbox({ + displayName: 'Accepts Marketing', + required: false, + }), + tax_exempt: Property.Checkbox({ + displayName: 'Tax Exempt', + required: false, + }), + send_email_invite: Property.Checkbox({ + displayName: 'Send Email Invite', + required: false, + }), + }, + + async run(context) { + const { + email, + firstName, + lastName, + company, + street_address, + street_address_2, + city, + state, + country, + zipcode, + phone, + tags, + note, + accepts_marketing = false, + tax_exempt = false, + send_email_invite = false, + } = context.propsValue; + + const shopName = context.auth.shopName; + const adminToken = context.auth.adminToken; + + const response = await httpClient.sendRequest<{ + customer: { + id: string; + }; + }>({ + method: HttpMethod.POST, + url: `https://${shopName}.myshopify.com/admin/api/2023-01/customers.json`, + headers: { + 'X-Shopify-Access-Token': adminToken, + }, + body: { + customer: { + email, + first_name: firstName, + last_name: lastName, + company, + addresses: [ + { + address1: street_address, + address2: street_address_2, + city, + province: state, + country, + zip: zipcode, + }, + ], + send_email_invite, + phone, + tags, + note, + accepts_marketing, + tax_exempt, + }, + }, + }); + + return [response.body.customer]; + }, +}); diff --git a/packages/pieces/shopify/src/lib/actions/create-order.ts b/packages/pieces/shopify/src/lib/actions/create-order.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/shopify/src/lib/actions/create-product.ts b/packages/pieces/shopify/src/lib/actions/create-product.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/shopify/src/lib/actions/create-variant-product.ts b/packages/pieces/shopify/src/lib/actions/create-variant-product.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/shopify/src/lib/actions/find-customer.ts b/packages/pieces/shopify/src/lib/actions/find-customer.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/shopify/src/lib/actions/find-product-by-title.ts b/packages/pieces/shopify/src/lib/actions/find-product-by-title.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/shopify/src/lib/actions/find-product-variant-by-title.ts b/packages/pieces/shopify/src/lib/actions/find-product-variant-by-title.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/shopify/src/lib/actions/update-customer.ts b/packages/pieces/shopify/src/lib/actions/update-customer.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/shopify/src/lib/actions/update-inventory-quantity.ts b/packages/pieces/shopify/src/lib/actions/update-inventory-quantity.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/shopify/src/lib/actions/update-product-variant.ts b/packages/pieces/shopify/src/lib/actions/update-product-variant.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/shopify/src/lib/actions/update-product.ts b/packages/pieces/shopify/src/lib/actions/update-product.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/shopify/src/lib/triggers/new-dispute.ts b/packages/pieces/shopify/src/lib/triggers/new-dispute.ts new file mode 100644 index 0000000000..33da366b8f --- /dev/null +++ b/packages/pieces/shopify/src/lib/triggers/new-dispute.ts @@ -0,0 +1,22 @@ +import { createShopifyWebhookTrigger } from '../common/register-webhook'; + +export const newDispute = createShopifyWebhookTrigger({ + name: 'new_dispute', + description: 'Triggered when a new dispute is created', + topic: 'disputes/create', + displayName: 'New Dispute', + sampleData: { + id: 285332461850802050, + order_id: 820982911946154500, + type: 'chargeback', + amount: '11.50', + currency: 'CAD', + reason: 'fraudulent', + network_reason_code: '4837', + status: 'under_review', + evidence_due_by: '2021-12-30T19:00:00-05:00', + evidence_sent_on: null, + finalized_on: null, + initiated_at: '2021-12-31T19:00:00-05:00', + }, +}); diff --git a/packages/pieces/shopify/src/lib/triggers/new-product.ts b/packages/pieces/shopify/src/lib/triggers/new-product.ts new file mode 100644 index 0000000000..31b991fe55 --- /dev/null +++ b/packages/pieces/shopify/src/lib/triggers/new-product.ts @@ -0,0 +1,85 @@ +import { createShopifyWebhookTrigger } from '../common/register-webhook'; + +export const newProduct = createShopifyWebhookTrigger({ + name: 'new_product', + description: 'Triggered when a new product is created', + topic: 'products/create', + displayName: 'New Product', + sampleData: { + admin_graphql_api_id: 'gid://shopify/Product/788032119674292922', + body_html: 'An example T-Shirt', + created_at: null, + handle: 'example-t-shirt', + id: 788032119674292900, + product_type: 'Shirts', + published_at: '2021-12-31T19:00:00-05:00', + template_suffix: null, + title: 'Example T-Shirt', + updated_at: '2021-12-31T19:00:00-05:00', + vendor: 'Acme', + status: 'active', + published_scope: 'web', + tags: 'example, mens, t-shirt', + variants: [ + { + admin_graphql_api_id: 'gid://shopify/ProductVariant/642667041472713922', + barcode: null, + compare_at_price: '24.99', + created_at: null, + fulfillment_service: 'manual', + id: 642667041472714000, + inventory_management: 'shopify', + inventory_policy: 'deny', + position: 0, + price: '19.99', + product_id: 788032119674292900, + sku: 'example-shirt-s', + taxable: true, + title: '', + updated_at: null, + option1: 'Small', + option2: null, + option3: null, + grams: 200, + image_id: null, + weight: 200, + weight_unit: 'g', + inventory_item_id: null, + inventory_quantity: 75, + old_inventory_quantity: 75, + requires_shipping: true, + }, + { + admin_graphql_api_id: 'gid://shopify/ProductVariant/757650484644203962', + barcode: null, + compare_at_price: '24.99', + created_at: null, + fulfillment_service: 'manual', + id: 757650484644203900, + inventory_management: 'shopify', + inventory_policy: 'deny', + position: 0, + price: '19.99', + product_id: 788032119674292900, + sku: 'example-shirt-m', + taxable: true, + title: '', + updated_at: null, + option1: 'Medium', + option2: null, + option3: null, + grams: 200, + image_id: null, + weight: 200, + weight_unit: 'g', + inventory_item_id: null, + inventory_quantity: 50, + old_inventory_quantity: 50, + requires_shipping: true, + }, + ], + options: [], + images: [], + image: null, + }, +}); diff --git a/packages/pieces/shopify/src/lib/triggers/updated-customer.ts b/packages/pieces/shopify/src/lib/triggers/updated-customer.ts new file mode 100644 index 0000000000..36445e931a --- /dev/null +++ b/packages/pieces/shopify/src/lib/triggers/updated-customer.ts @@ -0,0 +1,36 @@ +import { createShopifyWebhookTrigger } from '../common/register-webhook'; + +export const updatedCustomer = createShopifyWebhookTrigger({ + name: 'updated_customer', + description: 'Triggered when a customer is updated', + topic: 'customers/updated', + displayName: 'Updated Customer', + sampleData: { + id: 706405506930370000, + email: 'bob@biller.com', + accepts_marketing: true, + created_at: '2021-12-31T19:00:00-05:00', + updated_at: '2021-12-31T19:00:00-05:00', + first_name: 'Bob', + last_name: 'Biller', + orders_count: 0, + state: 'disabled', + total_spent: '0.00', + last_order_id: null, + note: 'This customer loves ice cream', + verified_email: true, + multipass_identifier: null, + tax_exempt: false, + tags: '', + last_order_name: null, + currency: 'USD', + phone: null, + addresses: [], + accepts_marketing_updated_at: '2021-12-31T19:00:00-05:00', + marketing_opt_in_level: null, + tax_exemptions: [], + email_marketing_consent: null, + sms_marketing_consent: null, + admin_graphql_api_id: 'gid://shopify/Customer/706405506930370084', + }, +}); diff --git a/packages/pieces/shopify/src/lib/triggers/updated-order.ts b/packages/pieces/shopify/src/lib/triggers/updated-order.ts new file mode 100644 index 0000000000..e73739ced4 --- /dev/null +++ b/packages/pieces/shopify/src/lib/triggers/updated-order.ts @@ -0,0 +1,401 @@ +import { createShopifyWebhookTrigger } from '../common/register-webhook'; + +export const updatedOrder = createShopifyWebhookTrigger({ + name: 'updated_order', + description: 'Triggered when an order is updated', + topic: 'orders/updated', + displayName: 'Updated Order', + sampleData: { + id: 820982911946154500, + admin_graphql_api_id: 'gid://shopify/Order/820982911946154508', + app_id: null, + browser_ip: null, + buyer_accepts_marketing: true, + cancel_reason: 'customer', + cancelled_at: '2021-12-31T19:00:00-05:00', + cart_token: null, + checkout_id: null, + checkout_token: null, + client_details: null, + closed_at: null, + confirmation_number: null, + confirmed: false, + contact_email: 'jon@example.com', + created_at: '2021-12-31T19:00:00-05:00', + currency: 'USD', + current_subtotal_price: '398.00', + current_subtotal_price_set: { + shop_money: { + amount: '398.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '398.00', + currency_code: 'USD', + }, + }, + current_total_additional_fees_set: null, + current_total_discounts: '0.00', + current_total_discounts_set: { + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, + }, + current_total_duties_set: null, + current_total_price: '398.00', + current_total_price_set: { + shop_money: { + amount: '398.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '398.00', + currency_code: 'USD', + }, + }, + current_total_tax: '0.00', + current_total_tax_set: { + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, + }, + customer_locale: 'en', + device_id: null, + discount_codes: [], + email: 'jon@example.com', + estimated_taxes: false, + financial_status: 'voided', + fulfillment_status: 'pending', + landing_site: null, + landing_site_ref: null, + location_id: null, + merchant_of_record_app_id: null, + name: '#9999', + note: null, + note_attributes: [], + number: 234, + order_number: 1234, + order_status_url: + 'https://jsmith.myshopify.com/548380009/orders/123456abcd/authenticate?key=abcdefg', + original_total_additional_fees_set: null, + original_total_duties_set: null, + payment_gateway_names: ['visa', 'bogus'], + phone: null, + po_number: null, + presentment_currency: 'USD', + processed_at: null, + reference: null, + referring_site: null, + source_identifier: null, + source_name: 'web', + source_url: null, + subtotal_price: '388.00', + subtotal_price_set: { + shop_money: { + amount: '388.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '388.00', + currency_code: 'USD', + }, + }, + tags: '', + tax_exempt: false, + tax_lines: [], + taxes_included: false, + test: true, + token: '123456abcd', + total_discounts: '20.00', + total_discounts_set: { + shop_money: { + amount: '20.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '20.00', + currency_code: 'USD', + }, + }, + total_line_items_price: '398.00', + total_line_items_price_set: { + shop_money: { + amount: '398.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '398.00', + currency_code: 'USD', + }, + }, + total_outstanding: '398.00', + total_price: '388.00', + total_price_set: { + shop_money: { + amount: '388.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '388.00', + currency_code: 'USD', + }, + }, + total_shipping_price_set: { + shop_money: { + amount: '10.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '10.00', + currency_code: 'USD', + }, + }, + total_tax: '0.00', + total_tax_set: { + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, + }, + total_tip_received: '0.00', + total_weight: 0, + updated_at: '2021-12-31T19:00:00-05:00', + user_id: null, + billing_address: { + first_name: 'Steve', + address1: '123 Shipping Street', + phone: '555-555-SHIP', + city: 'Shippington', + zip: '40003', + province: 'Kentucky', + country: 'United States', + last_name: 'Shipper', + address2: null, + company: 'Shipping Company', + latitude: null, + longitude: null, + name: 'Steve Shipper', + country_code: 'US', + province_code: 'KY', + }, + customer: { + id: 115310627314723950, + email: 'john@example.com', + accepts_marketing: false, + created_at: null, + updated_at: null, + first_name: 'John', + last_name: 'Smith', + state: 'disabled', + note: null, + verified_email: true, + multipass_identifier: null, + tax_exempt: false, + phone: null, + email_marketing_consent: { + state: 'not_subscribed', + opt_in_level: null, + consent_updated_at: null, + }, + sms_marketing_consent: null, + tags: '', + currency: 'USD', + accepts_marketing_updated_at: null, + marketing_opt_in_level: null, + tax_exemptions: [], + admin_graphql_api_id: 'gid://shopify/Customer/115310627314723954', + default_address: { + id: 715243470612851200, + customer_id: 115310627314723950, + first_name: null, + last_name: null, + company: null, + address1: '123 Elm St.', + address2: null, + city: 'Ottawa', + province: 'Ontario', + country: 'Canada', + zip: 'K2H7A8', + phone: '123-123-1234', + name: '', + province_code: 'ON', + country_code: 'CA', + country_name: 'Canada', + default: true, + }, + }, + discount_applications: [], + fulfillments: [], + line_items: [ + { + id: 866550311766439000, + admin_graphql_api_id: 'gid://shopify/LineItem/866550311766439020', + attributed_staffs: [ + { + id: 'gid://shopify/StaffMember/902541635', + quantity: 1, + }, + ], + fulfillable_quantity: 1, + fulfillment_service: 'manual', + fulfillment_status: null, + gift_card: false, + grams: 567, + name: 'IPod Nano - 8GB', + price: '199.00', + price_set: { + shop_money: { + amount: '199.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '199.00', + currency_code: 'USD', + }, + }, + product_exists: true, + product_id: 632910392, + properties: [], + quantity: 1, + requires_shipping: true, + sku: 'IPOD2008PINK', + taxable: true, + title: 'IPod Nano - 8GB', + total_discount: '0.00', + total_discount_set: { + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, + }, + variant_id: 808950810, + variant_inventory_management: 'shopify', + variant_title: null, + vendor: null, + tax_lines: [], + duties: [], + discount_allocations: [], + }, + { + id: 141249953214522980, + admin_graphql_api_id: 'gid://shopify/LineItem/141249953214522974', + attributed_staffs: [], + fulfillable_quantity: 1, + fulfillment_service: 'manual', + fulfillment_status: null, + gift_card: false, + grams: 567, + name: 'IPod Nano - 8GB', + price: '199.00', + price_set: { + shop_money: { + amount: '199.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '199.00', + currency_code: 'USD', + }, + }, + product_exists: true, + product_id: 632910392, + properties: [], + quantity: 1, + requires_shipping: true, + sku: 'IPOD2008PINK', + taxable: true, + title: 'IPod Nano - 8GB', + total_discount: '0.00', + total_discount_set: { + shop_money: { + amount: '0.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '0.00', + currency_code: 'USD', + }, + }, + variant_id: 808950810, + variant_inventory_management: 'shopify', + variant_title: null, + vendor: null, + tax_lines: [], + duties: [], + discount_allocations: [], + }, + ], + payment_terms: null, + refunds: [], + shipping_address: { + first_name: 'Steve', + address1: '123 Shipping Street', + phone: '555-555-SHIP', + city: 'Shippington', + zip: '40003', + province: 'Kentucky', + country: 'United States', + last_name: 'Shipper', + address2: null, + company: 'Shipping Company', + latitude: null, + longitude: null, + name: 'Steve Shipper', + country_code: 'US', + province_code: 'KY', + }, + shipping_lines: [ + { + id: 271878346596884000, + carrier_identifier: null, + code: null, + discounted_price: '10.00', + discounted_price_set: { + shop_money: { + amount: '10.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '10.00', + currency_code: 'USD', + }, + }, + phone: null, + price: '10.00', + price_set: { + shop_money: { + amount: '10.00', + currency_code: 'USD', + }, + presentment_money: { + amount: '10.00', + currency_code: 'USD', + }, + }, + requested_fulfillment_service_id: null, + source: 'shopify', + title: 'Generic Shipping', + tax_lines: [], + discount_allocations: [], + }, + ], + }, +}); From c92585ef8e6c0de84acc1ec167bcffc34fb00eee Mon Sep 17 00:00:00 2001 From: kylebuilds Date: Sun, 29 Oct 2023 17:08:13 -0700 Subject: [PATCH 3/4] targets --- packages/pieces/monday/src/lib/actions/archive-board.ts | 0 packages/pieces/monday/src/lib/actions/archive-group.ts | 0 packages/pieces/monday/src/lib/actions/archive-item.ts | 0 packages/pieces/monday/src/lib/actions/create-board.ts | 0 packages/pieces/monday/src/lib/actions/create-column.ts | 0 packages/pieces/monday/src/lib/actions/create-group.ts | 0 packages/pieces/monday/src/lib/actions/create-subitem.ts | 0 packages/pieces/monday/src/lib/actions/create-update.ts | 0 packages/pieces/monday/src/lib/actions/delete-group.ts | 0 packages/pieces/monday/src/lib/actions/delete-item.ts | 0 packages/pieces/monday/src/lib/actions/get-user.ts | 0 11 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 packages/pieces/monday/src/lib/actions/archive-board.ts create mode 100644 packages/pieces/monday/src/lib/actions/archive-group.ts create mode 100644 packages/pieces/monday/src/lib/actions/archive-item.ts create mode 100644 packages/pieces/monday/src/lib/actions/create-board.ts create mode 100644 packages/pieces/monday/src/lib/actions/create-column.ts create mode 100644 packages/pieces/monday/src/lib/actions/create-group.ts create mode 100644 packages/pieces/monday/src/lib/actions/create-subitem.ts create mode 100644 packages/pieces/monday/src/lib/actions/create-update.ts create mode 100644 packages/pieces/monday/src/lib/actions/delete-group.ts create mode 100644 packages/pieces/monday/src/lib/actions/delete-item.ts create mode 100644 packages/pieces/monday/src/lib/actions/get-user.ts diff --git a/packages/pieces/monday/src/lib/actions/archive-board.ts b/packages/pieces/monday/src/lib/actions/archive-board.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/monday/src/lib/actions/archive-group.ts b/packages/pieces/monday/src/lib/actions/archive-group.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/monday/src/lib/actions/archive-item.ts b/packages/pieces/monday/src/lib/actions/archive-item.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/monday/src/lib/actions/create-board.ts b/packages/pieces/monday/src/lib/actions/create-board.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/monday/src/lib/actions/create-column.ts b/packages/pieces/monday/src/lib/actions/create-column.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/monday/src/lib/actions/create-group.ts b/packages/pieces/monday/src/lib/actions/create-group.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/monday/src/lib/actions/create-subitem.ts b/packages/pieces/monday/src/lib/actions/create-subitem.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/monday/src/lib/actions/create-update.ts b/packages/pieces/monday/src/lib/actions/create-update.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/monday/src/lib/actions/delete-group.ts b/packages/pieces/monday/src/lib/actions/delete-group.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/monday/src/lib/actions/delete-item.ts b/packages/pieces/monday/src/lib/actions/delete-item.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/monday/src/lib/actions/get-user.ts b/packages/pieces/monday/src/lib/actions/get-user.ts new file mode 100644 index 0000000000..e69de29bb2 From d2a3e1d0b5525a55c270bc93143f9c65942a7b6b Mon Sep 17 00:00:00 2001 From: kylebuilds Date: Sun, 29 Oct 2023 17:12:33 -0700 Subject: [PATCH 4/4] targets --- package-lock.json | 87 ++----------------- packages/pieces/thinkific/.eslintrc.json | 25 ++++++ packages/pieces/thinkific/README.md | 7 ++ packages/pieces/thinkific/package.json | 4 + packages/pieces/thinkific/project.json | 44 ++++++++++ packages/pieces/thinkific/src/index.ts | 12 +++ .../thinkific/src/lib/actions/enroll-user.ts | 0 .../thinkific/src/lib/actions/search-users.ts | 0 .../src/lib/actions/unenroll-user.ts | 0 .../src/lib/triggers/course-completed.ts | 0 .../src/lib/triggers/lesson-completed.ts | 0 .../triggers/new-free-preview-enrollment.ts | 0 .../src/lib/triggers/new-full-enrollment.ts | 0 .../thinkific/src/lib/triggers/new-order.ts | 0 .../thinkific/src/lib/triggers/new-user.ts | 0 .../lib/triggers/subscription-cancelled.ts | 0 packages/pieces/thinkific/tsconfig.json | 19 ++++ packages/pieces/thinkific/tsconfig.lib.json | 11 +++ tsconfig.base.json | 3 + 19 files changed, 133 insertions(+), 79 deletions(-) create mode 100644 packages/pieces/thinkific/.eslintrc.json create mode 100644 packages/pieces/thinkific/README.md create mode 100644 packages/pieces/thinkific/package.json create mode 100644 packages/pieces/thinkific/project.json create mode 100644 packages/pieces/thinkific/src/index.ts create mode 100644 packages/pieces/thinkific/src/lib/actions/enroll-user.ts create mode 100644 packages/pieces/thinkific/src/lib/actions/search-users.ts create mode 100644 packages/pieces/thinkific/src/lib/actions/unenroll-user.ts create mode 100644 packages/pieces/thinkific/src/lib/triggers/course-completed.ts create mode 100644 packages/pieces/thinkific/src/lib/triggers/lesson-completed.ts create mode 100644 packages/pieces/thinkific/src/lib/triggers/new-free-preview-enrollment.ts create mode 100644 packages/pieces/thinkific/src/lib/triggers/new-full-enrollment.ts create mode 100644 packages/pieces/thinkific/src/lib/triggers/new-order.ts create mode 100644 packages/pieces/thinkific/src/lib/triggers/new-user.ts create mode 100644 packages/pieces/thinkific/src/lib/triggers/subscription-cancelled.ts create mode 100644 packages/pieces/thinkific/tsconfig.json create mode 100644 packages/pieces/thinkific/tsconfig.lib.json diff --git a/package-lock.json b/package-lock.json index dc1d552fde..9350da8e14 100644 --- a/package-lock.json +++ b/package-lock.json @@ -261,7 +261,6 @@ "version": "2.2.1", "resolved": "https://registry.npmjs.org/@ampproject/remapping/-/remapping-2.2.1.tgz", "integrity": "sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg==", - "dev": true, "dependencies": { "@jridgewell/gen-mapping": "^0.3.0", "@jridgewell/trace-mapping": "^0.3.9" @@ -2450,7 +2449,6 @@ "version": "7.22.13", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.22.13.tgz", "integrity": "sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==", - "dev": true, "dependencies": { "@babel/highlight": "^7.22.13", "chalk": "^2.4.2" @@ -2463,7 +2461,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -2475,7 +2472,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -2489,7 +2485,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "dependencies": { "color-name": "1.1.3" } @@ -2497,14 +2492,12 @@ "node_modules/@babel/code-frame/node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, "node_modules/@babel/code-frame/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, "engines": { "node": ">=0.8.0" } @@ -2513,7 +2506,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, "engines": { "node": ">=4" } @@ -2522,7 +2514,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -2534,7 +2525,6 @@ "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.20.tgz", "integrity": "sha512-BQYjKbpXjoXwFW5jGqiizJQQT/aC7pFm9Ok1OWssonuguICi264lbgMzRp2ZMmRSlfkX6DsWDDcsrctK8Rwfiw==", - "dev": true, "engines": { "node": ">=6.9.0" } @@ -2582,7 +2572,6 @@ "version": "7.22.9", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.22.9.tgz", "integrity": "sha512-KtLMbmicyuK2Ak/FTCJVbDnkN1SlT8/kceFTiuDiiRUUSMnHMidxSCdG4ndkTOHHpoomWe/4xkvHkEOncwjYIw==", - "dev": true, "dependencies": { "@babel/types": "^7.22.5", "@jridgewell/gen-mapping": "^0.3.2", @@ -2621,7 +2610,6 @@ "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz", "integrity": "sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==", - "dev": true, "dependencies": { "@babel/compat-data": "^7.22.9", "@babel/helper-validator-option": "^7.22.15", @@ -2637,7 +2625,6 @@ "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, "bin": { "semver": "bin/semver.js" } @@ -2720,7 +2707,6 @@ "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/helper-environment-visitor/-/helper-environment-visitor-7.22.20.tgz", "integrity": "sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==", - "dev": true, "engines": { "node": ">=6.9.0" } @@ -2729,7 +2715,6 @@ "version": "7.23.0", "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.23.0.tgz", "integrity": "sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==", - "dev": true, "dependencies": { "@babel/template": "^7.22.15", "@babel/types": "^7.23.0" @@ -2742,7 +2727,6 @@ "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", - "dev": true, "dependencies": { "@babel/code-frame": "^7.22.13", "@babel/parser": "^7.22.15", @@ -2756,7 +2740,6 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.22.5.tgz", "integrity": "sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==", - "dev": true, "dependencies": { "@babel/types": "^7.22.5" }, @@ -2780,7 +2763,6 @@ "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.22.15.tgz", "integrity": "sha512-0pYVBnDKZO2fnSPCrgM/6WMc7eS20Fbok+0r88fp+YtWVLZrp4CkafFGIp+W0VKw4a22sgebPT99y+FDNMdP4w==", - "dev": true, "dependencies": { "@babel/types": "^7.22.15" }, @@ -2792,7 +2774,6 @@ "version": "7.23.0", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.23.0.tgz", "integrity": "sha512-WhDWw1tdrlT0gMgUJSlX0IQvoO1eN279zrAUbVB+KpV2c3Tylz8+GnKOLllCS6Z/iZQEyVYxhZVUdPTqs2YYPw==", - "dev": true, "dependencies": { "@babel/helper-environment-visitor": "^7.22.20", "@babel/helper-module-imports": "^7.22.15", @@ -2866,7 +2847,6 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.22.5.tgz", "integrity": "sha512-n0H99E/K+Bika3++WNL17POvo4rKWZ7lZEp1Q+fStVbUi8nxPQEBOlTmCOxW/0JsS56SKKQ+ojAe2pHKJHN35w==", - "dev": true, "dependencies": { "@babel/types": "^7.22.5" }, @@ -2890,7 +2870,6 @@ "version": "7.22.6", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.22.6.tgz", "integrity": "sha512-AsUnxuLhRYsisFiaJwvp1QF+I3KjD5FOxut14q/GzovUe6orHLesW2C7d754kRm53h5gqrz6sFl6sxc4BVtE/g==", - "dev": true, "dependencies": { "@babel/types": "^7.22.5" }, @@ -2902,7 +2881,6 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-string-parser/-/helper-string-parser-7.22.5.tgz", "integrity": "sha512-mM4COjgZox8U+JcXQwPijIZLElkgEpO5rsERVDJTc2qfCDfERyob6k5WegS14SX18IIjv+XD+GrqNumY5JRCDw==", - "dev": true, "engines": { "node": ">=6.9.0" } @@ -2911,7 +2889,6 @@ "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.22.20.tgz", "integrity": "sha512-Y4OZ+ytlatR8AI+8KZfKuL5urKp7qey08ha31L8b3BwewJAoJamTzyvxPR/5D+KkdJCGPq/+8TukHBlY10FX9A==", - "dev": true, "engines": { "node": ">=6.9.0" } @@ -2920,7 +2897,6 @@ "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz", "integrity": "sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==", - "dev": true, "engines": { "node": ">=6.9.0" } @@ -2957,7 +2933,6 @@ "version": "7.23.1", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.23.1.tgz", "integrity": "sha512-chNpneuK18yW5Oxsr+t553UZzzAs3aZnFm4bxhebsNTeshrC95yA7l5yl7GBAG+JG1rF0F7zzD2EixK9mWSDoA==", - "dev": true, "dependencies": { "@babel/template": "^7.22.15", "@babel/traverse": "^7.23.0", @@ -2971,7 +2946,6 @@ "version": "7.22.15", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.15.tgz", "integrity": "sha512-QPErUVm4uyJa60rkI73qneDacvdvzxshT3kksGqlGWYdOTIUOwJ7RDUL8sGqslY1uXWSL6xMFKEXDS3ox2uF0w==", - "dev": true, "dependencies": { "@babel/code-frame": "^7.22.13", "@babel/parser": "^7.22.15", @@ -2985,7 +2959,6 @@ "version": "7.22.20", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.22.20.tgz", "integrity": "sha512-dkdMCN3py0+ksCgYmGG8jKeGA/8Tk+gJwSYYlFGxG5lmhfKNoAy004YpLxpS1W2J8m/EK2Ew+yOs9pVRwO89mg==", - "dev": true, "dependencies": { "@babel/helper-validator-identifier": "^7.22.20", "chalk": "^2.4.2", @@ -2999,7 +2972,6 @@ "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -3011,7 +2983,6 @@ "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -3025,7 +2996,6 @@ "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, "dependencies": { "color-name": "1.1.3" } @@ -3033,14 +3003,12 @@ "node_modules/@babel/highlight/node_modules/color-name": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==" }, "node_modules/@babel/highlight/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", - "dev": true, "engines": { "node": ">=0.8.0" } @@ -3049,7 +3017,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true, "engines": { "node": ">=4" } @@ -3058,7 +3025,6 @@ "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -3070,7 +3036,6 @@ "version": "7.23.0", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.23.0.tgz", "integrity": "sha512-vvPKKdMemU85V9WE/l5wZEmImpCtLqbnTvqDS2U1fJ96KrxoW7KrXhNsNCblQlg8Ck4b85yxdTyelsMUgFUXiw==", - "devOptional": true, "bin": { "parser": "bin/babel-parser.js" }, @@ -4464,7 +4429,6 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.22.5.tgz", "integrity": "sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==", - "dev": true, "dependencies": { "@babel/code-frame": "^7.22.5", "@babel/parser": "^7.22.5", @@ -4478,7 +4442,6 @@ "version": "7.23.2", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.23.2.tgz", "integrity": "sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==", - "dev": true, "dependencies": { "@babel/code-frame": "^7.22.13", "@babel/generator": "^7.23.0", @@ -4499,7 +4462,6 @@ "version": "7.23.0", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.23.0.tgz", "integrity": "sha512-lN85QRR+5IbYrMWM6Y4pE/noaQtg4pNiqeNGX60eqOfo6gtEj6uw/JagelB8vVztSd7R6M5n1+PQkDbHbBRU4g==", - "dev": true, "dependencies": { "@babel/types": "^7.23.0", "@jridgewell/gen-mapping": "^0.3.2", @@ -4514,7 +4476,6 @@ "version": "7.23.0", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.23.0.tgz", "integrity": "sha512-0oIyUfKoI3mSqMvsxBdclDwxXKXAUA8v/apZbc+iSyARYou1o8ZGDxbUYyLFoW2arqS2jDGqJuZvv1d/io1axg==", - "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.22.5", "@babel/helper-validator-identifier": "^7.22.20", @@ -7190,7 +7151,6 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", "integrity": "sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ==", - "dev": true, "dependencies": { "@jridgewell/set-array": "^1.0.1", "@jridgewell/sourcemap-codec": "^1.4.10", @@ -7204,7 +7164,6 @@ "version": "3.1.1", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz", "integrity": "sha512-dSYZh7HhCDtCKm4QakX0xFpsRDqjjtZf/kjI/v3T3Nwt5r8/qz/M19F9ySyOqU94SXBmeG9ttTul+YnR4LOxFA==", - "dev": true, "engines": { "node": ">=6.0.0" } @@ -7213,7 +7172,6 @@ "version": "1.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/set-array/-/set-array-1.1.2.tgz", "integrity": "sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw==", - "dev": true, "engines": { "node": ">=6.0.0" } @@ -7237,7 +7195,6 @@ "version": "0.3.19", "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.19.tgz", "integrity": "sha512-kf37QtfW+Hwx/buWGMPcR60iF9ziHa6r/CZJIHbmcm4+0qrXiVdxegAH0F6yddEVQ7zdkjcGCgCzUu+BcbhQxw==", - "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.1.0", "@jridgewell/sourcemap-codec": "^1.4.14" @@ -8224,7 +8181,6 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -8237,7 +8193,6 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, "engines": { "node": ">= 8" } @@ -8246,7 +8201,6 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -14273,7 +14227,6 @@ "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", - "dev": true, "dependencies": { "fill-range": "^7.0.1" }, @@ -14291,7 +14244,6 @@ "version": "4.22.1", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz", "integrity": "sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==", - "dev": true, "funding": [ { "type": "opencollective", @@ -14679,7 +14631,6 @@ "version": "1.0.30001541", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001541.tgz", "integrity": "sha512-bLOsqxDgTqUBkzxbNlSBt8annkDpQB9NdzdTbO2ooJ+eC/IQcvDspDc058g84ejCelF7vHUx57KIOjEecOHXaw==", - "dev": true, "funding": [ { "type": "opencollective", @@ -15639,8 +15590,7 @@ "node_modules/convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", - "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "dev": true + "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==" }, "node_modules/cookie": { "version": "0.4.2", @@ -17665,8 +17615,7 @@ "node_modules/electron-to-chromium": { "version": "1.4.537", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.537.tgz", - "integrity": "sha512-W1+g9qs9hviII0HAwOdehGYkr+zt7KKdmCcJcjH0mYg6oL8+ioT3Skjmt7BLoAQqXhjf40AXd+HlR4oAWMlXjA==", - "dev": true + "integrity": "sha512-W1+g9qs9hviII0HAwOdehGYkr+zt7KKdmCcJcjH0mYg6oL8+ioT3Skjmt7BLoAQqXhjf40AXd+HlR4oAWMlXjA==" }, "node_modules/elkjs": { "version": "0.8.2", @@ -19143,7 +19092,6 @@ "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", - "dev": true, "dependencies": { "to-regex-range": "^5.0.1" }, @@ -19830,7 +19778,6 @@ "version": "1.0.0-beta.2", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz", "integrity": "sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==", - "dev": true, "engines": { "node": ">=6.9.0" } @@ -19932,7 +19879,6 @@ "version": "5.1.2", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dev": true, "dependencies": { "is-glob": "^4.0.1" }, @@ -19987,7 +19933,6 @@ "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", - "dev": true, "engines": { "node": ">=4" } @@ -21328,7 +21273,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -21358,7 +21302,6 @@ "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, "dependencies": { "is-extglob": "^2.1.1" }, @@ -21403,7 +21346,6 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true, "engines": { "node": ">=0.12.0" } @@ -22822,8 +22764,7 @@ "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==" }, "node_modules/js-yaml": { "version": "3.14.1", @@ -22998,7 +22939,6 @@ "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", - "dev": true, "bin": { "jsesc": "bin/jsesc" }, @@ -25201,7 +25141,6 @@ "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dev": true, "dependencies": { "yallist": "^3.0.2" } @@ -25659,7 +25598,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, "engines": { "node": ">= 8" } @@ -25713,7 +25651,6 @@ "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -26828,8 +26765,7 @@ "node_modules/node-releases": { "version": "2.0.13", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-2.0.13.tgz", - "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==", - "dev": true + "integrity": "sha512-uYr7J37ae/ORWdZeQ1xxMJe3NtdmqMC/JZK+geofDrkLUApKRHPd18/TxtBOJ4A0/+uUIliorNrfYV6s1b02eQ==" }, "node_modules/nodemailer": { "version": "6.9.4", @@ -28346,8 +28282,7 @@ "node_modules/picocolors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.0.tgz", - "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==", - "dev": true + "integrity": "sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==" }, "node_modules/picomatch": { "version": "2.3.1", @@ -30395,7 +30330,6 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, "funding": [ { "type": "github", @@ -31472,7 +31406,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, "funding": [ { "type": "github", @@ -34158,7 +34091,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", "integrity": "sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog==", - "dev": true, "engines": { "node": ">=4" } @@ -34167,7 +34099,6 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dev": true, "dependencies": { "is-number": "^7.0.0" }, @@ -35012,7 +34943,6 @@ "version": "1.0.13", "resolved": "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.0.13.tgz", "integrity": "sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==", - "dev": true, "funding": [ { "type": "opencollective", @@ -36665,8 +36595,7 @@ "node_modules/yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", - "dev": true + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" }, "node_modules/yaml": { "version": "2.3.2", diff --git a/packages/pieces/thinkific/.eslintrc.json b/packages/pieces/thinkific/.eslintrc.json new file mode 100644 index 0000000000..3230caf3d2 --- /dev/null +++ b/packages/pieces/thinkific/.eslintrc.json @@ -0,0 +1,25 @@ +{ + "extends": ["../../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.json"], + "parser": "jsonc-eslint-parser", + "rules": { + "@nx/dependency-checks": "error" + } + } + ] +} diff --git a/packages/pieces/thinkific/README.md b/packages/pieces/thinkific/README.md new file mode 100644 index 0000000000..d469f063bb --- /dev/null +++ b/packages/pieces/thinkific/README.md @@ -0,0 +1,7 @@ +# pieces-thinkific + +This library was generated with [Nx](https://nx.dev). + +## Building + +Run `nx build pieces-thinkific` to build the library. diff --git a/packages/pieces/thinkific/package.json b/packages/pieces/thinkific/package.json new file mode 100644 index 0000000000..dffdedf2ca --- /dev/null +++ b/packages/pieces/thinkific/package.json @@ -0,0 +1,4 @@ +{ + "name": "@activepieces/piece-thinkific", + "version": "0.0.1" +} diff --git a/packages/pieces/thinkific/project.json b/packages/pieces/thinkific/project.json new file mode 100644 index 0000000000..6c9eb3c852 --- /dev/null +++ b/packages/pieces/thinkific/project.json @@ -0,0 +1,44 @@ +{ + "name": "pieces-thinkific", + "$schema": "../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "packages/pieces/thinkific/src", + "projectType": "library", + "targets": { + "build": { + "executor": "@nx/js:tsc", + "outputs": [ + "{options.outputPath}" + ], + "options": { + "outputPath": "dist/packages/pieces/thinkific", + "tsConfig": "packages/pieces/thinkific/tsconfig.lib.json", + "packageJson": "packages/pieces/thinkific/package.json", + "main": "packages/pieces/thinkific/src/index.ts", + "assets": [ + "packages/pieces/thinkific/*.md" + ], + "buildableProjectDepsInPackageJsonType": "dependencies", + "updateBuildableProjectDepsInPackageJson": true + } + }, + "publish": { + "command": "node tools/scripts/publish.mjs pieces-thinkific {args.ver} {args.tag}", + "dependsOn": [ + "build" + ] + }, + "lint": { + "executor": "@nx/linter:eslint", + "outputs": [ + "{options.outputFile}" + ], + "options": { + "lintFilePatterns": [ + "packages/pieces/thinkific/**/*.ts", + "packages/pieces/thinkific/package.json" + ] + } + } + }, + "tags": [] +} \ No newline at end of file diff --git a/packages/pieces/thinkific/src/index.ts b/packages/pieces/thinkific/src/index.ts new file mode 100644 index 0000000000..5ac1015f1d --- /dev/null +++ b/packages/pieces/thinkific/src/index.ts @@ -0,0 +1,12 @@ + +import { createPiece, PieceAuth } from "@activepieces/pieces-framework"; + +export const thinkific = createPiece({ + displayName: "Thinkific", + auth: PieceAuth.None(), + minimumSupportedRelease: '0.9.0', + logoUrl: "https://cdn.activepieces.com/pieces/thinkific.png", + authors: [], + actions: [], + triggers: [], +}); diff --git a/packages/pieces/thinkific/src/lib/actions/enroll-user.ts b/packages/pieces/thinkific/src/lib/actions/enroll-user.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/thinkific/src/lib/actions/search-users.ts b/packages/pieces/thinkific/src/lib/actions/search-users.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/thinkific/src/lib/actions/unenroll-user.ts b/packages/pieces/thinkific/src/lib/actions/unenroll-user.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/thinkific/src/lib/triggers/course-completed.ts b/packages/pieces/thinkific/src/lib/triggers/course-completed.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/thinkific/src/lib/triggers/lesson-completed.ts b/packages/pieces/thinkific/src/lib/triggers/lesson-completed.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/thinkific/src/lib/triggers/new-free-preview-enrollment.ts b/packages/pieces/thinkific/src/lib/triggers/new-free-preview-enrollment.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/thinkific/src/lib/triggers/new-full-enrollment.ts b/packages/pieces/thinkific/src/lib/triggers/new-full-enrollment.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/thinkific/src/lib/triggers/new-order.ts b/packages/pieces/thinkific/src/lib/triggers/new-order.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/thinkific/src/lib/triggers/new-user.ts b/packages/pieces/thinkific/src/lib/triggers/new-user.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/thinkific/src/lib/triggers/subscription-cancelled.ts b/packages/pieces/thinkific/src/lib/triggers/subscription-cancelled.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/pieces/thinkific/tsconfig.json b/packages/pieces/thinkific/tsconfig.json new file mode 100644 index 0000000000..f2400abede --- /dev/null +++ b/packages/pieces/thinkific/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../../tsconfig.base.json", + "compilerOptions": { + "module": "commonjs", + "forceConsistentCasingInFileNames": true, + "strict": true, + "noImplicitOverride": true, + "noPropertyAccessFromIndexSignature": true, + "noImplicitReturns": true, + "noFallthroughCasesInSwitch": true + }, + "files": [], + "include": [], + "references": [ + { + "path": "./tsconfig.lib.json" + } + ] +} diff --git a/packages/pieces/thinkific/tsconfig.lib.json b/packages/pieces/thinkific/tsconfig.lib.json new file mode 100644 index 0000000000..e583571eac --- /dev/null +++ b/packages/pieces/thinkific/tsconfig.lib.json @@ -0,0 +1,11 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "commonjs", + "outDir": "../../../dist/out-tsc", + "declaration": true, + "types": ["node"] + }, + "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"], + "include": ["src/**/*.ts"] +} diff --git a/tsconfig.base.json b/tsconfig.base.json index bdd733266f..fa77180829 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -208,6 +208,9 @@ "@activepieces/piece-telegram-bot": [ "packages/pieces/telegram-bot/src/index.ts" ], + "@activepieces/piece-thinkific": [ + "packages/pieces/thinkific/src/index.ts" + ], "@activepieces/piece-tidycal": ["packages/pieces/tidycal/src/index.ts"], "@activepieces/piece-todoist": ["packages/pieces/todoist/src/index.ts"], "@activepieces/piece-trello": ["packages/pieces/trello/src/index.ts"],