@useairfoil/producer-shopify 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.txt +201 -0
- package/README.md +85 -248
- package/dist/index.d.mts +6993 -0
- package/dist/index.mjs +3 -0
- package/dist/main.d.mts +1 -0
- package/dist/main.mjs +700 -0
- package/dist/main.mjs.map +1 -0
- package/dist/manifest.d.mts +32 -0
- package/dist/manifest.mjs +51 -0
- package/dist/manifest.mjs.map +1 -0
- package/dist/{chunk-Bp6m_JJh.js → rolldown-runtime-D7D4PA-g.mjs} +4 -4
- package/dist/src-YBU_KSf5.mjs +2472 -0
- package/dist/src-YBU_KSf5.mjs.map +1 -0
- package/package.json +27 -27
- package/src/{auth.ts → api/auth.ts} +15 -35
- package/src/api/client.ts +429 -0
- package/src/api/graphql.ts +221 -0
- package/src/api/http.ts +25 -0
- package/src/connector.ts +266 -163
- package/src/create-table.ts +10 -0
- package/src/demo/customers.ts +412 -0
- package/src/demo/index.ts +31 -0
- package/src/demo/setup.ts +63 -0
- package/src/demo/shared.ts +114 -0
- package/src/index.ts +35 -21
- package/src/main.ts +14 -8
- package/src/manifest.ts +4 -55
- package/src/resources/carts/row.ts +82 -0
- package/src/resources/carts/webhook.ts +98 -0
- package/src/resources/customers/graphql.ts +175 -0
- package/src/resources/customers/row.ts +140 -0
- package/src/resources/customers/webhook.ts +30 -0
- package/src/resources/orders/graphql.ts +419 -0
- package/src/resources/orders/row.ts +306 -0
- package/src/resources/orders/webhook.ts +248 -0
- package/src/resources/products/graphql.ts +142 -0
- package/src/resources/products/row.ts +122 -0
- package/src/resources/products/webhook.ts +130 -0
- package/src/resources/refunds/graphql.ts +196 -0
- package/src/resources/refunds/row.ts +137 -0
- package/src/resources/refunds/webhook.ts +123 -0
- package/src/resources/shared.ts +300 -0
- package/src/sandbox.ts +3 -3
- package/src/start.ts +4 -6
- package/src/tables.ts +15 -0
- package/dist/index.d.ts +0 -965
- package/dist/index.js +0 -4
- package/dist/main.d.ts +0 -1
- package/dist/main.js +0 -49
- package/dist/main.js.map +0 -1
- package/dist/manifest-BFfx2LkS.js +0 -91
- package/dist/manifest-BFfx2LkS.js.map +0 -1
- package/dist/manifest-CPOEExQU.d.ts +0 -34
- package/dist/manifest.d.ts +0 -2
- package/dist/manifest.js +0 -3
- package/dist/src-DqmiLrYS.js +0 -984
- package/dist/src-DqmiLrYS.js.map +0 -1
- package/src/api.ts +0 -636
- package/src/schemas.ts +0 -319
- package/src/throttle.ts +0 -89
- package/src/transient-retry.ts +0 -74
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main.mjs","names":["ConnectorLayer","ShopifyConnector.layerConfig","TelemetryLayer","ShopifyConnector.ShopifyConnector","ShopifyConnector.layerConfig","ShopifyConnector.ShopifyConnector","packageJson.version"],"sources":["../package.json","../src/tables.ts","../src/create-table.ts","../src/demo/shared.ts","../src/demo/customers.ts","../src/demo/setup.ts","../src/demo/index.ts","../src/sandbox.ts","../src/start.ts","../src/main.ts"],"sourcesContent":["","import * as Schema from \"effect/Schema\";\n\nimport { CartSchema } from \"./resources/carts/row\";\nimport { CustomerSchema } from \"./resources/customers/row\";\nimport { OrderSchema } from \"./resources/orders/row\";\nimport { ProductSchema } from \"./resources/products/row\";\nimport { RefundSchema } from \"./resources/refunds/row\";\n\nexport const tableSchemas: Readonly<Record<string, Schema.Top>> = {\n products: ProductSchema,\n carts: CartSchema,\n customers: CustomerSchema,\n orders: OrderSchema,\n refunds: RefundSchema,\n};\n","import { ConnectorApp, RuntimeConfig } from \"@useairfoil/connector-kit\";\nimport { Command } from \"effect/cli\";\n\nimport { tableSchemas } from \"./tables\";\n\nexport const createTableCommand = ConnectorApp.makeCreateTableCommand(tableSchemas);\n\nexport const setupCommand = ConnectorApp.makeSetupCommand(tableSchemas).pipe(\n Command.provide(RuntimeConfig.layerHosted()),\n);\n","import type { Demo } from \"@useairfoil/connector-kit\";\n\nimport { Duration } from \"effect\";\n\nimport type { Cart } from \"../resources/carts/row\";\nimport type { Customer } from \"../resources/customers/row\";\nimport type { Order } from \"../resources/orders/row\";\nimport type { Refund } from \"../resources/refunds/row\";\n\nimport { type MoneyBag, normalizeAmount } from \"../resources/shared\";\n\nexport const hour = Duration.toMillis(Duration.hours(1));\nexport const day = Duration.toMillis(Duration.days(1));\nexport const vendor = \"Northwind Goods\";\nexport const taxRate = 0.08;\nexport const welcomeCode = \"WELCOME10\";\n\n// Amounts are in cents, weights in grams.\nexport const catalog = [\n {\n title: \"Classic Cotton Tee\",\n type: \"T-Shirts\",\n price: 2800,\n grams: 180,\n option: { name: \"Size\", values: [\"S\", \"M\", \"L\", \"XL\"] },\n },\n {\n title: \"Everyday Hoodie\",\n type: \"Sweatshirts\",\n price: 6400,\n grams: 520,\n option: { name: \"Size\", values: [\"S\", \"M\", \"L\", \"XL\"] },\n },\n {\n title: \"Linen Button Shirt\",\n type: \"Shirts\",\n price: 7200,\n grams: 260,\n option: { name: \"Size\", values: [\"S\", \"M\", \"L\"] },\n },\n {\n title: \"Wool Beanie\",\n type: \"Hats\",\n price: 2600,\n grams: 90,\n option: { name: \"Color\", values: [\"Charcoal\", \"Navy\", \"Rust\"] },\n },\n { title: \"Canvas Tote Bag\", type: \"Bags\", price: 2200, grams: 300, option: null },\n {\n title: \"Leather Card Wallet\",\n type: \"Accessories\",\n price: 5400,\n grams: 80,\n option: { name: \"Color\", values: [\"Black\", \"Tan\"] },\n },\n {\n title: \"Stoneware Mug\",\n type: \"Home\",\n price: 1800,\n grams: 400,\n option: { name: \"Color\", values: [\"Cream\", \"Sage\"] },\n },\n {\n title: \"Insulated Water Bottle\",\n type: \"Home\",\n price: 3200,\n grams: 450,\n option: { name: \"Color\", values: [\"Black\", \"White\", \"Sky\"] },\n },\n {\n title: \"Merino Running Socks\",\n type: \"Socks\",\n price: 1600,\n grams: 60,\n option: { name: \"Size\", values: [\"S/M\", \"L/XL\"] },\n },\n { title: \"Gift Card\", type: \"Gift Cards\", price: 5000, grams: 0, option: null },\n] as const;\n\ntype CatalogItem = (typeof catalog)[number];\n\n// Shopify IDs are numbers; each kind gets its own range.\nexport const productNumber = (p: number) => 8_100_000_000_000 + p;\nexport const variantNumber = (p: number, v: number) => 44_000_000_000_000 + p * 10 + v;\n\nexport const handleOf = (item: CatalogItem) => item.title.toLowerCase().replaceAll(\" \", \"-\");\nexport const isGiftCard = (item: CatalogItem) => item.type === \"Gift Cards\";\n\nexport const valuesOf = (item: CatalogItem): ReadonlyArray<string> =>\n item.option?.values ?? [\"Default Title\"];\n\nexport const money = (cents: number): MoneyBag => {\n const amount = normalizeAmount((cents / 100).toFixed(2));\n\n return {\n shopMoney: { amount, currencyCode: \"USD\" },\n presentmentMoney: { amount, currencyCode: \"USD\" },\n };\n};\n\nexport const amount = (cents: number) => normalizeAmount((cents / 100).toFixed(2));\n\n/** Date helpers for one run. `at` keeps a time from going past now. */\nexport const clock = ({ now }: Demo.DemoContext) => {\n const at = (time: number) => new Date(Math.min(time, now.getTime()));\n return { at };\n};\n\nexport type Rows = {\n readonly customers: Array<Customer>;\n readonly orders: Array<Order>;\n readonly refunds: Array<Refund>;\n readonly carts: Array<Cart>;\n};\n","import type { Demo } from \"@useairfoil/connector-kit\";\n\nimport { type Address, gid } from \"../resources/shared\";\nimport {\n amount,\n catalog,\n clock,\n day,\n handleOf,\n hour,\n isGiftCard,\n money,\n productNumber,\n type Rows,\n taxRate,\n valuesOf,\n variantNumber,\n vendor,\n welcomeCode,\n} from \"./shared\";\n\n/** One group is one customer with their orders, refunds, and sometimes an open cart. */\nexport const customerRows = (index: number, context: Demo.DemoContext): Rows => {\n const { faker, now } = context;\n const { at } = clock(context);\n\n const rows: Rows = { customers: [], orders: [], refunds: [], carts: [] };\n\n const customerNumber = 7_200_000_000_000 + index;\n const customerId = gid(\"Customer\", customerNumber);\n const addressId = gid(\"MailingAddress\", 9_300_000_000_000 + index);\n const firstName = faker.person.firstName();\n const lastName = faker.person.lastName();\n const email = faker.internet.exampleEmail({ firstName, lastName }).toLowerCase();\n const phone = faker.phone.number({ style: \"international\" });\n\n const address: Address = {\n firstName,\n lastName,\n name: `${firstName} ${lastName}`,\n company: null,\n address1: faker.location.streetAddress(),\n address2: null,\n city: faker.location.city(),\n province: faker.location.state(),\n provinceCode: faker.location.state({ abbreviated: true }),\n country: \"United States\",\n countryCode: \"US\",\n zip: faker.location.zipCode(\"#####\"),\n phone,\n latitude: faker.location.latitude(),\n longitude: faker.location.longitude(),\n };\n\n const subscribed = faker.datatype.boolean({ probability: 0.4 });\n const created = at(now.getTime() - faker.number.int({ min: 10 * day, max: 700 * day }));\n\n // Pick purchase times between signup and now, oldest first.\n const orderCount = faker.helpers.weightedArrayElement([\n { weight: 20, value: 0 },\n { weight: 40, value: 1 },\n { weight: 20, value: 2 },\n { weight: 10, value: 3 },\n { weight: 10, value: faker.number.int({ min: 4, max: 6 }) },\n ]);\n\n const orderTimes = Array.from({ length: orderCount }, () =>\n faker.date.between({ from: created, to: now }),\n ).toSorted((a, b) => a.getTime() - b.getTime());\n\n let spent = 0;\n let lastChange = created;\n\n orderTimes.forEach((orderCreated, n) => {\n const orderNumber = 5_600_000_000_000 + index * 10 + n;\n const orderId = gid(\"Order\", orderNumber);\n const saleId = gid(\"OrderTransaction\", 6_700_000_000_000 + (index * 10 + n) * 2);\n const discounted = n === 0 && faker.datatype.boolean({ probability: 0.25 });\n\n const picks = faker.helpers.arrayElements(\n catalog.map((item, p) => ({ item, p })),\n { min: 1, max: 3 },\n );\n\n const lines = picks.map(({ item, p }, k) => {\n const v = faker.number.int({ max: valuesOf(item).length - 1 });\n const quantity = isGiftCard(item) ? 1 : faker.number.int({ min: 1, max: 2 });\n const gross = item.price * quantity;\n const discount = discounted ? Math.round(gross * 0.1) : 0;\n const tax = isGiftCard(item) ? 0 : Math.round((gross - discount) * taxRate);\n\n return { item, p, v, k, quantity, gross, discount, tax };\n });\n\n const discountTotal = lines.reduce((sum, line) => sum + line.discount, 0);\n const subtotal = lines.reduce((sum, line) => sum + line.gross - line.discount, 0);\n const tax = lines.reduce((sum, line) => sum + line.tax, 0);\n const shipping = lines.every((line) => isGiftCard(line.item)) || subtotal >= 7500 ? 0 : 600;\n const total = subtotal + shipping + tax;\n const grams = lines.reduce((sum, line) => sum + line.item.grams * line.quantity, 0);\n\n const cancelled = faker.datatype.boolean({ probability: 0.03 });\n\n const refund = cancelled\n ? null\n : faker.helpers.maybe(() => faker.helpers.arrayElement([\"full\", \"partial\"] as const), {\n probability: 0.06,\n });\n\n const refundedLines = refund === \"full\" ? lines : refund === \"partial\" ? lines.slice(0, 1) : [];\n const refundShipping = refund === \"full\" ? shipping : 0;\n\n const refundedSubtotal = refundedLines.reduce(\n (sum, line) => sum + line.gross - line.discount,\n 0,\n );\n\n const refundedTax = refundedLines.reduce((sum, line) => sum + line.tax, 0);\n const refundedTotal = refundedSubtotal + refundedTax + refundShipping;\n\n const cancelledAt = cancelled\n ? at(orderCreated.getTime() + faker.number.int({ min: 60_000, max: day }))\n : null;\n\n const refundAt = refund\n ? at(orderCreated.getTime() + faker.number.int({ min: 3 * day, max: 20 * day }))\n : null;\n\n const fulfilled = orderCreated.getTime() < now.getTime() - 5 * day;\n\n const closedAt =\n cancelledAt ??\n (fulfilled\n ? at(orderCreated.getTime() + faker.number.int({ min: 2 * day, max: 5 * day }))\n : null);\n\n const updatedAt = new Date(\n Math.max(orderCreated.getTime(), closedAt?.getTime() ?? 0, refundAt?.getTime() ?? 0),\n );\n\n const current = cancelled ? 0 : 1;\n const currentSubtotal = (subtotal - refundedSubtotal) * current;\n const currentTax = (tax - refundedTax) * current;\n const currentShipping = (shipping - refundShipping) * current;\n const currentTotal = currentSubtotal + currentTax + currentShipping;\n spent += currentTotal;\n lastChange = updatedAt > lastChange ? updatedAt : lastChange;\n\n const shippingLineId = gid(\"ShippingLine\", 4_500_000_000_000 + index * 10 + n);\n\n rows.orders.push({\n id: orderId,\n legacyResourceId: String(orderNumber),\n name: `#${1001 + index * 10 + n}`,\n email,\n phone,\n customerId,\n customerLocale: \"en\",\n customerAcceptsMarketing: subscribed,\n billingAddress: address,\n shippingAddress: lines.every((line) => isGiftCard(line.item)) ? null : address,\n note: \"\",\n customAttributes: [],\n tags: [],\n confirmationNumber: faker.string.alphanumeric({ length: 9, casing: \"upper\" }),\n poNumber: \"\",\n sourceName: \"web\",\n sourceIdentifier: \"\",\n // The Online Store sales channel.\n appId: gid(\"App\", 580111),\n paymentGatewayNames: [\"shopify_payments\"],\n test: false,\n taxesIncluded: false,\n taxExempt: false,\n dutiesIncluded: false,\n estimatedTaxes: false,\n totalWeight: grams,\n displayFinancialStatus: cancelled\n ? \"VOIDED\"\n : refund === \"full\"\n ? \"REFUNDED\"\n : refund === \"partial\"\n ? \"PARTIALLY_REFUNDED\"\n : \"PAID\",\n cancelReason: cancelled ? \"CUSTOMER\" : null,\n cancelledAt,\n closedAt,\n processedAt: orderCreated,\n createdAt: orderCreated,\n updatedAt,\n currencyCode: \"USD\",\n presentmentCurrencyCode: \"USD\",\n discountCodes: discounted ? [welcomeCode] : [],\n discountApplications: discounted\n ? [\n {\n index: 0,\n type: \"DISCOUNT_CODE\",\n code: welcomeCode,\n title: null,\n description: null,\n allocationMethod: \"ACROSS\",\n targetSelection: \"ALL\",\n targetType: \"LINE_ITEM\",\n valueType: \"PERCENTAGE\",\n value: \"10\",\n },\n ]\n : [],\n subtotalPriceSet: money(subtotal),\n currentSubtotalPriceSet: money(currentSubtotal),\n totalDiscountsSet: money(discountTotal),\n currentTotalDiscountsSet: money(discountTotal * current),\n totalShippingPriceSet: money(shipping),\n currentShippingPriceSet: money(currentShipping),\n totalTaxSet: money(tax),\n currentTotalTaxSet: money(currentTax),\n originalTotalDutiesSet: null,\n currentTotalDutiesSet: null,\n totalPriceSet: money(total),\n currentTotalPriceSet: money(currentTotal),\n taxLines: tax > 0 ? [{ title: \"Sales Tax\", rate: taxRate, priceSet: money(tax) }] : [],\n shippingLines:\n shipping === 0 && lines.every((line) => isGiftCard(line.item))\n ? []\n : [\n {\n id: shippingLineId,\n title: shipping === 0 ? \"Free Shipping\" : \"Standard Shipping\",\n code: shipping === 0 ? \"Free Shipping\" : \"Standard Shipping\",\n source: \"shopify\",\n carrierIdentifier: null,\n phone: null,\n isRemoved: false,\n originalPriceSet: money(shipping),\n discountedPriceSet: money(shipping),\n currentDiscountedPriceSet: money(currentShipping),\n taxLines: [],\n discountAllocations: [],\n },\n ],\n lineItems: lines.map((line) => {\n const value = valuesOf(line.item)[line.v] ?? \"Default Title\";\n const refundedQuantity = refundedLines.includes(line) ? line.quantity : 0;\n\n return {\n id: gid(\"LineItem\", 14_000_000_000_000 + (index * 10 + n) * 10 + line.k),\n name: line.item.option ? `${line.item.title} - ${value}` : line.item.title,\n title: line.item.title,\n variantTitle: line.item.option ? value : null,\n sku: `NW-${handleOf(line.item).toUpperCase()}-${value.replace(\"/\", \"\").toUpperCase()}`,\n vendor,\n productId: gid(\"Product\", productNumber(line.p)),\n variantId: gid(\"ProductVariant\", variantNumber(line.p, line.v)),\n quantity: line.quantity,\n currentQuantity: (line.quantity - refundedQuantity) * current,\n taxable: !isGiftCard(line.item),\n requiresShipping: !isGiftCard(line.item),\n isGiftCard: isGiftCard(line.item),\n originalUnitPriceSet: money(line.item.price),\n totalDiscountSet: money(line.discount),\n taxLines:\n line.tax > 0 ? [{ title: \"Sales Tax\", rate: taxRate, priceSet: money(line.tax) }] : [],\n discountAllocations: discounted\n ? [{ discountApplicationIndex: 0, amountSet: money(line.discount) }]\n : [],\n customAttributes: [],\n };\n }),\n });\n\n if (refund && refundAt) {\n const refundNumber = 1_000_000_000_000 + index * 10 + n;\n\n rows.refunds.push({\n id: gid(\"Refund\", refundNumber),\n legacyResourceId: String(refundNumber),\n orderId,\n note: refund === \"full\" ? \"Returned by customer\" : \"\",\n createdAt: refundAt,\n processedAt: refundAt,\n transactions: [\n {\n id: gid(\"OrderTransaction\", 6_700_000_000_000 + (index * 10 + n) * 2 + 1),\n kind: \"REFUND\",\n status: \"SUCCESS\",\n amount: amount(refundedTotal),\n currencyCode: \"USD\",\n gateway: \"shopify_payments\",\n test: false,\n errorCode: null,\n parentTransactionId: saleId,\n createdAt: refundAt,\n processedAt: refundAt,\n },\n ],\n refundLineItems: refundedLines.map((line) => ({\n id: gid(\"RefundLineItem\", 2_000_000_000_000 + (index * 10 + n) * 10 + line.k),\n lineItemId: gid(\"LineItem\", 14_000_000_000_000 + (index * 10 + n) * 10 + line.k),\n quantity: line.quantity,\n restockType: \"RETURN\",\n locationId: gid(\"Location\", 64_000_000_001),\n subtotalSet: money(line.gross - line.discount),\n totalTaxSet: money(line.tax),\n })),\n refundShippingLines:\n refundShipping > 0\n ? [\n {\n id: gid(\"RefundShippingLine\", 3_000_000_000_000 + index * 10 + n),\n shippingLineId,\n subtotalAmountSet: money(refundShipping),\n },\n ]\n : [],\n orderAdjustments: [],\n duties: [],\n });\n }\n });\n\n // Some shoppers leave a cart behind.\n if (faker.datatype.boolean({ probability: 0.25 })) {\n const token = `c1-${index.toString(16).padStart(8, \"0\")}${faker.string.hexadecimal({ length: 24, casing: \"lower\", prefix: \"\" })}`;\n const cartCreated = at(now.getTime() - faker.number.int({ min: hour, max: 7 * day }));\n\n rows.carts.push({\n id: token,\n token,\n topic: \"carts/update\",\n lineItems: faker.helpers\n .arrayElements(\n catalog.map((item, p) => ({ item, p })),\n { min: 1, max: 2 },\n )\n .map(({ item, p }) => {\n const v = faker.number.int({ max: valuesOf(item).length - 1 });\n const quantity = faker.number.int({ min: 1, max: 2 });\n const variant = variantNumber(p, v);\n\n return {\n id: String(variant),\n properties: null,\n quantity,\n variantId: gid(\"ProductVariant\", variant),\n key: `${variant}:${faker.string.hexadecimal({ length: 32, casing: \"lower\", prefix: \"\" })}`,\n discountedPrice: amount(item.price),\n discounts: \"[]\",\n giftCard: isGiftCard(item),\n grams: item.grams,\n linePrice: amount(item.price * quantity),\n originalLinePrice: amount(item.price * quantity),\n originalPrice: amount(item.price),\n price: amount(item.price),\n productId: gid(\"Product\", productNumber(p)),\n sku: `NW-${handleOf(item).toUpperCase()}-${(valuesOf(item)[v] ?? \"\").replace(\"/\", \"\").toUpperCase()}`,\n taxable: !isGiftCard(item),\n title: item.title,\n totalDiscount: \"0\",\n vendor,\n discountedPriceSet: money(item.price),\n linePriceSet: money(item.price * quantity),\n originalLinePriceSet: money(item.price * quantity),\n priceSet: money(item.price),\n totalDiscountSet: money(0),\n parentRelationship: null,\n };\n }),\n note: \"\",\n updatedAt: at(cartCreated.getTime() + faker.number.int({ min: 0, max: hour })),\n createdAt: cartCreated,\n });\n }\n\n const subscribedAt = subscribed ? created : null;\n\n rows.customers.push({\n id: customerId,\n legacyResourceId: String(customerNumber),\n firstName,\n lastName,\n displayName: `${firstName} ${lastName}`,\n email,\n emailMarketingState: subscribed ? \"SUBSCRIBED\" : \"NOT_SUBSCRIBED\",\n emailMarketingOptInLevel: subscribed ? \"SINGLE_OPT_IN\" : null,\n emailMarketingUpdatedAt: subscribedAt,\n phone,\n smsMarketingState: \"NOT_SUBSCRIBED\",\n smsMarketingOptInLevel: null,\n smsMarketingUpdatedAt: null,\n smsMarketingCollectedFrom: null,\n note: \"\",\n state: orderCount > 0 ? \"ENABLED\" : \"DISABLED\",\n verifiedEmail: true,\n taxExempt: false,\n taxExemptions: [],\n tags: orderCount >= 3 ? [\"repeat\"] : [],\n locale: \"en\",\n numberOfOrders: orderCount,\n amountSpent: { amount: amount(spent), currencyCode: \"USD\" },\n lastOrderId:\n orderCount > 0 ? gid(\"Order\", 5_600_000_000_000 + index * 10 + orderCount - 1) : \"\",\n productSubscriberStatus: \"NEVER_SUBSCRIBED\",\n dataSaleOptOut: false,\n defaultAddressId: addressId,\n addresses: [{ id: addressId, ...address }],\n createdAt: created,\n updatedAt: lastChange,\n });\n\n return rows;\n};\n","import type { Demo } from \"@useairfoil/connector-kit\";\n\nimport type { Product } from \"../resources/products/row\";\n\nimport { gid } from \"../resources/shared\";\nimport {\n amount,\n catalog,\n day,\n handleOf,\n isGiftCard,\n productNumber,\n valuesOf,\n variantNumber,\n vendor,\n} from \"./shared\";\n\n/** The product catalog, written once before any customer. */\nexport const setupRows = ({ now }: Demo.DemoContext) => {\n const created = new Date(now.getTime() - 800 * day);\n\n const products: Array<Product> = catalog.map((item, p) => ({\n id: gid(\"Product\", productNumber(p)),\n legacyResourceId: String(productNumber(p)),\n title: item.title,\n handle: handleOf(item),\n descriptionHtml: `<p>The ${item.title.toLowerCase()} from ${vendor}.</p>`,\n productType: item.type,\n vendor,\n status: \"ACTIVE\",\n tags: [item.type.toLowerCase()],\n createdAt: created,\n updatedAt: created,\n publishedAt: created,\n templateSuffix: \"\",\n featuredMedia: {\n image: { url: `https://demo.example.com/images/${handleOf(item)}.jpg`, altText: item.title },\n },\n options: [\n {\n id: gid(\"ProductOption\", productNumber(p)),\n name: item.option?.name ?? \"Title\",\n position: 1,\n values: valuesOf(item),\n },\n ],\n variants: valuesOf(item).map((value, v) => ({\n id: gid(\"ProductVariant\", variantNumber(p, v)),\n legacyResourceId: String(variantNumber(p, v)),\n title: value,\n sku: `NW-${handleOf(item).toUpperCase()}-${value.replace(\"/\", \"\").toUpperCase()}`,\n barcode: null,\n price: amount(item.price),\n compareAtPrice: null,\n inventoryPolicy: \"DENY\",\n taxable: !isGiftCard(item),\n createdAt: created,\n updatedAt: created,\n })),\n }));\n\n return { products };\n};\n","import { ConnectorApp, Demo, RuntimeConfig } from \"@useairfoil/connector-kit\";\nimport { Command } from \"effect/cli\";\n\nimport { CartSchema } from \"../resources/carts/row\";\nimport { CustomerSchema } from \"../resources/customers/row\";\nimport { OrderSchema } from \"../resources/orders/row\";\nimport { ProductSchema } from \"../resources/products/row\";\nimport { RefundSchema } from \"../resources/refunds/row\";\nimport { customerRows } from \"./customers\";\nimport { setupRows } from \"./setup\";\n\nexport const demo = Demo.define({\n name: \"producer-shopify\",\n setup: {\n tables: [Demo.table({ name: \"products\", rowSchema: ProductSchema, version: \"updatedAt\" })],\n rows: setupRows,\n },\n group: {\n tables: [\n Demo.table({ name: \"customers\", rowSchema: CustomerSchema, version: \"updatedAt\" }),\n Demo.table({ name: \"orders\", rowSchema: OrderSchema, version: \"updatedAt\" }),\n Demo.table({ name: \"refunds\", rowSchema: RefundSchema, version: \"processedAt\" }),\n Demo.table({ name: \"carts\", rowSchema: CartSchema, version: \"updatedAt\" }),\n ],\n rows: customerRows,\n },\n});\n\nexport const demoCommand = ConnectorApp.makeDemoCommand(demo).pipe(\n Command.provide(RuntimeConfig.layerHosted()),\n);\n","import {\n ConnectorApp,\n Ingestor,\n RuntimeConfig,\n StateStore,\n Telemetry,\n} from \"@useairfoil/connector-kit\";\nimport { Effect, Layer, Logger } from \"effect\";\nimport { Command } from \"effect/cli\";\n\nimport { ShopifyConnector } from \"./index\";\n\nconst ConnectorLayer = ShopifyConnector.layerConfig(ShopifyConnector.ShopifyConfigDef.config);\n\nconst TelemetryLayer = Layer.mergeAll(\n Telemetry.layerOtlp({ redactedHeaders: [\"x-shopify-access-token\"] }),\n Telemetry.layerMetricsConsoleDump(),\n);\n\nexport const sandboxCommand = Command.make(\"sandbox\", {}, () =>\n Effect.gen(function* () {\n const port = yield* RuntimeConfig.httpPort;\n const entrypoint = yield* ShopifyConnector.ShopifyConnector;\n\n return yield* ConnectorApp.start(entrypoint, { port });\n }).pipe(\n Effect.annotateLogs({ component: \"producer-shopify\" }),\n Effect.provide(\n Layer.mergeAll(\n StateStore.layerMemory,\n Ingestor.layerConsole,\n ConnectorLayer,\n Logger.layer([Logger.consolePretty()]),\n TelemetryLayer,\n ),\n ),\n ),\n).pipe(Command.withDescription(\"Run the connector locally and log ingested data\"));\n","import { PgClient } from \"@effect/sql-pg\";\nimport {\n ConnectorApp,\n Ingestor,\n RuntimeConfig,\n StateStore,\n Telemetry,\n} from \"@useairfoil/connector-kit\";\nimport { Config, Effect, Layer, Logger, Schema } from \"effect\";\nimport { Command } from \"effect/cli\";\n\nimport { ShopifyConnector } from \"./index\";\n\nconst ConnectorLayer = ShopifyConnector.layerConfig(ShopifyConnector.ShopifyConfigDef.config);\n\nconst TelemetryLayer = Telemetry.layerOtlp({\n redactedHeaders: [\"x-shopify-access-token\"],\n});\nconst PostgresLayer = PgClient.layerConfig({\n url: Config.schema(\n Schema.Redacted(Schema.NonEmptyString),\n RuntimeConfig.PlatformRuntimeKey.postgresConnectionString,\n ),\n maxConnections: Config.succeed(2),\n connectTimeout: Config.succeed(\"5 seconds\"),\n applicationName: Config.succeed(\"airfoil-producer-shopify\"),\n});\nconst StateStoreLayer = StateStore.layerSql().pipe(Layer.provide(PostgresLayer));\n\nexport const startCommand = Command.make(\"start\", {}, () =>\n Effect.gen(function* () {\n const port = yield* RuntimeConfig.httpPort;\n const entrypoint = yield* ShopifyConnector.ShopifyConnector;\n\n return yield* ConnectorApp.start(entrypoint, { port }).pipe(\n Effect.provide(Ingestor.layerArrowFlightConfig(entrypoint)),\n );\n }).pipe(\n Effect.annotateLogs({ component: \"producer-shopify\" }),\n Effect.provide(\n Layer.mergeAll(\n StateStoreLayer,\n ConnectorLayer,\n Logger.layer([Logger.consolePretty()]),\n TelemetryLayer,\n ),\n ),\n Effect.provide(RuntimeConfig.layerHosted()),\n ),\n).pipe(Command.withDescription(\"Run the connector\"));\n","import { NodeRuntime, NodeServices } from \"@effect/platform-node\";\nimport { Effect, Layer } from \"effect\";\nimport { Command } from \"effect/cli\";\nimport { FetchHttpClient } from \"effect/http\";\n\nimport packageJson from \"../package.json\";\nimport { createTableCommand, setupCommand } from \"./create-table\";\nimport { demoCommand } from \"./demo\";\nimport { sandboxCommand } from \"./sandbox\";\nimport { startCommand } from \"./start\";\n\nconst BootstrapLayer = Layer.mergeAll(FetchHttpClient.layer, NodeServices.layer);\n\nconst program = Command.make(\"producer-shopify\", {}, () => Effect.void).pipe(\n Command.withSubcommands([\n setupCommand,\n startCommand,\n sandboxCommand,\n createTableCommand,\n demoCommand,\n ]),\n);\n\nconst cli = Command.run(program, { version: packageJson.version });\n\nNodeRuntime.runMain(cli.pip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Ac,GAAG,OAAO,MAAM,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as Manifest from "@useairfoil/connector-kit/manifest";
|
|
2
|
+
//#region src/manifest.d.ts
|
|
3
|
+
export declare const ShopifyConfigDef: Manifest.ConnectorConfigDef<{
|
|
4
|
+
readonly shopDomain: Manifest.ConfigField<string>;
|
|
5
|
+
readonly clientId: Manifest.ConfigField<string>;
|
|
6
|
+
readonly clientSecret: Manifest.ConfigField<import("effect/Redacted").Redacted<string>>;
|
|
7
|
+
readonly webhookSecret: Manifest.ConfigField<import("effect/Redacted").Redacted<string>>;
|
|
8
|
+
}>;
|
|
9
|
+
export type ShopifyConfig = Manifest.ConfigValuesOf<typeof ShopifyConfigDef>;
|
|
10
|
+
export declare const manifest: {
|
|
11
|
+
readonly name: "producer-shopify";
|
|
12
|
+
readonly title: "Shopify";
|
|
13
|
+
readonly config: readonly Manifest.ConfigFieldSpec[];
|
|
14
|
+
readonly resources: readonly [{
|
|
15
|
+
readonly name: "products";
|
|
16
|
+
readonly capabilities: readonly ["backfill", "webhook"];
|
|
17
|
+
}, {
|
|
18
|
+
readonly name: "carts";
|
|
19
|
+
readonly capabilities: readonly ["webhook"];
|
|
20
|
+
}, {
|
|
21
|
+
readonly name: "customers";
|
|
22
|
+
readonly capabilities: readonly ["backfill", "webhook"];
|
|
23
|
+
}, {
|
|
24
|
+
readonly name: "orders";
|
|
25
|
+
readonly capabilities: readonly ["backfill", "webhook"];
|
|
26
|
+
}, {
|
|
27
|
+
readonly name: "refunds";
|
|
28
|
+
readonly capabilities: readonly ["backfill", "webhook"];
|
|
29
|
+
}];
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
//# sourceMappingURL=manifest.d.mts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import * as Manifest from "@useairfoil/connector-kit/manifest";
|
|
2
|
+
//#region src/manifest.ts
|
|
3
|
+
const ShopifyConfigDef = Manifest.defineConfig({
|
|
4
|
+
shopDomain: Manifest.string({
|
|
5
|
+
runtimeKey: "SHOPIFY_SHOP_DOMAIN",
|
|
6
|
+
description: "Shopify shop domain, for example example.myshopify.com."
|
|
7
|
+
}),
|
|
8
|
+
clientId: Manifest.string({
|
|
9
|
+
runtimeKey: "SHOPIFY_CLIENT_ID",
|
|
10
|
+
description: "Client ID for the merchant-owned Shopify Dev Dashboard app."
|
|
11
|
+
}),
|
|
12
|
+
clientSecret: Manifest.secret({
|
|
13
|
+
runtimeKey: "SHOPIFY_CLIENT_SECRET",
|
|
14
|
+
description: "Client secret for the merchant-owned Shopify Dev Dashboard app."
|
|
15
|
+
}),
|
|
16
|
+
webhookSecret: Manifest.secret({
|
|
17
|
+
runtimeKey: "SHOPIFY_WEBHOOK_SECRET",
|
|
18
|
+
description: "Shopify webhook HMAC secret."
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
const manifest = Manifest.define({
|
|
22
|
+
name: "producer-shopify",
|
|
23
|
+
title: "Shopify",
|
|
24
|
+
config: ShopifyConfigDef.spec,
|
|
25
|
+
resources: [
|
|
26
|
+
{
|
|
27
|
+
name: "products",
|
|
28
|
+
capabilities: ["backfill", "webhook"]
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: "carts",
|
|
32
|
+
capabilities: ["webhook"]
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "customers",
|
|
36
|
+
capabilities: ["backfill", "webhook"]
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: "orders",
|
|
40
|
+
capabilities: ["backfill", "webhook"]
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "refunds",
|
|
44
|
+
capabilities: ["backfill", "webhook"]
|
|
45
|
+
}
|
|
46
|
+
]
|
|
47
|
+
});
|
|
48
|
+
//#endregion
|
|
49
|
+
export { ShopifyConfigDef, manifest };
|
|
50
|
+
|
|
51
|
+
//# sourceMappingURL=manifest.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manifest.mjs","names":[],"sources":["../src/manifest.ts"],"sourcesContent":["import * as Manifest from \"@useairfoil/connector-kit/manifest\";\n\nexport const ShopifyConfigDef = Manifest.defineConfig({\n shopDomain: Manifest.string({\n runtimeKey: \"SHOPIFY_SHOP_DOMAIN\",\n description: \"Shopify shop domain, for example example.myshopify.com.\",\n }),\n clientId: Manifest.string({\n runtimeKey: \"SHOPIFY_CLIENT_ID\",\n description: \"Client ID for the merchant-owned Shopify Dev Dashboard app.\",\n }),\n clientSecret: Manifest.secret({\n runtimeKey: \"SHOPIFY_CLIENT_SECRET\",\n description: \"Client secret for the merchant-owned Shopify Dev Dashboard app.\",\n }),\n webhookSecret: Manifest.secret({\n runtimeKey: \"SHOPIFY_WEBHOOK_SECRET\",\n description: \"Shopify webhook HMAC secret.\",\n }),\n});\n\nexport type ShopifyConfig = Manifest.ConfigValuesOf<typeof ShopifyConfigDef>;\n\nexport const manifest = Manifest.define({\n name: \"producer-shopify\",\n title: \"Shopify\",\n config: ShopifyConfigDef.spec,\n resources: [\n { name: \"products\", capabilities: [\"backfill\", \"webhook\"] },\n { name: \"carts\", capabilities: [\"webhook\"] },\n { name: \"customers\", capabilities: [\"backfill\", \"webhook\"] },\n { name: \"orders\", capabilities: [\"backfill\", \"webhook\"] },\n { name: \"refunds\", capabilities: [\"backfill\", \"webhook\"] },\n ],\n});\n"],"mappings":";;AAEA,MAAa,mBAAmB,SAAS,aAAa;CACpD,YAAY,SAAS,OAAO;EAC1B,YAAY;EACZ,aAAa;CACf,CAAC;CACD,UAAU,SAAS,OAAO;EACxB,YAAY;EACZ,aAAa;CACf,CAAC;CACD,cAAc,SAAS,OAAO;EAC5B,YAAY;EACZ,aAAa;CACf,CAAC;CACD,eAAe,SAAS,OAAO;EAC7B,YAAY;EACZ,aAAa;CACf,CAAC;AACH,CAAC;AAID,MAAa,WAAW,SAAS,OAAO;CACtC,MAAM;CACN,OAAO;CACP,QAAQ,iBAAiB;CACzB,WAAW;EACT;GAAE,MAAM;GAAY,cAAc,CAAC,YAAY,SAAS;EAAE;EAC1D;GAAE,MAAM;GAAS,cAAc,CAAC,SAAS;EAAE;EAC3C;GAAE,MAAM;GAAa,cAAc,CAAC,YAAY,SAAS;EAAE;EAC3D;GAAE,MAAM;GAAU,cAAc,CAAC,YAAY,SAAS;EAAE;EACxD;GAAE,MAAM;GAAW,cAAc,CAAC,YAAY,SAAS;EAAE;CAC3D;AACF,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
//#region
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
|
-
var
|
|
3
|
+
var __exportAll = (all, no_symbols) => {
|
|
4
4
|
let target = {};
|
|
5
5
|
for (var name in all) __defProp(target, name, {
|
|
6
6
|
get: all[name],
|
|
7
7
|
enumerable: true
|
|
8
8
|
});
|
|
9
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
9
10
|
return target;
|
|
10
11
|
};
|
|
11
|
-
|
|
12
12
|
//#endregion
|
|
13
|
-
export {
|
|
13
|
+
export { __exportAll as t };
|