@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.
- package/README.md +4347 -171
- package/dist/catalog/assets.d.ts +120 -8
- package/dist/catalog/assets.js +98 -12
- package/dist/catalog/collections.d.ts +279 -14
- package/dist/catalog/collections.js +246 -15
- package/dist/catalog/index.d.ts +9 -2
- package/dist/catalog/index.js +4 -0
- package/dist/catalog/products.d.ts +159 -19
- package/dist/catalog/products.js +88 -13
- package/dist/catalog/properties.d.ts +102 -14
- package/dist/catalog/properties.js +13 -0
- package/dist/catalog/recommendations.d.ts +261 -0
- package/dist/catalog/recommendations.js +145 -0
- package/dist/catalog/reviews.d.ts +368 -0
- package/dist/catalog/reviews.js +318 -0
- package/dist/catalog/types.d.ts +17 -1
- package/dist/catalog/types.js +10 -0
- package/dist/catalog/variant-find.d.ts +136 -0
- package/dist/catalog/variant-find.js +239 -0
- package/dist/catalog/variants.d.ts +233 -26
- package/dist/catalog/variants.js +125 -7
- package/dist/catalog/visibility.d.ts +20 -5
- package/dist/catalog/visibility.js +19 -1
- package/dist/client.d.ts +95 -9
- package/dist/client.js +35 -7
- package/dist/content/assets.d.ts +286 -0
- package/dist/content/assets.js +181 -0
- package/dist/content/items.d.ts +269 -0
- package/dist/content/items.js +170 -0
- package/dist/content/types.d.ts +282 -0
- package/dist/content/types.js +100 -0
- package/dist/customers/age-verification.d.ts +66 -0
- package/dist/customers/age-verification.js +79 -0
- package/dist/customers/credit.d.ts +263 -0
- package/dist/customers/credit.js +244 -0
- package/dist/customers/delivery-preferences.d.ts +120 -0
- package/dist/customers/delivery-preferences.js +97 -0
- package/dist/customers/groups.d.ts +207 -0
- package/dist/customers/groups.js +438 -0
- package/dist/customers/index.d.ts +447 -37
- package/dist/customers/index.js +313 -40
- package/dist/customers/invitation-status.d.ts +57 -0
- package/dist/customers/invitation-status.js +21 -0
- package/dist/customers/notes.d.ts +67 -0
- package/dist/customers/notes.js +51 -0
- package/dist/customers/notification-recipients.d.ts +97 -0
- package/dist/customers/notification-recipients.js +84 -0
- package/dist/customers/saved-lists.d.ts +42 -0
- package/dist/customers/saved-lists.js +61 -0
- package/dist/customers/vat.d.ts +83 -0
- package/dist/customers/vat.js +46 -0
- package/dist/customers/wire.d.ts +20 -0
- package/dist/customers/wire.js +35 -0
- package/dist/documents/ar.d.ts +307 -0
- package/dist/documents/ar.js +254 -0
- package/dist/documents/index.d.ts +731 -21
- package/dist/documents/index.js +436 -24
- package/dist/documents/pdf.d.ts +2 -0
- package/dist/documents/pdf.js +11 -0
- package/dist/fulfillments/create.d.ts +167 -0
- package/dist/fulfillments/create.js +216 -0
- package/dist/fulfillments/index.d.ts +44 -10
- package/dist/fulfillments/index.js +11 -2
- package/dist/fulfillments/payment-policy.d.ts +64 -0
- package/dist/fulfillments/payment-policy.js +140 -0
- package/dist/fulfillments/warehouse.d.ts +724 -0
- package/dist/fulfillments/warehouse.js +914 -0
- package/dist/geo/index.d.ts +119 -0
- package/dist/geo/index.js +107 -0
- package/dist/index.d.ts +123 -35
- package/dist/index.js +45 -12
- package/dist/integrations/afas-actions.d.ts +234 -0
- package/dist/integrations/afas-actions.js +310 -0
- package/dist/integrations/afas-types.d.ts +483 -0
- package/dist/integrations/afas-types.js +5 -0
- package/dist/integrations/afas.d.ts +234 -0
- package/dist/integrations/afas.js +290 -0
- package/dist/integrations/connections.d.ts +103 -0
- package/dist/integrations/connections.js +55 -0
- package/dist/integrations/esp.d.ts +313 -0
- package/dist/integrations/esp.js +169 -0
- package/dist/integrations/exact-online-types.d.ts +423 -0
- package/dist/integrations/exact-online-types.js +6 -0
- package/dist/integrations/exact-online.d.ts +248 -0
- package/dist/integrations/exact-online.js +376 -0
- package/dist/integrations/index.d.ts +29 -3
- package/dist/integrations/index.js +18 -3
- package/dist/integrations/pipeline-keys.d.ts +13 -0
- package/dist/integrations/pipeline-keys.js +22 -0
- package/dist/integrations/pipelines.d.ts +15 -14
- package/dist/integrations/pipelines.js +6 -22
- package/dist/integrations/types.d.ts +146 -0
- package/dist/locations/index.d.ts +66 -0
- package/dist/locations/index.js +31 -0
- package/dist/meta/index.d.ts +162 -0
- package/dist/orders/cancel-with-money.d.ts +227 -0
- package/dist/orders/cancel-with-money.js +153 -0
- package/dist/orders/commit-edit.d.ts +7 -1
- package/dist/orders/commit-edit.js +5 -1
- package/dist/orders/drafts.d.ts +800 -0
- package/dist/orders/drafts.js +771 -0
- package/dist/orders/fields.d.ts +245 -0
- package/dist/orders/fields.js +188 -0
- package/dist/orders/get.d.ts +29 -19
- package/dist/orders/get.js +17 -8
- package/dist/orders/index.d.ts +49 -9
- package/dist/orders/index.js +22 -2
- package/dist/orders/lifecycle.d.ts +128 -0
- package/dist/orders/lifecycle.js +158 -0
- package/dist/orders/line-price-preview.d.ts +7 -2
- package/dist/orders/list.d.ts +222 -0
- package/dist/orders/list.js +377 -0
- package/dist/orders/manual-pricing.d.ts +5 -0
- package/dist/orders/order-entry.d.ts +20 -7
- package/dist/orders/plan-edit.d.ts +1 -1
- package/dist/orders/plan-edit.js +4 -1
- package/dist/orders/settings.d.ts +201 -0
- package/dist/orders/settings.js +325 -0
- package/dist/orders/status.d.ts +159 -13
- package/dist/orders/status.js +21 -0
- package/dist/orders/surcharges.d.ts +8 -1
- package/dist/orders/surcharges.js +3 -2
- package/dist/payments/account-credit.d.ts +30 -0
- package/dist/payments/account-credit.js +19 -0
- package/dist/payments/ar.d.ts +292 -0
- package/dist/payments/ar.js +223 -0
- package/dist/payments/connected-account.d.ts +47 -0
- package/dist/payments/connected-account.js +61 -0
- package/dist/payments/credit-noted-fields.d.ts +12 -0
- package/dist/payments/credit-noted-fields.js +37 -0
- package/dist/payments/index.d.ts +257 -11
- package/dist/payments/index.js +131 -1
- package/dist/payments/methods.d.ts +303 -8
- package/dist/payments/methods.js +337 -7
- package/dist/payments/mollie-methods.d.ts +159 -0
- package/dist/payments/mollie-methods.js +141 -0
- package/dist/payments/payment-links.d.ts +180 -0
- package/dist/payments/payment-links.js +97 -0
- package/dist/payments/provider-keys.d.ts +150 -0
- package/dist/payments/provider-keys.js +118 -0
- package/dist/payments/providers.d.ts +86 -11
- package/dist/payments/providers.js +29 -0
- package/dist/payments/requests.d.ts +144 -0
- package/dist/payments/requests.js +92 -0
- package/dist/payments/store-credit-fields.d.ts +15 -0
- package/dist/payments/store-credit-fields.js +51 -0
- package/dist/pickups/index.d.ts +104 -0
- package/dist/pickups/index.js +105 -0
- package/dist/platform/channels.d.ts +132 -0
- package/dist/platform/channels.js +128 -0
- package/dist/platform/geo.d.ts +123 -0
- package/dist/platform/geo.js +144 -0
- package/dist/platform/tax.d.ts +154 -0
- package/dist/platform/tax.js +139 -0
- package/dist/pos/anomalies.d.ts +158 -0
- package/dist/pos/anomalies.js +64 -0
- package/dist/pos/assisted-selling.d.ts +79 -0
- package/dist/pos/assisted-selling.js +38 -0
- package/dist/pos/exchanges.d.ts +103 -0
- package/dist/pos/exchanges.js +22 -0
- package/dist/pos/gift-cards.d.ts +135 -0
- package/dist/pos/gift-cards.js +47 -0
- package/dist/pos/index.d.ts +2125 -32
- package/dist/pos/index.js +742 -4
- package/dist/pos/no-receipt.d.ts +94 -0
- package/dist/pos/no-receipt.js +25 -0
- package/dist/pos/offline-sales.d.ts +187 -0
- package/dist/pos/offline-sales.js +116 -0
- package/dist/pos/pay-by-link.d.ts +143 -0
- package/dist/pos/pay-by-link.js +57 -0
- package/dist/pos/quick-keys.d.ts +103 -0
- package/dist/pos/quick-keys.js +45 -0
- package/dist/pos/reports.d.ts +360 -0
- package/dist/pos/reports.js +62 -0
- package/dist/pos/returns.d.ts +217 -0
- package/dist/pos/returns.js +53 -0
- package/dist/pricing/bulk-coupons.d.ts +139 -0
- package/dist/pricing/bulk-coupons.js +112 -0
- package/dist/pricing/index.d.ts +174 -4
- package/dist/pricing/index.js +174 -1
- package/dist/pricing/price-lists.d.ts +604 -0
- package/dist/pricing/price-lists.js +600 -0
- package/dist/purchasing/alerts.d.ts +89 -0
- package/dist/purchasing/alerts.js +62 -0
- package/dist/purchasing/cost.d.ts +110 -0
- package/dist/purchasing/cost.js +86 -0
- package/dist/purchasing/index.d.ts +36 -0
- package/dist/purchasing/index.js +16 -0
- package/dist/purchasing/purchase-orders.d.ts +548 -0
- package/dist/purchasing/purchase-orders.js +491 -0
- package/dist/purchasing/replenishment.d.ts +281 -0
- package/dist/purchasing/replenishment.js +240 -0
- package/dist/purchasing/settings.d.ts +152 -0
- package/dist/purchasing/settings.js +181 -0
- package/dist/purchasing/suppliers.d.ts +476 -0
- package/dist/purchasing/suppliers.js +438 -0
- package/dist/quotes/index.d.ts +501 -0
- package/dist/quotes/index.js +439 -0
- package/dist/reports/index.d.ts +71 -8
- package/dist/reports/index.js +74 -11
- package/dist/returns/index.d.ts +614 -21
- package/dist/returns/index.js +695 -11
- package/dist/search/index.d.ts +76 -1
- package/dist/search/index.js +63 -0
- package/dist/shipping/definitions.d.ts +29 -0
- package/dist/shipping/definitions.js +47 -0
- package/dist/shipping/fulfillment-profiles.d.ts +174 -0
- package/dist/shipping/fulfillment-profiles.js +104 -0
- package/dist/shipping/hendriks.d.ts +97 -0
- package/dist/shipping/hendriks.js +50 -0
- package/dist/shipping/index.d.ts +48 -0
- package/dist/shipping/index.js +25 -0
- package/dist/shipping/methods.d.ts +198 -0
- package/dist/shipping/methods.js +240 -0
- package/dist/shipping/myparcel.d.ts +254 -0
- package/dist/shipping/myparcel.js +178 -0
- package/dist/shipping/parcel-count-suggestion.d.ts +2 -0
- package/dist/shipping/parcel-rule.d.ts +6 -5
- package/dist/shipping/parcel-rule.js +21 -23
- package/dist/shipping/rate-tables.d.ts +179 -0
- package/dist/shipping/rate-tables.js +184 -0
- package/dist/stock/index.d.ts +10 -3
- package/dist/stock/index.js +3 -0
- package/dist/stock/locations.d.ts +144 -0
- package/dist/stock/locations.js +168 -0
- package/dist/stock/transfers.d.ts +216 -43
- package/dist/stock/transfers.js +140 -13
- package/dist/stored-value/index.d.ts +214 -4
- package/dist/stored-value/index.js +152 -0
- package/dist/subscriptions/index.d.ts +682 -0
- package/dist/subscriptions/index.js +815 -0
- package/dist/tax/index.d.ts +76 -1
- package/dist/tax/index.js +50 -0
- package/dist/tenant/email-style.d.ts +102 -0
- package/dist/tenant/email-style.js +72 -0
- package/dist/tenant/email-templates.d.ts +66 -0
- package/dist/tenant/email-templates.js +54 -0
- package/dist/tenant/notifications.d.ts +23 -17
- package/dist/tenant/settings-sources.d.ts +1 -1
- package/dist/tenant/time-zone.d.ts +17 -0
- package/dist/tenant/time-zone.js +11 -0
- package/dist/types.d.ts +50 -3
- package/dist/users/index.d.ts +3 -0
- package/dist/users/index.js +2 -0
- package/dist/users/warehouses.d.ts +50 -0
- package/dist/users/warehouses.js +51 -0
- package/package.json +2 -2
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import type
|
|
3
|
-
|
|
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,
|
|
128
|
+
* payment with, what a deposit policy names, and what the store's payment settings show.
|
|
23
129
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
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
|
|
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;
|