@flowselections/mailbox-orders 1.0.27 → 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/components/CartAssignmentWizard.js +1 -1
- package/dist-lib/components/MailboxInboxPage.js +2 -2
- package/dist-lib/components/MailboxProcessedPage.js +4 -4
- package/dist-lib/components/MailboxProposalsPage.js +10 -10
- package/dist-lib/components/settings/ImapAccountsCard.js +1 -1
- package/dist-lib/components/settings/ImapProfilesCard.js +1 -1
- package/dist-lib/components/settings/MailboxAiPromptCard.js +2 -2
- package/dist-lib/components/settings/MailboxOrderTemplateCard.js +1 -1
- package/dist-lib/components/settings/MailboxSettingsCard.js +1 -1
- package/dist-lib/index.d.ts +7 -7
- package/dist-lib/index.js +9 -9
- package/dist-lib/integrations/supabase/auth-middleware.d.ts +1 -1
- package/dist-lib/integrations/supabase/auth-middleware.js +1 -1
- package/dist-lib/integrations/supabase/client.server.d.ts +1 -1
- package/dist-lib/integrations/supabase/client.server.js +1 -1
- package/dist-lib/integrations/supabase/types.d.ts +346 -0
- package/dist-lib/integrations/supabase/types.d.ts.map +1 -1
- package/dist-lib/lib/ai-config.server.d.ts +1 -1
- package/dist-lib/lib/imap.functions.d.ts +1386 -1386
- package/dist-lib/lib/imap.functions.js +8 -8
- package/dist-lib/lib/mailbox-ai-settings.functions.d.ts +2 -2
- package/dist-lib/lib/mailbox-ai-settings.functions.js +2 -2
- package/dist-lib/lib/mailbox-ai.server.d.ts +2 -2
- package/dist-lib/lib/mailbox-ai.server.js +3 -3
- package/dist-lib/lib/mailbox-auto.server.js +4 -4
- package/dist-lib/lib/mailbox-ingest.server.d.ts +2 -2
- package/dist-lib/lib/mailbox-ingest.server.js +8 -8
- package/dist-lib/lib/mailbox-template.functions.d.ts +8 -8
- package/dist-lib/lib/mailbox-template.functions.js +1 -1
- package/dist-lib/lib/mailbox.functions.d.ts +26 -26
- package/dist-lib/lib/mailbox.functions.js +24 -24
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Server functions voor centraal IMAP-beheer (accounts + profielen).
|
|
2
2
|
// Admins beheren accounts & profielen; modules pollen via profile_key.
|
|
3
3
|
import { createServerFn } from "@tanstack/react-start";
|
|
4
|
-
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware";
|
|
4
|
+
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware.js";
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
async function assertAdmin(supabase, userId) {
|
|
7
7
|
const { data } = await supabase.rpc("has_role", { _user_id: userId, _role: "admin" });
|
|
@@ -37,7 +37,7 @@ export const upsertImapAccount = createServerFn({ method: "POST" })
|
|
|
37
37
|
.inputValidator((input) => AccountInput.parse(input))
|
|
38
38
|
.handler(async ({ data, context }) => {
|
|
39
39
|
await assertAdmin(context.supabase, context.userId);
|
|
40
|
-
const { supabaseAdmin } = await import("../integrations/supabase/client.server");
|
|
40
|
+
const { supabaseAdmin } = await import("../integrations/supabase/client.server.js");
|
|
41
41
|
const payload = {
|
|
42
42
|
name: data.name,
|
|
43
43
|
email: data.email ?? null,
|
|
@@ -68,7 +68,7 @@ export const activateImapAccount = createServerFn({ method: "POST" })
|
|
|
68
68
|
.inputValidator((input) => z.object({ account_id: z.string().uuid() }).parse(input))
|
|
69
69
|
.handler(async ({ data, context }) => {
|
|
70
70
|
await assertAdmin(context.supabase, context.userId);
|
|
71
|
-
const { supabaseAdmin } = await import("../integrations/supabase/client.server");
|
|
71
|
+
const { supabaseAdmin } = await import("../integrations/supabase/client.server.js");
|
|
72
72
|
// Zorg dat het standaardprofiel bestaat
|
|
73
73
|
const { data: prof } = await supabaseAdmin
|
|
74
74
|
.from("imap_profiles")
|
|
@@ -86,7 +86,7 @@ export const deleteImapAccount = createServerFn({ method: "POST" })
|
|
|
86
86
|
.inputValidator((input) => z.object({ id: z.string().uuid() }).parse(input))
|
|
87
87
|
.handler(async ({ data, context }) => {
|
|
88
88
|
await assertAdmin(context.supabase, context.userId);
|
|
89
|
-
const { supabaseAdmin } = await import("../integrations/supabase/client.server");
|
|
89
|
+
const { supabaseAdmin } = await import("../integrations/supabase/client.server.js");
|
|
90
90
|
const { error } = await supabaseAdmin.from("imap_accounts").delete().eq("id", data.id);
|
|
91
91
|
if (error)
|
|
92
92
|
throw new Error(error.message);
|
|
@@ -151,7 +151,7 @@ export const upsertImapProfile = createServerFn({ method: "POST" })
|
|
|
151
151
|
.inputValidator((input) => ProfileInput.parse(input))
|
|
152
152
|
.handler(async ({ data, context }) => {
|
|
153
153
|
await assertAdmin(context.supabase, context.userId);
|
|
154
|
-
const { supabaseAdmin } = await import("../integrations/supabase/client.server");
|
|
154
|
+
const { supabaseAdmin } = await import("../integrations/supabase/client.server.js");
|
|
155
155
|
const payload = {
|
|
156
156
|
profile_key: data.profile_key,
|
|
157
157
|
name: data.name,
|
|
@@ -178,7 +178,7 @@ export const deleteImapProfile = createServerFn({ method: "POST" })
|
|
|
178
178
|
.inputValidator((input) => z.object({ id: z.string().uuid() }).parse(input))
|
|
179
179
|
.handler(async ({ data, context }) => {
|
|
180
180
|
await assertAdmin(context.supabase, context.userId);
|
|
181
|
-
const { supabaseAdmin } = await import("../integrations/supabase/client.server");
|
|
181
|
+
const { supabaseAdmin } = await import("../integrations/supabase/client.server.js");
|
|
182
182
|
const { error } = await supabaseAdmin.from("imap_profiles").delete().eq("id", data.id);
|
|
183
183
|
if (error)
|
|
184
184
|
throw new Error(error.message);
|
|
@@ -189,7 +189,7 @@ export const setProfileAccount = createServerFn({ method: "POST" })
|
|
|
189
189
|
.inputValidator((input) => z.object({ profile_id: z.string().uuid(), account_id: z.string().uuid().nullable() }).parse(input))
|
|
190
190
|
.handler(async ({ data, context }) => {
|
|
191
191
|
await assertAdmin(context.supabase, context.userId);
|
|
192
|
-
const { supabaseAdmin } = await import("../integrations/supabase/client.server");
|
|
192
|
+
const { supabaseAdmin } = await import("../integrations/supabase/client.server.js");
|
|
193
193
|
const { error } = await supabaseAdmin.from("imap_profiles").update({ account_id: data.account_id }).eq("id", data.profile_id);
|
|
194
194
|
if (error)
|
|
195
195
|
throw new Error(error.message);
|
|
@@ -208,7 +208,7 @@ export const pollImapProfile = createServerFn({ method: "POST" })
|
|
|
208
208
|
const r = res;
|
|
209
209
|
// Auto-verwerk binnenkomende mails (alleen mailbox_orders profiel heeft AI-flow)
|
|
210
210
|
if (r.ok && (r.inserted ?? 0) > 0) {
|
|
211
|
-
const { autoProcessNewMessagesInternal } = await import("./mailbox-auto.server");
|
|
211
|
+
const { autoProcessNewMessagesInternal } = await import("./mailbox-auto.server.js");
|
|
212
212
|
await autoProcessNewMessagesInternal();
|
|
213
213
|
}
|
|
214
214
|
return r;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const getMailboxAiSettings: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
2
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
2
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
3
3
|
userId: string;
|
|
4
4
|
claims: import("@supabase/auth-js").User;
|
|
5
5
|
}, undefined, undefined, undefined>], undefined, Promise<{
|
|
@@ -10,7 +10,7 @@ export declare const getMailboxAiSettings: import("@tanstack/start-client-core")
|
|
|
10
10
|
default_prompt: string;
|
|
11
11
|
}>>;
|
|
12
12
|
export declare const saveMailboxAiSettings: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
13
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
13
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
14
14
|
userId: string;
|
|
15
15
|
claims: import("@supabase/auth-js").User;
|
|
16
16
|
}, undefined, undefined, undefined>], (input: unknown) => {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// Beheer van de centrale systeemprompt en verplichte velden voor de mailbox-AI.
|
|
2
2
|
import { createServerFn } from "@tanstack/react-start";
|
|
3
|
-
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware";
|
|
3
|
+
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
|
-
import { DEFAULT_MAILBOX_SYSTEM_PROMPT, DEFAULT_REQUIRED_FIELDS } from "./mailbox-ai-prompt";
|
|
5
|
+
import { DEFAULT_MAILBOX_SYSTEM_PROMPT, DEFAULT_REQUIRED_FIELDS } from "./mailbox-ai-prompt.js";
|
|
6
6
|
export const getMailboxAiSettings = createServerFn({ method: "GET" })
|
|
7
7
|
.middleware([requireSupabaseAuth])
|
|
8
8
|
.handler(async ({ context }) => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SupabaseClient } from "@supabase/supabase-js";
|
|
2
|
-
import type { Database } from "../integrations/supabase/types";
|
|
3
|
-
import { DEFAULT_MAILBOX_SYSTEM_PROMPT } from "./mailbox-ai-prompt";
|
|
2
|
+
import type { Database } from "../integrations/supabase/types.js";
|
|
3
|
+
import { DEFAULT_MAILBOX_SYSTEM_PROMPT } from "./mailbox-ai-prompt.js";
|
|
4
4
|
export { DEFAULT_MAILBOX_SYSTEM_PROMPT };
|
|
5
5
|
type AdminClient = SupabaseClient<Database>;
|
|
6
6
|
export declare const MAILBOX_AI_MODULE_KEY = "mailbox-bestellingen";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// AI-parsing van bestelmails. De provider, het model en de API-sleutel komen
|
|
2
2
|
// uit de centrale AI-Authenticatie module (zie ai-config.server.ts).
|
|
3
3
|
// Er wordt GEEN gebruik gemaakt van Lovable AI / de Lovable AI Gateway.
|
|
4
|
-
import { resolveModuleAi, logAiCall } from "./ai-config.server";
|
|
5
|
-
import { DEFAULT_MAILBOX_SYSTEM_PROMPT } from "./mailbox-ai-prompt";
|
|
4
|
+
import { resolveModuleAi, logAiCall } from "./ai-config.server.js";
|
|
5
|
+
import { DEFAULT_MAILBOX_SYSTEM_PROMPT } from "./mailbox-ai-prompt.js";
|
|
6
6
|
export { DEFAULT_MAILBOX_SYSTEM_PROMPT };
|
|
7
7
|
export const MAILBOX_AI_MODULE_KEY = "mailbox-bestellingen";
|
|
8
8
|
/** Huidige vingerafdruk van de gekoppelde AI-agent, of null als AI niet beschikbaar is. */
|
|
@@ -261,7 +261,7 @@ export class AiUnavailableError extends Error {
|
|
|
261
261
|
}
|
|
262
262
|
}
|
|
263
263
|
export async function parseOrderEmail(admin, args) {
|
|
264
|
-
const { resolveModuleAiAll } = await import("./ai-config.server");
|
|
264
|
+
const { resolveModuleAiAll } = await import("./ai-config.server.js");
|
|
265
265
|
const resolution = await resolveModuleAiAll(admin, MAILBOX_AI_MODULE_KEY);
|
|
266
266
|
if (!resolution.ok)
|
|
267
267
|
throw new AiUnavailableError(resolution.reason, false, 0);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
async function parseOneMessage(messageId) {
|
|
2
|
-
const { supabaseAdmin } = await import("../integrations/supabase/client.server");
|
|
2
|
+
const { supabaseAdmin } = await import("../integrations/supabase/client.server.js");
|
|
3
3
|
const { data: msg, error: msgErr } = await supabaseAdmin
|
|
4
4
|
.from("mailbox_messages").select("*").eq("id", messageId).single();
|
|
5
5
|
if (msgErr || !msg)
|
|
@@ -48,7 +48,7 @@ async function parseOneMessage(messageId) {
|
|
|
48
48
|
allowed,
|
|
49
49
|
};
|
|
50
50
|
});
|
|
51
|
-
const { parseOrderEmail } = await import("./mailbox-ai.server");
|
|
51
|
+
const { parseOrderEmail } = await import("./mailbox-ai.server.js");
|
|
52
52
|
const parsed = await parseOrderEmail(msg.body_text ?? msg.body_html ?? "", msg.subject ?? "", spec, catalog);
|
|
53
53
|
const customerId = parsed.fields["customer"]?.value;
|
|
54
54
|
const deliveryDate = parsed.fields["delivery_date"]?.value;
|
|
@@ -113,7 +113,7 @@ async function parseOneMessage(messageId) {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
async function autoApproveProposal(args) {
|
|
116
|
-
const { supabaseAdmin } = await import("../integrations/supabase/client.server");
|
|
116
|
+
const { supabaseAdmin } = await import("../integrations/supabase/client.server.js");
|
|
117
117
|
const customFields = {};
|
|
118
118
|
for (const [k, v] of Object.entries(args.parsed.fields)) {
|
|
119
119
|
customFields[k] = v.value ?? null;
|
|
@@ -155,7 +155,7 @@ async function autoApproveProposal(args) {
|
|
|
155
155
|
return true;
|
|
156
156
|
}
|
|
157
157
|
export async function autoProcessNewMessagesInternal() {
|
|
158
|
-
const { supabaseAdmin } = await import("../integrations/supabase/client.server");
|
|
158
|
+
const { supabaseAdmin } = await import("../integrations/supabase/client.server.js");
|
|
159
159
|
const { data: newMsgs } = await supabaseAdmin
|
|
160
160
|
.from("mailbox_messages")
|
|
161
161
|
.select("id")
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SupabaseClient } from "@supabase/supabase-js";
|
|
2
|
-
import type { Database } from "../integrations/supabase/types";
|
|
2
|
+
import type { Database } from "../integrations/supabase/types.js";
|
|
3
3
|
type AdminClient = SupabaseClient<Database>;
|
|
4
4
|
/** Centrale AI-instellingen van deze module (aanpasbaar via Instellingen). */
|
|
5
5
|
export declare function loadMailboxAiSettings(admin: AdminClient): Promise<{
|
|
@@ -11,7 +11,7 @@ export declare function loadMailboxAiSettings(admin: AdminClient): Promise<{
|
|
|
11
11
|
* verplichte velden. Ontbrekende of onzekere gegevens worden expliciet
|
|
12
12
|
* benoemd in plaats van stilzwijgend leeg gelaten.
|
|
13
13
|
*/
|
|
14
|
-
export declare function computeValidation(parsed: import("./mailbox-ai.server").ParsedOrder, requiredFields: string[], extra: {
|
|
14
|
+
export declare function computeValidation(parsed: import("./mailbox-ai.server.js").ParsedOrder, requiredFields: string[], extra: {
|
|
15
15
|
customerId: string | null;
|
|
16
16
|
}): {
|
|
17
17
|
missing: string[];
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
// GEEN imports van "@/integrations/supabase/client.server" op module-scope —
|
|
9
9
|
// die worden per aanroep dynamisch geladen (client-reachable modules mogen
|
|
10
10
|
// server-only helpers niet direct binnenhalen).
|
|
11
|
-
import { emailBodyText } from "./mailbox-body";
|
|
12
|
-
import { detectLoadCarrierInText, isLoadCarrierAllowed, loadCarrierLabel, normalizeAllowedLoadCarriers, } from "./load-carriers";
|
|
11
|
+
import { emailBodyText } from "./mailbox-body.js";
|
|
12
|
+
import { detectLoadCarrierInText, isLoadCarrierAllowed, loadCarrierLabel, normalizeAllowedLoadCarriers, } from "./load-carriers.js";
|
|
13
13
|
/**
|
|
14
14
|
* Ladingdragers komen live uit de Logistics Engine — nooit cachen, nooit een
|
|
15
15
|
* eigen lijst bijhouden.
|
|
@@ -216,7 +216,7 @@ async function aiParseMessage(admin, messageId, customerId) {
|
|
|
216
216
|
if (!bodyText.trim())
|
|
217
217
|
throw new Error("Bericht bevat geen tekst om te lezen.");
|
|
218
218
|
const ctx = await buildAiContext(admin, customerId);
|
|
219
|
-
const { parseOrderEmail } = await import("./mailbox-ai.server");
|
|
219
|
+
const { parseOrderEmail } = await import("./mailbox-ai.server.js");
|
|
220
220
|
const res = await parseOrderEmail(admin, {
|
|
221
221
|
bodyText,
|
|
222
222
|
subject: msg?.subject ?? "",
|
|
@@ -231,7 +231,7 @@ async function aiParseMessage(admin, messageId, customerId) {
|
|
|
231
231
|
}
|
|
232
232
|
catch (e) {
|
|
233
233
|
const msg = String(e?.message ?? e);
|
|
234
|
-
const { isTransientAiError } = await import("./mailbox-ai.server");
|
|
234
|
+
const { isTransientAiError } = await import("./mailbox-ai.server.js");
|
|
235
235
|
const transient = e?.name === "AiUnavailableError" ? Boolean(e.transient) : isTransientAiError(msg);
|
|
236
236
|
return { parsed: null, meta: null, error: msg.slice(0, 500), transient, requiredFields: [] };
|
|
237
237
|
}
|
|
@@ -426,7 +426,7 @@ export async function createStubProposal(admin, messageId, fromEmail) {
|
|
|
426
426
|
auto_match_candidates: matchResult.candidates,
|
|
427
427
|
};
|
|
428
428
|
// --- AI-parse (best effort) ---------------------------------------------
|
|
429
|
-
const { currentAiFingerprint } = await import("./mailbox-ai.server");
|
|
429
|
+
const { currentAiFingerprint } = await import("./mailbox-ai.server.js");
|
|
430
430
|
const fingerprint = await currentAiFingerprint(admin).catch(() => null);
|
|
431
431
|
const attempt = await aiParseMessage(admin, messageId, matchResult.customerId);
|
|
432
432
|
const parsed = attempt.parsed;
|
|
@@ -557,7 +557,7 @@ export async function reparseProposal(admin, proposalId) {
|
|
|
557
557
|
const rematch = matchedCustomerId ? null : await matchCustomerByEmail(admin, senderEmail);
|
|
558
558
|
if (rematch?.customerId)
|
|
559
559
|
matchedCustomerId = rematch.customerId;
|
|
560
|
-
const { currentAiFingerprint } = await import("./mailbox-ai.server");
|
|
560
|
+
const { currentAiFingerprint } = await import("./mailbox-ai.server.js");
|
|
561
561
|
const fingerprint = await currentAiFingerprint(admin).catch(() => null);
|
|
562
562
|
const attempt = await aiParseMessage(admin, prop.message_id, matchedCustomerId);
|
|
563
563
|
const prevBase = (prop.parsed_payload && typeof prop.parsed_payload === "object" ? prop.parsed_payload : {});
|
|
@@ -663,7 +663,7 @@ export async function reparseProposal(admin, proposalId) {
|
|
|
663
663
|
* opgeslagen vingerafdruk afwijkt van de huidige worden opnieuw geanalyseerd.
|
|
664
664
|
*/
|
|
665
665
|
export async function reparseChangedAgentProposals(admin, limit = 25) {
|
|
666
|
-
const { currentAiFingerprint } = await import("./mailbox-ai.server");
|
|
666
|
+
const { currentAiFingerprint } = await import("./mailbox-ai.server.js");
|
|
667
667
|
const fingerprint = await currentAiFingerprint(admin).catch(() => null);
|
|
668
668
|
if (!fingerprint)
|
|
669
669
|
return { checked: 0, reparsed: 0, failed: 0, fingerprint: null };
|
|
@@ -799,7 +799,7 @@ async function ingestSingleEvent(admin, connectionId, ev) {
|
|
|
799
799
|
}
|
|
800
800
|
// De volledige pipeline. Alle triggers roepen dit aan.
|
|
801
801
|
export async function runIngest(trigger) {
|
|
802
|
-
const { supabaseAdmin } = await import("../integrations/supabase/client.server");
|
|
802
|
+
const { supabaseAdmin } = await import("../integrations/supabase/client.server.js");
|
|
803
803
|
// 1. Actieve orders/receive connectie ophalen (service_role → geen bearer nodig).
|
|
804
804
|
const { data: active, error: activeErr } = await supabaseAdmin.rpc("email_auth_for_purpose", {
|
|
805
805
|
_purpose: "orders",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const listTemplateFields: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
2
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
2
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
3
3
|
userId: string;
|
|
4
4
|
claims: import("@supabase/auth-js").User;
|
|
5
5
|
}, undefined, undefined, undefined>], undefined, Promise<{
|
|
@@ -7,12 +7,12 @@ export declare const listTemplateFields: import("@tanstack/start-client-core").O
|
|
|
7
7
|
ai_enabled: boolean;
|
|
8
8
|
ai_hint: string | null;
|
|
9
9
|
created_at: string;
|
|
10
|
-
default_value: import("../integrations/supabase/types").Json | null;
|
|
10
|
+
default_value: import("../integrations/supabase/types.js").Json | null;
|
|
11
11
|
field_type: string;
|
|
12
12
|
id: string;
|
|
13
13
|
key: string;
|
|
14
14
|
label: string;
|
|
15
|
-
options: import("../integrations/supabase/types").Json | null;
|
|
15
|
+
options: import("../integrations/supabase/types.js").Json | null;
|
|
16
16
|
required: boolean;
|
|
17
17
|
sort_order: number;
|
|
18
18
|
source: string;
|
|
@@ -22,7 +22,7 @@ export declare const listTemplateFields: import("@tanstack/start-client-core").O
|
|
|
22
22
|
}[];
|
|
23
23
|
}>>;
|
|
24
24
|
export declare const upsertTemplateField: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
25
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
25
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
26
26
|
userId: string;
|
|
27
27
|
claims: import("@supabase/auth-js").User;
|
|
28
28
|
}, undefined, undefined, undefined>], (input: unknown) => {
|
|
@@ -47,7 +47,7 @@ export declare const upsertTemplateField: import("@tanstack/start-client-core").
|
|
|
47
47
|
id: string;
|
|
48
48
|
}>>;
|
|
49
49
|
export declare const deleteTemplateField: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
50
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
50
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
51
51
|
userId: string;
|
|
52
52
|
claims: import("@supabase/auth-js").User;
|
|
53
53
|
}, undefined, undefined, undefined>], (input: unknown) => {
|
|
@@ -56,7 +56,7 @@ export declare const deleteTemplateField: import("@tanstack/start-client-core").
|
|
|
56
56
|
ok: true;
|
|
57
57
|
}>>;
|
|
58
58
|
export declare const reorderTemplateFields: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
59
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
59
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
60
60
|
userId: string;
|
|
61
61
|
claims: import("@supabase/auth-js").User;
|
|
62
62
|
}, undefined, undefined, undefined>], (input: unknown) => {
|
|
@@ -65,7 +65,7 @@ export declare const reorderTemplateFields: import("@tanstack/start-client-core"
|
|
|
65
65
|
ok: true;
|
|
66
66
|
}>>;
|
|
67
67
|
export declare const listPlantTypesForPicker: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
68
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
68
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
69
69
|
userId: string;
|
|
70
70
|
claims: import("@supabase/auth-js").User;
|
|
71
71
|
}, undefined, undefined, undefined>], undefined, Promise<{
|
|
@@ -75,7 +75,7 @@ export declare const listPlantTypesForPicker: import("@tanstack/start-client-cor
|
|
|
75
75
|
}[];
|
|
76
76
|
}>>;
|
|
77
77
|
export declare const listSuppliersForPicker: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
78
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
78
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
79
79
|
userId: string;
|
|
80
80
|
claims: import("@supabase/auth-js").User;
|
|
81
81
|
}, undefined, undefined, undefined>], undefined, Promise<{
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// CRUD voor de configureerbare ordertemplate.
|
|
2
2
|
import { createServerFn } from "@tanstack/react-start";
|
|
3
|
-
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware";
|
|
3
|
+
import { requireSupabaseAuth } from "../integrations/supabase/auth-middleware.js";
|
|
4
4
|
import { z } from "zod";
|
|
5
5
|
const FieldType = z.enum([
|
|
6
6
|
"text", "number", "date", "select", "multiselect",
|
|
@@ -34,7 +34,7 @@ export declare const getActiveOrdersMailbox: import("@tanstack/start-client-core
|
|
|
34
34
|
}>>;
|
|
35
35
|
export declare const syncMailboxNow: import("@tanstack/start-client-core").OptionalFetcher<undefined, (input: unknown) => {
|
|
36
36
|
trigger: "realtime" | "manual";
|
|
37
|
-
}, Promise<import("../lib/mailbox-ingest.server").IngestRunResult | {
|
|
37
|
+
}, Promise<import("../lib/mailbox-ingest.server.js").IngestRunResult | {
|
|
38
38
|
ok: false;
|
|
39
39
|
error: string;
|
|
40
40
|
processed: 0;
|
|
@@ -42,7 +42,7 @@ export declare const syncMailboxNow: import("@tanstack/start-client-core").Optio
|
|
|
42
42
|
errors: 1;
|
|
43
43
|
}>>;
|
|
44
44
|
export declare const getLastIngestRun: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
45
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
45
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
46
46
|
userId: string;
|
|
47
47
|
claims: import("@supabase/auth-js").User;
|
|
48
48
|
}, undefined, undefined, undefined>], undefined, Promise<{
|
|
@@ -59,7 +59,7 @@ export declare const getLastIngestRun: import("@tanstack/start-client-core").Opt
|
|
|
59
59
|
}>>;
|
|
60
60
|
/** Handmatig één voorstel opnieuw laten analyseren met de huidige AI-agent. */
|
|
61
61
|
export declare const reparseProposalNow: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
62
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
62
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
63
63
|
userId: string;
|
|
64
64
|
claims: import("@supabase/auth-js").User;
|
|
65
65
|
}, undefined, undefined, undefined>], (input: unknown) => {
|
|
@@ -70,7 +70,7 @@ export declare const reparseProposalNow: import("@tanstack/start-client-core").O
|
|
|
70
70
|
}>>;
|
|
71
71
|
/** Detecteert een gewijzigde AI-agent en herverwerkt openstaande voorstellen. */
|
|
72
72
|
export declare const refreshProposalsForAgentChange: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
73
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
73
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
74
74
|
userId: string;
|
|
75
75
|
claims: import("@supabase/auth-js").User;
|
|
76
76
|
}, undefined, undefined, undefined>], undefined, Promise<{
|
|
@@ -80,7 +80,7 @@ export declare const refreshProposalsForAgentChange: import("@tanstack/start-cli
|
|
|
80
80
|
fingerprint: string | null;
|
|
81
81
|
}>>;
|
|
82
82
|
export declare const listMessages: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
83
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
83
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
84
84
|
userId: string;
|
|
85
85
|
claims: import("@supabase/auth-js").User;
|
|
86
86
|
}, undefined, undefined, undefined>], undefined, Promise<{
|
|
@@ -97,7 +97,7 @@ export declare const listMessages: import("@tanstack/start-client-core").Optiona
|
|
|
97
97
|
}[];
|
|
98
98
|
}>>;
|
|
99
99
|
export declare const parseMessage: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
100
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
100
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
101
101
|
userId: string;
|
|
102
102
|
claims: import("@supabase/auth-js").User;
|
|
103
103
|
}, undefined, undefined, undefined>], (input: unknown) => {
|
|
@@ -106,7 +106,7 @@ export declare const parseMessage: import("@tanstack/start-client-core").Optiona
|
|
|
106
106
|
ok: true;
|
|
107
107
|
}>>;
|
|
108
108
|
export declare const listProposals: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
109
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
109
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
110
110
|
userId: string;
|
|
111
111
|
claims: import("@supabase/auth-js").User;
|
|
112
112
|
}, undefined, undefined, undefined>], (input: unknown) => {
|
|
@@ -116,7 +116,7 @@ export declare const listProposals: import("@tanstack/start-client-core").Option
|
|
|
116
116
|
}>>;
|
|
117
117
|
/** Eén voorstel volledig: mailtekst, bestelregels en veldwaarden. */
|
|
118
118
|
export declare const getProposalDetail: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
119
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
119
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
120
120
|
userId: string;
|
|
121
121
|
claims: import("@supabase/auth-js").User;
|
|
122
122
|
}, undefined, undefined, undefined>], (input: unknown) => {
|
|
@@ -125,17 +125,17 @@ export declare const getProposalDetail: import("@tanstack/start-client-core").Op
|
|
|
125
125
|
item: any;
|
|
126
126
|
}>>;
|
|
127
127
|
export declare const listAllowedLoadCarriers: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
128
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
128
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
129
129
|
userId: string;
|
|
130
130
|
claims: import("@supabase/auth-js").User;
|
|
131
131
|
}, undefined, undefined, undefined>], undefined, Promise<{
|
|
132
132
|
error: string | null;
|
|
133
133
|
allowed: string[];
|
|
134
134
|
default: string | null;
|
|
135
|
-
carriers: import("./load-carriers").EngineLoadCarrier[];
|
|
135
|
+
carriers: import("./load-carriers.js").EngineLoadCarrier[];
|
|
136
136
|
}>>;
|
|
137
137
|
export declare const approveProposal: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
138
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
138
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
139
139
|
userId: string;
|
|
140
140
|
claims: import("@supabase/auth-js").User;
|
|
141
141
|
}, undefined, undefined, undefined>], (input: unknown) => {
|
|
@@ -163,7 +163,7 @@ export declare const approveProposal: import("@tanstack/start-client-core").Opti
|
|
|
163
163
|
shortages: any[];
|
|
164
164
|
}>>;
|
|
165
165
|
export declare const rejectProposal: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
166
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
166
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
167
167
|
userId: string;
|
|
168
168
|
claims: import("@supabase/auth-js").User;
|
|
169
169
|
}, undefined, undefined, undefined>], (input: unknown) => {
|
|
@@ -173,7 +173,7 @@ export declare const rejectProposal: import("@tanstack/start-client-core").Optio
|
|
|
173
173
|
ok: true;
|
|
174
174
|
}>>;
|
|
175
175
|
export declare const reopenProposal: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
176
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
176
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
177
177
|
userId: string;
|
|
178
178
|
claims: import("@supabase/auth-js").User;
|
|
179
179
|
}, undefined, undefined, undefined>], (input: unknown) => {
|
|
@@ -182,14 +182,14 @@ export declare const reopenProposal: import("@tanstack/start-client-core").Optio
|
|
|
182
182
|
ok: true;
|
|
183
183
|
}>>;
|
|
184
184
|
export declare const listCustomersForPicker: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
185
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
185
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
186
186
|
userId: string;
|
|
187
187
|
claims: import("@supabase/auth-js").User;
|
|
188
188
|
}, undefined, undefined, undefined>], undefined, Promise<{
|
|
189
189
|
items: any[];
|
|
190
190
|
}>>;
|
|
191
191
|
export declare const createCustomerFromGroup: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
192
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
192
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
193
193
|
userId: string;
|
|
194
194
|
claims: import("@supabase/auth-js").User;
|
|
195
195
|
}, undefined, undefined, undefined>], (input: unknown) => {
|
|
@@ -211,7 +211,7 @@ export declare const createCustomerFromGroup: import("@tanstack/start-client-cor
|
|
|
211
211
|
created: true;
|
|
212
212
|
}>>;
|
|
213
213
|
export declare const listProductsForPicker: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
214
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
214
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
215
215
|
userId: string;
|
|
216
216
|
claims: import("@supabase/auth-js").User;
|
|
217
217
|
}, undefined, undefined, undefined>], undefined, Promise<{
|
|
@@ -219,7 +219,7 @@ export declare const listProductsForPicker: import("@tanstack/start-client-core"
|
|
|
219
219
|
allowBackorder: boolean;
|
|
220
220
|
}>>;
|
|
221
221
|
export declare const planAndSaveAutoCarts: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
222
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
222
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
223
223
|
userId: string;
|
|
224
224
|
claims: import("@supabase/auth-js").User;
|
|
225
225
|
}, undefined, undefined, undefined>], (input: unknown) => {
|
|
@@ -250,7 +250,7 @@ export declare const planAndSaveAutoCarts: import("@tanstack/start-client-core")
|
|
|
250
250
|
nextCartNumber: number;
|
|
251
251
|
}>>;
|
|
252
252
|
export declare const saveManualCarts: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
253
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
253
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
254
254
|
userId: string;
|
|
255
255
|
claims: import("@supabase/auth-js").User;
|
|
256
256
|
}, undefined, undefined, undefined>], (input: unknown) => {
|
|
@@ -271,7 +271,7 @@ export declare const saveManualCarts: import("@tanstack/start-client-core").Opti
|
|
|
271
271
|
ok: true;
|
|
272
272
|
}>>;
|
|
273
273
|
export declare const listOrderCarts: import("@tanstack/start-client-core").RequiredFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
274
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
274
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
275
275
|
userId: string;
|
|
276
276
|
claims: import("@supabase/auth-js").User;
|
|
277
277
|
}, undefined, undefined, undefined>], (d: {
|
|
@@ -288,7 +288,7 @@ export declare const listOrderCarts: import("@tanstack/start-client-core").Requi
|
|
|
288
288
|
order_cart_items: {
|
|
289
289
|
boxes: number | null;
|
|
290
290
|
cart_id: string;
|
|
291
|
-
components: import("../integrations/supabase/types").Json | null;
|
|
291
|
+
components: import("../integrations/supabase/types.js").Json | null;
|
|
292
292
|
crates: number;
|
|
293
293
|
crates_in_layer: number | null;
|
|
294
294
|
crates_per_layer: number;
|
|
@@ -307,7 +307,7 @@ export declare const listOrderCarts: import("@tanstack/start-client-core").Requi
|
|
|
307
307
|
}[];
|
|
308
308
|
}>>;
|
|
309
309
|
export declare const listDeliveryLocationsForCustomer: import("@tanstack/start-client-core").RequiredFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
310
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
310
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
311
311
|
userId: string;
|
|
312
312
|
claims: import("@supabase/auth-js").User;
|
|
313
313
|
}, undefined, undefined, undefined>], (d: {
|
|
@@ -334,7 +334,7 @@ export declare const listDeliveryLocationsForCustomer: import("@tanstack/start-c
|
|
|
334
334
|
}[];
|
|
335
335
|
}>>;
|
|
336
336
|
export declare const listPickupLocations: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
337
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
337
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
338
338
|
userId: string;
|
|
339
339
|
claims: import("@supabase/auth-js").User;
|
|
340
340
|
}, undefined, undefined, undefined>], undefined, Promise<{
|
|
@@ -346,7 +346,7 @@ export declare const listPickupLocations: import("@tanstack/start-client-core").
|
|
|
346
346
|
}[];
|
|
347
347
|
}>>;
|
|
348
348
|
export declare const listCarriersForPicker: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
349
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
349
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
350
350
|
userId: string;
|
|
351
351
|
claims: import("@supabase/auth-js").User;
|
|
352
352
|
}, undefined, undefined, undefined>], undefined, Promise<{
|
|
@@ -358,18 +358,18 @@ export declare const listCarriersForPicker: import("@tanstack/start-client-core"
|
|
|
358
358
|
delivery_days: number | null;
|
|
359
359
|
pickup_weekdays: number[];
|
|
360
360
|
delivery_weekdays: number[];
|
|
361
|
-
pickup_moments: import("../integrations/supabase/types").Json;
|
|
361
|
+
pickup_moments: import("../integrations/supabase/types.js").Json;
|
|
362
362
|
}[];
|
|
363
363
|
}>>;
|
|
364
364
|
export declare const getOrderPickDays: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
365
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
365
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
366
366
|
userId: string;
|
|
367
367
|
claims: import("@supabase/auth-js").User;
|
|
368
368
|
}, undefined, undefined, undefined>], undefined, Promise<{
|
|
369
369
|
pickDays: number;
|
|
370
370
|
}>>;
|
|
371
371
|
export declare const listBeladingOptionsForProducts: import("@tanstack/start-client-core").OptionalFetcher<readonly [import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
372
|
-
supabase: import("../integrations/supabase/auth-middleware").AuthedSupabaseClient;
|
|
372
|
+
supabase: import("../integrations/supabase/auth-middleware.js").AuthedSupabaseClient;
|
|
373
373
|
userId: string;
|
|
374
374
|
claims: import("@supabase/auth-js").User;
|
|
375
375
|
}, undefined, undefined, undefined>], (input: unknown) => {
|