@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/index.js ADDED
@@ -0,0 +1,4076 @@
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/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ AddDepartmentMemberDtoRole: () => AddDepartmentMemberDtoRole,
34
+ AttendanceControllerGetLogsSortOrder: () => AttendanceControllerGetLogsSortOrder,
35
+ CmsCustomFieldsDtoPublishStatus: () => CmsCustomFieldsDtoPublishStatus,
36
+ CreateCrmFieldDtoType: () => CreateCrmFieldDtoType,
37
+ CreateCrmRelationshipDtoType: () => CreateCrmRelationshipDtoType,
38
+ CreateExpenseDtoPaymentMethod: () => CreateExpenseDtoPaymentMethod,
39
+ CreateIntegrationDefinitionDtoAuthType: () => CreateIntegrationDefinitionDtoAuthType,
40
+ CreateIntegrationDefinitionDtoCategory: () => CreateIntegrationDefinitionDtoCategory,
41
+ CreateInvitationDtoRole: () => CreateInvitationDtoRole,
42
+ CreateMemberDtoRole: () => CreateMemberDtoRole,
43
+ CreateOrderDtoChannel: () => CreateOrderDtoChannel,
44
+ CreatePartnerDtoBenefitType: () => CreatePartnerDtoBenefitType,
45
+ CreatePartnerDtoReconciliationPolicy: () => CreatePartnerDtoReconciliationPolicy,
46
+ CreateServiceDtoPricingModel: () => CreateServiceDtoPricingModel,
47
+ CreateStrapiConnectionDtoEnabledSyncTypesItem: () => CreateStrapiConnectionDtoEnabledSyncTypesItem,
48
+ CreateStrapiConnectionDtoSyncDirection: () => CreateStrapiConnectionDtoSyncDirection,
49
+ CreateTransferDtoPriority: () => CreateTransferDtoPriority,
50
+ CreateUtilityAccountDtoType: () => CreateUtilityAccountDtoType,
51
+ DepartmentsListSortOrder: () => DepartmentsListSortOrder,
52
+ ExpenseControllerGetExpensesStatus: () => ExpenseControllerGetExpensesStatus,
53
+ InvitationResponseDtoRole: () => InvitationResponseDtoRole,
54
+ InvitationResponseDtoStatus: () => InvitationResponseDtoStatus,
55
+ InvitationsListSortOrder: () => InvitationsListSortOrder,
56
+ InvitationsListStatus: () => InvitationsListStatus,
57
+ MemberResponseDtoMembershipStatus: () => MemberResponseDtoMembershipStatus,
58
+ MemberResponseDtoRole: () => MemberResponseDtoRole,
59
+ MemberResponseDtoStatus: () => MemberResponseDtoStatus,
60
+ MembersControllerGetMembersMembershipStatus: () => MembersControllerGetMembersMembershipStatus,
61
+ MembersControllerGetMembersRole: () => MembersControllerGetMembersRole,
62
+ MembersControllerGetMembersSortOrder: () => MembersControllerGetMembersSortOrder,
63
+ ReconcilePodDtoOutcome: () => ReconcilePodDtoOutcome,
64
+ RegisterPettyCashDtoPaymentMethod: () => RegisterPettyCashDtoPaymentMethod,
65
+ ReviewPriceChangeDtoStatus: () => ReviewPriceChangeDtoStatus,
66
+ RoleManagementControllerGetCustomRolesSortOrder: () => RoleManagementControllerGetCustomRolesSortOrder,
67
+ ScrymeAuthProvider: () => ScrymeAuthProvider,
68
+ ScrymeClientSDK: () => ScrymeClientSDK,
69
+ ScrymeServerSDK: () => ScrymeServerSDK,
70
+ ServicesUpdateBookingStatusBodyStatus: () => ServicesUpdateBookingStatusBodyStatus,
71
+ TriggerSyncDtoDirection: () => TriggerSyncDtoDirection,
72
+ TriggerSyncDtoSyncTypesItem: () => TriggerSyncDtoSyncTypesItem,
73
+ UpdateIntegrationDefinitionDtoAuthType: () => UpdateIntegrationDefinitionDtoAuthType,
74
+ UpdateIntegrationDefinitionDtoCategory: () => UpdateIntegrationDefinitionDtoCategory,
75
+ UpdateMemberDtoMembershipStatus: () => UpdateMemberDtoMembershipStatus,
76
+ UpdateMemberDtoRole: () => UpdateMemberDtoRole,
77
+ UpdateMemberDtoStatus: () => UpdateMemberDtoStatus,
78
+ UpdatePartnerDtoBenefitType: () => UpdatePartnerDtoBenefitType,
79
+ UpdatePartnerDtoReconciliationPolicy: () => UpdatePartnerDtoReconciliationPolicy,
80
+ UpdateServiceDtoPricingModel: () => UpdateServiceDtoPricingModel,
81
+ UpdateStrapiConnectionDtoEnabledSyncTypesItem: () => UpdateStrapiConnectionDtoEnabledSyncTypesItem,
82
+ UpdateStrapiConnectionDtoSyncDirection: () => UpdateStrapiConnectionDtoSyncDirection,
83
+ accountingMapping: () => accountingMapping,
84
+ adminMapping: () => adminMapping,
85
+ authMapping: () => authMapping,
86
+ buildModule: () => buildModule,
87
+ catalogMapping: () => catalogMapping,
88
+ createClientSDK: () => createClientSDK,
89
+ createServerSDK: () => createServerSDK,
90
+ crmMapping: () => crmMapping,
91
+ getJwtExpiry: () => getJwtExpiry,
92
+ getScrymeV3API: () => getScrymeV3API2,
93
+ inventoryMapping: () => inventoryMapping,
94
+ loyaltyMapping: () => loyaltyMapping,
95
+ membersMapping: () => membersMapping,
96
+ methodsWithOrgSlugSet: () => methodsWithOrgSlugSet,
97
+ ordersMapping: () => ordersMapping,
98
+ posMapping: () => posMapping,
99
+ publicServicesMapping: () => publicServicesMapping,
100
+ servicesMapping: () => servicesMapping,
101
+ useScrymeAuth: () => useScrymeAuth
102
+ });
103
+ module.exports = __toCommonJS(index_exports);
104
+
105
+ // src/generated/scryme.ts
106
+ var import_axios = __toESM(require("axios"));
107
+ var getScrymeV3API = (axiosInstance = import_axios.default) => {
108
+ const inventoryVerifyIntegrity = (orgSlug, options) => {
109
+ return axiosInstance.get(
110
+ `/v3/${orgSlug}/inventory/integrity/verify`,
111
+ options
112
+ );
113
+ };
114
+ const inventoryFixIntegrity = (orgSlug, variantId, params, options) => {
115
+ return axiosInstance.post(
116
+ `/v3/${orgSlug}/inventory/integrity/fix/${variantId}`,
117
+ void 0,
118
+ {
119
+ ...options,
120
+ params: { ...params, ...options?.params }
121
+ }
122
+ );
123
+ };
124
+ const inventoryGetInventory = (orgSlug, params, options) => {
125
+ return axiosInstance.get(
126
+ `/v3/${orgSlug}/inventory`,
127
+ {
128
+ ...options,
129
+ params: { ...params, ...options?.params }
130
+ }
131
+ );
132
+ };
133
+ const inventoryTraceBatch = (orgSlug, identifier, options) => {
134
+ return axiosInstance.get(
135
+ `/v3/${orgSlug}/inventory/trace/${identifier}`,
136
+ options
137
+ );
138
+ };
139
+ const inventorySplitBatch = (orgSlug, id, options) => {
140
+ return axiosInstance.post(
141
+ `/v3/${orgSlug}/inventory/batches/${id}/split`,
142
+ void 0,
143
+ options
144
+ );
145
+ };
146
+ const inventoryMergeBatches = (orgSlug, options) => {
147
+ return axiosInstance.post(
148
+ `/v3/${orgSlug}/inventory/batches/merge`,
149
+ void 0,
150
+ options
151
+ );
152
+ };
153
+ const inventoryCreateAssembly = (orgSlug, options) => {
154
+ return axiosInstance.post(
155
+ `/v3/${orgSlug}/inventory/assemblies`,
156
+ void 0,
157
+ options
158
+ );
159
+ };
160
+ const inventoryCompleteAssembly = (orgSlug, id, options) => {
161
+ return axiosInstance.post(
162
+ `/v3/${orgSlug}/inventory/assemblies/${id}/complete`,
163
+ void 0,
164
+ options
165
+ );
166
+ };
167
+ const inventoryRequestAdjustment = (orgSlug, options) => {
168
+ return axiosInstance.post(
169
+ `/v3/${orgSlug}/inventory/adjustments/request`,
170
+ void 0,
171
+ options
172
+ );
173
+ };
174
+ const inventoryGetAdjustments = (orgSlug, params, options) => {
175
+ return axiosInstance.get(
176
+ `/v3/${orgSlug}/inventory/adjustments`,
177
+ {
178
+ ...options,
179
+ params: { ...params, ...options?.params }
180
+ }
181
+ );
182
+ };
183
+ const inventoryApproveAdjustment = (orgSlug, id, options) => {
184
+ return axiosInstance.patch(
185
+ `/v3/${orgSlug}/inventory/adjustments/${id}/approve`,
186
+ void 0,
187
+ options
188
+ );
189
+ };
190
+ const inventoryRejectAdjustment = (orgSlug, id, options) => {
191
+ return axiosInstance.patch(
192
+ `/v3/${orgSlug}/inventory/adjustments/${id}/reject`,
193
+ void 0,
194
+ options
195
+ );
196
+ };
197
+ const inventoryGetLeadTime = (orgSlug, params, options) => {
198
+ return axiosInstance.get(
199
+ `/v3/${orgSlug}/inventory/analytics/supplier-lead-time`,
200
+ {
201
+ ...options,
202
+ params: { ...params, ...options?.params }
203
+ }
204
+ );
205
+ };
206
+ const inventoryGetWasteAnalysis = (orgSlug, params, options) => {
207
+ return axiosInstance.get(
208
+ `/v3/${orgSlug}/inventory/analytics/waste`,
209
+ {
210
+ ...options,
211
+ params: { ...params, ...options?.params }
212
+ }
213
+ );
214
+ };
215
+ const inventoryCheckB2BAvailability = (orgSlug, checkB2BAvailabilityDto, options) => {
216
+ return axiosInstance.post(
217
+ `/v3/${orgSlug}/inventory/b2b/availability`,
218
+ checkB2BAvailabilityDto,
219
+ options
220
+ );
221
+ };
222
+ const inventoryUnpackBatch = (orgSlug, id, options) => {
223
+ return axiosInstance.post(
224
+ `/v3/${orgSlug}/inventory/batches/${id}/unpack`,
225
+ void 0,
226
+ options
227
+ );
228
+ };
229
+ const inventoryScanUnpackBatch = (orgSlug, options) => {
230
+ return axiosInstance.post(
231
+ `/v3/${orgSlug}/inventory/batches/scan-unpack`,
232
+ void 0,
233
+ options
234
+ );
235
+ };
236
+ const inventoryQuickStockInquiry = (orgSlug, options) => {
237
+ return axiosInstance.post(
238
+ `/v3/${orgSlug}/inventory/b2b/quick-inquiry`,
239
+ void 0,
240
+ options
241
+ );
242
+ };
243
+ const expenseControllerCreateExpense = (createExpenseDto, options) => {
244
+ return axiosInstance.post(
245
+ `/v3/finance/expenses`,
246
+ createExpenseDto,
247
+ options
248
+ );
249
+ };
250
+ const expenseControllerGetExpenses = (params, options) => {
251
+ return axiosInstance.get(
252
+ `/v3/finance/expenses`,
253
+ {
254
+ ...options,
255
+ params: { ...params, ...options?.params }
256
+ }
257
+ );
258
+ };
259
+ const expenseControllerGetExpenseCategories = (options) => {
260
+ return axiosInstance.get(
261
+ `/v3/finance/expenses/categories`,
262
+ options
263
+ );
264
+ };
265
+ const expenseControllerGetExpense = (id, options) => {
266
+ return axiosInstance.get(
267
+ `/v3/finance/expenses/${id}`,
268
+ options
269
+ );
270
+ };
271
+ const pettyCashControllerCreateFund = (createPettyCashFundDto, options) => {
272
+ return axiosInstance.post(
273
+ `/v3/finance/petty-cash`,
274
+ createPettyCashFundDto,
275
+ options
276
+ );
277
+ };
278
+ const pettyCashControllerGetFunds = (options) => {
279
+ return axiosInstance.get(
280
+ `/v3/finance/petty-cash`,
281
+ options
282
+ );
283
+ };
284
+ const pettyCashControllerGetFund = (id, options) => {
285
+ return axiosInstance.get(
286
+ `/v3/finance/petty-cash/${id}`,
287
+ options
288
+ );
289
+ };
290
+ const pettyCashControllerTopUpFund = (id, topUpPettyCashFundDto, options) => {
291
+ return axiosInstance.post(
292
+ `/v3/finance/petty-cash/${id}/top-up`,
293
+ topUpPettyCashFundDto,
294
+ options
295
+ );
296
+ };
297
+ const pettyCashControllerGetFundTransactions = (id, options) => {
298
+ return axiosInstance.get(
299
+ `/v3/finance/petty-cash/${id}/transactions`,
300
+ options
301
+ );
302
+ };
303
+ const utilityAccountControllerCreateAccount = (createUtilityAccountDto, options) => {
304
+ return axiosInstance.post(
305
+ `/v3/finance/utility-accounts`,
306
+ createUtilityAccountDto,
307
+ options
308
+ );
309
+ };
310
+ const utilityAccountControllerGetAccounts = (options) => {
311
+ return axiosInstance.get(
312
+ `/v3/finance/utility-accounts`,
313
+ options
314
+ );
315
+ };
316
+ const utilityAccountControllerGetAccount = (id, options) => {
317
+ return axiosInstance.get(
318
+ `/v3/finance/utility-accounts/${id}`,
319
+ options
320
+ );
321
+ };
322
+ const accountingInitialize = (orgSlug, options) => {
323
+ return axiosInstance.post(
324
+ `/v3/${orgSlug}/finance/accounting/initialize`,
325
+ void 0,
326
+ options
327
+ );
328
+ };
329
+ const accountingGetProfitLoss = (orgSlug, params, options) => {
330
+ return axiosInstance.get(
331
+ `/v3/${orgSlug}/finance/accounting/reports/profit-loss`,
332
+ {
333
+ ...options,
334
+ params: { ...params, ...options?.params }
335
+ }
336
+ );
337
+ };
338
+ const accountingGetBalanceSheet = (orgSlug, params, options) => {
339
+ return axiosInstance.get(
340
+ `/v3/${orgSlug}/finance/accounting/reports/balance-sheet`,
341
+ {
342
+ ...options,
343
+ params: { ...params, ...options?.params }
344
+ }
345
+ );
346
+ };
347
+ const accountingGetCashFlow = (orgSlug, params, options) => {
348
+ return axiosInstance.get(
349
+ `/v3/${orgSlug}/finance/accounting/reports/cash-flow`,
350
+ {
351
+ ...options,
352
+ params: { ...params, ...options?.params }
353
+ }
354
+ );
355
+ };
356
+ const accountingGetTaxSummary = (orgSlug, params, options) => {
357
+ return axiosInstance.get(
358
+ `/v3/${orgSlug}/finance/accounting/reports/tax-summary`,
359
+ {
360
+ ...options,
361
+ params: { ...params, ...options?.params }
362
+ }
363
+ );
364
+ };
365
+ const invoiceControllerCreateInvoice = (createInvoiceDto, options) => {
366
+ return axiosInstance.post(
367
+ `/v3/finance/invoices`,
368
+ createInvoiceDto,
369
+ options
370
+ );
371
+ };
372
+ const invoiceControllerGetInvoices = (options) => {
373
+ return axiosInstance.get(
374
+ `/v3/finance/invoices`,
375
+ options
376
+ );
377
+ };
378
+ const invoiceControllerGetInvoice = (id, options) => {
379
+ return axiosInstance.get(
380
+ `/v3/finance/invoices/${id}`,
381
+ options
382
+ );
383
+ };
384
+ const invoiceControllerUpdateInvoice = (id, updateInvoiceDto, options) => {
385
+ return axiosInstance.put(
386
+ `/v3/finance/invoices/${id}`,
387
+ updateInvoiceDto,
388
+ options
389
+ );
390
+ };
391
+ const invoiceControllerDeleteInvoice = (id, options) => {
392
+ return axiosInstance.delete(
393
+ `/v3/finance/invoices/${id}`,
394
+ options
395
+ );
396
+ };
397
+ const invoiceControllerFinalizeInvoice = (id, options) => {
398
+ return axiosInstance.post(
399
+ `/v3/finance/invoices/${id}/finalize`,
400
+ void 0,
401
+ options
402
+ );
403
+ };
404
+ const invoiceControllerGetTemplates = (options) => {
405
+ return axiosInstance.get(
406
+ `/v3/finance/invoices/templates`,
407
+ options
408
+ );
409
+ };
410
+ const invoiceControllerCreateTemplate = (createInvoiceTemplateDto, options) => {
411
+ return axiosInstance.post(
412
+ `/v3/finance/invoices/templates`,
413
+ createInvoiceTemplateDto,
414
+ options
415
+ );
416
+ };
417
+ const invoiceControllerGetConfig = (options) => {
418
+ return axiosInstance.get(
419
+ `/v3/finance/invoices/config`,
420
+ options
421
+ );
422
+ };
423
+ const invoiceControllerUpdateConfig = (invoiceConfigDto, options) => {
424
+ return axiosInstance.put(
425
+ `/v3/finance/invoices/config`,
426
+ invoiceConfigDto,
427
+ options
428
+ );
429
+ };
430
+ const publicInvoiceControllerDownloadInvoice = (id, params, options) => {
431
+ return axiosInstance.get(
432
+ `/v3/public-invoices/${id}/download`,
433
+ {
434
+ ...options,
435
+ params: { ...params, ...options?.params }
436
+ }
437
+ );
438
+ };
439
+ const publicInvoiceControllerDownloadInvoiceByTransaction = (transactionId, params, options) => {
440
+ return axiosInstance.get(
441
+ `/v3/public-invoices/transactions/${transactionId}/download`,
442
+ {
443
+ ...options,
444
+ params: { ...params, ...options?.params }
445
+ }
446
+ );
447
+ };
448
+ const publicInvoiceControllerDownloadReceipt = (transactionId, params, options) => {
449
+ return axiosInstance.get(
450
+ `/v3/public-invoices/receipts/${transactionId}/download`,
451
+ {
452
+ ...options,
453
+ params: { ...params, ...options?.params }
454
+ }
455
+ );
456
+ };
457
+ const publicInvoiceControllerGeneratePublicLink = (transactionId, params, options) => {
458
+ return axiosInstance.post(
459
+ `/v3/public-invoices/transactions/${transactionId}/generate-public-link`,
460
+ void 0,
461
+ {
462
+ ...options,
463
+ params: { ...params, ...options?.params }
464
+ }
465
+ );
466
+ };
467
+ const authExchangeToken = (tokenRequestDto, options) => {
468
+ return axiosInstance.post(
469
+ `/v3/auth/token`,
470
+ tokenRequestDto,
471
+ options
472
+ );
473
+ };
474
+ const authControllerHandleOAuth2 = (path, options) => {
475
+ return axiosInstance.get(
476
+ `/v3/auth/oauth2/${path}`,
477
+ options
478
+ );
479
+ };
480
+ const adminControllerGetStats = (options) => {
481
+ return axiosInstance.get(
482
+ `/v3/admin/stats`,
483
+ options
484
+ );
485
+ };
486
+ const adminControllerListOrganizations = (options) => {
487
+ return axiosInstance.get(
488
+ `/v3/admin/organizations`,
489
+ options
490
+ );
491
+ };
492
+ const adminControllerCreateOrganization = (createOrganizationDto, options) => {
493
+ return axiosInstance.post(
494
+ `/v3/admin/organizations`,
495
+ createOrganizationDto,
496
+ options
497
+ );
498
+ };
499
+ const adminControllerGetOrganizationDetails = (id, options) => {
500
+ return axiosInstance.get(
501
+ `/v3/admin/organizations/${id}`,
502
+ options
503
+ );
504
+ };
505
+ const adminControllerUpdateOrganization = (id, updateOrganizationDto, options) => {
506
+ return axiosInstance.patch(
507
+ `/v3/admin/organizations/${id}`,
508
+ updateOrganizationDto,
509
+ options
510
+ );
511
+ };
512
+ const adminControllerDeleteOrganization = (id, options) => {
513
+ return axiosInstance.delete(
514
+ `/v3/admin/organizations/${id}`,
515
+ options
516
+ );
517
+ };
518
+ const adminControllerListMembers = (params, options) => {
519
+ return axiosInstance.get(
520
+ `/v3/admin/members`,
521
+ {
522
+ ...options,
523
+ params: { ...params, ...options?.params }
524
+ }
525
+ );
526
+ };
527
+ const adminControllerListUsers = (options) => {
528
+ return axiosInstance.get(
529
+ `/v3/admin/users`,
530
+ options
531
+ );
532
+ };
533
+ const adminControllerBanUser = (id, banUserDto, options) => {
534
+ return axiosInstance.post(
535
+ `/v3/admin/users/${id}/ban`,
536
+ banUserDto,
537
+ options
538
+ );
539
+ };
540
+ const adminControllerUnbanUser = (id, options) => {
541
+ return axiosInstance.post(
542
+ `/v3/admin/users/${id}/unban`,
543
+ void 0,
544
+ options
545
+ );
546
+ };
547
+ const adminControllerListConnectedApps = (options) => {
548
+ return axiosInstance.get(
549
+ `/v3/admin/connected-apps`,
550
+ options
551
+ );
552
+ };
553
+ const adminControllerListSystemLogs = (options) => {
554
+ return axiosInstance.get(
555
+ `/v3/admin/system-logs`,
556
+ options
557
+ );
558
+ };
559
+ const adminControllerListGlobalSettings = (options) => {
560
+ return axiosInstance.get(
561
+ `/v3/admin/settings`,
562
+ options
563
+ );
564
+ };
565
+ const adminControllerSetGlobalSetting = (setGlobalSettingDto, options) => {
566
+ return axiosInstance.post(
567
+ `/v3/admin/settings`,
568
+ setGlobalSettingDto,
569
+ options
570
+ );
571
+ };
572
+ const adminControllerDeleteGlobalSetting = (key, options) => {
573
+ return axiosInstance.delete(
574
+ `/v3/admin/settings/${key}`,
575
+ options
576
+ );
577
+ };
578
+ const adminControllerListTiers = (options) => {
579
+ return axiosInstance.get(
580
+ `/v3/admin/tiers`,
581
+ options
582
+ );
583
+ };
584
+ const adminControllerDefineTier = (defineTierDto, options) => {
585
+ return axiosInstance.post(
586
+ `/v3/admin/tiers`,
587
+ defineTierDto,
588
+ options
589
+ );
590
+ };
591
+ const adminControllerDeleteTier = (slug, options) => {
592
+ return axiosInstance.delete(
593
+ `/v3/admin/tiers/${slug}`,
594
+ options
595
+ );
596
+ };
597
+ const adminControllerGetOrganizationSubscription = (id, options) => {
598
+ return axiosInstance.get(
599
+ `/v3/admin/organizations/${id}/subscription`,
600
+ options
601
+ );
602
+ };
603
+ const adminControllerUpdateOrganizationSubscription = (id, updateSubscriptionDto, options) => {
604
+ return axiosInstance.put(
605
+ `/v3/admin/organizations/${id}/subscription`,
606
+ updateSubscriptionDto,
607
+ options
608
+ );
609
+ };
610
+ const adminControllerListSystemPayments = (options) => {
611
+ return axiosInstance.get(
612
+ `/v3/admin/payments`,
613
+ options
614
+ );
615
+ };
616
+ const adminControllerRecordCustomPayment = (recordCustomPaymentDto, options) => {
617
+ return axiosInstance.post(
618
+ `/v3/admin/payments/record`,
619
+ recordCustomPaymentDto,
620
+ options
621
+ );
622
+ };
623
+ const adminControllerListIntegrationDefinitions = (options) => {
624
+ return axiosInstance.get(
625
+ `/v3/admin/integrations/definitions`,
626
+ options
627
+ );
628
+ };
629
+ const adminControllerCreateIntegrationDefinition = (createIntegrationDefinitionDto, options) => {
630
+ return axiosInstance.post(
631
+ `/v3/admin/integrations/definitions`,
632
+ createIntegrationDefinitionDto,
633
+ options
634
+ );
635
+ };
636
+ const adminControllerUpdateIntegrationDefinition = (id, updateIntegrationDefinitionDto, options) => {
637
+ return axiosInstance.patch(
638
+ `/v3/admin/integrations/definitions/${id}`,
639
+ updateIntegrationDefinitionDto,
640
+ options
641
+ );
642
+ };
643
+ const adminControllerDeleteIntegrationDefinition = (id, options) => {
644
+ return axiosInstance.delete(
645
+ `/v3/admin/integrations/definitions/${id}`,
646
+ options
647
+ );
648
+ };
649
+ const adminControllerListActiveOrganizationIntegrations = (options) => {
650
+ return axiosInstance.get(
651
+ `/v3/admin/integrations/active`,
652
+ options
653
+ );
654
+ };
655
+ const webhooksCreate = (orgSlug, createWebhookDto, options) => {
656
+ return axiosInstance.post(
657
+ `/v3/${orgSlug}/webhooks`,
658
+ createWebhookDto,
659
+ options
660
+ );
661
+ };
662
+ const webhooksList = (orgSlug, options) => {
663
+ return axiosInstance.get(
664
+ `/v3/${orgSlug}/webhooks`,
665
+ options
666
+ );
667
+ };
668
+ const webhooksDelete = (orgSlug, id, options) => {
669
+ return axiosInstance.delete(
670
+ `/v3/${orgSlug}/webhooks/${id}`,
671
+ options
672
+ );
673
+ };
674
+ const windmillCallbackControllerHandleCallback = (options) => {
675
+ return axiosInstance.post(
676
+ `/v3/webhooks/windmill`,
677
+ void 0,
678
+ options
679
+ );
680
+ };
681
+ const windmillCallbackControllerHandleApprovalCallback = (options) => {
682
+ return axiosInstance.post(
683
+ `/v3/webhooks/windmill/approval`,
684
+ void 0,
685
+ options
686
+ );
687
+ };
688
+ const windmillCallbackControllerHandleBakeryDisposalCallback = (options) => {
689
+ return axiosInstance.post(
690
+ `/v3/webhooks/windmill/bakery/disposal`,
691
+ void 0,
692
+ options
693
+ );
694
+ };
695
+ const windmillCallbackControllerHandleOutcomeCallback = (options) => {
696
+ return axiosInstance.post(
697
+ `/v3/webhooks/windmill/outcome`,
698
+ void 0,
699
+ options
700
+ );
701
+ };
702
+ const catalogGetProducts = (orgSlug, params, options) => {
703
+ return axiosInstance.get(
704
+ `/v3/${orgSlug}/catalog/products`,
705
+ {
706
+ ...options,
707
+ params: { ...params, ...options?.params }
708
+ }
709
+ );
710
+ };
711
+ const catalogCreateProduct = (orgSlug, createProductDto, options) => {
712
+ return axiosInstance.post(
713
+ `/v3/${orgSlug}/catalog/products`,
714
+ createProductDto,
715
+ options
716
+ );
717
+ };
718
+ const catalogGetServices = (orgSlug, params, options) => {
719
+ return axiosInstance.get(
720
+ `/v3/${orgSlug}/catalog/services`,
721
+ {
722
+ ...options,
723
+ params: { ...params, ...options?.params }
724
+ }
725
+ );
726
+ };
727
+ const catalogUpdateProduct = (orgSlug, id, updateProductDto, options) => {
728
+ return axiosInstance.patch(
729
+ `/v3/${orgSlug}/catalog/products/${id}`,
730
+ updateProductDto,
731
+ options
732
+ );
733
+ };
734
+ const catalogUpdateSupplierVariant = (orgSlug, supplierId, variantId, updateSupplierProductDto, options) => {
735
+ return axiosInstance.patch(
736
+ `/v3/${orgSlug}/catalog/suppliers/${supplierId}/variants/${variantId}`,
737
+ updateSupplierProductDto,
738
+ options
739
+ );
740
+ };
741
+ const catalogGetPriceChangeRequests = (orgSlug, params, options) => {
742
+ return axiosInstance.get(
743
+ `/v3/${orgSlug}/catalog/price-change-requests`,
744
+ {
745
+ ...options,
746
+ params: { ...params, ...options?.params }
747
+ }
748
+ );
749
+ };
750
+ const catalogReviewPriceChangeRequest = (orgSlug, id, reviewPriceChangeDto, options) => {
751
+ return axiosInstance.post(
752
+ `/v3/${orgSlug}/catalog/price-change-requests/${id}/review`,
753
+ reviewPriceChangeDto,
754
+ options
755
+ );
756
+ };
757
+ const servicesCreateCategory = (orgSlug, createServiceCategoryDto, options) => {
758
+ return axiosInstance.post(
759
+ `/v3/${orgSlug}/services/categories`,
760
+ createServiceCategoryDto,
761
+ options
762
+ );
763
+ };
764
+ const servicesGetCategories = (orgSlug, options) => {
765
+ return axiosInstance.get(
766
+ `/v3/${orgSlug}/services/categories`,
767
+ options
768
+ );
769
+ };
770
+ const servicesUpdateCategory = (orgSlug, id, updateServiceCategoryDto, options) => {
771
+ return axiosInstance.patch(
772
+ `/v3/${orgSlug}/services/categories/${id}`,
773
+ updateServiceCategoryDto,
774
+ options
775
+ );
776
+ };
777
+ const servicesDeleteCategory = (orgSlug, id, options) => {
778
+ return axiosInstance.post(
779
+ `/v3/${orgSlug}/services/categories/${id}/delete`,
780
+ void 0,
781
+ options
782
+ );
783
+ };
784
+ const servicesCreateService = (orgSlug, createServiceDto, options) => {
785
+ return axiosInstance.post(
786
+ `/v3/${orgSlug}/services`,
787
+ createServiceDto,
788
+ options
789
+ );
790
+ };
791
+ const servicesGetServices = (orgSlug, options) => {
792
+ return axiosInstance.get(
793
+ `/v3/${orgSlug}/services`,
794
+ options
795
+ );
796
+ };
797
+ const servicesGetCurrentMemberShifts = (orgSlug, options) => {
798
+ return axiosInstance.get(
799
+ `/v3/${orgSlug}/services/shifts/me`,
800
+ options
801
+ );
802
+ };
803
+ const servicesGetShifts = (orgSlug, params, options) => {
804
+ return axiosInstance.get(
805
+ `/v3/${orgSlug}/services/shifts`,
806
+ {
807
+ ...options,
808
+ params: { ...params, ...options?.params }
809
+ }
810
+ );
811
+ };
812
+ const servicesGetService = (orgSlug, id, options) => {
813
+ return axiosInstance.get(
814
+ `/v3/${orgSlug}/services/${id}`,
815
+ options
816
+ );
817
+ };
818
+ const servicesUpdateService = (orgSlug, id, updateServiceDto, options) => {
819
+ return axiosInstance.patch(
820
+ `/v3/${orgSlug}/services/${id}`,
821
+ updateServiceDto,
822
+ options
823
+ );
824
+ };
825
+ const servicesDeleteService = (orgSlug, id, options) => {
826
+ return axiosInstance.post(
827
+ `/v3/${orgSlug}/services/${id}/delete`,
828
+ void 0,
829
+ options
830
+ );
831
+ };
832
+ const servicesCreateResource = (orgSlug, createServiceResourceDto, options) => {
833
+ return axiosInstance.post(
834
+ `/v3/${orgSlug}/services/resources`,
835
+ createServiceResourceDto,
836
+ options
837
+ );
838
+ };
839
+ const servicesGetResources = (orgSlug, options) => {
840
+ return axiosInstance.get(
841
+ `/v3/${orgSlug}/services/resources`,
842
+ options
843
+ );
844
+ };
845
+ const servicesUpdateResource = (orgSlug, id, updateServiceResourceDto, options) => {
846
+ return axiosInstance.patch(
847
+ `/v3/${orgSlug}/services/resources/${id}`,
848
+ updateServiceResourceDto,
849
+ options
850
+ );
851
+ };
852
+ const servicesDeleteResource = (orgSlug, id, options) => {
853
+ return axiosInstance.post(
854
+ `/v3/${orgSlug}/services/resources/${id}/delete`,
855
+ void 0,
856
+ options
857
+ );
858
+ };
859
+ const servicesCreateBooking = (orgSlug, createBookingDto, options) => {
860
+ return axiosInstance.post(
861
+ `/v3/${orgSlug}/services/bookings`,
862
+ createBookingDto,
863
+ options
864
+ );
865
+ };
866
+ const servicesGetBookings = (orgSlug, options) => {
867
+ return axiosInstance.get(
868
+ `/v3/${orgSlug}/services/bookings`,
869
+ options
870
+ );
871
+ };
872
+ const servicesGetBooking = (orgSlug, id, options) => {
873
+ return axiosInstance.get(
874
+ `/v3/${orgSlug}/services/bookings/${id}`,
875
+ options
876
+ );
877
+ };
878
+ const servicesUpdateBookingStatus = (orgSlug, id, servicesUpdateBookingStatusBody, options) => {
879
+ return axiosInstance.patch(
880
+ `/v3/${orgSlug}/services/bookings/${id}/status`,
881
+ servicesUpdateBookingStatusBody,
882
+ options
883
+ );
884
+ };
885
+ const servicesCompleteBooking = (orgSlug, id, completeBookingDto, options) => {
886
+ return axiosInstance.patch(
887
+ `/v3/${orgSlug}/services/bookings/${id}/complete`,
888
+ completeBookingDto,
889
+ options
890
+ );
891
+ };
892
+ const servicesCreateShift = (orgSlug, memberId, servicesCreateShiftBody, options) => {
893
+ return axiosInstance.post(
894
+ `/v3/${orgSlug}/services/staff/${memberId}/shifts`,
895
+ servicesCreateShiftBody,
896
+ options
897
+ );
898
+ };
899
+ const servicesGetStaffShifts = (orgSlug, memberId, options) => {
900
+ return axiosInstance.get(
901
+ `/v3/${orgSlug}/services/staff/${memberId}/shifts`,
902
+ options
903
+ );
904
+ };
905
+ const servicesAddBreak = (orgSlug, shiftId, servicesAddBreakBody, options) => {
906
+ return axiosInstance.post(
907
+ `/v3/${orgSlug}/services/shifts/${shiftId}/breaks`,
908
+ servicesAddBreakBody,
909
+ options
910
+ );
911
+ };
912
+ const servicesRegisterCustomerApp = (orgSlug, servicesRegisterCustomerAppBody, options) => {
913
+ return axiosInstance.post(
914
+ `/v3/${orgSlug}/services/register-customer-app`,
915
+ servicesRegisterCustomerAppBody,
916
+ options
917
+ );
918
+ };
919
+ const servicesGetUtilization = (orgSlug, params, options) => {
920
+ return axiosInstance.get(
921
+ `/v3/${orgSlug}/services/analytics/utilization`,
922
+ {
923
+ ...options,
924
+ params: { ...params, ...options?.params }
925
+ }
926
+ );
927
+ };
928
+ const servicesGetPerformance = (orgSlug, params, options) => {
929
+ return axiosInstance.get(
930
+ `/v3/${orgSlug}/services/analytics/performance`,
931
+ {
932
+ ...options,
933
+ params: { ...params, ...options?.params }
934
+ }
935
+ );
936
+ };
937
+ const servicesGetFunnel = (orgSlug, params, options) => {
938
+ return axiosInstance.get(
939
+ `/v3/${orgSlug}/services/analytics/funnel`,
940
+ {
941
+ ...options,
942
+ params: { ...params, ...options?.params }
943
+ }
944
+ );
945
+ };
946
+ const publicServicesListServices = (orgSlug, options) => {
947
+ return axiosInstance.get(
948
+ `/v3/public/${orgSlug}/services`,
949
+ options
950
+ );
951
+ };
952
+ const publicServicesGetCategories = (orgSlug, options) => {
953
+ return axiosInstance.get(
954
+ `/v3/public/${orgSlug}/services/categories`,
955
+ options
956
+ );
957
+ };
958
+ const publicServicesGetService = (orgSlug, id, options) => {
959
+ return axiosInstance.get(
960
+ `/v3/public/${orgSlug}/services/${id}`,
961
+ options
962
+ );
963
+ };
964
+ const publicServicesGetAvailability = (orgSlug, id, params, options) => {
965
+ return axiosInstance.get(
966
+ `/v3/public/${orgSlug}/services/${id}/availability`,
967
+ {
968
+ ...options,
969
+ params: { ...params, ...options?.params }
970
+ }
971
+ );
972
+ };
973
+ const publicServicesRequestOtp = (orgSlug, requestOtpDto, options) => {
974
+ return axiosInstance.post(
975
+ `/v3/public/${orgSlug}/services/otp/request`,
976
+ requestOtpDto,
977
+ options
978
+ );
979
+ };
980
+ const publicServicesVerifyOtp = (orgSlug, verifyOtpDto, options) => {
981
+ return axiosInstance.post(
982
+ `/v3/public/${orgSlug}/services/otp/verify`,
983
+ verifyOtpDto,
984
+ options
985
+ );
986
+ };
987
+ const publicServicesCreatePublicBooking = (orgSlug, publicBookingDto, options) => {
988
+ return axiosInstance.post(
989
+ `/v3/public/${orgSlug}/services/bookings`,
990
+ publicBookingDto,
991
+ options
992
+ );
993
+ };
994
+ const customersProvisionZitadel = (orgSlug, provisionZitadelDto, options) => {
995
+ return axiosInstance.post(
996
+ `/v3/${orgSlug}/customers/zitadel/provision`,
997
+ provisionZitadelDto,
998
+ options
999
+ );
1000
+ };
1001
+ const customersGetCustomers = (orgSlug, params, options) => {
1002
+ return axiosInstance.get(
1003
+ `/v3/${orgSlug}/customers`,
1004
+ {
1005
+ ...options,
1006
+ params: { ...params, ...options?.params }
1007
+ }
1008
+ );
1009
+ };
1010
+ const customersRegister = (orgSlug, registerCustomerDto, options) => {
1011
+ return axiosInstance.post(
1012
+ `/v3/${orgSlug}/customers/register`,
1013
+ registerCustomerDto,
1014
+ options
1015
+ );
1016
+ };
1017
+ const customersLogin = (orgSlug, customerLoginDto, options) => {
1018
+ return axiosInstance.post(
1019
+ `/v3/${orgSlug}/customers/auth/login`,
1020
+ customerLoginDto,
1021
+ options
1022
+ );
1023
+ };
1024
+ const customersGetCurrentSession = (orgSlug, options) => {
1025
+ return axiosInstance.get(
1026
+ `/v3/${orgSlug}/customers/auth/session`,
1027
+ options
1028
+ );
1029
+ };
1030
+ const customersGetSessions = (orgSlug, options) => {
1031
+ return axiosInstance.get(
1032
+ `/v3/${orgSlug}/customers/auth/sessions`,
1033
+ options
1034
+ );
1035
+ };
1036
+ const customersRevokeAllSessions = (orgSlug, params, options) => {
1037
+ return axiosInstance.delete(
1038
+ `/v3/${orgSlug}/customers/auth/sessions`,
1039
+ {
1040
+ ...options,
1041
+ params: { ...params, ...options?.params }
1042
+ }
1043
+ );
1044
+ };
1045
+ const customersRevokeSession = (orgSlug, id, options) => {
1046
+ return axiosInstance.delete(
1047
+ `/v3/${orgSlug}/customers/auth/sessions/${id}`,
1048
+ options
1049
+ );
1050
+ };
1051
+ const customersUpdate = (orgSlug, id, updateCustomerDto, options) => {
1052
+ return axiosInstance.patch(
1053
+ `/v3/${orgSlug}/customers/${id}`,
1054
+ updateCustomerDto,
1055
+ options
1056
+ );
1057
+ };
1058
+ const customersGetCustomerById = (orgSlug, id, options) => {
1059
+ return axiosInstance.get(
1060
+ `/v3/${orgSlug}/customers/${id}`,
1061
+ options
1062
+ );
1063
+ };
1064
+ const customersDelete = (orgSlug, id, options) => {
1065
+ return axiosInstance.delete(
1066
+ `/v3/${orgSlug}/customers/${id}`,
1067
+ options
1068
+ );
1069
+ };
1070
+ const customersGetAddresses = (orgSlug, id, options) => {
1071
+ return axiosInstance.get(
1072
+ `/v3/${orgSlug}/customers/${id}/addresses`,
1073
+ options
1074
+ );
1075
+ };
1076
+ const customersAddAddress = (orgSlug, id, addressDto, options) => {
1077
+ return axiosInstance.post(
1078
+ `/v3/${orgSlug}/customers/${id}/addresses`,
1079
+ addressDto,
1080
+ options
1081
+ );
1082
+ };
1083
+ const businessAccountControllerCreate = (orgSlug, createBusinessAccountDto, options) => {
1084
+ return axiosInstance.post(
1085
+ `/v3/${orgSlug}/business-accounts`,
1086
+ createBusinessAccountDto,
1087
+ options
1088
+ );
1089
+ };
1090
+ const businessAccountControllerGetOne = (orgSlug, id, options) => {
1091
+ return axiosInstance.get(
1092
+ `/v3/${orgSlug}/business-accounts/${id}`,
1093
+ options
1094
+ );
1095
+ };
1096
+ const crmControllerCreateRecord = (orgSlug, createCrmRecordDto, options) => {
1097
+ return axiosInstance.post(
1098
+ `/v3/${orgSlug}/crm/records`,
1099
+ createCrmRecordDto,
1100
+ options
1101
+ );
1102
+ };
1103
+ const crmControllerGetRecord = (orgSlug, id, options) => {
1104
+ return axiosInstance.get(
1105
+ `/v3/${orgSlug}/crm/records/${id}`,
1106
+ options
1107
+ );
1108
+ };
1109
+ const crmControllerUpdateRecord = (orgSlug, id, updateCrmRecordDto, options) => {
1110
+ return axiosInstance.patch(
1111
+ `/v3/${orgSlug}/crm/records/${id}`,
1112
+ updateCrmRecordDto,
1113
+ options
1114
+ );
1115
+ };
1116
+ const crmControllerCreateNote = (orgSlug, createCrmNoteDto, options) => {
1117
+ return axiosInstance.post(
1118
+ `/v3/${orgSlug}/crm/notes`,
1119
+ createCrmNoteDto,
1120
+ options
1121
+ );
1122
+ };
1123
+ const crmControllerGetRecordNotes = (orgSlug, id, options) => {
1124
+ return axiosInstance.get(
1125
+ `/v3/${orgSlug}/crm/records/${id}/notes`,
1126
+ options
1127
+ );
1128
+ };
1129
+ const crmControllerCreateActivity = (orgSlug, createCrmActivityDto, options) => {
1130
+ return axiosInstance.post(
1131
+ `/v3/${orgSlug}/crm/activities`,
1132
+ createCrmActivityDto,
1133
+ options
1134
+ );
1135
+ };
1136
+ const crmControllerGetTimeline = (orgSlug, id, options) => {
1137
+ return axiosInstance.get(
1138
+ `/v3/${orgSlug}/crm/records/${id}/timeline`,
1139
+ options
1140
+ );
1141
+ };
1142
+ const crmControllerCreateObject = (orgSlug, createCrmObjectDto, options) => {
1143
+ return axiosInstance.post(
1144
+ `/v3/${orgSlug}/crm/objects`,
1145
+ createCrmObjectDto,
1146
+ options
1147
+ );
1148
+ };
1149
+ const crmControllerListObjects = (orgSlug, options) => {
1150
+ return axiosInstance.get(
1151
+ `/v3/${orgSlug}/crm/objects`,
1152
+ options
1153
+ );
1154
+ };
1155
+ const crmControllerCreateField = (orgSlug, objectId, createCrmFieldDto, options) => {
1156
+ return axiosInstance.post(
1157
+ `/v3/${orgSlug}/crm/objects/${objectId}/fields`,
1158
+ createCrmFieldDto,
1159
+ options
1160
+ );
1161
+ };
1162
+ const crmControllerListFields = (orgSlug, objectId, options) => {
1163
+ return axiosInstance.get(
1164
+ `/v3/${orgSlug}/crm/objects/${objectId}/fields`,
1165
+ options
1166
+ );
1167
+ };
1168
+ const crmControllerCreateRelationship = (orgSlug, createCrmRelationshipDto, options) => {
1169
+ return axiosInstance.post(
1170
+ `/v3/${orgSlug}/crm/relationships`,
1171
+ createCrmRelationshipDto,
1172
+ options
1173
+ );
1174
+ };
1175
+ const crmControllerListRelationships = (orgSlug, options) => {
1176
+ return axiosInstance.get(
1177
+ `/v3/${orgSlug}/crm/relationships`,
1178
+ options
1179
+ );
1180
+ };
1181
+ const crmControllerCreateAssociation = (orgSlug, createCrmAssociationDto, options) => {
1182
+ return axiosInstance.post(
1183
+ `/v3/${orgSlug}/crm/associations`,
1184
+ createCrmAssociationDto,
1185
+ options
1186
+ );
1187
+ };
1188
+ const crmControllerListRecordAssociations = (orgSlug, id, options) => {
1189
+ return axiosInstance.get(
1190
+ `/v3/${orgSlug}/crm/records/${id}/associations`,
1191
+ options
1192
+ );
1193
+ };
1194
+ const loyaltyRedeemReward = (orgSlug, redeemRewardDto, options) => {
1195
+ return axiosInstance.post(
1196
+ `/v3/${orgSlug}/loyalty/vouchers/redeem`,
1197
+ redeemRewardDto,
1198
+ options
1199
+ );
1200
+ };
1201
+ const loyaltyGetCustomerStatus = (orgSlug, id, options) => {
1202
+ return axiosInstance.get(
1203
+ `/v3/${orgSlug}/loyalty/customers/${id}/status`,
1204
+ options
1205
+ );
1206
+ };
1207
+ const loyaltyValidateVoucher = (orgSlug, validateVoucherDto, options) => {
1208
+ return axiosInstance.post(
1209
+ `/v3/${orgSlug}/loyalty/vouchers/validate`,
1210
+ validateVoucherDto,
1211
+ options
1212
+ );
1213
+ };
1214
+ const ordersCreateOrder = (orgSlug, createOrderDto, options) => {
1215
+ return axiosInstance.post(
1216
+ `/v3/${orgSlug}/orders`,
1217
+ createOrderDto,
1218
+ options
1219
+ );
1220
+ };
1221
+ const ordersGetOrders = (orgSlug, params, options) => {
1222
+ return axiosInstance.get(
1223
+ `/v3/${orgSlug}/orders`,
1224
+ {
1225
+ ...options,
1226
+ params: { ...params, ...options?.params }
1227
+ }
1228
+ );
1229
+ };
1230
+ const ordersUpdateStatus = (orgSlug, id, updateOrderStatusDto, options) => {
1231
+ return axiosInstance.post(
1232
+ `/v3/${orgSlug}/orders/${id}/status`,
1233
+ updateOrderStatusDto,
1234
+ options
1235
+ );
1236
+ };
1237
+ const ordersRequestB2BQuote = (orgSlug, requestB2BQuoteDto, options) => {
1238
+ return axiosInstance.post(
1239
+ `/v3/${orgSlug}/orders/b2b/quotes`,
1240
+ requestB2BQuoteDto,
1241
+ options
1242
+ );
1243
+ };
1244
+ const ordersConvertQuoteToOrder = (orgSlug, id, options) => {
1245
+ return axiosInstance.post(
1246
+ `/v3/${orgSlug}/orders/b2b/quotes/${id}/convert`,
1247
+ void 0,
1248
+ options
1249
+ );
1250
+ };
1251
+ const paymentsControllerHandleStkCallback = (orgSlug, paymentId, options) => {
1252
+ return axiosInstance.post(
1253
+ `/v3/${orgSlug}/payments/webhooks/mpesa/stkpush/${paymentId}`,
1254
+ void 0,
1255
+ options
1256
+ );
1257
+ };
1258
+ const pOSProvision = (orgSlug, provisionDeviceDto, options) => {
1259
+ return axiosInstance.post(
1260
+ `/v3/${orgSlug}/pos/provision`,
1261
+ provisionDeviceDto,
1262
+ options
1263
+ );
1264
+ };
1265
+ const pOSLogin = (orgSlug, posLoginDto, options) => {
1266
+ return axiosInstance.post(
1267
+ `/v3/${orgSlug}/pos/login`,
1268
+ posLoginDto,
1269
+ options
1270
+ );
1271
+ };
1272
+ const pOSGetMe = (orgSlug, options) => {
1273
+ return axiosInstance.get(
1274
+ `/v3/${orgSlug}/pos/me`,
1275
+ options
1276
+ );
1277
+ };
1278
+ const pOSProcessSale = (orgSlug, processSaleDto, options) => {
1279
+ return axiosInstance.post(
1280
+ `/v3/${orgSlug}/pos/sale`,
1281
+ processSaleDto,
1282
+ options
1283
+ );
1284
+ };
1285
+ const pOSSync = (orgSlug, options) => {
1286
+ return axiosInstance.get(
1287
+ `/v3/${orgSlug}/pos/sync`,
1288
+ options
1289
+ );
1290
+ };
1291
+ const pOSGetTransactions = (orgSlug, options) => {
1292
+ return axiosInstance.get(
1293
+ `/v3/${orgSlug}/pos/transactions`,
1294
+ options
1295
+ );
1296
+ };
1297
+ const pOSRegisterPettyCash = (orgSlug, registerPettyCashDto, options) => {
1298
+ return axiosInstance.post(
1299
+ `/v3/${orgSlug}/pos/petty-cash`,
1300
+ registerPettyCashDto,
1301
+ options
1302
+ );
1303
+ };
1304
+ const pOSGetPettyCashFunds = (orgSlug, options) => {
1305
+ return axiosInstance.get(
1306
+ `/v3/${orgSlug}/pos/petty-cash/funds`,
1307
+ options
1308
+ );
1309
+ };
1310
+ const pOSGetPettyCashTransactions = (orgSlug, params, options) => {
1311
+ return axiosInstance.get(
1312
+ `/v3/${orgSlug}/pos/petty-cash/transactions`,
1313
+ {
1314
+ ...options,
1315
+ params: { ...params, ...options?.params }
1316
+ }
1317
+ );
1318
+ };
1319
+ const membersControllerGetMembers = (orgSlug, params, options) => {
1320
+ return axiosInstance.get(
1321
+ `/v3/${orgSlug}/members`,
1322
+ {
1323
+ ...options,
1324
+ params: { ...params, ...options?.params }
1325
+ }
1326
+ );
1327
+ };
1328
+ const membersControllerCreateMember = (orgSlug, createMemberDto, options) => {
1329
+ return axiosInstance.post(
1330
+ `/v3/${orgSlug}/members`,
1331
+ createMemberDto,
1332
+ options
1333
+ );
1334
+ };
1335
+ const membersControllerGetMember = (orgSlug, id, options) => {
1336
+ return axiosInstance.get(
1337
+ `/v3/${orgSlug}/members/${id}`,
1338
+ options
1339
+ );
1340
+ };
1341
+ const membersControllerUpdateMember = (orgSlug, id, updateMemberDto, options) => {
1342
+ return axiosInstance.patch(
1343
+ `/v3/${orgSlug}/members/${id}`,
1344
+ updateMemberDto,
1345
+ options
1346
+ );
1347
+ };
1348
+ const membersControllerDeleteMember = (orgSlug, id, options) => {
1349
+ return axiosInstance.delete(
1350
+ `/v3/${orgSlug}/members/${id}`,
1351
+ options
1352
+ );
1353
+ };
1354
+ const membersControllerGetMemberActivity = (orgSlug, id, options) => {
1355
+ return axiosInstance.get(
1356
+ `/v3/${orgSlug}/members/${id}/activity`,
1357
+ options
1358
+ );
1359
+ };
1360
+ const membersControllerUpdateStatus = (orgSlug, id, options) => {
1361
+ return axiosInstance.patch(
1362
+ `/v3/${orgSlug}/members/${id}/status`,
1363
+ void 0,
1364
+ options
1365
+ );
1366
+ };
1367
+ const membersControllerAdminCheckOut = (orgSlug, memberId, checkOutDto, options) => {
1368
+ return axiosInstance.post(
1369
+ `/v3/${orgSlug}/members/${memberId}/attendance/check-out`,
1370
+ checkOutDto,
1371
+ options
1372
+ );
1373
+ };
1374
+ const terminalMembersControllerLogin = (terminalLoginDto, options) => {
1375
+ return axiosInstance.post(
1376
+ `/v3/members/login`,
1377
+ terminalLoginDto,
1378
+ options
1379
+ );
1380
+ };
1381
+ const invitationsList = (orgSlug, params, options) => {
1382
+ return axiosInstance.get(
1383
+ `/v3/${orgSlug}/members/invitations`,
1384
+ {
1385
+ ...options,
1386
+ params: { ...params, ...options?.params }
1387
+ }
1388
+ );
1389
+ };
1390
+ const invitationsCreate = (orgSlug, createInvitationDto, options) => {
1391
+ return axiosInstance.post(
1392
+ `/v3/${orgSlug}/members/invitations`,
1393
+ createInvitationDto,
1394
+ options
1395
+ );
1396
+ };
1397
+ const invitationsRevoke = (orgSlug, id, options) => {
1398
+ return axiosInstance.delete(
1399
+ `/v3/${orgSlug}/members/invitations/${id}`,
1400
+ options
1401
+ );
1402
+ };
1403
+ const invitationsAccept = (orgSlug, acceptInvitationDto, options) => {
1404
+ return axiosInstance.post(
1405
+ `/v3/${orgSlug}/members/invitations/accept`,
1406
+ acceptInvitationDto,
1407
+ options
1408
+ );
1409
+ };
1410
+ const roleManagementControllerGetCustomRoles = (orgSlug, params, options) => {
1411
+ return axiosInstance.get(
1412
+ `/v3/${orgSlug}/members/roles/custom`,
1413
+ {
1414
+ ...options,
1415
+ params: { ...params, ...options?.params }
1416
+ }
1417
+ );
1418
+ };
1419
+ const roleManagementControllerCreateCustomRole = (orgSlug, createCustomRoleDto, options) => {
1420
+ return axiosInstance.post(
1421
+ `/v3/${orgSlug}/members/roles/custom`,
1422
+ createCustomRoleDto,
1423
+ options
1424
+ );
1425
+ };
1426
+ const roleManagementControllerUpdateCustomRole = (orgSlug, id, updateCustomRoleDto, options) => {
1427
+ return axiosInstance.patch(
1428
+ `/v3/${orgSlug}/members/roles/custom/${id}`,
1429
+ updateCustomRoleDto,
1430
+ options
1431
+ );
1432
+ };
1433
+ const roleManagementControllerDeleteCustomRole = (orgSlug, id, options) => {
1434
+ return axiosInstance.delete(
1435
+ `/v3/${orgSlug}/members/roles/custom/${id}`,
1436
+ options
1437
+ );
1438
+ };
1439
+ const roleManagementControllerGetPermissionSets = (orgSlug, options) => {
1440
+ return axiosInstance.get(
1441
+ `/v3/${orgSlug}/members/roles/permission-sets`,
1442
+ options
1443
+ );
1444
+ };
1445
+ const roleManagementControllerCreatePermissionSet = (orgSlug, createPermissionSetDto, options) => {
1446
+ return axiosInstance.post(
1447
+ `/v3/${orgSlug}/members/roles/permission-sets`,
1448
+ createPermissionSetDto,
1449
+ options
1450
+ );
1451
+ };
1452
+ const roleManagementControllerGetRoleGroups = (orgSlug, options) => {
1453
+ return axiosInstance.get(
1454
+ `/v3/${orgSlug}/members/roles/groups`,
1455
+ options
1456
+ );
1457
+ };
1458
+ const roleManagementControllerCreateRoleGroup = (orgSlug, createRoleGroupDto, options) => {
1459
+ return axiosInstance.post(
1460
+ `/v3/${orgSlug}/members/roles/groups`,
1461
+ createRoleGroupDto,
1462
+ options
1463
+ );
1464
+ };
1465
+ const roleManagementControllerAssignRoles = (orgSlug, memberId, options) => {
1466
+ return axiosInstance.post(
1467
+ `/v3/${orgSlug}/members/roles/member/${memberId}/assign`,
1468
+ void 0,
1469
+ options
1470
+ );
1471
+ };
1472
+ const roleManagementControllerRemoveRoles = (orgSlug, memberId, options) => {
1473
+ return axiosInstance.post(
1474
+ `/v3/${orgSlug}/members/roles/member/${memberId}/remove`,
1475
+ void 0,
1476
+ options
1477
+ );
1478
+ };
1479
+ const departmentsList = (orgSlug, params, options) => {
1480
+ return axiosInstance.get(
1481
+ `/v3/${orgSlug}/members/departments`,
1482
+ {
1483
+ ...options,
1484
+ params: { ...params, ...options?.params }
1485
+ }
1486
+ );
1487
+ };
1488
+ const departmentsCreate = (orgSlug, createDepartmentDto, options) => {
1489
+ return axiosInstance.post(
1490
+ `/v3/${orgSlug}/members/departments`,
1491
+ createDepartmentDto,
1492
+ options
1493
+ );
1494
+ };
1495
+ const departmentsGet = (orgSlug, id, options) => {
1496
+ return axiosInstance.get(
1497
+ `/v3/${orgSlug}/members/departments/${id}`,
1498
+ options
1499
+ );
1500
+ };
1501
+ const departmentsUpdate = (orgSlug, id, updateDepartmentDto, options) => {
1502
+ return axiosInstance.patch(
1503
+ `/v3/${orgSlug}/members/departments/${id}`,
1504
+ updateDepartmentDto,
1505
+ options
1506
+ );
1507
+ };
1508
+ const departmentsDelete = (orgSlug, id, options) => {
1509
+ return axiosInstance.delete(
1510
+ `/v3/${orgSlug}/members/departments/${id}`,
1511
+ options
1512
+ );
1513
+ };
1514
+ const departmentsAddMember = (orgSlug, id, addDepartmentMemberDto, options) => {
1515
+ return axiosInstance.post(
1516
+ `/v3/${orgSlug}/members/departments/${id}/members`,
1517
+ addDepartmentMemberDto,
1518
+ options
1519
+ );
1520
+ };
1521
+ const departmentsRemoveMember = (orgSlug, id, memberId, options) => {
1522
+ return axiosInstance.delete(
1523
+ `/v3/${orgSlug}/members/departments/${id}/members/${memberId}`,
1524
+ options
1525
+ );
1526
+ };
1527
+ const attendanceControllerGetLogs = (orgSlug, params, options) => {
1528
+ return axiosInstance.get(
1529
+ `/v3/${orgSlug}/members/attendance/logs`,
1530
+ {
1531
+ ...options,
1532
+ params: { ...params, ...options?.params }
1533
+ }
1534
+ );
1535
+ };
1536
+ const attendanceControllerCheckIn = (orgSlug, checkInDto, options) => {
1537
+ return axiosInstance.post(
1538
+ `/v3/${orgSlug}/members/attendance/check-in`,
1539
+ checkInDto,
1540
+ options
1541
+ );
1542
+ };
1543
+ const attendanceControllerCheckOut = (orgSlug, checkOutDto, options) => {
1544
+ return axiosInstance.post(
1545
+ `/v3/${orgSlug}/members/attendance/check-out`,
1546
+ checkOutDto,
1547
+ options
1548
+ );
1549
+ };
1550
+ const attendanceControllerGetMyStatus = (orgSlug, options) => {
1551
+ return axiosInstance.get(
1552
+ `/v3/${orgSlug}/members/attendance/me/status`,
1553
+ options
1554
+ );
1555
+ };
1556
+ const attendanceControllerGetStatus = (orgSlug, memberId, options) => {
1557
+ return axiosInstance.get(
1558
+ `/v3/${orgSlug}/members/attendance/${memberId}/status`,
1559
+ options
1560
+ );
1561
+ };
1562
+ const announcementControllerBroadcastAnnouncement = (orgSlug, announcementDto, options) => {
1563
+ return axiosInstance.post(
1564
+ `/v3/${orgSlug}/announcements`,
1565
+ announcementDto,
1566
+ options
1567
+ );
1568
+ };
1569
+ const cartControllerGetCart = (orgSlug, params, options) => {
1570
+ return axiosInstance.get(
1571
+ `/v3/${orgSlug}/cart`,
1572
+ {
1573
+ ...options,
1574
+ params: { ...params, ...options?.params }
1575
+ }
1576
+ );
1577
+ };
1578
+ const cartControllerClearCart = (orgSlug, params, options) => {
1579
+ return axiosInstance.delete(
1580
+ `/v3/${orgSlug}/cart`,
1581
+ {
1582
+ ...options,
1583
+ params: { ...params, ...options?.params }
1584
+ }
1585
+ );
1586
+ };
1587
+ const cartControllerAddToCart = (orgSlug, addToCartDto, options) => {
1588
+ return axiosInstance.post(
1589
+ `/v3/${orgSlug}/cart/items`,
1590
+ addToCartDto,
1591
+ options
1592
+ );
1593
+ };
1594
+ const cartControllerRemoveFromCart = (orgSlug, removeFromCartDto, options) => {
1595
+ return axiosInstance.delete(
1596
+ `/v3/${orgSlug}/cart/items`,
1597
+ { data: removeFromCartDto, ...options }
1598
+ );
1599
+ };
1600
+ const favoritesControllerGetFavorites = (orgSlug, options) => {
1601
+ return axiosInstance.get(
1602
+ `/v3/${orgSlug}/favorites`,
1603
+ options
1604
+ );
1605
+ };
1606
+ const favoritesControllerAddFavorite = (orgSlug, favoriteDto, options) => {
1607
+ return axiosInstance.post(
1608
+ `/v3/${orgSlug}/favorites`,
1609
+ favoriteDto,
1610
+ options
1611
+ );
1612
+ };
1613
+ const favoritesControllerRemoveFavorite = (orgSlug, favoriteDto, options) => {
1614
+ return axiosInstance.delete(
1615
+ `/v3/${orgSlug}/favorites`,
1616
+ { data: favoriteDto, ...options }
1617
+ );
1618
+ };
1619
+ const stockingGetPurchases = (orgSlug, params, options) => {
1620
+ return axiosInstance.get(
1621
+ `/v3/${orgSlug}/stocking/purchases`,
1622
+ {
1623
+ ...options,
1624
+ params: { ...params, ...options?.params }
1625
+ }
1626
+ );
1627
+ };
1628
+ const stockingCreatePurchase = (orgSlug, createPurchaseDto, options) => {
1629
+ return axiosInstance.post(
1630
+ `/v3/${orgSlug}/stocking/purchases`,
1631
+ createPurchaseDto,
1632
+ options
1633
+ );
1634
+ };
1635
+ const stockingReceivePurchase = (orgSlug, id, receivePurchaseDto, options) => {
1636
+ return axiosInstance.post(
1637
+ `/v3/${orgSlug}/stocking/purchases/${id}/receive`,
1638
+ receivePurchaseDto,
1639
+ options
1640
+ );
1641
+ };
1642
+ const stockingGetTransfers = (orgSlug, params, options) => {
1643
+ return axiosInstance.get(
1644
+ `/v3/${orgSlug}/stocking/transfers`,
1645
+ {
1646
+ ...options,
1647
+ params: { ...params, ...options?.params }
1648
+ }
1649
+ );
1650
+ };
1651
+ const stockingCreateTransfer = (orgSlug, createTransferDto, options) => {
1652
+ return axiosInstance.post(
1653
+ `/v3/${orgSlug}/stocking/transfers`,
1654
+ createTransferDto,
1655
+ options
1656
+ );
1657
+ };
1658
+ const stockingShipTransfer = (orgSlug, id, shipTransferDto, options) => {
1659
+ return axiosInstance.post(
1660
+ `/v3/${orgSlug}/stocking/transfers/${id}/ship`,
1661
+ shipTransferDto,
1662
+ options
1663
+ );
1664
+ };
1665
+ const stockingReceiveTransfer = (orgSlug, id, receiveTransferDto, options) => {
1666
+ return axiosInstance.post(
1667
+ `/v3/${orgSlug}/stocking/transfers/${id}/receive`,
1668
+ receiveTransferDto,
1669
+ options
1670
+ );
1671
+ };
1672
+ const stockingGetRequests = (orgSlug, params, options) => {
1673
+ return axiosInstance.get(
1674
+ `/v3/${orgSlug}/stocking/requests`,
1675
+ {
1676
+ ...options,
1677
+ params: { ...params, ...options?.params }
1678
+ }
1679
+ );
1680
+ };
1681
+ const stockingGetPendingDispatch = (orgSlug, params, options) => {
1682
+ return axiosInstance.get(
1683
+ `/v3/${orgSlug}/stocking/reconciliation/pending-dispatch`,
1684
+ {
1685
+ ...options,
1686
+ params: { ...params, ...options?.params }
1687
+ }
1688
+ );
1689
+ };
1690
+ const stockingDispatchOrders = (orgSlug, dispatchOrderDto, options) => {
1691
+ return axiosInstance.post(
1692
+ `/v3/${orgSlug}/stocking/reconciliation/dispatch`,
1693
+ dispatchOrderDto,
1694
+ options
1695
+ );
1696
+ };
1697
+ const stockingGetActiveDeliveries = (orgSlug, params, options) => {
1698
+ return axiosInstance.get(
1699
+ `/v3/${orgSlug}/stocking/reconciliation/active-deliveries`,
1700
+ {
1701
+ ...options,
1702
+ params: { ...params, ...options?.params }
1703
+ }
1704
+ );
1705
+ };
1706
+ const stockingReconcilePod = (orgSlug, reconcilePodDto, options) => {
1707
+ return axiosInstance.post(
1708
+ `/v3/${orgSlug}/stocking/reconciliation/reconcile-pod`,
1709
+ reconcilePodDto,
1710
+ options
1711
+ );
1712
+ };
1713
+ const stockingGetPhysicalReconciliations = (orgSlug, params, options) => {
1714
+ return axiosInstance.get(
1715
+ `/v3/${orgSlug}/stocking/physical-reconciliations`,
1716
+ {
1717
+ ...options,
1718
+ params: { ...params, ...options?.params }
1719
+ }
1720
+ );
1721
+ };
1722
+ const stockingSubmitPhysicalReconciliation = (orgSlug, submitReconciliationDto, options) => {
1723
+ return axiosInstance.post(
1724
+ `/v3/${orgSlug}/stocking/physical-reconciliations`,
1725
+ submitReconciliationDto,
1726
+ options
1727
+ );
1728
+ };
1729
+ const stockingGetReconciliationReport = (orgSlug, id, options) => {
1730
+ return axiosInstance.get(
1731
+ `/v3/${orgSlug}/stocking/physical-reconciliations/${id}/report`,
1732
+ options
1733
+ );
1734
+ };
1735
+ const stockingGetPartners = (orgSlug, options) => {
1736
+ return axiosInstance.get(
1737
+ `/v3/${orgSlug}/stocking/partners`,
1738
+ options
1739
+ );
1740
+ };
1741
+ const stockingCreatePartner = (orgSlug, createPartnerDto, options) => {
1742
+ return axiosInstance.post(
1743
+ `/v3/${orgSlug}/stocking/partners`,
1744
+ createPartnerDto,
1745
+ options
1746
+ );
1747
+ };
1748
+ const stockingGetPartner = (orgSlug, id, options) => {
1749
+ return axiosInstance.get(
1750
+ `/v3/${orgSlug}/stocking/partners/${id}`,
1751
+ options
1752
+ );
1753
+ };
1754
+ const stockingUpdatePartner = (orgSlug, id, updatePartnerDto, options) => {
1755
+ return axiosInstance.patch(
1756
+ `/v3/${orgSlug}/stocking/partners/${id}`,
1757
+ updatePartnerDto,
1758
+ options
1759
+ );
1760
+ };
1761
+ const stockingAdjustPartnerWallet = (orgSlug, id, partnerWalletActionDto, options) => {
1762
+ return axiosInstance.post(
1763
+ `/v3/${orgSlug}/stocking/partners/${id}/wallet/adjust`,
1764
+ partnerWalletActionDto,
1765
+ options
1766
+ );
1767
+ };
1768
+ const standalonePosControllerCreateSetupKey = (createSetupKeyDto, options) => {
1769
+ return axiosInstance.post(
1770
+ `/v3/standalone-pos/setup-keys`,
1771
+ createSetupKeyDto,
1772
+ options
1773
+ );
1774
+ };
1775
+ const standalonePosControllerActivateDevice = (activateDeviceDto, options) => {
1776
+ return axiosInstance.post(
1777
+ `/v3/standalone-pos/activate`,
1778
+ activateDeviceDto,
1779
+ options
1780
+ );
1781
+ };
1782
+ const standalonePosControllerValidateKey = (options) => {
1783
+ return axiosInstance.get(
1784
+ `/v3/standalone-pos/validate`,
1785
+ options
1786
+ );
1787
+ };
1788
+ const standalonePosControllerLinkOrganization = (linkOrganizationDto, options) => {
1789
+ return axiosInstance.patch(
1790
+ `/v3/standalone-pos/link-org`,
1791
+ linkOrganizationDto,
1792
+ options
1793
+ );
1794
+ };
1795
+ const b2BGetCatalog = (orgSlug, params, options) => {
1796
+ return axiosInstance.get(
1797
+ `/v3/${orgSlug}/b2b/catalog`,
1798
+ {
1799
+ ...options,
1800
+ params: { ...params, ...options?.params }
1801
+ }
1802
+ );
1803
+ };
1804
+ const b2BGetInvoices = (orgSlug, options) => {
1805
+ return axiosInstance.get(
1806
+ `/v3/${orgSlug}/b2b/invoices`,
1807
+ options
1808
+ );
1809
+ };
1810
+ const b2BGetOrders = (orgSlug, options) => {
1811
+ return axiosInstance.get(
1812
+ `/v3/${orgSlug}/b2b/orders`,
1813
+ options
1814
+ );
1815
+ };
1816
+ const b2BCreateOrder = (orgSlug, createB2BOrderDto, options) => {
1817
+ return axiosInstance.post(
1818
+ `/v3/${orgSlug}/b2b/orders`,
1819
+ createB2BOrderDto,
1820
+ options
1821
+ );
1822
+ };
1823
+ const b2BCreateQuote = (orgSlug, createB2BOrderDto, options) => {
1824
+ return axiosInstance.post(
1825
+ `/v3/${orgSlug}/b2b/quotes`,
1826
+ createB2BOrderDto,
1827
+ options
1828
+ );
1829
+ };
1830
+ const crmIntegrationsGetAuthUrl = (orgSlug, provider, options) => {
1831
+ return axiosInstance.get(
1832
+ `/v3/${orgSlug}/crm-integrations/${provider}/auth`,
1833
+ options
1834
+ );
1835
+ };
1836
+ const crmIntegrationsHandleCallback = (orgSlug, provider, params, options) => {
1837
+ return axiosInstance.get(
1838
+ `/v3/${orgSlug}/crm-integrations/${provider}/callback`,
1839
+ {
1840
+ ...options,
1841
+ params: { ...params, ...options?.params }
1842
+ }
1843
+ );
1844
+ };
1845
+ const crmIntegrationsHandleWebhook = (orgSlug, provider, options) => {
1846
+ return axiosInstance.post(
1847
+ `/v3/${orgSlug}/crm-integrations/${provider}/webhook`,
1848
+ void 0,
1849
+ options
1850
+ );
1851
+ };
1852
+ const crmIntegrationsReplyToActivity = (orgSlug, id, options) => {
1853
+ return axiosInstance.post(
1854
+ `/v3/${orgSlug}/crm-integrations/activities/${id}/reply`,
1855
+ void 0,
1856
+ options
1857
+ );
1858
+ };
1859
+ const unitsGetUnits = (orgSlug, params, options) => {
1860
+ return axiosInstance.get(
1861
+ `/v3/${orgSlug}/units`,
1862
+ {
1863
+ ...options,
1864
+ params: { ...params, ...options?.params }
1865
+ }
1866
+ );
1867
+ };
1868
+ const strapiCreateConnection = (orgSlug, createStrapiConnectionDto, options) => {
1869
+ return axiosInstance.post(
1870
+ `/v3/${orgSlug}/strapi/connections`,
1871
+ createStrapiConnectionDto,
1872
+ options
1873
+ );
1874
+ };
1875
+ const strapiListConnections = (orgSlug, options) => {
1876
+ return axiosInstance.get(
1877
+ `/v3/${orgSlug}/strapi/connections`,
1878
+ options
1879
+ );
1880
+ };
1881
+ const strapiGetConnection = (orgSlug, connectionId, options) => {
1882
+ return axiosInstance.get(
1883
+ `/v3/${orgSlug}/strapi/connections/${connectionId}`,
1884
+ options
1885
+ );
1886
+ };
1887
+ const strapiUpdateConnection = (orgSlug, connectionId, updateStrapiConnectionDto, options) => {
1888
+ return axiosInstance.patch(
1889
+ `/v3/${orgSlug}/strapi/connections/${connectionId}`,
1890
+ updateStrapiConnectionDto,
1891
+ options
1892
+ );
1893
+ };
1894
+ const strapiDeleteConnection = (orgSlug, connectionId, options) => {
1895
+ return axiosInstance.delete(
1896
+ `/v3/${orgSlug}/strapi/connections/${connectionId}`,
1897
+ options
1898
+ );
1899
+ };
1900
+ const strapiTriggerSync = (orgSlug, connectionId, triggerSyncDto, options) => {
1901
+ return axiosInstance.post(
1902
+ `/v3/${orgSlug}/strapi/connections/${connectionId}/sync`,
1903
+ triggerSyncDto,
1904
+ options
1905
+ );
1906
+ };
1907
+ const strapiEnqueueSync = (orgSlug, connectionId, triggerSyncDto, options) => {
1908
+ return axiosInstance.post(
1909
+ `/v3/${orgSlug}/strapi/connections/${connectionId}/sync/queue`,
1910
+ triggerSyncDto,
1911
+ options
1912
+ );
1913
+ };
1914
+ const strapiGetWebhookLogs = (orgSlug, connectionId, options) => {
1915
+ return axiosInstance.get(
1916
+ `/v3/${orgSlug}/strapi/connections/${connectionId}/webhook-logs`,
1917
+ options
1918
+ );
1919
+ };
1920
+ const strapiGetSyncLogs = (orgSlug, connectionId, options) => {
1921
+ return axiosInstance.get(
1922
+ `/v3/${orgSlug}/strapi/connections/${connectionId}/sync-logs`,
1923
+ options
1924
+ );
1925
+ };
1926
+ const strapiExchangeCustomerToken = (orgSlug, connectionId, options) => {
1927
+ return axiosInstance.post(
1928
+ `/v3/${orgSlug}/strapi/connections/${connectionId}/customers/exchange-token`,
1929
+ void 0,
1930
+ options
1931
+ );
1932
+ };
1933
+ const strapiRegisterCustomer = (orgSlug, connectionId, options) => {
1934
+ return axiosInstance.post(
1935
+ `/v3/${orgSlug}/strapi/connections/${connectionId}/customers/register`,
1936
+ void 0,
1937
+ options
1938
+ );
1939
+ };
1940
+ const strapiReceiveWebhook = (connectionId, options) => {
1941
+ return axiosInstance.post(
1942
+ `/v3/webhooks/strapi/${connectionId}`,
1943
+ void 0,
1944
+ options
1945
+ );
1946
+ };
1947
+ const analyticsControllerGetDashboardAnalytics = (orgSlug, options) => {
1948
+ return axiosInstance.get(
1949
+ `/v3/${orgSlug}/analytics/dashboard`,
1950
+ options
1951
+ );
1952
+ };
1953
+ const analyticsControllerGetResourceUtilization = (orgSlug, params, options) => {
1954
+ return axiosInstance.get(
1955
+ `/v3/${orgSlug}/analytics/utilization`,
1956
+ {
1957
+ ...options,
1958
+ params: { ...params, ...options?.params }
1959
+ }
1960
+ );
1961
+ };
1962
+ 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 };
1963
+ };
1964
+
1965
+ // src/generated/model/addDepartmentMemberDtoRole.ts
1966
+ var AddDepartmentMemberDtoRole = {
1967
+ HEAD: "HEAD",
1968
+ MANAGER: "MANAGER",
1969
+ MEMBER: "MEMBER",
1970
+ VIEWER: "VIEWER"
1971
+ };
1972
+
1973
+ // src/generated/model/attendanceControllerGetLogsSortOrder.ts
1974
+ var AttendanceControllerGetLogsSortOrder = {
1975
+ asc: "asc",
1976
+ desc: "desc"
1977
+ };
1978
+
1979
+ // src/generated/model/cmsCustomFieldsDtoPublishStatus.ts
1980
+ var CmsCustomFieldsDtoPublishStatus = {
1981
+ Draft: "Draft",
1982
+ Published: "Published",
1983
+ Scheduled: "Scheduled",
1984
+ Archived: "Archived"
1985
+ };
1986
+
1987
+ // src/generated/model/createCrmFieldDtoType.ts
1988
+ var CreateCrmFieldDtoType = {
1989
+ TEXT: "TEXT",
1990
+ NUMBER: "NUMBER",
1991
+ BOOLEAN: "BOOLEAN",
1992
+ DATE: "DATE",
1993
+ SELECT: "SELECT",
1994
+ MULTI_SELECT: "MULTI_SELECT",
1995
+ EMAIL: "EMAIL",
1996
+ PHONE: "PHONE",
1997
+ URL: "URL",
1998
+ JSON: "JSON"
1999
+ };
2000
+
2001
+ // src/generated/model/createCrmRelationshipDtoType.ts
2002
+ var CreateCrmRelationshipDtoType = {
2003
+ ONE_TO_ONE: "ONE_TO_ONE",
2004
+ ONE_TO_MANY: "ONE_TO_MANY",
2005
+ MANY_TO_MANY: "MANY_TO_MANY"
2006
+ };
2007
+
2008
+ // src/generated/model/createExpenseDtoPaymentMethod.ts
2009
+ var CreateExpenseDtoPaymentMethod = {
2010
+ CASH: "CASH",
2011
+ CREDIT: "CREDIT",
2012
+ CARD: "CARD",
2013
+ MOBILE_PAYMENT: "MOBILE_PAYMENT",
2014
+ MPESA_C2B: "MPESA_C2B",
2015
+ BANK_TRANSFER: "BANK_TRANSFER",
2016
+ CHEQUE: "CHEQUE",
2017
+ STORE_CREDIT: "STORE_CREDIT",
2018
+ GIFT_CARD: "GIFT_CARD",
2019
+ LOYALTY_POINTS: "LOYALTY_POINTS",
2020
+ ON_ACCOUNT: "ON_ACCOUNT",
2021
+ MPESA: "MPESA",
2022
+ OTHER: "OTHER"
2023
+ };
2024
+
2025
+ // src/generated/model/createIntegrationDefinitionDtoAuthType.ts
2026
+ var CreateIntegrationDefinitionDtoAuthType = {
2027
+ API_KEY: "API_KEY",
2028
+ OAUTH2: "OAUTH2",
2029
+ OTHER: "OTHER"
2030
+ };
2031
+
2032
+ // src/generated/model/createIntegrationDefinitionDtoCategory.ts
2033
+ var CreateIntegrationDefinitionDtoCategory = {
2034
+ E_COMMERCE: "E_COMMERCE",
2035
+ ACCOUNTING: "ACCOUNTING",
2036
+ MARKETING: "MARKETING",
2037
+ PAYMENT_GATEWAY: "PAYMENT_GATEWAY",
2038
+ CRM: "CRM",
2039
+ COMMUNICATION: "COMMUNICATION",
2040
+ OTHER: "OTHER"
2041
+ };
2042
+
2043
+ // src/generated/model/createInvitationDtoRole.ts
2044
+ var CreateInvitationDtoRole = {
2045
+ OWNER: "OWNER",
2046
+ ADMIN: "ADMIN",
2047
+ MANAGER: "MANAGER",
2048
+ EMPLOYEE: "EMPLOYEE",
2049
+ CASHIER: "CASHIER",
2050
+ REPORTER: "REPORTER",
2051
+ GUEST: "GUEST"
2052
+ };
2053
+
2054
+ // src/generated/model/createMemberDtoRole.ts
2055
+ var CreateMemberDtoRole = {
2056
+ OWNER: "OWNER",
2057
+ ADMIN: "ADMIN",
2058
+ MANAGER: "MANAGER",
2059
+ EMPLOYEE: "EMPLOYEE",
2060
+ CASHIER: "CASHIER",
2061
+ REPORTER: "REPORTER",
2062
+ GUEST: "GUEST"
2063
+ };
2064
+
2065
+ // src/generated/model/createOrderDtoChannel.ts
2066
+ var CreateOrderDtoChannel = {
2067
+ ECOMMERCE_STORE: "ECOMMERCE_STORE",
2068
+ MOBILE_APP: "MOBILE_APP"
2069
+ };
2070
+
2071
+ // src/generated/model/createPartnerDtoBenefitType.ts
2072
+ var CreatePartnerDtoBenefitType = {
2073
+ COMMISSION: "COMMISSION",
2074
+ FIXED_FEE: "FIXED_FEE",
2075
+ PROFIT_MARGIN: "PROFIT_MARGIN",
2076
+ NONE: "NONE"
2077
+ };
2078
+
2079
+ // src/generated/model/createPartnerDtoReconciliationPolicy.ts
2080
+ var CreatePartnerDtoReconciliationPolicy = {
2081
+ RETURN_TO_STOCK: "RETURN_TO_STOCK",
2082
+ MARK_AS_WASTE: "MARK_AS_WASTE",
2083
+ PARTNER_CHARGED: "PARTNER_CHARGED"
2084
+ };
2085
+
2086
+ // src/generated/model/createServiceDtoPricingModel.ts
2087
+ var CreateServiceDtoPricingModel = {
2088
+ FIXED: "FIXED",
2089
+ HOURLY: "HOURLY",
2090
+ VARIABLE: "VARIABLE"
2091
+ };
2092
+
2093
+ // src/generated/model/createStrapiConnectionDtoEnabledSyncTypesItem.ts
2094
+ var CreateStrapiConnectionDtoEnabledSyncTypesItem = {
2095
+ PRODUCTS: "PRODUCTS",
2096
+ INVENTORY: "INVENTORY",
2097
+ ORDERS: "ORDERS",
2098
+ CUSTOMERS: "CUSTOMERS",
2099
+ CATEGORIES: "CATEGORIES",
2100
+ PRICES: "PRICES"
2101
+ };
2102
+
2103
+ // src/generated/model/createStrapiConnectionDtoSyncDirection.ts
2104
+ var CreateStrapiConnectionDtoSyncDirection = {
2105
+ INBOUND: "INBOUND",
2106
+ OUTBOUND: "OUTBOUND",
2107
+ BIDIRECTIONAL: "BIDIRECTIONAL"
2108
+ };
2109
+
2110
+ // src/generated/model/createTransferDtoPriority.ts
2111
+ var CreateTransferDtoPriority = {
2112
+ LOW: "LOW",
2113
+ MEDIUM: "MEDIUM",
2114
+ HIGH: "HIGH",
2115
+ URGENT: "URGENT"
2116
+ };
2117
+
2118
+ // src/generated/model/createUtilityAccountDtoType.ts
2119
+ var CreateUtilityAccountDtoType = {
2120
+ ELECTRICITY: "ELECTRICITY",
2121
+ WATER: "WATER",
2122
+ INTERNET: "INTERNET",
2123
+ GAS: "GAS",
2124
+ WASTE_MANAGEMENT: "WASTE_MANAGEMENT",
2125
+ OTHER: "OTHER"
2126
+ };
2127
+
2128
+ // src/generated/model/departmentsListSortOrder.ts
2129
+ var DepartmentsListSortOrder = {
2130
+ asc: "asc",
2131
+ desc: "desc"
2132
+ };
2133
+
2134
+ // src/generated/model/expenseControllerGetExpensesStatus.ts
2135
+ var ExpenseControllerGetExpensesStatus = {
2136
+ PENDING: "PENDING",
2137
+ PENDING_APPROVAL: "PENDING_APPROVAL",
2138
+ APPROVED: "APPROVED",
2139
+ REJECTED: "REJECTED",
2140
+ PAID: "PAID",
2141
+ REIMBURSED: "REIMBURSED",
2142
+ VOIDED: "VOIDED"
2143
+ };
2144
+
2145
+ // src/generated/model/invitationResponseDtoRole.ts
2146
+ var InvitationResponseDtoRole = {
2147
+ OWNER: "OWNER",
2148
+ ADMIN: "ADMIN",
2149
+ MANAGER: "MANAGER",
2150
+ EMPLOYEE: "EMPLOYEE",
2151
+ CASHIER: "CASHIER",
2152
+ REPORTER: "REPORTER",
2153
+ GUEST: "GUEST"
2154
+ };
2155
+
2156
+ // src/generated/model/invitationResponseDtoStatus.ts
2157
+ var InvitationResponseDtoStatus = {
2158
+ PENDING: "PENDING",
2159
+ ACCEPTED: "ACCEPTED",
2160
+ DECLINED: "DECLINED",
2161
+ EXPIRED: "EXPIRED"
2162
+ };
2163
+
2164
+ // src/generated/model/invitationsListSortOrder.ts
2165
+ var InvitationsListSortOrder = {
2166
+ asc: "asc",
2167
+ desc: "desc"
2168
+ };
2169
+
2170
+ // src/generated/model/invitationsListStatus.ts
2171
+ var InvitationsListStatus = {
2172
+ PENDING: "PENDING",
2173
+ ACCEPTED: "ACCEPTED",
2174
+ DECLINED: "DECLINED",
2175
+ EXPIRED: "EXPIRED"
2176
+ };
2177
+
2178
+ // src/generated/model/memberResponseDtoMembershipStatus.ts
2179
+ var MemberResponseDtoMembershipStatus = {
2180
+ ACTIVE: "ACTIVE",
2181
+ PENDING_APPROVAL: "PENDING_APPROVAL",
2182
+ SUSPENDED: "SUSPENDED",
2183
+ REJECTED: "REJECTED"
2184
+ };
2185
+
2186
+ // src/generated/model/memberResponseDtoRole.ts
2187
+ var MemberResponseDtoRole = {
2188
+ OWNER: "OWNER",
2189
+ ADMIN: "ADMIN",
2190
+ MANAGER: "MANAGER",
2191
+ EMPLOYEE: "EMPLOYEE",
2192
+ CASHIER: "CASHIER",
2193
+ REPORTER: "REPORTER",
2194
+ GUEST: "GUEST"
2195
+ };
2196
+
2197
+ // src/generated/model/memberResponseDtoStatus.ts
2198
+ var MemberResponseDtoStatus = {
2199
+ ONLINE: "ONLINE",
2200
+ OFFLINE: "OFFLINE"
2201
+ };
2202
+
2203
+ // src/generated/model/membersControllerGetMembersMembershipStatus.ts
2204
+ var MembersControllerGetMembersMembershipStatus = {
2205
+ ACTIVE: "ACTIVE",
2206
+ PENDING_APPROVAL: "PENDING_APPROVAL",
2207
+ SUSPENDED: "SUSPENDED",
2208
+ REJECTED: "REJECTED"
2209
+ };
2210
+
2211
+ // src/generated/model/membersControllerGetMembersRole.ts
2212
+ var MembersControllerGetMembersRole = {
2213
+ OWNER: "OWNER",
2214
+ ADMIN: "ADMIN",
2215
+ MANAGER: "MANAGER",
2216
+ EMPLOYEE: "EMPLOYEE",
2217
+ CASHIER: "CASHIER",
2218
+ REPORTER: "REPORTER",
2219
+ GUEST: "GUEST"
2220
+ };
2221
+
2222
+ // src/generated/model/membersControllerGetMembersSortOrder.ts
2223
+ var MembersControllerGetMembersSortOrder = {
2224
+ asc: "asc",
2225
+ desc: "desc"
2226
+ };
2227
+
2228
+ // src/generated/model/reconcilePodDtoOutcome.ts
2229
+ var ReconcilePodDtoOutcome = {
2230
+ DELIVERED: "DELIVERED",
2231
+ FAILED: "FAILED",
2232
+ PARTIAL: "PARTIAL"
2233
+ };
2234
+
2235
+ // src/generated/model/registerPettyCashDtoPaymentMethod.ts
2236
+ var RegisterPettyCashDtoPaymentMethod = {
2237
+ CASH: "CASH",
2238
+ CREDIT: "CREDIT",
2239
+ CARD: "CARD",
2240
+ MOBILE_PAYMENT: "MOBILE_PAYMENT",
2241
+ MPESA_C2B: "MPESA_C2B",
2242
+ BANK_TRANSFER: "BANK_TRANSFER",
2243
+ CHEQUE: "CHEQUE",
2244
+ STORE_CREDIT: "STORE_CREDIT",
2245
+ GIFT_CARD: "GIFT_CARD",
2246
+ LOYALTY_POINTS: "LOYALTY_POINTS",
2247
+ ON_ACCOUNT: "ON_ACCOUNT",
2248
+ MPESA: "MPESA",
2249
+ OTHER: "OTHER"
2250
+ };
2251
+
2252
+ // src/generated/model/reviewPriceChangeDtoStatus.ts
2253
+ var ReviewPriceChangeDtoStatus = {
2254
+ PENDING: "PENDING",
2255
+ APPROVED: "APPROVED",
2256
+ REJECTED: "REJECTED",
2257
+ EXPIRED: "EXPIRED",
2258
+ CANCELLED: "CANCELLED"
2259
+ };
2260
+
2261
+ // src/generated/model/roleManagementControllerGetCustomRolesSortOrder.ts
2262
+ var RoleManagementControllerGetCustomRolesSortOrder = {
2263
+ asc: "asc",
2264
+ desc: "desc"
2265
+ };
2266
+
2267
+ // src/generated/model/servicesUpdateBookingStatusBodyStatus.ts
2268
+ var ServicesUpdateBookingStatusBodyStatus = {
2269
+ REQUESTED: "REQUESTED",
2270
+ SCHEDULED: "SCHEDULED",
2271
+ IN_PROGRESS: "IN_PROGRESS",
2272
+ COMPLETED: "COMPLETED",
2273
+ CANCELLED: "CANCELLED",
2274
+ NOSHOW: "NOSHOW"
2275
+ };
2276
+
2277
+ // src/generated/model/triggerSyncDtoDirection.ts
2278
+ var TriggerSyncDtoDirection = {
2279
+ INBOUND: "INBOUND",
2280
+ OUTBOUND: "OUTBOUND",
2281
+ BIDIRECTIONAL: "BIDIRECTIONAL"
2282
+ };
2283
+
2284
+ // src/generated/model/triggerSyncDtoSyncTypesItem.ts
2285
+ var TriggerSyncDtoSyncTypesItem = {
2286
+ PRODUCTS: "PRODUCTS",
2287
+ INVENTORY: "INVENTORY",
2288
+ ORDERS: "ORDERS",
2289
+ CUSTOMERS: "CUSTOMERS",
2290
+ CATEGORIES: "CATEGORIES",
2291
+ PRICES: "PRICES"
2292
+ };
2293
+
2294
+ // src/generated/model/updateIntegrationDefinitionDtoAuthType.ts
2295
+ var UpdateIntegrationDefinitionDtoAuthType = {
2296
+ API_KEY: "API_KEY",
2297
+ OAUTH2: "OAUTH2",
2298
+ OTHER: "OTHER"
2299
+ };
2300
+
2301
+ // src/generated/model/updateIntegrationDefinitionDtoCategory.ts
2302
+ var UpdateIntegrationDefinitionDtoCategory = {
2303
+ E_COMMERCE: "E_COMMERCE",
2304
+ ACCOUNTING: "ACCOUNTING",
2305
+ MARKETING: "MARKETING",
2306
+ PAYMENT_GATEWAY: "PAYMENT_GATEWAY",
2307
+ CRM: "CRM",
2308
+ COMMUNICATION: "COMMUNICATION",
2309
+ OTHER: "OTHER"
2310
+ };
2311
+
2312
+ // src/generated/model/updateMemberDtoMembershipStatus.ts
2313
+ var UpdateMemberDtoMembershipStatus = {
2314
+ ACTIVE: "ACTIVE",
2315
+ PENDING_APPROVAL: "PENDING_APPROVAL",
2316
+ SUSPENDED: "SUSPENDED",
2317
+ REJECTED: "REJECTED"
2318
+ };
2319
+
2320
+ // src/generated/model/updateMemberDtoRole.ts
2321
+ var UpdateMemberDtoRole = {
2322
+ OWNER: "OWNER",
2323
+ ADMIN: "ADMIN",
2324
+ MANAGER: "MANAGER",
2325
+ EMPLOYEE: "EMPLOYEE",
2326
+ CASHIER: "CASHIER",
2327
+ REPORTER: "REPORTER",
2328
+ GUEST: "GUEST"
2329
+ };
2330
+
2331
+ // src/generated/model/updateMemberDtoStatus.ts
2332
+ var UpdateMemberDtoStatus = {
2333
+ ONLINE: "ONLINE",
2334
+ OFFLINE: "OFFLINE"
2335
+ };
2336
+
2337
+ // src/generated/model/updatePartnerDtoBenefitType.ts
2338
+ var UpdatePartnerDtoBenefitType = {
2339
+ COMMISSION: "COMMISSION",
2340
+ FIXED_FEE: "FIXED_FEE",
2341
+ PROFIT_MARGIN: "PROFIT_MARGIN",
2342
+ NONE: "NONE"
2343
+ };
2344
+
2345
+ // src/generated/model/updatePartnerDtoReconciliationPolicy.ts
2346
+ var UpdatePartnerDtoReconciliationPolicy = {
2347
+ RETURN_TO_STOCK: "RETURN_TO_STOCK",
2348
+ MARK_AS_WASTE: "MARK_AS_WASTE",
2349
+ PARTNER_CHARGED: "PARTNER_CHARGED"
2350
+ };
2351
+
2352
+ // src/generated/model/updateServiceDtoPricingModel.ts
2353
+ var UpdateServiceDtoPricingModel = {
2354
+ FIXED: "FIXED",
2355
+ HOURLY: "HOURLY",
2356
+ VARIABLE: "VARIABLE"
2357
+ };
2358
+
2359
+ // src/generated/model/updateStrapiConnectionDtoEnabledSyncTypesItem.ts
2360
+ var UpdateStrapiConnectionDtoEnabledSyncTypesItem = {
2361
+ PRODUCTS: "PRODUCTS",
2362
+ INVENTORY: "INVENTORY",
2363
+ ORDERS: "ORDERS",
2364
+ CUSTOMERS: "CUSTOMERS",
2365
+ CATEGORIES: "CATEGORIES",
2366
+ PRICES: "PRICES"
2367
+ };
2368
+
2369
+ // src/generated/model/updateStrapiConnectionDtoSyncDirection.ts
2370
+ var UpdateStrapiConnectionDtoSyncDirection = {
2371
+ INBOUND: "INBOUND",
2372
+ OUTBOUND: "OUTBOUND",
2373
+ BIDIRECTIONAL: "BIDIRECTIONAL"
2374
+ };
2375
+
2376
+ // src/base.ts
2377
+ var methodsWithOrgSlugSet = /* @__PURE__ */ new Set([
2378
+ "publicServicesListServices",
2379
+ "publicServicesGetCategories",
2380
+ "publicServicesGetService",
2381
+ "publicServicesGetAvailability",
2382
+ "publicServicesRequestOtp",
2383
+ "publicServicesVerifyOtp",
2384
+ "publicServicesCreatePublicBooking",
2385
+ "inventoryVerifyIntegrity",
2386
+ "inventoryFixIntegrity",
2387
+ "inventoryGetInventory",
2388
+ "inventoryTraceBatch",
2389
+ "inventorySplitBatch",
2390
+ "inventoryMergeBatches",
2391
+ "inventoryCreateAssembly",
2392
+ "inventoryCompleteAssembly",
2393
+ "inventoryRequestAdjustment",
2394
+ "inventoryGetAdjustments",
2395
+ "inventoryApproveAdjustment",
2396
+ "inventoryRejectAdjustment",
2397
+ "inventoryGetLeadTime",
2398
+ "inventoryGetWasteAnalysis",
2399
+ "inventoryCheckB2BAvailability",
2400
+ "inventoryUnpackBatch",
2401
+ "inventoryScanUnpackBatch",
2402
+ "inventoryQuickStockInquiry",
2403
+ "accountingInitialize",
2404
+ "accountingGetProfitLoss",
2405
+ "accountingGetBalanceSheet",
2406
+ "accountingGetCashFlow",
2407
+ "accountingGetTaxSummary",
2408
+ "webhooksCreate",
2409
+ "webhooksList",
2410
+ "webhooksDelete",
2411
+ "catalogGetProducts",
2412
+ "catalogCreateProduct",
2413
+ "catalogGetServices",
2414
+ "catalogUpdateProduct",
2415
+ "catalogUpdateSupplierVariant",
2416
+ "catalogGetPriceChangeRequests",
2417
+ "catalogReviewPriceChangeRequest",
2418
+ "servicesCreateCategory",
2419
+ "servicesGetCategories",
2420
+ "servicesUpdateCategory",
2421
+ "servicesDeleteCategory",
2422
+ "servicesCreateService",
2423
+ "servicesGetServices",
2424
+ "servicesGetCurrentMemberShifts",
2425
+ "servicesGetShifts",
2426
+ "servicesGetService",
2427
+ "servicesUpdateService",
2428
+ "servicesDeleteService",
2429
+ "servicesCreateResource",
2430
+ "servicesGetResources",
2431
+ "servicesUpdateResource",
2432
+ "servicesDeleteResource",
2433
+ "servicesCreateBooking",
2434
+ "servicesGetBookings",
2435
+ "servicesGetBooking",
2436
+ "servicesUpdateBookingStatus",
2437
+ "servicesCompleteBooking",
2438
+ "servicesCreateShift",
2439
+ "servicesGetStaffShifts",
2440
+ "servicesAddBreak",
2441
+ "servicesRegisterCustomerApp",
2442
+ "servicesGetUtilization",
2443
+ "servicesGetPerformance",
2444
+ "servicesGetFunnel",
2445
+ "customersProvisionZitadel",
2446
+ "customersGetCustomers",
2447
+ "customersRegister",
2448
+ "customersUpdate",
2449
+ "customersGetCustomerById",
2450
+ "customersDelete",
2451
+ "customersGetAddresses",
2452
+ "customersAddAddress",
2453
+ "customersGetCurrentSession",
2454
+ "businessAccountControllerCreate",
2455
+ "businessAccountControllerGetOne",
2456
+ "crmControllerCreateRecord",
2457
+ "crmControllerGetRecord",
2458
+ "crmControllerUpdateRecord",
2459
+ "crmControllerCreateNote",
2460
+ "crmControllerGetRecordNotes",
2461
+ "crmControllerCreateActivity",
2462
+ "crmControllerGetTimeline",
2463
+ "crmControllerCreateObject",
2464
+ "crmControllerListObjects",
2465
+ "crmControllerCreateField",
2466
+ "crmControllerListFields",
2467
+ "crmControllerCreateRelationship",
2468
+ "crmControllerListRelationships",
2469
+ "crmControllerCreateAssociation",
2470
+ "crmControllerListRecordAssociations",
2471
+ "loyaltyRedeemReward",
2472
+ "loyaltyGetCustomerStatus",
2473
+ "loyaltyValidateVoucher",
2474
+ "ordersCreateOrder",
2475
+ "ordersGetOrders",
2476
+ "ordersUpdateStatus",
2477
+ "ordersRequestB2BQuote",
2478
+ "ordersConvertQuoteToOrder",
2479
+ "paymentsControllerHandleStkCallback",
2480
+ "pOSProvision",
2481
+ "pOSLogin",
2482
+ "pOSGetMe",
2483
+ "pOSProcessSale",
2484
+ "pOSSync",
2485
+ "pOSGetTransactions",
2486
+ "pOSRegisterPettyCash",
2487
+ "pOSGetPettyCashFunds",
2488
+ "pOSGetPettyCashTransactions",
2489
+ "membersControllerGetMembers",
2490
+ "membersControllerCreateMember",
2491
+ "membersControllerGetMember",
2492
+ "membersControllerUpdateMember",
2493
+ "membersControllerDeleteMember",
2494
+ "membersControllerGetMemberActivity",
2495
+ "membersControllerUpdateStatus",
2496
+ "membersControllerAdminCheckOut",
2497
+ "invitationsList",
2498
+ "invitationsCreate",
2499
+ "invitationsRevoke",
2500
+ "invitationsAccept",
2501
+ "roleManagementControllerGetCustomRoles",
2502
+ "roleManagementControllerCreateCustomRole",
2503
+ "roleManagementControllerUpdateCustomRole",
2504
+ "roleManagementControllerDeleteCustomRole",
2505
+ "roleManagementControllerGetPermissionSets",
2506
+ "roleManagementControllerCreatePermissionSet",
2507
+ "roleManagementControllerGetRoleGroups",
2508
+ "roleManagementControllerCreateRoleGroup",
2509
+ "roleManagementControllerAssignRoles",
2510
+ "roleManagementControllerRemoveRoles",
2511
+ "departmentsList",
2512
+ "cartControllerGetCart",
2513
+ "cartControllerClearCart",
2514
+ "cartControllerAddToCart",
2515
+ "cartControllerRemoveFromCart",
2516
+ "favoritesControllerGetFavorites",
2517
+ "favoritesControllerAddFavorite",
2518
+ "favoritesControllerRemoveFavorite"
2519
+ ]);
2520
+ var catalogMapping = {
2521
+ getProducts: "catalogGetProducts",
2522
+ createProduct: "catalogCreateProduct",
2523
+ getServices: "catalogGetServices",
2524
+ updateProduct: "catalogUpdateProduct",
2525
+ updateSupplierVariant: "catalogUpdateSupplierVariant",
2526
+ getPriceChangeRequests: "catalogGetPriceChangeRequests",
2527
+ reviewPriceChangeRequest: "catalogReviewPriceChangeRequest",
2528
+ createServiceCategory: "servicesCreateCategory",
2529
+ getServiceCategories: "servicesGetCategories",
2530
+ updateServiceCategory: "servicesUpdateCategory",
2531
+ deleteServiceCategory: "servicesDeleteCategory",
2532
+ createService: "servicesCreateService",
2533
+ getServicesList: "servicesGetServices",
2534
+ getCurrentMemberShifts: "servicesGetCurrentMemberShifts",
2535
+ getShifts: "servicesGetShifts",
2536
+ getService: "servicesGetService",
2537
+ updateService: "servicesUpdateService",
2538
+ deleteService: "servicesDeleteService",
2539
+ createResource: "servicesCreateResource",
2540
+ getResources: "servicesGetResources",
2541
+ updateResource: "servicesUpdateResource",
2542
+ deleteResource: "servicesDeleteResource",
2543
+ createBooking: "servicesCreateBooking",
2544
+ getBookings: "servicesGetBookings",
2545
+ getBooking: "servicesGetBooking",
2546
+ updateBookingStatus: "servicesUpdateBookingStatus",
2547
+ completeBooking: "servicesCompleteBooking",
2548
+ createShift: "servicesCreateShift",
2549
+ getStaffShifts: "servicesGetStaffShifts",
2550
+ addBreak: "servicesAddBreak",
2551
+ registerCustomerApp: "servicesRegisterCustomerApp",
2552
+ getServiceUtilization: "servicesGetUtilization",
2553
+ getServicePerformance: "servicesGetPerformance",
2554
+ getServiceFunnel: "servicesGetFunnel"
2555
+ };
2556
+ var authMapping = {
2557
+ exchangeToken: "authExchangeToken",
2558
+ handleOAuth2: "authControllerHandleOAuth2"
2559
+ };
2560
+ var inventoryMapping = {
2561
+ verifyIntegrity: "inventoryVerifyIntegrity",
2562
+ fixIntegrity: "inventoryFixIntegrity",
2563
+ getInventory: "inventoryGetInventory",
2564
+ traceBatch: "inventoryTraceBatch",
2565
+ splitBatch: "inventorySplitBatch",
2566
+ mergeBatches: "inventoryMergeBatches",
2567
+ createAssembly: "inventoryCreateAssembly",
2568
+ completeAssembly: "inventoryCompleteAssembly",
2569
+ requestAdjustment: "inventoryRequestAdjustment",
2570
+ getAdjustments: "inventoryGetAdjustments",
2571
+ approveAdjustment: "inventoryApproveAdjustment",
2572
+ rejectAdjustment: "inventoryRejectAdjustment",
2573
+ getLeadTime: "inventoryGetLeadTime",
2574
+ getWasteAnalysis: "inventoryGetWasteAnalysis",
2575
+ checkB2BAvailability: "inventoryCheckB2BAvailability",
2576
+ unpackBatch: "inventoryUnpackBatch",
2577
+ scanUnpackBatch: "inventoryScanUnpackBatch",
2578
+ quickStockInquiry: "inventoryQuickStockInquiry",
2579
+ getPurchases: "stockingGetPurchases",
2580
+ createPurchase: "stockingCreatePurchase",
2581
+ receivePurchase: "stockingReceivePurchase",
2582
+ getTransfers: "stockingGetTransfers",
2583
+ createTransfer: "stockingCreateTransfer",
2584
+ shipTransfer: "stockingShipTransfer",
2585
+ receiveTransfer: "stockingReceiveTransfer",
2586
+ getRequests: "stockingGetRequests",
2587
+ getPendingDispatch: "stockingGetPendingDispatch",
2588
+ dispatchOrders: "stockingDispatchOrders",
2589
+ getActiveDeliveries: "stockingGetActiveDeliveries",
2590
+ reconcilePod: "stockingReconcilePod",
2591
+ getPhysicalReconciliations: "stockingGetPhysicalReconciliations",
2592
+ submitPhysicalReconciliation: "stockingSubmitPhysicalReconciliation",
2593
+ getReconciliationReport: "stockingGetReconciliationReport",
2594
+ getPartners: "stockingGetPartners",
2595
+ createPartner: "stockingCreatePartner",
2596
+ getPartner: "stockingGetPartner",
2597
+ updatePartner: "stockingUpdatePartner",
2598
+ adjustPartnerWallet: "stockingAdjustPartnerWallet",
2599
+ getUnits: "unitsGetUnits"
2600
+ };
2601
+ var ordersMapping = {
2602
+ createOrder: "ordersCreateOrder",
2603
+ getOrders: "ordersGetOrders",
2604
+ updateStatus: "ordersUpdateStatus",
2605
+ requestB2BQuote: "ordersRequestB2BQuote",
2606
+ convertQuoteToOrder: "ordersConvertQuoteToOrder",
2607
+ getB2BCatalog: "b2BGetCatalog",
2608
+ getB2BInvoices: "b2BGetInvoices",
2609
+ getB2BOrders: "b2BGetOrders",
2610
+ createB2BOrder: "b2BCreateOrder",
2611
+ createB2BQuote: "b2BCreateQuote",
2612
+ getCart: "cartControllerGetCart",
2613
+ clearCart: "cartControllerClearCart",
2614
+ addToCart: "cartControllerAddToCart",
2615
+ removeFromCart: "cartControllerRemoveFromCart",
2616
+ handleStkCallback: "paymentsControllerHandleStkCallback"
2617
+ };
2618
+ var crmMapping = {
2619
+ createRecord: "crmControllerCreateRecord",
2620
+ getRecord: "crmControllerGetRecord",
2621
+ updateRecord: "crmControllerUpdateRecord",
2622
+ createNote: "crmControllerCreateNote",
2623
+ getRecordNotes: "crmControllerGetRecordNotes",
2624
+ createActivity: "crmControllerCreateActivity",
2625
+ getTimeline: "crmControllerGetTimeline",
2626
+ createObject: "crmControllerCreateObject",
2627
+ listObjects: "crmControllerListObjects",
2628
+ createField: "crmControllerCreateField",
2629
+ listFields: "crmControllerListFields",
2630
+ createRelationship: "crmControllerCreateRelationship",
2631
+ listRelationships: "crmControllerListRelationships",
2632
+ createAssociation: "crmControllerCreateAssociation",
2633
+ listRecordAssociations: "crmControllerListRecordAssociations",
2634
+ getIntegrationsAuthUrl: "crmIntegrationsGetAuthUrl",
2635
+ handleIntegrationsCallback: "crmIntegrationsHandleCallback",
2636
+ handleIntegrationsWebhook: "crmIntegrationsHandleWebhook",
2637
+ replyToIntegrationsActivity: "crmIntegrationsReplyToActivity",
2638
+ createStrapiConnection: "strapiCreateConnection",
2639
+ listStrapiConnections: "strapiListConnections",
2640
+ getStrapiConnection: "strapiGetConnection",
2641
+ updateStrapiConnection: "strapiUpdateConnection",
2642
+ deleteStrapiConnection: "strapiDeleteConnection",
2643
+ triggerStrapiSync: "strapiTriggerSync",
2644
+ enqueueStrapiSync: "strapiEnqueueSync",
2645
+ getStrapiWebhookLogs: "strapiGetWebhookLogs",
2646
+ getStrapiSyncLogs: "strapiGetSyncLogs",
2647
+ exchangeStrapiCustomerToken: "strapiExchangeCustomerToken",
2648
+ registerStrapiCustomer: "strapiRegisterCustomer",
2649
+ receiveStrapiWebhook: "strapiReceiveWebhook"
2650
+ };
2651
+ var posMapping = {
2652
+ provision: "pOSProvision",
2653
+ login: "pOSLogin",
2654
+ getMe: "pOSGetMe",
2655
+ processSale: "pOSProcessSale",
2656
+ sync: "pOSSync",
2657
+ getTransactions: "pOSGetTransactions",
2658
+ registerPettyCash: "pOSRegisterPettyCash",
2659
+ getPettyCashFunds: "pOSGetPettyCashFunds",
2660
+ getPettyCashTransactions: "pOSGetPettyCashTransactions",
2661
+ createSetupKey: "standalonePosControllerCreateSetupKey",
2662
+ activateDevice: "standalonePosControllerActivateDevice",
2663
+ validateKey: "standalonePosControllerValidateKey",
2664
+ linkOrganization: "standalonePosControllerLinkOrganization"
2665
+ };
2666
+ var accountingMapping = {
2667
+ createExpense: "expenseControllerCreateExpense",
2668
+ getExpenses: "expenseControllerGetExpenses",
2669
+ getExpenseCategories: "expenseControllerGetExpenseCategories",
2670
+ getExpense: "expenseControllerGetExpense",
2671
+ createPettyCashFund: "pettyCashControllerCreateFund",
2672
+ getPettyCashFunds: "pettyCashControllerGetFunds",
2673
+ getPettyCashFund: "pettyCashControllerGetFund",
2674
+ topUpPettyCashFund: "pettyCashControllerTopUpFund",
2675
+ getPettyCashFundTransactions: "pettyCashControllerGetFundTransactions",
2676
+ createUtilityAccount: "utilityAccountControllerCreateAccount",
2677
+ getUtilityAccounts: "utilityAccountControllerGetAccounts",
2678
+ getUtilityAccount: "utilityAccountControllerGetAccount",
2679
+ initialize: "accountingInitialize",
2680
+ getProfitLoss: "accountingGetProfitLoss",
2681
+ getBalanceSheet: "accountingGetBalanceSheet",
2682
+ getCashFlow: "accountingGetCashFlow",
2683
+ getTaxSummary: "accountingGetTaxSummary",
2684
+ createInvoice: "invoiceControllerCreateInvoice",
2685
+ getInvoices: "invoiceControllerGetInvoices",
2686
+ getInvoice: "invoiceControllerGetInvoice",
2687
+ updateInvoice: "invoiceControllerUpdateInvoice",
2688
+ deleteInvoice: "invoiceControllerDeleteInvoice",
2689
+ finalizeInvoice: "invoiceControllerFinalizeInvoice",
2690
+ getTemplates: "invoiceControllerGetTemplates",
2691
+ createTemplate: "invoiceControllerCreateTemplate",
2692
+ getInvoiceConfig: "invoiceControllerGetConfig",
2693
+ updateInvoiceConfig: "invoiceControllerUpdateConfig",
2694
+ downloadInvoice: "publicInvoiceControllerDownloadInvoice",
2695
+ downloadInvoiceByTransaction: "publicInvoiceControllerDownloadInvoiceByTransaction",
2696
+ downloadReceipt: "publicInvoiceControllerDownloadReceipt",
2697
+ generatePublicLink: "publicInvoiceControllerGeneratePublicLink"
2698
+ };
2699
+ var loyaltyMapping = {
2700
+ redeemReward: "loyaltyRedeemReward",
2701
+ getCustomerStatus: "loyaltyGetCustomerStatus",
2702
+ validateVoucher: "loyaltyValidateVoucher",
2703
+ getFavorites: "favoritesControllerGetFavorites",
2704
+ addFavorite: "favoritesControllerAddFavorite",
2705
+ removeFavorite: "favoritesControllerRemoveFavorite"
2706
+ };
2707
+ var membersMapping = {
2708
+ getMembers: "membersControllerGetMembers",
2709
+ createMember: "membersControllerCreateMember",
2710
+ getMember: "membersControllerGetMember",
2711
+ updateMember: "membersControllerUpdateMember",
2712
+ deleteMember: "membersControllerDeleteMember",
2713
+ getMemberActivity: "membersControllerGetMemberActivity",
2714
+ updateStatus: "membersControllerUpdateStatus",
2715
+ adminCheckOut: "membersControllerAdminCheckOut",
2716
+ terminalLogin: "terminalMembersControllerLogin",
2717
+ listInvitations: "invitationsList",
2718
+ createInvitation: "invitationsCreate",
2719
+ revokeInvitation: "invitationsRevoke",
2720
+ acceptInvitation: "invitationsAccept",
2721
+ getCustomRoles: "roleManagementControllerGetCustomRoles",
2722
+ createCustomRole: "roleManagementControllerCreateCustomRole",
2723
+ updateCustomRole: "roleManagementControllerUpdateCustomRole",
2724
+ deleteCustomRole: "roleManagementControllerDeleteCustomRole",
2725
+ getPermissionSets: "roleManagementControllerGetPermissionSets",
2726
+ createPermissionSet: "roleManagementControllerCreatePermissionSet",
2727
+ getRoleGroups: "roleManagementControllerGetRoleGroups",
2728
+ createRoleGroup: "roleManagementControllerCreateRoleGroup",
2729
+ assignRoles: "roleManagementControllerAssignRoles",
2730
+ removeRoles: "roleManagementControllerRemoveRoles",
2731
+ listDepartments: "departmentsList",
2732
+ createDepartment: "departmentsCreate",
2733
+ getDepartment: "departmentsGet",
2734
+ updateDepartment: "departmentsUpdate",
2735
+ deleteDepartment: "departmentsDelete",
2736
+ addDepartmentMember: "departmentsAddMember",
2737
+ removeDepartmentMember: "departmentsRemoveMember",
2738
+ getAttendanceLogs: "attendanceControllerGetLogs",
2739
+ checkIn: "attendanceControllerCheckIn",
2740
+ checkOut: "attendanceControllerCheckOut",
2741
+ getMyAttendanceStatus: "attendanceControllerGetMyStatus",
2742
+ getAttendanceStatus: "attendanceControllerGetStatus",
2743
+ broadcastAnnouncement: "announcementControllerBroadcastAnnouncement"
2744
+ };
2745
+ var publicServicesMapping = {
2746
+ listServices: "publicServicesListServices",
2747
+ getCategories: "publicServicesGetCategories",
2748
+ getService: "publicServicesGetService",
2749
+ getAvailability: "publicServicesGetAvailability",
2750
+ requestOtp: "publicServicesRequestOtp",
2751
+ verifyOtp: "publicServicesVerifyOtp",
2752
+ createBooking: "publicServicesCreatePublicBooking"
2753
+ };
2754
+ var servicesMapping = {
2755
+ ...publicServicesMapping,
2756
+ // Admin / Staff scheduling endpoints
2757
+ createCategory: "servicesCreateCategory",
2758
+ getCategoriesAdmin: "servicesGetCategories",
2759
+ updateCategory: "servicesUpdateCategory",
2760
+ deleteCategory: "servicesDeleteCategory",
2761
+ createService: "servicesCreateService",
2762
+ getServicesAdmin: "servicesGetServices",
2763
+ getCurrentMemberShifts: "servicesGetCurrentMemberShifts",
2764
+ getShifts: "servicesGetShifts",
2765
+ getServiceAdmin: "servicesGetService",
2766
+ updateService: "servicesUpdateService",
2767
+ deleteService: "servicesDeleteService",
2768
+ createResource: "servicesCreateResource",
2769
+ getResources: "servicesGetResources",
2770
+ updateResource: "servicesUpdateResource",
2771
+ deleteResource: "servicesDeleteResource",
2772
+ createBookingAdmin: "servicesCreateBooking",
2773
+ getBookings: "servicesGetBookings",
2774
+ getBookingAdmin: "servicesGetBooking",
2775
+ updateBookingStatus: "servicesUpdateBookingStatus",
2776
+ completeBooking: "servicesCompleteBooking",
2777
+ createShift: "servicesCreateShift",
2778
+ getStaffShifts: "servicesGetStaffShifts",
2779
+ addBreak: "servicesAddBreak",
2780
+ registerCustomerApp: "servicesRegisterCustomerApp",
2781
+ getServiceUtilization: "servicesGetUtilization",
2782
+ getServicePerformance: "servicesGetPerformance",
2783
+ getServiceFunnel: "servicesGetFunnel"
2784
+ };
2785
+ var adminMapping = {
2786
+ getStats: "adminControllerGetStats",
2787
+ listOrganizations: "adminControllerListOrganizations",
2788
+ createOrganization: "adminControllerCreateOrganization",
2789
+ getOrganizationDetails: "adminControllerGetOrganizationDetails",
2790
+ updateOrganization: "adminControllerUpdateOrganization",
2791
+ deleteOrganization: "adminControllerDeleteOrganization",
2792
+ listMembers: "adminControllerListMembers",
2793
+ listUsers: "adminControllerListUsers",
2794
+ banUser: "adminControllerBanUser",
2795
+ unbanUser: "adminControllerUnbanUser",
2796
+ listConnectedApps: "adminControllerListConnectedApps",
2797
+ listSystemLogs: "adminControllerListSystemLogs",
2798
+ listGlobalSettings: "adminControllerListGlobalSettings",
2799
+ setGlobalSetting: "adminControllerSetGlobalSetting",
2800
+ deleteGlobalSetting: "adminControllerDeleteGlobalSetting",
2801
+ listTiers: "adminControllerListTiers",
2802
+ defineTier: "adminControllerDefineTier",
2803
+ deleteTier: "adminControllerDeleteTier",
2804
+ getOrganizationSubscription: "adminControllerGetOrganizationSubscription",
2805
+ updateOrganizationSubscription: "adminControllerUpdateOrganizationSubscription",
2806
+ listSystemPayments: "adminControllerListSystemPayments",
2807
+ recordCustomPayment: "adminControllerRecordCustomPayment",
2808
+ listIntegrationDefinitions: "adminControllerListIntegrationDefinitions",
2809
+ createIntegrationDefinition: "adminControllerCreateIntegrationDefinition",
2810
+ updateIntegrationDefinition: "adminControllerUpdateIntegrationDefinition",
2811
+ deleteIntegrationDefinition: "adminControllerDeleteIntegrationDefinition",
2812
+ listActiveOrganizationIntegrations: "adminControllerListActiveOrganizationIntegrations",
2813
+ createWebhook: "webhooksCreate",
2814
+ listWebhooks: "webhooksList",
2815
+ deleteWebhook: "webhooksDelete",
2816
+ handleWindmillCallback: "windmillCallbackControllerHandleCallback",
2817
+ handleWindmillApprovalCallback: "windmillCallbackControllerHandleApprovalCallback",
2818
+ handleWindmillBakeryDisposalCallback: "windmillCallbackControllerHandleBakeryDisposalCallback",
2819
+ handleWindmillOutcomeCallback: "windmillCallbackControllerHandleOutcomeCallback",
2820
+ provisionZitadel: "customersProvisionZitadel",
2821
+ getCustomers: "customersGetCustomers",
2822
+ registerCustomer: "customersRegister",
2823
+ updateCustomer: "customersUpdate",
2824
+ getCustomerById: "customersGetCustomerById",
2825
+ deleteCustomer: "customersDelete",
2826
+ getCustomerAddresses: "customersGetAddresses",
2827
+ addCustomerAddress: "customersAddAddress",
2828
+ createBusinessAccount: "businessAccountControllerCreate",
2829
+ getBusinessAccount: "businessAccountControllerGetOne",
2830
+ getDashboardAnalytics: "analyticsControllerGetDashboardAnalytics",
2831
+ getResourceUtilization: "analyticsControllerGetResourceUtilization"
2832
+ };
2833
+ function buildModule(api, orgSlug, mapping) {
2834
+ const result = {};
2835
+ for (const [key, rawMethodName] of Object.entries(mapping)) {
2836
+ const rawFn = api[rawMethodName];
2837
+ if (typeof rawFn === "function") {
2838
+ if (methodsWithOrgSlugSet.has(rawMethodName)) {
2839
+ result[key] = function(...args) {
2840
+ return rawFn.apply(this, [orgSlug, ...args]);
2841
+ };
2842
+ } else {
2843
+ result[key] = function(...args) {
2844
+ return rawFn.apply(this, args);
2845
+ };
2846
+ }
2847
+ }
2848
+ }
2849
+ return result;
2850
+ }
2851
+ function getJwtExpiry(token) {
2852
+ try {
2853
+ const parts = token.split(".");
2854
+ if (parts.length !== 3) return null;
2855
+ let payloadStr = "";
2856
+ if (typeof Buffer !== "undefined") {
2857
+ payloadStr = Buffer.from(parts[1], "base64").toString("utf-8");
2858
+ } else if (typeof window !== "undefined" && typeof window.atob === "function") {
2859
+ payloadStr = window.atob(parts[1]);
2860
+ } else {
2861
+ payloadStr = atob(parts[1]);
2862
+ }
2863
+ const payload = JSON.parse(payloadStr);
2864
+ if (payload && typeof payload.exp === "number") {
2865
+ return payload.exp * 1e3;
2866
+ }
2867
+ } catch (e) {
2868
+ }
2869
+ return null;
2870
+ }
2871
+
2872
+ // src/client.tsx
2873
+ var import_react = require("react");
2874
+ var import_axios2 = __toESM(require("axios"));
2875
+ var import_jsx_runtime = require("react/jsx-runtime");
2876
+ var InMemoryStorage = class {
2877
+ constructor() {
2878
+ this.cache = /* @__PURE__ */ new Map();
2879
+ }
2880
+ getItem(key) {
2881
+ return this.cache.get(key) || null;
2882
+ }
2883
+ setItem(key, value) {
2884
+ this.cache.set(key, value);
2885
+ }
2886
+ removeItem(key) {
2887
+ this.cache.delete(key);
2888
+ }
2889
+ };
2890
+ var SCRYME_SESSION_TOKEN_KEY = "scryme_session_token";
2891
+ var SCRYME_USER_KEY = "scryme_user";
2892
+ var SCRYME_EXPIRES_AT_KEY = "scryme_expires_at";
2893
+ var ScrymeClientSDK = class {
2894
+ constructor(config) {
2895
+ if (!config || !config.clientId || !config.orgSlug) {
2896
+ throw new Error(
2897
+ "clientId and orgSlug are required to initialize the SDK."
2898
+ );
2899
+ }
2900
+ let finalBaseURL = config.baseURL || "https://api.scryme.tech";
2901
+ if (finalBaseURL && !finalBaseURL.includes("/api") && !finalBaseURL.endsWith("/api")) {
2902
+ finalBaseURL = finalBaseURL.replace(/\/$/, "") + "/api";
2903
+ }
2904
+ this.axiosInstance = import_axios2.default.create({
2905
+ baseURL: finalBaseURL
2906
+ });
2907
+ let storage;
2908
+ if (config.storage) {
2909
+ storage = config.storage;
2910
+ } else if (typeof window !== "undefined" && window.localStorage) {
2911
+ storage = {
2912
+ getItem: (key) => window.localStorage.getItem(key),
2913
+ setItem: (key, value) => window.localStorage.setItem(key, value),
2914
+ removeItem: (key) => window.localStorage.removeItem(key)
2915
+ };
2916
+ } else {
2917
+ storage = new InMemoryStorage();
2918
+ }
2919
+ const state = {
2920
+ token: null,
2921
+ user: null
2922
+ };
2923
+ const listeners = /* @__PURE__ */ new Set();
2924
+ const notify = (event) => {
2925
+ const currentState = { ...state };
2926
+ listeners.forEach((listener) => {
2927
+ try {
2928
+ listener(event, currentState);
2929
+ } catch (e) {
2930
+ console.error("Error in auth state listener:", e);
2931
+ }
2932
+ });
2933
+ };
2934
+ const initPromise = (async () => {
2935
+ try {
2936
+ const storedToken = await storage.getItem(SCRYME_SESSION_TOKEN_KEY);
2937
+ const storedUser = await storage.getItem(SCRYME_USER_KEY);
2938
+ const storedExpiresAt = await storage.getItem(SCRYME_EXPIRES_AT_KEY);
2939
+ if (storedToken) {
2940
+ state.token = storedToken;
2941
+ if (storedExpiresAt) {
2942
+ state.expiresAt = Number(storedExpiresAt);
2943
+ } else {
2944
+ const jwtExp = getJwtExpiry(storedToken);
2945
+ if (jwtExp) {
2946
+ state.expiresAt = jwtExp;
2947
+ } else {
2948
+ delete state.expiresAt;
2949
+ }
2950
+ }
2951
+ if (storedUser) {
2952
+ try {
2953
+ state.user = JSON.parse(storedUser);
2954
+ } catch {
2955
+ state.user = null;
2956
+ }
2957
+ }
2958
+ notify("INITIAL_SESSION");
2959
+ }
2960
+ } catch (e) {
2961
+ console.error("Failed to initialize Scryme Client SDK session:", e);
2962
+ }
2963
+ })();
2964
+ let activeAuthPromise = null;
2965
+ const performExchange = async () => {
2966
+ if (activeAuthPromise) {
2967
+ return activeAuthPromise;
2968
+ }
2969
+ activeAuthPromise = (async () => {
2970
+ try {
2971
+ const response = await this.api.authExchangeToken({
2972
+ clientId: config.clientId,
2973
+ clientSecret: config.clientSecret || ""
2974
+ });
2975
+ const tokenData = response.data?.data;
2976
+ const accessToken = tokenData?.access_token;
2977
+ const expiresIn = tokenData?.expires_in;
2978
+ if (accessToken) {
2979
+ state.token = accessToken;
2980
+ if (expiresIn) {
2981
+ state.expiresAt = Date.now() + expiresIn * 1e3;
2982
+ await storage.setItem(
2983
+ SCRYME_EXPIRES_AT_KEY,
2984
+ String(state.expiresAt)
2985
+ );
2986
+ } else {
2987
+ const jwtExp = getJwtExpiry(accessToken);
2988
+ if (jwtExp) {
2989
+ state.expiresAt = jwtExp;
2990
+ await storage.setItem(SCRYME_EXPIRES_AT_KEY, String(jwtExp));
2991
+ } else {
2992
+ delete state.expiresAt;
2993
+ }
2994
+ }
2995
+ await storage.setItem(SCRYME_SESSION_TOKEN_KEY, accessToken);
2996
+ notify("SIGNED_IN");
2997
+ }
2998
+ return response.data;
2999
+ } finally {
3000
+ activeAuthPromise = null;
3001
+ }
3002
+ })();
3003
+ return activeAuthPromise;
3004
+ };
3005
+ this.axiosInstance.interceptors.request.use(async (req) => {
3006
+ await initPromise;
3007
+ 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"));
3008
+ if (!isAuthTokenRequest) {
3009
+ const isExpired = !state.token || state.expiresAt && Date.now() >= (state.expiresAt || 0) - 3e4;
3010
+ if (isExpired) {
3011
+ if (state.token) {
3012
+ try {
3013
+ await this.auth.refreshSession();
3014
+ } catch (e) {
3015
+ console.error(
3016
+ "Proactive customer session refresh failed in request interceptor:",
3017
+ e
3018
+ );
3019
+ }
3020
+ } else if (config.clientId && config.clientSecret) {
3021
+ try {
3022
+ await performExchange();
3023
+ } catch (e) {
3024
+ console.error(
3025
+ "Auto-authentication failed in request interceptor:",
3026
+ e
3027
+ );
3028
+ }
3029
+ }
3030
+ }
3031
+ }
3032
+ if (state.token) {
3033
+ req.headers["Authorization"] = `Bearer ${state.token}`;
3034
+ }
3035
+ return req;
3036
+ });
3037
+ this.axiosInstance.interceptors.response.use(
3038
+ (response) => response,
3039
+ async (error) => {
3040
+ const originalRequest = error.config;
3041
+ 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"));
3042
+ if (error.response && error.response.status === 401 && originalRequest && !originalRequest._retry && !isAuthTokenRequest) {
3043
+ originalRequest._retry = true;
3044
+ try {
3045
+ if (state.token) {
3046
+ await this.auth.refreshSession();
3047
+ if (state.token) {
3048
+ originalRequest.headers["Authorization"] = `Bearer ${state.token}`;
3049
+ }
3050
+ return this.axiosInstance(originalRequest);
3051
+ } else if (config.clientId && config.clientSecret) {
3052
+ await performExchange();
3053
+ if (state.token) {
3054
+ originalRequest.headers["Authorization"] = `Bearer ${state.token}`;
3055
+ }
3056
+ return this.axiosInstance(originalRequest);
3057
+ }
3058
+ } catch (e) {
3059
+ return Promise.reject(error);
3060
+ }
3061
+ }
3062
+ return Promise.reject(error);
3063
+ }
3064
+ );
3065
+ this.api = getScrymeV3API2(this.axiosInstance, config.orgSlug);
3066
+ this.catalog = buildModule(this.api, config.orgSlug, catalogMapping);
3067
+ this.inventory = buildModule(this.api, config.orgSlug, inventoryMapping);
3068
+ this.orders = buildModule(this.api, config.orgSlug, ordersMapping);
3069
+ this.crm = buildModule(this.api, config.orgSlug, crmMapping);
3070
+ this.pos = buildModule(this.api, config.orgSlug, posMapping);
3071
+ this.accounting = buildModule(this.api, config.orgSlug, accountingMapping);
3072
+ this.loyalty = buildModule(this.api, config.orgSlug, loyaltyMapping);
3073
+ this.members = buildModule(this.api, config.orgSlug, membersMapping);
3074
+ this.admin = buildModule(this.api, config.orgSlug, adminMapping);
3075
+ this.cart = {
3076
+ get: async (params) => {
3077
+ return this.orders.getCart(params || {});
3078
+ },
3079
+ add: async (dto) => {
3080
+ return this.orders.addToCart(dto);
3081
+ },
3082
+ remove: async (dto) => {
3083
+ return this.orders.removeFromCart(dto);
3084
+ },
3085
+ clear: async (params) => {
3086
+ return this.orders.clearCart(params || {});
3087
+ },
3088
+ update: async (dto) => {
3089
+ const response = await this.orders.getCart({
3090
+ sessionId: dto.sessionId
3091
+ });
3092
+ const data = response.data;
3093
+ const items = data?.data?.items || data?.items || [];
3094
+ let existingItem = null;
3095
+ if (dto.productId) {
3096
+ existingItem = items.find(
3097
+ (item) => item.productId === dto.productId && (item.variantId || null) === (dto.variantId || null)
3098
+ );
3099
+ } else if (dto.serviceId) {
3100
+ existingItem = items.find(
3101
+ (item) => item.serviceId === dto.serviceId
3102
+ );
3103
+ }
3104
+ if (existingItem) {
3105
+ const currentQty = existingItem.quantity || 0;
3106
+ if (dto.quantity <= 0) {
3107
+ return this.orders.removeFromCart({
3108
+ productId: dto.productId,
3109
+ variantId: dto.variantId,
3110
+ serviceId: dto.serviceId,
3111
+ sessionId: dto.sessionId,
3112
+ customerId: dto.customerId
3113
+ });
3114
+ } else {
3115
+ const diff = dto.quantity - currentQty;
3116
+ if (diff !== 0) {
3117
+ return this.orders.addToCart({
3118
+ ...dto,
3119
+ quantity: diff
3120
+ });
3121
+ }
3122
+ return response;
3123
+ }
3124
+ } else {
3125
+ if (dto.quantity > 0) {
3126
+ return this.orders.addToCart(dto);
3127
+ }
3128
+ }
3129
+ },
3130
+ getItems: async (params) => {
3131
+ const res = await this.orders.getCart(params || {});
3132
+ const data = res?.data || res;
3133
+ return data?.items || data?.data?.items || [];
3134
+ },
3135
+ getTotals: async (params) => {
3136
+ const res = await this.orders.getCart(params || {});
3137
+ const data = res?.data || res;
3138
+ const items = data?.items || data?.data?.items || [];
3139
+ const itemsCount = items.reduce(
3140
+ (sum, item) => sum + (item.quantity || 0),
3141
+ 0
3142
+ );
3143
+ return {
3144
+ itemsCount,
3145
+ items,
3146
+ raw: data
3147
+ };
3148
+ },
3149
+ mergeGuestCart: async (guestSessionId, customerId) => {
3150
+ return this.orders.getCart({ sessionId: guestSessionId });
3151
+ },
3152
+ checkout: async (params) => {
3153
+ const session = await this.auth.getSession();
3154
+ const user = session.user;
3155
+ const customerId = user?.customerId || user?.id || user?.customer?.id;
3156
+ if (!customerId)
3157
+ throw new Error("No authenticated customer found for checkout.");
3158
+ const items = await this.cart.getItems();
3159
+ if (!items || items.length === 0) {
3160
+ throw new Error("Cannot checkout an empty cart.");
3161
+ }
3162
+ const orderItems = items.map((item) => ({
3163
+ variantId: item.variantId || "",
3164
+ quantity: item.quantity,
3165
+ unitPrice: item.unitPrice
3166
+ }));
3167
+ const orderResponse = await this.orders.createOrder({
3168
+ customerId,
3169
+ locationId: params.locationId,
3170
+ items: orderItems,
3171
+ notes: params.notes,
3172
+ channel: params.channel
3173
+ });
3174
+ await this.cart.clear();
3175
+ return orderResponse?.data || orderResponse;
3176
+ }
3177
+ };
3178
+ this.customer = {
3179
+ getProfile: async () => {
3180
+ return this.auth.getCurrentSession();
3181
+ },
3182
+ updateProfile: async (dto) => {
3183
+ const session = await this.auth.getSession();
3184
+ const user = session.user;
3185
+ const customerId = user?.customerId || user?.id || user?.customer?.id;
3186
+ if (!customerId) throw new Error("No authenticated customer found.");
3187
+ return this.admin.updateCustomer(customerId, dto);
3188
+ },
3189
+ getAddresses: async () => {
3190
+ const session = await this.auth.getSession();
3191
+ const user = session.user;
3192
+ const customerId = user?.customerId || user?.id || user?.customer?.id;
3193
+ if (!customerId) throw new Error("No authenticated customer found.");
3194
+ return this.admin.getCustomerAddresses(customerId);
3195
+ },
3196
+ addAddress: async (dto) => {
3197
+ const session = await this.auth.getSession();
3198
+ const user = session.user;
3199
+ const customerId = user?.customerId || user?.id || user?.customer?.id;
3200
+ if (!customerId) throw new Error("No authenticated customer found.");
3201
+ return this.admin.addCustomerAddress(customerId, dto);
3202
+ }
3203
+ };
3204
+ this.bookings = {
3205
+ create: async (dto) => {
3206
+ return this.catalog.createBooking(dto);
3207
+ },
3208
+ get: async (id) => {
3209
+ return this.catalog.getBooking(id);
3210
+ },
3211
+ list: async () => {
3212
+ return this.catalog.getBookings();
3213
+ },
3214
+ cancel: async (id) => {
3215
+ return this.catalog.updateBookingStatus(id, "CANCELLED");
3216
+ }
3217
+ };
3218
+ const baseAuth = buildModule(this.api, config.orgSlug, authMapping);
3219
+ this.auth = {
3220
+ ...baseAuth,
3221
+ signUp: async (dto) => {
3222
+ return this.api.customersRegister(config.orgSlug, dto);
3223
+ },
3224
+ authenticate: async () => {
3225
+ return performExchange();
3226
+ },
3227
+ signIn: async (credentials) => {
3228
+ try {
3229
+ const authServiceUrl = process.env.CUSTOMER_AUTH_URL || `${this.axiosInstance.defaults.baseURL || "http://localhost:3002"}/api/customer-auth`;
3230
+ 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`;
3231
+ const response2 = await import_axios2.default.post(postUrl, credentials);
3232
+ const data2 = response2.data;
3233
+ const token2 = data2?.session?.token || data2?.token || null;
3234
+ const user2 = data2?.user || null;
3235
+ if (token2) {
3236
+ state.token = token2;
3237
+ state.user = user2;
3238
+ const jwtExp = getJwtExpiry(token2);
3239
+ await storage.setItem(SCRYME_SESSION_TOKEN_KEY, token2);
3240
+ if (jwtExp) {
3241
+ state.expiresAt = jwtExp;
3242
+ await storage.setItem(
3243
+ SCRYME_EXPIRES_AT_KEY,
3244
+ String(state.expiresAt)
3245
+ );
3246
+ } else {
3247
+ delete state.expiresAt;
3248
+ await storage.removeItem(SCRYME_EXPIRES_AT_KEY);
3249
+ }
3250
+ if (user2) {
3251
+ await storage.setItem(SCRYME_USER_KEY, JSON.stringify(user2));
3252
+ }
3253
+ notify("SIGNED_IN");
3254
+ return data2;
3255
+ } else {
3256
+ throw new Error("No token returned");
3257
+ }
3258
+ } catch (e) {
3259
+ }
3260
+ const response = await this.axiosInstance.post(
3261
+ `/${config.orgSlug}/customers/auth/login`,
3262
+ credentials
3263
+ );
3264
+ const data = response.data?.data || response.data;
3265
+ const token = data?.token || null;
3266
+ const user = data?.session || null;
3267
+ if (token) {
3268
+ state.token = token;
3269
+ state.user = user;
3270
+ const jwtExp = getJwtExpiry(token);
3271
+ await storage.setItem(SCRYME_SESSION_TOKEN_KEY, token);
3272
+ if (jwtExp) {
3273
+ state.expiresAt = jwtExp;
3274
+ await storage.setItem(
3275
+ SCRYME_EXPIRES_AT_KEY,
3276
+ String(state.expiresAt)
3277
+ );
3278
+ } else {
3279
+ delete state.expiresAt;
3280
+ await storage.removeItem(SCRYME_EXPIRES_AT_KEY);
3281
+ }
3282
+ if (user) {
3283
+ await storage.setItem(SCRYME_USER_KEY, JSON.stringify(user));
3284
+ }
3285
+ notify("SIGNED_IN");
3286
+ }
3287
+ return data;
3288
+ },
3289
+ signOut: async () => {
3290
+ try {
3291
+ await this.axiosInstance.post("/auth/sign-out");
3292
+ } catch {
3293
+ }
3294
+ state.token = null;
3295
+ state.user = null;
3296
+ delete state.expiresAt;
3297
+ await storage.removeItem(SCRYME_SESSION_TOKEN_KEY);
3298
+ await storage.removeItem(SCRYME_USER_KEY);
3299
+ await storage.removeItem(SCRYME_EXPIRES_AT_KEY);
3300
+ notify("SIGNED_OUT");
3301
+ },
3302
+ getSession: async () => {
3303
+ await initPromise;
3304
+ return { ...state };
3305
+ },
3306
+ onAuthStateChange: (callback) => {
3307
+ listeners.add(callback);
3308
+ initPromise.then(() => {
3309
+ try {
3310
+ callback("INITIAL_SESSION", { ...state });
3311
+ } catch (e) {
3312
+ console.error("Error in immediate auth state listener call:", e);
3313
+ }
3314
+ });
3315
+ return {
3316
+ unsubscribe: () => {
3317
+ listeners.delete(callback);
3318
+ }
3319
+ };
3320
+ },
3321
+ getSessions: async () => {
3322
+ const res = await this.axiosInstance.get(
3323
+ `/${config.orgSlug}/customers/auth/sessions`
3324
+ );
3325
+ return res.data?.data || res.data;
3326
+ },
3327
+ revokeSession: async (id) => {
3328
+ const res = await this.axiosInstance.delete(
3329
+ `/${config.orgSlug}/customers/auth/sessions/${id}`
3330
+ );
3331
+ return res.data?.data || res.data;
3332
+ },
3333
+ revokeAllSessions: async (mode) => {
3334
+ const url = mode ? `/${config.orgSlug}/customers/auth/sessions?mode=${mode}` : `/${config.orgSlug}/customers/auth/sessions`;
3335
+ const res = await this.axiosInstance.delete(url);
3336
+ return res.data?.data || res.data;
3337
+ },
3338
+ getCurrentSession: async () => {
3339
+ const res = await this.axiosInstance.get(
3340
+ `/${config.orgSlug}/customers/auth/session`
3341
+ );
3342
+ return res.data?.data || res.data;
3343
+ },
3344
+ refreshSession: async () => {
3345
+ const response = await this.axiosInstance.post(
3346
+ `/${config.orgSlug}/customers/auth/refresh`
3347
+ );
3348
+ const data = response.data?.data || response.data;
3349
+ const token = data?.token || null;
3350
+ const user = data?.session || null;
3351
+ if (token) {
3352
+ state.token = token;
3353
+ state.user = user;
3354
+ const jwtExp = getJwtExpiry(token);
3355
+ await storage.setItem(SCRYME_SESSION_TOKEN_KEY, token);
3356
+ if (jwtExp) {
3357
+ state.expiresAt = jwtExp;
3358
+ await storage.setItem(
3359
+ SCRYME_EXPIRES_AT_KEY,
3360
+ String(state.expiresAt)
3361
+ );
3362
+ } else {
3363
+ delete state.expiresAt;
3364
+ await storage.removeItem(SCRYME_EXPIRES_AT_KEY);
3365
+ }
3366
+ if (user) {
3367
+ await storage.setItem(SCRYME_USER_KEY, JSON.stringify(user));
3368
+ }
3369
+ notify("SIGNED_IN");
3370
+ }
3371
+ return data;
3372
+ },
3373
+ swapZitadel: async (zitadelToken) => {
3374
+ const response = await this.axiosInstance.post(
3375
+ `/${config.orgSlug}/customers/auth/swap-zitadel`,
3376
+ { zitadelToken }
3377
+ );
3378
+ const data = response.data?.data || response.data;
3379
+ const token = data?.token || null;
3380
+ const user = data?.session || null;
3381
+ if (token) {
3382
+ state.token = token;
3383
+ state.user = user;
3384
+ const jwtExp = getJwtExpiry(token);
3385
+ await storage.setItem(SCRYME_SESSION_TOKEN_KEY, token);
3386
+ if (jwtExp) {
3387
+ state.expiresAt = jwtExp;
3388
+ await storage.setItem(
3389
+ SCRYME_EXPIRES_AT_KEY,
3390
+ String(state.expiresAt)
3391
+ );
3392
+ } else {
3393
+ delete state.expiresAt;
3394
+ await storage.removeItem(SCRYME_EXPIRES_AT_KEY);
3395
+ }
3396
+ if (user) {
3397
+ await storage.setItem(SCRYME_USER_KEY, JSON.stringify(user));
3398
+ }
3399
+ notify("SIGNED_IN");
3400
+ }
3401
+ return data;
3402
+ }
3403
+ };
3404
+ }
3405
+ };
3406
+ function createClientSDK(config = {}) {
3407
+ const finalConfig = {
3408
+ clientId: config.clientId || "mock-client-id",
3409
+ clientSecret: config.clientSecret || "mock-client-secret",
3410
+ orgSlug: config.orgSlug || "mock-org-slug",
3411
+ ...config
3412
+ };
3413
+ return new ScrymeClientSDK(finalConfig);
3414
+ }
3415
+ var AuthContext = (0, import_react.createContext)(void 0);
3416
+ var ScrymeAuthProvider = ({
3417
+ sdk,
3418
+ children
3419
+ }) => {
3420
+ const [session, setSession] = (0, import_react.useState)({
3421
+ token: null,
3422
+ user: null
3423
+ });
3424
+ const [isLoading, setIsLoading] = (0, import_react.useState)(true);
3425
+ const [cart, setCart] = (0, import_react.useState)(null);
3426
+ const [cartLoading, setCartLoading] = (0, import_react.useState)(false);
3427
+ const [customerProfile, setCustomerProfile] = (0, import_react.useState)(null);
3428
+ const [customerAddresses, setCustomerAddresses] = (0, import_react.useState)([]);
3429
+ const [bookingsList, setBookingsList] = (0, import_react.useState)([]);
3430
+ const [bookingsLoading, setBookingsLoading] = (0, import_react.useState)(false);
3431
+ (0, import_react.useEffect)(() => {
3432
+ const { unsubscribe } = sdk.auth.onAuthStateChange((event, newSession) => {
3433
+ setSession(newSession);
3434
+ setIsLoading(false);
3435
+ });
3436
+ return () => unsubscribe();
3437
+ }, [sdk]);
3438
+ const refreshCart = async () => {
3439
+ if (!session.token) {
3440
+ setCart(null);
3441
+ return;
3442
+ }
3443
+ setCartLoading(true);
3444
+ try {
3445
+ const res = await sdk.cart.get();
3446
+ setCart(res.data?.data || res.data || null);
3447
+ } catch (err) {
3448
+ console.error("Failed to fetch cart:", err);
3449
+ } finally {
3450
+ setCartLoading(false);
3451
+ }
3452
+ };
3453
+ const refreshProfile = async () => {
3454
+ if (!session.token) {
3455
+ setCustomerProfile(null);
3456
+ setCustomerAddresses([]);
3457
+ return;
3458
+ }
3459
+ try {
3460
+ const profile = await sdk.customer.getProfile();
3461
+ setCustomerProfile(profile || null);
3462
+ const addresses = await sdk.customer.getAddresses();
3463
+ setCustomerAddresses(addresses?.data || addresses || []);
3464
+ } catch (err) {
3465
+ console.error("Failed to fetch customer profile or addresses:", err);
3466
+ }
3467
+ };
3468
+ const refreshBookings = async () => {
3469
+ if (!session.token) {
3470
+ setBookingsList([]);
3471
+ return;
3472
+ }
3473
+ setBookingsLoading(true);
3474
+ try {
3475
+ const res = await sdk.bookings.list();
3476
+ setBookingsList(res?.data || res || []);
3477
+ } catch (err) {
3478
+ console.error("Failed to fetch bookings:", err);
3479
+ } finally {
3480
+ setBookingsLoading(false);
3481
+ }
3482
+ };
3483
+ (0, import_react.useEffect)(() => {
3484
+ if (session.token) {
3485
+ refreshCart();
3486
+ refreshProfile();
3487
+ refreshBookings();
3488
+ } else {
3489
+ setCart(null);
3490
+ setCustomerProfile(null);
3491
+ setCustomerAddresses([]);
3492
+ setBookingsList([]);
3493
+ }
3494
+ }, [session.token]);
3495
+ const signIn = async (credentials) => {
3496
+ const res = await sdk.auth.signIn(credentials);
3497
+ return res;
3498
+ };
3499
+ const signUp = async (dto) => {
3500
+ const res = await sdk.auth.signUp(dto);
3501
+ return res;
3502
+ };
3503
+ const signOut = async () => {
3504
+ await sdk.auth.signOut();
3505
+ };
3506
+ const addToCart = async (dto) => {
3507
+ if (!session.token)
3508
+ throw new Error("Customer must be logged in to manage cart");
3509
+ await sdk.cart.add(dto);
3510
+ await refreshCart();
3511
+ };
3512
+ const removeFromCart = async (dto) => {
3513
+ if (!session.token)
3514
+ throw new Error("Customer must be logged in to manage cart");
3515
+ await sdk.cart.remove(dto);
3516
+ await refreshCart();
3517
+ };
3518
+ const updateCartItem = async (dto) => {
3519
+ if (!session.token)
3520
+ throw new Error("Customer must be logged in to manage cart");
3521
+ await sdk.cart.update(dto);
3522
+ await refreshCart();
3523
+ };
3524
+ const clearCart = async (params) => {
3525
+ if (!session.token)
3526
+ throw new Error("Customer must be logged in to manage cart");
3527
+ await sdk.cart.clear(params);
3528
+ await refreshCart();
3529
+ };
3530
+ const addAddress = async (dto) => {
3531
+ if (!session.token)
3532
+ throw new Error("Customer must be logged in to manage addresses");
3533
+ const res = await sdk.customer.addAddress(dto);
3534
+ await refreshProfile();
3535
+ return res;
3536
+ };
3537
+ const updateProfile = async (dto) => {
3538
+ if (!session.token)
3539
+ throw new Error("Customer must be logged in to update profile");
3540
+ const res = await sdk.customer.updateProfile(dto);
3541
+ await refreshProfile();
3542
+ return res;
3543
+ };
3544
+ const createBooking = async (dto) => {
3545
+ if (!session.token)
3546
+ throw new Error("Customer must be logged in to create bookings");
3547
+ const res = await sdk.bookings.create(dto);
3548
+ await refreshBookings();
3549
+ return res;
3550
+ };
3551
+ const cancelBooking = async (id) => {
3552
+ if (!session.token)
3553
+ throw new Error("Customer must be logged in to cancel bookings");
3554
+ const res = await sdk.bookings.cancel(id);
3555
+ await refreshBookings();
3556
+ return res;
3557
+ };
3558
+ const checkoutCart = async (params) => {
3559
+ if (!session.token)
3560
+ throw new Error("Customer must be logged in to checkout");
3561
+ const res = await sdk.cart.checkout(params);
3562
+ await refreshCart();
3563
+ await refreshBookings();
3564
+ return res;
3565
+ };
3566
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
3567
+ AuthContext.Provider,
3568
+ {
3569
+ value: {
3570
+ sdk,
3571
+ session,
3572
+ user: session.user,
3573
+ token: session.token,
3574
+ isLoading,
3575
+ signIn,
3576
+ signUp,
3577
+ signOut,
3578
+ cart,
3579
+ cartLoading,
3580
+ addToCart,
3581
+ removeFromCart,
3582
+ updateCartItem,
3583
+ clearCart,
3584
+ refreshCart,
3585
+ customerProfile,
3586
+ customerAddresses,
3587
+ bookings: bookingsList,
3588
+ bookingsLoading,
3589
+ addAddress,
3590
+ updateProfile,
3591
+ createBooking,
3592
+ cancelBooking,
3593
+ checkoutCart,
3594
+ refreshProfile,
3595
+ refreshBookings
3596
+ },
3597
+ children
3598
+ }
3599
+ );
3600
+ };
3601
+ var useScrymeAuth = () => {
3602
+ const context = (0, import_react.useContext)(AuthContext);
3603
+ if (context === void 0) {
3604
+ throw new Error("useScrymeAuth must be used within a ScrymeAuthProvider");
3605
+ }
3606
+ return context;
3607
+ };
3608
+
3609
+ // src/server.ts
3610
+ var import_axios3 = __toESM(require("axios"));
3611
+ var ScrymeServerSDK = class {
3612
+ constructor(config) {
3613
+ this.token = null;
3614
+ this.expiresAt = null;
3615
+ this.activeAuthPromise = null;
3616
+ if (!config || !config.clientId || !config.clientSecret || !config.orgSlug) {
3617
+ throw new Error(
3618
+ "clientId, clientSecret, and orgSlug are required to initialize the SDK."
3619
+ );
3620
+ }
3621
+ let finalBaseURL = config.baseURL || "https://api.scryme.tech";
3622
+ if (finalBaseURL && !finalBaseURL.includes("/api") && !finalBaseURL.endsWith("/api")) {
3623
+ finalBaseURL = finalBaseURL.replace(/\/$/, "") + "/api";
3624
+ }
3625
+ this.axiosInstance = import_axios3.default.create({
3626
+ baseURL: finalBaseURL
3627
+ });
3628
+ if (config.token) {
3629
+ this.token = config.token;
3630
+ this.expiresAt = getJwtExpiry(config.token);
3631
+ this.axiosInstance.defaults.headers.common["Authorization"] = `Bearer ${config.token}`;
3632
+ }
3633
+ if (config.apiKey) {
3634
+ this.axiosInstance.defaults.headers.common["x-api-key"] = config.apiKey;
3635
+ }
3636
+ const performExchange = async () => {
3637
+ if (this.activeAuthPromise) {
3638
+ return this.activeAuthPromise;
3639
+ }
3640
+ this.activeAuthPromise = (async () => {
3641
+ try {
3642
+ const response = await this.api.authExchangeToken({
3643
+ clientId: config.clientId,
3644
+ clientSecret: config.clientSecret
3645
+ });
3646
+ const tokenData = response.data?.data;
3647
+ const accessToken = tokenData?.access_token;
3648
+ const expiresIn = tokenData?.expires_in;
3649
+ if (accessToken) {
3650
+ this.token = accessToken;
3651
+ if (expiresIn) {
3652
+ this.expiresAt = Date.now() + expiresIn * 1e3;
3653
+ } else {
3654
+ this.expiresAt = getJwtExpiry(accessToken);
3655
+ }
3656
+ this.axiosInstance.defaults.headers.common["Authorization"] = `Bearer ${accessToken}`;
3657
+ }
3658
+ return response.data;
3659
+ } finally {
3660
+ this.activeAuthPromise = null;
3661
+ }
3662
+ })();
3663
+ return this.activeAuthPromise;
3664
+ };
3665
+ this.axiosInstance.interceptors.request.use(async (req) => {
3666
+ 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"));
3667
+ if (!isAuthTokenRequest && !config.apiKey) {
3668
+ const isExpired = !this.token || this.expiresAt && Date.now() >= this.expiresAt - 3e4;
3669
+ if (isExpired) {
3670
+ const isCustomerToken = this.token && getJwtExpiry(this.token) && !config.clientSecret;
3671
+ if (isCustomerToken || this.token && !config.clientSecret) {
3672
+ try {
3673
+ await this.auth.refreshSession();
3674
+ } catch (e) {
3675
+ console.error(
3676
+ "Proactive customer session refresh failed in request interceptor:",
3677
+ e
3678
+ );
3679
+ }
3680
+ } else if (config.clientId && config.clientSecret) {
3681
+ try {
3682
+ await performExchange();
3683
+ } catch (e) {
3684
+ console.error(
3685
+ "Auto-authentication failed in request interceptor:",
3686
+ e
3687
+ );
3688
+ }
3689
+ }
3690
+ }
3691
+ }
3692
+ if (this.token) {
3693
+ req.headers["Authorization"] = `Bearer ${this.token}`;
3694
+ }
3695
+ return req;
3696
+ });
3697
+ this.axiosInstance.interceptors.response.use(
3698
+ (response) => response,
3699
+ async (error) => {
3700
+ const originalRequest = error.config;
3701
+ 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"));
3702
+ if (error.response && error.response.status === 401 && originalRequest && !originalRequest._retry && !isAuthTokenRequest && !config.apiKey) {
3703
+ originalRequest._retry = true;
3704
+ try {
3705
+ const isCustomerToken = this.token && getJwtExpiry(this.token) && !config.clientSecret;
3706
+ if (isCustomerToken || this.token && !config.clientSecret) {
3707
+ await this.auth.refreshSession();
3708
+ if (this.token) {
3709
+ originalRequest.headers["Authorization"] = `Bearer ${this.token}`;
3710
+ }
3711
+ return this.axiosInstance(originalRequest);
3712
+ } else if (config.clientId && config.clientSecret) {
3713
+ await performExchange();
3714
+ if (this.token) {
3715
+ originalRequest.headers["Authorization"] = `Bearer ${this.token}`;
3716
+ }
3717
+ return this.axiosInstance(originalRequest);
3718
+ }
3719
+ } catch (e) {
3720
+ return Promise.reject(error);
3721
+ }
3722
+ }
3723
+ return Promise.reject(error);
3724
+ }
3725
+ );
3726
+ this.api = getScrymeV3API2(this.axiosInstance, config.orgSlug);
3727
+ this.catalog = buildModule(this.api, config.orgSlug, catalogMapping);
3728
+ this.inventory = buildModule(this.api, config.orgSlug, inventoryMapping);
3729
+ this.orders = buildModule(this.api, config.orgSlug, ordersMapping);
3730
+ this.crm = buildModule(this.api, config.orgSlug, crmMapping);
3731
+ this.pos = buildModule(this.api, config.orgSlug, posMapping);
3732
+ this.accounting = buildModule(this.api, config.orgSlug, accountingMapping);
3733
+ this.loyalty = buildModule(this.api, config.orgSlug, loyaltyMapping);
3734
+ this.members = buildModule(this.api, config.orgSlug, membersMapping);
3735
+ this.admin = buildModule(this.api, config.orgSlug, adminMapping);
3736
+ this.services = buildModule(this.api, config.orgSlug, servicesMapping);
3737
+ this.cart = {
3738
+ get: async (params) => {
3739
+ return this.orders.getCart(params || {});
3740
+ },
3741
+ add: async (dto) => {
3742
+ return this.orders.addToCart(dto);
3743
+ },
3744
+ remove: async (dto) => {
3745
+ return this.orders.removeFromCart(dto);
3746
+ },
3747
+ clear: async (params) => {
3748
+ return this.orders.clearCart(params || {});
3749
+ },
3750
+ update: async (dto) => {
3751
+ const response = await this.orders.getCart({
3752
+ sessionId: dto.sessionId
3753
+ });
3754
+ const data = response.data;
3755
+ const items = data?.data?.items || data?.items || [];
3756
+ let existingItem = null;
3757
+ if (dto.productId) {
3758
+ existingItem = items.find(
3759
+ (item) => item.productId === dto.productId && (item.variantId || null) === (dto.variantId || null)
3760
+ );
3761
+ } else if (dto.serviceId) {
3762
+ existingItem = items.find(
3763
+ (item) => item.serviceId === dto.serviceId
3764
+ );
3765
+ }
3766
+ if (existingItem) {
3767
+ const currentQty = existingItem.quantity || 0;
3768
+ if (dto.quantity <= 0) {
3769
+ return this.orders.removeFromCart({
3770
+ productId: dto.productId,
3771
+ variantId: dto.variantId,
3772
+ serviceId: dto.serviceId,
3773
+ sessionId: dto.sessionId,
3774
+ customerId: dto.customerId
3775
+ });
3776
+ } else {
3777
+ const diff = dto.quantity - currentQty;
3778
+ if (diff !== 0) {
3779
+ return this.orders.addToCart({
3780
+ ...dto,
3781
+ quantity: diff
3782
+ });
3783
+ }
3784
+ return response;
3785
+ }
3786
+ } else {
3787
+ if (dto.quantity > 0) {
3788
+ return this.orders.addToCart(dto);
3789
+ }
3790
+ }
3791
+ },
3792
+ getItems: async (params) => {
3793
+ const res = await this.orders.getCart(params || {});
3794
+ const data = res?.data || res;
3795
+ return data?.items || data?.data?.items || [];
3796
+ },
3797
+ getTotals: async (params) => {
3798
+ const res = await this.orders.getCart(params || {});
3799
+ const data = res?.data || res;
3800
+ const items = data?.items || data?.data?.items || [];
3801
+ const itemsCount = items.reduce(
3802
+ (sum, item) => sum + (item.quantity || 0),
3803
+ 0
3804
+ );
3805
+ return {
3806
+ itemsCount,
3807
+ items,
3808
+ raw: data
3809
+ };
3810
+ },
3811
+ checkout: async (params) => {
3812
+ if (!params.customerId)
3813
+ throw new Error("customerId is required for server checkout.");
3814
+ const items = await this.cart.getItems({
3815
+ sessionId: params.sessionId,
3816
+ customerId: params.customerId
3817
+ });
3818
+ if (!items || items.length === 0) {
3819
+ throw new Error("Cannot checkout an empty cart.");
3820
+ }
3821
+ const orderItems = items.map((item) => ({
3822
+ variantId: item.variantId || "",
3823
+ quantity: item.quantity,
3824
+ unitPrice: item.unitPrice
3825
+ }));
3826
+ const orderResponse = await this.orders.createOrder({
3827
+ customerId: params.customerId,
3828
+ locationId: params.locationId,
3829
+ items: orderItems,
3830
+ notes: params.notes,
3831
+ channel: params.channel
3832
+ });
3833
+ await this.cart.clear({
3834
+ sessionId: params.sessionId || "",
3835
+ customerId: params.customerId
3836
+ });
3837
+ return orderResponse?.data || orderResponse;
3838
+ }
3839
+ };
3840
+ this.customer = {
3841
+ getProfile: async (customerId) => {
3842
+ return this.admin.getCustomerById(customerId);
3843
+ },
3844
+ updateProfile: async (customerId, dto) => {
3845
+ return this.admin.updateCustomer(customerId, dto);
3846
+ },
3847
+ getAddresses: async (customerId) => {
3848
+ return this.admin.getCustomerAddresses(customerId);
3849
+ },
3850
+ addAddress: async (customerId, dto) => {
3851
+ return this.admin.addCustomerAddress(customerId, dto);
3852
+ }
3853
+ };
3854
+ this.bookings = {
3855
+ create: async (dto) => {
3856
+ return this.catalog.createBooking(dto);
3857
+ },
3858
+ get: async (id) => {
3859
+ return this.catalog.getBooking(id);
3860
+ },
3861
+ list: async () => {
3862
+ return this.catalog.getBookings();
3863
+ },
3864
+ cancel: async (id) => {
3865
+ return this.catalog.updateBookingStatus(id, "CANCELLED");
3866
+ },
3867
+ complete: async (id, dto) => {
3868
+ return this.catalog.completeBooking(id, dto);
3869
+ }
3870
+ };
3871
+ const baseAuth = buildModule(this.api, config.orgSlug, authMapping);
3872
+ this.auth = {
3873
+ ...baseAuth,
3874
+ signUp: async (dto) => {
3875
+ return this.api.customersRegister(config.orgSlug, dto);
3876
+ },
3877
+ authenticate: async () => {
3878
+ return performExchange();
3879
+ },
3880
+ signIn: async (credentials) => {
3881
+ const response = await this.axiosInstance.post(
3882
+ "/auth/sign-in/email",
3883
+ credentials
3884
+ );
3885
+ const data = response.data;
3886
+ const token = data?.session?.token || data?.token || null;
3887
+ if (token) {
3888
+ this.token = token;
3889
+ this.expiresAt = getJwtExpiry(token);
3890
+ this.axiosInstance.defaults.headers.common["Authorization"] = `Bearer ${token}`;
3891
+ }
3892
+ return data;
3893
+ },
3894
+ getCurrentSession: async () => {
3895
+ const response = await this.axiosInstance.get(
3896
+ `/${config.orgSlug}/customers/auth/session`
3897
+ );
3898
+ return response.data?.data || response.data;
3899
+ },
3900
+ refreshSession: async () => {
3901
+ const response = await this.axiosInstance.post(
3902
+ `/${config.orgSlug}/customers/auth/refresh`
3903
+ );
3904
+ const data = response.data?.data || response.data;
3905
+ const token = data?.token || null;
3906
+ if (token) {
3907
+ this.token = token;
3908
+ this.expiresAt = getJwtExpiry(token);
3909
+ this.axiosInstance.defaults.headers.common["Authorization"] = `Bearer ${token}`;
3910
+ }
3911
+ return data;
3912
+ },
3913
+ swapZitadel: async (zitadelToken) => {
3914
+ const response = await this.axiosInstance.post(
3915
+ `/${config.orgSlug}/customers/auth/swap-zitadel`,
3916
+ { zitadelToken }
3917
+ );
3918
+ const data = response.data?.data || response.data;
3919
+ const token = data?.token || null;
3920
+ if (token) {
3921
+ this.token = token;
3922
+ this.expiresAt = getJwtExpiry(token);
3923
+ this.axiosInstance.defaults.headers.common["Authorization"] = `Bearer ${token}`;
3924
+ }
3925
+ return data;
3926
+ }
3927
+ };
3928
+ }
3929
+ };
3930
+ function createServerSDK(config = {}) {
3931
+ const finalConfig = {
3932
+ clientId: config.clientId || "mock-client-id",
3933
+ clientSecret: config.clientSecret || "mock-client-secret",
3934
+ orgSlug: config.orgSlug || "mock-org-slug",
3935
+ ...config
3936
+ };
3937
+ return new ScrymeServerSDK(finalConfig);
3938
+ }
3939
+
3940
+ // src/index.ts
3941
+ function getEnvOrgSlug() {
3942
+ if (typeof process !== "undefined" && process.env) {
3943
+ const slug = process.env.SCRYME_ORG_SLUG || process.env.NEXT_PUBLIC_SCRYME_ORG_SLUG;
3944
+ if (slug) return slug;
3945
+ }
3946
+ try {
3947
+ const getMeta = new Function("return typeof import.meta !== 'undefined' ? import.meta : undefined");
3948
+ const meta = getMeta();
3949
+ if (meta && meta.env) {
3950
+ const slug = meta.env.VITE_SCRYME_ORG_SLUG || meta.env.SCRYME_ORG_SLUG;
3951
+ if (slug) return slug;
3952
+ }
3953
+ } catch (e) {
3954
+ }
3955
+ return void 0;
3956
+ }
3957
+ function expectsOrgSlug(fn) {
3958
+ const fnStr = fn.toString();
3959
+ const match = fnStr.match(/^\s*(?:async\s+)?\(([^)]+)\)/);
3960
+ if (!match) {
3961
+ const singleMatch = fnStr.match(/^\s*(\w+)\s*=>/);
3962
+ return singleMatch ? singleMatch[1] === "orgSlug" : false;
3963
+ }
3964
+ const firstParam = match[1].split(",")[0].split(":")[0].trim();
3965
+ return firstParam === "orgSlug";
3966
+ }
3967
+ function getStringParamCount(fn) {
3968
+ const fnStr = fn.toString();
3969
+ const match = fnStr.match(/^\s*(?:async\s+)?\(([^)]+)\)/);
3970
+ if (!match) return 0;
3971
+ const params = match[1].split(",").map((p) => p.trim());
3972
+ let count = 0;
3973
+ for (const param of params) {
3974
+ const cleanParam = param.split(":")[0].split("=")[0].trim();
3975
+ const lower = cleanParam.toLowerCase();
3976
+ if (lower === "params" || lower === "options" || lower.endsWith("dto") || lower.endsWith("body") || lower.endsWith("payload")) {
3977
+ break;
3978
+ }
3979
+ count++;
3980
+ }
3981
+ return count;
3982
+ }
3983
+ var getScrymeV3API2 = (axiosInstance, defaultOrgSlug) => {
3984
+ const api = getScrymeV3API(axiosInstance);
3985
+ return new Proxy(api, {
3986
+ get(target, prop, receiver) {
3987
+ const originalValue = Reflect.get(target, prop, receiver);
3988
+ if (typeof originalValue === "function") {
3989
+ if (expectsOrgSlug(originalValue)) {
3990
+ return function(...args) {
3991
+ const stringParamsExpected = getStringParamCount(originalValue);
3992
+ const stringArgsPassed = args.filter((arg) => typeof arg === "string").length;
3993
+ if (stringArgsPassed < stringParamsExpected) {
3994
+ const envSlug = defaultOrgSlug || getEnvOrgSlug() || "default-org";
3995
+ return originalValue.apply(this, [envSlug, ...args]);
3996
+ }
3997
+ return originalValue.apply(this, args);
3998
+ };
3999
+ }
4000
+ }
4001
+ return originalValue;
4002
+ }
4003
+ });
4004
+ };
4005
+ // Annotate the CommonJS export names for ESM import in node:
4006
+ 0 && (module.exports = {
4007
+ AddDepartmentMemberDtoRole,
4008
+ AttendanceControllerGetLogsSortOrder,
4009
+ CmsCustomFieldsDtoPublishStatus,
4010
+ CreateCrmFieldDtoType,
4011
+ CreateCrmRelationshipDtoType,
4012
+ CreateExpenseDtoPaymentMethod,
4013
+ CreateIntegrationDefinitionDtoAuthType,
4014
+ CreateIntegrationDefinitionDtoCategory,
4015
+ CreateInvitationDtoRole,
4016
+ CreateMemberDtoRole,
4017
+ CreateOrderDtoChannel,
4018
+ CreatePartnerDtoBenefitType,
4019
+ CreatePartnerDtoReconciliationPolicy,
4020
+ CreateServiceDtoPricingModel,
4021
+ CreateStrapiConnectionDtoEnabledSyncTypesItem,
4022
+ CreateStrapiConnectionDtoSyncDirection,
4023
+ CreateTransferDtoPriority,
4024
+ CreateUtilityAccountDtoType,
4025
+ DepartmentsListSortOrder,
4026
+ ExpenseControllerGetExpensesStatus,
4027
+ InvitationResponseDtoRole,
4028
+ InvitationResponseDtoStatus,
4029
+ InvitationsListSortOrder,
4030
+ InvitationsListStatus,
4031
+ MemberResponseDtoMembershipStatus,
4032
+ MemberResponseDtoRole,
4033
+ MemberResponseDtoStatus,
4034
+ MembersControllerGetMembersMembershipStatus,
4035
+ MembersControllerGetMembersRole,
4036
+ MembersControllerGetMembersSortOrder,
4037
+ ReconcilePodDtoOutcome,
4038
+ RegisterPettyCashDtoPaymentMethod,
4039
+ ReviewPriceChangeDtoStatus,
4040
+ RoleManagementControllerGetCustomRolesSortOrder,
4041
+ ScrymeAuthProvider,
4042
+ ScrymeClientSDK,
4043
+ ScrymeServerSDK,
4044
+ ServicesUpdateBookingStatusBodyStatus,
4045
+ TriggerSyncDtoDirection,
4046
+ TriggerSyncDtoSyncTypesItem,
4047
+ UpdateIntegrationDefinitionDtoAuthType,
4048
+ UpdateIntegrationDefinitionDtoCategory,
4049
+ UpdateMemberDtoMembershipStatus,
4050
+ UpdateMemberDtoRole,
4051
+ UpdateMemberDtoStatus,
4052
+ UpdatePartnerDtoBenefitType,
4053
+ UpdatePartnerDtoReconciliationPolicy,
4054
+ UpdateServiceDtoPricingModel,
4055
+ UpdateStrapiConnectionDtoEnabledSyncTypesItem,
4056
+ UpdateStrapiConnectionDtoSyncDirection,
4057
+ accountingMapping,
4058
+ adminMapping,
4059
+ authMapping,
4060
+ buildModule,
4061
+ catalogMapping,
4062
+ createClientSDK,
4063
+ createServerSDK,
4064
+ crmMapping,
4065
+ getJwtExpiry,
4066
+ getScrymeV3API,
4067
+ inventoryMapping,
4068
+ loyaltyMapping,
4069
+ membersMapping,
4070
+ methodsWithOrgSlugSet,
4071
+ ordersMapping,
4072
+ posMapping,
4073
+ publicServicesMapping,
4074
+ servicesMapping,
4075
+ useScrymeAuth
4076
+ });