openxiangda 1.0.196 → 1.0.197

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.
Files changed (2) hide show
  1. package/lib/cli.js +19 -18
  2. package/package.json +1 -1
package/lib/cli.js CHANGED
@@ -11104,24 +11104,25 @@ async function permission(args) {
11104
11104
  fail('用法: openxiangda permission role-create <roleCode> --name <text>');
11105
11105
  }
11106
11106
  const target = getWorkspaceTarget(config, profileName, flags);
11107
- await ensureDirectMutationPublishContext(config, target, flags, 'permission role-create');
11108
- const data = await requestWithAuth(
11109
- config,
11110
- target.profileName,
11111
- `/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/roles`,
11112
- {
11113
- method: 'POST',
11114
- body: {
11115
- code: flags.code || roleCode,
11116
- name,
11117
- description: flags.description || '',
11118
- },
11119
- }
11120
- );
11121
- if (data?.id) saveRoleResource(target, roleCode, data.id, { code: data.code, name: data.name });
11122
- if (flags.json) return writeJson(data);
11123
- print(JSON.stringify(data, null, 2));
11124
- return;
11107
+ const data = await runDirectRequest(config, target, flags, {
11108
+ method: 'POST',
11109
+ path: `/openxiangda-api/v1/apps/${encodeURIComponent(target.appType)}/roles`,
11110
+ body: {
11111
+ code: flags.code || roleCode,
11112
+ name,
11113
+ description: flags.description || '',
11114
+ },
11115
+ }, {
11116
+ returnData: true,
11117
+ mutationLabel: 'permission role-create',
11118
+ });
11119
+ if (!flags['dry-run'] && data?.id) {
11120
+ saveRoleResource(target, roleCode, data.id, {
11121
+ code: data.code,
11122
+ name: data.name,
11123
+ });
11124
+ }
11125
+ return outputDirectResult(data, flags);
11125
11126
  }
11126
11127
 
11127
11128
  if (subcommand === 'role-update') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda",
3
- "version": "1.0.196",
3
+ "version": "1.0.197",
4
4
  "description": "OpenXiangda CLI, workspace build tools, runtime SDK, and form components.",
5
5
  "private": false,
6
6
  "bin": {