@lovrabet/rabetbase-cli 2.3.7-beta.1 → 2.3.7-beta.3
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/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -0
- package/lib/commands/db/analyze-batch-plan.js +1 -0
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a53_0x3e90ba=a53_0x51d2;function a53_0x1421(){const _0x7c2b98=['\x20app\x20add\x20<name>\x20--appcode\x20','key','Write\x20to\x20global\x20config\x20(~/.rabetbase.json)','apps','global','5974835dVokXo','\x20set\x20to:\x20','305431EanvoR','app','\x20(stored\x20as\x20apps\x20+\x20defaultApp)','riskLevel','locale','Settable\x20top-level\x20keys:\x20','validation','Config\x20value\x20is\x20invalid\x20or\x20too\x20long.','includes','\x20workspace\x20use\x20--app\x20<name>`,\x20or\x20pass\x20`--appcode`\x20on\x20the\x20command.','Missing\x20key.','\x20appcode\x20set\x20to:\x20','set','keys','config','398947MWZsGt','Project','Usage:\x20','boolean','2mzWCzA','string','value','692964yYjPQx','Invalid\x20value\x20for\x20\x22','length','2248815qNaMcY','Global','write','42ZLMwQJ','Invalid\x20value\x20for\x20env.\x20Allowed:\x20production,\x20daily.','str','join','Use\x20`','137528VlfMRM','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>','Legacy\x20alias\x20\x22online\x22\x20is\x20accepted\x20and\x20stored\x20as\x20production.','`,\x20`','Cannot\x20set\x20top-level\x20\x22appcode\x22\x20when\x20multi-app\x20config\x20already\x20exists.','Invalid\x20locale\x20value.','appcode','\x22.\x20Allowed:\x20','bool','24093IvixQN','1730xyBlnt','env'];a53_0x1421=function(){return _0x7c2b98;};return a53_0x1421();}function a53_0x51d2(_0x5cf05d,_0x149242){_0x5cf05d=_0x5cf05d-0x10d;const _0x1421d2=a53_0x1421();let _0x51d295=_0x1421d2[_0x5cf05d];return _0x51d295;}(function(_0x59e9c4,_0x121eb8){const _0x296d5d=a53_0x51d2,_0xc21988=_0x59e9c4();while(!![]){try{const _0x188a6c=-parseInt(_0x296d5d(0x123))/0x1*(-parseInt(_0x296d5d(0x127))/0x2)+-parseInt(_0x296d5d(0x12d))/0x3+parseInt(_0x296d5d(0x12a))/0x4+parseInt(_0x296d5d(0x112))/0x5+parseInt(_0x296d5d(0x130))/0x6*(parseInt(_0x296d5d(0x114))/0x7)+-parseInt(_0x296d5d(0x135))/0x8+-parseInt(_0x296d5d(0x13f))/0x9*(parseInt(_0x296d5d(0x140))/0xa);if(_0x188a6c===_0x121eb8)break;else _0xc21988['push'](_0xc21988['shift']());}catch(_0x1f9cce){_0xc21988['push'](_0xc21988['shift']());}}}(a53_0x1421,0xcdbad));import{CliErrors}from'../../errors.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';import{CLI_BIN_NAME,CONFIG_ENUM_VALUES,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale,resolveWriteScope,readScopedConfig,writeScopedConfig}from'../../commands/config/shared.js';import{normalizeEnv,isProduction,isDaily}from'../../constant/env.js';async function execute(_0x16ff6c){const _0x117578=a53_0x51d2,_0x3eb29d=_0x16ff6c['str'](_0x117578(0x10e)),_0x4db96d=_0x16ff6c[_0x117578(0x132)](_0x117578(0x129));if(!_0x3eb29d)throw CliErrors['validation'](_0x117578(0x11e),_0x117578(0x125)+CLI_BIN_NAME+'\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>');if(_0x4db96d===undefined||_0x4db96d==='')throw CliErrors[_0x117578(0x11a)]('Missing\x20value.',_0x117578(0x125)+CLI_BIN_NAME+_0x117578(0x137));if(_0x4db96d[_0x117578(0x12c)]>0x1f4)throw CliErrors[_0x117578(0x11a)](_0x117578(0x11b));if(!isTopLevelConfigKey(_0x3eb29d))throw CliErrors[_0x117578(0x11a)]('Top-level\x20key\x20\x22'+_0x3eb29d+'\x22\x20is\x20not\x20settable.',_0x117578(0x119)+getTopLevelConfigKeySummary());if(_0x3eb29d===_0x117578(0x117))throw CliErrors[_0x117578(0x11a)](_0x117578(0x136));if(CONFIG_ENUM_VALUES[_0x3eb29d]&&!CONFIG_ENUM_VALUES[_0x3eb29d][_0x117578(0x11c)](_0x4db96d))throw CliErrors[_0x117578(0x11a)](_0x117578(0x12b)+_0x3eb29d+_0x117578(0x13d)+CONFIG_ENUM_VALUES[_0x3eb29d][_0x117578(0x133)](',\x20'));if(_0x3eb29d===_0x117578(0x118)&&!normalizeLocale(_0x4db96d))throw CliErrors[_0x117578(0x11a)](_0x117578(0x13b),'Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US');const _0x49a9ff={'global':_0x16ff6c[_0x117578(0x13e)](_0x117578(0x111))},_0x440900=resolveWriteScope(_0x49a9ff),_0x58622e=readScopedConfig(_0x440900);let _0x4ae1b7=_0x3eb29d,_0x3aeb9c=_0x4db96d;_0x3eb29d===_0x117578(0x115)&&(_0x4ae1b7='appcode',delete _0x58622e['app']);_0x3eb29d===_0x117578(0x118)&&(_0x3aeb9c=normalizeLocale(_0x4db96d));if(_0x3eb29d===_0x117578(0x141)){_0x3aeb9c=normalizeEnv(_0x4db96d);if(!isProduction(_0x3aeb9c)&&!isDaily(_0x3aeb9c))throw CliErrors[_0x117578(0x11a)](_0x117578(0x131),_0x117578(0x138));}if(_0x3eb29d===_0x117578(0x13c)){const _0x56d971=_0x58622e[_0x117578(0x110)]&&typeof _0x58622e[_0x117578(0x110)]==='object'?Object[_0x117578(0x121)](_0x58622e[_0x117578(0x110)]):[];if(_0x56d971[_0x117578(0x12c)]>0x0)throw CliErrors[_0x117578(0x11a)](_0x117578(0x13a),_0x117578(0x134)+CLI_BIN_NAME+_0x117578(0x10d)+_0x3aeb9c+_0x117578(0x139)+CLI_BIN_NAME+_0x117578(0x11d));const _0x2e570b=buildCanonicalProjectConfig({..._0x58622e},{'appCodes':[_0x3aeb9c],'env':typeof _0x58622e[_0x117578(0x141)]===_0x117578(0x128)?_0x58622e[_0x117578(0x141)]:undefined});writeScopedConfig(_0x2e570b,_0x440900);const _0x396fa7=_0x440900===_0x117578(0x111)?'Global':'Project';return{'ok':!![],'message':'✓\x20'+_0x396fa7+_0x117578(0x11f)+_0x3aeb9c+_0x117578(0x116)};}_0x58622e[_0x4ae1b7]=_0x3aeb9c,writeScopedConfig(_0x58622e,_0x440900);const _0x346f27=_0x440900===_0x117578(0x111)?_0x117578(0x12e):_0x117578(0x124);return{'ok':!![],'message':'✓\x20'+_0x346f27+'\x20'+_0x4ae1b7+_0x117578(0x113)+_0x3aeb9c};}export const configSetDefinition={'service':a53_0x3e90ba(0x122),'command':a53_0x3e90ba(0x120),'description':'Set\x20a\x20config\x20value','risk':a53_0x3e90ba(0x12f),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a53_0x3e90ba(0x10e),'type':a53_0x3e90ba(0x128),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':'value','type':a53_0x3e90ba(0x128),'description':'Config\x20value','required':!![]},{'name':'global','type':a53_0x3e90ba(0x126),'description':a53_0x3e90ba(0x10f),'default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x350583,_0x30fc7c){var _0x4803cb=a54_0x4796,_0x345f92=_0x350583();while(!![]){try{var _0x31c6fc=parseInt(_0x4803cb(0x16e))/0x1*(-parseInt(_0x4803cb(0x173))/0x2)+parseInt(_0x4803cb(0x167))/0x3*(-parseInt(_0x4803cb(0x164))/0x4)+parseInt(_0x4803cb(0x171))/0x5+-parseInt(_0x4803cb(0x170))/0x6*(-parseInt(_0x4803cb(0x169))/0x7)+parseInt(_0x4803cb(0x16c))/0x8+parseInt(_0x4803cb(0x168))/0x9*(-parseInt(_0x4803cb(0x165))/0xa)+parseInt(_0x4803cb(0x16d))/0xb;if(_0x31c6fc===_0x30fc7c)break;else _0x345f92['push'](_0x345f92['shift']());}catch(_0x466bab){_0x345f92['push'](_0x345f92['shift']());}}}(a54_0x424f,0x3c92a));import{CLI_BIN_NAME}from'../../constant/cli.js';import{isInProject,resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';import{CliErrors}from'../../errors.js';import{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale}from'../../config/schema.js';export{CLI_BIN_NAME};export{normalizeLocale};export{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey};function a54_0x424f(){var _0x565fe8=['1094570FjsTpG','Add\x20--global\x20to\x20write\x20to\x20~/.rabetbase.json,\x20or\x20run\x20`','4530xhjsFp','18GINYec','74571WPXRId','global','\x20init`\x20first.','2051920tydiwJ','584760FqFxWG','1ZshyRa','Not\x20inside\x20a\x20project\x20(no\x20.rabetbase.json\x20found).','204lwINaj','1321295FIqhov','project','808322Rjhdju','validation','172YeqPGv'];a54_0x424f=function(){return _0x565fe8;};return a54_0x424f();}export function resolveWriteScope(_0x2352b5){var _0x31903f=a54_0x4796;if(_0x2352b5[_0x31903f(0x16a)])return _0x31903f(0x16a);if(!isInProject())throw CliErrors[_0x31903f(0x174)](_0x31903f(0x16f),_0x31903f(0x166)+CLI_BIN_NAME+_0x31903f(0x16b));return _0x31903f(0x172);}export function readScopedConfig(_0x2861a1){return readConfigFile(resolveWriteConfigPath(_0x2861a1));}function a54_0x4796(_0x203dd1,_0x17266c){_0x203dd1=_0x203dd1-0x164;var _0x424f77=a54_0x424f();var _0x479666=_0x424f77[_0x203dd1];return _0x479666;}export function writeScopedConfig(_0x1c68d0,_0x56fccf){writeConfigFile(resolveWriteConfigPath(_0x56fccf),_0x1c68d0);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a55_0x1dd0(_0x4f53b9,_0x111164){_0x4f53b9=_0x4f53b9-0x179;const _0x53a9e=a55_0x53a9();let _0x1dd09f=_0x53a9e[_0x4f53b9];return _0x1dd09f;}const a55_0x89a866=a55_0x1dd0;(function(_0x6dd28,_0x3927d9){const _0x4a8806=a55_0x1dd0,_0xfcc1b=_0x6dd28();while(!![]){try{const _0x3492ce=-parseInt(_0x4a8806(0x188))/0x1+-parseInt(_0x4a8806(0x181))/0x2*(-parseInt(_0x4a8806(0x186))/0x3)+parseInt(_0x4a8806(0x17e))/0x4*(-parseInt(_0x4a8806(0x185))/0x5)+parseInt(_0x4a8806(0x182))/0x6+parseInt(_0x4a8806(0x17a))/0x7+parseInt(_0x4a8806(0x180))/0x8+parseInt(_0x4a8806(0x187))/0x9*(parseInt(_0x4a8806(0x17b))/0xa);if(_0x3492ce===_0x3927d9)break;else _0xfcc1b['push'](_0xfcc1b['shift']());}catch(_0x5a748a){_0xfcc1b['push'](_0xfcc1b['shift']());}}}(a55_0x53a9,0x19452));import{buildDataCommand}from'../../commands/data/shared.js';function a55_0x53a9(){const _0x6e38a2=['2FSeHdn','365676FOeqMt','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','851785wTvwjA','3177KasiJi','1815876KKrplI','202880TWXyvw','Filter\x20dataset\x20records\x20with\x20query\x20conditions','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','1416863EpUABi','10NufkZG','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','filter','4KZbSbX','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page','84520hSBzyE'];a55_0x53a9=function(){return _0x6e38a2;};return a55_0x53a9();}export const dataFilter=buildDataCommand({'command':a55_0x89a866(0x17d),'operation':a55_0x89a866(0x17d),'description':a55_0x89a866(0x189),'paramsRequired':![],'paramsHint':a55_0x89a866(0x183),'helpExtra':[a55_0x89a866(0x179),a55_0x89a866(0x18b),a55_0x89a866(0x17c),a55_0x89a866(0x184),a55_0x89a866(0x18a),a55_0x89a866(0x17f)]['join']('\x0a')});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a56_0xee60(_0x48ed66,_0x101ced){_0x48ed66=_0x48ed66-0x132;const _0x1e1967=a56_0x1e19();let _0xee6029=_0x1e1967[_0x48ed66];return _0xee6029;}const a56_0x484ed7=a56_0xee60;function a56_0x1e19(){const _0x40f290=['7654149HGxVvq','4841459LmHgGl','10894728KyWEsY','6cJAyuQ','645mnKQIg','9552JYaiky','560318lhWzat','363778upnsoJ','Get\x20a\x20single\x20record\x20by\x20ID','getOne','2057157FjyQjs'];a56_0x1e19=function(){return _0x40f290;};return a56_0x1e19();}(function(_0x2d59c6,_0x2bee58){const _0x7c3abb=a56_0xee60,_0x5d662b=_0x2d59c6();while(!![]){try{const _0x48b02a=-parseInt(_0x7c3abb(0x139))/0x1+parseInt(_0x7c3abb(0x138))/0x2+parseInt(_0x7c3abb(0x13c))/0x3+-parseInt(_0x7c3abb(0x137))/0x4*(-parseInt(_0x7c3abb(0x136))/0x5)+parseInt(_0x7c3abb(0x135))/0x6*(-parseInt(_0x7c3abb(0x133))/0x7)+parseInt(_0x7c3abb(0x134))/0x8+-parseInt(_0x7c3abb(0x132))/0x9;if(_0x48b02a===_0x2bee58)break;else _0x5d662b['push'](_0x5d662b['shift']());}catch(_0x9cda03){_0x5d662b['push'](_0x5d662b['shift']());}}}(a56_0x1e19,0xb2327));import{buildDataCommand}from'../../commands/data/shared.js';export const dataGetOne=buildDataCommand({'command':a56_0x484ed7(0x13b),'operation':a56_0x484ed7(0x13b),'description':a56_0x484ed7(0x13a),'paramsRequired':!![],'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a57_0x3186(_0x159e56,_0x446c6d){_0x159e56=_0x159e56-0x173;const _0x2ec580=a57_0x2ec5();let _0x31869e=_0x2ec580[_0x159e56];return _0x31869e;}(function(_0x373bfc,_0x4b1d44){const _0x2fd5af=a57_0x3186,_0x23a868=_0x373bfc();while(!![]){try{const _0x133585=-parseInt(_0x2fd5af(0x179))/0x1+-parseInt(_0x2fd5af(0x17a))/0x2+parseInt(_0x2fd5af(0x17c))/0x3*(parseInt(_0x2fd5af(0x177))/0x4)+-parseInt(_0x2fd5af(0x178))/0x5*(-parseInt(_0x2fd5af(0x174))/0x6)+parseInt(_0x2fd5af(0x175))/0x7+parseInt(_0x2fd5af(0x17b))/0x8*(parseInt(_0x2fd5af(0x173))/0x9)+-parseInt(_0x2fd5af(0x176))/0xa;if(_0x133585===_0x4b1d44)break;else _0x23a868['push'](_0x23a868['shift']());}catch(_0x52493a){_0x23a868['push'](_0x23a868['shift']());}}}(a57_0x2ec5,0x4da0b));import{dataFilter}from'../../commands/data/filter.js';import{dataGetOne}from'../../commands/data/getOne.js';export const dataDefinitions=[dataFilter,dataGetOne];function a57_0x2ec5(){const _0xe2fd33=['2571SaUoYc','9lBFrep','12UropEP','2773470LEnzAO','10486700HUrbEW','2788XdvgRg','828805iBoVLD','45405FaXTwm','496592aZZqOE','2682184PoDVvQ'];a57_0x2ec5=function(){return _0xe2fd33;};return a57_0x2ec5();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a58_0x2c0f(_0x119617,_0x48c996){_0x119617=_0x119617-0x1be;const _0xd9f826=a58_0xd9f8();let _0x2c0fd8=_0xd9f826[_0x119617];return _0x2c0fd8;}(function(_0x202b62,_0x514865){const _0x12ba76=a58_0x2c0f,_0x1f2898=_0x202b62();while(!![]){try{const _0x43c28f=-parseInt(_0x12ba76(0x1c4))/0x1*(parseInt(_0x12ba76(0x1dc))/0x2)+parseInt(_0x12ba76(0x1d8))/0x3*(parseInt(_0x12ba76(0x1d7))/0x4)+parseInt(_0x12ba76(0x1c7))/0x5+-parseInt(_0x12ba76(0x1c3))/0x6*(-parseInt(_0x12ba76(0x1d3))/0x7)+-parseInt(_0x12ba76(0x1c6))/0x8*(parseInt(_0x12ba76(0x1d5))/0x9)+parseInt(_0x12ba76(0x1c0))/0xa*(parseInt(_0x12ba76(0x1cc))/0xb)+-parseInt(_0x12ba76(0x1c5))/0xc;if(_0x43c28f===_0x514865)break;else _0x1f2898['push'](_0x1f2898['shift']());}catch(_0x541eb9){_0x1f2898['push'](_0x1f2898['shift']());}}}(a58_0xd9f8,0x71c4b));import{executeDatasetDataOperation}from'../../core/api-client.js';import{CODE_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{parseJsonParams}from'../../utils/params.js';function assertGetOneId(_0x492521){const _0x155e75=a58_0x2c0f;if(!_0x492521)throw CliErrors[_0x155e75(0x1d1)](_0x155e75(0x1cf),_0x155e75(0x1be));const _0x4b99ab=_0x492521['id'];if(_0x4b99ab===undefined||_0x4b99ab===null||_0x4b99ab==='')throw CliErrors['validation']('data\x20getOne\x20requires\x20\x22id\x22\x20in\x20--params',_0x155e75(0x1bf));}function parseCommandParams(_0x40efc1){return parseJsonParams(_0x40efc1)??{};}export function buildDataCommand(_0x4daeb2){const _0x15841a=a58_0x2c0f,_0x522067=_0x15841a(0x1c2);return{'service':_0x15841a(0x1d9),'command':_0x4daeb2[_0x15841a(0x1c9)],'description':_0x4daeb2[_0x15841a(0x1ce)],'risk':_0x15841a(0x1d0),'defaultOutputFormat':_0x15841a(0x1da),'helpExtra':_0x4daeb2['helpExtra'],'flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':'alias','type':_0x15841a(0x1db),'description':_0x522067},{'name':_0x15841a(0x1cf),'type':'string','description':_0x4daeb2['paramsHint']}],async 'validate'(_0xfef365){const _0x244cfe=_0x15841a,_0x2759c2=_0xfef365[_0x244cfe(0x1d4)](_0x244cfe(0x1cf));if(_0x4daeb2[_0x244cfe(0x1c8)]&&!_0x2759c2)throw CliErrors[_0x244cfe(0x1d1)](_0x244cfe(0x1cf),_0x4daeb2['paramsHint']);const _0x415f38=parseJsonParams(_0x2759c2);_0x4daeb2['operation']===_0x244cfe(0x1cd)&&assertGetOneId(_0x415f38);},async 'execute'(_0xac4222){const _0x4500e4=_0x15841a,_0x5b6b50=parseCommandParams(_0xac4222[_0x4500e4(0x1d4)](_0x4500e4(0x1cf))),_0x49dfda=Date[_0x4500e4(0x1cb)](),_0x3b7f0a=await executeDatasetDataOperation(_0xac4222[_0x4500e4(0x1d6)],_0xac4222[_0x4500e4(0x1d4)]('code'),_0x4daeb2[_0x4500e4(0x1ca)],_0x5b6b50),_0x12abd6=Date[_0x4500e4(0x1cb)]()-_0x49dfda;return{'ok':!![],'data':{'result':_0x3b7f0a,'elapsed':_0x12abd6},'message':_0x4500e4(0x1c1)+_0x4daeb2['command']+_0x4500e4(0x1d2)+_0x12abd6+'ms'};}};}function a58_0xd9f8(){const _0x5ecfda=['params','read','flagMissing','\x20completed\x20in\x20','5894tOCvuo','str','45vfTIQU','appCode','4040qLwneG','45bekJym','data','compress','string','4OEjdbR','Provide\x20--params\x20\x27{\x22id\x22:123}\x27\x20for\x20data\x20getOne.','Example:\x20--params\x20\x27{\x22id\x22:123}\x27','4748630adLXlH','data\x20','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically','5784zqZNWi','171867qLCiEU','1358772JiFMXX','685288WOXRkT','247820mhEGzR','paramsRequired','command','operation','now','11zjSukG','getOne','description'];a58_0xd9f8=function(){return _0x5ecfda;};return a58_0xd9f8();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a59_0xc4451c=a59_0x112f;(function(_0x479b73,_0x216a83){const _0x39d5d6=a59_0x112f,_0x15d312=_0x479b73();while(!![]){try{const _0x5b1b9e=parseInt(_0x39d5d6(0x1c3))/0x1*(parseInt(_0x39d5d6(0x1a9))/0x2)+-parseInt(_0x39d5d6(0x1c5))/0x3+parseInt(_0x39d5d6(0x1a3))/0x4+parseInt(_0x39d5d6(0x1b0))/0x5+parseInt(_0x39d5d6(0x1a7))/0x6+-parseInt(_0x39d5d6(0x1bd))/0x7+-parseInt(_0x39d5d6(0x1e2))/0x8;if(_0x5b1b9e===_0x216a83)break;else _0x15d312['push'](_0x15d312['shift']());}catch(_0xeebf97){_0x15d312['push'](_0x15d312['shift']());}}}(a59_0x4cd4,0xef471));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateErBusinessGroup}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const BACKEND_PATH=a59_0xc4451c(0x1b2);export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x2944b4,input:_0x52b72a,dryRun:_0x5134a9}){const _0x261978=a59_0xc4451c;validateInput(_0x52b72a);const _0x31eba9=normalizeBusinessGroup(_0x52b72a[_0x261978(0x1bf)]),_0x30bfbe=await getDatasetDetail(_0x52b72a['code']),_0x3d3033=resolveBusinessGroupDataset(_0x30bfbe,_0x52b72a['code']),_0x4379dc=loadCurrentBusinessGroup(_0x30bfbe,_0x3d3033);assertExpectedBusinessGroup(_0x4379dc,_0x52b72a[_0x261978(0x1ca)]);const _0x30419e=buildBackendPayload(_0x2944b4,_0x3d3033,_0x31eba9),_0x2cae7c=_0x4379dc!==_0x31eba9;let _0x379d86;if(_0x2cae7c&&!_0x5134a9){await updateErBusinessGroup(_0x30419e);const _0x50f740=await getDatasetDetail(_0x3d3033[_0x261978(0x1d2)]),_0x2ab709=resolveBusinessGroupDataset(_0x50f740,_0x3d3033[_0x261978(0x1d2)]),_0x4972e2=loadCurrentBusinessGroup(_0x50f740,_0x2ab709);if(_0x4972e2!==_0x31eba9)throw CliErrors[_0x261978(0x1b1)](_0x261978(0x1c4),'Expected\x20'+JSON['stringify'](_0x31eba9)+',\x20actual\x20'+JSON[_0x261978(0x1b7)](_0x4972e2)+'.');_0x379d86={'verified':!![],'status':_0x261978(0x1cb),'afterReadback':{'businessGroup':_0x4972e2}};}else!_0x2cae7c&&(_0x379d86={'verified':!![],'status':_0x261978(0x1ba),'afterReadback':{'businessGroup':_0x4379dc}});const _0x1e5cd4={'operation':_0x261978(0x1b9),'appCode':_0x2944b4,'selector':{'code':_0x3d3033[_0x261978(0x1d2)]},'dataset':_0x3d3033,'before':{'businessGroup':_0x4379dc},'after':{'businessGroup':_0x31eba9},'changed':_0x2cae7c,'dryRun':_0x5134a9,'submitted':_0x2cae7c&&!_0x5134a9,'backend':{'method':'POST','path':BACKEND_PATH,'payload':_0x30419e},..._0x379d86?{'verification':_0x379d86}:{},'warnings':[]};return{'ok':!![],'data':_0x1e5cd4,'message':_0x2cae7c?_0x5134a9?_0x261978(0x1bb)+_0x3d3033[_0x261978(0x1d2)]:_0x261978(0x1df)+_0x3d3033['code']:_0x261978(0x1de)+_0x3d3033[_0x261978(0x1d2)]};}export const datasetBusinessGroupUpdate={'service':a59_0xc4451c(0x1b8),'command':a59_0xc4451c(0x1a1),'description':'Update\x20business\x20model\x20group','risk':a59_0xc4451c(0x1c1),'flags':[CODE_FLAG,{'name':a59_0xc4451c(0x1d8),'type':a59_0xc4451c(0x1db),'required':!![],'description':a59_0xc4451c(0x1d3)},{'name':a59_0xc4451c(0x1c8),'type':a59_0xc4451c(0x1db),'required':![],'description':a59_0xc4451c(0x1c2)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x53ab2){validateInput(readBusinessGroupUpdateInput(_0x53ab2));},async 'dryRun'(_0x4f9f33){const _0x1c17d0=a59_0xc4451c,_0x1f4f7b=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x4f9f33[_0x1c17d0(0x1a8)],'input':readBusinessGroupUpdateInput(_0x4f9f33),'dryRun':!![]});return{'method':_0x1c17d0(0x1dd),'url':BACKEND_PATH,'body':_0x1f4f7b[_0x1c17d0(0x1ac)][_0x1c17d0(0x1e1)][_0x1c17d0(0x1da)],'description':_0x1f4f7b['message'],..._0x1f4f7b['data']};},async 'execute'(_0x24cd63){const _0x46c035=a59_0xc4451c;return buildDatasetBusinessGroupUpdateResult({'appCode':_0x24cd63[_0x46c035(0x1a8)],'input':readBusinessGroupUpdateInput(_0x24cd63),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x1067a0){const _0x5a2014=a59_0xc4451c,_0x54355c=_0x1067a0[_0x5a2014(0x1e0)](_0x5a2014(0x1c8));return{'code':trim(_0x1067a0[_0x5a2014(0x1e0)](_0x5a2014(0x1d2))),'businessGroup':_0x1067a0['str'](_0x5a2014(0x1d8)),'expectBusinessGroup':_0x54355c===undefined||_0x54355c===''?undefined:_0x54355c};}function validateInput(_0xfa0d6e){const _0x3ddbc5=a59_0xc4451c;if(!trim(_0xfa0d6e[_0x3ddbc5(0x1d2)]))throw CliErrors[_0x3ddbc5(0x1d4)]('--code\x20is\x20required');if(_0xfa0d6e[_0x3ddbc5(0x1bf)]===undefined)throw CliErrors[_0x3ddbc5(0x1d4)](_0x3ddbc5(0x1d7));}function resolveBusinessGroupDataset(_0x51ae09,_0x2672c3){const _0x149338=a59_0xc4451c,_0x2b5744=asPlainObject(_0x51ae09[_0x149338(0x1b8)]),_0x72a357=asPlainObject(_0x51ae09[_0x149338(0x1a5)]),_0x1ba109=resolveSourceType(_0x51ae09,_0x2b5744,_0x72a357),_0xeb49=firstString(_0x51ae09[_0x149338(0x1d9)],_0x51ae09[_0x149338(0x1d2)],_0x2b5744[_0x149338(0x1c7)],_0x2672c3)||_0x2672c3;return{'id':firstNumber(_0x51ae09[_0x149338(0x1cd)],_0x51ae09['id'],_0x2b5744[_0x149338(0x1af)])??firstString(_0x51ae09['modelId'],_0x51ae09['id'],_0x2b5744[_0x149338(0x1af)])??null,'code':_0xeb49,'name':firstString(_0x51ae09[_0x149338(0x1b3)],_0x2b5744[_0x149338(0x1aa)],_0x2b5744[_0x149338(0x1b3)])||null,'sourceType':_0x1ba109};}function resolveSourceType(_0x42e825,_0x29ddc0,_0x2d80a7){const _0x227cd9=a59_0xc4451c,_0x3224bc=firstString(_0x42e825[_0x227cd9(0x1c0)],_0x42e825[_0x227cd9(0x1a4)],_0x29ddc0[_0x227cd9(0x1c0)],_0x29ddc0['sourceType'])?.['trim']()[_0x227cd9(0x1bc)]();if(_0x3224bc===_0x227cd9(0x1ad)||_0x3224bc===_0x227cd9(0x1be))return _0x3224bc;if(Object[_0x227cd9(0x1cf)](_0x2d80a7)[_0x227cd9(0x1d6)]>0x0)return'DB_TABLE';throw CliErrors[_0x227cd9(0x1d4)](_0x227cd9(0x1d0));}function loadCurrentBusinessGroup(_0x37f211,_0x547a55){const _0x59a6b8=a59_0xc4451c,_0x3e0e87=readBusinessGroupFromDatasetDetail(_0x37f211,_0x547a55['sourceType']);if(_0x3e0e87['found'])return normalizeBusinessGroup(_0x3e0e87['value']);if(_0x547a55[_0x59a6b8(0x1a4)]===_0x59a6b8(0x1be))return'';throw CliErrors[_0x59a6b8(0x1d4)](_0x59a6b8(0x1a6),_0x59a6b8(0x1b5));}function readBusinessGroupFromDatasetDetail(_0x3f537f,_0x21c31d){const _0x3ed4e3=a59_0xc4451c,_0x419a7f=asPlainObject(_0x3f537f[_0x3ed4e3(0x1b8)]),_0x53e17a=firstPresent(_0x3f537f[_0x3ed4e3(0x1bf)]);if(_0x53e17a[_0x3ed4e3(0x1c9)])return _0x53e17a;const _0x423d03=firstPresent(_0x419a7f['businessGroup']);if(_0x423d03[_0x3ed4e3(0x1c9)])return _0x423d03;if(_0x21c31d===_0x3ed4e3(0x1ad))return{'found':![]};const _0x551cd5=readBusinessGroupFromExtend(_0x3f537f[_0x3ed4e3(0x1a2)]);if(_0x551cd5['found'])return _0x551cd5;return readBusinessGroupFromExtend(_0x419a7f[_0x3ed4e3(0x1a2)]);}function readBusinessGroupFromExtend(_0x5e1411){const _0x33dc17=a59_0xc4451c;if(_0x5e1411===undefined||_0x5e1411===null||_0x5e1411==='')return{'found':![]};if(typeof _0x5e1411===_0x33dc17(0x1db))try{const _0x31ee28=JSON['parse'](_0x5e1411);return readBusinessGroupFromExtend(_0x31ee28);}catch{return{'found':![]};}const _0x2ae931=asPlainObject(_0x5e1411);if(Object[_0x33dc17(0x1d5)][_0x33dc17(0x1b6)][_0x33dc17(0x1ab)](_0x2ae931,_0x33dc17(0x1bf)))return{'found':!![],'value':_0x2ae931['businessGroup']};return{'found':![]};}function firstPresent(..._0x2bfbdd){for(const _0x547ce6 of _0x2bfbdd){if(_0x547ce6!==undefined&&_0x547ce6!==null)return{'found':!![],'value':_0x547ce6};}return{'found':![]};}function assertExpectedBusinessGroup(_0x179bf0,_0x38757a){const _0x4b0a1a=a59_0xc4451c;if(_0x38757a===undefined)return;const _0x1e9fb8=normalizeBusinessGroup(_0x38757a);if(_0x179bf0!==_0x1e9fb8)throw CliErrors['validation'](_0x4b0a1a(0x1b4),_0x4b0a1a(0x1c6)+JSON['stringify'](_0x1e9fb8)+',\x20actual\x20'+JSON['stringify'](_0x179bf0));}function buildBackendPayload(_0x55c4bb,_0x28ff1c,_0x9ef7f5){const _0x306525=a59_0xc4451c;return{'appCode':_0x55c4bb,'datasetCode':_0x28ff1c[_0x306525(0x1d2)],'businessGroup':_0x9ef7f5};}function normalizeBusinessGroup(_0x40ba78){const _0x32f0da=a59_0xc4451c;if(_0x40ba78===undefined||_0x40ba78===null)return'';return String(_0x40ba78)[_0x32f0da(0x1ae)]();}function a59_0x4cd4(){const _0x23e250=['Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.','isArray','code','New\x20business\x20model\x20group\x20value;\x20empty\x20string\x20clears\x20it','validation','prototype','length','--business-group\x20is\x20required','business-group','modelCode','payload','string','number','POST','No\x20changes\x20for\x20business\x20model\x20group\x20on\x20dataset\x20','Updated\x20business\x20model\x20group\x20for\x20dataset\x20','str','backend','14529544eYzkNA','business-group-update','extend','3304156JyuXpA','sourceType','dbtableConfig','Dataset\x20detail\x20does\x20not\x20expose\x20businessGroup.','7112982nYYWza','appCode','2780354DJYiUs','datasetName','call','data','DB_TABLE','trim','datasetId','6822700tSJsNv','apiError','/smartapi/question/er-config/business-group/edit','name','Expectation\x20mismatch\x20at\x20businessGroup','Business\x20model\x20group\x20readback\x20must\x20be\x20available\x20by\x20datasetCode;\x20upgrade\x20the\x20backend\x20read\x20contract\x20instead\x20of\x20using\x20dblinkId/tableName.','hasOwnProperty','stringify','dataset','update','unchanged','Dry-run:\x20business\x20model\x20group\x20would\x20change\x20for\x20dataset\x20','toUpperCase','13344912BiZspG','METADATA','businessGroup','source','write','Expected\x20current\x20business\x20model\x20group;\x20mismatch\x20aborts\x20without\x20writing','1HPILwn','Business\x20model\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','190689liShbd','Expected\x20','datasetCode','expect-business-group','found','expectBusinessGroup','matched','isFinite','modelId','object','keys'];a59_0x4cd4=function(){return _0x23e250;};return a59_0x4cd4();}function asPlainObject(_0x320d5e){const _0x382a81=a59_0xc4451c;if(!_0x320d5e||typeof _0x320d5e!==_0x382a81(0x1ce)||Array[_0x382a81(0x1d1)](_0x320d5e))return{};return _0x320d5e;}function firstString(..._0x3b4cfa){const _0x2ddac2=a59_0xc4451c;for(const _0x2b9a45 of _0x3b4cfa){if(typeof _0x2b9a45===_0x2ddac2(0x1db)&&_0x2b9a45[_0x2ddac2(0x1ae)]())return _0x2b9a45[_0x2ddac2(0x1ae)]();if(typeof _0x2b9a45===_0x2ddac2(0x1dc)&&Number[_0x2ddac2(0x1cc)](_0x2b9a45))return String(_0x2b9a45);}return undefined;}function a59_0x112f(_0x13c678,_0x1b8b92){_0x13c678=_0x13c678-0x1a1;const _0x4cd426=a59_0x4cd4();let _0x112f57=_0x4cd426[_0x13c678];return _0x112f57;}function firstNumber(..._0x6ce0a){const _0x3d4a40=a59_0xc4451c;for(const _0x1cb416 of _0x6ce0a){if(typeof _0x1cb416==='number'&&Number[_0x3d4a40(0x1cc)](_0x1cb416))return _0x1cb416;if(typeof _0x1cb416==='string'&&_0x1cb416[_0x3d4a40(0x1ae)]()&&Number[_0x3d4a40(0x1cc)](Number(_0x1cb416)))return Number(_0x1cb416);}return null;}function trim(_0x5b6db4){const _0x6eeecc=a59_0xc4451c;return String(_0x5b6db4||'')[_0x6eeecc(0x1ae)]();}
|
|
1
|
+
const a59_0x1f6f3c=a59_0x57bb;(function(_0x2cdc30,_0x528364){const _0x55c72f=a59_0x57bb,_0x4eca7c=_0x2cdc30();while(!![]){try{const _0x267922=parseInt(_0x55c72f(0x181))/0x1+parseInt(_0x55c72f(0x18a))/0x2+-parseInt(_0x55c72f(0x16a))/0x3+parseInt(_0x55c72f(0x163))/0x4*(-parseInt(_0x55c72f(0x15d))/0x5)+parseInt(_0x55c72f(0x179))/0x6*(parseInt(_0x55c72f(0x170))/0x7)+-parseInt(_0x55c72f(0x173))/0x8*(parseInt(_0x55c72f(0x160))/0x9)+parseInt(_0x55c72f(0x17b))/0xa*(-parseInt(_0x55c72f(0x158))/0xb);if(_0x267922===_0x528364)break;else _0x4eca7c['push'](_0x4eca7c['shift']());}catch(_0x9fa0f2){_0x4eca7c['push'](_0x4eca7c['shift']());}}}(a59_0x49ed,0x2cb2e));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateErBusinessGroup}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const BACKEND_PATH='/smartapi/question/er-config/business-group/edit';export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x31a1fb,input:_0x218990,dryRun:_0x51b2eb}){const _0x37ec3b=a59_0x57bb;validateInput(_0x218990);const _0x255ef7=normalizeBusinessGroup(_0x218990[_0x37ec3b(0x18c)]),_0x5d3dab=await getDatasetDetail(_0x218990['code']),_0x5a1d6b=resolveBusinessGroupDataset(_0x5d3dab,_0x218990[_0x37ec3b(0x185)]),_0x1ccef1=loadCurrentBusinessGroup(_0x5d3dab,_0x5a1d6b);assertExpectedBusinessGroup(_0x1ccef1,_0x218990[_0x37ec3b(0x18d)]);const _0x3f74d1=buildBackendPayload(_0x31a1fb,_0x5a1d6b,_0x255ef7),_0x20b523=_0x1ccef1!==_0x255ef7;let _0x505e46;if(_0x20b523&&!_0x51b2eb){await updateErBusinessGroup(_0x3f74d1);const _0x59076f=await getDatasetDetail(_0x5a1d6b[_0x37ec3b(0x185)]),_0xece61a=resolveBusinessGroupDataset(_0x59076f,_0x5a1d6b[_0x37ec3b(0x185)]),_0x5ea0de=loadCurrentBusinessGroup(_0x59076f,_0xece61a);if(_0x5ea0de!==_0x255ef7)throw CliErrors[_0x37ec3b(0x18e)](_0x37ec3b(0x187),_0x37ec3b(0x186)+JSON[_0x37ec3b(0x167)](_0x255ef7)+_0x37ec3b(0x180)+JSON['stringify'](_0x5ea0de)+'.');_0x505e46={'verified':!![],'status':'matched','afterReadback':{'businessGroup':_0x5ea0de}};}else!_0x20b523&&(_0x505e46={'verified':!![],'status':_0x37ec3b(0x18f),'afterReadback':{'businessGroup':_0x1ccef1}});const _0x542110={'operation':'update','appCode':_0x31a1fb,'selector':{'code':_0x5a1d6b[_0x37ec3b(0x185)]},'dataset':_0x5a1d6b,'before':{'businessGroup':_0x1ccef1},'after':{'businessGroup':_0x255ef7},'changed':_0x20b523,'dryRun':_0x51b2eb,'submitted':_0x20b523&&!_0x51b2eb,'backend':{'method':_0x37ec3b(0x188),'path':BACKEND_PATH,'payload':_0x3f74d1},..._0x505e46?{'verification':_0x505e46}:{},'warnings':[]};return{'ok':!![],'data':_0x542110,'message':_0x20b523?_0x51b2eb?'Dry-run:\x20business\x20model\x20group\x20would\x20change\x20for\x20dataset\x20'+_0x5a1d6b[_0x37ec3b(0x185)]:_0x37ec3b(0x178)+_0x5a1d6b[_0x37ec3b(0x185)]:_0x37ec3b(0x161)+_0x5a1d6b[_0x37ec3b(0x185)]};}export const datasetBusinessGroupUpdate={'service':a59_0x1f6f3c(0x182),'command':'business-group-update','description':a59_0x1f6f3c(0x16b),'risk':a59_0x1f6f3c(0x16e),'flags':[CODE_FLAG,{'name':a59_0x1f6f3c(0x176),'type':a59_0x1f6f3c(0x183),'required':!![],'description':'New\x20business\x20model\x20group\x20value;\x20empty\x20string\x20clears\x20it'},{'name':a59_0x1f6f3c(0x15f),'type':a59_0x1f6f3c(0x183),'required':![],'description':a59_0x1f6f3c(0x177)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3ef57e){validateInput(readBusinessGroupUpdateInput(_0x3ef57e));},async 'dryRun'(_0x4ddcf5){const _0x5702b1=a59_0x1f6f3c,_0x3b7d9f=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x4ddcf5[_0x5702b1(0x16f)],'input':readBusinessGroupUpdateInput(_0x4ddcf5),'dryRun':!![]});return{'method':_0x5702b1(0x188),'url':BACKEND_PATH,'body':_0x3b7d9f['data']['backend'][_0x5702b1(0x15a)],'description':_0x3b7d9f['message'],..._0x3b7d9f['data']};},async 'execute'(_0xbe10ba){return buildDatasetBusinessGroupUpdateResult({'appCode':_0xbe10ba['appCode'],'input':readBusinessGroupUpdateInput(_0xbe10ba),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x325880){const _0x2bf685=a59_0x1f6f3c,_0xc7ea56=_0x325880['str'](_0x2bf685(0x15f));return{'code':trim(_0x325880[_0x2bf685(0x17f)](_0x2bf685(0x185))),'businessGroup':_0x325880[_0x2bf685(0x17f)]('business-group'),'expectBusinessGroup':_0xc7ea56===undefined||_0xc7ea56===''?undefined:_0xc7ea56};}function validateInput(_0x517427){const _0x3f5cee=a59_0x1f6f3c;if(!trim(_0x517427['code']))throw CliErrors[_0x3f5cee(0x17a)](_0x3f5cee(0x17e));if(_0x517427[_0x3f5cee(0x18c)]===undefined)throw CliErrors[_0x3f5cee(0x17a)](_0x3f5cee(0x15e));}function resolveBusinessGroupDataset(_0x4ea43e,_0x95295){const _0x46f369=a59_0x1f6f3c,_0x11db24=asPlainObject(_0x4ea43e[_0x46f369(0x182)]),_0x1ae082=asPlainObject(_0x4ea43e[_0x46f369(0x16c)]),_0x241831=resolveSourceType(_0x4ea43e,_0x11db24,_0x1ae082),_0x27c363=firstString(_0x4ea43e[_0x46f369(0x191)],_0x4ea43e[_0x46f369(0x185)],_0x11db24[_0x46f369(0x17c)],_0x95295)||_0x95295;return{'id':firstNumber(_0x4ea43e['modelId'],_0x4ea43e['id'],_0x11db24['datasetId'])??firstString(_0x4ea43e[_0x46f369(0x15b)],_0x4ea43e['id'],_0x11db24[_0x46f369(0x165)])??null,'code':_0x27c363,'name':firstString(_0x4ea43e[_0x46f369(0x175)],_0x11db24['datasetName'],_0x11db24[_0x46f369(0x175)])||null,'sourceType':_0x241831};}function resolveSourceType(_0x1b978c,_0x9c6869,_0x1d9f15){const _0x2ac7ef=a59_0x1f6f3c,_0x2e3c57=firstString(_0x1b978c[_0x2ac7ef(0x16d)],_0x1b978c[_0x2ac7ef(0x172)],_0x9c6869['source'],_0x9c6869[_0x2ac7ef(0x172)])?.[_0x2ac7ef(0x166)]()[_0x2ac7ef(0x159)]();if(_0x2e3c57===_0x2ac7ef(0x192)||_0x2e3c57===_0x2ac7ef(0x164))return _0x2e3c57;if(Object['keys'](_0x1d9f15)[_0x2ac7ef(0x18b)]>0x0)return _0x2ac7ef(0x192);throw CliErrors[_0x2ac7ef(0x17a)]('Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.');}function loadCurrentBusinessGroup(_0x580e0e,_0x36291c){const _0xcce396=a59_0x1f6f3c,_0x49725f=readBusinessGroupFromDatasetDetail(_0x580e0e,_0x36291c[_0xcce396(0x172)]);if(_0x49725f['found'])return normalizeBusinessGroup(_0x49725f[_0xcce396(0x162)]);if(_0x36291c[_0xcce396(0x172)]===_0xcce396(0x164))return'';throw CliErrors[_0xcce396(0x17a)]('Dataset\x20detail\x20does\x20not\x20expose\x20businessGroup.','Business\x20model\x20group\x20readback\x20must\x20be\x20available\x20by\x20datasetCode;\x20upgrade\x20the\x20backend\x20read\x20contract\x20instead\x20of\x20using\x20dblinkId/tableName.');}function readBusinessGroupFromDatasetDetail(_0x11587b,_0x3c2f03){const _0x1e0540=a59_0x1f6f3c,_0x116a1d=asPlainObject(_0x11587b[_0x1e0540(0x182)]),_0x1016c1=firstPresent(_0x11587b['businessGroup']);if(_0x1016c1[_0x1e0540(0x171)])return _0x1016c1;const _0x32dba9=firstPresent(_0x116a1d[_0x1e0540(0x18c)]);if(_0x32dba9[_0x1e0540(0x171)])return _0x32dba9;if(_0x3c2f03===_0x1e0540(0x192))return{'found':![]};const _0x104aa2=readBusinessGroupFromExtend(_0x11587b[_0x1e0540(0x17d)]);if(_0x104aa2[_0x1e0540(0x171)])return _0x104aa2;return readBusinessGroupFromExtend(_0x116a1d[_0x1e0540(0x17d)]);}function readBusinessGroupFromExtend(_0x2b7cb1){const _0x2d5924=a59_0x1f6f3c;if(_0x2b7cb1===undefined||_0x2b7cb1===null||_0x2b7cb1==='')return{'found':![]};if(typeof _0x2b7cb1===_0x2d5924(0x183))try{const _0x300ee8=JSON[_0x2d5924(0x174)](_0x2b7cb1);return readBusinessGroupFromExtend(_0x300ee8);}catch{return{'found':![]};}const _0x15ea31=asPlainObject(_0x2b7cb1);if(Object[_0x2d5924(0x15c)]['hasOwnProperty']['call'](_0x15ea31,_0x2d5924(0x18c)))return{'found':!![],'value':_0x15ea31[_0x2d5924(0x18c)]};return{'found':![]};}function firstPresent(..._0x349a34){for(const _0x28e479 of _0x349a34){if(_0x28e479!==undefined&&_0x28e479!==null)return{'found':!![],'value':_0x28e479};}return{'found':![]};}function assertExpectedBusinessGroup(_0x3a5581,_0x451919){const _0x403a8d=a59_0x1f6f3c;if(_0x451919===undefined)return;const _0x49a908=normalizeBusinessGroup(_0x451919);if(_0x3a5581!==_0x49a908)throw CliErrors[_0x403a8d(0x17a)](_0x403a8d(0x168),_0x403a8d(0x186)+JSON['stringify'](_0x49a908)+_0x403a8d(0x180)+JSON['stringify'](_0x3a5581));}function buildBackendPayload(_0x25cd2d,_0x10b131,_0x5e15a5){return{'appCode':_0x25cd2d,'datasetCode':_0x10b131['code'],'businessGroup':_0x5e15a5};}function normalizeBusinessGroup(_0x114568){const _0x24769e=a59_0x1f6f3c;if(_0x114568===undefined||_0x114568===null)return'';return String(_0x114568)[_0x24769e(0x166)]();}function asPlainObject(_0xf64771){const _0x427705=a59_0x1f6f3c;if(!_0xf64771||typeof _0xf64771!==_0x427705(0x190)||Array[_0x427705(0x169)](_0xf64771))return{};return _0xf64771;}function firstString(..._0x16dd10){const _0x48317e=a59_0x1f6f3c;for(const _0x22a52c of _0x16dd10){if(typeof _0x22a52c==='string'&&_0x22a52c['trim']())return _0x22a52c[_0x48317e(0x166)]();if(typeof _0x22a52c===_0x48317e(0x189)&&Number[_0x48317e(0x184)](_0x22a52c))return String(_0x22a52c);}return undefined;}function a59_0x49ed(){const _0xed9632=['code','Expected\x20','Business\x20model\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','POST','number','679682eyQROz','length','businessGroup','expectBusinessGroup','apiError','unchanged','object','modelCode','DB_TABLE','2167plAGPN','toUpperCase','payload','modelId','prototype','235XlHpDQ','--business-group\x20is\x20required','expect-business-group','2289807pfvLmQ','No\x20changes\x20for\x20business\x20model\x20group\x20on\x20dataset\x20','value','1964ieeqhj','METADATA','datasetId','trim','stringify','Expectation\x20mismatch\x20at\x20businessGroup','isArray','42000gaNnVg','Update\x20business\x20model\x20group','dbtableConfig','source','write','appCode','7sYGVGz','found','sourceType','8tfCVAj','parse','name','business-group','Expected\x20current\x20business\x20model\x20group;\x20mismatch\x20aborts\x20without\x20writing','Updated\x20business\x20model\x20group\x20for\x20dataset\x20','1536750hmOAHc','validation','17410uxfNBg','datasetCode','extend','--code\x20is\x20required','str',',\x20actual\x20','221597mLgzft','dataset','string','isFinite'];a59_0x49ed=function(){return _0xed9632;};return a59_0x49ed();}function a59_0x57bb(_0x44ae2c,_0xaf6d41){_0x44ae2c=_0x44ae2c-0x158;const _0x49edb9=a59_0x49ed();let _0x57bb61=_0x49edb9[_0x44ae2c];return _0x57bb61;}function firstNumber(..._0x19fb66){const _0x12127f=a59_0x1f6f3c;for(const _0xf2321 of _0x19fb66){if(typeof _0xf2321==='number'&&Number[_0x12127f(0x184)](_0xf2321))return _0xf2321;if(typeof _0xf2321===_0x12127f(0x183)&&_0xf2321[_0x12127f(0x166)]()&&Number[_0x12127f(0x184)](Number(_0xf2321)))return Number(_0xf2321);}return null;}function trim(_0xbe407b){const _0x1354d8=a59_0x1f6f3c;return String(_0xbe407b||'')[_0x1354d8(0x166)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a60_0x263fb8=a60_0x248d;(function(_0x1a6387,_0x409add){const _0x43c320=a60_0x248d,_0x2cfb3c=_0x1a6387();while(!![]){try{const _0x40ccab=-parseInt(_0x43c320(0x1d9))/0x1*(-parseInt(_0x43c320(0x1c1))/0x2)+-parseInt(_0x43c320(0x1dc))/0x3*(-parseInt(_0x43c320(0x1dd))/0x4)+-parseInt(_0x43c320(0x1ce))/0x5+parseInt(_0x43c320(0x1cf))/0x6+-parseInt(_0x43c320(0x1de))/0x7+-parseInt(_0x43c320(0x1d4))/0x8*(-parseInt(_0x43c320(0x1e1))/0x9)+parseInt(_0x43c320(0x1c7))/0xa;if(_0x40ccab===_0x409add)break;else _0x2cfb3c['push'](_0x2cfb3c['shift']());}catch(_0x1a5ebc){_0x2cfb3c['push'](_0x2cfb3c['shift']());}}}(a60_0x32c5,0x5427d));function a60_0x248d(_0x3a1d17,_0x5535f5){_0x3a1d17=_0x3a1d17-0x1c0;const _0x32c5ee=a60_0x32c5();let _0x248d62=_0x32c5ee[_0x3a1d17];return _0x248d62;}import{CliErrors}from'../../errors.js';export const RUNTIME_DATA_ACCESS_COMMANDS={'cli':a60_0x263fb8(0x1e6),'filter':a60_0x263fb8(0x1d0),'getOne':a60_0x263fb8(0x1c0)};export const RUNTIME_DATA_ACCESS_SUMMARY=a60_0x263fb8(0x1c9);function valueToString(_0x418e74){const _0x5bf027=a60_0x263fb8;return _0x418e74==null?'':String(_0x418e74)[_0x5bf027(0x1da)]();}function getDatasetCode(_0x1da51b){const _0x2fb2e0=a60_0x263fb8;return valueToString(_0x1da51b[_0x2fb2e0(0x1e2)]??_0x1da51b[_0x2fb2e0(0x1d3)]??_0x1da51b[_0x2fb2e0(0x1d7)]?.[_0x2fb2e0(0x1c6)]);}function getDatasetName(_0x839f2e){const _0x4c3a7a=a60_0x263fb8;return valueToString(_0x839f2e[_0x4c3a7a(0x1c4)]??_0x839f2e[_0x4c3a7a(0x1d7)]?.[_0x4c3a7a(0x1e3)])||'unknown';}function a60_0x32c5(){const _0x2c7b8f=['tableName','dbtable','当前数据集\x20\x22','1650225EBExEY','441702wDVPLk','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27<json>\x27\x20--format\x20compress','dbtableConfig','getOne','modelCode','1322800vBHlXD','join','source','dataset','dbId','5305naLSLI','trim','length','456gQDXEn','4496gDbGyb','4164405OEWzeY','\x20的\x20DB_TABLE\x20数据源上下文。','filter','18vLPpSW','code','datasetName','如果只是查看运行态真实行数据,请切换到\x20lovrabet\x20CLI:','UNKNOWN','lovrabet','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27\x20--format\x20compress','184icmPKg','METADATA','请先将该数据集升级/迁移为\x20DB_TABLE\x20数据集,再基于新的\x20dataset\x20code\x20继续开发。','name','sourceType','datasetCode','2064360qUrPJL','validation','Use\x20lovrabet\x20data\x20filter/getOne\x20for\x20real\x20runtime\x20records.','\x20是\x20'];a60_0x32c5=function(){return _0x2c7b8f;};return a60_0x32c5();}function getDatasetSource(_0x27410e){const _0x36af52=a60_0x263fb8;return valueToString(_0x27410e[_0x36af52(0x1d6)]??_0x27410e['dataset']?.[_0x36af52(0x1c5)])['toUpperCase']();}function getDbtableConfig(_0x4b964b){const _0x5b19eb=a60_0x263fb8,_0x130573=_0x4b964b[_0x5b19eb(0x1d1)]??_0x4b964b[_0x5b19eb(0x1cc)];return _0x130573&&typeof _0x130573==='object'?_0x130573:{};}export function isDbTableBackedDataset(_0x499bd2){const _0x571b47=a60_0x263fb8,_0x306f07=getDatasetSource(_0x499bd2);if(_0x306f07===_0x571b47(0x1c2))return![];const _0x1edeec=getDbtableConfig(_0x499bd2),_0x56be10=_0x1edeec[_0x571b47(0x1d8)]??_0x1edeec['id'],_0xa2a979=valueToString(_0x1edeec[_0x571b47(0x1cb)]??_0x499bd2['tableName']??_0x499bd2[_0x571b47(0x1d7)]?.['tableName']);return _0x56be10!==undefined&&_0x56be10!==null&&_0xa2a979[_0x571b47(0x1db)]>0x0;}export function filterDbTableBackedDatasets(_0xd3ee4b){return _0xd3ee4b['filter'](_0xe2ed80=>isDbTableBackedDataset(_0xe2ed80));}export function buildDbTableBackedRequirementMessage(_0x76566d,_0x308944='SQL\x20schema\x20validation'){const _0x3519a7=a60_0x263fb8,_0x4e2889=getDatasetSource(_0x76566d)||_0x3519a7(0x1e5),_0x3902f3=getDatasetName(_0x76566d),_0x463547=getDatasetCode(_0x76566d),_0x5235b7=_0x463547?'\x20('+_0x463547+')':'';return[_0x3519a7(0x1cd)+_0x3902f3+'\x22'+_0x5235b7+_0x3519a7(0x1ca)+_0x4e2889+'\x20类型,没有可用于\x20'+_0x308944+_0x3519a7(0x1df),'原因:schema\x20introspection\x20与\x20custom\x20SQL\x20需要\x20source=DB_TABLE、dbtableConfig.dbId、dbtableConfig.tableName\x20与数据库连接上下文。',_0x3519a7(0x1c3),_0x3519a7(0x1e4)+RUNTIME_DATA_ACCESS_COMMANDS[_0x3519a7(0x1e0)]+';'+RUNTIME_DATA_ACCESS_COMMANDS[_0x3519a7(0x1d2)]+'。'][_0x3519a7(0x1d5)]('\x20');}export function assertDatasetIsDbTableBacked(_0x2a6aa4,_0x439f27){const _0x37962c=a60_0x263fb8;if(!isDbTableBackedDataset(_0x2a6aa4))throw CliErrors[_0x37962c(0x1c8)](buildDbTableBackedRequirementMessage(_0x2a6aa4,_0x439f27));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a61_0x3144f9=a61_0x98e3;(function(_0x446cb1,_0x36860d){const _0xec698e=a61_0x98e3,_0x29bffc=_0x446cb1();while(!![]){try{const _0x4f8b4e=-parseInt(_0xec698e(0x109))/0x1+parseInt(_0xec698e(0x128))/0x2*(-parseInt(_0xec698e(0x115))/0x3)+parseInt(_0xec698e(0x101))/0x4+parseInt(_0xec698e(0x118))/0x5+-parseInt(_0xec698e(0x12b))/0x6*(parseInt(_0xec698e(0x129))/0x7)+-parseInt(_0xec698e(0x133))/0x8*(parseInt(_0xec698e(0x121))/0x9)+parseInt(_0xec698e(0x10c))/0xa*(parseInt(_0xec698e(0x125))/0xb);if(_0x4f8b4e===_0x36860d)break;else _0x29bffc['push'](_0x29bffc['shift']());}catch(_0x2fe403){_0x29bffc['push'](_0x29bffc['shift']());}}}(a61_0x28f9,0xd8554));import{deleteDataset,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL,CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a61_0x28f9(){const _0x53258e=['isArray','64359qVuFos','\x20dataset(s).\x20This\x20only\x20deletes\x20platform\x20dataset\x20metadata\x20and\x20related\x20page/menu\x20records,\x20not\x20physical\x20databases\x20or\x20tables.','/smartapi/dataset/delete-dataset','dbid=','1866623wVkwiw','Matched\x20','Delete\x20dataset\x20metadata\x20by\x20id/code\x20or\x20all\x20datasets\x20under\x20a\x20db\x20id','26DboTkn','49nRRZiu','filter','193434vyqLSn','confirm','delete','code','\x20dataset(s);\x20','dbName','source','Would\x20delete\x20','672XBtkOh','appCode','\x20failed','3583600dxKUId','POST','expected-count','Required\x20to\x20execute\x20dataset\x20deletion','name','Abort\x20unless\x20the\x20matched\x20dataset\x20count\x20equals\x20this\x20value','tableName','boolean','1552856Gzqryj','high-risk-write','dataset','170OyCDEm','str','dbtableConfig','Use\x20only\x20one\x20of\x20--id,\x20--code,\x20or\x20--dbid.','Deleted\x20','num','push','relationPages','bool','138399pgtRil','dbid','message','421805EABoCF','length','number','Delete\x20all\x20datasets\x20under\x20this\x20database\x20connection\x20id','map','dbId','One\x20of\x20--id,\x20--code,\x20or\x20--dbid\x20is\x20required.','validation'];a61_0x28f9=function(){return _0x53258e;};return a61_0x28f9();}const DATASET_ID_FLAG={'name':'id','type':a61_0x3144f9(0x11a),'description':'Dataset\x20id'},DBID_FLAG={'name':a61_0x3144f9(0x116),'type':a61_0x3144f9(0x11a),'description':a61_0x3144f9(0x11b)},CONFIRM_FLAG={'name':'confirm','type':a61_0x3144f9(0x108),'description':a61_0x3144f9(0x104)},EXPECTED_COUNT_FLAG={'name':a61_0x3144f9(0x103),'type':a61_0x3144f9(0x11a),'description':a61_0x3144f9(0x106)};export const datasetDelete={'service':a61_0x3144f9(0x10b),'command':a61_0x3144f9(0x12d),'description':a61_0x3144f9(0x127),'risk':a61_0x3144f9(0x10a),'flags':[DATASET_ID_FLAG,CODE_FLAG_OPTIONAL,DBID_FLAG,CONFIRM_FLAG,EXPECTED_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x529a5a){const _0x16d4b2=a61_0x3144f9,_0x34b780=_0x529a5a[_0x16d4b2(0x111)]('id'),_0x84d5ee=_0x529a5a['str'](_0x16d4b2(0x12e)),_0x4a7192=_0x529a5a[_0x16d4b2(0x111)]('dbid'),_0x115f90=[_0x34b780>0x0,Boolean(_0x84d5ee),_0x4a7192>0x0]['filter'](Boolean);if(_0x115f90['length']===0x0)throw CliErrors[_0x16d4b2(0x11f)](_0x16d4b2(0x11e));if(_0x115f90[_0x16d4b2(0x119)]>0x1)throw CliErrors['validation'](_0x16d4b2(0x10f));},async 'dryRun'(_0x586c21){const _0x48fe53=a61_0x3144f9,_0xcb560e=await resolveTargets(_0x586c21);return{'method':_0x48fe53(0x102),'url':_0x48fe53(0x123),'body':{'appCode':_0x586c21[_0x48fe53(0x134)],'count':_0xcb560e['length'],'datasets':_0xcb560e},'description':_0x48fe53(0x132)+_0xcb560e[_0x48fe53(0x119)]+_0x48fe53(0x122)};},async 'execute'(_0x205ecf){const _0xbf6570=a61_0x3144f9;if(!_0x205ecf[_0xbf6570(0x114)](_0xbf6570(0x12c)))throw CliErrors[_0xbf6570(0x11f)]('--confirm\x20is\x20required\x20to\x20delete\x20datasets.','Run\x20with\x20--dry-run\x20first,\x20then\x20add\x20--confirm\x20when\x20the\x20target\x20list\x20is\x20correct.');const _0x3682db=await resolveTargets(_0x205ecf),_0x34641b=[],_0x57f283=[];for(const _0x349fe7 of _0x3682db){try{await deleteDataset(_0x205ecf[_0xbf6570(0x134)],_0x349fe7['id']),_0x34641b[_0xbf6570(0x112)](_0x349fe7);}catch(_0x7c0b17){_0x57f283[_0xbf6570(0x112)]({..._0x349fe7,'error':_0x7c0b17 instanceof Error?_0x7c0b17[_0xbf6570(0x117)]:String(_0x7c0b17)});}}if(_0x57f283[_0xbf6570(0x119)]>0x0)return{'ok':![],'data':{'requested':_0x3682db['length'],'deletedCount':_0x34641b[_0xbf6570(0x119)],'failedCount':_0x57f283[_0xbf6570(0x119)],'deleted':_0x34641b,'failed':_0x57f283},'message':'Deleted\x20'+_0x34641b[_0xbf6570(0x119)]+'/'+_0x3682db[_0xbf6570(0x119)]+_0xbf6570(0x12f)+_0x57f283['length']+_0xbf6570(0x135)};return{'ok':!![],'data':{'requested':_0x3682db[_0xbf6570(0x119)],'deletedCount':_0x34641b[_0xbf6570(0x119)],'deleted':_0x34641b},'message':_0xbf6570(0x110)+_0x34641b[_0xbf6570(0x119)]+'\x20dataset(s)'};}};function a61_0x98e3(_0x3b3833,_0x3cf387){_0x3b3833=_0x3b3833-0x101;const _0x28f9d2=a61_0x28f9();let _0x98e36a=_0x28f9d2[_0x3b3833];return _0x98e36a;}async function resolveTargets(_0x461bdd){const _0x118c92=a61_0x3144f9,_0x209725=_0x461bdd[_0x118c92(0x111)]('id'),_0x2daf47=_0x461bdd[_0x118c92(0x10d)](_0x118c92(0x12e)),_0x3c3709=_0x461bdd[_0x118c92(0x111)](_0x118c92(0x116));let _0x170d6d;_0x2daf47?(_0x170d6d=await listDatasets(_0x461bdd['appCode'],{'code':_0x2daf47}),_0x170d6d=_0x170d6d[_0x118c92(0x12a)](_0x3d78f5=>_0x3d78f5[_0x118c92(0x12e)]===_0x2daf47)):(_0x170d6d=await listDatasets(_0x461bdd[_0x118c92(0x134)]),_0x209725>0x0&&(_0x170d6d=_0x170d6d[_0x118c92(0x12a)](_0x3b303f=>_0x3b303f['id']===_0x209725)),_0x3c3709>0x0&&(_0x170d6d=_0x170d6d[_0x118c92(0x12a)](_0x1a280a=>_0x1a280a[_0x118c92(0x10e)]?.[_0x118c92(0x11d)]===_0x3c3709)));const _0x97cf62=_0x170d6d[_0x118c92(0x11c)](normalizeTarget);if(_0x97cf62['length']===0x0){const _0x5d1c1e=_0x2daf47||(_0x209725>0x0?'id='+_0x209725:_0x118c92(0x124)+_0x3c3709);throw CliErrors['validation']('No\x20undeleted\x20dataset\x20found\x20for\x20'+_0x5d1c1e+'.');}const _0x1d346f=_0x461bdd['num']('expected-count');if(_0x1d346f>0x0&&_0x97cf62[_0x118c92(0x119)]!==_0x1d346f)throw CliErrors['validation'](_0x118c92(0x126)+_0x97cf62['length']+'\x20dataset(s),\x20but\x20--expected-count\x20is\x20'+_0x1d346f+'.');return _0x97cf62;}function normalizeTarget(_0x328d37){const _0x12901e=a61_0x3144f9,_0x1e0350=_0x328d37['dbtableConfig']??{};return{'id':_0x328d37['id'],'code':_0x328d37[_0x12901e(0x12e)],'name':_0x328d37[_0x12901e(0x105)],'description':_0x328d37['description'],'source':_0x328d37[_0x12901e(0x131)],'dbId':_0x1e0350['dbId'],'dbName':_0x1e0350[_0x12901e(0x130)],'tableName':_0x1e0350[_0x12901e(0x107)],'relatedPageCount':Array[_0x12901e(0x120)](_0x328d37['relationPages'])?_0x328d37[_0x12901e(0x113)]['length']:undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a62_0x1532f4=a62_0x1a22;function a62_0x1a22(_0x54f8cc,_0x2a8d9f){_0x54f8cc=_0x54f8cc-0xc2;const _0x253bf5=a62_0x253b();let _0x1a2296=_0x253bf5[_0x54f8cc];return _0x1a2296;}(function(_0x578830,_0x53ceaa){const _0x470184=a62_0x1a22,_0x44099d=_0x578830();while(!![]){try{const _0x122abd=-parseInt(_0x470184(0xf7))/0x1+-parseInt(_0x470184(0x112))/0x2*(parseInt(_0x470184(0x103))/0x3)+-parseInt(_0x470184(0xfb))/0x4*(-parseInt(_0x470184(0x107))/0x5)+parseInt(_0x470184(0xf2))/0x6*(parseInt(_0x470184(0x117))/0x7)+parseInt(_0x470184(0xfc))/0x8+parseInt(_0x470184(0x118))/0x9*(-parseInt(_0x470184(0x10d))/0xa)+parseInt(_0x470184(0x109))/0xb;if(_0x122abd===_0x53ceaa)break;else _0x44099d['push'](_0x44099d['shift']());}catch(_0x956d9d){_0x44099d['push'](_0x44099d['shift']());}}}(a62_0x253b,0xa7d32));import{getDatasetDetail}from'../../core/api-client.js';import{CODE_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function normalizeField(_0x3c0e2){const _0x2979de=a62_0x1a22;if(_0x3c0e2['deleted'])return null;const _0x1622f9=Boolean(_0x3c0e2[_0x2979de(0xcc)]!==undefined||_0x3c0e2[_0x2979de(0xd0)]!==undefined);let _0x214127={};if(!_0x1622f9&&typeof _0x3c0e2['extend']==='string')try{_0x214127=JSON['parse'](_0x3c0e2['extend']);}catch{}const _0x394bb5=_0x1622f9?_0x3c0e2[_0x2979de(0xfe)]:_0x3c0e2['code'],_0x57a04e=_0x1622f9?_0x3c0e2[_0x2979de(0xcc)]:_0x3c0e2['name'],_0x417ebb=_0x1622f9?_0x3c0e2[_0x2979de(0xd0)]:_0x3c0e2['type']||_0x3c0e2[_0x2979de(0xda)],_0x2f7210=_0x1622f9?_0x3c0e2[_0x2979de(0xe2)]===!![]:_0x214127[_0x2979de(0xe2)]===!![],_0x5503d9=_0x1622f9?_0x3c0e2[_0x2979de(0xde)]===!![]:_0x214127[_0x2979de(0xde)]===!![],_0x35065a=_0x1622f9?_0x3c0e2['options']??null:_0x214127[_0x2979de(0x119)]??null,_0x42cfe1={'name':_0x394bb5,'displayName':_0x57a04e||_0x394bb5,'type':_0x417ebb,'dbType':_0x3c0e2[_0x2979de(0xd8)],'pk':_0x2f7210,'required':_0x5503d9,'deprecated':_0x3c0e2[_0x2979de(0xd3)]===!![],'description':_0x3c0e2[_0x2979de(0xc4)]||undefined};return Array[_0x2979de(0x113)](_0x35065a)&&_0x35065a[_0x2979de(0x105)]>0x0&&(_0x42cfe1[_0x2979de(0x119)]=_0x35065a),_0x42cfe1;}function parseJsonMaybe(_0x1eb938){const _0x33e6b3=a62_0x1a22;if(typeof _0x1eb938!=='string')return _0x1eb938;try{return JSON[_0x33e6b3(0xe1)](_0x1eb938);}catch{return _0x1eb938;}}function normalizeOperationEntry(_0x17c863,_0x445280){const _0x541169=a62_0x1a22;if(!_0x445280||typeof _0x445280!==_0x541169(0xe3))return null;if(!_0x445280[_0x541169(0xcf)]||!_0x445280['path'])return null;const _0x267cff={'name':_0x17c863,'method':_0x445280['method'],'path':_0x445280[_0x541169(0xd2)]};if(_0x445280[_0x541169(0xca)])_0x267cff['host']=_0x445280[_0x541169(0xca)];if(_0x445280[_0x541169(0xe4)]!=null){const _0x184389=parseJsonMaybe(_0x445280[_0x541169(0xe4)]);_0x267cff[_0x541169(0xe4)]=_0x184389;}if(_0x445280[_0x541169(0xe9)]!=null){const _0x4adc36=parseJsonMaybe(_0x445280[_0x541169(0xe9)]);_0x267cff[_0x541169(0xe9)]=_0x4adc36;}if(_0x445280[_0x541169(0xf8)]!=null)_0x267cff['beforeScriptId']=_0x445280[_0x541169(0xf8)];if(_0x445280[_0x541169(0xd5)]!=null)_0x267cff[_0x541169(0xd5)]=_0x445280[_0x541169(0xd5)];if(Array[_0x541169(0x113)](_0x445280['requestFields']))_0x267cff[_0x541169(0x115)]=_0x445280['requestFields'];if(Array[_0x541169(0x113)](_0x445280[_0x541169(0x10a)]))_0x267cff[_0x541169(0x10a)]=_0x445280[_0x541169(0x10a)];return _0x267cff;}function summarizeDbtable(_0x495c63){const _0x14ab3f=a62_0x1a22,_0x2c6cf2={},_0xc22375=[_0x14ab3f(0xf9),_0x14ab3f(0xfa),_0x14ab3f(0x11a),_0x14ab3f(0xf4),'pkField','allFields',_0x14ab3f(0x114),_0x14ab3f(0xc2),_0x14ab3f(0xe6),_0x14ab3f(0xf3),_0x14ab3f(0xf6),_0x14ab3f(0x100),_0x14ab3f(0xdf),_0x14ab3f(0xeb),'dblinkInfoDTO'];for(const _0x393bc7 of _0xc22375){if(_0x495c63[_0x393bc7]!==undefined)_0x2c6cf2[_0x393bc7]=_0x495c63[_0x393bc7];}return typeof _0x2c6cf2[_0x14ab3f(0xc8)]===_0x14ab3f(0xe5)&&_0x2c6cf2[_0x14ab3f(0xc8)][_0x14ab3f(0x105)]>0x0&&(_0x2c6cf2[_0x14ab3f(0xc5)]=_0x2c6cf2[_0x14ab3f(0xc8)][_0x14ab3f(0x116)](',')[_0x14ab3f(0xd7)](_0x528c35=>_0x528c35[_0x14ab3f(0xce)]())['filter'](Boolean)),_0x2c6cf2;}function normalizeRelatedPages(_0x51c207){const _0x491c29=a62_0x1a22;if(!Array['isArray'](_0x51c207))return[];return _0x51c207[_0x491c29(0x10e)](_0xe5ec1a=>_0xe5ec1a&&typeof _0xe5ec1a===_0x491c29(0xe3))[_0x491c29(0xd7)](_0x52e813=>({'id':_0x52e813['id'],'type':_0x52e813[_0x491c29(0xea)],'code':_0x52e813['code'],'title':_0x52e813['title'],'deleted':_0x52e813['deleted']===!![]}));}function a62_0x253b(){const _0x8d0b04=['validateRules','properties','relationId','fromField','code','extend','42ynZKsM','creatorIdField','datasetKey','modelId','creatorNameField','837037fZgAJu','beforeScriptId','dbId','dbName','28BENnEd','6990536FbuQGO','formatRules','name','columnCodeListWithDeleted','modifierIdField','toTableName','toDatasetCode','111102hNAUfF','sourceType','length','indexes','210835VJFSdH','main_sub','2033460WaPndY','responseFields','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically','relations','50PiDViv','filter','entries','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','read','4IsCqUs','isArray','logicField','requestFields','split','418789nuOSlP','313416XucYYM','options','tableName','createTimeField','operations','description','allFieldNames','cardinality','str','allFields','fields','host','modelCode','displayName','dbtableConfig','trim','method','doType','alias','path','deprecated','push','afterScriptId','toField','map','dbType','bizRelationType','dataType','doVersion','relatedPageInfoList','source','required','modifierNameField','dataset','parse','pkField','object','requestBody','string','updateTimeField','detail','toDatasetName','responseBody','type','labelField'];a62_0x253b=function(){return _0x8d0b04;};return a62_0x253b();}export const datasetDetail={'service':'dataset','command':a62_0x1532f4(0xe7),'description':a62_0x1532f4(0x110),'risk':a62_0x1532f4(0x111),'flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':a62_0x1532f4(0xd1),'type':'string','description':a62_0x1532f4(0x10b)}],async 'execute'(_0x15cb11){const _0x485ff5=a62_0x1532f4,_0x24c412=await getDatasetDetail(_0x15cb11[_0x485ff5(0xc7)](_0x485ff5(0xf0))),_0x2c38db=Array[_0x485ff5(0x113)](_0x24c412['fields'])?_0x24c412[_0x485ff5(0xc9)]:Array[_0x485ff5(0x113)](_0x24c412[_0x485ff5(0xed)])?_0x24c412[_0x485ff5(0xed)]:[],_0x4ce827=_0x2c38db[_0x485ff5(0xd7)](_0x7111b3=>normalizeField(_0x7111b3))[_0x485ff5(0x10e)](_0xf738da=>_0xf738da!==null),_0x15d0a1=_0x24c412[_0x485ff5(0xc3)]??{},_0x3a6082=[];for(const [_0x1cbe7e,_0x2b30ac]of Object[_0x485ff5(0x10f)](_0x15d0a1)){const _0x555eea=normalizeOperationEntry(_0x1cbe7e,_0x2b30ac);if(_0x555eea)_0x3a6082[_0x485ff5(0xd4)](_0x555eea);}const _0x5c9c13=_0x24c412[_0x485ff5(0xcd)]??{},_0x317ba1=_0x24c412[_0x485ff5(0xe0)]??{},_0x3949a3=_0x5c9c13[_0x485ff5(0xf9)]!=null?{'id':_0x5c9c13[_0x485ff5(0xf9)],'name':_0x5c9c13[_0x485ff5(0xfa)]??null}:undefined;let _0x47007a;return typeof _0x24c412[_0x485ff5(0xf1)]==='string'&&(_0x47007a=parseJsonMaybe(_0x24c412[_0x485ff5(0xf1)])),{'ok':!![],'data':{'id':_0x24c412[_0x485ff5(0xf5)]??_0x24c412['id'],'name':_0x24c412['name'],'code':_0x24c412['modelCode']||_0x24c412['code'],'doVersion':_0x24c412[_0x485ff5(0xdb)],'description':_0x24c412[_0x485ff5(0xc4)]||_0x317ba1['tableComment']||undefined,'source':_0x24c412[_0x485ff5(0xdd)]||_0x317ba1[_0x485ff5(0x104)],'table':_0x5c9c13[_0x485ff5(0x11a)]||_0x317ba1[_0x485ff5(0x11a)],'datasetKey':_0x5c9c13[_0x485ff5(0xf4)],'pk':_0x5c9c13[_0x485ff5(0xe2)],'db':_0x3949a3,'dbtable':summarizeDbtable(_0x5c9c13),'fields':_0x4ce827,'operations':_0x3a6082,'indexes':Array[_0x485ff5(0x113)](_0x317ba1[_0x485ff5(0x106)])?_0x317ba1[_0x485ff5(0x106)]:[],'relations':Array[_0x485ff5(0x113)](_0x24c412[_0x485ff5(0x10c)])?_0x24c412['relations'][_0x485ff5(0xd7)](_0x5d6e00=>({..._0x5d6e00[_0x485ff5(0xee)]!=null?{'relationId':_0x5d6e00[_0x485ff5(0xee)]}:{},'fromDataset':_0x24c412[_0x485ff5(0xfe)],'fromCode':_0x24c412[_0x485ff5(0xcb)]||_0x24c412[_0x485ff5(0xf0)],'fromTable':_0x5c9c13[_0x485ff5(0x11a)]||_0x317ba1[_0x485ff5(0x11a)],'fromField':_0x5d6e00[_0x485ff5(0xef)],'toDataset':_0x5d6e00[_0x485ff5(0xe8)],'toCode':_0x5d6e00[_0x485ff5(0x102)],'toTable':_0x5d6e00[_0x485ff5(0x101)],'toField':_0x5d6e00[_0x485ff5(0xd6)],'labelField':_0x5d6e00['toFieldLabel']||undefined,'cardinality':_0x5d6e00[_0x485ff5(0xc6)]||undefined,'bizRelationType':_0x5d6e00[_0x485ff5(0xd9)]===_0x485ff5(0x108)?'main_sub':null})):[],'relatedPages':normalizeRelatedPages(_0x24c412[_0x485ff5(0xdc)]),...Array[_0x485ff5(0x113)](_0x24c412[_0x485ff5(0xff)])?{'columnCodeListWithDeleted':_0x24c412['columnCodeListWithDeleted']}:{},'formatRules':Array[_0x485ff5(0x113)](_0x24c412[_0x485ff5(0xfd)])?_0x24c412[_0x485ff5(0xfd)]:[],'validateRules':Array[_0x485ff5(0x113)](_0x24c412[_0x485ff5(0xec)])?_0x24c412['validateRules']:[],..._0x47007a!==undefined?{'extend':_0x47007a}:{},'stats':{'fieldCount':_0x4ce827[_0x485ff5(0x105)],'operationCount':_0x3a6082['length']}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a63_0x86eada=a63_0x2f2c;(function(_0x144d8b,_0x1d7318){const _0x234ad9=a63_0x2f2c,_0x377f3f=_0x144d8b();while(!![]){try{const _0x1c3637=-parseInt(_0x234ad9(0x232))/0x1*(parseInt(_0x234ad9(0x21e))/0x2)+-parseInt(_0x234ad9(0x213))/0x3+parseInt(_0x234ad9(0x204))/0x4*(parseInt(_0x234ad9(0x216))/0x5)+-parseInt(_0x234ad9(0x234))/0x6+parseInt(_0x234ad9(0x221))/0x7+-parseInt(_0x234ad9(0x202))/0x8+parseInt(_0x234ad9(0x1fd))/0x9*(parseInt(_0x234ad9(0x1f9))/0xa);if(_0x1c3637===_0x1d7318)break;else _0x377f3f['push'](_0x377f3f['shift']());}catch(_0x152dd4){_0x377f3f['push'](_0x377f3f['shift']());}}}(a63_0x2610,0xb8e95));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const MUTABLE_EXTEND_KEYS=new Set(),EXTEND_PATCH_REDIRECTS=new Map([[a63_0x86eada(0x207),{'message':a63_0x86eada(0x224),'hint':'Use\x20`rabetbase\x20dataset\x20business-group-update`\x20to\x20update\x20business\x20model\x20groups.'}]]);export function parseJsonObjectFlag(_0x5df9a7,_0x36c8ac){const _0x5946cc=a63_0x86eada;if(!_0x5df9a7)return undefined;let _0x138462;try{_0x138462=JSON['parse'](_0x5df9a7);}catch(_0x36b36b){const _0x27eea9=_0x36b36b instanceof Error?_0x36b36b['message']:String(_0x36b36b);throw CliErrors[_0x5946cc(0x233)](_0x36c8ac+_0x5946cc(0x21b)+_0x27eea9);}if(!isPlainObject(_0x138462)||Array['isArray'](_0x138462))throw CliErrors[_0x5946cc(0x233)](_0x36c8ac+_0x5946cc(0x20c));return _0x138462;}function a63_0x2610(){const _0x4fb519=['join','isArray','104938lWiPKx','datasetName','string','9792237KhBMyc','Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object','expect-json','dataset\x20extend-update\x20does\x20not\x20support\x20businessGroup;\x20use\x20dataset\x20business-group-update','Expected\x20','datasetCode','No\x20dataset\x20extend\x20patch\x20keys\x20are\x20currently\x20supported.','modelId','length','No\x20changes\x20for\x20dataset\x20extend','/smartapi/dataset/update-driven-data','from','code','has','Dry-run:\x20dataset\x20extend\x20would\x20change\x20(','write','value','22xNNIRo','validation','3354546eyQHQC','trim','str','expect','patch-json','sort','push','keys','3886360PZxTay','message','parse','POST','36ivglah','hint','patch','entries','dataset','3211392WLkALd','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','1283364dPNbCi','stringify','datasetId','businessGroup','--expect-json','extend','appCode','Expectation\x20mismatch\x20at\x20extend.','\x20must\x20be\x20a\x20JSON\x20object','--patch-json','shape','modelCode','Allowed\x20keys:\x20','tableName','JSON\x20object\x20of\x20expected\x20current\x20extend\x20values;\x20mismatch\x20aborts\x20without\x20writing','4093707pInQSY','dbName','Patch\x20dataset\x20top-level\x20extend\x20safely','20MFmjnR','object',',\x20actual\x20','extend.','Updated\x20dataset\x20extend\x20(','\x20must\x20be\x20valid\x20JSON\x20object:\x20'];a63_0x2610=function(){return _0x4fb519;};return a63_0x2610();}export function validateExtendPatchKeys(_0x216d47){const _0x287d55=a63_0x86eada,_0x257460=Object[_0x287d55(0x1f8)](_0x216d47);if(_0x257460[_0x287d55(0x229)]===0x0)throw CliErrors[_0x287d55(0x233)](_0x287d55(0x203));for(const _0x129f90 of _0x257460){const _0xff0f99=EXTEND_PATCH_REDIRECTS['get'](_0x129f90);if(_0xff0f99)throw CliErrors[_0x287d55(0x233)](_0xff0f99['message'],_0xff0f99[_0x287d55(0x1fe)]);if(!MUTABLE_EXTEND_KEYS[_0x287d55(0x22e)](_0x129f90))throw CliErrors[_0x287d55(0x233)]('Unsupported\x20patch\x20key:\x20'+_0x129f90,describeMutableExtendKeys());}}function describeMutableExtendKeys(){const _0x30531d=a63_0x86eada,_0x32d107=Array[_0x30531d(0x22c)](MUTABLE_EXTEND_KEYS)[_0x30531d(0x1f6)]();return _0x32d107[_0x30531d(0x229)]>0x0?_0x30531d(0x210)+_0x32d107[_0x30531d(0x21c)](',\x20'):_0x30531d(0x227);}export function applyExtendPatch(_0x3d37e6,_0x415cc7){const _0xe5ed1c=a63_0x86eada;validateExtendPatchKeys(_0x415cc7);const _0x2b02ab=deepClone(_0x3d37e6),_0x121007=[];for(const [_0x1d917d,_0x674e79]of Object[_0xe5ed1c(0x200)](_0x415cc7)){const _0x4e4429=_0x2b02ab[_0x1d917d],_0x1d843f=deepClone(_0x674e79);!deepEqual(_0x4e4429,_0x1d843f)&&(_0x2b02ab[_0x1d917d]=_0x1d843f,_0x121007[_0xe5ed1c(0x1f7)](_0xe5ed1c(0x219)+_0x1d917d));}return _0x121007[_0xe5ed1c(0x1f6)](),{'after':_0x2b02ab,'changedPaths':_0x121007,'changed':_0x121007['length']>0x0};}export function assertExpectation(_0x582be4,_0x5b2d2d){const _0x56186f=a63_0x86eada;if(!_0x5b2d2d)return;for(const [_0x264e50,_0x35a82d]of Object[_0x56186f(0x200)](_0x5b2d2d)){const _0x42518c=_0x582be4[_0x264e50];if(!deepEqual(_0x42518c,_0x35a82d))throw CliErrors[_0x56186f(0x233)](_0x56186f(0x20b)+_0x264e50,_0x56186f(0x225)+JSON['stringify'](_0x35a82d)+_0x56186f(0x218)+JSON['stringify'](_0x42518c));}}export async function buildDatasetExtendUpdateResult({appCode:_0x5525c0,input:_0x3a280a,dryRun:_0x5f0fcc}){const _0x3618fc=a63_0x86eada;validateInput(_0x3a280a);const _0x1022e8=await getDatasetDetail(_0x3a280a[_0x3618fc(0x22d)]),_0x22373c=parseDatasetExtend(_0x1022e8[_0x3618fc(0x209)]),_0x3d0940=deepClone(_0x22373c[_0x3618fc(0x231)]);assertExpectation(_0x3d0940,_0x3a280a[_0x3618fc(0x1f4)]);const {after:_0x150ac9,changedPaths:_0x352e9f,changed:_0x271a9d}=applyExtendPatch(_0x3d0940,_0x3a280a['patch']),_0x2b34a4=summarizeDataset(_0x1022e8,_0x3a280a[_0x3618fc(0x22d)]);return _0x271a9d&&!_0x5f0fcc&&(_0x1022e8[_0x3618fc(0x209)]=serializeDatasetExtend(_0x150ac9,_0x22373c[_0x3618fc(0x20e)]),await updateDrivenData(_0x1022e8)),{'ok':!![],'data':{'appCode':_0x5525c0,'selector':{'code':_0x3a280a['code']},'dataset':_0x2b34a4,'dryRun':_0x5f0fcc,'changed':_0x271a9d,'changedPaths':_0x352e9f,'before':{'extend':_0x3d0940},'after':{'extend':_0x150ac9},'submitted':_0x271a9d&&!_0x5f0fcc},'message':_0x271a9d?_0x5f0fcc?_0x3618fc(0x22f)+_0x352e9f[_0x3618fc(0x21c)](',\x20')+')':_0x3618fc(0x21a)+_0x352e9f[_0x3618fc(0x21c)](',\x20')+')':_0x3618fc(0x22a)};}export const datasetExtendUpdate={'service':'dataset','command':'extend-update','description':a63_0x86eada(0x215),'risk':a63_0x86eada(0x230),'flags':[CODE_FLAG,{'name':a63_0x86eada(0x1f5),'type':'string','required':!![],'description':'JSON\x20object\x20patch\x20for\x20dataset\x20top-level\x20extend;\x20current\x20allowlist\x20is\x20empty'},{'name':a63_0x86eada(0x223),'type':a63_0x86eada(0x220),'required':![],'description':a63_0x86eada(0x212)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x375b01){validateInput(readExtendUpdateInput(_0x375b01));},async 'dryRun'(_0x5f0d43){const _0x4dd7de=a63_0x86eada,_0x331848=await buildDatasetExtendUpdateResult({'appCode':_0x5f0d43[_0x4dd7de(0x20a)],'input':readExtendUpdateInput(_0x5f0d43),'dryRun':!![]});return{'method':_0x4dd7de(0x1fc),'url':_0x4dd7de(0x22b),'body':_0x331848['data'],'description':_0x331848[_0x4dd7de(0x1fa)]};},async 'execute'(_0x4aa866){const _0x3fa3a5=a63_0x86eada;return buildDatasetExtendUpdateResult({'appCode':_0x4aa866[_0x3fa3a5(0x20a)],'input':readExtendUpdateInput(_0x4aa866),'dryRun':![]});}};function readExtendUpdateInput(_0x90e21d){const _0x2d3998=a63_0x86eada,_0x36025e=trim(_0x90e21d['str'](_0x2d3998(0x22d))),_0xde0b1c=parseJsonObjectFlag(_0x90e21d[_0x2d3998(0x236)](_0x2d3998(0x1f5)),_0x2d3998(0x20d)),_0x1cd8df=parseJsonObjectFlag(_0x90e21d['str'](_0x2d3998(0x223)),_0x2d3998(0x208));return{'code':_0x36025e,'patch':_0xde0b1c||{},'expect':_0x1cd8df};}function validateInput(_0x8914ba){const _0x2c7a2f=a63_0x86eada;if(!_0x8914ba[_0x2c7a2f(0x22d)])throw CliErrors[_0x2c7a2f(0x233)]('--code\x20is\x20required');validateExtendPatchKeys(_0x8914ba[_0x2c7a2f(0x1ff)]);}function parseDatasetExtend(_0x50a5a5){const _0x140657=a63_0x86eada;if(typeof _0x50a5a5==='string'){const _0x3edf2f=_0x50a5a5[_0x140657(0x235)]();if(!_0x3edf2f)return{'value':{},'shape':_0x140657(0x220)};let _0x52fe58;try{_0x52fe58=JSON[_0x140657(0x1fb)](_0x3edf2f);}catch(_0x37459d){const _0x4c4d1f=_0x37459d instanceof Error?_0x37459d['message']:String(_0x37459d);throw CliErrors['validation']('Dataset\x20extend\x20must\x20be\x20valid\x20JSON\x20object:\x20'+_0x4c4d1f);}if(!isPlainObject(_0x52fe58)||Array['isArray'](_0x52fe58))throw CliErrors['validation'](_0x140657(0x222));return{'value':_0x52fe58,'shape':_0x140657(0x220)};}if(_0x50a5a5===undefined||_0x50a5a5===null)return{'value':{},'shape':'string'};if(!isPlainObject(_0x50a5a5)||Array['isArray'](_0x50a5a5))throw CliErrors[_0x140657(0x233)]('Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object');return{'value':_0x50a5a5,'shape':_0x140657(0x217)};}function serializeDatasetExtend(_0x24f5b4,_0x16669e){const _0x3a322c=a63_0x86eada;return _0x16669e===_0x3a322c(0x220)?JSON[_0x3a322c(0x205)](_0x24f5b4):_0x24f5b4;}function summarizeDataset(_0x2dcb6a,_0x24ec85){const _0x14e99b=a63_0x86eada,_0x17cb83=isPlainObject(_0x2dcb6a[_0x14e99b(0x201)])?_0x2dcb6a['dataset']:{},_0xd2d20=isPlainObject(_0x2dcb6a['dbtableConfig'])?_0x2dcb6a['dbtableConfig']:{};return{'id':_0x2dcb6a[_0x14e99b(0x228)]??_0x2dcb6a['id']??_0x17cb83[_0x14e99b(0x206)]??null,'code':_0x2dcb6a[_0x14e99b(0x20f)]??_0x2dcb6a['code']??_0x17cb83[_0x14e99b(0x226)]??_0x24ec85,'name':_0x2dcb6a['name']??_0x17cb83[_0x14e99b(0x21f)]??null,'table':_0xd2d20[_0x14e99b(0x211)]??_0x17cb83[_0x14e99b(0x211)]??null,'db':_0xd2d20[_0x14e99b(0x214)]??_0xd2d20['dbId']??null};}function deepClone(_0x4e6c8c){const _0x4c0b7a=a63_0x86eada;if(_0x4e6c8c===undefined)return _0x4e6c8c;return JSON[_0x4c0b7a(0x1fb)](JSON[_0x4c0b7a(0x205)](_0x4e6c8c));}function a63_0x2f2c(_0x33fd78,_0x6a8857){_0x33fd78=_0x33fd78-0x1f4;const _0x2610f4=a63_0x2610();let _0x2f2c24=_0x2610f4[_0x33fd78];return _0x2f2c24;}function deepEqual(_0x29b4be,_0x162a29){const _0x3500e5=a63_0x86eada;return JSON['stringify'](_0x29b4be)===JSON[_0x3500e5(0x205)](_0x162a29);}function isPlainObject(_0x51b0e0){const _0x5ade2f=a63_0x86eada;return Boolean(_0x51b0e0)&&typeof _0x51b0e0===_0x5ade2f(0x217)&&!Array[_0x5ade2f(0x21d)](_0x51b0e0);}function trim(_0x114a34){const _0x52f748=a63_0x86eada,_0x12d8a8=String(_0x114a34||'')[_0x52f748(0x235)]();return _0x12d8a8;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a64_0x2f3550=a64_0x37fe;(function(_0x588d24,_0x1d2ea6){const _0xd9e1d4=a64_0x37fe,_0x2a217f=_0x588d24();while(!![]){try{const _0x66944b=parseInt(_0xd9e1d4(0xb0))/0x1+parseInt(_0xd9e1d4(0xb2))/0x2*(-parseInt(_0xd9e1d4(0x91))/0x3)+parseInt(_0xd9e1d4(0xaf))/0x4*(-parseInt(_0xd9e1d4(0xbe))/0x5)+-parseInt(_0xd9e1d4(0x9e))/0x6*(parseInt(_0xd9e1d4(0xbd))/0x7)+parseInt(_0xd9e1d4(0xa9))/0x8+parseInt(_0xd9e1d4(0xa7))/0x9+parseInt(_0xd9e1d4(0x90))/0xa;if(_0x66944b===_0x1d2ea6)break;else _0x2a217f['push'](_0x2a217f['shift']());}catch(_0xae41a0){_0x2a217f['push'](_0x2a217f['shift']());}}}(a64_0x124d,0x9e484));import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';const MUTABLE_FIELD_KEYS=new Set([a64_0x2f3550(0xca),a64_0x2f3550(0x8b),a64_0x2f3550(0xa2),'options',a64_0x2f3550(0xd3),a64_0x2f3550(0xb3),a64_0x2f3550(0xc5),a64_0x2f3550(0xc3),a64_0x2f3550(0xb5)]),FORBIDDEN_FIELD_KEYS=new Set(['id','name','code',a64_0x2f3550(0xd2),a64_0x2f3550(0x9b),a64_0x2f3550(0xd4),a64_0x2f3550(0x9a),a64_0x2f3550(0xcf),'deleted',a64_0x2f3550(0xb6),a64_0x2f3550(0x8f),a64_0x2f3550(0xd7)]);function a64_0x37fe(_0x3b0274,_0x4a82f8){_0x3b0274=_0x3b0274-0x8a;const _0x124d22=a64_0x124d();let _0x37fe42=_0x124d22[_0x3b0274];return _0x37fe42;}export function parseJsonObjectFlag(_0x346f1f,_0x4a9c90){const _0x2ff216=a64_0x2f3550;if(!_0x346f1f)return undefined;let _0x1a4ad0;try{_0x1a4ad0=JSON[_0x2ff216(0xb4)](_0x346f1f);}catch(_0x4b57a0){const _0x15df6e=_0x4b57a0 instanceof Error?_0x4b57a0[_0x2ff216(0x92)]:String(_0x4b57a0);throw CliErrors['validation'](_0x4a9c90+'\x20must\x20be\x20valid\x20JSON\x20object:\x20'+_0x15df6e);}if(!isPlainObject(_0x1a4ad0)||Array[_0x2ff216(0x9f)](_0x1a4ad0))throw CliErrors[_0x2ff216(0xd1)](_0x4a9c90+_0x2ff216(0xaa));return _0x1a4ad0;}export function validatePatchKeys(_0x303109){const _0x4b6e99=a64_0x2f3550,_0x3bd526=Object[_0x4b6e99(0xcd)](_0x303109);if(_0x3bd526['length']===0x0)throw CliErrors[_0x4b6e99(0xd1)](_0x4b6e99(0xb9));for(const _0x418ae2 of _0x3bd526){if(FORBIDDEN_FIELD_KEYS[_0x4b6e99(0x9d)](_0x418ae2))throw CliErrors[_0x4b6e99(0xd1)](_0x4b6e99(0xba)+_0x418ae2);if(!MUTABLE_FIELD_KEYS[_0x4b6e99(0x9d)](_0x418ae2))throw CliErrors[_0x4b6e99(0xd1)](_0x4b6e99(0x95)+_0x418ae2,_0x4b6e99(0xa5)+Array[_0x4b6e99(0xa0)](MUTABLE_FIELD_KEYS)[_0x4b6e99(0xc6)](',\x20'));}}export function applyFieldPatch(_0x101b8b,_0x2b1eb9){const _0x56e315=a64_0x2f3550;validatePatchKeys(_0x2b1eb9);const _0x355fbb=deepClone(_0x101b8b),_0x35ec8d=new Set();for(const [_0x4745aa,_0xa1ce6b]of Object['entries'](_0x2b1eb9)){const _0x482bc6=_0x355fbb[_0x4745aa],_0x4f9e43=mergePatchValue(_0x482bc6,_0xa1ce6b);!deepEqual(_0x482bc6,_0x4f9e43)&&(_0x355fbb[_0x4745aa]=_0x4f9e43,_0x35ec8d[_0x56e315(0xce)](_0x4745aa),collectChangedPaths(_0x4745aa,_0x482bc6,_0x4f9e43,_0x35ec8d));}return{'after':_0x355fbb,'changedPaths':Array[_0x56e315(0xa0)](_0x35ec8d)[_0x56e315(0xd6)](),'changed':_0x35ec8d[_0x56e315(0xbf)]>0x0};}export function assertExpectation(_0x44157f,_0x1a52a9){const _0x5cb63f=a64_0x2f3550;if(!_0x1a52a9)return;for(const [_0x55ea13,_0x1eeeb4]of Object[_0x5cb63f(0xa6)](_0x1a52a9)){const _0x255c02=_0x44157f[_0x55ea13];if(!deepEqual(_0x255c02,_0x1eeeb4))throw CliErrors[_0x5cb63f(0xd1)](_0x5cb63f(0xab)+_0x55ea13,_0x5cb63f(0xd0)+JSON['stringify'](_0x1eeeb4)+',\x20actual\x20'+JSON[_0x5cb63f(0x97)](_0x255c02));}}export async function buildDatasetFieldUpdateResult({appCode:_0xb56019,input:_0x7e2c9f,dryRun:_0x3eb540}){const _0xe54ec2=a64_0x2f3550;validateInput(_0x7e2c9f);const _0x20d58b=await getDatasetDetail(_0x7e2c9f[_0xe54ec2(0xc4)]),_0x528201=readFieldArray(_0x20d58b),_0x2d3600=_0x528201['findIndex'](_0x1d7aa9=>_0x1d7aa9?.[_0xe54ec2(0xcc)]===_0x7e2c9f[_0xe54ec2(0x99)]);if(_0x2d3600<0x0)throw CliErrors['validation']('Field\x20not\x20found:\x20'+_0x7e2c9f[_0xe54ec2(0x99)]);const _0xf952b6=deepClone(_0x528201[_0x2d3600]);assertExpectation(_0xf952b6,_0x7e2c9f[_0xe54ec2(0xae)]);const {after:_0x3b5518,changedPaths:_0x1a9f26,changed:_0x1c7fe5}=applyFieldPatch(_0xf952b6,_0x7e2c9f[_0xe54ec2(0xad)]),_0x288f8a=summarizeDataset(_0x20d58b,_0x7e2c9f['code']);return _0x1c7fe5&&!_0x3eb540&&(_0x528201[_0x2d3600]=_0x3b5518,await updateDrivenData(_0x20d58b)),{'ok':!![],'data':{'appCode':_0xb56019,'selector':{'code':_0x7e2c9f['code']},'dataset':_0x288f8a,'field':{'id':_0xf952b6['id']??null,'name':_0xf952b6[_0xe54ec2(0xcc)]},'dryRun':_0x3eb540,'changed':_0x1c7fe5,'changedPaths':_0x1a9f26,'before':_0xf952b6,'after':_0x3b5518,'submitted':_0x1c7fe5&&!_0x3eb540},'message':_0x1c7fe5?_0x3eb540?_0xe54ec2(0xb1)+_0x7e2c9f[_0xe54ec2(0x99)]+_0xe54ec2(0xc7)+_0x1a9f26['join'](',\x20')+')':'Updated\x20dataset\x20field\x20'+_0x7e2c9f[_0xe54ec2(0x99)]+'\x20('+_0x1a9f26[_0xe54ec2(0xc6)](',\x20')+')':_0xe54ec2(0x8e)+_0x7e2c9f[_0xe54ec2(0x99)]};}export const datasetFieldUpdate={'service':a64_0x2f3550(0xbc),'command':'field-update','description':a64_0x2f3550(0xcb),'risk':'write','flags':[CODE_FLAG,{'name':a64_0x2f3550(0x99),'type':a64_0x2f3550(0x93),'required':!![],'description':a64_0x2f3550(0xa1)},{'name':a64_0x2f3550(0x94),'type':a64_0x2f3550(0x93),'required':!![],'description':a64_0x2f3550(0xbb)},{'name':a64_0x2f3550(0x96),'type':a64_0x2f3550(0x93),'required':![],'description':a64_0x2f3550(0x8a)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3112d6){validateInput(readFieldUpdateInput(_0x3112d6));},async 'dryRun'(_0x3dd6d8){const _0x2c8029=a64_0x2f3550,_0x2a9852=await buildDatasetFieldUpdateResult({'appCode':_0x3dd6d8['appCode'],'input':readFieldUpdateInput(_0x3dd6d8),'dryRun':!![]});return{'method':_0x2c8029(0xb8),'url':_0x2c8029(0xa4),'body':_0x2a9852[_0x2c8029(0xa8)],'description':_0x2a9852[_0x2c8029(0x92)]};},async 'execute'(_0x9980e){const _0x3b0bb2=a64_0x2f3550;return buildDatasetFieldUpdateResult({'appCode':_0x9980e[_0x3b0bb2(0xc1)],'input':readFieldUpdateInput(_0x9980e),'dryRun':![]});}};function readFieldUpdateInput(_0x15cd2e){const _0x413c1a=a64_0x2f3550,_0x2c1545=trim(_0x15cd2e['str']('code')),_0x4a4760=emptyToUndefined(_0x15cd2e[_0x413c1a(0xac)](_0x413c1a(0x99))),_0x277895=parseJsonObjectFlag(_0x15cd2e[_0x413c1a(0xac)](_0x413c1a(0x94)),_0x413c1a(0xc9)),_0x26dc8f=parseJsonObjectFlag(_0x15cd2e[_0x413c1a(0xac)]('expect-json'),_0x413c1a(0xa3));return{'code':_0x2c1545,'field':_0x4a4760||'','patch':_0x277895||{},'expect':_0x26dc8f};}function validateInput(_0x3f2529){const _0xd6f649=a64_0x2f3550;if(!_0x3f2529[_0xd6f649(0xc4)])throw CliErrors['validation'](_0xd6f649(0xc2));if(!_0x3f2529[_0xd6f649(0x99)])throw CliErrors['validation'](_0xd6f649(0xd8));validatePatchKeys(_0x3f2529[_0xd6f649(0xad)]);}function readFieldArray(_0x44ad53){const _0x3c3078=a64_0x2f3550;if(Array[_0x3c3078(0x9f)](_0x44ad53[_0x3c3078(0xd9)]))return _0x44ad53[_0x3c3078(0xd9)];if(Array[_0x3c3078(0x9f)](_0x44ad53['properties']))return _0x44ad53[_0x3c3078(0x8d)];throw CliErrors[_0x3c3078(0xd1)]('Driven\x20data\x20does\x20not\x20contain\x20fields[]\x20or\x20properties[]');}function summarizeDataset(_0x3d0a03,_0x20503b){const _0x24b6c3=a64_0x2f3550,_0x4a2b34=isPlainObject(_0x3d0a03[_0x24b6c3(0xbc)])?_0x3d0a03[_0x24b6c3(0xbc)]:{},_0x3df31f=isPlainObject(_0x3d0a03[_0x24b6c3(0xc0)])?_0x3d0a03[_0x24b6c3(0xc0)]:{};return{'id':_0x3d0a03[_0x24b6c3(0xc8)]??_0x3d0a03['id']??_0x4a2b34['datasetId']??null,'code':_0x3d0a03['modelCode']??_0x3d0a03[_0x24b6c3(0xc4)]??_0x4a2b34['datasetCode']??_0x20503b,'name':_0x3d0a03['name']??_0x4a2b34[_0x24b6c3(0xd5)]??null,'table':_0x3df31f['tableName']??_0x4a2b34[_0x24b6c3(0xcf)]??null,'db':_0x3df31f[_0x24b6c3(0x9c)]??_0x3df31f[_0x24b6c3(0xb7)]??null};}function mergePatchValue(_0x1436b6,_0x5d2d91){if(isPlainObject(_0x1436b6)&&isPlainObject(_0x5d2d91))return deepMerge(_0x1436b6,_0x5d2d91);return deepClone(_0x5d2d91);}function deepMerge(_0x14206d,_0x482d74){const _0x350302=a64_0x2f3550,_0xeb50b0=deepClone(_0x14206d);for(const [_0x36d8bd,_0x5b17ce]of Object[_0x350302(0xa6)](_0x482d74)){_0xeb50b0[_0x36d8bd]=isPlainObject(_0xeb50b0[_0x36d8bd])&&isPlainObject(_0x5b17ce)?deepMerge(_0xeb50b0[_0x36d8bd],_0x5b17ce):deepClone(_0x5b17ce);}return _0xeb50b0;}function collectChangedPaths(_0xcebd88,_0x17ffc6,_0x4073ac,_0x12da6c){const _0xf4c9a2=a64_0x2f3550;if(!isPlainObject(_0x17ffc6)||!isPlainObject(_0x4073ac))return;const _0x37a642=new Set([...Object[_0xf4c9a2(0xcd)](_0x17ffc6),...Object[_0xf4c9a2(0xcd)](_0x4073ac)]);for(const _0x5b6829 of _0x37a642){const _0x1e8830=_0x17ffc6[_0x5b6829],_0x475dff=_0x4073ac[_0x5b6829];!deepEqual(_0x1e8830,_0x475dff)&&_0x12da6c['add'](_0xcebd88+'.'+_0x5b6829);}}function a64_0x124d(){const _0x2d06d2=['stringify','object','field','dbFieldName','dbTypeLen','dbName','has','3234oTCIzi','isArray','from','Exact\x20raw\x20fields[].name\x20to\x20patch','description','--expect-json','/smartapi/dataset/update-driven-data','Allowed\x20keys:\x20','entries','605142WgnfVW','data','3949808yLvOpB','\x20must\x20be\x20a\x20JSON\x20object','Expectation\x20mismatch\x20at\x20','str','patch','expect','4hLYgLB','59458tYcmZj','Dry-run:\x20dataset\x20field\x20','1508686NkkJMe','datetimeFormat','parse','deprecated','pkField','dbId','POST','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','Forbidden\x20patch\x20key:\x20','JSON\x20object\x20patch;\x20allowed\x20keys:\x20doType/displayName/description/options/required/datetimeFormat/defaultAggregation/chartRole/deprecated','dataset','4739CSJTFp','4053610VQXRMq','size','dbtableConfig','appCode','--code\x20is\x20required','chartRole','code','defaultAggregation','join','\x20would\x20change\x20(','modelId','--patch-json','doType','Patch\x20one\x20raw\x20dataset\x20fields[]\x20field\x20object\x20safely','name','keys','add','tableName','Expected\x20','validation','dbType','required','dbTypeScale','datasetName','sort','systemRetain','--field\x20is\x20required','fields','JSON\x20object\x20of\x20expected\x20current\x20field\x20values;\x20mismatch\x20aborts\x20without\x20writing','displayName','trim','properties','No\x20changes\x20for\x20dataset\x20field\x20','autoIncrement','19578700wPpMtN','3IWYdkR','message','string','patch-json','Unsupported\x20patch\x20key:\x20','expect-json'];a64_0x124d=function(){return _0x2d06d2;};return a64_0x124d();}function deepClone(_0x4f1ff9){const _0xa804d3=a64_0x2f3550;if(_0x4f1ff9===undefined)return _0x4f1ff9;return JSON[_0xa804d3(0xb4)](JSON[_0xa804d3(0x97)](_0x4f1ff9));}function deepEqual(_0x529786,_0x2bc71b){const _0x1e3403=a64_0x2f3550;return JSON[_0x1e3403(0x97)](_0x529786)===JSON['stringify'](_0x2bc71b);}function isPlainObject(_0x3d3f80){const _0x2b520e=a64_0x2f3550;return Boolean(_0x3d3f80)&&typeof _0x3d3f80===_0x2b520e(0x98)&&!Array[_0x2b520e(0x9f)](_0x3d3f80);}function emptyToUndefined(_0x27f396){const _0x1def0d=String(_0x27f396||'')['trim']();return _0x1def0d||undefined;}function trim(_0x56ef6a){const _0x4defb9=a64_0x2f3550;return String(_0x56ef6a||'')[_0x4defb9(0x8c)]();}
|
|
1
|
+
const a64_0x271f65=a64_0x45d5;(function(_0x877b8b,_0x55a4ee){const _0x33573a=a64_0x45d5,_0x485d2d=_0x877b8b();while(!![]){try{const _0xd366e7=parseInt(_0x33573a(0x1bf))/0x1+parseInt(_0x33573a(0x1e8))/0x2+parseInt(_0x33573a(0x1d1))/0x3*(parseInt(_0x33573a(0x1a9))/0x4)+-parseInt(_0x33573a(0x1db))/0x5+-parseInt(_0x33573a(0x1f4))/0x6*(parseInt(_0x33573a(0x1ce))/0x7)+-parseInt(_0x33573a(0x1cd))/0x8*(parseInt(_0x33573a(0x1e9))/0x9)+parseInt(_0x33573a(0x1dd))/0xa*(parseInt(_0x33573a(0x1d0))/0xb);if(_0xd366e7===_0x55a4ee)break;else _0x485d2d['push'](_0x485d2d['shift']());}catch(_0x6c58f7){_0x485d2d['push'](_0x485d2d['shift']());}}}(a64_0x4039,0xd8ded));import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';const MUTABLE_FIELD_KEYS=new Set([a64_0x271f65(0x1e6),a64_0x271f65(0x1a6),'description',a64_0x271f65(0x1e3),'required',a64_0x271f65(0x1bc),a64_0x271f65(0x1e7),a64_0x271f65(0x1b0),'deprecated']),FORBIDDEN_FIELD_KEYS=new Set(['id',a64_0x271f65(0x1bd),'code',a64_0x271f65(0x1ab),a64_0x271f65(0x1ca),a64_0x271f65(0x1b6),a64_0x271f65(0x1d8),a64_0x271f65(0x1e0),a64_0x271f65(0x1f5),a64_0x271f65(0x1cf),'autoIncrement',a64_0x271f65(0x1d3)]);export function parseJsonObjectFlag(_0x58e6a7,_0x1d57fc){const _0x558cb2=a64_0x271f65;if(!_0x58e6a7)return undefined;let _0x280075;try{_0x280075=JSON[_0x558cb2(0x1aa)](_0x58e6a7);}catch(_0x22dada){const _0x1be9d6=_0x22dada instanceof Error?_0x22dada[_0x558cb2(0x1d2)]:String(_0x22dada);throw CliErrors[_0x558cb2(0x1e5)](_0x1d57fc+'\x20must\x20be\x20valid\x20JSON\x20object:\x20'+_0x1be9d6);}if(!isPlainObject(_0x280075)||Array[_0x558cb2(0x1c8)](_0x280075))throw CliErrors[_0x558cb2(0x1e5)](_0x1d57fc+_0x558cb2(0x1df));return _0x280075;}export function validatePatchKeys(_0x46efeb){const _0x231a04=a64_0x271f65,_0x586bea=Object[_0x231a04(0x1ae)](_0x46efeb);if(_0x586bea[_0x231a04(0x1c5)]===0x0)throw CliErrors['validation'](_0x231a04(0x1b7));for(const _0x411900 of _0x586bea){if(FORBIDDEN_FIELD_KEYS[_0x231a04(0x1c0)](_0x411900))throw CliErrors[_0x231a04(0x1e5)](_0x231a04(0x1bb)+_0x411900);if(!MUTABLE_FIELD_KEYS['has'](_0x411900))throw CliErrors[_0x231a04(0x1e5)](_0x231a04(0x1ac)+_0x411900,_0x231a04(0x1cc)+Array[_0x231a04(0x1c3)](MUTABLE_FIELD_KEYS)['join'](',\x20'));}}function a64_0x4039(){const _0x5006d7=['dbName','dbFieldName','/smartapi/dataset/update-driven-data','object','4599835bFOFKO','write','1040XJCakr','string','\x20must\x20be\x20a\x20JSON\x20object','tableName','datasetCode','size','options','JSON\x20object\x20of\x20expected\x20current\x20field\x20values;\x20mismatch\x20aborts\x20without\x20writing','validation','doType','defaultAggregation','746636LVhbBP','450awjfxV','appCode','findIndex','Exact\x20raw\x20fields[].name\x20to\x20patch','--code\x20is\x20required','patch-json','--field\x20is\x20required','str','POST','stringify','dbtableConfig','2802pplGLo','deleted','displayName','field','add','168rgQgSy','parse','dbType','Unsupported\x20patch\x20key:\x20','--expect-json','keys','JSON\x20object\x20patch;\x20allowed\x20keys:\x20doType/displayName/description/options/required/datetimeFormat/defaultAggregation/chartRole/deprecated','chartRole','patch','\x20would\x20change\x20(','join','datasetName','properties','dbTypeScale','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','modelId','trim','entries','Forbidden\x20patch\x20key:\x20','datetimeFormat','name','dataset','34027iTXVob','has','code',',\x20actual\x20','from','Patch\x20one\x20raw\x20dataset\x20fields[]\x20field\x20object\x20safely','length','Expected\x20','expect-json','isArray','fields','dbTypeLen','Field\x20not\x20found:\x20','Allowed\x20keys:\x20','233968MCKyRq','3633UNjkQe','pkField','254441vDQzak','49998Yodqxy','message','systemRetain','--patch-json','No\x20changes\x20for\x20dataset\x20field\x20','sort'];a64_0x4039=function(){return _0x5006d7;};return a64_0x4039();}export function applyFieldPatch(_0x399f16,_0x9dc86c){const _0x183346=a64_0x271f65;validatePatchKeys(_0x9dc86c);const _0x4aab8f=deepClone(_0x399f16),_0x304a87=new Set();for(const [_0x3a27c7,_0x16d537]of Object[_0x183346(0x1ba)](_0x9dc86c)){const _0x45c949=_0x4aab8f[_0x3a27c7],_0x5813ce=mergePatchValue(_0x45c949,_0x16d537);!deepEqual(_0x45c949,_0x5813ce)&&(_0x4aab8f[_0x3a27c7]=_0x5813ce,_0x304a87[_0x183346(0x1a8)](_0x3a27c7),collectChangedPaths(_0x3a27c7,_0x45c949,_0x5813ce,_0x304a87));}return{'after':_0x4aab8f,'changedPaths':Array[_0x183346(0x1c3)](_0x304a87)[_0x183346(0x1d6)](),'changed':_0x304a87[_0x183346(0x1e2)]>0x0};}export function assertExpectation(_0x7650b2,_0x38035d){const _0x4cf05e=a64_0x271f65;if(!_0x38035d)return;for(const [_0x1fb58a,_0x57ce34]of Object['entries'](_0x38035d)){const _0x53172a=_0x7650b2[_0x1fb58a];if(!deepEqual(_0x53172a,_0x57ce34))throw CliErrors[_0x4cf05e(0x1e5)]('Expectation\x20mismatch\x20at\x20'+_0x1fb58a,_0x4cf05e(0x1c6)+JSON[_0x4cf05e(0x1f2)](_0x57ce34)+_0x4cf05e(0x1c2)+JSON[_0x4cf05e(0x1f2)](_0x53172a));}}export async function buildDatasetFieldUpdateResult({appCode:_0x3b5027,input:_0x57a088,dryRun:_0x36a0f7}){const _0x14b83e=a64_0x271f65;validateInput(_0x57a088);const _0x3aef4c=await getDatasetDetail(_0x57a088[_0x14b83e(0x1c1)]),_0x5e1deb=readFieldArray(_0x3aef4c),_0xa1e347=_0x5e1deb[_0x14b83e(0x1eb)](_0x284ad7=>_0x284ad7?.[_0x14b83e(0x1bd)]===_0x57a088['field']);if(_0xa1e347<0x0)throw CliErrors[_0x14b83e(0x1e5)](_0x14b83e(0x1cb)+_0x57a088['field']);const _0x3baec2=deepClone(_0x5e1deb[_0xa1e347]);assertExpectation(_0x3baec2,_0x57a088['expect']);const {after:_0x55f54b,changedPaths:_0x26277c,changed:_0x30577b}=applyFieldPatch(_0x3baec2,_0x57a088[_0x14b83e(0x1b1)]),_0x3a381c=summarizeDataset(_0x3aef4c,_0x57a088['code']);return _0x30577b&&!_0x36a0f7&&(_0x5e1deb[_0xa1e347]=_0x55f54b,await updateDrivenData(_0x3aef4c)),{'ok':!![],'data':{'appCode':_0x3b5027,'selector':{'code':_0x57a088['code']},'dataset':_0x3a381c,'field':{'id':_0x3baec2['id']??null,'name':_0x3baec2['name']},'dryRun':_0x36a0f7,'changed':_0x30577b,'changedPaths':_0x26277c,'before':_0x3baec2,'after':_0x55f54b,'submitted':_0x30577b&&!_0x36a0f7},'message':_0x30577b?_0x36a0f7?'Dry-run:\x20dataset\x20field\x20'+_0x57a088[_0x14b83e(0x1a7)]+_0x14b83e(0x1b2)+_0x26277c[_0x14b83e(0x1b3)](',\x20')+')':'Updated\x20dataset\x20field\x20'+_0x57a088[_0x14b83e(0x1a7)]+'\x20('+_0x26277c[_0x14b83e(0x1b3)](',\x20')+')':_0x14b83e(0x1d5)+_0x57a088['field']};}export const datasetFieldUpdate={'service':a64_0x271f65(0x1be),'command':'field-update','description':a64_0x271f65(0x1c4),'risk':a64_0x271f65(0x1dc),'flags':[CODE_FLAG,{'name':'field','type':a64_0x271f65(0x1de),'required':!![],'description':a64_0x271f65(0x1ec)},{'name':a64_0x271f65(0x1ee),'type':a64_0x271f65(0x1de),'required':!![],'description':a64_0x271f65(0x1af)},{'name':a64_0x271f65(0x1c7),'type':a64_0x271f65(0x1de),'required':![],'description':a64_0x271f65(0x1e4)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4a280a){validateInput(readFieldUpdateInput(_0x4a280a));},async 'dryRun'(_0x2d6932){const _0x282988=a64_0x271f65,_0x3c7833=await buildDatasetFieldUpdateResult({'appCode':_0x2d6932[_0x282988(0x1ea)],'input':readFieldUpdateInput(_0x2d6932),'dryRun':!![]});return{'method':_0x282988(0x1f1),'url':_0x282988(0x1d9),'body':_0x3c7833['data'],'description':_0x3c7833[_0x282988(0x1d2)]};},async 'execute'(_0x5db709){const _0x227f99=a64_0x271f65;return buildDatasetFieldUpdateResult({'appCode':_0x5db709[_0x227f99(0x1ea)],'input':readFieldUpdateInput(_0x5db709),'dryRun':![]});}};function readFieldUpdateInput(_0x33055f){const _0x527e80=a64_0x271f65,_0x5b4c58=trim(_0x33055f[_0x527e80(0x1f0)](_0x527e80(0x1c1))),_0x504391=emptyToUndefined(_0x33055f[_0x527e80(0x1f0)](_0x527e80(0x1a7))),_0x286249=parseJsonObjectFlag(_0x33055f[_0x527e80(0x1f0)]('patch-json'),_0x527e80(0x1d4)),_0xf01ea8=parseJsonObjectFlag(_0x33055f[_0x527e80(0x1f0)](_0x527e80(0x1c7)),_0x527e80(0x1ad));return{'code':_0x5b4c58,'field':_0x504391||'','patch':_0x286249||{},'expect':_0xf01ea8};}function validateInput(_0x319144){const _0x3fe6a1=a64_0x271f65;if(!_0x319144[_0x3fe6a1(0x1c1)])throw CliErrors['validation'](_0x3fe6a1(0x1ed));if(!_0x319144[_0x3fe6a1(0x1a7)])throw CliErrors['validation'](_0x3fe6a1(0x1ef));validatePatchKeys(_0x319144[_0x3fe6a1(0x1b1)]);}function readFieldArray(_0x38c7d2){const _0x30dfc4=a64_0x271f65;if(Array[_0x30dfc4(0x1c8)](_0x38c7d2['fields']))return _0x38c7d2[_0x30dfc4(0x1c9)];if(Array[_0x30dfc4(0x1c8)](_0x38c7d2[_0x30dfc4(0x1b5)]))return _0x38c7d2['properties'];throw CliErrors[_0x30dfc4(0x1e5)]('Driven\x20data\x20does\x20not\x20contain\x20fields[]\x20or\x20properties[]');}function summarizeDataset(_0x53d615,_0x135593){const _0x3ce85f=a64_0x271f65,_0x13137c=isPlainObject(_0x53d615['dataset'])?_0x53d615['dataset']:{},_0x3c3e84=isPlainObject(_0x53d615[_0x3ce85f(0x1f3)])?_0x53d615['dbtableConfig']:{};return{'id':_0x53d615[_0x3ce85f(0x1b8)]??_0x53d615['id']??_0x13137c['datasetId']??null,'code':_0x53d615['modelCode']??_0x53d615['code']??_0x13137c[_0x3ce85f(0x1e1)]??_0x135593,'name':_0x53d615['name']??_0x13137c[_0x3ce85f(0x1b4)]??null,'table':_0x3c3e84[_0x3ce85f(0x1e0)]??_0x13137c[_0x3ce85f(0x1e0)]??null,'db':_0x3c3e84[_0x3ce85f(0x1d7)]??_0x3c3e84['dbId']??null};}function mergePatchValue(_0xc25cca,_0x12b321){if(isPlainObject(_0xc25cca)&&isPlainObject(_0x12b321))return deepMerge(_0xc25cca,_0x12b321);return deepClone(_0x12b321);}function deepMerge(_0x2d7f8a,_0x38a929){const _0x2bd9d9=deepClone(_0x2d7f8a);for(const [_0x24bbf4,_0x1a34a2]of Object['entries'](_0x38a929)){_0x2bd9d9[_0x24bbf4]=isPlainObject(_0x2bd9d9[_0x24bbf4])&&isPlainObject(_0x1a34a2)?deepMerge(_0x2bd9d9[_0x24bbf4],_0x1a34a2):deepClone(_0x1a34a2);}return _0x2bd9d9;}function collectChangedPaths(_0x3c2f87,_0x46c2c0,_0x345e33,_0x3f002b){const _0x4d554c=a64_0x271f65;if(!isPlainObject(_0x46c2c0)||!isPlainObject(_0x345e33))return;const _0x3d643a=new Set([...Object[_0x4d554c(0x1ae)](_0x46c2c0),...Object[_0x4d554c(0x1ae)](_0x345e33)]);for(const _0x4e5136 of _0x3d643a){const _0x3d0280=_0x46c2c0[_0x4e5136],_0x1078f4=_0x345e33[_0x4e5136];!deepEqual(_0x3d0280,_0x1078f4)&&_0x3f002b['add'](_0x3c2f87+'.'+_0x4e5136);}}function deepClone(_0x2c91e1){const _0x44ee0f=a64_0x271f65;if(_0x2c91e1===undefined)return _0x2c91e1;return JSON[_0x44ee0f(0x1aa)](JSON['stringify'](_0x2c91e1));}function deepEqual(_0x416cf5,_0x3bdc76){const _0x565de4=a64_0x271f65;return JSON[_0x565de4(0x1f2)](_0x416cf5)===JSON[_0x565de4(0x1f2)](_0x3bdc76);}function isPlainObject(_0x2bc616){const _0x4981b1=a64_0x271f65;return Boolean(_0x2bc616)&&typeof _0x2bc616===_0x4981b1(0x1da)&&!Array[_0x4981b1(0x1c8)](_0x2bc616);}function a64_0x45d5(_0x4dbc72,_0xcfd25e){_0x4dbc72=_0x4dbc72-0x1a6;const _0x40392b=a64_0x4039();let _0x45d56e=_0x40392b[_0x4dbc72];return _0x45d56e;}function emptyToUndefined(_0x457e33){const _0x2a0029=a64_0x271f65,_0x518535=String(_0x457e33||'')[_0x2a0029(0x1b9)]();return _0x518535||undefined;}function trim(_0x5c143a){const _0x553518=a64_0x271f65;return String(_0x5c143a||'')[_0x553518(0x1b9)]();}
|