@hiennc24/constant 1.6.6 → 1.7.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/lib/index.d.ts +1 -0
- package/lib/index.js +3 -1
- package/lib/permission.constant.d.ts +43 -0
- package/lib/permission.constant.js +49 -0
- package/package.json +6 -1
package/lib/index.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ export type ServiceBrokerConstantType = {
|
|
|
4
4
|
[K in keyof typeof SERVICE_BROKER]: (typeof SERVICE_BROKER)[K];
|
|
5
5
|
};
|
|
6
6
|
export { default as COLLECTIONS, CollectionsConstantType, } from "./collections.constant";
|
|
7
|
+
export { default as PERMISSIONS, PermissionConstantType, } from "./permission.constant";
|
|
7
8
|
export declare const addLocalServices: (services: ServiceBrokerConstantType) => void;
|
package/lib/index.js
CHANGED
|
@@ -3,11 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.addLocalServices = exports.COLLECTIONS = void 0;
|
|
6
|
+
exports.addLocalServices = exports.PERMISSIONS = exports.COLLECTIONS = void 0;
|
|
7
7
|
const service_constant_json_1 = __importDefault(require("./service.constant.json"));
|
|
8
8
|
exports.default = service_constant_json_1.default;
|
|
9
9
|
var collections_constant_1 = require("./collections.constant");
|
|
10
10
|
Object.defineProperty(exports, "COLLECTIONS", { enumerable: true, get: function () { return __importDefault(collections_constant_1).default; } });
|
|
11
|
+
var permission_constant_1 = require("./permission.constant");
|
|
12
|
+
Object.defineProperty(exports, "PERMISSIONS", { enumerable: true, get: function () { return __importDefault(permission_constant_1).default; } });
|
|
11
13
|
const addLocalServices = (services) => {
|
|
12
14
|
Object.assign(service_constant_json_1.default, services);
|
|
13
15
|
console.log("added local services!");
|
|
@@ -17,5 +17,48 @@ declare const PERMISSIONS: {
|
|
|
17
17
|
SVC_AUTH_ROLES_UPDATE: string;
|
|
18
18
|
SVC_AUTH_ROLES_CREATE: string;
|
|
19
19
|
SVC_AUTH_ROLES_BULK_DELETE: string;
|
|
20
|
+
SYSTEM_PERMISSION_CACHE_EVICT: string;
|
|
21
|
+
ORGANIZATION_APP_FULL: string;
|
|
22
|
+
ORGANIZATION_GROUP_FULL: string;
|
|
23
|
+
ORGANIZATION_EMPLOYEES_FULL: string;
|
|
24
|
+
ORGANIZATION_EMPLOYEES_LIST: string;
|
|
25
|
+
ORGANIZATION_EMPLOYEES_READ: string;
|
|
26
|
+
ORGANIZATION_EMPLOYEES_CREATE: string;
|
|
27
|
+
ORGANIZATION_EMPLOYEES_UPDATE: string;
|
|
28
|
+
ORGANIZATION_EMPLOYEES_DELETE: string;
|
|
29
|
+
ORGANIZATION_EMPLOYEES_DOWNLOAD: string;
|
|
30
|
+
ORGANIZATION_EMPLOYEES_UPLOAD: string;
|
|
31
|
+
ORGANIZATION_EMPLOYEES_CANCEL_APPROVE: string;
|
|
32
|
+
ORGANIZATION_ORGANIZATIONAL_FULL: string;
|
|
33
|
+
ORGANIZATION_ORGANIZATIONAL_LIST: string;
|
|
34
|
+
ORGANIZATION_ORGANIZATIONAL_READ: string;
|
|
35
|
+
ORGANIZATION_ORGANIZATIONAL_CREATE: string;
|
|
36
|
+
ORGANIZATION_ORGANIZATIONAL_UPDATE: string;
|
|
37
|
+
ORGANIZATION_ORGANIZATIONAL_DELETE: string;
|
|
38
|
+
ORGANIZATION_ORGANIZATIONAL_DOWNLOAD: string;
|
|
39
|
+
ORGANIZATION_ORGANIZATIONAL_UPLOAD: string;
|
|
40
|
+
ORGANIZATION_ORGANIZATIONAL_APPROVE: string;
|
|
41
|
+
ORGANIZATION_ORGANIZATIONAL_CANCEL_APPROVE: string;
|
|
42
|
+
ORGANIZATION_ORGANIZATIONAL_UPDATE_STATUS: string;
|
|
43
|
+
ORGANIZATION_VALUE_CHAINS_FULL: string;
|
|
44
|
+
ORGANIZATION_VALUE_CHAINS_LIST: string;
|
|
45
|
+
ORGANIZATION_VALUE_CHAINS_READ: string;
|
|
46
|
+
ORGANIZATION_VALUE_CHAINS_CREATE: string;
|
|
47
|
+
ORGANIZATION_VALUE_CHAINS_UPDATE: string;
|
|
48
|
+
ORGANIZATION_VALUE_CHAINS_DELETE: string;
|
|
49
|
+
ORGANIZATION_VALUE_CHAINS_DOWNLOAD: string;
|
|
50
|
+
ORGANIZATION_VALUE_CHAINS_UPLOAD: string;
|
|
51
|
+
ORGANIZATION_VALUE_CHAINS_APPROVE: string;
|
|
52
|
+
ORGANIZATION_MISSION_FULL: string;
|
|
53
|
+
ORGANIZATION_MISSION_LIST: string;
|
|
54
|
+
ORGANIZATION_MISSION_READ: string;
|
|
55
|
+
ORGANIZATION_MISSION_CREATE: string;
|
|
56
|
+
ORGANIZATION_MISSION_UPDATE: string;
|
|
57
|
+
ORGANIZATION_MISSION_COPY: string;
|
|
58
|
+
ORGANIZATION_MISSION_DELETE: string;
|
|
59
|
+
ORGANIZATION_MISSION_DOWNLOAD: string;
|
|
60
|
+
ORGANIZATION_MISSION_UPLOAD: string;
|
|
61
|
+
ORGANIZATION_MISSION_APPROVE: string;
|
|
62
|
+
ORGANIZATION_MISSION_SETTING: string;
|
|
20
63
|
};
|
|
21
64
|
export default PERMISSIONS;
|
|
@@ -19,5 +19,54 @@ const PERMISSIONS = {
|
|
|
19
19
|
SVC_AUTH_ROLES_UPDATE: "system_management:roles:update",
|
|
20
20
|
SVC_AUTH_ROLES_CREATE: "system_management:roles:create",
|
|
21
21
|
SVC_AUTH_ROLES_BULK_DELETE: "system_management:roles:bulk_delete",
|
|
22
|
+
// 1.3 Permission Cache (gateway admin force-clear)
|
|
23
|
+
SYSTEM_PERMISSION_CACHE_EVICT: "system_management:permission_cache:evict",
|
|
24
|
+
// 2. Organization — application + group wildcards
|
|
25
|
+
ORGANIZATION_APP_FULL: "organization_service:*",
|
|
26
|
+
ORGANIZATION_GROUP_FULL: "organization_service:operational_organization:*",
|
|
27
|
+
// 2.1 Employees (actions: list, read, create, update, delete, download, upload, cancel_approve)
|
|
28
|
+
ORGANIZATION_EMPLOYEES_FULL: "organization_service:operational_organization:employees:*",
|
|
29
|
+
ORGANIZATION_EMPLOYEES_LIST: "organization_service:operational_organization:employees:list",
|
|
30
|
+
ORGANIZATION_EMPLOYEES_READ: "organization_service:operational_organization:employees:read",
|
|
31
|
+
ORGANIZATION_EMPLOYEES_CREATE: "organization_service:operational_organization:employees:create",
|
|
32
|
+
ORGANIZATION_EMPLOYEES_UPDATE: "organization_service:operational_organization:employees:update",
|
|
33
|
+
ORGANIZATION_EMPLOYEES_DELETE: "organization_service:operational_organization:employees:delete",
|
|
34
|
+
ORGANIZATION_EMPLOYEES_DOWNLOAD: "organization_service:operational_organization:employees:download",
|
|
35
|
+
ORGANIZATION_EMPLOYEES_UPLOAD: "organization_service:operational_organization:employees:upload",
|
|
36
|
+
ORGANIZATION_EMPLOYEES_CANCEL_APPROVE: "organization_service:operational_organization:employees:cancel_approve",
|
|
37
|
+
// 2.2 Organizational (actions: list, read, create, update, delete, download, upload, approve, cancel_approve, update_status)
|
|
38
|
+
ORGANIZATION_ORGANIZATIONAL_FULL: "organization_service:operational_organization:organizational:*",
|
|
39
|
+
ORGANIZATION_ORGANIZATIONAL_LIST: "organization_service:operational_organization:organizational:list",
|
|
40
|
+
ORGANIZATION_ORGANIZATIONAL_READ: "organization_service:operational_organization:organizational:read",
|
|
41
|
+
ORGANIZATION_ORGANIZATIONAL_CREATE: "organization_service:operational_organization:organizational:create",
|
|
42
|
+
ORGANIZATION_ORGANIZATIONAL_UPDATE: "organization_service:operational_organization:organizational:update",
|
|
43
|
+
ORGANIZATION_ORGANIZATIONAL_DELETE: "organization_service:operational_organization:organizational:delete",
|
|
44
|
+
ORGANIZATION_ORGANIZATIONAL_DOWNLOAD: "organization_service:operational_organization:organizational:download",
|
|
45
|
+
ORGANIZATION_ORGANIZATIONAL_UPLOAD: "organization_service:operational_organization:organizational:upload",
|
|
46
|
+
ORGANIZATION_ORGANIZATIONAL_APPROVE: "organization_service:operational_organization:organizational:approve",
|
|
47
|
+
ORGANIZATION_ORGANIZATIONAL_CANCEL_APPROVE: "organization_service:operational_organization:organizational:cancel_approve",
|
|
48
|
+
ORGANIZATION_ORGANIZATIONAL_UPDATE_STATUS: "organization_service:operational_organization:organizational:update_status",
|
|
49
|
+
// 2.3 Value Chains (actions: list, read, create, update, delete, download, upload, approve)
|
|
50
|
+
ORGANIZATION_VALUE_CHAINS_FULL: "organization_service:operational_organization:value_chains:*",
|
|
51
|
+
ORGANIZATION_VALUE_CHAINS_LIST: "organization_service:operational_organization:value_chains:list",
|
|
52
|
+
ORGANIZATION_VALUE_CHAINS_READ: "organization_service:operational_organization:value_chains:read",
|
|
53
|
+
ORGANIZATION_VALUE_CHAINS_CREATE: "organization_service:operational_organization:value_chains:create",
|
|
54
|
+
ORGANIZATION_VALUE_CHAINS_UPDATE: "organization_service:operational_organization:value_chains:update",
|
|
55
|
+
ORGANIZATION_VALUE_CHAINS_DELETE: "organization_service:operational_organization:value_chains:delete",
|
|
56
|
+
ORGANIZATION_VALUE_CHAINS_DOWNLOAD: "organization_service:operational_organization:value_chains:download",
|
|
57
|
+
ORGANIZATION_VALUE_CHAINS_UPLOAD: "organization_service:operational_organization:value_chains:upload",
|
|
58
|
+
ORGANIZATION_VALUE_CHAINS_APPROVE: "organization_service:operational_organization:value_chains:approve",
|
|
59
|
+
// 2.4 Mission (actions: list, read, create, update, copy, delete, download, upload, approve, setting)
|
|
60
|
+
ORGANIZATION_MISSION_FULL: "organization_service:operational_organization:mission:*",
|
|
61
|
+
ORGANIZATION_MISSION_LIST: "organization_service:operational_organization:mission:list",
|
|
62
|
+
ORGANIZATION_MISSION_READ: "organization_service:operational_organization:mission:read",
|
|
63
|
+
ORGANIZATION_MISSION_CREATE: "organization_service:operational_organization:mission:create",
|
|
64
|
+
ORGANIZATION_MISSION_UPDATE: "organization_service:operational_organization:mission:update",
|
|
65
|
+
ORGANIZATION_MISSION_COPY: "organization_service:operational_organization:mission:copy",
|
|
66
|
+
ORGANIZATION_MISSION_DELETE: "organization_service:operational_organization:mission:delete",
|
|
67
|
+
ORGANIZATION_MISSION_DOWNLOAD: "organization_service:operational_organization:mission:download",
|
|
68
|
+
ORGANIZATION_MISSION_UPLOAD: "organization_service:operational_organization:mission:upload",
|
|
69
|
+
ORGANIZATION_MISSION_APPROVE: "organization_service:operational_organization:mission:approve",
|
|
70
|
+
ORGANIZATION_MISSION_SETTING: "organization_service:operational_organization:mission:setting",
|
|
22
71
|
};
|
|
23
72
|
exports.default = PERMISSIONS;
|
package/package.json
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hiennc24/constant",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"types": "lib/index.d.ts",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc",
|
|
8
8
|
"clean": "rimraf lib",
|
|
9
|
+
"test": "jest",
|
|
10
|
+
"test:watch": "jest --watch",
|
|
9
11
|
"prepare": "npm run clean && npm run build",
|
|
10
12
|
"prepublishOnly": "npm run build"
|
|
11
13
|
},
|
|
@@ -30,7 +32,10 @@
|
|
|
30
32
|
},
|
|
31
33
|
"homepage": "https://github.com/hiennc24/moleculer-action-constants.git#readme",
|
|
32
34
|
"devDependencies": {
|
|
35
|
+
"@types/jest": "30.0.0",
|
|
36
|
+
"jest": "30.2.0",
|
|
33
37
|
"rimraf": "5.0.6",
|
|
38
|
+
"ts-jest": "29.4.5",
|
|
34
39
|
"ts-node": "10.9.2",
|
|
35
40
|
"typescript": "^5.5.4"
|
|
36
41
|
},
|