@scryme/sdk 0.1.0 → 9.64.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.
@@ -0,0 +1,3143 @@
1
+ // src/server.ts
2
+ import axios3 from "axios";
3
+
4
+ // src/generated/scryme.ts
5
+ import axios from "axios";
6
+ var getScrymeV3API = (axiosInstance = axios) => {
7
+ const inventoryVerifyIntegrity = (orgSlug, options) => {
8
+ return axiosInstance.get(
9
+ `/v3/${orgSlug}/inventory/integrity/verify`,
10
+ options
11
+ );
12
+ };
13
+ const inventoryFixIntegrity = (orgSlug, variantId, params, options) => {
14
+ return axiosInstance.post(
15
+ `/v3/${orgSlug}/inventory/integrity/fix/${variantId}`,
16
+ void 0,
17
+ {
18
+ ...options,
19
+ params: { ...params, ...options?.params }
20
+ }
21
+ );
22
+ };
23
+ const inventoryGetInventory = (orgSlug, params, options) => {
24
+ return axiosInstance.get(
25
+ `/v3/${orgSlug}/inventory`,
26
+ {
27
+ ...options,
28
+ params: { ...params, ...options?.params }
29
+ }
30
+ );
31
+ };
32
+ const inventoryTraceBatch = (orgSlug, identifier, options) => {
33
+ return axiosInstance.get(
34
+ `/v3/${orgSlug}/inventory/trace/${identifier}`,
35
+ options
36
+ );
37
+ };
38
+ const inventorySplitBatch = (orgSlug, id, options) => {
39
+ return axiosInstance.post(
40
+ `/v3/${orgSlug}/inventory/batches/${id}/split`,
41
+ void 0,
42
+ options
43
+ );
44
+ };
45
+ const inventoryMergeBatches = (orgSlug, options) => {
46
+ return axiosInstance.post(
47
+ `/v3/${orgSlug}/inventory/batches/merge`,
48
+ void 0,
49
+ options
50
+ );
51
+ };
52
+ const inventoryCreateAssembly = (orgSlug, options) => {
53
+ return axiosInstance.post(
54
+ `/v3/${orgSlug}/inventory/assemblies`,
55
+ void 0,
56
+ options
57
+ );
58
+ };
59
+ const inventoryCompleteAssembly = (orgSlug, id, options) => {
60
+ return axiosInstance.post(
61
+ `/v3/${orgSlug}/inventory/assemblies/${id}/complete`,
62
+ void 0,
63
+ options
64
+ );
65
+ };
66
+ const inventoryRequestAdjustment = (orgSlug, options) => {
67
+ return axiosInstance.post(
68
+ `/v3/${orgSlug}/inventory/adjustments/request`,
69
+ void 0,
70
+ options
71
+ );
72
+ };
73
+ const inventoryGetAdjustments = (orgSlug, params, options) => {
74
+ return axiosInstance.get(
75
+ `/v3/${orgSlug}/inventory/adjustments`,
76
+ {
77
+ ...options,
78
+ params: { ...params, ...options?.params }
79
+ }
80
+ );
81
+ };
82
+ const inventoryApproveAdjustment = (orgSlug, id, options) => {
83
+ return axiosInstance.patch(
84
+ `/v3/${orgSlug}/inventory/adjustments/${id}/approve`,
85
+ void 0,
86
+ options
87
+ );
88
+ };
89
+ const inventoryRejectAdjustment = (orgSlug, id, options) => {
90
+ return axiosInstance.patch(
91
+ `/v3/${orgSlug}/inventory/adjustments/${id}/reject`,
92
+ void 0,
93
+ options
94
+ );
95
+ };
96
+ const inventoryGetLeadTime = (orgSlug, params, options) => {
97
+ return axiosInstance.get(
98
+ `/v3/${orgSlug}/inventory/analytics/supplier-lead-time`,
99
+ {
100
+ ...options,
101
+ params: { ...params, ...options?.params }
102
+ }
103
+ );
104
+ };
105
+ const inventoryGetWasteAnalysis = (orgSlug, params, options) => {
106
+ return axiosInstance.get(
107
+ `/v3/${orgSlug}/inventory/analytics/waste`,
108
+ {
109
+ ...options,
110
+ params: { ...params, ...options?.params }
111
+ }
112
+ );
113
+ };
114
+ const inventoryCheckB2BAvailability = (orgSlug, checkB2BAvailabilityDto, options) => {
115
+ return axiosInstance.post(
116
+ `/v3/${orgSlug}/inventory/b2b/availability`,
117
+ checkB2BAvailabilityDto,
118
+ options
119
+ );
120
+ };
121
+ const inventoryUnpackBatch = (orgSlug, id, options) => {
122
+ return axiosInstance.post(
123
+ `/v3/${orgSlug}/inventory/batches/${id}/unpack`,
124
+ void 0,
125
+ options
126
+ );
127
+ };
128
+ const inventoryScanUnpackBatch = (orgSlug, options) => {
129
+ return axiosInstance.post(
130
+ `/v3/${orgSlug}/inventory/batches/scan-unpack`,
131
+ void 0,
132
+ options
133
+ );
134
+ };
135
+ const inventoryQuickStockInquiry = (orgSlug, options) => {
136
+ return axiosInstance.post(
137
+ `/v3/${orgSlug}/inventory/b2b/quick-inquiry`,
138
+ void 0,
139
+ options
140
+ );
141
+ };
142
+ const expenseControllerCreateExpense = (createExpenseDto, options) => {
143
+ return axiosInstance.post(
144
+ `/v3/finance/expenses`,
145
+ createExpenseDto,
146
+ options
147
+ );
148
+ };
149
+ const expenseControllerGetExpenses = (params, options) => {
150
+ return axiosInstance.get(
151
+ `/v3/finance/expenses`,
152
+ {
153
+ ...options,
154
+ params: { ...params, ...options?.params }
155
+ }
156
+ );
157
+ };
158
+ const expenseControllerGetExpenseCategories = (options) => {
159
+ return axiosInstance.get(
160
+ `/v3/finance/expenses/categories`,
161
+ options
162
+ );
163
+ };
164
+ const expenseControllerGetExpense = (id, options) => {
165
+ return axiosInstance.get(
166
+ `/v3/finance/expenses/${id}`,
167
+ options
168
+ );
169
+ };
170
+ const pettyCashControllerCreateFund = (createPettyCashFundDto, options) => {
171
+ return axiosInstance.post(
172
+ `/v3/finance/petty-cash`,
173
+ createPettyCashFundDto,
174
+ options
175
+ );
176
+ };
177
+ const pettyCashControllerGetFunds = (options) => {
178
+ return axiosInstance.get(
179
+ `/v3/finance/petty-cash`,
180
+ options
181
+ );
182
+ };
183
+ const pettyCashControllerGetFund = (id, options) => {
184
+ return axiosInstance.get(
185
+ `/v3/finance/petty-cash/${id}`,
186
+ options
187
+ );
188
+ };
189
+ const pettyCashControllerTopUpFund = (id, topUpPettyCashFundDto, options) => {
190
+ return axiosInstance.post(
191
+ `/v3/finance/petty-cash/${id}/top-up`,
192
+ topUpPettyCashFundDto,
193
+ options
194
+ );
195
+ };
196
+ const pettyCashControllerGetFundTransactions = (id, options) => {
197
+ return axiosInstance.get(
198
+ `/v3/finance/petty-cash/${id}/transactions`,
199
+ options
200
+ );
201
+ };
202
+ const utilityAccountControllerCreateAccount = (createUtilityAccountDto, options) => {
203
+ return axiosInstance.post(
204
+ `/v3/finance/utility-accounts`,
205
+ createUtilityAccountDto,
206
+ options
207
+ );
208
+ };
209
+ const utilityAccountControllerGetAccounts = (options) => {
210
+ return axiosInstance.get(
211
+ `/v3/finance/utility-accounts`,
212
+ options
213
+ );
214
+ };
215
+ const utilityAccountControllerGetAccount = (id, options) => {
216
+ return axiosInstance.get(
217
+ `/v3/finance/utility-accounts/${id}`,
218
+ options
219
+ );
220
+ };
221
+ const accountingInitialize = (orgSlug, options) => {
222
+ return axiosInstance.post(
223
+ `/v3/${orgSlug}/finance/accounting/initialize`,
224
+ void 0,
225
+ options
226
+ );
227
+ };
228
+ const accountingGetProfitLoss = (orgSlug, params, options) => {
229
+ return axiosInstance.get(
230
+ `/v3/${orgSlug}/finance/accounting/reports/profit-loss`,
231
+ {
232
+ ...options,
233
+ params: { ...params, ...options?.params }
234
+ }
235
+ );
236
+ };
237
+ const accountingGetBalanceSheet = (orgSlug, params, options) => {
238
+ return axiosInstance.get(
239
+ `/v3/${orgSlug}/finance/accounting/reports/balance-sheet`,
240
+ {
241
+ ...options,
242
+ params: { ...params, ...options?.params }
243
+ }
244
+ );
245
+ };
246
+ const accountingGetCashFlow = (orgSlug, params, options) => {
247
+ return axiosInstance.get(
248
+ `/v3/${orgSlug}/finance/accounting/reports/cash-flow`,
249
+ {
250
+ ...options,
251
+ params: { ...params, ...options?.params }
252
+ }
253
+ );
254
+ };
255
+ const accountingGetTaxSummary = (orgSlug, params, options) => {
256
+ return axiosInstance.get(
257
+ `/v3/${orgSlug}/finance/accounting/reports/tax-summary`,
258
+ {
259
+ ...options,
260
+ params: { ...params, ...options?.params }
261
+ }
262
+ );
263
+ };
264
+ const invoiceControllerCreateInvoice = (createInvoiceDto, options) => {
265
+ return axiosInstance.post(
266
+ `/v3/finance/invoices`,
267
+ createInvoiceDto,
268
+ options
269
+ );
270
+ };
271
+ const invoiceControllerGetInvoices = (options) => {
272
+ return axiosInstance.get(
273
+ `/v3/finance/invoices`,
274
+ options
275
+ );
276
+ };
277
+ const invoiceControllerGetInvoice = (id, options) => {
278
+ return axiosInstance.get(
279
+ `/v3/finance/invoices/${id}`,
280
+ options
281
+ );
282
+ };
283
+ const invoiceControllerUpdateInvoice = (id, updateInvoiceDto, options) => {
284
+ return axiosInstance.put(
285
+ `/v3/finance/invoices/${id}`,
286
+ updateInvoiceDto,
287
+ options
288
+ );
289
+ };
290
+ const invoiceControllerDeleteInvoice = (id, options) => {
291
+ return axiosInstance.delete(
292
+ `/v3/finance/invoices/${id}`,
293
+ options
294
+ );
295
+ };
296
+ const invoiceControllerFinalizeInvoice = (id, options) => {
297
+ return axiosInstance.post(
298
+ `/v3/finance/invoices/${id}/finalize`,
299
+ void 0,
300
+ options
301
+ );
302
+ };
303
+ const invoiceControllerGetTemplates = (options) => {
304
+ return axiosInstance.get(
305
+ `/v3/finance/invoices/templates`,
306
+ options
307
+ );
308
+ };
309
+ const invoiceControllerCreateTemplate = (options) => {
310
+ return axiosInstance.post(
311
+ `/v3/finance/invoices/templates`,
312
+ void 0,
313
+ options
314
+ );
315
+ };
316
+ const invoiceControllerGetConfig = (options) => {
317
+ return axiosInstance.get(
318
+ `/v3/finance/invoices/config`,
319
+ options
320
+ );
321
+ };
322
+ const invoiceControllerUpdateConfig = (invoiceConfigDto, options) => {
323
+ return axiosInstance.put(
324
+ `/v3/finance/invoices/config`,
325
+ invoiceConfigDto,
326
+ options
327
+ );
328
+ };
329
+ const publicInvoiceControllerDownloadInvoice = (id, params, options) => {
330
+ return axiosInstance.get(
331
+ `/v3/public-invoices/${id}/download`,
332
+ {
333
+ ...options,
334
+ params: { ...params, ...options?.params }
335
+ }
336
+ );
337
+ };
338
+ const publicInvoiceControllerDownloadInvoiceByTransaction = (transactionId, params, options) => {
339
+ return axiosInstance.get(
340
+ `/v3/public-invoices/transactions/${transactionId}/download`,
341
+ {
342
+ ...options,
343
+ params: { ...params, ...options?.params }
344
+ }
345
+ );
346
+ };
347
+ const publicInvoiceControllerDownloadReceipt = (transactionId, params, options) => {
348
+ return axiosInstance.get(
349
+ `/v3/public-invoices/receipts/${transactionId}/download`,
350
+ {
351
+ ...options,
352
+ params: { ...params, ...options?.params }
353
+ }
354
+ );
355
+ };
356
+ const publicInvoiceControllerGeneratePublicLink = (transactionId, params, options) => {
357
+ return axiosInstance.post(
358
+ `/v3/public-invoices/transactions/${transactionId}/generate-public-link`,
359
+ void 0,
360
+ {
361
+ ...options,
362
+ params: { ...params, ...options?.params }
363
+ }
364
+ );
365
+ };
366
+ const authExchangeToken = (tokenRequestDto, options) => {
367
+ return axiosInstance.post(
368
+ `/v3/auth/token`,
369
+ tokenRequestDto,
370
+ options
371
+ );
372
+ };
373
+ const authControllerHandleOAuth2 = (path, options) => {
374
+ return axiosInstance.get(
375
+ `/v3/auth/oauth2/${path}`,
376
+ options
377
+ );
378
+ };
379
+ const adminControllerGetStats = (options) => {
380
+ return axiosInstance.get(
381
+ `/v3/admin/stats`,
382
+ options
383
+ );
384
+ };
385
+ const adminControllerListOrganizations = (options) => {
386
+ return axiosInstance.get(
387
+ `/v3/admin/organizations`,
388
+ options
389
+ );
390
+ };
391
+ const adminControllerCreateOrganization = (createOrganizationDto, options) => {
392
+ return axiosInstance.post(
393
+ `/v3/admin/organizations`,
394
+ createOrganizationDto,
395
+ options
396
+ );
397
+ };
398
+ const adminControllerGetOrganizationDetails = (id, options) => {
399
+ return axiosInstance.get(
400
+ `/v3/admin/organizations/${id}`,
401
+ options
402
+ );
403
+ };
404
+ const adminControllerUpdateOrganization = (id, updateOrganizationDto, options) => {
405
+ return axiosInstance.patch(
406
+ `/v3/admin/organizations/${id}`,
407
+ updateOrganizationDto,
408
+ options
409
+ );
410
+ };
411
+ const adminControllerDeleteOrganization = (id, options) => {
412
+ return axiosInstance.delete(
413
+ `/v3/admin/organizations/${id}`,
414
+ options
415
+ );
416
+ };
417
+ const adminControllerListMembers = (params, options) => {
418
+ return axiosInstance.get(
419
+ `/v3/admin/members`,
420
+ {
421
+ ...options,
422
+ params: { ...params, ...options?.params }
423
+ }
424
+ );
425
+ };
426
+ const adminControllerListUsers = (options) => {
427
+ return axiosInstance.get(
428
+ `/v3/admin/users`,
429
+ options
430
+ );
431
+ };
432
+ const adminControllerBanUser = (id, banUserDto, options) => {
433
+ return axiosInstance.post(
434
+ `/v3/admin/users/${id}/ban`,
435
+ banUserDto,
436
+ options
437
+ );
438
+ };
439
+ const adminControllerUnbanUser = (id, options) => {
440
+ return axiosInstance.post(
441
+ `/v3/admin/users/${id}/unban`,
442
+ void 0,
443
+ options
444
+ );
445
+ };
446
+ const adminControllerListConnectedApps = (options) => {
447
+ return axiosInstance.get(
448
+ `/v3/admin/connected-apps`,
449
+ options
450
+ );
451
+ };
452
+ const adminControllerListSystemLogs = (options) => {
453
+ return axiosInstance.get(
454
+ `/v3/admin/system-logs`,
455
+ options
456
+ );
457
+ };
458
+ const adminControllerListGlobalSettings = (options) => {
459
+ return axiosInstance.get(
460
+ `/v3/admin/settings`,
461
+ options
462
+ );
463
+ };
464
+ const adminControllerSetGlobalSetting = (setGlobalSettingDto, options) => {
465
+ return axiosInstance.post(
466
+ `/v3/admin/settings`,
467
+ setGlobalSettingDto,
468
+ options
469
+ );
470
+ };
471
+ const adminControllerDeleteGlobalSetting = (key, options) => {
472
+ return axiosInstance.delete(
473
+ `/v3/admin/settings/${key}`,
474
+ options
475
+ );
476
+ };
477
+ const adminControllerListTiers = (options) => {
478
+ return axiosInstance.get(
479
+ `/v3/admin/tiers`,
480
+ options
481
+ );
482
+ };
483
+ const adminControllerDefineTier = (defineTierDto, options) => {
484
+ return axiosInstance.post(
485
+ `/v3/admin/tiers`,
486
+ defineTierDto,
487
+ options
488
+ );
489
+ };
490
+ const adminControllerDeleteTier = (slug, options) => {
491
+ return axiosInstance.delete(
492
+ `/v3/admin/tiers/${slug}`,
493
+ options
494
+ );
495
+ };
496
+ const adminControllerGetOrganizationSubscription = (id, options) => {
497
+ return axiosInstance.get(
498
+ `/v3/admin/organizations/${id}/subscription`,
499
+ options
500
+ );
501
+ };
502
+ const adminControllerUpdateOrganizationSubscription = (id, updateSubscriptionDto, options) => {
503
+ return axiosInstance.put(
504
+ `/v3/admin/organizations/${id}/subscription`,
505
+ updateSubscriptionDto,
506
+ options
507
+ );
508
+ };
509
+ const adminControllerListSystemPayments = (options) => {
510
+ return axiosInstance.get(
511
+ `/v3/admin/payments`,
512
+ options
513
+ );
514
+ };
515
+ const adminControllerRecordCustomPayment = (recordCustomPaymentDto, options) => {
516
+ return axiosInstance.post(
517
+ `/v3/admin/payments/record`,
518
+ recordCustomPaymentDto,
519
+ options
520
+ );
521
+ };
522
+ const adminControllerListIntegrationDefinitions = (options) => {
523
+ return axiosInstance.get(
524
+ `/v3/admin/integrations/definitions`,
525
+ options
526
+ );
527
+ };
528
+ const adminControllerCreateIntegrationDefinition = (createIntegrationDefinitionDto, options) => {
529
+ return axiosInstance.post(
530
+ `/v3/admin/integrations/definitions`,
531
+ createIntegrationDefinitionDto,
532
+ options
533
+ );
534
+ };
535
+ const adminControllerUpdateIntegrationDefinition = (id, updateIntegrationDefinitionDto, options) => {
536
+ return axiosInstance.patch(
537
+ `/v3/admin/integrations/definitions/${id}`,
538
+ updateIntegrationDefinitionDto,
539
+ options
540
+ );
541
+ };
542
+ const adminControllerDeleteIntegrationDefinition = (id, options) => {
543
+ return axiosInstance.delete(
544
+ `/v3/admin/integrations/definitions/${id}`,
545
+ options
546
+ );
547
+ };
548
+ const adminControllerListActiveOrganizationIntegrations = (options) => {
549
+ return axiosInstance.get(
550
+ `/v3/admin/integrations/active`,
551
+ options
552
+ );
553
+ };
554
+ const webhooksCreate = (orgSlug, createWebhookDto, options) => {
555
+ return axiosInstance.post(
556
+ `/v3/${orgSlug}/webhooks`,
557
+ createWebhookDto,
558
+ options
559
+ );
560
+ };
561
+ const webhooksList = (orgSlug, options) => {
562
+ return axiosInstance.get(
563
+ `/v3/${orgSlug}/webhooks`,
564
+ options
565
+ );
566
+ };
567
+ const webhooksDelete = (orgSlug, id, options) => {
568
+ return axiosInstance.delete(
569
+ `/v3/${orgSlug}/webhooks/${id}`,
570
+ options
571
+ );
572
+ };
573
+ const windmillCallbackControllerHandleCallback = (options) => {
574
+ return axiosInstance.post(
575
+ `/v3/webhooks/windmill`,
576
+ void 0,
577
+ options
578
+ );
579
+ };
580
+ const windmillCallbackControllerHandleApprovalCallback = (options) => {
581
+ return axiosInstance.post(
582
+ `/v3/webhooks/windmill/approval`,
583
+ void 0,
584
+ options
585
+ );
586
+ };
587
+ const windmillCallbackControllerHandleBakeryDisposalCallback = (options) => {
588
+ return axiosInstance.post(
589
+ `/v3/webhooks/windmill/bakery/disposal`,
590
+ void 0,
591
+ options
592
+ );
593
+ };
594
+ const windmillCallbackControllerHandleOutcomeCallback = (options) => {
595
+ return axiosInstance.post(
596
+ `/v3/webhooks/windmill/outcome`,
597
+ void 0,
598
+ options
599
+ );
600
+ };
601
+ const catalogGetProducts = (orgSlug, params, options) => {
602
+ return axiosInstance.get(
603
+ `/v3/${orgSlug}/catalog/products`,
604
+ {
605
+ ...options,
606
+ params: { ...params, ...options?.params }
607
+ }
608
+ );
609
+ };
610
+ const catalogCreateProduct = (orgSlug, createProductDto, options) => {
611
+ return axiosInstance.post(
612
+ `/v3/${orgSlug}/catalog/products`,
613
+ createProductDto,
614
+ options
615
+ );
616
+ };
617
+ const catalogGetServices = (orgSlug, params, options) => {
618
+ return axiosInstance.get(
619
+ `/v3/${orgSlug}/catalog/services`,
620
+ {
621
+ ...options,
622
+ params: { ...params, ...options?.params }
623
+ }
624
+ );
625
+ };
626
+ const catalogUpdateProduct = (orgSlug, id, updateProductDto, options) => {
627
+ return axiosInstance.patch(
628
+ `/v3/${orgSlug}/catalog/products/${id}`,
629
+ updateProductDto,
630
+ options
631
+ );
632
+ };
633
+ const catalogUpdateSupplierVariant = (orgSlug, supplierId, variantId, updateSupplierProductDto, options) => {
634
+ return axiosInstance.patch(
635
+ `/v3/${orgSlug}/catalog/suppliers/${supplierId}/variants/${variantId}`,
636
+ updateSupplierProductDto,
637
+ options
638
+ );
639
+ };
640
+ const catalogGetPriceChangeRequests = (orgSlug, params, options) => {
641
+ return axiosInstance.get(
642
+ `/v3/${orgSlug}/catalog/price-change-requests`,
643
+ {
644
+ ...options,
645
+ params: { ...params, ...options?.params }
646
+ }
647
+ );
648
+ };
649
+ const catalogReviewPriceChangeRequest = (orgSlug, id, reviewPriceChangeDto, options) => {
650
+ return axiosInstance.post(
651
+ `/v3/${orgSlug}/catalog/price-change-requests/${id}/review`,
652
+ reviewPriceChangeDto,
653
+ options
654
+ );
655
+ };
656
+ const servicesCreateCategory = (orgSlug, createServiceCategoryDto, options) => {
657
+ return axiosInstance.post(
658
+ `/v3/${orgSlug}/services/categories`,
659
+ createServiceCategoryDto,
660
+ options
661
+ );
662
+ };
663
+ const servicesGetCategories = (orgSlug, options) => {
664
+ return axiosInstance.get(
665
+ `/v3/${orgSlug}/services/categories`,
666
+ options
667
+ );
668
+ };
669
+ const servicesUpdateCategory = (orgSlug, id, updateServiceCategoryDto, options) => {
670
+ return axiosInstance.patch(
671
+ `/v3/${orgSlug}/services/categories/${id}`,
672
+ updateServiceCategoryDto,
673
+ options
674
+ );
675
+ };
676
+ const servicesDeleteCategory = (orgSlug, id, options) => {
677
+ return axiosInstance.post(
678
+ `/v3/${orgSlug}/services/categories/${id}/delete`,
679
+ void 0,
680
+ options
681
+ );
682
+ };
683
+ const servicesCreateService = (orgSlug, createServiceDto, options) => {
684
+ return axiosInstance.post(
685
+ `/v3/${orgSlug}/services`,
686
+ createServiceDto,
687
+ options
688
+ );
689
+ };
690
+ const servicesGetServices = (orgSlug, options) => {
691
+ return axiosInstance.get(
692
+ `/v3/${orgSlug}/services`,
693
+ options
694
+ );
695
+ };
696
+ const servicesGetCurrentMemberShifts = (orgSlug, options) => {
697
+ return axiosInstance.get(
698
+ `/v3/${orgSlug}/services/shifts/me`,
699
+ options
700
+ );
701
+ };
702
+ const servicesGetShifts = (orgSlug, params, options) => {
703
+ return axiosInstance.get(
704
+ `/v3/${orgSlug}/services/shifts`,
705
+ {
706
+ ...options,
707
+ params: { ...params, ...options?.params }
708
+ }
709
+ );
710
+ };
711
+ const servicesGetService = (orgSlug, id, options) => {
712
+ return axiosInstance.get(
713
+ `/v3/${orgSlug}/services/${id}`,
714
+ options
715
+ );
716
+ };
717
+ const servicesUpdateService = (orgSlug, id, updateServiceDto, options) => {
718
+ return axiosInstance.patch(
719
+ `/v3/${orgSlug}/services/${id}`,
720
+ updateServiceDto,
721
+ options
722
+ );
723
+ };
724
+ const servicesDeleteService = (orgSlug, id, options) => {
725
+ return axiosInstance.post(
726
+ `/v3/${orgSlug}/services/${id}/delete`,
727
+ void 0,
728
+ options
729
+ );
730
+ };
731
+ const servicesCreateResource = (orgSlug, createServiceResourceDto, options) => {
732
+ return axiosInstance.post(
733
+ `/v3/${orgSlug}/services/resources`,
734
+ createServiceResourceDto,
735
+ options
736
+ );
737
+ };
738
+ const servicesGetResources = (orgSlug, options) => {
739
+ return axiosInstance.get(
740
+ `/v3/${orgSlug}/services/resources`,
741
+ options
742
+ );
743
+ };
744
+ const servicesUpdateResource = (orgSlug, id, updateServiceResourceDto, options) => {
745
+ return axiosInstance.patch(
746
+ `/v3/${orgSlug}/services/resources/${id}`,
747
+ updateServiceResourceDto,
748
+ options
749
+ );
750
+ };
751
+ const servicesDeleteResource = (orgSlug, id, options) => {
752
+ return axiosInstance.post(
753
+ `/v3/${orgSlug}/services/resources/${id}/delete`,
754
+ void 0,
755
+ options
756
+ );
757
+ };
758
+ const servicesCreateBooking = (orgSlug, createBookingDto, options) => {
759
+ return axiosInstance.post(
760
+ `/v3/${orgSlug}/services/bookings`,
761
+ createBookingDto,
762
+ options
763
+ );
764
+ };
765
+ const servicesGetBookings = (orgSlug, options) => {
766
+ return axiosInstance.get(
767
+ `/v3/${orgSlug}/services/bookings`,
768
+ options
769
+ );
770
+ };
771
+ const servicesGetBooking = (orgSlug, id, options) => {
772
+ return axiosInstance.get(
773
+ `/v3/${orgSlug}/services/bookings/${id}`,
774
+ options
775
+ );
776
+ };
777
+ const servicesUpdateBookingStatus = (orgSlug, id, servicesUpdateBookingStatusBody, options) => {
778
+ return axiosInstance.patch(
779
+ `/v3/${orgSlug}/services/bookings/${id}/status`,
780
+ servicesUpdateBookingStatusBody,
781
+ options
782
+ );
783
+ };
784
+ const servicesCompleteBooking = (orgSlug, id, completeBookingDto, options) => {
785
+ return axiosInstance.patch(
786
+ `/v3/${orgSlug}/services/bookings/${id}/complete`,
787
+ completeBookingDto,
788
+ options
789
+ );
790
+ };
791
+ const servicesCreateShift = (orgSlug, memberId, servicesCreateShiftBody, options) => {
792
+ return axiosInstance.post(
793
+ `/v3/${orgSlug}/services/staff/${memberId}/shifts`,
794
+ servicesCreateShiftBody,
795
+ options
796
+ );
797
+ };
798
+ const servicesGetStaffShifts = (orgSlug, memberId, options) => {
799
+ return axiosInstance.get(
800
+ `/v3/${orgSlug}/services/staff/${memberId}/shifts`,
801
+ options
802
+ );
803
+ };
804
+ const servicesAddBreak = (orgSlug, shiftId, servicesAddBreakBody, options) => {
805
+ return axiosInstance.post(
806
+ `/v3/${orgSlug}/services/shifts/${shiftId}/breaks`,
807
+ servicesAddBreakBody,
808
+ options
809
+ );
810
+ };
811
+ const servicesRegisterCustomerApp = (orgSlug, servicesRegisterCustomerAppBody, options) => {
812
+ return axiosInstance.post(
813
+ `/v3/${orgSlug}/services/register-customer-app`,
814
+ servicesRegisterCustomerAppBody,
815
+ options
816
+ );
817
+ };
818
+ const servicesGetUtilization = (orgSlug, params, options) => {
819
+ return axiosInstance.get(
820
+ `/v3/${orgSlug}/services/analytics/utilization`,
821
+ {
822
+ ...options,
823
+ params: { ...params, ...options?.params }
824
+ }
825
+ );
826
+ };
827
+ const servicesGetPerformance = (orgSlug, params, options) => {
828
+ return axiosInstance.get(
829
+ `/v3/${orgSlug}/services/analytics/performance`,
830
+ {
831
+ ...options,
832
+ params: { ...params, ...options?.params }
833
+ }
834
+ );
835
+ };
836
+ const servicesGetFunnel = (orgSlug, params, options) => {
837
+ return axiosInstance.get(
838
+ `/v3/${orgSlug}/services/analytics/funnel`,
839
+ {
840
+ ...options,
841
+ params: { ...params, ...options?.params }
842
+ }
843
+ );
844
+ };
845
+ const customersProvisionZitadel = (orgSlug, provisionZitadelDto, options) => {
846
+ return axiosInstance.post(
847
+ `/v3/${orgSlug}/customers/zitadel/provision`,
848
+ provisionZitadelDto,
849
+ options
850
+ );
851
+ };
852
+ const customersGetCustomers = (orgSlug, params, options) => {
853
+ return axiosInstance.get(
854
+ `/v3/${orgSlug}/customers`,
855
+ {
856
+ ...options,
857
+ params: { ...params, ...options?.params }
858
+ }
859
+ );
860
+ };
861
+ const customersRegister = (orgSlug, registerCustomerDto, options) => {
862
+ return axiosInstance.post(
863
+ `/v3/${orgSlug}/customers/register`,
864
+ registerCustomerDto,
865
+ options
866
+ );
867
+ };
868
+ const customersUpdate = (orgSlug, id, updateCustomerDto, options) => {
869
+ return axiosInstance.patch(
870
+ `/v3/${orgSlug}/customers/${id}`,
871
+ updateCustomerDto,
872
+ options
873
+ );
874
+ };
875
+ const customersGetCustomerById = (orgSlug, id, options) => {
876
+ return axiosInstance.get(
877
+ `/v3/${orgSlug}/customers/${id}`,
878
+ options
879
+ );
880
+ };
881
+ const customersDelete = (orgSlug, id, options) => {
882
+ return axiosInstance.delete(
883
+ `/v3/${orgSlug}/customers/${id}`,
884
+ options
885
+ );
886
+ };
887
+ const customersGetAddresses = (orgSlug, id, options) => {
888
+ return axiosInstance.get(
889
+ `/v3/${orgSlug}/customers/${id}/addresses`,
890
+ options
891
+ );
892
+ };
893
+ const customersAddAddress = (orgSlug, id, addressDto, options) => {
894
+ return axiosInstance.post(
895
+ `/v3/${orgSlug}/customers/${id}/addresses`,
896
+ addressDto,
897
+ options
898
+ );
899
+ };
900
+ const businessAccountControllerCreate = (orgSlug, createBusinessAccountDto, options) => {
901
+ return axiosInstance.post(
902
+ `/v3/${orgSlug}/business-accounts`,
903
+ createBusinessAccountDto,
904
+ options
905
+ );
906
+ };
907
+ const businessAccountControllerGetOne = (orgSlug, id, options) => {
908
+ return axiosInstance.get(
909
+ `/v3/${orgSlug}/business-accounts/${id}`,
910
+ options
911
+ );
912
+ };
913
+ const crmControllerCreateRecord = (orgSlug, createCrmRecordDto, options) => {
914
+ return axiosInstance.post(
915
+ `/v3/${orgSlug}/crm/records`,
916
+ createCrmRecordDto,
917
+ options
918
+ );
919
+ };
920
+ const crmControllerGetRecord = (orgSlug, id, options) => {
921
+ return axiosInstance.get(
922
+ `/v3/${orgSlug}/crm/records/${id}`,
923
+ options
924
+ );
925
+ };
926
+ const crmControllerUpdateRecord = (orgSlug, id, updateCrmRecordDto, options) => {
927
+ return axiosInstance.patch(
928
+ `/v3/${orgSlug}/crm/records/${id}`,
929
+ updateCrmRecordDto,
930
+ options
931
+ );
932
+ };
933
+ const crmControllerCreateNote = (orgSlug, createCrmNoteDto, options) => {
934
+ return axiosInstance.post(
935
+ `/v3/${orgSlug}/crm/notes`,
936
+ createCrmNoteDto,
937
+ options
938
+ );
939
+ };
940
+ const crmControllerGetRecordNotes = (orgSlug, id, options) => {
941
+ return axiosInstance.get(
942
+ `/v3/${orgSlug}/crm/records/${id}/notes`,
943
+ options
944
+ );
945
+ };
946
+ const crmControllerCreateActivity = (orgSlug, createCrmActivityDto, options) => {
947
+ return axiosInstance.post(
948
+ `/v3/${orgSlug}/crm/activities`,
949
+ createCrmActivityDto,
950
+ options
951
+ );
952
+ };
953
+ const crmControllerGetTimeline = (orgSlug, id, options) => {
954
+ return axiosInstance.get(
955
+ `/v3/${orgSlug}/crm/records/${id}/timeline`,
956
+ options
957
+ );
958
+ };
959
+ const crmControllerCreateObject = (orgSlug, createCrmObjectDto, options) => {
960
+ return axiosInstance.post(
961
+ `/v3/${orgSlug}/crm/objects`,
962
+ createCrmObjectDto,
963
+ options
964
+ );
965
+ };
966
+ const crmControllerListObjects = (orgSlug, options) => {
967
+ return axiosInstance.get(
968
+ `/v3/${orgSlug}/crm/objects`,
969
+ options
970
+ );
971
+ };
972
+ const crmControllerCreateField = (orgSlug, objectId, createCrmFieldDto, options) => {
973
+ return axiosInstance.post(
974
+ `/v3/${orgSlug}/crm/objects/${objectId}/fields`,
975
+ createCrmFieldDto,
976
+ options
977
+ );
978
+ };
979
+ const crmControllerListFields = (orgSlug, objectId, options) => {
980
+ return axiosInstance.get(
981
+ `/v3/${orgSlug}/crm/objects/${objectId}/fields`,
982
+ options
983
+ );
984
+ };
985
+ const crmControllerCreateRelationship = (orgSlug, createCrmRelationshipDto, options) => {
986
+ return axiosInstance.post(
987
+ `/v3/${orgSlug}/crm/relationships`,
988
+ createCrmRelationshipDto,
989
+ options
990
+ );
991
+ };
992
+ const crmControllerListRelationships = (orgSlug, options) => {
993
+ return axiosInstance.get(
994
+ `/v3/${orgSlug}/crm/relationships`,
995
+ options
996
+ );
997
+ };
998
+ const crmControllerCreateAssociation = (orgSlug, createCrmAssociationDto, options) => {
999
+ return axiosInstance.post(
1000
+ `/v3/${orgSlug}/crm/associations`,
1001
+ createCrmAssociationDto,
1002
+ options
1003
+ );
1004
+ };
1005
+ const crmControllerListRecordAssociations = (orgSlug, id, options) => {
1006
+ return axiosInstance.get(
1007
+ `/v3/${orgSlug}/crm/records/${id}/associations`,
1008
+ options
1009
+ );
1010
+ };
1011
+ const loyaltyRedeemReward = (orgSlug, redeemRewardDto, options) => {
1012
+ return axiosInstance.post(
1013
+ `/v3/${orgSlug}/loyalty/vouchers/redeem`,
1014
+ redeemRewardDto,
1015
+ options
1016
+ );
1017
+ };
1018
+ const loyaltyGetCustomerStatus = (orgSlug, id, options) => {
1019
+ return axiosInstance.get(
1020
+ `/v3/${orgSlug}/loyalty/customers/${id}/status`,
1021
+ options
1022
+ );
1023
+ };
1024
+ const loyaltyValidateVoucher = (orgSlug, validateVoucherDto, options) => {
1025
+ return axiosInstance.post(
1026
+ `/v3/${orgSlug}/loyalty/vouchers/validate`,
1027
+ validateVoucherDto,
1028
+ options
1029
+ );
1030
+ };
1031
+ const ordersCreateOrder = (orgSlug, createOrderDto, options) => {
1032
+ return axiosInstance.post(
1033
+ `/v3/${orgSlug}/orders`,
1034
+ createOrderDto,
1035
+ options
1036
+ );
1037
+ };
1038
+ const ordersGetOrders = (orgSlug, params, options) => {
1039
+ return axiosInstance.get(
1040
+ `/v3/${orgSlug}/orders`,
1041
+ {
1042
+ ...options,
1043
+ params: { ...params, ...options?.params }
1044
+ }
1045
+ );
1046
+ };
1047
+ const ordersUpdateStatus = (orgSlug, id, updateOrderStatusDto, options) => {
1048
+ return axiosInstance.post(
1049
+ `/v3/${orgSlug}/orders/${id}/status`,
1050
+ updateOrderStatusDto,
1051
+ options
1052
+ );
1053
+ };
1054
+ const ordersRequestB2BQuote = (orgSlug, requestB2BQuoteDto, options) => {
1055
+ return axiosInstance.post(
1056
+ `/v3/${orgSlug}/orders/b2b/quotes`,
1057
+ requestB2BQuoteDto,
1058
+ options
1059
+ );
1060
+ };
1061
+ const ordersConvertQuoteToOrder = (orgSlug, id, options) => {
1062
+ return axiosInstance.post(
1063
+ `/v3/${orgSlug}/orders/b2b/quotes/${id}/convert`,
1064
+ void 0,
1065
+ options
1066
+ );
1067
+ };
1068
+ const paymentsControllerHandleStkCallback = (orgSlug, paymentId, options) => {
1069
+ return axiosInstance.post(
1070
+ `/v3/${orgSlug}/payments/webhooks/mpesa/stkpush/${paymentId}`,
1071
+ void 0,
1072
+ options
1073
+ );
1074
+ };
1075
+ const pOSProvision = (orgSlug, provisionDeviceDto, options) => {
1076
+ return axiosInstance.post(
1077
+ `/v3/${orgSlug}/pos/provision`,
1078
+ provisionDeviceDto,
1079
+ options
1080
+ );
1081
+ };
1082
+ const pOSLogin = (orgSlug, posLoginDto, options) => {
1083
+ return axiosInstance.post(
1084
+ `/v3/${orgSlug}/pos/login`,
1085
+ posLoginDto,
1086
+ options
1087
+ );
1088
+ };
1089
+ const pOSGetMe = (orgSlug, options) => {
1090
+ return axiosInstance.get(
1091
+ `/v3/${orgSlug}/pos/me`,
1092
+ options
1093
+ );
1094
+ };
1095
+ const pOSProcessSale = (orgSlug, processSaleDto, options) => {
1096
+ return axiosInstance.post(
1097
+ `/v3/${orgSlug}/pos/sale`,
1098
+ processSaleDto,
1099
+ options
1100
+ );
1101
+ };
1102
+ const pOSSync = (orgSlug, options) => {
1103
+ return axiosInstance.get(
1104
+ `/v3/${orgSlug}/pos/sync`,
1105
+ options
1106
+ );
1107
+ };
1108
+ const pOSGetTransactions = (orgSlug, options) => {
1109
+ return axiosInstance.get(
1110
+ `/v3/${orgSlug}/pos/transactions`,
1111
+ options
1112
+ );
1113
+ };
1114
+ const pOSRegisterPettyCash = (orgSlug, registerPettyCashDto, options) => {
1115
+ return axiosInstance.post(
1116
+ `/v3/${orgSlug}/pos/petty-cash`,
1117
+ registerPettyCashDto,
1118
+ options
1119
+ );
1120
+ };
1121
+ const pOSGetPettyCashFunds = (orgSlug, options) => {
1122
+ return axiosInstance.get(
1123
+ `/v3/${orgSlug}/pos/petty-cash/funds`,
1124
+ options
1125
+ );
1126
+ };
1127
+ const pOSGetPettyCashTransactions = (orgSlug, params, options) => {
1128
+ return axiosInstance.get(
1129
+ `/v3/${orgSlug}/pos/petty-cash/transactions`,
1130
+ {
1131
+ ...options,
1132
+ params: { ...params, ...options?.params }
1133
+ }
1134
+ );
1135
+ };
1136
+ const membersControllerGetMembers = (orgSlug, params, options) => {
1137
+ return axiosInstance.get(
1138
+ `/v3/${orgSlug}/members`,
1139
+ {
1140
+ ...options,
1141
+ params: { ...params, ...options?.params }
1142
+ }
1143
+ );
1144
+ };
1145
+ const membersControllerCreateMember = (orgSlug, createMemberDto, options) => {
1146
+ return axiosInstance.post(
1147
+ `/v3/${orgSlug}/members`,
1148
+ createMemberDto,
1149
+ options
1150
+ );
1151
+ };
1152
+ const membersControllerGetMember = (orgSlug, id, options) => {
1153
+ return axiosInstance.get(
1154
+ `/v3/${orgSlug}/members/${id}`,
1155
+ options
1156
+ );
1157
+ };
1158
+ const membersControllerUpdateMember = (orgSlug, id, updateMemberDto, options) => {
1159
+ return axiosInstance.patch(
1160
+ `/v3/${orgSlug}/members/${id}`,
1161
+ updateMemberDto,
1162
+ options
1163
+ );
1164
+ };
1165
+ const membersControllerDeleteMember = (orgSlug, id, options) => {
1166
+ return axiosInstance.delete(
1167
+ `/v3/${orgSlug}/members/${id}`,
1168
+ options
1169
+ );
1170
+ };
1171
+ const membersControllerGetMemberActivity = (orgSlug, id, options) => {
1172
+ return axiosInstance.get(
1173
+ `/v3/${orgSlug}/members/${id}/activity`,
1174
+ options
1175
+ );
1176
+ };
1177
+ const membersControllerUpdateStatus = (orgSlug, id, options) => {
1178
+ return axiosInstance.patch(
1179
+ `/v3/${orgSlug}/members/${id}/status`,
1180
+ void 0,
1181
+ options
1182
+ );
1183
+ };
1184
+ const membersControllerAdminCheckOut = (orgSlug, memberId, checkOutDto, options) => {
1185
+ return axiosInstance.post(
1186
+ `/v3/${orgSlug}/members/${memberId}/attendance/check-out`,
1187
+ checkOutDto,
1188
+ options
1189
+ );
1190
+ };
1191
+ const terminalMembersControllerLogin = (terminalLoginDto, options) => {
1192
+ return axiosInstance.post(
1193
+ `/v3/members/login`,
1194
+ terminalLoginDto,
1195
+ options
1196
+ );
1197
+ };
1198
+ const invitationsList = (orgSlug, params, options) => {
1199
+ return axiosInstance.get(
1200
+ `/v3/${orgSlug}/members/invitations`,
1201
+ {
1202
+ ...options,
1203
+ params: { ...params, ...options?.params }
1204
+ }
1205
+ );
1206
+ };
1207
+ const invitationsCreate = (orgSlug, createInvitationDto, options) => {
1208
+ return axiosInstance.post(
1209
+ `/v3/${orgSlug}/members/invitations`,
1210
+ createInvitationDto,
1211
+ options
1212
+ );
1213
+ };
1214
+ const invitationsRevoke = (orgSlug, id, options) => {
1215
+ return axiosInstance.delete(
1216
+ `/v3/${orgSlug}/members/invitations/${id}`,
1217
+ options
1218
+ );
1219
+ };
1220
+ const invitationsAccept = (orgSlug, acceptInvitationDto, options) => {
1221
+ return axiosInstance.post(
1222
+ `/v3/${orgSlug}/members/invitations/accept`,
1223
+ acceptInvitationDto,
1224
+ options
1225
+ );
1226
+ };
1227
+ const roleManagementControllerGetCustomRoles = (orgSlug, params, options) => {
1228
+ return axiosInstance.get(
1229
+ `/v3/${orgSlug}/members/roles/custom`,
1230
+ {
1231
+ ...options,
1232
+ params: { ...params, ...options?.params }
1233
+ }
1234
+ );
1235
+ };
1236
+ const roleManagementControllerCreateCustomRole = (orgSlug, createCustomRoleDto, options) => {
1237
+ return axiosInstance.post(
1238
+ `/v3/${orgSlug}/members/roles/custom`,
1239
+ createCustomRoleDto,
1240
+ options
1241
+ );
1242
+ };
1243
+ const roleManagementControllerUpdateCustomRole = (orgSlug, id, updateCustomRoleDto, options) => {
1244
+ return axiosInstance.patch(
1245
+ `/v3/${orgSlug}/members/roles/custom/${id}`,
1246
+ updateCustomRoleDto,
1247
+ options
1248
+ );
1249
+ };
1250
+ const roleManagementControllerDeleteCustomRole = (orgSlug, id, options) => {
1251
+ return axiosInstance.delete(
1252
+ `/v3/${orgSlug}/members/roles/custom/${id}`,
1253
+ options
1254
+ );
1255
+ };
1256
+ const roleManagementControllerGetPermissionSets = (orgSlug, options) => {
1257
+ return axiosInstance.get(
1258
+ `/v3/${orgSlug}/members/roles/permission-sets`,
1259
+ options
1260
+ );
1261
+ };
1262
+ const roleManagementControllerCreatePermissionSet = (orgSlug, createPermissionSetDto, options) => {
1263
+ return axiosInstance.post(
1264
+ `/v3/${orgSlug}/members/roles/permission-sets`,
1265
+ createPermissionSetDto,
1266
+ options
1267
+ );
1268
+ };
1269
+ const roleManagementControllerGetRoleGroups = (orgSlug, options) => {
1270
+ return axiosInstance.get(
1271
+ `/v3/${orgSlug}/members/roles/groups`,
1272
+ options
1273
+ );
1274
+ };
1275
+ const roleManagementControllerCreateRoleGroup = (orgSlug, createRoleGroupDto, options) => {
1276
+ return axiosInstance.post(
1277
+ `/v3/${orgSlug}/members/roles/groups`,
1278
+ createRoleGroupDto,
1279
+ options
1280
+ );
1281
+ };
1282
+ const roleManagementControllerAssignRoles = (orgSlug, memberId, options) => {
1283
+ return axiosInstance.post(
1284
+ `/v3/${orgSlug}/members/roles/member/${memberId}/assign`,
1285
+ void 0,
1286
+ options
1287
+ );
1288
+ };
1289
+ const roleManagementControllerRemoveRoles = (orgSlug, memberId, options) => {
1290
+ return axiosInstance.post(
1291
+ `/v3/${orgSlug}/members/roles/member/${memberId}/remove`,
1292
+ void 0,
1293
+ options
1294
+ );
1295
+ };
1296
+ const departmentsList = (orgSlug, params, options) => {
1297
+ return axiosInstance.get(
1298
+ `/v3/${orgSlug}/members/departments`,
1299
+ {
1300
+ ...options,
1301
+ params: { ...params, ...options?.params }
1302
+ }
1303
+ );
1304
+ };
1305
+ const departmentsCreate = (orgSlug, createDepartmentDto, options) => {
1306
+ return axiosInstance.post(
1307
+ `/v3/${orgSlug}/members/departments`,
1308
+ createDepartmentDto,
1309
+ options
1310
+ );
1311
+ };
1312
+ const departmentsGet = (orgSlug, id, options) => {
1313
+ return axiosInstance.get(
1314
+ `/v3/${orgSlug}/members/departments/${id}`,
1315
+ options
1316
+ );
1317
+ };
1318
+ const departmentsUpdate = (orgSlug, id, updateDepartmentDto, options) => {
1319
+ return axiosInstance.patch(
1320
+ `/v3/${orgSlug}/members/departments/${id}`,
1321
+ updateDepartmentDto,
1322
+ options
1323
+ );
1324
+ };
1325
+ const departmentsDelete = (orgSlug, id, options) => {
1326
+ return axiosInstance.delete(
1327
+ `/v3/${orgSlug}/members/departments/${id}`,
1328
+ options
1329
+ );
1330
+ };
1331
+ const departmentsAddMember = (orgSlug, id, addDepartmentMemberDto, options) => {
1332
+ return axiosInstance.post(
1333
+ `/v3/${orgSlug}/members/departments/${id}/members`,
1334
+ addDepartmentMemberDto,
1335
+ options
1336
+ );
1337
+ };
1338
+ const departmentsRemoveMember = (orgSlug, id, memberId, options) => {
1339
+ return axiosInstance.delete(
1340
+ `/v3/${orgSlug}/members/departments/${id}/members/${memberId}`,
1341
+ options
1342
+ );
1343
+ };
1344
+ const attendanceControllerGetLogs = (orgSlug, params, options) => {
1345
+ return axiosInstance.get(
1346
+ `/v3/${orgSlug}/members/attendance/logs`,
1347
+ {
1348
+ ...options,
1349
+ params: { ...params, ...options?.params }
1350
+ }
1351
+ );
1352
+ };
1353
+ const attendanceControllerCheckIn = (orgSlug, checkInDto, options) => {
1354
+ return axiosInstance.post(
1355
+ `/v3/${orgSlug}/members/attendance/check-in`,
1356
+ checkInDto,
1357
+ options
1358
+ );
1359
+ };
1360
+ const attendanceControllerCheckOut = (orgSlug, checkOutDto, options) => {
1361
+ return axiosInstance.post(
1362
+ `/v3/${orgSlug}/members/attendance/check-out`,
1363
+ checkOutDto,
1364
+ options
1365
+ );
1366
+ };
1367
+ const attendanceControllerGetMyStatus = (orgSlug, options) => {
1368
+ return axiosInstance.get(
1369
+ `/v3/${orgSlug}/members/attendance/me/status`,
1370
+ options
1371
+ );
1372
+ };
1373
+ const attendanceControllerGetStatus = (orgSlug, memberId, options) => {
1374
+ return axiosInstance.get(
1375
+ `/v3/${orgSlug}/members/attendance/${memberId}/status`,
1376
+ options
1377
+ );
1378
+ };
1379
+ const announcementControllerBroadcastAnnouncement = (orgSlug, announcementDto, options) => {
1380
+ return axiosInstance.post(
1381
+ `/v3/${orgSlug}/announcements`,
1382
+ announcementDto,
1383
+ options
1384
+ );
1385
+ };
1386
+ const cartControllerGetCart = (orgSlug, params, options) => {
1387
+ return axiosInstance.get(
1388
+ `/v3/${orgSlug}/cart`,
1389
+ {
1390
+ ...options,
1391
+ params: { ...params, ...options?.params }
1392
+ }
1393
+ );
1394
+ };
1395
+ const cartControllerClearCart = (orgSlug, params, options) => {
1396
+ return axiosInstance.delete(
1397
+ `/v3/${orgSlug}/cart`,
1398
+ {
1399
+ ...options,
1400
+ params: { ...params, ...options?.params }
1401
+ }
1402
+ );
1403
+ };
1404
+ const cartControllerAddToCart = (orgSlug, addToCartDto, options) => {
1405
+ return axiosInstance.post(
1406
+ `/v3/${orgSlug}/cart/items`,
1407
+ addToCartDto,
1408
+ options
1409
+ );
1410
+ };
1411
+ const cartControllerRemoveFromCart = (orgSlug, removeFromCartDto, options) => {
1412
+ return axiosInstance.delete(
1413
+ `/v3/${orgSlug}/cart/items`,
1414
+ { data: removeFromCartDto, ...options }
1415
+ );
1416
+ };
1417
+ const favoritesControllerGetFavorites = (orgSlug, options) => {
1418
+ return axiosInstance.get(
1419
+ `/v3/${orgSlug}/favorites`,
1420
+ options
1421
+ );
1422
+ };
1423
+ const favoritesControllerAddFavorite = (orgSlug, favoriteDto, options) => {
1424
+ return axiosInstance.post(
1425
+ `/v3/${orgSlug}/favorites`,
1426
+ favoriteDto,
1427
+ options
1428
+ );
1429
+ };
1430
+ const favoritesControllerRemoveFavorite = (orgSlug, favoriteDto, options) => {
1431
+ return axiosInstance.delete(
1432
+ `/v3/${orgSlug}/favorites`,
1433
+ { data: favoriteDto, ...options }
1434
+ );
1435
+ };
1436
+ const stockingGetPurchases = (orgSlug, params, options) => {
1437
+ return axiosInstance.get(
1438
+ `/v3/${orgSlug}/stocking/purchases`,
1439
+ {
1440
+ ...options,
1441
+ params: { ...params, ...options?.params }
1442
+ }
1443
+ );
1444
+ };
1445
+ const stockingCreatePurchase = (orgSlug, createPurchaseDto, options) => {
1446
+ return axiosInstance.post(
1447
+ `/v3/${orgSlug}/stocking/purchases`,
1448
+ createPurchaseDto,
1449
+ options
1450
+ );
1451
+ };
1452
+ const stockingReceivePurchase = (orgSlug, id, receivePurchaseDto, options) => {
1453
+ return axiosInstance.post(
1454
+ `/v3/${orgSlug}/stocking/purchases/${id}/receive`,
1455
+ receivePurchaseDto,
1456
+ options
1457
+ );
1458
+ };
1459
+ const stockingGetTransfers = (orgSlug, params, options) => {
1460
+ return axiosInstance.get(
1461
+ `/v3/${orgSlug}/stocking/transfers`,
1462
+ {
1463
+ ...options,
1464
+ params: { ...params, ...options?.params }
1465
+ }
1466
+ );
1467
+ };
1468
+ const stockingCreateTransfer = (orgSlug, createTransferDto, options) => {
1469
+ return axiosInstance.post(
1470
+ `/v3/${orgSlug}/stocking/transfers`,
1471
+ createTransferDto,
1472
+ options
1473
+ );
1474
+ };
1475
+ const stockingShipTransfer = (orgSlug, id, shipTransferDto, options) => {
1476
+ return axiosInstance.post(
1477
+ `/v3/${orgSlug}/stocking/transfers/${id}/ship`,
1478
+ shipTransferDto,
1479
+ options
1480
+ );
1481
+ };
1482
+ const stockingReceiveTransfer = (orgSlug, id, receiveTransferDto, options) => {
1483
+ return axiosInstance.post(
1484
+ `/v3/${orgSlug}/stocking/transfers/${id}/receive`,
1485
+ receiveTransferDto,
1486
+ options
1487
+ );
1488
+ };
1489
+ const stockingGetRequests = (orgSlug, params, options) => {
1490
+ return axiosInstance.get(
1491
+ `/v3/${orgSlug}/stocking/requests`,
1492
+ {
1493
+ ...options,
1494
+ params: { ...params, ...options?.params }
1495
+ }
1496
+ );
1497
+ };
1498
+ const stockingGetPendingDispatch = (orgSlug, params, options) => {
1499
+ return axiosInstance.get(
1500
+ `/v3/${orgSlug}/stocking/reconciliation/pending-dispatch`,
1501
+ {
1502
+ ...options,
1503
+ params: { ...params, ...options?.params }
1504
+ }
1505
+ );
1506
+ };
1507
+ const stockingDispatchOrders = (orgSlug, dispatchOrderDto, options) => {
1508
+ return axiosInstance.post(
1509
+ `/v3/${orgSlug}/stocking/reconciliation/dispatch`,
1510
+ dispatchOrderDto,
1511
+ options
1512
+ );
1513
+ };
1514
+ const stockingGetActiveDeliveries = (orgSlug, params, options) => {
1515
+ return axiosInstance.get(
1516
+ `/v3/${orgSlug}/stocking/reconciliation/active-deliveries`,
1517
+ {
1518
+ ...options,
1519
+ params: { ...params, ...options?.params }
1520
+ }
1521
+ );
1522
+ };
1523
+ const stockingReconcilePod = (orgSlug, reconcilePodDto, options) => {
1524
+ return axiosInstance.post(
1525
+ `/v3/${orgSlug}/stocking/reconciliation/reconcile-pod`,
1526
+ reconcilePodDto,
1527
+ options
1528
+ );
1529
+ };
1530
+ const stockingGetPhysicalReconciliations = (orgSlug, params, options) => {
1531
+ return axiosInstance.get(
1532
+ `/v3/${orgSlug}/stocking/physical-reconciliations`,
1533
+ {
1534
+ ...options,
1535
+ params: { ...params, ...options?.params }
1536
+ }
1537
+ );
1538
+ };
1539
+ const stockingSubmitPhysicalReconciliation = (orgSlug, submitReconciliationDto, options) => {
1540
+ return axiosInstance.post(
1541
+ `/v3/${orgSlug}/stocking/physical-reconciliations`,
1542
+ submitReconciliationDto,
1543
+ options
1544
+ );
1545
+ };
1546
+ const stockingGetReconciliationReport = (orgSlug, id, options) => {
1547
+ return axiosInstance.get(
1548
+ `/v3/${orgSlug}/stocking/physical-reconciliations/${id}/report`,
1549
+ options
1550
+ );
1551
+ };
1552
+ const stockingGetPartners = (orgSlug, options) => {
1553
+ return axiosInstance.get(
1554
+ `/v3/${orgSlug}/stocking/partners`,
1555
+ options
1556
+ );
1557
+ };
1558
+ const stockingCreatePartner = (orgSlug, createPartnerDto, options) => {
1559
+ return axiosInstance.post(
1560
+ `/v3/${orgSlug}/stocking/partners`,
1561
+ createPartnerDto,
1562
+ options
1563
+ );
1564
+ };
1565
+ const stockingGetPartner = (orgSlug, id, options) => {
1566
+ return axiosInstance.get(
1567
+ `/v3/${orgSlug}/stocking/partners/${id}`,
1568
+ options
1569
+ );
1570
+ };
1571
+ const stockingUpdatePartner = (orgSlug, id, updatePartnerDto, options) => {
1572
+ return axiosInstance.patch(
1573
+ `/v3/${orgSlug}/stocking/partners/${id}`,
1574
+ updatePartnerDto,
1575
+ options
1576
+ );
1577
+ };
1578
+ const stockingAdjustPartnerWallet = (orgSlug, id, partnerWalletActionDto, options) => {
1579
+ return axiosInstance.post(
1580
+ `/v3/${orgSlug}/stocking/partners/${id}/wallet/adjust`,
1581
+ partnerWalletActionDto,
1582
+ options
1583
+ );
1584
+ };
1585
+ const standalonePosControllerCreateSetupKey = (createSetupKeyDto, options) => {
1586
+ return axiosInstance.post(
1587
+ `/v3/standalone-pos/setup-keys`,
1588
+ createSetupKeyDto,
1589
+ options
1590
+ );
1591
+ };
1592
+ const standalonePosControllerActivateDevice = (activateDeviceDto, options) => {
1593
+ return axiosInstance.post(
1594
+ `/v3/standalone-pos/activate`,
1595
+ activateDeviceDto,
1596
+ options
1597
+ );
1598
+ };
1599
+ const standalonePosControllerValidateKey = (options) => {
1600
+ return axiosInstance.get(
1601
+ `/v3/standalone-pos/validate`,
1602
+ options
1603
+ );
1604
+ };
1605
+ const standalonePosControllerLinkOrganization = (linkOrganizationDto, options) => {
1606
+ return axiosInstance.patch(
1607
+ `/v3/standalone-pos/link-org`,
1608
+ linkOrganizationDto,
1609
+ options
1610
+ );
1611
+ };
1612
+ const b2BGetCatalog = (orgSlug, params, options) => {
1613
+ return axiosInstance.get(
1614
+ `/v3/${orgSlug}/b2b/catalog`,
1615
+ {
1616
+ ...options,
1617
+ params: { ...params, ...options?.params }
1618
+ }
1619
+ );
1620
+ };
1621
+ const b2BGetInvoices = (orgSlug, options) => {
1622
+ return axiosInstance.get(
1623
+ `/v3/${orgSlug}/b2b/invoices`,
1624
+ options
1625
+ );
1626
+ };
1627
+ const b2BGetOrders = (orgSlug, options) => {
1628
+ return axiosInstance.get(
1629
+ `/v3/${orgSlug}/b2b/orders`,
1630
+ options
1631
+ );
1632
+ };
1633
+ const b2BCreateOrder = (orgSlug, createB2BOrderDto, options) => {
1634
+ return axiosInstance.post(
1635
+ `/v3/${orgSlug}/b2b/orders`,
1636
+ createB2BOrderDto,
1637
+ options
1638
+ );
1639
+ };
1640
+ const b2BCreateQuote = (orgSlug, createB2BOrderDto, options) => {
1641
+ return axiosInstance.post(
1642
+ `/v3/${orgSlug}/b2b/quotes`,
1643
+ createB2BOrderDto,
1644
+ options
1645
+ );
1646
+ };
1647
+ const crmIntegrationsGetAuthUrl = (orgSlug, provider, options) => {
1648
+ return axiosInstance.get(
1649
+ `/v3/${orgSlug}/crm-integrations/${provider}/auth`,
1650
+ options
1651
+ );
1652
+ };
1653
+ const crmIntegrationsHandleCallback = (orgSlug, provider, params, options) => {
1654
+ return axiosInstance.get(
1655
+ `/v3/${orgSlug}/crm-integrations/${provider}/callback`,
1656
+ {
1657
+ ...options,
1658
+ params: { ...params, ...options?.params }
1659
+ }
1660
+ );
1661
+ };
1662
+ const crmIntegrationsHandleWebhook = (orgSlug, provider, options) => {
1663
+ return axiosInstance.post(
1664
+ `/v3/${orgSlug}/crm-integrations/${provider}/webhook`,
1665
+ void 0,
1666
+ options
1667
+ );
1668
+ };
1669
+ const crmIntegrationsReplyToActivity = (orgSlug, id, options) => {
1670
+ return axiosInstance.post(
1671
+ `/v3/${orgSlug}/crm-integrations/activities/${id}/reply`,
1672
+ void 0,
1673
+ options
1674
+ );
1675
+ };
1676
+ const unitsGetUnits = (orgSlug, params, options) => {
1677
+ return axiosInstance.get(
1678
+ `/v3/${orgSlug}/units`,
1679
+ {
1680
+ ...options,
1681
+ params: { ...params, ...options?.params }
1682
+ }
1683
+ );
1684
+ };
1685
+ const strapiCreateConnection = (orgSlug, createStrapiConnectionDto, options) => {
1686
+ return axiosInstance.post(
1687
+ `/v3/${orgSlug}/strapi/connections`,
1688
+ createStrapiConnectionDto,
1689
+ options
1690
+ );
1691
+ };
1692
+ const strapiListConnections = (orgSlug, options) => {
1693
+ return axiosInstance.get(
1694
+ `/v3/${orgSlug}/strapi/connections`,
1695
+ options
1696
+ );
1697
+ };
1698
+ const strapiGetConnection = (orgSlug, connectionId, options) => {
1699
+ return axiosInstance.get(
1700
+ `/v3/${orgSlug}/strapi/connections/${connectionId}`,
1701
+ options
1702
+ );
1703
+ };
1704
+ const strapiUpdateConnection = (orgSlug, connectionId, updateStrapiConnectionDto, options) => {
1705
+ return axiosInstance.patch(
1706
+ `/v3/${orgSlug}/strapi/connections/${connectionId}`,
1707
+ updateStrapiConnectionDto,
1708
+ options
1709
+ );
1710
+ };
1711
+ const strapiDeleteConnection = (orgSlug, connectionId, options) => {
1712
+ return axiosInstance.delete(
1713
+ `/v3/${orgSlug}/strapi/connections/${connectionId}`,
1714
+ options
1715
+ );
1716
+ };
1717
+ const strapiTriggerSync = (orgSlug, connectionId, triggerSyncDto, options) => {
1718
+ return axiosInstance.post(
1719
+ `/v3/${orgSlug}/strapi/connections/${connectionId}/sync`,
1720
+ triggerSyncDto,
1721
+ options
1722
+ );
1723
+ };
1724
+ const strapiEnqueueSync = (orgSlug, connectionId, triggerSyncDto, options) => {
1725
+ return axiosInstance.post(
1726
+ `/v3/${orgSlug}/strapi/connections/${connectionId}/sync/queue`,
1727
+ triggerSyncDto,
1728
+ options
1729
+ );
1730
+ };
1731
+ const strapiGetWebhookLogs = (orgSlug, connectionId, options) => {
1732
+ return axiosInstance.get(
1733
+ `/v3/${orgSlug}/strapi/connections/${connectionId}/webhook-logs`,
1734
+ options
1735
+ );
1736
+ };
1737
+ const strapiGetSyncLogs = (orgSlug, connectionId, options) => {
1738
+ return axiosInstance.get(
1739
+ `/v3/${orgSlug}/strapi/connections/${connectionId}/sync-logs`,
1740
+ options
1741
+ );
1742
+ };
1743
+ const strapiExchangeCustomerToken = (orgSlug, connectionId, options) => {
1744
+ return axiosInstance.post(
1745
+ `/v3/${orgSlug}/strapi/connections/${connectionId}/customers/exchange-token`,
1746
+ void 0,
1747
+ options
1748
+ );
1749
+ };
1750
+ const strapiRegisterCustomer = (orgSlug, connectionId, options) => {
1751
+ return axiosInstance.post(
1752
+ `/v3/${orgSlug}/strapi/connections/${connectionId}/customers/register`,
1753
+ void 0,
1754
+ options
1755
+ );
1756
+ };
1757
+ const strapiReceiveWebhook = (connectionId, options) => {
1758
+ return axiosInstance.post(
1759
+ `/v3/webhooks/strapi/${connectionId}`,
1760
+ void 0,
1761
+ options
1762
+ );
1763
+ };
1764
+ const analyticsControllerGetDashboardAnalytics = (orgSlug, options) => {
1765
+ return axiosInstance.get(
1766
+ `/v3/${orgSlug}/analytics/dashboard`,
1767
+ options
1768
+ );
1769
+ };
1770
+ const analyticsControllerGetResourceUtilization = (orgSlug, params, options) => {
1771
+ return axiosInstance.get(
1772
+ `/v3/${orgSlug}/analytics/utilization`,
1773
+ {
1774
+ ...options,
1775
+ params: { ...params, ...options?.params }
1776
+ }
1777
+ );
1778
+ };
1779
+ return { inventoryVerifyIntegrity, inventoryFixIntegrity, inventoryGetInventory, inventoryTraceBatch, inventorySplitBatch, inventoryMergeBatches, inventoryCreateAssembly, inventoryCompleteAssembly, inventoryRequestAdjustment, inventoryGetAdjustments, inventoryApproveAdjustment, inventoryRejectAdjustment, inventoryGetLeadTime, inventoryGetWasteAnalysis, inventoryCheckB2BAvailability, inventoryUnpackBatch, inventoryScanUnpackBatch, inventoryQuickStockInquiry, expenseControllerCreateExpense, expenseControllerGetExpenses, expenseControllerGetExpenseCategories, expenseControllerGetExpense, pettyCashControllerCreateFund, pettyCashControllerGetFunds, pettyCashControllerGetFund, pettyCashControllerTopUpFund, pettyCashControllerGetFundTransactions, utilityAccountControllerCreateAccount, utilityAccountControllerGetAccounts, utilityAccountControllerGetAccount, accountingInitialize, accountingGetProfitLoss, accountingGetBalanceSheet, accountingGetCashFlow, accountingGetTaxSummary, invoiceControllerCreateInvoice, invoiceControllerGetInvoices, invoiceControllerGetInvoice, invoiceControllerUpdateInvoice, invoiceControllerDeleteInvoice, invoiceControllerFinalizeInvoice, invoiceControllerGetTemplates, invoiceControllerCreateTemplate, invoiceControllerGetConfig, invoiceControllerUpdateConfig, publicInvoiceControllerDownloadInvoice, publicInvoiceControllerDownloadInvoiceByTransaction, publicInvoiceControllerDownloadReceipt, publicInvoiceControllerGeneratePublicLink, authExchangeToken, authControllerHandleOAuth2, adminControllerGetStats, adminControllerListOrganizations, adminControllerCreateOrganization, adminControllerGetOrganizationDetails, adminControllerUpdateOrganization, adminControllerDeleteOrganization, adminControllerListMembers, adminControllerListUsers, adminControllerBanUser, adminControllerUnbanUser, adminControllerListConnectedApps, adminControllerListSystemLogs, adminControllerListGlobalSettings, adminControllerSetGlobalSetting, adminControllerDeleteGlobalSetting, adminControllerListTiers, adminControllerDefineTier, adminControllerDeleteTier, adminControllerGetOrganizationSubscription, adminControllerUpdateOrganizationSubscription, adminControllerListSystemPayments, adminControllerRecordCustomPayment, adminControllerListIntegrationDefinitions, adminControllerCreateIntegrationDefinition, adminControllerUpdateIntegrationDefinition, adminControllerDeleteIntegrationDefinition, adminControllerListActiveOrganizationIntegrations, webhooksCreate, webhooksList, webhooksDelete, windmillCallbackControllerHandleCallback, windmillCallbackControllerHandleApprovalCallback, windmillCallbackControllerHandleBakeryDisposalCallback, windmillCallbackControllerHandleOutcomeCallback, catalogGetProducts, catalogCreateProduct, catalogGetServices, catalogUpdateProduct, catalogUpdateSupplierVariant, catalogGetPriceChangeRequests, catalogReviewPriceChangeRequest, servicesCreateCategory, servicesGetCategories, servicesUpdateCategory, servicesDeleteCategory, servicesCreateService, servicesGetServices, servicesGetCurrentMemberShifts, servicesGetShifts, servicesGetService, servicesUpdateService, servicesDeleteService, servicesCreateResource, servicesGetResources, servicesUpdateResource, servicesDeleteResource, servicesCreateBooking, servicesGetBookings, servicesGetBooking, servicesUpdateBookingStatus, servicesCompleteBooking, servicesCreateShift, servicesGetStaffShifts, servicesAddBreak, servicesRegisterCustomerApp, servicesGetUtilization, servicesGetPerformance, servicesGetFunnel, customersProvisionZitadel, customersGetCustomers, customersRegister, customersUpdate, customersGetCustomerById, customersDelete, customersGetAddresses, customersAddAddress, businessAccountControllerCreate, businessAccountControllerGetOne, crmControllerCreateRecord, crmControllerGetRecord, crmControllerUpdateRecord, crmControllerCreateNote, crmControllerGetRecordNotes, crmControllerCreateActivity, crmControllerGetTimeline, crmControllerCreateObject, crmControllerListObjects, crmControllerCreateField, crmControllerListFields, crmControllerCreateRelationship, crmControllerListRelationships, crmControllerCreateAssociation, crmControllerListRecordAssociations, loyaltyRedeemReward, loyaltyGetCustomerStatus, loyaltyValidateVoucher, ordersCreateOrder, ordersGetOrders, ordersUpdateStatus, ordersRequestB2BQuote, ordersConvertQuoteToOrder, paymentsControllerHandleStkCallback, pOSProvision, pOSLogin, pOSGetMe, pOSProcessSale, pOSSync, pOSGetTransactions, pOSRegisterPettyCash, pOSGetPettyCashFunds, pOSGetPettyCashTransactions, membersControllerGetMembers, membersControllerCreateMember, membersControllerGetMember, membersControllerUpdateMember, membersControllerDeleteMember, membersControllerGetMemberActivity, membersControllerUpdateStatus, membersControllerAdminCheckOut, terminalMembersControllerLogin, invitationsList, invitationsCreate, invitationsRevoke, invitationsAccept, roleManagementControllerGetCustomRoles, roleManagementControllerCreateCustomRole, roleManagementControllerUpdateCustomRole, roleManagementControllerDeleteCustomRole, roleManagementControllerGetPermissionSets, roleManagementControllerCreatePermissionSet, roleManagementControllerGetRoleGroups, roleManagementControllerCreateRoleGroup, roleManagementControllerAssignRoles, roleManagementControllerRemoveRoles, departmentsList, departmentsCreate, departmentsGet, departmentsUpdate, departmentsDelete, departmentsAddMember, departmentsRemoveMember, attendanceControllerGetLogs, attendanceControllerCheckIn, attendanceControllerCheckOut, attendanceControllerGetMyStatus, attendanceControllerGetStatus, announcementControllerBroadcastAnnouncement, cartControllerGetCart, cartControllerClearCart, cartControllerAddToCart, cartControllerRemoveFromCart, favoritesControllerGetFavorites, favoritesControllerAddFavorite, favoritesControllerRemoveFavorite, stockingGetPurchases, stockingCreatePurchase, stockingReceivePurchase, stockingGetTransfers, stockingCreateTransfer, stockingShipTransfer, stockingReceiveTransfer, stockingGetRequests, stockingGetPendingDispatch, stockingDispatchOrders, stockingGetActiveDeliveries, stockingReconcilePod, stockingGetPhysicalReconciliations, stockingSubmitPhysicalReconciliation, stockingGetReconciliationReport, stockingGetPartners, stockingCreatePartner, stockingGetPartner, stockingUpdatePartner, stockingAdjustPartnerWallet, standalonePosControllerCreateSetupKey, standalonePosControllerActivateDevice, standalonePosControllerValidateKey, standalonePosControllerLinkOrganization, b2BGetCatalog, b2BGetInvoices, b2BGetOrders, b2BCreateOrder, b2BCreateQuote, crmIntegrationsGetAuthUrl, crmIntegrationsHandleCallback, crmIntegrationsHandleWebhook, crmIntegrationsReplyToActivity, unitsGetUnits, strapiCreateConnection, strapiListConnections, strapiGetConnection, strapiUpdateConnection, strapiDeleteConnection, strapiTriggerSync, strapiEnqueueSync, strapiGetWebhookLogs, strapiGetSyncLogs, strapiExchangeCustomerToken, strapiRegisterCustomer, strapiReceiveWebhook, analyticsControllerGetDashboardAnalytics, analyticsControllerGetResourceUtilization };
1780
+ };
1781
+
1782
+ // src/generated/model/addDepartmentMemberDtoRole.ts
1783
+ var AddDepartmentMemberDtoRole = {
1784
+ HEAD: "HEAD",
1785
+ MANAGER: "MANAGER",
1786
+ MEMBER: "MEMBER",
1787
+ VIEWER: "VIEWER"
1788
+ };
1789
+
1790
+ // src/generated/model/attendanceControllerGetLogsSortOrder.ts
1791
+ var AttendanceControllerGetLogsSortOrder = {
1792
+ asc: "asc",
1793
+ desc: "desc"
1794
+ };
1795
+
1796
+ // src/generated/model/cmsCustomFieldsDtoPublishStatus.ts
1797
+ var CmsCustomFieldsDtoPublishStatus = {
1798
+ Draft: "Draft",
1799
+ Published: "Published",
1800
+ Scheduled: "Scheduled",
1801
+ Archived: "Archived"
1802
+ };
1803
+
1804
+ // src/generated/model/createCrmFieldDtoType.ts
1805
+ var CreateCrmFieldDtoType = {
1806
+ TEXT: "TEXT",
1807
+ NUMBER: "NUMBER",
1808
+ BOOLEAN: "BOOLEAN",
1809
+ DATE: "DATE",
1810
+ SELECT: "SELECT",
1811
+ MULTI_SELECT: "MULTI_SELECT",
1812
+ EMAIL: "EMAIL",
1813
+ PHONE: "PHONE",
1814
+ URL: "URL",
1815
+ JSON: "JSON"
1816
+ };
1817
+
1818
+ // src/generated/model/createCrmRelationshipDtoType.ts
1819
+ var CreateCrmRelationshipDtoType = {
1820
+ ONE_TO_ONE: "ONE_TO_ONE",
1821
+ ONE_TO_MANY: "ONE_TO_MANY",
1822
+ MANY_TO_MANY: "MANY_TO_MANY"
1823
+ };
1824
+
1825
+ // src/generated/model/createExpenseDtoPaymentMethod.ts
1826
+ var CreateExpenseDtoPaymentMethod = {
1827
+ CASH: "CASH",
1828
+ CREDIT: "CREDIT",
1829
+ CARD: "CARD",
1830
+ MOBILE_PAYMENT: "MOBILE_PAYMENT",
1831
+ MPESA_C2B: "MPESA_C2B",
1832
+ BANK_TRANSFER: "BANK_TRANSFER",
1833
+ CHEQUE: "CHEQUE",
1834
+ STORE_CREDIT: "STORE_CREDIT",
1835
+ GIFT_CARD: "GIFT_CARD",
1836
+ LOYALTY_POINTS: "LOYALTY_POINTS",
1837
+ ON_ACCOUNT: "ON_ACCOUNT",
1838
+ MPESA: "MPESA",
1839
+ OTHER: "OTHER"
1840
+ };
1841
+
1842
+ // src/generated/model/createIntegrationDefinitionDtoAuthType.ts
1843
+ var CreateIntegrationDefinitionDtoAuthType = {
1844
+ API_KEY: "API_KEY",
1845
+ OAUTH2: "OAUTH2",
1846
+ OTHER: "OTHER"
1847
+ };
1848
+
1849
+ // src/generated/model/createIntegrationDefinitionDtoCategory.ts
1850
+ var CreateIntegrationDefinitionDtoCategory = {
1851
+ E_COMMERCE: "E_COMMERCE",
1852
+ ACCOUNTING: "ACCOUNTING",
1853
+ MARKETING: "MARKETING",
1854
+ PAYMENT_GATEWAY: "PAYMENT_GATEWAY",
1855
+ CRM: "CRM",
1856
+ COMMUNICATION: "COMMUNICATION",
1857
+ OTHER: "OTHER"
1858
+ };
1859
+
1860
+ // src/generated/model/createInvitationDtoRole.ts
1861
+ var CreateInvitationDtoRole = {
1862
+ OWNER: "OWNER",
1863
+ ADMIN: "ADMIN",
1864
+ MANAGER: "MANAGER",
1865
+ EMPLOYEE: "EMPLOYEE",
1866
+ CASHIER: "CASHIER",
1867
+ REPORTER: "REPORTER",
1868
+ GUEST: "GUEST"
1869
+ };
1870
+
1871
+ // src/generated/model/createMemberDtoRole.ts
1872
+ var CreateMemberDtoRole = {
1873
+ OWNER: "OWNER",
1874
+ ADMIN: "ADMIN",
1875
+ MANAGER: "MANAGER",
1876
+ EMPLOYEE: "EMPLOYEE",
1877
+ CASHIER: "CASHIER",
1878
+ REPORTER: "REPORTER",
1879
+ GUEST: "GUEST"
1880
+ };
1881
+
1882
+ // src/generated/model/createOrderDtoChannel.ts
1883
+ var CreateOrderDtoChannel = {
1884
+ ECOMMERCE_STORE: "ECOMMERCE_STORE",
1885
+ MOBILE_APP: "MOBILE_APP"
1886
+ };
1887
+
1888
+ // src/generated/model/createPartnerDtoBenefitType.ts
1889
+ var CreatePartnerDtoBenefitType = {
1890
+ COMMISSION: "COMMISSION",
1891
+ FIXED_FEE: "FIXED_FEE",
1892
+ PROFIT_MARGIN: "PROFIT_MARGIN",
1893
+ NONE: "NONE"
1894
+ };
1895
+
1896
+ // src/generated/model/createPartnerDtoReconciliationPolicy.ts
1897
+ var CreatePartnerDtoReconciliationPolicy = {
1898
+ RETURN_TO_STOCK: "RETURN_TO_STOCK",
1899
+ MARK_AS_WASTE: "MARK_AS_WASTE",
1900
+ PARTNER_CHARGED: "PARTNER_CHARGED"
1901
+ };
1902
+
1903
+ // src/generated/model/createServiceDtoPricingModel.ts
1904
+ var CreateServiceDtoPricingModel = {
1905
+ FIXED: "FIXED",
1906
+ HOURLY: "HOURLY",
1907
+ VARIABLE: "VARIABLE"
1908
+ };
1909
+
1910
+ // src/generated/model/createStrapiConnectionDtoEnabledSyncTypesItem.ts
1911
+ var CreateStrapiConnectionDtoEnabledSyncTypesItem = {
1912
+ PRODUCTS: "PRODUCTS",
1913
+ INVENTORY: "INVENTORY",
1914
+ ORDERS: "ORDERS",
1915
+ CUSTOMERS: "CUSTOMERS",
1916
+ CATEGORIES: "CATEGORIES",
1917
+ PRICES: "PRICES"
1918
+ };
1919
+
1920
+ // src/generated/model/createStrapiConnectionDtoSyncDirection.ts
1921
+ var CreateStrapiConnectionDtoSyncDirection = {
1922
+ INBOUND: "INBOUND",
1923
+ OUTBOUND: "OUTBOUND",
1924
+ BIDIRECTIONAL: "BIDIRECTIONAL"
1925
+ };
1926
+
1927
+ // src/generated/model/createTransferDtoPriority.ts
1928
+ var CreateTransferDtoPriority = {
1929
+ LOW: "LOW",
1930
+ MEDIUM: "MEDIUM",
1931
+ HIGH: "HIGH",
1932
+ URGENT: "URGENT"
1933
+ };
1934
+
1935
+ // src/generated/model/createUtilityAccountDtoType.ts
1936
+ var CreateUtilityAccountDtoType = {
1937
+ ELECTRICITY: "ELECTRICITY",
1938
+ WATER: "WATER",
1939
+ INTERNET: "INTERNET",
1940
+ GAS: "GAS",
1941
+ WASTE_MANAGEMENT: "WASTE_MANAGEMENT",
1942
+ OTHER: "OTHER"
1943
+ };
1944
+
1945
+ // src/generated/model/departmentsListSortOrder.ts
1946
+ var DepartmentsListSortOrder = {
1947
+ asc: "asc",
1948
+ desc: "desc"
1949
+ };
1950
+
1951
+ // src/generated/model/expenseControllerGetExpensesStatus.ts
1952
+ var ExpenseControllerGetExpensesStatus = {
1953
+ PENDING: "PENDING",
1954
+ PENDING_APPROVAL: "PENDING_APPROVAL",
1955
+ APPROVED: "APPROVED",
1956
+ REJECTED: "REJECTED",
1957
+ PAID: "PAID",
1958
+ REIMBURSED: "REIMBURSED",
1959
+ VOIDED: "VOIDED"
1960
+ };
1961
+
1962
+ // src/generated/model/invitationResponseDtoRole.ts
1963
+ var InvitationResponseDtoRole = {
1964
+ OWNER: "OWNER",
1965
+ ADMIN: "ADMIN",
1966
+ MANAGER: "MANAGER",
1967
+ EMPLOYEE: "EMPLOYEE",
1968
+ CASHIER: "CASHIER",
1969
+ REPORTER: "REPORTER",
1970
+ GUEST: "GUEST"
1971
+ };
1972
+
1973
+ // src/generated/model/invitationResponseDtoStatus.ts
1974
+ var InvitationResponseDtoStatus = {
1975
+ PENDING: "PENDING",
1976
+ ACCEPTED: "ACCEPTED",
1977
+ DECLINED: "DECLINED",
1978
+ EXPIRED: "EXPIRED"
1979
+ };
1980
+
1981
+ // src/generated/model/invitationsListSortOrder.ts
1982
+ var InvitationsListSortOrder = {
1983
+ asc: "asc",
1984
+ desc: "desc"
1985
+ };
1986
+
1987
+ // src/generated/model/invitationsListStatus.ts
1988
+ var InvitationsListStatus = {
1989
+ PENDING: "PENDING",
1990
+ ACCEPTED: "ACCEPTED",
1991
+ DECLINED: "DECLINED",
1992
+ EXPIRED: "EXPIRED"
1993
+ };
1994
+
1995
+ // src/generated/model/memberResponseDtoMembershipStatus.ts
1996
+ var MemberResponseDtoMembershipStatus = {
1997
+ ACTIVE: "ACTIVE",
1998
+ PENDING_APPROVAL: "PENDING_APPROVAL",
1999
+ SUSPENDED: "SUSPENDED",
2000
+ REJECTED: "REJECTED"
2001
+ };
2002
+
2003
+ // src/generated/model/memberResponseDtoRole.ts
2004
+ var MemberResponseDtoRole = {
2005
+ OWNER: "OWNER",
2006
+ ADMIN: "ADMIN",
2007
+ MANAGER: "MANAGER",
2008
+ EMPLOYEE: "EMPLOYEE",
2009
+ CASHIER: "CASHIER",
2010
+ REPORTER: "REPORTER",
2011
+ GUEST: "GUEST"
2012
+ };
2013
+
2014
+ // src/generated/model/memberResponseDtoStatus.ts
2015
+ var MemberResponseDtoStatus = {
2016
+ ONLINE: "ONLINE",
2017
+ OFFLINE: "OFFLINE"
2018
+ };
2019
+
2020
+ // src/generated/model/membersControllerGetMembersMembershipStatus.ts
2021
+ var MembersControllerGetMembersMembershipStatus = {
2022
+ ACTIVE: "ACTIVE",
2023
+ PENDING_APPROVAL: "PENDING_APPROVAL",
2024
+ SUSPENDED: "SUSPENDED",
2025
+ REJECTED: "REJECTED"
2026
+ };
2027
+
2028
+ // src/generated/model/membersControllerGetMembersRole.ts
2029
+ var MembersControllerGetMembersRole = {
2030
+ OWNER: "OWNER",
2031
+ ADMIN: "ADMIN",
2032
+ MANAGER: "MANAGER",
2033
+ EMPLOYEE: "EMPLOYEE",
2034
+ CASHIER: "CASHIER",
2035
+ REPORTER: "REPORTER",
2036
+ GUEST: "GUEST"
2037
+ };
2038
+
2039
+ // src/generated/model/membersControllerGetMembersSortOrder.ts
2040
+ var MembersControllerGetMembersSortOrder = {
2041
+ asc: "asc",
2042
+ desc: "desc"
2043
+ };
2044
+
2045
+ // src/generated/model/reconcilePodDtoOutcome.ts
2046
+ var ReconcilePodDtoOutcome = {
2047
+ DELIVERED: "DELIVERED",
2048
+ FAILED: "FAILED",
2049
+ PARTIAL: "PARTIAL"
2050
+ };
2051
+
2052
+ // src/generated/model/registerPettyCashDtoPaymentMethod.ts
2053
+ var RegisterPettyCashDtoPaymentMethod = {
2054
+ CASH: "CASH",
2055
+ CREDIT: "CREDIT",
2056
+ CARD: "CARD",
2057
+ MOBILE_PAYMENT: "MOBILE_PAYMENT",
2058
+ MPESA_C2B: "MPESA_C2B",
2059
+ BANK_TRANSFER: "BANK_TRANSFER",
2060
+ CHEQUE: "CHEQUE",
2061
+ STORE_CREDIT: "STORE_CREDIT",
2062
+ GIFT_CARD: "GIFT_CARD",
2063
+ LOYALTY_POINTS: "LOYALTY_POINTS",
2064
+ ON_ACCOUNT: "ON_ACCOUNT",
2065
+ MPESA: "MPESA",
2066
+ OTHER: "OTHER"
2067
+ };
2068
+
2069
+ // src/generated/model/reviewPriceChangeDtoStatus.ts
2070
+ var ReviewPriceChangeDtoStatus = {
2071
+ PENDING: "PENDING",
2072
+ APPROVED: "APPROVED",
2073
+ REJECTED: "REJECTED",
2074
+ EXPIRED: "EXPIRED",
2075
+ CANCELLED: "CANCELLED"
2076
+ };
2077
+
2078
+ // src/generated/model/roleManagementControllerGetCustomRolesSortOrder.ts
2079
+ var RoleManagementControllerGetCustomRolesSortOrder = {
2080
+ asc: "asc",
2081
+ desc: "desc"
2082
+ };
2083
+
2084
+ // src/generated/model/servicesUpdateBookingStatusBodyStatus.ts
2085
+ var ServicesUpdateBookingStatusBodyStatus = {
2086
+ REQUESTED: "REQUESTED",
2087
+ SCHEDULED: "SCHEDULED",
2088
+ IN_PROGRESS: "IN_PROGRESS",
2089
+ COMPLETED: "COMPLETED",
2090
+ CANCELLED: "CANCELLED",
2091
+ NOSHOW: "NOSHOW"
2092
+ };
2093
+
2094
+ // src/generated/model/triggerSyncDtoDirection.ts
2095
+ var TriggerSyncDtoDirection = {
2096
+ INBOUND: "INBOUND",
2097
+ OUTBOUND: "OUTBOUND",
2098
+ BIDIRECTIONAL: "BIDIRECTIONAL"
2099
+ };
2100
+
2101
+ // src/generated/model/triggerSyncDtoSyncTypesItem.ts
2102
+ var TriggerSyncDtoSyncTypesItem = {
2103
+ PRODUCTS: "PRODUCTS",
2104
+ INVENTORY: "INVENTORY",
2105
+ ORDERS: "ORDERS",
2106
+ CUSTOMERS: "CUSTOMERS",
2107
+ CATEGORIES: "CATEGORIES",
2108
+ PRICES: "PRICES"
2109
+ };
2110
+
2111
+ // src/generated/model/updateIntegrationDefinitionDtoAuthType.ts
2112
+ var UpdateIntegrationDefinitionDtoAuthType = {
2113
+ API_KEY: "API_KEY",
2114
+ OAUTH2: "OAUTH2",
2115
+ OTHER: "OTHER"
2116
+ };
2117
+
2118
+ // src/generated/model/updateIntegrationDefinitionDtoCategory.ts
2119
+ var UpdateIntegrationDefinitionDtoCategory = {
2120
+ E_COMMERCE: "E_COMMERCE",
2121
+ ACCOUNTING: "ACCOUNTING",
2122
+ MARKETING: "MARKETING",
2123
+ PAYMENT_GATEWAY: "PAYMENT_GATEWAY",
2124
+ CRM: "CRM",
2125
+ COMMUNICATION: "COMMUNICATION",
2126
+ OTHER: "OTHER"
2127
+ };
2128
+
2129
+ // src/generated/model/updateMemberDtoMembershipStatus.ts
2130
+ var UpdateMemberDtoMembershipStatus = {
2131
+ ACTIVE: "ACTIVE",
2132
+ PENDING_APPROVAL: "PENDING_APPROVAL",
2133
+ SUSPENDED: "SUSPENDED",
2134
+ REJECTED: "REJECTED"
2135
+ };
2136
+
2137
+ // src/generated/model/updateMemberDtoRole.ts
2138
+ var UpdateMemberDtoRole = {
2139
+ OWNER: "OWNER",
2140
+ ADMIN: "ADMIN",
2141
+ MANAGER: "MANAGER",
2142
+ EMPLOYEE: "EMPLOYEE",
2143
+ CASHIER: "CASHIER",
2144
+ REPORTER: "REPORTER",
2145
+ GUEST: "GUEST"
2146
+ };
2147
+
2148
+ // src/generated/model/updateMemberDtoStatus.ts
2149
+ var UpdateMemberDtoStatus = {
2150
+ ONLINE: "ONLINE",
2151
+ OFFLINE: "OFFLINE"
2152
+ };
2153
+
2154
+ // src/generated/model/updatePartnerDtoBenefitType.ts
2155
+ var UpdatePartnerDtoBenefitType = {
2156
+ COMMISSION: "COMMISSION",
2157
+ FIXED_FEE: "FIXED_FEE",
2158
+ PROFIT_MARGIN: "PROFIT_MARGIN",
2159
+ NONE: "NONE"
2160
+ };
2161
+
2162
+ // src/generated/model/updatePartnerDtoReconciliationPolicy.ts
2163
+ var UpdatePartnerDtoReconciliationPolicy = {
2164
+ RETURN_TO_STOCK: "RETURN_TO_STOCK",
2165
+ MARK_AS_WASTE: "MARK_AS_WASTE",
2166
+ PARTNER_CHARGED: "PARTNER_CHARGED"
2167
+ };
2168
+
2169
+ // src/generated/model/updateServiceDtoPricingModel.ts
2170
+ var UpdateServiceDtoPricingModel = {
2171
+ FIXED: "FIXED",
2172
+ HOURLY: "HOURLY",
2173
+ VARIABLE: "VARIABLE"
2174
+ };
2175
+
2176
+ // src/generated/model/updateStrapiConnectionDtoEnabledSyncTypesItem.ts
2177
+ var UpdateStrapiConnectionDtoEnabledSyncTypesItem = {
2178
+ PRODUCTS: "PRODUCTS",
2179
+ INVENTORY: "INVENTORY",
2180
+ ORDERS: "ORDERS",
2181
+ CUSTOMERS: "CUSTOMERS",
2182
+ CATEGORIES: "CATEGORIES",
2183
+ PRICES: "PRICES"
2184
+ };
2185
+
2186
+ // src/generated/model/updateStrapiConnectionDtoSyncDirection.ts
2187
+ var UpdateStrapiConnectionDtoSyncDirection = {
2188
+ INBOUND: "INBOUND",
2189
+ OUTBOUND: "OUTBOUND",
2190
+ BIDIRECTIONAL: "BIDIRECTIONAL"
2191
+ };
2192
+
2193
+ // src/base.ts
2194
+ var methodsWithOrgSlugSet = /* @__PURE__ */ new Set([
2195
+ "inventoryVerifyIntegrity",
2196
+ "inventoryFixIntegrity",
2197
+ "inventoryGetInventory",
2198
+ "inventoryTraceBatch",
2199
+ "inventorySplitBatch",
2200
+ "inventoryMergeBatches",
2201
+ "inventoryCreateAssembly",
2202
+ "inventoryCompleteAssembly",
2203
+ "inventoryRequestAdjustment",
2204
+ "inventoryGetAdjustments",
2205
+ "inventoryApproveAdjustment",
2206
+ "inventoryRejectAdjustment",
2207
+ "inventoryGetLeadTime",
2208
+ "inventoryGetWasteAnalysis",
2209
+ "inventoryCheckB2BAvailability",
2210
+ "inventoryUnpackBatch",
2211
+ "inventoryScanUnpackBatch",
2212
+ "inventoryQuickStockInquiry",
2213
+ "accountingInitialize",
2214
+ "accountingGetProfitLoss",
2215
+ "accountingGetBalanceSheet",
2216
+ "accountingGetCashFlow",
2217
+ "accountingGetTaxSummary",
2218
+ "webhooksCreate",
2219
+ "webhooksList",
2220
+ "webhooksDelete",
2221
+ "catalogGetProducts",
2222
+ "catalogCreateProduct",
2223
+ "catalogGetServices",
2224
+ "catalogUpdateProduct",
2225
+ "catalogUpdateSupplierVariant",
2226
+ "catalogGetPriceChangeRequests",
2227
+ "catalogReviewPriceChangeRequest",
2228
+ "servicesCreateCategory",
2229
+ "servicesGetCategories",
2230
+ "servicesUpdateCategory",
2231
+ "servicesDeleteCategory",
2232
+ "servicesCreateService",
2233
+ "servicesGetServices",
2234
+ "servicesGetCurrentMemberShifts",
2235
+ "servicesGetShifts",
2236
+ "servicesGetService",
2237
+ "servicesUpdateService",
2238
+ "servicesDeleteService",
2239
+ "servicesCreateResource",
2240
+ "servicesGetResources",
2241
+ "servicesUpdateResource",
2242
+ "servicesDeleteResource",
2243
+ "servicesCreateBooking",
2244
+ "servicesGetBookings",
2245
+ "servicesGetBooking",
2246
+ "servicesUpdateBookingStatus",
2247
+ "servicesCompleteBooking",
2248
+ "servicesCreateShift",
2249
+ "servicesGetStaffShifts",
2250
+ "servicesAddBreak",
2251
+ "servicesRegisterCustomerApp",
2252
+ "servicesGetUtilization",
2253
+ "servicesGetPerformance",
2254
+ "servicesGetFunnel",
2255
+ "customersProvisionZitadel",
2256
+ "customersGetCustomers",
2257
+ "customersRegister",
2258
+ "customersUpdate",
2259
+ "customersGetCustomerById",
2260
+ "customersDelete",
2261
+ "customersGetAddresses",
2262
+ "customersAddAddress",
2263
+ "businessAccountControllerCreate",
2264
+ "businessAccountControllerGetOne",
2265
+ "crmControllerCreateRecord",
2266
+ "crmControllerGetRecord",
2267
+ "crmControllerUpdateRecord",
2268
+ "crmControllerCreateNote",
2269
+ "crmControllerGetRecordNotes",
2270
+ "crmControllerCreateActivity",
2271
+ "crmControllerGetTimeline",
2272
+ "crmControllerCreateObject",
2273
+ "crmControllerListObjects",
2274
+ "crmControllerCreateField",
2275
+ "crmControllerListFields",
2276
+ "crmControllerCreateRelationship",
2277
+ "crmControllerListRelationships",
2278
+ "crmControllerCreateAssociation",
2279
+ "crmControllerListRecordAssociations",
2280
+ "loyaltyRedeemReward",
2281
+ "loyaltyGetCustomerStatus",
2282
+ "loyaltyValidateVoucher",
2283
+ "ordersCreateOrder",
2284
+ "ordersGetOrders",
2285
+ "ordersUpdateStatus",
2286
+ "ordersRequestB2BQuote",
2287
+ "ordersConvertQuoteToOrder",
2288
+ "paymentsControllerHandleStkCallback",
2289
+ "pOSProvision",
2290
+ "pOSLogin",
2291
+ "pOSGetMe",
2292
+ "pOSProcessSale",
2293
+ "pOSSync",
2294
+ "pOSGetTransactions",
2295
+ "pOSRegisterPettyCash",
2296
+ "pOSGetPettyCashFunds",
2297
+ "pOSGetPettyCashTransactions",
2298
+ "membersControllerGetMembers",
2299
+ "membersControllerCreateMember",
2300
+ "membersControllerGetMember",
2301
+ "membersControllerUpdateMember",
2302
+ "membersControllerDeleteMember",
2303
+ "membersControllerGetMemberActivity",
2304
+ "membersControllerUpdateStatus",
2305
+ "membersControllerAdminCheckOut",
2306
+ "invitationsList",
2307
+ "invitationsCreate",
2308
+ "invitationsRevoke",
2309
+ "invitationsAccept",
2310
+ "roleManagementControllerGetCustomRoles",
2311
+ "roleManagementControllerCreateCustomRole",
2312
+ "roleManagementControllerUpdateCustomRole",
2313
+ "roleManagementControllerDeleteCustomRole",
2314
+ "roleManagementControllerGetPermissionSets",
2315
+ "roleManagementControllerCreatePermissionSet",
2316
+ "roleManagementControllerGetRoleGroups",
2317
+ "roleManagementControllerCreateRoleGroup",
2318
+ "roleManagementControllerAssignRoles",
2319
+ "roleManagementControllerRemoveRoles",
2320
+ "departmentsList"
2321
+ ]);
2322
+ var catalogMapping = {
2323
+ getProducts: "catalogGetProducts",
2324
+ createProduct: "catalogCreateProduct",
2325
+ getServices: "catalogGetServices",
2326
+ updateProduct: "catalogUpdateProduct",
2327
+ updateSupplierVariant: "catalogUpdateSupplierVariant",
2328
+ getPriceChangeRequests: "catalogGetPriceChangeRequests",
2329
+ reviewPriceChangeRequest: "catalogReviewPriceChangeRequest",
2330
+ createServiceCategory: "servicesCreateCategory",
2331
+ getServiceCategories: "servicesGetCategories",
2332
+ updateServiceCategory: "servicesUpdateCategory",
2333
+ deleteServiceCategory: "servicesDeleteCategory",
2334
+ createService: "servicesCreateService",
2335
+ getServicesList: "servicesGetServices",
2336
+ getCurrentMemberShifts: "servicesGetCurrentMemberShifts",
2337
+ getShifts: "servicesGetShifts",
2338
+ getService: "servicesGetService",
2339
+ updateService: "servicesUpdateService",
2340
+ deleteService: "servicesDeleteService",
2341
+ createResource: "servicesCreateResource",
2342
+ getResources: "servicesGetResources",
2343
+ updateResource: "servicesUpdateResource",
2344
+ deleteResource: "servicesDeleteResource",
2345
+ createBooking: "servicesCreateBooking",
2346
+ getBookings: "servicesGetBookings",
2347
+ getBooking: "servicesGetBooking",
2348
+ updateBookingStatus: "servicesUpdateBookingStatus",
2349
+ completeBooking: "servicesCompleteBooking",
2350
+ createShift: "servicesCreateShift",
2351
+ getStaffShifts: "servicesGetStaffShifts",
2352
+ addBreak: "servicesAddBreak",
2353
+ registerCustomerApp: "servicesRegisterCustomerApp",
2354
+ getServiceUtilization: "servicesGetUtilization",
2355
+ getServicePerformance: "servicesGetPerformance",
2356
+ getServiceFunnel: "servicesGetFunnel"
2357
+ };
2358
+ var authMapping = {
2359
+ exchangeToken: "authExchangeToken",
2360
+ handleOAuth2: "authControllerHandleOAuth2"
2361
+ };
2362
+ var inventoryMapping = {
2363
+ verifyIntegrity: "inventoryVerifyIntegrity",
2364
+ fixIntegrity: "inventoryFixIntegrity",
2365
+ getInventory: "inventoryGetInventory",
2366
+ traceBatch: "inventoryTraceBatch",
2367
+ splitBatch: "inventorySplitBatch",
2368
+ mergeBatches: "inventoryMergeBatches",
2369
+ createAssembly: "inventoryCreateAssembly",
2370
+ completeAssembly: "inventoryCompleteAssembly",
2371
+ requestAdjustment: "inventoryRequestAdjustment",
2372
+ getAdjustments: "inventoryGetAdjustments",
2373
+ approveAdjustment: "inventoryApproveAdjustment",
2374
+ rejectAdjustment: "inventoryRejectAdjustment",
2375
+ getLeadTime: "inventoryGetLeadTime",
2376
+ getWasteAnalysis: "inventoryGetWasteAnalysis",
2377
+ checkB2BAvailability: "inventoryCheckB2BAvailability",
2378
+ unpackBatch: "inventoryUnpackBatch",
2379
+ scanUnpackBatch: "inventoryScanUnpackBatch",
2380
+ quickStockInquiry: "inventoryQuickStockInquiry",
2381
+ getPurchases: "stockingGetPurchases",
2382
+ createPurchase: "stockingCreatePurchase",
2383
+ receivePurchase: "stockingReceivePurchase",
2384
+ getTransfers: "stockingGetTransfers",
2385
+ createTransfer: "stockingCreateTransfer",
2386
+ shipTransfer: "stockingShipTransfer",
2387
+ receiveTransfer: "stockingReceiveTransfer",
2388
+ getRequests: "stockingGetRequests",
2389
+ getPendingDispatch: "stockingGetPendingDispatch",
2390
+ dispatchOrders: "stockingDispatchOrders",
2391
+ getActiveDeliveries: "stockingGetActiveDeliveries",
2392
+ reconcilePod: "stockingReconcilePod",
2393
+ getPhysicalReconciliations: "stockingGetPhysicalReconciliations",
2394
+ submitPhysicalReconciliation: "stockingSubmitPhysicalReconciliation",
2395
+ getReconciliationReport: "stockingGetReconciliationReport",
2396
+ getPartners: "stockingGetPartners",
2397
+ createPartner: "stockingCreatePartner",
2398
+ getPartner: "stockingGetPartner",
2399
+ updatePartner: "stockingUpdatePartner",
2400
+ adjustPartnerWallet: "stockingAdjustPartnerWallet",
2401
+ getUnits: "unitsGetUnits"
2402
+ };
2403
+ var ordersMapping = {
2404
+ createOrder: "ordersCreateOrder",
2405
+ getOrders: "ordersGetOrders",
2406
+ updateStatus: "ordersUpdateStatus",
2407
+ requestB2BQuote: "ordersRequestB2BQuote",
2408
+ convertQuoteToOrder: "ordersConvertQuoteToOrder",
2409
+ getB2BCatalog: "b2BGetCatalog",
2410
+ getB2BInvoices: "b2BGetInvoices",
2411
+ getB2BOrders: "b2BGetOrders",
2412
+ createB2BOrder: "b2BCreateOrder",
2413
+ createB2BQuote: "b2BCreateQuote",
2414
+ getCart: "cartControllerGetCart",
2415
+ clearCart: "cartControllerClearCart",
2416
+ addToCart: "cartControllerAddToCart",
2417
+ removeFromCart: "cartControllerRemoveFromCart",
2418
+ handleStkCallback: "paymentsControllerHandleStkCallback"
2419
+ };
2420
+ var crmMapping = {
2421
+ createRecord: "crmControllerCreateRecord",
2422
+ getRecord: "crmControllerGetRecord",
2423
+ updateRecord: "crmControllerUpdateRecord",
2424
+ createNote: "crmControllerCreateNote",
2425
+ getRecordNotes: "crmControllerGetRecordNotes",
2426
+ createActivity: "crmControllerCreateActivity",
2427
+ getTimeline: "crmControllerGetTimeline",
2428
+ createObject: "crmControllerCreateObject",
2429
+ listObjects: "crmControllerListObjects",
2430
+ createField: "crmControllerCreateField",
2431
+ listFields: "crmControllerListFields",
2432
+ createRelationship: "crmControllerCreateRelationship",
2433
+ listRelationships: "crmControllerListRelationships",
2434
+ createAssociation: "crmControllerCreateAssociation",
2435
+ listRecordAssociations: "crmControllerListRecordAssociations",
2436
+ getIntegrationsAuthUrl: "crmIntegrationsGetAuthUrl",
2437
+ handleIntegrationsCallback: "crmIntegrationsHandleCallback",
2438
+ handleIntegrationsWebhook: "crmIntegrationsHandleWebhook",
2439
+ replyToIntegrationsActivity: "crmIntegrationsReplyToActivity",
2440
+ createStrapiConnection: "strapiCreateConnection",
2441
+ listStrapiConnections: "strapiListConnections",
2442
+ getStrapiConnection: "strapiGetConnection",
2443
+ updateStrapiConnection: "strapiUpdateConnection",
2444
+ deleteStrapiConnection: "strapiDeleteConnection",
2445
+ triggerStrapiSync: "strapiTriggerSync",
2446
+ enqueueStrapiSync: "strapiEnqueueSync",
2447
+ getStrapiWebhookLogs: "strapiGetWebhookLogs",
2448
+ getStrapiSyncLogs: "strapiGetSyncLogs",
2449
+ exchangeStrapiCustomerToken: "strapiExchangeCustomerToken",
2450
+ registerStrapiCustomer: "strapiRegisterCustomer",
2451
+ receiveStrapiWebhook: "strapiReceiveWebhook"
2452
+ };
2453
+ var posMapping = {
2454
+ provision: "pOSProvision",
2455
+ login: "pOSLogin",
2456
+ getMe: "pOSGetMe",
2457
+ processSale: "pOSProcessSale",
2458
+ sync: "pOSSync",
2459
+ getTransactions: "pOSGetTransactions",
2460
+ registerPettyCash: "pOSRegisterPettyCash",
2461
+ getPettyCashFunds: "pOSGetPettyCashFunds",
2462
+ getPettyCashTransactions: "pOSGetPettyCashTransactions",
2463
+ createSetupKey: "standalonePosControllerCreateSetupKey",
2464
+ activateDevice: "standalonePosControllerActivateDevice",
2465
+ validateKey: "standalonePosControllerValidateKey",
2466
+ linkOrganization: "standalonePosControllerLinkOrganization"
2467
+ };
2468
+ var accountingMapping = {
2469
+ createExpense: "expenseControllerCreateExpense",
2470
+ getExpenses: "expenseControllerGetExpenses",
2471
+ getExpenseCategories: "expenseControllerGetExpenseCategories",
2472
+ getExpense: "expenseControllerGetExpense",
2473
+ createPettyCashFund: "pettyCashControllerCreateFund",
2474
+ getPettyCashFunds: "pettyCashControllerGetFunds",
2475
+ getPettyCashFund: "pettyCashControllerGetFund",
2476
+ topUpPettyCashFund: "pettyCashControllerTopUpFund",
2477
+ getPettyCashFundTransactions: "pettyCashControllerGetFundTransactions",
2478
+ createUtilityAccount: "utilityAccountControllerCreateAccount",
2479
+ getUtilityAccounts: "utilityAccountControllerGetAccounts",
2480
+ getUtilityAccount: "utilityAccountControllerGetAccount",
2481
+ initialize: "accountingInitialize",
2482
+ getProfitLoss: "accountingGetProfitLoss",
2483
+ getBalanceSheet: "accountingGetBalanceSheet",
2484
+ getCashFlow: "accountingGetCashFlow",
2485
+ getTaxSummary: "accountingGetTaxSummary",
2486
+ createInvoice: "invoiceControllerCreateInvoice",
2487
+ getInvoices: "invoiceControllerGetInvoices",
2488
+ getInvoice: "invoiceControllerGetInvoice",
2489
+ updateInvoice: "invoiceControllerUpdateInvoice",
2490
+ deleteInvoice: "invoiceControllerDeleteInvoice",
2491
+ finalizeInvoice: "invoiceControllerFinalizeInvoice",
2492
+ getTemplates: "invoiceControllerGetTemplates",
2493
+ createTemplate: "invoiceControllerCreateTemplate",
2494
+ getInvoiceConfig: "invoiceControllerGetConfig",
2495
+ updateInvoiceConfig: "invoiceControllerUpdateConfig",
2496
+ downloadInvoice: "publicInvoiceControllerDownloadInvoice",
2497
+ downloadInvoiceByTransaction: "publicInvoiceControllerDownloadInvoiceByTransaction",
2498
+ downloadReceipt: "publicInvoiceControllerDownloadReceipt",
2499
+ generatePublicLink: "publicInvoiceControllerGeneratePublicLink"
2500
+ };
2501
+ var loyaltyMapping = {
2502
+ redeemReward: "loyaltyRedeemReward",
2503
+ getCustomerStatus: "loyaltyGetCustomerStatus",
2504
+ validateVoucher: "loyaltyValidateVoucher",
2505
+ getFavorites: "favoritesControllerGetFavorites",
2506
+ addFavorite: "favoritesControllerAddFavorite",
2507
+ removeFavorite: "favoritesControllerRemoveFavorite"
2508
+ };
2509
+ var membersMapping = {
2510
+ getMembers: "membersControllerGetMembers",
2511
+ createMember: "membersControllerCreateMember",
2512
+ getMember: "membersControllerGetMember",
2513
+ updateMember: "membersControllerUpdateMember",
2514
+ deleteMember: "membersControllerDeleteMember",
2515
+ getMemberActivity: "membersControllerGetMemberActivity",
2516
+ updateStatus: "membersControllerUpdateStatus",
2517
+ adminCheckOut: "membersControllerAdminCheckOut",
2518
+ terminalLogin: "terminalMembersControllerLogin",
2519
+ listInvitations: "invitationsList",
2520
+ createInvitation: "invitationsCreate",
2521
+ revokeInvitation: "invitationsRevoke",
2522
+ acceptInvitation: "invitationsAccept",
2523
+ getCustomRoles: "roleManagementControllerGetCustomRoles",
2524
+ createCustomRole: "roleManagementControllerCreateCustomRole",
2525
+ updateCustomRole: "roleManagementControllerUpdateCustomRole",
2526
+ deleteCustomRole: "roleManagementControllerDeleteCustomRole",
2527
+ getPermissionSets: "roleManagementControllerGetPermissionSets",
2528
+ createPermissionSet: "roleManagementControllerCreatePermissionSet",
2529
+ getRoleGroups: "roleManagementControllerGetRoleGroups",
2530
+ createRoleGroup: "roleManagementControllerCreateRoleGroup",
2531
+ assignRoles: "roleManagementControllerAssignRoles",
2532
+ removeRoles: "roleManagementControllerRemoveRoles",
2533
+ listDepartments: "departmentsList",
2534
+ createDepartment: "departmentsCreate",
2535
+ getDepartment: "departmentsGet",
2536
+ updateDepartment: "departmentsUpdate",
2537
+ deleteDepartment: "departmentsDelete",
2538
+ addDepartmentMember: "departmentsAddMember",
2539
+ removeDepartmentMember: "departmentsRemoveMember",
2540
+ getAttendanceLogs: "attendanceControllerGetLogs",
2541
+ checkIn: "attendanceControllerCheckIn",
2542
+ checkOut: "attendanceControllerCheckOut",
2543
+ getMyAttendanceStatus: "attendanceControllerGetMyStatus",
2544
+ getAttendanceStatus: "attendanceControllerGetStatus",
2545
+ broadcastAnnouncement: "announcementControllerBroadcastAnnouncement"
2546
+ };
2547
+ var adminMapping = {
2548
+ getStats: "adminControllerGetStats",
2549
+ listOrganizations: "adminControllerListOrganizations",
2550
+ createOrganization: "adminControllerCreateOrganization",
2551
+ getOrganizationDetails: "adminControllerGetOrganizationDetails",
2552
+ updateOrganization: "adminControllerUpdateOrganization",
2553
+ deleteOrganization: "adminControllerDeleteOrganization",
2554
+ listMembers: "adminControllerListMembers",
2555
+ listUsers: "adminControllerListUsers",
2556
+ banUser: "adminControllerBanUser",
2557
+ unbanUser: "adminControllerUnbanUser",
2558
+ listConnectedApps: "adminControllerListConnectedApps",
2559
+ listSystemLogs: "adminControllerListSystemLogs",
2560
+ listGlobalSettings: "adminControllerListGlobalSettings",
2561
+ setGlobalSetting: "adminControllerSetGlobalSetting",
2562
+ deleteGlobalSetting: "adminControllerDeleteGlobalSetting",
2563
+ listTiers: "adminControllerListTiers",
2564
+ defineTier: "adminControllerDefineTier",
2565
+ deleteTier: "adminControllerDeleteTier",
2566
+ getOrganizationSubscription: "adminControllerGetOrganizationSubscription",
2567
+ updateOrganizationSubscription: "adminControllerUpdateOrganizationSubscription",
2568
+ listSystemPayments: "adminControllerListSystemPayments",
2569
+ recordCustomPayment: "adminControllerRecordCustomPayment",
2570
+ listIntegrationDefinitions: "adminControllerListIntegrationDefinitions",
2571
+ createIntegrationDefinition: "adminControllerCreateIntegrationDefinition",
2572
+ updateIntegrationDefinition: "adminControllerUpdateIntegrationDefinition",
2573
+ deleteIntegrationDefinition: "adminControllerDeleteIntegrationDefinition",
2574
+ listActiveOrganizationIntegrations: "adminControllerListActiveOrganizationIntegrations",
2575
+ createWebhook: "webhooksCreate",
2576
+ listWebhooks: "webhooksList",
2577
+ deleteWebhook: "webhooksDelete",
2578
+ handleWindmillCallback: "windmillCallbackControllerHandleCallback",
2579
+ handleWindmillApprovalCallback: "windmillCallbackControllerHandleApprovalCallback",
2580
+ handleWindmillBakeryDisposalCallback: "windmillCallbackControllerHandleBakeryDisposalCallback",
2581
+ handleWindmillOutcomeCallback: "windmillCallbackControllerHandleOutcomeCallback",
2582
+ provisionZitadel: "customersProvisionZitadel",
2583
+ getCustomers: "customersGetCustomers",
2584
+ registerCustomer: "customersRegister",
2585
+ updateCustomer: "customersUpdate",
2586
+ getCustomerById: "customersGetCustomerById",
2587
+ deleteCustomer: "customersDelete",
2588
+ getCustomerAddresses: "customersGetAddresses",
2589
+ addCustomerAddress: "customersAddAddress",
2590
+ createBusinessAccount: "businessAccountControllerCreate",
2591
+ getBusinessAccount: "businessAccountControllerGetOne",
2592
+ getDashboardAnalytics: "analyticsControllerGetDashboardAnalytics",
2593
+ getResourceUtilization: "analyticsControllerGetResourceUtilization"
2594
+ };
2595
+ function buildModule(api, orgSlug, mapping) {
2596
+ const result = {};
2597
+ for (const [key, rawMethodName] of Object.entries(mapping)) {
2598
+ const rawFn = api[rawMethodName];
2599
+ if (typeof rawFn === "function") {
2600
+ if (methodsWithOrgSlugSet.has(rawMethodName)) {
2601
+ result[key] = function(...args) {
2602
+ return rawFn.apply(this, [orgSlug, ...args]);
2603
+ };
2604
+ } else {
2605
+ result[key] = function(...args) {
2606
+ return rawFn.apply(this, args);
2607
+ };
2608
+ }
2609
+ }
2610
+ }
2611
+ return result;
2612
+ }
2613
+ function getJwtExpiry(token) {
2614
+ try {
2615
+ const parts = token.split(".");
2616
+ if (parts.length !== 3) return null;
2617
+ let payloadStr = "";
2618
+ if (typeof Buffer !== "undefined") {
2619
+ payloadStr = Buffer.from(parts[1], "base64").toString("utf-8");
2620
+ } else if (typeof window !== "undefined" && typeof window.atob === "function") {
2621
+ payloadStr = window.atob(parts[1]);
2622
+ } else {
2623
+ payloadStr = atob(parts[1]);
2624
+ }
2625
+ const payload = JSON.parse(payloadStr);
2626
+ if (payload && typeof payload.exp === "number") {
2627
+ return payload.exp * 1e3;
2628
+ }
2629
+ } catch (e) {
2630
+ }
2631
+ return null;
2632
+ }
2633
+
2634
+ // src/client.ts
2635
+ import axios2 from "axios";
2636
+ var InMemoryStorage = class {
2637
+ constructor() {
2638
+ this.cache = /* @__PURE__ */ new Map();
2639
+ }
2640
+ getItem(key) {
2641
+ return this.cache.get(key) || null;
2642
+ }
2643
+ setItem(key, value) {
2644
+ this.cache.set(key, value);
2645
+ }
2646
+ removeItem(key) {
2647
+ this.cache.delete(key);
2648
+ }
2649
+ };
2650
+ var SCRYME_SESSION_TOKEN_KEY = "scryme_session_token";
2651
+ var SCRYME_USER_KEY = "scryme_user";
2652
+ var SCRYME_EXPIRES_AT_KEY = "scryme_expires_at";
2653
+ var ScrymeClientSDK = class {
2654
+ constructor(config) {
2655
+ if (!config || !config.clientId || !config.clientSecret || !config.orgSlug) {
2656
+ throw new Error("clientId, clientSecret, and orgSlug are required to initialize the SDK.");
2657
+ }
2658
+ this.axiosInstance = axios2.create({
2659
+ baseURL: config.baseURL || "https://api.scryme.tech"
2660
+ });
2661
+ let storage;
2662
+ if (config.storage) {
2663
+ storage = config.storage;
2664
+ } else if (typeof window !== "undefined" && window.localStorage) {
2665
+ storage = {
2666
+ getItem: (key) => window.localStorage.getItem(key),
2667
+ setItem: (key, value) => window.localStorage.setItem(key, value),
2668
+ removeItem: (key) => window.localStorage.removeItem(key)
2669
+ };
2670
+ } else {
2671
+ storage = new InMemoryStorage();
2672
+ }
2673
+ const state = {
2674
+ token: null,
2675
+ user: null
2676
+ };
2677
+ const listeners = /* @__PURE__ */ new Set();
2678
+ const notify = (event) => {
2679
+ const currentState = { ...state };
2680
+ listeners.forEach((listener) => {
2681
+ try {
2682
+ listener(event, currentState);
2683
+ } catch (e) {
2684
+ console.error("Error in auth state listener:", e);
2685
+ }
2686
+ });
2687
+ };
2688
+ const initPromise = (async () => {
2689
+ try {
2690
+ const storedToken = await storage.getItem(SCRYME_SESSION_TOKEN_KEY);
2691
+ const storedUser = await storage.getItem(SCRYME_USER_KEY);
2692
+ const storedExpiresAt = await storage.getItem(SCRYME_EXPIRES_AT_KEY);
2693
+ if (storedToken) {
2694
+ state.token = storedToken;
2695
+ if (storedExpiresAt) {
2696
+ state.expiresAt = Number(storedExpiresAt);
2697
+ } else {
2698
+ const jwtExp = getJwtExpiry(storedToken);
2699
+ if (jwtExp) {
2700
+ state.expiresAt = jwtExp;
2701
+ } else {
2702
+ delete state.expiresAt;
2703
+ }
2704
+ }
2705
+ if (storedUser) {
2706
+ try {
2707
+ state.user = JSON.parse(storedUser);
2708
+ } catch {
2709
+ state.user = storedUser;
2710
+ }
2711
+ }
2712
+ notify("INITIAL_SESSION");
2713
+ }
2714
+ } catch (e) {
2715
+ console.error("Failed to initialize Scryme Client SDK session:", e);
2716
+ }
2717
+ })();
2718
+ let activeAuthPromise = null;
2719
+ const performExchange = async () => {
2720
+ if (activeAuthPromise) {
2721
+ return activeAuthPromise;
2722
+ }
2723
+ activeAuthPromise = (async () => {
2724
+ try {
2725
+ const response = await this.api.authExchangeToken({
2726
+ clientId: config.clientId,
2727
+ clientSecret: config.clientSecret
2728
+ });
2729
+ const tokenData = response.data?.data;
2730
+ const accessToken = tokenData?.access_token;
2731
+ const expiresIn = tokenData?.expires_in;
2732
+ if (accessToken) {
2733
+ state.token = accessToken;
2734
+ if (expiresIn) {
2735
+ state.expiresAt = Date.now() + expiresIn * 1e3;
2736
+ await storage.setItem(SCRYME_EXPIRES_AT_KEY, String(state.expiresAt));
2737
+ } else {
2738
+ const jwtExp = getJwtExpiry(accessToken);
2739
+ if (jwtExp) {
2740
+ state.expiresAt = jwtExp;
2741
+ await storage.setItem(SCRYME_EXPIRES_AT_KEY, String(jwtExp));
2742
+ } else {
2743
+ delete state.expiresAt;
2744
+ }
2745
+ }
2746
+ await storage.setItem(SCRYME_SESSION_TOKEN_KEY, accessToken);
2747
+ notify("SIGNED_IN");
2748
+ }
2749
+ return response.data;
2750
+ } finally {
2751
+ activeAuthPromise = null;
2752
+ }
2753
+ })();
2754
+ return activeAuthPromise;
2755
+ };
2756
+ this.axiosInstance.interceptors.request.use(async (req) => {
2757
+ await initPromise;
2758
+ const isAuthTokenRequest = req.url && (req.url.endsWith("/auth/token") || req.url.includes("/auth/token"));
2759
+ if (!isAuthTokenRequest) {
2760
+ const isExpired = !state.token || state.expiresAt && Date.now() >= state.expiresAt - 3e4;
2761
+ if (isExpired && config.clientId && config.clientSecret) {
2762
+ try {
2763
+ await performExchange();
2764
+ } catch (e) {
2765
+ console.error("Auto-authentication failed in request interceptor:", e);
2766
+ }
2767
+ }
2768
+ }
2769
+ if (state.token) {
2770
+ req.headers["Authorization"] = `Bearer ${state.token}`;
2771
+ }
2772
+ return req;
2773
+ });
2774
+ this.axiosInstance.interceptors.response.use(
2775
+ (response) => response,
2776
+ async (error) => {
2777
+ const originalRequest = error.config;
2778
+ const isAuthTokenRequest = originalRequest && originalRequest.url && (originalRequest.url.endsWith("/auth/token") || originalRequest.url.includes("/auth/token"));
2779
+ if (error.response && error.response.status === 401 && originalRequest && !originalRequest._retry && !isAuthTokenRequest && config.clientId && config.clientSecret) {
2780
+ originalRequest._retry = true;
2781
+ try {
2782
+ await performExchange();
2783
+ if (state.token) {
2784
+ originalRequest.headers["Authorization"] = `Bearer ${state.token}`;
2785
+ }
2786
+ return this.axiosInstance(originalRequest);
2787
+ } catch (e) {
2788
+ return Promise.reject(error);
2789
+ }
2790
+ }
2791
+ return Promise.reject(error);
2792
+ }
2793
+ );
2794
+ this.api = getScrymeV3API2(this.axiosInstance, config.orgSlug);
2795
+ this.catalog = buildModule(this.api, config.orgSlug, catalogMapping);
2796
+ this.inventory = buildModule(this.api, config.orgSlug, inventoryMapping);
2797
+ this.orders = buildModule(this.api, config.orgSlug, ordersMapping);
2798
+ this.crm = buildModule(this.api, config.orgSlug, crmMapping);
2799
+ this.pos = buildModule(this.api, config.orgSlug, posMapping);
2800
+ this.accounting = buildModule(this.api, config.orgSlug, accountingMapping);
2801
+ this.loyalty = buildModule(this.api, config.orgSlug, loyaltyMapping);
2802
+ this.members = buildModule(this.api, config.orgSlug, membersMapping);
2803
+ this.admin = buildModule(this.api, config.orgSlug, adminMapping);
2804
+ const baseAuth = buildModule(this.api, config.orgSlug, authMapping);
2805
+ this.auth = {
2806
+ ...baseAuth,
2807
+ signUp: async (dto) => {
2808
+ return this.api.customersRegister(config.orgSlug, dto);
2809
+ },
2810
+ authenticate: async () => {
2811
+ return performExchange();
2812
+ },
2813
+ signIn: async (credentials) => {
2814
+ const response = await this.axiosInstance.post("/auth/sign-in/email", credentials);
2815
+ const data = response.data;
2816
+ const token = data?.session?.token || data?.token || null;
2817
+ const user = data?.user || null;
2818
+ if (token) {
2819
+ state.token = token;
2820
+ state.user = user;
2821
+ const jwtExp = getJwtExpiry(token);
2822
+ await storage.setItem(SCRYME_SESSION_TOKEN_KEY, token);
2823
+ if (jwtExp) {
2824
+ state.expiresAt = jwtExp;
2825
+ await storage.setItem(SCRYME_EXPIRES_AT_KEY, String(state.expiresAt));
2826
+ } else {
2827
+ delete state.expiresAt;
2828
+ await storage.removeItem(SCRYME_EXPIRES_AT_KEY);
2829
+ }
2830
+ if (user) {
2831
+ await storage.setItem(SCRYME_USER_KEY, JSON.stringify(user));
2832
+ }
2833
+ notify("SIGNED_IN");
2834
+ }
2835
+ return data;
2836
+ },
2837
+ signOut: async () => {
2838
+ try {
2839
+ await this.axiosInstance.post("/auth/sign-out");
2840
+ } catch {
2841
+ }
2842
+ state.token = null;
2843
+ state.user = null;
2844
+ delete state.expiresAt;
2845
+ await storage.removeItem(SCRYME_SESSION_TOKEN_KEY);
2846
+ await storage.removeItem(SCRYME_USER_KEY);
2847
+ await storage.removeItem(SCRYME_EXPIRES_AT_KEY);
2848
+ notify("SIGNED_OUT");
2849
+ },
2850
+ getSession: async () => {
2851
+ await initPromise;
2852
+ return { ...state };
2853
+ },
2854
+ onAuthStateChange: (callback) => {
2855
+ listeners.add(callback);
2856
+ initPromise.then(() => {
2857
+ try {
2858
+ callback("INITIAL_SESSION", { ...state });
2859
+ } catch (e) {
2860
+ console.error("Error in immediate auth state listener call:", e);
2861
+ }
2862
+ });
2863
+ return {
2864
+ unsubscribe: () => {
2865
+ listeners.delete(callback);
2866
+ }
2867
+ };
2868
+ }
2869
+ };
2870
+ }
2871
+ };
2872
+ function createClientSDK(config = {}) {
2873
+ const finalConfig = {
2874
+ clientId: config.clientId || "mock-client-id",
2875
+ clientSecret: config.clientSecret || "mock-client-secret",
2876
+ orgSlug: config.orgSlug || "mock-org-slug",
2877
+ ...config
2878
+ };
2879
+ return new ScrymeClientSDK(finalConfig);
2880
+ }
2881
+
2882
+ // src/index.ts
2883
+ function getEnvOrgSlug() {
2884
+ if (typeof process !== "undefined" && process.env) {
2885
+ const slug = process.env.SCRYME_ORG_SLUG || process.env.NEXT_PUBLIC_SCRYME_ORG_SLUG;
2886
+ if (slug) return slug;
2887
+ }
2888
+ try {
2889
+ const getMeta = new Function("return typeof import.meta !== 'undefined' ? import.meta : undefined");
2890
+ const meta = getMeta();
2891
+ if (meta && meta.env) {
2892
+ const slug = meta.env.VITE_SCRYME_ORG_SLUG || meta.env.SCRYME_ORG_SLUG;
2893
+ if (slug) return slug;
2894
+ }
2895
+ } catch (e) {
2896
+ }
2897
+ return void 0;
2898
+ }
2899
+ function expectsOrgSlug(fn) {
2900
+ const fnStr = fn.toString();
2901
+ const match = fnStr.match(/^\s*(?:async\s+)?\(([^)]+)\)/);
2902
+ if (!match) {
2903
+ const singleMatch = fnStr.match(/^\s*(\w+)\s*=>/);
2904
+ return singleMatch ? singleMatch[1] === "orgSlug" : false;
2905
+ }
2906
+ const firstParam = match[1].split(",")[0].split(":")[0].trim();
2907
+ return firstParam === "orgSlug";
2908
+ }
2909
+ function getStringParamCount(fn) {
2910
+ const fnStr = fn.toString();
2911
+ const match = fnStr.match(/^\s*(?:async\s+)?\(([^)]+)\)/);
2912
+ if (!match) return 0;
2913
+ const params = match[1].split(",").map((p) => p.trim());
2914
+ let count = 0;
2915
+ for (const param of params) {
2916
+ const cleanParam = param.split(":")[0].split("=")[0].trim();
2917
+ const lower = cleanParam.toLowerCase();
2918
+ if (lower === "params" || lower === "options" || lower.endsWith("dto") || lower.endsWith("body") || lower.endsWith("payload")) {
2919
+ break;
2920
+ }
2921
+ count++;
2922
+ }
2923
+ return count;
2924
+ }
2925
+ var getScrymeV3API2 = (axiosInstance, defaultOrgSlug) => {
2926
+ const api = getScrymeV3API(axiosInstance);
2927
+ return new Proxy(api, {
2928
+ get(target, prop, receiver) {
2929
+ const originalValue = Reflect.get(target, prop, receiver);
2930
+ if (typeof originalValue === "function") {
2931
+ if (expectsOrgSlug(originalValue)) {
2932
+ return function(...args) {
2933
+ const stringParamsExpected = getStringParamCount(originalValue);
2934
+ const stringArgsPassed = args.filter((arg) => typeof arg === "string").length;
2935
+ if (stringArgsPassed < stringParamsExpected) {
2936
+ const envSlug = defaultOrgSlug || getEnvOrgSlug() || "default-org";
2937
+ return originalValue.apply(this, [envSlug, ...args]);
2938
+ }
2939
+ return originalValue.apply(this, args);
2940
+ };
2941
+ }
2942
+ }
2943
+ return originalValue;
2944
+ }
2945
+ });
2946
+ };
2947
+
2948
+ // src/server.ts
2949
+ var ScrymeServerSDK = class {
2950
+ constructor(config) {
2951
+ this.token = null;
2952
+ this.expiresAt = null;
2953
+ this.activeAuthPromise = null;
2954
+ if (!config || !config.clientId || !config.clientSecret || !config.orgSlug) {
2955
+ throw new Error("clientId, clientSecret, and orgSlug are required to initialize the SDK.");
2956
+ }
2957
+ this.axiosInstance = axios3.create({
2958
+ baseURL: config.baseURL || "https://api.scryme.tech"
2959
+ });
2960
+ if (config.token) {
2961
+ this.token = config.token;
2962
+ this.expiresAt = getJwtExpiry(config.token);
2963
+ this.axiosInstance.defaults.headers.common["Authorization"] = `Bearer ${config.token}`;
2964
+ }
2965
+ if (config.apiKey) {
2966
+ this.axiosInstance.defaults.headers.common["x-api-key"] = config.apiKey;
2967
+ }
2968
+ const performExchange = async () => {
2969
+ if (this.activeAuthPromise) {
2970
+ return this.activeAuthPromise;
2971
+ }
2972
+ this.activeAuthPromise = (async () => {
2973
+ try {
2974
+ const response = await this.api.authExchangeToken({
2975
+ clientId: config.clientId,
2976
+ clientSecret: config.clientSecret
2977
+ });
2978
+ const tokenData = response.data?.data;
2979
+ const accessToken = tokenData?.access_token;
2980
+ const expiresIn = tokenData?.expires_in;
2981
+ if (accessToken) {
2982
+ this.token = accessToken;
2983
+ if (expiresIn) {
2984
+ this.expiresAt = Date.now() + expiresIn * 1e3;
2985
+ } else {
2986
+ this.expiresAt = getJwtExpiry(accessToken);
2987
+ }
2988
+ this.axiosInstance.defaults.headers.common["Authorization"] = `Bearer ${accessToken}`;
2989
+ }
2990
+ return response.data;
2991
+ } finally {
2992
+ this.activeAuthPromise = null;
2993
+ }
2994
+ })();
2995
+ return this.activeAuthPromise;
2996
+ };
2997
+ this.axiosInstance.interceptors.request.use(async (req) => {
2998
+ const isAuthTokenRequest = req.url && (req.url.endsWith("/auth/token") || req.url.includes("/auth/token"));
2999
+ if (!isAuthTokenRequest && !config.apiKey) {
3000
+ const isExpired = !this.token || this.expiresAt && Date.now() >= this.expiresAt - 3e4;
3001
+ if (isExpired && config.clientId && config.clientSecret) {
3002
+ try {
3003
+ await performExchange();
3004
+ } catch (e) {
3005
+ console.error("Auto-authentication failed in request interceptor:", e);
3006
+ }
3007
+ }
3008
+ }
3009
+ if (this.token) {
3010
+ req.headers["Authorization"] = `Bearer ${this.token}`;
3011
+ }
3012
+ return req;
3013
+ });
3014
+ this.axiosInstance.interceptors.response.use(
3015
+ (response) => response,
3016
+ async (error) => {
3017
+ const originalRequest = error.config;
3018
+ const isAuthTokenRequest = originalRequest && originalRequest.url && (originalRequest.url.endsWith("/auth/token") || originalRequest.url.includes("/auth/token"));
3019
+ if (error.response && error.response.status === 401 && originalRequest && !originalRequest._retry && !isAuthTokenRequest && !config.apiKey && config.clientId && config.clientSecret) {
3020
+ originalRequest._retry = true;
3021
+ try {
3022
+ await performExchange();
3023
+ if (this.token) {
3024
+ originalRequest.headers["Authorization"] = `Bearer ${this.token}`;
3025
+ }
3026
+ return this.axiosInstance(originalRequest);
3027
+ } catch (e) {
3028
+ return Promise.reject(error);
3029
+ }
3030
+ }
3031
+ return Promise.reject(error);
3032
+ }
3033
+ );
3034
+ this.api = getScrymeV3API2(this.axiosInstance, config.orgSlug);
3035
+ this.catalog = buildModule(this.api, config.orgSlug, catalogMapping);
3036
+ this.inventory = buildModule(this.api, config.orgSlug, inventoryMapping);
3037
+ this.orders = buildModule(this.api, config.orgSlug, ordersMapping);
3038
+ this.crm = buildModule(this.api, config.orgSlug, crmMapping);
3039
+ this.pos = buildModule(this.api, config.orgSlug, posMapping);
3040
+ this.accounting = buildModule(this.api, config.orgSlug, accountingMapping);
3041
+ this.loyalty = buildModule(this.api, config.orgSlug, loyaltyMapping);
3042
+ this.members = buildModule(this.api, config.orgSlug, membersMapping);
3043
+ this.admin = buildModule(this.api, config.orgSlug, adminMapping);
3044
+ const baseAuth = buildModule(this.api, config.orgSlug, authMapping);
3045
+ this.auth = {
3046
+ ...baseAuth,
3047
+ signUp: async (dto) => {
3048
+ return this.api.customersRegister(config.orgSlug, dto);
3049
+ },
3050
+ authenticate: async () => {
3051
+ return performExchange();
3052
+ },
3053
+ signIn: async (credentials) => {
3054
+ const response = await this.axiosInstance.post("/auth/sign-in/email", credentials);
3055
+ const data = response.data;
3056
+ const token = data?.session?.token || data?.token || null;
3057
+ if (token) {
3058
+ this.token = token;
3059
+ this.expiresAt = getJwtExpiry(token);
3060
+ this.axiosInstance.defaults.headers.common["Authorization"] = `Bearer ${token}`;
3061
+ }
3062
+ return data;
3063
+ }
3064
+ };
3065
+ }
3066
+ };
3067
+ function createServerSDK(config = {}) {
3068
+ const finalConfig = {
3069
+ clientId: config.clientId || "mock-client-id",
3070
+ clientSecret: config.clientSecret || "mock-client-secret",
3071
+ orgSlug: config.orgSlug || "mock-org-slug",
3072
+ ...config
3073
+ };
3074
+ return new ScrymeServerSDK(finalConfig);
3075
+ }
3076
+
3077
+ export {
3078
+ AddDepartmentMemberDtoRole,
3079
+ AttendanceControllerGetLogsSortOrder,
3080
+ CmsCustomFieldsDtoPublishStatus,
3081
+ CreateCrmFieldDtoType,
3082
+ CreateCrmRelationshipDtoType,
3083
+ CreateExpenseDtoPaymentMethod,
3084
+ CreateIntegrationDefinitionDtoAuthType,
3085
+ CreateIntegrationDefinitionDtoCategory,
3086
+ CreateInvitationDtoRole,
3087
+ CreateMemberDtoRole,
3088
+ CreateOrderDtoChannel,
3089
+ CreatePartnerDtoBenefitType,
3090
+ CreatePartnerDtoReconciliationPolicy,
3091
+ CreateServiceDtoPricingModel,
3092
+ CreateStrapiConnectionDtoEnabledSyncTypesItem,
3093
+ CreateStrapiConnectionDtoSyncDirection,
3094
+ CreateTransferDtoPriority,
3095
+ CreateUtilityAccountDtoType,
3096
+ DepartmentsListSortOrder,
3097
+ ExpenseControllerGetExpensesStatus,
3098
+ InvitationResponseDtoRole,
3099
+ InvitationResponseDtoStatus,
3100
+ InvitationsListSortOrder,
3101
+ InvitationsListStatus,
3102
+ MemberResponseDtoMembershipStatus,
3103
+ MemberResponseDtoRole,
3104
+ MemberResponseDtoStatus,
3105
+ MembersControllerGetMembersMembershipStatus,
3106
+ MembersControllerGetMembersRole,
3107
+ MembersControllerGetMembersSortOrder,
3108
+ ReconcilePodDtoOutcome,
3109
+ RegisterPettyCashDtoPaymentMethod,
3110
+ ReviewPriceChangeDtoStatus,
3111
+ RoleManagementControllerGetCustomRolesSortOrder,
3112
+ ServicesUpdateBookingStatusBodyStatus,
3113
+ TriggerSyncDtoDirection,
3114
+ TriggerSyncDtoSyncTypesItem,
3115
+ UpdateIntegrationDefinitionDtoAuthType,
3116
+ UpdateIntegrationDefinitionDtoCategory,
3117
+ UpdateMemberDtoMembershipStatus,
3118
+ UpdateMemberDtoRole,
3119
+ UpdateMemberDtoStatus,
3120
+ UpdatePartnerDtoBenefitType,
3121
+ UpdatePartnerDtoReconciliationPolicy,
3122
+ UpdateServiceDtoPricingModel,
3123
+ UpdateStrapiConnectionDtoEnabledSyncTypesItem,
3124
+ UpdateStrapiConnectionDtoSyncDirection,
3125
+ methodsWithOrgSlugSet,
3126
+ catalogMapping,
3127
+ authMapping,
3128
+ inventoryMapping,
3129
+ ordersMapping,
3130
+ crmMapping,
3131
+ posMapping,
3132
+ accountingMapping,
3133
+ loyaltyMapping,
3134
+ membersMapping,
3135
+ adminMapping,
3136
+ buildModule,
3137
+ getJwtExpiry,
3138
+ ScrymeServerSDK,
3139
+ createServerSDK,
3140
+ getScrymeV3API2 as getScrymeV3API,
3141
+ ScrymeClientSDK,
3142
+ createClientSDK
3143
+ };