@digital8/lighting-illusions-ts-sdk 0.0.1938 → 0.0.1940
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 -16
- package/README.md +19 -10
- package/dist/apis/TransactionsApi.d.ts +69 -0
- package/dist/apis/TransactionsApi.js +262 -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 +1 -3
- package/dist/models/AddressResource.d.ts +9 -3
- package/dist/models/AddressResource.js +6 -8
- package/dist/models/AdminOrderResource.d.ts +0 -6
- package/dist/models/AdminOrderResource.js +0 -4
- package/dist/models/CartListResource.d.ts +0 -6
- package/dist/models/CartListResource.js +0 -4
- package/dist/models/CartResource.d.ts +0 -6
- package/dist/models/CartResource.js +0 -4
- package/dist/models/ExternalApiLogResource.d.ts +1 -1
- package/dist/models/ExternalApiLogResource.js +1 -3
- package/dist/models/IndexTransactionRequest.d.ts +127 -0
- package/dist/models/IndexTransactionRequest.js +91 -0
- package/dist/models/PaginatedTransactionListResourceResponse.d.ts +40 -0
- package/dist/models/PaginatedTransactionListResourceResponse.js +57 -0
- package/dist/models/PaginatedTransactionResourceResponse.d.ts +40 -0
- package/dist/models/PaginatedTransactionResourceResponse.js +57 -0
- package/dist/models/PaymentMethod.d.ts +30 -0
- package/dist/models/PaymentMethod.js +56 -0
- package/dist/models/PaymentSource.d.ts +26 -0
- package/dist/models/PaymentSource.js +52 -0
- package/dist/models/PaymentStatus.d.ts +25 -0
- package/dist/models/PaymentStatus.js +51 -0
- package/dist/models/ProductChildCartLiteResource.d.ts +0 -6
- package/dist/models/ProductChildCartLiteResource.js +0 -4
- package/dist/models/RefundTransactionRequest.d.ts +38 -0
- package/dist/models/RefundTransactionRequest.js +53 -0
- package/dist/models/StoreCartRequest.d.ts +0 -6
- package/dist/models/StoreCartRequest.js +0 -2
- package/dist/models/StoreCartRequestShippingAddress.d.ts +6 -0
- package/dist/models/StoreCartRequestShippingAddress.js +2 -0
- package/dist/models/StoreFrontendResource.d.ts +1 -1
- package/dist/models/StoreFrontendResource.js +3 -1
- package/dist/models/StoreListResource.d.ts +2 -2
- package/dist/models/StoreListResource.js +4 -4
- package/dist/models/StoreResource.d.ts +1 -1
- package/dist/models/StoreResource.js +3 -1
- package/dist/models/StoreSpecialDateFrontendResource.d.ts +2 -2
- package/dist/models/StoreSpecialDateFrontendResource.js +1 -3
- package/dist/models/StoreSpecialDateResource.d.ts +2 -2
- package/dist/models/StoreSpecialDateResource.js +3 -1
- package/dist/models/StoreTransactionRequest.d.ts +81 -0
- package/dist/models/StoreTransactionRequest.js +78 -0
- package/dist/models/TransactionListResource.d.ts +152 -0
- package/dist/models/TransactionListResource.js +109 -0
- package/dist/models/TransactionListResourceArrayResponse.d.ts +33 -0
- package/dist/models/TransactionListResourceArrayResponse.js +50 -0
- package/dist/models/TransactionResource.d.ts +152 -0
- package/dist/models/TransactionResource.js +109 -0
- package/dist/models/TransactionResourceArrayResponse.d.ts +33 -0
- package/dist/models/TransactionResourceArrayResponse.js +50 -0
- package/dist/models/TransactionType.d.ts +25 -0
- package/dist/models/TransactionType.js +51 -0
- package/dist/models/UpdateCartRequest.d.ts +0 -6
- package/dist/models/UpdateCartRequest.js +0 -2
- package/dist/models/UpdateOrderRequest.d.ts +3 -9
- package/dist/models/UpdateOrderRequest.js +3 -5
- package/dist/models/UpdateOrderRequestBillingAddress.d.ts +6 -0
- package/dist/models/UpdateOrderRequestBillingAddress.js +2 -0
- package/dist/models/UpdateOrderRequestShippingAddress.d.ts +80 -0
- package/dist/models/UpdateOrderRequestShippingAddress.js +67 -0
- package/dist/models/index.d.ts +14 -8
- package/dist/models/index.js +14 -8
- package/docs/AddressResource.md +2 -0
- package/docs/AdminOrderResource.md +0 -2
- package/docs/CartListResource.md +0 -2
- package/docs/CartResource.md +0 -2
- package/docs/IndexTransactionRequest.md +60 -0
- package/docs/PaginatedTransactionListResourceResponse.md +36 -0
- package/docs/{FrontendLineItemResourceArrayResponse.md → PaginatedTransactionResourceResponse.md} +7 -5
- package/docs/{CartCouponLiteResource.md → PaymentMethod.md} +4 -10
- package/docs/{CartCouponLiteResourceArrayResponse.md → PaymentSource.md} +4 -6
- package/docs/PaymentStatus.md +32 -0
- package/docs/ProductChildCartLiteResource.md +0 -2
- package/docs/RefundTransactionRequest.md +36 -0
- package/docs/StoreCartRequest.md +0 -2
- package/docs/StoreCartRequestShippingAddress.md +2 -0
- package/docs/StoreSpecialDateFrontendResource.md +1 -1
- package/docs/StoreSpecialDateResource.md +1 -1
- package/docs/StoreTransactionRequest.md +46 -0
- package/docs/TransactionListResource.md +74 -0
- package/docs/{FrontendOrderResourceArrayResponse.md → TransactionListResourceArrayResponse.md} +5 -5
- package/docs/TransactionResource.md +74 -0
- package/docs/{FrontendCartResourceArrayResponse.md → TransactionResourceArrayResponse.md} +5 -5
- package/docs/TransactionType.md +32 -0
- package/docs/TransactionsApi.md +209 -0
- package/docs/UpdateCartRequest.md +0 -2
- package/docs/UpdateOrderRequest.md +1 -3
- package/docs/UpdateOrderRequestBillingAddress.md +2 -0
- package/docs/UpdateOrderRequestShippingAddress.md +50 -0
- package/package.json +1 -1
- package/src/apis/TransactionsApi.ts +193 -0
- package/src/apis/index.ts +1 -0
- package/src/models/AddressFrontendResource.ts +2 -3
- package/src/models/AddressResource.ts +15 -9
- package/src/models/AdminOrderResource.ts +0 -9
- package/src/models/CartListResource.ts +0 -9
- package/src/models/CartResource.ts +0 -9
- package/src/models/ExternalApiLogResource.ts +2 -3
- package/src/models/IndexTransactionRequest.ts +190 -0
- package/src/models/PaginatedTransactionListResourceResponse.ts +90 -0
- package/src/models/PaginatedTransactionResourceResponse.ts +90 -0
- package/src/models/PaymentMethod.ts +58 -0
- package/src/models/PaymentSource.ts +54 -0
- package/src/models/PaymentStatus.ts +53 -0
- package/src/models/ProductChildCartLiteResource.ts +0 -9
- package/src/models/RefundTransactionRequest.ts +74 -0
- package/src/models/StoreCartRequest.ts +0 -8
- package/src/models/StoreCartRequestShippingAddress.ts +8 -0
- package/src/models/StoreFrontendResource.ts +3 -2
- package/src/models/StoreListResource.ts +5 -5
- package/src/models/StoreResource.ts +3 -2
- package/src/models/StoreSpecialDateFrontendResource.ts +3 -4
- package/src/models/StoreSpecialDateResource.ts +4 -3
- package/src/models/StoreTransactionRequest.ts +131 -0
- package/src/models/TransactionListResource.ts +235 -0
- package/src/models/TransactionListResourceArrayResponse.ts +73 -0
- package/src/models/TransactionResource.ts +235 -0
- package/src/models/TransactionResourceArrayResponse.ts +73 -0
- package/src/models/TransactionType.ts +53 -0
- package/src/models/UpdateCartRequest.ts +0 -8
- package/src/models/UpdateOrderRequest.ts +10 -18
- package/src/models/UpdateOrderRequestBillingAddress.ts +8 -0
- package/src/models/UpdateOrderRequestShippingAddress.ts +130 -0
- package/src/models/index.ts +14 -8
- package/dist/models/CartCouponLiteResource.d.ts +0 -44
- package/dist/models/CartCouponLiteResource.js +0 -59
- package/dist/models/CartCouponLiteResourceArrayResponse.d.ts +0 -33
- package/dist/models/CartCouponLiteResourceArrayResponse.js +0 -50
- package/dist/models/FrontendCartResource.d.ts +0 -144
- package/dist/models/FrontendCartResource.js +0 -121
- package/dist/models/FrontendCartResourceArrayResponse.d.ts +0 -33
- package/dist/models/FrontendCartResourceArrayResponse.js +0 -50
- package/dist/models/FrontendLineItemResource.d.ts +0 -63
- package/dist/models/FrontendLineItemResource.js +0 -70
- package/dist/models/FrontendLineItemResourceArrayResponse.d.ts +0 -33
- package/dist/models/FrontendLineItemResourceArrayResponse.js +0 -50
- package/dist/models/FrontendOrderResource.d.ts +0 -168
- package/dist/models/FrontendOrderResource.js +0 -137
- package/dist/models/FrontendOrderResourceArrayResponse.d.ts +0 -33
- package/dist/models/FrontendOrderResourceArrayResponse.js +0 -50
- package/docs/FrontendCartResource.md +0 -70
- package/docs/FrontendLineItemResource.md +0 -44
- package/docs/FrontendOrderResource.md +0 -78
- package/src/models/CartCouponLiteResource.ts +0 -84
- package/src/models/CartCouponLiteResourceArrayResponse.ts +0 -73
- package/src/models/FrontendCartResource.ts +0 -254
- package/src/models/FrontendCartResourceArrayResponse.ts +0 -73
- package/src/models/FrontendLineItemResource.ts +0 -118
- package/src/models/FrontendLineItemResourceArrayResponse.ts +0 -73
- package/src/models/FrontendOrderResource.ts +0 -290
- package/src/models/FrontendOrderResourceArrayResponse.ts +0 -73
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# TransactionsApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *http://localhost/api*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**indexTransaction**](TransactionsApi.md#indextransactionoperation) | **POST** /admin-api/transactions/list | Auto-generated: indexTransaction |
|
|
8
|
+
| [**refundTransaction**](TransactionsApi.md#refundtransactionoperation) | **POST** /admin-api/transactions/{transaction}/refund | Auto-generated: refundTransaction |
|
|
9
|
+
| [**storeTransaction**](TransactionsApi.md#storetransactionoperation) | **POST** /admin-api/transactions/create | Auto-generated: storeTransaction |
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## indexTransaction
|
|
14
|
+
|
|
15
|
+
> PaginatedTransactionListResourceResponse indexTransaction(indexTransactionRequest)
|
|
16
|
+
|
|
17
|
+
Auto-generated: indexTransaction
|
|
18
|
+
|
|
19
|
+
### Example
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import {
|
|
23
|
+
Configuration,
|
|
24
|
+
TransactionsApi,
|
|
25
|
+
} from '@digital8/lighting-illusions-ts-sdk';
|
|
26
|
+
import type { IndexTransactionOperationRequest } from '@digital8/lighting-illusions-ts-sdk';
|
|
27
|
+
|
|
28
|
+
async function example() {
|
|
29
|
+
console.log("🚀 Testing @digital8/lighting-illusions-ts-sdk SDK...");
|
|
30
|
+
const api = new TransactionsApi();
|
|
31
|
+
|
|
32
|
+
const body = {
|
|
33
|
+
// IndexTransactionRequest (optional)
|
|
34
|
+
indexTransactionRequest: ...,
|
|
35
|
+
} satisfies IndexTransactionOperationRequest;
|
|
36
|
+
|
|
37
|
+
try {
|
|
38
|
+
const data = await api.indexTransaction(body);
|
|
39
|
+
console.log(data);
|
|
40
|
+
} catch (error) {
|
|
41
|
+
console.error(error);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
// Run the test
|
|
46
|
+
example().catch(console.error);
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Parameters
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
| Name | Type | Description | Notes |
|
|
53
|
+
|------------- | ------------- | ------------- | -------------|
|
|
54
|
+
| **indexTransactionRequest** | [IndexTransactionRequest](IndexTransactionRequest.md) | | [Optional] |
|
|
55
|
+
|
|
56
|
+
### Return type
|
|
57
|
+
|
|
58
|
+
[**PaginatedTransactionListResourceResponse**](PaginatedTransactionListResourceResponse.md)
|
|
59
|
+
|
|
60
|
+
### Authorization
|
|
61
|
+
|
|
62
|
+
No authorization required
|
|
63
|
+
|
|
64
|
+
### HTTP request headers
|
|
65
|
+
|
|
66
|
+
- **Content-Type**: `application/json`
|
|
67
|
+
- **Accept**: `application/json`
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
### HTTP response details
|
|
71
|
+
| Status code | Description | Response headers |
|
|
72
|
+
|-------------|-------------|------------------|
|
|
73
|
+
| **200** | Paginated response \\JsonResponse<\\ResourcePaginator<\\TransactionListResource[]>> | - |
|
|
74
|
+
|
|
75
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## refundTransaction
|
|
79
|
+
|
|
80
|
+
> TransactionResource refundTransaction(transaction, refundTransactionRequest)
|
|
81
|
+
|
|
82
|
+
Auto-generated: refundTransaction
|
|
83
|
+
|
|
84
|
+
### Example
|
|
85
|
+
|
|
86
|
+
```ts
|
|
87
|
+
import {
|
|
88
|
+
Configuration,
|
|
89
|
+
TransactionsApi,
|
|
90
|
+
} from '@digital8/lighting-illusions-ts-sdk';
|
|
91
|
+
import type { RefundTransactionOperationRequest } from '@digital8/lighting-illusions-ts-sdk';
|
|
92
|
+
|
|
93
|
+
async function example() {
|
|
94
|
+
console.log("🚀 Testing @digital8/lighting-illusions-ts-sdk SDK...");
|
|
95
|
+
const api = new TransactionsApi();
|
|
96
|
+
|
|
97
|
+
const body = {
|
|
98
|
+
// number | The id of the transaction
|
|
99
|
+
transaction: 56,
|
|
100
|
+
// RefundTransactionRequest (optional)
|
|
101
|
+
refundTransactionRequest: ...,
|
|
102
|
+
} satisfies RefundTransactionOperationRequest;
|
|
103
|
+
|
|
104
|
+
try {
|
|
105
|
+
const data = await api.refundTransaction(body);
|
|
106
|
+
console.log(data);
|
|
107
|
+
} catch (error) {
|
|
108
|
+
console.error(error);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Run the test
|
|
113
|
+
example().catch(console.error);
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
### Parameters
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
| Name | Type | Description | Notes |
|
|
120
|
+
|------------- | ------------- | ------------- | -------------|
|
|
121
|
+
| **transaction** | `number` | The id of the transaction | [Defaults to `undefined`] |
|
|
122
|
+
| **refundTransactionRequest** | [RefundTransactionRequest](RefundTransactionRequest.md) | | [Optional] |
|
|
123
|
+
|
|
124
|
+
### Return type
|
|
125
|
+
|
|
126
|
+
[**TransactionResource**](TransactionResource.md)
|
|
127
|
+
|
|
128
|
+
### Authorization
|
|
129
|
+
|
|
130
|
+
No authorization required
|
|
131
|
+
|
|
132
|
+
### HTTP request headers
|
|
133
|
+
|
|
134
|
+
- **Content-Type**: `application/json`
|
|
135
|
+
- **Accept**: `application/json`
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
### HTTP response details
|
|
139
|
+
| Status code | Description | Response headers |
|
|
140
|
+
|-------------|-------------|------------------|
|
|
141
|
+
| **200** | Successful resource response | - |
|
|
142
|
+
|
|
143
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
## storeTransaction
|
|
147
|
+
|
|
148
|
+
> GenericResponse storeTransaction(storeTransactionRequest)
|
|
149
|
+
|
|
150
|
+
Auto-generated: storeTransaction
|
|
151
|
+
|
|
152
|
+
### Example
|
|
153
|
+
|
|
154
|
+
```ts
|
|
155
|
+
import {
|
|
156
|
+
Configuration,
|
|
157
|
+
TransactionsApi,
|
|
158
|
+
} from '@digital8/lighting-illusions-ts-sdk';
|
|
159
|
+
import type { StoreTransactionOperationRequest } from '@digital8/lighting-illusions-ts-sdk';
|
|
160
|
+
|
|
161
|
+
async function example() {
|
|
162
|
+
console.log("🚀 Testing @digital8/lighting-illusions-ts-sdk SDK...");
|
|
163
|
+
const api = new TransactionsApi();
|
|
164
|
+
|
|
165
|
+
const body = {
|
|
166
|
+
// StoreTransactionRequest (optional)
|
|
167
|
+
storeTransactionRequest: ...,
|
|
168
|
+
} satisfies StoreTransactionOperationRequest;
|
|
169
|
+
|
|
170
|
+
try {
|
|
171
|
+
const data = await api.storeTransaction(body);
|
|
172
|
+
console.log(data);
|
|
173
|
+
} catch (error) {
|
|
174
|
+
console.error(error);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
// Run the test
|
|
179
|
+
example().catch(console.error);
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
### Parameters
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
| Name | Type | Description | Notes |
|
|
186
|
+
|------------- | ------------- | ------------- | -------------|
|
|
187
|
+
| **storeTransactionRequest** | [StoreTransactionRequest](StoreTransactionRequest.md) | | [Optional] |
|
|
188
|
+
|
|
189
|
+
### Return type
|
|
190
|
+
|
|
191
|
+
[**GenericResponse**](GenericResponse.md)
|
|
192
|
+
|
|
193
|
+
### Authorization
|
|
194
|
+
|
|
195
|
+
No authorization required
|
|
196
|
+
|
|
197
|
+
### HTTP request headers
|
|
198
|
+
|
|
199
|
+
- **Content-Type**: `application/json`
|
|
200
|
+
- **Accept**: `application/json`
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
### HTTP response details
|
|
204
|
+
| Status code | Description | Response headers |
|
|
205
|
+
|-------------|-------------|------------------|
|
|
206
|
+
| **200** | \\JsonResponse<array{transaction: \\TransactionResource|null, order_id: int|null}> | - |
|
|
207
|
+
|
|
208
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
209
|
+
|
|
@@ -14,7 +14,6 @@ Name | Type
|
|
|
14
14
|
`shippingSubtotal` | number
|
|
15
15
|
`overrideShipping` | boolean
|
|
16
16
|
`insuranceAmount` | number
|
|
17
|
-
`includeInsurance` | boolean
|
|
18
17
|
`overrideInsurance` | boolean
|
|
19
18
|
`useAsBillingAddress` | boolean
|
|
20
19
|
`shippingAddressId` | number
|
|
@@ -37,7 +36,6 @@ const example = {
|
|
|
37
36
|
"shippingSubtotal": null,
|
|
38
37
|
"overrideShipping": null,
|
|
39
38
|
"insuranceAmount": null,
|
|
40
|
-
"includeInsurance": null,
|
|
41
39
|
"overrideInsurance": null,
|
|
42
40
|
"useAsBillingAddress": null,
|
|
43
41
|
"shippingAddressId": null,
|
|
@@ -13,9 +13,8 @@ Name | Type
|
|
|
13
13
|
`shippingSubtotal` | number
|
|
14
14
|
`overrideShipping` | boolean
|
|
15
15
|
`insuranceAmount` | number
|
|
16
|
-
`includeInsurance` | boolean
|
|
17
16
|
`overrideInsurance` | boolean
|
|
18
|
-
`shippingAddress` | [
|
|
17
|
+
`shippingAddress` | [UpdateOrderRequestShippingAddress](UpdateOrderRequestShippingAddress.md)
|
|
19
18
|
`billingAddress` | [UpdateOrderRequestBillingAddress](UpdateOrderRequestBillingAddress.md)
|
|
20
19
|
|
|
21
20
|
## Example
|
|
@@ -32,7 +31,6 @@ const example = {
|
|
|
32
31
|
"shippingSubtotal": null,
|
|
33
32
|
"overrideShipping": null,
|
|
34
33
|
"insuranceAmount": null,
|
|
35
|
-
"includeInsurance": null,
|
|
36
34
|
"overrideInsurance": null,
|
|
37
35
|
"shippingAddress": null,
|
|
38
36
|
"billingAddress": null,
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
Name | Type
|
|
8
8
|
------------ | -------------
|
|
9
9
|
`addresseeName` | string
|
|
10
|
+
`addressee` | string
|
|
10
11
|
`company` | string
|
|
11
12
|
`line1` | string
|
|
12
13
|
`line2` | string
|
|
@@ -23,6 +24,7 @@ import type { UpdateOrderRequestBillingAddress } from '@digital8/lighting-illusi
|
|
|
23
24
|
// TODO: Update the object below with actual values
|
|
24
25
|
const example = {
|
|
25
26
|
"addresseeName": null,
|
|
27
|
+
"addressee": null,
|
|
26
28
|
"company": null,
|
|
27
29
|
"line1": null,
|
|
28
30
|
"line2": null,
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
|
|
2
|
+
# UpdateOrderRequestShippingAddress
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`addresseeName` | string
|
|
10
|
+
`addressee` | string
|
|
11
|
+
`company` | string
|
|
12
|
+
`line1` | string
|
|
13
|
+
`line2` | string
|
|
14
|
+
`suburb` | string
|
|
15
|
+
`state` | string
|
|
16
|
+
`postcode` | string
|
|
17
|
+
`country` | string
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import type { UpdateOrderRequestShippingAddress } from '@digital8/lighting-illusions-ts-sdk'
|
|
23
|
+
|
|
24
|
+
// TODO: Update the object below with actual values
|
|
25
|
+
const example = {
|
|
26
|
+
"addresseeName": null,
|
|
27
|
+
"addressee": null,
|
|
28
|
+
"company": null,
|
|
29
|
+
"line1": null,
|
|
30
|
+
"line2": null,
|
|
31
|
+
"suburb": null,
|
|
32
|
+
"state": null,
|
|
33
|
+
"postcode": null,
|
|
34
|
+
"country": null,
|
|
35
|
+
} satisfies UpdateOrderRequestShippingAddress
|
|
36
|
+
|
|
37
|
+
console.log(example)
|
|
38
|
+
|
|
39
|
+
// Convert the instance to a JSON string
|
|
40
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
41
|
+
console.log(exampleJSON)
|
|
42
|
+
|
|
43
|
+
// Parse the JSON string back to an object
|
|
44
|
+
const exampleParsed = JSON.parse(exampleJSON) as UpdateOrderRequestShippingAddress
|
|
45
|
+
console.log(exampleParsed)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
49
|
+
|
|
50
|
+
|
package/package.json
CHANGED
|
@@ -0,0 +1,193 @@
|
|
|
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 GenericResponse,
|
|
18
|
+
GenericResponseFromJSON,
|
|
19
|
+
GenericResponseToJSON,
|
|
20
|
+
} from '../models/GenericResponse';
|
|
21
|
+
import {
|
|
22
|
+
type IndexTransactionRequest,
|
|
23
|
+
IndexTransactionRequestFromJSON,
|
|
24
|
+
IndexTransactionRequestToJSON,
|
|
25
|
+
} from '../models/IndexTransactionRequest';
|
|
26
|
+
import {
|
|
27
|
+
type PaginatedTransactionListResourceResponse,
|
|
28
|
+
PaginatedTransactionListResourceResponseFromJSON,
|
|
29
|
+
PaginatedTransactionListResourceResponseToJSON,
|
|
30
|
+
} from '../models/PaginatedTransactionListResourceResponse';
|
|
31
|
+
import {
|
|
32
|
+
type RefundTransactionRequest,
|
|
33
|
+
RefundTransactionRequestFromJSON,
|
|
34
|
+
RefundTransactionRequestToJSON,
|
|
35
|
+
} from '../models/RefundTransactionRequest';
|
|
36
|
+
import {
|
|
37
|
+
type StoreTransactionRequest,
|
|
38
|
+
StoreTransactionRequestFromJSON,
|
|
39
|
+
StoreTransactionRequestToJSON,
|
|
40
|
+
} from '../models/StoreTransactionRequest';
|
|
41
|
+
import {
|
|
42
|
+
type TransactionResource,
|
|
43
|
+
TransactionResourceFromJSON,
|
|
44
|
+
TransactionResourceToJSON,
|
|
45
|
+
} from '../models/TransactionResource';
|
|
46
|
+
|
|
47
|
+
export interface IndexTransactionOperationRequest {
|
|
48
|
+
indexTransactionRequest?: IndexTransactionRequest;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface RefundTransactionOperationRequest {
|
|
52
|
+
transaction: number;
|
|
53
|
+
refundTransactionRequest?: RefundTransactionRequest;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface StoreTransactionOperationRequest {
|
|
57
|
+
storeTransactionRequest?: StoreTransactionRequest;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
*/
|
|
63
|
+
export class TransactionsApi extends runtime.BaseAPI {
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Creates request options for indexTransaction without sending the request
|
|
67
|
+
*/
|
|
68
|
+
async indexTransactionRequestOpts(requestParameters: IndexTransactionOperationRequest): Promise<runtime.RequestOpts> {
|
|
69
|
+
const queryParameters: any = {};
|
|
70
|
+
|
|
71
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
72
|
+
|
|
73
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
let urlPath = `/admin-api/transactions/list`;
|
|
77
|
+
|
|
78
|
+
return {
|
|
79
|
+
path: urlPath,
|
|
80
|
+
method: 'POST',
|
|
81
|
+
headers: headerParameters,
|
|
82
|
+
query: queryParameters,
|
|
83
|
+
body: IndexTransactionRequestToJSON(requestParameters['indexTransactionRequest']),
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Auto-generated: indexTransaction
|
|
89
|
+
*/
|
|
90
|
+
async indexTransactionRaw(requestParameters: IndexTransactionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedTransactionListResourceResponse>> {
|
|
91
|
+
const requestOptions = await this.indexTransactionRequestOpts(requestParameters);
|
|
92
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
93
|
+
|
|
94
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedTransactionListResourceResponseFromJSON(jsonValue));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Auto-generated: indexTransaction
|
|
99
|
+
*/
|
|
100
|
+
async indexTransaction(requestParameters: IndexTransactionOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedTransactionListResourceResponse> {
|
|
101
|
+
const response = await this.indexTransactionRaw(requestParameters, initOverrides);
|
|
102
|
+
return await response.value();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Creates request options for refundTransaction without sending the request
|
|
107
|
+
*/
|
|
108
|
+
async refundTransactionRequestOpts(requestParameters: RefundTransactionOperationRequest): Promise<runtime.RequestOpts> {
|
|
109
|
+
if (requestParameters['transaction'] == null) {
|
|
110
|
+
throw new runtime.RequiredError(
|
|
111
|
+
'transaction',
|
|
112
|
+
'Required parameter "transaction" was null or undefined when calling refundTransaction().'
|
|
113
|
+
);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const queryParameters: any = {};
|
|
117
|
+
|
|
118
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
119
|
+
|
|
120
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
let urlPath = `/admin-api/transactions/{transaction}/refund`;
|
|
124
|
+
urlPath = urlPath.replace('{transaction}', encodeURIComponent(String(requestParameters['transaction'])));
|
|
125
|
+
|
|
126
|
+
return {
|
|
127
|
+
path: urlPath,
|
|
128
|
+
method: 'POST',
|
|
129
|
+
headers: headerParameters,
|
|
130
|
+
query: queryParameters,
|
|
131
|
+
body: RefundTransactionRequestToJSON(requestParameters['refundTransactionRequest']),
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Auto-generated: refundTransaction
|
|
137
|
+
*/
|
|
138
|
+
async refundTransactionRaw(requestParameters: RefundTransactionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TransactionResource>> {
|
|
139
|
+
const requestOptions = await this.refundTransactionRequestOpts(requestParameters);
|
|
140
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
141
|
+
|
|
142
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => TransactionResourceFromJSON(jsonValue));
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Auto-generated: refundTransaction
|
|
147
|
+
*/
|
|
148
|
+
async refundTransaction(requestParameters: RefundTransactionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TransactionResource> {
|
|
149
|
+
const response = await this.refundTransactionRaw(requestParameters, initOverrides);
|
|
150
|
+
return await response.value();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Creates request options for storeTransaction without sending the request
|
|
155
|
+
*/
|
|
156
|
+
async storeTransactionRequestOpts(requestParameters: StoreTransactionOperationRequest): Promise<runtime.RequestOpts> {
|
|
157
|
+
const queryParameters: any = {};
|
|
158
|
+
|
|
159
|
+
const headerParameters: runtime.HTTPHeaders = {};
|
|
160
|
+
|
|
161
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
let urlPath = `/admin-api/transactions/create`;
|
|
165
|
+
|
|
166
|
+
return {
|
|
167
|
+
path: urlPath,
|
|
168
|
+
method: 'POST',
|
|
169
|
+
headers: headerParameters,
|
|
170
|
+
query: queryParameters,
|
|
171
|
+
body: StoreTransactionRequestToJSON(requestParameters['storeTransactionRequest']),
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Auto-generated: storeTransaction
|
|
177
|
+
*/
|
|
178
|
+
async storeTransactionRaw(requestParameters: StoreTransactionOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<GenericResponse>> {
|
|
179
|
+
const requestOptions = await this.storeTransactionRequestOpts(requestParameters);
|
|
180
|
+
const response = await this.request(requestOptions, initOverrides);
|
|
181
|
+
|
|
182
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => GenericResponseFromJSON(jsonValue));
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/**
|
|
186
|
+
* Auto-generated: storeTransaction
|
|
187
|
+
*/
|
|
188
|
+
async storeTransaction(requestParameters: StoreTransactionOperationRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<GenericResponse> {
|
|
189
|
+
const response = await this.storeTransactionRaw(requestParameters, initOverrides);
|
|
190
|
+
return await response.value();
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
}
|
package/src/apis/index.ts
CHANGED
|
@@ -24,7 +24,7 @@ export interface AddressFrontendResource {
|
|
|
24
24
|
* @type {string}
|
|
25
25
|
* @memberof AddressFrontendResource
|
|
26
26
|
*/
|
|
27
|
-
company
|
|
27
|
+
company?: string | null;
|
|
28
28
|
/**
|
|
29
29
|
*
|
|
30
30
|
* @type {string}
|
|
@@ -73,7 +73,6 @@ export interface AddressFrontendResource {
|
|
|
73
73
|
* Check if a given object implements the AddressFrontendResource interface.
|
|
74
74
|
*/
|
|
75
75
|
export function instanceOfAddressFrontendResource(value: object): value is AddressFrontendResource {
|
|
76
|
-
if (!('company' in value) || value['company'] === undefined) return false;
|
|
77
76
|
if (!('line1' in value) || value['line1'] === undefined) return false;
|
|
78
77
|
if (!('postcode' in value) || value['postcode'] === undefined) return false;
|
|
79
78
|
if (!('suburb' in value) || value['suburb'] === undefined) return false;
|
|
@@ -93,7 +92,7 @@ export function AddressFrontendResourceFromJSONTyped(json: any, ignoreDiscrimina
|
|
|
93
92
|
}
|
|
94
93
|
return {
|
|
95
94
|
|
|
96
|
-
'company': json['company'],
|
|
95
|
+
'company': json['company'] == null ? undefined : json['company'],
|
|
97
96
|
'line1': json['line1'],
|
|
98
97
|
'line2': json['line2'] == null ? undefined : json['line2'],
|
|
99
98
|
'postcode': json['postcode'],
|
|
@@ -36,13 +36,19 @@ export interface AddressResource {
|
|
|
36
36
|
* @type {string}
|
|
37
37
|
* @memberof AddressResource
|
|
38
38
|
*/
|
|
39
|
-
addresseeName
|
|
39
|
+
addresseeName?: string | null;
|
|
40
40
|
/**
|
|
41
41
|
*
|
|
42
42
|
* @type {string}
|
|
43
43
|
* @memberof AddressResource
|
|
44
44
|
*/
|
|
45
|
-
company
|
|
45
|
+
company?: string | null;
|
|
46
|
+
/**
|
|
47
|
+
*
|
|
48
|
+
* @type {string}
|
|
49
|
+
* @memberof AddressResource
|
|
50
|
+
*/
|
|
51
|
+
addressee: string;
|
|
46
52
|
/**
|
|
47
53
|
*
|
|
48
54
|
* @type {string}
|
|
@@ -54,7 +60,7 @@ export interface AddressResource {
|
|
|
54
60
|
* @type {string}
|
|
55
61
|
* @memberof AddressResource
|
|
56
62
|
*/
|
|
57
|
-
line2
|
|
63
|
+
line2?: string | null;
|
|
58
64
|
/**
|
|
59
65
|
*
|
|
60
66
|
* @type {string}
|
|
@@ -91,10 +97,8 @@ export interface AddressResource {
|
|
|
91
97
|
* Check if a given object implements the AddressResource interface.
|
|
92
98
|
*/
|
|
93
99
|
export function instanceOfAddressResource(value: object): value is AddressResource {
|
|
94
|
-
if (!('
|
|
95
|
-
if (!('company' in value) || value['company'] === undefined) return false;
|
|
100
|
+
if (!('addressee' in value) || value['addressee'] === undefined) return false;
|
|
96
101
|
if (!('line1' in value) || value['line1'] === undefined) return false;
|
|
97
|
-
if (!('line2' in value) || value['line2'] === undefined) return false;
|
|
98
102
|
if (!('postcode' in value) || value['postcode'] === undefined) return false;
|
|
99
103
|
if (!('suburb' in value) || value['suburb'] === undefined) return false;
|
|
100
104
|
if (!('country' in value) || value['country'] === undefined) return false;
|
|
@@ -115,10 +119,11 @@ export function AddressResourceFromJSONTyped(json: any, ignoreDiscriminator: boo
|
|
|
115
119
|
|
|
116
120
|
'id': json['id'] == null ? undefined : json['id'],
|
|
117
121
|
'sourceAddressId': json['source_address_id'] == null ? undefined : json['source_address_id'],
|
|
118
|
-
'addresseeName': json['addressee_name'],
|
|
119
|
-
'company': json['company'],
|
|
122
|
+
'addresseeName': json['addressee_name'] == null ? undefined : json['addressee_name'],
|
|
123
|
+
'company': json['company'] == null ? undefined : json['company'],
|
|
124
|
+
'addressee': json['addressee'],
|
|
120
125
|
'line1': json['line_1'],
|
|
121
|
-
'line2': json['line_2'],
|
|
126
|
+
'line2': json['line_2'] == null ? undefined : json['line_2'],
|
|
122
127
|
'postcode': json['postcode'],
|
|
123
128
|
'suburb': json['suburb'],
|
|
124
129
|
'country': json['country'],
|
|
@@ -142,6 +147,7 @@ export function AddressResourceToJSONTyped(value?: AddressResource | null, ignor
|
|
|
142
147
|
'source_address_id': value['sourceAddressId'],
|
|
143
148
|
'addressee_name': value['addresseeName'],
|
|
144
149
|
'company': value['company'],
|
|
150
|
+
'addressee': value['addressee'],
|
|
145
151
|
'line_1': value['line1'],
|
|
146
152
|
'line_2': value['line2'],
|
|
147
153
|
'postcode': value['postcode'],
|
|
@@ -100,12 +100,6 @@ export interface AdminOrderResource {
|
|
|
100
100
|
* @memberof AdminOrderResource
|
|
101
101
|
*/
|
|
102
102
|
insuranceAmount: number;
|
|
103
|
-
/**
|
|
104
|
-
*
|
|
105
|
-
* @type {boolean}
|
|
106
|
-
* @memberof AdminOrderResource
|
|
107
|
-
*/
|
|
108
|
-
includeInsurance: boolean;
|
|
109
103
|
/**
|
|
110
104
|
*
|
|
111
105
|
* @type {boolean}
|
|
@@ -291,7 +285,6 @@ export function instanceOfAdminOrderResource(value: object): value is AdminOrder
|
|
|
291
285
|
if (!('shippingType' in value) || value['shippingType'] === undefined) return false;
|
|
292
286
|
if (!('overrideShipping' in value) || value['overrideShipping'] === undefined) return false;
|
|
293
287
|
if (!('insuranceAmount' in value) || value['insuranceAmount'] === undefined) return false;
|
|
294
|
-
if (!('includeInsurance' in value) || value['includeInsurance'] === undefined) return false;
|
|
295
288
|
if (!('overrideInsurance' in value) || value['overrideInsurance'] === undefined) return false;
|
|
296
289
|
if (!('useAsBillingAddress' in value) || value['useAsBillingAddress'] === undefined) return false;
|
|
297
290
|
if (!('isNetsuiteLocked' in value) || value['isNetsuiteLocked'] === undefined) return false;
|
|
@@ -342,7 +335,6 @@ export function AdminOrderResourceFromJSONTyped(json: any, ignoreDiscriminator:
|
|
|
342
335
|
'shippingSubtotal': json['shipping_subtotal'] == null ? undefined : json['shipping_subtotal'],
|
|
343
336
|
'overrideShipping': json['override_shipping'],
|
|
344
337
|
'insuranceAmount': json['insurance_amount'],
|
|
345
|
-
'includeInsurance': json['include_insurance'],
|
|
346
338
|
'overrideInsurance': json['override_insurance'],
|
|
347
339
|
'useAsBillingAddress': json['use_as_billing_address'],
|
|
348
340
|
'netsuiteId': json['netsuite_id'] == null ? undefined : json['netsuite_id'],
|
|
@@ -397,7 +389,6 @@ export function AdminOrderResourceToJSONTyped(value?: AdminOrderResource | null,
|
|
|
397
389
|
'shipping_subtotal': value['shippingSubtotal'],
|
|
398
390
|
'override_shipping': value['overrideShipping'],
|
|
399
391
|
'insurance_amount': value['insuranceAmount'],
|
|
400
|
-
'include_insurance': value['includeInsurance'],
|
|
401
392
|
'override_insurance': value['overrideInsurance'],
|
|
402
393
|
'use_as_billing_address': value['useAsBillingAddress'],
|
|
403
394
|
'netsuite_id': value['netsuiteId'],
|
|
@@ -83,12 +83,6 @@ export interface CartListResource {
|
|
|
83
83
|
* @memberof CartListResource
|
|
84
84
|
*/
|
|
85
85
|
insuranceAmount?: number | null;
|
|
86
|
-
/**
|
|
87
|
-
*
|
|
88
|
-
* @type {boolean}
|
|
89
|
-
* @memberof CartListResource
|
|
90
|
-
*/
|
|
91
|
-
includeInsurance: boolean;
|
|
92
86
|
/**
|
|
93
87
|
*
|
|
94
88
|
* @type {boolean}
|
|
@@ -157,7 +151,6 @@ export interface CartListResource {
|
|
|
157
151
|
export function instanceOfCartListResource(value: object): value is CartListResource {
|
|
158
152
|
if (!('source' in value) || value['source'] === undefined) return false;
|
|
159
153
|
if (!('overrideShipping' in value) || value['overrideShipping'] === undefined) return false;
|
|
160
|
-
if (!('includeInsurance' in value) || value['includeInsurance'] === undefined) return false;
|
|
161
154
|
if (!('overrideInsurance' in value) || value['overrideInsurance'] === undefined) return false;
|
|
162
155
|
if (!('useAsBillingAddress' in value) || value['useAsBillingAddress'] === undefined) return false;
|
|
163
156
|
if (!('expiryDate' in value) || value['expiryDate'] === undefined) return false;
|
|
@@ -186,7 +179,6 @@ export function CartListResourceFromJSONTyped(json: any, ignoreDiscriminator: bo
|
|
|
186
179
|
'shippingSubtotal': json['shipping_subtotal'] == null ? undefined : json['shipping_subtotal'],
|
|
187
180
|
'overrideShipping': json['override_shipping'],
|
|
188
181
|
'insuranceAmount': json['insurance_amount'] == null ? undefined : json['insurance_amount'],
|
|
189
|
-
'includeInsurance': json['include_insurance'],
|
|
190
182
|
'overrideInsurance': json['override_insurance'],
|
|
191
183
|
'useAsBillingAddress': json['use_as_billing_address'],
|
|
192
184
|
'expiryDate': (new Date(json['expiry_date'])),
|
|
@@ -218,7 +210,6 @@ export function CartListResourceToJSONTyped(value?: CartListResource | null, ign
|
|
|
218
210
|
'shipping_subtotal': value['shippingSubtotal'],
|
|
219
211
|
'override_shipping': value['overrideShipping'],
|
|
220
212
|
'insurance_amount': value['insuranceAmount'],
|
|
221
|
-
'include_insurance': value['includeInsurance'],
|
|
222
213
|
'override_insurance': value['overrideInsurance'],
|
|
223
214
|
'use_as_billing_address': value['useAsBillingAddress'],
|
|
224
215
|
'expiry_date': value['expiryDate'].toISOString(),
|