@scryme/sdk 9.65.0 → 9.67.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/README.md +1 -1
- package/dist/{base-DZWqHn_L.d.mts → base-1B2-e5i_.d.mts} +78 -20
- package/dist/{base-DZWqHn_L.d.ts → base-1B2-e5i_.d.ts} +78 -20
- package/dist/{chunk-PPNV4D3M.mjs → chunk-QS5K7GIL.mjs} +284 -445
- package/dist/client.d.mts +149 -87
- package/dist/client.d.ts +149 -87
- package/dist/client.js +160 -394
- package/dist/client.mjs +3 -7
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +285 -448
- package/dist/index.mjs +3 -7
- package/dist/server.d.mts +199 -29
- package/dist/server.d.ts +199 -29
- package/dist/server.js +145 -67
- package/dist/server.mjs +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -33,7 +33,6 @@ import {
|
|
|
33
33
|
RegisterPettyCashDtoPaymentMethod,
|
|
34
34
|
ReviewPriceChangeDtoStatus,
|
|
35
35
|
RoleManagementControllerGetCustomRolesSortOrder,
|
|
36
|
-
ScrymeAuthProvider,
|
|
37
36
|
ScrymeClientSDK,
|
|
38
37
|
ScrymeServerSDK,
|
|
39
38
|
ServicesUpdateBookingStatusBodyStatus,
|
|
@@ -66,9 +65,8 @@ import {
|
|
|
66
65
|
ordersMapping,
|
|
67
66
|
posMapping,
|
|
68
67
|
publicServicesMapping,
|
|
69
|
-
servicesMapping
|
|
70
|
-
|
|
71
|
-
} from "./chunk-PPNV4D3M.mjs";
|
|
68
|
+
servicesMapping
|
|
69
|
+
} from "./chunk-QS5K7GIL.mjs";
|
|
72
70
|
export {
|
|
73
71
|
AddDepartmentMemberDtoRole,
|
|
74
72
|
AttendanceControllerGetLogsSortOrder,
|
|
@@ -104,7 +102,6 @@ export {
|
|
|
104
102
|
RegisterPettyCashDtoPaymentMethod,
|
|
105
103
|
ReviewPriceChangeDtoStatus,
|
|
106
104
|
RoleManagementControllerGetCustomRolesSortOrder,
|
|
107
|
-
ScrymeAuthProvider,
|
|
108
105
|
ScrymeClientSDK,
|
|
109
106
|
ScrymeServerSDK,
|
|
110
107
|
ServicesUpdateBookingStatusBodyStatus,
|
|
@@ -137,6 +134,5 @@ export {
|
|
|
137
134
|
ordersMapping,
|
|
138
135
|
posMapping,
|
|
139
136
|
publicServicesMapping,
|
|
140
|
-
servicesMapping
|
|
141
|
-
useScrymeAuth
|
|
137
|
+
servicesMapping
|
|
142
138
|
};
|
package/dist/server.d.mts
CHANGED
|
@@ -1,41 +1,123 @@
|
|
|
1
1
|
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
2
|
-
import {
|
|
2
|
+
import { G as ProductResponseDto, K as ServiceCatalogResponseDto, cM as CartItemDto, b7 as CartResponseDto, ae as CustomerResponseDto, dK as CustomerSessionDto, fT as RawAPI, cT as CatalogModule, ep as InventoryModule, fh as OrdersModule, cH as CRMModule, fp as POSModule, bN as AccountingModule, eR as LoyaltyModule, fa as MembersModule, cf as AdminModule, gH as ServicesModule, b6 as CartControllerGetCartParams, b9 as AddToCartDto, ba as RemoveFromCartDto, b8 as CartControllerClearCartParams, az as OrderResponseDto, ai as UpdateCustomerDto, aj as AddressDto, af as RegisterCustomerDto, dJ as CustomerAuthResponseDto, a0 as CreateBookingDto, gf as ServiceBookingItemDto, a2 as CompleteBookingDto, cs as AuthModule, s as AuthExchangeToken201 } from './base-1B2-e5i_.mjs';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Configuration options for the isolated ScrymeServerSDK.
|
|
6
|
+
*/
|
|
4
7
|
interface ServerSDKConfig {
|
|
8
|
+
/**
|
|
9
|
+
* The client ID of your Server application credentials.
|
|
10
|
+
*/
|
|
5
11
|
clientId: string;
|
|
12
|
+
/**
|
|
13
|
+
* The client secret of your Server application credentials.
|
|
14
|
+
*/
|
|
6
15
|
clientSecret: string;
|
|
16
|
+
/**
|
|
17
|
+
* The unique slug of the organization to target.
|
|
18
|
+
*/
|
|
7
19
|
orgSlug: string;
|
|
20
|
+
/**
|
|
21
|
+
* Optional base API URL. Defaults to "https://api.scryme.tech".
|
|
22
|
+
*/
|
|
8
23
|
baseURL?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Optional high-performance customer session or admin JWT token.
|
|
26
|
+
*/
|
|
9
27
|
token?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Optional organization API key for system-level integrations.
|
|
30
|
+
*/
|
|
10
31
|
apiKey?: string;
|
|
11
32
|
}
|
|
12
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Isolated, Multi-Tenant Safe Server-Side SDK for Scryme V3.
|
|
35
|
+
*
|
|
36
|
+
* Allocates strict request/session isolation to prevent token leakages, supporting
|
|
37
|
+
* backoffice orchestration, batch catalog syncs, scheduling updates, and administrative audits.
|
|
38
|
+
*
|
|
39
|
+
* @template TProduct Custom Product DTO type override. Defaults to ProductResponseDto.
|
|
40
|
+
* @template TService Custom Service DTO type override. Defaults to ServiceCatalogResponseDto.
|
|
41
|
+
* @template TCartItem Custom Cart Item DTO type override. Defaults to CartItemDto.
|
|
42
|
+
* @template TCartResponse Custom Cart Response DTO type override. Defaults to CartResponseDto.
|
|
43
|
+
* @template TUser Custom User Profile DTO type override. Defaults to CustomerResponseDto.
|
|
44
|
+
* @template TSession Custom Customer Session DTO type override. Defaults to CustomerSessionDto.
|
|
45
|
+
*/
|
|
46
|
+
declare class ScrymeServerSDK<TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TUser = CustomerResponseDto, TSession = CustomerSessionDto> {
|
|
47
|
+
/** Underlying Axios instance allocated exclusively to this server instance. */
|
|
13
48
|
axiosInstance: AxiosInstance;
|
|
49
|
+
/** Raw proxy API client exposing all standard endpoints auto-bound with the configured orgSlug. */
|
|
14
50
|
api: RawAPI;
|
|
15
|
-
|
|
51
|
+
/** Catalog operations submodule (products, services, categories, bookings, staff schedules). */
|
|
52
|
+
catalog: CatalogModule<TProduct, TService>;
|
|
53
|
+
/** Traceability, split/merge, physical reconciliation, and partner wallet operations submodule. */
|
|
16
54
|
inventory: InventoryModule;
|
|
55
|
+
/** Cart management, sales order orchestration, checkout processing, and payments submodule. */
|
|
17
56
|
orders: OrdersModule;
|
|
57
|
+
/** Custom fields, relationships, note logging, associations, and CRM timeline submodule. */
|
|
18
58
|
crm: CRMModule;
|
|
59
|
+
/** Cash flow register, sale processing, terminal synchronization, and device provision submodule. */
|
|
19
60
|
pos: POSModule;
|
|
61
|
+
/** Balance sheets, Profit & Loss reports, expenses, invoices, and utility account submodule. */
|
|
20
62
|
accounting: AccountingModule;
|
|
63
|
+
/** Rewards, voucher validation, point balances, and customer favorite records submodule. */
|
|
21
64
|
loyalty: LoyaltyModule;
|
|
65
|
+
/** Staff members, department directories, check-in logs, and broadcast announcements submodule. */
|
|
22
66
|
members: MembersModule;
|
|
67
|
+
/** Global setup parameters, organization definitions, audit trails, and tier limit submodule. */
|
|
23
68
|
admin: AdminModule;
|
|
69
|
+
/** Scheduling operations, break/shift management, staff schedules, and resource utilization submodule. */
|
|
24
70
|
services: ServicesModule;
|
|
71
|
+
/**
|
|
72
|
+
* Server Cart Submodule.
|
|
73
|
+
* Enables backend processes to orchestrate customer checkout sessions, retrieve active item lists, and manage shopping states.
|
|
74
|
+
*/
|
|
25
75
|
cart: {
|
|
26
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Retrieves a customer shopping cart.
|
|
78
|
+
* @param params Query arguments containing guest session or customer identifier.
|
|
79
|
+
*/
|
|
80
|
+
get<T = TCartResponse>(params?: CartControllerGetCartParams): Promise<AxiosResponse<T>>;
|
|
81
|
+
/**
|
|
82
|
+
* Adds an item to a target shopping cart.
|
|
83
|
+
* @param dto Item and target cart identifier details.
|
|
84
|
+
*/
|
|
27
85
|
add(dto: AddToCartDto): Promise<AxiosResponse<void>>;
|
|
86
|
+
/**
|
|
87
|
+
* Removes an item from a target shopping cart.
|
|
88
|
+
* @param dto Item and target cart identifier details.
|
|
89
|
+
*/
|
|
28
90
|
remove(dto: RemoveFromCartDto): Promise<AxiosResponse<void>>;
|
|
91
|
+
/**
|
|
92
|
+
* Clears all items from a target shopping cart.
|
|
93
|
+
* @param params Query arguments containing target session/customer identifiers.
|
|
94
|
+
*/
|
|
29
95
|
clear(params?: CartControllerClearCartParams): Promise<AxiosResponse<void>>;
|
|
30
|
-
|
|
96
|
+
/**
|
|
97
|
+
* Performs a smart delta-based update of item quantities in a shopping cart.
|
|
98
|
+
* @param dto Item, quantity, and cart identifier details.
|
|
99
|
+
*/
|
|
100
|
+
update<T = TCartResponse>(dto: AddToCartDto & {
|
|
31
101
|
quantity: number;
|
|
32
|
-
}): Promise<AxiosResponse<void> | AxiosResponse<
|
|
33
|
-
|
|
34
|
-
|
|
102
|
+
}): Promise<AxiosResponse<void> | AxiosResponse<T> | undefined>;
|
|
103
|
+
/**
|
|
104
|
+
* Returns a flat list of all items present in a shopping cart.
|
|
105
|
+
* @param params Query arguments containing target session/customer identifiers.
|
|
106
|
+
*/
|
|
107
|
+
getItems<T = TCartItem>(params?: CartControllerGetCartParams): Promise<T[]>;
|
|
108
|
+
/**
|
|
109
|
+
* Calculates totals including items counts and returns full raw cart response details.
|
|
110
|
+
* @param params Query arguments containing target session/customer identifiers.
|
|
111
|
+
*/
|
|
112
|
+
getTotals<TItem = TCartItem, TRaw = TCartResponse>(params?: CartControllerGetCartParams): Promise<{
|
|
35
113
|
itemsCount: number;
|
|
36
|
-
items:
|
|
37
|
-
raw:
|
|
114
|
+
items: TItem[];
|
|
115
|
+
raw: TRaw;
|
|
38
116
|
}>;
|
|
117
|
+
/**
|
|
118
|
+
* Orchestrates cart checkouts, finalizes shopping workflows, and outputs a registered sales order.
|
|
119
|
+
* @param params Target customer, location, and metadata details.
|
|
120
|
+
*/
|
|
39
121
|
checkout(params: {
|
|
40
122
|
sessionId?: string;
|
|
41
123
|
customerId?: string;
|
|
@@ -44,45 +126,133 @@ declare class ScrymeServerSDK {
|
|
|
44
126
|
channel?: string;
|
|
45
127
|
}): Promise<OrderResponseDto>;
|
|
46
128
|
};
|
|
129
|
+
/**
|
|
130
|
+
* Server Customer Management Submodule.
|
|
131
|
+
* Provides administrative lookup, profile updates, and shipping/billing address configurations.
|
|
132
|
+
*/
|
|
47
133
|
customer: {
|
|
48
|
-
|
|
49
|
-
|
|
134
|
+
/**
|
|
135
|
+
* Fetches detailed profile information for a specific customer.
|
|
136
|
+
* @param customerId Customer database identifier.
|
|
137
|
+
*/
|
|
138
|
+
getProfile<T = TUser>(customerId: string): Promise<AxiosResponse<T>>;
|
|
139
|
+
/**
|
|
140
|
+
* Modifies profile attributes for a specific customer.
|
|
141
|
+
* @param customerId Customer database identifier.
|
|
142
|
+
* @param dto Updated fields.
|
|
143
|
+
*/
|
|
144
|
+
updateProfile<T = TUser>(customerId: string, dto: UpdateCustomerDto): Promise<AxiosResponse<T>>;
|
|
145
|
+
/**
|
|
146
|
+
* Retrieves shipping and billing addresses for a specific customer.
|
|
147
|
+
* @param customerId Customer database identifier.
|
|
148
|
+
*/
|
|
50
149
|
getAddresses(customerId: string): Promise<AxiosResponse<AddressDto[]>>;
|
|
150
|
+
/**
|
|
151
|
+
* Adds an address to a customer's directory.
|
|
152
|
+
* @param customerId Customer database identifier.
|
|
153
|
+
* @param dto Address details.
|
|
154
|
+
*/
|
|
51
155
|
addAddress(customerId: string, dto: AddressDto): Promise<AxiosResponse<void>>;
|
|
156
|
+
/**
|
|
157
|
+
* Server Customer Authentication Submodule.
|
|
158
|
+
*/
|
|
159
|
+
auth: {
|
|
160
|
+
/**
|
|
161
|
+
* Administer registration of a new customer account.
|
|
162
|
+
* @param dto Customer credentials and details.
|
|
163
|
+
*/
|
|
164
|
+
signUp<T = TUser>(dto: RegisterCustomerDto): Promise<AxiosResponse<T>>;
|
|
165
|
+
/**
|
|
166
|
+
* Swaps credentials for an active, high-performance customer session token.
|
|
167
|
+
* @param credentials Email and password.
|
|
168
|
+
*/
|
|
169
|
+
signIn<TSess = TSession, TU = TUser>(credentials: {
|
|
170
|
+
email: string;
|
|
171
|
+
password?: string;
|
|
172
|
+
}): Promise<CustomerAuthResponseDto<TU, TSess>>;
|
|
173
|
+
/**
|
|
174
|
+
* Fetches details of the customer session associated with the active token.
|
|
175
|
+
*/
|
|
176
|
+
getCurrentSession<TU = TUser>(headers?: any | Record<string, string | string[]>): Promise<TU>;
|
|
177
|
+
/**
|
|
178
|
+
* Refreshes the current active customer session token.
|
|
179
|
+
*/
|
|
180
|
+
refreshSession<TSess = TSession, TU = TUser>(): Promise<CustomerAuthResponseDto<TU, TSess>>;
|
|
181
|
+
};
|
|
52
182
|
};
|
|
183
|
+
/**
|
|
184
|
+
* Server Bookings & Appointment Submodule.
|
|
185
|
+
* Enables booking creation, history audits, cancellations, and secure completion workflows.
|
|
186
|
+
*/
|
|
53
187
|
bookings: {
|
|
188
|
+
/**
|
|
189
|
+
* Schedules a new booking reservation.
|
|
190
|
+
* @param dto Booking specifications.
|
|
191
|
+
*/
|
|
54
192
|
create(dto: CreateBookingDto): Promise<AxiosResponse<void>>;
|
|
193
|
+
/**
|
|
194
|
+
* Looks up detailed configuration and status details for a specific booking.
|
|
195
|
+
* @param id Booking database identifier.
|
|
196
|
+
*/
|
|
55
197
|
get(id: string): Promise<AxiosResponse<ServiceBookingItemDto>>;
|
|
198
|
+
/**
|
|
199
|
+
* Lists the full history of booking reservations inside the organization.
|
|
200
|
+
*/
|
|
56
201
|
list(): Promise<AxiosResponse<ServiceBookingItemDto[]>>;
|
|
202
|
+
/**
|
|
203
|
+
* Cancels an active reservation, marking its status as CANCELLED.
|
|
204
|
+
* @param id Booking database identifier.
|
|
205
|
+
*/
|
|
57
206
|
cancel(id: string): Promise<AxiosResponse<void>>;
|
|
207
|
+
/**
|
|
208
|
+
* Securely completes a booking reservation (including post-service audits and QC reports).
|
|
209
|
+
* @param id Booking database identifier.
|
|
210
|
+
* @param dto Completion data.
|
|
211
|
+
*/
|
|
58
212
|
complete(id: string, dto: CompleteBookingDto & Record<string, any>): Promise<AxiosResponse<void>>;
|
|
59
213
|
};
|
|
214
|
+
/**
|
|
215
|
+
* Server Authentication & Customer Session Submodule.
|
|
216
|
+
* Handles server-orchestrated sign-ups, credential-based customer login, token validations.
|
|
217
|
+
*/
|
|
60
218
|
auth: AuthModule & {
|
|
61
|
-
|
|
219
|
+
/**
|
|
220
|
+
* Administer registration of a new customer account.
|
|
221
|
+
* @param dto Customer credentials and details.
|
|
222
|
+
*/
|
|
223
|
+
signUp<T = TUser>(dto: RegisterCustomerDto): Promise<AxiosResponse<T>>;
|
|
224
|
+
/**
|
|
225
|
+
* Triggers client credentials exchange for your Server credentials.
|
|
226
|
+
*/
|
|
62
227
|
authenticate(): Promise<AuthExchangeToken201>;
|
|
63
|
-
|
|
228
|
+
/**
|
|
229
|
+
* Swaps credentials for an active, high-performance customer session token.
|
|
230
|
+
* @param credentials Email and password.
|
|
231
|
+
*/
|
|
232
|
+
signIn<TSess = TSession, TU = TUser>(credentials: {
|
|
64
233
|
email: string;
|
|
65
234
|
password?: string;
|
|
66
|
-
}): Promise<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}>;
|
|
76
|
-
swapZitadel(zitadelToken: string): Promise<{
|
|
77
|
-
token: string;
|
|
78
|
-
session?: any;
|
|
79
|
-
}>;
|
|
235
|
+
}): Promise<CustomerAuthResponseDto<TU, TSess>>;
|
|
236
|
+
/**
|
|
237
|
+
* Fetches details of the customer session associated with the active token.
|
|
238
|
+
*/
|
|
239
|
+
getCurrentSession<TU = TUser>(headers?: any | Record<string, string | string[]>): Promise<TU>;
|
|
240
|
+
/**
|
|
241
|
+
* Refreshes the current active customer session token.
|
|
242
|
+
*/
|
|
243
|
+
refreshSession<TSess = TSession, TU = TUser>(): Promise<CustomerAuthResponseDto<TU, TSess>>;
|
|
80
244
|
};
|
|
81
245
|
private token;
|
|
82
246
|
private expiresAt;
|
|
83
247
|
private activeAuthPromise;
|
|
84
248
|
constructor(config: ServerSDKConfig);
|
|
85
249
|
}
|
|
86
|
-
|
|
250
|
+
/**
|
|
251
|
+
* Factory helper function to instantiate a ScrymeServerSDK.
|
|
252
|
+
* Retains backward compatibility while enforcing strict ServerSDKConfig types.
|
|
253
|
+
*
|
|
254
|
+
* @param config Server configuration overrides.
|
|
255
|
+
*/
|
|
256
|
+
declare function createServerSDK<TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TUser = CustomerResponseDto, TSession = CustomerSessionDto>(config?: Partial<ServerSDKConfig>): ScrymeServerSDK<TProduct, TService, TCartItem, TCartResponse, TUser, TSession>;
|
|
87
257
|
|
|
88
258
|
export { ScrymeServerSDK, type ServerSDKConfig, createServerSDK };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,41 +1,123 @@
|
|
|
1
1
|
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
2
|
-
import {
|
|
2
|
+
import { G as ProductResponseDto, K as ServiceCatalogResponseDto, cM as CartItemDto, b7 as CartResponseDto, ae as CustomerResponseDto, dK as CustomerSessionDto, fT as RawAPI, cT as CatalogModule, ep as InventoryModule, fh as OrdersModule, cH as CRMModule, fp as POSModule, bN as AccountingModule, eR as LoyaltyModule, fa as MembersModule, cf as AdminModule, gH as ServicesModule, b6 as CartControllerGetCartParams, b9 as AddToCartDto, ba as RemoveFromCartDto, b8 as CartControllerClearCartParams, az as OrderResponseDto, ai as UpdateCustomerDto, aj as AddressDto, af as RegisterCustomerDto, dJ as CustomerAuthResponseDto, a0 as CreateBookingDto, gf as ServiceBookingItemDto, a2 as CompleteBookingDto, cs as AuthModule, s as AuthExchangeToken201 } from './base-1B2-e5i_.js';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Configuration options for the isolated ScrymeServerSDK.
|
|
6
|
+
*/
|
|
4
7
|
interface ServerSDKConfig {
|
|
8
|
+
/**
|
|
9
|
+
* The client ID of your Server application credentials.
|
|
10
|
+
*/
|
|
5
11
|
clientId: string;
|
|
12
|
+
/**
|
|
13
|
+
* The client secret of your Server application credentials.
|
|
14
|
+
*/
|
|
6
15
|
clientSecret: string;
|
|
16
|
+
/**
|
|
17
|
+
* The unique slug of the organization to target.
|
|
18
|
+
*/
|
|
7
19
|
orgSlug: string;
|
|
20
|
+
/**
|
|
21
|
+
* Optional base API URL. Defaults to "https://api.scryme.tech".
|
|
22
|
+
*/
|
|
8
23
|
baseURL?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Optional high-performance customer session or admin JWT token.
|
|
26
|
+
*/
|
|
9
27
|
token?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Optional organization API key for system-level integrations.
|
|
30
|
+
*/
|
|
10
31
|
apiKey?: string;
|
|
11
32
|
}
|
|
12
|
-
|
|
33
|
+
/**
|
|
34
|
+
* Isolated, Multi-Tenant Safe Server-Side SDK for Scryme V3.
|
|
35
|
+
*
|
|
36
|
+
* Allocates strict request/session isolation to prevent token leakages, supporting
|
|
37
|
+
* backoffice orchestration, batch catalog syncs, scheduling updates, and administrative audits.
|
|
38
|
+
*
|
|
39
|
+
* @template TProduct Custom Product DTO type override. Defaults to ProductResponseDto.
|
|
40
|
+
* @template TService Custom Service DTO type override. Defaults to ServiceCatalogResponseDto.
|
|
41
|
+
* @template TCartItem Custom Cart Item DTO type override. Defaults to CartItemDto.
|
|
42
|
+
* @template TCartResponse Custom Cart Response DTO type override. Defaults to CartResponseDto.
|
|
43
|
+
* @template TUser Custom User Profile DTO type override. Defaults to CustomerResponseDto.
|
|
44
|
+
* @template TSession Custom Customer Session DTO type override. Defaults to CustomerSessionDto.
|
|
45
|
+
*/
|
|
46
|
+
declare class ScrymeServerSDK<TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TUser = CustomerResponseDto, TSession = CustomerSessionDto> {
|
|
47
|
+
/** Underlying Axios instance allocated exclusively to this server instance. */
|
|
13
48
|
axiosInstance: AxiosInstance;
|
|
49
|
+
/** Raw proxy API client exposing all standard endpoints auto-bound with the configured orgSlug. */
|
|
14
50
|
api: RawAPI;
|
|
15
|
-
|
|
51
|
+
/** Catalog operations submodule (products, services, categories, bookings, staff schedules). */
|
|
52
|
+
catalog: CatalogModule<TProduct, TService>;
|
|
53
|
+
/** Traceability, split/merge, physical reconciliation, and partner wallet operations submodule. */
|
|
16
54
|
inventory: InventoryModule;
|
|
55
|
+
/** Cart management, sales order orchestration, checkout processing, and payments submodule. */
|
|
17
56
|
orders: OrdersModule;
|
|
57
|
+
/** Custom fields, relationships, note logging, associations, and CRM timeline submodule. */
|
|
18
58
|
crm: CRMModule;
|
|
59
|
+
/** Cash flow register, sale processing, terminal synchronization, and device provision submodule. */
|
|
19
60
|
pos: POSModule;
|
|
61
|
+
/** Balance sheets, Profit & Loss reports, expenses, invoices, and utility account submodule. */
|
|
20
62
|
accounting: AccountingModule;
|
|
63
|
+
/** Rewards, voucher validation, point balances, and customer favorite records submodule. */
|
|
21
64
|
loyalty: LoyaltyModule;
|
|
65
|
+
/** Staff members, department directories, check-in logs, and broadcast announcements submodule. */
|
|
22
66
|
members: MembersModule;
|
|
67
|
+
/** Global setup parameters, organization definitions, audit trails, and tier limit submodule. */
|
|
23
68
|
admin: AdminModule;
|
|
69
|
+
/** Scheduling operations, break/shift management, staff schedules, and resource utilization submodule. */
|
|
24
70
|
services: ServicesModule;
|
|
71
|
+
/**
|
|
72
|
+
* Server Cart Submodule.
|
|
73
|
+
* Enables backend processes to orchestrate customer checkout sessions, retrieve active item lists, and manage shopping states.
|
|
74
|
+
*/
|
|
25
75
|
cart: {
|
|
26
|
-
|
|
76
|
+
/**
|
|
77
|
+
* Retrieves a customer shopping cart.
|
|
78
|
+
* @param params Query arguments containing guest session or customer identifier.
|
|
79
|
+
*/
|
|
80
|
+
get<T = TCartResponse>(params?: CartControllerGetCartParams): Promise<AxiosResponse<T>>;
|
|
81
|
+
/**
|
|
82
|
+
* Adds an item to a target shopping cart.
|
|
83
|
+
* @param dto Item and target cart identifier details.
|
|
84
|
+
*/
|
|
27
85
|
add(dto: AddToCartDto): Promise<AxiosResponse<void>>;
|
|
86
|
+
/**
|
|
87
|
+
* Removes an item from a target shopping cart.
|
|
88
|
+
* @param dto Item and target cart identifier details.
|
|
89
|
+
*/
|
|
28
90
|
remove(dto: RemoveFromCartDto): Promise<AxiosResponse<void>>;
|
|
91
|
+
/**
|
|
92
|
+
* Clears all items from a target shopping cart.
|
|
93
|
+
* @param params Query arguments containing target session/customer identifiers.
|
|
94
|
+
*/
|
|
29
95
|
clear(params?: CartControllerClearCartParams): Promise<AxiosResponse<void>>;
|
|
30
|
-
|
|
96
|
+
/**
|
|
97
|
+
* Performs a smart delta-based update of item quantities in a shopping cart.
|
|
98
|
+
* @param dto Item, quantity, and cart identifier details.
|
|
99
|
+
*/
|
|
100
|
+
update<T = TCartResponse>(dto: AddToCartDto & {
|
|
31
101
|
quantity: number;
|
|
32
|
-
}): Promise<AxiosResponse<void> | AxiosResponse<
|
|
33
|
-
|
|
34
|
-
|
|
102
|
+
}): Promise<AxiosResponse<void> | AxiosResponse<T> | undefined>;
|
|
103
|
+
/**
|
|
104
|
+
* Returns a flat list of all items present in a shopping cart.
|
|
105
|
+
* @param params Query arguments containing target session/customer identifiers.
|
|
106
|
+
*/
|
|
107
|
+
getItems<T = TCartItem>(params?: CartControllerGetCartParams): Promise<T[]>;
|
|
108
|
+
/**
|
|
109
|
+
* Calculates totals including items counts and returns full raw cart response details.
|
|
110
|
+
* @param params Query arguments containing target session/customer identifiers.
|
|
111
|
+
*/
|
|
112
|
+
getTotals<TItem = TCartItem, TRaw = TCartResponse>(params?: CartControllerGetCartParams): Promise<{
|
|
35
113
|
itemsCount: number;
|
|
36
|
-
items:
|
|
37
|
-
raw:
|
|
114
|
+
items: TItem[];
|
|
115
|
+
raw: TRaw;
|
|
38
116
|
}>;
|
|
117
|
+
/**
|
|
118
|
+
* Orchestrates cart checkouts, finalizes shopping workflows, and outputs a registered sales order.
|
|
119
|
+
* @param params Target customer, location, and metadata details.
|
|
120
|
+
*/
|
|
39
121
|
checkout(params: {
|
|
40
122
|
sessionId?: string;
|
|
41
123
|
customerId?: string;
|
|
@@ -44,45 +126,133 @@ declare class ScrymeServerSDK {
|
|
|
44
126
|
channel?: string;
|
|
45
127
|
}): Promise<OrderResponseDto>;
|
|
46
128
|
};
|
|
129
|
+
/**
|
|
130
|
+
* Server Customer Management Submodule.
|
|
131
|
+
* Provides administrative lookup, profile updates, and shipping/billing address configurations.
|
|
132
|
+
*/
|
|
47
133
|
customer: {
|
|
48
|
-
|
|
49
|
-
|
|
134
|
+
/**
|
|
135
|
+
* Fetches detailed profile information for a specific customer.
|
|
136
|
+
* @param customerId Customer database identifier.
|
|
137
|
+
*/
|
|
138
|
+
getProfile<T = TUser>(customerId: string): Promise<AxiosResponse<T>>;
|
|
139
|
+
/**
|
|
140
|
+
* Modifies profile attributes for a specific customer.
|
|
141
|
+
* @param customerId Customer database identifier.
|
|
142
|
+
* @param dto Updated fields.
|
|
143
|
+
*/
|
|
144
|
+
updateProfile<T = TUser>(customerId: string, dto: UpdateCustomerDto): Promise<AxiosResponse<T>>;
|
|
145
|
+
/**
|
|
146
|
+
* Retrieves shipping and billing addresses for a specific customer.
|
|
147
|
+
* @param customerId Customer database identifier.
|
|
148
|
+
*/
|
|
50
149
|
getAddresses(customerId: string): Promise<AxiosResponse<AddressDto[]>>;
|
|
150
|
+
/**
|
|
151
|
+
* Adds an address to a customer's directory.
|
|
152
|
+
* @param customerId Customer database identifier.
|
|
153
|
+
* @param dto Address details.
|
|
154
|
+
*/
|
|
51
155
|
addAddress(customerId: string, dto: AddressDto): Promise<AxiosResponse<void>>;
|
|
156
|
+
/**
|
|
157
|
+
* Server Customer Authentication Submodule.
|
|
158
|
+
*/
|
|
159
|
+
auth: {
|
|
160
|
+
/**
|
|
161
|
+
* Administer registration of a new customer account.
|
|
162
|
+
* @param dto Customer credentials and details.
|
|
163
|
+
*/
|
|
164
|
+
signUp<T = TUser>(dto: RegisterCustomerDto): Promise<AxiosResponse<T>>;
|
|
165
|
+
/**
|
|
166
|
+
* Swaps credentials for an active, high-performance customer session token.
|
|
167
|
+
* @param credentials Email and password.
|
|
168
|
+
*/
|
|
169
|
+
signIn<TSess = TSession, TU = TUser>(credentials: {
|
|
170
|
+
email: string;
|
|
171
|
+
password?: string;
|
|
172
|
+
}): Promise<CustomerAuthResponseDto<TU, TSess>>;
|
|
173
|
+
/**
|
|
174
|
+
* Fetches details of the customer session associated with the active token.
|
|
175
|
+
*/
|
|
176
|
+
getCurrentSession<TU = TUser>(headers?: any | Record<string, string | string[]>): Promise<TU>;
|
|
177
|
+
/**
|
|
178
|
+
* Refreshes the current active customer session token.
|
|
179
|
+
*/
|
|
180
|
+
refreshSession<TSess = TSession, TU = TUser>(): Promise<CustomerAuthResponseDto<TU, TSess>>;
|
|
181
|
+
};
|
|
52
182
|
};
|
|
183
|
+
/**
|
|
184
|
+
* Server Bookings & Appointment Submodule.
|
|
185
|
+
* Enables booking creation, history audits, cancellations, and secure completion workflows.
|
|
186
|
+
*/
|
|
53
187
|
bookings: {
|
|
188
|
+
/**
|
|
189
|
+
* Schedules a new booking reservation.
|
|
190
|
+
* @param dto Booking specifications.
|
|
191
|
+
*/
|
|
54
192
|
create(dto: CreateBookingDto): Promise<AxiosResponse<void>>;
|
|
193
|
+
/**
|
|
194
|
+
* Looks up detailed configuration and status details for a specific booking.
|
|
195
|
+
* @param id Booking database identifier.
|
|
196
|
+
*/
|
|
55
197
|
get(id: string): Promise<AxiosResponse<ServiceBookingItemDto>>;
|
|
198
|
+
/**
|
|
199
|
+
* Lists the full history of booking reservations inside the organization.
|
|
200
|
+
*/
|
|
56
201
|
list(): Promise<AxiosResponse<ServiceBookingItemDto[]>>;
|
|
202
|
+
/**
|
|
203
|
+
* Cancels an active reservation, marking its status as CANCELLED.
|
|
204
|
+
* @param id Booking database identifier.
|
|
205
|
+
*/
|
|
57
206
|
cancel(id: string): Promise<AxiosResponse<void>>;
|
|
207
|
+
/**
|
|
208
|
+
* Securely completes a booking reservation (including post-service audits and QC reports).
|
|
209
|
+
* @param id Booking database identifier.
|
|
210
|
+
* @param dto Completion data.
|
|
211
|
+
*/
|
|
58
212
|
complete(id: string, dto: CompleteBookingDto & Record<string, any>): Promise<AxiosResponse<void>>;
|
|
59
213
|
};
|
|
214
|
+
/**
|
|
215
|
+
* Server Authentication & Customer Session Submodule.
|
|
216
|
+
* Handles server-orchestrated sign-ups, credential-based customer login, token validations.
|
|
217
|
+
*/
|
|
60
218
|
auth: AuthModule & {
|
|
61
|
-
|
|
219
|
+
/**
|
|
220
|
+
* Administer registration of a new customer account.
|
|
221
|
+
* @param dto Customer credentials and details.
|
|
222
|
+
*/
|
|
223
|
+
signUp<T = TUser>(dto: RegisterCustomerDto): Promise<AxiosResponse<T>>;
|
|
224
|
+
/**
|
|
225
|
+
* Triggers client credentials exchange for your Server credentials.
|
|
226
|
+
*/
|
|
62
227
|
authenticate(): Promise<AuthExchangeToken201>;
|
|
63
|
-
|
|
228
|
+
/**
|
|
229
|
+
* Swaps credentials for an active, high-performance customer session token.
|
|
230
|
+
* @param credentials Email and password.
|
|
231
|
+
*/
|
|
232
|
+
signIn<TSess = TSession, TU = TUser>(credentials: {
|
|
64
233
|
email: string;
|
|
65
234
|
password?: string;
|
|
66
|
-
}): Promise<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}>;
|
|
76
|
-
swapZitadel(zitadelToken: string): Promise<{
|
|
77
|
-
token: string;
|
|
78
|
-
session?: any;
|
|
79
|
-
}>;
|
|
235
|
+
}): Promise<CustomerAuthResponseDto<TU, TSess>>;
|
|
236
|
+
/**
|
|
237
|
+
* Fetches details of the customer session associated with the active token.
|
|
238
|
+
*/
|
|
239
|
+
getCurrentSession<TU = TUser>(headers?: any | Record<string, string | string[]>): Promise<TU>;
|
|
240
|
+
/**
|
|
241
|
+
* Refreshes the current active customer session token.
|
|
242
|
+
*/
|
|
243
|
+
refreshSession<TSess = TSession, TU = TUser>(): Promise<CustomerAuthResponseDto<TU, TSess>>;
|
|
80
244
|
};
|
|
81
245
|
private token;
|
|
82
246
|
private expiresAt;
|
|
83
247
|
private activeAuthPromise;
|
|
84
248
|
constructor(config: ServerSDKConfig);
|
|
85
249
|
}
|
|
86
|
-
|
|
250
|
+
/**
|
|
251
|
+
* Factory helper function to instantiate a ScrymeServerSDK.
|
|
252
|
+
* Retains backward compatibility while enforcing strict ServerSDKConfig types.
|
|
253
|
+
*
|
|
254
|
+
* @param config Server configuration overrides.
|
|
255
|
+
*/
|
|
256
|
+
declare function createServerSDK<TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TUser = CustomerResponseDto, TSession = CustomerSessionDto>(config?: Partial<ServerSDKConfig>): ScrymeServerSDK<TProduct, TService, TCartItem, TCartResponse, TUser, TSession>;
|
|
87
257
|
|
|
88
258
|
export { ScrymeServerSDK, type ServerSDKConfig, createServerSDK };
|