@hiennc24/constant 1.6.5 → 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/lib/service.constant.json +28 -4
- package/package.json +7 -2
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;
|
|
@@ -17,6 +17,9 @@
|
|
|
17
17
|
"ORGANIZATION": {
|
|
18
18
|
"EMPLOYEE_UPDATED": "organization.employee.updated",
|
|
19
19
|
"POSITION_UPDATED": "organization.position.updated"
|
|
20
|
+
},
|
|
21
|
+
"PRODUCT": {
|
|
22
|
+
"UPDATED": "product.product.updated"
|
|
20
23
|
}
|
|
21
24
|
},
|
|
22
25
|
"CHANNEL_CONSUMER_GROUPS": {
|
|
@@ -24,6 +27,9 @@
|
|
|
24
27
|
"LEAVE_MANAGEMENT": "hrm.leave-management",
|
|
25
28
|
"TIMEKEEPING": "hrm.timekeeping",
|
|
26
29
|
"WORKSHIFT": "hrm.workshift"
|
|
30
|
+
},
|
|
31
|
+
"WAREHOUSE": {
|
|
32
|
+
"INVENTORY": "warehouse.inventory"
|
|
27
33
|
}
|
|
28
34
|
},
|
|
29
35
|
"CHANNEL_DLQ_QUEUES": {
|
|
@@ -31,6 +37,9 @@
|
|
|
31
37
|
"LEAVE_EMPLOYEE_UPDATED": "DEAD_LETTER.hrm.employee.updated",
|
|
32
38
|
"TIMEKEEPING_EMPLOYEE_UPDATED": "DEAD_LETTER.hrm.timekeeping.employee.updated",
|
|
33
39
|
"WORKSHIFT_EMPLOYEE_UPDATED": "DEAD_LETTER.hrm.workshift.employee.updated"
|
|
40
|
+
},
|
|
41
|
+
"WAREHOUSE": {
|
|
42
|
+
"INVENTORY_PRODUCT_UPDATED": "DEAD_LETTER.warehouse.inventory.product.updated"
|
|
34
43
|
}
|
|
35
44
|
},
|
|
36
45
|
"SVC_SHARED_SETTING_INVOICE": {
|
|
@@ -172,15 +181,18 @@
|
|
|
172
181
|
"ACTION_GET_OVERVIEW": "getOverview",
|
|
173
182
|
"ACTION_GET_REVENUE_CHART": "getRevenueChart",
|
|
174
183
|
"ACTION_GET_TOP_PRODUCTS": "getTopProducts",
|
|
175
|
-
"ACTION_GET_RECENT_TX": "getRecentTx"
|
|
184
|
+
"ACTION_GET_RECENT_TX": "getRecentTx",
|
|
185
|
+
"ACTION_GET_DASHBOARD": "getDashboard"
|
|
176
186
|
},
|
|
177
187
|
"SVC_CUSTOMER_SALES": {
|
|
178
188
|
"NAME": "svc-business-partner.customer-sales",
|
|
179
189
|
"ACTION_GET_ORDERS": "getOrders",
|
|
180
190
|
"ACTION_GET_ORDERS_SUMMARY": "getOrdersSummary",
|
|
181
191
|
"ACTION_GET_INVOICES": "getInvoices",
|
|
192
|
+
"ACTION_GET_INVOICES_SUMMARY": "getInvoicesSummary",
|
|
182
193
|
"ACTION_GET_RETURNS": "getReturns",
|
|
183
|
-
"ACTION_GET_PRODUCTS": "getProducts"
|
|
194
|
+
"ACTION_GET_PRODUCTS": "getProducts",
|
|
195
|
+
"ACTION_GET_SALES_TAB": "getSalesTab"
|
|
184
196
|
},
|
|
185
197
|
"SVC_CUSTOMER_MARKETING": {
|
|
186
198
|
"NAME": "svc-business-partner.customer-marketing",
|
|
@@ -188,14 +200,16 @@
|
|
|
188
200
|
"ACTION_GET_PROMOTIONS": "getPromotions",
|
|
189
201
|
"ACTION_GET_LOYALTY": "getLoyalty",
|
|
190
202
|
"ACTION_GET_REWARDS": "getRewards",
|
|
191
|
-
"ACTION_GET_EMAILS": "getEmails"
|
|
203
|
+
"ACTION_GET_EMAILS": "getEmails",
|
|
204
|
+
"ACTION_GET_MARKETING_TAB": "getMarketingTab"
|
|
192
205
|
},
|
|
193
206
|
"SVC_CUSTOMER_PAYMENT": {
|
|
194
207
|
"NAME": "svc-business-partner.customer-payment",
|
|
195
208
|
"ACTION_GET_VOUCHERS": "getVouchers",
|
|
196
209
|
"ACTION_GET_SUMMARY": "getSummary",
|
|
197
210
|
"ACTION_GET_VOUCHER_BY_ID": "getVoucherById",
|
|
198
|
-
"ACTION_DOWNLOAD_VOUCHER": "downloadVoucher"
|
|
211
|
+
"ACTION_DOWNLOAD_VOUCHER": "downloadVoucher",
|
|
212
|
+
"ACTION_GET_PAYMENT_TAB": "getPaymentTab"
|
|
199
213
|
},
|
|
200
214
|
"SVC_DEBTS": {
|
|
201
215
|
"NAME": "svc-business-partner.debts",
|
|
@@ -514,6 +528,16 @@
|
|
|
514
528
|
"ACTION_UPDATE_ALLOW_OUT_OF_STOCK": "getSettingAllowOutOfStock",
|
|
515
529
|
"ACTIONS_GET_SETTING_ALLOW_OUT_OF_STOCK": "updateAllowOutOfStock"
|
|
516
530
|
},
|
|
531
|
+
"SVC_SALES_ORDERS_PARTNER_AGGREGATION": {
|
|
532
|
+
"NAME": "svc-sales-orders.partner-aggregation",
|
|
533
|
+
"ACTION_GET_PARTNER_ORDERS": "getPartnerOrders",
|
|
534
|
+
"ACTION_GET_PARTNER_ORDERS_SUMMARY": "getPartnerOrdersSummary",
|
|
535
|
+
"ACTION_GET_PARTNER_RETURNS": "getPartnerReturns",
|
|
536
|
+
"ACTION_GET_PARTNER_PRODUCTS": "getPartnerProducts",
|
|
537
|
+
"ACTION_GET_PARTNER_REVENUE_CHART": "getPartnerRevenueChart",
|
|
538
|
+
"ACTION_GET_PARTNER_TOP_PRODUCTS": "getPartnerTopProducts",
|
|
539
|
+
"ACTION_GET_PARTNER_RECENT_TRANSACTIONS": "getPartnerRecentTransactions"
|
|
540
|
+
},
|
|
517
541
|
"SVC_SALES_ORDERS": {
|
|
518
542
|
"NAME": "svc-sales-orders",
|
|
519
543
|
"ACTION_GET_SALES_ORDERS_BY_CUSTOMER_ID": "getSalesOrdersByCustomerId",
|
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
|
},
|
|
@@ -38,4 +43,4 @@
|
|
|
38
43
|
"access": "public",
|
|
39
44
|
"registry": "https://registry.npmjs.org/"
|
|
40
45
|
}
|
|
41
|
-
}
|
|
46
|
+
}
|