@develit-services/notification 0.0.14 → 0.0.16
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/database/schema.cjs +9 -0
- package/dist/database/schema.d.cts +2 -0
- package/dist/database/schema.d.mts +2 -0
- package/dist/database/schema.d.ts +2 -0
- package/dist/database/schema.mjs +3 -0
- package/dist/export/worker.cjs +41 -41
- package/dist/export/worker.d.cts +2 -201
- package/dist/export/worker.d.mts +2 -201
- package/dist/export/worker.d.ts +2 -201
- package/dist/export/worker.mjs +41 -41
- package/dist/shared/notification.4b3eUEIG.cjs +22 -0
- package/dist/shared/notification.BJyMXKGH.d.cts +203 -0
- package/dist/shared/notification.BJyMXKGH.d.mts +203 -0
- package/dist/shared/notification.BJyMXKGH.d.ts +203 -0
- package/dist/shared/notification.C0X8Orrh.mjs +19 -0
- package/package.json +5 -5
- package/@types/consts/audit-log.consts.ts +0 -7
- package/@types/consts/index.ts +0 -1
- package/@types/database/audit-log.types.ts +0 -7
- package/@types/database/index.ts +0 -1
- package/@types/email/IEmail.connector.ts +0 -21
- package/@types/email/IEmail.types.ts +0 -25
- package/@types/email/ecomail/ecomail.connector.ts +0 -139
- package/@types/email/ecomail/ecomail.types.ts +0 -27
- package/@types/email/ecomail/index.ts +0 -2
- package/@types/email/index.ts +0 -3
- package/@types/index.ts +0 -9
- package/@types/io/index.ts +0 -3
- package/@types/io/sendEmail.ts +0 -18
- package/@types/io/sendSlack.ts +0 -19
- package/@types/io/sendSms.ts +0 -20
- package/@types/pushNotification/IPushNotification.ts +0 -1
- package/@types/pushNotification/index.ts +0 -1
- package/@types/queue.ts +0 -19
- package/@types/service.ts +0 -30
- package/@types/slack/ISlack.types.ts +0 -3
- package/@types/slack/index.ts +0 -1
- package/@types/slack/slack.connector.ts +0 -27
- package/@types/sms/ISms.connector.ts +0 -22
- package/@types/sms/ISms.types.ts +0 -4
- package/@types/sms/index.ts +0 -3
- package/@types/sms/twilio/index.ts +0 -1
- package/@types/sms/twilio/twilio.connector.ts +0 -35
- package/src/database/schema/audit-log.schema.ts +0 -13
- package/src/database/schema/index.ts +0 -1
package/dist/export/worker.cjs
CHANGED
|
@@ -6,8 +6,9 @@ const backendSdk = require('@develit-io/backend-sdk');
|
|
|
6
6
|
const z = require('zod');
|
|
7
7
|
const v4 = require('zod/v4');
|
|
8
8
|
const twilio = require('twilio');
|
|
9
|
-
const
|
|
9
|
+
const database_schema = require('../shared/notification.4b3eUEIG.cjs');
|
|
10
10
|
require('drizzle-orm');
|
|
11
|
+
require('drizzle-orm/sqlite-core');
|
|
11
12
|
const cloudflare_workers = require('cloudflare:workers');
|
|
12
13
|
const d1 = require('drizzle-orm/d1');
|
|
13
14
|
|
|
@@ -37,10 +38,6 @@ const iEmailSchema = z.z.object({
|
|
|
37
38
|
});
|
|
38
39
|
|
|
39
40
|
class IEmailConnector {
|
|
40
|
-
static providerName;
|
|
41
|
-
API_KEY;
|
|
42
|
-
SMTP_HOST;
|
|
43
|
-
SENDER;
|
|
44
41
|
constructor({
|
|
45
42
|
API_KEY,
|
|
46
43
|
SMTP_HOST,
|
|
@@ -53,7 +50,9 @@ class IEmailConnector {
|
|
|
53
50
|
}
|
|
54
51
|
|
|
55
52
|
class EcomailConnector extends IEmailConnector {
|
|
56
|
-
static
|
|
53
|
+
static {
|
|
54
|
+
this.providerName = "ecomail";
|
|
55
|
+
}
|
|
57
56
|
constructor({
|
|
58
57
|
API_KEY,
|
|
59
58
|
SMTP_HOST,
|
|
@@ -183,10 +182,6 @@ const sendSmsInputSchema = z.z.object({
|
|
|
183
182
|
});
|
|
184
183
|
|
|
185
184
|
class ISmsConnector {
|
|
186
|
-
static providerName;
|
|
187
|
-
ACCOUNT_ID;
|
|
188
|
-
AUTH_TOKEN;
|
|
189
|
-
SERVICE_ID;
|
|
190
185
|
constructor({
|
|
191
186
|
ACCOUNT_ID,
|
|
192
187
|
AUTH_TOKEN,
|
|
@@ -199,8 +194,9 @@ class ISmsConnector {
|
|
|
199
194
|
}
|
|
200
195
|
|
|
201
196
|
class TwilioConnector extends ISmsConnector {
|
|
202
|
-
static
|
|
203
|
-
|
|
197
|
+
static {
|
|
198
|
+
this.providerName = "twilio";
|
|
199
|
+
}
|
|
204
200
|
constructor({
|
|
205
201
|
ACCOUNT_ID,
|
|
206
202
|
AUTH_TOKEN,
|
|
@@ -223,22 +219,7 @@ class TwilioConnector extends ISmsConnector {
|
|
|
223
219
|
}
|
|
224
220
|
}
|
|
225
221
|
|
|
226
|
-
const
|
|
227
|
-
...backendSdk.base,
|
|
228
|
-
event: sqliteCore.text("event").$type().notNull(),
|
|
229
|
-
ip: sqliteCore.text("ip"),
|
|
230
|
-
userAgent: sqliteCore.text("user_agent"),
|
|
231
|
-
description: sqliteCore.text("description"),
|
|
232
|
-
initiatorService: sqliteCore.text("initiator_service").notNull(),
|
|
233
|
-
initiatorUserId: sqliteCore.text("initiator_user_id")
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
const schema = {
|
|
237
|
-
__proto__: null,
|
|
238
|
-
auditLog: auditLog
|
|
239
|
-
};
|
|
240
|
-
|
|
241
|
-
const tables = schema;
|
|
222
|
+
const tables = database_schema.schema;
|
|
242
223
|
|
|
243
224
|
const initiateEmailConnector = async (provider, apiKey, smtpHost, sender) => {
|
|
244
225
|
const connector = [EcomailConnector].find(
|
|
@@ -295,7 +276,6 @@ const initiateSmsConnector = async (provider, accountId, authToken, serviceId) =
|
|
|
295
276
|
};
|
|
296
277
|
|
|
297
278
|
class SlackConnector {
|
|
298
|
-
webhooks;
|
|
299
279
|
constructor(webhooks) {
|
|
300
280
|
this.webhooks = webhooks;
|
|
301
281
|
}
|
|
@@ -317,20 +297,25 @@ class SlackConnector {
|
|
|
317
297
|
}
|
|
318
298
|
}
|
|
319
299
|
|
|
300
|
+
var __defProp = Object.defineProperty;
|
|
301
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
302
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
303
|
+
var result = __getOwnPropDesc(target, key) ;
|
|
304
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
305
|
+
if (decorator = decorators[i])
|
|
306
|
+
result = (decorator(target, key, result) ) || result;
|
|
307
|
+
if (result) __defProp(target, key, result);
|
|
308
|
+
return result;
|
|
309
|
+
};
|
|
320
310
|
class NotificationServiceBase extends backendSdk.develitWorker(
|
|
321
311
|
cloudflare_workers.WorkerEntrypoint
|
|
322
312
|
) {
|
|
323
|
-
name;
|
|
324
|
-
slackConnector = new SlackConnector(this.env.SLACK_WEBHOOKS);
|
|
325
|
-
emailConnector;
|
|
326
|
-
smsConnector;
|
|
327
|
-
db;
|
|
328
313
|
constructor(ctx, env) {
|
|
329
314
|
super(ctx, env);
|
|
315
|
+
this.slackConnector = new SlackConnector(this.env.SLACK_WEBHOOKS);
|
|
330
316
|
this.name = "notification-service";
|
|
331
317
|
this.db = d1.drizzle(this.env.NOTIFICATION_D1, { schema: tables });
|
|
332
318
|
}
|
|
333
|
-
@backendSdk.cloudflareQueue({ baseDelay: 60 })
|
|
334
319
|
async queue(batch) {
|
|
335
320
|
for (const message of batch.messages) {
|
|
336
321
|
this.logInput({ message });
|
|
@@ -404,7 +389,6 @@ class NotificationServiceBase extends backendSdk.develitWorker(
|
|
|
404
389
|
message.ack();
|
|
405
390
|
}
|
|
406
391
|
}
|
|
407
|
-
@backendSdk.action("private-send-email")
|
|
408
392
|
async _sendEmail(input) {
|
|
409
393
|
return this.handleAction(
|
|
410
394
|
{ data: input, schema: sendEmailInputSchema },
|
|
@@ -449,7 +433,6 @@ class NotificationServiceBase extends backendSdk.develitWorker(
|
|
|
449
433
|
}
|
|
450
434
|
);
|
|
451
435
|
}
|
|
452
|
-
@backendSdk.action("private-send-sms")
|
|
453
436
|
async _sendSms(input) {
|
|
454
437
|
return this.handleAction(
|
|
455
438
|
{ data: input, schema: sendSmsInputSchema },
|
|
@@ -481,7 +464,6 @@ class NotificationServiceBase extends backendSdk.develitWorker(
|
|
|
481
464
|
}
|
|
482
465
|
);
|
|
483
466
|
}
|
|
484
|
-
@backendSdk.action("public-send-email")
|
|
485
467
|
async sendEmail(input) {
|
|
486
468
|
return this.handleAction(
|
|
487
469
|
{ data: input, schema: sendEmailInputSchema },
|
|
@@ -502,7 +484,6 @@ class NotificationServiceBase extends backendSdk.develitWorker(
|
|
|
502
484
|
}
|
|
503
485
|
);
|
|
504
486
|
}
|
|
505
|
-
@backendSdk.action("public-send-sms")
|
|
506
487
|
async sendSms(input) {
|
|
507
488
|
return this.handleAction(
|
|
508
489
|
{ data: input, schema: sendSmsInputSchema },
|
|
@@ -529,13 +510,11 @@ class NotificationServiceBase extends backendSdk.develitWorker(
|
|
|
529
510
|
}
|
|
530
511
|
);
|
|
531
512
|
}
|
|
532
|
-
@backendSdk.action("send-push-notification")
|
|
533
513
|
async _sendPushNotification() {
|
|
534
514
|
this.logInput({});
|
|
535
515
|
this.logError({ error: "Method not implemented." });
|
|
536
516
|
throw new Error("Method not implemented.");
|
|
537
517
|
}
|
|
538
|
-
@backendSdk.action("send-slack-notification")
|
|
539
518
|
async sendSlackNotification(input) {
|
|
540
519
|
return this.handleAction(
|
|
541
520
|
{
|
|
@@ -551,6 +530,27 @@ class NotificationServiceBase extends backendSdk.develitWorker(
|
|
|
551
530
|
);
|
|
552
531
|
}
|
|
553
532
|
}
|
|
533
|
+
__decorateClass([
|
|
534
|
+
backendSdk.cloudflareQueue({ baseDelay: 60 })
|
|
535
|
+
], NotificationServiceBase.prototype, "queue");
|
|
536
|
+
__decorateClass([
|
|
537
|
+
backendSdk.action("private-send-email")
|
|
538
|
+
], NotificationServiceBase.prototype, "_sendEmail");
|
|
539
|
+
__decorateClass([
|
|
540
|
+
backendSdk.action("private-send-sms")
|
|
541
|
+
], NotificationServiceBase.prototype, "_sendSms");
|
|
542
|
+
__decorateClass([
|
|
543
|
+
backendSdk.action("public-send-email")
|
|
544
|
+
], NotificationServiceBase.prototype, "sendEmail");
|
|
545
|
+
__decorateClass([
|
|
546
|
+
backendSdk.action("public-send-sms")
|
|
547
|
+
], NotificationServiceBase.prototype, "sendSms");
|
|
548
|
+
__decorateClass([
|
|
549
|
+
backendSdk.action("send-push-notification")
|
|
550
|
+
], NotificationServiceBase.prototype, "_sendPushNotification");
|
|
551
|
+
__decorateClass([
|
|
552
|
+
backendSdk.action("send-slack-notification")
|
|
553
|
+
], NotificationServiceBase.prototype, "sendSlackNotification");
|
|
554
554
|
function defineNotificationService() {
|
|
555
555
|
return class NotificationService extends NotificationServiceBase {
|
|
556
556
|
constructor(ctx, env) {
|
package/dist/export/worker.d.cts
CHANGED
|
@@ -2,9 +2,10 @@ import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
|
2
2
|
import { InternalError, IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
3
|
import z$1, { z } from 'zod';
|
|
4
4
|
import { z as z$2 } from 'zod/v4';
|
|
5
|
-
import
|
|
5
|
+
import { s as schema } from '../shared/notification.BJyMXKGH.cjs';
|
|
6
6
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
7
7
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
8
|
+
import 'drizzle-orm/sqlite-core';
|
|
8
9
|
|
|
9
10
|
declare const iContactSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
10
11
|
email: z.ZodString;
|
|
@@ -199,206 +200,6 @@ interface ISlack {
|
|
|
199
200
|
message: string;
|
|
200
201
|
}
|
|
201
202
|
|
|
202
|
-
declare const auditLog: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
203
|
-
name: "audit_log";
|
|
204
|
-
schema: undefined;
|
|
205
|
-
columns: {
|
|
206
|
-
event: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
207
|
-
name: "event";
|
|
208
|
-
tableName: "audit_log";
|
|
209
|
-
dataType: "string";
|
|
210
|
-
columnType: "SQLiteText";
|
|
211
|
-
data: "EMAIL" | "SMS" | "PUSH_NOTIFICATION" | "SLACK";
|
|
212
|
-
driverParam: string;
|
|
213
|
-
notNull: true;
|
|
214
|
-
hasDefault: false;
|
|
215
|
-
isPrimaryKey: false;
|
|
216
|
-
isAutoincrement: false;
|
|
217
|
-
hasRuntimeDefault: false;
|
|
218
|
-
enumValues: [string, ...string[]];
|
|
219
|
-
baseColumn: never;
|
|
220
|
-
identity: undefined;
|
|
221
|
-
generated: undefined;
|
|
222
|
-
}, {}, {
|
|
223
|
-
length: number | undefined;
|
|
224
|
-
$type: "EMAIL" | "SMS" | "PUSH_NOTIFICATION" | "SLACK";
|
|
225
|
-
}>;
|
|
226
|
-
ip: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
227
|
-
name: "ip";
|
|
228
|
-
tableName: "audit_log";
|
|
229
|
-
dataType: "string";
|
|
230
|
-
columnType: "SQLiteText";
|
|
231
|
-
data: string;
|
|
232
|
-
driverParam: string;
|
|
233
|
-
notNull: false;
|
|
234
|
-
hasDefault: false;
|
|
235
|
-
isPrimaryKey: false;
|
|
236
|
-
isAutoincrement: false;
|
|
237
|
-
hasRuntimeDefault: false;
|
|
238
|
-
enumValues: [string, ...string[]];
|
|
239
|
-
baseColumn: never;
|
|
240
|
-
identity: undefined;
|
|
241
|
-
generated: undefined;
|
|
242
|
-
}, {}, {
|
|
243
|
-
length: number | undefined;
|
|
244
|
-
}>;
|
|
245
|
-
userAgent: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
246
|
-
name: "user_agent";
|
|
247
|
-
tableName: "audit_log";
|
|
248
|
-
dataType: "string";
|
|
249
|
-
columnType: "SQLiteText";
|
|
250
|
-
data: string;
|
|
251
|
-
driverParam: string;
|
|
252
|
-
notNull: false;
|
|
253
|
-
hasDefault: false;
|
|
254
|
-
isPrimaryKey: false;
|
|
255
|
-
isAutoincrement: false;
|
|
256
|
-
hasRuntimeDefault: false;
|
|
257
|
-
enumValues: [string, ...string[]];
|
|
258
|
-
baseColumn: never;
|
|
259
|
-
identity: undefined;
|
|
260
|
-
generated: undefined;
|
|
261
|
-
}, {}, {
|
|
262
|
-
length: number | undefined;
|
|
263
|
-
}>;
|
|
264
|
-
description: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
265
|
-
name: "description";
|
|
266
|
-
tableName: "audit_log";
|
|
267
|
-
dataType: "string";
|
|
268
|
-
columnType: "SQLiteText";
|
|
269
|
-
data: string;
|
|
270
|
-
driverParam: string;
|
|
271
|
-
notNull: false;
|
|
272
|
-
hasDefault: false;
|
|
273
|
-
isPrimaryKey: false;
|
|
274
|
-
isAutoincrement: false;
|
|
275
|
-
hasRuntimeDefault: false;
|
|
276
|
-
enumValues: [string, ...string[]];
|
|
277
|
-
baseColumn: never;
|
|
278
|
-
identity: undefined;
|
|
279
|
-
generated: undefined;
|
|
280
|
-
}, {}, {
|
|
281
|
-
length: number | undefined;
|
|
282
|
-
}>;
|
|
283
|
-
initiatorService: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
284
|
-
name: "initiator_service";
|
|
285
|
-
tableName: "audit_log";
|
|
286
|
-
dataType: "string";
|
|
287
|
-
columnType: "SQLiteText";
|
|
288
|
-
data: string;
|
|
289
|
-
driverParam: string;
|
|
290
|
-
notNull: true;
|
|
291
|
-
hasDefault: false;
|
|
292
|
-
isPrimaryKey: false;
|
|
293
|
-
isAutoincrement: false;
|
|
294
|
-
hasRuntimeDefault: false;
|
|
295
|
-
enumValues: [string, ...string[]];
|
|
296
|
-
baseColumn: never;
|
|
297
|
-
identity: undefined;
|
|
298
|
-
generated: undefined;
|
|
299
|
-
}, {}, {
|
|
300
|
-
length: number | undefined;
|
|
301
|
-
}>;
|
|
302
|
-
initiatorUserId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
303
|
-
name: "initiator_user_id";
|
|
304
|
-
tableName: "audit_log";
|
|
305
|
-
dataType: "string";
|
|
306
|
-
columnType: "SQLiteText";
|
|
307
|
-
data: string;
|
|
308
|
-
driverParam: string;
|
|
309
|
-
notNull: false;
|
|
310
|
-
hasDefault: false;
|
|
311
|
-
isPrimaryKey: false;
|
|
312
|
-
isAutoincrement: false;
|
|
313
|
-
hasRuntimeDefault: false;
|
|
314
|
-
enumValues: [string, ...string[]];
|
|
315
|
-
baseColumn: never;
|
|
316
|
-
identity: undefined;
|
|
317
|
-
generated: undefined;
|
|
318
|
-
}, {}, {
|
|
319
|
-
length: number | undefined;
|
|
320
|
-
}>;
|
|
321
|
-
id: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
322
|
-
name: "id";
|
|
323
|
-
tableName: "audit_log";
|
|
324
|
-
dataType: "string";
|
|
325
|
-
columnType: "SQLiteText";
|
|
326
|
-
data: string;
|
|
327
|
-
driverParam: string;
|
|
328
|
-
notNull: true;
|
|
329
|
-
hasDefault: false;
|
|
330
|
-
isPrimaryKey: true;
|
|
331
|
-
isAutoincrement: false;
|
|
332
|
-
hasRuntimeDefault: false;
|
|
333
|
-
enumValues: [string, ...string[]];
|
|
334
|
-
baseColumn: never;
|
|
335
|
-
identity: undefined;
|
|
336
|
-
generated: undefined;
|
|
337
|
-
}, {}, {
|
|
338
|
-
length: number | undefined;
|
|
339
|
-
}>;
|
|
340
|
-
createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
341
|
-
name: "created_at";
|
|
342
|
-
tableName: "audit_log";
|
|
343
|
-
dataType: "date";
|
|
344
|
-
columnType: "SQLiteTimestamp";
|
|
345
|
-
data: Date;
|
|
346
|
-
driverParam: number;
|
|
347
|
-
notNull: false;
|
|
348
|
-
hasDefault: true;
|
|
349
|
-
isPrimaryKey: false;
|
|
350
|
-
isAutoincrement: false;
|
|
351
|
-
hasRuntimeDefault: false;
|
|
352
|
-
enumValues: undefined;
|
|
353
|
-
baseColumn: never;
|
|
354
|
-
identity: undefined;
|
|
355
|
-
generated: undefined;
|
|
356
|
-
}, {}, {}>;
|
|
357
|
-
updatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
358
|
-
name: "updated_at";
|
|
359
|
-
tableName: "audit_log";
|
|
360
|
-
dataType: "date";
|
|
361
|
-
columnType: "SQLiteTimestamp";
|
|
362
|
-
data: Date;
|
|
363
|
-
driverParam: number;
|
|
364
|
-
notNull: false;
|
|
365
|
-
hasDefault: true;
|
|
366
|
-
isPrimaryKey: false;
|
|
367
|
-
isAutoincrement: false;
|
|
368
|
-
hasRuntimeDefault: false;
|
|
369
|
-
enumValues: undefined;
|
|
370
|
-
baseColumn: never;
|
|
371
|
-
identity: undefined;
|
|
372
|
-
generated: undefined;
|
|
373
|
-
}, {}, {}>;
|
|
374
|
-
deletedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
375
|
-
name: "deleted_at";
|
|
376
|
-
tableName: "audit_log";
|
|
377
|
-
dataType: "date";
|
|
378
|
-
columnType: "SQLiteTimestamp";
|
|
379
|
-
data: Date;
|
|
380
|
-
driverParam: number;
|
|
381
|
-
notNull: false;
|
|
382
|
-
hasDefault: true;
|
|
383
|
-
isPrimaryKey: false;
|
|
384
|
-
isAutoincrement: false;
|
|
385
|
-
hasRuntimeDefault: false;
|
|
386
|
-
enumValues: undefined;
|
|
387
|
-
baseColumn: never;
|
|
388
|
-
identity: undefined;
|
|
389
|
-
generated: undefined;
|
|
390
|
-
}, {}, {}>;
|
|
391
|
-
};
|
|
392
|
-
dialect: "sqlite";
|
|
393
|
-
}>;
|
|
394
|
-
|
|
395
|
-
declare const schema_auditLog: typeof auditLog;
|
|
396
|
-
declare namespace schema {
|
|
397
|
-
export {
|
|
398
|
-
schema_auditLog as auditLog,
|
|
399
|
-
};
|
|
400
|
-
}
|
|
401
|
-
|
|
402
203
|
declare const tables: typeof schema;
|
|
403
204
|
|
|
404
205
|
declare class SlackConnector {
|
package/dist/export/worker.d.mts
CHANGED
|
@@ -2,9 +2,10 @@ import * as _develit_io_backend_sdk from '@develit-io/backend-sdk';
|
|
|
2
2
|
import { InternalError, IRPCResponse } from '@develit-io/backend-sdk';
|
|
3
3
|
import z$1, { z } from 'zod';
|
|
4
4
|
import { z as z$2 } from 'zod/v4';
|
|
5
|
-
import
|
|
5
|
+
import { s as schema } from '../shared/notification.BJyMXKGH.mjs';
|
|
6
6
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
7
7
|
import { DrizzleD1Database } from 'drizzle-orm/d1';
|
|
8
|
+
import 'drizzle-orm/sqlite-core';
|
|
8
9
|
|
|
9
10
|
declare const iContactSchema: z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
|
|
10
11
|
email: z.ZodString;
|
|
@@ -199,206 +200,6 @@ interface ISlack {
|
|
|
199
200
|
message: string;
|
|
200
201
|
}
|
|
201
202
|
|
|
202
|
-
declare const auditLog: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
203
|
-
name: "audit_log";
|
|
204
|
-
schema: undefined;
|
|
205
|
-
columns: {
|
|
206
|
-
event: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
207
|
-
name: "event";
|
|
208
|
-
tableName: "audit_log";
|
|
209
|
-
dataType: "string";
|
|
210
|
-
columnType: "SQLiteText";
|
|
211
|
-
data: "EMAIL" | "SMS" | "PUSH_NOTIFICATION" | "SLACK";
|
|
212
|
-
driverParam: string;
|
|
213
|
-
notNull: true;
|
|
214
|
-
hasDefault: false;
|
|
215
|
-
isPrimaryKey: false;
|
|
216
|
-
isAutoincrement: false;
|
|
217
|
-
hasRuntimeDefault: false;
|
|
218
|
-
enumValues: [string, ...string[]];
|
|
219
|
-
baseColumn: never;
|
|
220
|
-
identity: undefined;
|
|
221
|
-
generated: undefined;
|
|
222
|
-
}, {}, {
|
|
223
|
-
length: number | undefined;
|
|
224
|
-
$type: "EMAIL" | "SMS" | "PUSH_NOTIFICATION" | "SLACK";
|
|
225
|
-
}>;
|
|
226
|
-
ip: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
227
|
-
name: "ip";
|
|
228
|
-
tableName: "audit_log";
|
|
229
|
-
dataType: "string";
|
|
230
|
-
columnType: "SQLiteText";
|
|
231
|
-
data: string;
|
|
232
|
-
driverParam: string;
|
|
233
|
-
notNull: false;
|
|
234
|
-
hasDefault: false;
|
|
235
|
-
isPrimaryKey: false;
|
|
236
|
-
isAutoincrement: false;
|
|
237
|
-
hasRuntimeDefault: false;
|
|
238
|
-
enumValues: [string, ...string[]];
|
|
239
|
-
baseColumn: never;
|
|
240
|
-
identity: undefined;
|
|
241
|
-
generated: undefined;
|
|
242
|
-
}, {}, {
|
|
243
|
-
length: number | undefined;
|
|
244
|
-
}>;
|
|
245
|
-
userAgent: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
246
|
-
name: "user_agent";
|
|
247
|
-
tableName: "audit_log";
|
|
248
|
-
dataType: "string";
|
|
249
|
-
columnType: "SQLiteText";
|
|
250
|
-
data: string;
|
|
251
|
-
driverParam: string;
|
|
252
|
-
notNull: false;
|
|
253
|
-
hasDefault: false;
|
|
254
|
-
isPrimaryKey: false;
|
|
255
|
-
isAutoincrement: false;
|
|
256
|
-
hasRuntimeDefault: false;
|
|
257
|
-
enumValues: [string, ...string[]];
|
|
258
|
-
baseColumn: never;
|
|
259
|
-
identity: undefined;
|
|
260
|
-
generated: undefined;
|
|
261
|
-
}, {}, {
|
|
262
|
-
length: number | undefined;
|
|
263
|
-
}>;
|
|
264
|
-
description: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
265
|
-
name: "description";
|
|
266
|
-
tableName: "audit_log";
|
|
267
|
-
dataType: "string";
|
|
268
|
-
columnType: "SQLiteText";
|
|
269
|
-
data: string;
|
|
270
|
-
driverParam: string;
|
|
271
|
-
notNull: false;
|
|
272
|
-
hasDefault: false;
|
|
273
|
-
isPrimaryKey: false;
|
|
274
|
-
isAutoincrement: false;
|
|
275
|
-
hasRuntimeDefault: false;
|
|
276
|
-
enumValues: [string, ...string[]];
|
|
277
|
-
baseColumn: never;
|
|
278
|
-
identity: undefined;
|
|
279
|
-
generated: undefined;
|
|
280
|
-
}, {}, {
|
|
281
|
-
length: number | undefined;
|
|
282
|
-
}>;
|
|
283
|
-
initiatorService: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
284
|
-
name: "initiator_service";
|
|
285
|
-
tableName: "audit_log";
|
|
286
|
-
dataType: "string";
|
|
287
|
-
columnType: "SQLiteText";
|
|
288
|
-
data: string;
|
|
289
|
-
driverParam: string;
|
|
290
|
-
notNull: true;
|
|
291
|
-
hasDefault: false;
|
|
292
|
-
isPrimaryKey: false;
|
|
293
|
-
isAutoincrement: false;
|
|
294
|
-
hasRuntimeDefault: false;
|
|
295
|
-
enumValues: [string, ...string[]];
|
|
296
|
-
baseColumn: never;
|
|
297
|
-
identity: undefined;
|
|
298
|
-
generated: undefined;
|
|
299
|
-
}, {}, {
|
|
300
|
-
length: number | undefined;
|
|
301
|
-
}>;
|
|
302
|
-
initiatorUserId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
303
|
-
name: "initiator_user_id";
|
|
304
|
-
tableName: "audit_log";
|
|
305
|
-
dataType: "string";
|
|
306
|
-
columnType: "SQLiteText";
|
|
307
|
-
data: string;
|
|
308
|
-
driverParam: string;
|
|
309
|
-
notNull: false;
|
|
310
|
-
hasDefault: false;
|
|
311
|
-
isPrimaryKey: false;
|
|
312
|
-
isAutoincrement: false;
|
|
313
|
-
hasRuntimeDefault: false;
|
|
314
|
-
enumValues: [string, ...string[]];
|
|
315
|
-
baseColumn: never;
|
|
316
|
-
identity: undefined;
|
|
317
|
-
generated: undefined;
|
|
318
|
-
}, {}, {
|
|
319
|
-
length: number | undefined;
|
|
320
|
-
}>;
|
|
321
|
-
id: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
322
|
-
name: "id";
|
|
323
|
-
tableName: "audit_log";
|
|
324
|
-
dataType: "string";
|
|
325
|
-
columnType: "SQLiteText";
|
|
326
|
-
data: string;
|
|
327
|
-
driverParam: string;
|
|
328
|
-
notNull: true;
|
|
329
|
-
hasDefault: false;
|
|
330
|
-
isPrimaryKey: true;
|
|
331
|
-
isAutoincrement: false;
|
|
332
|
-
hasRuntimeDefault: false;
|
|
333
|
-
enumValues: [string, ...string[]];
|
|
334
|
-
baseColumn: never;
|
|
335
|
-
identity: undefined;
|
|
336
|
-
generated: undefined;
|
|
337
|
-
}, {}, {
|
|
338
|
-
length: number | undefined;
|
|
339
|
-
}>;
|
|
340
|
-
createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
341
|
-
name: "created_at";
|
|
342
|
-
tableName: "audit_log";
|
|
343
|
-
dataType: "date";
|
|
344
|
-
columnType: "SQLiteTimestamp";
|
|
345
|
-
data: Date;
|
|
346
|
-
driverParam: number;
|
|
347
|
-
notNull: false;
|
|
348
|
-
hasDefault: true;
|
|
349
|
-
isPrimaryKey: false;
|
|
350
|
-
isAutoincrement: false;
|
|
351
|
-
hasRuntimeDefault: false;
|
|
352
|
-
enumValues: undefined;
|
|
353
|
-
baseColumn: never;
|
|
354
|
-
identity: undefined;
|
|
355
|
-
generated: undefined;
|
|
356
|
-
}, {}, {}>;
|
|
357
|
-
updatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
358
|
-
name: "updated_at";
|
|
359
|
-
tableName: "audit_log";
|
|
360
|
-
dataType: "date";
|
|
361
|
-
columnType: "SQLiteTimestamp";
|
|
362
|
-
data: Date;
|
|
363
|
-
driverParam: number;
|
|
364
|
-
notNull: false;
|
|
365
|
-
hasDefault: true;
|
|
366
|
-
isPrimaryKey: false;
|
|
367
|
-
isAutoincrement: false;
|
|
368
|
-
hasRuntimeDefault: false;
|
|
369
|
-
enumValues: undefined;
|
|
370
|
-
baseColumn: never;
|
|
371
|
-
identity: undefined;
|
|
372
|
-
generated: undefined;
|
|
373
|
-
}, {}, {}>;
|
|
374
|
-
deletedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
375
|
-
name: "deleted_at";
|
|
376
|
-
tableName: "audit_log";
|
|
377
|
-
dataType: "date";
|
|
378
|
-
columnType: "SQLiteTimestamp";
|
|
379
|
-
data: Date;
|
|
380
|
-
driverParam: number;
|
|
381
|
-
notNull: false;
|
|
382
|
-
hasDefault: true;
|
|
383
|
-
isPrimaryKey: false;
|
|
384
|
-
isAutoincrement: false;
|
|
385
|
-
hasRuntimeDefault: false;
|
|
386
|
-
enumValues: undefined;
|
|
387
|
-
baseColumn: never;
|
|
388
|
-
identity: undefined;
|
|
389
|
-
generated: undefined;
|
|
390
|
-
}, {}, {}>;
|
|
391
|
-
};
|
|
392
|
-
dialect: "sqlite";
|
|
393
|
-
}>;
|
|
394
|
-
|
|
395
|
-
declare const schema_auditLog: typeof auditLog;
|
|
396
|
-
declare namespace schema {
|
|
397
|
-
export {
|
|
398
|
-
schema_auditLog as auditLog,
|
|
399
|
-
};
|
|
400
|
-
}
|
|
401
|
-
|
|
402
203
|
declare const tables: typeof schema;
|
|
403
204
|
|
|
404
205
|
declare class SlackConnector {
|