@flowselections/floriday-voorraad 1.0.13 → 1.0.15
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/voorraad/ArtikelWizard.d.ts +5 -0
- package/dist-lib/components/voorraad/ArtikelWizard.d.ts.map +1 -0
- package/dist-lib/components/voorraad/ArtikelWizard.js +1229 -0
- package/dist-lib/components/voorraad/EditArtikelPage.d.ts +4 -0
- package/dist-lib/components/voorraad/EditArtikelPage.d.ts.map +1 -0
- package/dist-lib/components/voorraad/EditArtikelPage.js +51 -0
- package/dist-lib/components/voorraad/NieuwArtikelPage.d.ts +2 -0
- package/dist-lib/components/voorraad/NieuwArtikelPage.d.ts.map +1 -0
- package/dist-lib/components/voorraad/NieuwArtikelPage.js +5 -0
- package/dist-lib/components/voorraad/StockBulkButtons.d.ts +7 -0
- package/dist-lib/components/voorraad/StockBulkButtons.d.ts.map +1 -0
- package/dist-lib/components/voorraad/StockBulkButtons.js +356 -0
- package/dist-lib/components/voorraad/ValidationOverviewTable.d.ts +7 -0
- package/dist-lib/components/voorraad/ValidationOverviewTable.d.ts.map +1 -0
- package/dist-lib/components/voorraad/ValidationOverviewTable.js +87 -0
- package/dist-lib/components/voorraad/ValidationPage.d.ts +2 -0
- package/dist-lib/components/voorraad/ValidationPage.d.ts.map +1 -0
- package/dist-lib/components/voorraad/ValidationPage.js +12 -0
- package/dist-lib/components/voorraad/VoorraadDashboard.d.ts +6 -0
- package/dist-lib/components/voorraad/VoorraadDashboard.d.ts.map +1 -0
- package/dist-lib/components/voorraad/VoorraadDashboard.js +42 -0
- package/dist-lib/components/voorraad/VoorraadPage.d.ts.map +1 -1
- package/dist-lib/components/voorraad/VoorraadPage.js +70 -11
- package/dist-lib/components/voorraad/VoorraadPagination.d.ts +10 -0
- package/dist-lib/components/voorraad/VoorraadPagination.d.ts.map +1 -0
- package/dist-lib/components/voorraad/VoorraadPagination.js +12 -0
- package/dist-lib/components/voorraad/VoorraadStockCard.d.ts +8 -0
- package/dist-lib/components/voorraad/VoorraadStockCard.d.ts.map +1 -0
- package/dist-lib/components/voorraad/VoorraadStockCard.js +33 -0
- package/dist-lib/components/voorraad/VoorraadTable.d.ts.map +1 -1
- package/dist-lib/components/voorraad/VoorraadTable.js +16 -5
- package/dist-lib/hooks/useFloriday.d.ts +55 -0
- package/dist-lib/hooks/useFloriday.d.ts.map +1 -0
- package/dist-lib/hooks/useFloriday.js +298 -0
- package/dist-lib/hooks/useLocalTradeItems.d.ts +17 -1
- package/dist-lib/hooks/useLocalTradeItems.d.ts.map +1 -1
- package/dist-lib/hooks/useLocalTradeItems.js +54 -10
- package/dist-lib/hooks/useTradeItemSpec.d.ts +42 -0
- package/dist-lib/hooks/useTradeItemSpec.d.ts.map +1 -0
- package/dist-lib/hooks/useTradeItemSpec.js +448 -0
- package/dist-lib/hooks/useTradeItemStock.d.ts +19 -0
- package/dist-lib/hooks/useTradeItemStock.d.ts.map +1 -0
- package/dist-lib/hooks/useTradeItemStock.js +78 -0
- package/dist-lib/hooks/useVbnRegulatoryFeatures.d.ts +3 -0
- package/dist-lib/hooks/useVbnRegulatoryFeatures.d.ts.map +1 -0
- package/dist-lib/hooks/useVbnRegulatoryFeatures.js +19 -0
- package/dist-lib/hooks/useVoorraadData.d.ts +2 -1
- package/dist-lib/hooks/useVoorraadData.d.ts.map +1 -1
- package/dist-lib/hooks/useVoorraadData.js +39 -11
- package/dist-lib/index.d.ts +4 -0
- package/dist-lib/index.d.ts.map +1 -1
- package/dist-lib/index.js +6 -5
- package/dist-lib/integrations/supabase/auth-middleware.d.ts +8346 -3367
- package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/client.d.ts +8346 -3367
- package/dist-lib/integrations/supabase/client.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/client.server.d.ts +8346 -3367
- package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +8460 -3341
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/types.js +10 -1
- package/dist-lib/lib/__tests__/floricode-required-features.test.d.ts +2 -0
- package/dist-lib/lib/__tests__/floricode-required-features.test.d.ts.map +1 -0
- package/dist-lib/lib/__tests__/floricode-required-features.test.js +186 -0
- package/dist-lib/lib/floricode-client.d.ts +15 -1
- package/dist-lib/lib/floricode-client.d.ts.map +1 -1
- package/dist-lib/lib/floricode-client.js +42 -4
- package/dist-lib/lib/floricode-required-features.functions.d.ts +10026 -0
- package/dist-lib/lib/floricode-required-features.functions.d.ts.map +1 -0
- package/dist-lib/lib/floricode-required-features.functions.js +170 -0
- package/dist-lib/lib/floriday-client.d.ts +36 -8
- package/dist-lib/lib/floriday-client.d.ts.map +1 -1
- package/dist-lib/lib/floriday-client.js +206 -25
- package/dist-lib/lib/floriday-env.d.ts +29 -0
- package/dist-lib/lib/floriday-env.d.ts.map +1 -0
- package/dist-lib/lib/floriday-env.js +42 -0
- package/dist-lib/lib/floriday-env.server.d.ts +15 -0
- package/dist-lib/lib/floriday-env.server.d.ts.map +1 -0
- package/dist-lib/lib/floriday-env.server.js +13 -0
- package/dist-lib/lib/floriday-field-sources.d.ts +18 -0
- package/dist-lib/lib/floriday-field-sources.d.ts.map +1 -0
- package/dist-lib/lib/floriday-field-sources.js +45 -0
- package/dist-lib/lib/floriday-gateway-entities.d.ts +44 -0
- package/dist-lib/lib/floriday-gateway-entities.d.ts.map +1 -0
- package/dist-lib/lib/floriday-gateway-entities.js +51 -0
- package/dist-lib/lib/floriday-gateway.functions.d.ts +39999 -0
- package/dist-lib/lib/floriday-gateway.functions.d.ts.map +1 -0
- package/dist-lib/lib/floriday-gateway.functions.js +68 -0
- package/dist-lib/lib/floriday-gateway.server.d.ts +122 -0
- package/dist-lib/lib/floriday-gateway.server.d.ts.map +1 -0
- package/dist-lib/lib/floriday-gateway.server.js +230 -0
- package/dist-lib/lib/floriday-import-validator.d.ts +26 -0
- package/dist-lib/lib/floriday-import-validator.d.ts.map +1 -0
- package/dist-lib/lib/floriday-import-validator.js +41 -0
- package/dist-lib/lib/floriday-payload.d.ts +47 -3
- package/dist-lib/lib/floriday-payload.d.ts.map +1 -1
- package/dist-lib/lib/floriday-payload.js +179 -7
- package/dist-lib/lib/floriday-schema-to-zod.d.ts +9 -0
- package/dist-lib/lib/floriday-schema-to-zod.d.ts.map +1 -0
- package/dist-lib/lib/floriday-schema-to-zod.js +53 -0
- package/dist-lib/lib/floriday-writes.functions.d.ts +19998 -0
- package/dist-lib/lib/floriday-writes.functions.d.ts.map +1 -0
- package/dist-lib/lib/floriday-writes.functions.js +74 -0
- package/dist-lib/lib/image-resize.d.ts +43 -0
- package/dist-lib/lib/image-resize.d.ts.map +1 -0
- package/dist-lib/lib/image-resize.js +212 -0
- package/dist-lib/lib/normalize-errors-middleware.d.ts +2 -0
- package/dist-lib/lib/normalize-errors-middleware.d.ts.map +1 -0
- package/dist-lib/lib/normalize-errors-middleware.js +24 -0
- package/dist-lib/lib/wizard-step-fields.d.ts +15 -0
- package/dist-lib/lib/wizard-step-fields.d.ts.map +1 -0
- package/dist-lib/lib/wizard-step-fields.js +51 -0
- package/package.json +35 -14
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-only HMAC client for the Floriday Auth-module gateway.
|
|
3
|
+
*
|
|
4
|
+
* Headers exact volgens §14.2:
|
|
5
|
+
* x-floriday-timestamp: <unix milliseconds>
|
|
6
|
+
* x-floriday-caller: voorraad
|
|
7
|
+
* x-floriday-signature: sha256=<hex HMAC-SHA256 over `${ts}.${rawBody}`>
|
|
8
|
+
*
|
|
9
|
+
* Niet importeren vanuit client code (filename eindigt op .server.ts en
|
|
10
|
+
* wordt geblokkeerd door de client bundler).
|
|
11
|
+
*
|
|
12
|
+
* Fail-closed contract:
|
|
13
|
+
* - Voor ELKE call: response MOET application/json zijn en HTTP 2xx — anders error.
|
|
14
|
+
* - Voor WRITE-call (`/api/public/gateway/write`) EXTRA envelope-eisen:
|
|
15
|
+
* { ok: true, status: 2xx, attemptId: "...", data: ... }
|
|
16
|
+
* Ontbreekt één daarvan → throw met de echte `json.error`.
|
|
17
|
+
* - Lees-/upload-paden (schema, code-list, cached-list, media) krijgen
|
|
18
|
+
* GEEN envelope-check; die geven gewoon de payload terug.
|
|
19
|
+
*/
|
|
20
|
+
export interface GatewaySchemaInput {
|
|
21
|
+
environment: "staging" | "live";
|
|
22
|
+
resource: string;
|
|
23
|
+
/**
|
|
24
|
+
* §15.2 — optionele lijst code-list-namen (kebab-case, max 25) die de
|
|
25
|
+
* gateway in dezelfde response moet meeleveren onder `codeLists`.
|
|
26
|
+
*/
|
|
27
|
+
includeCodeLists?: string[];
|
|
28
|
+
[key: string]: unknown;
|
|
29
|
+
}
|
|
30
|
+
export declare function gatewaySchema<T = unknown>(input: GatewaySchemaInput): Promise<T>;
|
|
31
|
+
export interface GatewayCodeListInput {
|
|
32
|
+
environment: "staging" | "live";
|
|
33
|
+
listName: string;
|
|
34
|
+
}
|
|
35
|
+
export declare function gatewayCodeList<T = unknown>(input: GatewayCodeListInput): Promise<T>;
|
|
36
|
+
import { type GatewayEntity } from "./floriday-gateway-entities";
|
|
37
|
+
export interface GatewayCachedListInput {
|
|
38
|
+
environment: "staging" | "live";
|
|
39
|
+
/**
|
|
40
|
+
* Kebab-case Floriday-resource (bv. "packings", "trade-item-classifications").
|
|
41
|
+
* NIET de Supabase-tabelnaam — die wordt server-side geweigerd met
|
|
42
|
+
* `400 Onbekende entity`.
|
|
43
|
+
*/
|
|
44
|
+
entity: GatewayEntity;
|
|
45
|
+
limit?: number;
|
|
46
|
+
}
|
|
47
|
+
export declare function gatewayCachedList<T = unknown>(input: GatewayCachedListInput): Promise<T>;
|
|
48
|
+
export interface GatewayWriteInput {
|
|
49
|
+
environment: "staging" | "live";
|
|
50
|
+
module: string;
|
|
51
|
+
action: string;
|
|
52
|
+
method: "POST" | "PUT" | "PATCH" | "DELETE";
|
|
53
|
+
path: string;
|
|
54
|
+
referenceId: string;
|
|
55
|
+
idempotencyKey: string;
|
|
56
|
+
body: unknown;
|
|
57
|
+
validateEnums?: {
|
|
58
|
+
field: string;
|
|
59
|
+
listName: string;
|
|
60
|
+
}[];
|
|
61
|
+
}
|
|
62
|
+
export interface GatewayWriteResult {
|
|
63
|
+
data: any;
|
|
64
|
+
attemptId: string;
|
|
65
|
+
status: number;
|
|
66
|
+
}
|
|
67
|
+
export declare function gatewayWrite(input: GatewayWriteInput): Promise<GatewayWriteResult>;
|
|
68
|
+
export interface GatewayMediaUploadInput {
|
|
69
|
+
caller?: string;
|
|
70
|
+
environment: "staging" | "live";
|
|
71
|
+
path: string;
|
|
72
|
+
method?: "POST" | "PUT";
|
|
73
|
+
filename: string;
|
|
74
|
+
contentType: string;
|
|
75
|
+
bytes: Uint8Array;
|
|
76
|
+
formField?: string;
|
|
77
|
+
referenceId?: string;
|
|
78
|
+
idempotencyKey?: string;
|
|
79
|
+
extraFields?: Record<string, string>;
|
|
80
|
+
}
|
|
81
|
+
export interface GatewayMediaUploadResult {
|
|
82
|
+
ok: boolean;
|
|
83
|
+
status: number;
|
|
84
|
+
data: any;
|
|
85
|
+
attemptId: string | null;
|
|
86
|
+
error?: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Streamt het bestand 1-op-1 naar de centrale Auth-gateway. HMAC wordt
|
|
90
|
+
* berekend over `${timestamp}.${sha256hex(bodyBytes)}` (§14.11), GEEN
|
|
91
|
+
* base64-inflatie en geen formData-buffering meer.
|
|
92
|
+
*/
|
|
93
|
+
export declare function gatewayMediaUpload(input: GatewayMediaUploadInput): Promise<GatewayMediaUploadResult>;
|
|
94
|
+
export interface GatewayDiagnosticsReport {
|
|
95
|
+
caller?: string;
|
|
96
|
+
module: string;
|
|
97
|
+
action: string;
|
|
98
|
+
environment: "staging" | "live";
|
|
99
|
+
path: string;
|
|
100
|
+
referenceId?: string | null;
|
|
101
|
+
idempotencyKey?: string | null;
|
|
102
|
+
attemptNumber?: number;
|
|
103
|
+
requestTimestamp?: number;
|
|
104
|
+
requestBodyHash?: string | null;
|
|
105
|
+
fileMeta?: {
|
|
106
|
+
filename?: string;
|
|
107
|
+
contentType?: string;
|
|
108
|
+
sizeBytes?: number;
|
|
109
|
+
};
|
|
110
|
+
responseStatus?: number | null;
|
|
111
|
+
responseContentType?: string | null;
|
|
112
|
+
responseSnippet?: string | null;
|
|
113
|
+
errorMessage?: string | null;
|
|
114
|
+
clientUserId?: string | null;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Stuurt een machine-leesbaar diagnoserapport naar de Authenticatie-module
|
|
118
|
+
* (gateway-endpoint `/api/public/gateway/diagnostics`). Fire-and-forget: fouten
|
|
119
|
+
* worden geslikt zodat de oorspronkelijke caller niet cascadeert.
|
|
120
|
+
*/
|
|
121
|
+
export declare function reportGatewayFailure(report: GatewayDiagnosticsReport): Promise<void>;
|
|
122
|
+
//# sourceMappingURL=floriday-gateway.server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floriday-gateway.server.d.ts","sourceRoot":"","sources":["../../src/lib/floriday-gateway.server.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AA0IH,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,SAAS,GAAG,MAAM,CAAC;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AACD,wBAAgB,aAAa,CAAC,CAAC,GAAG,OAAO,EAAE,KAAK,EAAE,kBAAkB,GAAG,OAAO,CAAC,CAAC,CAAC,CAEhF;AAID,MAAM,WAAW,oBAAoB;IACnC,WAAW,EAAE,SAAS,GAAG,MAAM,CAAC;IAChC,QAAQ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AC,EAAE,MAAM,GAAG,IAAI,CAAC;IACpC,eAAe,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED;;;;GAIG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAAC,IAAI,CAAC,CAmBf"}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Server-only HMAC client for the Floriday Auth-module gateway.
|
|
3
|
+
*
|
|
4
|
+
* Headers exact volgens §14.2:
|
|
5
|
+
* x-floriday-timestamp: <unix milliseconds>
|
|
6
|
+
* x-floriday-caller: voorraad
|
|
7
|
+
* x-floriday-signature: sha256=<hex HMAC-SHA256 over `${ts}.${rawBody}`>
|
|
8
|
+
*
|
|
9
|
+
* Niet importeren vanuit client code (filename eindigt op .server.ts en
|
|
10
|
+
* wordt geblokkeerd door de client bundler).
|
|
11
|
+
*
|
|
12
|
+
* Fail-closed contract:
|
|
13
|
+
* - Voor ELKE call: response MOET application/json zijn en HTTP 2xx — anders error.
|
|
14
|
+
* - Voor WRITE-call (`/api/public/gateway/write`) EXTRA envelope-eisen:
|
|
15
|
+
* { ok: true, status: 2xx, attemptId: "...", data: ... }
|
|
16
|
+
* Ontbreekt één daarvan → throw met de echte `json.error`.
|
|
17
|
+
* - Lees-/upload-paden (schema, code-list, cached-list, media) krijgen
|
|
18
|
+
* GEEN envelope-check; die geven gewoon de payload terug.
|
|
19
|
+
*/
|
|
20
|
+
// HMAC via Web Crypto (browser/Node 15+/Deno). Node's "node:crypto" is niet
|
|
21
|
+
// beschikbaar wanneer dist-lib client-side wordt gebundeld door de shell.
|
|
22
|
+
const CALLER = "voorraad";
|
|
23
|
+
const WRITE_PATH = "/api/public/gateway/write";
|
|
24
|
+
function getConfig() {
|
|
25
|
+
const url = process.env.FLORIDAY_GATEWAY_URL;
|
|
26
|
+
const secret = process.env.FLORIDAY_GATEWAY_SECRET;
|
|
27
|
+
if (!url || !secret) {
|
|
28
|
+
throw new Error("FLORIDAY_GATEWAY_URL / FLORIDAY_GATEWAY_SECRET ontbreken — gateway niet bereikbaar.");
|
|
29
|
+
}
|
|
30
|
+
return { url: url.replace(/\/$/, ""), secret };
|
|
31
|
+
}
|
|
32
|
+
async function hmacSha256Hex(secret, data) {
|
|
33
|
+
const key = await globalThis.crypto.subtle.importKey("raw", new TextEncoder().encode(secret), { name: "HMAC", hash: "SHA-256" }, false, ["sign"]);
|
|
34
|
+
const sig = await globalThis.crypto.subtle.sign("HMAC", key, new TextEncoder().encode(data));
|
|
35
|
+
return Array.from(new Uint8Array(sig))
|
|
36
|
+
.map((b) => b.toString(16).padStart(2, "0"))
|
|
37
|
+
.join("");
|
|
38
|
+
}
|
|
39
|
+
async function sign(ts, rawBody, secret) {
|
|
40
|
+
return hmacSha256Hex(secret, `${ts}.${rawBody}`);
|
|
41
|
+
}
|
|
42
|
+
async function doSignedFetch(path, rawBody) {
|
|
43
|
+
const { url, secret } = getConfig();
|
|
44
|
+
// x-floriday-timestamp MOET per call vers gezet worden op Date.now()
|
|
45
|
+
// (unix-MILLISECONDEN, niet seconden, niet gecached). De HMAC wordt
|
|
46
|
+
// berekend over exact `${timestamp}.${rawBody}` met diezelfde string.
|
|
47
|
+
const timestamp = Date.now().toString();
|
|
48
|
+
const sigHex = await sign(timestamp, rawBody, secret);
|
|
49
|
+
return fetch(`${url}${path}`, {
|
|
50
|
+
method: "POST",
|
|
51
|
+
headers: {
|
|
52
|
+
"Content-Type": "application/json",
|
|
53
|
+
"x-floriday-timestamp": timestamp,
|
|
54
|
+
"x-floriday-signature": `sha256=${sigHex}`,
|
|
55
|
+
"x-floriday-caller": CALLER,
|
|
56
|
+
},
|
|
57
|
+
body: rawBody,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
async function gatewayPost(path, body) {
|
|
61
|
+
// Runtime-guard: als de body een `environment`-veld bevat, MOET het exact
|
|
62
|
+
// "staging" of "live" zijn. Voorkomt dat een "production" of undefined
|
|
63
|
+
// de gateway 400 "Ongeldige environment" oplevert.
|
|
64
|
+
if (body && typeof body === "object") {
|
|
65
|
+
const env = body.environment;
|
|
66
|
+
if (env !== undefined && env !== "staging" && env !== "live") {
|
|
67
|
+
const { FloridayEnvError } = await import("./floriday-env");
|
|
68
|
+
throw new FloridayEnvError("INVALID_FLORIDAY_ENVIRONMENT", `Body.environment moet "staging" of "live" zijn (kreeg: ${JSON.stringify(env)}).`);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
const raw = JSON.stringify(body ?? {});
|
|
72
|
+
const res = await doSignedFetch(path, raw);
|
|
73
|
+
const ct = res.headers.get("content-type") ?? "";
|
|
74
|
+
const text = await res.text();
|
|
75
|
+
// Fail-closed: alleen JSON wordt geaccepteerd. HTML/leeg = fout, ook bij 2xx.
|
|
76
|
+
if (!ct.toLowerCase().includes("application/json")) {
|
|
77
|
+
throw new Error(`gateway ${path} → niet-JSON antwoord (status=${res.status}, content-type=${ct || "leeg"})`);
|
|
78
|
+
}
|
|
79
|
+
let parsed;
|
|
80
|
+
try {
|
|
81
|
+
parsed = text ? JSON.parse(text) : null;
|
|
82
|
+
}
|
|
83
|
+
catch {
|
|
84
|
+
throw new Error(`gateway ${path} → JSON parse-fout (status=${res.status})`);
|
|
85
|
+
}
|
|
86
|
+
if (parsed == null) {
|
|
87
|
+
throw new Error(`gateway ${path} → lege JSON-body (status=${res.status})`);
|
|
88
|
+
}
|
|
89
|
+
if (!res.ok) {
|
|
90
|
+
const detail = parsed?.error || parsed?.detail || parsed?.message || `HTTP ${res.status}`;
|
|
91
|
+
throw new Error(`gateway ${path} → ${detail}`);
|
|
92
|
+
}
|
|
93
|
+
// Write-pad: strikte envelope-check.
|
|
94
|
+
if (path === WRITE_PATH) {
|
|
95
|
+
if (parsed.ok !== true) {
|
|
96
|
+
throw new Error(parsed.error ??
|
|
97
|
+
`Gateway-call niet bevestigd door Floriday (status=${parsed.status ?? "onbekend"})`);
|
|
98
|
+
}
|
|
99
|
+
if (typeof parsed.status !== "number" ||
|
|
100
|
+
parsed.status < 200 ||
|
|
101
|
+
parsed.status >= 300) {
|
|
102
|
+
throw new Error(parsed.error ??
|
|
103
|
+
`Gateway-call niet bevestigd door Floriday (status=${parsed.status ?? "onbekend"})`);
|
|
104
|
+
}
|
|
105
|
+
if (!parsed.attemptId) {
|
|
106
|
+
throw new Error("Gateway-call verwerkt, maar zonder centrale logbevestiging (attemptId ontbreekt)");
|
|
107
|
+
}
|
|
108
|
+
return {
|
|
109
|
+
data: parsed.data ?? null,
|
|
110
|
+
attemptId: String(parsed.attemptId),
|
|
111
|
+
status: parsed.status,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
return parsed;
|
|
115
|
+
}
|
|
116
|
+
export function gatewaySchema(input) {
|
|
117
|
+
return gatewayPost("/api/public/gateway/schema", input);
|
|
118
|
+
}
|
|
119
|
+
export function gatewayCodeList(input) {
|
|
120
|
+
return gatewayPost("/api/public/gateway/code-list", input);
|
|
121
|
+
}
|
|
122
|
+
// ---------- Cached list (stamdata uit gedeelde Supabase cache) -------------
|
|
123
|
+
import { isGatewayEntity } from "./floriday-gateway-entities";
|
|
124
|
+
export function gatewayCachedList(input) {
|
|
125
|
+
if (!isGatewayEntity(input.entity)) {
|
|
126
|
+
throw new Error(`gateway.cachedList: ongeldige entity ${JSON.stringify(input.entity)} — gebruik een kebab-case Floriday-resource uit GATEWAY_ENTITIES.`);
|
|
127
|
+
}
|
|
128
|
+
return gatewayPost("/api/public/gateway/cached-list", {
|
|
129
|
+
limit: 1000,
|
|
130
|
+
...input,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
export function gatewayWrite(input) {
|
|
134
|
+
return gatewayPost(WRITE_PATH, input);
|
|
135
|
+
}
|
|
136
|
+
function toHex(buf) {
|
|
137
|
+
const a = new Uint8Array(buf);
|
|
138
|
+
let s = "";
|
|
139
|
+
for (let i = 0; i < a.length; i++)
|
|
140
|
+
s += a[i].toString(16).padStart(2, "0");
|
|
141
|
+
return s;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Streamt het bestand 1-op-1 naar de centrale Auth-gateway. HMAC wordt
|
|
145
|
+
* berekend over `${timestamp}.${sha256hex(bodyBytes)}` (§14.11), GEEN
|
|
146
|
+
* base64-inflatie en geen formData-buffering meer.
|
|
147
|
+
*/
|
|
148
|
+
export async function gatewayMediaUpload(input) {
|
|
149
|
+
const { url, secret } = getConfig();
|
|
150
|
+
const timestamp = Date.now().toString();
|
|
151
|
+
const bodyHashBuf = await crypto.subtle.digest("SHA-256", input.bytes);
|
|
152
|
+
const bodyHash = toHex(bodyHashBuf);
|
|
153
|
+
const sigHex = await hmacSha256Hex(secret, `${timestamp}.${bodyHash}`);
|
|
154
|
+
const headers = {
|
|
155
|
+
"Content-Type": input.contentType,
|
|
156
|
+
"x-floriday-timestamp": timestamp,
|
|
157
|
+
"x-floriday-signature": `sha256=${sigHex}`,
|
|
158
|
+
"x-floriday-caller": input.caller ?? CALLER,
|
|
159
|
+
"x-floriday-environment": input.environment,
|
|
160
|
+
"x-floriday-path": input.path,
|
|
161
|
+
"x-floriday-filename": input.filename,
|
|
162
|
+
"x-floriday-content-type": input.contentType,
|
|
163
|
+
};
|
|
164
|
+
if (input.method)
|
|
165
|
+
headers["x-floriday-method"] = input.method;
|
|
166
|
+
if (input.formField)
|
|
167
|
+
headers["x-floriday-form-field"] = input.formField;
|
|
168
|
+
if (input.referenceId)
|
|
169
|
+
headers["x-floriday-reference-id"] = input.referenceId;
|
|
170
|
+
if (input.idempotencyKey)
|
|
171
|
+
headers["x-floriday-idempotency-key"] = input.idempotencyKey;
|
|
172
|
+
if (input.extraFields)
|
|
173
|
+
headers["x-floriday-extra-fields"] = JSON.stringify(input.extraFields);
|
|
174
|
+
const res = await fetch(`${url}/api/public/gateway/media-upload`, {
|
|
175
|
+
method: "POST",
|
|
176
|
+
headers,
|
|
177
|
+
body: input.bytes,
|
|
178
|
+
});
|
|
179
|
+
const ct = res.headers.get("content-type") ?? "";
|
|
180
|
+
const text = await res.text();
|
|
181
|
+
if (!ct.toLowerCase().includes("application/json")) {
|
|
182
|
+
throw new Error(`gateway media-upload → niet-JSON antwoord (status=${res.status})`);
|
|
183
|
+
}
|
|
184
|
+
let parsed;
|
|
185
|
+
try {
|
|
186
|
+
parsed = text ? JSON.parse(text) : null;
|
|
187
|
+
}
|
|
188
|
+
catch {
|
|
189
|
+
throw new Error(`gateway media-upload → JSON parse-fout (status=${res.status})`);
|
|
190
|
+
}
|
|
191
|
+
if (parsed == null) {
|
|
192
|
+
throw new Error(`gateway media-upload → lege body (status=${res.status})`);
|
|
193
|
+
}
|
|
194
|
+
if (!res.ok || parsed.ok !== true) {
|
|
195
|
+
const detail = parsed?.error || parsed?.detail || parsed?.message || `HTTP ${res.status}`;
|
|
196
|
+
throw new Error(detail);
|
|
197
|
+
}
|
|
198
|
+
return {
|
|
199
|
+
ok: true,
|
|
200
|
+
status: typeof parsed.status === "number" ? parsed.status : res.status,
|
|
201
|
+
data: parsed.data ?? null,
|
|
202
|
+
attemptId: parsed.attemptId ?? null,
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Stuurt een machine-leesbaar diagnoserapport naar de Authenticatie-module
|
|
207
|
+
* (gateway-endpoint `/api/public/gateway/diagnostics`). Fire-and-forget: fouten
|
|
208
|
+
* worden geslikt zodat de oorspronkelijke caller niet cascadeert.
|
|
209
|
+
*/
|
|
210
|
+
export async function reportGatewayFailure(report) {
|
|
211
|
+
try {
|
|
212
|
+
const { url, secret } = getConfig();
|
|
213
|
+
const body = JSON.stringify({ caller: CALLER, ...report });
|
|
214
|
+
const timestamp = Date.now().toString();
|
|
215
|
+
const sigHex = await hmacSha256Hex(secret, `${timestamp}.${body}`);
|
|
216
|
+
await fetch(`${url}/api/public/gateway/diagnostics`, {
|
|
217
|
+
method: "POST",
|
|
218
|
+
headers: {
|
|
219
|
+
"Content-Type": "application/json",
|
|
220
|
+
"x-floriday-timestamp": timestamp,
|
|
221
|
+
"x-floriday-signature": `sha256=${sigHex}`,
|
|
222
|
+
"x-floriday-caller": report.caller ?? CALLER,
|
|
223
|
+
},
|
|
224
|
+
body,
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
catch (e) {
|
|
228
|
+
console.warn("[reportGatewayFailure] kon diagnose niet versturen:", e);
|
|
229
|
+
}
|
|
230
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validatie-helpers voor Excel-import → auto-koppel / auto-publiceer flow.
|
|
3
|
+
*
|
|
4
|
+
* De lijst met verplichte velden is bewust hier gecentraliseerd zodat we die
|
|
5
|
+
* kunnen uitbreiden zodra Floriday nieuwe eisen stelt zonder de import-logica
|
|
6
|
+
* te raken.
|
|
7
|
+
*/
|
|
8
|
+
import type { WizardData } from "./floriday-payload";
|
|
9
|
+
export type DraftLinkStatus = "unlinked" | "linked" | "waiting_for_data" | "ready_to_publish" | "publish_failed" | "ambiguous_match" | "published";
|
|
10
|
+
export interface RequiredFieldSpec {
|
|
11
|
+
key: string;
|
|
12
|
+
label: string;
|
|
13
|
+
check: (d: Partial<WizardData>) => boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Basisset van verplichte velden voor publicatie naar Floriday. Uitbreidbaar:
|
|
17
|
+
* voeg eenvoudig extra items toe wanneer Floriday nieuwe eisen stelt.
|
|
18
|
+
*/
|
|
19
|
+
export declare const REQUIRED_FIELDS_FOR_PUBLISH: RequiredFieldSpec[];
|
|
20
|
+
export interface ValidationResult {
|
|
21
|
+
ok: boolean;
|
|
22
|
+
missing: string[];
|
|
23
|
+
missingKeys: string[];
|
|
24
|
+
}
|
|
25
|
+
export declare function validateDraftForPublish(d: Partial<WizardData>): ValidationResult;
|
|
26
|
+
//# sourceMappingURL=floriday-import-validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floriday-import-validator.d.ts","sourceRoot":"","sources":["../../src/lib/floriday-import-validator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,MAAM,eAAe,GACvB,UAAU,GACV,QAAQ,GACR,kBAAkB,GAClB,kBAAkB,GAClB,gBAAgB,GAChB,iBAAiB,GACjB,WAAW,CAAC;AAEhB,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,KAAK,OAAO,CAAC;CAC5C;AAED;;;GAGG;AACH,eAAO,MAAM,2BAA2B,EAAE,iBAAiB,EA0B1D,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,OAAO,CAAC;IACZ,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,OAAO,CAAC,UAAU,CAAC,GAAG,gBAAgB,CAUhF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Basisset van verplichte velden voor publicatie naar Floriday. Uitbreidbaar:
|
|
3
|
+
* voeg eenvoudig extra items toe wanneer Floriday nieuwe eisen stelt.
|
|
4
|
+
*/
|
|
5
|
+
export const REQUIRED_FIELDS_FOR_PUBLISH = [
|
|
6
|
+
{ key: "articleCode", label: "Artikelcode", check: (d) => !!d.articleCode?.trim() },
|
|
7
|
+
{ key: "name", label: "Artikelnaam", check: (d) => !!d.name?.trim() && d.name.trim().length >= 2 },
|
|
8
|
+
{ key: "vbnCode", label: "VBN-productcode", check: (d) => !!d.vbnCode?.trim() },
|
|
9
|
+
{ key: "productGroup", label: "Productgroep", check: (d) => !!d.productGroup },
|
|
10
|
+
{
|
|
11
|
+
key: "botanicalName",
|
|
12
|
+
label: "Botanische naam",
|
|
13
|
+
check: (d) => !!d.botanicalName?.trim(),
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
key: "countryOfOrigin",
|
|
17
|
+
label: "Land van oorsprong",
|
|
18
|
+
check: (d) => !!d.countryOfOrigin?.trim(),
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
key: "images",
|
|
22
|
+
label: "Minstens 1 foto",
|
|
23
|
+
check: (d) => Array.isArray(d.images) && d.images.length > 0,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
key: "packingConfigurations",
|
|
27
|
+
label: "Beladingsconfiguratie",
|
|
28
|
+
check: (d) => Array.isArray(d.packingConfigurations) && d.packingConfigurations.length > 0,
|
|
29
|
+
},
|
|
30
|
+
];
|
|
31
|
+
export function validateDraftForPublish(d) {
|
|
32
|
+
const missing = [];
|
|
33
|
+
const missingKeys = [];
|
|
34
|
+
for (const f of REQUIRED_FIELDS_FOR_PUBLISH) {
|
|
35
|
+
if (!f.check(d)) {
|
|
36
|
+
missing.push(f.label);
|
|
37
|
+
missingKeys.push(f.key);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return { ok: missing.length === 0, missing, missingKeys };
|
|
41
|
+
}
|
|
@@ -1,16 +1,44 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export type ProductGroup = "CUT_FLOWER" | "POT_PLANT" | "GARDEN_PLANT";
|
|
3
3
|
export type ArticleType = "REGULAR" | "CUSTOMER_SPECIFIC";
|
|
4
|
+
export type PackingSource = "VBN" | "SUPPLIER";
|
|
4
5
|
export interface PackingConfigurationInput {
|
|
5
6
|
id: string;
|
|
6
7
|
floridayId?: string;
|
|
7
|
-
|
|
8
|
+
/** Bron van het fust: reguliere VBN-fust óf aangesloten verpakkingsleverancier */
|
|
9
|
+
source: PackingSource;
|
|
10
|
+
/** Ladingdrager (verplicht) */
|
|
8
11
|
loadCarrier: string;
|
|
12
|
+
/** VBN-fustcode — verplicht wanneer source = "VBN", en als fallback bij "SUPPLIER" */
|
|
13
|
+
packagingType: string;
|
|
14
|
+
/** Alleen bij source = "SUPPLIER" */
|
|
15
|
+
packagingSupplierId?: string;
|
|
16
|
+
packagingSupplierName?: string;
|
|
17
|
+
packagingMaterialId?: string;
|
|
18
|
+
packagingMaterialName?: string;
|
|
19
|
+
packageWidthMm?: number;
|
|
20
|
+
packageLengthMm?: number;
|
|
21
|
+
volumeWeightKg?: number;
|
|
22
|
+
/** Belading afmetingen */
|
|
9
23
|
unitsPerPackage: number;
|
|
10
24
|
packagesPerLayer: number;
|
|
11
25
|
layersPerLoadCarrier: number;
|
|
12
26
|
stackingHeightCm?: number;
|
|
27
|
+
/** Foto van artikel in dit fust (optioneel). URL is Floriday-CDN url. */
|
|
28
|
+
photoUrl?: string;
|
|
29
|
+
photoImageId?: string;
|
|
30
|
+
photoPreviewUrl?: string;
|
|
31
|
+
/** Reguliere of klantspecifieke belading */
|
|
32
|
+
isCustomerSpecific: boolean;
|
|
33
|
+
customerOrganizationIds: string[];
|
|
34
|
+
/** Eerste belading = primair. Wordt door de UI beheerd. */
|
|
35
|
+
isPrimary: boolean;
|
|
13
36
|
}
|
|
37
|
+
/** Hardcoded lijst met aangesloten verpakkingsleveranciers zoals in Floriday. */
|
|
38
|
+
export declare const PACKAGING_SUPPLIERS: {
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
}[];
|
|
14
42
|
export interface AdditionalPackagingInput {
|
|
15
43
|
id: string;
|
|
16
44
|
code: string;
|
|
@@ -22,6 +50,10 @@ export interface PhotoInput {
|
|
|
22
50
|
name?: string;
|
|
23
51
|
primary?: boolean;
|
|
24
52
|
sortOrder?: number;
|
|
53
|
+
/** Floriday mediaId (UUID), teruggegeven door POST /media (AddImage). */
|
|
54
|
+
imageId?: string | null;
|
|
55
|
+
/** Lokale blob/object URL voor previewweergave in de wizard (niet verstuurd) */
|
|
56
|
+
previewUrl?: string;
|
|
25
57
|
}
|
|
26
58
|
export interface WizardData {
|
|
27
59
|
productGroup: ProductGroup | null;
|
|
@@ -80,11 +112,18 @@ export declare const stepSchemas: {
|
|
|
80
112
|
}, z.core.$strip>;
|
|
81
113
|
beladingen: z.ZodObject<{
|
|
82
114
|
packingConfigurations: z.ZodArray<z.ZodObject<{
|
|
83
|
-
|
|
115
|
+
source: z.ZodDefault<z.ZodEnum<{
|
|
116
|
+
VBN: "VBN";
|
|
117
|
+
SUPPLIER: "SUPPLIER";
|
|
118
|
+
}>>;
|
|
119
|
+
packagingType: z.ZodDefault<z.ZodString>;
|
|
84
120
|
loadCarrier: z.ZodString;
|
|
121
|
+
packagingSupplierId: z.ZodOptional<z.ZodString>;
|
|
85
122
|
unitsPerPackage: z.ZodNumber;
|
|
86
123
|
packagesPerLayer: z.ZodNumber;
|
|
87
124
|
layersPerLoadCarrier: z.ZodNumber;
|
|
125
|
+
isCustomerSpecific: z.ZodDefault<z.ZodBoolean>;
|
|
126
|
+
customerOrganizationIds: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
88
127
|
}, z.core.$strip>>;
|
|
89
128
|
}, z.core.$strip>;
|
|
90
129
|
beschikbaarheid: z.ZodObject<{
|
|
@@ -100,6 +139,7 @@ export declare function validateStep(key: StepKey, data: WizardData): {
|
|
|
100
139
|
errors: string[];
|
|
101
140
|
};
|
|
102
141
|
export type LoadCarrierEnum = "NONE" | "AUCTION_TROLLEY" | "DANISH_TROLLEY" | "EURO_TROLLEY" | "PALLET" | "EURO_PALLET";
|
|
142
|
+
export type LoadCarrierPayload = LoadCarrierEnum | number | string;
|
|
103
143
|
export type PhotoTypeEnum = "UNKNOWN" | "PIECE" | "TRAY" | "DETAIL" | "RULER" | "WEBSHOPFRIENDLY" | "SCENE" | "SEASON" | "STEM" | "BUNCH" | "CONTAINER" | "CLOCK";
|
|
104
144
|
export interface AddPackingConfigPayload {
|
|
105
145
|
primary: boolean;
|
|
@@ -109,8 +149,11 @@ export interface AddPackingConfigPayload {
|
|
|
109
149
|
};
|
|
110
150
|
packagesPerLayer: number;
|
|
111
151
|
layersPerLoadCarrier: number;
|
|
112
|
-
loadCarrier:
|
|
152
|
+
loadCarrier: LoadCarrierPayload;
|
|
113
153
|
isHiddenForDirectSales: boolean;
|
|
154
|
+
packagingSupplierId?: string;
|
|
155
|
+
packagingSupplierMaterialId?: string;
|
|
156
|
+
customerOrganizationIds?: string[];
|
|
114
157
|
}
|
|
115
158
|
export declare function buildPackingConfigPayload(p: PackingConfigurationInput, primary?: boolean): AddPackingConfigPayload;
|
|
116
159
|
export interface AddTradeItemPayload {
|
|
@@ -143,4 +186,5 @@ export interface AddTradeItemPayload {
|
|
|
143
186
|
}
|
|
144
187
|
export declare function buildAddTradeItemPayload(d: WizardData): AddTradeItemPayload;
|
|
145
188
|
export declare const emptyWizardData: WizardData;
|
|
189
|
+
export declare function floridayCacheToWizardData(raw: any): WizardData;
|
|
146
190
|
//# sourceMappingURL=floriday-payload.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"floriday-payload.d.ts","sourceRoot":"","sources":["../../src/lib/floriday-payload.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,WAAW,GAAG,cAAc,CAAC;AACvE,MAAM,MAAM,WAAW,GAAG,SAAS,GAAG,mBAAmB,CAAC;AAE1D,MAAM,WAAW,yBAAyB;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,
|
|
1
|
+
{"version":3,"file":"floriday-payload.d.ts","sourceRoot":"","sources":["../../src/lib/floriday-payload.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,MAAM,YAAY,GAAG,YAAY,GAAG,WAAW,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