@instockng/api-client 1.0.0 → 1.0.1

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.
Files changed (86) hide show
  1. package/dist/backend-types.d.ts +10 -0
  2. package/dist/backend-types.js +10 -0
  3. package/dist/client.d.ts +20 -0
  4. package/dist/client.js +40 -0
  5. package/dist/fetchers/carts.d.ts +2330 -0
  6. package/dist/fetchers/carts.js +167 -0
  7. package/dist/fetchers/delivery-zones.d.ts +28 -0
  8. package/{src/fetchers/delivery-zones.ts → dist/fetchers/delivery-zones.js} +9 -12
  9. package/{src/fetchers/index.ts → dist/fetchers/index.d.ts} +0 -1
  10. package/dist/fetchers/index.js +21 -0
  11. package/dist/fetchers/orders.d.ts +282 -0
  12. package/dist/fetchers/orders.js +44 -0
  13. package/dist/fetchers/products.d.ts +384 -0
  14. package/dist/fetchers/products.js +42 -0
  15. package/dist/hooks/admin/abandoned-carts.d.ts +533 -0
  16. package/dist/hooks/admin/abandoned-carts.js +79 -0
  17. package/dist/hooks/admin/brands.d.ts +75 -0
  18. package/dist/hooks/admin/brands.js +103 -0
  19. package/dist/hooks/admin/customers.d.ts +277 -0
  20. package/dist/hooks/admin/customers.js +25 -0
  21. package/dist/hooks/admin/delivery-zones.d.ts +266 -0
  22. package/dist/hooks/admin/delivery-zones.js +168 -0
  23. package/dist/hooks/admin/discount-codes.d.ts +294 -0
  24. package/dist/hooks/admin/discount-codes.js +157 -0
  25. package/{src/hooks/admin/index.ts → dist/hooks/admin/index.d.ts} +0 -1
  26. package/dist/hooks/admin/index.js +16 -0
  27. package/dist/hooks/admin/inventory.d.ts +224 -0
  28. package/dist/hooks/admin/inventory.js +102 -0
  29. package/dist/hooks/admin/orders.d.ts +1375 -0
  30. package/dist/hooks/admin/orders.js +169 -0
  31. package/dist/hooks/admin/products.d.ts +372 -0
  32. package/dist/hooks/admin/products.js +84 -0
  33. package/dist/hooks/admin/stats.d.ts +276 -0
  34. package/dist/hooks/admin/stats.js +24 -0
  35. package/dist/hooks/admin/variants.d.ts +115 -0
  36. package/dist/hooks/admin/variants.js +121 -0
  37. package/dist/hooks/admin/warehouses.d.ts +276 -0
  38. package/dist/hooks/admin/warehouses.js +103 -0
  39. package/dist/hooks/public/carts.d.ts +2398 -0
  40. package/dist/hooks/public/carts.js +213 -0
  41. package/dist/hooks/public/delivery-zones.d.ts +34 -0
  42. package/{src/hooks/public/delivery-zones.ts → dist/hooks/public/delivery-zones.js} +6 -12
  43. package/{src/hooks/public/index.ts → dist/hooks/public/index.d.ts} +0 -1
  44. package/dist/hooks/public/index.js +9 -0
  45. package/dist/hooks/public/orders.d.ts +301 -0
  46. package/{src/hooks/public/orders.ts → dist/hooks/public/orders.js} +12 -28
  47. package/dist/hooks/public/products.d.ts +396 -0
  48. package/{src/hooks/public/products.ts → dist/hooks/public/products.js} +12 -22
  49. package/dist/hooks/use-query-unwrapped.d.ts +20 -0
  50. package/dist/hooks/use-query-unwrapped.js +22 -0
  51. package/dist/hooks/useApiConfig.d.ts +11 -0
  52. package/dist/hooks/useApiConfig.js +14 -0
  53. package/dist/index.d.ts +20 -0
  54. package/{src/index.ts → dist/index.js} +0 -17
  55. package/dist/provider.d.ts +33 -0
  56. package/dist/provider.js +52 -0
  57. package/dist/rpc-client.d.ts +8966 -0
  58. package/dist/rpc-client.js +79 -0
  59. package/{src/rpc-types.ts → dist/rpc-types.d.ts} +35 -80
  60. package/dist/rpc-types.js +7 -0
  61. package/{src/types.ts → dist/types.d.ts} +0 -6
  62. package/dist/types.js +16 -0
  63. package/dist/utils/query-keys.d.ts +102 -0
  64. package/dist/utils/query-keys.js +104 -0
  65. package/package.json +20 -13
  66. package/src/client.ts +0 -57
  67. package/src/fetchers/carts.ts +0 -202
  68. package/src/fetchers/orders.ts +0 -48
  69. package/src/fetchers/products.ts +0 -46
  70. package/src/hooks/admin/abandoned-carts.ts +0 -102
  71. package/src/hooks/admin/brands.ts +0 -134
  72. package/src/hooks/admin/customers.ts +0 -31
  73. package/src/hooks/admin/delivery-zones.ts +0 -236
  74. package/src/hooks/admin/discount-codes.ts +0 -222
  75. package/src/hooks/admin/inventory.ts +0 -137
  76. package/src/hooks/admin/orders.ts +0 -229
  77. package/src/hooks/admin/products.ts +0 -116
  78. package/src/hooks/admin/stats.ts +0 -30
  79. package/src/hooks/admin/variants.ts +0 -173
  80. package/src/hooks/admin/warehouses.ts +0 -143
  81. package/src/hooks/public/carts.ts +0 -298
  82. package/src/hooks/use-query-unwrapped.ts +0 -30
  83. package/src/hooks/useApiConfig.ts +0 -22
  84. package/src/provider.tsx +0 -89
  85. package/src/rpc-client.ts +0 -106
  86. package/src/utils/query-keys.ts +0 -121
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Type-safe admin RPC hooks for brand management
3
+ */
4
+ import { useMutation, useQueryClient } from '@tanstack/react-query';
5
+ import { useQueryUnwrapped } from '../use-query-unwrapped';
6
+ import { createAdminRpcClients, authHeaders } from '../../rpc-client';
7
+ import { queryKeys } from '../../utils/query-keys';
8
+ import { useApiConfig } from '../useApiConfig';
9
+ /**
10
+ * Hook to list all brands using admin RPC
11
+ */
12
+ export function useListBrands(options) {
13
+ const { baseURL, authToken } = useApiConfig();
14
+ return useQueryUnwrapped({
15
+ queryKey: queryKeys.admin.brands.list(),
16
+ queryFn: async () => {
17
+ const clients = createAdminRpcClients(baseURL);
18
+ const res = await clients.brands.index.$get({}, authHeaders(authToken));
19
+ if (!res.ok)
20
+ throw new Error(`Failed to fetch brands: ${res.statusText}`);
21
+ return res.json();
22
+ },
23
+ ...options,
24
+ });
25
+ }
26
+ /**
27
+ * Hook to get brand by ID using admin RPC
28
+ */
29
+ export function useGetBrand(brandId, options) {
30
+ const { baseURL, authToken } = useApiConfig();
31
+ return useQueryUnwrapped({
32
+ queryKey: queryKeys.admin.brands.detail(brandId),
33
+ queryFn: async () => {
34
+ const clients = createAdminRpcClients(baseURL);
35
+ const res = await clients.brands[':id'].$get({ param: { id: brandId } }, authHeaders(authToken));
36
+ if (!res.ok)
37
+ throw new Error(`Failed to fetch brand: ${res.statusText}`);
38
+ return res.json();
39
+ },
40
+ ...options,
41
+ });
42
+ }
43
+ /**
44
+ * Hook to create a brand using admin RPC
45
+ */
46
+ export function useCreateBrand(options) {
47
+ const { baseURL, authToken } = useApiConfig();
48
+ const queryClient = useQueryClient();
49
+ return useMutation({
50
+ mutationFn: async (data) => {
51
+ const clients = createAdminRpcClients(baseURL);
52
+ const res = await clients.brands.index.$post({ json: data }, authHeaders(authToken));
53
+ if (!res.ok)
54
+ throw new Error(`Failed to create brand: ${res.statusText}`);
55
+ return res.json();
56
+ },
57
+ onSuccess: () => {
58
+ queryClient.invalidateQueries({ queryKey: queryKeys.admin.brands.all });
59
+ },
60
+ ...options,
61
+ });
62
+ }
63
+ /**
64
+ * Hook to update a brand using admin RPC
65
+ */
66
+ export function useUpdateBrand(brandId, options) {
67
+ const { baseURL, authToken } = useApiConfig();
68
+ const queryClient = useQueryClient();
69
+ return useMutation({
70
+ mutationFn: async (data) => {
71
+ const clients = createAdminRpcClients(baseURL);
72
+ const res = await clients.brands[':id'].$patch({ json: data, param: { id: brandId } }, authHeaders(authToken));
73
+ if (!res.ok)
74
+ throw new Error(`Failed to update brand: ${res.statusText}`);
75
+ return res.json();
76
+ },
77
+ onSuccess: () => {
78
+ queryClient.invalidateQueries({ queryKey: queryKeys.admin.brands.detail(brandId) });
79
+ queryClient.invalidateQueries({ queryKey: queryKeys.admin.brands.all });
80
+ },
81
+ ...options,
82
+ });
83
+ }
84
+ /**
85
+ * Hook to delete a brand using admin RPC
86
+ */
87
+ export function useDeleteBrand(brandId, options) {
88
+ const { baseURL, authToken } = useApiConfig();
89
+ const queryClient = useQueryClient();
90
+ return useMutation({
91
+ mutationFn: async () => {
92
+ const clients = createAdminRpcClients(baseURL);
93
+ const res = await clients.brands[':id'].$delete({ param: { id: brandId } }, authHeaders(authToken));
94
+ if (!res.ok)
95
+ throw new Error(`Failed to delete brand: ${res.statusText}`);
96
+ return res.json();
97
+ },
98
+ onSuccess: () => {
99
+ queryClient.invalidateQueries({ queryKey: queryKeys.admin.brands.all });
100
+ },
101
+ ...options,
102
+ });
103
+ }
@@ -0,0 +1,277 @@
1
+ /**
2
+ * Type-safe admin RPC hooks for customer management
3
+ */
4
+ import { UseQueryOptions } from '@tanstack/react-query';
5
+ import { createAdminRpcClients } from '../../rpc-client';
6
+ /**
7
+ * Hook to get customer order history by phone using admin RPC
8
+ */
9
+ export declare function useGetCustomerHistory(phone: string, options?: Omit<UseQueryOptions<Awaited<ReturnType<Awaited<ReturnType<ReturnType<typeof createAdminRpcClients>['customers']['history']['$get']>>['json']>>, Error>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<{
10
+ customer: any;
11
+ orders: never;
12
+ } | {
13
+ customer: {
14
+ firstName: string;
15
+ lastName: string;
16
+ phone: string;
17
+ totalOrders: number;
18
+ totalSpent: number;
19
+ };
20
+ orders: {
21
+ subtotal: number;
22
+ deliveryCharge: number;
23
+ totalPrice: number;
24
+ discountAmount: number;
25
+ createdAt: string;
26
+ updatedAt: string;
27
+ deletedAt: string;
28
+ prospectSince: string;
29
+ lastRecoveryAttemptAt: string;
30
+ brand: {
31
+ createdAt: string;
32
+ updatedAt: string;
33
+ deletedAt: string;
34
+ name: string;
35
+ id: string;
36
+ slug: string;
37
+ logoUrl: string | null;
38
+ siteUrl: string;
39
+ domain: string;
40
+ };
41
+ deliveryZone: {
42
+ deliveryCost: number;
43
+ freeShippingThreshold: number;
44
+ createdAt: string;
45
+ updatedAt: string;
46
+ deletedAt: string;
47
+ state: {
48
+ createdAt: string;
49
+ updatedAt: string;
50
+ deletedAt: string;
51
+ name: string;
52
+ id: string;
53
+ isActive: boolean;
54
+ };
55
+ name: string;
56
+ id: string;
57
+ brandId: string | null;
58
+ stateId: string;
59
+ allowCOD: boolean;
60
+ allowOnline: boolean;
61
+ waybillOnly: boolean;
62
+ estimatedDays: number | null;
63
+ isActive: boolean;
64
+ };
65
+ items: {
66
+ priceAtPurchase: number;
67
+ variant: {
68
+ price: number;
69
+ createdAt: string;
70
+ updatedAt: string;
71
+ deletedAt: string;
72
+ product: {
73
+ createdAt: string;
74
+ updatedAt: string;
75
+ deletedAt: string;
76
+ name: string;
77
+ id: string;
78
+ slug: string;
79
+ brandId: string;
80
+ isActive: boolean;
81
+ description: string | null;
82
+ thumbnailUrl: string | null;
83
+ quantityDiscounts: string | number | boolean | {
84
+ [x: string]: string | number | boolean | /*elided*/ any | {
85
+ [x: number]: string | number | boolean | /*elided*/ any | /*elided*/ any;
86
+ length: number;
87
+ toString: never;
88
+ toLocaleString: never;
89
+ pop: never;
90
+ push: never;
91
+ concat: never;
92
+ join: never;
93
+ reverse: never;
94
+ shift: never;
95
+ slice: never;
96
+ sort: never;
97
+ splice: never;
98
+ unshift: never;
99
+ indexOf: never;
100
+ lastIndexOf: never;
101
+ every: never;
102
+ some: never;
103
+ forEach: never;
104
+ map: never;
105
+ filter: never;
106
+ reduce: never;
107
+ reduceRight: never;
108
+ find: never;
109
+ findIndex: never;
110
+ fill: never;
111
+ copyWithin: never;
112
+ entries: never;
113
+ keys: never;
114
+ values: never;
115
+ includes: never;
116
+ flatMap: never;
117
+ flat: never;
118
+ [Symbol.iterator]: never;
119
+ readonly [Symbol.unscopables]: {
120
+ [x: number]: boolean;
121
+ length?: boolean;
122
+ toString?: boolean;
123
+ toLocaleString?: boolean;
124
+ pop?: boolean;
125
+ push?: boolean;
126
+ concat?: boolean;
127
+ join?: boolean;
128
+ reverse?: boolean;
129
+ shift?: boolean;
130
+ slice?: boolean;
131
+ sort?: boolean;
132
+ splice?: boolean;
133
+ unshift?: boolean;
134
+ indexOf?: boolean;
135
+ lastIndexOf?: boolean;
136
+ every?: boolean;
137
+ some?: boolean;
138
+ forEach?: boolean;
139
+ map?: boolean;
140
+ filter?: boolean;
141
+ reduce?: boolean;
142
+ reduceRight?: boolean;
143
+ find?: boolean;
144
+ findIndex?: boolean;
145
+ fill?: boolean;
146
+ copyWithin?: boolean;
147
+ entries?: boolean;
148
+ keys?: boolean;
149
+ values?: boolean;
150
+ includes?: boolean;
151
+ flatMap?: boolean;
152
+ flat?: boolean;
153
+ };
154
+ };
155
+ } | {
156
+ [x: number]: string | number | boolean | {
157
+ [x: string]: string | number | boolean | /*elided*/ any | /*elided*/ any;
158
+ } | /*elided*/ any;
159
+ length: number;
160
+ toString: never;
161
+ toLocaleString: never;
162
+ pop: never;
163
+ push: never;
164
+ concat: never;
165
+ join: never;
166
+ reverse: never;
167
+ shift: never;
168
+ slice: never;
169
+ sort: never;
170
+ splice: never;
171
+ unshift: never;
172
+ indexOf: never;
173
+ lastIndexOf: never;
174
+ every: never;
175
+ some: never;
176
+ forEach: never;
177
+ map: never;
178
+ filter: never;
179
+ reduce: never;
180
+ reduceRight: never;
181
+ find: never;
182
+ findIndex: never;
183
+ fill: never;
184
+ copyWithin: never;
185
+ entries: never;
186
+ keys: never;
187
+ values: never;
188
+ includes: never;
189
+ flatMap: never;
190
+ flat: never;
191
+ [Symbol.iterator]: never;
192
+ readonly [Symbol.unscopables]: {
193
+ [x: number]: boolean;
194
+ length?: boolean;
195
+ toString?: boolean;
196
+ toLocaleString?: boolean;
197
+ pop?: boolean;
198
+ push?: boolean;
199
+ concat?: boolean;
200
+ join?: boolean;
201
+ reverse?: boolean;
202
+ shift?: boolean;
203
+ slice?: boolean;
204
+ sort?: boolean;
205
+ splice?: boolean;
206
+ unshift?: boolean;
207
+ indexOf?: boolean;
208
+ lastIndexOf?: boolean;
209
+ every?: boolean;
210
+ some?: boolean;
211
+ forEach?: boolean;
212
+ map?: boolean;
213
+ filter?: boolean;
214
+ reduce?: boolean;
215
+ reduceRight?: boolean;
216
+ find?: boolean;
217
+ findIndex?: boolean;
218
+ fill?: boolean;
219
+ copyWithin?: boolean;
220
+ entries?: boolean;
221
+ keys?: boolean;
222
+ values?: boolean;
223
+ includes?: boolean;
224
+ flatMap?: boolean;
225
+ flat?: boolean;
226
+ };
227
+ };
228
+ };
229
+ name: string | null;
230
+ id: string;
231
+ isActive: boolean;
232
+ thumbnailUrl: string | null;
233
+ productId: string;
234
+ sku: string;
235
+ trackInventory: boolean;
236
+ lowStockThreshold: number | null;
237
+ };
238
+ warehouse: {
239
+ createdAt: string;
240
+ updatedAt: string;
241
+ deletedAt: string;
242
+ name: string;
243
+ id: string;
244
+ isActive: boolean;
245
+ address: string | null;
246
+ city: string | null;
247
+ state: string | null;
248
+ };
249
+ id: string;
250
+ orderId: string;
251
+ variantId: string;
252
+ warehouseId: string | null;
253
+ quantity: number;
254
+ }[];
255
+ id: string;
256
+ email: string | null;
257
+ brandId: string;
258
+ deliveryZoneId: string;
259
+ recoveryAttempts: number;
260
+ recoveryDiscountCodeId: string | null;
261
+ wasRecovered: boolean;
262
+ estimatedDays: number | null;
263
+ orderNumber: number;
264
+ firstName: string;
265
+ lastName: string;
266
+ phone: string;
267
+ address: string;
268
+ city: string;
269
+ discountCodeId: string | null;
270
+ paymentMethod: import("@prisma/client").$Enums.PaymentMethod;
271
+ paystackReference: string | null;
272
+ status: import("@prisma/client").$Enums.OrderStatus;
273
+ cancellationReason: string | null;
274
+ prospectReason: import("@prisma/client").$Enums.ProspectReason | null;
275
+ userActionToken: string;
276
+ }[];
277
+ }, Error>;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Type-safe admin RPC hooks for customer management
3
+ */
4
+ import { useQueryUnwrapped } from '../use-query-unwrapped';
5
+ import { createAdminRpcClients, authHeaders } from '../../rpc-client';
6
+ import { queryKeys } from '../../utils/query-keys';
7
+ import { useApiConfig } from '../useApiConfig';
8
+ /**
9
+ * Hook to get customer order history by phone using admin RPC
10
+ */
11
+ export function useGetCustomerHistory(phone, options) {
12
+ const { baseURL, authToken } = useApiConfig();
13
+ return useQueryUnwrapped({
14
+ queryKey: queryKeys.admin.customers.history(phone),
15
+ queryFn: async () => {
16
+ const clients = createAdminRpcClients(baseURL);
17
+ const res = await clients.customers.history.$get({ query: { phone } }, authHeaders(authToken));
18
+ if (!res.ok)
19
+ throw new Error(`Failed to fetch customer history: ${res.statusText}`);
20
+ return res.json();
21
+ },
22
+ enabled: !!phone,
23
+ ...options,
24
+ });
25
+ }
@@ -0,0 +1,266 @@
1
+ /**
2
+ * Type-safe admin RPC hooks for delivery zone and state management
3
+ */
4
+ import { UseQueryOptions, UseMutationOptions } from '@tanstack/react-query';
5
+ import { createAdminRpcClients } from '../../rpc-client';
6
+ /**
7
+ * Hook to list all states using admin RPC
8
+ */
9
+ export declare function useListStates(options?: Omit<UseQueryOptions<Awaited<ReturnType<Awaited<ReturnType<ReturnType<typeof createAdminRpcClients>['deliveryZones']['states']['$get']>>['json']>>, Error>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<{
10
+ deliveryZones: {
11
+ deliveryCost: number;
12
+ freeShippingThreshold: number;
13
+ createdAt: string;
14
+ updatedAt: string;
15
+ deletedAt: string;
16
+ brand: {
17
+ createdAt: string;
18
+ updatedAt: string;
19
+ deletedAt: string;
20
+ name: string;
21
+ id: string;
22
+ slug: string;
23
+ logoUrl: string | null;
24
+ siteUrl: string;
25
+ domain: string;
26
+ };
27
+ stateName: string;
28
+ brandName: string;
29
+ state: {
30
+ name: string;
31
+ id: string;
32
+ createdAt: string;
33
+ updatedAt: string;
34
+ deletedAt: string;
35
+ isActive: boolean;
36
+ };
37
+ name: string;
38
+ id: string;
39
+ brandId: string | null;
40
+ stateId: string;
41
+ allowCOD: boolean;
42
+ allowOnline: boolean;
43
+ waybillOnly: boolean;
44
+ estimatedDays: number | null;
45
+ isActive: boolean;
46
+ }[];
47
+ zonesCount: number;
48
+ createdAt: string;
49
+ updatedAt: string;
50
+ deletedAt: string;
51
+ name: string;
52
+ id: string;
53
+ isActive: boolean;
54
+ }[], Error>;
55
+ /**
56
+ * Hook to create a state using admin RPC
57
+ */
58
+ export declare function useCreateState(options?: UseMutationOptions<Awaited<ReturnType<Awaited<ReturnType<ReturnType<typeof createAdminRpcClients>['deliveryZones']['states']['$post']>>['json']>>, Error, any>): import("@tanstack/react-query").UseMutationResult<{
59
+ error: {
60
+ code: string;
61
+ message: string;
62
+ };
63
+ } | {
64
+ zonesCount: number;
65
+ createdAt: string;
66
+ updatedAt: string;
67
+ deletedAt: string;
68
+ name: string;
69
+ id: string;
70
+ isActive: boolean;
71
+ deliveryZones?: never;
72
+ } | {
73
+ error: {
74
+ code: string;
75
+ message: string;
76
+ };
77
+ }, Error, any, unknown>;
78
+ /**
79
+ * Hook to update a state using admin RPC
80
+ */
81
+ export declare function useUpdateState(stateId: string, options?: UseMutationOptions<Awaited<ReturnType<Awaited<ReturnType<ReturnType<typeof createAdminRpcClients>['deliveryZones']['states'][':id']['$patch']>>['json']>>, Error, any>): import("@tanstack/react-query").UseMutationResult<{
82
+ zonesCount: number;
83
+ createdAt: string;
84
+ updatedAt: string;
85
+ deletedAt: string;
86
+ name: string;
87
+ id: string;
88
+ isActive: boolean;
89
+ deliveryZones?: never;
90
+ } | {
91
+ error: {
92
+ code: string;
93
+ message: string;
94
+ };
95
+ } | {
96
+ error: {
97
+ code: string;
98
+ message: string;
99
+ };
100
+ } | {
101
+ error: {
102
+ code: string;
103
+ message: string;
104
+ };
105
+ }, Error, any, unknown>;
106
+ /**
107
+ * Hook to delete a state using admin RPC
108
+ */
109
+ export declare function useDeleteState(stateId: string, options?: UseMutationOptions<Awaited<ReturnType<Awaited<ReturnType<ReturnType<typeof createAdminRpcClients>['deliveryZones']['states'][':id']['$delete']>>['json']>>, Error, void>): import("@tanstack/react-query").UseMutationResult<unknown, Error, void, unknown>;
110
+ /**
111
+ * Hook to list delivery zones using admin RPC
112
+ */
113
+ export declare function useListDeliveryZones(params?: {
114
+ stateId?: string;
115
+ brandId?: string;
116
+ }, options?: Omit<UseQueryOptions<Awaited<ReturnType<Awaited<ReturnType<ReturnType<typeof createAdminRpcClients>['deliveryZones']['zones']['$get']>>['json']>>, Error>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<{
117
+ deliveryCost: number;
118
+ freeShippingThreshold: number;
119
+ createdAt: string;
120
+ updatedAt: string;
121
+ deletedAt: string;
122
+ brand: {
123
+ createdAt: string;
124
+ updatedAt: string;
125
+ deletedAt: string;
126
+ name: string;
127
+ id: string;
128
+ slug: string;
129
+ logoUrl: string | null;
130
+ siteUrl: string;
131
+ domain: string;
132
+ };
133
+ stateName: string;
134
+ brandName: string;
135
+ state: {
136
+ name: string;
137
+ id: string;
138
+ createdAt: string;
139
+ updatedAt: string;
140
+ deletedAt: string;
141
+ isActive: boolean;
142
+ };
143
+ name: string;
144
+ id: string;
145
+ brandId: string | null;
146
+ stateId: string;
147
+ allowCOD: boolean;
148
+ allowOnline: boolean;
149
+ waybillOnly: boolean;
150
+ estimatedDays: number | null;
151
+ isActive: boolean;
152
+ }[], Error>;
153
+ /**
154
+ * Hook to create a delivery zone using admin RPC
155
+ */
156
+ export declare function useCreateDeliveryZone(options?: UseMutationOptions<Awaited<ReturnType<Awaited<ReturnType<ReturnType<typeof createAdminRpcClients>['deliveryZones']['zones']['$post']>>['json']>>, Error, any>): import("@tanstack/react-query").UseMutationResult<{
157
+ deliveryCost: number;
158
+ freeShippingThreshold: number;
159
+ createdAt: string;
160
+ updatedAt: string;
161
+ deletedAt: string;
162
+ brand: {
163
+ createdAt: string;
164
+ updatedAt: string;
165
+ deletedAt: string;
166
+ name: string;
167
+ id: string;
168
+ slug: string;
169
+ logoUrl: string | null;
170
+ siteUrl: string;
171
+ domain: string;
172
+ };
173
+ stateName: string;
174
+ brandName: string;
175
+ state: {
176
+ name: string;
177
+ id: string;
178
+ createdAt: string;
179
+ updatedAt: string;
180
+ deletedAt: string;
181
+ isActive: boolean;
182
+ };
183
+ name: string;
184
+ id: string;
185
+ brandId: string | null;
186
+ stateId: string;
187
+ allowCOD: boolean;
188
+ allowOnline: boolean;
189
+ waybillOnly: boolean;
190
+ estimatedDays: number | null;
191
+ isActive: boolean;
192
+ } | {
193
+ error: {
194
+ code: string;
195
+ message: string;
196
+ };
197
+ } | {
198
+ error: {
199
+ code: string;
200
+ message: string;
201
+ };
202
+ } | {
203
+ error: {
204
+ code: string;
205
+ message: string;
206
+ };
207
+ }, Error, any, unknown>;
208
+ /**
209
+ * Hook to update a delivery zone using admin RPC
210
+ */
211
+ export declare function useUpdateDeliveryZone(zoneId: string, options?: UseMutationOptions<Awaited<ReturnType<Awaited<ReturnType<ReturnType<typeof createAdminRpcClients>['deliveryZones']['zones'][':id']['$patch']>>['json']>>, Error, any>): import("@tanstack/react-query").UseMutationResult<{
212
+ deliveryCost: number;
213
+ freeShippingThreshold: number;
214
+ createdAt: string;
215
+ updatedAt: string;
216
+ deletedAt: string;
217
+ brand: {
218
+ createdAt: string;
219
+ updatedAt: string;
220
+ deletedAt: string;
221
+ name: string;
222
+ id: string;
223
+ slug: string;
224
+ logoUrl: string | null;
225
+ siteUrl: string;
226
+ domain: string;
227
+ };
228
+ stateName: string;
229
+ brandName: string;
230
+ state: {
231
+ name: string;
232
+ id: string;
233
+ createdAt: string;
234
+ updatedAt: string;
235
+ deletedAt: string;
236
+ isActive: boolean;
237
+ };
238
+ name: string;
239
+ id: string;
240
+ brandId: string | null;
241
+ stateId: string;
242
+ allowCOD: boolean;
243
+ allowOnline: boolean;
244
+ waybillOnly: boolean;
245
+ estimatedDays: number | null;
246
+ isActive: boolean;
247
+ } | {
248
+ error: {
249
+ code: string;
250
+ message: string;
251
+ };
252
+ } | {
253
+ error: {
254
+ code: string;
255
+ message: string;
256
+ };
257
+ } | {
258
+ error: {
259
+ code: string;
260
+ message: string;
261
+ };
262
+ }, Error, any, unknown>;
263
+ /**
264
+ * Hook to delete a delivery zone using admin RPC
265
+ */
266
+ export declare function useDeleteDeliveryZone(zoneId: string, options?: UseMutationOptions<Awaited<ReturnType<Awaited<ReturnType<ReturnType<typeof createAdminRpcClients>['deliveryZones']['zones'][':id']['$delete']>>['json']>>, Error, void>): import("@tanstack/react-query").UseMutationResult<unknown, Error, void, unknown>;