asfur 1.0.88 → 1.0.90
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 +37 -0
- package/dist/index.js +18 -1
- package/dist/types.d.ts +31 -0
- package/dist/types.js +24 -2
- package/index.ts +23 -2
- package/package.json +1 -1
- package/types.ts +26 -0
package/dist/index.d.ts
CHANGED
|
@@ -509,6 +509,7 @@ export declare const MongoReportSchema: Schema<any, import("mongoose").Model<any
|
|
|
509
509
|
created_at: number;
|
|
510
510
|
updated_at: number;
|
|
511
511
|
user_id: string;
|
|
512
|
+
process_status: "pending" | "in_progress" | "completed" | "failed";
|
|
512
513
|
title?: string | null | undefined;
|
|
513
514
|
type?: string | null | undefined;
|
|
514
515
|
thread_id?: string | null | undefined;
|
|
@@ -519,6 +520,7 @@ export declare const MongoReportSchema: Schema<any, import("mongoose").Model<any
|
|
|
519
520
|
created_at: number;
|
|
520
521
|
updated_at: number;
|
|
521
522
|
user_id: string;
|
|
523
|
+
process_status: "pending" | "in_progress" | "completed" | "failed";
|
|
522
524
|
title?: string | null | undefined;
|
|
523
525
|
type?: string | null | undefined;
|
|
524
526
|
thread_id?: string | null | undefined;
|
|
@@ -529,6 +531,7 @@ export declare const MongoReportSchema: Schema<any, import("mongoose").Model<any
|
|
|
529
531
|
created_at: number;
|
|
530
532
|
updated_at: number;
|
|
531
533
|
user_id: string;
|
|
534
|
+
process_status: "pending" | "in_progress" | "completed" | "failed";
|
|
532
535
|
title?: string | null | undefined;
|
|
533
536
|
type?: string | null | undefined;
|
|
534
537
|
thread_id?: string | null | undefined;
|
|
@@ -540,3 +543,37 @@ export declare const MongoReportSchema: Schema<any, import("mongoose").Model<any
|
|
|
540
543
|
} & {
|
|
541
544
|
__v: number;
|
|
542
545
|
}>;
|
|
546
|
+
export declare const MongoNotificationSchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
547
|
+
versionKey: false;
|
|
548
|
+
toJSON: {
|
|
549
|
+
virtuals: true;
|
|
550
|
+
};
|
|
551
|
+
toObject: {
|
|
552
|
+
virtuals: true;
|
|
553
|
+
};
|
|
554
|
+
}, {
|
|
555
|
+
message: string;
|
|
556
|
+
created_at: number;
|
|
557
|
+
updated_at: number;
|
|
558
|
+
user_id: string;
|
|
559
|
+
is_read: boolean;
|
|
560
|
+
priority: "low" | "medium" | "high" | "critical";
|
|
561
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
562
|
+
message: string;
|
|
563
|
+
created_at: number;
|
|
564
|
+
updated_at: number;
|
|
565
|
+
user_id: string;
|
|
566
|
+
is_read: boolean;
|
|
567
|
+
priority: "low" | "medium" | "high" | "critical";
|
|
568
|
+
}>, {}> & import("mongoose").FlatRecord<{
|
|
569
|
+
message: string;
|
|
570
|
+
created_at: number;
|
|
571
|
+
updated_at: number;
|
|
572
|
+
user_id: string;
|
|
573
|
+
is_read: boolean;
|
|
574
|
+
priority: "low" | "medium" | "high" | "critical";
|
|
575
|
+
}> & {
|
|
576
|
+
_id: import("mongoose").Types.ObjectId;
|
|
577
|
+
} & {
|
|
578
|
+
__v: number;
|
|
579
|
+
}>;
|
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.MongoReportSchema = exports.MongoApiKeySchema = exports.MongoGeoSelectionSchema = exports.MongoGeoSchema = exports.MongoJobSchema = exports.MongoConversationSchema = exports.MongoUserSettingsSchema = exports.MongoQuerySchema = exports.MongoSourceSchema = exports.MongoInstructionsSchema = exports.MongoDataSchema = void 0;
|
|
17
|
+
exports.MongoNotificationSchema = 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");
|
|
@@ -226,6 +226,23 @@ exports.MongoReportSchema = new mongoose_1.Schema({
|
|
|
226
226
|
report_html: { type: String },
|
|
227
227
|
type: { type: String },
|
|
228
228
|
created_at: { type: Number, default: Date.now },
|
|
229
|
+
updated_at: { type: Number, default: Date.now },
|
|
230
|
+
process_status: {
|
|
231
|
+
type: String,
|
|
232
|
+
enum: ['pending', 'in_progress', 'completed', 'failed'],
|
|
233
|
+
default: 'pending',
|
|
234
|
+
}, // status of the report generation process
|
|
235
|
+
}, {
|
|
236
|
+
versionKey: false,
|
|
237
|
+
toJSON: { virtuals: true },
|
|
238
|
+
toObject: { virtuals: true },
|
|
239
|
+
});
|
|
240
|
+
exports.MongoNotificationSchema = new mongoose_1.Schema({
|
|
241
|
+
user_id: { type: String, required: true },
|
|
242
|
+
message: { type: String, required: true },
|
|
243
|
+
is_read: { type: Boolean, default: false },
|
|
244
|
+
priority: { type: String, enum: types_1.notificationPriorityList, default: 'low' },
|
|
245
|
+
created_at: { type: Number, default: Date.now },
|
|
229
246
|
updated_at: { type: Number, default: Date.now }, // last update date
|
|
230
247
|
}, {
|
|
231
248
|
versionKey: false,
|
package/dist/types.d.ts
CHANGED
|
@@ -646,6 +646,7 @@ export declare const zodApiKeySchema: z.ZodObject<{
|
|
|
646
646
|
created_at?: number | undefined;
|
|
647
647
|
updated_at?: number | undefined;
|
|
648
648
|
}>;
|
|
649
|
+
export declare const reportProcessStatusList: readonly ["pending", "in_progress", "completed", "failed"];
|
|
649
650
|
export declare const zodReportSchema: z.ZodObject<{
|
|
650
651
|
_id: z.ZodOptional<z.ZodString>;
|
|
651
652
|
user_id: z.ZodString;
|
|
@@ -657,11 +658,13 @@ export declare const zodReportSchema: z.ZodObject<{
|
|
|
657
658
|
updated_at: z.ZodOptional<z.ZodNumber>;
|
|
658
659
|
report_html: z.ZodOptional<z.ZodString>;
|
|
659
660
|
type: z.ZodEnum<["pdf", "slide"]>;
|
|
661
|
+
process_status: z.ZodEnum<["pending", "in_progress", "completed", "failed"]>;
|
|
660
662
|
}, "strip", z.ZodTypeAny, {
|
|
661
663
|
type: "pdf" | "slide";
|
|
662
664
|
user_id: string;
|
|
663
665
|
thread_id: string;
|
|
664
666
|
last_assistant_messages_count: number;
|
|
667
|
+
process_status: "pending" | "in_progress" | "completed" | "failed";
|
|
665
668
|
_id?: string | undefined;
|
|
666
669
|
title?: string | undefined;
|
|
667
670
|
created_at?: number | undefined;
|
|
@@ -672,6 +675,7 @@ export declare const zodReportSchema: z.ZodObject<{
|
|
|
672
675
|
type: "pdf" | "slide";
|
|
673
676
|
user_id: string;
|
|
674
677
|
thread_id: string;
|
|
678
|
+
process_status: "pending" | "in_progress" | "completed" | "failed";
|
|
675
679
|
_id?: string | undefined;
|
|
676
680
|
title?: string | undefined;
|
|
677
681
|
created_at?: number | undefined;
|
|
@@ -680,6 +684,32 @@ export declare const zodReportSchema: z.ZodObject<{
|
|
|
680
684
|
additional_instructions?: string | undefined;
|
|
681
685
|
report_html?: string | undefined;
|
|
682
686
|
}>;
|
|
687
|
+
export declare const notificationPriorityList: readonly ["low", "medium", "high", "critical"];
|
|
688
|
+
export declare const zodNotificationSchema: z.ZodObject<{
|
|
689
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
690
|
+
user_id: z.ZodString;
|
|
691
|
+
message: z.ZodString;
|
|
692
|
+
is_read: z.ZodDefault<z.ZodBoolean>;
|
|
693
|
+
priority: z.ZodEnum<["low", "medium", "high", "critical"]>;
|
|
694
|
+
created_at: z.ZodOptional<z.ZodNumber>;
|
|
695
|
+
updated_at: z.ZodOptional<z.ZodNumber>;
|
|
696
|
+
}, "strip", z.ZodTypeAny, {
|
|
697
|
+
message: string;
|
|
698
|
+
user_id: string;
|
|
699
|
+
is_read: boolean;
|
|
700
|
+
priority: "low" | "medium" | "high" | "critical";
|
|
701
|
+
_id?: string | undefined;
|
|
702
|
+
created_at?: number | undefined;
|
|
703
|
+
updated_at?: number | undefined;
|
|
704
|
+
}, {
|
|
705
|
+
message: string;
|
|
706
|
+
user_id: string;
|
|
707
|
+
priority: "low" | "medium" | "high" | "critical";
|
|
708
|
+
_id?: string | undefined;
|
|
709
|
+
created_at?: number | undefined;
|
|
710
|
+
updated_at?: number | undefined;
|
|
711
|
+
is_read?: boolean | undefined;
|
|
712
|
+
}>;
|
|
683
713
|
/**
|
|
684
714
|
* 'approved' - active and approved sources,
|
|
685
715
|
* 'back_to_business' - sources that were paused and now resumed,
|
|
@@ -704,6 +734,7 @@ export type GeoType = z.infer<typeof zodGeoSchema>;
|
|
|
704
734
|
export type GeoSelectionType = z.infer<typeof zodGeoSelectionSchema>;
|
|
705
735
|
export type ApiKeyType = z.infer<typeof zodApiKeySchema>;
|
|
706
736
|
export type ReportType = z.infer<typeof zodReportSchema>;
|
|
737
|
+
export type NotificationType = z.infer<typeof zodNotificationSchema>;
|
|
707
738
|
export type UserPublicMetadata = {
|
|
708
739
|
is_admin?: boolean;
|
|
709
740
|
regions?: {
|
package/dist/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
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;
|
|
3
|
+
exports.zodNotificationSchema = exports.notificationPriorityList = exports.zodReportSchema = exports.reportProcessStatusList = 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,6 +192,12 @@ 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.reportProcessStatusList = [
|
|
196
|
+
'pending',
|
|
197
|
+
'in_progress',
|
|
198
|
+
'completed',
|
|
199
|
+
'failed', // report generation failed
|
|
200
|
+
];
|
|
195
201
|
exports.zodReportSchema = zod_1.z.object({
|
|
196
202
|
_id: zod_1.z.string().optional(),
|
|
197
203
|
user_id: zod_1.z.string().nonempty('User ID must be provided'),
|
|
@@ -202,5 +208,21 @@ exports.zodReportSchema = zod_1.z.object({
|
|
|
202
208
|
created_at: zod_1.z.number().optional(),
|
|
203
209
|
updated_at: zod_1.z.number().optional(),
|
|
204
210
|
report_html: zod_1.z.string().optional(),
|
|
205
|
-
type: zod_1.z.enum(['pdf', 'slide']),
|
|
211
|
+
type: zod_1.z.enum(['pdf', 'slide']),
|
|
212
|
+
process_status: zod_1.z.enum(exports.reportProcessStatusList), // status of the report generation process
|
|
213
|
+
});
|
|
214
|
+
exports.notificationPriorityList = [
|
|
215
|
+
'low',
|
|
216
|
+
'medium',
|
|
217
|
+
'high',
|
|
218
|
+
'critical',
|
|
219
|
+
];
|
|
220
|
+
exports.zodNotificationSchema = zod_1.z.object({
|
|
221
|
+
_id: zod_1.z.string().optional(),
|
|
222
|
+
user_id: zod_1.z.string(),
|
|
223
|
+
message: zod_1.z.string(),
|
|
224
|
+
is_read: zod_1.z.boolean().default(false),
|
|
225
|
+
priority: zod_1.z.enum(exports.notificationPriorityList),
|
|
226
|
+
created_at: zod_1.z.number().optional(),
|
|
227
|
+
updated_at: zod_1.z.number().optional(), // last update date
|
|
206
228
|
});
|
package/index.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export * from './types';
|
|
3
3
|
|
|
4
4
|
import { Schema } from 'mongoose';
|
|
5
|
-
import { generalStatusList } from './types';
|
|
5
|
+
import { generalStatusList, notificationPriorityList } from './types';
|
|
6
6
|
|
|
7
7
|
export const MongoDataSchema = new Schema(
|
|
8
8
|
{
|
|
@@ -245,7 +245,7 @@ export const MongoApiKeySchema = new Schema(
|
|
|
245
245
|
export const MongoReportSchema = new Schema(
|
|
246
246
|
{
|
|
247
247
|
user_id: { type: String, required: true }, // user identifier
|
|
248
|
-
thread_id: { type: String },
|
|
248
|
+
thread_id: { type: String },
|
|
249
249
|
title: { type: String }, // report title
|
|
250
250
|
last_assistant_messages_count: { type: Number }, // number of assistant messages at the time of report
|
|
251
251
|
additional_instructions: { type: String }, // additional instructions provided by the user
|
|
@@ -253,6 +253,27 @@ export const MongoReportSchema = new Schema(
|
|
|
253
253
|
type: { type: String }, // report type
|
|
254
254
|
created_at: { type: Number, default: Date.now }, // creation date
|
|
255
255
|
updated_at: { type: Number, default: Date.now }, // last update date
|
|
256
|
+
process_status: {
|
|
257
|
+
type: String,
|
|
258
|
+
enum: ['pending', 'in_progress', 'completed', 'failed'],
|
|
259
|
+
default: 'pending',
|
|
260
|
+
}, // status of the report generation process
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
versionKey: false,
|
|
264
|
+
toJSON: { virtuals: true },
|
|
265
|
+
toObject: { virtuals: true },
|
|
266
|
+
}
|
|
267
|
+
);
|
|
268
|
+
|
|
269
|
+
export const MongoNotificationSchema = new Schema(
|
|
270
|
+
{
|
|
271
|
+
user_id: { type: String, required: true }, // user identifier
|
|
272
|
+
message: { type: String, required: true }, // notification message
|
|
273
|
+
is_read: { type: Boolean, default: false }, // read status
|
|
274
|
+
priority: { type: String, enum: notificationPriorityList, default: 'low' }, // notification priority
|
|
275
|
+
created_at: { type: Number, default: Date.now }, // creation date
|
|
276
|
+
updated_at: { type: Number, default: Date.now }, // last update date
|
|
256
277
|
},
|
|
257
278
|
{
|
|
258
279
|
versionKey: false,
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -213,6 +213,13 @@ export const zodApiKeySchema = z.object({
|
|
|
213
213
|
status: z.enum(generalStatusList).default('active'), // status of the API key
|
|
214
214
|
});
|
|
215
215
|
|
|
216
|
+
export const reportProcessStatusList = [
|
|
217
|
+
'pending', // report generation is pending
|
|
218
|
+
'in_progress', // report generation is in progress
|
|
219
|
+
'completed', // report generation is completed
|
|
220
|
+
'failed', // report generation failed
|
|
221
|
+
] as const;
|
|
222
|
+
|
|
216
223
|
export const zodReportSchema = z.object({
|
|
217
224
|
_id: z.string().optional(),
|
|
218
225
|
user_id: z.string().nonempty('User ID must be provided'), // user identifier
|
|
@@ -224,6 +231,24 @@ export const zodReportSchema = z.object({
|
|
|
224
231
|
updated_at: z.number().optional(), // last update date
|
|
225
232
|
report_html: z.string().optional(), // generated report in HTML format
|
|
226
233
|
type: z.enum(['pdf', 'slide']), // type of the report
|
|
234
|
+
process_status: z.enum(reportProcessStatusList), // status of the report generation process
|
|
235
|
+
});
|
|
236
|
+
|
|
237
|
+
export const notificationPriorityList = [
|
|
238
|
+
'low',
|
|
239
|
+
'medium',
|
|
240
|
+
'high',
|
|
241
|
+
'critical',
|
|
242
|
+
] as const;
|
|
243
|
+
|
|
244
|
+
export const zodNotificationSchema = z.object({
|
|
245
|
+
_id: z.string().optional(),
|
|
246
|
+
user_id: z.string(), // user identifier
|
|
247
|
+
message: z.string(), // notification message
|
|
248
|
+
is_read: z.boolean().default(false), // true if the notification has been read
|
|
249
|
+
priority: z.enum(notificationPriorityList), // priority of the notification
|
|
250
|
+
created_at: z.number().optional(), // creation date
|
|
251
|
+
updated_at: z.number().optional(), // last update date
|
|
227
252
|
});
|
|
228
253
|
|
|
229
254
|
/**
|
|
@@ -257,6 +282,7 @@ export type GeoType = z.infer<typeof zodGeoSchema>;
|
|
|
257
282
|
export type GeoSelectionType = z.infer<typeof zodGeoSelectionSchema>;
|
|
258
283
|
export type ApiKeyType = z.infer<typeof zodApiKeySchema>;
|
|
259
284
|
export type ReportType = z.infer<typeof zodReportSchema>;
|
|
285
|
+
export type NotificationType = z.infer<typeof zodNotificationSchema>;
|
|
260
286
|
|
|
261
287
|
export type UserPublicMetadata = {
|
|
262
288
|
is_admin?: boolean;
|