asfur 1.0.82 → 1.0.84

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
@@ -497,3 +497,43 @@ export declare const MongoApiKeySchema: Schema<any, import("mongoose").Model<any
497
497
  } & {
498
498
  __v: number;
499
499
  }>;
500
+ export declare const MongoReportSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
501
+ versionKey: false;
502
+ toJSON: {
503
+ virtuals: true;
504
+ };
505
+ toObject: {
506
+ virtuals: true;
507
+ };
508
+ }, {
509
+ created_at: number;
510
+ updated_at: number;
511
+ user_id: string;
512
+ title?: string | null | undefined;
513
+ conversation_id?: string | null | undefined;
514
+ last_assistant_messages_count?: number | null | undefined;
515
+ additional_instructions?: string | null | undefined;
516
+ report_html?: string | null | undefined;
517
+ }, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
518
+ created_at: number;
519
+ updated_at: number;
520
+ user_id: string;
521
+ title?: string | null | undefined;
522
+ conversation_id?: string | null | undefined;
523
+ last_assistant_messages_count?: number | null | undefined;
524
+ additional_instructions?: string | null | undefined;
525
+ report_html?: string | null | undefined;
526
+ }>, {}> & import("mongoose").FlatRecord<{
527
+ created_at: number;
528
+ updated_at: number;
529
+ user_id: string;
530
+ title?: string | null | undefined;
531
+ conversation_id?: string | null | undefined;
532
+ last_assistant_messages_count?: number | null | undefined;
533
+ additional_instructions?: string | null | undefined;
534
+ report_html?: string | null | undefined;
535
+ }> & {
536
+ _id: import("mongoose").Types.ObjectId;
537
+ } & {
538
+ __v: number;
539
+ }>;
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.MongoApiKeySchema = exports.MongoGeoSelectionSchema = exports.MongoGeoSchema = exports.MongoJobSchema = exports.MongoConversationSchema = exports.MongoUserSettingsSchema = exports.MongoQuerySchema = exports.MongoSourceSchema = exports.MongoInstructionsSchema = exports.MongoDataSchema = void 0;
17
+ exports.MongoReportSchema = exports.MongoApiKeySchema = exports.MongoGeoSelectionSchema = exports.MongoGeoSchema = exports.MongoJobSchema = exports.MongoConversationSchema = exports.MongoUserSettingsSchema = exports.MongoQuerySchema = exports.MongoSourceSchema = exports.MongoInstructionsSchema = exports.MongoDataSchema = void 0;
18
18
  // Export types for consumers
19
19
  __exportStar(require("./types"), exports);
20
20
  const mongoose_1 = require("mongoose");
@@ -217,3 +217,17 @@ exports.MongoApiKeySchema = new mongoose_1.Schema({
217
217
  toJSON: { virtuals: true },
218
218
  toObject: { virtuals: true },
219
219
  });
220
+ exports.MongoReportSchema = new mongoose_1.Schema({
221
+ user_id: { type: String, required: true },
222
+ conversation_id: { type: String },
223
+ title: { type: String },
224
+ last_assistant_messages_count: { type: Number },
225
+ additional_instructions: { type: String },
226
+ report_html: { type: String },
227
+ created_at: { type: Number, default: Date.now },
228
+ updated_at: { type: Number, default: Date.now }, // last update date
229
+ }, {
230
+ versionKey: false,
231
+ toJSON: { virtuals: true },
232
+ toObject: { virtuals: true },
233
+ });
package/dist/types.d.ts CHANGED
@@ -646,6 +646,37 @@ export declare const zodApiKeySchema: z.ZodObject<{
646
646
  created_at?: number | undefined;
647
647
  updated_at?: number | undefined;
648
648
  }>;
649
+ export declare const zodReportSchema: z.ZodObject<{
650
+ _id: z.ZodOptional<z.ZodString>;
651
+ user_id: z.ZodString;
652
+ conversation_id: z.ZodString;
653
+ title: z.ZodOptional<z.ZodString>;
654
+ last_assistant_messages_count: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
655
+ additional_instructions: z.ZodOptional<z.ZodString>;
656
+ created_at: z.ZodOptional<z.ZodNumber>;
657
+ updated_at: z.ZodOptional<z.ZodNumber>;
658
+ report_html: z.ZodOptional<z.ZodString>;
659
+ }, "strip", z.ZodTypeAny, {
660
+ user_id: string;
661
+ conversation_id: string;
662
+ last_assistant_messages_count: number;
663
+ _id?: string | undefined;
664
+ title?: string | undefined;
665
+ created_at?: number | undefined;
666
+ updated_at?: number | undefined;
667
+ additional_instructions?: string | undefined;
668
+ report_html?: string | undefined;
669
+ }, {
670
+ user_id: string;
671
+ conversation_id: string;
672
+ _id?: string | undefined;
673
+ title?: string | undefined;
674
+ created_at?: number | undefined;
675
+ updated_at?: number | undefined;
676
+ last_assistant_messages_count?: number | undefined;
677
+ additional_instructions?: string | undefined;
678
+ report_html?: string | undefined;
679
+ }>;
649
680
  /**
650
681
  * 'approved' - active and approved sources,
651
682
  * 'back_to_business' - sources that were paused and now resumed,
@@ -669,3 +700,21 @@ export type CronScheduleResponseType = z.infer<typeof zodCronScheduleResponseSch
669
700
  export type GeoType = z.infer<typeof zodGeoSchema>;
670
701
  export type GeoSelectionType = z.infer<typeof zodGeoSelectionSchema>;
671
702
  export type ApiKeyType = z.infer<typeof zodApiKeySchema>;
703
+ export type UserPublicMetadata = {
704
+ is_admin?: boolean;
705
+ regions?: {
706
+ name: string;
707
+ _id: string;
708
+ }[];
709
+ notes?: string;
710
+ };
711
+ export type MessageMetaData = {
712
+ geoLocations?: string[];
713
+ startDate?: string;
714
+ endDate?: string;
715
+ documents?: number;
716
+ userInstructions?: string;
717
+ sourceDocumentCounts?: {
718
+ [key: string]: number;
719
+ };
720
+ };
package/dist/types.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zodApiKeySchema = exports.zodCronScheduleResponseSchema = exports.zodJobSchema = exports.zodConversationSchema = exports.zodUserSettingsSchema = exports.zodInstructionsSchema = exports.zodQuerySchema = exports.zodAbsoluteTimeRangeSchema = exports.zodRelativeTimeRangeSchema = exports.relativeTimeRangeList = exports.zodDataSchema = exports.zodSourceSchema = exports.zodGeoSelectionSchema = exports.zodGeoSchema = exports.generalStatusList = exports.statusList = exports.platformsList = void 0;
3
+ exports.zodReportSchema = exports.zodApiKeySchema = exports.zodCronScheduleResponseSchema = exports.zodJobSchema = exports.zodConversationSchema = exports.zodUserSettingsSchema = exports.zodInstructionsSchema = exports.zodQuerySchema = exports.zodAbsoluteTimeRangeSchema = exports.zodRelativeTimeRangeSchema = exports.relativeTimeRangeList = exports.zodDataSchema = exports.zodSourceSchema = exports.zodGeoSelectionSchema = exports.zodGeoSchema = exports.generalStatusList = exports.statusList = exports.platformsList = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports.platformsList = [
6
6
  'telegram',
@@ -192,3 +192,14 @@ exports.zodApiKeySchema = zod_1.z.object({
192
192
  updated_at: zod_1.z.number().optional(),
193
193
  status: zod_1.z.enum(exports.generalStatusList).default('active'), // status of the API key
194
194
  });
195
+ exports.zodReportSchema = zod_1.z.object({
196
+ _id: zod_1.z.string().optional(),
197
+ user_id: zod_1.z.string().nonempty('User ID must be provided'),
198
+ conversation_id: zod_1.z.string(),
199
+ title: zod_1.z.string().optional(),
200
+ last_assistant_messages_count: zod_1.z.number().optional().default(0),
201
+ additional_instructions: zod_1.z.string().optional(),
202
+ created_at: zod_1.z.number().optional(),
203
+ updated_at: zod_1.z.number().optional(),
204
+ report_html: zod_1.z.string().optional(), // generated report in HTML format
205
+ });
package/index.ts CHANGED
@@ -241,3 +241,21 @@ export const MongoApiKeySchema = new Schema(
241
241
  toObject: { virtuals: true },
242
242
  }
243
243
  );
244
+
245
+ export const MongoReportSchema = new Schema(
246
+ {
247
+ user_id: { type: String, required: true }, // user identifier
248
+ conversation_id: { type: String },
249
+ title: { type: String }, // report title
250
+ last_assistant_messages_count: { type: Number }, // number of assistant messages at the time of report
251
+ additional_instructions: { type: String }, // additional instructions provided by the user
252
+ report_html: { type: String }, // report content in HTML format
253
+ created_at: { type: Number, default: Date.now }, // creation date
254
+ updated_at: { type: Number, default: Date.now }, // last update date
255
+ },
256
+ {
257
+ versionKey: false,
258
+ toJSON: { virtuals: true },
259
+ toObject: { virtuals: true },
260
+ }
261
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asfur",
3
- "version": "1.0.82",
3
+ "version": "1.0.84",
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
@@ -214,6 +214,18 @@ export const zodApiKeySchema = z.object({
214
214
  status: z.enum(generalStatusList).default('active'), // status of the API key
215
215
  });
216
216
 
217
+ export const zodReportSchema = z.object({
218
+ _id: z.string().optional(),
219
+ user_id: z.string().nonempty('User ID must be provided'), // user identifier
220
+ conversation_id: z.string(), // conversation ID for the report
221
+ title: z.string().optional(), // optional title for the report
222
+ last_assistant_messages_count: z.number().optional().default(0), // number of assistant messages in the conversation
223
+ additional_instructions: z.string().optional(), // optional additional instructions for the report
224
+ created_at: z.number().optional(), // creation date
225
+ updated_at: z.number().optional(), // last update date
226
+ report_html: z.string().optional(), // generated report in HTML format
227
+ });
228
+
217
229
  /**
218
230
  * 'approved' - active and approved sources,
219
231
  * 'back_to_business' - sources that were paused and now resumed,
@@ -243,4 +255,22 @@ export type CronScheduleResponseType = z.infer<
243
255
  >;
244
256
  export type GeoType = z.infer<typeof zodGeoSchema>;
245
257
  export type GeoSelectionType = z.infer<typeof zodGeoSelectionSchema>;
246
- export type ApiKeyType = z.infer<typeof zodApiKeySchema>;
258
+ export type ApiKeyType = z.infer<typeof zodApiKeySchema>;
259
+
260
+ export type UserPublicMetadata = {
261
+ is_admin?: boolean;
262
+ regions?: {
263
+ name: string;
264
+ _id: string;
265
+ }[];
266
+ notes?: string;
267
+ };
268
+
269
+ export type MessageMetaData = {
270
+ geoLocations?: string[];
271
+ startDate?: string;
272
+ endDate?: string;
273
+ documents?: number;
274
+ userInstructions?: string;
275
+ sourceDocumentCounts?: { [key: string]: number };
276
+ };