@flowselections/layout-maker 1.31.0 → 1.32.0

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.
@@ -0,0 +1,170 @@
1
+ // ============================================================================
2
+ // src/lib/previewPdf.ts — afhandeling van /api/public/print/preview-pdf.
3
+ // Toont hoe een pickregel eruit komt als PDF, zonder printopdracht en zonder
4
+ // iets in de database te wijzigen. De shell levert de databaseverbinding.
5
+ //
6
+ // Eén bron van waarheid: de gegevens komen uit de read-only databasefunctie
7
+ // `pick_preview_job` van de Logistiek Engine — dezelfde opbouw als
8
+ // `pick_enqueue_print_job`. Deze module spiegelt die mapping bewust niet.
9
+ // ============================================================================
10
+ /** Maximaal aantal voorbeelden per station binnen het venster. */
11
+ const MAX_PER_VENSTER = 6;
12
+ const VENSTER_SEC = 60;
13
+ function gelijk(a, b) {
14
+ if (a.length !== b.length)
15
+ return false;
16
+ let verschil = 0;
17
+ for (let i = 0; i < a.length; i++)
18
+ verschil |= a.charCodeAt(i) ^ b.charCodeAt(i);
19
+ return verschil === 0;
20
+ }
21
+ function leesSleutel(request) {
22
+ return (request.headers.get("apikey") ??
23
+ (request.headers.get("authorization") ?? "").replace(/^Bearer\s+/i, "")).trim();
24
+ }
25
+ /** Mag deze aanroeper voorbeelden opvragen? Zelfde regels als de queue-tick. */
26
+ async function magAanroepen(request, db) {
27
+ const meegegeven = leesSleutel(request);
28
+ if (!meegegeven)
29
+ return false;
30
+ const { isRunnerSleutel } = await import("./runnerRegistry.server.js");
31
+ if (await isRunnerSleutel(db, meegegeven))
32
+ return true;
33
+ const projectSleutel = process.env["SUPABASE_PUBLISHABLE_KEY"] ??
34
+ process.env["VITE_SUPABASE_PUBLISHABLE_KEY"] ??
35
+ "";
36
+ if (projectSleutel && gelijk(projectSleutel, meegegeven))
37
+ return true;
38
+ try {
39
+ const { data } = await db.auth.getUser(meegegeven);
40
+ return !!data?.user?.id;
41
+ }
42
+ catch {
43
+ return false;
44
+ }
45
+ }
46
+ const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
47
+ /** Legt een weigering vindbaar vast; faalt nooit hard. */
48
+ async function weiger(db, station, queueItem, code, reden, status) {
49
+ try {
50
+ await db.rpc("print_preview_weiger", {
51
+ _station_slug: station,
52
+ _queue_item_id: queueItem && UUID.test(queueItem) ? queueItem : null,
53
+ _code: code,
54
+ _reden: reden,
55
+ });
56
+ }
57
+ catch {
58
+ /* logboek mag een voorbeeld nooit blokkeren */
59
+ }
60
+ return Response.json({ ok: false, code, fout: reden }, { status });
61
+ }
62
+ /**
63
+ * POST { station_slug, queue_item_id } → PDF-bytes.
64
+ * Fouten komen terug als JSON met een code, en worden vastgelegd in
65
+ * `print_preview_events`.
66
+ */
67
+ export async function behandelPreviewPdf(request, supabase) {
68
+ if (!supabase) {
69
+ return Response.json({ ok: false, code: "geen_database", fout: "De server kreeg geen databaseverbinding." }, { status: 500 });
70
+ }
71
+ if (!(await magAanroepen(request, supabase))) {
72
+ return Response.json({ ok: false, code: "geen_toegang", fout: "Het voorbeeld weigerde het verzoek: geen geldig toegangsbewijs." }, { status: 401 });
73
+ }
74
+ let body = {};
75
+ try {
76
+ body = (await request.json());
77
+ }
78
+ catch {
79
+ body = {};
80
+ }
81
+ const station = typeof body["station_slug"] === "string" ? body["station_slug"].trim() : "";
82
+ const queueItem = typeof body["queue_item_id"] === "string" ? body["queue_item_id"].trim() : "";
83
+ if (!station || !queueItem || !UUID.test(queueItem)) {
84
+ return weiger(supabase, station || null, null, "ongeldig_verzoek", "Geef een station_slug en een geldig queue_item_id mee.", 400);
85
+ }
86
+ // 1) Snelheidsbegrenzing (telt en logt in één databasestap).
87
+ const { data: tempo, error: tempoFout } = await supabase.rpc("print_preview_toestaan", {
88
+ _station_slug: station,
89
+ _queue_item_id: queueItem,
90
+ _max: MAX_PER_VENSTER,
91
+ _venster_sec: VENSTER_SEC,
92
+ });
93
+ if (tempoFout) {
94
+ return weiger(supabase, station, queueItem, "render_mislukt", `Voorbeeld niet mogelijk: ${tempoFout.message}`, 500);
95
+ }
96
+ const toestemming = (tempo ?? {});
97
+ if (toestemming["toegestaan"] === false) {
98
+ const wacht = Number(toestemming["wacht_sec"] ?? VENSTER_SEC);
99
+ return Response.json({
100
+ ok: false,
101
+ code: "te_snel",
102
+ fout: `Te veel voorbeelden achter elkaar. Probeer het over ${wacht} seconden opnieuw.`,
103
+ wacht_sec: wacht,
104
+ }, { status: 429, headers: { "Retry-After": String(wacht) } });
105
+ }
106
+ // 2) Gegevens ophalen: read-only, met stationvalidatie in de database zelf.
107
+ const { data: rij, error: rpcFout } = await supabase.rpc("pick_preview_job", {
108
+ _station_slug: station,
109
+ _queue_item_id: queueItem,
110
+ });
111
+ if (rpcFout) {
112
+ const melding = String(rpcFout.message ?? "");
113
+ // Ontbreekt de functie zelf (Engine nog niet bijgewerkt)? Dat is geen
114
+ // stationprobleem maar een installatieprobleem.
115
+ if (/could not find the function|does not exist/i.test(melding)) {
116
+ return weiger(supabase, station, queueItem, "rpc_ontbreekt", "De databasefunctie pick_preview_job ontbreekt. Werk de Logistiek Engine bij.", 503);
117
+ }
118
+ if (/is not unique/i.test(melding)) {
119
+ return weiger(supabase, station, queueItem, "rpc_dubbel", "Er bestaan meerdere varianten van pick_preview_job in de database. Verwijder de oude variant.", 503);
120
+ }
121
+ const code = /station/i.test(melding)
122
+ ? "station_mismatch"
123
+ : /bestaat niet|niet gevonden|not found|onbekend/i.test(melding)
124
+ ? "regel_onbekend"
125
+ : "render_mislukt";
126
+ return weiger(supabase, station, queueItem, code, melding || "Voorbeeld niet mogelijk.", code === "render_mislukt" ? 500 : 404);
127
+ }
128
+ const job = (Array.isArray(rij) ? rij[0] : rij);
129
+ if (!job) {
130
+ return weiger(supabase, station, queueItem, "regel_onbekend", "Deze pickregel bestaat niet of hoort niet bij dit station.", 404);
131
+ }
132
+ // 3) Exact dezelfde documentkeuze en opmaak als de printwachtrij.
133
+ const { bepaalDocumentKeuze, bouwHtml, heeftZichtbareInhoud, GeenDocumentFout } = await import("./printQueue.server.js");
134
+ const { htmlNaarPdfServer } = await import("./htmlNaarPdf.server.js");
135
+ try {
136
+ const { keuze, klaarPdf } = await bepaalDocumentKeuze(supabase, job);
137
+ const layout = keuze.layout;
138
+ const uitkomst = { bron: "extern_pdf" };
139
+ let pdfBase64 = klaarPdf;
140
+ if (!pdfBase64) {
141
+ const html = await bouwHtml(supabase, job, keuze, uitkomst);
142
+ if (!heeftZichtbareInhoud(html)) {
143
+ return weiger(supabase, station, queueItem, "layout_leeg", "Het document blijft leeg: de layout heeft geen blokken of de order heeft geen gegevens.", 422);
144
+ }
145
+ pdfBase64 = await htmlNaarPdfServer({
146
+ html,
147
+ breedteMm: Number(layout?.breedte_mm ?? 210),
148
+ hoogteMm: Number(layout?.hoogte_mm ?? 297),
149
+ margeMm: Number(layout?.marge_boven ?? 10),
150
+ landschap: String(layout?.orientatie ?? "portrait") === "landscape",
151
+ });
152
+ }
153
+ const bytes = Uint8Array.from(atob(pdfBase64), (c) => c.charCodeAt(0));
154
+ return new Response(bytes, {
155
+ status: 200,
156
+ headers: {
157
+ "Content-Type": "application/pdf",
158
+ "Content-Disposition": 'inline; filename="voorbeeld.pdf"',
159
+ "Cache-Control": "no-store",
160
+ "X-Preview-Bron": String(uitkomst.bron),
161
+ "X-Preview-Layout-Id": String(layout?.id ?? ""),
162
+ },
163
+ });
164
+ }
165
+ catch (e) {
166
+ const melding = e instanceof Error ? e.message : "Voorbeeld maken mislukte.";
167
+ const blijvend = e?.name === "GeenDocumentFout" || e instanceof GeenDocumentFout;
168
+ return weiger(supabase, station, queueItem, blijvend ? "layout_ontbreekt" : "render_mislukt", melding, blijvend ? 422 : 500);
169
+ }
170
+ }
@@ -8,13 +8,17 @@ export type PrintDb = SupabaseClient<any, any, any>;
8
8
  * meer nu de shell de client levert.
9
9
  */
10
10
  export declare function controleerClient(db: PrintDb): Promise<string | null>;
11
+ /** Fout waarbij opnieuw proberen zinloos is (er valt niets te printen). */
12
+ export declare class GeenDocumentFout extends Error {
13
+ name: string;
14
+ }
11
15
  /**
12
16
  * `ontwerpWint` = deze layout is een echt ontwerp van deze module (actief, geen
13
17
  * Floriday-systeemlayout) en gaat daarom vóór meegestuurde HTML. Er is bewust
14
18
  * maar één schakelaar voor dit besluit: bron/systeem. Een tweede schakelaar
15
19
  * ("stond er een layout_id op de opdracht?") is verwijderd.
16
20
  */
17
- type LayoutKeuze = {
21
+ export type LayoutKeuze = {
18
22
  layout: Job | null;
19
23
  ontwerpWint: boolean;
20
24
  };
@@ -50,5 +54,14 @@ export interface WachtrijResultaat {
50
54
  }
51
55
  /** Eén ronde: vastgelopen opdrachten opruimen, afdrukken en statussen bijwerken. */
52
56
  export declare function verwerkWachtrij(db: PrintDb, max?: number): Promise<WachtrijResultaat>;
57
+ /**
58
+ * Dezelfde documentkeuze als de printwachtrij maakt, maar zonder printer en
59
+ * zonder statuswijziging. Gebruikt door het voorbeeld (`preview-pdf`) zodat
60
+ * het voorbeeld exact toont wat er straks uit de printer komt.
61
+ */
62
+ export declare function bepaalDocumentKeuze(db: PrintDb, job: Job): Promise<{
63
+ keuze: LayoutKeuze;
64
+ klaarPdf: string | null;
65
+ }>;
53
66
  export {};
54
67
  //# sourceMappingURL=printQueue.server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"printQueue.server.d.ts","sourceRoot":"","sources":["../../src/lib/printQueue.server.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAsB5D,KAAK,GAAG,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAE/B,mFAAmF;AACnF,MAAM,MAAM,OAAO,GAAG,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAEpD;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,EAAE,EAAE,OAAO,GAAG,OAAO,C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B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,oFAAoF;AACpF,wBAAsB,eAAe,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,SAAI,GAAG,OAAO,CAAC,iBAAiB,CAAC,CA4BtF;AAED;;;;GAIG;AACH,wBAAsB,mBAAmB,CACvC,EAAE,EAAE,OAAO,EACX,GAAG,EAAE,GAAG,GACP,OAAO,CAAC;IAAE,KAAK,EAAE,WAAW,CAAC;IAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,CA0B1D"}
@@ -41,7 +41,7 @@ async function log(db, jobId, gebeurtenis, detail) {
41
41
  });
42
42
  }
43
43
  /** Fout waarbij opnieuw proberen zinloos is (er valt niets te printen). */
44
- class GeenDocumentFout extends Error {
44
+ export class GeenDocumentFout extends Error {
45
45
  constructor() {
46
46
  super(...arguments);
47
47
  this.name = "GeenDocumentFout";
@@ -864,3 +864,28 @@ export async function verwerkWachtrij(db, max = 5) {
864
864
  bijgewerkt: await synchroniseerStatussen(db),
865
865
  };
866
866
  }
867
+ /**
868
+ * Dezelfde documentkeuze als de printwachtrij maakt, maar zonder printer en
869
+ * zonder statuswijziging. Gebruikt door het voorbeeld (`preview-pdf`) zodat
870
+ * het voorbeeld exact toont wat er straks uit de printer komt.
871
+ */
872
+ export async function bepaalDocumentKeuze(db, job) {
873
+ let bron = await zoekBronregel(db, job);
874
+ if (await isFloridayLayoutKeuze(db, job)) {
875
+ bron = "extern_pdf";
876
+ job.layout_id = null;
877
+ }
878
+ if (bron === "eigen_layout") {
879
+ job.pdf_base64 = null;
880
+ job.pdf_url = null;
881
+ }
882
+ const klaar = await kantEnKlarePdf(db, job);
883
+ if (!klaar && bron === "extern_pdf") {
884
+ throw new GeenDocumentFout("Voor dit document is ingesteld dat het aangeleverde document wordt " +
885
+ "gebruikt, maar er is geen PDF meegestuurd.");
886
+ }
887
+ const keuze = klaar
888
+ ? { layout: null, ontwerpWint: false }
889
+ : await zoekLayout(db, job);
890
+ return { keuze, klaarPdf: klaar };
891
+ }
@@ -13849,6 +13849,39 @@ export declare const netwerkPrinters: import("@tanstack/start-client-core").Opti
13849
13849
  };
13850
13850
  Relationships: [];
13851
13851
  };
13852
+ print_preview_events: {
13853
+ Row: {
13854
+ code: string | null;
13855
+ created_at: string;
13856
+ detail: import("../integrations/supabase/types.js").Json;
13857
+ id: string;
13858
+ queue_item_id: string | null;
13859
+ reden: string | null;
13860
+ station_slug: string | null;
13861
+ uitkomst: string;
13862
+ };
13863
+ Insert: {
13864
+ code?: string | null;
13865
+ created_at?: string;
13866
+ detail?: import("../integrations/supabase/types.js").Json;
13867
+ id?: string;
13868
+ queue_item_id?: string | null;
13869
+ reden?: string | null;
13870
+ station_slug?: string | null;
13871
+ uitkomst?: string;
13872
+ };
13873
+ Update: {
13874
+ code?: string | null;
13875
+ created_at?: string;
13876
+ detail?: import("../integrations/supabase/types.js").Json;
13877
+ id?: string;
13878
+ queue_item_id?: string | null;
13879
+ reden?: string | null;
13880
+ station_slug?: string | null;
13881
+ uitkomst?: string;
13882
+ };
13883
+ Relationships: [];
13884
+ };
13852
13885
  print_queue_runners: {
13853
13886
  Row: {
13854
13887
  actief: boolean;
@@ -22344,13 +22377,6 @@ export declare const netwerkPrinters: import("@tanstack/start-client-core").Opti
22344
22377
  Returns: import("../integrations/supabase/types.js").Json;
22345
22378
  };
22346
22379
  pick_enqueue_print_job: {
22347
- Args: {
22348
- _printer_id?: string;
22349
- _queue_item_id: string;
22350
- _session_id?: string;
22351
- };
22352
- Returns: string;
22353
- } | {
22354
22380
  Args: {
22355
22381
  _is_herprint?: boolean;
22356
22382
  _printer_id?: string;
@@ -22543,6 +22569,24 @@ export declare const netwerkPrinters: import("@tanstack/start-client-core").Opti
22543
22569
  };
22544
22570
  Returns: undefined;
22545
22571
  };
22572
+ print_preview_toestaan: {
22573
+ Args: {
22574
+ _max?: number;
22575
+ _queue_item_id: string;
22576
+ _station_slug: string;
22577
+ _venster_sec?: number;
22578
+ };
22579
+ Returns: import("../integrations/supabase/types.js").Json;
22580
+ };
22581
+ print_preview_weiger: {
22582
+ Args: {
22583
+ _code: string;
22584
+ _queue_item_id: string;
22585
+ _reden: string;
22586
+ _station_slug: string;
22587
+ };
22588
+ Returns: undefined;
22589
+ };
22546
22590
  process_logistics_event: {
22547
22591
  Args: {
22548
22592
  p_event_id: string;
@@ -37152,6 +37196,39 @@ export declare const verstuurPrintOpdracht: import("@tanstack/start-client-core"
37152
37196
  };
37153
37197
  Relationships: [];
37154
37198
  };
37199
+ print_preview_events: {
37200
+ Row: {
37201
+ code: string | null;
37202
+ created_at: string;
37203
+ detail: import("../integrations/supabase/types.js").Json;
37204
+ id: string;
37205
+ queue_item_id: string | null;
37206
+ reden: string | null;
37207
+ station_slug: string | null;
37208
+ uitkomst: string;
37209
+ };
37210
+ Insert: {
37211
+ code?: string | null;
37212
+ created_at?: string;
37213
+ detail?: import("../integrations/supabase/types.js").Json;
37214
+ id?: string;
37215
+ queue_item_id?: string | null;
37216
+ reden?: string | null;
37217
+ station_slug?: string | null;
37218
+ uitkomst?: string;
37219
+ };
37220
+ Update: {
37221
+ code?: string | null;
37222
+ created_at?: string;
37223
+ detail?: import("../integrations/supabase/types.js").Json;
37224
+ id?: string;
37225
+ queue_item_id?: string | null;
37226
+ reden?: string | null;
37227
+ station_slug?: string | null;
37228
+ uitkomst?: string;
37229
+ };
37230
+ Relationships: [];
37231
+ };
37155
37232
  print_queue_runners: {
37156
37233
  Row: {
37157
37234
  actief: boolean;
@@ -45647,13 +45724,6 @@ export declare const verstuurPrintOpdracht: import("@tanstack/start-client-core"
45647
45724
  Returns: import("../integrations/supabase/types.js").Json;
45648
45725
  };
45649
45726
  pick_enqueue_print_job: {
45650
- Args: {
45651
- _printer_id?: string;
45652
- _queue_item_id: string;
45653
- _session_id?: string;
45654
- };
45655
- Returns: string;
45656
- } | {
45657
45727
  Args: {
45658
45728
  _is_herprint?: boolean;
45659
45729
  _printer_id?: string;
@@ -45846,6 +45916,24 @@ export declare const verstuurPrintOpdracht: import("@tanstack/start-client-core"
45846
45916
  };
45847
45917
  Returns: undefined;
45848
45918
  };
45919
+ print_preview_toestaan: {
45920
+ Args: {
45921
+ _max?: number;
45922
+ _queue_item_id: string;
45923
+ _station_slug: string;
45924
+ _venster_sec?: number;
45925
+ };
45926
+ Returns: import("../integrations/supabase/types.js").Json;
45927
+ };
45928
+ print_preview_weiger: {
45929
+ Args: {
45930
+ _code: string;
45931
+ _queue_item_id: string;
45932
+ _reden: string;
45933
+ _station_slug: string;
45934
+ };
45935
+ Returns: undefined;
45936
+ };
45849
45937
  process_logistics_event: {
45850
45938
  Args: {
45851
45939
  p_event_id: string;
@@ -60465,6 +60553,39 @@ export declare const printStatus: import("@tanstack/start-client-core").Required
60465
60553
  };
60466
60554
  Relationships: [];
60467
60555
  };
60556
+ print_preview_events: {
60557
+ Row: {
60558
+ code: string | null;
60559
+ created_at: string;
60560
+ detail: import("../integrations/supabase/types.js").Json;
60561
+ id: string;
60562
+ queue_item_id: string | null;
60563
+ reden: string | null;
60564
+ station_slug: string | null;
60565
+ uitkomst: string;
60566
+ };
60567
+ Insert: {
60568
+ code?: string | null;
60569
+ created_at?: string;
60570
+ detail?: import("../integrations/supabase/types.js").Json;
60571
+ id?: string;
60572
+ queue_item_id?: string | null;
60573
+ reden?: string | null;
60574
+ station_slug?: string | null;
60575
+ uitkomst?: string;
60576
+ };
60577
+ Update: {
60578
+ code?: string | null;
60579
+ created_at?: string;
60580
+ detail?: import("../integrations/supabase/types.js").Json;
60581
+ id?: string;
60582
+ queue_item_id?: string | null;
60583
+ reden?: string | null;
60584
+ station_slug?: string | null;
60585
+ uitkomst?: string;
60586
+ };
60587
+ Relationships: [];
60588
+ };
60468
60589
  print_queue_runners: {
60469
60590
  Row: {
60470
60591
  actief: boolean;
@@ -68960,13 +69081,6 @@ export declare const printStatus: import("@tanstack/start-client-core").Required
68960
69081
  Returns: import("../integrations/supabase/types.js").Json;
68961
69082
  };
68962
69083
  pick_enqueue_print_job: {
68963
- Args: {
68964
- _printer_id?: string;
68965
- _queue_item_id: string;
68966
- _session_id?: string;
68967
- };
68968
- Returns: string;
68969
- } | {
68970
69084
  Args: {
68971
69085
  _is_herprint?: boolean;
68972
69086
  _printer_id?: string;
@@ -69159,6 +69273,24 @@ export declare const printStatus: import("@tanstack/start-client-core").Required
69159
69273
  };
69160
69274
  Returns: undefined;
69161
69275
  };
69276
+ print_preview_toestaan: {
69277
+ Args: {
69278
+ _max?: number;
69279
+ _queue_item_id: string;
69280
+ _station_slug: string;
69281
+ _venster_sec?: number;
69282
+ };
69283
+ Returns: import("../integrations/supabase/types.js").Json;
69284
+ };
69285
+ print_preview_weiger: {
69286
+ Args: {
69287
+ _code: string;
69288
+ _queue_item_id: string;
69289
+ _reden: string;
69290
+ _station_slug: string;
69291
+ };
69292
+ Returns: undefined;
69293
+ };
69162
69294
  process_logistics_event: {
69163
69295
  Args: {
69164
69296
  p_event_id: string;
@@ -83772,6 +83904,39 @@ export declare const netwerkComputers: import("@tanstack/start-client-core").Opt
83772
83904
  };
83773
83905
  Relationships: [];
83774
83906
  };
83907
+ print_preview_events: {
83908
+ Row: {
83909
+ code: string | null;
83910
+ created_at: string;
83911
+ detail: import("../integrations/supabase/types.js").Json;
83912
+ id: string;
83913
+ queue_item_id: string | null;
83914
+ reden: string | null;
83915
+ station_slug: string | null;
83916
+ uitkomst: string;
83917
+ };
83918
+ Insert: {
83919
+ code?: string | null;
83920
+ created_at?: string;
83921
+ detail?: import("../integrations/supabase/types.js").Json;
83922
+ id?: string;
83923
+ queue_item_id?: string | null;
83924
+ reden?: string | null;
83925
+ station_slug?: string | null;
83926
+ uitkomst?: string;
83927
+ };
83928
+ Update: {
83929
+ code?: string | null;
83930
+ created_at?: string;
83931
+ detail?: import("../integrations/supabase/types.js").Json;
83932
+ id?: string;
83933
+ queue_item_id?: string | null;
83934
+ reden?: string | null;
83935
+ station_slug?: string | null;
83936
+ uitkomst?: string;
83937
+ };
83938
+ Relationships: [];
83939
+ };
83775
83940
  print_queue_runners: {
83776
83941
  Row: {
83777
83942
  actief: boolean;
@@ -92267,13 +92432,6 @@ export declare const netwerkComputers: import("@tanstack/start-client-core").Opt
92267
92432
  Returns: import("../integrations/supabase/types.js").Json;
92268
92433
  };
92269
92434
  pick_enqueue_print_job: {
92270
- Args: {
92271
- _printer_id?: string;
92272
- _queue_item_id: string;
92273
- _session_id?: string;
92274
- };
92275
- Returns: string;
92276
- } | {
92277
92435
  Args: {
92278
92436
  _is_herprint?: boolean;
92279
92437
  _printer_id?: string;
@@ -92466,6 +92624,24 @@ export declare const netwerkComputers: import("@tanstack/start-client-core").Opt
92466
92624
  };
92467
92625
  Returns: undefined;
92468
92626
  };
92627
+ print_preview_toestaan: {
92628
+ Args: {
92629
+ _max?: number;
92630
+ _queue_item_id: string;
92631
+ _station_slug: string;
92632
+ _venster_sec?: number;
92633
+ };
92634
+ Returns: import("../integrations/supabase/types.js").Json;
92635
+ };
92636
+ print_preview_weiger: {
92637
+ Args: {
92638
+ _code: string;
92639
+ _queue_item_id: string;
92640
+ _reden: string;
92641
+ _station_slug: string;
92642
+ };
92643
+ Returns: undefined;
92644
+ };
92469
92645
  process_logistics_event: {
92470
92646
  Args: {
92471
92647
  p_event_id: string;