@share-crm/sharedev-cli 0.0.4-rc.51 → 0.0.4-rc.53

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/dist/sharedev.js +254 -170
  2. package/package.json +1 -1
package/dist/sharedev.js CHANGED
@@ -8954,6 +8954,7 @@ var __webpack_unused_export__;
8954
8954
 
8955
8955
  __webpack_unused_export__ = ({ value: true });
8956
8956
  exports.registerAplNamespace = registerAplNamespace;
8957
+ const hide_unverified_new_ts_1 = __webpack_require__(46110);
8957
8958
  const command_ts_1 = __webpack_require__(51481);
8958
8959
  const apl_command_ts_1 = __webpack_require__(10508);
8959
8960
  const index_ts_1 = __webpack_require__(76266);
@@ -9044,7 +9045,7 @@ Examples:
9044
9045
  };
9045
9046
  await (0, apl_command_ts_1.aplCreateCommand)(context, resolvedOptions);
9046
9047
  }));
9047
- // ===== 操作中心动作:code-dev function(启用或停用函数 set-active / 查询函数执行日志 list-execution-logs / 查询函数执行日志详情 get-execution-log) =====
9048
+ // ===== 操作中心动作:code-dev apl(启用或停用函数 set-active / 查询函数执行日志 list-execution-logs / 查询函数执行日志详情 get-execution-log) =====
9048
9049
  apl.command('set-active <apiName>')
9049
9050
  .description('[operation-center] 启用或停用函数 / Enable or disable a remote APL function by api name')
9050
9051
  .requiredOption('--is_active <boolean>', 'Target active state: true or false')
@@ -9089,91 +9090,94 @@ Examples:
9089
9090
  await (0, index_ts_1.aplLogDetailNewCommand)(args[0], context, options);
9090
9091
  }));
9091
9092
  // ============ 操作中心链路(-new):与上方 FHH 链路指令一一对应,便于对比改造前后行为 ============
9092
- apl.command('list-new')
9093
- .description('[operation-center] List APL functions with pagination and server-side filters')
9094
- .requiredOption('--pageNumber <number>', 'Query page number, starting from 1')
9095
- .requiredOption('--pageSize <size>', 'Page size')
9096
- .option('--api_name <apiName>', 'Filter by API name')
9097
- .option('--binding_object_api_name <name>', 'Filter by binding object API name')
9098
- .option('--function_name <name>', 'Filter by function name keyword')
9099
- .option('--body <keyword>', 'Filter by function body keyword')
9100
- .option('--package_name <name>', 'Filter by package name')
9101
- .option('--return_type <type>', 'Filter by return type')
9102
- .option('--type <type>', 'Filter by function type')
9103
- .option('--selectFieldName <field>', 'Select function name or body as the keyword query field')
9104
- .option('--lang <number>', 'Filter by script language code')
9105
- .option('--is_active <boolean>', 'Filter by active status: true or false')
9106
- .action((0, command_ts_1.createCommandAction)('apl', 'list-new', runtimeContext, async ({ options, context }) => {
9107
- await (0, index_ts_1.aplListNewCommand)(context, options);
9108
- }));
9109
- apl.command('info-new <apiName>')
9110
- .description('[operation-center] Show APL function details')
9111
- .option('--bind <bindingObjectApiName>', 'Provide binding object api name for bound functions')
9112
- .action((0, command_ts_1.createCommandAction)('apl', 'info-new', runtimeContext, async ({ args, options, context }) => {
9113
- await (0, index_ts_1.aplInfoNewCommand)(args[0], context, options);
9114
- }));
9115
- apl.command('pull-new [apiName]')
9116
- .description('[operation-center] Pull APL source from remote')
9117
- .option('--all', 'Pull all APL functions')
9118
- .option('--parameters <json>', 'Override function parameters, e.g. \'[{"name":"xx","type":"String","remark":"xx","default_value":"xx"}]\'')
9119
- .action((0, command_ts_1.createCommandAction)('apl', 'pull-new', runtimeContext, async ({ args, options, context }) => {
9120
- await (0, index_ts_1.aplPullNewCommand)(args[0], context, options);
9121
- }));
9122
- apl.command('diff-new [apiName]')
9123
- .description('[operation-center] Compare local APL source with snapshot or remote version')
9124
- .option('-r, --remote <versionOrLatest>', 'Compare with remote version or latest')
9125
- .action((0, command_ts_1.createCommandAction)('apl', 'diff-new', runtimeContext, async ({ args, options, context }) => {
9126
- await (0, index_ts_1.aplDiffNewCommand)(args[0], context, options);
9127
- }));
9128
- apl.command('push-new [apiName]')
9129
- .description('[operation-center] Push local APL source to remote with a required commit comment')
9130
- .requiredOption('-m, --remark <comment>', 'Required push comment submitted as remote commit_log; [apiName] targets one function, omit it to push all tracked local changes')
9131
- .option('--force', 'Force push only when remote version changed')
9132
- .option('--parameters <json>', 'Override function parameters, e.g. \'[{"name":"xx","type":"String","remark":"xx","default_value":"xx"}]\'')
9133
- .action((0, command_ts_1.createCommandAction)('apl', 'push-new', runtimeContext, async ({ args, options, context }) => {
9134
- await (0, index_ts_1.aplPushNewCommand)(args[0], context, options);
9135
- }));
9136
- apl.command('reset-new [apiName]')
9137
- .description('[operation-center] Reset local APL source to remote latest or a specific version')
9138
- .option('-r, --remote <versionOrLatest>', 'Reset to remote latest or a specific version')
9139
- .action((0, command_ts_1.createCommandAction)('apl', 'reset-new', runtimeContext, async ({ args, options, context }) => {
9140
- await (0, index_ts_1.aplResetNewCommand)(args[0], context, options);
9141
- }));
9142
- apl.command('analyze-new [apiName]')
9143
- .description('[operation-center] Analyze local APL source against remote metadata')
9144
- .action((0, command_ts_1.createCommandAction)('apl', 'analyze-new', runtimeContext, async ({ args, context }) => {
9145
- await (0, index_ts_1.aplAnalyzeNewCommand)(args[0], context);
9146
- }));
9147
- apl.command('compile-new [apiName]')
9148
- .description('[operation-center] Compile-check local APL source against remote metadata')
9149
- .action((0, command_ts_1.createCommandAction)('apl', 'compile-new', runtimeContext, async ({ args, context }) => {
9150
- await (0, index_ts_1.aplCompileNewCommand)(args[0], context);
9151
- }));
9152
- apl.command('debug-new [apiName]')
9153
- .description('[operation-center] Debug local tracked APL source against remote metadata')
9154
- .option('--data-id <id>', 'Pass object data ID for bound-object debug runs')
9155
- .option('--params <name=value...>', 'Pass debug params once; separate entries by space or comma, e.g. --params a=1 b=2 or --params a=1,b=2')
9156
- .action((0, command_ts_1.createCommandAction)('apl', 'debug-new', runtimeContext, async ({ args, options, context }) => {
9157
- await (0, index_ts_1.aplDebugNewCommand)(args[0], context, options);
9158
- }));
9159
- apl.command('create-new')
9160
- .description('[operation-center] Create a new APL function/class and write local groovy source')
9161
- .option('--apiname <apiName>', 'APL API name')
9162
- .option('--function-name <functionName>', 'APL display/function name')
9163
- .option('--type <type>', 'APL type: function | class', 'function')
9164
- .option('--namespace <namespace>', 'Namespace value')
9165
- .option('--return-type <returnType>', 'Return type (required when --type function)')
9166
- .option('--bind <bindingObjectApiName>', 'Binding object API name, or NONE for unbound')
9167
- .option('--remark <remark>', 'Description (max 200 chars)')
9168
- .option('--template-id <templateId>', 'Code template id from remote template list')
9169
- .option('--parameters <json>', 'Function parameters, e.g. \'[{"name":"xx","type":"String","remark":"xx","default_value":"xx"}]\'')
9170
- .action((0, command_ts_1.createCommandAction)('apl', 'create-new', runtimeContext, async ({ options, context }) => {
9171
- const resolvedOptions = {
9172
- ...options,
9173
- apiName: options.apiName ?? options.apiname
9174
- };
9175
- await (0, index_ts_1.aplCreateNewCommand)(context, resolvedOptions);
9176
- }));
9093
+ // 临时屏蔽:服务端操作中心未上线 code-dev apl 相关 action,放开:SHAREDEV_ENABLE_NEW_COMMANDS=1
9094
+ if ((0, hide_unverified_new_ts_1.isNewCommandEnabled)(runtimeContext.settings?.domain)) {
9095
+ apl.command('list-new')
9096
+ .description('[operation-center] List APL functions with pagination and server-side filters')
9097
+ .requiredOption('--pageNumber <number>', 'Query page number, starting from 1')
9098
+ .requiredOption('--pageSize <size>', 'Page size')
9099
+ .option('--api_name <apiName>', 'Filter by API name')
9100
+ .option('--binding_object_api_name <name>', 'Filter by binding object API name')
9101
+ .option('--function_name <name>', 'Filter by function name keyword')
9102
+ .option('--body <keyword>', 'Filter by function body keyword')
9103
+ .option('--package_name <name>', 'Filter by package name')
9104
+ .option('--return_type <type>', 'Filter by return type')
9105
+ .option('--type <type>', 'Filter by function type')
9106
+ .option('--selectFieldName <field>', 'Select function name or body as the keyword query field')
9107
+ .option('--lang <number>', 'Filter by script language code')
9108
+ .option('--is_active <boolean>', 'Filter by active status: true or false')
9109
+ .action((0, command_ts_1.createCommandAction)('apl', 'list-new', runtimeContext, async ({ options, context }) => {
9110
+ await (0, index_ts_1.aplListNewCommand)(context, options);
9111
+ }));
9112
+ apl.command('info-new <apiName>')
9113
+ .description('[operation-center] Show APL function details')
9114
+ .option('--bind <bindingObjectApiName>', 'Provide binding object api name for bound functions')
9115
+ .action((0, command_ts_1.createCommandAction)('apl', 'info-new', runtimeContext, async ({ args, options, context }) => {
9116
+ await (0, index_ts_1.aplInfoNewCommand)(args[0], context, options);
9117
+ }));
9118
+ apl.command('pull-new [apiName]')
9119
+ .description('[operation-center] Pull APL source from remote')
9120
+ .option('--all', 'Pull all APL functions')
9121
+ .option('--parameters <json>', 'Override function parameters, e.g. \'[{"name":"xx","type":"String","remark":"xx","default_value":"xx"}]\'')
9122
+ .action((0, command_ts_1.createCommandAction)('apl', 'pull-new', runtimeContext, async ({ args, options, context }) => {
9123
+ await (0, index_ts_1.aplPullNewCommand)(args[0], context, options);
9124
+ }));
9125
+ apl.command('diff-new [apiName]')
9126
+ .description('[operation-center] Compare local APL source with snapshot or remote version')
9127
+ .option('-r, --remote <versionOrLatest>', 'Compare with remote version or latest')
9128
+ .action((0, command_ts_1.createCommandAction)('apl', 'diff-new', runtimeContext, async ({ args, options, context }) => {
9129
+ await (0, index_ts_1.aplDiffNewCommand)(args[0], context, options);
9130
+ }));
9131
+ apl.command('push-new [apiName]')
9132
+ .description('[operation-center] Push local APL source to remote with a required commit comment')
9133
+ .requiredOption('-m, --remark <comment>', 'Required push comment submitted as remote commit_log; [apiName] targets one function, omit it to push all tracked local changes')
9134
+ .option('--force', 'Force push only when remote version changed')
9135
+ .option('--parameters <json>', 'Override function parameters, e.g. \'[{"name":"xx","type":"String","remark":"xx","default_value":"xx"}]\'')
9136
+ .action((0, command_ts_1.createCommandAction)('apl', 'push-new', runtimeContext, async ({ args, options, context }) => {
9137
+ await (0, index_ts_1.aplPushNewCommand)(args[0], context, options);
9138
+ }));
9139
+ apl.command('reset-new [apiName]')
9140
+ .description('[operation-center] Reset local APL source to remote latest or a specific version')
9141
+ .option('-r, --remote <versionOrLatest>', 'Reset to remote latest or a specific version')
9142
+ .action((0, command_ts_1.createCommandAction)('apl', 'reset-new', runtimeContext, async ({ args, options, context }) => {
9143
+ await (0, index_ts_1.aplResetNewCommand)(args[0], context, options);
9144
+ }));
9145
+ apl.command('analyze-new [apiName]')
9146
+ .description('[operation-center] Analyze local APL source against remote metadata')
9147
+ .action((0, command_ts_1.createCommandAction)('apl', 'analyze-new', runtimeContext, async ({ args, context }) => {
9148
+ await (0, index_ts_1.aplAnalyzeNewCommand)(args[0], context);
9149
+ }));
9150
+ apl.command('compile-new [apiName]')
9151
+ .description('[operation-center] Compile-check local APL source against remote metadata')
9152
+ .action((0, command_ts_1.createCommandAction)('apl', 'compile-new', runtimeContext, async ({ args, context }) => {
9153
+ await (0, index_ts_1.aplCompileNewCommand)(args[0], context);
9154
+ }));
9155
+ apl.command('debug-new [apiName]')
9156
+ .description('[operation-center] Debug local tracked APL source against remote metadata')
9157
+ .option('--data-id <id>', 'Pass object data ID for bound-object debug runs')
9158
+ .option('--params <name=value...>', 'Pass debug params once; separate entries by space or comma, e.g. --params a=1 b=2 or --params a=1,b=2')
9159
+ .action((0, command_ts_1.createCommandAction)('apl', 'debug-new', runtimeContext, async ({ args, options, context }) => {
9160
+ await (0, index_ts_1.aplDebugNewCommand)(args[0], context, options);
9161
+ }));
9162
+ apl.command('create-new')
9163
+ .description('[operation-center] Create a new APL function/class and write local groovy source')
9164
+ .option('--apiname <apiName>', 'APL API name')
9165
+ .option('--function-name <functionName>', 'APL display/function name')
9166
+ .option('--type <type>', 'APL type: function | class', 'function')
9167
+ .option('--namespace <namespace>', 'Namespace value')
9168
+ .option('--return-type <returnType>', 'Return type (required when --type function)')
9169
+ .option('--bind <bindingObjectApiName>', 'Binding object API name, or NONE for unbound')
9170
+ .option('--remark <remark>', 'Description (max 200 chars)')
9171
+ .option('--template-id <templateId>', 'Code template id from remote template list')
9172
+ .option('--parameters <json>', 'Function parameters, e.g. \'[{"name":"xx","type":"String","remark":"xx","default_value":"xx"}]\'')
9173
+ .action((0, command_ts_1.createCommandAction)('apl', 'create-new', runtimeContext, async ({ options, context }) => {
9174
+ const resolvedOptions = {
9175
+ ...options,
9176
+ apiName: options.apiName ?? options.apiname
9177
+ };
9178
+ await (0, index_ts_1.aplCreateNewCommand)(context, resolvedOptions);
9179
+ }));
9180
+ }
9177
9181
  }
9178
9182
 
9179
9183
 
@@ -12265,6 +12269,46 @@ function registerFlowNamespace(program, runtimeContext) {
12265
12269
  }
12266
12270
 
12267
12271
 
12272
+ /***/ },
12273
+
12274
+ /***/ 46110
12275
+ (__unused_webpack_module, exports) {
12276
+
12277
+ var __webpack_unused_export__;
12278
+
12279
+ __webpack_unused_export__ = ({ value: true });
12280
+ exports.isNewCommandEnabled = isNewCommandEnabled;
12281
+ /**
12282
+ * 操作中心 -new 命令的环境开关。
12283
+ *
12284
+ * 服务端操作中心按环境部署:ceshi112 环境已上线 code-dev 相关 action,其余环境
12285
+ * (如 fktest5642 所在环境)执行这些命令只会得到 "Command does not exist"。
12286
+ * 已验证可用的操作中心命令(apl set-active / logs / log-detail)不受此开关影响。
12287
+ *
12288
+ * 放开条件(满足其一):
12289
+ * - 工作区 settings.domain 的 hostname 命中 ENABLED_DOMAIN_HOSTS;
12290
+ * - 环境变量 SHAREDEV_ENABLE_NEW_COMMANDS=1(联调验证用)。
12291
+ *
12292
+ * 注意:--help 走 placeholder 上下文(domain 为哨兵值),help 输出中看不到
12293
+ * 这些命令;在放开环境下直接执行即可,或用环境变量让 help 也显示。
12294
+ */
12295
+ const ENABLED_DOMAIN_HOSTS = new Set(['crm.ceshi112.com']);
12296
+ function isNewCommandEnabled(domain) {
12297
+ if (process.env.SHAREDEV_ENABLE_NEW_COMMANDS === '1') {
12298
+ return true;
12299
+ }
12300
+ if (!domain) {
12301
+ return false;
12302
+ }
12303
+ try {
12304
+ return ENABLED_DOMAIN_HOSTS.has(new URL(domain).hostname);
12305
+ }
12306
+ catch {
12307
+ return false;
12308
+ }
12309
+ }
12310
+
12311
+
12268
12312
  /***/ },
12269
12313
 
12270
12314
  /***/ 22841
@@ -13704,6 +13748,7 @@ var __webpack_unused_export__;
13704
13748
  __webpack_unused_export__ = ({ value: true });
13705
13749
  exports.registerPwcNamespace = registerPwcNamespace;
13706
13750
  const commander_1 = __webpack_require__(63219);
13751
+ const hide_unverified_new_ts_1 = __webpack_require__(46110);
13707
13752
  const command_ts_1 = __webpack_require__(51481);
13708
13753
  const pwc_command_ts_1 = __webpack_require__(10372);
13709
13754
  const index_ts_1 = __webpack_require__(60063);
@@ -13732,6 +13777,9 @@ Examples:
13732
13777
  $ sharedev pwc push --apiname MyPlugin --type plugin
13733
13778
  $ sharedev pwc deploy --apiname MyComponent --type component
13734
13779
  $ sharedev pwc create --type component --name Demo --apiname demo__c
13780
+ $ sharedev pwc create --type component --name Demo --apiname demo__c
13781
+ $ sharedev pwc dev src/index.js
13782
+ ${(0, hide_unverified_new_ts_1.isNewCommandEnabled)(runtimeContext.settings?.domain) ? `
13735
13783
  $ sharedev pwc list-new --type component
13736
13784
  $ sharedev pwc info-new --apiname MyComponent --type component
13737
13785
  $ sharedev pwc pull-new --apiname MyComponent --type component
@@ -13739,8 +13787,7 @@ Examples:
13739
13787
  $ sharedev pwc push-new --apiname MyComponent --type component
13740
13788
  $ sharedev pwc deploy-new --apiname MyComponent --type component
13741
13789
  $ sharedev pwc create-new --type component --name Demo --apiname demo__c
13742
- $ sharedev pwc dev src/index.js
13743
- `);
13790
+ ` : ''}`);
13744
13791
  pwc.command('info')
13745
13792
  .description('Show detail info (URL, type, clients) for a PWC resource by apiName')
13746
13793
  .requiredOption('--apiname <apiName>', 'PWC resource API name')
@@ -13814,81 +13861,84 @@ Examples:
13814
13861
  await (0, pwc_command_ts_1.pwcPushCommand)(target, options, context);
13815
13862
  }));
13816
13863
  // ============ 操作中心链路(-new):与上方 FHH 链路指令对应,便于对比改造前后行为 ============
13817
- pwc.command('list-new')
13818
- .description('[operation-center] List PWC resources by type')
13819
- .addOption(new commander_1.Option('--type <type>', 'PWC type: component or plugin')
13820
- .choices(pwc_types_ts_1.PWC_TYPE_VALUES)
13821
- .makeOptionMandatory())
13822
- .option('--componentType <componentType>', 'Component type filter (component only)')
13823
- .option('--scopePageTypes <scopePageTypes>', 'Component page types filter (component only)')
13824
- .option('--pageNumber <pageNumber>', 'Component list page number (component only)')
13825
- .option('--pageSize <pageSize>', 'Component list page size (component only)')
13826
- .option('--clients <clients>', 'Component clients filter (component only)')
13827
- .option('--scopeObjects <scopeObjects>', 'Component objects filter (component only)')
13828
- .option('--keyword <keyword>', 'Component keyword filter (component only)')
13829
- .action((0, command_ts_1.createCommandAction)('pwc', 'list-new', runtimeContext, async ({ options }) => {
13830
- await (0, index_ts_1.pwcPwcListCommand)(options);
13831
- }));
13832
- pwc.command('info-new')
13833
- .description('[operation-center] Show PWC resource details by apiName')
13834
- .requiredOption('--apiname <apiName>', 'PWC resource API name')
13835
- .addOption(new commander_1.Option('--type <type>', 'PWC type: component or plugin')
13836
- .choices(pwc_types_ts_1.PWC_TYPE_VALUES)
13837
- .makeOptionMandatory())
13838
- .action((0, command_ts_1.createCommandAction)('pwc', 'info-new', runtimeContext, async ({ options }) => {
13839
- await (0, index_ts_1.pwcPwcInfoCommand)(options);
13840
- }));
13841
- pwc.command('pull-new')
13842
- .description('[operation-center] Pull PWC source from remote')
13843
- .option('--apiname <apiName>', 'Pull one PWC resource by apiName')
13844
- .option('--all', 'Pull all PWC resources of the specified type')
13845
- .addOption(new commander_1.Option('--type <type>', 'PWC type: component or plugin')
13846
- .choices(pwc_types_ts_1.PWC_TYPE_VALUES)
13847
- .makeOptionMandatory())
13848
- .action((0, command_ts_1.createCommandAction)('pwc', 'pull-new', runtimeContext, async ({ options, context }) => {
13849
- await (0, index_ts_1.pwcPwcPullCommand)(options, context);
13850
- }));
13851
- pwc.command('push-new')
13852
- .description('[operation-center] Push local PWC source to remote (upload files and update metadata, no build)')
13853
- .option('--apiname <apiName>', 'Push one PWC resource by apiName')
13854
- .option('--path <path>', 'Push one PWC resource by local path')
13855
- .addOption(new commander_1.Option('--type <type>', 'PWC type: component or plugin')
13856
- .choices(pwc_types_ts_1.PWC_TYPE_VALUES)
13857
- .makeOptionMandatory())
13858
- .action((0, command_ts_1.createCommandAction)('pwc', 'push-new', runtimeContext, async ({ options, context }) => {
13859
- await (0, index_ts_1.pwcPwcPushCommand)(options, context);
13860
- }));
13861
- pwc.command('deploy-new')
13862
- .description('[operation-center] Deploy local PWC source to remote (push + build)')
13863
- .option('--apiname <apiName>', 'Deploy one PWC resource by apiName')
13864
- .option('--path <path>', 'Deploy one PWC resource by local path')
13865
- .addOption(new commander_1.Option('--type <type>', 'PWC type: component or plugin')
13866
- .choices(pwc_types_ts_1.PWC_TYPE_VALUES)
13867
- .makeOptionMandatory())
13868
- .action((0, command_ts_1.createCommandAction)('pwc', 'deploy-new', runtimeContext, async ({ options, context }) => {
13869
- await (0, index_ts_1.pwcPwcDeployCommand)(options, context);
13870
- }));
13871
- pwc.command('create-new')
13872
- .description('[operation-center] Create a new PWC resource and pull it into local workspace')
13873
- .addOption(new commander_1.Option('--type <type>', 'PWC type: component or plugin')
13874
- .choices(pwc_types_ts_1.PWC_TYPE_VALUES))
13875
- .option('--name <name>', 'PWC name')
13876
- .option('--apiname <apiName>', 'PWC API name')
13877
- .option('--description <description>', 'Description')
13878
- .option('--component-type <componentType>', 'Component type, e.g. vue/applet')
13879
- .option('--client-types <clientTypes>', 'Component client types, comma separated: web,app')
13880
- .option('--scope-page-types <scopePageTypes>', 'Component page types, comma separated')
13881
- .option('--client <client>', 'Plugin client: web or app')
13882
- .option('--plugin-type <pluginType>', 'Plugin type value')
13883
- .option('--limit-obj <limitObj>', 'Restrict objects: true or false')
13884
- .option('--scope-objects <scopeObjects>', 'Object api names, comma separated')
13885
- .action((0, command_ts_1.createCommandAction)('pwc', 'create-new', runtimeContext, async ({ options, context }) => {
13886
- const resolvedOptions = {
13887
- ...options,
13888
- apiName: options.apiName ?? options.apiname
13889
- };
13890
- await (0, index_ts_1.pwcPwcCreateCommand)(resolvedOptions, context);
13891
- }));
13864
+ // 临时屏蔽:服务端操作中心未上线 code-dev apl 相关 action,放开:SHAREDEV_ENABLE_NEW_COMMANDS=1
13865
+ if ((0, hide_unverified_new_ts_1.isNewCommandEnabled)(runtimeContext.settings?.domain)) {
13866
+ pwc.command('list-new')
13867
+ .description('[operation-center] List PWC resources by type')
13868
+ .addOption(new commander_1.Option('--type <type>', 'PWC type: component or plugin')
13869
+ .choices(pwc_types_ts_1.PWC_TYPE_VALUES)
13870
+ .makeOptionMandatory())
13871
+ .option('--componentType <componentType>', 'Component type filter (component only)')
13872
+ .option('--scopePageTypes <scopePageTypes>', 'Component page types filter (component only)')
13873
+ .option('--pageNumber <pageNumber>', 'Component list page number (component only)')
13874
+ .option('--pageSize <pageSize>', 'Component list page size (component only)')
13875
+ .option('--clients <clients>', 'Component clients filter (component only)')
13876
+ .option('--scopeObjects <scopeObjects>', 'Component objects filter (component only)')
13877
+ .option('--keyword <keyword>', 'Component keyword filter (component only)')
13878
+ .action((0, command_ts_1.createCommandAction)('pwc', 'list-new', runtimeContext, async ({ options }) => {
13879
+ await (0, index_ts_1.pwcPwcListCommand)(options);
13880
+ }));
13881
+ pwc.command('info-new')
13882
+ .description('[operation-center] Show PWC resource details by apiName')
13883
+ .requiredOption('--apiname <apiName>', 'PWC resource API name')
13884
+ .addOption(new commander_1.Option('--type <type>', 'PWC type: component or plugin')
13885
+ .choices(pwc_types_ts_1.PWC_TYPE_VALUES)
13886
+ .makeOptionMandatory())
13887
+ .action((0, command_ts_1.createCommandAction)('pwc', 'info-new', runtimeContext, async ({ options }) => {
13888
+ await (0, index_ts_1.pwcPwcInfoCommand)(options);
13889
+ }));
13890
+ pwc.command('pull-new')
13891
+ .description('[operation-center] Pull PWC source from remote')
13892
+ .option('--apiname <apiName>', 'Pull one PWC resource by apiName')
13893
+ .option('--all', 'Pull all PWC resources of the specified type')
13894
+ .addOption(new commander_1.Option('--type <type>', 'PWC type: component or plugin')
13895
+ .choices(pwc_types_ts_1.PWC_TYPE_VALUES)
13896
+ .makeOptionMandatory())
13897
+ .action((0, command_ts_1.createCommandAction)('pwc', 'pull-new', runtimeContext, async ({ options, context }) => {
13898
+ await (0, index_ts_1.pwcPwcPullCommand)(options, context);
13899
+ }));
13900
+ pwc.command('push-new')
13901
+ .description('[operation-center] Push local PWC source to remote (upload files and update metadata, no build)')
13902
+ .option('--apiname <apiName>', 'Push one PWC resource by apiName')
13903
+ .option('--path <path>', 'Push one PWC resource by local path')
13904
+ .addOption(new commander_1.Option('--type <type>', 'PWC type: component or plugin')
13905
+ .choices(pwc_types_ts_1.PWC_TYPE_VALUES)
13906
+ .makeOptionMandatory())
13907
+ .action((0, command_ts_1.createCommandAction)('pwc', 'push-new', runtimeContext, async ({ options, context }) => {
13908
+ await (0, index_ts_1.pwcPwcPushCommand)(options, context);
13909
+ }));
13910
+ pwc.command('deploy-new')
13911
+ .description('[operation-center] Deploy local PWC source to remote (push + build)')
13912
+ .option('--apiname <apiName>', 'Deploy one PWC resource by apiName')
13913
+ .option('--path <path>', 'Deploy one PWC resource by local path')
13914
+ .addOption(new commander_1.Option('--type <type>', 'PWC type: component or plugin')
13915
+ .choices(pwc_types_ts_1.PWC_TYPE_VALUES)
13916
+ .makeOptionMandatory())
13917
+ .action((0, command_ts_1.createCommandAction)('pwc', 'deploy-new', runtimeContext, async ({ options, context }) => {
13918
+ await (0, index_ts_1.pwcPwcDeployCommand)(options, context);
13919
+ }));
13920
+ pwc.command('create-new')
13921
+ .description('[operation-center] Create a new PWC resource and pull it into local workspace')
13922
+ .addOption(new commander_1.Option('--type <type>', 'PWC type: component or plugin')
13923
+ .choices(pwc_types_ts_1.PWC_TYPE_VALUES))
13924
+ .option('--name <name>', 'PWC name')
13925
+ .option('--apiname <apiName>', 'PWC API name')
13926
+ .option('--description <description>', 'Description')
13927
+ .option('--component-type <componentType>', 'Component type, e.g. vue/applet')
13928
+ .option('--client-types <clientTypes>', 'Component client types, comma separated: web,app')
13929
+ .option('--scope-page-types <scopePageTypes>', 'Component page types, comma separated')
13930
+ .option('--client <client>', 'Plugin client: web or app')
13931
+ .option('--plugin-type <pluginType>', 'Plugin type value')
13932
+ .option('--limit-obj <limitObj>', 'Restrict objects: true or false')
13933
+ .option('--scope-objects <scopeObjects>', 'Object api names, comma separated')
13934
+ .action((0, command_ts_1.createCommandAction)('pwc', 'create-new', runtimeContext, async ({ options, context }) => {
13935
+ const resolvedOptions = {
13936
+ ...options,
13937
+ apiName: options.apiName ?? options.apiname
13938
+ };
13939
+ await (0, index_ts_1.pwcPwcCreateCommand)(resolvedOptions, context);
13940
+ }));
13941
+ }
13892
13942
  }
13893
13943
 
13894
13944
 
@@ -16441,10 +16491,11 @@ const SHARE_CLI_COMMAND_PATH_MAP = {
16441
16491
  aplFind: ['code-dev', 'apl', 'get-by-apiname-and-binding-object-apiname'],
16442
16492
  aplBatchQuery: ['code-dev', 'apl', 'query-by-apinames'],
16443
16493
  aplList: ['code-dev', 'apl', 'list'],
16444
- // ===== function(apl 函数启用/停用 + 执行日志,操作中心新命名空间,已实测 fktest5642 环境) =====
16445
- functionSetActive: ['code-dev', 'function', 'set-active'],
16446
- functionListExecutionLogs: ['code-dev', 'function', 'list-execution-logs'],
16447
- functionGetExecutionLog: ['code-dev', 'function', 'get-execution-log'],
16494
+ // ===== function 类 action(函数启用/停用 + 执行日志)=====
16495
+ // 2026-10-23 双环境(112 / fxiaoke)实测:函数类 action 统一挂在 `code-dev apl` 下,`code-dev function` 命名空间均未注册
16496
+ functionSetActive: ['code-dev', 'apl', 'set-active'],
16497
+ functionListExecutionLogs: ['code-dev', 'apl', 'list-execution-logs'],
16498
+ functionGetExecutionLog: ['code-dev', 'apl', 'get-execution-log'],
16448
16499
  },
16449
16500
  };
16450
16501
  function getShareCliCommandPath(namespace, key) {
@@ -49120,6 +49171,10 @@ async function stageDefDeployCommand(_context, options) {
49120
49171
  descTranslateInfo: "object"
49121
49172
  };
49122
49173
  const data = buildOptionsData(options, typeMap);
49174
+ // 空 body 会被服务端直接拒绝为 500,本地先校验定位字段
49175
+ if (!data.id && !data.sourceWorkflowId) {
49176
+ throw new Error('stage-dev deploy requires --id or --sourceWorkflowId to locate the definition.');
49177
+ }
49123
49178
  logger_ts_1.loggerService.startLoading('Executing stageDef deploy');
49124
49179
  try {
49125
49180
  const response = await (0, stage_def_service_ts_1.executeStageDefShareCli)((0, request_execute_command_paths_ts_1.getShareCliCommandPath)('stageDef', 'deploy'), data);
@@ -49150,7 +49205,36 @@ async function stageDefUpdateCommand(_context, options) {
49150
49205
  nameTranslateInfo: "object",
49151
49206
  descTranslateInfo: "object"
49152
49207
  };
49153
- const data = buildOptionsData(options, typeMap);
49208
+ const updates = buildOptionsData(options, typeMap);
49209
+ // 服务端为全量更新语义:必须先按 --sourceWorkflowId 拉取完整定义,再合并增量提交
49210
+ if (!updates.sourceWorkflowId) {
49211
+ throw new Error('stage-dev update requires --sourceWorkflowId to locate and load the full definition.');
49212
+ }
49213
+ const changedFields = Object.keys(updates).filter((key) => key !== 'sourceWorkflowId');
49214
+ if (changedFields.length === 0) {
49215
+ throw new Error('stage-dev update requires at least one field to update besides --sourceWorkflowId.');
49216
+ }
49217
+ logger_ts_1.loggerService.startLoading('Loading stageDef detail for full definition');
49218
+ let fullDefinition;
49219
+ try {
49220
+ const detailResponse = await (0, stage_def_service_ts_1.executeStageDefShareCli)((0, request_execute_command_paths_ts_1.getShareCliCommandPath)('stageDef', 'detail'), { sourceWorkflowId: updates.sourceWorkflowId });
49221
+ logger_ts_1.loggerService.stopLoading();
49222
+ const envelope = (detailResponse && typeof detailResponse === 'object')
49223
+ ? detailResponse
49224
+ : {};
49225
+ if (envelope.success !== true || !envelope.data) {
49226
+ throw new Error(`Failed to load full definition via stageDef detail: ${envelope.message ?? 'definition missing'}.`);
49227
+ }
49228
+ fullDefinition = envelope.data;
49229
+ }
49230
+ catch (error) {
49231
+ logger_ts_1.loggerService.stopLoading();
49232
+ throw error;
49233
+ }
49234
+ // 服务端 schema 将 id 定义为 object 类型,detail 返回的 string id 回传会被校验拒绝;
49235
+ // 定位统一交给 sourceWorkflowId(schema 中 id 非必填)
49236
+ const { id: _omitId, ...data } = { ...fullDefinition, ...updates };
49237
+ void _omitId;
49154
49238
  logger_ts_1.loggerService.startLoading('Executing stageDef update');
49155
49239
  try {
49156
49240
  const response = await (0, stage_def_service_ts_1.executeStageDefShareCli)((0, request_execute_command_paths_ts_1.getShareCliCommandPath)('stageDef', 'update'), data);
@@ -50553,8 +50637,8 @@ async function readCliPackageMeta() {
50553
50637
  ? "@share-crm/sharedev-cli".trim()
50554
50638
  : '@share-crm/sharedev-cli';
50555
50639
  const debugEnabled = true && Boolean(false);
50556
- const rawVersion = ( true && "0.0.4-rc.51".trim())
50557
- ? "0.0.4-rc.51".trim()
50640
+ const rawVersion = ( true && "0.0.4-rc.53".trim())
50641
+ ? "0.0.4-rc.53".trim()
50558
50642
  : '0.0.0';
50559
50643
  const version = rawVersion + (debugEnabled ? '-debug' : '');
50560
50644
  return { name, version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@share-crm/sharedev-cli",
3
- "version": "0.0.4-rc.51",
3
+ "version": "0.0.4-rc.53",
4
4
  "private": false,
5
5
  "description": "sharedev command line tool",
6
6
  "type": "module",