@digital8/lighting-illusions-ts-sdk 0.0.1838 → 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.
- package/.openapi-generator/FILES +10 -0
- package/README.md +7 -2
- package/dist/apis/CouponsApi.d.ts +33 -0
- package/dist/apis/CouponsApi.js +138 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/models/AddressResource.d.ts +2 -2
- package/dist/models/AddressResource.js +4 -4
- package/dist/models/ExternalApiLogResource.d.ts +1 -1
- package/dist/models/ExternalApiLogResource.js +3 -1
- package/dist/models/StoreFrontendResource.d.ts +1 -1
- package/dist/models/StoreFrontendResource.js +1 -3
- package/dist/models/StoreListResource.d.ts +1 -1
- package/dist/models/StoreListResource.js +3 -1
- package/dist/models/StoreResource.d.ts +1 -1
- package/dist/models/StoreResource.js +1 -3
- package/dist/models/StoreSpecialDateFrontendResource.d.ts +2 -2
- package/dist/models/StoreSpecialDateFrontendResource.js +1 -3
- package/dist/models/VerifyCouponRequest.d.ts +63 -0
- package/dist/models/VerifyCouponRequest.js +64 -0
- package/dist/models/VerifyCouponRequestProductsInner.d.ts +38 -0
- package/dist/models/VerifyCouponRequestProductsInner.js +51 -0
- package/dist/models/VerifyCouponResource.d.ts +38 -0
- package/dist/models/VerifyCouponResource.js +55 -0
- package/dist/models/VerifyCouponResourceArrayResponse.d.ts +33 -0
- package/dist/models/VerifyCouponResourceArrayResponse.js +50 -0
- package/dist/models/index.d.ts +4 -0
- package/dist/models/index.js +4 -0
- package/docs/CouponsApi.md +74 -0
- package/docs/StoreSpecialDateFrontendResource.md +1 -1
- package/docs/VerifyCouponRequest.md +44 -0
- package/docs/VerifyCouponRequestProductsInner.md +36 -0
- package/docs/VerifyCouponResource.md +36 -0
- package/docs/VerifyCouponResourceArrayResponse.md +34 -0
- package/package.json +1 -1
- package/src/apis/CouponsApi.ts +77 -0
- package/src/apis/index.ts +1 -0
- package/src/models/AddressResource.ts +5 -5
- package/src/models/ExternalApiLogResource.ts +3 -2
- package/src/models/StoreFrontendResource.ts +2 -3
- package/src/models/StoreListResource.ts +3 -2
- package/src/models/StoreResource.ts +2 -3
- package/src/models/StoreSpecialDateFrontendResource.ts +3 -4
- package/src/models/VerifyCouponRequest.ts +115 -0
- package/src/models/VerifyCouponRequestProductsInner.ts +73 -0
- package/src/models/VerifyCouponResource.ts +75 -0
- package/src/models/VerifyCouponResourceArrayResponse.ts +73 -0
- package/src/models/index.ts +4 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* My API
|
|
6
|
+
* API documentation for my Laravel app
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.instanceOfVerifyCouponRequestProductsInner = instanceOfVerifyCouponRequestProductsInner;
|
|
17
|
+
exports.VerifyCouponRequestProductsInnerFromJSON = VerifyCouponRequestProductsInnerFromJSON;
|
|
18
|
+
exports.VerifyCouponRequestProductsInnerFromJSONTyped = VerifyCouponRequestProductsInnerFromJSONTyped;
|
|
19
|
+
exports.VerifyCouponRequestProductsInnerToJSON = VerifyCouponRequestProductsInnerToJSON;
|
|
20
|
+
exports.VerifyCouponRequestProductsInnerToJSONTyped = VerifyCouponRequestProductsInnerToJSONTyped;
|
|
21
|
+
/**
|
|
22
|
+
* Check if a given object implements the VerifyCouponRequestProductsInner interface.
|
|
23
|
+
*/
|
|
24
|
+
function instanceOfVerifyCouponRequestProductsInner(value) {
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
function VerifyCouponRequestProductsInnerFromJSON(json) {
|
|
28
|
+
return VerifyCouponRequestProductsInnerFromJSONTyped(json, false);
|
|
29
|
+
}
|
|
30
|
+
function VerifyCouponRequestProductsInnerFromJSONTyped(json, ignoreDiscriminator) {
|
|
31
|
+
if (json == null) {
|
|
32
|
+
return json;
|
|
33
|
+
}
|
|
34
|
+
return {
|
|
35
|
+
'productChildId': json['product_child_id'] == null ? undefined : json['product_child_id'],
|
|
36
|
+
'quantity': json['quantity'] == null ? undefined : json['quantity'],
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function VerifyCouponRequestProductsInnerToJSON(json) {
|
|
40
|
+
return VerifyCouponRequestProductsInnerToJSONTyped(json, false);
|
|
41
|
+
}
|
|
42
|
+
function VerifyCouponRequestProductsInnerToJSONTyped(value, ignoreDiscriminator) {
|
|
43
|
+
if (ignoreDiscriminator === void 0) { ignoreDiscriminator = false; }
|
|
44
|
+
if (value == null) {
|
|
45
|
+
return value;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
'product_child_id': value['productChildId'],
|
|
49
|
+
'quantity': value['quantity'],
|
|
50
|
+
};
|
|
51
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* My API
|
|
3
|
+
* API documentation for my Laravel app
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
*
|
|
14
|
+
* @export
|
|
15
|
+
* @interface VerifyCouponResource
|
|
16
|
+
*/
|
|
17
|
+
export interface VerifyCouponResource {
|
|
18
|
+
/**
|
|
19
|
+
*
|
|
20
|
+
* @type {number}
|
|
21
|
+
* @memberof VerifyCouponResource
|
|
22
|
+
*/
|
|
23
|
+
couponId: number;
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @type {number}
|
|
27
|
+
* @memberof VerifyCouponResource
|
|
28
|
+
*/
|
|
29
|
+
discountAmount: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Check if a given object implements the VerifyCouponResource interface.
|
|
33
|
+
*/
|
|
34
|
+
export declare function instanceOfVerifyCouponResource(value: object): value is VerifyCouponResource;
|
|
35
|
+
export declare function VerifyCouponResourceFromJSON(json: any): VerifyCouponResource;
|
|
36
|
+
export declare function VerifyCouponResourceFromJSONTyped(json: any, ignoreDiscriminator: boolean): VerifyCouponResource;
|
|
37
|
+
export declare function VerifyCouponResourceToJSON(json: any): VerifyCouponResource;
|
|
38
|
+
export declare function VerifyCouponResourceToJSONTyped(value?: VerifyCouponResource | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* My API
|
|
6
|
+
* API documentation for my Laravel app
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.instanceOfVerifyCouponResource = instanceOfVerifyCouponResource;
|
|
17
|
+
exports.VerifyCouponResourceFromJSON = VerifyCouponResourceFromJSON;
|
|
18
|
+
exports.VerifyCouponResourceFromJSONTyped = VerifyCouponResourceFromJSONTyped;
|
|
19
|
+
exports.VerifyCouponResourceToJSON = VerifyCouponResourceToJSON;
|
|
20
|
+
exports.VerifyCouponResourceToJSONTyped = VerifyCouponResourceToJSONTyped;
|
|
21
|
+
/**
|
|
22
|
+
* Check if a given object implements the VerifyCouponResource interface.
|
|
23
|
+
*/
|
|
24
|
+
function instanceOfVerifyCouponResource(value) {
|
|
25
|
+
if (!('couponId' in value) || value['couponId'] === undefined)
|
|
26
|
+
return false;
|
|
27
|
+
if (!('discountAmount' in value) || value['discountAmount'] === undefined)
|
|
28
|
+
return false;
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
function VerifyCouponResourceFromJSON(json) {
|
|
32
|
+
return VerifyCouponResourceFromJSONTyped(json, false);
|
|
33
|
+
}
|
|
34
|
+
function VerifyCouponResourceFromJSONTyped(json, ignoreDiscriminator) {
|
|
35
|
+
if (json == null) {
|
|
36
|
+
return json;
|
|
37
|
+
}
|
|
38
|
+
return {
|
|
39
|
+
'couponId': json['coupon_id'],
|
|
40
|
+
'discountAmount': json['discount_amount'],
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function VerifyCouponResourceToJSON(json) {
|
|
44
|
+
return VerifyCouponResourceToJSONTyped(json, false);
|
|
45
|
+
}
|
|
46
|
+
function VerifyCouponResourceToJSONTyped(value, ignoreDiscriminator) {
|
|
47
|
+
if (ignoreDiscriminator === void 0) { ignoreDiscriminator = false; }
|
|
48
|
+
if (value == null) {
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
return {
|
|
52
|
+
'coupon_id': value['couponId'],
|
|
53
|
+
'discount_amount': value['discountAmount'],
|
|
54
|
+
};
|
|
55
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* My API
|
|
3
|
+
* API documentation for my Laravel app
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 1.0.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { VerifyCouponResource } from './VerifyCouponResource';
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @export
|
|
16
|
+
* @interface VerifyCouponResourceArrayResponse
|
|
17
|
+
*/
|
|
18
|
+
export interface VerifyCouponResourceArrayResponse {
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @type {Array<VerifyCouponResource>}
|
|
22
|
+
* @memberof VerifyCouponResourceArrayResponse
|
|
23
|
+
*/
|
|
24
|
+
data?: Array<VerifyCouponResource>;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Check if a given object implements the VerifyCouponResourceArrayResponse interface.
|
|
28
|
+
*/
|
|
29
|
+
export declare function instanceOfVerifyCouponResourceArrayResponse(value: object): value is VerifyCouponResourceArrayResponse;
|
|
30
|
+
export declare function VerifyCouponResourceArrayResponseFromJSON(json: any): VerifyCouponResourceArrayResponse;
|
|
31
|
+
export declare function VerifyCouponResourceArrayResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): VerifyCouponResourceArrayResponse;
|
|
32
|
+
export declare function VerifyCouponResourceArrayResponseToJSON(json: any): VerifyCouponResourceArrayResponse;
|
|
33
|
+
export declare function VerifyCouponResourceArrayResponseToJSONTyped(value?: VerifyCouponResourceArrayResponse | null, ignoreDiscriminator?: boolean): any;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* My API
|
|
6
|
+
* API documentation for my Laravel app
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
*
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.instanceOfVerifyCouponResourceArrayResponse = instanceOfVerifyCouponResourceArrayResponse;
|
|
17
|
+
exports.VerifyCouponResourceArrayResponseFromJSON = VerifyCouponResourceArrayResponseFromJSON;
|
|
18
|
+
exports.VerifyCouponResourceArrayResponseFromJSONTyped = VerifyCouponResourceArrayResponseFromJSONTyped;
|
|
19
|
+
exports.VerifyCouponResourceArrayResponseToJSON = VerifyCouponResourceArrayResponseToJSON;
|
|
20
|
+
exports.VerifyCouponResourceArrayResponseToJSONTyped = VerifyCouponResourceArrayResponseToJSONTyped;
|
|
21
|
+
var VerifyCouponResource_1 = require("./VerifyCouponResource");
|
|
22
|
+
/**
|
|
23
|
+
* Check if a given object implements the VerifyCouponResourceArrayResponse interface.
|
|
24
|
+
*/
|
|
25
|
+
function instanceOfVerifyCouponResourceArrayResponse(value) {
|
|
26
|
+
return true;
|
|
27
|
+
}
|
|
28
|
+
function VerifyCouponResourceArrayResponseFromJSON(json) {
|
|
29
|
+
return VerifyCouponResourceArrayResponseFromJSONTyped(json, false);
|
|
30
|
+
}
|
|
31
|
+
function VerifyCouponResourceArrayResponseFromJSONTyped(json, ignoreDiscriminator) {
|
|
32
|
+
if (json == null) {
|
|
33
|
+
return json;
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
'data': json['data'] == null ? undefined : (json['data'].map(VerifyCouponResource_1.VerifyCouponResourceFromJSON)),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
function VerifyCouponResourceArrayResponseToJSON(json) {
|
|
40
|
+
return VerifyCouponResourceArrayResponseToJSONTyped(json, false);
|
|
41
|
+
}
|
|
42
|
+
function VerifyCouponResourceArrayResponseToJSONTyped(value, ignoreDiscriminator) {
|
|
43
|
+
if (ignoreDiscriminator === void 0) { ignoreDiscriminator = false; }
|
|
44
|
+
if (value == null) {
|
|
45
|
+
return value;
|
|
46
|
+
}
|
|
47
|
+
return {
|
|
48
|
+
'data': value['data'] == null ? undefined : (value['data'].map(VerifyCouponResource_1.VerifyCouponResourceToJSON)),
|
|
49
|
+
};
|
|
50
|
+
}
|
package/dist/models/index.d.ts
CHANGED
|
@@ -461,6 +461,10 @@ export * from './UpdateStoreRequest';
|
|
|
461
461
|
export * from './UpdateStoreRequestSpecialDatesInner';
|
|
462
462
|
export * from './UpdateSupplierRequest';
|
|
463
463
|
export * from './UpdateTagRequest';
|
|
464
|
+
export * from './VerifyCouponRequest';
|
|
465
|
+
export * from './VerifyCouponRequestProductsInner';
|
|
466
|
+
export * from './VerifyCouponResource';
|
|
467
|
+
export * from './VerifyCouponResourceArrayResponse';
|
|
464
468
|
export * from './WishlistCheckResource';
|
|
465
469
|
export * from './WishlistCheckResourceArrayResponse';
|
|
466
470
|
export * from './WishlistToggleResource';
|
package/dist/models/index.js
CHANGED
|
@@ -479,6 +479,10 @@ __exportStar(require("./UpdateStoreRequest"), exports);
|
|
|
479
479
|
__exportStar(require("./UpdateStoreRequestSpecialDatesInner"), exports);
|
|
480
480
|
__exportStar(require("./UpdateSupplierRequest"), exports);
|
|
481
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);
|
|
482
486
|
__exportStar(require("./WishlistCheckResource"), exports);
|
|
483
487
|
__exportStar(require("./WishlistCheckResourceArrayResponse"), exports);
|
|
484
488
|
__exportStar(require("./WishlistToggleResource"), exports);
|
|
@@ -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
|
+
|
|
@@ -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
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# VerifyCouponRequestProductsInner
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`productChildId` | number
|
|
10
|
+
`quantity` | number
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { VerifyCouponRequestProductsInner } from '@digital8/lighting-illusions-ts-sdk'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"productChildId": null,
|
|
20
|
+
"quantity": null,
|
|
21
|
+
} satisfies VerifyCouponRequestProductsInner
|
|
22
|
+
|
|
23
|
+
console.log(example)
|
|
24
|
+
|
|
25
|
+
// Convert the instance to a JSON string
|
|
26
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
27
|
+
console.log(exampleJSON)
|
|
28
|
+
|
|
29
|
+
// Parse the JSON string back to an object
|
|
30
|
+
const exampleParsed = JSON.parse(exampleJSON) as VerifyCouponRequestProductsInner
|
|
31
|
+
console.log(exampleParsed)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
35
|
+
|
|
36
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# VerifyCouponResource
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`couponId` | number
|
|
10
|
+
`discountAmount` | number
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { VerifyCouponResource } from '@digital8/lighting-illusions-ts-sdk'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"couponId": null,
|
|
20
|
+
"discountAmount": null,
|
|
21
|
+
} satisfies VerifyCouponResource
|
|
22
|
+
|
|
23
|
+
console.log(example)
|
|
24
|
+
|
|
25
|
+
// Convert the instance to a JSON string
|
|
26
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
27
|
+
console.log(exampleJSON)
|
|
28
|
+
|
|
29
|
+
// Parse the JSON string back to an object
|
|
30
|
+
const exampleParsed = JSON.parse(exampleJSON) as VerifyCouponResource
|
|
31
|
+
console.log(exampleParsed)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
35
|
+
|
|
36
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# VerifyCouponResourceArrayResponse
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`data` | [Array<VerifyCouponResource>](VerifyCouponResource.md)
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { VerifyCouponResourceArrayResponse } from '@digital8/lighting-illusions-ts-sdk'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
"data": null,
|
|
19
|
+
} satisfies VerifyCouponResourceArrayResponse
|
|
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 VerifyCouponResourceArrayResponse
|
|
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
|
@@ -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
|
@@ -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}
|
|
@@ -42,7 +42,7 @@ export interface AddressResource {
|
|
|
42
42
|
* @type {string}
|
|
43
43
|
* @memberof AddressResource
|
|
44
44
|
*/
|
|
45
|
-
line2
|
|
45
|
+
line2: string;
|
|
46
46
|
/**
|
|
47
47
|
*
|
|
48
48
|
* @type {string}
|
|
@@ -79,8 +79,8 @@ 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;
|
|
83
|
+
if (!('line2' in value) || value['line2'] === undefined) return false;
|
|
84
84
|
if (!('postcode' in value) || value['postcode'] === undefined) return false;
|
|
85
85
|
if (!('suburb' in value) || value['suburb'] === undefined) return false;
|
|
86
86
|
if (!('country' in value) || value['country'] === undefined) return false;
|
|
@@ -100,9 +100,9 @@ export function AddressResourceFromJSONTyped(json: any, ignoreDiscriminator: boo
|
|
|
100
100
|
return {
|
|
101
101
|
|
|
102
102
|
'id': json['id'] == null ? undefined : json['id'],
|
|
103
|
-
'company': json['company'],
|
|
103
|
+
'company': json['company'] == null ? undefined : json['company'],
|
|
104
104
|
'line1': json['line_1'],
|
|
105
|
-
'line2': json['line_2']
|
|
105
|
+
'line2': json['line_2'],
|
|
106
106
|
'postcode': json['postcode'],
|
|
107
107
|
'suburb': json['suburb'],
|
|
108
108
|
'country': json['country'],
|
|
@@ -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']),
|