asfur 1.0.114 → 1.0.116

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
@@ -686,3 +686,46 @@ export declare const MongoMessageSchema: Schema<any, import("mongoose").Model<an
686
686
  } & {
687
687
  __v: number;
688
688
  }>;
689
+ export declare const MongoSendEmailSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
690
+ versionKey: false;
691
+ toJSON: {
692
+ virtuals: true;
693
+ };
694
+ toObject: {
695
+ virtuals: true;
696
+ };
697
+ }, {
698
+ user_id: string;
699
+ priority: "low" | "medium" | "high" | "critical";
700
+ to: string[];
701
+ timestamp?: number | null | undefined;
702
+ from_service?: string | null | undefined;
703
+ from?: string | null | undefined;
704
+ subject?: string | null | undefined;
705
+ body?: string | null | undefined;
706
+ html?: string | null | undefined;
707
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
708
+ user_id: string;
709
+ priority: "low" | "medium" | "high" | "critical";
710
+ to: string[];
711
+ timestamp?: number | null | undefined;
712
+ from_service?: string | null | undefined;
713
+ from?: string | null | undefined;
714
+ subject?: string | null | undefined;
715
+ body?: string | null | undefined;
716
+ html?: string | null | undefined;
717
+ }>, {}> & import("mongoose").FlatRecord<{
718
+ user_id: string;
719
+ priority: "low" | "medium" | "high" | "critical";
720
+ to: string[];
721
+ timestamp?: number | null | undefined;
722
+ from_service?: string | null | undefined;
723
+ from?: string | null | undefined;
724
+ subject?: string | null | undefined;
725
+ body?: string | null | undefined;
726
+ html?: string | null | undefined;
727
+ }> & {
728
+ _id: import("mongoose").Types.ObjectId;
729
+ } & {
730
+ __v: number;
731
+ }>;
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.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.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");
@@ -279,3 +279,18 @@ exports.MongoMessageSchema = new mongoose_1.Schema({
279
279
  toJSON: { virtuals: true },
280
280
  toObject: { virtuals: true },
281
281
  });
282
+ exports.MongoSendEmailSchema = new mongoose_1.Schema({
283
+ user_id: { type: String, required: true },
284
+ priority: { type: String, enum: types_1.notificationPriorityList, default: 'low' },
285
+ timestamp: { type: Number },
286
+ from_service: { type: String },
287
+ to: { type: [String] },
288
+ from: { type: String },
289
+ subject: { type: String },
290
+ body: { type: String },
291
+ html: { type: String }, // email body in HTML format
292
+ }, {
293
+ versionKey: false,
294
+ toJSON: { virtuals: true },
295
+ toObject: { virtuals: true },
296
+ });
package/dist/types.d.ts CHANGED
@@ -1757,6 +1757,37 @@ export declare const zodScenarioSchema: z.ZodObject<{
1757
1757
  confidence_level?: string | undefined;
1758
1758
  }[] | undefined;
1759
1759
  }>;
1760
+ export declare const zodSendEmailSchema: z.ZodObject<{
1761
+ user_id: z.ZodString;
1762
+ priority: z.ZodEnum<["low", "medium", "high", "critical"]>;
1763
+ timestamp: z.ZodNumber;
1764
+ from_service: z.ZodString;
1765
+ to: z.ZodArray<z.ZodString, "many">;
1766
+ from: z.ZodString;
1767
+ subject: z.ZodString;
1768
+ body: z.ZodOptional<z.ZodString>;
1769
+ html: z.ZodOptional<z.ZodString>;
1770
+ }, "strip", z.ZodTypeAny, {
1771
+ user_id: string;
1772
+ timestamp: number;
1773
+ priority: "low" | "medium" | "high" | "critical";
1774
+ from_service: string;
1775
+ to: string[];
1776
+ from: string;
1777
+ subject: string;
1778
+ body?: string | undefined;
1779
+ html?: string | undefined;
1780
+ }, {
1781
+ user_id: string;
1782
+ timestamp: number;
1783
+ priority: "low" | "medium" | "high" | "critical";
1784
+ from_service: string;
1785
+ to: string[];
1786
+ from: string;
1787
+ subject: string;
1788
+ body?: string | undefined;
1789
+ html?: string | undefined;
1790
+ }>;
1760
1791
  /**
1761
1792
  * 'approved' - active and approved sources,
1762
1793
  * 'back_to_business' - sources that were paused and now resumed,
@@ -1781,6 +1812,7 @@ export type ScenarioScoreType = z.infer<typeof zodScenarioScoreSchema>;
1781
1812
  export type AlertType = z.infer<typeof zodAlertSchema>;
1782
1813
  export type MessageType = z.infer<typeof zodMessageSchema>;
1783
1814
  export type HeatmapType = z.infer<typeof zodHeatmapSchema>;
1815
+ export type SendEmailType = z.infer<typeof zodSendEmailSchema>;
1784
1816
  export type UserPublicMetadata = {
1785
1817
  is_admin?: boolean;
1786
1818
  regions?: {
package/dist/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
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;
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;
4
4
  const zod_1 = require("zod");
5
5
  exports.generalStatusList = ['active', 'inactive'];
6
6
  exports.jobRunStatusList = ['done', 'failed', 'in_progress'];
@@ -100,18 +100,6 @@ exports.zodJobSchema = zod_1.z.object({
100
100
  }))
101
101
  .optional(),
102
102
  });
103
- // export const zodJobRunSchema = z.object({
104
- // _id: z.string().optional(),
105
- // job_id: z.string().nonempty('Job ID must be provided'), // job identifier
106
- // user_id: z.string().nonempty('User ID must be provided'), // user identifier
107
- // status: z.enum(jobRunStatusList).default('done'), // status of the job run
108
- // created_at: z.number().optional(), // creation date
109
- // updated_at: z.number().optional(), // last update date
110
- // result: z.string().optional(), // result of the job run
111
- // error: z.string().optional(), // error message if the job run failed
112
- // user_time_zone: z.string().optional(), // user's timezone
113
- // metadata: z.record(z.string(), z.any()).optional(), // flexible metadata for the job run
114
- // });
115
103
  exports.zodHeatmapSchema = zod_1.z.object({
116
104
  _id: zod_1.z.string().optional(),
117
105
  user_id: zod_1.z.string().nonempty('User ID must be provided'),
@@ -270,3 +258,14 @@ exports.zodScenarioSchema = zod_1.z.object({
270
258
  alert: exports.zodAlertSchema.optional(),
271
259
  scores: zod_1.z.array(exports.zodScenarioScoreSchema).optional(), // array of scenario scores associated with the scenario
272
260
  });
261
+ exports.zodSendEmailSchema = zod_1.z.object({
262
+ user_id: zod_1.z.string(),
263
+ priority: zod_1.z.enum(exports.notificationPriorityList),
264
+ timestamp: zod_1.z.number(),
265
+ from_service: zod_1.z.string(),
266
+ to: zod_1.z.array(zod_1.z.string().email()),
267
+ from: zod_1.z.string().email(),
268
+ subject: zod_1.z.string(),
269
+ body: zod_1.z.string().optional(),
270
+ html: zod_1.z.string().optional(), // email body
271
+ });
package/index.ts CHANGED
@@ -316,3 +316,22 @@ export const MongoMessageSchema = new Schema(
316
316
  toObject: { virtuals: true },
317
317
  },
318
318
  );
319
+
320
+ export const MongoSendEmailSchema = new Schema(
321
+ {
322
+ user_id: { type: String, required: true }, // user identifier
323
+ priority: { type: String, enum: notificationPriorityList, default: 'low' }, // email priority
324
+ timestamp: { type: Number }, // timestamp for when the email should be sent
325
+ from_service: { type: String }, // name of the service sending the email
326
+ to: { type: [String] }, // recipient email addresses
327
+ from: { type: String }, // sender email address
328
+ subject: { type: String }, // email subject
329
+ body: { type: String }, // optional plain text email body
330
+ html: { type: String }, // email body in HTML format
331
+ },
332
+ {
333
+ versionKey: false,
334
+ toJSON: { virtuals: true },
335
+ toObject: { virtuals: true },
336
+ },
337
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asfur",
3
- "version": "1.0.114",
3
+ "version": "1.0.116",
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
@@ -133,19 +133,6 @@ export const zodJobSchema = z.object({
133
133
  .optional(),
134
134
  });
135
135
 
136
- // export const zodJobRunSchema = z.object({
137
- // _id: z.string().optional(),
138
- // job_id: z.string().nonempty('Job ID must be provided'), // job identifier
139
- // user_id: z.string().nonempty('User ID must be provided'), // user identifier
140
- // status: z.enum(jobRunStatusList).default('done'), // status of the job run
141
- // created_at: z.number().optional(), // creation date
142
- // updated_at: z.number().optional(), // last update date
143
- // result: z.string().optional(), // result of the job run
144
- // error: z.string().optional(), // error message if the job run failed
145
- // user_time_zone: z.string().optional(), // user's timezone
146
- // metadata: z.record(z.string(), z.any()).optional(), // flexible metadata for the job run
147
- // });
148
-
149
136
  export const zodHeatmapSchema = z.object({
150
137
  _id: z.string().optional(),
151
138
  user_id: z.string().nonempty('User ID must be provided'), // user identifier
@@ -320,6 +307,18 @@ export const zodScenarioSchema = z.object({
320
307
  scores: z.array(zodScenarioScoreSchema).optional(), // array of scenario scores associated with the scenario
321
308
  });
322
309
 
310
+ export const zodSendEmailSchema = z.object({
311
+ user_id: z.string(), // user identifier
312
+ priority: z.enum(notificationPriorityList), // priority of the email
313
+ timestamp: z.number(), // timestamp for when the email should be sent
314
+ from_service: z.string(), // name of the service sending the email
315
+ to: z.array(z.string().email()), // recipient email address
316
+ from: z.string().email(), // sender email address
317
+ subject: z.string(), // email subject
318
+ body: z.string().optional(), // optional plain text email body
319
+ html: z.string().optional(), // email body
320
+ });
321
+
323
322
  /**
324
323
  * 'approved' - active and approved sources,
325
324
  * 'back_to_business' - sources that were paused and now resumed,
@@ -349,6 +348,7 @@ export type ScenarioScoreType = z.infer<typeof zodScenarioScoreSchema>;
349
348
  export type AlertType = z.infer<typeof zodAlertSchema>;
350
349
  export type MessageType = z.infer<typeof zodMessageSchema>;
351
350
  export type HeatmapType = z.infer<typeof zodHeatmapSchema>;
351
+ export type SendEmailType = z.infer<typeof zodSendEmailSchema>;
352
352
 
353
353
  export type UserPublicMetadata = {
354
354
  is_admin?: boolean;