asfur 1.0.14 → 1.0.16
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 +11 -1
- package/dist/types.d.ts +0 -12
- package/dist/types.js +0 -12
- package/index.ts +15 -2
- package/package.json +1 -1
- package/types.ts +0 -13
package/dist/index.d.ts
CHANGED
|
@@ -202,3 +202,54 @@ export declare const MongoDataSchema: Schema<{
|
|
|
202
202
|
}> & {
|
|
203
203
|
__v: number;
|
|
204
204
|
}>;
|
|
205
|
+
export declare const MongoInstructionsSchema: Schema<{
|
|
206
|
+
user_id: string;
|
|
207
|
+
prompt: string;
|
|
208
|
+
_id?: string | undefined;
|
|
209
|
+
created_at?: number | Date | undefined;
|
|
210
|
+
updated_at?: number | Date | undefined;
|
|
211
|
+
}, import("mongoose").Model<{
|
|
212
|
+
user_id: string;
|
|
213
|
+
prompt: string;
|
|
214
|
+
_id?: string | undefined;
|
|
215
|
+
created_at?: number | Date | undefined;
|
|
216
|
+
updated_at?: number | Date | undefined;
|
|
217
|
+
}, any, any, any, import("mongoose").Document<unknown, any, {
|
|
218
|
+
user_id: string;
|
|
219
|
+
prompt: string;
|
|
220
|
+
_id?: string | undefined;
|
|
221
|
+
created_at?: number | Date | undefined;
|
|
222
|
+
updated_at?: number | Date | undefined;
|
|
223
|
+
}, any> & {
|
|
224
|
+
user_id: string;
|
|
225
|
+
prompt: string;
|
|
226
|
+
_id?: string | undefined;
|
|
227
|
+
created_at?: number | Date | undefined;
|
|
228
|
+
updated_at?: number | Date | undefined;
|
|
229
|
+
} & Required<{
|
|
230
|
+
_id: string;
|
|
231
|
+
}> & {
|
|
232
|
+
__v: number;
|
|
233
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
|
234
|
+
user_id: string;
|
|
235
|
+
prompt: string;
|
|
236
|
+
_id?: string | undefined;
|
|
237
|
+
created_at?: number | Date | undefined;
|
|
238
|
+
updated_at?: number | Date | undefined;
|
|
239
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
240
|
+
user_id: string;
|
|
241
|
+
prompt: string;
|
|
242
|
+
_id?: string | undefined;
|
|
243
|
+
created_at?: number | Date | undefined;
|
|
244
|
+
updated_at?: number | Date | undefined;
|
|
245
|
+
}>, {}> & import("mongoose").FlatRecord<{
|
|
246
|
+
user_id: string;
|
|
247
|
+
prompt: string;
|
|
248
|
+
_id?: string | undefined;
|
|
249
|
+
created_at?: number | Date | undefined;
|
|
250
|
+
updated_at?: number | Date | undefined;
|
|
251
|
+
}> & Required<{
|
|
252
|
+
_id: string;
|
|
253
|
+
}> & {
|
|
254
|
+
__v: number;
|
|
255
|
+
}>;
|
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.MongoDataSchema = void 0;
|
|
17
|
+
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");
|
|
@@ -40,4 +40,14 @@ exports.MongoDataSchema = new mongoose_1.Schema({
|
|
|
40
40
|
toJSON: { virtuals: true },
|
|
41
41
|
toObject: { virtuals: true },
|
|
42
42
|
});
|
|
43
|
+
exports.MongoInstructionsSchema = new mongoose_1.Schema({
|
|
44
|
+
user_id: { type: String, required: true },
|
|
45
|
+
prompt: { type: String },
|
|
46
|
+
created_at: { type: Number, default: Date.now },
|
|
47
|
+
updated_at: { type: Number, default: Date.now },
|
|
48
|
+
}, {
|
|
49
|
+
versionKey: false,
|
|
50
|
+
toJSON: { virtuals: true },
|
|
51
|
+
toObject: { virtuals: true },
|
|
52
|
+
});
|
|
43
53
|
// export const DataModel = model('DataModel', MongoDataSchema, 'data');
|
package/dist/types.d.ts
CHANGED
|
@@ -55,18 +55,6 @@ export declare const zodSourceSchema: z.ZodObject<{
|
|
|
55
55
|
metadata?: Record<string, any> | undefined;
|
|
56
56
|
updated_at?: Date | undefined;
|
|
57
57
|
}>;
|
|
58
|
-
/**
|
|
59
|
-
* ids:
|
|
60
|
-
* 1. _id: MongoDB ObjectId as string
|
|
61
|
-
* 2. source_id: reference to Source _id
|
|
62
|
-
* 3. platform_id: e.g., 'telegram:1234567890' (channel_id)
|
|
63
|
-
* 4. original_id: ID from the platform (e.g., message_id
|
|
64
|
-
*
|
|
65
|
-
* INDEXES:
|
|
66
|
-
* - source_id: reference to Source _id
|
|
67
|
-
* - timestamp: date in milliseconds (e.g., 1751210833000)
|
|
68
|
-
* - text_geo: array of strings (e.g., ["sinjil", "ramallah", "west bank"])
|
|
69
|
-
*/
|
|
70
58
|
export declare const zodDataSchema: z.ZodObject<{
|
|
71
59
|
_id: z.ZodOptional<z.ZodString>;
|
|
72
60
|
source_id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
package/dist/types.js
CHANGED
|
@@ -30,18 +30,6 @@ exports.zodSourceSchema = zod_1.z.object({
|
|
|
30
30
|
created_at: zod_1.z.coerce.date(),
|
|
31
31
|
updated_at: zod_1.z.coerce.date().optional(),
|
|
32
32
|
});
|
|
33
|
-
/**
|
|
34
|
-
* ids:
|
|
35
|
-
* 1. _id: MongoDB ObjectId as string
|
|
36
|
-
* 2. source_id: reference to Source _id
|
|
37
|
-
* 3. platform_id: e.g., 'telegram:1234567890' (channel_id)
|
|
38
|
-
* 4. original_id: ID from the platform (e.g., message_id
|
|
39
|
-
*
|
|
40
|
-
* INDEXES:
|
|
41
|
-
* - source_id: reference to Source _id
|
|
42
|
-
* - timestamp: date in milliseconds (e.g., 1751210833000)
|
|
43
|
-
* - text_geo: array of strings (e.g., ["sinjil", "ramallah", "west bank"])
|
|
44
|
-
*/
|
|
45
33
|
exports.zodDataSchema = zod_1.z.object({
|
|
46
34
|
_id: zod_1.z.string().optional(),
|
|
47
35
|
source_id: zod_1.z.string().or(zod_1.z.number()),
|
package/index.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export * from './types';
|
|
3
3
|
|
|
4
4
|
import { Schema, model } from 'mongoose';
|
|
5
|
-
import { DataType } from './types';
|
|
5
|
+
import { DataType, InstructionsType } from './types';
|
|
6
6
|
|
|
7
7
|
export const MongoDataSchema = new Schema<DataType>(
|
|
8
8
|
{
|
|
@@ -22,13 +22,26 @@ export const MongoDataSchema = new Schema<DataType>(
|
|
|
22
22
|
reply_to_message_id: { type: String || Number },
|
|
23
23
|
created_at: { type: Number, default: Date.now },
|
|
24
24
|
updated_at: { type: Number, default: Date.now },
|
|
25
|
-
|
|
26
25
|
},
|
|
27
26
|
{
|
|
28
27
|
versionKey: false,
|
|
29
28
|
toJSON: { virtuals: true },
|
|
30
29
|
toObject: { virtuals: true },
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
export const MongoInstructionsSchema = new Schema<InstructionsType>(
|
|
34
|
+
{
|
|
35
|
+
user_id: { type: String, required: true },
|
|
36
|
+
prompt: { type: String },
|
|
37
|
+
created_at: { type: Number, default: Date.now },
|
|
38
|
+
updated_at: { type: Number, default: Date.now },
|
|
31
39
|
},
|
|
40
|
+
{
|
|
41
|
+
versionKey: false,
|
|
42
|
+
toJSON: { virtuals: true },
|
|
43
|
+
toObject: { virtuals: true },
|
|
44
|
+
}
|
|
32
45
|
);
|
|
33
46
|
|
|
34
47
|
// export const DataModel = model('DataModel', MongoDataSchema, 'data');
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -30,19 +30,6 @@ export const zodSourceSchema = z.object({
|
|
|
30
30
|
updated_at: z.coerce.date().optional(),
|
|
31
31
|
});
|
|
32
32
|
|
|
33
|
-
/**
|
|
34
|
-
* ids:
|
|
35
|
-
* 1. _id: MongoDB ObjectId as string
|
|
36
|
-
* 2. source_id: reference to Source _id
|
|
37
|
-
* 3. platform_id: e.g., 'telegram:1234567890' (channel_id)
|
|
38
|
-
* 4. original_id: ID from the platform (e.g., message_id
|
|
39
|
-
*
|
|
40
|
-
* INDEXES:
|
|
41
|
-
* - source_id: reference to Source _id
|
|
42
|
-
* - timestamp: date in milliseconds (e.g., 1751210833000)
|
|
43
|
-
* - text_geo: array of strings (e.g., ["sinjil", "ramallah", "west bank"])
|
|
44
|
-
*/
|
|
45
|
-
|
|
46
33
|
export const zodDataSchema = z.object({
|
|
47
34
|
_id: z.string().optional(),
|
|
48
35
|
source_id: z.string().or(z.number()), // INDEX - reference to Source _id (e.g., '60c72b2f9b1e8d3f4c8b4567')
|