@digital8/lighting-illusions-ts-sdk 0.0.1838 → 0.0.1839
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/.openapi-generator/FILES +10 -0
- package/README.md +8 -3
- package/dist/apis/CartsApi.d.ts +6 -6
- package/dist/apis/CartsApi.js +3 -5
- package/dist/models/AddressResource.d.ts +1 -1
- package/dist/models/AddressResource.js +1 -3
- package/dist/models/AdminCartResource.d.ts +34 -4
- package/dist/models/AdminCartResource.js +32 -10
- package/dist/models/AttachCouponCartRequest.d.ts +2 -2
- package/dist/models/AttachCouponCartRequest.js +3 -3
- package/dist/models/DetachCouponCartRequest.d.ts +32 -0
- package/dist/models/DetachCouponCartRequest.js +51 -0
- package/dist/models/DiscountType.d.ts +26 -0
- package/dist/models/DiscountType.js +52 -0
- package/dist/models/DiscountValueType.d.ts +25 -0
- package/dist/models/DiscountValueType.js +51 -0
- package/dist/models/ExternalApiLogResource.d.ts +1 -1
- package/dist/models/ExternalApiLogResource.js +3 -1
- package/dist/models/FrontendCartResource.d.ts +12 -0
- package/dist/models/FrontendCartResource.js +8 -0
- package/dist/models/LineItemListResource.d.ts +27 -3
- package/dist/models/LineItemListResource.js +19 -3
- package/dist/models/ProductChildCartLiteResource.d.ts +70 -0
- package/dist/models/ProductChildCartLiteResource.js +77 -0
- package/dist/models/ProductChildCartLiteResourceArrayResponse.d.ts +33 -0
- package/dist/models/ProductChildCartLiteResourceArrayResponse.js +50 -0
- package/dist/models/StoreResource.d.ts +1 -1
- package/dist/models/StoreResource.js +3 -1
- package/dist/models/index.d.ts +5 -0
- package/dist/models/index.js +5 -0
- package/docs/AdminCartResource.md +16 -6
- package/docs/AttachCouponCartRequest.md +2 -2
- package/docs/CartsApi.md +8 -8
- package/docs/DetachCouponCartRequest.md +34 -0
- package/docs/DiscountType.md +32 -0
- package/docs/DiscountValueType.md +32 -0
- package/docs/FrontendCartResource.md +4 -0
- package/docs/LineItemListResource.md +9 -1
- package/docs/ProductChildCartLiteResource.md +46 -0
- package/docs/ProductChildCartLiteResourceArrayResponse.md +34 -0
- package/package.json +1 -1
- package/src/apis/CartsApi.ts +12 -14
- package/src/models/AddressResource.ts +2 -3
- package/src/models/AdminCartResource.ts +60 -14
- package/src/models/AttachCouponCartRequest.ts +5 -5
- package/src/models/DetachCouponCartRequest.ts +66 -0
- package/src/models/DiscountType.ts +54 -0
- package/src/models/DiscountValueType.ts +53 -0
- package/src/models/ExternalApiLogResource.ts +3 -2
- package/src/models/FrontendCartResource.ts +18 -0
- package/src/models/LineItemListResource.ts +46 -10
- package/src/models/ProductChildCartLiteResource.ts +135 -0
- package/src/models/ProductChildCartLiteResourceArrayResponse.ts +73 -0
- package/src/models/StoreResource.ts +3 -2
- package/src/models/index.ts +5 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
# DiscountValueType
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
|
|
10
|
+
## Example
|
|
11
|
+
|
|
12
|
+
```typescript
|
|
13
|
+
import type { DiscountValueType } from '@digital8/lighting-illusions-ts-sdk'
|
|
14
|
+
|
|
15
|
+
// TODO: Update the object below with actual values
|
|
16
|
+
const example = {
|
|
17
|
+
} satisfies DiscountValueType
|
|
18
|
+
|
|
19
|
+
console.log(example)
|
|
20
|
+
|
|
21
|
+
// Convert the instance to a JSON string
|
|
22
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
23
|
+
console.log(exampleJSON)
|
|
24
|
+
|
|
25
|
+
// Parse the JSON string back to an object
|
|
26
|
+
const exampleParsed = JSON.parse(exampleJSON) as DiscountValueType
|
|
27
|
+
console.log(exampleParsed)
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
31
|
+
|
|
32
|
+
|
|
@@ -25,6 +25,8 @@ Name | Type
|
|
|
25
25
|
`billingAddress` | [AddressResource](AddressResource.md)
|
|
26
26
|
`subtotal` | number
|
|
27
27
|
`discountPreview` | number
|
|
28
|
+
`totalSubtotalDiscount` | number
|
|
29
|
+
`totalShippingDiscount` | number
|
|
28
30
|
`shippingEstimate` | number
|
|
29
31
|
`insuranceEstimate` | number
|
|
30
32
|
`status` | string
|
|
@@ -55,6 +57,8 @@ const example = {
|
|
|
55
57
|
"billingAddress": null,
|
|
56
58
|
"subtotal": null,
|
|
57
59
|
"discountPreview": null,
|
|
60
|
+
"totalSubtotalDiscount": null,
|
|
61
|
+
"totalShippingDiscount": null,
|
|
58
62
|
"shippingEstimate": null,
|
|
59
63
|
"insuranceEstimate": null,
|
|
60
64
|
"status": null,
|
|
@@ -9,7 +9,11 @@ Name | Type
|
|
|
9
9
|
`id` | number
|
|
10
10
|
`quantity` | number
|
|
11
11
|
`productPrice` | number
|
|
12
|
-
`
|
|
12
|
+
`productDiscount` | number
|
|
13
|
+
`totalDiscount` | number
|
|
14
|
+
`lineSubtotal` | number
|
|
15
|
+
`discounts` | Array<boolean>
|
|
16
|
+
`productChild` | [ProductChildCartLiteResource](ProductChildCartLiteResource.md)
|
|
13
17
|
|
|
14
18
|
## Example
|
|
15
19
|
|
|
@@ -21,6 +25,10 @@ const example = {
|
|
|
21
25
|
"id": null,
|
|
22
26
|
"quantity": null,
|
|
23
27
|
"productPrice": null,
|
|
28
|
+
"productDiscount": null,
|
|
29
|
+
"totalDiscount": null,
|
|
30
|
+
"lineSubtotal": null,
|
|
31
|
+
"discounts": null,
|
|
24
32
|
"productChild": null,
|
|
25
33
|
} satisfies LineItemListResource
|
|
26
34
|
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
|
|
2
|
+
# ProductChildCartLiteResource
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`id` | number
|
|
10
|
+
`parentId` | number
|
|
11
|
+
`sku` | string
|
|
12
|
+
`model` | string
|
|
13
|
+
`name` | string
|
|
14
|
+
`thumbnail` | [AssetLiteResource](AssetLiteResource.md)
|
|
15
|
+
`label` | [LabelResource](LabelResource.md)
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import type { ProductChildCartLiteResource } from '@digital8/lighting-illusions-ts-sdk'
|
|
21
|
+
|
|
22
|
+
// TODO: Update the object below with actual values
|
|
23
|
+
const example = {
|
|
24
|
+
"id": null,
|
|
25
|
+
"parentId": null,
|
|
26
|
+
"sku": null,
|
|
27
|
+
"model": null,
|
|
28
|
+
"name": null,
|
|
29
|
+
"thumbnail": null,
|
|
30
|
+
"label": null,
|
|
31
|
+
} satisfies ProductChildCartLiteResource
|
|
32
|
+
|
|
33
|
+
console.log(example)
|
|
34
|
+
|
|
35
|
+
// Convert the instance to a JSON string
|
|
36
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
37
|
+
console.log(exampleJSON)
|
|
38
|
+
|
|
39
|
+
// Parse the JSON string back to an object
|
|
40
|
+
const exampleParsed = JSON.parse(exampleJSON) as ProductChildCartLiteResource
|
|
41
|
+
console.log(exampleParsed)
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
45
|
+
|
|
46
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# ProductChildCartLiteResourceArrayResponse
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`data` | [Array<ProductChildCartLiteResource>](ProductChildCartLiteResource.md)
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { ProductChildCartLiteResourceArrayResponse } from '@digital8/lighting-illusions-ts-sdk'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
"data": null,
|
|
19
|
+
} satisfies ProductChildCartLiteResourceArrayResponse
|
|
20
|
+
|
|
21
|
+
console.log(example)
|
|
22
|
+
|
|
23
|
+
// Convert the instance to a JSON string
|
|
24
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
25
|
+
console.log(exampleJSON)
|
|
26
|
+
|
|
27
|
+
// Parse the JSON string back to an object
|
|
28
|
+
const exampleParsed = JSON.parse(exampleJSON) as ProductChildCartLiteResourceArrayResponse
|
|
29
|
+
console.log(exampleParsed)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
33
|
+
|
|
34
|
+
|
package/package.json
CHANGED
package/src/apis/CartsApi.ts
CHANGED
|
@@ -18,6 +18,7 @@ import type {
|
|
|
18
18
|
AdminCartResource,
|
|
19
19
|
AttachCouponCartRequest,
|
|
20
20
|
AttachItemCartRequest,
|
|
21
|
+
DetachCouponCartRequest,
|
|
21
22
|
GenericResponse,
|
|
22
23
|
IndexCartRequest,
|
|
23
24
|
PaginatedCartListResourceResponse,
|
|
@@ -32,6 +33,8 @@ import {
|
|
|
32
33
|
AttachCouponCartRequestToJSON,
|
|
33
34
|
AttachItemCartRequestFromJSON,
|
|
34
35
|
AttachItemCartRequestToJSON,
|
|
36
|
+
DetachCouponCartRequestFromJSON,
|
|
37
|
+
DetachCouponCartRequestToJSON,
|
|
35
38
|
GenericResponseFromJSON,
|
|
36
39
|
GenericResponseToJSON,
|
|
37
40
|
IndexCartRequestFromJSON,
|
|
@@ -60,9 +63,9 @@ export interface DestroyCartRequest {
|
|
|
60
63
|
cart: number;
|
|
61
64
|
}
|
|
62
65
|
|
|
63
|
-
export interface
|
|
66
|
+
export interface DetachCouponCartOperationRequest {
|
|
64
67
|
cart: number;
|
|
65
|
-
|
|
68
|
+
detachCouponCartRequest?: DetachCouponCartRequest;
|
|
66
69
|
}
|
|
67
70
|
|
|
68
71
|
export interface DetachItemCartRequest {
|
|
@@ -246,7 +249,7 @@ export class CartsApi extends runtime.BaseAPI {
|
|
|
246
249
|
/**
|
|
247
250
|
* Creates request options for detachCouponCart without sending the request
|
|
248
251
|
*/
|
|
249
|
-
async detachCouponCartRequestOpts(requestParameters:
|
|
252
|
+
async detachCouponCartRequestOpts(requestParameters: DetachCouponCartOperationRequest): Promise<runtime.RequestOpts> {
|
|
250
253
|
if (requestParameters['cart'] == null) {
|
|
251
254
|
throw new runtime.RequiredError(
|
|
252
255
|
'cart',
|
|
@@ -254,34 +257,29 @@ export class CartsApi extends runtime.BaseAPI {
|
|
|
254
257
|
);
|
|
255
258
|
}
|
|
256
259
|
|
|
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
|
-
|
|
264
260
|
const queryParameters: any = {};
|
|
265
261
|
|
|
266
262
|
const headerParameters: runtime.HTTPHeaders = {};
|
|
267
263
|
|
|
264
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
265
|
+
|
|
268
266
|
|
|
269
|
-
let urlPath = `/admin-api/carts/{cart}/coupons/
|
|
267
|
+
let urlPath = `/admin-api/carts/{cart}/coupons/detach`;
|
|
270
268
|
urlPath = urlPath.replace(`{${"cart"}}`, encodeURIComponent(String(requestParameters['cart'])));
|
|
271
|
-
urlPath = urlPath.replace(`{${"coupon"}}`, encodeURIComponent(String(requestParameters['coupon'])));
|
|
272
269
|
|
|
273
270
|
return {
|
|
274
271
|
path: urlPath,
|
|
275
272
|
method: 'DELETE',
|
|
276
273
|
headers: headerParameters,
|
|
277
274
|
query: queryParameters,
|
|
275
|
+
body: DetachCouponCartRequestToJSON(requestParameters['detachCouponCartRequest']),
|
|
278
276
|
};
|
|
279
277
|
}
|
|
280
278
|
|
|
281
279
|
/**
|
|
282
280
|
* Auto-generated: detachCouponCart
|
|
283
281
|
*/
|
|
284
|
-
async detachCouponCartRaw(requestParameters:
|
|
282
|
+
async detachCouponCartRaw(requestParameters: DetachCouponCartOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AdminCartResource>> {
|
|
285
283
|
const requestOptions = await this.detachCouponCartRequestOpts(requestParameters);
|
|
286
284
|
const response = await this.request(requestOptions, initOverrides);
|
|
287
285
|
|
|
@@ -291,7 +289,7 @@ export class CartsApi extends runtime.BaseAPI {
|
|
|
291
289
|
/**
|
|
292
290
|
* Auto-generated: detachCouponCart
|
|
293
291
|
*/
|
|
294
|
-
async detachCouponCart(requestParameters:
|
|
292
|
+
async detachCouponCart(requestParameters: DetachCouponCartOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AdminCartResource> {
|
|
295
293
|
const response = await this.detachCouponCartRaw(requestParameters, initOverrides);
|
|
296
294
|
return await response.value();
|
|
297
295
|
}
|
|
@@ -30,7 +30,7 @@ export interface AddressResource {
|
|
|
30
30
|
* @type {string}
|
|
31
31
|
* @memberof AddressResource
|
|
32
32
|
*/
|
|
33
|
-
company
|
|
33
|
+
company?: string | null;
|
|
34
34
|
/**
|
|
35
35
|
*
|
|
36
36
|
* @type {string}
|
|
@@ -79,7 +79,6 @@ export interface AddressResource {
|
|
|
79
79
|
* Check if a given object implements the AddressResource interface.
|
|
80
80
|
*/
|
|
81
81
|
export function instanceOfAddressResource(value: object): value is AddressResource {
|
|
82
|
-
if (!('company' in value) || value['company'] === undefined) return false;
|
|
83
82
|
if (!('line1' in value) || value['line1'] === undefined) return false;
|
|
84
83
|
if (!('postcode' in value) || value['postcode'] === undefined) return false;
|
|
85
84
|
if (!('suburb' in value) || value['suburb'] === undefined) return false;
|
|
@@ -100,7 +99,7 @@ export function AddressResourceFromJSONTyped(json: any, ignoreDiscriminator: boo
|
|
|
100
99
|
return {
|
|
101
100
|
|
|
102
101
|
'id': json['id'] == null ? undefined : json['id'],
|
|
103
|
-
'company': json['company'],
|
|
102
|
+
'company': json['company'] == null ? undefined : json['company'],
|
|
104
103
|
'line1': json['line_1'],
|
|
105
104
|
'line2': json['line_2'] == null ? undefined : json['line_2'],
|
|
106
105
|
'postcode': json['postcode'],
|
|
@@ -137,7 +137,7 @@ export interface AdminCartResource {
|
|
|
137
137
|
* @type {number}
|
|
138
138
|
* @memberof AdminCartResource
|
|
139
139
|
*/
|
|
140
|
-
insuranceAmount
|
|
140
|
+
insuranceAmount: number;
|
|
141
141
|
/**
|
|
142
142
|
*
|
|
143
143
|
* @type {boolean}
|
|
@@ -192,6 +192,12 @@ export interface AdminCartResource {
|
|
|
192
192
|
* @memberof AdminCartResource
|
|
193
193
|
*/
|
|
194
194
|
billingAddress: AddressResource | null;
|
|
195
|
+
/**
|
|
196
|
+
*
|
|
197
|
+
* @type {number}
|
|
198
|
+
* @memberof AdminCartResource
|
|
199
|
+
*/
|
|
200
|
+
discountPreview: number;
|
|
195
201
|
/**
|
|
196
202
|
*
|
|
197
203
|
* @type {number}
|
|
@@ -203,19 +209,43 @@ export interface AdminCartResource {
|
|
|
203
209
|
* @type {number}
|
|
204
210
|
* @memberof AdminCartResource
|
|
205
211
|
*/
|
|
206
|
-
|
|
212
|
+
shippingAmount: number;
|
|
213
|
+
/**
|
|
214
|
+
*
|
|
215
|
+
* @type {number}
|
|
216
|
+
* @memberof AdminCartResource
|
|
217
|
+
*/
|
|
218
|
+
total: number;
|
|
219
|
+
/**
|
|
220
|
+
*
|
|
221
|
+
* @type {number}
|
|
222
|
+
* @memberof AdminCartResource
|
|
223
|
+
*/
|
|
224
|
+
discountAmount: number;
|
|
207
225
|
/**
|
|
208
226
|
*
|
|
209
227
|
* @type {number}
|
|
210
228
|
* @memberof AdminCartResource
|
|
211
229
|
*/
|
|
212
|
-
|
|
230
|
+
productDiscountAmount: number;
|
|
213
231
|
/**
|
|
214
232
|
*
|
|
215
233
|
* @type {number}
|
|
216
234
|
* @memberof AdminCartResource
|
|
217
235
|
*/
|
|
218
|
-
|
|
236
|
+
shippingDiscountAmount: number;
|
|
237
|
+
/**
|
|
238
|
+
*
|
|
239
|
+
* @type {number}
|
|
240
|
+
* @memberof AdminCartResource
|
|
241
|
+
*/
|
|
242
|
+
cartDiscountAmount: number;
|
|
243
|
+
/**
|
|
244
|
+
*
|
|
245
|
+
* @type {number}
|
|
246
|
+
* @memberof AdminCartResource
|
|
247
|
+
*/
|
|
248
|
+
finalTotalAmount: number;
|
|
219
249
|
/**
|
|
220
250
|
*
|
|
221
251
|
* @type {string}
|
|
@@ -233,6 +263,7 @@ export function instanceOfAdminCartResource(value: object): value is AdminCartRe
|
|
|
233
263
|
if (!('expiryDate' in value) || value['expiryDate'] === undefined) return false;
|
|
234
264
|
if (!('shippingType' in value) || value['shippingType'] === undefined) return false;
|
|
235
265
|
if (!('overrideShipping' in value) || value['overrideShipping'] === undefined) return false;
|
|
266
|
+
if (!('insuranceAmount' in value) || value['insuranceAmount'] === undefined) return false;
|
|
236
267
|
if (!('overrideInsurance' in value) || value['overrideInsurance'] === undefined) return false;
|
|
237
268
|
if (!('useAsBillingAddress' in value) || value['useAsBillingAddress'] === undefined) return false;
|
|
238
269
|
if (!('admin' in value) || value['admin'] === undefined) return false;
|
|
@@ -242,10 +273,15 @@ export function instanceOfAdminCartResource(value: object): value is AdminCartRe
|
|
|
242
273
|
if (!('coupons' in value) || value['coupons'] === undefined) return false;
|
|
243
274
|
if (!('shippingAddress' in value) || value['shippingAddress'] === undefined) return false;
|
|
244
275
|
if (!('billingAddress' in value) || value['billingAddress'] === undefined) return false;
|
|
245
|
-
if (!('subtotal' in value) || value['subtotal'] === undefined) return false;
|
|
246
276
|
if (!('discountPreview' in value) || value['discountPreview'] === undefined) return false;
|
|
247
|
-
if (!('
|
|
248
|
-
if (!('
|
|
277
|
+
if (!('subtotal' in value) || value['subtotal'] === undefined) return false;
|
|
278
|
+
if (!('shippingAmount' in value) || value['shippingAmount'] === undefined) return false;
|
|
279
|
+
if (!('total' in value) || value['total'] === undefined) return false;
|
|
280
|
+
if (!('discountAmount' in value) || value['discountAmount'] === undefined) return false;
|
|
281
|
+
if (!('productDiscountAmount' in value) || value['productDiscountAmount'] === undefined) return false;
|
|
282
|
+
if (!('shippingDiscountAmount' in value) || value['shippingDiscountAmount'] === undefined) return false;
|
|
283
|
+
if (!('cartDiscountAmount' in value) || value['cartDiscountAmount'] === undefined) return false;
|
|
284
|
+
if (!('finalTotalAmount' in value) || value['finalTotalAmount'] === undefined) return false;
|
|
249
285
|
if (!('status' in value) || value['status'] === undefined) return false;
|
|
250
286
|
return true;
|
|
251
287
|
}
|
|
@@ -274,7 +310,7 @@ export function AdminCartResourceFromJSONTyped(json: any, ignoreDiscriminator: b
|
|
|
274
310
|
'shippingType': json['shipping_type'],
|
|
275
311
|
'shippingSubtotal': json['shipping_subtotal'] == null ? undefined : json['shipping_subtotal'],
|
|
276
312
|
'overrideShipping': json['override_shipping'],
|
|
277
|
-
'insuranceAmount': json['insurance_amount']
|
|
313
|
+
'insuranceAmount': json['insurance_amount'],
|
|
278
314
|
'overrideInsurance': json['override_insurance'],
|
|
279
315
|
'useAsBillingAddress': json['use_as_billing_address'],
|
|
280
316
|
'admin': json['admin'],
|
|
@@ -284,10 +320,15 @@ export function AdminCartResourceFromJSONTyped(json: any, ignoreDiscriminator: b
|
|
|
284
320
|
'coupons': json['coupons'],
|
|
285
321
|
'shippingAddress': AddressResourceFromJSON(json['shipping_address']),
|
|
286
322
|
'billingAddress': AddressResourceFromJSON(json['billing_address']),
|
|
287
|
-
'subtotal': json['subtotal'],
|
|
288
323
|
'discountPreview': json['discount_preview'],
|
|
289
|
-
'
|
|
290
|
-
'
|
|
324
|
+
'subtotal': json['subtotal'],
|
|
325
|
+
'shippingAmount': json['shipping_amount'],
|
|
326
|
+
'total': json['total'],
|
|
327
|
+
'discountAmount': json['discount_amount'],
|
|
328
|
+
'productDiscountAmount': json['product_discount_amount'],
|
|
329
|
+
'shippingDiscountAmount': json['shipping_discount_amount'],
|
|
330
|
+
'cartDiscountAmount': json['cart_discount_amount'],
|
|
331
|
+
'finalTotalAmount': json['final_total_amount'],
|
|
291
332
|
'status': json['status'],
|
|
292
333
|
};
|
|
293
334
|
}
|
|
@@ -327,10 +368,15 @@ export function AdminCartResourceToJSONTyped(value?: AdminCartResource | null, i
|
|
|
327
368
|
'coupons': value['coupons'],
|
|
328
369
|
'shipping_address': AddressResourceToJSON(value['shippingAddress']),
|
|
329
370
|
'billing_address': AddressResourceToJSON(value['billingAddress']),
|
|
330
|
-
'subtotal': value['subtotal'],
|
|
331
371
|
'discount_preview': value['discountPreview'],
|
|
332
|
-
'
|
|
333
|
-
'
|
|
372
|
+
'subtotal': value['subtotal'],
|
|
373
|
+
'shipping_amount': value['shippingAmount'],
|
|
374
|
+
'total': value['total'],
|
|
375
|
+
'discount_amount': value['discountAmount'],
|
|
376
|
+
'product_discount_amount': value['productDiscountAmount'],
|
|
377
|
+
'shipping_discount_amount': value['shippingDiscountAmount'],
|
|
378
|
+
'cart_discount_amount': value['cartDiscountAmount'],
|
|
379
|
+
'final_total_amount': value['finalTotalAmount'],
|
|
334
380
|
'status': value['status'],
|
|
335
381
|
};
|
|
336
382
|
}
|
|
@@ -21,17 +21,17 @@ import { mapValues } from '../runtime';
|
|
|
21
21
|
export interface AttachCouponCartRequest {
|
|
22
22
|
/**
|
|
23
23
|
*
|
|
24
|
-
* @type {number}
|
|
24
|
+
* @type {Array<number>}
|
|
25
25
|
* @memberof AttachCouponCartRequest
|
|
26
26
|
*/
|
|
27
|
-
|
|
27
|
+
couponIds: Array<number>;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Check if a given object implements the AttachCouponCartRequest interface.
|
|
32
32
|
*/
|
|
33
33
|
export function instanceOfAttachCouponCartRequest(value: object): value is AttachCouponCartRequest {
|
|
34
|
-
if (!('
|
|
34
|
+
if (!('couponIds' in value) || value['couponIds'] === undefined) return false;
|
|
35
35
|
return true;
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -45,7 +45,7 @@ export function AttachCouponCartRequestFromJSONTyped(json: any, ignoreDiscrimina
|
|
|
45
45
|
}
|
|
46
46
|
return {
|
|
47
47
|
|
|
48
|
-
'
|
|
48
|
+
'couponIds': json['coupon_ids'],
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -60,7 +60,7 @@ export function AttachCouponCartRequestToJSONTyped(value?: AttachCouponCartReque
|
|
|
60
60
|
|
|
61
61
|
return {
|
|
62
62
|
|
|
63
|
-
'
|
|
63
|
+
'coupon_ids': value['couponIds'],
|
|
64
64
|
};
|
|
65
65
|
}
|
|
66
66
|
|
|
@@ -0,0 +1,66 @@
|
|
|
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
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
* @interface DetachCouponCartRequest
|
|
20
|
+
*/
|
|
21
|
+
export interface DetachCouponCartRequest {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {Array<number>}
|
|
25
|
+
* @memberof DetachCouponCartRequest
|
|
26
|
+
*/
|
|
27
|
+
couponIds: Array<number>;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Check if a given object implements the DetachCouponCartRequest interface.
|
|
32
|
+
*/
|
|
33
|
+
export function instanceOfDetachCouponCartRequest(value: object): value is DetachCouponCartRequest {
|
|
34
|
+
if (!('couponIds' in value) || value['couponIds'] === undefined) return false;
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function DetachCouponCartRequestFromJSON(json: any): DetachCouponCartRequest {
|
|
39
|
+
return DetachCouponCartRequestFromJSONTyped(json, false);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function DetachCouponCartRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): DetachCouponCartRequest {
|
|
43
|
+
if (json == null) {
|
|
44
|
+
return json;
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
|
|
48
|
+
'couponIds': json['coupon_ids'],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function DetachCouponCartRequestToJSON(json: any): DetachCouponCartRequest {
|
|
53
|
+
return DetachCouponCartRequestToJSONTyped(json, false);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function DetachCouponCartRequestToJSONTyped(value?: DetachCouponCartRequest | null, ignoreDiscriminator: boolean = false): any {
|
|
57
|
+
if (value == null) {
|
|
58
|
+
return value;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
return {
|
|
62
|
+
|
|
63
|
+
'coupon_ids': value['couponIds'],
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
@@ -0,0 +1,54 @@
|
|
|
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
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
*/
|
|
20
|
+
export const DiscountType = {
|
|
21
|
+
Shipping: 'shipping',
|
|
22
|
+
Subtotal: 'subtotal',
|
|
23
|
+
Product: 'product'
|
|
24
|
+
} as const;
|
|
25
|
+
export type DiscountType = typeof DiscountType[keyof typeof DiscountType];
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
export function instanceOfDiscountType(value: any): boolean {
|
|
29
|
+
for (const key in DiscountType) {
|
|
30
|
+
if (Object.prototype.hasOwnProperty.call(DiscountType, key)) {
|
|
31
|
+
if (DiscountType[key as keyof typeof DiscountType] === value) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function DiscountTypeFromJSON(json: any): DiscountType {
|
|
40
|
+
return DiscountTypeFromJSONTyped(json, false);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function DiscountTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): DiscountType {
|
|
44
|
+
return json as DiscountType;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function DiscountTypeToJSON(value?: DiscountType | null): any {
|
|
48
|
+
return value as any;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function DiscountTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): DiscountType {
|
|
52
|
+
return value as DiscountType;
|
|
53
|
+
}
|
|
54
|
+
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @export
|
|
19
|
+
*/
|
|
20
|
+
export const DiscountValueType = {
|
|
21
|
+
FixedValue: 'fixed_value',
|
|
22
|
+
Percentage: 'percentage'
|
|
23
|
+
} as const;
|
|
24
|
+
export type DiscountValueType = typeof DiscountValueType[keyof typeof DiscountValueType];
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
export function instanceOfDiscountValueType(value: any): boolean {
|
|
28
|
+
for (const key in DiscountValueType) {
|
|
29
|
+
if (Object.prototype.hasOwnProperty.call(DiscountValueType, key)) {
|
|
30
|
+
if (DiscountValueType[key as keyof typeof DiscountValueType] === value) {
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function DiscountValueTypeFromJSON(json: any): DiscountValueType {
|
|
39
|
+
return DiscountValueTypeFromJSONTyped(json, false);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export function DiscountValueTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): DiscountValueType {
|
|
43
|
+
return json as DiscountValueType;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function DiscountValueTypeToJSON(value?: DiscountValueType | null): any {
|
|
47
|
+
return value as any;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function DiscountValueTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): DiscountValueType {
|
|
51
|
+
return value as DiscountValueType;
|
|
52
|
+
}
|
|
53
|
+
|
|
@@ -74,7 +74,7 @@ export interface ExternalApiLogResource {
|
|
|
74
74
|
* @type {string}
|
|
75
75
|
* @memberof ExternalApiLogResource
|
|
76
76
|
*/
|
|
77
|
-
requestPayload
|
|
77
|
+
requestPayload: string;
|
|
78
78
|
/**
|
|
79
79
|
*
|
|
80
80
|
* @type {string}
|
|
@@ -106,6 +106,7 @@ export function instanceOfExternalApiLogResource(value: object): value is Extern
|
|
|
106
106
|
if (!('exteranlApiLoggableId' in value) || value['exteranlApiLoggableId'] === undefined) return false;
|
|
107
107
|
if (!('endpoint' in value) || value['endpoint'] === undefined) return false;
|
|
108
108
|
if (!('responseCode' in value) || value['responseCode'] === undefined) return false;
|
|
109
|
+
if (!('requestPayload' in value) || value['requestPayload'] === undefined) return false;
|
|
109
110
|
if (!('responsePayload' in value) || value['responsePayload'] === undefined) return false;
|
|
110
111
|
if (!('site' in value) || value['site'] === undefined) return false;
|
|
111
112
|
return true;
|
|
@@ -128,7 +129,7 @@ export function ExternalApiLogResourceFromJSONTyped(json: any, ignoreDiscriminat
|
|
|
128
129
|
'exteranlApiLoggableId': json['exteranlApiLoggableId'],
|
|
129
130
|
'endpoint': json['endpoint'],
|
|
130
131
|
'responseCode': json['responseCode'],
|
|
131
|
-
'requestPayload': json['requestPayload']
|
|
132
|
+
'requestPayload': json['requestPayload'],
|
|
132
133
|
'responsePayload': json['responsePayload'],
|
|
133
134
|
'createdAt': json['createdAt'] == null ? undefined : json['createdAt'],
|
|
134
135
|
'site': SiteLiteResourceFromJSON(json['site']),
|