@digital8/lighting-illusions-ts-sdk 0.0.2358 → 0.0.2360
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 +30 -0
- package/README.md +22 -2
- package/dist/apis/CouponsApi.d.ts +116 -0
- package/dist/apis/CouponsApi.js +440 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/models/AddressFrontendResource.d.ts +1 -1
- package/dist/models/AddressFrontendResource.js +3 -1
- package/dist/models/AddressResource.d.ts +2 -2
- package/dist/models/AddressResource.js +4 -4
- package/dist/models/CouponListResource.d.ts +99 -0
- package/dist/models/CouponListResource.js +90 -0
- package/dist/models/CouponListResourceArrayResponse.d.ts +33 -0
- package/dist/models/CouponListResourceArrayResponse.js +50 -0
- package/dist/models/CouponLiteResource.d.ts +44 -0
- package/dist/models/CouponLiteResource.js +57 -0
- package/dist/models/CouponLiteResourceArrayResponse.d.ts +33 -0
- package/dist/models/CouponLiteResourceArrayResponse.js +50 -0
- package/dist/models/CouponResource.d.ts +163 -0
- package/dist/models/CouponResource.js +134 -0
- package/dist/models/CouponResourceArrayResponse.d.ts +33 -0
- package/dist/models/CouponResourceArrayResponse.js +50 -0
- package/dist/models/CouponType.d.ts +26 -0
- package/dist/models/CouponType.js +52 -0
- package/dist/models/CreateCouponRequest.d.ts +134 -0
- package/dist/models/CreateCouponRequest.js +114 -0
- package/dist/models/CreateCouponRequestCouponablesInner.d.ts +48 -0
- package/dist/models/CreateCouponRequestCouponablesInner.js +61 -0
- package/dist/models/ExternalApiLogResource.d.ts +1 -1
- package/dist/models/ExternalApiLogResource.js +1 -3
- package/dist/models/OrderFulfillmentResource.d.ts +3 -3
- package/dist/models/OrderFulfillmentResource.js +4 -6
- package/dist/models/PaginatedCouponListResourceResponse.d.ts +40 -0
- package/dist/models/PaginatedCouponListResourceResponse.js +57 -0
- package/dist/models/PaginatedCouponResourceResponse.d.ts +40 -0
- package/dist/models/PaginatedCouponResourceResponse.js +57 -0
- package/dist/models/SearchAllCouponsRequest.d.ts +101 -0
- package/dist/models/SearchAllCouponsRequest.js +85 -0
- package/dist/models/SearchCartsRequest.d.ts +6 -0
- package/dist/models/SearchCartsRequest.js +2 -0
- package/dist/models/SearchCouponsRequest.d.ts +137 -0
- package/dist/models/SearchCouponsRequest.js +97 -0
- package/dist/models/SearchOrdersRequest.d.ts +6 -0
- package/dist/models/SearchOrdersRequest.js +2 -0
- package/dist/models/StoreFrontendResource.d.ts +2 -2
- package/dist/models/StoreFrontendResource.js +4 -4
- 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 +3 -1
- package/dist/models/UpdateCouponRequest.d.ts +128 -0
- package/dist/models/UpdateCouponRequest.js +110 -0
- package/dist/models/index.d.ts +14 -0
- package/dist/models/index.js +14 -0
- package/docs/CouponListResource.md +56 -0
- package/docs/CouponListResourceArrayResponse.md +34 -0
- package/docs/CouponLiteResource.md +38 -0
- package/docs/CouponLiteResourceArrayResponse.md +34 -0
- package/docs/CouponResource.md +76 -0
- package/docs/CouponResourceArrayResponse.md +34 -0
- package/docs/CouponType.md +32 -0
- package/docs/CouponsApi.md +407 -0
- package/docs/CreateCouponRequest.md +62 -0
- package/docs/CreateCouponRequestCouponablesInner.md +36 -0
- package/docs/PaginatedCouponListResourceResponse.md +36 -0
- package/docs/PaginatedCouponResourceResponse.md +36 -0
- package/docs/SearchAllCouponsRequest.md +50 -0
- package/docs/SearchCartsRequest.md +2 -0
- package/docs/SearchCouponsRequest.md +62 -0
- package/docs/SearchOrdersRequest.md +2 -0
- package/docs/UpdateCouponRequest.md +60 -0
- package/package.json +1 -1
- package/src/apis/CouponsApi.ts +345 -0
- package/src/apis/index.ts +1 -0
- package/src/models/AddressFrontendResource.ts +3 -2
- package/src/models/AddressResource.ts +5 -5
- package/src/models/CouponListResource.ts +170 -0
- package/src/models/CouponListResourceArrayResponse.ts +73 -0
- package/src/models/CouponLiteResource.ts +83 -0
- package/src/models/CouponLiteResourceArrayResponse.ts +73 -0
- package/src/models/CouponResource.ts +288 -0
- package/src/models/CouponResourceArrayResponse.ts +73 -0
- package/src/models/CouponType.ts +54 -0
- package/src/models/CreateCouponRequest.ts +216 -0
- package/src/models/CreateCouponRequestCouponablesInner.ts +86 -0
- package/src/models/ExternalApiLogResource.ts +2 -3
- package/src/models/OrderFulfillmentResource.ts +7 -8
- package/src/models/PaginatedCouponListResourceResponse.ts +90 -0
- package/src/models/PaginatedCouponResourceResponse.ts +90 -0
- package/src/models/SearchAllCouponsRequest.ts +154 -0
- package/src/models/SearchCartsRequest.ts +8 -0
- package/src/models/SearchCouponsRequest.ts +202 -0
- package/src/models/SearchOrdersRequest.ts +8 -0
- package/src/models/StoreFrontendResource.ts +5 -5
- package/src/models/StoreListResource.ts +3 -2
- package/src/models/StoreResource.ts +3 -2
- package/src/models/UpdateCouponRequest.ts +207 -0
- package/src/models/index.ts +14 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
|
|
2
|
+
# SearchCouponsRequest
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`search` | string
|
|
10
|
+
`sortBy` | string
|
|
11
|
+
`sortDirection` | string
|
|
12
|
+
`perPage` | number
|
|
13
|
+
`page` | number
|
|
14
|
+
`type` | Array<string>
|
|
15
|
+
`siteId` | Array<string>
|
|
16
|
+
`isAbandonedCart` | Array<string>
|
|
17
|
+
`beforeStartDate` | Date
|
|
18
|
+
`afterStartDate` | Date
|
|
19
|
+
`beforeEndDate` | Date
|
|
20
|
+
`afterEndDate` | Date
|
|
21
|
+
`relatedId` | number
|
|
22
|
+
`relatedType` | string
|
|
23
|
+
`includesRelations` | boolean
|
|
24
|
+
|
|
25
|
+
## Example
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import type { SearchCouponsRequest } from '@digital8/lighting-illusions-ts-sdk'
|
|
29
|
+
|
|
30
|
+
// TODO: Update the object below with actual values
|
|
31
|
+
const example = {
|
|
32
|
+
"search": null,
|
|
33
|
+
"sortBy": null,
|
|
34
|
+
"sortDirection": null,
|
|
35
|
+
"perPage": null,
|
|
36
|
+
"page": null,
|
|
37
|
+
"type": null,
|
|
38
|
+
"siteId": null,
|
|
39
|
+
"isAbandonedCart": null,
|
|
40
|
+
"beforeStartDate": null,
|
|
41
|
+
"afterStartDate": null,
|
|
42
|
+
"beforeEndDate": null,
|
|
43
|
+
"afterEndDate": null,
|
|
44
|
+
"relatedId": null,
|
|
45
|
+
"relatedType": null,
|
|
46
|
+
"includesRelations": null,
|
|
47
|
+
} satisfies SearchCouponsRequest
|
|
48
|
+
|
|
49
|
+
console.log(example)
|
|
50
|
+
|
|
51
|
+
// Convert the instance to a JSON string
|
|
52
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
53
|
+
console.log(exampleJSON)
|
|
54
|
+
|
|
55
|
+
// Parse the JSON string back to an object
|
|
56
|
+
const exampleParsed = JSON.parse(exampleJSON) as SearchCouponsRequest
|
|
57
|
+
console.log(exampleParsed)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
61
|
+
|
|
62
|
+
|
|
@@ -25,6 +25,7 @@ Name | Type
|
|
|
25
25
|
`relatedId` | number
|
|
26
26
|
`relatedType` | string
|
|
27
27
|
`includesRelations` | boolean
|
|
28
|
+
`couponId` | number
|
|
28
29
|
|
|
29
30
|
## Example
|
|
30
31
|
|
|
@@ -52,6 +53,7 @@ const example = {
|
|
|
52
53
|
"relatedId": null,
|
|
53
54
|
"relatedType": null,
|
|
54
55
|
"includesRelations": null,
|
|
56
|
+
"couponId": null,
|
|
55
57
|
} satisfies SearchOrdersRequest
|
|
56
58
|
|
|
57
59
|
console.log(example)
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
|
|
2
|
+
# UpdateCouponRequest
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`name` | string
|
|
10
|
+
`code` | string
|
|
11
|
+
`type` | string
|
|
12
|
+
`discountType` | string
|
|
13
|
+
`discountAmount` | number
|
|
14
|
+
`minAmount` | number
|
|
15
|
+
`minProducts` | number
|
|
16
|
+
`totalUseLimit` | number
|
|
17
|
+
`customerUseLimit` | number
|
|
18
|
+
`startDate` | string
|
|
19
|
+
`endDate` | string
|
|
20
|
+
`isForAllProducts` | boolean
|
|
21
|
+
`isForAllCustomers` | boolean
|
|
22
|
+
`couponables` | [Array<CreateCouponRequestCouponablesInner>](CreateCouponRequestCouponablesInner.md)
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import type { UpdateCouponRequest } from '@digital8/lighting-illusions-ts-sdk'
|
|
28
|
+
|
|
29
|
+
// TODO: Update the object below with actual values
|
|
30
|
+
const example = {
|
|
31
|
+
"name": null,
|
|
32
|
+
"code": null,
|
|
33
|
+
"type": null,
|
|
34
|
+
"discountType": null,
|
|
35
|
+
"discountAmount": null,
|
|
36
|
+
"minAmount": null,
|
|
37
|
+
"minProducts": null,
|
|
38
|
+
"totalUseLimit": null,
|
|
39
|
+
"customerUseLimit": null,
|
|
40
|
+
"startDate": null,
|
|
41
|
+
"endDate": null,
|
|
42
|
+
"isForAllProducts": null,
|
|
43
|
+
"isForAllCustomers": null,
|
|
44
|
+
"couponables": null,
|
|
45
|
+
} satisfies UpdateCouponRequest
|
|
46
|
+
|
|
47
|
+
console.log(example)
|
|
48
|
+
|
|
49
|
+
// Convert the instance to a JSON string
|
|
50
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
51
|
+
console.log(exampleJSON)
|
|
52
|
+
|
|
53
|
+
// Parse the JSON string back to an object
|
|
54
|
+
const exampleParsed = JSON.parse(exampleJSON) as UpdateCouponRequest
|
|
55
|
+
console.log(exampleParsed)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
59
|
+
|
|
60
|
+
|
package/package.json
CHANGED
|
@@ -0,0 +1,345 @@
|
|
|
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 * as runtime from '../runtime';
|
|
16
|
+
import {
|
|
17
|
+
type CouponLiteResourceArrayResponse,
|
|
18
|
+
CouponLiteResourceArrayResponseFromJSON,
|
|
19
|
+
CouponLiteResourceArrayResponseToJSON,
|
|
20
|
+
} from '../models/CouponLiteResourceArrayResponse';
|
|
21
|
+
import {
|
|
22
|
+
type CouponResource,
|
|
23
|
+
CouponResourceFromJSON,
|
|
24
|
+
CouponResourceToJSON,
|
|
25
|
+
} from '../models/CouponResource';
|
|
26
|
+
import {
|
|
27
|
+
type CreateCouponRequest,
|
|
28
|
+
CreateCouponRequestFromJSON,
|
|
29
|
+
CreateCouponRequestToJSON,
|
|
30
|
+
} from '../models/CreateCouponRequest';
|
|
31
|
+
import {
|
|
32
|
+
type GenericResponse,
|
|
33
|
+
GenericResponseFromJSON,
|
|
34
|
+
GenericResponseToJSON,
|
|
35
|
+
} from '../models/GenericResponse';
|
|
36
|
+
import {
|
|
37
|
+
type PaginatedCouponListResourceResponse,
|
|
38
|
+
PaginatedCouponListResourceResponseFromJSON,
|
|
39
|
+
PaginatedCouponListResourceResponseToJSON,
|
|
40
|
+
} from '../models/PaginatedCouponListResourceResponse';
|
|
41
|
+
import {
|
|
42
|
+
type SearchAllCouponsRequest,
|
|
43
|
+
SearchAllCouponsRequestFromJSON,
|
|
44
|
+
SearchAllCouponsRequestToJSON,
|
|
45
|
+
} from '../models/SearchAllCouponsRequest';
|
|
46
|
+
import {
|
|
47
|
+
type SearchCouponsRequest,
|
|
48
|
+
SearchCouponsRequestFromJSON,
|
|
49
|
+
SearchCouponsRequestToJSON,
|
|
50
|
+
} from '../models/SearchCouponsRequest';
|
|
51
|
+
import {
|
|
52
|
+
type UpdateCouponRequest,
|
|
53
|
+
UpdateCouponRequestFromJSON,
|
|
54
|
+
UpdateCouponRequestToJSON,
|
|
55
|
+
} from '../models/UpdateCouponRequest';
|
|
56
|
+
|
|
57
|
+
export interface DestroyCouponRequest {
|
|
58
|
+
coupon: number;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export interface GetAllCouponRequest {
|
|
62
|
+
searchAllCouponsRequest?: SearchAllCouponsRequest;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface IndexCouponRequest {
|
|
66
|
+
searchCouponsRequest?: SearchCouponsRequest;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export interface ShowCouponRequest {
|
|
70
|
+
coupon: number;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export interface StoreCouponRequest {
|
|
74
|
+
createCouponRequest?: CreateCouponRequest;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface UpdateCouponOperationRequest {
|
|
78
|
+
coupon: number;
|
|
79
|
+
updateCouponRequest?: UpdateCouponRequest;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
*
|
|
84
|
+
*/
|
|
85
|
+
export class CouponsApi extends runtime.BaseAPI {
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Creates request options for destroyCoupon without sending the request
|
|
89
|
+
*/
|
|
90
|
+
async destroyCouponRequestOpts(requestParameters: DestroyCouponRequest): Promise<runtime.RequestOpts> {
|
|
91
|
+
if (requestParameters['coupon'] == null) {
|
|
92
|
+
throw new runtime.RequiredError(
|
|
93
|
+
'coupon',
|
|
94
|
+
'Required parameter "coupon" was null or undefined when calling destroyCoupon().'
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const queryParameters: any = {};
|
|
99
|
+
|
|
100
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
let urlPath = `/admin-api/coupons/{coupon}/delete`;
|
|
104
|
+
urlPath = urlPath.replace('{coupon}', encodeURIComponent(String(requestParameters['coupon'])));
|
|
105
|
+
|
|
106
|
+
return {
|
|
107
|
+
path: urlPath,
|
|
108
|
+
method: 'DELETE',
|
|
109
|
+
headers: headerParameters,
|
|
110
|
+
query: queryParameters,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Auto-generated: destroyCoupon
|
|
116
|
+
*/
|
|
117
|
+
async destroyCouponRaw(requestParameters: DestroyCouponRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GenericResponse>> {
|
|
118
|
+
const requestOptions = await this.destroyCouponRequestOpts(requestParameters);
|
|
119
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
120
|
+
|
|
121
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GenericResponseFromJSON(jsonValue));
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Auto-generated: destroyCoupon
|
|
126
|
+
*/
|
|
127
|
+
async destroyCoupon(requestParameters: DestroyCouponRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GenericResponse> {
|
|
128
|
+
const response = await this.destroyCouponRaw(requestParameters, initOverrides);
|
|
129
|
+
return await response.value();
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Creates request options for getAllCoupon without sending the request
|
|
134
|
+
*/
|
|
135
|
+
async getAllCouponRequestOpts(requestParameters: GetAllCouponRequest): Promise<runtime.RequestOpts> {
|
|
136
|
+
const queryParameters: any = {};
|
|
137
|
+
|
|
138
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
139
|
+
|
|
140
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
141
|
+
|
|
142
|
+
|
|
143
|
+
let urlPath = `/admin-api/coupons/all`;
|
|
144
|
+
|
|
145
|
+
return {
|
|
146
|
+
path: urlPath,
|
|
147
|
+
method: 'POST',
|
|
148
|
+
headers: headerParameters,
|
|
149
|
+
query: queryParameters,
|
|
150
|
+
body: SearchAllCouponsRequestToJSON(requestParameters['searchAllCouponsRequest']),
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Auto-generated: getAllCoupon
|
|
156
|
+
*/
|
|
157
|
+
async getAllCouponRaw(requestParameters: GetAllCouponRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CouponLiteResourceArrayResponse>> {
|
|
158
|
+
const requestOptions = await this.getAllCouponRequestOpts(requestParameters);
|
|
159
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
160
|
+
|
|
161
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CouponLiteResourceArrayResponseFromJSON(jsonValue));
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Auto-generated: getAllCoupon
|
|
166
|
+
*/
|
|
167
|
+
async getAllCoupon(requestParameters: GetAllCouponRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CouponLiteResourceArrayResponse> {
|
|
168
|
+
const response = await this.getAllCouponRaw(requestParameters, initOverrides);
|
|
169
|
+
return await response.value();
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Creates request options for indexCoupon without sending the request
|
|
174
|
+
*/
|
|
175
|
+
async indexCouponRequestOpts(requestParameters: IndexCouponRequest): Promise<runtime.RequestOpts> {
|
|
176
|
+
const queryParameters: any = {};
|
|
177
|
+
|
|
178
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
179
|
+
|
|
180
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
let urlPath = `/admin-api/coupons/list`;
|
|
184
|
+
|
|
185
|
+
return {
|
|
186
|
+
path: urlPath,
|
|
187
|
+
method: 'POST',
|
|
188
|
+
headers: headerParameters,
|
|
189
|
+
query: queryParameters,
|
|
190
|
+
body: SearchCouponsRequestToJSON(requestParameters['searchCouponsRequest']),
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Auto-generated: indexCoupon
|
|
196
|
+
*/
|
|
197
|
+
async indexCouponRaw(requestParameters: IndexCouponRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedCouponListResourceResponse>> {
|
|
198
|
+
const requestOptions = await this.indexCouponRequestOpts(requestParameters);
|
|
199
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
200
|
+
|
|
201
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedCouponListResourceResponseFromJSON(jsonValue));
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Auto-generated: indexCoupon
|
|
206
|
+
*/
|
|
207
|
+
async indexCoupon(requestParameters: IndexCouponRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedCouponListResourceResponse> {
|
|
208
|
+
const response = await this.indexCouponRaw(requestParameters, initOverrides);
|
|
209
|
+
return await response.value();
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Creates request options for showCoupon without sending the request
|
|
214
|
+
*/
|
|
215
|
+
async showCouponRequestOpts(requestParameters: ShowCouponRequest): Promise<runtime.RequestOpts> {
|
|
216
|
+
if (requestParameters['coupon'] == null) {
|
|
217
|
+
throw new runtime.RequiredError(
|
|
218
|
+
'coupon',
|
|
219
|
+
'Required parameter "coupon" was null or undefined when calling showCoupon().'
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
const queryParameters: any = {};
|
|
224
|
+
|
|
225
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
let urlPath = `/admin-api/coupons/{coupon}`;
|
|
229
|
+
urlPath = urlPath.replace('{coupon}', encodeURIComponent(String(requestParameters['coupon'])));
|
|
230
|
+
|
|
231
|
+
return {
|
|
232
|
+
path: urlPath,
|
|
233
|
+
method: 'GET',
|
|
234
|
+
headers: headerParameters,
|
|
235
|
+
query: queryParameters,
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
/**
|
|
240
|
+
* Auto-generated: showCoupon
|
|
241
|
+
*/
|
|
242
|
+
async showCouponRaw(requestParameters: ShowCouponRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CouponResource>> {
|
|
243
|
+
const requestOptions = await this.showCouponRequestOpts(requestParameters);
|
|
244
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
245
|
+
|
|
246
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CouponResourceFromJSON(jsonValue));
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* Auto-generated: showCoupon
|
|
251
|
+
*/
|
|
252
|
+
async showCoupon(requestParameters: ShowCouponRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CouponResource> {
|
|
253
|
+
const response = await this.showCouponRaw(requestParameters, initOverrides);
|
|
254
|
+
return await response.value();
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* Creates request options for storeCoupon without sending the request
|
|
259
|
+
*/
|
|
260
|
+
async storeCouponRequestOpts(requestParameters: StoreCouponRequest): Promise<runtime.RequestOpts> {
|
|
261
|
+
const queryParameters: any = {};
|
|
262
|
+
|
|
263
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
264
|
+
|
|
265
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
266
|
+
|
|
267
|
+
|
|
268
|
+
let urlPath = `/admin-api/coupons/create`;
|
|
269
|
+
|
|
270
|
+
return {
|
|
271
|
+
path: urlPath,
|
|
272
|
+
method: 'POST',
|
|
273
|
+
headers: headerParameters,
|
|
274
|
+
query: queryParameters,
|
|
275
|
+
body: CreateCouponRequestToJSON(requestParameters['createCouponRequest']),
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/**
|
|
280
|
+
* Auto-generated: storeCoupon
|
|
281
|
+
*/
|
|
282
|
+
async storeCouponRaw(requestParameters: StoreCouponRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CouponResource>> {
|
|
283
|
+
const requestOptions = await this.storeCouponRequestOpts(requestParameters);
|
|
284
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
285
|
+
|
|
286
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CouponResourceFromJSON(jsonValue));
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Auto-generated: storeCoupon
|
|
291
|
+
*/
|
|
292
|
+
async storeCoupon(requestParameters: StoreCouponRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CouponResource> {
|
|
293
|
+
const response = await this.storeCouponRaw(requestParameters, initOverrides);
|
|
294
|
+
return await response.value();
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Creates request options for updateCoupon without sending the request
|
|
299
|
+
*/
|
|
300
|
+
async updateCouponRequestOpts(requestParameters: UpdateCouponOperationRequest): Promise<runtime.RequestOpts> {
|
|
301
|
+
if (requestParameters['coupon'] == null) {
|
|
302
|
+
throw new runtime.RequiredError(
|
|
303
|
+
'coupon',
|
|
304
|
+
'Required parameter "coupon" was null or undefined when calling updateCoupon().'
|
|
305
|
+
);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
const queryParameters: any = {};
|
|
309
|
+
|
|
310
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
311
|
+
|
|
312
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
313
|
+
|
|
314
|
+
|
|
315
|
+
let urlPath = `/admin-api/coupons/{coupon}/update`;
|
|
316
|
+
urlPath = urlPath.replace('{coupon}', encodeURIComponent(String(requestParameters['coupon'])));
|
|
317
|
+
|
|
318
|
+
return {
|
|
319
|
+
path: urlPath,
|
|
320
|
+
method: 'PUT',
|
|
321
|
+
headers: headerParameters,
|
|
322
|
+
query: queryParameters,
|
|
323
|
+
body: UpdateCouponRequestToJSON(requestParameters['updateCouponRequest']),
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Auto-generated: updateCoupon
|
|
329
|
+
*/
|
|
330
|
+
async updateCouponRaw(requestParameters: UpdateCouponOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CouponResource>> {
|
|
331
|
+
const requestOptions = await this.updateCouponRequestOpts(requestParameters);
|
|
332
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
333
|
+
|
|
334
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => CouponResourceFromJSON(jsonValue));
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/**
|
|
338
|
+
* Auto-generated: updateCoupon
|
|
339
|
+
*/
|
|
340
|
+
async updateCoupon(requestParameters: UpdateCouponOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CouponResource> {
|
|
341
|
+
const response = await this.updateCouponRaw(requestParameters, initOverrides);
|
|
342
|
+
return await response.value();
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
}
|
package/src/apis/index.ts
CHANGED
|
@@ -36,7 +36,7 @@ export interface AddressFrontendResource {
|
|
|
36
36
|
* @type {string}
|
|
37
37
|
* @memberof AddressFrontendResource
|
|
38
38
|
*/
|
|
39
|
-
line2
|
|
39
|
+
line2: string;
|
|
40
40
|
/**
|
|
41
41
|
*
|
|
42
42
|
* @type {string}
|
|
@@ -75,6 +75,7 @@ export interface AddressFrontendResource {
|
|
|
75
75
|
export function instanceOfAddressFrontendResource(value: object): value is AddressFrontendResource {
|
|
76
76
|
if (!('company' in value) || value['company'] === undefined) return false;
|
|
77
77
|
if (!('line1' in value) || value['line1'] === undefined) return false;
|
|
78
|
+
if (!('line2' in value) || value['line2'] === undefined) return false;
|
|
78
79
|
if (!('postcode' in value) || value['postcode'] === undefined) return false;
|
|
79
80
|
if (!('suburb' in value) || value['suburb'] === undefined) return false;
|
|
80
81
|
if (!('country' in value) || value['country'] === undefined) return false;
|
|
@@ -95,7 +96,7 @@ export function AddressFrontendResourceFromJSONTyped(json: any, ignoreDiscrimina
|
|
|
95
96
|
|
|
96
97
|
'company': json['company'],
|
|
97
98
|
'line1': json['line1'],
|
|
98
|
-
'line2': json['line2']
|
|
99
|
+
'line2': json['line2'],
|
|
99
100
|
'postcode': json['postcode'],
|
|
100
101
|
'suburb': json['suburb'],
|
|
101
102
|
'country': json['country'],
|
|
@@ -42,7 +42,7 @@ export interface AddressResource {
|
|
|
42
42
|
* @type {string}
|
|
43
43
|
* @memberof AddressResource
|
|
44
44
|
*/
|
|
45
|
-
addresseeName
|
|
45
|
+
addresseeName?: string | null;
|
|
46
46
|
/**
|
|
47
47
|
*
|
|
48
48
|
* @type {string}
|
|
@@ -60,7 +60,7 @@ export interface AddressResource {
|
|
|
60
60
|
* @type {string}
|
|
61
61
|
* @memberof AddressResource
|
|
62
62
|
*/
|
|
63
|
-
line2
|
|
63
|
+
line2: string;
|
|
64
64
|
/**
|
|
65
65
|
*
|
|
66
66
|
* @type {string}
|
|
@@ -97,9 +97,9 @@ export interface AddressResource {
|
|
|
97
97
|
* Check if a given object implements the AddressResource interface.
|
|
98
98
|
*/
|
|
99
99
|
export function instanceOfAddressResource(value: object): value is AddressResource {
|
|
100
|
-
if (!('addresseeName' in value) || value['addresseeName'] === undefined) return false;
|
|
101
100
|
if (!('company' in value) || value['company'] === undefined) return false;
|
|
102
101
|
if (!('line1' in value) || value['line1'] === undefined) return false;
|
|
102
|
+
if (!('line2' in value) || value['line2'] === undefined) return false;
|
|
103
103
|
if (!('postcode' in value) || value['postcode'] === undefined) return false;
|
|
104
104
|
if (!('suburb' in value) || value['suburb'] === undefined) return false;
|
|
105
105
|
if (!('country' in value) || value['country'] === undefined) return false;
|
|
@@ -121,10 +121,10 @@ export function AddressResourceFromJSONTyped(json: any, ignoreDiscriminator: boo
|
|
|
121
121
|
'id': json['id'] == null ? undefined : json['id'],
|
|
122
122
|
'type': json['type'] == null ? undefined : json['type'],
|
|
123
123
|
'sourceAddressId': json['sourceAddressId'] == null ? undefined : json['sourceAddressId'],
|
|
124
|
-
'addresseeName': json['addresseeName'],
|
|
124
|
+
'addresseeName': json['addresseeName'] == null ? undefined : json['addresseeName'],
|
|
125
125
|
'company': json['company'],
|
|
126
126
|
'line1': json['line1'],
|
|
127
|
-
'line2': json['line2']
|
|
127
|
+
'line2': json['line2'],
|
|
128
128
|
'postcode': json['postcode'],
|
|
129
129
|
'suburb': json['suburb'],
|
|
130
130
|
'country': json['country'],
|