@scryme/sdk 9.67.0 → 9.68.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-1B2-e5i_.d.mts → base-CSVOv3Nr.d.mts} +187 -3
- package/dist/{base-1B2-e5i_.d.ts → base-CSVOv3Nr.d.ts} +187 -3
- package/dist/{chunk-QS5K7GIL.mjs → chunk-SYGBIPUK.mjs} +214 -3
- package/dist/client.d.mts +255 -3
- package/dist/client.d.ts +255 -3
- package/dist/client.js +202 -2
- package/dist/client.mjs +1 -1
- package/dist/index.d.mts +8 -4
- package/dist/index.d.ts +8 -4
- package/dist/index.js +214 -3
- package/dist/index.mjs +1 -1
- package/dist/server.d.mts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/server.js +50 -2
- package/dist/server.mjs +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -758,6 +758,29 @@ var getScrymeV3API = (axiosInstance = import_axios.default) => {
|
|
|
758
758
|
options
|
|
759
759
|
);
|
|
760
760
|
};
|
|
761
|
+
const catalogCreateReview = (orgSlug, productId, createProductReviewDto, options) => {
|
|
762
|
+
return axiosInstance.post(
|
|
763
|
+
`/v3/${orgSlug}/catalog/products/${productId}/reviews`,
|
|
764
|
+
createProductReviewDto,
|
|
765
|
+
options
|
|
766
|
+
);
|
|
767
|
+
};
|
|
768
|
+
const catalogUpdateReview = (orgSlug, reviewId, updateProductReviewDto, options) => {
|
|
769
|
+
return axiosInstance.patch(
|
|
770
|
+
`/v3/${orgSlug}/catalog/reviews/${reviewId}`,
|
|
771
|
+
updateProductReviewDto,
|
|
772
|
+
options
|
|
773
|
+
);
|
|
774
|
+
};
|
|
775
|
+
const catalogDeleteReview = (orgSlug, reviewId, params, options) => {
|
|
776
|
+
return axiosInstance.delete(
|
|
777
|
+
`/v3/${orgSlug}/catalog/reviews/${reviewId}`,
|
|
778
|
+
{
|
|
779
|
+
...options,
|
|
780
|
+
params: { ...params, ...options?.params }
|
|
781
|
+
}
|
|
782
|
+
);
|
|
783
|
+
};
|
|
761
784
|
const servicesCreateCategory = (orgSlug, createServiceCategoryDto, options) => {
|
|
762
785
|
return axiosInstance.post(
|
|
763
786
|
`/v3/${orgSlug}/services/categories`,
|
|
@@ -1011,6 +1034,13 @@ var getScrymeV3API = (axiosInstance = import_axios.default) => {
|
|
|
1011
1034
|
options
|
|
1012
1035
|
);
|
|
1013
1036
|
};
|
|
1037
|
+
const customerRegister = (orgSlug, registerCustomerDto, options) => {
|
|
1038
|
+
return axiosInstance.post(
|
|
1039
|
+
`/v3/${orgSlug}/customers/../customer/register`,
|
|
1040
|
+
registerCustomerDto,
|
|
1041
|
+
options
|
|
1042
|
+
);
|
|
1043
|
+
};
|
|
1014
1044
|
const customersLogin = (orgSlug, customerLoginDto, options) => {
|
|
1015
1045
|
return axiosInstance.post(
|
|
1016
1046
|
`/v3/${orgSlug}/customers/auth/login`,
|
|
@@ -1963,7 +1993,7 @@ var getScrymeV3API = (axiosInstance = import_axios.default) => {
|
|
|
1963
1993
|
}
|
|
1964
1994
|
);
|
|
1965
1995
|
};
|
|
1966
|
-
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, 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, customersGetCustomers, customersRegister, 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 };
|
|
1996
|
+
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, servicesDeleteService, servicesCreateResource, servicesGetResources, servicesUpdateResource, servicesDeleteResource, servicesCreateBooking, servicesGetBookings, servicesGetBooking, servicesUpdateBookingStatus, servicesCompleteBooking, 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 };
|
|
1967
1997
|
};
|
|
1968
1998
|
|
|
1969
1999
|
// src/generated/model/addDepartmentMemberDtoRole.ts
|
|
@@ -2420,6 +2450,9 @@ var methodsWithOrgSlugSet = /* @__PURE__ */ new Set([
|
|
|
2420
2450
|
"catalogUpdateSupplierVariant",
|
|
2421
2451
|
"catalogGetPriceChangeRequests",
|
|
2422
2452
|
"catalogReviewPriceChangeRequest",
|
|
2453
|
+
"catalogCreateReview",
|
|
2454
|
+
"catalogUpdateReview",
|
|
2455
|
+
"catalogDeleteReview",
|
|
2423
2456
|
"servicesCreateCategory",
|
|
2424
2457
|
"servicesGetCategories",
|
|
2425
2458
|
"servicesUpdateCategory",
|
|
@@ -2534,6 +2567,9 @@ var catalogMapping = {
|
|
|
2534
2567
|
updateSupplierVariant: "catalogUpdateSupplierVariant",
|
|
2535
2568
|
getPriceChangeRequests: "catalogGetPriceChangeRequests",
|
|
2536
2569
|
reviewPriceChangeRequest: "catalogReviewPriceChangeRequest",
|
|
2570
|
+
createReview: "catalogCreateReview",
|
|
2571
|
+
updateReview: "catalogUpdateReview",
|
|
2572
|
+
deleteReview: "catalogDeleteReview",
|
|
2537
2573
|
createServiceCategory: "servicesCreateCategory",
|
|
2538
2574
|
getServiceCategories: "servicesGetCategories",
|
|
2539
2575
|
updateServiceCategory: "servicesUpdateCategory",
|
|
@@ -2878,6 +2914,7 @@ function getJwtExpiry(token) {
|
|
|
2878
2914
|
}
|
|
2879
2915
|
|
|
2880
2916
|
// src/client.tsx
|
|
2917
|
+
var import_react = require("react");
|
|
2881
2918
|
var import_axios2 = __toESM(require("axios"));
|
|
2882
2919
|
var InMemoryStorage = class {
|
|
2883
2920
|
constructor() {
|
|
@@ -3119,6 +3156,39 @@ var ScrymeClientSDK = class {
|
|
|
3119
3156
|
...response,
|
|
3120
3157
|
data: service
|
|
3121
3158
|
};
|
|
3159
|
+
},
|
|
3160
|
+
createReview: async (productId, dto, options) => {
|
|
3161
|
+
if (!dto.customerId) {
|
|
3162
|
+
const session = await this.auth.getSession();
|
|
3163
|
+
const user = session?.user;
|
|
3164
|
+
const customerId = user?.customerId || user?.id || user?.customer?.id;
|
|
3165
|
+
if (customerId) {
|
|
3166
|
+
dto = { ...dto, customerId };
|
|
3167
|
+
}
|
|
3168
|
+
}
|
|
3169
|
+
return baseCatalog.createReview(productId, dto, options);
|
|
3170
|
+
},
|
|
3171
|
+
updateReview: async (reviewId, dto, options) => {
|
|
3172
|
+
if (!dto.customerId) {
|
|
3173
|
+
const session = await this.auth.getSession();
|
|
3174
|
+
const user = session?.user;
|
|
3175
|
+
const customerId = user?.customerId || user?.id || user?.customer?.id;
|
|
3176
|
+
if (customerId) {
|
|
3177
|
+
dto = { ...dto, customerId };
|
|
3178
|
+
}
|
|
3179
|
+
}
|
|
3180
|
+
return baseCatalog.updateReview(reviewId, dto, options);
|
|
3181
|
+
},
|
|
3182
|
+
deleteReview: async (reviewId, params, options) => {
|
|
3183
|
+
if (!params || !params.customerId) {
|
|
3184
|
+
const session = await this.auth.getSession();
|
|
3185
|
+
const user = session?.user;
|
|
3186
|
+
const customerId = user?.customerId || user?.id || user?.customer?.id;
|
|
3187
|
+
if (customerId) {
|
|
3188
|
+
params = { ...params, customerId };
|
|
3189
|
+
}
|
|
3190
|
+
}
|
|
3191
|
+
return baseCatalog.deleteReview(reviewId, params, options);
|
|
3122
3192
|
}
|
|
3123
3193
|
};
|
|
3124
3194
|
this.inventory = buildModule(this.api, config.orgSlug, inventoryMapping);
|
|
@@ -3134,15 +3204,42 @@ var ScrymeClientSDK = class {
|
|
|
3134
3204
|
return this.orders.getCart(params);
|
|
3135
3205
|
},
|
|
3136
3206
|
add: async (dto) => {
|
|
3207
|
+
if (!dto.customerId) {
|
|
3208
|
+
const session = await this.auth.getSession();
|
|
3209
|
+
const user = session?.user;
|
|
3210
|
+
const customerId = user?.customerId || user?.id || user?.customer?.id;
|
|
3211
|
+
if (!customerId) {
|
|
3212
|
+
throw new Error("Unauthorized: customerId is required.");
|
|
3213
|
+
}
|
|
3214
|
+
dto = { ...dto, customerId };
|
|
3215
|
+
}
|
|
3137
3216
|
return this.orders.addToCart(dto);
|
|
3138
3217
|
},
|
|
3139
3218
|
remove: async (dto) => {
|
|
3219
|
+
if (!dto.customerId) {
|
|
3220
|
+
const session = await this.auth.getSession();
|
|
3221
|
+
const user = session?.user;
|
|
3222
|
+
const customerId = user?.customerId || user?.id || user?.customer?.id;
|
|
3223
|
+
if (!customerId) {
|
|
3224
|
+
throw new Error("Unauthorized: customerId is required.");
|
|
3225
|
+
}
|
|
3226
|
+
dto = { ...dto, customerId };
|
|
3227
|
+
}
|
|
3140
3228
|
return this.orders.removeFromCart(dto);
|
|
3141
3229
|
},
|
|
3142
3230
|
clear: async (params) => {
|
|
3143
3231
|
return this.orders.clearCart(params);
|
|
3144
3232
|
},
|
|
3145
3233
|
update: async (dto) => {
|
|
3234
|
+
if (!dto.customerId) {
|
|
3235
|
+
const session = await this.auth.getSession();
|
|
3236
|
+
const user = session?.user;
|
|
3237
|
+
const customerId = user?.customerId || user?.id || user?.customer?.id;
|
|
3238
|
+
if (!customerId) {
|
|
3239
|
+
throw new Error("Unauthorized: customerId is required.");
|
|
3240
|
+
}
|
|
3241
|
+
dto = { ...dto, customerId };
|
|
3242
|
+
}
|
|
3146
3243
|
const response = await this.orders.getCart({
|
|
3147
3244
|
sessionId: dto.sessionId || ""
|
|
3148
3245
|
});
|
|
@@ -3233,8 +3330,42 @@ var ScrymeClientSDK = class {
|
|
|
3233
3330
|
}
|
|
3234
3331
|
};
|
|
3235
3332
|
const customerAuth = {
|
|
3333
|
+
get session() {
|
|
3334
|
+
if (!state.token) {
|
|
3335
|
+
return {
|
|
3336
|
+
data: null,
|
|
3337
|
+
isPending: false,
|
|
3338
|
+
error: null
|
|
3339
|
+
};
|
|
3340
|
+
}
|
|
3341
|
+
const userId = state.user?.id || state.user?.userId || state.user?.customerId || "";
|
|
3342
|
+
return {
|
|
3343
|
+
data: {
|
|
3344
|
+
session: {
|
|
3345
|
+
id: userId || state.token,
|
|
3346
|
+
userId,
|
|
3347
|
+
expiresAt: state.expiresAt ? new Date(state.expiresAt) : null,
|
|
3348
|
+
token: state.token
|
|
3349
|
+
},
|
|
3350
|
+
user: state.user
|
|
3351
|
+
},
|
|
3352
|
+
isPending: false,
|
|
3353
|
+
error: null
|
|
3354
|
+
};
|
|
3355
|
+
},
|
|
3236
3356
|
signUp: async (dto) => {
|
|
3237
|
-
|
|
3357
|
+
const res = await this.api.customersRegister(config.orgSlug, dto);
|
|
3358
|
+
if (dto.password) {
|
|
3359
|
+
try {
|
|
3360
|
+
await customerAuth.signIn({
|
|
3361
|
+
email: dto.email,
|
|
3362
|
+
password: dto.password
|
|
3363
|
+
});
|
|
3364
|
+
} catch (e) {
|
|
3365
|
+
console.error("Auto sign-in after sign-up failed:", e);
|
|
3366
|
+
}
|
|
3367
|
+
}
|
|
3368
|
+
return res;
|
|
3238
3369
|
},
|
|
3239
3370
|
signIn: async (credentials) => {
|
|
3240
3371
|
const res = await this.api.customersLogin(config.orgSlug, credentials);
|
|
@@ -3312,6 +3443,60 @@ var ScrymeClientSDK = class {
|
|
|
3312
3443
|
notify("SIGNED_IN");
|
|
3313
3444
|
}
|
|
3314
3445
|
return authData;
|
|
3446
|
+
},
|
|
3447
|
+
useSession: () => {
|
|
3448
|
+
const currentSession = customerAuth.session;
|
|
3449
|
+
const [data, setData] = (0, import_react.useState)(currentSession.data);
|
|
3450
|
+
const [isPending, setIsPending] = (0, import_react.useState)(false);
|
|
3451
|
+
const [error, setError] = (0, import_react.useState)(null);
|
|
3452
|
+
const fetchSessionSync = () => {
|
|
3453
|
+
const s = customerAuth.session;
|
|
3454
|
+
setData(s.data);
|
|
3455
|
+
setError(s.error);
|
|
3456
|
+
setIsPending(s.isPending);
|
|
3457
|
+
};
|
|
3458
|
+
const fetchSessionAsync = async () => {
|
|
3459
|
+
setIsPending(true);
|
|
3460
|
+
try {
|
|
3461
|
+
const res = await customerAuth.getCurrentSession();
|
|
3462
|
+
if (res && (res.session || res.customer || res.user)) {
|
|
3463
|
+
setData({
|
|
3464
|
+
session: res.session,
|
|
3465
|
+
user: res.customer || res.user
|
|
3466
|
+
});
|
|
3467
|
+
} else {
|
|
3468
|
+
const sessionState = await customerAuth.getSession();
|
|
3469
|
+
setData({
|
|
3470
|
+
session: {
|
|
3471
|
+
id: sessionState.user?.id || sessionState.user?.userId || sessionState.user?.customerId || sessionState.token,
|
|
3472
|
+
userId: sessionState.user?.id || sessionState.user?.userId || sessionState.user?.customerId || "",
|
|
3473
|
+
expiresAt: sessionState.expiresAt ? new Date(sessionState.expiresAt) : null,
|
|
3474
|
+
token: sessionState.token
|
|
3475
|
+
},
|
|
3476
|
+
user: sessionState.user
|
|
3477
|
+
});
|
|
3478
|
+
}
|
|
3479
|
+
setError(null);
|
|
3480
|
+
} catch (e) {
|
|
3481
|
+
setError(e instanceof Error ? e : new Error(String(e)));
|
|
3482
|
+
setData(null);
|
|
3483
|
+
} finally {
|
|
3484
|
+
setIsPending(false);
|
|
3485
|
+
}
|
|
3486
|
+
};
|
|
3487
|
+
(0, import_react.useEffect)(() => {
|
|
3488
|
+
fetchSessionSync();
|
|
3489
|
+
const { unsubscribe } = customerAuth.onAuthStateChange(() => {
|
|
3490
|
+
fetchSessionSync();
|
|
3491
|
+
});
|
|
3492
|
+
return () => unsubscribe();
|
|
3493
|
+
}, []);
|
|
3494
|
+
return {
|
|
3495
|
+
data,
|
|
3496
|
+
isPending,
|
|
3497
|
+
error,
|
|
3498
|
+
refetch: fetchSessionAsync
|
|
3499
|
+
};
|
|
3315
3500
|
}
|
|
3316
3501
|
};
|
|
3317
3502
|
this.customer = {
|
|
@@ -3347,10 +3532,25 @@ var ScrymeClientSDK = class {
|
|
|
3347
3532
|
...customerAuth,
|
|
3348
3533
|
authenticate: async () => {
|
|
3349
3534
|
return performExchange();
|
|
3535
|
+
},
|
|
3536
|
+
get session() {
|
|
3537
|
+
return customerAuth.session;
|
|
3538
|
+
},
|
|
3539
|
+
useSession() {
|
|
3540
|
+
return customerAuth.useSession();
|
|
3350
3541
|
}
|
|
3351
3542
|
};
|
|
3352
3543
|
this.bookings = {
|
|
3353
3544
|
create: async (dto) => {
|
|
3545
|
+
if (!dto.customerId) {
|
|
3546
|
+
const session = await this.auth.getSession();
|
|
3547
|
+
const user = session?.user;
|
|
3548
|
+
const customerId = user?.customerId || user?.id || user?.customer?.id;
|
|
3549
|
+
if (!customerId) {
|
|
3550
|
+
throw new Error("Unauthorized: customerId is required.");
|
|
3551
|
+
}
|
|
3552
|
+
dto = { ...dto, customerId };
|
|
3553
|
+
}
|
|
3354
3554
|
return this.catalog.createBooking(dto);
|
|
3355
3555
|
},
|
|
3356
3556
|
get: async (id) => {
|
|
@@ -3673,7 +3873,18 @@ var ScrymeServerSDK = class {
|
|
|
3673
3873
|
},
|
|
3674
3874
|
auth: {
|
|
3675
3875
|
signUp: async (dto) => {
|
|
3676
|
-
|
|
3876
|
+
const res = await this.api.customersRegister(config.orgSlug, dto);
|
|
3877
|
+
if (dto.password) {
|
|
3878
|
+
try {
|
|
3879
|
+
await this.customer.auth.signIn({
|
|
3880
|
+
email: dto.email,
|
|
3881
|
+
password: dto.password
|
|
3882
|
+
});
|
|
3883
|
+
} catch (e) {
|
|
3884
|
+
console.error("Auto sign-in after sign-up failed on server SDK:", e);
|
|
3885
|
+
}
|
|
3886
|
+
}
|
|
3887
|
+
return res;
|
|
3677
3888
|
},
|
|
3678
3889
|
signIn: async (credentials) => {
|
|
3679
3890
|
const response = await this.axiosInstance.post(
|
package/dist/index.mjs
CHANGED
package/dist/server.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
2
|
-
import { G as ProductResponseDto, K as ServiceCatalogResponseDto,
|
|
2
|
+
import { G as ProductResponseDto, K as ServiceCatalogResponseDto, cQ as CartItemDto, bb as CartResponseDto, ai as CustomerResponseDto, dS as CustomerSessionDto, g6 as RawAPI, cZ as CatalogModule, ex as InventoryModule, fp as OrdersModule, cL as CRMModule, fx as POSModule, bR as AccountingModule, eZ as LoyaltyModule, fi as MembersModule, cj as AdminModule, gW as ServicesModule, ba as CartControllerGetCartParams, bd as AddToCartDto, be as RemoveFromCartDto, bc as CartControllerClearCartParams, aD as OrderResponseDto, am as UpdateCustomerDto, an as AddressDto, aj as RegisterCustomerDto, dQ as CustomerAuthResponseDto, a4 as CreateBookingDto, gu as ServiceBookingItemDto, a6 as CompleteBookingDto, cw as AuthModule, s as AuthExchangeToken201 } from './base-CSVOv3Nr.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Configuration options for the isolated ScrymeServerSDK.
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
2
|
-
import { G as ProductResponseDto, K as ServiceCatalogResponseDto,
|
|
2
|
+
import { G as ProductResponseDto, K as ServiceCatalogResponseDto, cQ as CartItemDto, bb as CartResponseDto, ai as CustomerResponseDto, dS as CustomerSessionDto, g6 as RawAPI, cZ as CatalogModule, ex as InventoryModule, fp as OrdersModule, cL as CRMModule, fx as POSModule, bR as AccountingModule, eZ as LoyaltyModule, fi as MembersModule, cj as AdminModule, gW as ServicesModule, ba as CartControllerGetCartParams, bd as AddToCartDto, be as RemoveFromCartDto, bc as CartControllerClearCartParams, aD as OrderResponseDto, am as UpdateCustomerDto, an as AddressDto, aj as RegisterCustomerDto, dQ as CustomerAuthResponseDto, a4 as CreateBookingDto, gu as ServiceBookingItemDto, a6 as CompleteBookingDto, cw as AuthModule, s as AuthExchangeToken201 } from './base-CSVOv3Nr.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Configuration options for the isolated ScrymeServerSDK.
|
package/dist/server.js
CHANGED
|
@@ -694,6 +694,29 @@ var getScrymeV3API = (axiosInstance = import_axios.default) => {
|
|
|
694
694
|
options
|
|
695
695
|
);
|
|
696
696
|
};
|
|
697
|
+
const catalogCreateReview = (orgSlug, productId, createProductReviewDto, options) => {
|
|
698
|
+
return axiosInstance.post(
|
|
699
|
+
`/v3/${orgSlug}/catalog/products/${productId}/reviews`,
|
|
700
|
+
createProductReviewDto,
|
|
701
|
+
options
|
|
702
|
+
);
|
|
703
|
+
};
|
|
704
|
+
const catalogUpdateReview = (orgSlug, reviewId, updateProductReviewDto, options) => {
|
|
705
|
+
return axiosInstance.patch(
|
|
706
|
+
`/v3/${orgSlug}/catalog/reviews/${reviewId}`,
|
|
707
|
+
updateProductReviewDto,
|
|
708
|
+
options
|
|
709
|
+
);
|
|
710
|
+
};
|
|
711
|
+
const catalogDeleteReview = (orgSlug, reviewId, params, options) => {
|
|
712
|
+
return axiosInstance.delete(
|
|
713
|
+
`/v3/${orgSlug}/catalog/reviews/${reviewId}`,
|
|
714
|
+
{
|
|
715
|
+
...options,
|
|
716
|
+
params: { ...params, ...options?.params }
|
|
717
|
+
}
|
|
718
|
+
);
|
|
719
|
+
};
|
|
697
720
|
const servicesCreateCategory = (orgSlug, createServiceCategoryDto, options) => {
|
|
698
721
|
return axiosInstance.post(
|
|
699
722
|
`/v3/${orgSlug}/services/categories`,
|
|
@@ -947,6 +970,13 @@ var getScrymeV3API = (axiosInstance = import_axios.default) => {
|
|
|
947
970
|
options
|
|
948
971
|
);
|
|
949
972
|
};
|
|
973
|
+
const customerRegister = (orgSlug, registerCustomerDto, options) => {
|
|
974
|
+
return axiosInstance.post(
|
|
975
|
+
`/v3/${orgSlug}/customers/../customer/register`,
|
|
976
|
+
registerCustomerDto,
|
|
977
|
+
options
|
|
978
|
+
);
|
|
979
|
+
};
|
|
950
980
|
const customersLogin = (orgSlug, customerLoginDto, options) => {
|
|
951
981
|
return axiosInstance.post(
|
|
952
982
|
`/v3/${orgSlug}/customers/auth/login`,
|
|
@@ -1899,7 +1929,7 @@ var getScrymeV3API = (axiosInstance = import_axios.default) => {
|
|
|
1899
1929
|
}
|
|
1900
1930
|
);
|
|
1901
1931
|
};
|
|
1902
|
-
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, 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, customersGetCustomers, customersRegister, 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 };
|
|
1932
|
+
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, servicesDeleteService, servicesCreateResource, servicesGetResources, servicesUpdateResource, servicesDeleteResource, servicesCreateBooking, servicesGetBookings, servicesGetBooking, servicesUpdateBookingStatus, servicesCompleteBooking, 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 };
|
|
1903
1933
|
};
|
|
1904
1934
|
|
|
1905
1935
|
// src/base.ts
|
|
@@ -1945,6 +1975,9 @@ var methodsWithOrgSlugSet = /* @__PURE__ */ new Set([
|
|
|
1945
1975
|
"catalogUpdateSupplierVariant",
|
|
1946
1976
|
"catalogGetPriceChangeRequests",
|
|
1947
1977
|
"catalogReviewPriceChangeRequest",
|
|
1978
|
+
"catalogCreateReview",
|
|
1979
|
+
"catalogUpdateReview",
|
|
1980
|
+
"catalogDeleteReview",
|
|
1948
1981
|
"servicesCreateCategory",
|
|
1949
1982
|
"servicesGetCategories",
|
|
1950
1983
|
"servicesUpdateCategory",
|
|
@@ -2059,6 +2092,9 @@ var catalogMapping = {
|
|
|
2059
2092
|
updateSupplierVariant: "catalogUpdateSupplierVariant",
|
|
2060
2093
|
getPriceChangeRequests: "catalogGetPriceChangeRequests",
|
|
2061
2094
|
reviewPriceChangeRequest: "catalogReviewPriceChangeRequest",
|
|
2095
|
+
createReview: "catalogCreateReview",
|
|
2096
|
+
updateReview: "catalogUpdateReview",
|
|
2097
|
+
deleteReview: "catalogDeleteReview",
|
|
2062
2098
|
createServiceCategory: "servicesCreateCategory",
|
|
2063
2099
|
getServiceCategories: "servicesGetCategories",
|
|
2064
2100
|
updateServiceCategory: "servicesUpdateCategory",
|
|
@@ -2403,6 +2439,7 @@ function getJwtExpiry(token) {
|
|
|
2403
2439
|
}
|
|
2404
2440
|
|
|
2405
2441
|
// src/client.tsx
|
|
2442
|
+
var import_react = require("react");
|
|
2406
2443
|
var import_axios2 = __toESM(require("axios"));
|
|
2407
2444
|
|
|
2408
2445
|
// src/index.ts
|
|
@@ -2769,7 +2806,18 @@ var ScrymeServerSDK = class {
|
|
|
2769
2806
|
},
|
|
2770
2807
|
auth: {
|
|
2771
2808
|
signUp: async (dto) => {
|
|
2772
|
-
|
|
2809
|
+
const res = await this.api.customersRegister(config.orgSlug, dto);
|
|
2810
|
+
if (dto.password) {
|
|
2811
|
+
try {
|
|
2812
|
+
await this.customer.auth.signIn({
|
|
2813
|
+
email: dto.email,
|
|
2814
|
+
password: dto.password
|
|
2815
|
+
});
|
|
2816
|
+
} catch (e) {
|
|
2817
|
+
console.error("Auto sign-in after sign-up failed on server SDK:", e);
|
|
2818
|
+
}
|
|
2819
|
+
}
|
|
2820
|
+
return res;
|
|
2773
2821
|
},
|
|
2774
2822
|
signIn: async (credentials) => {
|
|
2775
2823
|
const response = await this.axiosInstance.post(
|
package/dist/server.mjs
CHANGED