@instockng/api-client 1.0.7 → 1.0.8

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 (66) hide show
  1. package/dist/apps/backend/src/http-app.js +28 -0
  2. package/dist/apps/backend/src/lib/brand-response.d.ts +1 -1
  3. package/dist/apps/backend/src/lib/cart-helpers.d.ts +13 -11
  4. package/dist/apps/backend/src/lib/cart-helpers.js +28 -0
  5. package/dist/apps/backend/src/lib/cart-response.d.ts +5 -5
  6. package/dist/apps/backend/src/lib/clerk.js +23 -0
  7. package/dist/apps/backend/src/lib/delivery-zone-response.d.ts +6 -4
  8. package/dist/apps/backend/src/lib/discount-code-response.d.ts +2 -2
  9. package/dist/apps/backend/src/lib/meta-capi.d.ts +5 -0
  10. package/dist/apps/backend/src/lib/meta-capi.js +33 -2
  11. package/dist/apps/backend/src/lib/order-recovery.d.ts +30 -24
  12. package/dist/apps/backend/src/lib/order-response.d.ts +9 -7
  13. package/dist/apps/backend/src/lib/product-response.d.ts +4 -4
  14. package/dist/apps/backend/src/lib/sentry.d.ts +48 -0
  15. package/dist/apps/backend/src/lib/sentry.js +180 -0
  16. package/dist/apps/backend/src/notifications/producers/meta-capi-producer.js +18 -4
  17. package/dist/apps/backend/src/routes/admin/abandoned-carts.d.ts +10 -10
  18. package/dist/apps/backend/src/routes/admin/brands.d.ts +4 -4
  19. package/dist/apps/backend/src/routes/admin/customers.d.ts +9 -7
  20. package/dist/apps/backend/src/routes/admin/delivery-zones.d.ts +23 -15
  21. package/dist/apps/backend/src/routes/admin/discount-codes.d.ts +10 -10
  22. package/dist/apps/backend/src/routes/admin/inventory.js +10 -0
  23. package/dist/apps/backend/src/routes/admin/orders.d.ts +54 -42
  24. package/dist/apps/backend/src/routes/admin/orders.js +25 -0
  25. package/dist/apps/backend/src/routes/admin/products.d.ts +12 -12
  26. package/dist/apps/backend/src/routes/admin/products.js +34 -15
  27. package/dist/apps/backend/src/routes/admin/stats.d.ts +9 -7
  28. package/dist/apps/backend/src/routes/admin/variants.d.ts +5 -5
  29. package/dist/apps/backend/src/routes/admin/variants.js +42 -18
  30. package/dist/apps/backend/src/routes/admin/warehouses.d.ts +7 -7
  31. package/dist/apps/backend/src/routes/public/brands.d.ts +1 -1
  32. package/dist/apps/backend/src/routes/public/carts.d.ts +49 -47
  33. package/dist/apps/backend/src/routes/public/carts.js +148 -1
  34. package/dist/apps/backend/src/routes/public/delivery-zones.d.ts +2 -0
  35. package/dist/apps/backend/src/routes/public/delivery-zones.js +2 -0
  36. package/dist/apps/backend/src/routes/public/orders.d.ts +18 -14
  37. package/dist/apps/backend/src/routes/public/orders.js +24 -0
  38. package/dist/apps/backend/src/routes/public/products.d.ts +6 -6
  39. package/dist/apps/backend/src/types/index.d.ts +1 -0
  40. package/dist/apps/backend/src/validators/delivery-zone.d.ts +4 -0
  41. package/dist/apps/backend/src/validators/delivery-zone.js +4 -0
  42. package/dist/apps/backend/src/validators/discount-code.d.ts +3 -3
  43. package/dist/apps/backend/src/validators/order.d.ts +3 -1
  44. package/dist/apps/backend/src/validators/order.js +3 -1
  45. package/dist/packages/api-client/src/fetchers/brands.d.ts +1 -1
  46. package/dist/packages/api-client/src/fetchers/carts.d.ts +49 -47
  47. package/dist/packages/api-client/src/fetchers/delivery-zones.d.ts +2 -0
  48. package/dist/packages/api-client/src/fetchers/orders.d.ts +18 -14
  49. package/dist/packages/api-client/src/fetchers/products.d.ts +6 -6
  50. package/dist/packages/api-client/src/hooks/admin/abandoned-carts.d.ts +10 -10
  51. package/dist/packages/api-client/src/hooks/admin/brands.d.ts +4 -4
  52. package/dist/packages/api-client/src/hooks/admin/customers.d.ts +9 -7
  53. package/dist/packages/api-client/src/hooks/admin/delivery-zones.d.ts +23 -15
  54. package/dist/packages/api-client/src/hooks/admin/discount-codes.d.ts +10 -10
  55. package/dist/packages/api-client/src/hooks/admin/orders.d.ts +54 -42
  56. package/dist/packages/api-client/src/hooks/admin/products.d.ts +6 -6
  57. package/dist/packages/api-client/src/hooks/admin/stats.d.ts +9 -7
  58. package/dist/packages/api-client/src/hooks/admin/variants.d.ts +5 -5
  59. package/dist/packages/api-client/src/hooks/admin/warehouses.d.ts +7 -7
  60. package/dist/packages/api-client/src/hooks/public/brands.d.ts +1 -1
  61. package/dist/packages/api-client/src/hooks/public/carts.d.ts +49 -47
  62. package/dist/packages/api-client/src/hooks/public/delivery-zones.d.ts +2 -0
  63. package/dist/packages/api-client/src/hooks/public/orders.d.ts +18 -14
  64. package/dist/packages/api-client/src/hooks/public/products.d.ts +6 -6
  65. package/dist/packages/api-client/src/rpc-client.d.ts +219 -187
  66. package/package.json +1 -1
@@ -16,8 +16,8 @@ export declare function useListAbandonedCarts(params?: {
16
16
  createdAt: string;
17
17
  updatedAt: string;
18
18
  deletedAt: string;
19
- name: string;
20
19
  id: string;
20
+ name: string;
21
21
  slug: string;
22
22
  logoUrl: string | null;
23
23
  siteUrl: string;
@@ -37,14 +37,14 @@ export declare function useListAbandonedCarts(params?: {
37
37
  lastRecoveryAttemptAt: string;
38
38
  recoveryDiscountCode: {
39
39
  id: string;
40
+ type: string;
41
+ value: string;
40
42
  createdAt: string;
41
43
  updatedAt: string;
42
44
  deletedAt: string;
43
45
  brandId: string | null;
44
46
  isActive: boolean;
45
47
  code: string;
46
- type: string;
47
- value: string;
48
48
  minPurchase: string;
49
49
  maxDiscount: string;
50
50
  usageLimit: number | null;
@@ -62,8 +62,8 @@ export declare function useListAbandonedCarts(params?: {
62
62
  variant: {
63
63
  price: number;
64
64
  product: {
65
- name: string;
66
65
  id: string;
66
+ name: string;
67
67
  slug: string;
68
68
  createdAt: string;
69
69
  updatedAt: string;
@@ -218,8 +218,8 @@ export declare function useListAbandonedCarts(params?: {
218
218
  };
219
219
  };
220
220
  };
221
- name: string | null;
222
221
  id: string;
222
+ name: string | null;
223
223
  createdAt: string;
224
224
  updatedAt: string;
225
225
  deletedAt: string;
@@ -282,8 +282,8 @@ export declare function useGetAbandonedCart(cartId: string, options?: Omit<UseQu
282
282
  createdAt: string;
283
283
  updatedAt: string;
284
284
  deletedAt: string;
285
- name: string;
286
285
  id: string;
286
+ name: string;
287
287
  slug: string;
288
288
  logoUrl: string | null;
289
289
  siteUrl: string;
@@ -303,14 +303,14 @@ export declare function useGetAbandonedCart(cartId: string, options?: Omit<UseQu
303
303
  lastRecoveryAttemptAt: string;
304
304
  recoveryDiscountCode: {
305
305
  id: string;
306
+ type: string;
307
+ value: string;
306
308
  createdAt: string;
307
309
  updatedAt: string;
308
310
  deletedAt: string;
309
311
  brandId: string | null;
310
312
  isActive: boolean;
311
313
  code: string;
312
- type: string;
313
- value: string;
314
314
  minPurchase: string;
315
315
  maxDiscount: string;
316
316
  usageLimit: number | null;
@@ -328,8 +328,8 @@ export declare function useGetAbandonedCart(cartId: string, options?: Omit<UseQu
328
328
  variant: {
329
329
  price: number;
330
330
  product: {
331
- name: string;
332
331
  id: string;
332
+ name: string;
333
333
  slug: string;
334
334
  createdAt: string;
335
335
  updatedAt: string;
@@ -484,8 +484,8 @@ export declare function useGetAbandonedCart(cartId: string, options?: Omit<UseQu
484
484
  };
485
485
  };
486
486
  };
487
- name: string | null;
488
487
  id: string;
488
+ name: string | null;
489
489
  createdAt: string;
490
490
  updatedAt: string;
491
491
  deletedAt: string;
@@ -7,8 +7,8 @@ import { createAdminRpcClients } from '../../rpc-client';
7
7
  * Hook to list all brands using admin RPC
8
8
  */
9
9
  export declare function useListBrands(options?: Omit<UseQueryOptions<Awaited<ReturnType<Awaited<ReturnType<ReturnType<typeof createAdminRpcClients>['brands']['index']['$get']>>['json']>>, Error>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<{
10
- name: string;
11
10
  id: string;
11
+ name: string;
12
12
  slug: string;
13
13
  logoUrl: string | null;
14
14
  siteUrl: string;
@@ -22,8 +22,8 @@ export declare function useListBrands(options?: Omit<UseQueryOptions<Awaited<Ret
22
22
  * Hook to get brand by ID using admin RPC
23
23
  */
24
24
  export declare function useGetBrand(brandId: string, options?: Omit<UseQueryOptions<Awaited<ReturnType<Awaited<ReturnType<ReturnType<typeof createAdminRpcClients>['brands'][':id']['$get']>>['json']>>, Error>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<{
25
- name: string;
26
25
  id: string;
26
+ name: string;
27
27
  slug: string;
28
28
  logoUrl: string | null;
29
29
  siteUrl: string;
@@ -37,8 +37,8 @@ export declare function useGetBrand(brandId: string, options?: Omit<UseQueryOpti
37
37
  * Hook to create a brand using admin RPC
38
38
  */
39
39
  export declare function useCreateBrand(options?: UseMutationOptions<Awaited<ReturnType<Awaited<ReturnType<ReturnType<typeof createAdminRpcClients>['brands']['index']['$post']>>['json']>>, Error, any>): import("@tanstack/react-query").UseMutationResult<{
40
- name: string;
41
40
  id: string;
41
+ name: string;
42
42
  slug: string;
43
43
  logoUrl: string | null;
44
44
  siteUrl: string;
@@ -57,8 +57,8 @@ export declare function useCreateBrand(options?: UseMutationOptions<Awaited<Retu
57
57
  * Hook to update a brand using admin RPC
58
58
  */
59
59
  export declare function useUpdateBrand(brandId: string, options?: UseMutationOptions<Awaited<ReturnType<Awaited<ReturnType<ReturnType<typeof createAdminRpcClients>['brands'][':id']['$patch']>>['json']>>, Error, any>): import("@tanstack/react-query").UseMutationResult<{
60
- name: string;
61
60
  id: string;
61
+ name: string;
62
62
  slug: string;
63
63
  logoUrl: string | null;
64
64
  siteUrl: string;
@@ -31,8 +31,8 @@ export declare function useGetCustomerHistory(phone: string, options?: Omit<UseQ
31
31
  createdAt: string;
32
32
  updatedAt: string;
33
33
  deletedAt: string;
34
- name: string;
35
34
  id: string;
35
+ name: string;
36
36
  slug: string;
37
37
  logoUrl: string | null;
38
38
  siteUrl: string;
@@ -49,18 +49,20 @@ export declare function useGetCustomerHistory(phone: string, options?: Omit<UseQ
49
49
  createdAt: string;
50
50
  updatedAt: string;
51
51
  deletedAt: string;
52
- name: string;
53
52
  id: string;
53
+ name: string;
54
54
  isActive: boolean;
55
55
  };
56
- name: string;
57
56
  id: string;
57
+ name: string;
58
58
  brandId: string | null;
59
59
  stateId: string;
60
60
  allowCOD: boolean;
61
61
  allowOnline: boolean;
62
62
  waybillOnly: boolean;
63
63
  estimatedDays: number | null;
64
+ noteTitle: string | null;
65
+ noteContent: string | null;
64
66
  isActive: boolean;
65
67
  };
66
68
  items: {
@@ -74,8 +76,8 @@ export declare function useGetCustomerHistory(phone: string, options?: Omit<UseQ
74
76
  createdAt: string;
75
77
  updatedAt: string;
76
78
  deletedAt: string;
77
- name: string;
78
79
  id: string;
80
+ name: string;
79
81
  slug: string;
80
82
  brandId: string;
81
83
  isActive: boolean;
@@ -227,8 +229,8 @@ export declare function useGetCustomerHistory(phone: string, options?: Omit<UseQ
227
229
  };
228
230
  };
229
231
  };
230
- name: string | null;
231
232
  id: string;
233
+ name: string | null;
232
234
  isActive: boolean;
233
235
  thumbnailUrl: string | null;
234
236
  productId: string;
@@ -240,8 +242,8 @@ export declare function useGetCustomerHistory(phone: string, options?: Omit<UseQ
240
242
  createdAt: string;
241
243
  updatedAt: string;
242
244
  deletedAt: string;
243
- name: string;
244
245
  id: string;
246
+ name: string;
245
247
  isActive: boolean;
246
248
  address: string | null;
247
249
  city: string | null;
@@ -253,8 +255,8 @@ export declare function useGetCustomerHistory(phone: string, options?: Omit<UseQ
253
255
  warehouseId: string | null;
254
256
  quantity: number;
255
257
  }[];
256
- id: string;
257
258
  email: string | null;
259
+ id: string;
258
260
  brandId: string;
259
261
  deliveryZoneId: string;
260
262
  recoveryAttempts: number;
@@ -17,8 +17,8 @@ export declare function useListStates(options?: Omit<UseQueryOptions<Awaited<Ret
17
17
  createdAt: string;
18
18
  updatedAt: string;
19
19
  deletedAt: string;
20
- name: string;
21
20
  id: string;
21
+ name: string;
22
22
  slug: string;
23
23
  logoUrl: string | null;
24
24
  siteUrl: string;
@@ -28,29 +28,31 @@ export declare function useListStates(options?: Omit<UseQueryOptions<Awaited<Ret
28
28
  stateName: string;
29
29
  brandName: string;
30
30
  state: {
31
- name: string;
32
31
  id: string;
32
+ name: string;
33
33
  createdAt: string;
34
34
  updatedAt: string;
35
35
  deletedAt: string;
36
36
  isActive: boolean;
37
37
  };
38
- name: string;
39
38
  id: string;
39
+ name: string;
40
40
  brandId: string | null;
41
41
  stateId: string;
42
42
  allowCOD: boolean;
43
43
  allowOnline: boolean;
44
44
  waybillOnly: boolean;
45
45
  estimatedDays: number | null;
46
+ noteTitle: string | null;
47
+ noteContent: string | null;
46
48
  isActive: boolean;
47
49
  }[];
48
50
  zonesCount: number;
49
51
  createdAt: string;
50
52
  updatedAt: string;
51
53
  deletedAt: string;
52
- name: string;
53
54
  id: string;
55
+ name: string;
54
56
  isActive: boolean;
55
57
  }[], Error>;
56
58
  /**
@@ -66,8 +68,8 @@ export declare function useCreateState(options?: UseMutationOptions<Awaited<Retu
66
68
  createdAt: string;
67
69
  updatedAt: string;
68
70
  deletedAt: string;
69
- name: string;
70
71
  id: string;
72
+ name: string;
71
73
  isActive: boolean;
72
74
  deliveryZones?: never;
73
75
  } | {
@@ -84,8 +86,8 @@ export declare function useUpdateState(stateId: string, options?: UseMutationOpt
84
86
  createdAt: string;
85
87
  updatedAt: string;
86
88
  deletedAt: string;
87
- name: string;
88
89
  id: string;
90
+ name: string;
89
91
  isActive: boolean;
90
92
  deliveryZones?: never;
91
93
  } | {
@@ -124,8 +126,8 @@ export declare function useListDeliveryZones(params?: {
124
126
  createdAt: string;
125
127
  updatedAt: string;
126
128
  deletedAt: string;
127
- name: string;
128
129
  id: string;
130
+ name: string;
129
131
  slug: string;
130
132
  logoUrl: string | null;
131
133
  siteUrl: string;
@@ -135,21 +137,23 @@ export declare function useListDeliveryZones(params?: {
135
137
  stateName: string;
136
138
  brandName: string;
137
139
  state: {
138
- name: string;
139
140
  id: string;
141
+ name: string;
140
142
  createdAt: string;
141
143
  updatedAt: string;
142
144
  deletedAt: string;
143
145
  isActive: boolean;
144
146
  };
145
- name: string;
146
147
  id: string;
148
+ name: string;
147
149
  brandId: string | null;
148
150
  stateId: string;
149
151
  allowCOD: boolean;
150
152
  allowOnline: boolean;
151
153
  waybillOnly: boolean;
152
154
  estimatedDays: number | null;
155
+ noteTitle: string | null;
156
+ noteContent: string | null;
153
157
  isActive: boolean;
154
158
  }[], Error>;
155
159
  /**
@@ -165,8 +169,8 @@ export declare function useCreateDeliveryZone(options?: UseMutationOptions<Await
165
169
  createdAt: string;
166
170
  updatedAt: string;
167
171
  deletedAt: string;
168
- name: string;
169
172
  id: string;
173
+ name: string;
170
174
  slug: string;
171
175
  logoUrl: string | null;
172
176
  siteUrl: string;
@@ -176,21 +180,23 @@ export declare function useCreateDeliveryZone(options?: UseMutationOptions<Await
176
180
  stateName: string;
177
181
  brandName: string;
178
182
  state: {
179
- name: string;
180
183
  id: string;
184
+ name: string;
181
185
  createdAt: string;
182
186
  updatedAt: string;
183
187
  deletedAt: string;
184
188
  isActive: boolean;
185
189
  };
186
- name: string;
187
190
  id: string;
191
+ name: string;
188
192
  brandId: string | null;
189
193
  stateId: string;
190
194
  allowCOD: boolean;
191
195
  allowOnline: boolean;
192
196
  waybillOnly: boolean;
193
197
  estimatedDays: number | null;
198
+ noteTitle: string | null;
199
+ noteContent: string | null;
194
200
  isActive: boolean;
195
201
  } | {
196
202
  error: {
@@ -221,8 +227,8 @@ export declare function useUpdateDeliveryZone(zoneId: string, options?: UseMutat
221
227
  createdAt: string;
222
228
  updatedAt: string;
223
229
  deletedAt: string;
224
- name: string;
225
230
  id: string;
231
+ name: string;
226
232
  slug: string;
227
233
  logoUrl: string | null;
228
234
  siteUrl: string;
@@ -232,21 +238,23 @@ export declare function useUpdateDeliveryZone(zoneId: string, options?: UseMutat
232
238
  stateName: string;
233
239
  brandName: string;
234
240
  state: {
235
- name: string;
236
241
  id: string;
242
+ name: string;
237
243
  createdAt: string;
238
244
  updatedAt: string;
239
245
  deletedAt: string;
240
246
  isActive: boolean;
241
247
  };
242
- name: string;
243
248
  id: string;
249
+ name: string;
244
250
  brandId: string | null;
245
251
  stateId: string;
246
252
  allowCOD: boolean;
247
253
  allowOnline: boolean;
248
254
  waybillOnly: boolean;
249
255
  estimatedDays: number | null;
256
+ noteTitle: string | null;
257
+ noteContent: string | null;
250
258
  isActive: boolean;
251
259
  } | {
252
260
  error: {
@@ -25,8 +25,8 @@ export declare function useListDiscountCodes(params?: {
25
25
  createdAt: string;
26
26
  updatedAt: string;
27
27
  deletedAt: string;
28
- name: string;
29
28
  id: string;
29
+ name: string;
30
30
  slug: string;
31
31
  logoUrl: string | null;
32
32
  siteUrl: string;
@@ -36,10 +36,10 @@ export declare function useListDiscountCodes(params?: {
36
36
  isExpired: boolean;
37
37
  usagePercentage: number;
38
38
  id: string;
39
+ type: string;
39
40
  brandId: string | null;
40
41
  isActive: boolean;
41
42
  code: string;
42
- type: string;
43
43
  usageLimit: number | null;
44
44
  usageCount: number;
45
45
  perCustomerLimit: number | null;
@@ -75,8 +75,8 @@ export declare function useGetDiscountCode(codeId: string, options?: Omit<UseQue
75
75
  createdAt: string;
76
76
  updatedAt: string;
77
77
  deletedAt: string;
78
- name: string;
79
78
  id: string;
79
+ name: string;
80
80
  slug: string;
81
81
  logoUrl: string | null;
82
82
  siteUrl: string;
@@ -86,10 +86,10 @@ export declare function useGetDiscountCode(codeId: string, options?: Omit<UseQue
86
86
  isExpired: boolean;
87
87
  usagePercentage: number;
88
88
  id: string;
89
+ type: string;
89
90
  brandId: string | null;
90
91
  isActive: boolean;
91
92
  code: string;
92
- type: string;
93
93
  usageLimit: number | null;
94
94
  usageCount: number;
95
95
  perCustomerLimit: number | null;
@@ -124,8 +124,8 @@ export declare function useCreateDiscountCode(options?: UseMutationOptions<Await
124
124
  createdAt: string;
125
125
  updatedAt: string;
126
126
  deletedAt: string;
127
- name: string;
128
127
  id: string;
128
+ name: string;
129
129
  slug: string;
130
130
  logoUrl: string | null;
131
131
  siteUrl: string;
@@ -135,10 +135,10 @@ export declare function useCreateDiscountCode(options?: UseMutationOptions<Await
135
135
  isExpired: boolean;
136
136
  usagePercentage: number;
137
137
  id: string;
138
+ type: string;
138
139
  brandId: string | null;
139
140
  isActive: boolean;
140
141
  code: string;
141
- type: string;
142
142
  usageLimit: number | null;
143
143
  usageCount: number;
144
144
  perCustomerLimit: number | null;
@@ -168,8 +168,8 @@ export declare function useUpdateDiscountCode(codeId: string, options?: UseMutat
168
168
  createdAt: string;
169
169
  updatedAt: string;
170
170
  deletedAt: string;
171
- name: string;
172
171
  id: string;
172
+ name: string;
173
173
  slug: string;
174
174
  logoUrl: string | null;
175
175
  siteUrl: string;
@@ -179,10 +179,10 @@ export declare function useUpdateDiscountCode(codeId: string, options?: UseMutat
179
179
  isExpired: boolean;
180
180
  usagePercentage: number;
181
181
  id: string;
182
+ type: string;
182
183
  brandId: string | null;
183
184
  isActive: boolean;
184
185
  code: string;
185
- type: string;
186
186
  usageLimit: number | null;
187
187
  usageCount: number;
188
188
  perCustomerLimit: number | null;
@@ -247,8 +247,8 @@ export declare function useGetDiscountCodeAnalytics(codeId: string, options?: Om
247
247
  createdAt: string;
248
248
  updatedAt: string;
249
249
  deletedAt: string;
250
- name: string;
251
250
  id: string;
251
+ name: string;
252
252
  slug: string;
253
253
  logoUrl: string | null;
254
254
  siteUrl: string;
@@ -257,10 +257,10 @@ export declare function useGetDiscountCodeAnalytics(codeId: string, options?: Om
257
257
  };
258
258
  isExpired: boolean;
259
259
  id: string;
260
+ type: string;
260
261
  brandId: string | null;
261
262
  isActive: boolean;
262
263
  code: string;
263
- type: string;
264
264
  usageLimit: number | null;
265
265
  usageCount: number;
266
266
  perCustomerLimit: number | null;