asfur 1.0.119 → 1.0.120

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 CHANGED
@@ -127,11 +127,11 @@ export declare const MongoUserSettingsSchema: Schema<any, import("mongoose").Mod
127
127
  updated_at: NativeDate;
128
128
  has_jobs_access: boolean;
129
129
  active_jobs_limit: number;
130
+ emails?: string | null | undefined;
130
131
  time_range?: any;
131
132
  thread_id?: string | null | undefined;
132
133
  instructions?: string | null | undefined;
133
134
  logo_url?: string | null | undefined;
134
- emails?: string | null | undefined;
135
135
  name?: string | null | undefined;
136
136
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
137
137
  status: "active" | "inactive";
@@ -143,11 +143,11 @@ export declare const MongoUserSettingsSchema: Schema<any, import("mongoose").Mod
143
143
  updated_at: NativeDate;
144
144
  has_jobs_access: boolean;
145
145
  active_jobs_limit: number;
146
+ emails?: string | null | undefined;
146
147
  time_range?: any;
147
148
  thread_id?: string | null | undefined;
148
149
  instructions?: string | null | undefined;
149
150
  logo_url?: string | null | undefined;
150
- emails?: string | null | undefined;
151
151
  name?: string | null | undefined;
152
152
  }>, {}> & import("mongoose").FlatRecord<{
153
153
  status: "active" | "inactive";
@@ -159,11 +159,11 @@ export declare const MongoUserSettingsSchema: Schema<any, import("mongoose").Mod
159
159
  updated_at: NativeDate;
160
160
  has_jobs_access: boolean;
161
161
  active_jobs_limit: number;
162
+ emails?: string | null | undefined;
162
163
  time_range?: any;
163
164
  thread_id?: string | null | undefined;
164
165
  instructions?: string | null | undefined;
165
166
  logo_url?: string | null | undefined;
166
- emails?: string | null | undefined;
167
167
  name?: string | null | undefined;
168
168
  }> & {
169
169
  _id: import("mongoose").Types.ObjectId;
@@ -238,6 +238,7 @@ export declare const MongoJobSchema: Schema<any, import("mongoose").Model<any, a
238
238
  schedule_text?: string | null | undefined;
239
239
  active_until?: number | null | undefined;
240
240
  time_zone?: string | null | undefined;
241
+ alert?: any;
241
242
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
242
243
  status: "active" | "inactive";
243
244
  query: any;
@@ -261,6 +262,7 @@ export declare const MongoJobSchema: Schema<any, import("mongoose").Model<any, a
261
262
  schedule_text?: string | null | undefined;
262
263
  active_until?: number | null | undefined;
263
264
  time_zone?: string | null | undefined;
265
+ alert?: any;
264
266
  }>, {}> & import("mongoose").FlatRecord<{
265
267
  status: "active" | "inactive";
266
268
  query: any;
@@ -284,6 +286,7 @@ export declare const MongoJobSchema: Schema<any, import("mongoose").Model<any, a
284
286
  schedule_text?: string | null | undefined;
285
287
  active_until?: number | null | undefined;
286
288
  time_zone?: string | null | undefined;
289
+ alert?: any;
287
290
  }> & {
288
291
  _id: import("mongoose").Types.ObjectId;
289
292
  } & {
@@ -436,8 +439,8 @@ export declare const MongoScenarioSchema: Schema<any, import("mongoose").Model<a
436
439
  schedule_text?: string | null | undefined;
437
440
  active_until?: number | null | undefined;
438
441
  time_zone?: string | null | undefined;
439
- additional_instructions?: string | null | undefined;
440
442
  alert?: any;
443
+ additional_instructions?: string | null | undefined;
441
444
  }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
442
445
  status: "active" | "inactive";
443
446
  title: string;
@@ -454,8 +457,8 @@ export declare const MongoScenarioSchema: Schema<any, import("mongoose").Model<a
454
457
  schedule_text?: string | null | undefined;
455
458
  active_until?: number | null | undefined;
456
459
  time_zone?: string | null | undefined;
457
- additional_instructions?: string | null | undefined;
458
460
  alert?: any;
461
+ additional_instructions?: string | null | undefined;
459
462
  }>, {}> & import("mongoose").FlatRecord<{
460
463
  status: "active" | "inactive";
461
464
  title: string;
@@ -472,8 +475,8 @@ export declare const MongoScenarioSchema: Schema<any, import("mongoose").Model<a
472
475
  schedule_text?: string | null | undefined;
473
476
  active_until?: number | null | undefined;
474
477
  time_zone?: string | null | undefined;
475
- additional_instructions?: string | null | undefined;
476
478
  alert?: any;
479
+ additional_instructions?: string | null | undefined;
477
480
  }> & {
478
481
  _id: import("mongoose").Types.ObjectId;
479
482
  } & {
package/dist/index.js CHANGED
@@ -117,6 +117,7 @@ exports.MongoJobSchema = new mongoose_1.Schema({
117
117
  config: { type: mongoose_1.Schema.Types.Mixed }, // configuration for the addon
118
118
  },
119
119
  ],
120
+ alert: { type: mongoose_1.Schema.Types.Mixed }, // optional alert configuration for the job
120
121
  }, {
121
122
  versionKey: false,
122
123
  toJSON: { virtuals: true },
package/dist/types.d.ts CHANGED
@@ -31,6 +31,49 @@ export declare const zodAbsoluteTimeRangeSchema: z.ZodObject<{
31
31
  start: number;
32
32
  end: number;
33
33
  }>;
34
+ export declare const zodAlertSchema: z.ZodObject<{
35
+ title: z.ZodOptional<z.ZodString>;
36
+ threshold: z.ZodOptional<z.ZodNumber>;
37
+ is_on: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
38
+ is_triggered: z.ZodOptional<z.ZodBoolean>;
39
+ triggered_at: z.ZodOptional<z.ZodNumber>;
40
+ is_sent: z.ZodOptional<z.ZodBoolean>;
41
+ message: z.ZodOptional<z.ZodString>;
42
+ by_email: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
43
+ by_whatsapp: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
44
+ emails: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
45
+ phone_numbers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
46
+ trigger_on: z.ZodOptional<z.ZodEnum<["every_new_message", "condition"]>>;
47
+ trigger_condition: z.ZodOptional<z.ZodString>;
48
+ }, "strip", z.ZodTypeAny, {
49
+ is_on: boolean;
50
+ by_email: boolean;
51
+ by_whatsapp: boolean;
52
+ message?: string | undefined;
53
+ title?: string | undefined;
54
+ threshold?: number | undefined;
55
+ is_triggered?: boolean | undefined;
56
+ triggered_at?: number | undefined;
57
+ is_sent?: boolean | undefined;
58
+ emails?: string[] | undefined;
59
+ phone_numbers?: string[] | undefined;
60
+ trigger_on?: "every_new_message" | "condition" | undefined;
61
+ trigger_condition?: string | undefined;
62
+ }, {
63
+ message?: string | undefined;
64
+ title?: string | undefined;
65
+ threshold?: number | undefined;
66
+ is_on?: boolean | undefined;
67
+ is_triggered?: boolean | undefined;
68
+ triggered_at?: number | undefined;
69
+ is_sent?: boolean | undefined;
70
+ by_email?: boolean | undefined;
71
+ by_whatsapp?: boolean | undefined;
72
+ emails?: string[] | undefined;
73
+ phone_numbers?: string[] | undefined;
74
+ trigger_on?: "every_new_message" | "condition" | undefined;
75
+ trigger_condition?: string | undefined;
76
+ }>;
34
77
  export declare const zodQuerySchema: z.ZodObject<{
35
78
  _id: z.ZodOptional<z.ZodString>;
36
79
  title: z.ZodOptional<z.ZodString>;
@@ -77,8 +120,8 @@ export declare const zodQuerySchema: z.ZodObject<{
77
120
  end: number;
78
121
  };
79
122
  user_id: string;
80
- _id?: string | undefined;
81
123
  title?: string | undefined;
124
+ _id?: string | undefined;
82
125
  query?: string | undefined;
83
126
  sources?: string[] | undefined;
84
127
  geos?: string[] | undefined;
@@ -99,8 +142,8 @@ export declare const zodQuerySchema: z.ZodObject<{
99
142
  end: number;
100
143
  };
101
144
  user_id: string;
102
- _id?: string | undefined;
103
145
  title?: string | undefined;
146
+ _id?: string | undefined;
104
147
  query?: string | undefined;
105
148
  sources?: string[] | undefined;
106
149
  geos?: string[] | undefined;
@@ -184,6 +227,7 @@ export declare const zodUserSettingsSchema: z.ZodObject<{
184
227
  requested_content: ("text" | "table" | "heatmap")[];
185
228
  has_jobs_access: boolean;
186
229
  active_jobs_limit: number;
230
+ emails?: string | undefined;
187
231
  _id?: string | undefined;
188
232
  geos?: string[] | undefined;
189
233
  created_at?: number | Date | undefined;
@@ -191,7 +235,6 @@ export declare const zodUserSettingsSchema: z.ZodObject<{
191
235
  thread_id?: string | undefined;
192
236
  instructions?: string | undefined;
193
237
  logo_url?: string | undefined;
194
- emails?: string | undefined;
195
238
  name?: string | undefined;
196
239
  }, {
197
240
  sources: string[];
@@ -205,6 +248,7 @@ export declare const zodUserSettingsSchema: z.ZodObject<{
205
248
  };
206
249
  user_id: string;
207
250
  status?: "active" | "inactive" | undefined;
251
+ emails?: string | undefined;
208
252
  _id?: string | undefined;
209
253
  geos?: string[] | undefined;
210
254
  requested_content?: ("text" | "table" | "heatmap")[] | undefined;
@@ -215,7 +259,6 @@ export declare const zodUserSettingsSchema: z.ZodObject<{
215
259
  has_jobs_access?: boolean | undefined;
216
260
  active_jobs_limit?: number | undefined;
217
261
  logo_url?: string | undefined;
218
- emails?: string | undefined;
219
262
  name?: string | undefined;
220
263
  }>;
221
264
  export declare const zodConversationSchema: z.ZodObject<{
@@ -232,15 +275,15 @@ export declare const zodConversationSchema: z.ZodObject<{
232
275
  user_id: string;
233
276
  is_job: boolean;
234
277
  is_favorite: boolean;
235
- _id?: string | undefined;
236
278
  title?: string | undefined;
279
+ _id?: string | undefined;
237
280
  created_at?: number | undefined;
238
281
  updated_at?: number | undefined;
239
282
  }, {
240
283
  user_id: string;
241
284
  status?: "active" | "inactive" | undefined;
242
- _id?: string | undefined;
243
285
  title?: string | undefined;
286
+ _id?: string | undefined;
244
287
  created_at?: number | undefined;
245
288
  updated_at?: number | undefined;
246
289
  is_job?: boolean | undefined;
@@ -302,8 +345,8 @@ export declare const zodJobSchema: z.ZodObject<{
302
345
  end: number;
303
346
  };
304
347
  user_id: string;
305
- _id?: string | undefined;
306
348
  title?: string | undefined;
349
+ _id?: string | undefined;
307
350
  query?: string | undefined;
308
351
  sources?: string[] | undefined;
309
352
  geos?: string[] | undefined;
@@ -324,8 +367,8 @@ export declare const zodJobSchema: z.ZodObject<{
324
367
  end: number;
325
368
  };
326
369
  user_id: string;
327
- _id?: string | undefined;
328
370
  title?: string | undefined;
371
+ _id?: string | undefined;
329
372
  query?: string | undefined;
330
373
  sources?: string[] | undefined;
331
374
  geos?: string[] | undefined;
@@ -350,6 +393,49 @@ export declare const zodJobSchema: z.ZodObject<{
350
393
  name: string;
351
394
  config: Record<string, any>;
352
395
  }>, "many">>;
396
+ alert: z.ZodOptional<z.ZodObject<{
397
+ title: z.ZodOptional<z.ZodString>;
398
+ threshold: z.ZodOptional<z.ZodNumber>;
399
+ is_on: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
400
+ is_triggered: z.ZodOptional<z.ZodBoolean>;
401
+ triggered_at: z.ZodOptional<z.ZodNumber>;
402
+ is_sent: z.ZodOptional<z.ZodBoolean>;
403
+ message: z.ZodOptional<z.ZodString>;
404
+ by_email: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
405
+ by_whatsapp: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
406
+ emails: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
407
+ phone_numbers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
408
+ trigger_on: z.ZodOptional<z.ZodEnum<["every_new_message", "condition"]>>;
409
+ trigger_condition: z.ZodOptional<z.ZodString>;
410
+ }, "strip", z.ZodTypeAny, {
411
+ is_on: boolean;
412
+ by_email: boolean;
413
+ by_whatsapp: boolean;
414
+ message?: string | undefined;
415
+ title?: string | undefined;
416
+ threshold?: number | undefined;
417
+ is_triggered?: boolean | undefined;
418
+ triggered_at?: number | undefined;
419
+ is_sent?: boolean | undefined;
420
+ emails?: string[] | undefined;
421
+ phone_numbers?: string[] | undefined;
422
+ trigger_on?: "every_new_message" | "condition" | undefined;
423
+ trigger_condition?: string | undefined;
424
+ }, {
425
+ message?: string | undefined;
426
+ title?: string | undefined;
427
+ threshold?: number | undefined;
428
+ is_on?: boolean | undefined;
429
+ is_triggered?: boolean | undefined;
430
+ triggered_at?: number | undefined;
431
+ is_sent?: boolean | undefined;
432
+ by_email?: boolean | undefined;
433
+ by_whatsapp?: boolean | undefined;
434
+ emails?: string[] | undefined;
435
+ phone_numbers?: string[] | undefined;
436
+ trigger_on?: "every_new_message" | "condition" | undefined;
437
+ trigger_condition?: string | undefined;
438
+ }>>;
353
439
  }, "strip", z.ZodTypeAny, {
354
440
  status: "active" | "inactive";
355
441
  query: {
@@ -362,8 +448,8 @@ export declare const zodJobSchema: z.ZodObject<{
362
448
  end: number;
363
449
  };
364
450
  user_id: string;
365
- _id?: string | undefined;
366
451
  title?: string | undefined;
452
+ _id?: string | undefined;
367
453
  query?: string | undefined;
368
454
  sources?: string[] | undefined;
369
455
  geos?: string[] | undefined;
@@ -390,6 +476,21 @@ export declare const zodJobSchema: z.ZodObject<{
390
476
  name: string;
391
477
  config: Record<string, any>;
392
478
  }[] | undefined;
479
+ alert?: {
480
+ is_on: boolean;
481
+ by_email: boolean;
482
+ by_whatsapp: boolean;
483
+ message?: string | undefined;
484
+ title?: string | undefined;
485
+ threshold?: number | undefined;
486
+ is_triggered?: boolean | undefined;
487
+ triggered_at?: number | undefined;
488
+ is_sent?: boolean | undefined;
489
+ emails?: string[] | undefined;
490
+ phone_numbers?: string[] | undefined;
491
+ trigger_on?: "every_new_message" | "condition" | undefined;
492
+ trigger_condition?: string | undefined;
493
+ } | undefined;
393
494
  }, {
394
495
  query: {
395
496
  time_range: {
@@ -401,8 +502,8 @@ export declare const zodJobSchema: z.ZodObject<{
401
502
  end: number;
402
503
  };
403
504
  user_id: string;
404
- _id?: string | undefined;
405
505
  title?: string | undefined;
506
+ _id?: string | undefined;
406
507
  query?: string | undefined;
407
508
  sources?: string[] | undefined;
408
509
  geos?: string[] | undefined;
@@ -430,6 +531,21 @@ export declare const zodJobSchema: z.ZodObject<{
430
531
  name: string;
431
532
  config: Record<string, any>;
432
533
  }[] | undefined;
534
+ alert?: {
535
+ message?: string | undefined;
536
+ title?: string | undefined;
537
+ threshold?: number | undefined;
538
+ is_on?: boolean | undefined;
539
+ is_triggered?: boolean | undefined;
540
+ triggered_at?: number | undefined;
541
+ is_sent?: boolean | undefined;
542
+ by_email?: boolean | undefined;
543
+ by_whatsapp?: boolean | undefined;
544
+ emails?: string[] | undefined;
545
+ phone_numbers?: string[] | undefined;
546
+ trigger_on?: "every_new_message" | "condition" | undefined;
547
+ trigger_condition?: string | undefined;
548
+ } | undefined;
433
549
  }>;
434
550
  export declare const zodHeatmapSchema: z.ZodObject<{
435
551
  _id: z.ZodOptional<z.ZodString>;
@@ -859,8 +975,8 @@ export declare const zodReportSchema: z.ZodObject<{
859
975
  conversation_id: string;
860
976
  last_assistant_messages_count: number;
861
977
  process_status: "failed" | "in_progress" | "pending" | "completed";
862
- _id?: string | undefined;
863
978
  title?: string | undefined;
979
+ _id?: string | undefined;
864
980
  created_at?: number | undefined;
865
981
  updated_at?: number | undefined;
866
982
  additional_instructions?: string | undefined;
@@ -871,8 +987,8 @@ export declare const zodReportSchema: z.ZodObject<{
871
987
  user_id: string;
872
988
  conversation_id: string;
873
989
  process_status: "failed" | "in_progress" | "pending" | "completed";
874
- _id?: string | undefined;
875
990
  title?: string | undefined;
991
+ _id?: string | undefined;
876
992
  created_at?: number | undefined;
877
993
  updated_at?: number | undefined;
878
994
  last_assistant_messages_count?: number | undefined;
@@ -910,43 +1026,6 @@ export declare const zodNotificationSchema: z.ZodObject<{
910
1026
  redirect_url?: string | undefined;
911
1027
  }>;
912
1028
  export declare const scenarioScoreTypeList: readonly ["ten_score", "hundred_score", "percentage_score", "four_point_scale"];
913
- export declare const zodAlertSchema: z.ZodObject<{
914
- title: z.ZodOptional<z.ZodString>;
915
- threshold: z.ZodOptional<z.ZodNumber>;
916
- is_on: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
917
- is_triggered: z.ZodOptional<z.ZodBoolean>;
918
- triggered_at: z.ZodOptional<z.ZodNumber>;
919
- is_sent: z.ZodOptional<z.ZodBoolean>;
920
- message: z.ZodOptional<z.ZodString>;
921
- by_email: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
922
- by_whatsapp: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
923
- emails: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
924
- phone_numbers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
925
- }, "strip", z.ZodTypeAny, {
926
- is_on: boolean;
927
- by_email: boolean;
928
- by_whatsapp: boolean;
929
- message?: string | undefined;
930
- title?: string | undefined;
931
- emails?: string[] | undefined;
932
- threshold?: number | undefined;
933
- is_triggered?: boolean | undefined;
934
- triggered_at?: number | undefined;
935
- is_sent?: boolean | undefined;
936
- phone_numbers?: string[] | undefined;
937
- }, {
938
- message?: string | undefined;
939
- title?: string | undefined;
940
- emails?: string[] | undefined;
941
- threshold?: number | undefined;
942
- is_on?: boolean | undefined;
943
- is_triggered?: boolean | undefined;
944
- triggered_at?: number | undefined;
945
- is_sent?: boolean | undefined;
946
- by_email?: boolean | undefined;
947
- by_whatsapp?: boolean | undefined;
948
- phone_numbers?: string[] | undefined;
949
- }>;
950
1029
  export declare const zodScenarioScoreSchema: z.ZodObject<{
951
1030
  _id: z.ZodOptional<z.ZodString>;
952
1031
  scenario_id: z.ZodString;
@@ -1081,22 +1160,25 @@ export declare const zodScenarioScoreSchema: z.ZodObject<{
1081
1160
  by_whatsapp: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1082
1161
  emails: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1083
1162
  phone_numbers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1163
+ trigger_on: z.ZodOptional<z.ZodEnum<["every_new_message", "condition"]>>;
1164
+ trigger_condition: z.ZodOptional<z.ZodString>;
1084
1165
  }, "strip", z.ZodTypeAny, {
1085
1166
  is_on: boolean;
1086
1167
  by_email: boolean;
1087
1168
  by_whatsapp: boolean;
1088
1169
  message?: string | undefined;
1089
1170
  title?: string | undefined;
1090
- emails?: string[] | undefined;
1091
1171
  threshold?: number | undefined;
1092
1172
  is_triggered?: boolean | undefined;
1093
1173
  triggered_at?: number | undefined;
1094
1174
  is_sent?: boolean | undefined;
1175
+ emails?: string[] | undefined;
1095
1176
  phone_numbers?: string[] | undefined;
1177
+ trigger_on?: "every_new_message" | "condition" | undefined;
1178
+ trigger_condition?: string | undefined;
1096
1179
  }, {
1097
1180
  message?: string | undefined;
1098
1181
  title?: string | undefined;
1099
- emails?: string[] | undefined;
1100
1182
  threshold?: number | undefined;
1101
1183
  is_on?: boolean | undefined;
1102
1184
  is_triggered?: boolean | undefined;
@@ -1104,7 +1186,10 @@ export declare const zodScenarioScoreSchema: z.ZodObject<{
1104
1186
  is_sent?: boolean | undefined;
1105
1187
  by_email?: boolean | undefined;
1106
1188
  by_whatsapp?: boolean | undefined;
1189
+ emails?: string[] | undefined;
1107
1190
  phone_numbers?: string[] | undefined;
1191
+ trigger_on?: "every_new_message" | "condition" | undefined;
1192
+ trigger_condition?: string | undefined;
1108
1193
  }>>;
1109
1194
  key_evidence: z.ZodOptional<z.ZodArray<z.ZodObject<{
1110
1195
  evidence: z.ZodString;
@@ -1157,24 +1242,26 @@ export declare const zodScenarioScoreSchema: z.ZodObject<{
1157
1242
  _id?: string | undefined;
1158
1243
  created_at?: number | undefined;
1159
1244
  updated_at?: number | undefined;
1160
- main_bullets?: {
1161
- title: string;
1162
- bullet: string;
1163
- urls?: string[] | undefined;
1164
- }[] | undefined;
1165
1245
  alert?: {
1166
1246
  is_on: boolean;
1167
1247
  by_email: boolean;
1168
1248
  by_whatsapp: boolean;
1169
1249
  message?: string | undefined;
1170
1250
  title?: string | undefined;
1171
- emails?: string[] | undefined;
1172
1251
  threshold?: number | undefined;
1173
1252
  is_triggered?: boolean | undefined;
1174
1253
  triggered_at?: number | undefined;
1175
1254
  is_sent?: boolean | undefined;
1255
+ emails?: string[] | undefined;
1176
1256
  phone_numbers?: string[] | undefined;
1257
+ trigger_on?: "every_new_message" | "condition" | undefined;
1258
+ trigger_condition?: string | undefined;
1177
1259
  } | undefined;
1260
+ main_bullets?: {
1261
+ title: string;
1262
+ bullet: string;
1263
+ urls?: string[] | undefined;
1264
+ }[] | undefined;
1178
1265
  key_evidence?: {
1179
1266
  evidence: string;
1180
1267
  url?: string | undefined;
@@ -1218,15 +1305,9 @@ export declare const zodScenarioScoreSchema: z.ZodObject<{
1218
1305
  _id?: string | undefined;
1219
1306
  created_at?: number | undefined;
1220
1307
  updated_at?: number | undefined;
1221
- main_bullets?: {
1222
- title: string;
1223
- bullet: string;
1224
- urls?: string[] | undefined;
1225
- }[] | undefined;
1226
1308
  alert?: {
1227
1309
  message?: string | undefined;
1228
1310
  title?: string | undefined;
1229
- emails?: string[] | undefined;
1230
1311
  threshold?: number | undefined;
1231
1312
  is_on?: boolean | undefined;
1232
1313
  is_triggered?: boolean | undefined;
@@ -1234,8 +1315,16 @@ export declare const zodScenarioScoreSchema: z.ZodObject<{
1234
1315
  is_sent?: boolean | undefined;
1235
1316
  by_email?: boolean | undefined;
1236
1317
  by_whatsapp?: boolean | undefined;
1318
+ emails?: string[] | undefined;
1237
1319
  phone_numbers?: string[] | undefined;
1320
+ trigger_on?: "every_new_message" | "condition" | undefined;
1321
+ trigger_condition?: string | undefined;
1238
1322
  } | undefined;
1323
+ main_bullets?: {
1324
+ title: string;
1325
+ bullet: string;
1326
+ urls?: string[] | undefined;
1327
+ }[] | undefined;
1239
1328
  key_evidence?: {
1240
1329
  evidence: string;
1241
1330
  url?: string | undefined;
@@ -1293,22 +1382,25 @@ export declare const zodScenarioSchema: z.ZodObject<{
1293
1382
  by_whatsapp: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1294
1383
  emails: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1295
1384
  phone_numbers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1385
+ trigger_on: z.ZodOptional<z.ZodEnum<["every_new_message", "condition"]>>;
1386
+ trigger_condition: z.ZodOptional<z.ZodString>;
1296
1387
  }, "strip", z.ZodTypeAny, {
1297
1388
  is_on: boolean;
1298
1389
  by_email: boolean;
1299
1390
  by_whatsapp: boolean;
1300
1391
  message?: string | undefined;
1301
1392
  title?: string | undefined;
1302
- emails?: string[] | undefined;
1303
1393
  threshold?: number | undefined;
1304
1394
  is_triggered?: boolean | undefined;
1305
1395
  triggered_at?: number | undefined;
1306
1396
  is_sent?: boolean | undefined;
1397
+ emails?: string[] | undefined;
1307
1398
  phone_numbers?: string[] | undefined;
1399
+ trigger_on?: "every_new_message" | "condition" | undefined;
1400
+ trigger_condition?: string | undefined;
1308
1401
  }, {
1309
1402
  message?: string | undefined;
1310
1403
  title?: string | undefined;
1311
- emails?: string[] | undefined;
1312
1404
  threshold?: number | undefined;
1313
1405
  is_on?: boolean | undefined;
1314
1406
  is_triggered?: boolean | undefined;
@@ -1316,7 +1408,10 @@ export declare const zodScenarioSchema: z.ZodObject<{
1316
1408
  is_sent?: boolean | undefined;
1317
1409
  by_email?: boolean | undefined;
1318
1410
  by_whatsapp?: boolean | undefined;
1411
+ emails?: string[] | undefined;
1319
1412
  phone_numbers?: string[] | undefined;
1413
+ trigger_on?: "every_new_message" | "condition" | undefined;
1414
+ trigger_condition?: string | undefined;
1320
1415
  }>>;
1321
1416
  scores: z.ZodOptional<z.ZodArray<z.ZodObject<{
1322
1417
  _id: z.ZodOptional<z.ZodString>;
@@ -1452,22 +1547,25 @@ export declare const zodScenarioSchema: z.ZodObject<{
1452
1547
  by_whatsapp: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1453
1548
  emails: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1454
1549
  phone_numbers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1550
+ trigger_on: z.ZodOptional<z.ZodEnum<["every_new_message", "condition"]>>;
1551
+ trigger_condition: z.ZodOptional<z.ZodString>;
1455
1552
  }, "strip", z.ZodTypeAny, {
1456
1553
  is_on: boolean;
1457
1554
  by_email: boolean;
1458
1555
  by_whatsapp: boolean;
1459
1556
  message?: string | undefined;
1460
1557
  title?: string | undefined;
1461
- emails?: string[] | undefined;
1462
1558
  threshold?: number | undefined;
1463
1559
  is_triggered?: boolean | undefined;
1464
1560
  triggered_at?: number | undefined;
1465
1561
  is_sent?: boolean | undefined;
1562
+ emails?: string[] | undefined;
1466
1563
  phone_numbers?: string[] | undefined;
1564
+ trigger_on?: "every_new_message" | "condition" | undefined;
1565
+ trigger_condition?: string | undefined;
1467
1566
  }, {
1468
1567
  message?: string | undefined;
1469
1568
  title?: string | undefined;
1470
- emails?: string[] | undefined;
1471
1569
  threshold?: number | undefined;
1472
1570
  is_on?: boolean | undefined;
1473
1571
  is_triggered?: boolean | undefined;
@@ -1475,7 +1573,10 @@ export declare const zodScenarioSchema: z.ZodObject<{
1475
1573
  is_sent?: boolean | undefined;
1476
1574
  by_email?: boolean | undefined;
1477
1575
  by_whatsapp?: boolean | undefined;
1576
+ emails?: string[] | undefined;
1478
1577
  phone_numbers?: string[] | undefined;
1578
+ trigger_on?: "every_new_message" | "condition" | undefined;
1579
+ trigger_condition?: string | undefined;
1479
1580
  }>>;
1480
1581
  key_evidence: z.ZodOptional<z.ZodArray<z.ZodObject<{
1481
1582
  evidence: z.ZodString;
@@ -1528,24 +1629,26 @@ export declare const zodScenarioSchema: z.ZodObject<{
1528
1629
  _id?: string | undefined;
1529
1630
  created_at?: number | undefined;
1530
1631
  updated_at?: number | undefined;
1531
- main_bullets?: {
1532
- title: string;
1533
- bullet: string;
1534
- urls?: string[] | undefined;
1535
- }[] | undefined;
1536
1632
  alert?: {
1537
1633
  is_on: boolean;
1538
1634
  by_email: boolean;
1539
1635
  by_whatsapp: boolean;
1540
1636
  message?: string | undefined;
1541
1637
  title?: string | undefined;
1542
- emails?: string[] | undefined;
1543
1638
  threshold?: number | undefined;
1544
1639
  is_triggered?: boolean | undefined;
1545
1640
  triggered_at?: number | undefined;
1546
1641
  is_sent?: boolean | undefined;
1642
+ emails?: string[] | undefined;
1547
1643
  phone_numbers?: string[] | undefined;
1644
+ trigger_on?: "every_new_message" | "condition" | undefined;
1645
+ trigger_condition?: string | undefined;
1548
1646
  } | undefined;
1647
+ main_bullets?: {
1648
+ title: string;
1649
+ bullet: string;
1650
+ urls?: string[] | undefined;
1651
+ }[] | undefined;
1549
1652
  key_evidence?: {
1550
1653
  evidence: string;
1551
1654
  url?: string | undefined;
@@ -1589,15 +1692,9 @@ export declare const zodScenarioSchema: z.ZodObject<{
1589
1692
  _id?: string | undefined;
1590
1693
  created_at?: number | undefined;
1591
1694
  updated_at?: number | undefined;
1592
- main_bullets?: {
1593
- title: string;
1594
- bullet: string;
1595
- urls?: string[] | undefined;
1596
- }[] | undefined;
1597
1695
  alert?: {
1598
1696
  message?: string | undefined;
1599
1697
  title?: string | undefined;
1600
- emails?: string[] | undefined;
1601
1698
  threshold?: number | undefined;
1602
1699
  is_on?: boolean | undefined;
1603
1700
  is_triggered?: boolean | undefined;
@@ -1605,8 +1702,16 @@ export declare const zodScenarioSchema: z.ZodObject<{
1605
1702
  is_sent?: boolean | undefined;
1606
1703
  by_email?: boolean | undefined;
1607
1704
  by_whatsapp?: boolean | undefined;
1705
+ emails?: string[] | undefined;
1608
1706
  phone_numbers?: string[] | undefined;
1707
+ trigger_on?: "every_new_message" | "condition" | undefined;
1708
+ trigger_condition?: string | undefined;
1609
1709
  } | undefined;
1710
+ main_bullets?: {
1711
+ title: string;
1712
+ bullet: string;
1713
+ urls?: string[] | undefined;
1714
+ }[] | undefined;
1610
1715
  key_evidence?: {
1611
1716
  evidence: string;
1612
1717
  url?: string | undefined;
@@ -1638,20 +1743,22 @@ export declare const zodScenarioSchema: z.ZodObject<{
1638
1743
  schedule_text?: string | undefined;
1639
1744
  active_until?: number | undefined;
1640
1745
  time_zone?: string | undefined;
1641
- additional_instructions?: string | undefined;
1642
1746
  alert?: {
1643
1747
  is_on: boolean;
1644
1748
  by_email: boolean;
1645
1749
  by_whatsapp: boolean;
1646
1750
  message?: string | undefined;
1647
1751
  title?: string | undefined;
1648
- emails?: string[] | undefined;
1649
1752
  threshold?: number | undefined;
1650
1753
  is_triggered?: boolean | undefined;
1651
1754
  triggered_at?: number | undefined;
1652
1755
  is_sent?: boolean | undefined;
1756
+ emails?: string[] | undefined;
1653
1757
  phone_numbers?: string[] | undefined;
1758
+ trigger_on?: "every_new_message" | "condition" | undefined;
1759
+ trigger_condition?: string | undefined;
1654
1760
  } | undefined;
1761
+ additional_instructions?: string | undefined;
1655
1762
  scores?: {
1656
1763
  text: string;
1657
1764
  user_id: string;
@@ -1689,24 +1796,26 @@ export declare const zodScenarioSchema: z.ZodObject<{
1689
1796
  _id?: string | undefined;
1690
1797
  created_at?: number | undefined;
1691
1798
  updated_at?: number | undefined;
1692
- main_bullets?: {
1693
- title: string;
1694
- bullet: string;
1695
- urls?: string[] | undefined;
1696
- }[] | undefined;
1697
1799
  alert?: {
1698
1800
  is_on: boolean;
1699
1801
  by_email: boolean;
1700
1802
  by_whatsapp: boolean;
1701
1803
  message?: string | undefined;
1702
1804
  title?: string | undefined;
1703
- emails?: string[] | undefined;
1704
1805
  threshold?: number | undefined;
1705
1806
  is_triggered?: boolean | undefined;
1706
1807
  triggered_at?: number | undefined;
1707
1808
  is_sent?: boolean | undefined;
1809
+ emails?: string[] | undefined;
1708
1810
  phone_numbers?: string[] | undefined;
1811
+ trigger_on?: "every_new_message" | "condition" | undefined;
1812
+ trigger_condition?: string | undefined;
1709
1813
  } | undefined;
1814
+ main_bullets?: {
1815
+ title: string;
1816
+ bullet: string;
1817
+ urls?: string[] | undefined;
1818
+ }[] | undefined;
1710
1819
  key_evidence?: {
1711
1820
  evidence: string;
1712
1821
  url?: string | undefined;
@@ -1738,11 +1847,9 @@ export declare const zodScenarioSchema: z.ZodObject<{
1738
1847
  schedule_text?: string | undefined;
1739
1848
  active_until?: number | undefined;
1740
1849
  time_zone?: string | undefined;
1741
- additional_instructions?: string | undefined;
1742
1850
  alert?: {
1743
1851
  message?: string | undefined;
1744
1852
  title?: string | undefined;
1745
- emails?: string[] | undefined;
1746
1853
  threshold?: number | undefined;
1747
1854
  is_on?: boolean | undefined;
1748
1855
  is_triggered?: boolean | undefined;
@@ -1750,8 +1857,12 @@ export declare const zodScenarioSchema: z.ZodObject<{
1750
1857
  is_sent?: boolean | undefined;
1751
1858
  by_email?: boolean | undefined;
1752
1859
  by_whatsapp?: boolean | undefined;
1860
+ emails?: string[] | undefined;
1753
1861
  phone_numbers?: string[] | undefined;
1862
+ trigger_on?: "every_new_message" | "condition" | undefined;
1863
+ trigger_condition?: string | undefined;
1754
1864
  } | undefined;
1865
+ additional_instructions?: string | undefined;
1755
1866
  scores?: {
1756
1867
  text: string;
1757
1868
  user_id: string;
@@ -1789,15 +1900,9 @@ export declare const zodScenarioSchema: z.ZodObject<{
1789
1900
  _id?: string | undefined;
1790
1901
  created_at?: number | undefined;
1791
1902
  updated_at?: number | undefined;
1792
- main_bullets?: {
1793
- title: string;
1794
- bullet: string;
1795
- urls?: string[] | undefined;
1796
- }[] | undefined;
1797
1903
  alert?: {
1798
1904
  message?: string | undefined;
1799
1905
  title?: string | undefined;
1800
- emails?: string[] | undefined;
1801
1906
  threshold?: number | undefined;
1802
1907
  is_on?: boolean | undefined;
1803
1908
  is_triggered?: boolean | undefined;
@@ -1805,8 +1910,16 @@ export declare const zodScenarioSchema: z.ZodObject<{
1805
1910
  is_sent?: boolean | undefined;
1806
1911
  by_email?: boolean | undefined;
1807
1912
  by_whatsapp?: boolean | undefined;
1913
+ emails?: string[] | undefined;
1808
1914
  phone_numbers?: string[] | undefined;
1915
+ trigger_on?: "every_new_message" | "condition" | undefined;
1916
+ trigger_condition?: string | undefined;
1809
1917
  } | undefined;
1918
+ main_bullets?: {
1919
+ title: string;
1920
+ bullet: string;
1921
+ urls?: string[] | undefined;
1922
+ }[] | undefined;
1810
1923
  key_evidence?: {
1811
1924
  evidence: string;
1812
1925
  url?: string | undefined;
package/dist/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
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;
3
+ exports.zodSendEmailSchema = exports.zodScenarioSchema = exports.zodScenarioScoreSchema = 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.zodAlertSchema = 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'];
@@ -25,6 +25,21 @@ exports.zodAbsoluteTimeRangeSchema = zod_1.z.object({
25
25
  start: zod_1.z.number(),
26
26
  end: zod_1.z.number(), // end date
27
27
  });
28
+ exports.zodAlertSchema = zod_1.z.object({
29
+ title: zod_1.z.string().optional(),
30
+ threshold: zod_1.z.number().optional(),
31
+ is_on: zod_1.z.boolean().optional().default(false),
32
+ is_triggered: zod_1.z.boolean().optional(),
33
+ triggered_at: zod_1.z.number().optional(),
34
+ is_sent: zod_1.z.boolean().optional(),
35
+ message: zod_1.z.string().optional(),
36
+ by_email: zod_1.z.boolean().optional().default(false),
37
+ by_whatsapp: zod_1.z.boolean().optional().default(false),
38
+ emails: zod_1.z.array(zod_1.z.string().email()).optional(),
39
+ phone_numbers: zod_1.z.array(zod_1.z.string()).optional(),
40
+ trigger_on: zod_1.z.enum(['every_new_message', 'condition']).optional(),
41
+ trigger_condition: zod_1.z.string().optional(), // JOB - condition for triggering the job if trigger_on is set to 'condition'
42
+ });
28
43
  exports.zodQuerySchema = zod_1.z.object({
29
44
  _id: zod_1.z.string().optional(),
30
45
  title: zod_1.z.string().optional(),
@@ -99,6 +114,7 @@ exports.zodJobSchema = zod_1.z.object({
99
114
  config: zod_1.z.record(zod_1.z.string(), zod_1.z.any()), // configuration for the addon
100
115
  }))
101
116
  .optional(),
117
+ alert: exports.zodAlertSchema.optional(), // optional alert configuration for the job
102
118
  });
103
119
  exports.zodHeatmapSchema = zod_1.z.object({
104
120
  _id: zod_1.z.string().optional(),
@@ -205,19 +221,6 @@ exports.scenarioScoreTypeList = [
205
221
  'percentage_score',
206
222
  'four_point_scale',
207
223
  ];
208
- exports.zodAlertSchema = zod_1.z.object({
209
- title: zod_1.z.string().optional(),
210
- threshold: zod_1.z.number().optional(),
211
- is_on: zod_1.z.boolean().optional().default(false),
212
- is_triggered: zod_1.z.boolean().optional(),
213
- triggered_at: zod_1.z.number().optional(),
214
- is_sent: zod_1.z.boolean().optional(),
215
- message: zod_1.z.string().optional(),
216
- by_email: zod_1.z.boolean().optional().default(false),
217
- by_whatsapp: zod_1.z.boolean().optional().default(false),
218
- emails: zod_1.z.array(zod_1.z.string().email()).optional(),
219
- phone_numbers: zod_1.z.array(zod_1.z.string()).optional(), // array of phone numbers to send WhatsApp alerts to when the scenario score exceeds the alert_threshold
220
- });
221
224
  exports.zodScenarioScoreSchema = zod_1.z.object({
222
225
  _id: zod_1.z.string().optional(),
223
226
  scenario_id: zod_1.z.string().nonempty('Scenario ID must be provided'),
package/index.ts CHANGED
@@ -124,6 +124,7 @@ export const MongoJobSchema = new Schema(
124
124
  config: { type: Schema.Types.Mixed }, // configuration for the addon
125
125
  },
126
126
  ],
127
+ alert: { type: Schema.Types.Mixed }, // optional alert configuration for the job
127
128
  },
128
129
  {
129
130
  versionKey: false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asfur",
3
- "version": "1.0.119",
3
+ "version": "1.0.120",
4
4
  "description": "SDK for interacting with the Asfur API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/types.ts CHANGED
@@ -51,6 +51,22 @@ export const zodAbsoluteTimeRangeSchema = z.object({
51
51
  end: z.number(), // end date
52
52
  });
53
53
 
54
+ export const zodAlertSchema = z.object({
55
+ title: z.string().optional(), // optional title for the alert when the scenario score exceeds the alert_threshold
56
+ threshold: z.number().optional(), // threshold for the alert
57
+ is_on: z.boolean().optional().default(false), // true if the alert is enabled
58
+ is_triggered: z.boolean().optional(), // true if the alert has been triggered
59
+ triggered_at: z.number().optional(), // date when the alert was triggered
60
+ is_sent: z.boolean().optional(), // true if the alert has been sent to the user
61
+ message: z.string().optional(), // optional message for the alert
62
+ by_email: z.boolean().optional().default(false), // true if the user wants to receive email alerts for this scenario
63
+ by_whatsapp: z.boolean().optional().default(false), // true if the user wants to receive WhatsApp alerts for this scenario
64
+ emails: z.array(z.string().email()).optional(), // array of email addresses to send alerts to when the scenario score exceeds the alert_threshold
65
+ phone_numbers: z.array(z.string()).optional(), // array of phone numbers to send WhatsApp alerts to when the scenario score exceeds the alert_threshold
66
+ trigger_on: z.enum(['every_new_message', 'condition']).optional(), // JOB - when to trigger the job
67
+ trigger_condition: z.string().optional(), // JOB - condition for triggering the job if trigger_on is set to 'condition'
68
+ });
69
+
54
70
  export const zodQuerySchema = z.object({
55
71
  _id: z.string().optional(),
56
72
  title: z.string().optional(), // optional title for the query
@@ -131,6 +147,7 @@ export const zodJobSchema = z.object({
131
147
  }),
132
148
  )
133
149
  .optional(),
150
+ alert: zodAlertSchema.optional(), // optional alert configuration for the job
134
151
  });
135
152
 
136
153
  export const zodHeatmapSchema = z.object({
@@ -249,20 +266,6 @@ export const scenarioScoreTypeList = [
249
266
  'four_point_scale',
250
267
  ] as const;
251
268
 
252
- export const zodAlertSchema = z.object({
253
- title: z.string().optional(), // optional title for the alert when the scenario score exceeds the alert_threshold
254
- threshold: z.number().optional(), // threshold for the alert
255
- is_on: z.boolean().optional().default(false), // true if the alert is enabled
256
- is_triggered: z.boolean().optional(), // true if the alert has been triggered
257
- triggered_at: z.number().optional(), // date when the alert was triggered
258
- is_sent: z.boolean().optional(), // true if the alert has been sent to the user
259
- message: z.string().optional(), // optional message for the alert
260
- by_email: z.boolean().optional().default(false), // true if the user wants to receive email alerts for this scenario
261
- by_whatsapp: z.boolean().optional().default(false), // true if the user wants to receive WhatsApp alerts for this scenario
262
- emails: z.array(z.string().email()).optional(), // array of email addresses to send alerts to when the scenario score exceeds the alert_threshold
263
- phone_numbers: z.array(z.string()).optional(), // array of phone numbers to send WhatsApp alerts to when the scenario score exceeds the alert_threshold
264
- });
265
-
266
269
  export const zodScenarioScoreSchema = z.object({
267
270
  _id: z.string().optional(),
268
271
  scenario_id: z.string().nonempty('Scenario ID must be provided'), // scenario identifier