asfur 1.0.131 → 1.0.133

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,101 @@ 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
+ }>;
956
+ export declare const MongoUserRequestSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
957
+ versionKey: false;
958
+ toJSON: {
959
+ virtuals: true;
960
+ };
961
+ toObject: {
962
+ virtuals: true;
963
+ };
964
+ }, {
965
+ user_id: string;
966
+ created_at: number;
967
+ updated_at: number;
968
+ request_type: string;
969
+ request: string;
970
+ status?: string | null | undefined;
971
+ file_url?: string | null | undefined;
972
+ admin_notes?: string | null | undefined;
973
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
974
+ user_id: string;
975
+ created_at: number;
976
+ updated_at: number;
977
+ request_type: string;
978
+ request: string;
979
+ status?: string | null | undefined;
980
+ file_url?: string | null | undefined;
981
+ admin_notes?: string | null | undefined;
982
+ }>, {}> & import("mongoose").FlatRecord<{
983
+ user_id: string;
984
+ created_at: number;
985
+ updated_at: number;
986
+ request_type: string;
987
+ request: string;
988
+ status?: string | null | undefined;
989
+ file_url?: string | null | undefined;
990
+ admin_notes?: string | null | undefined;
991
+ }> & {
992
+ _id: import("mongoose").Types.ObjectId;
993
+ } & {
994
+ __v: number;
995
+ }>;
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.MongoUserRequestSchema = 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,31 @@ 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
+ });
373
+ exports.MongoUserRequestSchema = new mongoose_1.Schema({
374
+ user_id: { type: String, required: true },
375
+ request_type: { type: String, required: true },
376
+ request: { type: String, required: true },
377
+ file_url: { type: String },
378
+ created_at: { type: Number, default: Date.now },
379
+ updated_at: { type: Number, default: Date.now },
380
+ status: { type: String },
381
+ admin_notes: { type: String }, // internal notes for admins regarding the user request
382
+ }, {
383
+ versionKey: false,
384
+ toJSON: { virtuals: true },
385
+ toObject: { virtuals: true },
386
+ });
package/dist/types.d.ts CHANGED
@@ -2294,6 +2294,68 @@ 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
+ }>;
2328
+ export declare const zodUserRequestSchema: z.ZodObject<{
2329
+ _id: z.ZodOptional<z.ZodString>;
2330
+ user_id: z.ZodString;
2331
+ request_type: z.ZodString;
2332
+ request: z.ZodString;
2333
+ file_url: z.ZodOptional<z.ZodString>;
2334
+ created_at: z.ZodOptional<z.ZodNumber>;
2335
+ updated_at: z.ZodOptional<z.ZodNumber>;
2336
+ status: z.ZodOptional<z.ZodString>;
2337
+ admin_notes: z.ZodOptional<z.ZodString>;
2338
+ }, "strip", z.ZodTypeAny, {
2339
+ user_id: string;
2340
+ request_type: string;
2341
+ request: string;
2342
+ status?: string | undefined;
2343
+ _id?: string | undefined;
2344
+ created_at?: number | undefined;
2345
+ updated_at?: number | undefined;
2346
+ file_url?: string | undefined;
2347
+ admin_notes?: string | undefined;
2348
+ }, {
2349
+ user_id: string;
2350
+ request_type: string;
2351
+ request: string;
2352
+ status?: string | undefined;
2353
+ _id?: string | undefined;
2354
+ created_at?: number | undefined;
2355
+ updated_at?: number | undefined;
2356
+ file_url?: string | undefined;
2357
+ admin_notes?: string | undefined;
2358
+ }>;
2297
2359
  /**
2298
2360
  * 'approved' - active and approved sources,
2299
2361
  * 'back_to_business' - sources that were paused and now resumed,
@@ -2323,6 +2385,8 @@ export type SendWhatsappType = z.infer<typeof zodSendWhatsappSchema>;
2323
2385
  export type PredefinedQueryType = z.infer<typeof zodPredefinedQuerySchema>;
2324
2386
  export type GeoSelectionGroupType = z.infer<typeof zodGeoSelectionGroupSchema>;
2325
2387
  export type FavoriteEventType = z.infer<typeof zodFavoriteEventSchema>;
2388
+ export type PolygonType = z.infer<typeof zodPolygonSchema>;
2389
+ export type UserRequestType = z.infer<typeof zodUserRequestSchema>;
2326
2390
  export type UserPublicMetadata = {
2327
2391
  is_admin?: boolean;
2328
2392
  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.zodUserRequestSchema = 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,25 @@ 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
+ });
344
+ exports.zodUserRequestSchema = zod_1.z.object({
345
+ _id: zod_1.z.string().optional(),
346
+ user_id: zod_1.z.string(),
347
+ request_type: zod_1.z.string(),
348
+ request: zod_1.z.string(),
349
+ file_url: zod_1.z.string().url().optional(),
350
+ created_at: zod_1.z.number().optional(),
351
+ updated_at: zod_1.z.number().optional(),
352
+ status: zod_1.z.string().optional(),
353
+ admin_notes: zod_1.z.string().optional(), // internal notes for admins regarding the user request
354
+ });
package/index.ts CHANGED
@@ -414,3 +414,40 @@ 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
+ export const MongoUserRequestSchema = new Schema(
436
+ {
437
+ user_id: { type: String, required: true }, // user identifier
438
+ request_type: { type: String, required: true },
439
+ request: { type: String, required: true }, // user request or feedback
440
+ file_url: { type: String }, // optional URL for any file attached to the request
441
+ created_at: { type: Number, default: Date.now }, // creation date
442
+ updated_at: { type: Number, default: Date.now }, // last update date
443
+ status: { type: String }, // status of the user request (e.g., "pending", "in_progress", "resolved")
444
+ admin_notes: { type: String }, // internal notes for admins regarding the user request
445
+ },
446
+ {
447
+ versionKey: false,
448
+ toJSON: { virtuals: true },
449
+ toObject: { virtuals: true },
450
+ },
451
+ );
452
+
453
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asfur",
3
- "version": "1.0.131",
3
+ "version": "1.0.133",
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,30 @@ 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
+
401
+ export const zodUserRequestSchema = z.object({
402
+ _id: z.string().optional(),
403
+ user_id: z.string(), // user identifier
404
+ request_type: z.string(),
405
+ request: z.string(), // user request or feedback
406
+ file_url: z.string().url().optional(), // optional URL for any file attached to the request
407
+ created_at: z.number().optional(), // creation date
408
+ updated_at: z.number().optional(), // last update date
409
+ status: z.string().optional(), // status of the user request (e.g., "pending", "in_progress", "resolved")
410
+ admin_notes: z.string().optional(), // internal notes for admins regarding the user request
411
+ });
412
+
387
413
  /**
388
414
  * 'approved' - active and approved sources,
389
415
  * 'back_to_business' - sources that were paused and now resumed,
@@ -418,6 +444,8 @@ export type SendWhatsappType = z.infer<typeof zodSendWhatsappSchema>;
418
444
  export type PredefinedQueryType = z.infer<typeof zodPredefinedQuerySchema>;
419
445
  export type GeoSelectionGroupType = z.infer<typeof zodGeoSelectionGroupSchema>;
420
446
  export type FavoriteEventType = z.infer<typeof zodFavoriteEventSchema>;
447
+ export type PolygonType = z.infer<typeof zodPolygonSchema>;
448
+ export type UserRequestType = z.infer<typeof zodUserRequestSchema>;
421
449
 
422
450
  export type UserPublicMetadata = {
423
451
  is_admin?: boolean;