@mahmoud-auth/model-climbers 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +8 -2
- package/dist/base-resource-field/compiler.d.ts +8 -0
- package/dist/base-resource-field/compiler.js +33 -0
- package/dist/base-resource-field/index.d.ts +3 -0
- package/dist/base-resource-field/index.js +19 -0
- package/dist/base-resource-field/registry.d.ts +10 -0
- package/dist/base-resource-field/registry.js +25 -0
- package/dist/base-resource-field/scanner.d.ts +8 -0
- package/dist/base-resource-field/scanner.js +14 -0
- package/dist/base-resource-field/type.d.ts +6 -0
- package/dist/base-resource-field/type.js +2 -0
- package/dist/errors/index.d.ts +3 -0
- package/dist/errors/index.js +19 -0
- package/dist/errors/invalid-resource-provider.exception.d.ts +4 -0
- package/dist/errors/invalid-resource-provider.exception.js +11 -0
- package/dist/errors/missing-resource-provider.exception.d.ts +4 -0
- package/dist/errors/missing-resource-provider.exception.js +10 -0
- package/dist/errors/missing-transition.exception.d.ts +4 -0
- package/dist/errors/missing-transition.exception.js +10 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +20 -0
- package/dist/relations/index.d.ts +4 -0
- package/dist/relations/index.js +20 -0
- package/dist/relations/module.d.ts +4 -0
- package/dist/relations/module.js +33 -0
- package/dist/relations/resource-provider/compiler.d.ts +9 -0
- package/dist/relations/resource-provider/compiler.js +47 -0
- package/dist/relations/resource-provider/decorator.d.ts +9 -0
- package/dist/relations/resource-provider/decorator.js +12 -0
- package/dist/relations/resource-provider/index.d.ts +4 -0
- package/dist/relations/resource-provider/index.js +20 -0
- package/dist/relations/resource-provider/module.d.ts +7 -0
- package/dist/relations/resource-provider/module.js +39 -0
- package/dist/relations/resource-provider/registry.d.ts +8 -0
- package/dist/relations/resource-provider/registry.js +31 -0
- package/dist/relations/resource-provider/scanner.d.ts +9 -0
- package/dist/relations/resource-provider/scanner.js +52 -0
- package/dist/relations/resource-provider/type.d.ts +7 -0
- package/dist/relations/resource-provider/type.js +2 -0
- package/dist/relations/resource-reference/compiler.d.ts +9 -0
- package/dist/relations/resource-reference/compiler.js +34 -0
- package/dist/relations/resource-reference/decorator.d.ts +7 -0
- package/dist/relations/resource-reference/decorator.js +10 -0
- package/dist/relations/resource-reference/index.d.ts +4 -0
- package/dist/relations/resource-reference/index.js +20 -0
- package/dist/relations/resource-reference/module.d.ts +8 -0
- package/dist/relations/resource-reference/module.js +46 -0
- package/dist/relations/resource-reference/registry.d.ts +4 -0
- package/dist/relations/resource-reference/registry.js +24 -0
- package/dist/relations/resource-reference/scanner.d.ts +10 -0
- package/dist/relations/resource-reference/scanner.js +46 -0
- package/dist/relations/resource-reference/type.d.ts +6 -0
- package/dist/relations/resource-reference/type.js +2 -0
- package/dist/relations/resource-resolver.service.d.ts +20 -0
- package/dist/relations/resource-resolver.service.js +137 -0
- package/dist/resource/index.d.ts +1 -0
- package/dist/resource/index.js +17 -0
- package/dist/resource/token.d.ts +4 -0
- package/dist/resource/token.js +12 -0
- package/dist/resource-cascade/base/base-cascade-helper.repository.d.ts +17 -0
- package/dist/resource-cascade/base/base-cascade-helper.repository.js +2 -0
- package/dist/resource-cascade/base/base-model.d.ts +13 -0
- package/dist/resource-cascade/base/base-model.js +42 -0
- package/dist/resource-cascade/base/base-service.d.ts +12 -0
- package/dist/resource-cascade/base/base-service.js +82 -0
- package/dist/resource-cascade/base/repository-registry.d.ts +7 -0
- package/dist/resource-cascade/base/repository-registry.js +13 -0
- package/dist/resource-cascade/compiler.d.ts +9 -0
- package/dist/resource-cascade/compiler.js +34 -0
- package/dist/resource-cascade/decorator.d.ts +10 -0
- package/dist/resource-cascade/decorator.js +20 -0
- package/dist/resource-cascade/enum.d.ts +4 -0
- package/dist/resource-cascade/enum.js +8 -0
- package/dist/resource-cascade/index.d.ts +9 -0
- package/dist/resource-cascade/index.js +25 -0
- package/dist/resource-cascade/module.d.ts +13 -0
- package/dist/resource-cascade/module.js +102 -0
- package/dist/resource-cascade/mongo/mongo-cascade-helper.repository.d.ts +13 -0
- package/dist/resource-cascade/mongo/mongo-cascade-helper.repository.js +50 -0
- package/dist/resource-cascade/registry.d.ts +8 -0
- package/dist/resource-cascade/registry.js +32 -0
- package/dist/resource-cascade/scanner.d.ts +10 -0
- package/dist/resource-cascade/scanner.js +43 -0
- package/dist/resource-cascade/token.d.ts +4 -0
- package/dist/resource-cascade/token.js +10 -0
- package/dist/resource-cascade/type.d.ts +8 -0
- package/dist/resource-cascade/type.js +2 -0
- package/dist/transition/compiler.d.ts +8 -0
- package/dist/transition/compiler.js +35 -0
- package/dist/transition/decorator.d.ts +3 -0
- package/dist/transition/decorator.js +12 -0
- package/dist/transition/index.d.ts +2 -0
- package/dist/transition/index.js +18 -0
- package/dist/transition/module.d.ts +7 -0
- package/dist/transition/module.js +35 -0
- package/dist/transition/registry.d.ts +8 -0
- package/dist/transition/registry.js +34 -0
- package/dist/transition/scanner.d.ts +8 -0
- package/dist/transition/scanner.js +50 -0
- package/dist/transition/type.d.ts +8 -0
- package/dist/transition/type.js +2 -0
- package/package.json +41 -4
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DiscoveryService, Reflector } from '@nestjs/core';
|
|
2
|
+
export declare class TransitionScanner {
|
|
3
|
+
private discovery;
|
|
4
|
+
private reflector;
|
|
5
|
+
constructor(discovery: DiscoveryService, reflector: Reflector);
|
|
6
|
+
lookupTransitions(): any[];
|
|
7
|
+
private getTransitionMetadata;
|
|
8
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.TransitionScanner = void 0;
|
|
13
|
+
const common_1 = require("@nestjs/common");
|
|
14
|
+
const core_1 = require("@nestjs/core");
|
|
15
|
+
const common_2 = require("@mahmoud-auth/common");
|
|
16
|
+
const decorator_1 = require("./decorator");
|
|
17
|
+
let TransitionScanner = class TransitionScanner {
|
|
18
|
+
discovery;
|
|
19
|
+
reflector;
|
|
20
|
+
constructor(discovery, reflector) {
|
|
21
|
+
this.discovery = discovery;
|
|
22
|
+
this.reflector = reflector;
|
|
23
|
+
}
|
|
24
|
+
lookupTransitions() {
|
|
25
|
+
return this.discovery
|
|
26
|
+
.getProviders()
|
|
27
|
+
.map(provider => this.getTransitionMetadata(provider))
|
|
28
|
+
.filter(common_2.isNotNull);
|
|
29
|
+
}
|
|
30
|
+
getTransitionMetadata(provider) {
|
|
31
|
+
const instance = provider.instance;
|
|
32
|
+
if (!instance) {
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
const metadata = this.reflector.get(decorator_1.TRANSITION_METADATA, instance.constructor);
|
|
36
|
+
if (!metadata) {
|
|
37
|
+
return null;
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
...metadata,
|
|
41
|
+
resolve: instance.resolve.bind(instance),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
exports.TransitionScanner = TransitionScanner;
|
|
46
|
+
exports.TransitionScanner = TransitionScanner = __decorate([
|
|
47
|
+
(0, common_1.Injectable)(),
|
|
48
|
+
__metadata("design:paramtypes", [core_1.DiscoveryService,
|
|
49
|
+
core_1.Reflector])
|
|
50
|
+
], TransitionScanner);
|
package/package.json
CHANGED
|
@@ -1,6 +1,43 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mahmoud-auth/model-climbers",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "Resource relations, transitions, and cascading operations for NestJS and Mongoose.",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": ["dist", "README.md", "LICENSE"],
|
|
15
|
+
"scripts": {
|
|
16
|
+
"clean": "rimraf dist",
|
|
17
|
+
"build": "rimraf dist && tsc -p tsconfig.build.json",
|
|
18
|
+
"prepack": "npm run build"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@mahmoud-auth/base-registry": "*",
|
|
22
|
+
"@mahmoud-auth/common": "*",
|
|
23
|
+
"@mahmoud-auth/utils": "*"
|
|
24
|
+
},
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@nestjs/common": "^11.0.0",
|
|
27
|
+
"@nestjs/core": "^11.0.0",
|
|
28
|
+
"@nestjs/mongoose": "^11.0.0",
|
|
29
|
+
"mongoose": "^8.0.0",
|
|
30
|
+
"reflect-metadata": "^0.1.13 || ^0.2.0"
|
|
31
|
+
},
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": "^22.12.0 || ^24.0.0 || >=26.0.0"
|
|
34
|
+
},
|
|
35
|
+
"publishConfig": {
|
|
36
|
+
"access": "public"
|
|
37
|
+
},
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/shahariko-lab/nestjs-rebac.git",
|
|
41
|
+
"directory": "packages/mahmoud/model-climbers"
|
|
42
|
+
}
|
|
43
|
+
}
|