@conduitplatform/module-tools 0.16.0-alpha.14 → 0.16.0-alpha.15
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.
|
@@ -2,18 +2,18 @@ import { ConduitModel, ConduitSchema, ConduitSchemaOptions, DatabaseProvider, Qu
|
|
|
2
2
|
export declare class ConduitActiveSchema<T> extends ConduitSchema {
|
|
3
3
|
private readonly dbInstance;
|
|
4
4
|
constructor(dbInstance: DatabaseProvider, name: string, fields?: ConduitModel, modelOptions?: ConduitSchemaOptions, collectionName?: string);
|
|
5
|
-
findOne(query: Query<T>, select?: string, populate?: string | string[]): Promise<T | null>;
|
|
5
|
+
findOne(query: Query<T>, select?: string, populate?: string | string[], userId?: string, scope?: string): Promise<T | null>;
|
|
6
6
|
findMany(query: Query<T>, select?: string, skip?: number, limit?: number, sort?: {
|
|
7
7
|
[field: string]: -1 | 1;
|
|
8
|
-
} | string[] | string, populate?: string | string[]): Promise<T[]>;
|
|
9
|
-
create(query: Query<T
|
|
10
|
-
createMany(query: Query<T>[]): Promise<T[]>;
|
|
11
|
-
findByIdAndUpdate(id: string, document: Query<T>, populate?: string | string[]): Promise<T | null>;
|
|
12
|
-
findByIdAndReplace(id: string, document: Query<T>, populate?: string | string[]): Promise<T | null>;
|
|
13
|
-
replaceOne(filterQuery: Query<T>, query: Query<T>, populate?: string | string[]): Promise<any>;
|
|
14
|
-
updateOne(filterQuery: Query<T>, query: Query<T>, populate?: string | string[]): Promise<any>;
|
|
15
|
-
updateMany(filterQuery: Query<T>, query: Query<T>, populate?: string | string[]): Promise<any>;
|
|
16
|
-
deleteOne(query: Query<T
|
|
17
|
-
deleteMany(query: Query<T
|
|
18
|
-
countDocuments(query: Query<T
|
|
8
|
+
} | string[] | string, populate?: string | string[], userId?: string, scope?: string): Promise<T[]>;
|
|
9
|
+
create(query: Query<T>, userId?: string, scope?: string): Promise<T>;
|
|
10
|
+
createMany(query: Query<T>[], userId?: string, scope?: string): Promise<T[]>;
|
|
11
|
+
findByIdAndUpdate(id: string, document: Query<T>, populate?: string | string[], userId?: string, scope?: string): Promise<T | null>;
|
|
12
|
+
findByIdAndReplace(id: string, document: Query<T>, populate?: string | string[], userId?: string, scope?: string): Promise<T | null>;
|
|
13
|
+
replaceOne(filterQuery: Query<T>, query: Query<T>, populate?: string | string[], userId?: string, scope?: string): Promise<any>;
|
|
14
|
+
updateOne(filterQuery: Query<T>, query: Query<T>, populate?: string | string[], userId?: string, scope?: string): Promise<any>;
|
|
15
|
+
updateMany(filterQuery: Query<T>, query: Query<T>, populate?: string | string[], userId?: string, scope?: string): Promise<any>;
|
|
16
|
+
deleteOne(query: Query<T>, userId?: string, scope?: string): Promise<any>;
|
|
17
|
+
deleteMany(query: Query<T>, userId?: string, scope?: string): Promise<any>;
|
|
18
|
+
countDocuments(query: Query<T>, userId?: string, scope?: string): Promise<number>;
|
|
19
19
|
}
|
|
@@ -24,41 +24,41 @@ var ConduitActiveSchema = /** @class */ (function (_super) {
|
|
|
24
24
|
_this.dbInstance = dbInstance;
|
|
25
25
|
return _this;
|
|
26
26
|
}
|
|
27
|
-
ConduitActiveSchema.prototype.findOne = function (query, select, populate) {
|
|
28
|
-
return this.dbInstance.findOne(this.name, query, select, populate);
|
|
27
|
+
ConduitActiveSchema.prototype.findOne = function (query, select, populate, userId, scope) {
|
|
28
|
+
return this.dbInstance.findOne(this.name, query, select, populate, userId, scope);
|
|
29
29
|
};
|
|
30
|
-
ConduitActiveSchema.prototype.findMany = function (query, select, skip, limit, sort, populate) {
|
|
31
|
-
return this.dbInstance.findMany(this.name, query, select, skip, limit, sort, populate);
|
|
30
|
+
ConduitActiveSchema.prototype.findMany = function (query, select, skip, limit, sort, populate, userId, scope) {
|
|
31
|
+
return this.dbInstance.findMany(this.name, query, select, skip, limit, sort, populate, userId, scope);
|
|
32
32
|
};
|
|
33
|
-
ConduitActiveSchema.prototype.create = function (query) {
|
|
34
|
-
return this.dbInstance.create(this.name, query);
|
|
33
|
+
ConduitActiveSchema.prototype.create = function (query, userId, scope) {
|
|
34
|
+
return this.dbInstance.create(this.name, query, userId, scope);
|
|
35
35
|
};
|
|
36
|
-
ConduitActiveSchema.prototype.createMany = function (query) {
|
|
37
|
-
return this.dbInstance.createMany(this.name, query);
|
|
36
|
+
ConduitActiveSchema.prototype.createMany = function (query, userId, scope) {
|
|
37
|
+
return this.dbInstance.createMany(this.name, query, userId, scope);
|
|
38
38
|
};
|
|
39
|
-
ConduitActiveSchema.prototype.findByIdAndUpdate = function (id, document, populate) {
|
|
40
|
-
return this.dbInstance.findByIdAndUpdate(this.name, id, document, populate);
|
|
39
|
+
ConduitActiveSchema.prototype.findByIdAndUpdate = function (id, document, populate, userId, scope) {
|
|
40
|
+
return this.dbInstance.findByIdAndUpdate(this.name, id, document, populate, userId, scope);
|
|
41
41
|
};
|
|
42
|
-
ConduitActiveSchema.prototype.findByIdAndReplace = function (id, document, populate) {
|
|
43
|
-
return this.dbInstance.findByIdAndReplace(this.name, id, document, populate);
|
|
42
|
+
ConduitActiveSchema.prototype.findByIdAndReplace = function (id, document, populate, userId, scope) {
|
|
43
|
+
return this.dbInstance.findByIdAndReplace(this.name, id, document, populate, userId, scope);
|
|
44
44
|
};
|
|
45
|
-
ConduitActiveSchema.prototype.replaceOne = function (filterQuery, query, populate) {
|
|
46
|
-
return this.dbInstance.replaceOne(this.name, filterQuery, query, populate);
|
|
45
|
+
ConduitActiveSchema.prototype.replaceOne = function (filterQuery, query, populate, userId, scope) {
|
|
46
|
+
return this.dbInstance.replaceOne(this.name, filterQuery, query, populate, userId, scope);
|
|
47
47
|
};
|
|
48
|
-
ConduitActiveSchema.prototype.updateOne = function (filterQuery, query, populate) {
|
|
49
|
-
return this.dbInstance.updateOne(this.name, filterQuery, query, populate);
|
|
48
|
+
ConduitActiveSchema.prototype.updateOne = function (filterQuery, query, populate, userId, scope) {
|
|
49
|
+
return this.dbInstance.updateOne(this.name, filterQuery, query, populate, userId, scope);
|
|
50
50
|
};
|
|
51
|
-
ConduitActiveSchema.prototype.updateMany = function (filterQuery, query, populate) {
|
|
52
|
-
return this.dbInstance.updateMany(this.name, filterQuery, query, populate);
|
|
51
|
+
ConduitActiveSchema.prototype.updateMany = function (filterQuery, query, populate, userId, scope) {
|
|
52
|
+
return this.dbInstance.updateMany(this.name, filterQuery, query, populate, userId, scope);
|
|
53
53
|
};
|
|
54
|
-
ConduitActiveSchema.prototype.deleteOne = function (query) {
|
|
55
|
-
return this.dbInstance.deleteOne(this.name, query);
|
|
54
|
+
ConduitActiveSchema.prototype.deleteOne = function (query, userId, scope) {
|
|
55
|
+
return this.dbInstance.deleteOne(this.name, query, userId, scope);
|
|
56
56
|
};
|
|
57
|
-
ConduitActiveSchema.prototype.deleteMany = function (query) {
|
|
58
|
-
return this.dbInstance.deleteMany(this.name, query);
|
|
57
|
+
ConduitActiveSchema.prototype.deleteMany = function (query, userId, scope) {
|
|
58
|
+
return this.dbInstance.deleteMany(this.name, query, userId, scope);
|
|
59
59
|
};
|
|
60
|
-
ConduitActiveSchema.prototype.countDocuments = function (query) {
|
|
61
|
-
return this.dbInstance.countDocuments(this.name, query);
|
|
60
|
+
ConduitActiveSchema.prototype.countDocuments = function (query, userId, scope) {
|
|
61
|
+
return this.dbInstance.countDocuments(this.name, query, userId, scope);
|
|
62
62
|
};
|
|
63
63
|
return ConduitActiveSchema;
|
|
64
64
|
}(grpc_sdk_1.ConduitSchema));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConduitActiveSchema.js","sourceRoot":"","sources":["../../src/classes/ConduitActiveSchema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,sDAMmC;AAEnC;IAA4C,uCAAa;IAGvD,6BACE,UAA4B,EAC5B,IAAY,EACZ,MAAqB,EACrB,YAAmC,EACnC,cAAuB;QALzB,YAOE,kBAAM,IAAI,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,EAAE,YAAY,EAAE,cAAc,CAAC,SAExD;QADC,KAAI,CAAC,UAAU,GAAG,UAAU,CAAC;;IAC/B,CAAC;IAED,qCAAO,GAAP,UACE,KAAe,EACf,MAAe,EACf,QAA4B;
|
|
1
|
+
{"version":3,"file":"ConduitActiveSchema.js","sourceRoot":"","sources":["../../src/classes/ConduitActiveSchema.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,sDAMmC;AAEnC;IAA4C,uCAAa;IAGvD,6BACE,UAA4B,EAC5B,IAAY,EACZ,MAAqB,EACrB,YAAmC,EACnC,cAAuB;QALzB,YAOE,kBAAM,IAAI,EAAE,MAAM,aAAN,MAAM,cAAN,MAAM,GAAI,EAAE,EAAE,YAAY,EAAE,cAAc,CAAC,SAExD;QADC,KAAI,CAAC,UAAU,GAAG,UAAU,CAAC;;IAC/B,CAAC;IAED,qCAAO,GAAP,UACE,KAAe,EACf,MAAe,EACf,QAA4B,EAC5B,MAAe,EACf,KAAc;QAEd,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACvF,CAAC;IAED,sCAAQ,GAAR,UACE,KAAe,EACf,MAAe,EACf,IAAa,EACb,KAAc,EACd,IAAsD,EACtD,QAA4B,EAC5B,MAAe,EACf,KAAc;QAEd,OAAO,IAAI,CAAC,UAAU,CAAC,QAAQ,CAC7B,IAAI,CAAC,IAAI,EACT,KAAK,EACL,MAAM,EACN,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,KAAK,CACN,CAAC;IACJ,CAAC;IAED,oCAAM,GAAN,UAAO,KAAe,EAAE,MAAe,EAAE,KAAc;QACrD,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,CAAI,IAAI,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC;IACpE,CAAC;IAED,wCAAU,GAAV,UAA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