asfur 1.0.33 → 1.0.34
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 +191 -0
- package/dist/index.js +19 -1
- package/index.ts +23 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -688,3 +688,194 @@ export declare const MongoConversationSchema: Schema<{
|
|
|
688
688
|
}> & {
|
|
689
689
|
__v: number;
|
|
690
690
|
}>;
|
|
691
|
+
export declare const MongoAutomationJobSchema: Schema<{
|
|
692
|
+
status: "inactive" | "active";
|
|
693
|
+
user_id: string;
|
|
694
|
+
query: {
|
|
695
|
+
user_id: string;
|
|
696
|
+
sources: string[];
|
|
697
|
+
time_range: {
|
|
698
|
+
type: "relative";
|
|
699
|
+
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
700
|
+
} | {
|
|
701
|
+
type: "absolute";
|
|
702
|
+
start: number | Date;
|
|
703
|
+
end: number | Date;
|
|
704
|
+
};
|
|
705
|
+
_id?: string | undefined;
|
|
706
|
+
title?: string | undefined;
|
|
707
|
+
query?: string | undefined;
|
|
708
|
+
user_instructions?: string | undefined;
|
|
709
|
+
thread_id?: string | undefined;
|
|
710
|
+
};
|
|
711
|
+
job_name: string;
|
|
712
|
+
_id?: string | undefined;
|
|
713
|
+
created_at?: number | Date | undefined;
|
|
714
|
+
updated_at?: number | Date | undefined;
|
|
715
|
+
job_description?: string | undefined;
|
|
716
|
+
schedule?: string | undefined;
|
|
717
|
+
}, import("mongoose").Model<{
|
|
718
|
+
status: "inactive" | "active";
|
|
719
|
+
user_id: string;
|
|
720
|
+
query: {
|
|
721
|
+
user_id: string;
|
|
722
|
+
sources: string[];
|
|
723
|
+
time_range: {
|
|
724
|
+
type: "relative";
|
|
725
|
+
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
726
|
+
} | {
|
|
727
|
+
type: "absolute";
|
|
728
|
+
start: number | Date;
|
|
729
|
+
end: number | Date;
|
|
730
|
+
};
|
|
731
|
+
_id?: string | undefined;
|
|
732
|
+
title?: string | undefined;
|
|
733
|
+
query?: string | undefined;
|
|
734
|
+
user_instructions?: string | undefined;
|
|
735
|
+
thread_id?: string | undefined;
|
|
736
|
+
};
|
|
737
|
+
job_name: string;
|
|
738
|
+
_id?: string | undefined;
|
|
739
|
+
created_at?: number | Date | undefined;
|
|
740
|
+
updated_at?: number | Date | undefined;
|
|
741
|
+
job_description?: string | undefined;
|
|
742
|
+
schedule?: string | undefined;
|
|
743
|
+
}, any, any, any, import("mongoose").Document<unknown, any, {
|
|
744
|
+
status: "inactive" | "active";
|
|
745
|
+
user_id: string;
|
|
746
|
+
query: {
|
|
747
|
+
user_id: string;
|
|
748
|
+
sources: string[];
|
|
749
|
+
time_range: {
|
|
750
|
+
type: "relative";
|
|
751
|
+
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
752
|
+
} | {
|
|
753
|
+
type: "absolute";
|
|
754
|
+
start: number | Date;
|
|
755
|
+
end: number | Date;
|
|
756
|
+
};
|
|
757
|
+
_id?: string | undefined;
|
|
758
|
+
title?: string | undefined;
|
|
759
|
+
query?: string | undefined;
|
|
760
|
+
user_instructions?: string | undefined;
|
|
761
|
+
thread_id?: string | undefined;
|
|
762
|
+
};
|
|
763
|
+
job_name: string;
|
|
764
|
+
_id?: string | undefined;
|
|
765
|
+
created_at?: number | Date | undefined;
|
|
766
|
+
updated_at?: number | Date | undefined;
|
|
767
|
+
job_description?: string | undefined;
|
|
768
|
+
schedule?: string | undefined;
|
|
769
|
+
}, any> & {
|
|
770
|
+
status: "inactive" | "active";
|
|
771
|
+
user_id: string;
|
|
772
|
+
query: {
|
|
773
|
+
user_id: string;
|
|
774
|
+
sources: string[];
|
|
775
|
+
time_range: {
|
|
776
|
+
type: "relative";
|
|
777
|
+
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
778
|
+
} | {
|
|
779
|
+
type: "absolute";
|
|
780
|
+
start: number | Date;
|
|
781
|
+
end: number | Date;
|
|
782
|
+
};
|
|
783
|
+
_id?: string | undefined;
|
|
784
|
+
title?: string | undefined;
|
|
785
|
+
query?: string | undefined;
|
|
786
|
+
user_instructions?: string | undefined;
|
|
787
|
+
thread_id?: string | undefined;
|
|
788
|
+
};
|
|
789
|
+
job_name: string;
|
|
790
|
+
_id?: string | undefined;
|
|
791
|
+
created_at?: number | Date | undefined;
|
|
792
|
+
updated_at?: number | Date | undefined;
|
|
793
|
+
job_description?: string | undefined;
|
|
794
|
+
schedule?: string | undefined;
|
|
795
|
+
} & Required<{
|
|
796
|
+
_id: string;
|
|
797
|
+
}> & {
|
|
798
|
+
__v: number;
|
|
799
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
|
800
|
+
status: "inactive" | "active";
|
|
801
|
+
user_id: string;
|
|
802
|
+
query: {
|
|
803
|
+
user_id: string;
|
|
804
|
+
sources: string[];
|
|
805
|
+
time_range: {
|
|
806
|
+
type: "relative";
|
|
807
|
+
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
808
|
+
} | {
|
|
809
|
+
type: "absolute";
|
|
810
|
+
start: number | Date;
|
|
811
|
+
end: number | Date;
|
|
812
|
+
};
|
|
813
|
+
_id?: string | undefined;
|
|
814
|
+
title?: string | undefined;
|
|
815
|
+
query?: string | undefined;
|
|
816
|
+
user_instructions?: string | undefined;
|
|
817
|
+
thread_id?: string | undefined;
|
|
818
|
+
};
|
|
819
|
+
job_name: string;
|
|
820
|
+
_id?: string | undefined;
|
|
821
|
+
created_at?: number | Date | undefined;
|
|
822
|
+
updated_at?: number | Date | undefined;
|
|
823
|
+
job_description?: string | undefined;
|
|
824
|
+
schedule?: string | undefined;
|
|
825
|
+
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
826
|
+
status: "inactive" | "active";
|
|
827
|
+
user_id: string;
|
|
828
|
+
query: {
|
|
829
|
+
user_id: string;
|
|
830
|
+
sources: string[];
|
|
831
|
+
time_range: {
|
|
832
|
+
type: "relative";
|
|
833
|
+
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
834
|
+
} | {
|
|
835
|
+
type: "absolute";
|
|
836
|
+
start: number | Date;
|
|
837
|
+
end: number | Date;
|
|
838
|
+
};
|
|
839
|
+
_id?: string | undefined;
|
|
840
|
+
title?: string | undefined;
|
|
841
|
+
query?: string | undefined;
|
|
842
|
+
user_instructions?: string | undefined;
|
|
843
|
+
thread_id?: string | undefined;
|
|
844
|
+
};
|
|
845
|
+
job_name: string;
|
|
846
|
+
_id?: string | undefined;
|
|
847
|
+
created_at?: number | Date | undefined;
|
|
848
|
+
updated_at?: number | Date | undefined;
|
|
849
|
+
job_description?: string | undefined;
|
|
850
|
+
schedule?: string | undefined;
|
|
851
|
+
}>, {}> & import("mongoose").FlatRecord<{
|
|
852
|
+
status: "inactive" | "active";
|
|
853
|
+
user_id: string;
|
|
854
|
+
query: {
|
|
855
|
+
user_id: string;
|
|
856
|
+
sources: string[];
|
|
857
|
+
time_range: {
|
|
858
|
+
type: "relative";
|
|
859
|
+
time: "last_12_hours" | "last_24_hours" | "last_48_hours" | "last_72_hours" | "last_week";
|
|
860
|
+
} | {
|
|
861
|
+
type: "absolute";
|
|
862
|
+
start: number | Date;
|
|
863
|
+
end: number | Date;
|
|
864
|
+
};
|
|
865
|
+
_id?: string | undefined;
|
|
866
|
+
title?: string | undefined;
|
|
867
|
+
query?: string | undefined;
|
|
868
|
+
user_instructions?: string | undefined;
|
|
869
|
+
thread_id?: string | undefined;
|
|
870
|
+
};
|
|
871
|
+
job_name: string;
|
|
872
|
+
_id?: string | undefined;
|
|
873
|
+
created_at?: number | Date | undefined;
|
|
874
|
+
updated_at?: number | Date | undefined;
|
|
875
|
+
job_description?: string | undefined;
|
|
876
|
+
schedule?: string | undefined;
|
|
877
|
+
}> & Required<{
|
|
878
|
+
_id: string;
|
|
879
|
+
}> & {
|
|
880
|
+
__v: number;
|
|
881
|
+
}>;
|
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.MongoConversationSchema = exports.MongoUserSettingsSchema = exports.MongoQuerySchema = exports.MongoSourceSchema = exports.MongoInstructionsSchema = exports.MongoDataSchema = void 0;
|
|
17
|
+
exports.MongoAutomationJobSchema = 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");
|
|
@@ -134,3 +134,21 @@ exports.MongoConversationSchema = new mongoose_1.Schema({
|
|
|
134
134
|
toJSON: { virtuals: true },
|
|
135
135
|
toObject: { virtuals: true },
|
|
136
136
|
});
|
|
137
|
+
exports.MongoAutomationJobSchema = new mongoose_1.Schema({
|
|
138
|
+
user_id: { type: String, required: true },
|
|
139
|
+
job_name: { type: String, required: true },
|
|
140
|
+
job_description: { type: String },
|
|
141
|
+
status: {
|
|
142
|
+
type: String,
|
|
143
|
+
enum: types_1.generalStatusList,
|
|
144
|
+
default: 'active',
|
|
145
|
+
},
|
|
146
|
+
created_at: { type: Date, default: Date.now },
|
|
147
|
+
updated_at: { type: Date, default: Date.now },
|
|
148
|
+
schedule: { type: String },
|
|
149
|
+
query: { type: mongoose_1.Schema.Types.Mixed, required: true }, // query associated with the job
|
|
150
|
+
}, {
|
|
151
|
+
versionKey: false,
|
|
152
|
+
toJSON: { virtuals: true },
|
|
153
|
+
toObject: { virtuals: true },
|
|
154
|
+
});
|
package/index.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from './types';
|
|
|
3
3
|
|
|
4
4
|
import { Schema } from 'mongoose';
|
|
5
5
|
import {
|
|
6
|
+
AutomationJobType,
|
|
6
7
|
ConversationType,
|
|
7
8
|
DataType,
|
|
8
9
|
generalStatusList,
|
|
@@ -150,3 +151,25 @@ export const MongoConversationSchema = new Schema<ConversationType>(
|
|
|
150
151
|
toObject: { virtuals: true },
|
|
151
152
|
}
|
|
152
153
|
);
|
|
154
|
+
|
|
155
|
+
export const MongoAutomationJobSchema = new Schema<AutomationJobType>(
|
|
156
|
+
{
|
|
157
|
+
user_id: { type: String, required: true }, // user identifier
|
|
158
|
+
job_name: { type: String, required: true }, // name of the automation job
|
|
159
|
+
job_description: { type: String }, // description of the job
|
|
160
|
+
status: {
|
|
161
|
+
type: String,
|
|
162
|
+
enum: generalStatusList,
|
|
163
|
+
default: 'active',
|
|
164
|
+
}, // status of the job
|
|
165
|
+
created_at: { type: Date, default: Date.now }, // creation date
|
|
166
|
+
updated_at: { type: Date, default: Date.now }, // last update date
|
|
167
|
+
schedule: { type: String }, // cron schedule for the job
|
|
168
|
+
query: { type: Schema.Types.Mixed, required: true }, // query associated with the job
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
versionKey: false,
|
|
172
|
+
toJSON: { virtuals: true },
|
|
173
|
+
toObject: { virtuals: true },
|
|
174
|
+
}
|
|
175
|
+
);
|