@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
|
@@ -4,7 +4,7 @@ import { useQuery } from "@tanstack/react-query";
|
|
|
4
4
|
import { useServerFn } from "@tanstack/react-start";
|
|
5
5
|
import { Button, Badge, Card, CardContent, CardHeader, CardTitle, Input, Label, Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, toast, } from "@flowselections/core";
|
|
6
6
|
import { Plus, Trash2, AlertTriangle, CheckCircle2 } from "lucide-react";
|
|
7
|
-
import { planAndSaveAutoCarts, saveManualCarts } from "../lib/mailbox.functions";
|
|
7
|
+
import { planAndSaveAutoCarts, saveManualCarts } from "../lib/mailbox.functions.js";
|
|
8
8
|
export function CartAssignmentWizard({ orderId, open, onClose, }) {
|
|
9
9
|
const fetchPlan = useServerFn(planAndSaveAutoCarts);
|
|
10
10
|
const fetchSave = useServerFn(saveManualCarts);
|
|
@@ -4,8 +4,8 @@ import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
|
|
4
4
|
import { useServerFn } from "@tanstack/react-start";
|
|
5
5
|
import { Button, Badge, Card, CardContent, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, toast, } from "@flowselections/core";
|
|
6
6
|
import { Mail, Sparkles, AlertCircle, ExternalLink, RefreshCw } from "lucide-react";
|
|
7
|
-
import { listMessages, parseMessage, getActiveOrdersMailbox, ingestEmailEvent, backfillRecentEvents, } from "../lib/mailbox.functions";
|
|
8
|
-
import { supabase } from "../integrations/supabase/client";
|
|
7
|
+
import { listMessages, parseMessage, getActiveOrdersMailbox, ingestEmailEvent, backfillRecentEvents, } from "../lib/mailbox.functions.js";
|
|
8
|
+
import { supabase } from "../integrations/supabase/client.js";
|
|
9
9
|
const AUTH_MODULE_URL = "https://auth.flowselections.com/e-mail-authenticatie";
|
|
10
10
|
const STATUS_VARIANT = {
|
|
11
11
|
new: "secondary",
|
|
@@ -4,10 +4,10 @@ import { useQuery, useQueryClient } from "@tanstack/react-query";
|
|
|
4
4
|
import { useServerFn } from "@tanstack/react-start";
|
|
5
5
|
import { toast } from "sonner";
|
|
6
6
|
import { Badge, Button, Card, CardContent, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, } from "@flowselections/core";
|
|
7
|
-
import { listProposals, reopenProposal, getActiveOrdersMailbox } from "../lib/mailbox.functions";
|
|
8
|
-
import { MailboxAuthBanner } from "./MailboxAuthBanner";
|
|
9
|
-
import { TablePagination } from "./TablePagination";
|
|
10
|
-
import { MailboxFilterBar, usePersistedState, normalizeText, matchesPeriod } from "./MailboxFilterBar";
|
|
7
|
+
import { listProposals, reopenProposal, getActiveOrdersMailbox } from "../lib/mailbox.functions.js";
|
|
8
|
+
import { MailboxAuthBanner } from "./MailboxAuthBanner.js";
|
|
9
|
+
import { TablePagination } from "./TablePagination.js";
|
|
10
|
+
import { MailboxFilterBar, usePersistedState, normalizeText, matchesPeriod } from "./MailboxFilterBar.js";
|
|
11
11
|
export function MailboxProcessedPage() {
|
|
12
12
|
const fetchList = useServerFn(listProposals);
|
|
13
13
|
const reopen = useServerFn(reopenProposal);
|
|
@@ -4,16 +4,16 @@ import { useQuery, useQueryClient, useMutation } from "@tanstack/react-query";
|
|
|
4
4
|
import { useServerFn } from "@tanstack/react-start";
|
|
5
5
|
import { Button, Badge, Card, CardContent, CardHeader, CardTitle, Input, Label, Textarea, Switch, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Dialog, DialogContent, DialogHeader, DialogTitle, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, toast, } from "@flowselections/core";
|
|
6
6
|
import { Check, X, Trash2, Plus, AlertTriangle, RefreshCw } from "lucide-react";
|
|
7
|
-
import { computeEarliestDelivery, isValidDeliveryDate } from "../lib/delivery-date";
|
|
8
|
-
import { listProposals, getProposalDetail, approveProposal, rejectProposal, listCustomersForPicker, createCustomerFromGroup, listProductsForPicker, listDeliveryLocationsForCustomer, listPickupLocations, listCarriersForPicker, getOrderPickDays, getActiveOrdersMailbox, syncMailboxNow, refreshProposalsForAgentChange, reparseProposalNow, listBeladingOptionsForProducts, listAllowedLoadCarriers, } from "../lib/mailbox.functions";
|
|
9
|
-
import { enabledLoadCarriers, normalizeAllowedLoadCarriers, EMPTY_LOAD_CARRIERS } from "../lib/load-carriers";
|
|
10
|
-
import { listTemplateFields, listPlantTypesForPicker, listSuppliersForPicker, } from "../lib/mailbox-template.functions";
|
|
11
|
-
import { SearchableSelect } from "./SearchableSelect";
|
|
12
|
-
import { MailboxAuthBanner } from "./MailboxAuthBanner";
|
|
13
|
-
import { EmailPreview } from "./EmailPreview";
|
|
14
|
-
import { TablePagination } from "./TablePagination";
|
|
15
|
-
import { MailboxFilterBar, usePersistedState, normalizeText, matchesPeriod } from "./MailboxFilterBar";
|
|
16
|
-
import { supabase } from "../integrations/supabase/client";
|
|
7
|
+
import { computeEarliestDelivery, isValidDeliveryDate } from "../lib/delivery-date.js";
|
|
8
|
+
import { listProposals, getProposalDetail, approveProposal, rejectProposal, listCustomersForPicker, createCustomerFromGroup, listProductsForPicker, listDeliveryLocationsForCustomer, listPickupLocations, listCarriersForPicker, getOrderPickDays, getActiveOrdersMailbox, syncMailboxNow, refreshProposalsForAgentChange, reparseProposalNow, listBeladingOptionsForProducts, listAllowedLoadCarriers, } from "../lib/mailbox.functions.js";
|
|
9
|
+
import { enabledLoadCarriers, normalizeAllowedLoadCarriers, EMPTY_LOAD_CARRIERS } from "../lib/load-carriers.js";
|
|
10
|
+
import { listTemplateFields, listPlantTypesForPicker, listSuppliersForPicker, } from "../lib/mailbox-template.functions.js";
|
|
11
|
+
import { SearchableSelect } from "./SearchableSelect.js";
|
|
12
|
+
import { MailboxAuthBanner } from "./MailboxAuthBanner.js";
|
|
13
|
+
import { EmailPreview } from "./EmailPreview.js";
|
|
14
|
+
import { TablePagination } from "./TablePagination.js";
|
|
15
|
+
import { MailboxFilterBar, usePersistedState, normalizeText, matchesPeriod } from "./MailboxFilterBar.js";
|
|
16
|
+
import { supabase } from "../integrations/supabase/client.js";
|
|
17
17
|
const beladingKey = (b) => `${b.plants_per_crate}x${b.crates_per_layer}x${b.layers_per_cart}|${b.crate_code ?? ""}|${b.carrier_code ?? ""}`;
|
|
18
18
|
const beladingLabel = (b) => `${b.plants_per_crate} planten/fust · ${b.crates_per_layer} fusten/laag · ${b.layers_per_cart} lagen`;
|
|
19
19
|
// Extra regel onder het label: fusten/kar + fusttype + kartype
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Button, Input, Label, Switch, Badge, Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, toast, } from "@flowselections/core";
|
|
4
4
|
import { Server, Plus, Pencil, Trash2, TestTube2, RefreshCw, CheckCircle2, PlayCircle } from "lucide-react";
|
|
5
|
-
import { listImapAccounts, upsertImapAccount, deleteImapAccount, testImapAccount, listImapProfiles, activateImapAccount, pollImapProfile, } from "../../lib/imap.functions";
|
|
5
|
+
import { listImapAccounts, upsertImapAccount, deleteImapAccount, testImapAccount, listImapProfiles, activateImapAccount, pollImapProfile, } from "../../lib/imap.functions.js";
|
|
6
6
|
const emptyAccount = {
|
|
7
7
|
id: undefined,
|
|
8
8
|
name: "",
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Button, Input, Label, Switch, Badge, Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, Table, TableBody, TableCell, TableHead, TableHeader, TableRow, toast, } from "@flowselections/core";
|
|
4
4
|
import { Inbox, Plus, Pencil, Trash2, RefreshCw, PlayCircle } from "lucide-react";
|
|
5
|
-
import { listImapAccounts, listImapProfiles, upsertImapProfile, deleteImapProfile, setProfileAccount, pollImapProfile, } from "../../lib/imap.functions";
|
|
5
|
+
import { listImapAccounts, listImapProfiles, upsertImapProfile, deleteImapProfile, setProfileAccount, pollImapProfile, } from "../../lib/imap.functions.js";
|
|
6
6
|
const emptyProfile = {
|
|
7
7
|
id: undefined,
|
|
8
8
|
profile_key: "",
|
|
@@ -3,8 +3,8 @@ import { useEffect, useState } from "react";
|
|
|
3
3
|
import { useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
|
|
4
4
|
import { useServerFn } from "@tanstack/react-start";
|
|
5
5
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Button, Label, Textarea, Badge, toast, } from "@flowselections/core";
|
|
6
|
-
import { getMailboxAiSettings, saveMailboxAiSettings } from "../../lib/mailbox-ai-settings.functions";
|
|
7
|
-
import { REQUIRED_FIELD_CHOICES, DEFAULT_REQUIRED_FIELDS } from "../../lib/mailbox-ai-prompt";
|
|
6
|
+
import { getMailboxAiSettings, saveMailboxAiSettings } from "../../lib/mailbox-ai-settings.functions.js";
|
|
7
|
+
import { REQUIRED_FIELD_CHOICES, DEFAULT_REQUIRED_FIELDS } from "../../lib/mailbox-ai-prompt.js";
|
|
8
8
|
export function MailboxAiPromptCard() {
|
|
9
9
|
const qc = useQueryClient();
|
|
10
10
|
const fetchSettings = useServerFn(getMailboxAiSettings);
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Button, Input, Label, Switch, Textarea, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, toast, } from "@flowselections/core";
|
|
4
4
|
import { Settings2, Plus, Trash2, ArrowUp, ArrowDown } from "lucide-react";
|
|
5
|
-
import { listTemplateFields, upsertTemplateField, deleteTemplateField, reorderTemplateFields, } from "../../lib/mailbox-template.functions";
|
|
5
|
+
import { listTemplateFields, upsertTemplateField, deleteTemplateField, reorderTemplateFields, } from "../../lib/mailbox-template.functions.js";
|
|
6
6
|
const FIELD_TYPES = [
|
|
7
7
|
{ value: "text", label: "Tekst", defaultSource: "static" },
|
|
8
8
|
{ value: "number", label: "Nummer", defaultSource: "static" },
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { useEffect, useState } from "react";
|
|
3
3
|
import { Card, CardContent, CardDescription, CardHeader, CardTitle, Button, Input, Label, Switch, toast, } from "@flowselections/core";
|
|
4
4
|
import { Mail, RefreshCw } from "lucide-react";
|
|
5
|
-
import { getMailboxSettings, saveMailboxSettings, testMailboxConnection, pollMailbox, } from "../../lib/mailbox.functions";
|
|
5
|
+
import { getMailboxSettings, saveMailboxSettings, testMailboxConnection, pollMailbox, } from "../../lib/mailbox.functions.js";
|
|
6
6
|
export function MailboxSettingsCard() {
|
|
7
7
|
const [form, setForm] = useState({
|
|
8
8
|
imap_host: "",
|
package/dist-lib/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { FlowModule } from "@flowselections/core";
|
|
2
|
-
export * from "./_core-safelist";
|
|
3
|
-
export { MailboxProposalsPage } from "./components/MailboxProposalsPage";
|
|
4
|
-
export { SearchableSelect } from "./components/SearchableSelect";
|
|
5
|
-
export { MailboxProcessedPage } from "./components/MailboxProcessedPage";
|
|
6
|
-
export { EmailPreview } from "./components/EmailPreview";
|
|
7
|
-
export { TablePagination } from "./components/TablePagination";
|
|
8
|
-
export { MailboxFilterBar } from "./components/MailboxFilterBar";
|
|
2
|
+
export * from "./_core-safelist.js";
|
|
3
|
+
export { MailboxProposalsPage } from "./components/MailboxProposalsPage.js";
|
|
4
|
+
export { SearchableSelect } from "./components/SearchableSelect.js";
|
|
5
|
+
export { MailboxProcessedPage } from "./components/MailboxProcessedPage.js";
|
|
6
|
+
export { EmailPreview } from "./components/EmailPreview.js";
|
|
7
|
+
export { TablePagination } from "./components/TablePagination.js";
|
|
8
|
+
export { MailboxFilterBar } from "./components/MailboxFilterBar.js";
|
|
9
9
|
export declare const mailboxOrdersModule: FlowModule;
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist-lib/index.js
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
// src/index.ts — MODULE CONTRACT (Mailbox bestellingen)
|
|
3
3
|
// ============================================================================
|
|
4
4
|
import { Mail, ClipboardCheck, CheckCircle2 } from "lucide-react";
|
|
5
|
-
import { MailboxOrderTemplateCard } from "./components/settings/MailboxOrderTemplateCard";
|
|
6
|
-
import { MailboxAiPromptCard } from "./components/settings/MailboxAiPromptCard";
|
|
7
|
-
export * from "./_core-safelist";
|
|
8
|
-
export { MailboxProposalsPage } from "./components/MailboxProposalsPage";
|
|
9
|
-
export { SearchableSelect } from "./components/SearchableSelect";
|
|
10
|
-
export { MailboxProcessedPage } from "./components/MailboxProcessedPage";
|
|
11
|
-
export { EmailPreview } from "./components/EmailPreview";
|
|
12
|
-
export { TablePagination } from "./components/TablePagination";
|
|
13
|
-
export { MailboxFilterBar } from "./components/MailboxFilterBar";
|
|
5
|
+
import { MailboxOrderTemplateCard } from "./components/settings/MailboxOrderTemplateCard.js";
|
|
6
|
+
import { MailboxAiPromptCard } from "./components/settings/MailboxAiPromptCard.js";
|
|
7
|
+
export * from "./_core-safelist.js";
|
|
8
|
+
export { MailboxProposalsPage } from "./components/MailboxProposalsPage.js";
|
|
9
|
+
export { SearchableSelect } from "./components/SearchableSelect.js";
|
|
10
|
+
export { MailboxProcessedPage } from "./components/MailboxProcessedPage.js";
|
|
11
|
+
export { EmailPreview } from "./components/EmailPreview.js";
|
|
12
|
+
export { TablePagination } from "./components/TablePagination.js";
|
|
13
|
+
export { MailboxFilterBar } from "./components/MailboxFilterBar.js";
|
|
14
14
|
export const mailboxOrdersModule = {
|
|
15
15
|
id: "mailbox_orders",
|
|
16
16
|
name: "Mailbox bestellingen",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SupabaseClient } from '@supabase/supabase-js';
|
|
2
|
-
import type { Database } from './types';
|
|
2
|
+
import type { Database } from './types.js';
|
|
3
3
|
export interface AuthedSupabaseClient extends SupabaseClient<Database> {
|
|
4
4
|
}
|
|
5
5
|
export declare const requireSupabaseAuth: import("@tanstack/start-client-core").FunctionMiddlewareAfterServer<{}, unknown, undefined, {
|
|
@@ -42,7 +42,7 @@ export const requireSupabaseAuth = createMiddleware({ type: 'function' }).server
|
|
|
42
42
|
if (!data.user.id) {
|
|
43
43
|
throw new Response('Unauthorized: No user ID found in token', { status: 401 });
|
|
44
44
|
}
|
|
45
|
-
const { supabaseAdmin } = await import('./client.server');
|
|
45
|
+
const { supabaseAdmin } = await import('./client.server.js');
|
|
46
46
|
return next({
|
|
47
47
|
context: {
|
|
48
48
|
supabase: supabaseAdmin,
|
|
@@ -20,7 +20,7 @@ function createSupabaseAdminClient() {
|
|
|
20
20
|
let _supabaseAdmin;
|
|
21
21
|
// Server-side Supabase client with service role - bypasses RLS
|
|
22
22
|
// SECURITY: Only use this for trusted server-side operations, never expose to client code
|
|
23
|
-
// Import like: import { supabaseAdmin } from "../../integrations/supabase/client.server";
|
|
23
|
+
// Import like: import { supabaseAdmin } from "../../integrations/supabase/client.server.js";
|
|
24
24
|
export const supabaseAdmin = new Proxy({}, {
|
|
25
25
|
get(_, prop, receiver) {
|
|
26
26
|
if (!_supabaseAdmin)
|