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,318 @@
|
|
|
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 company_contacts_exports = {};
|
|
20
|
+
__export(company_contacts_exports, {
|
|
21
|
+
runCompanyContacts: () => runCompanyContacts
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(company_contacts_exports);
|
|
24
|
+
var import_errors = require("../errors");
|
|
25
|
+
var import_input = require("../input");
|
|
26
|
+
var import_output = require("../output");
|
|
27
|
+
var import_router = require("../router");
|
|
28
|
+
var import_select = require("../selection/select");
|
|
29
|
+
var import_userErrors = require("../userErrors");
|
|
30
|
+
var import_shared = require("./_shared");
|
|
31
|
+
const companyContactSummarySelection = {
|
|
32
|
+
id: true,
|
|
33
|
+
isMainContact: true,
|
|
34
|
+
customer: { id: true, displayName: true, email: true }
|
|
35
|
+
};
|
|
36
|
+
const companyContactFullSelection = {
|
|
37
|
+
...companyContactSummarySelection,
|
|
38
|
+
locale: true,
|
|
39
|
+
title: true,
|
|
40
|
+
roles: {
|
|
41
|
+
__args: { first: 10 },
|
|
42
|
+
nodes: { id: true, name: true }
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const getCompanyContactSelection = (view) => {
|
|
46
|
+
if (view === "ids") return { id: true };
|
|
47
|
+
if (view === "full") return companyContactFullSelection;
|
|
48
|
+
if (view === "raw") return {};
|
|
49
|
+
return companyContactSummarySelection;
|
|
50
|
+
};
|
|
51
|
+
const companyContactRoleSelection = {
|
|
52
|
+
id: true,
|
|
53
|
+
name: true,
|
|
54
|
+
note: true
|
|
55
|
+
};
|
|
56
|
+
const runCompanyContacts = async ({
|
|
57
|
+
ctx,
|
|
58
|
+
verb,
|
|
59
|
+
argv
|
|
60
|
+
}) => {
|
|
61
|
+
if (argv.includes("--help") || argv.includes("-h")) {
|
|
62
|
+
console.log(
|
|
63
|
+
[
|
|
64
|
+
"Usage:",
|
|
65
|
+
" shop company-contacts <verb> [flags]",
|
|
66
|
+
"",
|
|
67
|
+
"Verbs:",
|
|
68
|
+
" create|get|update|delete|bulk-delete",
|
|
69
|
+
" role-get",
|
|
70
|
+
" assign-role|assign-roles|revoke-role|revoke-roles",
|
|
71
|
+
" remove-from-company|send-welcome-email",
|
|
72
|
+
"",
|
|
73
|
+
"Common output flags:",
|
|
74
|
+
" --view summary|ids|full|raw",
|
|
75
|
+
" --select <path> (repeatable; dot paths; adds to base view selection)",
|
|
76
|
+
" --selection <graphql> (selection override; can be @file.gql)"
|
|
77
|
+
].join("\n")
|
|
78
|
+
);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (verb === "role-get") {
|
|
82
|
+
const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: {} });
|
|
83
|
+
const id = (0, import_shared.requireId)(args.id, "CompanyContactRole");
|
|
84
|
+
const result = await (0, import_router.runQuery)(ctx, { companyContactRole: { __args: { id }, ...companyContactRoleSelection } });
|
|
85
|
+
if (result === void 0) return;
|
|
86
|
+
(0, import_output.printNode)({ node: result.companyContactRole, format: ctx.format, quiet: ctx.quiet });
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
if (verb === "get") {
|
|
90
|
+
const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: {} });
|
|
91
|
+
const id = (0, import_shared.requireId)(args.id, "CompanyContact");
|
|
92
|
+
const selection = (0, import_select.resolveSelection)({
|
|
93
|
+
resource: "company-contacts",
|
|
94
|
+
view: ctx.view,
|
|
95
|
+
baseSelection: getCompanyContactSelection(ctx.view),
|
|
96
|
+
select: args.select,
|
|
97
|
+
selection: args.selection,
|
|
98
|
+
include: args.include,
|
|
99
|
+
ensureId: ctx.quiet
|
|
100
|
+
});
|
|
101
|
+
const result = await (0, import_router.runQuery)(ctx, { companyContact: { __args: { id }, ...selection } });
|
|
102
|
+
if (result === void 0) return;
|
|
103
|
+
(0, import_output.printNode)({ node: result.companyContact, format: ctx.format, quiet: ctx.quiet });
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (verb === "create") {
|
|
107
|
+
const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: { "company-id": { type: "string" } } });
|
|
108
|
+
const companyId = (0, import_shared.requireId)(args["company-id"], "Company", "--company-id");
|
|
109
|
+
const built = (0, import_input.buildInput)({
|
|
110
|
+
inputArg: args.input,
|
|
111
|
+
setArgs: args.set,
|
|
112
|
+
setJsonArgs: args["set-json"]
|
|
113
|
+
});
|
|
114
|
+
if (!built.used) throw new import_errors.CliError("Missing --input or --set/--set-json", 2);
|
|
115
|
+
const result = await (0, import_router.runMutation)(ctx, {
|
|
116
|
+
companyContactCreate: {
|
|
117
|
+
__args: { companyId, input: built.input },
|
|
118
|
+
companyContact: companyContactSummarySelection,
|
|
119
|
+
userErrors: { field: true, message: true }
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
if (result === void 0) return;
|
|
123
|
+
(0, import_userErrors.maybeFailOnUserErrors)({ payload: result.companyContactCreate, failOnUserErrors: ctx.failOnUserErrors });
|
|
124
|
+
if (ctx.quiet) return console.log(result.companyContactCreate?.companyContact?.id ?? "");
|
|
125
|
+
(0, import_output.printJson)(result.companyContactCreate, ctx.format !== "raw");
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (verb === "update") {
|
|
129
|
+
const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: {} });
|
|
130
|
+
const id = (0, import_shared.requireId)(args.id, "CompanyContact");
|
|
131
|
+
const built = (0, import_input.buildInput)({
|
|
132
|
+
inputArg: args.input,
|
|
133
|
+
setArgs: args.set,
|
|
134
|
+
setJsonArgs: args["set-json"]
|
|
135
|
+
});
|
|
136
|
+
if (!built.used) throw new import_errors.CliError("Missing --input or --set/--set-json", 2);
|
|
137
|
+
const result = await (0, import_router.runMutation)(ctx, {
|
|
138
|
+
companyContactUpdate: {
|
|
139
|
+
__args: { companyContactId: id, input: built.input },
|
|
140
|
+
companyContact: companyContactSummarySelection,
|
|
141
|
+
userErrors: { field: true, message: true }
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
if (result === void 0) return;
|
|
145
|
+
(0, import_userErrors.maybeFailOnUserErrors)({ payload: result.companyContactUpdate, failOnUserErrors: ctx.failOnUserErrors });
|
|
146
|
+
if (ctx.quiet) return console.log(result.companyContactUpdate?.companyContact?.id ?? "");
|
|
147
|
+
(0, import_output.printJson)(result.companyContactUpdate, ctx.format !== "raw");
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
if (verb === "delete") {
|
|
151
|
+
const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: {} });
|
|
152
|
+
const id = (0, import_shared.requireId)(args.id, "CompanyContact");
|
|
153
|
+
if (!args.yes) throw new import_errors.CliError("Refusing to delete without --yes", 2);
|
|
154
|
+
const result = await (0, import_router.runMutation)(ctx, {
|
|
155
|
+
companyContactDelete: {
|
|
156
|
+
__args: { companyContactId: id },
|
|
157
|
+
deletedCompanyContactId: true,
|
|
158
|
+
userErrors: { field: true, message: true }
|
|
159
|
+
}
|
|
160
|
+
});
|
|
161
|
+
if (result === void 0) return;
|
|
162
|
+
(0, import_userErrors.maybeFailOnUserErrors)({ payload: result.companyContactDelete, failOnUserErrors: ctx.failOnUserErrors });
|
|
163
|
+
if (ctx.quiet) return console.log(result.companyContactDelete?.deletedCompanyContactId ?? "");
|
|
164
|
+
(0, import_output.printJson)(result.companyContactDelete, ctx.format !== "raw");
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
if (verb === "bulk-delete") {
|
|
168
|
+
const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: {} });
|
|
169
|
+
if (!args.yes) throw new import_errors.CliError("Refusing to bulk-delete without --yes", 2);
|
|
170
|
+
const companyContactIds = (0, import_shared.parseIds)(args.ids, "CompanyContact");
|
|
171
|
+
const result = await (0, import_router.runMutation)(ctx, {
|
|
172
|
+
companyContactsDelete: {
|
|
173
|
+
__args: { companyContactIds },
|
|
174
|
+
deletedCompanyContactIds: true,
|
|
175
|
+
userErrors: { field: true, message: true }
|
|
176
|
+
}
|
|
177
|
+
});
|
|
178
|
+
if (result === void 0) return;
|
|
179
|
+
(0, import_userErrors.maybeFailOnUserErrors)({ payload: result.companyContactsDelete, failOnUserErrors: ctx.failOnUserErrors });
|
|
180
|
+
if (ctx.quiet) return console.log((result.companyContactsDelete?.deletedCompanyContactIds ?? []).join("\n"));
|
|
181
|
+
(0, import_output.printJson)(result.companyContactsDelete, ctx.format !== "raw");
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
if (verb === "assign-role") {
|
|
185
|
+
const args = (0, import_router.parseStandardArgs)({
|
|
186
|
+
argv,
|
|
187
|
+
extraOptions: {
|
|
188
|
+
"role-id": { type: "string" },
|
|
189
|
+
"location-id": { type: "string" }
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
const id = (0, import_shared.requireId)(args.id, "CompanyContact");
|
|
193
|
+
const roleId = (0, import_shared.requireId)(args["role-id"], "CompanyContactRole", "--role-id");
|
|
194
|
+
const locationId = (0, import_shared.requireId)(args["location-id"], "CompanyLocation", "--location-id");
|
|
195
|
+
const result = await (0, import_router.runMutation)(ctx, {
|
|
196
|
+
companyContactAssignRole: {
|
|
197
|
+
__args: { companyContactId: id, companyContactRoleId: roleId, companyLocationId: locationId },
|
|
198
|
+
companyContactRoleAssignment: { id: true },
|
|
199
|
+
userErrors: { field: true, message: true }
|
|
200
|
+
}
|
|
201
|
+
});
|
|
202
|
+
if (result === void 0) return;
|
|
203
|
+
(0, import_userErrors.maybeFailOnUserErrors)({ payload: result.companyContactAssignRole, failOnUserErrors: ctx.failOnUserErrors });
|
|
204
|
+
if (ctx.quiet) return console.log(result.companyContactAssignRole?.companyContactRoleAssignment?.id ?? "");
|
|
205
|
+
(0, import_output.printJson)(result.companyContactAssignRole, ctx.format !== "raw");
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
if (verb === "assign-roles") {
|
|
209
|
+
const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: { "role-assignments": { type: "string" } } });
|
|
210
|
+
const id = (0, import_shared.requireId)(args.id, "CompanyContact");
|
|
211
|
+
const rolesToAssign = (0, import_shared.parseJsonArg)(args["role-assignments"], "--role-assignments");
|
|
212
|
+
const result = await (0, import_router.runMutation)(ctx, {
|
|
213
|
+
companyContactAssignRoles: {
|
|
214
|
+
__args: { companyContactId: id, rolesToAssign },
|
|
215
|
+
roleAssignments: { id: true },
|
|
216
|
+
userErrors: { field: true, message: true }
|
|
217
|
+
}
|
|
218
|
+
});
|
|
219
|
+
if (result === void 0) return;
|
|
220
|
+
(0, import_userErrors.maybeFailOnUserErrors)({ payload: result.companyContactAssignRoles, failOnUserErrors: ctx.failOnUserErrors });
|
|
221
|
+
if (ctx.quiet) {
|
|
222
|
+
const ids = (result.companyContactAssignRoles?.roleAssignments ?? []).map((r) => r?.id);
|
|
223
|
+
return console.log(ids.filter(Boolean).join("\n"));
|
|
224
|
+
}
|
|
225
|
+
(0, import_output.printJson)(result.companyContactAssignRoles, ctx.format !== "raw");
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
if (verb === "revoke-role") {
|
|
229
|
+
const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: { "role-assignment-id": { type: "string" } } });
|
|
230
|
+
const id = (0, import_shared.requireId)(args.id, "CompanyContact");
|
|
231
|
+
const assignmentId = (0, import_shared.requireId)(
|
|
232
|
+
args["role-assignment-id"],
|
|
233
|
+
"CompanyContactRoleAssignment",
|
|
234
|
+
"--role-assignment-id"
|
|
235
|
+
);
|
|
236
|
+
const result = await (0, import_router.runMutation)(ctx, {
|
|
237
|
+
companyContactRevokeRole: {
|
|
238
|
+
__args: { companyContactId: id, companyContactRoleAssignmentId: assignmentId },
|
|
239
|
+
revokedCompanyContactRoleAssignmentId: true,
|
|
240
|
+
userErrors: { field: true, message: true }
|
|
241
|
+
}
|
|
242
|
+
});
|
|
243
|
+
if (result === void 0) return;
|
|
244
|
+
(0, import_userErrors.maybeFailOnUserErrors)({ payload: result.companyContactRevokeRole, failOnUserErrors: ctx.failOnUserErrors });
|
|
245
|
+
if (ctx.quiet) return console.log(result.companyContactRevokeRole?.revokedCompanyContactRoleAssignmentId ?? "");
|
|
246
|
+
(0, import_output.printJson)(result.companyContactRevokeRole, ctx.format !== "raw");
|
|
247
|
+
return;
|
|
248
|
+
}
|
|
249
|
+
if (verb === "revoke-roles") {
|
|
250
|
+
const args = (0, import_router.parseStandardArgs)({
|
|
251
|
+
argv,
|
|
252
|
+
extraOptions: { "role-assignment-ids": { type: "string", multiple: true }, all: { type: "boolean" } }
|
|
253
|
+
});
|
|
254
|
+
const id = (0, import_shared.requireId)(args.id, "CompanyContact");
|
|
255
|
+
const revokeAll = Boolean(args.all);
|
|
256
|
+
const roleAssignmentIds = revokeAll ? void 0 : (0, import_shared.parseStringList)(args["role-assignment-ids"], "--role-assignment-ids");
|
|
257
|
+
const result = await (0, import_router.runMutation)(ctx, {
|
|
258
|
+
companyContactRevokeRoles: {
|
|
259
|
+
__args: { companyContactId: id, revokeAll, ...roleAssignmentIds ? { roleAssignmentIds } : {} },
|
|
260
|
+
revokedRoleAssignmentIds: true,
|
|
261
|
+
userErrors: { field: true, message: true }
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
if (result === void 0) return;
|
|
265
|
+
(0, import_userErrors.maybeFailOnUserErrors)({ payload: result.companyContactRevokeRoles, failOnUserErrors: ctx.failOnUserErrors });
|
|
266
|
+
if (ctx.quiet) {
|
|
267
|
+
const ids = result.companyContactRevokeRoles?.revokedRoleAssignmentIds ?? [];
|
|
268
|
+
return console.log(ids.filter(Boolean).join("\n"));
|
|
269
|
+
}
|
|
270
|
+
(0, import_output.printJson)(result.companyContactRevokeRoles, ctx.format !== "raw");
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
if (verb === "remove-from-company") {
|
|
274
|
+
const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: {} });
|
|
275
|
+
const id = (0, import_shared.requireId)(args.id, "CompanyContact");
|
|
276
|
+
const result = await (0, import_router.runMutation)(ctx, {
|
|
277
|
+
companyContactRemoveFromCompany: {
|
|
278
|
+
__args: { companyContactId: id },
|
|
279
|
+
removedCompanyContactId: true,
|
|
280
|
+
userErrors: { field: true, message: true }
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
if (result === void 0) return;
|
|
284
|
+
(0, import_userErrors.maybeFailOnUserErrors)({
|
|
285
|
+
payload: result.companyContactRemoveFromCompany,
|
|
286
|
+
failOnUserErrors: ctx.failOnUserErrors
|
|
287
|
+
});
|
|
288
|
+
if (ctx.quiet) return console.log(result.companyContactRemoveFromCompany?.removedCompanyContactId ?? "");
|
|
289
|
+
(0, import_output.printJson)(result.companyContactRemoveFromCompany, ctx.format !== "raw");
|
|
290
|
+
return;
|
|
291
|
+
}
|
|
292
|
+
if (verb === "send-welcome-email") {
|
|
293
|
+
const args = (0, import_router.parseStandardArgs)({ argv, extraOptions: { email: { type: "string" } } });
|
|
294
|
+
const id = (0, import_shared.requireId)(args.id, "CompanyContact");
|
|
295
|
+
const email = args.email ? (0, import_shared.parseJsonArg)(args.email, "--email", { allowEmpty: true }) : void 0;
|
|
296
|
+
const result = await (0, import_router.runMutation)(ctx, {
|
|
297
|
+
companyContactSendWelcomeEmail: {
|
|
298
|
+
__args: { companyContactId: id, ...email ? { email } : {} },
|
|
299
|
+
companyContact: companyContactSummarySelection,
|
|
300
|
+
userErrors: { field: true, message: true }
|
|
301
|
+
}
|
|
302
|
+
});
|
|
303
|
+
if (result === void 0) return;
|
|
304
|
+
(0, import_userErrors.maybeFailOnUserErrors)({
|
|
305
|
+
payload: result.companyContactSendWelcomeEmail,
|
|
306
|
+
failOnUserErrors: ctx.failOnUserErrors
|
|
307
|
+
});
|
|
308
|
+
if (ctx.quiet) return console.log(result.companyContactSendWelcomeEmail?.companyContact?.id ?? "");
|
|
309
|
+
(0, import_output.printJson)(result.companyContactSendWelcomeEmail, ctx.format !== "raw");
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
312
|
+
throw new import_errors.CliError(`Unknown verb for company-contacts: ${verb}`, 2);
|
|
313
|
+
};
|
|
314
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
315
|
+
0 && (module.exports = {
|
|
316
|
+
runCompanyContacts
|
|
317
|
+
});
|
|
318
|
+
//# sourceMappingURL=company-contacts.js.map
|