@viu/emporix-sdk 2.21.0 → 2.23.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 (114) hide show
  1. package/CHANGELOG.md +146 -0
  2. package/dist/availability.cjs +118 -0
  3. package/dist/availability.cjs.map +1 -1
  4. package/dist/availability.d.cts +178 -2
  5. package/dist/availability.d.ts +178 -2
  6. package/dist/availability.js +1 -1
  7. package/dist/cart.cjs +215 -9
  8. package/dist/cart.cjs.map +1 -1
  9. package/dist/cart.d.cts +281 -3
  10. package/dist/cart.d.ts +281 -3
  11. package/dist/cart.js +1 -1
  12. package/dist/category.cjs +220 -2
  13. package/dist/category.cjs.map +1 -1
  14. package/dist/category.d.cts +408 -1
  15. package/dist/category.d.ts +408 -1
  16. package/dist/category.js +1 -1
  17. package/dist/{chunk-HD5RBCM6.js → chunk-27NLS646.js} +10 -2
  18. package/dist/chunk-27NLS646.js.map +1 -0
  19. package/dist/{chunk-PYLWZZC4.js → chunk-6PJFOX3A.js} +126 -2
  20. package/dist/chunk-6PJFOX3A.js.map +1 -0
  21. package/dist/chunk-HWVFF6B2.js +378 -0
  22. package/dist/chunk-HWVFF6B2.js.map +1 -0
  23. package/dist/chunk-LQFRJSVT.js +224 -0
  24. package/dist/chunk-LQFRJSVT.js.map +1 -0
  25. package/dist/chunk-P7G4LOOV.js +264 -0
  26. package/dist/chunk-P7G4LOOV.js.map +1 -0
  27. package/dist/{chunk-HBEQEIT6.js → chunk-PRN3T6TY.js} +63 -3
  28. package/dist/chunk-PRN3T6TY.js.map +1 -0
  29. package/dist/{chunk-44F52KRE.js → chunk-QQMLN76U.js} +27 -2
  30. package/dist/chunk-QQMLN76U.js.map +1 -0
  31. package/dist/chunk-UNW6SFSB.js +363 -0
  32. package/dist/chunk-UNW6SFSB.js.map +1 -0
  33. package/dist/chunk-V3275BA7.js +181 -0
  34. package/dist/chunk-V3275BA7.js.map +1 -0
  35. package/dist/chunk-W2KBVWJ2.js +323 -0
  36. package/dist/chunk-W2KBVWJ2.js.map +1 -0
  37. package/dist/chunk-YVZ6GOLE.js +399 -0
  38. package/dist/chunk-YVZ6GOLE.js.map +1 -0
  39. package/dist/chunk-ZOFGDNSX.js +305 -0
  40. package/dist/chunk-ZOFGDNSX.js.map +1 -0
  41. package/dist/companies.cjs +25 -0
  42. package/dist/companies.cjs.map +1 -1
  43. package/dist/companies.d.cts +14 -0
  44. package/dist/companies.d.ts +14 -0
  45. package/dist/companies.js +1 -1
  46. package/dist/contacts.cjs +8 -0
  47. package/dist/contacts.cjs.map +1 -1
  48. package/dist/contacts.d.cts +2 -0
  49. package/dist/contacts.d.ts +2 -0
  50. package/dist/contacts.js +1 -1
  51. package/dist/customer-groups-BxSNFHq1.d.cts +706 -0
  52. package/dist/customer-groups-GlzWhDsi.d.ts +706 -0
  53. package/dist/customer-groups.cjs +200 -17
  54. package/dist/customer-groups.cjs.map +1 -1
  55. package/dist/customer-groups.d.cts +2 -110
  56. package/dist/customer-groups.d.ts +2 -110
  57. package/dist/customer-groups.js +1 -1
  58. package/dist/customer.cjs +61 -1
  59. package/dist/customer.cjs.map +1 -1
  60. package/dist/customer.d.cts +48 -1
  61. package/dist/customer.d.ts +48 -1
  62. package/dist/customer.js +1 -1
  63. package/dist/index.cjs +2566 -554
  64. package/dist/index.cjs.map +1 -1
  65. package/dist/index.d.cts +455 -12
  66. package/dist/index.d.ts +455 -12
  67. package/dist/index.js +687 -342
  68. package/dist/index.js.map +1 -1
  69. package/dist/orders.cjs +160 -2
  70. package/dist/orders.cjs.map +1 -1
  71. package/dist/orders.d.cts +221 -1
  72. package/dist/orders.d.ts +221 -1
  73. package/dist/orders.js +1 -1
  74. package/dist/payment.cjs +124 -0
  75. package/dist/payment.cjs.map +1 -1
  76. package/dist/payment.d.cts +335 -1
  77. package/dist/payment.d.ts +335 -1
  78. package/dist/payment.js +1 -1
  79. package/dist/price.cjs +197 -0
  80. package/dist/price.cjs.map +1 -1
  81. package/dist/price.d.cts +577 -1
  82. package/dist/price.d.ts +577 -1
  83. package/dist/price.js +1 -1
  84. package/dist/product.cjs +190 -0
  85. package/dist/product.cjs.map +1 -1
  86. package/dist/product.d.cts +503 -1
  87. package/dist/product.d.ts +503 -1
  88. package/dist/product.js +1 -1
  89. package/dist/segment.cjs +179 -0
  90. package/dist/segment.cjs.map +1 -1
  91. package/dist/segment.d.cts +181 -1
  92. package/dist/segment.d.ts +181 -1
  93. package/dist/segment.js +1 -1
  94. package/package.json +1 -1
  95. package/dist/chunk-36T4YPQJ.js +0 -106
  96. package/dist/chunk-36T4YPQJ.js.map +0 -1
  97. package/dist/chunk-3BTPX7IJ.js +0 -41
  98. package/dist/chunk-3BTPX7IJ.js.map +0 -1
  99. package/dist/chunk-44F52KRE.js.map +0 -1
  100. package/dist/chunk-A3LYJUD4.js +0 -108
  101. package/dist/chunk-A3LYJUD4.js.map +0 -1
  102. package/dist/chunk-FZMP5NQZ.js +0 -173
  103. package/dist/chunk-FZMP5NQZ.js.map +0 -1
  104. package/dist/chunk-HBEQEIT6.js.map +0 -1
  105. package/dist/chunk-HD5RBCM6.js.map +0 -1
  106. package/dist/chunk-HUEMYP2L.js +0 -193
  107. package/dist/chunk-HUEMYP2L.js.map +0 -1
  108. package/dist/chunk-IVCCGJN5.js +0 -63
  109. package/dist/chunk-IVCCGJN5.js.map +0 -1
  110. package/dist/chunk-NE7MIZPR.js +0 -144
  111. package/dist/chunk-NE7MIZPR.js.map +0 -1
  112. package/dist/chunk-PYLWZZC4.js.map +0 -1
  113. package/dist/chunk-ZNLHLFQM.js +0 -160
  114. package/dist/chunk-ZNLHLFQM.js.map +0 -1
package/dist/payment.d.ts CHANGED
@@ -1,5 +1,94 @@
1
1
  import { C as ClientContext, b as AuthContext } from './context-CfXJcYKP.js';
2
2
 
3
+ type PaymentModeRequest = {
4
+ /**
5
+ * Indicates a code of a given method.
6
+ */
7
+ code: string;
8
+ /**
9
+ * Indicates whether a give mode is active.
10
+ */
11
+ active?: boolean;
12
+ /**
13
+ * Indicates which provider should be used.
14
+ */
15
+ provider: Provider;
16
+ /**
17
+ * Map of configuration values for a particular gateway. Supported and required values for Spreedly:
18
+ * * `Spreedly/GatewayToken` - Indicates Spreedly gateway. Valid for `SPREEDLY`, `SPREEDLY_SAFERPAY`.
19
+ * * `Spreedly/EnvironmentKey` - Indicates Spreedly environment key. Valid for `SPREEDLY`, `SPREEDLY_SAFERPAY`.
20
+ * * `Spreedly/AccessSecret` - Indicates Spreedly access secret. Valid for `SPREEDLY`, `SPREEDLY_SAFERPAY`.
21
+ * * `Spreedly/PaymentMethodType` - Indicates payment method type, for example: paypal. Valid for `SPREEDLY`.
22
+ * * `Spreedly/RedirectURL` - Indicates a redirect URL where an end user should be redirected when a payment flow is finished. Usually it's a storefront URL. Valid for `SPREEDLY`.
23
+ * * `Spreedly/SignatureSecret` - Indicates a signature secret. The value is needed for an offsite flow, when a confirmation callback is used. Valid for `SPREEDLY`.
24
+ * * `Spreedly/SCAProviderToken` - Indicates the Spreedly SCA (Strong Customer Authentication) provider token (3DS credit cart). Valid for `SPREEDLY`.
25
+ * * `Spreedly/ReceiverId` - Indicates the Spreedly Receiver identifier. Valid for `SPREEDLY_SAFERPAY`.
26
+ * * `Saferpay/BasicAuth` - Base64 encoded username and password of Saferpay account. Valid for `SPREEDLY_SAFERPAY`.
27
+ * * `Saferpay/CustomerId` - Saferpay customer ID. Valid for `SPREEDLY_SAFERPAY`.
28
+ * * `Saferpay/TerminalId` - Saferpay terminal ID. Valid for `SPREEDLY_SAFERPAY`.
29
+ * * `Saferpay/TestEnvironment` - Indicates if the configuration is done for test environment or a production one. If `true` then `https://test.saferpay.com` is used as a destination. Otherwise `https://www.saferpay.com` is used. Valid for `SPREEDLY_SAFERPAY`.
30
+ * * `Saferpay/RedirectUrl` - Indicates a redirect URL where an end user should be redirected when a payment flow is finished. Usually it's a storefront URL. Valid for `SPREEDLY_SAFERPAY`.
31
+ * * `Unzer/PaymentMethodType` - Indicates a payment method type. Currently supported value is `PAYLATER_INVOICE`. Valid for `UNZER`.
32
+ * * `Unzer/PublicKey` - Indicates a Unzer public key. Valid for `UNZER`.
33
+ * * `Unzer/PrivateKey` - Indicates a Unzer private key. Valid for `UNZER`.
34
+ * * `Unzer/CustomerType` - Indicates a customer type. Currently supported value is `B2C`. Valid for `UNZER`.
35
+ * requestBodies: { }
36
+ */
37
+ configuration?: {
38
+ [key: string]: string;
39
+ };
40
+ };
41
+ type PaymentMethodUpdateRequest = {
42
+ /**
43
+ * Indicates whether a give mode is active.
44
+ */
45
+ active?: boolean;
46
+ /**
47
+ * Map of configuration values for a particular gateway. Supported and required values for Spreedly:
48
+ * * `Spreedly/GatewayToken` - Indicates Spreedly gateway.
49
+ * * `Spreedly/EnvironmentKey` - Indicates Spreedly environment key.
50
+ * * `Spreedly/AccessSecret` - Indicates Spreedly access secret.
51
+ * * `Spreedly/PaymentMethodType` - Indicates payment method type, for example: paypal.
52
+ * * `Spreedly/RedirectURL` - Indicates a redirect URL where an end user should be redirected when a payment flow is finished. Usually it's a storefront URL.
53
+ * * `Spreedly/SignatureSecret` - Indicates a signature secret. The value is needed for an offsite flow, when a confirmation callback is used.
54
+ * * `Spreedly/SCAProviderToken` - Indicates the Spreedly SCA (Strong Customer Authentication) provider token (3DS credit cart).
55
+ * requestBodies: { }
56
+ */
57
+ configuration?: {
58
+ [key: string]: string;
59
+ };
60
+ };
61
+ type Provider = 'INVOICE' | 'CASH_ON_DELIVERY' | 'SPREEDLY' | 'SPREEDLY_SAFERPAY' | 'UNZER';
62
+ type PaymentModeResponse = {
63
+ /**
64
+ * Indicates an autogenerated identifier of a given payment method.
65
+ */
66
+ id?: string;
67
+ /**
68
+ * Indicates a code of a given method.
69
+ */
70
+ code?: string;
71
+ /**
72
+ * Indicates whether a give mode is active.
73
+ */
74
+ active?: boolean;
75
+ /**
76
+ * Indicates which provider should be used.
77
+ */
78
+ provider?: Provider;
79
+ /**
80
+ * Map of configuration values for a particular gateway. Supported and required values for Spreedly:
81
+ * * `Spreedly/GatewayToken` - Indicates Spreedly gateway.
82
+ * * `Spreedly/EnvironmentKey` - Indicates Spreedly environment key.
83
+ * * `Spreedly/AccessSecret` - Indicates Spreedly access secret.
84
+ * * `Spreedly/PaymentMethodType` - Indicates payment method type, for example: paypal.
85
+ * * `Spreedly/RedirectURL` - Indicates a redirect URL where an end user should be redirected when a payment flow is finished. Usually it's a storefront URL.
86
+ * * `Spreedly/SignatureSecret` - Indicates a signature secret. The value is needed for an offsite flow, when a confirmation callback is used.
87
+ */
88
+ configuration?: {
89
+ [key: string]: string;
90
+ };
91
+ };
3
92
  type PaymentModeFrontendResponse = {
4
93
  /**
5
94
  * Indicates an autogenerated identifier of a given payment method.
@@ -82,11 +171,176 @@ type AuthorizePaymentRequest = AuthorizeFrontendPaymentRequest & {
82
171
  */
83
172
  currency?: string;
84
173
  };
174
+ type InitializePaymentResponse = {
175
+ /**
176
+ * Indicates if the authorization process finished with success.
177
+ */
178
+ successful?: boolean;
179
+ /**
180
+ * Unique payment transaction identifier.
181
+ */
182
+ paymentTransactionId?: string;
183
+ /**
184
+ * Authorization token
185
+ */
186
+ authorizationToken?: string;
187
+ /**
188
+ * Indicates a URL address where a user should be redirected in order to finish the authorization process.
189
+ */
190
+ externalPaymentRedirectURL?: string;
191
+ /**
192
+ * Indicates a HTTP Method which should be used in order to finish the authorization process.
193
+ */
194
+ externalPaymentHttpMethod?: string;
195
+ /**
196
+ * Map of additional parameters that may be needed in order to complete the authorization flow.
197
+ */
198
+ externalPaymentParameters?: {
199
+ [key: string]: string;
200
+ };
201
+ };
202
+ type AuthorizePaymentResponse = InitializePaymentResponse & {
203
+ /**
204
+ * Indicates if a redirect to an external site is required in order to finish the authorization flow.
205
+ */
206
+ requiresExternalPayment?: boolean;
207
+ };
208
+ type CaptureRequest = {
209
+ /**
210
+ * Amount that should be captured. The amount should not be greater than amount that was authorized.
211
+ */
212
+ amount?: number;
213
+ /**
214
+ * Currency for the amount that should be captured.
215
+ */
216
+ currency?: string;
217
+ };
218
+ type CommonPaymentResponse = {
219
+ /**
220
+ * Indicates if the operation finished with success or not.
221
+ */
222
+ successful?: boolean;
223
+ /**
224
+ * In case of failed operation, the field provides error details.
225
+ */
226
+ message?: string;
227
+ };
228
+ type RefundRequest = {
229
+ /**
230
+ * Amount that should be refunded. The amount should not be greater than amount that was captured.
231
+ */
232
+ amount?: number;
233
+ /**
234
+ * Currency for the amount that should be refunded.
235
+ */
236
+ currency?: string;
237
+ /**
238
+ * Capture identifier. The value is mandatory only if there were more captures for a payment and the refund should be related to a specific capture. In another case the value can be skipped and the capture related to the payment will be chosen automatically.
239
+ */
240
+ captureId?: string;
241
+ };
242
+ type PaymentTransactionResponse = {
243
+ /**
244
+ * A unique identifier of a payment transaction.
245
+ */
246
+ id?: string;
247
+ provider?: Provider;
248
+ /**
249
+ * Information related to a payment mode.
250
+ */
251
+ paymentInformation?: {
252
+ /**
253
+ * A unique identifier of a payment mode configured for the tenant.
254
+ */
255
+ paymentMode?: string;
256
+ /**
257
+ * Token of the credit card.
258
+ */
259
+ creditCardToken?: string;
260
+ /**
261
+ * Name of the card holder.
262
+ */
263
+ cardHolderName?: string;
264
+ /**
265
+ * URL for pay-by-link payment flow.
266
+ */
267
+ payByLinkURL?: string;
268
+ /**
269
+ * International Bank Account Number.
270
+ */
271
+ iban?: string;
272
+ /**
273
+ * Bank Identifier Code (SWIFT).
274
+ */
275
+ bic?: string;
276
+ /**
277
+ * SEPA mandate reference.
278
+ */
279
+ sepaMandateReference?: string;
280
+ };
281
+ /**
282
+ * List of transaction entries representing payment events.
283
+ */
284
+ entries?: Array<{
285
+ /**
286
+ * Unique identifier of a payment transaction entry.
287
+ */
288
+ id?: string;
289
+ /**
290
+ * Timestamp when the event happened.
291
+ */
292
+ createdDate?: string;
293
+ /**
294
+ * Event type.
295
+ */
296
+ type?: 'INITIALIZATION' | 'AUTHORIZATION' | 'CAPTURE' | 'REFUND' | 'CANCEL' | 'AUTHORIZATION_START' | 'AUTHORIZATION_CALLBACK';
297
+ /**
298
+ * Indicates if the event completed successfully.
299
+ */
300
+ successful?: boolean;
301
+ amount?: {
302
+ /**
303
+ * Amount related to the event.
304
+ */
305
+ amount?: number;
306
+ /**
307
+ * ISO currency code.
308
+ */
309
+ currency?: string;
310
+ };
311
+ /**
312
+ * Summary of the event.
313
+ */
314
+ summary?: string;
315
+ /**
316
+ * Serialized request body sent to payment provider.
317
+ */
318
+ remoteRequest?: string;
319
+ /**
320
+ * Serialized response body from payment provider.
321
+ */
322
+ remoteResponse?: string;
323
+ /**
324
+ * Remote token returned by payment provider.
325
+ */
326
+ remoteToken?: string;
327
+ /**
328
+ * Additional info about the transaction.
329
+ */
330
+ additionalInfo?: {
331
+ [key: string]: unknown;
332
+ };
333
+ }>;
334
+ };
85
335
 
86
336
  /** A frontend payment mode (generated). */
87
337
  type PaymentMode = PaymentModeFrontendResponse;
88
338
  /** Post-checkout authorize request (generated; caller sends the exact wire shape). */
89
339
  type AuthorizePaymentInput = AuthorizePaymentRequest;
340
+ /** Frontend payment-initialize request (generated). */
341
+ type InitializePaymentInput = InitializePaymentRequest;
342
+ /** Frontend payment-initialize response (generated). */
343
+ type InitializePaymentResult = InitializePaymentResponse;
90
344
  /** Post-checkout authorize result. */
91
345
  interface AuthorizePaymentResult {
92
346
  successful: boolean;
@@ -97,6 +351,31 @@ interface AuthorizePaymentResult {
97
351
  externalPaymentHttpMethod?: string;
98
352
  [k: string]: unknown;
99
353
  }
354
+ /** A configured payment mode (admin view, `/paymentmodes/config`). */
355
+ type PaymentModeConfig = PaymentModeResponse;
356
+ /** Body for creating a payment-mode configuration. */
357
+ type PaymentModeCreateInput = PaymentModeRequest;
358
+ /** Body for updating a payment-mode configuration. */
359
+ type PaymentModeUpdateInput = PaymentMethodUpdateRequest;
360
+ /** A payment transaction (generated). */
361
+ type PaymentTransaction = PaymentTransactionResponse;
362
+ /** Result of a backend payment authorization. */
363
+ type PaymentAuthorizeResult = AuthorizePaymentResponse;
364
+ /** Body for capturing an authorized payment. */
365
+ type PaymentCaptureInput = CaptureRequest;
366
+ /** Body for refunding a captured payment. */
367
+ type PaymentRefundInput = RefundRequest;
368
+ /**
369
+ * Result of a refund/cancel operation. Business failures are reported in the
370
+ * body (`successful: false` + `message`), not via HTTP status.
371
+ */
372
+ type PaymentActionResult = CommonPaymentResponse;
373
+ /** Result of a capture — like {@link PaymentActionResult} plus the provider's capture id. */
374
+ type PaymentCaptureResult = {
375
+ successful?: boolean;
376
+ message?: string;
377
+ captureId?: string;
378
+ };
100
379
  /** Payment-Gateway: list frontend payment modes, authorize deferred payments. */
101
380
  declare class PaymentGatewayService {
102
381
  private readonly ctx;
@@ -110,6 +389,61 @@ declare class PaymentGatewayService {
110
389
  listPaymentModes(authCtx?: AuthContext): Promise<PaymentMode[]>;
111
390
  /** Authorizes a post-checkout (deferred) payment for an existing order. */
112
391
  authorize(input: AuthorizePaymentInput, authCtx?: AuthContext): Promise<AuthorizePaymentResult>;
392
+ /** Retrieves a single frontend payment mode by id. Defaults to anonymous (no scope required). */
393
+ getMode(id: string, authCtx?: AuthContext): Promise<PaymentMode>;
394
+ /** Initializes a payment from the frontend. Defaults to anonymous (no scope required). */
395
+ initialize(input: InitializePaymentInput, authCtx?: AuthContext): Promise<InitializePaymentResult>;
396
+ /**
397
+ * Payment-mode **configuration** (`/paymentmodes/config`) — the admin view.
398
+ * For the storefront view use {@link listPaymentModes} / {@link getMode}.
399
+ * Defaults to service auth.
400
+ */
401
+ readonly modes: {
402
+ /** Lists all configured payment modes. The endpoint takes no query parameters. */
403
+ list: (authCtx?: AuthContext) => Promise<PaymentModeConfig[]>;
404
+ /** Retrieves one payment-mode configuration by id. */
405
+ get: (id: string, authCtx?: AuthContext) => Promise<PaymentModeConfig>;
406
+ /** Creates a payment-mode configuration. Responds 200 with the created mode. */
407
+ create: (input: PaymentModeCreateInput, authCtx?: AuthContext) => Promise<PaymentModeConfig>;
408
+ /** Updates a payment-mode configuration (PUT). Responds 200 with the updated mode. */
409
+ update: (id: string, input: PaymentModeUpdateInput, authCtx?: AuthContext) => Promise<PaymentModeConfig>;
410
+ /** Deletes a payment-mode configuration. */
411
+ delete: (id: string, authCtx?: AuthContext) => Promise<void>;
412
+ };
413
+ /**
414
+ * Backend transaction lifecycle and reads. `authorize` creates the transaction
415
+ * that `capture`/`refund`/`cancel` then act on. Business failures are reported
416
+ * in the response body (`successful: false`), not as HTTP errors — always check
417
+ * `successful`. Defaults to service auth.
418
+ */
419
+ readonly transactions: {
420
+ /** One page of payment transactions. */
421
+ list: (params?: {
422
+ pageNumber?: number;
423
+ pageSize?: number;
424
+ sort?: string;
425
+ }, authCtx?: AuthContext) => Promise<PaymentTransaction[]>;
426
+ /** Retrieves one payment transaction by id. */
427
+ get: (transactionId: string, authCtx?: AuthContext) => Promise<PaymentTransaction>;
428
+ /**
429
+ * Authorizes a payment as a backend caller (`POST /payment/authorize`). The
430
+ * storefront equivalent is {@link PaymentGatewayService.authorize}, which
431
+ * targets `/payment/frontend/authorize` with a customer token.
432
+ */
433
+ authorize: (input: AuthorizePaymentInput, authCtx?: AuthContext) => Promise<PaymentAuthorizeResult>;
434
+ /**
435
+ * Captures an authorized payment. Omit `input` to capture the full
436
+ * authorized amount. Returns the provider's `captureId` on success.
437
+ */
438
+ capture: (transactionId: string, input?: PaymentCaptureInput, authCtx?: AuthContext) => Promise<PaymentCaptureResult>;
439
+ /**
440
+ * Refunds a captured payment. Omit `input` to refund the full captured
441
+ * amount; pass `captureId` when several captures exist for the payment.
442
+ */
443
+ refund: (transactionId: string, input?: PaymentRefundInput, authCtx?: AuthContext) => Promise<PaymentActionResult>;
444
+ /** Cancels an authorized payment. Takes no body. */
445
+ cancel: (transactionId: string, authCtx?: AuthContext) => Promise<PaymentActionResult>;
446
+ };
113
447
  }
114
448
 
115
- export { type AuthorizePaymentInput, type AuthorizePaymentResult, PaymentGatewayService, type PaymentMode };
449
+ export { type AuthorizePaymentInput, type AuthorizePaymentResult, type InitializePaymentInput, type InitializePaymentResult, type PaymentActionResult, type PaymentAuthorizeResult, type PaymentCaptureInput, type PaymentCaptureResult, PaymentGatewayService, type PaymentMode, type PaymentModeConfig, type PaymentModeCreateInput, type PaymentModeUpdateInput, type PaymentRefundInput, type PaymentTransaction };
package/dist/payment.js CHANGED
@@ -1,4 +1,4 @@
1
- export { PaymentGatewayService } from './chunk-PYLWZZC4.js';
1
+ export { PaymentGatewayService } from './chunk-6PJFOX3A.js';
2
2
  import './chunk-3BDDYX3V.js';
3
3
  import './chunk-UWGGF4MC.js';
4
4
  //# sourceMappingURL=payment.js.map
package/dist/price.cjs CHANGED
@@ -142,6 +142,203 @@ var PriceService = class {
142
142
  await Promise.all(Array.from({ length: workerCount }, () => worker()));
143
143
  return results.flat();
144
144
  }
145
+ // --- Admin CRUD (flat prices). Default auth: service. ---
146
+ /** Creates a flat price. Default auth: service. */
147
+ async create(input, authCtx = SERVICE) {
148
+ return this.ctx.http.request({
149
+ method: "POST",
150
+ path: `/price/${this.ctx.tenant}/prices`,
151
+ auth: authCtx,
152
+ body: input
153
+ });
154
+ }
155
+ /** Lists flat prices. Default auth: service. */
156
+ async list(query, authCtx = SERVICE) {
157
+ return this.ctx.http.request({
158
+ method: "GET",
159
+ path: `/price/${this.ctx.tenant}/prices`,
160
+ auth: authCtx,
161
+ ...query ? { query } : {}
162
+ });
163
+ }
164
+ /** Retrieves one flat price by id. Default auth: service. */
165
+ async get(priceId, authCtx = SERVICE) {
166
+ return this.ctx.http.request({
167
+ method: "GET",
168
+ path: `/price/${this.ctx.tenant}/prices/${priceId}`,
169
+ auth: authCtx
170
+ });
171
+ }
172
+ /** Upserts a flat price by id (PUT). Default auth: service. */
173
+ async upsert(priceId, input, authCtx = SERVICE) {
174
+ return this.ctx.http.request({
175
+ method: "PUT",
176
+ path: `/price/${this.ctx.tenant}/prices/${priceId}`,
177
+ auth: authCtx,
178
+ body: input
179
+ });
180
+ }
181
+ /** Deletes a flat price by id. Default auth: service. */
182
+ async delete(priceId, authCtx = SERVICE) {
183
+ await this.ctx.http.request({
184
+ method: "DELETE",
185
+ path: `/price/${this.ctx.tenant}/prices/${priceId}`,
186
+ auth: authCtx
187
+ });
188
+ }
189
+ /** Searches flat prices (POST body query). Default auth: service. */
190
+ async search(query, authCtx = SERVICE) {
191
+ return this.ctx.http.request({
192
+ method: "POST",
193
+ path: `/price/${this.ctx.tenant}/prices/search`,
194
+ auth: authCtx,
195
+ body: query
196
+ });
197
+ }
198
+ /** Creates multiple flat prices in one request. Default auth: service. */
199
+ async bulkCreate(inputs, authCtx = SERVICE) {
200
+ return this.ctx.http.request({
201
+ method: "POST",
202
+ path: `/price/${this.ctx.tenant}/prices/bulk`,
203
+ auth: authCtx,
204
+ body: inputs
205
+ });
206
+ }
207
+ /** Upserts multiple flat prices in one request (PUT). Default auth: service. */
208
+ async bulkUpsert(inputs, authCtx = SERVICE) {
209
+ return this.ctx.http.request({
210
+ method: "PUT",
211
+ path: `/price/${this.ctx.tenant}/prices/bulk`,
212
+ auth: authCtx,
213
+ body: inputs
214
+ });
215
+ }
216
+ /** Price-model admin CRUD (`/priceModels`). Default auth: service. */
217
+ models = {
218
+ list: async (query, authCtx = SERVICE) => this.ctx.http.request({
219
+ method: "GET",
220
+ path: `/price/${this.ctx.tenant}/priceModels`,
221
+ auth: authCtx,
222
+ ...query ? { query } : {}
223
+ }),
224
+ create: async (input, authCtx = SERVICE) => this.ctx.http.request({
225
+ method: "POST",
226
+ path: `/price/${this.ctx.tenant}/priceModels`,
227
+ auth: authCtx,
228
+ body: input
229
+ }),
230
+ get: async (modelId, authCtx = SERVICE) => this.ctx.http.request({
231
+ method: "GET",
232
+ path: `/price/${this.ctx.tenant}/priceModels/${modelId}`,
233
+ auth: authCtx
234
+ }),
235
+ upsert: async (modelId, input, authCtx = SERVICE) => this.ctx.http.request({
236
+ method: "PUT",
237
+ path: `/price/${this.ctx.tenant}/priceModels/${modelId}`,
238
+ auth: authCtx,
239
+ body: input
240
+ }),
241
+ delete: async (modelId, authCtx = SERVICE) => {
242
+ await this.ctx.http.request({
243
+ method: "DELETE",
244
+ path: `/price/${this.ctx.tenant}/priceModels/${modelId}`,
245
+ auth: authCtx
246
+ });
247
+ }
248
+ };
249
+ /** Price-list admin CRUD (`/price-lists`) + nested price management. Default auth: service. */
250
+ lists = {
251
+ list: async (query, authCtx = SERVICE) => this.ctx.http.request({
252
+ method: "GET",
253
+ path: `/price/${this.ctx.tenant}/price-lists`,
254
+ auth: authCtx,
255
+ ...query ? { query } : {}
256
+ }),
257
+ create: async (input, authCtx = SERVICE) => this.ctx.http.request({
258
+ method: "POST",
259
+ path: `/price/${this.ctx.tenant}/price-lists`,
260
+ auth: authCtx,
261
+ body: input
262
+ }),
263
+ search: async (query, authCtx = SERVICE) => this.ctx.http.request({
264
+ method: "POST",
265
+ path: `/price/${this.ctx.tenant}/price-lists/search`,
266
+ auth: authCtx,
267
+ body: query
268
+ }),
269
+ get: async (listId, authCtx = SERVICE) => this.ctx.http.request({
270
+ method: "GET",
271
+ path: `/price/${this.ctx.tenant}/price-lists/${listId}`,
272
+ auth: authCtx
273
+ }),
274
+ upsert: async (listId, input, authCtx = SERVICE) => this.ctx.http.request({
275
+ method: "PUT",
276
+ path: `/price/${this.ctx.tenant}/price-lists/${listId}`,
277
+ auth: authCtx,
278
+ body: input
279
+ }),
280
+ delete: async (listId, authCtx = SERVICE) => {
281
+ await this.ctx.http.request({
282
+ method: "DELETE",
283
+ path: `/price/${this.ctx.tenant}/price-lists/${listId}`,
284
+ auth: authCtx
285
+ });
286
+ },
287
+ listPrices: async (listId, query, authCtx = SERVICE) => this.ctx.http.request({
288
+ method: "GET",
289
+ path: `/price/${this.ctx.tenant}/price-lists/${listId}/prices`,
290
+ auth: authCtx,
291
+ ...query ? { query } : {}
292
+ }),
293
+ addPrice: async (listId, input, authCtx = SERVICE) => this.ctx.http.request({
294
+ method: "POST",
295
+ path: `/price/${this.ctx.tenant}/price-lists/${listId}/prices`,
296
+ auth: authCtx,
297
+ body: input
298
+ }),
299
+ getPrice: async (listId, priceId, authCtx = SERVICE) => this.ctx.http.request({
300
+ method: "GET",
301
+ path: `/price/${this.ctx.tenant}/price-lists/${listId}/prices/${priceId}`,
302
+ auth: authCtx
303
+ }),
304
+ upsertPrice: async (listId, priceId, input, authCtx = SERVICE) => this.ctx.http.request({
305
+ method: "PUT",
306
+ path: `/price/${this.ctx.tenant}/price-lists/${listId}/prices/${priceId}`,
307
+ auth: authCtx,
308
+ body: input
309
+ }),
310
+ deletePrice: async (listId, priceId, authCtx = SERVICE) => {
311
+ await this.ctx.http.request({
312
+ method: "DELETE",
313
+ path: `/price/${this.ctx.tenant}/price-lists/${listId}/prices/${priceId}`,
314
+ auth: authCtx
315
+ });
316
+ },
317
+ searchPrices: async (listId, query, authCtx = SERVICE) => this.ctx.http.request({
318
+ method: "POST",
319
+ path: `/price/${this.ctx.tenant}/price-lists/${listId}/prices/search`,
320
+ auth: authCtx,
321
+ body: query
322
+ }),
323
+ bulkCreatePrices: async (listId, inputs, authCtx = SERVICE) => this.ctx.http.request({
324
+ method: "POST",
325
+ path: `/price/${this.ctx.tenant}/price-lists/${listId}/prices/bulk`,
326
+ auth: authCtx,
327
+ body: inputs
328
+ }),
329
+ bulkUpsertPrices: async (listId, inputs, authCtx = SERVICE) => this.ctx.http.request({
330
+ method: "PUT",
331
+ path: `/price/${this.ctx.tenant}/price-lists/${listId}/prices/bulk`,
332
+ auth: authCtx,
333
+ body: inputs
334
+ }),
335
+ bulkDeletePrices: async (listId, body, authCtx = SERVICE) => this.ctx.http.request({
336
+ method: "DELETE",
337
+ path: `/price/${this.ctx.tenant}/price-lists/${listId}/prices/bulk`,
338
+ auth: authCtx,
339
+ body
340
+ })
341
+ };
145
342
  };
146
343
 
147
344
  exports.PriceService = PriceService;