@flowselections/floriday-authenticatie-module 1.0.46 → 1.0.47

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 (32) hide show
  1. package/dist-lib/components/settings/FlorydaySettingsCard.d.ts.map +1 -1
  2. package/dist-lib/components/settings/FlorydaySettingsCard.js +12 -2
  3. package/dist-lib/integrations/supabase/auth-middleware.d.ts +54 -0
  4. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  5. package/dist-lib/integrations/supabase/client.d.ts +54 -0
  6. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  7. package/dist-lib/integrations/supabase/client.server.d.ts +54 -0
  8. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  9. package/dist-lib/integrations/supabase/types.d.ts +54 -0
  10. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  11. package/dist-lib/lib/cron/process-stock-queue.d.ts.map +1 -1
  12. package/dist-lib/lib/cron/process-stock-queue.js +5 -0
  13. package/dist-lib/lib/floricode.functions.d.ts +378 -0
  14. package/dist-lib/lib/floricode.functions.d.ts.map +1 -1
  15. package/dist-lib/lib/floriday-api-log.functions.d.ts +486 -0
  16. package/dist-lib/lib/floriday-api-log.functions.d.ts.map +1 -1
  17. package/dist-lib/lib/floriday-auction-letters.functions.d.ts +54 -0
  18. package/dist-lib/lib/floriday-auction-letters.functions.d.ts.map +1 -1
  19. package/dist-lib/lib/floriday-labels.functions.d.ts +54 -0
  20. package/dist-lib/lib/floriday-labels.functions.d.ts.map +1 -1
  21. package/dist-lib/lib/floriday-public.functions.d.ts +324 -0
  22. package/dist-lib/lib/floriday-public.functions.d.ts.map +1 -1
  23. package/dist-lib/lib/floriday-stickers.functions.d.ts +54 -0
  24. package/dist-lib/lib/floriday-stickers.functions.d.ts.map +1 -1
  25. package/dist-lib/lib/floriday-sync.functions.d.ts +1782 -0
  26. package/dist-lib/lib/floriday-sync.functions.d.ts.map +1 -1
  27. package/dist-lib/lib/floriday-writes.functions.d.ts +432 -0
  28. package/dist-lib/lib/floriday-writes.functions.d.ts.map +1 -1
  29. package/dist-lib/lib/floriday.functions.d.ts +55821 -75
  30. package/dist-lib/lib/floriday.functions.d.ts.map +1 -1
  31. package/dist-lib/lib/floriday.functions.js +66 -10
  32. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"FlorydaySettingsCard.d.ts","sourceRoot":"","sources":["../../../src/components/settings/FlorydaySettingsCard.tsx"],"names":[],"mappings":"AA4EA,wBAAgB,oBAAoB,4CAqHnC"}
1
+ {"version":3,"file":"FlorydaySettingsCard.d.ts","sourceRoot":"","sources":["../../../src/components/settings/FlorydaySettingsCard.tsx"],"names":[],"mappings":"AA8EA,wBAAgB,oBAAoB,4CAqHnC"}
@@ -5,7 +5,7 @@ import { ChevronDown } from "lucide-react";
5
5
  import { useServerFn } from "@tanstack/react-start";
6
6
  import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
7
7
  import { Card, Button, Input, Label, Badge, Tabs, TabsList, TabsTrigger, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, toast, } from "@flowselections/core";
8
- import { listFlorydayConnections, upsertFlorydayConnection, testFlorydayConnection, deleteFlorydayConnection, getFlorydaySettings, setFlorydayActiveEnvironment, listFlorydayWarehouses, updateFlorydayPublishingSettings, validateGln, syncFlorydayConnections, getFlorydaySyncStatus, } from "../../lib/floriday.functions.js";
8
+ import { listFlorydayConnections, upsertFlorydayConnection, testFlorydayConnection, deleteFlorydayConnection, getFlorydaySettings, setFlorydayActiveEnvironment, listFlorydayWarehouses, updateFlorydayPublishingSettings, validateGln, syncFlorydayConnections, getFlorydaySyncStatus, getFlorydayShellHostStatus, } from "../../lib/floriday.functions.js";
9
9
  import { syncFlorydayTradeItems, syncFlorydaySalesOrders, syncFlorydayCustomerOrganizations, syncFlorydayCarriers, syncFlorydayFulfillmentOrders, syncFlorydayCustomerStickers, syncFlorydayWarehouses, syncFlorydayPackings, syncFlorydayDeliveryLocations, syncFlorydayClockSupplies, syncFlorydayDeliveryOrders, syncFlorydayClockPresales, syncFlorydayContracts, syncFlorydayBlanketOrders, syncFlorydayAdditionalServices, syncFlorydayCommercialServiceTypes, syncFlorydayCollections, syncFlorydayPriceGroups, syncFlorydayDeliveryConditionSets, syncFlorydaySalesStrategies, syncFlorydayBaseItems, syncFlorydayContractTradeItemGroups, syncFlorydayCatalogPrices, } from "../../lib/floriday-sync.functions.js";
10
10
  import { FlorydayCredentialStatusBanner } from "../floriday/FlorydayCredentialStatusBanner.js";
11
11
  export function FlorydaySettingsCard() {
@@ -95,7 +95,17 @@ function EnvironmentForm({ env, label, connection, }) {
95
95
  },
96
96
  onError: (e) => toast.error(e?.message ?? "Verwijderen mislukt"),
97
97
  });
98
- return (_jsxs("div", { className: "space-y-6", children: [_jsx(StepBlock, { number: 2, title: "Vul de Floriday API-sleutel in", children: _jsxs("div", { className: "rounded-lg border border-border/60 bg-card p-4 space-y-4", children: [_jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [_jsx("h4", { className: "font-medium text-sm", children: "API-sleutel" }), connection ? (_jsx(Badge, { variant: "default", className: "text-[10px]", children: "Actief" })) : (_jsx(Badge, { variant: "secondary", className: "text-[10px]", children: "Nog niet gekoppeld" }))] }), connection && (_jsxs(AlertDialog, { children: [_jsx(AlertDialogTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "sm", disabled: deleteMutation.isPending, children: "Verwijderen" }) }), _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Koppeling verwijderen?" }), _jsxs(AlertDialogDescription, { children: ["Hiermee worden de opgeslagen Floriday-gegevens voor de ", label.toLowerCase(), " permanent verwijderd. Andere modules die deze koppeling gebruiken werken daarna niet meer totdat je opnieuw koppelt."] })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Annuleren" }), _jsx(AlertDialogAction, { onClick: () => deleteMutation.mutate(), children: "Verwijderen" })] })] })] }))] }), _jsx("p", { className: "text-[11px] text-muted-foreground", children: "Client ID en Client Secret worden centraal beheerd in de Centrale Authenticatiemodule. Hier hoeft alleen de Floriday API-sleutel te staan." }), _jsx("div", { className: "grid gap-4", children: _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { htmlFor: `${env}-api-key`, className: "text-xs", children: "API-sleutel" }), _jsx(Input, { id: `${env}-api-key`, type: "text", value: apiKey, onChange: e => setApiKey(e.target.value), placeholder: connection ? connection.api_key_masked : "X-Api-Key uit Floriday", className: connection ? "font-mono placeholder:font-mono placeholder:text-foreground/60" : undefined, autoComplete: "off" }), _jsx("p", { className: "text-[11px] text-muted-foreground", children: "Kopieer de API-sleutel uit Floriday." })] }) }), _jsx("div", { children: _jsx(Button, { size: "sm", onClick: () => saveMutation.mutate(), disabled: saveMutation.isPending || !apiKey.trim(), children: saveMutation.isPending ? "Opslaan…" : "API-sleutel opslaan" }) })] }) }), _jsx(StepBlock, { number: 3, title: "Test de verbinding", description: "Controleer of het token, de API-sleutel en een echte Floriday-aanroep werken.", children: _jsxs("div", { className: "space-y-3", children: [_jsx(Button, { variant: "outline", size: "sm", onClick: () => testMutation.mutate(), disabled: !connection || testMutation.isPending, children: testMutation.isPending ? "Testen…" : "Verbinding testen" }), testSteps.length > 0 && (_jsx("ul", { className: "space-y-2", children: testSteps.map((s) => (_jsxs("li", { className: "flex gap-2 text-xs", children: [_jsx("span", { "aria-hidden": true, className: `mt-1 h-2 w-2 rounded-full shrink-0 ${s.ok ? "bg-emerald-500" : "bg-red-500"}` }), _jsxs("span", { children: [_jsx("span", { className: "font-medium", children: s.label }), _jsx("span", { className: "block text-muted-foreground", children: s.detail })] })] }, s.key))) }))] }) }), _jsx(StepBlock, { number: 4, title: "Publicatie-instellingen", description: "Vul je GLN-code in en kies het voorkeursmagazijn voor het publiceren van producten via Floriday.", children: _jsx(PublishingSettings, { env: env, connection: connection }) }), _jsxs(StepBlock, { number: 5, title: "Gegevens up-to-date houden", description: "We halen je Floriday-gegevens automatisch op en bewaren ze in je werkomgeving. Zo werkt alles effici\u00EBnt & snel.", children: [connection ? _jsx(FlorydayCredentialStatusBanner, { environment: env, className: "mb-3" }) : null, _jsx(SyncStatusPanel, { env: env, connection: connection })] })] }));
98
+ return (_jsxs("div", { className: "space-y-6", children: [_jsx(StepBlock, { number: 2, title: "Vul de Floriday API-sleutel in", children: _jsxs("div", { className: "rounded-lg border border-border/60 bg-card p-4 space-y-4", children: [_jsxs("div", { className: "flex items-start justify-between gap-3", children: [_jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [_jsx("h4", { className: "font-medium text-sm", children: "API-sleutel" }), connection ? (_jsx(Badge, { variant: "default", className: "text-[10px]", children: "Actief" })) : (_jsx(Badge, { variant: "secondary", className: "text-[10px]", children: "Nog niet gekoppeld" }))] }), connection && (_jsxs(AlertDialog, { children: [_jsx(AlertDialogTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "sm", disabled: deleteMutation.isPending, children: "Verwijderen" }) }), _jsxs(AlertDialogContent, { children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: "Koppeling verwijderen?" }), _jsxs(AlertDialogDescription, { children: ["Hiermee worden de opgeslagen Floriday-gegevens voor de ", label.toLowerCase(), " permanent verwijderd. Andere modules die deze koppeling gebruiken werken daarna niet meer totdat je opnieuw koppelt."] })] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: "Annuleren" }), _jsx(AlertDialogAction, { onClick: () => deleteMutation.mutate(), children: "Verwijderen" })] })] })] }))] }), _jsx("p", { className: "text-[11px] text-muted-foreground", children: "Client ID en Client Secret worden centraal beheerd in de Centrale Authenticatiemodule. Hier hoeft alleen de Floriday API-sleutel te staan." }), _jsx("div", { className: "grid gap-4", children: _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { htmlFor: `${env}-api-key`, className: "text-xs", children: "API-sleutel" }), _jsx(Input, { id: `${env}-api-key`, type: "text", value: apiKey, onChange: e => setApiKey(e.target.value), placeholder: connection ? connection.api_key_masked : "X-Api-Key uit Floriday", className: connection ? "font-mono placeholder:font-mono placeholder:text-foreground/60" : undefined, autoComplete: "off" }), _jsx("p", { className: "text-[11px] text-muted-foreground", children: "Kopieer de API-sleutel uit Floriday." })] }) }), _jsx("div", { children: _jsx(Button, { size: "sm", onClick: () => saveMutation.mutate(), disabled: saveMutation.isPending || !apiKey.trim(), children: saveMutation.isPending ? "Opslaan…" : "API-sleutel opslaan" }) })] }) }), _jsx(StepBlock, { number: 3, title: "Test de verbinding", description: "Controleer of het token, de API-sleutel en een echte Floriday-aanroep werken.", children: _jsxs("div", { className: "space-y-3", children: [_jsx(Button, { variant: "outline", size: "sm", onClick: () => testMutation.mutate(), disabled: !connection || testMutation.isPending, children: testMutation.isPending ? "Testen…" : "Verbinding testen" }), testSteps.length > 0 && (_jsx("ul", { className: "space-y-2", children: testSteps.map((s) => (_jsxs("li", { className: "flex gap-2 text-xs", children: [_jsx("span", { "aria-hidden": true, className: `mt-1 h-2 w-2 rounded-full shrink-0 ${s.ok ? "bg-emerald-500" : "bg-red-500"}` }), _jsxs("span", { children: [_jsx("span", { className: "font-medium", children: s.label }), _jsx("span", { className: "block text-muted-foreground", children: s.detail })] })] }, s.key))) }))] }) }), _jsx(StepBlock, { number: 4, title: "Publicatie-instellingen", description: "Vul je GLN-code in en kies het voorkeursmagazijn voor het publiceren van producten via Floriday.", children: _jsx(PublishingSettings, { env: env, connection: connection }) }), _jsxs(StepBlock, { number: 5, title: "Gegevens up-to-date houden", description: "We halen je Floriday-gegevens automatisch op en bewaren ze in je werkomgeving. Zo werkt alles effici\u00EBnt & snel.", children: [connection ? _jsx(FlorydayCredentialStatusBanner, { environment: env, className: "mb-3" }) : null, connection ? _jsx(ShellHostStatus, {}) : null, _jsx(SyncStatusPanel, { env: env, connection: connection })] })] }));
99
+ }
100
+ function ShellHostStatus() {
101
+ const getStatus = useServerFn(getFlorydayShellHostStatus);
102
+ const query = useQuery({
103
+ queryKey: ["floriday-shell-host-status"],
104
+ queryFn: () => getStatus(),
105
+ refetchInterval: 60000,
106
+ });
107
+ const status = query.data;
108
+ return (_jsxs("div", { className: "mb-3 rounded-lg border border-border/60 bg-card p-4 space-y-2", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("p", { className: "text-sm font-medium", children: "Actieve werkomgeving" }), _jsx(Badge, { variant: "default", className: "text-[10px]", children: query.isLoading ? "Controleren…" : "Via Central Auth" })] }), _jsx("p", { className: "text-[11px] text-muted-foreground", children: "Central Auth bepaalt naar welke actieve werkomgeving alle automatische taken worden gestuurd. Dit adres wordt elke minuut automatisch bijgewerkt." }), status?.ok ? (_jsx("div", { className: "rounded border border-border/40 bg-muted/30 px-2 py-1.5 text-[11px]", children: _jsx("div", { className: "break-all font-mono text-foreground", children: status.centralHost ?? "Niet beschikbaar" }) })) : status && !status.ok ? (_jsxs("p", { className: "text-[11px] text-red-600", children: ["Hostcontrole mislukt: ", status.error] })) : null] }));
99
109
  }
100
110
  function PublishingSettings({ env, connection, }) {
101
111
  const qc = useQueryClient();
@@ -1823,6 +1823,42 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
1823
1823
  };
1824
1824
  Relationships: [];
1825
1825
  };
1826
+ customer_assortment_items: {
1827
+ Row: {
1828
+ created_at: string;
1829
+ customer_key: string;
1830
+ id: string;
1831
+ in_assortment: boolean;
1832
+ manual_override: boolean;
1833
+ source: string;
1834
+ synced_at: string | null;
1835
+ trade_item_key: string;
1836
+ updated_at: string;
1837
+ };
1838
+ Insert: {
1839
+ created_at?: string;
1840
+ customer_key: string;
1841
+ id?: string;
1842
+ in_assortment?: boolean;
1843
+ manual_override?: boolean;
1844
+ source?: string;
1845
+ synced_at?: string | null;
1846
+ trade_item_key: string;
1847
+ updated_at?: string;
1848
+ };
1849
+ Update: {
1850
+ created_at?: string;
1851
+ customer_key?: string;
1852
+ id?: string;
1853
+ in_assortment?: boolean;
1854
+ manual_override?: boolean;
1855
+ source?: string;
1856
+ synced_at?: string | null;
1857
+ trade_item_key?: string;
1858
+ updated_at?: string;
1859
+ };
1860
+ Relationships: [];
1861
+ };
1826
1862
  customer_audit_log: {
1827
1863
  Row: {
1828
1864
  action: string;
@@ -2227,40 +2263,58 @@ export declare const requireSupabaseAuth: import("@tanstack/start-client-core").
2227
2263
  };
2228
2264
  customer_product_stickers: {
2229
2265
  Row: {
2266
+ content_hash: string | null;
2230
2267
  created_at: string;
2231
2268
  customer_key: string;
2232
2269
  file_name: string;
2233
2270
  file_path: string;
2234
2271
  file_size: number | null;
2272
+ floriday_sticker_id: string | null;
2273
+ floriday_synced_at: string | null;
2274
+ height_mm: number | null;
2235
2275
  id: string;
2236
2276
  mime_type: string | null;
2277
+ source: string;
2237
2278
  trade_item_key: string;
2238
2279
  updated_at: string;
2239
2280
  uploaded_by: string | null;
2281
+ width_mm: number | null;
2240
2282
  };
2241
2283
  Insert: {
2284
+ content_hash?: string | null;
2242
2285
  created_at?: string;
2243
2286
  customer_key: string;
2244
2287
  file_name: string;
2245
2288
  file_path: string;
2246
2289
  file_size?: number | null;
2290
+ floriday_sticker_id?: string | null;
2291
+ floriday_synced_at?: string | null;
2292
+ height_mm?: number | null;
2247
2293
  id?: string;
2248
2294
  mime_type?: string | null;
2295
+ source?: string;
2249
2296
  trade_item_key: string;
2250
2297
  updated_at?: string;
2251
2298
  uploaded_by?: string | null;
2299
+ width_mm?: number | null;
2252
2300
  };
2253
2301
  Update: {
2302
+ content_hash?: string | null;
2254
2303
  created_at?: string;
2255
2304
  customer_key?: string;
2256
2305
  file_name?: string;
2257
2306
  file_path?: string;
2258
2307
  file_size?: number | null;
2308
+ floriday_sticker_id?: string | null;
2309
+ floriday_synced_at?: string | null;
2310
+ height_mm?: number | null;
2259
2311
  id?: string;
2260
2312
  mime_type?: string | null;
2313
+ source?: string;
2261
2314
  trade_item_key?: string;
2262
2315
  updated_at?: string;
2263
2316
  uploaded_by?: string | null;
2317
+ width_mm?: number | null;
2264
2318
  };
2265
2319
  Relationships: [];
2266
2320
  };