asfur 1.0.130 → 1.0.132
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 +86 -0
- package/dist/index.js +25 -1
- package/dist/types.d.ts +52 -0
- package/dist/types.js +22 -2
- package/index.ts +33 -0
- package/package.json +1 -1
- package/types.ts +25 -1
package/dist/index.d.ts
CHANGED
|
@@ -867,3 +867,89 @@ export declare const MongoGeoSelectionGroupSchema: Schema<any, import("mongoose"
|
|
|
867
867
|
} & {
|
|
868
868
|
__v: number;
|
|
869
869
|
}>;
|
|
870
|
+
export declare const MongoFavoriteEventSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
871
|
+
versionKey: false;
|
|
872
|
+
toJSON: {
|
|
873
|
+
virtuals: true;
|
|
874
|
+
};
|
|
875
|
+
toObject: {
|
|
876
|
+
virtuals: true;
|
|
877
|
+
};
|
|
878
|
+
}, {
|
|
879
|
+
user_id: string;
|
|
880
|
+
created_at: number;
|
|
881
|
+
updated_at: number;
|
|
882
|
+
event_id: string;
|
|
883
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
884
|
+
user_id: string;
|
|
885
|
+
created_at: number;
|
|
886
|
+
updated_at: number;
|
|
887
|
+
event_id: string;
|
|
888
|
+
}>, {}> & import("mongoose").FlatRecord<{
|
|
889
|
+
user_id: string;
|
|
890
|
+
created_at: number;
|
|
891
|
+
updated_at: number;
|
|
892
|
+
event_id: string;
|
|
893
|
+
}> & {
|
|
894
|
+
_id: import("mongoose").Types.ObjectId;
|
|
895
|
+
} & {
|
|
896
|
+
__v: number;
|
|
897
|
+
}>;
|
|
898
|
+
export declare const MongoPolygonSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
899
|
+
versionKey: false;
|
|
900
|
+
toJSON: {
|
|
901
|
+
virtuals: true;
|
|
902
|
+
};
|
|
903
|
+
toObject: {
|
|
904
|
+
virtuals: true;
|
|
905
|
+
};
|
|
906
|
+
}, {
|
|
907
|
+
title: string;
|
|
908
|
+
user_id: string;
|
|
909
|
+
created_at: number;
|
|
910
|
+
updated_at: number;
|
|
911
|
+
region_id: string;
|
|
912
|
+
coordinates: import("mongoose").Types.DocumentArray<{
|
|
913
|
+
[x: number]: number[];
|
|
914
|
+
}, import("mongoose").Types.Subdocument<unknown, any, {
|
|
915
|
+
[x: number]: number[];
|
|
916
|
+
}> & {
|
|
917
|
+
[x: number]: number[];
|
|
918
|
+
}>;
|
|
919
|
+
description?: string | null | undefined;
|
|
920
|
+
color?: string | null | undefined;
|
|
921
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
922
|
+
title: string;
|
|
923
|
+
user_id: string;
|
|
924
|
+
created_at: number;
|
|
925
|
+
updated_at: number;
|
|
926
|
+
region_id: string;
|
|
927
|
+
coordinates: import("mongoose").Types.DocumentArray<{
|
|
928
|
+
[x: number]: number[];
|
|
929
|
+
}, import("mongoose").Types.Subdocument<unknown, any, {
|
|
930
|
+
[x: number]: number[];
|
|
931
|
+
}> & {
|
|
932
|
+
[x: number]: number[];
|
|
933
|
+
}>;
|
|
934
|
+
description?: string | null | undefined;
|
|
935
|
+
color?: string | null | undefined;
|
|
936
|
+
}>, {}> & import("mongoose").FlatRecord<{
|
|
937
|
+
title: string;
|
|
938
|
+
user_id: string;
|
|
939
|
+
created_at: number;
|
|
940
|
+
updated_at: number;
|
|
941
|
+
region_id: string;
|
|
942
|
+
coordinates: import("mongoose").Types.DocumentArray<{
|
|
943
|
+
[x: number]: number[];
|
|
944
|
+
}, import("mongoose").Types.Subdocument<unknown, any, {
|
|
945
|
+
[x: number]: number[];
|
|
946
|
+
}> & {
|
|
947
|
+
[x: number]: number[];
|
|
948
|
+
}>;
|
|
949
|
+
description?: string | null | undefined;
|
|
950
|
+
color?: string | null | undefined;
|
|
951
|
+
}> & {
|
|
952
|
+
_id: import("mongoose").Types.ObjectId;
|
|
953
|
+
} & {
|
|
954
|
+
__v: number;
|
|
955
|
+
}>;
|
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.MongoGeoSelectionGroupSchema = exports.MongoPredefinedQuerySchema = exports.MongoSendWhatsappSchema = 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;
|
|
17
|
+
exports.MongoPolygonSchema = exports.MongoFavoriteEventSchema = exports.MongoGeoSelectionGroupSchema = exports.MongoPredefinedQuerySchema = exports.MongoSendWhatsappSchema = 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");
|
|
@@ -346,3 +346,27 @@ exports.MongoGeoSelectionGroupSchema = new mongoose_1.Schema({
|
|
|
346
346
|
toJSON: { virtuals: true },
|
|
347
347
|
toObject: { virtuals: true },
|
|
348
348
|
});
|
|
349
|
+
exports.MongoFavoriteEventSchema = new mongoose_1.Schema({
|
|
350
|
+
user_id: { type: String, required: true },
|
|
351
|
+
event_id: { type: String, required: true },
|
|
352
|
+
created_at: { type: Number, default: Date.now },
|
|
353
|
+
updated_at: { type: Number, default: Date.now }, // last update date
|
|
354
|
+
}, {
|
|
355
|
+
versionKey: false,
|
|
356
|
+
toJSON: { virtuals: true },
|
|
357
|
+
toObject: { virtuals: true },
|
|
358
|
+
});
|
|
359
|
+
exports.MongoPolygonSchema = new mongoose_1.Schema({
|
|
360
|
+
user_id: { type: String, required: true },
|
|
361
|
+
region_id: { type: String, required: true },
|
|
362
|
+
title: { type: String, required: true },
|
|
363
|
+
description: { type: String },
|
|
364
|
+
coordinates: { type: [[[Number]]], required: true },
|
|
365
|
+
created_at: { type: Number, default: Date.now },
|
|
366
|
+
updated_at: { type: Number, default: Date.now },
|
|
367
|
+
color: { type: String }, // optional color for displaying the polygon on the mapF
|
|
368
|
+
}, {
|
|
369
|
+
versionKey: false,
|
|
370
|
+
toJSON: { virtuals: true },
|
|
371
|
+
toObject: { virtuals: true },
|
|
372
|
+
});
|
package/dist/types.d.ts
CHANGED
|
@@ -2275,6 +2275,56 @@ export declare const zodGeoSelectionGroupSchema: z.ZodObject<{
|
|
|
2275
2275
|
lng?: number | undefined;
|
|
2276
2276
|
}[] | undefined;
|
|
2277
2277
|
}>;
|
|
2278
|
+
export declare const zodFavoriteEventSchema: z.ZodObject<{
|
|
2279
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
2280
|
+
user_id: z.ZodString;
|
|
2281
|
+
event_id: z.ZodString;
|
|
2282
|
+
created_at: z.ZodOptional<z.ZodNumber>;
|
|
2283
|
+
updated_at: z.ZodOptional<z.ZodNumber>;
|
|
2284
|
+
}, "strip", z.ZodTypeAny, {
|
|
2285
|
+
user_id: string;
|
|
2286
|
+
event_id: string;
|
|
2287
|
+
_id?: string | undefined;
|
|
2288
|
+
created_at?: number | undefined;
|
|
2289
|
+
updated_at?: number | undefined;
|
|
2290
|
+
}, {
|
|
2291
|
+
user_id: string;
|
|
2292
|
+
event_id: string;
|
|
2293
|
+
_id?: string | undefined;
|
|
2294
|
+
created_at?: number | undefined;
|
|
2295
|
+
updated_at?: number | undefined;
|
|
2296
|
+
}>;
|
|
2297
|
+
export declare const zodPolygonSchema: z.ZodObject<{
|
|
2298
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
2299
|
+
user_id: z.ZodString;
|
|
2300
|
+
region_id: z.ZodString;
|
|
2301
|
+
title: z.ZodString;
|
|
2302
|
+
description: z.ZodOptional<z.ZodString>;
|
|
2303
|
+
coordinates: z.ZodArray<z.ZodArray<z.ZodArray<z.ZodNumber, "many">, "many">, "many">;
|
|
2304
|
+
created_at: z.ZodOptional<z.ZodNumber>;
|
|
2305
|
+
updated_at: z.ZodOptional<z.ZodNumber>;
|
|
2306
|
+
color: z.ZodOptional<z.ZodString>;
|
|
2307
|
+
}, "strip", z.ZodTypeAny, {
|
|
2308
|
+
title: string;
|
|
2309
|
+
user_id: string;
|
|
2310
|
+
region_id: string;
|
|
2311
|
+
coordinates: number[][][];
|
|
2312
|
+
_id?: string | undefined;
|
|
2313
|
+
created_at?: number | undefined;
|
|
2314
|
+
updated_at?: number | undefined;
|
|
2315
|
+
description?: string | undefined;
|
|
2316
|
+
color?: string | undefined;
|
|
2317
|
+
}, {
|
|
2318
|
+
title: string;
|
|
2319
|
+
user_id: string;
|
|
2320
|
+
region_id: string;
|
|
2321
|
+
coordinates: number[][][];
|
|
2322
|
+
_id?: string | undefined;
|
|
2323
|
+
created_at?: number | undefined;
|
|
2324
|
+
updated_at?: number | undefined;
|
|
2325
|
+
description?: string | undefined;
|
|
2326
|
+
color?: string | undefined;
|
|
2327
|
+
}>;
|
|
2278
2328
|
/**
|
|
2279
2329
|
* 'approved' - active and approved sources,
|
|
2280
2330
|
* 'back_to_business' - sources that were paused and now resumed,
|
|
@@ -2303,6 +2353,8 @@ export type SendEmailType = z.infer<typeof zodSendEmailSchema>;
|
|
|
2303
2353
|
export type SendWhatsappType = z.infer<typeof zodSendWhatsappSchema>;
|
|
2304
2354
|
export type PredefinedQueryType = z.infer<typeof zodPredefinedQuerySchema>;
|
|
2305
2355
|
export type GeoSelectionGroupType = z.infer<typeof zodGeoSelectionGroupSchema>;
|
|
2356
|
+
export type FavoriteEventType = z.infer<typeof zodFavoriteEventSchema>;
|
|
2357
|
+
export type PolygonType = z.infer<typeof zodPolygonSchema>;
|
|
2306
2358
|
export type UserPublicMetadata = {
|
|
2307
2359
|
is_admin?: boolean;
|
|
2308
2360
|
regions?: {
|
package/dist/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.zodGeoSelectionGroupSchema = exports.zodPredefinedQuerySchema = exports.zodSendWhatsappSchema = 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;
|
|
3
|
+
exports.zodPolygonSchema = exports.zodFavoriteEventSchema = exports.zodGeoSelectionGroupSchema = exports.zodPredefinedQuerySchema = exports.zodSendWhatsappSchema = 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 harvester_sdk_1 = require("harvester_sdk");
|
|
5
5
|
const zod_1 = require("zod");
|
|
6
6
|
exports.generalStatusList = ['active', 'inactive'];
|
|
@@ -303,7 +303,9 @@ exports.zodPredefinedQuerySchema = zod_1.z.object({
|
|
|
303
303
|
geos_ids: zod_1.z
|
|
304
304
|
.array(zod_1.z.string().or(zod_1.z.object({ _id: zod_1.z.string(), name: zod_1.z.string() })))
|
|
305
305
|
.optional(),
|
|
306
|
-
time_range: exports.zodRelativeTimeRangeSchema
|
|
306
|
+
time_range: exports.zodRelativeTimeRangeSchema
|
|
307
|
+
.or(exports.zodAbsoluteTimeRangeSchema)
|
|
308
|
+
.optional(),
|
|
307
309
|
user_instructions: zod_1.z.string().optional(),
|
|
308
310
|
status: zod_1.z.enum(exports.generalStatusList).default('active').optional(),
|
|
309
311
|
created_at: zod_1.z.number().optional(),
|
|
@@ -321,3 +323,21 @@ exports.zodGeoSelectionGroupSchema = zod_1.z.object({
|
|
|
321
323
|
geo_selections_ids: zod_1.z.array(zod_1.z.string()).optional(),
|
|
322
324
|
geo_selections: harvester_sdk_1.zodGeoSelectionSchema.array().optional(), // array of geo selection objects
|
|
323
325
|
});
|
|
326
|
+
exports.zodFavoriteEventSchema = zod_1.z.object({
|
|
327
|
+
_id: zod_1.z.string().optional(),
|
|
328
|
+
user_id: zod_1.z.string(),
|
|
329
|
+
event_id: zod_1.z.string(),
|
|
330
|
+
created_at: zod_1.z.number().optional(),
|
|
331
|
+
updated_at: zod_1.z.number().optional(), // last update date
|
|
332
|
+
});
|
|
333
|
+
exports.zodPolygonSchema = zod_1.z.object({
|
|
334
|
+
_id: zod_1.z.string().optional(),
|
|
335
|
+
user_id: zod_1.z.string(),
|
|
336
|
+
region_id: zod_1.z.string(),
|
|
337
|
+
title: zod_1.z.string(),
|
|
338
|
+
description: zod_1.z.string().optional(),
|
|
339
|
+
coordinates: zod_1.z.array(zod_1.z.array(zod_1.z.array(zod_1.z.number()))),
|
|
340
|
+
created_at: zod_1.z.number().optional(),
|
|
341
|
+
updated_at: zod_1.z.number().optional(),
|
|
342
|
+
color: zod_1.z.string().optional(), // optional color for displaying the polygon on the map
|
|
343
|
+
});
|
package/index.ts
CHANGED
|
@@ -400,3 +400,36 @@ export const MongoGeoSelectionGroupSchema = new Schema(
|
|
|
400
400
|
},
|
|
401
401
|
);
|
|
402
402
|
|
|
403
|
+
export const MongoFavoriteEventSchema = new Schema(
|
|
404
|
+
{
|
|
405
|
+
user_id: { type: String, required: true }, // user identifier
|
|
406
|
+
event_id: { type: String, required: true }, // event identifier
|
|
407
|
+
created_at: { type: Number, default: Date.now }, // creation date
|
|
408
|
+
updated_at: { type: Number, default: Date.now }, // last update date
|
|
409
|
+
},
|
|
410
|
+
{
|
|
411
|
+
versionKey: false,
|
|
412
|
+
toJSON: { virtuals: true },
|
|
413
|
+
toObject: { virtuals: true },
|
|
414
|
+
},
|
|
415
|
+
);
|
|
416
|
+
|
|
417
|
+
export const MongoPolygonSchema = new Schema(
|
|
418
|
+
{
|
|
419
|
+
user_id: { type: String, required: true }, // user identifier
|
|
420
|
+
region_id: { type: String, required: true }, // e.g., region ID
|
|
421
|
+
title: { type: String, required: true }, // e.g., "Zarqa city center"
|
|
422
|
+
description: { type: String }, // e.g., "Description of the area"
|
|
423
|
+
coordinates: { type: [[[Number]]], required: true }, // array of linear rings, where each linear ring is an array of [longitude, latitude] pairs
|
|
424
|
+
created_at: { type: Number, default: Date.now }, // creation date
|
|
425
|
+
updated_at: { type: Number, default: Date.now }, // last update date
|
|
426
|
+
color: { type: String }, // optional color for displaying the polygon on the mapF
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
versionKey: false,
|
|
430
|
+
toJSON: { virtuals: true },
|
|
431
|
+
toObject: { virtuals: true },
|
|
432
|
+
},
|
|
433
|
+
);
|
|
434
|
+
|
|
435
|
+
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -356,7 +356,9 @@ export const zodPredefinedQuerySchema = z.object({
|
|
|
356
356
|
geos_ids: z
|
|
357
357
|
.array(z.string().or(z.object({ _id: z.string(), name: z.string() })))
|
|
358
358
|
.optional(), // array of geo _id strings
|
|
359
|
-
time_range: zodRelativeTimeRangeSchema
|
|
359
|
+
time_range: zodRelativeTimeRangeSchema
|
|
360
|
+
.or(zodAbsoluteTimeRangeSchema)
|
|
361
|
+
.optional(), // optional time range for the predefined query
|
|
360
362
|
user_instructions: z.string().optional(), // optional user instructions for the predefined query
|
|
361
363
|
status: z.enum(generalStatusList).default('active').optional(), // status of the predefined query
|
|
362
364
|
created_at: z.number().optional(), // creation date
|
|
@@ -376,6 +378,26 @@ export const zodGeoSelectionGroupSchema = z.object({
|
|
|
376
378
|
geo_selections: zodGeoSelectionSchema.array().optional(), // array of geo selection objects
|
|
377
379
|
});
|
|
378
380
|
|
|
381
|
+
export const zodFavoriteEventSchema = z.object({
|
|
382
|
+
_id: z.string().optional(),
|
|
383
|
+
user_id: z.string(), // user identifier
|
|
384
|
+
event_id: z.string(), // event identifier
|
|
385
|
+
created_at: z.number().optional(), // creation date
|
|
386
|
+
updated_at: z.number().optional(), // last update date
|
|
387
|
+
});
|
|
388
|
+
|
|
389
|
+
export const zodPolygonSchema = z.object({
|
|
390
|
+
_id: z.string().optional(),
|
|
391
|
+
user_id: z.string(), // user identifier
|
|
392
|
+
region_id: z.string(), // e.g., region ID
|
|
393
|
+
title: z.string(), // e.g., "Zarqa city center"
|
|
394
|
+
description: z.string().optional(), // e.g., "Description of the area"
|
|
395
|
+
coordinates: z.array(z.array(z.array(z.number()))), // array of linear rings, where each linear ring is an array of [longitude, latitude] pairs
|
|
396
|
+
created_at: z.number().optional(), // creation date
|
|
397
|
+
updated_at: z.number().optional(), // last update date
|
|
398
|
+
color: z.string().optional(), // optional color for displaying the polygon on the map
|
|
399
|
+
});
|
|
400
|
+
|
|
379
401
|
/**
|
|
380
402
|
* 'approved' - active and approved sources,
|
|
381
403
|
* 'back_to_business' - sources that were paused and now resumed,
|
|
@@ -409,6 +431,8 @@ export type SendEmailType = z.infer<typeof zodSendEmailSchema>;
|
|
|
409
431
|
export type SendWhatsappType = z.infer<typeof zodSendWhatsappSchema>;
|
|
410
432
|
export type PredefinedQueryType = z.infer<typeof zodPredefinedQuerySchema>;
|
|
411
433
|
export type GeoSelectionGroupType = z.infer<typeof zodGeoSelectionGroupSchema>;
|
|
434
|
+
export type FavoriteEventType = z.infer<typeof zodFavoriteEventSchema>;
|
|
435
|
+
export type PolygonType = z.infer<typeof zodPolygonSchema>;
|
|
412
436
|
|
|
413
437
|
export type UserPublicMetadata = {
|
|
414
438
|
is_admin?: boolean;
|