asfur 1.0.71 → 1.0.72
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 +31 -0
- package/dist/index.js +16 -1
- package/dist/types.d.ts +23 -0
- package/dist/types.js +9 -1
- package/index.ts +19 -0
- package/package.json +1 -1
- package/types.ts +10 -1
package/dist/index.d.ts
CHANGED
|
@@ -451,3 +451,34 @@ export declare const MongoGeoSelectionSchema: Schema<any, import("mongoose").Mod
|
|
|
451
451
|
} & {
|
|
452
452
|
__v: number;
|
|
453
453
|
}>;
|
|
454
|
+
export declare const MongoApiKeySchema: Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, {
|
|
455
|
+
versionKey: false;
|
|
456
|
+
toJSON: {
|
|
457
|
+
virtuals: true;
|
|
458
|
+
};
|
|
459
|
+
toObject: {
|
|
460
|
+
virtuals: true;
|
|
461
|
+
};
|
|
462
|
+
}, {
|
|
463
|
+
status: "inactive" | "active";
|
|
464
|
+
created_at: number;
|
|
465
|
+
updated_at: number;
|
|
466
|
+
user_id: string;
|
|
467
|
+
api_key: string;
|
|
468
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
469
|
+
status: "inactive" | "active";
|
|
470
|
+
created_at: number;
|
|
471
|
+
updated_at: number;
|
|
472
|
+
user_id: string;
|
|
473
|
+
api_key: string;
|
|
474
|
+
}>, {}> & import("mongoose").FlatRecord<{
|
|
475
|
+
status: "inactive" | "active";
|
|
476
|
+
created_at: number;
|
|
477
|
+
updated_at: number;
|
|
478
|
+
user_id: string;
|
|
479
|
+
api_key: string;
|
|
480
|
+
}> & {
|
|
481
|
+
_id: import("mongoose").Types.ObjectId;
|
|
482
|
+
} & {
|
|
483
|
+
__v: number;
|
|
484
|
+
}>;
|
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");
|
|
@@ -197,3 +197,18 @@ exports.MongoGeoSelectionSchema = new mongoose_1.Schema({
|
|
|
197
197
|
toJSON: { virtuals: true },
|
|
198
198
|
toObject: { virtuals: true },
|
|
199
199
|
});
|
|
200
|
+
exports.MongoApiKeySchema = new mongoose_1.Schema({
|
|
201
|
+
user_id: { type: String, required: true },
|
|
202
|
+
api_key: { type: String, required: true },
|
|
203
|
+
created_at: { type: Number, default: Date.now },
|
|
204
|
+
updated_at: { type: Number, default: Date.now },
|
|
205
|
+
status: {
|
|
206
|
+
type: String,
|
|
207
|
+
enum: types_1.generalStatusList,
|
|
208
|
+
default: 'active',
|
|
209
|
+
}, // status of the API key
|
|
210
|
+
}, {
|
|
211
|
+
versionKey: false,
|
|
212
|
+
toJSON: { virtuals: true },
|
|
213
|
+
toObject: { virtuals: true },
|
|
214
|
+
});
|
package/dist/types.d.ts
CHANGED
|
@@ -596,6 +596,28 @@ export declare const zodCronScheduleResponseSchema: z.ZodObject<{
|
|
|
596
596
|
schedule?: string | undefined;
|
|
597
597
|
error?: string | undefined;
|
|
598
598
|
}>;
|
|
599
|
+
export declare const zodApiKeySchema: z.ZodObject<{
|
|
600
|
+
_id: z.ZodOptional<z.ZodString>;
|
|
601
|
+
user_id: z.ZodString;
|
|
602
|
+
api_key: z.ZodString;
|
|
603
|
+
created_at: z.ZodOptional<z.ZodNumber>;
|
|
604
|
+
updated_at: z.ZodOptional<z.ZodNumber>;
|
|
605
|
+
status: z.ZodDefault<z.ZodEnum<["active", "inactive"]>>;
|
|
606
|
+
}, "strip", z.ZodTypeAny, {
|
|
607
|
+
status: "inactive" | "active";
|
|
608
|
+
user_id: string;
|
|
609
|
+
api_key: string;
|
|
610
|
+
_id?: string | undefined;
|
|
611
|
+
created_at?: number | undefined;
|
|
612
|
+
updated_at?: number | undefined;
|
|
613
|
+
}, {
|
|
614
|
+
user_id: string;
|
|
615
|
+
api_key: string;
|
|
616
|
+
_id?: string | undefined;
|
|
617
|
+
status?: "inactive" | "active" | undefined;
|
|
618
|
+
created_at?: number | undefined;
|
|
619
|
+
updated_at?: number | undefined;
|
|
620
|
+
}>;
|
|
599
621
|
export type SourceType = z.infer<typeof zodSourceSchema>;
|
|
600
622
|
export type DataType = z.infer<typeof zodDataSchema>;
|
|
601
623
|
export type QueryType = z.infer<typeof zodQuerySchema>;
|
|
@@ -611,3 +633,4 @@ export type JobType = z.infer<typeof zodJobSchema>;
|
|
|
611
633
|
export type CronScheduleResponseType = z.infer<typeof zodCronScheduleResponseSchema>;
|
|
612
634
|
export type GeoType = z.infer<typeof zodGeoSchema>;
|
|
613
635
|
export type GeoSelectionType = z.infer<typeof zodGeoSelectionSchema>;
|
|
636
|
+
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',
|
|
@@ -179,3 +179,11 @@ exports.zodCronScheduleResponseSchema = zod_1.z.object({
|
|
|
179
179
|
is_ok: zod_1.z.boolean(),
|
|
180
180
|
error: zod_1.z.string().optional(), // error message if the cron job is invalid
|
|
181
181
|
});
|
|
182
|
+
exports.zodApiKeySchema = zod_1.z.object({
|
|
183
|
+
_id: zod_1.z.string().optional(),
|
|
184
|
+
user_id: zod_1.z.string(),
|
|
185
|
+
api_key: zod_1.z.string(),
|
|
186
|
+
created_at: zod_1.z.number().optional(),
|
|
187
|
+
updated_at: zod_1.z.number().optional(),
|
|
188
|
+
status: zod_1.z.enum(exports.generalStatusList).default('active'), // status of the API key
|
|
189
|
+
});
|
package/index.ts
CHANGED
|
@@ -217,3 +217,22 @@ export const MongoGeoSelectionSchema = new Schema(
|
|
|
217
217
|
toObject: { virtuals: true },
|
|
218
218
|
}
|
|
219
219
|
);
|
|
220
|
+
|
|
221
|
+
export const MongoApiKeySchema = new Schema(
|
|
222
|
+
{
|
|
223
|
+
user_id: { type: String, required: true }, // user identifier
|
|
224
|
+
api_key: { type: String, required: true }, // API key
|
|
225
|
+
created_at: { type: Number, default: Date.now }, // creation date
|
|
226
|
+
updated_at: { type: Number, default: Date.now }, // last update date
|
|
227
|
+
status: {
|
|
228
|
+
type: String,
|
|
229
|
+
enum: generalStatusList,
|
|
230
|
+
default: 'active',
|
|
231
|
+
}, // status of the API key
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
versionKey: false,
|
|
235
|
+
toJSON: { virtuals: true },
|
|
236
|
+
toObject: { virtuals: true },
|
|
237
|
+
}
|
|
238
|
+
);
|
package/package.json
CHANGED
package/types.ts
CHANGED
|
@@ -197,6 +197,14 @@ export const zodCronScheduleResponseSchema = z.object({
|
|
|
197
197
|
error: z.string().optional(), // error message if the cron job is invalid
|
|
198
198
|
});
|
|
199
199
|
|
|
200
|
+
export const zodApiKeySchema = z.object({
|
|
201
|
+
_id: z.string().optional(),
|
|
202
|
+
user_id: z.string(), // user identifier
|
|
203
|
+
api_key: z.string(), // API key
|
|
204
|
+
created_at: z.number().optional(), // creation date
|
|
205
|
+
updated_at: z.number().optional(), // last update date
|
|
206
|
+
status: z.enum(generalStatusList).default('active'), // status of the API key
|
|
207
|
+
});
|
|
200
208
|
|
|
201
209
|
export type SourceType = z.infer<typeof zodSourceSchema>;
|
|
202
210
|
export type DataType = z.infer<typeof zodDataSchema>;
|
|
@@ -219,4 +227,5 @@ export type CronScheduleResponseType = z.infer<
|
|
|
219
227
|
typeof zodCronScheduleResponseSchema
|
|
220
228
|
>;
|
|
221
229
|
export type GeoType = z.infer<typeof zodGeoSchema>;
|
|
222
|
-
export type GeoSelectionType = z.infer<typeof zodGeoSelectionSchema>;
|
|
230
|
+
export type GeoSelectionType = z.infer<typeof zodGeoSelectionSchema>;
|
|
231
|
+
export type ApiKeyType = z.infer<typeof zodApiKeySchema>;
|