@flowselections/floriday-authenticatie-module 1.0.28 → 1.0.29
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/lib/cron/index.d.ts +35 -0
- package/dist-lib/lib/cron/index.d.ts.map +1 -0
- package/dist-lib/lib/cron/index.js +49 -0
- package/dist-lib/lib/cron/refresh-floricode-codelists.d.ts +3 -0
- package/dist-lib/lib/cron/refresh-floricode-codelists.d.ts.map +1 -0
- package/dist-lib/lib/cron/refresh-floricode-codelists.js +26 -0
- package/dist-lib/lib/cron/refresh-floriday-reference-data.d.ts +3 -0
- package/dist-lib/lib/cron/refresh-floriday-reference-data.d.ts.map +1 -0
- package/dist-lib/lib/cron/refresh-floriday-reference-data.js +40 -0
- package/dist-lib/lib/cron/refresh-floriday-tokens.d.ts +3 -0
- package/dist-lib/lib/cron/refresh-floriday-tokens.d.ts.map +1 -0
- package/dist-lib/lib/cron/refresh-floriday-tokens.js +151 -0
- package/dist-lib/lib/cron/sync-connections.d.ts +3 -0
- package/dist-lib/lib/cron/sync-connections.d.ts.map +1 -0
- package/dist-lib/lib/cron/sync-connections.js +49 -0
- package/dist-lib/lib/cron/sync-floricode-all.d.ts +3 -0
- package/dist-lib/lib/cron/sync-floricode-all.d.ts.map +1 -0
- package/dist-lib/lib/cron/sync-floricode-all.js +23 -0
- package/dist-lib/lib/cron/sync-floricode-regulatory-features.d.ts +3 -0
- package/dist-lib/lib/cron/sync-floricode-regulatory-features.d.ts.map +1 -0
- package/dist-lib/lib/cron/sync-floricode-regulatory-features.js +31 -0
- package/dist-lib/lib/cron/sync-resource-compact.d.ts +4 -0
- package/dist-lib/lib/cron/sync-resource-compact.d.ts.map +1 -0
- package/dist-lib/lib/cron/sync-resource-compact.js +31 -0
- package/dist-lib/lib/cron/sync-resource.d.ts +6 -0
- package/dist-lib/lib/cron/sync-resource.d.ts.map +1 -0
- package/dist-lib/lib/cron/sync-resource.js +61 -0
- package/dist-lib/lib/cron/verify-floricode-characteristics-coverage.d.ts +3 -0
- package/dist-lib/lib/cron/verify-floricode-characteristics-coverage.d.ts.map +1 -0
- package/dist-lib/lib/cron/verify-floricode-characteristics-coverage.js +55 -0
- package/package.json +475 -100
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { SupabaseClient } from "@supabase/supabase-js";
|
|
2
|
+
export { handleSyncResource } from "./sync-resource";
|
|
3
|
+
export { handleSyncResourceCompact } from "./sync-resource-compact";
|
|
4
|
+
export { handleSyncConnections } from "./sync-connections";
|
|
5
|
+
export declare const handleSyncAdditionalServices: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
6
|
+
export declare const handleSyncBaseItems: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
7
|
+
export declare const handleSyncCollections: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
8
|
+
export declare const handleSyncCommercialServiceTypes: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
9
|
+
export declare const handleSyncContractTradeItemGroups: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
10
|
+
export declare const handleSyncDeliveryConditionSets: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
11
|
+
export declare const handleSyncPriceGroups: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
12
|
+
export declare const handleSyncSalesStrategies: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
13
|
+
export declare const handleSyncBlanketOrders: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
14
|
+
export declare const handleSyncCarriers: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
15
|
+
export declare const handleSyncContracts: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
16
|
+
export declare const handleSyncCustomerOrganizations: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
17
|
+
export declare const handleSyncCustomerStickers: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
18
|
+
export declare const handleSyncFulfillmentOrders: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
19
|
+
export declare const handleSyncSalesorders: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
20
|
+
export declare const handleSyncTradeItems: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
21
|
+
export declare const handleSyncClockPresales: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
22
|
+
export declare const handleSyncClockSupplies: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
23
|
+
export declare const handleSyncDeliveryLocations: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
24
|
+
export declare const handleSyncDeliveryOrders: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
25
|
+
export declare const handleSyncPackings: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
26
|
+
export declare const handleSyncTradeSettingsCustomers: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
27
|
+
export declare const handleSyncWarehouses: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
28
|
+
export declare const handleSyncFloridayConnections: (req: Request, sb: SupabaseClient) => Promise<Response>;
|
|
29
|
+
export { handleSyncFloricodeAll } from "./sync-floricode-all";
|
|
30
|
+
export { handleSyncFloricodeRegulatoryFeatures } from "./sync-floricode-regulatory-features";
|
|
31
|
+
export { handleRefreshFloricodeCodelists } from "./refresh-floricode-codelists";
|
|
32
|
+
export { handleRefreshFlorydayReferenceData } from "./refresh-floriday-reference-data";
|
|
33
|
+
export { handleRefreshFlorydayTokens } from "./refresh-floriday-tokens";
|
|
34
|
+
export { handleVerifyFloricodeCharacteristicsCoverage } from "./verify-floricode-characteristics-coverage";
|
|
35
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/cron/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAK5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAI3D,eAAO,MAAM,4BAA4B,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBACzB,CAAC;AACrD,eAAO,MAAM,mBAAmB,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBACzB,CAAC;AAC5C,eAAO,MAAM,qBAAqB,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBAC1B,CAAC;AAC7C,eAAO,MAAM,gCAAgC,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBACxB,CAAC;AAC1D,eAAO,MAAM,iCAAiC,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBACvB,CAAC;AAC5D,eAAO,MAAM,+BAA+B,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBACxB,CAAC;AACzD,eAAO,MAAM,qBAAqB,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBACzB,CAAC;AAC9C,eAAO,MAAM,yBAAyB,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBACzB,CAAC;AAGlD,eAAO,MAAM,uBAAuB,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBACF,CAAC;AACvE,eAAO,MAAM,kBAAkB,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBACH,CAAC;AACjE,eAAO,MAAM,mBAAmB,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBACH,CAAC;AAClE,eAAO,MAAM,+BAA+B,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBACF,CAAC;AAC/E,eAAO,MAAM,0BAA0B,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBACF,CAAC;AAC1E,eAAO,MAAM,2BAA2B,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBACF,CAAC;AAC3E,eAAO,MAAM,qBAAqB,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBACF,CAAC;AACrE,eAAO,MAAM,oBAAoB,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBACF,CAAC;AAGpE,eAAO,MAAM,uBAAuB,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBAClB,CAAC;AACvD,eAAO,MAAM,uBAAuB,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBAClB,CAAC;AACvD,eAAO,MAAM,2BAA2B,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBAClB,CAAC;AAC3D,eAAO,MAAM,wBAAwB,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBAClB,CAAC;AACxD,eAAO,MAAM,kBAAkB,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBACnB,CAAC;AACjD,eAAO,MAAM,gCAAgC,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBACjB,CAAC;AACjE,eAAO,MAAM,oBAAoB,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBACnB,CAAC;AAGnD,eAAO,MAAM,6BAA6B,GAAI,KAAK,OAAO,EAAE,IAAI,cAAc,sBAC9C,CAAC;AAGjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,qCAAqC,EAAE,MAAM,sCAAsC,CAAC;AAC7F,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,kCAAkC,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AACxE,OAAO,EAAE,4CAA4C,EAAE,MAAM,6CAA6C,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Barrel voor `@flowselections/floriday-authenticatie-module/cron`.
|
|
3
|
+
// Per resource één dunne named export met vaste signatuur
|
|
4
|
+
// `(request, supabase) => Promise<Response>` — bytes van de bron-envelope
|
|
5
|
+
// worden bewaakt door de runner (zie sync-resource.ts, sync-resource-compact.ts,
|
|
6
|
+
// sync-connections.ts).
|
|
7
|
+
// ============================================================================
|
|
8
|
+
import { handleSyncResource } from "./sync-resource";
|
|
9
|
+
import { handleSyncResourceCompact } from "./sync-resource-compact";
|
|
10
|
+
import { handleSyncConnections } from "./sync-connections";
|
|
11
|
+
export { handleSyncResource } from "./sync-resource";
|
|
12
|
+
export { handleSyncResourceCompact } from "./sync-resource-compact";
|
|
13
|
+
export { handleSyncConnections } from "./sync-connections";
|
|
14
|
+
// -- Standaard-vorm (16) --------------------------------------------------
|
|
15
|
+
// Sub-groep zonder per-iteratie progress-log (8):
|
|
16
|
+
export const handleSyncAdditionalServices = (req, sb) => handleSyncResource(req, sb, "additional-services");
|
|
17
|
+
export const handleSyncBaseItems = (req, sb) => handleSyncResource(req, sb, "base-items");
|
|
18
|
+
export const handleSyncCollections = (req, sb) => handleSyncResource(req, sb, "collections");
|
|
19
|
+
export const handleSyncCommercialServiceTypes = (req, sb) => handleSyncResource(req, sb, "commercial-service-types");
|
|
20
|
+
export const handleSyncContractTradeItemGroups = (req, sb) => handleSyncResource(req, sb, "contract-trade-item-groups");
|
|
21
|
+
export const handleSyncDeliveryConditionSets = (req, sb) => handleSyncResource(req, sb, "delivery-condition-sets");
|
|
22
|
+
export const handleSyncPriceGroups = (req, sb) => handleSyncResource(req, sb, "price-groups");
|
|
23
|
+
export const handleSyncSalesStrategies = (req, sb) => handleSyncResource(req, sb, "sales-strategies");
|
|
24
|
+
// Sub-groep met per-iteratie progress-log (8):
|
|
25
|
+
export const handleSyncBlanketOrders = (req, sb) => handleSyncResource(req, sb, "blanket-orders", { logProgress: true });
|
|
26
|
+
export const handleSyncCarriers = (req, sb) => handleSyncResource(req, sb, "carriers", { logProgress: true });
|
|
27
|
+
export const handleSyncContracts = (req, sb) => handleSyncResource(req, sb, "contracts", { logProgress: true });
|
|
28
|
+
export const handleSyncCustomerOrganizations = (req, sb) => handleSyncResource(req, sb, "customer-organizations", { logProgress: true });
|
|
29
|
+
export const handleSyncCustomerStickers = (req, sb) => handleSyncResource(req, sb, "customer-stickers", { logProgress: true });
|
|
30
|
+
export const handleSyncFulfillmentOrders = (req, sb) => handleSyncResource(req, sb, "fulfillment-orders", { logProgress: true });
|
|
31
|
+
export const handleSyncSalesorders = (req, sb) => handleSyncResource(req, sb, "sales-orders", { logProgress: true });
|
|
32
|
+
export const handleSyncTradeItems = (req, sb) => handleSyncResource(req, sb, "trade-items", { logProgress: true });
|
|
33
|
+
// -- Compact-vorm (7) -----------------------------------------------------
|
|
34
|
+
export const handleSyncClockPresales = (req, sb) => handleSyncResourceCompact(req, sb, "clock-presales");
|
|
35
|
+
export const handleSyncClockSupplies = (req, sb) => handleSyncResourceCompact(req, sb, "clock-supplies");
|
|
36
|
+
export const handleSyncDeliveryLocations = (req, sb) => handleSyncResourceCompact(req, sb, "delivery-locations");
|
|
37
|
+
export const handleSyncDeliveryOrders = (req, sb) => handleSyncResourceCompact(req, sb, "delivery-orders");
|
|
38
|
+
export const handleSyncPackings = (req, sb) => handleSyncResourceCompact(req, sb, "packings");
|
|
39
|
+
export const handleSyncTradeSettingsCustomers = (req, sb) => handleSyncResourceCompact(req, sb, "trade-settings-customers");
|
|
40
|
+
export const handleSyncWarehouses = (req, sb) => handleSyncResourceCompact(req, sb, "warehouses");
|
|
41
|
+
// -- Uitzondering: connections (eigen sync-functie) -----------------------
|
|
42
|
+
export const handleSyncFloridayConnections = (req, sb) => handleSyncConnections(req, sb);
|
|
43
|
+
// -- Overige zes cron-routes (eigen bestand per route) --------------------
|
|
44
|
+
export { handleSyncFloricodeAll } from "./sync-floricode-all";
|
|
45
|
+
export { handleSyncFloricodeRegulatoryFeatures } from "./sync-floricode-regulatory-features";
|
|
46
|
+
export { handleRefreshFloricodeCodelists } from "./refresh-floricode-codelists";
|
|
47
|
+
export { handleRefreshFlorydayReferenceData } from "./refresh-floriday-reference-data";
|
|
48
|
+
export { handleRefreshFlorydayTokens } from "./refresh-floriday-tokens";
|
|
49
|
+
export { handleVerifyFloricodeCharacteristicsCoverage } from "./verify-floricode-characteristics-coverage";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh-floricode-codelists.d.ts","sourceRoot":"","sources":["../../../src/lib/cron/refresh-floricode-codelists.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,wBAAsB,+BAA+B,CACnD,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,QAAQ,CAAC,CAoBnB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Cron-route: VBN-codelijsten (productgroep, karakteristieken, waarden) uit de
|
|
3
|
+
// Floricode-cache projecteren naar floriday_code_lists_cache zodat de gateway-
|
|
4
|
+
// endpoints (`/api/public/gateway/schema` met includeCodeLists, en
|
|
5
|
+
// `/api/public/gateway/code-list`) ze direct kunnen serveren.
|
|
6
|
+
// ============================================================================
|
|
7
|
+
export async function handleRefreshFloricodeCodelists(request, supabase) {
|
|
8
|
+
try {
|
|
9
|
+
const apikey = request.headers.get("apikey") ?? request.headers.get("x-api-key");
|
|
10
|
+
const expected = process.env.SUPABASE_PUBLISHABLE_KEY;
|
|
11
|
+
if (!expected || !apikey || apikey !== expected) {
|
|
12
|
+
return new Response("Unauthorized", { status: 401 });
|
|
13
|
+
}
|
|
14
|
+
const { data, error } = await supabase.rpc("refresh_floricode_derived_code_lists");
|
|
15
|
+
if (error) {
|
|
16
|
+
console.error("[cron/refresh-floricode-codelists] rpc error:", error.message);
|
|
17
|
+
return Response.json({ ok: false, error: error.message }, { status: 500 });
|
|
18
|
+
}
|
|
19
|
+
return Response.json({ ok: true, summary: data ?? [] });
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
const msg = String(e?.message ?? e);
|
|
23
|
+
console.error("[cron/refresh-floricode-codelists] crashed:", msg);
|
|
24
|
+
return Response.json({ ok: false, error: msg }, { status: 500 });
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh-floriday-reference-data.d.ts","sourceRoot":"","sources":["../../../src/lib/cron/refresh-floriday-reference-data.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAI5D,wBAAsB,kCAAkC,CACtD,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,QAAQ,CAAC,CA+CnB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { runFlorydayReferenceDataRefresh } from "../floriday-sync.functions";
|
|
2
|
+
export async function handleRefreshFlorydayReferenceData(request, supabase) {
|
|
3
|
+
console.log("[cron] refresh-floriday-reference-data start");
|
|
4
|
+
try {
|
|
5
|
+
const apikey = request.headers.get("apikey") ?? request.headers.get("x-api-key");
|
|
6
|
+
const expected = process.env.SUPABASE_PUBLISHABLE_KEY;
|
|
7
|
+
if (!expected || !apikey || apikey !== expected) {
|
|
8
|
+
return new Response("Unauthorized", { status: 401 });
|
|
9
|
+
}
|
|
10
|
+
const { data: rows, error } = await supabase
|
|
11
|
+
.from("floriday_connections")
|
|
12
|
+
.select("environment")
|
|
13
|
+
.eq("is_active", true);
|
|
14
|
+
if (error) {
|
|
15
|
+
return Response.json({ ok: false, error: error.message }, { status: 500 });
|
|
16
|
+
}
|
|
17
|
+
// Eén refresh per environment volstaat (referentiedata is per env).
|
|
18
|
+
const envs = Array.from(new Set((rows ?? []).map((r) => r.environment)));
|
|
19
|
+
const results = [];
|
|
20
|
+
for (const env of envs) {
|
|
21
|
+
try {
|
|
22
|
+
const out = await runFlorydayReferenceDataRefresh(supabase, env);
|
|
23
|
+
results.push({ environment: env, ...out });
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
results.push({
|
|
27
|
+
environment: env,
|
|
28
|
+
ok: false,
|
|
29
|
+
error: e?.message ?? String(e),
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
return Response.json({ ok: true, processed: results.length, results });
|
|
34
|
+
}
|
|
35
|
+
catch (e) {
|
|
36
|
+
const msg = String(e?.message ?? e);
|
|
37
|
+
console.error("[cron] refresh-floriday-reference-data crashed:", msg);
|
|
38
|
+
return Response.json({ ok: false, error: msg }, { status: 500 });
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refresh-floriday-tokens.d.ts","sourceRoot":"","sources":["../../../src/lib/cron/refresh-floriday-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AA8D5D,wBAAsB,2BAA2B,CAC/C,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,QAAQ,CAAC,CAmHnB"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { FLORYDAY_STANDARD_SCOPE } from "../floriday-scopes";
|
|
2
|
+
const FLORYDAY_ENDPOINTS = {
|
|
3
|
+
staging: "https://idm.staging.floriday.io/oauth2/ausmw6b47z1BnlHkw0h7/v1/token",
|
|
4
|
+
live: "https://idm.floriday.io/oauth2/aus3testdcf2vyfs70i7/v1/token",
|
|
5
|
+
};
|
|
6
|
+
// De algemene token-refresh gebruikt alleen basisrechten. Module-specifieke
|
|
7
|
+
// rechten worden pas aangevraagd wanneer die module daadwerkelijk synchroniseert.
|
|
8
|
+
const DEFAULT_SCOPE = FLORYDAY_STANDARD_SCOPE;
|
|
9
|
+
const REFRESH_WINDOW_MS = 2 * 60 * 60 * 1000;
|
|
10
|
+
function sanitize(input) {
|
|
11
|
+
if (!input)
|
|
12
|
+
return "";
|
|
13
|
+
let s = String(input).normalize("NFKC");
|
|
14
|
+
s = s.replace(/[\u200B-\u200D\uFEFF]/g, "");
|
|
15
|
+
s = s.replace(/[\u202A-\u202E\u2066-\u2069]/g, "");
|
|
16
|
+
s = s.replace(/[\u00A0\u2007\u202F]/g, " ");
|
|
17
|
+
s = s.replace(/[\u2018\u2019]/g, "'").replace(/[\u201C\u201D]/g, '"');
|
|
18
|
+
s = s.replace(/[\u0000-\u001F\u007F]/g, "");
|
|
19
|
+
return s.trim();
|
|
20
|
+
}
|
|
21
|
+
async function refreshOne(admin, row) {
|
|
22
|
+
const res = await fetch(FLORYDAY_ENDPOINTS[row.environment], {
|
|
23
|
+
method: "POST",
|
|
24
|
+
headers: {
|
|
25
|
+
"Content-Type": "application/x-www-form-urlencoded",
|
|
26
|
+
Accept: "application/json",
|
|
27
|
+
},
|
|
28
|
+
body: new URLSearchParams({
|
|
29
|
+
grant_type: "client_credentials",
|
|
30
|
+
client_id: sanitize(row.client_id),
|
|
31
|
+
client_secret: sanitize(row.client_secret),
|
|
32
|
+
scope: DEFAULT_SCOPE,
|
|
33
|
+
}).toString(),
|
|
34
|
+
});
|
|
35
|
+
const text = await res.text();
|
|
36
|
+
if (!res.ok) {
|
|
37
|
+
throw new Error(`Token request failed [${res.status}]: ${text.slice(0, 200)}`);
|
|
38
|
+
}
|
|
39
|
+
const json = JSON.parse(text);
|
|
40
|
+
const newExpiresAt = new Date(Date.now() + json.expires_in * 1000).toISOString();
|
|
41
|
+
const { error } = await admin
|
|
42
|
+
.from("floriday_connections")
|
|
43
|
+
.update({ access_token: json.access_token, token_expires_at: newExpiresAt })
|
|
44
|
+
.eq("id", row.id);
|
|
45
|
+
if (error)
|
|
46
|
+
throw new Error(`DB update failed: ${error.message}`);
|
|
47
|
+
return { id: row.id, environment: row.environment, expires_at: newExpiresAt };
|
|
48
|
+
}
|
|
49
|
+
export async function handleRefreshFlorydayTokens(request, supabase) {
|
|
50
|
+
console.log("[cron] refresh-floriday-tokens start");
|
|
51
|
+
try {
|
|
52
|
+
// Authenticate with Supabase anon key (cron uses apikey header).
|
|
53
|
+
const apikey = request.headers.get("apikey") ?? request.headers.get("x-api-key");
|
|
54
|
+
const expected = process.env.SUPABASE_PUBLISHABLE_KEY;
|
|
55
|
+
if (!expected || !apikey || apikey !== expected) {
|
|
56
|
+
return new Response("Unauthorized", { status: 401 });
|
|
57
|
+
}
|
|
58
|
+
const supabaseAdmin = supabase;
|
|
59
|
+
const { data: rows, error } = await supabaseAdmin
|
|
60
|
+
.from("floriday_connections")
|
|
61
|
+
.select("id, environment, client_id, client_secret, token_expires_at")
|
|
62
|
+
.eq("is_active", true);
|
|
63
|
+
if (error) {
|
|
64
|
+
await supabaseAdmin.from("floriday_token_refresh_log").insert({
|
|
65
|
+
connection_id: null,
|
|
66
|
+
environment: "staging",
|
|
67
|
+
ok: false,
|
|
68
|
+
error: `DB select failed: ${error.message}`.slice(0, 500),
|
|
69
|
+
});
|
|
70
|
+
return Response.json({ ok: false, error: error.message }, { status: 500 });
|
|
71
|
+
}
|
|
72
|
+
const now = Date.now();
|
|
73
|
+
const due = (rows ?? []).filter((r) => {
|
|
74
|
+
if (!r.client_id || !r.client_secret)
|
|
75
|
+
return false;
|
|
76
|
+
if (!r.token_expires_at)
|
|
77
|
+
return true;
|
|
78
|
+
return Date.parse(r.token_expires_at) - now < REFRESH_WINDOW_MS;
|
|
79
|
+
});
|
|
80
|
+
const results = [];
|
|
81
|
+
if (due.length === 0 && (rows?.length ?? 0) > 0) {
|
|
82
|
+
await supabaseAdmin.from("floriday_token_refresh_log").insert({
|
|
83
|
+
connection_id: rows[0].id,
|
|
84
|
+
environment: rows[0].environment,
|
|
85
|
+
ok: true,
|
|
86
|
+
expires_at: rows[0].token_expires_at,
|
|
87
|
+
error: "heartbeat: nog niet binnen refresh-window",
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
for (const r of due) {
|
|
91
|
+
try {
|
|
92
|
+
const out = await refreshOne(supabaseAdmin, {
|
|
93
|
+
id: r.id,
|
|
94
|
+
environment: r.environment,
|
|
95
|
+
client_id: r.client_id,
|
|
96
|
+
client_secret: r.client_secret,
|
|
97
|
+
});
|
|
98
|
+
results.push({ ...out, ok: true });
|
|
99
|
+
await supabaseAdmin.from("floriday_token_refresh_log").insert({
|
|
100
|
+
connection_id: r.id,
|
|
101
|
+
environment: r.environment,
|
|
102
|
+
ok: true,
|
|
103
|
+
expires_at: out.expires_at,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
catch (e) {
|
|
107
|
+
const msg = e?.message ?? "Onbekende fout";
|
|
108
|
+
results.push({
|
|
109
|
+
id: r.id,
|
|
110
|
+
environment: r.environment,
|
|
111
|
+
ok: false,
|
|
112
|
+
error: msg,
|
|
113
|
+
});
|
|
114
|
+
await supabaseAdmin.from("floriday_token_refresh_log").insert({
|
|
115
|
+
connection_id: r.id,
|
|
116
|
+
environment: r.environment,
|
|
117
|
+
ok: false,
|
|
118
|
+
error: String(msg).slice(0, 500),
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
await supabaseAdmin
|
|
123
|
+
.from("floriday_token_refresh_log")
|
|
124
|
+
.delete()
|
|
125
|
+
.lt("attempted_at", new Date(Date.now() - 14 * 24 * 60 * 60 * 1000).toISOString());
|
|
126
|
+
return Response.json({
|
|
127
|
+
ok: true,
|
|
128
|
+
checked: rows?.length ?? 0,
|
|
129
|
+
refreshed: results.filter((r) => r.ok).length,
|
|
130
|
+
failed: results.filter((r) => !r.ok).length,
|
|
131
|
+
results,
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
catch (e) {
|
|
135
|
+
const msg = String(e?.message ?? e);
|
|
136
|
+
console.error("[cron] refresh-floriday-tokens crashed:", msg);
|
|
137
|
+
// best-effort log
|
|
138
|
+
try {
|
|
139
|
+
await supabase.from("floriday_token_refresh_log").insert({
|
|
140
|
+
connection_id: null,
|
|
141
|
+
environment: "staging",
|
|
142
|
+
ok: false,
|
|
143
|
+
error: `handler crash: ${msg}`.slice(0, 500),
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
// ignore
|
|
148
|
+
}
|
|
149
|
+
return Response.json({ ok: false, error: msg }, { status: 500 });
|
|
150
|
+
}
|
|
151
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-connections.d.ts","sourceRoot":"","sources":["../../../src/lib/cron/sync-connections.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAM5D,wBAAsB,qBAAqB,CACzC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,QAAQ,CAAC,CAyDnB"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Sync-runner voor `sync-floriday-connections`. Regel-voor-regel overgenomen
|
|
3
|
+
// uit `src/routes/api/public/cron/sync-floriday-connections.ts`. Roept de
|
|
4
|
+
// aparte `runFloridayConnectionsSync` aan (niet `runFloridayResourceSync`);
|
|
5
|
+
// envelope heeft géén `resource`-veld.
|
|
6
|
+
// ============================================================================
|
|
7
|
+
import { runFloridayConnectionsSync, } from "../floriday.functions";
|
|
8
|
+
export async function handleSyncConnections(request, supabase) {
|
|
9
|
+
console.log("[cron] sync-floriday-connections start");
|
|
10
|
+
try {
|
|
11
|
+
const apikey = request.headers.get("apikey") ?? request.headers.get("x-api-key");
|
|
12
|
+
const expected = process.env.SUPABASE_PUBLISHABLE_KEY;
|
|
13
|
+
if (!expected || !apikey || apikey !== expected) {
|
|
14
|
+
return new Response("Unauthorized", { status: 401 });
|
|
15
|
+
}
|
|
16
|
+
const { data: rows, error } = await supabase
|
|
17
|
+
.from("floriday_connections")
|
|
18
|
+
.select("id, environment")
|
|
19
|
+
.eq("is_active", true);
|
|
20
|
+
if (error) {
|
|
21
|
+
return Response.json({ ok: false, error: error.message }, { status: 500 });
|
|
22
|
+
}
|
|
23
|
+
const results = [];
|
|
24
|
+
for (const r of rows ?? []) {
|
|
25
|
+
try {
|
|
26
|
+
const out = await runFloridayConnectionsSync(supabase, r.environment);
|
|
27
|
+
results.push({ id: r.id, environment: r.environment, ok: true, ...out });
|
|
28
|
+
console.log(`[floriday-connections-sync] ${r.environment}: ${out.synced} synced (${out.fromSequence} → ${out.toSequence})`);
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
const msg = e?.message ?? "Onbekende fout";
|
|
32
|
+
results.push({ id: r.id, environment: r.environment, ok: false, error: msg });
|
|
33
|
+
console.error(`[floriday-connections-sync] ${r.environment} failed: ${msg}`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return Response.json({
|
|
37
|
+
ok: true,
|
|
38
|
+
processed: results.length,
|
|
39
|
+
succeeded: results.filter((r) => r.ok).length,
|
|
40
|
+
failed: results.filter((r) => !r.ok).length,
|
|
41
|
+
results,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
catch (e) {
|
|
45
|
+
const msg = String(e?.message ?? e);
|
|
46
|
+
console.error("[cron] sync-floriday-connections crashed:", msg);
|
|
47
|
+
return Response.json({ ok: false, error: msg }, { status: 500 });
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-floricode-all.d.ts","sourceRoot":"","sources":["../../../src/lib/cron/sync-floricode-all.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,cAAc,GACxB,OAAO,CAAC,QAAQ,CAAC,CAqBnB"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export async function handleSyncFloricodeAll(request, _supabase) {
|
|
2
|
+
console.log("[cron] sync-floricode-all start");
|
|
3
|
+
try {
|
|
4
|
+
const apikey = request.headers.get("apikey") ?? request.headers.get("x-api-key");
|
|
5
|
+
const expected = process.env.SUPABASE_PUBLISHABLE_KEY;
|
|
6
|
+
if (!expected || !apikey || apikey !== expected) {
|
|
7
|
+
return new Response("Unauthorized", { status: 401 });
|
|
8
|
+
}
|
|
9
|
+
const url = new URL(request.url);
|
|
10
|
+
const batchSize = Number(url.searchParams.get("batchSize") ?? "5000");
|
|
11
|
+
const maxBatches = Number(url.searchParams.get("maxBatchesPerResource") ?? "2");
|
|
12
|
+
const { syncAllFloricodeResources } = await import("../floricode-sync.server");
|
|
13
|
+
const result = await syncAllFloricodeResources({
|
|
14
|
+
batchSize: Number.isFinite(batchSize) ? batchSize : 5000,
|
|
15
|
+
maxBatchesPerResource: Number.isFinite(maxBatches) ? maxBatches : 2,
|
|
16
|
+
});
|
|
17
|
+
return Response.json(result);
|
|
18
|
+
}
|
|
19
|
+
catch (e) {
|
|
20
|
+
console.error("[cron] sync-floricode-all crashed:", String(e?.message ?? e));
|
|
21
|
+
return Response.json({ ok: false, error: String(e?.message ?? e) }, { status: 500 });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-floricode-regulatory-features.d.ts","sourceRoot":"","sources":["../../../src/lib/cron/sync-floricode-regulatory-features.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,wBAAsB,qCAAqC,CACzD,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,QAAQ,CAAC,CAkCnB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export async function handleSyncFloricodeRegulatoryFeatures(request, supabase) {
|
|
2
|
+
console.log("[cron] sync-floricode-regulatory-features start");
|
|
3
|
+
try {
|
|
4
|
+
const apikey = request.headers.get("apikey") ?? request.headers.get("x-api-key");
|
|
5
|
+
const expected = process.env.SUPABASE_PUBLISHABLE_KEY;
|
|
6
|
+
if (!expected || !apikey || apikey !== expected) {
|
|
7
|
+
return new Response("Unauthorized", { status: 401 });
|
|
8
|
+
}
|
|
9
|
+
const { syncFloricodeRegulatoryFeatures } = await import("../floricode-regulatory-features");
|
|
10
|
+
const url = new URL(request.url);
|
|
11
|
+
const batchSize = Number(url.searchParams.get("batchSize") ?? "2000");
|
|
12
|
+
const maxBatchesRaw = url.searchParams.get("maxBatches");
|
|
13
|
+
// Default: 1 batch (~2k rijen) per invocation om Supabase Disk IO
|
|
14
|
+
// budget te sparen tijdens de initiële backfill. De cron tikt vaak
|
|
15
|
+
// genoeg om cumulatief door te lopen, met veel minder piek-IO.
|
|
16
|
+
const maxBatches = maxBatchesRaw == null ? 1 : Number(maxBatchesRaw);
|
|
17
|
+
const resumeParam = url.searchParams.get("resume");
|
|
18
|
+
const resume = resumeParam == null ? true : resumeParam !== "false";
|
|
19
|
+
const result = await syncFloricodeRegulatoryFeatures(supabase, {
|
|
20
|
+
batchSize: Number.isFinite(batchSize) ? batchSize : 2000,
|
|
21
|
+
maxBatches: Number.isFinite(maxBatches) ? maxBatches : 1,
|
|
22
|
+
resume,
|
|
23
|
+
});
|
|
24
|
+
return Response.json(result);
|
|
25
|
+
}
|
|
26
|
+
catch (e) {
|
|
27
|
+
const msg = String(e?.message ?? e);
|
|
28
|
+
console.error("[cron] sync-floricode-regulatory-features crashed:", msg);
|
|
29
|
+
return Response.json({ ok: false, error: msg }, { status: 500 });
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { SupabaseClient } from "@supabase/supabase-js";
|
|
2
|
+
import { type FlorydayResource } from "../floriday-sync.functions";
|
|
3
|
+
export declare function handleSyncResourceCompact(request: Request, supabase: SupabaseClient, resource: FlorydayResource): Promise<Response>;
|
|
4
|
+
//# sourceMappingURL=sync-resource-compact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-resource-compact.d.ts","sourceRoot":"","sources":["../../../src/lib/cron/sync-resource-compact.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,4BAA4B,CAAC;AAGpC,wBAAsB,yBAAyB,CAC7C,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,gBAAgB,GACzB,OAAO,CAAC,QAAQ,CAAC,CAyBnB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Compact-vorm sync-runner voor de 7 clock-/delivery-/warehouse-cron-routes.
|
|
3
|
+
// Regel-voor-regel overgenomen uit
|
|
4
|
+
// `src/routes/api/public/cron/sync-floriday-clock-presales.ts` — envelope
|
|
5
|
+
// bevat alleen {ok, resource, results}, results-rijen hebben géén
|
|
6
|
+
// `environment`, catch-msg-fallback = "err", geen top-level try/catch,
|
|
7
|
+
// geen start-log en geen DB-error-branch.
|
|
8
|
+
// ============================================================================
|
|
9
|
+
import { runFloridayResourceSync, } from "../floriday-sync.functions";
|
|
10
|
+
export async function handleSyncResourceCompact(request, supabase, resource) {
|
|
11
|
+
const RESOURCE = resource;
|
|
12
|
+
const apikey = request.headers.get("apikey") ?? request.headers.get("x-api-key");
|
|
13
|
+
const expected = process.env.SUPABASE_PUBLISHABLE_KEY;
|
|
14
|
+
if (!expected || !apikey || apikey !== expected)
|
|
15
|
+
return new Response("Unauthorized", { status: 401 });
|
|
16
|
+
const { data: rows } = await supabase
|
|
17
|
+
.from("floriday_connections")
|
|
18
|
+
.select("id, environment")
|
|
19
|
+
.eq("is_active", true);
|
|
20
|
+
const results = [];
|
|
21
|
+
for (const r of rows ?? []) {
|
|
22
|
+
try {
|
|
23
|
+
const out = await runFloridayResourceSync(supabase, r.environment, RESOURCE);
|
|
24
|
+
results.push({ id: r.id, ok: true, ...out });
|
|
25
|
+
}
|
|
26
|
+
catch (e) {
|
|
27
|
+
results.push({ id: r.id, ok: false, error: e?.message ?? "err" });
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return Response.json({ ok: true, resource: RESOURCE, results });
|
|
31
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { SupabaseClient } from "@supabase/supabase-js";
|
|
2
|
+
import { type FlorydayResource } from "../floriday-sync.functions";
|
|
3
|
+
export declare function handleSyncResource(request: Request, supabase: SupabaseClient, resource: FlorydayResource, options?: {
|
|
4
|
+
logProgress?: boolean;
|
|
5
|
+
}): Promise<Response>;
|
|
6
|
+
//# sourceMappingURL=sync-resource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-resource.d.ts","sourceRoot":"","sources":["../../../src/lib/cron/sync-resource.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAEL,KAAK,gBAAgB,EACtB,MAAM,4BAA4B,CAAC;AAGpC,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,GAClC,OAAO,CAAC,QAAQ,CAAC,CAmDnB"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Standaard-vorm sync-runner voor de 16 "collections-vorm" cron-routes.
|
|
3
|
+
// Envelope, veldvolgorde, catch-tekst ("Onbekende fout"), start-log en
|
|
4
|
+
// DB-error-branch zijn regel-voor-regel overgenomen uit
|
|
5
|
+
// `src/routes/api/public/cron/sync-floriday-collections.ts`.
|
|
6
|
+
//
|
|
7
|
+
// De per-iteratie `console.log(... synced (${from} → ${to}))` is aanwezig in
|
|
8
|
+
// 8 van de 16 bronroutes (blanket-orders, carriers, contracts,
|
|
9
|
+
// customer-organizations, customer-stickers, fulfillment-orders, salesorders,
|
|
10
|
+
// trade-items) en afwezig in de andere 8. Om byte-identiek te blijven wordt
|
|
11
|
+
// dit gestuurd door de optionele `logProgress`-flag; de barrel-exports zetten
|
|
12
|
+
// hem per resource exact zoals de bron nu doet.
|
|
13
|
+
// ============================================================================
|
|
14
|
+
import { runFloridayResourceSync, } from "../floriday-sync.functions";
|
|
15
|
+
export async function handleSyncResource(request, supabase, resource, options) {
|
|
16
|
+
const RESOURCE = resource;
|
|
17
|
+
const logProgress = options?.logProgress === true;
|
|
18
|
+
console.log(`[cron] sync-floriday-${RESOURCE} start`);
|
|
19
|
+
try {
|
|
20
|
+
const apikey = request.headers.get("apikey") ?? request.headers.get("x-api-key");
|
|
21
|
+
const expected = process.env.SUPABASE_PUBLISHABLE_KEY;
|
|
22
|
+
if (!expected || !apikey || apikey !== expected) {
|
|
23
|
+
return new Response("Unauthorized", { status: 401 });
|
|
24
|
+
}
|
|
25
|
+
const { data: rows, error } = await supabase
|
|
26
|
+
.from("floriday_connections")
|
|
27
|
+
.select("id, environment")
|
|
28
|
+
.eq("is_active", true);
|
|
29
|
+
if (error) {
|
|
30
|
+
return Response.json({ ok: false, error: error.message }, { status: 500 });
|
|
31
|
+
}
|
|
32
|
+
const results = [];
|
|
33
|
+
for (const r of rows ?? []) {
|
|
34
|
+
try {
|
|
35
|
+
const out = await runFloridayResourceSync(supabase, r.environment, RESOURCE);
|
|
36
|
+
results.push({ id: r.id, environment: r.environment, ok: true, ...out });
|
|
37
|
+
if (logProgress) {
|
|
38
|
+
console.log(`[floriday-${RESOURCE}-sync] ${r.environment}: ${out.synced} synced (${out.fromSequence} → ${out.toSequence})`);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
catch (e) {
|
|
42
|
+
const msg = e?.message ?? "Onbekende fout";
|
|
43
|
+
results.push({ id: r.id, environment: r.environment, ok: false, error: msg });
|
|
44
|
+
console.error(`[floriday-${RESOURCE}-sync] ${r.environment} failed: ${msg}`);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return Response.json({
|
|
48
|
+
ok: true,
|
|
49
|
+
resource: RESOURCE,
|
|
50
|
+
processed: results.length,
|
|
51
|
+
succeeded: results.filter((r) => r.ok).length,
|
|
52
|
+
failed: results.filter((r) => !r.ok).length,
|
|
53
|
+
results,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
const msg = String(e?.message ?? e);
|
|
58
|
+
console.error(`[cron] sync-floriday-${RESOURCE} crashed:`, msg);
|
|
59
|
+
return Response.json({ ok: false, error: msg }, { status: 500 });
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-floricode-characteristics-coverage.d.ts","sourceRoot":"","sources":["../../../src/lib/cron/verify-floricode-characteristics-coverage.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,wBAAsB,4CAA4C,CAChE,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,cAAc,GACvB,OAAO,CAAC,QAAQ,CAAC,CA6DnB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
// ============================================================================
|
|
2
|
+
// Cron-route: meet dekking van vbn-product-characteristic en herstel projectie
|
|
3
|
+
// als deze achterloopt op de raw RegulatoryFeatureType-cache.
|
|
4
|
+
// ============================================================================
|
|
5
|
+
export async function handleVerifyFloricodeCharacteristicsCoverage(request, supabase) {
|
|
6
|
+
try {
|
|
7
|
+
const apikey = request.headers.get("apikey") ?? request.headers.get("x-api-key");
|
|
8
|
+
const expected = process.env.SUPABASE_PUBLISHABLE_KEY;
|
|
9
|
+
if (!expected || !apikey || apikey !== expected) {
|
|
10
|
+
return new Response("Unauthorized", { status: 401 });
|
|
11
|
+
}
|
|
12
|
+
const [totalRes, projectedRes, rawCountRes] = await Promise.all([
|
|
13
|
+
supabase
|
|
14
|
+
.from("floricode_records")
|
|
15
|
+
.select("record_id", { count: "exact", head: true })
|
|
16
|
+
.eq("resource", "VbnProduct"),
|
|
17
|
+
supabase
|
|
18
|
+
.from("floriday_code_lists_cache")
|
|
19
|
+
.select("code", { count: "exact", head: true })
|
|
20
|
+
.eq("list_name", "vbn-product-characteristic"),
|
|
21
|
+
supabase.rpc("count_distinct_regulatory_products"),
|
|
22
|
+
]);
|
|
23
|
+
const totalVbn = totalRes?.count ?? null;
|
|
24
|
+
const projected = projectedRes?.count ?? null;
|
|
25
|
+
const vbnWithRaw = typeof rawCountRes?.data === "number"
|
|
26
|
+
? rawCountRes.data
|
|
27
|
+
: null;
|
|
28
|
+
let refreshed = false;
|
|
29
|
+
if (projected != null &&
|
|
30
|
+
vbnWithRaw != null &&
|
|
31
|
+
projected < vbnWithRaw) {
|
|
32
|
+
const { error } = await supabase.rpc("refresh_floricode_derived_code_lists");
|
|
33
|
+
if (error) {
|
|
34
|
+
console.warn("[verify-coverage] projection refresh failed:", error.message);
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
refreshed = true;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return Response.json({
|
|
41
|
+
ok: true,
|
|
42
|
+
totals: {
|
|
43
|
+
vbn_products: totalVbn,
|
|
44
|
+
vbn_with_raw: vbnWithRaw,
|
|
45
|
+
vbn_projected: projected,
|
|
46
|
+
},
|
|
47
|
+
projection_refreshed: refreshed,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
const msg = String(e?.message ?? e);
|
|
52
|
+
console.error("[verify-coverage] crashed:", msg);
|
|
53
|
+
return Response.json({ ok: false, error: msg }, { status: 500 });
|
|
54
|
+
}
|
|
55
|
+
}
|
package/package.json
CHANGED
|
@@ -1,100 +1,475 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@flowselections/floriday-authenticatie-module",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"sideEffects": false,
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./dist-lib/index.js",
|
|
7
|
-
"types": "./dist-lib/index.d.ts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"types": "./dist-lib/index.d.ts",
|
|
11
|
-
"default": "./dist-lib/index.js"
|
|
12
|
-
},
|
|
13
|
-
"./gateway": {
|
|
14
|
-
"types": "./dist-lib/lib/gateway/index.d.ts",
|
|
15
|
-
"default": "./dist-lib/lib/gateway/index.js"
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
},
|
|
43
|
-
"
|
|
44
|
-
"@
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
50
|
-
"@
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"vite
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
{
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
{
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@flowselections/floriday-authenticatie-module",
|
|
3
|
+
"version": "1.0.29",
|
|
4
|
+
"sideEffects": false,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist-lib/index.js",
|
|
7
|
+
"types": "./dist-lib/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist-lib/index.d.ts",
|
|
11
|
+
"default": "./dist-lib/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./gateway": {
|
|
14
|
+
"types": "./dist-lib/lib/gateway/index.d.ts",
|
|
15
|
+
"default": "./dist-lib/lib/gateway/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./cron": {
|
|
18
|
+
"types": "./dist-lib/lib/cron/index.d.ts",
|
|
19
|
+
"default": "./dist-lib/lib/cron/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist-lib",
|
|
24
|
+
"public"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"access": "public"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"dev": "vite dev",
|
|
31
|
+
"build": "vite build",
|
|
32
|
+
"build:lib": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && node -e \"require('fs').writeFileSync('dist-lib/styles.css', '@source \\\"./\\\";\\n')\"",
|
|
33
|
+
"build:lib:watch": "tsc -p tsconfig.build.json --watch",
|
|
34
|
+
"build:dev": "vite build --mode development",
|
|
35
|
+
"preview": "vite preview",
|
|
36
|
+
"lint": "eslint ."
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"react": "^18 || ^19",
|
|
40
|
+
"react-dom": "^18 || ^19",
|
|
41
|
+
"@flowselections/core": "*"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@supabase/supabase-js": "^2.105.4",
|
|
45
|
+
"pdf-lib": "^1.17.1"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@flowselections/core": "1.0.16",
|
|
49
|
+
"@eslint/js": "^9.32.0",
|
|
50
|
+
"@lovable.dev/vite-tanstack-config": "2.7.7",
|
|
51
|
+
"@types/node": "^22.16.5",
|
|
52
|
+
"@types/react": "^19.2.0",
|
|
53
|
+
"@types/react-dom": "^19.2.0",
|
|
54
|
+
"@vitejs/plugin-react": "^5.0.4",
|
|
55
|
+
"eslint": "^9.32.0",
|
|
56
|
+
"eslint-plugin-react-hooks": "^5.2.0",
|
|
57
|
+
"eslint-plugin-react-refresh": "^0.4.20",
|
|
58
|
+
"globals": "^15.15.0",
|
|
59
|
+
"typescript": "^5.8.3",
|
|
60
|
+
"tsc-alias": "^1.8.0",
|
|
61
|
+
"typescript-eslint": "^8.56.1",
|
|
62
|
+
"vite": "^7.3.1",
|
|
63
|
+
"@cloudflare/vite-plugin": "^1.25.5",
|
|
64
|
+
"@rsbuild/core": "^1.0.0",
|
|
65
|
+
"@tailwindcss/vite": "^4.2.1",
|
|
66
|
+
"@tanstack/router-plugin": "^1.167.10",
|
|
67
|
+
"tailwindcss": "^4.2.1",
|
|
68
|
+
"tw-animate-css": "^1.3.4",
|
|
69
|
+
"vite-tsconfig-paths": "^6.0.2",
|
|
70
|
+
"react": "^19.2.0",
|
|
71
|
+
"react-dom": "^19.2.0",
|
|
72
|
+
"nitro": "3.0.260603-beta"
|
|
73
|
+
},
|
|
74
|
+
"private": false,
|
|
75
|
+
"flowselections": {
|
|
76
|
+
"moduleId": "Floriday Authenticatie",
|
|
77
|
+
"pages": [
|
|
78
|
+
{
|
|
79
|
+
"export": "FlorydayConnectionPage",
|
|
80
|
+
"route": "floriday-connection",
|
|
81
|
+
"title": "Connectie"
|
|
82
|
+
}
|
|
83
|
+
],
|
|
84
|
+
"serverRoutes": [
|
|
85
|
+
{
|
|
86
|
+
"routePath": "/api/public/gateway/active-environment",
|
|
87
|
+
"import": "@flowselections/floriday-authenticatie-module/gateway",
|
|
88
|
+
"handler": "handleActiveEnvironment",
|
|
89
|
+
"methods": [
|
|
90
|
+
"POST",
|
|
91
|
+
"OPTIONS"
|
|
92
|
+
]
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"routePath": "/api/public/gateway/auto-process",
|
|
96
|
+
"import": "@flowselections/floriday-authenticatie-module/gateway",
|
|
97
|
+
"handler": "handleAutoProcess",
|
|
98
|
+
"methods": [
|
|
99
|
+
"POST",
|
|
100
|
+
"OPTIONS"
|
|
101
|
+
]
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
"routePath": "/api/public/gateway/cached-list",
|
|
105
|
+
"import": "@flowselections/floriday-authenticatie-module/gateway",
|
|
106
|
+
"handler": "handleCachedList",
|
|
107
|
+
"methods": [
|
|
108
|
+
"POST"
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
"routePath": "/api/public/gateway/code-list",
|
|
113
|
+
"import": "@flowselections/floriday-authenticatie-module/gateway",
|
|
114
|
+
"handler": "handleCodeList",
|
|
115
|
+
"methods": [
|
|
116
|
+
"POST"
|
|
117
|
+
]
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
"routePath": "/api/public/gateway/cron/scan",
|
|
121
|
+
"import": "@flowselections/floriday-authenticatie-module/gateway",
|
|
122
|
+
"handler": "handleCronScan",
|
|
123
|
+
"methods": [
|
|
124
|
+
"POST",
|
|
125
|
+
"OPTIONS"
|
|
126
|
+
]
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
"routePath": "/api/public/gateway/diagnostics",
|
|
130
|
+
"import": "@flowselections/floriday-authenticatie-module/gateway",
|
|
131
|
+
"handler": "handleDiagnostics",
|
|
132
|
+
"methods": [
|
|
133
|
+
"POST",
|
|
134
|
+
"OPTIONS"
|
|
135
|
+
]
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"routePath": "/api/public/gateway/floricode-records",
|
|
139
|
+
"import": "@flowselections/floriday-authenticatie-module/gateway",
|
|
140
|
+
"handler": "handleFloricodeRecords",
|
|
141
|
+
"methods": [
|
|
142
|
+
"POST"
|
|
143
|
+
]
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"routePath": "/api/public/gateway/fulfillment-order/send",
|
|
147
|
+
"import": "@flowselections/floriday-authenticatie-module/gateway",
|
|
148
|
+
"handler": "handleFulfillmentOrderSend",
|
|
149
|
+
"methods": [
|
|
150
|
+
"POST",
|
|
151
|
+
"OPTIONS"
|
|
152
|
+
]
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
"routePath": "/api/public/gateway/media",
|
|
156
|
+
"import": "@flowselections/floriday-authenticatie-module/gateway",
|
|
157
|
+
"handler": "handleMedia",
|
|
158
|
+
"methods": [
|
|
159
|
+
"POST",
|
|
160
|
+
"OPTIONS"
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"routePath": "/api/public/gateway/media-upload",
|
|
165
|
+
"import": "@flowselections/floriday-authenticatie-module/gateway",
|
|
166
|
+
"handler": "handleMediaUpload",
|
|
167
|
+
"methods": [
|
|
168
|
+
"POST",
|
|
169
|
+
"OPTIONS"
|
|
170
|
+
]
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
"routePath": "/api/public/gateway/pdf",
|
|
174
|
+
"import": "@flowselections/floriday-authenticatie-module/gateway",
|
|
175
|
+
"handler": "handlePdf",
|
|
176
|
+
"methods": [
|
|
177
|
+
"POST",
|
|
178
|
+
"OPTIONS"
|
|
179
|
+
]
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
"routePath": "/api/public/gateway/pdf/bulk",
|
|
183
|
+
"import": "@flowselections/floriday-authenticatie-module/gateway",
|
|
184
|
+
"handler": "handlePdfBulk",
|
|
185
|
+
"methods": [
|
|
186
|
+
"POST",
|
|
187
|
+
"OPTIONS"
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"routePath": "/api/public/gateway/pdf/bulk-merged",
|
|
192
|
+
"import": "@flowselections/floriday-authenticatie-module/gateway",
|
|
193
|
+
"handler": "handlePdfBulkMerged",
|
|
194
|
+
"methods": [
|
|
195
|
+
"POST",
|
|
196
|
+
"OPTIONS"
|
|
197
|
+
]
|
|
198
|
+
},
|
|
199
|
+
{
|
|
200
|
+
"routePath": "/api/public/gateway/product-characteristics",
|
|
201
|
+
"import": "@flowselections/floriday-authenticatie-module/gateway",
|
|
202
|
+
"handler": "handleProductCharacteristics",
|
|
203
|
+
"methods": [
|
|
204
|
+
"POST",
|
|
205
|
+
"OPTIONS"
|
|
206
|
+
]
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
"routePath": "/api/public/gateway/schema",
|
|
210
|
+
"import": "@flowselections/floriday-authenticatie-module/gateway",
|
|
211
|
+
"handler": "handleSchema",
|
|
212
|
+
"methods": [
|
|
213
|
+
"POST"
|
|
214
|
+
]
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"routePath": "/api/public/gateway/supply-line",
|
|
218
|
+
"import": "@flowselections/floriday-authenticatie-module/gateway",
|
|
219
|
+
"handler": "handleSupplyLine",
|
|
220
|
+
"methods": [
|
|
221
|
+
"POST",
|
|
222
|
+
"OPTIONS"
|
|
223
|
+
]
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
"routePath": "/api/public/gateway/write",
|
|
227
|
+
"import": "@flowselections/floriday-authenticatie-module/gateway",
|
|
228
|
+
"handler": "handleWrite",
|
|
229
|
+
"methods": [
|
|
230
|
+
"POST"
|
|
231
|
+
]
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
"routePath": "/api/public/cron/sync-floriday-additional-services",
|
|
235
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
236
|
+
"handler": "handleSyncAdditionalServices",
|
|
237
|
+
"methods": [
|
|
238
|
+
"POST"
|
|
239
|
+
]
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
"routePath": "/api/public/cron/sync-floriday-base-items",
|
|
243
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
244
|
+
"handler": "handleSyncBaseItems",
|
|
245
|
+
"methods": [
|
|
246
|
+
"POST"
|
|
247
|
+
]
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
"routePath": "/api/public/cron/sync-floriday-blanket-orders",
|
|
251
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
252
|
+
"handler": "handleSyncBlanketOrders",
|
|
253
|
+
"methods": [
|
|
254
|
+
"POST"
|
|
255
|
+
]
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
"routePath": "/api/public/cron/sync-floriday-carriers",
|
|
259
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
260
|
+
"handler": "handleSyncCarriers",
|
|
261
|
+
"methods": [
|
|
262
|
+
"POST"
|
|
263
|
+
]
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
"routePath": "/api/public/cron/sync-floriday-clock-presales",
|
|
267
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
268
|
+
"handler": "handleSyncClockPresales",
|
|
269
|
+
"methods": [
|
|
270
|
+
"POST"
|
|
271
|
+
]
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"routePath": "/api/public/cron/sync-floriday-clock-supplies",
|
|
275
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
276
|
+
"handler": "handleSyncClockSupplies",
|
|
277
|
+
"methods": [
|
|
278
|
+
"POST"
|
|
279
|
+
]
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"routePath": "/api/public/cron/sync-floriday-collections",
|
|
283
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
284
|
+
"handler": "handleSyncCollections",
|
|
285
|
+
"methods": [
|
|
286
|
+
"POST"
|
|
287
|
+
]
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
"routePath": "/api/public/cron/sync-floriday-commercial-service-types",
|
|
291
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
292
|
+
"handler": "handleSyncCommercialServiceTypes",
|
|
293
|
+
"methods": [
|
|
294
|
+
"POST"
|
|
295
|
+
]
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
"routePath": "/api/public/cron/sync-floriday-contract-trade-item-groups",
|
|
299
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
300
|
+
"handler": "handleSyncContractTradeItemGroups",
|
|
301
|
+
"methods": [
|
|
302
|
+
"POST"
|
|
303
|
+
]
|
|
304
|
+
},
|
|
305
|
+
{
|
|
306
|
+
"routePath": "/api/public/cron/sync-floriday-contracts",
|
|
307
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
308
|
+
"handler": "handleSyncContracts",
|
|
309
|
+
"methods": [
|
|
310
|
+
"POST"
|
|
311
|
+
]
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
"routePath": "/api/public/cron/sync-floriday-customer-organizations",
|
|
315
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
316
|
+
"handler": "handleSyncCustomerOrganizations",
|
|
317
|
+
"methods": [
|
|
318
|
+
"POST"
|
|
319
|
+
]
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"routePath": "/api/public/cron/sync-floriday-customer-stickers",
|
|
323
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
324
|
+
"handler": "handleSyncCustomerStickers",
|
|
325
|
+
"methods": [
|
|
326
|
+
"POST"
|
|
327
|
+
]
|
|
328
|
+
},
|
|
329
|
+
{
|
|
330
|
+
"routePath": "/api/public/cron/sync-floriday-delivery-condition-sets",
|
|
331
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
332
|
+
"handler": "handleSyncDeliveryConditionSets",
|
|
333
|
+
"methods": [
|
|
334
|
+
"POST"
|
|
335
|
+
]
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"routePath": "/api/public/cron/sync-floriday-delivery-locations",
|
|
339
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
340
|
+
"handler": "handleSyncDeliveryLocations",
|
|
341
|
+
"methods": [
|
|
342
|
+
"POST"
|
|
343
|
+
]
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
"routePath": "/api/public/cron/sync-floriday-delivery-orders",
|
|
347
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
348
|
+
"handler": "handleSyncDeliveryOrders",
|
|
349
|
+
"methods": [
|
|
350
|
+
"POST"
|
|
351
|
+
]
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"routePath": "/api/public/cron/sync-floriday-fulfillment-orders",
|
|
355
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
356
|
+
"handler": "handleSyncFulfillmentOrders",
|
|
357
|
+
"methods": [
|
|
358
|
+
"POST"
|
|
359
|
+
]
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"routePath": "/api/public/cron/sync-floriday-packings",
|
|
363
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
364
|
+
"handler": "handleSyncPackings",
|
|
365
|
+
"methods": [
|
|
366
|
+
"POST"
|
|
367
|
+
]
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"routePath": "/api/public/cron/sync-floriday-price-groups",
|
|
371
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
372
|
+
"handler": "handleSyncPriceGroups",
|
|
373
|
+
"methods": [
|
|
374
|
+
"POST"
|
|
375
|
+
]
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"routePath": "/api/public/cron/sync-floriday-sales-strategies",
|
|
379
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
380
|
+
"handler": "handleSyncSalesStrategies",
|
|
381
|
+
"methods": [
|
|
382
|
+
"POST"
|
|
383
|
+
]
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"routePath": "/api/public/cron/sync-floriday-salesorders",
|
|
387
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
388
|
+
"handler": "handleSyncSalesorders",
|
|
389
|
+
"methods": [
|
|
390
|
+
"POST"
|
|
391
|
+
]
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"routePath": "/api/public/cron/sync-floriday-trade-items",
|
|
395
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
396
|
+
"handler": "handleSyncTradeItems",
|
|
397
|
+
"methods": [
|
|
398
|
+
"POST"
|
|
399
|
+
]
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"routePath": "/api/public/cron/sync-floriday-trade-settings-customers",
|
|
403
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
404
|
+
"handler": "handleSyncTradeSettingsCustomers",
|
|
405
|
+
"methods": [
|
|
406
|
+
"POST"
|
|
407
|
+
]
|
|
408
|
+
},
|
|
409
|
+
{
|
|
410
|
+
"routePath": "/api/public/cron/sync-floriday-warehouses",
|
|
411
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
412
|
+
"handler": "handleSyncWarehouses",
|
|
413
|
+
"methods": [
|
|
414
|
+
"POST"
|
|
415
|
+
]
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
"routePath": "/api/public/cron/sync-floriday-connections",
|
|
419
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
420
|
+
"handler": "handleSyncFloridayConnections",
|
|
421
|
+
"methods": [
|
|
422
|
+
"POST"
|
|
423
|
+
]
|
|
424
|
+
},
|
|
425
|
+
{
|
|
426
|
+
"routePath": "/api/public/cron/sync-floricode-all",
|
|
427
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
428
|
+
"handler": "handleSyncFloricodeAll",
|
|
429
|
+
"methods": [
|
|
430
|
+
"POST"
|
|
431
|
+
]
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"routePath": "/api/public/cron/sync-floricode-regulatory-features",
|
|
435
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
436
|
+
"handler": "handleSyncFloricodeRegulatoryFeatures",
|
|
437
|
+
"methods": [
|
|
438
|
+
"POST"
|
|
439
|
+
]
|
|
440
|
+
},
|
|
441
|
+
{
|
|
442
|
+
"routePath": "/api/public/cron/refresh-floricode-codelists",
|
|
443
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
444
|
+
"handler": "handleRefreshFloricodeCodelists",
|
|
445
|
+
"methods": [
|
|
446
|
+
"POST"
|
|
447
|
+
]
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"routePath": "/api/public/cron/refresh-floriday-reference-data",
|
|
451
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
452
|
+
"handler": "handleRefreshFlorydayReferenceData",
|
|
453
|
+
"methods": [
|
|
454
|
+
"POST"
|
|
455
|
+
]
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
"routePath": "/api/public/cron/refresh-floriday-tokens",
|
|
459
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
460
|
+
"handler": "handleRefreshFlorydayTokens",
|
|
461
|
+
"methods": [
|
|
462
|
+
"POST"
|
|
463
|
+
]
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
"routePath": "/api/public/cron/verify-floricode-characteristics-coverage",
|
|
467
|
+
"import": "@flowselections/floriday-authenticatie-module/cron",
|
|
468
|
+
"handler": "handleVerifyFloricodeCharacteristicsCoverage",
|
|
469
|
+
"methods": [
|
|
470
|
+
"POST"
|
|
471
|
+
]
|
|
472
|
+
}
|
|
473
|
+
]
|
|
474
|
+
}
|
|
475
|
+
}
|