@flowselections/logistiek-engine 1.0.177 → 1.0.181
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/db/schema/logistiek-engine.sql +850 -0
- package/dist-lib/components/BeladingIndelingCard.d.ts.map +1 -1
- package/dist-lib/components/BeladingIndelingCard.js +2 -0
- package/dist-lib/integrations/supabase/previewAuthStorage.d.ts +11 -5
- package/dist-lib/integrations/supabase/previewAuthStorage.d.ts.map +1 -1
- package/dist-lib/integrations/supabase/previewAuthStorage.js +38 -21
- package/dist-lib/integrations/supabase/types.d.ts +137 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/beladingRegels.d.ts +78 -0
- package/dist-lib/lib/beladingRegels.d.ts.map +1 -0
- package/dist-lib/lib/beladingRegels.js +143 -0
- package/dist-lib/lib/bulkLoadCarrierPlanning.server.js +2 -2
- package/dist-lib/lib/eigenTraysticker.d.ts +17 -0
- package/dist-lib/lib/eigenTraysticker.d.ts.map +1 -0
- package/dist-lib/lib/eigenTraysticker.js +32 -0
- package/dist-lib/lib/loadCarrierPlanning.server.d.ts +35 -3
- package/dist-lib/lib/loadCarrierPlanning.server.d.ts.map +1 -1
- package/dist-lib/lib/loadCarrierPlanning.server.js +251 -89
- package/dist-lib/lib/modulePrompts.d.ts.map +1 -1
- package/dist-lib/lib/modulePrompts.js +76 -0
- package/dist-lib/lib/moduleVersion.d.ts +1 -1
- package/dist-lib/lib/moduleVersion.js +1 -1
- package/dist-lib/lib/planQueue.server.d.ts.map +1 -1
- package/dist-lib/lib/planQueue.server.js +26 -2
- package/dist-lib/lib/stickerQueue.server.d.ts +1 -1
- package/dist-lib/lib/stickerQueue.server.d.ts.map +1 -1
- package/dist-lib/lib/stickerQueue.server.js +88 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BeladingIndelingCard.d.ts","sourceRoot":"","sources":["../../src/components/BeladingIndelingCard.tsx"],"names":[],"mappings":"AAoCA,wBAAgB,oBAAoB,
|
|
1
|
+
{"version":3,"file":"BeladingIndelingCard.d.ts","sourceRoot":"","sources":["../../src/components/BeladingIndelingCard.tsx"],"names":[],"mappings":"AAoCA,wBAAgB,oBAAoB,gCAoJnC"}
|
|
@@ -48,6 +48,8 @@ export function BeladingIndelingCard() {
|
|
|
48
48
|
setWarnings(Array.isArray(result?.warnings) ? result.warnings : []);
|
|
49
49
|
if (result?.skipped === "locked")
|
|
50
50
|
toast.info("Deze buffer is vergrendeld en wordt niet herplaatst.");
|
|
51
|
+
if (result?.skipped === "busy")
|
|
52
|
+
toast.info("Deze buffer wordt op dit moment al ingedeeld; probeer het zo opnieuw.");
|
|
51
53
|
else
|
|
52
54
|
toast.success(`${list.length} ladingdragers berekend`);
|
|
53
55
|
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
/** Storage accepted by Supabase's `auth.storage` option; `localStorage` and the editor broker both satisfy it. */
|
|
2
|
+
export interface PreviewAuthStorage {
|
|
3
|
+
getItem: (key: string) => string | null | Promise<string | null>;
|
|
4
|
+
setItem: (key: string, value: string) => void | Promise<void>;
|
|
5
|
+
removeItem: (key: string) => void | Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* On a Lovable preview surface, broker the auth session to the editor over
|
|
9
|
+
* postMessage so the project's preview surfaces share one login; else localStorage.
|
|
10
|
+
*/
|
|
11
|
+
export declare function brokeredPreviewStorage(): PreviewAuthStorage | undefined;
|
|
6
12
|
//# sourceMappingURL=previewAuthStorage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"previewAuthStorage.d.ts","sourceRoot":"","sources":["../../../src/integrations/supabase/previewAuthStorage.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"previewAuthStorage.d.ts","sourceRoot":"","sources":["../../../src/integrations/supabase/previewAuthStorage.ts"],"names":[],"mappings":"AAEA,kHAAkH;AAClH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;IACjE,OAAO,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAC9D,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACnD;AA6BD;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,kBAAkB,GAAG,SAAS,CAsGvE"}
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
// This file is automatically generated. Do not edit it directly.
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
const RESULT = 'lovable-preview-auth:result';
|
|
3
|
+
function readBrokerReply(data, requestId) {
|
|
4
|
+
if (typeof data !== 'object' || data === null)
|
|
5
|
+
return null;
|
|
6
|
+
if (!('type' in data) || data.type !== RESULT)
|
|
7
|
+
return null;
|
|
8
|
+
if (!('requestId' in data) || data.requestId !== requestId)
|
|
9
|
+
return null;
|
|
10
|
+
return {
|
|
11
|
+
ok: 'ok' in data && Boolean(data.ok),
|
|
12
|
+
value: 'value' in data && typeof data.value === 'string' ? data.value : null,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* On a Lovable preview surface, broker the auth session to the editor over
|
|
17
|
+
* postMessage so the project's preview surfaces share one login; else localStorage.
|
|
18
|
+
*/
|
|
4
19
|
export function brokeredPreviewStorage() {
|
|
5
20
|
if (typeof window === 'undefined')
|
|
6
21
|
return undefined;
|
|
@@ -11,10 +26,13 @@ export function brokeredPreviewStorage() {
|
|
|
11
26
|
// preview--<name> host can't smuggle another project's id.
|
|
12
27
|
const UUID = '[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}';
|
|
13
28
|
const projectId = onPreviewZone
|
|
14
|
-
? (
|
|
15
|
-
??
|
|
29
|
+
? (new RegExp('^(?:id-preview(?:-[a-z0-9]+)?|project)--(' + UUID + ')(?:-dev)?(?=\\.|$)', 'i').exec(host)?.[1]
|
|
30
|
+
?? new RegExp('^(' + UUID + ')(?=[.-])', 'i').exec(host)?.[1])
|
|
16
31
|
: undefined;
|
|
17
|
-
|
|
32
|
+
// lib.dom types window.parent and location.ancestorOrigins as always set, but a
|
|
33
|
+
// detached frame has no parent and not every browser implements ancestorOrigins.
|
|
34
|
+
const parentWindow = window.parent;
|
|
35
|
+
const framed = parentWindow !== null && parentWindow !== window;
|
|
18
36
|
if (!projectId || !framed)
|
|
19
37
|
return localStorage;
|
|
20
38
|
// Post only to the real editor ancestor, validated as a Lovable origin, so the
|
|
@@ -23,40 +41,39 @@ export function brokeredPreviewStorage() {
|
|
|
23
41
|
const EDITOR = dev
|
|
24
42
|
? /^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/
|
|
25
43
|
: /^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/;
|
|
26
|
-
const
|
|
44
|
+
const ancestorOrigins = location.ancestorOrigins;
|
|
45
|
+
const ancestor = ancestorOrigins?.[0] ?? (document.referrer ? new URL(document.referrer).origin : '');
|
|
27
46
|
const editorOrigins = ancestor && EDITOR.test(ancestor)
|
|
28
47
|
? [ancestor]
|
|
29
48
|
: (dev ? ['https://lovable.dev', 'http://localhost:3000'] : ['https://lovable.dev']);
|
|
30
|
-
const RESULT = 'lovable-preview-auth:result';
|
|
31
49
|
const TIMEOUT = 2000;
|
|
32
50
|
const newId = () => Math.random().toString(36).slice(2) + Date.now().toString(36);
|
|
33
51
|
const request = (type, key, value) => new Promise((resolve) => {
|
|
34
52
|
const requestId = newId();
|
|
35
53
|
let done = false;
|
|
36
|
-
|
|
37
|
-
const finish = (r) => {
|
|
54
|
+
const finish = (reply) => {
|
|
38
55
|
if (done)
|
|
39
56
|
return;
|
|
40
57
|
done = true;
|
|
41
58
|
clearTimeout(timer);
|
|
42
59
|
window.removeEventListener('message', onMessage);
|
|
43
|
-
resolve(
|
|
60
|
+
resolve(reply);
|
|
44
61
|
};
|
|
45
62
|
const onMessage = (e) => {
|
|
46
|
-
if (editorOrigins.
|
|
63
|
+
if (!editorOrigins.includes(e.origin))
|
|
47
64
|
return;
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
finish(
|
|
65
|
+
const reply = readBrokerReply(e.data, requestId);
|
|
66
|
+
if (reply)
|
|
67
|
+
finish(reply);
|
|
51
68
|
};
|
|
52
69
|
window.addEventListener('message', onMessage);
|
|
70
|
+
const timer = setTimeout(() => { finish(null); }, TIMEOUT);
|
|
53
71
|
const msg = { type, requestId, projectId, key };
|
|
54
72
|
if (value !== undefined)
|
|
55
|
-
msg
|
|
73
|
+
msg.value = value;
|
|
56
74
|
// targetOrigin per trusted editor origin, so a session token never reaches an arbitrary embedder.
|
|
57
75
|
for (const origin of editorOrigins)
|
|
58
76
|
window.parent.postMessage(msg, origin);
|
|
59
|
-
timer = setTimeout(() => finish(null), TIMEOUT);
|
|
60
77
|
});
|
|
61
78
|
// The editor may not be listening yet at the first getItem, so retry once.
|
|
62
79
|
let firstGet = true;
|
|
@@ -74,13 +91,13 @@ export function brokeredPreviewStorage() {
|
|
|
74
91
|
const local = readLocal(key);
|
|
75
92
|
let res = await request('lovable-preview-auth:get', key, local ?? undefined);
|
|
76
93
|
if (!res && firstGet) {
|
|
77
|
-
await new Promise((
|
|
94
|
+
await new Promise((resolve) => setTimeout(resolve, RETRY_DELAY));
|
|
78
95
|
res = await request('lovable-preview-auth:get', key, local ?? undefined);
|
|
79
96
|
}
|
|
80
97
|
firstGet = false;
|
|
81
98
|
// '' is the logout tombstone: clear the local copy too so it can't resurrect if
|
|
82
|
-
// the broker later goes silent. A null
|
|
83
|
-
if (res
|
|
99
|
+
// the broker later goes silent. A null value means never-synced -> keep local.
|
|
100
|
+
if (res?.ok && res.value !== null) {
|
|
84
101
|
if (res.value === '') {
|
|
85
102
|
if (local !== undefined && readLocal(key) === local)
|
|
86
103
|
localStorage.removeItem(key);
|
|
@@ -100,7 +117,7 @@ export function brokeredPreviewStorage() {
|
|
|
100
117
|
setItem: (key, value) => {
|
|
101
118
|
localStorage.setItem(key, value);
|
|
102
119
|
return request('lovable-preview-auth:set', key, value).then((res) => {
|
|
103
|
-
if (res
|
|
120
|
+
if (res?.ok && res.value !== null && localStorage.getItem(key) === value) {
|
|
104
121
|
if (res.value === '')
|
|
105
122
|
localStorage.removeItem(key);
|
|
106
123
|
else
|
|
@@ -111,7 +128,7 @@ export function brokeredPreviewStorage() {
|
|
|
111
128
|
removeItem: (key) => {
|
|
112
129
|
const local = readLocal(key);
|
|
113
130
|
localStorage.removeItem(key);
|
|
114
|
-
return request('lovable-preview-auth:remove', key, local ?? undefined).then(() =>
|
|
131
|
+
return request('lovable-preview-auth:remove', key, local ?? undefined).then(() => { });
|
|
115
132
|
},
|
|
116
133
|
};
|
|
117
134
|
}
|
|
@@ -1531,6 +1531,7 @@ export type Database = {
|
|
|
1531
1531
|
cart_numbers: {
|
|
1532
1532
|
Row: {
|
|
1533
1533
|
assigned_at: string;
|
|
1534
|
+
cart_id: string | null;
|
|
1534
1535
|
cart_index: number;
|
|
1535
1536
|
cart_number: string;
|
|
1536
1537
|
day_seq: number | null;
|
|
@@ -1544,6 +1545,7 @@ export type Database = {
|
|
|
1544
1545
|
};
|
|
1545
1546
|
Insert: {
|
|
1546
1547
|
assigned_at?: string;
|
|
1548
|
+
cart_id?: string | null;
|
|
1547
1549
|
cart_index: number;
|
|
1548
1550
|
cart_number: string;
|
|
1549
1551
|
day_seq?: number | null;
|
|
@@ -1557,6 +1559,7 @@ export type Database = {
|
|
|
1557
1559
|
};
|
|
1558
1560
|
Update: {
|
|
1559
1561
|
assigned_at?: string;
|
|
1562
|
+
cart_id?: string | null;
|
|
1560
1563
|
cart_index?: number;
|
|
1561
1564
|
cart_number?: string;
|
|
1562
1565
|
day_seq?: number | null;
|
|
@@ -8206,6 +8209,53 @@ export type Database = {
|
|
|
8206
8209
|
};
|
|
8207
8210
|
Relationships: [];
|
|
8208
8211
|
};
|
|
8212
|
+
floriday_packing_mismatches: {
|
|
8213
|
+
Row: {
|
|
8214
|
+
api_value: Json | null;
|
|
8215
|
+
cache_value: Json | null;
|
|
8216
|
+
connection_id: string;
|
|
8217
|
+
details: string | null;
|
|
8218
|
+
detected_at: string;
|
|
8219
|
+
entity: string;
|
|
8220
|
+
floriday_id: string;
|
|
8221
|
+
id: string;
|
|
8222
|
+
last_checked_at: string;
|
|
8223
|
+
resolved_at: string | null;
|
|
8224
|
+
};
|
|
8225
|
+
Insert: {
|
|
8226
|
+
api_value?: Json | null;
|
|
8227
|
+
cache_value?: Json | null;
|
|
8228
|
+
connection_id: string;
|
|
8229
|
+
details?: string | null;
|
|
8230
|
+
detected_at?: string;
|
|
8231
|
+
entity: string;
|
|
8232
|
+
floriday_id: string;
|
|
8233
|
+
id?: string;
|
|
8234
|
+
last_checked_at?: string;
|
|
8235
|
+
resolved_at?: string | null;
|
|
8236
|
+
};
|
|
8237
|
+
Update: {
|
|
8238
|
+
api_value?: Json | null;
|
|
8239
|
+
cache_value?: Json | null;
|
|
8240
|
+
connection_id?: string;
|
|
8241
|
+
details?: string | null;
|
|
8242
|
+
detected_at?: string;
|
|
8243
|
+
entity?: string;
|
|
8244
|
+
floriday_id?: string;
|
|
8245
|
+
id?: string;
|
|
8246
|
+
last_checked_at?: string;
|
|
8247
|
+
resolved_at?: string | null;
|
|
8248
|
+
};
|
|
8249
|
+
Relationships: [
|
|
8250
|
+
{
|
|
8251
|
+
foreignKeyName: "floriday_packing_mismatches_connection_id_fkey";
|
|
8252
|
+
columns: ["connection_id"];
|
|
8253
|
+
isOneToOne: false;
|
|
8254
|
+
referencedRelation: "floriday_connections";
|
|
8255
|
+
referencedColumns: ["id"];
|
|
8256
|
+
}
|
|
8257
|
+
];
|
|
8258
|
+
};
|
|
8209
8259
|
floriday_packings_cache: {
|
|
8210
8260
|
Row: {
|
|
8211
8261
|
connection_id: string;
|
|
@@ -12149,6 +12199,36 @@ export type Database = {
|
|
|
12149
12199
|
};
|
|
12150
12200
|
Relationships: [];
|
|
12151
12201
|
};
|
|
12202
|
+
logistics_belading_bevestigingen: {
|
|
12203
|
+
Row: {
|
|
12204
|
+
bevestigd_door: string | null;
|
|
12205
|
+
bevestigd_op: string;
|
|
12206
|
+
created_at: string;
|
|
12207
|
+
id: string;
|
|
12208
|
+
order_id: string;
|
|
12209
|
+
redenen: string[];
|
|
12210
|
+
verpakking_sleutel: string;
|
|
12211
|
+
};
|
|
12212
|
+
Insert: {
|
|
12213
|
+
bevestigd_door?: string | null;
|
|
12214
|
+
bevestigd_op?: string;
|
|
12215
|
+
created_at?: string;
|
|
12216
|
+
id?: string;
|
|
12217
|
+
order_id: string;
|
|
12218
|
+
redenen?: string[];
|
|
12219
|
+
verpakking_sleutel: string;
|
|
12220
|
+
};
|
|
12221
|
+
Update: {
|
|
12222
|
+
bevestigd_door?: string | null;
|
|
12223
|
+
bevestigd_op?: string;
|
|
12224
|
+
created_at?: string;
|
|
12225
|
+
id?: string;
|
|
12226
|
+
order_id?: string;
|
|
12227
|
+
redenen?: string[];
|
|
12228
|
+
verpakking_sleutel?: string;
|
|
12229
|
+
};
|
|
12230
|
+
Relationships: [];
|
|
12231
|
+
};
|
|
12152
12232
|
logistics_capacity_alerts: {
|
|
12153
12233
|
Row: {
|
|
12154
12234
|
available_minutes: number;
|
|
@@ -30453,6 +30533,8 @@ export type Database = {
|
|
|
30453
30533
|
cart_index: number;
|
|
30454
30534
|
cart_number: string;
|
|
30455
30535
|
cart_number_id: string;
|
|
30536
|
+
country_code: string;
|
|
30537
|
+
crates_on_cart: number;
|
|
30456
30538
|
order_id: string;
|
|
30457
30539
|
order_number: string;
|
|
30458
30540
|
order_source: string;
|
|
@@ -32268,6 +32350,14 @@ export type Database = {
|
|
|
32268
32350
|
Args: never;
|
|
32269
32351
|
Returns: number;
|
|
32270
32352
|
};
|
|
32353
|
+
logistics_belading_bevestig: {
|
|
32354
|
+
Args: {
|
|
32355
|
+
p_order_id: string;
|
|
32356
|
+
p_redenen?: string[];
|
|
32357
|
+
p_sleutel: string;
|
|
32358
|
+
};
|
|
32359
|
+
Returns: Json;
|
|
32360
|
+
};
|
|
32271
32361
|
logistics_belading_verstuurder: {
|
|
32272
32362
|
Args: never;
|
|
32273
32363
|
Returns: string;
|
|
@@ -32654,6 +32744,16 @@ export type Database = {
|
|
|
32654
32744
|
order_uuid: string;
|
|
32655
32745
|
}[];
|
|
32656
32746
|
};
|
|
32747
|
+
logistics_cart_seq_dubbel: {
|
|
32748
|
+
Args: {
|
|
32749
|
+
p_order_uuid?: string;
|
|
32750
|
+
};
|
|
32751
|
+
Returns: {
|
|
32752
|
+
cart_ids: string[];
|
|
32753
|
+
cart_index: number;
|
|
32754
|
+
order_uuid: string;
|
|
32755
|
+
}[];
|
|
32756
|
+
};
|
|
32657
32757
|
logistics_cart_slip_plan: {
|
|
32658
32758
|
Args: {
|
|
32659
32759
|
p_order_id: string;
|
|
@@ -33946,6 +34046,18 @@ export type Database = {
|
|
|
33946
34046
|
};
|
|
33947
34047
|
Returns: Json;
|
|
33948
34048
|
};
|
|
34049
|
+
logistics_own_traysticker_payload: {
|
|
34050
|
+
Args: {
|
|
34051
|
+
p_id: string;
|
|
34052
|
+
};
|
|
34053
|
+
Returns: Json;
|
|
34054
|
+
};
|
|
34055
|
+
logistics_own_traysticker_sync: {
|
|
34056
|
+
Args: {
|
|
34057
|
+
p_limit?: number;
|
|
34058
|
+
};
|
|
34059
|
+
Returns: Json;
|
|
34060
|
+
};
|
|
33949
34061
|
logistics_packing_autofix: {
|
|
33950
34062
|
Args: {
|
|
33951
34063
|
p_limit?: number;
|
|
@@ -34246,6 +34358,15 @@ export type Database = {
|
|
|
34246
34358
|
Args: never;
|
|
34247
34359
|
Returns: number;
|
|
34248
34360
|
};
|
|
34361
|
+
logistics_plan_queue_dubbel: {
|
|
34362
|
+
Args: never;
|
|
34363
|
+
Returns: {
|
|
34364
|
+
nieuwste: string;
|
|
34365
|
+
open_opdrachten: number;
|
|
34366
|
+
order_id: string;
|
|
34367
|
+
oudste: string;
|
|
34368
|
+
}[];
|
|
34369
|
+
};
|
|
34249
34370
|
logistics_plan_queue_list: {
|
|
34250
34371
|
Args: {
|
|
34251
34372
|
p_limit?: number;
|
|
@@ -34287,6 +34408,13 @@ export type Database = {
|
|
|
34287
34408
|
};
|
|
34288
34409
|
Returns: number;
|
|
34289
34410
|
};
|
|
34411
|
+
logistics_plan_retry_later: {
|
|
34412
|
+
Args: {
|
|
34413
|
+
p_id: string;
|
|
34414
|
+
p_seconds?: number;
|
|
34415
|
+
};
|
|
34416
|
+
Returns: undefined;
|
|
34417
|
+
};
|
|
34290
34418
|
logistics_plan_setting: {
|
|
34291
34419
|
Args: {
|
|
34292
34420
|
p_default: number;
|
|
@@ -35321,6 +35449,15 @@ export type Database = {
|
|
|
35321
35449
|
};
|
|
35322
35450
|
Returns: Json;
|
|
35323
35451
|
};
|
|
35452
|
+
logistics_tray_plants: {
|
|
35453
|
+
Args: {
|
|
35454
|
+
p_fust: number;
|
|
35455
|
+
p_fusten: number;
|
|
35456
|
+
p_ppc: number;
|
|
35457
|
+
p_regel_totaal: number;
|
|
35458
|
+
};
|
|
35459
|
+
Returns: number;
|
|
35460
|
+
};
|
|
35324
35461
|
logistics_try_uuid: {
|
|
35325
35462
|
Args: {
|
|
35326
35463
|
p: string;
|