@instockng/api-client 1.0.12 → 1.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/fetchers/carts.d.ts +45 -0
- package/dist/fetchers/orders.d.ts +10 -0
- package/dist/fetchers/products.d.ts +10 -0
- package/dist/hooks/admin/abandoned-carts.d.ts +10 -0
- package/dist/hooks/admin/brands.d.ts +4 -0
- package/dist/hooks/admin/customers.d.ts +5 -0
- package/dist/hooks/admin/delivery-zones.d.ts +4 -0
- package/dist/hooks/admin/discount-codes.d.ts +5 -0
- package/dist/hooks/admin/inventory.d.ts +4 -0
- package/dist/hooks/admin/orders.d.ts +390 -0
- package/dist/hooks/admin/orders.js +31 -0
- package/dist/hooks/admin/products.d.ts +10 -0
- package/dist/hooks/admin/stats.d.ts +5 -0
- package/dist/hooks/admin/warehouses.d.ts +5 -0
- package/dist/hooks/public/carts.d.ts +45 -0
- package/dist/hooks/public/orders.d.ts +10 -0
- package/dist/hooks/public/products.d.ts +10 -0
- package/dist/rpc-client.d.ts +531 -0
- package/package.json +1 -1
|
@@ -48,6 +48,7 @@ export declare function useListOrders(filters?: {
|
|
|
48
48
|
siteUrl: string;
|
|
49
49
|
domain: string;
|
|
50
50
|
metaPixelId: string | null;
|
|
51
|
+
tiktokPixelId: string | null;
|
|
51
52
|
paystackPublicKey: string | null;
|
|
52
53
|
paystackSecretKey: string | null;
|
|
53
54
|
};
|
|
@@ -165,7 +166,9 @@ export declare function useListOrders(filters?: {
|
|
|
165
166
|
includes?: boolean;
|
|
166
167
|
flatMap?: boolean;
|
|
167
168
|
flat?: boolean;
|
|
169
|
+
at?: boolean;
|
|
168
170
|
};
|
|
171
|
+
at: never;
|
|
169
172
|
};
|
|
170
173
|
} | {
|
|
171
174
|
[x: number]: string | number | boolean | {
|
|
@@ -238,7 +241,9 @@ export declare function useListOrders(filters?: {
|
|
|
238
241
|
includes?: boolean;
|
|
239
242
|
flatMap?: boolean;
|
|
240
243
|
flat?: boolean;
|
|
244
|
+
at?: boolean;
|
|
241
245
|
};
|
|
246
|
+
at: never;
|
|
242
247
|
};
|
|
243
248
|
};
|
|
244
249
|
id: string;
|
|
@@ -328,6 +333,7 @@ export declare function useGetOrder(orderId: string, options?: Omit<UseQueryOpti
|
|
|
328
333
|
siteUrl: string;
|
|
329
334
|
domain: string;
|
|
330
335
|
metaPixelId: string | null;
|
|
336
|
+
tiktokPixelId: string | null;
|
|
331
337
|
paystackPublicKey: string | null;
|
|
332
338
|
paystackSecretKey: string | null;
|
|
333
339
|
};
|
|
@@ -445,7 +451,9 @@ export declare function useGetOrder(orderId: string, options?: Omit<UseQueryOpti
|
|
|
445
451
|
includes?: boolean;
|
|
446
452
|
flatMap?: boolean;
|
|
447
453
|
flat?: boolean;
|
|
454
|
+
at?: boolean;
|
|
448
455
|
};
|
|
456
|
+
at: never;
|
|
449
457
|
};
|
|
450
458
|
} | {
|
|
451
459
|
[x: number]: string | number | boolean | {
|
|
@@ -518,7 +526,9 @@ export declare function useGetOrder(orderId: string, options?: Omit<UseQueryOpti
|
|
|
518
526
|
includes?: boolean;
|
|
519
527
|
flatMap?: boolean;
|
|
520
528
|
flat?: boolean;
|
|
529
|
+
at?: boolean;
|
|
521
530
|
};
|
|
531
|
+
at: never;
|
|
522
532
|
};
|
|
523
533
|
};
|
|
524
534
|
id: string;
|
|
@@ -605,6 +615,7 @@ export declare function useCreateOrder(options?: UseMutationOptions<Awaited<Retu
|
|
|
605
615
|
siteUrl: string;
|
|
606
616
|
domain: string;
|
|
607
617
|
metaPixelId: string | null;
|
|
618
|
+
tiktokPixelId: string | null;
|
|
608
619
|
paystackPublicKey: string | null;
|
|
609
620
|
paystackSecretKey: string | null;
|
|
610
621
|
};
|
|
@@ -722,7 +733,9 @@ export declare function useCreateOrder(options?: UseMutationOptions<Awaited<Retu
|
|
|
722
733
|
includes?: boolean;
|
|
723
734
|
flatMap?: boolean;
|
|
724
735
|
flat?: boolean;
|
|
736
|
+
at?: boolean;
|
|
725
737
|
};
|
|
738
|
+
at: never;
|
|
726
739
|
};
|
|
727
740
|
} | {
|
|
728
741
|
[x: number]: string | number | boolean | {
|
|
@@ -795,7 +808,9 @@ export declare function useCreateOrder(options?: UseMutationOptions<Awaited<Retu
|
|
|
795
808
|
includes?: boolean;
|
|
796
809
|
flatMap?: boolean;
|
|
797
810
|
flat?: boolean;
|
|
811
|
+
at?: boolean;
|
|
798
812
|
};
|
|
813
|
+
at: never;
|
|
799
814
|
};
|
|
800
815
|
};
|
|
801
816
|
id: string;
|
|
@@ -883,6 +898,7 @@ export declare function useUpdateOrder(orderId: string, options?: UseMutationOpt
|
|
|
883
898
|
siteUrl: string;
|
|
884
899
|
domain: string;
|
|
885
900
|
metaPixelId: string | null;
|
|
901
|
+
tiktokPixelId: string | null;
|
|
886
902
|
paystackPublicKey: string | null;
|
|
887
903
|
paystackSecretKey: string | null;
|
|
888
904
|
};
|
|
@@ -1000,7 +1016,9 @@ export declare function useUpdateOrder(orderId: string, options?: UseMutationOpt
|
|
|
1000
1016
|
includes?: boolean;
|
|
1001
1017
|
flatMap?: boolean;
|
|
1002
1018
|
flat?: boolean;
|
|
1019
|
+
at?: boolean;
|
|
1003
1020
|
};
|
|
1021
|
+
at: never;
|
|
1004
1022
|
};
|
|
1005
1023
|
} | {
|
|
1006
1024
|
[x: number]: string | number | boolean | {
|
|
@@ -1073,7 +1091,9 @@ export declare function useUpdateOrder(orderId: string, options?: UseMutationOpt
|
|
|
1073
1091
|
includes?: boolean;
|
|
1074
1092
|
flatMap?: boolean;
|
|
1075
1093
|
flat?: boolean;
|
|
1094
|
+
at?: boolean;
|
|
1076
1095
|
};
|
|
1096
|
+
at: never;
|
|
1077
1097
|
};
|
|
1078
1098
|
};
|
|
1079
1099
|
id: string;
|
|
@@ -1137,6 +1157,7 @@ export declare function useUpdateOrder(orderId: string, options?: UseMutationOpt
|
|
|
1137
1157
|
siteUrl: string;
|
|
1138
1158
|
domain: string;
|
|
1139
1159
|
metaPixelId: string | null;
|
|
1160
|
+
tiktokPixelId: string | null;
|
|
1140
1161
|
paystackPublicKey: string | null;
|
|
1141
1162
|
paystackSecretKey: string | null;
|
|
1142
1163
|
createdAt: string;
|
|
@@ -1263,7 +1284,9 @@ export declare function useUpdateOrder(orderId: string, options?: UseMutationOpt
|
|
|
1263
1284
|
includes?: boolean;
|
|
1264
1285
|
flatMap?: boolean;
|
|
1265
1286
|
flat?: boolean;
|
|
1287
|
+
at?: boolean;
|
|
1266
1288
|
};
|
|
1289
|
+
at: never;
|
|
1267
1290
|
};
|
|
1268
1291
|
} | {
|
|
1269
1292
|
[x: number]: string | number | boolean | {
|
|
@@ -1336,7 +1359,9 @@ export declare function useUpdateOrder(orderId: string, options?: UseMutationOpt
|
|
|
1336
1359
|
includes?: boolean;
|
|
1337
1360
|
flatMap?: boolean;
|
|
1338
1361
|
flat?: boolean;
|
|
1362
|
+
at?: boolean;
|
|
1339
1363
|
};
|
|
1364
|
+
at: never;
|
|
1340
1365
|
};
|
|
1341
1366
|
};
|
|
1342
1367
|
id: string;
|
|
@@ -1359,6 +1384,172 @@ export declare function useUpdateOrder(orderId: string, options?: UseMutationOpt
|
|
|
1359
1384
|
quantity: number;
|
|
1360
1385
|
priceAtPurchase: string;
|
|
1361
1386
|
}[];
|
|
1387
|
+
notes: {
|
|
1388
|
+
User: {
|
|
1389
|
+
email: string;
|
|
1390
|
+
id: string;
|
|
1391
|
+
name: string | null;
|
|
1392
|
+
createdAt: string;
|
|
1393
|
+
deletedAt: string;
|
|
1394
|
+
clerkId: string;
|
|
1395
|
+
role: string;
|
|
1396
|
+
};
|
|
1397
|
+
id: string;
|
|
1398
|
+
metadata: string | number | boolean | {
|
|
1399
|
+
[x: string]: string | number | boolean | /*elided*/ any | {
|
|
1400
|
+
[x: number]: string | number | boolean | /*elided*/ any | /*elided*/ any;
|
|
1401
|
+
length: number;
|
|
1402
|
+
toString: never;
|
|
1403
|
+
toLocaleString: never;
|
|
1404
|
+
pop: never;
|
|
1405
|
+
push: never;
|
|
1406
|
+
concat: never;
|
|
1407
|
+
join: never;
|
|
1408
|
+
reverse: never;
|
|
1409
|
+
shift: never;
|
|
1410
|
+
slice: never;
|
|
1411
|
+
sort: never;
|
|
1412
|
+
splice: never;
|
|
1413
|
+
unshift: never;
|
|
1414
|
+
indexOf: never;
|
|
1415
|
+
lastIndexOf: never;
|
|
1416
|
+
every: never;
|
|
1417
|
+
some: never;
|
|
1418
|
+
forEach: never;
|
|
1419
|
+
map: never;
|
|
1420
|
+
filter: never;
|
|
1421
|
+
reduce: never;
|
|
1422
|
+
reduceRight: never;
|
|
1423
|
+
find: never;
|
|
1424
|
+
findIndex: never;
|
|
1425
|
+
fill: never;
|
|
1426
|
+
copyWithin: never;
|
|
1427
|
+
entries: never;
|
|
1428
|
+
keys: never;
|
|
1429
|
+
values: never;
|
|
1430
|
+
includes: never;
|
|
1431
|
+
flatMap: never;
|
|
1432
|
+
flat: never;
|
|
1433
|
+
[Symbol.iterator]: never;
|
|
1434
|
+
readonly [Symbol.unscopables]: {
|
|
1435
|
+
[x: number]: boolean;
|
|
1436
|
+
length?: boolean;
|
|
1437
|
+
toString?: boolean;
|
|
1438
|
+
toLocaleString?: boolean;
|
|
1439
|
+
pop?: boolean;
|
|
1440
|
+
push?: boolean;
|
|
1441
|
+
concat?: boolean;
|
|
1442
|
+
join?: boolean;
|
|
1443
|
+
reverse?: boolean;
|
|
1444
|
+
shift?: boolean;
|
|
1445
|
+
slice?: boolean;
|
|
1446
|
+
sort?: boolean;
|
|
1447
|
+
splice?: boolean;
|
|
1448
|
+
unshift?: boolean;
|
|
1449
|
+
indexOf?: boolean;
|
|
1450
|
+
lastIndexOf?: boolean;
|
|
1451
|
+
every?: boolean;
|
|
1452
|
+
some?: boolean;
|
|
1453
|
+
forEach?: boolean;
|
|
1454
|
+
map?: boolean;
|
|
1455
|
+
filter?: boolean;
|
|
1456
|
+
reduce?: boolean;
|
|
1457
|
+
reduceRight?: boolean;
|
|
1458
|
+
find?: boolean;
|
|
1459
|
+
findIndex?: boolean;
|
|
1460
|
+
fill?: boolean;
|
|
1461
|
+
copyWithin?: boolean;
|
|
1462
|
+
entries?: boolean;
|
|
1463
|
+
keys?: boolean;
|
|
1464
|
+
values?: boolean;
|
|
1465
|
+
includes?: boolean;
|
|
1466
|
+
flatMap?: boolean;
|
|
1467
|
+
flat?: boolean;
|
|
1468
|
+
at?: boolean;
|
|
1469
|
+
};
|
|
1470
|
+
at: never;
|
|
1471
|
+
};
|
|
1472
|
+
} | {
|
|
1473
|
+
[x: number]: string | number | boolean | {
|
|
1474
|
+
[x: string]: string | number | boolean | /*elided*/ any | /*elided*/ any;
|
|
1475
|
+
} | /*elided*/ any;
|
|
1476
|
+
length: number;
|
|
1477
|
+
toString: never;
|
|
1478
|
+
toLocaleString: never;
|
|
1479
|
+
pop: never;
|
|
1480
|
+
push: never;
|
|
1481
|
+
concat: never;
|
|
1482
|
+
join: never;
|
|
1483
|
+
reverse: never;
|
|
1484
|
+
shift: never;
|
|
1485
|
+
slice: never;
|
|
1486
|
+
sort: never;
|
|
1487
|
+
splice: never;
|
|
1488
|
+
unshift: never;
|
|
1489
|
+
indexOf: never;
|
|
1490
|
+
lastIndexOf: never;
|
|
1491
|
+
every: never;
|
|
1492
|
+
some: never;
|
|
1493
|
+
forEach: never;
|
|
1494
|
+
map: never;
|
|
1495
|
+
filter: never;
|
|
1496
|
+
reduce: never;
|
|
1497
|
+
reduceRight: never;
|
|
1498
|
+
find: never;
|
|
1499
|
+
findIndex: never;
|
|
1500
|
+
fill: never;
|
|
1501
|
+
copyWithin: never;
|
|
1502
|
+
entries: never;
|
|
1503
|
+
keys: never;
|
|
1504
|
+
values: never;
|
|
1505
|
+
includes: never;
|
|
1506
|
+
flatMap: never;
|
|
1507
|
+
flat: never;
|
|
1508
|
+
[Symbol.iterator]: never;
|
|
1509
|
+
readonly [Symbol.unscopables]: {
|
|
1510
|
+
[x: number]: boolean;
|
|
1511
|
+
length?: boolean;
|
|
1512
|
+
toString?: boolean;
|
|
1513
|
+
toLocaleString?: boolean;
|
|
1514
|
+
pop?: boolean;
|
|
1515
|
+
push?: boolean;
|
|
1516
|
+
concat?: boolean;
|
|
1517
|
+
join?: boolean;
|
|
1518
|
+
reverse?: boolean;
|
|
1519
|
+
shift?: boolean;
|
|
1520
|
+
slice?: boolean;
|
|
1521
|
+
sort?: boolean;
|
|
1522
|
+
splice?: boolean;
|
|
1523
|
+
unshift?: boolean;
|
|
1524
|
+
indexOf?: boolean;
|
|
1525
|
+
lastIndexOf?: boolean;
|
|
1526
|
+
every?: boolean;
|
|
1527
|
+
some?: boolean;
|
|
1528
|
+
forEach?: boolean;
|
|
1529
|
+
map?: boolean;
|
|
1530
|
+
filter?: boolean;
|
|
1531
|
+
reduce?: boolean;
|
|
1532
|
+
reduceRight?: boolean;
|
|
1533
|
+
find?: boolean;
|
|
1534
|
+
findIndex?: boolean;
|
|
1535
|
+
fill?: boolean;
|
|
1536
|
+
copyWithin?: boolean;
|
|
1537
|
+
entries?: boolean;
|
|
1538
|
+
keys?: boolean;
|
|
1539
|
+
values?: boolean;
|
|
1540
|
+
includes?: boolean;
|
|
1541
|
+
flatMap?: boolean;
|
|
1542
|
+
flat?: boolean;
|
|
1543
|
+
at?: boolean;
|
|
1544
|
+
};
|
|
1545
|
+
at: never;
|
|
1546
|
+
};
|
|
1547
|
+
type: import("@prisma/client").$Enums.NoteType;
|
|
1548
|
+
createdAt: string;
|
|
1549
|
+
createdBy: string | null;
|
|
1550
|
+
orderId: string;
|
|
1551
|
+
note: string;
|
|
1552
|
+
}[];
|
|
1362
1553
|
email: string | null;
|
|
1363
1554
|
id: string;
|
|
1364
1555
|
createdAt: string;
|
|
@@ -1421,6 +1612,7 @@ export declare function useUpdateOrderStatus(orderId: string, options?: UseMutat
|
|
|
1421
1612
|
siteUrl: string;
|
|
1422
1613
|
domain: string;
|
|
1423
1614
|
metaPixelId: string | null;
|
|
1615
|
+
tiktokPixelId: string | null;
|
|
1424
1616
|
paystackPublicKey: string | null;
|
|
1425
1617
|
paystackSecretKey: string | null;
|
|
1426
1618
|
};
|
|
@@ -1538,7 +1730,9 @@ export declare function useUpdateOrderStatus(orderId: string, options?: UseMutat
|
|
|
1538
1730
|
includes?: boolean;
|
|
1539
1731
|
flatMap?: boolean;
|
|
1540
1732
|
flat?: boolean;
|
|
1733
|
+
at?: boolean;
|
|
1541
1734
|
};
|
|
1735
|
+
at: never;
|
|
1542
1736
|
};
|
|
1543
1737
|
} | {
|
|
1544
1738
|
[x: number]: string | number | boolean | {
|
|
@@ -1611,7 +1805,9 @@ export declare function useUpdateOrderStatus(orderId: string, options?: UseMutat
|
|
|
1611
1805
|
includes?: boolean;
|
|
1612
1806
|
flatMap?: boolean;
|
|
1613
1807
|
flat?: boolean;
|
|
1808
|
+
at?: boolean;
|
|
1614
1809
|
};
|
|
1810
|
+
at: never;
|
|
1615
1811
|
};
|
|
1616
1812
|
};
|
|
1617
1813
|
id: string;
|
|
@@ -1684,3 +1880,197 @@ export declare function useUpdateOrderStatus(orderId: string, options?: UseMutat
|
|
|
1684
1880
|
* @param options - React Query mutation options
|
|
1685
1881
|
*/
|
|
1686
1882
|
export declare function useDeleteOrder(orderId: string, options?: UseMutationOptions<Awaited<ReturnType<Awaited<ReturnType<ReturnType<typeof createAdminRpcClients>['orders'][':id']['$delete']>>['json']>>, Error, void>): import("@tanstack/react-query").UseMutationResult<unknown, Error, void, unknown>;
|
|
1883
|
+
/**
|
|
1884
|
+
* Hook to add a note to an order using admin RPC
|
|
1885
|
+
*
|
|
1886
|
+
* @param orderId - Order UUID
|
|
1887
|
+
* @param options - React Query mutation options
|
|
1888
|
+
*
|
|
1889
|
+
* @example
|
|
1890
|
+
* ```tsx
|
|
1891
|
+
* const addNote = useAddOrderNote(orderId);
|
|
1892
|
+
* addNote.mutate({ note: 'Customer called to confirm', type: 'customer_communication' });
|
|
1893
|
+
* ```
|
|
1894
|
+
*/
|
|
1895
|
+
export declare function useAddOrderNote(orderId: string, options?: UseMutationOptions<Awaited<ReturnType<Awaited<ReturnType<ReturnType<typeof createAdminRpcClients>['orders'][':id']['notes']['$post']>>['json']>>, Error, {
|
|
1896
|
+
note: string;
|
|
1897
|
+
type?: 'general' | 'status_change' | 'prospect_reason' | 'delivery_attempt' | 'customer_communication' | 'internal';
|
|
1898
|
+
}>): import("@tanstack/react-query").UseMutationResult<{
|
|
1899
|
+
error: {
|
|
1900
|
+
code: string;
|
|
1901
|
+
message: string;
|
|
1902
|
+
};
|
|
1903
|
+
} | {
|
|
1904
|
+
User: {
|
|
1905
|
+
email: string;
|
|
1906
|
+
id: string;
|
|
1907
|
+
name: string | null;
|
|
1908
|
+
createdAt: string;
|
|
1909
|
+
deletedAt: string;
|
|
1910
|
+
clerkId: string;
|
|
1911
|
+
role: string;
|
|
1912
|
+
};
|
|
1913
|
+
id: string;
|
|
1914
|
+
metadata: string | number | boolean | {
|
|
1915
|
+
[x: string]: string | number | boolean | /*elided*/ any | {
|
|
1916
|
+
[x: number]: string | number | boolean | /*elided*/ any | /*elided*/ any;
|
|
1917
|
+
length: number;
|
|
1918
|
+
toString: never;
|
|
1919
|
+
toLocaleString: never;
|
|
1920
|
+
pop: never;
|
|
1921
|
+
push: never;
|
|
1922
|
+
concat: never;
|
|
1923
|
+
join: never;
|
|
1924
|
+
reverse: never;
|
|
1925
|
+
shift: never;
|
|
1926
|
+
slice: never;
|
|
1927
|
+
sort: never;
|
|
1928
|
+
splice: never;
|
|
1929
|
+
unshift: never;
|
|
1930
|
+
indexOf: never;
|
|
1931
|
+
lastIndexOf: never;
|
|
1932
|
+
every: never;
|
|
1933
|
+
some: never;
|
|
1934
|
+
forEach: never;
|
|
1935
|
+
map: never;
|
|
1936
|
+
filter: never;
|
|
1937
|
+
reduce: never;
|
|
1938
|
+
reduceRight: never;
|
|
1939
|
+
find: never;
|
|
1940
|
+
findIndex: never;
|
|
1941
|
+
fill: never;
|
|
1942
|
+
copyWithin: never;
|
|
1943
|
+
entries: never;
|
|
1944
|
+
keys: never;
|
|
1945
|
+
values: never;
|
|
1946
|
+
includes: never;
|
|
1947
|
+
flatMap: never;
|
|
1948
|
+
flat: never;
|
|
1949
|
+
[Symbol.iterator]: never;
|
|
1950
|
+
readonly [Symbol.unscopables]: {
|
|
1951
|
+
[x: number]: boolean;
|
|
1952
|
+
length?: boolean;
|
|
1953
|
+
toString?: boolean;
|
|
1954
|
+
toLocaleString?: boolean;
|
|
1955
|
+
pop?: boolean;
|
|
1956
|
+
push?: boolean;
|
|
1957
|
+
concat?: boolean;
|
|
1958
|
+
join?: boolean;
|
|
1959
|
+
reverse?: boolean;
|
|
1960
|
+
shift?: boolean;
|
|
1961
|
+
slice?: boolean;
|
|
1962
|
+
sort?: boolean;
|
|
1963
|
+
splice?: boolean;
|
|
1964
|
+
unshift?: boolean;
|
|
1965
|
+
indexOf?: boolean;
|
|
1966
|
+
lastIndexOf?: boolean;
|
|
1967
|
+
every?: boolean;
|
|
1968
|
+
some?: boolean;
|
|
1969
|
+
forEach?: boolean;
|
|
1970
|
+
map?: boolean;
|
|
1971
|
+
filter?: boolean;
|
|
1972
|
+
reduce?: boolean;
|
|
1973
|
+
reduceRight?: boolean;
|
|
1974
|
+
find?: boolean;
|
|
1975
|
+
findIndex?: boolean;
|
|
1976
|
+
fill?: boolean;
|
|
1977
|
+
copyWithin?: boolean;
|
|
1978
|
+
entries?: boolean;
|
|
1979
|
+
keys?: boolean;
|
|
1980
|
+
values?: boolean;
|
|
1981
|
+
includes?: boolean;
|
|
1982
|
+
flatMap?: boolean;
|
|
1983
|
+
flat?: boolean;
|
|
1984
|
+
at?: boolean;
|
|
1985
|
+
};
|
|
1986
|
+
at: never;
|
|
1987
|
+
};
|
|
1988
|
+
} | {
|
|
1989
|
+
[x: number]: string | number | boolean | {
|
|
1990
|
+
[x: string]: string | number | boolean | /*elided*/ any | /*elided*/ any;
|
|
1991
|
+
} | /*elided*/ any;
|
|
1992
|
+
length: number;
|
|
1993
|
+
toString: never;
|
|
1994
|
+
toLocaleString: never;
|
|
1995
|
+
pop: never;
|
|
1996
|
+
push: never;
|
|
1997
|
+
concat: never;
|
|
1998
|
+
join: never;
|
|
1999
|
+
reverse: never;
|
|
2000
|
+
shift: never;
|
|
2001
|
+
slice: never;
|
|
2002
|
+
sort: never;
|
|
2003
|
+
splice: never;
|
|
2004
|
+
unshift: never;
|
|
2005
|
+
indexOf: never;
|
|
2006
|
+
lastIndexOf: never;
|
|
2007
|
+
every: never;
|
|
2008
|
+
some: never;
|
|
2009
|
+
forEach: never;
|
|
2010
|
+
map: never;
|
|
2011
|
+
filter: never;
|
|
2012
|
+
reduce: never;
|
|
2013
|
+
reduceRight: never;
|
|
2014
|
+
find: never;
|
|
2015
|
+
findIndex: never;
|
|
2016
|
+
fill: never;
|
|
2017
|
+
copyWithin: never;
|
|
2018
|
+
entries: never;
|
|
2019
|
+
keys: never;
|
|
2020
|
+
values: never;
|
|
2021
|
+
includes: never;
|
|
2022
|
+
flatMap: never;
|
|
2023
|
+
flat: never;
|
|
2024
|
+
[Symbol.iterator]: never;
|
|
2025
|
+
readonly [Symbol.unscopables]: {
|
|
2026
|
+
[x: number]: boolean;
|
|
2027
|
+
length?: boolean;
|
|
2028
|
+
toString?: boolean;
|
|
2029
|
+
toLocaleString?: boolean;
|
|
2030
|
+
pop?: boolean;
|
|
2031
|
+
push?: boolean;
|
|
2032
|
+
concat?: boolean;
|
|
2033
|
+
join?: boolean;
|
|
2034
|
+
reverse?: boolean;
|
|
2035
|
+
shift?: boolean;
|
|
2036
|
+
slice?: boolean;
|
|
2037
|
+
sort?: boolean;
|
|
2038
|
+
splice?: boolean;
|
|
2039
|
+
unshift?: boolean;
|
|
2040
|
+
indexOf?: boolean;
|
|
2041
|
+
lastIndexOf?: boolean;
|
|
2042
|
+
every?: boolean;
|
|
2043
|
+
some?: boolean;
|
|
2044
|
+
forEach?: boolean;
|
|
2045
|
+
map?: boolean;
|
|
2046
|
+
filter?: boolean;
|
|
2047
|
+
reduce?: boolean;
|
|
2048
|
+
reduceRight?: boolean;
|
|
2049
|
+
find?: boolean;
|
|
2050
|
+
findIndex?: boolean;
|
|
2051
|
+
fill?: boolean;
|
|
2052
|
+
copyWithin?: boolean;
|
|
2053
|
+
entries?: boolean;
|
|
2054
|
+
keys?: boolean;
|
|
2055
|
+
values?: boolean;
|
|
2056
|
+
includes?: boolean;
|
|
2057
|
+
flatMap?: boolean;
|
|
2058
|
+
flat?: boolean;
|
|
2059
|
+
at?: boolean;
|
|
2060
|
+
};
|
|
2061
|
+
at: never;
|
|
2062
|
+
};
|
|
2063
|
+
type: import("@prisma/client").$Enums.NoteType;
|
|
2064
|
+
createdAt: string;
|
|
2065
|
+
createdBy: string | null;
|
|
2066
|
+
orderId: string;
|
|
2067
|
+
note: string;
|
|
2068
|
+
} | {
|
|
2069
|
+
error: {
|
|
2070
|
+
code: string;
|
|
2071
|
+
message: string;
|
|
2072
|
+
};
|
|
2073
|
+
}, Error, {
|
|
2074
|
+
note: string;
|
|
2075
|
+
type?: "general" | "status_change" | "prospect_reason" | "delivery_attempt" | "customer_communication" | "internal";
|
|
2076
|
+
}, unknown>;
|
|
@@ -176,3 +176,34 @@ export function useDeleteOrder(orderId, options) {
|
|
|
176
176
|
...options,
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
+
/**
|
|
180
|
+
* Hook to add a note to an order using admin RPC
|
|
181
|
+
*
|
|
182
|
+
* @param orderId - Order UUID
|
|
183
|
+
* @param options - React Query mutation options
|
|
184
|
+
*
|
|
185
|
+
* @example
|
|
186
|
+
* ```tsx
|
|
187
|
+
* const addNote = useAddOrderNote(orderId);
|
|
188
|
+
* addNote.mutate({ note: 'Customer called to confirm', type: 'customer_communication' });
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
191
|
+
export function useAddOrderNote(orderId, options) {
|
|
192
|
+
const { baseURL, getAuthToken } = useApiConfig();
|
|
193
|
+
const queryClient = useQueryClient();
|
|
194
|
+
return useMutation({
|
|
195
|
+
mutationFn: async (data) => {
|
|
196
|
+
const token = await getAuthToken();
|
|
197
|
+
const clients = createAdminRpcClients(baseURL);
|
|
198
|
+
const res = await clients.orders[':id'].notes.$post({ param: { id: orderId }, json: data }, authHeaders(token));
|
|
199
|
+
if (!res.ok) {
|
|
200
|
+
throw new Error(`Failed to add order note: ${res.statusText}`);
|
|
201
|
+
}
|
|
202
|
+
return res.json();
|
|
203
|
+
},
|
|
204
|
+
onSuccess: () => {
|
|
205
|
+
queryClient.invalidateQueries({ queryKey: queryKeys.admin.orders.detail(orderId) });
|
|
206
|
+
},
|
|
207
|
+
...options,
|
|
208
|
+
});
|
|
209
|
+
}
|
|
@@ -15,6 +15,7 @@ export declare function useListProducts(brandId?: string, options?: Omit<UseQuer
|
|
|
15
15
|
siteUrl: string;
|
|
16
16
|
domain: string;
|
|
17
17
|
metaPixelId: string | null;
|
|
18
|
+
tiktokPixelId: string | null;
|
|
18
19
|
paystackPublicKey: string | null;
|
|
19
20
|
paystackSecretKey: string | null;
|
|
20
21
|
};
|
|
@@ -112,7 +113,9 @@ export declare function useListProducts(brandId?: string, options?: Omit<UseQuer
|
|
|
112
113
|
includes?: boolean;
|
|
113
114
|
flatMap?: boolean;
|
|
114
115
|
flat?: boolean;
|
|
116
|
+
at?: boolean;
|
|
115
117
|
};
|
|
118
|
+
at: never;
|
|
116
119
|
};
|
|
117
120
|
} | {
|
|
118
121
|
[x: number]: string | number | boolean | {
|
|
@@ -185,7 +188,9 @@ export declare function useListProducts(brandId?: string, options?: Omit<UseQuer
|
|
|
185
188
|
includes?: boolean;
|
|
186
189
|
flatMap?: boolean;
|
|
187
190
|
flat?: boolean;
|
|
191
|
+
at?: boolean;
|
|
188
192
|
};
|
|
193
|
+
at: never;
|
|
189
194
|
};
|
|
190
195
|
}[], Error>;
|
|
191
196
|
export declare function useGetProduct(productId: string, options?: Omit<UseQueryOptions<Awaited<ReturnType<Awaited<ReturnType<ReturnType<typeof createAdminRpcClients>['products'][':id']['$get']>>['json']>>, Error>, 'queryKey' | 'queryFn'>): import("@tanstack/react-query").UseQueryResult<{
|
|
@@ -200,6 +205,7 @@ export declare function useGetProduct(productId: string, options?: Omit<UseQuery
|
|
|
200
205
|
siteUrl: string;
|
|
201
206
|
domain: string;
|
|
202
207
|
metaPixelId: string | null;
|
|
208
|
+
tiktokPixelId: string | null;
|
|
203
209
|
paystackPublicKey: string | null;
|
|
204
210
|
paystackSecretKey: string | null;
|
|
205
211
|
};
|
|
@@ -297,7 +303,9 @@ export declare function useGetProduct(productId: string, options?: Omit<UseQuery
|
|
|
297
303
|
includes?: boolean;
|
|
298
304
|
flatMap?: boolean;
|
|
299
305
|
flat?: boolean;
|
|
306
|
+
at?: boolean;
|
|
300
307
|
};
|
|
308
|
+
at: never;
|
|
301
309
|
};
|
|
302
310
|
} | {
|
|
303
311
|
[x: number]: string | number | boolean | {
|
|
@@ -370,7 +378,9 @@ export declare function useGetProduct(productId: string, options?: Omit<UseQuery
|
|
|
370
378
|
includes?: boolean;
|
|
371
379
|
flatMap?: boolean;
|
|
372
380
|
flat?: boolean;
|
|
381
|
+
at?: boolean;
|
|
373
382
|
};
|
|
383
|
+
at: never;
|
|
374
384
|
};
|
|
375
385
|
}, Error>;
|
|
376
386
|
export declare function useCreateProduct(options?: UseMutationOptions<any, Error, any>): import("@tanstack/react-query").UseMutationResult<any, Error, any, unknown>;
|
|
@@ -37,6 +37,7 @@ export declare function useGetStats(params?: {
|
|
|
37
37
|
siteUrl: string;
|
|
38
38
|
domain: string;
|
|
39
39
|
metaPixelId: string | null;
|
|
40
|
+
tiktokPixelId: string | null;
|
|
40
41
|
paystackPublicKey: string | null;
|
|
41
42
|
paystackSecretKey: string | null;
|
|
42
43
|
};
|
|
@@ -154,7 +155,9 @@ export declare function useGetStats(params?: {
|
|
|
154
155
|
includes?: boolean;
|
|
155
156
|
flatMap?: boolean;
|
|
156
157
|
flat?: boolean;
|
|
158
|
+
at?: boolean;
|
|
157
159
|
};
|
|
160
|
+
at: never;
|
|
158
161
|
};
|
|
159
162
|
} | {
|
|
160
163
|
[x: number]: string | number | boolean | {
|
|
@@ -227,7 +230,9 @@ export declare function useGetStats(params?: {
|
|
|
227
230
|
includes?: boolean;
|
|
228
231
|
flatMap?: boolean;
|
|
229
232
|
flat?: boolean;
|
|
233
|
+
at?: boolean;
|
|
230
234
|
};
|
|
235
|
+
at: never;
|
|
231
236
|
};
|
|
232
237
|
};
|
|
233
238
|
id: string;
|
|
@@ -71,6 +71,7 @@ export declare function useGetWarehouseInventory(warehouseId: string, options?:
|
|
|
71
71
|
siteUrl: string;
|
|
72
72
|
domain: string;
|
|
73
73
|
metaPixelId: string | null;
|
|
74
|
+
tiktokPixelId: string | null;
|
|
74
75
|
paystackPublicKey: string | null;
|
|
75
76
|
paystackSecretKey: string | null;
|
|
76
77
|
createdAt: string;
|
|
@@ -157,7 +158,9 @@ export declare function useGetWarehouseInventory(warehouseId: string, options?:
|
|
|
157
158
|
includes?: boolean;
|
|
158
159
|
flatMap?: boolean;
|
|
159
160
|
flat?: boolean;
|
|
161
|
+
at?: boolean;
|
|
160
162
|
};
|
|
163
|
+
at: never;
|
|
161
164
|
};
|
|
162
165
|
} | {
|
|
163
166
|
[x: number]: string | number | boolean | {
|
|
@@ -230,7 +233,9 @@ export declare function useGetWarehouseInventory(warehouseId: string, options?:
|
|
|
230
233
|
includes?: boolean;
|
|
231
234
|
flatMap?: boolean;
|
|
232
235
|
flat?: boolean;
|
|
236
|
+
at?: boolean;
|
|
233
237
|
};
|
|
238
|
+
at: never;
|
|
234
239
|
};
|
|
235
240
|
};
|
|
236
241
|
id: string;
|