@commercetools/checkout-sdk 1.0.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 (58) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +172 -0
  3. package/dist/commercetools-checkout-sdk.browser.cjs.js +499 -0
  4. package/dist/commercetools-checkout-sdk.browser.esm.js +481 -0
  5. package/dist/commercetools-checkout-sdk.cjs.d.ts +2 -0
  6. package/dist/commercetools-checkout-sdk.cjs.dev.js +499 -0
  7. package/dist/commercetools-checkout-sdk.cjs.js +7 -0
  8. package/dist/commercetools-checkout-sdk.cjs.prod.js +499 -0
  9. package/dist/commercetools-checkout-sdk.esm.js +481 -0
  10. package/dist/declarations/src/ctp/ctp-client.d.ts +3 -0
  11. package/dist/declarations/src/ctp/ctp-client.d.ts.map +1 -0
  12. package/dist/declarations/src/generated/client/api-root.d.ts +19 -0
  13. package/dist/declarations/src/generated/client/api-root.d.ts.map +1 -0
  14. package/dist/declarations/src/generated/client/by-project-key-request-builder.d.ts +29 -0
  15. package/dist/declarations/src/generated/client/by-project-key-request-builder.d.ts.map +1 -0
  16. package/dist/declarations/src/generated/client/payment-intents/by-project-key-payment-intents-by-payment-id-request-builder.d.ts +42 -0
  17. package/dist/declarations/src/generated/client/payment-intents/by-project-key-payment-intents-by-payment-id-request-builder.d.ts.map +1 -0
  18. package/dist/declarations/src/generated/client/payment-intents/by-project-key-payment-intents-request-builder.d.ts +29 -0
  19. package/dist/declarations/src/generated/client/payment-intents/by-project-key-payment-intents-request-builder.d.ts.map +1 -0
  20. package/dist/declarations/src/generated/client/transactions/by-project-key-transactions-by-id-request-builder.d.ts +40 -0
  21. package/dist/declarations/src/generated/client/transactions/by-project-key-transactions-by-id-request-builder.d.ts.map +1 -0
  22. package/dist/declarations/src/generated/client/transactions/by-project-key-transactions-key-by-key-request-builder.d.ts +40 -0
  23. package/dist/declarations/src/generated/client/transactions/by-project-key-transactions-key-by-key-request-builder.d.ts.map +1 -0
  24. package/dist/declarations/src/generated/client/transactions/by-project-key-transactions-request-builder.d.ts +50 -0
  25. package/dist/declarations/src/generated/client/transactions/by-project-key-transactions-request-builder.d.ts.map +1 -0
  26. package/dist/declarations/src/generated/index.d.ts +27 -0
  27. package/dist/declarations/src/generated/index.d.ts.map +1 -0
  28. package/dist/declarations/src/generated/models/application.d.ts +39 -0
  29. package/dist/declarations/src/generated/models/application.d.ts.map +1 -0
  30. package/dist/declarations/src/generated/models/cart.d.ts +52 -0
  31. package/dist/declarations/src/generated/models/cart.d.ts.map +1 -0
  32. package/dist/declarations/src/generated/models/common.d.ts +100 -0
  33. package/dist/declarations/src/generated/models/common.d.ts.map +1 -0
  34. package/dist/declarations/src/generated/models/error.d.ts +144 -0
  35. package/dist/declarations/src/generated/models/error.d.ts.map +1 -0
  36. package/dist/declarations/src/generated/models/order.d.ts +26 -0
  37. package/dist/declarations/src/generated/models/order.d.ts.map +1 -0
  38. package/dist/declarations/src/generated/models/payment-integration.d.ts +39 -0
  39. package/dist/declarations/src/generated/models/payment-integration.d.ts.map +1 -0
  40. package/dist/declarations/src/generated/models/payment-intents.d.ts +111 -0
  41. package/dist/declarations/src/generated/models/payment-intents.d.ts.map +1 -0
  42. package/dist/declarations/src/generated/models/payment.d.ts +39 -0
  43. package/dist/declarations/src/generated/models/payment.d.ts.map +1 -0
  44. package/dist/declarations/src/generated/models/responses.d.ts +1647 -0
  45. package/dist/declarations/src/generated/models/responses.d.ts.map +1 -0
  46. package/dist/declarations/src/generated/models/transaction.d.ts +170 -0
  47. package/dist/declarations/src/generated/models/transaction.d.ts.map +1 -0
  48. package/dist/declarations/src/generated/shared/utils/common-types.d.ts +56 -0
  49. package/dist/declarations/src/generated/shared/utils/common-types.d.ts.map +1 -0
  50. package/dist/declarations/src/generated/shared/utils/middleware.d.ts +9 -0
  51. package/dist/declarations/src/generated/shared/utils/middleware.d.ts.map +1 -0
  52. package/dist/declarations/src/generated/shared/utils/requests-utils.d.ts +14 -0
  53. package/dist/declarations/src/generated/shared/utils/requests-utils.d.ts.map +1 -0
  54. package/dist/declarations/src/generated/shared/utils/uri-utils.d.ts +8 -0
  55. package/dist/declarations/src/generated/shared/utils/uri-utils.d.ts.map +1 -0
  56. package/dist/declarations/src/index.d.ts +3 -0
  57. package/dist/declarations/src/index.d.ts.map +1 -0
  58. package/package.json +48 -0
@@ -0,0 +1,481 @@
1
+ function _toPrimitive(t, r) {
2
+ if ("object" != typeof t || !t) return t;
3
+ var e = t[Symbol.toPrimitive];
4
+ if (void 0 !== e) {
5
+ var i = e.call(t, r || "default");
6
+ if ("object" != typeof i) return i;
7
+ throw new TypeError("@@toPrimitive must return a primitive value.");
8
+ }
9
+ return ("string" === r ? String : Number)(t);
10
+ }
11
+
12
+ function _toPropertyKey(t) {
13
+ var i = _toPrimitive(t, "string");
14
+ return "symbol" == typeof i ? i : i + "";
15
+ }
16
+
17
+ function _defineProperty(e, r, t) {
18
+ return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
19
+ value: t,
20
+ enumerable: !0,
21
+ configurable: !0,
22
+ writable: !0
23
+ }) : e[r] = t, e;
24
+ }
25
+
26
+ /**
27
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
28
+ * Please don't change this file manually but run `rmf-codegen generate <raml_file_path> -o <output_path> -t typescript_client` to update it.
29
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
30
+ */
31
+
32
+ function isDefined(value) {
33
+ return typeof value !== 'undefined' && value !== null;
34
+ }
35
+ function stringify(object) {
36
+ const params = new URLSearchParams(object);
37
+ for (const [key, value] of Object.entries(object)) {
38
+ if (Array.isArray(value)) {
39
+ params.delete(key);
40
+ value.filter(Boolean).forEach(v => params.append(key, v));
41
+ }
42
+ }
43
+ return params.toString();
44
+ }
45
+ function cleanObject(obj) {
46
+ return Object.keys(obj).reduce((result, key) => {
47
+ const value = obj[key];
48
+ if (Array.isArray(value)) {
49
+ const values = value.filter(isDefined);
50
+ if (!values.length) {
51
+ return result;
52
+ }
53
+ return {
54
+ ...result,
55
+ [key]: values
56
+ };
57
+ }
58
+ if (isDefined(value)) {
59
+ return {
60
+ ...result,
61
+ [key]: value
62
+ };
63
+ }
64
+ return result;
65
+ }, {});
66
+ }
67
+ function formatQueryString(variableMap) {
68
+ const map = cleanObject(variableMap);
69
+ const result = stringify(map);
70
+ if (result === '') {
71
+ return '';
72
+ }
73
+ return `?${result}`;
74
+ }
75
+ function buildRelativeUri(commonRequest) {
76
+ const pathMap = commonRequest.pathVariables;
77
+ var uri = commonRequest.uriTemplate;
78
+ for (const param in pathMap) {
79
+ const value = encodeURIComponent(`${pathMap[param]}`);
80
+ uri = uri.replace(`{${param}}`, `${value}`);
81
+ }
82
+ const resQuery = formatQueryString(commonRequest.queryParams || {});
83
+ return `${uri}${resQuery}`;
84
+ }
85
+
86
+ class ApiRequest {
87
+ constructor(request, requestExecutor) {
88
+ this.requestExecutor = requestExecutor;
89
+ _defineProperty(this, "request", void 0);
90
+ this.request = {
91
+ ...request,
92
+ uri: buildRelativeUri(request)
93
+ };
94
+ }
95
+ clientRequest() {
96
+ return this.request;
97
+ }
98
+ execute() {
99
+ return this.requestExecutor(this.request);
100
+ }
101
+ }
102
+
103
+ /**
104
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
105
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
106
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
107
+ */
108
+ /**
109
+ **/
110
+ class ByProjectKeyPaymentIntentsByPaymentIdRequestBuilder {
111
+ constructor(args) {
112
+ this.args = args;
113
+ }
114
+ /**
115
+ * Specific Error Codes:
116
+ * - [MultipleActionsNotAllowed](ctp:checkout:type:MultipleActionsNotAllowedError)
117
+ * - [RequiredField](ctp:checkout:type:RequiredFieldError)
118
+ * - [ResourceNotFound](ctp:checkout:type:ResourceNotFoundError)
119
+ *
120
+ */
121
+ post(methodArgs) {
122
+ return new ApiRequest({
123
+ baseUri: this.args.baseUri,
124
+ method: 'POST',
125
+ uriTemplate: '/{projectKey}/payment-intents/{paymentId}',
126
+ pathVariables: this.args.pathArgs,
127
+ headers: {
128
+ 'Content-Type': 'application/json',
129
+ ...methodArgs?.headers
130
+ },
131
+ body: methodArgs?.body
132
+ }, this.args.executeRequest);
133
+ }
134
+ }
135
+
136
+ /**
137
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
138
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
139
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
140
+ */
141
+ /**
142
+ **/
143
+ class ByProjectKeyPaymentIntentsRequestBuilder {
144
+ constructor(args) {
145
+ this.args = args;
146
+ }
147
+ withPaymentId(childPathArgs) {
148
+ return new ByProjectKeyPaymentIntentsByPaymentIdRequestBuilder({
149
+ pathArgs: {
150
+ ...this.args.pathArgs,
151
+ ...childPathArgs
152
+ },
153
+ executeRequest: this.args.executeRequest,
154
+ baseUri: this.args.baseUri
155
+ });
156
+ }
157
+ }
158
+
159
+ /**
160
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
161
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
162
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
163
+ */
164
+ /**
165
+ **/
166
+ class ByProjectKeyTransactionsByIdRequestBuilder {
167
+ constructor(args) {
168
+ this.args = args;
169
+ }
170
+ /**
171
+ * Returns a Transaction with a given `id`. Specific Error Codes:
172
+ * - [ResourceNotFound](ctp:checkout:type:ResourceNotFoundError)
173
+ * - [GeneralError](ctp:checkout:type:GeneralError)
174
+ *
175
+ */
176
+ get(methodArgs) {
177
+ return new ApiRequest({
178
+ baseUri: this.args.baseUri,
179
+ method: 'GET',
180
+ uriTemplate: '/{projectKey}/transactions/{id}',
181
+ pathVariables: this.args.pathArgs,
182
+ headers: {
183
+ ...methodArgs?.headers
184
+ }
185
+ }, this.args.executeRequest);
186
+ }
187
+ }
188
+
189
+ /**
190
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
191
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
192
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
193
+ */
194
+ /**
195
+ **/
196
+ class ByProjectKeyTransactionsKeyByKeyRequestBuilder {
197
+ constructor(args) {
198
+ this.args = args;
199
+ }
200
+ /**
201
+ * Returns a Transaction with a given `key`. Specific Error Codes:
202
+ * - [ResourceNotFound](ctp:checkout:type:ResourceNotFoundError)
203
+ * - [GeneralError](ctp:checkout:type:GeneralError)
204
+ *
205
+ */
206
+ get(methodArgs) {
207
+ return new ApiRequest({
208
+ baseUri: this.args.baseUri,
209
+ method: 'GET',
210
+ uriTemplate: '/{projectKey}/transactions/key={key}',
211
+ pathVariables: this.args.pathArgs,
212
+ headers: {
213
+ ...methodArgs?.headers
214
+ }
215
+ }, this.args.executeRequest);
216
+ }
217
+ }
218
+
219
+ /**
220
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
221
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
222
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
223
+ */
224
+ /**
225
+ **/
226
+ class ByProjectKeyTransactionsRequestBuilder {
227
+ constructor(args) {
228
+ this.args = args;
229
+ }
230
+ withId(childPathArgs) {
231
+ return new ByProjectKeyTransactionsByIdRequestBuilder({
232
+ pathArgs: {
233
+ ...this.args.pathArgs,
234
+ ...childPathArgs
235
+ },
236
+ executeRequest: this.args.executeRequest,
237
+ baseUri: this.args.baseUri
238
+ });
239
+ }
240
+ withKey(childPathArgs) {
241
+ return new ByProjectKeyTransactionsKeyByKeyRequestBuilder({
242
+ pathArgs: {
243
+ ...this.args.pathArgs,
244
+ ...childPathArgs
245
+ },
246
+ executeRequest: this.args.executeRequest,
247
+ baseUri: this.args.baseUri
248
+ });
249
+ }
250
+
251
+ /**
252
+ * Creates a Transaction on Checkout. Specific Error Codes:
253
+ * - [InvalidInput](ctp:checkout:type:InvalidInputError)
254
+ * - [ResourceNotFound](ctp:checkout:type:ResourceNotFoundError)
255
+ * - [ConnectorFailed](ctp:checkout:type:ConnectorFailedError)
256
+ * - [PaymentFailure](ctp:checkout:type:PaymentFailureError)
257
+ * - [RequiredField](ctp:checkout:type:RequiredFieldError)
258
+ *
259
+ */
260
+ post(methodArgs) {
261
+ return new ApiRequest({
262
+ baseUri: this.args.baseUri,
263
+ method: 'POST',
264
+ uriTemplate: '/{projectKey}/transactions',
265
+ pathVariables: this.args.pathArgs,
266
+ headers: {
267
+ 'Content-Type': 'application/json',
268
+ ...methodArgs?.headers
269
+ },
270
+ body: methodArgs?.body
271
+ }, this.args.executeRequest);
272
+ }
273
+ }
274
+
275
+ /**
276
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
277
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
278
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
279
+ */
280
+ /**
281
+ **/
282
+ class ByProjectKeyRequestBuilder {
283
+ constructor(args) {
284
+ this.args = args;
285
+ }
286
+ paymentIntents() {
287
+ return new ByProjectKeyPaymentIntentsRequestBuilder({
288
+ pathArgs: {
289
+ ...this.args.pathArgs
290
+ },
291
+ executeRequest: this.args.executeRequest,
292
+ baseUri: this.args.baseUri
293
+ });
294
+ }
295
+ transactions() {
296
+ return new ByProjectKeyTransactionsRequestBuilder({
297
+ pathArgs: {
298
+ ...this.args.pathArgs
299
+ },
300
+ executeRequest: this.args.executeRequest,
301
+ baseUri: this.args.baseUri
302
+ });
303
+ }
304
+ }
305
+
306
+ class ApiRoot {
307
+ constructor(args) {
308
+ _defineProperty(this, "executeRequest", void 0);
309
+ _defineProperty(this, "baseUri", void 0);
310
+ this.executeRequest = args.executeRequest;
311
+ this.baseUri = args.baseUri || 'https://checkout.europe-west1.gcp.commercetools.com';
312
+ }
313
+ withProjectKey(childPathArgs) {
314
+ return new ByProjectKeyRequestBuilder({
315
+ pathArgs: {
316
+ ...childPathArgs
317
+ },
318
+ executeRequest: this.executeRequest,
319
+ baseUri: this.baseUri
320
+ });
321
+ }
322
+ }
323
+
324
+ /**
325
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
326
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
327
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
328
+ */
329
+
330
+ /**
331
+ * A Reference represents a loose reference to another resource in the same Project identified by its `id`. The `typeId` indicates the type of the referenced resource. Each resource type has its corresponding Reference type, like [ChannelReference](ctp:api:type:ChannelReference). A referenced resource can be embedded through [Reference Expansion](/general-concepts#reference-expansion). The expanded reference is the value of an additional `obj` field then.
332
+ *
333
+ */
334
+
335
+ /**
336
+ * Type of resource the value should reference. Supported resource type identifiers are:
337
+ *
338
+ */
339
+ let ReferenceTypeIdValues = /*#__PURE__*/function (ReferenceTypeIdValues) {
340
+ ReferenceTypeIdValues["Application"] = "application";
341
+ ReferenceTypeIdValues["Cart"] = "cart";
342
+ ReferenceTypeIdValues["Order"] = "order";
343
+ ReferenceTypeIdValues["Payment"] = "payment";
344
+ ReferenceTypeIdValues["PaymentIntegration"] = "payment-integration";
345
+ return ReferenceTypeIdValues;
346
+ }({});
347
+
348
+ /**
349
+ * Draft type to create a [Reference](ctp:api:type:Reference) or a [KeyReference](ctp:api:type:KeyReference) to a resource. Provide either the `id` or (wherever supported) the `key` of the resource to reference, but depending on the API endpoint the response returns either a Reference or a KeyReference. For example, the field `parent` of a [CategoryDraft](ctp:api:type:CategoryDraft) takes a ResourceIdentifier for its value while the value of the corresponding field of a [Category](ctp:api:type:Category) is a Reference.
350
+ *
351
+ * Each resource type has its corresponding ResourceIdentifier, like [ChannelResourceIdentifier](ctp:api:type:ChannelResourceIdentifier).
352
+ *
353
+ */
354
+
355
+ /**
356
+ * Money in cent amounts for a specific currency.
357
+ *
358
+ */
359
+
360
+ /**
361
+ * The Region in which the Checkout application is [hosted](/hosts-and-authorization).
362
+ *
363
+ */
364
+ let RegionValues = /*#__PURE__*/function (RegionValues) {
365
+ RegionValues["AustraliaSoutheast1Gcp"] = "australia-southeast1.gcp";
366
+ RegionValues["EuropeWest1Gcp"] = "europe-west1.gcp";
367
+ RegionValues["UsCentral1Gcp"] = "us-central1.gcp";
368
+ return RegionValues;
369
+ }({});
370
+
371
+ /**
372
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
373
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
374
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
375
+ */
376
+
377
+ /**
378
+ * Depending on the action specified, Checkout requests the [payment service provider](/connectors-and-applications#supported-psps-payment-integration-types-and-payment-methods) (PSP) or gift card management system to capture, refund, or cancel the authorization for the given Payment.
379
+ *
380
+ */
381
+
382
+ /**
383
+ * Requests to [cancel the authorization](/payments-lifecycle#authorization-cancellation) for a Payment. Checkout will cancel the [Payment](/../api/projects/payments#payment) and will request the PSP or gift card management system to proceed with the financial process to cancel the authorization.
384
+ *
385
+ * You cannot request to cancel the authorization for a Payment that has already been [captured](/payments-lifecycle#payment-capture).
386
+ *
387
+ */
388
+
389
+ /**
390
+ * Requests to [capture](/payments-lifecycle#payment-capture) the given amount from the customer. Checkout will request the PSP or gift card management system to proceed with the financial process to capture the amount.
391
+ *
392
+ */
393
+
394
+ /**
395
+ * The possible values for a [Payment Intent Action](ctp:checkout:type:PaymentIntentAction).
396
+ *
397
+ */
398
+ let PaymentIntentOperationValues = /*#__PURE__*/function (PaymentIntentOperationValues) {
399
+ PaymentIntentOperationValues["CancelPayment"] = "cancelPayment";
400
+ PaymentIntentOperationValues["CapturePayment"] = "capturePayment";
401
+ PaymentIntentOperationValues["RefundPayment"] = "refundPayment";
402
+ PaymentIntentOperationValues["ReversePayment"] = "reversePayment";
403
+ return PaymentIntentOperationValues;
404
+ }({});
405
+
406
+ /**
407
+ * Requests to [refund](/payments-lifecycle#refund) the given amount to the customer. Checkout will request the PSP or gift card management system to proceed with the financial process to refund the amount.
408
+ *
409
+ */
410
+
411
+ /**
412
+ * Requests to [reverse](/payment-integration-predicates) a [Payment](/../api/projects/payments#payment). Checkout reverses the Payment, and then requests the PSP or gift card management system to proceed with the relevant process to reverse the Payment.
413
+ *
414
+ */
415
+
416
+ /**
417
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
418
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
419
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
420
+ */
421
+
422
+ /**
423
+ * Information for the request to the [Connector](/connectors-and-applications#payment-connectors) to initiate the payment for a specific [Cart](/../api/projects/carts).
424
+ *
425
+ */
426
+
427
+ /**
428
+ * A single error on the [Transaction](/transactions-api#transaction). Multiple errors may be included in the [Transaction Status](/transactions-api#transactionstatus).
429
+ *
430
+ */
431
+
432
+ /**
433
+ * Payment information related to the [Transaction](/transactions-api#transaction).
434
+ *
435
+ */
436
+
437
+ /**
438
+ * The state of the [Transaction](/transactions-api#transaction).
439
+ *
440
+ */
441
+ let TransactionStateValues = /*#__PURE__*/function (TransactionStateValues) {
442
+ TransactionStateValues["Completed"] = "Completed";
443
+ TransactionStateValues["Failed"] = "Failed";
444
+ TransactionStateValues["Initial"] = "Initial";
445
+ TransactionStateValues["Pending"] = "Pending";
446
+ return TransactionStateValues;
447
+ }({});
448
+
449
+ /**
450
+ * The state of the [Transaction](/transactions-api#transaction) and the related errors in case of a failed Transaction.
451
+ *
452
+ */
453
+
454
+ /**
455
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
456
+ * Please don't change this file manually but run `rmf-codegen generate <raml_file_path> -o <output_path> -t typescript_client` to update it.
457
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
458
+ */
459
+
460
+ const createExecutorFromMiddlewares = (executor, midds) => {
461
+ if (!midds || midds.length == 0) {
462
+ return executor;
463
+ }
464
+ const reduced = midds.reduce(reduceMiddleware);
465
+ return middlewareToExecutor(reduced, executor);
466
+ };
467
+ function reduceMiddleware(middleware1, middleware2) {
468
+ return (request, executor) => middleware1(request, middlewareToExecutor(middleware2, executor));
469
+ }
470
+ function middlewareToExecutor(middleware, executor) {
471
+ return request => middleware(request, executor);
472
+ }
473
+
474
+ function createApiBuilderFromCtpClient(ctpClient, baseUri) {
475
+ return new ApiRoot({
476
+ executeRequest: ctpClient.execute,
477
+ baseUri: baseUri
478
+ });
479
+ }
480
+
481
+ export { ApiRequest, ApiRoot, ByProjectKeyPaymentIntentsByPaymentIdRequestBuilder, ByProjectKeyPaymentIntentsRequestBuilder, ByProjectKeyRequestBuilder, ByProjectKeyTransactionsByIdRequestBuilder, ByProjectKeyTransactionsKeyByKeyRequestBuilder, ByProjectKeyTransactionsRequestBuilder, PaymentIntentOperationValues, ReferenceTypeIdValues, RegionValues, TransactionStateValues, buildRelativeUri, createApiBuilderFromCtpClient, createExecutorFromMiddlewares };
@@ -0,0 +1,2 @@
1
+ export * from "./declarations/src/index.js";
2
+ //# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWVyY2V0b29scy1jaGVja291dC1zZGsuY2pzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuL2RlY2xhcmF0aW9ucy9zcmMvaW5kZXguZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSJ9