@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.d.ts
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.js';
|
|
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.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { useResult, createInternalError,
|
|
1
|
+
import { useResult, createInternalError, uuidv4, develitWorker, cloudflareQueue, action } from '@develit-io/backend-sdk';
|
|
2
2
|
import z$1, { z } from 'zod';
|
|
3
3
|
import { z as z$2 } from 'zod/v4';
|
|
4
4
|
import twilio from 'twilio';
|
|
5
|
-
import {
|
|
5
|
+
import { s as schema } from '../shared/notification.C0X8Orrh.mjs';
|
|
6
6
|
import 'drizzle-orm';
|
|
7
|
+
import 'drizzle-orm/sqlite-core';
|
|
7
8
|
import { WorkerEntrypoint } from 'cloudflare:workers';
|
|
8
9
|
import { drizzle } from 'drizzle-orm/d1';
|
|
9
10
|
|
|
@@ -28,10 +29,6 @@ const iEmailSchema = z.object({
|
|
|
28
29
|
});
|
|
29
30
|
|
|
30
31
|
class IEmailConnector {
|
|
31
|
-
static providerName;
|
|
32
|
-
API_KEY;
|
|
33
|
-
SMTP_HOST;
|
|
34
|
-
SENDER;
|
|
35
32
|
constructor({
|
|
36
33
|
API_KEY,
|
|
37
34
|
SMTP_HOST,
|
|
@@ -44,7 +41,9 @@ class IEmailConnector {
|
|
|
44
41
|
}
|
|
45
42
|
|
|
46
43
|
class EcomailConnector extends IEmailConnector {
|
|
47
|
-
static
|
|
44
|
+
static {
|
|
45
|
+
this.providerName = "ecomail";
|
|
46
|
+
}
|
|
48
47
|
constructor({
|
|
49
48
|
API_KEY,
|
|
50
49
|
SMTP_HOST,
|
|
@@ -174,10 +173,6 @@ const sendSmsInputSchema = z.object({
|
|
|
174
173
|
});
|
|
175
174
|
|
|
176
175
|
class ISmsConnector {
|
|
177
|
-
static providerName;
|
|
178
|
-
ACCOUNT_ID;
|
|
179
|
-
AUTH_TOKEN;
|
|
180
|
-
SERVICE_ID;
|
|
181
176
|
constructor({
|
|
182
177
|
ACCOUNT_ID,
|
|
183
178
|
AUTH_TOKEN,
|
|
@@ -190,8 +185,9 @@ class ISmsConnector {
|
|
|
190
185
|
}
|
|
191
186
|
|
|
192
187
|
class TwilioConnector extends ISmsConnector {
|
|
193
|
-
static
|
|
194
|
-
|
|
188
|
+
static {
|
|
189
|
+
this.providerName = "twilio";
|
|
190
|
+
}
|
|
195
191
|
constructor({
|
|
196
192
|
ACCOUNT_ID,
|
|
197
193
|
AUTH_TOKEN,
|
|
@@ -214,21 +210,6 @@ class TwilioConnector extends ISmsConnector {
|
|
|
214
210
|
}
|
|
215
211
|
}
|
|
216
212
|
|
|
217
|
-
const auditLog = sqliteTable("audit_log", {
|
|
218
|
-
...base,
|
|
219
|
-
event: text("event").$type().notNull(),
|
|
220
|
-
ip: text("ip"),
|
|
221
|
-
userAgent: text("user_agent"),
|
|
222
|
-
description: text("description"),
|
|
223
|
-
initiatorService: text("initiator_service").notNull(),
|
|
224
|
-
initiatorUserId: text("initiator_user_id")
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
const schema = {
|
|
228
|
-
__proto__: null,
|
|
229
|
-
auditLog: auditLog
|
|
230
|
-
};
|
|
231
|
-
|
|
232
213
|
const tables = schema;
|
|
233
214
|
|
|
234
215
|
const initiateEmailConnector = async (provider, apiKey, smtpHost, sender) => {
|
|
@@ -286,7 +267,6 @@ const initiateSmsConnector = async (provider, accountId, authToken, serviceId) =
|
|
|
286
267
|
};
|
|
287
268
|
|
|
288
269
|
class SlackConnector {
|
|
289
|
-
webhooks;
|
|
290
270
|
constructor(webhooks) {
|
|
291
271
|
this.webhooks = webhooks;
|
|
292
272
|
}
|
|
@@ -308,20 +288,25 @@ class SlackConnector {
|
|
|
308
288
|
}
|
|
309
289
|
}
|
|
310
290
|
|
|
291
|
+
var __defProp = Object.defineProperty;
|
|
292
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
293
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
294
|
+
var result = __getOwnPropDesc(target, key) ;
|
|
295
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
296
|
+
if (decorator = decorators[i])
|
|
297
|
+
result = (decorator(target, key, result) ) || result;
|
|
298
|
+
if (result) __defProp(target, key, result);
|
|
299
|
+
return result;
|
|
300
|
+
};
|
|
311
301
|
class NotificationServiceBase extends develitWorker(
|
|
312
302
|
WorkerEntrypoint
|
|
313
303
|
) {
|
|
314
|
-
name;
|
|
315
|
-
slackConnector = new SlackConnector(this.env.SLACK_WEBHOOKS);
|
|
316
|
-
emailConnector;
|
|
317
|
-
smsConnector;
|
|
318
|
-
db;
|
|
319
304
|
constructor(ctx, env) {
|
|
320
305
|
super(ctx, env);
|
|
306
|
+
this.slackConnector = new SlackConnector(this.env.SLACK_WEBHOOKS);
|
|
321
307
|
this.name = "notification-service";
|
|
322
308
|
this.db = drizzle(this.env.NOTIFICATION_D1, { schema: tables });
|
|
323
309
|
}
|
|
324
|
-
@cloudflareQueue({ baseDelay: 60 })
|
|
325
310
|
async queue(batch) {
|
|
326
311
|
for (const message of batch.messages) {
|
|
327
312
|
this.logInput({ message });
|
|
@@ -395,7 +380,6 @@ class NotificationServiceBase extends develitWorker(
|
|
|
395
380
|
message.ack();
|
|
396
381
|
}
|
|
397
382
|
}
|
|
398
|
-
@action("private-send-email")
|
|
399
383
|
async _sendEmail(input) {
|
|
400
384
|
return this.handleAction(
|
|
401
385
|
{ data: input, schema: sendEmailInputSchema },
|
|
@@ -440,7 +424,6 @@ class NotificationServiceBase extends develitWorker(
|
|
|
440
424
|
}
|
|
441
425
|
);
|
|
442
426
|
}
|
|
443
|
-
@action("private-send-sms")
|
|
444
427
|
async _sendSms(input) {
|
|
445
428
|
return this.handleAction(
|
|
446
429
|
{ data: input, schema: sendSmsInputSchema },
|
|
@@ -472,7 +455,6 @@ class NotificationServiceBase extends develitWorker(
|
|
|
472
455
|
}
|
|
473
456
|
);
|
|
474
457
|
}
|
|
475
|
-
@action("public-send-email")
|
|
476
458
|
async sendEmail(input) {
|
|
477
459
|
return this.handleAction(
|
|
478
460
|
{ data: input, schema: sendEmailInputSchema },
|
|
@@ -493,7 +475,6 @@ class NotificationServiceBase extends develitWorker(
|
|
|
493
475
|
}
|
|
494
476
|
);
|
|
495
477
|
}
|
|
496
|
-
@action("public-send-sms")
|
|
497
478
|
async sendSms(input) {
|
|
498
479
|
return this.handleAction(
|
|
499
480
|
{ data: input, schema: sendSmsInputSchema },
|
|
@@ -520,13 +501,11 @@ class NotificationServiceBase extends develitWorker(
|
|
|
520
501
|
}
|
|
521
502
|
);
|
|
522
503
|
}
|
|
523
|
-
@action("send-push-notification")
|
|
524
504
|
async _sendPushNotification() {
|
|
525
505
|
this.logInput({});
|
|
526
506
|
this.logError({ error: "Method not implemented." });
|
|
527
507
|
throw new Error("Method not implemented.");
|
|
528
508
|
}
|
|
529
|
-
@action("send-slack-notification")
|
|
530
509
|
async sendSlackNotification(input) {
|
|
531
510
|
return this.handleAction(
|
|
532
511
|
{
|
|
@@ -542,6 +521,27 @@ class NotificationServiceBase extends develitWorker(
|
|
|
542
521
|
);
|
|
543
522
|
}
|
|
544
523
|
}
|
|
524
|
+
__decorateClass([
|
|
525
|
+
cloudflareQueue({ baseDelay: 60 })
|
|
526
|
+
], NotificationServiceBase.prototype, "queue");
|
|
527
|
+
__decorateClass([
|
|
528
|
+
action("private-send-email")
|
|
529
|
+
], NotificationServiceBase.prototype, "_sendEmail");
|
|
530
|
+
__decorateClass([
|
|
531
|
+
action("private-send-sms")
|
|
532
|
+
], NotificationServiceBase.prototype, "_sendSms");
|
|
533
|
+
__decorateClass([
|
|
534
|
+
action("public-send-email")
|
|
535
|
+
], NotificationServiceBase.prototype, "sendEmail");
|
|
536
|
+
__decorateClass([
|
|
537
|
+
action("public-send-sms")
|
|
538
|
+
], NotificationServiceBase.prototype, "sendSms");
|
|
539
|
+
__decorateClass([
|
|
540
|
+
action("send-push-notification")
|
|
541
|
+
], NotificationServiceBase.prototype, "_sendPushNotification");
|
|
542
|
+
__decorateClass([
|
|
543
|
+
action("send-slack-notification")
|
|
544
|
+
], NotificationServiceBase.prototype, "sendSlackNotification");
|
|
545
545
|
function defineNotificationService() {
|
|
546
546
|
return class NotificationService extends NotificationServiceBase {
|
|
547
547
|
constructor(ctx, env) {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const backendSdk = require('@develit-io/backend-sdk');
|
|
4
|
+
const sqliteCore = require('drizzle-orm/sqlite-core');
|
|
5
|
+
|
|
6
|
+
const auditLog = sqliteCore.sqliteTable("audit_log", {
|
|
7
|
+
...backendSdk.base,
|
|
8
|
+
event: sqliteCore.text("event").$type().notNull(),
|
|
9
|
+
ip: sqliteCore.text("ip"),
|
|
10
|
+
userAgent: sqliteCore.text("user_agent"),
|
|
11
|
+
description: sqliteCore.text("description"),
|
|
12
|
+
initiatorService: sqliteCore.text("initiator_service").notNull(),
|
|
13
|
+
initiatorUserId: sqliteCore.text("initiator_user_id")
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const schema = {
|
|
17
|
+
__proto__: null,
|
|
18
|
+
auditLog: auditLog
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
exports.auditLog = auditLog;
|
|
22
|
+
exports.schema = schema;
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import * as drizzle_orm_sqlite_core from 'drizzle-orm/sqlite-core';
|
|
2
|
+
|
|
3
|
+
declare const auditLog: drizzle_orm_sqlite_core.SQLiteTableWithColumns<{
|
|
4
|
+
name: "audit_log";
|
|
5
|
+
schema: undefined;
|
|
6
|
+
columns: {
|
|
7
|
+
event: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
8
|
+
name: "event";
|
|
9
|
+
tableName: "audit_log";
|
|
10
|
+
dataType: "string";
|
|
11
|
+
columnType: "SQLiteText";
|
|
12
|
+
data: "EMAIL" | "SMS" | "PUSH_NOTIFICATION" | "SLACK";
|
|
13
|
+
driverParam: string;
|
|
14
|
+
notNull: true;
|
|
15
|
+
hasDefault: false;
|
|
16
|
+
isPrimaryKey: false;
|
|
17
|
+
isAutoincrement: false;
|
|
18
|
+
hasRuntimeDefault: false;
|
|
19
|
+
enumValues: [string, ...string[]];
|
|
20
|
+
baseColumn: never;
|
|
21
|
+
identity: undefined;
|
|
22
|
+
generated: undefined;
|
|
23
|
+
}, {}, {
|
|
24
|
+
length: number | undefined;
|
|
25
|
+
$type: "EMAIL" | "SMS" | "PUSH_NOTIFICATION" | "SLACK";
|
|
26
|
+
}>;
|
|
27
|
+
ip: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
28
|
+
name: "ip";
|
|
29
|
+
tableName: "audit_log";
|
|
30
|
+
dataType: "string";
|
|
31
|
+
columnType: "SQLiteText";
|
|
32
|
+
data: string;
|
|
33
|
+
driverParam: string;
|
|
34
|
+
notNull: false;
|
|
35
|
+
hasDefault: false;
|
|
36
|
+
isPrimaryKey: false;
|
|
37
|
+
isAutoincrement: false;
|
|
38
|
+
hasRuntimeDefault: false;
|
|
39
|
+
enumValues: [string, ...string[]];
|
|
40
|
+
baseColumn: never;
|
|
41
|
+
identity: undefined;
|
|
42
|
+
generated: undefined;
|
|
43
|
+
}, {}, {
|
|
44
|
+
length: number | undefined;
|
|
45
|
+
}>;
|
|
46
|
+
userAgent: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
47
|
+
name: "user_agent";
|
|
48
|
+
tableName: "audit_log";
|
|
49
|
+
dataType: "string";
|
|
50
|
+
columnType: "SQLiteText";
|
|
51
|
+
data: string;
|
|
52
|
+
driverParam: string;
|
|
53
|
+
notNull: false;
|
|
54
|
+
hasDefault: false;
|
|
55
|
+
isPrimaryKey: false;
|
|
56
|
+
isAutoincrement: false;
|
|
57
|
+
hasRuntimeDefault: false;
|
|
58
|
+
enumValues: [string, ...string[]];
|
|
59
|
+
baseColumn: never;
|
|
60
|
+
identity: undefined;
|
|
61
|
+
generated: undefined;
|
|
62
|
+
}, {}, {
|
|
63
|
+
length: number | undefined;
|
|
64
|
+
}>;
|
|
65
|
+
description: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
66
|
+
name: "description";
|
|
67
|
+
tableName: "audit_log";
|
|
68
|
+
dataType: "string";
|
|
69
|
+
columnType: "SQLiteText";
|
|
70
|
+
data: string;
|
|
71
|
+
driverParam: string;
|
|
72
|
+
notNull: false;
|
|
73
|
+
hasDefault: false;
|
|
74
|
+
isPrimaryKey: false;
|
|
75
|
+
isAutoincrement: false;
|
|
76
|
+
hasRuntimeDefault: false;
|
|
77
|
+
enumValues: [string, ...string[]];
|
|
78
|
+
baseColumn: never;
|
|
79
|
+
identity: undefined;
|
|
80
|
+
generated: undefined;
|
|
81
|
+
}, {}, {
|
|
82
|
+
length: number | undefined;
|
|
83
|
+
}>;
|
|
84
|
+
initiatorService: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
85
|
+
name: "initiator_service";
|
|
86
|
+
tableName: "audit_log";
|
|
87
|
+
dataType: "string";
|
|
88
|
+
columnType: "SQLiteText";
|
|
89
|
+
data: string;
|
|
90
|
+
driverParam: string;
|
|
91
|
+
notNull: true;
|
|
92
|
+
hasDefault: false;
|
|
93
|
+
isPrimaryKey: false;
|
|
94
|
+
isAutoincrement: false;
|
|
95
|
+
hasRuntimeDefault: false;
|
|
96
|
+
enumValues: [string, ...string[]];
|
|
97
|
+
baseColumn: never;
|
|
98
|
+
identity: undefined;
|
|
99
|
+
generated: undefined;
|
|
100
|
+
}, {}, {
|
|
101
|
+
length: number | undefined;
|
|
102
|
+
}>;
|
|
103
|
+
initiatorUserId: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
104
|
+
name: "initiator_user_id";
|
|
105
|
+
tableName: "audit_log";
|
|
106
|
+
dataType: "string";
|
|
107
|
+
columnType: "SQLiteText";
|
|
108
|
+
data: string;
|
|
109
|
+
driverParam: string;
|
|
110
|
+
notNull: false;
|
|
111
|
+
hasDefault: false;
|
|
112
|
+
isPrimaryKey: false;
|
|
113
|
+
isAutoincrement: false;
|
|
114
|
+
hasRuntimeDefault: false;
|
|
115
|
+
enumValues: [string, ...string[]];
|
|
116
|
+
baseColumn: never;
|
|
117
|
+
identity: undefined;
|
|
118
|
+
generated: undefined;
|
|
119
|
+
}, {}, {
|
|
120
|
+
length: number | undefined;
|
|
121
|
+
}>;
|
|
122
|
+
id: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
123
|
+
name: "id";
|
|
124
|
+
tableName: "audit_log";
|
|
125
|
+
dataType: "string";
|
|
126
|
+
columnType: "SQLiteText";
|
|
127
|
+
data: string;
|
|
128
|
+
driverParam: string;
|
|
129
|
+
notNull: true;
|
|
130
|
+
hasDefault: false;
|
|
131
|
+
isPrimaryKey: true;
|
|
132
|
+
isAutoincrement: false;
|
|
133
|
+
hasRuntimeDefault: false;
|
|
134
|
+
enumValues: [string, ...string[]];
|
|
135
|
+
baseColumn: never;
|
|
136
|
+
identity: undefined;
|
|
137
|
+
generated: undefined;
|
|
138
|
+
}, {}, {
|
|
139
|
+
length: number | undefined;
|
|
140
|
+
}>;
|
|
141
|
+
createdAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
142
|
+
name: "created_at";
|
|
143
|
+
tableName: "audit_log";
|
|
144
|
+
dataType: "date";
|
|
145
|
+
columnType: "SQLiteTimestamp";
|
|
146
|
+
data: Date;
|
|
147
|
+
driverParam: number;
|
|
148
|
+
notNull: false;
|
|
149
|
+
hasDefault: true;
|
|
150
|
+
isPrimaryKey: false;
|
|
151
|
+
isAutoincrement: false;
|
|
152
|
+
hasRuntimeDefault: false;
|
|
153
|
+
enumValues: undefined;
|
|
154
|
+
baseColumn: never;
|
|
155
|
+
identity: undefined;
|
|
156
|
+
generated: undefined;
|
|
157
|
+
}, {}, {}>;
|
|
158
|
+
updatedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
159
|
+
name: "updated_at";
|
|
160
|
+
tableName: "audit_log";
|
|
161
|
+
dataType: "date";
|
|
162
|
+
columnType: "SQLiteTimestamp";
|
|
163
|
+
data: Date;
|
|
164
|
+
driverParam: number;
|
|
165
|
+
notNull: false;
|
|
166
|
+
hasDefault: true;
|
|
167
|
+
isPrimaryKey: false;
|
|
168
|
+
isAutoincrement: false;
|
|
169
|
+
hasRuntimeDefault: false;
|
|
170
|
+
enumValues: undefined;
|
|
171
|
+
baseColumn: never;
|
|
172
|
+
identity: undefined;
|
|
173
|
+
generated: undefined;
|
|
174
|
+
}, {}, {}>;
|
|
175
|
+
deletedAt: drizzle_orm_sqlite_core.SQLiteColumn<{
|
|
176
|
+
name: "deleted_at";
|
|
177
|
+
tableName: "audit_log";
|
|
178
|
+
dataType: "date";
|
|
179
|
+
columnType: "SQLiteTimestamp";
|
|
180
|
+
data: Date;
|
|
181
|
+
driverParam: number;
|
|
182
|
+
notNull: false;
|
|
183
|
+
hasDefault: true;
|
|
184
|
+
isPrimaryKey: false;
|
|
185
|
+
isAutoincrement: false;
|
|
186
|
+
hasRuntimeDefault: false;
|
|
187
|
+
enumValues: undefined;
|
|
188
|
+
baseColumn: never;
|
|
189
|
+
identity: undefined;
|
|
190
|
+
generated: undefined;
|
|
191
|
+
}, {}, {}>;
|
|
192
|
+
};
|
|
193
|
+
dialect: "sqlite";
|
|
194
|
+
}>;
|
|
195
|
+
|
|
196
|
+
declare const schema_auditLog: typeof auditLog;
|
|
197
|
+
declare namespace schema {
|
|
198
|
+
export {
|
|
199
|
+
schema_auditLog as auditLog,
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export { auditLog as a, schema as s };
|