@scryme/sdk 9.64.2 → 9.66.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/LICENSE +661 -0
- package/README.md +1 -1
- package/dist/{base-DZXCyXwH.d.mts → base-Cl7_QxqC.d.mts} +255 -52
- package/dist/{base-DZXCyXwH.d.ts → base-Cl7_QxqC.d.ts} +255 -52
- package/dist/{chunk-CBV4VTNE.mjs → chunk-PPNV4D3M.mjs} +875 -44
- package/dist/client.d.mts +100 -16
- package/dist/client.d.ts +100 -16
- package/dist/client.js +661 -31
- package/dist/client.mjs +7 -3
- package/dist/index.d.mts +19 -5
- package/dist/index.d.ts +19 -5
- package/dist/index.js +880 -45
- package/dist/index.mjs +11 -3
- package/dist/server.d.mts +48 -9
- package/dist/server.d.ts +48 -9
- package/dist/server.js +361 -20
- package/dist/server.mjs +1 -1
- package/package.json +13 -3
package/dist/index.mjs
CHANGED
|
@@ -33,6 +33,7 @@ import {
|
|
|
33
33
|
RegisterPettyCashDtoPaymentMethod,
|
|
34
34
|
ReviewPriceChangeDtoStatus,
|
|
35
35
|
RoleManagementControllerGetCustomRolesSortOrder,
|
|
36
|
+
ScrymeAuthProvider,
|
|
36
37
|
ScrymeClientSDK,
|
|
37
38
|
ScrymeServerSDK,
|
|
38
39
|
ServicesUpdateBookingStatusBodyStatus,
|
|
@@ -63,8 +64,11 @@ import {
|
|
|
63
64
|
membersMapping,
|
|
64
65
|
methodsWithOrgSlugSet,
|
|
65
66
|
ordersMapping,
|
|
66
|
-
posMapping
|
|
67
|
-
|
|
67
|
+
posMapping,
|
|
68
|
+
publicServicesMapping,
|
|
69
|
+
servicesMapping,
|
|
70
|
+
useScrymeAuth
|
|
71
|
+
} from "./chunk-PPNV4D3M.mjs";
|
|
68
72
|
export {
|
|
69
73
|
AddDepartmentMemberDtoRole,
|
|
70
74
|
AttendanceControllerGetLogsSortOrder,
|
|
@@ -100,6 +104,7 @@ export {
|
|
|
100
104
|
RegisterPettyCashDtoPaymentMethod,
|
|
101
105
|
ReviewPriceChangeDtoStatus,
|
|
102
106
|
RoleManagementControllerGetCustomRolesSortOrder,
|
|
107
|
+
ScrymeAuthProvider,
|
|
103
108
|
ScrymeClientSDK,
|
|
104
109
|
ScrymeServerSDK,
|
|
105
110
|
ServicesUpdateBookingStatusBodyStatus,
|
|
@@ -130,5 +135,8 @@ export {
|
|
|
130
135
|
membersMapping,
|
|
131
136
|
methodsWithOrgSlugSet,
|
|
132
137
|
ordersMapping,
|
|
133
|
-
posMapping
|
|
138
|
+
posMapping,
|
|
139
|
+
publicServicesMapping,
|
|
140
|
+
servicesMapping,
|
|
141
|
+
useScrymeAuth
|
|
134
142
|
};
|
package/dist/server.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AxiosInstance } from 'axios';
|
|
2
|
-
import {
|
|
1
|
+
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
2
|
+
import { G as ProductResponseDto, K as ServiceCatalogResponseDto, cN as CartItemDto, b8 as CartResponseDto, af as CustomerResponseDto, 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, gH as ServicesModule, 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, a2 as CompleteBookingDto, ct as AuthModule, ag as RegisterCustomerDto, s as AuthExchangeToken201, dJ as CustomerAuthResponseDto } from './base-Cl7_QxqC.mjs';
|
|
3
3
|
|
|
4
4
|
interface ServerSDKConfig {
|
|
5
5
|
clientId: string;
|
|
@@ -9,10 +9,10 @@ interface ServerSDKConfig {
|
|
|
9
9
|
token?: string;
|
|
10
10
|
apiKey?: string;
|
|
11
11
|
}
|
|
12
|
-
declare class ScrymeServerSDK {
|
|
12
|
+
declare class ScrymeServerSDK<TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TUser = CustomerResponseDto, TSession = CustomerSessionDto> {
|
|
13
13
|
axiosInstance: AxiosInstance;
|
|
14
14
|
api: RawAPI;
|
|
15
|
-
catalog: CatalogModule
|
|
15
|
+
catalog: CatalogModule<TProduct, TService>;
|
|
16
16
|
inventory: InventoryModule;
|
|
17
17
|
orders: OrdersModule;
|
|
18
18
|
crm: CRMModule;
|
|
@@ -21,19 +21,58 @@ declare class ScrymeServerSDK {
|
|
|
21
21
|
loyalty: LoyaltyModule;
|
|
22
22
|
members: MembersModule;
|
|
23
23
|
admin: AdminModule;
|
|
24
|
+
services: ServicesModule;
|
|
25
|
+
cart: {
|
|
26
|
+
get<T = TCartResponse>(params?: CartControllerGetCartParams): Promise<AxiosResponse<T>>;
|
|
27
|
+
add(dto: AddToCartDto): Promise<AxiosResponse<void>>;
|
|
28
|
+
remove(dto: RemoveFromCartDto): Promise<AxiosResponse<void>>;
|
|
29
|
+
clear(params?: CartControllerClearCartParams): Promise<AxiosResponse<void>>;
|
|
30
|
+
update<T = TCartResponse>(dto: AddToCartDto & {
|
|
31
|
+
quantity: number;
|
|
32
|
+
}): Promise<AxiosResponse<void> | AxiosResponse<T> | undefined>;
|
|
33
|
+
getItems<T = TCartItem>(params?: CartControllerGetCartParams): Promise<T[]>;
|
|
34
|
+
getTotals<TItem = TCartItem, TRaw = TCartResponse>(params?: CartControllerGetCartParams): Promise<{
|
|
35
|
+
itemsCount: number;
|
|
36
|
+
items: TItem[];
|
|
37
|
+
raw: TRaw;
|
|
38
|
+
}>;
|
|
39
|
+
checkout(params: {
|
|
40
|
+
sessionId?: string;
|
|
41
|
+
customerId?: string;
|
|
42
|
+
locationId: string;
|
|
43
|
+
notes?: string;
|
|
44
|
+
channel?: string;
|
|
45
|
+
}): Promise<OrderResponseDto>;
|
|
46
|
+
};
|
|
47
|
+
customer: {
|
|
48
|
+
getProfile<T = TUser>(customerId: string): Promise<AxiosResponse<T>>;
|
|
49
|
+
updateProfile<T = TUser>(customerId: string, dto: UpdateCustomerDto): Promise<AxiosResponse<T>>;
|
|
50
|
+
getAddresses(customerId: string): Promise<AxiosResponse<AddressDto[]>>;
|
|
51
|
+
addAddress(customerId: string, dto: AddressDto): Promise<AxiosResponse<void>>;
|
|
52
|
+
};
|
|
53
|
+
bookings: {
|
|
54
|
+
create(dto: CreateBookingDto): Promise<AxiosResponse<void>>;
|
|
55
|
+
get(id: string): Promise<AxiosResponse<ServiceBookingItemDto>>;
|
|
56
|
+
list(): Promise<AxiosResponse<ServiceBookingItemDto[]>>;
|
|
57
|
+
cancel(id: string): Promise<AxiosResponse<void>>;
|
|
58
|
+
complete(id: string, dto: CompleteBookingDto & Record<string, any>): Promise<AxiosResponse<void>>;
|
|
59
|
+
};
|
|
24
60
|
auth: AuthModule & {
|
|
25
|
-
signUp(dto: RegisterCustomerDto): Promise<
|
|
26
|
-
authenticate(): Promise<
|
|
27
|
-
signIn(credentials: {
|
|
61
|
+
signUp<T = TUser>(dto: RegisterCustomerDto): Promise<AxiosResponse<T>>;
|
|
62
|
+
authenticate(): Promise<AuthExchangeToken201>;
|
|
63
|
+
signIn<TSess = TSession, TU = TUser>(credentials: {
|
|
28
64
|
email: string;
|
|
29
65
|
password?: string;
|
|
30
|
-
}): Promise<
|
|
66
|
+
}): Promise<CustomerAuthResponseDto<TU, TSess>>;
|
|
67
|
+
getCurrentSession<TU = TUser>(): Promise<TU>;
|
|
68
|
+
refreshSession<TSess = TSession, TU = TUser>(): Promise<CustomerAuthResponseDto<TU, TSess>>;
|
|
69
|
+
swapZitadel<TSess = TSession, TU = TUser>(zitadelToken: string): Promise<CustomerAuthResponseDto<TU, TSess>>;
|
|
31
70
|
};
|
|
32
71
|
private token;
|
|
33
72
|
private expiresAt;
|
|
34
73
|
private activeAuthPromise;
|
|
35
74
|
constructor(config: ServerSDKConfig);
|
|
36
75
|
}
|
|
37
|
-
declare function createServerSDK(config?: any): ScrymeServerSDK
|
|
76
|
+
declare function createServerSDK<TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TUser = CustomerResponseDto, TSession = CustomerSessionDto>(config?: any): ScrymeServerSDK<TProduct, TService, TCartItem, TCartResponse, TUser, TSession>;
|
|
38
77
|
|
|
39
78
|
export { ScrymeServerSDK, type ServerSDKConfig, createServerSDK };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AxiosInstance } from 'axios';
|
|
2
|
-
import {
|
|
1
|
+
import { AxiosInstance, AxiosResponse } from 'axios';
|
|
2
|
+
import { G as ProductResponseDto, K as ServiceCatalogResponseDto, cN as CartItemDto, b8 as CartResponseDto, af as CustomerResponseDto, 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, gH as ServicesModule, 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, a2 as CompleteBookingDto, ct as AuthModule, ag as RegisterCustomerDto, s as AuthExchangeToken201, dJ as CustomerAuthResponseDto } from './base-Cl7_QxqC.js';
|
|
3
3
|
|
|
4
4
|
interface ServerSDKConfig {
|
|
5
5
|
clientId: string;
|
|
@@ -9,10 +9,10 @@ interface ServerSDKConfig {
|
|
|
9
9
|
token?: string;
|
|
10
10
|
apiKey?: string;
|
|
11
11
|
}
|
|
12
|
-
declare class ScrymeServerSDK {
|
|
12
|
+
declare class ScrymeServerSDK<TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TUser = CustomerResponseDto, TSession = CustomerSessionDto> {
|
|
13
13
|
axiosInstance: AxiosInstance;
|
|
14
14
|
api: RawAPI;
|
|
15
|
-
catalog: CatalogModule
|
|
15
|
+
catalog: CatalogModule<TProduct, TService>;
|
|
16
16
|
inventory: InventoryModule;
|
|
17
17
|
orders: OrdersModule;
|
|
18
18
|
crm: CRMModule;
|
|
@@ -21,19 +21,58 @@ declare class ScrymeServerSDK {
|
|
|
21
21
|
loyalty: LoyaltyModule;
|
|
22
22
|
members: MembersModule;
|
|
23
23
|
admin: AdminModule;
|
|
24
|
+
services: ServicesModule;
|
|
25
|
+
cart: {
|
|
26
|
+
get<T = TCartResponse>(params?: CartControllerGetCartParams): Promise<AxiosResponse<T>>;
|
|
27
|
+
add(dto: AddToCartDto): Promise<AxiosResponse<void>>;
|
|
28
|
+
remove(dto: RemoveFromCartDto): Promise<AxiosResponse<void>>;
|
|
29
|
+
clear(params?: CartControllerClearCartParams): Promise<AxiosResponse<void>>;
|
|
30
|
+
update<T = TCartResponse>(dto: AddToCartDto & {
|
|
31
|
+
quantity: number;
|
|
32
|
+
}): Promise<AxiosResponse<void> | AxiosResponse<T> | undefined>;
|
|
33
|
+
getItems<T = TCartItem>(params?: CartControllerGetCartParams): Promise<T[]>;
|
|
34
|
+
getTotals<TItem = TCartItem, TRaw = TCartResponse>(params?: CartControllerGetCartParams): Promise<{
|
|
35
|
+
itemsCount: number;
|
|
36
|
+
items: TItem[];
|
|
37
|
+
raw: TRaw;
|
|
38
|
+
}>;
|
|
39
|
+
checkout(params: {
|
|
40
|
+
sessionId?: string;
|
|
41
|
+
customerId?: string;
|
|
42
|
+
locationId: string;
|
|
43
|
+
notes?: string;
|
|
44
|
+
channel?: string;
|
|
45
|
+
}): Promise<OrderResponseDto>;
|
|
46
|
+
};
|
|
47
|
+
customer: {
|
|
48
|
+
getProfile<T = TUser>(customerId: string): Promise<AxiosResponse<T>>;
|
|
49
|
+
updateProfile<T = TUser>(customerId: string, dto: UpdateCustomerDto): Promise<AxiosResponse<T>>;
|
|
50
|
+
getAddresses(customerId: string): Promise<AxiosResponse<AddressDto[]>>;
|
|
51
|
+
addAddress(customerId: string, dto: AddressDto): Promise<AxiosResponse<void>>;
|
|
52
|
+
};
|
|
53
|
+
bookings: {
|
|
54
|
+
create(dto: CreateBookingDto): Promise<AxiosResponse<void>>;
|
|
55
|
+
get(id: string): Promise<AxiosResponse<ServiceBookingItemDto>>;
|
|
56
|
+
list(): Promise<AxiosResponse<ServiceBookingItemDto[]>>;
|
|
57
|
+
cancel(id: string): Promise<AxiosResponse<void>>;
|
|
58
|
+
complete(id: string, dto: CompleteBookingDto & Record<string, any>): Promise<AxiosResponse<void>>;
|
|
59
|
+
};
|
|
24
60
|
auth: AuthModule & {
|
|
25
|
-
signUp(dto: RegisterCustomerDto): Promise<
|
|
26
|
-
authenticate(): Promise<
|
|
27
|
-
signIn(credentials: {
|
|
61
|
+
signUp<T = TUser>(dto: RegisterCustomerDto): Promise<AxiosResponse<T>>;
|
|
62
|
+
authenticate(): Promise<AuthExchangeToken201>;
|
|
63
|
+
signIn<TSess = TSession, TU = TUser>(credentials: {
|
|
28
64
|
email: string;
|
|
29
65
|
password?: string;
|
|
30
|
-
}): Promise<
|
|
66
|
+
}): Promise<CustomerAuthResponseDto<TU, TSess>>;
|
|
67
|
+
getCurrentSession<TU = TUser>(): Promise<TU>;
|
|
68
|
+
refreshSession<TSess = TSession, TU = TUser>(): Promise<CustomerAuthResponseDto<TU, TSess>>;
|
|
69
|
+
swapZitadel<TSess = TSession, TU = TUser>(zitadelToken: string): Promise<CustomerAuthResponseDto<TU, TSess>>;
|
|
31
70
|
};
|
|
32
71
|
private token;
|
|
33
72
|
private expiresAt;
|
|
34
73
|
private activeAuthPromise;
|
|
35
74
|
constructor(config: ServerSDKConfig);
|
|
36
75
|
}
|
|
37
|
-
declare function createServerSDK(config?: any): ScrymeServerSDK
|
|
76
|
+
declare function createServerSDK<TProduct = ProductResponseDto, TService = ServiceCatalogResponseDto, TCartItem = CartItemDto, TCartResponse = CartResponseDto, TUser = CustomerResponseDto, TSession = CustomerSessionDto>(config?: any): ScrymeServerSDK<TProduct, TService, TCartItem, TCartResponse, TUser, TSession>;
|
|
38
77
|
|
|
39
78
|
export { ScrymeServerSDK, type ServerSDKConfig, createServerSDK };
|