codebase-models 3.0.1 → 3.0.2
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/src/models/CustomQuery.d.ts +2 -14
- package/dist/src/models/CustomQuery.js +1 -1
- package/dist/src/models/HypothesisSheet.d.ts +1 -3
- package/dist/src/models/HypothesisSheet.js +1 -1
- package/dist/src/models/NewIdeas.d.ts +1 -3
- package/dist/src/models/NewIdeas.js +1 -1
- package/package.json +1 -1
- package/src/models/CustomQuery.ts +1 -1
- package/src/models/HypothesisSheet.ts +2 -2
- package/src/models/NewIdeas.ts +1 -1
|
@@ -22,18 +22,6 @@
|
|
|
22
22
|
/// <reference types="mongoose/types/validation" />
|
|
23
23
|
/// <reference types="mongoose/types/virtuals" />
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
|
-
import mongoose
|
|
26
|
-
|
|
27
|
-
iid: string;
|
|
28
|
-
organizationId?: mongoose.Schema.Types.ObjectId;
|
|
29
|
-
title: string;
|
|
30
|
-
module: string;
|
|
31
|
-
client: mongoose.Schema.Types.ObjectId;
|
|
32
|
-
query: string;
|
|
33
|
-
metadata: any;
|
|
34
|
-
createdBy?: mongoose.Schema.Types.ObjectId;
|
|
35
|
-
}
|
|
36
|
-
declare const CustomQuery: mongoose.Model<ICustomQuery, {}, {}, {}, mongoose.Document<unknown, {}, ICustomQuery> & ICustomQuery & {
|
|
37
|
-
_id: mongoose.Types.ObjectId;
|
|
38
|
-
}, any>;
|
|
25
|
+
import mongoose from 'mongoose';
|
|
26
|
+
declare const CustomQuery: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
39
27
|
export default CustomQuery;
|
|
@@ -65,5 +65,5 @@ CustomQuerySchema.pre('save', function (next) {
|
|
|
65
65
|
next();
|
|
66
66
|
});
|
|
67
67
|
});
|
|
68
|
-
const CustomQuery = (0, mongoose_1.model)('
|
|
68
|
+
const CustomQuery = mongoose_1.default.models.customquery || (0, mongoose_1.model)('customquery', CustomQuerySchema);
|
|
69
69
|
exports.default = CustomQuery;
|
|
@@ -44,7 +44,5 @@ export interface IHypothesisSheet extends Document {
|
|
|
44
44
|
tested?: Boolean;
|
|
45
45
|
createdBy?: mongoose.Schema.Types.ObjectId;
|
|
46
46
|
}
|
|
47
|
-
declare const HypothesisSheet: mongoose.Model<
|
|
48
|
-
_id: mongoose.Types.ObjectId;
|
|
49
|
-
}, any>;
|
|
47
|
+
declare const HypothesisSheet: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
50
48
|
export default HypothesisSheet;
|
|
@@ -114,5 +114,5 @@ const HypothesisSheetSchema = new mongoose_1.Schema({
|
|
|
114
114
|
}, {
|
|
115
115
|
timestamps: true,
|
|
116
116
|
});
|
|
117
|
-
const HypothesisSheet = (0, mongoose_1.model)("
|
|
117
|
+
const HypothesisSheet = mongoose_1.default.models.hypothesissheet || (0, mongoose_1.model)("hypothesissheet", HypothesisSheetSchema);
|
|
118
118
|
exports.default = HypothesisSheet;
|
|
@@ -34,7 +34,5 @@ export interface INewIdeas extends Document {
|
|
|
34
34
|
totalPriority?: string;
|
|
35
35
|
createdBy?: mongoose.Schema.Types.ObjectId;
|
|
36
36
|
}
|
|
37
|
-
declare const NewIdeas: mongoose.Model<
|
|
38
|
-
_id: mongoose.Types.ObjectId;
|
|
39
|
-
}, any>;
|
|
37
|
+
declare const NewIdeas: mongoose.Model<any, {}, {}, {}, any, any>;
|
|
40
38
|
export default NewIdeas;
|
|
@@ -67,5 +67,5 @@ NewIdeasSchema.index({
|
|
|
67
67
|
client: 1,
|
|
68
68
|
viewId: 1,
|
|
69
69
|
});
|
|
70
|
-
const NewIdeas = (0, mongoose_1.model)("
|
|
70
|
+
const NewIdeas = mongoose_1.default.models.newideas || (0, mongoose_1.model)("newideas", NewIdeasSchema);
|
|
71
71
|
exports.default = NewIdeas;
|
package/package.json
CHANGED
|
@@ -46,6 +46,6 @@ CustomQuerySchema.pre('save', async function(next) {
|
|
|
46
46
|
});
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
const CustomQuery = model<ICustomQuery>('
|
|
49
|
+
const CustomQuery = mongoose.models.customquery || model<ICustomQuery>('customquery', CustomQuerySchema);
|
|
50
50
|
|
|
51
51
|
export default CustomQuery;
|
|
@@ -113,8 +113,8 @@ const HypothesisSheetSchema = new Schema<IHypothesisSheet>(
|
|
|
113
113
|
}
|
|
114
114
|
);
|
|
115
115
|
|
|
116
|
-
const HypothesisSheet = model<IHypothesisSheet>(
|
|
117
|
-
"
|
|
116
|
+
const HypothesisSheet = mongoose.models.hypothesissheet || model<IHypothesisSheet>(
|
|
117
|
+
"hypothesissheet",
|
|
118
118
|
HypothesisSheetSchema
|
|
119
119
|
);
|
|
120
120
|
|
package/src/models/NewIdeas.ts
CHANGED