@flowselections/floriday-authenticatie-module 1.0.79 → 1.0.81
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-lib/components/floriday/FlorydayApiLogPage.d.ts.map +1 -1
- package/dist-lib/components/floriday/FlorydayApiLogPage.js +1 -1
- package/dist-lib/components/floriday/FlorydayWebhooksCard.d.ts.map +1 -1
- package/dist-lib/components/floriday/FlorydayWebhooksCard.js +20 -2
- package/dist-lib/integrations/supabase/types.d.ts +157 -2
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/types.js +1 -0
- package/dist-lib/lib/floriday-sync.functions.d.ts +24 -192
- package/dist-lib/lib/floriday-sync.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday-webhooks.functions.d.ts +37 -0
- package/dist-lib/lib/floriday-webhooks.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday-webhooks.functions.js +95 -2
- package/dist-lib/lib/floriday.functions.d.ts +10 -0
- package/dist-lib/lib/floriday.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday.functions.js +9 -2
- package/dist-lib/lib/gateway/customer-stickers.d.ts +12 -8
- package/dist-lib/lib/gateway/customer-stickers.d.ts.map +1 -1
- package/dist-lib/lib/gateway/customer-stickers.js +190 -37
- package/dist-lib/lib/gateway/webhook.d.ts +17 -2
- package/dist-lib/lib/gateway/webhook.d.ts.map +1 -1
- package/dist-lib/lib/gateway/webhook.js +81 -6
- package/dist-lib/lib/module-version.d.ts +1 -1
- package/dist-lib/lib/module-version.js +1 -1
- package/package.json +2 -2
|
@@ -22,14 +22,7 @@ export declare function runFloridayResourceSync(supabase: SupabaseClient, env: F
|
|
|
22
22
|
toSequence: number;
|
|
23
23
|
durationMs: number;
|
|
24
24
|
} | {
|
|
25
|
-
uploadRequests:
|
|
26
|
-
synced: number;
|
|
27
|
-
fromSequence: number;
|
|
28
|
-
toSequence: number;
|
|
29
|
-
durationMs: number;
|
|
30
|
-
backfillNeeded?: boolean;
|
|
31
|
-
partial?: boolean;
|
|
32
|
-
};
|
|
25
|
+
uploadRequests: Record<string, unknown>;
|
|
33
26
|
synced: number;
|
|
34
27
|
fromSequence: number;
|
|
35
28
|
toSequence: number;
|
|
@@ -100,14 +93,7 @@ export declare const syncFlorydayTradeItems: import("@tanstack/start-client-core
|
|
|
100
93
|
resource: FlorydayResource;
|
|
101
94
|
error?: undefined;
|
|
102
95
|
} | {
|
|
103
|
-
uploadRequests:
|
|
104
|
-
synced: number;
|
|
105
|
-
fromSequence: number;
|
|
106
|
-
toSequence: number;
|
|
107
|
-
durationMs: number;
|
|
108
|
-
backfillNeeded?: boolean;
|
|
109
|
-
partial?: boolean;
|
|
110
|
-
};
|
|
96
|
+
uploadRequests: Record<string, unknown>;
|
|
111
97
|
synced: number;
|
|
112
98
|
fromSequence: number;
|
|
113
99
|
toSequence: number;
|
|
@@ -178,14 +164,7 @@ export declare const syncFlorydaySalesOrders: import("@tanstack/start-client-cor
|
|
|
178
164
|
resource: FlorydayResource;
|
|
179
165
|
error?: undefined;
|
|
180
166
|
} | {
|
|
181
|
-
uploadRequests:
|
|
182
|
-
synced: number;
|
|
183
|
-
fromSequence: number;
|
|
184
|
-
toSequence: number;
|
|
185
|
-
durationMs: number;
|
|
186
|
-
backfillNeeded?: boolean;
|
|
187
|
-
partial?: boolean;
|
|
188
|
-
};
|
|
167
|
+
uploadRequests: Record<string, unknown>;
|
|
189
168
|
synced: number;
|
|
190
169
|
fromSequence: number;
|
|
191
170
|
toSequence: number;
|
|
@@ -256,14 +235,7 @@ export declare const syncFlorydayCustomerOrganizations: import("@tanstack/start-
|
|
|
256
235
|
resource: FlorydayResource;
|
|
257
236
|
error?: undefined;
|
|
258
237
|
} | {
|
|
259
|
-
uploadRequests:
|
|
260
|
-
synced: number;
|
|
261
|
-
fromSequence: number;
|
|
262
|
-
toSequence: number;
|
|
263
|
-
durationMs: number;
|
|
264
|
-
backfillNeeded?: boolean;
|
|
265
|
-
partial?: boolean;
|
|
266
|
-
};
|
|
238
|
+
uploadRequests: Record<string, unknown>;
|
|
267
239
|
synced: number;
|
|
268
240
|
fromSequence: number;
|
|
269
241
|
toSequence: number;
|
|
@@ -334,14 +306,7 @@ export declare const syncFlorydayCarriers: import("@tanstack/start-client-core")
|
|
|
334
306
|
resource: FlorydayResource;
|
|
335
307
|
error?: undefined;
|
|
336
308
|
} | {
|
|
337
|
-
uploadRequests:
|
|
338
|
-
synced: number;
|
|
339
|
-
fromSequence: number;
|
|
340
|
-
toSequence: number;
|
|
341
|
-
durationMs: number;
|
|
342
|
-
backfillNeeded?: boolean;
|
|
343
|
-
partial?: boolean;
|
|
344
|
-
};
|
|
309
|
+
uploadRequests: Record<string, unknown>;
|
|
345
310
|
synced: number;
|
|
346
311
|
fromSequence: number;
|
|
347
312
|
toSequence: number;
|
|
@@ -412,14 +377,7 @@ export declare const syncFlorydayFulfillmentOrders: import("@tanstack/start-clie
|
|
|
412
377
|
resource: FlorydayResource;
|
|
413
378
|
error?: undefined;
|
|
414
379
|
} | {
|
|
415
|
-
uploadRequests:
|
|
416
|
-
synced: number;
|
|
417
|
-
fromSequence: number;
|
|
418
|
-
toSequence: number;
|
|
419
|
-
durationMs: number;
|
|
420
|
-
backfillNeeded?: boolean;
|
|
421
|
-
partial?: boolean;
|
|
422
|
-
};
|
|
380
|
+
uploadRequests: Record<string, unknown>;
|
|
423
381
|
synced: number;
|
|
424
382
|
fromSequence: number;
|
|
425
383
|
toSequence: number;
|
|
@@ -490,14 +448,7 @@ export declare const syncFlorydayCustomerStickers: import("@tanstack/start-clien
|
|
|
490
448
|
resource: FlorydayResource;
|
|
491
449
|
error?: undefined;
|
|
492
450
|
} | {
|
|
493
|
-
uploadRequests:
|
|
494
|
-
synced: number;
|
|
495
|
-
fromSequence: number;
|
|
496
|
-
toSequence: number;
|
|
497
|
-
durationMs: number;
|
|
498
|
-
backfillNeeded?: boolean;
|
|
499
|
-
partial?: boolean;
|
|
500
|
-
};
|
|
451
|
+
uploadRequests: Record<string, unknown>;
|
|
501
452
|
synced: number;
|
|
502
453
|
fromSequence: number;
|
|
503
454
|
toSequence: number;
|
|
@@ -568,14 +519,7 @@ export declare const syncFlorydayWarehouses: import("@tanstack/start-client-core
|
|
|
568
519
|
resource: FlorydayResource;
|
|
569
520
|
error?: undefined;
|
|
570
521
|
} | {
|
|
571
|
-
uploadRequests:
|
|
572
|
-
synced: number;
|
|
573
|
-
fromSequence: number;
|
|
574
|
-
toSequence: number;
|
|
575
|
-
durationMs: number;
|
|
576
|
-
backfillNeeded?: boolean;
|
|
577
|
-
partial?: boolean;
|
|
578
|
-
};
|
|
522
|
+
uploadRequests: Record<string, unknown>;
|
|
579
523
|
synced: number;
|
|
580
524
|
fromSequence: number;
|
|
581
525
|
toSequence: number;
|
|
@@ -646,14 +590,7 @@ export declare const syncFlorydayPackings: import("@tanstack/start-client-core")
|
|
|
646
590
|
resource: FlorydayResource;
|
|
647
591
|
error?: undefined;
|
|
648
592
|
} | {
|
|
649
|
-
uploadRequests:
|
|
650
|
-
synced: number;
|
|
651
|
-
fromSequence: number;
|
|
652
|
-
toSequence: number;
|
|
653
|
-
durationMs: number;
|
|
654
|
-
backfillNeeded?: boolean;
|
|
655
|
-
partial?: boolean;
|
|
656
|
-
};
|
|
593
|
+
uploadRequests: Record<string, unknown>;
|
|
657
594
|
synced: number;
|
|
658
595
|
fromSequence: number;
|
|
659
596
|
toSequence: number;
|
|
@@ -724,14 +661,7 @@ export declare const syncFlorydayDeliveryLocations: import("@tanstack/start-clie
|
|
|
724
661
|
resource: FlorydayResource;
|
|
725
662
|
error?: undefined;
|
|
726
663
|
} | {
|
|
727
|
-
uploadRequests:
|
|
728
|
-
synced: number;
|
|
729
|
-
fromSequence: number;
|
|
730
|
-
toSequence: number;
|
|
731
|
-
durationMs: number;
|
|
732
|
-
backfillNeeded?: boolean;
|
|
733
|
-
partial?: boolean;
|
|
734
|
-
};
|
|
664
|
+
uploadRequests: Record<string, unknown>;
|
|
735
665
|
synced: number;
|
|
736
666
|
fromSequence: number;
|
|
737
667
|
toSequence: number;
|
|
@@ -802,14 +732,7 @@ export declare const syncFlorydayClockSupplies: import("@tanstack/start-client-c
|
|
|
802
732
|
resource: FlorydayResource;
|
|
803
733
|
error?: undefined;
|
|
804
734
|
} | {
|
|
805
|
-
uploadRequests:
|
|
806
|
-
synced: number;
|
|
807
|
-
fromSequence: number;
|
|
808
|
-
toSequence: number;
|
|
809
|
-
durationMs: number;
|
|
810
|
-
backfillNeeded?: boolean;
|
|
811
|
-
partial?: boolean;
|
|
812
|
-
};
|
|
735
|
+
uploadRequests: Record<string, unknown>;
|
|
813
736
|
synced: number;
|
|
814
737
|
fromSequence: number;
|
|
815
738
|
toSequence: number;
|
|
@@ -880,14 +803,7 @@ export declare const syncFlorydayDeliveryOrders: import("@tanstack/start-client-
|
|
|
880
803
|
resource: FlorydayResource;
|
|
881
804
|
error?: undefined;
|
|
882
805
|
} | {
|
|
883
|
-
uploadRequests:
|
|
884
|
-
synced: number;
|
|
885
|
-
fromSequence: number;
|
|
886
|
-
toSequence: number;
|
|
887
|
-
durationMs: number;
|
|
888
|
-
backfillNeeded?: boolean;
|
|
889
|
-
partial?: boolean;
|
|
890
|
-
};
|
|
806
|
+
uploadRequests: Record<string, unknown>;
|
|
891
807
|
synced: number;
|
|
892
808
|
fromSequence: number;
|
|
893
809
|
toSequence: number;
|
|
@@ -958,14 +874,7 @@ export declare const syncFlorydayClockPresales: import("@tanstack/start-client-c
|
|
|
958
874
|
resource: FlorydayResource;
|
|
959
875
|
error?: undefined;
|
|
960
876
|
} | {
|
|
961
|
-
uploadRequests:
|
|
962
|
-
synced: number;
|
|
963
|
-
fromSequence: number;
|
|
964
|
-
toSequence: number;
|
|
965
|
-
durationMs: number;
|
|
966
|
-
backfillNeeded?: boolean;
|
|
967
|
-
partial?: boolean;
|
|
968
|
-
};
|
|
877
|
+
uploadRequests: Record<string, unknown>;
|
|
969
878
|
synced: number;
|
|
970
879
|
fromSequence: number;
|
|
971
880
|
toSequence: number;
|
|
@@ -1036,14 +945,7 @@ export declare const syncFlorydayContracts: import("@tanstack/start-client-core"
|
|
|
1036
945
|
resource: FlorydayResource;
|
|
1037
946
|
error?: undefined;
|
|
1038
947
|
} | {
|
|
1039
|
-
uploadRequests:
|
|
1040
|
-
synced: number;
|
|
1041
|
-
fromSequence: number;
|
|
1042
|
-
toSequence: number;
|
|
1043
|
-
durationMs: number;
|
|
1044
|
-
backfillNeeded?: boolean;
|
|
1045
|
-
partial?: boolean;
|
|
1046
|
-
};
|
|
948
|
+
uploadRequests: Record<string, unknown>;
|
|
1047
949
|
synced: number;
|
|
1048
950
|
fromSequence: number;
|
|
1049
951
|
toSequence: number;
|
|
@@ -1114,14 +1016,7 @@ export declare const syncFlorydayBlanketOrders: import("@tanstack/start-client-c
|
|
|
1114
1016
|
resource: FlorydayResource;
|
|
1115
1017
|
error?: undefined;
|
|
1116
1018
|
} | {
|
|
1117
|
-
uploadRequests:
|
|
1118
|
-
synced: number;
|
|
1119
|
-
fromSequence: number;
|
|
1120
|
-
toSequence: number;
|
|
1121
|
-
durationMs: number;
|
|
1122
|
-
backfillNeeded?: boolean;
|
|
1123
|
-
partial?: boolean;
|
|
1124
|
-
};
|
|
1019
|
+
uploadRequests: Record<string, unknown>;
|
|
1125
1020
|
synced: number;
|
|
1126
1021
|
fromSequence: number;
|
|
1127
1022
|
toSequence: number;
|
|
@@ -1294,14 +1189,7 @@ export declare const syncFlorydayAdditionalServices: import("@tanstack/start-cli
|
|
|
1294
1189
|
resource: FlorydayResource;
|
|
1295
1190
|
error?: undefined;
|
|
1296
1191
|
} | {
|
|
1297
|
-
uploadRequests:
|
|
1298
|
-
synced: number;
|
|
1299
|
-
fromSequence: number;
|
|
1300
|
-
toSequence: number;
|
|
1301
|
-
durationMs: number;
|
|
1302
|
-
backfillNeeded?: boolean;
|
|
1303
|
-
partial?: boolean;
|
|
1304
|
-
};
|
|
1192
|
+
uploadRequests: Record<string, unknown>;
|
|
1305
1193
|
synced: number;
|
|
1306
1194
|
fromSequence: number;
|
|
1307
1195
|
toSequence: number;
|
|
@@ -1372,14 +1260,7 @@ export declare const syncFlorydayCommercialServiceTypes: import("@tanstack/start
|
|
|
1372
1260
|
resource: FlorydayResource;
|
|
1373
1261
|
error?: undefined;
|
|
1374
1262
|
} | {
|
|
1375
|
-
uploadRequests:
|
|
1376
|
-
synced: number;
|
|
1377
|
-
fromSequence: number;
|
|
1378
|
-
toSequence: number;
|
|
1379
|
-
durationMs: number;
|
|
1380
|
-
backfillNeeded?: boolean;
|
|
1381
|
-
partial?: boolean;
|
|
1382
|
-
};
|
|
1263
|
+
uploadRequests: Record<string, unknown>;
|
|
1383
1264
|
synced: number;
|
|
1384
1265
|
fromSequence: number;
|
|
1385
1266
|
toSequence: number;
|
|
@@ -1450,14 +1331,7 @@ export declare const syncFlorydayCollections: import("@tanstack/start-client-cor
|
|
|
1450
1331
|
resource: FlorydayResource;
|
|
1451
1332
|
error?: undefined;
|
|
1452
1333
|
} | {
|
|
1453
|
-
uploadRequests:
|
|
1454
|
-
synced: number;
|
|
1455
|
-
fromSequence: number;
|
|
1456
|
-
toSequence: number;
|
|
1457
|
-
durationMs: number;
|
|
1458
|
-
backfillNeeded?: boolean;
|
|
1459
|
-
partial?: boolean;
|
|
1460
|
-
};
|
|
1334
|
+
uploadRequests: Record<string, unknown>;
|
|
1461
1335
|
synced: number;
|
|
1462
1336
|
fromSequence: number;
|
|
1463
1337
|
toSequence: number;
|
|
@@ -1528,14 +1402,7 @@ export declare const syncFlorydayPriceGroups: import("@tanstack/start-client-cor
|
|
|
1528
1402
|
resource: FlorydayResource;
|
|
1529
1403
|
error?: undefined;
|
|
1530
1404
|
} | {
|
|
1531
|
-
uploadRequests:
|
|
1532
|
-
synced: number;
|
|
1533
|
-
fromSequence: number;
|
|
1534
|
-
toSequence: number;
|
|
1535
|
-
durationMs: number;
|
|
1536
|
-
backfillNeeded?: boolean;
|
|
1537
|
-
partial?: boolean;
|
|
1538
|
-
};
|
|
1405
|
+
uploadRequests: Record<string, unknown>;
|
|
1539
1406
|
synced: number;
|
|
1540
1407
|
fromSequence: number;
|
|
1541
1408
|
toSequence: number;
|
|
@@ -1606,14 +1473,7 @@ export declare const syncFlorydayCatalogPrices: import("@tanstack/start-client-c
|
|
|
1606
1473
|
resource: FlorydayResource;
|
|
1607
1474
|
error?: undefined;
|
|
1608
1475
|
} | {
|
|
1609
|
-
uploadRequests:
|
|
1610
|
-
synced: number;
|
|
1611
|
-
fromSequence: number;
|
|
1612
|
-
toSequence: number;
|
|
1613
|
-
durationMs: number;
|
|
1614
|
-
backfillNeeded?: boolean;
|
|
1615
|
-
partial?: boolean;
|
|
1616
|
-
};
|
|
1476
|
+
uploadRequests: Record<string, unknown>;
|
|
1617
1477
|
synced: number;
|
|
1618
1478
|
fromSequence: number;
|
|
1619
1479
|
toSequence: number;
|
|
@@ -1695,14 +1555,7 @@ export declare const syncFlorydayDeliveryConditionSets: import("@tanstack/start-
|
|
|
1695
1555
|
resource: FlorydayResource;
|
|
1696
1556
|
error?: undefined;
|
|
1697
1557
|
} | {
|
|
1698
|
-
uploadRequests:
|
|
1699
|
-
synced: number;
|
|
1700
|
-
fromSequence: number;
|
|
1701
|
-
toSequence: number;
|
|
1702
|
-
durationMs: number;
|
|
1703
|
-
backfillNeeded?: boolean;
|
|
1704
|
-
partial?: boolean;
|
|
1705
|
-
};
|
|
1558
|
+
uploadRequests: Record<string, unknown>;
|
|
1706
1559
|
synced: number;
|
|
1707
1560
|
fromSequence: number;
|
|
1708
1561
|
toSequence: number;
|
|
@@ -1773,14 +1626,7 @@ export declare const syncFlorydaySalesStrategies: import("@tanstack/start-client
|
|
|
1773
1626
|
resource: FlorydayResource;
|
|
1774
1627
|
error?: undefined;
|
|
1775
1628
|
} | {
|
|
1776
|
-
uploadRequests:
|
|
1777
|
-
synced: number;
|
|
1778
|
-
fromSequence: number;
|
|
1779
|
-
toSequence: number;
|
|
1780
|
-
durationMs: number;
|
|
1781
|
-
backfillNeeded?: boolean;
|
|
1782
|
-
partial?: boolean;
|
|
1783
|
-
};
|
|
1629
|
+
uploadRequests: Record<string, unknown>;
|
|
1784
1630
|
synced: number;
|
|
1785
1631
|
fromSequence: number;
|
|
1786
1632
|
toSequence: number;
|
|
@@ -1851,14 +1697,7 @@ export declare const syncFlorydayBaseItems: import("@tanstack/start-client-core"
|
|
|
1851
1697
|
resource: FlorydayResource;
|
|
1852
1698
|
error?: undefined;
|
|
1853
1699
|
} | {
|
|
1854
|
-
uploadRequests:
|
|
1855
|
-
synced: number;
|
|
1856
|
-
fromSequence: number;
|
|
1857
|
-
toSequence: number;
|
|
1858
|
-
durationMs: number;
|
|
1859
|
-
backfillNeeded?: boolean;
|
|
1860
|
-
partial?: boolean;
|
|
1861
|
-
};
|
|
1700
|
+
uploadRequests: Record<string, unknown>;
|
|
1862
1701
|
synced: number;
|
|
1863
1702
|
fromSequence: number;
|
|
1864
1703
|
toSequence: number;
|
|
@@ -1929,14 +1768,7 @@ export declare const syncFlorydayContractTradeItemGroups: import("@tanstack/star
|
|
|
1929
1768
|
resource: FlorydayResource;
|
|
1930
1769
|
error?: undefined;
|
|
1931
1770
|
} | {
|
|
1932
|
-
uploadRequests:
|
|
1933
|
-
synced: number;
|
|
1934
|
-
fromSequence: number;
|
|
1935
|
-
toSequence: number;
|
|
1936
|
-
durationMs: number;
|
|
1937
|
-
backfillNeeded?: boolean;
|
|
1938
|
-
partial?: boolean;
|
|
1939
|
-
};
|
|
1771
|
+
uploadRequests: Record<string, unknown>;
|
|
1940
1772
|
synced: number;
|
|
1941
1773
|
fromSequence: number;
|
|
1942
1774
|
toSequence: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floriday-sync.functions.d.ts","sourceRoot":"","sources":["../../src/lib/floriday-sync.functions.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAS5D,OA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;;;;;;;;;;;;;;;;;;;;;;;;;GAkuCG,CAAC;AAEjG,eAAO,MAAM,mCAAmC;;;;8CAnenB;IAAE,WAAW,EAAE,mBAAmB,CAAA;CAAE;iBAArB,mBAAmB;;YAjwBtC,MAAM;kBAAgB,MAAM;gBAAc,MAAM;gBAAc,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuuCmB,CAAC;AA8LjH,wBAAsB,+BAA+B,CACnD,QAAQ,EAAE,cAAc,EACxB,GAAG,EAAE,mBAAmB;;;kBA/FH,MAAM;YAAM,OAAO;gBAAU,MAAM;;;mBA+ClC,MAAM;eAAS,MAAM;YAAM,OAAO;gBAAU,MAAM;;GAqDzE;AAED,eAAO,MAAM,4BAA4B;;;;8CA7qBZ;IAAE,WAAW,EAAE,mBAAmB,CAAA;CAAE;iBAArB,mBAAmB;;;;kBAukBxC,MAAM;YAAM,OAAO;gBAAU,MAAM;;;mBA+ClC,MAAM;eAAS,MAAM;YAAM,OAAO;gBAAU,MAAM;;;;;GAuEtE,CAAC;AAEL,wBAAsB,4CAA4C,CAChE,QAAQ,EAAE,cAAc;;WAWmB,MAAM;;GAClD;AAED,eAAO,MAAM,oCAAoC;;;;;;WAHJ,MAAM;;GAQ/C,CAAC;AAQL,MAAM,MAAM,sBAAsB,GAAG,cAAc,GAAG,oBAAoB,GAAG,iBAAiB,CAAC;AAQ/F,wBAAsB,4BAA4B,CAChD,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,sBAAsB,EAChC,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,GAAG,GACR,OAAO,CAAC,IAAI,CAAC,CAoBf"}
|
|
@@ -5,6 +5,7 @@ export declare const getFloridayWebhookStatus: import("@tanstack/start-client-co
|
|
|
5
5
|
}, undefined, undefined, undefined>], undefined, Promise<{
|
|
6
6
|
subscriptions: any[];
|
|
7
7
|
last24h: Record<string, number>;
|
|
8
|
+
rejectedByReason: Record<string, number>;
|
|
8
9
|
activeEnvironments: string[];
|
|
9
10
|
lastEnsureAt: string | null;
|
|
10
11
|
}>>;
|
|
@@ -39,4 +40,40 @@ export declare const unsubscribeFloridayWebhook: import("@tanstack/start-client-
|
|
|
39
40
|
ok: true;
|
|
40
41
|
error?: undefined;
|
|
41
42
|
}>>;
|
|
43
|
+
export declare const listStaleWebhookCallbacks: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
44
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
45
|
+
userId: string;
|
|
46
|
+
claims: import("@supabase/auth-js").JwtPayload;
|
|
47
|
+
}, undefined, undefined, undefined>], undefined, Promise<{
|
|
48
|
+
key: string;
|
|
49
|
+
callbackUrlMasked: string;
|
|
50
|
+
host: string | null;
|
|
51
|
+
route: any;
|
|
52
|
+
count: number;
|
|
53
|
+
firstAt: any;
|
|
54
|
+
lastAt: any;
|
|
55
|
+
unsubscribe: any;
|
|
56
|
+
}[]>>;
|
|
57
|
+
export declare const unsubscribeStaleWebhookCallback: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
58
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
59
|
+
userId: string;
|
|
60
|
+
claims: import("@supabase/auth-js").JwtPayload;
|
|
61
|
+
}, undefined, undefined, undefined>], (d: unknown) => {
|
|
62
|
+
key: string;
|
|
63
|
+
}, Promise<{
|
|
64
|
+
ok: false;
|
|
65
|
+
error: "Adres niet gevonden";
|
|
66
|
+
results?: undefined;
|
|
67
|
+
} | {
|
|
68
|
+
ok: false;
|
|
69
|
+
error: "Dit is het actieve adres; dat wordt nooit afgemeld";
|
|
70
|
+
results?: undefined;
|
|
71
|
+
} | {
|
|
72
|
+
ok: boolean;
|
|
73
|
+
results: {
|
|
74
|
+
environment: string;
|
|
75
|
+
status: number;
|
|
76
|
+
}[];
|
|
77
|
+
error?: undefined;
|
|
78
|
+
}>>;
|
|
42
79
|
//# sourceMappingURL=floriday-webhooks.functions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floriday-webhooks.functions.d.ts","sourceRoot":"","sources":["../../src/lib/floriday-webhooks.functions.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,wBAAwB;;;;;
|
|
1
|
+
{"version":3,"file":"floriday-webhooks.functions.d.ts","sourceRoot":"","sources":["../../src/lib/floriday-webhooks.functions.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,wBAAwB;;;;;mBAmCA,GAAG,EAAE;;;;;GAMtC,CAAC;AAEL,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;GAcjC,CAAC;AAEL,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;GAyBnC,CAAC;AAyBL,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;KAwBlC,CAAC;AAEL,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;qBAYJ,MAAM;gBAAU,MAAM;;;GAe1D,CAAC"}
|
|
@@ -13,12 +13,18 @@ export const getFloridayWebhookStatus = createServerFn({ method: "GET" })
|
|
|
13
13
|
const since = new Date(Date.now() - 24 * 3600000).toISOString();
|
|
14
14
|
const { data: events } = await sb
|
|
15
15
|
.from("floriday_webhook_events")
|
|
16
|
-
.select("status")
|
|
16
|
+
.select("status, last_error")
|
|
17
17
|
.gte("received_at", since)
|
|
18
18
|
.limit(1000);
|
|
19
19
|
const counts = {};
|
|
20
|
-
|
|
20
|
+
const rejectedByReason = {};
|
|
21
|
+
for (const e of (events ?? [])) {
|
|
21
22
|
counts[e.status] = (counts[e.status] ?? 0) + 1;
|
|
23
|
+
if (e.status === "rejected") {
|
|
24
|
+
const r = String(e.last_error ?? "Onbekende reden");
|
|
25
|
+
rejectedByReason[r] = (rejectedByReason[r] ?? 0) + 1;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
22
28
|
const { supabaseAdmin } = await import("../integrations/supabase/client.server.js");
|
|
23
29
|
const { data: conns } = await supabaseAdmin
|
|
24
30
|
.from("floriday_connections")
|
|
@@ -32,6 +38,7 @@ export const getFloridayWebhookStatus = createServerFn({ method: "GET" })
|
|
|
32
38
|
return {
|
|
33
39
|
subscriptions: (subs ?? []),
|
|
34
40
|
last24h: counts,
|
|
41
|
+
rejectedByReason,
|
|
35
42
|
activeEnvironments: (conns ?? []).map((c) => c.environment),
|
|
36
43
|
lastEnsureAt: setting?.value ?? null,
|
|
37
44
|
};
|
|
@@ -79,3 +86,89 @@ export const unsubscribeFloridayWebhook = createServerFn({ method: "POST" })
|
|
|
79
86
|
await supabaseAdmin.from("floriday_webhook_subscriptions").delete().eq("connection_id", conn.id);
|
|
80
87
|
return { ok: true };
|
|
81
88
|
});
|
|
89
|
+
// ---------------------------------------------------------------------------
|
|
90
|
+
// Oude aanmeldingen: adressen waarop meldingen met een onbekend token binnenkomen.
|
|
91
|
+
// Volledig adres staat alleen in module_runtime_config (service-role); het scherm
|
|
92
|
+
// krijgt het gemaskeerd. Afmelden alleen voor beheerders, nooit het actieve adres.
|
|
93
|
+
// ---------------------------------------------------------------------------
|
|
94
|
+
async function requireAdmin(context) {
|
|
95
|
+
const { data: isAdmin } = await context.supabase.rpc("has_role", { _user_id: context.userId, _role: "admin" });
|
|
96
|
+
if (!isAdmin)
|
|
97
|
+
throw new Error("Alleen voor beheerders");
|
|
98
|
+
}
|
|
99
|
+
async function loadStaleCallbacks(admin) {
|
|
100
|
+
const { STALE_CALLBACK_PREFIX } = await import("./gateway/webhook.js");
|
|
101
|
+
const { data } = await admin.from("module_runtime_config").select("key, value").like("key", `${STALE_CALLBACK_PREFIX}%`);
|
|
102
|
+
const { data: subs } = await admin.from("floriday_webhook_subscriptions").select("callback_url, environment");
|
|
103
|
+
const active = new Set((subs ?? []).map((s) => s.callback_url).filter(Boolean));
|
|
104
|
+
return (data ?? []).map((r) => {
|
|
105
|
+
let v = {};
|
|
106
|
+
try {
|
|
107
|
+
v = JSON.parse(r.value);
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
v = {};
|
|
111
|
+
}
|
|
112
|
+
return { key: String(r.key).slice(STALE_CALLBACK_PREFIX.length), v, isActive: active.has(v.callbackUrl) };
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
export const listStaleWebhookCallbacks = createServerFn({ method: "GET" })
|
|
116
|
+
.middleware([requireSupabaseAuth])
|
|
117
|
+
.handler(async ({ context }) => {
|
|
118
|
+
await requireAdmin(context);
|
|
119
|
+
const { supabaseAdmin } = await import("../integrations/supabase/client.server.js");
|
|
120
|
+
const { maskCallbackUrl } = await import("./gateway/webhook.js");
|
|
121
|
+
const rows = await loadStaleCallbacks(supabaseAdmin);
|
|
122
|
+
return rows
|
|
123
|
+
.filter((r) => !r.isActive && r.v.callbackUrl)
|
|
124
|
+
.map((r) => {
|
|
125
|
+
let host = null;
|
|
126
|
+
try {
|
|
127
|
+
host = new URL(r.v.callbackUrl).host;
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
host = null;
|
|
131
|
+
}
|
|
132
|
+
return {
|
|
133
|
+
key: r.key,
|
|
134
|
+
callbackUrlMasked: maskCallbackUrl(r.v.callbackUrl),
|
|
135
|
+
host,
|
|
136
|
+
route: r.v.route ?? null,
|
|
137
|
+
count: Number(r.v.count ?? 0),
|
|
138
|
+
firstAt: r.v.firstAt ?? null,
|
|
139
|
+
lastAt: r.v.lastAt ?? null,
|
|
140
|
+
unsubscribe: r.v.unsubscribe ?? null,
|
|
141
|
+
};
|
|
142
|
+
})
|
|
143
|
+
.sort((a, b) => String(b.lastAt).localeCompare(String(a.lastAt)));
|
|
144
|
+
});
|
|
145
|
+
export const unsubscribeStaleWebhookCallback = createServerFn({ method: "POST" })
|
|
146
|
+
.middleware([requireSupabaseAuth])
|
|
147
|
+
.inputValidator((d) => z.object({ key: z.string().regex(/^[0-9a-f]{32}$/) }).parse(d))
|
|
148
|
+
.handler(async ({ data, context }) => {
|
|
149
|
+
await requireAdmin(context);
|
|
150
|
+
const { supabaseAdmin } = await import("../integrations/supabase/client.server.js");
|
|
151
|
+
const rows = await loadStaleCallbacks(supabaseAdmin);
|
|
152
|
+
const row = rows.find((r) => r.key === data.key);
|
|
153
|
+
if (!row?.v.callbackUrl)
|
|
154
|
+
return { ok: false, error: "Adres niet gevonden" };
|
|
155
|
+
if (row.isActive)
|
|
156
|
+
return { ok: false, error: "Dit is het actieve adres; dat wordt nooit afgemeld" };
|
|
157
|
+
const { florydayFetch, SUPPLIERS_API_VERSION } = await import("./floriday.functions.js");
|
|
158
|
+
const { data: conns } = await supabaseAdmin.from("floriday_connections").select("environment").eq("is_active", true);
|
|
159
|
+
const results = [];
|
|
160
|
+
for (const env of Array.from(new Set((conns ?? []).map((c) => c.environment)))) {
|
|
161
|
+
const res = await florydayFetch(supabaseAdmin, env, `/${SUPPLIERS_API_VERSION}/webhooks/subscriptions`, {
|
|
162
|
+
method: "DELETE",
|
|
163
|
+
headers: { "Content-Type": "application/json" },
|
|
164
|
+
body: JSON.stringify({ callbackUrl: row.v.callbackUrl }),
|
|
165
|
+
});
|
|
166
|
+
results.push({ environment: env, status: res.status });
|
|
167
|
+
}
|
|
168
|
+
const { STALE_CALLBACK_PREFIX } = await import("./gateway/webhook.js");
|
|
169
|
+
await supabaseAdmin.from("module_runtime_config").update({
|
|
170
|
+
value: JSON.stringify({ ...row.v, unsubscribe: { at: new Date().toISOString(), results } }),
|
|
171
|
+
updated_at: new Date().toISOString(),
|
|
172
|
+
}).eq("key", STALE_CALLBACK_PREFIX + data.key);
|
|
173
|
+
return { ok: results.some((r) => r.status >= 200 && r.status < 300 || r.status === 404), results };
|
|
174
|
+
});
|
|
@@ -23,6 +23,16 @@ export interface FlorydayWarehouse {
|
|
|
23
23
|
gln?: string | null;
|
|
24
24
|
isDefault?: boolean;
|
|
25
25
|
}
|
|
26
|
+
export declare const FLORYDAY_ENDPOINTS: {
|
|
27
|
+
readonly staging: {
|
|
28
|
+
readonly tokenUrl: "https://idm.staging.floriday.io/oauth2/ausmw6b47z1BnlHkw0h7/v1/token";
|
|
29
|
+
readonly apiBaseUrl: "https://api.staging.floriday.io";
|
|
30
|
+
};
|
|
31
|
+
readonly live: {
|
|
32
|
+
readonly tokenUrl: "https://idm.floriday.io/oauth2/aus3testdcf2vyfs70i7/v1/token";
|
|
33
|
+
readonly apiBaseUrl: "https://api.floriday.io";
|
|
34
|
+
};
|
|
35
|
+
};
|
|
26
36
|
export declare const SUPPLIERS_API_VERSION = "suppliers-api-2026v1";
|
|
27
37
|
export declare function getActiveFlorydayCredentials(supabase: SupabaseClient, env: FlorydayEnvironment): Promise<{
|
|
28
38
|
api_key: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floriday.functions.d.ts","sourceRoot":"","sources":["../../src/lib/floriday.functions.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAc5D,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,MAAM,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAuE,KAAK,WAAW,EAAE,KAAK,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAElK,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,mBAAmB,CAAC;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,OAAO,CAAC;IACnB,0EAA0E;IAC1E,eAAe,EAAE,OAAO,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IACjC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,sBAAsB,EAAE,MAAM,GAAG,IAAI,CAAC;IACtC,wBAAwB,EAAE,MAAM,GAAG,IAAI,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seAuth } from "../integrations/supabase/auth-middleware.js
|
|
|
9
9
|
import { FLORYDAY_CLOCK_SUPPLY_PERMISSION_MESSAGE, FLORYDAY_CONTRACT_PERMISSION_MESSAGE, FLORYDAY_SALES_STRATEGY_PERMISSION_MESSAGE, FLORYDAY_STANDARD_SCOPE, getFlorydayScopeForPath, isClockSupplyScope, isContractScope, isSalesStrategyScope, } from "./floriday-scopes.js";
|
|
10
10
|
export { validateGln } from "./floriday-gln.js";
|
|
11
11
|
import { decideGln, decidePreferredWarehouse, isOwnWarehouse, warehouseLabel } from "./floriday-own-config.js";
|
|
12
|
-
const FLORYDAY_ENDPOINTS = {
|
|
12
|
+
export const FLORYDAY_ENDPOINTS = {
|
|
13
13
|
staging: {
|
|
14
14
|
tokenUrl: "https://idm.staging.floriday.io/oauth2/ausmw6b47z1BnlHkw0h7/v1/token",
|
|
15
15
|
apiBaseUrl: "https://api.staging.floriday.io",
|
|
@@ -533,7 +533,14 @@ export async function florydayFetch(supabase, pathOrEnv, pathOrInit, maybeInit =
|
|
|
533
533
|
return res;
|
|
534
534
|
}
|
|
535
535
|
}
|
|
536
|
-
|
|
536
|
+
if (res.ok) {
|
|
537
|
+
await writeLog(res.status, true, undefined, res);
|
|
538
|
+
}
|
|
539
|
+
else {
|
|
540
|
+
// Volledige foutinhoud (status, title, detail, traceId) + exacte URL in het logboek.
|
|
541
|
+
const body = await res.clone().text().catch(() => "");
|
|
542
|
+
await writeLog(res.status, false, `Floriday ${res.status} ${method} ${url}${body ? `: ${body.slice(0, 20000)}` : " (lege body)"}`, res);
|
|
543
|
+
}
|
|
537
544
|
return res;
|
|
538
545
|
}
|
|
539
546
|
// ─── Server functions exposed to the UI ─────────────────────────────────────
|