@customafk/lunas-api-sdk 0.0.1

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.
@@ -0,0 +1,2202 @@
1
+ import { Treaty } from "@elysiajs/eden";
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
+ //#region src/utils.d.ts
28
+ 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
+ }) => {
299
+ get: (options?: {
300
+ headers?: {} | undefined;
301
+ query?: {} | undefined;
302
+ fetch?: RequestInit | undefined;
303
+ } | undefined) => Promise<Treaty.TreatyResponse<{
304
+ 200: {
305
+ success: false;
306
+ statusCode: number;
307
+ data: null;
308
+ message: string;
309
+ error: void 0;
310
+ meta: void 0;
311
+ } | {
312
+ success: true;
313
+ statusCode: number;
314
+ data: {
315
+ uuid: string | null;
316
+ email: string;
317
+ createdAt: Date | null;
318
+ updatedAt: Date | null;
319
+ username: string;
320
+ role: string;
321
+ isActive: boolean | null;
322
+ networks: {
323
+ createdAt: Date | null;
324
+ updatedAt: Date | null;
325
+ id: number;
326
+ provider: string;
327
+ providerId: string;
328
+ }[];
329
+ profile: {
330
+ createdAt: Date | null;
331
+ updatedAt: Date | null;
332
+ id: number;
333
+ fullname: string;
334
+ phoneNumber: string | null;
335
+ bio: string | null;
336
+ gender: number | null;
337
+ socialLinks: unknown;
338
+ dateOfBirth: Date | null;
339
+ } | null;
340
+ };
341
+ message: null;
342
+ error: null;
343
+ meta: void 0;
344
+ };
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
+ }>>;
355
+ delete: (body?: {} | undefined, options?: {
356
+ headers?: {} | undefined;
357
+ query?: {} | undefined;
358
+ fetch?: RequestInit | undefined;
359
+ } | undefined) => Promise<Treaty.TreatyResponse<{
360
+ 200: {
361
+ success: false;
362
+ statusCode: number;
363
+ data: null;
364
+ message: string;
365
+ error: void 0;
366
+ meta: void 0;
367
+ } | {
368
+ success: true;
369
+ statusCode: number;
370
+ data: {
371
+ userUuid: string;
372
+ };
373
+ message: null;
374
+ error: null;
375
+ meta: void 0;
376
+ };
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
+ }>>;
387
+ }) & {
388
+ get: (options?: {
389
+ headers?: {} | undefined;
390
+ query?: {
391
+ page?: number | undefined;
392
+ limit?: number | undefined;
393
+ } | undefined;
394
+ fetch?: RequestInit | undefined;
395
+ } | undefined) => Promise<Treaty.TreatyResponse<{
396
+ 200: {
397
+ success: false;
398
+ statusCode: number;
399
+ data: null;
400
+ message: string;
401
+ error: void 0;
402
+ meta: void 0;
403
+ } | {
404
+ success: true;
405
+ 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;
431
+ meta: void 0;
432
+ };
433
+ 422: {
434
+ type: "validation";
435
+ on: string;
436
+ summary?: string;
437
+ message?: string;
438
+ found?: unknown;
439
+ property?: string;
440
+ expected?: string;
441
+ };
442
+ }>>;
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?: {
451
+ headers?: {} | undefined;
452
+ query?: {} | undefined;
453
+ fetch?: RequestInit | undefined;
454
+ } | undefined) => Promise<Treaty.TreatyResponse<{
455
+ 200: {
456
+ success: false;
457
+ statusCode: number;
458
+ data: null;
459
+ message: string;
460
+ error: void 0;
461
+ meta: void 0;
462
+ } | {
463
+ success: true;
464
+ statusCode: number;
465
+ data: undefined;
466
+ message: null;
467
+ error: null;
468
+ meta: void 0;
469
+ } | {
470
+ success: true;
471
+ statusCode: number;
472
+ data: {
473
+ uuid: string | null;
474
+ email: string;
475
+ createdAt: Date | null;
476
+ updatedAt: Date | null;
477
+ username: string;
478
+ role: string;
479
+ networks: {
480
+ createdAt: Date | null;
481
+ updatedAt: Date | null;
482
+ id: number;
483
+ provider: string;
484
+ providerId: string;
485
+ }[];
486
+ profile: {
487
+ createdAt: Date | null;
488
+ updatedAt: Date | null;
489
+ id: number;
490
+ fullname: string;
491
+ phoneNumber: string | null;
492
+ bio: string | null;
493
+ gender: number | null;
494
+ dateOfBirth: Date | null;
495
+ } | 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;
912
+ };
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
+ };
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;
1009
+ createdAt: Date | null;
1010
+ updatedAt: Date | null;
1011
+ id: number;
1012
+ code: string;
1013
+ exchangeRate: number;
1014
+ }[];
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: {
1063
+ id: number;
1064
+ name: string;
1065
+ code: string;
1066
+ exchangeRate: number;
1067
+ createdAt: Date | null;
1068
+ updatedAt: Date | null;
1069
+ }[];
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
+ };
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
+ }>>;
1160
+ };
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: {
1181
+ name: string;
1182
+ uuid: string;
1183
+ path: string;
1184
+ 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;
1233
+ };
1234
+ }>>;
1235
+ }) & {
1236
+ get: (options?: {
1237
+ headers?: {} | undefined;
1238
+ query?: {
1239
+ page?: number | undefined;
1240
+ limit?: number | undefined;
1241
+ search?: string | undefined;
1242
+ } | undefined;
1243
+ fetch?: RequestInit | undefined;
1244
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1245
+ 200: {
1246
+ success: false;
1247
+ statusCode: number;
1248
+ data: null;
1249
+ message: string;
1250
+ error: void 0;
1251
+ meta: void 0;
1252
+ } | {
1253
+ success: true;
1254
+ statusCode: number;
1255
+ data: {
1256
+ data: {
1257
+ name: string;
1258
+ uuid: string;
1259
+ path: string;
1260
+ description: string | null;
1261
+ createdAt: Date | null;
1262
+ updatedAt: Date | null;
1263
+ size: number;
1264
+ mimeType: string;
1265
+ altText: string | null;
1266
+ }[];
1267
+ pagination: {
1268
+ page: number;
1269
+ limit: number;
1270
+ total: number;
1271
+ totalPages: number;
1272
+ hasNextPage: boolean;
1273
+ hasPreviousPage: boolean;
1274
+ };
1275
+ };
1276
+ message: null;
1277
+ error: null;
1278
+ meta: void 0;
1279
+ };
1280
+ 422: {
1281
+ type: "validation";
1282
+ on: string;
1283
+ summary?: string;
1284
+ message?: string;
1285
+ found?: unknown;
1286
+ property?: string;
1287
+ expected?: string;
1288
+ };
1289
+ }>>;
1290
+ post: (body: {
1291
+ name: string;
1292
+ size: number;
1293
+ mimeType: void 0;
1294
+ altText: string;
1295
+ description: string;
1296
+ }, options?: {
1297
+ headers?: {} | undefined;
1298
+ query?: {} | undefined;
1299
+ fetch?: RequestInit | undefined;
1300
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1301
+ 200: {
1302
+ success: false;
1303
+ statusCode: number;
1304
+ data: null;
1305
+ message: string;
1306
+ error: void 0;
1307
+ meta: void 0;
1308
+ } | {
1309
+ success: true;
1310
+ statusCode: number;
1311
+ data: {
1312
+ files: {
1313
+ name: string;
1314
+ uuid: string;
1315
+ path: string;
1316
+ 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;
1327
+ }[];
1328
+ };
1329
+ message: null;
1330
+ error: null;
1331
+ meta: void 0;
1332
+ };
1333
+ 422: {
1334
+ type: "validation";
1335
+ on: string;
1336
+ summary?: string;
1337
+ message?: string;
1338
+ found?: unknown;
1339
+ property?: string;
1340
+ expected?: string;
1341
+ };
1342
+ }>>;
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?: {
1502
+ headers?: {} | undefined;
1503
+ query?: {} | undefined;
1504
+ fetch?: RequestInit | undefined;
1505
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1506
+ 200: {
1507
+ success: false;
1508
+ statusCode: number;
1509
+ data: null;
1510
+ message: string;
1511
+ error: void 0;
1512
+ meta: void 0;
1513
+ } | {
1514
+ success: true;
1515
+ 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;
1527
+ meta: void 0;
1528
+ };
1529
+ 422: {
1530
+ type: "validation";
1531
+ on: string;
1532
+ summary?: string;
1533
+ message?: string;
1534
+ found?: unknown;
1535
+ property?: string;
1536
+ expected?: string;
1537
+ };
1538
+ }>>;
1539
+ patch: (body?: {
1540
+ name?: string | undefined;
1541
+ description?: string | undefined;
1542
+ } | undefined, options?: {
1543
+ headers?: {} | undefined;
1544
+ query?: {} | undefined;
1545
+ fetch?: RequestInit | undefined;
1546
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1547
+ 200: {
1548
+ success: true;
1549
+ statusCode: number;
1550
+ data: null;
1551
+ message: string;
1552
+ error: null;
1553
+ meta: void 0;
1554
+ } | {
1555
+ success: false;
1556
+ statusCode: number;
1557
+ data: null;
1558
+ message: string;
1559
+ error: void 0;
1560
+ meta: void 0;
1561
+ };
1562
+ 422: {
1563
+ type: "validation";
1564
+ on: string;
1565
+ summary?: string;
1566
+ message?: string;
1567
+ found?: unknown;
1568
+ property?: string;
1569
+ expected?: string;
1570
+ };
1571
+ }>>;
1572
+ delete: (body?: {} | undefined, options?: {
1573
+ headers?: {} | undefined;
1574
+ query?: {} | undefined;
1575
+ fetch?: RequestInit | undefined;
1576
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1577
+ 200: {
1578
+ success: true;
1579
+ statusCode: number;
1580
+ data: null;
1581
+ message: string;
1582
+ error: null;
1583
+ meta: void 0;
1584
+ } | {
1585
+ success: false;
1586
+ statusCode: number;
1587
+ data: null;
1588
+ message: string;
1589
+ error: void 0;
1590
+ meta: void 0;
1591
+ };
1592
+ 422: {
1593
+ type: "validation";
1594
+ on: string;
1595
+ summary?: string;
1596
+ message?: string;
1597
+ found?: unknown;
1598
+ property?: string;
1599
+ expected?: string;
1600
+ };
1601
+ }>>;
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;
1618
+ data: {
1619
+ name: string;
1620
+ uuid: string;
1621
+ slug: string;
1622
+ description: string | null;
1623
+ createdAt: Date | null;
1624
+ 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
+ };
1637
+ }[];
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;
1663
+ };
1664
+ }>>;
1665
+ };
1666
+ post: (body: {
1667
+ name: string;
1668
+ description: string;
1669
+ }, options?: {
1670
+ headers?: {} | undefined;
1671
+ query?: {} | undefined;
1672
+ fetch?: RequestInit | undefined;
1673
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1674
+ 200: {
1675
+ success: false;
1676
+ statusCode: number;
1677
+ data: null;
1678
+ message: string;
1679
+ error: void 0;
1680
+ meta: void 0;
1681
+ } | {
1682
+ success: true;
1683
+ statusCode: number;
1684
+ 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;
1693
+ };
1694
+ message: null;
1695
+ error: null;
1696
+ meta: void 0;
1697
+ };
1698
+ 422: {
1699
+ type: "validation";
1700
+ on: string;
1701
+ summary?: string;
1702
+ message?: string;
1703
+ found?: unknown;
1704
+ property?: string;
1705
+ expected?: string;
1706
+ };
1707
+ }>>;
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
+ };
1786
+ };
1787
+ session: ((params: {
1788
+ sessionId: string | number;
1789
+ }) => {
1790
+ delete: (body?: {} | undefined, options?: {
1791
+ headers?: {} | undefined;
1792
+ query?: {} | undefined;
1793
+ fetch?: RequestInit | undefined;
1794
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1795
+ 200: {
1796
+ success: false;
1797
+ statusCode: number;
1798
+ data: null;
1799
+ message: string;
1800
+ error: void 0;
1801
+ meta: void 0;
1802
+ } | {
1803
+ success: true;
1804
+ statusCode: number;
1805
+ data: {
1806
+ sessionId: number;
1807
+ };
1808
+ message: null;
1809
+ error: null;
1810
+ meta: void 0;
1811
+ };
1812
+ 422: {
1813
+ type: "validation";
1814
+ on: string;
1815
+ summary?: string;
1816
+ message?: string;
1817
+ found?: unknown;
1818
+ property?: string;
1819
+ expected?: string;
1820
+ };
1821
+ }>>;
1822
+ }) & {
1823
+ get: (options?: {
1824
+ headers?: {} | undefined;
1825
+ query?: {
1826
+ page?: number | undefined;
1827
+ limit?: number | undefined;
1828
+ } | undefined;
1829
+ fetch?: RequestInit | undefined;
1830
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1831
+ 200: {
1832
+ success: false;
1833
+ statusCode: number;
1834
+ data: null;
1835
+ message: string;
1836
+ error: void 0;
1837
+ meta: void 0;
1838
+ } | {
1839
+ success: true;
1840
+ statusCode: number;
1841
+ 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
+ }[];
1854
+ message: null;
1855
+ error: null;
1856
+ meta: void 0;
1857
+ };
1858
+ 422: {
1859
+ type: "validation";
1860
+ on: string;
1861
+ summary?: string;
1862
+ message?: string;
1863
+ found?: unknown;
1864
+ property?: string;
1865
+ expected?: string;
1866
+ };
1867
+ }>>;
1868
+ };
1869
+ supplier: ((params: {
1870
+ uuid: string | number;
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
+ 422: {
1901
+ type: "validation";
1902
+ on: string;
1903
+ summary?: string;
1904
+ message?: string;
1905
+ found?: unknown;
1906
+ property?: string;
1907
+ expected?: string;
1908
+ };
1909
+ }>>;
1910
+ patch: (body?: {
1911
+ name?: string | undefined;
1912
+ phoneNumber?: string | undefined;
1913
+ contactEmail?: string | undefined;
1914
+ country?: string | undefined;
1915
+ } | undefined, options?: {
1916
+ headers?: {} | undefined;
1917
+ query?: {} | undefined;
1918
+ fetch?: RequestInit | undefined;
1919
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1920
+ 200: {
1921
+ success: true;
1922
+ statusCode: number;
1923
+ data: null;
1924
+ message: string;
1925
+ error: null;
1926
+ meta: void 0;
1927
+ } | {
1928
+ success: false;
1929
+ statusCode: number;
1930
+ data: null;
1931
+ message: string;
1932
+ error: void 0;
1933
+ meta: void 0;
1934
+ };
1935
+ 422: {
1936
+ type: "validation";
1937
+ on: string;
1938
+ summary?: string;
1939
+ message?: string;
1940
+ found?: unknown;
1941
+ property?: string;
1942
+ expected?: string;
1943
+ };
1944
+ }>>;
1945
+ delete: (body?: {} | undefined, options?: {
1946
+ headers?: {} | undefined;
1947
+ query?: {} | undefined;
1948
+ fetch?: RequestInit | undefined;
1949
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1950
+ 200: {
1951
+ success: true;
1952
+ statusCode: number;
1953
+ data: null;
1954
+ message: string;
1955
+ error: null;
1956
+ meta: void 0;
1957
+ } | {
1958
+ success: false;
1959
+ statusCode: number;
1960
+ data: null;
1961
+ message: string;
1962
+ error: void 0;
1963
+ meta: void 0;
1964
+ };
1965
+ 422: {
1966
+ type: "validation";
1967
+ on: string;
1968
+ summary?: string;
1969
+ message?: string;
1970
+ found?: unknown;
1971
+ property?: string;
1972
+ expected?: string;
1973
+ };
1974
+ }>>;
1975
+ }) & {
1976
+ get: (options?: {
1977
+ headers?: {} | undefined;
1978
+ query?: {} | undefined;
1979
+ fetch?: RequestInit | undefined;
1980
+ } | undefined) => Promise<Treaty.TreatyResponse<{
1981
+ 200: {
1982
+ success: false;
1983
+ statusCode: number;
1984
+ data: null;
1985
+ message: string;
1986
+ error: void 0;
1987
+ meta: void 0;
1988
+ } | {
1989
+ success: true;
1990
+ 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
+ }[];
2000
+ message: null;
2001
+ error: null;
2002
+ meta: void 0;
2003
+ };
2004
+ }>>;
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
+ }>>;
2027
+ };
2028
+ post: (body: {
2029
+ name: string;
2030
+ contactEmail: string;
2031
+ phoneNumber: string;
2032
+ country: string;
2033
+ }, options?: {
2034
+ headers?: {} | undefined;
2035
+ query?: {} | undefined;
2036
+ fetch?: RequestInit | undefined;
2037
+ } | undefined) => Promise<Treaty.TreatyResponse<{
2038
+ 200: {
2039
+ success: false;
2040
+ statusCode: number;
2041
+ data: null;
2042
+ message: string;
2043
+ error: void 0;
2044
+ meta: void 0;
2045
+ } | {
2046
+ success: true;
2047
+ statusCode: number;
2048
+ data: {
2049
+ uuid: string;
2050
+ name: string;
2051
+ contactEmail: string | null;
2052
+ phoneNumber: string | null;
2053
+ country: string | null;
2054
+ createdAt: Date | null;
2055
+ updatedAt: Date | null;
2056
+ }[];
2057
+ message: null;
2058
+ error: null;
2059
+ meta: void 0;
2060
+ };
2061
+ 422: {
2062
+ type: "validation";
2063
+ on: string;
2064
+ summary?: string;
2065
+ message?: string;
2066
+ found?: unknown;
2067
+ property?: string;
2068
+ expected?: string;
2069
+ };
2070
+ }>>;
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
+ };
2150
+ };
2151
+ };
2152
+ };
2153
+ } | undefined;
2154
+ getUserClient(): void;
2155
+ logout(): Promise<void>;
2156
+ fetchApi<TData>({
2157
+ request
2158
+ }: {
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
+ } | {
2182
+ success: boolean;
2183
+ statusCode: number;
2184
+ data: null;
2185
+ message: string;
2186
+ error: {
2187
+ statusCode: number;
2188
+ message: string;
2189
+ };
2190
+ meta: {
2191
+ version: string;
2192
+ timestamp: string;
2193
+ path: string;
2194
+ };
2195
+ } | null>;
2196
+ private _onSetUser?;
2197
+ private _onUnauthorized?;
2198
+ private _onLogout?;
2199
+ }
2200
+ //#endregion
2201
+ export { ClientApi, type TUser };
2202
+ //# sourceMappingURL=index.d.cts.map