@gadicc/loom 1.16.0 → 1.17.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.
- package/README.md +14 -0
- package/esm/_dnt.polyfills.d.ts +6 -0
- package/esm/_dnt.polyfills.d.ts.map +1 -1
- package/esm/mod.d.ts +2 -0
- package/esm/mod.d.ts.map +1 -1
- package/esm/mod.js +2 -0
- package/esm/src/cli/migrationEnv.d.ts +5 -0
- package/esm/src/cli/migrationEnv.d.ts.map +1 -1
- package/esm/src/cli/migrationEnv.js +10 -0
- package/esm/src/cli/mod.d.ts +1 -1
- package/esm/src/cli/mod.d.ts.map +1 -1
- package/esm/src/cli/mod.js +1065 -5
- package/esm/src/mail/errors.d.ts +33 -0
- package/esm/src/mail/errors.d.ts.map +1 -0
- package/esm/src/mail/errors.js +89 -0
- package/esm/src/mail/memory.d.ts +30 -0
- package/esm/src/mail/memory.d.ts.map +1 -0
- package/esm/src/mail/memory.js +340 -0
- package/esm/src/mail/mod.d.ts +7 -0
- package/esm/src/mail/mod.d.ts.map +1 -0
- package/esm/src/mail/mod.js +6 -0
- package/esm/src/mail/postal.d.ts +57 -0
- package/esm/src/mail/postal.d.ts.map +1 -0
- package/esm/src/mail/postal.js +238 -0
- package/esm/src/mail/retry.d.ts +9 -0
- package/esm/src/mail/retry.d.ts.map +1 -0
- package/esm/src/mail/retry.js +19 -0
- package/esm/src/mail/service.d.ts +23 -0
- package/esm/src/mail/service.d.ts.map +1 -0
- package/esm/src/mail/service.js +185 -0
- package/esm/src/mail/types.d.ts +176 -0
- package/esm/src/mail/types.d.ts.map +1 -0
- package/esm/src/mail/types.js +1 -0
- package/esm/src/mui/mail.d.ts +29 -0
- package/esm/src/mui/mail.d.ts.map +1 -0
- package/esm/src/mui/mail.js +114 -0
- package/esm/src/mui/mailView.d.ts +20 -0
- package/esm/src/mui/mailView.d.ts.map +1 -0
- package/esm/src/mui/mailView.js +26 -0
- package/esm/src/mui/mod.d.ts +1 -0
- package/esm/src/mui/mod.d.ts.map +1 -1
- package/esm/src/mui/mod.js +1 -0
- package/esm/src/next/mail/mod.d.ts +3 -0
- package/esm/src/next/mail/mod.d.ts.map +1 -0
- package/esm/src/next/mail/mod.js +2 -0
- package/esm/src/next/mail/route.d.ts +12 -0
- package/esm/src/next/mail/route.d.ts.map +1 -0
- package/esm/src/next/mail/route.js +43 -0
- package/package.json +55 -2
- package/script/_dnt.polyfills.d.ts +6 -0
- package/script/_dnt.polyfills.d.ts.map +1 -1
- package/script/mod.d.ts +2 -0
- package/script/mod.d.ts.map +1 -1
- package/script/mod.js +2 -0
- package/script/src/cli/migrationEnv.d.ts +5 -0
- package/script/src/cli/migrationEnv.d.ts.map +1 -1
- package/script/src/cli/migrationEnv.js +11 -0
- package/script/src/cli/mod.d.ts +1 -1
- package/script/src/cli/mod.d.ts.map +1 -1
- package/script/src/cli/mod.js +1064 -4
- package/script/src/mail/errors.d.ts +33 -0
- package/script/src/mail/errors.d.ts.map +1 -0
- package/script/src/mail/errors.js +97 -0
- package/script/src/mail/memory.d.ts +30 -0
- package/script/src/mail/memory.d.ts.map +1 -0
- package/script/src/mail/memory.js +345 -0
- package/script/src/mail/mod.d.ts +7 -0
- package/script/src/mail/mod.d.ts.map +1 -0
- package/script/src/mail/mod.js +22 -0
- package/script/src/mail/postal.d.ts +57 -0
- package/script/src/mail/postal.d.ts.map +1 -0
- package/script/src/mail/postal.js +245 -0
- package/script/src/mail/retry.d.ts +9 -0
- package/script/src/mail/retry.d.ts.map +1 -0
- package/script/src/mail/retry.js +22 -0
- package/script/src/mail/service.d.ts +23 -0
- package/script/src/mail/service.d.ts.map +1 -0
- package/script/src/mail/service.js +189 -0
- package/script/src/mail/types.d.ts +176 -0
- package/script/src/mail/types.d.ts.map +1 -0
- package/script/src/mail/types.js +2 -0
- package/script/src/mui/mail.d.ts +29 -0
- package/script/src/mui/mail.d.ts.map +1 -0
- package/script/src/mui/mail.js +159 -0
- package/script/src/mui/mailView.d.ts +20 -0
- package/script/src/mui/mailView.d.ts.map +1 -0
- package/script/src/mui/mailView.js +32 -0
- package/script/src/mui/mod.d.ts +1 -0
- package/script/src/mui/mod.d.ts.map +1 -1
- package/script/src/mui/mod.js +1 -0
- package/script/src/next/mail/mod.d.ts +3 -0
- package/script/src/next/mail/mod.d.ts.map +1 -0
- package/script/src/next/mail/mod.js +18 -0
- package/script/src/next/mail/route.d.ts +12 -0
- package/script/src/next/mail/route.d.ts.map +1 -0
- package/script/src/next/mail/route.js +46 -0
- package/skills/loom/SKILL.md +5 -0
- package/skills/loom-db/SKILL.md +6 -3
- package/skills/loom-mail/SKILL.md +68 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/src/mail/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAC7B,WAAW,GACX,WAAW,GACX,QAAQ,GACR,qBAAqB,GACrB,QAAQ,GACR,SAAS,GACT,MAAM,CAAC;AAEX,MAAM,MAAM,sBAAsB,GAC9B,UAAU,GACV,SAAS,GACT,WAAW,GACX,SAAS,GACT,WAAW,GACX,QAAQ,GACR,MAAM,GACN,QAAQ,CAAC;AAEb,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC;AAExD,MAAM,MAAM,yBAAyB,GACjC,SAAS,GACT,SAAS,GACT,WAAW,GACX,QAAQ,GACR,MAAM,GACN,SAAS,CAAC;AAEd,MAAM,WAAW,kBAAkB;IACjC,WAAW,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACnC,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACxB,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;I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AS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB,MAAM,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC1B,eAAe,CAAC,EAAE,uBAAuB,CAAC;CAC3C;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,eAAe,CAC9B,QAAQ,SAAS,qBAAqB,GAAG,qBAAqB;IAE9D,UAAU,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAChD,WAAW,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,uBAAuB,GAAG,IAAI,CAAC,CAAC;IACzE,KAAK,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;IACpD,mBAAmB,CACjB,KAAK,EAAE,qBAAqB,GAC3B,OAAO,CAAC,2BAA2B,CAAC,CAAC;IACxC,SAAS,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IACnD,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC;QACtC,OAAO,EAAE,QAAQ,CAAC;QAClB,MAAM,EAAE,uBAAuB,CAAC;KACjC,CAAC,CAAC;CACJ"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import "../../_dnt.polyfills.js";
|
|
2
|
+
import { type MailAdminRow } from "./mailView.js";
|
|
3
|
+
export * from "./mailView.js";
|
|
4
|
+
export interface MailTestActionState {
|
|
5
|
+
message: string | null;
|
|
6
|
+
messageId?: string;
|
|
7
|
+
status: "error" | "idle" | "success";
|
|
8
|
+
}
|
|
9
|
+
export type MailTestAction = (previous: MailTestActionState, formData: FormData) => Promise<MailTestActionState>;
|
|
10
|
+
export type MailRowAction = (formData: FormData) => Promise<void>;
|
|
11
|
+
export interface MailTestFormProps {
|
|
12
|
+
action: MailTestAction;
|
|
13
|
+
defaultSubject?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
}
|
|
16
|
+
/** Reusable admin-only form. The injected server action must enforce auth. */
|
|
17
|
+
export declare function MailTestForm(props: MailTestFormProps): any;
|
|
18
|
+
export interface MailLogTableProps {
|
|
19
|
+
cancelAction?: MailRowAction;
|
|
20
|
+
detailsBasePath?: string;
|
|
21
|
+
retryAction?: MailRowAction;
|
|
22
|
+
rows: MailAdminRow[];
|
|
23
|
+
}
|
|
24
|
+
export declare function MailLogTable(props: MailLogTableProps): any;
|
|
25
|
+
export interface AdminMailConsoleProps extends MailLogTableProps {
|
|
26
|
+
testAction: MailTestAction;
|
|
27
|
+
}
|
|
28
|
+
export declare function AdminMailConsole(props: AdminMailConsoleProps): any;
|
|
29
|
+
//# sourceMappingURL=mail.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mail.d.ts","sourceRoot":"","sources":["../../../src/src/mui/mail.tsx"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AAoBjC,OAAO,EAIL,KAAK,YAAY,EAElB,MAAM,eAAe,CAAC;AAEvB,cAAc,eAAe,CAAC;AAE9B,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;CACtC;AAED,MAAM,MAAM,cAAc,GAAG,CAC3B,QAAQ,EAAE,mBAAmB,EAC7B,QAAQ,EAAE,QAAQ,KACf,OAAO,CAAC,mBAAmB,CAAC,CAAC;AAElC,MAAM,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;AAgBlE,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,cAAc,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,8EAA8E;AAC9E,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,OAwEpD;AAED,MAAM,WAAW,iBAAiB;IAChC,YAAY,CAAC,EAAE,aAAa,CAAC;IAC7B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,aAAa,CAAC;IAC5B,IAAI,EAAE,YAAY,EAAE,CAAC;CACtB;AAED,wBAAgB,YAAY,CAAC,KAAK,EAAE,iBAAiB,OA+GpD;AAED,MAAM,WAAW,qBAAsB,SAAQ,iBAAiB;IAC9D,UAAU,EAAE,cAAc,CAAC;CAC5B;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,OA0B5D"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
36
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
37
|
+
};
|
|
38
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.MailTestForm = MailTestForm;
|
|
43
|
+
exports.MailLogTable = MailLogTable;
|
|
44
|
+
exports.AdminMailConsole = AdminMailConsole;
|
|
45
|
+
require("../../_dnt.polyfills.js");
|
|
46
|
+
"use client";
|
|
47
|
+
const Alert_1 = __importDefault(require("@mui/material/Alert"));
|
|
48
|
+
const Button_1 = __importDefault(require("@mui/material/Button"));
|
|
49
|
+
const Chip_1 = __importDefault(require("@mui/material/Chip"));
|
|
50
|
+
const Paper_1 = __importDefault(require("@mui/material/Paper"));
|
|
51
|
+
const Stack_1 = __importDefault(require("@mui/material/Stack"));
|
|
52
|
+
const Tab_1 = __importDefault(require("@mui/material/Tab"));
|
|
53
|
+
const Table_1 = __importDefault(require("@mui/material/Table"));
|
|
54
|
+
const TableBody_1 = __importDefault(require("@mui/material/TableBody"));
|
|
55
|
+
const TableCell_1 = __importDefault(require("@mui/material/TableCell"));
|
|
56
|
+
const TableContainer_1 = __importDefault(require("@mui/material/TableContainer"));
|
|
57
|
+
const TableHead_1 = __importDefault(require("@mui/material/TableHead"));
|
|
58
|
+
const TableRow_1 = __importDefault(require("@mui/material/TableRow"));
|
|
59
|
+
const Tabs_1 = __importDefault(require("@mui/material/Tabs"));
|
|
60
|
+
const TextField_1 = __importDefault(require("@mui/material/TextField"));
|
|
61
|
+
const Typography_1 = __importDefault(require("@mui/material/Typography"));
|
|
62
|
+
const react_1 = __importStar(require("react"));
|
|
63
|
+
const react_dom_1 = require("react-dom");
|
|
64
|
+
const mailView_js_1 = require("./mailView.js");
|
|
65
|
+
__exportStar(require("./mailView.js"), exports);
|
|
66
|
+
const initialTestState = {
|
|
67
|
+
message: null,
|
|
68
|
+
status: "idle",
|
|
69
|
+
};
|
|
70
|
+
function SubmitMailButton() {
|
|
71
|
+
const { pending } = (0, react_dom_1.useFormStatus)();
|
|
72
|
+
return (react_1.default.createElement(Button_1.default, { type: "submit", variant: "contained", disabled: pending }, pending ? "Sending…" : "Send test email"));
|
|
73
|
+
}
|
|
74
|
+
/** Reusable admin-only form. The injected server action must enforce auth. */
|
|
75
|
+
function MailTestForm(props) {
|
|
76
|
+
const [state, formAction] = (0, react_1.useActionState)(props.action, initialTestState);
|
|
77
|
+
const formRef = (0, react_1.useRef)(null);
|
|
78
|
+
(0, react_1.useEffect)(() => {
|
|
79
|
+
if (state.status === "success") {
|
|
80
|
+
formRef.current?.reset();
|
|
81
|
+
}
|
|
82
|
+
}, [state.status]);
|
|
83
|
+
return (react_1.default.createElement(Stack_1.default, { component: "form", action: formAction, ref: formRef, spacing: 2, noValidate: true },
|
|
84
|
+
react_1.default.createElement(Typography_1.default, { variant: "h6" }, "Test / one-off email"),
|
|
85
|
+
react_1.default.createElement(Typography_1.default, { color: "text.secondary" }, props.description ??
|
|
86
|
+
"Verify sender configuration and delivery while recording the attempt in the mail log."),
|
|
87
|
+
state.message
|
|
88
|
+
? (react_1.default.createElement(Alert_1.default, { severity: state.status === "success" ? "success" : "error" },
|
|
89
|
+
state.message,
|
|
90
|
+
state.messageId ? ` Message ID: ${state.messageId}` : null))
|
|
91
|
+
: null,
|
|
92
|
+
react_1.default.createElement(TextField_1.default, { name: "to", label: "To", required: true, fullWidth: true, helperText: "Separate multiple recipients with commas or new lines." }),
|
|
93
|
+
react_1.default.createElement(Stack_1.default, { direction: { xs: "column", md: "row" }, spacing: 2 },
|
|
94
|
+
react_1.default.createElement(TextField_1.default, { name: "cc", label: "CC", fullWidth: true }),
|
|
95
|
+
react_1.default.createElement(TextField_1.default, { name: "bcc", label: "BCC", fullWidth: true })),
|
|
96
|
+
react_1.default.createElement(Stack_1.default, { direction: { xs: "column", md: "row" }, spacing: 2 },
|
|
97
|
+
react_1.default.createElement(TextField_1.default, { name: "replyTo", label: "Reply-To", fullWidth: true }),
|
|
98
|
+
react_1.default.createElement(TextField_1.default, { name: "tag", label: "Tag", fullWidth: true })),
|
|
99
|
+
react_1.default.createElement(TextField_1.default, { name: "subject", label: "Subject", defaultValue: props.defaultSubject, required: true, fullWidth: true }),
|
|
100
|
+
react_1.default.createElement(TextField_1.default, { name: "plainBody", label: "Plain text body", fullWidth: true, multiline: true, minRows: 6 }),
|
|
101
|
+
react_1.default.createElement(TextField_1.default, { name: "htmlBody", label: "HTML body", fullWidth: true, multiline: true, minRows: 8 }),
|
|
102
|
+
react_1.default.createElement("div", null,
|
|
103
|
+
react_1.default.createElement(SubmitMailButton, null))));
|
|
104
|
+
}
|
|
105
|
+
function MailLogTable(props) {
|
|
106
|
+
if (props.rows.length === 0) {
|
|
107
|
+
return (react_1.default.createElement(Stack_1.default, { spacing: 1, sx: { p: 3 } },
|
|
108
|
+
react_1.default.createElement(Typography_1.default, { variant: "h6" }, "No mail yet"),
|
|
109
|
+
react_1.default.createElement(Typography_1.default, { color: "text.secondary" }, "Messages appear here after they are queued.")));
|
|
110
|
+
}
|
|
111
|
+
return (react_1.default.createElement(TableContainer_1.default, { component: Paper_1.default },
|
|
112
|
+
react_1.default.createElement(Table_1.default, { size: "small" },
|
|
113
|
+
react_1.default.createElement(TableHead_1.default, null,
|
|
114
|
+
react_1.default.createElement(TableRow_1.default, null,
|
|
115
|
+
react_1.default.createElement(TableCell_1.default, null, "Subject"),
|
|
116
|
+
react_1.default.createElement(TableCell_1.default, null, "Status"),
|
|
117
|
+
react_1.default.createElement(TableCell_1.default, null, "Recipients"),
|
|
118
|
+
react_1.default.createElement(TableCell_1.default, null, "Provider ID"),
|
|
119
|
+
react_1.default.createElement(TableCell_1.default, null, "Created"),
|
|
120
|
+
react_1.default.createElement(TableCell_1.default, { align: "right" }, "Actions"))),
|
|
121
|
+
react_1.default.createElement(TableBody_1.default, null, props.rows.map((row) => (react_1.default.createElement(TableRow_1.default, { key: row.id, hover: true },
|
|
122
|
+
react_1.default.createElement(TableCell_1.default, null,
|
|
123
|
+
react_1.default.createElement(Stack_1.default, { spacing: 0.5 },
|
|
124
|
+
react_1.default.createElement(Typography_1.default, { variant: "body2", sx: { fontWeight: 600 } }, row.subject),
|
|
125
|
+
react_1.default.createElement(Typography_1.default, { variant: "caption", color: "text.secondary" }, row.tag ?? "untagged"))),
|
|
126
|
+
react_1.default.createElement(TableCell_1.default, null,
|
|
127
|
+
react_1.default.createElement(Chip_1.default, { label: row.status.replaceAll("_", " "), color: (0, mailView_js_1.mailStatusColor)(row.status), size: "small" })),
|
|
128
|
+
react_1.default.createElement(TableCell_1.default, null, row.recipients.map((recipient) => recipient.email).join(", ") ||
|
|
129
|
+
"None"),
|
|
130
|
+
react_1.default.createElement(TableCell_1.default, null,
|
|
131
|
+
react_1.default.createElement(Typography_1.default, { variant: "caption" }, row.providerMessageId ?? "Pending")),
|
|
132
|
+
react_1.default.createElement(TableCell_1.default, null,
|
|
133
|
+
react_1.default.createElement(Typography_1.default, { variant: "caption" }, (0, mailView_js_1.formatMailAdminDate)(row.createdAt))),
|
|
134
|
+
react_1.default.createElement(TableCell_1.default, { align: "right" },
|
|
135
|
+
react_1.default.createElement(Stack_1.default, { direction: { xs: "column", md: "row" }, spacing: 1 },
|
|
136
|
+
props.detailsBasePath
|
|
137
|
+
? (react_1.default.createElement(Button_1.default, { component: "a", href: `${props.detailsBasePath}/${row.id}`, size: "small" }, "View"))
|
|
138
|
+
: null,
|
|
139
|
+
props.retryAction
|
|
140
|
+
? (react_1.default.createElement("form", { action: props.retryAction },
|
|
141
|
+
react_1.default.createElement("input", { type: "hidden", name: "messageId", value: row.id }),
|
|
142
|
+
react_1.default.createElement(Button_1.default, { size: "small", type: "submit", disabled: !(0, mailView_js_1.canRetryMail)(row.status) }, "Retry")))
|
|
143
|
+
: null,
|
|
144
|
+
props.cancelAction
|
|
145
|
+
? (react_1.default.createElement("form", { action: props.cancelAction },
|
|
146
|
+
react_1.default.createElement("input", { type: "hidden", name: "messageId", value: row.id }),
|
|
147
|
+
react_1.default.createElement(Button_1.default, { size: "small", type: "submit", color: "error", disabled: !(0, mailView_js_1.canCancelMail)(row.status) }, "Cancel")))
|
|
148
|
+
: null)))))))));
|
|
149
|
+
}
|
|
150
|
+
function AdminMailConsole(props) {
|
|
151
|
+
const [tab, setTab] = (0, react_1.useState)(0);
|
|
152
|
+
return (react_1.default.createElement(Paper_1.default, null,
|
|
153
|
+
react_1.default.createElement(Tabs_1.default, { value: tab, onChange: (_event, value) => setTab(value), "aria-label": "Mail administration" },
|
|
154
|
+
react_1.default.createElement(Tab_1.default, { label: "Mail log" }),
|
|
155
|
+
react_1.default.createElement(Tab_1.default, { label: "Send test" })),
|
|
156
|
+
react_1.default.createElement(Stack_1.default, { sx: { p: 3 } }, tab === 0
|
|
157
|
+
? (react_1.default.createElement(MailLogTable, { cancelAction: props.cancelAction, detailsBasePath: props.detailsBasePath, retryAction: props.retryAction, rows: props.rows }))
|
|
158
|
+
: react_1.default.createElement(MailTestForm, { action: props.testAction }))));
|
|
159
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { LoomMailMessageStatus, LoomMailRecipientKind } from "../mail/types.js";
|
|
2
|
+
export interface MailAdminRecipientRow {
|
|
3
|
+
email: string;
|
|
4
|
+
kind: LoomMailRecipientKind;
|
|
5
|
+
status?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface MailAdminRow {
|
|
8
|
+
createdAt: string;
|
|
9
|
+
id: string;
|
|
10
|
+
providerMessageId?: string | null;
|
|
11
|
+
recipients: MailAdminRecipientRow[];
|
|
12
|
+
status: LoomMailMessageStatus;
|
|
13
|
+
subject: string;
|
|
14
|
+
tag?: string | null;
|
|
15
|
+
}
|
|
16
|
+
export declare function mailStatusColor(status: LoomMailMessageStatus): "error" | "info" | "success" | "default" | "warning";
|
|
17
|
+
export declare function formatMailAdminDate(value: string): string;
|
|
18
|
+
export declare function canCancelMail(status: LoomMailMessageStatus): status is "failed" | "queued";
|
|
19
|
+
export declare function canRetryMail(status: LoomMailMessageStatus): status is "failed" | "cancelled";
|
|
20
|
+
//# sourceMappingURL=mailView.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mailView.d.ts","sourceRoot":"","sources":["../../../src/src/mui/mailView.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAE1B,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,qBAAqB,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,YAAY;IAC3B,SAAS,EAAE,MAAM,CAAC;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,iBAAiB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,UAAU,EAAE,qBAAqB,EAAE,CAAC;IACpC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,qBAAqB,wDAe5D;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,UAGhD;AAED,wBAAgB,aAAa,CAAC,MAAM,EAAE,qBAAqB,iCAE1D;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,qBAAqB,oCAEzD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.mailStatusColor = mailStatusColor;
|
|
4
|
+
exports.formatMailAdminDate = formatMailAdminDate;
|
|
5
|
+
exports.canCancelMail = canCancelMail;
|
|
6
|
+
exports.canRetryMail = canRetryMail;
|
|
7
|
+
function mailStatusColor(status) {
|
|
8
|
+
switch (status) {
|
|
9
|
+
case "delivered":
|
|
10
|
+
return "success";
|
|
11
|
+
case "failed":
|
|
12
|
+
case "partially_delivered":
|
|
13
|
+
return "error";
|
|
14
|
+
case "sent":
|
|
15
|
+
return "info";
|
|
16
|
+
case "queued":
|
|
17
|
+
case "sending":
|
|
18
|
+
return "warning";
|
|
19
|
+
case "cancelled":
|
|
20
|
+
return "default";
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function formatMailAdminDate(value) {
|
|
24
|
+
const date = new Date(value);
|
|
25
|
+
return Number.isNaN(date.valueOf()) ? value : date.toLocaleString();
|
|
26
|
+
}
|
|
27
|
+
function canCancelMail(status) {
|
|
28
|
+
return status === "queued" || status === "failed";
|
|
29
|
+
}
|
|
30
|
+
function canRetryMail(status) {
|
|
31
|
+
return status === "failed" || status === "cancelled";
|
|
32
|
+
}
|
package/script/src/mui/mod.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/mui/mod.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../src/src/mui/mod.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC"}
|
package/script/src/mui/mod.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../src/src/next/mail/mod.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAC;AACpC,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
require("../../../_dnt.polyfills.js");
|
|
18
|
+
__exportStar(require("./route.js"), exports);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { LoomMailProviderEvent, LoomMailProviderEventResult } from "../../mail/types.js";
|
|
2
|
+
import type { PostalWebhookPublicKey } from "../../mail/postal.js";
|
|
3
|
+
export interface CreatePostalWebhookRouteHandlerOptions {
|
|
4
|
+
handleEvent: (event: LoomMailProviderEvent) => Promise<LoomMailProviderEventResult>;
|
|
5
|
+
publicKeys: readonly PostalWebhookPublicKey[] | (() => readonly PostalWebhookPublicKey[]);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Next.js-compatible Postal webhook handler. Signature verification always
|
|
9
|
+
* runs against the exact raw text before JSON parsing or persistence.
|
|
10
|
+
*/
|
|
11
|
+
export declare function createPostalWebhookRouteHandler(options: CreatePostalWebhookRouteHandlerOptions): (request: Request) => Promise<any>;
|
|
12
|
+
//# sourceMappingURL=route.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"route.d.ts","sourceRoot":"","sources":["../../../../src/src/next/mail/route.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,2BAA2B,EAC5B,MAAM,qBAAqB,CAAC;AAM7B,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAEnE,MAAM,WAAW,sCAAsC;IACrD,WAAW,EAAE,CACX,KAAK,EAAE,qBAAqB,KACzB,OAAO,CAAC,2BAA2B,CAAC,CAAC;IAC1C,UAAU,EACN,SAAS,sBAAsB,EAAE,GACjC,CAAC,MAAM,SAAS,sBAAsB,EAAE,CAAC,CAAC;CAC/C;AASD;;;GAGG;AACH,wBAAgB,+BAA+B,CAC7C,OAAO,EAAE,sCAAsC,IAEpB,SAAS,OAAO,kBAyC5C"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createPostalWebhookRouteHandler = createPostalWebhookRouteHandler;
|
|
4
|
+
const postal_js_1 = require("../../mail/postal.js");
|
|
5
|
+
function json(body, status) {
|
|
6
|
+
return Response.json(body, {
|
|
7
|
+
headers: { "Cache-Control": "no-store" },
|
|
8
|
+
status,
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Next.js-compatible Postal webhook handler. Signature verification always
|
|
13
|
+
* runs against the exact raw text before JSON parsing or persistence.
|
|
14
|
+
*/
|
|
15
|
+
function createPostalWebhookRouteHandler(options) {
|
|
16
|
+
return async function POST(request) {
|
|
17
|
+
try {
|
|
18
|
+
const body = await request.text();
|
|
19
|
+
const publicKeys = typeof options.publicKeys === "function"
|
|
20
|
+
? options.publicKeys()
|
|
21
|
+
: options.publicKeys;
|
|
22
|
+
await (0, postal_js_1.verifyPostalWebhookSignature)({
|
|
23
|
+
body,
|
|
24
|
+
headers: request.headers,
|
|
25
|
+
publicKeys,
|
|
26
|
+
});
|
|
27
|
+
const event = (0, postal_js_1.parsePostalWebhook)(body);
|
|
28
|
+
const result = await options.handleEvent(event);
|
|
29
|
+
if (result.messageId === null) {
|
|
30
|
+
return json({ code: "mail_message_not_found", error: "Mail message not found." }, 503);
|
|
31
|
+
}
|
|
32
|
+
return json({ accepted: true, duplicate: !result.inserted }, 202);
|
|
33
|
+
}
|
|
34
|
+
catch (error) {
|
|
35
|
+
if (error instanceof postal_js_1.LoomPostalWebhookError) {
|
|
36
|
+
return json({
|
|
37
|
+
code: error.code,
|
|
38
|
+
error: error.status >= 500
|
|
39
|
+
? "Webhook configuration failed."
|
|
40
|
+
: error.message,
|
|
41
|
+
}, error.status);
|
|
42
|
+
}
|
|
43
|
+
return json({ code: "webhook_processing_failed", error: "Webhook failed." }, 500);
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
}
|
package/skills/loom/SKILL.md
CHANGED
|
@@ -72,6 +72,11 @@ from the consumer's working directory.
|
|
|
72
72
|
only for migration validation and the migration command. Readable pulled URLs
|
|
73
73
|
and the legacy `DATABASE_URL_UNPOOLED` secret remain supported during gradual
|
|
74
74
|
adoption.
|
|
75
|
+
- Validate the migration boundary with
|
|
76
|
+
`loom db migrations verify-env
|
|
77
|
+
--env-file "$RUNNER_TEMP/vercel-production.env"`
|
|
78
|
+
so the optional protected migration secret overlays the untouched readable
|
|
79
|
+
pull snapshot instead of replacing that gradual-adoption fallback.
|
|
75
80
|
|
|
76
81
|
## Re-establishing work context
|
|
77
82
|
|
package/skills/loom-db/SKILL.md
CHANGED
|
@@ -86,9 +86,12 @@ Use this skill when working on the shared DB stack from a consuming app.
|
|
|
86
86
|
the prebuilt artifact. Prefer `loom db release prepare-build-env` and
|
|
87
87
|
`loom db release verify-build-env`; keep only the declarative requirements
|
|
88
88
|
policy app-local.
|
|
89
|
-
- Use
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
- Use
|
|
90
|
+
`loom db migrations verify-env --env-file
|
|
91
|
+
"$RUNNER_TEMP/vercel-production.env"`
|
|
92
|
+
before a release migration. It validates the preserved pull snapshot plus any
|
|
93
|
+
process-level migration-secret overlay, including URL precedence, database
|
|
94
|
+
role, and direct-vs-pooled endpoint, without printing credentials.
|
|
92
95
|
- Once a dedicated direct URL has been provisioned, load it as
|
|
93
96
|
`MIGRATION_DATABASE_URL_UNPOOLED` in the local process and run
|
|
94
97
|
`loom db migrations setup-github`. Loom sends the value to GitHub over stdin,
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: loom-mail
|
|
3
|
+
description: Use when the task mentions the Loom mail feature, Postal outgoing mail or signed webhooks, mail outbox jobs, or admin test mail.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Loom mail
|
|
7
|
+
|
|
8
|
+
Use this skill together with the global `loom` skill. Read `loom.json` before
|
|
9
|
+
changing a consumer and treat `features.mail.config` as the path/provider/UI
|
|
10
|
+
contract.
|
|
11
|
+
|
|
12
|
+
## Ownership
|
|
13
|
+
|
|
14
|
+
- Keep message rendering and domain delivery policy in the consumer.
|
|
15
|
+
- Use `@gadicc/loom/mail` for enqueue/lease/retry/event orchestration.
|
|
16
|
+
- Use `@gadicc/loom/mail/postal` for Postal HTTP and signed webhook behavior.
|
|
17
|
+
- Keep the Drizzle repository and migrations app-local. Never hide migrations
|
|
18
|
+
inside Loom.
|
|
19
|
+
- Preserve `authorizeMailAdmin()` on every admin page and server action. The
|
|
20
|
+
generated implementation intentionally denies all access until the app wires a
|
|
21
|
+
fresh session and admin-role check.
|
|
22
|
+
|
|
23
|
+
## Adding mail
|
|
24
|
+
|
|
25
|
+
1. Ensure Loom DB and auth features are active.
|
|
26
|
+
2. Run `loom add mail`.
|
|
27
|
+
3. Review the materialized schema and generate the app-local migration.
|
|
28
|
+
4. Replace the generated deny-all access function with the app's admin check.
|
|
29
|
+
5. Configure `POSTAL_API_KEY`, `POSTAL_HOST`, `POSTAL_FROM_EMAIL`, and
|
|
30
|
+
`POSTAL_WEBHOOK_PUBLIC_KEYS`. The last value is a JSON array of RSA public
|
|
31
|
+
JWKs with `kid`; it is not a shared secret.
|
|
32
|
+
6. If jobs is active, register the generated `mail-drain` module in the app's
|
|
33
|
+
full and metadata catalogs and choose an app-owned schedule.
|
|
34
|
+
7. Configure Postal to POST signed events to the generated webhook route.
|
|
35
|
+
8. Run `loom check`; use `loom check --production` before release.
|
|
36
|
+
|
|
37
|
+
## Delivery invariants
|
|
38
|
+
|
|
39
|
+
- Repository claim and completion methods are atomic transaction boundaries.
|
|
40
|
+
- A completion must match message id plus lease token.
|
|
41
|
+
- Postal API acceptance means `sent`, not `delivered`.
|
|
42
|
+
- Track provider ids and events per recipient.
|
|
43
|
+
- Deduplicate webhook events by provider plus event UUID.
|
|
44
|
+
- Verify the exact raw body with `X-Postal-Signature-KID` and
|
|
45
|
+
`X-Postal-Signature-256` before parsing.
|
|
46
|
+
- Treat timeout/network retries as at-least-once ambiguity; do not claim Postal
|
|
47
|
+
supports an idempotency key.
|
|
48
|
+
- Bound attachment size at the app/action boundary and never log attachment
|
|
49
|
+
bodies, API keys, or webhook key material.
|
|
50
|
+
|
|
51
|
+
## Testing
|
|
52
|
+
|
|
53
|
+
- Use the memory repository/transport for lease, retry, cancellation, and
|
|
54
|
+
provider-event tests.
|
|
55
|
+
- Test the app-local Drizzle repository with its PGlite harness, especially live
|
|
56
|
+
lease exclusion, expired lease recovery, stale completion, and event replay.
|
|
57
|
+
- Sign webhook fixtures with an ephemeral RSA test key; do not bypass signature
|
|
58
|
+
verification in route tests.
|
|
59
|
+
- Verify the admin test-mail action rejects non-admin sessions.
|
|
60
|
+
|
|
61
|
+
## AptHunt compatibility
|
|
62
|
+
|
|
63
|
+
Keep AptHunt's watchlist renderer and notification-delivery claim/backoff logic
|
|
64
|
+
local. Its `sendEmail` export may remain as a thin compatibility wrapper over
|
|
65
|
+
the Loom service. Preserve `/admin/emails` and its test/one-off-mail workflow.
|
|
66
|
+
|
|
67
|
+
Inbound mail and reply threading are planned follow-ups; do not infer a mailbox
|
|
68
|
+
or thread schema until a consumer supplies concrete routing requirements.
|