@dudousxd/nestjs-authz-mikro-orm 0.3.1 → 0.4.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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @dudousxd/nestjs-authz-mikro-orm
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`45719bb`](https://github.com/DavideCarvalho/nestjs-authz/commit/45719bb958d7abceb8b0edad4c0c3d97f99590cb) - Support MikroORM 7 (peer `@mikro-orm/core` / `@mikro-orm/nestjs` widened to `^6 || ^7`).
8
+
9
+ MikroORM 7 relocated the entity decorators (`@Entity/@Property/@PrimaryKey/@Index`) out of `@mikro-orm/core` into a separate `@mikro-orm/decorators` package, and removed `MikroORM.getSchemaGenerator()`. To run on both v6 and v7 from a single codebase with no extra peer:
10
+
11
+ - The four authz entities are now defined with `EntitySchema` (the one definition style that lives in `@mikro-orm/core` on both majors) instead of decorators. The entity classes (`RoleEntity` … `UserRoleEntity`) are unchanged as the store's reference; their schemas are also exported (`RoleEntitySchema` … `UserRoleEntitySchema`) for BYO-table-name re-declaration.
12
+ - `ensureAuthzSchema` / `authzSchemaSql` now detect a `MikroORM` instance via its `em` property (present on both v6 and v7) instead of the v7-removed `getSchemaGenerator()`, and read the schema generator off the EM-bound platform.
13
+
14
+ Verified end-to-end against `@mikro-orm/core@7` + `@mikro-orm/sqlite@7` (and the existing v6 suite still passes).
15
+
3
16
  ## 0.3.1
4
17
 
5
18
  ### Patch Changes
package/README.md CHANGED
@@ -7,6 +7,11 @@ roles, permissions, and a Gate seam, with **zero connection ownership** (your ap
7
7
  This is the MikroORM sibling of `@dudousxd/nestjs-authz-typeorm`: identical store surface
8
8
  and `AuthzRbacModule`, backed by MikroORM entities.
9
9
 
10
+ Works with **MikroORM 6 and 7** (peer `@mikro-orm/core` `^6 || ^7`). The entities are
11
+ defined with `EntitySchema` — the one definition style that lives entirely in
12
+ `@mikro-orm/core` across both majors (v7 moved the `@Entity/@Property/...` decorators into a
13
+ separate `@mikro-orm/decorators` package), so no extra peer is required.
14
+
10
15
  ## Install
11
16
 
12
17
  ```bash
@@ -32,9 +37,9 @@ await MikroORM.init({ entities: [...AUTHZ_ENTITIES /* , your entities */] });
32
37
  ```
33
38
 
34
39
  > BYO table names: MikroORM resolves table names from entity metadata at discovery time,
35
- > so override them by re-decorating these entities with your own `@Entity({ tableName })`;
36
- > the store + schema helpers operate purely through the `EntityManager` and never assume a
37
- > literal name.
40
+ > so override them by re-declaring these entities with your own `EntitySchema({ tableName })`
41
+ > (the `RoleEntitySchema` … `UserRoleEntitySchema` exports are the defaults); the store +
42
+ > schema helpers operate purely through the `EntityManager` and never assume a literal name.
38
43
 
39
44
  ## Usage
40
45
 
@@ -1,8 +1,9 @@
1
+ import { EntitySchema } from '@mikro-orm/core';
1
2
  /**
2
- * Default table names — the entities below carry these as their `tableName`. MikroORM
3
- * resolves the physical table from the entity metadata (not at runtime), so an app that
4
- * wants different names re-decorates these entities; the store + schema helpers operate
5
- * purely through the EntityManager and never assume a literal name.
3
+ * Default table names — the {@link EntitySchema} definitions below carry these as their
4
+ * `tableName`. MikroORM resolves the physical table from the entity metadata (not at
5
+ * runtime), so an app that wants different names re-declares these schemas; the store +
6
+ * schema helpers operate purely through the EntityManager and never assume a literal name.
6
7
  */
7
8
  export declare const DEFAULT_TABLE_NAMES: {
8
9
  readonly roles: "authz_roles";
@@ -11,24 +12,34 @@ export declare const DEFAULT_TABLE_NAMES: {
11
12
  readonly userRole: "authz_user_role";
12
13
  };
13
14
  /**
14
- * A named role (e.g. `editor`). Permissions are attached via {@link RolePermissionEntity};
15
- * users are attached via {@link UserRoleEntity}.
15
+ * The entities are described with {@link EntitySchema} (the schema-first definition style)
16
+ * rather than property decorators. This is the ONE definition surface that lives entirely
17
+ * in `@mikro-orm/core` and is identical across MikroORM 6 and 7 — v7 relocated the
18
+ * `@Entity/@Property/...` decorators to a separate `@mikro-orm/decorators` package, so a
19
+ * decorator-based definition would force an extra peer and break on v6. The plain classes
20
+ * below stay the public reference the store keys on (`em.find(RoleEntity, ...)`,
21
+ * `meta.get(RoleEntity.name)`); the schemas attach metadata to them.
16
22
  *
17
- * Every column declares an explicit `type` instead of relying on `emitDecoratorMetadata`
18
- * reflection, so the entity discovers correctly even when the consuming app compiles with
19
- * SWC/esbuild/Vite (which don't emit decorator metadata).
23
+ * Every column declares an explicit `type`, so discovery works even when the consuming app
24
+ * compiles with SWC/esbuild/Vite (which don't emit decorator metadata — irrelevant here
25
+ * since we don't rely on reflection, but kept explicit for clarity and parity).
20
26
  *
21
27
  * Forward-compat rule: any column added to these entities AFTER v1 MUST be nullable or
22
28
  * carry a default — `ensureAuthzSchema` only ever runs the non-destructive `safe` diff
23
29
  * (create table + add-missing-column), and `ADD COLUMN NOT NULL` without a default fails
24
30
  * on a populated table.
25
31
  */
32
+ /**
33
+ * A named role (e.g. `editor`). Permissions are attached via {@link RolePermissionEntity};
34
+ * users are attached via {@link UserRoleEntity}.
35
+ */
26
36
  export declare class RoleEntity {
27
37
  id: string;
28
38
  name: string;
29
39
  guard?: string | null;
30
40
  createdAt: Date;
31
41
  }
42
+ export declare const RoleEntitySchema: EntitySchema<RoleEntity, never>;
32
43
  /** A named permission (e.g. `posts.publish`). Granted to roles via {@link RolePermissionEntity}. */
33
44
  export declare class PermissionEntity {
34
45
  id: string;
@@ -36,11 +47,13 @@ export declare class PermissionEntity {
36
47
  guard?: string | null;
37
48
  createdAt: Date;
38
49
  }
50
+ export declare const PermissionEntitySchema: EntitySchema<PermissionEntity, never>;
39
51
  /** Pivot: role ↔ permission. Composite PK `(roleId, permissionId)`. */
40
52
  export declare class RolePermissionEntity {
41
53
  roleId: string;
42
54
  permissionId: string;
43
55
  }
56
+ export declare const RolePermissionEntitySchema: EntitySchema<RolePermissionEntity, never>;
44
57
  /**
45
58
  * Pivot: user ↔ role. References the user BY ID ONLY — this package NEVER defines or
46
59
  * owns a users table. `userType` lets the same table key polymorphic principals
@@ -51,6 +64,11 @@ export declare class UserRoleEntity {
51
64
  userId: string;
52
65
  roleId: string;
53
66
  }
54
- /** All entities, in dependency order — convenient for `entities: [...]` registration. */
55
- export declare const AUTHZ_ENTITIES: readonly [typeof RoleEntity, typeof PermissionEntity, typeof RolePermissionEntity, typeof UserRoleEntity];
67
+ export declare const UserRoleEntitySchema: EntitySchema<UserRoleEntity, never>;
68
+ /**
69
+ * All entity SCHEMAS, in dependency order — pass to `entities: [...]` registration. These
70
+ * are the {@link EntitySchema} objects MikroORM discovers; the store keys on the plain
71
+ * classes ({@link RoleEntity} etc.), which the schemas are bound to via `class`.
72
+ */
73
+ export declare const AUTHZ_ENTITIES: readonly [EntitySchema<RoleEntity, never>, EntitySchema<PermissionEntity, never>, EntitySchema<RolePermissionEntity, never>, EntitySchema<UserRoleEntity, never>];
56
74
  //# sourceMappingURL=entities.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../src/entities.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;;CAKtB,CAAC;AAEX;;;;;;;;;;;;GAYG;AACH,qBACa,UAAU;IAErB,EAAE,EAAG,MAAM,CAAC;IAIZ,IAAI,EAAG,MAAM,CAAC;IAGd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGtB,SAAS,EAAG,IAAI,CAAC;CAClB;AAED,oGAAoG;AACpG,qBACa,gBAAgB;IAE3B,EAAE,EAAG,MAAM,CAAC;IAIZ,IAAI,EAAG,MAAM,CAAC;IAGd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAGtB,SAAS,EAAG,IAAI,CAAC;CAClB;AAED,uEAAuE;AACvE,qBACa,oBAAoB;IAE/B,MAAM,EAAG,MAAM,CAAC;IAGhB,YAAY,EAAG,MAAM,CAAC;CACvB;AAED;;;;GAIG;AACH,qBAEa,cAAc;IAEzB,QAAQ,EAAG,MAAM,CAAC;IAGlB,MAAM,EAAG,MAAM,CAAC;IAGhB,MAAM,EAAG,MAAM,CAAC;CACjB;AAED,yFAAyF;AACzF,eAAO,MAAM,cAAc,2GAKjB,CAAC"}
1
+ {"version":3,"file":"entities.d.ts","sourceRoot":"","sources":["../src/entities.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB;;;;;CAKtB,CAAC;AAEX;;;;;;;;;;;;;;;;;GAiBG;AAEH;;;GAGG;AACH,qBAAa,UAAU;IACrB,EAAE,EAAG,MAAM,CAAC;IACZ,IAAI,EAAG,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAG,IAAI,CAAC;CAClB;AAED,eAAO,MAAM,gBAAgB,iCAc3B,CAAC;AAEH,oGAAoG;AACpG,qBAAa,gBAAgB;IAC3B,EAAE,EAAG,MAAM,CAAC;IACZ,IAAI,EAAG,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,SAAS,EAAG,IAAI,CAAC;CAClB;AAED,eAAO,MAAM,sBAAsB,uCAcjC,CAAC;AAEH,uEAAuE;AACvE,qBAAa,oBAAoB;IAC/B,MAAM,EAAG,MAAM,CAAC;IAChB,YAAY,EAAG,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,0BAA0B,2CAOrC,CAAC;AAEH;;;;GAIG;AACH,qBAAa,cAAc;IACzB,QAAQ,EAAG,MAAM,CAAC;IAClB,MAAM,EAAG,MAAM,CAAC;IAChB,MAAM,EAAG,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,oBAAoB,qCAS/B,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,cAAc,mKAKjB,CAAC"}
package/dist/entities.js CHANGED
@@ -1,18 +1,9 @@
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 { Entity, Index, PrimaryKey, Property } from '@mikro-orm/core';
1
+ import { EntitySchema } from '@mikro-orm/core';
11
2
  /**
12
- * Default table names — the entities below carry these as their `tableName`. MikroORM
13
- * resolves the physical table from the entity metadata (not at runtime), so an app that
14
- * wants different names re-decorates these entities; the store + schema helpers operate
15
- * purely through the EntityManager and never assume a literal name.
3
+ * Default table names — the {@link EntitySchema} definitions below carry these as their
4
+ * `tableName`. MikroORM resolves the physical table from the entity metadata (not at
5
+ * runtime), so an app that wants different names re-declares these schemas; the store +
6
+ * schema helpers operate purely through the EntityManager and never assume a literal name.
16
7
  */
17
8
  export const DEFAULT_TABLE_NAMES = {
18
9
  roles: 'authz_roles',
@@ -21,122 +12,112 @@ export const DEFAULT_TABLE_NAMES = {
21
12
  userRole: 'authz_user_role',
22
13
  };
23
14
  /**
24
- * A named role (e.g. `editor`). Permissions are attached via {@link RolePermissionEntity};
25
- * users are attached via {@link UserRoleEntity}.
15
+ * The entities are described with {@link EntitySchema} (the schema-first definition style)
16
+ * rather than property decorators. This is the ONE definition surface that lives entirely
17
+ * in `@mikro-orm/core` and is identical across MikroORM 6 and 7 — v7 relocated the
18
+ * `@Entity/@Property/...` decorators to a separate `@mikro-orm/decorators` package, so a
19
+ * decorator-based definition would force an extra peer and break on v6. The plain classes
20
+ * below stay the public reference the store keys on (`em.find(RoleEntity, ...)`,
21
+ * `meta.get(RoleEntity.name)`); the schemas attach metadata to them.
26
22
  *
27
- * Every column declares an explicit `type` instead of relying on `emitDecoratorMetadata`
28
- * reflection, so the entity discovers correctly even when the consuming app compiles with
29
- * SWC/esbuild/Vite (which don't emit decorator metadata).
23
+ * Every column declares an explicit `type`, so discovery works even when the consuming app
24
+ * compiles with SWC/esbuild/Vite (which don't emit decorator metadata — irrelevant here
25
+ * since we don't rely on reflection, but kept explicit for clarity and parity).
30
26
  *
31
27
  * Forward-compat rule: any column added to these entities AFTER v1 MUST be nullable or
32
28
  * carry a default — `ensureAuthzSchema` only ever runs the non-destructive `safe` diff
33
29
  * (create table + add-missing-column), and `ADD COLUMN NOT NULL` without a default fails
34
30
  * on a populated table.
35
31
  */
36
- let RoleEntity = class RoleEntity {
32
+ /**
33
+ * A named role (e.g. `editor`). Permissions are attached via {@link RolePermissionEntity};
34
+ * users are attached via {@link UserRoleEntity}.
35
+ */
36
+ export class RoleEntity {
37
37
  id;
38
38
  name;
39
39
  guard;
40
40
  createdAt;
41
- };
42
- __decorate([
43
- PrimaryKey({ type: 'string', length: 191 }),
44
- __metadata("design:type", String)
45
- ], RoleEntity.prototype, "id", void 0);
46
- __decorate([
47
- Index({ name: 'authz_roles_name_uniq' }),
48
- Property({ type: 'string', length: 191, unique: true }),
49
- __metadata("design:type", String)
50
- ], RoleEntity.prototype, "name", void 0);
51
- __decorate([
52
- Property({ type: 'string', nullable: true }),
53
- __metadata("design:type", Object)
54
- ], RoleEntity.prototype, "guard", void 0);
55
- __decorate([
56
- Property({ type: 'datetime' }),
57
- __metadata("design:type", Date)
58
- ], RoleEntity.prototype, "createdAt", void 0);
59
- RoleEntity = __decorate([
60
- Entity({ tableName: DEFAULT_TABLE_NAMES.roles })
61
- ], RoleEntity);
62
- export { RoleEntity };
41
+ }
42
+ export const RoleEntitySchema = new EntitySchema({
43
+ class: RoleEntity,
44
+ tableName: DEFAULT_TABLE_NAMES.roles,
45
+ properties: {
46
+ id: { type: 'string', length: 191, primary: true },
47
+ name: {
48
+ type: 'string',
49
+ length: 191,
50
+ unique: true,
51
+ index: 'authz_roles_name_uniq',
52
+ },
53
+ guard: { type: 'string', nullable: true },
54
+ createdAt: { type: 'datetime' },
55
+ },
56
+ });
63
57
  /** A named permission (e.g. `posts.publish`). Granted to roles via {@link RolePermissionEntity}. */
64
- let PermissionEntity = class PermissionEntity {
58
+ export class PermissionEntity {
65
59
  id;
66
60
  name;
67
61
  guard;
68
62
  createdAt;
69
- };
70
- __decorate([
71
- PrimaryKey({ type: 'string', length: 191 }),
72
- __metadata("design:type", String)
73
- ], PermissionEntity.prototype, "id", void 0);
74
- __decorate([
75
- Index({ name: 'authz_permissions_name_uniq' }),
76
- Property({ type: 'string', length: 191, unique: true }),
77
- __metadata("design:type", String)
78
- ], PermissionEntity.prototype, "name", void 0);
79
- __decorate([
80
- Property({ type: 'string', nullable: true }),
81
- __metadata("design:type", Object)
82
- ], PermissionEntity.prototype, "guard", void 0);
83
- __decorate([
84
- Property({ type: 'datetime' }),
85
- __metadata("design:type", Date)
86
- ], PermissionEntity.prototype, "createdAt", void 0);
87
- PermissionEntity = __decorate([
88
- Entity({ tableName: DEFAULT_TABLE_NAMES.permissions })
89
- ], PermissionEntity);
90
- export { PermissionEntity };
63
+ }
64
+ export const PermissionEntitySchema = new EntitySchema({
65
+ class: PermissionEntity,
66
+ tableName: DEFAULT_TABLE_NAMES.permissions,
67
+ properties: {
68
+ id: { type: 'string', length: 191, primary: true },
69
+ name: {
70
+ type: 'string',
71
+ length: 191,
72
+ unique: true,
73
+ index: 'authz_permissions_name_uniq',
74
+ },
75
+ guard: { type: 'string', nullable: true },
76
+ createdAt: { type: 'datetime' },
77
+ },
78
+ });
91
79
  /** Pivot: role ↔ permission. Composite PK `(roleId, permissionId)`. */
92
- let RolePermissionEntity = class RolePermissionEntity {
80
+ export class RolePermissionEntity {
93
81
  roleId;
94
82
  permissionId;
95
- };
96
- __decorate([
97
- PrimaryKey({ type: 'string', length: 191 }),
98
- __metadata("design:type", String)
99
- ], RolePermissionEntity.prototype, "roleId", void 0);
100
- __decorate([
101
- PrimaryKey({ type: 'string', length: 191 }),
102
- __metadata("design:type", String)
103
- ], RolePermissionEntity.prototype, "permissionId", void 0);
104
- RolePermissionEntity = __decorate([
105
- Entity({ tableName: DEFAULT_TABLE_NAMES.rolePermission })
106
- ], RolePermissionEntity);
107
- export { RolePermissionEntity };
83
+ }
84
+ export const RolePermissionEntitySchema = new EntitySchema({
85
+ class: RolePermissionEntity,
86
+ tableName: DEFAULT_TABLE_NAMES.rolePermission,
87
+ properties: {
88
+ roleId: { type: 'string', length: 191, primary: true },
89
+ permissionId: { type: 'string', length: 191, primary: true },
90
+ },
91
+ });
108
92
  /**
109
93
  * Pivot: user ↔ role. References the user BY ID ONLY — this package NEVER defines or
110
94
  * owns a users table. `userType` lets the same table key polymorphic principals
111
95
  * (mirrors nestjs-context's `UserRef` shape).
112
96
  */
113
- let UserRoleEntity = class UserRoleEntity {
97
+ export class UserRoleEntity {
114
98
  userType;
115
99
  userId;
116
100
  roleId;
117
- };
118
- __decorate([
119
- PrimaryKey({ type: 'string', length: 191 }),
120
- __metadata("design:type", String)
121
- ], UserRoleEntity.prototype, "userType", void 0);
122
- __decorate([
123
- PrimaryKey({ type: 'string', length: 191 }),
124
- __metadata("design:type", String)
125
- ], UserRoleEntity.prototype, "userId", void 0);
126
- __decorate([
127
- PrimaryKey({ type: 'string', length: 191 }),
128
- __metadata("design:type", String)
129
- ], UserRoleEntity.prototype, "roleId", void 0);
130
- UserRoleEntity = __decorate([
131
- Entity({ tableName: DEFAULT_TABLE_NAMES.userRole }),
132
- Index({ name: 'authz_user_role_user_idx', properties: ['userType', 'userId'] })
133
- ], UserRoleEntity);
134
- export { UserRoleEntity };
135
- /** All entities, in dependency order — convenient for `entities: [...]` registration. */
101
+ }
102
+ export const UserRoleEntitySchema = new EntitySchema({
103
+ class: UserRoleEntity,
104
+ tableName: DEFAULT_TABLE_NAMES.userRole,
105
+ properties: {
106
+ userType: { type: 'string', length: 191, primary: true },
107
+ userId: { type: 'string', length: 191, primary: true },
108
+ roleId: { type: 'string', length: 191, primary: true },
109
+ },
110
+ indexes: [{ name: 'authz_user_role_user_idx', properties: ['userType', 'userId'] }],
111
+ });
112
+ /**
113
+ * All entity SCHEMAS, in dependency order — pass to `entities: [...]` registration. These
114
+ * are the {@link EntitySchema} objects MikroORM discovers; the store keys on the plain
115
+ * classes ({@link RoleEntity} etc.), which the schemas are bound to via `class`.
116
+ */
136
117
  export const AUTHZ_ENTITIES = [
137
- RoleEntity,
138
- PermissionEntity,
139
- RolePermissionEntity,
140
- UserRoleEntity,
118
+ RoleEntitySchema,
119
+ PermissionEntitySchema,
120
+ RolePermissionEntitySchema,
121
+ UserRoleEntitySchema,
141
122
  ];
142
123
  //# sourceMappingURL=entities.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"entities.js","sourceRoot":"","sources":["../src/entities.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAEtE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,KAAK,EAAE,aAAa;IACpB,WAAW,EAAE,mBAAmB;IAChC,cAAc,EAAE,uBAAuB;IACvC,QAAQ,EAAE,iBAAiB;CACnB,CAAC;AAEX;;;;;;;;;;;;GAYG;AAEI,IAAM,UAAU,GAAhB,MAAM,UAAU;IAErB,EAAE,CAAU;IAIZ,IAAI,CAAU;IAGd,KAAK,CAAiB;IAGtB,SAAS,CAAQ;CAClB,CAAA;AAXC;IADC,UAAU,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC;;sCAChC;AAIZ;IAFC,KAAK,CAAC,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC;IACxC,QAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,GAA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1B,oBAAoB;CACZ,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { AUTHZ_ENTITIES, DEFAULT_TABLE_NAMES, PermissionEntity, RoleEntity, RolePermissionEntity, UserRoleEntity, } from './entities.js';
1
+ export { AUTHZ_ENTITIES, DEFAULT_TABLE_NAMES, PermissionEntity, PermissionEntitySchema, RoleEntity, RoleEntitySchema, RolePermissionEntity, RolePermissionEntitySchema, UserRoleEntity, UserRoleEntitySchema, } from './entities.js';
2
2
  export { authzSchemaSql, ensureAuthzSchema } from './schema.js';
3
3
  export { MikroOrmAuthzStore } from './mikro-orm-authz.store.js';
4
4
  export type { UserAuthz } from './mikro-orm-authz.store.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,EACV,oBAAoB,EACpB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,YAAY,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,2BAA2B,EAC3B,sBAAsB,EACtB,aAAa,GACd,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACtD,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,0BAA0B,EAC1B,cAAc,EACd,oBAAoB,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,YAAY,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAChC,YAAY,EACV,2BAA2B,EAC3B,sBAAsB,EACtB,aAAa,GACd,MAAM,wBAAwB,CAAC;AAChC,YAAY,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AACpD,YAAY,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAC9E,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACtD,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC"}
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { AUTHZ_ENTITIES, DEFAULT_TABLE_NAMES, PermissionEntity, RoleEntity, RolePermissionEntity, UserRoleEntity, } from './entities.js';
1
+ export { AUTHZ_ENTITIES, DEFAULT_TABLE_NAMES, PermissionEntity, PermissionEntitySchema, RoleEntity, RoleEntitySchema, RolePermissionEntity, RolePermissionEntitySchema, UserRoleEntity, UserRoleEntitySchema, } from './entities.js';
2
2
  export { authzSchemaSql, ensureAuthzSchema } from './schema.js';
3
3
  export { MikroOrmAuthzStore } from './mikro-orm-authz.store.js';
4
4
  export { AUTHZ_RBAC_OPTIONS, AUTHZ_RBAC_STORE, AuthzRbacModule, defaultUserRefMapper, } from './authz-rbac.module.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,UAAU,EACV,oBAAoB,EACpB,cAAc,GACf,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAQhC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,UAAU,EACV,gBAAgB,EAChB,oBAAoB,EACpB,0BAA0B,EAC1B,cAAc,EACd,oBAAoB,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAEhE,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,GACrB,MAAM,wBAAwB,CAAC;AAQhC,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAiC/D;;;;;;;;;;;GAWG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAGvF;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAQxF"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAwC/D;;;;;;;;;;;GAWG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,QAAQ,GAAG,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CAGvF;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,QAAQ,GAAG,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC,CAQxF"}
package/dist/schema.js CHANGED
@@ -9,8 +9,15 @@ const AUTHZ_TABLES = [
9
9
  function toEm(ormOrEm) {
10
10
  return isOrm(ormOrEm) ? ormOrEm.em : ormOrEm;
11
11
  }
12
+ /**
13
+ * A {@link MikroORM} instance exposes its {@link EntityManager} as a (non-null) `em`
14
+ * property; an EntityManager does not expose an `em`. That distinction is stable across
15
+ * MikroORM 6 and 7 — v7 removed `MikroORM.getSchemaGenerator()`, so we can no longer probe
16
+ * for it (the EM-bound generator is read via {@link generatorFor} instead).
17
+ */
12
18
  function isOrm(value) {
13
- return 'em' in value && typeof value.getSchemaGenerator === 'function';
19
+ const candidate = value;
20
+ return candidate.em != null && typeof candidate.em === 'object';
14
21
  }
15
22
  /** The platform's schema generator for a given EM (driver + EM bound). */
16
23
  function generatorFor(em) {
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAEA,sFAAsF;AACtF,MAAM,YAAY,GAAG;IACnB,aAAa;IACb,mBAAmB;IACnB,uBAAuB;IACvB,iBAAiB;CAClB,CAAC;AAEF,yEAAyE;AACzE,SAAS,IAAI,CAAC,OAAiC;I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{
2
2
  "name": "@dudousxd/nestjs-authz-mikro-orm",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "description": "MikroORM RBAC persistence for @dudousxd/nestjs-authz — roles, permissions, and a Gate seam (zero connection ownership).",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -26,8 +26,8 @@
26
26
  ],
27
27
  "peerDependencies": {
28
28
  "@dudousxd/nestjs-authz": ">=0.1.0",
29
- "@mikro-orm/core": "^6.0.0",
30
- "@mikro-orm/nestjs": "^5.0.0 || ^6.0.0",
29
+ "@mikro-orm/core": "^6.0.0 || ^7.0.0",
30
+ "@mikro-orm/nestjs": "^5.0.0 || ^6.0.0 || ^7.0.0",
31
31
  "@nestjs/common": ">=10.0.0",
32
32
  "@nestjs/core": ">=10.0.0",
33
33
  "reflect-metadata": ">=0.1.13"
@@ -49,7 +49,7 @@
49
49
  "rxjs": "^7.8.1",
50
50
  "typescript": "^5.4.0",
51
51
  "vitest": "^3.0.0",
52
- "@dudousxd/nestjs-authz": "^0.6.1"
52
+ "@dudousxd/nestjs-authz": "^0.6.3"
53
53
  },
54
54
  "engines": {
55
55
  "node": ">=20"