@scryme/sdk 0.1.0 → 9.64.2
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 +86 -283
- package/dist/base-DZXCyXwH.d.mts +4892 -0
- package/dist/base-DZXCyXwH.d.ts +4892 -0
- package/dist/chunk-CBV4VTNE.mjs +3143 -0
- package/dist/client.d.mts +52 -0
- package/dist/client.d.ts +52 -0
- package/dist/client.js +2577 -0
- package/dist/client.mjs +8 -0
- package/dist/index.d.mts +326 -0
- package/dist/index.d.ts +326 -0
- package/dist/index.js +3241 -0
- package/dist/index.mjs +134 -0
- package/dist/server.d.mts +39 -0
- package/dist/server.d.ts +39 -0
- package/dist/server.js +2459 -0
- package/dist/server.mjs +8 -0
- package/package.json +34 -3
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { fx as RawAPI, cM as CatalogModule, eb as InventoryModule, f3 as OrdersModule, cB as CRMModule, fb as POSModule, bH as AccountingModule, eD as LoyaltyModule, eY as MembersModule, c9 as AdminModule, cm as AuthModule, ab as RegisterCustomerDto } from './base-DZXCyXwH.mjs';
|
|
3
|
+
|
|
4
|
+
interface StorageProvider {
|
|
5
|
+
getItem(key: string): string | null | Promise<string | null>;
|
|
6
|
+
setItem(key: string, value: string): void | Promise<void>;
|
|
7
|
+
removeItem(key: string): void | Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
interface ClientSDKConfig {
|
|
10
|
+
clientId: string;
|
|
11
|
+
clientSecret: string;
|
|
12
|
+
orgSlug: string;
|
|
13
|
+
baseURL?: string;
|
|
14
|
+
storage?: StorageProvider;
|
|
15
|
+
}
|
|
16
|
+
type AuthChangeEvent = "SIGNED_IN" | "SIGNED_OUT" | "INITIAL_SESSION";
|
|
17
|
+
interface SessionState {
|
|
18
|
+
token: string | null;
|
|
19
|
+
user: any | null;
|
|
20
|
+
expiresAt?: number | null;
|
|
21
|
+
}
|
|
22
|
+
type AuthStateCallback = (event: AuthChangeEvent, session: SessionState) => void;
|
|
23
|
+
declare class ScrymeClientSDK {
|
|
24
|
+
axiosInstance: AxiosInstance;
|
|
25
|
+
api: RawAPI;
|
|
26
|
+
catalog: CatalogModule;
|
|
27
|
+
inventory: InventoryModule;
|
|
28
|
+
orders: OrdersModule;
|
|
29
|
+
crm: CRMModule;
|
|
30
|
+
pos: POSModule;
|
|
31
|
+
accounting: AccountingModule;
|
|
32
|
+
loyalty: LoyaltyModule;
|
|
33
|
+
members: MembersModule;
|
|
34
|
+
admin: AdminModule;
|
|
35
|
+
auth: AuthModule & {
|
|
36
|
+
signUp(dto: RegisterCustomerDto): Promise<any>;
|
|
37
|
+
authenticate(): Promise<any>;
|
|
38
|
+
signIn(credentials: {
|
|
39
|
+
email: string;
|
|
40
|
+
password?: string;
|
|
41
|
+
}): Promise<any>;
|
|
42
|
+
signOut(): Promise<void>;
|
|
43
|
+
getSession(): Promise<SessionState>;
|
|
44
|
+
onAuthStateChange(callback: AuthStateCallback): {
|
|
45
|
+
unsubscribe(): void;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
constructor(config: ClientSDKConfig);
|
|
49
|
+
}
|
|
50
|
+
declare function createClientSDK(config?: any): ScrymeClientSDK;
|
|
51
|
+
|
|
52
|
+
export { type AuthChangeEvent, type AuthStateCallback, type ClientSDKConfig, ScrymeClientSDK, type SessionState, type StorageProvider, createClientSDK };
|
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { AxiosInstance } from 'axios';
|
|
2
|
+
import { fx as RawAPI, cM as CatalogModule, eb as InventoryModule, f3 as OrdersModule, cB as CRMModule, fb as POSModule, bH as AccountingModule, eD as LoyaltyModule, eY as MembersModule, c9 as AdminModule, cm as AuthModule, ab as RegisterCustomerDto } from './base-DZXCyXwH.js';
|
|
3
|
+
|
|
4
|
+
interface StorageProvider {
|
|
5
|
+
getItem(key: string): string | null | Promise<string | null>;
|
|
6
|
+
setItem(key: string, value: string): void | Promise<void>;
|
|
7
|
+
removeItem(key: string): void | Promise<void>;
|
|
8
|
+
}
|
|
9
|
+
interface ClientSDKConfig {
|
|
10
|
+
clientId: string;
|
|
11
|
+
clientSecret: string;
|
|
12
|
+
orgSlug: string;
|
|
13
|
+
baseURL?: string;
|
|
14
|
+
storage?: StorageProvider;
|
|
15
|
+
}
|
|
16
|
+
type AuthChangeEvent = "SIGNED_IN" | "SIGNED_OUT" | "INITIAL_SESSION";
|
|
17
|
+
interface SessionState {
|
|
18
|
+
token: string | null;
|
|
19
|
+
user: any | null;
|
|
20
|
+
expiresAt?: number | null;
|
|
21
|
+
}
|
|
22
|
+
type AuthStateCallback = (event: AuthChangeEvent, session: SessionState) => void;
|
|
23
|
+
declare class ScrymeClientSDK {
|
|
24
|
+
axiosInstance: AxiosInstance;
|
|
25
|
+
api: RawAPI;
|
|
26
|
+
catalog: CatalogModule;
|
|
27
|
+
inventory: InventoryModule;
|
|
28
|
+
orders: OrdersModule;
|
|
29
|
+
crm: CRMModule;
|
|
30
|
+
pos: POSModule;
|
|
31
|
+
accounting: AccountingModule;
|
|
32
|
+
loyalty: LoyaltyModule;
|
|
33
|
+
members: MembersModule;
|
|
34
|
+
admin: AdminModule;
|
|
35
|
+
auth: AuthModule & {
|
|
36
|
+
signUp(dto: RegisterCustomerDto): Promise<any>;
|
|
37
|
+
authenticate(): Promise<any>;
|
|
38
|
+
signIn(credentials: {
|
|
39
|
+
email: string;
|
|
40
|
+
password?: string;
|
|
41
|
+
}): Promise<any>;
|
|
42
|
+
signOut(): Promise<void>;
|
|
43
|
+
getSession(): Promise<SessionState>;
|
|
44
|
+
onAuthStateChange(callback: AuthStateCallback): {
|
|
45
|
+
unsubscribe(): void;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
constructor(config: ClientSDKConfig);
|
|
49
|
+
}
|
|
50
|
+
declare function createClientSDK(config?: any): ScrymeClientSDK;
|
|
51
|
+
|
|
52
|
+
export { type AuthChangeEvent, type AuthStateCallback, type ClientSDKConfig, ScrymeClientSDK, type SessionState, type StorageProvider, createClientSDK };
|