@classytic/commerce-sdk 0.1.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.
Potentially problematic release.
This version of @classytic/commerce-sdk might be problematic. Click here for more details.
- package/LICENSE +14 -0
- package/README.md +104 -0
- package/dist/adjustment-DTSLM7AN.js +5 -0
- package/dist/adjustment-DTSLM7AN.js.map +1 -0
- package/dist/analytics/index.d.ts +27 -0
- package/dist/analytics/index.js +6 -0
- package/dist/analytics/index.js.map +1 -0
- package/dist/analytics-DMcD-o8w.d.ts +76 -0
- package/dist/api-factory-B_h4RKBm.d.ts +280 -0
- package/dist/auth/index.d.ts +39 -0
- package/dist/auth/index.js +5 -0
- package/dist/auth/index.js.map +1 -0
- package/dist/catalog/index.d.ts +479 -0
- package/dist/catalog/index.js +9 -0
- package/dist/catalog/index.js.map +1 -0
- package/dist/chunk-4ZQK3FFN.js +40 -0
- package/dist/chunk-4ZQK3FFN.js.map +1 -0
- package/dist/chunk-5L6EXDGH.js +465 -0
- package/dist/chunk-5L6EXDGH.js.map +1 -0
- package/dist/chunk-5ZFW3FEI.js +183 -0
- package/dist/chunk-5ZFW3FEI.js.map +1 -0
- package/dist/chunk-66OQAZSL.js +94 -0
- package/dist/chunk-66OQAZSL.js.map +1 -0
- package/dist/chunk-6RYGA6MF.js +123 -0
- package/dist/chunk-6RYGA6MF.js.map +1 -0
- package/dist/chunk-B6MPVOV7.js +328 -0
- package/dist/chunk-B6MPVOV7.js.map +1 -0
- package/dist/chunk-BDA2WSJA.js +148 -0
- package/dist/chunk-BDA2WSJA.js.map +1 -0
- package/dist/chunk-EIVYT3HM.js +126 -0
- package/dist/chunk-EIVYT3HM.js.map +1 -0
- package/dist/chunk-EPQN7ZKZ.js +27 -0
- package/dist/chunk-EPQN7ZKZ.js.map +1 -0
- package/dist/chunk-FA7QFJ2G.js +177 -0
- package/dist/chunk-FA7QFJ2G.js.map +1 -0
- package/dist/chunk-I5TIKUIQ.js +261 -0
- package/dist/chunk-I5TIKUIQ.js.map +1 -0
- package/dist/chunk-ILQUH444.js +135 -0
- package/dist/chunk-ILQUH444.js.map +1 -0
- package/dist/chunk-IXMWZJLV.js +616 -0
- package/dist/chunk-IXMWZJLV.js.map +1 -0
- package/dist/chunk-KZIGRIQG.js +75 -0
- package/dist/chunk-KZIGRIQG.js.map +1 -0
- package/dist/chunk-OF5M6R2S.js +769 -0
- package/dist/chunk-OF5M6R2S.js.map +1 -0
- package/dist/chunk-PYYLHUV6.js +3 -0
- package/dist/chunk-PYYLHUV6.js.map +1 -0
- package/dist/chunk-QO5AGZFP.js +159 -0
- package/dist/chunk-QO5AGZFP.js.map +1 -0
- package/dist/chunk-QUMTBLNE.js +76 -0
- package/dist/chunk-QUMTBLNE.js.map +1 -0
- package/dist/chunk-R5Z7NYLH.js +126 -0
- package/dist/chunk-R5Z7NYLH.js.map +1 -0
- package/dist/chunk-SZYWG5IB.js +75 -0
- package/dist/chunk-SZYWG5IB.js.map +1 -0
- package/dist/chunk-U3XT35GZ.js +202 -0
- package/dist/chunk-U3XT35GZ.js.map +1 -0
- package/dist/chunk-UGELTUIZ.js +830 -0
- package/dist/chunk-UGELTUIZ.js.map +1 -0
- package/dist/chunk-VR36QVX2.js +122 -0
- package/dist/chunk-VR36QVX2.js.map +1 -0
- package/dist/chunk-WUOQK7BO.js +13 -0
- package/dist/chunk-WUOQK7BO.js.map +1 -0
- package/dist/chunk-X6PV5MHG.js +582 -0
- package/dist/chunk-X6PV5MHG.js.map +1 -0
- package/dist/chunk-ZWLMFLLH.js +534 -0
- package/dist/chunk-ZWLMFLLH.js.map +1 -0
- package/dist/content/index.d.ts +309 -0
- package/dist/content/index.js +6 -0
- package/dist/content/index.js.map +1 -0
- package/dist/core/index.d.ts +107 -0
- package/dist/core/index.js +5 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/react.d.ts +107 -0
- package/dist/core/react.js +5 -0
- package/dist/core/react.js.map +1 -0
- package/dist/coupon-CHFcw7cd.d.ts +632 -0
- package/dist/coupon-zGkvO-Xx.d.ts +129 -0
- package/dist/crud.factory-DyKaPHcU.d.ts +181 -0
- package/dist/finance/index.d.ts +81 -0
- package/dist/finance/index.js +5 -0
- package/dist/finance/index.js.map +1 -0
- package/dist/finance-BJdfKRw0.d.ts +135 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -0
- package/dist/inventory/index.d.ts +512 -0
- package/dist/inventory/index.js +16 -0
- package/dist/inventory/index.js.map +1 -0
- package/dist/inventory-DCiIZh8P.d.ts +742 -0
- package/dist/logistics/index.d.ts +226 -0
- package/dist/logistics/index.js +7 -0
- package/dist/logistics/index.js.map +1 -0
- package/dist/logistics-V8a9lUN3.d.ts +428 -0
- package/dist/media-CNLJK93J.d.ts +721 -0
- package/dist/movement-7MV3ADY5.js +5 -0
- package/dist/movement-7MV3ADY5.js.map +1 -0
- package/dist/payment-BRboLqvU.d.ts +127 -0
- package/dist/payments/index.d.ts +55 -0
- package/dist/payments/index.js +6 -0
- package/dist/payments/index.js.map +1 -0
- package/dist/platform/index.d.ts +645 -0
- package/dist/platform/index.js +8 -0
- package/dist/platform/index.js.map +1 -0
- package/dist/pos-D1jkkFl0.d.ts +885 -0
- package/dist/product-p09zXkXB.d.ts +260 -0
- package/dist/purchase-24BGT2HA.js +5 -0
- package/dist/purchase-24BGT2HA.js.map +1 -0
- package/dist/request-652PS6VR.js +5 -0
- package/dist/request-652PS6VR.js.map +1 -0
- package/dist/sales/index.d.ts +585 -0
- package/dist/sales/index.js +9 -0
- package/dist/sales/index.js.map +1 -0
- package/dist/server.d.ts +120 -0
- package/dist/server.js +27 -0
- package/dist/server.js.map +1 -0
- package/dist/size-guide-DgjzjM5P.d.ts +554 -0
- package/dist/stock-DEApGC-w.d.ts +632 -0
- package/dist/stock-OOUW57VQ.js +5 -0
- package/dist/stock-OOUW57VQ.js.map +1 -0
- package/dist/supplier-OC6JAWV6.js +5 -0
- package/dist/supplier-OC6JAWV6.js.map +1 -0
- package/dist/transaction/index.d.ts +104 -0
- package/dist/transaction/index.js +8 -0
- package/dist/transaction/index.js.map +1 -0
- package/dist/transaction-BTmoHpWh.d.ts +428 -0
- package/dist/transaction-u5oaNuav.d.ts +84 -0
- package/dist/transfer-7SYSH3RG.js +5 -0
- package/dist/transfer-7SYSH3RG.js.map +1 -0
- package/dist/user-data-DdLjAGwO.d.ts +132 -0
- package/package.json +146 -0
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { k as QueryKeys, b as CrudHooksReturn, L as ListOptions, l as ListQueryResult, D as DetailOptions, m as DetailQueryResult, d as CrudActions, N as NavigateFn } from './crud.factory-DyKaPHcU.js';
|
|
2
|
+
import { I as PlatformConfig, J as UpdatePlatformConfigPayload, R as PaymentMethodConfig, Q as CheckoutSettings, H as MembershipConfig, g as Branch, h as CreateBranchPayload, j as UpdateBranchPayload, T as User, n as CreateUserPayload, o as UpdateUserPayload, r as Coupon, t as CreateCouponPayload } from './coupon-CHFcw7cd.js';
|
|
3
|
+
|
|
4
|
+
declare const PLATFORM_KEYS: QueryKeys;
|
|
5
|
+
interface UsePlatformConfigReturn {
|
|
6
|
+
config: PlatformConfig | undefined;
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
isError: boolean;
|
|
9
|
+
error: Error | null;
|
|
10
|
+
refetch: () => void;
|
|
11
|
+
}
|
|
12
|
+
interface UsePaymentMethodsReturn {
|
|
13
|
+
paymentMethods: PaymentMethodConfig[];
|
|
14
|
+
isLoading: boolean;
|
|
15
|
+
isError: boolean;
|
|
16
|
+
error: Error | null;
|
|
17
|
+
refetch: () => void;
|
|
18
|
+
}
|
|
19
|
+
interface UseDeliveryZonesReturn {
|
|
20
|
+
deliveryZones: CheckoutSettings["deliveryZones"];
|
|
21
|
+
freeDeliveryThreshold: number;
|
|
22
|
+
allowStorePickup: boolean;
|
|
23
|
+
pickupBranches: CheckoutSettings["pickupBranches"];
|
|
24
|
+
isLoading: boolean;
|
|
25
|
+
isError: boolean;
|
|
26
|
+
error: Error | null;
|
|
27
|
+
refetch: () => void;
|
|
28
|
+
}
|
|
29
|
+
interface UseMembershipConfigReturn {
|
|
30
|
+
membership: MembershipConfig | null | undefined;
|
|
31
|
+
isLoading: boolean;
|
|
32
|
+
isError: boolean;
|
|
33
|
+
error: Error | null;
|
|
34
|
+
refetch: () => void;
|
|
35
|
+
}
|
|
36
|
+
interface UseUpdatePlatformConfigReturn {
|
|
37
|
+
updateConfig: (data: UpdatePlatformConfigPayload) => Promise<PlatformConfig | undefined>;
|
|
38
|
+
isUpdating: boolean;
|
|
39
|
+
error: Error | null;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Hook to fetch platform configuration
|
|
43
|
+
*
|
|
44
|
+
* @param token - Optional auth token (public access without, authenticated with)
|
|
45
|
+
* @param select - Optional field selection (e.g., "paymentMethods", "checkout,vat")
|
|
46
|
+
* @returns Platform config with loading/error states
|
|
47
|
+
*/
|
|
48
|
+
declare function usePlatformConfig(token?: string | null, select?: string | null): UsePlatformConfigReturn;
|
|
49
|
+
/**
|
|
50
|
+
* Hook to update platform configuration
|
|
51
|
+
*
|
|
52
|
+
* @param token - Admin auth token (required)
|
|
53
|
+
* @returns Mutation function with loading state
|
|
54
|
+
*/
|
|
55
|
+
declare function useUpdatePlatformConfig(token: string): UseUpdatePlatformConfigReturn;
|
|
56
|
+
/**
|
|
57
|
+
* Hook to fetch payment methods only
|
|
58
|
+
* Convenience hook for checkout/POS
|
|
59
|
+
*
|
|
60
|
+
* @param token - Optional auth token
|
|
61
|
+
* @returns Payment methods with loading state
|
|
62
|
+
*/
|
|
63
|
+
declare function usePaymentMethods(token?: string | null): UsePaymentMethodsReturn;
|
|
64
|
+
/**
|
|
65
|
+
* Hook to fetch delivery zones and checkout settings
|
|
66
|
+
* Convenience hook for checkout flow
|
|
67
|
+
*
|
|
68
|
+
* @param token - Optional auth token
|
|
69
|
+
* @returns Delivery zones and checkout settings
|
|
70
|
+
*/
|
|
71
|
+
declare function useDeliveryZones(token?: string | null): UseDeliveryZonesReturn;
|
|
72
|
+
/**
|
|
73
|
+
* Hook to fetch membership config only
|
|
74
|
+
* Convenience hook for loyalty programs
|
|
75
|
+
*
|
|
76
|
+
* @param token - Optional auth token
|
|
77
|
+
* @returns Membership configuration
|
|
78
|
+
*/
|
|
79
|
+
declare function useMembershipConfig(token?: string | null): UseMembershipConfigReturn;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Branch hooks using createCrudHooks factory
|
|
83
|
+
*
|
|
84
|
+
* Provides:
|
|
85
|
+
* - useBranches: List branches with filtering/pagination
|
|
86
|
+
* - useBranchDetail: Get single branch
|
|
87
|
+
* - useBranchActions: Create, update, delete mutations
|
|
88
|
+
* - useBranchNavigation: Navigation between branches
|
|
89
|
+
*/
|
|
90
|
+
declare const branchHooks: CrudHooksReturn<Branch, CreateBranchPayload, UpdateBranchPayload>;
|
|
91
|
+
declare const BRANCH_KEYS: QueryKeys;
|
|
92
|
+
declare const useBranches: (token: string | null, params?: Record<string, unknown>, options?: ListOptions) => ListQueryResult<Branch>;
|
|
93
|
+
declare const useBranchDetail: (id: string | null, token: string | null, options?: DetailOptions) => DetailQueryResult<Branch>;
|
|
94
|
+
declare const useBranchActions: () => CrudActions<CreateBranchPayload, UpdateBranchPayload>;
|
|
95
|
+
declare const useBranchNavigation: () => NavigateFn<Branch>;
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* User hooks using createCrudHooks factory
|
|
99
|
+
*
|
|
100
|
+
* Provides:
|
|
101
|
+
* - useUsers: List users with filtering/pagination
|
|
102
|
+
* - useUserDetail: Get single user
|
|
103
|
+
* - useUserActions: Create, update, delete mutations
|
|
104
|
+
* - useUserNavigation: Navigation between users
|
|
105
|
+
*/
|
|
106
|
+
declare const userHooks: CrudHooksReturn<User, CreateUserPayload, UpdateUserPayload>;
|
|
107
|
+
declare const USER_KEYS: QueryKeys;
|
|
108
|
+
declare const useUsers: (token: string | null, params?: Record<string, unknown>, options?: ListOptions) => ListQueryResult<User>;
|
|
109
|
+
declare const useUserDetail: (id: string | null, token: string | null, options?: DetailOptions) => DetailQueryResult<User>;
|
|
110
|
+
declare const useUserActions: () => CrudActions<CreateUserPayload, UpdateUserPayload>;
|
|
111
|
+
declare const useUserNavigation: () => NavigateFn<User>;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Coupon hooks using createCrudHooks factory
|
|
115
|
+
*
|
|
116
|
+
* Provides:
|
|
117
|
+
* - useCoupons: List coupons with filtering/pagination
|
|
118
|
+
* - useCouponDetail: Get single coupon
|
|
119
|
+
* - useCouponActions: Create, update, delete mutations
|
|
120
|
+
* - useCouponNavigation: Navigation between coupons
|
|
121
|
+
*/
|
|
122
|
+
declare const couponHooks: CrudHooksReturn<Coupon, CreateCouponPayload, Partial<CreateCouponPayload>>;
|
|
123
|
+
declare const COUPON_KEYS: QueryKeys;
|
|
124
|
+
declare const useCoupons: (token: string | null, params?: Record<string, unknown>, options?: ListOptions) => ListQueryResult<Coupon>;
|
|
125
|
+
declare const useCouponDetail: (id: string | null, token: string | null, options?: DetailOptions) => DetailQueryResult<Coupon>;
|
|
126
|
+
declare const useCouponActions: () => CrudActions<CreateCouponPayload, Partial<CreateCouponPayload>>;
|
|
127
|
+
declare const useCouponNavigation: () => NavigateFn<Coupon>;
|
|
128
|
+
|
|
129
|
+
export { BRANCH_KEYS as B, COUPON_KEYS as C, PLATFORM_KEYS as P, USER_KEYS as U, useUpdatePlatformConfig as a, usePaymentMethods as b, useDeliveryZones as c, useMembershipConfig as d, branchHooks as e, useBranches as f, useBranchDetail as g, useBranchActions as h, useBranchNavigation as i, userHooks as j, useUsers as k, useUserDetail as l, useUserActions as m, useUserNavigation as n, couponHooks as o, useCoupons as p, useCouponDetail as q, useCouponActions as r, useCouponNavigation as s, type UsePlatformConfigReturn as t, usePlatformConfig as u, type UsePaymentMethodsReturn as v, type UseDeliveryZonesReturn as w, type UseMembershipConfigReturn as x, type UseUpdatePlatformConfigReturn as y };
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { QueryKey } from '@tanstack/react-query';
|
|
2
|
+
|
|
3
|
+
interface QueryConfig {
|
|
4
|
+
staleTime: number;
|
|
5
|
+
gcTime: number;
|
|
6
|
+
refetchOnWindowFocus: boolean;
|
|
7
|
+
retry: number;
|
|
8
|
+
}
|
|
9
|
+
declare const DEFAULT_QUERY_CONFIG: QueryConfig;
|
|
10
|
+
interface PaginationData {
|
|
11
|
+
total: number;
|
|
12
|
+
pages: number;
|
|
13
|
+
page: number;
|
|
14
|
+
limit: number;
|
|
15
|
+
hasNext: boolean;
|
|
16
|
+
hasPrev: boolean;
|
|
17
|
+
totalDocs: number;
|
|
18
|
+
totalPages: number;
|
|
19
|
+
currentPage: number;
|
|
20
|
+
hasNextPage: boolean;
|
|
21
|
+
hasPrevPage: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface ListQueryResult<T> {
|
|
24
|
+
items: T[];
|
|
25
|
+
pagination: PaginationData | null;
|
|
26
|
+
isLoading: boolean;
|
|
27
|
+
isFetching: boolean;
|
|
28
|
+
isError: boolean;
|
|
29
|
+
error: Error | null;
|
|
30
|
+
refetch: () => void;
|
|
31
|
+
data: unknown;
|
|
32
|
+
}
|
|
33
|
+
interface DetailQueryResult<T> {
|
|
34
|
+
item: T | null;
|
|
35
|
+
isLoading: boolean;
|
|
36
|
+
isFetching: boolean;
|
|
37
|
+
isError: boolean;
|
|
38
|
+
error: Error | null;
|
|
39
|
+
refetch: () => void;
|
|
40
|
+
data: unknown;
|
|
41
|
+
}
|
|
42
|
+
interface CreateListQueryOptions<T> {
|
|
43
|
+
queryKey: QueryKey;
|
|
44
|
+
queryFn: () => Promise<unknown>;
|
|
45
|
+
enabled?: boolean;
|
|
46
|
+
options?: Record<string, unknown>;
|
|
47
|
+
prefillDetailCache?: boolean;
|
|
48
|
+
detailKeyBuilder?: (id: string) => QueryKey;
|
|
49
|
+
}
|
|
50
|
+
declare function createListQuery<T>({ queryKey, queryFn, enabled, options, prefillDetailCache, detailKeyBuilder, }: CreateListQueryOptions<T>): ListQueryResult<T>;
|
|
51
|
+
interface CreateDetailQueryOptions {
|
|
52
|
+
queryKey: QueryKey;
|
|
53
|
+
queryFn: () => Promise<unknown>;
|
|
54
|
+
enabled?: boolean;
|
|
55
|
+
options?: Record<string, unknown>;
|
|
56
|
+
}
|
|
57
|
+
declare function createDetailQuery<T>({ queryKey, queryFn, enabled, options, }: CreateDetailQueryOptions): DetailQueryResult<T>;
|
|
58
|
+
declare function updateListCache<T>(listData: unknown, updater: (arr: T[]) => T[]): unknown;
|
|
59
|
+
declare function getItemId(item: unknown): string | null;
|
|
60
|
+
interface QueryKeys {
|
|
61
|
+
all: string[];
|
|
62
|
+
lists: () => QueryKey;
|
|
63
|
+
list: (params: unknown) => QueryKey;
|
|
64
|
+
details: () => QueryKey;
|
|
65
|
+
detail: (id: string) => QueryKey;
|
|
66
|
+
custom: (key: string) => QueryKey;
|
|
67
|
+
scopedList: (scope: string, params: unknown) => QueryKey;
|
|
68
|
+
}
|
|
69
|
+
declare function createQueryKeys(entityKey: string): QueryKeys;
|
|
70
|
+
|
|
71
|
+
interface CrudApi<T, TCreate, TUpdate> {
|
|
72
|
+
getAll: (options: {
|
|
73
|
+
token?: string | null;
|
|
74
|
+
organizationId?: string | null;
|
|
75
|
+
params?: Record<string, unknown>;
|
|
76
|
+
}) => Promise<unknown>;
|
|
77
|
+
getById: (options: {
|
|
78
|
+
id: string;
|
|
79
|
+
token?: string | null;
|
|
80
|
+
organizationId?: string | null;
|
|
81
|
+
}) => Promise<unknown>;
|
|
82
|
+
create: (options: {
|
|
83
|
+
token?: string | null;
|
|
84
|
+
organizationId?: string | null;
|
|
85
|
+
data: TCreate;
|
|
86
|
+
}) => Promise<T>;
|
|
87
|
+
update: (options: {
|
|
88
|
+
token?: string | null;
|
|
89
|
+
organizationId?: string | null;
|
|
90
|
+
id: string;
|
|
91
|
+
data: TUpdate;
|
|
92
|
+
}) => Promise<T>;
|
|
93
|
+
delete: (options: {
|
|
94
|
+
token?: string | null;
|
|
95
|
+
organizationId?: string | null;
|
|
96
|
+
id: string;
|
|
97
|
+
}) => Promise<unknown>;
|
|
98
|
+
}
|
|
99
|
+
interface CrudHooksConfig<T, TCreate, TUpdate> {
|
|
100
|
+
api: CrudApi<T, TCreate, TUpdate>;
|
|
101
|
+
entityKey: string;
|
|
102
|
+
singular: string;
|
|
103
|
+
plural: string;
|
|
104
|
+
defaults?: {
|
|
105
|
+
staleTime?: number;
|
|
106
|
+
gcTime?: number;
|
|
107
|
+
refetchOnWindowFocus?: boolean;
|
|
108
|
+
structuralSharing?: boolean;
|
|
109
|
+
messages?: {
|
|
110
|
+
createSuccess?: string;
|
|
111
|
+
createError?: string;
|
|
112
|
+
updateSuccess?: string;
|
|
113
|
+
updateError?: string;
|
|
114
|
+
deleteSuccess?: string;
|
|
115
|
+
deleteError?: string;
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
interface ListOptions {
|
|
120
|
+
public?: boolean;
|
|
121
|
+
enabled?: boolean;
|
|
122
|
+
staleTime?: number;
|
|
123
|
+
gcTime?: number;
|
|
124
|
+
refetchOnWindowFocus?: boolean;
|
|
125
|
+
structuralSharing?: boolean;
|
|
126
|
+
prefillDetailCache?: boolean;
|
|
127
|
+
_scope?: string;
|
|
128
|
+
[key: string]: unknown;
|
|
129
|
+
}
|
|
130
|
+
interface DetailOptions {
|
|
131
|
+
organizationId?: string | null;
|
|
132
|
+
enabled?: boolean;
|
|
133
|
+
staleTime?: number;
|
|
134
|
+
gcTime?: number;
|
|
135
|
+
structuralSharing?: boolean;
|
|
136
|
+
refetchInterval?: number;
|
|
137
|
+
refetchIntervalInBackground?: boolean;
|
|
138
|
+
[key: string]: unknown;
|
|
139
|
+
}
|
|
140
|
+
interface CrudActions<TCreate, TUpdate> {
|
|
141
|
+
create: (params: {
|
|
142
|
+
token?: string | null;
|
|
143
|
+
organizationId?: string | null;
|
|
144
|
+
data: TCreate;
|
|
145
|
+
}) => Promise<unknown>;
|
|
146
|
+
update: (params: {
|
|
147
|
+
token?: string | null;
|
|
148
|
+
organizationId?: string | null;
|
|
149
|
+
id: string;
|
|
150
|
+
data: TUpdate;
|
|
151
|
+
}) => Promise<unknown>;
|
|
152
|
+
remove: (params: {
|
|
153
|
+
token?: string | null;
|
|
154
|
+
organizationId?: string | null;
|
|
155
|
+
id: string;
|
|
156
|
+
}) => Promise<unknown>;
|
|
157
|
+
updateOnly: (params: {
|
|
158
|
+
token?: string | null;
|
|
159
|
+
organizationId?: string | null;
|
|
160
|
+
id: string;
|
|
161
|
+
data: TUpdate;
|
|
162
|
+
}) => Promise<unknown>;
|
|
163
|
+
isCreating: boolean;
|
|
164
|
+
isUpdating: boolean;
|
|
165
|
+
isDeleting: boolean;
|
|
166
|
+
}
|
|
167
|
+
interface NavigationOptions {
|
|
168
|
+
scroll?: boolean;
|
|
169
|
+
replace?: boolean;
|
|
170
|
+
}
|
|
171
|
+
type NavigateFn<T> = (href: string, item: T, options?: NavigationOptions) => void;
|
|
172
|
+
interface CrudHooksReturn<T, TCreate, TUpdate> {
|
|
173
|
+
KEYS: QueryKeys;
|
|
174
|
+
useList: (token: string | null, params?: Record<string, unknown>, options?: ListOptions) => ListQueryResult<T>;
|
|
175
|
+
useDetail: (id: string | null, token: string | null, options?: DetailOptions) => DetailQueryResult<T>;
|
|
176
|
+
useActions: () => CrudActions<TCreate, TUpdate>;
|
|
177
|
+
useNavigation: () => NavigateFn<T>;
|
|
178
|
+
}
|
|
179
|
+
declare function createCrudHooks<T, TCreate = Partial<T>, TUpdate = Partial<T>>({ api, entityKey, singular, plural, defaults, }: CrudHooksConfig<T, TCreate, TUpdate>): CrudHooksReturn<T, TCreate, TUpdate>;
|
|
180
|
+
|
|
181
|
+
export { type CrudApi as C, type DetailOptions as D, type ListOptions as L, type NavigateFn as N, type PaginationData as P, type QueryConfig as Q, type CrudHooksConfig as a, type CrudHooksReturn as b, createCrudHooks as c, type CrudActions as d, type NavigationOptions as e, createListQuery as f, createDetailQuery as g, createQueryKeys as h, getItemId as i, DEFAULT_QUERY_CONFIG as j, type QueryKeys as k, type ListQueryResult as l, type DetailQueryResult as m, type CreateListQueryOptions as n, type CreateDetailQueryOptions as o, updateListCache as u };
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { b as FinanceStatementParams, h as FinanceSummaryParams, a as FinanceStatement, g as FinanceSummary } from '../finance-BJdfKRw0.js';
|
|
2
|
+
export { F as FinanceApi, e as FinanceByDay, d as FinanceByMethod, c as FinanceTotals, f as financeApi } from '../finance-BJdfKRw0.js';
|
|
3
|
+
import '../api-factory-B_h4RKBm.js';
|
|
4
|
+
|
|
5
|
+
declare const FINANCE_KEYS: {
|
|
6
|
+
all: readonly ["finance"];
|
|
7
|
+
statements: () => readonly ["finance", "statements"];
|
|
8
|
+
statementList: (params: FinanceStatementParams) => readonly ["finance", "statements", FinanceStatementParams];
|
|
9
|
+
summary: () => readonly ["finance", "summary"];
|
|
10
|
+
summaryData: (params: FinanceSummaryParams) => readonly ["finance", "summary", FinanceSummaryParams];
|
|
11
|
+
};
|
|
12
|
+
interface QueryOptions {
|
|
13
|
+
enabled?: boolean;
|
|
14
|
+
staleTime?: number;
|
|
15
|
+
}
|
|
16
|
+
interface UseFinanceStatementsReturn {
|
|
17
|
+
statements: FinanceStatement[];
|
|
18
|
+
isLoading: boolean;
|
|
19
|
+
isFetching: boolean;
|
|
20
|
+
error: Error | null;
|
|
21
|
+
refetch: () => void;
|
|
22
|
+
}
|
|
23
|
+
interface UseFinanceSummaryReturn {
|
|
24
|
+
summary: FinanceSummary | null;
|
|
25
|
+
totals: FinanceSummary["totals"] | null;
|
|
26
|
+
byMethod: FinanceSummary["byMethod"];
|
|
27
|
+
byDay: FinanceSummary["byDay"];
|
|
28
|
+
isLoading: boolean;
|
|
29
|
+
isFetching: boolean;
|
|
30
|
+
error: Error | null;
|
|
31
|
+
refetch: () => void;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Fetch finance statements for a date range
|
|
35
|
+
*
|
|
36
|
+
* @param token - Auth token (admin/finance roles)
|
|
37
|
+
* @param params - Query parameters (startDate, endDate required)
|
|
38
|
+
* @param options - Query options
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```tsx
|
|
42
|
+
* function StatementTable() {
|
|
43
|
+
* const { statements, isLoading } = useFinanceStatements(token, {
|
|
44
|
+
* startDate: '2024-01-01T00:00:00Z',
|
|
45
|
+
* endDate: '2024-01-31T23:59:59Z',
|
|
46
|
+
* branchId: selectedBranch,
|
|
47
|
+
* });
|
|
48
|
+
*
|
|
49
|
+
* return <DataTable data={statements} loading={isLoading} />;
|
|
50
|
+
* }
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
declare function useFinanceStatements(token: string, params: FinanceStatementParams, options?: QueryOptions): UseFinanceStatementsReturn;
|
|
54
|
+
/**
|
|
55
|
+
* Fetch finance summary with breakdowns
|
|
56
|
+
*
|
|
57
|
+
* @param token - Auth token (admin/finance roles)
|
|
58
|
+
* @param params - Query parameters (startDate, endDate required)
|
|
59
|
+
* @param options - Query options
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```tsx
|
|
63
|
+
* function FinanceDashboard() {
|
|
64
|
+
* const { totals, byMethod, byDay, isLoading } = useFinanceSummary(token, {
|
|
65
|
+
* startDate: '2024-01-01T00:00:00Z',
|
|
66
|
+
* endDate: '2024-01-31T23:59:59Z',
|
|
67
|
+
* });
|
|
68
|
+
*
|
|
69
|
+
* return (
|
|
70
|
+
* <>
|
|
71
|
+
* <SummaryCards totals={totals} />
|
|
72
|
+
* <MethodBreakdown data={byMethod} />
|
|
73
|
+
* <DailyChart data={byDay} />
|
|
74
|
+
* </>
|
|
75
|
+
* );
|
|
76
|
+
* }
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
declare function useFinanceSummary(token: string, params: FinanceSummaryParams, options?: QueryOptions): UseFinanceSummaryReturn;
|
|
80
|
+
|
|
81
|
+
export { FINANCE_KEYS, FinanceStatement, FinanceStatementParams, FinanceSummary, FinanceSummaryParams, type UseFinanceStatementsReturn, type UseFinanceSummaryReturn, useFinanceStatements, useFinanceSummary };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { R as RequestOptions, A as ApiResponse } from './api-factory-B_h4RKBm.js';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Finance Types
|
|
5
|
+
*
|
|
6
|
+
* Types for finance statements, summaries, and exports
|
|
7
|
+
*/
|
|
8
|
+
interface FinanceStatement {
|
|
9
|
+
_id: string;
|
|
10
|
+
date: string;
|
|
11
|
+
branchId?: string;
|
|
12
|
+
branchCode?: string;
|
|
13
|
+
branchName?: string;
|
|
14
|
+
type: 'income' | 'expense';
|
|
15
|
+
amount: number;
|
|
16
|
+
currency: string;
|
|
17
|
+
method: string;
|
|
18
|
+
source: 'web' | 'pos' | 'api';
|
|
19
|
+
status: string;
|
|
20
|
+
invoiceNumber?: string;
|
|
21
|
+
paymentReference?: string;
|
|
22
|
+
orderReference?: {
|
|
23
|
+
model: string;
|
|
24
|
+
id: string;
|
|
25
|
+
};
|
|
26
|
+
description?: string;
|
|
27
|
+
createdAt: string;
|
|
28
|
+
}
|
|
29
|
+
interface FinanceStatementParams {
|
|
30
|
+
startDate: string;
|
|
31
|
+
endDate: string;
|
|
32
|
+
branchId?: string;
|
|
33
|
+
source?: 'web' | 'pos' | 'api';
|
|
34
|
+
status?: string;
|
|
35
|
+
format?: 'csv' | 'json';
|
|
36
|
+
page?: number;
|
|
37
|
+
limit?: number;
|
|
38
|
+
}
|
|
39
|
+
interface FinanceTotals {
|
|
40
|
+
income: number;
|
|
41
|
+
expense: number;
|
|
42
|
+
net: number;
|
|
43
|
+
count: number;
|
|
44
|
+
currency: string;
|
|
45
|
+
}
|
|
46
|
+
interface FinanceByMethod {
|
|
47
|
+
method: string;
|
|
48
|
+
income: number;
|
|
49
|
+
expense: number;
|
|
50
|
+
net: number;
|
|
51
|
+
count: number;
|
|
52
|
+
}
|
|
53
|
+
interface FinanceByDay {
|
|
54
|
+
date: string;
|
|
55
|
+
branchId?: string;
|
|
56
|
+
branchCode?: string;
|
|
57
|
+
branchName?: string;
|
|
58
|
+
income: number;
|
|
59
|
+
expense: number;
|
|
60
|
+
net: number;
|
|
61
|
+
count: number;
|
|
62
|
+
byMethod: FinanceByMethod[];
|
|
63
|
+
}
|
|
64
|
+
interface FinanceSummary {
|
|
65
|
+
totals: FinanceTotals;
|
|
66
|
+
byMethod: FinanceByMethod[];
|
|
67
|
+
byDay: FinanceByDay[];
|
|
68
|
+
dateRange: {
|
|
69
|
+
startDate: string;
|
|
70
|
+
endDate: string;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
interface FinanceSummaryParams {
|
|
74
|
+
startDate: string;
|
|
75
|
+
endDate: string;
|
|
76
|
+
branchId?: string;
|
|
77
|
+
source?: 'web' | 'pos' | 'api';
|
|
78
|
+
status?: string;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
type FetchOptions = Omit<RequestOptions, "token" | "organizationId">;
|
|
82
|
+
/**
|
|
83
|
+
* Finance API - Statements and summaries for backoffice
|
|
84
|
+
*
|
|
85
|
+
* Endpoints:
|
|
86
|
+
* - getStatements({ token, params }) - Export statements (CSV/JSON)
|
|
87
|
+
* - getSummary({ token, params }) - Get summary with breakdowns
|
|
88
|
+
*
|
|
89
|
+
* Roles:
|
|
90
|
+
* - admin, superadmin, finance-admin, finance-manager
|
|
91
|
+
*/
|
|
92
|
+
declare class FinanceApi {
|
|
93
|
+
private baseUrl;
|
|
94
|
+
constructor();
|
|
95
|
+
/**
|
|
96
|
+
* Get finance statements (export)
|
|
97
|
+
* GET /finance/statements
|
|
98
|
+
*
|
|
99
|
+
* Query params:
|
|
100
|
+
* - startDate, endDate (ISO datetime) - required
|
|
101
|
+
* - branchId (optional)
|
|
102
|
+
* - source = web|pos|api (optional)
|
|
103
|
+
* - status (optional)
|
|
104
|
+
* - format = csv|json (default: csv)
|
|
105
|
+
* - page, limit (for JSON pagination)
|
|
106
|
+
*/
|
|
107
|
+
getStatements({ token, params, options, }: {
|
|
108
|
+
token: string;
|
|
109
|
+
params: FinanceStatementParams;
|
|
110
|
+
options?: FetchOptions;
|
|
111
|
+
}): Promise<ApiResponse<FinanceStatement[]>>;
|
|
112
|
+
/**
|
|
113
|
+
* Get finance summary (dashboard)
|
|
114
|
+
* GET /finance/summary
|
|
115
|
+
*
|
|
116
|
+
* Query params:
|
|
117
|
+
* - startDate, endDate (ISO datetime) - required
|
|
118
|
+
* - branchId (optional)
|
|
119
|
+
* - source = web|pos|api (optional)
|
|
120
|
+
* - status (optional)
|
|
121
|
+
*
|
|
122
|
+
* Response:
|
|
123
|
+
* - data.totals: overall income/expense/net/count
|
|
124
|
+
* - data.byMethod: breakdown by payment method
|
|
125
|
+
* - data.byDay: per-day breakdown by branch
|
|
126
|
+
*/
|
|
127
|
+
getSummary({ token, params, options, }: {
|
|
128
|
+
token: string;
|
|
129
|
+
params: FinanceSummaryParams;
|
|
130
|
+
options?: FetchOptions;
|
|
131
|
+
}): Promise<ApiResponse<FinanceSummary>>;
|
|
132
|
+
}
|
|
133
|
+
declare const financeApi: FinanceApi;
|
|
134
|
+
|
|
135
|
+
export { FinanceApi as F, type FinanceStatement as a, type FinanceStatementParams as b, type FinanceTotals as c, type FinanceByMethod as d, type FinanceByDay as e, financeApi as f, type FinanceSummary as g, type FinanceSummaryParams as h };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export { CommerceSDKClient, CommerceSDKConfig, createCommerceSDK, createCommerceSDK as default, initCommerceSDK } from './server.js';
|
|
2
|
+
export { ApiRequestOptions, BlobResponse, HttpMethod, SDKConfig, TextResponse, configureSDK, createQueryString, getBaseUrl, getSDKConfig, handleApiRequest } from './core/index.js';
|
|
3
|
+
export { d as AggregatePaginationResponse, A as ApiResponse, B as BaseApi, f as BaseApiConfig, D as DeleteResponse, E as ExtractDoc, F as FilterOperator, K as KeysetPaginationResponse, O as OffsetPaginationResponse, P as PaginatedResponse, Q as QueryParams, R as RequestOptions, S as SortDirection, e as SortSpec, c as createCrudApi, b as isAggregatePagination, a as isKeysetPagination, i as isOffsetPagination } from './api-factory-B_h4RKBm.js';
|
|
4
|
+
export { o as CreateDetailQueryOptions, n as CreateListQueryOptions, d as CrudActions, C as CrudApi, a as CrudHooksConfig, b as CrudHooksReturn, j as DEFAULT_QUERY_CONFIG, D as DetailOptions, m as DetailQueryResult, L as ListOptions, l as ListQueryResult, N as NavigateFn, e as NavigationOptions, P as PaginationData, Q as QueryConfig, k as QueryKeys, c as createCrudHooks, g as createDetailQuery, f as createListQuery, h as createQueryKeys, i as getItemId, u as updateListCache } from './crud.factory-DyKaPHcU.js';
|
|
5
|
+
export { CreateOptimisticMutationConfig, MutationMessages, MutationWithOptimisticConfig, MutationWithTransitionConfig, QUERY_CONFIGS, ToastHandler, configureToast, createMessage, createOptimisticMutation, getToastHandler, useMutationWithOptimistic, useMutationWithTransition } from './core/react.js';
|
|
6
|
+
export { j as AuthApiResponse, A as AuthResponse, D as DISCOUNT_ALLOWED_ROLES, F as ForgotPasswordData, L as LoginCredentials, O as OAuthLoginData, R as RefreshResponse, n as RefreshTokenData, k as RegisterData, m as ResetPasswordData, i as User, U as UserRole, h as UserRoleType, V as VerifyManagerData, p as VerifyManagerResponse, a as authApi, a as authApiDefault, d as createUser, f as forgetPassApi, e as getProfile, g as getUser, c as getUserByPhone, l as loginApi, o as oauthLoginApi, r as registerApi, b as resetPassApi, t as tokenRefreshApi, u as updateUser, v as verifyManagerAuth } from './user-data-DdLjAGwO.js';
|
|
7
|
+
export { useUserSearch } from './auth/index.js';
|
|
8
|
+
export { A as AddCartItemPayload, c as AddToCartPayload, u as CancelOrderPayload, v as CancelRequestPayload, q as CancellationRequest, C as Cart, a as CartItem, e as CartItemVariation, d as CartResponse, b as CartSummary, s as CreateOrderPayload, z as Customer, B as CustomerAddress, T as CustomerApi, K as CustomerGender, I as CustomerListResponse, E as CustomerMembership, G as CustomerPayload, H as CustomerQueryParams, J as CustomerResponse, D as CustomerStats, L as CustomerTier, F as FulfillOrderPayload, h as Order, k as OrderAddress, j as OrderDelivery, i as OrderItem, p as OrderParcel, m as OrderPayment, n as OrderShipping, o as OrderShippingHistory, O as OrderStatus, l as OrderVat, r as PaymentData, f as PaymentStatus, P as PopulatedCartItem, w as RefundOrderPayload, R as RemoveCartItemPayload, x as RequestShippingPayload, g as ShippingProvider, S as ShippingStatus, U as UpdateCartItemPayload, y as UpdateShippingPayload, t as UpdateStatusPayload, M as cartApi, Q as customerApi, N as orderApi, N as orderApiDefault, V as posApi, V as posApiDefault } from './pos-D1jkkFl0.js';
|
|
9
|
+
export { ae as AdjustStockPayload, af as AdjustStockResult, ab as AdjustmentItem, B as BranchStock, ad as BulkAdjustmentPayload, ac as CreateAdjustmentPayload, I as CreatePurchasePayload, a9 as CreateStockRequestPayload, $ as CreateTransferPayload, a2 as DispatchTransferPayload, Z as InventoryTransfer, ag as LowStockItem, ai as MovementQueryParams, t as PaymentOption, u as PaymentState, s as PosCartItem, k as PosCustomer, f as PosLookupData, e as PosLookupProduct, g as PosLookupResponse, h as PosLookupResult, i as PosOrderItem, l as PosOrderPayload, j as PosPayment, m as PosPaymentMethod, P as PosProduct, c as PosProductsBranch, d as PosProductsParams, a as PosProductsResponse, b as PosProductsSummary, r as PosReceipt, p as PosReceiptData, n as PosReceiptItem, q as PosReceiptResponse, o as PosReceiptVat, H as Purchase, M as PurchaseActionPayload, C as PurchaseActionType, L as PurchaseCancelPayload, E as PurchaseItem, F as PurchaseItemDoc, K as PurchasePayPayload, D as PurchasePaymentDetails, z as PurchasePaymentStatus, A as PurchasePaymentTerms, J as PurchaseReceivePayload, y as PurchaseStatus, G as PurchaseStatusHistoryEntry, a3 as ReceiveTransferPayload, R as RecordPurchasePayload, S as SplitPaymentEntry, v as StockEntry, w as StockMovement, x as StockMovementType, a8 as StockRequest, aa as StockRequestActionPayload, a5 as StockRequestActionType, a7 as StockRequestItem, a6 as StockRequestPriority, a4 as StockRequestStatus, _ as Transfer, a0 as TransferActionPayload, O as TransferActionType, W as TransferItem, Q as TransferItemPayload, ah as TransferStats, T as TransferStatus, Y as TransferStatusHistoryEntry, N as TransferType, X as TransportDetails, U as UpdatePurchasePayload, a1 as UpdateTransferPayload, V as VariantStock } from './inventory-DCiIZh8P.js';
|
|
10
|
+
export { CART_KEYS, CUSTOMER_KEYS, CartOptions, MembershipActionParams, ORDER_KEYS, POS_KEYS, PosProductFilters, UseAdminOrderActionsReturn, UseCartCountReturn, UseCartReturn, UseCustomerMembershipReturn, UseCustomerOrderActionsReturn, UseMyOrdersReturn, UsePosOrdersReturn, UsePosProductsReturn, UsePosStockActionsReturn, calculateCartSubtotal, calculateItemPrice, calculateItemTotal, calculateVariantPrice, customerHooks, findVariantBySku, formatVariantAttributes, formatVariantLabel, generateIdempotencyKey, getAvailableVariants, getCartItemCount, getCartItemVariant, getPosProductImage, getVariantStock, isInStock, isVariantProduct, orderHooks, useAdminOrderActions, useCart, useCartCount, useCurrentCustomer, useCustomerActions, useCustomerDetail, useCustomerMembership, useCustomerNavigation, useCustomerOrderActions, useCustomers, useMyOrderDetail, useMyOrders, useOrderActions, useOrderDetail, useOrderNavigation, useOrders, usePosLookup, usePosLookupMutation, usePosOrders, usePosProducts, usePosReceipt, usePosStockActions } from './sales/index.js';
|
|
11
|
+
export { d as Category, C as CategoryApi, j as CategoryDeleteResponse, a as CategoryImage, g as CategoryListResponse, i as CategoryResponse, b as CategorySeo, k as CategorySyncResponse, e as CategoryTreeNode, h as CategoryTreeResponse, f as CreateCategoryPayload, n as CreateSizeGuidePayload, P as ProductApi, l as SizeDefinition, m as SizeGuide, S as SizeGuideApi, t as SizeGuideDeleteResponse, q as SizeGuideListResponse, r as SizeGuideResponse, U as UpdateCategoryPayload, o as UpdateSizeGuidePayload, c as categoryApi, p as productApi, s as sizeGuideApi } from './size-guide-DgjzjM5P.js';
|
|
12
|
+
export { C as CreateProductPayload, D as Dimensions, e as Product, h as ProductDeleteResponse, c as ProductDiscount, P as ProductImage, f as ProductListResponse, g as ProductResponse, a as ProductShipping, d as ProductStats, i as ProductSyncStockResponse, b as ProductVariant, S as StockProjection, U as UpdateProductPayload, V as VariationAttribute } from './product-p09zXkXB.js';
|
|
13
|
+
export { CATEGORY_KEYS, PRODUCT_KEYS, SIZE_GUIDE_KEYS, categoryHooks, findCategoryBySlug, findSizeGuideById, findSizeGuideBySlug, flattenCategoryTree, formatMeasurement, getAllCategoryOptions, getCategoryBreadcrumb, getChildCategorySlugs, getParentCategoryOptions, getRootCategories, getSizeGuideOptions, getSizeTableHeaders, getSizeTableRows, productHooks, sizeGuideHooks, useCategories, useCategoryActions, useCategoryBySlug, useCategoryDetail, useCategoryNavigation, useCategorySyncProductCount, useCategoryTree, useDeletedProducts, useHardDeleteProduct, useProductActions, useProductBySlug, useProductDetail, useProductNavigation, useProductRecommendations, useProducts, useRestoreProduct, useSizeGuideActions, useSizeGuideBySlug, useSizeGuideDetail, useSizeGuideNavigation, useSizeGuides, useSyncProductStock } from './catalog/index.js';
|
|
14
|
+
export { ADJUSTMENT_KEYS, INVENTORY_KEYS, InventoryFilters, InventorySummary, MOVEMENT_KEYS, PURCHASE_KEYS, REQUEST_KEYS, STOCK_KEYS, SUPPLIER_KEYS, TRANSFER_KEYS, TRANSFER_STATS_KEYS, UseInventoryReturn, UseMovementsReturn, UsePurchaseStateActionsReturn, UseStockActionsReturn, UseStockRequestActionsReturn, UseStockRequestsReturn, UseTransferStateActionsReturn, adjustmentHooks, getStockChangeInvalidationKeys, getStockStatus, getStockStatusBadge, getTransferStateInvalidationKeys, inventoryApis, purchaseHooks, stockHooks, supplierHooks, transferHooks, useAdjustmentActions, useAdjustmentDetail, useAdjustmentNavigation, useAdjustments, useInventory, useInventoryLookup, useLowStock, useMovements, usePendingStockRequests, usePurchaseActions, usePurchaseDetail, usePurchaseNavigation, usePurchaseStateActions, usePurchases, useStock, useStockActions, useStockDetail, useStockActions as useStockEntryActions, useStockNavigation, useStockRequestActions, useStockRequestDetail, useStockRequests, useSupplierActions, useSupplierDetail, useSupplierNavigation, useSuppliers, useTransferActions, useTransferDetail, useTransferNavigation, useTransferStateActions, useTransferStats, useTransfers } from './inventory/index.js';
|
|
15
|
+
export { A as AdjustmentApi, M as MovementApi, P as PurchaseApi, R as RequestApi, S as StockApi, g as Supplier, c as SupplierApi, h as SupplierCreatePayload, j as SupplierListResponse, f as SupplierPaymentTerms, d as SupplierQueryParams, k as SupplierResponse, e as SupplierType, i as SupplierUpdatePayload, T as TransferApi, a as adjustmentApi, m as movementApi, p as purchaseApi, r as requestApi, s as stockApi, b as supplierApi, t as transferApi } from './stock-DEApGC-w.js';
|
|
16
|
+
export { A as Area, q as CalculateChargeParams, p as CancelShipmentPayload, t as CheckoutSettings, C as CreateShipmentPayload, r as DeliveryFeeSource, u as DeliveryMethod, v as DeliveryOption, b as District, D as Division, L as LogisticsApi, o as LogisticsConfig, c as LogisticsProvider, s as PickupBranchInfo, m as PickupStore, a as ProviderAreaIds, d as ProviderCharges, n as ProviderConfig, P as ProviderName, j as Shipment, h as ShipmentCashCollection, g as ShipmentDelivery, e as ShipmentParcel, f as ShipmentPickup, S as ShipmentStatus, i as ShipmentTimelineEvent, T as TrackingData, k as TrackingResult, U as UpdateShipmentStatusPayload, l as logisticsApi } from './logistics-V8a9lUN3.js';
|
|
17
|
+
export { LOGISTICS_KEYS, UseDeliveryChargeReturn, UseLogisticsActionsReturn, useCancelShipment, useCreateShipment, useDeliveryCharge, useDeliveryChargeCalculation, useLogisticsActions, usePickupStores, useShipment, useTrackShipment, useUpdateShipmentStatus } from './logistics/index.js';
|
|
18
|
+
export { F as FinanceApi, e as FinanceByDay, d as FinanceByMethod, a as FinanceStatement, b as FinanceStatementParams, g as FinanceSummary, h as FinanceSummaryParams, c as FinanceTotals, f as financeApi } from './finance-BJdfKRw0.js';
|
|
19
|
+
export { FINANCE_KEYS, UseFinanceStatementsReturn, UseFinanceSummaryReturn, useFinanceStatements, useFinanceSummary } from './finance/index.js';
|
|
20
|
+
export { q as CashFlowReport, r as CategoryReport, C as CreateTransactionPayload, F as FinancialReport, a as PaymentGatewayType, p as PaymentIntent, P as PaymentMethod, s as StatementResponse, S as StatementRow, i as TaxType, o as Transaction, e as TransactionCategory, f as TransactionCategoryType, l as TransactionCommission, T as TransactionFlow, b as TransactionFlowType, k as TransactionGateway, h as TransactionPaymentDetails, n as TransactionReconciliation, g as TransactionSplitPayment, c as TransactionStatus, d as TransactionStatusType, j as TransactionTaxDetails, t as TransactionType, m as TransactionWebhook, U as UpdateTransactionPayload } from './transaction-BTmoHpWh.js';
|
|
21
|
+
export { C as CashFlowParams, a as CategoryParams, R as ReportParams, S as StatementParams, T as TransactionApi, t as transactionApi, t as transactionApiDefault } from './transaction-u5oaNuav.js';
|
|
22
|
+
export { TRANSACTION_KEYS, transactionHooks, useCashFlow, useCategoryReport, useProfitLoss, useStatement, useTransactionActions, useTransactionDetail, useTransactionNavigation, useTransactions } from './transaction/index.js';
|
|
23
|
+
export { A as AboutPageContent, B as BulkDeletePayload, r as BulkDeleteResult, f as CMSContentBySlug, a as CMSMetadata, b as CMSPage, c as CMSPagePayload, C as CMSPageStatus, h as CMSSlug, d as ContactPageContent, F as FAQPageContent, H as HomePageContent, l as Media, M as MediaApi, j as MediaDimensions, i as MediaFolder, q as MediaQueryParams, k as MediaVariant, p as MoveFilesPayload, s as MoveFilesResult, P as PolicyPageContent, R as ReturnsPageContent, e as ShippingPageContent, S as SizeGuidePageContent, o as UpdateMediaPayload, n as UploadMultiplePayload, U as UploadPayload, V as VariantName, g as getCmsPage, m as mediaApi, u as updateCmsPage } from './media-CNLJK93J.js';
|
|
24
|
+
export { CMS_KEYS, MEDIA_KEYS, UseCMSPageReturn, UseCMSUpdateReturn, UseMediaBulkDeleteReturn, UseMediaListOptions, UseMediaMoveReturn, UseMediaUpdateReturn, UseMediaUploadReturn, getMediaMediumUrl, getMediaThumbnailUrl, getMediaVariantUrl, useCMSPage, useCMSUpdate, useMediaBulkDelete, useMediaDetail, useMediaFolders, useMediaList, useMediaMove, useMediaUpdate, useMediaUpload } from './content/index.js';
|
|
25
|
+
export { g as Branch, f as BranchAddress, B as BranchApi, e as BranchRole, l as BranchRoleType, k as BranchSummary, d as BranchType, A as CheckoutPickupBranch, r as Coupon, C as CouponApi, w as CouponListResponse, x as CouponResponse, z as CouponUsage, y as CouponValidationResponse, s as CouponValidationResult, h as CreateBranchPayload, t as CreateCouponPayload, n as CreateUserPayload, D as DeliveryZone, L as LogisticsSettings, H as MembershipConfig, G as MembershipRedemptionConfig, M as MembershipRoundingMode, F as MembershipTierConfig, I as PlatformConfig, P as PlatformConfigApi, E as PlatformPolicies, j as UpdateBranchPayload, v as UpdateCouponPayload, J as UpdatePlatformConfigPayload, o as UpdateUserPayload, U as UserApi, m as UserBranchAssignment, q as UserListParams, V as ValidateCouponPayload, b as branchApi, c as couponApi, i as isHeadOffice, a as isSubBranch, p as platformConfigApi, u as userApi } from './coupon-CHFcw7cd.js';
|
|
26
|
+
export { B as BRANCH_KEYS, C as COUPON_KEYS, P as PLATFORM_KEYS, U as USER_KEYS, w as UseDeliveryZonesReturn, x as UseMembershipConfigReturn, v as UsePaymentMethodsReturn, t as UsePlatformConfigReturn, y as UseUpdatePlatformConfigReturn, e as branchHooks, o as couponHooks, h as useBranchActions, g as useBranchDetail, i as useBranchNavigation, f as useBranches, r as useCouponActions, q as useCouponDetail, s as useCouponNavigation, p as useCoupons, c as useDeliveryZones, d as useMembershipConfig, b as usePaymentMethods, u as usePlatformConfig, a as useUpdatePlatformConfig, m as useUserActions, l as useUserDetail, n as useUserNavigation, k as useUsers, j as userHooks } from './coupon-zGkvO-Xx.js';
|
|
27
|
+
export { P as PaymentApi, b as RejectPaymentPayload, R as RejectResult, T as TransactionEntity, V as VerificationResult, a as VerifyPaymentPayload, p as paymentApi } from './payment-BRboLqvU.js';
|
|
28
|
+
export { UsePaymentActionsReturn, usePaymentActions } from './payments/index.js';
|
|
29
|
+
export { A as AnalyticsApi, f as AnalyticsDashboard, g as AnalyticsDashboardParams, b as AnalyticsPeriod, c as AnalyticsSummary, d as AnalyticsTrend, e as TopCategory, T as TopProduct, a as analyticsApi } from './analytics-DMcD-o8w.js';
|
|
30
|
+
export { ANALYTICS_KEYS, useAnalyticsDashboard } from './analytics/index.js';
|
|
31
|
+
import '@tanstack/react-query';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
export { ANALYTICS_KEYS, useAnalyticsDashboard } from './chunk-EPQN7ZKZ.js';
|
|
3
|
+
export { createCommerceSDK, client_default as default, initCommerceSDK } from './chunk-QUMTBLNE.js';
|
|
4
|
+
export { LOGISTICS_KEYS, LogisticsApi, logisticsApi, useCancelShipment, useCreateShipment, useDeliveryCharge, useDeliveryChargeCalculation, useLogisticsActions, usePickupStores, useShipment, useTrackShipment, useUpdateShipmentStatus } from './chunk-5L6EXDGH.js';
|
|
5
|
+
export { FINANCE_KEYS, FinanceApi, financeApi, useFinanceStatements, useFinanceSummary } from './chunk-EIVYT3HM.js';
|
|
6
|
+
export { TRANSACTION_KEYS, TransactionApi, TransactionCategory, TransactionFlow, TransactionStatus, TransactionType, transactionApi, transaction_default as transactionApiDefault, transactionHooks, useCashFlow, useCategoryReport, useProfitLoss, useStatement, useTransactionActions, useTransactionDetail, useTransactionNavigation, useTransactions } from './chunk-5ZFW3FEI.js';
|
|
7
|
+
export { CMS_KEYS, MEDIA_KEYS, MediaApi, getCmsPage, getMediaMediumUrl, getMediaThumbnailUrl, getMediaVariantUrl, mediaApi, updateCmsPage, useCMSPage, useCMSUpdate, useMediaBulkDelete, useMediaDetail, useMediaFolders, useMediaList, useMediaMove, useMediaUpdate, useMediaUpload } from './chunk-ZWLMFLLH.js';
|
|
8
|
+
export { BRANCH_KEYS, BranchApi, COUPON_KEYS, CouponApi, PLATFORM_KEYS, PlatformConfigApi, USER_KEYS, UserApi, branchApi, branchHooks, couponApi, couponHooks, isHeadOffice, isSubBranch, platformConfigApi, useBranchActions, useBranchDetail, useBranchNavigation, useBranches, useCouponActions, useCouponDetail, useCouponNavigation, useCoupons, useDeliveryZones, useMembershipConfig, usePaymentMethods, usePlatformConfig, useUpdatePlatformConfig, useUserActions, useUserDetail, useUserNavigation, useUsers, userApi, userHooks } from './chunk-OF5M6R2S.js';
|
|
9
|
+
export { PaymentApi, paymentApi, usePaymentActions } from './chunk-ILQUH444.js';
|
|
10
|
+
export { AnalyticsApi, analyticsApi } from './chunk-4ZQK3FFN.js';
|
|
11
|
+
export { DISCOUNT_ALLOWED_ROLES, UserRole, authApi, user_data_default as authApiDefault, createUser, forgetPassApi, getProfile, getUser, getUserByPhone, loginApi, oauthLoginApi, registerApi, resetPassApi, tokenRefreshApi, updateUser, useUserSearch, verifyManagerAuth } from './chunk-BDA2WSJA.js';
|
|
12
|
+
export { CATEGORY_KEYS, CategoryApi, PRODUCT_KEYS, ProductApi, SIZE_GUIDE_KEYS, SizeGuideApi, categoryApi, categoryHooks, findCategoryBySlug, findSizeGuideById, findSizeGuideBySlug, flattenCategoryTree, formatMeasurement, getAllCategoryOptions, getCategoryBreadcrumb, getChildCategorySlugs, getParentCategoryOptions, getRootCategories, getSizeGuideOptions, getSizeTableHeaders, getSizeTableRows, productApi, productHooks, sizeGuideApi, sizeGuideHooks, useCategories, useCategoryActions, useCategoryBySlug, useCategoryDetail, useCategoryNavigation, useCategorySyncProductCount, useCategoryTree, useDeletedProducts, useHardDeleteProduct, useProductActions, useProductBySlug, useProductDetail, useProductNavigation, useProductRecommendations, useProducts, useRestoreProduct, useSizeGuideActions, useSizeGuideBySlug, useSizeGuideDetail, useSizeGuideNavigation, useSizeGuides, useSyncProductStock } from './chunk-X6PV5MHG.js';
|
|
13
|
+
import './chunk-PYYLHUV6.js';
|
|
14
|
+
export { CART_KEYS, CUSTOMER_KEYS, CustomerApi, ORDER_KEYS, OrderStatus, POS_KEYS, PaymentStatus, calculateCartSubtotal, calculateItemPrice, calculateItemTotal, calculateVariantPrice, cartApi, customerApi, customerHooks, findVariantBySku, formatVariantAttributes, formatVariantLabel, generateIdempotencyKey, getAvailableVariants, getCartItemCount, getCartItemVariant, getPosProductImage, getVariantStock, isInStock, isVariantProduct, orderApi, order_default as orderApiDefault, orderHooks, useAdminOrderActions, useCart, useCartCount, useCurrentCustomer, useCustomerActions, useCustomerDetail, useCustomerMembership, useCustomerNavigation, useCustomerOrderActions, useCustomers, useMyOrderDetail, useMyOrders, useOrderActions, useOrderDetail, useOrderNavigation, useOrders, usePosLookup, usePosLookupMutation, usePosOrders, usePosProducts, usePosReceipt, usePosStockActions } from './chunk-UGELTUIZ.js';
|
|
15
|
+
export { ADJUSTMENT_KEYS, INVENTORY_KEYS, MOVEMENT_KEYS, PURCHASE_KEYS, REQUEST_KEYS, STOCK_KEYS, SUPPLIER_KEYS, TRANSFER_KEYS, TRANSFER_STATS_KEYS, adjustmentHooks, getStockChangeInvalidationKeys, getStockStatus, getStockStatusBadge, getTransferStateInvalidationKeys, inventoryApis, purchaseHooks, stockHooks, supplierHooks, transferHooks, useAdjustmentActions, useAdjustmentDetail, useAdjustmentNavigation, useAdjustments, useInventory, useInventoryLookup, useLowStock, useMovements, usePendingStockRequests, usePurchaseActions, usePurchaseDetail, usePurchaseNavigation, usePurchaseStateActions, usePurchases, useStock, useStockActions, useStockDetail, useStockActions as useStockEntryActions, useStockNavigation, useStockRequestActions, useStockRequestDetail, useStockRequests, useSupplierActions, useSupplierDetail, useSupplierNavigation, useSuppliers, useTransferActions, useTransferDetail, useTransferNavigation, useTransferStateActions, useTransferStats, useTransfers } from './chunk-IXMWZJLV.js';
|
|
16
|
+
export { PurchaseApi, purchaseApi } from './chunk-6RYGA6MF.js';
|
|
17
|
+
export { TransferApi, transferApi } from './chunk-FA7QFJ2G.js';
|
|
18
|
+
export { RequestApi, requestApi } from './chunk-QO5AGZFP.js';
|
|
19
|
+
export { MovementApi, movementApi } from './chunk-SZYWG5IB.js';
|
|
20
|
+
export { AdjustmentApi, adjustmentApi } from './chunk-R5Z7NYLH.js';
|
|
21
|
+
export { SupplierApi, supplierApi } from './chunk-WUOQK7BO.js';
|
|
22
|
+
export { StockApi, stockApi } from './chunk-KZIGRIQG.js';
|
|
23
|
+
export { posApi, pos_default as posApiDefault } from './chunk-66OQAZSL.js';
|
|
24
|
+
export { BaseApi, createCrudApi, isAggregatePagination, isKeysetPagination, isOffsetPagination } from './chunk-I5TIKUIQ.js';
|
|
25
|
+
export { DEFAULT_QUERY_CONFIG, createCrudHooks, createDetailQuery, createListQuery, createQueryKeys, getItemId, updateListCache } from './chunk-B6MPVOV7.js';
|
|
26
|
+
export { QUERY_CONFIGS, configureToast, createMessage, createOptimisticMutation, getToastHandler, useMutationWithOptimistic, useMutationWithTransition } from './chunk-U3XT35GZ.js';
|
|
27
|
+
export { configureSDK, createQueryString, getBaseUrl, getSDKConfig, handleApiRequest } from './chunk-VR36QVX2.js';
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
29
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|