@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,40 @@
1
+ /**
2
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
3
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
4
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
5
+ */
6
+ import { Transaction } from "../../models/transaction.js";
7
+ import { executeRequest } from "../../shared/utils/common-types.js";
8
+ import { ApiRequest } from "../../shared/utils/requests-utils.js";
9
+ /**
10
+ **/
11
+ export declare class ByProjectKeyTransactionsKeyByKeyRequestBuilder {
12
+ protected readonly args: {
13
+ pathArgs: {
14
+ projectKey: string;
15
+ key: string;
16
+ };
17
+ executeRequest: executeRequest;
18
+ baseUri?: string;
19
+ };
20
+ constructor(args: {
21
+ pathArgs: {
22
+ projectKey: string;
23
+ key: string;
24
+ };
25
+ executeRequest: executeRequest;
26
+ baseUri?: string;
27
+ });
28
+ /**
29
+ * Returns a Transaction with a given `key`. Specific Error Codes:
30
+ * - [ResourceNotFound](ctp:checkout:type:ResourceNotFoundError)
31
+ * - [GeneralError](ctp:checkout:type:GeneralError)
32
+ *
33
+ */
34
+ get(methodArgs?: {
35
+ headers?: {
36
+ [key: string]: string | string[];
37
+ };
38
+ }): ApiRequest<Transaction>;
39
+ }
40
+ //# sourceMappingURL=by-project-key-transactions-key-by-key-request-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"by-project-key-transactions-key-by-key-request-builder.d.ts","sourceRoot":"../../../../../../src/generated/client/transactions","sources":["by-project-key-transactions-key-by-key-request-builder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAE,oCAAgC;AACtD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAChE,OAAO,EAAE,UAAU,EAAE,6CAAyC;AAC9D;IACI;AACJ,qBAAa,8CAA8C;IAEvD,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE;QACvB,QAAQ,EAAE;YACR,UAAU,EAAE,MAAM,CAAA;YAClB,GAAG,EAAE,MAAM,CAAA;SACZ,CAAA;QACD,cAAc,EAAE,cAAc,CAAA;QAC9B,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;gBAPkB,IAAI,EAAE;QACvB,QAAQ,EAAE;YACR,UAAU,EAAE,MAAM,CAAA;YAClB,GAAG,EAAE,MAAM,CAAA;SACZ,CAAA;QACD,cAAc,EAAE,cAAc,CAAA;QAC9B,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;IAEH;;;;;OAKG;IACI,GAAG,CAAC,UAAU,CAAC,EAAE;QACtB,OAAO,CAAC,EAAE;YACR,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;SACjC,CAAA;KACF,GAAG,UAAU,CAAC,WAAW,CAAC;CAc5B"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
3
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
4
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
5
+ */
6
+ import { Transaction, TransactionDraft } from "../../models/transaction.js";
7
+ import { executeRequest } from "../../shared/utils/common-types.js";
8
+ import { ApiRequest } from "../../shared/utils/requests-utils.js";
9
+ import { ByProjectKeyTransactionsByIdRequestBuilder } from "./by-project-key-transactions-by-id-request-builder.js";
10
+ import { ByProjectKeyTransactionsKeyByKeyRequestBuilder } from "./by-project-key-transactions-key-by-key-request-builder.js";
11
+ /**
12
+ **/
13
+ export declare class ByProjectKeyTransactionsRequestBuilder {
14
+ protected readonly args: {
15
+ pathArgs: {
16
+ projectKey: string;
17
+ };
18
+ executeRequest: executeRequest;
19
+ baseUri?: string;
20
+ };
21
+ constructor(args: {
22
+ pathArgs: {
23
+ projectKey: string;
24
+ };
25
+ executeRequest: executeRequest;
26
+ baseUri?: string;
27
+ });
28
+ withId(childPathArgs: {
29
+ id: string;
30
+ }): ByProjectKeyTransactionsByIdRequestBuilder;
31
+ withKey(childPathArgs: {
32
+ key: string;
33
+ }): ByProjectKeyTransactionsKeyByKeyRequestBuilder;
34
+ /**
35
+ * Creates a Transaction on Checkout. Specific Error Codes:
36
+ * - [InvalidInput](ctp:checkout:type:InvalidInputError)
37
+ * - [ResourceNotFound](ctp:checkout:type:ResourceNotFoundError)
38
+ * - [ConnectorFailed](ctp:checkout:type:ConnectorFailedError)
39
+ * - [PaymentFailure](ctp:checkout:type:PaymentFailureError)
40
+ * - [RequiredField](ctp:checkout:type:RequiredFieldError)
41
+ *
42
+ */
43
+ post(methodArgs: {
44
+ body: TransactionDraft;
45
+ headers?: {
46
+ [key: string]: string | string[];
47
+ };
48
+ }): ApiRequest<Transaction>;
49
+ }
50
+ //# sourceMappingURL=by-project-key-transactions-request-builder.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"by-project-key-transactions-request-builder.d.ts","sourceRoot":"../../../../../../src/generated/client/transactions","sources":["by-project-key-transactions-request-builder.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,oCAAgC;AACxE,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAChE,OAAO,EAAE,UAAU,EAAE,6CAAyC;AAC9D,OAAO,EAAE,0CAA0C,EAAE,+DAA2D;AAChH,OAAO,EAAE,8CAA8C,EAAE,oEAAgE;AACzH;IACI;AACJ,qBAAa,sCAAsC;IAE/C,SAAS,CAAC,QAAQ,CAAC,IAAI,EAAE;QACvB,QAAQ,EAAE;YACR,UAAU,EAAE,MAAM,CAAA;SACnB,CAAA;QACD,cAAc,EAAE,cAAc,CAAA;QAC9B,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;gBANkB,IAAI,EAAE;QACvB,QAAQ,EAAE;YACR,UAAU,EAAE,MAAM,CAAA;SACnB,CAAA;QACD,cAAc,EAAE,cAAc,CAAA;QAC9B,OAAO,CAAC,EAAE,MAAM,CAAA;KACjB;IAEI,MAAM,CAAC,aAAa,EAAE;QAC3B,EAAE,EAAE,MAAM,CAAA;KACX,GAAG,0CAA0C;IAUvC,OAAO,CAAC,aAAa,EAAE;QAC5B,GAAG,EAAE,MAAM,CAAA;KACZ,GAAG,8CAA8C;IAWlD;;;;;;;;OAQG;IACI,IAAI,CAAC,UAAU,EAAE;QACtB,IAAI,EAAE,gBAAgB,CAAA;QACtB,OAAO,CAAC,EAAE;YACR,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAA;SACjC,CAAA;KACF,GAAG,UAAU,CAAC,WAAW,CAAC;CAgB5B"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
3
+ * Please don't change this file manually but run `rmf-codegen generate <raml_file_path> -o <output_path> -t typescript_client` to update it.
4
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
5
+ */
6
+ export * from "./client/api-root.js";
7
+ export * from "./client/by-project-key-request-builder.js";
8
+ export * from "./client/payment-intents/by-project-key-payment-intents-by-payment-id-request-builder.js";
9
+ export * from "./client/payment-intents/by-project-key-payment-intents-request-builder.js";
10
+ export * from "./client/transactions/by-project-key-transactions-by-id-request-builder.js";
11
+ export * from "./client/transactions/by-project-key-transactions-key-by-key-request-builder.js";
12
+ export * from "./client/transactions/by-project-key-transactions-request-builder.js";
13
+ export * from "./models/application.js";
14
+ export * from "./models/cart.js";
15
+ export * from "./models/common.js";
16
+ export * from "./models/error.js";
17
+ export * from "./models/order.js";
18
+ export * from "./models/payment.js";
19
+ export * from "./models/payment-integration.js";
20
+ export * from "./models/payment-intents.js";
21
+ export * from "./models/responses.js";
22
+ export * from "./models/transaction.js";
23
+ export * from "./shared/utils/common-types.js";
24
+ export * from "./shared/utils/middleware.js";
25
+ export * from "./shared/utils/requests-utils.js";
26
+ export * from "./shared/utils/uri-utils.js";
27
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"../../../../src/generated","sources":["index.ts"],"names":[],"mappings":"AACA;;;;EAIE;AAGF,qCAAkC;AAClC,2DAAuD;AACvD,yGAAqG;AACrG,2FAAuF;AACvF,2FAAuF;AACvF,gGAA4F;AAC5F,qFAAiF;AAEjF,wCAAoC;AACpC,iCAA6B;AAC7B,mCAA+B;AAC/B,kCAA8B;AAC9B,kCAA8B;AAC9B,oCAAgC;AAChC,gDAA4C;AAC5C,4CAAwC;AACxC,sCAAkC;AAClC,wCAAoC;AAEpC,+CAA2C;AAC3C,6CAAyC;AACzC,iDAA6C;AAC7C,4CAAwC"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
3
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
4
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
5
+ */
6
+ import { IReference, IResourceIdentifier } from "./common.js";
7
+ /**
8
+ * Reference to an [Application](/connectors-and-applications#applications).
9
+ *
10
+ */
11
+ export interface ApplicationReference extends IReference {
12
+ readonly typeId: 'application';
13
+ /**
14
+ * Unique identifier of the referenced Application.
15
+ *
16
+ *
17
+ */
18
+ readonly id: string;
19
+ }
20
+ /**
21
+ * Resource identifier to an [Application](/connectors-and-applications#applications). Either `id` or `key` is required. If both are set, an [InvalidJsonInput](/errors#invalidjsoninput) error is returned.
22
+ *
23
+ */
24
+ export interface ApplicationResourceIdentifier extends IResourceIdentifier {
25
+ readonly typeId: 'application';
26
+ /**
27
+ * Unique identifier of the referenced Application. Required if `key` is absent.
28
+ *
29
+ *
30
+ */
31
+ readonly id?: string;
32
+ /**
33
+ * User-defined unique identifier of the referenced Application. Required if `id` is absent.
34
+ *
35
+ *
36
+ */
37
+ readonly key?: string;
38
+ }
39
+ //# sourceMappingURL=application.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"application.d.ts","sourceRoot":"../../../../../src/generated/models","sources":["application.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,oBAAgB;AAE1D;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,UAAU;IACtD,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CACpB;AACD;;;GAGG;AACH,MAAM,WAAW,6BAA8B,SAAQ,mBAAmB;IACxE,QAAQ,CAAC,MAAM,EAAE,aAAa,CAAA;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CACtB"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
3
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
4
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
5
+ */
6
+ import { IReference, IResourceIdentifier } from "./common.js";
7
+ /**
8
+ * Reference to a [Cart](/../api/projects/carts).
9
+ *
10
+ */
11
+ export interface CartReference extends IReference {
12
+ readonly typeId: 'cart';
13
+ /**
14
+ * Unique identifier of the referenced [Cart](/../api/projects/carts).
15
+ *
16
+ *
17
+ */
18
+ readonly id: string;
19
+ }
20
+ /**
21
+ * Resource identifier to a [Cart](/../api/projects/carts). Either `id` or `key` is required. If both are set, an [InvalidJsonInput](/errors#invalidjsoninput) error is returned.
22
+ *
23
+ */
24
+ export interface CartResourceIdentifier extends IResourceIdentifier {
25
+ readonly typeId: 'cart';
26
+ /**
27
+ * Unique identifier of the referenced [Cart](/../api/projects/carts). Required if `key` is absent.
28
+ *
29
+ *
30
+ */
31
+ readonly id?: string;
32
+ /**
33
+ * User-defined unique identifier of the referenced [Cart](/../api/projects/carts). Required if `id` is absent.
34
+ *
35
+ *
36
+ */
37
+ readonly key?: string;
38
+ }
39
+ /**
40
+ * Reference to an [Order](/../api/projects/orders).
41
+ *
42
+ */
43
+ export interface OrderReference extends IReference {
44
+ readonly typeId: 'order';
45
+ /**
46
+ * Unique identifier of the referenced [Order](/../api/projects/orders).
47
+ *
48
+ *
49
+ */
50
+ readonly id: string;
51
+ }
52
+ //# sourceMappingURL=cart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cart.d.ts","sourceRoot":"../../../../../src/generated/models","sources":["cart.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,oBAAgB;AAE1D;;;GAGG;AACH,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CACpB;AACD;;;GAGG;AACH,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IACjE,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CACtB;AACD;;;GAGG;AACH,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CACpB"}
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
3
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
4
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
5
+ */
6
+ import { ApplicationReference, ApplicationResourceIdentifier } from "./application.js";
7
+ import { CartReference, CartResourceIdentifier, OrderReference } from "./cart.js";
8
+ import { OrderResourceIdentifier } from "./order.js";
9
+ import { PaymentReference, PaymentResourceIdentifier } from "./payment.js";
10
+ import { PaymentIntegrationReference, PaymentIntegrationResourceIdentifier } from "./payment-integration.js";
11
+ /**
12
+ * 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.
13
+ *
14
+ */
15
+ export type Reference = ApplicationReference | CartReference | OrderReference | PaymentIntegrationReference | PaymentReference;
16
+ export interface IReference {
17
+ /**
18
+ * Type of referenced resource.
19
+ *
20
+ *
21
+ */
22
+ readonly typeId: ReferenceTypeId;
23
+ /**
24
+ * Unique ID of the referenced resource.
25
+ *
26
+ *
27
+ */
28
+ readonly id: string;
29
+ }
30
+ /**
31
+ * Type of resource the value should reference. Supported resource type identifiers are:
32
+ *
33
+ */
34
+ export declare enum ReferenceTypeIdValues {
35
+ Application = "application",
36
+ Cart = "cart",
37
+ Order = "order",
38
+ Payment = "payment",
39
+ PaymentIntegration = "payment-integration"
40
+ }
41
+ export type ReferenceTypeId = 'application' | 'cart' | 'order' | 'payment' | 'payment-integration' | (string & {});
42
+ /**
43
+ * 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.
44
+ *
45
+ * Each resource type has its corresponding ResourceIdentifier, like [ChannelResourceIdentifier](ctp:api:type:ChannelResourceIdentifier).
46
+ *
47
+ */
48
+ export type ResourceIdentifier = ApplicationResourceIdentifier | CartResourceIdentifier | OrderResourceIdentifier | PaymentIntegrationResourceIdentifier | PaymentResourceIdentifier;
49
+ export interface IResourceIdentifier {
50
+ /**
51
+ * Type of referenced resource. If given, it must match the expected [ReferenceTypeId](/../api/types#ctp:api:type:ReferenceTypeId) of the referenced resource.
52
+ *
53
+ *
54
+ */
55
+ readonly typeId?: ReferenceTypeId;
56
+ /**
57
+ * Unique identifier of the referenced resource. Required if `key` is absent.
58
+ *
59
+ *
60
+ */
61
+ readonly id?: string;
62
+ /**
63
+ * User-defined unique identifier of the referenced resource. Required if `id` is absent.
64
+ *
65
+ *
66
+ */
67
+ readonly key?: string;
68
+ }
69
+ /**
70
+ * Money in cent amounts for a specific currency.
71
+ *
72
+ */
73
+ export interface Amount {
74
+ /**
75
+ * Amount in the smallest indivisible unit of a currency, such as:
76
+ *
77
+ * * Cents for EUR and USD, pence for GBP, or centime for CHF (5 CHF is specified as `500`).
78
+ * * The value in the major unit for currencies without minor units, like JPY (5 JPY is specified as `5`).
79
+ *
80
+ *
81
+ */
82
+ readonly centAmount: number;
83
+ /**
84
+ * Currency code compliant to [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217).
85
+ *
86
+ *
87
+ */
88
+ readonly currencyCode: string;
89
+ }
90
+ /**
91
+ * The Region in which the Checkout application is [hosted](/hosts-and-authorization).
92
+ *
93
+ */
94
+ export declare enum RegionValues {
95
+ AustraliaSoutheast1Gcp = "australia-southeast1.gcp",
96
+ EuropeWest1Gcp = "europe-west1.gcp",
97
+ UsCentral1Gcp = "us-central1.gcp"
98
+ }
99
+ export type Region = 'australia-southeast1.gcp' | 'europe-west1.gcp' | 'us-central1.gcp' | (string & {});
100
+ //# sourceMappingURL=common.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"../../../../../src/generated/models","sources":["common.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EACL,oBAAoB,EACpB,6BAA6B,EAC9B,yBAAqB;AACtB,OAAO,EAAE,aAAa,EAAE,sBAAsB,EAAE,cAAc,EAAE,kBAAc;AAC9E,OAAO,EAAE,uBAAuB,EAAE,mBAAe;AACjD,OAAO,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,qBAAiB;AACvE,OAAO,EACL,2BAA2B,EAC3B,oCAAoC,EACrC,iCAA6B;AAE9B;;;GAGG;AACH,MAAM,MAAM,SAAS,GACjB,oBAAoB,GACpB,aAAa,GACb,cAAc,GACd,2BAA2B,GAC3B,gBAAgB,CAAA;AACpB,MAAM,WAAW,UAAU;IACzB;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAA;IAChC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CACpB;AACD;;;GAGG;AACH,oBAAY,qBAAqB;IAC/B,WAAW,gBAAgB;IAC3B,IAAI,SAAS;IACb,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,kBAAkB,wBAAwB;CAC3C;AAED,MAAM,MAAM,eAAe,GACvB,aAAa,GACb,MAAM,GACN,OAAO,GACP,SAAS,GACT,qBAAqB,GACrB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AACjB;;;;;GAKG;AACH,MAAM,MAAM,kBAAkB,GAC1B,6BAA6B,GAC7B,sBAAsB,GACtB,uBAAuB,GACvB,oCAAoC,GACpC,yBAAyB,CAAA;AAC7B,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAA;IACjC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CACtB;AACD;;;GAGG;AACH,MAAM,WAAW,MAAM;IACrB;;;;;;;OAOG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAA;CAC9B;AACD;;;GAGG;AACH,oBAAY,YAAY;IACtB,sBAAsB,6BAA6B;IACnD,cAAc,qBAAqB;IACnC,aAAa,oBAAoB;CAClC;AAED,MAAM,MAAM,MAAM,GACd,0BAA0B,GAC1B,kBAAkB,GAClB,iBAAiB,GACjB,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA"}
@@ -0,0 +1,144 @@
1
+ /**
2
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
3
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
4
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
5
+ */
6
+ /**
7
+ * This is the representation of a single error.
8
+ */
9
+ export type ErrorObject = ConnectorFailedError | GeneralError | InvalidInputError | InvalidJsonInputError | MultipleActionsNotAllowedError | PaymentFailureError | RequiredFieldError | ResourceNotFoundError;
10
+ export interface IErrorObject {
11
+ /**
12
+ * Error identifier.
13
+ *
14
+ *
15
+ */
16
+ readonly code: string;
17
+ /**
18
+ * Plain text description of the cause of the error.
19
+ *
20
+ *
21
+ */
22
+ readonly message: string;
23
+ }
24
+ /**
25
+ * Returned when the payment [Connector](/connectors-and-applications#payment-connectors) cannot be reached.
26
+ *
27
+ */
28
+ export interface ConnectorFailedError extends IErrorObject {
29
+ readonly code: 'ConnectorFailed';
30
+ /**
31
+ * `"The connector could not be reached."`
32
+ *
33
+ *
34
+ */
35
+ readonly message: string;
36
+ }
37
+ /**
38
+ * Returned when a server-side problem occurs. In some cases, the requested action may successfully complete after the error is returned. Therefore, it is recommended to verify the status of the requested resource after receiving a 500 error.
39
+ *
40
+ * If you encounter this error, report it to the [Checkout support team](https://support.commercetools.com/).
41
+ *
42
+ */
43
+ export interface GeneralError extends IErrorObject {
44
+ readonly code: 'General';
45
+ /**
46
+ * Description about any known details of the problem, for example, `"Write operations are temporarily unavailable"`.
47
+ *
48
+ *
49
+ */
50
+ readonly message: string;
51
+ }
52
+ /**
53
+ * Returned when input is not valid.
54
+ *
55
+ */
56
+ export interface InvalidInputError extends IErrorObject {
57
+ readonly code: 'InvalidInput';
58
+ /**
59
+ * Description of the invalid input error.
60
+ *
61
+ *
62
+ */
63
+ readonly message: string;
64
+ }
65
+ /**
66
+ * Returned when an invalid JSON input has been sent.
67
+ * Either the JSON is syntactically incorrect or does not conform to the expected shape, for example, it is missing a required field.
68
+ *
69
+ * The client application should validate the input according to the constraints described in the error message before sending the request.
70
+ *
71
+ */
72
+ export interface InvalidJsonInputError extends IErrorObject {
73
+ readonly code: 'InvalidJsonInput';
74
+ /**
75
+ * `"Request body does not contain valid JSON."`
76
+ *
77
+ *
78
+ */
79
+ readonly message: string;
80
+ /**
81
+ * Further explanation about why the JSON is invalid.
82
+ *
83
+ */
84
+ readonly detailedErrorMessage: string;
85
+ }
86
+ /**
87
+ * Returned when `actions` in the request body contains more than one object.
88
+ *
89
+ */
90
+ export interface MultipleActionsNotAllowedError extends IErrorObject {
91
+ readonly code: 'MultipleActionsNotAllowed';
92
+ /**
93
+ * `"Actions accepts only one action at time. Array size must be 1."`
94
+ *
95
+ *
96
+ */
97
+ readonly message: string;
98
+ }
99
+ /**
100
+ * Returned when the payment cannot be completed successfully.
101
+ *
102
+ */
103
+ export interface PaymentFailureError extends IErrorObject {
104
+ readonly code: 'PaymentFailure';
105
+ /**
106
+ * `"Payment could not be completed successfully."`
107
+ *
108
+ *
109
+ */
110
+ readonly message: string;
111
+ }
112
+ /**
113
+ * Returned when a value is not defined for a required field.
114
+ *
115
+ */
116
+ export interface RequiredFieldError extends IErrorObject {
117
+ readonly code: 'RequiredField';
118
+ /**
119
+ * `"A value is required for field $field."`
120
+ *
121
+ *
122
+ */
123
+ readonly message: string;
124
+ /**
125
+ * Name of the field missing the value.
126
+ *
127
+ *
128
+ */
129
+ readonly field: string;
130
+ }
131
+ /**
132
+ * Returned when the resource addressed by the request URL does not exist.
133
+ *
134
+ */
135
+ export interface ResourceNotFoundError extends IErrorObject {
136
+ readonly code: 'ResourceNotFound';
137
+ /**
138
+ * `"The Resource with ID $resourceId was not found."`
139
+ *
140
+ *
141
+ */
142
+ readonly message: string;
143
+ }
144
+ //# sourceMappingURL=error.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"error.d.ts","sourceRoot":"../../../../../src/generated/models","sources":["error.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;GAEG;AACH,MAAM,MAAM,WAAW,GACnB,oBAAoB,GACpB,YAAY,GACZ,iBAAiB,GACjB,qBAAqB,GACrB,8BAA8B,GAC9B,mBAAmB,GACnB,kBAAkB,GAClB,qBAAqB,CAAA;AACzB,MAAM,WAAW,YAAY;IAC3B;;;;OAIG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AACD;;;GAGG;AACH,MAAM,WAAW,oBAAqB,SAAQ,YAAY;IACxD,QAAQ,CAAC,IAAI,EAAE,iBAAiB,CAAA;IAChC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AACD;;;;;GAKG;AACH,MAAM,WAAW,YAAa,SAAQ,YAAY;IAChD,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAA;IACxB;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AACD;;;GAGG;AACH,MAAM,WAAW,iBAAkB,SAAQ,YAAY;IACrD,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;IAC7B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AACD;;;;;;GAMG;AACH,MAAM,WAAW,qBAAsB,SAAQ,YAAY;IACzD,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAA;IACjC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB;;;OAGG;IACH,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAA;CACtC;AACD;;;GAGG;AACH,MAAM,WAAW,8BAA+B,SAAQ,YAAY;IAClE,QAAQ,CAAC,IAAI,EAAE,2BAA2B,CAAA;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AACD;;;GAGG;AACH,MAAM,WAAW,mBAAoB,SAAQ,YAAY;IACvD,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAA;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB;AACD;;;GAGG;AACH,MAAM,WAAW,kBAAmB,SAAQ,YAAY;IACtD,QAAQ,CAAC,IAAI,EAAE,eAAe,CAAA;IAC9B;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB;;;;OAIG;IACH,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;CACvB;AACD;;;GAGG;AACH,MAAM,WAAW,qBAAsB,SAAQ,YAAY;IACzD,QAAQ,CAAC,IAAI,EAAE,kBAAkB,CAAA;IACjC;;;;OAIG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
3
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
4
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
5
+ */
6
+ import { IResourceIdentifier } from "./common.js";
7
+ /**
8
+ * Resource identifier to an [Order](/../api/projects/orders). Either `id` or `key` is required. If both are set, an [InvalidJsonInput](/errors#invalidjsoninput) error is returned.
9
+ *
10
+ */
11
+ export interface OrderResourceIdentifier extends IResourceIdentifier {
12
+ readonly typeId: 'order';
13
+ /**
14
+ * Unique identifier of the referenced [Order](/../api/projects/orders). Required if `key` is absent.
15
+ *
16
+ *
17
+ */
18
+ readonly id?: string;
19
+ /**
20
+ * User-defined unique identifier of the referenced [Order](/../api/projects/orders). Required if `id` is absent.
21
+ *
22
+ *
23
+ */
24
+ readonly key?: string;
25
+ }
26
+ //# sourceMappingURL=order.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"order.d.ts","sourceRoot":"../../../../../src/generated/models","sources":["order.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,mBAAmB,EAAE,oBAAgB;AAE9C;;;GAGG;AACH,MAAM,WAAW,uBAAwB,SAAQ,mBAAmB;IAClE,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CACtB"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Code generated by [commercetools RMF-Codegen](https://github.com/commercetools/rmf-codegen). DO NOT EDIT.
3
+ * Please don't change this file manually but run `rmf-codegen generate raml_file_path -o output_path -t typescript_client` to update it.
4
+ * For more information about the commercetools platform APIs, visit https://docs.commercetools.com/.
5
+ */
6
+ import { IReference, IResourceIdentifier } from "./common.js";
7
+ /**
8
+ * Reference to a [Payment Integration](/connectors-and-applications#payment-integrations).
9
+ *
10
+ */
11
+ export interface PaymentIntegrationReference extends IReference {
12
+ readonly typeId: 'payment-integration';
13
+ /**
14
+ * Unique identifier of the referenced Payment Integration.
15
+ *
16
+ *
17
+ */
18
+ readonly id: string;
19
+ }
20
+ /**
21
+ * Resource identifier to a [Payment Integration](/connectors-and-applications#payment-integrations). Either `id` or `key` is required. If both are set, an [InvalidJsonInput](/errors#invalidjsoninput) error is returned.
22
+ *
23
+ */
24
+ export interface PaymentIntegrationResourceIdentifier extends IResourceIdentifier {
25
+ readonly typeId: 'payment-integration';
26
+ /**
27
+ * Unique identifier of the referenced Payment Integration. Required if `key` is absent.
28
+ *
29
+ *
30
+ */
31
+ readonly id?: string;
32
+ /**
33
+ * User-defined unique identifier of the referenced Payment Integration. Required if `id` is absent.
34
+ *
35
+ *
36
+ */
37
+ readonly key?: string;
38
+ }
39
+ //# sourceMappingURL=payment-integration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payment-integration.d.ts","sourceRoot":"../../../../../src/generated/models","sources":["payment-integration.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,oBAAgB;AAE1D;;;GAGG;AACH,MAAM,WAAW,2BAA4B,SAAQ,UAAU;IAC7D,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAA;IACtC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;CACpB;AACD;;;GAGG;AACH,MAAM,WAAW,oCACf,SAAQ,mBAAmB;IAC3B,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAA;IACtC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAA;IACpB;;;;OAIG;IACH,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CACtB"}