@holoyan/adonisjs-permissions 1.0.1 → 1.0.2

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 CHANGED
@@ -132,8 +132,8 @@ export default class Post extends BaseModel implements AclModelInterface {
132
132
 
133
133
  ## Release Notes
134
134
 
135
- Version: >= 'v0.8.18'
136
- * Fix: Overwriting global scope
135
+ Version: >= v1.0.2
136
+ * Update: Mixin getModelId method return type
137
137
 
138
138
  ## Mixins
139
139
 
@@ -1,8 +1,8 @@
1
1
  import type { NormalizeConstructor } from '@adonisjs/core/types/helpers';
2
- import { AclModel } from '../types.js';
2
+ import { AclModel, ModelIdType } from '../types.js';
3
3
  export declare function hasPermissions(): <Model extends NormalizeConstructor<import("@adonisjs/lucid/types/model").LucidModel>>(superclass: Model) => {
4
4
  new (...args: any[]): {
5
- getModelId(): string;
5
+ getModelId(): ModelIdType;
6
6
  roles(): import("@adonisjs/lucid/types/model").ModelQueryBuilderContract<import("@adonisjs/lucid/types/model").LucidModel, import("../types.js").RoleModel<import("@adonisjs/lucid/types/model").LucidModel>>;
7
7
  hasRole(role: string): Promise<boolean>;
8
8
  hasAllRoles(...roles: string[]): Promise<boolean>;
@@ -10,6 +10,6 @@ export default class ModelManager {
10
10
  if (key in this.models) {
11
11
  return this.models[key];
12
12
  }
13
- throw new Error('Model not defined');
13
+ throw new Error('Model not defined for key: ' + key);
14
14
  }
15
15
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@holoyan/adonisjs-permissions",
3
3
  "description": "Adonisjs roles and permissions system",
4
- "version": "1.0.1",
4
+ "version": "1.0.2",
5
5
  "engines": {
6
6
  "node": ">=18.16.0"
7
7
  },