@sixtyninecommerce/admin 0.8.0 → 0.10.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 (179) hide show
  1. package/README.md +2739 -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 +650 -0
  28. package/dist/catalog/products.js +458 -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 +324 -0
  34. package/dist/catalog/variants.js +288 -0
  35. package/dist/catalog/visibility.d.ts +57 -0
  36. package/dist/catalog/visibility.js +59 -0
  37. package/dist/client.d.ts +192 -3
  38. package/dist/client.js +87 -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 +437 -0
  66. package/dist/fulfillments/index.js +534 -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 +95 -9
  74. package/dist/index.js +21 -1
  75. package/dist/integrations/index.d.ts +14 -0
  76. package/dist/integrations/index.js +9 -0
  77. package/dist/integrations/pipelines.d.ts +113 -0
  78. package/dist/integrations/pipelines.js +62 -0
  79. package/dist/integrations/types.d.ts +176 -0
  80. package/dist/integrations/types.js +8 -0
  81. package/dist/jobs/bulk-action-run.d.ts +74 -0
  82. package/dist/jobs/bulk-action-run.js +69 -0
  83. package/dist/locations/index.d.ts +6 -2
  84. package/dist/meta/index.d.ts +32 -0
  85. package/dist/orders/bulk.d.ts +75 -0
  86. package/dist/orders/bulk.js +150 -0
  87. package/dist/orders/commit-edit.d.ts +123 -0
  88. package/dist/orders/commit-edit.js +142 -0
  89. package/dist/orders/deposit-policy.d.ts +103 -0
  90. package/dist/orders/deposit-policy.js +202 -0
  91. package/dist/orders/get.d.ts +722 -0
  92. package/dist/orders/get.js +530 -0
  93. package/dist/orders/index.d.ts +186 -21
  94. package/dist/orders/index.js +57 -0
  95. package/dist/orders/line-price-preview.d.ts +297 -0
  96. package/dist/orders/line-price-preview.js +50 -0
  97. package/dist/orders/manual-discounts.d.ts +141 -0
  98. package/dist/orders/manual-discounts.js +97 -0
  99. package/dist/orders/manual-pricing.d.ts +192 -0
  100. package/dist/orders/manual-pricing.js +72 -0
  101. package/dist/orders/order-entry.d.ts +566 -0
  102. package/dist/orders/order-entry.js +129 -0
  103. package/dist/orders/parcel-charge.d.ts +45 -0
  104. package/dist/orders/parcel-charge.js +55 -0
  105. package/dist/orders/plan-edit.d.ts +489 -0
  106. package/dist/orders/plan-edit.js +93 -0
  107. package/dist/orders/status.d.ts +235 -0
  108. package/dist/orders/status.js +96 -0
  109. package/dist/orders/surcharges.d.ts +75 -2
  110. package/dist/orders/surcharges.js +110 -4
  111. package/dist/payments/account-credit.d.ts +171 -0
  112. package/dist/payments/account-credit.js +107 -0
  113. package/dist/payments/index.d.ts +241 -9
  114. package/dist/payments/index.js +92 -0
  115. package/dist/payments/methods.d.ts +37 -0
  116. package/dist/payments/methods.js +33 -0
  117. package/dist/platform/catalog.d.ts +148 -0
  118. package/dist/platform/catalog.js +74 -0
  119. package/dist/platform/entitlements.d.ts +111 -0
  120. package/dist/platform/entitlements.js +86 -0
  121. package/dist/platform/legal-entities.d.ts +139 -0
  122. package/dist/platform/legal-entities.js +126 -0
  123. package/dist/platform/legal-entity-numbering.d.ts +103 -0
  124. package/dist/platform/legal-entity-numbering.js +101 -0
  125. package/dist/platform/organization-membership.d.ts +80 -0
  126. package/dist/platform/organization-membership.js +71 -0
  127. package/dist/platform/organization-settings.d.ts +33 -0
  128. package/dist/platform/organization-settings.js +42 -0
  129. package/dist/platform/organization-sharing.d.ts +172 -0
  130. package/dist/platform/organization-sharing.js +120 -0
  131. package/dist/platform/organizations.d.ts +205 -0
  132. package/dist/platform/organizations.js +180 -0
  133. package/dist/platform/provision-store.d.ts +88 -8
  134. package/dist/platform/provision-store.js +12 -0
  135. package/dist/platform/reports.d.ts +46 -0
  136. package/dist/platform/reports.js +31 -0
  137. package/dist/platform/server-metrics.d.ts +58 -0
  138. package/dist/platform/server-metrics.js +11 -0
  139. package/dist/pos/index.d.ts +567 -0
  140. package/dist/pos/index.js +205 -0
  141. package/dist/pricing/index.d.ts +408 -0
  142. package/dist/pricing/index.js +353 -0
  143. package/dist/pricing/vouchers.d.ts +103 -0
  144. package/dist/pricing/vouchers.js +69 -0
  145. package/dist/provenance/index.d.ts +93 -0
  146. package/dist/provenance/index.js +53 -0
  147. package/dist/reports/index.d.ts +199 -0
  148. package/dist/reports/index.js +154 -0
  149. package/dist/returns/index.d.ts +225 -0
  150. package/dist/returns/index.js +160 -0
  151. package/dist/search/index.d.ts +99 -0
  152. package/dist/search/index.js +62 -0
  153. package/dist/shipping/parcel-count-suggestion.d.ts +52 -0
  154. package/dist/shipping/parcel-count-suggestion.js +73 -0
  155. package/dist/shipping/parcel-rule.d.ts +48 -0
  156. package/dist/shipping/parcel-rule.js +91 -0
  157. package/dist/stock/index.d.ts +166 -0
  158. package/dist/stock/index.js +115 -0
  159. package/dist/stock/transfers.d.ts +520 -0
  160. package/dist/stock/transfers.js +437 -0
  161. package/dist/stored-value/index.d.ts +154 -0
  162. package/dist/stored-value/index.js +130 -0
  163. package/dist/tenant/capabilities.d.ts +10 -0
  164. package/dist/tenant/entitlements.d.ts +35 -0
  165. package/dist/tenant/entitlements.js +15 -0
  166. package/dist/tenant/field-groups.d.ts +64 -0
  167. package/dist/tenant/field-groups.js +34 -0
  168. package/dist/tenant/legal-entity.d.ts +32 -0
  169. package/dist/tenant/legal-entity.js +41 -0
  170. package/dist/tenant/notifications.d.ts +148 -0
  171. package/dist/tenant/notifications.js +79 -0
  172. package/dist/tenant/retention.d.ts +10 -4
  173. package/dist/tenant/settings-sources.d.ts +103 -0
  174. package/dist/tenant/settings-sources.js +92 -0
  175. package/dist/types.d.ts +86 -11
  176. package/dist/uploads/index.d.ts +11 -7
  177. package/dist/users/index.d.ts +104 -0
  178. package/dist/users/index.js +80 -0
  179. package/package.json +3 -2
@@ -0,0 +1,90 @@
1
+ import type { Transport } from '@sixtyninecommerce/core';
2
+ import type { Call } from '../types.js';
3
+ /**
4
+ * Provider assignments (spec §8.14 "Tenants assign providers").
5
+ *
6
+ * An installed app becomes this store's `tax`, `payment` or `fulfillment`
7
+ * provider by assignment. Validation and rate hooks need none: they apply to
8
+ * every order once the app is installed.
9
+ *
10
+ * - One `tax` provider per store.
11
+ * - One `fulfillment` provider per stock location.
12
+ * - One `payment` assignment per installation. Each backs its own payment
13
+ * method, so a store can offer several payment apps.
14
+ *
15
+ * Assigning needs `InstallApps` AND the kind's permission: `UpdateTaxRate`,
16
+ * `UpdatePaymentMethod` or `UpdateStockLocation`. Reading needs
17
+ * `ReadSettings`. Every change emits `app.provider_assignment_changed`.
18
+ * Uninstalling the app removes its assignments.
19
+ */
20
+ export type AppProviderKind = 'tax' | 'payment' | 'fulfillment';
21
+ export interface AppProviderAssignment {
22
+ id: string;
23
+ kind: AppProviderKind;
24
+ installationId: string;
25
+ /** The installation's app slug. */
26
+ appSlug: string;
27
+ /** The stock location a `fulfillment` provider serves; `null` for the other kinds. */
28
+ locationId: string | null;
29
+ /** The payment method a `payment` provider backs, once one exists; `null` otherwise. */
30
+ paymentMethodId: string | null;
31
+ /** ISO-8601. */
32
+ createdAt: string;
33
+ /** ISO-8601; `null` while the assignment is live. */
34
+ removedAt: string | null;
35
+ }
36
+ export interface AssignAppProviderInput {
37
+ installationId: string;
38
+ kind: AppProviderKind;
39
+ /** Required for `fulfillment`, refused for the other kinds. */
40
+ locationId?: string;
41
+ /**
42
+ * Required for `payment`, refused for the other kinds. `code` is lower-case
43
+ * letters, digits and single hyphens, at most 64 characters.
44
+ */
45
+ paymentMethod?: {
46
+ code: string;
47
+ name: string;
48
+ };
49
+ }
50
+ export interface AppProviderAssignmentsModule {
51
+ /**
52
+ * The store's live assignments, oldest first; optionally one kind. Not
53
+ * paginated: a store holds at most one tax provider, one fulfillment
54
+ * provider per location and one payment assignment per installation.
55
+ */
56
+ list(options?: {
57
+ kind?: AppProviderKind;
58
+ } & Call): Promise<AppProviderAssignment[]>;
59
+ /**
60
+ * Make an installed app this store's provider of `kind`. Refusals:
61
+ * - `PermissionDeniedError` `PROVIDER_ASSIGNMENT_NOT_ALLOWED`: the caller lacks the kind's permission.
62
+ * - `NotFoundError` `APP_INSTALLATION_NOT_FOUND`: no such installation on this store.
63
+ * - `BusinessRuleError` `INSTALLATION_NOT_ACTIVE`: not active, or its app is suspended.
64
+ * - `BusinessRuleError` `HOOK_NOT_DECLARED`: the app does not declare `tax.calculate`,
65
+ * `payment.provider` or `fulfillment.service`, whichever the kind needs.
66
+ * - `BusinessRuleError` `HOOK_NOT_APPROVED`: the app declares that hook, but this store has not
67
+ * approved it yet (the installation awaits consent for it); approve its consent first.
68
+ * - `ConflictError` `PROVIDER_ALREADY_ASSIGNED`: the slot is taken; unassign the holder first.
69
+ * - `ValidationError` `LOCATION_NOT_IN_CHANNEL`: the location is not one of this store's.
70
+ * - `BusinessRuleError` `LOCATION_NOT_GRANTED`: the installation is restricted to other locations.
71
+ * - `PermissionDeniedError` `LOCATION_NOT_ALLOWED`: your own credential is restricted to other
72
+ * locations (also on `unassign`).
73
+ * - `ValidationError` `PROVIDER_ASSIGNMENT_INPUT_INVALID`: a location or payment method
74
+ * missing or given where the kind does not take it.
75
+ *
76
+ * With `idempotencyKey`, a repeat within 24 h answers the first assignment.
77
+ */
78
+ assign(input: AssignAppProviderInput, options?: Call): Promise<AppProviderAssignment>;
79
+ /**
80
+ * Remove an assignment. Needs the same permissions as assigning it.
81
+ * Removing twice answers the removed assignment; an unknown id is
82
+ * `NotFoundError` `PROVIDER_ASSIGNMENT_NOT_FOUND`.
83
+ */
84
+ unassign(id: string, options?: Call): Promise<AppProviderAssignment>;
85
+ }
86
+ export declare const ASSIGNMENT_FIELDS = "\n id\n kind\n installationId\n appSlug\n locationId\n paymentMethodId\n createdAt\n removedAt\n";
87
+ export declare const LIST_QUERY = "\n query AppProviderAssignments($kind: String) {\n appProviderAssignments(kind: $kind) { \n id\n kind\n installationId\n appSlug\n locationId\n paymentMethodId\n createdAt\n removedAt\n }\n }\n";
88
+ export declare const ASSIGN_MUTATION = "\n mutation AssignAppProvider($input: AssignAppProviderInput!) {\n assignAppProvider(input: $input) { \n id\n kind\n installationId\n appSlug\n locationId\n paymentMethodId\n createdAt\n removedAt\n }\n }\n";
89
+ export declare const UNASSIGN_MUTATION = "\n mutation UnassignAppProvider($id: ID!) {\n unassignAppProvider(id: $id) { \n id\n kind\n installationId\n appSlug\n locationId\n paymentMethodId\n createdAt\n removedAt\n }\n }\n";
90
+ export declare function createAppProviderAssignmentsModule(transport: Transport): AppProviderAssignmentsModule;
@@ -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,58 @@ 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, ProductCondition, ProductListFilter, ProductListOptions, ProductOptionGroupRef, ProductOptionRef, ProductsModule, ProductTranslation, ProductTranslationInput, SaveProductFieldsInput, SaveProductInput, SaveProductPropertyValueInput, SaveProductResult, SaveProductVariantInput, SaveProductWarning, 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, VariantBackorderPolicy, VariantPriceInput, 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, FulfillmentCoverageActorKind, FulfillmentCoverageExemption, FulfillmentCoverageOverride, FulfillmentLabel, FulfillmentLabelFormat, FulfillmentParcelTracking, FulfillmentsModule, LabelMyparcelParcelsInput, MyparcelParcelsLabelRequest, MyparcelRetractionVerdict, MyparcelUnretractedShipment, OrderFulfillmentCoverage, 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 { CommittedPipelineDraft, ImportDependency, ImportDependencyWarning, IntegrationPipelinesModule, IntegrationsModule, PipelineDirection, PipelineDraft, PipelineDraftConnection, PipelineDraftDiscovery, PipelineDraftFieldMapping, PipelineDraftSchemaMap, PipelineDraftStep, PipelineDraftSummary, PipelineDraftsModule, PipelineScheduleType, PipelineSyncPolicy, PipelineTriggerType, UpdatePipelineDraftInput, UpdatePipelineDraftSchemaMapInput, } from './integrations/index.js';
86
+ export { PIPELINE_DRAFT_PRESERVE_KEYS, PIPELINE_DRAFT_SLOW_TIMEOUT_MS, } from './integrations/index.js';
87
+ export type { BulkActionItem, BulkActionRun, BulkActionRunStatus, } from './jobs/bulk-action-run.js';
88
+ export { TERMINAL_BULK_ACTION_STATUSES } from './jobs/bulk-action-run.js';
53
89
  /**
54
90
  * `JobHandle` and `WaitOptions` are exported from here AND from
55
91
  * `./platform/provision-store.js`, which re-exports them: they used to live
@@ -63,18 +99,68 @@ export { OPENING_HOURS_DAYS } from './locations/index.js';
63
99
  export type { ApiTokenTemplate, JsonSchema, LabelMap, MetaCatalog, MetaCatalogLabels, MetaCatalogPermissions, MetaCatalogPlugins, MetaCatalogTransitions, MetaModule, PermissionGroup, PluginCatalogEntry, RoleTemplate, StatusMetaMap, StatusTone, TransitionMap, } from './meta/index.js';
64
100
  export type { Metafield, MetafieldAttachment, MetafieldDefinition, MetafieldDefinitionsModule, MetafieldMoney, MetafieldOwnerType, MetafieldReference, MetafieldScalarType, MetafieldsModule, MetafieldType, MetafieldVisibility, SetMetafieldInput, UpsertMetafieldDefinitionInput, } from './metafields/index.js';
65
101
  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 { IssuedRefund, OrderPaymentPosition, OrderRefundPosition, PaidOrder, PaymentsModule, ProviderConnection, ProviderCredentialPath, ProviderOnboardingStart, ProviderReadiness, ProvidersModule, ProviderTerminal, ProviderTerminalsModule, ProvisionTerminalInput, ReadinessOptions, RecordPaymentInput, RefundablePayment, RefundPaymentInput, } from './payments/index.js';
102
+ export type { OrderBulkAction, OrderBulkCapture, OrderBulkInput, OrderBulkItem, OrderBulkRun, } from './orders/bulk.js';
103
+ export { MAX_BULK_ORDERS, ORDER_BULK_ACTIONS, ORDER_BULK_TRANSITION_REFUSED, } from './orders/bulk.js';
104
+ export type { CommitOrderEditCall, OrderCommitEditModule, OrderEditCommit, OrderEditCommittedOrder, OrderEditCommittedRefund, OrderEditOverpaymentSettlement, } from './orders/commit-edit.js';
105
+ export type { OrderDepositPolicy, OrderDepositPolicyModule, StorefrontDepositPolicy, } from './orders/deposit-policy.js';
106
+ export { DEFAULT_ORDER_DEPOSIT_POLICY, DEPOSIT_POLICY_AUTO_CANCEL_DAYS_MIN, DEPOSIT_POLICY_MINIMUM_PERCENT_MAX, DEPOSIT_POLICY_STOREFRONT_METHODS_MAX, } from './orders/deposit-policy.js';
107
+ 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';
108
+ export { ORDER_INCLUDES } from './orders/get.js';
109
+ export type { OrderProviderFallback, OrderSettlement, OrdersModule } from './orders/index.js';
110
+ export type { LineNotPurchasableCode, LinePricePreview, LinePricePreviewBase, LinePriceStackingStep, NotPurchasableLinePricePreview, OrderLinePriceBasis, OrderLinePricePreviewModule, OrderLinePriceSource, PreviewLineDiscountType, PreviewLinePriceLine, PreviewLinePriceOverride, PreviewOneTimeDiscount, PurchasableLinePricePreview, } from './orders/line-price-preview.js';
111
+ export type { DiscountPolicy, DiscountPolicyInput, DiscountPolicyModule, DiscountReason, DiscountReasonInput, DiscountReasonsModule, ManualDiscountsModule, OrderManualDiscount, } from './orders/manual-discounts.js';
112
+ export type { LinePriceInput, OneTimeDiscountType, OneTimeLineDiscountInput, OneTimeOrderDiscountInput, OrderManualPricingModule, SetLinePricesInput, SetOneTimeDiscountsInput, } from './orders/manual-pricing.js';
113
+ export type { ExternalLinePriceBasis, ExternalOrder, ExternalOrderAddressInput, ExternalOrderCall, ExternalOrderCatalogLine, ExternalOrderExternalLine, ExternalOrderFulfilment, ExternalOrderInput, ExternalOrderLine, ExternalOrderLineInput, ExternalOrderSurcharge, ExternalOrderSurchargeInput, ExternalOrderTargetState, ExternalOrderTaxLine, OrderEntryModule, } from './orders/order-entry.js';
114
+ export type { OrderParcelCharge, OrderParcelChargeFulfillment, OrderParcelChargeModule, } from './orders/parcel-charge.js';
115
+ 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';
116
+ export type { OrderAllocationBadge, OrderEditBlockCode, OrderLockReason, OrderStatusAction, OrderStatusActionName, OrderStatusModule, OrderStatusProviderFallback, OrderStatusReasonCode, OrderStatusView, } from './orders/status.js';
117
+ export { ORDER_ALLOCATION_BADGES, ORDER_EDIT_BLOCK_CODES, ORDER_LOCK_REASONS, ORDER_STATUS_ACTIONS, ORDER_STATUS_REASON_CODES, } from './orders/status.js';
118
+ export type { OrderOverpaymentChoice, OverpaymentOption, SurchargeCall, SurchargeChange, SurchargeChangePreview, SurchargedOrder, SurchargeInput, SurchargeRemoveCall, SurchargesModule, } from './orders/surcharges.js';
119
+ export type { AccountCreditModule, ApplyUnappliedCashInput, AppPayment, AppPaymentReportState, CreditOverpaymentInput, IssuedRefund, OrderMoneyOnAccount, OrderPaymentPosition, OrderRefundPosition, PaidOrder, PaymentMethod, PaymentMethodsModule, 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
120
  export type { AppKey, PlatformAppsModule, RegisterAppResult, RegisteredApp, } from './platform/apps.js';
121
+ export type { PlatformCatalogModule, RepairTranslationLanguagesInput, TranslationRepairEntity, TranslationRepairEntityKind, TranslationRepairNameMismatch, TranslationRepairPage, TranslationRepairRemovedRow, TranslationRepairSkipped, TranslationRepairSkipReason, } from './platform/catalog.js';
122
+ export type { PlatformEntitlementSource, PlatformEntitlementsModule, PlatformPluginEntitlement, SetPlatformEntitlementOptions, } from './platform/entitlements.js';
70
123
  export { requireHumanSession } from './platform/guard.js';
124
+ export type { CreateLegalEntityInput, LegalEntity, LegalEntityFields, LegalEntityListOptions, LegalEntityStore, PlatformLegalEntitiesModule, UpdateLegalEntityInput, } from './platform/legal-entities.js';
125
+ export type { LegalEntityNumbering, LegalEntityNumberingSeries, LegalEntityNumberingSeriesName, PlatformLegalEntityNumberingModule, TenantLegalEntityNumberingModule, UpdateLegalEntityNumberingInput, } from './platform/legal-entity-numbering.js';
126
+ export type { JoinOrganizationInput, OrganizationMembership, OrganizationMembershipMethods, } from './platform/organization-membership.js';
127
+ export type { OrganizationSettingsMethods, OrganizationSettingsOverride, } from './platform/organization-settings.js';
128
+ export type { OrganizationSettingsKindSwitchOff, OrganizationSettingsSwitchOff, OrganizationSharingKind, OrganizationSharingKindInput, OrganizationSharingKindState, OrganizationSharingModule, SetOrganizationSharingKindInput, } from './platform/organization-sharing.js';
129
+ export type { CreateOrganizationInput, Organization, OrganizationAssortmentMode, OrganizationCustomerPolicy, OrganizationEntitlementsModule, OrganizationPluginEntitlement, PlatformOrganizationsModule, SetOrganizationEntitlementInput, UpdateOrganizationInput, } from './platform/organizations.js';
71
130
  export type { PlatformModule, ProvisionProfile, ProvisionRun, ProvisionRunStatus, ProvisionStep, ProvisionStepStatus, ProvisionStoreInput, ProvisionStoreResult, } from './platform/provision-store.js';
72
131
  export { PROVISION_PROFILES } from './platform/provision-store.js';
132
+ export type { FleetChannelMetric, FleetReportInput, PlatformReportsModule, } from './platform/reports.js';
133
+ export type { PlatformServerMetricsModule, ServerMetricPoint, ServerMetrics, ServerMetricsInput, ServerMetricsOverview, ServerMetricsRange, } from './platform/server-metrics.js';
134
+ 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';
135
+ export type { ActivePromotion, ActivePromotionsFilter, CreatePromotionInput, DiscountedOrderLine, LocalTime, OrderDiscount, OrderDiscounts, OrderPackage, PricingCouponsModule, PricingModule, PricingPromotion, PricingPromotionsModule, PromotionOperationSummary, PromotionTranslationInput, SetComponent, UpdatePromotionInput, Weekday, } from './pricing/index.js';
136
+ export { promotionActions, promotionConditions } from './pricing/index.js';
137
+ export type { IssuedVoucher, IssueVoucherInput, IssueVouchersInput, IssueVouchersItem, PricingVouchersModule, Voucher, VoucherCustomer, VoucherStatus, VoucherTemplate, } from './pricing/vouchers.js';
138
+ export type { EntityProvenance, ProvenanceActor, ProvenanceEntityType, ProvenanceFieldGroup, ProvenanceManagedBy, ProvenanceModule, } from './provenance/index.js';
139
+ export { PROVENANCE_MAX_IDS } from './provenance/index.js';
140
+ export type { LowStockInput, LowStockVariant, PopularVariant, PopularVariantsInput, ReportDay, ReportExport, ReportExportFilter, ReportExportKind, ReportOverview, ReportOverviewInput, ReportPeriod, ReportsModule, ReportTotals, } from './reports/index.js';
141
+ export type { OrderReturn, OrderReturnDetail, OrderReturnLine, OrderReturnStatusLogEntry, ReturnableOrderLine, ReturnCreditNoteLedger, ReturnCreditNoteUnavailableReason, ReturnEligibility, ReturnRefundUnavailableReason, ReturnSettlementBlocker, ReturnSettlementMethod, ReturnSettlementOptions, ReturnSettlementPayment, ReturnState, ReturnsModule, } from './returns/index.js';
142
+ export { RETURN_SETTLEMENT_BLOCKERS, RETURN_SETTLEMENT_METHODS, RETURN_STATES, } from './returns/index.js';
143
+ export type { EntitySearchResult, SearchContentHit, SearchCustomerHit, SearchEntitiesOptions, SearchEntityType, SearchModule, SearchOrderHit, SearchProductHit, SearchSkip, SearchSkipReason, } from './search/index.js';
144
+ export { SEARCH_ENTITIES_MAX_TAKE, SEARCH_ENTITIES_MIN_TERM_LENGTH } from './search/index.js';
73
145
  export type { Redirect, RedirectCreateInput, RedirectsModule, RedirectUpdateInput, } from './seo/redirects.js';
146
+ export type { ParcelCountSuggestion, ParcelCountSuggestionInput, ParcelCountSuggestionItem, ParcelCountSuggestionMethod, } from './shipping/parcel-count-suggestion.js';
147
+ export { PARCEL_SUGGESTION_MAX_ITEMS, PARCEL_SUGGESTION_MAX_QUANTITY, } from './shipping/parcel-count-suggestion.js';
148
+ export type { ParcelRule, ParcelRuleModule, SetParcelRuleInput, ShippingModule, } from './shipping/parcel-rule.js';
149
+ export { PARCEL_CAPACITY_MAX, PARCEL_WEIGHT_GRAMS_MAX } from './shipping/parcel-rule.js';
150
+ export type { AdjustStockInput, ReleasedAllocation, StockAllocationsModule, StockModule, StockMovement, StockMovementFilter, StockMovementType, StockPosition, StockPositionOptions, } from './stock/index.js';
151
+ 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';
152
+ export type { IssueStoredValueInput, RedeemStoredValueInput, StoredValueAccount, StoredValueEntry, StoredValueLiability, StoredValueModule, StoredValueRedemption, StoredValueStatement, } from './stored-value/index.js';
74
153
  export type { TaxClass, TaxClassesModule, TaxClassMapping, TaxClassTaxCategory, TaxMappingsModule, TaxModule, UpsertTaxClassInput, } from './tax/index.js';
75
154
  export { TAX_CLASS_FALLBACK_COUNTRY } from './tax/index.js';
76
155
  export type { CapabilitiesModule, Capability, CapabilityManifest, } from './tenant/capabilities.js';
77
156
  export type { ChannelsModule } from './tenant/channels.js';
157
+ export type { TenantEntitlement, TenantEntitlementSource, TenantEntitlementsReader, } from './tenant/entitlements.js';
158
+ export type { FieldGroupOwnership, FieldGroupOwnersReader, FieldGroupSyncSource, FieldGroupSyncSourcesReader, } from './tenant/field-groups.js';
159
+ export type { LegalEntityModule } from './tenant/legal-entity.js';
160
+ export type { NotificationEventConfig, NotificationRecipientSegment, NotificationRecipients, NotificationSender, NotificationsModule, UpdateNotificationEventConfigInput, } from './tenant/notifications.js';
78
161
  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';
162
+ export type { ChannelSettingsSource, SettingsGroup, SettingsSourceKind, SettingsSourcesModule, } from './tenant/settings-sources.js';
163
+ export { SETTINGS_GROUPS } from './tenant/settings-sources.js';
164
+ export type { ApiToken, Call, ChannelInfo, CreateApiTokenInput, FieldGroupGrantRefusalCode, ListOptions, Me, MeChannel, TenantContext, TenantScope, UpdateApiTokenInput, WhoAmI, } from './types.js';
80
165
  export type { ClaimAsAssetInput, StagedUpload, StagedUploadTicket, StageUploadInput, UploadBody, UploadPurpose, UploadStatus, UploadsModule, } from './uploads/index.js';
166
+ export type { EnsureUserInput, EnsureUserOutcome, EnsureUserResult, StaffUser, UpdateUserInput, UserRoleRequest, UsersModule, } from './users/index.js';
package/dist/index.js CHANGED
@@ -27,13 +27,33 @@
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 { PIPELINE_DRAFT_PRESERVE_KEYS, PIPELINE_DRAFT_SLOW_TIMEOUT_MS, } from './integrations/index.js';
42
+ export { TERMINAL_BULK_ACTION_STATUSES } from './jobs/bulk-action-run.js';
34
43
  export { TERMINAL_JOB_STATUSES } from './jobs/index.js';
35
44
  export { OPENING_HOURS_DAYS } from './locations/index.js';
36
45
  export { METAFIELD_OWNER_TYPES, METAFIELD_SCALAR_TYPES } from './metafields/index.js';
46
+ export { MAX_BULK_ORDERS, ORDER_BULK_ACTIONS, ORDER_BULK_TRANSITION_REFUSED, } from './orders/bulk.js';
47
+ export { DEFAULT_ORDER_DEPOSIT_POLICY, DEPOSIT_POLICY_AUTO_CANCEL_DAYS_MIN, DEPOSIT_POLICY_MINIMUM_PERCENT_MAX, DEPOSIT_POLICY_STOREFRONT_METHODS_MAX, } from './orders/deposit-policy.js';
48
+ export { ORDER_INCLUDES } from './orders/get.js';
49
+ export { ORDER_ALLOCATION_BADGES, ORDER_EDIT_BLOCK_CODES, ORDER_LOCK_REASONS, ORDER_STATUS_ACTIONS, ORDER_STATUS_REASON_CODES, } from './orders/status.js';
37
50
  export { requireHumanSession } from './platform/guard.js';
38
51
  export { PROVISION_PROFILES } from './platform/provision-store.js';
52
+ export { promotionActions, promotionConditions } from './pricing/index.js';
53
+ export { PROVENANCE_MAX_IDS } from './provenance/index.js';
54
+ export { RETURN_SETTLEMENT_BLOCKERS, RETURN_SETTLEMENT_METHODS, RETURN_STATES, } from './returns/index.js';
55
+ export { SEARCH_ENTITIES_MAX_TAKE, SEARCH_ENTITIES_MIN_TERM_LENGTH } from './search/index.js';
56
+ export { PARCEL_SUGGESTION_MAX_ITEMS, PARCEL_SUGGESTION_MAX_QUANTITY, } from './shipping/parcel-count-suggestion.js';
57
+ export { PARCEL_CAPACITY_MAX, PARCEL_WEIGHT_GRAMS_MAX } from './shipping/parcel-rule.js';
39
58
  export { TAX_CLASS_FALLBACK_COUNTRY } from './tax/index.js';
59
+ export { SETTINGS_GROUPS } from './tenant/settings-sources.js';
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Integrations (headless spec §9.2): the store's connections to other systems. Today the data
3
+ * pipelines' import and export set-ups; the rest of the pipeline surface follows in phase 7.
4
+ */
5
+ import type { Transport } from '@sixtyninecommerce/core';
6
+ import { type IntegrationPipelinesModule } from './pipelines.js';
7
+ export type { IntegrationPipelinesModule, PipelineDraftsModule } from './pipelines.js';
8
+ export { PIPELINE_DRAFT_PRESERVE_KEYS, PIPELINE_DRAFT_SLOW_TIMEOUT_MS } from './pipelines.js';
9
+ export type * from './types.js';
10
+ export interface IntegrationsModule {
11
+ /** Data pipelines: import and export set-ups kept on the server (`drafts`). */
12
+ pipelines: IntegrationPipelinesModule;
13
+ }
14
+ export declare function createIntegrationsModule(transport: Transport): IntegrationsModule;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Integrations (headless spec §9.2): the store's connections to other systems. Today the data
3
+ * pipelines' import and export set-ups; the rest of the pipeline surface follows in phase 7.
4
+ */
5
+ import { createIntegrationPipelinesModule } from './pipelines.js';
6
+ export { PIPELINE_DRAFT_PRESERVE_KEYS, PIPELINE_DRAFT_SLOW_TIMEOUT_MS } from './pipelines.js';
7
+ export function createIntegrationsModule(transport) {
8
+ return { pipelines: createIntegrationPipelinesModule(transport) };
9
+ }