@rpcbase/db 0.134.0 → 0.136.0
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/README.md +19 -3
- package/dist/acl/index.d.ts +1 -0
- package/dist/acl/index.d.ts.map +1 -1
- package/dist/acl/mongooseAclAggregate.d.ts +8 -0
- package/dist/acl/mongooseAclAggregate.d.ts.map +1 -0
- package/dist/acl/mongooseAclDriver.d.ts +22 -0
- package/dist/acl/mongooseAclDriver.d.ts.map +1 -0
- package/dist/acl/mongooseAclDriverContext.d.ts +17 -0
- package/dist/acl/mongooseAclDriverContext.d.ts.map +1 -0
- package/dist/acl/mongooseAclModel.d.ts +31 -0
- package/dist/acl/mongooseAclModel.d.ts.map +1 -0
- package/dist/acl/mongooseAclUtils.d.ts +6 -0
- package/dist/acl/mongooseAclUtils.d.ts.map +1 -0
- package/dist/ensureMongooseConnection.d.ts.map +1 -1
- package/dist/index.js +1025 -166
- package/dist/index.js.map +1 -1
- package/dist/models/RBUploadSession.d.ts +2 -2
- package/dist/modelsApi.d.ts +1 -1
- package/dist/modelsApi.d.ts.map +1 -1
- package/dist/registerModels.d.ts.map +1 -1
- package/dist/rtsChangeLogPlugin.d.ts +54 -0
- package/dist/rtsChangeLogPlugin.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/acl/mongooseAclPlugin.d.ts +0 -37
- package/dist/acl/mongooseAclPlugin.d.ts.map +0 -1
|
@@ -2,8 +2,8 @@ import { Schema } from 'mongoose';
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { AclPolicy } from '../acl';
|
|
4
4
|
export declare const ZRBUploadSessionStatus: z.ZodEnum<{
|
|
5
|
-
error: "error";
|
|
6
5
|
done: "done";
|
|
6
|
+
error: "error";
|
|
7
7
|
uploading: "uploading";
|
|
8
8
|
assembling: "assembling";
|
|
9
9
|
}>;
|
|
@@ -29,8 +29,8 @@ export declare const ZRBUploadSession: z.ZodObject<{
|
|
|
29
29
|
chunkSize: z.ZodNumber;
|
|
30
30
|
chunksTotal: z.ZodNumber;
|
|
31
31
|
status: z.ZodEnum<{
|
|
32
|
-
error: "error";
|
|
33
32
|
done: "done";
|
|
33
|
+
error: "error";
|
|
34
34
|
uploading: "uploading";
|
|
35
35
|
assembling: "assembling";
|
|
36
36
|
}>;
|
package/dist/modelsApi.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ export declare const models: {
|
|
|
17
17
|
global?: import('./registerModels').ModelModules;
|
|
18
18
|
}, options?: import('./registerModels').RegisterModelsOptions) => void;
|
|
19
19
|
readonly getUnsafe: (modelName: string, ctx: LoadModelCtx) => Promise<import('mongoose').Model<any, {}, {}, {}, any, any, any>>;
|
|
20
|
-
readonly get: (modelName: string, ctx: LoadModelCtx) => Promise<import('mongoose').Model<any, {}, {}, {}, any, any, any
|
|
20
|
+
readonly get: (modelName: string, ctx: LoadModelCtx) => Promise<import('./acl').AclMongooseModel<import('mongoose').Model<any, {}, {}, {}, any, any, any>>>;
|
|
21
21
|
readonly getGlobal: (modelName: string, ctx: LoadModelCtx) => Promise<import('mongoose').Model<any, {}, {}, {}, any, any, any>>;
|
|
22
22
|
};
|
|
23
23
|
//# sourceMappingURL=modelsApi.d.ts.map
|
package/dist/modelsApi.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modelsApi.d.ts","sourceRoot":"","sources":["../src/modelsApi.ts"],"names":[],"mappings":"AAKA,OAAO,
|
|
1
|
+
{"version":3,"file":"modelsApi.d.ts","sourceRoot":"","sources":["../src/modelsApi.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AASvC,MAAM,MAAM,YAAY,GAAG;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE;QACJ,OAAO,CAAC,EAAE;YACR,IAAI,CAAC,EAAE;gBACL,eAAe,CAAC,EAAE,MAAM,CAAC;aAC1B,CAAA;SACF,GAAG,IAAI,CAAC;KACV,CAAC;IACF,OAAO,CAAC,EAAE,UAAU,CAAC;CACtB,CAAC;AA6BF,eAAO,MAAM,2BAA2B,GAAI,KAAK,YAAY,KAAG,MAM/D,CAAA;AAED,eAAO,MAAM,MAAM;;;cAqBgB,CAAC;;oCAlBL,MAAM,OAAO,YAAY;8BAO/B,MAAM,OAAO,YAAY;oCASnB,MAAM,OAAO,YAAY;CAI9C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registerModels.d.ts","sourceRoot":"","sources":["../src/registerModels.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"registerModels.d.ts","sourceRoot":"","sources":["../src/registerModels.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAA;AAa/B,KAAK,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAC3C,KAAK,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAA;AACtC,KAAK,qBAAqB,GAAG;IAC3B,yBAAyB,CAAC,EAAE,OAAO,CAAC;CACrC,CAAA;AAED,KAAK,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAA;AA8DxD,eAAO,MAAM,cAAc,GACzB,oBAAoB;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,MAAM,CAAC,EAAE,YAAY,CAAA;CAAE,EACnE,UAAS,qBAA0B,SA6DpC,CAAA;AAED,eAAO,MAAM,mBAAmB,GAAI,OAAO,WAAW,sBAKrD,CAAA;AAED,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,qBAAqB,EAAE,CAAA"}
|
|
@@ -1,3 +1,57 @@
|
|
|
1
1
|
import { default as mongoose } from 'mongoose';
|
|
2
2
|
export declare const rtsChangeLogPlugin: (schema: mongoose.Schema) => void;
|
|
3
|
+
export declare const _private: {
|
|
4
|
+
getRtsModels: (db: mongoose.Connection) => {
|
|
5
|
+
RtsCounter: mongoose.Model<{
|
|
6
|
+
_id: string;
|
|
7
|
+
seq: number;
|
|
8
|
+
}, {}, {}, {}, mongoose.Document<unknown, {}, {
|
|
9
|
+
_id: string;
|
|
10
|
+
seq: number;
|
|
11
|
+
}, {}, mongoose.DefaultSchemaOptions> & {
|
|
12
|
+
_id: string;
|
|
13
|
+
seq: number;
|
|
14
|
+
} & Required<{
|
|
15
|
+
_id: string;
|
|
16
|
+
}> & {
|
|
17
|
+
__v: number;
|
|
18
|
+
} & {
|
|
19
|
+
id: string;
|
|
20
|
+
}, any, {
|
|
21
|
+
_id: string;
|
|
22
|
+
seq: number;
|
|
23
|
+
}>;
|
|
24
|
+
RtsChange: mongoose.Model<{
|
|
25
|
+
seq: number;
|
|
26
|
+
modelName: string;
|
|
27
|
+
op: "delete" | "reset_model";
|
|
28
|
+
ts: Date;
|
|
29
|
+
docId?: string | undefined;
|
|
30
|
+
}, {}, {}, {}, mongoose.Document<unknown, {}, {
|
|
31
|
+
seq: number;
|
|
32
|
+
modelName: string;
|
|
33
|
+
op: "delete" | "reset_model";
|
|
34
|
+
ts: Date;
|
|
35
|
+
docId?: string | undefined;
|
|
36
|
+
}, {}, mongoose.DefaultSchemaOptions> & {
|
|
37
|
+
seq: number;
|
|
38
|
+
modelName: string;
|
|
39
|
+
op: "delete" | "reset_model";
|
|
40
|
+
ts: Date;
|
|
41
|
+
docId?: string | undefined;
|
|
42
|
+
} & {
|
|
43
|
+
_id: mongoose.Types.ObjectId;
|
|
44
|
+
} & {
|
|
45
|
+
__v: number;
|
|
46
|
+
} & {
|
|
47
|
+
id: string;
|
|
48
|
+
}, any, {
|
|
49
|
+
seq: number;
|
|
50
|
+
modelName: string;
|
|
51
|
+
op: "delete" | "reset_model";
|
|
52
|
+
ts: Date;
|
|
53
|
+
docId?: string | undefined;
|
|
54
|
+
}>;
|
|
55
|
+
};
|
|
56
|
+
};
|
|
3
57
|
//# sourceMappingURL=rtsChangeLogPlugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rtsChangeLogPlugin.d.ts","sourceRoot":"","sources":["../src/rtsChangeLogPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"rtsChangeLogPlugin.d.ts","sourceRoot":"","sources":["../src/rtsChangeLogPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAA;AA2MpC,eAAO,MAAM,kBAAkB,GAAI,QAAQ,QAAQ,CAAC,MAAM,KAAG,IAmC5D,CAAA;AAED,eAAO,MAAM,QAAQ;uBAtLK,QAAQ,CAAC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwL5C,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { default as mongoose } from 'mongoose';
|
|
2
|
-
import { AclAction, AppAbility } from './types';
|
|
3
|
-
type StoredAcl = {
|
|
4
|
-
ability: AppAbility;
|
|
5
|
-
action?: AclAction;
|
|
6
|
-
};
|
|
7
|
-
type PipelineStageLike = Record<string, unknown>;
|
|
8
|
-
declare const mongooseAclPluginBrand: unique symbol;
|
|
9
|
-
declare module "mongoose" {
|
|
10
|
-
interface QueryOptions<DocType = unknown> {
|
|
11
|
-
rbAcl?: StoredAcl;
|
|
12
|
-
[mongooseAclPluginBrand]?: DocType;
|
|
13
|
-
}
|
|
14
|
-
interface AggregateOptions {
|
|
15
|
-
rbAcl?: StoredAcl;
|
|
16
|
-
}
|
|
17
|
-
interface Query<ResultType, DocType, THelpers = {}, RawDocType = unknown, QueryOp = "find", TDocOverrides = Record<string, never>> {
|
|
18
|
-
[mongooseAclPluginBrand]?: [ResultType, DocType, THelpers, RawDocType, QueryOp, TDocOverrides];
|
|
19
|
-
acl: (ability: AppAbility, action?: AclAction) => this;
|
|
20
|
-
}
|
|
21
|
-
interface Aggregate<ResultType> {
|
|
22
|
-
[mongooseAclPluginBrand]?: ResultType;
|
|
23
|
-
acl: (ability: AppAbility, action?: AclAction) => this;
|
|
24
|
-
}
|
|
25
|
-
interface Model<TRawDocType, TQueryHelpers, TInstanceMethods, TVirtuals, THydratedDocumentType, TSchema, TLeanResultType> {
|
|
26
|
-
[mongooseAclPluginBrand]?: [TRawDocType, TQueryHelpers, TInstanceMethods, TVirtuals, THydratedDocumentType, TSchema, TLeanResultType];
|
|
27
|
-
acl: (ability: AppAbility) => this;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
export declare const mongooseAclPlugin: (schema: mongoose.Schema) => void;
|
|
31
|
-
export declare const _private: {
|
|
32
|
-
createModelAclProxy: <TModel extends mongoose.Model<unknown>>(model: TModel, ability: AppAbility) => TModel;
|
|
33
|
-
injectAggregateMatch: (pipeline: PipelineStageLike[], match: Record<string, unknown>) => void;
|
|
34
|
-
mergeMongoQuery: (left: unknown, right: Record<string, unknown>) => Record<string, unknown>;
|
|
35
|
-
};
|
|
36
|
-
export {};
|
|
37
|
-
//# sourceMappingURL=mongooseAclPlugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mongooseAclPlugin.d.ts","sourceRoot":"","sources":["../../src/acl/mongooseAclPlugin.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,UAAU,CAAA;AAG/B,OAAO,KAAK,EAAE,SAAS,EAAkB,UAAU,EAAE,MAAM,SAAS,CAAA;AAGpE,KAAK,SAAS,GAAG;IACf,OAAO,EAAE,UAAU,CAAA;IACnB,MAAM,CAAC,EAAE,SAAS,CAAA;CACnB,CAAA;AAID,KAAK,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAqIhD,OAAO,CAAC,MAAM,sBAAsB,EAAE,OAAO,MAAM,CAAA;AAEnD,OAAO,QAAQ,UAAU,CAAC;IACxB,UAAU,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