@scryme/sdk 9.69.0 → 9.70.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/{base-CSVOv3Nr.d.mts → base-B5jgRLyM.d.mts} +53 -2
- package/dist/{base-CSVOv3Nr.d.ts → base-B5jgRLyM.d.ts} +53 -2
- package/dist/{chunk-SYGBIPUK.mjs → chunk-Z6VKSRBE.mjs} +96 -1
- package/dist/client.d.mts +56 -6
- package/dist/client.d.ts +56 -6
- package/dist/client.js +66 -1
- package/dist/client.mjs +1 -1
- package/dist/index.d.mts +6 -3
- package/dist/index.d.ts +6 -3
- package/dist/index.js +99 -3
- package/dist/index.mjs +5 -3
- package/dist/server.d.mts +36 -2
- package/dist/server.d.ts +36 -2
- package/dist/server.js +64 -1
- package/dist/server.mjs +1 -1
- package/package.json +1 -1
|
@@ -750,6 +750,15 @@ var getScrymeV3API = (axiosInstance = axios) => {
|
|
|
750
750
|
options
|
|
751
751
|
);
|
|
752
752
|
};
|
|
753
|
+
const servicesGetAvailability = (orgSlug, id, params, options) => {
|
|
754
|
+
return axiosInstance.get(
|
|
755
|
+
`/v3/${orgSlug}/services/${id}/availability`,
|
|
756
|
+
{
|
|
757
|
+
...options,
|
|
758
|
+
params: { ...params, ...options?.params }
|
|
759
|
+
}
|
|
760
|
+
);
|
|
761
|
+
};
|
|
753
762
|
const servicesDeleteService = (orgSlug, id, options) => {
|
|
754
763
|
return axiosInstance.post(
|
|
755
764
|
`/v3/${orgSlug}/services/${id}/delete`,
|
|
@@ -817,6 +826,13 @@ var getScrymeV3API = (axiosInstance = axios) => {
|
|
|
817
826
|
options
|
|
818
827
|
);
|
|
819
828
|
};
|
|
829
|
+
const servicesCancelBookingSeries = (orgSlug, recurrenceId, options) => {
|
|
830
|
+
return axiosInstance.post(
|
|
831
|
+
`/v3/${orgSlug}/services/bookings/recurrence/${recurrenceId}/cancel`,
|
|
832
|
+
void 0,
|
|
833
|
+
options
|
|
834
|
+
);
|
|
835
|
+
};
|
|
820
836
|
const servicesCreateShift = (orgSlug, memberId, servicesCreateShiftBody, options) => {
|
|
821
837
|
return axiosInstance.post(
|
|
822
838
|
`/v3/${orgSlug}/services/staff/${memberId}/shifts`,
|
|
@@ -1894,7 +1910,14 @@ var getScrymeV3API = (axiosInstance = axios) => {
|
|
|
1894
1910
|
}
|
|
1895
1911
|
);
|
|
1896
1912
|
};
|
|
1897
|
-
|
|
1913
|
+
const paymentsCheckout = (orgSlug, checkoutDto, options) => {
|
|
1914
|
+
return axiosInstance.post(
|
|
1915
|
+
`/v3/${orgSlug}/payments/checkout`,
|
|
1916
|
+
checkoutDto,
|
|
1917
|
+
options
|
|
1918
|
+
);
|
|
1919
|
+
};
|
|
1920
|
+
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, catalogGetProduct, catalogGetServices, catalogUpdateProduct, catalogUpdateSupplierVariant, catalogGetPriceChangeRequests, catalogReviewPriceChangeRequest, catalogCreateReview, catalogUpdateReview, catalogDeleteReview, servicesCreateCategory, servicesGetCategories, servicesUpdateCategory, servicesDeleteCategory, servicesCreateService, servicesGetServices, servicesGetCurrentMemberShifts, servicesGetShifts, servicesGetService, servicesUpdateService, servicesGetAvailability, servicesDeleteService, servicesCreateResource, servicesGetResources, servicesUpdateResource, servicesDeleteResource, servicesCreateBooking, servicesGetBookings, servicesGetBooking, servicesUpdateBookingStatus, servicesCompleteBooking, servicesCancelBookingSeries, servicesCreateShift, servicesGetStaffShifts, servicesAddBreak, servicesRegisterCustomerApp, servicesGetUtilization, servicesGetPerformance, servicesGetFunnel, publicServicesListServices, publicServicesGetCategories, publicServicesGetService, publicServicesGetAvailability, publicServicesRequestOtp, publicServicesVerifyOtp, publicServicesCreatePublicBooking, customersGetCustomers, customersRegister, customerRegister, customersLogin, customersRefreshSession, 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, paymentsCheckout };
|
|
1898
1921
|
};
|
|
1899
1922
|
|
|
1900
1923
|
// src/generated/model/addDepartmentMemberDtoRole.ts
|
|
@@ -2343,6 +2366,7 @@ var methodsWithOrgSlugSet = /* @__PURE__ */ new Set([
|
|
|
2343
2366
|
"webhooksCreate",
|
|
2344
2367
|
"webhooksList",
|
|
2345
2368
|
"webhooksDelete",
|
|
2369
|
+
"paymentsCheckout",
|
|
2346
2370
|
"catalogGetProducts",
|
|
2347
2371
|
"catalogGetProduct",
|
|
2348
2372
|
"catalogCreateProduct",
|
|
@@ -2372,8 +2396,10 @@ var methodsWithOrgSlugSet = /* @__PURE__ */ new Set([
|
|
|
2372
2396
|
"servicesCreateBooking",
|
|
2373
2397
|
"servicesGetBookings",
|
|
2374
2398
|
"servicesGetBooking",
|
|
2399
|
+
"servicesGetAvailability",
|
|
2375
2400
|
"servicesUpdateBookingStatus",
|
|
2376
2401
|
"servicesCompleteBooking",
|
|
2402
|
+
"servicesCancelBookingSeries",
|
|
2377
2403
|
"servicesCreateShift",
|
|
2378
2404
|
"servicesGetStaffShifts",
|
|
2379
2405
|
"servicesAddBreak",
|
|
@@ -2559,8 +2585,14 @@ var ordersMapping = {
|
|
|
2559
2585
|
clearCart: "cartControllerClearCart",
|
|
2560
2586
|
addToCart: "cartControllerAddToCart",
|
|
2561
2587
|
removeFromCart: "cartControllerRemoveFromCart",
|
|
2588
|
+
checkout: "paymentsCheckout",
|
|
2562
2589
|
handleStkCallback: "paymentsControllerHandleStkCallback"
|
|
2563
2590
|
};
|
|
2591
|
+
var webhooksMapping = {
|
|
2592
|
+
create: "webhooksCreate",
|
|
2593
|
+
list: "webhooksList",
|
|
2594
|
+
delete: "webhooksDelete"
|
|
2595
|
+
};
|
|
2564
2596
|
var crmMapping = {
|
|
2565
2597
|
createRecord: "crmControllerCreateRecord",
|
|
2566
2598
|
getRecord: "crmControllerGetRecord",
|
|
@@ -2718,8 +2750,10 @@ var servicesMapping = {
|
|
|
2718
2750
|
createBookingAdmin: "servicesCreateBooking",
|
|
2719
2751
|
getBookings: "servicesGetBookings",
|
|
2720
2752
|
getBookingAdmin: "servicesGetBooking",
|
|
2753
|
+
getAvailabilityAdmin: "servicesGetAvailability",
|
|
2721
2754
|
updateBookingStatus: "servicesUpdateBookingStatus",
|
|
2722
2755
|
completeBooking: "servicesCompleteBooking",
|
|
2756
|
+
cancelBookingSeries: "servicesCancelBookingSeries",
|
|
2723
2757
|
createShift: "servicesCreateShift",
|
|
2724
2758
|
getStaffShifts: "servicesGetStaffShifts",
|
|
2725
2759
|
addBreak: "servicesAddBreak",
|
|
@@ -3100,6 +3134,7 @@ var ScrymeClientSDK = class {
|
|
|
3100
3134
|
this.loyalty = buildModule(this.api, config.orgSlug, loyaltyMapping);
|
|
3101
3135
|
this.members = buildModule(this.api, config.orgSlug, membersMapping);
|
|
3102
3136
|
this.admin = buildModule(this.api, config.orgSlug, adminMapping);
|
|
3137
|
+
this.webhooks = buildModule(this.api, config.orgSlug, webhooksMapping);
|
|
3103
3138
|
this.cart = {
|
|
3104
3139
|
get: async (params) => {
|
|
3105
3140
|
return this.orders.getCart(params);
|
|
@@ -3205,6 +3240,15 @@ var ScrymeClientSDK = class {
|
|
|
3205
3240
|
return this.orders.getCart({ sessionId: guestSessionId });
|
|
3206
3241
|
},
|
|
3207
3242
|
checkout: async (params) => {
|
|
3243
|
+
if (params.phoneNumber) {
|
|
3244
|
+
const res = await this.orders.checkout({
|
|
3245
|
+
cartId: params.cartId,
|
|
3246
|
+
phoneNumber: params.phoneNumber,
|
|
3247
|
+
locationId: params.locationId,
|
|
3248
|
+
notes: params.notes
|
|
3249
|
+
});
|
|
3250
|
+
return res?.data || res;
|
|
3251
|
+
}
|
|
3208
3252
|
const session = await this.auth.getSession();
|
|
3209
3253
|
const user = session.user;
|
|
3210
3254
|
const customerId = user?.customerId || user?.id || user?.customer?.id;
|
|
@@ -3460,8 +3504,29 @@ var ScrymeClientSDK = class {
|
|
|
3460
3504
|
list: async () => {
|
|
3461
3505
|
return this.catalog.getBookings();
|
|
3462
3506
|
},
|
|
3507
|
+
updateStatus: async (id, status) => {
|
|
3508
|
+
return this.catalog.updateBookingStatus(id, status);
|
|
3509
|
+
},
|
|
3463
3510
|
cancel: async (id) => {
|
|
3464
3511
|
return this.catalog.updateBookingStatus(id, "CANCELLED");
|
|
3512
|
+
},
|
|
3513
|
+
cancelSeries: async (recurrenceId) => {
|
|
3514
|
+
return this.api.servicesCancelBookingSeries(config.orgSlug, recurrenceId);
|
|
3515
|
+
},
|
|
3516
|
+
complete: async (id, dto) => {
|
|
3517
|
+
return this.catalog.completeBooking(id, dto);
|
|
3518
|
+
},
|
|
3519
|
+
getAvailability: async (serviceId, date) => {
|
|
3520
|
+
return this.api.publicServicesGetAvailability(config.orgSlug, serviceId, date ? { date } : void 0);
|
|
3521
|
+
},
|
|
3522
|
+
requestOtp: async (dto) => {
|
|
3523
|
+
return this.api.publicServicesRequestOtp(config.orgSlug, dto);
|
|
3524
|
+
},
|
|
3525
|
+
verifyOtp: async (dto) => {
|
|
3526
|
+
return this.api.publicServicesVerifyOtp(config.orgSlug, dto);
|
|
3527
|
+
},
|
|
3528
|
+
createPublicBooking: async (dto) => {
|
|
3529
|
+
return this.api.publicServicesCreatePublicBooking(config.orgSlug, dto);
|
|
3465
3530
|
}
|
|
3466
3531
|
};
|
|
3467
3532
|
}
|
|
@@ -3714,6 +3779,7 @@ var ScrymeServerSDK = class {
|
|
|
3714
3779
|
this.loyalty = buildModule(this.api, config.orgSlug, loyaltyMapping);
|
|
3715
3780
|
this.members = buildModule(this.api, config.orgSlug, membersMapping);
|
|
3716
3781
|
this.admin = buildModule(this.api, config.orgSlug, adminMapping);
|
|
3782
|
+
this.webhooks = buildModule(this.api, config.orgSlug, webhooksMapping);
|
|
3717
3783
|
this.services = buildModule(this.api, config.orgSlug, servicesMapping);
|
|
3718
3784
|
this.cart = {
|
|
3719
3785
|
get: async (params) => {
|
|
@@ -3796,6 +3862,16 @@ var ScrymeServerSDK = class {
|
|
|
3796
3862
|
};
|
|
3797
3863
|
},
|
|
3798
3864
|
checkout: async (params) => {
|
|
3865
|
+
if (params.phoneNumber) {
|
|
3866
|
+
const res = await this.orders.checkout({
|
|
3867
|
+
cartId: params.cartId,
|
|
3868
|
+
sessionId: params.sessionId,
|
|
3869
|
+
phoneNumber: params.phoneNumber,
|
|
3870
|
+
locationId: params.locationId,
|
|
3871
|
+
notes: params.notes
|
|
3872
|
+
});
|
|
3873
|
+
return res?.data || res;
|
|
3874
|
+
}
|
|
3799
3875
|
if (!params.customerId)
|
|
3800
3876
|
throw new Error("customerId is required for server checkout.");
|
|
3801
3877
|
const items = await this.cart.getItems({
|
|
@@ -3914,11 +3990,29 @@ var ScrymeServerSDK = class {
|
|
|
3914
3990
|
list: async () => {
|
|
3915
3991
|
return this.catalog.getBookings();
|
|
3916
3992
|
},
|
|
3993
|
+
updateStatus: async (id, status) => {
|
|
3994
|
+
return this.catalog.updateBookingStatus(id, status);
|
|
3995
|
+
},
|
|
3917
3996
|
cancel: async (id) => {
|
|
3918
3997
|
return this.catalog.updateBookingStatus(id, "CANCELLED");
|
|
3919
3998
|
},
|
|
3999
|
+
cancelSeries: async (recurrenceId) => {
|
|
4000
|
+
return this.api.servicesCancelBookingSeries(config.orgSlug, recurrenceId);
|
|
4001
|
+
},
|
|
3920
4002
|
complete: async (id, dto) => {
|
|
3921
4003
|
return this.catalog.completeBooking(id, dto);
|
|
4004
|
+
},
|
|
4005
|
+
getAvailability: async (serviceId, date) => {
|
|
4006
|
+
return this.api.publicServicesGetAvailability(config.orgSlug, serviceId, date ? { date } : void 0);
|
|
4007
|
+
},
|
|
4008
|
+
requestOtp: async (dto) => {
|
|
4009
|
+
return this.api.publicServicesRequestOtp(config.orgSlug, dto);
|
|
4010
|
+
},
|
|
4011
|
+
verifyOtp: async (dto) => {
|
|
4012
|
+
return this.api.publicServicesVerifyOtp(config.orgSlug, dto);
|
|
4013
|
+
},
|
|
4014
|
+
createPublicBooking: async (dto) => {
|
|
4015
|
+
return this.api.publicServicesCreatePublicBooking(config.orgSlug, dto);
|
|
3922
4016
|
}
|
|
3923
4017
|
};
|
|
3924
4018
|
const baseAuth = buildModule(this.api, config.orgSlug, authMapping);
|
|
@@ -4006,6 +4100,7 @@ export {
|
|
|
4006
4100
|
authMapping,
|
|
4007
4101
|
inventoryMapping,
|
|
4008
4102
|
ordersMapping,
|
|
4103
|
+
webhooksMapping,
|
|
4009
4104
|
crmMapping,
|
|
4010
4105
|
posMapping,
|
|
4011
4106
|
accountingMapping,
|
package/dist/client.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
2
|
-
import {
|
|
2
|
+
import { aj as CustomerResponseDto, G as ProductResponseDto, K as ServiceCatalogResponseDto, cT as CartItemDto, bc as CartResponseDto, dV as CustomerSessionDto, d0 as CatalogModule, eA as InventoryModule, fs as OrdersModule, cO as CRMModule, fA as POSModule, bU as AccountingModule, f0 as LoyaltyModule, fl as MembersModule, cm as AdminModule, i7 as WebhooksModule, bb as CartControllerGetCartParams, be as AddToCartDto, bf as RemoveFromCartDto, bd as CartControllerClearCartParams, an as UpdateCustomerDto, ao as AddressDto, ak as RegisterCustomerDto, dT as CustomerAuthResponseDto, a5 as CreateBookingDto, gy as ServiceBookingItemDto, h2 as ServicesUpdateBookingStatusBodyStatus, a7 as CompleteBookingDto, af as RequestOtpDto, ag as VerifyOtpDto, ah as PublicBookingDto, cz as AuthModule, s as AuthExchangeToken201 } from './base-B5jgRLyM.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Defines a storage contract for persisting authentication tokens and session data.
|
|
@@ -130,6 +130,8 @@ declare class ScrymeClientSDK<TProduct = ProductResponseDto, TService = ServiceC
|
|
|
130
130
|
members: MembersModule;
|
|
131
131
|
/** Global setup parameters, organization definitions, audit trails, and tier limit submodule. */
|
|
132
132
|
admin: AdminModule;
|
|
133
|
+
/** Webhook registration, management, listing, and deletion submodule. */
|
|
134
|
+
webhooks: WebhooksModule;
|
|
133
135
|
/**
|
|
134
136
|
* Stateful Shopping Cart Submodule.
|
|
135
137
|
* Leverages internal tracking and smart delta calculations for optimized storefront shopping.
|
|
@@ -195,17 +197,19 @@ declare class ScrymeClientSDK<TProduct = ProductResponseDto, TService = ServiceC
|
|
|
195
197
|
*/
|
|
196
198
|
mergeGuestCart<T = TCartResponse>(guestSessionId: string, customerId: string): Promise<AxiosResponse<T & Record<string, any>>>;
|
|
197
199
|
/**
|
|
198
|
-
* Finalizes the shopping cart, creating a physical Sales Order
|
|
199
|
-
* Automatically resolves and appends the customer ID from the active customer session.
|
|
200
|
+
* Finalizes the shopping cart, creating a physical Sales Order or executing STK Push checkout.
|
|
201
|
+
* Automatically resolves and appends the customer ID from the active customer session if phoneNumber is omitted.
|
|
200
202
|
* Clears the shopping cart state upon successful transaction creation.
|
|
201
|
-
* @param params Checkout configurations including locationId, channel, and custom notes.
|
|
202
|
-
* @returns Promise resolving to the created order response.
|
|
203
|
+
* @param params Checkout configurations including locationId, phoneNumber, cartId, channel, and custom notes.
|
|
204
|
+
* @returns Promise resolving to the created order or payment response.
|
|
203
205
|
*/
|
|
204
206
|
checkout(params: {
|
|
205
207
|
locationId: string;
|
|
208
|
+
phoneNumber?: string;
|
|
209
|
+
cartId?: string;
|
|
206
210
|
notes?: string;
|
|
207
211
|
channel?: string;
|
|
208
|
-
}): Promise<
|
|
212
|
+
}): Promise<any>;
|
|
209
213
|
};
|
|
210
214
|
/**
|
|
211
215
|
* Storefront Customer Profile Submodule.
|
|
@@ -327,6 +331,7 @@ declare class ScrymeClientSDK<TProduct = ProductResponseDto, TService = ServiceC
|
|
|
327
331
|
};
|
|
328
332
|
/**
|
|
329
333
|
* Service Bookings & Appointments Submodule.
|
|
334
|
+
* Provides comprehensive booking management, appointment scheduling, cancellations, public OTP flows, and completion orchestration.
|
|
330
335
|
*/
|
|
331
336
|
bookings: {
|
|
332
337
|
/**
|
|
@@ -347,12 +352,57 @@ declare class ScrymeClientSDK<TProduct = ProductResponseDto, TService = ServiceC
|
|
|
347
352
|
* @returns Promise containing the list of service booking records.
|
|
348
353
|
*/
|
|
349
354
|
list(): Promise<AxiosResponse<ServiceBookingItemDto[]>>;
|
|
355
|
+
/**
|
|
356
|
+
* Updates the status of an existing booking appointment.
|
|
357
|
+
* @param id Service booking ID.
|
|
358
|
+
* @param status Target status enum value (e.g. CONFIRMED, CANCELLED, IN_PROGRESS).
|
|
359
|
+
* @returns Promise containing the status update response.
|
|
360
|
+
*/
|
|
361
|
+
updateStatus(id: string, status: ServicesUpdateBookingStatusBodyStatus | string): Promise<AxiosResponse<void>>;
|
|
350
362
|
/**
|
|
351
363
|
* Cancels an existing service booking appointment.
|
|
352
364
|
* @param id Service booking ID to cancel.
|
|
353
365
|
* @returns Promise containing the cancellation response.
|
|
354
366
|
*/
|
|
355
367
|
cancel(id: string): Promise<AxiosResponse<void>>;
|
|
368
|
+
/**
|
|
369
|
+
* Cancels an entire recurring booking series by its recurrence ID.
|
|
370
|
+
* @param recurrenceId Recurrence series identifier.
|
|
371
|
+
* @returns Promise containing the series cancellation response.
|
|
372
|
+
*/
|
|
373
|
+
cancelSeries(recurrenceId: string): Promise<AxiosResponse<void>>;
|
|
374
|
+
/**
|
|
375
|
+
* Completes a booking appointment, recording actual duration and deducting consumed material stock.
|
|
376
|
+
* @param id Service booking ID.
|
|
377
|
+
* @param dto Completion details including actual start/end times and consumed materials.
|
|
378
|
+
* @returns Promise containing the completion response.
|
|
379
|
+
*/
|
|
380
|
+
complete(id: string, dto: CompleteBookingDto & Record<string, any>): Promise<AxiosResponse<void>>;
|
|
381
|
+
/**
|
|
382
|
+
* Calculates and retrieves available booking slot times for a service on a given target date.
|
|
383
|
+
* @param serviceId Service identifier.
|
|
384
|
+
* @param date Target date string in YYYY-MM-DD format (optional).
|
|
385
|
+
* @returns Promise containing the available booking slots.
|
|
386
|
+
*/
|
|
387
|
+
getAvailability(serviceId: string, date?: string): Promise<AxiosResponse<any>>;
|
|
388
|
+
/**
|
|
389
|
+
* Requests a secure One-Time Password (OTP) code via email or SMS for public guest bookings.
|
|
390
|
+
* @param dto Contact parameters specifying email or phone number.
|
|
391
|
+
* @returns Promise containing the OTP request response.
|
|
392
|
+
*/
|
|
393
|
+
requestOtp(dto: RequestOtpDto): Promise<AxiosResponse<any>>;
|
|
394
|
+
/**
|
|
395
|
+
* Verifies an OTP code submitted by a customer for public booking flows.
|
|
396
|
+
* @param dto Code and contact details.
|
|
397
|
+
* @returns Promise containing the verification response with verificationId.
|
|
398
|
+
*/
|
|
399
|
+
verifyOtp(dto: VerifyOtpDto): Promise<AxiosResponse<any>>;
|
|
400
|
+
/**
|
|
401
|
+
* Creates a public booking without requiring full customer authentication using a valid verification ID.
|
|
402
|
+
* @param dto Public booking payload including serviceId, verificationId, and scheduled time.
|
|
403
|
+
* @returns Promise containing the public booking response.
|
|
404
|
+
*/
|
|
405
|
+
createPublicBooking(dto: PublicBookingDto): Promise<AxiosResponse<any>>;
|
|
356
406
|
};
|
|
357
407
|
/**
|
|
358
408
|
* Authentication & Customer Session Submodule.
|
package/dist/client.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
2
|
-
import {
|
|
2
|
+
import { aj as CustomerResponseDto, G as ProductResponseDto, K as ServiceCatalogResponseDto, cT as CartItemDto, bc as CartResponseDto, dV as CustomerSessionDto, d0 as CatalogModule, eA as InventoryModule, fs as OrdersModule, cO as CRMModule, fA as POSModule, bU as AccountingModule, f0 as LoyaltyModule, fl as MembersModule, cm as AdminModule, i7 as WebhooksModule, bb as CartControllerGetCartParams, be as AddToCartDto, bf as RemoveFromCartDto, bd as CartControllerClearCartParams, an as UpdateCustomerDto, ao as AddressDto, ak as RegisterCustomerDto, dT as CustomerAuthResponseDto, a5 as CreateBookingDto, gy as ServiceBookingItemDto, h2 as ServicesUpdateBookingStatusBodyStatus, a7 as CompleteBookingDto, af as RequestOtpDto, ag as VerifyOtpDto, ah as PublicBookingDto, cz as AuthModule, s as AuthExchangeToken201 } from './base-B5jgRLyM.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Defines a storage contract for persisting authentication tokens and session data.
|
|
@@ -130,6 +130,8 @@ declare class ScrymeClientSDK<TProduct = ProductResponseDto, TService = ServiceC
|
|
|
130
130
|
members: MembersModule;
|
|
131
131
|
/** Global setup parameters, organization definitions, audit trails, and tier limit submodule. */
|
|
132
132
|
admin: AdminModule;
|
|
133
|
+
/** Webhook registration, management, listing, and deletion submodule. */
|
|
134
|
+
webhooks: WebhooksModule;
|
|
133
135
|
/**
|
|
134
136
|
* Stateful Shopping Cart Submodule.
|
|
135
137
|
* Leverages internal tracking and smart delta calculations for optimized storefront shopping.
|
|
@@ -195,17 +197,19 @@ declare class ScrymeClientSDK<TProduct = ProductResponseDto, TService = ServiceC
|
|
|
195
197
|
*/
|
|
196
198
|
mergeGuestCart<T = TCartResponse>(guestSessionId: string, customerId: string): Promise<AxiosResponse<T & Record<string, any>>>;
|
|
197
199
|
/**
|
|
198
|
-
* Finalizes the shopping cart, creating a physical Sales Order
|
|
199
|
-
* Automatically resolves and appends the customer ID from the active customer session.
|
|
200
|
+
* Finalizes the shopping cart, creating a physical Sales Order or executing STK Push checkout.
|
|
201
|
+
* Automatically resolves and appends the customer ID from the active customer session if phoneNumber is omitted.
|
|
200
202
|
* Clears the shopping cart state upon successful transaction creation.
|
|
201
|
-
* @param params Checkout configurations including locationId, channel, and custom notes.
|
|
202
|
-
* @returns Promise resolving to the created order response.
|
|
203
|
+
* @param params Checkout configurations including locationId, phoneNumber, cartId, channel, and custom notes.
|
|
204
|
+
* @returns Promise resolving to the created order or payment response.
|
|
203
205
|
*/
|
|
204
206
|
checkout(params: {
|
|
205
207
|
locationId: string;
|
|
208
|
+
phoneNumber?: string;
|
|
209
|
+
cartId?: string;
|
|
206
210
|
notes?: string;
|
|
207
211
|
channel?: string;
|
|
208
|
-
}): Promise<
|
|
212
|
+
}): Promise<any>;
|
|
209
213
|
};
|
|
210
214
|
/**
|
|
211
215
|
* Storefront Customer Profile Submodule.
|
|
@@ -327,6 +331,7 @@ declare class ScrymeClientSDK<TProduct = ProductResponseDto, TService = ServiceC
|
|
|
327
331
|
};
|
|
328
332
|
/**
|
|
329
333
|
* Service Bookings & Appointments Submodule.
|
|
334
|
+
* Provides comprehensive booking management, appointment scheduling, cancellations, public OTP flows, and completion orchestration.
|
|
330
335
|
*/
|
|
331
336
|
bookings: {
|
|
332
337
|
/**
|
|
@@ -347,12 +352,57 @@ declare class ScrymeClientSDK<TProduct = ProductResponseDto, TService = ServiceC
|
|
|
347
352
|
* @returns Promise containing the list of service booking records.
|
|
348
353
|
*/
|
|
349
354
|
list(): Promise<AxiosResponse<ServiceBookingItemDto[]>>;
|
|
355
|
+
/**
|
|
356
|
+
* Updates the status of an existing booking appointment.
|
|
357
|
+
* @param id Service booking ID.
|
|
358
|
+
* @param status Target status enum value (e.g. CONFIRMED, CANCELLED, IN_PROGRESS).
|
|
359
|
+
* @returns Promise containing the status update response.
|
|
360
|
+
*/
|
|
361
|
+
updateStatus(id: string, status: ServicesUpdateBookingStatusBodyStatus | string): Promise<AxiosResponse<void>>;
|
|
350
362
|
/**
|
|
351
363
|
* Cancels an existing service booking appointment.
|
|
352
364
|
* @param id Service booking ID to cancel.
|
|
353
365
|
* @returns Promise containing the cancellation response.
|
|
354
366
|
*/
|
|
355
367
|
cancel(id: string): Promise<AxiosResponse<void>>;
|
|
368
|
+
/**
|
|
369
|
+
* Cancels an entire recurring booking series by its recurrence ID.
|
|
370
|
+
* @param recurrenceId Recurrence series identifier.
|
|
371
|
+
* @returns Promise containing the series cancellation response.
|
|
372
|
+
*/
|
|
373
|
+
cancelSeries(recurrenceId: string): Promise<AxiosResponse<void>>;
|
|
374
|
+
/**
|
|
375
|
+
* Completes a booking appointment, recording actual duration and deducting consumed material stock.
|
|
376
|
+
* @param id Service booking ID.
|
|
377
|
+
* @param dto Completion details including actual start/end times and consumed materials.
|
|
378
|
+
* @returns Promise containing the completion response.
|
|
379
|
+
*/
|
|
380
|
+
complete(id: string, dto: CompleteBookingDto & Record<string, any>): Promise<AxiosResponse<void>>;
|
|
381
|
+
/**
|
|
382
|
+
* Calculates and retrieves available booking slot times for a service on a given target date.
|
|
383
|
+
* @param serviceId Service identifier.
|
|
384
|
+
* @param date Target date string in YYYY-MM-DD format (optional).
|
|
385
|
+
* @returns Promise containing the available booking slots.
|
|
386
|
+
*/
|
|
387
|
+
getAvailability(serviceId: string, date?: string): Promise<AxiosResponse<any>>;
|
|
388
|
+
/**
|
|
389
|
+
* Requests a secure One-Time Password (OTP) code via email or SMS for public guest bookings.
|
|
390
|
+
* @param dto Contact parameters specifying email or phone number.
|
|
391
|
+
* @returns Promise containing the OTP request response.
|
|
392
|
+
*/
|
|
393
|
+
requestOtp(dto: RequestOtpDto): Promise<AxiosResponse<any>>;
|
|
394
|
+
/**
|
|
395
|
+
* Verifies an OTP code submitted by a customer for public booking flows.
|
|
396
|
+
* @param dto Code and contact details.
|
|
397
|
+
* @returns Promise containing the verification response with verificationId.
|
|
398
|
+
*/
|
|
399
|
+
verifyOtp(dto: VerifyOtpDto): Promise<AxiosResponse<any>>;
|
|
400
|
+
/**
|
|
401
|
+
* Creates a public booking without requiring full customer authentication using a valid verification ID.
|
|
402
|
+
* @param dto Public booking payload including serviceId, verificationId, and scheduled time.
|
|
403
|
+
* @returns Promise containing the public booking response.
|
|
404
|
+
*/
|
|
405
|
+
createPublicBooking(dto: PublicBookingDto): Promise<AxiosResponse<any>>;
|
|
356
406
|
};
|
|
357
407
|
/**
|
|
358
408
|
* Authentication & Customer Session Submodule.
|
package/dist/client.js
CHANGED
|
@@ -786,6 +786,15 @@ var getScrymeV3API = (axiosInstance = import_axios.default) => {
|
|
|
786
786
|
options
|
|
787
787
|
);
|
|
788
788
|
};
|
|
789
|
+
const servicesGetAvailability = (orgSlug, id, params, options) => {
|
|
790
|
+
return axiosInstance.get(
|
|
791
|
+
`/v3/${orgSlug}/services/${id}/availability`,
|
|
792
|
+
{
|
|
793
|
+
...options,
|
|
794
|
+
params: { ...params, ...options?.params }
|
|
795
|
+
}
|
|
796
|
+
);
|
|
797
|
+
};
|
|
789
798
|
const servicesDeleteService = (orgSlug, id, options) => {
|
|
790
799
|
return axiosInstance.post(
|
|
791
800
|
`/v3/${orgSlug}/services/${id}/delete`,
|
|
@@ -853,6 +862,13 @@ var getScrymeV3API = (axiosInstance = import_axios.default) => {
|
|
|
853
862
|
options
|
|
854
863
|
);
|
|
855
864
|
};
|
|
865
|
+
const servicesCancelBookingSeries = (orgSlug, recurrenceId, options) => {
|
|
866
|
+
return axiosInstance.post(
|
|
867
|
+
`/v3/${orgSlug}/services/bookings/recurrence/${recurrenceId}/cancel`,
|
|
868
|
+
void 0,
|
|
869
|
+
options
|
|
870
|
+
);
|
|
871
|
+
};
|
|
856
872
|
const servicesCreateShift = (orgSlug, memberId, servicesCreateShiftBody, options) => {
|
|
857
873
|
return axiosInstance.post(
|
|
858
874
|
`/v3/${orgSlug}/services/staff/${memberId}/shifts`,
|
|
@@ -1930,7 +1946,14 @@ var getScrymeV3API = (axiosInstance = import_axios.default) => {
|
|
|
1930
1946
|
}
|
|
1931
1947
|
);
|
|
1932
1948
|
};
|
|
1933
|
-
|
|
1949
|
+
const paymentsCheckout = (orgSlug, checkoutDto, options) => {
|
|
1950
|
+
return axiosInstance.post(
|
|
1951
|
+
`/v3/${orgSlug}/payments/checkout`,
|
|
1952
|
+
checkoutDto,
|
|
1953
|
+
options
|
|
1954
|
+
);
|
|
1955
|
+
};
|
|
1956
|
+
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, catalogGetProduct, catalogGetServices, catalogUpdateProduct, catalogUpdateSupplierVariant, catalogGetPriceChangeRequests, catalogReviewPriceChangeRequest, catalogCreateReview, catalogUpdateReview, catalogDeleteReview, servicesCreateCategory, servicesGetCategories, servicesUpdateCategory, servicesDeleteCategory, servicesCreateService, servicesGetServices, servicesGetCurrentMemberShifts, servicesGetShifts, servicesGetService, servicesUpdateService, servicesGetAvailability, servicesDeleteService, servicesCreateResource, servicesGetResources, servicesUpdateResource, servicesDeleteResource, servicesCreateBooking, servicesGetBookings, servicesGetBooking, servicesUpdateBookingStatus, servicesCompleteBooking, servicesCancelBookingSeries, servicesCreateShift, servicesGetStaffShifts, servicesAddBreak, servicesRegisterCustomerApp, servicesGetUtilization, servicesGetPerformance, servicesGetFunnel, publicServicesListServices, publicServicesGetCategories, publicServicesGetService, publicServicesGetAvailability, publicServicesRequestOtp, publicServicesVerifyOtp, publicServicesCreatePublicBooking, customersGetCustomers, customersRegister, customerRegister, customersLogin, customersRefreshSession, 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, paymentsCheckout };
|
|
1934
1957
|
};
|
|
1935
1958
|
|
|
1936
1959
|
// src/base.ts
|
|
@@ -1968,6 +1991,7 @@ var methodsWithOrgSlugSet = /* @__PURE__ */ new Set([
|
|
|
1968
1991
|
"webhooksCreate",
|
|
1969
1992
|
"webhooksList",
|
|
1970
1993
|
"webhooksDelete",
|
|
1994
|
+
"paymentsCheckout",
|
|
1971
1995
|
"catalogGetProducts",
|
|
1972
1996
|
"catalogGetProduct",
|
|
1973
1997
|
"catalogCreateProduct",
|
|
@@ -1997,8 +2021,10 @@ var methodsWithOrgSlugSet = /* @__PURE__ */ new Set([
|
|
|
1997
2021
|
"servicesCreateBooking",
|
|
1998
2022
|
"servicesGetBookings",
|
|
1999
2023
|
"servicesGetBooking",
|
|
2024
|
+
"servicesGetAvailability",
|
|
2000
2025
|
"servicesUpdateBookingStatus",
|
|
2001
2026
|
"servicesCompleteBooking",
|
|
2027
|
+
"servicesCancelBookingSeries",
|
|
2002
2028
|
"servicesCreateShift",
|
|
2003
2029
|
"servicesGetStaffShifts",
|
|
2004
2030
|
"servicesAddBreak",
|
|
@@ -2184,8 +2210,14 @@ var ordersMapping = {
|
|
|
2184
2210
|
clearCart: "cartControllerClearCart",
|
|
2185
2211
|
addToCart: "cartControllerAddToCart",
|
|
2186
2212
|
removeFromCart: "cartControllerRemoveFromCart",
|
|
2213
|
+
checkout: "paymentsCheckout",
|
|
2187
2214
|
handleStkCallback: "paymentsControllerHandleStkCallback"
|
|
2188
2215
|
};
|
|
2216
|
+
var webhooksMapping = {
|
|
2217
|
+
create: "webhooksCreate",
|
|
2218
|
+
list: "webhooksList",
|
|
2219
|
+
delete: "webhooksDelete"
|
|
2220
|
+
};
|
|
2189
2221
|
var crmMapping = {
|
|
2190
2222
|
createRecord: "crmControllerCreateRecord",
|
|
2191
2223
|
getRecord: "crmControllerGetRecord",
|
|
@@ -2343,8 +2375,10 @@ var servicesMapping = {
|
|
|
2343
2375
|
createBookingAdmin: "servicesCreateBooking",
|
|
2344
2376
|
getBookings: "servicesGetBookings",
|
|
2345
2377
|
getBookingAdmin: "servicesGetBooking",
|
|
2378
|
+
getAvailabilityAdmin: "servicesGetAvailability",
|
|
2346
2379
|
updateBookingStatus: "servicesUpdateBookingStatus",
|
|
2347
2380
|
completeBooking: "servicesCompleteBooking",
|
|
2381
|
+
cancelBookingSeries: "servicesCancelBookingSeries",
|
|
2348
2382
|
createShift: "servicesCreateShift",
|
|
2349
2383
|
getStaffShifts: "servicesGetStaffShifts",
|
|
2350
2384
|
addBreak: "servicesAddBreak",
|
|
@@ -2792,6 +2826,7 @@ var ScrymeClientSDK = class {
|
|
|
2792
2826
|
this.loyalty = buildModule(this.api, config.orgSlug, loyaltyMapping);
|
|
2793
2827
|
this.members = buildModule(this.api, config.orgSlug, membersMapping);
|
|
2794
2828
|
this.admin = buildModule(this.api, config.orgSlug, adminMapping);
|
|
2829
|
+
this.webhooks = buildModule(this.api, config.orgSlug, webhooksMapping);
|
|
2795
2830
|
this.cart = {
|
|
2796
2831
|
get: async (params) => {
|
|
2797
2832
|
return this.orders.getCart(params);
|
|
@@ -2897,6 +2932,15 @@ var ScrymeClientSDK = class {
|
|
|
2897
2932
|
return this.orders.getCart({ sessionId: guestSessionId });
|
|
2898
2933
|
},
|
|
2899
2934
|
checkout: async (params) => {
|
|
2935
|
+
if (params.phoneNumber) {
|
|
2936
|
+
const res = await this.orders.checkout({
|
|
2937
|
+
cartId: params.cartId,
|
|
2938
|
+
phoneNumber: params.phoneNumber,
|
|
2939
|
+
locationId: params.locationId,
|
|
2940
|
+
notes: params.notes
|
|
2941
|
+
});
|
|
2942
|
+
return res?.data || res;
|
|
2943
|
+
}
|
|
2900
2944
|
const session = await this.auth.getSession();
|
|
2901
2945
|
const user = session.user;
|
|
2902
2946
|
const customerId = user?.customerId || user?.id || user?.customer?.id;
|
|
@@ -3152,8 +3196,29 @@ var ScrymeClientSDK = class {
|
|
|
3152
3196
|
list: async () => {
|
|
3153
3197
|
return this.catalog.getBookings();
|
|
3154
3198
|
},
|
|
3199
|
+
updateStatus: async (id, status) => {
|
|
3200
|
+
return this.catalog.updateBookingStatus(id, status);
|
|
3201
|
+
},
|
|
3155
3202
|
cancel: async (id) => {
|
|
3156
3203
|
return this.catalog.updateBookingStatus(id, "CANCELLED");
|
|
3204
|
+
},
|
|
3205
|
+
cancelSeries: async (recurrenceId) => {
|
|
3206
|
+
return this.api.servicesCancelBookingSeries(config.orgSlug, recurrenceId);
|
|
3207
|
+
},
|
|
3208
|
+
complete: async (id, dto) => {
|
|
3209
|
+
return this.catalog.completeBooking(id, dto);
|
|
3210
|
+
},
|
|
3211
|
+
getAvailability: async (serviceId, date) => {
|
|
3212
|
+
return this.api.publicServicesGetAvailability(config.orgSlug, serviceId, date ? { date } : void 0);
|
|
3213
|
+
},
|
|
3214
|
+
requestOtp: async (dto) => {
|
|
3215
|
+
return this.api.publicServicesRequestOtp(config.orgSlug, dto);
|
|
3216
|
+
},
|
|
3217
|
+
verifyOtp: async (dto) => {
|
|
3218
|
+
return this.api.publicServicesVerifyOtp(config.orgSlug, dto);
|
|
3219
|
+
},
|
|
3220
|
+
createPublicBooking: async (dto) => {
|
|
3221
|
+
return this.api.publicServicesCreatePublicBooking(config.orgSlug, dto);
|
|
3157
3222
|
}
|
|
3158
3223
|
};
|
|
3159
3224
|
}
|