@agent-native/core 0.138.0 → 0.139.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/corpus/README.md +1 -1
- package/corpus/templates/analytics/server/lib/dashboard-report.ts +2 -0
- package/corpus/templates/analytics/server/lib/emails.ts +51 -0
- package/corpus/templates/analytics/server/plugins/transactional-emails.ts +5 -0
- package/corpus/templates/calendar/server/lib/booking-emails.ts +154 -70
- package/corpus/templates/calendar/server/lib/emails.ts +167 -0
- package/corpus/templates/calendar/server/lib/event-guest-notifications.ts +64 -28
- package/corpus/templates/calendar/server/plugins/transactional-emails.ts +5 -0
- package/corpus/templates/clips/actions/invite-member.ts +39 -15
- package/corpus/templates/clips/server/lib/emails.ts +256 -0
- package/corpus/templates/clips/server/lib/transactional-email-templates.ts +24 -0
- package/corpus/templates/clips/server/plugins/transactional-email-catalog.ts +5 -0
- package/corpus/templates/content/server/lib/comment-notifications.ts +57 -26
- package/corpus/templates/content/server/lib/emails.ts +70 -0
- package/corpus/templates/content/server/plugins/transactional-emails.ts +5 -0
- package/corpus/templates/dispatch/app/routes/transactional-email.$appId.$id.tsx +4 -0
- package/corpus/templates/dispatch/app/routes/transactional-email.tsx +4 -0
- package/corpus/templates/forms/server/lib/emails.ts +52 -0
- package/corpus/templates/forms/server/lib/response-email.ts +2 -0
- package/corpus/templates/forms/server/plugins/transactional-emails.ts +5 -0
- package/corpus/templates/plan/actions/request-plan-access.ts +33 -12
- package/corpus/templates/plan/server/lib/comment-notifications.ts +53 -27
- package/corpus/templates/plan/server/lib/emails.ts +67 -0
- package/corpus/templates/plan/server/plugins/transactional-emails.ts +5 -0
- package/corpus/templates/slides/server/lib/comment-notifications.ts +44 -21
- package/corpus/templates/slides/server/lib/emails.ts +40 -0
- package/corpus/templates/slides/server/plugins/transactional-emails.ts +5 -0
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/email-catalog/actions/list-email-activity.d.ts +6 -0
- package/dist/email-catalog/actions/list-email-activity.js +15 -0
- package/dist/email-catalog/actions/list-email-engagement.d.ts +6 -0
- package/dist/email-catalog/actions/list-email-engagement.js +15 -0
- package/dist/email-catalog/actions/list-email-log.d.ts +8 -0
- package/dist/email-catalog/actions/list-email-log.js +22 -0
- package/dist/email-catalog/actions/list-transactional-emails.d.ts +23 -0
- package/dist/email-catalog/actions/list-transactional-emails.js +61 -0
- package/dist/email-catalog/actions/render-transactional-email-preview.d.ts +10 -0
- package/dist/email-catalog/actions/render-transactional-email-preview.js +24 -0
- package/dist/email-catalog/authorize.d.ts +2 -0
- package/dist/email-catalog/authorize.js +10 -0
- package/dist/email-catalog/log.d.ts +57 -0
- package/dist/email-catalog/log.js +117 -0
- package/dist/email-catalog/provider-metrics.d.ts +34 -0
- package/dist/email-catalog/provider-metrics.js +165 -0
- package/dist/email-catalog/registry.d.ts +79 -0
- package/dist/email-catalog/registry.js +71 -0
- package/dist/email-catalog/schema.d.ts +212 -0
- package/dist/email-catalog/schema.js +49 -0
- package/dist/email-catalog/system-emails.d.ts +14 -0
- package/dist/email-catalog/system-emails.js +68 -0
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/localization/default-messages.d.ts +45 -0
- package/dist/localization/default-messages.js +45 -0
- package/dist/notifications/routes.d.ts +5 -5
- package/dist/org/handlers.js +8 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +8 -8
- package/dist/provider-api/actions/provider-api.d.ts +12 -12
- package/dist/server/action-discovery.js +22 -0
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/better-auth-instance.js +17 -2
- package/dist/server/email.d.ts +9 -0
- package/dist/server/email.js +44 -3
- package/dist/server/index.d.ts +1 -0
- package/dist/server/index.js +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drizzle schema for the transactional email send log.
|
|
3
|
+
*
|
|
4
|
+
* One row per `sendEmail` attempt, written by the transport itself so every
|
|
5
|
+
* send is recorded regardless of which app or code path triggered it. This is
|
|
6
|
+
* the durable record of "did we send it": the provider's own activity feed ages
|
|
7
|
+
* out (SendGrid keeps 3 days without the extended-retention add-on), so send
|
|
8
|
+
* counts and last-sent must not depend on it.
|
|
9
|
+
*
|
|
10
|
+
* Engagement (opens, clicks, bounces) is deliberately NOT stored here. Only the
|
|
11
|
+
* provider knows it, and mirroring it would go stale the moment a recipient
|
|
12
|
+
* opens an old message. Dispatch reads engagement live from the provider and
|
|
13
|
+
* joins on `template_id`.
|
|
14
|
+
*/
|
|
15
|
+
export declare const emailLog: import("drizzle-orm/sqlite-core").SQLiteTableWithColumns<{
|
|
16
|
+
name: "email_log";
|
|
17
|
+
schema: undefined;
|
|
18
|
+
columns: {
|
|
19
|
+
id: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
20
|
+
name: "id";
|
|
21
|
+
tableName: "email_log";
|
|
22
|
+
dataType: "string";
|
|
23
|
+
columnType: "SQLiteText";
|
|
24
|
+
data: string;
|
|
25
|
+
driverParam: string;
|
|
26
|
+
notNull: true;
|
|
27
|
+
hasDefault: false;
|
|
28
|
+
isPrimaryKey: true;
|
|
29
|
+
isAutoincrement: false;
|
|
30
|
+
hasRuntimeDefault: false;
|
|
31
|
+
enumValues: [string, ...string[]];
|
|
32
|
+
baseColumn: never;
|
|
33
|
+
identity: undefined;
|
|
34
|
+
generated: undefined;
|
|
35
|
+
}, {}, {
|
|
36
|
+
length: number;
|
|
37
|
+
}>;
|
|
38
|
+
templateId: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
39
|
+
name: "template_id";
|
|
40
|
+
tableName: "email_log";
|
|
41
|
+
dataType: "string";
|
|
42
|
+
columnType: "SQLiteText";
|
|
43
|
+
data: string;
|
|
44
|
+
driverParam: string;
|
|
45
|
+
notNull: false;
|
|
46
|
+
hasDefault: false;
|
|
47
|
+
isPrimaryKey: false;
|
|
48
|
+
isAutoincrement: false;
|
|
49
|
+
hasRuntimeDefault: false;
|
|
50
|
+
enumValues: [string, ...string[]];
|
|
51
|
+
baseColumn: never;
|
|
52
|
+
identity: undefined;
|
|
53
|
+
generated: undefined;
|
|
54
|
+
}, {}, {
|
|
55
|
+
length: number;
|
|
56
|
+
}>;
|
|
57
|
+
app: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
58
|
+
name: "app";
|
|
59
|
+
tableName: "email_log";
|
|
60
|
+
dataType: "string";
|
|
61
|
+
columnType: "SQLiteText";
|
|
62
|
+
data: string;
|
|
63
|
+
driverParam: string;
|
|
64
|
+
notNull: false;
|
|
65
|
+
hasDefault: false;
|
|
66
|
+
isPrimaryKey: false;
|
|
67
|
+
isAutoincrement: false;
|
|
68
|
+
hasRuntimeDefault: false;
|
|
69
|
+
enumValues: [string, ...string[]];
|
|
70
|
+
baseColumn: never;
|
|
71
|
+
identity: undefined;
|
|
72
|
+
generated: undefined;
|
|
73
|
+
}, {}, {
|
|
74
|
+
length: number;
|
|
75
|
+
}>;
|
|
76
|
+
recipient: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
77
|
+
name: "recipient";
|
|
78
|
+
tableName: "email_log";
|
|
79
|
+
dataType: "string";
|
|
80
|
+
columnType: "SQLiteText";
|
|
81
|
+
data: string;
|
|
82
|
+
driverParam: string;
|
|
83
|
+
notNull: true;
|
|
84
|
+
hasDefault: false;
|
|
85
|
+
isPrimaryKey: false;
|
|
86
|
+
isAutoincrement: false;
|
|
87
|
+
hasRuntimeDefault: false;
|
|
88
|
+
enumValues: [string, ...string[]];
|
|
89
|
+
baseColumn: never;
|
|
90
|
+
identity: undefined;
|
|
91
|
+
generated: undefined;
|
|
92
|
+
}, {}, {
|
|
93
|
+
length: number;
|
|
94
|
+
}>;
|
|
95
|
+
sender: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
96
|
+
name: "sender";
|
|
97
|
+
tableName: "email_log";
|
|
98
|
+
dataType: "string";
|
|
99
|
+
columnType: "SQLiteText";
|
|
100
|
+
data: string;
|
|
101
|
+
driverParam: string;
|
|
102
|
+
notNull: true;
|
|
103
|
+
hasDefault: false;
|
|
104
|
+
isPrimaryKey: false;
|
|
105
|
+
isAutoincrement: false;
|
|
106
|
+
hasRuntimeDefault: false;
|
|
107
|
+
enumValues: [string, ...string[]];
|
|
108
|
+
baseColumn: never;
|
|
109
|
+
identity: undefined;
|
|
110
|
+
generated: undefined;
|
|
111
|
+
}, {}, {
|
|
112
|
+
length: number;
|
|
113
|
+
}>;
|
|
114
|
+
subject: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
115
|
+
name: "subject";
|
|
116
|
+
tableName: "email_log";
|
|
117
|
+
dataType: "string";
|
|
118
|
+
columnType: "SQLiteText";
|
|
119
|
+
data: string;
|
|
120
|
+
driverParam: string;
|
|
121
|
+
notNull: true;
|
|
122
|
+
hasDefault: false;
|
|
123
|
+
isPrimaryKey: false;
|
|
124
|
+
isAutoincrement: false;
|
|
125
|
+
hasRuntimeDefault: false;
|
|
126
|
+
enumValues: [string, ...string[]];
|
|
127
|
+
baseColumn: never;
|
|
128
|
+
identity: undefined;
|
|
129
|
+
generated: undefined;
|
|
130
|
+
}, {}, {
|
|
131
|
+
length: number;
|
|
132
|
+
}>;
|
|
133
|
+
status: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
134
|
+
name: "status";
|
|
135
|
+
tableName: "email_log";
|
|
136
|
+
dataType: "string";
|
|
137
|
+
columnType: "SQLiteText";
|
|
138
|
+
data: "failed" | "sent";
|
|
139
|
+
driverParam: string;
|
|
140
|
+
notNull: true;
|
|
141
|
+
hasDefault: false;
|
|
142
|
+
isPrimaryKey: false;
|
|
143
|
+
isAutoincrement: false;
|
|
144
|
+
hasRuntimeDefault: false;
|
|
145
|
+
enumValues: ["sent", "failed"];
|
|
146
|
+
baseColumn: never;
|
|
147
|
+
identity: undefined;
|
|
148
|
+
generated: undefined;
|
|
149
|
+
}, {}, {
|
|
150
|
+
length: number;
|
|
151
|
+
}>;
|
|
152
|
+
error: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
153
|
+
name: "error";
|
|
154
|
+
tableName: "email_log";
|
|
155
|
+
dataType: "string";
|
|
156
|
+
columnType: "SQLiteText";
|
|
157
|
+
data: string;
|
|
158
|
+
driverParam: string;
|
|
159
|
+
notNull: false;
|
|
160
|
+
hasDefault: false;
|
|
161
|
+
isPrimaryKey: false;
|
|
162
|
+
isAutoincrement: false;
|
|
163
|
+
hasRuntimeDefault: false;
|
|
164
|
+
enumValues: [string, ...string[]];
|
|
165
|
+
baseColumn: never;
|
|
166
|
+
identity: undefined;
|
|
167
|
+
generated: undefined;
|
|
168
|
+
}, {}, {
|
|
169
|
+
length: number;
|
|
170
|
+
}>;
|
|
171
|
+
provider: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
172
|
+
name: "provider";
|
|
173
|
+
tableName: "email_log";
|
|
174
|
+
dataType: "string";
|
|
175
|
+
columnType: "SQLiteText";
|
|
176
|
+
data: string;
|
|
177
|
+
driverParam: string;
|
|
178
|
+
notNull: true;
|
|
179
|
+
hasDefault: false;
|
|
180
|
+
isPrimaryKey: false;
|
|
181
|
+
isAutoincrement: false;
|
|
182
|
+
hasRuntimeDefault: false;
|
|
183
|
+
enumValues: [string, ...string[]];
|
|
184
|
+
baseColumn: never;
|
|
185
|
+
identity: undefined;
|
|
186
|
+
generated: undefined;
|
|
187
|
+
}, {}, {
|
|
188
|
+
length: number;
|
|
189
|
+
}>;
|
|
190
|
+
createdAt: import("drizzle-orm/sqlite-core").SQLiteColumn<{
|
|
191
|
+
name: "created_at";
|
|
192
|
+
tableName: "email_log";
|
|
193
|
+
dataType: "number";
|
|
194
|
+
columnType: "SQLiteInteger";
|
|
195
|
+
data: number;
|
|
196
|
+
driverParam: number;
|
|
197
|
+
notNull: true;
|
|
198
|
+
hasDefault: false;
|
|
199
|
+
isPrimaryKey: false;
|
|
200
|
+
isAutoincrement: false;
|
|
201
|
+
hasRuntimeDefault: false;
|
|
202
|
+
enumValues: undefined;
|
|
203
|
+
baseColumn: never;
|
|
204
|
+
identity: undefined;
|
|
205
|
+
generated: undefined;
|
|
206
|
+
}, {}, {}>;
|
|
207
|
+
};
|
|
208
|
+
dialect: 'sqlite';
|
|
209
|
+
}>;
|
|
210
|
+
export declare const EMAIL_LOG_CREATE_SQL = "CREATE TABLE IF NOT EXISTS email_log (\n id TEXT PRIMARY KEY,\n template_id TEXT,\n app TEXT,\n recipient TEXT NOT NULL,\n sender TEXT NOT NULL,\n subject TEXT NOT NULL,\n status TEXT NOT NULL,\n error TEXT,\n provider TEXT NOT NULL,\n created_at INTEGER NOT NULL\n)";
|
|
211
|
+
export declare const EMAIL_LOG_TEMPLATE_INDEX_SQL = "CREATE INDEX IF NOT EXISTS email_log_template_created_idx\n ON email_log (template_id, created_at)";
|
|
212
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Drizzle schema for the transactional email send log.
|
|
3
|
+
*
|
|
4
|
+
* One row per `sendEmail` attempt, written by the transport itself so every
|
|
5
|
+
* send is recorded regardless of which app or code path triggered it. This is
|
|
6
|
+
* the durable record of "did we send it": the provider's own activity feed ages
|
|
7
|
+
* out (SendGrid keeps 3 days without the extended-retention add-on), so send
|
|
8
|
+
* counts and last-sent must not depend on it.
|
|
9
|
+
*
|
|
10
|
+
* Engagement (opens, clicks, bounces) is deliberately NOT stored here. Only the
|
|
11
|
+
* provider knows it, and mirroring it would go stale the moment a recipient
|
|
12
|
+
* opens an old message. Dispatch reads engagement live from the provider and
|
|
13
|
+
* joins on `template_id`.
|
|
14
|
+
*/
|
|
15
|
+
import { table, text, integer } from "../db/schema.js";
|
|
16
|
+
export const emailLog = table("email_log", {
|
|
17
|
+
id: text("id").primaryKey(),
|
|
18
|
+
/** Registered transactional email id, e.g. "calendar.booking-confirmed". */
|
|
19
|
+
templateId: text("template_id"),
|
|
20
|
+
/** App slug that sent it. */
|
|
21
|
+
app: text("app"),
|
|
22
|
+
/** Recipient address. */
|
|
23
|
+
recipient: text("recipient").notNull(),
|
|
24
|
+
/** Resolved From address, after app-sender branding is applied. */
|
|
25
|
+
sender: text("sender").notNull(),
|
|
26
|
+
subject: text("subject").notNull(),
|
|
27
|
+
/** "sent" once the provider accepted it, or "failed". Never optimistic. */
|
|
28
|
+
status: text("status", { enum: ["sent", "failed"] }).notNull(),
|
|
29
|
+
/** Provider error text when status is "failed". */
|
|
30
|
+
error: text("error"),
|
|
31
|
+
/** "resend" | "sendgrid" | "dev". */
|
|
32
|
+
provider: text("provider").notNull(),
|
|
33
|
+
createdAt: integer("created_at").notNull(),
|
|
34
|
+
});
|
|
35
|
+
export const EMAIL_LOG_CREATE_SQL = `CREATE TABLE IF NOT EXISTS email_log (
|
|
36
|
+
id TEXT PRIMARY KEY,
|
|
37
|
+
template_id TEXT,
|
|
38
|
+
app TEXT,
|
|
39
|
+
recipient TEXT NOT NULL,
|
|
40
|
+
sender TEXT NOT NULL,
|
|
41
|
+
subject TEXT NOT NULL,
|
|
42
|
+
status TEXT NOT NULL,
|
|
43
|
+
error TEXT,
|
|
44
|
+
provider TEXT NOT NULL,
|
|
45
|
+
created_at INTEGER NOT NULL
|
|
46
|
+
)`;
|
|
47
|
+
export const EMAIL_LOG_TEMPLATE_INDEX_SQL = `CREATE INDEX IF NOT EXISTS email_log_template_created_idx
|
|
48
|
+
ON email_log (template_id, created_at)`;
|
|
49
|
+
//# sourceMappingURL=schema.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catalog entries for the framework's own system emails.
|
|
3
|
+
*
|
|
4
|
+
* These ship with every app rather than belonging to one, so they register
|
|
5
|
+
* under the `core` app instead of the running app's slug. Importing this module
|
|
6
|
+
* performs the registration; `register-system-emails.ts` is the single import
|
|
7
|
+
* site so the emails appear in every app's catalog without each template
|
|
8
|
+
* remembering to opt in.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CORE_INVITE_EMAIL_ID = "core.organization-invite";
|
|
11
|
+
export declare const CORE_VERIFY_SIGNUP_EMAIL_ID = "core.verify-signup";
|
|
12
|
+
export declare const CORE_RESET_PASSWORD_EMAIL_ID = "core.reset-password";
|
|
13
|
+
export declare function registerCoreSystemEmails(): void;
|
|
14
|
+
//# sourceMappingURL=system-emails.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Catalog entries for the framework's own system emails.
|
|
3
|
+
*
|
|
4
|
+
* These ship with every app rather than belonging to one, so they register
|
|
5
|
+
* under the `core` app instead of the running app's slug. Importing this module
|
|
6
|
+
* performs the registration; `register-system-emails.ts` is the single import
|
|
7
|
+
* site so the emails appear in every app's catalog without each template
|
|
8
|
+
* remembering to opt in.
|
|
9
|
+
*/
|
|
10
|
+
import { renderInviteEmail, renderResetPasswordEmail, renderVerifySignupEmail, } from "../server/email-templates.js";
|
|
11
|
+
import { defineTransactionalEmail } from "./registry.js";
|
|
12
|
+
/** Obviously-fake sample data — these render in a preview pane, never send. */
|
|
13
|
+
const SAMPLE_URL = "https://example.com/accept/sample-token";
|
|
14
|
+
const SAMPLE_EMAIL = "sam.rivera@example.com";
|
|
15
|
+
export const CORE_INVITE_EMAIL_ID = "core.organization-invite";
|
|
16
|
+
export const CORE_VERIFY_SIGNUP_EMAIL_ID = "core.verify-signup";
|
|
17
|
+
export const CORE_RESET_PASSWORD_EMAIL_ID = "core.reset-password";
|
|
18
|
+
let registered = false;
|
|
19
|
+
export function registerCoreSystemEmails() {
|
|
20
|
+
if (registered)
|
|
21
|
+
return;
|
|
22
|
+
registered = true;
|
|
23
|
+
defineTransactionalEmail({
|
|
24
|
+
id: CORE_INVITE_EMAIL_ID,
|
|
25
|
+
app: "core",
|
|
26
|
+
name: "Organization invitation",
|
|
27
|
+
trigger: "A member invites someone to their organization from the team settings page.",
|
|
28
|
+
recipientLabel: "Invited address",
|
|
29
|
+
recipient: "The address typed into the invite form. One email per invited address.",
|
|
30
|
+
senderLabel: "Default, app-branded",
|
|
31
|
+
sender: "The configured EMAIL_FROM. On first-party agent-native.com deployments the display name becomes the app's own, with reply-to agent-native@builder.io.",
|
|
32
|
+
preview: () => renderInviteEmail({
|
|
33
|
+
invitee: SAMPLE_EMAIL,
|
|
34
|
+
orgName: "Northwind Design",
|
|
35
|
+
acceptUrl: SAMPLE_URL,
|
|
36
|
+
inviter: "alex.chen@example.com",
|
|
37
|
+
}),
|
|
38
|
+
});
|
|
39
|
+
defineTransactionalEmail({
|
|
40
|
+
id: CORE_VERIFY_SIGNUP_EMAIL_ID,
|
|
41
|
+
app: "core",
|
|
42
|
+
name: "Verify signup",
|
|
43
|
+
trigger: "A new account is created with email and password, before the account can be used.",
|
|
44
|
+
recipientLabel: "New account address",
|
|
45
|
+
recipient: "The address the account was registered with.",
|
|
46
|
+
senderLabel: "Default, app-branded",
|
|
47
|
+
sender: "The configured EMAIL_FROM, branded with the app name the signup happened in.",
|
|
48
|
+
preview: () => renderVerifySignupEmail({
|
|
49
|
+
email: SAMPLE_EMAIL,
|
|
50
|
+
verifyUrl: SAMPLE_URL,
|
|
51
|
+
}),
|
|
52
|
+
});
|
|
53
|
+
defineTransactionalEmail({
|
|
54
|
+
id: CORE_RESET_PASSWORD_EMAIL_ID,
|
|
55
|
+
app: "core",
|
|
56
|
+
name: "Reset password",
|
|
57
|
+
trigger: "A user requests a password reset from the sign-in screen. The link expires after one hour.",
|
|
58
|
+
recipientLabel: "Account address",
|
|
59
|
+
recipient: "The account address the reset was requested for, never an address supplied in the request body.",
|
|
60
|
+
senderLabel: "Default, app-branded",
|
|
61
|
+
sender: "The configured EMAIL_FROM, branded with the app name the reset was requested from.",
|
|
62
|
+
preview: () => renderResetPasswordEmail({
|
|
63
|
+
email: SAMPLE_EMAIL,
|
|
64
|
+
resetUrl: SAMPLE_URL,
|
|
65
|
+
}),
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=system-emails.js.map
|
|
@@ -17,12 +17,12 @@ declare const _default: import("../../action.js").ActionDefinition<{
|
|
|
17
17
|
id?: undefined;
|
|
18
18
|
provider?: undefined;
|
|
19
19
|
} | {
|
|
20
|
-
error?: undefined;
|
|
21
20
|
configured?: undefined;
|
|
22
21
|
connectPath?: undefined;
|
|
23
22
|
url: string;
|
|
24
23
|
id: string;
|
|
25
24
|
provider: string;
|
|
25
|
+
error?: undefined;
|
|
26
26
|
}>;
|
|
27
27
|
export default _default;
|
|
28
28
|
//# sourceMappingURL=upload-image.d.ts.map
|
|
@@ -175,6 +175,7 @@ declare const messages: {
|
|
|
175
175
|
resources: string;
|
|
176
176
|
messaging: string;
|
|
177
177
|
destinations: string;
|
|
178
|
+
transactionalEmail: string;
|
|
178
179
|
identities: string;
|
|
179
180
|
approvals: string;
|
|
180
181
|
automations: string;
|
|
@@ -205,6 +206,50 @@ declare const messages: {
|
|
|
205
206
|
suggestionRouteSlack: string;
|
|
206
207
|
suggestionGrantKey: string;
|
|
207
208
|
};
|
|
209
|
+
transactionalEmail: {
|
|
210
|
+
title: string;
|
|
211
|
+
description: string;
|
|
212
|
+
retentionTitle: string;
|
|
213
|
+
retentionNote: string;
|
|
214
|
+
openRatesUnavailable: string;
|
|
215
|
+
sharedProviderMetricsUnavailable: string;
|
|
216
|
+
catalogFanoutFailed: string;
|
|
217
|
+
retry: string;
|
|
218
|
+
noApps: string;
|
|
219
|
+
catalogUnreadable: string;
|
|
220
|
+
countsUnreadable: string;
|
|
221
|
+
appSendsNoEmail: string;
|
|
222
|
+
emailNotFound: string;
|
|
223
|
+
emailNotFoundDescription: string;
|
|
224
|
+
sharedTitle: string;
|
|
225
|
+
sharedSubtitle: string;
|
|
226
|
+
email: string;
|
|
227
|
+
trigger: string;
|
|
228
|
+
sends: string;
|
|
229
|
+
openRate: string;
|
|
230
|
+
lastSent: string;
|
|
231
|
+
sendLogUnread: string;
|
|
232
|
+
failedCount: string;
|
|
233
|
+
failuresUnknown: string;
|
|
234
|
+
noProviderRecord: string;
|
|
235
|
+
noDeliveredMail: string;
|
|
236
|
+
neverSent: string;
|
|
237
|
+
lastSentUnknown: string;
|
|
238
|
+
preview: string;
|
|
239
|
+
previewDescription: string;
|
|
240
|
+
previewFailed: string;
|
|
241
|
+
previewFrameTitle: string;
|
|
242
|
+
subject: string;
|
|
243
|
+
activityLink: string;
|
|
244
|
+
activityTitle: string;
|
|
245
|
+
activityUnavailable: string;
|
|
246
|
+
activityEmpty: string;
|
|
247
|
+
recipient: string;
|
|
248
|
+
sender: string;
|
|
249
|
+
status: string;
|
|
250
|
+
opens: string;
|
|
251
|
+
lastEvent: string;
|
|
252
|
+
};
|
|
208
253
|
pages: {
|
|
209
254
|
appsDescription: string;
|
|
210
255
|
appsDescriptionWithWorkspace: string;
|
|
@@ -180,6 +180,7 @@ const messages = {
|
|
|
180
180
|
resources: "Resources",
|
|
181
181
|
messaging: "Messaging",
|
|
182
182
|
destinations: "Destinations",
|
|
183
|
+
transactionalEmail: "Transactional email",
|
|
183
184
|
identities: "Identities",
|
|
184
185
|
approvals: "Approvals",
|
|
185
186
|
automations: "Automations",
|
|
@@ -210,6 +211,50 @@ const messages = {
|
|
|
210
211
|
suggestionRouteSlack: "Route Slack mentions to my analytics app",
|
|
211
212
|
suggestionGrantKey: "Grant my OpenAI key to this app",
|
|
212
213
|
},
|
|
214
|
+
transactionalEmail: {
|
|
215
|
+
title: "Transactional email",
|
|
216
|
+
description: "Every transactional email each app in this workspace can send, with its trigger, recipients, and delivery metrics.",
|
|
217
|
+
retentionTitle: "Activity feed retention is short",
|
|
218
|
+
retentionNote: "The email provider's activity feed only retains recent messages, so an empty activity list does not mean nothing was sent.",
|
|
219
|
+
openRatesUnavailable: "Open rates unavailable",
|
|
220
|
+
sharedProviderMetricsUnavailable: "Provider metrics vary by sending app. Expand an app to see its provider data.",
|
|
221
|
+
catalogFanoutFailed: "Could not load app email catalogs",
|
|
222
|
+
retry: "Retry",
|
|
223
|
+
noApps: "No ready apps reported a transactional email catalog.",
|
|
224
|
+
catalogUnreadable: "This app's email catalog could not be read",
|
|
225
|
+
countsUnreadable: "Send counts could not be read",
|
|
226
|
+
appSendsNoEmail: "This app sends no transactional email of its own.",
|
|
227
|
+
emailNotFound: "Email not found",
|
|
228
|
+
emailNotFoundDescription: "This email is not in the app's catalog.",
|
|
229
|
+
sharedTitle: "Shared system email",
|
|
230
|
+
sharedSubtitle: "sent by every app",
|
|
231
|
+
email: "Email",
|
|
232
|
+
trigger: "Trigger",
|
|
233
|
+
sends: "Sends",
|
|
234
|
+
openRate: "Open rate",
|
|
235
|
+
lastSent: "Last sent",
|
|
236
|
+
sendLogUnread: "The send log could not be read, so the number of sends is unknown.",
|
|
237
|
+
failedCount: "{{count}} failed",
|
|
238
|
+
failuresUnknown: "failures unknown",
|
|
239
|
+
noProviderRecord: "The provider reported no record for this email in the window.",
|
|
240
|
+
noDeliveredMail: "No delivered mail yet",
|
|
241
|
+
neverSent: "Never sent",
|
|
242
|
+
lastSentUnknown: "The send log could not be read, so the last send time is unknown.",
|
|
243
|
+
preview: "Preview",
|
|
244
|
+
previewDescription: "Rendered with dummy data. Scripts are disabled in this preview.",
|
|
245
|
+
previewFailed: "Preview could not be rendered",
|
|
246
|
+
previewFrameTitle: "Preview of {{name}}",
|
|
247
|
+
subject: "Subject",
|
|
248
|
+
activityLink: "Activity log",
|
|
249
|
+
activityTitle: "Activity for {{name}}",
|
|
250
|
+
activityUnavailable: "Activity feed unavailable",
|
|
251
|
+
activityEmpty: "No recent activity in the provider's retention window.",
|
|
252
|
+
recipient: "Recipient",
|
|
253
|
+
sender: "Sender",
|
|
254
|
+
status: "Status",
|
|
255
|
+
opens: "Opens",
|
|
256
|
+
lastEvent: "Last event",
|
|
257
|
+
},
|
|
213
258
|
pages: {
|
|
214
259
|
appsDescription: "Open workspace apps and start new app creation from Dispatch.",
|
|
215
260
|
appsDescriptionWithWorkspace: 'Apps in the "{{workspace}}" workspace. Each app gets its own route under this workspace and shares its database, auth, and agent chat.',
|
|
@@ -13,22 +13,22 @@
|
|
|
13
13
|
export declare function createNotificationsHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<"" | import("./types.js").Notification[] | {
|
|
14
14
|
count: number;
|
|
15
15
|
updated?: undefined;
|
|
16
|
-
ok?: undefined;
|
|
17
16
|
error?: undefined;
|
|
17
|
+
ok?: undefined;
|
|
18
18
|
} | {
|
|
19
|
+
count?: undefined;
|
|
19
20
|
updated: number;
|
|
20
|
-
ok?: undefined;
|
|
21
21
|
error?: undefined;
|
|
22
|
-
|
|
22
|
+
ok?: undefined;
|
|
23
23
|
} | {
|
|
24
|
+
count?: undefined;
|
|
24
25
|
updated?: undefined;
|
|
25
26
|
error: string;
|
|
26
27
|
ok?: undefined;
|
|
27
|
-
count?: undefined;
|
|
28
28
|
} | {
|
|
29
|
+
count?: undefined;
|
|
29
30
|
updated?: undefined;
|
|
30
31
|
ok: boolean;
|
|
31
32
|
error?: undefined;
|
|
32
|
-
count?: undefined;
|
|
33
33
|
}>>;
|
|
34
34
|
//# sourceMappingURL=routes.d.ts.map
|
package/dist/org/handlers.js
CHANGED
|
@@ -28,6 +28,7 @@ function extractMemberEmail(event) {
|
|
|
28
28
|
const nanoid = () => globalThis.crypto?.randomUUID?.().replace(/-/g, "") ??
|
|
29
29
|
Math.random().toString(36).slice(2) + Date.now().toString(36);
|
|
30
30
|
import { getDbExec, isPostgres } from "../db/client.js";
|
|
31
|
+
import { CORE_INVITE_EMAIL_ID } from "../email-catalog/system-emails.js";
|
|
31
32
|
import { ssrfSafeFetch } from "../extensions/url-safety.js";
|
|
32
33
|
import { getAppProductionUrl } from "../server/app-url.js";
|
|
33
34
|
import { getSession } from "../server/auth.js";
|
|
@@ -275,7 +276,13 @@ async function inviteOne(ctx, rawEmail, role, event) {
|
|
|
275
276
|
acceptUrl: getInviteAppUrl(event),
|
|
276
277
|
inviter: ctx.email,
|
|
277
278
|
});
|
|
278
|
-
await sendEmail({
|
|
279
|
+
await sendEmail({
|
|
280
|
+
to: email,
|
|
281
|
+
subject,
|
|
282
|
+
html,
|
|
283
|
+
text,
|
|
284
|
+
templateId: CORE_INVITE_EMAIL_ID,
|
|
285
|
+
});
|
|
279
286
|
emailSent = true;
|
|
280
287
|
}
|
|
281
288
|
catch (err) {
|
|
@@ -75,9 +75,9 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
|
|
|
75
75
|
user: "user";
|
|
76
76
|
}>>;
|
|
77
77
|
}, z.core.$strip>>, {
|
|
78
|
+
deleted?: undefined;
|
|
78
79
|
id?: undefined;
|
|
79
80
|
provider?: undefined;
|
|
80
|
-
deleted?: undefined;
|
|
81
81
|
found?: undefined;
|
|
82
82
|
providers: {
|
|
83
83
|
id: string;
|
|
@@ -93,41 +93,41 @@ export declare function createCustomProviderRegistrationAction<TSchema extends Z
|
|
|
93
93
|
label?: undefined;
|
|
94
94
|
message?: undefined;
|
|
95
95
|
} | {
|
|
96
|
-
id?: undefined;
|
|
97
96
|
deleted?: undefined;
|
|
98
|
-
providers?: undefined;
|
|
99
97
|
count?: undefined;
|
|
98
|
+
id?: undefined;
|
|
99
|
+
providers?: undefined;
|
|
100
100
|
found: boolean;
|
|
101
101
|
provider: import("../custom-registry.js").CustomProviderConfig;
|
|
102
102
|
registered?: undefined;
|
|
103
103
|
label?: undefined;
|
|
104
104
|
message?: undefined;
|
|
105
105
|
} | {
|
|
106
|
-
provider?: undefined;
|
|
107
106
|
deleted?: undefined;
|
|
108
|
-
providers?: undefined;
|
|
109
107
|
count?: undefined;
|
|
108
|
+
provider?: undefined;
|
|
109
|
+
providers?: undefined;
|
|
110
110
|
found: boolean;
|
|
111
111
|
id: string;
|
|
112
112
|
registered?: undefined;
|
|
113
113
|
label?: undefined;
|
|
114
114
|
message?: undefined;
|
|
115
115
|
} | {
|
|
116
|
+
count?: undefined;
|
|
116
117
|
provider?: undefined;
|
|
117
118
|
found?: undefined;
|
|
118
119
|
providers?: undefined;
|
|
119
|
-
count?: undefined;
|
|
120
120
|
deleted: boolean;
|
|
121
121
|
id: string;
|
|
122
122
|
registered?: undefined;
|
|
123
123
|
label?: undefined;
|
|
124
124
|
message?: undefined;
|
|
125
125
|
} | {
|
|
126
|
-
provider?: undefined;
|
|
127
126
|
deleted?: undefined;
|
|
127
|
+
count?: undefined;
|
|
128
|
+
provider?: undefined;
|
|
128
129
|
found?: undefined;
|
|
129
130
|
providers?: undefined;
|
|
130
|
-
count?: undefined;
|
|
131
131
|
registered: boolean;
|
|
132
132
|
id: string;
|
|
133
133
|
label: string;
|
|
@@ -311,11 +311,10 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
311
311
|
notes?: string | undefined;
|
|
312
312
|
scope?: "org" | "user" | undefined;
|
|
313
313
|
}, {
|
|
314
|
+
message?: undefined;
|
|
314
315
|
id?: undefined;
|
|
315
|
-
provider?: undefined;
|
|
316
316
|
deleted?: undefined;
|
|
317
317
|
found?: undefined;
|
|
318
|
-
message?: undefined;
|
|
319
318
|
providers: {
|
|
320
319
|
id: string;
|
|
321
320
|
label: string;
|
|
@@ -326,44 +325,45 @@ export declare function createProviderApiActions(runtime: Pick<ProviderApiRuntim
|
|
|
326
325
|
updatedAt: number;
|
|
327
326
|
}[];
|
|
328
327
|
count: number;
|
|
328
|
+
provider?: undefined;
|
|
329
329
|
registered?: undefined;
|
|
330
330
|
label?: undefined;
|
|
331
331
|
} | {
|
|
332
|
+
message?: undefined;
|
|
332
333
|
id?: undefined;
|
|
333
|
-
count?: undefined;
|
|
334
334
|
deleted?: undefined;
|
|
335
|
-
|
|
335
|
+
count?: undefined;
|
|
336
336
|
providers?: undefined;
|
|
337
337
|
found: boolean;
|
|
338
338
|
provider: import("../custom-registry.js").CustomProviderConfig;
|
|
339
339
|
registered?: undefined;
|
|
340
340
|
label?: undefined;
|
|
341
341
|
} | {
|
|
342
|
-
count?: undefined;
|
|
343
|
-
provider?: undefined;
|
|
344
|
-
deleted?: undefined;
|
|
345
342
|
message?: undefined;
|
|
343
|
+
deleted?: undefined;
|
|
344
|
+
count?: undefined;
|
|
346
345
|
providers?: undefined;
|
|
346
|
+
provider?: undefined;
|
|
347
347
|
found: boolean;
|
|
348
348
|
id: string;
|
|
349
349
|
registered?: undefined;
|
|
350
350
|
label?: undefined;
|
|
351
351
|
} | {
|
|
352
|
-
count?: undefined;
|
|
353
|
-
provider?: undefined;
|
|
354
|
-
found?: undefined;
|
|
355
352
|
message?: undefined;
|
|
353
|
+
found?: undefined;
|
|
354
|
+
count?: undefined;
|
|
356
355
|
providers?: undefined;
|
|
356
|
+
provider?: undefined;
|
|
357
357
|
deleted: boolean;
|
|
358
358
|
id: string;
|
|
359
359
|
registered?: undefined;
|
|
360
360
|
label?: undefined;
|
|
361
361
|
} | {
|
|
362
|
-
count?: undefined;
|
|
363
|
-
provider?: undefined;
|
|
364
362
|
deleted?: undefined;
|
|
365
363
|
found?: undefined;
|
|
364
|
+
count?: undefined;
|
|
366
365
|
providers?: undefined;
|
|
366
|
+
provider?: undefined;
|
|
367
367
|
registered: boolean;
|
|
368
368
|
id: string;
|
|
369
369
|
label: string;
|