@share-crm/sharedev-cli 0.0.4-rc.29 → 0.0.4-rc.30
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/dist/sharedev.js +197 -1
- package/package.json +1 -1
package/dist/sharedev.js
CHANGED
|
@@ -8635,6 +8635,97 @@ bootstrap().catch((error) => {
|
|
|
8635
8635
|
});
|
|
8636
8636
|
|
|
8637
8637
|
|
|
8638
|
+
/***/ },
|
|
8639
|
+
|
|
8640
|
+
/***/ 1696
|
|
8641
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
8642
|
+
|
|
8643
|
+
|
|
8644
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
8645
|
+
exports.registerAccessNamespace = registerAccessNamespace;
|
|
8646
|
+
const command_ts_1 = __webpack_require__(528);
|
|
8647
|
+
const index_ts_1 = __webpack_require__(8877);
|
|
8648
|
+
const ROLE_COMMANDS = [
|
|
8649
|
+
{
|
|
8650
|
+
action: 'queryUserRoleByUserIds',
|
|
8651
|
+
command: 'query-user-role-by-user-ids',
|
|
8652
|
+
description: '根据人员 ID 查询人员角色详情'
|
|
8653
|
+
},
|
|
8654
|
+
{
|
|
8655
|
+
action: 'queryRolesByName',
|
|
8656
|
+
command: 'query-roles-by-name',
|
|
8657
|
+
description: '根据名称查询业务或管理角色'
|
|
8658
|
+
},
|
|
8659
|
+
{
|
|
8660
|
+
action: 'queryBusinessRolesByName',
|
|
8661
|
+
command: 'query-business-roles-by-name',
|
|
8662
|
+
description: '按名称查询 CRM 业务角色'
|
|
8663
|
+
},
|
|
8664
|
+
{
|
|
8665
|
+
action: 'queryManagementRolesByName',
|
|
8666
|
+
command: 'query-management-roles-by-name',
|
|
8667
|
+
description: '按名称查询系统管理角色'
|
|
8668
|
+
},
|
|
8669
|
+
{
|
|
8670
|
+
action: 'queryBusinessRoleMembers',
|
|
8671
|
+
command: 'query-business-role-members',
|
|
8672
|
+
description: '查询业务角色下的人员'
|
|
8673
|
+
},
|
|
8674
|
+
{
|
|
8675
|
+
action: 'queryManagementRoleMembers',
|
|
8676
|
+
command: 'query-management-role-members',
|
|
8677
|
+
description: '查询管理角色下的人员'
|
|
8678
|
+
},
|
|
8679
|
+
{
|
|
8680
|
+
action: 'queryUserAllRoles',
|
|
8681
|
+
command: 'query-user-all-roles',
|
|
8682
|
+
description: '查询人员全部管理角色和业务角色'
|
|
8683
|
+
},
|
|
8684
|
+
{
|
|
8685
|
+
action: 'addPeopleToBusinessRole',
|
|
8686
|
+
command: 'add-people-to-business-role',
|
|
8687
|
+
description: '给业务角色追加人员'
|
|
8688
|
+
},
|
|
8689
|
+
{
|
|
8690
|
+
action: 'addPeopleToManagementRole',
|
|
8691
|
+
command: 'add-people-to-management-role',
|
|
8692
|
+
description: '给管理角色追加人员'
|
|
8693
|
+
},
|
|
8694
|
+
{
|
|
8695
|
+
action: 'addBusinessRolesToPerson',
|
|
8696
|
+
command: 'add-business-roles-to-person',
|
|
8697
|
+
description: '给人员追加业务角色'
|
|
8698
|
+
},
|
|
8699
|
+
{
|
|
8700
|
+
action: 'addManagementRolesToPerson',
|
|
8701
|
+
command: 'add-management-roles-to-person',
|
|
8702
|
+
description: '给人员追加管理角色'
|
|
8703
|
+
},
|
|
8704
|
+
{
|
|
8705
|
+
action: 'removePeopleFromBusinessRole',
|
|
8706
|
+
command: 'remove-people-from-business-role',
|
|
8707
|
+
description: '从业务角色移除人员'
|
|
8708
|
+
},
|
|
8709
|
+
{
|
|
8710
|
+
action: 'removePeopleFromManagementRole',
|
|
8711
|
+
command: 'remove-people-from-management-role',
|
|
8712
|
+
description: '从管理角色移除人员'
|
|
8713
|
+
}
|
|
8714
|
+
];
|
|
8715
|
+
function registerAccessNamespace(program, runtimeContext) {
|
|
8716
|
+
const access = program.command('access').description('Access and authorization commands');
|
|
8717
|
+
const role = access.command('role').description('Role management commands');
|
|
8718
|
+
for (const definition of ROLE_COMMANDS) {
|
|
8719
|
+
role.command(definition.command)
|
|
8720
|
+
.description(definition.description)
|
|
8721
|
+
.requiredOption('--data <data>', 'JSON object passed to the Action Centre')
|
|
8722
|
+
.action((0, command_ts_1.createCommandAction)('access role', definition.command, runtimeContext, async ({ options, context }) => {
|
|
8723
|
+
await (0, index_ts_1.roleActionCommand)(context, definition.action, options);
|
|
8724
|
+
}));
|
|
8725
|
+
}
|
|
8726
|
+
}
|
|
8727
|
+
|
|
8728
|
+
|
|
8638
8729
|
/***/ },
|
|
8639
8730
|
|
|
8640
8731
|
/***/ 5679
|
|
@@ -10703,6 +10794,7 @@ const interface_dev_ts_1 = __webpack_require__(8965);
|
|
|
10703
10794
|
const sales_ts_1 = __webpack_require__(4056);
|
|
10704
10795
|
const data_ts_1 = __webpack_require__(7170);
|
|
10705
10796
|
const email_ts_1 = __webpack_require__(4952);
|
|
10797
|
+
const access_ts_1 = __webpack_require__(1696);
|
|
10706
10798
|
function registerNamespaces(program, context) {
|
|
10707
10799
|
(0, init_ts_1.registerInitCommand)(program, context);
|
|
10708
10800
|
(0, config_ts_1.registerConfigCommand)(program, context);
|
|
@@ -10727,6 +10819,7 @@ function registerNamespaces(program, context) {
|
|
|
10727
10819
|
(0, sales_ts_1.registerSalesNamespace)(program, context);
|
|
10728
10820
|
(0, data_ts_1.registerDataNamespace)(program, context);
|
|
10729
10821
|
(0, email_ts_1.registerEmailNamespace)(program, context);
|
|
10822
|
+
(0, access_ts_1.registerAccessNamespace)(program, context);
|
|
10730
10823
|
}
|
|
10731
10824
|
|
|
10732
10825
|
|
|
@@ -13375,6 +13468,22 @@ const SHARE_CLI_COMMAND_PATH_MAP = {
|
|
|
13375
13468
|
getCommonPrivilegeList: ['access', 'data-auth', 'get-common-privilege-list'],
|
|
13376
13469
|
batchUpdateCommonPrivilege: ['access', 'data-auth', 'batch-update-common-privilege'],
|
|
13377
13470
|
},
|
|
13471
|
+
// Manual addition - role-management Action Centre routes are not generated yet.
|
|
13472
|
+
accessRole: {
|
|
13473
|
+
queryUserRoleByUserIds: ['access', 'role', 'queryUserRoleByUserIds'],
|
|
13474
|
+
queryRolesByName: ['access', 'role', 'queryRolesByName'],
|
|
13475
|
+
queryBusinessRolesByName: ['access', 'role', 'queryBusinessRolesByName'],
|
|
13476
|
+
queryManagementRolesByName: ['access', 'role', 'queryManagementRolesByName'],
|
|
13477
|
+
queryBusinessRoleMembers: ['access', 'role', 'queryBusinessRoleMembers'],
|
|
13478
|
+
queryManagementRoleMembers: ['access', 'role', 'queryManagementRoleMembers'],
|
|
13479
|
+
queryUserAllRoles: ['access', 'role', 'queryUserAllRoles'],
|
|
13480
|
+
addPeopleToBusinessRole: ['access', 'role', 'addPeopleToBusinessRole'],
|
|
13481
|
+
addPeopleToManagementRole: ['access', 'role', 'addPeopleToManagementRole'],
|
|
13482
|
+
addBusinessRolesToPerson: ['access', 'role', 'addBusinessRolesToPerson'],
|
|
13483
|
+
addManagementRolesToPerson: ['access', 'role', 'addManagementRolesToPerson'],
|
|
13484
|
+
removePeopleFromBusinessRole: ['access', 'role', 'removePeopleFromBusinessRole'],
|
|
13485
|
+
removePeopleFromManagementRole: ['access', 'role', 'removePeopleFromManagementRole'],
|
|
13486
|
+
},
|
|
13378
13487
|
orgDev: {
|
|
13379
13488
|
userQuery: ['QueryRecordIdByName'],
|
|
13380
13489
|
departmentQuery: ['QueryRecordIdByName'],
|
|
@@ -14572,6 +14681,93 @@ const getXmlMetadataRule = (headerName) => exports.XML_METADATA_RULES[headerName
|
|
|
14572
14681
|
exports.getXmlMetadataRule = getXmlMetadataRule;
|
|
14573
14682
|
|
|
14574
14683
|
|
|
14684
|
+
/***/ },
|
|
14685
|
+
|
|
14686
|
+
/***/ 8877
|
|
14687
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
14688
|
+
|
|
14689
|
+
|
|
14690
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
14691
|
+
exports.roleActionCommand = void 0;
|
|
14692
|
+
var role_command_ts_1 = __webpack_require__(5794);
|
|
14693
|
+
Object.defineProperty(exports, "roleActionCommand", ({ enumerable: true, get: function () { return role_command_ts_1.roleActionCommand; } }));
|
|
14694
|
+
|
|
14695
|
+
|
|
14696
|
+
/***/ },
|
|
14697
|
+
|
|
14698
|
+
/***/ 5794
|
|
14699
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
14700
|
+
|
|
14701
|
+
|
|
14702
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
14703
|
+
exports.roleActionCommand = roleActionCommand;
|
|
14704
|
+
const logger_ts_1 = __webpack_require__(3333);
|
|
14705
|
+
const role_service_ts_1 = __webpack_require__(7186);
|
|
14706
|
+
async function roleActionCommand(_context, action, options) {
|
|
14707
|
+
void _context;
|
|
14708
|
+
const data = parseRoleActionData(options.data);
|
|
14709
|
+
logger_ts_1.loggerService.startLoading(`Executing access role ${action}`);
|
|
14710
|
+
try {
|
|
14711
|
+
const response = await (0, role_service_ts_1.executeAccessRoleShareCli)(action, data);
|
|
14712
|
+
logger_ts_1.loggerService.stopLoading();
|
|
14713
|
+
logger_ts_1.loggerService.printJson(response);
|
|
14714
|
+
}
|
|
14715
|
+
catch (error) {
|
|
14716
|
+
logger_ts_1.loggerService.stopLoading();
|
|
14717
|
+
throw error;
|
|
14718
|
+
}
|
|
14719
|
+
}
|
|
14720
|
+
function parseRoleActionData(value) {
|
|
14721
|
+
if (!value || !value.trim()) {
|
|
14722
|
+
throw new Error('Invalid arguments: use --data <JSON object>.');
|
|
14723
|
+
}
|
|
14724
|
+
let parsed;
|
|
14725
|
+
try {
|
|
14726
|
+
parsed = JSON.parse(value);
|
|
14727
|
+
}
|
|
14728
|
+
catch {
|
|
14729
|
+
throw new Error('Invalid arguments: --data must be valid JSON.');
|
|
14730
|
+
}
|
|
14731
|
+
if (!parsed || typeof parsed !== 'object' || Array.isArray(parsed)) {
|
|
14732
|
+
throw new Error('Invalid arguments: --data must be a JSON object.');
|
|
14733
|
+
}
|
|
14734
|
+
return parsed;
|
|
14735
|
+
}
|
|
14736
|
+
|
|
14737
|
+
|
|
14738
|
+
/***/ },
|
|
14739
|
+
|
|
14740
|
+
/***/ 6362
|
|
14741
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
14742
|
+
|
|
14743
|
+
|
|
14744
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
14745
|
+
exports.requestAccessRoleExecute = requestAccessRoleExecute;
|
|
14746
|
+
const request_execute_ts_1 = __webpack_require__(8554);
|
|
14747
|
+
async function requestAccessRoleExecute(commandPath, data) {
|
|
14748
|
+
const response = await (0, request_execute_ts_1.executeShareCliCommand)(commandPath, data);
|
|
14749
|
+
if (!response || typeof response !== 'object') {
|
|
14750
|
+
throw new Error('Response is not an object or is empty.');
|
|
14751
|
+
}
|
|
14752
|
+
return response;
|
|
14753
|
+
}
|
|
14754
|
+
|
|
14755
|
+
|
|
14756
|
+
/***/ },
|
|
14757
|
+
|
|
14758
|
+
/***/ 7186
|
|
14759
|
+
(__unused_webpack_module, exports, __webpack_require__) {
|
|
14760
|
+
|
|
14761
|
+
|
|
14762
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
14763
|
+
exports.executeAccessRoleShareCli = executeAccessRoleShareCli;
|
|
14764
|
+
const request_execute_command_paths_ts_1 = __webpack_require__(2351);
|
|
14765
|
+
const request_ts_1 = __webpack_require__(6362);
|
|
14766
|
+
async function executeAccessRoleShareCli(action, data) {
|
|
14767
|
+
return (0, request_ts_1.requestAccessRoleExecute)((0, request_execute_command_paths_ts_1.getShareCliCommandPath)('accessRole', action), data);
|
|
14768
|
+
}
|
|
14769
|
+
|
|
14770
|
+
|
|
14575
14771
|
/***/ },
|
|
14576
14772
|
|
|
14577
14773
|
/***/ 2561
|
|
@@ -46824,7 +47020,7 @@ module.exports = /*#__PURE__*/JSON.parse('{"application/1d-interleaved-parityfec
|
|
|
46824
47020
|
/***/ 8330
|
|
46825
47021
|
(module) {
|
|
46826
47022
|
|
|
46827
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"@share-crm/sharedev-cli","version":"0.0.4-rc.
|
|
47023
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"@share-crm/sharedev-cli","version":"0.0.4-rc.30","private":false,"description":"sharedev command line tool","type":"module","main":"dist/sharedev.js","bin":{"sharedev":"./bin/cli.mjs"},"author":{"name":"sharecrm-npm"},"files":["dist","bin","README.md"],"scripts":{"build":"tsc --noEmit && webpack --config build/webpack/webpack.prod.cjs","build:debug":"tsc --noEmit && webpack --config build/webpack/webpack.debug.cjs","build:bin":"bun build --compile --target=bun-darwin-x64 src/cli.ts --outfile scripts/sharedev-darwin-x64 && bun build --compile --target=bun-darwin-arm64 src/cli.ts --outfile scripts/sharedev-darwin-arm64 && bun build --compile --target=bun-windows-x64 src/cli.ts --outfile scripts/sharedev-windows-x64.exe","build:all":"npm run build && npm run build:bin","dev":"tsc --noEmit --watch & webpack --config build/webpack/webpack.dev.cjs --watch","dev2":"node src/cli.ts","typecheck":"tsc --noEmit","prettier":"prettier --write ./src/**/*.ts","test":"vitest run","test:watch":"vitest","test:coverage":"vitest run --coverage"},"dependencies":{"@clack/prompts":"^1.1.0","@mariozechner/pi-coding-agent":"^0.62.0","axios":"~1.13.0","chalk":"^5.6.2","commander":"^14.0.1","extract-zip":"^2.0.1","fast-xml-parser":"^5.2.5","fs-extra":"^11.3.2","lodash-es":"^4.18.1","ora":"^9.3.0","terser-webpack-plugin":"^5.6.1"},"devDependencies":{"@types/extract-zip":"^2.0.3","@types/fs-extra":"^11.0.4","@types/lodash-es":"^4.17.12","@types/node":"^24.3.0","@vitest/coverage-v8":"^4.1.8","ts-loader":"^9.5.4","typescript":"^5.9.2","vitest":"^3.2.6","webpack":"^5.101.3","webpack-cli":"^6.0.1","webpack-merge":"^6.0.1"},"packageManager":"pnpm@10.17.0"}');
|
|
46828
47024
|
|
|
46829
47025
|
/***/ }
|
|
46830
47026
|
|