@sixtyninecommerce/admin 0.10.0 → 0.11.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 (247) hide show
  1. package/README.md +4347 -171
  2. package/dist/catalog/assets.d.ts +120 -8
  3. package/dist/catalog/assets.js +98 -12
  4. package/dist/catalog/collections.d.ts +279 -14
  5. package/dist/catalog/collections.js +246 -15
  6. package/dist/catalog/index.d.ts +9 -2
  7. package/dist/catalog/index.js +4 -0
  8. package/dist/catalog/products.d.ts +159 -19
  9. package/dist/catalog/products.js +88 -13
  10. package/dist/catalog/properties.d.ts +102 -14
  11. package/dist/catalog/properties.js +13 -0
  12. package/dist/catalog/recommendations.d.ts +261 -0
  13. package/dist/catalog/recommendations.js +145 -0
  14. package/dist/catalog/reviews.d.ts +368 -0
  15. package/dist/catalog/reviews.js +318 -0
  16. package/dist/catalog/types.d.ts +17 -1
  17. package/dist/catalog/types.js +10 -0
  18. package/dist/catalog/variant-find.d.ts +136 -0
  19. package/dist/catalog/variant-find.js +239 -0
  20. package/dist/catalog/variants.d.ts +233 -26
  21. package/dist/catalog/variants.js +125 -7
  22. package/dist/catalog/visibility.d.ts +20 -5
  23. package/dist/catalog/visibility.js +19 -1
  24. package/dist/client.d.ts +95 -9
  25. package/dist/client.js +35 -7
  26. package/dist/content/assets.d.ts +286 -0
  27. package/dist/content/assets.js +181 -0
  28. package/dist/content/items.d.ts +269 -0
  29. package/dist/content/items.js +170 -0
  30. package/dist/content/types.d.ts +282 -0
  31. package/dist/content/types.js +100 -0
  32. package/dist/customers/age-verification.d.ts +66 -0
  33. package/dist/customers/age-verification.js +79 -0
  34. package/dist/customers/credit.d.ts +263 -0
  35. package/dist/customers/credit.js +244 -0
  36. package/dist/customers/delivery-preferences.d.ts +120 -0
  37. package/dist/customers/delivery-preferences.js +97 -0
  38. package/dist/customers/groups.d.ts +207 -0
  39. package/dist/customers/groups.js +438 -0
  40. package/dist/customers/index.d.ts +447 -37
  41. package/dist/customers/index.js +313 -40
  42. package/dist/customers/invitation-status.d.ts +57 -0
  43. package/dist/customers/invitation-status.js +21 -0
  44. package/dist/customers/notes.d.ts +67 -0
  45. package/dist/customers/notes.js +51 -0
  46. package/dist/customers/notification-recipients.d.ts +97 -0
  47. package/dist/customers/notification-recipients.js +84 -0
  48. package/dist/customers/saved-lists.d.ts +42 -0
  49. package/dist/customers/saved-lists.js +61 -0
  50. package/dist/customers/vat.d.ts +83 -0
  51. package/dist/customers/vat.js +46 -0
  52. package/dist/customers/wire.d.ts +20 -0
  53. package/dist/customers/wire.js +35 -0
  54. package/dist/documents/ar.d.ts +307 -0
  55. package/dist/documents/ar.js +254 -0
  56. package/dist/documents/index.d.ts +731 -21
  57. package/dist/documents/index.js +436 -24
  58. package/dist/documents/pdf.d.ts +2 -0
  59. package/dist/documents/pdf.js +11 -0
  60. package/dist/fulfillments/create.d.ts +167 -0
  61. package/dist/fulfillments/create.js +216 -0
  62. package/dist/fulfillments/index.d.ts +44 -10
  63. package/dist/fulfillments/index.js +11 -2
  64. package/dist/fulfillments/payment-policy.d.ts +64 -0
  65. package/dist/fulfillments/payment-policy.js +140 -0
  66. package/dist/fulfillments/warehouse.d.ts +724 -0
  67. package/dist/fulfillments/warehouse.js +914 -0
  68. package/dist/geo/index.d.ts +119 -0
  69. package/dist/geo/index.js +107 -0
  70. package/dist/index.d.ts +123 -35
  71. package/dist/index.js +45 -12
  72. package/dist/integrations/afas-actions.d.ts +234 -0
  73. package/dist/integrations/afas-actions.js +310 -0
  74. package/dist/integrations/afas-types.d.ts +483 -0
  75. package/dist/integrations/afas-types.js +5 -0
  76. package/dist/integrations/afas.d.ts +234 -0
  77. package/dist/integrations/afas.js +290 -0
  78. package/dist/integrations/connections.d.ts +103 -0
  79. package/dist/integrations/connections.js +55 -0
  80. package/dist/integrations/esp.d.ts +313 -0
  81. package/dist/integrations/esp.js +169 -0
  82. package/dist/integrations/exact-online-types.d.ts +423 -0
  83. package/dist/integrations/exact-online-types.js +6 -0
  84. package/dist/integrations/exact-online.d.ts +248 -0
  85. package/dist/integrations/exact-online.js +376 -0
  86. package/dist/integrations/index.d.ts +29 -3
  87. package/dist/integrations/index.js +18 -3
  88. package/dist/integrations/pipeline-keys.d.ts +13 -0
  89. package/dist/integrations/pipeline-keys.js +22 -0
  90. package/dist/integrations/pipelines.d.ts +15 -14
  91. package/dist/integrations/pipelines.js +6 -22
  92. package/dist/integrations/types.d.ts +146 -0
  93. package/dist/locations/index.d.ts +66 -0
  94. package/dist/locations/index.js +31 -0
  95. package/dist/meta/index.d.ts +162 -0
  96. package/dist/orders/cancel-with-money.d.ts +227 -0
  97. package/dist/orders/cancel-with-money.js +153 -0
  98. package/dist/orders/commit-edit.d.ts +7 -1
  99. package/dist/orders/commit-edit.js +5 -1
  100. package/dist/orders/drafts.d.ts +800 -0
  101. package/dist/orders/drafts.js +771 -0
  102. package/dist/orders/fields.d.ts +245 -0
  103. package/dist/orders/fields.js +188 -0
  104. package/dist/orders/get.d.ts +29 -19
  105. package/dist/orders/get.js +17 -8
  106. package/dist/orders/index.d.ts +49 -9
  107. package/dist/orders/index.js +22 -2
  108. package/dist/orders/lifecycle.d.ts +128 -0
  109. package/dist/orders/lifecycle.js +158 -0
  110. package/dist/orders/line-price-preview.d.ts +7 -2
  111. package/dist/orders/list.d.ts +222 -0
  112. package/dist/orders/list.js +377 -0
  113. package/dist/orders/manual-pricing.d.ts +5 -0
  114. package/dist/orders/order-entry.d.ts +20 -7
  115. package/dist/orders/plan-edit.d.ts +1 -1
  116. package/dist/orders/plan-edit.js +4 -1
  117. package/dist/orders/settings.d.ts +201 -0
  118. package/dist/orders/settings.js +325 -0
  119. package/dist/orders/status.d.ts +159 -13
  120. package/dist/orders/status.js +21 -0
  121. package/dist/orders/surcharges.d.ts +8 -1
  122. package/dist/orders/surcharges.js +3 -2
  123. package/dist/payments/account-credit.d.ts +30 -0
  124. package/dist/payments/account-credit.js +19 -0
  125. package/dist/payments/ar.d.ts +292 -0
  126. package/dist/payments/ar.js +223 -0
  127. package/dist/payments/connected-account.d.ts +47 -0
  128. package/dist/payments/connected-account.js +61 -0
  129. package/dist/payments/credit-noted-fields.d.ts +12 -0
  130. package/dist/payments/credit-noted-fields.js +37 -0
  131. package/dist/payments/index.d.ts +257 -11
  132. package/dist/payments/index.js +131 -1
  133. package/dist/payments/methods.d.ts +303 -8
  134. package/dist/payments/methods.js +337 -7
  135. package/dist/payments/mollie-methods.d.ts +159 -0
  136. package/dist/payments/mollie-methods.js +141 -0
  137. package/dist/payments/payment-links.d.ts +180 -0
  138. package/dist/payments/payment-links.js +97 -0
  139. package/dist/payments/provider-keys.d.ts +150 -0
  140. package/dist/payments/provider-keys.js +118 -0
  141. package/dist/payments/providers.d.ts +86 -11
  142. package/dist/payments/providers.js +29 -0
  143. package/dist/payments/requests.d.ts +144 -0
  144. package/dist/payments/requests.js +92 -0
  145. package/dist/payments/store-credit-fields.d.ts +15 -0
  146. package/dist/payments/store-credit-fields.js +51 -0
  147. package/dist/pickups/index.d.ts +104 -0
  148. package/dist/pickups/index.js +105 -0
  149. package/dist/platform/channels.d.ts +132 -0
  150. package/dist/platform/channels.js +128 -0
  151. package/dist/platform/geo.d.ts +123 -0
  152. package/dist/platform/geo.js +144 -0
  153. package/dist/platform/tax.d.ts +154 -0
  154. package/dist/platform/tax.js +139 -0
  155. package/dist/pos/anomalies.d.ts +158 -0
  156. package/dist/pos/anomalies.js +64 -0
  157. package/dist/pos/assisted-selling.d.ts +79 -0
  158. package/dist/pos/assisted-selling.js +38 -0
  159. package/dist/pos/exchanges.d.ts +103 -0
  160. package/dist/pos/exchanges.js +22 -0
  161. package/dist/pos/gift-cards.d.ts +135 -0
  162. package/dist/pos/gift-cards.js +47 -0
  163. package/dist/pos/index.d.ts +2125 -32
  164. package/dist/pos/index.js +742 -4
  165. package/dist/pos/no-receipt.d.ts +94 -0
  166. package/dist/pos/no-receipt.js +25 -0
  167. package/dist/pos/offline-sales.d.ts +187 -0
  168. package/dist/pos/offline-sales.js +116 -0
  169. package/dist/pos/pay-by-link.d.ts +143 -0
  170. package/dist/pos/pay-by-link.js +57 -0
  171. package/dist/pos/quick-keys.d.ts +103 -0
  172. package/dist/pos/quick-keys.js +45 -0
  173. package/dist/pos/reports.d.ts +360 -0
  174. package/dist/pos/reports.js +62 -0
  175. package/dist/pos/returns.d.ts +217 -0
  176. package/dist/pos/returns.js +53 -0
  177. package/dist/pricing/bulk-coupons.d.ts +139 -0
  178. package/dist/pricing/bulk-coupons.js +112 -0
  179. package/dist/pricing/index.d.ts +174 -4
  180. package/dist/pricing/index.js +174 -1
  181. package/dist/pricing/price-lists.d.ts +604 -0
  182. package/dist/pricing/price-lists.js +600 -0
  183. package/dist/purchasing/alerts.d.ts +89 -0
  184. package/dist/purchasing/alerts.js +62 -0
  185. package/dist/purchasing/cost.d.ts +110 -0
  186. package/dist/purchasing/cost.js +86 -0
  187. package/dist/purchasing/index.d.ts +36 -0
  188. package/dist/purchasing/index.js +16 -0
  189. package/dist/purchasing/purchase-orders.d.ts +548 -0
  190. package/dist/purchasing/purchase-orders.js +491 -0
  191. package/dist/purchasing/replenishment.d.ts +281 -0
  192. package/dist/purchasing/replenishment.js +240 -0
  193. package/dist/purchasing/settings.d.ts +152 -0
  194. package/dist/purchasing/settings.js +181 -0
  195. package/dist/purchasing/suppliers.d.ts +476 -0
  196. package/dist/purchasing/suppliers.js +438 -0
  197. package/dist/quotes/index.d.ts +501 -0
  198. package/dist/quotes/index.js +439 -0
  199. package/dist/reports/index.d.ts +71 -8
  200. package/dist/reports/index.js +74 -11
  201. package/dist/returns/index.d.ts +614 -21
  202. package/dist/returns/index.js +695 -11
  203. package/dist/search/index.d.ts +76 -1
  204. package/dist/search/index.js +63 -0
  205. package/dist/shipping/definitions.d.ts +29 -0
  206. package/dist/shipping/definitions.js +47 -0
  207. package/dist/shipping/fulfillment-profiles.d.ts +174 -0
  208. package/dist/shipping/fulfillment-profiles.js +104 -0
  209. package/dist/shipping/hendriks.d.ts +97 -0
  210. package/dist/shipping/hendriks.js +50 -0
  211. package/dist/shipping/index.d.ts +48 -0
  212. package/dist/shipping/index.js +25 -0
  213. package/dist/shipping/methods.d.ts +198 -0
  214. package/dist/shipping/methods.js +240 -0
  215. package/dist/shipping/myparcel.d.ts +254 -0
  216. package/dist/shipping/myparcel.js +178 -0
  217. package/dist/shipping/parcel-count-suggestion.d.ts +2 -0
  218. package/dist/shipping/parcel-rule.d.ts +6 -5
  219. package/dist/shipping/parcel-rule.js +21 -23
  220. package/dist/shipping/rate-tables.d.ts +179 -0
  221. package/dist/shipping/rate-tables.js +184 -0
  222. package/dist/stock/index.d.ts +10 -3
  223. package/dist/stock/index.js +3 -0
  224. package/dist/stock/locations.d.ts +144 -0
  225. package/dist/stock/locations.js +168 -0
  226. package/dist/stock/transfers.d.ts +216 -43
  227. package/dist/stock/transfers.js +140 -13
  228. package/dist/stored-value/index.d.ts +214 -4
  229. package/dist/stored-value/index.js +152 -0
  230. package/dist/subscriptions/index.d.ts +682 -0
  231. package/dist/subscriptions/index.js +815 -0
  232. package/dist/tax/index.d.ts +76 -1
  233. package/dist/tax/index.js +50 -0
  234. package/dist/tenant/email-style.d.ts +102 -0
  235. package/dist/tenant/email-style.js +72 -0
  236. package/dist/tenant/email-templates.d.ts +66 -0
  237. package/dist/tenant/email-templates.js +54 -0
  238. package/dist/tenant/notifications.d.ts +23 -17
  239. package/dist/tenant/settings-sources.d.ts +1 -1
  240. package/dist/tenant/time-zone.d.ts +17 -0
  241. package/dist/tenant/time-zone.js +11 -0
  242. package/dist/types.d.ts +50 -3
  243. package/dist/users/index.d.ts +3 -0
  244. package/dist/users/index.js +2 -0
  245. package/dist/users/warehouses.d.ts +50 -0
  246. package/dist/users/warehouses.js +51 -0
  247. package/package.json +2 -2
@@ -1,6 +1,17 @@
1
- import type { Page, Transport } from '@sixtyninecommerce/core';
2
- import type { ListOptions } from '../types.js';
3
- /** One payment method of the store, as staff choose one. */
1
+ import { type Page, type Transport } from '@sixtyninecommerce/core';
2
+ import { type ConfigurableOperation, type ConfigurableOperationInput, type LanguageCode } from '../catalog/types.js';
3
+ import type { Call, ConfigurableOperationDefinition, ListOptions } from '../types.js';
4
+ import { type MollieMethodsModule } from './mollie-methods.js';
5
+ import { type ProviderKeysModule } from './provider-keys.js';
6
+ /** A payment method's name and description in one language. */
7
+ export interface PaymentMethodTranslation {
8
+ id: string;
9
+ /** As the engine spells it: `en`, `nl`, `pt_BR`. */
10
+ languageCode: string;
11
+ name: string;
12
+ description: string;
13
+ }
14
+ /** One payment method of the store, as staff choose one and as its settings read. */
4
15
  export interface PaymentMethod {
5
16
  id: string;
6
17
  /**
@@ -8,30 +19,314 @@ export interface PaymentMethod {
8
19
  * deposit policy names in `storefront.methods`.
9
20
  */
10
21
  code: string;
22
+ /** In the language the client is set to (`tenant.language`), else the store's default. */
11
23
  name: string;
24
+ /** In the same language as {@link name}; empty when the method has none. */
25
+ description: string;
12
26
  /** A disabled method takes no new payments; it still names the ones it took. */
13
27
  enabled: boolean;
14
28
  /**
15
29
  * The code of the handler that takes the money (`manual-payment`, `mollie`, a
16
- * payment app's handler, …): what kind of method this is.
30
+ * payment app's handler, …): what kind of method this is. Always `handler.code`.
17
31
  */
18
32
  handlerCode: string;
33
+ /**
34
+ * The handler with its stored arguments, every value a string as the engine keeps it.
35
+ *
36
+ * A SECRET argument (a PSP API key, a webhook secret, any argument the handler's definition
37
+ * renders as a password) is answered MASKED to every caller but the platform SuperAdmin:
38
+ * store staff, an API token and an app installation read `test_••••k6rW` or `••••`, never the
39
+ * credential. The mask is also how a later save says "keep the stored value". The SDK passes
40
+ * the engine's answer on as it is and never unmasks or re-masks one.
41
+ */
42
+ handler: ConfigurableOperation;
43
+ /** The eligibility checker that decides which customers may use the method; null without one. */
44
+ checker: ConfigurableOperation | null;
45
+ /** Every language the method is named in. A recorded payment may carry any of these names. */
46
+ translations: PaymentMethodTranslation[];
47
+ /**
48
+ * A net-terms ("pay later") method: an order placed with it holds no money, and it is offered
49
+ * and accepted only for the customers its checker allows.
50
+ */
51
+ isNetTermsCredit: boolean;
52
+ /** On a net-terms method: staff may use it for any customer; the webshop never reads this. */
53
+ netTermsStaffAnyCustomer: boolean;
54
+ /**
55
+ * Whether shoppers are offered the method at webshop checkout; on unless it was switched off.
56
+ * Staff orders and the till do not read it.
57
+ */
58
+ enabledInStorefront: boolean;
59
+ /** ISO-8601, UTC. */
60
+ createdAt: string;
61
+ /** ISO-8601, UTC. */
62
+ updatedAt: string;
63
+ }
64
+ /**
65
+ * Which credential a Mollie payment method takes payments with: its own pasted API key, or the
66
+ * store's Mollie Connect account (the legal entity's OAuth connection). Every other handler is
67
+ * `api_key`.
68
+ */
69
+ export type PaymentMethodCredentialPath = 'api_key' | 'connect';
70
+ /** A method's credential path, as {@link PaymentMethodsModule.setCredentialPath} answers it. */
71
+ export interface PaymentMethodCredential {
72
+ paymentMethodCode: string;
73
+ credentialPath: PaymentMethodCredentialPath;
74
+ }
75
+ /**
76
+ * A method's name and description in one language, as a create or an update writes them. The
77
+ * engine keeps one row per language: writing a language the method has replaces that row's
78
+ * name and description, and any other language is added beside the ones it has.
79
+ */
80
+ export interface PaymentMethodTranslationInput {
81
+ /** As the engine spells it: `en`, `nl`, `pt_BR`. */
82
+ languageCode: LanguageCode;
83
+ name: string;
84
+ /** Empty when left out. */
85
+ description?: string;
86
+ }
87
+ /** A new payment method, as {@link PaymentMethodsModule.create} takes it. */
88
+ export interface CreatePaymentMethodInput {
89
+ /** What `payments.record` takes as `method` and a deposit policy names. */
90
+ code: string;
91
+ enabled: boolean;
92
+ /**
93
+ * The handler that takes the money, with every argument it needs (a value is always a string;
94
+ * lists and booleans JSON-encoded). One of {@link PaymentMethodsModule.handlers}.
95
+ */
96
+ handler: ConfigurableOperationInput;
97
+ /** Who may use the method; left out (or null), everyone. One of `checkers()`. */
98
+ checker?: ConfigurableOperationInput | null;
99
+ /** At least the store's default language: it is the name shoppers and staff are shown. */
100
+ translations: PaymentMethodTranslationInput[];
101
+ /** A net-terms ("pay later") method; off when left out. See {@link PaymentMethod}. */
102
+ isNetTermsCredit?: boolean;
103
+ /** On a net-terms method, staff may use it for any customer; off when left out. */
104
+ netTermsStaffAnyCustomer?: boolean;
105
+ /** Offered at webshop checkout; on when left out. */
106
+ enabledInStorefront?: boolean;
107
+ }
108
+ /**
109
+ * A change to a payment method, as {@link PaymentMethodsModule.update} takes it. A field left
110
+ * out keeps what the method has; `checker: null` takes its eligibility checker away.
111
+ */
112
+ export interface UpdatePaymentMethodInput {
113
+ code?: string;
114
+ enabled?: boolean;
115
+ /**
116
+ * The method's WHOLE handler: it replaces the stored one, so send every argument the method
117
+ * keeps. A secret argument round-trips masked: see {@link PaymentMethodsModule.update}.
118
+ */
119
+ handler?: ConfigurableOperationInput;
120
+ checker?: ConfigurableOperationInput | null;
121
+ translations?: PaymentMethodTranslationInput[];
122
+ isNetTermsCredit?: boolean;
123
+ netTermsStaffAnyCustomer?: boolean;
124
+ enabledInStorefront?: boolean;
19
125
  }
20
126
  /**
21
127
  * The store's payment methods (`admin.payments.methods`): what staff record a
22
- * payment with, and what a deposit policy names.
128
+ * payment with, what a deposit policy names, and what the store's payment settings show.
23
129
  *
24
- * Needs `ReadSettings` or `ReadPaymentMethod`. Scoped to the channel the client
25
- * is on: another store's methods are not listed.
130
+ * Every read needs `ReadSettings` or `ReadPaymentMethod` (either one, so no `@permission` tag:
131
+ * the tag can only say "all of these"). Scoped to the channel the client is on: another
132
+ * store's methods are not listed, and not answered by id.
26
133
  */
27
134
  export interface PaymentMethodsModule {
135
+ /**
136
+ * Each method's own Mollie or Stripe API key (the legacy credential path): what the store's
137
+ * Mollie and Stripe cards set and test. See {@link ProviderKeysModule}.
138
+ */
139
+ providerKeys: ProviderKeysModule;
140
+ /**
141
+ * A Mollie method's checkout methods, their order and visibility, and a diagnosis of the
142
+ * Mollie account. See {@link MollieMethodsModule}.
143
+ */
144
+ mollie: MollieMethodsModule;
28
145
  /**
29
146
  * Every method of the store, enabled or not, in the engine's order. Paged
30
147
  * (`options.limit`, default 100, at most 1,000 or `INVALID_PAGE_SIZE`; and
31
148
  * `options.after` from a previous page); `for await (const method of page)`
32
149
  * walks them all.
150
+ *
151
+ * @effect read
33
152
  */
34
153
  list(options?: ListOptions): Promise<Page<PaymentMethod>>;
154
+ /**
155
+ * One method by id, or `null` when the store the client is on has no such method: an id that
156
+ * does not exist and the id of a method only ANOTHER store holds read the same. A value that
157
+ * is no id of the engine's kind at all is refused `ENTITY_NOT_FOUND` (`NotFoundError`, 404).
158
+ *
159
+ * @effect read
160
+ */
161
+ get(id: string, options?: Call): Promise<PaymentMethod | null>;
162
+ /**
163
+ * The payment handlers the engine has registered: what a method's `handler` may be, each with
164
+ * the arguments it takes. The whole list in one page, the same whichever store the client is
165
+ * on; labels and descriptions are in the language of the request.
166
+ *
167
+ * `args[].required` is NOT the enforced rule (see `ConfigArgDefinition.required`); never gate
168
+ * a form on it.
169
+ *
170
+ * @effect read
171
+ */
172
+ handlers(options?: Call): Promise<Page<ConfigurableOperationDefinition>>;
173
+ /**
174
+ * The eligibility checkers the engine has registered: what a method's `checker` may be, each
175
+ * with the arguments it takes. The whole list in one page, with the same `required` caveat as
176
+ * {@link handlers}.
177
+ *
178
+ * @effect read
179
+ */
180
+ checkers(options?: Call): Promise<Page<ConfigurableOperationDefinition>>;
181
+ /**
182
+ * The credential path of one method, by code; null when the store has no such method. Read
183
+ * from the method's own (readonly) custom field, so it is what the method pays with NOW.
184
+ *
185
+ * @effect read
186
+ */
187
+ credentialPath(paymentMethodCode: string, options?: Call): Promise<PaymentMethodCredentialPath | null>;
188
+ /**
189
+ * Move one Mollie method between its own API key and the store's Mollie Connect account.
190
+ * A payment keeps the credential it was taken with, so a switch never strands one. Asking for
191
+ * the path the method is on changes nothing.
192
+ *
193
+ * Needs `UpdatePaymentMethod` on every store holding the method AND every store of the legal
194
+ * entity. Coded refusals: `APP_SECRET_ARG_NOT_ALLOWED`, `SHARED_PAYMENT_METHOD_NOT_ALLOWED`,
195
+ * `SHARED_SELLER_NOT_ALLOWED`, `CREDENTIAL_PATH_UNSUPPORTED` (not a Mollie method); to
196
+ * `connect`: `CREDENTIAL_PATH_SHARED_ACROSS_SELLERS` (a store of another legal entity holds
197
+ * the method), `PROVIDER_NOT_CONNECTED`, `LIVE_PAYMENT_REFUSED`, `RECONNECT_REQUIRED`
198
+ * (each missing scope a `details[].code`), `PAYMENTS_NOT_ENABLED`, `MOLLIE_ACCOUNT_MISMATCH` (the method's
199
+ * key belongs to another Mollie profile); to `api_key`: `CREDENTIAL_PATH_KEY_MISSING`,
200
+ * `MOLLIE_ACCOUNT_MISMATCH`.
201
+ *
202
+ * @effect write
203
+ * @permission UpdatePaymentMethod
204
+ */
205
+ setCredentialPath(paymentMethodCode: string, path: PaymentMethodCredentialPath, options?: Call): Promise<PaymentMethodCredential>;
206
+ /**
207
+ * Add a payment method to the store the client is on, and answer it as {@link get} reads it
208
+ * (a secret argument masked for every caller but the platform SuperAdmin). Needs
209
+ * `CreateSettings` or `CreatePaymentMethod` (either one). Nothing is saved when it is refused:
210
+ *
211
+ * - `NET_TERMS_CHECKER_INVALID` (`ValidationError`, 400): an ENABLED net-terms method needs
212
+ * the `customer-group-payment-checker`, which decides who may buy on terms. Judged on the
213
+ * method as it would be saved; a disabled one may be saved without it.
214
+ * - `SECRET_ARG_MASK_INVALID` (`ValidationError`, 400): a secret argument carries the mask
215
+ * glyph `••••`, which no provider issues; nothing is stored yet that a mask could keep.
216
+ * - `APP_SECRET_ARG_NOT_ALLOWED` (`PermissionDeniedError`, 403): an app installation may
217
+ * create a method only with its secret arguments empty.
218
+ * - `LIVE_CONNECTION_REFUSED` (`BusinessRuleError`, 422): a store that is not live (a
219
+ * sandbox) holds only a TEST Mollie or Stripe key (`test_…`, `sk_test_…`).
220
+ * - `PLUGIN_ACCESS_DENIED` (`PermissionDeniedError`, 403): the handler belongs to a plugin the
221
+ * store does not hold (Mollie, Stripe, the till's card terminal, stored value).
222
+ * - `ORGANIZATION_WORKSPACE_NOT_A_STORE` (`BusinessRuleError`, 422): an organization's
223
+ * workspace takes no payments; create the method in one of its stores.
224
+ *
225
+ * @effect write
226
+ */
227
+ create(input: CreatePaymentMethodInput, options?: Call): Promise<PaymentMethod>;
228
+ /**
229
+ * Change a payment method of the store the client is on, and answer it as {@link get} reads it.
230
+ * A field left out keeps what the method has; `checker: null` takes the checker away. Needs
231
+ * `UpdateSettings` or `UpdatePaymentMethod` (either one).
232
+ *
233
+ * **Secret arguments round-trip masked (`x-secret: masked-roundtrip`).** `handler` replaces
234
+ * the whole stored handler, and a read answers a secret argument (a PSP API key, a webhook
235
+ * secret) MASKED to everyone but the platform SuperAdmin. Send back the value the read
236
+ * answered, the mask included, and the engine keeps the stored secret; leaving `handler` out
237
+ * keeps it too. A new value replaces it, and an empty one CLEARS it (for staff and API tokens):
238
+ * a blank never means "keep". A mask that is no longer the stored value's (the key was changed
239
+ * after the read) is refused `SECRET_ARG_MASK_INVALID`: read the method again. An app
240
+ * installation may echo the mask or leave the argument as it is, never set, replace, clear or
241
+ * drop a secret (`APP_SECRET_ARG_NOT_ALLOWED`).
242
+ *
243
+ * Refused, with nothing saved, as {@link create} is (`NET_TERMS_CHECKER_INVALID` on the method
244
+ * as it would be saved, so enabling a net-terms method that has no checker is refused too;
245
+ * `SECRET_ARG_MASK_INVALID`; `APP_SECRET_ARG_NOT_ALLOWED`; `LIVE_CONNECTION_REFUSED`, also for
246
+ * a patch that only enables a method holding such a key; `PLUGIN_ACCESS_DENIED` for the
247
+ * handler named, or else the one stored), and:
248
+ *
249
+ * - `ENTITY_NOT_FOUND` (`NotFoundError`, 404): the store has no such method (another store's
250
+ * reads the same).
251
+ * - `SHARED_PAYMENT_METHOD_NOT_ALLOWED` (`PermissionDeniedError`, 403): the method is shared
252
+ * with other stores, and the caller lacks `UpdateSettings` or `UpdatePaymentMethod` in one
253
+ * of them. A change reaches every store that holds the method.
254
+ *
255
+ * @effect write
256
+ */
257
+ update(id: string, patch: UpdatePaymentMethodInput, options?: Call): Promise<PaymentMethod>;
258
+ /**
259
+ * Take a payment method out of the store the client is on. Needs `DeleteSettings` or
260
+ * `DeletePaymentMethod` (either one).
261
+ *
262
+ * In a store this REMOVES the method from that store only: the engine unlinks it, and every
263
+ * other store holding it keeps it. Payments already taken with it stay on their orders, but
264
+ * this store can no longer refund them through it (a refund resolves its method in the store,
265
+ * enabled). Only in the platform's default channel is the method deleted outright, and there
266
+ * one that any store still holds is refused `PAYMENT_METHOD_NOT_DELETED` (`ConflictError`,
267
+ * 409) with the engine's reason naming those stores. The SDK never forces it.
268
+ *
269
+ * `ENTITY_NOT_FOUND` (`NotFoundError`, 404): the store has no such method.
270
+ *
271
+ * @effect destructive
272
+ */
273
+ delete(id: string, options?: Call): Promise<void>;
274
+ /**
275
+ * {@link delete} for several methods in one call. An empty list does nothing. An id the store
276
+ * does not hold refuses the whole call `ENTITY_NOT_FOUND` (`NotFoundError`, 404), and nothing
277
+ * is removed. A method the engine keeps (in the default channel, one another store still
278
+ * holds) does not stop the others: they ARE removed, and the call then rejects
279
+ * `PAYMENT_METHOD_NOT_DELETED` (`ConflictError`, 409) whose `details` name each id that was
280
+ * not (`field: 'ids.<index>'`).
281
+ *
282
+ * @effect destructive
283
+ */
284
+ deleteMany(ids: readonly string[], options?: Call): Promise<void>;
285
+ /**
286
+ * Share payment methods with one more store (`channelId`, the engine's id of that store), so
287
+ * its checkout and staff can use them too. Answers the methods as the store the client is on
288
+ * holds them. An empty list does nothing.
289
+ *
290
+ * Cross-store, so the engine asks twice: `UpdateSettings` or `UpdatePaymentMethod` on a store
291
+ * that holds each method (else `CHANNEL_ACCESS_DENIED`, `PermissionDeniedError`, 403, naming
292
+ * no method), and on the store that receives them (else `FORBIDDEN`, 403). The platform
293
+ * SuperAdmin passes both. Refused also:
294
+ *
295
+ * - `ORGANIZATION_WORKSPACE_NOT_A_STORE` (`BusinessRuleError`, 422): the receiving channel is
296
+ * an organization's workspace, which takes no payments.
297
+ * - `PLUGIN_ACCESS_DENIED` (`PermissionDeniedError`, 403): a method uses a plugin's handler
298
+ * (Mollie, Stripe, the till's card terminal, stored value) that either store does not hold.
299
+ *
300
+ * @effect write
301
+ */
302
+ assignToStores(ids: readonly string[], channelId: string, options?: Call): Promise<PaymentMethod[]>;
303
+ /**
304
+ * Take payment methods out of one store (`channelId`): its checkout and staff no longer offer
305
+ * them, and every other store holding them keeps them. Answers the methods as the store the
306
+ * client is on still holds them (none, when `channelId` is that store). An empty list does
307
+ * nothing.
308
+ *
309
+ * Needs `DeleteSettings` or `DeletePaymentMethod` on the store the client is on and on
310
+ * `channelId` (else `FORBIDDEN`, 403); the SuperAdmin passes. The platform's default channel
311
+ * keeps every method (`USER_INPUT_ERROR`, `ValidationError`, 400), and an id the engine
312
+ * does not know is `ENTITY_NOT_FOUND` (`NotFoundError`, 404). Payments already taken with a
313
+ * method in that store stay on their orders, but the store can no longer refund them
314
+ * through it.
315
+ *
316
+ * @effect destructive
317
+ */
318
+ removeFromStores(ids: readonly string[], channelId: string, options?: Call): Promise<PaymentMethod[]>;
35
319
  }
36
- export declare const PAYMENT_METHODS_QUERY = "\n query StorePaymentMethods($options: PaymentMethodListOptions) {\n paymentMethods(options: $options) {\n items {\n id\n code\n name\n enabled\n handler {\n code\n }\n }\n totalItems\n }\n }\n";
320
+ export declare const PAYMENT_METHODS_QUERY = "\n query StorePaymentMethods($options: PaymentMethodListOptions) {\n paymentMethods(options: $options) {\n items { \n id\n createdAt\n updatedAt\n code\n name\n description\n enabled\n handler { \n code\n args {\n name\n value\n }\n }\n checker { \n code\n args {\n name\n value\n }\n }\n translations {\n id\n languageCode\n name\n description\n }\n customFields {\n isNetTermsCredit\n netTermsStaffAnyCustomer\n enabledInStorefront\n }\n }\n totalItems\n }\n }\n";
321
+ export declare const PAYMENT_METHOD_QUERY = "\n query StorePaymentMethod($id: ID!) {\n paymentMethod(id: $id) { \n id\n createdAt\n updatedAt\n code\n name\n description\n enabled\n handler { \n code\n args {\n name\n value\n }\n }\n checker { \n code\n args {\n name\n value\n }\n }\n translations {\n id\n languageCode\n name\n description\n }\n customFields {\n isNetTermsCredit\n netTermsStaffAnyCustomer\n enabledInStorefront\n }\n }\n }\n";
322
+ export declare const PAYMENT_METHOD_HANDLERS_QUERY = "\n query PaymentMethodHandlers {\n paymentMethodHandlers { \n code\n description\n args {\n name\n type\n list\n required\n defaultValue\n label\n description\n ui\n }\n }\n }\n";
323
+ export declare const PAYMENT_METHOD_CHECKERS_QUERY = "\n query PaymentMethodEligibilityCheckers {\n paymentMethodEligibilityCheckers { \n code\n description\n args {\n name\n type\n list\n required\n defaultValue\n label\n description\n ui\n }\n }\n }\n";
324
+ export declare const PAYMENT_METHOD_CREDENTIAL_PATH_QUERY = "\n query PaymentMethodCredentialPath($code: String!) {\n paymentMethods(options: { filter: { code: { eq: $code } }, take: 1 }) {\n items {\n code\n customFields {\n mollieCredentialPath\n }\n }\n }\n }\n";
325
+ export declare const SET_PAYMENT_METHOD_CREDENTIAL_PATH_MUTATION = "\n mutation SetPaymentMethodCredentialPath(\n $paymentMethodCode: String!\n $path: PaymentMethodCredentialPath!\n ) {\n setPaymentMethodCredentialPath(paymentMethodCode: $paymentMethodCode, path: $path) {\n paymentMethodCode\n credentialPath\n }\n }\n";
326
+ export declare const CREATE_PAYMENT_METHOD_MUTATION = "\n mutation CreateStorePaymentMethod($input: CreatePaymentMethodInput!) {\n createPaymentMethod(input: $input) { \n id\n createdAt\n updatedAt\n code\n name\n description\n enabled\n handler { \n code\n args {\n name\n value\n }\n }\n checker { \n code\n args {\n name\n value\n }\n }\n translations {\n id\n languageCode\n name\n description\n }\n customFields {\n isNetTermsCredit\n netTermsStaffAnyCustomer\n enabledInStorefront\n }\n }\n }\n";
327
+ export declare const UPDATE_PAYMENT_METHOD_MUTATION = "\n mutation UpdateStorePaymentMethod($input: UpdatePaymentMethodInput!) {\n updatePaymentMethod(input: $input) { \n id\n createdAt\n updatedAt\n code\n name\n description\n enabled\n handler { \n code\n args {\n name\n value\n }\n }\n checker { \n code\n args {\n name\n value\n }\n }\n translations {\n id\n languageCode\n name\n description\n }\n customFields {\n isNetTermsCredit\n netTermsStaffAnyCustomer\n enabledInStorefront\n }\n }\n }\n";
328
+ export declare const DELETE_PAYMENT_METHOD_MUTATION = "\n mutation DeleteStorePaymentMethod($id: ID!) {\n deletePaymentMethod(id: $id, force: false) {\n result\n message\n }\n }\n";
329
+ export declare const DELETE_PAYMENT_METHODS_MUTATION = "\n mutation DeleteStorePaymentMethods($ids: [ID!]!) {\n deletePaymentMethods(ids: $ids, force: false) {\n result\n message\n }\n }\n";
330
+ export declare const ASSIGN_PAYMENT_METHODS_TO_CHANNEL_MUTATION = "\n mutation AssignPaymentMethodsToStore($input: AssignPaymentMethodsToChannelInput!) {\n assignPaymentMethodsToChannel(input: $input) { \n id\n createdAt\n updatedAt\n code\n name\n description\n enabled\n handler { \n code\n args {\n name\n value\n }\n }\n checker { \n code\n args {\n name\n value\n }\n }\n translations {\n id\n languageCode\n name\n description\n }\n customFields {\n isNetTermsCredit\n netTermsStaffAnyCustomer\n enabledInStorefront\n }\n }\n }\n";
331
+ export declare const REMOVE_PAYMENT_METHODS_FROM_CHANNEL_MUTATION = "\n mutation RemovePaymentMethodsFromStore($input: RemovePaymentMethodsFromChannelInput!) {\n removePaymentMethodsFromChannel(input: $input) { \n id\n createdAt\n updatedAt\n code\n name\n description\n enabled\n handler { \n code\n args {\n name\n value\n }\n }\n checker { \n code\n args {\n name\n value\n }\n }\n translations {\n id\n languageCode\n name\n description\n }\n customFields {\n isNetTermsCredit\n netTermsStaffAnyCustomer\n enabledInStorefront\n }\n }\n }\n";
37
332
  export declare function createPaymentMethodsModule(transport: Transport): PaymentMethodsModule;