openyida 2026.9.16-2 → 2026.9.17

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/README.md CHANGED
@@ -491,7 +491,7 @@ Run `openyida --help` or `openyida <command> --help` for detailed usage.
491
491
  | `openyida connector update-action --connector-id <id> --action <operationId> --query-json JSON --confirm` | Safely update action query defaults |
492
492
  | `openyida connector list-actions <id>` | List actions |
493
493
  | `openyida connector delete-action <id> <operation-id>` | Delete an action |
494
- | `openyida connector test --connector-id <id> --action <actionId> [--path-json JSON] [--query-json JSON] [--header-json JSON] [--body-json JSON] [--account-id <id>] [--system-token-app <appType>]` | Test an action |
494
+ | `openyida connector test --connector-id <id> --action <actionId> [--path-json JSON] [--query-json JSON] [--header-json JSON] [--body-json JSON] [--account-id <id>] [--system-token-app <appType>] [--ignore-defaults]` | Test an action |
495
495
  | `openyida connector list-connections <id>` | List auth connections |
496
496
  | `openyida connector create-connection <id> <name> [--interactive]` | Create an auth connection |
497
497
  | `openyida connector smart-create --curl "..."` | Generate a redacted action draft from cURL (no remote create) |
@@ -543,7 +543,7 @@ Run `openyida --help` or `openyida <command> --help` for detailed usage.
543
543
 
544
544
  #### Connector Safety and Real E2E
545
545
 
546
- `connector test` keeps the legacy flat `--params` option, but dispatches each key only to the location proven by the action schema. Unknown or ambiguous keys fail closed. Authenticated connectors require `--account-id`, and that account must belong to the selected connector. The test response follows the frontend canonical contract `{statusLine,responseHeaders,content}`; unknown envelopes and non-2xx status lines are failures.
546
+ `connector test` keeps the legacy flat `--params` option, but dispatches each key only to the location proven by the action schema. Unknown or ambiguous keys fail closed. Authenticated connectors require `--account-id`, and that account must belong to the selected connector. The test response follows the frontend canonical contract `{statusLine,responseHeaders,content}`; unknown envelopes and non-2xx status lines are failures. With `--ignore-defaults`, the test starts from empty parameter sets: saved default values from the action definition (including sensitive placeholder values such as documented `***` samples) are ignored for the run, and a warning is printed when a non-empty systemToken default exists. Declared systemToken actions still require `--system-token-app`, target-trust checks still apply, and explicitly provided systemToken values are still rejected.
547
547
 
548
548
  `connector update-action --connector-id <id> --action <operationId> --query-json '{"currentPage":"1"}' --confirm` is the narrow safe path for editing existing query defaults. It requires a complete connector/action preflight, changes only declared query defaults mirrored in `inputs` and `parameters`, submits the complete action collection once, and verifies an unchanged connector fingerprint, action count, non-target actions, and stable IDs. Missing/empty/unknown parameters, duplicate IDs, incomplete readback, and unknown write outcomes fail closed without automatic retry. `add-action` no longer overwrites an existing action ID; use `update-action` for query-only edits.
549
549
 
@@ -5,6 +5,7 @@
5
5
  'use strict';
6
6
 
7
7
  const { t } = require('../core/i18n');
8
+ const { warn } = require('../core/chalk');
8
9
  const { redactSensitive, redactString, safeJsonStringify } = require('../core/redact');
9
10
  const {
10
11
  getAuthRef,
@@ -18,6 +19,7 @@ const {
18
19
  assertNoExplicitSystemToken,
19
20
  assertTrustedYidaSystemTokenTarget,
20
21
  collectSystemTokenLocations,
22
+ hasNonEmptySystemToken,
21
23
  resolveYidaSystemToken,
22
24
  } = require('./yida-system-token');
23
25
 
@@ -48,6 +50,7 @@ function parseArgs(args) {
48
50
  case '--body-json': options.bodyJson = args[++i]; break;
49
51
  case '--account-id': options.accountId = args[++i]; break;
50
52
  case '--system-token-app': options.systemTokenApp = args[++i]; break;
53
+ case '--ignore-defaults': options.ignoreDefaults = true; break;
51
54
  case '--json': options.json = true; break;
52
55
  }
53
56
  }
@@ -141,7 +144,9 @@ function mergeLocation(params, location, value) {
141
144
  }
142
145
 
143
146
  function buildTestParams(operation, options = {}) {
144
- const params = buildDefaults(operation);
147
+ const params = options.ignoreDefaults
148
+ ? { path: {}, query: {}, header: {}, body: {} }
149
+ : buildDefaults(operation);
145
150
  const flat = parseJsonObject(options.params, '--params');
146
151
  if (flat) {
147
152
  const schemaLocations = collectSchemaLocations(operation);
@@ -220,10 +225,19 @@ async function run(args) {
220
225
  const systemTokenLocations = collectSystemTokenLocations(operation);
221
226
  const isYidaSystemTokenAction = systemTokenLocations.length > 0;
222
227
  if (options.systemTokenApp || isYidaSystemTokenAction) {
223
- assertNoExplicitSystemToken(operation, {
224
- connectorId: options.connectorId,
225
- actionId: options.actionId,
226
- });
228
+ if (options.ignoreDefaults) {
229
+ // Saved defaults are ignored for this run, so their values (including
230
+ // sensitive placeholders) never reach the request; warn instead of
231
+ // failing closed on definition-level defaults.
232
+ if (hasNonEmptySystemToken(operation)) {
233
+ warn(t('connector_test.ignore_defaults_system_token_warning'));
234
+ }
235
+ } else {
236
+ assertNoExplicitSystemToken(operation, {
237
+ connectorId: options.connectorId,
238
+ actionId: options.actionId,
239
+ });
240
+ }
227
241
  assertTrustedYidaSystemTokenTarget(detail, operation);
228
242
  }
229
243
  const requiresAuth = connectorRequiresAuth(detail.securitySchemes);
@@ -190,7 +190,9 @@ function buildConnectorTestPayload(params) {
190
190
  payload.connection = connection;
191
191
  }
192
192
  if (method !== 'get' && method !== 'delete') {
193
- payload.body = params.body || {};
193
+ payload.body = typeof params.body === 'string'
194
+ ? params.body
195
+ : JSON.stringify(params.body || {});
194
196
  }
195
197
  return payload;
196
198
  }
@@ -1389,7 +1389,7 @@ const COMMAND_GROUPS = [
1389
1389
  command('connector.update-action', ['connector', 'update-action'], 'connector update-action --connector-id <id> --action <operationId> --query-json JSON --confirm', 'help.cmd_connector_update_action'),
1390
1390
  command('connector.list-actions', ['connector', 'list-actions'], 'connector list-actions <id>', 'help.cmd_connector_list_actions'),
1391
1391
  command('connector.delete-action', ['connector', 'delete-action'], 'connector delete-action <id> <operation-id>', 'help.cmd_connector_delete_action'),
1392
- command('connector.test', ['connector', 'test'], 'connector test --connector-id <id> --action <actionId> [--path-json JSON] [--query-json JSON] [--header-json JSON] [--body-json JSON] [--account-id <id>] [--system-token-app <appType>]', 'help.cmd_connector_test'),
1392
+ command('connector.test', ['connector', 'test'], 'connector test --connector-id <id> --action <actionId> [--path-json JSON] [--query-json JSON] [--header-json JSON] [--body-json JSON] [--account-id <id>] [--system-token-app <appType>] [--ignore-defaults]', 'help.cmd_connector_test'),
1393
1393
  command('connector.list-connections', ['connector', 'list-connections'], 'connector list-connections <id>', 'help.cmd_connector_list_connections'),
1394
1394
  command('connector.create-connection', ['connector', 'create-connection'], 'connector create-connection <id> <name> [--interactive]', 'help.cmd_connector_create_connection'),
1395
1395
  command('connector.smart-create', ['connector', 'smart-create'], 'connector smart-create --curl "..."', 'help.cmd_connector_smart'),
@@ -1990,7 +1990,8 @@ Object.assign(module.exports.create_process || (module.exports.create_process =
1990
1990
  login_required: 'No valid Yida login session was found. Run openyida login first.',
1991
1991
  });
1992
1992
  module.exports.connector_test = {
1993
- usage: 'Usage: openyida connector test --connector-id <id> --action <actionId> [--params <json>] [--path-json <json>] [--query-json <json>] [--header-json <json>] [--body-json <json>] [--account-id <id>] [--system-token-app <appType>] [--json]',
1993
+ usage: 'Usage: openyida connector test --connector-id <id> --action <actionId> [--params <json>] [--path-json <json>] [--query-json <json>] [--header-json <json>] [--body-json <json>] [--account-id <id>] [--system-token-app <appType>] [--ignore-defaults] [--json]',
1994
+ ignore_defaults_system_token_warning: 'Saved default parameter values are ignored via --ignore-defaults (they contain a non-empty systemToken and are not used in this run); clean up the action defaults in the designer before production use.',
1994
1995
  invalid_json: '{0} is not valid JSON: {1}',
1995
1996
  json_object_required: '{0} must be a JSON object',
1996
1997
  unknown_flat_param: 'Parameter {0} is not in the action schema; use the matching structured JSON option',
@@ -1944,7 +1944,8 @@ Object.assign(module.exports.create_process || (module.exports.create_process =
1944
1944
  login_required: '未获取到有效宜搭登录态,请先执行 openyida login。',
1945
1945
  });
1946
1946
  module.exports.connector_test = {
1947
- usage: '用法: openyida connector test --connector-id <id> --action <actionId> [--params <json>] [--path-json <json>] [--query-json <json>] [--header-json <json>] [--body-json <json>] [--account-id <id>] [--system-token-app <appType>] [--json]',
1947
+ usage: '用法: openyida connector test --connector-id <id> --action <actionId> [--params <json>] [--path-json <json>] [--query-json <json>] [--header-json <json>] [--body-json <json>] [--account-id <id>] [--system-token-app <appType>] [--ignore-defaults] [--json]',
1948
+ ignore_defaults_system_token_warning: '已按 --ignore-defaults 忽略动作保存的默认参数值(其中包含非空 systemToken,本次请求不会使用);生产使用前请先在设计器清理默认值。',
1948
1949
  invalid_json: '{0} 不是合法 JSON: {1}',
1949
1950
  json_object_required: '{0} 必须是 JSON 对象',
1950
1951
  unknown_flat_param: '参数 {0} 不在动作 Schema 中;请改用对应的结构化 JSON 参数',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openyida",
3
- "version": "2026.9.16-2",
3
+ "version": "2026.9.17",
4
4
  "description": "OpenYida CLI - 宜搭低代码 AI 开发工具(安装即用,零配置)",
5
5
  "bin": {
6
6
  "openyida": "bin/yida.js",