@flowselections/logistiek-engine 1.0.12 → 1.0.14

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.
Files changed (37) hide show
  1. package/dist-lib/components/FloridayPushCard.d.ts.map +1 -1
  2. package/dist-lib/components/FloridayPushCard.js +7 -2
  3. package/dist-lib/components/PrintjobsCard.d.ts.map +1 -1
  4. package/dist-lib/components/PrintjobsCard.js +3 -1
  5. package/dist-lib/hooks/useFloridayPushes.d.ts +7 -0
  6. package/dist-lib/hooks/useFloridayPushes.d.ts.map +1 -1
  7. package/dist-lib/hooks/useFloridayPushes.js +11 -0
  8. package/dist-lib/hooks/usePrintjobs.d.ts +1 -0
  9. package/dist-lib/hooks/usePrintjobs.d.ts.map +1 -1
  10. package/dist-lib/hooks/usePrintjobs.js +17 -1
  11. package/dist-lib/integrations/supabase/auth-middleware.d.ts +292 -0
  12. package/dist-lib/integrations/supabase/auth-middleware.d.ts.map +1 -1
  13. package/dist-lib/integrations/supabase/client.server.d.ts +292 -0
  14. package/dist-lib/integrations/supabase/client.server.d.ts.map +1 -1
  15. package/dist-lib/integrations/supabase/moduleClient.d.ts +292 -0
  16. package/dist-lib/integrations/supabase/moduleClient.d.ts.map +1 -1
  17. package/dist-lib/integrations/supabase/previewAuthStorage.d.ts +6 -0
  18. package/dist-lib/integrations/supabase/previewAuthStorage.d.ts.map +1 -0
  19. package/dist-lib/integrations/supabase/previewAuthStorage.js +92 -0
  20. package/dist-lib/integrations/supabase/types.d.ts +299 -0
  21. package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
  22. package/dist-lib/lib/floridayDocuments.functions.d.ts +876 -0
  23. package/dist-lib/lib/floridayDocuments.functions.d.ts.map +1 -1
  24. package/dist-lib/lib/floridayPush.functions.d.ts +292 -0
  25. package/dist-lib/lib/floridayPush.functions.d.ts.map +1 -1
  26. package/dist-lib/lib/floridayPush.server.d.ts +39 -21
  27. package/dist-lib/lib/floridayPush.server.d.ts.map +1 -1
  28. package/dist-lib/lib/floridayPush.server.js +156 -49
  29. package/dist-lib/lib/loadCarrierPlanning.functions.d.ts +1460 -0
  30. package/dist-lib/lib/loadCarrierPlanning.functions.d.ts.map +1 -1
  31. package/dist-lib/lib/logisticsRecalcJob.functions.d.ts +584 -0
  32. package/dist-lib/lib/logisticsRecalcJob.functions.d.ts.map +1 -1
  33. package/dist-lib/lib/logisticsRecalculate.functions.d.ts +292 -0
  34. package/dist-lib/lib/logisticsRecalculate.functions.d.ts.map +1 -1
  35. package/dist-lib/lib/modulePrompts.d.ts.map +1 -1
  36. package/dist-lib/lib/modulePrompts.js +39 -0
  37. package/package.json +1 -1
@@ -0,0 +1,92 @@
1
+ // This file is automatically generated. Do not edit it directly.
2
+ // On a Lovable preview surface, broker the auth session to the editor over
3
+ // postMessage so the project's preview surfaces share one login; else localStorage.
4
+ export function brokeredPreviewStorage() {
5
+ if (typeof window === 'undefined')
6
+ return undefined;
7
+ const host = location.hostname;
8
+ const PREVIEW_ZONES = ['lovableproject.com', 'lovableproject-dev.com', 'lovable.app', 'gpt-eng.com', 'gptengineer.run'];
9
+ const onPreviewZone = PREVIEW_ZONES.some((z) => host === z || host.endsWith('.' + z));
10
+ // Read the id only from non-user-controlled host positions, so a user-named
11
+ // preview--<name> host can't smuggle another project's id.
12
+ 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
+ const projectId = onPreviewZone
14
+ ? (host.match(new RegExp('^(?:id-preview(?:-[a-z0-9]+)?|project)--(' + UUID + ')(?:-dev)?(?=\\.|$)', 'i'))?.[1]
15
+ ?? host.match(new RegExp('^(' + UUID + ')(?=[.-])', 'i'))?.[1])
16
+ : undefined;
17
+ const framed = window.parent && window.parent !== window;
18
+ if (!projectId || !framed)
19
+ return localStorage;
20
+ // Post only to the real editor ancestor, validated as a Lovable origin, so the
21
+ // session token can never reach an untrusted embedder.
22
+ const dev = host.endsWith('.lovableproject-dev.com') || host.endsWith('.gpt-eng.com');
23
+ const EDITOR = dev
24
+ ? /^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$|^http:\/\/localhost:3000$/
25
+ : /^https:\/\/([a-z0-9-]+\.)*(lovable\.dev|gptengineer\.app)$/;
26
+ const ancestor = (location.ancestorOrigins && location.ancestorOrigins[0]) || (document.referrer ? new URL(document.referrer).origin : '');
27
+ const editorOrigins = ancestor && EDITOR.test(ancestor)
28
+ ? [ancestor]
29
+ : (dev ? ['https://lovable.dev', 'http://localhost:3000'] : ['https://lovable.dev']);
30
+ const RESULT = 'lovable-preview-auth:result';
31
+ const TIMEOUT = 2000;
32
+ const newId = () => Math.random().toString(36).slice(2) + Date.now().toString(36);
33
+ const request = (type, key, value) => new Promise((resolve) => {
34
+ const requestId = newId();
35
+ let done = false;
36
+ let timer;
37
+ const finish = (r) => {
38
+ if (done)
39
+ return;
40
+ done = true;
41
+ clearTimeout(timer);
42
+ window.removeEventListener('message', onMessage);
43
+ resolve(r);
44
+ };
45
+ const onMessage = (e) => {
46
+ if (editorOrigins.indexOf(e.origin) < 0)
47
+ return;
48
+ const d = e.data;
49
+ if (d && d.type === RESULT && d.requestId === requestId)
50
+ finish(d);
51
+ };
52
+ window.addEventListener('message', onMessage);
53
+ const msg = { type, requestId, projectId, key };
54
+ if (value !== undefined)
55
+ msg['value'] = value;
56
+ // targetOrigin per trusted editor origin, so a session token never reaches an arbitrary embedder.
57
+ for (const origin of editorOrigins)
58
+ window.parent.postMessage(msg, origin);
59
+ timer = setTimeout(() => finish(null), TIMEOUT);
60
+ });
61
+ // The editor may not be listening yet at the first getItem, so retry once.
62
+ let firstGet = true;
63
+ const RETRY_DELAY = 250;
64
+ return {
65
+ getItem: async (key) => {
66
+ let res = await request('lovable-preview-auth:get', key);
67
+ if (!res && firstGet) {
68
+ await new Promise((r) => setTimeout(r, RETRY_DELAY));
69
+ res = await request('lovable-preview-auth:get', key);
70
+ }
71
+ firstGet = false;
72
+ // '' is the logout tombstone: clear the local copy too so it can't resurrect if
73
+ // the broker later goes silent. A null reply means never-synced -> keep local.
74
+ if (res && res.ok && typeof res.value === 'string') {
75
+ if (res.value === '') {
76
+ localStorage.removeItem(key);
77
+ return null;
78
+ }
79
+ return res.value;
80
+ }
81
+ return localStorage.getItem(key);
82
+ },
83
+ setItem: (key, value) => {
84
+ localStorage.setItem(key, value);
85
+ return request('lovable-preview-auth:set', key, value).then(() => undefined);
86
+ },
87
+ removeItem: (key) => {
88
+ localStorage.removeItem(key);
89
+ return request('lovable-preview-auth:remove', key).then(() => undefined);
90
+ },
91
+ };
92
+ }
@@ -692,6 +692,99 @@ export type Database = {
692
692
  };
693
693
  Relationships: [];
694
694
  };
695
+ artikelen_cache: {
696
+ Row: {
697
+ artikelcode: string;
698
+ bron: string;
699
+ bruto_prijs_cent: number | null;
700
+ created_at: string;
701
+ eenheid: string;
702
+ fabrikant: string | null;
703
+ fetched_at: string;
704
+ gtin: string | null;
705
+ id: string;
706
+ naam: string;
707
+ netto_prijs_cent: number | null;
708
+ omschrijving: string | null;
709
+ raw: Json;
710
+ updated_at: string;
711
+ valuta: string;
712
+ };
713
+ Insert: {
714
+ artikelcode: string;
715
+ bron?: string;
716
+ bruto_prijs_cent?: number | null;
717
+ created_at?: string;
718
+ eenheid?: string;
719
+ fabrikant?: string | null;
720
+ fetched_at?: string;
721
+ gtin?: string | null;
722
+ id?: string;
723
+ naam: string;
724
+ netto_prijs_cent?: number | null;
725
+ omschrijving?: string | null;
726
+ raw?: Json;
727
+ updated_at?: string;
728
+ valuta?: string;
729
+ };
730
+ Update: {
731
+ artikelcode?: string;
732
+ bron?: string;
733
+ bruto_prijs_cent?: number | null;
734
+ created_at?: string;
735
+ eenheid?: string;
736
+ fabrikant?: string | null;
737
+ fetched_at?: string;
738
+ gtin?: string | null;
739
+ id?: string;
740
+ naam?: string;
741
+ netto_prijs_cent?: number | null;
742
+ omschrijving?: string | null;
743
+ raw?: Json;
744
+ updated_at?: string;
745
+ valuta?: string;
746
+ };
747
+ Relationships: [];
748
+ };
749
+ artikelen_veldconfig: {
750
+ Row: {
751
+ bron_pad: string;
752
+ created_at: string;
753
+ id: string;
754
+ label: string;
755
+ sort_order: number;
756
+ type: string;
757
+ updated_at: string;
758
+ veld_key: string;
759
+ zichtbaar_in_detail: boolean;
760
+ zichtbaar_in_lijst: boolean;
761
+ };
762
+ Insert: {
763
+ bron_pad: string;
764
+ created_at?: string;
765
+ id?: string;
766
+ label: string;
767
+ sort_order?: number;
768
+ type?: string;
769
+ updated_at?: string;
770
+ veld_key: string;
771
+ zichtbaar_in_detail?: boolean;
772
+ zichtbaar_in_lijst?: boolean;
773
+ };
774
+ Update: {
775
+ bron_pad?: string;
776
+ created_at?: string;
777
+ id?: string;
778
+ label?: string;
779
+ sort_order?: number;
780
+ type?: string;
781
+ updated_at?: string;
782
+ veld_key?: string;
783
+ zichtbaar_in_detail?: boolean;
784
+ zichtbaar_in_lijst?: boolean;
785
+ };
786
+ Relationships: [];
787
+ };
695
788
  booking_items: {
696
789
  Row: {
697
790
  booking_id: string;
@@ -3220,6 +3313,51 @@ export type Database = {
3220
3313
  };
3221
3314
  Relationships: [];
3222
3315
  };
3316
+ document_printplek_printers: {
3317
+ Row: {
3318
+ created_at: string;
3319
+ documenttype: string;
3320
+ id: string;
3321
+ papierformaat: string | null;
3322
+ print_plek_id: string;
3323
+ printer_id: string | null;
3324
+ updated_at: string;
3325
+ };
3326
+ Insert: {
3327
+ created_at?: string;
3328
+ documenttype: string;
3329
+ id?: string;
3330
+ papierformaat?: string | null;
3331
+ print_plek_id: string;
3332
+ printer_id?: string | null;
3333
+ updated_at?: string;
3334
+ };
3335
+ Update: {
3336
+ created_at?: string;
3337
+ documenttype?: string;
3338
+ id?: string;
3339
+ papierformaat?: string | null;
3340
+ print_plek_id?: string;
3341
+ printer_id?: string | null;
3342
+ updated_at?: string;
3343
+ };
3344
+ Relationships: [
3345
+ {
3346
+ foreignKeyName: "document_printplek_printers_print_plek_id_fkey";
3347
+ columns: ["print_plek_id"];
3348
+ isOneToOne: false;
3349
+ referencedRelation: "print_plekken";
3350
+ referencedColumns: ["id"];
3351
+ },
3352
+ {
3353
+ foreignKeyName: "document_printplek_printers_printer_id_fkey";
3354
+ columns: ["printer_id"];
3355
+ isOneToOne: false;
3356
+ referencedRelation: "printers";
3357
+ referencedColumns: ["id"];
3358
+ }
3359
+ ];
3360
+ };
3223
3361
  document_werkplek_printers: {
3224
3362
  Row: {
3225
3363
  created_at: string;
@@ -9379,6 +9517,7 @@ export type Database = {
9379
9517
  last_error_at: string | null;
9380
9518
  last_error_code: string | null;
9381
9519
  last_gateway_status: number | null;
9520
+ last_queued_at: string | null;
9382
9521
  last_response: Json | null;
9383
9522
  last_sent_hash: string | null;
9384
9523
  locked_by: string | null;
@@ -9402,6 +9541,7 @@ export type Database = {
9402
9541
  last_error_at?: string | null;
9403
9542
  last_error_code?: string | null;
9404
9543
  last_gateway_status?: number | null;
9544
+ last_queued_at?: string | null;
9405
9545
  last_response?: Json | null;
9406
9546
  last_sent_hash?: string | null;
9407
9547
  locked_by?: string | null;
@@ -9425,6 +9565,7 @@ export type Database = {
9425
9565
  last_error_at?: string | null;
9426
9566
  last_error_code?: string | null;
9427
9567
  last_gateway_status?: number | null;
9568
+ last_queued_at?: string | null;
9428
9569
  last_response?: Json | null;
9429
9570
  last_sent_hash?: string | null;
9430
9571
  locked_by?: string | null;
@@ -13722,6 +13863,103 @@ export type Database = {
13722
13863
  }
13723
13864
  ];
13724
13865
  };
13866
+ print_plek_computers: {
13867
+ Row: {
13868
+ computer_naam: string;
13869
+ created_at: string;
13870
+ id: string;
13871
+ print_plek_id: string;
13872
+ updated_at: string;
13873
+ };
13874
+ Insert: {
13875
+ computer_naam: string;
13876
+ created_at?: string;
13877
+ id?: string;
13878
+ print_plek_id: string;
13879
+ updated_at?: string;
13880
+ };
13881
+ Update: {
13882
+ computer_naam?: string;
13883
+ created_at?: string;
13884
+ id?: string;
13885
+ print_plek_id?: string;
13886
+ updated_at?: string;
13887
+ };
13888
+ Relationships: [
13889
+ {
13890
+ foreignKeyName: "print_plek_computers_print_plek_id_fkey";
13891
+ columns: ["print_plek_id"];
13892
+ isOneToOne: false;
13893
+ referencedRelation: "print_plekken";
13894
+ referencedColumns: ["id"];
13895
+ }
13896
+ ];
13897
+ };
13898
+ print_plek_koppelingen: {
13899
+ Row: {
13900
+ bron: string;
13901
+ bron_id: string;
13902
+ created_at: string;
13903
+ id: string;
13904
+ label: string | null;
13905
+ print_plek_id: string;
13906
+ updated_at: string;
13907
+ };
13908
+ Insert: {
13909
+ bron: string;
13910
+ bron_id: string;
13911
+ created_at?: string;
13912
+ id?: string;
13913
+ label?: string | null;
13914
+ print_plek_id: string;
13915
+ updated_at?: string;
13916
+ };
13917
+ Update: {
13918
+ bron?: string;
13919
+ bron_id?: string;
13920
+ created_at?: string;
13921
+ id?: string;
13922
+ label?: string | null;
13923
+ print_plek_id?: string;
13924
+ updated_at?: string;
13925
+ };
13926
+ Relationships: [
13927
+ {
13928
+ foreignKeyName: "print_plek_koppelingen_print_plek_id_fkey";
13929
+ columns: ["print_plek_id"];
13930
+ isOneToOne: false;
13931
+ referencedRelation: "print_plekken";
13932
+ referencedColumns: ["id"];
13933
+ }
13934
+ ];
13935
+ };
13936
+ print_plekken: {
13937
+ Row: {
13938
+ actief: boolean;
13939
+ created_at: string;
13940
+ id: string;
13941
+ naam: string;
13942
+ omschrijving: string | null;
13943
+ updated_at: string;
13944
+ };
13945
+ Insert: {
13946
+ actief?: boolean;
13947
+ created_at?: string;
13948
+ id?: string;
13949
+ naam: string;
13950
+ omschrijving?: string | null;
13951
+ updated_at?: string;
13952
+ };
13953
+ Update: {
13954
+ actief?: boolean;
13955
+ created_at?: string;
13956
+ id?: string;
13957
+ naam?: string;
13958
+ omschrijving?: string | null;
13959
+ updated_at?: string;
13960
+ };
13961
+ Relationships: [];
13962
+ };
13725
13963
  print_queue_runners: {
13726
13964
  Row: {
13727
13965
  actief: boolean;
@@ -19118,6 +19356,9 @@ export type Database = {
19118
19356
  scheduled_end_time: string | null;
19119
19357
  scheduled_start_time: string | null;
19120
19358
  sequence_number: number;
19359
+ signature_accepted_at: string | null;
19360
+ signature_by_user_id: string | null;
19361
+ signature_name: string | null;
19121
19362
  source_email_meta: Json | null;
19122
19363
  source_mailbox_message_id: string | null;
19123
19364
  source_pdf_path: string | null;
@@ -19153,6 +19394,9 @@ export type Database = {
19153
19394
  scheduled_end_time?: string | null;
19154
19395
  scheduled_start_time?: string | null;
19155
19396
  sequence_number: number;
19397
+ signature_accepted_at?: string | null;
19398
+ signature_by_user_id?: string | null;
19399
+ signature_name?: string | null;
19156
19400
  source_email_meta?: Json | null;
19157
19401
  source_mailbox_message_id?: string | null;
19158
19402
  source_pdf_path?: string | null;
@@ -19188,6 +19432,9 @@ export type Database = {
19188
19432
  scheduled_end_time?: string | null;
19189
19433
  scheduled_start_time?: string | null;
19190
19434
  sequence_number?: number;
19435
+ signature_accepted_at?: string | null;
19436
+ signature_by_user_id?: string | null;
19437
+ signature_name?: string | null;
19191
19438
  source_email_meta?: Json | null;
19192
19439
  source_mailbox_message_id?: string | null;
19193
19440
  source_pdf_path?: string | null;
@@ -21627,6 +21874,24 @@ export type Database = {
21627
21874
  };
21628
21875
  Returns: string;
21629
21876
  };
21877
+ logistics_floriday_finish_push_v3: {
21878
+ Args: {
21879
+ _error?: string;
21880
+ _error_code?: string;
21881
+ _fulfillment_order_id?: string;
21882
+ _gateway_status?: number;
21883
+ _id: string;
21884
+ _max_age_hours?: number;
21885
+ _max_attempts?: number;
21886
+ _outcome: string;
21887
+ _permanent?: boolean;
21888
+ _response?: Json;
21889
+ _revision: number;
21890
+ _sent_hash?: string;
21891
+ _wait_max_age_hours?: number;
21892
+ };
21893
+ Returns: string;
21894
+ };
21630
21895
  logistics_floriday_prune_pushes: {
21631
21896
  Args: {
21632
21897
  _days?: number;
@@ -22262,6 +22527,14 @@ export type Database = {
22262
22527
  };
22263
22528
  Returns: Json;
22264
22529
  };
22530
+ pick_print_plekken: {
22531
+ Args: never;
22532
+ Returns: {
22533
+ id: string;
22534
+ naam: string;
22535
+ omschrijving: string;
22536
+ }[];
22537
+ };
22265
22538
  pick_release_expired_locks: {
22266
22539
  Args: never;
22267
22540
  Returns: number;
@@ -22326,6 +22599,13 @@ export type Database = {
22326
22599
  isSetofReturn: false;
22327
22600
  };
22328
22601
  };
22602
+ pick_set_station_print_plek: {
22603
+ Args: {
22604
+ _print_plek_id: string;
22605
+ _station_id: string;
22606
+ };
22607
+ Returns: string;
22608
+ };
22329
22609
  pick_station_dashboard: {
22330
22610
  Args: never;
22331
22611
  Returns: {
@@ -22338,6 +22618,25 @@ export type Database = {
22338
22618
  waiting: number;
22339
22619
  }[];
22340
22620
  };
22621
+ pick_station_print_plek: {
22622
+ Args: {
22623
+ _station_id: string;
22624
+ };
22625
+ Returns: {
22626
+ naam: string;
22627
+ omschrijving: string;
22628
+ print_plek_id: string;
22629
+ }[];
22630
+ };
22631
+ pick_station_print_plekken: {
22632
+ Args: never;
22633
+ Returns: {
22634
+ naam: string;
22635
+ omschrijving: string;
22636
+ print_plek_id: string;
22637
+ station_id: string;
22638
+ }[];
22639
+ };
22341
22640
  pick_station_slugify: {
22342
22641
  Args: {
22343
22642
  _id: string;