notifkit 0.1.6 → 0.1.8
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 +5 -17
- package/dashboard/README.md +29 -0
- package/dashboard/dist/assets/index-7mvXb4bS.js +310 -0
- package/dashboard/dist/assets/index-o7L-f3-c.css +1 -0
- package/dashboard/dist/favicon.svg +4 -0
- package/dashboard/dist/index.html +14 -0
- package/dist/index.d.mts +3435 -548
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/{main-DDbquL89.mjs → main-0FHNtN5g.mjs} +2 -2
- package/dist/{main-DDbquL89.mjs.map → main-0FHNtN5g.mjs.map} +1 -1
- package/dist/{main-DdLzptZE.mjs → main-7KMlWnDx.mjs} +2 -2
- package/dist/{main-DdLzptZE.mjs.map → main-7KMlWnDx.mjs.map} +1 -1
- package/dist/{main-DsDkyBZi.mjs → main-B0BcY_JJ.mjs} +2 -2
- package/dist/{main-DsDkyBZi.mjs.map → main-B0BcY_JJ.mjs.map} +1 -1
- package/dist/{main-Db2f2-sW.mjs → main-BAO4kKce.mjs} +437 -63
- package/dist/main-BAO4kKce.mjs.map +1 -0
- package/dist/{main-DfrrNKp9.mjs → main-BjXgGJBd.mjs} +2 -2
- package/dist/{main-DfrrNKp9.mjs.map → main-BjXgGJBd.mjs.map} +1 -1
- package/dist/{main-BnIX5nfp.mjs → main-BtXITy0k.mjs} +2 -2
- package/dist/{main-BnIX5nfp.mjs.map → main-BtXITy0k.mjs.map} +1 -1
- package/dist/{main-CWGEKpLU.mjs → main-BxqAXTr6.mjs} +2 -2
- package/dist/{main-CWGEKpLU.mjs.map → main-BxqAXTr6.mjs.map} +1 -1
- package/dist/{main-Cwu4iQXc.mjs → main-zCpvA9Rx.mjs} +2 -2
- package/dist/{main-Cwu4iQXc.mjs.map → main-zCpvA9Rx.mjs.map} +1 -1
- package/dist/{src-CpUnBl_M.mjs → src-DkvHYM3y.mjs} +127 -41
- package/dist/src-DkvHYM3y.mjs.map +1 -0
- package/drizzle/0005_admin_users.sql +11 -0
- package/drizzle/meta/_journal.json +7 -0
- package/package.json +8 -3
- package/scripts/create-admin.mjs +67 -0
- package/src/client.ts +111 -40
- package/src/config/index.ts +3 -0
- package/src/contracts/sdk.ts +143 -3
- package/src/db/schema.ts +13 -0
- package/src/repositories/index.ts +82 -1
- package/src/services/api/admin-static.ts +224 -0
- package/src/services/api/handlers.ts +223 -42
- package/src/services/api/main.ts +72 -19
- package/src/services/auth/index.ts +103 -0
- package/dist/main-Db2f2-sW.mjs.map +0 -1
- package/dist/src-CpUnBl_M.mjs.map +0 -1
|
@@ -7,7 +7,7 @@ import { createHmac, randomUUID, timingSafeEqual } from "node:crypto";
|
|
|
7
7
|
import postgres from "postgres";
|
|
8
8
|
import { drizzle } from "drizzle-orm/postgres-js";
|
|
9
9
|
import { boolean, check, index, integer, jsonb, pgEnum, pgTable, primaryKey, text, time, timestamp, unique, uuid, varchar } from "drizzle-orm/pg-core";
|
|
10
|
-
import { and, desc, eq, inArray, sql } from "drizzle-orm";
|
|
10
|
+
import { and, desc, eq, inArray, or, sql } from "drizzle-orm";
|
|
11
11
|
import { createInsertSchema, createSelectSchema } from "drizzle-zod";
|
|
12
12
|
import { migrate } from "drizzle-orm/postgres-js/migrator";
|
|
13
13
|
import { fileURLToPath } from "url";
|
|
@@ -69,6 +69,9 @@ const baseConfigSchema = z.object({
|
|
|
69
69
|
REDIS_URL: z.string().url().default("redis://localhost:6379"),
|
|
70
70
|
DATABASE_URL: z.string().url().default("postgres://platform:platform@localhost:5432/notifkit"),
|
|
71
71
|
ADMIN_API_KEY: z.string().trim().optional(),
|
|
72
|
+
ADMIN_EMAIL: z.string().trim().email().optional(),
|
|
73
|
+
ADMIN_PASSWORD: z.string().trim().min(6).optional(),
|
|
74
|
+
ADMIN_USERNAME: z.string().trim().optional(),
|
|
72
75
|
WORKER_CONCURRENCY: z.coerce.number().int().min(1).default(10),
|
|
73
76
|
QUEUE_MAX_LEN: z.coerce.number().int().min(1).default(1e7),
|
|
74
77
|
DB_MAX_CONNECTIONS: z.coerce.number().int().min(1).default(2),
|
|
@@ -291,6 +294,7 @@ const ContactChannelSchema = z.enum([
|
|
|
291
294
|
"sms",
|
|
292
295
|
"push",
|
|
293
296
|
"webhook",
|
|
297
|
+
"in-app",
|
|
294
298
|
"telegram",
|
|
295
299
|
"discord",
|
|
296
300
|
"whatsapp",
|
|
@@ -298,14 +302,24 @@ const ContactChannelSchema = z.enum([
|
|
|
298
302
|
]);
|
|
299
303
|
/** Accept a single value or an array; always normalise to a non-empty array. */
|
|
300
304
|
const stringOrArray = z.union([z.string().min(1), z.array(z.string().min(1))]).transform((v) => Array.isArray(v) ? v : [v]);
|
|
305
|
+
const UserContactInputSchema = z.object({
|
|
306
|
+
channel: ContactChannelSchema,
|
|
307
|
+
target: z.string().min(1),
|
|
308
|
+
label: z.string().optional(),
|
|
309
|
+
isPrimary: z.boolean().optional(),
|
|
310
|
+
enabled: z.boolean().optional(),
|
|
311
|
+
preferences: PreferencesSchema.optional()
|
|
312
|
+
});
|
|
301
313
|
/**
|
|
302
|
-
* addUser({ id, email, phone, pushToken, segments, preferences })
|
|
303
|
-
* email / phone / pushToken accept a single string or an array.
|
|
314
|
+
* addUser({ id, contacts, email, phone, pushToken, segments, preferences })
|
|
315
|
+
* email / phone / pushToken accept a single string or an array for backwards compatibility.
|
|
316
|
+
* Prefer `contacts: [{ channel, target }]`.
|
|
304
317
|
*/
|
|
305
318
|
const AddUserSchema = z.object({
|
|
306
319
|
id: z.string().min(1),
|
|
307
320
|
language: z.string().optional(),
|
|
308
321
|
timezone: z.string().optional(),
|
|
322
|
+
contacts: z.array(UserContactInputSchema).optional(),
|
|
309
323
|
email: stringOrArray.optional(),
|
|
310
324
|
phone: stringOrArray.optional(),
|
|
311
325
|
pushToken: stringOrArray.optional(),
|
|
@@ -316,18 +330,23 @@ const AddUserSchema = z.object({
|
|
|
316
330
|
const UpdateUserSchema = z.object({
|
|
317
331
|
language: z.string().optional(),
|
|
318
332
|
timezone: z.string().optional(),
|
|
333
|
+
contacts: z.array(UserContactInputSchema).optional(),
|
|
319
334
|
email: stringOrArray.optional(),
|
|
320
335
|
phone: stringOrArray.optional(),
|
|
321
336
|
pushToken: stringOrArray.optional(),
|
|
322
337
|
segments: z.array(z.string().min(1)).optional(),
|
|
323
338
|
preferences: PreferencesSchema.optional()
|
|
324
339
|
});
|
|
325
|
-
/** addUserContact(userId, channel, { target, preferences
|
|
340
|
+
/** addUserContact(userId, channel, { target, preferences, label, isPrimary, enabled }) */
|
|
326
341
|
const AddContactSchema = z.object({
|
|
327
342
|
channel: ContactChannelSchema,
|
|
328
343
|
target: z.string().min(1),
|
|
344
|
+
label: z.string().optional(),
|
|
345
|
+
isPrimary: z.boolean().optional(),
|
|
346
|
+
enabled: z.boolean().optional(),
|
|
329
347
|
preferences: PreferencesSchema.optional()
|
|
330
348
|
});
|
|
349
|
+
const BatchAddContactsSchema = z.union([AddContactSchema, z.array(AddContactSchema).min(1)]);
|
|
331
350
|
const TemplateSchema = z.object({
|
|
332
351
|
id: z.string().min(1),
|
|
333
352
|
channel: NotificationChannelSchema,
|
|
@@ -341,6 +360,7 @@ const InlineUserSchema = z.object({
|
|
|
341
360
|
id: z.string().min(1),
|
|
342
361
|
language: z.string().optional(),
|
|
343
362
|
timezone: z.string().optional(),
|
|
363
|
+
contacts: z.array(UserContactInputSchema).optional(),
|
|
344
364
|
email: stringOrArray.optional(),
|
|
345
365
|
phone: stringOrArray.optional(),
|
|
346
366
|
pushToken: stringOrArray.optional(),
|
|
@@ -656,10 +676,12 @@ registry.define("notification.ai_pending", NotificationAiPendingPayloadSchema);
|
|
|
656
676
|
//#endregion
|
|
657
677
|
//#region src/db/schema.ts
|
|
658
678
|
var schema_exports = /* @__PURE__ */ __exportAll({
|
|
679
|
+
adminUsers: () => adminUsers,
|
|
659
680
|
apiKeyRoleEnum: () => apiKeyRoleEnum,
|
|
660
681
|
channelEnum: () => channelEnum,
|
|
661
682
|
contactTopicPreferences: () => contactTopicPreferences,
|
|
662
683
|
deliveryOutbox: () => deliveryOutbox,
|
|
684
|
+
insertAdminUserSchema: () => insertAdminUserSchema,
|
|
663
685
|
insertDeliveryOutboxSchema: () => insertDeliveryOutboxSchema,
|
|
664
686
|
insertMessageLogSchema: () => insertMessageLogSchema,
|
|
665
687
|
insertProjectApiKeySchema: () => insertProjectApiKeySchema,
|
|
@@ -679,6 +701,7 @@ var schema_exports = /* @__PURE__ */ __exportAll({
|
|
|
679
701
|
projects: () => projects,
|
|
680
702
|
quietHours: () => quietHours,
|
|
681
703
|
scheduledPayloads: () => scheduledPayloads,
|
|
704
|
+
selectAdminUserSchema: () => selectAdminUserSchema,
|
|
682
705
|
selectDeliveryOutboxSchema: () => selectDeliveryOutboxSchema,
|
|
683
706
|
selectMessageLogSchema: () => selectMessageLogSchema,
|
|
684
707
|
selectProjectApiKeySchema: () => selectProjectApiKeySchema,
|
|
@@ -924,6 +947,17 @@ const scheduledPayloads = pgTable("scheduled_payloads", {
|
|
|
924
947
|
payload: jsonb("payload").notNull(),
|
|
925
948
|
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull()
|
|
926
949
|
});
|
|
950
|
+
const adminUsers = pgTable("admin_users", {
|
|
951
|
+
id: uuid("id").primaryKey().defaultRandom(),
|
|
952
|
+
email: varchar("email").notNull().unique(),
|
|
953
|
+
username: varchar("username").unique(),
|
|
954
|
+
passwordHash: varchar("password_hash").notNull(),
|
|
955
|
+
role: varchar("role").notNull().default("admin"),
|
|
956
|
+
createdAt: timestamp("created_at", { withTimezone: true }).defaultNow().notNull(),
|
|
957
|
+
updatedAt: timestamp("updated_at", { withTimezone: true }).defaultNow().notNull()
|
|
958
|
+
});
|
|
959
|
+
const insertAdminUserSchema = createInsertSchema(adminUsers);
|
|
960
|
+
const selectAdminUserSchema = createSelectSchema(adminUsers);
|
|
927
961
|
const insertProjectSchema = createInsertSchema(projects);
|
|
928
962
|
const selectProjectSchema = createSelectSchema(projects);
|
|
929
963
|
const insertProjectApiKeySchema = createInsertSchema(projectApiKeys);
|
|
@@ -2550,6 +2584,46 @@ var SegmentRepository = class {
|
|
|
2550
2584
|
`)).map((r) => r.segment);
|
|
2551
2585
|
}
|
|
2552
2586
|
};
|
|
2587
|
+
var AdminUserRepository = class {
|
|
2588
|
+
db;
|
|
2589
|
+
constructor(db) {
|
|
2590
|
+
this.db = db;
|
|
2591
|
+
}
|
|
2592
|
+
async findByEmailOrUsername(identifier) {
|
|
2593
|
+
const normalized = identifier.trim().toLowerCase();
|
|
2594
|
+
return (await this.db.select().from(adminUsers).where(or(eq(adminUsers.email, normalized), eq(adminUsers.username, identifier.trim()))).limit(1))[0] ?? null;
|
|
2595
|
+
}
|
|
2596
|
+
async findById(id) {
|
|
2597
|
+
return (await this.db.select().from(adminUsers).where(eq(adminUsers.id, id)).limit(1))[0] ?? null;
|
|
2598
|
+
}
|
|
2599
|
+
async create(data) {
|
|
2600
|
+
return (await this.db.insert(adminUsers).values({
|
|
2601
|
+
email: data.email.trim().toLowerCase(),
|
|
2602
|
+
username: data.username ? data.username.trim() : null,
|
|
2603
|
+
passwordHash: data.passwordHash,
|
|
2604
|
+
role: data.role || "admin"
|
|
2605
|
+
}).returning())[0];
|
|
2606
|
+
}
|
|
2607
|
+
async updatePassword(id, passwordHash) {
|
|
2608
|
+
return (await this.db.update(adminUsers).set({
|
|
2609
|
+
passwordHash,
|
|
2610
|
+
updatedAt: /* @__PURE__ */ new Date()
|
|
2611
|
+
}).where(eq(adminUsers.id, id)).returning()).length > 0;
|
|
2612
|
+
}
|
|
2613
|
+
async list() {
|
|
2614
|
+
return await this.db.select({
|
|
2615
|
+
id: adminUsers.id,
|
|
2616
|
+
email: adminUsers.email,
|
|
2617
|
+
username: adminUsers.username,
|
|
2618
|
+
role: adminUsers.role,
|
|
2619
|
+
createdAt: adminUsers.createdAt,
|
|
2620
|
+
updatedAt: adminUsers.updatedAt
|
|
2621
|
+
}).from(adminUsers).orderBy(adminUsers.createdAt);
|
|
2622
|
+
}
|
|
2623
|
+
async count() {
|
|
2624
|
+
return (await this.db.select({ count: sql`count(*)::int` }).from(adminUsers))[0]?.count ?? 0;
|
|
2625
|
+
}
|
|
2626
|
+
};
|
|
2553
2627
|
//#endregion
|
|
2554
2628
|
//#region src/templates/render.ts
|
|
2555
2629
|
function escapeHtml(unsafe) {
|
|
@@ -3064,29 +3138,41 @@ var NotifkitClient = class {
|
|
|
3064
3138
|
}
|
|
3065
3139
|
return data;
|
|
3066
3140
|
}
|
|
3067
|
-
/** Sync templates with the server. */
|
|
3141
|
+
/** Sync templates with the server. Accepts either { templates: [...] } or an array of templates directly. */
|
|
3068
3142
|
async syncTemplates(input) {
|
|
3069
|
-
|
|
3143
|
+
const payload = Array.isArray(input) ? { templates: input } : input;
|
|
3144
|
+
return this.request("/v1/templates", "PUT", payload);
|
|
3145
|
+
}
|
|
3146
|
+
async addUser(idOrInput, contacts, options) {
|
|
3147
|
+
if (typeof idOrInput === "string") return this.request("/v1/users", "POST", {
|
|
3148
|
+
id: idOrInput,
|
|
3149
|
+
contacts: contacts ?? [],
|
|
3150
|
+
...options
|
|
3151
|
+
});
|
|
3152
|
+
return this.request("/v1/users", "POST", idOrInput);
|
|
3070
3153
|
}
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
return this.request("/v1/users", "POST", input);
|
|
3154
|
+
async identify(idOrInput, contacts, options) {
|
|
3155
|
+
return this.addUser(idOrInput, contacts, options);
|
|
3074
3156
|
}
|
|
3075
3157
|
/** Update user profile. */
|
|
3076
3158
|
async updateUser(id, input) {
|
|
3077
|
-
return this.request(`/v1/users/${id}`, "PATCH", input);
|
|
3159
|
+
return this.request(`/v1/users/${encodeURIComponent(id)}`, "PATCH", input);
|
|
3078
3160
|
}
|
|
3079
3161
|
/** Delete user profile. */
|
|
3080
3162
|
async deleteUser(id) {
|
|
3081
|
-
return this.request(`/v1/users/${id}`, "DELETE");
|
|
3163
|
+
return this.request(`/v1/users/${encodeURIComponent(id)}`, "DELETE");
|
|
3082
3164
|
}
|
|
3083
|
-
/** Add contact
|
|
3165
|
+
/** Add contact target to user profile. */
|
|
3084
3166
|
async addContact(userId, input) {
|
|
3085
|
-
return this.request(`/v1/users/${userId}/contacts`, "POST", input);
|
|
3167
|
+
return this.request(`/v1/users/${encodeURIComponent(userId)}/contacts`, "POST", input);
|
|
3168
|
+
}
|
|
3169
|
+
/** Add multiple contact targets to user profile in a batch. */
|
|
3170
|
+
async addContacts(userId, contacts) {
|
|
3171
|
+
return this.request(`/v1/users/${encodeURIComponent(userId)}/contacts`, "POST", contacts);
|
|
3086
3172
|
}
|
|
3087
3173
|
/** Delete a specific contact channel target. */
|
|
3088
3174
|
async deleteContact(userId, channel, target) {
|
|
3089
|
-
return this.request(`/v1/users/${userId}/contacts/${channel}/${target}`, "DELETE");
|
|
3175
|
+
return this.request(`/v1/users/${encodeURIComponent(userId)}/contacts/${encodeURIComponent(channel)}/${encodeURIComponent(target)}`, "DELETE");
|
|
3090
3176
|
}
|
|
3091
3177
|
/** Request a notification dispatch. */
|
|
3092
3178
|
async notify(input) {
|
|
@@ -3119,11 +3205,11 @@ var NotifkitClient = class {
|
|
|
3119
3205
|
}
|
|
3120
3206
|
/** Get a workflow instance by ID. */
|
|
3121
3207
|
async getWorkflow(instanceId) {
|
|
3122
|
-
return this.request(`/v1/workflows/instances/${instanceId}`, "GET");
|
|
3208
|
+
return this.request(`/v1/workflows/instances/${encodeURIComponent(instanceId)}`, "GET");
|
|
3123
3209
|
}
|
|
3124
3210
|
/** Cancel a running/suspended workflow instance. */
|
|
3125
3211
|
async cancelWorkflow(instanceId) {
|
|
3126
|
-
return this.request(`/v1/workflows/instances/${instanceId}`, "DELETE");
|
|
3212
|
+
return this.request(`/v1/workflows/instances/${encodeURIComponent(instanceId)}`, "DELETE");
|
|
3127
3213
|
}
|
|
3128
3214
|
/** Get notification logs for the project. */
|
|
3129
3215
|
async getNotificationLogs(options) {
|
|
@@ -3159,11 +3245,11 @@ var NotifkitClient = class {
|
|
|
3159
3245
|
}
|
|
3160
3246
|
/** Delete a template. */
|
|
3161
3247
|
async deleteTemplate(id) {
|
|
3162
|
-
return this.request(`/v1/templates/${id}`, "DELETE");
|
|
3248
|
+
return this.request(`/v1/templates/${encodeURIComponent(id)}`, "DELETE");
|
|
3163
3249
|
}
|
|
3164
3250
|
/** Get a user's contacts. */
|
|
3165
3251
|
async getUserContacts(userId) {
|
|
3166
|
-
return this.request(`/v1/users/${userId}/contacts`, "GET");
|
|
3252
|
+
return this.request(`/v1/users/${encodeURIComponent(userId)}/contacts`, "GET");
|
|
3167
3253
|
}
|
|
3168
3254
|
/** List projects (Admin only). */
|
|
3169
3255
|
async listProjects() {
|
|
@@ -3171,23 +3257,23 @@ var NotifkitClient = class {
|
|
|
3171
3257
|
}
|
|
3172
3258
|
/** Delete a project (Admin only). */
|
|
3173
3259
|
async deleteProject(id) {
|
|
3174
|
-
return this.request(`/v1/projects/${id}`, "DELETE");
|
|
3260
|
+
return this.request(`/v1/projects/${encodeURIComponent(id)}`, "DELETE");
|
|
3175
3261
|
}
|
|
3176
3262
|
/** Create a new project API key (Admin only). */
|
|
3177
3263
|
async createProjectKey(id, input) {
|
|
3178
|
-
return this.request(`/v1/projects/${id}/keys`, "POST", input || {});
|
|
3264
|
+
return this.request(`/v1/projects/${encodeURIComponent(id)}/keys`, "POST", input || {});
|
|
3179
3265
|
}
|
|
3180
3266
|
/** List project API keys (Admin only). */
|
|
3181
3267
|
async listProjectKeys(id) {
|
|
3182
|
-
return this.request(`/v1/projects/${id}/keys`, "GET");
|
|
3268
|
+
return this.request(`/v1/projects/${encodeURIComponent(id)}/keys`, "GET");
|
|
3183
3269
|
}
|
|
3184
3270
|
/** Delete a project API key (Admin only). */
|
|
3185
3271
|
async deleteProjectKey(id, keyId) {
|
|
3186
|
-
return this.request(`/v1/projects/${id}/keys/${keyId}`, "DELETE");
|
|
3272
|
+
return this.request(`/v1/projects/${encodeURIComponent(id)}/keys/${encodeURIComponent(keyId)}`, "DELETE");
|
|
3187
3273
|
}
|
|
3188
3274
|
/** Update project settings (Admin only). */
|
|
3189
3275
|
async updateProject(id, input) {
|
|
3190
|
-
return this.request(`/v1/projects/${id}`, "PATCH", input);
|
|
3276
|
+
return this.request(`/v1/projects/${encodeURIComponent(id)}`, "PATCH", input);
|
|
3191
3277
|
}
|
|
3192
3278
|
/** List unique segment tags. */
|
|
3193
3279
|
async listSegments() {
|
|
@@ -3373,35 +3459,35 @@ var NotifkitServer = class extends EventEmitter {
|
|
|
3373
3459
|
}
|
|
3374
3460
|
const startupPromises = [];
|
|
3375
3461
|
if (services.includes("api")) {
|
|
3376
|
-
const { startApiServer } = await import("./main-
|
|
3462
|
+
const { startApiServer } = await import("./main-BAO4kKce.mjs");
|
|
3377
3463
|
startupPromises.push(startApiServer());
|
|
3378
3464
|
}
|
|
3379
3465
|
if (services.includes("delivery")) {
|
|
3380
|
-
const { startDeliveryWorker } = await import("./main-
|
|
3466
|
+
const { startDeliveryWorker } = await import("./main-7KMlWnDx.mjs");
|
|
3381
3467
|
startupPromises.push(startDeliveryWorker());
|
|
3382
3468
|
}
|
|
3383
3469
|
if (services.includes("engine")) {
|
|
3384
|
-
const { startEngineWorker } = await import("./main-
|
|
3470
|
+
const { startEngineWorker } = await import("./main-BxqAXTr6.mjs");
|
|
3385
3471
|
startupPromises.push(startEngineWorker());
|
|
3386
3472
|
}
|
|
3387
3473
|
if (services.includes("enricher")) {
|
|
3388
|
-
const { startEnricherWorker } = await import("./main-
|
|
3474
|
+
const { startEnricherWorker } = await import("./main-B0BcY_JJ.mjs");
|
|
3389
3475
|
startupPromises.push(startEnricherWorker());
|
|
3390
3476
|
}
|
|
3391
3477
|
if (services.includes("scheduler")) {
|
|
3392
|
-
const { startSchedulerWorker } = await import("./main-
|
|
3478
|
+
const { startSchedulerWorker } = await import("./main-zCpvA9Rx.mjs");
|
|
3393
3479
|
startupPromises.push(startSchedulerWorker());
|
|
3394
3480
|
}
|
|
3395
3481
|
if (services.includes("ai")) {
|
|
3396
|
-
const { startAiWorker } = await import("./main-
|
|
3482
|
+
const { startAiWorker } = await import("./main-0FHNtN5g.mjs");
|
|
3397
3483
|
startupPromises.push(startAiWorker());
|
|
3398
3484
|
}
|
|
3399
3485
|
if (services.includes("workflow")) {
|
|
3400
|
-
const { startWorkflowWorker } = await import("./main-
|
|
3486
|
+
const { startWorkflowWorker } = await import("./main-BtXITy0k.mjs");
|
|
3401
3487
|
startupPromises.push(startWorkflowWorker());
|
|
3402
3488
|
}
|
|
3403
3489
|
if (services.includes("events")) {
|
|
3404
|
-
const { startEventWorker } = await import("./main-
|
|
3490
|
+
const { startEventWorker } = await import("./main-BjXgGJBd.mjs");
|
|
3405
3491
|
startupPromises.push(startEventWorker());
|
|
3406
3492
|
}
|
|
3407
3493
|
const handleSignal = async (signal) => {
|
|
@@ -3441,35 +3527,35 @@ var NotifkitServer = class extends EventEmitter {
|
|
|
3441
3527
|
"events"
|
|
3442
3528
|
] : this.options.services;
|
|
3443
3529
|
if (services.includes("api")) {
|
|
3444
|
-
const { stopApiServer } = await import("./main-
|
|
3530
|
+
const { stopApiServer } = await import("./main-BAO4kKce.mjs");
|
|
3445
3531
|
await stopApiServer();
|
|
3446
3532
|
}
|
|
3447
3533
|
if (services.includes("delivery")) {
|
|
3448
|
-
const { stopDeliveryWorker } = await import("./main-
|
|
3534
|
+
const { stopDeliveryWorker } = await import("./main-7KMlWnDx.mjs");
|
|
3449
3535
|
await stopDeliveryWorker();
|
|
3450
3536
|
}
|
|
3451
3537
|
if (services.includes("engine")) {
|
|
3452
|
-
const { stopEngineWorker } = await import("./main-
|
|
3538
|
+
const { stopEngineWorker } = await import("./main-BxqAXTr6.mjs");
|
|
3453
3539
|
await stopEngineWorker();
|
|
3454
3540
|
}
|
|
3455
3541
|
if (services.includes("enricher")) {
|
|
3456
|
-
const { stopEnricherWorker } = await import("./main-
|
|
3542
|
+
const { stopEnricherWorker } = await import("./main-B0BcY_JJ.mjs");
|
|
3457
3543
|
await stopEnricherWorker();
|
|
3458
3544
|
}
|
|
3459
3545
|
if (services.includes("scheduler")) {
|
|
3460
|
-
const { stopSchedulerWorker } = await import("./main-
|
|
3546
|
+
const { stopSchedulerWorker } = await import("./main-zCpvA9Rx.mjs");
|
|
3461
3547
|
await stopSchedulerWorker();
|
|
3462
3548
|
}
|
|
3463
3549
|
if (services.includes("ai")) {
|
|
3464
|
-
const { stopAiWorker } = await import("./main-
|
|
3550
|
+
const { stopAiWorker } = await import("./main-0FHNtN5g.mjs");
|
|
3465
3551
|
await stopAiWorker();
|
|
3466
3552
|
}
|
|
3467
3553
|
if (services.includes("workflow")) {
|
|
3468
|
-
const { stopWorkflowWorker } = await import("./main-
|
|
3554
|
+
const { stopWorkflowWorker } = await import("./main-BtXITy0k.mjs");
|
|
3469
3555
|
await stopWorkflowWorker();
|
|
3470
3556
|
}
|
|
3471
3557
|
if (services.includes("events")) {
|
|
3472
|
-
const { stopEventWorker } = await import("./main-
|
|
3558
|
+
const { stopEventWorker } = await import("./main-BjXgGJBd.mjs");
|
|
3473
3559
|
await stopEventWorker();
|
|
3474
3560
|
}
|
|
3475
3561
|
if (this.pgContainer) {
|
|
@@ -3483,6 +3569,6 @@ var NotifkitServer = class extends EventEmitter {
|
|
|
3483
3569
|
}
|
|
3484
3570
|
};
|
|
3485
3571
|
//#endregion
|
|
3486
|
-
export {
|
|
3572
|
+
export { metrics as $, ENRICHED_STREAMS as $t, RedisClient as A, NotificationCreatedPayloadSchema as At, AsyncSemaphore as B, NotifyRequestSchema as Bt, PreferenceRepository as C, NotificationDeliveredPayloadSchema as Ct, UserRepository as D, NotificationScheduledPayloadSchema as Dt, TemplateRepository as E, RenderedContentSchema as Et, generateId as F, BatchAddContactsSchema as Ft, getPriorityBucket as G, TriggerWorkflowSchema as Gt, LUA_RENEW_LOCK as H, QuietHoursSchema as Ht, sleep as I, ContactChannelSchema as It, globalEmitter as J, UserContactInputSchema as Jt, normaliseTarget as K, UpdateProjectSchema as Kt, DataLoader as L, CreateWorkflowSchema as Lt, UserThrottle as M, NotificationTargetSchema as Mt, AppError as N, AddContactSchema as Nt, WorkflowRepository as O, NotificationEnrichedPayloadSchema as Ot, ValidationError as P, AddUserSchema as Pt, getMetricsRegistry as Q, CONSUMER_GROUPS as Qt, CircuitBreaker as R, IngestEventSchema as Rt, ContactRepository as S, NotificationFailedPayloadSchema as St, SegmentRepository as T, NotificationDispatchedPayloadSchema as Tt, LUA_SCHEDULER_CLAIM as U, SyncTemplatesSchema as Ut, LUA_RELEASE_LOCK as V, PreferencesSchema as Vt, LUA_SCHEDULER_POLL as W, TemplateSchema as Wt, StreamConsumer as X, WorkflowStepSchema as Xt, PendingMessageScanner as Y, WorkflowNotifyPayloadSchema as Yt, StreamProducer as Z, buildStreamEvent as Zt, escapeHeader as _, parseConfig as _n, workflowSteps as _t, SuspendExecutionError as a, StreamEventMetadataSchema as an, createDatabase as at, renderWithTemplate as b, setGlobalConfig as bn, NotificationCanceledPayloadSchema as bt, BaseWorker as c, registry as cn, messageLogs as ct, buildUnsubscribeHeaders as d, NotificationPrioritySchema as dn, scheduledPayloads as dt, INBOUND_STREAMS as en, childLogger as et, signUnsubscribeToken as f, NotificationStatusSchema as fn, suppressions as ft, TemplateCache as g, loadEnv as gn, workflowInstances as gt, templateRegistry as h, getAiConfig as hn, workflowDefinitions as ht, workflowRegistry as i, EventEnvelopeSchema as in, IdempotencyGuard as it, ProjectSettingsCache as j, NotificationRequestedPayloadSchema as jt, Redis as k, RecipientProfileSchema as kt, NonRetryableError as l, EventMetadataSchema as ln, projectApiKeys as lt, renderTemplate as m, baseConfigSchema as mn, users as mt, NotifkitClient as n, PUBSUB_CHANNELS as nn, withContext as nt, buildStepNotifyPayload as o, StreamEventSchema as on, runMigrations as ot, verifyUnsubscribeToken as p, AI_DEFAULTS as pn, userTopicPreferences as pt, LRUCache as q, UpdateUserSchema as qt, workflow as r, STREAMS as rn, withRequestId as rt, resolveStepTarget as s, EventRegistry as sn, deliveryOutbox as st, NotifkitServer as t, OUTBOUND_STREAMS as tn, createLogger as tt, startHealthReporter as u, NotificationChannelSchema as un, projects as ut, escapeHtml as v, readBaseConfig as vn, workflowWaiters as vt, ProjectRepository as w, DeliveryOptionsSchema as wt, AdminUserRepository as x, NotificationSkippedPayloadSchema as xt, interpolate as y, setAiConfig as yn, NotificationAiPendingPayloadSchema as yt, BatchProcessor as z, InlineUserSchema as zt };
|
|
3487
3573
|
|
|
3488
|
-
//# sourceMappingURL=src-
|
|
3574
|
+
//# sourceMappingURL=src-DkvHYM3y.mjs.map
|