asfur 1.0.70 → 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 +44 -21
- package/dist/types.js +10 -1
- package/index.ts +19 -0
- package/package.json +1 -1
- package/types.ts +11 -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
|
@@ -215,16 +215,16 @@ export declare const zodDataSchema: z.ZodObject<{
|
|
|
215
215
|
author_username?: string | undefined;
|
|
216
216
|
author_id?: string | undefined;
|
|
217
217
|
}>;
|
|
218
|
-
export declare const relativeTimeRangeList: readonly ["last_30_minutes", "last_1_hour", "last_2_hours", "last_6_hours", "last_12_hours", "last_24_hours", "last_48_hours", "last_72_hours", "last_week"];
|
|
218
|
+
export declare const relativeTimeRangeList: readonly ["last_30_minutes", "last_1_hour", "last_2_hours", "last_6_hours", "last_12_hours", "last_24_hours", "last_48_hours", "last_72_hours", "last_week", "7_october"];
|
|
219
219
|
export declare const zodRelativeTimeRangeSchema: z.ZodObject<{
|
|
220
220
|
type: z.ZodLiteral<"relative">;
|
|
221
|
-
time: z.ZodEnum<["last_30_minutes", "last_1_hour", "last_2_hours", "last_6_hours", "last_12_hours", "last_24_hours", "last_48_hours", "last_72_hours", "last_week"]>;
|
|
221
|
+
time: z.ZodEnum<["last_30_minutes", "last_1_hour", "last_2_hours", "last_6_hours", "last_12_hours", "last_24_hours", "last_48_hours", "last_72_hours", "last_week", "7_october"]>;
|
|
222
222
|
}, "strip", z.ZodTypeAny, {
|
|
223
223
|
type: "relative";
|
|
224
|
-
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
224
|
+
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week" | "7_october";
|
|
225
225
|
}, {
|
|
226
226
|
type: "relative";
|
|
227
|
-
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
227
|
+
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week" | "7_october";
|
|
228
228
|
}>;
|
|
229
229
|
export declare const zodAbsoluteTimeRangeSchema: z.ZodObject<{
|
|
230
230
|
type: z.ZodLiteral<"absolute">;
|
|
@@ -248,13 +248,13 @@ export declare const zodQuerySchema: z.ZodObject<{
|
|
|
248
248
|
geos_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
249
249
|
time_range: z.ZodUnion<[z.ZodObject<{
|
|
250
250
|
type: z.ZodLiteral<"relative">;
|
|
251
|
-
time: z.ZodEnum<["last_30_minutes", "last_1_hour", "last_2_hours", "last_6_hours", "last_12_hours", "last_24_hours", "last_48_hours", "last_72_hours", "last_week"]>;
|
|
251
|
+
time: z.ZodEnum<["last_30_minutes", "last_1_hour", "last_2_hours", "last_6_hours", "last_12_hours", "last_24_hours", "last_48_hours", "last_72_hours", "last_week", "7_october"]>;
|
|
252
252
|
}, "strip", z.ZodTypeAny, {
|
|
253
253
|
type: "relative";
|
|
254
|
-
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
254
|
+
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week" | "7_october";
|
|
255
255
|
}, {
|
|
256
256
|
type: "relative";
|
|
257
|
-
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
257
|
+
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week" | "7_october";
|
|
258
258
|
}>, z.ZodObject<{
|
|
259
259
|
type: z.ZodLiteral<"absolute">;
|
|
260
260
|
start: z.ZodUnion<[z.ZodDate, z.ZodNumber]>;
|
|
@@ -275,7 +275,7 @@ export declare const zodQuerySchema: z.ZodObject<{
|
|
|
275
275
|
user_id: string;
|
|
276
276
|
time_range: {
|
|
277
277
|
type: "relative";
|
|
278
|
-
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
278
|
+
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week" | "7_october";
|
|
279
279
|
} | {
|
|
280
280
|
type: "absolute";
|
|
281
281
|
start: number | Date;
|
|
@@ -293,7 +293,7 @@ export declare const zodQuerySchema: z.ZodObject<{
|
|
|
293
293
|
user_id: string;
|
|
294
294
|
time_range: {
|
|
295
295
|
type: "relative";
|
|
296
|
-
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
296
|
+
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week" | "7_october";
|
|
297
297
|
} | {
|
|
298
298
|
type: "absolute";
|
|
299
299
|
start: number | Date;
|
|
@@ -333,13 +333,13 @@ export declare const zodUserSettingsSchema: z.ZodObject<{
|
|
|
333
333
|
geos: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
334
334
|
time_range: z.ZodUnion<[z.ZodObject<{
|
|
335
335
|
type: z.ZodLiteral<"relative">;
|
|
336
|
-
time: z.ZodEnum<["last_30_minutes", "last_1_hour", "last_2_hours", "last_6_hours", "last_12_hours", "last_24_hours", "last_48_hours", "last_72_hours", "last_week"]>;
|
|
336
|
+
time: z.ZodEnum<["last_30_minutes", "last_1_hour", "last_2_hours", "last_6_hours", "last_12_hours", "last_24_hours", "last_48_hours", "last_72_hours", "last_week", "7_october"]>;
|
|
337
337
|
}, "strip", z.ZodTypeAny, {
|
|
338
338
|
type: "relative";
|
|
339
|
-
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
339
|
+
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week" | "7_october";
|
|
340
340
|
}, {
|
|
341
341
|
type: "relative";
|
|
342
|
-
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
342
|
+
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week" | "7_october";
|
|
343
343
|
}>, z.ZodObject<{
|
|
344
344
|
type: z.ZodLiteral<"absolute">;
|
|
345
345
|
start: z.ZodUnion<[z.ZodDate, z.ZodNumber]>;
|
|
@@ -367,7 +367,7 @@ export declare const zodUserSettingsSchema: z.ZodObject<{
|
|
|
367
367
|
sources: string[];
|
|
368
368
|
time_range: {
|
|
369
369
|
type: "relative";
|
|
370
|
-
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
370
|
+
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week" | "7_october";
|
|
371
371
|
} | {
|
|
372
372
|
type: "absolute";
|
|
373
373
|
start: number | Date;
|
|
@@ -386,7 +386,7 @@ export declare const zodUserSettingsSchema: z.ZodObject<{
|
|
|
386
386
|
sources: string[];
|
|
387
387
|
time_range: {
|
|
388
388
|
type: "relative";
|
|
389
|
-
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
389
|
+
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week" | "7_october";
|
|
390
390
|
} | {
|
|
391
391
|
type: "absolute";
|
|
392
392
|
start: number | Date;
|
|
@@ -449,13 +449,13 @@ export declare const zodJobSchema: z.ZodObject<{
|
|
|
449
449
|
geos_ids: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
450
450
|
time_range: z.ZodUnion<[z.ZodObject<{
|
|
451
451
|
type: z.ZodLiteral<"relative">;
|
|
452
|
-
time: z.ZodEnum<["last_30_minutes", "last_1_hour", "last_2_hours", "last_6_hours", "last_12_hours", "last_24_hours", "last_48_hours", "last_72_hours", "last_week"]>;
|
|
452
|
+
time: z.ZodEnum<["last_30_minutes", "last_1_hour", "last_2_hours", "last_6_hours", "last_12_hours", "last_24_hours", "last_48_hours", "last_72_hours", "last_week", "7_october"]>;
|
|
453
453
|
}, "strip", z.ZodTypeAny, {
|
|
454
454
|
type: "relative";
|
|
455
|
-
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
455
|
+
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week" | "7_october";
|
|
456
456
|
}, {
|
|
457
457
|
type: "relative";
|
|
458
|
-
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
458
|
+
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week" | "7_october";
|
|
459
459
|
}>, z.ZodObject<{
|
|
460
460
|
type: z.ZodLiteral<"absolute">;
|
|
461
461
|
start: z.ZodUnion<[z.ZodDate, z.ZodNumber]>;
|
|
@@ -476,7 +476,7 @@ export declare const zodJobSchema: z.ZodObject<{
|
|
|
476
476
|
user_id: string;
|
|
477
477
|
time_range: {
|
|
478
478
|
type: "relative";
|
|
479
|
-
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
479
|
+
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week" | "7_october";
|
|
480
480
|
} | {
|
|
481
481
|
type: "absolute";
|
|
482
482
|
start: number | Date;
|
|
@@ -494,7 +494,7 @@ export declare const zodJobSchema: z.ZodObject<{
|
|
|
494
494
|
user_id: string;
|
|
495
495
|
time_range: {
|
|
496
496
|
type: "relative";
|
|
497
|
-
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
497
|
+
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week" | "7_october";
|
|
498
498
|
} | {
|
|
499
499
|
type: "absolute";
|
|
500
500
|
start: number | Date;
|
|
@@ -520,7 +520,7 @@ export declare const zodJobSchema: z.ZodObject<{
|
|
|
520
520
|
user_id: string;
|
|
521
521
|
time_range: {
|
|
522
522
|
type: "relative";
|
|
523
|
-
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
523
|
+
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week" | "7_october";
|
|
524
524
|
} | {
|
|
525
525
|
type: "absolute";
|
|
526
526
|
start: number | Date;
|
|
@@ -552,7 +552,7 @@ export declare const zodJobSchema: z.ZodObject<{
|
|
|
552
552
|
user_id: string;
|
|
553
553
|
time_range: {
|
|
554
554
|
type: "relative";
|
|
555
|
-
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
555
|
+
time: "last_30_minutes" | "last_1_hour" | "last_2_hours" | "last_6_hours" | "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week" | "7_october";
|
|
556
556
|
} | {
|
|
557
557
|
type: "absolute";
|
|
558
558
|
start: number | Date;
|
|
@@ -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',
|
|
@@ -103,6 +103,7 @@ exports.relativeTimeRangeList = [
|
|
|
103
103
|
'last_48_hours',
|
|
104
104
|
'last_72_hours',
|
|
105
105
|
'last_week',
|
|
106
|
+
'7_october'
|
|
106
107
|
];
|
|
107
108
|
exports.zodRelativeTimeRangeSchema = zod_1.z.object({
|
|
108
109
|
type: zod_1.z.literal('relative'),
|
|
@@ -178,3 +179,11 @@ exports.zodCronScheduleResponseSchema = zod_1.z.object({
|
|
|
178
179
|
is_ok: zod_1.z.boolean(),
|
|
179
180
|
error: zod_1.z.string().optional(), // error message if the cron job is invalid
|
|
180
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
|
@@ -111,6 +111,7 @@ export const relativeTimeRangeList = [
|
|
|
111
111
|
'last_48_hours',
|
|
112
112
|
'last_72_hours',
|
|
113
113
|
'last_week',
|
|
114
|
+
'7_october'
|
|
114
115
|
] as const;
|
|
115
116
|
|
|
116
117
|
export const zodRelativeTimeRangeSchema = z.object({
|
|
@@ -196,6 +197,14 @@ export const zodCronScheduleResponseSchema = z.object({
|
|
|
196
197
|
error: z.string().optional(), // error message if the cron job is invalid
|
|
197
198
|
});
|
|
198
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
|
+
});
|
|
199
208
|
|
|
200
209
|
export type SourceType = z.infer<typeof zodSourceSchema>;
|
|
201
210
|
export type DataType = z.infer<typeof zodDataSchema>;
|
|
@@ -218,4 +227,5 @@ export type CronScheduleResponseType = z.infer<
|
|
|
218
227
|
typeof zodCronScheduleResponseSchema
|
|
219
228
|
>;
|
|
220
229
|
export type GeoType = z.infer<typeof zodGeoSchema>;
|
|
221
|
-
export type GeoSelectionType = z.infer<typeof zodGeoSelectionSchema>;
|
|
230
|
+
export type GeoSelectionType = z.infer<typeof zodGeoSelectionSchema>;
|
|
231
|
+
export type ApiKeyType = z.infer<typeof zodApiKeySchema>;
|