shop-cli 0.1.1
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 +21 -0
- package/README.md +392 -0
- package/bin/shop-cli.js +17 -0
- package/bin/shop.js +16 -0
- package/dist/adminClient.d.ts +34 -0
- package/dist/adminClient.js +144 -0
- package/dist/cli/client.d.ts +10 -0
- package/dist/cli/client.js +56 -0
- package/dist/cli/command.d.ts +5 -0
- package/dist/cli/command.js +62 -0
- package/dist/cli/errors.d.ts +4 -0
- package/dist/cli/errors.js +35 -0
- package/dist/cli/gid.d.ts +3 -0
- package/dist/cli/gid.js +42 -0
- package/dist/cli/globalFlags.d.ts +15 -0
- package/dist/cli/globalFlags.js +100 -0
- package/dist/cli/headers.d.ts +2 -0
- package/dist/cli/headers.js +79 -0
- package/dist/cli/help/format.d.ts +8 -0
- package/dist/cli/help/format.js +78 -0
- package/dist/cli/help/registry.d.ts +5 -0
- package/dist/cli/help/registry.js +6443 -0
- package/dist/cli/help/render.d.ts +8 -0
- package/dist/cli/help/render.js +399 -0
- package/dist/cli/help/spec.d.ts +39 -0
- package/dist/cli/help/spec.js +17 -0
- package/dist/cli/input.d.ts +9 -0
- package/dist/cli/input.js +104 -0
- package/dist/cli/introspection/deprecations.d.ts +1 -0
- package/dist/cli/introspection/deprecations.js +83 -0
- package/dist/cli/introspection/format.d.ts +6 -0
- package/dist/cli/introspection/format.js +63 -0
- package/dist/cli/introspection/index.d.ts +14 -0
- package/dist/cli/introspection/index.js +89 -0
- package/dist/cli/introspection/resources.d.ts +1 -0
- package/dist/cli/introspection/resources.js +127 -0
- package/dist/cli/output/computedFields.d.ts +39 -0
- package/dist/cli/output/computedFields.js +104 -0
- package/dist/cli/output.d.ts +37 -0
- package/dist/cli/output.js +332 -0
- package/dist/cli/parse-command.d.ts +18 -0
- package/dist/cli/parse-command.js +109 -0
- package/dist/cli/router.d.ts +29 -0
- package/dist/cli/router.js +480 -0
- package/dist/cli/selection/buildAllSelection.d.ts +13 -0
- package/dist/cli/selection/buildAllSelection.js +108 -0
- package/dist/cli/selection/graphqlSelection.d.ts +5 -0
- package/dist/cli/selection/graphqlSelection.js +301 -0
- package/dist/cli/selection/select.d.ts +13 -0
- package/dist/cli/selection/select.js +136 -0
- package/dist/cli/selection/stripDeprecated.d.ts +2 -0
- package/dist/cli/selection/stripDeprecated.js +63 -0
- package/dist/cli/suggest.d.ts +5 -0
- package/dist/cli/suggest.js +88 -0
- package/dist/cli/userErrors.d.ts +4 -0
- package/dist/cli/userErrors.js +41 -0
- package/dist/cli/verbs/_shared.d.ts +38 -0
- package/dist/cli/verbs/_shared.js +181 -0
- package/dist/cli/verbs/abandoned-checkouts.d.ts +6 -0
- package/dist/cli/verbs/abandoned-checkouts.js +259 -0
- package/dist/cli/verbs/app-billing.d.ts +6 -0
- package/dist/cli/verbs/app-billing.js +452 -0
- package/dist/cli/verbs/apps.d.ts +6 -0
- package/dist/cli/verbs/apps.js +296 -0
- package/dist/cli/verbs/articles.d.ts +6 -0
- package/dist/cli/verbs/articles.js +251 -0
- package/dist/cli/verbs/backup.d.ts +6 -0
- package/dist/cli/verbs/backup.js +94 -0
- package/dist/cli/verbs/blogs.d.ts +6 -0
- package/dist/cli/verbs/blogs.js +273 -0
- package/dist/cli/verbs/bulk-operations.d.ts +6 -0
- package/dist/cli/verbs/bulk-operations.js +272 -0
- package/dist/cli/verbs/business-entities.d.ts +6 -0
- package/dist/cli/verbs/business-entities.js +102 -0
- package/dist/cli/verbs/carrier-services.d.ts +6 -0
- package/dist/cli/verbs/carrier-services.js +195 -0
- package/dist/cli/verbs/cart-transforms.d.ts +6 -0
- package/dist/cli/verbs/cart-transforms.js +141 -0
- package/dist/cli/verbs/cash-tracking.d.ts +6 -0
- package/dist/cli/verbs/cash-tracking.js +118 -0
- package/dist/cli/verbs/catalogs.d.ts +6 -0
- package/dist/cli/verbs/catalogs.js +267 -0
- package/dist/cli/verbs/channels.d.ts +6 -0
- package/dist/cli/verbs/channels.js +120 -0
- package/dist/cli/verbs/checkout-branding.d.ts +6 -0
- package/dist/cli/verbs/checkout-branding.js +144 -0
- package/dist/cli/verbs/checkout-profiles.d.ts +6 -0
- package/dist/cli/verbs/checkout-profiles.js +124 -0
- package/dist/cli/verbs/collections.d.ts +6 -0
- package/dist/cli/verbs/collections.js +620 -0
- package/dist/cli/verbs/comments.d.ts +6 -0
- package/dist/cli/verbs/comments.js +160 -0
- package/dist/cli/verbs/companies.d.ts +6 -0
- package/dist/cli/verbs/companies.js +313 -0
- package/dist/cli/verbs/company-contacts.d.ts +6 -0
- package/dist/cli/verbs/company-contacts.js +318 -0
- package/dist/cli/verbs/company-locations.d.ts +6 -0
- package/dist/cli/verbs/company-locations.js +467 -0
- package/dist/cli/verbs/customer-account-pages.d.ts +6 -0
- package/dist/cli/verbs/customer-account-pages.js +97 -0
- package/dist/cli/verbs/customer-payment-methods.d.ts +6 -0
- package/dist/cli/verbs/customer-payment-methods.js +358 -0
- package/dist/cli/verbs/customer-privacy.d.ts +6 -0
- package/dist/cli/verbs/customer-privacy.js +167 -0
- package/dist/cli/verbs/customer-segments.d.ts +6 -0
- package/dist/cli/verbs/customer-segments.js +193 -0
- package/dist/cli/verbs/customers.d.ts +6 -0
- package/dist/cli/verbs/customers.js +793 -0
- package/dist/cli/verbs/delegate-tokens.d.ts +6 -0
- package/dist/cli/verbs/delegate-tokens.js +95 -0
- package/dist/cli/verbs/delivery-customizations.d.ts +6 -0
- package/dist/cli/verbs/delivery-customizations.js +205 -0
- package/dist/cli/verbs/delivery-profile-locations.d.ts +6 -0
- package/dist/cli/verbs/delivery-profile-locations.js +90 -0
- package/dist/cli/verbs/delivery-profiles.d.ts +6 -0
- package/dist/cli/verbs/delivery-profiles.js +207 -0
- package/dist/cli/verbs/delivery-promises.d.ts +6 -0
- package/dist/cli/verbs/delivery-promises.js +262 -0
- package/dist/cli/verbs/delivery-settings.d.ts +6 -0
- package/dist/cli/verbs/delivery-settings.js +85 -0
- package/dist/cli/verbs/discount-nodes.d.ts +6 -0
- package/dist/cli/verbs/discount-nodes.js +169 -0
- package/dist/cli/verbs/discount-redeem-codes.d.ts +6 -0
- package/dist/cli/verbs/discount-redeem-codes.js +102 -0
- package/dist/cli/verbs/discount-saved-searches.d.ts +6 -0
- package/dist/cli/verbs/discount-saved-searches.js +113 -0
- package/dist/cli/verbs/discounts-automatic.d.ts +6 -0
- package/dist/cli/verbs/discounts-automatic.js +501 -0
- package/dist/cli/verbs/discounts-code.d.ts +6 -0
- package/dist/cli/verbs/discounts-code.js +540 -0
- package/dist/cli/verbs/disputes.d.ts +6 -0
- package/dist/cli/verbs/disputes.js +154 -0
- package/dist/cli/verbs/draft-orders.d.ts +6 -0
- package/dist/cli/verbs/draft-orders.js +475 -0
- package/dist/cli/verbs/events.d.ts +6 -0
- package/dist/cli/verbs/events.js +182 -0
- package/dist/cli/verbs/file-saved-searches.d.ts +6 -0
- package/dist/cli/verbs/file-saved-searches.js +83 -0
- package/dist/cli/verbs/files.d.ts +6 -0
- package/dist/cli/verbs/files.js +329 -0
- package/dist/cli/verbs/finance.d.ts +6 -0
- package/dist/cli/verbs/finance.js +115 -0
- package/dist/cli/verbs/flow.d.ts +6 -0
- package/dist/cli/verbs/flow.js +94 -0
- package/dist/cli/verbs/fulfillment-constraint-rules.d.ts +6 -0
- package/dist/cli/verbs/fulfillment-constraint-rules.js +139 -0
- package/dist/cli/verbs/fulfillment-orders.d.ts +6 -0
- package/dist/cli/verbs/fulfillment-orders.js +689 -0
- package/dist/cli/verbs/fulfillment-services.d.ts +6 -0
- package/dist/cli/verbs/fulfillment-services.js +212 -0
- package/dist/cli/verbs/fulfillments.d.ts +6 -0
- package/dist/cli/verbs/fulfillments.js +279 -0
- package/dist/cli/verbs/gift-cards.d.ts +6 -0
- package/dist/cli/verbs/gift-cards.js +359 -0
- package/dist/cli/verbs/graphql.d.ts +14 -0
- package/dist/cli/verbs/graphql.js +285 -0
- package/dist/cli/verbs/inventory-items.d.ts +6 -0
- package/dist/cli/verbs/inventory-items.js +164 -0
- package/dist/cli/verbs/inventory-shipments.d.ts +6 -0
- package/dist/cli/verbs/inventory-shipments.js +276 -0
- package/dist/cli/verbs/inventory-transfers.d.ts +6 -0
- package/dist/cli/verbs/inventory-transfers.js +396 -0
- package/dist/cli/verbs/inventory.d.ts +6 -0
- package/dist/cli/verbs/inventory.js +557 -0
- package/dist/cli/verbs/locales.d.ts +6 -0
- package/dist/cli/verbs/locales.js +61 -0
- package/dist/cli/verbs/locations.d.ts +6 -0
- package/dist/cli/verbs/locations.js +385 -0
- package/dist/cli/verbs/market-localizations.d.ts +6 -0
- package/dist/cli/verbs/market-localizations.js +291 -0
- package/dist/cli/verbs/market-web-presences.d.ts +6 -0
- package/dist/cli/verbs/market-web-presences.js +139 -0
- package/dist/cli/verbs/marketing-activities.d.ts +6 -0
- package/dist/cli/verbs/marketing-activities.js +353 -0
- package/dist/cli/verbs/marketing-events.d.ts +6 -0
- package/dist/cli/verbs/marketing-events.js +132 -0
- package/dist/cli/verbs/markets.d.ts +6 -0
- package/dist/cli/verbs/markets.js +357 -0
- package/dist/cli/verbs/menus.d.ts +6 -0
- package/dist/cli/verbs/menus.js +251 -0
- package/dist/cli/verbs/metafield-definition-tools.d.ts +6 -0
- package/dist/cli/verbs/metafield-definition-tools.js +289 -0
- package/dist/cli/verbs/metafield-definitions.d.ts +6 -0
- package/dist/cli/verbs/metafield-definitions.js +240 -0
- package/dist/cli/verbs/metafields.d.ts +6 -0
- package/dist/cli/verbs/metafields.js +112 -0
- package/dist/cli/verbs/metaobject-definition-tools.d.ts +6 -0
- package/dist/cli/verbs/metaobject-definition-tools.js +83 -0
- package/dist/cli/verbs/metaobject-definitions.d.ts +6 -0
- package/dist/cli/verbs/metaobject-definitions.js +176 -0
- package/dist/cli/verbs/metaobjects.d.ts +6 -0
- package/dist/cli/verbs/metaobjects.js +306 -0
- package/dist/cli/verbs/mobile-platform-applications.d.ts +6 -0
- package/dist/cli/verbs/mobile-platform-applications.js +247 -0
- package/dist/cli/verbs/order-edit.d.ts +6 -0
- package/dist/cli/verbs/order-edit.js +596 -0
- package/dist/cli/verbs/orders.d.ts +6 -0
- package/dist/cli/verbs/orders.js +853 -0
- package/dist/cli/verbs/pages.d.ts +6 -0
- package/dist/cli/verbs/pages.js +234 -0
- package/dist/cli/verbs/payment-customizations.d.ts +6 -0
- package/dist/cli/verbs/payment-customizations.js +193 -0
- package/dist/cli/verbs/payment-terms.d.ts +6 -0
- package/dist/cli/verbs/payment-terms.js +228 -0
- package/dist/cli/verbs/point-of-sale.d.ts +6 -0
- package/dist/cli/verbs/point-of-sale.js +57 -0
- package/dist/cli/verbs/price-lists.d.ts +6 -0
- package/dist/cli/verbs/price-lists.js +426 -0
- package/dist/cli/verbs/product-feeds.d.ts +6 -0
- package/dist/cli/verbs/product-feeds.js +187 -0
- package/dist/cli/verbs/product-variants.d.ts +6 -0
- package/dist/cli/verbs/product-variants.js +439 -0
- package/dist/cli/verbs/products.d.ts +6 -0
- package/dist/cli/verbs/products.js +2309 -0
- package/dist/cli/verbs/publications.d.ts +6 -0
- package/dist/cli/verbs/publications.js +256 -0
- package/dist/cli/verbs/publishables.d.ts +6 -0
- package/dist/cli/verbs/publishables.js +73 -0
- package/dist/cli/verbs/refunds.d.ts +6 -0
- package/dist/cli/verbs/refunds.js +226 -0
- package/dist/cli/verbs/resource-feedback.d.ts +6 -0
- package/dist/cli/verbs/resource-feedback.js +119 -0
- package/dist/cli/verbs/returnable-fulfillments.d.ts +6 -0
- package/dist/cli/verbs/returnable-fulfillments.js +102 -0
- package/dist/cli/verbs/returns.d.ts +6 -0
- package/dist/cli/verbs/returns.js +506 -0
- package/dist/cli/verbs/reverse-deliveries.d.ts +6 -0
- package/dist/cli/verbs/reverse-deliveries.js +203 -0
- package/dist/cli/verbs/reverse-fulfillment-orders.d.ts +6 -0
- package/dist/cli/verbs/reverse-fulfillment-orders.js +157 -0
- package/dist/cli/verbs/saved-searches.d.ts +6 -0
- package/dist/cli/verbs/saved-searches.js +150 -0
- package/dist/cli/verbs/script-tags.d.ts +6 -0
- package/dist/cli/verbs/script-tags.js +179 -0
- package/dist/cli/verbs/segments.d.ts +6 -0
- package/dist/cli/verbs/segments.js +343 -0
- package/dist/cli/verbs/selling-plan-group-products.d.ts +6 -0
- package/dist/cli/verbs/selling-plan-group-products.js +115 -0
- package/dist/cli/verbs/selling-plan-groups.d.ts +6 -0
- package/dist/cli/verbs/selling-plan-groups.js +230 -0
- package/dist/cli/verbs/server-pixels.d.ts +6 -0
- package/dist/cli/verbs/server-pixels.js +172 -0
- package/dist/cli/verbs/shipping-packages.d.ts +6 -0
- package/dist/cli/verbs/shipping-packages.js +107 -0
- package/dist/cli/verbs/shop-policies.d.ts +6 -0
- package/dist/cli/verbs/shop-policies.js +91 -0
- package/dist/cli/verbs/shop-utils.d.ts +6 -0
- package/dist/cli/verbs/shop-utils.js +147 -0
- package/dist/cli/verbs/shop.d.ts +6 -0
- package/dist/cli/verbs/shop.js +177 -0
- package/dist/cli/verbs/shopify-functions.d.ts +6 -0
- package/dist/cli/verbs/shopify-functions.js +127 -0
- package/dist/cli/verbs/shopify-payments.d.ts +6 -0
- package/dist/cli/verbs/shopify-payments.js +111 -0
- package/dist/cli/verbs/staff.d.ts +6 -0
- package/dist/cli/verbs/staff.js +127 -0
- package/dist/cli/verbs/staged-uploads.d.ts +6 -0
- package/dist/cli/verbs/staged-uploads.js +128 -0
- package/dist/cli/verbs/store-credit.d.ts +6 -0
- package/dist/cli/verbs/store-credit.js +209 -0
- package/dist/cli/verbs/storefront-access-tokens.d.ts +6 -0
- package/dist/cli/verbs/storefront-access-tokens.js +183 -0
- package/dist/cli/verbs/subscription-billing-cycles.d.ts +6 -0
- package/dist/cli/verbs/subscription-billing-cycles.js +391 -0
- package/dist/cli/verbs/subscription-billing.d.ts +6 -0
- package/dist/cli/verbs/subscription-billing.js +391 -0
- package/dist/cli/verbs/subscription-contracts.d.ts +6 -0
- package/dist/cli/verbs/subscription-contracts.js +392 -0
- package/dist/cli/verbs/subscription-drafts.d.ts +6 -0
- package/dist/cli/verbs/subscription-drafts.js +315 -0
- package/dist/cli/verbs/tags.d.ts +6 -0
- package/dist/cli/verbs/tags.js +73 -0
- package/dist/cli/verbs/tax.d.ts +6 -0
- package/dist/cli/verbs/tax.js +114 -0
- package/dist/cli/verbs/taxonomy.d.ts +6 -0
- package/dist/cli/verbs/taxonomy.js +99 -0
- package/dist/cli/verbs/tender-transactions.d.ts +6 -0
- package/dist/cli/verbs/tender-transactions.js +105 -0
- package/dist/cli/verbs/themes.d.ts +6 -0
- package/dist/cli/verbs/themes.js +315 -0
- package/dist/cli/verbs/translations.d.ts +6 -0
- package/dist/cli/verbs/translations.js +221 -0
- package/dist/cli/verbs/types.d.ts +4 -0
- package/dist/cli/verbs/types.js +224 -0
- package/dist/cli/verbs/url-redirects.d.ts +6 -0
- package/dist/cli/verbs/url-redirects.js +465 -0
- package/dist/cli/verbs/validations.d.ts +6 -0
- package/dist/cli/verbs/validations.js +181 -0
- package/dist/cli/verbs/web-pixels.d.ts +6 -0
- package/dist/cli/verbs/web-pixels.js +145 -0
- package/dist/cli/verbs/web-presences.d.ts +6 -0
- package/dist/cli/verbs/web-presences.js +186 -0
- package/dist/cli/verbs/webhooks.d.ts +6 -0
- package/dist/cli/verbs/webhooks.js +336 -0
- package/dist/cli/workflows/files/stagedUploads.d.ts +28 -0
- package/dist/cli/workflows/files/stagedUploads.js +227 -0
- package/dist/cli/workflows/files/stdinFile.d.ts +7 -0
- package/dist/cli/workflows/files/stdinFile.js +65 -0
- package/dist/cli/workflows/files/urlDownloads.d.ts +14 -0
- package/dist/cli/workflows/files/urlDownloads.js +114 -0
- package/dist/cli/workflows/files/waitForReady.d.ts +20 -0
- package/dist/cli/workflows/files/waitForReady.js +114 -0
- package/dist/cli/workflows/inventory/resolveInventoryItemId.d.ts +6 -0
- package/dist/cli/workflows/inventory/resolveInventoryItemId.js +59 -0
- package/dist/cli/workflows/productVariants/upsert.d.ts +8 -0
- package/dist/cli/workflows/productVariants/upsert.js +110 -0
- package/dist/cli/workflows/products/metafieldsUpsert.d.ts +6 -0
- package/dist/cli/workflows/products/metafieldsUpsert.js +94 -0
- package/dist/cli/workflows/products/publishablePublish.d.ts +21 -0
- package/dist/cli/workflows/products/publishablePublish.js +131 -0
- package/dist/cli/workflows/publications/resolvePublicationId.d.ts +17 -0
- package/dist/cli/workflows/publications/resolvePublicationId.js +93 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +238 -0
- package/dist/defaults.d.ts +2 -0
- package/dist/defaults.js +38 -0
- package/dist/generated/admin-2026-04/index.d.ts +25 -0
- package/dist/generated/admin-2026-04/index.js +70 -0
- package/dist/generated/admin-2026-04/runtime/batcher.d.ts +105 -0
- package/dist/generated/admin-2026-04/runtime/batcher.js +203 -0
- package/dist/generated/admin-2026-04/runtime/createClient.d.ts +17 -0
- package/dist/generated/admin-2026-04/runtime/createClient.js +59 -0
- package/dist/generated/admin-2026-04/runtime/error.d.ts +18 -0
- package/dist/generated/admin-2026-04/runtime/error.js +44 -0
- package/dist/generated/admin-2026-04/runtime/fetcher.d.ts +10 -0
- package/dist/generated/admin-2026-04/runtime/fetcher.js +104 -0
- package/dist/generated/admin-2026-04/runtime/generateGraphqlOperation.d.ts +30 -0
- package/dist/generated/admin-2026-04/runtime/generateGraphqlOperation.js +191 -0
- package/dist/generated/admin-2026-04/runtime/index.d.ts +11 -0
- package/dist/generated/admin-2026-04/runtime/index.js +46 -0
- package/dist/generated/admin-2026-04/runtime/linkTypeMap.d.ts +9 -0
- package/dist/generated/admin-2026-04/runtime/linkTypeMap.js +142 -0
- package/dist/generated/admin-2026-04/runtime/typeSelection.d.ts +28 -0
- package/dist/generated/admin-2026-04/runtime/typeSelection.js +17 -0
- package/dist/generated/admin-2026-04/runtime/types.d.ts +55 -0
- package/dist/generated/admin-2026-04/runtime/types.js +17 -0
- package/dist/generated/admin-2026-04/schema.d.ts +102240 -0
- package/dist/generated/admin-2026-04/schema.graphql +91596 -0
- package/dist/generated/admin-2026-04/schema.js +20322 -0
- package/dist/generated/admin-2026-04/types.d.ts +24224 -0
- package/dist/generated/admin-2026-04/types.js +62299 -0
- package/dist/generated/help/schema-help.d.ts +30 -0
- package/dist/generated/help/schema-help.js +61833 -0
- package/dist/graphqlValidator.d.ts +17 -0
- package/dist/graphqlValidator.js +84 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +23 -0
- package/package.json +66 -0
- package/schema/2026-04.graphql +61256 -0
- package/schema/2026-04.introspection.json +1 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { type ShopifyGidType } from '../gid';
|
|
2
|
+
export declare const parseFirst: (value: unknown) => number;
|
|
3
|
+
export declare const parseIntFlag: (flag: string, value: unknown) => number;
|
|
4
|
+
export declare const requireId: (id: unknown, type: ShopifyGidType, flag?: string) => string;
|
|
5
|
+
export declare const requireGidFlag: (value: unknown, flag: string, type: ShopifyGidType) => string;
|
|
6
|
+
export declare const requireStringFlag: (value: unknown, flag: string) => string;
|
|
7
|
+
export declare const requireLocationId: (value: unknown, flag?: string) => string;
|
|
8
|
+
export declare const parseDateTime: (value: unknown, flag: string) => string;
|
|
9
|
+
export declare const parseCsv: (value: unknown, label: string) => string[];
|
|
10
|
+
export declare const parseIds: (value: unknown, type: ShopifyGidType) => string[];
|
|
11
|
+
export declare const parseJsonArg: (value: unknown, label: string, { allowEmpty }?: {
|
|
12
|
+
allowEmpty?: boolean;
|
|
13
|
+
}) => any;
|
|
14
|
+
export declare const parseTextArg: (value: unknown, label: string, { allowEmpty }?: {
|
|
15
|
+
allowEmpty?: boolean;
|
|
16
|
+
}) => string | undefined;
|
|
17
|
+
export declare const parseStringList: (value: unknown, label: string, { allowEmpty }?: {
|
|
18
|
+
allowEmpty?: boolean;
|
|
19
|
+
}) => string[];
|
|
20
|
+
export declare const buildListNextPageArgs: (resource: string, args: {
|
|
21
|
+
first?: unknown;
|
|
22
|
+
query?: unknown;
|
|
23
|
+
sort?: unknown;
|
|
24
|
+
reverse?: unknown;
|
|
25
|
+
}, extraFlags?: Array<{
|
|
26
|
+
flag: string;
|
|
27
|
+
value?: unknown;
|
|
28
|
+
}>) => {
|
|
29
|
+
base: string;
|
|
30
|
+
first: number | undefined;
|
|
31
|
+
query: string | undefined;
|
|
32
|
+
sort: string | undefined;
|
|
33
|
+
reverse: boolean;
|
|
34
|
+
extraFlags: {
|
|
35
|
+
flag: string;
|
|
36
|
+
value?: string | number | boolean;
|
|
37
|
+
}[];
|
|
38
|
+
};
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var shared_exports = {};
|
|
20
|
+
__export(shared_exports, {
|
|
21
|
+
buildListNextPageArgs: () => buildListNextPageArgs,
|
|
22
|
+
parseCsv: () => parseCsv,
|
|
23
|
+
parseDateTime: () => parseDateTime,
|
|
24
|
+
parseFirst: () => parseFirst,
|
|
25
|
+
parseIds: () => parseIds,
|
|
26
|
+
parseIntFlag: () => parseIntFlag,
|
|
27
|
+
parseJsonArg: () => parseJsonArg,
|
|
28
|
+
parseStringList: () => parseStringList,
|
|
29
|
+
parseTextArg: () => parseTextArg,
|
|
30
|
+
requireGidFlag: () => requireGidFlag,
|
|
31
|
+
requireId: () => requireId,
|
|
32
|
+
requireLocationId: () => requireLocationId,
|
|
33
|
+
requireStringFlag: () => requireStringFlag
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(shared_exports);
|
|
36
|
+
var import_node_fs = require("node:fs");
|
|
37
|
+
var import_errors = require("../errors");
|
|
38
|
+
var import_gid = require("../gid");
|
|
39
|
+
const parseFirst = (value) => {
|
|
40
|
+
if (value === void 0) return 50;
|
|
41
|
+
const n = Number(value);
|
|
42
|
+
if (!Number.isFinite(n) || n <= 0) throw new import_errors.CliError("--first must be a positive integer", 2);
|
|
43
|
+
return Math.floor(n);
|
|
44
|
+
};
|
|
45
|
+
const parseIntFlag = (flag, value) => {
|
|
46
|
+
if (value === void 0 || value === null || value === "") {
|
|
47
|
+
throw new import_errors.CliError(`Missing ${flag}`, 2);
|
|
48
|
+
}
|
|
49
|
+
const n = Number(value);
|
|
50
|
+
if (!Number.isFinite(n) || !Number.isInteger(n)) {
|
|
51
|
+
throw new import_errors.CliError(`${flag} must be an integer`, 2);
|
|
52
|
+
}
|
|
53
|
+
return n;
|
|
54
|
+
};
|
|
55
|
+
const requireId = (id, type, flag = "--id") => {
|
|
56
|
+
const normalized = typeof id === "string" ? id : typeof id === "number" && Number.isFinite(id) ? String(id) : void 0;
|
|
57
|
+
if (!normalized) throw new import_errors.CliError(`Missing ${flag}`, 2);
|
|
58
|
+
return (0, import_gid.coerceGid)(normalized, type);
|
|
59
|
+
};
|
|
60
|
+
const requireGidFlag = (value, flag, type) => {
|
|
61
|
+
if (typeof value !== "string" || !value) throw new import_errors.CliError(`Missing ${flag}`, 2);
|
|
62
|
+
return (0, import_gid.coerceGid)(value, type);
|
|
63
|
+
};
|
|
64
|
+
const requireStringFlag = (value, flag) => {
|
|
65
|
+
if (typeof value !== "string" || !value) throw new import_errors.CliError(`Missing ${flag}`, 2);
|
|
66
|
+
return value;
|
|
67
|
+
};
|
|
68
|
+
const requireLocationId = (value, flag = "--location-id") => {
|
|
69
|
+
if (typeof value !== "string" || !value) throw new import_errors.CliError(`Missing ${flag}`, 2);
|
|
70
|
+
return (0, import_gid.coerceGid)(value, "Location");
|
|
71
|
+
};
|
|
72
|
+
const parseDateTime = (value, flag) => {
|
|
73
|
+
if (typeof value !== "string" || !value) throw new import_errors.CliError(`Missing ${flag}`, 2);
|
|
74
|
+
return value;
|
|
75
|
+
};
|
|
76
|
+
const parseCsv = (value, label) => {
|
|
77
|
+
if (typeof value !== "string" || !value.trim()) throw new import_errors.CliError(`Missing ${label}`, 2);
|
|
78
|
+
const parts = value.split(",").map((s) => s.trim()).filter(Boolean);
|
|
79
|
+
if (parts.length === 0) throw new import_errors.CliError(`${label} must include at least one item`, 2);
|
|
80
|
+
return parts;
|
|
81
|
+
};
|
|
82
|
+
const parseIds = (value, type) => {
|
|
83
|
+
const raw = Array.isArray(value) ? value : value === void 0 ? [] : [value];
|
|
84
|
+
const parts = [];
|
|
85
|
+
for (const v of raw) {
|
|
86
|
+
if (typeof v !== "string") throw new import_errors.CliError("--ids must be a string", 2);
|
|
87
|
+
parts.push(...v.split(",").map((s) => s.trim()).filter(Boolean));
|
|
88
|
+
}
|
|
89
|
+
if (parts.length === 0) throw new import_errors.CliError("Missing --ids", 2);
|
|
90
|
+
return parts.map((id) => (0, import_gid.coerceGid)(id, type));
|
|
91
|
+
};
|
|
92
|
+
const readUtf8 = (path) => (0, import_node_fs.readFileSync)(path, "utf8");
|
|
93
|
+
const parseJson = (value, label) => {
|
|
94
|
+
try {
|
|
95
|
+
return JSON.parse(value);
|
|
96
|
+
} catch (err) {
|
|
97
|
+
throw new import_errors.CliError(`${label} must be valid JSON: ${err.message}`, 2);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
const parseJsonArg = (value, label, { allowEmpty = false } = {}) => {
|
|
101
|
+
if (value === void 0 || value === null || value === "") {
|
|
102
|
+
if (allowEmpty) return void 0;
|
|
103
|
+
throw new import_errors.CliError(`Missing ${label}`, 2);
|
|
104
|
+
}
|
|
105
|
+
if (typeof value !== "string") throw new import_errors.CliError(`${label} must be a string`, 2);
|
|
106
|
+
const raw = value.trim();
|
|
107
|
+
if (!raw) {
|
|
108
|
+
if (allowEmpty) return void 0;
|
|
109
|
+
throw new import_errors.CliError(`Missing ${label}`, 2);
|
|
110
|
+
}
|
|
111
|
+
if (raw.startsWith("@file:")) return parseJson(readUtf8(raw.slice("@file:".length)), label);
|
|
112
|
+
if (raw.startsWith("@")) return parseJson(readUtf8(raw.slice(1)), label);
|
|
113
|
+
return parseJson(raw, label);
|
|
114
|
+
};
|
|
115
|
+
const parseTextArg = (value, label, { allowEmpty = false } = {}) => {
|
|
116
|
+
if (value === void 0 || value === null || value === "") {
|
|
117
|
+
if (allowEmpty) return void 0;
|
|
118
|
+
throw new import_errors.CliError(`Missing ${label}`, 2);
|
|
119
|
+
}
|
|
120
|
+
if (typeof value !== "string") throw new import_errors.CliError(`${label} must be a string`, 2);
|
|
121
|
+
const raw = value.trim();
|
|
122
|
+
if (!raw) {
|
|
123
|
+
if (allowEmpty) return void 0;
|
|
124
|
+
throw new import_errors.CliError(`Missing ${label}`, 2);
|
|
125
|
+
}
|
|
126
|
+
if (raw.startsWith("@file:")) return readUtf8(raw.slice("@file:".length));
|
|
127
|
+
if (raw.startsWith("@")) return readUtf8(raw.slice(1));
|
|
128
|
+
return raw;
|
|
129
|
+
};
|
|
130
|
+
const parseStringList = (value, label, { allowEmpty = false } = {}) => {
|
|
131
|
+
if (value === void 0 || value === null) {
|
|
132
|
+
if (allowEmpty) return [];
|
|
133
|
+
throw new import_errors.CliError(`Missing ${label}`, 2);
|
|
134
|
+
}
|
|
135
|
+
const raw = Array.isArray(value) ? value : [value];
|
|
136
|
+
const parts = [];
|
|
137
|
+
for (const v of raw) {
|
|
138
|
+
if (typeof v !== "string") throw new import_errors.CliError(`${label} must be a string`, 2);
|
|
139
|
+
parts.push(...v.split(",").map((s) => s.trim()).filter(Boolean));
|
|
140
|
+
}
|
|
141
|
+
if (parts.length === 0) {
|
|
142
|
+
if (allowEmpty) return [];
|
|
143
|
+
throw new import_errors.CliError(`Missing ${label}`, 2);
|
|
144
|
+
}
|
|
145
|
+
return parts;
|
|
146
|
+
};
|
|
147
|
+
const buildListNextPageArgs = (resource, args, extraFlags) => {
|
|
148
|
+
const normalizedExtraFlags = [];
|
|
149
|
+
for (const f of extraFlags ?? []) {
|
|
150
|
+
if (!f?.flag) continue;
|
|
151
|
+
const value = f.value;
|
|
152
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
|
|
153
|
+
normalizedExtraFlags.push({ flag: f.flag, value });
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return {
|
|
157
|
+
base: `shop ${resource} list`,
|
|
158
|
+
first: typeof args.first === "number" ? args.first : void 0,
|
|
159
|
+
query: typeof args.query === "string" ? args.query : void 0,
|
|
160
|
+
sort: typeof args.sort === "string" ? args.sort : void 0,
|
|
161
|
+
reverse: args.reverse === true,
|
|
162
|
+
extraFlags: normalizedExtraFlags
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
166
|
+
0 && (module.exports = {
|
|
167
|
+
buildListNextPageArgs,
|
|
168
|
+
parseCsv,
|
|
169
|
+
parseDateTime,
|
|
170
|
+
parseFirst,
|
|
171
|
+
parseIds,
|
|
172
|
+
parseIntFlag,
|
|
173
|
+
parseJsonArg,
|
|
174
|
+
parseStringList,
|
|
175
|
+
parseTextArg,
|
|
176
|
+
requireGidFlag,
|
|
177
|
+
requireId,
|
|
178
|
+
requireLocationId,
|
|
179
|
+
requireStringFlag
|
|
180
|
+
});
|
|
181
|
+
//# sourceMappingURL=_shared.js.map
|
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var abandoned_checkouts_exports = {};
|
|
20
|
+
__export(abandoned_checkouts_exports, {
|
|
21
|
+
runAbandonedCheckouts: () => runAbandonedCheckouts
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(abandoned_checkouts_exports);
|
|
24
|
+
var import_errors = require("../errors");
|
|
25
|
+
var import_output = require("../output");
|
|
26
|
+
var import_router = require("../router");
|
|
27
|
+
var import_select = require("../selection/select");
|
|
28
|
+
var import_userErrors = require("../userErrors");
|
|
29
|
+
var import_gid = require("../gid");
|
|
30
|
+
var import_shared = require("./_shared");
|
|
31
|
+
const abandonedCheckoutSummarySelection = {
|
|
32
|
+
id: true,
|
|
33
|
+
name: true,
|
|
34
|
+
createdAt: true,
|
|
35
|
+
completedAt: true,
|
|
36
|
+
abandonedCheckoutUrl: true,
|
|
37
|
+
customer: { id: true, email: true, displayName: true },
|
|
38
|
+
totalPriceSet: { shopMoney: { amount: true, currencyCode: true } }
|
|
39
|
+
};
|
|
40
|
+
const abandonedCheckoutFullSelection = {
|
|
41
|
+
...abandonedCheckoutSummarySelection,
|
|
42
|
+
updatedAt: true,
|
|
43
|
+
subtotalPriceSet: { shopMoney: { amount: true, currencyCode: true } },
|
|
44
|
+
totalDiscountSet: { shopMoney: { amount: true, currencyCode: true } },
|
|
45
|
+
lineItems: {
|
|
46
|
+
__args: { first: 25 },
|
|
47
|
+
nodes: {
|
|
48
|
+
id: true,
|
|
49
|
+
title: true,
|
|
50
|
+
quantity: true,
|
|
51
|
+
originalUnitPriceSet: { shopMoney: { amount: true, currencyCode: true } },
|
|
52
|
+
variant: { id: true, title: true },
|
|
53
|
+
product: { id: true, title: true }
|
|
54
|
+
},
|
|
55
|
+
pageInfo: { hasNextPage: true, endCursor: true }
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const getAbandonedCheckoutSelection = (view) => {
|
|
59
|
+
if (view === "ids") return { id: true };
|
|
60
|
+
if (view === "full") return abandonedCheckoutFullSelection;
|
|
61
|
+
if (view === "raw") return {};
|
|
62
|
+
return abandonedCheckoutSummarySelection;
|
|
63
|
+
};
|
|
64
|
+
const abandonmentSummarySelection = {
|
|
65
|
+
id: true,
|
|
66
|
+
abandonmentType: true,
|
|
67
|
+
createdAt: true,
|
|
68
|
+
emailState: true,
|
|
69
|
+
emailSentAt: true,
|
|
70
|
+
daysSinceLastAbandonmentEmail: true,
|
|
71
|
+
customerHasNoOrderSinceAbandonment: true,
|
|
72
|
+
customerHasNoDraftOrderSinceAbandonment: true,
|
|
73
|
+
customer: { id: true, email: true, displayName: true },
|
|
74
|
+
abandonedCheckoutPayload: { id: true, name: true, abandonedCheckoutUrl: true }
|
|
75
|
+
};
|
|
76
|
+
const runAbandonedCheckouts = async ({
|
|
77
|
+
ctx,
|
|
78
|
+
verb,
|
|
79
|
+
argv
|
|
80
|
+
}) => {
|
|
81
|
+
if (verb === "list") {
|
|
82
|
+
const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: {} });
|
|
83
|
+
const first = (0, import_shared.parseFirst)(args.first);
|
|
84
|
+
const after = args.after;
|
|
85
|
+
const query = args.query;
|
|
86
|
+
const reverse = args.reverse;
|
|
87
|
+
const sortKey = args.sort;
|
|
88
|
+
const nodeSelection = (0, import_select.resolveSelection)({
|
|
89
|
+
resource: "abandoned-checkouts",
|
|
90
|
+
view: ctx.view,
|
|
91
|
+
baseSelection: getAbandonedCheckoutSelection(ctx.view),
|
|
92
|
+
select: args.select,
|
|
93
|
+
selection: args.selection,
|
|
94
|
+
include: args.include,
|
|
95
|
+
ensureId: ctx.quiet
|
|
96
|
+
});
|
|
97
|
+
const result = await (0, import_router.runQuery)(ctx, {
|
|
98
|
+
abandonedCheckouts: {
|
|
99
|
+
__args: { first, after, query, reverse, sortKey },
|
|
100
|
+
pageInfo: { hasNextPage: true, endCursor: true },
|
|
101
|
+
nodes: nodeSelection
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
if (result === void 0) return;
|
|
105
|
+
(0, import_output.printConnection)({
|
|
106
|
+
connection: result.abandonedCheckouts,
|
|
107
|
+
format: ctx.format,
|
|
108
|
+
quiet: ctx.quiet,
|
|
109
|
+
nextPageArgs: (0, import_shared.buildListNextPageArgs)("abandoned-checkouts", { first, query, sort: sortKey, reverse })
|
|
110
|
+
});
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
if (verb === "count") {
|
|
114
|
+
const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: { limit: { type: "string" } } });
|
|
115
|
+
const query = args.query;
|
|
116
|
+
const limitRaw = args.limit;
|
|
117
|
+
const limit = limitRaw === void 0 || limitRaw === null || limitRaw === "" ? void 0 : Number(limitRaw);
|
|
118
|
+
if (limit !== void 0 && (!Number.isFinite(limit) || limit <= 0)) {
|
|
119
|
+
throw new import_errors.CliError("--limit must be a positive number", 2);
|
|
120
|
+
}
|
|
121
|
+
const result = await (0, import_router.runQuery)(ctx, {
|
|
122
|
+
abandonedCheckoutsCount: {
|
|
123
|
+
__args: {
|
|
124
|
+
...query ? { query } : {},
|
|
125
|
+
...limit !== void 0 ? { limit: Math.floor(limit) } : {}
|
|
126
|
+
},
|
|
127
|
+
count: true,
|
|
128
|
+
precision: true
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
if (result === void 0) return;
|
|
132
|
+
if (ctx.quiet) return console.log(result.abandonedCheckoutsCount?.count ?? "");
|
|
133
|
+
(0, import_output.printJson)(result.abandonedCheckoutsCount, ctx.format !== "raw");
|
|
134
|
+
return;
|
|
135
|
+
}
|
|
136
|
+
if (verb === "abandonment") {
|
|
137
|
+
const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: {} });
|
|
138
|
+
const id = (0, import_shared.requireId)(args.id, "Abandonment");
|
|
139
|
+
const selection = (0, import_select.resolveSelection)({
|
|
140
|
+
resource: "abandoned-checkouts",
|
|
141
|
+
view: ctx.view,
|
|
142
|
+
baseSelection: abandonmentSummarySelection,
|
|
143
|
+
select: args.select,
|
|
144
|
+
selection: args.selection,
|
|
145
|
+
include: args.include,
|
|
146
|
+
ensureId: ctx.quiet
|
|
147
|
+
});
|
|
148
|
+
const result = await (0, import_router.runQuery)(ctx, { abandonment: { __args: { id }, ...selection } });
|
|
149
|
+
if (result === void 0) return;
|
|
150
|
+
(0, import_output.printNode)({ node: result.abandonment, format: ctx.format, quiet: ctx.quiet });
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (verb === "abandonment-by-checkout") {
|
|
154
|
+
const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: { "checkout-id": { type: "string" } } });
|
|
155
|
+
const checkoutIdRaw = args["checkout-id"];
|
|
156
|
+
if (!checkoutIdRaw) throw new import_errors.CliError("Missing --checkout-id", 2);
|
|
157
|
+
const abandonedCheckoutId = (0, import_gid.coerceGid)(checkoutIdRaw, "AbandonedCheckout");
|
|
158
|
+
const selection = (0, import_select.resolveSelection)({
|
|
159
|
+
resource: "abandoned-checkouts",
|
|
160
|
+
view: ctx.view,
|
|
161
|
+
baseSelection: abandonmentSummarySelection,
|
|
162
|
+
select: args.select,
|
|
163
|
+
selection: args.selection,
|
|
164
|
+
include: args.include,
|
|
165
|
+
ensureId: ctx.quiet
|
|
166
|
+
});
|
|
167
|
+
const result = await (0, import_router.runQuery)(ctx, {
|
|
168
|
+
abandonmentByAbandonedCheckoutId: { __args: { abandonedCheckoutId }, ...selection }
|
|
169
|
+
});
|
|
170
|
+
if (result === void 0) return;
|
|
171
|
+
(0, import_output.printNode)({
|
|
172
|
+
node: result.abandonmentByAbandonedCheckoutId,
|
|
173
|
+
format: ctx.format,
|
|
174
|
+
quiet: ctx.quiet
|
|
175
|
+
});
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
if (verb === "update-email-state") {
|
|
179
|
+
const args = (0, import_router.parseStandardArgs)({
|
|
180
|
+
argv,
|
|
181
|
+
extraOptions: {
|
|
182
|
+
state: { type: "string" },
|
|
183
|
+
"email-sent-at": { type: "string" },
|
|
184
|
+
reason: { type: "string" }
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
const id = (0, import_shared.requireId)(args.id, "Abandonment");
|
|
188
|
+
const emailState = args.state;
|
|
189
|
+
if (!emailState) throw new import_errors.CliError("Missing --state", 2);
|
|
190
|
+
const emailSentAt = args["email-sent-at"];
|
|
191
|
+
const emailStateChangeReason = args.reason;
|
|
192
|
+
const result = await (0, import_router.runMutation)(ctx, {
|
|
193
|
+
abandonmentEmailStateUpdate: {
|
|
194
|
+
__args: {
|
|
195
|
+
id,
|
|
196
|
+
emailState,
|
|
197
|
+
...emailSentAt ? { emailSentAt } : {},
|
|
198
|
+
...emailStateChangeReason ? { emailStateChangeReason } : {}
|
|
199
|
+
},
|
|
200
|
+
abandonment: abandonmentSummarySelection,
|
|
201
|
+
userErrors: { field: true, message: true }
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
if (result === void 0) return;
|
|
205
|
+
(0, import_userErrors.maybeFailOnUserErrors)({ payload: result.abandonmentEmailStateUpdate, failOnUserErrors: ctx.failOnUserErrors });
|
|
206
|
+
if (ctx.quiet) return console.log(result.abandonmentEmailStateUpdate?.abandonment?.id ?? "");
|
|
207
|
+
(0, import_output.printJson)(result.abandonmentEmailStateUpdate, ctx.format !== "raw");
|
|
208
|
+
return;
|
|
209
|
+
}
|
|
210
|
+
if (verb === "update-activity-delivery-status") {
|
|
211
|
+
const args = (0, import_router.parseStandardArgs)({
|
|
212
|
+
argv,
|
|
213
|
+
extraOptions: {
|
|
214
|
+
"abandonment-id": { type: "string" },
|
|
215
|
+
"marketing-activity-id": { type: "string" },
|
|
216
|
+
status: { type: "string" },
|
|
217
|
+
"delivered-at": { type: "string" },
|
|
218
|
+
reason: { type: "string" }
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
const abandonmentIdRaw = args["abandonment-id"];
|
|
222
|
+
const marketingActivityIdRaw = args["marketing-activity-id"];
|
|
223
|
+
const deliveryStatus = args.status;
|
|
224
|
+
if (!abandonmentIdRaw) throw new import_errors.CliError("Missing --abandonment-id", 2);
|
|
225
|
+
if (!marketingActivityIdRaw) throw new import_errors.CliError("Missing --marketing-activity-id", 2);
|
|
226
|
+
if (!deliveryStatus) throw new import_errors.CliError("Missing --status", 2);
|
|
227
|
+
const abandonmentId = (0, import_gid.coerceGid)(abandonmentIdRaw, "Abandonment");
|
|
228
|
+
const marketingActivityId = (0, import_gid.coerceGid)(marketingActivityIdRaw, "MarketingActivity");
|
|
229
|
+
const deliveredAt = args["delivered-at"];
|
|
230
|
+
const deliveryStatusChangeReason = args.reason;
|
|
231
|
+
const result = await (0, import_router.runMutation)(ctx, {
|
|
232
|
+
abandonmentUpdateActivitiesDeliveryStatuses: {
|
|
233
|
+
__args: {
|
|
234
|
+
abandonmentId,
|
|
235
|
+
marketingActivityId,
|
|
236
|
+
deliveryStatus,
|
|
237
|
+
...deliveredAt ? { deliveredAt } : {},
|
|
238
|
+
...deliveryStatusChangeReason ? { deliveryStatusChangeReason } : {}
|
|
239
|
+
},
|
|
240
|
+
abandonment: abandonmentSummarySelection,
|
|
241
|
+
userErrors: { field: true, message: true }
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
if (result === void 0) return;
|
|
245
|
+
(0, import_userErrors.maybeFailOnUserErrors)({
|
|
246
|
+
payload: result.abandonmentUpdateActivitiesDeliveryStatuses,
|
|
247
|
+
failOnUserErrors: ctx.failOnUserErrors
|
|
248
|
+
});
|
|
249
|
+
if (ctx.quiet) return console.log(result.abandonmentUpdateActivitiesDeliveryStatuses?.abandonment?.id ?? "");
|
|
250
|
+
(0, import_output.printJson)(result.abandonmentUpdateActivitiesDeliveryStatuses, ctx.format !== "raw");
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
throw new import_errors.CliError(`Unknown verb for abandoned-checkouts: ${verb}`, 2);
|
|
254
|
+
};
|
|
255
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
256
|
+
0 && (module.exports = {
|
|
257
|
+
runAbandonedCheckouts
|
|
258
|
+
});
|
|
259
|
+
//# sourceMappingURL=abandoned-checkouts.js.map
|