@codeleap/permissions 5.0.11 → 5.0.12
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/package.json +7 -6
- package/package.json.bak +2 -1
- package/src/Permission.ts +2 -1
- package/src/PermissionsManager.ts +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeleap/permissions",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.12",
|
|
4
4
|
"main": "src/index.ts",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -9,17 +9,18 @@
|
|
|
9
9
|
"directory": "packages/permissions"
|
|
10
10
|
},
|
|
11
11
|
"devDependencies": {
|
|
12
|
-
"@codeleap/config": "5.0.
|
|
13
|
-
"@codeleap/store": "5.0.
|
|
14
|
-
"@codeleap/types": "5.0.
|
|
12
|
+
"@codeleap/config": "5.0.12",
|
|
13
|
+
"@codeleap/store": "5.0.12",
|
|
14
|
+
"@codeleap/types": "5.0.12",
|
|
15
15
|
"ts-node-dev": "1.1.8"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
18
|
"build": "echo 'No build needed'"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@codeleap/store": "5.0.
|
|
22
|
-
"@codeleap/types": "5.0.
|
|
21
|
+
"@codeleap/store": "5.0.12",
|
|
22
|
+
"@codeleap/types": "5.0.12",
|
|
23
|
+
"@codeleap/logger": "5.0.12",
|
|
23
24
|
"typescript": "5.5.2"
|
|
24
25
|
}
|
|
25
26
|
}
|
package/package.json.bak
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeleap/permissions",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.12",
|
|
4
4
|
"main": "src/index.ts",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"repository": {
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"@codeleap/store": "workspace:*",
|
|
22
22
|
"@codeleap/types": "workspace:*",
|
|
23
|
+
"@codeleap/logger": "workspace:*",
|
|
23
24
|
"typescript": "5.5.2"
|
|
24
25
|
}
|
|
25
26
|
}
|
package/src/Permission.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { GlobalState, globalState } from '@codeleap/store'
|
|
|
2
2
|
import { PermissionOptions } from './types'
|
|
3
3
|
import { PermissionConfig, PermissionStatus } from './globals'
|
|
4
4
|
import { TypeGuards } from '@codeleap/types'
|
|
5
|
+
import { logger } from '@codeleap/logger'
|
|
5
6
|
|
|
6
7
|
export class Permission {
|
|
7
8
|
/** The name of the permission. */
|
|
@@ -65,7 +66,7 @@ export class Permission {
|
|
|
65
66
|
|
|
66
67
|
private log(msg: string, obj?: any) {
|
|
67
68
|
if (!Permission.logsEnabled) return
|
|
68
|
-
|
|
69
|
+
logger.log(`(Permission) ${this.name} -> ${msg}`, obj)
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
/**
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Permission } from './Permission'
|
|
2
2
|
import { PermissionOptions } from './types'
|
|
3
3
|
import { PermissionStatus, PermissionConfig } from './globals'
|
|
4
|
+
import { logger } from '@codeleap/logger'
|
|
4
5
|
|
|
5
6
|
export class PermissionsManager<P extends string> {
|
|
6
7
|
private requester: (permission: Permission) => Promise<PermissionStatus>
|
|
@@ -52,9 +53,9 @@ export class PermissionsManager<P extends string> {
|
|
|
52
53
|
this.checkAll()
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
private log(msg: string,
|
|
56
|
+
private log(msg: string, ...args: unknown[]) {
|
|
56
57
|
if (!Permission.logsEnabled) return
|
|
57
|
-
|
|
58
|
+
logger.log(`(Permissions) -> ${msg}`, ...(args ?? ''))
|
|
58
59
|
}
|
|
59
60
|
|
|
60
61
|
/**
|