@lovrabet/rabetbase-cli 2.3.6 → 2.3.7-beta.2
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 -0
- 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 -0
- 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_0x493d3f=a53_0x286d;(function(_0x59bf30,_0x441070){const _0x498c9b=a53_0x286d,_0x4e8636=_0x59bf30();while(!![]){try{const _0x233864=-parseInt(_0x498c9b(0x1cb))/0x1*(-parseInt(_0x498c9b(0x1c0))/0x2)+parseInt(_0x498c9b(0x1c8))/0x3*(-parseInt(_0x498c9b(0x1d5))/0x4)+-parseInt(_0x498c9b(0x1c9))/0x5*(parseInt(_0x498c9b(0x1ce))/0x6)+parseInt(_0x498c9b(0x1e0))/0x7*(parseInt(_0x498c9b(0x1c6))/0x8)+parseInt(_0x498c9b(0x1cf))/0x9+parseInt(_0x498c9b(0x1c3))/0xa*(-parseInt(_0x498c9b(0x1be))/0xb)+parseInt(_0x498c9b(0x1ba))/0xc;if(_0x233864===_0x441070)break;else _0x4e8636['push'](_0x4e8636['shift']());}catch(_0x1d62cf){_0x4e8636['push'](_0x4e8636['shift']());}}}(a53_0x4d79,0x1880d));function a53_0x286d(_0x5dfd3d,_0x120616){_0x5dfd3d=_0x5dfd3d-0x1b7;const _0x4d7979=a53_0x4d79();let _0x286d46=_0x4d7979[_0x5dfd3d];return _0x286d46;}import{CliErrors}from'../../errors.js';function a53_0x4d79(){const _0x420a53=['Missing\x20value.','353316fnFWpR','1783602QXsiWV','object','set','Top-level\x20key\x20\x22','apps','global','28SGRZCS','Global','env','riskLevel','bool','app','\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>','Usage:\x20','str','write','Config\x20value\x20is\x20invalid\x20or\x20too\x20long.','10969vuczOr','\x20set\x20to:\x20','keys','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','appcode','key','Settable\x20top-level\x20keys:\x20','Legacy\x20alias\x20\x22online\x22\x20is\x20accepted\x20and\x20stored\x20as\x20production.','`,\x20`','\x22.\x20Allowed:\x20','711000mrNGKM','Set\x20a\x20config\x20value','boolean','Invalid\x20value\x20for\x20\x22','8393YrrcpF','Project','30ZwtrGX','locale','config','1250ghXMGP','value','length','648HSjOsU','includes','78312HintrQ','10tBpGWU','\x20appcode\x20set\x20to:\x20','7459PDAUrb','validation'];a53_0x4d79=function(){return _0x420a53;};return a53_0x4d79();}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(_0x5ba7e7){const _0x56a3b0=a53_0x286d,_0x35f34d=_0x5ba7e7[_0x56a3b0(0x1dd)]('key'),_0x5eb0de=_0x5ba7e7[_0x56a3b0(0x1dd)](_0x56a3b0(0x1c4));if(!_0x35f34d)throw CliErrors[_0x56a3b0(0x1cc)]('Missing\x20key.','Usage:\x20'+CLI_BIN_NAME+_0x56a3b0(0x1db));if(_0x5eb0de===undefined||_0x5eb0de==='')throw CliErrors[_0x56a3b0(0x1cc)](_0x56a3b0(0x1cd),_0x56a3b0(0x1dc)+CLI_BIN_NAME+_0x56a3b0(0x1db));if(_0x5eb0de['length']>0x1f4)throw CliErrors[_0x56a3b0(0x1cc)](_0x56a3b0(0x1df));if(!isTopLevelConfigKey(_0x35f34d))throw CliErrors['validation'](_0x56a3b0(0x1d2)+_0x35f34d+'\x22\x20is\x20not\x20settable.',_0x56a3b0(0x1e6)+getTopLevelConfigKeySummary());if(_0x35f34d===_0x56a3b0(0x1d8))throw CliErrors['validation']('\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.');if(CONFIG_ENUM_VALUES[_0x35f34d]&&!CONFIG_ENUM_VALUES[_0x35f34d][_0x56a3b0(0x1c7)](_0x5eb0de))throw CliErrors['validation'](_0x56a3b0(0x1bd)+_0x35f34d+_0x56a3b0(0x1b9)+CONFIG_ENUM_VALUES[_0x35f34d]['join'](',\x20'));if(_0x35f34d===_0x56a3b0(0x1c1)&&!normalizeLocale(_0x5eb0de))throw CliErrors[_0x56a3b0(0x1cc)]('Invalid\x20locale\x20value.',_0x56a3b0(0x1e3));const _0x33c40f={'global':_0x5ba7e7[_0x56a3b0(0x1d9)](_0x56a3b0(0x1d4))},_0x3e9985=resolveWriteScope(_0x33c40f),_0x36619b=readScopedConfig(_0x3e9985);let _0x4ed971=_0x35f34d,_0x466f3d=_0x5eb0de;_0x35f34d===_0x56a3b0(0x1da)&&(_0x4ed971=_0x56a3b0(0x1e4),delete _0x36619b[_0x56a3b0(0x1da)]);_0x35f34d==='locale'&&(_0x466f3d=normalizeLocale(_0x5eb0de));if(_0x35f34d==='env'){_0x466f3d=normalizeEnv(_0x5eb0de);if(!isProduction(_0x466f3d)&&!isDaily(_0x466f3d))throw CliErrors['validation']('Invalid\x20value\x20for\x20env.\x20Allowed:\x20production,\x20daily.',_0x56a3b0(0x1b7));}if(_0x35f34d==='appcode'){const _0x525ec0=_0x36619b[_0x56a3b0(0x1d3)]&&typeof _0x36619b[_0x56a3b0(0x1d3)]===_0x56a3b0(0x1d0)?Object[_0x56a3b0(0x1e2)](_0x36619b['apps']):[];if(_0x525ec0[_0x56a3b0(0x1c5)]>0x0)throw CliErrors[_0x56a3b0(0x1cc)]('Cannot\x20set\x20top-level\x20\x22appcode\x22\x20when\x20multi-app\x20config\x20already\x20exists.','Use\x20`'+CLI_BIN_NAME+'\x20app\x20add\x20<name>\x20--appcode\x20'+_0x466f3d+_0x56a3b0(0x1b8)+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`,\x20or\x20pass\x20`--appcode`\x20on\x20the\x20command.');const _0x41e88d=buildCanonicalProjectConfig({..._0x36619b},{'appCodes':[_0x466f3d],'env':typeof _0x36619b[_0x56a3b0(0x1d7)]==='string'?_0x36619b[_0x56a3b0(0x1d7)]:undefined});writeScopedConfig(_0x41e88d,_0x3e9985);const _0x4cba16=_0x3e9985===_0x56a3b0(0x1d4)?_0x56a3b0(0x1d6):_0x56a3b0(0x1bf);return{'ok':!![],'message':'✓\x20'+_0x4cba16+_0x56a3b0(0x1ca)+_0x466f3d+'\x20(stored\x20as\x20apps\x20+\x20defaultApp)'};}_0x36619b[_0x4ed971]=_0x466f3d,writeScopedConfig(_0x36619b,_0x3e9985);const _0x186fdd=_0x3e9985===_0x56a3b0(0x1d4)?'Global':'Project';return{'ok':!![],'message':'✓\x20'+_0x186fdd+'\x20'+_0x4ed971+_0x56a3b0(0x1e1)+_0x466f3d};}export const configSetDefinition={'service':a53_0x493d3f(0x1c2),'command':a53_0x493d3f(0x1d1),'description':a53_0x493d3f(0x1bb),'risk':a53_0x493d3f(0x1de),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a53_0x493d3f(0x1e5),'type':'string','description':getConfigCommandKeyDescription(),'required':!![]},{'name':a53_0x493d3f(0x1c4),'type':'string','description':'Config\x20value','required':!![]},{'name':a53_0x493d3f(0x1d4),'type':a53_0x493d3f(0x1bc),'description':'Write\x20to\x20global\x20config\x20(~/.rabetbase.json)','default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x22002d,_0x8aa2dc){var _0x5bb528=a54_0x4aa5,_0x1999d4=_0x22002d();while(!![]){try{var _0x2acbaa=-parseInt(_0x5bb528(0xfe))/0x1+-parseInt(_0x5bb528(0x103))/0x2+parseInt(_0x5bb528(0xfb))/0x3*(parseInt(_0x5bb528(0x102))/0x4)+parseInt(_0x5bb528(0xff))/0x5+parseInt(_0x5bb528(0x106))/0x6*(parseInt(_0x5bb528(0x100))/0x7)+-parseInt(_0x5bb528(0x105))/0x8+parseInt(_0x5bb528(0x108))/0x9;if(_0x2acbaa===_0x8aa2dc)break;else _0x1999d4['push'](_0x1999d4['shift']());}catch(_0x47aa9e){_0x1999d4['push'](_0x1999d4['shift']());}}}(a54_0x40d3,0x56887));function a54_0x4aa5(_0x15c945,_0x530ea2){_0x15c945=_0x15c945-0xfb;var _0x40d370=a54_0x40d3();var _0x4aa56b=_0x40d370[_0x15c945];return _0x4aa56b;}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';function a54_0x40d3(){var _0x38d4c9=['6rkdNeD','validation','5712066iPOKIC','101685fFhckY','global','Add\x20--global\x20to\x20write\x20to\x20~/.rabetbase.json,\x20or\x20run\x20`','42952jDannr','400185SxJUSm','2696561qZDbQl','Not\x20inside\x20a\x20project\x20(no\x20.rabetbase.json\x20found).','36VFBKPj','1126062tXFCQc','\x20init`\x20first.','3556536GNyfGQ'];a54_0x40d3=function(){return _0x38d4c9;};return a54_0x40d3();}export{CLI_BIN_NAME};export{normalizeLocale};export{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey};export function resolveWriteScope(_0x19ddd0){var _0x1e73bc=a54_0x4aa5;if(_0x19ddd0['global'])return _0x1e73bc(0xfc);if(!isInProject())throw CliErrors[_0x1e73bc(0x107)](_0x1e73bc(0x101),_0x1e73bc(0xfd)+CLI_BIN_NAME+_0x1e73bc(0x104));return'project';}export function readScopedConfig(_0x287262){return readConfigFile(resolveWriteConfigPath(_0x287262));}export function writeScopedConfig(_0x32be86,_0x199fb2){writeConfigFile(resolveWriteConfigPath(_0x199fb2),_0x32be86);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a55_0x3c5af5=a55_0x3e7e;(function(_0x14633c,_0xeff764){const _0x394075=a55_0x3e7e,_0x10f260=_0x14633c();while(!![]){try{const _0x55c1c8=-parseInt(_0x394075(0x182))/0x1+parseInt(_0x394075(0x185))/0x2*(parseInt(_0x394075(0x187))/0x3)+parseInt(_0x394075(0x18b))/0x4+-parseInt(_0x394075(0x17e))/0x5+-parseInt(_0x394075(0x181))/0x6+parseInt(_0x394075(0x18a))/0x7*(parseInt(_0x394075(0x18c))/0x8)+-parseInt(_0x394075(0x17b))/0x9*(-parseInt(_0x394075(0x180))/0xa);if(_0x55c1c8===_0xeff764)break;else _0x10f260['push'](_0x10f260['shift']());}catch(_0x1e5634){_0x10f260['push'](_0x10f260['shift']());}}}(a55_0x23dd,0xa92a8));import{buildDataCommand}from'../../commands/data/shared.js';function a55_0x3e7e(_0x56740a,_0x2e21d2){_0x56740a=_0x56740a-0x17b;const _0x23dd96=a55_0x23dd();let _0x3e7e08=_0x23dd96[_0x56740a];return _0x3e7e08;}export const dataFilter=buildDataCommand({'command':a55_0x3c5af5(0x186),'operation':a55_0x3c5af5(0x186),'description':a55_0x3c5af5(0x17d),'paramsRequired':![],'paramsHint':'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','helpExtra':[a55_0x3c5af5(0x17c),a55_0x3c5af5(0x184),a55_0x3c5af5(0x189),a55_0x3c5af5(0x17f),a55_0x3c5af5(0x188),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page'][a55_0x3c5af5(0x183)]('\x0a')});function a55_0x23dd(){const _0x31820e=['5438536XsMWXC','8IhlbHe','376011CjFotB','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','Filter\x20dataset\x20records\x20with\x20query\x20conditions','2132945oUoAZL','\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}]','130liICWK','5053602MHnirF','682885hJGOQJ','join','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions','3862vLYfAx','filter','501RWmfYi','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\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]','2935849Gcmfbk'];a55_0x23dd=function(){return _0x31820e;};return a55_0x23dd();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a56_0x53e3(_0x5e6cda,_0x4c062a){_0x5e6cda=_0x5e6cda-0x64;const _0x1b620f=a56_0x1b62();let _0x53e33c=_0x1b620f[_0x5e6cda];return _0x53e33c;}const a56_0x3d5698=a56_0x53e3;(function(_0x2e5371,_0x529d1b){const _0x2aaf30=a56_0x53e3,_0x2c4f8e=_0x2e5371();while(!![]){try{const _0xa7ec2e=parseInt(_0x2aaf30(0x66))/0x1+-parseInt(_0x2aaf30(0x6d))/0x2+parseInt(_0x2aaf30(0x67))/0x3*(-parseInt(_0x2aaf30(0x65))/0x4)+parseInt(_0x2aaf30(0x69))/0x5+parseInt(_0x2aaf30(0x6e))/0x6*(parseInt(_0x2aaf30(0x6a))/0x7)+parseInt(_0x2aaf30(0x70))/0x8*(-parseInt(_0x2aaf30(0x6b))/0x9)+-parseInt(_0x2aaf30(0x64))/0xa;if(_0xa7ec2e===_0x529d1b)break;else _0x2c4f8e['push'](_0x2c4f8e['shift']());}catch(_0x196101){_0x2c4f8e['push'](_0x2c4f8e['shift']());}}}(a56_0x1b62,0x1d4f7));import{buildDataCommand}from'../../commands/data/shared.js';function a56_0x1b62(){const _0x2e0090=['21QURcew','24210dsoDvE','getOne','113314EECOyd','363648XaUigV','Get\x20a\x20single\x20record\x20by\x20ID','16guRbiG','654440XPYJJt','611092iWmgWN','96211iEhxcs','3krsyxe','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','611370YYWyOU'];a56_0x1b62=function(){return _0x2e0090;};return a56_0x1b62();}export const dataGetOne=buildDataCommand({'command':'getOne','operation':a56_0x3d5698(0x6c),'description':a56_0x3d5698(0x6f),'paramsRequired':!![],'paramsHint':a56_0x3d5698(0x68)});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a57_0x429f(){const _0x130d50=['194krEYPp','14814970lFwMhV','6904440tTCwgj','15535mfIwrQ','11PJBBwi','4NPrkib','16dagcvs','1597752LmEyFy','16134djmLlC','3070374rnRLAG','4990286sytSWg','805jxgPGf'];a57_0x429f=function(){return _0x130d50;};return a57_0x429f();}(function(_0xdb5edd,_0x8fb6d9){const _0x3f1f3d=a57_0x20db,_0x5585a9=_0xdb5edd();while(!![]){try{const _0x2687ca=-parseInt(_0x3f1f3d(0x6d))/0x1*(parseInt(_0x3f1f3d(0x6a))/0x2)+-parseInt(_0x3f1f3d(0x73))/0x3*(parseInt(_0x3f1f3d(0x6f))/0x4)+parseInt(_0x3f1f3d(0x69))/0x5*(-parseInt(_0x3f1f3d(0x72))/0x6)+parseInt(_0x3f1f3d(0x74))/0x7+parseInt(_0x3f1f3d(0x70))/0x8*(parseInt(_0x3f1f3d(0x6c))/0x9)+parseInt(_0x3f1f3d(0x6b))/0xa+parseInt(_0x3f1f3d(0x6e))/0xb*(parseInt(_0x3f1f3d(0x71))/0xc);if(_0x2687ca===_0x8fb6d9)break;else _0x5585a9['push'](_0x5585a9['shift']());}catch(_0x5bfd26){_0x5585a9['push'](_0x5585a9['shift']());}}}(a57_0x429f,0xdb613));import{dataFilter}from'../../commands/data/filter.js';function a57_0x20db(_0xf3797f,_0x428299){_0xf3797f=_0xf3797f-0x69;const _0x429faf=a57_0x429f();let _0x20db15=_0x429faf[_0xf3797f];return _0x20db15;}import{dataGetOne}from'../../commands/data/getOne.js';export const dataDefinitions=[dataFilter,dataGetOne];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x44bffa,_0x4e5f65){const _0x351b6c=a58_0x8aab,_0x5e05c1=_0x44bffa();while(!![]){try{const _0x339140=-parseInt(_0x351b6c(0x14e))/0x1*(-parseInt(_0x351b6c(0x142))/0x2)+-parseInt(_0x351b6c(0x143))/0x3*(parseInt(_0x351b6c(0x158))/0x4)+-parseInt(_0x351b6c(0x159))/0x5*(parseInt(_0x351b6c(0x14f))/0x6)+-parseInt(_0x351b6c(0x145))/0x7+parseInt(_0x351b6c(0x146))/0x8+parseInt(_0x351b6c(0x148))/0x9*(parseInt(_0x351b6c(0x14d))/0xa)+parseInt(_0x351b6c(0x15c))/0xb;if(_0x339140===_0x4e5f65)break;else _0x5e05c1['push'](_0x5e05c1['shift']());}catch(_0x470224){_0x5e05c1['push'](_0x5e05c1['shift']());}}}(a58_0x5842,0x9a595));import{executeDatasetDataOperation}from'../../core/api-client.js';function a58_0x5842(){const _0x58811b=['appCode','1081380fmeAWL','1UdShCL','282030MNGLhI','paramsRequired','code','data\x20','Provide\x20--params\x20\x27{\x22id\x22:123}\x27\x20for\x20data\x20getOne.','flagMissing','helpExtra','data\x20getOne\x20requires\x20\x22id\x22\x20in\x20--params','compress','8qTsaPp','30thnVRT','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically','\x20completed\x20in\x20','9594200KHkMyG','str','description','string','paramsHint','now','427122DiYnli','617979IplctE','data','5743381HFlyqI','5892296OuSQeB','read','27GoGanp','params','command','alias'];a58_0x5842=function(){return _0x58811b;};return a58_0x5842();}function a58_0x8aab(_0x3b0692,_0x482bb7){_0x3b0692=_0x3b0692-0x140;const _0x5842bd=a58_0x5842();let _0x8aab4a=_0x5842bd[_0x3b0692];return _0x8aab4a;}import{CODE_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{parseJsonParams}from'../../utils/params.js';function assertGetOneId(_0x5ca118){const _0x18c411=a58_0x8aab;if(!_0x5ca118)throw CliErrors[_0x18c411(0x154)](_0x18c411(0x149),_0x18c411(0x153));const _0x669ddd=_0x5ca118['id'];if(_0x669ddd===undefined||_0x669ddd===null||_0x669ddd==='')throw CliErrors['validation'](_0x18c411(0x156),'Example:\x20--params\x20\x27{\x22id\x22:123}\x27');}function parseCommandParams(_0x22ab9b){return parseJsonParams(_0x22ab9b)??{};}export function buildDataCommand(_0x18b5dc){const _0x10ad26=a58_0x8aab,_0x43885f=_0x10ad26(0x15a);return{'service':_0x10ad26(0x144),'command':_0x18b5dc[_0x10ad26(0x14a)],'description':_0x18b5dc[_0x10ad26(0x15e)],'risk':_0x10ad26(0x147),'defaultOutputFormat':_0x10ad26(0x157),'helpExtra':_0x18b5dc[_0x10ad26(0x155)],'flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':_0x10ad26(0x14b),'type':_0x10ad26(0x15f),'description':_0x43885f},{'name':_0x10ad26(0x149),'type':'string','description':_0x18b5dc[_0x10ad26(0x140)]}],async 'validate'(_0x4bee3c){const _0x261656=_0x10ad26,_0x7b8da3=_0x4bee3c['str'](_0x261656(0x149));if(_0x18b5dc[_0x261656(0x150)]&&!_0x7b8da3)throw CliErrors['flagMissing']('params',_0x18b5dc[_0x261656(0x140)]);const _0x2a2a48=parseJsonParams(_0x7b8da3);_0x18b5dc['operation']==='getOne'&&assertGetOneId(_0x2a2a48);},async 'execute'(_0xf7be23){const _0x1e4fc6=_0x10ad26,_0x25498f=parseCommandParams(_0xf7be23[_0x1e4fc6(0x15d)](_0x1e4fc6(0x149))),_0x402d5d=Date[_0x1e4fc6(0x141)](),_0x47c298=await executeDatasetDataOperation(_0xf7be23[_0x1e4fc6(0x14c)],_0xf7be23[_0x1e4fc6(0x15d)](_0x1e4fc6(0x151)),_0x18b5dc['operation'],_0x25498f),_0x468506=Date['now']()-_0x402d5d;return{'ok':!![],'data':{'result':_0x47c298,'elapsed':_0x468506},'message':_0x1e4fc6(0x152)+_0x18b5dc[_0x1e4fc6(0x14a)]+_0x1e4fc6(0x15b)+_0x468506+'ms'};}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a58_0xffb8c1=a58_0x4315;(function(_0x906511,_0xd0e1e6){const _0x92c64a=a58_0x4315,_0x24e2e7=_0x906511();while(!![]){try{const _0x1ab3a2=parseInt(_0x92c64a(0x191))/0x1+-parseInt(_0x92c64a(0x18a))/0x2+-parseInt(_0x92c64a(0x185))/0x3*(parseInt(_0x92c64a(0x182))/0x4)+parseInt(_0x92c64a(0x198))/0x5+-parseInt(_0x92c64a(0x17c))/0x6*(parseInt(_0x92c64a(0x181))/0x7)+parseInt(_0x92c64a(0x17d))/0x8+parseInt(_0x92c64a(0x1aa))/0x9*(parseInt(_0x92c64a(0x19c))/0xa);if(_0x1ab3a2===_0xd0e1e6)break;else _0x24e2e7['push'](_0x24e2e7['shift']());}catch(_0x45390a){_0x24e2e7['push'](_0x24e2e7['shift']());}}}(a58_0x1207,0x5b8cc));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=a58_0xffb8c1(0x189);export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x35df7e,input:_0x5ef0d0,dryRun:_0x4208fa}){const _0x568ae5=a58_0xffb8c1;validateInput(_0x5ef0d0);const _0x4a667f=normalizeBusinessGroup(_0x5ef0d0['businessGroup']),_0x423c53=await getDatasetDetail(_0x5ef0d0[_0x568ae5(0x1a8)]),_0x5d7cdc=resolveBusinessGroupDataset(_0x423c53,_0x5ef0d0[_0x568ae5(0x1a8)]),_0x43cee6=loadCurrentBusinessGroup(_0x423c53,_0x5d7cdc);assertExpectedBusinessGroup(_0x43cee6,_0x5ef0d0['expectBusinessGroup']);const _0x42a853=buildBackendPayload(_0x35df7e,_0x5d7cdc,_0x4a667f),_0x348ce8=_0x43cee6!==_0x4a667f;let _0x39b3c6;if(_0x348ce8&&!_0x4208fa){await updateErBusinessGroup(_0x42a853);const _0x4a8f6b=await getDatasetDetail(_0x5d7cdc[_0x568ae5(0x1a8)]),_0x1bafde=resolveBusinessGroupDataset(_0x4a8f6b,_0x5d7cdc['code']),_0x52de87=loadCurrentBusinessGroup(_0x4a8f6b,_0x1bafde);if(_0x52de87!==_0x4a667f)throw CliErrors['apiError'](_0x568ae5(0x1ab),_0x568ae5(0x171)+JSON[_0x568ae5(0x175)](_0x4a667f)+_0x568ae5(0x19d)+JSON[_0x568ae5(0x175)](_0x52de87)+'.');_0x39b3c6={'verified':!![],'status':_0x568ae5(0x178),'afterReadback':{'businessGroup':_0x52de87}};}else!_0x348ce8&&(_0x39b3c6={'verified':!![],'status':'unchanged','afterReadback':{'businessGroup':_0x43cee6}});const _0x5c03c4={'operation':_0x568ae5(0x16e),'appCode':_0x35df7e,'selector':{'code':_0x5d7cdc[_0x568ae5(0x1a8)]},'dataset':_0x5d7cdc,'before':{'businessGroup':_0x43cee6},'after':{'businessGroup':_0x4a667f},'changed':_0x348ce8,'dryRun':_0x4208fa,'submitted':_0x348ce8&&!_0x4208fa,'backend':{'method':_0x568ae5(0x19e),'path':BACKEND_PATH,'payload':_0x42a853},..._0x39b3c6?{'verification':_0x39b3c6}:{},'warnings':[]};return{'ok':!![],'data':_0x5c03c4,'message':_0x348ce8?_0x4208fa?_0x568ae5(0x195)+_0x5d7cdc[_0x568ae5(0x1a8)]:_0x568ae5(0x1a9)+_0x5d7cdc['code']:_0x568ae5(0x176)+_0x5d7cdc['code']};}export const datasetBusinessGroupUpdate={'service':a58_0xffb8c1(0x19f),'command':a58_0xffb8c1(0x1a2),'description':a58_0xffb8c1(0x188),'risk':a58_0xffb8c1(0x184),'flags':[CODE_FLAG,{'name':a58_0xffb8c1(0x174),'type':a58_0xffb8c1(0x187),'required':!![],'description':'New\x20business\x20model\x20group\x20value;\x20empty\x20string\x20clears\x20it'},{'name':a58_0xffb8c1(0x170),'type':'string','required':![],'description':a58_0xffb8c1(0x1a6)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3c6d93){validateInput(readBusinessGroupUpdateInput(_0x3c6d93));},async 'dryRun'(_0x2e32a1){const _0x39d374=a58_0xffb8c1,_0x1ee7a1=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x2e32a1[_0x39d374(0x177)],'input':readBusinessGroupUpdateInput(_0x2e32a1),'dryRun':!![]});return{'method':_0x39d374(0x19e),'url':BACKEND_PATH,'body':_0x1ee7a1[_0x39d374(0x1a3)][_0x39d374(0x18e)]['payload'],'description':_0x1ee7a1[_0x39d374(0x193)],..._0x1ee7a1['data']};},async 'execute'(_0x55291b){const _0x460acc=a58_0xffb8c1;return buildDatasetBusinessGroupUpdateResult({'appCode':_0x55291b[_0x460acc(0x177)],'input':readBusinessGroupUpdateInput(_0x55291b),'dryRun':![]});}};function a58_0x4315(_0x4e79f6,_0x31f71c){_0x4e79f6=_0x4e79f6-0x16d;const _0x1207ba=a58_0x1207();let _0x431532=_0x1207ba[_0x4e79f6];return _0x431532;}function readBusinessGroupUpdateInput(_0x3d78e7){const _0x24b147=a58_0xffb8c1,_0x2bdf0d=_0x3d78e7[_0x24b147(0x1a5)](_0x24b147(0x170));return{'code':trim(_0x3d78e7[_0x24b147(0x1a5)](_0x24b147(0x1a8))),'businessGroup':_0x3d78e7['str'](_0x24b147(0x174)),'expectBusinessGroup':_0x2bdf0d===undefined||_0x2bdf0d===''?undefined:_0x2bdf0d};}function validateInput(_0x957cf5){const _0x554e11=a58_0xffb8c1;if(!trim(_0x957cf5[_0x554e11(0x1a8)]))throw CliErrors[_0x554e11(0x18d)]('--code\x20is\x20required');if(_0x957cf5[_0x554e11(0x17f)]===undefined)throw CliErrors[_0x554e11(0x18d)]('--business-group\x20is\x20required');}function resolveBusinessGroupDataset(_0x2c1d4d,_0x3ac1ce){const _0x34f6f1=a58_0xffb8c1,_0x202c73=asPlainObject(_0x2c1d4d[_0x34f6f1(0x19f)]),_0x315505=asPlainObject(_0x2c1d4d[_0x34f6f1(0x19a)]),_0x29582d=resolveSourceType(_0x2c1d4d,_0x202c73,_0x315505),_0x3133cd=firstString(_0x2c1d4d[_0x34f6f1(0x190)],_0x2c1d4d[_0x34f6f1(0x1a8)],_0x202c73[_0x34f6f1(0x199)],_0x3ac1ce)||_0x3ac1ce;return{'id':firstNumber(_0x2c1d4d[_0x34f6f1(0x17a)],_0x2c1d4d['id'],_0x202c73[_0x34f6f1(0x197)])??firstString(_0x2c1d4d['modelId'],_0x2c1d4d['id'],_0x202c73[_0x34f6f1(0x197)])??null,'code':_0x3133cd,'name':firstString(_0x2c1d4d[_0x34f6f1(0x186)],_0x202c73[_0x34f6f1(0x19b)],_0x202c73[_0x34f6f1(0x186)])||null,'sourceType':_0x29582d};}function resolveSourceType(_0x489d48,_0x1f1bf2,_0x1615b7){const _0x59dbec=a58_0xffb8c1,_0x4704db=firstString(_0x489d48[_0x59dbec(0x16f)],_0x489d48[_0x59dbec(0x18b)],_0x1f1bf2[_0x59dbec(0x16f)],_0x1f1bf2['sourceType'])?.[_0x59dbec(0x17b)]()['toUpperCase']();if(_0x4704db===_0x59dbec(0x16d)||_0x4704db==='METADATA')return _0x4704db;if(Object[_0x59dbec(0x1a4)](_0x1615b7)['length']>0x0)return _0x59dbec(0x16d);throw CliErrors['validation'](_0x59dbec(0x194));}function loadCurrentBusinessGroup(_0x1b74f0,_0xdf6d0d){const _0x154098=a58_0xffb8c1,_0x169d3f=readBusinessGroupFromDatasetDetail(_0x1b74f0,_0xdf6d0d[_0x154098(0x18b)]);if(_0x169d3f[_0x154098(0x18c)])return normalizeBusinessGroup(_0x169d3f[_0x154098(0x1a7)]);if(_0xdf6d0d[_0x154098(0x18b)]===_0x154098(0x17e))return'';throw CliErrors[_0x154098(0x18d)](_0x154098(0x196),'Business\x20model\x20group\x20readback\x20must\x20be\x20available\x20by\x20datasetCode;\x20upgrade\x20the\x20backend\x20read\x20contract\x20instead\x20of\x20using\x20dblinkId/tableName.');}function readBusinessGroupFromDatasetDetail(_0x41c0e8,_0x1401a0){const _0x9d3f8f=a58_0xffb8c1,_0x3c2aed=asPlainObject(_0x41c0e8[_0x9d3f8f(0x19f)]),_0x5ac821=firstPresent(_0x41c0e8[_0x9d3f8f(0x17f)]);if(_0x5ac821[_0x9d3f8f(0x18c)])return _0x5ac821;const _0x27fb94=firstPresent(_0x3c2aed['businessGroup']);if(_0x27fb94[_0x9d3f8f(0x18c)])return _0x27fb94;if(_0x1401a0==='DB_TABLE')return{'found':![]};const _0x3c5cf8=readBusinessGroupFromExtend(_0x41c0e8[_0x9d3f8f(0x179)]);if(_0x3c5cf8['found'])return _0x3c5cf8;return readBusinessGroupFromExtend(_0x3c2aed[_0x9d3f8f(0x179)]);}function readBusinessGroupFromExtend(_0x4f8386){const _0x3123c8=a58_0xffb8c1;if(_0x4f8386===undefined||_0x4f8386===null||_0x4f8386==='')return{'found':![]};if(typeof _0x4f8386==='string')try{const _0x227a97=JSON[_0x3123c8(0x1a0)](_0x4f8386);return readBusinessGroupFromExtend(_0x227a97);}catch{return{'found':![]};}const _0x1e85e3=asPlainObject(_0x4f8386);if(Object[_0x3123c8(0x18f)][_0x3123c8(0x180)][_0x3123c8(0x173)](_0x1e85e3,'businessGroup'))return{'found':!![],'value':_0x1e85e3[_0x3123c8(0x17f)]};return{'found':![]};}function firstPresent(..._0x47f7a8){for(const _0x37cc7c of _0x47f7a8){if(_0x37cc7c!==undefined&&_0x37cc7c!==null)return{'found':!![],'value':_0x37cc7c};}return{'found':![]};}function assertExpectedBusinessGroup(_0x514bf3,_0x258300){const _0x218ab2=a58_0xffb8c1;if(_0x258300===undefined)return;const _0x7ff453=normalizeBusinessGroup(_0x258300);if(_0x514bf3!==_0x7ff453)throw CliErrors['validation']('Expectation\x20mismatch\x20at\x20businessGroup',_0x218ab2(0x171)+JSON[_0x218ab2(0x175)](_0x7ff453)+',\x20actual\x20'+JSON[_0x218ab2(0x175)](_0x514bf3));}function buildBackendPayload(_0x2d6c85,_0x254655,_0x1c17f5){const _0x16980d=a58_0xffb8c1;return{'appCode':_0x2d6c85,'datasetCode':_0x254655[_0x16980d(0x1a8)],'businessGroup':_0x1c17f5};}function a58_0x1207(){const _0x525550=['sourceType','found','validation','backend','prototype','modelCode','610826YjebdD','object','message','Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.','Dry-run:\x20business\x20model\x20group\x20would\x20change\x20for\x20dataset\x20','Dataset\x20detail\x20does\x20not\x20expose\x20businessGroup.','datasetId','775340pxXQbE','datasetCode','dbtableConfig','datasetName','2270320sCzFLr',',\x20actual\x20','POST','dataset','parse','isFinite','business-group-update','data','keys','str','Expected\x20current\x20business\x20model\x20group;\x20mismatch\x20aborts\x20without\x20writing','value','code','Updated\x20business\x20model\x20group\x20for\x20dataset\x20','18GEoCtv','Business\x20model\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','DB_TABLE','update','source','expect-business-group','Expected\x20','number','call','business-group','stringify','No\x20changes\x20for\x20business\x20model\x20group\x20on\x20dataset\x20','appCode','matched','extend','modelId','trim','887694iFypRw','5457640KDjTeV','METADATA','businessGroup','hasOwnProperty','35LnxfCS','386744DboGsZ','isArray','write','3WuLtBL','name','string','Update\x20business\x20model\x20group','/smartapi/question/er-config/business-group/edit','1381488PMhPql'];a58_0x1207=function(){return _0x525550;};return a58_0x1207();}function normalizeBusinessGroup(_0x45d873){const _0x1b6041=a58_0xffb8c1;if(_0x45d873===undefined||_0x45d873===null)return'';return String(_0x45d873)[_0x1b6041(0x17b)]();}function asPlainObject(_0x4b03ee){const _0x260313=a58_0xffb8c1;if(!_0x4b03ee||typeof _0x4b03ee!==_0x260313(0x192)||Array[_0x260313(0x183)](_0x4b03ee))return{};return _0x4b03ee;}function firstString(..._0x1169dc){const _0x5a666f=a58_0xffb8c1;for(const _0x2edded of _0x1169dc){if(typeof _0x2edded===_0x5a666f(0x187)&&_0x2edded[_0x5a666f(0x17b)]())return _0x2edded[_0x5a666f(0x17b)]();if(typeof _0x2edded==='number'&&Number[_0x5a666f(0x1a1)](_0x2edded))return String(_0x2edded);}return undefined;}function firstNumber(..._0x535467){const _0x4c3c7b=a58_0xffb8c1;for(const _0x30c96b of _0x535467){if(typeof _0x30c96b===_0x4c3c7b(0x172)&&Number['isFinite'](_0x30c96b))return _0x30c96b;if(typeof _0x30c96b==='string'&&_0x30c96b['trim']()&&Number[_0x4c3c7b(0x1a1)](Number(_0x30c96b)))return Number(_0x30c96b);}return null;}function trim(_0x79002d){const _0x562e51=a58_0xffb8c1;return String(_0x79002d||'')[_0x562e51(0x17b)]();}
|
|
1
|
+
function a59_0x375b(_0x55af21,_0x580b2e){_0x55af21=_0x55af21-0x1d1;const _0x4c2e85=a59_0x4c2e();let _0x375b3a=_0x4c2e85[_0x55af21];return _0x375b3a;}const a59_0x3beea6=a59_0x375b;(function(_0x152503,_0x4cce13){const _0x2e6faf=a59_0x375b,_0x59ff01=_0x152503();while(!![]){try{const _0x5cebd9=parseInt(_0x2e6faf(0x1e3))/0x1+-parseInt(_0x2e6faf(0x1d7))/0x2+-parseInt(_0x2e6faf(0x1db))/0x3+-parseInt(_0x2e6faf(0x1e7))/0x4+parseInt(_0x2e6faf(0x1f3))/0x5+parseInt(_0x2e6faf(0x1e9))/0x6*(parseInt(_0x2e6faf(0x1d9))/0x7)+parseInt(_0x2e6faf(0x1e5))/0x8*(parseInt(_0x2e6faf(0x1d4))/0x9);if(_0x5cebd9===_0x4cce13)break;else _0x59ff01['push'](_0x59ff01['shift']());}catch(_0x45aec7){_0x59ff01['push'](_0x59ff01['shift']());}}}(a59_0x4c2e,0x70484));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_0x3beea6(0x1ff);export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x38e6b4,input:_0x5f6b36,dryRun:_0x57344b}){const _0x45e3fb=a59_0x3beea6;validateInput(_0x5f6b36);const _0x2d055a=normalizeBusinessGroup(_0x5f6b36['businessGroup']),_0x2ec842=await getDatasetDetail(_0x5f6b36[_0x45e3fb(0x1e8)]),_0x3f9012=resolveBusinessGroupDataset(_0x2ec842,_0x5f6b36['code']),_0x6ace0b=loadCurrentBusinessGroup(_0x2ec842,_0x3f9012);assertExpectedBusinessGroup(_0x6ace0b,_0x5f6b36['expectBusinessGroup']);const _0x477d75=buildBackendPayload(_0x38e6b4,_0x3f9012,_0x2d055a),_0x42c256=_0x6ace0b!==_0x2d055a;let _0x1b819e;if(_0x42c256&&!_0x57344b){await updateErBusinessGroup(_0x477d75);const _0x45d415=await getDatasetDetail(_0x3f9012[_0x45e3fb(0x1e8)]),_0x37d643=resolveBusinessGroupDataset(_0x45d415,_0x3f9012['code']),_0x5c5c35=loadCurrentBusinessGroup(_0x45d415,_0x37d643);if(_0x5c5c35!==_0x2d055a)throw CliErrors[_0x45e3fb(0x1df)]('Business\x20model\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.',_0x45e3fb(0x1d1)+JSON[_0x45e3fb(0x201)](_0x2d055a)+_0x45e3fb(0x209)+JSON[_0x45e3fb(0x201)](_0x5c5c35)+'.');_0x1b819e={'verified':!![],'status':_0x45e3fb(0x1e4),'afterReadback':{'businessGroup':_0x5c5c35}};}else!_0x42c256&&(_0x1b819e={'verified':!![],'status':_0x45e3fb(0x1ee),'afterReadback':{'businessGroup':_0x6ace0b}});const _0x41260e={'operation':_0x45e3fb(0x208),'appCode':_0x38e6b4,'selector':{'code':_0x3f9012[_0x45e3fb(0x1e8)]},'dataset':_0x3f9012,'before':{'businessGroup':_0x6ace0b},'after':{'businessGroup':_0x2d055a},'changed':_0x42c256,'dryRun':_0x57344b,'submitted':_0x42c256&&!_0x57344b,'backend':{'method':'POST','path':BACKEND_PATH,'payload':_0x477d75},..._0x1b819e?{'verification':_0x1b819e}:{},'warnings':[]};return{'ok':!![],'data':_0x41260e,'message':_0x42c256?_0x57344b?_0x45e3fb(0x1d5)+_0x3f9012[_0x45e3fb(0x1e8)]:'Updated\x20business\x20model\x20group\x20for\x20dataset\x20'+_0x3f9012[_0x45e3fb(0x1e8)]:'No\x20changes\x20for\x20business\x20model\x20group\x20on\x20dataset\x20'+_0x3f9012['code']};}function a59_0x4c2e(){const _0x396865=['DB_TABLE','toUpperCase','update',',\x20actual\x20','isFinite','appCode','extend','keys','trim','Expected\x20','--business-group\x20is\x20required','string','702ezGEgJ','Dry-run:\x20business\x20model\x20group\x20would\x20change\x20for\x20dataset\x20','length','1652566BXeiEK','payload','84IsPmJg','Business\x20model\x20group\x20readback\x20must\x20be\x20available\x20by\x20datasetCode;\x20upgrade\x20the\x20backend\x20read\x20contract\x20instead\x20of\x20using\x20dblinkId/tableName.','476850yEpGSG','prototype','Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.','business-group','apiError','name','backend','sourceType','319390khhfXa','matched','56808ZkmmCJ','dbtableConfig','1627392usqqYz','code','367194vZwrfr','found','datasetName','datasetId','validation','unchanged','parse','modelId','dataset','businessGroup','1221665aLZfYP','expect-business-group','datasetCode','number','object','str','write','Dataset\x20detail\x20does\x20not\x20expose\x20businessGroup.','Update\x20business\x20model\x20group','value','METADATA','data','/smartapi/question/er-config/business-group/edit','isArray','stringify','source','message','New\x20business\x20model\x20group\x20value;\x20empty\x20string\x20clears\x20it','Expectation\x20mismatch\x20at\x20businessGroup'];a59_0x4c2e=function(){return _0x396865;};return a59_0x4c2e();}export const datasetBusinessGroupUpdate={'service':a59_0x3beea6(0x1f1),'command':'business-group-update','description':a59_0x3beea6(0x1fb),'risk':a59_0x3beea6(0x1f9),'flags':[CODE_FLAG,{'name':'business-group','type':a59_0x3beea6(0x1d3),'required':!![],'description':a59_0x3beea6(0x204)},{'name':a59_0x3beea6(0x1f4),'type':'string','required':![],'description':'Expected\x20current\x20business\x20model\x20group;\x20mismatch\x20aborts\x20without\x20writing'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0xbd40c9){validateInput(readBusinessGroupUpdateInput(_0xbd40c9));},async 'dryRun'(_0x4a2d34){const _0x460702=a59_0x3beea6,_0x109591=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x4a2d34[_0x460702(0x20b)],'input':readBusinessGroupUpdateInput(_0x4a2d34),'dryRun':!![]});return{'method':'POST','url':BACKEND_PATH,'body':_0x109591[_0x460702(0x1fe)][_0x460702(0x1e1)][_0x460702(0x1d8)],'description':_0x109591[_0x460702(0x203)],..._0x109591[_0x460702(0x1fe)]};},async 'execute'(_0x37a239){const _0x3f211d=a59_0x3beea6;return buildDatasetBusinessGroupUpdateResult({'appCode':_0x37a239[_0x3f211d(0x20b)],'input':readBusinessGroupUpdateInput(_0x37a239),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x45227b){const _0x5ecc64=a59_0x3beea6,_0x4ec7a8=_0x45227b[_0x5ecc64(0x1f8)](_0x5ecc64(0x1f4));return{'code':trim(_0x45227b[_0x5ecc64(0x1f8)](_0x5ecc64(0x1e8))),'businessGroup':_0x45227b[_0x5ecc64(0x1f8)](_0x5ecc64(0x1de)),'expectBusinessGroup':_0x4ec7a8===undefined||_0x4ec7a8===''?undefined:_0x4ec7a8};}function validateInput(_0x439f6d){const _0x141e7c=a59_0x3beea6;if(!trim(_0x439f6d['code']))throw CliErrors[_0x141e7c(0x1ed)]('--code\x20is\x20required');if(_0x439f6d['businessGroup']===undefined)throw CliErrors[_0x141e7c(0x1ed)](_0x141e7c(0x1d2));}function resolveBusinessGroupDataset(_0x36e5b0,_0x318711){const _0x1bb860=a59_0x3beea6,_0x106e8d=asPlainObject(_0x36e5b0['dataset']),_0x3082b9=asPlainObject(_0x36e5b0[_0x1bb860(0x1e6)]),_0x1c3393=resolveSourceType(_0x36e5b0,_0x106e8d,_0x3082b9),_0x3df182=firstString(_0x36e5b0['modelCode'],_0x36e5b0['code'],_0x106e8d[_0x1bb860(0x1f5)],_0x318711)||_0x318711;return{'id':firstNumber(_0x36e5b0[_0x1bb860(0x1f0)],_0x36e5b0['id'],_0x106e8d[_0x1bb860(0x1ec)])??firstString(_0x36e5b0['modelId'],_0x36e5b0['id'],_0x106e8d[_0x1bb860(0x1ec)])??null,'code':_0x3df182,'name':firstString(_0x36e5b0[_0x1bb860(0x1e0)],_0x106e8d[_0x1bb860(0x1eb)],_0x106e8d[_0x1bb860(0x1e0)])||null,'sourceType':_0x1c3393};}function resolveSourceType(_0x4e803d,_0x3d04be,_0x4317e9){const _0x40badb=a59_0x3beea6,_0x289bde=firstString(_0x4e803d[_0x40badb(0x202)],_0x4e803d[_0x40badb(0x1e2)],_0x3d04be['source'],_0x3d04be[_0x40badb(0x1e2)])?.[_0x40badb(0x20e)]()[_0x40badb(0x207)]();if(_0x289bde===_0x40badb(0x206)||_0x289bde==='METADATA')return _0x289bde;if(Object[_0x40badb(0x20d)](_0x4317e9)[_0x40badb(0x1d6)]>0x0)return _0x40badb(0x206);throw CliErrors[_0x40badb(0x1ed)](_0x40badb(0x1dd));}function loadCurrentBusinessGroup(_0x256f4f,_0x3d85ca){const _0x29b38f=a59_0x3beea6,_0x10c627=readBusinessGroupFromDatasetDetail(_0x256f4f,_0x3d85ca[_0x29b38f(0x1e2)]);if(_0x10c627[_0x29b38f(0x1ea)])return normalizeBusinessGroup(_0x10c627[_0x29b38f(0x1fc)]);if(_0x3d85ca[_0x29b38f(0x1e2)]===_0x29b38f(0x1fd))return'';throw CliErrors[_0x29b38f(0x1ed)](_0x29b38f(0x1fa),_0x29b38f(0x1da));}function readBusinessGroupFromDatasetDetail(_0x30e16f,_0x3cfeb6){const _0x3bddf2=a59_0x3beea6,_0x26f42c=asPlainObject(_0x30e16f['dataset']),_0x572ce8=firstPresent(_0x30e16f[_0x3bddf2(0x1f2)]);if(_0x572ce8['found'])return _0x572ce8;const _0x3c9945=firstPresent(_0x26f42c['businessGroup']);if(_0x3c9945['found'])return _0x3c9945;if(_0x3cfeb6===_0x3bddf2(0x206))return{'found':![]};const _0x9e16da=readBusinessGroupFromExtend(_0x30e16f[_0x3bddf2(0x20c)]);if(_0x9e16da['found'])return _0x9e16da;return readBusinessGroupFromExtend(_0x26f42c['extend']);}function readBusinessGroupFromExtend(_0x403da7){const _0xbc4d1c=a59_0x3beea6;if(_0x403da7===undefined||_0x403da7===null||_0x403da7==='')return{'found':![]};if(typeof _0x403da7===_0xbc4d1c(0x1d3))try{const _0x5f36c9=JSON[_0xbc4d1c(0x1ef)](_0x403da7);return readBusinessGroupFromExtend(_0x5f36c9);}catch{return{'found':![]};}const _0x2ac22f=asPlainObject(_0x403da7);if(Object[_0xbc4d1c(0x1dc)]['hasOwnProperty']['call'](_0x2ac22f,_0xbc4d1c(0x1f2)))return{'found':!![],'value':_0x2ac22f[_0xbc4d1c(0x1f2)]};return{'found':![]};}function firstPresent(..._0x4e5dcc){for(const _0x2810bb of _0x4e5dcc){if(_0x2810bb!==undefined&&_0x2810bb!==null)return{'found':!![],'value':_0x2810bb};}return{'found':![]};}function assertExpectedBusinessGroup(_0x1c83fa,_0x54e33e){const _0x1a0f8a=a59_0x3beea6;if(_0x54e33e===undefined)return;const _0xabc755=normalizeBusinessGroup(_0x54e33e);if(_0x1c83fa!==_0xabc755)throw CliErrors[_0x1a0f8a(0x1ed)](_0x1a0f8a(0x205),_0x1a0f8a(0x1d1)+JSON[_0x1a0f8a(0x201)](_0xabc755)+_0x1a0f8a(0x209)+JSON[_0x1a0f8a(0x201)](_0x1c83fa));}function buildBackendPayload(_0x497468,_0x5bbff2,_0x51471c){const _0x17d475=a59_0x3beea6;return{'appCode':_0x497468,'datasetCode':_0x5bbff2[_0x17d475(0x1e8)],'businessGroup':_0x51471c};}function normalizeBusinessGroup(_0x566db6){const _0x5635cc=a59_0x3beea6;if(_0x566db6===undefined||_0x566db6===null)return'';return String(_0x566db6)[_0x5635cc(0x20e)]();}function asPlainObject(_0xd58b99){const _0x4d1dcf=a59_0x3beea6;if(!_0xd58b99||typeof _0xd58b99!==_0x4d1dcf(0x1f7)||Array[_0x4d1dcf(0x200)](_0xd58b99))return{};return _0xd58b99;}function firstString(..._0xdeb6d9){const _0x167dfc=a59_0x3beea6;for(const _0x2bd764 of _0xdeb6d9){if(typeof _0x2bd764===_0x167dfc(0x1d3)&&_0x2bd764[_0x167dfc(0x20e)]())return _0x2bd764[_0x167dfc(0x20e)]();if(typeof _0x2bd764===_0x167dfc(0x1f6)&&Number[_0x167dfc(0x20a)](_0x2bd764))return String(_0x2bd764);}return undefined;}function firstNumber(..._0x266881){const _0x55ad14=a59_0x3beea6;for(const _0x184390 of _0x266881){if(typeof _0x184390===_0x55ad14(0x1f6)&&Number['isFinite'](_0x184390))return _0x184390;if(typeof _0x184390===_0x55ad14(0x1d3)&&_0x184390['trim']()&&Number[_0x55ad14(0x20a)](Number(_0x184390)))return Number(_0x184390);}return null;}function trim(_0x382a01){const _0x5f112d=a59_0x3beea6;return String(_0x382a01||'')[_0x5f112d(0x20e)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a60_0x510a6c=a60_0x5341;(function(_0x5ddf72,_0x1e1651){const _0x495918=a60_0x5341,_0x3af634=_0x5ddf72();while(!![]){try{const _0x5e5559=-parseInt(_0x495918(0x154))/0x1*(parseInt(_0x495918(0x135))/0x2)+parseInt(_0x495918(0x156))/0x3*(parseInt(_0x495918(0x134))/0x4)+parseInt(_0x495918(0x143))/0x5*(parseInt(_0x495918(0x148))/0x6)+parseInt(_0x495918(0x155))/0x7*(parseInt(_0x495918(0x145))/0x8)+parseInt(_0x495918(0x151))/0x9*(-parseInt(_0x495918(0x146))/0xa)+-parseInt(_0x495918(0x138))/0xb+parseInt(_0x495918(0x14f))/0xc;if(_0x5e5559===_0x1e1651)break;else _0x3af634['push'](_0x3af634['shift']());}catch(_0x5184e4){_0x3af634['push'](_0x3af634['shift']());}}}(a60_0x2b6d,0x6a4f6));import{CliErrors}from'../../errors.js';export const RUNTIME_DATA_ACCESS_COMMANDS={'cli':a60_0x510a6c(0x136),'filter':a60_0x510a6c(0x13a),'getOne':'lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27\x20--format\x20compress'};export const RUNTIME_DATA_ACCESS_SUMMARY=a60_0x510a6c(0x157);function valueToString(_0x4b8565){const _0x119eb1=a60_0x510a6c;return _0x4b8565==null?'':String(_0x4b8565)[_0x119eb1(0x158)]();}function a60_0x5341(_0x58f14e,_0x2fe411){_0x58f14e=_0x58f14e-0x133;const _0x2b6dd1=a60_0x2b6d();let _0x5341d7=_0x2b6dd1[_0x58f14e];return _0x5341d7;}function getDatasetCode(_0x2c2936){const _0x2441ba=a60_0x510a6c;return valueToString(_0x2c2936[_0x2441ba(0x159)]??_0x2c2936['modelCode']??_0x2c2936[_0x2441ba(0x13b)]?.[_0x2441ba(0x150)]);}function getDatasetName(_0x4afe81){const _0x5e21af=a60_0x510a6c;return valueToString(_0x4afe81[_0x5e21af(0x133)]??_0x4afe81[_0x5e21af(0x13b)]?.[_0x5e21af(0x14d)])||_0x5e21af(0x13e);}function a60_0x2b6d(){const _0x3ee9de=['lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27<json>\x27\x20--format\x20compress','dataset','filter','dbtableConfig','unknown','dbId','object','原因:schema\x20introspection\x20与\x20custom\x20SQL\x20需要\x20source=DB_TABLE、dbtableConfig.dbId、dbtableConfig.tableName\x20与数据库连接上下文。','join','60VbFSvE','length','1384qAOBXE','21430SQOeHA','\x20类型,没有可用于\x20','84264MSwsPs','当前数据集\x20\x22','UNKNOWN','getOne','SQL\x20schema\x20validation','datasetName','如果只是查看运行态真实行数据,请切换到\x20lovrabet\x20CLI:','9796236GWLKyG','datasetCode','2223kkQlbr','\x20的\x20DB_TABLE\x20数据源上下文。','sourceType','684458jjtNJo','30737TnFFNY','397857nlgBBw','Use\x20lovrabet\x20data\x20filter/getOne\x20for\x20real\x20runtime\x20records.','trim','code','tableName','name','8cbLzxm','2Bxdcyu','lovrabet','dbtable','3965907jskUlR','请先将该数据集升级/迁移为\x20DB_TABLE\x20数据集,再基于新的\x20dataset\x20code\x20继续开发。'];a60_0x2b6d=function(){return _0x3ee9de;};return a60_0x2b6d();}function getDatasetSource(_0x5be6db){const _0x46834a=a60_0x510a6c;return valueToString(_0x5be6db['source']??_0x5be6db[_0x46834a(0x13b)]?.[_0x46834a(0x153)])['toUpperCase']();}function getDbtableConfig(_0x14d792){const _0x287f61=a60_0x510a6c,_0x24baca=_0x14d792[_0x287f61(0x13d)]??_0x14d792[_0x287f61(0x137)];return _0x24baca&&typeof _0x24baca===_0x287f61(0x140)?_0x24baca:{};}export function isDbTableBackedDataset(_0xa070d1){const _0x33e7b2=a60_0x510a6c,_0x33f1d1=getDatasetSource(_0xa070d1);if(_0x33f1d1==='METADATA')return![];const _0x4e5072=getDbtableConfig(_0xa070d1),_0x1a644d=_0x4e5072[_0x33e7b2(0x13f)]??_0x4e5072['id'],_0x499de5=valueToString(_0x4e5072[_0x33e7b2(0x15a)]??_0xa070d1[_0x33e7b2(0x15a)]??_0xa070d1['dataset']?.[_0x33e7b2(0x15a)]);return _0x1a644d!==undefined&&_0x1a644d!==null&&_0x499de5[_0x33e7b2(0x144)]>0x0;}export function filterDbTableBackedDatasets(_0x223157){const _0x5301a4=a60_0x510a6c;return _0x223157[_0x5301a4(0x13c)](_0x4c42ae=>isDbTableBackedDataset(_0x4c42ae));}export function buildDbTableBackedRequirementMessage(_0x5657ff,_0x7d854c=a60_0x510a6c(0x14c)){const _0x4b859e=a60_0x510a6c,_0x5aefe6=getDatasetSource(_0x5657ff)||_0x4b859e(0x14a),_0x407117=getDatasetName(_0x5657ff),_0x5f41a5=getDatasetCode(_0x5657ff),_0x4b0ce3=_0x5f41a5?'\x20('+_0x5f41a5+')':'';return[_0x4b859e(0x149)+_0x407117+'\x22'+_0x4b0ce3+'\x20是\x20'+_0x5aefe6+_0x4b859e(0x147)+_0x7d854c+_0x4b859e(0x152),_0x4b859e(0x141),_0x4b859e(0x139),_0x4b859e(0x14e)+RUNTIME_DATA_ACCESS_COMMANDS[_0x4b859e(0x13c)]+';'+RUNTIME_DATA_ACCESS_COMMANDS[_0x4b859e(0x14b)]+'。'][_0x4b859e(0x142)]('\x20');}export function assertDatasetIsDbTableBacked(_0x511b51,_0x4267ef){if(!isDbTableBackedDataset(_0x511b51))throw CliErrors['validation'](buildDbTableBackedRequirementMessage(_0x511b51,_0x4267ef));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a61_0x27afcd=a61_0x5c97;(function(_0x1d411b,_0x1ae8c2){const _0x2e88ad=a61_0x5c97,_0x7f0cb3=_0x1d411b();while(!![]){try{const _0xcd387f=parseInt(_0x2e88ad(0x21b))/0x1*(parseInt(_0x2e88ad(0x1ec))/0x2)+-parseInt(_0x2e88ad(0x1f1))/0x3*(-parseInt(_0x2e88ad(0x1f5))/0x4)+parseInt(_0x2e88ad(0x216))/0x5+-parseInt(_0x2e88ad(0x1f6))/0x6*(-parseInt(_0x2e88ad(0x204))/0x7)+-parseInt(_0x2e88ad(0x1f7))/0x8*(parseInt(_0x2e88ad(0x1ea))/0x9)+parseInt(_0x2e88ad(0x1ee))/0xa+-parseInt(_0x2e88ad(0x1f9))/0xb*(parseInt(_0x2e88ad(0x1fe))/0xc);if(_0xcd387f===_0x1ae8c2)break;else _0x7f0cb3['push'](_0x7f0cb3['shift']());}catch(_0x1c638f){_0x7f0cb3['push'](_0x7f0cb3['shift']());}}}(a61_0x29aa,0xe8b4e));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';const DATASET_ID_FLAG={'name':'id','type':a61_0x27afcd(0x1f4),'description':a61_0x27afcd(0x1f0)},DBID_FLAG={'name':a61_0x27afcd(0x1f3),'type':'number','description':a61_0x27afcd(0x21d)},CONFIRM_FLAG={'name':a61_0x27afcd(0x1ff),'type':'boolean','description':a61_0x27afcd(0x210)},EXPECTED_COUNT_FLAG={'name':a61_0x27afcd(0x201),'type':a61_0x27afcd(0x1f4),'description':'Abort\x20unless\x20the\x20matched\x20dataset\x20count\x20equals\x20this\x20value'};export const datasetDelete={'service':'dataset','command':'delete','description':a61_0x27afcd(0x207),'risk':a61_0x27afcd(0x209),'flags':[DATASET_ID_FLAG,CODE_FLAG_OPTIONAL,DBID_FLAG,CONFIRM_FLAG,EXPECTED_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0xb0ac06){const _0x2446c1=a61_0x27afcd,_0x5b0ddf=_0xb0ac06[_0x2446c1(0x202)]('id'),_0x20ea87=_0xb0ac06[_0x2446c1(0x21a)](_0x2446c1(0x211)),_0xb4abbf=_0xb0ac06[_0x2446c1(0x202)](_0x2446c1(0x1f3)),_0xee66dc=[_0x5b0ddf>0x0,Boolean(_0x20ea87),_0xb4abbf>0x0][_0x2446c1(0x1ef)](Boolean);if(_0xee66dc['length']===0x0)throw CliErrors[_0x2446c1(0x1fa)]('One\x20of\x20--id,\x20--code,\x20or\x20--dbid\x20is\x20required.');if(_0xee66dc['length']>0x1)throw CliErrors[_0x2446c1(0x1fa)](_0x2446c1(0x20a));},async 'dryRun'(_0x1e90a8){const _0x8ed088=a61_0x27afcd,_0x2c57ea=await resolveTargets(_0x1e90a8);return{'method':_0x8ed088(0x1fc),'url':_0x8ed088(0x21c),'body':{'appCode':_0x1e90a8['appCode'],'count':_0x2c57ea[_0x8ed088(0x206)],'datasets':_0x2c57ea},'description':_0x8ed088(0x20f)+_0x2c57ea['length']+_0x8ed088(0x20d)};},async 'execute'(_0x22b451){const _0x26441e=a61_0x27afcd;if(!_0x22b451[_0x26441e(0x20c)]('confirm'))throw CliErrors['validation']('--confirm\x20is\x20required\x20to\x20delete\x20datasets.',_0x26441e(0x1ed));const _0x355b6f=await resolveTargets(_0x22b451),_0x2bfaea=[],_0x12e8ea=[];for(const _0x2ca4a9 of _0x355b6f){try{await deleteDataset(_0x22b451['appCode'],_0x2ca4a9['id']),_0x2bfaea[_0x26441e(0x215)](_0x2ca4a9);}catch(_0x453d27){_0x12e8ea['push']({..._0x2ca4a9,'error':_0x453d27 instanceof Error?_0x453d27[_0x26441e(0x1fb)]:String(_0x453d27)});}}if(_0x12e8ea[_0x26441e(0x206)]>0x0)return{'ok':![],'data':{'requested':_0x355b6f[_0x26441e(0x206)],'deletedCount':_0x2bfaea[_0x26441e(0x206)],'failedCount':_0x12e8ea['length'],'deleted':_0x2bfaea,'failed':_0x12e8ea},'message':_0x26441e(0x217)+_0x2bfaea[_0x26441e(0x206)]+'/'+_0x355b6f[_0x26441e(0x206)]+_0x26441e(0x20b)+_0x12e8ea['length']+'\x20failed'};return{'ok':!![],'data':{'requested':_0x355b6f[_0x26441e(0x206)],'deletedCount':_0x2bfaea[_0x26441e(0x206)],'deleted':_0x2bfaea},'message':'Deleted\x20'+_0x2bfaea['length']+_0x26441e(0x218)};}};async function resolveTargets(_0x4d1b9f){const _0x16d1a3=a61_0x27afcd,_0x202389=_0x4d1b9f[_0x16d1a3(0x202)]('id'),_0x10e98c=_0x4d1b9f[_0x16d1a3(0x21a)](_0x16d1a3(0x211)),_0x4f5b9e=_0x4d1b9f[_0x16d1a3(0x202)]('dbid');let _0x576fd7;_0x10e98c?(_0x576fd7=await listDatasets(_0x4d1b9f[_0x16d1a3(0x1f2)],{'code':_0x10e98c}),_0x576fd7=_0x576fd7[_0x16d1a3(0x1ef)](_0x5643ff=>_0x5643ff[_0x16d1a3(0x211)]===_0x10e98c)):(_0x576fd7=await listDatasets(_0x4d1b9f[_0x16d1a3(0x1f2)]),_0x202389>0x0&&(_0x576fd7=_0x576fd7[_0x16d1a3(0x1ef)](_0x411d17=>_0x411d17['id']===_0x202389)),_0x4f5b9e>0x0&&(_0x576fd7=_0x576fd7[_0x16d1a3(0x1ef)](_0x48d218=>_0x48d218['dbtableConfig']?.['dbId']===_0x4f5b9e)));const _0x2a12e4=_0x576fd7[_0x16d1a3(0x208)](normalizeTarget);if(_0x2a12e4[_0x16d1a3(0x206)]===0x0){const _0x5931dd=_0x10e98c||(_0x202389>0x0?_0x16d1a3(0x20e)+_0x202389:'dbid='+_0x4f5b9e);throw CliErrors['validation'](_0x16d1a3(0x205)+_0x5931dd+'.');}const _0x3bdb61=_0x4d1b9f[_0x16d1a3(0x202)]('expected-count');if(_0x3bdb61>0x0&&_0x2a12e4[_0x16d1a3(0x206)]!==_0x3bdb61)throw CliErrors[_0x16d1a3(0x1fa)](_0x16d1a3(0x1eb)+_0x2a12e4['length']+_0x16d1a3(0x203)+_0x3bdb61+'.');return _0x2a12e4;}function a61_0x29aa(){const _0x5cb7cb=['3CTLEFj','appCode','dbid','number','1900496lBhVsQ','1021578tcgBta','32RfiOSB','dbName','133089JfvLIq','validation','message','POST','name','3276vLmDqZ','confirm','isArray','expected-count','num','\x20dataset(s),\x20but\x20--expected-count\x20is\x20','14zJSyJI','No\x20undeleted\x20dataset\x20found\x20for\x20','length','Delete\x20dataset\x20metadata\x20by\x20id/code\x20or\x20all\x20datasets\x20under\x20a\x20db\x20id','map','high-risk-write','Use\x20only\x20one\x20of\x20--id,\x20--code,\x20or\x20--dbid.','\x20dataset(s);\x20','bool','\x20dataset(s).\x20This\x20only\x20deletes\x20platform\x20dataset\x20metadata\x20and\x20related\x20page/menu\x20records,\x20not\x20physical\x20databases\x20or\x20tables.','id=','Would\x20delete\x20','Required\x20to\x20execute\x20dataset\x20deletion','code','dbtableConfig','relationPages','description','push','5401515tcdhcM','Deleted\x20','\x20dataset(s)','source','str','772864AJlBjA','/smartapi/dataset/delete-dataset','Delete\x20all\x20datasets\x20under\x20this\x20database\x20connection\x20id','dbId','308538BFoOiB','Matched\x20','2cFaEGJ','Run\x20with\x20--dry-run\x20first,\x20then\x20add\x20--confirm\x20when\x20the\x20target\x20list\x20is\x20correct.','17245040JTrtdF','filter','Dataset\x20id'];a61_0x29aa=function(){return _0x5cb7cb;};return a61_0x29aa();}function a61_0x5c97(_0x2680bb,_0x4cd65e){_0x2680bb=_0x2680bb-0x1e9;const _0x29aaa2=a61_0x29aa();let _0x5c9746=_0x29aaa2[_0x2680bb];return _0x5c9746;}function normalizeTarget(_0x41d0c0){const _0x38dc01=a61_0x27afcd,_0x36a921=_0x41d0c0[_0x38dc01(0x212)]??{};return{'id':_0x41d0c0['id'],'code':_0x41d0c0[_0x38dc01(0x211)],'name':_0x41d0c0[_0x38dc01(0x1fd)],'description':_0x41d0c0[_0x38dc01(0x214)],'source':_0x41d0c0[_0x38dc01(0x219)],'dbId':_0x36a921[_0x38dc01(0x1e9)],'dbName':_0x36a921[_0x38dc01(0x1f8)],'tableName':_0x36a921['tableName'],'relatedPageCount':Array[_0x38dc01(0x200)](_0x41d0c0[_0x38dc01(0x213)])?_0x41d0c0[_0x38dc01(0x213)][_0x38dc01(0x206)]:undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a62_0x43df(_0x166ac4,_0x4bbb7b){_0x166ac4=_0x166ac4-0x16d;const _0x36a949=a62_0x36a9();let _0x43dfd0=_0x36a949[_0x166ac4];return _0x43dfd0;}const a62_0xa0b59c=a62_0x43df;(function(_0x8ea739,_0x145994){const _0x5effcb=a62_0x43df,_0x4dcf50=_0x8ea739();while(!![]){try{const _0x30f689=-parseInt(_0x5effcb(0x19d))/0x1*(-parseInt(_0x5effcb(0x195))/0x2)+-parseInt(_0x5effcb(0x19a))/0x3*(-parseInt(_0x5effcb(0x1b1))/0x4)+parseInt(_0x5effcb(0x1ac))/0x5*(parseInt(_0x5effcb(0x18b))/0x6)+-parseInt(_0x5effcb(0x19c))/0x7+-parseInt(_0x5effcb(0x17a))/0x8+-parseInt(_0x5effcb(0x18d))/0x9+parseInt(_0x5effcb(0x197))/0xa;if(_0x30f689===_0x145994)break;else _0x4dcf50['push'](_0x4dcf50['shift']());}catch(_0x25f75a){_0x4dcf50['push'](_0x4dcf50['shift']());}}}(a62_0x36a9,0x44c89));function a62_0x36a9(){const _0x14b014=['filter','labelField','updateTimeField','6FrwJjG','requestFields','3880818oiNzQC','dblinkInfoDTO','modifierIdField','source','extend','deprecated','detail','allFieldNames','40OhRBLd','allFields','2143060HMUjaz','relatedPageInfoList','split','645izWYwo','doType','704543PNokLI','1585qqbwEM','length','string','path','host','dbName','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','toDatasetName','operations','validateRules','required','relationId','datasetKey','beforeScriptId','main_sub','2730440lIOtua','bizRelationType','fields','displayName','method','2012xgOgNC','code','dbType','toFieldLabel','isArray','read','properties','parse','dbId','toDatasetCode','toTableName','name','logicField','tableComment','dataset','description','trim','type','responseBody','createTimeField','fromField','creatorIdField','requestBody','columnCodeListWithDeleted','tableName','afterScriptId','sourceType','responseFields','693208PkvxOp','formatRules','map','indexes','pkField','object','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically','title','options','modelId','toField','str','modelCode','dbtableConfig'];a62_0x36a9=function(){return _0x14b014;};return a62_0x36a9();}import{getDatasetDetail}from'../../core/api-client.js';import{CODE_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function normalizeField(_0x12093e){const _0x3a83f8=a62_0x43df;if(_0x12093e['deleted'])return null;const _0x2671ea=Boolean(_0x12093e['displayName']!==undefined||_0x12093e['doType']!==undefined);let _0x1f0aef={};if(!_0x2671ea&&typeof _0x12093e[_0x3a83f8(0x191)]===_0x3a83f8(0x19f))try{_0x1f0aef=JSON['parse'](_0x12093e[_0x3a83f8(0x191)]);}catch{}const _0x4bbadf=_0x2671ea?_0x12093e[_0x3a83f8(0x1bc)]:_0x12093e[_0x3a83f8(0x1b2)],_0x1c004c=_0x2671ea?_0x12093e[_0x3a83f8(0x1af)]:_0x12093e[_0x3a83f8(0x1bc)],_0x5137f1=_0x2671ea?_0x12093e[_0x3a83f8(0x19b)]:_0x12093e[_0x3a83f8(0x16f)]||_0x12093e['dataType'],_0x2bb7fa=_0x2671ea?_0x12093e['pkField']===!![]:_0x1f0aef[_0x3a83f8(0x17e)]===!![],_0xfbbebe=_0x2671ea?_0x12093e[_0x3a83f8(0x1a7)]===!![]:_0x1f0aef[_0x3a83f8(0x1a7)]===!![],_0x3eb8ed=_0x2671ea?_0x12093e[_0x3a83f8(0x182)]??null:_0x1f0aef[_0x3a83f8(0x182)]??null,_0x10bbfe={'name':_0x4bbadf,'displayName':_0x1c004c||_0x4bbadf,'type':_0x5137f1,'dbType':_0x12093e[_0x3a83f8(0x1b3)],'pk':_0x2bb7fa,'required':_0xfbbebe,'deprecated':_0x12093e[_0x3a83f8(0x192)]===!![],'description':_0x12093e['description']||undefined};return Array[_0x3a83f8(0x1b5)](_0x3eb8ed)&&_0x3eb8ed[_0x3a83f8(0x19e)]>0x0&&(_0x10bbfe[_0x3a83f8(0x182)]=_0x3eb8ed),_0x10bbfe;}function parseJsonMaybe(_0x3c95ec){const _0x321e46=a62_0x43df;if(typeof _0x3c95ec!==_0x321e46(0x19f))return _0x3c95ec;try{return JSON[_0x321e46(0x1b8)](_0x3c95ec);}catch{return _0x3c95ec;}}function normalizeOperationEntry(_0x16d763,_0x45fba9){const _0x107c36=a62_0x43df;if(!_0x45fba9||typeof _0x45fba9!==_0x107c36(0x17f))return null;if(!_0x45fba9[_0x107c36(0x1b0)]||!_0x45fba9[_0x107c36(0x1a0)])return null;const _0x35ddde={'name':_0x16d763,'method':_0x45fba9[_0x107c36(0x1b0)],'path':_0x45fba9[_0x107c36(0x1a0)]};if(_0x45fba9[_0x107c36(0x1a1)])_0x35ddde[_0x107c36(0x1a1)]=_0x45fba9[_0x107c36(0x1a1)];if(_0x45fba9['requestBody']!=null){const _0x1fd515=parseJsonMaybe(_0x45fba9[_0x107c36(0x174)]);_0x35ddde[_0x107c36(0x174)]=_0x1fd515;}if(_0x45fba9['responseBody']!=null){const _0x16673d=parseJsonMaybe(_0x45fba9[_0x107c36(0x170)]);_0x35ddde['responseBody']=_0x16673d;}if(_0x45fba9[_0x107c36(0x1aa)]!=null)_0x35ddde[_0x107c36(0x1aa)]=_0x45fba9[_0x107c36(0x1aa)];if(_0x45fba9[_0x107c36(0x177)]!=null)_0x35ddde[_0x107c36(0x177)]=_0x45fba9[_0x107c36(0x177)];if(Array['isArray'](_0x45fba9[_0x107c36(0x18c)]))_0x35ddde[_0x107c36(0x18c)]=_0x45fba9[_0x107c36(0x18c)];if(Array['isArray'](_0x45fba9[_0x107c36(0x179)]))_0x35ddde[_0x107c36(0x179)]=_0x45fba9['responseFields'];return _0x35ddde;}function summarizeDbtable(_0x283b0d){const _0x242390=a62_0x43df,_0x1b3d39={},_0xaedb75=[_0x242390(0x1b9),'dbName',_0x242390(0x176),'datasetKey',_0x242390(0x17e),_0x242390(0x196),_0x242390(0x1bd),_0x242390(0x171),_0x242390(0x18a),_0x242390(0x173),'creatorNameField',_0x242390(0x18f),'modifierNameField',_0x242390(0x189),_0x242390(0x18e)];for(const _0x295cb5 of _0xaedb75){if(_0x283b0d[_0x295cb5]!==undefined)_0x1b3d39[_0x295cb5]=_0x283b0d[_0x295cb5];}return typeof _0x1b3d39[_0x242390(0x196)]==='string'&&_0x1b3d39[_0x242390(0x196)]['length']>0x0&&(_0x1b3d39[_0x242390(0x194)]=_0x1b3d39[_0x242390(0x196)][_0x242390(0x199)](',')[_0x242390(0x17c)](_0x104d97=>_0x104d97[_0x242390(0x16e)]())['filter'](Boolean)),_0x1b3d39;}function normalizeRelatedPages(_0x3b9632){const _0x820156=a62_0x43df;if(!Array[_0x820156(0x1b5)](_0x3b9632))return[];return _0x3b9632[_0x820156(0x188)](_0x8a8438=>_0x8a8438&&typeof _0x8a8438===_0x820156(0x17f))[_0x820156(0x17c)](_0x23968b=>({'id':_0x23968b['id'],'type':_0x23968b['type'],'code':_0x23968b[_0x820156(0x1b2)],'title':_0x23968b[_0x820156(0x181)],'deleted':_0x23968b['deleted']===!![]}));}export const datasetDetail={'service':a62_0xa0b59c(0x1bf),'command':a62_0xa0b59c(0x193),'description':a62_0xa0b59c(0x1a3),'risk':a62_0xa0b59c(0x1b6),'flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':'alias','type':'string','description':a62_0xa0b59c(0x180)}],async 'execute'(_0x1a1008){const _0x1d9c5b=a62_0xa0b59c,_0x233bc8=await getDatasetDetail(_0x1a1008[_0x1d9c5b(0x185)](_0x1d9c5b(0x1b2))),_0x3245ce=Array['isArray'](_0x233bc8[_0x1d9c5b(0x1ae)])?_0x233bc8[_0x1d9c5b(0x1ae)]:Array[_0x1d9c5b(0x1b5)](_0x233bc8[_0x1d9c5b(0x1b7)])?_0x233bc8[_0x1d9c5b(0x1b7)]:[],_0x13d62e=_0x3245ce[_0x1d9c5b(0x17c)](_0x54eb5b=>normalizeField(_0x54eb5b))[_0x1d9c5b(0x188)](_0x286e04=>_0x286e04!==null),_0x26c06a=_0x233bc8[_0x1d9c5b(0x1a5)]??{},_0x5eb244=[];for(const [_0x1f27b8,_0x23915b]of Object['entries'](_0x26c06a)){const _0x4116fb=normalizeOperationEntry(_0x1f27b8,_0x23915b);if(_0x4116fb)_0x5eb244['push'](_0x4116fb);}const _0x3355cb=_0x233bc8[_0x1d9c5b(0x187)]??{},_0x1e5ed9=_0x233bc8[_0x1d9c5b(0x1bf)]??{},_0x531afc=_0x3355cb[_0x1d9c5b(0x1b9)]!=null?{'id':_0x3355cb[_0x1d9c5b(0x1b9)],'name':_0x3355cb[_0x1d9c5b(0x1a2)]??null}:undefined;let _0x11c157;return typeof _0x233bc8[_0x1d9c5b(0x191)]===_0x1d9c5b(0x19f)&&(_0x11c157=parseJsonMaybe(_0x233bc8[_0x1d9c5b(0x191)])),{'ok':!![],'data':{'id':_0x233bc8[_0x1d9c5b(0x183)]??_0x233bc8['id'],'name':_0x233bc8[_0x1d9c5b(0x1bc)],'code':_0x233bc8[_0x1d9c5b(0x186)]||_0x233bc8[_0x1d9c5b(0x1b2)],'doVersion':_0x233bc8['doVersion'],'description':_0x233bc8[_0x1d9c5b(0x16d)]||_0x1e5ed9[_0x1d9c5b(0x1be)]||undefined,'source':_0x233bc8[_0x1d9c5b(0x190)]||_0x1e5ed9[_0x1d9c5b(0x178)],'table':_0x3355cb['tableName']||_0x1e5ed9[_0x1d9c5b(0x176)],'datasetKey':_0x3355cb[_0x1d9c5b(0x1a9)],'pk':_0x3355cb[_0x1d9c5b(0x17e)],'db':_0x531afc,'dbtable':summarizeDbtable(_0x3355cb),'fields':_0x13d62e,'operations':_0x5eb244,'indexes':Array[_0x1d9c5b(0x1b5)](_0x1e5ed9[_0x1d9c5b(0x17d)])?_0x1e5ed9[_0x1d9c5b(0x17d)]:[],'relations':Array[_0x1d9c5b(0x1b5)](_0x233bc8['relations'])?_0x233bc8['relations'][_0x1d9c5b(0x17c)](_0x353d3d=>({..._0x353d3d['relationId']!=null?{'relationId':_0x353d3d[_0x1d9c5b(0x1a8)]}:{},'fromDataset':_0x233bc8[_0x1d9c5b(0x1bc)],'fromCode':_0x233bc8[_0x1d9c5b(0x186)]||_0x233bc8[_0x1d9c5b(0x1b2)],'fromTable':_0x3355cb[_0x1d9c5b(0x176)]||_0x1e5ed9[_0x1d9c5b(0x176)],'fromField':_0x353d3d[_0x1d9c5b(0x172)],'toDataset':_0x353d3d[_0x1d9c5b(0x1a4)],'toCode':_0x353d3d[_0x1d9c5b(0x1ba)],'toTable':_0x353d3d[_0x1d9c5b(0x1bb)],'toField':_0x353d3d[_0x1d9c5b(0x184)],'labelField':_0x353d3d[_0x1d9c5b(0x1b4)]||undefined,'cardinality':_0x353d3d['cardinality']||undefined,'bizRelationType':_0x353d3d[_0x1d9c5b(0x1ad)]===_0x1d9c5b(0x1ab)?_0x1d9c5b(0x1ab):null})):[],'relatedPages':normalizeRelatedPages(_0x233bc8[_0x1d9c5b(0x198)]),...Array[_0x1d9c5b(0x1b5)](_0x233bc8[_0x1d9c5b(0x175)])?{'columnCodeListWithDeleted':_0x233bc8[_0x1d9c5b(0x175)]}:{},'formatRules':Array[_0x1d9c5b(0x1b5)](_0x233bc8[_0x1d9c5b(0x17b)])?_0x233bc8[_0x1d9c5b(0x17b)]:[],'validateRules':Array[_0x1d9c5b(0x1b5)](_0x233bc8[_0x1d9c5b(0x1a6)])?_0x233bc8[_0x1d9c5b(0x1a6)]:[],..._0x11c157!==undefined?{'extend':_0x11c157}:{},'stats':{'fieldCount':_0x13d62e['length'],'operationCount':_0x5eb244[_0x1d9c5b(0x19e)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a63_0xc4bca4=a63_0x1dd0;(function(_0x2e5ca1,_0x546909){const _0x33e3a0=a63_0x1dd0,_0x392229=_0x2e5ca1();while(!![]){try{const _0x20ca1b=parseInt(_0x33e3a0(0x208))/0x1+-parseInt(_0x33e3a0(0x1e0))/0x2+-parseInt(_0x33e3a0(0x210))/0x3+parseInt(_0x33e3a0(0x1d7))/0x4*(parseInt(_0x33e3a0(0x1e5))/0x5)+parseInt(_0x33e3a0(0x1e9))/0x6*(parseInt(_0x33e3a0(0x1d5))/0x7)+parseInt(_0x33e3a0(0x1fa))/0x8+-parseInt(_0x33e3a0(0x1f0))/0x9;if(_0x20ca1b===_0x546909)break;else _0x392229['push'](_0x392229['shift']());}catch(_0x32f376){_0x392229['push'](_0x392229['shift']());}}}(a63_0x4f27,0x5dd1c));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';function a63_0x1dd0(_0xc04686,_0x1ddcdf){_0xc04686=_0xc04686-0x1d2;const _0x4f2749=a63_0x4f27();let _0x1dd0af=_0x4f2749[_0xc04686];return _0x1dd0af;}import{CliErrors}from'../../errors.js';const MUTABLE_EXTEND_KEYS=new Set(),EXTEND_PATCH_REDIRECTS=new Map([[a63_0xc4bca4(0x1de),{'message':a63_0xc4bca4(0x20a),'hint':a63_0xc4bca4(0x1fc)}]]);export function parseJsonObjectFlag(_0x73e7b0,_0xd1546a){const _0x7086d4=a63_0xc4bca4;if(!_0x73e7b0)return undefined;let _0x81ba81;try{_0x81ba81=JSON[_0x7086d4(0x1f8)](_0x73e7b0);}catch(_0x5eb7e1){const _0x5d5e1a=_0x5eb7e1 instanceof Error?_0x5eb7e1[_0x7086d4(0x20d)]:String(_0x5eb7e1);throw CliErrors[_0x7086d4(0x213)](_0xd1546a+_0x7086d4(0x1db)+_0x5d5e1a);}if(!isPlainObject(_0x81ba81)||Array[_0x7086d4(0x212)](_0x81ba81))throw CliErrors[_0x7086d4(0x213)](_0xd1546a+_0x7086d4(0x1f4));return _0x81ba81;}export function validateExtendPatchKeys(_0x31e471){const _0x56ed48=a63_0xc4bca4,_0xf349a1=Object[_0x56ed48(0x1ec)](_0x31e471);if(_0xf349a1['length']===0x0)throw CliErrors['validation']('--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key');for(const _0x256742 of _0xf349a1){const _0x2ab38f=EXTEND_PATCH_REDIRECTS[_0x56ed48(0x1fd)](_0x256742);if(_0x2ab38f)throw CliErrors[_0x56ed48(0x213)](_0x2ab38f[_0x56ed48(0x20d)],_0x2ab38f[_0x56ed48(0x1f5)]);if(!MUTABLE_EXTEND_KEYS[_0x56ed48(0x1f6)](_0x256742))throw CliErrors[_0x56ed48(0x213)](_0x56ed48(0x1dc)+_0x256742,describeMutableExtendKeys());}}function describeMutableExtendKeys(){const _0x199988=a63_0xc4bca4,_0x4d9c8d=Array[_0x199988(0x1ee)](MUTABLE_EXTEND_KEYS)[_0x199988(0x202)]();return _0x4d9c8d[_0x199988(0x209)]>0x0?_0x199988(0x211)+_0x4d9c8d[_0x199988(0x1e2)](',\x20'):_0x199988(0x1e3);}export function applyExtendPatch(_0x2927f6,_0x33b8d6){const _0x467a30=a63_0xc4bca4;validateExtendPatchKeys(_0x33b8d6);const _0x4695f2=deepClone(_0x2927f6),_0x3de24f=[];for(const [_0x516717,_0x67476b]of Object[_0x467a30(0x1f9)](_0x33b8d6)){const _0x3ae9a2=_0x4695f2[_0x516717],_0x122bd9=deepClone(_0x67476b);!deepEqual(_0x3ae9a2,_0x122bd9)&&(_0x4695f2[_0x516717]=_0x122bd9,_0x3de24f[_0x467a30(0x1e1)]('extend.'+_0x516717));}return _0x3de24f[_0x467a30(0x202)](),{'after':_0x4695f2,'changedPaths':_0x3de24f,'changed':_0x3de24f[_0x467a30(0x209)]>0x0};}export function assertExpectation(_0x573f76,_0x60f619){const _0x8f2a5e=a63_0xc4bca4;if(!_0x60f619)return;for(const [_0x19deff,_0x363e7d]of Object[_0x8f2a5e(0x1f9)](_0x60f619)){const _0x5a329d=_0x573f76[_0x19deff];if(!deepEqual(_0x5a329d,_0x363e7d))throw CliErrors[_0x8f2a5e(0x213)]('Expectation\x20mismatch\x20at\x20extend.'+_0x19deff,_0x8f2a5e(0x1da)+JSON[_0x8f2a5e(0x1d3)](_0x363e7d)+_0x8f2a5e(0x200)+JSON[_0x8f2a5e(0x1d3)](_0x5a329d));}}export async function buildDatasetExtendUpdateResult({appCode:_0x3b9d34,input:_0x40483c,dryRun:_0x47e7e4}){const _0x385ba2=a63_0xc4bca4;validateInput(_0x40483c);const _0x501d3f=await getDatasetDetail(_0x40483c[_0x385ba2(0x206)]),_0x3fc2df=parseDatasetExtend(_0x501d3f[_0x385ba2(0x1fe)]),_0x33b370=deepClone(_0x3fc2df[_0x385ba2(0x1e4)]);assertExpectation(_0x33b370,_0x40483c[_0x385ba2(0x1fb)]);const {after:_0xf183,changedPaths:_0x318b9f,changed:_0x557a16}=applyExtendPatch(_0x33b370,_0x40483c[_0x385ba2(0x1df)]),_0x1b9ae5=summarizeDataset(_0x501d3f,_0x40483c['code']);return _0x557a16&&!_0x47e7e4&&(_0x501d3f['extend']=serializeDatasetExtend(_0xf183,_0x3fc2df[_0x385ba2(0x1f1)]),await updateDrivenData(_0x501d3f)),{'ok':!![],'data':{'appCode':_0x3b9d34,'selector':{'code':_0x40483c['code']},'dataset':_0x1b9ae5,'dryRun':_0x47e7e4,'changed':_0x557a16,'changedPaths':_0x318b9f,'before':{'extend':_0x33b370},'after':{'extend':_0xf183},'submitted':_0x557a16&&!_0x47e7e4},'message':_0x557a16?_0x47e7e4?_0x385ba2(0x1e6)+_0x318b9f[_0x385ba2(0x1e2)](',\x20')+')':_0x385ba2(0x20b)+_0x318b9f[_0x385ba2(0x1e2)](',\x20')+')':'No\x20changes\x20for\x20dataset\x20extend'};}export const datasetExtendUpdate={'service':a63_0xc4bca4(0x1e8),'command':a63_0xc4bca4(0x207),'description':'Patch\x20dataset\x20top-level\x20extend\x20safely','risk':a63_0xc4bca4(0x1d9),'flags':[CODE_FLAG,{'name':a63_0xc4bca4(0x1d4),'type':a63_0xc4bca4(0x1eb),'required':!![],'description':a63_0xc4bca4(0x1ed)},{'name':a63_0xc4bca4(0x1dd),'type':a63_0xc4bca4(0x1eb),'required':![],'description':a63_0xc4bca4(0x1d2)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x15dca7){validateInput(readExtendUpdateInput(_0x15dca7));},async 'dryRun'(_0x14ff62){const _0x591412=a63_0xc4bca4,_0x24873b=await buildDatasetExtendUpdateResult({'appCode':_0x14ff62['appCode'],'input':readExtendUpdateInput(_0x14ff62),'dryRun':!![]});return{'method':'POST','url':_0x591412(0x1ff),'body':_0x24873b[_0x591412(0x203)],'description':_0x24873b[_0x591412(0x20d)]};},async 'execute'(_0x17d5ae){const _0x557aa5=a63_0xc4bca4;return buildDatasetExtendUpdateResult({'appCode':_0x17d5ae[_0x557aa5(0x1f3)],'input':readExtendUpdateInput(_0x17d5ae),'dryRun':![]});}};function readExtendUpdateInput(_0x45da6a){const _0x3cff30=a63_0xc4bca4,_0x335a94=trim(_0x45da6a[_0x3cff30(0x1f7)](_0x3cff30(0x206))),_0x22eb19=parseJsonObjectFlag(_0x45da6a[_0x3cff30(0x1f7)](_0x3cff30(0x1d4)),_0x3cff30(0x20f)),_0x1cc3f0=parseJsonObjectFlag(_0x45da6a[_0x3cff30(0x1f7)](_0x3cff30(0x1dd)),'--expect-json');return{'code':_0x335a94,'patch':_0x22eb19||{},'expect':_0x1cc3f0};}function validateInput(_0x2c51b4){const _0x954707=a63_0xc4bca4;if(!_0x2c51b4['code'])throw CliErrors[_0x954707(0x213)]('--code\x20is\x20required');validateExtendPatchKeys(_0x2c51b4[_0x954707(0x1df)]);}function parseDatasetExtend(_0x4a9baa){const _0x147d2c=a63_0xc4bca4;if(typeof _0x4a9baa===_0x147d2c(0x1eb)){const _0xb86f4a=_0x4a9baa[_0x147d2c(0x1ef)]();if(!_0xb86f4a)return{'value':{},'shape':_0x147d2c(0x1eb)};let _0x1aa850;try{_0x1aa850=JSON[_0x147d2c(0x1f8)](_0xb86f4a);}catch(_0xa26060){const _0x1ead39=_0xa26060 instanceof Error?_0xa26060[_0x147d2c(0x20d)]:String(_0xa26060);throw CliErrors[_0x147d2c(0x213)](_0x147d2c(0x1e7)+_0x1ead39);}if(!isPlainObject(_0x1aa850)||Array['isArray'](_0x1aa850))throw CliErrors[_0x147d2c(0x213)](_0x147d2c(0x201));return{'value':_0x1aa850,'shape':_0x147d2c(0x1eb)};}if(_0x4a9baa===undefined||_0x4a9baa===null)return{'value':{},'shape':_0x147d2c(0x1eb)};if(!isPlainObject(_0x4a9baa)||Array[_0x147d2c(0x212)](_0x4a9baa))throw CliErrors['validation'](_0x147d2c(0x201));return{'value':_0x4a9baa,'shape':_0x147d2c(0x20e)};}function serializeDatasetExtend(_0x5bb0e8,_0x188ffb){const _0x5c1f0e=a63_0xc4bca4;return _0x188ffb==='string'?JSON[_0x5c1f0e(0x1d3)](_0x5bb0e8):_0x5bb0e8;}function summarizeDataset(_0x3b8e83,_0x3a633d){const _0x459340=a63_0xc4bca4,_0x23b0a4=isPlainObject(_0x3b8e83[_0x459340(0x1e8)])?_0x3b8e83[_0x459340(0x1e8)]:{},_0x1d75b1=isPlainObject(_0x3b8e83[_0x459340(0x1ea)])?_0x3b8e83[_0x459340(0x1ea)]:{};return{'id':_0x3b8e83[_0x459340(0x1f2)]??_0x3b8e83['id']??_0x23b0a4[_0x459340(0x205)]??null,'code':_0x3b8e83[_0x459340(0x204)]??_0x3b8e83[_0x459340(0x206)]??_0x23b0a4[_0x459340(0x1d8)]??_0x3a633d,'name':_0x3b8e83[_0x459340(0x1d6)]??_0x23b0a4['datasetName']??null,'table':_0x1d75b1['tableName']??_0x23b0a4[_0x459340(0x20c)]??null,'db':_0x1d75b1['dbName']??_0x1d75b1['dbId']??null};}function deepClone(_0x19f3f9){const _0x3ccb32=a63_0xc4bca4;if(_0x19f3f9===undefined)return _0x19f3f9;return JSON[_0x3ccb32(0x1f8)](JSON[_0x3ccb32(0x1d3)](_0x19f3f9));}function a63_0x4f27(){const _0x20b941=['No\x20dataset\x20extend\x20patch\x20keys\x20are\x20currently\x20supported.','value','3574520FeyqNb','Dry-run:\x20dataset\x20extend\x20would\x20change\x20(','Dataset\x20extend\x20must\x20be\x20valid\x20JSON\x20object:\x20','dataset','20688EVMpKe','dbtableConfig','string','keys','JSON\x20object\x20patch\x20for\x20dataset\x20top-level\x20extend;\x20current\x20allowlist\x20is\x20empty','from','trim','7132509ZHJCNF','shape','modelId','appCode','\x20must\x20be\x20a\x20JSON\x20object','hint','has','str','parse','entries','4361320tNvnJf','expect','Use\x20`rabetbase\x20dataset\x20business-group-update`\x20to\x20update\x20business\x20model\x20groups.','get','extend','/smartapi/dataset/update-driven-data',',\x20actual\x20','Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object','sort','data','modelCode','datasetId','code','extend-update','339212PnYbnE','length','dataset\x20extend-update\x20does\x20not\x20support\x20businessGroup;\x20use\x20dataset\x20business-group-update','Updated\x20dataset\x20extend\x20(','tableName','message','object','--patch-json','1167906MDDfFS','Allowed\x20keys:\x20','isArray','validation','JSON\x20object\x20of\x20expected\x20current\x20extend\x20values;\x20mismatch\x20aborts\x20without\x20writing','stringify','patch-json','70resmTn','name','4BJzifX','datasetCode','write','Expected\x20','\x20must\x20be\x20valid\x20JSON\x20object:\x20','Unsupported\x20patch\x20key:\x20','expect-json','businessGroup','patch','135348uHfmNw','push','join'];a63_0x4f27=function(){return _0x20b941;};return a63_0x4f27();}function deepEqual(_0x55c932,_0x30494f){const _0x88a8de=a63_0xc4bca4;return JSON[_0x88a8de(0x1d3)](_0x55c932)===JSON[_0x88a8de(0x1d3)](_0x30494f);}function isPlainObject(_0xbbf91){const _0x41b49e=a63_0xc4bca4;return Boolean(_0xbbf91)&&typeof _0xbbf91===_0x41b49e(0x20e)&&!Array['isArray'](_0xbbf91);}function trim(_0x23024c){const _0x2f8c22=a63_0xc4bca4,_0x5cb4da=String(_0x23024c||'')[_0x2f8c22(0x1ef)]();return _0x5cb4da;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a63_0x45209e=a63_0x1541;(function(_0x5bef2e,_0x53dc13){const _0x285d41=a63_0x1541,_0x40d927=_0x5bef2e();while(!![]){try{const _0x3ff346=parseInt(_0x285d41(0x1ef))/0x1*(-parseInt(_0x285d41(0x1e7))/0x2)+-parseInt(_0x285d41(0x1d2))/0x3*(-parseInt(_0x285d41(0x1ea))/0x4)+parseInt(_0x285d41(0x1f7))/0x5*(parseInt(_0x285d41(0x200))/0x6)+-parseInt(_0x285d41(0x20c))/0x7+parseInt(_0x285d41(0x1e2))/0x8*(-parseInt(_0x285d41(0x1d5))/0x9)+parseInt(_0x285d41(0x1e4))/0xa+parseInt(_0x285d41(0x202))/0xb;if(_0x3ff346===_0x53dc13)break;else _0x40d927['push'](_0x40d927['shift']());}catch(_0x1005df){_0x40d927['push'](_0x40d927['shift']());}}}(a63_0x4530,0xb7122));import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';function a63_0x1541(_0x300a7c,_0x4e8706){_0x300a7c=_0x300a7c-0x1d0;const _0x453030=a63_0x4530();let _0x1541ee=_0x453030[_0x300a7c];return _0x1541ee;}const MUTABLE_FIELD_KEYS=new Set([a63_0x45209e(0x1dc),a63_0x45209e(0x215),'description','options',a63_0x45209e(0x1df),a63_0x45209e(0x1da),a63_0x45209e(0x1f1),a63_0x45209e(0x212),a63_0x45209e(0x1f8)]),FORBIDDEN_FIELD_KEYS=new Set(['id','name',a63_0x45209e(0x208),a63_0x45209e(0x1fe),a63_0x45209e(0x1f0),'dbTypeScale',a63_0x45209e(0x1ec),'tableName',a63_0x45209e(0x1e1),'pkField',a63_0x45209e(0x213),'systemRetain']);export function parseJsonObjectFlag(_0x46bddb,_0x51ae09){const _0x5c9f81=a63_0x45209e;if(!_0x46bddb)return undefined;let _0x2c8465;try{_0x2c8465=JSON[_0x5c9f81(0x1ed)](_0x46bddb);}catch(_0x57247c){const _0x3b4b79=_0x57247c instanceof Error?_0x57247c['message']:String(_0x57247c);throw CliErrors[_0x5c9f81(0x1de)](_0x51ae09+_0x5c9f81(0x20a)+_0x3b4b79);}if(!isPlainObject(_0x2c8465)||Array[_0x5c9f81(0x201)](_0x2c8465))throw CliErrors[_0x5c9f81(0x1de)](_0x51ae09+'\x20must\x20be\x20a\x20JSON\x20object');return _0x2c8465;}export function validatePatchKeys(_0x241068){const _0x4e8491=a63_0x45209e,_0x4e1376=Object[_0x4e8491(0x209)](_0x241068);if(_0x4e1376[_0x4e8491(0x1d0)]===0x0)throw CliErrors[_0x4e8491(0x1de)](_0x4e8491(0x1eb));for(const _0x55f6ee of _0x4e1376){if(FORBIDDEN_FIELD_KEYS[_0x4e8491(0x1f6)](_0x55f6ee))throw CliErrors[_0x4e8491(0x1de)](_0x4e8491(0x1d9)+_0x55f6ee);if(!MUTABLE_FIELD_KEYS[_0x4e8491(0x1f6)](_0x55f6ee))throw CliErrors['validation']('Unsupported\x20patch\x20key:\x20'+_0x55f6ee,'Allowed\x20keys:\x20'+Array['from'](MUTABLE_FIELD_KEYS)['join'](',\x20'));}}export function applyFieldPatch(_0x4a4b98,_0x22a985){const _0x3ef46e=a63_0x45209e;validatePatchKeys(_0x22a985);const _0xc24ca5=deepClone(_0x4a4b98),_0x4cd499=new Set();for(const [_0x2eecad,_0x65ae7]of Object['entries'](_0x22a985)){const _0x15eb7b=_0xc24ca5[_0x2eecad],_0x689a32=mergePatchValue(_0x15eb7b,_0x65ae7);!deepEqual(_0x15eb7b,_0x689a32)&&(_0xc24ca5[_0x2eecad]=_0x689a32,_0x4cd499[_0x3ef46e(0x1d6)](_0x2eecad),collectChangedPaths(_0x2eecad,_0x15eb7b,_0x689a32,_0x4cd499));}return{'after':_0xc24ca5,'changedPaths':Array['from'](_0x4cd499)[_0x3ef46e(0x1d8)](),'changed':_0x4cd499['size']>0x0};}function a63_0x4530(){const _0x479a26=['entries','findIndex','datasetName','has','5EDUApQ','deprecated','Exact\x20raw\x20fields[].name\x20to\x20patch','name','Driven\x20data\x20does\x20not\x20contain\x20fields[]\x20or\x20properties[]','message','Expected\x20','dbType','data','4162038FEXlka','isArray','82005DztZnj','Expectation\x20mismatch\x20at\x20','/smartapi/dataset/update-driven-data','--expect-json','patch','patch-json','code','keys','\x20must\x20be\x20valid\x20JSON\x20object:\x20','join','2626379coePqv','expect','dataset','expect-json',',\x20actual\x20','dbName','chartRole','autoIncrement','modelCode','displayName','properties','stringify','field','\x20would\x20change\x20(','No\x20changes\x20for\x20dataset\x20field\x20','length','fields','177PUqEdE','Field\x20not\x20found:\x20','JSON\x20object\x20of\x20expected\x20current\x20field\x20values;\x20mismatch\x20aborts\x20without\x20writing','74988kvMxmt','add','string','sort','Forbidden\x20patch\x20key:\x20','datetimeFormat','datasetCode','doType','--code\x20is\x20required','validation','required','Patch\x20one\x20raw\x20dataset\x20fields[]\x20field\x20object\x20safely','deleted','264GbhhrJ','field-update','2691980hKpENE','--field\x20is\x20required','appCode','2LhVQKB','Updated\x20dataset\x20field\x20','str','48544iBvaGz','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','dbFieldName','parse','dbtableConfig','286339gllfIQ','dbTypeLen','defaultAggregation','POST'];a63_0x4530=function(){return _0x479a26;};return a63_0x4530();}export function assertExpectation(_0x4a1ff5,_0x9c4ba0){const _0x1d213d=a63_0x45209e;if(!_0x9c4ba0)return;for(const [_0x47bd8d,_0x4cdcb3]of Object['entries'](_0x9c4ba0)){const _0xe9383f=_0x4a1ff5[_0x47bd8d];if(!deepEqual(_0xe9383f,_0x4cdcb3))throw CliErrors[_0x1d213d(0x1de)](_0x1d213d(0x203)+_0x47bd8d,_0x1d213d(0x1fd)+JSON[_0x1d213d(0x217)](_0x4cdcb3)+_0x1d213d(0x210)+JSON[_0x1d213d(0x217)](_0xe9383f));}}export async function buildDatasetFieldUpdateResult({appCode:_0x32cda6,input:_0x250cbb,dryRun:_0x3a1d9c}){const _0x4c26de=a63_0x45209e;validateInput(_0x250cbb);const _0x482c92=await getDatasetDetail(_0x250cbb[_0x4c26de(0x208)]),_0x2e425d=readFieldArray(_0x482c92),_0x37b0ea=_0x2e425d[_0x4c26de(0x1f4)](_0x36c031=>_0x36c031?.[_0x4c26de(0x1fa)]===_0x250cbb['field']);if(_0x37b0ea<0x0)throw CliErrors[_0x4c26de(0x1de)](_0x4c26de(0x1d3)+_0x250cbb[_0x4c26de(0x218)]);const _0x3ae72f=deepClone(_0x2e425d[_0x37b0ea]);assertExpectation(_0x3ae72f,_0x250cbb[_0x4c26de(0x20d)]);const {after:_0x2ec057,changedPaths:_0x5b90e4,changed:_0x3143a2}=applyFieldPatch(_0x3ae72f,_0x250cbb['patch']),_0x4610cd=summarizeDataset(_0x482c92,_0x250cbb[_0x4c26de(0x208)]);return _0x3143a2&&!_0x3a1d9c&&(_0x2e425d[_0x37b0ea]=_0x2ec057,await updateDrivenData(_0x482c92)),{'ok':!![],'data':{'appCode':_0x32cda6,'selector':{'code':_0x250cbb[_0x4c26de(0x208)]},'dataset':_0x4610cd,'field':{'id':_0x3ae72f['id']??null,'name':_0x3ae72f[_0x4c26de(0x1fa)]},'dryRun':_0x3a1d9c,'changed':_0x3143a2,'changedPaths':_0x5b90e4,'before':_0x3ae72f,'after':_0x2ec057,'submitted':_0x3143a2&&!_0x3a1d9c},'message':_0x3143a2?_0x3a1d9c?'Dry-run:\x20dataset\x20field\x20'+_0x250cbb[_0x4c26de(0x218)]+_0x4c26de(0x219)+_0x5b90e4['join'](',\x20')+')':_0x4c26de(0x1e8)+_0x250cbb['field']+'\x20('+_0x5b90e4[_0x4c26de(0x20b)](',\x20')+')':_0x4c26de(0x21a)+_0x250cbb[_0x4c26de(0x218)]};}export const datasetFieldUpdate={'service':a63_0x45209e(0x20e),'command':a63_0x45209e(0x1e3),'description':a63_0x45209e(0x1e0),'risk':'write','flags':[CODE_FLAG,{'name':'field','type':a63_0x45209e(0x1d7),'required':!![],'description':a63_0x45209e(0x1f9)},{'name':a63_0x45209e(0x207),'type':a63_0x45209e(0x1d7),'required':!![],'description':'JSON\x20object\x20patch;\x20allowed\x20keys:\x20doType/displayName/description/options/required/datetimeFormat/defaultAggregation/chartRole/deprecated'},{'name':a63_0x45209e(0x20f),'type':a63_0x45209e(0x1d7),'required':![],'description':a63_0x45209e(0x1d4)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5c661e){validateInput(readFieldUpdateInput(_0x5c661e));},async 'dryRun'(_0x4c6a08){const _0x273d77=a63_0x45209e,_0x4a474e=await buildDatasetFieldUpdateResult({'appCode':_0x4c6a08[_0x273d77(0x1e6)],'input':readFieldUpdateInput(_0x4c6a08),'dryRun':!![]});return{'method':_0x273d77(0x1f2),'url':_0x273d77(0x204),'body':_0x4a474e[_0x273d77(0x1ff)],'description':_0x4a474e[_0x273d77(0x1fc)]};},async 'execute'(_0x1afe72){const _0x3745e6=a63_0x45209e;return buildDatasetFieldUpdateResult({'appCode':_0x1afe72[_0x3745e6(0x1e6)],'input':readFieldUpdateInput(_0x1afe72),'dryRun':![]});}};function readFieldUpdateInput(_0x1cb81f){const _0x108ea5=a63_0x45209e,_0x35fb41=trim(_0x1cb81f[_0x108ea5(0x1e9)](_0x108ea5(0x208))),_0x50b20a=emptyToUndefined(_0x1cb81f[_0x108ea5(0x1e9)](_0x108ea5(0x218))),_0x51aee4=parseJsonObjectFlag(_0x1cb81f[_0x108ea5(0x1e9)]('patch-json'),'--patch-json'),_0x572ec2=parseJsonObjectFlag(_0x1cb81f['str']('expect-json'),_0x108ea5(0x205));return{'code':_0x35fb41,'field':_0x50b20a||'','patch':_0x51aee4||{},'expect':_0x572ec2};}function validateInput(_0x255a0b){const _0x211cfd=a63_0x45209e;if(!_0x255a0b['code'])throw CliErrors['validation'](_0x211cfd(0x1dd));if(!_0x255a0b[_0x211cfd(0x218)])throw CliErrors[_0x211cfd(0x1de)](_0x211cfd(0x1e5));validatePatchKeys(_0x255a0b[_0x211cfd(0x206)]);}function readFieldArray(_0x3e434b){const _0x4d8bf3=a63_0x45209e;if(Array[_0x4d8bf3(0x201)](_0x3e434b[_0x4d8bf3(0x1d1)]))return _0x3e434b['fields'];if(Array[_0x4d8bf3(0x201)](_0x3e434b[_0x4d8bf3(0x216)]))return _0x3e434b['properties'];throw CliErrors[_0x4d8bf3(0x1de)](_0x4d8bf3(0x1fb));}function summarizeDataset(_0x1f5c9d,_0xca5c61){const _0x4a2bfd=a63_0x45209e,_0x39dea7=isPlainObject(_0x1f5c9d[_0x4a2bfd(0x20e)])?_0x1f5c9d[_0x4a2bfd(0x20e)]:{},_0x294447=isPlainObject(_0x1f5c9d[_0x4a2bfd(0x1ee)])?_0x1f5c9d['dbtableConfig']:{};return{'id':_0x1f5c9d['modelId']??_0x1f5c9d['id']??_0x39dea7['datasetId']??null,'code':_0x1f5c9d[_0x4a2bfd(0x214)]??_0x1f5c9d[_0x4a2bfd(0x208)]??_0x39dea7[_0x4a2bfd(0x1db)]??_0xca5c61,'name':_0x1f5c9d['name']??_0x39dea7[_0x4a2bfd(0x1f5)]??null,'table':_0x294447['tableName']??_0x39dea7['tableName']??null,'db':_0x294447[_0x4a2bfd(0x211)]??_0x294447['dbId']??null};}function mergePatchValue(_0x30a7dd,_0x30006d){if(isPlainObject(_0x30a7dd)&&isPlainObject(_0x30006d))return deepMerge(_0x30a7dd,_0x30006d);return deepClone(_0x30006d);}function deepMerge(_0x49e8e1,_0x61f892){const _0x516854=a63_0x45209e,_0x52fd73=deepClone(_0x49e8e1);for(const [_0x2a651e,_0xfe1cf5]of Object[_0x516854(0x1f3)](_0x61f892)){_0x52fd73[_0x2a651e]=isPlainObject(_0x52fd73[_0x2a651e])&&isPlainObject(_0xfe1cf5)?deepMerge(_0x52fd73[_0x2a651e],_0xfe1cf5):deepClone(_0xfe1cf5);}return _0x52fd73;}function collectChangedPaths(_0x3fed43,_0x58527e,_0x3b860f,_0x5538cb){const _0x242219=a63_0x45209e;if(!isPlainObject(_0x58527e)||!isPlainObject(_0x3b860f))return;const _0x117b42=new Set([...Object['keys'](_0x58527e),...Object[_0x242219(0x209)](_0x3b860f)]);for(const _0x172d29 of _0x117b42){const _0x529192=_0x58527e[_0x172d29],_0x2ede17=_0x3b860f[_0x172d29];!deepEqual(_0x529192,_0x2ede17)&&_0x5538cb[_0x242219(0x1d6)](_0x3fed43+'.'+_0x172d29);}}function deepClone(_0x3cbdf0){const _0x4e567c=a63_0x45209e;if(_0x3cbdf0===undefined)return _0x3cbdf0;return JSON[_0x4e567c(0x1ed)](JSON['stringify'](_0x3cbdf0));}function deepEqual(_0x46c8e5,_0x453f74){const _0x351d2e=a63_0x45209e;return JSON[_0x351d2e(0x217)](_0x46c8e5)===JSON['stringify'](_0x453f74);}function isPlainObject(_0x27a1cc){return Boolean(_0x27a1cc)&&typeof _0x27a1cc==='object'&&!Array['isArray'](_0x27a1cc);}function emptyToUndefined(_0x20d848){const _0x1fc660=String(_0x20d848||'')['trim']();return _0x1fc660||undefined;}function trim(_0x324d88){return String(_0x324d88||'')['trim']();}
|
|
1
|
+
const a64_0xdcba90=a64_0x4554;(function(_0x13a55a,_0x456ae1){const _0x128b54=a64_0x4554,_0x2242c7=_0x13a55a();while(!![]){try{const _0x1978c9=parseInt(_0x128b54(0x210))/0x1*(parseInt(_0x128b54(0x215))/0x2)+-parseInt(_0x128b54(0x1fd))/0x3*(parseInt(_0x128b54(0x22a))/0x4)+-parseInt(_0x128b54(0x226))/0x5+-parseInt(_0x128b54(0x222))/0x6+parseInt(_0x128b54(0x208))/0x7*(parseInt(_0x128b54(0x1f4))/0x8)+-parseInt(_0x128b54(0x220))/0x9+parseInt(_0x128b54(0x207))/0xa*(parseInt(_0x128b54(0x20d))/0xb);if(_0x1978c9===_0x456ae1)break;else _0x2242c7['push'](_0x2242c7['shift']());}catch(_0x39c803){_0x2242c7['push'](_0x2242c7['shift']());}}}(a64_0x9b9e,0x2722a));import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';function a64_0x4554(_0x4d1962,_0x5dab19){_0x4d1962=_0x4d1962-0x1e5;const _0x9b9eb4=a64_0x9b9e();let _0x4554cf=_0x9b9eb4[_0x4d1962];return _0x4554cf;}const MUTABLE_FIELD_KEYS=new Set([a64_0xdcba90(0x21a),'displayName',a64_0xdcba90(0x22c),a64_0xdcba90(0x203),'required',a64_0xdcba90(0x205),a64_0xdcba90(0x225),a64_0xdcba90(0x213),a64_0xdcba90(0x21e)]),FORBIDDEN_FIELD_KEYS=new Set(['id','name',a64_0xdcba90(0x218),a64_0xdcba90(0x227),'dbTypeLen',a64_0xdcba90(0x1ea),a64_0xdcba90(0x1ec),a64_0xdcba90(0x1f7),a64_0xdcba90(0x1ee),a64_0xdcba90(0x21b),'autoIncrement',a64_0xdcba90(0x1e7)]);export function parseJsonObjectFlag(_0x22355c,_0x3ecd7d){const _0x3563fc=a64_0xdcba90;if(!_0x22355c)return undefined;let _0x44222f;try{_0x44222f=JSON['parse'](_0x22355c);}catch(_0x5d7811){const _0x2ee54c=_0x5d7811 instanceof Error?_0x5d7811[_0x3563fc(0x1f9)]:String(_0x5d7811);throw CliErrors['validation'](_0x3ecd7d+'\x20must\x20be\x20valid\x20JSON\x20object:\x20'+_0x2ee54c);}if(!isPlainObject(_0x44222f)||Array[_0x3563fc(0x22d)](_0x44222f))throw CliErrors[_0x3563fc(0x200)](_0x3ecd7d+_0x3563fc(0x1eb));return _0x44222f;}export function validatePatchKeys(_0x424363){const _0x58dfe8=a64_0xdcba90,_0x49b256=Object[_0x58dfe8(0x214)](_0x424363);if(_0x49b256[_0x58dfe8(0x206)]===0x0)throw CliErrors['validation'](_0x58dfe8(0x1ed));for(const _0x529de1 of _0x49b256){if(FORBIDDEN_FIELD_KEYS[_0x58dfe8(0x1fb)](_0x529de1))throw CliErrors['validation'](_0x58dfe8(0x216)+_0x529de1);if(!MUTABLE_FIELD_KEYS[_0x58dfe8(0x1fb)](_0x529de1))throw CliErrors[_0x58dfe8(0x200)](_0x58dfe8(0x20b)+_0x529de1,'Allowed\x20keys:\x20'+Array[_0x58dfe8(0x1e9)](MUTABLE_FIELD_KEYS)[_0x58dfe8(0x236)](',\x20'));}}function a64_0x9b9e(){const _0x9ae19a=['isArray','dbName','dataset','Updated\x20dataset\x20field\x20','Expectation\x20mismatch\x20at\x20','patch','Field\x20not\x20found:\x20','datasetCode','stringify','join','appCode','patch-json','systemRetain','sort','from','dbTypeScale','\x20must\x20be\x20a\x20JSON\x20object','dbFieldName','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','deleted','parse','Patch\x20one\x20raw\x20dataset\x20fields[]\x20field\x20object\x20safely','findIndex','Dry-run:\x20dataset\x20field\x20','write','16YZnlvH','--code\x20is\x20required','fields','tableName','expect','message','Exact\x20raw\x20fields[].name\x20to\x20patch','has','properties','32145dPUaBU','modelCode','size','validation','trim','Driven\x20data\x20does\x20not\x20contain\x20fields[]\x20or\x20properties[]','options','/smartapi/dataset/update-driven-data','datetimeFormat','length','90hFAXsa','388829qzGxAA','field','expect-json','Unsupported\x20patch\x20key:\x20','string','577379ntrBIz','datasetId','--expect-json','303jCTXwv','dbtableConfig','datasetName','chartRole','keys','270NVnJCK','Forbidden\x20patch\x20key:\x20','add','code','object','doType','pkField','entries','--patch-json','deprecated','\x20would\x20change\x20(','138339jVDouE','modelId','491166PstDAK','name','data','defaultAggregation','1084300XUrqhc','dbType','No\x20changes\x20for\x20dataset\x20field\x20','str','56jeeOwv','Expected\x20','description'];a64_0x9b9e=function(){return _0x9ae19a;};return a64_0x9b9e();}export function applyFieldPatch(_0x25d28b,_0x5a454b){const _0x2d9c7b=a64_0xdcba90;validatePatchKeys(_0x5a454b);const _0x1f5258=deepClone(_0x25d28b),_0x547a04=new Set();for(const [_0x178821,_0x2bcca9]of Object[_0x2d9c7b(0x21c)](_0x5a454b)){const _0x4e1984=_0x1f5258[_0x178821],_0x29023e=mergePatchValue(_0x4e1984,_0x2bcca9);!deepEqual(_0x4e1984,_0x29023e)&&(_0x1f5258[_0x178821]=_0x29023e,_0x547a04[_0x2d9c7b(0x217)](_0x178821),collectChangedPaths(_0x178821,_0x4e1984,_0x29023e,_0x547a04));}return{'after':_0x1f5258,'changedPaths':Array[_0x2d9c7b(0x1e9)](_0x547a04)[_0x2d9c7b(0x1e8)](),'changed':_0x547a04[_0x2d9c7b(0x1ff)]>0x0};}export function assertExpectation(_0x5abb1d,_0x106276){const _0x47331d=a64_0xdcba90;if(!_0x106276)return;for(const [_0x200b62,_0x19fc7d]of Object['entries'](_0x106276)){const _0x577341=_0x5abb1d[_0x200b62];if(!deepEqual(_0x577341,_0x19fc7d))throw CliErrors[_0x47331d(0x200)](_0x47331d(0x231)+_0x200b62,_0x47331d(0x22b)+JSON['stringify'](_0x19fc7d)+',\x20actual\x20'+JSON[_0x47331d(0x235)](_0x577341));}}export async function buildDatasetFieldUpdateResult({appCode:_0x3456e7,input:_0x36089b,dryRun:_0x3c2de2}){const _0x2ac649=a64_0xdcba90;validateInput(_0x36089b);const _0x61fa17=await getDatasetDetail(_0x36089b[_0x2ac649(0x218)]),_0x3e8991=readFieldArray(_0x61fa17),_0x35efb1=_0x3e8991[_0x2ac649(0x1f1)](_0xe58aaf=>_0xe58aaf?.['name']===_0x36089b[_0x2ac649(0x209)]);if(_0x35efb1<0x0)throw CliErrors['validation'](_0x2ac649(0x233)+_0x36089b[_0x2ac649(0x209)]);const _0x577e29=deepClone(_0x3e8991[_0x35efb1]);assertExpectation(_0x577e29,_0x36089b[_0x2ac649(0x1f8)]);const {after:_0x440f67,changedPaths:_0x2f05b4,changed:_0x13e7bf}=applyFieldPatch(_0x577e29,_0x36089b[_0x2ac649(0x232)]),_0x5b659a=summarizeDataset(_0x61fa17,_0x36089b[_0x2ac649(0x218)]);return _0x13e7bf&&!_0x3c2de2&&(_0x3e8991[_0x35efb1]=_0x440f67,await updateDrivenData(_0x61fa17)),{'ok':!![],'data':{'appCode':_0x3456e7,'selector':{'code':_0x36089b[_0x2ac649(0x218)]},'dataset':_0x5b659a,'field':{'id':_0x577e29['id']??null,'name':_0x577e29[_0x2ac649(0x223)]},'dryRun':_0x3c2de2,'changed':_0x13e7bf,'changedPaths':_0x2f05b4,'before':_0x577e29,'after':_0x440f67,'submitted':_0x13e7bf&&!_0x3c2de2},'message':_0x13e7bf?_0x3c2de2?_0x2ac649(0x1f2)+_0x36089b[_0x2ac649(0x209)]+_0x2ac649(0x21f)+_0x2f05b4['join'](',\x20')+')':_0x2ac649(0x230)+_0x36089b[_0x2ac649(0x209)]+'\x20('+_0x2f05b4[_0x2ac649(0x236)](',\x20')+')':_0x2ac649(0x228)+_0x36089b[_0x2ac649(0x209)]};}export const datasetFieldUpdate={'service':a64_0xdcba90(0x22f),'command':'field-update','description':a64_0xdcba90(0x1f0),'risk':a64_0xdcba90(0x1f3),'flags':[CODE_FLAG,{'name':a64_0xdcba90(0x209),'type':'string','required':!![],'description':a64_0xdcba90(0x1fa)},{'name':a64_0xdcba90(0x1e6),'type':a64_0xdcba90(0x20c),'required':!![],'description':'JSON\x20object\x20patch;\x20allowed\x20keys:\x20doType/displayName/description/options/required/datetimeFormat/defaultAggregation/chartRole/deprecated'},{'name':a64_0xdcba90(0x20a),'type':a64_0xdcba90(0x20c),'required':![],'description':'JSON\x20object\x20of\x20expected\x20current\x20field\x20values;\x20mismatch\x20aborts\x20without\x20writing'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5d2751){validateInput(readFieldUpdateInput(_0x5d2751));},async 'dryRun'(_0x53394c){const _0x32c9c0=a64_0xdcba90,_0x343705=await buildDatasetFieldUpdateResult({'appCode':_0x53394c[_0x32c9c0(0x1e5)],'input':readFieldUpdateInput(_0x53394c),'dryRun':!![]});return{'method':'POST','url':_0x32c9c0(0x204),'body':_0x343705[_0x32c9c0(0x224)],'description':_0x343705[_0x32c9c0(0x1f9)]};},async 'execute'(_0x19d51b){const _0x5900f5=a64_0xdcba90;return buildDatasetFieldUpdateResult({'appCode':_0x19d51b[_0x5900f5(0x1e5)],'input':readFieldUpdateInput(_0x19d51b),'dryRun':![]});}};function readFieldUpdateInput(_0x41ad01){const _0x682354=a64_0xdcba90,_0xda089e=trim(_0x41ad01[_0x682354(0x229)]('code')),_0x4602b5=emptyToUndefined(_0x41ad01[_0x682354(0x229)](_0x682354(0x209))),_0x4470bf=parseJsonObjectFlag(_0x41ad01[_0x682354(0x229)](_0x682354(0x1e6)),_0x682354(0x21d)),_0x4b8bb1=parseJsonObjectFlag(_0x41ad01[_0x682354(0x229)](_0x682354(0x20a)),_0x682354(0x20f));return{'code':_0xda089e,'field':_0x4602b5||'','patch':_0x4470bf||{},'expect':_0x4b8bb1};}function validateInput(_0x31ed99){const _0x328323=a64_0xdcba90;if(!_0x31ed99['code'])throw CliErrors[_0x328323(0x200)](_0x328323(0x1f5));if(!_0x31ed99[_0x328323(0x209)])throw CliErrors['validation']('--field\x20is\x20required');validatePatchKeys(_0x31ed99['patch']);}function readFieldArray(_0x1d5c6d){const _0x88ef6e=a64_0xdcba90;if(Array[_0x88ef6e(0x22d)](_0x1d5c6d[_0x88ef6e(0x1f6)]))return _0x1d5c6d['fields'];if(Array['isArray'](_0x1d5c6d['properties']))return _0x1d5c6d[_0x88ef6e(0x1fc)];throw CliErrors[_0x88ef6e(0x200)](_0x88ef6e(0x202));}function summarizeDataset(_0x2df755,_0x519eb1){const _0x380680=a64_0xdcba90,_0x4c1c02=isPlainObject(_0x2df755[_0x380680(0x22f)])?_0x2df755['dataset']:{},_0x31a7d9=isPlainObject(_0x2df755[_0x380680(0x211)])?_0x2df755[_0x380680(0x211)]:{};return{'id':_0x2df755[_0x380680(0x221)]??_0x2df755['id']??_0x4c1c02[_0x380680(0x20e)]??null,'code':_0x2df755[_0x380680(0x1fe)]??_0x2df755[_0x380680(0x218)]??_0x4c1c02[_0x380680(0x234)]??_0x519eb1,'name':_0x2df755[_0x380680(0x223)]??_0x4c1c02[_0x380680(0x212)]??null,'table':_0x31a7d9[_0x380680(0x1f7)]??_0x4c1c02[_0x380680(0x1f7)]??null,'db':_0x31a7d9[_0x380680(0x22e)]??_0x31a7d9['dbId']??null};}function mergePatchValue(_0x121e0,_0x44cb85){if(isPlainObject(_0x121e0)&&isPlainObject(_0x44cb85))return deepMerge(_0x121e0,_0x44cb85);return deepClone(_0x44cb85);}function deepMerge(_0x269391,_0x52656f){const _0x3e41bb=a64_0xdcba90,_0x279b0e=deepClone(_0x269391);for(const [_0x24c499,_0x3fde48]of Object[_0x3e41bb(0x21c)](_0x52656f)){_0x279b0e[_0x24c499]=isPlainObject(_0x279b0e[_0x24c499])&&isPlainObject(_0x3fde48)?deepMerge(_0x279b0e[_0x24c499],_0x3fde48):deepClone(_0x3fde48);}return _0x279b0e;}function collectChangedPaths(_0xe3b1d5,_0x223024,_0x4a3671,_0x69ad52){const _0x4b43df=a64_0xdcba90;if(!isPlainObject(_0x223024)||!isPlainObject(_0x4a3671))return;const _0x5a761f=new Set([...Object[_0x4b43df(0x214)](_0x223024),...Object[_0x4b43df(0x214)](_0x4a3671)]);for(const _0x3d5580 of _0x5a761f){const _0x5b614b=_0x223024[_0x3d5580],_0xad4de9=_0x4a3671[_0x3d5580];!deepEqual(_0x5b614b,_0xad4de9)&&_0x69ad52[_0x4b43df(0x217)](_0xe3b1d5+'.'+_0x3d5580);}}function deepClone(_0x1314b4){const _0x547bf9=a64_0xdcba90;if(_0x1314b4===undefined)return _0x1314b4;return JSON[_0x547bf9(0x1ef)](JSON[_0x547bf9(0x235)](_0x1314b4));}function deepEqual(_0x3d486c,_0xa35909){const _0x3b349c=a64_0xdcba90;return JSON[_0x3b349c(0x235)](_0x3d486c)===JSON[_0x3b349c(0x235)](_0xa35909);}function isPlainObject(_0x24c1b2){const _0x4c64f3=a64_0xdcba90;return Boolean(_0x24c1b2)&&typeof _0x24c1b2===_0x4c64f3(0x219)&&!Array[_0x4c64f3(0x22d)](_0x24c1b2);}function emptyToUndefined(_0x2a1ab6){const _0x36eed7=String(_0x2a1ab6||'')['trim']();return _0x36eed7||undefined;}function trim(_0x27702c){const _0x12ba56=a64_0xdcba90;return String(_0x27702c||'')[_0x12ba56(0x201)]();}
|