ce-storefront 0.0.4 → 0.0.5

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 (88) hide show
  1. package/README.md +6 -0
  2. package/docs/sdks/customersapi/README.md +234 -0
  3. package/funcs/customersAPIGetCustomersId.d.ts +15 -0
  4. package/funcs/customersAPIGetCustomersId.d.ts.map +1 -0
  5. package/funcs/customersAPIGetCustomersId.js +93 -0
  6. package/funcs/customersAPIGetCustomersId.js.map +1 -0
  7. package/funcs/customersAPIPostCustomers.d.ts +17 -0
  8. package/funcs/customersAPIPostCustomers.d.ts.map +1 -0
  9. package/funcs/customersAPIPostCustomers.js +96 -0
  10. package/funcs/customersAPIPostCustomers.js.map +1 -0
  11. package/funcs/customersAPIPutCustomersId.d.ts +16 -0
  12. package/funcs/customersAPIPutCustomersId.d.ts.map +1 -0
  13. package/funcs/customersAPIPutCustomersId.js +98 -0
  14. package/funcs/customersAPIPutCustomersId.js.map +1 -0
  15. package/lib/config.d.ts +2 -2
  16. package/lib/config.js +2 -2
  17. package/models/components/business.d.ts +31 -0
  18. package/models/components/business.d.ts.map +1 -0
  19. package/models/components/business.js +71 -0
  20. package/models/components/business.js.map +1 -0
  21. package/models/components/cart.d.ts +1 -1
  22. package/models/components/cart.d.ts.map +1 -1
  23. package/models/components/cart.js +5 -5
  24. package/models/components/cart.js.map +1 -1
  25. package/models/components/createcustomer.d.ts +29 -0
  26. package/models/components/createcustomer.d.ts.map +1 -0
  27. package/models/components/createcustomer.js +54 -0
  28. package/models/components/createcustomer.js.map +1 -0
  29. package/models/components/{customeraddress.d.ts → customeraddressinput.d.ts} +29 -29
  30. package/models/components/customeraddressinput.d.ts.map +1 -0
  31. package/models/components/{customeraddress.js → customeraddressinput.js} +30 -30
  32. package/models/components/customeraddressinput.js.map +1 -0
  33. package/models/components/customerdetail.d.ts +51 -0
  34. package/models/components/customerdetail.d.ts.map +1 -0
  35. package/models/components/customerdetail.js +88 -0
  36. package/models/components/customerdetail.js.map +1 -0
  37. package/models/components/index.d.ts +5 -1
  38. package/models/components/index.d.ts.map +1 -1
  39. package/models/components/index.js +5 -1
  40. package/models/components/index.js.map +1 -1
  41. package/models/components/orderdetail.d.ts +1 -1
  42. package/models/components/orderdetail.d.ts.map +1 -1
  43. package/models/components/orderdetail.js +5 -5
  44. package/models/components/orderdetail.js.map +1 -1
  45. package/models/components/updatecustomer.d.ts +26 -0
  46. package/models/components/updatecustomer.d.ts.map +1 -0
  47. package/models/components/updatecustomer.js +51 -0
  48. package/models/components/updatecustomer.js.map +1 -0
  49. package/models/operations/getcustomersid.d.ts +82 -0
  50. package/models/operations/getcustomersid.d.ts.map +1 -0
  51. package/models/operations/getcustomersid.js +106 -0
  52. package/models/operations/getcustomersid.js.map +1 -0
  53. package/models/operations/index.d.ts +3 -0
  54. package/models/operations/index.d.ts.map +1 -1
  55. package/models/operations/index.js +3 -0
  56. package/models/operations/index.js.map +1 -1
  57. package/models/operations/postcustomers.d.ts +56 -0
  58. package/models/operations/postcustomers.d.ts.map +1 -0
  59. package/models/operations/postcustomers.js +87 -0
  60. package/models/operations/postcustomers.js.map +1 -0
  61. package/models/operations/putcustomersid.d.ts +84 -0
  62. package/models/operations/putcustomersid.d.ts.map +1 -0
  63. package/models/operations/putcustomersid.js +120 -0
  64. package/models/operations/putcustomersid.js.map +1 -0
  65. package/package.json +1 -1
  66. package/sdk/customersapi.d.ts +22 -0
  67. package/sdk/customersapi.d.ts.map +1 -1
  68. package/sdk/customersapi.js +30 -0
  69. package/sdk/customersapi.js.map +1 -1
  70. package/src/funcs/customersAPIGetCustomersId.ts +124 -0
  71. package/src/funcs/customersAPIPostCustomers.ts +133 -0
  72. package/src/funcs/customersAPIPutCustomersId.ts +136 -0
  73. package/src/lib/config.ts +2 -2
  74. package/src/models/components/business.ts +64 -0
  75. package/src/models/components/cart.ts +1 -1
  76. package/src/models/components/createcustomer.ts +58 -0
  77. package/src/models/components/customerdetail.ts +109 -0
  78. package/src/models/components/index.ts +5 -1
  79. package/src/models/components/orderdetail.ts +1 -1
  80. package/src/models/components/updatecustomer.ts +48 -0
  81. package/src/models/operations/getcustomersid.ts +153 -0
  82. package/src/models/operations/index.ts +3 -0
  83. package/src/models/operations/postcustomers.ts +110 -0
  84. package/src/models/operations/putcustomersid.ts +169 -0
  85. package/src/sdk/customersapi.ts +43 -0
  86. package/models/components/customeraddress.d.ts.map +0 -1
  87. package/models/components/customeraddress.js.map +0 -1
  88. package/src/models/components/{customeraddress.ts → customeraddressinput.ts} +46 -46
package/README.md CHANGED
@@ -95,6 +95,9 @@ run();
95
95
  ### [customersAPI](docs/sdks/customersapi/README.md)
96
96
 
97
97
  * [getRecommendedProducts](docs/sdks/customersapi/README.md#getrecommendedproducts) - List all recommended products
98
+ * [postCustomers](docs/sdks/customersapi/README.md#postcustomers) - Create customer
99
+ * [getCustomersId](docs/sdks/customersapi/README.md#getcustomersid) - Retrieve customer detail
100
+ * [putCustomersId](docs/sdks/customersapi/README.md#putcustomersid) - Update customer detail
98
101
 
99
102
  ### [carts](docs/sdks/carts/README.md)
100
103
 
@@ -293,7 +296,10 @@ To read more about standalone functions, check [FUNCTIONS.md](./FUNCTIONS.md).
293
296
  - [checkoutRemoveLoyaltyPoints](docs/sdks/checkout/README.md#removeloyaltypoints)
294
297
  - [checkoutUpdateAddress](docs/sdks/checkout/README.md#updateaddress)
295
298
  - [checkoutUseCreditBalance](docs/sdks/checkout/README.md#usecreditbalance)
299
+ - [customersAPIGetCustomersId](docs/sdks/customersapi/README.md#getcustomersid)
296
300
  - [customersAPIGetRecommendedProducts](docs/sdks/customersapi/README.md#getrecommendedproducts)
301
+ - [customersAPIPostCustomers](docs/sdks/customersapi/README.md#postcustomers)
302
+ - [customersAPIPutCustomersId](docs/sdks/customersapi/README.md#putcustomersid)
297
303
  - [customersAddressesAdd](docs/sdks/addresses/README.md#add)
298
304
  - [customersAddressesDelete](docs/sdks/addresses/README.md#delete)
299
305
  - [customersAddressesGet](docs/sdks/addresses/README.md#get)
@@ -8,6 +8,9 @@ Customers API
8
8
  ### Available Operations
9
9
 
10
10
  * [getRecommendedProducts](#getrecommendedproducts) - List all recommended products
11
+ * [postCustomers](#postcustomers) - Create customer
12
+ * [getCustomersId](#getcustomersid) - Retrieve customer detail
13
+ * [putCustomersId](#putcustomersid) - Update customer detail
11
14
 
12
15
  ## getRecommendedProducts
13
16
 
@@ -86,3 +89,234 @@ run();
86
89
  | errors.Unauthorized | 401 | application/json |
87
90
  | errors.NotFound | 404 | application/json |
88
91
  | errors.SDKError | 4xx-5xx | */* |
92
+
93
+
94
+ ## postCustomers
95
+
96
+ Create customer
97
+
98
+ ### Example Usage
99
+
100
+ ```typescript
101
+ import { CeStorefront } from "ce-storefront";
102
+
103
+ const ceStorefront = new CeStorefront({
104
+ authorization: "<YOUR_BEARER_TOKEN_HERE>",
105
+ });
106
+
107
+ async function run() {
108
+ const result = await ceStorefront.customersAPI.postCustomers();
109
+
110
+ // Handle the result
111
+ console.log(result)
112
+ }
113
+
114
+ run();
115
+ ```
116
+
117
+ ### Standalone function
118
+
119
+ The standalone function version of this method:
120
+
121
+ ```typescript
122
+ import { CeStorefrontCore } from "ce-storefront/core.js";
123
+ import { customersAPIPostCustomers } from "ce-storefront/funcs/customersAPIPostCustomers.js";
124
+
125
+ // Use `CeStorefrontCore` for best tree-shaking performance.
126
+ // You can create one instance of it to use across an application.
127
+ const ceStorefront = new CeStorefrontCore({
128
+ authorization: "<YOUR_BEARER_TOKEN_HERE>",
129
+ });
130
+
131
+ async function run() {
132
+ const res = await customersAPIPostCustomers(ceStorefront);
133
+
134
+ if (!res.ok) {
135
+ throw res.error;
136
+ }
137
+
138
+ const { value: result } = res;
139
+
140
+ // Handle the result
141
+ console.log(result)
142
+ }
143
+
144
+ run();
145
+ ```
146
+
147
+ ### Parameters
148
+
149
+ | Parameter | Type | Required | Description |
150
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
151
+ | `request` | [components.CreateCustomer](../../models/components/createcustomer.md) | :heavy_check_mark: | The request object to use for the request. |
152
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
153
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
154
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
155
+
156
+ ### Response
157
+
158
+ **Promise\<[operations.PostCustomersResponseBody](../../models/operations/postcustomersresponsebody.md)\>**
159
+
160
+ ### Errors
161
+
162
+ | Error Object | Status Code | Content Type |
163
+ | ------------------- | ------------------- | ------------------- |
164
+ | errors.BadRequest | 400 | application/json |
165
+ | errors.Unauthorized | 401 | application/json |
166
+ | errors.SDKError | 4xx-5xx | */* |
167
+
168
+
169
+ ## getCustomersId
170
+
171
+ Retrieve customer detail.
172
+
173
+ ### Example Usage
174
+
175
+ ```typescript
176
+ import { CeStorefront } from "ce-storefront";
177
+
178
+ const ceStorefront = new CeStorefront({
179
+ authorization: "<YOUR_BEARER_TOKEN_HERE>",
180
+ });
181
+
182
+ async function run() {
183
+ const result = await ceStorefront.customersAPI.getCustomersId({
184
+ id: "<id>",
185
+ });
186
+
187
+ // Handle the result
188
+ console.log(result)
189
+ }
190
+
191
+ run();
192
+ ```
193
+
194
+ ### Standalone function
195
+
196
+ The standalone function version of this method:
197
+
198
+ ```typescript
199
+ import { CeStorefrontCore } from "ce-storefront/core.js";
200
+ import { customersAPIGetCustomersId } from "ce-storefront/funcs/customersAPIGetCustomersId.js";
201
+
202
+ // Use `CeStorefrontCore` for best tree-shaking performance.
203
+ // You can create one instance of it to use across an application.
204
+ const ceStorefront = new CeStorefrontCore({
205
+ authorization: "<YOUR_BEARER_TOKEN_HERE>",
206
+ });
207
+
208
+ async function run() {
209
+ const res = await customersAPIGetCustomersId(ceStorefront, {
210
+ id: "<id>",
211
+ });
212
+
213
+ if (!res.ok) {
214
+ throw res.error;
215
+ }
216
+
217
+ const { value: result } = res;
218
+
219
+ // Handle the result
220
+ console.log(result)
221
+ }
222
+
223
+ run();
224
+ ```
225
+
226
+ ### Parameters
227
+
228
+ | Parameter | Type | Required | Description |
229
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
230
+ | `request` | [operations.GetCustomersIdRequest](../../models/operations/getcustomersidrequest.md) | :heavy_check_mark: | The request object to use for the request. |
231
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
232
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
233
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
234
+
235
+ ### Response
236
+
237
+ **Promise\<[operations.GetCustomersIdResponseBody](../../models/operations/getcustomersidresponsebody.md)\>**
238
+
239
+ ### Errors
240
+
241
+ | Error Object | Status Code | Content Type |
242
+ | --------------- | --------------- | --------------- |
243
+ | errors.SDKError | 4xx-5xx | */* |
244
+
245
+
246
+ ## putCustomersId
247
+
248
+ Update customer detail
249
+
250
+ ### Example Usage
251
+
252
+ ```typescript
253
+ import { CeStorefront } from "ce-storefront";
254
+
255
+ const ceStorefront = new CeStorefront({
256
+ authorization: "<YOUR_BEARER_TOKEN_HERE>",
257
+ });
258
+
259
+ async function run() {
260
+ const result = await ceStorefront.customersAPI.putCustomersId({
261
+ id: "<id>",
262
+ });
263
+
264
+ // Handle the result
265
+ console.log(result)
266
+ }
267
+
268
+ run();
269
+ ```
270
+
271
+ ### Standalone function
272
+
273
+ The standalone function version of this method:
274
+
275
+ ```typescript
276
+ import { CeStorefrontCore } from "ce-storefront/core.js";
277
+ import { customersAPIPutCustomersId } from "ce-storefront/funcs/customersAPIPutCustomersId.js";
278
+
279
+ // Use `CeStorefrontCore` for best tree-shaking performance.
280
+ // You can create one instance of it to use across an application.
281
+ const ceStorefront = new CeStorefrontCore({
282
+ authorization: "<YOUR_BEARER_TOKEN_HERE>",
283
+ });
284
+
285
+ async function run() {
286
+ const res = await customersAPIPutCustomersId(ceStorefront, {
287
+ id: "<id>",
288
+ });
289
+
290
+ if (!res.ok) {
291
+ throw res.error;
292
+ }
293
+
294
+ const { value: result } = res;
295
+
296
+ // Handle the result
297
+ console.log(result)
298
+ }
299
+
300
+ run();
301
+ ```
302
+
303
+ ### Parameters
304
+
305
+ | Parameter | Type | Required | Description |
306
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
307
+ | `request` | [operations.PutCustomersIdRequest](../../models/operations/putcustomersidrequest.md) | :heavy_check_mark: | The request object to use for the request. |
308
+ | `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
309
+ | `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
310
+ | `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
311
+
312
+ ### Response
313
+
314
+ **Promise\<[operations.PutCustomersIdResponseBody](../../models/operations/putcustomersidresponsebody.md)\>**
315
+
316
+ ### Errors
317
+
318
+ | Error Object | Status Code | Content Type |
319
+ | ------------------- | ------------------- | ------------------- |
320
+ | errors.BadRequest | 400 | application/json |
321
+ | errors.Unauthorized | 401 | application/json |
322
+ | errors.SDKError | 4xx-5xx | */* |
@@ -0,0 +1,15 @@
1
+ import { CeStorefrontCore } from "../core.js";
2
+ import { RequestOptions } from "../lib/sdks.js";
3
+ import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
4
+ import { SDKError } from "../models/errors/sdkerror.js";
5
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
6
+ import * as operations from "../models/operations/index.js";
7
+ import { Result } from "../types/fp.js";
8
+ /**
9
+ * Retrieve customer detail
10
+ *
11
+ * @remarks
12
+ * Retrieve customer detail.
13
+ */
14
+ export declare function customersAPIGetCustomersId(client$: CeStorefrontCore, request: operations.GetCustomersIdRequest, options?: RequestOptions): Promise<Result<operations.GetCustomersIdResponseBody, SDKError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
15
+ //# sourceMappingURL=customersAPIGetCustomersId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customersAPIGetCustomersId.d.ts","sourceRoot":"","sources":["../src/funcs/customersAPIGetCustomersId.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAI9C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EACH,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACxB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAC5C,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,UAAU,CAAC,qBAAqB,EACzC,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CACN,MAAM,CACF,UAAU,CAAC,0BAA0B,EACnC,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CACpB,CACJ,CA+EA"}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.customersAPIGetCustomersId = customersAPIGetCustomersId;
30
+ const encodings_js_1 = require("../lib/encodings.js");
31
+ const m$ = __importStar(require("../lib/matchers.js"));
32
+ const schemas$ = __importStar(require("../lib/schemas.js"));
33
+ const security_js_1 = require("../lib/security.js");
34
+ const url_js_1 = require("../lib/url.js");
35
+ const operations = __importStar(require("../models/operations/index.js"));
36
+ /**
37
+ * Retrieve customer detail
38
+ *
39
+ * @remarks
40
+ * Retrieve customer detail.
41
+ */
42
+ async function customersAPIGetCustomersId(client$, request, options) {
43
+ const input$ = request;
44
+ const parsed$ = schemas$.safeParse(input$, (value$) => operations.GetCustomersIdRequest$outboundSchema.parse(value$), "Input validation failed");
45
+ if (!parsed$.ok) {
46
+ return parsed$;
47
+ }
48
+ const payload$ = parsed$.value;
49
+ const body$ = null;
50
+ const pathParams$ = {
51
+ id: (0, encodings_js_1.encodeSimple)("id", payload$.id, { explode: false, charEncoding: "percent" }),
52
+ };
53
+ const path$ = (0, url_js_1.pathToFunc)("/customers/{id}")(pathParams$);
54
+ const headers$ = new Headers({
55
+ Accept: "application/json",
56
+ });
57
+ const authorization$ = await (0, security_js_1.extractSecurity)(client$.options$.authorization);
58
+ const security$ = authorization$ == null ? {} : { authorization: authorization$ };
59
+ const context = {
60
+ operationID: "get-customers-id",
61
+ oAuth2Scopes: [],
62
+ securitySource: client$.options$.authorization,
63
+ };
64
+ const securitySettings$ = (0, security_js_1.resolveGlobalSecurity)(security$);
65
+ const requestRes = client$.createRequest$(context, {
66
+ security: securitySettings$,
67
+ method: "GET",
68
+ path: path$,
69
+ headers: headers$,
70
+ body: body$,
71
+ timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || client$.options$.timeoutMs || -1,
72
+ }, options);
73
+ if (!requestRes.ok) {
74
+ return requestRes;
75
+ }
76
+ const request$ = requestRes.value;
77
+ const doResult = await client$.do$(request$, {
78
+ context,
79
+ errorCodes: ["4XX", "5XX"],
80
+ retryConfig: (options === null || options === void 0 ? void 0 : options.retries) || client$.options$.retryConfig,
81
+ retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
82
+ });
83
+ if (!doResult.ok) {
84
+ return doResult;
85
+ }
86
+ const response = doResult.value;
87
+ const [result$] = await m$.match(m$.json(200, operations.GetCustomersIdResponseBody$inboundSchema), m$.fail(["4XX", "5XX"]))(response);
88
+ if (!result$.ok) {
89
+ return result$;
90
+ }
91
+ return result$;
92
+ }
93
+ //# sourceMappingURL=customersAPIGetCustomersId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customersAPIGetCustomersId.js","sourceRoot":"","sources":["../src/funcs/customersAPIGetCustomersId.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AA2BH,gEA8FC;AAtHD,sDAAoE;AACpE,uDAAyC;AACzC,4DAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;AAU3C,0EAA4D;AAG5D;;;;;GAKG;AACI,KAAK,UAAU,0BAA0B,CAC5C,OAAyB,EACzB,OAAyC,EACzC,OAAwB;IAaxB,MAAM,MAAM,GAAG,OAAO,CAAC;IAEvB,MAAM,OAAO,GAAG,QAAQ,CAAC,SAAS,CAC9B,MAAM,EACN,CAAC,MAAM,EAAE,EAAE,CAAC,UAAU,CAAC,oCAAoC,CAAC,KAAK,CAAC,MAAM,CAAC,EACzE,yBAAyB,CAC5B,CAAC;IACF,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;QACd,OAAO,OAAO,CAAC;IACnB,CAAC;IACD,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC;IAC/B,MAAM,KAAK,GAAG,IAAI,CAAC;IAEnB,MAAM,WAAW,GAAG;QAChB,EAAE,EAAE,IAAA,2BAAa,EAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;KACpF,CAAC;IAEF,MAAM,KAAK,GAAG,IAAA,mBAAU,EAAC,iBAAiB,CAAC,CAAC,WAAW,CAAC,CAAC;IAEzD,MAAM,QAA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AP,OAAO,CAAE,UAAU,KAAI,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC;KACzE,CAAC,CAAC;IACH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACf,OAAO,QAAQ,CAAC;IACpB,CAAC;IACD,MAAM,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC;IAEhC,MAAM,CAAC,OAAO,CAAC,GAAG,MAAM,EAAE,CAAC,KAAK,CAU5B,EAAE,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,wCAAwC,CAAC,EACjE,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAC1B,CAAC,QAAQ,CAAC,CAAC;IACZ,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;QACd,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { CeStorefrontCore } from "../core.js";
2
+ import { RequestOptions } from "../lib/sdks.js";
3
+ import * as components from "../models/components/index.js";
4
+ import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
5
+ import * as errors from "../models/errors/index.js";
6
+ import { SDKError } from "../models/errors/sdkerror.js";
7
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
8
+ import * as operations from "../models/operations/index.js";
9
+ import { Result } from "../types/fp.js";
10
+ /**
11
+ * Create customer
12
+ *
13
+ * @remarks
14
+ * Create customer
15
+ */
16
+ export declare function customersAPIPostCustomers(client$: CeStorefrontCore, request?: components.CreateCustomer | undefined, options?: RequestOptions): Promise<Result<operations.PostCustomersResponseBody, errors.BadRequest | errors.Unauthorized | SDKError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
17
+ //# sourceMappingURL=customersAPIPostCustomers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customersAPIPostCustomers.d.ts","sourceRoot":"","sources":["../src/funcs/customersAPIPostCustomers.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAI9C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EACH,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACxB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAC3C,OAAO,EAAE,gBAAgB,EACzB,OAAO,CAAC,EAAE,UAAU,CAAC,cAAc,GAAG,SAAS,EAC/C,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CACN,MAAM,CACF,UAAU,CAAC,yBAAyB,EAClC,MAAM,CAAC,UAAU,GACjB,MAAM,CAAC,YAAY,GACnB,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CACpB,CACJ,CAoFA"}
@@ -0,0 +1,96 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.customersAPIPostCustomers = customersAPIPostCustomers;
30
+ const encodings_js_1 = require("../lib/encodings.js");
31
+ const m$ = __importStar(require("../lib/matchers.js"));
32
+ const schemas$ = __importStar(require("../lib/schemas.js"));
33
+ const security_js_1 = require("../lib/security.js");
34
+ const url_js_1 = require("../lib/url.js");
35
+ const components = __importStar(require("../models/components/index.js"));
36
+ const errors = __importStar(require("../models/errors/index.js"));
37
+ const operations = __importStar(require("../models/operations/index.js"));
38
+ /**
39
+ * Create customer
40
+ *
41
+ * @remarks
42
+ * Create customer
43
+ */
44
+ async function customersAPIPostCustomers(client$, request, options) {
45
+ const input$ = request;
46
+ const parsed$ = schemas$.safeParse(input$, (value$) => components.CreateCustomer$outboundSchema.optional().parse(value$), "Input validation failed");
47
+ if (!parsed$.ok) {
48
+ return parsed$;
49
+ }
50
+ const payload$ = parsed$.value;
51
+ const body$ = payload$ === undefined ? null : (0, encodings_js_1.encodeJSON)("body", payload$, { explode: true });
52
+ const path$ = (0, url_js_1.pathToFunc)("/customers")();
53
+ const headers$ = new Headers({
54
+ "Content-Type": "application/json",
55
+ Accept: "application/json",
56
+ });
57
+ const authorization$ = await (0, security_js_1.extractSecurity)(client$.options$.authorization);
58
+ const security$ = authorization$ == null ? {} : { authorization: authorization$ };
59
+ const context = {
60
+ operationID: "post-customers",
61
+ oAuth2Scopes: [],
62
+ securitySource: client$.options$.authorization,
63
+ };
64
+ const securitySettings$ = (0, security_js_1.resolveGlobalSecurity)(security$);
65
+ const requestRes = client$.createRequest$(context, {
66
+ security: securitySettings$,
67
+ method: "POST",
68
+ path: path$,
69
+ headers: headers$,
70
+ body: body$,
71
+ timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || client$.options$.timeoutMs || -1,
72
+ }, options);
73
+ if (!requestRes.ok) {
74
+ return requestRes;
75
+ }
76
+ const request$ = requestRes.value;
77
+ const doResult = await client$.do$(request$, {
78
+ context,
79
+ errorCodes: ["400", "401", "4XX", "5XX"],
80
+ retryConfig: (options === null || options === void 0 ? void 0 : options.retries) || client$.options$.retryConfig,
81
+ retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
82
+ });
83
+ if (!doResult.ok) {
84
+ return doResult;
85
+ }
86
+ const response = doResult.value;
87
+ const responseFields$ = {
88
+ HttpMeta: { Response: response, Request: request$ },
89
+ };
90
+ const [result$] = await m$.match(m$.json(200, operations.PostCustomersResponseBody$inboundSchema), m$.jsonErr(400, errors.BadRequest$inboundSchema), m$.jsonErr(401, errors.Unauthorized$inboundSchema), m$.fail(["4XX", "5XX"]))(response, { extraFields: responseFields$ });
91
+ if (!result$.ok) {
92
+ return result$;
93
+ }
94
+ return result$;
95
+ }
96
+ //# sourceMappingURL=customersAPIPostCustomers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customersAPIPostCustomers.js","sourceRoot":"","sources":["../src/funcs/customersAPIPostCustomers.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;;;;;;;;;;;;;;;;;;;;;;AA6BH,8DAqGC;AA/HD,sDAAgE;AAChE,uDAAyC;AACzC,4DAA8C;AAE9C,oDAA4E;AAC5E,0CAA2C;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CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,CAAC,uCAAuC,CAAC,EAChE,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,wBAAwB,CAAC,EAChD,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,CAAC,0BAA0B,CAAC,EAClD,EAAE,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC,CAC1B,CAAC,QAAQ,EAAE,EAAE,WAAW,EAAE,eAAe,EAAE,CAAC,CAAC;IAC9C,IAAI,CAAC,OAAO,CAAC,EAAE,EAAE,CAAC;QACd,OAAO,OAAO,CAAC;IACnB,CAAC;IAED,OAAO,OAAO,CAAC;AACnB,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { CeStorefrontCore } from "../core.js";
2
+ import { RequestOptions } from "../lib/sdks.js";
3
+ import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
4
+ import * as errors from "../models/errors/index.js";
5
+ import { SDKError } from "../models/errors/sdkerror.js";
6
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
7
+ import * as operations from "../models/operations/index.js";
8
+ import { Result } from "../types/fp.js";
9
+ /**
10
+ * Update customer detail
11
+ *
12
+ * @remarks
13
+ * Update customer detail
14
+ */
15
+ export declare function customersAPIPutCustomersId(client$: CeStorefrontCore, request: operations.PutCustomersIdRequest, options?: RequestOptions): Promise<Result<operations.PutCustomersIdResponseBody, errors.BadRequest | errors.Unauthorized | SDKError | SDKValidationError | UnexpectedClientError | InvalidRequestError | RequestAbortedError | RequestTimeoutError | ConnectionError>>;
16
+ //# sourceMappingURL=customersAPIPutCustomersId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"customersAPIPutCustomersId.d.ts","sourceRoot":"","sources":["../src/funcs/customersAPIPutCustomersId.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAI9C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAGhD,OAAO,EACH,eAAe,EACf,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,qBAAqB,EACxB,MAAM,sCAAsC,CAAC;AAC9C,OAAO,KAAK,MAAM,MAAM,2BAA2B,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AAC5E,OAAO,KAAK,UAAU,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAExC;;;;;GAKG;AACH,wBAAsB,0BAA0B,CAC5C,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,UAAU,CAAC,qBAAqB,EACzC,OAAO,CAAC,EAAE,cAAc,GACzB,OAAO,CACN,MAAM,CACF,UAAU,CAAC,0BAA0B,EACnC,MAAM,CAAC,UAAU,GACjB,MAAM,CAAC,YAAY,GACnB,QAAQ,GACR,kBAAkB,GAClB,qBAAqB,GACrB,mBAAmB,GACnB,mBAAmB,GACnB,mBAAmB,GACnB,eAAe,CACpB,CACJ,CAwFA"}
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ /*
3
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ var desc = Object.getOwnPropertyDescriptor(m, k);
8
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
9
+ desc = { enumerable: true, get: function() { return m[k]; } };
10
+ }
11
+ Object.defineProperty(o, k2, desc);
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ exports.customersAPIPutCustomersId = customersAPIPutCustomersId;
30
+ const encodings_js_1 = require("../lib/encodings.js");
31
+ const m$ = __importStar(require("../lib/matchers.js"));
32
+ const schemas$ = __importStar(require("../lib/schemas.js"));
33
+ const security_js_1 = require("../lib/security.js");
34
+ const url_js_1 = require("../lib/url.js");
35
+ const errors = __importStar(require("../models/errors/index.js"));
36
+ const operations = __importStar(require("../models/operations/index.js"));
37
+ /**
38
+ * Update customer detail
39
+ *
40
+ * @remarks
41
+ * Update customer detail
42
+ */
43
+ async function customersAPIPutCustomersId(client$, request, options) {
44
+ const input$ = request;
45
+ const parsed$ = schemas$.safeParse(input$, (value$) => operations.PutCustomersIdRequest$outboundSchema.parse(value$), "Input validation failed");
46
+ if (!parsed$.ok) {
47
+ return parsed$;
48
+ }
49
+ const payload$ = parsed$.value;
50
+ const body$ = (0, encodings_js_1.encodeJSON)("body", payload$.UpdateCustomer, { explode: true });
51
+ const pathParams$ = {
52
+ id: (0, encodings_js_1.encodeSimple)("id", payload$.id, { explode: false, charEncoding: "percent" }),
53
+ };
54
+ const path$ = (0, url_js_1.pathToFunc)("/customers/{id}")(pathParams$);
55
+ const headers$ = new Headers({
56
+ "Content-Type": "application/json",
57
+ Accept: "application/json",
58
+ });
59
+ const authorization$ = await (0, security_js_1.extractSecurity)(client$.options$.authorization);
60
+ const security$ = authorization$ == null ? {} : { authorization: authorization$ };
61
+ const context = {
62
+ operationID: "put-customers-id",
63
+ oAuth2Scopes: [],
64
+ securitySource: client$.options$.authorization,
65
+ };
66
+ const securitySettings$ = (0, security_js_1.resolveGlobalSecurity)(security$);
67
+ const requestRes = client$.createRequest$(context, {
68
+ security: securitySettings$,
69
+ method: "PUT",
70
+ path: path$,
71
+ headers: headers$,
72
+ body: body$,
73
+ timeoutMs: (options === null || options === void 0 ? void 0 : options.timeoutMs) || client$.options$.timeoutMs || -1,
74
+ }, options);
75
+ if (!requestRes.ok) {
76
+ return requestRes;
77
+ }
78
+ const request$ = requestRes.value;
79
+ const doResult = await client$.do$(request$, {
80
+ context,
81
+ errorCodes: ["400", "401", "4XX", "5XX"],
82
+ retryConfig: (options === null || options === void 0 ? void 0 : options.retries) || client$.options$.retryConfig,
83
+ retryCodes: (options === null || options === void 0 ? void 0 : options.retryCodes) || ["429", "500", "502", "503", "504"],
84
+ });
85
+ if (!doResult.ok) {
86
+ return doResult;
87
+ }
88
+ const response = doResult.value;
89
+ const responseFields$ = {
90
+ HttpMeta: { Response: response, Request: request$ },
91
+ };
92
+ const [result$] = await m$.match(m$.json(200, operations.PutCustomersIdResponseBody$inboundSchema), m$.jsonErr(400, errors.BadRequest$inboundSchema), m$.jsonErr(401, errors.Unauthorized$inboundSchema), m$.fail(["4XX", "5XX"]))(response, { extraFields: responseFields$ });
93
+ if (!result$.ok) {
94
+ return result$;
95
+ }
96
+ return result$;
97
+ }
98
+ //# sourceMappingURL=customersAPIPutCustomersId.js.map