@scryme/sdk 0.1.0 → 9.65.0

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