@lukadriel/wave-sdk 0.0.0-stage → 0.1.2

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 (185) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE +2 -0
  4. package/README.md +523 -2
  5. package/dist/client/wave-client-options.d.ts +29 -0
  6. package/dist/client/wave-client-options.d.ts.map +1 -0
  7. package/dist/client/wave-client-options.js +58 -0
  8. package/dist/client/wave-client-options.js.map +1 -0
  9. package/dist/client/wave-client.d.ts +47 -0
  10. package/dist/client/wave-client.d.ts.map +1 -0
  11. package/dist/client/wave-client.js +66 -0
  12. package/dist/client/wave-client.js.map +1 -0
  13. package/dist/core/auth/authentication.d.ts +8 -0
  14. package/dist/core/auth/authentication.d.ts.map +1 -0
  15. package/dist/core/auth/authentication.js +10 -0
  16. package/dist/core/auth/authentication.js.map +1 -0
  17. package/dist/core/auth/request-signer.d.ts +26 -0
  18. package/dist/core/auth/request-signer.d.ts.map +1 -0
  19. package/dist/core/auth/request-signer.js +39 -0
  20. package/dist/core/auth/request-signer.js.map +1 -0
  21. package/dist/core/errors/error-parser.d.ts +25 -0
  22. package/dist/core/errors/error-parser.d.ts.map +1 -0
  23. package/dist/core/errors/error-parser.js +198 -0
  24. package/dist/core/errors/error-parser.js.map +1 -0
  25. package/dist/core/errors/redact.d.ts +11 -0
  26. package/dist/core/errors/redact.d.ts.map +1 -0
  27. package/dist/core/errors/redact.js +20 -0
  28. package/dist/core/errors/redact.js.map +1 -0
  29. package/dist/core/errors/wave-api-error.d.ts +116 -0
  30. package/dist/core/errors/wave-api-error.d.ts.map +1 -0
  31. package/dist/core/errors/wave-api-error.js +114 -0
  32. package/dist/core/errors/wave-api-error.js.map +1 -0
  33. package/dist/core/errors/wave-error.d.ts +27 -0
  34. package/dist/core/errors/wave-error.d.ts.map +1 -0
  35. package/dist/core/errors/wave-error.js +22 -0
  36. package/dist/core/errors/wave-error.js.map +1 -0
  37. package/dist/core/errors/wave-network-error.d.ts +24 -0
  38. package/dist/core/errors/wave-network-error.d.ts.map +1 -0
  39. package/dist/core/errors/wave-network-error.js +24 -0
  40. package/dist/core/errors/wave-network-error.js.map +1 -0
  41. package/dist/core/errors/wave-webhook-verification-error.d.ts +18 -0
  42. package/dist/core/errors/wave-webhook-verification-error.d.ts.map +1 -0
  43. package/dist/core/errors/wave-webhook-verification-error.js +17 -0
  44. package/dist/core/errors/wave-webhook-verification-error.js.map +1 -0
  45. package/dist/core/http/fetch-transport.d.ts +23 -0
  46. package/dist/core/http/fetch-transport.d.ts.map +1 -0
  47. package/dist/core/http/fetch-transport.js +34 -0
  48. package/dist/core/http/fetch-transport.js.map +1 -0
  49. package/dist/core/http/http-client.d.ts +57 -0
  50. package/dist/core/http/http-client.d.ts.map +1 -0
  51. package/dist/core/http/http-client.js +254 -0
  52. package/dist/core/http/http-client.js.map +1 -0
  53. package/dist/core/http/http-request.d.ts +35 -0
  54. package/dist/core/http/http-request.d.ts.map +1 -0
  55. package/dist/core/http/http-request.js +2 -0
  56. package/dist/core/http/http-request.js.map +1 -0
  57. package/dist/core/http/http-response.d.ts +26 -0
  58. package/dist/core/http/http-response.d.ts.map +1 -0
  59. package/dist/core/http/http-response.js +23 -0
  60. package/dist/core/http/http-response.js.map +1 -0
  61. package/dist/core/http/query.d.ts +14 -0
  62. package/dist/core/http/query.d.ts.map +1 -0
  63. package/dist/core/http/query.js +23 -0
  64. package/dist/core/http/query.js.map +1 -0
  65. package/dist/core/http/transport.d.ts +44 -0
  66. package/dist/core/http/transport.d.ts.map +1 -0
  67. package/dist/core/http/transport.js +2 -0
  68. package/dist/core/http/transport.js.map +1 -0
  69. package/dist/core/idempotency/idempotency.d.ts +16 -0
  70. package/dist/core/idempotency/idempotency.d.ts.map +1 -0
  71. package/dist/core/idempotency/idempotency.js +27 -0
  72. package/dist/core/idempotency/idempotency.js.map +1 -0
  73. package/dist/core/retry/backoff.d.ts +18 -0
  74. package/dist/core/retry/backoff.d.ts.map +1 -0
  75. package/dist/core/retry/backoff.js +46 -0
  76. package/dist/core/retry/backoff.js.map +1 -0
  77. package/dist/core/retry/retry-policy.d.ts +43 -0
  78. package/dist/core/retry/retry-policy.d.ts.map +1 -0
  79. package/dist/core/retry/retry-policy.js +90 -0
  80. package/dist/core/retry/retry-policy.js.map +1 -0
  81. package/dist/core/types/common.d.ts +59 -0
  82. package/dist/core/types/common.d.ts.map +1 -0
  83. package/dist/core/types/common.js +2 -0
  84. package/dist/core/types/common.js.map +1 -0
  85. package/dist/core/types/configuration.d.ts +82 -0
  86. package/dist/core/types/configuration.d.ts.map +1 -0
  87. package/dist/core/types/configuration.js +2 -0
  88. package/dist/core/types/configuration.js.map +1 -0
  89. package/dist/core/types/json.d.ts +15 -0
  90. package/dist/core/types/json.d.ts.map +1 -0
  91. package/dist/core/types/json.js +2 -0
  92. package/dist/core/types/json.js.map +1 -0
  93. package/dist/index.d.ts +39 -0
  94. package/dist/index.d.ts.map +1 -0
  95. package/dist/index.js +24 -0
  96. package/dist/index.js.map +1 -0
  97. package/dist/resources/aggregated-merchants/aggregated-merchant-types.d.ts +82 -0
  98. package/dist/resources/aggregated-merchants/aggregated-merchant-types.d.ts.map +1 -0
  99. package/dist/resources/aggregated-merchants/aggregated-merchant-types.js +2 -0
  100. package/dist/resources/aggregated-merchants/aggregated-merchant-types.js.map +1 -0
  101. package/dist/resources/aggregated-merchants/aggregated-merchants.d.ts +67 -0
  102. package/dist/resources/aggregated-merchants/aggregated-merchants.d.ts.map +1 -0
  103. package/dist/resources/aggregated-merchants/aggregated-merchants.js +111 -0
  104. package/dist/resources/aggregated-merchants/aggregated-merchants.js.map +1 -0
  105. package/dist/resources/balance/balance-types.d.ts +18 -0
  106. package/dist/resources/balance/balance-types.d.ts.map +1 -0
  107. package/dist/resources/balance/balance-types.js +2 -0
  108. package/dist/resources/balance/balance-types.js.map +1 -0
  109. package/dist/resources/balance/balance.d.ts +20 -0
  110. package/dist/resources/balance/balance.d.ts.map +1 -0
  111. package/dist/resources/balance/balance.js +28 -0
  112. package/dist/resources/balance/balance.js.map +1 -0
  113. package/dist/resources/checkout/checkout-types.d.ts +96 -0
  114. package/dist/resources/checkout/checkout-types.d.ts.map +1 -0
  115. package/dist/resources/checkout/checkout-types.js +2 -0
  116. package/dist/resources/checkout/checkout-types.js.map +1 -0
  117. package/dist/resources/checkout/checkout.d.ts +66 -0
  118. package/dist/resources/checkout/checkout.d.ts.map +1 -0
  119. package/dist/resources/checkout/checkout.js +95 -0
  120. package/dist/resources/checkout/checkout.js.map +1 -0
  121. package/dist/resources/payout-batches/payout-batches.d.ts +31 -0
  122. package/dist/resources/payout-batches/payout-batches.d.ts.map +1 -0
  123. package/dist/resources/payout-batches/payout-batches.js +36 -0
  124. package/dist/resources/payout-batches/payout-batches.js.map +1 -0
  125. package/dist/resources/payouts/payout-types.d.ts +158 -0
  126. package/dist/resources/payouts/payout-types.d.ts.map +1 -0
  127. package/dist/resources/payouts/payout-types.js +2 -0
  128. package/dist/resources/payouts/payout-types.js.map +1 -0
  129. package/dist/resources/payouts/payouts.d.ts +63 -0
  130. package/dist/resources/payouts/payouts.d.ts.map +1 -0
  131. package/dist/resources/payouts/payouts.js +80 -0
  132. package/dist/resources/payouts/payouts.js.map +1 -0
  133. package/dist/resources/reconciliation/reconciliation-types.d.ts +86 -0
  134. package/dist/resources/reconciliation/reconciliation-types.d.ts.map +1 -0
  135. package/dist/resources/reconciliation/reconciliation-types.js +2 -0
  136. package/dist/resources/reconciliation/reconciliation-types.js.map +1 -0
  137. package/dist/resources/reconciliation/reconciliation.d.ts +41 -0
  138. package/dist/resources/reconciliation/reconciliation.d.ts.map +1 -0
  139. package/dist/resources/reconciliation/reconciliation.js +81 -0
  140. package/dist/resources/reconciliation/reconciliation.js.map +1 -0
  141. package/dist/resources/webhooks/webhook-types.d.ts +159 -0
  142. package/dist/resources/webhooks/webhook-types.d.ts.map +1 -0
  143. package/dist/resources/webhooks/webhook-types.js +36 -0
  144. package/dist/resources/webhooks/webhook-types.js.map +1 -0
  145. package/dist/resources/webhooks/webhook-verifier.d.ts +104 -0
  146. package/dist/resources/webhooks/webhook-verifier.d.ts.map +1 -0
  147. package/dist/resources/webhooks/webhook-verifier.js +188 -0
  148. package/dist/resources/webhooks/webhook-verifier.js.map +1 -0
  149. package/package.json +70 -4
  150. package/src/client/wave-client-options.ts +91 -0
  151. package/src/client/wave-client.ts +70 -0
  152. package/src/core/auth/authentication.ts +9 -0
  153. package/src/core/auth/request-signer.ts +42 -0
  154. package/src/core/errors/error-parser.ts +258 -0
  155. package/src/core/errors/redact.ts +20 -0
  156. package/src/core/errors/wave-api-error.ts +148 -0
  157. package/src/core/errors/wave-error.ts +32 -0
  158. package/src/core/errors/wave-network-error.ts +24 -0
  159. package/src/core/errors/wave-webhook-verification-error.ts +28 -0
  160. package/src/core/http/fetch-transport.ts +48 -0
  161. package/src/core/http/http-client.ts +352 -0
  162. package/src/core/http/http-request.ts +37 -0
  163. package/src/core/http/http-response.ts +37 -0
  164. package/src/core/http/query.ts +31 -0
  165. package/src/core/http/transport.ts +45 -0
  166. package/src/core/idempotency/idempotency.ts +31 -0
  167. package/src/core/retry/backoff.ts +61 -0
  168. package/src/core/retry/retry-policy.ts +106 -0
  169. package/src/core/types/common.ts +65 -0
  170. package/src/core/types/configuration.ts +85 -0
  171. package/src/core/types/json.ts +16 -0
  172. package/src/index.ts +146 -0
  173. package/src/resources/aggregated-merchants/aggregated-merchant-types.ts +87 -0
  174. package/src/resources/aggregated-merchants/aggregated-merchants.ts +171 -0
  175. package/src/resources/balance/balance-types.ts +19 -0
  176. package/src/resources/balance/balance.ts +39 -0
  177. package/src/resources/checkout/checkout-types.ts +102 -0
  178. package/src/resources/checkout/checkout.ts +144 -0
  179. package/src/resources/payout-batches/payout-batches.ts +58 -0
  180. package/src/resources/payouts/payout-types.ts +171 -0
  181. package/src/resources/payouts/payouts.ts +120 -0
  182. package/src/resources/reconciliation/reconciliation-types.ts +102 -0
  183. package/src/resources/reconciliation/reconciliation.ts +116 -0
  184. package/src/resources/webhooks/webhook-types.ts +222 -0
  185. package/src/resources/webhooks/webhook-verifier.ts +297 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregated-merchants.d.ts","sourceRoot":"","sources":["../../../src/resources/aggregated-merchants/aggregated-merchants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAEjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EACV,kBAAkB,EAClB,yBAAyB,EACzB,uBAAuB,EACvB,4BAA4B,EAC7B,MAAM,gCAAgC,CAAC;AAQxC;;GAEG;AACH,qBAAa,2BAA2B;;IAGtC,0CAA0C;gBAC9B,IAAI,EAAE,UAAU;IAI5B;;;;;;OAMG;IACH,IAAI,CACF,KAAK,GAAE,4BAAiC,EACxC,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,uBAAuB,CAAC;IAQnC;;;;;;OAMG;IACI,OAAO,CACZ,KAAK,GAAE,4BAAiC,EACxC,OAAO,GAAE,cAAmB,GAC3B,cAAc,CAAC,kBAAkB,EAAE,IAAI,EAAE,SAAS,CAAC;IAyBtD;;;;;;;;;OASG;IACH,MAAM,CACJ,OAAO,EAAE,yBAAyB,EAClC,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,kBAAkB,CAAC;IAQ9B;;;;;;OAMG;IACH,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAQvF;;;;;;;;;OASG;IACH,MAAM,CACJ,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,yBAAyB,EAClC,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,kBAAkB,CAAC;IAY9B;;;;;;;OAOG;IACH,MAAM,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;CAOxE"}
@@ -0,0 +1,111 @@
1
+ const LIST_MERCHANTS = { idempotent: true, requiresIdempotencyKey: false };
2
+ const CREATE_MERCHANT = { idempotent: false, requiresIdempotencyKey: false };
3
+ const GET_MERCHANT = { idempotent: true, requiresIdempotencyKey: false };
4
+ const UPDATE_MERCHANT = { idempotent: true, requiresIdempotencyKey: false };
5
+ const DELETE_MERCHANT = { idempotent: true, requiresIdempotencyKey: false };
6
+ /**
7
+ * Aggregated Merchants API operations.
8
+ */
9
+ export class AggregatedMerchantsResource {
10
+ #http;
11
+ /** @param http - Shared HTTP pipeline. */
12
+ constructor(http) {
13
+ this.#http = http;
14
+ }
15
+ /**
16
+ * Retrieves a page of aggregated merchants available to the account.
17
+ *
18
+ * @param query - Cursor pagination parameters.
19
+ * @param options - Per-request overrides.
20
+ * @returns One page of aggregated merchants.
21
+ */
22
+ list(query = {}, options = {}) {
23
+ return this.#http.request(LIST_MERCHANTS, { method: 'GET', path: '/v1/aggregated_merchants', query: toQuery(query) }, options);
24
+ }
25
+ /**
26
+ * Iterates every aggregated merchant, following pagination cursors.
27
+ *
28
+ * @param query - Cursor and page-size options; `after` is managed automatically.
29
+ * @param options - Per-request overrides applied to every page request.
30
+ * @yields Each aggregated merchant.
31
+ */
32
+ async *iterate(query = {}, options = {}) {
33
+ let after = query.after;
34
+ for (;;) {
35
+ const page = await this.list({ ...query, ...(after === undefined ? {} : { after }) }, options);
36
+ for (const merchant of page.items) {
37
+ yield merchant;
38
+ }
39
+ if (!page.page_info.has_next_page) {
40
+ return;
41
+ }
42
+ const nextCursor = page.page_info.end_cursor;
43
+ if (nextCursor === null || nextCursor === after) {
44
+ return;
45
+ }
46
+ after = nextCursor;
47
+ }
48
+ }
49
+ /**
50
+ * Creates an aggregated merchant.
51
+ *
52
+ * Merchant names must be unique. Wave does not document an idempotency mechanism for this
53
+ * endpoint, so the SDK never retries it automatically.
54
+ *
55
+ * @param request - Merchant details.
56
+ * @param options - Per-request overrides.
57
+ * @returns The created merchant.
58
+ */
59
+ create(request, options = {}) {
60
+ return this.#http.request(CREATE_MERCHANT, { method: 'POST', path: '/v1/aggregated_merchants', body: request }, options);
61
+ }
62
+ /**
63
+ * Retrieves a single aggregated merchant.
64
+ *
65
+ * @param merchantId - Merchant identifier starting with `am-`.
66
+ * @param options - Per-request overrides.
67
+ * @returns The aggregated merchant.
68
+ */
69
+ retrieve(merchantId, options = {}) {
70
+ return this.#http.request(GET_MERCHANT, { method: 'GET', path: `/v1/aggregated_merchants/${encodeURIComponent(merchantId)}` }, options);
71
+ }
72
+ /**
73
+ * Updates an aggregated merchant.
74
+ *
75
+ * Wave returns HTTP 403 with `record-locked` once the merchant is locked after review.
76
+ *
77
+ * @param merchantId - Merchant identifier starting with `am-`.
78
+ * @param request - Replacement merchant details.
79
+ * @param options - Per-request overrides.
80
+ * @returns The updated merchant.
81
+ */
82
+ update(merchantId, request, options = {}) {
83
+ return this.#http.request(UPDATE_MERCHANT, {
84
+ method: 'PUT',
85
+ path: `/v1/aggregated_merchants/${encodeURIComponent(merchantId)}`,
86
+ body: request,
87
+ }, options);
88
+ }
89
+ /**
90
+ * Deletes an aggregated merchant.
91
+ *
92
+ * Wave returns HTTP 204 with no body on success.
93
+ *
94
+ * @param merchantId - Merchant identifier starting with `am-`.
95
+ * @param options - Per-request overrides.
96
+ */
97
+ delete(merchantId, options = {}) {
98
+ return this.#http.requestVoid(DELETE_MERCHANT, { method: 'DELETE', path: `/v1/aggregated_merchants/${encodeURIComponent(merchantId)}` }, options);
99
+ }
100
+ }
101
+ function toQuery(query) {
102
+ const result = {};
103
+ if (query.first !== undefined) {
104
+ result['first'] = query.first;
105
+ }
106
+ if (query.after !== undefined) {
107
+ result['after'] = query.after;
108
+ }
109
+ return result;
110
+ }
111
+ //# sourceMappingURL=aggregated-merchants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aggregated-merchants.js","sourceRoot":"","sources":["../../../src/resources/a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AAC,KAAK,CAAC,WAAW,CAC3B,eAAe,EACf,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,4BAA4B,kBAAkB,CAAC,UAAU,CAAC,EAAE,EAAE,EACxF,OAAO,CACR,CAAC;IACJ,CAAC;CACF;AAED,SAAS,OAAO,CACd,KAAmC;IAEnC,MAAM,MAAM,GAAwC,EAAE,CAAC;IACvD,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;IAChC,CAAC;IACD,IAAI,KAAK,CAAC,KAAK,KAAK,SAAS,EAAE,CAAC;QAC9B,MAAM,CAAC,OAAO,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC;IAChC,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import type { HttpClient } from '../../core/http/http-client.js';\nimport type { QueryParameterValue } from '../../core/http/query.js';\nimport type { RequestOptions } from '../../core/types/configuration.js';\nimport type {\n AggregatedMerchant,\n AggregatedMerchantRequest,\n AggregatedMerchantsPage,\n ListAggregatedMerchantsQuery,\n} from './aggregated-merchant-types.js';\n\nconst LIST_MERCHANTS = { idempotent: true, requiresIdempotencyKey: false } as const;\nconst CREATE_MERCHANT = { idempotent: false, requiresIdempotencyKey: false } as const;\nconst GET_MERCHANT = { idempotent: true, requiresIdempotencyKey: false } as const;\nconst UPDATE_MERCHANT = { idempotent: true, requiresIdempotencyKey: false } as const;\nconst DELETE_MERCHANT = { idempotent: true, requiresIdempotencyKey: false } as const;\n\n/**\n * Aggregated Merchants API operations.\n */\nexport class AggregatedMerchantsResource {\n readonly #http: HttpClient;\n\n /** @param http - Shared HTTP pipeline. */\n constructor(http: HttpClient) {\n this.#http = http;\n }\n\n /**\n * Retrieves a page of aggregated merchants available to the account.\n *\n * @param query - Cursor pagination parameters.\n * @param options - Per-request overrides.\n * @returns One page of aggregated merchants.\n */\n list(\n query: ListAggregatedMerchantsQuery = {},\n options: RequestOptions = {},\n ): Promise<AggregatedMerchantsPage> {\n return this.#http.request<AggregatedMerchantsPage>(\n LIST_MERCHANTS,\n { method: 'GET', path: '/v1/aggregated_merchants', query: toQuery(query) },\n options,\n );\n }\n\n /**\n * Iterates every aggregated merchant, following pagination cursors.\n *\n * @param query - Cursor and page-size options; `after` is managed automatically.\n * @param options - Per-request overrides applied to every page request.\n * @yields Each aggregated merchant.\n */\n async *iterate(\n query: ListAggregatedMerchantsQuery = {},\n options: RequestOptions = {},\n ): AsyncGenerator<AggregatedMerchant, void, undefined> {\n let after = query.after;\n\n for (;;) {\n const page = await this.list(\n { ...query, ...(after === undefined ? {} : { after }) },\n options,\n );\n\n for (const merchant of page.items) {\n yield merchant;\n }\n\n if (!page.page_info.has_next_page) {\n return;\n }\n\n const nextCursor = page.page_info.end_cursor;\n if (nextCursor === null || nextCursor === after) {\n return;\n }\n after = nextCursor;\n }\n }\n\n /**\n * Creates an aggregated merchant.\n *\n * Merchant names must be unique. Wave does not document an idempotency mechanism for this\n * endpoint, so the SDK never retries it automatically.\n *\n * @param request - Merchant details.\n * @param options - Per-request overrides.\n * @returns The created merchant.\n */\n create(\n request: AggregatedMerchantRequest,\n options: RequestOptions = {},\n ): Promise<AggregatedMerchant> {\n return this.#http.request<AggregatedMerchant>(\n CREATE_MERCHANT,\n { method: 'POST', path: '/v1/aggregated_merchants', body: request },\n options,\n );\n }\n\n /**\n * Retrieves a single aggregated merchant.\n *\n * @param merchantId - Merchant identifier starting with `am-`.\n * @param options - Per-request overrides.\n * @returns The aggregated merchant.\n */\n retrieve(merchantId: string, options: RequestOptions = {}): Promise<AggregatedMerchant> {\n return this.#http.request<AggregatedMerchant>(\n GET_MERCHANT,\n { method: 'GET', path: `/v1/aggregated_merchants/${encodeURIComponent(merchantId)}` },\n options,\n );\n }\n\n /**\n * Updates an aggregated merchant.\n *\n * Wave returns HTTP 403 with `record-locked` once the merchant is locked after review.\n *\n * @param merchantId - Merchant identifier starting with `am-`.\n * @param request - Replacement merchant details.\n * @param options - Per-request overrides.\n * @returns The updated merchant.\n */\n update(\n merchantId: string,\n request: AggregatedMerchantRequest,\n options: RequestOptions = {},\n ): Promise<AggregatedMerchant> {\n return this.#http.request<AggregatedMerchant>(\n UPDATE_MERCHANT,\n {\n method: 'PUT',\n path: `/v1/aggregated_merchants/${encodeURIComponent(merchantId)}`,\n body: request,\n },\n options,\n );\n }\n\n /**\n * Deletes an aggregated merchant.\n *\n * Wave returns HTTP 204 with no body on success.\n *\n * @param merchantId - Merchant identifier starting with `am-`.\n * @param options - Per-request overrides.\n */\n delete(merchantId: string, options: RequestOptions = {}): Promise<void> {\n return this.#http.requestVoid(\n DELETE_MERCHANT,\n { method: 'DELETE', path: `/v1/aggregated_merchants/${encodeURIComponent(merchantId)}` },\n options,\n );\n }\n}\n\nfunction toQuery(\n query: ListAggregatedMerchantsQuery,\n): Readonly<Record<string, QueryParameterValue>> {\n const result: Record<string, QueryParameterValue> = {};\n if (query.first !== undefined) {\n result['first'] = query.first;\n }\n if (query.after !== undefined) {\n result['after'] = query.after;\n }\n return result;\n}\n"]}
@@ -0,0 +1,18 @@
1
+ import type { Amount, CurrencyCode } from '../../core/types/common.js';
2
+ /**
3
+ * The Balance object.
4
+ */
5
+ export interface Balance {
6
+ /** Balance amount. */
7
+ readonly amount: Amount;
8
+ /** Three-letter ISO 4217 currency code. */
9
+ readonly currency: CurrencyCode;
10
+ }
11
+ /**
12
+ * Query parameters for `GET /v1/balance`.
13
+ */
14
+ export interface RetrieveBalanceQuery {
15
+ /** Include readable subaccount balances in the total. */
16
+ readonly include_subaccounts?: boolean;
17
+ }
18
+ //# sourceMappingURL=balance-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balance-types.d.ts","sourceRoot":"","sources":["../../../src/resources/balance/balance-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAEvE;;GAEG;AACH,MAAM,WAAW,OAAO;IACtB,sBAAsB;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,2CAA2C;IAC3C,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,yDAAyD;IACzD,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACxC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=balance-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balance-types.js","sourceRoot":"","sources":["../../../src/resources/balance/balance-types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Amount, CurrencyCode } from '../../core/types/common.js';\n\n/**\n * The Balance object.\n */\nexport interface Balance {\n /** Balance amount. */\n readonly amount: Amount;\n /** Three-letter ISO 4217 currency code. */\n readonly currency: CurrencyCode;\n}\n\n/**\n * Query parameters for `GET /v1/balance`.\n */\nexport interface RetrieveBalanceQuery {\n /** Include readable subaccount balances in the total. */\n readonly include_subaccounts?: boolean;\n}\n"]}
@@ -0,0 +1,20 @@
1
+ import type { HttpClient } from '../../core/http/http-client.js';
2
+ import type { RequestOptions } from '../../core/types/configuration.js';
3
+ import type { Balance, RetrieveBalanceQuery } from './balance-types.js';
4
+ /**
5
+ * Balance API operations.
6
+ */
7
+ export declare class BalanceResource {
8
+ #private;
9
+ /** @param http - Shared HTTP pipeline. */
10
+ constructor(http: HttpClient);
11
+ /**
12
+ * Retrieves the balance of the wallet associated with the API key.
13
+ *
14
+ * @param query - Optional subaccount inclusion.
15
+ * @param options - Per-request overrides.
16
+ * @returns The wallet balance.
17
+ */
18
+ retrieve(query?: RetrieveBalanceQuery, options?: RequestOptions): Promise<Balance>;
19
+ }
20
+ //# sourceMappingURL=balance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balance.d.ts","sourceRoot":"","sources":["../../../src/resources/balance/balance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EAAE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAIxE;;GAEG;AACH,qBAAa,eAAe;;IAG1B,0CAA0C;gBAC9B,IAAI,EAAE,UAAU;IAI5B;;;;;;OAMG;IACH,QAAQ,CAAC,KAAK,GAAE,oBAAyB,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,OAAO,CAAC;CAc3F"}
@@ -0,0 +1,28 @@
1
+ const GET_BALANCE = { idempotent: true, requiresIdempotencyKey: false };
2
+ /**
3
+ * Balance API operations.
4
+ */
5
+ export class BalanceResource {
6
+ #http;
7
+ /** @param http - Shared HTTP pipeline. */
8
+ constructor(http) {
9
+ this.#http = http;
10
+ }
11
+ /**
12
+ * Retrieves the balance of the wallet associated with the API key.
13
+ *
14
+ * @param query - Optional subaccount inclusion.
15
+ * @param options - Per-request overrides.
16
+ * @returns The wallet balance.
17
+ */
18
+ retrieve(query = {}, options = {}) {
19
+ return this.#http.request(GET_BALANCE, {
20
+ method: 'GET',
21
+ path: '/v1/balance',
22
+ query: query.include_subaccounts === undefined
23
+ ? {}
24
+ : { include_subaccounts: query.include_subaccounts },
25
+ }, options);
26
+ }
27
+ }
28
+ //# sourceMappingURL=balance.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"balance.js","sourceRoot":"","sources":["../../../src/resources/balance/balance.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAW,CAAC;AAEjF;;GAEG;AACH,MAAM,OAAO,eAAe;IACjB,KAAK,CAAa;IAE3B,0CAA0C;IAC1C,YAAY,IAAgB;QAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,QAA8B,EAAE,EAAE,UAA0B,EAAE;QACrE,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CACvB,WAAW,EACX;YACE,MAAM,EAAE,KAAK;YACb,IAAI,EAAE,aAAa;YACnB,KAAK,EACH,KAAK,CAAC,mBAAmB,KAAK,SAAS;gBACrC,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC,EAAE,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAAE;SACzD,EACD,OAAO,CACR,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { HttpClient } from '../../core/http/http-client.js';\nimport type { RequestOptions } from '../../core/types/configuration.js';\nimport type { Balance, RetrieveBalanceQuery } from './balance-types.js';\n\nconst GET_BALANCE = { idempotent: true, requiresIdempotencyKey: false } as const;\n\n/**\n * Balance API operations.\n */\nexport class BalanceResource {\n readonly #http: HttpClient;\n\n /** @param http - Shared HTTP pipeline. */\n constructor(http: HttpClient) {\n this.#http = http;\n }\n\n /**\n * Retrieves the balance of the wallet associated with the API key.\n *\n * @param query - Optional subaccount inclusion.\n * @param options - Per-request overrides.\n * @returns The wallet balance.\n */\n retrieve(query: RetrieveBalanceQuery = {}, options: RequestOptions = {}): Promise<Balance> {\n return this.#http.request<Balance>(\n GET_BALANCE,\n {\n method: 'GET',\n path: '/v1/balance',\n query:\n query.include_subaccounts === undefined\n ? {}\n : { include_subaccounts: query.include_subaccounts },\n },\n options,\n );\n }\n}\n"]}
@@ -0,0 +1,96 @@
1
+ import type { Amount, CurrencyCode, Timestamp } from '../../core/types/common.js';
2
+ /**
3
+ * Documented checkout session states.
4
+ */
5
+ export type CheckoutStatus = 'open' | 'complete' | 'expired';
6
+ /**
7
+ * Documented payment states for a checkout session.
8
+ */
9
+ export type PaymentStatus = 'processing' | 'cancelled' | 'succeeded';
10
+ /**
11
+ * Reason for the last failed payment attempt on a checkout session.
12
+ */
13
+ export interface CheckoutPaymentError {
14
+ /** Short machine-readable error code. */
15
+ readonly code: string;
16
+ /** Human-readable description. */
17
+ readonly message: string;
18
+ }
19
+ /**
20
+ * The Checkout Session object.
21
+ */
22
+ export interface CheckoutSession {
23
+ /** Unique session identifier, up to 20 characters. */
24
+ readonly id: string;
25
+ /** Total amount collected from the customer, gross of fees. */
26
+ readonly amount: Amount;
27
+ /** Checkout state. */
28
+ readonly checkout_status: CheckoutStatus;
29
+ /** Caller correlation string, or `null` when not provided. */
30
+ readonly client_reference: string | null;
31
+ /** Three-letter ISO 4217 currency code. */
32
+ readonly currency: CurrencyCode;
33
+ /** URL the customer is sent to when a payment attempt fails. */
34
+ readonly error_url: string;
35
+ /** Reason for the last failed payment attempt, or `null` when none. */
36
+ readonly last_payment_error: CheckoutPaymentError | null;
37
+ /** Business name shown to the customer. */
38
+ readonly business_name: string;
39
+ /** State of the associated payment. */
40
+ readonly payment_status: PaymentStatus;
41
+ /** Wave transaction identifier visible in the customer's app. */
42
+ readonly transaction_id: string;
43
+ /** Aggregated merchant identity used for this checkout, when applicable. */
44
+ readonly aggregated_merchant_id?: string;
45
+ /** Payer restriction currently stored on the session, when set. */
46
+ readonly restrict_payer_mobile?: string;
47
+ /** URL the customer is sent to when the payment succeeds. */
48
+ readonly success_url: string;
49
+ /** URL that opens the Wave app to complete the checkout. */
50
+ readonly wave_launch_url: string;
51
+ /** When the session succeeded or expired; absent while the session is open. */
52
+ readonly when_completed?: Timestamp;
53
+ /** When the session was created. */
54
+ readonly when_created: Timestamp;
55
+ /** When the session expires (30 minutes after creation by default). */
56
+ readonly when_expires: Timestamp;
57
+ }
58
+ /**
59
+ * Request body for `POST /v1/checkout/sessions`.
60
+ */
61
+ export interface CreateCheckoutSessionRequest {
62
+ /** Total amount to collect, gross of fees. */
63
+ readonly amount: Amount;
64
+ /** Three-letter ISO 4217 currency code. */
65
+ readonly currency: CurrencyCode;
66
+ /** Fully qualified HTTPS URL for failed payments. */
67
+ readonly error_url: string;
68
+ /** Fully qualified HTTPS URL for successful payments. */
69
+ readonly success_url: string;
70
+ /** Caller correlation string, up to 255 characters. */
71
+ readonly client_reference?: string;
72
+ /**
73
+ * Restrict payment to the Wave account with this E.164 number.
74
+ *
75
+ * Wave previously named this field `enforce_payer_mobile`; the old name is documented as still
76
+ * accepted but deprecated.
77
+ */
78
+ readonly restrict_payer_mobile?: string;
79
+ /** Aggregated merchant identity; only available to permitted aggregators. */
80
+ readonly aggregated_merchant_id?: string;
81
+ }
82
+ /**
83
+ * Query parameters for `GET /v1/checkout/sessions/search`.
84
+ */
85
+ export interface SearchCheckoutSessionsQuery {
86
+ /** Caller correlation string to search for. */
87
+ readonly client_reference: string;
88
+ }
89
+ /**
90
+ * Response body of `GET /v1/checkout/sessions/search`.
91
+ */
92
+ export interface SearchCheckoutSessionsResponse {
93
+ /** Matching checkout sessions. */
94
+ readonly result: readonly CheckoutSession[];
95
+ }
96
+ //# sourceMappingURL=checkout-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkout-types.d.ts","sourceRoot":"","sources":["../../../src/resources/checkout/checkout-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAElF;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,YAAY,GAAG,WAAW,GAAG,WAAW,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,yCAAyC;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,kCAAkC;IAClC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,sDAAsD;IACtD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,+DAA+D;IAC/D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,sBAAsB;IACtB,QAAQ,CAAC,e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E,MAAM,CAAC;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IACxC,6EAA6E;IAC7E,QAAQ,CAAC,sBAAsB,CAAC,EAAE,MAAM,CAAC;CAC1C;AAED;;GAEG;AACH,MAAM,WAAW,2BAA2B;IAC1C,+CAA+C;IAC/C,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,8BAA8B;IAC7C,kCAAkC;IAClC,QAAQ,CAAC,MAAM,EAAE,SAAS,eAAe,EAAE,CAAC;CAC7C"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=checkout-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkout-types.js","sourceRoot":"","sources":["../../../src/resources/checkout/checkout-types.ts"],"names":[],"mappings":"","sourcesContent":["import type { Amount, CurrencyCode, Timestamp } from '../../core/types/common.js';\n\n/**\n * Documented checkout session states.\n */\nexport type CheckoutStatus = 'open' | 'complete' | 'expired';\n\n/**\n * Documented payment states for a checkout session.\n */\nexport type PaymentStatus = 'processing' | 'cancelled' | 'succeeded';\n\n/**\n * Reason for the last failed payment attempt on a checkout session.\n */\nexport interface CheckoutPaymentError {\n /** Short machine-readable error code. */\n readonly code: string;\n /** Human-readable description. */\n readonly message: string;\n}\n\n/**\n * The Checkout Session object.\n */\nexport interface CheckoutSession {\n /** Unique session identifier, up to 20 characters. */\n readonly id: string;\n /** Total amount collected from the customer, gross of fees. */\n readonly amount: Amount;\n /** Checkout state. */\n readonly checkout_status: CheckoutStatus;\n /** Caller correlation string, or `null` when not provided. */\n readonly client_reference: string | null;\n /** Three-letter ISO 4217 currency code. */\n readonly currency: CurrencyCode;\n /** URL the customer is sent to when a payment attempt fails. */\n readonly error_url: string;\n /** Reason for the last failed payment attempt, or `null` when none. */\n readonly last_payment_error: CheckoutPaymentError | null;\n /** Business name shown to the customer. */\n readonly business_name: string;\n /** State of the associated payment. */\n readonly payment_status: PaymentStatus;\n /** Wave transaction identifier visible in the customer's app. */\n readonly transaction_id: string;\n /** Aggregated merchant identity used for this checkout, when applicable. */\n readonly aggregated_merchant_id?: string;\n /** Payer restriction currently stored on the session, when set. */\n readonly restrict_payer_mobile?: string;\n /** URL the customer is sent to when the payment succeeds. */\n readonly success_url: string;\n /** URL that opens the Wave app to complete the checkout. */\n readonly wave_launch_url: string;\n /** When the session succeeded or expired; absent while the session is open. */\n readonly when_completed?: Timestamp;\n /** When the session was created. */\n readonly when_created: Timestamp;\n /** When the session expires (30 minutes after creation by default). */\n readonly when_expires: Timestamp;\n}\n\n/**\n * Request body for `POST /v1/checkout/sessions`.\n */\nexport interface CreateCheckoutSessionRequest {\n /** Total amount to collect, gross of fees. */\n readonly amount: Amount;\n /** Three-letter ISO 4217 currency code. */\n readonly currency: CurrencyCode;\n /** Fully qualified HTTPS URL for failed payments. */\n readonly error_url: string;\n /** Fully qualified HTTPS URL for successful payments. */\n readonly success_url: string;\n /** Caller correlation string, up to 255 characters. */\n readonly client_reference?: string;\n /**\n * Restrict payment to the Wave account with this E.164 number.\n *\n * Wave previously named this field `enforce_payer_mobile`; the old name is documented as still\n * accepted but deprecated.\n */\n readonly restrict_payer_mobile?: string;\n /** Aggregated merchant identity; only available to permitted aggregators. */\n readonly aggregated_merchant_id?: string;\n}\n\n/**\n * Query parameters for `GET /v1/checkout/sessions/search`.\n */\nexport interface SearchCheckoutSessionsQuery {\n /** Caller correlation string to search for. */\n readonly client_reference: string;\n}\n\n/**\n * Response body of `GET /v1/checkout/sessions/search`.\n */\nexport interface SearchCheckoutSessionsResponse {\n /** Matching checkout sessions. */\n readonly result: readonly CheckoutSession[];\n}\n"]}
@@ -0,0 +1,66 @@
1
+ import type { HttpClient } from '../../core/http/http-client.js';
2
+ import type { RequestOptions } from '../../core/types/configuration.js';
3
+ import type { CheckoutSession, CreateCheckoutSessionRequest, SearchCheckoutSessionsQuery, SearchCheckoutSessionsResponse } from './checkout-types.js';
4
+ /**
5
+ * Checkout API operations.
6
+ */
7
+ export declare class CheckoutResource {
8
+ #private;
9
+ /** @param http - Shared HTTP pipeline. */
10
+ constructor(http: HttpClient);
11
+ /**
12
+ * Creates a checkout session.
13
+ *
14
+ * Wave does not document an idempotency mechanism for this endpoint, so the SDK never retries it
15
+ * automatically. Redirect the customer to `wave_launch_url` in a browser (not a webview).
16
+ *
17
+ * @param request - Session details.
18
+ * @param options - Per-request overrides.
19
+ * @returns The created checkout session.
20
+ */
21
+ createSession(request: CreateCheckoutSessionRequest, options?: RequestOptions): Promise<CheckoutSession>;
22
+ /**
23
+ * Retrieves a checkout session by identifier.
24
+ *
25
+ * @param sessionId - Session identifier starting with `cos-`.
26
+ * @param options - Per-request overrides.
27
+ * @returns The checkout session.
28
+ */
29
+ retrieve(sessionId: string, options?: RequestOptions): Promise<CheckoutSession>;
30
+ /**
31
+ * Retrieves a checkout session by its Wave transaction identifier.
32
+ *
33
+ * @param transactionId - Transaction identifier starting with `T_`.
34
+ * @param options - Per-request overrides.
35
+ * @returns The checkout session.
36
+ */
37
+ retrieveByTransactionId(transactionId: string, options?: RequestOptions): Promise<CheckoutSession>;
38
+ /**
39
+ * Searches checkout sessions by client reference.
40
+ *
41
+ * @param query - Search criteria.
42
+ * @param options - Per-request overrides.
43
+ * @returns Matching checkout sessions.
44
+ */
45
+ search(query: SearchCheckoutSessionsQuery, options?: RequestOptions): Promise<SearchCheckoutSessionsResponse>;
46
+ /**
47
+ * Refunds the payment associated with a checkout session.
48
+ *
49
+ * Refunding twice returns HTTP 200 without creating another transaction.
50
+ *
51
+ * @param sessionId - Session identifier starting with `cos-`.
52
+ * @param options - Per-request overrides.
53
+ */
54
+ refund(sessionId: string, options?: RequestOptions): Promise<void>;
55
+ /**
56
+ * Expires an open checkout session.
57
+ *
58
+ * Wave documents HTTP 409 when the session is already complete or expired, so retries are not
59
+ * performed automatically.
60
+ *
61
+ * @param sessionId - Session identifier starting with `cos-`.
62
+ * @param options - Per-request overrides.
63
+ */
64
+ expire(sessionId: string, options?: RequestOptions): Promise<void>;
65
+ }
66
+ //# sourceMappingURL=checkout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkout.d.ts","sourceRoot":"","sources":["../../../src/resources/checkout/checkout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EACV,eAAe,EACf,4BAA4B,EAC5B,2BAA2B,EAC3B,8BAA8B,EAC/B,MAAM,qBAAqB,CAAC;AAO7B;;GAEG;AACH,qBAAa,gBAAgB;;IAG3B,0CAA0C;gBAC9B,IAAI,EAAE,UAAU;IAI5B;;;;;;;;;OASG;IACH,aAAa,CACX,OAAO,EAAE,4BAA4B,EACrC,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,eAAe,CAAC;IAQ3B;;;;;;OAMG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,eAAe,CAAC;IAQnF;;;;;;OAMG;IACH,uBAAuB,CACrB,aAAa,EAAE,MAAM,EACrB,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,eAAe,CAAC;IAY3B;;;;;;OAMG;IACH,MAAM,CACJ,KAAK,EAAE,2BAA2B,EAClC,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,8BAA8B,CAAC;IAY1C;;;;;;;OAOG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAWtE;;;;;;;;OAQG;IACH,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;CAUvE"}
@@ -0,0 +1,95 @@
1
+ const CREATE_SESSION = { idempotent: false, requiresIdempotencyKey: false };
2
+ const GET_SESSION = { idempotent: true, requiresIdempotencyKey: false };
3
+ const REFUND_SESSION = { idempotent: true, requiresIdempotencyKey: true };
4
+ const EXPIRE_SESSION = { idempotent: false, requiresIdempotencyKey: false };
5
+ /**
6
+ * Checkout API operations.
7
+ */
8
+ export class CheckoutResource {
9
+ #http;
10
+ /** @param http - Shared HTTP pipeline. */
11
+ constructor(http) {
12
+ this.#http = http;
13
+ }
14
+ /**
15
+ * Creates a checkout session.
16
+ *
17
+ * Wave does not document an idempotency mechanism for this endpoint, so the SDK never retries it
18
+ * automatically. Redirect the customer to `wave_launch_url` in a browser (not a webview).
19
+ *
20
+ * @param request - Session details.
21
+ * @param options - Per-request overrides.
22
+ * @returns The created checkout session.
23
+ */
24
+ createSession(request, options = {}) {
25
+ return this.#http.request(CREATE_SESSION, { method: 'POST', path: '/v1/checkout/sessions', body: request }, options);
26
+ }
27
+ /**
28
+ * Retrieves a checkout session by identifier.
29
+ *
30
+ * @param sessionId - Session identifier starting with `cos-`.
31
+ * @param options - Per-request overrides.
32
+ * @returns The checkout session.
33
+ */
34
+ retrieve(sessionId, options = {}) {
35
+ return this.#http.request(GET_SESSION, { method: 'GET', path: `/v1/checkout/sessions/${encodeURIComponent(sessionId)}` }, options);
36
+ }
37
+ /**
38
+ * Retrieves a checkout session by its Wave transaction identifier.
39
+ *
40
+ * @param transactionId - Transaction identifier starting with `T_`.
41
+ * @param options - Per-request overrides.
42
+ * @returns The checkout session.
43
+ */
44
+ retrieveByTransactionId(transactionId, options = {}) {
45
+ return this.#http.request(GET_SESSION, {
46
+ method: 'GET',
47
+ path: '/v1/checkout/sessions',
48
+ query: { transaction_id: transactionId },
49
+ }, options);
50
+ }
51
+ /**
52
+ * Searches checkout sessions by client reference.
53
+ *
54
+ * @param query - Search criteria.
55
+ * @param options - Per-request overrides.
56
+ * @returns Matching checkout sessions.
57
+ */
58
+ search(query, options = {}) {
59
+ return this.#http.request(GET_SESSION, {
60
+ method: 'GET',
61
+ path: '/v1/checkout/sessions/search',
62
+ query: { client_reference: query.client_reference },
63
+ }, options);
64
+ }
65
+ /**
66
+ * Refunds the payment associated with a checkout session.
67
+ *
68
+ * Refunding twice returns HTTP 200 without creating another transaction.
69
+ *
70
+ * @param sessionId - Session identifier starting with `cos-`.
71
+ * @param options - Per-request overrides.
72
+ */
73
+ refund(sessionId, options = {}) {
74
+ return this.#http.requestVoid(REFUND_SESSION, {
75
+ method: 'POST',
76
+ path: `/v1/checkout/sessions/${encodeURIComponent(sessionId)}/refund`,
77
+ }, options);
78
+ }
79
+ /**
80
+ * Expires an open checkout session.
81
+ *
82
+ * Wave documents HTTP 409 when the session is already complete or expired, so retries are not
83
+ * performed automatically.
84
+ *
85
+ * @param sessionId - Session identifier starting with `cos-`.
86
+ * @param options - Per-request overrides.
87
+ */
88
+ expire(sessionId, options = {}) {
89
+ return this.#http.requestVoid(EXPIRE_SESSION, {
90
+ method: 'POST',
91
+ path: `/v1/checkout/sessions/${encodeURIComponent(sessionId)}/expire`,
92
+ }, options);
93
+ }
94
+ }
95
+ //# sourceMappingURL=checkout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkout.js","sourceRoot":"","sources":["../../../src/resources/checkout/checkout.ts"],"names":[],"mappings":"AASA,MAAM,cAAc,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAW,CAAC;AACrF,MAAM,WAAW,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAW,CAAC;AACjF,MAAM,cAAc,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,sBAAsB,EAAE,IAAI,EAAW,CAAC;AACnF,MAAM,cAAc,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAW,CAAC;AAErF;;GAEG;AACH,MAAM,OAAO,gBAAgB;IAClB,KAAK,CAAa;IAE3B,0CAA0C;IAC1C,YAAY,IAAgB;QAC1B,IAAI,CAAC,KAAK,GAAG,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C,SAAS;SACtE,EACD,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,SAAiB,EAAE,UAA0B,EAAE;QACpD,OAAO,IAAI,CAAC,KAAK,CAAC,WAAW,CAC3B,cAAc,EACd;YACE,MAAM,EAAE,MAAM;YACd,IAAI,EAAE,yBAAyB,kBAAkB,CAAC,SAAS,CAAC,SAAS;SACtE,EACD,OAAO,CACR,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { HttpClient } from '../../core/http/http-client.js';\nimport type { RequestOptions } from '../../core/types/configuration.js';\nimport type {\n CheckoutSession,\n CreateCheckoutSessionRequest,\n SearchCheckoutSessionsQuery,\n SearchCheckoutSessionsResponse,\n} from './checkout-types.js';\n\nconst CREATE_SESSION = { idempotent: false, requiresIdempotencyKey: false } as const;\nconst GET_SESSION = { idempotent: true, requiresIdempotencyKey: false } as const;\nconst REFUND_SESSION = { idempotent: true, requiresIdempotencyKey: true } as const;\nconst EXPIRE_SESSION = { idempotent: false, requiresIdempotencyKey: false } as const;\n\n/**\n * Checkout API operations.\n */\nexport class CheckoutResource {\n readonly #http: HttpClient;\n\n /** @param http - Shared HTTP pipeline. */\n constructor(http: HttpClient) {\n this.#http = http;\n }\n\n /**\n * Creates a checkout session.\n *\n * Wave does not document an idempotency mechanism for this endpoint, so the SDK never retries it\n * automatically. Redirect the customer to `wave_launch_url` in a browser (not a webview).\n *\n * @param request - Session details.\n * @param options - Per-request overrides.\n * @returns The created checkout session.\n */\n createSession(\n request: CreateCheckoutSessionRequest,\n options: RequestOptions = {},\n ): Promise<CheckoutSession> {\n return this.#http.request<CheckoutSession>(\n CREATE_SESSION,\n { method: 'POST', path: '/v1/checkout/sessions', body: request },\n options,\n );\n }\n\n /**\n * Retrieves a checkout session by identifier.\n *\n * @param sessionId - Session identifier starting with `cos-`.\n * @param options - Per-request overrides.\n * @returns The checkout session.\n */\n retrieve(sessionId: string, options: RequestOptions = {}): Promise<CheckoutSession> {\n return this.#http.request<CheckoutSession>(\n GET_SESSION,\n { method: 'GET', path: `/v1/checkout/sessions/${encodeURIComponent(sessionId)}` },\n options,\n );\n }\n\n /**\n * Retrieves a checkout session by its Wave transaction identifier.\n *\n * @param transactionId - Transaction identifier starting with `T_`.\n * @param options - Per-request overrides.\n * @returns The checkout session.\n */\n retrieveByTransactionId(\n transactionId: string,\n options: RequestOptions = {},\n ): Promise<CheckoutSession> {\n return this.#http.request<CheckoutSession>(\n GET_SESSION,\n {\n method: 'GET',\n path: '/v1/checkout/sessions',\n query: { transaction_id: transactionId },\n },\n options,\n );\n }\n\n /**\n * Searches checkout sessions by client reference.\n *\n * @param query - Search criteria.\n * @param options - Per-request overrides.\n * @returns Matching checkout sessions.\n */\n search(\n query: SearchCheckoutSessionsQuery,\n options: RequestOptions = {},\n ): Promise<SearchCheckoutSessionsResponse> {\n return this.#http.request<SearchCheckoutSessionsResponse>(\n GET_SESSION,\n {\n method: 'GET',\n path: '/v1/checkout/sessions/search',\n query: { client_reference: query.client_reference },\n },\n options,\n );\n }\n\n /**\n * Refunds the payment associated with a checkout session.\n *\n * Refunding twice returns HTTP 200 without creating another transaction.\n *\n * @param sessionId - Session identifier starting with `cos-`.\n * @param options - Per-request overrides.\n */\n refund(sessionId: string, options: RequestOptions = {}): Promise<void> {\n return this.#http.requestVoid(\n REFUND_SESSION,\n {\n method: 'POST',\n path: `/v1/checkout/sessions/${encodeURIComponent(sessionId)}/refund`,\n },\n options,\n );\n }\n\n /**\n * Expires an open checkout session.\n *\n * Wave documents HTTP 409 when the session is already complete or expired, so retries are not\n * performed automatically.\n *\n * @param sessionId - Session identifier starting with `cos-`.\n * @param options - Per-request overrides.\n */\n expire(sessionId: string, options: RequestOptions = {}): Promise<void> {\n return this.#http.requestVoid(\n EXPIRE_SESSION,\n {\n method: 'POST',\n path: `/v1/checkout/sessions/${encodeURIComponent(sessionId)}/expire`,\n },\n options,\n );\n }\n}\n"]}
@@ -0,0 +1,31 @@
1
+ import type { HttpClient } from '../../core/http/http-client.js';
2
+ import type { RequestOptions } from '../../core/types/configuration.js';
3
+ import type { CreatePayoutBatchRequest, CreatePayoutBatchResponse, PayoutBatch } from '../payouts/payout-types.js';
4
+ /**
5
+ * Payout batch operations.
6
+ */
7
+ export declare class PayoutBatchesResource {
8
+ #private;
9
+ /** @param http - Shared HTTP pipeline. */
10
+ constructor(http: HttpClient);
11
+ /**
12
+ * Submits a payout batch for asynchronous processing.
13
+ *
14
+ * @param request - Payouts to send.
15
+ * @param options - Per-request overrides.
16
+ * @returns The batch identifier; poll {@link retrieve} for results.
17
+ */
18
+ create(request: CreatePayoutBatchRequest, options?: RequestOptions): Promise<CreatePayoutBatchResponse>;
19
+ /**
20
+ * Retrieves a payout batch and its individual payouts.
21
+ *
22
+ * Wave's endpoint list writes this path as `/v1/payouts-batch/:id`, while the endpoint section and
23
+ * curl example use `/v1/payout-batch/:id`; this SDK follows the latter.
24
+ *
25
+ * @param batchId - Batch identifier starting with `pb-`.
26
+ * @param options - Per-request overrides.
27
+ * @returns The payout batch.
28
+ */
29
+ retrieve(batchId: string, options?: RequestOptions): Promise<PayoutBatch>;
30
+ }
31
+ //# sourceMappingURL=payout-batches.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payout-batches.d.ts","sourceRoot":"","sources":["../../../src/resources/payout-batches/payout-batches.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACxE,OAAO,KAAK,EACV,wBAAwB,EACxB,yBAAyB,EACzB,WAAW,EACZ,MAAM,4BAA4B,CAAC;AAKpC;;GAEG;AACH,qBAAa,qBAAqB;;IAGhC,0CAA0C;gBAC9B,IAAI,EAAE,UAAU;IAI5B;;;;;;OAMG;IACH,MAAM,CACJ,OAAO,EAAE,wBAAwB,EACjC,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,yBAAyB,CAAC;IAQrC;;;;;;;;;OASG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,WAAW,CAAC;CAO9E"}
@@ -0,0 +1,36 @@
1
+ const CREATE_BATCH = { idempotent: true, requiresIdempotencyKey: true };
2
+ const GET_BATCH = { idempotent: true, requiresIdempotencyKey: false };
3
+ /**
4
+ * Payout batch operations.
5
+ */
6
+ export class PayoutBatchesResource {
7
+ #http;
8
+ /** @param http - Shared HTTP pipeline. */
9
+ constructor(http) {
10
+ this.#http = http;
11
+ }
12
+ /**
13
+ * Submits a payout batch for asynchronous processing.
14
+ *
15
+ * @param request - Payouts to send.
16
+ * @param options - Per-request overrides.
17
+ * @returns The batch identifier; poll {@link retrieve} for results.
18
+ */
19
+ create(request, options = {}) {
20
+ return this.#http.request(CREATE_BATCH, { method: 'POST', path: '/v1/payout-batch', body: request }, options);
21
+ }
22
+ /**
23
+ * Retrieves a payout batch and its individual payouts.
24
+ *
25
+ * Wave's endpoint list writes this path as `/v1/payouts-batch/:id`, while the endpoint section and
26
+ * curl example use `/v1/payout-batch/:id`; this SDK follows the latter.
27
+ *
28
+ * @param batchId - Batch identifier starting with `pb-`.
29
+ * @param options - Per-request overrides.
30
+ * @returns The payout batch.
31
+ */
32
+ retrieve(batchId, options = {}) {
33
+ return this.#http.request(GET_BATCH, { method: 'GET', path: `/v1/payout-batch/${encodeURIComponent(batchId)}` }, options);
34
+ }
35
+ }
36
+ //# sourceMappingURL=payout-batches.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payout-batches.js","sourceRoot":"","sources":["../../../src/resources/payout-batches/payout-batches.ts"],"names":[],"mappings":"AAQA,MAAM,YAAY,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,sBAAsB,EAAE,IAAI,EAAW,CAAC;AACjF,MAAM,SAAS,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,sBAAsB,EAAE,KAAK,EAAW,CAAC;AAE/E;;GAEG;AACH,MAAM,OAAO,qBAAqB;IACvB,KAAK,CAAa;IAE3B,0CAA0C;IAC1C,YAAY,IAAgB;QAC1B,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;IACpB,CAAC;IAED;;;;;;OAMG;IACH,MAAM,CACJ,OAAiC,EACjC,UAA0B,EAAE;QAE5B,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CACvB,YAAY,EACZ,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,OAAO,EAAE,EAC3D,OAAO,CACR,CAAC;IACJ,CAAC;IAED;;;;;;;;;OASG;IACH,QAAQ,CAAC,OAAe,EAAE,UAA0B,EAAE;QACpD,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,CACvB,SAAS,EACT,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,oBAAoB,kBAAkB,CAAC,OAAO,CAAC,EAAE,EAAE,EAC1E,OAAO,CACR,CAAC;IACJ,CAAC;CACF","sourcesContent":["import type { HttpClient } from '../../core/http/http-client.js';\nimport type { RequestOptions } from '../../core/types/configuration.js';\nimport type {\n CreatePayoutBatchRequest,\n CreatePayoutBatchResponse,\n PayoutBatch,\n} from '../payouts/payout-types.js';\n\nconst CREATE_BATCH = { idempotent: true, requiresIdempotencyKey: true } as const;\nconst GET_BATCH = { idempotent: true, requiresIdempotencyKey: false } as const;\n\n/**\n * Payout batch operations.\n */\nexport class PayoutBatchesResource {\n readonly #http: HttpClient;\n\n /** @param http - Shared HTTP pipeline. */\n constructor(http: HttpClient) {\n this.#http = http;\n }\n\n /**\n * Submits a payout batch for asynchronous processing.\n *\n * @param request - Payouts to send.\n * @param options - Per-request overrides.\n * @returns The batch identifier; poll {@link retrieve} for results.\n */\n create(\n request: CreatePayoutBatchRequest,\n options: RequestOptions = {},\n ): Promise<CreatePayoutBatchResponse> {\n return this.#http.request<CreatePayoutBatchResponse>(\n CREATE_BATCH,\n { method: 'POST', path: '/v1/payout-batch', body: request },\n options,\n );\n }\n\n /**\n * Retrieves a payout batch and its individual payouts.\n *\n * Wave's endpoint list writes this path as `/v1/payouts-batch/:id`, while the endpoint section and\n * curl example use `/v1/payout-batch/:id`; this SDK follows the latter.\n *\n * @param batchId - Batch identifier starting with `pb-`.\n * @param options - Per-request overrides.\n * @returns The payout batch.\n */\n retrieve(batchId: string, options: RequestOptions = {}): Promise<PayoutBatch> {\n return this.#http.request<PayoutBatch>(\n GET_BATCH,\n { method: 'GET', path: `/v1/payout-batch/${encodeURIComponent(batchId)}` },\n options,\n );\n }\n}\n"]}