@flowselections/floriday-voorraad 1.0.77 → 1.0.78
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/TemplatePage.d.ts +2 -0
- package/dist-lib/components/TemplatePage.d.ts.map +1 -0
- package/dist-lib/components/TemplatePage.js +4 -0
- package/dist-lib/components/settings/VoorraadSettingsCard.d.ts +2 -0
- package/dist-lib/components/settings/VoorraadSettingsCard.d.ts.map +1 -0
- package/dist-lib/components/settings/VoorraadSettingsCard.js +39 -0
- package/dist-lib/components/voorraad/AdditionalPackagingDialog.d.ts +2 -2
- package/dist-lib/components/voorraad/AdditionalPackagingDialog.d.ts.map +1 -1
- package/dist-lib/components/voorraad/AdditionalPackagingDialog.js +2 -2
- package/dist-lib/components/voorraad/ArtikelCompositionCard.d.ts +1 -1
- package/dist-lib/components/voorraad/ArtikelCompositionCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ArtikelCompositionCard.js +1 -1
- package/dist-lib/components/voorraad/ArtikelWizard.d.ts +1 -1
- package/dist-lib/components/voorraad/ArtikelWizard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ArtikelWizard.js +40 -40
- package/dist-lib/components/voorraad/CollapsibleText.d.ts +1 -1
- package/dist-lib/components/voorraad/CollapsibleText.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ConnectionBadge.d.ts +6 -0
- package/dist-lib/components/voorraad/ConnectionBadge.d.ts.map +1 -0
- package/dist-lib/components/voorraad/ConnectionBadge.js +12 -0
- package/dist-lib/components/voorraad/ConnectionPicker.d.ts +8 -0
- package/dist-lib/components/voorraad/ConnectionPicker.d.ts.map +1 -0
- package/dist-lib/components/voorraad/ConnectionPicker.js +8 -0
- package/dist-lib/components/voorraad/EditArtikelPage.d.ts +1 -1
- package/dist-lib/components/voorraad/EditArtikelPage.d.ts.map +1 -1
- package/dist-lib/components/voorraad/EditArtikelPage.js +4 -4
- package/dist-lib/components/voorraad/ExcelExportButton.d.ts +2 -2
- package/dist-lib/components/voorraad/ExcelExportButton.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ExcelExportButton.js +1 -1
- package/dist-lib/components/voorraad/FloridayInfoCard.d.ts +1 -1
- package/dist-lib/components/voorraad/FloridayInfoCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/FloridayInfoCard.js +2 -2
- package/dist-lib/components/voorraad/FloridaySentCard.d.ts +1 -1
- package/dist-lib/components/voorraad/FloridaySentCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/FloridaySentCard.js +2 -2
- package/dist-lib/components/voorraad/FloridayStatusBadge.d.ts +4 -0
- package/dist-lib/components/voorraad/FloridayStatusBadge.d.ts.map +1 -0
- package/dist-lib/components/voorraad/FloridayStatusBadge.js +8 -0
- package/dist-lib/components/voorraad/FustenPage.d.ts +1 -1
- package/dist-lib/components/voorraad/FustenPage.d.ts.map +1 -1
- package/dist-lib/components/voorraad/FustenPage.js +4 -4
- package/dist-lib/components/voorraad/InventorySettingsDrawer.d.ts +2 -2
- package/dist-lib/components/voorraad/InventorySettingsDrawer.d.ts.map +1 -1
- package/dist-lib/components/voorraad/InventorySettingsDrawer.js +3 -3
- package/dist-lib/components/voorraad/InventoryStatusBadge.d.ts +3 -3
- package/dist-lib/components/voorraad/InventoryStatusBadge.d.ts.map +1 -1
- package/dist-lib/components/voorraad/InventoryStatusBadge.js +1 -1
- package/dist-lib/components/voorraad/ModuleHealthCard.d.ts +2 -0
- package/dist-lib/components/voorraad/ModuleHealthCard.d.ts.map +1 -0
- package/dist-lib/components/voorraad/ModuleHealthCard.js +40 -0
- package/dist-lib/components/voorraad/NieuwArtikelPage.d.ts +1 -1
- package/dist-lib/components/voorraad/NieuwArtikelPage.d.ts.map +1 -1
- package/dist-lib/components/voorraad/NieuwArtikelPage.js +3 -3
- package/dist-lib/components/voorraad/OrderHistoryCard.d.ts +1 -1
- package/dist-lib/components/voorraad/OrderHistoryCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/OrderHistoryCard.js +1 -1
- package/dist-lib/components/voorraad/PriceStatusBadge.d.ts +1 -1
- package/dist-lib/components/voorraad/PriceStatusBadge.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ProductCustomFieldsCard.d.ts +1 -1
- package/dist-lib/components/voorraad/ProductCustomFieldsCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ProductCustomFieldsCard.js +2 -2
- package/dist-lib/components/voorraad/ProductLinkCard.d.ts +1 -1
- package/dist-lib/components/voorraad/ProductLinkCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ProductLinkCard.js +1 -1
- package/dist-lib/components/voorraad/ProductSalePriceField.d.ts +2 -2
- package/dist-lib/components/voorraad/ProductSalePriceField.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ProductSalePriceField.js +2 -2
- package/dist-lib/components/voorraad/ProductStructureCard.d.ts +2 -2
- package/dist-lib/components/voorraad/ProductStructureCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ProductStructureCard.js +3 -3
- package/dist-lib/components/voorraad/PublicatiesPage.d.ts +1 -1
- package/dist-lib/components/voorraad/PublicatiesPage.d.ts.map +1 -1
- package/dist-lib/components/voorraad/PublicatiesPage.js +2 -2
- package/dist-lib/components/voorraad/PublishProgressCard.d.ts +2 -2
- package/dist-lib/components/voorraad/PublishProgressCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/PublishReadinessCard.d.ts +2 -2
- package/dist-lib/components/voorraad/PublishReadinessCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/StepSamenstelling.d.ts +2 -2
- package/dist-lib/components/voorraad/StepSamenstelling.d.ts.map +1 -1
- package/dist-lib/components/voorraad/StepSamenstelling.js +1 -1
- package/dist-lib/components/voorraad/StockBulkButtons.d.ts +2 -2
- package/dist-lib/components/voorraad/StockBulkButtons.d.ts.map +1 -1
- package/dist-lib/components/voorraad/StockBulkButtons.js +5 -5
- package/dist-lib/components/voorraad/StockHistoryChart.d.ts +1 -1
- package/dist-lib/components/voorraad/StockHistoryChart.d.ts.map +1 -1
- package/dist-lib/components/voorraad/StockHistoryChart.js +1 -1
- package/dist-lib/components/voorraad/StockIntegrityAlert.d.ts +1 -1
- package/dist-lib/components/voorraad/StockIntegrityAlert.d.ts.map +1 -1
- package/dist-lib/components/voorraad/StockIntegrityAlert.js +1 -1
- package/dist-lib/components/voorraad/StockMutationHistoryCard.d.ts +1 -1
- package/dist-lib/components/voorraad/StockMutationHistoryCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/StockMutationHistoryCard.js +2 -2
- package/dist-lib/components/voorraad/StockPushMonitor.d.ts +1 -1
- package/dist-lib/components/voorraad/StockPushMonitor.d.ts.map +1 -1
- package/dist-lib/components/voorraad/StockPushMonitor.js +3 -3
- package/dist-lib/components/voorraad/StockSyncStatus.d.ts +1 -1
- package/dist-lib/components/voorraad/StockSyncStatus.d.ts.map +1 -1
- package/dist-lib/components/voorraad/StockSyncStatus.js +2 -2
- package/dist-lib/components/voorraad/SupplyReadScopeAlert.d.ts +1 -1
- package/dist-lib/components/voorraad/SupplyReadScopeAlert.d.ts.map +1 -1
- package/dist-lib/components/voorraad/SupplyReadScopeAlert.js +1 -1
- package/dist-lib/components/voorraad/TrayStickerCard.d.ts +1 -1
- package/dist-lib/components/voorraad/TrayStickerCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ValidationOverviewTable.d.ts +2 -2
- package/dist-lib/components/voorraad/ValidationOverviewTable.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ValidationOverviewTable.js +5 -5
- package/dist-lib/components/voorraad/ValidationPage.d.ts +1 -1
- package/dist-lib/components/voorraad/ValidationPage.d.ts.map +1 -1
- package/dist-lib/components/voorraad/ValidationPage.js +3 -3
- package/dist-lib/components/voorraad/VoorraadDashboard.d.ts +10 -0
- package/dist-lib/components/voorraad/VoorraadDashboard.d.ts.map +1 -0
- package/dist-lib/components/voorraad/VoorraadDashboard.js +53 -0
- package/dist-lib/components/voorraad/VoorraadPage.d.ts +1 -1
- package/dist-lib/components/voorraad/VoorraadPage.d.ts.map +1 -1
- package/dist-lib/components/voorraad/VoorraadPage.js +14 -14
- package/dist-lib/components/voorraad/VoorraadPagination.d.ts +1 -1
- package/dist-lib/components/voorraad/VoorraadPagination.d.ts.map +1 -1
- package/dist-lib/components/voorraad/VoorraadStockCard.d.ts +1 -1
- package/dist-lib/components/voorraad/VoorraadStockCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/VoorraadStockCard.js +3 -3
- package/dist-lib/components/voorraad/VoorraadTable.d.ts +3 -3
- package/dist-lib/components/voorraad/VoorraadTable.d.ts.map +1 -1
- package/dist-lib/components/voorraad/VoorraadTable.js +5 -5
- package/dist-lib/components/voorraad/VoorraadVeldenCard.d.ts +1 -1
- package/dist-lib/components/voorraad/VoorraadVeldenCard.d.ts.map +1 -1
- package/dist-lib/components/voorraad/VoorraadVeldenCard.js +2 -2
- package/dist-lib/hooks/useFloriday.d.ts +1 -1
- package/dist-lib/hooks/useFloriday.js +4 -4
- package/dist-lib/hooks/useFloridayConnection.d.ts +1 -1
- package/dist-lib/hooks/useFloridayConnection.js +1 -1
- package/dist-lib/hooks/useFloridayContinuousStock.js +1 -1
- package/dist-lib/hooks/useFloridayPriceGroups.js +1 -1
- package/dist-lib/hooks/useFloridayVbnRequired.js +1 -1
- package/dist-lib/hooks/useFlorydayCustomers.js +1 -1
- package/dist-lib/hooks/useFusten.d.ts +1 -1
- package/dist-lib/hooks/useFusten.js +2 -2
- package/dist-lib/hooks/useInventorySettings.d.ts +1 -1
- package/dist-lib/hooks/useInventorySettings.js +1 -1
- package/dist-lib/hooks/useLocalTradeItems.d.ts +2 -2
- package/dist-lib/hooks/useLocalTradeItems.js +3 -3
- package/dist-lib/hooks/usePublishJob.d.ts +1 -1
- package/dist-lib/hooks/usePublishJob.js +2 -2
- package/dist-lib/hooks/useStockPushJobs.js +1 -1
- package/dist-lib/hooks/useStockSyncHealth.js +1 -1
- package/dist-lib/hooks/useTradeItemSpec.d.ts +2 -2
- package/dist-lib/hooks/useTradeItemStock.js +3 -3
- package/dist-lib/hooks/useVbnRegulatoryFeatures.d.ts +1 -1
- package/dist-lib/hooks/useVbnRegulatoryFeatures.js +1 -1
- package/dist-lib/hooks/useVoorraadCustomFields.d.ts +1 -1
- package/dist-lib/hooks/useVoorraadCustomFields.js +1 -1
- package/dist-lib/hooks/useVoorraadData.d.ts +1 -1
- package/dist-lib/hooks/useVoorraadData.js +6 -6
- package/dist-lib/hooks-entry.d.ts +5 -5
- package/dist-lib/hooks-entry.js +5 -5
- package/dist-lib/index.d.ts +11 -11
- package/dist-lib/index.js +12 -12
- package/dist-lib/integrations/supabase/auth-attacher.js +1 -1
- package/dist-lib/integrations/supabase/auth-middleware.d.ts +1 -1
- package/dist-lib/integrations/supabase/client.d.ts +1 -1
- package/dist-lib/integrations/supabase/client.js +1 -1
- package/dist-lib/integrations/supabase/client.server.d.ts +1 -1
- package/dist-lib/integrations/supabase/client.server.js +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +346 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/__tests__/floricode-required-features.test.js +1 -1
- package/dist-lib/lib/__tests__/floriday-base-supply.test.js +1 -1
- package/dist-lib/lib/base-supply-reader.server.js +2 -2
- package/dist-lib/lib/ensure-article-codes.d.ts +1 -1
- package/dist-lib/lib/ensure-article-codes.js +1 -1
- package/dist-lib/lib/floricode-client.js +1 -1
- package/dist-lib/lib/floriday-2026v1.server.js +2 -2
- package/dist-lib/lib/floriday-client.d.ts +2 -2
- package/dist-lib/lib/floriday-client.js +2 -2
- package/dist-lib/lib/floriday-customer-offer.functions.d.ts +1 -1
- package/dist-lib/lib/floriday-customer-offer.functions.js +4 -4
- package/dist-lib/lib/floriday-env.functions.d.ts +4 -4
- package/dist-lib/lib/floriday-env.functions.js +4 -4
- package/dist-lib/lib/floriday-env.server.d.ts +2 -2
- package/dist-lib/lib/floriday-env.server.js +2 -2
- 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.functions.d.ts +10 -10
- package/dist-lib/lib/floriday-gateway.functions.js +14 -14
- package/dist-lib/lib/floriday-gateway.server.d.ts +1 -1
- package/dist-lib/lib/floriday-gateway.server.js +9 -9
- package/dist-lib/lib/floriday-import-validator.d.ts +1 -1
- package/dist-lib/lib/floriday-readiness.server.d.ts +1 -1
- package/dist-lib/lib/floriday-readiness.server.js +2 -2
- package/dist-lib/lib/floriday-relink.js +1 -1
- 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-stock-supply.server.d.ts +1 -1
- package/dist-lib/lib/floriday-stock-supply.server.js +1 -1
- package/dist-lib/lib/floriday-supply-line.js +2 -2
- package/dist-lib/lib/floriday-vbn-required.functions.d.ts +2 -2
- package/dist-lib/lib/floriday-vbn-required.functions.js +2 -2
- package/dist-lib/lib/floriday-warehouse.functions.d.ts +6 -6
- package/dist-lib/lib/floriday-warehouse.functions.js +7 -7
- package/dist-lib/lib/floriday-write-gate.server.js +1 -1
- package/dist-lib/lib/floriday-writes.functions.d.ts +2 -2
- package/dist-lib/lib/floriday-writes.functions.js +6 -6
- package/dist-lib/lib/fusten.d.ts +1 -1
- package/dist-lib/lib/fusten.js +2 -2
- package/dist-lib/lib/inventory-settings.functions.js +1 -1
- package/dist-lib/lib/logistics-buffer-events.server.js +2 -2
- package/dist-lib/lib/logistics-events.js +2 -2
- package/dist-lib/lib/logistics-tasks.server.js +5 -5
- package/dist-lib/lib/merge-products.d.ts +8 -0
- package/dist-lib/lib/merge-products.d.ts.map +1 -0
- package/dist-lib/lib/merge-products.js +17 -0
- package/dist-lib/lib/module-health.functions.d.ts +53497 -0
- package/dist-lib/lib/module-health.functions.d.ts.map +1 -0
- package/dist-lib/lib/module-health.functions.js +261 -0
- package/dist-lib/lib/module-runtime-config.functions.d.ts +1 -1
- package/dist-lib/lib/module-runtime-config.functions.js +2 -2
- package/dist-lib/lib/module-runtime.server.js +1 -1
- package/dist-lib/lib/product-packing.js +1 -1
- package/dist-lib/lib/publish-pipeline.d.ts +1 -1
- package/dist-lib/lib/publish-pipeline.js +2 -2
- package/dist-lib/lib/publish-readiness.d.ts +2 -2
- package/dist-lib/lib/trade-item-prices.d.ts +1 -1
- package/dist-lib/lib/trade-item-prices.js +2 -2
- package/dist-lib/lib/validationSchemas.d.ts +15 -0
- package/dist-lib/lib/validationSchemas.d.ts.map +1 -0
- package/dist-lib/lib/validationSchemas.js +25 -0
- package/dist-lib/lib/voorraad-custom-fields.js +1 -1
- package/dist-lib/server-hooks/floriday-base-supply.js +1 -1
- package/dist-lib/server-hooks/floriday-continuous-stock-pull.js +1 -1
- package/dist-lib/server-hooks/floriday-continuous-stock.js +1 -1
- package/dist-lib/server-hooks/floriday-stock-reconcile.js +1 -1
- package/dist-lib/server-hooks/logistics-tasks-run.js +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, it, expect } from "vitest";
|
|
2
|
-
import { computeVbnRequiredFeatures, } from "../floricode-required-features.functions";
|
|
2
|
+
import { computeVbnRequiredFeatures, } from "../floricode-required-features.functions.js";
|
|
3
3
|
const REG_100023 = [
|
|
4
4
|
{
|
|
5
5
|
record_id: "REG|100023|S01",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { describe, expect, it } from "vitest";
|
|
2
|
-
import { buildRequest, decide, isoWeekAmsterdam, priceForRow } from "../floriday-base-supply";
|
|
2
|
+
import { buildRequest, decide, isoWeekAmsterdam, priceForRow } from "../floriday-base-supply.js";
|
|
3
3
|
const row = {
|
|
4
4
|
id: "r1",
|
|
5
5
|
trade_item_id: "11111111-1111-1111-1111-111111111111",
|
|
@@ -56,7 +56,7 @@ async function callOnce(endpoint, secret, year, week) {
|
|
|
56
56
|
return { res, json };
|
|
57
57
|
}
|
|
58
58
|
export async function readBaseSupplyWeeks(weeks) {
|
|
59
|
-
const central = await import("./centralSecrets.server");
|
|
59
|
+
const central = await import("./centralSecrets.server.js");
|
|
60
60
|
const endpoint = `${(await central.getShellHost()).replace(/\/$/, "")}${PATH}`;
|
|
61
61
|
const secret = await central.getFloridayGatewaySecret();
|
|
62
62
|
const results = [];
|
|
@@ -119,7 +119,7 @@ export async function readBaseSupplyWeeks(weeks) {
|
|
|
119
119
|
}
|
|
120
120
|
/** Eén leesverzoek GET /trade-items/availabilities via floriday-get. */
|
|
121
121
|
export async function readAvailabilities() {
|
|
122
|
-
const central = await import("./centralSecrets.server");
|
|
122
|
+
const central = await import("./centralSecrets.server.js");
|
|
123
123
|
const endpoint = `${(await central.getShellHost()).replace(/\/$/, "")}${PATH}`;
|
|
124
124
|
const secret = await central.getFloridayGatewaySecret();
|
|
125
125
|
const call = async () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TradeItem } from "./floriday-client";
|
|
1
|
+
import type { TradeItem } from "./floriday-client.js";
|
|
2
2
|
/**
|
|
3
3
|
* Zorgt dat elk item in de lijst een niet-lege, unieke `articleNumber` heeft.
|
|
4
4
|
* Genereert er automatisch één als het ontbreekt, slaat die op in de juiste
|
|
@@ -93,7 +93,7 @@ export class Floriday2026v1Client {
|
|
|
93
93
|
return { ok: false, error: `429 snelheidslimiet, wacht ${gate.waitMs} ms` };
|
|
94
94
|
}
|
|
95
95
|
try {
|
|
96
|
-
const { gatewayWrite } = await import("./floriday-gateway.server");
|
|
96
|
+
const { gatewayWrite } = await import("./floriday-gateway.server.js");
|
|
97
97
|
const res = await gatewayWrite({
|
|
98
98
|
environment: this.environment,
|
|
99
99
|
module: "inventory",
|
|
@@ -116,7 +116,7 @@ export class Floriday2026v1Client {
|
|
|
116
116
|
return { ok: false, error: `429 snelheidslimiet, wacht ${gate.waitMs} ms` };
|
|
117
117
|
}
|
|
118
118
|
try {
|
|
119
|
-
const { gatewayRead } = await import("./floriday-gateway.server");
|
|
119
|
+
const { gatewayRead } = await import("./floriday-gateway.server.js");
|
|
120
120
|
const res = await gatewayRead({ environment: this.environment, path });
|
|
121
121
|
return { ok: res.ok !== false, status: res.status, data: res.data };
|
|
122
122
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PackingConfigurationInput } from "./floriday-payload";
|
|
2
|
-
import type { FloridayInfo } from "./floriday-info";
|
|
1
|
+
import type { PackingConfigurationInput } from "./floriday-payload.js";
|
|
2
|
+
import type { FloridayInfo } from "./floriday-info.js";
|
|
3
3
|
export interface PrimaryPackingSummary {
|
|
4
4
|
packagingType: string;
|
|
5
5
|
unitsPerPackage: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { supabase } from "../integrations/supabase/client";
|
|
2
|
-
import { publishTradeItem, updateTradeItemFn } from "./floriday-writes.functions";
|
|
1
|
+
import { supabase } from "../integrations/supabase/client.js";
|
|
2
|
+
import { publishTradeItem, updateTradeItemFn } from "./floriday-writes.functions.js";
|
|
3
3
|
function summarizePayload(payload) {
|
|
4
4
|
if (!payload || typeof payload !== "object")
|
|
5
5
|
return {};
|
|
@@ -28,7 +28,7 @@ export type CustomerOfferInput = z.infer<typeof CustomerOfferInputSchema>;
|
|
|
28
28
|
* Retourneert het gateway-attemptId + `customerOfferId` bij succes.
|
|
29
29
|
*/
|
|
30
30
|
export declare const publishCustomerOfferFn: import("@tanstack/start-client-core").RequiredFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, undefined, undefined, undefined, undefined>, import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
31
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
31
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
32
32
|
userId: string;
|
|
33
33
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
34
34
|
}, undefined, undefined, undefined>], (d: CustomerOfferInput) => {
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { createServerFn } from "@tanstack/react-start";
|
|
15
15
|
import { z } from "zod";
|
|
16
|
-
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware";
|
|
17
|
-
import { normalizeErrors } from "./normalize-errors-middleware";
|
|
16
|
+
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware.js";
|
|
17
|
+
import { normalizeErrors } from "./normalize-errors-middleware.js";
|
|
18
18
|
// ---------- Types ----------------------------------------------------------
|
|
19
19
|
export const CustomerOfferInputSchema = z.object({
|
|
20
20
|
/** Deterministisch UUID — als je hem meegeeft is de call idempotent. */
|
|
@@ -86,8 +86,8 @@ export const publishCustomerOfferFn = createServerFn({ method: "POST" })
|
|
|
86
86
|
.middleware([normalizeErrors, requireSupabaseAuth])
|
|
87
87
|
.inputValidator((d) => CustomerOfferInputSchema.parse(d))
|
|
88
88
|
.handler(async ({ data, context }) => safe("publishCustomerOffer", async () => {
|
|
89
|
-
const { resolveActiveFloridayConnection } = await import("./floriday-env.server");
|
|
90
|
-
const { gatewayWrite } = await import("./floriday-gateway.server");
|
|
89
|
+
const { resolveActiveFloridayConnection } = await import("./floriday-env.server.js");
|
|
90
|
+
const { gatewayWrite } = await import("./floriday-gateway.server.js");
|
|
91
91
|
const activeConnection = await resolveActiveFloridayConnection(context.supabase);
|
|
92
92
|
const environment = activeConnection.environment;
|
|
93
93
|
// Vul allowedCustomerOrganizationIds aan met alle gekoppelde
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export declare const getActiveFloridayConnectionFn: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, undefined, undefined, undefined, undefined>, import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
2
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
2
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
3
3
|
userId: string;
|
|
4
4
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
5
5
|
}, undefined, undefined, undefined>], undefined, Promise<{
|
|
6
6
|
id: string;
|
|
7
|
-
environment: import("./floriday-env").FloridayEnvironment;
|
|
7
|
+
environment: import("./floriday-env.js").FloridayEnvironment;
|
|
8
8
|
}>>;
|
|
9
9
|
export declare const getFloridayReadinessFn: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, undefined, undefined, undefined, undefined>, import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
10
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
10
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
11
11
|
userId: string;
|
|
12
12
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
13
|
-
}, undefined, undefined, undefined>], undefined, Promise<import("./floriday-readiness.server").FloridayReadinessResult>>;
|
|
13
|
+
}, undefined, undefined, undefined>], undefined, Promise<import("./floriday-readiness.server.js").FloridayReadinessResult>>;
|
|
14
14
|
//# sourceMappingURL=floriday-env.functions.d.ts.map
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { createServerFn } from "@tanstack/react-start";
|
|
2
|
-
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware";
|
|
3
|
-
import { normalizeErrors } from "./normalize-errors-middleware";
|
|
2
|
+
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware.js";
|
|
3
|
+
import { normalizeErrors } from "./normalize-errors-middleware.js";
|
|
4
4
|
export const getActiveFloridayConnectionFn = createServerFn({ method: "GET" })
|
|
5
5
|
.middleware([normalizeErrors, requireSupabaseAuth])
|
|
6
6
|
.handler(async ({ context }) => {
|
|
7
|
-
const { resolveActiveFloridayConnection } = await import("./floriday-env.server");
|
|
7
|
+
const { resolveActiveFloridayConnection } = await import("./floriday-env.server.js");
|
|
8
8
|
const active = await resolveActiveFloridayConnection(context.supabase);
|
|
9
9
|
return { id: active.id, environment: active.environment };
|
|
10
10
|
});
|
|
11
11
|
export const getFloridayReadinessFn = createServerFn({ method: "GET" })
|
|
12
12
|
.middleware([normalizeErrors, requireSupabaseAuth])
|
|
13
13
|
.handler(async ({ context }) => {
|
|
14
|
-
const { checkFloridayReadiness } = await import("./floriday-readiness.server");
|
|
14
|
+
const { checkFloridayReadiness } = await import("./floriday-readiness.server.js");
|
|
15
15
|
return checkFloridayReadiness(context.supabase);
|
|
16
16
|
});
|
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
* en wordt geblokkeerd door de client-bundler.
|
|
10
10
|
*/
|
|
11
11
|
import type { SupabaseClient } from "@supabase/supabase-js";
|
|
12
|
-
import { type FloridayEnvironment } from "./floriday-env";
|
|
13
|
-
export { FloridayEnvError, normalizeFloridayEnvironment, type FloridayEnvironment, } from "./floriday-env";
|
|
12
|
+
import { type FloridayEnvironment } from "./floriday-env.js";
|
|
13
|
+
export { FloridayEnvError, normalizeFloridayEnvironment, type FloridayEnvironment, } from "./floriday-env.js";
|
|
14
14
|
export interface ActiveFloridayConnection {
|
|
15
15
|
id: string;
|
|
16
16
|
environment: FloridayEnvironment;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FloridayEnvError, normalizeFloridayEnvironment, } from "./floriday-env";
|
|
2
|
-
export { FloridayEnvError, normalizeFloridayEnvironment, } from "./floriday-env";
|
|
1
|
+
import { FloridayEnvError, normalizeFloridayEnvironment, } from "./floriday-env.js";
|
|
2
|
+
export { FloridayEnvError, normalizeFloridayEnvironment, } from "./floriday-env.js";
|
|
3
3
|
/**
|
|
4
4
|
* Haalt de actieve connectie op via dezelfde beveiligde RPC als de client.
|
|
5
5
|
* Nooit rechtstreeks `floriday_connections` lezen met een gebruikerstoken:
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mapping van Floriday-veldnamen naar hun waarde-bron.
|
|
3
|
+
*
|
|
4
|
+
* - CODE_LIST_BY_FIELD: veld met vaste enum-waardes uit /gateway/code-list.
|
|
5
|
+
* - REF_ENTITY_BY_FIELD: veld dat verwijst naar een rij in een stamdata-cache,
|
|
6
|
+
* te lezen via /gateway/cached-list. Waarden zijn kebab-case Floriday-
|
|
7
|
+
* resources (GatewayEntity) — NIET de Supabase-tabelnaam.
|
|
8
|
+
* - REF_TABLE_BY_FIELD: identieke mapping naar de Supabase-cache-tabelnaam,
|
|
9
|
+
* uitsluitend voor directe `supabase.from(...)` reads in deze module.
|
|
10
|
+
*/
|
|
11
|
+
import { type GatewayEntity } from "./floriday-gateway-entities.js";
|
|
12
|
+
export declare const CODE_LIST_BY_FIELD: Record<string, string>;
|
|
13
|
+
export declare const REF_ENTITY_BY_FIELD: Record<string, GatewayEntity>;
|
|
14
|
+
export declare const REF_TABLE_BY_FIELD: Record<string, string>;
|
|
15
|
+
export declare function codeListFor(field: string): string | undefined;
|
|
16
|
+
export declare function refEntityFor(field: string): GatewayEntity | undefined;
|
|
17
|
+
export declare function refTableFor(field: string): string | undefined;
|
|
18
|
+
//# sourceMappingURL=floriday-field-sources.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floriday-field-sources.d.ts","sourceRoot":"","sources":["../../src/lib/floriday-field-sources.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAoB,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAEnF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAUrD,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,aAAa,CAM7D,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAMrD,CAAC;AAEF,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE7D;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAErE;AAED,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAE7D"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mapping van Floriday-veldnamen naar hun waarde-bron.
|
|
3
|
+
*
|
|
4
|
+
* - CODE_LIST_BY_FIELD: veld met vaste enum-waardes uit /gateway/code-list.
|
|
5
|
+
* - REF_ENTITY_BY_FIELD: veld dat verwijst naar een rij in een stamdata-cache,
|
|
6
|
+
* te lezen via /gateway/cached-list. Waarden zijn kebab-case Floriday-
|
|
7
|
+
* resources (GatewayEntity) — NIET de Supabase-tabelnaam.
|
|
8
|
+
* - REF_TABLE_BY_FIELD: identieke mapping naar de Supabase-cache-tabelnaam,
|
|
9
|
+
* uitsluitend voor directe `supabase.from(...)` reads in deze module.
|
|
10
|
+
*/
|
|
11
|
+
import { GATEWAY_ENTITIES } from "./floriday-gateway-entities.js";
|
|
12
|
+
export const CODE_LIST_BY_FIELD = {
|
|
13
|
+
currency: "Currency",
|
|
14
|
+
salesUnit: "SalesUnit",
|
|
15
|
+
auctionLocation: "AuctionLocation",
|
|
16
|
+
supplyType: "SupplyType",
|
|
17
|
+
loadCarrierType: "SupplyLoadCarrierType",
|
|
18
|
+
packingType: "PackingType",
|
|
19
|
+
qualityMark: "QualityMark",
|
|
20
|
+
country: "Country",
|
|
21
|
+
countryOfOrigin: "Country",
|
|
22
|
+
};
|
|
23
|
+
export const REF_ENTITY_BY_FIELD = {
|
|
24
|
+
packingId: GATEWAY_ENTITIES.packings,
|
|
25
|
+
warehouseId: GATEWAY_ENTITIES.warehouses,
|
|
26
|
+
deliveryLocationId: GATEWAY_ENTITIES.deliveryLocations,
|
|
27
|
+
priceGroupId: GATEWAY_ENTITIES.priceGroups,
|
|
28
|
+
collectionId: GATEWAY_ENTITIES.collections,
|
|
29
|
+
};
|
|
30
|
+
export const REF_TABLE_BY_FIELD = {
|
|
31
|
+
packingId: "floriday_packings_cache",
|
|
32
|
+
warehouseId: "floriday_warehouses_cache",
|
|
33
|
+
deliveryLocationId: "floriday_delivery_locations_cache",
|
|
34
|
+
priceGroupId: "floriday_price_groups_cache",
|
|
35
|
+
collectionId: "floriday_collections_cache",
|
|
36
|
+
};
|
|
37
|
+
export function codeListFor(field) {
|
|
38
|
+
return CODE_LIST_BY_FIELD[field];
|
|
39
|
+
}
|
|
40
|
+
export function refEntityFor(field) {
|
|
41
|
+
return REF_ENTITY_BY_FIELD[field];
|
|
42
|
+
}
|
|
43
|
+
export function refTableFor(field) {
|
|
44
|
+
return REF_TABLE_BY_FIELD[field];
|
|
45
|
+
}
|
|
@@ -5,7 +5,7 @@ type SchemaArgs = {
|
|
|
5
5
|
type CodeListArgs = {
|
|
6
6
|
listName: string;
|
|
7
7
|
};
|
|
8
|
-
import type { GatewayEntity } from "./floriday-gateway-entities";
|
|
8
|
+
import type { GatewayEntity } from "./floriday-gateway-entities.js";
|
|
9
9
|
type CachedListArgs = {
|
|
10
10
|
entity: GatewayEntity;
|
|
11
11
|
limit?: number;
|
|
@@ -24,22 +24,22 @@ type WriteArgs = {
|
|
|
24
24
|
}[];
|
|
25
25
|
};
|
|
26
26
|
export declare const gatewaySchemaFn: import("@tanstack/start-client-core").RequiredFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, undefined, undefined, undefined, undefined>, import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
27
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
27
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
28
28
|
userId: string;
|
|
29
29
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
30
30
|
}, undefined, undefined, undefined>], (d: SchemaArgs) => SchemaArgs, Promise<Record<string, any>>>;
|
|
31
31
|
export declare const gatewayCodeListFn: import("@tanstack/start-client-core").RequiredFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, undefined, undefined, undefined, undefined>, import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
32
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
32
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
33
33
|
userId: string;
|
|
34
34
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
35
35
|
}, undefined, undefined, undefined>], (d: CodeListArgs) => CodeListArgs, Promise<Record<string, any>>>;
|
|
36
36
|
export declare const gatewayCachedListFn: import("@tanstack/start-client-core").RequiredFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, undefined, undefined, undefined, undefined>, import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
37
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
37
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
38
38
|
userId: string;
|
|
39
39
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
40
40
|
}, undefined, undefined, undefined>], (d: CachedListArgs) => CachedListArgs, Promise<Record<string, any>>>;
|
|
41
41
|
export declare const gatewayWriteFn: import("@tanstack/start-client-core").RequiredFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, undefined, undefined, undefined, undefined>, import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
42
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
42
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
43
43
|
userId: string;
|
|
44
44
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
45
45
|
}, undefined, undefined, undefined>], (d: WriteArgs) => WriteArgs, Promise<Record<string, any>>>;
|
|
@@ -47,7 +47,7 @@ type ReadArgs = {
|
|
|
47
47
|
path: string;
|
|
48
48
|
};
|
|
49
49
|
export declare const gatewayReadFn: import("@tanstack/start-client-core").RequiredFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, undefined, undefined, undefined, undefined>, import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
50
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
50
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
51
51
|
userId: string;
|
|
52
52
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
53
53
|
}, undefined, undefined, undefined>], (d: ReadArgs) => ReadArgs, Promise<Record<string, any>>>;
|
|
@@ -65,7 +65,7 @@ type SupplyLineArgs = {
|
|
|
65
65
|
customerOrganizationIds?: string[];
|
|
66
66
|
};
|
|
67
67
|
export declare const gatewaySupplyLineFn: import("@tanstack/start-client-core").RequiredFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, undefined, undefined, undefined, undefined>, import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
68
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
68
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
69
69
|
userId: string;
|
|
70
70
|
claims: import("@supabase/auth-js").JwtPayload;
|
|
71
71
|
}, undefined, undefined, undefined>], (d: SupplyLineArgs) => SupplyLineArgs, Promise<{
|
|
@@ -74,7 +74,7 @@ export declare const gatewaySupplyLineFn: import("@tanstack/start-client-core").
|
|
|
74
74
|
endpointFamily: string;
|
|
75
75
|
year: number;
|
|
76
76
|
week: number;
|
|
77
|
-
environment: import("./floriday-env").FloridayEnvironment;
|
|
77
|
+
environment: import("./floriday-env.js").FloridayEnvironment;
|
|
78
78
|
status: number;
|
|
79
79
|
steps: {
|
|
80
80
|
name: string;
|
|
@@ -86,7 +86,7 @@ export declare const gatewaySupplyLineFn: import("@tanstack/start-client-core").
|
|
|
86
86
|
endpointFamily: string;
|
|
87
87
|
year: number;
|
|
88
88
|
week: number;
|
|
89
|
-
environment: import("./floriday-env").FloridayEnvironment;
|
|
89
|
+
environment: import("./floriday-env.js").FloridayEnvironment;
|
|
90
90
|
status: number;
|
|
91
91
|
steps: ({
|
|
92
92
|
name: string;
|
|
@@ -103,7 +103,7 @@ export declare const gatewaySupplyLineFn: import("@tanstack/start-client-core").
|
|
|
103
103
|
endpointFamily: string;
|
|
104
104
|
year: number;
|
|
105
105
|
week: number;
|
|
106
|
-
environment: import("./floriday-env").FloridayEnvironment;
|
|
106
|
+
environment: import("./floriday-env.js").FloridayEnvironment;
|
|
107
107
|
status: number;
|
|
108
108
|
steps: {
|
|
109
109
|
name: string;
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* deze fns aan — nooit de `.server.ts` rechtstreeks.
|
|
4
4
|
*/
|
|
5
5
|
import { createServerFn } from "@tanstack/react-start";
|
|
6
|
-
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware";
|
|
7
|
-
import { normalizeErrors } from "./normalize-errors-middleware";
|
|
6
|
+
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware.js";
|
|
7
|
+
import { normalizeErrors } from "./normalize-errors-middleware.js";
|
|
8
8
|
/**
|
|
9
9
|
* Normaliseer alles wat een handler kan throwen naar een plain Error met
|
|
10
10
|
* leesbare message. Zonder dit relayeert TanStack een raw Response → de
|
|
@@ -30,8 +30,8 @@ export const gatewaySchemaFn = createServerFn({ method: "POST" })
|
|
|
30
30
|
.middleware([normalizeErrors, requireSupabaseAuth])
|
|
31
31
|
.inputValidator((d) => d)
|
|
32
32
|
.handler(async ({ data, context }) => safe("gateway.schema", async () => {
|
|
33
|
-
const { resolveFloridayEnvironment } = await import("./floriday-env.server");
|
|
34
|
-
const { gatewaySchema } = await import("./floriday-gateway.server");
|
|
33
|
+
const { resolveFloridayEnvironment } = await import("./floriday-env.server.js");
|
|
34
|
+
const { gatewaySchema } = await import("./floriday-gateway.server.js");
|
|
35
35
|
// De browser mag nooit de doelomgeving kiezen. Alle gateway-aanroepen
|
|
36
36
|
// volgen uitsluitend de actieve server-side koppeling.
|
|
37
37
|
const environment = await resolveFloridayEnvironment(context.supabase);
|
|
@@ -41,8 +41,8 @@ export const gatewayCodeListFn = createServerFn({ method: "POST" })
|
|
|
41
41
|
.middleware([normalizeErrors, requireSupabaseAuth])
|
|
42
42
|
.inputValidator((d) => d)
|
|
43
43
|
.handler(async ({ data, context }) => safe("gateway.codeList", async () => {
|
|
44
|
-
const { resolveFloridayEnvironment } = await import("./floriday-env.server");
|
|
45
|
-
const { gatewayCodeList } = await import("./floriday-gateway.server");
|
|
44
|
+
const { resolveFloridayEnvironment } = await import("./floriday-env.server.js");
|
|
45
|
+
const { gatewayCodeList } = await import("./floriday-gateway.server.js");
|
|
46
46
|
const environment = await resolveFloridayEnvironment(context.supabase);
|
|
47
47
|
return (await gatewayCodeList({ ...data, environment }));
|
|
48
48
|
}));
|
|
@@ -50,8 +50,8 @@ export const gatewayCachedListFn = createServerFn({ method: "POST" })
|
|
|
50
50
|
.middleware([normalizeErrors, requireSupabaseAuth])
|
|
51
51
|
.inputValidator((d) => d)
|
|
52
52
|
.handler(async ({ data, context }) => safe("gateway.cachedList", async () => {
|
|
53
|
-
const { resolveFloridayEnvironment } = await import("./floriday-env.server");
|
|
54
|
-
const { gatewayCachedList } = await import("./floriday-gateway.server");
|
|
53
|
+
const { resolveFloridayEnvironment } = await import("./floriday-env.server.js");
|
|
54
|
+
const { gatewayCachedList } = await import("./floriday-gateway.server.js");
|
|
55
55
|
const environment = await resolveFloridayEnvironment(context.supabase);
|
|
56
56
|
return (await gatewayCachedList({ ...data, environment }));
|
|
57
57
|
}));
|
|
@@ -59,8 +59,8 @@ export const gatewayWriteFn = createServerFn({ method: "POST" })
|
|
|
59
59
|
.middleware([normalizeErrors, requireSupabaseAuth])
|
|
60
60
|
.inputValidator((d) => d)
|
|
61
61
|
.handler(async ({ data, context }) => safe("gateway.write", async () => {
|
|
62
|
-
const { resolveFloridayEnvironment } = await import("./floriday-env.server");
|
|
63
|
-
const { gatewayWrite } = await import("./floriday-gateway.server");
|
|
62
|
+
const { resolveFloridayEnvironment } = await import("./floriday-env.server.js");
|
|
63
|
+
const { gatewayWrite } = await import("./floriday-gateway.server.js");
|
|
64
64
|
const environment = await resolveFloridayEnvironment(context.supabase);
|
|
65
65
|
return (await gatewayWrite({ ...data, environment }));
|
|
66
66
|
}));
|
|
@@ -68,8 +68,8 @@ export const gatewayReadFn = createServerFn({ method: "POST" })
|
|
|
68
68
|
.middleware([normalizeErrors, requireSupabaseAuth])
|
|
69
69
|
.inputValidator((d) => d)
|
|
70
70
|
.handler(async ({ data, context }) => safe("gateway.read", async () => {
|
|
71
|
-
const { resolveFloridayEnvironment } = await import("./floriday-env.server");
|
|
72
|
-
const { gatewayRead } = await import("./floriday-gateway.server");
|
|
71
|
+
const { resolveFloridayEnvironment } = await import("./floriday-env.server.js");
|
|
72
|
+
const { gatewayRead } = await import("./floriday-gateway.server.js");
|
|
73
73
|
const environment = await resolveFloridayEnvironment(context.supabase);
|
|
74
74
|
return (await gatewayRead({ path: data.path, environment }));
|
|
75
75
|
}));
|
|
@@ -91,8 +91,8 @@ export const gatewaySupplyLineFn = createServerFn({ method: "POST" })
|
|
|
91
91
|
.middleware([normalizeErrors, requireSupabaseAuth])
|
|
92
92
|
.inputValidator((d) => d)
|
|
93
93
|
.handler(async ({ data, context }) => safe("gateway.supplyLine", async () => {
|
|
94
|
-
const { resolveFloridayEnvironment } = await import("./floriday-env.server");
|
|
95
|
-
const { gatewayWrite } = await import("./floriday-gateway.server");
|
|
94
|
+
const { resolveFloridayEnvironment } = await import("./floriday-env.server.js");
|
|
95
|
+
const { gatewayWrite } = await import("./floriday-gateway.server.js");
|
|
96
96
|
const environment = await resolveFloridayEnvironment(context.supabase);
|
|
97
97
|
const { year, week } = isoWeekParts(data.periodStart);
|
|
98
98
|
const quantity = Math.max(0, Number(data.availableQuantity) || 0);
|
|
@@ -61,7 +61,7 @@ export interface GatewayCodeListInput {
|
|
|
61
61
|
listName: string;
|
|
62
62
|
}
|
|
63
63
|
export declare function gatewayCodeList<T = unknown>(input: GatewayCodeListInput): Promise<T>;
|
|
64
|
-
import { type GatewayEntity } from "./floriday-gateway-entities";
|
|
64
|
+
import { type GatewayEntity } from "./floriday-gateway-entities.js";
|
|
65
65
|
export interface GatewayCachedListInput {
|
|
66
66
|
environment: "staging" | "live";
|
|
67
67
|
/**
|
|
@@ -33,7 +33,7 @@ async function resolveGatewayUrl() {
|
|
|
33
33
|
if (explicit)
|
|
34
34
|
return explicit.replace(/\/$/, "");
|
|
35
35
|
try {
|
|
36
|
-
const { getShellHost } = await import("./centralSecrets.server");
|
|
36
|
+
const { getShellHost } = await import("./centralSecrets.server.js");
|
|
37
37
|
const host = await getShellHost();
|
|
38
38
|
return host.replace(/\/$/, "");
|
|
39
39
|
}
|
|
@@ -48,7 +48,7 @@ async function resolveGatewaySecret() {
|
|
|
48
48
|
const explicit = process.env.FLORIDAY_GATEWAY_SECRET;
|
|
49
49
|
if (explicit)
|
|
50
50
|
return explicit;
|
|
51
|
-
const { getFloridayGatewaySecret } = await import("./centralSecrets.server");
|
|
51
|
+
const { getFloridayGatewaySecret } = await import("./centralSecrets.server.js");
|
|
52
52
|
return getFloridayGatewaySecret();
|
|
53
53
|
}
|
|
54
54
|
async function getConfig() {
|
|
@@ -75,7 +75,7 @@ export async function describeGatewayResolution() {
|
|
|
75
75
|
let error = null;
|
|
76
76
|
if (centralConfigured) {
|
|
77
77
|
try {
|
|
78
|
-
const { getShellHost, getFloridayGatewaySecret } = await import("./centralSecrets.server");
|
|
78
|
+
const { getShellHost, getFloridayGatewaySecret } = await import("./centralSecrets.server.js");
|
|
79
79
|
centralAddress = (await getShellHost()).replace(/\/$/, "");
|
|
80
80
|
centralSecretOk = Boolean(await getFloridayGatewaySecret());
|
|
81
81
|
}
|
|
@@ -141,7 +141,7 @@ async function gatewayPost(path, body) {
|
|
|
141
141
|
if (body && typeof body === "object") {
|
|
142
142
|
const env = body.environment;
|
|
143
143
|
if (env !== undefined && env !== "staging" && env !== "live") {
|
|
144
|
-
const { FloridayEnvError } = await import("./floriday-env");
|
|
144
|
+
const { FloridayEnvError } = await import("./floriday-env.js");
|
|
145
145
|
throw new FloridayEnvError("INVALID_FLORIDAY_ENVIRONMENT", `Body.environment moet "staging" of "live" zijn (kreeg: ${JSON.stringify(env)}).`);
|
|
146
146
|
}
|
|
147
147
|
}
|
|
@@ -200,7 +200,7 @@ export function gatewayCodeList(input) {
|
|
|
200
200
|
return gatewayPost("/api/public/gateway/code-list", input);
|
|
201
201
|
}
|
|
202
202
|
// ---------- Cached list (stamdata uit gedeelde Supabase cache) -------------
|
|
203
|
-
import { isGatewayEntity } from "./floriday-gateway-entities";
|
|
203
|
+
import { isGatewayEntity } from "./floriday-gateway-entities.js";
|
|
204
204
|
export function gatewayCachedList(input) {
|
|
205
205
|
if (!isGatewayEntity(input.entity)) {
|
|
206
206
|
throw new Error(`gateway.cachedList: ongeldige entity ${JSON.stringify(input.entity)} — gebruik een kebab-case Floriday-resource uit GATEWAY_ENTITIES.`);
|
|
@@ -215,7 +215,7 @@ export function gatewayCachedList(input) {
|
|
|
215
215
|
* poort (koppelprompt 4 + 5): zonder toestemming gaat er niets weg.
|
|
216
216
|
*/
|
|
217
217
|
export async function gatewayWrite(input) {
|
|
218
|
-
const { ensureFloridayWriteAllowed, logFloridaySend } = await import("./floriday-write-gate.server");
|
|
218
|
+
const { ensureFloridayWriteAllowed, logFloridaySend } = await import("./floriday-write-gate.server.js");
|
|
219
219
|
const gateAction = await ensureFloridayWriteAllowed({
|
|
220
220
|
action: input.action,
|
|
221
221
|
path: input.path,
|
|
@@ -249,7 +249,7 @@ export async function gatewayWrite(input) {
|
|
|
249
249
|
}
|
|
250
250
|
}
|
|
251
251
|
export async function gatewaySupplyLine(input) {
|
|
252
|
-
const { ensureFloridayWriteAllowed } = await import("./floriday-write-gate.server");
|
|
252
|
+
const { ensureFloridayWriteAllowed } = await import("./floriday-write-gate.server.js");
|
|
253
253
|
await ensureFloridayWriteAllowed({
|
|
254
254
|
action: "publish-supply-line",
|
|
255
255
|
path: "/supply-lines",
|
|
@@ -272,7 +272,7 @@ function toHex(buf) {
|
|
|
272
272
|
export async function gatewayMediaUpload(input) {
|
|
273
273
|
const { url, secret } = await getConfig();
|
|
274
274
|
const timestamp = Date.now().toString();
|
|
275
|
-
const { ensureFloridayWriteAllowed } = await import("./floriday-write-gate.server");
|
|
275
|
+
const { ensureFloridayWriteAllowed } = await import("./floriday-write-gate.server.js");
|
|
276
276
|
await ensureFloridayWriteAllowed({
|
|
277
277
|
action: "upload-trade-item-media",
|
|
278
278
|
path: input.path,
|
|
@@ -365,7 +365,7 @@ export async function reportGatewayFailure(report) {
|
|
|
365
365
|
* niet-JSON-antwoord (route niet bereikbaar).
|
|
366
366
|
*/
|
|
367
367
|
export async function gatewaySupplyLineWeek(input) {
|
|
368
|
-
const { ensureFloridayWriteAllowed } = await import("./floriday-write-gate.server");
|
|
368
|
+
const { ensureFloridayWriteAllowed } = await import("./floriday-write-gate.server.js");
|
|
369
369
|
await ensureFloridayWriteAllowed({
|
|
370
370
|
action: "publish-supply-line",
|
|
371
371
|
path: "/supply-lines",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* kunnen uitbreiden zodra Floriday nieuwe eisen stelt zonder de import-logica
|
|
6
6
|
* te raken.
|
|
7
7
|
*/
|
|
8
|
-
import type { WizardData } from "./floriday-payload";
|
|
8
|
+
import type { WizardData } from "./floriday-payload.js";
|
|
9
9
|
export type DraftLinkStatus = "unlinked" | "linked" | "waiting_for_data" | "ready_to_publish" | "publish_failed" | "ambiguous_match" | "published";
|
|
10
10
|
export interface RequiredFieldSpec {
|
|
11
11
|
key: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SupabaseClient } from "@supabase/supabase-js";
|
|
2
|
-
import type { FloridayEnvironment } from "./floriday-env";
|
|
2
|
+
import type { FloridayEnvironment } from "./floriday-env.js";
|
|
3
3
|
export interface FloridayReadinessResult {
|
|
4
4
|
ready: boolean;
|
|
5
5
|
connectionId: string | null;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { resolveActiveFloridayConnection } from "./floriday-env.server";
|
|
2
|
-
import { gatewaySchema } from "./floriday-gateway.server";
|
|
1
|
+
import { resolveActiveFloridayConnection } from "./floriday-env.server.js";
|
|
2
|
+
import { gatewaySchema } from "./floriday-gateway.server.js";
|
|
3
3
|
function environmentLabel(environment) {
|
|
4
4
|
return environment === "live" ? "liveomgeving" : "testomgeving";
|
|
5
5
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { supabase } from "../integrations/supabase/client";
|
|
1
|
+
import { supabase } from "../integrations/supabase/client.js";
|
|
2
2
|
/**
|
|
3
3
|
* Herstelt de koppeling tussen lokale producten en Floriday-artikelen.
|
|
4
4
|
* Draait ook automatisch (bij binnenkomende Floriday-artikelen en elk uur),
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bouwt een Zod-schema op basis van de fields[]-projectie van /gateway/schema.
|
|
3
|
+
* Wordt gebruikt voor snelle client-side UX-feedback. De gateway valideert
|
|
4
|
+
* altijd nogmaals server-side (validateEnums + Floriday zelf).
|
|
5
|
+
*/
|
|
6
|
+
import { z, type ZodTypeAny } from "zod";
|
|
7
|
+
import type { FloridaySchemaField } from "../hooks/useFloriday.js";
|
|
8
|
+
export declare function buildZodFromFields(fields: FloridaySchemaField[]): z.ZodObject<Record<string, ZodTypeAny>>;
|
|
9
|
+
//# sourceMappingURL=floriday-schema-to-zod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"floriday-schema-to-zod.d.ts","sourceRoot":"","sources":["../../src/lib/floriday-schema-to-zod.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,EAAE,CAAC,EAAE,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAmChE,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,mBAAmB,EAAE,GAC5B,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAIzC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bouwt een Zod-schema op basis van de fields[]-projectie van /gateway/schema.
|
|
3
|
+
* Wordt gebruikt voor snelle client-side UX-feedback. De gateway valideert
|
|
4
|
+
* altijd nogmaals server-side (validateEnums + Floriday zelf).
|
|
5
|
+
*/
|
|
6
|
+
import { z } from "zod";
|
|
7
|
+
function fieldToZod(f) {
|
|
8
|
+
let schema;
|
|
9
|
+
if (f.enum && f.enum.length > 0) {
|
|
10
|
+
schema = z.enum(f.enum);
|
|
11
|
+
}
|
|
12
|
+
else if (f.type === "number" || f.type === "integer") {
|
|
13
|
+
let n = z.number();
|
|
14
|
+
if (typeof f.minimum === "number")
|
|
15
|
+
n = n.min(f.minimum);
|
|
16
|
+
if (typeof f.maximum === "number")
|
|
17
|
+
n = n.max(f.maximum);
|
|
18
|
+
if (f.type === "integer")
|
|
19
|
+
n = n.int();
|
|
20
|
+
schema = n;
|
|
21
|
+
}
|
|
22
|
+
else if (f.type === "boolean") {
|
|
23
|
+
schema = z.boolean();
|
|
24
|
+
}
|
|
25
|
+
else if (f.type === "array") {
|
|
26
|
+
schema = z.array(z.any());
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
let s = z.string();
|
|
30
|
+
if (typeof f.minLength === "number")
|
|
31
|
+
s = s.min(f.minLength);
|
|
32
|
+
if (typeof f.maxLength === "number")
|
|
33
|
+
s = s.max(f.maxLength);
|
|
34
|
+
if (f.pattern) {
|
|
35
|
+
try {
|
|
36
|
+
s = s.regex(new RegExp(f.pattern));
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
// ongeldige pattern uit schema → negeren
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
schema = s;
|
|
43
|
+
}
|
|
44
|
+
if (!f.required)
|
|
45
|
+
schema = schema.optional().nullable();
|
|
46
|
+
return schema;
|
|
47
|
+
}
|
|
48
|
+
export function buildZodFromFields(fields) {
|
|
49
|
+
const shape = {};
|
|
50
|
+
for (const f of fields)
|
|
51
|
+
shape[f.name] = fieldToZod(f);
|
|
52
|
+
return z.object(shape);
|
|
53
|
+
}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* aangeroepen door de verwerker (dit project als terugvalweg, en de
|
|
12
12
|
* Floriday-Authenticatie-module als vaste verwerker).
|
|
13
13
|
*/
|
|
14
|
-
import { type ErrorClass } from "./floriday-2026v1.server";
|
|
14
|
+
import { type ErrorClass } from "./floriday-2026v1.server.js";
|
|
15
15
|
export type StockQueueRow = {
|
|
16
16
|
id: string;
|
|
17
17
|
connection_id: string;
|