shop-cli 0.1.0
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 +5651 -0
- package/dist/cli/help/render.d.ts +7 -0
- package/dist/cli/help/render.js +352 -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/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/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 +180 -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 +485 -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 +314 -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 +656 -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 +475 -0
- package/dist/cli/verbs/discounts-code.d.ts +6 -0
- package/dist/cli/verbs/discounts-code.js +523 -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 +429 -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 +213 -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 +674 -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 +273 -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 +551 -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 +324 -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 +297 -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 +781 -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 +388 -0
- package/dist/cli/verbs/products.d.ts +6 -0
- package/dist/cli/verbs/products.js +1257 -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 +208 -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 +391 -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 +297 -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 +407 -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 +175 -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 +152 -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 +65 -0
- package/schema/2026-04.graphql +61256 -0
- package/schema/2026-04.introspection.json +1 -0
|
@@ -0,0 +1,391 @@
|
|
|
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 subscription_billing_cycles_exports = {};
|
|
20
|
+
__export(subscription_billing_cycles_exports, {
|
|
21
|
+
runSubscriptionBillingCycles: () => runSubscriptionBillingCycles
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(subscription_billing_cycles_exports);
|
|
24
|
+
var import_errors = require("../errors");
|
|
25
|
+
var import_gid = require("../gid");
|
|
26
|
+
var import_input = require("../input");
|
|
27
|
+
var import_output = require("../output");
|
|
28
|
+
var import_router = require("../router");
|
|
29
|
+
var import_select = require("../selection/select");
|
|
30
|
+
var import_userErrors = require("../userErrors");
|
|
31
|
+
var import_shared = require("./_shared");
|
|
32
|
+
const subscriptionBillingAttemptSummarySelection = {
|
|
33
|
+
id: true,
|
|
34
|
+
createdAt: true,
|
|
35
|
+
ready: true,
|
|
36
|
+
errorCode: true,
|
|
37
|
+
errorMessage: true,
|
|
38
|
+
originTime: true,
|
|
39
|
+
nextActionUrl: true
|
|
40
|
+
};
|
|
41
|
+
const subscriptionBillingCycleSummarySelection = {
|
|
42
|
+
cycleIndex: true,
|
|
43
|
+
status: true,
|
|
44
|
+
billingAttemptExpectedDate: true,
|
|
45
|
+
cycleStartAt: true,
|
|
46
|
+
cycleEndAt: true,
|
|
47
|
+
skipped: true,
|
|
48
|
+
edited: true,
|
|
49
|
+
sourceContract: { id: true, status: true }
|
|
50
|
+
};
|
|
51
|
+
const subscriptionBillingCycleFullSelection = {
|
|
52
|
+
...subscriptionBillingCycleSummarySelection,
|
|
53
|
+
editedContract: { updatedAt: true, createdAt: true },
|
|
54
|
+
billingAttempts: {
|
|
55
|
+
__args: { first: 10 },
|
|
56
|
+
nodes: subscriptionBillingAttemptSummarySelection,
|
|
57
|
+
pageInfo: { hasNextPage: true, endCursor: true }
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const getSubscriptionBillingCycleSelection = (view) => {
|
|
61
|
+
if (view === "full") return subscriptionBillingCycleFullSelection;
|
|
62
|
+
if (view === "raw") return {};
|
|
63
|
+
return subscriptionBillingCycleSummarySelection;
|
|
64
|
+
};
|
|
65
|
+
const requireContractId = (value) => {
|
|
66
|
+
if (typeof value !== "string" || !value) throw new import_errors.CliError("Missing --contract-id", 2);
|
|
67
|
+
return (0, import_gid.coerceGid)(value, "SubscriptionContract");
|
|
68
|
+
};
|
|
69
|
+
const requireDraftId = (value) => {
|
|
70
|
+
if (typeof value !== "string" || !value) throw new import_errors.CliError("Missing --draft-id", 2);
|
|
71
|
+
return (0, import_gid.coerceGid)(value, "SubscriptionDraft");
|
|
72
|
+
};
|
|
73
|
+
const requireJobId = (value) => {
|
|
74
|
+
if (typeof value !== "string" || !value) throw new import_errors.CliError("Missing --job-id", 2);
|
|
75
|
+
return (0, import_gid.coerceGid)(value, "Job");
|
|
76
|
+
};
|
|
77
|
+
const parseCycleIndex = (value) => {
|
|
78
|
+
if (value === void 0 || value === null || value === "") throw new import_errors.CliError("Missing --cycle-index", 2);
|
|
79
|
+
const n = Number(value);
|
|
80
|
+
if (!Number.isFinite(n) || !Number.isInteger(n) || n <= 0) throw new import_errors.CliError("--cycle-index must be a positive integer", 2);
|
|
81
|
+
return n;
|
|
82
|
+
};
|
|
83
|
+
const parseDateTime = (value) => {
|
|
84
|
+
if (typeof value !== "string" || !value.trim()) throw new import_errors.CliError("Missing --date", 2);
|
|
85
|
+
return value.trim();
|
|
86
|
+
};
|
|
87
|
+
const extractArrayField = (input, field) => {
|
|
88
|
+
if (Array.isArray(input)) return input;
|
|
89
|
+
if (input && Array.isArray(input[field])) return input[field];
|
|
90
|
+
return void 0;
|
|
91
|
+
};
|
|
92
|
+
const runSubscriptionBillingCycles = async ({
|
|
93
|
+
ctx,
|
|
94
|
+
verb,
|
|
95
|
+
argv
|
|
96
|
+
}) => {
|
|
97
|
+
if (argv.includes("--help") || argv.includes("-h")) {
|
|
98
|
+
console.log(
|
|
99
|
+
[
|
|
100
|
+
"Usage:",
|
|
101
|
+
" shop subscription-billing-cycles <verb> [flags]",
|
|
102
|
+
"",
|
|
103
|
+
"Verbs:",
|
|
104
|
+
" get|bulk-results|attempts",
|
|
105
|
+
" charge|skip|unskip|schedule-edit",
|
|
106
|
+
" contract-edit|edit-delete|edits-delete",
|
|
107
|
+
" contract-draft-commit|contract-draft-concatenate",
|
|
108
|
+
"",
|
|
109
|
+
"Common output flags:",
|
|
110
|
+
" --view summary|full|raw|all",
|
|
111
|
+
" --select <path> (repeatable; dot paths; adds to base view selection)",
|
|
112
|
+
" --selection <graphql> (selection override; can be @file.gql)"
|
|
113
|
+
].join("\n")
|
|
114
|
+
);
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
if (verb === "get") {
|
|
118
|
+
const args = (0, import_router.parseStandardArgs)({
|
|
119
|
+
argv,
|
|
120
|
+
extraOptions: { "contract-id": { type: "string" }, "cycle-index": { type: "string" }, date: { type: "string" } }
|
|
121
|
+
});
|
|
122
|
+
const contractId = requireContractId(args["contract-id"]);
|
|
123
|
+
const cycleIndexRaw = args["cycle-index"];
|
|
124
|
+
const dateRaw = args.date;
|
|
125
|
+
const selector = cycleIndexRaw !== void 0 ? { index: parseCycleIndex(cycleIndexRaw) } : dateRaw ? { date: parseDateTime(dateRaw) } : void 0;
|
|
126
|
+
if (!selector) throw new import_errors.CliError("Missing --cycle-index or --date", 2);
|
|
127
|
+
const selection = (0, import_select.resolveSelection)({
|
|
128
|
+
typeName: "SubscriptionBillingCycle",
|
|
129
|
+
view: ctx.view,
|
|
130
|
+
baseSelection: getSubscriptionBillingCycleSelection(ctx.view),
|
|
131
|
+
select: args.select,
|
|
132
|
+
selection: args.selection,
|
|
133
|
+
include: args.include,
|
|
134
|
+
ensureId: false
|
|
135
|
+
});
|
|
136
|
+
const result = await (0, import_router.runQuery)(ctx, {
|
|
137
|
+
subscriptionBillingCycle: {
|
|
138
|
+
__args: { billingCycleInput: { contractId, selector } },
|
|
139
|
+
...selection
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
if (result === void 0) return;
|
|
143
|
+
if (ctx.quiet) return console.log(result.subscriptionBillingCycle?.cycleIndex ?? "");
|
|
144
|
+
(0, import_output.printNode)({ node: result.subscriptionBillingCycle, format: ctx.format, quiet: false });
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (verb === "bulk-results") {
|
|
148
|
+
const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: { "job-id": { type: "string" } } });
|
|
149
|
+
const jobId = requireJobId(args["job-id"]);
|
|
150
|
+
const first = (0, import_shared.parseFirst)(args.first);
|
|
151
|
+
const after = args.after;
|
|
152
|
+
const reverse = args.reverse;
|
|
153
|
+
const nodeSelection = (0, import_select.resolveSelection)({
|
|
154
|
+
typeName: "SubscriptionBillingCycle",
|
|
155
|
+
view: ctx.view,
|
|
156
|
+
baseSelection: getSubscriptionBillingCycleSelection(ctx.view),
|
|
157
|
+
select: args.select,
|
|
158
|
+
selection: args.selection,
|
|
159
|
+
include: args.include,
|
|
160
|
+
ensureId: false
|
|
161
|
+
});
|
|
162
|
+
const result = await (0, import_router.runQuery)(ctx, {
|
|
163
|
+
subscriptionBillingCycleBulkResults: {
|
|
164
|
+
__args: { jobId, first, after, reverse },
|
|
165
|
+
pageInfo: { hasNextPage: true, endCursor: true },
|
|
166
|
+
nodes: nodeSelection
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
if (result === void 0) return;
|
|
170
|
+
(0, import_output.printConnection)({
|
|
171
|
+
connection: result.subscriptionBillingCycleBulkResults,
|
|
172
|
+
format: ctx.format,
|
|
173
|
+
quiet: ctx.quiet,
|
|
174
|
+
nextPageArgs: {
|
|
175
|
+
base: "shop subscription-billing-cycles bulk-results",
|
|
176
|
+
first,
|
|
177
|
+
reverse: reverse === true,
|
|
178
|
+
extraFlags: [{ flag: "--job-id", value: jobId }]
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
if (verb === "attempts") {
|
|
184
|
+
const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: {} });
|
|
185
|
+
const first = (0, import_shared.parseFirst)(args.first);
|
|
186
|
+
const after = args.after;
|
|
187
|
+
const query = args.query;
|
|
188
|
+
const reverse = args.reverse;
|
|
189
|
+
const sortKey = args.sort;
|
|
190
|
+
const selection = (0, import_select.resolveSelection)({
|
|
191
|
+
typeName: "SubscriptionBillingAttempt",
|
|
192
|
+
view: ctx.view,
|
|
193
|
+
baseSelection: subscriptionBillingAttemptSummarySelection,
|
|
194
|
+
select: args.select,
|
|
195
|
+
selection: args.selection,
|
|
196
|
+
include: args.include,
|
|
197
|
+
ensureId: true
|
|
198
|
+
});
|
|
199
|
+
const result = await (0, import_router.runQuery)(ctx, {
|
|
200
|
+
subscriptionBillingAttempts: {
|
|
201
|
+
__args: { first, after, query, reverse, sortKey },
|
|
202
|
+
pageInfo: { hasNextPage: true, endCursor: true },
|
|
203
|
+
nodes: selection
|
|
204
|
+
}
|
|
205
|
+
});
|
|
206
|
+
if (result === void 0) return;
|
|
207
|
+
(0, import_output.printConnection)({
|
|
208
|
+
connection: result.subscriptionBillingAttempts,
|
|
209
|
+
format: ctx.format,
|
|
210
|
+
quiet: ctx.quiet,
|
|
211
|
+
nextPageArgs: (0, import_shared.buildListNextPageArgs)("subscription-billing-cycles", { first, query, sort: sortKey, reverse })
|
|
212
|
+
});
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
if (verb === "charge") {
|
|
216
|
+
const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: { "contract-id": { type: "string" }, "cycle-index": { type: "string" } } });
|
|
217
|
+
const subscriptionContractId = requireContractId(args["contract-id"]);
|
|
218
|
+
const cycleIndex = parseCycleIndex(args["cycle-index"]);
|
|
219
|
+
const result = await (0, import_router.runMutation)(ctx, {
|
|
220
|
+
subscriptionBillingCycleCharge: {
|
|
221
|
+
__args: { subscriptionContractId, billingCycleSelector: { index: cycleIndex } },
|
|
222
|
+
subscriptionBillingAttempt: subscriptionBillingAttemptSummarySelection,
|
|
223
|
+
userErrors: { field: true, message: true }
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
if (result === void 0) return;
|
|
227
|
+
(0, import_userErrors.maybeFailOnUserErrors)({ payload: result.subscriptionBillingCycleCharge, failOnUserErrors: ctx.failOnUserErrors });
|
|
228
|
+
if (ctx.quiet) return console.log(result.subscriptionBillingCycleCharge?.subscriptionBillingAttempt?.id ?? "");
|
|
229
|
+
(0, import_output.printJson)(result.subscriptionBillingCycleCharge, ctx.format !== "raw");
|
|
230
|
+
return;
|
|
231
|
+
}
|
|
232
|
+
if (verb === "skip" || verb === "unskip" || verb === "schedule-edit" || verb === "contract-edit" || verb === "edit-delete") {
|
|
233
|
+
const args = (0, import_router.parseStandardArgs)({
|
|
234
|
+
argv,
|
|
235
|
+
extraOptions: { "contract-id": { type: "string" }, "cycle-index": { type: "string" } }
|
|
236
|
+
});
|
|
237
|
+
const contractId = requireContractId(args["contract-id"]);
|
|
238
|
+
const cycleIndex = parseCycleIndex(args["cycle-index"]);
|
|
239
|
+
const billingCycleInput = { contractId, selector: { index: cycleIndex } };
|
|
240
|
+
if (verb === "skip" || verb === "unskip") {
|
|
241
|
+
const mutationField = verb === "skip" ? "subscriptionBillingCycleSkip" : "subscriptionBillingCycleUnskip";
|
|
242
|
+
const result = await (0, import_router.runMutation)(ctx, {
|
|
243
|
+
[mutationField]: {
|
|
244
|
+
__args: { billingCycleInput },
|
|
245
|
+
billingCycle: subscriptionBillingCycleSummarySelection,
|
|
246
|
+
userErrors: { field: true, message: true }
|
|
247
|
+
}
|
|
248
|
+
});
|
|
249
|
+
if (result === void 0) return;
|
|
250
|
+
const payload = result[mutationField];
|
|
251
|
+
(0, import_userErrors.maybeFailOnUserErrors)({ payload, failOnUserErrors: ctx.failOnUserErrors });
|
|
252
|
+
if (ctx.quiet) return;
|
|
253
|
+
(0, import_output.printJson)(payload, ctx.format !== "raw");
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
if (verb === "schedule-edit") {
|
|
257
|
+
const built = (0, import_input.buildInput)({
|
|
258
|
+
inputArg: args.input,
|
|
259
|
+
setArgs: args.set,
|
|
260
|
+
setJsonArgs: args["set-json"]
|
|
261
|
+
});
|
|
262
|
+
if (!built.used) throw new import_errors.CliError("Missing --input or --set/--set-json", 2);
|
|
263
|
+
const result = await (0, import_router.runMutation)(ctx, {
|
|
264
|
+
subscriptionBillingCycleScheduleEdit: {
|
|
265
|
+
__args: { billingCycleInput, input: built.input },
|
|
266
|
+
billingCycle: subscriptionBillingCycleSummarySelection,
|
|
267
|
+
userErrors: { field: true, message: true }
|
|
268
|
+
}
|
|
269
|
+
});
|
|
270
|
+
if (result === void 0) return;
|
|
271
|
+
(0, import_userErrors.maybeFailOnUserErrors)({ payload: result.subscriptionBillingCycleScheduleEdit, failOnUserErrors: ctx.failOnUserErrors });
|
|
272
|
+
if (ctx.quiet) return;
|
|
273
|
+
(0, import_output.printJson)(result.subscriptionBillingCycleScheduleEdit, ctx.format !== "raw");
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
276
|
+
if (verb === "contract-edit") {
|
|
277
|
+
const built = (0, import_input.buildInput)({
|
|
278
|
+
inputArg: args.input,
|
|
279
|
+
setArgs: args.set,
|
|
280
|
+
setJsonArgs: args["set-json"]
|
|
281
|
+
});
|
|
282
|
+
const editResult = await (0, import_router.runMutation)(ctx, {
|
|
283
|
+
subscriptionBillingCycleContractEdit: {
|
|
284
|
+
__args: { billingCycleInput },
|
|
285
|
+
draft: { id: true },
|
|
286
|
+
userErrors: { field: true, message: true }
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
if (editResult === void 0) return;
|
|
290
|
+
(0, import_userErrors.maybeFailOnUserErrors)({ payload: editResult.subscriptionBillingCycleContractEdit, failOnUserErrors: ctx.failOnUserErrors });
|
|
291
|
+
const draftId = editResult.subscriptionBillingCycleContractEdit?.draft?.id;
|
|
292
|
+
if (!draftId || !built.used) {
|
|
293
|
+
if (ctx.quiet) return console.log(draftId ?? "");
|
|
294
|
+
(0, import_output.printJson)(editResult.subscriptionBillingCycleContractEdit, ctx.format !== "raw");
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
const updateResult = await (0, import_router.runMutation)(ctx, {
|
|
298
|
+
subscriptionDraftUpdate: {
|
|
299
|
+
__args: { draftId, input: built.input },
|
|
300
|
+
draft: { id: true },
|
|
301
|
+
userErrors: { field: true, message: true }
|
|
302
|
+
}
|
|
303
|
+
});
|
|
304
|
+
if (updateResult === void 0) return;
|
|
305
|
+
(0, import_userErrors.maybeFailOnUserErrors)({ payload: updateResult.subscriptionDraftUpdate, failOnUserErrors: ctx.failOnUserErrors });
|
|
306
|
+
if (ctx.quiet) return console.log(updateResult.subscriptionDraftUpdate?.draft?.id ?? "");
|
|
307
|
+
(0, import_output.printJson)(updateResult.subscriptionDraftUpdate, ctx.format !== "raw");
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
if (verb === "edit-delete") {
|
|
311
|
+
if (!args.yes) throw new import_errors.CliError("Refusing to delete without --yes", 2);
|
|
312
|
+
const result = await (0, import_router.runMutation)(ctx, {
|
|
313
|
+
subscriptionBillingCycleEditDelete: {
|
|
314
|
+
__args: { billingCycleInput },
|
|
315
|
+
billingCycles: subscriptionBillingCycleSummarySelection,
|
|
316
|
+
userErrors: { field: true, message: true }
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
if (result === void 0) return;
|
|
320
|
+
(0, import_userErrors.maybeFailOnUserErrors)({ payload: result.subscriptionBillingCycleEditDelete, failOnUserErrors: ctx.failOnUserErrors });
|
|
321
|
+
if (ctx.quiet) return;
|
|
322
|
+
(0, import_output.printJson)(result.subscriptionBillingCycleEditDelete, ctx.format !== "raw");
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
if (verb === "edits-delete") {
|
|
327
|
+
const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: { "contract-id": { type: "string" } } });
|
|
328
|
+
const contractId = requireContractId(args["contract-id"]);
|
|
329
|
+
if (!args.yes) throw new import_errors.CliError("Refusing to delete without --yes", 2);
|
|
330
|
+
const result = await (0, import_router.runMutation)(ctx, {
|
|
331
|
+
subscriptionBillingCycleEditsDelete: {
|
|
332
|
+
__args: { contractId, targetSelection: "ALL" },
|
|
333
|
+
billingCycles: subscriptionBillingCycleSummarySelection,
|
|
334
|
+
userErrors: { field: true, message: true }
|
|
335
|
+
}
|
|
336
|
+
});
|
|
337
|
+
if (result === void 0) return;
|
|
338
|
+
(0, import_userErrors.maybeFailOnUserErrors)({ payload: result.subscriptionBillingCycleEditsDelete, failOnUserErrors: ctx.failOnUserErrors });
|
|
339
|
+
if (ctx.quiet) return;
|
|
340
|
+
(0, import_output.printJson)(result.subscriptionBillingCycleEditsDelete, ctx.format !== "raw");
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
if (verb === "contract-draft-commit") {
|
|
344
|
+
const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: { "draft-id": { type: "string" } } });
|
|
345
|
+
const draftId = requireDraftId(args["draft-id"]);
|
|
346
|
+
const result = await (0, import_router.runMutation)(ctx, {
|
|
347
|
+
subscriptionBillingCycleContractDraftCommit: {
|
|
348
|
+
__args: { draftId },
|
|
349
|
+
contract: { createdAt: true, updatedAt: true },
|
|
350
|
+
userErrors: { field: true, message: true, code: true }
|
|
351
|
+
}
|
|
352
|
+
});
|
|
353
|
+
if (result === void 0) return;
|
|
354
|
+
(0, import_userErrors.maybeFailOnUserErrors)({ payload: result.subscriptionBillingCycleContractDraftCommit, failOnUserErrors: ctx.failOnUserErrors });
|
|
355
|
+
if (ctx.quiet) return;
|
|
356
|
+
(0, import_output.printJson)(result.subscriptionBillingCycleContractDraftCommit, ctx.format !== "raw");
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
if (verb === "contract-draft-concatenate") {
|
|
360
|
+
const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: { "draft-id": { type: "string" } } });
|
|
361
|
+
const draftId = requireDraftId(args["draft-id"]);
|
|
362
|
+
const built = (0, import_input.buildInput)({
|
|
363
|
+
inputArg: args.input,
|
|
364
|
+
setArgs: args.set,
|
|
365
|
+
setJsonArgs: args["set-json"]
|
|
366
|
+
});
|
|
367
|
+
if (!built.used) throw new import_errors.CliError("Missing --input or --set/--set-json", 2);
|
|
368
|
+
const concatenatedBillingCycleContracts = extractArrayField(built.input, "concatenatedBillingCycleContracts");
|
|
369
|
+
if (!concatenatedBillingCycleContracts || concatenatedBillingCycleContracts.length === 0) {
|
|
370
|
+
throw new import_errors.CliError("Missing concatenatedBillingCycleContracts array", 2);
|
|
371
|
+
}
|
|
372
|
+
const result = await (0, import_router.runMutation)(ctx, {
|
|
373
|
+
subscriptionBillingCycleContractDraftConcatenate: {
|
|
374
|
+
__args: { draftId, concatenatedBillingCycleContracts },
|
|
375
|
+
draft: { id: true },
|
|
376
|
+
userErrors: { field: true, message: true, code: true }
|
|
377
|
+
}
|
|
378
|
+
});
|
|
379
|
+
if (result === void 0) return;
|
|
380
|
+
(0, import_userErrors.maybeFailOnUserErrors)({ payload: result.subscriptionBillingCycleContractDraftConcatenate, failOnUserErrors: ctx.failOnUserErrors });
|
|
381
|
+
if (ctx.quiet) return console.log(result.subscriptionBillingCycleContractDraftConcatenate?.draft?.id ?? "");
|
|
382
|
+
(0, import_output.printJson)(result.subscriptionBillingCycleContractDraftConcatenate, ctx.format !== "raw");
|
|
383
|
+
return;
|
|
384
|
+
}
|
|
385
|
+
throw new import_errors.CliError(`Unknown verb for subscription-billing-cycles: ${verb}`, 2);
|
|
386
|
+
};
|
|
387
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
388
|
+
0 && (module.exports = {
|
|
389
|
+
runSubscriptionBillingCycles
|
|
390
|
+
});
|
|
391
|
+
//# sourceMappingURL=subscription-billing-cycles.js.map
|