asfur 1.0.29 → 1.0.31
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 +51 -0
- package/dist/index.js +16 -1
- package/dist/types.d.ts +21 -0
- package/dist/types.js +9 -1
- package/index.ts +20 -0
- package/package.json +1 -1
- package/types.ts +11 -0
package/dist/index.d.ts
CHANGED
|
@@ -623,3 +623,54 @@ export declare const MongoUserSettingsSchema: Schema<{
|
|
|
623
623
|
}> & {
|
|
624
624
|
__v: number;
|
|
625
625
|
}>;
|
|
626
|
+
export declare const MongoConversationSchema: Schema<{
|
|
627
|
+
status: "inactive" | "active";
|
|
628
|
+
user_id: string;
|
|
629
|
+
_id?: string | undefined;
|
|
630
|
+
title?: string | undefined;
|
|
631
|
+
thread_id?: string | undefined;
|
|
632
|
+
}, import("mongoose").Model<{
|
|
633
|
+
status: "inactive" | "active";
|
|
634
|
+
user_id: string;
|
|
635
|
+
_id?: string | undefined;
|
|
636
|
+
title?: string | undefined;
|
|
637
|
+
thread_id?: string | undefined;
|
|
638
|
+
}, any, any, any, import("mongoose").Document<unknown, any, {
|
|
639
|
+
status: "inactive" | "active";
|
|
640
|
+
user_id: string;
|
|
641
|
+
_id?: string | undefined;
|
|
642
|
+
title?: string | undefined;
|
|
643
|
+
thread_id?: string | undefined;
|
|
644
|
+
}, any> & {
|
|
645
|
+
status: "inactive" | "active";
|
|
646
|
+
user_id: string;
|
|
647
|
+
_id?: string | undefined;
|
|
648
|
+
title?: string | undefined;
|
|
649
|
+
thread_id?: string | undefined;
|
|
650
|
+
} & Required<{
|
|
651
|
+
_id: string;
|
|
652
|
+
}> & {
|
|
653
|
+
__v: number;
|
|
654
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
|
655
|
+
status: "inactive" | "active";
|
|
656
|
+
user_id: string;
|
|
657
|
+
_id?: string | undefined;
|
|
658
|
+
title?: string | undefined;
|
|
659
|
+
thread_id?: string | undefined;
|
|
660
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
661
|
+
status: "inactive" | "active";
|
|
662
|
+
user_id: string;
|
|
663
|
+
_id?: string | undefined;
|
|
664
|
+
title?: string | undefined;
|
|
665
|
+
thread_id?: string | undefined;
|
|
666
|
+
}>, {}> & import("mongoose").FlatRecord<{
|
|
667
|
+
status: "inactive" | "active";
|
|
668
|
+
user_id: string;
|
|
669
|
+
_id?: string | undefined;
|
|
670
|
+
title?: string | undefined;
|
|
671
|
+
thread_id?: string | undefined;
|
|
672
|
+
}> & Required<{
|
|
673
|
+
_id: string;
|
|
674
|
+
}> & {
|
|
675
|
+
__v: number;
|
|
676
|
+
}>;
|
package/dist/index.js
CHANGED
|
@@ -14,10 +14,11 @@ 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.MongoUserSettingsSchema = exports.MongoQuerySchema = exports.MongoSourceSchema = exports.MongoInstructionsSchema = exports.MongoDataSchema = void 0;
|
|
17
|
+
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");
|
|
21
|
+
const types_1 = require("./types");
|
|
21
22
|
exports.MongoDataSchema = new mongoose_1.Schema({
|
|
22
23
|
source_id: { type: String || Number },
|
|
23
24
|
source_public_id: { type: String || Number },
|
|
@@ -117,3 +118,17 @@ exports.MongoUserSettingsSchema = new mongoose_1.Schema({
|
|
|
117
118
|
toJSON: { virtuals: true },
|
|
118
119
|
toObject: { virtuals: true },
|
|
119
120
|
});
|
|
121
|
+
exports.MongoConversationSchema = new mongoose_1.Schema({
|
|
122
|
+
user_id: { type: String, required: true },
|
|
123
|
+
title: { type: String },
|
|
124
|
+
thread_id: { type: String },
|
|
125
|
+
status: {
|
|
126
|
+
type: String,
|
|
127
|
+
enum: types_1.generalStatusList,
|
|
128
|
+
default: 'active',
|
|
129
|
+
}, // status of the conversation
|
|
130
|
+
}, {
|
|
131
|
+
versionKey: false,
|
|
132
|
+
toJSON: { virtuals: true },
|
|
133
|
+
toObject: { virtuals: true },
|
|
134
|
+
});
|
package/dist/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const platformsList: readonly ["telegram", "facebook", "instagram", "tiktok", "website", "document", "other"];
|
|
3
3
|
export declare const statusList: readonly ["approved", "pending", "inactive", "in_review"];
|
|
4
|
+
export declare const generalStatusList: readonly ["active", "inactive"];
|
|
4
5
|
export declare const zodSourceSchema: z.ZodObject<{
|
|
5
6
|
_id: z.ZodOptional<z.ZodString>;
|
|
6
7
|
title: z.ZodOptional<z.ZodString>;
|
|
@@ -303,6 +304,25 @@ export declare const zodUserSettingsSchema: z.ZodObject<{
|
|
|
303
304
|
thread_id?: string | undefined;
|
|
304
305
|
instructions?: string | undefined;
|
|
305
306
|
}>;
|
|
307
|
+
export declare const zodConversationSchema: z.ZodObject<{
|
|
308
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
309
|
+
user_id: z.ZodString;
|
|
310
|
+
title: z.ZodOptional<z.ZodString>;
|
|
311
|
+
thread_id: z.ZodOptional<z.ZodString>;
|
|
312
|
+
status: z.ZodDefault<z.ZodEnum<["active", "inactive"]>>;
|
|
313
|
+
}, "strip", z.ZodTypeAny, {
|
|
314
|
+
status: "inactive" | "active";
|
|
315
|
+
user_id: string;
|
|
316
|
+
_id?: string | undefined;
|
|
317
|
+
title?: string | undefined;
|
|
318
|
+
thread_id?: string | undefined;
|
|
319
|
+
}, {
|
|
320
|
+
user_id: string;
|
|
321
|
+
_id?: string | undefined;
|
|
322
|
+
title?: string | undefined;
|
|
323
|
+
status?: "inactive" | "active" | undefined;
|
|
324
|
+
thread_id?: string | undefined;
|
|
325
|
+
}>;
|
|
306
326
|
export type SourceType = z.infer<typeof zodSourceSchema>;
|
|
307
327
|
export type DataType = z.infer<typeof zodDataSchema>;
|
|
308
328
|
export type QueryType = z.infer<typeof zodQuerySchema>;
|
|
@@ -313,3 +333,4 @@ export type TimeRangeTypeLiteral = 'relative' | 'absolute';
|
|
|
313
333
|
export type RelativeTimeRangeType = (typeof relativeTimeRangeList)[number];
|
|
314
334
|
export type AddSourceToReviewType = Pick<SourceType, 'platform' | 'url' | 'description' | 'source_public_id'>;
|
|
315
335
|
export type UserSettingsType = z.infer<typeof zodUserSettingsSchema>;
|
|
336
|
+
export type ConversationType = z.infer<typeof zodConversationSchema>;
|
package/dist/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.zodUserSettingsSchema = exports.zodInstructionsSchema = exports.zodQuerySchema = exports.zodAbsoluteTimeRangeSchema = exports.zodRelativeTimeRangeSchema = exports.relativeTimeRangeList = exports.zodDataSchema = exports.zodSourceSchema = exports.statusList = exports.platformsList = void 0;
|
|
3
|
+
exports.zodConversationSchema = exports.zodUserSettingsSchema = exports.zodInstructionsSchema = exports.zodQuerySchema = exports.zodAbsoluteTimeRangeSchema = exports.zodRelativeTimeRangeSchema = exports.relativeTimeRangeList = exports.zodDataSchema = exports.zodSourceSchema = exports.generalStatusList = exports.statusList = exports.platformsList = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
exports.platformsList = [
|
|
6
6
|
'telegram',
|
|
@@ -17,6 +17,7 @@ exports.statusList = [
|
|
|
17
17
|
'inactive',
|
|
18
18
|
'in_review',
|
|
19
19
|
];
|
|
20
|
+
exports.generalStatusList = ['active', 'inactive'];
|
|
20
21
|
exports.zodSourceSchema = zod_1.z.object({
|
|
21
22
|
_id: zod_1.z.string().optional(),
|
|
22
23
|
title: zod_1.z.string().optional(),
|
|
@@ -111,3 +112,10 @@ exports.zodUserSettingsSchema = zod_1.z.object({
|
|
|
111
112
|
user_id: zod_1.z.string().nonempty('User ID must be provided'),
|
|
112
113
|
instructions: zod_1.z.string().optional(), // optional user instructions for the query
|
|
113
114
|
});
|
|
115
|
+
exports.zodConversationSchema = zod_1.z.object({
|
|
116
|
+
_id: zod_1.z.string().optional(),
|
|
117
|
+
user_id: zod_1.z.string().nonempty('User ID must be provided'),
|
|
118
|
+
title: zod_1.z.string().optional(),
|
|
119
|
+
thread_id: zod_1.z.string().optional(),
|
|
120
|
+
status: zod_1.z.enum(exports.generalStatusList).default('active'), // status of the conversation
|
|
121
|
+
});
|
package/index.ts
CHANGED
|
@@ -3,7 +3,9 @@ export * from './types';
|
|
|
3
3
|
|
|
4
4
|
import { Schema } from 'mongoose';
|
|
5
5
|
import {
|
|
6
|
+
ConversationType,
|
|
6
7
|
DataType,
|
|
8
|
+
generalStatusList,
|
|
7
9
|
InstructionsType,
|
|
8
10
|
QueryType,
|
|
9
11
|
SourceType,
|
|
@@ -128,3 +130,21 @@ export const MongoUserSettingsSchema = new Schema<UserSettingsType>(
|
|
|
128
130
|
toObject: { virtuals: true },
|
|
129
131
|
}
|
|
130
132
|
);
|
|
133
|
+
|
|
134
|
+
export const MongoConversationSchema = new Schema<ConversationType>(
|
|
135
|
+
{
|
|
136
|
+
user_id: { type: String, required: true }, // user identifier
|
|
137
|
+
title: { type: String }, // optional title for the conversation
|
|
138
|
+
thread_id: { type: String }, // thread ID for the conversation
|
|
139
|
+
status: {
|
|
140
|
+
type: String,
|
|
141
|
+
enum: generalStatusList,
|
|
142
|
+
default: 'active',
|
|
143
|
+
}, // status of the conversation
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
versionKey: false,
|
|
147
|
+
toJSON: { virtuals: true },
|
|
148
|
+
toObject: { virtuals: true },
|
|
149
|
+
}
|
|
150
|
+
);
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -17,6 +17,8 @@ export const statusList = [
|
|
|
17
17
|
'in_review',
|
|
18
18
|
] as const;
|
|
19
19
|
|
|
20
|
+
export const generalStatusList = ['active', 'inactive'] as const;
|
|
21
|
+
|
|
20
22
|
export const zodSourceSchema = z.object({
|
|
21
23
|
_id: z.string().optional(),
|
|
22
24
|
title: z.string().optional(), // e.g., 'Telegram Channel Name'
|
|
@@ -121,6 +123,14 @@ export const zodUserSettingsSchema = z.object({
|
|
|
121
123
|
instructions: z.string().optional(), // optional user instructions for the query
|
|
122
124
|
});
|
|
123
125
|
|
|
126
|
+
export const zodConversationSchema = z.object({
|
|
127
|
+
_id: z.string().optional(),
|
|
128
|
+
user_id: z.string().nonempty('User ID must be provided'), // user identifier
|
|
129
|
+
title: z.string().optional(), // optional title for the conversation
|
|
130
|
+
thread_id: z.string().optional(), // thread ID for the conversation
|
|
131
|
+
status: z.enum(generalStatusList).default('active'), // status of the conversation
|
|
132
|
+
});
|
|
133
|
+
|
|
124
134
|
export type SourceType = z.infer<typeof zodSourceSchema>;
|
|
125
135
|
export type DataType = z.infer<typeof zodDataSchema>;
|
|
126
136
|
export type QueryType = z.infer<typeof zodQuerySchema>;
|
|
@@ -136,3 +146,4 @@ export type AddSourceToReviewType = Pick<
|
|
|
136
146
|
'platform' | 'url' | 'description' | 'source_public_id'
|
|
137
147
|
>;
|
|
138
148
|
export type UserSettingsType = z.infer<typeof zodUserSettingsSchema>;
|
|
149
|
+
export type ConversationType = z.infer<typeof zodConversationSchema>;
|