@flowselections/floriday-authenticatie-module 1.0.42 → 1.0.43

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 (45) hide show
  1. package/dist-lib/components/settings/FlorydaySettingsCard.js +4 -9
  2. package/dist-lib/integrations/supabase/auth-middleware.d.ts +728 -9
  3. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  4. package/dist-lib/integrations/supabase/client.d.ts +728 -9
  5. package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
  6. package/dist-lib/integrations/supabase/client.server.d.ts +728 -9
  7. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  8. package/dist-lib/integrations/supabase/types.d.ts +736 -9
  9. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  10. package/dist-lib/lib/floricode.functions.d.ts +5412 -379
  11. package/dist-lib/lib/floricode.functions.d.ts.map +1 -1
  12. package/dist-lib/lib/floriday-auction-letters.functions.d.ts +728 -9
  13. package/dist-lib/lib/floriday-auction-letters.functions.d.ts.map +1 -1
  14. package/dist-lib/lib/floriday-labels.functions.d.ts +728 -9
  15. package/dist-lib/lib/floriday-labels.functions.d.ts.map +1 -1
  16. package/dist-lib/lib/floriday-public.functions.d.ts +4605 -291
  17. package/dist-lib/lib/floriday-public.functions.d.ts.map +1 -1
  18. package/dist-lib/lib/floriday-stickers.functions.d.ts +728 -9
  19. package/dist-lib/lib/floriday-stickers.functions.d.ts.map +1 -1
  20. package/dist-lib/lib/floriday-sync.functions.d.ts +24780 -2491
  21. package/dist-lib/lib/floriday-sync.functions.d.ts.map +1 -1
  22. package/dist-lib/lib/floriday-tray-stickers.functions.d.ts +14 -0
  23. package/dist-lib/lib/floriday-tray-stickers.functions.d.ts.map +1 -0
  24. package/dist-lib/lib/floriday-tray-stickers.functions.js +66 -0
  25. package/dist-lib/lib/floriday-writes.functions.d.ts +52015 -515
  26. package/dist-lib/lib/floriday-writes.functions.d.ts.map +1 -1
  27. package/dist-lib/lib/floriday-writes.functions.js +17 -12
  28. package/dist-lib/lib/floriday.functions.d.ts +15017 -1229
  29. package/dist-lib/lib/floriday.functions.d.ts.map +1 -1
  30. package/dist-lib/lib/floriday.functions.js +76 -21
  31. package/dist-lib/lib/gateway/fulfillment-order-body.d.ts +36 -0
  32. package/dist-lib/lib/gateway/fulfillment-order-body.d.ts.map +1 -1
  33. package/dist-lib/lib/gateway/fulfillment-order-body.js +159 -110
  34. package/dist-lib/lib/gateway/fulfillment-order-send.d.ts.map +1 -1
  35. package/dist-lib/lib/gateway/fulfillment-order-send.js +6 -0
  36. package/dist-lib/lib/gateway/fulfillment-order-status.d.ts +11 -0
  37. package/dist-lib/lib/gateway/fulfillment-order-status.d.ts.map +1 -0
  38. package/dist-lib/lib/gateway/fulfillment-order-status.js +84 -0
  39. package/dist-lib/lib/gateway/index.d.ts +1 -0
  40. package/dist-lib/lib/gateway/index.d.ts.map +1 -1
  41. package/dist-lib/lib/gateway/index.js +1 -0
  42. package/dist-lib/lib/gateway/pdf.d.ts +1 -1
  43. package/dist-lib/lib/gateway/pdf.d.ts.map +1 -1
  44. package/dist-lib/lib/gateway/pdf.js +11 -0
  45. package/package.json +10 -1
@@ -55,23 +55,18 @@ function EnvironmentForm({ env, label, connection, }) {
55
55
  const upsert = useServerFn(upsertFlorydayConnection);
56
56
  const test = useServerFn(testFlorydayConnection);
57
57
  const remove = useServerFn(deleteFlorydayConnection);
58
- const [clientId, setClientId] = useState("");
59
- const [clientSecret, setClientSecret] = useState("");
60
58
  const [apiKey, setApiKey] = useState("");
59
+ const [testSteps, setTestSteps] = useState([]);
61
60
  const saveMutation = useMutation({
62
61
  mutationFn: () => upsert({
63
62
  data: {
64
63
  environment: env,
65
- client_id: clientId,
66
- client_secret: clientSecret,
67
64
  api_key: apiKey,
68
65
  label,
69
66
  },
70
67
  }),
71
68
  onSuccess: () => {
72
- toast.success(`${label}-koppeling opgeslagen`);
73
- setClientId("");
74
- setClientSecret("");
69
+ toast.success(`API-sleutel voor ${label.toLowerCase()} opgeslagen`);
75
70
  setApiKey("");
76
71
  qc.invalidateQueries({ queryKey: ["floriday-connections"] });
77
72
  qc.invalidateQueries({ queryKey: ["floriday-warehouses", env] });
@@ -81,6 +76,7 @@ function EnvironmentForm({ env, label, connection, }) {
81
76
  const testMutation = useMutation({
82
77
  mutationFn: () => test({ data: { environment: env } }),
83
78
  onSuccess: async (res) => {
79
+ setTestSteps(res.steps ?? []);
84
80
  if (res.ok)
85
81
  toast.success(`${label} koppeling OK`);
86
82
  else
@@ -98,8 +94,7 @@ function EnvironmentForm({ env, label, connection, }) {
98
94
  },
99
95
  onError: (e) => toast.error(e?.message ?? "Verwijderen mislukt"),
100
96
  });
101
- return (_jsxs("div", { className: "space-y-6", children: [_jsx(StepBlock, { number: 2, title: "Vul verbindingsgegevens 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: "Verbindingsgegevens" }), 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" })] })] })] }))] }), _jsxs("div", { className: "grid gap-4", children: [_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { htmlFor: `${env}-client-id`, className: "text-xs", children: "Client ID" }), _jsx(Input, { id: `${env}-client-id`, value: clientId, onChange: e => setClientId(e.target.value), placeholder: connection ? connection.client_id_masked : "Floriday Client ID", className: connection ? "font-mono placeholder:font-mono placeholder:text-foreground/60" : undefined, autoComplete: "off" }), _jsx("p", { className: "text-[11px] text-muted-foreground", children: "Te vinden in je Floriday API-instellingen." }), connection && (_jsx("p", { className: "text-[11px] text-muted-foreground", children: "Laat leeg als je deze waarde niet wilt wijzigen." }))] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { htmlFor: `${env}-client-secret`, className: "text-xs", children: "Client Secret" }), _jsx(Input, { id: `${env}-client-secret`, type: "password", value: clientSecret, onChange: e => setClientSecret(e.target.value), placeholder: connection ? "••••••••" : "Floriday Client Secret", className: connection ? "placeholder:text-foreground/60" : undefined, autoComplete: "off" }), _jsx("p", { className: "text-[11px] text-muted-foreground", children: "Houd deze sleutel priv\u00E9." }), connection && (_jsx("p", { className: "text-[11px] text-muted-foreground", children: "Laat leeg als je deze waarde niet wilt wijzigen." }))] }), _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." }), connection && (_jsx("p", { className: "text-[11px] text-muted-foreground", children: "Laat leeg als je deze waarde niet wilt wijzigen." }))] })] }), _jsx("div", { children: _jsx(Button, { size: "sm", onClick: () => saveMutation.mutate(), disabled: saveMutation.isPending ||
102
- !clientId.trim() || !clientSecret.trim() || !apiKey.trim(), children: saveMutation.isPending ? "Opslaan…" : connection ? "Wijzigingen opslaan" : "Koppeling opslaan" }) })] }) }), _jsx(StepBlock, { number: 3, title: "Test de verbinding", description: "Controleer of je gegevens correct zijn en of de koppeling werkt.", children: _jsx(Button, { variant: "outline", size: "sm", onClick: () => testMutation.mutate(), disabled: !connection || testMutation.isPending, children: testMutation.isPending ? "Testen…" : "Verbinding testen" }) }), _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 }) }), _jsx(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: _jsx(SyncStatusPanel, { env: env, connection: connection }) })] }));
97
+ 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 }) }), _jsx(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: _jsx(SyncStatusPanel, { env: env, connection: connection }) })] }));
103
98
  }
104
99
  function PublishingSettings({ env, connection, }) {
105
100
  const qc = useQueryClient();