@digital8/lighting-illusions-ts-sdk 0.0.1839 → 0.0.1840

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 (82) hide show
  1. package/.openapi-generator/FILES +10 -10
  2. package/README.md +8 -8
  3. package/dist/apis/CartsApi.d.ts +6 -6
  4. package/dist/apis/CartsApi.js +5 -3
  5. package/dist/apis/CouponsApi.d.ts +33 -0
  6. package/dist/apis/CouponsApi.js +138 -0
  7. package/dist/apis/index.d.ts +1 -0
  8. package/dist/apis/index.js +1 -0
  9. package/dist/models/AddressResource.d.ts +1 -1
  10. package/dist/models/AddressResource.js +3 -1
  11. package/dist/models/AdminCartResource.d.ts +4 -34
  12. package/dist/models/AdminCartResource.js +10 -32
  13. package/dist/models/AttachCouponCartRequest.d.ts +2 -2
  14. package/dist/models/AttachCouponCartRequest.js +3 -3
  15. package/dist/models/FrontendCartResource.d.ts +0 -12
  16. package/dist/models/FrontendCartResource.js +0 -8
  17. package/dist/models/LineItemListResource.d.ts +3 -27
  18. package/dist/models/LineItemListResource.js +3 -19
  19. package/dist/models/StoreFrontendResource.d.ts +1 -1
  20. package/dist/models/StoreFrontendResource.js +1 -3
  21. package/dist/models/StoreListResource.d.ts +1 -1
  22. package/dist/models/StoreListResource.js +3 -1
  23. package/dist/models/StoreResource.d.ts +2 -2
  24. package/dist/models/StoreResource.js +2 -6
  25. package/dist/models/StoreSpecialDateFrontendResource.d.ts +2 -2
  26. package/dist/models/StoreSpecialDateFrontendResource.js +1 -3
  27. package/dist/models/VerifyCouponRequest.d.ts +63 -0
  28. package/dist/models/VerifyCouponRequest.js +64 -0
  29. package/dist/models/VerifyCouponRequestProductsInner.d.ts +38 -0
  30. package/dist/models/VerifyCouponRequestProductsInner.js +51 -0
  31. package/dist/models/VerifyCouponResource.d.ts +38 -0
  32. package/dist/models/VerifyCouponResource.js +55 -0
  33. package/dist/models/VerifyCouponResourceArrayResponse.d.ts +33 -0
  34. package/dist/models/VerifyCouponResourceArrayResponse.js +50 -0
  35. package/dist/models/index.d.ts +4 -5
  36. package/dist/models/index.js +4 -5
  37. package/docs/AdminCartResource.md +6 -16
  38. package/docs/AttachCouponCartRequest.md +2 -2
  39. package/docs/CartsApi.md +8 -8
  40. package/docs/CouponsApi.md +74 -0
  41. package/docs/FrontendCartResource.md +0 -4
  42. package/docs/LineItemListResource.md +1 -9
  43. package/docs/StoreSpecialDateFrontendResource.md +1 -1
  44. package/docs/VerifyCouponRequest.md +44 -0
  45. package/docs/{DiscountValueType.md → VerifyCouponRequestProductsInner.md} +8 -4
  46. package/docs/{DetachCouponCartRequest.md → VerifyCouponResource.md} +8 -6
  47. package/docs/{DiscountType.md → VerifyCouponResourceArrayResponse.md} +6 -4
  48. package/package.json +1 -1
  49. package/src/apis/CartsApi.ts +14 -12
  50. package/src/apis/CouponsApi.ts +77 -0
  51. package/src/apis/index.ts +1 -0
  52. package/src/models/AddressResource.ts +3 -2
  53. package/src/models/AdminCartResource.ts +14 -60
  54. package/src/models/AttachCouponCartRequest.ts +5 -5
  55. package/src/models/FrontendCartResource.ts +0 -18
  56. package/src/models/LineItemListResource.ts +10 -46
  57. package/src/models/StoreFrontendResource.ts +2 -3
  58. package/src/models/StoreListResource.ts +3 -2
  59. package/src/models/StoreResource.ts +4 -6
  60. package/src/models/StoreSpecialDateFrontendResource.ts +3 -4
  61. package/src/models/VerifyCouponRequest.ts +115 -0
  62. package/src/models/VerifyCouponRequestProductsInner.ts +73 -0
  63. package/src/models/VerifyCouponResource.ts +75 -0
  64. package/src/models/VerifyCouponResourceArrayResponse.ts +73 -0
  65. package/src/models/index.ts +4 -5
  66. package/dist/models/DetachCouponCartRequest.d.ts +0 -32
  67. package/dist/models/DetachCouponCartRequest.js +0 -51
  68. package/dist/models/DiscountType.d.ts +0 -26
  69. package/dist/models/DiscountType.js +0 -52
  70. package/dist/models/DiscountValueType.d.ts +0 -25
  71. package/dist/models/DiscountValueType.js +0 -51
  72. package/dist/models/ProductChildCartLiteResource.d.ts +0 -70
  73. package/dist/models/ProductChildCartLiteResource.js +0 -77
  74. package/dist/models/ProductChildCartLiteResourceArrayResponse.d.ts +0 -33
  75. package/dist/models/ProductChildCartLiteResourceArrayResponse.js +0 -50
  76. package/docs/ProductChildCartLiteResource.md +0 -46
  77. package/docs/ProductChildCartLiteResourceArrayResponse.md +0 -34
  78. package/src/models/DetachCouponCartRequest.ts +0 -66
  79. package/src/models/DiscountType.ts +0 -54
  80. package/src/models/DiscountValueType.ts +0 -53
  81. package/src/models/ProductChildCartLiteResource.ts +0 -135
  82. package/src/models/ProductChildCartLiteResourceArrayResponse.ts +0 -73
@@ -72,7 +72,6 @@ export * from './DestroyAttributeValueRequest';
72
72
  export * from './DetachAccessoriesProductRangeRequest';
73
73
  export * from './DetachAssetableOverlayTemplateRequest';
74
74
  export * from './DetachAttributesProductRangeRequest';
75
- export * from './DetachCouponCartRequest';
76
75
  export * from './DetachDocumentablesDocumentRequest';
77
76
  export * from './DetachDocumentablesDocumentRequestDocumentablesInner';
78
77
  export * from './DetachDocumentsProductChildRequest';
@@ -80,8 +79,6 @@ export * from './DetachDocumentsProductRangeRequest';
80
79
  export * from './DetachProductsProductCategoryRequest';
81
80
  export * from './DetachStoresSupplierRequest';
82
81
  export * from './DetachSuppliersStoreRequest';
83
- export * from './DiscountType';
84
- export * from './DiscountValueType';
85
82
  export * from './DocumentFileForUploadResource';
86
83
  export * from './DocumentFileForUploadResourceArrayResponse';
87
84
  export * from './DocumentFrontendResource';
@@ -268,8 +265,6 @@ export * from './ProductChildAttributeGroupedResource';
268
265
  export * from './ProductChildAttributeGroupedResourceArrayResponse';
269
266
  export * from './ProductChildAttributeResource';
270
267
  export * from './ProductChildAttributeResourceArrayResponse';
271
- export * from './ProductChildCartLiteResource';
272
- export * from './ProductChildCartLiteResourceArrayResponse';
273
268
  export * from './ProductChildListResource';
274
269
  export * from './ProductChildListResourceArrayResponse';
275
270
  export * from './ProductChildLiteResource';
@@ -466,6 +461,10 @@ export * from './UpdateStoreRequest';
466
461
  export * from './UpdateStoreRequestSpecialDatesInner';
467
462
  export * from './UpdateSupplierRequest';
468
463
  export * from './UpdateTagRequest';
464
+ export * from './VerifyCouponRequest';
465
+ export * from './VerifyCouponRequestProductsInner';
466
+ export * from './VerifyCouponResource';
467
+ export * from './VerifyCouponResourceArrayResponse';
469
468
  export * from './WishlistCheckResource';
470
469
  export * from './WishlistCheckResourceArrayResponse';
471
470
  export * from './WishlistToggleResource';
@@ -90,7 +90,6 @@ __exportStar(require("./DestroyAttributeValueRequest"), exports);
90
90
  __exportStar(require("./DetachAccessoriesProductRangeRequest"), exports);
91
91
  __exportStar(require("./DetachAssetableOverlayTemplateRequest"), exports);
92
92
  __exportStar(require("./DetachAttributesProductRangeRequest"), exports);
93
- __exportStar(require("./DetachCouponCartRequest"), exports);
94
93
  __exportStar(require("./DetachDocumentablesDocumentRequest"), exports);
95
94
  __exportStar(require("./DetachDocumentablesDocumentRequestDocumentablesInner"), exports);
96
95
  __exportStar(require("./DetachDocumentsProductChildRequest"), exports);
@@ -98,8 +97,6 @@ __exportStar(require("./DetachDocumentsProductRangeRequest"), exports);
98
97
  __exportStar(require("./DetachProductsProductCategoryRequest"), exports);
99
98
  __exportStar(require("./DetachStoresSupplierRequest"), exports);
100
99
  __exportStar(require("./DetachSuppliersStoreRequest"), exports);
101
- __exportStar(require("./DiscountType"), exports);
102
- __exportStar(require("./DiscountValueType"), exports);
103
100
  __exportStar(require("./DocumentFileForUploadResource"), exports);
104
101
  __exportStar(require("./DocumentFileForUploadResourceArrayResponse"), exports);
105
102
  __exportStar(require("./DocumentFrontendResource"), exports);
@@ -286,8 +283,6 @@ __exportStar(require("./ProductChildAttributeGroupedResource"), exports);
286
283
  __exportStar(require("./ProductChildAttributeGroupedResourceArrayResponse"), exports);
287
284
  __exportStar(require("./ProductChildAttributeResource"), exports);
288
285
  __exportStar(require("./ProductChildAttributeResourceArrayResponse"), exports);
289
- __exportStar(require("./ProductChildCartLiteResource"), exports);
290
- __exportStar(require("./ProductChildCartLiteResourceArrayResponse"), exports);
291
286
  __exportStar(require("./ProductChildListResource"), exports);
292
287
  __exportStar(require("./ProductChildListResourceArrayResponse"), exports);
293
288
  __exportStar(require("./ProductChildLiteResource"), exports);
@@ -484,6 +479,10 @@ __exportStar(require("./UpdateStoreRequest"), exports);
484
479
  __exportStar(require("./UpdateStoreRequestSpecialDatesInner"), exports);
485
480
  __exportStar(require("./UpdateSupplierRequest"), exports);
486
481
  __exportStar(require("./UpdateTagRequest"), exports);
482
+ __exportStar(require("./VerifyCouponRequest"), exports);
483
+ __exportStar(require("./VerifyCouponRequestProductsInner"), exports);
484
+ __exportStar(require("./VerifyCouponResource"), exports);
485
+ __exportStar(require("./VerifyCouponResourceArrayResponse"), exports);
487
486
  __exportStar(require("./WishlistCheckResource"), exports);
488
487
  __exportStar(require("./WishlistCheckResourceArrayResponse"), exports);
489
488
  __exportStar(require("./WishlistToggleResource"), exports);
@@ -30,15 +30,10 @@ Name | Type
30
30
  `coupons` | object
31
31
  `shippingAddress` | [AddressResource](AddressResource.md)
32
32
  `billingAddress` | [AddressResource](AddressResource.md)
33
- `discountPreview` | number
34
33
  `subtotal` | number
35
- `shippingAmount` | number
36
- `total` | number
37
- `discountAmount` | number
38
- `productDiscountAmount` | number
39
- `shippingDiscountAmount` | number
40
- `cartDiscountAmount` | number
41
- `finalTotalAmount` | number
34
+ `discountPreview` | number
35
+ `shippingEstimate` | number
36
+ `insuranceEstimate` | number
42
37
  `status` | string
43
38
 
44
39
  ## Example
@@ -72,15 +67,10 @@ const example = {
72
67
  "coupons": null,
73
68
  "shippingAddress": null,
74
69
  "billingAddress": null,
75
- "discountPreview": null,
76
70
  "subtotal": null,
77
- "shippingAmount": null,
78
- "total": null,
79
- "discountAmount": null,
80
- "productDiscountAmount": null,
81
- "shippingDiscountAmount": null,
82
- "cartDiscountAmount": null,
83
- "finalTotalAmount": null,
71
+ "discountPreview": null,
72
+ "shippingEstimate": null,
73
+ "insuranceEstimate": null,
84
74
  "status": null,
85
75
  } satisfies AdminCartResource
86
76
 
@@ -6,7 +6,7 @@
6
6
 
7
7
  Name | Type
8
8
  ------------ | -------------
9
- `couponIds` | Array<number>
9
+ `couponId` | number
10
10
 
11
11
  ## Example
12
12
 
@@ -15,7 +15,7 @@ import type { AttachCouponCartRequest } from '@digital8/lighting-illusions-ts-sd
15
15
 
16
16
  // TODO: Update the object below with actual values
17
17
  const example = {
18
- "couponIds": null,
18
+ "couponId": null,
19
19
  } satisfies AttachCouponCartRequest
20
20
 
21
21
  console.log(example)
package/docs/CartsApi.md CHANGED
@@ -7,7 +7,7 @@ All URIs are relative to *http://localhost/api*
7
7
  | [**attachCouponCart**](CartsApi.md#attachcouponcartoperation) | **POST** /admin-api/carts/{cart}/coupons/attach | Auto-generated: attachCouponCart |
8
8
  | [**attachItemCart**](CartsApi.md#attachitemcartoperation) | **POST** /admin-api/carts/{cart}/items/attach | Auto-generated: attachItemCart |
9
9
  | [**destroyCart**](CartsApi.md#destroycart) | **DELETE** /admin-api/carts/{cart}/delete | Auto-generated: destroyCart |
10
- | [**detachCouponCart**](CartsApi.md#detachcouponcartoperation) | **DELETE** /admin-api/carts/{cart}/coupons/detach | Auto-generated: detachCouponCart |
10
+ | [**detachCouponCart**](CartsApi.md#detachcouponcart) | **DELETE** /admin-api/carts/{cart}/coupons/{coupon}/detach | Auto-generated: detachCouponCart |
11
11
  | [**detachItemCart**](CartsApi.md#detachitemcart) | **DELETE** /admin-api/carts/{cart}/items/{lineItem}/detach | Auto-generated: detachItemCart |
12
12
  | [**indexCart**](CartsApi.md#indexcartoperation) | **POST** /admin-api/carts/list | Auto-generated: indexCart |
13
13
  | [**sendPaymentLinkCart**](CartsApi.md#sendpaymentlinkcart) | **POST** /admin-api/carts/{cart}/send-payment-link | Auto-generated: sendPaymentLinkCart |
@@ -221,7 +221,7 @@ No authorization required
221
221
 
222
222
  ## detachCouponCart
223
223
 
224
- > AdminCartResource detachCouponCart(cart, detachCouponCartRequest)
224
+ > AdminCartResource detachCouponCart(cart, coupon)
225
225
 
226
226
  Auto-generated: detachCouponCart
227
227
 
@@ -232,7 +232,7 @@ import {
232
232
  Configuration,
233
233
  CartsApi,
234
234
  } from '@digital8/lighting-illusions-ts-sdk';
235
- import type { DetachCouponCartOperationRequest } from '@digital8/lighting-illusions-ts-sdk';
235
+ import type { DetachCouponCartRequest } from '@digital8/lighting-illusions-ts-sdk';
236
236
 
237
237
  async function example() {
238
238
  console.log("🚀 Testing @digital8/lighting-illusions-ts-sdk SDK...");
@@ -241,9 +241,9 @@ async function example() {
241
241
  const body = {
242
242
  // number | The id of the cart
243
243
  cart: 56,
244
- // DetachCouponCartRequest (optional)
245
- detachCouponCartRequest: ...,
246
- } satisfies DetachCouponCartOperationRequest;
244
+ // number | The id of the coupon
245
+ coupon: 56,
246
+ } satisfies DetachCouponCartRequest;
247
247
 
248
248
  try {
249
249
  const data = await api.detachCouponCart(body);
@@ -263,7 +263,7 @@ example().catch(console.error);
263
263
  | Name | Type | Description | Notes |
264
264
  |------------- | ------------- | ------------- | -------------|
265
265
  | **cart** | `number` | The id of the cart | [Defaults to `undefined`] |
266
- | **detachCouponCartRequest** | [DetachCouponCartRequest](DetachCouponCartRequest.md) | | [Optional] |
266
+ | **coupon** | `number` | The id of the coupon | [Defaults to `undefined`] |
267
267
 
268
268
  ### Return type
269
269
 
@@ -275,7 +275,7 @@ No authorization required
275
275
 
276
276
  ### HTTP request headers
277
277
 
278
- - **Content-Type**: `application/json`
278
+ - **Content-Type**: Not defined
279
279
  - **Accept**: `application/json`
280
280
 
281
281
 
@@ -0,0 +1,74 @@
1
+ # CouponsApi
2
+
3
+ All URIs are relative to *http://localhost/api*
4
+
5
+ | Method | HTTP request | Description |
6
+ |------------- | ------------- | -------------|
7
+ | [**verifyCoupon**](CouponsApi.md#verifycouponoperation) | **POST** /admin-api/coupons/verify | Auto-generated: verifyCoupon |
8
+
9
+
10
+
11
+ ## verifyCoupon
12
+
13
+ > VerifyCouponResourceArrayResponse verifyCoupon(verifyCouponRequest)
14
+
15
+ Auto-generated: verifyCoupon
16
+
17
+ ### Example
18
+
19
+ ```ts
20
+ import {
21
+ Configuration,
22
+ CouponsApi,
23
+ } from '@digital8/lighting-illusions-ts-sdk';
24
+ import type { VerifyCouponOperationRequest } from '@digital8/lighting-illusions-ts-sdk';
25
+
26
+ async function example() {
27
+ console.log("🚀 Testing @digital8/lighting-illusions-ts-sdk SDK...");
28
+ const api = new CouponsApi();
29
+
30
+ const body = {
31
+ // VerifyCouponRequest (optional)
32
+ verifyCouponRequest: ...,
33
+ } satisfies VerifyCouponOperationRequest;
34
+
35
+ try {
36
+ const data = await api.verifyCoupon(body);
37
+ console.log(data);
38
+ } catch (error) {
39
+ console.error(error);
40
+ }
41
+ }
42
+
43
+ // Run the test
44
+ example().catch(console.error);
45
+ ```
46
+
47
+ ### Parameters
48
+
49
+
50
+ | Name | Type | Description | Notes |
51
+ |------------- | ------------- | ------------- | -------------|
52
+ | **verifyCouponRequest** | [VerifyCouponRequest](VerifyCouponRequest.md) | | [Optional] |
53
+
54
+ ### Return type
55
+
56
+ [**VerifyCouponResourceArrayResponse**](VerifyCouponResourceArrayResponse.md)
57
+
58
+ ### Authorization
59
+
60
+ No authorization required
61
+
62
+ ### HTTP request headers
63
+
64
+ - **Content-Type**: `application/json`
65
+ - **Accept**: `application/json`
66
+
67
+
68
+ ### HTTP response details
69
+ | Status code | Description | Response headers |
70
+ |-------------|-------------|------------------|
71
+ | **200** | Successful resource response | - |
72
+
73
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
74
+
@@ -25,8 +25,6 @@ Name | Type
25
25
  `billingAddress` | [AddressResource](AddressResource.md)
26
26
  `subtotal` | number
27
27
  `discountPreview` | number
28
- `totalSubtotalDiscount` | number
29
- `totalShippingDiscount` | number
30
28
  `shippingEstimate` | number
31
29
  `insuranceEstimate` | number
32
30
  `status` | string
@@ -57,8 +55,6 @@ const example = {
57
55
  "billingAddress": null,
58
56
  "subtotal": null,
59
57
  "discountPreview": null,
60
- "totalSubtotalDiscount": null,
61
- "totalShippingDiscount": null,
62
58
  "shippingEstimate": null,
63
59
  "insuranceEstimate": null,
64
60
  "status": null,
@@ -9,11 +9,7 @@ Name | Type
9
9
  `id` | number
10
10
  `quantity` | number
11
11
  `productPrice` | number
12
- `productDiscount` | number
13
- `totalDiscount` | number
14
- `lineSubtotal` | number
15
- `discounts` | Array<boolean>
16
- `productChild` | [ProductChildCartLiteResource](ProductChildCartLiteResource.md)
12
+ `productChild` | [ProductChildListResource](ProductChildListResource.md)
17
13
 
18
14
  ## Example
19
15
 
@@ -25,10 +21,6 @@ const example = {
25
21
  "id": null,
26
22
  "quantity": null,
27
23
  "productPrice": null,
28
- "productDiscount": null,
29
- "totalDiscount": null,
30
- "lineSubtotal": null,
31
- "discounts": null,
32
24
  "productChild": null,
33
25
  } satisfies LineItemListResource
34
26
 
@@ -9,7 +9,7 @@ Name | Type
9
9
  `id` | number
10
10
  `name` | string
11
11
  `hours` | string
12
- `date` | object
12
+ `date` | string
13
13
  `closed` | boolean
14
14
  `displayStartDate` | object
15
15
  `displayEndDate` | object
@@ -0,0 +1,44 @@
1
+
2
+ # VerifyCouponRequest
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `siteId` | number
10
+ `customerId` | number
11
+ `cartId` | number
12
+ `products` | [Array<VerifyCouponRequestProductsInner>](VerifyCouponRequestProductsInner.md)
13
+ `couponCode` | string
14
+ `couponIds` | Array<number>
15
+
16
+ ## Example
17
+
18
+ ```typescript
19
+ import type { VerifyCouponRequest } from '@digital8/lighting-illusions-ts-sdk'
20
+
21
+ // TODO: Update the object below with actual values
22
+ const example = {
23
+ "siteId": null,
24
+ "customerId": null,
25
+ "cartId": null,
26
+ "products": null,
27
+ "couponCode": null,
28
+ "couponIds": null,
29
+ } satisfies VerifyCouponRequest
30
+
31
+ console.log(example)
32
+
33
+ // Convert the instance to a JSON string
34
+ const exampleJSON: string = JSON.stringify(example)
35
+ console.log(exampleJSON)
36
+
37
+ // Parse the JSON string back to an object
38
+ const exampleParsed = JSON.parse(exampleJSON) as VerifyCouponRequest
39
+ console.log(exampleParsed)
40
+ ```
41
+
42
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
43
+
44
+
@@ -1,20 +1,24 @@
1
1
 
2
- # DiscountValueType
2
+ # VerifyCouponRequestProductsInner
3
3
 
4
4
 
5
5
  ## Properties
6
6
 
7
7
  Name | Type
8
8
  ------------ | -------------
9
+ `productChildId` | number
10
+ `quantity` | number
9
11
 
10
12
  ## Example
11
13
 
12
14
  ```typescript
13
- import type { DiscountValueType } from '@digital8/lighting-illusions-ts-sdk'
15
+ import type { VerifyCouponRequestProductsInner } from '@digital8/lighting-illusions-ts-sdk'
14
16
 
15
17
  // TODO: Update the object below with actual values
16
18
  const example = {
17
- } satisfies DiscountValueType
19
+ "productChildId": null,
20
+ "quantity": null,
21
+ } satisfies VerifyCouponRequestProductsInner
18
22
 
19
23
  console.log(example)
20
24
 
@@ -23,7 +27,7 @@ const exampleJSON: string = JSON.stringify(example)
23
27
  console.log(exampleJSON)
24
28
 
25
29
  // Parse the JSON string back to an object
26
- const exampleParsed = JSON.parse(exampleJSON) as DiscountValueType
30
+ const exampleParsed = JSON.parse(exampleJSON) as VerifyCouponRequestProductsInner
27
31
  console.log(exampleParsed)
28
32
  ```
29
33
 
@@ -1,22 +1,24 @@
1
1
 
2
- # DetachCouponCartRequest
2
+ # VerifyCouponResource
3
3
 
4
4
 
5
5
  ## Properties
6
6
 
7
7
  Name | Type
8
8
  ------------ | -------------
9
- `couponIds` | Array<number>
9
+ `couponId` | number
10
+ `discountAmount` | number
10
11
 
11
12
  ## Example
12
13
 
13
14
  ```typescript
14
- import type { DetachCouponCartRequest } from '@digital8/lighting-illusions-ts-sdk'
15
+ import type { VerifyCouponResource } from '@digital8/lighting-illusions-ts-sdk'
15
16
 
16
17
  // TODO: Update the object below with actual values
17
18
  const example = {
18
- "couponIds": null,
19
- } satisfies DetachCouponCartRequest
19
+ "couponId": null,
20
+ "discountAmount": null,
21
+ } satisfies VerifyCouponResource
20
22
 
21
23
  console.log(example)
22
24
 
@@ -25,7 +27,7 @@ const exampleJSON: string = JSON.stringify(example)
25
27
  console.log(exampleJSON)
26
28
 
27
29
  // Parse the JSON string back to an object
28
- const exampleParsed = JSON.parse(exampleJSON) as DetachCouponCartRequest
30
+ const exampleParsed = JSON.parse(exampleJSON) as VerifyCouponResource
29
31
  console.log(exampleParsed)
30
32
  ```
31
33
 
@@ -1,20 +1,22 @@
1
1
 
2
- # DiscountType
2
+ # VerifyCouponResourceArrayResponse
3
3
 
4
4
 
5
5
  ## Properties
6
6
 
7
7
  Name | Type
8
8
  ------------ | -------------
9
+ `data` | [Array<VerifyCouponResource>](VerifyCouponResource.md)
9
10
 
10
11
  ## Example
11
12
 
12
13
  ```typescript
13
- import type { DiscountType } from '@digital8/lighting-illusions-ts-sdk'
14
+ import type { VerifyCouponResourceArrayResponse } from '@digital8/lighting-illusions-ts-sdk'
14
15
 
15
16
  // TODO: Update the object below with actual values
16
17
  const example = {
17
- } satisfies DiscountType
18
+ "data": null,
19
+ } satisfies VerifyCouponResourceArrayResponse
18
20
 
19
21
  console.log(example)
20
22
 
@@ -23,7 +25,7 @@ const exampleJSON: string = JSON.stringify(example)
23
25
  console.log(exampleJSON)
24
26
 
25
27
  // Parse the JSON string back to an object
26
- const exampleParsed = JSON.parse(exampleJSON) as DiscountType
28
+ const exampleParsed = JSON.parse(exampleJSON) as VerifyCouponResourceArrayResponse
27
29
  console.log(exampleParsed)
28
30
  ```
29
31
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital8/lighting-illusions-ts-sdk",
3
- "version": "0.0.1839",
3
+ "version": "0.0.1840",
4
4
  "description": "OpenAPI client for @digital8/lighting-illusions-ts-sdk",
5
5
  "author": "OpenAPI-Generator",
6
6
  "repository": {
@@ -18,7 +18,6 @@ import type {
18
18
  AdminCartResource,
19
19
  AttachCouponCartRequest,
20
20
  AttachItemCartRequest,
21
- DetachCouponCartRequest,
22
21
  GenericResponse,
23
22
  IndexCartRequest,
24
23
  PaginatedCartListResourceResponse,
@@ -33,8 +32,6 @@ import {
33
32
  AttachCouponCartRequestToJSON,
34
33
  AttachItemCartRequestFromJSON,
35
34
  AttachItemCartRequestToJSON,
36
- DetachCouponCartRequestFromJSON,
37
- DetachCouponCartRequestToJSON,
38
35
  GenericResponseFromJSON,
39
36
  GenericResponseToJSON,
40
37
  IndexCartRequestFromJSON,
@@ -63,9 +60,9 @@ export interface DestroyCartRequest {
63
60
  cart: number;
64
61
  }
65
62
 
66
- export interface DetachCouponCartOperationRequest {
63
+ export interface DetachCouponCartRequest {
67
64
  cart: number;
68
- detachCouponCartRequest?: DetachCouponCartRequest;
65
+ coupon: number;
69
66
  }
70
67
 
71
68
  export interface DetachItemCartRequest {
@@ -249,7 +246,7 @@ export class CartsApi extends runtime.BaseAPI {
249
246
  /**
250
247
  * Creates request options for detachCouponCart without sending the request
251
248
  */
252
- async detachCouponCartRequestOpts(requestParameters: DetachCouponCartOperationRequest): Promise<runtime.RequestOpts> {
249
+ async detachCouponCartRequestOpts(requestParameters: DetachCouponCartRequest): Promise<runtime.RequestOpts> {
253
250
  if (requestParameters['cart'] == null) {
254
251
  throw new runtime.RequiredError(
255
252
  'cart',
@@ -257,29 +254,34 @@ export class CartsApi extends runtime.BaseAPI {
257
254
  );
258
255
  }
259
256
 
257
+ if (requestParameters['coupon'] == null) {
258
+ throw new runtime.RequiredError(
259
+ 'coupon',
260
+ 'Required parameter "coupon" was null or undefined when calling detachCouponCart().'
261
+ );
262
+ }
263
+
260
264
  const queryParameters: any = {};
261
265
 
262
266
  const headerParameters: runtime.HTTPHeaders = {};
263
267
 
264
- headerParameters['Content-Type'] = 'application/json';
265
-
266
268
 
267
- let urlPath = `/admin-api/carts/{cart}/coupons/detach`;
269
+ let urlPath = `/admin-api/carts/{cart}/coupons/{coupon}/detach`;
268
270
  urlPath = urlPath.replace(`{${"cart"}}`, encodeURIComponent(String(requestParameters['cart'])));
271
+ urlPath = urlPath.replace(`{${"coupon"}}`, encodeURIComponent(String(requestParameters['coupon'])));
269
272
 
270
273
  return {
271
274
  path: urlPath,
272
275
  method: 'DELETE',
273
276
  headers: headerParameters,
274
277
  query: queryParameters,
275
- body: DetachCouponCartRequestToJSON(requestParameters['detachCouponCartRequest']),
276
278
  };
277
279
  }
278
280
 
279
281
  /**
280
282
  * Auto-generated: detachCouponCart
281
283
  */
282
- async detachCouponCartRaw(requestParameters: DetachCouponCartOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminCartResource>> {
284
+ async detachCouponCartRaw(requestParameters: DetachCouponCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminCartResource>> {
283
285
  const requestOptions = await this.detachCouponCartRequestOpts(requestParameters);
284
286
  const response = await this.request(requestOptions, initOverrides);
285
287
 
@@ -289,7 +291,7 @@ export class CartsApi extends runtime.BaseAPI {
289
291
  /**
290
292
  * Auto-generated: detachCouponCart
291
293
  */
292
- async detachCouponCart(requestParameters: DetachCouponCartOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminCartResource> {
294
+ async detachCouponCart(requestParameters: DetachCouponCartRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminCartResource> {
293
295
  const response = await this.detachCouponCartRaw(requestParameters, initOverrides);
294
296
  return await response.value();
295
297
  }
@@ -0,0 +1,77 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * My API
5
+ * API documentation for my Laravel app
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ *
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+
16
+ import * as runtime from '../runtime';
17
+ import type {
18
+ VerifyCouponRequest,
19
+ VerifyCouponResourceArrayResponse,
20
+ } from '../models/index';
21
+ import {
22
+ VerifyCouponRequestFromJSON,
23
+ VerifyCouponRequestToJSON,
24
+ VerifyCouponResourceArrayResponseFromJSON,
25
+ VerifyCouponResourceArrayResponseToJSON,
26
+ } from '../models/index';
27
+
28
+ export interface VerifyCouponOperationRequest {
29
+ verifyCouponRequest?: VerifyCouponRequest;
30
+ }
31
+
32
+ /**
33
+ *
34
+ */
35
+ export class CouponsApi extends runtime.BaseAPI {
36
+
37
+ /**
38
+ * Creates request options for verifyCoupon without sending the request
39
+ */
40
+ async verifyCouponRequestOpts(requestParameters: VerifyCouponOperationRequest): Promise<runtime.RequestOpts> {
41
+ const queryParameters: any = {};
42
+
43
+ const headerParameters: runtime.HTTPHeaders = {};
44
+
45
+ headerParameters['Content-Type'] = 'application/json';
46
+
47
+
48
+ let urlPath = `/admin-api/coupons/verify`;
49
+
50
+ return {
51
+ path: urlPath,
52
+ method: 'POST',
53
+ headers: headerParameters,
54
+ query: queryParameters,
55
+ body: VerifyCouponRequestToJSON(requestParameters['verifyCouponRequest']),
56
+ };
57
+ }
58
+
59
+ /**
60
+ * Auto-generated: verifyCoupon
61
+ */
62
+ async verifyCouponRaw(requestParameters: VerifyCouponOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<VerifyCouponResourceArrayResponse>> {
63
+ const requestOptions = await this.verifyCouponRequestOpts(requestParameters);
64
+ const response = await this.request(requestOptions, initOverrides);
65
+
66
+ return new runtime.JSONApiResponse(response, (jsonValue) => VerifyCouponResourceArrayResponseFromJSON(jsonValue));
67
+ }
68
+
69
+ /**
70
+ * Auto-generated: verifyCoupon
71
+ */
72
+ async verifyCoupon(requestParameters: VerifyCouponOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<VerifyCouponResourceArrayResponse> {
73
+ const response = await this.verifyCouponRaw(requestParameters, initOverrides);
74
+ return await response.value();
75
+ }
76
+
77
+ }
package/src/apis/index.ts CHANGED
@@ -4,6 +4,7 @@ export * from './AdminApi';
4
4
  export * from './AssetApi';
5
5
  export * from './AttributeApi';
6
6
  export * from './CartsApi';
7
+ export * from './CouponsApi';
7
8
  export * from './CustomersApi';
8
9
  export * from './DefinitionApi';
9
10
  export * from './DocumentApi';