@scryme/sdk 9.66.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/dist/client.d.mts CHANGED
@@ -1,39 +1,123 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React from 'react';
3
1
  import { AxiosInstance, AxiosResponse } from 'axios';
4
- import { af as CustomerResponseDto, G as ProductResponseDto, K as ServiceCatalogResponseDto, cN as CartItemDto, b8 as CartResponseDto, dK as CustomerSessionDto, fT as RawAPI, cT as CatalogModule, ep as InventoryModule, fh as OrdersModule, cI as CRMModule, fp as POSModule, bO as AccountingModule, eR as LoyaltyModule, fa as MembersModule, cg as AdminModule, b7 as CartControllerGetCartParams, ba as AddToCartDto, bb as RemoveFromCartDto, b9 as CartControllerClearCartParams, aA as OrderResponseDto, aj as UpdateCustomerDto, ak as AddressDto, a0 as CreateBookingDto, gf as ServiceBookingItemDto, ct as AuthModule, ag as RegisterCustomerDto, s as AuthExchangeToken201, dJ as CustomerAuthResponseDto } from './base-Cl7_QxqC.mjs';
2
+ import { ae as CustomerResponseDto, G as ProductResponseDto, K as ServiceCatalogResponseDto, cM as CartItemDto, b7 as CartResponseDto, 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, 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, cs as AuthModule, s as AuthExchangeToken201 } from './base-1B2-e5i_.mjs';
5
3
 
4
+ /**
5
+ * Defines a storage contract for persisting authentication tokens and session data.
6
+ * Ideal for client-side environments (localStorage, secure storage, custom cookies).
7
+ */
6
8
  interface StorageProvider {
9
+ /**
10
+ * Retrieves an item from storage.
11
+ * @param key Unique storage key.
12
+ */
7
13
  getItem(key: string): string | null | Promise<string | null>;
14
+ /**
15
+ * Stores an item in storage.
16
+ * @param key Unique storage key.
17
+ * @param value Stringified value to store.
18
+ */
8
19
  setItem(key: string, value: string): void | Promise<void>;
20
+ /**
21
+ * Deletes an item from storage.
22
+ * @param key Unique storage key.
23
+ */
9
24
  removeItem(key: string): void | Promise<void>;
10
25
  }
26
+ /**
27
+ * Configuration options for the stateful ScrymeClientSDK.
28
+ */
11
29
  interface ClientSDKConfig {
30
+ /**
31
+ * The client ID of your Storefront application.
32
+ */
12
33
  clientId: string;
34
+ /**
35
+ * The optional client secret. It is omitted on the client side for maximum security.
36
+ */
13
37
  clientSecret?: string;
38
+ /**
39
+ * The unique slug of the organization to target.
40
+ */
14
41
  orgSlug: string;
42
+ /**
43
+ * Optional base API URL. Defaults to "https://api.scryme.tech".
44
+ */
15
45
  baseURL?: string;
46
+ /**
47
+ * Custom storage provider to persist session tokens. Defaults to localStorage where available.
48
+ */
16
49
  storage?: StorageProvider;
17
50
  }
51
+ /**
52
+ * Represents the authentication change events emitted by the SDK.
53
+ */
18
54
  type AuthChangeEvent = "SIGNED_IN" | "SIGNED_OUT" | "INITIAL_SESSION";
55
+ /**
56
+ * Represents the active customer session status.
57
+ * @template TUser Custom User profile type.
58
+ */
19
59
  interface SessionState<TUser = CustomerResponseDto> {
60
+ /**
61
+ * The current customer authentication JWT token.
62
+ */
20
63
  token: string | null;
64
+ /**
65
+ * The deserialized customer profile details.
66
+ */
21
67
  user: TUser | null;
68
+ /**
69
+ * Epoch millisecond expiration timestamp of the token.
70
+ */
22
71
  expiresAt?: number | null;
23
72
  }
73
+ /**
74
+ * Callback signature triggered whenever the customer authentication status changes.
75
+ */
24
76
  type AuthStateCallback<TUser = CustomerResponseDto> = (event: AuthChangeEvent, session: SessionState<TUser>) => void;
77
+ /**
78
+ * Stateful, reactive Client-Side SDK for Scryme V3.
79
+ *
80
+ * Automatically handles JWT token exchanges, reactive customer session refreshes,
81
+ * stateful shopping cart synchronization, and real-time authentication state updates.
82
+ *
83
+ * @template TProduct Custom Product DTO type override. Defaults to ProductResponseDto.
84
+ * @template TService Custom Service DTO type override. Defaults to ServiceCatalogResponseDto.
85
+ * @template TCartItem Custom Cart Item DTO type override. Defaults to CartItemDto.
86
+ * @template TCartResponse Custom Cart Response DTO type override. Defaults to CartResponseDto.
87
+ * @template TUser Custom User Profile DTO type override. Defaults to CustomerResponseDto.
88
+ * @template TSession Custom Customer Session DTO type override. Defaults to CustomerSessionDto.
89
+ */
25
90
  declare class ScrymeClientSDK<TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TUser = CustomerResponseDto, TSession = CustomerSessionDto> {
91
+ /**
92
+ * Underlying Axios instance initialized with the customized baseUrl and automatic interceptors.
93
+ */
26
94
  axiosInstance: AxiosInstance;
95
+ /**
96
+ * Raw proxy API client exposing all standard endpoints auto-bound with the configured orgSlug.
97
+ */
27
98
  api: RawAPI;
99
+ /** Catalog operations submodule (products, services, categories, bookings, staff schedules). */
28
100
  catalog: CatalogModule<TProduct, TService>;
101
+ /** Traceability, split/merge, physical reconciliation, and partner wallet operations submodule. */
29
102
  inventory: InventoryModule;
103
+ /** Cart management, sales order orchestration, checkout processing, and payments submodule. */
30
104
  orders: OrdersModule;
105
+ /** Custom fields, relationships, note logging, associations, and CRM timeline submodule. */
31
106
  crm: CRMModule;
107
+ /** Cash flow register, sale processing, terminal synchronization, and device provision submodule. */
32
108
  pos: POSModule;
109
+ /** Balance sheets, Profit & Loss reports, expenses, invoices, and utility account submodule. */
33
110
  accounting: AccountingModule;
111
+ /** Rewards, voucher validation, point balances, and customer favorite records submodule. */
34
112
  loyalty: LoyaltyModule;
113
+ /** Staff members, department directories, check-in logs, and broadcast announcements submodule. */
35
114
  members: MembersModule;
115
+ /** Global setup parameters, organization definitions, audit trails, and tier limit submodule. */
36
116
  admin: AdminModule;
117
+ /**
118
+ * Stateful Shopping Cart Submodule.
119
+ * Leverages internal tracking and smart delta calculations for optimized storefront shopping.
120
+ */
37
121
  cart: {
38
122
  get<T = TCartResponse>(params?: CartControllerGetCartParams): Promise<AxiosResponse<T & Record<string, any>>>;
39
123
  add(dto: AddToCartDto): Promise<AxiosResponse<void>>;
@@ -55,18 +139,45 @@ declare class ScrymeClientSDK<TProduct = ProductResponseDto, TService = ServiceC
55
139
  channel?: string;
56
140
  }): Promise<OrderResponseDto>;
57
141
  };
142
+ /**
143
+ * Storefront Customer Profile Submodule.
144
+ * Manages the authenticated user's self-serve account, update workflows, and shipping/billing directories.
145
+ */
58
146
  customer: {
59
147
  getProfile<T = TUser>(): Promise<T>;
60
148
  updateProfile<T = TUser>(dto: UpdateCustomerDto): Promise<AxiosResponse<T>>;
61
149
  getAddresses(): Promise<AxiosResponse<AddressDto[]>>;
62
150
  addAddress(dto: AddressDto): Promise<AxiosResponse<void>>;
151
+ auth: {
152
+ signUp<T = TUser>(dto: RegisterCustomerDto): Promise<AxiosResponse<T>>;
153
+ signIn<TSess = TSession, TU = TUser>(credentials: {
154
+ email: string;
155
+ password?: string;
156
+ }): Promise<CustomerAuthResponseDto<TU, TSess>>;
157
+ signOut(): Promise<void>;
158
+ getSession<TU = TUser>(): Promise<SessionState<TU>>;
159
+ onAuthStateChange<TU = TUser>(callback: AuthStateCallback<TU>): {
160
+ unsubscribe(): void;
161
+ };
162
+ getSessions<TSess = TSession>(): Promise<TSess[]>;
163
+ revokeSession(id: string): Promise<AxiosResponse<void>>;
164
+ revokeAllSessions(mode?: string): Promise<AxiosResponse<void>>;
165
+ getCurrentSession<TU = TUser>(): Promise<TU>;
166
+ refreshSession<TSess = TSession, TU = TUser>(): Promise<CustomerAuthResponseDto<TU, TSess>>;
167
+ };
63
168
  };
169
+ /**
170
+ * Service Bookings & Appointments Submodule.
171
+ */
64
172
  bookings: {
65
173
  create(dto: CreateBookingDto): Promise<AxiosResponse<void>>;
66
174
  get(id: string): Promise<AxiosResponse<ServiceBookingItemDto>>;
67
175
  list(): Promise<AxiosResponse<ServiceBookingItemDto[]>>;
68
176
  cancel(id: string): Promise<AxiosResponse<void>>;
69
177
  };
178
+ /**
179
+ * Authentication & Customer Session Submodule.
180
+ */
70
181
  auth: AuthModule & {
71
182
  signUp<T = TUser>(dto: RegisterCustomerDto): Promise<AxiosResponse<T>>;
72
183
  authenticate(): Promise<AuthExchangeToken201>;
@@ -80,57 +191,21 @@ declare class ScrymeClientSDK<TProduct = ProductResponseDto, TService = ServiceC
80
191
  unsubscribe(): void;
81
192
  };
82
193
  getSessions<TSess = TSession>(): Promise<TSess[]>;
83
- revokeSession(id: string): Promise<any>;
84
- revokeAllSessions(mode?: string): Promise<any>;
194
+ revokeSession(id: string): Promise<AxiosResponse<void>>;
195
+ revokeAllSessions(mode?: string): Promise<AxiosResponse<void>>;
85
196
  getCurrentSession<TU = TUser>(): Promise<TU>;
86
197
  refreshSession<TSess = TSession, TU = TUser>(): Promise<CustomerAuthResponseDto<TU, TSess>>;
87
- swapZitadel<TSess = TSession, TU = TUser>(zitadelToken: string): Promise<CustomerAuthResponseDto<TU, TSess>>;
88
198
  };
199
+ /**
200
+ * Initializes the ScrymeClientSDK.
201
+ * @param config Application and organization configuration parameters.
202
+ */
89
203
  constructor(config: ClientSDKConfig);
90
204
  }
91
- declare function createClientSDK<TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TUser = CustomerResponseDto, TSession = CustomerSessionDto>(config?: any): ScrymeClientSDK<TProduct, TService, TCartItem, TCartResponse, TUser, TSession>;
92
- interface AuthContextType<TUser = CustomerResponseDto, TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TSession = CustomerSessionDto> {
93
- sdk: ScrymeClientSDK<TProduct, TService, TCartItem, TCartResponse, TUser, TSession>;
94
- session: SessionState<TUser>;
95
- user: TUser | null;
96
- token: string | null;
97
- isLoading: boolean;
98
- signIn: (credentials: {
99
- email: string;
100
- password?: string;
101
- }) => Promise<CustomerAuthResponseDto<TUser, TSession>>;
102
- signUp: (dto: RegisterCustomerDto) => Promise<AxiosResponse<TUser>>;
103
- signOut: () => Promise<void>;
104
- cart: TCartResponse | null;
105
- cartLoading: boolean;
106
- addToCart: (dto: AddToCartDto) => Promise<void>;
107
- removeFromCart: (dto: RemoveFromCartDto) => Promise<void>;
108
- updateCartItem: (dto: AddToCartDto & {
109
- quantity: number;
110
- }) => Promise<void>;
111
- clearCart: (params?: CartControllerClearCartParams) => Promise<void>;
112
- refreshCart: () => Promise<void>;
113
- customerProfile: TUser | null;
114
- customerAddresses: AddressDto[];
115
- bookings: ServiceBookingItemDto[];
116
- bookingsLoading: boolean;
117
- addAddress: (dto: AddressDto) => Promise<AxiosResponse<void>>;
118
- updateProfile: (dto: UpdateCustomerDto) => Promise<AxiosResponse<TUser>>;
119
- createBooking: (dto: CreateBookingDto) => Promise<AxiosResponse<void>>;
120
- cancelBooking: (id: string) => Promise<AxiosResponse<void>>;
121
- checkoutCart: (params: {
122
- locationId: string;
123
- notes?: string;
124
- channel?: string;
125
- }) => Promise<OrderResponseDto>;
126
- refreshProfile: () => Promise<void>;
127
- refreshBookings: () => Promise<void>;
128
- }
129
- interface ScrymeAuthProviderProps<TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TUser = CustomerResponseDto, TSession = CustomerSessionDto> {
130
- sdk: ScrymeClientSDK<TProduct, TService, TCartItem, TCartResponse, TUser, TSession>;
131
- children: React.ReactNode;
132
- }
133
- declare const ScrymeAuthProvider: <TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TUser = CustomerResponseDto, TSession = CustomerSessionDto>({ sdk, children, }: ScrymeAuthProviderProps<TProduct, TService, TCartItem, TCartResponse, TUser, TSession>) => react_jsx_runtime.JSX.Element;
134
- declare const useScrymeAuth: <TUser = CustomerResponseDto, TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TSession = CustomerSessionDto>() => AuthContextType<TUser, TProduct, TService, TCartItem, TCartResponse, TSession>;
205
+ /**
206
+ * Factory helper function to instantiate a ScrymeClientSDK.
207
+ * Retains backward compatibility while enforcing strict ClientSDKConfig types.
208
+ */
209
+ declare function createClientSDK<TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TUser = CustomerResponseDto, TSession = CustomerSessionDto>(config?: Partial<ClientSDKConfig>): ScrymeClientSDK<TProduct, TService, TCartItem, TCartResponse, TUser, TSession>;
135
210
 
136
- export { type AuthChangeEvent, type AuthContextType, type AuthStateCallback, type ClientSDKConfig, ScrymeAuthProvider, type ScrymeAuthProviderProps, ScrymeClientSDK, type SessionState, type StorageProvider, createClientSDK, useScrymeAuth };
211
+ export { type AuthChangeEvent, type AuthStateCallback, type ClientSDKConfig, ScrymeClientSDK, type SessionState, type StorageProvider, createClientSDK };
package/dist/client.d.ts CHANGED
@@ -1,39 +1,123 @@
1
- import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import React from 'react';
3
1
  import { AxiosInstance, AxiosResponse } from 'axios';
4
- import { af as CustomerResponseDto, G as ProductResponseDto, K as ServiceCatalogResponseDto, cN as CartItemDto, b8 as CartResponseDto, dK as CustomerSessionDto, fT as RawAPI, cT as CatalogModule, ep as InventoryModule, fh as OrdersModule, cI as CRMModule, fp as POSModule, bO as AccountingModule, eR as LoyaltyModule, fa as MembersModule, cg as AdminModule, b7 as CartControllerGetCartParams, ba as AddToCartDto, bb as RemoveFromCartDto, b9 as CartControllerClearCartParams, aA as OrderResponseDto, aj as UpdateCustomerDto, ak as AddressDto, a0 as CreateBookingDto, gf as ServiceBookingItemDto, ct as AuthModule, ag as RegisterCustomerDto, s as AuthExchangeToken201, dJ as CustomerAuthResponseDto } from './base-Cl7_QxqC.js';
2
+ import { ae as CustomerResponseDto, G as ProductResponseDto, K as ServiceCatalogResponseDto, cM as CartItemDto, b7 as CartResponseDto, 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, 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, cs as AuthModule, s as AuthExchangeToken201 } from './base-1B2-e5i_.js';
5
3
 
4
+ /**
5
+ * Defines a storage contract for persisting authentication tokens and session data.
6
+ * Ideal for client-side environments (localStorage, secure storage, custom cookies).
7
+ */
6
8
  interface StorageProvider {
9
+ /**
10
+ * Retrieves an item from storage.
11
+ * @param key Unique storage key.
12
+ */
7
13
  getItem(key: string): string | null | Promise<string | null>;
14
+ /**
15
+ * Stores an item in storage.
16
+ * @param key Unique storage key.
17
+ * @param value Stringified value to store.
18
+ */
8
19
  setItem(key: string, value: string): void | Promise<void>;
20
+ /**
21
+ * Deletes an item from storage.
22
+ * @param key Unique storage key.
23
+ */
9
24
  removeItem(key: string): void | Promise<void>;
10
25
  }
26
+ /**
27
+ * Configuration options for the stateful ScrymeClientSDK.
28
+ */
11
29
  interface ClientSDKConfig {
30
+ /**
31
+ * The client ID of your Storefront application.
32
+ */
12
33
  clientId: string;
34
+ /**
35
+ * The optional client secret. It is omitted on the client side for maximum security.
36
+ */
13
37
  clientSecret?: string;
38
+ /**
39
+ * The unique slug of the organization to target.
40
+ */
14
41
  orgSlug: string;
42
+ /**
43
+ * Optional base API URL. Defaults to "https://api.scryme.tech".
44
+ */
15
45
  baseURL?: string;
46
+ /**
47
+ * Custom storage provider to persist session tokens. Defaults to localStorage where available.
48
+ */
16
49
  storage?: StorageProvider;
17
50
  }
51
+ /**
52
+ * Represents the authentication change events emitted by the SDK.
53
+ */
18
54
  type AuthChangeEvent = "SIGNED_IN" | "SIGNED_OUT" | "INITIAL_SESSION";
55
+ /**
56
+ * Represents the active customer session status.
57
+ * @template TUser Custom User profile type.
58
+ */
19
59
  interface SessionState<TUser = CustomerResponseDto> {
60
+ /**
61
+ * The current customer authentication JWT token.
62
+ */
20
63
  token: string | null;
64
+ /**
65
+ * The deserialized customer profile details.
66
+ */
21
67
  user: TUser | null;
68
+ /**
69
+ * Epoch millisecond expiration timestamp of the token.
70
+ */
22
71
  expiresAt?: number | null;
23
72
  }
73
+ /**
74
+ * Callback signature triggered whenever the customer authentication status changes.
75
+ */
24
76
  type AuthStateCallback<TUser = CustomerResponseDto> = (event: AuthChangeEvent, session: SessionState<TUser>) => void;
77
+ /**
78
+ * Stateful, reactive Client-Side SDK for Scryme V3.
79
+ *
80
+ * Automatically handles JWT token exchanges, reactive customer session refreshes,
81
+ * stateful shopping cart synchronization, and real-time authentication state updates.
82
+ *
83
+ * @template TProduct Custom Product DTO type override. Defaults to ProductResponseDto.
84
+ * @template TService Custom Service DTO type override. Defaults to ServiceCatalogResponseDto.
85
+ * @template TCartItem Custom Cart Item DTO type override. Defaults to CartItemDto.
86
+ * @template TCartResponse Custom Cart Response DTO type override. Defaults to CartResponseDto.
87
+ * @template TUser Custom User Profile DTO type override. Defaults to CustomerResponseDto.
88
+ * @template TSession Custom Customer Session DTO type override. Defaults to CustomerSessionDto.
89
+ */
25
90
  declare class ScrymeClientSDK<TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TUser = CustomerResponseDto, TSession = CustomerSessionDto> {
91
+ /**
92
+ * Underlying Axios instance initialized with the customized baseUrl and automatic interceptors.
93
+ */
26
94
  axiosInstance: AxiosInstance;
95
+ /**
96
+ * Raw proxy API client exposing all standard endpoints auto-bound with the configured orgSlug.
97
+ */
27
98
  api: RawAPI;
99
+ /** Catalog operations submodule (products, services, categories, bookings, staff schedules). */
28
100
  catalog: CatalogModule<TProduct, TService>;
101
+ /** Traceability, split/merge, physical reconciliation, and partner wallet operations submodule. */
29
102
  inventory: InventoryModule;
103
+ /** Cart management, sales order orchestration, checkout processing, and payments submodule. */
30
104
  orders: OrdersModule;
105
+ /** Custom fields, relationships, note logging, associations, and CRM timeline submodule. */
31
106
  crm: CRMModule;
107
+ /** Cash flow register, sale processing, terminal synchronization, and device provision submodule. */
32
108
  pos: POSModule;
109
+ /** Balance sheets, Profit & Loss reports, expenses, invoices, and utility account submodule. */
33
110
  accounting: AccountingModule;
111
+ /** Rewards, voucher validation, point balances, and customer favorite records submodule. */
34
112
  loyalty: LoyaltyModule;
113
+ /** Staff members, department directories, check-in logs, and broadcast announcements submodule. */
35
114
  members: MembersModule;
115
+ /** Global setup parameters, organization definitions, audit trails, and tier limit submodule. */
36
116
  admin: AdminModule;
117
+ /**
118
+ * Stateful Shopping Cart Submodule.
119
+ * Leverages internal tracking and smart delta calculations for optimized storefront shopping.
120
+ */
37
121
  cart: {
38
122
  get<T = TCartResponse>(params?: CartControllerGetCartParams): Promise<AxiosResponse<T & Record<string, any>>>;
39
123
  add(dto: AddToCartDto): Promise<AxiosResponse<void>>;
@@ -55,18 +139,45 @@ declare class ScrymeClientSDK<TProduct = ProductResponseDto, TService = ServiceC
55
139
  channel?: string;
56
140
  }): Promise<OrderResponseDto>;
57
141
  };
142
+ /**
143
+ * Storefront Customer Profile Submodule.
144
+ * Manages the authenticated user's self-serve account, update workflows, and shipping/billing directories.
145
+ */
58
146
  customer: {
59
147
  getProfile<T = TUser>(): Promise<T>;
60
148
  updateProfile<T = TUser>(dto: UpdateCustomerDto): Promise<AxiosResponse<T>>;
61
149
  getAddresses(): Promise<AxiosResponse<AddressDto[]>>;
62
150
  addAddress(dto: AddressDto): Promise<AxiosResponse<void>>;
151
+ auth: {
152
+ signUp<T = TUser>(dto: RegisterCustomerDto): Promise<AxiosResponse<T>>;
153
+ signIn<TSess = TSession, TU = TUser>(credentials: {
154
+ email: string;
155
+ password?: string;
156
+ }): Promise<CustomerAuthResponseDto<TU, TSess>>;
157
+ signOut(): Promise<void>;
158
+ getSession<TU = TUser>(): Promise<SessionState<TU>>;
159
+ onAuthStateChange<TU = TUser>(callback: AuthStateCallback<TU>): {
160
+ unsubscribe(): void;
161
+ };
162
+ getSessions<TSess = TSession>(): Promise<TSess[]>;
163
+ revokeSession(id: string): Promise<AxiosResponse<void>>;
164
+ revokeAllSessions(mode?: string): Promise<AxiosResponse<void>>;
165
+ getCurrentSession<TU = TUser>(): Promise<TU>;
166
+ refreshSession<TSess = TSession, TU = TUser>(): Promise<CustomerAuthResponseDto<TU, TSess>>;
167
+ };
63
168
  };
169
+ /**
170
+ * Service Bookings & Appointments Submodule.
171
+ */
64
172
  bookings: {
65
173
  create(dto: CreateBookingDto): Promise<AxiosResponse<void>>;
66
174
  get(id: string): Promise<AxiosResponse<ServiceBookingItemDto>>;
67
175
  list(): Promise<AxiosResponse<ServiceBookingItemDto[]>>;
68
176
  cancel(id: string): Promise<AxiosResponse<void>>;
69
177
  };
178
+ /**
179
+ * Authentication & Customer Session Submodule.
180
+ */
70
181
  auth: AuthModule & {
71
182
  signUp<T = TUser>(dto: RegisterCustomerDto): Promise<AxiosResponse<T>>;
72
183
  authenticate(): Promise<AuthExchangeToken201>;
@@ -80,57 +191,21 @@ declare class ScrymeClientSDK<TProduct = ProductResponseDto, TService = ServiceC
80
191
  unsubscribe(): void;
81
192
  };
82
193
  getSessions<TSess = TSession>(): Promise<TSess[]>;
83
- revokeSession(id: string): Promise<any>;
84
- revokeAllSessions(mode?: string): Promise<any>;
194
+ revokeSession(id: string): Promise<AxiosResponse<void>>;
195
+ revokeAllSessions(mode?: string): Promise<AxiosResponse<void>>;
85
196
  getCurrentSession<TU = TUser>(): Promise<TU>;
86
197
  refreshSession<TSess = TSession, TU = TUser>(): Promise<CustomerAuthResponseDto<TU, TSess>>;
87
- swapZitadel<TSess = TSession, TU = TUser>(zitadelToken: string): Promise<CustomerAuthResponseDto<TU, TSess>>;
88
198
  };
199
+ /**
200
+ * Initializes the ScrymeClientSDK.
201
+ * @param config Application and organization configuration parameters.
202
+ */
89
203
  constructor(config: ClientSDKConfig);
90
204
  }
91
- declare function createClientSDK<TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TUser = CustomerResponseDto, TSession = CustomerSessionDto>(config?: any): ScrymeClientSDK<TProduct, TService, TCartItem, TCartResponse, TUser, TSession>;
92
- interface AuthContextType<TUser = CustomerResponseDto, TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TSession = CustomerSessionDto> {
93
- sdk: ScrymeClientSDK<TProduct, TService, TCartItem, TCartResponse, TUser, TSession>;
94
- session: SessionState<TUser>;
95
- user: TUser | null;
96
- token: string | null;
97
- isLoading: boolean;
98
- signIn: (credentials: {
99
- email: string;
100
- password?: string;
101
- }) => Promise<CustomerAuthResponseDto<TUser, TSession>>;
102
- signUp: (dto: RegisterCustomerDto) => Promise<AxiosResponse<TUser>>;
103
- signOut: () => Promise<void>;
104
- cart: TCartResponse | null;
105
- cartLoading: boolean;
106
- addToCart: (dto: AddToCartDto) => Promise<void>;
107
- removeFromCart: (dto: RemoveFromCartDto) => Promise<void>;
108
- updateCartItem: (dto: AddToCartDto & {
109
- quantity: number;
110
- }) => Promise<void>;
111
- clearCart: (params?: CartControllerClearCartParams) => Promise<void>;
112
- refreshCart: () => Promise<void>;
113
- customerProfile: TUser | null;
114
- customerAddresses: AddressDto[];
115
- bookings: ServiceBookingItemDto[];
116
- bookingsLoading: boolean;
117
- addAddress: (dto: AddressDto) => Promise<AxiosResponse<void>>;
118
- updateProfile: (dto: UpdateCustomerDto) => Promise<AxiosResponse<TUser>>;
119
- createBooking: (dto: CreateBookingDto) => Promise<AxiosResponse<void>>;
120
- cancelBooking: (id: string) => Promise<AxiosResponse<void>>;
121
- checkoutCart: (params: {
122
- locationId: string;
123
- notes?: string;
124
- channel?: string;
125
- }) => Promise<OrderResponseDto>;
126
- refreshProfile: () => Promise<void>;
127
- refreshBookings: () => Promise<void>;
128
- }
129
- interface ScrymeAuthProviderProps<TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TUser = CustomerResponseDto, TSession = CustomerSessionDto> {
130
- sdk: ScrymeClientSDK<TProduct, TService, TCartItem, TCartResponse, TUser, TSession>;
131
- children: React.ReactNode;
132
- }
133
- declare const ScrymeAuthProvider: <TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TUser = CustomerResponseDto, TSession = CustomerSessionDto>({ sdk, children, }: ScrymeAuthProviderProps<TProduct, TService, TCartItem, TCartResponse, TUser, TSession>) => react_jsx_runtime.JSX.Element;
134
- declare const useScrymeAuth: <TUser = CustomerResponseDto, TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TSession = CustomerSessionDto>() => AuthContextType<TUser, TProduct, TService, TCartItem, TCartResponse, TSession>;
205
+ /**
206
+ * Factory helper function to instantiate a ScrymeClientSDK.
207
+ * Retains backward compatibility while enforcing strict ClientSDKConfig types.
208
+ */
209
+ declare function createClientSDK<TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TUser = CustomerResponseDto, TSession = CustomerSessionDto>(config?: Partial<ClientSDKConfig>): ScrymeClientSDK<TProduct, TService, TCartItem, TCartResponse, TUser, TSession>;
135
210
 
136
- export { type AuthChangeEvent, type AuthContextType, type AuthStateCallback, type ClientSDKConfig, ScrymeAuthProvider, type ScrymeAuthProviderProps, ScrymeClientSDK, type SessionState, type StorageProvider, createClientSDK, useScrymeAuth };
211
+ export { type AuthChangeEvent, type AuthStateCallback, type ClientSDKConfig, ScrymeClientSDK, type SessionState, type StorageProvider, createClientSDK };