@flowselections/floriday-authenticatie-module 1.0.54 → 1.0.55
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/assets/floriday-logo.png.asset.json +11 -0
- package/dist-lib/components/TemplatePage.d.ts +1 -1
- package/dist-lib/components/TemplatePage.d.ts.map +1 -1
- package/dist-lib/components/floriday/FlorydayApiLogPage.d.ts +1 -1
- package/dist-lib/components/floriday/FlorydayApiLogPage.d.ts.map +1 -1
- package/dist-lib/components/floriday/FlorydayConnectionPage.d.ts +1 -1
- package/dist-lib/components/floriday/FlorydayConnectionPage.d.ts.map +1 -1
- package/dist-lib/components/floriday/FlorydayCredentialStatusBanner.d.ts +1 -1
- package/dist-lib/components/floriday/FlorydayCredentialStatusBanner.d.ts.map +1 -1
- package/dist-lib/components/floriday/FlorydayShellRoutesCard.d.ts +1 -1
- package/dist-lib/components/floriday/FlorydayShellRoutesCard.d.ts.map +1 -1
- package/dist-lib/components/floriday/FlorydaySyncHealthBanner.d.ts +1 -1
- package/dist-lib/components/floriday/FlorydaySyncHealthBanner.d.ts.map +1 -1
- package/dist-lib/components/floriday/FlorydaySyncJobsCard.d.ts +1 -1
- package/dist-lib/components/floriday/FlorydaySyncJobsCard.d.ts.map +1 -1
- package/dist-lib/components/floriday/FlorydayWebhooksCard.d.ts +1 -1
- package/dist-lib/components/floriday/FlorydayWebhooksCard.d.ts.map +1 -1
- package/dist-lib/components/floriday/TokenHealthCard.d.ts +1 -1
- package/dist-lib/components/floriday/TokenHealthCard.d.ts.map +1 -1
- package/dist-lib/components/settings/FloricodeSettingsCard.d.ts +1 -1
- package/dist-lib/components/settings/FloricodeSettingsCard.d.ts.map +1 -1
- package/dist-lib/components/settings/FlorydaySettingsCard.d.ts +1 -1
- package/dist-lib/components/settings/FlorydaySettingsCard.d.ts.map +1 -1
- package/dist-lib/components/settings/FlorydaySettingsCard.js +26 -48
- package/dist-lib/index.js +1 -1
- package/dist-lib/integrations/supabase/client.js +1 -1
- package/dist-lib/integrations/supabase/client.server.js +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +372 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/cron/process-stock-queue.d.ts +18 -1
- package/dist-lib/lib/cron/process-stock-queue.d.ts.map +1 -1
- package/dist-lib/lib/cron/process-stock-queue.js +71 -23
- package/dist-lib/lib/floriday-gln.d.ts +6 -0
- package/dist-lib/lib/floriday-gln.d.ts.map +1 -0
- package/dist-lib/lib/floriday-gln.js +22 -0
- package/dist-lib/lib/floriday-own-config.d.ts +68 -0
- package/dist-lib/lib/floriday-own-config.d.ts.map +1 -0
- package/dist-lib/lib/floriday-own-config.js +73 -0
- package/dist-lib/lib/floriday-sync.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday-sync.functions.js +8 -0
- package/dist-lib/lib/floriday.functions.d.ts +38 -12
- package/dist-lib/lib/floriday.functions.d.ts.map +1 -1
- package/dist-lib/lib/floriday.functions.js +145 -41
- package/package.json +4 -504
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 1,
|
|
3
|
+
"asset_id": "6db44648-6f9b-4335-8b88-714ad7aaee9d",
|
|
4
|
+
"project_id": "27b6733b-2e2f-4518-b204-681958559055",
|
|
5
|
+
"url": "/__l5e/assets-v1/6db44648-6f9b-4335-8b88-714ad7aaee9d/floriday-logo.png",
|
|
6
|
+
"r2_key": "a/v1/27b6733b-2e2f-4518-b204-681958559055/6db44648-6f9b-4335-8b88-714ad7aaee9d/floriday-logo.png",
|
|
7
|
+
"original_filename": "floriday-logo.png",
|
|
8
|
+
"size": 6921,
|
|
9
|
+
"content_type": "image/png",
|
|
10
|
+
"created_at": "2026-06-24T12:45:45Z"
|
|
11
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function TemplatePage(): import("react").JSX.Element;
|
|
1
|
+
export declare function TemplatePage(): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
//# sourceMappingURL=TemplatePage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TemplatePage.d.ts","sourceRoot":"","sources":["../../src/components/TemplatePage.tsx"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,
|
|
1
|
+
{"version":3,"file":"TemplatePage.d.ts","sourceRoot":"","sources":["../../src/components/TemplatePage.tsx"],"names":[],"mappings":"AAAA,wBAAgB,YAAY,4CAS3B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function FlorydayApiLogPage(): import("react").JSX.Element;
|
|
1
|
+
export declare function FlorydayApiLogPage(): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
//# sourceMappingURL=FlorydayApiLogPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlorydayApiLogPage.d.ts","sourceRoot":"","sources":["../../../src/components/floriday/FlorydayApiLogPage.tsx"],"names":[],"mappings":"AAgEA,wBAAgB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"FlorydayApiLogPage.d.ts","sourceRoot":"","sources":["../../../src/components/floriday/FlorydayApiLogPage.tsx"],"names":[],"mappings":"AAgEA,wBAAgB,kBAAkB,4CAyZjC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function FlorydayConnectionPage(): import("react").JSX.Element;
|
|
1
|
+
export declare function FlorydayConnectionPage(): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
//# sourceMappingURL=FlorydayConnectionPage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlorydayConnectionPage.d.ts","sourceRoot":"","sources":["../../../src/components/floriday/FlorydayConnectionPage.tsx"],"names":[],"mappings":"AAKA,wBAAgB,sBAAsB,
|
|
1
|
+
{"version":3,"file":"FlorydayConnectionPage.d.ts","sourceRoot":"","sources":["../../../src/components/floriday/FlorydayConnectionPage.tsx"],"names":[],"mappings":"AAKA,wBAAgB,sBAAsB,4CAerC"}
|
|
@@ -7,5 +7,5 @@ import { type FlorydayEnvironment } from "../../lib/floriday.functions.js";
|
|
|
7
7
|
export declare function FlorydayCredentialStatusBanner({ environment, className, }: {
|
|
8
8
|
environment: FlorydayEnvironment;
|
|
9
9
|
className?: string;
|
|
10
|
-
}): import("react").JSX.Element | null;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
11
11
|
//# sourceMappingURL=FlorydayCredentialStatusBanner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlorydayCredentialStatusBanner.d.ts","sourceRoot":"","sources":["../../../src/components/floriday/FlorydayCredentialStatusBanner.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAC;AAEzC;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,EAC7C,WAAW,EACX,SAAS,GACV,EAAE;IACD,WAAW,EAAE,mBAAmB,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,
|
|
1
|
+
{"version":3,"file":"FlorydayCredentialStatusBanner.d.ts","sourceRoot":"","sources":["../../../src/components/floriday/FlorydayCredentialStatusBanner.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAC;AAEzC;;;;GAIG;AACH,wBAAgB,8BAA8B,CAAC,EAC7C,WAAW,EACX,SAAS,GACV,EAAE;IACD,WAAW,EAAE,mBAAmB,CAAC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,kDAiCA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function FlorydayShellRoutesCard(): import("react").JSX.Element;
|
|
1
|
+
export declare function FlorydayShellRoutesCard(): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
//# sourceMappingURL=FlorydayShellRoutesCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlorydayShellRoutesCard.d.ts","sourceRoot":"","sources":["../../../src/components/floriday/FlorydayShellRoutesCard.tsx"],"names":[],"mappings":"AAIA,wBAAgB,uBAAuB,
|
|
1
|
+
{"version":3,"file":"FlorydayShellRoutesCard.d.ts","sourceRoot":"","sources":["../../../src/components/floriday/FlorydayShellRoutesCard.tsx"],"names":[],"mappings":"AAIA,wBAAgB,uBAAuB,4CAoDtC"}
|
|
@@ -16,5 +16,5 @@ export declare function FlorydaySyncHealthBanner({ environment, watch, className
|
|
|
16
16
|
environment: FlorydayEnvironment;
|
|
17
17
|
watch: string[];
|
|
18
18
|
className?: string;
|
|
19
|
-
}): import("react").JSX.Element | null;
|
|
19
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
20
20
|
//# sourceMappingURL=FlorydaySyncHealthBanner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlorydaySyncHealthBanner.d.ts","sourceRoot":"","sources":["../../../src/components/floriday/FlorydaySyncHealthBanner.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAC;AAEzC;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,WAAW,EACX,KAAK,EACL,SAAS,GACV,EAAE;IACD,WAAW,EAAE,mBAAmB,CAAC;IACjC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,
|
|
1
|
+
{"version":3,"file":"FlorydaySyncHealthBanner.d.ts","sourceRoot":"","sources":["../../../src/components/floriday/FlorydaySyncHealthBanner.tsx"],"names":[],"mappings":"AAIA,OAAO,EAEL,KAAK,mBAAmB,EACzB,MAAM,iCAAiC,CAAC;AAEzC;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,WAAW,EACX,KAAK,EACL,SAAS,GACV,EAAE;IACD,WAAW,EAAE,mBAAmB,CAAC;IACjC,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,kDAqCA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function FlorydaySyncJobsCard(): import("react").JSX.Element;
|
|
1
|
+
export declare function FlorydaySyncJobsCard(): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
//# sourceMappingURL=FlorydaySyncJobsCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlorydaySyncJobsCard.d.ts","sourceRoot":"","sources":["../../../src/components/floriday/FlorydaySyncJobsCard.tsx"],"names":[],"mappings":"AAmEA,wBAAgB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"FlorydaySyncJobsCard.d.ts","sourceRoot":"","sources":["../../../src/components/floriday/FlorydaySyncJobsCard.tsx"],"names":[],"mappings":"AAmEA,wBAAgB,oBAAoB,4CAsInC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function FlorydayWebhooksCard(): import("react").JSX.Element;
|
|
1
|
+
export declare function FlorydayWebhooksCard(): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
//# sourceMappingURL=FlorydayWebhooksCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlorydayWebhooksCard.d.ts","sourceRoot":"","sources":["../../../src/components/floriday/FlorydayWebhooksCard.tsx"],"names":[],"mappings":"AAsBA,wBAAgB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"FlorydayWebhooksCard.d.ts","sourceRoot":"","sources":["../../../src/components/floriday/FlorydayWebhooksCard.tsx"],"names":[],"mappings":"AAsBA,wBAAgB,oBAAoB,4CAyFnC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function TokenHealthCard(): import("react").JSX.Element;
|
|
1
|
+
export declare function TokenHealthCard(): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
//# sourceMappingURL=TokenHealthCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenHealthCard.d.ts","sourceRoot":"","sources":["../../../src/components/floriday/TokenHealthCard.tsx"],"names":[],"mappings":"AA2DA,wBAAgB,eAAe,
|
|
1
|
+
{"version":3,"file":"TokenHealthCard.d.ts","sourceRoot":"","sources":["../../../src/components/floriday/TokenHealthCard.tsx"],"names":[],"mappings":"AA2DA,wBAAgB,eAAe,4CAqL9B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function FloricodeSettingsCard(): import("react").JSX.Element;
|
|
1
|
+
export declare function FloricodeSettingsCard(): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
//# sourceMappingURL=FloricodeSettingsCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FloricodeSettingsCard.d.ts","sourceRoot":"","sources":["../../../src/components/settings/FloricodeSettingsCard.tsx"],"names":[],"mappings":"AAuDA,wBAAgB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"FloricodeSettingsCard.d.ts","sourceRoot":"","sources":["../../../src/components/settings/FloricodeSettingsCard.tsx"],"names":[],"mappings":"AAuDA,wBAAgB,qBAAqB,4CA4EpC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function FlorydaySettingsCard(): import("react").JSX.Element;
|
|
1
|
+
export declare function FlorydaySettingsCard(): import("react/jsx-runtime").JSX.Element;
|
|
2
2
|
//# sourceMappingURL=FlorydaySettingsCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlorydaySettingsCard.d.ts","sourceRoot":"","sources":["../../../src/components/settings/FlorydaySettingsCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FlorydaySettingsCard.d.ts","sourceRoot":"","sources":["../../../src/components/settings/FlorydaySettingsCard.tsx"],"names":[],"mappings":"AA4EA,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,
|
|
8
|
+
import { listFlorydayConnections, upsertFlorydayConnection, testFlorydayConnection, deleteFlorydayConnection, getFlorydaySettings, setFlorydayActiveEnvironment, getFlorydayOwnConfigStatus, updateFlorydayPublishingSettings, 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() {
|
|
@@ -109,65 +109,43 @@ function ShellHostStatus() {
|
|
|
109
109
|
}
|
|
110
110
|
function PublishingSettings({ env, connection, }) {
|
|
111
111
|
const qc = useQueryClient();
|
|
112
|
-
const
|
|
112
|
+
const getStatus = useServerFn(getFlorydayOwnConfigStatus);
|
|
113
113
|
const updateSettings = useServerFn(updateFlorydayPublishingSettings);
|
|
114
|
-
const [
|
|
115
|
-
const
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
queryFn: () => listWarehouses({ data: { environment: env } }),
|
|
114
|
+
const [warehouseId, setWarehouseId] = useState("");
|
|
115
|
+
const statusQuery = useQuery({
|
|
116
|
+
queryKey: ["floriday-own-config", env],
|
|
117
|
+
queryFn: () => getStatus({ data: { environment: env } }),
|
|
119
118
|
enabled: Boolean(connection),
|
|
120
119
|
});
|
|
121
|
-
const
|
|
122
|
-
? warehousesQuery.data.warehouses
|
|
123
|
-
: [];
|
|
124
|
-
const warehousesError = warehousesQuery.data && !warehousesQuery.data.ok ? warehousesQuery.data.error : null;
|
|
125
|
-
// Auto-preselect het default-magazijn van Floriday wanneer de gebruiker
|
|
126
|
-
// nog geen keuze heeft gemaakt.
|
|
120
|
+
const status = statusQuery.data;
|
|
127
121
|
useEffect(() => {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
if (!warehouses.length)
|
|
131
|
-
return;
|
|
132
|
-
const def = warehouses.find((w) => w.isDefault) ?? warehouses[0];
|
|
133
|
-
if (def)
|
|
134
|
-
setWarehouseId(def.id);
|
|
135
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
136
|
-
}, [warehouses.length]);
|
|
122
|
+
setWarehouseId(status?.preferredWarehouseId ?? "");
|
|
123
|
+
}, [status?.preferredWarehouseId]);
|
|
137
124
|
const saveMutation = useMutation({
|
|
138
|
-
mutationFn: () => {
|
|
139
|
-
const selected = warehouses.find((w) => w.id === warehouseId);
|
|
140
|
-
return updateSettings({
|
|
141
|
-
data: {
|
|
142
|
-
environment: env,
|
|
143
|
-
gln_code: gln,
|
|
144
|
-
preferred_warehouse_id: warehouseId || null,
|
|
145
|
-
preferred_warehouse_name: selected?.name ?? null,
|
|
146
|
-
},
|
|
147
|
-
});
|
|
148
|
-
},
|
|
125
|
+
mutationFn: () => updateSettings({ data: { environment: env, preferred_warehouse_id: warehouseId } }),
|
|
149
126
|
onSuccess: () => {
|
|
150
|
-
toast.success("
|
|
127
|
+
toast.success("Voorkeursmagazijn opgeslagen");
|
|
128
|
+
qc.invalidateQueries({ queryKey: ["floriday-own-config", env] });
|
|
151
129
|
qc.invalidateQueries({ queryKey: ["floriday-connections"] });
|
|
152
130
|
},
|
|
153
131
|
onError: (e) => toast.error(e?.message ?? "Opslaan mislukt"),
|
|
154
132
|
});
|
|
155
133
|
if (!connection) {
|
|
156
|
-
return (_jsx("p", { className: "text-xs text-muted-foreground", children: "Sla eerst je verbindingsgegevens op om publicatie-instellingen te
|
|
134
|
+
return (_jsx("p", { className: "text-xs text-muted-foreground", children: "Sla eerst je verbindingsgegevens op om publicatie-instellingen te zien." }));
|
|
135
|
+
}
|
|
136
|
+
if (statusQuery.isLoading) {
|
|
137
|
+
return _jsx("p", { className: "text-xs text-muted-foreground", children: "Gegevens uit Floriday laden\u2026" });
|
|
138
|
+
}
|
|
139
|
+
if (statusQuery.error || !status) {
|
|
140
|
+
return (_jsxs("p", { className: "text-[11px] text-destructive", children: ["Publicatie-instellingen niet beschikbaar: ", String(statusQuery.error?.message ?? "onbekende fout")] }));
|
|
157
141
|
}
|
|
158
|
-
const
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
if (!selected)
|
|
166
|
-
return null;
|
|
167
|
-
return (_jsxs("span", { className: "flex items-baseline gap-2 truncate", children: [_jsx("span", { className: "truncate", children: selected.name }), selected.gln && (_jsx("span", { className: "text-[11px] text-muted-foreground font-mono", children: selected.gln }))] }));
|
|
168
|
-
})() }) }), _jsx(SelectContent, { children: warehouses.map((w) => (_jsx(SelectItem, { value: w.id, children: _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { children: w.name }), w.gln && (_jsx("span", { className: "text-[11px] text-muted-foreground font-mono", children: w.gln }))] }) }, w.id))) })] }), _jsx("p", { className: "text-[11px] text-muted-foreground", children: "Alleen magazijnen die in Floriday aan je organisatie gekoppeld zijn." }), warehousesError && (_jsxs("p", { className: "text-[11px] text-red-600", children: ["Magazijnen niet beschikbaar: ", warehousesError] }))] }), _jsx("div", { children: _jsx(Button, { size: "sm", onClick: () => saveMutation.mutate(), disabled: saveMutation.isPending ||
|
|
169
|
-
Boolean(glnError) ||
|
|
170
|
-
(!gln.trim() && !warehouseId), children: saveMutation.isPending ? "Opslaan…" : "Instellingen opslaan" }) })] }));
|
|
142
|
+
const gln = status.gln;
|
|
143
|
+
const wh = status.warehouse;
|
|
144
|
+
const own = status.ownWarehouses;
|
|
145
|
+
const showChoice = own.length > 1 || wh?.kind === "missing" || wh?.kind === "choice_needed";
|
|
146
|
+
const dirty = Boolean(warehouseId) && warehouseId !== (status.preferredWarehouseId ?? "");
|
|
147
|
+
const current = own.find((w) => w.id === status.preferredWarehouseId);
|
|
148
|
+
return (_jsxs("div", { className: "rounded-lg border border-border/60 bg-card p-4 space-y-4", children: [_jsxs("div", { className: "space-y-1", children: [_jsx(Label, { className: "text-xs", children: "GLN-code organisatie" }), _jsx("p", { className: "font-mono text-sm", children: status.storedGln ?? "—" }), _jsx("p", { className: "text-[11px] text-muted-foreground", children: "Automatisch uit Floriday." }), gln?.kind === "mismatch" && (_jsxs("p", { className: "text-[11px] text-destructive", children: ["GLN in Floriday (", gln.fromFloriday, ") wijkt af van de opgeslagen GLN (", gln.stored, "); waarschijnlijk is er met een ander account gekoppeld. De opgeslagen waarde is niet overschreven."] })), gln?.kind === "unavailable" && (_jsx("p", { className: "text-[11px] text-muted-foreground", children: "GLN niet beschikbaar in Floriday." })), gln?.kind === "invalid" && (_jsxs("p", { className: "text-[11px] text-destructive", children: ["De GLN in Floriday (", gln.fromFloriday, ") is ongeldig en is niet opgeslagen: ", gln.error] }))] }), _jsxs("div", { className: "space-y-1", children: [_jsx(Label, { htmlFor: `${env}-warehouse`, className: "text-xs", children: "Voorkeursmagazijn" }), wh?.kind === "none" ? (_jsx("p", { className: "text-[11px] text-destructive", children: "Er zijn geen eigen magazijnen in Floriday voor deze koppeling." })) : !showChoice ? (_jsxs("p", { className: "text-sm", children: [current?.name ?? status.preferredWarehouseName ?? "—", current?.gln && (_jsx("span", { className: "ml-2 text-[11px] text-muted-foreground font-mono", children: current.gln }))] })) : (_jsxs(Select, { value: warehouseId || undefined, onValueChange: setWarehouseId, children: [_jsx(SelectTrigger, { id: `${env}-warehouse`, children: _jsx(SelectValue, { placeholder: "Kies een magazijn" }) }), _jsx(SelectContent, { children: own.map((w) => (_jsx(SelectItem, { value: w.id, children: _jsxs("div", { className: "flex flex-col", children: [_jsxs("span", { children: [w.name, w.isDefault ? " (standaard in Floriday)" : ""] }), w.gln && (_jsx("span", { className: "text-[11px] text-muted-foreground font-mono", children: w.gln }))] }) }, w.id))) })] })), wh?.kind === "fill" && wh.reason === "single" && (_jsx("p", { className: "text-[11px] text-muted-foreground", children: "Automatisch: het enige eigen magazijn." })), wh?.kind === "fill" && wh.reason === "default" && (_jsx("p", { className: "text-[11px] text-muted-foreground", children: "Automatisch: standaardmagazijn in Floriday." })), wh?.kind === "choice_needed" && (_jsx("p", { className: "text-[11px] text-destructive", children: "Keuze nodig: er zijn meerdere eigen magazijnen." })), wh?.kind === "missing" && (_jsx("p", { className: "text-[11px] text-destructive", children: "Gekozen magazijn niet meer beschikbaar in Floriday, kies opnieuw." }))] }), showChoice && dirty && (_jsx("div", { children: _jsx(Button, { size: "sm", onClick: () => saveMutation.mutate(), disabled: saveMutation.isPending, children: saveMutation.isPending ? "Opslaan…" : "Instellingen opslaan" }) }))] }));
|
|
171
149
|
}
|
|
172
150
|
function formatRelative(iso) {
|
|
173
151
|
if (!iso)
|
package/dist-lib/index.js
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
// (VITE_SUPABASE_URL / VITE_SUPABASE_PUBLISHABLE_KEY, met fallback op
|
|
4
4
|
// SUPABASE_URL / SUPABASE_PUBLISHABLE_KEY). Geen hardcoded URL of key.
|
|
5
5
|
// Import the supabase client like this:
|
|
6
|
-
// import { supabase } from "
|
|
6
|
+
// import { supabase } from "../../integrations/supabase/client";
|
|
7
7
|
import { supabase } from "@flowselections/core";
|
|
8
8
|
export { supabase };
|
|
@@ -27,7 +27,7 @@ function createSupabaseAdminClient() {
|
|
|
27
27
|
let _supabaseAdmin;
|
|
28
28
|
// Server-side Supabase client with service role - bypasses RLS
|
|
29
29
|
// SECURITY: Only use this for trusted server-side operations, never expose to client code
|
|
30
|
-
// Import like: import { supabaseAdmin } from "
|
|
30
|
+
// Import like: import { supabaseAdmin } from "../../integrations/supabase/client.server";
|
|
31
31
|
export const supabaseAdmin = new Proxy({}, {
|
|
32
32
|
get(_, prop, receiver) {
|
|
33
33
|
if (!_supabaseAdmin)
|