ce-storefront 0.13.1 → 0.13.3
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.
- package/FUNCTIONS.md +5 -22
- package/README.md +44 -58
- package/docs/sdks/auth/README.md +50 -90
- package/docs/sdks/carts/README.md +60 -108
- package/docs/sdks/catalog/README.md +62 -104
- package/docs/sdks/common/README.md +5 -9
- package/docs/sdks/customers/README.md +35 -63
- package/docs/sdks/orders/README.md +35 -63
- package/docs/sdks/shipping/README.md +5 -9
- package/esm/funcs/catalogGetProductDetail.d.ts +1 -1
- package/esm/funcs/catalogGetProductDetail.js +5 -11
- package/esm/funcs/catalogGetProductDetail.js.map +1 -1
- package/esm/funcs/catalogGetVariantDetail.js +2 -5
- package/esm/funcs/catalogGetVariantDetail.js.map +1 -1
- package/esm/funcs/catalogListCategories.js +1 -0
- package/esm/funcs/catalogListCategories.js.map +1 -1
- package/esm/funcs/catalogListCrosssellProducts.js +2 -1
- package/esm/funcs/catalogListCrosssellProducts.js.map +1 -1
- package/esm/funcs/catalogListProductVariants.js +2 -5
- package/esm/funcs/catalogListProductVariants.js.map +1 -1
- package/esm/funcs/catalogListProducts.js +3 -2
- package/esm/funcs/catalogListProducts.js.map +1 -1
- package/esm/funcs/catalogListSimilarProducts.js +2 -1
- package/esm/funcs/catalogListSimilarProducts.js.map +1 -1
- package/esm/funcs/catalogListSkus.js +2 -2
- package/esm/funcs/catalogListSkus.js.map +1 -1
- package/esm/funcs/catalogListUpsellProducts.js +2 -1
- package/esm/funcs/catalogListUpsellProducts.js.map +1 -1
- package/esm/index.d.ts +2 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -1
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/components/productreview.d.ts +1 -10
- package/esm/models/components/productreview.d.ts.map +1 -1
- package/esm/models/components/productreview.js +2 -5
- package/esm/models/components/productreview.js.map +1 -1
- package/esm/models/errors/ceerror.d.ts +14 -2
- package/esm/models/errors/ceerror.d.ts.map +1 -1
- package/esm/models/errors/ceerror.js +1 -1
- package/esm/models/errors/ceerror.js.map +1 -1
- package/esm/models/operations/getproductdetail.d.ts +5 -5
- package/esm/models/operations/getproductdetail.d.ts.map +1 -1
- package/esm/models/operations/getproductdetail.js +4 -4
- package/esm/models/operations/getproductdetail.js.map +1 -1
- package/esm/models/operations/getvariantdetail.d.ts +5 -5
- package/esm/models/operations/getvariantdetail.d.ts.map +1 -1
- package/esm/models/operations/getvariantdetail.js +4 -4
- package/esm/models/operations/getvariantdetail.js.map +1 -1
- package/esm/models/operations/listcategories.d.ts +6 -1
- package/esm/models/operations/listcategories.d.ts.map +1 -1
- package/esm/models/operations/listcategories.js +4 -0
- package/esm/models/operations/listcategories.js.map +1 -1
- package/esm/models/operations/listcrosssellproducts.d.ts +5 -0
- package/esm/models/operations/listcrosssellproducts.d.ts.map +1 -1
- package/esm/models/operations/listcrosssellproducts.js +4 -0
- package/esm/models/operations/listcrosssellproducts.js.map +1 -1
- package/esm/models/operations/listproducts.d.ts +7 -2
- package/esm/models/operations/listproducts.d.ts.map +1 -1
- package/esm/models/operations/listproducts.js +4 -0
- package/esm/models/operations/listproducts.js.map +1 -1
- package/esm/models/operations/listproductvariants.d.ts +5 -5
- package/esm/models/operations/listproductvariants.d.ts.map +1 -1
- package/esm/models/operations/listproductvariants.js +4 -4
- package/esm/models/operations/listproductvariants.js.map +1 -1
- package/esm/models/operations/listsimilarproducts.d.ts +5 -0
- package/esm/models/operations/listsimilarproducts.d.ts.map +1 -1
- package/esm/models/operations/listsimilarproducts.js +4 -0
- package/esm/models/operations/listsimilarproducts.js.map +1 -1
- package/esm/models/operations/listskus.d.ts +5 -5
- package/esm/models/operations/listskus.d.ts.map +1 -1
- package/esm/models/operations/listskus.js +2 -2
- package/esm/models/operations/listskus.js.map +1 -1
- package/esm/models/operations/listupsellproducts.d.ts +5 -0
- package/esm/models/operations/listupsellproducts.d.ts.map +1 -1
- package/esm/models/operations/listupsellproducts.js +4 -0
- package/esm/models/operations/listupsellproducts.js.map +1 -1
- package/esm/sdk/catalog.d.ts +1 -1
- package/esm/sdk/catalog.js +1 -1
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/catalogGetProductDetail.ts +13 -12
- package/src/funcs/catalogGetVariantDetail.ts +6 -6
- package/src/funcs/catalogListCategories.ts +1 -0
- package/src/funcs/catalogListCrosssellProducts.ts +6 -1
- package/src/funcs/catalogListProductVariants.ts +6 -6
- package/src/funcs/catalogListProducts.ts +7 -2
- package/src/funcs/catalogListSimilarProducts.ts +6 -1
- package/src/funcs/catalogListSkus.ts +6 -2
- package/src/funcs/catalogListUpsellProducts.ts +6 -1
- package/src/index.ts +2 -0
- package/src/lib/config.ts +3 -3
- package/src/models/components/productreview.ts +3 -6
- package/src/models/errors/ceerror.ts +18 -3
- package/src/models/operations/getproductdetail.ts +9 -9
- package/src/models/operations/getvariantdetail.ts +9 -9
- package/src/models/operations/listcategories.ts +10 -1
- package/src/models/operations/listcrosssellproducts.ts +9 -0
- package/src/models/operations/listproducts.ts +11 -2
- package/src/models/operations/listproductvariants.ts +9 -9
- package/src/models/operations/listsimilarproducts.ts +9 -0
- package/src/models/operations/listskus.ts +7 -7
- package/src/models/operations/listupsellproducts.ts +9 -0
- package/src/sdk/catalog.ts +1 -1
package/FUNCTIONS.md
CHANGED
|
@@ -21,7 +21,6 @@ specific category of applications.
|
|
|
21
21
|
```typescript
|
|
22
22
|
import { CeStorefrontCore } from "ce-storefront/core.js";
|
|
23
23
|
import { catalogListProducts } from "ce-storefront/funcs/catalogListProducts.js";
|
|
24
|
-
import { SDKValidationError } from "ce-storefront/models/errors/sdkvalidationerror.js";
|
|
25
24
|
|
|
26
25
|
// Use `CeStorefrontCore` for best tree-shaking performance.
|
|
27
26
|
// You can create one instance of it to use across an application.
|
|
@@ -33,28 +32,12 @@ async function run() {
|
|
|
33
32
|
const res = await catalogListProducts(ceStorefront, {
|
|
34
33
|
sortBy: "{\"country\":\"asc\",\"city\":\"asc\",\"population\":\"desc\"}",
|
|
35
34
|
});
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
case res.error instanceof SDKValidationError:
|
|
42
|
-
// Pretty-print validation errors.
|
|
43
|
-
return console.log(res.error.pretty());
|
|
44
|
-
case res.error instanceof Error:
|
|
45
|
-
return console.log(res.error);
|
|
46
|
-
default:
|
|
47
|
-
// TypeScript's type checking will fail on the following line if the above
|
|
48
|
-
// cases were not exhaustive.
|
|
49
|
-
res.error satisfies never;
|
|
50
|
-
throw new Error("Assertion failed: expected error checks to be exhaustive: " + res.error);
|
|
35
|
+
if (res.ok) {
|
|
36
|
+
const { value: result } = res;
|
|
37
|
+
console.log(result);
|
|
38
|
+
} else {
|
|
39
|
+
console.log("catalogListProducts failed:", res.error);
|
|
51
40
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const { value: result } = res;
|
|
55
|
-
|
|
56
|
-
// Handle the result
|
|
57
|
-
console.log(result);
|
|
58
41
|
}
|
|
59
42
|
|
|
60
43
|
run();
|
package/README.md
CHANGED
|
@@ -89,7 +89,6 @@ async function run() {
|
|
|
89
89
|
sortBy: "{\"country\":\"asc\",\"city\":\"asc\",\"population\":\"desc\"}",
|
|
90
90
|
});
|
|
91
91
|
|
|
92
|
-
// Handle the result
|
|
93
92
|
console.log(result);
|
|
94
93
|
}
|
|
95
94
|
|
|
@@ -275,7 +274,6 @@ async function run() {
|
|
|
275
274
|
},
|
|
276
275
|
});
|
|
277
276
|
|
|
278
|
-
// Handle the result
|
|
279
277
|
console.log(result);
|
|
280
278
|
}
|
|
281
279
|
|
|
@@ -306,7 +304,6 @@ async function run() {
|
|
|
306
304
|
sortBy: "{\"country\":\"asc\",\"city\":\"asc\",\"population\":\"desc\"}",
|
|
307
305
|
});
|
|
308
306
|
|
|
309
|
-
// Handle the result
|
|
310
307
|
console.log(result);
|
|
311
308
|
}
|
|
312
309
|
|
|
@@ -318,61 +315,49 @@ run();
|
|
|
318
315
|
<!-- Start Error Handling [errors] -->
|
|
319
316
|
## Error Handling
|
|
320
317
|
|
|
321
|
-
|
|
318
|
+
This table shows properties which are common on error classes. For full details see [error classes](#error-classes).
|
|
322
319
|
|
|
323
|
-
|
|
|
324
|
-
| ------------------- |
|
|
325
|
-
|
|
|
326
|
-
|
|
|
327
|
-
|
|
|
328
|
-
|
|
329
|
-
|
|
320
|
+
| Property | Type | Description |
|
|
321
|
+
| ------------------- | ---------- | --------------------------------------------------------------------------------------- |
|
|
322
|
+
| `error.name` | `string` | Error class name eg `CeError` |
|
|
323
|
+
| `error.message` | `string` | Error message |
|
|
324
|
+
| `error.statusCode` | `number` | HTTP status code eg `404` |
|
|
325
|
+
| `error.contentType` | `string` | HTTP content type eg `application/json` |
|
|
326
|
+
| `error.body` | `string` | HTTP body. Can be empty string if no body is returned. |
|
|
327
|
+
| `error.rawResponse` | `Response` | Raw HTTP response. Access to headers and more. |
|
|
328
|
+
| `error.data$` | | Optional. Some errors may contain structured data. [See Error Classes](#error-classes). |
|
|
330
329
|
|
|
330
|
+
### Example
|
|
331
331
|
```typescript
|
|
332
332
|
import { CeStorefront } from "ce-storefront";
|
|
333
|
-
import
|
|
334
|
-
NotFound,
|
|
335
|
-
SDKValidationError,
|
|
336
|
-
Unauthorized,
|
|
337
|
-
} from "ce-storefront/models/errors";
|
|
333
|
+
import * as errors from "ce-storefront/models/errors";
|
|
338
334
|
|
|
339
335
|
const ceStorefront = new CeStorefront({
|
|
340
336
|
authorization: "<YOUR_BEARER_TOKEN_HERE>",
|
|
341
337
|
});
|
|
342
338
|
|
|
343
339
|
async function run() {
|
|
344
|
-
let result;
|
|
345
340
|
try {
|
|
346
|
-
result = await ceStorefront.catalog.listProducts({
|
|
341
|
+
const result = await ceStorefront.catalog.listProducts({
|
|
347
342
|
sortBy: "{\"country\":\"asc\",\"city\":\"asc\",\"population\":\"desc\"}",
|
|
348
343
|
});
|
|
349
344
|
|
|
350
|
-
// Handle the result
|
|
351
345
|
console.log(result);
|
|
352
|
-
} catch (
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
case (err instanceof NotFound): {
|
|
368
|
-
// Handle err.data$: NotFoundData
|
|
369
|
-
console.error(err);
|
|
370
|
-
return;
|
|
371
|
-
}
|
|
372
|
-
default: {
|
|
373
|
-
// Other errors such as network errors, see HTTPClientErrors for more details
|
|
374
|
-
throw err;
|
|
375
|
-
}
|
|
346
|
+
} catch (error) {
|
|
347
|
+
// Depending on the method different errors may be thrown
|
|
348
|
+
if (error instanceof errors.Unauthorized) {
|
|
349
|
+
console.log(error.message);
|
|
350
|
+
console.log(error.data$.message); // string
|
|
351
|
+
console.log(error.data$.success); // boolean
|
|
352
|
+
console.log(error.data$.code); // string
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
// Fallback error class, if no other more specific error class is matched
|
|
356
|
+
if (error instanceof errors.CeError) {
|
|
357
|
+
console.log(error.message);
|
|
358
|
+
console.log(error.statusCode);
|
|
359
|
+
console.log(error.body);
|
|
360
|
+
console.log(error.rawResponse.headers);
|
|
376
361
|
}
|
|
377
362
|
}
|
|
378
363
|
}
|
|
@@ -381,17 +366,22 @@ run();
|
|
|
381
366
|
|
|
382
367
|
```
|
|
383
368
|
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
369
|
+
### Error Classes
|
|
370
|
+
* [`Unauthorized`](docs/models/errors/unauthorized.md): Not authorized for given operation on the Resource. Status code `401`.
|
|
371
|
+
* `CeError`: The fallback error class, if no other more specific error class is matched.
|
|
372
|
+
* `SDKValidationError`: Type mismatch between the data returned from the server and the structure expected by the SDK. This can also be thrown for invalid method arguments. See `error.rawValue` for the raw value and `error.pretty()` for a nicely formatted multi-line string.
|
|
373
|
+
* Network errors:
|
|
374
|
+
* `ConnectionError`: HTTP client was unable to make a request to a server.
|
|
375
|
+
* `RequestTimeoutError`: HTTP request timed out due to an AbortSignal signal.
|
|
376
|
+
* `RequestAbortedError`: HTTP request was aborted by the client.
|
|
377
|
+
* `InvalidRequestError`: Any input used to create a request is invalid.
|
|
378
|
+
* `UnexpectedClientError`: Unrecognised or unexpected error.
|
|
379
|
+
* Less common errors, applicable to a subset of methods:
|
|
380
|
+
* [`NotFound`](docs/models/errors/notfound.md): Requested resource not found. Status code `404`. Applicable to 39 of 49 methods.*
|
|
381
|
+
* [`BadRequest`](docs/models/errors/badrequest.md): Bad request. Status code `400`. Applicable to 28 of 49 methods.*
|
|
382
|
+
|
|
383
|
+
|
|
384
|
+
\* Check [the method documentation](#available-resources-and-operations) to see if the error is applicable.
|
|
395
385
|
<!-- End Error Handling [errors] -->
|
|
396
386
|
|
|
397
387
|
<!-- Start Server Selection [server] -->
|
|
@@ -428,7 +418,6 @@ async function run() {
|
|
|
428
418
|
sortBy: "{\"country\":\"asc\",\"city\":\"asc\",\"population\":\"desc\"}",
|
|
429
419
|
});
|
|
430
420
|
|
|
431
|
-
// Handle the result
|
|
432
421
|
console.log(result);
|
|
433
422
|
}
|
|
434
423
|
|
|
@@ -452,7 +441,6 @@ async function run() {
|
|
|
452
441
|
sortBy: "{\"country\":\"asc\",\"city\":\"asc\",\"population\":\"desc\"}",
|
|
453
442
|
});
|
|
454
443
|
|
|
455
|
-
// Handle the result
|
|
456
444
|
console.log(result);
|
|
457
445
|
}
|
|
458
446
|
|
|
@@ -534,7 +522,6 @@ async function run() {
|
|
|
534
522
|
sortBy: "{\"country\":\"asc\",\"city\":\"asc\",\"population\":\"desc\"}",
|
|
535
523
|
});
|
|
536
524
|
|
|
537
|
-
// Handle the result
|
|
538
525
|
console.log(result);
|
|
539
526
|
}
|
|
540
527
|
|
|
@@ -555,7 +542,6 @@ async function run() {
|
|
|
555
542
|
xApiKey: "<YOUR_API_KEY_HERE>",
|
|
556
543
|
});
|
|
557
544
|
|
|
558
|
-
// Handle the result
|
|
559
545
|
console.log(result);
|
|
560
546
|
}
|
|
561
547
|
|
package/docs/sdks/auth/README.md
CHANGED
|
@@ -33,7 +33,6 @@ async function run() {
|
|
|
33
33
|
xApiKey: "<YOUR_API_KEY_HERE>",
|
|
34
34
|
});
|
|
35
35
|
|
|
36
|
-
// Handle the result
|
|
37
36
|
console.log(result);
|
|
38
37
|
}
|
|
39
38
|
|
|
@@ -56,15 +55,12 @@ async function run() {
|
|
|
56
55
|
const res = await authGetAnonymousToken(ceStorefront, {
|
|
57
56
|
xApiKey: "<YOUR_API_KEY_HERE>",
|
|
58
57
|
});
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
if (res.ok) {
|
|
59
|
+
const { value: result } = res;
|
|
60
|
+
console.log(result);
|
|
61
|
+
} else {
|
|
62
|
+
console.log("authGetAnonymousToken failed:", res.error);
|
|
62
63
|
}
|
|
63
|
-
|
|
64
|
-
const { value: result } = res;
|
|
65
|
-
|
|
66
|
-
// Handle the result
|
|
67
|
-
console.log(result);
|
|
68
64
|
}
|
|
69
65
|
|
|
70
66
|
run();
|
|
@@ -109,7 +105,6 @@ async function run() {
|
|
|
109
105
|
phone: "(553) 856-7634 x016",
|
|
110
106
|
});
|
|
111
107
|
|
|
112
|
-
// Handle the result
|
|
113
108
|
console.log(result);
|
|
114
109
|
}
|
|
115
110
|
|
|
@@ -134,15 +129,12 @@ async function run() {
|
|
|
134
129
|
const res = await authLoginWithPhone(ceStorefront, {
|
|
135
130
|
phone: "(553) 856-7634 x016",
|
|
136
131
|
});
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
132
|
+
if (res.ok) {
|
|
133
|
+
const { value: result } = res;
|
|
134
|
+
console.log(result);
|
|
135
|
+
} else {
|
|
136
|
+
console.log("authLoginWithPhone failed:", res.error);
|
|
140
137
|
}
|
|
141
|
-
|
|
142
|
-
const { value: result } = res;
|
|
143
|
-
|
|
144
|
-
// Handle the result
|
|
145
|
-
console.log(result);
|
|
146
138
|
}
|
|
147
139
|
|
|
148
140
|
run();
|
|
@@ -188,7 +180,6 @@ async function run() {
|
|
|
188
180
|
email: "Dax_Wisoky@gmail.com",
|
|
189
181
|
});
|
|
190
182
|
|
|
191
|
-
// Handle the result
|
|
192
183
|
console.log(result);
|
|
193
184
|
}
|
|
194
185
|
|
|
@@ -213,15 +204,12 @@ async function run() {
|
|
|
213
204
|
const res = await authLoginWithEmail(ceStorefront, {
|
|
214
205
|
email: "Dax_Wisoky@gmail.com",
|
|
215
206
|
});
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
207
|
+
if (res.ok) {
|
|
208
|
+
const { value: result } = res;
|
|
209
|
+
console.log(result);
|
|
210
|
+
} else {
|
|
211
|
+
console.log("authLoginWithEmail failed:", res.error);
|
|
219
212
|
}
|
|
220
|
-
|
|
221
|
-
const { value: result } = res;
|
|
222
|
-
|
|
223
|
-
// Handle the result
|
|
224
|
-
console.log(result);
|
|
225
213
|
}
|
|
226
214
|
|
|
227
215
|
run();
|
|
@@ -267,7 +255,6 @@ async function run() {
|
|
|
267
255
|
phone: "(797) 625-7467 x574",
|
|
268
256
|
});
|
|
269
257
|
|
|
270
|
-
// Handle the result
|
|
271
258
|
console.log(result);
|
|
272
259
|
}
|
|
273
260
|
|
|
@@ -292,15 +279,12 @@ async function run() {
|
|
|
292
279
|
const res = await authLoginWithWhatsapp(ceStorefront, {
|
|
293
280
|
phone: "(797) 625-7467 x574",
|
|
294
281
|
});
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
282
|
+
if (res.ok) {
|
|
283
|
+
const { value: result } = res;
|
|
284
|
+
console.log(result);
|
|
285
|
+
} else {
|
|
286
|
+
console.log("authLoginWithWhatsapp failed:", res.error);
|
|
298
287
|
}
|
|
299
|
-
|
|
300
|
-
const { value: result } = res;
|
|
301
|
-
|
|
302
|
-
// Handle the result
|
|
303
|
-
console.log(result);
|
|
304
288
|
}
|
|
305
289
|
|
|
306
290
|
run();
|
|
@@ -347,7 +331,6 @@ async function run() {
|
|
|
347
331
|
otpAction: "update-email",
|
|
348
332
|
});
|
|
349
333
|
|
|
350
|
-
// Handle the result
|
|
351
334
|
console.log(result);
|
|
352
335
|
}
|
|
353
336
|
|
|
@@ -374,15 +357,12 @@ async function run() {
|
|
|
374
357
|
otpToken: "<value>",
|
|
375
358
|
otpAction: "update-email",
|
|
376
359
|
});
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
360
|
+
if (res.ok) {
|
|
361
|
+
const { value: result } = res;
|
|
362
|
+
console.log(result);
|
|
363
|
+
} else {
|
|
364
|
+
console.log("authVerifyOtp failed:", res.error);
|
|
380
365
|
}
|
|
381
|
-
|
|
382
|
-
const { value: result } = res;
|
|
383
|
-
|
|
384
|
-
// Handle the result
|
|
385
|
-
console.log(result);
|
|
386
366
|
}
|
|
387
367
|
|
|
388
368
|
run();
|
|
@@ -428,7 +408,6 @@ async function run() {
|
|
|
428
408
|
id: "<id>",
|
|
429
409
|
});
|
|
430
410
|
|
|
431
|
-
// Handle the result
|
|
432
411
|
console.log(result);
|
|
433
412
|
}
|
|
434
413
|
|
|
@@ -453,15 +432,12 @@ async function run() {
|
|
|
453
432
|
const res = await authGetUserDetail(ceStorefront, {
|
|
454
433
|
id: "<id>",
|
|
455
434
|
});
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
435
|
+
if (res.ok) {
|
|
436
|
+
const { value: result } = res;
|
|
437
|
+
console.log(result);
|
|
438
|
+
} else {
|
|
439
|
+
console.log("authGetUserDetail failed:", res.error);
|
|
459
440
|
}
|
|
460
|
-
|
|
461
|
-
const { value: result } = res;
|
|
462
|
-
|
|
463
|
-
// Handle the result
|
|
464
|
-
console.log(result);
|
|
465
441
|
}
|
|
466
442
|
|
|
467
443
|
run();
|
|
@@ -535,7 +511,6 @@ async function run() {
|
|
|
535
511
|
},
|
|
536
512
|
});
|
|
537
513
|
|
|
538
|
-
// Handle the result
|
|
539
514
|
console.log(result);
|
|
540
515
|
}
|
|
541
516
|
|
|
@@ -588,15 +563,12 @@ async function run() {
|
|
|
588
563
|
},
|
|
589
564
|
},
|
|
590
565
|
});
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
566
|
+
if (res.ok) {
|
|
567
|
+
const { value: result } = res;
|
|
568
|
+
console.log(result);
|
|
569
|
+
} else {
|
|
570
|
+
console.log("authUpdateUser failed:", res.error);
|
|
594
571
|
}
|
|
595
|
-
|
|
596
|
-
const { value: result } = res;
|
|
597
|
-
|
|
598
|
-
// Handle the result
|
|
599
|
-
console.log(result);
|
|
600
572
|
}
|
|
601
573
|
|
|
602
574
|
run();
|
|
@@ -641,7 +613,6 @@ async function run() {
|
|
|
641
613
|
refreshToken: "<value>",
|
|
642
614
|
});
|
|
643
615
|
|
|
644
|
-
// Handle the result
|
|
645
616
|
console.log(result);
|
|
646
617
|
}
|
|
647
618
|
|
|
@@ -666,15 +637,12 @@ async function run() {
|
|
|
666
637
|
const res = await authRefreshToken(ceStorefront, {
|
|
667
638
|
refreshToken: "<value>",
|
|
668
639
|
});
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
640
|
+
if (res.ok) {
|
|
641
|
+
const { value: result } = res;
|
|
642
|
+
console.log(result);
|
|
643
|
+
} else {
|
|
644
|
+
console.log("authRefreshToken failed:", res.error);
|
|
672
645
|
}
|
|
673
|
-
|
|
674
|
-
const { value: result } = res;
|
|
675
|
-
|
|
676
|
-
// Handle the result
|
|
677
|
-
console.log(result);
|
|
678
646
|
}
|
|
679
647
|
|
|
680
648
|
run();
|
|
@@ -720,7 +688,6 @@ async function run() {
|
|
|
720
688
|
otpAction: "verify-email",
|
|
721
689
|
});
|
|
722
690
|
|
|
723
|
-
// Handle the result
|
|
724
691
|
console.log(result);
|
|
725
692
|
}
|
|
726
693
|
|
|
@@ -746,15 +713,12 @@ async function run() {
|
|
|
746
713
|
email: "Ahmed80@gmail.com",
|
|
747
714
|
otpAction: "verify-email",
|
|
748
715
|
});
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
716
|
+
if (res.ok) {
|
|
717
|
+
const { value: result } = res;
|
|
718
|
+
console.log(result);
|
|
719
|
+
} else {
|
|
720
|
+
console.log("authGenerateOtp failed:", res.error);
|
|
752
721
|
}
|
|
753
|
-
|
|
754
|
-
const { value: result } = res;
|
|
755
|
-
|
|
756
|
-
// Handle the result
|
|
757
|
-
console.log(result);
|
|
758
722
|
}
|
|
759
723
|
|
|
760
724
|
run();
|
|
@@ -797,7 +761,6 @@ const ceStorefront = new CeStorefront({
|
|
|
797
761
|
async function run() {
|
|
798
762
|
const result = await ceStorefront.auth.logout();
|
|
799
763
|
|
|
800
|
-
// Handle the result
|
|
801
764
|
console.log(result);
|
|
802
765
|
}
|
|
803
766
|
|
|
@@ -820,15 +783,12 @@ const ceStorefront = new CeStorefrontCore({
|
|
|
820
783
|
|
|
821
784
|
async function run() {
|
|
822
785
|
const res = await authLogout(ceStorefront);
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
786
|
+
if (res.ok) {
|
|
787
|
+
const { value: result } = res;
|
|
788
|
+
console.log(result);
|
|
789
|
+
} else {
|
|
790
|
+
console.log("authLogout failed:", res.error);
|
|
826
791
|
}
|
|
827
|
-
|
|
828
|
-
const { value: result } = res;
|
|
829
|
-
|
|
830
|
-
// Handle the result
|
|
831
|
-
console.log(result);
|
|
832
792
|
}
|
|
833
793
|
|
|
834
794
|
run();
|