asfur 1.0.71 → 1.0.73
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 +34 -0
- package/dist/index.js +18 -2
- package/dist/types.d.ts +26 -0
- package/dist/types.js +11 -2
- package/index.ts +20 -0
- package/package.json +1 -1
- package/types.ts +11 -1
package/dist/index.d.ts
CHANGED
|
@@ -158,6 +158,7 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
|
|
|
158
158
|
url?: string | null | undefined;
|
|
159
159
|
source_geo?: string | null | undefined;
|
|
160
160
|
source_region?: string | null | undefined;
|
|
161
|
+
server?: string | null | undefined;
|
|
161
162
|
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
162
163
|
status: "approved" | "back_to_business" | "pending" | "inactive" | "in_review";
|
|
163
164
|
subscribers: string[];
|
|
@@ -176,6 +177,7 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
|
|
|
176
177
|
url?: string | null | undefined;
|
|
177
178
|
source_geo?: string | null | undefined;
|
|
178
179
|
source_region?: string | null | undefined;
|
|
180
|
+
server?: string | null | undefined;
|
|
179
181
|
}>, {}> & import("mongoose").FlatRecord<{
|
|
180
182
|
status: "approved" | "back_to_business" | "pending" | "inactive" | "in_review";
|
|
181
183
|
subscribers: string[];
|
|
@@ -194,6 +196,7 @@ export declare const MongoSourceSchema: Schema<any, import("mongoose").Model<any
|
|
|
194
196
|
url?: string | null | undefined;
|
|
195
197
|
source_geo?: string | null | undefined;
|
|
196
198
|
source_region?: string | null | undefined;
|
|
199
|
+
server?: string | null | undefined;
|
|
197
200
|
}> & {
|
|
198
201
|
_id: import("mongoose").Types.ObjectId;
|
|
199
202
|
} & {
|
|
@@ -451,3 +454,34 @@ export declare const MongoGeoSelectionSchema: Schema<any, import("mongoose").Mod
|
|
|
451
454
|
} & {
|
|
452
455
|
__v: number;
|
|
453
456
|
}>;
|
|
457
|
+
export declare const MongoApiKeySchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
458
|
+
versionKey: false;
|
|
459
|
+
toJSON: {
|
|
460
|
+
virtuals: true;
|
|
461
|
+
};
|
|
462
|
+
toObject: {
|
|
463
|
+
virtuals: true;
|
|
464
|
+
};
|
|
465
|
+
}, {
|
|
466
|
+
status: "inactive" | "active";
|
|
467
|
+
created_at: number;
|
|
468
|
+
updated_at: number;
|
|
469
|
+
user_id: string;
|
|
470
|
+
api_key: string;
|
|
471
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
472
|
+
status: "inactive" | "active";
|
|
473
|
+
created_at: number;
|
|
474
|
+
updated_at: number;
|
|
475
|
+
user_id: string;
|
|
476
|
+
api_key: string;
|
|
477
|
+
}>, {}> & import("mongoose").FlatRecord<{
|
|
478
|
+
status: "inactive" | "active";
|
|
479
|
+
created_at: number;
|
|
480
|
+
updated_at: number;
|
|
481
|
+
user_id: string;
|
|
482
|
+
api_key: string;
|
|
483
|
+
}> & {
|
|
484
|
+
_id: import("mongoose").Types.ObjectId;
|
|
485
|
+
} & {
|
|
486
|
+
__v: number;
|
|
487
|
+
}>;
|
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.MongoGeoSelectionSchema = exports.MongoGeoSchema = exports.MongoJobSchema = exports.MongoConversationSchema = exports.MongoUserSettingsSchema = exports.MongoQuerySchema = exports.MongoSourceSchema = exports.MongoInstructionsSchema = exports.MongoDataSchema = void 0;
|
|
17
|
+
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");
|
|
@@ -86,7 +86,8 @@ exports.MongoSourceSchema = new mongoose_1.Schema({
|
|
|
86
86
|
subscribers: { type: [String], default: [] },
|
|
87
87
|
created_at: { type: Number, default: Date.now },
|
|
88
88
|
updated_at: { type: Number, default: Date.now },
|
|
89
|
-
source_region: { type: String },
|
|
89
|
+
source_region: { type: String },
|
|
90
|
+
server: { type: String }, // e.g., server handling this source
|
|
90
91
|
}, {
|
|
91
92
|
versionKey: false,
|
|
92
93
|
toJSON: { virtuals: true },
|
|
@@ -197,3 +198,18 @@ exports.MongoGeoSelectionSchema = new mongoose_1.Schema({
|
|
|
197
198
|
toJSON: { virtuals: true },
|
|
198
199
|
toObject: { virtuals: true },
|
|
199
200
|
});
|
|
201
|
+
exports.MongoApiKeySchema = new mongoose_1.Schema({
|
|
202
|
+
user_id: { type: String, required: true },
|
|
203
|
+
api_key: { type: String, required: true },
|
|
204
|
+
created_at: { type: Number, default: Date.now },
|
|
205
|
+
updated_at: { type: Number, default: Date.now },
|
|
206
|
+
status: {
|
|
207
|
+
type: String,
|
|
208
|
+
enum: types_1.generalStatusList,
|
|
209
|
+
default: 'active',
|
|
210
|
+
}, // status of the API key
|
|
211
|
+
}, {
|
|
212
|
+
versionKey: false,
|
|
213
|
+
toJSON: { virtuals: true },
|
|
214
|
+
toObject: { virtuals: true },
|
|
215
|
+
});
|
package/dist/types.d.ts
CHANGED
|
@@ -76,6 +76,7 @@ export declare const zodSourceSchema: z.ZodObject<{
|
|
|
76
76
|
user_id: z.ZodOptional<z.ZodString>;
|
|
77
77
|
subscribers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
78
78
|
source_region: z.ZodOptional<z.ZodString>;
|
|
79
|
+
server: z.ZodOptional<z.ZodString>;
|
|
79
80
|
}, "strip", z.ZodTypeAny, {
|
|
80
81
|
status: "approved" | "back_to_business" | "pending" | "inactive" | "in_review";
|
|
81
82
|
platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "document" | "other";
|
|
@@ -97,6 +98,7 @@ export declare const zodSourceSchema: z.ZodObject<{
|
|
|
97
98
|
metadata?: Record<string, any> | undefined;
|
|
98
99
|
user_id?: string | undefined;
|
|
99
100
|
source_region?: string | undefined;
|
|
101
|
+
server?: string | undefined;
|
|
100
102
|
}, {
|
|
101
103
|
status: "approved" | "back_to_business" | "pending" | "inactive" | "in_review";
|
|
102
104
|
platform: "telegram" | "facebook" | "instagram" | "tiktok" | "website" | "document" | "other";
|
|
@@ -118,6 +120,7 @@ export declare const zodSourceSchema: z.ZodObject<{
|
|
|
118
120
|
metadata?: Record<string, any> | undefined;
|
|
119
121
|
user_id?: string | undefined;
|
|
120
122
|
source_region?: string | undefined;
|
|
123
|
+
server?: string | undefined;
|
|
121
124
|
}>;
|
|
122
125
|
export declare const zodDataSchema: z.ZodObject<{
|
|
123
126
|
_id: z.ZodOptional<z.ZodString>;
|
|
@@ -596,6 +599,28 @@ export declare const zodCronScheduleResponseSchema: z.ZodObject<{
|
|
|
596
599
|
schedule?: string | undefined;
|
|
597
600
|
error?: string | undefined;
|
|
598
601
|
}>;
|
|
602
|
+
export declare const zodApiKeySchema: z.ZodObject<{
|
|
603
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
604
|
+
user_id: z.ZodString;
|
|
605
|
+
api_key: z.ZodString;
|
|
606
|
+
created_at: z.ZodOptional<z.ZodNumber>;
|
|
607
|
+
updated_at: z.ZodOptional<z.ZodNumber>;
|
|
608
|
+
status: z.ZodDefault<z.ZodEnum<["active", "inactive"]>>;
|
|
609
|
+
}, "strip", z.ZodTypeAny, {
|
|
610
|
+
status: "inactive" | "active";
|
|
611
|
+
user_id: string;
|
|
612
|
+
api_key: string;
|
|
613
|
+
_id?: string | undefined;
|
|
614
|
+
created_at?: number | undefined;
|
|
615
|
+
updated_at?: number | undefined;
|
|
616
|
+
}, {
|
|
617
|
+
user_id: string;
|
|
618
|
+
api_key: string;
|
|
619
|
+
_id?: string | undefined;
|
|
620
|
+
status?: "inactive" | "active" | undefined;
|
|
621
|
+
created_at?: number | undefined;
|
|
622
|
+
updated_at?: number | undefined;
|
|
623
|
+
}>;
|
|
599
624
|
export type SourceType = z.infer<typeof zodSourceSchema>;
|
|
600
625
|
export type DataType = z.infer<typeof zodDataSchema>;
|
|
601
626
|
export type QueryType = z.infer<typeof zodQuerySchema>;
|
|
@@ -611,3 +636,4 @@ export type JobType = z.infer<typeof zodJobSchema>;
|
|
|
611
636
|
export type CronScheduleResponseType = z.infer<typeof zodCronScheduleResponseSchema>;
|
|
612
637
|
export type GeoType = z.infer<typeof zodGeoSchema>;
|
|
613
638
|
export type GeoSelectionType = z.infer<typeof zodGeoSelectionSchema>;
|
|
639
|
+
export type ApiKeyType = z.infer<typeof zodApiKeySchema>;
|
package/dist/types.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
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.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',
|
|
@@ -58,7 +58,8 @@ exports.zodSourceSchema = zod_1.z.object({
|
|
|
58
58
|
updated_at: zod_1.z.number().optional(),
|
|
59
59
|
user_id: zod_1.z.string().optional(),
|
|
60
60
|
subscribers: zod_1.z.array(zod_1.z.string()).optional(),
|
|
61
|
-
source_region: zod_1.z.string().optional(),
|
|
61
|
+
source_region: zod_1.z.string().optional(),
|
|
62
|
+
server: zod_1.z.string().optional(), // e.g., server handling this source
|
|
62
63
|
});
|
|
63
64
|
exports.zodDataSchema = zod_1.z.object({
|
|
64
65
|
_id: zod_1.z.string().optional(),
|
|
@@ -179,3 +180,11 @@ exports.zodCronScheduleResponseSchema = zod_1.z.object({
|
|
|
179
180
|
is_ok: zod_1.z.boolean(),
|
|
180
181
|
error: zod_1.z.string().optional(), // error message if the cron job is invalid
|
|
181
182
|
});
|
|
183
|
+
exports.zodApiKeySchema = zod_1.z.object({
|
|
184
|
+
_id: zod_1.z.string().optional(),
|
|
185
|
+
user_id: zod_1.z.string(),
|
|
186
|
+
api_key: zod_1.z.string(),
|
|
187
|
+
created_at: zod_1.z.number().optional(),
|
|
188
|
+
updated_at: zod_1.z.number().optional(),
|
|
189
|
+
status: zod_1.z.enum(exports.generalStatusList).default('active'), // status of the API key
|
|
190
|
+
});
|
package/index.ts
CHANGED
|
@@ -81,6 +81,7 @@ export const MongoSourceSchema = new Schema(
|
|
|
81
81
|
created_at: { type: Number, default: Date.now },
|
|
82
82
|
updated_at: { type: Number, default: Date.now },
|
|
83
83
|
source_region: { type: String }, // e.g., "New York", "California"
|
|
84
|
+
server: { type: String }, // e.g., server handling this source
|
|
84
85
|
},
|
|
85
86
|
{
|
|
86
87
|
versionKey: false,
|
|
@@ -217,3 +218,22 @@ export const MongoGeoSelectionSchema = new Schema(
|
|
|
217
218
|
toObject: { virtuals: true },
|
|
218
219
|
}
|
|
219
220
|
);
|
|
221
|
+
|
|
222
|
+
export const MongoApiKeySchema = new Schema(
|
|
223
|
+
{
|
|
224
|
+
user_id: { type: String, required: true }, // user identifier
|
|
225
|
+
api_key: { type: String, required: true }, // API key
|
|
226
|
+
created_at: { type: Number, default: Date.now }, // creation date
|
|
227
|
+
updated_at: { type: Number, default: Date.now }, // last update date
|
|
228
|
+
status: {
|
|
229
|
+
type: String,
|
|
230
|
+
enum: generalStatusList,
|
|
231
|
+
default: 'active',
|
|
232
|
+
}, // status of the API key
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
versionKey: false,
|
|
236
|
+
toJSON: { virtuals: true },
|
|
237
|
+
toObject: { virtuals: true },
|
|
238
|
+
}
|
|
239
|
+
);
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -63,6 +63,7 @@ export const zodSourceSchema = z.object({
|
|
|
63
63
|
user_id: z.string().optional(), // user identifier
|
|
64
64
|
subscribers: z.array(z.string()).optional(), // array of user IDs who subscribed to this source
|
|
65
65
|
source_region: z.string().optional(), // e.g., "New York", "California"
|
|
66
|
+
server: z.string().optional(), // e.g., server handling this source
|
|
66
67
|
});
|
|
67
68
|
|
|
68
69
|
export const zodDataSchema = z.object({
|
|
@@ -197,6 +198,14 @@ export const zodCronScheduleResponseSchema = z.object({
|
|
|
197
198
|
error: z.string().optional(), // error message if the cron job is invalid
|
|
198
199
|
});
|
|
199
200
|
|
|
201
|
+
export const zodApiKeySchema = z.object({
|
|
202
|
+
_id: z.string().optional(),
|
|
203
|
+
user_id: z.string(), // user identifier
|
|
204
|
+
api_key: z.string(), // API key
|
|
205
|
+
created_at: z.number().optional(), // creation date
|
|
206
|
+
updated_at: z.number().optional(), // last update date
|
|
207
|
+
status: z.enum(generalStatusList).default('active'), // status of the API key
|
|
208
|
+
});
|
|
200
209
|
|
|
201
210
|
export type SourceType = z.infer<typeof zodSourceSchema>;
|
|
202
211
|
export type DataType = z.infer<typeof zodDataSchema>;
|
|
@@ -219,4 +228,5 @@ export type CronScheduleResponseType = z.infer<
|
|
|
219
228
|
typeof zodCronScheduleResponseSchema
|
|
220
229
|
>;
|
|
221
230
|
export type GeoType = z.infer<typeof zodGeoSchema>;
|
|
222
|
-
export type GeoSelectionType = z.infer<typeof zodGeoSelectionSchema>;
|
|
231
|
+
export type GeoSelectionType = z.infer<typeof zodGeoSelectionSchema>;
|
|
232
|
+
export type ApiKeyType = z.infer<typeof zodApiKeySchema>;
|