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