@wyocrm/sdk 5.0.38
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/LICENSE +21 -0
- package/README.md +162 -0
- package/build/index.d.ts +566 -0
- package/build/index.js +3 -0
- package/build/index.js.LICENSE.txt +13 -0
- package/package.json +80 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2019 Francisco Hodge
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# @wyocrm/sdk
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@wyocrm/sdk)
|
|
4
|
+
|
|
5
|
+
Official SDK for WyoCRM - Streamline your customer relationship management with our powerful API integration.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @wyocrm/sdk
|
|
11
|
+
# or
|
|
12
|
+
yarn add @wyocrm/sdk
|
|
13
|
+
# or
|
|
14
|
+
pnpm add @wyocrm/sdk
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
```javascript
|
|
20
|
+
import WyoCRM from '@wyocrm/sdk';
|
|
21
|
+
|
|
22
|
+
// Initialize the SDK with your API key
|
|
23
|
+
const client = new WyoCRM({
|
|
24
|
+
merchantGuid: 'YOUR_MERCHANT_GUID', // Your merchant GUID (required)
|
|
25
|
+
token: 'YOUR_AUTH_TOKEN', // Optional: Your authentication token
|
|
26
|
+
apiKey: 'YOUR_API_KEY', // Optional: Your API key
|
|
27
|
+
baseURL: 'basedURL', // Optional: Custom base URL
|
|
28
|
+
defaultHeaders: { // Optional: Custom headers
|
|
29
|
+
'Custom-Header': 'value'},
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// Example: Creating a new customer
|
|
33
|
+
async function createNewCustomer() {
|
|
34
|
+
try {
|
|
35
|
+
const newCustomer = await client.createCustomer({
|
|
36
|
+
ref_id: 'customer_ref_id',
|
|
37
|
+
display_name: 'John Doe',
|
|
38
|
+
// Other fields omitted...
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
});
|
|
43
|
+
console.log('New Customer Created:', newCustomer);
|
|
44
|
+
} catch (error) {
|
|
45
|
+
console.error('Error creating customer:', error);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Call the function to create a new customer
|
|
50
|
+
createNewCustomer();
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## Features
|
|
54
|
+
|
|
55
|
+
- ๐ Full TypeScript support
|
|
56
|
+
- ๐ฆ Modern ES Modules support
|
|
57
|
+
- ๐ Simple authentication
|
|
58
|
+
- ๐ Automatic retries on failed requests
|
|
59
|
+
- ๐ Comprehensive logging options
|
|
60
|
+
- ๐งช Testing utilities included
|
|
61
|
+
|
|
62
|
+
## Documentation
|
|
63
|
+
|
|
64
|
+
For detailed documentation, visit our [official documentation](https://wyocrm.com/docs).
|
|
65
|
+
|
|
66
|
+
## API Reference
|
|
67
|
+
|
|
68
|
+
### Client Configuration
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
import WyoCRM from '@wyocrm/sdk';
|
|
72
|
+
|
|
73
|
+
const client = new WyoCRM({
|
|
74
|
+
merchantGuid: 'YOUR_MERCHANT_GUID', // Your merchant GUID (required)
|
|
75
|
+
token: 'YOUR_AUTH_TOKEN', // Optional: Your authentication token
|
|
76
|
+
apiKey: 'YOUR_API_KEY', // Optional: Your API key
|
|
77
|
+
baseURL: 'basedURL', // Optional: Custom base URL
|
|
78
|
+
defaultHeaders: { // Optional: Custom headers
|
|
79
|
+
'Custom-Header': 'value'},
|
|
80
|
+
});
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Available Methods
|
|
84
|
+
- *uploadCustomerPhoto*
|
|
85
|
+
- *createCustomer*
|
|
86
|
+
- *updateCustomer*
|
|
87
|
+
- *deleteCustomer*
|
|
88
|
+
- *getCustomerById*
|
|
89
|
+
- *getCouponsByCustomerId*
|
|
90
|
+
- *searchCustomers*
|
|
91
|
+
- *queryCustomers*
|
|
92
|
+
- *queryTransactions*
|
|
93
|
+
- *queryOrders*
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
## Error Handling
|
|
98
|
+
|
|
99
|
+
The SDK throws typed errors that you can catch and handle appropriately:
|
|
100
|
+
|
|
101
|
+
```javascript
|
|
102
|
+
try {
|
|
103
|
+
await client.deleteCustomer(1);
|
|
104
|
+
console.log('Customer deleted successfully.');
|
|
105
|
+
} catch (error) {
|
|
106
|
+
if (error.response) {
|
|
107
|
+
// The request was made and the server responded with a status code
|
|
108
|
+
console.error('Error Response:', error.response.data);
|
|
109
|
+
} else if (error.request) {
|
|
110
|
+
// The request was made but no response was received
|
|
111
|
+
console.error('No Response:', error.request);
|
|
112
|
+
} else {
|
|
113
|
+
// Something happened in setting up the request that triggered an error
|
|
114
|
+
console.error('Error:', error.message);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
## Rate Limiting
|
|
120
|
+
|
|
121
|
+
The SDK includes built-in rate limiting handling. When you exceed the rate limit, the SDK will automatically wait and retry your request.
|
|
122
|
+
|
|
123
|
+
## Development
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
# Install dependencies
|
|
127
|
+
npm install
|
|
128
|
+
|
|
129
|
+
# Run tests
|
|
130
|
+
npm test
|
|
131
|
+
|
|
132
|
+
# Build the package
|
|
133
|
+
npm run build
|
|
134
|
+
|
|
135
|
+
# Generate documentation
|
|
136
|
+
npm run docs
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
## Contributing
|
|
140
|
+
|
|
141
|
+
We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details.
|
|
142
|
+
|
|
143
|
+
## License
|
|
144
|
+
|
|
145
|
+
Copyright ยฉ 2024 WyoCRM. All rights reserved.
|
|
146
|
+
|
|
147
|
+
This software is proprietary and confidential. Unauthorized copying, transferring or reproduction of this software, via any medium is strictly prohibited.
|
|
148
|
+
|
|
149
|
+
The use of this software is subject to the terms of the WyoCRM Software License Agreement. For inquiries, please contact support@wyocrm.com
|
|
150
|
+
|
|
151
|
+
## Support
|
|
152
|
+
|
|
153
|
+
- Email: support@wyocrm.com
|
|
154
|
+
- Website: [https://wyocrm.com](https://wyocrm.com)
|
|
155
|
+
|
|
156
|
+
## Security
|
|
157
|
+
|
|
158
|
+
If you discover a security vulnerability, please send an email to support@wyocrm.com. We take all security issues seriously.
|
|
159
|
+
|
|
160
|
+
## Changelog
|
|
161
|
+
|
|
162
|
+
See [CHANGELOG.md](CHANGELOG.md) for a list of changes.
|
package/build/index.d.ts
ADDED
|
@@ -0,0 +1,566 @@
|
|
|
1
|
+
declare module '@wyocrm/sdk/index' {
|
|
2
|
+
export * from '@wyocrm/sdk/types';
|
|
3
|
+
export * from '@wyocrm/sdk/utils';
|
|
4
|
+
export * from '@wyocrm/sdk/services';
|
|
5
|
+
|
|
6
|
+
}
|
|
7
|
+
declare module '@wyocrm/sdk/services' {
|
|
8
|
+
import { AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
9
|
+
import { ICustomerOptions, ICustomer, ITransaction, IOrder, ICouponItem, IApiResponse, IFileUploadRequest, ICharge, IObjectResponse } from '@wyocrm/sdk/types';
|
|
10
|
+
import { QueryBuilder } from '@wyocrm/sdk/utils';
|
|
11
|
+
export interface IServiceOptions {
|
|
12
|
+
merchantGuid: string;
|
|
13
|
+
token?: string;
|
|
14
|
+
apiKey?: string;
|
|
15
|
+
baseURL: string;
|
|
16
|
+
defaultHeaders?: Record<string, string>;
|
|
17
|
+
}
|
|
18
|
+
export class Configurator {
|
|
19
|
+
private static httpClient;
|
|
20
|
+
private static isInitialized;
|
|
21
|
+
private static merchantGuid;
|
|
22
|
+
static initialize(config: IServiceOptions): void;
|
|
23
|
+
static getHttpClient(): AxiosInstance;
|
|
24
|
+
static getMerchantGuid(): string;
|
|
25
|
+
}
|
|
26
|
+
export interface ITerminalServices {
|
|
27
|
+
uploadCustomerPhoto(customerId: number, fileUpload: IFileUploadRequest, axiosConfig?: AxiosRequestConfig): Promise<void>;
|
|
28
|
+
createCustomer(options: ICustomerOptions, axiosConfig?: AxiosRequestConfig): Promise<ICustomer>;
|
|
29
|
+
updateCustomer(options: ICustomerOptions, axiosConfig?: AxiosRequestConfig): Promise<ICustomer>;
|
|
30
|
+
deleteCustomer(id: number, axiosConfig?: AxiosRequestConfig): Promise<void>;
|
|
31
|
+
getCustomerById(id: number, axiosConfig?: AxiosRequestConfig): Promise<ICustomer>;
|
|
32
|
+
getCouponsByCustomerId(id: number, axiosConfig?: AxiosRequestConfig): Promise<IApiResponse<ICouponItem>>;
|
|
33
|
+
searchCustomers(keyword: string, builder: QueryBuilder<ICustomer>, axiosConfig?: AxiosRequestConfig): Promise<ICustomer[]>;
|
|
34
|
+
queryCustomers(builder: QueryBuilder<ICustomer>, searchKeywords?: string, axiosConfig?: AxiosRequestConfig): Promise<ICustomer[]>;
|
|
35
|
+
queryTransactions(query: QueryBuilder<ITransaction>, axiosConfig?: AxiosRequestConfig): Promise<ITransaction[]>;
|
|
36
|
+
queryOrders(query: QueryBuilder<IOrder>, axiosConfig?: AxiosRequestConfig): Promise<IOrder[]>;
|
|
37
|
+
createCharge(terminalId: string, amount: number, invoiceRefId: string, description: string, axiosConfig?: AxiosRequestConfig): Promise<ICharge>;
|
|
38
|
+
getCharge(chargeGuid: string, axiosConfig?: AxiosRequestConfig): Promise<IObjectResponse<ICharge>>;
|
|
39
|
+
}
|
|
40
|
+
export class TerminalServices implements ITerminalServices {
|
|
41
|
+
uploadCustomerPhoto(customerId: number, fileUpload: IFileUploadRequest, axiosConfig?: AxiosRequestConfig): Promise<void>;
|
|
42
|
+
createCustomer(options: ICustomerOptions, axiosConfig?: AxiosRequestConfig): Promise<any>;
|
|
43
|
+
updateCustomer(options: ICustomerOptions, axiosConfig?: AxiosRequestConfig): Promise<any>;
|
|
44
|
+
deleteCustomer(id: number, axiosConfig?: AxiosRequestConfig): Promise<void>;
|
|
45
|
+
getCustomerById(id: number, axiosConfig?: AxiosRequestConfig): Promise<any>;
|
|
46
|
+
getCouponsByCustomerId(id: number, axiosConfig?: AxiosRequestConfig): Promise<any>;
|
|
47
|
+
searchCustomers(keyword: string, builder: QueryBuilder<ICustomer>, axiosConfig?: AxiosRequestConfig): Promise<any>;
|
|
48
|
+
queryCustomers(builder: QueryBuilder<ICustomer>, searchKeywords?: string, axiosConfig?: AxiosRequestConfig): Promise<any>;
|
|
49
|
+
queryTransactions(builder: QueryBuilder<ITransaction>, axiosConfig?: AxiosRequestConfig): Promise<any>;
|
|
50
|
+
queryOrders(builder: QueryBuilder<IOrder>, axiosConfig?: AxiosRequestConfig): Promise<any>;
|
|
51
|
+
createCharge(terminalId: string, amount: number, invoiceRefId: string, description: string, axiosConfig?: AxiosRequestConfig): Promise<any>;
|
|
52
|
+
getCharge(chargeGuid: string, axiosConfig?: AxiosRequestConfig): Promise<IObjectResponse<ICharge>>;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
}
|
|
56
|
+
declare module '@wyocrm/sdk/types' {
|
|
57
|
+
export interface Result {
|
|
58
|
+
phone_number?: string | undefined;
|
|
59
|
+
succeeded?: boolean;
|
|
60
|
+
created_at?: Date;
|
|
61
|
+
}
|
|
62
|
+
export interface ExternalOrder {
|
|
63
|
+
order?: Order | undefined;
|
|
64
|
+
delivery?: Delivery | undefined;
|
|
65
|
+
}
|
|
66
|
+
export interface Delivery {
|
|
67
|
+
created_at?: Date;
|
|
68
|
+
updated_at?: Date;
|
|
69
|
+
errors?: string[] | undefined;
|
|
70
|
+
id?: number;
|
|
71
|
+
user_id?: number;
|
|
72
|
+
price?: number;
|
|
73
|
+
currency?: string | undefined;
|
|
74
|
+
provider?: string | undefined;
|
|
75
|
+
provider_order_id?: string | undefined;
|
|
76
|
+
driver_name?: string | undefined;
|
|
77
|
+
driver_phone_number?: string | undefined;
|
|
78
|
+
status?: string | undefined;
|
|
79
|
+
from_address?: Address | undefined;
|
|
80
|
+
to_address1?: Address | undefined;
|
|
81
|
+
}
|
|
82
|
+
export interface Address {
|
|
83
|
+
created_at?: Date;
|
|
84
|
+
updated_at?: Date;
|
|
85
|
+
errors?: string[] | undefined;
|
|
86
|
+
id?: number;
|
|
87
|
+
user_id?: number;
|
|
88
|
+
address1?: string | undefined;
|
|
89
|
+
address2?: string | undefined;
|
|
90
|
+
postcode?: string | undefined;
|
|
91
|
+
lat?: string | undefined;
|
|
92
|
+
lng?: string | undefined;
|
|
93
|
+
note?: string | undefined;
|
|
94
|
+
is_default?: boolean;
|
|
95
|
+
name?: string | undefined;
|
|
96
|
+
salute?: string | undefined;
|
|
97
|
+
phone_number?: string | undefined;
|
|
98
|
+
}
|
|
99
|
+
export interface Response {
|
|
100
|
+
errors?: string[] | undefined;
|
|
101
|
+
failures_count?: number | undefined;
|
|
102
|
+
}
|
|
103
|
+
export interface FileResponse {
|
|
104
|
+
data: Blob;
|
|
105
|
+
status: number;
|
|
106
|
+
fileName?: string;
|
|
107
|
+
headers?: {
|
|
108
|
+
[name: string]: any;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
export interface ICustomer {
|
|
112
|
+
membership_id: string;
|
|
113
|
+
license_id: number;
|
|
114
|
+
credit: number;
|
|
115
|
+
point: number;
|
|
116
|
+
transaction_total: number;
|
|
117
|
+
transaction_time: number;
|
|
118
|
+
tier: any | null;
|
|
119
|
+
tag_guids: string[] | null;
|
|
120
|
+
user_group_id: number;
|
|
121
|
+
user_group_name: string | null;
|
|
122
|
+
group_expires_at: string;
|
|
123
|
+
error: string | null;
|
|
124
|
+
id: number;
|
|
125
|
+
ref_id: string;
|
|
126
|
+
image_url: string | null;
|
|
127
|
+
stripe_token: string | null;
|
|
128
|
+
stripe_customer_id: string | null;
|
|
129
|
+
username: string;
|
|
130
|
+
company: string | null;
|
|
131
|
+
ic: string | null;
|
|
132
|
+
display_name: string;
|
|
133
|
+
full_name: string;
|
|
134
|
+
birth_date: string | null;
|
|
135
|
+
gender: string | null;
|
|
136
|
+
address: string | null;
|
|
137
|
+
postcode: string | null;
|
|
138
|
+
note: string | null;
|
|
139
|
+
language: string | null;
|
|
140
|
+
time_zone: string | null;
|
|
141
|
+
created_at: string;
|
|
142
|
+
updated_at: string;
|
|
143
|
+
license_ids: string;
|
|
144
|
+
security_stamp: string;
|
|
145
|
+
phone_number: string;
|
|
146
|
+
email: string | null;
|
|
147
|
+
email_confirmed: boolean;
|
|
148
|
+
phone_number_confirmed: boolean;
|
|
149
|
+
agree_pdpa_at: string | null;
|
|
150
|
+
}
|
|
151
|
+
export class Customer implements ICustomer {
|
|
152
|
+
membership_id: string;
|
|
153
|
+
license_id: number;
|
|
154
|
+
credit: number;
|
|
155
|
+
point: number;
|
|
156
|
+
transaction_total: number;
|
|
157
|
+
transaction_time: number;
|
|
158
|
+
tier: any;
|
|
159
|
+
tag_guids: any;
|
|
160
|
+
user_group_id: number;
|
|
161
|
+
user_group_name: any;
|
|
162
|
+
group_expires_at: string;
|
|
163
|
+
error: any;
|
|
164
|
+
id: number;
|
|
165
|
+
ref_id: string;
|
|
166
|
+
image_url: any;
|
|
167
|
+
stripe_token: any;
|
|
168
|
+
stripe_customer_id: any;
|
|
169
|
+
username: string;
|
|
170
|
+
company: any;
|
|
171
|
+
ic: any;
|
|
172
|
+
display_name: string;
|
|
173
|
+
full_name: string;
|
|
174
|
+
birth_date: any;
|
|
175
|
+
gender: any;
|
|
176
|
+
address: any;
|
|
177
|
+
postcode: any;
|
|
178
|
+
note: any;
|
|
179
|
+
language: any;
|
|
180
|
+
time_zone: any;
|
|
181
|
+
created_at: string;
|
|
182
|
+
updated_at: string;
|
|
183
|
+
license_ids: string;
|
|
184
|
+
security_stamp: string;
|
|
185
|
+
phone_number: string;
|
|
186
|
+
email: any;
|
|
187
|
+
email_confirmed: boolean;
|
|
188
|
+
phone_number_confirmed: boolean;
|
|
189
|
+
agree_pdpa_at: any;
|
|
190
|
+
}
|
|
191
|
+
export type ICustomerOptions = {
|
|
192
|
+
ref_id: string;
|
|
193
|
+
ic: string;
|
|
194
|
+
display_name: string;
|
|
195
|
+
image_url: string;
|
|
196
|
+
birth_date: string;
|
|
197
|
+
gender: string;
|
|
198
|
+
language: string;
|
|
199
|
+
phone_number: string;
|
|
200
|
+
email: string;
|
|
201
|
+
};
|
|
202
|
+
export class CustomerOptions implements ICustomerOptions {
|
|
203
|
+
ref_id: string;
|
|
204
|
+
ic: string;
|
|
205
|
+
display_name: string;
|
|
206
|
+
image_url: string;
|
|
207
|
+
birth_date: string;
|
|
208
|
+
gender: string;
|
|
209
|
+
language: string;
|
|
210
|
+
phone_number: string;
|
|
211
|
+
email: string;
|
|
212
|
+
constructor();
|
|
213
|
+
}
|
|
214
|
+
export type Operator<T> = T extends number ? keyof typeof NumericOperators : T extends string ? keyof typeof StringOperators : never;
|
|
215
|
+
export type OperatorValueMap = {
|
|
216
|
+
[K in Operator<any>]: K extends keyof typeof NumericOperators ? number : K extends keyof typeof StringOperators ? string : K extends keyof typeof MonthOperator ? MonthValues : K extends keyof typeof DayOperator ? string : never;
|
|
217
|
+
};
|
|
218
|
+
export enum NumericOperators {
|
|
219
|
+
'>' = 0,
|
|
220
|
+
'>=' = 1,
|
|
221
|
+
'<' = 2,
|
|
222
|
+
'<=' = 3,
|
|
223
|
+
'=' = 4
|
|
224
|
+
}
|
|
225
|
+
export enum StringOperators {
|
|
226
|
+
'Contains' = 0,
|
|
227
|
+
'NotContains' = 1,
|
|
228
|
+
'StartsWith' = 2,
|
|
229
|
+
'EndsWith' = 3
|
|
230
|
+
}
|
|
231
|
+
export enum MonthOperator {
|
|
232
|
+
WithinAMonth = "Contains"
|
|
233
|
+
}
|
|
234
|
+
export enum DayOperator {
|
|
235
|
+
At = "StartsWith"
|
|
236
|
+
}
|
|
237
|
+
export enum MonthValues {
|
|
238
|
+
Jan = "-01-",
|
|
239
|
+
Feb = "-02-",
|
|
240
|
+
Mar = "-03-",
|
|
241
|
+
Apr = "-04-",
|
|
242
|
+
May = "-05-",
|
|
243
|
+
Jun = "-06-",
|
|
244
|
+
Jul = "-07-",
|
|
245
|
+
Aug = "-08-",
|
|
246
|
+
Sep = "-09-",
|
|
247
|
+
Oct = "-10-",
|
|
248
|
+
Nov = "-11-",
|
|
249
|
+
Dec = "-12-"
|
|
250
|
+
}
|
|
251
|
+
export interface ITransaction {
|
|
252
|
+
id: number;
|
|
253
|
+
invoice_id: number;
|
|
254
|
+
type: string;
|
|
255
|
+
primary_license_id: number;
|
|
256
|
+
license_id: number;
|
|
257
|
+
ref_id: string;
|
|
258
|
+
user_id: number;
|
|
259
|
+
add_credit: number;
|
|
260
|
+
minus_credit: number;
|
|
261
|
+
add_point: number;
|
|
262
|
+
minus_point: number;
|
|
263
|
+
status: string;
|
|
264
|
+
grand_total: number;
|
|
265
|
+
is_local: boolean;
|
|
266
|
+
closed_at: string;
|
|
267
|
+
created_at: string;
|
|
268
|
+
updated_at: string;
|
|
269
|
+
errors: string[];
|
|
270
|
+
}
|
|
271
|
+
export class Transaction implements ITransaction {
|
|
272
|
+
id: number;
|
|
273
|
+
invoice_id: number;
|
|
274
|
+
type: string;
|
|
275
|
+
primary_license_id: number;
|
|
276
|
+
license_id: number;
|
|
277
|
+
ref_id: string;
|
|
278
|
+
user_id: number;
|
|
279
|
+
add_credit: number;
|
|
280
|
+
minus_credit: number;
|
|
281
|
+
add_point: number;
|
|
282
|
+
minus_point: number;
|
|
283
|
+
status: string;
|
|
284
|
+
grand_total: number;
|
|
285
|
+
is_local: boolean;
|
|
286
|
+
closed_at: string;
|
|
287
|
+
created_at: string;
|
|
288
|
+
updated_at: string;
|
|
289
|
+
errors: string[];
|
|
290
|
+
constructor();
|
|
291
|
+
}
|
|
292
|
+
export enum OrderStatus {
|
|
293
|
+
PayAtCounter = "Pay At Counter",
|
|
294
|
+
PlacingOrder = "Placing Order",
|
|
295
|
+
PreparingOrder = "Preparing Order",
|
|
296
|
+
DeliveringOrder = "Delivering Order",
|
|
297
|
+
Delivered = "Delivered",
|
|
298
|
+
PickingUp = "Picking Up",
|
|
299
|
+
PickedUp = "Picked Up",
|
|
300
|
+
SendingOrder = "Sending Order",
|
|
301
|
+
Sent = "Sent",
|
|
302
|
+
Cancelled = "Cancelled",
|
|
303
|
+
Confirmed = "Confirmed",
|
|
304
|
+
Expired = "Expired",
|
|
305
|
+
PendingPayment = "Pending Payment",
|
|
306
|
+
PaymentDeclined = "Payment Declined"
|
|
307
|
+
}
|
|
308
|
+
export interface IMeta {
|
|
309
|
+
placed_at: string;
|
|
310
|
+
current_status: string;
|
|
311
|
+
prepare_at: string;
|
|
312
|
+
previous_status: string;
|
|
313
|
+
deliver_at: string;
|
|
314
|
+
delivered_at: string;
|
|
315
|
+
}
|
|
316
|
+
export interface IOrder {
|
|
317
|
+
id: number;
|
|
318
|
+
order_ref: string;
|
|
319
|
+
table_id: number;
|
|
320
|
+
invoice_id: number;
|
|
321
|
+
call_num: number;
|
|
322
|
+
user_id: number;
|
|
323
|
+
license_id: number;
|
|
324
|
+
charge_id: number;
|
|
325
|
+
delivery_id: number;
|
|
326
|
+
order_type: string;
|
|
327
|
+
payment_source_id: number;
|
|
328
|
+
status: OrderStatus;
|
|
329
|
+
customer_name: string;
|
|
330
|
+
customer_phone_number: string;
|
|
331
|
+
meta: IMeta;
|
|
332
|
+
created_at: string;
|
|
333
|
+
updated_at: string;
|
|
334
|
+
errors: string[];
|
|
335
|
+
}
|
|
336
|
+
export class Order implements IOrder {
|
|
337
|
+
id: number;
|
|
338
|
+
order_ref: string;
|
|
339
|
+
table_id: number;
|
|
340
|
+
invoice_id: number;
|
|
341
|
+
call_num: number;
|
|
342
|
+
user_id: number;
|
|
343
|
+
license_id: number;
|
|
344
|
+
charge_id: number;
|
|
345
|
+
delivery_id: number;
|
|
346
|
+
order_type: string;
|
|
347
|
+
payment_source_id: number;
|
|
348
|
+
status: OrderStatus;
|
|
349
|
+
customer_name: string;
|
|
350
|
+
customer_phone_number: string;
|
|
351
|
+
meta: IMeta;
|
|
352
|
+
created_at: string;
|
|
353
|
+
updated_at: string;
|
|
354
|
+
errors: string[];
|
|
355
|
+
constructor();
|
|
356
|
+
}
|
|
357
|
+
export interface IQueryResponse<T> {
|
|
358
|
+
offset: number;
|
|
359
|
+
total?: number | undefined;
|
|
360
|
+
results: T[];
|
|
361
|
+
meta?: {
|
|
362
|
+
[index: string]: string;
|
|
363
|
+
} | undefined;
|
|
364
|
+
response_status?: IResponseStatus | undefined;
|
|
365
|
+
}
|
|
366
|
+
export interface IResponseStatus {
|
|
367
|
+
error_code?: string | undefined;
|
|
368
|
+
message?: string | undefined;
|
|
369
|
+
stack_trace?: string | undefined;
|
|
370
|
+
errors?: IResponseError[] | undefined;
|
|
371
|
+
meta?: {
|
|
372
|
+
[index: string]: string;
|
|
373
|
+
} | undefined;
|
|
374
|
+
}
|
|
375
|
+
export class IResponseError {
|
|
376
|
+
error_code?: string | undefined;
|
|
377
|
+
field_name?: string | undefined;
|
|
378
|
+
message?: string | undefined;
|
|
379
|
+
meta?: {
|
|
380
|
+
[index: string]: string;
|
|
381
|
+
} | undefined;
|
|
382
|
+
}
|
|
383
|
+
export enum ApplyingType {
|
|
384
|
+
ALL = 1,
|
|
385
|
+
INCLUSIVE = 2,
|
|
386
|
+
EXCLUSIVE = 3
|
|
387
|
+
}
|
|
388
|
+
export interface IApplying<T> {
|
|
389
|
+
applying_type: ApplyingType;
|
|
390
|
+
applying_items: T[];
|
|
391
|
+
}
|
|
392
|
+
export class Applying<T> implements IApplying<T> {
|
|
393
|
+
applying_type: ApplyingType;
|
|
394
|
+
applying_items: T[];
|
|
395
|
+
constructor();
|
|
396
|
+
}
|
|
397
|
+
export interface ICoupon {
|
|
398
|
+
guid: string;
|
|
399
|
+
promo_code: string;
|
|
400
|
+
is_multi_stores: boolean;
|
|
401
|
+
name: string;
|
|
402
|
+
alias: string;
|
|
403
|
+
description: string;
|
|
404
|
+
description_alias: string;
|
|
405
|
+
applying_plus: IApplying<string>;
|
|
406
|
+
applying_user_tags: IApplying<string>;
|
|
407
|
+
applying_user_groups: IApplying<number>;
|
|
408
|
+
discount_calc_type: number;
|
|
409
|
+
discount_amount: number;
|
|
410
|
+
discount_percent: number;
|
|
411
|
+
duration: number;
|
|
412
|
+
usage_count: number;
|
|
413
|
+
usage_limit_per_invoice: number;
|
|
414
|
+
above_invoice_amount: number;
|
|
415
|
+
below_invoice_amount: number;
|
|
416
|
+
is_delivery_free: boolean;
|
|
417
|
+
is_individual_use: boolean;
|
|
418
|
+
price_in_points: number;
|
|
419
|
+
styles: any;
|
|
420
|
+
expired_at: string;
|
|
421
|
+
auto_gen: boolean;
|
|
422
|
+
can_sell: boolean;
|
|
423
|
+
can_redeem: boolean;
|
|
424
|
+
created_at: string;
|
|
425
|
+
updated_at: string;
|
|
426
|
+
errors: any[];
|
|
427
|
+
}
|
|
428
|
+
export class Coupon implements ICoupon {
|
|
429
|
+
guid: string;
|
|
430
|
+
promo_code: string;
|
|
431
|
+
is_multi_stores: boolean;
|
|
432
|
+
name: string;
|
|
433
|
+
alias: string;
|
|
434
|
+
description: string;
|
|
435
|
+
description_alias: string;
|
|
436
|
+
applying_plus: Applying<string>;
|
|
437
|
+
applying_user_tags: Applying<string>;
|
|
438
|
+
applying_user_groups: Applying<number>;
|
|
439
|
+
discount_calc_type: number;
|
|
440
|
+
discount_amount: number;
|
|
441
|
+
discount_percent: number;
|
|
442
|
+
duration: number;
|
|
443
|
+
usage_count: number;
|
|
444
|
+
usage_limit_per_invoice: number;
|
|
445
|
+
above_invoice_amount: number;
|
|
446
|
+
below_invoice_amount: number;
|
|
447
|
+
is_delivery_free: boolean;
|
|
448
|
+
is_individual_use: boolean;
|
|
449
|
+
price_in_points: number;
|
|
450
|
+
styles: any;
|
|
451
|
+
expired_at: string;
|
|
452
|
+
auto_gen: boolean;
|
|
453
|
+
can_sell: boolean;
|
|
454
|
+
can_redeem: boolean;
|
|
455
|
+
created_at: string;
|
|
456
|
+
updated_at: string;
|
|
457
|
+
errors: any[];
|
|
458
|
+
constructor();
|
|
459
|
+
}
|
|
460
|
+
export interface ICouponItem {
|
|
461
|
+
guid: string;
|
|
462
|
+
coupon: ICoupon;
|
|
463
|
+
usage: any;
|
|
464
|
+
promo_code: string;
|
|
465
|
+
is_expired: boolean;
|
|
466
|
+
is_redeemed: boolean;
|
|
467
|
+
is_generated: boolean;
|
|
468
|
+
created_at: string;
|
|
469
|
+
updated_at: string;
|
|
470
|
+
errors: any[];
|
|
471
|
+
}
|
|
472
|
+
export class CouponItem implements ICouponItem {
|
|
473
|
+
guid: string;
|
|
474
|
+
coupon: Coupon;
|
|
475
|
+
usage: any;
|
|
476
|
+
promo_code: string;
|
|
477
|
+
is_expired: boolean;
|
|
478
|
+
is_redeemed: boolean;
|
|
479
|
+
is_generated: boolean;
|
|
480
|
+
created_at: string;
|
|
481
|
+
updated_at: string;
|
|
482
|
+
errors: any[];
|
|
483
|
+
constructor();
|
|
484
|
+
}
|
|
485
|
+
export interface IApiResponse<T> {
|
|
486
|
+
data: T[];
|
|
487
|
+
errors: string[];
|
|
488
|
+
count_all: number;
|
|
489
|
+
}
|
|
490
|
+
export class ApiResponse<T> implements IApiResponse<T> {
|
|
491
|
+
data: T[];
|
|
492
|
+
errors: string[];
|
|
493
|
+
count_all: number;
|
|
494
|
+
constructor();
|
|
495
|
+
}
|
|
496
|
+
export enum FileExtension {
|
|
497
|
+
JPG = "jpg",
|
|
498
|
+
PNG = "png"
|
|
499
|
+
}
|
|
500
|
+
export interface IFileUploadRequest {
|
|
501
|
+
name: string;
|
|
502
|
+
base64: string;
|
|
503
|
+
format: FileExtension;
|
|
504
|
+
}
|
|
505
|
+
export class FileUploadRequest implements IFileUploadRequest {
|
|
506
|
+
name: string;
|
|
507
|
+
base64: string;
|
|
508
|
+
format: FileExtension;
|
|
509
|
+
}
|
|
510
|
+
export interface IObjectResponse<T> {
|
|
511
|
+
data: T;
|
|
512
|
+
errors: string[] | null;
|
|
513
|
+
countAll: number;
|
|
514
|
+
}
|
|
515
|
+
export interface ICreateChargeRequest {
|
|
516
|
+
provider_terminal_id: string;
|
|
517
|
+
reference_type: ChargeReferenceType;
|
|
518
|
+
reference_id: string;
|
|
519
|
+
payment_method_code: string;
|
|
520
|
+
description: string;
|
|
521
|
+
amount: number;
|
|
522
|
+
currency: string;
|
|
523
|
+
}
|
|
524
|
+
export interface ICharge extends ICreateChargeRequest {
|
|
525
|
+
guid: string;
|
|
526
|
+
user_id: number;
|
|
527
|
+
payment_source_id: number;
|
|
528
|
+
provider_source_id: string;
|
|
529
|
+
delivery_amount: number;
|
|
530
|
+
status: string;
|
|
531
|
+
is_succeeded: boolean;
|
|
532
|
+
errors: string[];
|
|
533
|
+
etc: IChargeEtc;
|
|
534
|
+
}
|
|
535
|
+
export interface IChargeEtc {
|
|
536
|
+
previous_status: string;
|
|
537
|
+
order_id: number;
|
|
538
|
+
dynamic_payment_qr_code: string;
|
|
539
|
+
provider_transaction_id: string;
|
|
540
|
+
error_message: string;
|
|
541
|
+
is_processing: boolean;
|
|
542
|
+
}
|
|
543
|
+
export enum ChargeReferenceType {
|
|
544
|
+
"order" = 0,
|
|
545
|
+
"invoice" = 1
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
}
|
|
549
|
+
declare module '@wyocrm/sdk/utils' {
|
|
550
|
+
import { Operator, OperatorValueMap } from '@wyocrm/sdk/types';
|
|
551
|
+
export function createInstance(baseURL: string, key: string, uid: string, timeout?: number): import("axios").AxiosInstance;
|
|
552
|
+
export class QueryBuilder<T> {
|
|
553
|
+
private params;
|
|
554
|
+
addParam<K extends keyof T, O extends Operator<T[K]>>(property: K, operator: O, value: OperatorValueMap[O]): this;
|
|
555
|
+
includeTotal(flag: boolean): this;
|
|
556
|
+
skip(skip: number): this;
|
|
557
|
+
take(take: number): this;
|
|
558
|
+
jsconfig(param: string): this;
|
|
559
|
+
build(): Record<string, string>;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
}
|
|
563
|
+
declare module '@wyocrm/sdk' {
|
|
564
|
+
import main = require('@wyocrm/sdk/index');
|
|
565
|
+
export = main;
|
|
566
|
+
}
|
package/build/index.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/*! For license information please see index.js.LICENSE.txt */
|
|
2
|
+
(function t(e,n){if(typeof exports==="object"&&typeof module==="object")module.exports=n();else if(typeof define==="function"&&define.amd)define([],n);else if(typeof exports==="object")exports["@xpos/core"]=n();else e["@xpos/core"]=n()})(self,(()=>(()=>{"use strict";var t={};(()=>{t.d=(e,n)=>{for(var r in n){if(t.o(n,r)&&!t.o(e,r)){Object.defineProperty(e,r,{enumerable:true,get:n[r]})}}}})();(()=>{t.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)})();(()=>{t.r=t=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})}})();var e={};t.r(e);t.d(e,{ApiResponse:()=>S,Applying:()=>O,ApplyingType:()=>w,ChargeReferenceType:()=>j,Configurator:()=>Nn,Coupon:()=>E,CouponItem:()=>_,Customer:()=>u,CustomerOptions:()=>l,DayOperator:()=>d,FileExtension:()=>x,FileUploadRequest:()=>C,IResponseError:()=>v,MonthOperator:()=>p,MonthValues:()=>m,NumericOperators:()=>f,Order:()=>b,OrderStatus:()=>g,QueryBuilder:()=>wn,StringOperators:()=>h,TerminalServices:()=>Ln,Transaction:()=>y,createInstance:()=>vn});function n(t){"@babel/helpers - typeof";return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},n(t)}function r(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(t,a(r.key),r)}}function i(t,e,n){if(e)r(t.prototype,e);if(n)r(t,n);Object.defineProperty(t,"prototype",{writable:false});return t}function o(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}}function s(t,e,n){e=a(e);if(e in t){Object.defineProperty(t,e,{value:n,enumerable:true,configurable:true,writable:true})}else{t[e]=n}return t}function a(t){var e=c(t,"string");return"symbol"==n(e)?e:String(e)}function c(t,e){if("object"!=n(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var i=r.call(t,e||"default");if("object"!=n(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var u=i((function t(){o(this,t);s(this,"membership_id","");s(this,"license_id",0);s(this,"credit",0);s(this,"point",0);s(this,"transaction_total",0);s(this,"transaction_time",0);s(this,"tier",null);s(this,"tag_guids",null);s(this,"user_group_id",0);s(this,"user_group_name",null);s(this,"group_expires_at","");s(this,"error",null);s(this,"id",0);s(this,"ref_id","");s(this,"image_url",null);s(this,"stripe_token",null);s(this,"stripe_customer_id",null);s(this,"username","");s(this,"company",null);s(this,"ic",null);s(this,"display_name","");s(this,"full_name","");s(this,"birth_date",null);s(this,"gender",null);s(this,"address",null);s(this,"postcode",null);s(this,"note",null);s(this,"language",null);s(this,"time_zone",null);s(this,"created_at","");s(this,"updated_at","");s(this,"license_ids","");s(this,"security_stamp","");s(this,"phone_number","");s(this,"email",null);s(this,"email_confirmed",false);s(this,"phone_number_confirmed",false);s(this,"agree_pdpa_at",null)}));var l=i((function t(){o(this,t);s(this,"ref_id","");s(this,"ic","");s(this,"display_name","");s(this,"image_url","");s(this,"birth_date","");s(this,"gender","");s(this,"language","en");s(this,"phone_number","");s(this,"email","")}));var f=function(t){t[t[">"]=0]=">";t[t[">="]=1]=">=";t[t["<"]=2]="<";t[t["<="]=3]="<=";t[t["="]=4]="=";return t}({});var h=function(t){t[t["Contains"]=0]="Contains";t[t["NotContains"]=1]="NotContains";t[t["StartsWith"]=2]="StartsWith";t[t["EndsWith"]=3]="EndsWith";return t}({});var p=function(t){t["WithinAMonth"]="Contains";return t}({});var d=function(t){t["At"]="StartsWith";return t}({});var m=function(t){t["Jan"]="-01-";t["Feb"]="-02-";t["Mar"]="-03-";t["Apr"]="-04-";t["May"]="-05-";t["Jun"]="-06-";t["Jul"]="-07-";t["Aug"]="-08-";t["Sep"]="-09-";t["Oct"]="-10-";t["Nov"]="-11-";t["Dec"]="-12-";return t}({});var y=i((function t(){o(this,t);s(this,"id",0);s(this,"invoice_id",0);s(this,"type","");s(this,"primary_license_id",0);s(this,"license_id",0);s(this,"ref_id","");s(this,"user_id",0);s(this,"add_credit",0);s(this,"minus_credit",0);s(this,"add_point",0);s(this,"minus_point",0);s(this,"status","");s(this,"grand_total",0);s(this,"is_local",false);s(this,"closed_at","");s(this,"created_at","");s(this,"updated_at","");s(this,"errors",[])}));var g=function(t){t["PayAtCounter"]="Pay At Counter";t["PlacingOrder"]="Placing Order";t["PreparingOrder"]="Preparing Order";t["DeliveringOrder"]="Delivering Order";t["Delivered"]="Delivered";t["PickingUp"]="Picking Up";t["PickedUp"]="Picked Up";t["SendingOrder"]="Sending Order";t["Sent"]="Sent";t["Cancelled"]="Cancelled";t["Confirmed"]="Confirmed";t["Expired"]="Expired";t["PendingPayment"]="Pending Payment";t["PaymentDeclined"]="Payment Declined";return t}({});var b=i((function t(){o(this,t);s(this,"id",0);s(this,"order_ref","");s(this,"table_id",0);s(this,"invoice_id",0);s(this,"call_num",0);s(this,"user_id",0);s(this,"license_id",0);s(this,"charge_id",0);s(this,"delivery_id",0);s(this,"order_type","");s(this,"payment_source_id",0);s(this,"status",g.Sent);s(this,"customer_name","");s(this,"customer_phone_number","");s(this,"meta",{placed_at:"",current_status:"",prepare_at:"",previous_status:"",deliver_at:"",delivered_at:""});s(this,"created_at","");s(this,"updated_at","");s(this,"errors",[])}));var v=i((function t(){o(this,t)}));var w=function(t){t[t["ALL"]=1]="ALL";t[t["INCLUSIVE"]=2]="INCLUSIVE";t[t["EXCLUSIVE"]=3]="EXCLUSIVE";return t}({});var O=i((function t(){o(this,t);s(this,"applying_type",w.ALL);s(this,"applying_items",[])}));var E=i((function t(){o(this,t);s(this,"guid","");s(this,"promo_code","");s(this,"is_multi_stores",false);s(this,"name","");s(this,"alias","");s(this,"description","");s(this,"description_alias","");s(this,"applying_plus",new O);s(this,"applying_user_tags",new O);s(this,"applying_user_groups",new O);s(this,"discount_calc_type",0);s(this,"discount_amount",0);s(this,"discount_percent",0);s(this,"duration",0);s(this,"usage_count",0);s(this,"usage_limit_per_invoice",0);s(this,"above_invoice_amount",0);s(this,"below_invoice_amount",0);s(this,"is_delivery_free",false);s(this,"is_individual_use",false);s(this,"price_in_points",0);s(this,"styles",null);s(this,"expired_at","");s(this,"auto_gen",false);s(this,"can_sell",false);s(this,"can_redeem",false);s(this,"created_at","");s(this,"updated_at","");s(this,"errors",[])}));var _=i((function t(){o(this,t);s(this,"guid","");s(this,"coupon",new E);s(this,"usage",null);s(this,"promo_code","");s(this,"is_expired",false);s(this,"is_redeemed",false);s(this,"is_generated",false);s(this,"created_at","");s(this,"updated_at","");s(this,"errors",[])}));var S=i((function t(){o(this,t);s(this,"errors",[])}));var x=function(t){t["JPG"]="jpg";t["PNG"]="png";return t}({});var C=i((function t(){o(this,t);s(this,"name","");s(this,"base64","");s(this,"format",x.PNG)}));var j=function(t){t[t["order"]=0]="order";t[t["invoice"]=1]="invoice";return t}({});function P(t,e){return function n(){return t.apply(e,arguments)}}const{toString:R}=Object.prototype;const{getPrototypeOf:A}=Object;const T=(t=>e=>{const n=R.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null));const k=t=>{t=t.toLowerCase();return e=>T(e)===t};const N=t=>e=>typeof e===t;const{isArray:L}=Array;const U=N("undefined");function D(t){return t!==null&&!U(t)&&t.constructor!==null&&!U(t.constructor)&&M(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const F=k("ArrayBuffer");function B(t){let e;if(typeof ArrayBuffer!=="undefined"&&ArrayBuffer.isView){e=ArrayBuffer.isView(t)}else{e=t&&t.buffer&&F(t.buffer)}return e}const I=N("string");const M=N("function");const G=N("number");const H=t=>t!==null&&typeof t==="object";const q=t=>t===true||t===false;const z=t=>{if(T(t)!=="object"){return false}const e=A(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)};const J=k("Date");const W=k("File");const V=k("Blob");const K=k("FileList");const $=t=>H(t)&&M(t.pipe);const X=t=>{let e;return t&&(typeof FormData==="function"&&t instanceof FormData||M(t.append)&&((e=T(t))==="formdata"||e==="object"&&M(t.toString)&&t.toString()==="[object FormData]"))};const Q=k("URLSearchParams");const Y=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Z(t,e,{allOwnKeys:n=false}={}){if(t===null||typeof t==="undefined"){return}let r;let i;if(typeof t!=="object"){t=[t]}if(L(t)){for(r=0,i=t.length;r<i;r++){e.call(null,t[r],r,t)}}else{const i=n?Object.getOwnPropertyNames(t):Object.keys(t);const o=i.length;let s;for(r=0;r<o;r++){s=i[r];e.call(null,t[s],s,t)}}}function tt(t,e){e=e.toLowerCase();const n=Object.keys(t);let r=n.length;let i;while(r-- >0){i=n[r];if(e===i.toLowerCase()){return i}}return null}const et=(()=>{if(typeof globalThis!=="undefined")return globalThis;return typeof self!=="undefined"?self:typeof window!=="undefined"?window:global})();const nt=t=>!U(t)&&t!==et;function rt(){const{caseless:t}=nt(this)&&this||{};const e={};const n=(n,r)=>{const i=t&&tt(e,r)||r;if(z(e[i])&&z(n)){e[i]=rt(e[i],n)}else if(z(n)){e[i]=rt({},n)}else if(L(n)){e[i]=n.slice()}else{e[i]=n}};for(let t=0,e=arguments.length;t<e;t++){arguments[t]&&Z(arguments[t],n)}return e}const it=(t,e,n,{allOwnKeys:r}={})=>{Z(e,((e,r)=>{if(n&&M(e)){t[r]=P(e,n)}else{t[r]=e}}),{allOwnKeys:r});return t};const ot=t=>{if(t.charCodeAt(0)===65279){t=t.slice(1)}return t};const st=(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r);t.prototype.constructor=t;Object.defineProperty(t,"super",{value:e.prototype});n&&Object.assign(t.prototype,n)};const at=(t,e,n,r)=>{let i;let o;let s;const a={};e=e||{};if(t==null)return e;do{i=Object.getOwnPropertyNames(t);o=i.length;while(o-- >0){s=i[o];if((!r||r(s,t,e))&&!a[s]){e[s]=t[s];a[s]=true}}t=n!==false&&A(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e};const ct=(t,e,n)=>{t=String(t);if(n===undefined||n>t.length){n=t.length}n-=e.length;const r=t.indexOf(e,n);return r!==-1&&r===n};const ut=t=>{if(!t)return null;if(L(t))return t;let e=t.length;if(!G(e))return null;const n=new Array(e);while(e-- >0){n[e]=t[e]}return n};const lt=(t=>e=>t&&e instanceof t)(typeof Uint8Array!=="undefined"&&A(Uint8Array));const ft=(t,e)=>{const n=t&&t[Symbol.iterator];const r=n.call(t);let i;while((i=r.next())&&!i.done){const n=i.value;e.call(t,n[0],n[1])}};const ht=(t,e)=>{let n;const r=[];while((n=t.exec(e))!==null){r.push(n)}return r};const pt=k("HTMLFormElement");const dt=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function t(e,n,r){return n.toUpperCase()+r}));const mt=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype);const yt=k("RegExp");const gt=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t);const r={};Z(n,((n,i)=>{let o;if((o=e(n,i,t))!==false){r[i]=o||n}}));Object.defineProperties(t,r)};const bt=t=>{gt(t,((e,n)=>{if(M(t)&&["arguments","caller","callee"].indexOf(n)!==-1){return false}const r=t[n];if(!M(r))return;e.enumerable=false;if("writable"in e){e.writable=false;return}if(!e.set){e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}}}))};const vt=(t,e)=>{const n={};const r=t=>{t.forEach((t=>{n[t]=true}))};L(t)?r(t):r(String(t).split(e));return n};const wt=()=>{};const Ot=(t,e)=>{t=+t;return Number.isFinite(t)?t:e};const Et="abcdefghijklmnopqrstuvwxyz";const _t="0123456789";const St={DIGIT:_t,ALPHA:Et,ALPHA_DIGIT:Et+Et.toUpperCase()+_t};const xt=(t=16,e=St.ALPHA_DIGIT)=>{let n="";const{length:r}=e;while(t--){n+=e[Math.random()*r|0]}return n};function Ct(t){return!!(t&&M(t.append)&&t[Symbol.toStringTag]==="FormData"&&t[Symbol.iterator])}const jt=t=>{const e=new Array(10);const n=(t,r)=>{if(H(t)){if(e.indexOf(t)>=0){return}if(!("toJSON"in t)){e[r]=t;const i=L(t)?[]:{};Z(t,((t,e)=>{const o=n(t,r+1);!U(o)&&(i[e]=o)}));e[r]=undefined;return i}}return t};return n(t,0)};const Pt=k("AsyncFunction");const Rt=t=>t&&(H(t)||M(t))&&M(t.then)&&M(t.catch);const At={isArray:L,isArrayBuffer:F,isBuffer:D,isFormData:X,isArrayBufferView:B,isString:I,isNumber:G,isBoolean:q,isObject:H,isPlainObject:z,isUndefined:U,isDate:J,isFile:W,isBlob:V,isRegExp:yt,isFunction:M,isStream:$,isURLSearchParams:Q,isTypedArray:lt,isFileList:K,forEach:Z,merge:rt,extend:it,trim:Y,stripBOM:ot,inherits:st,toFlatObject:at,kindOf:T,kindOfTest:k,endsWith:ct,toArray:ut,forEachEntry:ft,matchAll:ht,isHTMLForm:pt,hasOwnProperty:mt,hasOwnProp:mt,reduceDescriptors:gt,freezeMethods:bt,toObjectSet:vt,toCamelCase:dt,noop:wt,toFiniteNumber:Ot,findKey:tt,global:et,isContextDefined:nt,ALPHABET:St,generateString:xt,isSpecCompliantForm:Ct,toJSONObject:jt,isAsyncFn:Pt,isThenable:Rt};function Tt(t,e,n,r,i){Error.call(this);if(Error.captureStackTrace){Error.captureStackTrace(this,this.constructor)}else{this.stack=(new Error).stack}this.message=t;this.name="AxiosError";e&&(this.code=e);n&&(this.config=n);r&&(this.request=r);i&&(this.response=i)}At.inherits(Tt,Error,{toJSON:function t(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:At.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const kt=Tt.prototype;const Nt={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{Nt[t]={value:t}}));Object.defineProperties(Tt,Nt);Object.defineProperty(kt,"isAxiosError",{value:true});Tt.from=(t,e,n,r,i,o)=>{const s=Object.create(kt);At.toFlatObject(t,s,(function t(e){return e!==Error.prototype}),(t=>t!=="isAxiosError"));Tt.call(s,t.message,e,n,r,i);s.cause=t;s.name=t.name;o&&Object.assign(s,o);return s};const Lt=Tt;const Ut=null;function Dt(t){return At.isPlainObject(t)||At.isArray(t)}function Ft(t){return At.endsWith(t,"[]")?t.slice(0,-2):t}function Bt(t,e,n){if(!t)return e;return t.concat(e).map((function t(e,r){e=Ft(e);return!n&&r?"["+e+"]":e})).join(n?".":"")}function It(t){return At.isArray(t)&&!t.some(Dt)}const Mt=At.toFlatObject(At,{},null,(function t(e){return/^is[A-Z]/.test(e)}));function Gt(t,e,n){if(!At.isObject(t)){throw new TypeError("target must be an object")}e=e||new(Ut||FormData);n=At.toFlatObject(n,{metaTokens:true,dots:false,indexes:false},false,(function t(e,n){return!At.isUndefined(n[e])}));const r=n.metaTokens;const i=n.visitor||l;const o=n.dots;const s=n.indexes;const a=n.Blob||typeof Blob!=="undefined"&&Blob;const c=a&&At.isSpecCompliantForm(e);if(!At.isFunction(i)){throw new TypeError("visitor must be a function")}function u(t){if(t===null)return"";if(At.isDate(t)){return t.toISOString()}if(!c&&At.isBlob(t)){throw new Lt("Blob is not supported. Use a Buffer instead.")}if(At.isArrayBuffer(t)||At.isTypedArray(t)){return c&&typeof Blob==="function"?new Blob([t]):Buffer.from(t)}return t}function l(t,n,i){let a=t;if(t&&!i&&typeof t==="object"){if(At.endsWith(n,"{}")){n=r?n:n.slice(0,-2);t=JSON.stringify(t)}else if(At.isArray(t)&&It(t)||(At.isFileList(t)||At.endsWith(n,"[]"))&&(a=At.toArray(t))){n=Ft(n);a.forEach((function t(r,i){!(At.isUndefined(r)||r===null)&&e.append(s===true?Bt([n],i,o):s===null?n:n+"[]",u(r))}));return false}}if(Dt(t)){return true}e.append(Bt(i,n,o),u(t));return false}const f=[];const h=Object.assign(Mt,{defaultVisitor:l,convertValue:u,isVisitable:Dt});function p(t,n){if(At.isUndefined(t))return;if(f.indexOf(t)!==-1){throw Error("Circular reference detected in "+n.join("."))}f.push(t);At.forEach(t,(function t(r,o){const s=!(At.isUndefined(r)||r===null)&&i.call(e,r,At.isString(o)?o.trim():o,n,h);if(s===true){p(r,n?n.concat(o):[o])}}));f.pop()}if(!At.isObject(t)){throw new TypeError("data must be an object")}p(t);return e}const Ht=Gt;function qt(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function t(n){return e[n]}))}function zt(t,e){this._pairs=[];t&&Ht(t,this,e)}const Jt=zt.prototype;Jt.append=function t(e,n){this._pairs.push([e,n])};Jt.toString=function t(e){const n=e?function(t){return e.call(this,t,qt)}:qt;return this._pairs.map((function t(e){return n(e[0])+"="+n(e[1])}),"").join("&")};const Wt=zt;function Vt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Kt(t,e,n){if(!e){return t}const r=n&&n.encode||Vt;const i=n&&n.serialize;let o;if(i){o=i(e,n)}else{o=At.isURLSearchParams(e)?e.toString():new Wt(e,n).toString(r)}if(o){const e=t.indexOf("#");if(e!==-1){t=t.slice(0,e)}t+=(t.indexOf("?")===-1?"?":"&")+o}return t}class $t{constructor(){this.handlers=[]}use(t,e,n){this.handlers.push({fulfilled:t,rejected:e,synchronous:n?n.synchronous:false,runWhen:n?n.runWhen:null});return this.handlers.length-1}eject(t){if(this.handlers[t]){this.handlers[t]=null}}clear(){if(this.handlers){this.handlers=[]}}forEach(t){At.forEach(this.handlers,(function e(n){if(n!==null){t(n)}}))}}const Xt=$t;const Qt={silentJSONParsing:true,forcedJSONParsing:true,clarifyTimeoutError:false};const Yt=typeof URLSearchParams!=="undefined"?URLSearchParams:Wt;const Zt=typeof FormData!=="undefined"?FormData:null;const te=typeof Blob!=="undefined"?Blob:null;const ee=(()=>{let t;if(typeof navigator!=="undefined"&&((t=navigator.product)==="ReactNative"||t==="NativeScript"||t==="NS")){return false}return typeof window!=="undefined"&&typeof document!=="undefined"})();const ne=(()=>typeof WorkerGlobalScope!=="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts==="function")();const re={isBrowser:true,classes:{URLSearchParams:Yt,FormData:Zt,Blob:te},isStandardBrowserEnv:ee,isStandardBrowserWebWorkerEnv:ne,protocols:["http","https","file","blob","url","data"]};function ie(t,e){return Ht(t,new re.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){if(re.isNode&&At.isBuffer(t)){this.append(e,t.toString("base64"));return false}return r.defaultVisitor.apply(this,arguments)}},e))}function oe(t){return At.matchAll(/\w+|\[(\w*)]/g,t).map((t=>t[0]==="[]"?"":t[1]||t[0]))}function se(t){const e={};const n=Object.keys(t);let r;const i=n.length;let o;for(r=0;r<i;r++){o=n[r];e[o]=t[o]}return e}function ae(t){function e(t,n,r,i){let o=t[i++];const s=Number.isFinite(+o);const a=i>=t.length;o=!o&&At.isArray(r)?r.length:o;if(a){if(At.hasOwnProp(r,o)){r[o]=[r[o],n]}else{r[o]=n}return!s}if(!r[o]||!At.isObject(r[o])){r[o]=[]}const c=e(t,n,r[o],i);if(c&&At.isArray(r[o])){r[o]=se(r[o])}return!s}if(At.isFormData(t)&&At.isFunction(t.entries)){const n={};At.forEachEntry(t,((t,r)=>{e(oe(t),r,n,0)}));return n}return null}const ce=ae;function ue(t,e,n){if(At.isString(t)){try{(e||JSON.parse)(t);return At.trim(t)}catch(t){if(t.name!=="SyntaxError"){throw t}}}return(n||JSON.stringify)(t)}const le={transitional:Qt,adapter:["xhr","http"],transformRequest:[function t(e,n){const r=n.getContentType()||"";const i=r.indexOf("application/json")>-1;const o=At.isObject(e);if(o&&At.isHTMLForm(e)){e=new FormData(e)}const s=At.isFormData(e);if(s){if(!i){return e}return i?JSON.stringify(ce(e)):e}if(At.isArrayBuffer(e)||At.isBuffer(e)||At.isStream(e)||At.isFile(e)||At.isBlob(e)){return e}if(At.isArrayBufferView(e)){return e.buffer}if(At.isURLSearchParams(e)){n.setContentType("application/x-www-form-urlencoded;charset=utf-8",false);return e.toString()}let a;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1){return ie(e,this.formSerializer).toString()}if((a=At.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Ht(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}if(o||i){n.setContentType("application/json",false);return ue(e)}return e}],transformResponse:[function t(e){const n=this.transitional||le.transitional;const r=n&&n.forcedJSONParsing;const i=this.responseType==="json";if(e&&At.isString(e)&&(r&&!this.responseType||i)){const t=n&&n.silentJSONParsing;const r=!t&&i;try{return JSON.parse(e)}catch(t){if(r){if(t.name==="SyntaxError"){throw Lt.from(t,Lt.ERR_BAD_RESPONSE,this,null,this.response)}throw t}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:re.classes.FormData,Blob:re.classes.Blob},validateStatus:function t(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":undefined}}};At.forEach(["delete","get","head","post","put","patch"],(t=>{le.headers[t]={}}));const fe=le;const he=At.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const pe=t=>{const e={};let n;let r;let i;t&&t.split("\n").forEach((function t(o){i=o.indexOf(":");n=o.substring(0,i).trim().toLowerCase();r=o.substring(i+1).trim();if(!n||e[n]&&he[n]){return}if(n==="set-cookie"){if(e[n]){e[n].push(r)}else{e[n]=[r]}}else{e[n]=e[n]?e[n]+", "+r:r}}));return e};const de=Symbol("internals");function me(t){return t&&String(t).trim().toLowerCase()}function ye(t){if(t===false||t==null){return t}return At.isArray(t)?t.map(ye):String(t)}function ge(t){const e=Object.create(null);const n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;while(r=n.exec(t)){e[r[1]]=r[2]}return e}const be=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function ve(t,e,n,r,i){if(At.isFunction(r)){return r.call(this,e,n)}if(i){e=n}if(!At.isString(e))return;if(At.isString(r)){return e.indexOf(r)!==-1}if(At.isRegExp(r)){return r.test(e)}}function we(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}function Oe(t,e){const n=At.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,i){return this[r].call(this,e,t,n,i)},configurable:true})}))}class Ee{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function i(t,e,n){const i=me(e);if(!i){throw new Error("header name must be a non-empty string")}const o=At.findKey(r,i);if(!o||r[o]===undefined||n===true||n===undefined&&r[o]!==false){r[o||e]=ye(t)}}const o=(t,e)=>At.forEach(t,((t,n)=>i(t,n,e)));if(At.isPlainObject(t)||t instanceof this.constructor){o(t,e)}else if(At.isString(t)&&(t=t.trim())&&!be(t)){o(pe(t),e)}else{t!=null&&i(e,t,n)}return this}get(t,e){t=me(t);if(t){const n=At.findKey(this,t);if(n){const t=this[n];if(!e){return t}if(e===true){return ge(t)}if(At.isFunction(e)){return e.call(this,t,n)}if(At.isRegExp(e)){return e.exec(t)}throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){t=me(t);if(t){const n=At.findKey(this,t);return!!(n&&this[n]!==undefined&&(!e||ve(this,this[n],n,e)))}return false}delete(t,e){const n=this;let r=false;function i(t){t=me(t);if(t){const i=At.findKey(n,t);if(i&&(!e||ve(n,n[i],i,e))){delete n[i];r=true}}}if(At.isArray(t)){t.forEach(i)}else{i(t)}return r}clear(t){const e=Object.keys(this);let n=e.length;let r=false;while(n--){const i=e[n];if(!t||ve(this,this[i],i,t,true)){delete this[i];r=true}}return r}normalize(t){const e=this;const n={};At.forEach(this,((r,i)=>{const o=At.findKey(n,i);if(o){e[o]=ye(r);delete e[i];return}const s=t?we(i):String(i).trim();if(s!==i){delete e[i]}e[s]=ye(r);n[s]=true}));return this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);At.forEach(this,((n,r)=>{n!=null&&n!==false&&(e[r]=t&&At.isArray(n)?n.join(", "):n)}));return e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);e.forEach((t=>n.set(t)));return n}static accessor(t){const e=this[de]=this[de]={accessors:{}};const n=e.accessors;const r=this.prototype;function i(t){const e=me(t);if(!n[e]){Oe(r,t);n[e]=true}}At.isArray(t)?t.forEach(i):i(t);return this}}Ee.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);At.reduceDescriptors(Ee.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}}));At.freezeMethods(Ee);const _e=Ee;function Se(t,e){const n=this||fe;const r=e||n;const i=_e.from(r.headers);let o=r.data;At.forEach(t,(function t(r){o=r.call(n,o,i.normalize(),e?e.status:undefined)}));i.normalize();return o}function xe(t){return!!(t&&t.__CANCEL__)}function Ce(t,e,n){Lt.call(this,t==null?"canceled":t,Lt.ERR_CANCELED,e,n);this.name="CanceledError"}At.inherits(Ce,Lt,{__CANCEL__:true});const je=Ce;function Pe(t,e,n){const r=n.config.validateStatus;if(!n.status||!r||r(n.status)){t(n)}else{e(new Lt("Request failed with status code "+n.status,[Lt.ERR_BAD_REQUEST,Lt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}}const Re=re.isStandardBrowserEnv?function t(){return{write:function t(e,n,r,i,o,s){const a=[];a.push(e+"="+encodeURIComponent(n));if(At.isNumber(r)){a.push("expires="+new Date(r).toGMTString())}if(At.isString(i)){a.push("path="+i)}if(At.isString(o)){a.push("domain="+o)}if(s===true){a.push("secure")}document.cookie=a.join("; ")},read:function t(e){const n=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function t(e){this.write(e,"",Date.now()-864e5)}}}():function t(){return{write:function t(){},read:function t(){return null},remove:function t(){}}}();function Ae(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Te(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}function ke(t,e){if(t&&!Ae(e)){return Te(t,e)}return e}const Ne=re.isStandardBrowserEnv?function t(){const e=/(msie|trident)/i.test(navigator.userAgent);const n=document.createElement("a");let r;function i(t){let r=t;if(e){n.setAttribute("href",r);r=n.href}n.setAttribute("href",r);return{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}r=i(window.location.href);return function t(e){const n=At.isString(e)?i(e):e;return n.protocol===r.protocol&&n.host===r.host}}():function t(){return function t(){return true}}();function Le(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Ue(t,e){t=t||10;const n=new Array(t);const r=new Array(t);let i=0;let o=0;let s;e=e!==undefined?e:1e3;return function a(c){const u=Date.now();const l=r[o];if(!s){s=u}n[i]=c;r[i]=u;let f=o;let h=0;while(f!==i){h+=n[f++];f=f%t}i=(i+1)%t;if(i===o){o=(o+1)%t}if(u-s<e){return}const p=l&&u-l;return p?Math.round(h*1e3/p):undefined}}const De=Ue;function Fe(t,e){let n=0;const r=De(50,250);return i=>{const o=i.loaded;const s=i.lengthComputable?i.total:undefined;const a=o-n;const c=r(a);const u=o<=s;n=o;const l={loaded:o,total:s,progress:s?o/s:undefined,bytes:a,rate:c?c:undefined,estimated:c&&s&&u?(s-o)/c:undefined,event:i};l[e?"download":"upload"]=true;t(l)}}const Be=typeof XMLHttpRequest!=="undefined";const Ie=Be&&function(t){return new Promise((function e(n,r){let i=t.data;const o=_e.from(t.headers).normalize();const s=t.responseType;let a;function c(){if(t.cancelToken){t.cancelToken.unsubscribe(a)}if(t.signal){t.signal.removeEventListener("abort",a)}}let u;if(At.isFormData(i)){if(re.isStandardBrowserEnv||re.isStandardBrowserWebWorkerEnv){o.setContentType(false)}else if(!o.getContentType(/^\s*multipart\/form-data/)){o.setContentType("multipart/form-data")}else if(At.isString(u=o.getContentType())){o.setContentType(u.replace(/^\s*(multipart\/form-data);+/,"$1"))}}let l=new XMLHttpRequest;if(t.auth){const e=t.auth.username||"";const n=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";o.set("Authorization","Basic "+btoa(e+":"+n))}const f=ke(t.baseURL,t.url);l.open(t.method.toUpperCase(),Kt(f,t.params,t.paramsSerializer),true);l.timeout=t.timeout;function h(){if(!l){return}const e=_e.from("getAllResponseHeaders"in l&&l.getAllResponseHeaders());const i=!s||s==="text"||s==="json"?l.responseText:l.response;const o={data:i,status:l.status,statusText:l.statusText,headers:e,config:t,request:l};Pe((function t(e){n(e);c()}),(function t(e){r(e);c()}),o);l=null}if("onloadend"in l){l.onloadend=h}else{l.onreadystatechange=function t(){if(!l||l.readyState!==4){return}if(l.status===0&&!(l.responseURL&&l.responseURL.indexOf("file:")===0)){return}setTimeout(h)}}l.onabort=function e(){if(!l){return}r(new Lt("Request aborted",Lt.ECONNABORTED,t,l));l=null};l.onerror=function e(){r(new Lt("Network Error",Lt.ERR_NETWORK,t,l));l=null};l.ontimeout=function e(){let n=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded";const i=t.transitional||Qt;if(t.timeoutErrorMessage){n=t.timeoutErrorMessage}r(new Lt(n,i.clarifyTimeoutError?Lt.ETIMEDOUT:Lt.ECONNABORTED,t,l));l=null};if(re.isStandardBrowserEnv){const e=(t.withCredentials||Ne(f))&&t.xsrfCookieName&&Re.read(t.xsrfCookieName);if(e){o.set(t.xsrfHeaderName,e)}}i===undefined&&o.setContentType(null);if("setRequestHeader"in l){At.forEach(o.toJSON(),(function t(e,n){l.setRequestHeader(n,e)}))}if(!At.isUndefined(t.withCredentials)){l.withCredentials=!!t.withCredentials}if(s&&s!=="json"){l.responseType=t.responseType}if(typeof t.onDownloadProgress==="function"){l.addEventListener("progress",Fe(t.onDownloadProgress,true))}if(typeof t.onUploadProgress==="function"&&l.upload){l.upload.addEventListener("progress",Fe(t.onUploadProgress))}if(t.cancelToken||t.signal){a=e=>{if(!l){return}r(!e||e.type?new je(null,t,l):e);l.abort();l=null};t.cancelToken&&t.cancelToken.subscribe(a);if(t.signal){t.signal.aborted?a():t.signal.addEventListener("abort",a)}}const p=Le(f);if(p&&re.protocols.indexOf(p)===-1){r(new Lt("Unsupported protocol "+p+":",Lt.ERR_BAD_REQUEST,t));return}l.send(i||null)}))};const Me={http:Ut,xhr:Ie};At.forEach(Me,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const Ge=t=>`- ${t}`;const He=t=>At.isFunction(t)||t===null||t===false;const qe={getAdapter:t=>{t=At.isArray(t)?t:[t];const{length:e}=t;let n;let r;const i={};for(let o=0;o<e;o++){n=t[o];let e;r=n;if(!He(n)){r=Me[(e=String(n)).toLowerCase()];if(r===undefined){throw new Lt(`Unknown adapter '${e}'`)}}if(r){break}i[e||"#"+o]=r}if(!r){const t=Object.entries(i).map((([t,e])=>`adapter ${t} `+(e===false?"is not supported by the environment":"is not available in the build")));let n=e?t.length>1?"since :\n"+t.map(Ge).join("\n"):" "+Ge(t[0]):"as no adapter specified";throw new Lt(`There is no suitable adapter to dispatch the request `+n,"ERR_NOT_SUPPORT")}return r},adapters:Me};function ze(t){if(t.cancelToken){t.cancelToken.throwIfRequested()}if(t.signal&&t.signal.aborted){throw new je(null,t)}}function Je(t){ze(t);t.headers=_e.from(t.headers);t.data=Se.call(t,t.transformRequest);if(["post","put","patch"].indexOf(t.method)!==-1){t.headers.setContentType("application/x-www-form-urlencoded",false)}const e=qe.getAdapter(t.adapter||fe.adapter);return e(t).then((function e(n){ze(t);n.data=Se.call(t,t.transformResponse,n);n.headers=_e.from(n.headers);return n}),(function e(n){if(!xe(n)){ze(t);if(n&&n.response){n.response.data=Se.call(t,t.transformResponse,n.response);n.response.headers=_e.from(n.response.headers)}}return Promise.reject(n)}))}const We=t=>t instanceof _e?t.toJSON():t;function Ve(t,e){e=e||{};const n={};function r(t,e,n){if(At.isPlainObject(t)&&At.isPlainObject(e)){return At.merge.call({caseless:n},t,e)}else if(At.isPlainObject(e)){return At.merge({},e)}else if(At.isArray(e)){return e.slice()}return e}function i(t,e,n){if(!At.isUndefined(e)){return r(t,e,n)}else if(!At.isUndefined(t)){return r(undefined,t,n)}}function o(t,e){if(!At.isUndefined(e)){return r(undefined,e)}}function s(t,e){if(!At.isUndefined(e)){return r(undefined,e)}else if(!At.isUndefined(t)){return r(undefined,t)}}function a(n,i,o){if(o in e){return r(n,i)}else if(o in t){return r(undefined,n)}}const c={url:o,method:o,data:o,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(t,e)=>i(We(t),We(e),true)};At.forEach(Object.keys(Object.assign({},t,e)),(function r(o){const s=c[o]||i;const u=s(t[o],e[o],o);At.isUndefined(u)&&s!==a||(n[o]=u)}));return n}const Ke="1.5.1";const $e={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{$e[t]=function n(r){return typeof r===t||"a"+(e<1?"n ":" ")+t}}));const Xe={};$e.transitional=function t(e,n,r){function i(t,e){return"[Axios v"+Ke+"] Transitional option '"+t+"'"+e+(r?". "+r:"")}return(t,r,o)=>{if(e===false){throw new Lt(i(r," has been removed"+(n?" in "+n:"")),Lt.ERR_DEPRECATED)}if(n&&!Xe[r]){Xe[r]=true;console.warn(i(r," has been deprecated since v"+n+" and will be removed in the near future"))}return e?e(t,r,o):true}};function Qe(t,e,n){if(typeof t!=="object"){throw new Lt("options must be an object",Lt.ERR_BAD_OPTION_VALUE)}const r=Object.keys(t);let i=r.length;while(i-- >0){const o=r[i];const s=e[o];if(s){const e=t[o];const n=e===undefined||s(e,o,t);if(n!==true){throw new Lt("option "+o+" must be "+n,Lt.ERR_BAD_OPTION_VALUE)}continue}if(n!==true){throw new Lt("Unknown option "+o,Lt.ERR_BAD_OPTION)}}}const Ye={assertOptions:Qe,validators:$e};const Ze=Ye.validators;class tn{constructor(t){this.defaults=t;this.interceptors={request:new Xt,response:new Xt}}request(t,e){if(typeof t==="string"){e=e||{};e.url=t}else{e=t||{}}e=Ve(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:i}=e;if(n!==undefined){Ye.assertOptions(n,{silentJSONParsing:Ze.transitional(Ze.boolean),forcedJSONParsing:Ze.transitional(Ze.boolean),clarifyTimeoutError:Ze.transitional(Ze.boolean)},false)}if(r!=null){if(At.isFunction(r)){e.paramsSerializer={serialize:r}}else{Ye.assertOptions(r,{encode:Ze.function,serialize:Ze.function},true)}}e.method=(e.method||this.defaults.method||"get").toLowerCase();let o=i&&At.merge(i.common,i[e.method]);i&&At.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete i[t]}));e.headers=_e.concat(o,i);const s=[];let a=true;this.interceptors.request.forEach((function t(n){if(typeof n.runWhen==="function"&&n.runWhen(e)===false){return}a=a&&n.synchronous;s.unshift(n.fulfilled,n.rejected)}));const c=[];this.interceptors.response.forEach((function t(e){c.push(e.fulfilled,e.rejected)}));let u;let l=0;let f;if(!a){const t=[Je.bind(this),undefined];t.unshift.apply(t,s);t.push.apply(t,c);f=t.length;u=Promise.resolve(e);while(l<f){u=u.then(t[l++],t[l++])}return u}f=s.length;let h=e;l=0;while(l<f){const t=s[l++];const e=s[l++];try{h=t(h)}catch(t){e.call(this,t);break}}try{u=Je.call(this,h)}catch(t){return Promise.reject(t)}l=0;f=c.length;while(l<f){u=u.then(c[l++],c[l++])}return u}getUri(t){t=Ve(this.defaults,t);const e=ke(t.baseURL,t.url);return Kt(e,t.params,t.paramsSerializer)}}At.forEach(["delete","get","head","options"],(function t(e){tn.prototype[e]=function(t,n){return this.request(Ve(n||{},{method:e,url:t,data:(n||{}).data}))}}));At.forEach(["post","put","patch"],(function t(e){function n(t){return function n(r,i,o){return this.request(Ve(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:i}))}}tn.prototype[e]=n();tn.prototype[e+"Form"]=n(true)}));const en=tn;class nn{constructor(t){if(typeof t!=="function"){throw new TypeError("executor must be a function.")}let e;this.promise=new Promise((function t(n){e=n}));const n=this;this.promise.then((t=>{if(!n._listeners)return;let e=n._listeners.length;while(e-- >0){n._listeners[e](t)}n._listeners=null}));this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t);e=t})).then(t);r.cancel=function t(){n.unsubscribe(e)};return r};t((function t(r,i,o){if(n.reason){return}n.reason=new je(r,i,o);e(n.reason)}))}throwIfRequested(){if(this.reason){throw this.reason}}subscribe(t){if(this.reason){t(this.reason);return}if(this._listeners){this._listeners.push(t)}else{this._listeners=[t]}}unsubscribe(t){if(!this._listeners){return}const e=this._listeners.indexOf(t);if(e!==-1){this._listeners.splice(e,1)}}static source(){let t;const e=new nn((function e(n){t=n}));return{token:e,cancel:t}}}const rn=nn;function on(t){return function e(n){return t.apply(null,n)}}function sn(t){return At.isObject(t)&&t.isAxiosError===true}const an={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(an).forEach((([t,e])=>{an[e]=t}));const cn=an;function un(t){const e=new en(t);const n=P(en.prototype.request,e);At.extend(n,en.prototype,e,{allOwnKeys:true});At.extend(n,e,null,{allOwnKeys:true});n.create=function e(n){return un(Ve(t,n))};return n}const ln=un(fe);ln.Axios=en;ln.CanceledError=je;ln.CancelToken=rn;ln.isCancel=xe;ln.VERSION=Ke;ln.toFormData=Ht;ln.AxiosError=Lt;ln.Cancel=ln.CanceledError;ln.all=function t(e){return Promise.all(e)};ln.spread=on;ln.isAxiosError=sn;ln.mergeConfig=Ve;ln.AxiosHeaders=_e;ln.formToJSON=t=>ce(At.isHTMLForm(t)?new FormData(t):t);ln.getAdapter=qe.getAdapter;ln.HttpStatusCode=cn;ln.default=ln;const fn=ln;function hn(t){"@babel/helpers - typeof";return hn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},hn(t)}function pn(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}}function dn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(t,gn(r.key),r)}}function mn(t,e,n){if(e)dn(t.prototype,e);if(n)dn(t,n);Object.defineProperty(t,"prototype",{writable:false});return t}function yn(t,e,n){e=gn(e);if(e in t){Object.defineProperty(t,e,{value:n,enumerable:true,configurable:true,writable:true})}else{t[e]=n}return t}function gn(t){var e=bn(t,"string");return"symbol"==hn(e)?e:String(e)}function bn(t,e){if("object"!=hn(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=hn(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}function vn(t,e,n){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:6e3;var i=fn.create({baseURL:t,timeout:r,headers:{" x-api-key":e,"x-device-uid":n}});i.interceptors.response.use((function(t){return t.data}),(function(t){return Promise.reject(t)}));return i}var wn=function(){function t(){pn(this,t);yn(this,"params",{})}mn(t,[{key:"addParam",value:function t(e,n,r){this.params["".concat(e.toString()).concat(n)]="".concat(r);return this}},{key:"includeTotal",value:function t(e){if(e)this.params["include"]="total";return this}},{key:"skip",value:function t(e){this.params["skip"]="".concat(e);return this}},{key:"take",value:function t(e){this.params["take"]="".concat(e);return this}},{key:"jsconfig",value:function t(e){this.params["jsconfig"]=e;return this}},{key:"build",value:function t(){this.params["jsconfig"]="dh:iso8601dt";return this.params}}]);return t}();function On(t){"@babel/helpers - typeof";return On="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},On(t)}function En(){"use strict";En=function t(){return e};var t,e={},n=Object.prototype,r=n.hasOwnProperty,i=Object.defineProperty||function(t,e,n){t[e]=n.value},o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag";function u(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{u({},"")}catch(t){u=function t(e,n,r){return e[n]=r}}function l(t,e,n,r){var o=e&&e.prototype instanceof g?e:g,s=Object.create(o.prototype),a=new A(r||[]);return i(s,"_invoke",{value:C(t,n,a)}),s}function f(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}e.wrap=l;var h="suspendedStart",p="suspendedYield",d="executing",m="completed",y={};function g(){}function b(){}function v(){}var w={};u(w,s,(function(){return this}));var O=Object.getPrototypeOf,E=O&&O(O(T([])));E&&E!==n&&r.call(E,s)&&(w=E);var _=v.prototype=g.prototype=Object.create(w);function S(t){["next","throw","return"].forEach((function(e){u(t,e,(function(t){return this._invoke(e,t)}))}))}function x(t,e){function n(i,o,s,a){var c=f(t[i],t,o);if("throw"!==c.type){var u=c.arg,l=u.value;return l&&"object"==On(l)&&r.call(l,"__await")?e.resolve(l.__await).then((function(t){n("next",t,s,a)}),(function(t){n("throw",t,s,a)})):e.resolve(l).then((function(t){u.value=t,s(u)}),(function(t){return n("throw",t,s,a)}))}a(c.arg)}var o;i(this,"_invoke",{value:function t(r,i){function s(){return new e((function(t,e){n(r,i,t,e)}))}return o=o?o.then(s,s):s()}})}function C(e,n,r){var i=h;return function(o,s){if(i===d)throw new Error("Generator is already running");if(i===m){if("throw"===o)throw s;return{value:t,done:!0}}for(r.method=o,r.arg=s;;){var a=r.delegate;if(a){var c=j(a,r);if(c){if(c===y)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===h)throw i=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=d;var u=f(e,n,r);if("normal"===u.type){if(i=r.done?m:p,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(i=m,r.method="throw",r.arg=u.arg)}}}function j(e,n){var r=n.method,i=e.iterator[r];if(i===t)return n.delegate=null,"throw"===r&&e.iterator["return"]&&(n.method="return",n.arg=t,j(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var o=f(i,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,y;var s=o.arg;return s?s.done?(n[e.resultName]=s.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):s:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function P(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function R(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function A(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(P,this),this.reset(!0)}function T(e){if(e||""===e){var n=e[s];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(r.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}throw new TypeError(On(e)+" is not iterable")}return b.prototype=v,i(_,"constructor",{value:v,configurable:!0}),i(v,"constructor",{value:b,configurable:!0}),b.displayName=u(v,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,v):(t.__proto__=v,u(t,c,"GeneratorFunction")),t.prototype=Object.create(_),t},e.awrap=function(t){return{__await:t}},S(x.prototype),u(x.prototype,a,(function(){return this})),e.AsyncIterator=x,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var s=new x(l(t,n,r,i),o);return e.isGeneratorFunction(n)?s:s.next().then((function(t){return t.done?t.value:s.next()}))},S(_),u(_,c,"Generator"),u(_,s,(function(){return this})),u(_,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},e.values=T,A.prototype={constructor:A,reset:function e(n){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(R),!n)for(var i in this)"t"===i.charAt(0)&&r.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=t)},stop:function t(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function e(n){if(this.done)throw n;var i=this;function o(e,r){return c.type="throw",c.arg=n,i.next=e,r&&(i.method="next",i.arg=t),!!r}for(var s=this.tryEntries.length-1;s>=0;--s){var a=this.tryEntries[s],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var u=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(u&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function t(e,n){for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var s=o;break}}s&&("break"===e||"continue"===e)&&s.tryLoc<=n&&n<=s.finallyLoc&&(s=null);var a=s?s.completion:{};return a.type=e,a.arg=n,s?(this.method="next",this.next=s.finallyLoc,y):this.complete(a)},complete:function t(e,n){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&n&&(this.next=n),y},finish:function t(e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),R(r),y}},catch:function t(e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===e){var i=r.completion;if("throw"===i.type){var o=i.arg;R(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function e(n,r,i){return this.delegate={iterator:T(n),resultName:r,nextLoc:i},"next"===this.method&&(this.arg=t),y}},e}function _n(t,e,n,r,i,o,s){try{var a=t[o](s);var c=a.value}catch(t){n(t);return}if(a.done){e(c)}else{Promise.resolve(c).then(r,i)}}function Sn(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function s(t){_n(o,r,i,s,a,"next",t)}function a(t){_n(o,r,i,s,a,"throw",t)}s(undefined)}))}}function xn(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Cn(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?xn(Object(n),!0).forEach((function(e){An(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):xn(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function jn(t,e){if(!(t instanceof e)){throw new TypeError("Cannot call a class as a function")}}function Pn(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(t,Tn(r.key),r)}}function Rn(t,e,n){if(e)Pn(t.prototype,e);if(n)Pn(t,n);Object.defineProperty(t,"prototype",{writable:false});return t}function An(t,e,n){e=Tn(e);if(e in t){Object.defineProperty(t,e,{value:n,enumerable:true,configurable:true,writable:true})}else{t[e]=n}return t}function Tn(t){var e=kn(t,"string");return"symbol"==On(e)?e:String(e)}function kn(t,e){if("object"!=On(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=On(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}var Nn=function(){function t(){jn(this,t)}Rn(t,null,[{key:"initialize",value:function t(e){var n=Cn(Cn({},e.defaultHeaders),{},{"Content-Type":"application/json"});if(e.token){n["Authorization"]="Bearer ".concat(e.token)}else if(e.apiKey){n["x-api-key"]="".concat(e.apiKey)}this.httpClient=fn.create({baseURL:e.baseURL,headers:n});this.merchantGuid=e.merchantGuid;this.isInitialized=true}},{key:"getHttpClient",value:function t(){if(!this.isInitialized){throw new Error("HttpClient not initialized. Call Configurator.initialize() first.")}return this.httpClient}},{key:"getMerchantGuid",value:function t(){if(!this.merchantGuid){throw new Error("Merchant GUID not initialized. Call Configurator.initialize() first.")}return this.merchantGuid}}]);return t}();An(Nn,"isInitialized",false);var Ln=function(){function t(){jn(this,t)}Rn(t,[{key:"uploadCustomerPhoto",value:function(){var t=Sn(En().mark((function t(e,n,r){var i,o,s;return En().wrap((function t(a){while(1)switch(a.prev=a.next){case 0:i=Nn.getHttpClient();o=Nn.getMerchantGuid();s=Cn(Cn({},r),{},{method:"post",url:"/api/terminal/merchants/".concat(o,"/customers/").concat(e,"/image"),data:n});a.prev=3;a.next=6;return i(s);case 6:a.next=12;break;case 8:a.prev=8;a.t0=a["catch"](3);console.error(a.t0);throw a.t0;case 12:case"end":return a.stop()}}),t,null,[[3,8]])})));function e(e,n,r){return t.apply(this,arguments)}return e}()},{key:"createCustomer",value:function(){var t=Sn(En().mark((function t(e,n){var r,i,o,s;return En().wrap((function t(a){while(1)switch(a.prev=a.next){case 0:r=Nn.getHttpClient();i=Nn.getMerchantGuid();o=Cn(Cn({},n),{},{method:"put",url:"/api/terminal/merchants/".concat(i,"/customers/customer"),data:e});a.prev=3;a.next=6;return r(o);case 6:s=a.sent;return a.abrupt("return",s.data);case 10:a.prev=10;a.t0=a["catch"](3);console.error(a.t0);throw a.t0;case 14:case"end":return a.stop()}}),t,null,[[3,10]])})));function e(e,n){return t.apply(this,arguments)}return e}()},{key:"updateCustomer",value:function(){var t=Sn(En().mark((function t(e,n){var r,i,o,s;return En().wrap((function t(a){while(1)switch(a.prev=a.next){case 0:r=Nn.getHttpClient();i=Nn.getMerchantGuid();o=Cn(Cn({},n),{},{method:"post",url:"/api/terminal/merchants/".concat(i,"/customers/customer"),data:e});a.prev=3;a.next=6;return r(o);case 6:s=a.sent;return a.abrupt("return",s.data);case 10:a.prev=10;a.t0=a["catch"](3);console.error(a.t0);throw a.t0;case 14:case"end":return a.stop()}}),t,null,[[3,10]])})));function e(e,n){return t.apply(this,arguments)}return e}()},{key:"deleteCustomer",value:function(){var t=Sn(En().mark((function t(e,n){var r,i,o;return En().wrap((function t(s){while(1)switch(s.prev=s.next){case 0:r=Nn.getHttpClient();i=Nn.getMerchantGuid();o=Cn(Cn({},n),{},{method:"delete",url:"/api/terminal/merchants/".concat(i,"/customers/").concat(e)});s.prev=3;s.next=6;return r(o);case 6:s.next=12;break;case 8:s.prev=8;s.t0=s["catch"](3);console.error(s.t0);throw s.t0;case 12:case"end":return s.stop()}}),t,null,[[3,8]])})));function e(e,n){return t.apply(this,arguments)}return e}()},{key:"getCustomerById",value:function(){var t=Sn(En().mark((function t(e,n){var r,i,o,s;return En().wrap((function t(a){while(1)switch(a.prev=a.next){case 0:r=Nn.getHttpClient();i=Nn.getMerchantGuid();o=Cn(Cn({},n),{},{method:"get",url:"/api/terminal/merchants/".concat(i,"/customers/").concat(e)});a.prev=3;a.next=6;return r(o);case 6:s=a.sent;return a.abrupt("return",s.data);case 10:a.prev=10;a.t0=a["catch"](3);console.error(a.t0);throw a.t0;case 14:case"end":return a.stop()}}),t,null,[[3,10]])})));function e(e,n){return t.apply(this,arguments)}return e}()},{key:"getCouponsByCustomerId",value:function(){var t=Sn(En().mark((function t(e,n){var r,i,o,s;return En().wrap((function t(a){while(1)switch(a.prev=a.next){case 0:r=Nn.getHttpClient();i=Nn.getMerchantGuid();o=Cn(Cn({},n),{},{method:"get",url:"/api/terminal/merchants/".concat(i,"/customers/").concat(e,"/coupons")});a.prev=3;a.next=6;return r(o);case 6:s=a.sent;return a.abrupt("return",s.data);case 10:a.prev=10;a.t0=a["catch"](3);console.error(a.t0);throw a.t0;case 14:case"end":return a.stop()}}),t,null,[[3,10]])})));function e(e,n){return t.apply(this,arguments)}return e}()},{key:"searchCustomers",value:function(){var t=Sn(En().mark((function t(e,n,r){var i,o,s,a,c;return En().wrap((function t(u){while(1)switch(u.prev=u.next){case 0:i=Nn.getHttpClient();o=Nn.getMerchantGuid();s=n.build();a=Cn(Cn({},r),{},{method:"get",url:"/sapi/terminal/merchants/".concat(o,"/customers"),params:Cn(Cn({},s),{},{SearchKeywords:e})});u.prev=4;u.next=7;return i(a);case 7:c=u.sent;return u.abrupt("return",c.data);case 11:u.prev=11;u.t0=u["catch"](4);console.error(u.t0);throw u.t0;case 15:case"end":return u.stop()}}),t,null,[[4,11]])})));function e(e,n,r){return t.apply(this,arguments)}return e}()},{key:"queryCustomers",value:function(){var t=Sn(En().mark((function t(e){var n,r,i,o,s,a,c,u=arguments;return En().wrap((function t(l){while(1)switch(l.prev=l.next){case 0:n=u.length>1&&u[1]!==undefined?u[1]:"";r=u.length>2?u[2]:undefined;i=Nn.getHttpClient();o=Nn.getMerchantGuid();s=e.build();a=Cn(Cn({},r),{},{method:"get",url:"/sapi/terminal/merchants/".concat(o,"/customers"),params:Cn(Cn({},s),n?{SearchKeywords:n}:{})});l.prev=6;l.next=9;return i(a);case 9:c=l.sent;return l.abrupt("return",c.data);case 13:l.prev=13;l.t0=l["catch"](6);console.error(l.t0);throw l.t0;case 17:case"end":return l.stop()}}),t,null,[[6,13]])})));function e(e){return t.apply(this,arguments)}return e}()},{key:"queryTransactions",value:function(){var t=Sn(En().mark((function t(e,n){var r,i,o,s,a;return En().wrap((function t(c){while(1)switch(c.prev=c.next){case 0:r=Nn.getHttpClient();i=Nn.getMerchantGuid();o=e.build();s=Cn(Cn({},n),{},{method:"get",url:"/sapi/terminal/merchants/".concat(i,"/transactions"),params:Cn({},o)});c.prev=4;c.next=7;return r(s);case 7:a=c.sent;return c.abrupt("return",a.data);case 11:c.prev=11;c.t0=c["catch"](4);console.error(c.t0);throw c.t0;case 15:case"end":return c.stop()}}),t,null,[[4,11]])})));function e(e,n){return t.apply(this,arguments)}return e}()},{key:"queryOrders",value:function(){var t=Sn(En().mark((function t(e,n){var r,i,o,s,a;return En().wrap((function t(c){while(1)switch(c.prev=c.next){case 0:r=Nn.getHttpClient();i=Nn.getMerchantGuid();o=e.build();s=Cn(Cn({},n),{},{method:"get",url:"/sapi/terminal/merchants/".concat(i,"/orders"),params:Cn({},o)});c.prev=4;c.next=7;return r(s);case 7:a=c.sent;return c.abrupt("return",a.data);case 11:c.prev=11;c.t0=c["catch"](4);console.error(c.t0);throw c.t0;case 15:case"end":return c.stop()}}),t,null,[[4,11]])})));function e(e,n){return t.apply(this,arguments)}return e}()},{key:"createCharge",value:function(){var t=Sn(En().mark((function t(e,n,r,i,o){var s,a,c,u,l;return En().wrap((function t(f){while(1)switch(f.prev=f.next){case 0:s=Nn.getHttpClient();a=Nn.getMerchantGuid();c={amount:n,reference_type:j.invoice,reference_id:r,currency:"SGD",payment_method_code:"PNOW",provider_terminal_id:e,description:i};u=Cn(Cn({},o),{},{method:"put",url:"/api/v1/terminal/merchants/".concat(a,"/charges"),data:c});f.prev=4;f.next=7;return s(u);case 7:l=f.sent;return f.abrupt("return",l.data);case 11:f.prev=11;f.t0=f["catch"](4);console.error(f.t0);throw f.t0;case 15:case"end":return f.stop()}}),t,null,[[4,11]])})));function e(e,n,r,i,o){return t.apply(this,arguments)}return e}()},{key:"getCharge",value:function(){var t=Sn(En().mark((function t(e,n){var r,i,o,s;return En().wrap((function t(a){while(1)switch(a.prev=a.next){case 0:r=Nn.getHttpClient();i=Nn.getMerchantGuid();o=Cn(Cn({},n),{},{method:"get",url:"/api/v1/terminal/merchants/".concat(i,"/charges/").concat(e)});a.prev=3;a.next=6;return r(o);case 6:s=a.sent;return a.abrupt("return",s.data);case 10:a.prev=10;a.t0=a["catch"](3);console.error(a.t0);throw a.t0;case 14:case"end":return a.stop()}}),t,null,[[3,10]])})));function e(e,n){return t.apply(this,arguments)}return e}()}]);return t}();return e})()));
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
*
|
|
3
|
+
* @wyocrm/sdk v5.0.38
|
|
4
|
+
* undefined
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Steven Lee and project contributors.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
package/package.json
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wyocrm/sdk",
|
|
3
|
+
"version": "5.0.38",
|
|
4
|
+
"description": "wyo sdk",
|
|
5
|
+
"main": "build/index.js",
|
|
6
|
+
"types": "build/index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"start": "webpack serve --config webpack.config.demo.js",
|
|
9
|
+
"build": "webpack && tsc",
|
|
10
|
+
"build:demo": "webpack --config webpack.config.demo.js",
|
|
11
|
+
"dts": "npm-dts generate -o build/index.d.ts",
|
|
12
|
+
"post:build": "node ./scripts/post-build.js",
|
|
13
|
+
"test": "jest",
|
|
14
|
+
"release": "npm run update && npm run build && npm run dts && npm run post:build && npm publish --access public && rm -rf build",
|
|
15
|
+
"coverage": "npm run test --coverage",
|
|
16
|
+
"trypublish": "npm publish || true",
|
|
17
|
+
"gen:index": "node ./scripts/generateIndex.js",
|
|
18
|
+
"update": "npm version patch && git push",
|
|
19
|
+
"docs": "typedoc --out docs src --excludePrivate --exclude '**/demo/**/*' --exclude '**/*+(interface|function|enum).ts'"
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git"
|
|
23
|
+
},
|
|
24
|
+
"author": "Steven Lee",
|
|
25
|
+
"license": "MIT",
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": ""
|
|
28
|
+
},
|
|
29
|
+
"homepage": "",
|
|
30
|
+
"keywords": [
|
|
31
|
+
"library",
|
|
32
|
+
"starter",
|
|
33
|
+
"es6"
|
|
34
|
+
],
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@babel/cli": "^7.22.15",
|
|
37
|
+
"@babel/core": "^7.22.11",
|
|
38
|
+
"@babel/plugin-proposal-decorators": "7.23.0",
|
|
39
|
+
"@babel/plugin-transform-class-properties": "7.22.5",
|
|
40
|
+
"@babel/plugin-transform-typescript": "^7.22.15",
|
|
41
|
+
"@babel/polyfill": "^7.12.1",
|
|
42
|
+
"@babel/preset-env": "^7.22.15",
|
|
43
|
+
"@babel/preset-typescript": "7.23.0",
|
|
44
|
+
"@types/jest": "^29.5.4",
|
|
45
|
+
"@types/lodash": "4.14.199",
|
|
46
|
+
"@types/node": "20.8.2",
|
|
47
|
+
"@types/uuid": "9.0.4",
|
|
48
|
+
"@typescript-eslint/eslint-plugin": "^4.33.0",
|
|
49
|
+
"@typescript-eslint/parser": "^4.33.0",
|
|
50
|
+
"babel-eslint": "^10.1.0",
|
|
51
|
+
"babel-loader": "^9.1.3",
|
|
52
|
+
"babel-preset-minify": "^0.5.2",
|
|
53
|
+
"clean-webpack-plugin": "4.0.0",
|
|
54
|
+
"css-loader": "^6.8.1",
|
|
55
|
+
"css-minimizer-webpack-plugin": "^5.0.1",
|
|
56
|
+
"eslint": "^7.32.0",
|
|
57
|
+
"file-loader": "^6.2.0",
|
|
58
|
+
"fs-extra": "11.1.1",
|
|
59
|
+
"html-webpack-plugin": "^5.5.3",
|
|
60
|
+
"jest": "^29.6.4",
|
|
61
|
+
"mini-css-extract-plugin": "^2.7.6",
|
|
62
|
+
"npm-dts": "1.3.12",
|
|
63
|
+
"sqlite3": "5.1.6",
|
|
64
|
+
"style-loader": "^3.3.2",
|
|
65
|
+
"terser-webpack-plugin": "^5.3.9",
|
|
66
|
+
"ts-jest": "29.1.1",
|
|
67
|
+
"typedoc": "0.25.3",
|
|
68
|
+
"typescript": "^4.9.5",
|
|
69
|
+
"url-loader": "^4.1.1",
|
|
70
|
+
"webpack": "^5.88.2",
|
|
71
|
+
"webpack-cli": "^5.1.4",
|
|
72
|
+
"webpack-dev-server": "4.13.3"
|
|
73
|
+
},
|
|
74
|
+
"dependencies": {
|
|
75
|
+
"axios": "1.5.1"
|
|
76
|
+
},
|
|
77
|
+
"files": [
|
|
78
|
+
"build"
|
|
79
|
+
]
|
|
80
|
+
}
|