asfur 1.0.113 → 1.0.115
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/index.d.ts +40 -0
- package/dist/index.js +15 -1
- package/dist/types.d.ts +29 -0
- package/dist/types.js +11 -13
- package/index.ts +18 -0
- package/package.json +1 -1
- package/types.ts +12 -13
package/dist/index.d.ts
CHANGED
|
@@ -424,6 +424,7 @@ export declare const MongoScenarioSchema: Schema<any, import("mongoose").Model<a
|
|
|
424
424
|
status: "active" | "inactive";
|
|
425
425
|
title: string;
|
|
426
426
|
geos: string[];
|
|
427
|
+
geos_ids: string[];
|
|
427
428
|
user_id: string;
|
|
428
429
|
created_at: number;
|
|
429
430
|
updated_at: number;
|
|
@@ -440,6 +441,7 @@ export declare const MongoScenarioSchema: Schema<any, import("mongoose").Model<a
|
|
|
440
441
|
status: "active" | "inactive";
|
|
441
442
|
title: string;
|
|
442
443
|
geos: string[];
|
|
444
|
+
geos_ids: string[];
|
|
443
445
|
user_id: string;
|
|
444
446
|
created_at: number;
|
|
445
447
|
updated_at: number;
|
|
@@ -456,6 +458,7 @@ export declare const MongoScenarioSchema: Schema<any, import("mongoose").Model<a
|
|
|
456
458
|
status: "active" | "inactive";
|
|
457
459
|
title: string;
|
|
458
460
|
geos: string[];
|
|
461
|
+
geos_ids: string[];
|
|
459
462
|
user_id: string;
|
|
460
463
|
created_at: number;
|
|
461
464
|
updated_at: number;
|
|
@@ -683,3 +686,40 @@ export declare const MongoMessageSchema: Schema<any, import("mongoose").Model<an
|
|
|
683
686
|
} & {
|
|
684
687
|
__v: number;
|
|
685
688
|
}>;
|
|
689
|
+
export declare const MongoSendEmailSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
690
|
+
versionKey: false;
|
|
691
|
+
toJSON: {
|
|
692
|
+
virtuals: true;
|
|
693
|
+
};
|
|
694
|
+
toObject: {
|
|
695
|
+
virtuals: true;
|
|
696
|
+
};
|
|
697
|
+
}, {
|
|
698
|
+
to: string[];
|
|
699
|
+
timestamp?: number | null | undefined;
|
|
700
|
+
from_service?: string | null | undefined;
|
|
701
|
+
from?: string | null | undefined;
|
|
702
|
+
subject?: string | null | undefined;
|
|
703
|
+
body?: string | null | undefined;
|
|
704
|
+
html?: string | null | undefined;
|
|
705
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
706
|
+
to: string[];
|
|
707
|
+
timestamp?: number | null | undefined;
|
|
708
|
+
from_service?: string | null | undefined;
|
|
709
|
+
from?: string | null | undefined;
|
|
710
|
+
subject?: string | null | undefined;
|
|
711
|
+
body?: string | null | undefined;
|
|
712
|
+
html?: string | null | undefined;
|
|
713
|
+
}>, {}> & import("mongoose").FlatRecord<{
|
|
714
|
+
to: string[];
|
|
715
|
+
timestamp?: number | null | undefined;
|
|
716
|
+
from_service?: string | null | undefined;
|
|
717
|
+
from?: string | null | undefined;
|
|
718
|
+
subject?: string | null | undefined;
|
|
719
|
+
body?: string | null | undefined;
|
|
720
|
+
html?: string | null | undefined;
|
|
721
|
+
}> & {
|
|
722
|
+
_id: import("mongoose").Types.ObjectId;
|
|
723
|
+
} & {
|
|
724
|
+
__v: number;
|
|
725
|
+
}>;
|
package/dist/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.MongoMessageSchema = exports.MongoHeatmapSchema = exports.MongoScenarioScoreSchema = exports.MongoScenarioSchema = exports.MongoNotificationSchema = exports.MongoReportSchema = exports.MongoApiKeySchema = exports.MongoJobSchema = exports.MongoConversationSchema = exports.MongoUserSettingsSchema = exports.MongoQuerySchema = exports.MongoInstructionsSchema = void 0;
|
|
17
|
+
exports.MongoSendEmailSchema = exports.MongoMessageSchema = exports.MongoHeatmapSchema = exports.MongoScenarioScoreSchema = exports.MongoScenarioSchema = exports.MongoNotificationSchema = exports.MongoReportSchema = exports.MongoApiKeySchema = exports.MongoJobSchema = exports.MongoConversationSchema = exports.MongoUserSettingsSchema = exports.MongoQuerySchema = exports.MongoInstructionsSchema = void 0;
|
|
18
18
|
// Export types for consumers
|
|
19
19
|
__exportStar(require("./types"), exports);
|
|
20
20
|
const mongoose_1 = require("mongoose");
|
|
@@ -177,6 +177,7 @@ exports.MongoScenarioSchema = new mongoose_1.Schema({
|
|
|
177
177
|
title: { type: String, required: true },
|
|
178
178
|
scenario: { type: String, required: true },
|
|
179
179
|
geos: { type: [String] },
|
|
180
|
+
geos_ids: { type: [String] },
|
|
180
181
|
time_range: { type: mongoose_1.Schema.Types.Mixed },
|
|
181
182
|
user_id: { type: String, required: true },
|
|
182
183
|
additional_instructions: { type: String },
|
|
@@ -278,3 +279,16 @@ exports.MongoMessageSchema = new mongoose_1.Schema({
|
|
|
278
279
|
toJSON: { virtuals: true },
|
|
279
280
|
toObject: { virtuals: true },
|
|
280
281
|
});
|
|
282
|
+
exports.MongoSendEmailSchema = new mongoose_1.Schema({
|
|
283
|
+
timestamp: { type: Number },
|
|
284
|
+
from_service: { type: String },
|
|
285
|
+
to: { type: [String] },
|
|
286
|
+
from: { type: String },
|
|
287
|
+
subject: { type: String },
|
|
288
|
+
body: { type: String },
|
|
289
|
+
html: { type: String }, // email body in HTML format
|
|
290
|
+
}, {
|
|
291
|
+
versionKey: false,
|
|
292
|
+
toJSON: { virtuals: true },
|
|
293
|
+
toObject: { virtuals: true },
|
|
294
|
+
});
|
package/dist/types.d.ts
CHANGED
|
@@ -1225,6 +1225,7 @@ export declare const zodScenarioSchema: z.ZodObject<{
|
|
|
1225
1225
|
title: z.ZodString;
|
|
1226
1226
|
scenario: z.ZodString;
|
|
1227
1227
|
geos: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1228
|
+
geos_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
1228
1229
|
time_range: z.ZodUnion<[z.ZodObject<{
|
|
1229
1230
|
type: z.ZodLiteral<"relative">;
|
|
1230
1231
|
time: z.ZodEnum<["last_30_minutes", "last_1_hour", "last_2_hours", "last_6_hours", "last_12_hours", "last_24_hours", "last_48_hours", "last_72_hours", "last_week"]>;
|
|
@@ -1583,6 +1584,7 @@ export declare const zodScenarioSchema: z.ZodObject<{
|
|
|
1583
1584
|
scenario: string;
|
|
1584
1585
|
_id?: string | undefined;
|
|
1585
1586
|
geos?: string[] | undefined;
|
|
1587
|
+
geos_ids?: string[] | undefined;
|
|
1586
1588
|
created_at?: number | undefined;
|
|
1587
1589
|
updated_at?: number | undefined;
|
|
1588
1590
|
schedule?: string | undefined;
|
|
@@ -1676,6 +1678,7 @@ export declare const zodScenarioSchema: z.ZodObject<{
|
|
|
1676
1678
|
status?: "active" | "inactive" | undefined;
|
|
1677
1679
|
_id?: string | undefined;
|
|
1678
1680
|
geos?: string[] | undefined;
|
|
1681
|
+
geos_ids?: string[] | undefined;
|
|
1679
1682
|
created_at?: number | undefined;
|
|
1680
1683
|
updated_at?: number | undefined;
|
|
1681
1684
|
schedule?: string | undefined;
|
|
@@ -1754,6 +1757,31 @@ export declare const zodScenarioSchema: z.ZodObject<{
|
|
|
1754
1757
|
confidence_level?: string | undefined;
|
|
1755
1758
|
}[] | undefined;
|
|
1756
1759
|
}>;
|
|
1760
|
+
export declare const zodSendEmailSchema: z.ZodObject<{
|
|
1761
|
+
timestamp: z.ZodNumber;
|
|
1762
|
+
from_service: z.ZodString;
|
|
1763
|
+
to: z.ZodArray<z.ZodString, "many">;
|
|
1764
|
+
from: z.ZodString;
|
|
1765
|
+
subject: z.ZodString;
|
|
1766
|
+
body: z.ZodOptional<z.ZodString>;
|
|
1767
|
+
html: z.ZodOptional<z.ZodString>;
|
|
1768
|
+
}, "strip", z.ZodTypeAny, {
|
|
1769
|
+
timestamp: number;
|
|
1770
|
+
from_service: string;
|
|
1771
|
+
to: string[];
|
|
1772
|
+
from: string;
|
|
1773
|
+
subject: string;
|
|
1774
|
+
body?: string | undefined;
|
|
1775
|
+
html?: string | undefined;
|
|
1776
|
+
}, {
|
|
1777
|
+
timestamp: number;
|
|
1778
|
+
from_service: string;
|
|
1779
|
+
to: string[];
|
|
1780
|
+
from: string;
|
|
1781
|
+
subject: string;
|
|
1782
|
+
body?: string | undefined;
|
|
1783
|
+
html?: string | undefined;
|
|
1784
|
+
}>;
|
|
1757
1785
|
/**
|
|
1758
1786
|
* 'approved' - active and approved sources,
|
|
1759
1787
|
* 'back_to_business' - sources that were paused and now resumed,
|
|
@@ -1778,6 +1806,7 @@ export type ScenarioScoreType = z.infer<typeof zodScenarioScoreSchema>;
|
|
|
1778
1806
|
export type AlertType = z.infer<typeof zodAlertSchema>;
|
|
1779
1807
|
export type MessageType = z.infer<typeof zodMessageSchema>;
|
|
1780
1808
|
export type HeatmapType = z.infer<typeof zodHeatmapSchema>;
|
|
1809
|
+
export type SendEmailType = z.infer<typeof zodSendEmailSchema>;
|
|
1781
1810
|
export type UserPublicMetadata = {
|
|
1782
1811
|
is_admin?: boolean;
|
|
1783
1812
|
regions?: {
|
package/dist/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.zodScenarioSchema = exports.zodScenarioScoreSchema = exports.zodAlertSchema = exports.scenarioScoreTypeList = exports.zodNotificationSchema = exports.notificationPriorityList = exports.zodReportSchema = exports.reportProcessStatusList = exports.zodApiKeySchema = exports.zodCronScheduleResponseSchema = exports.zodMessageSchema = exports.zodHeatmapSchema = exports.zodJobSchema = exports.zodConversationSchema = exports.zodUserSettingsSchema = exports.zodInstructionsSchema = exports.zodQuerySchema = exports.zodAbsoluteTimeRangeSchema = exports.zodRelativeTimeRangeSchema = exports.requestedContentList = exports.relativeTimeRangeList = exports.jobRunStatusList = exports.generalStatusList = void 0;
|
|
3
|
+
exports.zodSendEmailSchema = exports.zodScenarioSchema = exports.zodScenarioScoreSchema = exports.zodAlertSchema = exports.scenarioScoreTypeList = exports.zodNotificationSchema = exports.notificationPriorityList = exports.zodReportSchema = exports.reportProcessStatusList = exports.zodApiKeySchema = exports.zodCronScheduleResponseSchema = exports.zodMessageSchema = exports.zodHeatmapSchema = exports.zodJobSchema = exports.zodConversationSchema = exports.zodUserSettingsSchema = exports.zodInstructionsSchema = exports.zodQuerySchema = exports.zodAbsoluteTimeRangeSchema = exports.zodRelativeTimeRangeSchema = exports.requestedContentList = exports.relativeTimeRangeList = exports.jobRunStatusList = exports.generalStatusList = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.generalStatusList = ['active', 'inactive'];
|
|
6
6
|
exports.jobRunStatusList = ['done', 'failed', 'in_progress'];
|
|
@@ -100,18 +100,6 @@ exports.zodJobSchema = zod_1.z.object({
|
|
|
100
100
|
}))
|
|
101
101
|
.optional(),
|
|
102
102
|
});
|
|
103
|
-
// export const zodJobRunSchema = z.object({
|
|
104
|
-
// _id: z.string().optional(),
|
|
105
|
-
// job_id: z.string().nonempty('Job ID must be provided'), // job identifier
|
|
106
|
-
// user_id: z.string().nonempty('User ID must be provided'), // user identifier
|
|
107
|
-
// status: z.enum(jobRunStatusList).default('done'), // status of the job run
|
|
108
|
-
// created_at: z.number().optional(), // creation date
|
|
109
|
-
// updated_at: z.number().optional(), // last update date
|
|
110
|
-
// result: z.string().optional(), // result of the job run
|
|
111
|
-
// error: z.string().optional(), // error message if the job run failed
|
|
112
|
-
// user_time_zone: z.string().optional(), // user's timezone
|
|
113
|
-
// metadata: z.record(z.string(), z.any()).optional(), // flexible metadata for the job run
|
|
114
|
-
// });
|
|
115
103
|
exports.zodHeatmapSchema = zod_1.z.object({
|
|
116
104
|
_id: zod_1.z.string().optional(),
|
|
117
105
|
user_id: zod_1.z.string().nonempty('User ID must be provided'),
|
|
@@ -255,6 +243,7 @@ exports.zodScenarioSchema = zod_1.z.object({
|
|
|
255
243
|
title: zod_1.z.string().nonempty('Scenario title must be provided'),
|
|
256
244
|
scenario: zod_1.z.string().nonempty('Scenario must be provided'),
|
|
257
245
|
geos: zod_1.z.array(zod_1.z.string()).optional(),
|
|
246
|
+
geos_ids: zod_1.z.array(zod_1.z.string()).optional(),
|
|
258
247
|
time_range: exports.zodRelativeTimeRangeSchema.or(exports.zodAbsoluteTimeRangeSchema),
|
|
259
248
|
user_id: zod_1.z.string().nonempty('User ID must be provided'),
|
|
260
249
|
additional_instructions: zod_1.z.string().optional(),
|
|
@@ -269,3 +258,12 @@ exports.zodScenarioSchema = zod_1.z.object({
|
|
|
269
258
|
alert: exports.zodAlertSchema.optional(),
|
|
270
259
|
scores: zod_1.z.array(exports.zodScenarioScoreSchema).optional(), // array of scenario scores associated with the scenario
|
|
271
260
|
});
|
|
261
|
+
exports.zodSendEmailSchema = zod_1.z.object({
|
|
262
|
+
timestamp: zod_1.z.number(),
|
|
263
|
+
from_service: zod_1.z.string(),
|
|
264
|
+
to: zod_1.z.array(zod_1.z.string().email()),
|
|
265
|
+
from: zod_1.z.string().email(),
|
|
266
|
+
subject: zod_1.z.string(),
|
|
267
|
+
body: zod_1.z.string().optional(),
|
|
268
|
+
html: zod_1.z.string().optional(), // email body
|
|
269
|
+
});
|
package/index.ts
CHANGED
|
@@ -200,6 +200,7 @@ export const MongoScenarioSchema = new Schema(
|
|
|
200
200
|
title: { type: String, required: true }, // scenario title
|
|
201
201
|
scenario: { type: String, required: true }, // the actual scenario
|
|
202
202
|
geos: { type: [String] }, // array of geo strings
|
|
203
|
+
geos_ids: { type: [String] }, // array of geo _id strings
|
|
203
204
|
time_range: { type: Schema.Types.Mixed }, // optional time range for the query
|
|
204
205
|
user_id: { type: String, required: true }, // user identifier
|
|
205
206
|
additional_instructions: { type: String }, // additional instructions for the scenario
|
|
@@ -315,3 +316,20 @@ export const MongoMessageSchema = new Schema(
|
|
|
315
316
|
toObject: { virtuals: true },
|
|
316
317
|
},
|
|
317
318
|
);
|
|
319
|
+
|
|
320
|
+
export const MongoSendEmailSchema = new Schema(
|
|
321
|
+
{
|
|
322
|
+
timestamp: { type: Number }, // timestamp for when the email should be sent
|
|
323
|
+
from_service: { type: String }, // name of the service sending the email
|
|
324
|
+
to: { type: [String] }, // recipient email addresses
|
|
325
|
+
from: { type: String }, // sender email address
|
|
326
|
+
subject: { type: String }, // email subject
|
|
327
|
+
body: { type: String }, // optional plain text email body
|
|
328
|
+
html: { type: String }, // email body in HTML format
|
|
329
|
+
},
|
|
330
|
+
{
|
|
331
|
+
versionKey: false,
|
|
332
|
+
toJSON: { virtuals: true },
|
|
333
|
+
toObject: { virtuals: true },
|
|
334
|
+
},
|
|
335
|
+
);
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -133,19 +133,6 @@ export const zodJobSchema = z.object({
|
|
|
133
133
|
.optional(),
|
|
134
134
|
});
|
|
135
135
|
|
|
136
|
-
// export const zodJobRunSchema = z.object({
|
|
137
|
-
// _id: z.string().optional(),
|
|
138
|
-
// job_id: z.string().nonempty('Job ID must be provided'), // job identifier
|
|
139
|
-
// user_id: z.string().nonempty('User ID must be provided'), // user identifier
|
|
140
|
-
// status: z.enum(jobRunStatusList).default('done'), // status of the job run
|
|
141
|
-
// created_at: z.number().optional(), // creation date
|
|
142
|
-
// updated_at: z.number().optional(), // last update date
|
|
143
|
-
// result: z.string().optional(), // result of the job run
|
|
144
|
-
// error: z.string().optional(), // error message if the job run failed
|
|
145
|
-
// user_time_zone: z.string().optional(), // user's timezone
|
|
146
|
-
// metadata: z.record(z.string(), z.any()).optional(), // flexible metadata for the job run
|
|
147
|
-
// });
|
|
148
|
-
|
|
149
136
|
export const zodHeatmapSchema = z.object({
|
|
150
137
|
_id: z.string().optional(),
|
|
151
138
|
user_id: z.string().nonempty('User ID must be provided'), // user identifier
|
|
@@ -304,6 +291,7 @@ export const zodScenarioSchema = z.object({
|
|
|
304
291
|
title: z.string().nonempty('Scenario title must be provided'), // title of the scenario
|
|
305
292
|
scenario: z.string().nonempty('Scenario must be provided'), // the actual scenario
|
|
306
293
|
geos: z.array(z.string()).optional(), // array of geo strings
|
|
294
|
+
geos_ids: z.array(z.string()).optional(), // array of geo _id strings
|
|
307
295
|
time_range: zodRelativeTimeRangeSchema.or(zodAbsoluteTimeRangeSchema), // optional time range for the query
|
|
308
296
|
user_id: z.string().nonempty('User ID must be provided'), // user identifier
|
|
309
297
|
additional_instructions: z.string().optional(), // optional additional instructions for the scenario
|
|
@@ -319,6 +307,16 @@ export const zodScenarioSchema = z.object({
|
|
|
319
307
|
scores: z.array(zodScenarioScoreSchema).optional(), // array of scenario scores associated with the scenario
|
|
320
308
|
});
|
|
321
309
|
|
|
310
|
+
export const zodSendEmailSchema = z.object({
|
|
311
|
+
timestamp: z.number(), // timestamp for when the email should be sent
|
|
312
|
+
from_service: z.string(), // name of the service sending the email
|
|
313
|
+
to: z.array(z.string().email()), // recipient email address
|
|
314
|
+
from: z.string().email(), // sender email address
|
|
315
|
+
subject: z.string(), // email subject
|
|
316
|
+
body: z.string().optional(), // optional plain text email body
|
|
317
|
+
html: z.string().optional(), // email body
|
|
318
|
+
});
|
|
319
|
+
|
|
322
320
|
/**
|
|
323
321
|
* 'approved' - active and approved sources,
|
|
324
322
|
* 'back_to_business' - sources that were paused and now resumed,
|
|
@@ -348,6 +346,7 @@ export type ScenarioScoreType = z.infer<typeof zodScenarioScoreSchema>;
|
|
|
348
346
|
export type AlertType = z.infer<typeof zodAlertSchema>;
|
|
349
347
|
export type MessageType = z.infer<typeof zodMessageSchema>;
|
|
350
348
|
export type HeatmapType = z.infer<typeof zodHeatmapSchema>;
|
|
349
|
+
export type SendEmailType = z.infer<typeof zodSendEmailSchema>;
|
|
351
350
|
|
|
352
351
|
export type UserPublicMetadata = {
|
|
353
352
|
is_admin?: boolean;
|