@customafk/lunas-api-sdk 0.0.1 → 0.0.2

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/dist/index.d.cts CHANGED
@@ -1,301 +1,19 @@
1
1
  import { Treaty } from "@elysiajs/eden";
2
2
 
3
- //#region src/types.d.ts
4
- type TResponsePagination = {
5
- page: number;
6
- limit: number;
7
- total: number;
8
- totalPages: number;
9
- hasNextPage: boolean;
10
- hasPreviousPage: boolean;
11
- };
12
- type TResponseError = {
13
- statusCode: number;
14
- message: string;
15
- reference?: string | null;
16
- fields?: {
17
- [key: string]: string[] | string;
18
- };
19
- };
20
- type TResponseMeta = {
21
- version: string;
22
- timestamp: string;
23
- path: string;
24
- pagination?: TResponsePagination;
25
- };
26
- //#endregion
27
3
  //#region src/utils.d.ts
28
4
  type TUser = Treaty.Data<Awaited<ReturnType<Treaty.Create<AppType>['admin']['v1']['auth']['me']['get']>>>['data'];
29
- type Config = {
30
- baseURL: string;
31
- config?: Omit<Treaty.Config, 'onResponse'>;
32
- listeners?: {
33
- onSetUser?: (user: TUser | null) => void | Promise<void>;
34
- onUnauthorized?: () => void | Promise<void>;
35
- onLogout?: () => void | Promise<void>;
36
- onRefreshToken?: (status: 'SUCCESS' | 'FAILED') => void | Promise<void>;
37
- onRefreshFailed?: () => void | Promise<void>;
38
- };
39
- };
40
- declare class ClientApi {
41
- private static _getMeTask;
42
- private static _refreshTokenTask;
43
- private static _logoutTask;
44
- private static _client;
45
- static client: Treaty.Create<AppType>;
46
- static _status: 'LOGGED' | 'INITIAL' | 'LOGGING';
47
- static _user: TUser;
48
- private static _getMe;
49
- private static _refreshToken;
50
- private static _logout;
51
- constructor({
52
- baseURL,
53
- config,
54
- listeners
55
- }: Config);
56
- isLogged(): boolean;
57
- isInitial(): boolean;
58
- getUser(): {
59
- uuid: string | null;
60
- email: string;
61
- createdAt: Date | null;
62
- updatedAt: Date | null;
63
- username: string;
64
- role: string;
65
- networks: {
66
- createdAt: Date | null;
67
- updatedAt: Date | null;
68
- id: number;
69
- provider: string;
70
- providerId: string;
71
- }[];
72
- profile: {
73
- createdAt: Date | null;
74
- updatedAt: Date | null;
75
- id: number;
76
- fullname: string;
77
- phoneNumber: string | null;
78
- bio: string | null;
79
- gender: number | null;
80
- dateOfBirth: Date | null;
81
- } | null;
82
- customerAddresses: {
83
- createdAt: Date | null;
84
- updatedAt: Date | null;
85
- id: number;
86
- fullname: string;
87
- phoneNumber: string;
88
- street: string;
89
- isDefault: boolean | null;
90
- province: {
91
- name: string;
92
- type: string;
93
- id: string | null;
94
- };
95
- ward: {
96
- name: string;
97
- type: string;
98
- id: string | null;
99
- districtId: string | null;
100
- };
101
- district: {
102
- name: string;
103
- type: string;
104
- id: string | null;
105
- provinceId: string | null;
106
- };
107
- }[];
108
- } | null;
109
- getClient(): {
110
- admin: {
111
- v1: {
112
- auth: {
113
- get: (options?: {
114
- headers?: Record<string, unknown> | undefined;
115
- query?: Record<string, unknown> | undefined;
116
- fetch?: RequestInit | undefined;
117
- } | undefined) => Promise<Treaty.TreatyResponse<{
118
- 200: string;
119
- }>>;
120
- me: {
121
- get: (options?: {
122
- headers?: {} | undefined;
123
- query?: {} | undefined;
124
- fetch?: RequestInit | undefined;
125
- } | undefined) => Promise<Treaty.TreatyResponse<{
126
- 200: {
127
- success: false;
128
- statusCode: number;
129
- data: null;
130
- message: string;
131
- error: void 0;
132
- meta: void 0;
133
- } | {
134
- success: true;
135
- statusCode: number;
136
- data: undefined;
137
- message: null;
138
- error: null;
139
- meta: void 0;
140
- } | {
141
- success: true;
142
- statusCode: number;
143
- data: {
144
- uuid: string | null;
145
- email: string;
146
- createdAt: Date | null;
147
- updatedAt: Date | null;
148
- username: string;
149
- role: string;
150
- networks: {
151
- createdAt: Date | null;
152
- updatedAt: Date | null;
153
- id: number;
154
- provider: string;
155
- providerId: string;
156
- }[];
157
- profile: {
158
- createdAt: Date | null;
159
- updatedAt: Date | null;
160
- id: number;
161
- fullname: string;
162
- phoneNumber: string | null;
163
- bio: string | null;
164
- gender: number | null;
165
- dateOfBirth: Date | null;
166
- } | null;
167
- customerAddresses: {
168
- createdAt: Date | null;
169
- updatedAt: Date | null;
170
- id: number;
171
- fullname: string;
172
- phoneNumber: string;
173
- street: string;
174
- isDefault: boolean | null;
175
- province: {
176
- name: string;
177
- type: string;
178
- id: string | null;
179
- };
180
- ward: {
181
- name: string;
182
- type: string;
183
- id: string | null;
184
- districtId: string | null;
185
- };
186
- district: {
187
- name: string;
188
- type: string;
189
- id: string | null;
190
- provinceId: string | null;
191
- };
192
- }[];
193
- };
194
- message: null;
195
- error: null;
196
- meta: void 0;
197
- };
198
- }>>;
199
- };
200
- "refresh-token": {
201
- get: (options?: {
202
- headers?: {} | undefined;
203
- query?: {} | undefined;
204
- fetch?: RequestInit | undefined;
205
- } | undefined) => Promise<Treaty.TreatyResponse<{
206
- 200: {
207
- success: true;
208
- statusCode: number;
209
- data: null;
210
- message: string;
211
- error: null;
212
- meta: void 0;
213
- } | {
214
- success: false;
215
- statusCode: number;
216
- data: null;
217
- message: string;
218
- error: void 0;
219
- meta: void 0;
220
- };
221
- }>>;
222
- };
223
- login: {
224
- post: (body: {
225
- email: string;
226
- password: string;
227
- }, options?: {
228
- headers?: {} | undefined;
229
- query?: {} | undefined;
230
- fetch?: RequestInit | undefined;
231
- } | undefined) => Promise<Treaty.TreatyResponse<{
232
- 200: {
233
- success: true;
234
- statusCode: number;
235
- data: null;
236
- message: string;
237
- error: null;
238
- meta: void 0;
239
- } | {
240
- success: false;
241
- statusCode: number;
242
- data: null;
243
- message: string;
244
- error: void 0;
245
- meta: void 0;
246
- };
247
- 422: {
248
- type: "validation";
249
- on: string;
250
- summary?: string;
251
- message?: string;
252
- found?: unknown;
253
- property?: string;
254
- expected?: string;
255
- };
256
- }>>;
257
- };
258
- logout: {
259
- delete: (body?: {} | undefined, options?: {
260
- headers?: {} | undefined;
261
- query?: {} | undefined;
262
- fetch?: RequestInit | undefined;
263
- } | undefined) => Promise<Treaty.TreatyResponse<{
264
- 200: {
265
- success: true;
266
- statusCode: number;
267
- data: null;
268
- message: string;
269
- error: null;
270
- meta: void 0;
271
- } | {
272
- success: false;
273
- statusCode: number;
274
- data: null;
275
- message: string;
276
- error: void 0;
277
- meta: void 0;
278
- } | {
279
- success: false;
280
- statusCode: number;
281
- data: null;
282
- message: string;
283
- error: void 0;
284
- meta: void 0;
285
- } | {
286
- success: true;
287
- statusCode: number;
288
- data: undefined;
289
- message: null;
290
- error: null;
291
- meta: void 0;
292
- };
293
- }>>;
294
- };
295
- };
296
- account: ((params: {
297
- uuid: string | number;
298
- }) => {
5
+ declare const _: () => {
6
+ admin: {
7
+ v1: {
8
+ auth: {
9
+ get: (options?: {
10
+ headers?: Record<string, unknown> | undefined;
11
+ query?: Record<string, unknown> | undefined;
12
+ fetch?: RequestInit | undefined;
13
+ } | undefined) => Promise<Treaty.TreatyResponse<{
14
+ 200: string;
15
+ }>>;
16
+ me: {
299
17
  get: (options?: {
300
18
  headers?: {} | undefined;
301
19
  query?: {} | undefined;
@@ -308,6 +26,13 @@ declare class ClientApi {
308
26
  message: string;
309
27
  error: void 0;
310
28
  meta: void 0;
29
+ } | {
30
+ success: true;
31
+ statusCode: number;
32
+ data: undefined;
33
+ message: null;
34
+ error: null;
35
+ meta: void 0;
311
36
  } | {
312
37
  success: true;
313
38
  statusCode: number;
@@ -318,7 +43,6 @@ declare class ClientApi {
318
43
  updatedAt: Date | null;
319
44
  username: string;
320
45
  role: string;
321
- isActive: boolean | null;
322
46
  networks: {
323
47
  createdAt: Date | null;
324
48
  updatedAt: Date | null;
@@ -334,100 +58,86 @@ declare class ClientApi {
334
58
  phoneNumber: string | null;
335
59
  bio: string | null;
336
60
  gender: number | null;
337
- socialLinks: unknown;
338
61
  dateOfBirth: Date | null;
339
62
  } | null;
63
+ customerAddresses: {
64
+ createdAt: Date | null;
65
+ updatedAt: Date | null;
66
+ id: number;
67
+ fullname: string;
68
+ phoneNumber: string;
69
+ street: string;
70
+ isDefault: boolean | null;
71
+ province: {
72
+ name: string;
73
+ type: string;
74
+ id: string | null;
75
+ };
76
+ ward: {
77
+ name: string;
78
+ type: string;
79
+ id: string | null;
80
+ districtId: string | null;
81
+ };
82
+ district: {
83
+ name: string;
84
+ type: string;
85
+ id: string | null;
86
+ provinceId: string | null;
87
+ };
88
+ }[];
340
89
  };
341
90
  message: null;
342
91
  error: null;
343
92
  meta: void 0;
344
93
  };
345
- 422: {
346
- type: "validation";
347
- on: string;
348
- summary?: string;
349
- message?: string;
350
- found?: unknown;
351
- property?: string;
352
- expected?: string;
353
- };
354
94
  }>>;
355
- delete: (body?: {} | undefined, options?: {
95
+ };
96
+ "refresh-token": {
97
+ get: (options?: {
356
98
  headers?: {} | undefined;
357
99
  query?: {} | undefined;
358
100
  fetch?: RequestInit | undefined;
359
101
  } | undefined) => Promise<Treaty.TreatyResponse<{
360
102
  200: {
361
- success: false;
103
+ success: true;
362
104
  statusCode: number;
363
105
  data: null;
364
106
  message: string;
365
- error: void 0;
107
+ error: null;
366
108
  meta: void 0;
367
109
  } | {
368
- success: true;
110
+ success: false;
369
111
  statusCode: number;
370
- data: {
371
- userUuid: string;
372
- };
373
- message: null;
374
- error: null;
112
+ data: null;
113
+ message: string;
114
+ error: void 0;
375
115
  meta: void 0;
376
116
  };
377
- 422: {
378
- type: "validation";
379
- on: string;
380
- summary?: string;
381
- message?: string;
382
- found?: unknown;
383
- property?: string;
384
- expected?: string;
385
- };
386
117
  }>>;
387
- }) & {
388
- get: (options?: {
118
+ };
119
+ login: {
120
+ post: (body: {
121
+ email: string;
122
+ password: string;
123
+ }, options?: {
389
124
  headers?: {} | undefined;
390
- query?: {
391
- page?: number | undefined;
392
- limit?: number | undefined;
393
- } | undefined;
125
+ query?: {} | undefined;
394
126
  fetch?: RequestInit | undefined;
395
127
  } | undefined) => Promise<Treaty.TreatyResponse<{
396
128
  200: {
397
- success: false;
129
+ success: true;
398
130
  statusCode: number;
399
131
  data: null;
400
132
  message: string;
401
- error: void 0;
133
+ error: null;
402
134
  meta: void 0;
403
135
  } | {
404
- success: true;
136
+ success: false;
405
137
  statusCode: number;
406
- data: {
407
- data: {
408
- uuid: string | null;
409
- email: string;
410
- createdAt: Date | null;
411
- updatedAt: Date | null;
412
- username: string;
413
- role: string;
414
- isActive: boolean | null;
415
- profile: {
416
- fullname: string;
417
- phoneNumber: string | null;
418
- } | null;
419
- }[];
420
- pagination: {
421
- page: number;
422
- limit: number;
423
- total: number;
424
- totalPages: number;
425
- hasNextPage: boolean;
426
- hasPreviousPage: boolean;
427
- };
428
- };
429
- message: null;
430
- error: null;
138
+ data: null;
139
+ message: string;
140
+ error: void 0;
431
141
  meta: void 0;
432
142
  };
433
143
  422: {
@@ -440,19 +150,28 @@ declare class ClientApi {
440
150
  expected?: string;
441
151
  };
442
152
  }>>;
443
- post: (body: {
444
- email: string;
445
- password: string;
446
- firstName: string;
447
- lastName: string;
448
- role: void 0;
449
- phoneNumber?: string | undefined;
450
- }, options?: {
153
+ };
154
+ logout: {
155
+ delete: (body?: {} | undefined, options?: {
451
156
  headers?: {} | undefined;
452
157
  query?: {} | undefined;
453
158
  fetch?: RequestInit | undefined;
454
159
  } | undefined) => Promise<Treaty.TreatyResponse<{
455
160
  200: {
161
+ success: true;
162
+ statusCode: number;
163
+ data: null;
164
+ message: string;
165
+ error: null;
166
+ meta: void 0;
167
+ } | {
168
+ success: false;
169
+ statusCode: number;
170
+ data: null;
171
+ message: string;
172
+ error: void 0;
173
+ meta: void 0;
174
+ } | {
456
175
  success: false;
457
176
  statusCode: number;
458
177
  data: null;
@@ -466,9 +185,121 @@ declare class ClientApi {
466
185
  message: null;
467
186
  error: null;
468
187
  meta: void 0;
469
- } | {
470
- success: true;
471
- statusCode: number;
188
+ };
189
+ }>>;
190
+ };
191
+ };
192
+ account: ((params: {
193
+ uuid: string | number;
194
+ }) => {
195
+ get: (options?: {
196
+ headers?: {} | undefined;
197
+ query?: {} | undefined;
198
+ fetch?: RequestInit | undefined;
199
+ } | undefined) => Promise<Treaty.TreatyResponse<{
200
+ 200: {
201
+ success: false;
202
+ statusCode: number;
203
+ data: null;
204
+ message: string;
205
+ error: void 0;
206
+ meta: void 0;
207
+ } | {
208
+ success: true;
209
+ statusCode: number;
210
+ data: {
211
+ uuid: string | null;
212
+ email: string;
213
+ createdAt: Date | null;
214
+ updatedAt: Date | null;
215
+ username: string;
216
+ role: string;
217
+ isActive: boolean | null;
218
+ networks: {
219
+ createdAt: Date | null;
220
+ updatedAt: Date | null;
221
+ id: number;
222
+ provider: string;
223
+ providerId: string;
224
+ }[];
225
+ profile: {
226
+ createdAt: Date | null;
227
+ updatedAt: Date | null;
228
+ id: number;
229
+ fullname: string;
230
+ phoneNumber: string | null;
231
+ bio: string | null;
232
+ gender: number | null;
233
+ socialLinks: unknown;
234
+ dateOfBirth: Date | null;
235
+ } | null;
236
+ };
237
+ message: null;
238
+ error: null;
239
+ meta: void 0;
240
+ };
241
+ 422: {
242
+ type: "validation";
243
+ on: string;
244
+ summary?: string;
245
+ message?: string;
246
+ found?: unknown;
247
+ property?: string;
248
+ expected?: string;
249
+ };
250
+ }>>;
251
+ delete: (body?: {} | undefined, options?: {
252
+ headers?: {} | undefined;
253
+ query?: {} | undefined;
254
+ fetch?: RequestInit | undefined;
255
+ } | undefined) => Promise<Treaty.TreatyResponse<{
256
+ 200: {
257
+ success: false;
258
+ statusCode: number;
259
+ data: null;
260
+ message: string;
261
+ error: void 0;
262
+ meta: void 0;
263
+ } | {
264
+ success: true;
265
+ statusCode: number;
266
+ data: {
267
+ userUuid: string;
268
+ };
269
+ message: null;
270
+ error: null;
271
+ meta: void 0;
272
+ };
273
+ 422: {
274
+ type: "validation";
275
+ on: string;
276
+ summary?: string;
277
+ message?: string;
278
+ found?: unknown;
279
+ property?: string;
280
+ expected?: string;
281
+ };
282
+ }>>;
283
+ }) & {
284
+ get: (options?: {
285
+ headers?: {} | undefined;
286
+ query?: {
287
+ page?: number | undefined;
288
+ limit?: number | undefined;
289
+ } | undefined;
290
+ fetch?: RequestInit | undefined;
291
+ } | undefined) => Promise<Treaty.TreatyResponse<{
292
+ 200: {
293
+ success: false;
294
+ statusCode: number;
295
+ data: null;
296
+ message: string;
297
+ error: void 0;
298
+ meta: void 0;
299
+ } | {
300
+ success: true;
301
+ statusCode: number;
302
+ data: {
472
303
  data: {
473
304
  uuid: string | null;
474
305
  email: string;
@@ -476,770 +307,223 @@ declare class ClientApi {
476
307
  updatedAt: Date | null;
477
308
  username: string;
478
309
  role: string;
479
- networks: {
480
- createdAt: Date | null;
481
- updatedAt: Date | null;
482
- id: number;
483
- provider: string;
484
- providerId: string;
485
- }[];
310
+ isActive: boolean | null;
486
311
  profile: {
487
- createdAt: Date | null;
488
- updatedAt: Date | null;
489
- id: number;
490
312
  fullname: string;
491
313
  phoneNumber: string | null;
492
- bio: string | null;
493
- gender: number | null;
494
- dateOfBirth: Date | null;
495
314
  } | null;
496
- customerAddresses: {
497
- createdAt: Date | null;
498
- updatedAt: Date | null;
499
- id: number;
500
- fullname: string;
501
- phoneNumber: string;
502
- street: string;
503
- isDefault: boolean | null;
504
- province: {
505
- name: string;
506
- type: string;
507
- id: string | null;
508
- };
509
- ward: {
510
- name: string;
511
- type: string;
512
- id: string | null;
513
- districtId: string | null;
514
- };
515
- district: {
516
- name: string;
517
- type: string;
518
- id: string | null;
519
- provinceId: string | null;
520
- };
521
- }[];
522
- };
523
- message: null;
524
- error: null;
525
- meta: void 0;
526
- };
527
- 422: {
528
- type: "validation";
529
- on: string;
530
- summary?: string;
531
- message?: string;
532
- found?: unknown;
533
- property?: string;
534
- expected?: string;
535
- };
536
- }>>;
537
- };
538
- category: ((params: {
539
- uuid: string | number;
540
- }) => {
541
- get: (options?: {
542
- headers?: {} | undefined;
543
- query?: {} | undefined;
544
- fetch?: RequestInit | undefined;
545
- } | undefined) => Promise<Treaty.TreatyResponse<{
546
- 200: {
547
- success: false;
548
- statusCode: number;
549
- data: null;
550
- message: string;
551
- error: void 0;
552
- meta: void 0;
553
- } | {
554
- success: true;
555
- statusCode: number;
556
- data: {
557
- name: string;
558
- uuid: string;
559
- slug: string;
560
- description: string | null;
561
- createdAt: Date;
562
- updatedAt: Date;
563
- sub: {
564
- name: string;
565
- uuid: string;
566
- slug: string;
567
- description: string | null;
568
- createdAt: Date;
569
- updatedAt: Date;
570
- }[];
571
- };
572
- message: null;
573
- error: null;
574
- meta: void 0;
575
- };
576
- 422: {
577
- type: "validation";
578
- on: string;
579
- summary?: string;
580
- message?: string;
581
- found?: unknown;
582
- property?: string;
583
- expected?: string;
584
- };
585
- }>>;
586
- post: (body: {
587
- name: string;
588
- description: string;
589
- }, options?: {
590
- headers?: {} | undefined;
591
- query?: {} | undefined;
592
- fetch?: RequestInit | undefined;
593
- } | undefined) => Promise<Treaty.TreatyResponse<{
594
- 200: {
595
- success: false;
596
- statusCode: number;
597
- data: null;
598
- message: string;
599
- error: void 0;
600
- meta: void 0;
601
- } | {
602
- success: true;
603
- statusCode: number;
604
- data: {
605
- uuid: string;
606
- };
607
- message: null;
608
- error: null;
609
- meta: void 0;
610
- };
611
- 422: {
612
- type: "validation";
613
- on: string;
614
- summary?: string;
615
- message?: string;
616
- found?: unknown;
617
- property?: string;
618
- expected?: string;
619
- };
620
- }>>;
621
- bulk: {
622
- post: (body: {
623
- parentUuid: string;
624
- categories: {
625
- name: string;
626
- description: string;
627
- }[];
628
- }, options?: {
629
- headers?: {} | undefined;
630
- query?: {} | undefined;
631
- fetch?: RequestInit | undefined;
632
- } | undefined) => Promise<Treaty.TreatyResponse<{
633
- 200: {
634
- success: false;
635
- statusCode: number;
636
- data: null;
637
- message: string;
638
- error: void 0;
639
- meta: void 0;
640
- } | {
641
- success: true;
642
- statusCode: number;
643
- data: {
644
- categories: {
645
- uuid: string;
646
- name: string;
647
- description: string | null;
648
- slug: string;
649
- createdAt: Date;
650
- updatedAt: Date;
651
- }[];
652
- };
653
- message: null;
654
- error: null;
655
- meta: void 0;
656
- };
657
- 422: {
658
- type: "validation";
659
- on: string;
660
- summary?: string;
661
- message?: string;
662
- found?: unknown;
663
- property?: string;
664
- expected?: string;
665
- };
666
- }>>;
667
- };
668
- patch: (body?: {
669
- name?: string | undefined;
670
- description?: string | undefined;
671
- parentUuid?: string | undefined;
672
- } | undefined, options?: {
673
- headers?: {} | undefined;
674
- query?: {} | undefined;
675
- fetch?: RequestInit | undefined;
676
- } | undefined) => Promise<Treaty.TreatyResponse<{
677
- 200: {
678
- success: false;
679
- statusCode: number;
680
- data: null;
681
- message: string;
682
- error: void 0;
683
- meta: void 0;
684
- } | {
685
- success: true;
686
- statusCode: number;
687
- data: {
688
- uuid: string;
689
- };
690
- message: null;
691
- error: null;
692
- meta: void 0;
693
- };
694
- 422: {
695
- type: "validation";
696
- on: string;
697
- summary?: string;
698
- message?: string;
699
- found?: unknown;
700
- property?: string;
701
- expected?: string;
702
- };
703
- }>>;
704
- delete: (body?: {} | undefined, options?: {
705
- headers?: {} | undefined;
706
- query?: {} | undefined;
707
- fetch?: RequestInit | undefined;
708
- } | undefined) => Promise<Treaty.TreatyResponse<{
709
- 200: {
710
- success: true;
711
- statusCode: number;
712
- data: null;
713
- message: string;
714
- error: null;
715
- meta: void 0;
716
- } | {
717
- success: false;
718
- statusCode: number;
719
- data: null;
720
- message: string;
721
- error: void 0;
722
- meta: void 0;
723
- };
724
- 422: {
725
- type: "validation";
726
- on: string;
727
- summary?: string;
728
- message?: string;
729
- found?: unknown;
730
- property?: string;
731
- expected?: string;
732
- };
733
- }>>;
734
- }) & {
735
- get: (options?: {
736
- headers?: {} | undefined;
737
- query?: {} | undefined;
738
- fetch?: RequestInit | undefined;
739
- } | undefined) => Promise<Treaty.TreatyResponse<{
740
- 200: {
741
- success: false;
742
- statusCode: number;
743
- data: null;
744
- message: string;
745
- error: void 0;
746
- meta: void 0;
747
- } | {
748
- success: true;
749
- statusCode: number;
750
- data: {
751
- name: string;
752
- uuid: string;
753
- slug: string;
754
- description: string | null;
755
- createdAt: Date;
756
- updatedAt: Date;
757
- sub: {
758
- name: string;
759
- uuid: string;
760
- slug: string;
761
- description: string | null;
762
- createdAt: Date;
763
- updatedAt: Date;
764
- }[];
765
- }[];
766
- message: null;
767
- error: null;
768
- meta: void 0;
769
- };
770
- }>>;
771
- post: (body: {
772
- name: string;
773
- description: string;
774
- }, options?: {
775
- headers?: {} | undefined;
776
- query?: {} | undefined;
777
- fetch?: RequestInit | undefined;
778
- } | undefined) => Promise<Treaty.TreatyResponse<{
779
- 200: {
780
- success: false;
781
- statusCode: number;
782
- data: null;
783
- message: string;
784
- error: void 0;
785
- meta: void 0;
786
- } | {
787
- success: true;
788
- statusCode: number;
789
- data: {
790
- uuid: string;
791
- };
792
- message: null;
793
- error: null;
794
- meta: void 0;
795
- };
796
- 422: {
797
- type: "validation";
798
- on: string;
799
- summary?: string;
800
- message?: string;
801
- found?: unknown;
802
- property?: string;
803
- expected?: string;
804
- };
805
- }>>;
806
- bulk: {
807
- post: (body: {
808
- categories: {
809
- name: string;
810
- description: string;
811
- }[];
812
- }, options?: {
813
- headers?: {} | undefined;
814
- query?: {} | undefined;
815
- fetch?: RequestInit | undefined;
816
- } | undefined) => Promise<Treaty.TreatyResponse<{
817
- 200: {
818
- success: false;
819
- statusCode: number;
820
- data: null;
821
- message: string;
822
- error: void 0;
823
- meta: void 0;
824
- } | {
825
- success: true;
826
- statusCode: number;
827
- data: {
828
- categories: {
829
- uuid: string;
830
- name: string;
831
- description: string | null;
832
- slug: string;
833
- createdAt: Date;
834
- updatedAt: Date;
835
- }[];
836
- };
837
- message: null;
838
- error: null;
839
- meta: void 0;
840
- };
841
- 422: {
842
- type: "validation";
843
- on: string;
844
- summary?: string;
845
- message?: string;
846
- found?: unknown;
847
- property?: string;
848
- expected?: string;
849
- };
850
- }>>;
851
- delete: (body: {}, options: {
852
- headers?: {} | undefined;
853
- query: {
854
- uuids: string[];
855
- };
856
- fetch?: RequestInit | undefined;
857
- }) => Promise<Treaty.TreatyResponse<{
858
- 200: {
859
- success: true;
860
- statusCode: number;
861
- data: null;
862
- message: string;
863
- error: null;
864
- meta: void 0;
865
- } | {
866
- success: false;
867
- statusCode: number;
868
- data: null;
869
- message: string;
870
- error: void 0;
871
- meta: void 0;
872
- };
873
- 422: {
874
- type: "validation";
875
- on: string;
876
- summary?: string;
877
- message?: string;
878
- found?: unknown;
879
- property?: string;
880
- expected?: string;
881
- };
882
- }>>;
883
- };
884
- };
885
- currency: ((params: {
886
- id: string | number;
887
- }) => {
888
- get: (options: {
889
- headers?: {} | undefined;
890
- query: {
891
- id: number;
892
- };
893
- fetch?: RequestInit | undefined;
894
- }) => Promise<Treaty.TreatyResponse<{
895
- 200: {
896
- success: false;
897
- statusCode: number;
898
- data: null;
899
- message: string;
900
- error: void 0;
901
- meta: void 0;
902
- } | {
903
- success: true;
904
- statusCode: number;
905
- data: {
906
- name: string;
907
- createdAt: Date | null;
908
- updatedAt: Date | null;
909
- id: number;
910
- code: string;
911
- exchangeRate: number;
315
+ }[];
316
+ pagination: {
317
+ page: number;
318
+ limit: number;
319
+ total: number;
320
+ totalPages: number;
321
+ hasNextPage: boolean;
322
+ hasPreviousPage: boolean;
912
323
  };
913
- message: null;
914
- error: null;
915
- meta: void 0;
916
- };
917
- 422: {
918
- type: "validation";
919
- on: string;
920
- summary?: string;
921
- message?: string;
922
- found?: unknown;
923
- property?: string;
924
- expected?: string;
925
- };
926
- }>>;
927
- patch: (body?: {
928
- code?: "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BTN" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHF" | "CLP" | "CNY" | "COP" | "CRC" | "CUC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GGP" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "IMP" | "INR" | "IQD" | "IRR" | "ISK" | "JEP" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLE" | "SLL" | "SOS" | "SRD" | "STN" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TVD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VED" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XDR" | "XOF" | "XPF" | "YER" | "ZAR" | "ZMW" | "ZWL" | undefined;
929
- name?: string | undefined;
930
- exchangeRate?: number | undefined;
931
- } | undefined, options?: {
932
- headers?: {} | undefined;
933
- query?: {} | undefined;
934
- fetch?: RequestInit | undefined;
935
- } | undefined) => Promise<Treaty.TreatyResponse<{
936
- 200: {
937
- success: true;
938
- statusCode: number;
939
- data: null;
940
- message: string;
941
- error: null;
942
- meta: void 0;
943
- } | {
944
- success: false;
945
- statusCode: number;
946
- data: null;
947
- message: string;
948
- error: void 0;
949
- meta: void 0;
950
- };
951
- 422: {
952
- type: "validation";
953
- on: string;
954
- summary?: string;
955
- message?: string;
956
- found?: unknown;
957
- property?: string;
958
- expected?: string;
959
- };
960
- }>>;
961
- delete: (body?: {} | undefined, options?: {
962
- headers?: {} | undefined;
963
- query?: {} | undefined;
964
- fetch?: RequestInit | undefined;
965
- } | undefined) => Promise<Treaty.TreatyResponse<{
966
- 200: {
967
- success: true;
968
- statusCode: number;
969
- data: null;
970
- message: string;
971
- error: null;
972
- meta: void 0;
973
- } | {
974
- success: false;
975
- statusCode: number;
976
- data: null;
977
- message: string;
978
- error: void 0;
979
- meta: void 0;
980
- };
981
- 422: {
982
- type: "validation";
983
- on: string;
984
- summary?: string;
985
- message?: string;
986
- found?: unknown;
987
- property?: string;
988
- expected?: string;
989
324
  };
990
- }>>;
991
- }) & {
992
- get: (options?: {
993
- headers?: {} | undefined;
994
- query?: {} | undefined;
995
- fetch?: RequestInit | undefined;
996
- } | undefined) => Promise<Treaty.TreatyResponse<{
997
- 200: {
998
- success: false;
999
- statusCode: number;
1000
- data: null;
1001
- message: string;
1002
- error: void 0;
1003
- meta: void 0;
1004
- } | {
1005
- success: true;
1006
- statusCode: number;
1007
- data: {
1008
- name: string;
325
+ message: null;
326
+ error: null;
327
+ meta: void 0;
328
+ };
329
+ 422: {
330
+ type: "validation";
331
+ on: string;
332
+ summary?: string;
333
+ message?: string;
334
+ found?: unknown;
335
+ property?: string;
336
+ expected?: string;
337
+ };
338
+ }>>;
339
+ post: (body: {
340
+ email: string;
341
+ password: string;
342
+ firstName: string;
343
+ lastName: string;
344
+ role: void 0;
345
+ phoneNumber?: string | undefined;
346
+ }, options?: {
347
+ headers?: {} | undefined;
348
+ query?: {} | undefined;
349
+ fetch?: RequestInit | undefined;
350
+ } | undefined) => Promise<Treaty.TreatyResponse<{
351
+ 200: {
352
+ success: false;
353
+ statusCode: number;
354
+ data: null;
355
+ message: string;
356
+ error: void 0;
357
+ meta: void 0;
358
+ } | {
359
+ success: true;
360
+ statusCode: number;
361
+ data: undefined;
362
+ message: null;
363
+ error: null;
364
+ meta: void 0;
365
+ } | {
366
+ success: true;
367
+ statusCode: number;
368
+ data: {
369
+ uuid: string | null;
370
+ email: string;
371
+ createdAt: Date | null;
372
+ updatedAt: Date | null;
373
+ username: string;
374
+ role: string;
375
+ networks: {
1009
376
  createdAt: Date | null;
1010
377
  updatedAt: Date | null;
1011
378
  id: number;
1012
- code: string;
1013
- exchangeRate: number;
379
+ provider: string;
380
+ providerId: string;
1014
381
  }[];
1015
- message: null;
1016
- error: null;
1017
- meta: void 0;
1018
- };
1019
- }>>;
1020
- count: {
1021
- get: (options?: {
1022
- headers?: {} | undefined;
1023
- query?: {} | undefined;
1024
- fetch?: RequestInit | undefined;
1025
- } | undefined) => Promise<Treaty.TreatyResponse<{
1026
- 200: {
1027
- success: false;
1028
- statusCode: number;
1029
- data: null;
1030
- message: string;
1031
- error: void 0;
1032
- meta: void 0;
1033
- } | {
1034
- success: true;
1035
- statusCode: number;
1036
- data: number;
1037
- message: null;
1038
- error: null;
1039
- meta: void 0;
1040
- };
1041
- }>>;
1042
- };
1043
- post: (body: {
1044
- code: "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BTN" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHF" | "CLP" | "CNY" | "COP" | "CRC" | "CUC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GGP" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "IMP" | "INR" | "IQD" | "IRR" | "ISK" | "JEP" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLE" | "SLL" | "SOS" | "SRD" | "STN" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TVD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VED" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XDR" | "XOF" | "XPF" | "YER" | "ZAR" | "ZMW" | "ZWL";
1045
- name: string;
1046
- exchangeRate: number;
1047
- }, options?: {
1048
- headers?: {} | undefined;
1049
- query?: {} | undefined;
1050
- fetch?: RequestInit | undefined;
1051
- } | undefined) => Promise<Treaty.TreatyResponse<{
1052
- 200: {
1053
- success: false;
1054
- statusCode: number;
1055
- data: null;
1056
- message: string;
1057
- error: void 0;
1058
- meta: void 0;
1059
- } | {
1060
- success: true;
1061
- statusCode: number;
1062
- data: {
382
+ profile: {
383
+ createdAt: Date | null;
384
+ updatedAt: Date | null;
1063
385
  id: number;
1064
- name: string;
1065
- code: string;
1066
- exchangeRate: number;
386
+ fullname: string;
387
+ phoneNumber: string | null;
388
+ bio: string | null;
389
+ gender: number | null;
390
+ dateOfBirth: Date | null;
391
+ } | null;
392
+ customerAddresses: {
1067
393
  createdAt: Date | null;
1068
394
  updatedAt: Date | null;
395
+ id: number;
396
+ fullname: string;
397
+ phoneNumber: string;
398
+ street: string;
399
+ isDefault: boolean | null;
400
+ province: {
401
+ name: string;
402
+ type: string;
403
+ id: string | null;
404
+ };
405
+ ward: {
406
+ name: string;
407
+ type: string;
408
+ id: string | null;
409
+ districtId: string | null;
410
+ };
411
+ district: {
412
+ name: string;
413
+ type: string;
414
+ id: string | null;
415
+ provinceId: string | null;
416
+ };
1069
417
  }[];
1070
- message: null;
1071
- error: null;
1072
- meta: void 0;
1073
- };
1074
- 422: {
1075
- type: "validation";
1076
- on: string;
1077
- summary?: string;
1078
- message?: string;
1079
- found?: unknown;
1080
- property?: string;
1081
- expected?: string;
1082
418
  };
1083
- }>>;
1084
- bulk: {
1085
- post: (body: {
1086
- currencies: {
1087
- code: "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BTN" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHF" | "CLP" | "CNY" | "COP" | "CRC" | "CUC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GGP" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "IMP" | "INR" | "IQD" | "IRR" | "ISK" | "JEP" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLE" | "SLL" | "SOS" | "SRD" | "STN" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TVD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VED" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XDR" | "XOF" | "XPF" | "YER" | "ZAR" | "ZMW" | "ZWL";
1088
- name: string;
1089
- exchangeRate: number;
1090
- }[];
1091
- }, options?: {
1092
- headers?: {} | undefined;
1093
- query?: {} | undefined;
1094
- fetch?: RequestInit | undefined;
1095
- } | undefined) => Promise<Treaty.TreatyResponse<{
1096
- 200: {
1097
- success: false;
1098
- statusCode: number;
1099
- data: null;
1100
- message: string;
1101
- error: void 0;
1102
- meta: void 0;
1103
- } | {
1104
- success: true;
1105
- statusCode: number;
1106
- data: {
1107
- id: number;
1108
- name: string;
1109
- code: string;
1110
- exchangeRate: number;
1111
- createdAt: Date | null;
1112
- updatedAt: Date | null;
1113
- }[];
1114
- message: null;
1115
- error: null;
1116
- meta: void 0;
1117
- };
1118
- 422: {
1119
- type: "validation";
1120
- on: string;
1121
- summary?: string;
1122
- message?: string;
1123
- found?: unknown;
1124
- property?: string;
1125
- expected?: string;
1126
- };
1127
- }>>;
1128
- delete: (body: {}, options: {
1129
- headers?: {} | undefined;
1130
- query: {
1131
- ids: number[];
1132
- };
1133
- fetch?: RequestInit | undefined;
1134
- }) => Promise<Treaty.TreatyResponse<{
1135
- 200: {
1136
- success: true;
1137
- statusCode: number;
1138
- data: null;
1139
- message: string;
1140
- error: null;
1141
- meta: void 0;
1142
- } | {
1143
- success: false;
1144
- statusCode: number;
1145
- data: null;
1146
- message: string;
1147
- error: void 0;
1148
- meta: void 0;
1149
- };
1150
- 422: {
1151
- type: "validation";
1152
- on: string;
1153
- summary?: string;
1154
- message?: string;
1155
- found?: unknown;
1156
- property?: string;
1157
- expected?: string;
1158
- };
1159
- }>>;
419
+ message: null;
420
+ error: null;
421
+ meta: void 0;
1160
422
  };
1161
- };
1162
- media: ((params: {
1163
- uuid: string | number;
1164
- }) => {
1165
- get: (options?: {
1166
- headers?: {} | undefined;
1167
- query?: {} | undefined;
1168
- fetch?: RequestInit | undefined;
1169
- } | undefined) => Promise<Treaty.TreatyResponse<{
1170
- 200: {
1171
- success: false;
1172
- statusCode: number;
1173
- data: null;
1174
- message: string;
1175
- error: void 0;
1176
- meta: void 0;
1177
- } | {
1178
- success: true;
1179
- statusCode: number;
1180
- data: {
423
+ 422: {
424
+ type: "validation";
425
+ on: string;
426
+ summary?: string;
427
+ message?: string;
428
+ found?: unknown;
429
+ property?: string;
430
+ expected?: string;
431
+ };
432
+ }>>;
433
+ };
434
+ category: ((params: {
435
+ uuid: string | number;
436
+ }) => {
437
+ get: (options?: {
438
+ headers?: {} | undefined;
439
+ query?: {} | undefined;
440
+ fetch?: RequestInit | undefined;
441
+ } | undefined) => Promise<Treaty.TreatyResponse<{
442
+ 200: {
443
+ success: false;
444
+ statusCode: number;
445
+ data: null;
446
+ message: string;
447
+ error: void 0;
448
+ meta: void 0;
449
+ } | {
450
+ success: true;
451
+ statusCode: number;
452
+ data: {
453
+ name: string;
454
+ uuid: string;
455
+ slug: string;
456
+ description: string | null;
457
+ createdAt: Date;
458
+ updatedAt: Date;
459
+ sub: {
1181
460
  name: string;
1182
461
  uuid: string;
1183
- path: string;
462
+ slug: string;
1184
463
  description: string | null;
1185
- createdAt: Date | null;
1186
- updatedAt: Date | null;
1187
- size: number;
1188
- mimeType: string;
1189
- altText: string | null;
1190
- };
1191
- message: null;
1192
- error: null;
1193
- meta: void 0;
1194
- };
1195
- 422: {
1196
- type: "validation";
1197
- on: string;
1198
- summary?: string;
1199
- message?: string;
1200
- found?: unknown;
1201
- property?: string;
1202
- expected?: string;
1203
- };
1204
- }>>;
1205
- delete: (body?: {} | undefined, options?: {
1206
- headers?: {} | undefined;
1207
- query?: {} | undefined;
1208
- fetch?: RequestInit | undefined;
1209
- } | undefined) => Promise<Treaty.TreatyResponse<{
1210
- 200: {
1211
- success: true;
1212
- statusCode: number;
1213
- data: null;
1214
- message: string;
1215
- error: null;
1216
- meta: void 0;
1217
- } | {
1218
- success: false;
1219
- statusCode: number;
1220
- data: null;
1221
- message: string;
1222
- error: void 0;
1223
- meta: void 0;
1224
- };
1225
- 422: {
1226
- type: "validation";
1227
- on: string;
1228
- summary?: string;
1229
- message?: string;
1230
- found?: unknown;
1231
- property?: string;
1232
- expected?: string;
464
+ createdAt: Date;
465
+ updatedAt: Date;
466
+ }[];
1233
467
  };
1234
- }>>;
1235
- }) & {
1236
- get: (options?: {
468
+ message: null;
469
+ error: null;
470
+ meta: void 0;
471
+ };
472
+ 422: {
473
+ type: "validation";
474
+ on: string;
475
+ summary?: string;
476
+ message?: string;
477
+ found?: unknown;
478
+ property?: string;
479
+ expected?: string;
480
+ };
481
+ }>>;
482
+ post: (body: {
483
+ name: string;
484
+ description: string;
485
+ }, options?: {
486
+ headers?: {} | undefined;
487
+ query?: {} | undefined;
488
+ fetch?: RequestInit | undefined;
489
+ } | undefined) => Promise<Treaty.TreatyResponse<{
490
+ 200: {
491
+ success: false;
492
+ statusCode: number;
493
+ data: null;
494
+ message: string;
495
+ error: void 0;
496
+ meta: void 0;
497
+ } | {
498
+ success: true;
499
+ statusCode: number;
500
+ data: {
501
+ uuid: string;
502
+ };
503
+ message: null;
504
+ error: null;
505
+ meta: void 0;
506
+ };
507
+ 422: {
508
+ type: "validation";
509
+ on: string;
510
+ summary?: string;
511
+ message?: string;
512
+ found?: unknown;
513
+ property?: string;
514
+ expected?: string;
515
+ };
516
+ }>>;
517
+ bulk: {
518
+ post: (body: {
519
+ parentUuid: string;
520
+ categories: {
521
+ name: string;
522
+ description: string;
523
+ }[];
524
+ }, options?: {
1237
525
  headers?: {} | undefined;
1238
- query?: {
1239
- page?: number | undefined;
1240
- limit?: number | undefined;
1241
- search?: string | undefined;
1242
- } | undefined;
526
+ query?: {} | undefined;
1243
527
  fetch?: RequestInit | undefined;
1244
528
  } | undefined) => Promise<Treaty.TreatyResponse<{
1245
529
  200: {
@@ -1253,25 +537,14 @@ declare class ClientApi {
1253
537
  success: true;
1254
538
  statusCode: number;
1255
539
  data: {
1256
- data: {
1257
- name: string;
540
+ categories: {
1258
541
  uuid: string;
1259
- path: string;
542
+ name: string;
1260
543
  description: string | null;
1261
- createdAt: Date | null;
1262
- updatedAt: Date | null;
1263
- size: number;
1264
- mimeType: string;
1265
- altText: string | null;
544
+ slug: string;
545
+ createdAt: Date;
546
+ updatedAt: Date;
1266
547
  }[];
1267
- pagination: {
1268
- page: number;
1269
- limit: number;
1270
- total: number;
1271
- totalPages: number;
1272
- hasNextPage: boolean;
1273
- hasPreviousPage: boolean;
1274
- };
1275
548
  };
1276
549
  message: null;
1277
550
  error: null;
@@ -1287,12 +560,151 @@ declare class ClientApi {
1287
560
  expected?: string;
1288
561
  };
1289
562
  }>>;
563
+ };
564
+ patch: (body?: {
565
+ name?: string | undefined;
566
+ description?: string | undefined;
567
+ parentUuid?: string | undefined;
568
+ } | undefined, options?: {
569
+ headers?: {} | undefined;
570
+ query?: {} | undefined;
571
+ fetch?: RequestInit | undefined;
572
+ } | undefined) => Promise<Treaty.TreatyResponse<{
573
+ 200: {
574
+ success: false;
575
+ statusCode: number;
576
+ data: null;
577
+ message: string;
578
+ error: void 0;
579
+ meta: void 0;
580
+ } | {
581
+ success: true;
582
+ statusCode: number;
583
+ data: {
584
+ uuid: string;
585
+ };
586
+ message: null;
587
+ error: null;
588
+ meta: void 0;
589
+ };
590
+ 422: {
591
+ type: "validation";
592
+ on: string;
593
+ summary?: string;
594
+ message?: string;
595
+ found?: unknown;
596
+ property?: string;
597
+ expected?: string;
598
+ };
599
+ }>>;
600
+ delete: (body?: {} | undefined, options?: {
601
+ headers?: {} | undefined;
602
+ query?: {} | undefined;
603
+ fetch?: RequestInit | undefined;
604
+ } | undefined) => Promise<Treaty.TreatyResponse<{
605
+ 200: {
606
+ success: true;
607
+ statusCode: number;
608
+ data: null;
609
+ message: string;
610
+ error: null;
611
+ meta: void 0;
612
+ } | {
613
+ success: false;
614
+ statusCode: number;
615
+ data: null;
616
+ message: string;
617
+ error: void 0;
618
+ meta: void 0;
619
+ };
620
+ 422: {
621
+ type: "validation";
622
+ on: string;
623
+ summary?: string;
624
+ message?: string;
625
+ found?: unknown;
626
+ property?: string;
627
+ expected?: string;
628
+ };
629
+ }>>;
630
+ }) & {
631
+ get: (options?: {
632
+ headers?: {} | undefined;
633
+ query?: {} | undefined;
634
+ fetch?: RequestInit | undefined;
635
+ } | undefined) => Promise<Treaty.TreatyResponse<{
636
+ 200: {
637
+ success: false;
638
+ statusCode: number;
639
+ data: null;
640
+ message: string;
641
+ error: void 0;
642
+ meta: void 0;
643
+ } | {
644
+ success: true;
645
+ statusCode: number;
646
+ data: {
647
+ name: string;
648
+ uuid: string;
649
+ slug: string;
650
+ description: string | null;
651
+ createdAt: Date;
652
+ updatedAt: Date;
653
+ sub: {
654
+ name: string;
655
+ uuid: string;
656
+ slug: string;
657
+ description: string | null;
658
+ createdAt: Date;
659
+ updatedAt: Date;
660
+ }[];
661
+ }[];
662
+ message: null;
663
+ error: null;
664
+ meta: void 0;
665
+ };
666
+ }>>;
667
+ post: (body: {
668
+ name: string;
669
+ description: string;
670
+ }, options?: {
671
+ headers?: {} | undefined;
672
+ query?: {} | undefined;
673
+ fetch?: RequestInit | undefined;
674
+ } | undefined) => Promise<Treaty.TreatyResponse<{
675
+ 200: {
676
+ success: false;
677
+ statusCode: number;
678
+ data: null;
679
+ message: string;
680
+ error: void 0;
681
+ meta: void 0;
682
+ } | {
683
+ success: true;
684
+ statusCode: number;
685
+ data: {
686
+ uuid: string;
687
+ };
688
+ message: null;
689
+ error: null;
690
+ meta: void 0;
691
+ };
692
+ 422: {
693
+ type: "validation";
694
+ on: string;
695
+ summary?: string;
696
+ message?: string;
697
+ found?: unknown;
698
+ property?: string;
699
+ expected?: string;
700
+ };
701
+ }>>;
702
+ bulk: {
1290
703
  post: (body: {
1291
- name: string;
1292
- size: number;
1293
- mimeType: void 0;
1294
- altText: string;
1295
- description: string;
704
+ categories: {
705
+ name: string;
706
+ description: string;
707
+ }[];
1296
708
  }, options?: {
1297
709
  headers?: {} | undefined;
1298
710
  query?: {} | undefined;
@@ -1309,21 +721,13 @@ declare class ClientApi {
1309
721
  success: true;
1310
722
  statusCode: number;
1311
723
  data: {
1312
- files: {
1313
- name: string;
724
+ categories: {
1314
725
  uuid: string;
1315
- path: string;
726
+ name: string;
1316
727
  description: string | null;
1317
- createdAt: Date | null;
1318
- updatedAt: Date | null;
1319
- size: number;
1320
- mimeType: string;
1321
- altText: string | null;
1322
- }[];
1323
- preSignedUrls: {
1324
- uuid: string;
1325
- order: number;
1326
- preSignedUrl: string;
728
+ slug: string;
729
+ createdAt: Date;
730
+ updatedAt: Date;
1327
731
  }[];
1328
732
  };
1329
733
  message: null;
@@ -1340,190 +744,26 @@ declare class ClientApi {
1340
744
  expected?: string;
1341
745
  };
1342
746
  }>>;
1343
- bulk: {
1344
- post: (body: {
1345
- files: {
1346
- uuid: string;
1347
- name: string;
1348
- mimeType: void 0;
1349
- size: number;
1350
- }[];
1351
- }, options?: {
1352
- headers?: {} | undefined;
1353
- query?: {} | undefined;
1354
- fetch?: RequestInit | undefined;
1355
- } | undefined) => Promise<Treaty.TreatyResponse<{
1356
- 200: {
1357
- success: false;
1358
- statusCode: number;
1359
- data: null;
1360
- message: string;
1361
- error: void 0;
1362
- meta: void 0;
1363
- } | {
1364
- success: true;
1365
- statusCode: number;
1366
- data: {
1367
- files: {
1368
- name: string;
1369
- uuid: string;
1370
- path: string;
1371
- description: string | null;
1372
- createdAt: Date | null;
1373
- updatedAt: Date | null;
1374
- size: number;
1375
- mimeType: string;
1376
- altText: string | null;
1377
- }[];
1378
- preSignedUrls: {
1379
- uuid: string;
1380
- order: number;
1381
- preSignedUrl: string;
1382
- }[];
1383
- };
1384
- message: null;
1385
- error: null;
1386
- meta: void 0;
1387
- };
1388
- 422: {
1389
- type: "validation";
1390
- on: string;
1391
- summary?: string;
1392
- message?: string;
1393
- found?: unknown;
1394
- property?: string;
1395
- expected?: string;
1396
- };
1397
- }>>;
1398
- delete: (body?: unknown, options?: {
1399
- headers?: Record<string, unknown> | undefined;
1400
- query?: Record<string, unknown> | undefined;
1401
- fetch?: RequestInit | undefined;
1402
- } | undefined) => Promise<Treaty.TreatyResponse<{}>>;
1403
- };
1404
- attach: {
1405
- post: (body: {
1406
- entityType: void 0;
1407
- mediaUuid: string;
1408
- entityId?: number | undefined;
1409
- entityUuid?: string | undefined;
1410
- }, options?: {
1411
- headers?: {} | undefined;
1412
- query?: {} | undefined;
1413
- fetch?: RequestInit | undefined;
1414
- } | undefined) => Promise<Treaty.TreatyResponse<{
1415
- 200: {
1416
- success: false;
1417
- statusCode: number;
1418
- data: null;
1419
- message: string;
1420
- error: void 0;
1421
- meta: void 0;
1422
- } | {
1423
- success: true;
1424
- statusCode: number;
1425
- data: {
1426
- mediaUuid: string;
1427
- entityUuid: string | null;
1428
- entityId: string | null;
1429
- };
1430
- message: null;
1431
- error: null;
1432
- meta: void 0;
1433
- };
1434
- 422: {
1435
- type: "validation";
1436
- on: string;
1437
- summary?: string;
1438
- message?: string;
1439
- found?: unknown;
1440
- property?: string;
1441
- expected?: string;
1442
- };
1443
- }>>;
1444
- };
1445
- detach: {
1446
- post: (body: {
1447
- entityType: void 0;
1448
- mediaUuid: string;
1449
- entityId?: number | undefined;
1450
- entityUuid?: string | undefined;
1451
- }, options?: {
1452
- headers?: {} | undefined;
1453
- query?: {} | undefined;
1454
- fetch?: RequestInit | undefined;
1455
- } | undefined) => Promise<Treaty.TreatyResponse<{
1456
- 200: {
1457
- success: false;
1458
- statusCode: number;
1459
- data: null;
1460
- message: string;
1461
- error: void 0;
1462
- meta: void 0;
1463
- } | {
1464
- success: true;
1465
- statusCode: number;
1466
- data: {
1467
- mediaUuid: string;
1468
- entityUuid: string;
1469
- entityId: null;
1470
- };
1471
- message: null;
1472
- error: null;
1473
- meta: void 0;
1474
- } | {
1475
- success: true;
1476
- statusCode: number;
1477
- data: {
1478
- mediaUuid: string;
1479
- entityUuid: null;
1480
- entityId: null;
1481
- };
1482
- message: null;
1483
- error: null;
1484
- meta: void 0;
1485
- };
1486
- 422: {
1487
- type: "validation";
1488
- on: string;
1489
- summary?: string;
1490
- message?: string;
1491
- found?: unknown;
1492
- property?: string;
1493
- expected?: string;
1494
- };
1495
- }>>;
1496
- };
1497
- };
1498
- series: ((params: {
1499
- uuid: string | number;
1500
- }) => {
1501
- get: (options?: {
747
+ delete: (body: {}, options: {
1502
748
  headers?: {} | undefined;
1503
- query?: {} | undefined;
749
+ query: {
750
+ uuids: string[];
751
+ };
1504
752
  fetch?: RequestInit | undefined;
1505
- } | undefined) => Promise<Treaty.TreatyResponse<{
753
+ }) => Promise<Treaty.TreatyResponse<{
1506
754
  200: {
1507
- success: false;
755
+ success: true;
1508
756
  statusCode: number;
1509
757
  data: null;
1510
758
  message: string;
1511
- error: void 0;
759
+ error: null;
1512
760
  meta: void 0;
1513
761
  } | {
1514
- success: true;
762
+ success: false;
1515
763
  statusCode: number;
1516
- data: {
1517
- name: string;
1518
- uuid: string;
1519
- slug: string;
1520
- description: string | null;
1521
- createdAt: Date | null;
1522
- updatedAt: Date | null;
1523
- productTotal: number;
1524
- };
1525
- message: null;
1526
- error: null;
764
+ data: null;
765
+ message: string;
766
+ error: void 0;
1527
767
  meta: void 0;
1528
768
  };
1529
769
  422: {
@@ -1536,28 +776,240 @@ declare class ClientApi {
1536
776
  expected?: string;
1537
777
  };
1538
778
  }>>;
1539
- patch: (body?: {
1540
- name?: string | undefined;
1541
- description?: string | undefined;
1542
- } | undefined, options?: {
779
+ };
780
+ };
781
+ currency: ((params: {
782
+ id: string | number;
783
+ }) => {
784
+ get: (options: {
785
+ headers?: {} | undefined;
786
+ query: {
787
+ id: number;
788
+ };
789
+ fetch?: RequestInit | undefined;
790
+ }) => Promise<Treaty.TreatyResponse<{
791
+ 200: {
792
+ success: false;
793
+ statusCode: number;
794
+ data: null;
795
+ message: string;
796
+ error: void 0;
797
+ meta: void 0;
798
+ } | {
799
+ success: true;
800
+ statusCode: number;
801
+ data: {
802
+ name: string;
803
+ createdAt: Date | null;
804
+ updatedAt: Date | null;
805
+ id: number;
806
+ code: string;
807
+ exchangeRate: number;
808
+ };
809
+ message: null;
810
+ error: null;
811
+ meta: void 0;
812
+ };
813
+ 422: {
814
+ type: "validation";
815
+ on: string;
816
+ summary?: string;
817
+ message?: string;
818
+ found?: unknown;
819
+ property?: string;
820
+ expected?: string;
821
+ };
822
+ }>>;
823
+ patch: (body?: {
824
+ code?: "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BTN" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHF" | "CLP" | "CNY" | "COP" | "CRC" | "CUC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GGP" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "IMP" | "INR" | "IQD" | "IRR" | "ISK" | "JEP" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLE" | "SLL" | "SOS" | "SRD" | "STN" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TVD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VED" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XDR" | "XOF" | "XPF" | "YER" | "ZAR" | "ZMW" | "ZWL" | undefined;
825
+ name?: string | undefined;
826
+ exchangeRate?: number | undefined;
827
+ } | undefined, options?: {
828
+ headers?: {} | undefined;
829
+ query?: {} | undefined;
830
+ fetch?: RequestInit | undefined;
831
+ } | undefined) => Promise<Treaty.TreatyResponse<{
832
+ 200: {
833
+ success: true;
834
+ statusCode: number;
835
+ data: null;
836
+ message: string;
837
+ error: null;
838
+ meta: void 0;
839
+ } | {
840
+ success: false;
841
+ statusCode: number;
842
+ data: null;
843
+ message: string;
844
+ error: void 0;
845
+ meta: void 0;
846
+ };
847
+ 422: {
848
+ type: "validation";
849
+ on: string;
850
+ summary?: string;
851
+ message?: string;
852
+ found?: unknown;
853
+ property?: string;
854
+ expected?: string;
855
+ };
856
+ }>>;
857
+ delete: (body?: {} | undefined, options?: {
858
+ headers?: {} | undefined;
859
+ query?: {} | undefined;
860
+ fetch?: RequestInit | undefined;
861
+ } | undefined) => Promise<Treaty.TreatyResponse<{
862
+ 200: {
863
+ success: true;
864
+ statusCode: number;
865
+ data: null;
866
+ message: string;
867
+ error: null;
868
+ meta: void 0;
869
+ } | {
870
+ success: false;
871
+ statusCode: number;
872
+ data: null;
873
+ message: string;
874
+ error: void 0;
875
+ meta: void 0;
876
+ };
877
+ 422: {
878
+ type: "validation";
879
+ on: string;
880
+ summary?: string;
881
+ message?: string;
882
+ found?: unknown;
883
+ property?: string;
884
+ expected?: string;
885
+ };
886
+ }>>;
887
+ }) & {
888
+ get: (options?: {
889
+ headers?: {} | undefined;
890
+ query?: {} | undefined;
891
+ fetch?: RequestInit | undefined;
892
+ } | undefined) => Promise<Treaty.TreatyResponse<{
893
+ 200: {
894
+ success: false;
895
+ statusCode: number;
896
+ data: null;
897
+ message: string;
898
+ error: void 0;
899
+ meta: void 0;
900
+ } | {
901
+ success: true;
902
+ statusCode: number;
903
+ data: {
904
+ name: string;
905
+ createdAt: Date | null;
906
+ updatedAt: Date | null;
907
+ id: number;
908
+ code: string;
909
+ exchangeRate: number;
910
+ }[];
911
+ message: null;
912
+ error: null;
913
+ meta: void 0;
914
+ };
915
+ }>>;
916
+ count: {
917
+ get: (options?: {
1543
918
  headers?: {} | undefined;
1544
919
  query?: {} | undefined;
1545
920
  fetch?: RequestInit | undefined;
1546
921
  } | undefined) => Promise<Treaty.TreatyResponse<{
1547
922
  200: {
1548
- success: true;
923
+ success: false;
1549
924
  statusCode: number;
1550
925
  data: null;
1551
926
  message: string;
1552
- error: null;
927
+ error: void 0;
1553
928
  meta: void 0;
1554
929
  } | {
930
+ success: true;
931
+ statusCode: number;
932
+ data: number;
933
+ message: null;
934
+ error: null;
935
+ meta: void 0;
936
+ };
937
+ }>>;
938
+ };
939
+ post: (body: {
940
+ code: "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BTN" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHF" | "CLP" | "CNY" | "COP" | "CRC" | "CUC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GGP" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "IMP" | "INR" | "IQD" | "IRR" | "ISK" | "JEP" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLE" | "SLL" | "SOS" | "SRD" | "STN" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TVD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VED" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XDR" | "XOF" | "XPF" | "YER" | "ZAR" | "ZMW" | "ZWL";
941
+ name: string;
942
+ exchangeRate: number;
943
+ }, options?: {
944
+ headers?: {} | undefined;
945
+ query?: {} | undefined;
946
+ fetch?: RequestInit | undefined;
947
+ } | undefined) => Promise<Treaty.TreatyResponse<{
948
+ 200: {
949
+ success: false;
950
+ statusCode: number;
951
+ data: null;
952
+ message: string;
953
+ error: void 0;
954
+ meta: void 0;
955
+ } | {
956
+ success: true;
957
+ statusCode: number;
958
+ data: {
959
+ id: number;
960
+ name: string;
961
+ code: string;
962
+ exchangeRate: number;
963
+ createdAt: Date | null;
964
+ updatedAt: Date | null;
965
+ }[];
966
+ message: null;
967
+ error: null;
968
+ meta: void 0;
969
+ };
970
+ 422: {
971
+ type: "validation";
972
+ on: string;
973
+ summary?: string;
974
+ message?: string;
975
+ found?: unknown;
976
+ property?: string;
977
+ expected?: string;
978
+ };
979
+ }>>;
980
+ bulk: {
981
+ post: (body: {
982
+ currencies: {
983
+ code: "AED" | "AFN" | "ALL" | "AMD" | "ANG" | "AOA" | "ARS" | "AUD" | "AWG" | "AZN" | "BAM" | "BBD" | "BDT" | "BGN" | "BHD" | "BIF" | "BMD" | "BND" | "BOB" | "BRL" | "BSD" | "BTN" | "BWP" | "BYN" | "BZD" | "CAD" | "CDF" | "CHF" | "CLP" | "CNY" | "COP" | "CRC" | "CUC" | "CUP" | "CVE" | "CZK" | "DJF" | "DKK" | "DOP" | "DZD" | "EGP" | "ERN" | "ETB" | "EUR" | "FJD" | "FKP" | "GBP" | "GEL" | "GGP" | "GHS" | "GIP" | "GMD" | "GNF" | "GTQ" | "GYD" | "HKD" | "HNL" | "HRK" | "HTG" | "HUF" | "IDR" | "ILS" | "IMP" | "INR" | "IQD" | "IRR" | "ISK" | "JEP" | "JMD" | "JOD" | "JPY" | "KES" | "KGS" | "KHR" | "KMF" | "KPW" | "KRW" | "KWD" | "KYD" | "KZT" | "LAK" | "LBP" | "LKR" | "LRD" | "LSL" | "LYD" | "MAD" | "MDL" | "MGA" | "MKD" | "MMK" | "MNT" | "MOP" | "MRU" | "MUR" | "MVR" | "MWK" | "MXN" | "MYR" | "MZN" | "NAD" | "NGN" | "NIO" | "NOK" | "NPR" | "NZD" | "OMR" | "PAB" | "PEN" | "PGK" | "PHP" | "PKR" | "PLN" | "PYG" | "QAR" | "RON" | "RSD" | "RUB" | "RWF" | "SAR" | "SBD" | "SCR" | "SDG" | "SEK" | "SGD" | "SHP" | "SLE" | "SLL" | "SOS" | "SRD" | "STN" | "SYP" | "SZL" | "THB" | "TJS" | "TMT" | "TND" | "TOP" | "TRY" | "TTD" | "TVD" | "TWD" | "TZS" | "UAH" | "UGX" | "USD" | "UYU" | "UZS" | "VED" | "VES" | "VND" | "VUV" | "WST" | "XAF" | "XCD" | "XDR" | "XOF" | "XPF" | "YER" | "ZAR" | "ZMW" | "ZWL";
984
+ name: string;
985
+ exchangeRate: number;
986
+ }[];
987
+ }, options?: {
988
+ headers?: {} | undefined;
989
+ query?: {} | undefined;
990
+ fetch?: RequestInit | undefined;
991
+ } | undefined) => Promise<Treaty.TreatyResponse<{
992
+ 200: {
1555
993
  success: false;
1556
994
  statusCode: number;
1557
995
  data: null;
1558
996
  message: string;
1559
997
  error: void 0;
1560
998
  meta: void 0;
999
+ } | {
1000
+ success: true;
1001
+ statusCode: number;
1002
+ data: {
1003
+ id: number;
1004
+ name: string;
1005
+ code: string;
1006
+ exchangeRate: number;
1007
+ createdAt: Date | null;
1008
+ updatedAt: Date | null;
1009
+ }[];
1010
+ message: null;
1011
+ error: null;
1012
+ meta: void 0;
1561
1013
  };
1562
1014
  422: {
1563
1015
  type: "validation";
@@ -1569,11 +1021,13 @@ declare class ClientApi {
1569
1021
  expected?: string;
1570
1022
  };
1571
1023
  }>>;
1572
- delete: (body?: {} | undefined, options?: {
1024
+ delete: (body: {}, options: {
1573
1025
  headers?: {} | undefined;
1574
- query?: {} | undefined;
1026
+ query: {
1027
+ ids: number[];
1028
+ };
1575
1029
  fetch?: RequestInit | undefined;
1576
- } | undefined) => Promise<Treaty.TreatyResponse<{
1030
+ }) => Promise<Treaty.TreatyResponse<{
1577
1031
  200: {
1578
1032
  success: true;
1579
1033
  statusCode: number;
@@ -1599,73 +1053,197 @@ declare class ClientApi {
1599
1053
  expected?: string;
1600
1054
  };
1601
1055
  }>>;
1602
- }) & {
1603
- get: (options?: {
1604
- headers?: {} | undefined;
1605
- query?: {} | undefined;
1606
- fetch?: RequestInit | undefined;
1607
- } | undefined) => Promise<Treaty.TreatyResponse<{
1608
- 200: {
1609
- success: false;
1610
- statusCode: number;
1611
- data: null;
1612
- message: string;
1613
- error: void 0;
1614
- meta: void 0;
1615
- } | {
1616
- success: true;
1617
- statusCode: number;
1056
+ };
1057
+ };
1058
+ media: ((params: {
1059
+ uuid: string | number;
1060
+ }) => {
1061
+ get: (options?: {
1062
+ headers?: {} | undefined;
1063
+ query?: {} | undefined;
1064
+ fetch?: RequestInit | undefined;
1065
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1066
+ 200: {
1067
+ success: false;
1068
+ statusCode: number;
1069
+ data: null;
1070
+ message: string;
1071
+ error: void 0;
1072
+ meta: void 0;
1073
+ } | {
1074
+ success: true;
1075
+ statusCode: number;
1076
+ data: {
1077
+ name: string;
1078
+ uuid: string;
1079
+ path: string;
1080
+ description: string | null;
1081
+ createdAt: Date | null;
1082
+ updatedAt: Date | null;
1083
+ size: number;
1084
+ mimeType: string;
1085
+ altText: string | null;
1086
+ };
1087
+ message: null;
1088
+ error: null;
1089
+ meta: void 0;
1090
+ };
1091
+ 422: {
1092
+ type: "validation";
1093
+ on: string;
1094
+ summary?: string;
1095
+ message?: string;
1096
+ found?: unknown;
1097
+ property?: string;
1098
+ expected?: string;
1099
+ };
1100
+ }>>;
1101
+ delete: (body?: {} | undefined, options?: {
1102
+ headers?: {} | undefined;
1103
+ query?: {} | undefined;
1104
+ fetch?: RequestInit | undefined;
1105
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1106
+ 200: {
1107
+ success: true;
1108
+ statusCode: number;
1109
+ data: null;
1110
+ message: string;
1111
+ error: null;
1112
+ meta: void 0;
1113
+ } | {
1114
+ success: false;
1115
+ statusCode: number;
1116
+ data: null;
1117
+ message: string;
1118
+ error: void 0;
1119
+ meta: void 0;
1120
+ };
1121
+ 422: {
1122
+ type: "validation";
1123
+ on: string;
1124
+ summary?: string;
1125
+ message?: string;
1126
+ found?: unknown;
1127
+ property?: string;
1128
+ expected?: string;
1129
+ };
1130
+ }>>;
1131
+ }) & {
1132
+ get: (options?: {
1133
+ headers?: {} | undefined;
1134
+ query?: {
1135
+ page?: number | undefined;
1136
+ limit?: number | undefined;
1137
+ search?: string | undefined;
1138
+ } | undefined;
1139
+ fetch?: RequestInit | undefined;
1140
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1141
+ 200: {
1142
+ success: false;
1143
+ statusCode: number;
1144
+ data: null;
1145
+ message: string;
1146
+ error: void 0;
1147
+ meta: void 0;
1148
+ } | {
1149
+ success: true;
1150
+ statusCode: number;
1151
+ data: {
1618
1152
  data: {
1619
1153
  name: string;
1620
1154
  uuid: string;
1621
- slug: string;
1155
+ path: string;
1622
1156
  description: string | null;
1623
1157
  createdAt: Date | null;
1624
1158
  updatedAt: Date | null;
1625
- productTotal: number;
1626
- media: {
1627
- createdAt: Date | null;
1628
- updatedAt: Date | null;
1629
- media: {
1630
- name: string;
1631
- uuid: string;
1632
- path: string;
1633
- createdAt: Date | null;
1634
- updatedAt: Date | null;
1635
- };
1636
- };
1159
+ size: number;
1160
+ mimeType: string;
1161
+ altText: string | null;
1637
1162
  }[];
1638
- message: null;
1639
- error: null;
1640
- meta: void 0;
1641
- };
1642
- }>>;
1643
- count: {
1644
- get: (options?: {
1645
- headers?: {} | undefined;
1646
- query?: {} | undefined;
1647
- fetch?: RequestInit | undefined;
1648
- } | undefined) => Promise<Treaty.TreatyResponse<{
1649
- 200: {
1650
- success: false;
1651
- statusCode: number;
1652
- data: null;
1653
- message: string;
1654
- error: void 0;
1655
- meta: void 0;
1656
- } | {
1657
- success: true;
1658
- statusCode: number;
1659
- data: number;
1660
- message: null;
1661
- error: null;
1662
- meta: void 0;
1163
+ pagination: {
1164
+ page: number;
1165
+ limit: number;
1166
+ total: number;
1167
+ totalPages: number;
1168
+ hasNextPage: boolean;
1169
+ hasPreviousPage: boolean;
1663
1170
  };
1664
- }>>;
1171
+ };
1172
+ message: null;
1173
+ error: null;
1174
+ meta: void 0;
1175
+ };
1176
+ 422: {
1177
+ type: "validation";
1178
+ on: string;
1179
+ summary?: string;
1180
+ message?: string;
1181
+ found?: unknown;
1182
+ property?: string;
1183
+ expected?: string;
1184
+ };
1185
+ }>>;
1186
+ post: (body: {
1187
+ name: string;
1188
+ size: number;
1189
+ mimeType: void 0;
1190
+ altText: string;
1191
+ description: string;
1192
+ }, options?: {
1193
+ headers?: {} | undefined;
1194
+ query?: {} | undefined;
1195
+ fetch?: RequestInit | undefined;
1196
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1197
+ 200: {
1198
+ success: false;
1199
+ statusCode: number;
1200
+ data: null;
1201
+ message: string;
1202
+ error: void 0;
1203
+ meta: void 0;
1204
+ } | {
1205
+ success: true;
1206
+ statusCode: number;
1207
+ data: {
1208
+ files: {
1209
+ name: string;
1210
+ uuid: string;
1211
+ path: string;
1212
+ description: string | null;
1213
+ createdAt: Date | null;
1214
+ updatedAt: Date | null;
1215
+ size: number;
1216
+ mimeType: string;
1217
+ altText: string | null;
1218
+ }[];
1219
+ preSignedUrls: {
1220
+ uuid: string;
1221
+ order: number;
1222
+ preSignedUrl: string;
1223
+ }[];
1224
+ };
1225
+ message: null;
1226
+ error: null;
1227
+ meta: void 0;
1665
1228
  };
1229
+ 422: {
1230
+ type: "validation";
1231
+ on: string;
1232
+ summary?: string;
1233
+ message?: string;
1234
+ found?: unknown;
1235
+ property?: string;
1236
+ expected?: string;
1237
+ };
1238
+ }>>;
1239
+ bulk: {
1666
1240
  post: (body: {
1667
- name: string;
1668
- description: string;
1241
+ files: {
1242
+ uuid: string;
1243
+ name: string;
1244
+ mimeType: void 0;
1245
+ size: number;
1246
+ }[];
1669
1247
  }, options?: {
1670
1248
  headers?: {} | undefined;
1671
1249
  query?: {} | undefined;
@@ -1682,14 +1260,22 @@ declare class ClientApi {
1682
1260
  success: true;
1683
1261
  statusCode: number;
1684
1262
  data: {
1685
- media: null;
1686
- uuid: string;
1687
- name: string;
1688
- slug: string;
1689
- description: string | null;
1690
- productTotal: number;
1691
- createdAt: Date | null;
1692
- updatedAt: Date | null;
1263
+ files: {
1264
+ name: string;
1265
+ uuid: string;
1266
+ path: string;
1267
+ description: string | null;
1268
+ createdAt: Date | null;
1269
+ updatedAt: Date | null;
1270
+ size: number;
1271
+ mimeType: string;
1272
+ altText: string | null;
1273
+ }[];
1274
+ preSignedUrls: {
1275
+ uuid: string;
1276
+ order: number;
1277
+ preSignedUrl: string;
1278
+ }[];
1693
1279
  };
1694
1280
  message: null;
1695
1281
  error: null;
@@ -1705,89 +1291,19 @@ declare class ClientApi {
1705
1291
  expected?: string;
1706
1292
  };
1707
1293
  }>>;
1708
- bulk: {
1709
- post: (body: {
1710
- series: {
1711
- name: string;
1712
- description: string;
1713
- }[];
1714
- }, options?: {
1715
- headers?: {} | undefined;
1716
- query?: {} | undefined;
1717
- fetch?: RequestInit | undefined;
1718
- } | undefined) => Promise<Treaty.TreatyResponse<{
1719
- 200: {
1720
- success: false;
1721
- statusCode: number;
1722
- data: null;
1723
- message: string;
1724
- error: void 0;
1725
- meta: void 0;
1726
- } | {
1727
- success: true;
1728
- statusCode: number;
1729
- data: {
1730
- media: null;
1731
- uuid: string;
1732
- name: string;
1733
- slug: string;
1734
- description: string | null;
1735
- productTotal: number;
1736
- createdAt: Date | null;
1737
- updatedAt: Date | null;
1738
- }[];
1739
- message: null;
1740
- error: null;
1741
- meta: void 0;
1742
- };
1743
- 422: {
1744
- type: "validation";
1745
- on: string;
1746
- summary?: string;
1747
- message?: string;
1748
- found?: unknown;
1749
- property?: string;
1750
- expected?: string;
1751
- };
1752
- }>>;
1753
- delete: (body: {}, options: {
1754
- headers?: {} | undefined;
1755
- query: {
1756
- uuids: string[];
1757
- };
1758
- fetch?: RequestInit | undefined;
1759
- }) => Promise<Treaty.TreatyResponse<{
1760
- 200: {
1761
- success: true;
1762
- statusCode: number;
1763
- data: null;
1764
- message: string;
1765
- error: null;
1766
- meta: void 0;
1767
- } | {
1768
- success: false;
1769
- statusCode: number;
1770
- data: null;
1771
- message: string;
1772
- error: void 0;
1773
- meta: void 0;
1774
- };
1775
- 422: {
1776
- type: "validation";
1777
- on: string;
1778
- summary?: string;
1779
- message?: string;
1780
- found?: unknown;
1781
- property?: string;
1782
- expected?: string;
1783
- };
1784
- }>>;
1785
- };
1294
+ delete: (body?: unknown, options?: {
1295
+ headers?: Record<string, unknown> | undefined;
1296
+ query?: Record<string, unknown> | undefined;
1297
+ fetch?: RequestInit | undefined;
1298
+ } | undefined) => Promise<Treaty.TreatyResponse<{}>>;
1786
1299
  };
1787
- session: ((params: {
1788
- sessionId: string | number;
1789
- }) => {
1790
- delete: (body?: {} | undefined, options?: {
1300
+ attach: {
1301
+ post: (body: {
1302
+ entityType: void 0;
1303
+ mediaUuid: string;
1304
+ entityId?: number | undefined;
1305
+ entityUuid?: string | undefined;
1306
+ }, options?: {
1791
1307
  headers?: {} | undefined;
1792
1308
  query?: {} | undefined;
1793
1309
  fetch?: RequestInit | undefined;
@@ -1803,7 +1319,9 @@ declare class ClientApi {
1803
1319
  success: true;
1804
1320
  statusCode: number;
1805
1321
  data: {
1806
- sessionId: number;
1322
+ mediaUuid: string;
1323
+ entityUuid: string | null;
1324
+ entityId: string | null;
1807
1325
  };
1808
1326
  message: null;
1809
1327
  error: null;
@@ -1819,13 +1337,16 @@ declare class ClientApi {
1819
1337
  expected?: string;
1820
1338
  };
1821
1339
  }>>;
1822
- }) & {
1823
- get: (options?: {
1340
+ };
1341
+ detach: {
1342
+ post: (body: {
1343
+ entityType: void 0;
1344
+ mediaUuid: string;
1345
+ entityId?: number | undefined;
1346
+ entityUuid?: string | undefined;
1347
+ }, options?: {
1824
1348
  headers?: {} | undefined;
1825
- query?: {
1826
- page?: number | undefined;
1827
- limit?: number | undefined;
1828
- } | undefined;
1349
+ query?: {} | undefined;
1829
1350
  fetch?: RequestInit | undefined;
1830
1351
  } | undefined) => Promise<Treaty.TreatyResponse<{
1831
1352
  200: {
@@ -1839,18 +1360,21 @@ declare class ClientApi {
1839
1360
  success: true;
1840
1361
  statusCode: number;
1841
1362
  data: {
1842
- createdAt: Date | null;
1843
- updatedAt: Date | null;
1844
- id: number;
1845
- expiresAt: Date;
1846
- ipAddress: string;
1847
- userAgent: string;
1848
- user: {
1849
- uuid: string | null;
1850
- email: string;
1851
- username: string;
1852
- };
1853
- }[];
1363
+ mediaUuid: string;
1364
+ entityUuid: string;
1365
+ entityId: null;
1366
+ };
1367
+ message: null;
1368
+ error: null;
1369
+ meta: void 0;
1370
+ } | {
1371
+ success: true;
1372
+ statusCode: number;
1373
+ data: {
1374
+ mediaUuid: string;
1375
+ entityUuid: null;
1376
+ entityId: null;
1377
+ };
1854
1378
  message: null;
1855
1379
  error: null;
1856
1380
  meta: void 0;
@@ -1866,9 +1390,153 @@ declare class ClientApi {
1866
1390
  };
1867
1391
  }>>;
1868
1392
  };
1869
- supplier: ((params: {
1870
- uuid: string | number;
1871
- }) => {
1393
+ };
1394
+ series: ((params: {
1395
+ uuid: string | number;
1396
+ }) => {
1397
+ get: (options?: {
1398
+ headers?: {} | undefined;
1399
+ query?: {} | undefined;
1400
+ fetch?: RequestInit | undefined;
1401
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1402
+ 200: {
1403
+ success: false;
1404
+ statusCode: number;
1405
+ data: null;
1406
+ message: string;
1407
+ error: void 0;
1408
+ meta: void 0;
1409
+ } | {
1410
+ success: true;
1411
+ statusCode: number;
1412
+ data: {
1413
+ name: string;
1414
+ uuid: string;
1415
+ slug: string;
1416
+ description: string | null;
1417
+ createdAt: Date | null;
1418
+ updatedAt: Date | null;
1419
+ productTotal: number;
1420
+ };
1421
+ message: null;
1422
+ error: null;
1423
+ meta: void 0;
1424
+ };
1425
+ 422: {
1426
+ type: "validation";
1427
+ on: string;
1428
+ summary?: string;
1429
+ message?: string;
1430
+ found?: unknown;
1431
+ property?: string;
1432
+ expected?: string;
1433
+ };
1434
+ }>>;
1435
+ patch: (body?: {
1436
+ name?: string | undefined;
1437
+ description?: string | undefined;
1438
+ } | undefined, options?: {
1439
+ headers?: {} | undefined;
1440
+ query?: {} | undefined;
1441
+ fetch?: RequestInit | undefined;
1442
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1443
+ 200: {
1444
+ success: true;
1445
+ statusCode: number;
1446
+ data: null;
1447
+ message: string;
1448
+ error: null;
1449
+ meta: void 0;
1450
+ } | {
1451
+ success: false;
1452
+ statusCode: number;
1453
+ data: null;
1454
+ message: string;
1455
+ error: void 0;
1456
+ meta: void 0;
1457
+ };
1458
+ 422: {
1459
+ type: "validation";
1460
+ on: string;
1461
+ summary?: string;
1462
+ message?: string;
1463
+ found?: unknown;
1464
+ property?: string;
1465
+ expected?: string;
1466
+ };
1467
+ }>>;
1468
+ delete: (body?: {} | undefined, options?: {
1469
+ headers?: {} | undefined;
1470
+ query?: {} | undefined;
1471
+ fetch?: RequestInit | undefined;
1472
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1473
+ 200: {
1474
+ success: true;
1475
+ statusCode: number;
1476
+ data: null;
1477
+ message: string;
1478
+ error: null;
1479
+ meta: void 0;
1480
+ } | {
1481
+ success: false;
1482
+ statusCode: number;
1483
+ data: null;
1484
+ message: string;
1485
+ error: void 0;
1486
+ meta: void 0;
1487
+ };
1488
+ 422: {
1489
+ type: "validation";
1490
+ on: string;
1491
+ summary?: string;
1492
+ message?: string;
1493
+ found?: unknown;
1494
+ property?: string;
1495
+ expected?: string;
1496
+ };
1497
+ }>>;
1498
+ }) & {
1499
+ get: (options?: {
1500
+ headers?: {} | undefined;
1501
+ query?: {} | undefined;
1502
+ fetch?: RequestInit | undefined;
1503
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1504
+ 200: {
1505
+ success: false;
1506
+ statusCode: number;
1507
+ data: null;
1508
+ message: string;
1509
+ error: void 0;
1510
+ meta: void 0;
1511
+ } | {
1512
+ success: true;
1513
+ statusCode: number;
1514
+ data: {
1515
+ name: string;
1516
+ uuid: string;
1517
+ slug: string;
1518
+ description: string | null;
1519
+ createdAt: Date | null;
1520
+ updatedAt: Date | null;
1521
+ productTotal: number;
1522
+ media: {
1523
+ createdAt: Date | null;
1524
+ updatedAt: Date | null;
1525
+ media: {
1526
+ name: string;
1527
+ uuid: string;
1528
+ path: string;
1529
+ createdAt: Date | null;
1530
+ updatedAt: Date | null;
1531
+ };
1532
+ };
1533
+ }[];
1534
+ message: null;
1535
+ error: null;
1536
+ meta: void 0;
1537
+ };
1538
+ }>>;
1539
+ count: {
1872
1540
  get: (options?: {
1873
1541
  headers?: {} | undefined;
1874
1542
  query?: {} | undefined;
@@ -1884,52 +1552,88 @@ declare class ClientApi {
1884
1552
  } | {
1885
1553
  success: true;
1886
1554
  statusCode: number;
1887
- data: {
1888
- name: string;
1889
- uuid: string;
1890
- createdAt: Date | null;
1891
- updatedAt: Date | null;
1892
- phoneNumber: string | null;
1893
- contactEmail: string | null;
1894
- country: string | null;
1895
- };
1555
+ data: number;
1896
1556
  message: null;
1897
1557
  error: null;
1898
1558
  meta: void 0;
1899
1559
  };
1900
- 422: {
1901
- type: "validation";
1902
- on: string;
1903
- summary?: string;
1904
- message?: string;
1905
- found?: unknown;
1906
- property?: string;
1907
- expected?: string;
1908
- };
1909
1560
  }>>;
1910
- patch: (body?: {
1911
- name?: string | undefined;
1912
- phoneNumber?: string | undefined;
1913
- contactEmail?: string | undefined;
1914
- country?: string | undefined;
1915
- } | undefined, options?: {
1561
+ };
1562
+ post: (body: {
1563
+ name: string;
1564
+ description: string;
1565
+ }, options?: {
1566
+ headers?: {} | undefined;
1567
+ query?: {} | undefined;
1568
+ fetch?: RequestInit | undefined;
1569
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1570
+ 200: {
1571
+ success: false;
1572
+ statusCode: number;
1573
+ data: null;
1574
+ message: string;
1575
+ error: void 0;
1576
+ meta: void 0;
1577
+ } | {
1578
+ success: true;
1579
+ statusCode: number;
1580
+ data: {
1581
+ media: null;
1582
+ uuid: string;
1583
+ name: string;
1584
+ slug: string;
1585
+ description: string | null;
1586
+ productTotal: number;
1587
+ createdAt: Date | null;
1588
+ updatedAt: Date | null;
1589
+ };
1590
+ message: null;
1591
+ error: null;
1592
+ meta: void 0;
1593
+ };
1594
+ 422: {
1595
+ type: "validation";
1596
+ on: string;
1597
+ summary?: string;
1598
+ message?: string;
1599
+ found?: unknown;
1600
+ property?: string;
1601
+ expected?: string;
1602
+ };
1603
+ }>>;
1604
+ bulk: {
1605
+ post: (body: {
1606
+ series: {
1607
+ name: string;
1608
+ description: string;
1609
+ }[];
1610
+ }, options?: {
1916
1611
  headers?: {} | undefined;
1917
1612
  query?: {} | undefined;
1918
1613
  fetch?: RequestInit | undefined;
1919
1614
  } | undefined) => Promise<Treaty.TreatyResponse<{
1920
1615
  200: {
1921
- success: true;
1616
+ success: false;
1922
1617
  statusCode: number;
1923
1618
  data: null;
1924
1619
  message: string;
1925
- error: null;
1620
+ error: void 0;
1926
1621
  meta: void 0;
1927
1622
  } | {
1928
- success: false;
1623
+ success: true;
1929
1624
  statusCode: number;
1930
- data: null;
1931
- message: string;
1932
- error: void 0;
1625
+ data: {
1626
+ media: null;
1627
+ uuid: string;
1628
+ name: string;
1629
+ slug: string;
1630
+ description: string | null;
1631
+ productTotal: number;
1632
+ createdAt: Date | null;
1633
+ updatedAt: Date | null;
1634
+ }[];
1635
+ message: null;
1636
+ error: null;
1933
1637
  meta: void 0;
1934
1638
  };
1935
1639
  422: {
@@ -1942,11 +1646,13 @@ declare class ClientApi {
1942
1646
  expected?: string;
1943
1647
  };
1944
1648
  }>>;
1945
- delete: (body?: {} | undefined, options?: {
1649
+ delete: (body: {}, options: {
1946
1650
  headers?: {} | undefined;
1947
- query?: {} | undefined;
1651
+ query: {
1652
+ uuids: string[];
1653
+ };
1948
1654
  fetch?: RequestInit | undefined;
1949
- } | undefined) => Promise<Treaty.TreatyResponse<{
1655
+ }) => Promise<Treaty.TreatyResponse<{
1950
1656
  200: {
1951
1657
  success: true;
1952
1658
  statusCode: number;
@@ -1972,7 +1678,227 @@ declare class ClientApi {
1972
1678
  expected?: string;
1973
1679
  };
1974
1680
  }>>;
1975
- }) & {
1681
+ };
1682
+ };
1683
+ session: ((params: {
1684
+ sessionId: string | number;
1685
+ }) => {
1686
+ delete: (body?: {} | undefined, options?: {
1687
+ headers?: {} | undefined;
1688
+ query?: {} | undefined;
1689
+ fetch?: RequestInit | undefined;
1690
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1691
+ 200: {
1692
+ success: false;
1693
+ statusCode: number;
1694
+ data: null;
1695
+ message: string;
1696
+ error: void 0;
1697
+ meta: void 0;
1698
+ } | {
1699
+ success: true;
1700
+ statusCode: number;
1701
+ data: {
1702
+ sessionId: number;
1703
+ };
1704
+ message: null;
1705
+ error: null;
1706
+ meta: void 0;
1707
+ };
1708
+ 422: {
1709
+ type: "validation";
1710
+ on: string;
1711
+ summary?: string;
1712
+ message?: string;
1713
+ found?: unknown;
1714
+ property?: string;
1715
+ expected?: string;
1716
+ };
1717
+ }>>;
1718
+ }) & {
1719
+ get: (options?: {
1720
+ headers?: {} | undefined;
1721
+ query?: {
1722
+ page?: number | undefined;
1723
+ limit?: number | undefined;
1724
+ } | undefined;
1725
+ fetch?: RequestInit | undefined;
1726
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1727
+ 200: {
1728
+ success: false;
1729
+ statusCode: number;
1730
+ data: null;
1731
+ message: string;
1732
+ error: void 0;
1733
+ meta: void 0;
1734
+ } | {
1735
+ success: true;
1736
+ statusCode: number;
1737
+ data: {
1738
+ createdAt: Date | null;
1739
+ updatedAt: Date | null;
1740
+ id: number;
1741
+ expiresAt: Date;
1742
+ ipAddress: string;
1743
+ userAgent: string;
1744
+ user: {
1745
+ uuid: string | null;
1746
+ email: string;
1747
+ username: string;
1748
+ };
1749
+ }[];
1750
+ message: null;
1751
+ error: null;
1752
+ meta: void 0;
1753
+ };
1754
+ 422: {
1755
+ type: "validation";
1756
+ on: string;
1757
+ summary?: string;
1758
+ message?: string;
1759
+ found?: unknown;
1760
+ property?: string;
1761
+ expected?: string;
1762
+ };
1763
+ }>>;
1764
+ };
1765
+ supplier: ((params: {
1766
+ uuid: string | number;
1767
+ }) => {
1768
+ get: (options?: {
1769
+ headers?: {} | undefined;
1770
+ query?: {} | undefined;
1771
+ fetch?: RequestInit | undefined;
1772
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1773
+ 200: {
1774
+ success: false;
1775
+ statusCode: number;
1776
+ data: null;
1777
+ message: string;
1778
+ error: void 0;
1779
+ meta: void 0;
1780
+ } | {
1781
+ success: true;
1782
+ statusCode: number;
1783
+ data: {
1784
+ name: string;
1785
+ uuid: string;
1786
+ createdAt: Date | null;
1787
+ updatedAt: Date | null;
1788
+ phoneNumber: string | null;
1789
+ contactEmail: string | null;
1790
+ country: string | null;
1791
+ };
1792
+ message: null;
1793
+ error: null;
1794
+ meta: void 0;
1795
+ };
1796
+ 422: {
1797
+ type: "validation";
1798
+ on: string;
1799
+ summary?: string;
1800
+ message?: string;
1801
+ found?: unknown;
1802
+ property?: string;
1803
+ expected?: string;
1804
+ };
1805
+ }>>;
1806
+ patch: (body?: {
1807
+ name?: string | undefined;
1808
+ phoneNumber?: string | undefined;
1809
+ contactEmail?: string | undefined;
1810
+ country?: string | undefined;
1811
+ } | undefined, options?: {
1812
+ headers?: {} | undefined;
1813
+ query?: {} | undefined;
1814
+ fetch?: RequestInit | undefined;
1815
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1816
+ 200: {
1817
+ success: true;
1818
+ statusCode: number;
1819
+ data: null;
1820
+ message: string;
1821
+ error: null;
1822
+ meta: void 0;
1823
+ } | {
1824
+ success: false;
1825
+ statusCode: number;
1826
+ data: null;
1827
+ message: string;
1828
+ error: void 0;
1829
+ meta: void 0;
1830
+ };
1831
+ 422: {
1832
+ type: "validation";
1833
+ on: string;
1834
+ summary?: string;
1835
+ message?: string;
1836
+ found?: unknown;
1837
+ property?: string;
1838
+ expected?: string;
1839
+ };
1840
+ }>>;
1841
+ delete: (body?: {} | undefined, options?: {
1842
+ headers?: {} | undefined;
1843
+ query?: {} | undefined;
1844
+ fetch?: RequestInit | undefined;
1845
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1846
+ 200: {
1847
+ success: true;
1848
+ statusCode: number;
1849
+ data: null;
1850
+ message: string;
1851
+ error: null;
1852
+ meta: void 0;
1853
+ } | {
1854
+ success: false;
1855
+ statusCode: number;
1856
+ data: null;
1857
+ message: string;
1858
+ error: void 0;
1859
+ meta: void 0;
1860
+ };
1861
+ 422: {
1862
+ type: "validation";
1863
+ on: string;
1864
+ summary?: string;
1865
+ message?: string;
1866
+ found?: unknown;
1867
+ property?: string;
1868
+ expected?: string;
1869
+ };
1870
+ }>>;
1871
+ }) & {
1872
+ get: (options?: {
1873
+ headers?: {} | undefined;
1874
+ query?: {} | undefined;
1875
+ fetch?: RequestInit | undefined;
1876
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1877
+ 200: {
1878
+ success: false;
1879
+ statusCode: number;
1880
+ data: null;
1881
+ message: string;
1882
+ error: void 0;
1883
+ meta: void 0;
1884
+ } | {
1885
+ success: true;
1886
+ statusCode: number;
1887
+ data: {
1888
+ name: string;
1889
+ uuid: string;
1890
+ createdAt: Date | null;
1891
+ updatedAt: Date | null;
1892
+ phoneNumber: string | null;
1893
+ contactEmail: string | null;
1894
+ country: string | null;
1895
+ }[];
1896
+ message: null;
1897
+ error: null;
1898
+ meta: void 0;
1899
+ };
1900
+ }>>;
1901
+ count: {
1976
1902
  get: (options?: {
1977
1903
  headers?: {} | undefined;
1978
1904
  query?: {} | undefined;
@@ -1988,48 +1914,64 @@ declare class ClientApi {
1988
1914
  } | {
1989
1915
  success: true;
1990
1916
  statusCode: number;
1991
- data: {
1992
- name: string;
1993
- uuid: string;
1994
- createdAt: Date | null;
1995
- updatedAt: Date | null;
1996
- phoneNumber: string | null;
1997
- contactEmail: string | null;
1998
- country: string | null;
1999
- }[];
1917
+ data: number;
2000
1918
  message: null;
2001
1919
  error: null;
2002
1920
  meta: void 0;
2003
1921
  };
2004
1922
  }>>;
2005
- count: {
2006
- get: (options?: {
2007
- headers?: {} | undefined;
2008
- query?: {} | undefined;
2009
- fetch?: RequestInit | undefined;
2010
- } | undefined) => Promise<Treaty.TreatyResponse<{
2011
- 200: {
2012
- success: false;
2013
- statusCode: number;
2014
- data: null;
2015
- message: string;
2016
- error: void 0;
2017
- meta: void 0;
2018
- } | {
2019
- success: true;
2020
- statusCode: number;
2021
- data: number;
2022
- message: null;
2023
- error: null;
2024
- meta: void 0;
2025
- };
2026
- }>>;
1923
+ };
1924
+ post: (body: {
1925
+ name: string;
1926
+ contactEmail: string;
1927
+ phoneNumber: string;
1928
+ country: string;
1929
+ }, options?: {
1930
+ headers?: {} | undefined;
1931
+ query?: {} | undefined;
1932
+ fetch?: RequestInit | undefined;
1933
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1934
+ 200: {
1935
+ success: false;
1936
+ statusCode: number;
1937
+ data: null;
1938
+ message: string;
1939
+ error: void 0;
1940
+ meta: void 0;
1941
+ } | {
1942
+ success: true;
1943
+ statusCode: number;
1944
+ data: {
1945
+ uuid: string;
1946
+ name: string;
1947
+ contactEmail: string | null;
1948
+ phoneNumber: string | null;
1949
+ country: string | null;
1950
+ createdAt: Date | null;
1951
+ updatedAt: Date | null;
1952
+ }[];
1953
+ message: null;
1954
+ error: null;
1955
+ meta: void 0;
1956
+ };
1957
+ 422: {
1958
+ type: "validation";
1959
+ on: string;
1960
+ summary?: string;
1961
+ message?: string;
1962
+ found?: unknown;
1963
+ property?: string;
1964
+ expected?: string;
2027
1965
  };
1966
+ }>>;
1967
+ bulk: {
2028
1968
  post: (body: {
2029
- name: string;
2030
- contactEmail: string;
2031
- phoneNumber: string;
2032
- country: string;
1969
+ suppliers: {
1970
+ name: string;
1971
+ contactEmail: string;
1972
+ phoneNumber: string;
1973
+ country: string;
1974
+ }[];
2033
1975
  }, options?: {
2034
1976
  headers?: {} | undefined;
2035
1977
  query?: {} | undefined;
@@ -2068,117 +2010,132 @@ declare class ClientApi {
2068
2010
  expected?: string;
2069
2011
  };
2070
2012
  }>>;
2071
- bulk: {
2072
- post: (body: {
2073
- suppliers: {
2074
- name: string;
2075
- contactEmail: string;
2076
- phoneNumber: string;
2077
- country: string;
2078
- }[];
2079
- }, options?: {
2080
- headers?: {} | undefined;
2081
- query?: {} | undefined;
2082
- fetch?: RequestInit | undefined;
2083
- } | undefined) => Promise<Treaty.TreatyResponse<{
2084
- 200: {
2085
- success: false;
2086
- statusCode: number;
2087
- data: null;
2088
- message: string;
2089
- error: void 0;
2090
- meta: void 0;
2091
- } | {
2092
- success: true;
2093
- statusCode: number;
2094
- data: {
2095
- uuid: string;
2096
- name: string;
2097
- contactEmail: string | null;
2098
- phoneNumber: string | null;
2099
- country: string | null;
2100
- createdAt: Date | null;
2101
- updatedAt: Date | null;
2102
- }[];
2103
- message: null;
2104
- error: null;
2105
- meta: void 0;
2106
- };
2107
- 422: {
2108
- type: "validation";
2109
- on: string;
2110
- summary?: string;
2111
- message?: string;
2112
- found?: unknown;
2113
- property?: string;
2114
- expected?: string;
2115
- };
2116
- }>>;
2117
- delete: (body: {}, options: {
2118
- headers?: {} | undefined;
2119
- query: {
2120
- uuids: string[];
2121
- };
2122
- fetch?: RequestInit | undefined;
2123
- }) => Promise<Treaty.TreatyResponse<{
2124
- 200: {
2125
- success: true;
2126
- statusCode: number;
2127
- data: null;
2128
- message: string;
2129
- error: null;
2130
- meta: void 0;
2131
- } | {
2132
- success: false;
2133
- statusCode: number;
2134
- data: null;
2135
- message: string;
2136
- error: void 0;
2137
- meta: void 0;
2138
- };
2139
- 422: {
2140
- type: "validation";
2141
- on: string;
2142
- summary?: string;
2143
- message?: string;
2144
- found?: unknown;
2145
- property?: string;
2146
- expected?: string;
2147
- };
2148
- }>>;
2149
- };
2013
+ delete: (body: {}, options: {
2014
+ headers?: {} | undefined;
2015
+ query: {
2016
+ uuids: string[];
2017
+ };
2018
+ fetch?: RequestInit | undefined;
2019
+ }) => Promise<Treaty.TreatyResponse<{
2020
+ 200: {
2021
+ success: true;
2022
+ statusCode: number;
2023
+ data: null;
2024
+ message: string;
2025
+ error: null;
2026
+ meta: void 0;
2027
+ } | {
2028
+ success: false;
2029
+ statusCode: number;
2030
+ data: null;
2031
+ message: string;
2032
+ error: void 0;
2033
+ meta: void 0;
2034
+ };
2035
+ 422: {
2036
+ type: "validation";
2037
+ on: string;
2038
+ summary?: string;
2039
+ message?: string;
2040
+ found?: unknown;
2041
+ property?: string;
2042
+ expected?: string;
2043
+ };
2044
+ }>>;
2150
2045
  };
2151
2046
  };
2152
2047
  };
2153
- } | undefined;
2048
+ };
2049
+ };
2050
+ type TClient = ReturnType<typeof _>;
2051
+ type Config = {
2052
+ baseURL: string;
2053
+ config?: Omit<Treaty.Config, 'onResponse'>;
2054
+ listeners?: {
2055
+ onSetUser?: (user: TUser | null) => void | Promise<void>;
2056
+ onUnauthorized?: () => void | Promise<void>;
2057
+ onLogout?: () => void | Promise<void>;
2058
+ onRefreshToken?: (status: 'SUCCESS' | 'FAILED') => void | Promise<void>;
2059
+ onRefreshFailed?: () => void | Promise<void>;
2060
+ };
2061
+ };
2062
+ declare class ClientApi {
2063
+ private static _getMeTask;
2064
+ private static _refreshTokenTask;
2065
+ private static _logoutTask;
2066
+ private static _client;
2067
+ static client: Treaty.Create<AppType>;
2068
+ static _status: 'LOGGED' | 'INITIAL' | 'LOGGING';
2069
+ static _user: TUser;
2070
+ private static _getMe;
2071
+ private static _refreshToken;
2072
+ private static _logout;
2073
+ constructor({
2074
+ baseURL,
2075
+ config,
2076
+ listeners
2077
+ }: Config);
2078
+ isLogged(): boolean;
2079
+ isInitial(): boolean;
2080
+ getUser(): {
2081
+ uuid: string | null;
2082
+ email: string;
2083
+ createdAt: Date | null;
2084
+ updatedAt: Date | null;
2085
+ username: string;
2086
+ role: string;
2087
+ networks: {
2088
+ createdAt: Date | null;
2089
+ updatedAt: Date | null;
2090
+ id: number;
2091
+ provider: string;
2092
+ providerId: string;
2093
+ }[];
2094
+ profile: {
2095
+ createdAt: Date | null;
2096
+ updatedAt: Date | null;
2097
+ id: number;
2098
+ fullname: string;
2099
+ phoneNumber: string | null;
2100
+ bio: string | null;
2101
+ gender: number | null;
2102
+ dateOfBirth: Date | null;
2103
+ } | null;
2104
+ customerAddresses: {
2105
+ createdAt: Date | null;
2106
+ updatedAt: Date | null;
2107
+ id: number;
2108
+ fullname: string;
2109
+ phoneNumber: string;
2110
+ street: string;
2111
+ isDefault: boolean | null;
2112
+ province: {
2113
+ name: string;
2114
+ type: string;
2115
+ id: string | null;
2116
+ };
2117
+ ward: {
2118
+ name: string;
2119
+ type: string;
2120
+ id: string | null;
2121
+ districtId: string | null;
2122
+ };
2123
+ district: {
2124
+ name: string;
2125
+ type: string;
2126
+ id: string | null;
2127
+ provinceId: string | null;
2128
+ };
2129
+ }[];
2130
+ } | null;
2131
+ getClient(): TClient | undefined;
2154
2132
  getUserClient(): void;
2155
2133
  logout(): Promise<void>;
2156
2134
  fetchApi<TData>({
2157
2135
  request
2158
2136
  }: {
2159
- request: (api: Treaty.Create<AppType>) => Promise<TData>;
2160
- }): Promise<{
2161
- success: true;
2162
- statusCode: number;
2163
- data: null;
2164
- message: string;
2165
- error: null;
2166
- meta: TResponseMeta;
2167
- } | {
2168
- success: false;
2169
- statusCode: number;
2170
- data: null;
2171
- message: string;
2172
- error: TResponseError;
2173
- meta: TResponseMeta;
2174
- } | {
2175
- success: true;
2176
- statusCode: number;
2177
- data: any;
2178
- message: null;
2179
- error: null;
2180
- meta: TResponseMeta;
2181
- } | {
2137
+ request: (api: TClient) => Promise<TData>;
2138
+ }): Promise<TData | {
2182
2139
  success: boolean;
2183
2140
  statusCode: number;
2184
2141
  data: null;