@scryme/sdk 10.1.41 → 10.1.43

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/server.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance, AxiosResponse } from 'axios';
2
- import { ab as ProductResponseDto, ae as ServiceCatalogResponseDto, d6 as CartItemDto, bj as CartResponseDto, ao as CustomerResponseDto, e8 as CustomerSessionDto, gt as RawAPI, df as CatalogModule, eP as InventoryModule, fI as OrdersModule, d1 as CRMModule, fT as POSModule, bZ as AccountingModule, ff as LoyaltyModule, fA as MembersModule, cv as AdminModule, it as WebhooksModule, hj as ServicesModule, bi as CartControllerGetCartParams, bl as AddToCartDto, bm as RemoveFromCartDto, bk as CartControllerClearCartParams, aJ as OrderResponseDto, as as UpdateCustomerDto, at as AddressDto, ap as RegisterCustomerDto, e6 as CustomerAuthResponseDto, f as CreateBookingDto, gR as ServiceBookingItemDto, hl as ServicesUpdateBookingStatusBodyStatus, h as CompleteBookingDto, R as RequestOtpDto, V as VerifyOtpDto, o as PublicBookingDto, cN as AuthModule, O as AuthExchangeToken201 } from './base-gdko1ojI.mjs';
2
+ import { b as ProductResponseDto, S as ServiceCatalogResponseDto, a3 as CartItemDto, C as CartResponseDto, f as CustomerResponseDto, bk as CustomerSessionDto, cs as RawAPI, a9 as CatalogModule, bC as InventoryModule, c0 as OrdersModule, a0 as CRMModule, c2 as POSModule, q as AccountingModule, bK as LoyaltyModule, bW as MembersModule, y as AdminModule, e2 as WebhooksModule, d3 as ServicesModule, a2 as CartControllerGetCartParams, u as AddToCartDto, cG as RemoveFromCartDto, a1 as CartControllerClearCartParams, O as OrderResponseDto, dx as UpdateCustomerDto, w as AddressDto, cC as RegisterCustomerDto, bi as CustomerAuthResponseDto, al as CreateBookingDto, cS as ServiceBookingItemDto, d6 as ServicesUpdateBookingStatusBodyStatus, aj as CompleteBookingDto, cI as RequestOtpDto, e1 as VerifyOtpDto, cl as PublicBookingDto, N as AuthModule, a as AuthExchangeToken201 } from './base-CoqrR8Yg.mjs';
3
3
 
4
4
  /**
5
5
  * Configuration options for the isolated ScrymeServerSDK.
@@ -54,6 +54,8 @@ declare class ScrymeServerSDK<TProduct = ProductResponseDto, TService = ServiceC
54
54
  inventory: InventoryModule;
55
55
  /** Cart management, sales order orchestration, checkout processing, and payments submodule. */
56
56
  orders: OrdersModule;
57
+ /** Alias for orders & B2B operations submodule. */
58
+ b2b: OrdersModule;
57
59
  /** Custom fields, relationships, note logging, associations, and CRM timeline submodule. */
58
60
  crm: CRMModule;
59
61
  /** Cash flow register, sale processing, terminal synchronization, and device provision submodule. */
package/dist/server.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { AxiosInstance, AxiosResponse } from 'axios';
2
- import { ab as ProductResponseDto, ae as ServiceCatalogResponseDto, d6 as CartItemDto, bj as CartResponseDto, ao as CustomerResponseDto, e8 as CustomerSessionDto, gt as RawAPI, df as CatalogModule, eP as InventoryModule, fI as OrdersModule, d1 as CRMModule, fT as POSModule, bZ as AccountingModule, ff as LoyaltyModule, fA as MembersModule, cv as AdminModule, it as WebhooksModule, hj as ServicesModule, bi as CartControllerGetCartParams, bl as AddToCartDto, bm as RemoveFromCartDto, bk as CartControllerClearCartParams, aJ as OrderResponseDto, as as UpdateCustomerDto, at as AddressDto, ap as RegisterCustomerDto, e6 as CustomerAuthResponseDto, f as CreateBookingDto, gR as ServiceBookingItemDto, hl as ServicesUpdateBookingStatusBodyStatus, h as CompleteBookingDto, R as RequestOtpDto, V as VerifyOtpDto, o as PublicBookingDto, cN as AuthModule, O as AuthExchangeToken201 } from './base-gdko1ojI.js';
2
+ import { b as ProductResponseDto, S as ServiceCatalogResponseDto, a3 as CartItemDto, C as CartResponseDto, f as CustomerResponseDto, bk as CustomerSessionDto, cs as RawAPI, a9 as CatalogModule, bC as InventoryModule, c0 as OrdersModule, a0 as CRMModule, c2 as POSModule, q as AccountingModule, bK as LoyaltyModule, bW as MembersModule, y as AdminModule, e2 as WebhooksModule, d3 as ServicesModule, a2 as CartControllerGetCartParams, u as AddToCartDto, cG as RemoveFromCartDto, a1 as CartControllerClearCartParams, O as OrderResponseDto, dx as UpdateCustomerDto, w as AddressDto, cC as RegisterCustomerDto, bi as CustomerAuthResponseDto, al as CreateBookingDto, cS as ServiceBookingItemDto, d6 as ServicesUpdateBookingStatusBodyStatus, aj as CompleteBookingDto, cI as RequestOtpDto, e1 as VerifyOtpDto, cl as PublicBookingDto, N as AuthModule, a as AuthExchangeToken201 } from './base-CoqrR8Yg.js';
3
3
 
4
4
  /**
5
5
  * Configuration options for the isolated ScrymeServerSDK.
@@ -54,6 +54,8 @@ declare class ScrymeServerSDK<TProduct = ProductResponseDto, TService = ServiceC
54
54
  inventory: InventoryModule;
55
55
  /** Cart management, sales order orchestration, checkout processing, and payments submodule. */
56
56
  orders: OrdersModule;
57
+ /** Alias for orders & B2B operations submodule. */
58
+ b2b: OrdersModule;
57
59
  /** Custom fields, relationships, note logging, associations, and CRM timeline submodule. */
58
60
  crm: CRMModule;
59
61
  /** Cash flow register, sale processing, terminal synchronization, and device provision submodule. */
package/dist/server.js CHANGED
@@ -34,7 +34,7 @@ __export(server_exports, {
34
34
  createServerSDK: () => createServerSDK
35
35
  });
36
36
  module.exports = __toCommonJS(server_exports);
37
- var import_axios3 = __toESM(require("axios"));
37
+ var import_axios2 = __toESM(require("axios"));
38
38
 
39
39
  // src/generated/scryme.ts
40
40
  var import_axios = __toESM(require("axios"));
@@ -2006,6 +2006,72 @@ var getScrymeV3API = (axiosInstance = import_axios.default) => {
2006
2006
  return { 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, 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, authCreateOAuthClient, authListOAuthClients, authGetOAuthClient, authUpdateOAuthClient, authDeleteOAuthClient, authControllerHandleOAuth2, adminControllerGetStats, adminControllerListOrganizations, adminControllerCreateOrganization, adminControllerGetOrganizationDetails, adminControllerUpdateOrganization, adminControllerDeleteOrganization, adminControllerSuspendOrganization, adminControllerReactivateOrganization, adminControllerGetEffectiveQuota, adminControllerSetQuotaOverrides, adminControllerListMembers, adminControllerListUsers, adminControllerBanUser, adminControllerUnbanUser, adminControllerListConnectedApps, adminControllerListSystemLogs, adminControllerListGlobalSettings, adminControllerSetGlobalSetting, adminControllerDeleteGlobalSetting, adminControllerListTiers, adminControllerDefineTier, adminControllerDeleteTier, adminControllerGetOrganizationSubscription, adminControllerUpdateOrganizationSubscription, adminControllerListSystemPayments, adminControllerRecordCustomPayment, adminControllerListIntegrationDefinitions, adminControllerCreateIntegrationDefinition, adminControllerUpdateIntegrationDefinition, adminControllerDeleteIntegrationDefinition, adminControllerListActiveOrganizationIntegrations, webhooksCreate, webhooksList, webhooksDelete, catalogGetProducts, catalogCreateProduct, catalogGetProduct, catalogGetServices, catalogUpdateProduct, catalogUpdateSupplierVariant, catalogGetPriceChangeRequests, catalogReviewPriceChangeRequest, catalogCreateReview, catalogUpdateReview, catalogDeleteReview, 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, paymentsCheckout, paymentsControllerHandleStkCallback, pOSProvision, pOSLogin, pOSGetMe, pOSProcessSale, pOSSync, pOSGetTransactions, pOSRegisterPettyCash, pOSGetPettyCashFunds, pOSGetPettyCashTransactions, pOSCreatePairingSession, pOSGetPairingSessionStatus, pOSAuthorizePairingSession, 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 };
2007
2007
  };
2008
2008
 
2009
+ // src/proxy.ts
2010
+ function getEnvOrgSlug() {
2011
+ if (typeof process !== "undefined" && process.env) {
2012
+ const slug = process.env.SCRYME_ORG_SLUG || process.env.NEXT_PUBLIC_SCRYME_ORG_SLUG;
2013
+ if (slug) return slug;
2014
+ }
2015
+ try {
2016
+ const getMeta = new Function("return typeof import.meta !== 'undefined' ? import.meta : undefined");
2017
+ const meta = getMeta();
2018
+ if (meta && meta.env) {
2019
+ const slug = meta.env.VITE_SCRYME_ORG_SLUG || meta.env.SCRYME_ORG_SLUG;
2020
+ if (slug) return slug;
2021
+ }
2022
+ } catch (e) {
2023
+ }
2024
+ return void 0;
2025
+ }
2026
+ function expectsOrgSlug(fn) {
2027
+ const fnStr = fn.toString();
2028
+ const match = fnStr.match(/^\s*(?:async\s+)?\(([^)]+)\)/);
2029
+ if (!match) {
2030
+ const singleMatch = fnStr.match(/^\s*(\w+)\s*=>/);
2031
+ return singleMatch ? singleMatch[1] === "orgSlug" : false;
2032
+ }
2033
+ const firstParam = match[1].split(",")[0].split(":")[0].trim();
2034
+ return firstParam === "orgSlug";
2035
+ }
2036
+ function getStringParamCount(fn) {
2037
+ const fnStr = fn.toString();
2038
+ const match = fnStr.match(/^\s*(?:async\s+)?\(([^)]+)\)/);
2039
+ if (!match) return 0;
2040
+ const params = match[1].split(",").map((p) => p.trim());
2041
+ let count = 0;
2042
+ for (const param of params) {
2043
+ const cleanParam = param.split(":")[0].split("=")[0].trim();
2044
+ const lower = cleanParam.toLowerCase();
2045
+ if (lower === "params" || lower === "options" || lower.endsWith("dto") || lower.endsWith("body") || lower.endsWith("payload")) {
2046
+ break;
2047
+ }
2048
+ count++;
2049
+ }
2050
+ return count;
2051
+ }
2052
+ var getScrymeV3API2 = (axiosInstance, defaultOrgSlug) => {
2053
+ const api = getScrymeV3API(axiosInstance);
2054
+ return new Proxy(api, {
2055
+ get(target, prop, receiver) {
2056
+ const originalValue = Reflect.get(target, prop, receiver);
2057
+ if (typeof originalValue === "function") {
2058
+ if (expectsOrgSlug(originalValue)) {
2059
+ return function(...args) {
2060
+ const stringParamsExpected = getStringParamCount(originalValue);
2061
+ const stringArgsPassed = args.filter((arg) => typeof arg === "string").length;
2062
+ if (stringArgsPassed < stringParamsExpected) {
2063
+ const envSlug = defaultOrgSlug || getEnvOrgSlug() || "default-org";
2064
+ return originalValue.apply(this, [envSlug, ...args]);
2065
+ }
2066
+ return originalValue.apply(this, args);
2067
+ };
2068
+ }
2069
+ }
2070
+ return originalValue;
2071
+ }
2072
+ });
2073
+ };
2074
+
2009
2075
  // src/base.ts
2010
2076
  var methodsWithOrgSlugSet = /* @__PURE__ */ new Set([
2011
2077
  "publicServicesListServices",
@@ -2256,6 +2322,9 @@ var ordersMapping = {
2256
2322
  updateStatus: "ordersUpdateStatus",
2257
2323
  requestB2BQuote: "ordersRequestB2BQuote",
2258
2324
  convertQuoteToOrder: "ordersConvertQuoteToOrder",
2325
+ getCatalog: "b2BGetCatalog",
2326
+ getInvoices: "b2BGetInvoices",
2327
+ createQuote: "b2BCreateQuote",
2259
2328
  getB2BCatalog: "b2BGetCatalog",
2260
2329
  getB2BInvoices: "b2BGetInvoices",
2261
2330
  getB2BOrders: "b2BGetOrders",
@@ -2528,76 +2597,6 @@ function getJwtExpiry(token) {
2528
2597
  return null;
2529
2598
  }
2530
2599
 
2531
- // src/client.tsx
2532
- var import_react = require("react");
2533
- var import_axios2 = __toESM(require("axios"));
2534
-
2535
- // src/index.ts
2536
- function getEnvOrgSlug() {
2537
- if (typeof process !== "undefined" && process.env) {
2538
- const slug = process.env.SCRYME_ORG_SLUG || process.env.NEXT_PUBLIC_SCRYME_ORG_SLUG;
2539
- if (slug) return slug;
2540
- }
2541
- try {
2542
- const getMeta = new Function("return typeof import.meta !== 'undefined' ? import.meta : undefined");
2543
- const meta = getMeta();
2544
- if (meta && meta.env) {
2545
- const slug = meta.env.VITE_SCRYME_ORG_SLUG || meta.env.SCRYME_ORG_SLUG;
2546
- if (slug) return slug;
2547
- }
2548
- } catch (e) {
2549
- }
2550
- return void 0;
2551
- }
2552
- function expectsOrgSlug(fn) {
2553
- const fnStr = fn.toString();
2554
- const match = fnStr.match(/^\s*(?:async\s+)?\(([^)]+)\)/);
2555
- if (!match) {
2556
- const singleMatch = fnStr.match(/^\s*(\w+)\s*=>/);
2557
- return singleMatch ? singleMatch[1] === "orgSlug" : false;
2558
- }
2559
- const firstParam = match[1].split(",")[0].split(":")[0].trim();
2560
- return firstParam === "orgSlug";
2561
- }
2562
- function getStringParamCount(fn) {
2563
- const fnStr = fn.toString();
2564
- const match = fnStr.match(/^\s*(?:async\s+)?\(([^)]+)\)/);
2565
- if (!match) return 0;
2566
- const params = match[1].split(",").map((p) => p.trim());
2567
- let count = 0;
2568
- for (const param of params) {
2569
- const cleanParam = param.split(":")[0].split("=")[0].trim();
2570
- const lower = cleanParam.toLowerCase();
2571
- if (lower === "params" || lower === "options" || lower.endsWith("dto") || lower.endsWith("body") || lower.endsWith("payload")) {
2572
- break;
2573
- }
2574
- count++;
2575
- }
2576
- return count;
2577
- }
2578
- var getScrymeV3API2 = (axiosInstance, defaultOrgSlug) => {
2579
- const api = getScrymeV3API(axiosInstance);
2580
- return new Proxy(api, {
2581
- get(target, prop, receiver) {
2582
- const originalValue = Reflect.get(target, prop, receiver);
2583
- if (typeof originalValue === "function") {
2584
- if (expectsOrgSlug(originalValue)) {
2585
- return function(...args) {
2586
- const stringParamsExpected = getStringParamCount(originalValue);
2587
- const stringArgsPassed = args.filter((arg) => typeof arg === "string").length;
2588
- if (stringArgsPassed < stringParamsExpected) {
2589
- const envSlug = defaultOrgSlug || getEnvOrgSlug() || "default-org";
2590
- return originalValue.apply(this, [envSlug, ...args]);
2591
- }
2592
- return originalValue.apply(this, args);
2593
- };
2594
- }
2595
- }
2596
- return originalValue;
2597
- }
2598
- });
2599
- };
2600
-
2601
2600
  // src/server.ts
2602
2601
  var ScrymeServerSDK = class {
2603
2602
  constructor(config) {
@@ -2613,7 +2612,7 @@ var ScrymeServerSDK = class {
2613
2612
  if (finalBaseURL && !finalBaseURL.includes("/api") && !finalBaseURL.endsWith("/api")) {
2614
2613
  finalBaseURL = finalBaseURL.replace(/\/$/, "") + "/api";
2615
2614
  }
2616
- this.axiosInstance = import_axios3.default.create({
2615
+ this.axiosInstance = import_axios2.default.create({
2617
2616
  baseURL: finalBaseURL
2618
2617
  });
2619
2618
  if (config.token) {
@@ -2765,6 +2764,7 @@ var ScrymeServerSDK = class {
2765
2764
  };
2766
2765
  this.inventory = buildModule(this.api, config.orgSlug, inventoryMapping);
2767
2766
  this.orders = buildModule(this.api, config.orgSlug, ordersMapping);
2767
+ this.b2b = this.orders;
2768
2768
  this.crm = buildModule(this.api, config.orgSlug, crmMapping);
2769
2769
  this.pos = buildModule(this.api, config.orgSlug, posMapping);
2770
2770
  this.accounting = buildModule(this.api, config.orgSlug, accountingMapping);