@sixtyninecommerce/admin 0.7.0 → 0.9.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.
Files changed (161) hide show
  1. package/README.md +2445 -17
  2. package/dist/api-tokens/index.d.ts +15 -5
  3. package/dist/api-tokens/index.js +1 -0
  4. package/dist/apps/event-subscription.d.ts +59 -0
  5. package/dist/apps/event-subscription.js +32 -0
  6. package/dist/apps/hook-secret.d.ts +22 -0
  7. package/dist/apps/hook-secret.js +36 -0
  8. package/dist/apps/index.d.ts +54 -3
  9. package/dist/apps/index.js +17 -0
  10. package/dist/audit/index.d.ts +7 -0
  11. package/dist/auth/queries.d.ts +5 -1
  12. package/dist/auth/queries.js +6 -0
  13. package/dist/bulk/index.d.ts +323 -0
  14. package/dist/bulk/index.js +162 -0
  15. package/dist/catalog/assets.d.ts +147 -0
  16. package/dist/catalog/assets.js +164 -0
  17. package/dist/catalog/collections.d.ts +109 -0
  18. package/dist/catalog/collections.js +91 -0
  19. package/dist/catalog/facets.d.ts +103 -0
  20. package/dist/catalog/facets.js +100 -0
  21. package/dist/catalog/index.d.ts +115 -0
  22. package/dist/catalog/index.js +21 -0
  23. package/dist/catalog/options.d.ts +89 -0
  24. package/dist/catalog/options.js +88 -0
  25. package/dist/catalog/products-bulk.d.ts +21 -0
  26. package/dist/catalog/products-bulk.js +58 -0
  27. package/dist/catalog/products.d.ts +489 -0
  28. package/dist/catalog/products.js +365 -0
  29. package/dist/catalog/properties.d.ts +234 -0
  30. package/dist/catalog/properties.js +158 -0
  31. package/dist/catalog/types.d.ts +174 -0
  32. package/dist/catalog/types.js +141 -0
  33. package/dist/catalog/variants.d.ts +274 -0
  34. package/dist/catalog/variants.js +258 -0
  35. package/dist/catalog/visibility.d.ts +57 -0
  36. package/dist/catalog/visibility.js +59 -0
  37. package/dist/client.d.ts +171 -3
  38. package/dist/client.js +81 -12
  39. package/dist/compliance/index.d.ts +88 -0
  40. package/dist/compliance/index.js +88 -0
  41. package/dist/customer-data-redaction.d.ts +14 -0
  42. package/dist/customer-data-redaction.js +22 -0
  43. package/dist/customers/index.d.ts +428 -17
  44. package/dist/customers/index.js +322 -15
  45. package/dist/documents/index.d.ts +513 -16
  46. package/dist/documents/index.js +229 -3
  47. package/dist/events/index.d.ts +259 -0
  48. package/dist/events/index.js +147 -0
  49. package/dist/feeds/ai.d.ts +46 -0
  50. package/dist/feeds/ai.js +43 -0
  51. package/dist/feeds/categories.d.ts +50 -0
  52. package/dist/feeds/categories.js +56 -0
  53. package/dist/feeds/configs.d.ts +54 -0
  54. package/dist/feeds/configs.js +85 -0
  55. package/dist/feeds/identifier-fields.d.ts +25 -0
  56. package/dist/feeds/identifier-fields.js +29 -0
  57. package/dist/feeds/index.d.ts +54 -0
  58. package/dist/feeds/index.js +46 -0
  59. package/dist/feeds/preserve.d.ts +38 -0
  60. package/dist/feeds/preserve.js +74 -0
  61. package/dist/feeds/rules.d.ts +42 -0
  62. package/dist/feeds/rules.js +56 -0
  63. package/dist/feeds/types.d.ts +654 -0
  64. package/dist/feeds/types.js +135 -0
  65. package/dist/fulfillments/index.d.ts +360 -0
  66. package/dist/fulfillments/index.js +425 -0
  67. package/dist/heads/index.d.ts +60 -0
  68. package/dist/heads/index.js +45 -0
  69. package/dist/hooks/assignments.d.ts +90 -0
  70. package/dist/hooks/assignments.js +53 -0
  71. package/dist/hooks/index.d.ts +97 -0
  72. package/dist/hooks/index.js +76 -0
  73. package/dist/index.d.ts +84 -9
  74. package/dist/index.js +16 -1
  75. package/dist/jobs/bulk-action-run.d.ts +65 -0
  76. package/dist/jobs/bulk-action-run.js +70 -0
  77. package/dist/locations/index.d.ts +6 -2
  78. package/dist/meta/index.d.ts +32 -0
  79. package/dist/orders/commit-edit.d.ts +123 -0
  80. package/dist/orders/commit-edit.js +142 -0
  81. package/dist/orders/get.d.ts +722 -0
  82. package/dist/orders/get.js +530 -0
  83. package/dist/orders/index.d.ts +105 -20
  84. package/dist/orders/index.js +44 -0
  85. package/dist/orders/line-price-preview.d.ts +297 -0
  86. package/dist/orders/line-price-preview.js +50 -0
  87. package/dist/orders/manual-discounts.d.ts +132 -0
  88. package/dist/orders/manual-discounts.js +95 -0
  89. package/dist/orders/manual-pricing.d.ts +192 -0
  90. package/dist/orders/manual-pricing.js +72 -0
  91. package/dist/orders/order-entry.d.ts +566 -0
  92. package/dist/orders/order-entry.js +129 -0
  93. package/dist/orders/parcel-charge.d.ts +45 -0
  94. package/dist/orders/parcel-charge.js +55 -0
  95. package/dist/orders/plan-edit.d.ts +489 -0
  96. package/dist/orders/plan-edit.js +93 -0
  97. package/dist/orders/status.d.ts +235 -0
  98. package/dist/orders/status.js +96 -0
  99. package/dist/orders/surcharges.d.ts +75 -2
  100. package/dist/orders/surcharges.js +110 -4
  101. package/dist/payments/account-credit.d.ts +171 -0
  102. package/dist/payments/account-credit.js +107 -0
  103. package/dist/payments/index.d.ts +368 -2
  104. package/dist/payments/index.js +138 -0
  105. package/dist/platform/catalog.d.ts +148 -0
  106. package/dist/platform/catalog.js +74 -0
  107. package/dist/platform/entitlements.d.ts +111 -0
  108. package/dist/platform/entitlements.js +86 -0
  109. package/dist/platform/legal-entities.d.ts +139 -0
  110. package/dist/platform/legal-entities.js +126 -0
  111. package/dist/platform/legal-entity-numbering.d.ts +103 -0
  112. package/dist/platform/legal-entity-numbering.js +101 -0
  113. package/dist/platform/organization-membership.d.ts +80 -0
  114. package/dist/platform/organization-membership.js +71 -0
  115. package/dist/platform/organization-settings.d.ts +33 -0
  116. package/dist/platform/organization-settings.js +42 -0
  117. package/dist/platform/organization-sharing.d.ts +172 -0
  118. package/dist/platform/organization-sharing.js +120 -0
  119. package/dist/platform/organizations.d.ts +205 -0
  120. package/dist/platform/organizations.js +180 -0
  121. package/dist/platform/provision-store.d.ts +88 -8
  122. package/dist/platform/provision-store.js +12 -0
  123. package/dist/platform/reports.d.ts +46 -0
  124. package/dist/platform/reports.js +31 -0
  125. package/dist/platform/server-metrics.d.ts +58 -0
  126. package/dist/platform/server-metrics.js +11 -0
  127. package/dist/pos/index.d.ts +567 -0
  128. package/dist/pos/index.js +205 -0
  129. package/dist/pricing/index.d.ts +405 -0
  130. package/dist/pricing/index.js +351 -0
  131. package/dist/provenance/index.d.ts +93 -0
  132. package/dist/provenance/index.js +53 -0
  133. package/dist/reports/index.d.ts +199 -0
  134. package/dist/reports/index.js +154 -0
  135. package/dist/shipping/parcel-count-suggestion.d.ts +52 -0
  136. package/dist/shipping/parcel-count-suggestion.js +73 -0
  137. package/dist/shipping/parcel-rule.d.ts +48 -0
  138. package/dist/shipping/parcel-rule.js +91 -0
  139. package/dist/stock/index.d.ts +166 -0
  140. package/dist/stock/index.js +115 -0
  141. package/dist/stock/transfers.d.ts +520 -0
  142. package/dist/stock/transfers.js +437 -0
  143. package/dist/stored-value/index.d.ts +154 -0
  144. package/dist/stored-value/index.js +130 -0
  145. package/dist/tenant/capabilities.d.ts +10 -0
  146. package/dist/tenant/entitlements.d.ts +35 -0
  147. package/dist/tenant/entitlements.js +15 -0
  148. package/dist/tenant/field-groups.d.ts +64 -0
  149. package/dist/tenant/field-groups.js +34 -0
  150. package/dist/tenant/legal-entity.d.ts +32 -0
  151. package/dist/tenant/legal-entity.js +41 -0
  152. package/dist/tenant/notifications.d.ts +148 -0
  153. package/dist/tenant/notifications.js +79 -0
  154. package/dist/tenant/retention.d.ts +10 -4
  155. package/dist/tenant/settings-sources.d.ts +103 -0
  156. package/dist/tenant/settings-sources.js +92 -0
  157. package/dist/types.d.ts +86 -11
  158. package/dist/uploads/index.d.ts +11 -7
  159. package/dist/users/index.d.ts +104 -0
  160. package/dist/users/index.js +80 -0
  161. package/package.json +3 -2
@@ -0,0 +1,53 @@
1
+ export const ASSIGNMENT_FIELDS = /* GraphQL */ `
2
+ id
3
+ kind
4
+ installationId
5
+ appSlug
6
+ locationId
7
+ paymentMethodId
8
+ createdAt
9
+ removedAt
10
+ `;
11
+ export const LIST_QUERY = /* GraphQL */ `
12
+ query AppProviderAssignments($kind: String) {
13
+ appProviderAssignments(kind: $kind) { ${ASSIGNMENT_FIELDS} }
14
+ }
15
+ `;
16
+ export const ASSIGN_MUTATION = /* GraphQL */ `
17
+ mutation AssignAppProvider($input: AssignAppProviderInput!) {
18
+ assignAppProvider(input: $input) { ${ASSIGNMENT_FIELDS} }
19
+ }
20
+ `;
21
+ export const UNASSIGN_MUTATION = /* GraphQL */ `
22
+ mutation UnassignAppProvider($id: ID!) {
23
+ unassignAppProvider(id: $id) { ${ASSIGNMENT_FIELDS} }
24
+ }
25
+ `;
26
+ export function createAppProviderAssignmentsModule(transport) {
27
+ return {
28
+ async list(options) {
29
+ const data = await transport.graphql({ api: 'admin', query: LIST_QUERY, variables: { kind: options?.kind ?? null } }, options);
30
+ return data.appProviderAssignments;
31
+ },
32
+ async assign(input, options) {
33
+ const data = await transport.graphql({
34
+ api: 'admin',
35
+ query: ASSIGN_MUTATION,
36
+ variables: {
37
+ input: {
38
+ installationId: input.installationId,
39
+ kind: input.kind,
40
+ locationId: input.locationId ?? null,
41
+ paymentMethod: input.paymentMethod ?? null,
42
+ idempotencyKey: options?.idempotencyKey ?? null,
43
+ },
44
+ },
45
+ }, options);
46
+ return data.assignAppProvider;
47
+ },
48
+ async unassign(id, options) {
49
+ const data = await transport.graphql({ api: 'admin', query: UNASSIGN_MUTATION, variables: { id } }, options);
50
+ return data.unassignAppProvider;
51
+ },
52
+ };
53
+ }
@@ -0,0 +1,97 @@
1
+ import type { Transport } from '@sixtyninecommerce/core';
2
+ import { type AppInstallation } from '../apps/index.js';
3
+ import type { Call } from '../types.js';
4
+ import { type AppProviderAssignmentsModule } from './assignments.js';
5
+ /** The answer to one hook ping. */
6
+ export interface AppHookPing {
7
+ /** True when the app answered any 2xx within its kind's budget. */
8
+ ok: boolean;
9
+ /**
10
+ * Why not: `timeout`, `network`, `tls`, `redirect`, `http_status`, `private_host`,
11
+ * `suspended` or `not_configured`. Null when `ok`.
12
+ */
13
+ reason: string | null;
14
+ /** The status the app answered, when it answered one. */
15
+ httpStatus: number | null;
16
+ durationMs: number;
17
+ }
18
+ /** One hook kind's health on one installation (spec §8.14, §15.19). */
19
+ export interface AppHookHealth {
20
+ /** `order.validate` | `shipping.rates` | `tax.calculate` | `payment.provider` | `fulfillment.service`. */
21
+ kind: string;
22
+ /**
23
+ * `healthy` | `unhealthy`. Unhealthy: 20 failures in a row, and the platform
24
+ * no longer calls the hook until it is re-enabled ({@link HooksModule.reenable}).
25
+ * A validation, payment or tax hook then keeps checkout CLOSED (tax refuses
26
+ * placement) until the app is re-enabled or the store suspends the
27
+ * installation ({@link HooksModule.suspend}); a rates hook falls back to the
28
+ * platform's methods and a fulfilment request stays pending.
29
+ */
30
+ state: string;
31
+ /** Failures in a row; any answer (including a business "no") resets it. */
32
+ consecutiveFailures: number;
33
+ /** ISO-8601 with offset. */
34
+ lastFailureAt: string | null;
35
+ /** `timeout` | `network` | `tls` | `redirect` | `http_status` | `invalid_response` | `private_host`. */
36
+ lastFailureReason: string | null;
37
+ /** ISO-8601 with offset; accurate to a minute. */
38
+ lastSuccessAt: string | null;
39
+ /** ISO-8601 with offset; null while healthy. */
40
+ suspendedAt: string | null;
41
+ }
42
+ /**
43
+ * App hooks (spec §8.14, §9.2 `hooks`): the platform calling an installed app
44
+ * synchronously — validation, rates, tax, payment, fulfilment — signed with the
45
+ * installation's hook secret, bounded by a budget per kind, never redirected,
46
+ * and audited (`admin.audit.calls({ integration: 'app_hook' })`).
47
+ */
48
+ export interface HooksModule {
49
+ /** Which installation is the store's tax, payment or fulfillment provider. */
50
+ assignments: AppProviderAssignmentsModule;
51
+ /**
52
+ * Send a signed ping to one hook of an installation, as the platform would
53
+ * call it: same signature, budget, SSRF guard and audit row. Needs
54
+ * `InstallApps`. Refused `HOOK_NOT_FOUND` when the installation is not on this
55
+ * store or has no consented hook of `kind`, `HOOK_KIND_INVALID` for an unknown kind.
56
+ */
57
+ ping(installationId: string, kind: string, options?: Call): Promise<AppHookPing>;
58
+ /**
59
+ * The health of every hook kind the installation consented to. Readable by
60
+ * the installation itself (its own credential) or an `InstallApps` admin of
61
+ * its store; any other installation id reads `HOOK_NOT_FOUND`.
62
+ */
63
+ health(installationId: string, options?: Call): Promise<AppHookHealth[]>;
64
+ /**
65
+ * Re-enable hook kinds suspended for health — each only after a signed ping
66
+ * of that kind succeeds, so fix the app first. `kind` omitted = every
67
+ * suspended kind. The installation itself or an `InstallApps` admin.
68
+ *
69
+ * Refused `HOOK_STILL_FAILING` (a `BusinessRuleError`, 422) when a ping fails;
70
+ * its message names each kind and why, and the kinds whose ping passed are
71
+ * re-enabled anyway. `INSTALLATION_NOT_ACTIVE` when the store has suspended
72
+ * the installation: {@link HooksModule.resume} it first. Answers the
73
+ * installation's health. One attempt: it calls the app.
74
+ */
75
+ reenable(installationId: string, kind?: string | null, options?: Omit<Call, 'idempotencyKey'>): Promise<AppHookHealth[]>;
76
+ /**
77
+ * Suspend an installation on this store — the escape when its hook blocks
78
+ * checkout (spec §15.19): every token dies, its hooks stop being called, its
79
+ * event deliveries pause. Grants and settings are kept; {@link resume} undoes
80
+ * it. `reason` (1-500 characters) goes to the audit trail. Idempotent.
81
+ * Needs `InstallApps`. Refused `INSTALLATION_NOT_ACTIVE` for an uninstalled
82
+ * installation, `INSTALLATION_SUSPENSION_REASON_INVALID` (a `ValidationError`)
83
+ * for a blank or long reason.
84
+ */
85
+ suspend(installationId: string, input: {
86
+ reason: string;
87
+ }, options?: Call): Promise<AppInstallation>;
88
+ /**
89
+ * Resume a suspended installation: back to `active`, or to `needs_consent`
90
+ * when the app's declarations grew meanwhile. The app mints fresh tokens.
91
+ * Hook kinds suspended for health stay suspended ({@link reenable}). Refused
92
+ * `INSTALLATION_NOT_SUSPENDED`. Needs `InstallApps`.
93
+ */
94
+ resume(installationId: string, options?: Call): Promise<AppInstallation>;
95
+ }
96
+ export declare function createHooksModule(transport: Transport): HooksModule;
97
+ export type { AppProviderAssignment, AppProviderAssignmentsModule, AppProviderKind, AssignAppProviderInput, } from './assignments.js';
@@ -0,0 +1,76 @@
1
+ import { INSTALLATION_FIELDS } from '../apps/index.js';
2
+ import { createAppProviderAssignmentsModule, } from './assignments.js';
3
+ const HEALTH_FIELDS = /* GraphQL */ `
4
+ kind
5
+ state
6
+ consecutiveFailures
7
+ lastFailureAt
8
+ lastFailureReason
9
+ lastSuccessAt
10
+ suspendedAt
11
+ `;
12
+ const HEALTH_QUERY = /* GraphQL */ `
13
+ query AppHookHealth($installationId: ID!) {
14
+ appHookHealth(installationId: $installationId) { ${HEALTH_FIELDS} }
15
+ }
16
+ `;
17
+ const REENABLE_MUTATION = /* GraphQL */ `
18
+ mutation ReenableAppHooks($installationId: ID!, $kind: String) {
19
+ reenableAppHooks(installationId: $installationId, kind: $kind) { ${HEALTH_FIELDS} }
20
+ }
21
+ `;
22
+ const SUSPEND_MUTATION = /* GraphQL */ `
23
+ mutation SuspendAppInstallation($id: ID!, $reason: String!) {
24
+ suspendAppInstallation(id: $id, reason: $reason) { ${INSTALLATION_FIELDS} }
25
+ }
26
+ `;
27
+ const RESUME_MUTATION = /* GraphQL */ `
28
+ mutation ResumeAppInstallation($id: ID!) {
29
+ resumeAppInstallation(id: $id) { ${INSTALLATION_FIELDS} }
30
+ }
31
+ `;
32
+ const PING_MUTATION = /* GraphQL */ `
33
+ mutation PingAppHook($installationId: ID!, $kind: String!) {
34
+ pingAppHook(installationId: $installationId, kind: $kind) {
35
+ ok
36
+ reason
37
+ httpStatus
38
+ durationMs
39
+ }
40
+ }
41
+ `;
42
+ export function createHooksModule(transport) {
43
+ return {
44
+ assignments: createAppProviderAssignmentsModule(transport),
45
+ async ping(installationId, kind, options) {
46
+ const data = await transport.graphql({ api: 'admin', query: PING_MUTATION, variables: { installationId, kind } }, options);
47
+ return data.pingAppHook;
48
+ },
49
+ async health(installationId, options) {
50
+ const data = await transport.graphql({ api: 'admin', query: HEALTH_QUERY, variables: { installationId } }, options);
51
+ return data.appHookHealth;
52
+ },
53
+ async reenable(installationId, kind, options) {
54
+ // ONE attempt: each try pings the app (up to 10 s for a payment hook),
55
+ // and a retry after a lost answer only repeats what already happened.
56
+ const data = await transport.graphql({
57
+ api: 'admin',
58
+ query: REENABLE_MUTATION,
59
+ variables: { installationId, kind: kind ?? null },
60
+ }, { ...options, retry: { attempts: 1 } });
61
+ return data.reenableAppHooks;
62
+ },
63
+ async suspend(installationId, input, options) {
64
+ const data = await transport.graphql({
65
+ api: 'admin',
66
+ query: SUSPEND_MUTATION,
67
+ variables: { id: installationId, reason: input.reason },
68
+ }, options);
69
+ return data.suspendAppInstallation;
70
+ },
71
+ async resume(installationId, options) {
72
+ const data = await transport.graphql({ api: 'admin', query: RESUME_MUTATION, variables: { id: installationId } }, options);
73
+ return data.resumeAppInstallation;
74
+ },
75
+ };
76
+ }
package/dist/index.d.ts CHANGED
@@ -34,22 +34,56 @@ export type { DeprecationNotice, Page, PageMeta, RateLimitInfo, RetryPolicy, } f
34
34
  * it without adding a direct dependency on `@sixtyninecommerce/core` — which,
35
35
  * being transitive, pnpm would not resolve for them anyway.
36
36
  */
37
- export { APP_MANIFEST_SCHEMA, APP_MANIFEST_SCHEMA_SOURCE, AuthenticationError, BusinessRuleError, ConflictError, type ErrorDetail, NotFoundError, PermissionDeniedError, PlatformError, type ProblemDetails, RateLimitedError, TransportError, UpstreamError, ValidationError, } from '@sixtyninecommerce/core';
37
+ /** Platform events: the webhook handler, the verifier and the payload types, from core. */
38
+ export { APP_MANIFEST_SCHEMA, APP_MANIFEST_SCHEMA_SOURCE, AuthenticationError, BusinessRuleError, ConflictError, createEventHandler, type ErrorDetail, type EventFeedPage, type EventHandlerOptions, type EventHandlers, type EventStream, EventStreamClosedError, type EventStreamCloseReason, type EventStreamOptions, type EventStreamTicket, type EventStreamTicketOptions, type HookRefusalFacts, HookRejectedError, HookUnavailableError, isEventType, NotFoundError, PermissionDeniedError, PlatformError, type PlatformEventEnvelope, type PlatformEventPayloadByTypeV1, type PlatformEventTypeV1, type PollAllOptions, type PollOptions, type ProblemDetails, RateLimitedError, type ReplayOptions, TransportError, type TypedEnvelope, UpstreamError, ValidationError, verifyEventDelivery, } from '@sixtyninecommerce/core';
38
39
  export type { ApiTokensModule, CreatedApiToken } from './api-tokens/index.js';
39
40
  export type { AppCryptoKey, AppPrivateKey } from './apps/assertion.js';
40
41
  export type { AppInstallationConfig, AppInstallationConfigModule } from './apps/config.js';
41
42
  export type { AppCredential, AppCredentialConfig } from './apps/credential.js';
42
- export type { App, AppInstallation, ApproveConsentInput, AppsModule, InstallAppInput, } from './apps/index.js';
43
+ export type { AppEventSubscription, AppEventSubscriptionModule, } from './apps/event-subscription.js';
44
+ export type { AppHookSecret, AppHookSecretModule } from './apps/hook-secret.js';
45
+ export type { App, AppInstallation, ApproveConsentInput, AppsModule, FieldGroupOwnerRef, InstallAppInput, } from './apps/index.js';
43
46
  export type { AuditCall, AuditCallFilter, AuditCorrelation, AuditEvent, AuditEventFilter, AuditModule, } from './audit/index.js';
44
47
  export type { AuthModule } from './auth/index.js';
48
+ export type { BulkEntity, BulkExportOptions, BulkFile, BulkImportOptions, BulkMode, BulkModule, BulkOperation, BulkOperationStatus, BulkResultsFilter, BulkRow, BulkRowResult, BulkRowStatus, } from './bulk/index.js';
49
+ export type { Asset, AssetDescription, AssetDescriptionsModule, AssetDescriptionsResult, AssetFile, AssetListOptions, AssetsModule, CreateAssetInput, UpdateAssetInput, } from './catalog/assets.js';
50
+ export type { Collection, CollectionListOptions, CollectionsModule, CollectionTranslationInput, CreateCollectionInput, UpdateCollectionInput, } from './catalog/collections.js';
51
+ export type { CreateFacetInput, CreateFacetValueInput, Facet, FacetListOptions, FacetsModule, FacetTranslationInput, FacetValue, UpdateFacetInput, UpdateFacetValueInput, } from './catalog/facets.js';
52
+ export type { CatalogModule } from './catalog/index.js';
53
+ export type { CreateOptionGroupInput, CreateOptionInput, OptionsModule, OptionTranslationInput, ProductOption, ProductOptionGroup, UpdateOptionGroupInput, UpdateOptionInput, } from './catalog/options.js';
54
+ export type { AvailabilityInStoresInput, CreateProductInput, LocalCopyOriginalOutcome, LocalCopyResult, LocalCopySkuInput, OrganizationProductAvailabilityAction, OrganizationProductAvailabilityChange, OrganizationProductStoreAvailability, OrganizationProductStoreState, Product, ProductCollectionNotRemovedReason, ProductCollectionsResult, ProductListFilter, ProductListOptions, ProductOptionGroupRef, ProductOptionRef, ProductsModule, ProductTranslation, ProductTranslationInput, SetAvailabilityInStoresInput, UpdateProductInput, } from './catalog/products.js';
55
+ export { MAX_AVAILABILITY_PRODUCTS, MAX_AVAILABILITY_STORES, MAX_PRODUCT_COLLECTION_IDS, MAX_STORE_EXCLUSION_PRODUCTS, } from './catalog/products.js';
56
+ export type { ProductBulkAction, ProductBulkInput, ProductBulkRun, } from './catalog/products-bulk.js';
57
+ export { MAX_BULK_PRODUCTS, PRODUCT_BULK_ACTIONS } from './catalog/products-bulk.js';
58
+ export type { ContentFacetSyncResult, CreatePropertyGroupInput, CreatePropertyInput, ProductPropertyGroupValues, ProductPropertyValue, PropertiesModule, Property, PropertyConfig, PropertyFieldType, PropertyGroup, SetPropertyValueInput, UpdatePropertyGroupInput, UpdatePropertyInput, } from './catalog/properties.js';
59
+ export type { AssetRef, Availability, AvailabilityInput, CatalogueOwnership, CatalogueOwnershipState, ConfigurableOperation, ConfigurableOperationInput, FacetValueRef, PriceBasis, ProductAvailabilityState, TranslationInput, VariantAvailabilityState, } from './catalog/types.js';
60
+ export type { CreateProductVariantInput, InventoryFlag, ParcelPacking, ProductVariant, StockLevel, StockLevelInput, UpdateProductVariantInput, VariantPriceSource, VariantPriceSourceKind, VariantsModule, VariantTranslationInput, } from './catalog/variants.js';
61
+ export { MAX_REVERT_PRICE_VARIANTS } from './catalog/variants.js';
62
+ export type { ProductVisibility, ProductVisibilityMode, SetProductVisibilityInput, VisibilityModule, } from './catalog/visibility.js';
45
63
  export { type AdminClient, type AdminClientConfig, type AppAuthConfig, createAdminClient, type SessionConfig, } from './client.js';
64
+ export type { AcknowledgeComplianceOptions, ComplianceAcknowledgement, ComplianceListOptions, ComplianceModule, ComplianceRequest, ComplianceRequestKind, } from './compliance/index.js';
46
65
  export type { Form, FormField, FormFieldInput, FormFieldTranslation, FormFieldTranslationInput, FormInput, FormsModule, FormTranslation, FormTranslationInput, } from './content/forms.js';
47
66
  export type { CustomObject, CustomObjectsModule } from './custom-objects/index.js';
48
- export type { CreateCustomerInput, CreatedCustomer, Customer, CustomerAddress, CustomerAddressesModule, CustomerErasureRecord, CustomerGroupRef, CustomerGroupsModule, CustomerInvitation, CustomerInviteMode, CustomersModule, EraseCustomerOptions, UpdateCustomerInput, } from './customers/index.js';
49
- export type { CreditNote, DocumentData, DocumentDataIssuer, DocumentDataLine, DocumentDataNumbering, DocumentDataParty, DocumentDataTaxRow, DocumentDataTotals, DocumentExtensionInput, DocumentExtensionSchema, DocumentExtensionsModule, DocumentLineInput, DocumentsModule, DocumentType, GenerateDocumentOptions, Invoice, IssuePartialCreditNoteInput, IssueSupplementaryInvoiceInput, PackingSlip, RegisterDocumentExtensionInput, SendInvoiceEmailInput, } from './documents/index.js';
67
+ export type { ActAsCustomerOptions, CreateCustomerInput, CreatedCustomer, Customer, CustomerAddress, CustomerAddressesModule, CustomerAgentSession, CustomerErasureRecord, CustomerExternalRef, CustomerExternalRefKey, CustomerGroup, CustomerGroupRef, CustomerGroupsModule, CustomerInvitation, CustomerInviteMode, CustomersModule, EndedCustomerAgentSession, EraseCustomerOptions, ExternalKeyedCustomerGroup, InviteB2BCustomersOptions, InviteB2BCustomersResult, ReplacedCustomerGroupMembers, RequestCustomerDataOptions, UpdateCustomerInput, UpsertCustomerByExternalRefInput, UpsertedCustomer, UpsertedCustomerGroup, } from './customers/index.js';
68
+ export { MAX_REPLACE_GROUP_MEMBERS } from './customers/index.js';
69
+ export type { CommitInvoiceCorrectionCall, CreditNote, CreditNoteEmailSend, CustomerDocument, DocumentData, DocumentDataIssuer, DocumentDataLine, DocumentDataNumbering, DocumentDataParty, DocumentDataTaxRow, DocumentDataTotals, DocumentDownloadUrl, DocumentExtensionInput, DocumentExtensionSchema, DocumentExtensionsModule, DocumentLine, DocumentLineInput, DocumentsModule, DocumentType, GenerateDocumentOptions, Invoice, InvoiceAddressCorrection, InvoiceCorrectionCommit, InvoiceCorrectionCommittedDocument, InvoiceCorrectionDocument, InvoiceCorrectionInput, InvoiceCorrectionLedger, InvoiceCorrectionLine, InvoiceCorrectionOutcome, InvoiceCorrectionPlan, InvoiceCorrectionTotals, IssuePartialCreditNoteInput, IssueSupplementaryInvoiceInput, PackingSlip, RegisterDocumentExtensionInput, SendCreditNoteEmailInput, SendInvoiceEmailInput, } from './documents/index.js';
50
70
  export { MAX_DOCUMENT_EXTENSIONS } from './documents/index.js';
51
71
  export { AdminProjectionError } from './errors.js';
52
- export type { CreateHeadInput, Head, HeadsModule, UpdateHeadInput, } from './heads/index.js';
72
+ export type { CreatedEventSubscription, EventDelivery, EventRedrive, EventSendTestOptions, EventSendTestResult, EventSubscription, EventSubscriptionInput, EventSubscriptionsModule, EventSubscriptionUpdate, EventsModule, RedriveAnswer, RedriveRequestState, RotatedEventSubscriptionSecret, } from './events/index.js';
73
+ export { MAX_REDRIVE_EVENT_IDS } from './events/index.js';
74
+ /**
75
+ * Product feeds — the merchandising surface that turns the catalogue into a
76
+ * Google, Meta, TikTok or Pinterest feed: the configurations, their rule ASTs,
77
+ * the runs and item issues the generator produces, the Google-taxonomy mapping
78
+ * and the two AI helpers.
79
+ */
80
+ export type { BulkStatusUpdateResult, BulkUpdateCategoryMappingStatusInput, CategorySuggestEnqueueResult, CategorySuggestStatus, CreateFeedCategoryMappingInput, CreateFeedConfigInput, CreateFeedInternalFieldInput, CreateFeedLookupTableInput, FeedAiModule, FeedAiSuggestion, FeedAiSuggestionKind, FeedAiSuggestionStatus, FeedCategoryMapping, FeedCategoryMappingSource, FeedCategoryMappingStatus, FeedCategoryMappingsModule, FeedCategoryMatchType, FeedCategorySuggestState, FeedCategorySuggestSummary, FeedCondition, FeedConditionGroup, FeedConditionOperand, FeedConditionOperator, FeedConditionValue, FeedConfig, FeedConfigSettings, FeedConfigsModule, FeedDeliveryMode, FeedDestination, FeedDestinationKey, FeedDestinationTemplateEntry, FeedFieldMapping, FeedFieldRule, FeedFilterSpec, FeedIdentifierFieldSupport, FeedIdentifierFieldsModule, FeedInternalField, FeedInternalFieldRules, FeedInternalFieldSpec, FeedInternalFieldsModule, FeedItemIssue, FeedItemIssueSeverity, FeedLookupEntry, FeedLookupTable, FeedLookupTablesModule, FeedMappingSpec, FeedPerDestinationCategories, FeedPreview, FeedPreviewDraft, FeedPreviewIssue, FeedPreviewItem, FeedRegenerateResult, FeedRegenerateThrottle, FeedRun, FeedRunStats, FeedRunStatus, FeedRunTrigger, FeedsModule, FeedTaxonomyModule, FeedTaxonomyNode, FeedTransformSpec, FeedValueSource, GenerateTitlePresetInput, ListFeedCategoryMappingsOptions, ListFeedConfigsOptions, ListFeedIssuesOptions, ListFeedRunsOptions, RotateFeedTokenResult, SearchTaxonomyOptions, SuggestCategoryMappingsInput, TitlePresetExample, TitlePresetPayload, TitlePresetStatus, UpdateFeedCategoryMappingInput, UpdateFeedConfigInput, UpdateFeedInternalFieldInput, UpdateFeedLookupTableInput, } from './feeds/index.js';
81
+ export { AI_UNAVAILABLE_CODE, DEFAULT_FEED_PAGE_LIMIT, DEFAULT_PREVIEW_SAMPLE_SIZE, DEFAULT_REFRESH_INTERVAL_MINUTES, FEED_CATEGORY_MAPPING_SOURCES, FEED_CATEGORY_MAPPING_STATUSES, FEED_CATEGORY_MATCH_TYPES, FEED_CONDITION_OPERATORS, FEED_DESTINATIONS, FEED_IDENTIFIER_PATTERN, FEED_ITEM_ISSUE_SEVERITIES, FEED_PREVIEW_TIMEOUT_MS, FEED_REGENERATE_THROTTLED, FEED_RUN_STATUSES, FEED_RUN_TRIGGERS, FEED_TRANSFORM_KINDS, FEED_VALUE_SOURCE_KINDS, isAiUnavailable, isFeedConditionGroup, isFeedValueSourceKind, MAX_BULK_STATUS_IDS, MAX_FEED_PAGE_LIMIT, MAX_LOOKUP_ENTRIES, MAX_PREVIEW_SAMPLE_SIZE, MAX_REFRESH_INTERVAL_MINUTES, MIN_REFRESH_INTERVAL_MINUTES, readFeedRegenerateThrottle, TAXONOMY_DEFAULT_LIMIT, TAXONOMY_MAX_LIMIT, TITLE_PRESET_TIMEOUT_MS, VALUELESS_FEED_CONDITION_OPERATORS, } from './feeds/index.js';
82
+ export type { AppFulfillmentReportState, CancelFulfillmentInput, CancelledFulfillment, ChargedParcelCountInput, FulfillmentCancelChoice, FulfillmentCancelOverpayment, FulfillmentCancelPreview, FulfillmentCancelSettlement, FulfillmentLabel, FulfillmentLabelFormat, FulfillmentParcelTracking, FulfillmentsModule, LabelMyparcelParcelsInput, MyparcelParcelsLabelRequest, MyparcelRetractionVerdict, MyparcelUnretractedShipment, OrderFulfillmentParcels, OrderFulfillmentUnretractedShipments, ReportAppFulfillmentInput, ReportedAppFulfillment, WarehouseDemandRouting, } from './fulfillments/index.js';
83
+ export type { CreateHeadInput, Head, HeadPrivateTokensModule, HeadStorefrontToken, HeadsModule, IssuedHeadStorefrontToken, UpdateHeadInput, } from './heads/index.js';
84
+ export type { AppHookHealth, AppHookPing, AppProviderAssignment, AppProviderAssignmentsModule, AppProviderKind, AssignAppProviderInput, HooksModule, } from './hooks/index.js';
85
+ export type { BulkActionItem, BulkActionRun, BulkActionRunStatus, } from './jobs/bulk-action-run.js';
86
+ export { TERMINAL_BULK_ACTION_STATUSES } from './jobs/bulk-action-run.js';
53
87
  /**
54
88
  * `JobHandle` and `WaitOptions` are exported from here AND from
55
89
  * `./platform/provision-store.js`, which re-exports them: they used to live
@@ -63,18 +97,59 @@ export { OPENING_HOURS_DAYS } from './locations/index.js';
63
97
  export type { ApiTokenTemplate, JsonSchema, LabelMap, MetaCatalog, MetaCatalogLabels, MetaCatalogPermissions, MetaCatalogPlugins, MetaCatalogTransitions, MetaModule, PermissionGroup, PluginCatalogEntry, RoleTemplate, StatusMetaMap, StatusTone, TransitionMap, } from './meta/index.js';
64
98
  export type { Metafield, MetafieldAttachment, MetafieldDefinition, MetafieldDefinitionsModule, MetafieldMoney, MetafieldOwnerType, MetafieldReference, MetafieldScalarType, MetafieldsModule, MetafieldType, MetafieldVisibility, SetMetafieldInput, UpsertMetafieldDefinitionInput, } from './metafields/index.js';
65
99
  export { METAFIELD_OWNER_TYPES, METAFIELD_SCALAR_TYPES } from './metafields/index.js';
66
- export type { OrderSettlement, OrdersModule } from './orders/index.js';
67
- export type { SurchargeCall, SurchargedOrder, SurchargeInput, SurchargesModule, } from './orders/surcharges.js';
68
- export type { OrderPaymentPosition, PaidOrder, PaymentsModule, ProviderConnection, ProviderCredentialPath, ProviderOnboardingStart, ProviderReadiness, ProvidersModule, ProviderTerminal, ProviderTerminalsModule, ProvisionTerminalInput, ReadinessOptions, RecordPaymentInput, } from './payments/index.js';
100
+ export type { CommitOrderEditCall, OrderCommitEditModule, OrderEditCommit, OrderEditCommittedOrder, OrderEditCommittedRefund, OrderEditOverpaymentSettlement, } from './orders/commit-edit.js';
101
+ export type { Order, OrderAddress, OrderAfasFields, OrderAsset, OrderCustomer, OrderCustomerAddress, OrderCustomerAfasFields, OrderCustomerParasutFields, OrderCustomerVatFields, OrderCustomFields, OrderDeliveryAdvice, OrderDeliverySelectionSource, OrderDeliveryTerms, OrderDeliveryTermsStatus, OrderFor, OrderFulfillment, OrderFulfillmentDetails, OrderFulfillmentHold, OrderFulfillmentHoldReason, OrderFulfillmentMyparcelFields, OrderGetAnswer, OrderGetModule, OrderGetOptions, OrderHistoryEntry, OrderInclude, OrderLine, OrderLineAllocation, OrderLineCustomFields, OrderLineOutstandingAllocation, OrderLineStockLevel, OrderLineVariant, OrderPackingSlip, OrderParasutFields, OrderPayment, OrderPaymentTerms, OrderPaymentTermsClassification, OrderPaymentTermsFields, OrderPaymentTermsStatus, OrderPriceList, OrderRefund, OrderSurcharge, OrderTaxSummary, } from './orders/get.js';
102
+ export { ORDER_INCLUDES } from './orders/get.js';
103
+ export type { OrderProviderFallback, OrderSettlement, OrdersModule } from './orders/index.js';
104
+ export type { LineNotPurchasableCode, LinePricePreview, LinePricePreviewBase, LinePriceStackingStep, NotPurchasableLinePricePreview, OrderLinePriceBasis, OrderLinePricePreviewModule, OrderLinePriceSource, PreviewLineDiscountType, PreviewLinePriceLine, PreviewLinePriceOverride, PreviewOneTimeDiscount, PurchasableLinePricePreview, } from './orders/line-price-preview.js';
105
+ export type { DiscountPolicy, DiscountPolicyInput, DiscountPolicyModule, DiscountReason, DiscountReasonInput, DiscountReasonsModule, ManualDiscountsModule, OrderManualDiscount, } from './orders/manual-discounts.js';
106
+ export type { LinePriceInput, OneTimeDiscountType, OneTimeLineDiscountInput, OneTimeOrderDiscountInput, OrderManualPricingModule, SetLinePricesInput, SetOneTimeDiscountsInput, } from './orders/manual-pricing.js';
107
+ export type { ExternalLinePriceBasis, ExternalOrder, ExternalOrderAddressInput, ExternalOrderCall, ExternalOrderCatalogLine, ExternalOrderExternalLine, ExternalOrderFulfilment, ExternalOrderInput, ExternalOrderLine, ExternalOrderLineInput, ExternalOrderSurcharge, ExternalOrderSurchargeInput, ExternalOrderTargetState, ExternalOrderTaxLine, OrderEntryModule, } from './orders/order-entry.js';
108
+ export type { OrderParcelCharge, OrderParcelChargeFulfillment, OrderParcelChargeModule, } from './orders/parcel-charge.js';
109
+ export type { OrderEditAddress, OrderEditAddressPatch, OrderEditBlocker, OrderEditBlockerCode, OrderEditDiff, OrderEditDiscount, OrderEditDiscountType, OrderEditNotice, OrderEditNoticeCode, OrderEditOverpayment, OrderEditPayment, OrderEditPlan, OrderEditPreview, OrderEditPriceOverride, OrderEditRefund, OrderEditStep, OrderEditStepKind, OrderEditSurcharge, OrderEditTaxSummaryLine, OrderPlanEditModule, } from './orders/plan-edit.js';
110
+ export type { OrderAllocationBadge, OrderEditBlockCode, OrderLockReason, OrderStatusAction, OrderStatusActionName, OrderStatusModule, OrderStatusProviderFallback, OrderStatusReasonCode, OrderStatusView, } from './orders/status.js';
111
+ export { ORDER_ALLOCATION_BADGES, ORDER_EDIT_BLOCK_CODES, ORDER_LOCK_REASONS, ORDER_STATUS_ACTIONS, ORDER_STATUS_REASON_CODES, } from './orders/status.js';
112
+ export type { OrderOverpaymentChoice, OverpaymentOption, SurchargeCall, SurchargeChange, SurchargeChangePreview, SurchargedOrder, SurchargeInput, SurchargeRemoveCall, SurchargesModule, } from './orders/surcharges.js';
113
+ export type { AccountCreditModule, ApplyUnappliedCashInput, AppPayment, AppPaymentReportState, CreditOverpaymentInput, IssuedRefund, OrderMoneyOnAccount, OrderPaymentPosition, OrderRefundPosition, PaidOrder, PaymentsModule, ProviderConnection, ProviderCredentialPath, ProviderOnboardingStart, ProviderReadiness, ProvidersModule, ProviderTerminal, ProviderTerminalsModule, ProvisionTerminalInput, ReadinessOptions, ReconcileRefundInput, RecordPaymentInput, RefundablePayment, RefundPaymentInput, RefundProviderOutcome, RefundUnappliedCashInput, ReportAppPaymentInput, ReportedAppPayment, UnappliedCash, UnappliedCashRefund, UnreconciledRefund, } from './payments/index.js';
69
114
  export type { AppKey, PlatformAppsModule, RegisterAppResult, RegisteredApp, } from './platform/apps.js';
115
+ export type { PlatformCatalogModule, RepairTranslationLanguagesInput, TranslationRepairEntity, TranslationRepairEntityKind, TranslationRepairNameMismatch, TranslationRepairPage, TranslationRepairRemovedRow, TranslationRepairSkipped, TranslationRepairSkipReason, } from './platform/catalog.js';
116
+ export type { PlatformEntitlementSource, PlatformEntitlementsModule, PlatformPluginEntitlement, SetPlatformEntitlementOptions, } from './platform/entitlements.js';
70
117
  export { requireHumanSession } from './platform/guard.js';
118
+ export type { CreateLegalEntityInput, LegalEntity, LegalEntityFields, LegalEntityListOptions, LegalEntityStore, PlatformLegalEntitiesModule, UpdateLegalEntityInput, } from './platform/legal-entities.js';
119
+ export type { LegalEntityNumbering, LegalEntityNumberingSeries, LegalEntityNumberingSeriesName, PlatformLegalEntityNumberingModule, TenantLegalEntityNumberingModule, UpdateLegalEntityNumberingInput, } from './platform/legal-entity-numbering.js';
120
+ export type { JoinOrganizationInput, OrganizationMembership, OrganizationMembershipMethods, } from './platform/organization-membership.js';
121
+ export type { OrganizationSettingsMethods, OrganizationSettingsOverride, } from './platform/organization-settings.js';
122
+ export type { OrganizationSettingsKindSwitchOff, OrganizationSettingsSwitchOff, OrganizationSharingKind, OrganizationSharingKindInput, OrganizationSharingKindState, OrganizationSharingModule, SetOrganizationSharingKindInput, } from './platform/organization-sharing.js';
123
+ export type { CreateOrganizationInput, Organization, OrganizationAssortmentMode, OrganizationCustomerPolicy, OrganizationEntitlementsModule, OrganizationPluginEntitlement, PlatformOrganizationsModule, SetOrganizationEntitlementInput, UpdateOrganizationInput, } from './platform/organizations.js';
71
124
  export type { PlatformModule, ProvisionProfile, ProvisionRun, ProvisionRunStatus, ProvisionStep, ProvisionStepStatus, ProvisionStoreInput, ProvisionStoreResult, } from './platform/provision-store.js';
72
125
  export { PROVISION_PROFILES } from './platform/provision-store.js';
126
+ export type { FleetChannelMetric, FleetReportInput, PlatformReportsModule, } from './platform/reports.js';
127
+ export type { PlatformServerMetricsModule, ServerMetricPoint, ServerMetrics, ServerMetricsInput, ServerMetricsOverview, ServerMetricsRange, } from './platform/server-metrics.js';
128
+ export type { CompletedPosSale, OpenPosSessionInput, PosCall, PosCart, PosCashModule, PosCashMovement, PosCashMovementType, PosDevice, PosDevicesModule, PosModule, PosMoneyCall, PosReceiptNumbering, PosReceiptNumberingModule, PosRefund, PosRefundsModule, PosRegister, PosRegisterSession, PosRegistersModule, PosSaleModule, PosSessionsModule, PosSessionTotals, PosTenderResult, PosTendersModule, PosXReport, } from './pos/index.js';
129
+ export type { ActivePromotion, ActivePromotionsFilter, CreatePromotionInput, DiscountedOrderLine, LocalTime, OrderDiscount, OrderDiscounts, OrderPackage, PricingCouponsModule, PricingModule, PricingPromotion, PricingPromotionsModule, PromotionOperationSummary, PromotionTranslationInput, SetComponent, UpdatePromotionInput, Weekday, } from './pricing/index.js';
130
+ export { promotionActions, promotionConditions } from './pricing/index.js';
131
+ export type { EntityProvenance, ProvenanceActor, ProvenanceEntityType, ProvenanceFieldGroup, ProvenanceManagedBy, ProvenanceModule, } from './provenance/index.js';
132
+ export { PROVENANCE_MAX_IDS } from './provenance/index.js';
133
+ export type { LowStockInput, LowStockVariant, PopularVariant, PopularVariantsInput, ReportDay, ReportExport, ReportExportFilter, ReportExportKind, ReportOverview, ReportOverviewInput, ReportPeriod, ReportsModule, ReportTotals, } from './reports/index.js';
73
134
  export type { Redirect, RedirectCreateInput, RedirectsModule, RedirectUpdateInput, } from './seo/redirects.js';
135
+ export type { ParcelCountSuggestion, ParcelCountSuggestionInput, ParcelCountSuggestionItem, ParcelCountSuggestionMethod, } from './shipping/parcel-count-suggestion.js';
136
+ export { PARCEL_SUGGESTION_MAX_ITEMS, PARCEL_SUGGESTION_MAX_QUANTITY, } from './shipping/parcel-count-suggestion.js';
137
+ export type { ParcelRule, ParcelRuleModule, SetParcelRuleInput, ShippingModule, } from './shipping/parcel-rule.js';
138
+ export { PARCEL_CAPACITY_MAX, PARCEL_WEIGHT_GRAMS_MAX } from './shipping/parcel-rule.js';
139
+ export type { AdjustStockInput, ReleasedAllocation, StockAllocationsModule, StockModule, StockMovement, StockMovementFilter, StockMovementType, StockPosition, StockPositionOptions, } from './stock/index.js';
140
+ export type { CloseStockTransferOptions, CreateStockTransferInput, CreateStockTransferReturnInput, ReceiveStockTransferLineInput, ShipStockTransferInput, StockTransfer, StockTransferAddress, StockTransferAddressInput, StockTransferCancellation, StockTransferFilter, StockTransferKind, StockTransferLabel, StockTransferLabelFormat, StockTransferLine, StockTransferLineInput, StockTransferParcel, StockTransferParcels, StockTransferReturnableLine, StockTransferReturnRef, StockTransferReturns, StockTransferShortfall, StockTransferShortfallDisposition, StockTransferShortfallLine, StockTransferShortfallLineInput, StockTransferStaffRef, StockTransferState, StockTransfersModule, UpdateStockTransferInput, } from './stock/transfers.js';
141
+ export type { IssueStoredValueInput, RedeemStoredValueInput, StoredValueAccount, StoredValueEntry, StoredValueLiability, StoredValueModule, StoredValueRedemption, StoredValueStatement, } from './stored-value/index.js';
74
142
  export type { TaxClass, TaxClassesModule, TaxClassMapping, TaxClassTaxCategory, TaxMappingsModule, TaxModule, UpsertTaxClassInput, } from './tax/index.js';
75
143
  export { TAX_CLASS_FALLBACK_COUNTRY } from './tax/index.js';
76
144
  export type { CapabilitiesModule, Capability, CapabilityManifest, } from './tenant/capabilities.js';
77
145
  export type { ChannelsModule } from './tenant/channels.js';
146
+ export type { TenantEntitlement, TenantEntitlementSource, TenantEntitlementsReader, } from './tenant/entitlements.js';
147
+ export type { FieldGroupOwnership, FieldGroupOwnersReader, FieldGroupSyncSource, FieldGroupSyncSourcesReader, } from './tenant/field-groups.js';
148
+ export type { LegalEntityModule } from './tenant/legal-entity.js';
149
+ export type { NotificationEventConfig, NotificationRecipientSegment, NotificationRecipients, NotificationSender, NotificationsModule, UpdateNotificationEventConfigInput, } from './tenant/notifications.js';
78
150
  export type { ChannelRetention, RetentionHold, RetentionModule, SetRetentionInput, } from './tenant/retention.js';
79
- export type { ApiToken, Call, ChannelInfo, CreateApiTokenInput, ListOptions, Me, TenantContext, TenantScope, UpdateApiTokenInput, WhoAmI, } from './types.js';
151
+ export type { ChannelSettingsSource, SettingsGroup, SettingsSourceKind, SettingsSourcesModule, } from './tenant/settings-sources.js';
152
+ export { SETTINGS_GROUPS } from './tenant/settings-sources.js';
153
+ export type { ApiToken, Call, ChannelInfo, CreateApiTokenInput, FieldGroupGrantRefusalCode, ListOptions, Me, MeChannel, TenantContext, TenantScope, UpdateApiTokenInput, WhoAmI, } from './types.js';
80
154
  export type { ClaimAsAssetInput, StagedUpload, StagedUploadTicket, StageUploadInput, UploadBody, UploadPurpose, UploadStatus, UploadsModule, } from './uploads/index.js';
155
+ export type { EnsureUserInput, EnsureUserOutcome, EnsureUserResult, StaffUser, UpdateUserInput, UserRoleRequest, UsersModule, } from './users/index.js';
package/dist/index.js CHANGED
@@ -27,13 +27,28 @@
27
27
  * it without adding a direct dependency on `@sixtyninecommerce/core` — which,
28
28
  * being transitive, pnpm would not resolve for them anyway.
29
29
  */
30
- export { APP_MANIFEST_SCHEMA, APP_MANIFEST_SCHEMA_SOURCE, AuthenticationError, BusinessRuleError, ConflictError, NotFoundError, PermissionDeniedError, PlatformError, RateLimitedError, TransportError, UpstreamError, ValidationError, } from '@sixtyninecommerce/core';
30
+ /** Platform events: the webhook handler, the verifier and the payload types, from core. */
31
+ export { APP_MANIFEST_SCHEMA, APP_MANIFEST_SCHEMA_SOURCE, AuthenticationError, BusinessRuleError, ConflictError, createEventHandler, EventStreamClosedError, HookRejectedError, HookUnavailableError, isEventType, NotFoundError, PermissionDeniedError, PlatformError, RateLimitedError, TransportError, UpstreamError, ValidationError, verifyEventDelivery, } from '@sixtyninecommerce/core';
32
+ export { MAX_AVAILABILITY_PRODUCTS, MAX_AVAILABILITY_STORES, MAX_PRODUCT_COLLECTION_IDS, MAX_STORE_EXCLUSION_PRODUCTS, } from './catalog/products.js';
33
+ export { MAX_BULK_PRODUCTS, PRODUCT_BULK_ACTIONS } from './catalog/products-bulk.js';
34
+ export { MAX_REVERT_PRICE_VARIANTS } from './catalog/variants.js';
31
35
  export { createAdminClient, } from './client.js';
36
+ export { MAX_REPLACE_GROUP_MEMBERS } from './customers/index.js';
32
37
  export { MAX_DOCUMENT_EXTENSIONS } from './documents/index.js';
33
38
  export { AdminProjectionError } from './errors.js';
39
+ export { MAX_REDRIVE_EVENT_IDS } from './events/index.js';
40
+ export { AI_UNAVAILABLE_CODE, DEFAULT_FEED_PAGE_LIMIT, DEFAULT_PREVIEW_SAMPLE_SIZE, DEFAULT_REFRESH_INTERVAL_MINUTES, FEED_CATEGORY_MAPPING_SOURCES, FEED_CATEGORY_MAPPING_STATUSES, FEED_CATEGORY_MATCH_TYPES, FEED_CONDITION_OPERATORS, FEED_DESTINATIONS, FEED_IDENTIFIER_PATTERN, FEED_ITEM_ISSUE_SEVERITIES, FEED_PREVIEW_TIMEOUT_MS, FEED_REGENERATE_THROTTLED, FEED_RUN_STATUSES, FEED_RUN_TRIGGERS, FEED_TRANSFORM_KINDS, FEED_VALUE_SOURCE_KINDS, isAiUnavailable, isFeedConditionGroup, isFeedValueSourceKind, MAX_BULK_STATUS_IDS, MAX_FEED_PAGE_LIMIT, MAX_LOOKUP_ENTRIES, MAX_PREVIEW_SAMPLE_SIZE, MAX_REFRESH_INTERVAL_MINUTES, MIN_REFRESH_INTERVAL_MINUTES, readFeedRegenerateThrottle, TAXONOMY_DEFAULT_LIMIT, TAXONOMY_MAX_LIMIT, TITLE_PRESET_TIMEOUT_MS, VALUELESS_FEED_CONDITION_OPERATORS, } from './feeds/index.js';
41
+ export { TERMINAL_BULK_ACTION_STATUSES } from './jobs/bulk-action-run.js';
34
42
  export { TERMINAL_JOB_STATUSES } from './jobs/index.js';
35
43
  export { OPENING_HOURS_DAYS } from './locations/index.js';
36
44
  export { METAFIELD_OWNER_TYPES, METAFIELD_SCALAR_TYPES } from './metafields/index.js';
45
+ export { ORDER_INCLUDES } from './orders/get.js';
46
+ export { ORDER_ALLOCATION_BADGES, ORDER_EDIT_BLOCK_CODES, ORDER_LOCK_REASONS, ORDER_STATUS_ACTIONS, ORDER_STATUS_REASON_CODES, } from './orders/status.js';
37
47
  export { requireHumanSession } from './platform/guard.js';
38
48
  export { PROVISION_PROFILES } from './platform/provision-store.js';
49
+ export { promotionActions, promotionConditions } from './pricing/index.js';
50
+ export { PROVENANCE_MAX_IDS } from './provenance/index.js';
51
+ export { PARCEL_SUGGESTION_MAX_ITEMS, PARCEL_SUGGESTION_MAX_QUANTITY, } from './shipping/parcel-count-suggestion.js';
52
+ export { PARCEL_CAPACITY_MAX, PARCEL_WEIGHT_GRAMS_MAX } from './shipping/parcel-rule.js';
39
53
  export { TAX_CLASS_FALLBACK_COUNTRY } from './tax/index.js';
54
+ export { SETTINGS_GROUPS } from './tenant/settings-sources.js';
@@ -0,0 +1,65 @@
1
+ import { type Transport } from '@sixtyninecommerce/core';
2
+ import type { Call } from '../types.js';
3
+ import { type JobHandle } from './index.js';
4
+ /**
5
+ * A bulk action run (`catalog.products.bulk`, and the orders kind of a later release): one call
6
+ * that acts on many records of the store as a job, each record through its single door and
7
+ * reported on its own. Read back through the Admin API's `bulkActionRun`.
8
+ */
9
+ /**
10
+ * `QUEUED` → `RUNNING` → `SUCCEEDED` (every item ran and has its own outcome, a `FAILED` item
11
+ * included), or `FAILED` (the run stopped before every item had an outcome; `items` lists the ones
12
+ * it reached), or `CANCELLED` (the items after the cancel did not run; `items` lists every one
13
+ * the run reached, the one running when the cancel landed included). A run cancelled while an item
14
+ * ran stays `RUNNING` until that item has its outcome. A string on the wire: a newer engine may add
15
+ * a status.
16
+ */
17
+ export type BulkActionRunStatus = 'QUEUED' | 'RUNNING' | 'SUCCEEDED' | 'FAILED' | 'CANCELLED';
18
+ /** A run nothing more will happen to. */
19
+ export declare const TERMINAL_BULK_ACTION_STATUSES: readonly string[];
20
+ /** One record's outcome. */
21
+ export interface BulkActionItem {
22
+ /** The record (a product id for `products.bulk`). */
23
+ id: string;
24
+ status: 'OK' | 'FAILED' | (string & {});
25
+ /**
26
+ * When `FAILED`: the single door's OWN code, the one a call of that door would have raised:
27
+ * `ENTITY_NOT_FOUND` (not in this store, another store's included), `SHARED_PRODUCT_NOT_ALLOWED`,
28
+ * `MANAGED_BY_ORGANIZATION`, `FIELD_GROUP_LOCKED`, `EXTERNAL_LINE_CARRIER_PROTECTED`,
29
+ * `PRODUCT_NOT_DELETED`, … Null when `OK`.
30
+ */
31
+ code: string | null;
32
+ /** When `FAILED`: the door's sentence. Null when `OK`. */
33
+ message: string | null;
34
+ /** What the action made: the new product of a `CLONE`. Null otherwise. */
35
+ newId: string | null;
36
+ }
37
+ export interface BulkActionRun<Action extends string = string> {
38
+ /** The run's id: the receipt `bulk()` answered. */
39
+ id: string;
40
+ /** `products.bulk`. */
41
+ kind: string;
42
+ action: Action | (string & {});
43
+ status: BulkActionRunStatus | (string & {});
44
+ /** How many records the run was asked to act on. */
45
+ total: number;
46
+ /** How many of them have an outcome. */
47
+ done: number;
48
+ /** One outcome per record reached, in the order the records were named. */
49
+ items: BulkActionItem[];
50
+ /** Why the RUN stopped early (`FAILED`); each item keeps its own code. Null otherwise. */
51
+ failure: {
52
+ code: string;
53
+ message: string;
54
+ } | null;
55
+ }
56
+ export declare const BULK_ACTION_RUN_QUERY = "\n query BulkActionRun($runId: ID!) {\n bulkActionRun(runId: $runId) {\n id\n kind\n action\n status\n total\n done\n items {\n id\n status\n code\n message\n newId\n }\n failure {\n code\n message\n }\n }\n }\n";
57
+ /** One read of a run. A run of another store, or one that does not exist, is `NotFoundError`. */
58
+ export declare function readBulkActionRun<Action extends string>(transport: Transport, runId: string, options?: Call): Promise<BulkActionRun<Action>>;
59
+ /**
60
+ * The handle a bulk submit answers. `wait()` polls the run until it is terminal and resolves with
61
+ * it WHATEVER the ending (a run whose items all failed still `SUCCEEDED` as a run); it throws only
62
+ * when waiting itself cannot go on: `JOB_WAIT_TIMEOUT`, an aborted signal, or a read refused for
63
+ * a reason polling cannot fix.
64
+ */
65
+ export declare function bulkActionHandle<Action extends string>(transport: Transport, runId: string, options?: Call): JobHandle<BulkActionRun<Action>>;
@@ -0,0 +1,70 @@
1
+ import { TransportError } from '@sixtyninecommerce/core';
2
+ import { fieldOf } from '../catalog/types.js';
3
+ import { pollUntilTerminal } from './index.js';
4
+ /** A run nothing more will happen to. */
5
+ export const TERMINAL_BULK_ACTION_STATUSES = [
6
+ 'SUCCEEDED',
7
+ 'FAILED',
8
+ 'CANCELLED',
9
+ ];
10
+ export const BULK_ACTION_RUN_QUERY = /* GraphQL */ `
11
+ query BulkActionRun($runId: ID!) {
12
+ bulkActionRun(runId: $runId) {
13
+ id
14
+ kind
15
+ action
16
+ status
17
+ total
18
+ done
19
+ items {
20
+ id
21
+ status
22
+ code
23
+ message
24
+ newId
25
+ }
26
+ failure {
27
+ code
28
+ message
29
+ }
30
+ }
31
+ }
32
+ `;
33
+ /** One read of a run. A run of another store, or one that does not exist, is `NotFoundError`. */
34
+ export function readBulkActionRun(transport, runId, options) {
35
+ return fieldOf(transport, BULK_ACTION_RUN_QUERY, 'bulkActionRun', { runId }, options);
36
+ }
37
+ /**
38
+ * The handle a bulk submit answers. `wait()` polls the run until it is terminal and resolves with
39
+ * it WHATEVER the ending (a run whose items all failed still `SUCCEEDED` as a run); it throws only
40
+ * when waiting itself cannot go on: `JOB_WAIT_TIMEOUT`, an aborted signal, or a read refused for
41
+ * a reason polling cannot fix.
42
+ */
43
+ export function bulkActionHandle(transport, runId, options) {
44
+ return {
45
+ runId,
46
+ wait(waitOptions) {
47
+ return pollUntilTerminal({
48
+ read: (signal) => readBulkActionRun(transport, runId, {
49
+ ...options,
50
+ ...(signal ? { signal } : {}),
51
+ }),
52
+ isTerminal: (run) => TERMINAL_BULK_ACTION_STATUSES.includes(run.status),
53
+ onTimeout: (seen) => bulkWaitTimeout(runId, seen),
54
+ ...waitOptions,
55
+ });
56
+ },
57
+ };
58
+ }
59
+ function bulkWaitTimeout(runId, run) {
60
+ const at = run
61
+ ? `while it was ${run.status} (${String(run.done)} of ${String(run.total)} done)`
62
+ : 'without reading it successfully';
63
+ return new TransportError({
64
+ code: 'JOB_WAIT_TIMEOUT',
65
+ message: `Stopped waiting for bulk run ${runId} ${at}. The run may still be going: read it again with its runId to follow it.`,
66
+ status: 0,
67
+ service: 'vendure',
68
+ retryable: true,
69
+ });
70
+ }
@@ -81,7 +81,7 @@ export interface LocationProfile {
81
81
  *
82
82
  * `address` is the one exception, because it writes through to the stock
83
83
  * location's own field: omit it to leave that field alone, pass `null` to clear
84
- * it.
84
+ * it. An address equal to the stored one writes nothing to that field.
85
85
  */
86
86
  export interface UpsertLocationProfileInput {
87
87
  stockLocationId: string;
@@ -107,7 +107,11 @@ export interface UpsertLocationProfileInput {
107
107
  * cannot probe another store's ids; `LOCATION_CODE_TAKEN` (→ `ConflictError`);
108
108
  * and `INVALID_LOCATION_CODE` / `INVALID_LOCATION_NAME` /
109
109
  * `INVALID_LOCATION_PHONE` / `INVALID_TIMEZONE` / `INVALID_OPENING_HOURS` /
110
- * `INVALID_ADDRESS` (→ `ValidationError`).
110
+ * `INVALID_ADDRESS` (→ `ValidationError`); and `LOCATION_NOT_ALLOWED`
111
+ * (→ `PermissionDeniedError`) when `upsert` changes or clears the `address` of a
112
+ * location a token or app installation restricted with `locationIds` does not
113
+ * hold. The address is the location's parcel sender. Sending the stored address
114
+ * back unchanged passes, and the profile's other fields are not restricted.
111
115
  *
112
116
  * `LOCATION_NOT_IN_CHANNEL` is NOT one of these: it belongs to the two places
113
117
  * that take a location id from outside this surface — `apiTokens.create`/
@@ -24,11 +24,21 @@ export interface MetaCatalogLabels {
24
24
  subscriptionStatus: LabelMap;
25
25
  quoteStatus: LabelMap;
26
26
  settlementMethod: LabelMap;
27
+ /** What a RETAIL credit note did, keyed by its `kind`. */
27
28
  creditNoteKind: LabelMap;
29
+ /**
30
+ * The same four kinds on the accounts-receivable ledger, in its own words:
31
+ * there `return` also covers a settled refund and a manual credit, so the
32
+ * retail "Return credited" would mislabel it. Pick the map by the note's
33
+ * ledger. Served by a platform from this release on.
34
+ */
35
+ arCreditNoteKind: LabelMap;
28
36
  auditService: LabelMap;
29
37
  auditCategory: LabelMap;
30
38
  auditEventOutcome: LabelMap;
31
39
  auditCallOutcome: LabelMap;
40
+ /** Who sends a notification event's email: `platform` or `none` (`admin.tenant.notifications`). */
41
+ notificationSender: LabelMap;
32
42
  /**
33
43
  * A vocabulary added after this SDK release arrives camelised, with its map
34
44
  * untouched.
@@ -59,10 +69,32 @@ export interface RoleTemplate {
59
69
  permissions: string[];
60
70
  }
61
71
  export interface ApiTokenTemplate {
72
+ /**
73
+ * The preset's stable key, accepted by `admin.apiTokens.create({ templateKeys })`.
74
+ * Shipped presets: `content`, `forms`, `catalog` (catalogue CRUD — the spec's
75
+ * "catalog-writer"), `readonly`, `external-tracking`, `platform-events` (event
76
+ * feed, read-only), `audit`, `pos`, `order-entry` (place and recover orders,
77
+ * caller-priced lines, find or create the customer), `customers` (customer CRUD
78
+ * without delete or erasure), `stock` (stock reads, adjustments and transfers
79
+ * through `AdjustStock`; it cannot edit locations or their settings), `events` (the
80
+ * event feed plus managing webhook subscriptions: `ReadPlatformEvents` +
81
+ * `ManageEventSubscriptions`), `full`, `sandbox-full` (for CI against a
82
+ * sandbox store: Full access plus the event feed and subscriptions, the audit
83
+ * trail, POS, tracking and stock moves; never user, token or app management)
84
+ * and `custom`. Read the live list from `meta.catalog()`; this one is
85
+ * documentation.
86
+ */
62
87
  key: string;
63
88
  label: string;
64
89
  description: string;
65
90
  permissions: string[];
91
+ /**
92
+ * `true` on a preset minted on a SANDBOX store only (`sandbox-full`);
93
+ * `apiTokens.create({ templateKeys })` refuses it elsewhere with
94
+ * `SANDBOX_ONLY_TEMPLATE`. A picker hides such a preset on a live store.
95
+ * Absent on every other preset, and on a platform older than this field.
96
+ */
97
+ sandbox?: boolean;
66
98
  }
67
99
  export interface MetaCatalogPermissions {
68
100
  /** Every permission name the Admin API registers. */