asfur 1.0.131 → 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 CHANGED
@@ -895,3 +895,61 @@ export declare const MongoFavoriteEventSchema: Schema<any, import("mongoose").Mo
895
895
  } & {
896
896
  __v: number;
897
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.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;
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");
@@ -356,3 +356,17 @@ exports.MongoFavoriteEventSchema = new mongoose_1.Schema({
356
356
  toJSON: { virtuals: true },
357
357
  toObject: { virtuals: true },
358
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
@@ -2294,6 +2294,37 @@ export declare const zodFavoriteEventSchema: z.ZodObject<{
2294
2294
  created_at?: number | undefined;
2295
2295
  updated_at?: number | undefined;
2296
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
+ }>;
2297
2328
  /**
2298
2329
  * 'approved' - active and approved sources,
2299
2330
  * 'back_to_business' - sources that were paused and now resumed,
@@ -2323,6 +2354,7 @@ export type SendWhatsappType = z.infer<typeof zodSendWhatsappSchema>;
2323
2354
  export type PredefinedQueryType = z.infer<typeof zodPredefinedQuerySchema>;
2324
2355
  export type GeoSelectionGroupType = z.infer<typeof zodGeoSelectionGroupSchema>;
2325
2356
  export type FavoriteEventType = z.infer<typeof zodFavoriteEventSchema>;
2357
+ export type PolygonType = z.infer<typeof zodPolygonSchema>;
2326
2358
  export type UserPublicMetadata = {
2327
2359
  is_admin?: boolean;
2328
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.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;
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.or(exports.zodAbsoluteTimeRangeSchema).optional(),
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(),
@@ -328,3 +330,14 @@ exports.zodFavoriteEventSchema = zod_1.z.object({
328
330
  created_at: zod_1.z.number().optional(),
329
331
  updated_at: zod_1.z.number().optional(), // last update date
330
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
@@ -414,3 +414,22 @@ export const MongoFavoriteEventSchema = new Schema(
414
414
  },
415
415
  );
416
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asfur",
3
- "version": "1.0.131",
3
+ "version": "1.0.132",
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
@@ -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.or(zodAbsoluteTimeRangeSchema).optional(), // optional time range for the predefined query
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
@@ -384,6 +386,18 @@ export const zodFavoriteEventSchema = z.object({
384
386
  updated_at: z.number().optional(), // last update date
385
387
  });
386
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
+
387
401
  /**
388
402
  * 'approved' - active and approved sources,
389
403
  * 'back_to_business' - sources that were paused and now resumed,
@@ -418,6 +432,7 @@ export type SendWhatsappType = z.infer<typeof zodSendWhatsappSchema>;
418
432
  export type PredefinedQueryType = z.infer<typeof zodPredefinedQuerySchema>;
419
433
  export type GeoSelectionGroupType = z.infer<typeof zodGeoSelectionGroupSchema>;
420
434
  export type FavoriteEventType = z.infer<typeof zodFavoriteEventSchema>;
435
+ export type PolygonType = z.infer<typeof zodPolygonSchema>;
421
436
 
422
437
  export type UserPublicMetadata = {
423
438
  is_admin?: boolean;