@nest-boot/auth 8.0.2 → 9.0.0-beta.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 +48 -0
- package/dist/abilities/index.d.ts +2 -0
- package/dist/abilities/index.js +3 -0
- package/dist/abilities/index.js.map +1 -0
- package/dist/abilities/user.ability.d.ts +5 -0
- package/dist/abilities/user.ability.js +11 -0
- package/dist/abilities/user.ability.js.map +1 -0
- package/dist/abilities/workspace.ability.d.ts +5 -0
- package/dist/abilities/workspace.ability.js +11 -0
- package/dist/abilities/workspace.ability.js.map +1 -0
- package/dist/access-control.service.d.ts +18 -0
- package/dist/access-control.service.js +153 -0
- package/dist/access-control.service.js.map +1 -0
- package/dist/adapters/mikro-orm/adapter-config.d.ts +13 -0
- package/dist/adapters/mikro-orm/adapter-config.js +15 -0
- package/dist/adapters/mikro-orm/adapter-config.js.map +1 -0
- package/dist/adapters/mikro-orm/create-custom-adapter.d.ts +10 -0
- package/dist/adapters/mikro-orm/create-custom-adapter.js +106 -0
- package/dist/adapters/mikro-orm/create-custom-adapter.js.map +1 -0
- package/dist/adapters/mikro-orm/entity-metadata-resolver.d.ts +14 -0
- package/dist/adapters/mikro-orm/entity-metadata-resolver.js +68 -0
- package/dist/adapters/mikro-orm/entity-metadata-resolver.js.map +1 -0
- package/dist/adapters/mikro-orm/where-compiler.d.ts +156 -0
- package/dist/adapters/mikro-orm/where-compiler.js +69 -0
- package/dist/adapters/mikro-orm/where-compiler.js.map +1 -0
- package/dist/adapters/mikro-orm-adapter.d.ts +8 -11
- package/dist/adapters/mikro-orm-adapter.js +32 -162
- package/dist/adapters/mikro-orm-adapter.js.map +1 -1
- package/dist/api-key-usage.interceptor.d.ts +8 -0
- package/dist/api-key-usage.interceptor.js +35 -0
- package/dist/api-key-usage.interceptor.js.map +1 -0
- package/dist/api-key.service.d.ts +75 -0
- package/dist/api-key.service.js +336 -0
- package/dist/api-key.service.js.map +1 -0
- package/dist/auth-handler.middleware.d.ts +7 -0
- package/dist/auth-handler.middleware.js +31 -0
- package/dist/auth-handler.middleware.js.map +1 -0
- package/dist/auth-module-options.interface.d.ts +341 -6
- package/dist/auth.guard.d.ts +36 -4
- package/dist/auth.guard.js +297 -7
- package/dist/auth.guard.js.map +1 -1
- package/dist/auth.middleware.d.ts +16 -6
- package/dist/auth.middleware.js +97 -42
- package/dist/auth.middleware.js.map +1 -1
- package/dist/auth.module-definition.d.ts +1 -1
- package/dist/auth.module.d.ts +10 -7
- package/dist/auth.module.js +157 -44
- package/dist/auth.module.js.map +1 -1
- package/dist/auth.service.d.ts +24 -1857
- package/dist/auth.service.js +174 -4
- package/dist/auth.service.js.map +1 -1
- package/dist/decorators/can.decorator.d.ts +6 -0
- package/dist/decorators/can.decorator.js +8 -0
- package/dist/decorators/can.decorator.js.map +1 -0
- package/dist/decorators/current-api-key.decorator.d.ts +1 -0
- package/dist/decorators/current-api-key.decorator.js +5 -0
- package/dist/decorators/current-api-key.decorator.js.map +1 -0
- package/dist/decorators/current-workspace-member.decorator.d.ts +1 -0
- package/dist/decorators/current-workspace-member.decorator.js +5 -0
- package/dist/decorators/current-workspace-member.decorator.js.map +1 -0
- package/dist/decorators/current-workspace.decorator.d.ts +1 -0
- package/dist/decorators/current-workspace.decorator.js +5 -0
- package/dist/decorators/current-workspace.decorator.js.map +1 -0
- package/dist/decorators/index.d.ts +6 -0
- package/dist/decorators/index.js +6 -0
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/user-can.decorator.d.ts +5 -0
- package/dist/decorators/user-can.decorator.js +13 -0
- package/dist/decorators/user-can.decorator.js.map +1 -0
- package/dist/decorators/workspace-can.decorator.d.ts +5 -0
- package/dist/decorators/workspace-can.decorator.js +13 -0
- package/dist/decorators/workspace-can.decorator.js.map +1 -0
- package/dist/entities/account.entity.d.ts +1 -0
- package/dist/entities/account.entity.js +12 -3
- package/dist/entities/account.entity.js.map +1 -1
- package/dist/entities/api-key.entity.d.ts +17 -0
- package/dist/entities/api-key.entity.js +92 -0
- package/dist/entities/api-key.entity.js.map +1 -0
- package/dist/entities/index.d.ts +4 -0
- package/dist/entities/index.js +4 -0
- package/dist/entities/index.js.map +1 -1
- package/dist/entities/resolve-auth-relation-target.d.ts +3 -0
- package/dist/entities/resolve-auth-relation-target.js +30 -0
- package/dist/entities/resolve-auth-relation-target.js.map +1 -0
- package/dist/entities/session.entity.d.ts +3 -1
- package/dist/entities/session.entity.js +15 -2
- package/dist/entities/session.entity.js.map +1 -1
- package/dist/entities/user.entity.d.ts +5 -0
- package/dist/entities/user.entity.js +25 -0
- package/dist/entities/user.entity.js.map +1 -1
- package/dist/entities/verification.entity.js +2 -1
- package/dist/entities/verification.entity.js.map +1 -1
- package/dist/entities/workspace-invitation.entity.d.ts +14 -0
- package/dist/entities/workspace-invitation.entity.js +74 -0
- package/dist/entities/workspace-invitation.entity.js.map +1 -0
- package/dist/entities/workspace-member.entity.d.ts +16 -0
- package/dist/entities/workspace-member.entity.js +86 -0
- package/dist/entities/workspace-member.entity.js.map +1 -0
- package/dist/entities/workspace.entity.d.ts +8 -0
- package/dist/entities/workspace.entity.js +48 -0
- package/dist/entities/workspace.entity.js.map +1 -0
- package/dist/index.d.ts +32 -2
- package/dist/index.js +32 -2
- package/dist/index.js.map +1 -1
- package/dist/interfaces/auth-role.interface.d.ts +4 -0
- package/dist/interfaces/auth-role.interface.js +2 -0
- package/dist/interfaces/auth-role.interface.js.map +1 -0
- package/dist/interfaces/auth-service.interface.d.ts +160 -0
- package/dist/interfaces/auth-service.interface.js +2 -0
- package/dist/interfaces/auth-service.interface.js.map +1 -0
- package/dist/interfaces/can-options.interface.d.ts +3 -0
- package/dist/interfaces/can-options.interface.js +2 -0
- package/dist/interfaces/can-options.interface.js.map +1 -0
- package/dist/interfaces/route-argument-metadata-value.interface.d.ts +6 -0
- package/dist/interfaces/route-argument-metadata-value.interface.js +2 -0
- package/dist/interfaces/route-argument-metadata-value.interface.js.map +1 -0
- package/dist/interfaces/serialized-ability-rule.interface.d.ts +9 -0
- package/dist/interfaces/serialized-ability-rule.interface.js +2 -0
- package/dist/interfaces/serialized-ability-rule.interface.js.map +1 -0
- package/dist/interfaces/session-service.interface.d.ts +5 -0
- package/dist/interfaces/session-service.interface.js +2 -0
- package/dist/interfaces/session-service.interface.js.map +1 -0
- package/dist/interfaces/user-can-metadata.interface.d.ts +6 -0
- package/dist/interfaces/user-can-metadata.interface.js +2 -0
- package/dist/interfaces/user-can-metadata.interface.js.map +1 -0
- package/dist/interfaces/user-service.interface.d.ts +44 -0
- package/dist/interfaces/user-service.interface.js +2 -0
- package/dist/interfaces/user-service.interface.js.map +1 -0
- package/dist/interfaces/workspace-can-metadata.interface.d.ts +6 -0
- package/dist/interfaces/workspace-can-metadata.interface.js +2 -0
- package/dist/interfaces/workspace-can-metadata.interface.js.map +1 -0
- package/dist/interfaces/workspace-service.interface.d.ts +37 -0
- package/dist/interfaces/workspace-service.interface.js +2 -0
- package/dist/interfaces/workspace-service.interface.js.map +1 -0
- package/dist/permission.constants.d.ts +25 -0
- package/dist/permission.constants.js +26 -0
- package/dist/permission.constants.js.map +1 -0
- package/dist/session.service.d.ts +18 -0
- package/dist/session.service.js +171 -0
- package/dist/session.service.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/auth-module-roles.type.d.ts +1 -0
- package/dist/types/auth-module-roles.type.js +2 -0
- package/dist/types/auth-module-roles.type.js.map +1 -0
- package/dist/types/build-user-ability-callback.type.d.ts +4 -0
- package/dist/types/build-user-ability-callback.type.js +2 -0
- package/dist/types/build-user-ability-callback.type.js.map +1 -0
- package/dist/types/build-workspace-ability-callback.type.d.ts +4 -0
- package/dist/types/build-workspace-ability-callback.type.js +2 -0
- package/dist/types/build-workspace-ability-callback.type.js.map +1 -0
- package/dist/types/can-subject-factory.type.d.ts +2 -0
- package/dist/types/can-subject-factory.type.js +2 -0
- package/dist/types/can-subject-factory.type.js.map +1 -0
- package/dist/types/can-subject.type.d.ts +4 -0
- package/dist/types/can-subject.type.js +2 -0
- package/dist/types/can-subject.type.js.map +1 -0
- package/dist/types/route-argument-metadata.type.d.ts +2 -0
- package/dist/types/route-argument-metadata.type.js +2 -0
- package/dist/types/route-argument-metadata.type.js.map +1 -0
- package/dist/user-deletion.service.d.ts +19 -0
- package/dist/user-deletion.service.js +103 -0
- package/dist/user-deletion.service.js.map +1 -0
- package/dist/user.constants.d.ts +7 -0
- package/dist/user.constants.js +23 -0
- package/dist/user.constants.js.map +1 -0
- package/dist/user.service.d.ts +54 -0
- package/dist/user.service.js +386 -0
- package/dist/user.service.js.map +1 -0
- package/dist/utils/append-metadata.util.d.ts +3 -0
- package/dist/utils/append-metadata.util.js +12 -0
- package/dist/utils/append-metadata.util.js.map +1 -0
- package/dist/utils/apply-auth-response-cookies.util.d.ts +1 -0
- package/dist/utils/apply-auth-response-cookies.util.js +13 -0
- package/dist/utils/apply-auth-response-cookies.util.js.map +1 -0
- package/dist/utils/auth-role.util.d.ts +11 -0
- package/dist/utils/auth-role.util.js +88 -0
- package/dist/utils/auth-role.util.js.map +1 -0
- package/dist/utils/can.util.d.ts +3 -0
- package/dist/utils/can.util.js +8 -0
- package/dist/utils/can.util.js.map +1 -0
- package/dist/utils/create-email-and-password-config.d.ts +7 -3
- package/dist/utils/create-email-and-password-config.js +22 -1
- package/dist/utils/create-email-and-password-config.js.map +1 -1
- package/dist/utils/create-email-verification-config.d.ts +7 -0
- package/dist/utils/create-email-verification-config.js +14 -0
- package/dist/utils/create-email-verification-config.js.map +1 -0
- package/dist/utils/create-generic-oauth-config.d.ts +2 -0
- package/dist/utils/create-generic-oauth-config.js +15 -0
- package/dist/utils/create-generic-oauth-config.js.map +1 -0
- package/dist/utils/create-social-provider-config.d.ts +2 -2
- package/dist/utils/create-social-provider-config.js +6 -0
- package/dist/utils/create-social-provider-config.js.map +1 -1
- package/dist/utils/create-social-providers-config.d.ts +2 -2
- package/dist/utils/create-social-providers-config.js.map +1 -1
- package/dist/utils/create-user-config.d.ts +7 -0
- package/dist/utils/create-user-config.js +48 -0
- package/dist/utils/create-user-config.js.map +1 -0
- package/dist/utils/extract-api-key.util.d.ts +2 -0
- package/dist/utils/extract-api-key.util.js +14 -0
- package/dist/utils/extract-api-key.util.js.map +1 -0
- package/dist/utils/get-user-ability.util.d.ts +2 -0
- package/dist/utils/get-user-ability.util.js +11 -0
- package/dist/utils/get-user-ability.util.js.map +1 -0
- package/dist/utils/get-workspace-ability.util.d.ts +2 -0
- package/dist/utils/get-workspace-ability.util.js +11 -0
- package/dist/utils/get-workspace-ability.util.js.map +1 -0
- package/dist/utils/serialize-ability-rules.util.d.ts +3 -0
- package/dist/utils/serialize-ability-rules.util.js +23 -0
- package/dist/utils/serialize-ability-rules.util.js.map +1 -0
- package/dist/utils/split-auth-providers.d.ts +10 -0
- package/dist/utils/split-auth-providers.js +34 -0
- package/dist/utils/split-auth-providers.js.map +1 -0
- package/dist/utils/user-can.util.d.ts +2 -0
- package/dist/utils/user-can.util.js +18 -0
- package/dist/utils/user-can.util.js.map +1 -0
- package/dist/utils/workspace-can.util.d.ts +2 -0
- package/dist/utils/workspace-can.util.js +18 -0
- package/dist/utils/workspace-can.util.js.map +1 -0
- package/dist/workspace.constants.d.ts +8 -0
- package/dist/workspace.constants.js +24 -0
- package/dist/workspace.constants.js.map +1 -0
- package/dist/workspace.service.d.ts +59 -0
- package/dist/workspace.service.js +611 -0
- package/dist/workspace.service.js.map +1 -0
- package/package.json +26 -14
- package/dist/auth.transaction-context.d.ts +0 -10
- package/dist/auth.transaction-context.js +0 -22
- package/dist/auth.transaction-context.js.map +0 -1
- package/dist/utils/assert-no-duplicate-generic-oauth-plugin.d.ts +0 -2
- package/dist/utils/assert-no-duplicate-generic-oauth-plugin.js +0 -8
- package/dist/utils/assert-no-duplicate-generic-oauth-plugin.js.map +0 -1
|
@@ -8,8 +8,10 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { BaseEntity, Cascade, t } from "@mikro-orm/core";
|
|
11
|
-
import { Entity, ManyToOne, PrimaryKey, Property, Unique, } from "@mikro-orm/decorators/legacy";
|
|
11
|
+
import { Entity, Index, ManyToOne, PrimaryKey, Property, Unique, } from "@mikro-orm/decorators/legacy";
|
|
12
12
|
import { randomUUID } from "crypto";
|
|
13
|
+
import { resolveAuthRelationTarget } from "./resolve-auth-relation-target.js";
|
|
14
|
+
import { BaseUser } from "./user.entity.js";
|
|
13
15
|
let BaseSession = class BaseSession extends BaseEntity {
|
|
14
16
|
id = randomUUID();
|
|
15
17
|
token;
|
|
@@ -17,6 +19,7 @@ let BaseSession = class BaseSession extends BaseEntity {
|
|
|
17
19
|
expiresAt;
|
|
18
20
|
ipAddress;
|
|
19
21
|
userAgent;
|
|
22
|
+
impersonatedBy;
|
|
20
23
|
createdAt = new Date();
|
|
21
24
|
updatedAt = new Date();
|
|
22
25
|
};
|
|
@@ -30,8 +33,9 @@ __decorate([
|
|
|
30
33
|
__metadata("design:type", String)
|
|
31
34
|
], BaseSession.prototype, "token", void 0);
|
|
32
35
|
__decorate([
|
|
36
|
+
Index(),
|
|
33
37
|
ManyToOne({
|
|
34
|
-
entity: () => "User",
|
|
38
|
+
entity: () => resolveAuthRelationTarget(BaseUser, "User"),
|
|
35
39
|
fieldName: "user_id",
|
|
36
40
|
mapToPk: true,
|
|
37
41
|
cascade: [Cascade.REMOVE],
|
|
@@ -50,6 +54,15 @@ __decorate([
|
|
|
50
54
|
Property({ type: t.text, nullable: true }),
|
|
51
55
|
__metadata("design:type", Object)
|
|
52
56
|
], BaseSession.prototype, "userAgent", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
ManyToOne({
|
|
59
|
+
entity: () => resolveAuthRelationTarget(BaseUser, "User"),
|
|
60
|
+
fieldName: "impersonated_by_id",
|
|
61
|
+
nullable: true,
|
|
62
|
+
deleteRule: "set null",
|
|
63
|
+
}),
|
|
64
|
+
__metadata("design:type", Object)
|
|
65
|
+
], BaseSession.prototype, "impersonatedBy", void 0);
|
|
53
66
|
__decorate([
|
|
54
67
|
Property({ type: t.datetime, defaultRaw: "now()" }),
|
|
55
68
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.entity.js","sourceRoot":"","sources":["../../src/entities/session.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"session.entity.js","sourceRoot":"","sources":["../../src/entities/session.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAsB,CAAC,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EACL,MAAM,EACN,KAAK,EACL,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,GACP,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEpC,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAUrC,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAGzC,EAAE,GAAgB,UAAU,EAAE,CAAC;IAK/B,KAAK,CAAU;IAUf,MAAM,CAAU;IAIhB,SAAS,CAAQ;IAIjB,SAAS,CAAe;IAIxB,SAAS,CAAe;IASxB,cAAc,CAAwB;IAItC,SAAS,GAAc,IAAI,IAAI,EAAE,CAAC;IAQlC,SAAS,GAAc,IAAI,IAAI,EAAE,CAAC;CACnC,CAAA;AAjDC;IADC,UAAU,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;;uCACE;AAK/B;IAFC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAC1B,MAAM,EAAE;;0CACM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opt<string[]>;
|
|
9
|
+
permissions: Opt<string[]>;
|
|
10
|
+
banned: Opt<boolean>;
|
|
11
|
+
banReason?: Opt<string> | null;
|
|
12
|
+
banExpiresAt?: Opt<Date> | null;
|
|
8
13
|
createdAt: Opt<Date>;
|
|
9
14
|
updatedAt: Opt<Date>;
|
|
10
15
|
}
|
|
@@ -16,6 +16,11 @@ let BaseUser = class BaseUser extends BaseEntity {
|
|
|
16
16
|
email;
|
|
17
17
|
emailVerified;
|
|
18
18
|
image;
|
|
19
|
+
roles = ["user"];
|
|
20
|
+
permissions = [];
|
|
21
|
+
banned = false;
|
|
22
|
+
banReason = null;
|
|
23
|
+
banExpiresAt = null;
|
|
19
24
|
createdAt = new Date();
|
|
20
25
|
updatedAt = new Date();
|
|
21
26
|
};
|
|
@@ -40,6 +45,26 @@ __decorate([
|
|
|
40
45
|
Property({ type: t.text, nullable: true }),
|
|
41
46
|
__metadata("design:type", Object)
|
|
42
47
|
], BaseUser.prototype, "image", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
Property({ type: t.array }),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], BaseUser.prototype, "roles", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
Property({ type: t.array }),
|
|
54
|
+
__metadata("design:type", Object)
|
|
55
|
+
], BaseUser.prototype, "permissions", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
Property({ type: t.boolean, default: false }),
|
|
58
|
+
__metadata("design:type", Object)
|
|
59
|
+
], BaseUser.prototype, "banned", void 0);
|
|
60
|
+
__decorate([
|
|
61
|
+
Property({ type: t.text, nullable: true }),
|
|
62
|
+
__metadata("design:type", Object)
|
|
63
|
+
], BaseUser.prototype, "banReason", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
Property({ type: t.datetime, nullable: true }),
|
|
66
|
+
__metadata("design:type", Object)
|
|
67
|
+
], BaseUser.prototype, "banExpiresAt", void 0);
|
|
43
68
|
__decorate([
|
|
44
69
|
Property({ type: t.datetime, defaultRaw: "now()" }),
|
|
45
70
|
__metadata("design:type", Object)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAY,CAAC,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EACL,MAAM,EACN,UAAU,EACV,QAAQ,EACR,MAAM,GACP,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAU7B,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IAGtC,EAAE,GAAgB,UAAU,EAAE,CAAC;IAI/B,IAAI,CAAU;IAKd,KAAK,CAAU;IAIf,aAAa,CAAW;IAIxB,KAAK,CAAe;IAIpB,SAAS,GAAc,IAAI,IAAI,EAAE,CAAC;IAQlC,SAAS,GAAc,IAAI,IAAI,EAAE,CAAC;CACnC,CAAA;
|
|
1
|
+
{"version":3,"file":"user.entity.js","sourceRoot":"","sources":["../../src/entities/user.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAY,CAAC,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EACL,MAAM,EACN,UAAU,EACV,QAAQ,EACR,MAAM,GACP,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAU7B,IAAM,QAAQ,GAAd,MAAM,QAAS,SAAQ,UAAU;IAGtC,EAAE,GAAgB,UAAU,EAAE,CAAC;IAI/B,IAAI,CAAU;IAKd,KAAK,CAAU;IAIf,aAAa,CAAW;IAIxB,KAAK,CAAe;IAIpB,KAAK,GAAkB,CAAC,MAAM,CAAC,CAAC;IAIhC,WAAW,GAAkB,EAAE,CAAC;IAIhC,MAAM,GAAiB,KAAK,CAAC;IAI7B,SAAS,GAAwB,IAAI,CAAC;IAItC,YAAY,GAA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;QAChB,UAAU,EAAE,OAAO;QACnB,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;KAC3B,CAAC;;2CACgC;AApDvB,QAAQ;IADpB,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;GACd,QAAQ,CAqDpB"}
|
|
@@ -8,7 +8,7 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
8
8
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
9
|
};
|
|
10
10
|
import { BaseEntity, t } from "@mikro-orm/core";
|
|
11
|
-
import { Entity, PrimaryKey, Property } from "@mikro-orm/decorators/legacy";
|
|
11
|
+
import { Entity, Index, PrimaryKey, Property, } from "@mikro-orm/decorators/legacy";
|
|
12
12
|
import { randomUUID } from "crypto";
|
|
13
13
|
let BaseVerification = class BaseVerification extends BaseEntity {
|
|
14
14
|
id = randomUUID();
|
|
@@ -23,6 +23,7 @@ __decorate([
|
|
|
23
23
|
__metadata("design:type", Object)
|
|
24
24
|
], BaseVerification.prototype, "id", void 0);
|
|
25
25
|
__decorate([
|
|
26
|
+
Index(),
|
|
26
27
|
Property({ type: t.text }),
|
|
27
28
|
__metadata("design:type", String)
|
|
28
29
|
], BaseVerification.prototype, "identifier", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"verification.entity.js","sourceRoot":"","sources":["../../src/entities/verification.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAY,CAAC,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"verification.entity.js","sourceRoot":"","sources":["../../src/entities/verification.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAY,CAAC,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EACL,MAAM,EACN,KAAK,EACL,UAAU,EACV,QAAQ,GACT,MAAM,8BAA8B,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAU7B,IAAe,gBAAgB,GAA/B,MAAe,gBAAiB,SAAQ,UAAU;IAGvD,EAAE,GAAgB,UAAU,EAAE,CAAC;IAK/B,UAAU,CAAU;IAIpB,KAAK,CAAU;IAIf,SAAS,CAAQ;IAIjB,SAAS,GAAc,IAAI,IAAI,EAAE,CAAC;IAQlC,SAAS,GAAc,IAAI,IAAI,EAAE,CAAC;CACnC,CAAA;AA1BC;IADC,UAAU,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;;4CACE;AAK/B;IAFC,KAAK,EAAE;IACP,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;;oDACP;AAIpB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;;+CACZ;AAIf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;8BACnB,IAAI;mDAAC;AAIjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;;mDAClB;AAQlC;IALC,QAAQ,CAAC;QACR,IAAI,EAAE,CAAC,CAAC,QAAQ;QAChB,UAAU,EAAE,OAAO;QACnB,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;KAC3B,CAAC;;mDACgC;AA5Bd,gBAAgB;IADrC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;GACL,gBAAgB,CA6BrC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { BaseEntity, type Opt, type Ref } from "@mikro-orm/core";
|
|
2
|
+
import { BaseUser } from "./user.entity.js";
|
|
3
|
+
import { BaseWorkspace } from "./workspace.entity.js";
|
|
4
|
+
export type AuthWorkspaceInvitationStatus = "accepted" | "canceled" | "pending" | "rejected";
|
|
5
|
+
export declare class BaseWorkspaceInvitation extends BaseEntity {
|
|
6
|
+
id: Opt<string>;
|
|
7
|
+
email: string;
|
|
8
|
+
roles: Opt<string[]>;
|
|
9
|
+
status: Opt<AuthWorkspaceInvitationStatus>;
|
|
10
|
+
expiresAt: Date;
|
|
11
|
+
createdAt: Opt<Date>;
|
|
12
|
+
inviter: Ref<BaseUser>;
|
|
13
|
+
workspace: Ref<BaseWorkspace>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { randomUUID } from "node:crypto";
|
|
11
|
+
import { BaseEntity, t } from "@mikro-orm/core";
|
|
12
|
+
import { Entity, ManyToOne, PrimaryKey, Property, Unique, } from "@mikro-orm/decorators/legacy";
|
|
13
|
+
import { resolveAuthRelationTarget } from "./resolve-auth-relation-target.js";
|
|
14
|
+
import { BaseUser } from "./user.entity.js";
|
|
15
|
+
import { BaseWorkspace } from "./workspace.entity.js";
|
|
16
|
+
let BaseWorkspaceInvitation = class BaseWorkspaceInvitation extends BaseEntity {
|
|
17
|
+
id = randomUUID();
|
|
18
|
+
email;
|
|
19
|
+
roles = ["member"];
|
|
20
|
+
status = "pending";
|
|
21
|
+
expiresAt;
|
|
22
|
+
createdAt = new Date();
|
|
23
|
+
inviter;
|
|
24
|
+
workspace;
|
|
25
|
+
};
|
|
26
|
+
__decorate([
|
|
27
|
+
PrimaryKey({ type: t.uuid }),
|
|
28
|
+
__metadata("design:type", Object)
|
|
29
|
+
], BaseWorkspaceInvitation.prototype, "id", void 0);
|
|
30
|
+
__decorate([
|
|
31
|
+
Property({ type: t.text }),
|
|
32
|
+
__metadata("design:type", String)
|
|
33
|
+
], BaseWorkspaceInvitation.prototype, "email", void 0);
|
|
34
|
+
__decorate([
|
|
35
|
+
Property({ type: t.array }),
|
|
36
|
+
__metadata("design:type", Object)
|
|
37
|
+
], BaseWorkspaceInvitation.prototype, "roles", void 0);
|
|
38
|
+
__decorate([
|
|
39
|
+
Property({ type: t.string, default: "pending" }),
|
|
40
|
+
__metadata("design:type", Object)
|
|
41
|
+
], BaseWorkspaceInvitation.prototype, "status", void 0);
|
|
42
|
+
__decorate([
|
|
43
|
+
Property({ type: t.datetime }),
|
|
44
|
+
__metadata("design:type", Date)
|
|
45
|
+
], BaseWorkspaceInvitation.prototype, "expiresAt", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
Property({ type: t.datetime, defaultRaw: "now()" }),
|
|
48
|
+
__metadata("design:type", Object)
|
|
49
|
+
], BaseWorkspaceInvitation.prototype, "createdAt", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
ManyToOne({
|
|
52
|
+
entity: () => resolveAuthRelationTarget(BaseUser, "User"),
|
|
53
|
+
updateRule: "cascade",
|
|
54
|
+
deleteRule: "cascade",
|
|
55
|
+
}),
|
|
56
|
+
__metadata("design:type", Object)
|
|
57
|
+
], BaseWorkspaceInvitation.prototype, "inviter", void 0);
|
|
58
|
+
__decorate([
|
|
59
|
+
ManyToOne({
|
|
60
|
+
entity: () => resolveAuthRelationTarget(BaseWorkspace, "Workspace"),
|
|
61
|
+
updateRule: "cascade",
|
|
62
|
+
deleteRule: "cascade",
|
|
63
|
+
}),
|
|
64
|
+
__metadata("design:type", Object)
|
|
65
|
+
], BaseWorkspaceInvitation.prototype, "workspace", void 0);
|
|
66
|
+
BaseWorkspaceInvitation = __decorate([
|
|
67
|
+
Entity({ abstract: true }),
|
|
68
|
+
Unique({
|
|
69
|
+
properties: ["email", "workspace"],
|
|
70
|
+
where: { status: "pending" },
|
|
71
|
+
})
|
|
72
|
+
], BaseWorkspaceInvitation);
|
|
73
|
+
export { BaseWorkspaceInvitation };
|
|
74
|
+
//# sourceMappingURL=workspace-invitation.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-invitation.entity.js","sourceRoot":"","sources":["../../src/entities/workspace-invitation.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAsB,CAAC,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EACL,MAAM,EACN,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,GACP,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAqB/C,IAAM,uBAAuB,GAA7B,MAAM,uBAAwB,SAAQ,UAAU;IAGrD,EAAE,GAAgB,UAAU,EAAE,CAAC;IAI/B,KAAK,CAAU;IAIf,KAAK,GAAkB,CAAC,QAAQ,CAAC,CAAC;IAKlC,MAAM,GAAuC,SAAS,CAAC;IAIvD,SAAS,CAAQ;IAIjB,SAAS,GAAc,IAAI,IAAI,EAAE,CAAC;IAQlC,OAAO,CAAiB;IAQxB,SAAS,CAAsB;CAChC,CAAA;AAtCC;IADC,UAAU,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;;mDACE;AAI/B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;;sDACZ;AAIf;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC;;sDACM;AAKlC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC;;uDACM;AAIvD;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC;8BACnB,IAAI;0DAAC;AAIjB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;;0DAClB;AAQlC;IALC,SAAS,CAAC;QACT,MAAM,EAAE,GAAG,EAAE,CAAC,yBAAyB,CAAC,QAAQ,EAAE,MAAM,CAAQ;QAChE,UAAU,EAAE,SAAS;QACrB,UAAU,EAAE,SAAS;KACtB,CAAC;;wDACsB;AAQxB;IALC,SAAS,CAAC;QACT,MAAM,EAAE,GAAG,EAAE,CAAC,yBAAyB,CAAC,aAAa,EAAE,WAAW,CAAQ;QAC1E,UAAU,EAAE,SAAS;QACrB,UAAU,EAAE,SAAS;KACtB,CAAC;;0DAC6B;AAxCpB,uBAAuB;IALnC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,MAAM,CAAC;QACN,UAAU,EAAE,CAAC,OAAO,EAAE,WAAW,CAAC;QAClC,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE;KAC7B,CAAC;GACW,uBAAuB,CAyCnC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { BaseEntity, type Opt, type Ref } from "@mikro-orm/core";
|
|
2
|
+
import { BaseUser } from "./user.entity.js";
|
|
3
|
+
import { BaseWorkspace } from "./workspace.entity.js";
|
|
4
|
+
export type AuthWorkspaceMemberStatus = "ACTIVE" | "DISABLED";
|
|
5
|
+
export declare class BaseWorkspaceMember extends BaseEntity {
|
|
6
|
+
id: Opt<string>;
|
|
7
|
+
name: string;
|
|
8
|
+
email?: Opt<string> | null;
|
|
9
|
+
roles: Opt<string[]>;
|
|
10
|
+
status: Opt<AuthWorkspaceMemberStatus>;
|
|
11
|
+
permissions: Opt<string[]>;
|
|
12
|
+
createdAt: Opt<Date>;
|
|
13
|
+
updatedAt: Opt<Date>;
|
|
14
|
+
user?: Ref<BaseUser> | null;
|
|
15
|
+
workspace: Ref<BaseWorkspace>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { randomUUID } from "node:crypto";
|
|
11
|
+
import { BaseEntity, t } from "@mikro-orm/core";
|
|
12
|
+
import { Entity, ManyToOne, PrimaryKey, Property, Unique, } from "@mikro-orm/decorators/legacy";
|
|
13
|
+
import { resolveAuthRelationTarget } from "./resolve-auth-relation-target.js";
|
|
14
|
+
import { BaseUser } from "./user.entity.js";
|
|
15
|
+
import { BaseWorkspace } from "./workspace.entity.js";
|
|
16
|
+
let BaseWorkspaceMember = class BaseWorkspaceMember extends BaseEntity {
|
|
17
|
+
id = randomUUID();
|
|
18
|
+
name;
|
|
19
|
+
email = null;
|
|
20
|
+
roles = ["member"];
|
|
21
|
+
status = "ACTIVE";
|
|
22
|
+
permissions = [];
|
|
23
|
+
createdAt = new Date();
|
|
24
|
+
updatedAt = new Date();
|
|
25
|
+
user;
|
|
26
|
+
workspace;
|
|
27
|
+
};
|
|
28
|
+
__decorate([
|
|
29
|
+
PrimaryKey({ type: t.uuid }),
|
|
30
|
+
__metadata("design:type", Object)
|
|
31
|
+
], BaseWorkspaceMember.prototype, "id", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
Property({ type: t.text }),
|
|
34
|
+
__metadata("design:type", String)
|
|
35
|
+
], BaseWorkspaceMember.prototype, "name", void 0);
|
|
36
|
+
__decorate([
|
|
37
|
+
Property({ type: t.text, nullable: true }),
|
|
38
|
+
__metadata("design:type", Object)
|
|
39
|
+
], BaseWorkspaceMember.prototype, "email", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
Property({ type: t.array }),
|
|
42
|
+
__metadata("design:type", Object)
|
|
43
|
+
], BaseWorkspaceMember.prototype, "roles", void 0);
|
|
44
|
+
__decorate([
|
|
45
|
+
Property({ type: t.string, default: "ACTIVE" }),
|
|
46
|
+
__metadata("design:type", Object)
|
|
47
|
+
], BaseWorkspaceMember.prototype, "status", void 0);
|
|
48
|
+
__decorate([
|
|
49
|
+
Property({ type: t.array }),
|
|
50
|
+
__metadata("design:type", Object)
|
|
51
|
+
], BaseWorkspaceMember.prototype, "permissions", void 0);
|
|
52
|
+
__decorate([
|
|
53
|
+
Property({ type: t.datetime, defaultRaw: "now()" }),
|
|
54
|
+
__metadata("design:type", Object)
|
|
55
|
+
], BaseWorkspaceMember.prototype, "createdAt", void 0);
|
|
56
|
+
__decorate([
|
|
57
|
+
Property({
|
|
58
|
+
type: t.datetime,
|
|
59
|
+
defaultRaw: "now()",
|
|
60
|
+
onUpdate: () => new Date(),
|
|
61
|
+
}),
|
|
62
|
+
__metadata("design:type", Object)
|
|
63
|
+
], BaseWorkspaceMember.prototype, "updatedAt", void 0);
|
|
64
|
+
__decorate([
|
|
65
|
+
ManyToOne({
|
|
66
|
+
entity: () => resolveAuthRelationTarget(BaseUser, "User"),
|
|
67
|
+
nullable: true,
|
|
68
|
+
updateRule: "cascade",
|
|
69
|
+
deleteRule: "cascade",
|
|
70
|
+
}),
|
|
71
|
+
__metadata("design:type", Object)
|
|
72
|
+
], BaseWorkspaceMember.prototype, "user", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
ManyToOne({
|
|
75
|
+
entity: () => resolveAuthRelationTarget(BaseWorkspace, "Workspace"),
|
|
76
|
+
updateRule: "cascade",
|
|
77
|
+
deleteRule: "cascade",
|
|
78
|
+
}),
|
|
79
|
+
__metadata("design:type", Object)
|
|
80
|
+
], BaseWorkspaceMember.prototype, "workspace", void 0);
|
|
81
|
+
BaseWorkspaceMember = __decorate([
|
|
82
|
+
Entity({ abstract: true }),
|
|
83
|
+
Unique({ properties: ["user", "workspace"] })
|
|
84
|
+
], BaseWorkspaceMember);
|
|
85
|
+
export { BaseWorkspaceMember };
|
|
86
|
+
//# sourceMappingURL=workspace-member.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-member.entity.js","sourceRoot":"","sources":["../../src/entities/workspace-member.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAsB,CAAC,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EACL,MAAM,EACN,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,GACP,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAc/C,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,UAAU;IAG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;QAChE,QAAQ,EAAE,IAAI;QACd,UAAU,EAAE,SAAS;QACrB,UAAU,EAAE,SAAS;KACtB,CAAC;;iDAC0B;AAQ5B;IALC,SAAS,CAAC;QACT,MAAM,EAAE,GAAG,EAAE,CAAC,yBAAyB,CAAC,aAAa,EAAE,WAAW,CAAQ;QAC1E,UAAU,EAAE,SAAS;QACrB,UAAU,EAAE,SAAS;KACtB,CAAC;;sDAC6B;AArDpB,mBAAmB;IAF/B,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC1B,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,EAAE,CAAC;GACjC,mBAAmB,CAsD/B"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
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;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
+
};
|
|
10
|
+
import { randomUUID } from "node:crypto";
|
|
11
|
+
import { BaseEntity, t } from "@mikro-orm/core";
|
|
12
|
+
import { Entity, PrimaryKey, Property } from "@mikro-orm/decorators/legacy";
|
|
13
|
+
let BaseWorkspace = class BaseWorkspace extends BaseEntity {
|
|
14
|
+
id = randomUUID();
|
|
15
|
+
name;
|
|
16
|
+
createdAt = new Date();
|
|
17
|
+
updatedAt = new Date();
|
|
18
|
+
deletedAt = null;
|
|
19
|
+
};
|
|
20
|
+
__decorate([
|
|
21
|
+
PrimaryKey({ type: t.uuid }),
|
|
22
|
+
__metadata("design:type", Object)
|
|
23
|
+
], BaseWorkspace.prototype, "id", void 0);
|
|
24
|
+
__decorate([
|
|
25
|
+
Property({ type: t.text }),
|
|
26
|
+
__metadata("design:type", String)
|
|
27
|
+
], BaseWorkspace.prototype, "name", void 0);
|
|
28
|
+
__decorate([
|
|
29
|
+
Property({ type: t.datetime, defaultRaw: "now()" }),
|
|
30
|
+
__metadata("design:type", Object)
|
|
31
|
+
], BaseWorkspace.prototype, "createdAt", void 0);
|
|
32
|
+
__decorate([
|
|
33
|
+
Property({
|
|
34
|
+
type: t.datetime,
|
|
35
|
+
defaultRaw: "now()",
|
|
36
|
+
onUpdate: () => new Date(),
|
|
37
|
+
}),
|
|
38
|
+
__metadata("design:type", Object)
|
|
39
|
+
], BaseWorkspace.prototype, "updatedAt", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
Property({ type: t.datetime, nullable: true }),
|
|
42
|
+
__metadata("design:type", Object)
|
|
43
|
+
], BaseWorkspace.prototype, "deletedAt", void 0);
|
|
44
|
+
BaseWorkspace = __decorate([
|
|
45
|
+
Entity({ abstract: true })
|
|
46
|
+
], BaseWorkspace);
|
|
47
|
+
export { BaseWorkspace };
|
|
48
|
+
//# sourceMappingURL=workspace.entity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.entity.js","sourceRoot":"","sources":["../../src/entities/workspace.entity.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAY,CAAC,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAUrE,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,UAAU;IAG3C,EAAE,GAAgB,UAAU,EAAE,CAAC;IAI/B,IAAI,CAAU;IAId,SAAS,GAAc,IAAI,IAAI,EAAE,CAAC;IAQlC,SAAS,GAAc,IAAI,IAAI,EAAE,CAAC;IAIlC,SAAS,GAAsB,IAAI,CAAC;CACrC,CAAA;AArBC;IADC,UAAU,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;;yCACE;AAI/B;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;;2CACb;AAId;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;;gDAClB;AAQlC;IALC,QAAQ,CAAC;QACR,IAAI,EAAE,CAAC,CAAC,QAAQ;QAChB,UAAU,EAAE,OAAO;QACnB,QAAQ,EAAE,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE;KAC3B,CAAC;;gDACgC;AAIlC;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;gDACX;AAvBzB,aAAa;IADzB,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;GACd,aAAa,CAwBzB"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,39 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./abilities/index.js";
|
|
2
|
+
export * from "./access-control.service.js";
|
|
3
|
+
export * from "./api-key.service.js";
|
|
4
|
+
export * from "./api-key-usage.interceptor.js";
|
|
5
|
+
export { IS_PUBLIC_KEY } from "./auth.constants.js";
|
|
2
6
|
export * from "./auth.guard.js";
|
|
3
7
|
export * from "./auth.middleware.js";
|
|
4
8
|
export * from "./auth.module.js";
|
|
5
9
|
export * from "./auth.service.js";
|
|
6
|
-
export * from "./auth.transaction-context.js";
|
|
7
10
|
export * from "./auth-module-options.interface.js";
|
|
8
11
|
export * from "./decorators/index.js";
|
|
9
12
|
export * from "./entities/index.js";
|
|
13
|
+
export * from "./interfaces/auth-role.interface.js";
|
|
14
|
+
export * from "./interfaces/auth-service.interface.js";
|
|
15
|
+
export * from "./interfaces/can-options.interface.js";
|
|
16
|
+
export * from "./interfaces/route-argument-metadata-value.interface.js";
|
|
17
|
+
export * from "./interfaces/serialized-ability-rule.interface.js";
|
|
18
|
+
export * from "./interfaces/session-service.interface.js";
|
|
19
|
+
export * from "./interfaces/user-service.interface.js";
|
|
20
|
+
export * from "./interfaces/workspace-service.interface.js";
|
|
21
|
+
export * from "./permission.constants.js";
|
|
22
|
+
export * from "./session.service.js";
|
|
23
|
+
export * from "./types/auth-module-roles.type.js";
|
|
24
|
+
export * from "./types/build-user-ability-callback.type.js";
|
|
25
|
+
export * from "./types/build-workspace-ability-callback.type.js";
|
|
26
|
+
export * from "./types/can-subject.type.js";
|
|
27
|
+
export * from "./types/can-subject-factory.type.js";
|
|
28
|
+
export * from "./types/route-argument-metadata.type.js";
|
|
29
|
+
export * from "./user.constants.js";
|
|
30
|
+
export * from "./user.service.js";
|
|
31
|
+
export * from "./utils/can.util.js";
|
|
32
|
+
export * from "./utils/extract-api-key.util.js";
|
|
33
|
+
export * from "./utils/get-user-ability.util.js";
|
|
34
|
+
export * from "./utils/get-workspace-ability.util.js";
|
|
35
|
+
export * from "./utils/serialize-ability-rules.util.js";
|
|
36
|
+
export * from "./utils/user-can.util.js";
|
|
37
|
+
export * from "./utils/workspace-can.util.js";
|
|
38
|
+
export * from "./workspace.constants.js";
|
|
39
|
+
export * from "./workspace.service.js";
|
package/dist/index.js
CHANGED
|
@@ -1,10 +1,40 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./abilities/index.js";
|
|
2
|
+
export * from "./access-control.service.js";
|
|
3
|
+
export * from "./api-key.service.js";
|
|
4
|
+
export * from "./api-key-usage.interceptor.js";
|
|
5
|
+
export { IS_PUBLIC_KEY } from "./auth.constants.js";
|
|
2
6
|
export * from "./auth.guard.js";
|
|
3
7
|
export * from "./auth.middleware.js";
|
|
4
8
|
export * from "./auth.module.js";
|
|
5
9
|
export * from "./auth.service.js";
|
|
6
|
-
export * from "./auth.transaction-context.js";
|
|
7
10
|
export * from "./auth-module-options.interface.js";
|
|
8
11
|
export * from "./decorators/index.js";
|
|
9
12
|
export * from "./entities/index.js";
|
|
13
|
+
export * from "./interfaces/auth-role.interface.js";
|
|
14
|
+
export * from "./interfaces/auth-service.interface.js";
|
|
15
|
+
export * from "./interfaces/can-options.interface.js";
|
|
16
|
+
export * from "./interfaces/route-argument-metadata-value.interface.js";
|
|
17
|
+
export * from "./interfaces/serialized-ability-rule.interface.js";
|
|
18
|
+
export * from "./interfaces/session-service.interface.js";
|
|
19
|
+
export * from "./interfaces/user-service.interface.js";
|
|
20
|
+
export * from "./interfaces/workspace-service.interface.js";
|
|
21
|
+
export * from "./permission.constants.js";
|
|
22
|
+
export * from "./session.service.js";
|
|
23
|
+
export * from "./types/auth-module-roles.type.js";
|
|
24
|
+
export * from "./types/build-user-ability-callback.type.js";
|
|
25
|
+
export * from "./types/build-workspace-ability-callback.type.js";
|
|
26
|
+
export * from "./types/can-subject.type.js";
|
|
27
|
+
export * from "./types/can-subject-factory.type.js";
|
|
28
|
+
export * from "./types/route-argument-metadata.type.js";
|
|
29
|
+
export * from "./user.constants.js";
|
|
30
|
+
export * from "./user.service.js";
|
|
31
|
+
export * from "./utils/can.util.js";
|
|
32
|
+
export * from "./utils/extract-api-key.util.js";
|
|
33
|
+
export * from "./utils/get-user-ability.util.js";
|
|
34
|
+
export * from "./utils/get-workspace-ability.util.js";
|
|
35
|
+
export * from "./utils/serialize-ability-rules.util.js";
|
|
36
|
+
export * from "./utils/user-can.util.js";
|
|
37
|
+
export * from "./utils/workspace-can.util.js";
|
|
38
|
+
export * from "./workspace.constants.js";
|
|
39
|
+
export * from "./workspace.service.js";
|
|
10
40
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sBAAsB,CAAC;AACrC,cAAc,gCAAgC,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,oCAAoC,CAAC;AACnD,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qCAAqC,CAAC;AACpD,cAAc,wCAAwC,CAAC;AACvD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yDAAyD,CAAC;AACxE,cAAc,mDAAmD,CAAC;AAClE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,wCAAwC,CAAC;AACvD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,2BAA2B,CAAC;AAC1C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mCAAmC,CAAC;AAClD,cAAc,6CAA6C,CAAC;AAC5D,cAAc,kDAAkD,CAAC;AACjE,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qCAAqC,CAAC;AACpD,cAAc,yCAAyC,CAAC;AACxD,cAAc,qBAAqB,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iCAAiC,CAAC;AAChD,cAAc,kCAAkC,CAAC;AACjD,cAAc,uCAAuC,CAAC;AACtD,cAAc,yCAAyC,CAAC;AACxD,cAAc,0BAA0B,CAAC;AACzC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth-role.interface.js","sourceRoot":"","sources":["../../src/interfaces/auth-role.interface.ts"],"names":[],"mappings":""}
|