asfur 1.0.112 → 1.0.114

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
@@ -424,11 +424,12 @@ 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;
430
- scenario: string;
431
431
  score_type: "ten_score" | "hundred_score" | "percentage_score" | "four_point_scale";
432
+ scenario: string;
432
433
  time_range?: any;
433
434
  schedule?: string | null | undefined;
434
435
  schedule_text?: string | null | undefined;
@@ -440,11 +441,12 @@ 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;
446
- scenario: string;
447
448
  score_type: "ten_score" | "hundred_score" | "percentage_score" | "four_point_scale";
449
+ scenario: string;
448
450
  time_range?: any;
449
451
  schedule?: string | null | undefined;
450
452
  schedule_text?: string | null | undefined;
@@ -456,11 +458,12 @@ 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;
462
- scenario: string;
463
465
  score_type: "ten_score" | "hundred_score" | "percentage_score" | "four_point_scale";
466
+ scenario: string;
464
467
  time_range?: any;
465
468
  schedule?: string | null | undefined;
466
469
  schedule_text?: string | null | undefined;
@@ -486,9 +489,9 @@ export declare const MongoScenarioScoreSchema: Schema<any, import("mongoose").Mo
486
489
  user_id: string;
487
490
  created_at: number;
488
491
  updated_at: number;
489
- score_type: "ten_score" | "hundred_score" | "percentage_score" | "four_point_scale";
490
492
  scenario_id: string;
491
493
  score: number;
494
+ score_type: "ten_score" | "hundred_score" | "percentage_score" | "four_point_scale";
492
495
  key_evidence: any[];
493
496
  text?: string | null | undefined;
494
497
  alert?: any;
@@ -498,9 +501,9 @@ export declare const MongoScenarioScoreSchema: Schema<any, import("mongoose").Mo
498
501
  user_id: string;
499
502
  created_at: number;
500
503
  updated_at: number;
501
- score_type: "ten_score" | "hundred_score" | "percentage_score" | "four_point_scale";
502
504
  scenario_id: string;
503
505
  score: number;
506
+ score_type: "ten_score" | "hundred_score" | "percentage_score" | "four_point_scale";
504
507
  key_evidence: any[];
505
508
  text?: string | null | undefined;
506
509
  alert?: any;
@@ -510,9 +513,9 @@ export declare const MongoScenarioScoreSchema: Schema<any, import("mongoose").Mo
510
513
  user_id: string;
511
514
  created_at: number;
512
515
  updated_at: number;
513
- score_type: "ten_score" | "hundred_score" | "percentage_score" | "four_point_scale";
514
516
  scenario_id: string;
515
517
  score: number;
518
+ score_type: "ten_score" | "hundred_score" | "percentage_score" | "four_point_scale";
516
519
  key_evidence: any[];
517
520
  text?: string | null | undefined;
518
521
  alert?: any;
package/dist/index.js CHANGED
@@ -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 },
package/dist/types.d.ts CHANGED
@@ -947,153 +947,6 @@ export declare const zodAlertSchema: z.ZodObject<{
947
947
  by_whatsapp?: boolean | undefined;
948
948
  phone_numbers?: string[] | undefined;
949
949
  }>;
950
- export declare const zodScenarioSchema: z.ZodObject<{
951
- _id: z.ZodOptional<z.ZodString>;
952
- title: z.ZodString;
953
- scenario: z.ZodString;
954
- geos: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
955
- time_range: z.ZodUnion<[z.ZodObject<{
956
- type: z.ZodLiteral<"relative">;
957
- 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"]>;
958
- }, "strip", z.ZodTypeAny, {
959
- type: "relative";
960
- time: "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";
961
- }, {
962
- type: "relative";
963
- time: "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";
964
- }>, z.ZodObject<{
965
- type: z.ZodLiteral<"absolute">;
966
- start: z.ZodNumber;
967
- end: z.ZodNumber;
968
- }, "strip", z.ZodTypeAny, {
969
- type: "absolute";
970
- start: number;
971
- end: number;
972
- }, {
973
- type: "absolute";
974
- start: number;
975
- end: number;
976
- }>]>;
977
- user_id: z.ZodString;
978
- additional_instructions: z.ZodOptional<z.ZodString>;
979
- status: z.ZodDefault<z.ZodEnum<["active", "inactive"]>>;
980
- score_type: z.ZodEnum<["ten_score", "hundred_score", "percentage_score", "four_point_scale"]>;
981
- schedule: z.ZodOptional<z.ZodString>;
982
- schedule_text: z.ZodOptional<z.ZodString>;
983
- created_at: z.ZodOptional<z.ZodNumber>;
984
- updated_at: z.ZodOptional<z.ZodNumber>;
985
- active_until: z.ZodOptional<z.ZodNumber>;
986
- time_zone: z.ZodOptional<z.ZodString>;
987
- alert: z.ZodOptional<z.ZodObject<{
988
- title: z.ZodOptional<z.ZodString>;
989
- threshold: z.ZodOptional<z.ZodNumber>;
990
- is_on: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
991
- is_triggered: z.ZodOptional<z.ZodBoolean>;
992
- triggered_at: z.ZodOptional<z.ZodNumber>;
993
- is_sent: z.ZodOptional<z.ZodBoolean>;
994
- message: z.ZodOptional<z.ZodString>;
995
- by_email: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
996
- by_whatsapp: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
997
- emails: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
998
- phone_numbers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
999
- }, "strip", z.ZodTypeAny, {
1000
- is_on: boolean;
1001
- by_email: boolean;
1002
- by_whatsapp: boolean;
1003
- message?: string | undefined;
1004
- title?: string | undefined;
1005
- emails?: string[] | undefined;
1006
- threshold?: number | undefined;
1007
- is_triggered?: boolean | undefined;
1008
- triggered_at?: number | undefined;
1009
- is_sent?: boolean | undefined;
1010
- phone_numbers?: string[] | undefined;
1011
- }, {
1012
- message?: string | undefined;
1013
- title?: string | undefined;
1014
- emails?: string[] | undefined;
1015
- threshold?: number | undefined;
1016
- is_on?: boolean | undefined;
1017
- is_triggered?: boolean | undefined;
1018
- triggered_at?: number | undefined;
1019
- is_sent?: boolean | undefined;
1020
- by_email?: boolean | undefined;
1021
- by_whatsapp?: boolean | undefined;
1022
- phone_numbers?: string[] | undefined;
1023
- }>>;
1024
- }, "strip", z.ZodTypeAny, {
1025
- status: "active" | "inactive";
1026
- title: string;
1027
- time_range: {
1028
- type: "relative";
1029
- time: "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";
1030
- } | {
1031
- type: "absolute";
1032
- start: number;
1033
- end: number;
1034
- };
1035
- user_id: string;
1036
- scenario: string;
1037
- score_type: "ten_score" | "hundred_score" | "percentage_score" | "four_point_scale";
1038
- _id?: string | undefined;
1039
- geos?: string[] | undefined;
1040
- created_at?: number | undefined;
1041
- updated_at?: number | undefined;
1042
- schedule?: string | undefined;
1043
- schedule_text?: string | undefined;
1044
- active_until?: number | undefined;
1045
- time_zone?: string | undefined;
1046
- additional_instructions?: string | undefined;
1047
- alert?: {
1048
- is_on: boolean;
1049
- by_email: boolean;
1050
- by_whatsapp: boolean;
1051
- message?: string | undefined;
1052
- title?: string | undefined;
1053
- emails?: string[] | undefined;
1054
- threshold?: number | undefined;
1055
- is_triggered?: boolean | undefined;
1056
- triggered_at?: number | undefined;
1057
- is_sent?: boolean | undefined;
1058
- phone_numbers?: string[] | undefined;
1059
- } | undefined;
1060
- }, {
1061
- title: string;
1062
- time_range: {
1063
- type: "relative";
1064
- time: "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";
1065
- } | {
1066
- type: "absolute";
1067
- start: number;
1068
- end: number;
1069
- };
1070
- user_id: string;
1071
- scenario: string;
1072
- score_type: "ten_score" | "hundred_score" | "percentage_score" | "four_point_scale";
1073
- status?: "active" | "inactive" | undefined;
1074
- _id?: string | undefined;
1075
- geos?: string[] | undefined;
1076
- created_at?: number | undefined;
1077
- updated_at?: number | undefined;
1078
- schedule?: string | undefined;
1079
- schedule_text?: string | undefined;
1080
- active_until?: number | undefined;
1081
- time_zone?: string | undefined;
1082
- additional_instructions?: string | undefined;
1083
- alert?: {
1084
- message?: string | undefined;
1085
- title?: string | undefined;
1086
- emails?: string[] | undefined;
1087
- threshold?: number | undefined;
1088
- is_on?: boolean | undefined;
1089
- is_triggered?: boolean | undefined;
1090
- triggered_at?: number | undefined;
1091
- is_sent?: boolean | undefined;
1092
- by_email?: boolean | undefined;
1093
- by_whatsapp?: boolean | undefined;
1094
- phone_numbers?: string[] | undefined;
1095
- } | undefined;
1096
- }>;
1097
950
  export declare const zodScenarioScoreSchema: z.ZodObject<{
1098
951
  _id: z.ZodOptional<z.ZodString>;
1099
952
  scenario_id: z.ZodString;
@@ -1257,9 +1110,9 @@ export declare const zodScenarioScoreSchema: z.ZodObject<{
1257
1110
  }, "strip", z.ZodTypeAny, {
1258
1111
  text: string;
1259
1112
  user_id: string;
1260
- score_type: "ten_score" | "hundred_score" | "percentage_score" | "four_point_scale";
1261
1113
  scenario_id: string;
1262
1114
  score: number;
1115
+ score_type: "ten_score" | "hundred_score" | "percentage_score" | "four_point_scale";
1263
1116
  heatmap?: {
1264
1117
  user_id: string;
1265
1118
  timestamp: number;
@@ -1313,9 +1166,9 @@ export declare const zodScenarioScoreSchema: z.ZodObject<{
1313
1166
  }, {
1314
1167
  text: string;
1315
1168
  user_id: string;
1316
- score_type: "ten_score" | "hundred_score" | "percentage_score" | "four_point_scale";
1317
1169
  scenario_id: string;
1318
1170
  score: number;
1171
+ score_type: "ten_score" | "hundred_score" | "percentage_score" | "four_point_scale";
1319
1172
  heatmap?: {
1320
1173
  user_id: string;
1321
1174
  timestamp: number;
@@ -1367,6 +1220,543 @@ export declare const zodScenarioScoreSchema: z.ZodObject<{
1367
1220
  }[] | undefined;
1368
1221
  confidence_level?: string | undefined;
1369
1222
  }>;
1223
+ export declare const zodScenarioSchema: z.ZodObject<{
1224
+ _id: z.ZodOptional<z.ZodString>;
1225
+ title: z.ZodString;
1226
+ scenario: z.ZodString;
1227
+ geos: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1228
+ geos_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1229
+ time_range: z.ZodUnion<[z.ZodObject<{
1230
+ type: z.ZodLiteral<"relative">;
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"]>;
1232
+ }, "strip", z.ZodTypeAny, {
1233
+ type: "relative";
1234
+ time: "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";
1235
+ }, {
1236
+ type: "relative";
1237
+ time: "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";
1238
+ }>, z.ZodObject<{
1239
+ type: z.ZodLiteral<"absolute">;
1240
+ start: z.ZodNumber;
1241
+ end: z.ZodNumber;
1242
+ }, "strip", z.ZodTypeAny, {
1243
+ type: "absolute";
1244
+ start: number;
1245
+ end: number;
1246
+ }, {
1247
+ type: "absolute";
1248
+ start: number;
1249
+ end: number;
1250
+ }>]>;
1251
+ user_id: z.ZodString;
1252
+ additional_instructions: z.ZodOptional<z.ZodString>;
1253
+ status: z.ZodDefault<z.ZodEnum<["active", "inactive"]>>;
1254
+ score_type: z.ZodEnum<["ten_score", "hundred_score", "percentage_score", "four_point_scale"]>;
1255
+ schedule: z.ZodOptional<z.ZodString>;
1256
+ schedule_text: z.ZodOptional<z.ZodString>;
1257
+ created_at: z.ZodOptional<z.ZodNumber>;
1258
+ updated_at: z.ZodOptional<z.ZodNumber>;
1259
+ active_until: z.ZodOptional<z.ZodNumber>;
1260
+ time_zone: z.ZodOptional<z.ZodString>;
1261
+ alert: z.ZodOptional<z.ZodObject<{
1262
+ title: z.ZodOptional<z.ZodString>;
1263
+ threshold: z.ZodOptional<z.ZodNumber>;
1264
+ is_on: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1265
+ is_triggered: z.ZodOptional<z.ZodBoolean>;
1266
+ triggered_at: z.ZodOptional<z.ZodNumber>;
1267
+ is_sent: z.ZodOptional<z.ZodBoolean>;
1268
+ message: z.ZodOptional<z.ZodString>;
1269
+ by_email: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1270
+ by_whatsapp: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1271
+ emails: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1272
+ phone_numbers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1273
+ }, "strip", z.ZodTypeAny, {
1274
+ is_on: boolean;
1275
+ by_email: boolean;
1276
+ by_whatsapp: boolean;
1277
+ message?: string | undefined;
1278
+ title?: string | undefined;
1279
+ emails?: string[] | undefined;
1280
+ threshold?: number | undefined;
1281
+ is_triggered?: boolean | undefined;
1282
+ triggered_at?: number | undefined;
1283
+ is_sent?: boolean | undefined;
1284
+ phone_numbers?: string[] | undefined;
1285
+ }, {
1286
+ message?: string | undefined;
1287
+ title?: string | undefined;
1288
+ emails?: string[] | undefined;
1289
+ threshold?: number | undefined;
1290
+ is_on?: boolean | undefined;
1291
+ is_triggered?: boolean | undefined;
1292
+ triggered_at?: number | undefined;
1293
+ is_sent?: boolean | undefined;
1294
+ by_email?: boolean | undefined;
1295
+ by_whatsapp?: boolean | undefined;
1296
+ phone_numbers?: string[] | undefined;
1297
+ }>>;
1298
+ scores: z.ZodOptional<z.ZodArray<z.ZodObject<{
1299
+ _id: z.ZodOptional<z.ZodString>;
1300
+ scenario_id: z.ZodString;
1301
+ user_id: z.ZodString;
1302
+ score: z.ZodNumber;
1303
+ score_type: z.ZodEnum<["ten_score", "hundred_score", "percentage_score", "four_point_scale"]>;
1304
+ text: z.ZodString;
1305
+ heatmap: z.ZodOptional<z.ZodArray<z.ZodObject<{
1306
+ _id: z.ZodOptional<z.ZodString>;
1307
+ user_id: z.ZodString;
1308
+ job_id: z.ZodOptional<z.ZodString>;
1309
+ conversation_id: z.ZodOptional<z.ZodString>;
1310
+ message_id: z.ZodOptional<z.ZodString>;
1311
+ timestamp: z.ZodNumber;
1312
+ location: z.ZodObject<{
1313
+ name: z.ZodString;
1314
+ type: z.ZodString;
1315
+ country: z.ZodString;
1316
+ lat: z.ZodNumber;
1317
+ lng: z.ZodNumber;
1318
+ }, "strip", z.ZodTypeAny, {
1319
+ type: string;
1320
+ name: string;
1321
+ country: string;
1322
+ lat: number;
1323
+ lng: number;
1324
+ }, {
1325
+ type: string;
1326
+ name: string;
1327
+ country: string;
1328
+ lat: number;
1329
+ lng: number;
1330
+ }>;
1331
+ category: z.ZodOptional<z.ZodString>;
1332
+ subcategory: z.ZodOptional<z.ZodString>;
1333
+ intensity: z.ZodOptional<z.ZodNumber>;
1334
+ escalation_risk: z.ZodOptional<z.ZodNumber>;
1335
+ confidence: z.ZodOptional<z.ZodNumber>;
1336
+ summary: z.ZodOptional<z.ZodString>;
1337
+ entities: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1338
+ sources: z.ZodOptional<z.ZodArray<z.ZodObject<{
1339
+ name: z.ZodString;
1340
+ url: z.ZodString;
1341
+ }, "strip", z.ZodTypeAny, {
1342
+ name: string;
1343
+ url: string;
1344
+ }, {
1345
+ name: string;
1346
+ url: string;
1347
+ }>, "many">>;
1348
+ created_at: z.ZodOptional<z.ZodNumber>;
1349
+ updated_at: z.ZodOptional<z.ZodNumber>;
1350
+ }, "strip", z.ZodTypeAny, {
1351
+ user_id: string;
1352
+ timestamp: number;
1353
+ location: {
1354
+ type: string;
1355
+ name: string;
1356
+ country: string;
1357
+ lat: number;
1358
+ lng: number;
1359
+ };
1360
+ _id?: string | undefined;
1361
+ sources?: {
1362
+ name: string;
1363
+ url: string;
1364
+ }[] | undefined;
1365
+ conversation_id?: string | undefined;
1366
+ job_id?: string | undefined;
1367
+ created_at?: number | undefined;
1368
+ updated_at?: number | undefined;
1369
+ message_id?: string | undefined;
1370
+ category?: string | undefined;
1371
+ subcategory?: string | undefined;
1372
+ intensity?: number | undefined;
1373
+ escalation_risk?: number | undefined;
1374
+ confidence?: number | undefined;
1375
+ summary?: string | undefined;
1376
+ entities?: string[] | undefined;
1377
+ }, {
1378
+ user_id: string;
1379
+ timestamp: number;
1380
+ location: {
1381
+ type: string;
1382
+ name: string;
1383
+ country: string;
1384
+ lat: number;
1385
+ lng: number;
1386
+ };
1387
+ _id?: string | undefined;
1388
+ sources?: {
1389
+ name: string;
1390
+ url: string;
1391
+ }[] | undefined;
1392
+ conversation_id?: string | undefined;
1393
+ job_id?: string | undefined;
1394
+ created_at?: number | undefined;
1395
+ updated_at?: number | undefined;
1396
+ message_id?: string | undefined;
1397
+ category?: string | undefined;
1398
+ subcategory?: string | undefined;
1399
+ intensity?: number | undefined;
1400
+ escalation_risk?: number | undefined;
1401
+ confidence?: number | undefined;
1402
+ summary?: string | undefined;
1403
+ entities?: string[] | undefined;
1404
+ }>, "many">>;
1405
+ created_at: z.ZodOptional<z.ZodNumber>;
1406
+ updated_at: z.ZodOptional<z.ZodNumber>;
1407
+ alert: z.ZodOptional<z.ZodObject<{
1408
+ title: z.ZodOptional<z.ZodString>;
1409
+ threshold: z.ZodOptional<z.ZodNumber>;
1410
+ is_on: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1411
+ is_triggered: z.ZodOptional<z.ZodBoolean>;
1412
+ triggered_at: z.ZodOptional<z.ZodNumber>;
1413
+ is_sent: z.ZodOptional<z.ZodBoolean>;
1414
+ message: z.ZodOptional<z.ZodString>;
1415
+ by_email: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1416
+ by_whatsapp: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1417
+ emails: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1418
+ phone_numbers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1419
+ }, "strip", z.ZodTypeAny, {
1420
+ is_on: boolean;
1421
+ by_email: boolean;
1422
+ by_whatsapp: boolean;
1423
+ message?: string | undefined;
1424
+ title?: string | undefined;
1425
+ emails?: string[] | undefined;
1426
+ threshold?: number | undefined;
1427
+ is_triggered?: boolean | undefined;
1428
+ triggered_at?: number | undefined;
1429
+ is_sent?: boolean | undefined;
1430
+ phone_numbers?: string[] | undefined;
1431
+ }, {
1432
+ message?: string | undefined;
1433
+ title?: string | undefined;
1434
+ emails?: string[] | undefined;
1435
+ threshold?: number | undefined;
1436
+ is_on?: boolean | undefined;
1437
+ is_triggered?: boolean | undefined;
1438
+ triggered_at?: number | undefined;
1439
+ is_sent?: boolean | undefined;
1440
+ by_email?: boolean | undefined;
1441
+ by_whatsapp?: boolean | undefined;
1442
+ phone_numbers?: string[] | undefined;
1443
+ }>>;
1444
+ key_evidence: z.ZodOptional<z.ZodArray<z.ZodObject<{
1445
+ evidence: z.ZodString;
1446
+ url: z.ZodOptional<z.ZodString>;
1447
+ source_name: z.ZodOptional<z.ZodString>;
1448
+ }, "strip", z.ZodTypeAny, {
1449
+ evidence: string;
1450
+ url?: string | undefined;
1451
+ source_name?: string | undefined;
1452
+ }, {
1453
+ evidence: string;
1454
+ url?: string | undefined;
1455
+ source_name?: string | undefined;
1456
+ }>, "many">>;
1457
+ confidence_level: z.ZodOptional<z.ZodString>;
1458
+ }, "strip", z.ZodTypeAny, {
1459
+ text: string;
1460
+ user_id: string;
1461
+ scenario_id: string;
1462
+ score: number;
1463
+ score_type: "ten_score" | "hundred_score" | "percentage_score" | "four_point_scale";
1464
+ heatmap?: {
1465
+ user_id: string;
1466
+ timestamp: number;
1467
+ location: {
1468
+ type: string;
1469
+ name: string;
1470
+ country: string;
1471
+ lat: number;
1472
+ lng: number;
1473
+ };
1474
+ _id?: string | undefined;
1475
+ sources?: {
1476
+ name: string;
1477
+ url: string;
1478
+ }[] | undefined;
1479
+ conversation_id?: string | undefined;
1480
+ job_id?: string | undefined;
1481
+ created_at?: number | undefined;
1482
+ updated_at?: number | undefined;
1483
+ message_id?: string | undefined;
1484
+ category?: string | undefined;
1485
+ subcategory?: string | undefined;
1486
+ intensity?: number | undefined;
1487
+ escalation_risk?: number | undefined;
1488
+ confidence?: number | undefined;
1489
+ summary?: string | undefined;
1490
+ entities?: string[] | undefined;
1491
+ }[] | undefined;
1492
+ _id?: string | undefined;
1493
+ created_at?: number | undefined;
1494
+ updated_at?: number | undefined;
1495
+ alert?: {
1496
+ is_on: boolean;
1497
+ by_email: boolean;
1498
+ by_whatsapp: boolean;
1499
+ message?: string | undefined;
1500
+ title?: string | undefined;
1501
+ emails?: string[] | undefined;
1502
+ threshold?: number | undefined;
1503
+ is_triggered?: boolean | undefined;
1504
+ triggered_at?: number | undefined;
1505
+ is_sent?: boolean | undefined;
1506
+ phone_numbers?: string[] | undefined;
1507
+ } | undefined;
1508
+ key_evidence?: {
1509
+ evidence: string;
1510
+ url?: string | undefined;
1511
+ source_name?: string | undefined;
1512
+ }[] | undefined;
1513
+ confidence_level?: string | undefined;
1514
+ }, {
1515
+ text: string;
1516
+ user_id: string;
1517
+ scenario_id: string;
1518
+ score: number;
1519
+ score_type: "ten_score" | "hundred_score" | "percentage_score" | "four_point_scale";
1520
+ heatmap?: {
1521
+ user_id: string;
1522
+ timestamp: number;
1523
+ location: {
1524
+ type: string;
1525
+ name: string;
1526
+ country: string;
1527
+ lat: number;
1528
+ lng: number;
1529
+ };
1530
+ _id?: string | undefined;
1531
+ sources?: {
1532
+ name: string;
1533
+ url: string;
1534
+ }[] | undefined;
1535
+ conversation_id?: string | undefined;
1536
+ job_id?: string | undefined;
1537
+ created_at?: number | undefined;
1538
+ updated_at?: number | undefined;
1539
+ message_id?: string | undefined;
1540
+ category?: string | undefined;
1541
+ subcategory?: string | undefined;
1542
+ intensity?: number | undefined;
1543
+ escalation_risk?: number | undefined;
1544
+ confidence?: number | undefined;
1545
+ summary?: string | undefined;
1546
+ entities?: string[] | undefined;
1547
+ }[] | undefined;
1548
+ _id?: string | undefined;
1549
+ created_at?: number | undefined;
1550
+ updated_at?: number | undefined;
1551
+ alert?: {
1552
+ message?: string | undefined;
1553
+ title?: string | undefined;
1554
+ emails?: string[] | undefined;
1555
+ threshold?: number | undefined;
1556
+ is_on?: boolean | undefined;
1557
+ is_triggered?: boolean | undefined;
1558
+ triggered_at?: number | undefined;
1559
+ is_sent?: boolean | undefined;
1560
+ by_email?: boolean | undefined;
1561
+ by_whatsapp?: boolean | undefined;
1562
+ phone_numbers?: string[] | undefined;
1563
+ } | undefined;
1564
+ key_evidence?: {
1565
+ evidence: string;
1566
+ url?: string | undefined;
1567
+ source_name?: string | undefined;
1568
+ }[] | undefined;
1569
+ confidence_level?: string | undefined;
1570
+ }>, "many">>;
1571
+ }, "strip", z.ZodTypeAny, {
1572
+ status: "active" | "inactive";
1573
+ title: string;
1574
+ time_range: {
1575
+ type: "relative";
1576
+ time: "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";
1577
+ } | {
1578
+ type: "absolute";
1579
+ start: number;
1580
+ end: number;
1581
+ };
1582
+ user_id: string;
1583
+ score_type: "ten_score" | "hundred_score" | "percentage_score" | "four_point_scale";
1584
+ scenario: string;
1585
+ _id?: string | undefined;
1586
+ geos?: string[] | undefined;
1587
+ geos_ids?: string[] | undefined;
1588
+ created_at?: number | undefined;
1589
+ updated_at?: number | undefined;
1590
+ schedule?: string | undefined;
1591
+ schedule_text?: string | undefined;
1592
+ active_until?: number | undefined;
1593
+ time_zone?: string | undefined;
1594
+ additional_instructions?: string | undefined;
1595
+ alert?: {
1596
+ is_on: boolean;
1597
+ by_email: boolean;
1598
+ by_whatsapp: boolean;
1599
+ message?: string | undefined;
1600
+ title?: string | undefined;
1601
+ emails?: string[] | undefined;
1602
+ threshold?: number | undefined;
1603
+ is_triggered?: boolean | undefined;
1604
+ triggered_at?: number | undefined;
1605
+ is_sent?: boolean | undefined;
1606
+ phone_numbers?: string[] | undefined;
1607
+ } | undefined;
1608
+ scores?: {
1609
+ text: string;
1610
+ user_id: string;
1611
+ scenario_id: string;
1612
+ score: number;
1613
+ score_type: "ten_score" | "hundred_score" | "percentage_score" | "four_point_scale";
1614
+ heatmap?: {
1615
+ user_id: string;
1616
+ timestamp: number;
1617
+ location: {
1618
+ type: string;
1619
+ name: string;
1620
+ country: string;
1621
+ lat: number;
1622
+ lng: number;
1623
+ };
1624
+ _id?: string | undefined;
1625
+ sources?: {
1626
+ name: string;
1627
+ url: string;
1628
+ }[] | undefined;
1629
+ conversation_id?: string | undefined;
1630
+ job_id?: string | undefined;
1631
+ created_at?: number | undefined;
1632
+ updated_at?: number | undefined;
1633
+ message_id?: string | undefined;
1634
+ category?: string | undefined;
1635
+ subcategory?: string | undefined;
1636
+ intensity?: number | undefined;
1637
+ escalation_risk?: number | undefined;
1638
+ confidence?: number | undefined;
1639
+ summary?: string | undefined;
1640
+ entities?: string[] | undefined;
1641
+ }[] | undefined;
1642
+ _id?: string | undefined;
1643
+ created_at?: number | undefined;
1644
+ updated_at?: number | undefined;
1645
+ alert?: {
1646
+ is_on: boolean;
1647
+ by_email: boolean;
1648
+ by_whatsapp: boolean;
1649
+ message?: string | undefined;
1650
+ title?: string | undefined;
1651
+ emails?: string[] | undefined;
1652
+ threshold?: number | undefined;
1653
+ is_triggered?: boolean | undefined;
1654
+ triggered_at?: number | undefined;
1655
+ is_sent?: boolean | undefined;
1656
+ phone_numbers?: string[] | undefined;
1657
+ } | undefined;
1658
+ key_evidence?: {
1659
+ evidence: string;
1660
+ url?: string | undefined;
1661
+ source_name?: string | undefined;
1662
+ }[] | undefined;
1663
+ confidence_level?: string | undefined;
1664
+ }[] | undefined;
1665
+ }, {
1666
+ title: string;
1667
+ time_range: {
1668
+ type: "relative";
1669
+ time: "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";
1670
+ } | {
1671
+ type: "absolute";
1672
+ start: number;
1673
+ end: number;
1674
+ };
1675
+ user_id: string;
1676
+ score_type: "ten_score" | "hundred_score" | "percentage_score" | "four_point_scale";
1677
+ scenario: string;
1678
+ status?: "active" | "inactive" | undefined;
1679
+ _id?: string | undefined;
1680
+ geos?: string[] | undefined;
1681
+ geos_ids?: string[] | undefined;
1682
+ created_at?: number | undefined;
1683
+ updated_at?: number | undefined;
1684
+ schedule?: string | undefined;
1685
+ schedule_text?: string | undefined;
1686
+ active_until?: number | undefined;
1687
+ time_zone?: string | undefined;
1688
+ additional_instructions?: string | undefined;
1689
+ alert?: {
1690
+ message?: string | undefined;
1691
+ title?: string | undefined;
1692
+ emails?: string[] | undefined;
1693
+ threshold?: number | undefined;
1694
+ is_on?: boolean | undefined;
1695
+ is_triggered?: boolean | undefined;
1696
+ triggered_at?: number | undefined;
1697
+ is_sent?: boolean | undefined;
1698
+ by_email?: boolean | undefined;
1699
+ by_whatsapp?: boolean | undefined;
1700
+ phone_numbers?: string[] | undefined;
1701
+ } | undefined;
1702
+ scores?: {
1703
+ text: string;
1704
+ user_id: string;
1705
+ scenario_id: string;
1706
+ score: number;
1707
+ score_type: "ten_score" | "hundred_score" | "percentage_score" | "four_point_scale";
1708
+ heatmap?: {
1709
+ user_id: string;
1710
+ timestamp: number;
1711
+ location: {
1712
+ type: string;
1713
+ name: string;
1714
+ country: string;
1715
+ lat: number;
1716
+ lng: number;
1717
+ };
1718
+ _id?: string | undefined;
1719
+ sources?: {
1720
+ name: string;
1721
+ url: string;
1722
+ }[] | undefined;
1723
+ conversation_id?: string | undefined;
1724
+ job_id?: string | undefined;
1725
+ created_at?: number | undefined;
1726
+ updated_at?: number | undefined;
1727
+ message_id?: string | undefined;
1728
+ category?: string | undefined;
1729
+ subcategory?: string | undefined;
1730
+ intensity?: number | undefined;
1731
+ escalation_risk?: number | undefined;
1732
+ confidence?: number | undefined;
1733
+ summary?: string | undefined;
1734
+ entities?: string[] | undefined;
1735
+ }[] | undefined;
1736
+ _id?: string | undefined;
1737
+ created_at?: number | undefined;
1738
+ updated_at?: number | undefined;
1739
+ alert?: {
1740
+ message?: string | undefined;
1741
+ title?: string | undefined;
1742
+ emails?: string[] | undefined;
1743
+ threshold?: number | undefined;
1744
+ is_on?: boolean | undefined;
1745
+ is_triggered?: boolean | undefined;
1746
+ triggered_at?: number | undefined;
1747
+ is_sent?: boolean | undefined;
1748
+ by_email?: boolean | undefined;
1749
+ by_whatsapp?: boolean | undefined;
1750
+ phone_numbers?: string[] | undefined;
1751
+ } | undefined;
1752
+ key_evidence?: {
1753
+ evidence: string;
1754
+ url?: string | undefined;
1755
+ source_name?: string | undefined;
1756
+ }[] | undefined;
1757
+ confidence_level?: string | undefined;
1758
+ }[] | undefined;
1759
+ }>;
1370
1760
  /**
1371
1761
  * 'approved' - active and approved sources,
1372
1762
  * 'back_to_business' - sources that were paused and now resumed,
package/dist/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zodScenarioScoreSchema = exports.zodScenarioSchema = 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.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'];
@@ -230,24 +230,6 @@ exports.zodAlertSchema = zod_1.z.object({
230
230
  emails: zod_1.z.array(zod_1.z.string().email()).optional(),
231
231
  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
232
232
  });
233
- exports.zodScenarioSchema = zod_1.z.object({
234
- _id: zod_1.z.string().optional(),
235
- title: zod_1.z.string().nonempty('Scenario title must be provided'),
236
- scenario: zod_1.z.string().nonempty('Scenario must be provided'),
237
- geos: zod_1.z.array(zod_1.z.string()).optional(),
238
- time_range: exports.zodRelativeTimeRangeSchema.or(exports.zodAbsoluteTimeRangeSchema),
239
- user_id: zod_1.z.string().nonempty('User ID must be provided'),
240
- additional_instructions: zod_1.z.string().optional(),
241
- status: zod_1.z.enum(exports.generalStatusList).default('active'),
242
- score_type: zod_1.z.enum(exports.scenarioScoreTypeList),
243
- schedule: zod_1.z.string().optional(),
244
- schedule_text: zod_1.z.string().optional(),
245
- created_at: zod_1.z.number().optional(),
246
- updated_at: zod_1.z.number().optional(),
247
- active_until: zod_1.z.number().optional(),
248
- time_zone: zod_1.z.string().optional(),
249
- alert: exports.zodAlertSchema.optional(), // optional alert configuration for the scenario
250
- });
251
233
  exports.zodScenarioScoreSchema = zod_1.z.object({
252
234
  _id: zod_1.z.string().optional(),
253
235
  scenario_id: zod_1.z.string().nonempty('Scenario ID must be provided'),
@@ -268,3 +250,23 @@ exports.zodScenarioScoreSchema = zod_1.z.object({
268
250
  .optional(),
269
251
  confidence_level: zod_1.z.string().optional(), // optional confidence level for the score (e.g., "high", "medium", "low")
270
252
  });
253
+ exports.zodScenarioSchema = zod_1.z.object({
254
+ _id: zod_1.z.string().optional(),
255
+ title: zod_1.z.string().nonempty('Scenario title must be provided'),
256
+ scenario: zod_1.z.string().nonempty('Scenario must be provided'),
257
+ geos: zod_1.z.array(zod_1.z.string()).optional(),
258
+ geos_ids: zod_1.z.array(zod_1.z.string()).optional(),
259
+ time_range: exports.zodRelativeTimeRangeSchema.or(exports.zodAbsoluteTimeRangeSchema),
260
+ user_id: zod_1.z.string().nonempty('User ID must be provided'),
261
+ additional_instructions: zod_1.z.string().optional(),
262
+ status: zod_1.z.enum(exports.generalStatusList).default('active'),
263
+ score_type: zod_1.z.enum(exports.scenarioScoreTypeList),
264
+ schedule: zod_1.z.string().optional(),
265
+ schedule_text: zod_1.z.string().optional(),
266
+ created_at: zod_1.z.number().optional(),
267
+ updated_at: zod_1.z.number().optional(),
268
+ active_until: zod_1.z.number().optional(),
269
+ time_zone: zod_1.z.string().optional(),
270
+ alert: exports.zodAlertSchema.optional(),
271
+ scores: zod_1.z.array(exports.zodScenarioScoreSchema).optional(), // array of scenario scores associated with the scenario
272
+ });
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asfur",
3
- "version": "1.0.112",
3
+ "version": "1.0.114",
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
@@ -276,25 +276,6 @@ export const zodAlertSchema = z.object({
276
276
  phone_numbers: z.array(z.string()).optional(), // array of phone numbers to send WhatsApp alerts to when the scenario score exceeds the alert_threshold
277
277
  });
278
278
 
279
- export const zodScenarioSchema = z.object({
280
- _id: z.string().optional(),
281
- title: z.string().nonempty('Scenario title must be provided'), // title of the scenario
282
- scenario: z.string().nonempty('Scenario must be provided'), // the actual scenario
283
- geos: z.array(z.string()).optional(), // array of geo strings
284
- time_range: zodRelativeTimeRangeSchema.or(zodAbsoluteTimeRangeSchema), // optional time range for the query
285
- user_id: z.string().nonempty('User ID must be provided'), // user identifier
286
- additional_instructions: z.string().optional(), // optional additional instructions for the scenario
287
- status: z.enum(generalStatusList).default('active'), // status of the scenario
288
- score_type: z.enum(scenarioScoreTypeList), // type of the scenario
289
- schedule: z.string().optional(), // cron schedule for the scenario
290
- schedule_text: z.string().optional(), // cron schedule in free-text format
291
- created_at: z.number().optional(), // creation date
292
- updated_at: z.number().optional(), // last update date
293
- active_until: z.number().optional(), // optional date until which the scenario is active
294
- time_zone: z.string().optional(), // optional timezone for the scenario
295
- alert: zodAlertSchema.optional(), // optional alert configuration for the scenario
296
- });
297
-
298
279
  export const zodScenarioScoreSchema = z.object({
299
280
  _id: z.string().optional(),
300
281
  scenario_id: z.string().nonempty('Scenario ID must be provided'), // scenario identifier
@@ -318,6 +299,27 @@ export const zodScenarioScoreSchema = z.object({
318
299
  confidence_level: z.string().optional(), // optional confidence level for the score (e.g., "high", "medium", "low")
319
300
  });
320
301
 
302
+ export const zodScenarioSchema = z.object({
303
+ _id: z.string().optional(),
304
+ title: z.string().nonempty('Scenario title must be provided'), // title of the scenario
305
+ scenario: z.string().nonempty('Scenario must be provided'), // the actual scenario
306
+ geos: z.array(z.string()).optional(), // array of geo strings
307
+ geos_ids: z.array(z.string()).optional(), // array of geo _id strings
308
+ time_range: zodRelativeTimeRangeSchema.or(zodAbsoluteTimeRangeSchema), // optional time range for the query
309
+ user_id: z.string().nonempty('User ID must be provided'), // user identifier
310
+ additional_instructions: z.string().optional(), // optional additional instructions for the scenario
311
+ status: z.enum(generalStatusList).default('active'), // status of the scenario
312
+ score_type: z.enum(scenarioScoreTypeList), // type of the scenario
313
+ schedule: z.string().optional(), // cron schedule for the scenario
314
+ schedule_text: z.string().optional(), // cron schedule in free-text format
315
+ created_at: z.number().optional(), // creation date
316
+ updated_at: z.number().optional(), // last update date
317
+ active_until: z.number().optional(), // optional date until which the scenario is active
318
+ time_zone: z.string().optional(), // optional timezone for the scenario
319
+ alert: zodAlertSchema.optional(), // optional alert configuration for the scenario
320
+ scores: z.array(zodScenarioScoreSchema).optional(), // array of scenario scores associated with the scenario
321
+ });
322
+
321
323
  /**
322
324
  * 'approved' - active and approved sources,
323
325
  * 'back_to_business' - sources that were paused and now resumed,