@things-factory/auth-base 6.2.19 → 6.2.25
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-server/service/privilege/privilege.d.ts +12 -0
- package/dist-server/service/privilege/privilege.js +45 -1
- package/dist-server/service/privilege/privilege.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/server/service/privilege/privilege.ts +31 -1
@@ -1,5 +1,17 @@
|
|
1
1
|
import { Role } from '../role/role';
|
2
2
|
import { User } from '../user/user';
|
3
|
+
export declare class PrivilegeObject {
|
4
|
+
privilege?: string;
|
5
|
+
category?: string;
|
6
|
+
owner?: boolean;
|
7
|
+
super?: boolean;
|
8
|
+
}
|
9
|
+
export declare class PrivilegeInput {
|
10
|
+
privilege?: string;
|
11
|
+
category?: string;
|
12
|
+
owner?: boolean;
|
13
|
+
super?: boolean;
|
14
|
+
}
|
3
15
|
export declare class Privilege {
|
4
16
|
id: string;
|
5
17
|
name: string;
|
@@ -1,11 +1,55 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.Privilege = void 0;
|
3
|
+
exports.Privilege = exports.PrivilegeInput = exports.PrivilegeObject = void 0;
|
4
4
|
const tslib_1 = require("tslib");
|
5
5
|
const typeorm_1 = require("typeorm");
|
6
6
|
const type_graphql_1 = require("type-graphql");
|
7
7
|
const role_1 = require("../role/role");
|
8
8
|
const user_1 = require("../user/user");
|
9
|
+
let PrivilegeObject = class PrivilegeObject {
|
10
|
+
};
|
11
|
+
tslib_1.__decorate([
|
12
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
13
|
+
tslib_1.__metadata("design:type", String)
|
14
|
+
], PrivilegeObject.prototype, "privilege", void 0);
|
15
|
+
tslib_1.__decorate([
|
16
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
17
|
+
tslib_1.__metadata("design:type", String)
|
18
|
+
], PrivilegeObject.prototype, "category", void 0);
|
19
|
+
tslib_1.__decorate([
|
20
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
21
|
+
tslib_1.__metadata("design:type", Boolean)
|
22
|
+
], PrivilegeObject.prototype, "owner", void 0);
|
23
|
+
tslib_1.__decorate([
|
24
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
25
|
+
tslib_1.__metadata("design:type", Boolean)
|
26
|
+
], PrivilegeObject.prototype, "super", void 0);
|
27
|
+
PrivilegeObject = tslib_1.__decorate([
|
28
|
+
(0, type_graphql_1.ObjectType)()
|
29
|
+
], PrivilegeObject);
|
30
|
+
exports.PrivilegeObject = PrivilegeObject;
|
31
|
+
let PrivilegeInput = class PrivilegeInput {
|
32
|
+
};
|
33
|
+
tslib_1.__decorate([
|
34
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
35
|
+
tslib_1.__metadata("design:type", String)
|
36
|
+
], PrivilegeInput.prototype, "privilege", void 0);
|
37
|
+
tslib_1.__decorate([
|
38
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
39
|
+
tslib_1.__metadata("design:type", String)
|
40
|
+
], PrivilegeInput.prototype, "category", void 0);
|
41
|
+
tslib_1.__decorate([
|
42
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
43
|
+
tslib_1.__metadata("design:type", Boolean)
|
44
|
+
], PrivilegeInput.prototype, "owner", void 0);
|
45
|
+
tslib_1.__decorate([
|
46
|
+
(0, type_graphql_1.Field)({ nullable: true }),
|
47
|
+
tslib_1.__metadata("design:type", Boolean)
|
48
|
+
], PrivilegeInput.prototype, "super", void 0);
|
49
|
+
PrivilegeInput = tslib_1.__decorate([
|
50
|
+
(0, type_graphql_1.InputType)()
|
51
|
+
], PrivilegeInput);
|
52
|
+
exports.PrivilegeInput = PrivilegeInput;
|
9
53
|
let Privilege = class Privilege {
|
10
54
|
};
|
11
55
|
tslib_1.__decorate([
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"privilege.js","sourceRoot":"","sources":["../../../server/service/privilege/privilege.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+
|
1
|
+
{"version":3,"file":"privilege.js","sourceRoot":"","sources":["../../../server/service/privilege/privilege.ts"],"names":[],"mappings":";;;;AAAA,qCAWgB;AAChB,+CAA+D;AAC/D,uCAAmC;AACnC,uCAAmC;AAG5B,IAAM,eAAe,GAArB,MAAM,eAAe;CAY3B,CAAA;AAXC;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;kDACR;AAElB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACT;AAEjB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACX;AAEf;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;8CACX;AAXJ,eAAe;IAD3B,IAAA,yBAAU,GAAE;GACA,eAAe,CAY3B;AAZY,0CAAe;AAerB,IAAM,cAAc,GAApB,MAAM,cAAc;CAY1B,CAAA;AAXC;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;iDACR;AAElB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACT;AAEjB;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACX;AAEf;IAAC,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;6CACX;AAXJ,cAAc;IAD1B,IAAA,wBAAS,GAAE;GACC,cAAc,CAY1B;AAZY,wCAAc;AAmBpB,IAAM,SAAS,GAAf,MAAM,SAAS;CAkDrB,CAAA;AAjDC;IAAC,IAAA,gCAAsB,EAAC,MAAM,CAAC;IAC9B,IAAA,oBAAK,EAAC,IAAI,CAAC,EAAE,CAAC,iBAAE,CAAC;;qCACR;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AK,EAAC,IAAI,CAAC,EAAE,CAAC,WAAI,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCAC/B,WAAI;0CAAA;AAEb;IAAC,IAAA,oBAAU,EAAC,CAAC,SAAoB,EAAE,EAAE,CAAC,SAAS,CAAC,OAAO,CAAC;;4CACvC;AAEjB;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;4CAAA;AAEf;IAAC,IAAA,0BAAgB,GAAE;IAClB,IAAA,oBAAK,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;sCACf,IAAI;4CAAA;AAjDJ,SAAS;IALrB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,gBAAgB,EAAE,CAAC,SAAoB,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,SAAS,CAAC,QAAQ,CAAC,EAAE;QACvF,MAAM,EAAE,KAAK;KACd,CAAC;IACD,IAAA,yBAAU,GAAE;GACA,SAAS,CAkDrB;AAlDY,8BAAS","sourcesContent":["import {\n Column,\n CreateDateColumn,\n Entity,\n Index,\n ManyToMany,\n ManyToOne,\n JoinTable,\n RelationId,\n PrimaryGeneratedColumn,\n UpdateDateColumn\n} from 'typeorm'\nimport { ObjectType, InputType, Field, ID } from 'type-graphql'\nimport { Role } from '../role/role'\nimport { User } from '../user/user'\n\n@ObjectType()\nexport class PrivilegeObject {\n @Field({ nullable: true })\n privilege?: string\n\n @Field({ nullable: true })\n category?: string\n\n @Field({ nullable: true })\n owner?: boolean\n\n @Field({ nullable: true })\n super?: boolean\n}\n\n@InputType()\nexport class PrivilegeInput {\n @Field({ nullable: true })\n privilege?: string\n\n @Field({ nullable: true })\n category?: string\n\n @Field({ nullable: true })\n owner?: boolean\n\n @Field({ nullable: true })\n super?: boolean\n}\n\n@Entity()\n@Index('ix_privilege_0', (privilege: Privilege) => [privilege.name, privilege.category], {\n unique: false\n})\n@ObjectType()\nexport class Privilege {\n @PrimaryGeneratedColumn('uuid')\n @Field(type => ID)\n id: string\n\n @Column()\n @Field()\n name: string\n\n @Column()\n @Field({ nullable: true })\n category: string\n\n @Column({\n nullable: true\n })\n @Field({ nullable: true })\n description: string\n\n @ManyToMany(type => Role, role => role.privileges)\n @JoinTable({\n /* case M2M, JoinTable setting should be defined only one side (never set both side) */\n name: 'roles_privileges',\n joinColumns: [{ name: 'privileges_id', referencedColumnName: 'id' }],\n inverseJoinColumns: [{ name: 'roles_id', referencedColumnName: 'id' }]\n })\n @Field(type => [Role], { nullable: true })\n roles: Role[]\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n creator: User\n\n @RelationId((privilege: Privilege) => privilege.creator)\n creatorId: string\n\n @ManyToOne(type => User, { nullable: true })\n @Field(type => User, { nullable: true })\n updater: User\n\n @RelationId((privilege: Privilege) => privilege.updater)\n updaterId: string\n\n @CreateDateColumn()\n @Field({ nullable: true })\n createdAt: Date\n\n @UpdateDateColumn()\n @Field({ nullable: true })\n updatedAt: Date\n}\n"]}
|