@lovrabet/rabetbase-cli 2.3.6 → 2.3.7-beta.1
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/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_0x3353a5=a53_0x4d13;function a53_0x4d13(_0x3876d4,_0x99a44e){_0x3876d4=_0x3876d4-0x80;const _0x32f5a4=a53_0x32f5();let _0x4d13dc=_0x32f5a4[_0x3876d4];return _0x4d13dc;}(function(_0x12f953,_0xe9506b){const _0x4b74df=a53_0x4d13,_0x3aff19=_0x12f953();while(!![]){try{const _0x9b6a10=-parseInt(_0x4b74df(0x8a))/0x1+-parseInt(_0x4b74df(0x88))/0x2+-parseInt(_0x4b74df(0xa0))/0x3+-parseInt(_0x4b74df(0xaf))/0x4+parseInt(_0x4b74df(0xa6))/0x5*(-parseInt(_0x4b74df(0xb4))/0x6)+parseInt(_0x4b74df(0xb3))/0x7+-parseInt(_0x4b74df(0xae))/0x8*(-parseInt(_0x4b74df(0x9a))/0x9);if(_0x9b6a10===_0xe9506b)break;else _0x3aff19['push'](_0x3aff19['shift']());}catch(_0x33c764){_0x3aff19['push'](_0x3aff19['shift']());}}}(a53_0x32f5,0xd460f));import{CliErrors}from'../../errors.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';import{CLI_BIN_NAME,CONFIG_ENUM_VALUES,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale,resolveWriteScope,readScopedConfig,writeScopedConfig}from'../../commands/config/shared.js';function a53_0x32f5(){const _0x533e40=['boolean','8jbQgBR','2949408mVCjvn','env','Invalid\x20value\x20for\x20\x22','Config\x20value','3784340XiDVZy','6010722Ikghpm','config','bool','string','Invalid\x20value\x20for\x20env.\x20Allowed:\x20production,\x20daily.','\x22\x20is\x20not\x20settable.','`,\x20`','\x20set\x20to:\x20','length','426152OclBrp','Config\x20value\x20is\x20invalid\x20or\x20too\x20long.','1635432CiqIDg','Settable\x20top-level\x20keys:\x20','write','\x20appcode\x20set\x20to:\x20','Set\x20a\x20config\x20value','Use\x20`','apps','set','\x20(stored\x20as\x20apps\x20+\x20defaultApp)','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','app','Usage:\x20','Global','locale','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','appcode','44062479QJbQEp','Invalid\x20locale\x20value.','global','includes','\x20app\x20add\x20<name>\x20--appcode\x20','Missing\x20value.','2936703jzHMYc','object','key','Project','Legacy\x20alias\x20\x22online\x22\x20is\x20accepted\x20and\x20stored\x20as\x20production.','keys','5okSGBS','str','\x20workspace\x20use\x20--app\x20<name>`,\x20or\x20pass\x20`--appcode`\x20on\x20the\x20command.','validation','\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>','\x22.\x20Allowed:\x20','Write\x20to\x20global\x20config\x20(~/.rabetbase.json)'];a53_0x32f5=function(){return _0x533e40;};return a53_0x32f5();}import{normalizeEnv,isProduction,isDaily}from'../../constant/env.js';async function execute(_0x3b76f1){const _0x290784=a53_0x4d13,_0x404bfe=_0x3b76f1[_0x290784(0xa7)](_0x290784(0xa2)),_0x34980f=_0x3b76f1[_0x290784(0xa7)]('value');if(!_0x404bfe)throw CliErrors[_0x290784(0xa9)]('Missing\x20key.',_0x290784(0x95)+CLI_BIN_NAME+'\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>');if(_0x34980f===undefined||_0x34980f==='')throw CliErrors[_0x290784(0xa9)](_0x290784(0x9f),_0x290784(0x95)+CLI_BIN_NAME+_0x290784(0xaa));if(_0x34980f[_0x290784(0x87)]>0x1f4)throw CliErrors[_0x290784(0xa9)](_0x290784(0x89));if(!isTopLevelConfigKey(_0x404bfe))throw CliErrors[_0x290784(0xa9)]('Top-level\x20key\x20\x22'+_0x404bfe+_0x290784(0x84),_0x290784(0x8b)+getTopLevelConfigKeySummary());if(_0x404bfe==='riskLevel')throw CliErrors[_0x290784(0xa9)](_0x290784(0x98));if(CONFIG_ENUM_VALUES[_0x404bfe]&&!CONFIG_ENUM_VALUES[_0x404bfe][_0x290784(0x9d)](_0x34980f))throw CliErrors['validation'](_0x290784(0xb1)+_0x404bfe+_0x290784(0xab)+CONFIG_ENUM_VALUES[_0x404bfe]['join'](',\x20'));if(_0x404bfe===_0x290784(0x97)&&!normalizeLocale(_0x34980f))throw CliErrors[_0x290784(0xa9)](_0x290784(0x9b),_0x290784(0x93));const _0x5c8e32={'global':_0x3b76f1[_0x290784(0x81)](_0x290784(0x9c))},_0x2daae5=resolveWriteScope(_0x5c8e32),_0x4c6b90=readScopedConfig(_0x2daae5);let _0x5ea1cf=_0x404bfe,_0x268e55=_0x34980f;_0x404bfe===_0x290784(0x94)&&(_0x5ea1cf='appcode',delete _0x4c6b90[_0x290784(0x94)]);_0x404bfe===_0x290784(0x97)&&(_0x268e55=normalizeLocale(_0x34980f));if(_0x404bfe===_0x290784(0xb0)){_0x268e55=normalizeEnv(_0x34980f);if(!isProduction(_0x268e55)&&!isDaily(_0x268e55))throw CliErrors[_0x290784(0xa9)](_0x290784(0x83),_0x290784(0xa4));}if(_0x404bfe===_0x290784(0x99)){const _0x485177=_0x4c6b90[_0x290784(0x90)]&&typeof _0x4c6b90['apps']===_0x290784(0xa1)?Object[_0x290784(0xa5)](_0x4c6b90[_0x290784(0x90)]):[];if(_0x485177[_0x290784(0x87)]>0x0)throw CliErrors[_0x290784(0xa9)]('Cannot\x20set\x20top-level\x20\x22appcode\x22\x20when\x20multi-app\x20config\x20already\x20exists.',_0x290784(0x8f)+CLI_BIN_NAME+_0x290784(0x9e)+_0x268e55+_0x290784(0x85)+CLI_BIN_NAME+_0x290784(0xa8));const _0x2693a4=buildCanonicalProjectConfig({..._0x4c6b90},{'appCodes':[_0x268e55],'env':typeof _0x4c6b90[_0x290784(0xb0)]==='string'?_0x4c6b90[_0x290784(0xb0)]:undefined});writeScopedConfig(_0x2693a4,_0x2daae5);const _0x37dcc4=_0x2daae5===_0x290784(0x9c)?_0x290784(0x96):_0x290784(0xa3);return{'ok':!![],'message':'✓\x20'+_0x37dcc4+_0x290784(0x8d)+_0x268e55+_0x290784(0x92)};}_0x4c6b90[_0x5ea1cf]=_0x268e55,writeScopedConfig(_0x4c6b90,_0x2daae5);const _0x246a11=_0x2daae5===_0x290784(0x9c)?_0x290784(0x96):_0x290784(0xa3);return{'ok':!![],'message':'✓\x20'+_0x246a11+'\x20'+_0x5ea1cf+_0x290784(0x86)+_0x268e55};}export const configSetDefinition={'service':a53_0x3353a5(0x80),'command':a53_0x3353a5(0x91),'description':a53_0x3353a5(0x8e),'risk':a53_0x3353a5(0x8c),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a53_0x3353a5(0xa2),'type':a53_0x3353a5(0x82),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':'value','type':a53_0x3353a5(0x82),'description':a53_0x3353a5(0xb2),'required':!![]},{'name':'global','type':a53_0x3353a5(0xad),'description':a53_0x3353a5(0xac),'default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x580f8f,_0x182d2f){var _0x1752ad=a54_0x2c50,_0x22be09=_0x580f8f();while(!![]){try{var _0x224dbb=parseInt(_0x1752ad(0x1ce))/0x1*(parseInt(_0x1752ad(0x1d8))/0x2)+parseInt(_0x1752ad(0x1cf))/0x3+-parseInt(_0x1752ad(0x1d1))/0x4+parseInt(_0x1752ad(0x1d3))/0x5*(-parseInt(_0x1752ad(0x1d5))/0x6)+-parseInt(_0x1752ad(0x1d4))/0x7+-parseInt(_0x1752ad(0x1cd))/0x8+parseInt(_0x1752ad(0x1d7))/0x9;if(_0x224dbb===_0x182d2f)break;else _0x22be09['push'](_0x22be09['shift']());}catch(_0x5f2f17){_0x22be09['push'](_0x22be09['shift']());}}}(a54_0x4784,0x2f92c));function a54_0x4784(){var _0x2c39e0=['global','10109457XwUyOU','1370JfftBr','\x20init`\x20first.','Add\x20--global\x20to\x20write\x20to\x20~/.rabetbase.json,\x20or\x20run\x20`','project','1846488yQXnCQ','48vQLgCl','430260becjkG','validation','1348908MVIMGc','Not\x20inside\x20a\x20project\x20(no\x20.rabetbase.json\x20found).','122315hayxOP','2558038HUjQML','42AFddUE'];a54_0x4784=function(){return _0x2c39e0;};return a54_0x4784();}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_0x2c50(_0x47822b,_0x39ccb9){_0x47822b=_0x47822b-0x1cd;var _0x478493=a54_0x4784();var _0x2c5015=_0x478493[_0x47822b];return _0x2c5015;}export{CLI_BIN_NAME};export{normalizeLocale};export{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey};export function resolveWriteScope(_0x2188ea){var _0x245a92=a54_0x2c50;if(_0x2188ea[_0x245a92(0x1d6)])return _0x245a92(0x1d6);if(!isInProject())throw CliErrors[_0x245a92(0x1d0)](_0x245a92(0x1d2),_0x245a92(0x1da)+CLI_BIN_NAME+_0x245a92(0x1d9));return _0x245a92(0x1db);}export function readScopedConfig(_0x1f5a1e){return readConfigFile(resolveWriteConfigPath(_0x1f5a1e));}export function writeScopedConfig(_0xa1df25,_0x5dc96f){writeConfigFile(resolveWriteConfigPath(_0x5dc96f),_0xa1df25);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a55_0x1ca9ca=a55_0x2d4d;function a55_0x44a0(){const _0x47873c=['join','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','484Cyeezr','110YZvBlH','214317yfNBwh','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page','392KQHqth','filter','6900JaRVmB','370216ECCzBT','118812cSdFfQ','8zPfquf','1gzNWCW','1265KggicT','256191xdTFaC','Filter\x20dataset\x20records\x20with\x20query\x20conditions','99853nroosR','4tTQUIZ','1221878FmAEpv','\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}]'];a55_0x44a0=function(){return _0x47873c;};return a55_0x44a0();}(function(_0x40b2d2,_0x5b8ab7){const _0x38555a=a55_0x2d4d,_0x272492=_0x40b2d2();while(!![]){try{const _0x40e364=-parseInt(_0x38555a(0xeb))/0x1*(-parseInt(_0x38555a(0xe8))/0x2)+-parseInt(_0x38555a(0xed))/0x3*(parseInt(_0x38555a(0xf0))/0x4)+parseInt(_0x38555a(0xec))/0x5*(-parseInt(_0x38555a(0xe7))/0x6)+-parseInt(_0x38555a(0xf1))/0x7*(-parseInt(_0x38555a(0xea))/0x8)+parseInt(_0x38555a(0xf7))/0x9*(parseInt(_0x38555a(0xf6))/0xa)+-parseInt(_0x38555a(0xf5))/0xb*(-parseInt(_0x38555a(0xe9))/0xc)+-parseInt(_0x38555a(0xef))/0xd*(parseInt(_0x38555a(0xf9))/0xe);if(_0x40e364===_0x5b8ab7)break;else _0x272492['push'](_0x272492['shift']());}catch(_0x5be479){_0x272492['push'](_0x272492['shift']());}}}(a55_0x44a0,0x71baa));function a55_0x2d4d(_0x25b5a0,_0x193e6c){_0x25b5a0=_0x25b5a0-0xe7;const _0x44a0d4=a55_0x44a0();let _0x2d4deb=_0x44a0d4[_0x25b5a0];return _0x2d4deb;}import{buildDataCommand}from'../../commands/data/shared.js';export const dataFilter=buildDataCommand({'command':'filter','operation':a55_0x1ca9ca(0xfa),'description':a55_0x1ca9ca(0xee),'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':['\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions','\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]',a55_0x1ca9ca(0xf2),a55_0x1ca9ca(0xf4),a55_0x1ca9ca(0xf8)][a55_0x1ca9ca(0xf3)]('\x0a')});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a56_0x1a9a2b=a56_0x25d4;(function(_0x28e03a,_0x152e73){const _0x29ad8e=a56_0x25d4,_0x282667=_0x28e03a();while(!![]){try{const _0xd251e1=-parseInt(_0x29ad8e(0xbb))/0x1*(-parseInt(_0x29ad8e(0xbc))/0x2)+parseInt(_0x29ad8e(0xb5))/0x3+parseInt(_0x29ad8e(0xb3))/0x4*(-parseInt(_0x29ad8e(0xb8))/0x5)+-parseInt(_0x29ad8e(0xb9))/0x6*(-parseInt(_0x29ad8e(0xb6))/0x7)+parseInt(_0x29ad8e(0xb2))/0x8+parseInt(_0x29ad8e(0xba))/0x9*(-parseInt(_0x29ad8e(0xb1))/0xa)+-parseInt(_0x29ad8e(0xb7))/0xb;if(_0xd251e1===_0x152e73)break;else _0x282667['push'](_0x282667['shift']());}catch(_0x3de479){_0x282667['push'](_0x282667['shift']());}}}(a56_0x58f8,0xe0b1c));function a56_0x58f8(){const _0x346b7c=['63OHWklL','635CpQVGJ','194wnHnlS','getOne','384530YzxlSe','6770088tvjnLx','8616GxaQMk','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','2241201gTzmYQ','57659gDmpKk','933042UhjqCT','1610KUXwaf','228vFZLqI'];a56_0x58f8=function(){return _0x346b7c;};return a56_0x58f8();}import{buildDataCommand}from'../../commands/data/shared.js';function a56_0x25d4(_0x190ee4,_0x3e01a2){_0x190ee4=_0x190ee4-0xb1;const _0x58f876=a56_0x58f8();let _0x25d45e=_0x58f876[_0x190ee4];return _0x25d45e;}export const dataGetOne=buildDataCommand({'command':a56_0x1a9a2b(0xbd),'operation':'getOne','description':'Get\x20a\x20single\x20record\x20by\x20ID','paramsRequired':!![],'paramsHint':a56_0x1a9a2b(0xb4)});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x54ee59,_0x36c0bb){const _0x239c18=a57_0x1fd6,_0x3a2cba=_0x54ee59();while(!![]){try{const _0x5a2772=-parseInt(_0x239c18(0x122))/0x1+parseInt(_0x239c18(0x123))/0x2+parseInt(_0x239c18(0x124))/0x3*(-parseInt(_0x239c18(0x11b))/0x4)+parseInt(_0x239c18(0x125))/0x5*(parseInt(_0x239c18(0x11d))/0x6)+-parseInt(_0x239c18(0x11e))/0x7*(-parseInt(_0x239c18(0x11c))/0x8)+-parseInt(_0x239c18(0x121))/0x9+parseInt(_0x239c18(0x120))/0xa*(parseInt(_0x239c18(0x11f))/0xb);if(_0x5a2772===_0x36c0bb)break;else _0x3a2cba['push'](_0x3a2cba['shift']());}catch(_0x399f94){_0x3a2cba['push'](_0x3a2cba['shift']());}}}(a57_0x51fe,0xdc127));import{dataFilter}from'../../commands/data/filter.js';import{dataGetOne}from'../../commands/data/getOne.js';function a57_0x1fd6(_0x231f36,_0x4061f6){_0x231f36=_0x231f36-0x11b;const _0x51fe41=a57_0x51fe();let _0x1fd685=_0x51fe41[_0x231f36];return _0x1fd685;}function a57_0x51fe(){const _0x334596=['3DuSDWM','80nYBOyU','2620712kmwOJT','16fryliW','107466LRtQfK','1278634CybowI','44PuVMMp','5162410gdjpHi','14276727dowfwO','379385SddrZh','1610834WFljNv'];a57_0x51fe=function(){return _0x334596;};return a57_0x51fe();}export const dataDefinitions=[dataFilter,dataGetOne];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2d9f24,_0x1dbd11){const _0x3f74be=a58_0x3d59,_0x293539=_0x2d9f24();while(!![]){try{const _0x5b0752=parseInt(_0x3f74be(0xd0))/0x1+-parseInt(_0x3f74be(0xd5))/0x2*(-parseInt(_0x3f74be(0xbe))/0x3)+-parseInt(_0x3f74be(0xc9))/0x4*(parseInt(_0x3f74be(0xc7))/0x5)+-parseInt(_0x3f74be(0xbd))/0x6+parseInt(_0x3f74be(0xd8))/0x7*(-parseInt(_0x3f74be(0xc5))/0x8)+parseInt(_0x3f74be(0xcc))/0x9+-parseInt(_0x3f74be(0xc6))/0xa*(-parseInt(_0x3f74be(0xc1))/0xb);if(_0x5b0752===_0x1dbd11)break;else _0x293539['push'](_0x293539['shift']());}catch(_0x406008){_0x293539['push'](_0x293539['shift']());}}}(a58_0x119e,0xaf470));function a58_0x3d59(_0x6977e6,_0x530da2){_0x6977e6=_0x6977e6-0xbd;const _0x119e6f=a58_0x119e();let _0x3d5989=_0x119e6f[_0x6977e6];return _0x3d5989;}import{executeDatasetDataOperation}from'../../core/api-client.js';import{CODE_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{parseJsonParams}from'../../utils/params.js';function assertGetOneId(_0x33f13a){const _0x4dd25c=a58_0x3d59;if(!_0x33f13a)throw CliErrors[_0x4dd25c(0xce)]('params',_0x4dd25c(0xd1));const _0x38d427=_0x33f13a['id'];if(_0x38d427===undefined||_0x38d427===null||_0x38d427==='')throw CliErrors[_0x4dd25c(0xbf)](_0x4dd25c(0xd3),_0x4dd25c(0xd6));}function a58_0x119e(){const _0x4f7217=['7mRlBid','appCode','params','str','8490750AkieyP','27CSMAwb','validation','string','11yQZoEZ','operation','\x20completed\x20in\x20','paramsRequired','6942904fQFtzN','30432570fEAwOa','5pxLGLU','read','5192644HVNvGI','code','description','189405dzfDyz','helpExtra','flagMissing','command','266149OYWUio','Provide\x20--params\x20\x27{\x22id\x22:123}\x27\x20for\x20data\x20getOne.','paramsHint','data\x20getOne\x20requires\x20\x22id\x22\x20in\x20--params','data\x20','215252xQChFp','Example:\x20--params\x20\x27{\x22id\x22:123}\x27','now'];a58_0x119e=function(){return _0x4f7217;};return a58_0x119e();}function parseCommandParams(_0x1bd889){return parseJsonParams(_0x1bd889)??{};}export function buildDataCommand(_0x286133){const _0x26d379=a58_0x3d59,_0x1935c1='Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically';return{'service':'data','command':_0x286133[_0x26d379(0xcf)],'description':_0x286133[_0x26d379(0xcb)],'risk':_0x26d379(0xc8),'defaultOutputFormat':'compress','helpExtra':_0x286133[_0x26d379(0xcd)],'flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':'alias','type':_0x26d379(0xc0),'description':_0x1935c1},{'name':'params','type':_0x26d379(0xc0),'description':_0x286133['paramsHint']}],async 'validate'(_0x5a0907){const _0x2a1931=_0x26d379,_0x5d6733=_0x5a0907['str'](_0x2a1931(0xda));if(_0x286133[_0x2a1931(0xc4)]&&!_0x5d6733)throw CliErrors['flagMissing']('params',_0x286133[_0x2a1931(0xd2)]);const _0x3018c2=parseJsonParams(_0x5d6733);_0x286133[_0x2a1931(0xc2)]==='getOne'&&assertGetOneId(_0x3018c2);},async 'execute'(_0x481ffa){const _0x473523=_0x26d379,_0x164327=parseCommandParams(_0x481ffa[_0x473523(0xdb)](_0x473523(0xda))),_0xf56ff6=Date[_0x473523(0xd7)](),_0x83dd97=await executeDatasetDataOperation(_0x481ffa[_0x473523(0xd9)],_0x481ffa[_0x473523(0xdb)](_0x473523(0xca)),_0x286133[_0x473523(0xc2)],_0x164327),_0x45ac29=Date['now']()-_0xf56ff6;return{'ok':!![],'data':{'result':_0x83dd97,'elapsed':_0x45ac29},'message':_0x473523(0xd4)+_0x286133['command']+_0x473523(0xc3)+_0x45ac29+'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
|
+
const a59_0xc4451c=a59_0x112f;(function(_0x479b73,_0x216a83){const _0x39d5d6=a59_0x112f,_0x15d312=_0x479b73();while(!![]){try{const _0x5b1b9e=parseInt(_0x39d5d6(0x1c3))/0x1*(parseInt(_0x39d5d6(0x1a9))/0x2)+-parseInt(_0x39d5d6(0x1c5))/0x3+parseInt(_0x39d5d6(0x1a3))/0x4+parseInt(_0x39d5d6(0x1b0))/0x5+parseInt(_0x39d5d6(0x1a7))/0x6+-parseInt(_0x39d5d6(0x1bd))/0x7+-parseInt(_0x39d5d6(0x1e2))/0x8;if(_0x5b1b9e===_0x216a83)break;else _0x15d312['push'](_0x15d312['shift']());}catch(_0xeebf97){_0x15d312['push'](_0x15d312['shift']());}}}(a59_0x4cd4,0xef471));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateErBusinessGroup}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const BACKEND_PATH=a59_0xc4451c(0x1b2);export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x2944b4,input:_0x52b72a,dryRun:_0x5134a9}){const _0x261978=a59_0xc4451c;validateInput(_0x52b72a);const _0x31eba9=normalizeBusinessGroup(_0x52b72a[_0x261978(0x1bf)]),_0x30bfbe=await getDatasetDetail(_0x52b72a['code']),_0x3d3033=resolveBusinessGroupDataset(_0x30bfbe,_0x52b72a['code']),_0x4379dc=loadCurrentBusinessGroup(_0x30bfbe,_0x3d3033);assertExpectedBusinessGroup(_0x4379dc,_0x52b72a[_0x261978(0x1ca)]);const _0x30419e=buildBackendPayload(_0x2944b4,_0x3d3033,_0x31eba9),_0x2cae7c=_0x4379dc!==_0x31eba9;let _0x379d86;if(_0x2cae7c&&!_0x5134a9){await updateErBusinessGroup(_0x30419e);const _0x50f740=await getDatasetDetail(_0x3d3033[_0x261978(0x1d2)]),_0x2ab709=resolveBusinessGroupDataset(_0x50f740,_0x3d3033[_0x261978(0x1d2)]),_0x4972e2=loadCurrentBusinessGroup(_0x50f740,_0x2ab709);if(_0x4972e2!==_0x31eba9)throw CliErrors[_0x261978(0x1b1)](_0x261978(0x1c4),'Expected\x20'+JSON['stringify'](_0x31eba9)+',\x20actual\x20'+JSON[_0x261978(0x1b7)](_0x4972e2)+'.');_0x379d86={'verified':!![],'status':_0x261978(0x1cb),'afterReadback':{'businessGroup':_0x4972e2}};}else!_0x2cae7c&&(_0x379d86={'verified':!![],'status':_0x261978(0x1ba),'afterReadback':{'businessGroup':_0x4379dc}});const _0x1e5cd4={'operation':_0x261978(0x1b9),'appCode':_0x2944b4,'selector':{'code':_0x3d3033[_0x261978(0x1d2)]},'dataset':_0x3d3033,'before':{'businessGroup':_0x4379dc},'after':{'businessGroup':_0x31eba9},'changed':_0x2cae7c,'dryRun':_0x5134a9,'submitted':_0x2cae7c&&!_0x5134a9,'backend':{'method':'POST','path':BACKEND_PATH,'payload':_0x30419e},..._0x379d86?{'verification':_0x379d86}:{},'warnings':[]};return{'ok':!![],'data':_0x1e5cd4,'message':_0x2cae7c?_0x5134a9?_0x261978(0x1bb)+_0x3d3033[_0x261978(0x1d2)]:_0x261978(0x1df)+_0x3d3033['code']:_0x261978(0x1de)+_0x3d3033[_0x261978(0x1d2)]};}export const datasetBusinessGroupUpdate={'service':a59_0xc4451c(0x1b8),'command':a59_0xc4451c(0x1a1),'description':'Update\x20business\x20model\x20group','risk':a59_0xc4451c(0x1c1),'flags':[CODE_FLAG,{'name':a59_0xc4451c(0x1d8),'type':a59_0xc4451c(0x1db),'required':!![],'description':a59_0xc4451c(0x1d3)},{'name':a59_0xc4451c(0x1c8),'type':a59_0xc4451c(0x1db),'required':![],'description':a59_0xc4451c(0x1c2)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x53ab2){validateInput(readBusinessGroupUpdateInput(_0x53ab2));},async 'dryRun'(_0x4f9f33){const _0x1c17d0=a59_0xc4451c,_0x1f4f7b=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x4f9f33[_0x1c17d0(0x1a8)],'input':readBusinessGroupUpdateInput(_0x4f9f33),'dryRun':!![]});return{'method':_0x1c17d0(0x1dd),'url':BACKEND_PATH,'body':_0x1f4f7b[_0x1c17d0(0x1ac)][_0x1c17d0(0x1e1)][_0x1c17d0(0x1da)],'description':_0x1f4f7b['message'],..._0x1f4f7b['data']};},async 'execute'(_0x24cd63){const _0x46c035=a59_0xc4451c;return buildDatasetBusinessGroupUpdateResult({'appCode':_0x24cd63[_0x46c035(0x1a8)],'input':readBusinessGroupUpdateInput(_0x24cd63),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x1067a0){const _0x5a2014=a59_0xc4451c,_0x54355c=_0x1067a0[_0x5a2014(0x1e0)](_0x5a2014(0x1c8));return{'code':trim(_0x1067a0[_0x5a2014(0x1e0)](_0x5a2014(0x1d2))),'businessGroup':_0x1067a0['str'](_0x5a2014(0x1d8)),'expectBusinessGroup':_0x54355c===undefined||_0x54355c===''?undefined:_0x54355c};}function validateInput(_0xfa0d6e){const _0x3ddbc5=a59_0xc4451c;if(!trim(_0xfa0d6e[_0x3ddbc5(0x1d2)]))throw CliErrors[_0x3ddbc5(0x1d4)]('--code\x20is\x20required');if(_0xfa0d6e[_0x3ddbc5(0x1bf)]===undefined)throw CliErrors[_0x3ddbc5(0x1d4)](_0x3ddbc5(0x1d7));}function resolveBusinessGroupDataset(_0x51ae09,_0x2672c3){const _0x149338=a59_0xc4451c,_0x2b5744=asPlainObject(_0x51ae09[_0x149338(0x1b8)]),_0x72a357=asPlainObject(_0x51ae09[_0x149338(0x1a5)]),_0x1ba109=resolveSourceType(_0x51ae09,_0x2b5744,_0x72a357),_0xeb49=firstString(_0x51ae09[_0x149338(0x1d9)],_0x51ae09[_0x149338(0x1d2)],_0x2b5744[_0x149338(0x1c7)],_0x2672c3)||_0x2672c3;return{'id':firstNumber(_0x51ae09[_0x149338(0x1cd)],_0x51ae09['id'],_0x2b5744[_0x149338(0x1af)])??firstString(_0x51ae09['modelId'],_0x51ae09['id'],_0x2b5744[_0x149338(0x1af)])??null,'code':_0xeb49,'name':firstString(_0x51ae09[_0x149338(0x1b3)],_0x2b5744[_0x149338(0x1aa)],_0x2b5744[_0x149338(0x1b3)])||null,'sourceType':_0x1ba109};}function resolveSourceType(_0x42e825,_0x29ddc0,_0x2d80a7){const _0x227cd9=a59_0xc4451c,_0x3224bc=firstString(_0x42e825[_0x227cd9(0x1c0)],_0x42e825[_0x227cd9(0x1a4)],_0x29ddc0[_0x227cd9(0x1c0)],_0x29ddc0['sourceType'])?.['trim']()[_0x227cd9(0x1bc)]();if(_0x3224bc===_0x227cd9(0x1ad)||_0x3224bc===_0x227cd9(0x1be))return _0x3224bc;if(Object[_0x227cd9(0x1cf)](_0x2d80a7)[_0x227cd9(0x1d6)]>0x0)return'DB_TABLE';throw CliErrors[_0x227cd9(0x1d4)](_0x227cd9(0x1d0));}function loadCurrentBusinessGroup(_0x37f211,_0x547a55){const _0x59a6b8=a59_0xc4451c,_0x3e0e87=readBusinessGroupFromDatasetDetail(_0x37f211,_0x547a55['sourceType']);if(_0x3e0e87['found'])return normalizeBusinessGroup(_0x3e0e87['value']);if(_0x547a55[_0x59a6b8(0x1a4)]===_0x59a6b8(0x1be))return'';throw CliErrors[_0x59a6b8(0x1d4)](_0x59a6b8(0x1a6),_0x59a6b8(0x1b5));}function readBusinessGroupFromDatasetDetail(_0x3f537f,_0x21c31d){const _0x3ed4e3=a59_0xc4451c,_0x419a7f=asPlainObject(_0x3f537f[_0x3ed4e3(0x1b8)]),_0x53e17a=firstPresent(_0x3f537f[_0x3ed4e3(0x1bf)]);if(_0x53e17a[_0x3ed4e3(0x1c9)])return _0x53e17a;const _0x423d03=firstPresent(_0x419a7f['businessGroup']);if(_0x423d03[_0x3ed4e3(0x1c9)])return _0x423d03;if(_0x21c31d===_0x3ed4e3(0x1ad))return{'found':![]};const _0x551cd5=readBusinessGroupFromExtend(_0x3f537f[_0x3ed4e3(0x1a2)]);if(_0x551cd5['found'])return _0x551cd5;return readBusinessGroupFromExtend(_0x419a7f[_0x3ed4e3(0x1a2)]);}function readBusinessGroupFromExtend(_0x5e1411){const _0x33dc17=a59_0xc4451c;if(_0x5e1411===undefined||_0x5e1411===null||_0x5e1411==='')return{'found':![]};if(typeof _0x5e1411===_0x33dc17(0x1db))try{const _0x31ee28=JSON['parse'](_0x5e1411);return readBusinessGroupFromExtend(_0x31ee28);}catch{return{'found':![]};}const _0x2ae931=asPlainObject(_0x5e1411);if(Object[_0x33dc17(0x1d5)][_0x33dc17(0x1b6)][_0x33dc17(0x1ab)](_0x2ae931,_0x33dc17(0x1bf)))return{'found':!![],'value':_0x2ae931['businessGroup']};return{'found':![]};}function firstPresent(..._0x2bfbdd){for(const _0x547ce6 of _0x2bfbdd){if(_0x547ce6!==undefined&&_0x547ce6!==null)return{'found':!![],'value':_0x547ce6};}return{'found':![]};}function assertExpectedBusinessGroup(_0x179bf0,_0x38757a){const _0x4b0a1a=a59_0xc4451c;if(_0x38757a===undefined)return;const _0x1e9fb8=normalizeBusinessGroup(_0x38757a);if(_0x179bf0!==_0x1e9fb8)throw CliErrors['validation'](_0x4b0a1a(0x1b4),_0x4b0a1a(0x1c6)+JSON['stringify'](_0x1e9fb8)+',\x20actual\x20'+JSON['stringify'](_0x179bf0));}function buildBackendPayload(_0x55c4bb,_0x28ff1c,_0x9ef7f5){const _0x306525=a59_0xc4451c;return{'appCode':_0x55c4bb,'datasetCode':_0x28ff1c[_0x306525(0x1d2)],'businessGroup':_0x9ef7f5};}function normalizeBusinessGroup(_0x40ba78){const _0x32f0da=a59_0xc4451c;if(_0x40ba78===undefined||_0x40ba78===null)return'';return String(_0x40ba78)[_0x32f0da(0x1ae)]();}function a59_0x4cd4(){const _0x23e250=['Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.','isArray','code','New\x20business\x20model\x20group\x20value;\x20empty\x20string\x20clears\x20it','validation','prototype','length','--business-group\x20is\x20required','business-group','modelCode','payload','string','number','POST','No\x20changes\x20for\x20business\x20model\x20group\x20on\x20dataset\x20','Updated\x20business\x20model\x20group\x20for\x20dataset\x20','str','backend','14529544eYzkNA','business-group-update','extend','3304156JyuXpA','sourceType','dbtableConfig','Dataset\x20detail\x20does\x20not\x20expose\x20businessGroup.','7112982nYYWza','appCode','2780354DJYiUs','datasetName','call','data','DB_TABLE','trim','datasetId','6822700tSJsNv','apiError','/smartapi/question/er-config/business-group/edit','name','Expectation\x20mismatch\x20at\x20businessGroup','Business\x20model\x20group\x20readback\x20must\x20be\x20available\x20by\x20datasetCode;\x20upgrade\x20the\x20backend\x20read\x20contract\x20instead\x20of\x20using\x20dblinkId/tableName.','hasOwnProperty','stringify','dataset','update','unchanged','Dry-run:\x20business\x20model\x20group\x20would\x20change\x20for\x20dataset\x20','toUpperCase','13344912BiZspG','METADATA','businessGroup','source','write','Expected\x20current\x20business\x20model\x20group;\x20mismatch\x20aborts\x20without\x20writing','1HPILwn','Business\x20model\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','190689liShbd','Expected\x20','datasetCode','expect-business-group','found','expectBusinessGroup','matched','isFinite','modelId','object','keys'];a59_0x4cd4=function(){return _0x23e250;};return a59_0x4cd4();}function asPlainObject(_0x320d5e){const _0x382a81=a59_0xc4451c;if(!_0x320d5e||typeof _0x320d5e!==_0x382a81(0x1ce)||Array[_0x382a81(0x1d1)](_0x320d5e))return{};return _0x320d5e;}function firstString(..._0x3b4cfa){const _0x2ddac2=a59_0xc4451c;for(const _0x2b9a45 of _0x3b4cfa){if(typeof _0x2b9a45===_0x2ddac2(0x1db)&&_0x2b9a45[_0x2ddac2(0x1ae)]())return _0x2b9a45[_0x2ddac2(0x1ae)]();if(typeof _0x2b9a45===_0x2ddac2(0x1dc)&&Number[_0x2ddac2(0x1cc)](_0x2b9a45))return String(_0x2b9a45);}return undefined;}function a59_0x112f(_0x13c678,_0x1b8b92){_0x13c678=_0x13c678-0x1a1;const _0x4cd426=a59_0x4cd4();let _0x112f57=_0x4cd426[_0x13c678];return _0x112f57;}function firstNumber(..._0x6ce0a){const _0x3d4a40=a59_0xc4451c;for(const _0x1cb416 of _0x6ce0a){if(typeof _0x1cb416==='number'&&Number[_0x3d4a40(0x1cc)](_0x1cb416))return _0x1cb416;if(typeof _0x1cb416==='string'&&_0x1cb416[_0x3d4a40(0x1ae)]()&&Number[_0x3d4a40(0x1cc)](Number(_0x1cb416)))return Number(_0x1cb416);}return null;}function trim(_0x5b6db4){const _0x6eeecc=a59_0xc4451c;return String(_0x5b6db4||'')[_0x6eeecc(0x1ae)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a60_0x488b12=a60_0x4e74;(function(_0x123ea5,_0x260d5e){const _0x5edaec=a60_0x4e74,_0x49102e=_0x123ea5();while(!![]){try{const _0x312916=parseInt(_0x5edaec(0x155))/0x1*(parseInt(_0x5edaec(0x146))/0x2)+-parseInt(_0x5edaec(0x150))/0x3*(-parseInt(_0x5edaec(0x14c))/0x4)+-parseInt(_0x5edaec(0x160))/0x5+-parseInt(_0x5edaec(0x158))/0x6+parseInt(_0x5edaec(0x148))/0x7*(parseInt(_0x5edaec(0x14f))/0x8)+-parseInt(_0x5edaec(0x165))/0x9+parseInt(_0x5edaec(0x149))/0xa;if(_0x312916===_0x260d5e)break;else _0x49102e['push'](_0x49102e['shift']());}catch(_0x3ae120){_0x49102e['push'](_0x49102e['shift']());}}}(a60_0x179c,0xcbf64));import{CliErrors}from'../../errors.js';export const RUNTIME_DATA_ACCESS_COMMANDS={'cli':a60_0x488b12(0x162),'filter':a60_0x488b12(0x145),'getOne':'lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27\x20--format\x20compress'};function a60_0x179c(){const _0x58a79d=['length','9046740juxtxj','请先将该数据集升级/迁移为\x20DB_TABLE\x20数据集,再基于新的\x20dataset\x20code\x20继续开发。','object','tableName','\x20是\x20','\x20类型,没有可用于\x20','\x20的\x20DB_TABLE\x20数据源上下文。','datasetName','5097095GeGwmM','trim','lovrabet','filter','SQL\x20schema\x20validation','3846051fTsKxy','join','原因:schema\x20introspection\x20与\x20custom\x20SQL\x20需要\x20source=DB_TABLE、dbtableConfig.dbId、dbtableConfig.tableName\x20与数据库连接上下文。','name','METADATA','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27<json>\x27\x20--format\x20compress','698008cmkGty','UNKNOWN','7kOQvRW','13357490cZpepW','dataset','当前数据集\x20\x22','688gAOjOs','toUpperCase','source','7883896LZdVYM','13443UvZrsn','dbId','datasetCode','validation','modelCode','2UuwKvj','dbtable'];a60_0x179c=function(){return _0x58a79d;};return a60_0x179c();}export const RUNTIME_DATA_ACCESS_SUMMARY='Use\x20lovrabet\x20data\x20filter/getOne\x20for\x20real\x20runtime\x20records.';function valueToString(_0x425b08){const _0x44758c=a60_0x488b12;return _0x425b08==null?'':String(_0x425b08)[_0x44758c(0x161)]();}function getDatasetCode(_0x33e927){const _0x54558d=a60_0x488b12;return valueToString(_0x33e927['code']??_0x33e927[_0x54558d(0x154)]??_0x33e927[_0x54558d(0x14a)]?.[_0x54558d(0x152)]);}function getDatasetName(_0x426d7c){const _0x3ac08d=a60_0x488b12;return valueToString(_0x426d7c[_0x3ac08d(0x143)]??_0x426d7c[_0x3ac08d(0x14a)]?.[_0x3ac08d(0x15f)])||'unknown';}function getDatasetSource(_0x522bcc){const _0x13e916=a60_0x488b12;return valueToString(_0x522bcc[_0x13e916(0x14e)]??_0x522bcc[_0x13e916(0x14a)]?.['sourceType'])[_0x13e916(0x14d)]();}function a60_0x4e74(_0x51ac7a,_0x398a63){_0x51ac7a=_0x51ac7a-0x142;const _0x179cb4=a60_0x179c();let _0x4e7449=_0x179cb4[_0x51ac7a];return _0x4e7449;}function getDbtableConfig(_0x42781f){const _0xedda38=a60_0x488b12,_0x329ac3=_0x42781f['dbtableConfig']??_0x42781f[_0xedda38(0x156)];return _0x329ac3&&typeof _0x329ac3===_0xedda38(0x15a)?_0x329ac3:{};}export function isDbTableBackedDataset(_0x28bbf2){const _0x246d4f=a60_0x488b12,_0x11a27d=getDatasetSource(_0x28bbf2);if(_0x11a27d===_0x246d4f(0x144))return![];const _0x5dfe25=getDbtableConfig(_0x28bbf2),_0x42101b=_0x5dfe25[_0x246d4f(0x151)]??_0x5dfe25['id'],_0x123621=valueToString(_0x5dfe25[_0x246d4f(0x15b)]??_0x28bbf2['tableName']??_0x28bbf2[_0x246d4f(0x14a)]?.[_0x246d4f(0x15b)]);return _0x42101b!==undefined&&_0x42101b!==null&&_0x123621[_0x246d4f(0x157)]>0x0;}export function filterDbTableBackedDatasets(_0x1dae01){const _0x5bd758=a60_0x488b12;return _0x1dae01[_0x5bd758(0x163)](_0x3ccad0=>isDbTableBackedDataset(_0x3ccad0));}export function buildDbTableBackedRequirementMessage(_0x2f7aca,_0x34ba92=a60_0x488b12(0x164)){const _0x3339f0=a60_0x488b12,_0x4f4b6f=getDatasetSource(_0x2f7aca)||_0x3339f0(0x147),_0x4a4dd6=getDatasetName(_0x2f7aca),_0x57bc4a=getDatasetCode(_0x2f7aca),_0xbb913b=_0x57bc4a?'\x20('+_0x57bc4a+')':'';return[_0x3339f0(0x14b)+_0x4a4dd6+'\x22'+_0xbb913b+_0x3339f0(0x15c)+_0x4f4b6f+_0x3339f0(0x15d)+_0x34ba92+_0x3339f0(0x15e),_0x3339f0(0x142),_0x3339f0(0x159),'如果只是查看运行态真实行数据,请切换到\x20lovrabet\x20CLI:'+RUNTIME_DATA_ACCESS_COMMANDS['filter']+';'+RUNTIME_DATA_ACCESS_COMMANDS['getOne']+'。'][_0x3339f0(0x166)]('\x20');}export function assertDatasetIsDbTableBacked(_0x371805,_0x5ef3cc){const _0x5b51be=a60_0x488b12;if(!isDbTableBackedDataset(_0x371805))throw CliErrors[_0x5b51be(0x153)](buildDbTableBackedRequirementMessage(_0x371805,_0x5ef3cc));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a61_0x4a4c36=a61_0x14cc;(function(_0x37475f,_0x57f56e){const _0x2b528c=a61_0x14cc,_0x4ab6a3=_0x37475f();while(!![]){try{const _0x4b65e6=-parseInt(_0x2b528c(0xa1))/0x1+-parseInt(_0x2b528c(0x94))/0x2*(parseInt(_0x2b528c(0x8f))/0x3)+parseInt(_0x2b528c(0x97))/0x4*(-parseInt(_0x2b528c(0x95))/0x5)+parseInt(_0x2b528c(0xa6))/0x6+-parseInt(_0x2b528c(0x80))/0x7*(-parseInt(_0x2b528c(0x7c))/0x8)+parseInt(_0x2b528c(0x89))/0x9*(-parseInt(_0x2b528c(0xa3))/0xa)+parseInt(_0x2b528c(0x9c))/0xb;if(_0x4b65e6===_0x57f56e)break;else _0x4ab6a3['push'](_0x4ab6a3['shift']());}catch(_0xf654c3){_0x4ab6a3['push'](_0x4ab6a3['shift']());}}}(a61_0x273c,0x47549));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_0x4a4c36(0x9f),'description':a61_0x4a4c36(0xa5)},DBID_FLAG={'name':a61_0x4a4c36(0x83),'type':a61_0x4a4c36(0x9f),'description':'Delete\x20all\x20datasets\x20under\x20this\x20database\x20connection\x20id'},CONFIRM_FLAG={'name':'confirm','type':'boolean','description':'Required\x20to\x20execute\x20dataset\x20deletion'},EXPECTED_COUNT_FLAG={'name':a61_0x4a4c36(0x8c),'type':a61_0x4a4c36(0x9f),'description':a61_0x4a4c36(0x96)};function a61_0x273c(){const _0x365a94=['code','dataset','8025787SDVJyd','Delete\x20dataset\x20metadata\x20by\x20id/code\x20or\x20all\x20datasets\x20under\x20a\x20db\x20id','appCode','number','dbid=','312587zgGZSr','bool','2357380niPhwl','Deleted\x20','Dataset\x20id','1286712mMsoRq','length','num','relationPages','\x20dataset(s);\x20','3448wcwgJh','id=','--confirm\x20is\x20required\x20to\x20delete\x20datasets.','Use\x20only\x20one\x20of\x20--id,\x20--code,\x20or\x20--dbid.','7637McSdMd','POST','One\x20of\x20--id,\x20--code,\x20or\x20--dbid\x20is\x20required.','dbid','str','\x20failed','Would\x20delete\x20','isArray','validation','9YEctSk','delete','push','expected-count','Matched\x20','high-risk-write','1381614dVJBGx','filter','description','dbtableConfig','name','2JZfpYe','5FAEJAu','Abort\x20unless\x20the\x20matched\x20dataset\x20count\x20equals\x20this\x20value','453032fbgFmN','/smartapi/dataset/delete-dataset','message'];a61_0x273c=function(){return _0x365a94;};return a61_0x273c();}export const datasetDelete={'service':a61_0x4a4c36(0x9b),'command':a61_0x4a4c36(0x8a),'description':a61_0x4a4c36(0x9d),'risk':a61_0x4a4c36(0x8e),'flags':[DATASET_ID_FLAG,CODE_FLAG_OPTIONAL,DBID_FLAG,CONFIRM_FLAG,EXPECTED_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4485dc){const _0x465f5d=a61_0x4a4c36,_0x41274f=_0x4485dc['num']('id'),_0x426674=_0x4485dc[_0x465f5d(0x84)](_0x465f5d(0x9a)),_0x577489=_0x4485dc[_0x465f5d(0xa8)](_0x465f5d(0x83)),_0x5058f8=[_0x41274f>0x0,Boolean(_0x426674),_0x577489>0x0][_0x465f5d(0x90)](Boolean);if(_0x5058f8[_0x465f5d(0xa7)]===0x0)throw CliErrors[_0x465f5d(0x88)](_0x465f5d(0x82));if(_0x5058f8[_0x465f5d(0xa7)]>0x1)throw CliErrors[_0x465f5d(0x88)](_0x465f5d(0x7f));},async 'dryRun'(_0x9fe801){const _0xf46215=a61_0x4a4c36,_0x290192=await resolveTargets(_0x9fe801);return{'method':_0xf46215(0x81),'url':_0xf46215(0x98),'body':{'appCode':_0x9fe801[_0xf46215(0x9e)],'count':_0x290192['length'],'datasets':_0x290192},'description':_0xf46215(0x86)+_0x290192[_0xf46215(0xa7)]+'\x20dataset(s).\x20This\x20only\x20deletes\x20platform\x20dataset\x20metadata\x20and\x20related\x20page/menu\x20records,\x20not\x20physical\x20databases\x20or\x20tables.'};},async 'execute'(_0x47a1ba){const _0x562386=a61_0x4a4c36;if(!_0x47a1ba[_0x562386(0xa2)]('confirm'))throw CliErrors['validation'](_0x562386(0x7e),'Run\x20with\x20--dry-run\x20first,\x20then\x20add\x20--confirm\x20when\x20the\x20target\x20list\x20is\x20correct.');const _0x275b86=await resolveTargets(_0x47a1ba),_0x1d1f28=[],_0x3bef20=[];for(const _0x5bd306 of _0x275b86){try{await deleteDataset(_0x47a1ba['appCode'],_0x5bd306['id']),_0x1d1f28[_0x562386(0x8b)](_0x5bd306);}catch(_0x448890){_0x3bef20[_0x562386(0x8b)]({..._0x5bd306,'error':_0x448890 instanceof Error?_0x448890[_0x562386(0x99)]:String(_0x448890)});}}if(_0x3bef20[_0x562386(0xa7)]>0x0)return{'ok':![],'data':{'requested':_0x275b86[_0x562386(0xa7)],'deletedCount':_0x1d1f28['length'],'failedCount':_0x3bef20['length'],'deleted':_0x1d1f28,'failed':_0x3bef20},'message':_0x562386(0xa4)+_0x1d1f28[_0x562386(0xa7)]+'/'+_0x275b86[_0x562386(0xa7)]+_0x562386(0x7b)+_0x3bef20[_0x562386(0xa7)]+_0x562386(0x85)};return{'ok':!![],'data':{'requested':_0x275b86[_0x562386(0xa7)],'deletedCount':_0x1d1f28['length'],'deleted':_0x1d1f28},'message':_0x562386(0xa4)+_0x1d1f28[_0x562386(0xa7)]+'\x20dataset(s)'};}};function a61_0x14cc(_0xdea332,_0x3ed1fc){_0xdea332=_0xdea332-0x7b;const _0x273c4a=a61_0x273c();let _0x14ccdb=_0x273c4a[_0xdea332];return _0x14ccdb;}async function resolveTargets(_0x47a36b){const _0x508e74=a61_0x4a4c36,_0x2b6379=_0x47a36b[_0x508e74(0xa8)]('id'),_0x4f272e=_0x47a36b[_0x508e74(0x84)](_0x508e74(0x9a)),_0x234707=_0x47a36b[_0x508e74(0xa8)](_0x508e74(0x83));let _0x1e66cd;_0x4f272e?(_0x1e66cd=await listDatasets(_0x47a36b[_0x508e74(0x9e)],{'code':_0x4f272e}),_0x1e66cd=_0x1e66cd[_0x508e74(0x90)](_0x83845b=>_0x83845b['code']===_0x4f272e)):(_0x1e66cd=await listDatasets(_0x47a36b['appCode']),_0x2b6379>0x0&&(_0x1e66cd=_0x1e66cd[_0x508e74(0x90)](_0x576f81=>_0x576f81['id']===_0x2b6379)),_0x234707>0x0&&(_0x1e66cd=_0x1e66cd[_0x508e74(0x90)](_0x4d1888=>_0x4d1888['dbtableConfig']?.['dbId']===_0x234707)));const _0x23b44b=_0x1e66cd['map'](normalizeTarget);if(_0x23b44b[_0x508e74(0xa7)]===0x0){const _0x2a7954=_0x4f272e||(_0x2b6379>0x0?_0x508e74(0x7d)+_0x2b6379:_0x508e74(0xa0)+_0x234707);throw CliErrors[_0x508e74(0x88)]('No\x20undeleted\x20dataset\x20found\x20for\x20'+_0x2a7954+'.');}const _0x5fda41=_0x47a36b[_0x508e74(0xa8)](_0x508e74(0x8c));if(_0x5fda41>0x0&&_0x23b44b[_0x508e74(0xa7)]!==_0x5fda41)throw CliErrors[_0x508e74(0x88)](_0x508e74(0x8d)+_0x23b44b[_0x508e74(0xa7)]+'\x20dataset(s),\x20but\x20--expected-count\x20is\x20'+_0x5fda41+'.');return _0x23b44b;}function normalizeTarget(_0x2c4365){const _0x206e22=a61_0x4a4c36,_0x490861=_0x2c4365[_0x206e22(0x92)]??{};return{'id':_0x2c4365['id'],'code':_0x2c4365['code'],'name':_0x2c4365[_0x206e22(0x93)],'description':_0x2c4365[_0x206e22(0x91)],'source':_0x2c4365['source'],'dbId':_0x490861['dbId'],'dbName':_0x490861['dbName'],'tableName':_0x490861['tableName'],'relatedPageCount':Array[_0x206e22(0x87)](_0x2c4365[_0x206e22(0xa9)])?_0x2c4365['relationPages'][_0x206e22(0xa7)]:undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a62_0x515489=a62_0x534f;function a62_0x47af(){const _0x1badd2=['38385DNKNTS','requestBody','required','isArray','operations','method','relationId','options','relations','dblinkInfoDTO','sourceType','3826734wlKaKK','relatedPageInfoList','entries','type','338956OzuLMP','dbType','title','10GCOQbr','fromField','doType','detail','string','updateTimeField','tableComment','logicField','str','592YVIWDr','source','creatorIdField','name','indexes','alias','responseBody','requestFields','read','toTableName','extend','path','formatRules','deprecated','1547364LClMtH','modelCode','labelField','90xOIZgO','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically','allFieldNames','cardinality','parse','modelId','displayName','doVersion','fields','allFields','744106aBoMAX','object','beforeScriptId','columnCodeListWithDeleted','pkField','responseFields','trim','dbId','bizRelationType','7gJWUTn','dataType','afterScriptId','deleted','code','toDatasetName','host','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','main_sub','2xjMqBc','1588436aivTYS','length','toFieldLabel','properties','filter','tableName','createTimeField','validateRules','map','dataset','18812232LNPlTF'];a62_0x47af=function(){return _0x1badd2;};return a62_0x47af();}(function(_0x2bfdad,_0x51eb5e){const _0x219d6c=a62_0x534f,_0x303b76=_0x2bfdad();while(!![]){try{const _0x4c4511=-parseInt(_0x219d6c(0x140))/0x1*(parseInt(_0x219d6c(0x15b))/0x2)+parseInt(_0x219d6c(0x121))/0x3+-parseInt(_0x219d6c(0x141))/0x4*(parseInt(_0x219d6c(0x15e))/0x5)+-parseInt(_0x219d6c(0x157))/0x6*(-parseInt(_0x219d6c(0x137))/0x7)+-parseInt(_0x219d6c(0x113))/0x8*(parseInt(_0x219d6c(0x14c))/0x9)+parseInt(_0x219d6c(0x124))/0xa*(-parseInt(_0x219d6c(0x12e))/0xb)+parseInt(_0x219d6c(0x14b))/0xc;if(_0x4c4511===_0x51eb5e)break;else _0x303b76['push'](_0x303b76['shift']());}catch(_0x59523b){_0x303b76['push'](_0x303b76['shift']());}}}(a62_0x47af,0xa2071));import{getDatasetDetail}from'../../core/api-client.js';import{CODE_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function normalizeField(_0x36a408){const _0x4df4ac=a62_0x534f;if(_0x36a408[_0x4df4ac(0x13a)])return null;const _0x2f3e9c=Boolean(_0x36a408[_0x4df4ac(0x12a)]!==undefined||_0x36a408[_0x4df4ac(0x10c)]!==undefined);let _0xfce34f={};if(!_0x2f3e9c&&typeof _0x36a408[_0x4df4ac(0x11d)]==='string')try{_0xfce34f=JSON[_0x4df4ac(0x128)](_0x36a408[_0x4df4ac(0x11d)]);}catch{}const _0x489426=_0x2f3e9c?_0x36a408[_0x4df4ac(0x116)]:_0x36a408['code'],_0x5556eb=_0x2f3e9c?_0x36a408[_0x4df4ac(0x12a)]:_0x36a408[_0x4df4ac(0x116)],_0x2f6e27=_0x2f3e9c?_0x36a408[_0x4df4ac(0x10c)]:_0x36a408[_0x4df4ac(0x15a)]||_0x36a408[_0x4df4ac(0x138)],_0x249f2f=_0x2f3e9c?_0x36a408[_0x4df4ac(0x132)]===!![]:_0xfce34f['pkField']===!![],_0x5c005b=_0x2f3e9c?_0x36a408['required']===!![]:_0xfce34f[_0x4df4ac(0x14e)]===!![],_0x4df1eb=_0x2f3e9c?_0x36a408[_0x4df4ac(0x153)]??null:_0xfce34f[_0x4df4ac(0x153)]??null,_0x50ce71={'name':_0x489426,'displayName':_0x5556eb||_0x489426,'type':_0x2f6e27,'dbType':_0x36a408[_0x4df4ac(0x15c)],'pk':_0x249f2f,'required':_0x5c005b,'deprecated':_0x36a408[_0x4df4ac(0x120)]===!![],'description':_0x36a408['description']||undefined};return Array['isArray'](_0x4df1eb)&&_0x4df1eb[_0x4df4ac(0x142)]>0x0&&(_0x50ce71[_0x4df4ac(0x153)]=_0x4df1eb),_0x50ce71;}function parseJsonMaybe(_0x37344d){if(typeof _0x37344d!=='string')return _0x37344d;try{return JSON['parse'](_0x37344d);}catch{return _0x37344d;}}function a62_0x534f(_0x232f6d,_0x4c753c){_0x232f6d=_0x232f6d-0x10c;const _0x47af77=a62_0x47af();let _0x534fea=_0x47af77[_0x232f6d];return _0x534fea;}function normalizeOperationEntry(_0x46ac28,_0x2bde12){const _0x525059=a62_0x534f;if(!_0x2bde12||typeof _0x2bde12!==_0x525059(0x12f))return null;if(!_0x2bde12[_0x525059(0x151)]||!_0x2bde12[_0x525059(0x11e)])return null;const _0x42b8a5={'name':_0x46ac28,'method':_0x2bde12[_0x525059(0x151)],'path':_0x2bde12[_0x525059(0x11e)]};if(_0x2bde12[_0x525059(0x13d)])_0x42b8a5[_0x525059(0x13d)]=_0x2bde12[_0x525059(0x13d)];if(_0x2bde12['requestBody']!=null){const _0x13a69c=parseJsonMaybe(_0x2bde12[_0x525059(0x14d)]);_0x42b8a5[_0x525059(0x14d)]=_0x13a69c;}if(_0x2bde12[_0x525059(0x119)]!=null){const _0x1f9662=parseJsonMaybe(_0x2bde12[_0x525059(0x119)]);_0x42b8a5[_0x525059(0x119)]=_0x1f9662;}if(_0x2bde12[_0x525059(0x130)]!=null)_0x42b8a5[_0x525059(0x130)]=_0x2bde12[_0x525059(0x130)];if(_0x2bde12[_0x525059(0x139)]!=null)_0x42b8a5[_0x525059(0x139)]=_0x2bde12['afterScriptId'];if(Array[_0x525059(0x14f)](_0x2bde12[_0x525059(0x11a)]))_0x42b8a5['requestFields']=_0x2bde12[_0x525059(0x11a)];if(Array['isArray'](_0x2bde12[_0x525059(0x133)]))_0x42b8a5[_0x525059(0x133)]=_0x2bde12[_0x525059(0x133)];return _0x42b8a5;}function summarizeDbtable(_0x303efc){const _0x53d184=a62_0x534f,_0x2953b2={},_0x124672=['dbId','dbName',_0x53d184(0x146),'datasetKey',_0x53d184(0x132),'allFields',_0x53d184(0x111),_0x53d184(0x147),_0x53d184(0x10f),_0x53d184(0x115),'creatorNameField','modifierIdField','modifierNameField',_0x53d184(0x123),_0x53d184(0x155)];for(const _0x11a497 of _0x124672){if(_0x303efc[_0x11a497]!==undefined)_0x2953b2[_0x11a497]=_0x303efc[_0x11a497];}return typeof _0x2953b2[_0x53d184(0x12d)]===_0x53d184(0x10e)&&_0x2953b2['allFields']['length']>0x0&&(_0x2953b2[_0x53d184(0x126)]=_0x2953b2[_0x53d184(0x12d)]['split'](',')[_0x53d184(0x149)](_0x3b0fd8=>_0x3b0fd8[_0x53d184(0x134)]())[_0x53d184(0x145)](Boolean)),_0x2953b2;}function normalizeRelatedPages(_0x25ba80){const _0x5d7bba=a62_0x534f;if(!Array[_0x5d7bba(0x14f)](_0x25ba80))return[];return _0x25ba80['filter'](_0x4bfa9e=>_0x4bfa9e&&typeof _0x4bfa9e===_0x5d7bba(0x12f))[_0x5d7bba(0x149)](_0x466af5=>({'id':_0x466af5['id'],'type':_0x466af5[_0x5d7bba(0x15a)],'code':_0x466af5[_0x5d7bba(0x13b)],'title':_0x466af5[_0x5d7bba(0x15d)],'deleted':_0x466af5[_0x5d7bba(0x13a)]===!![]}));}export const datasetDetail={'service':a62_0x515489(0x14a),'command':a62_0x515489(0x10d),'description':a62_0x515489(0x13e),'risk':a62_0x515489(0x11b),'flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':a62_0x515489(0x118),'type':'string','description':a62_0x515489(0x125)}],async 'execute'(_0x2818bd){const _0x55ec91=a62_0x515489,_0x520e18=await getDatasetDetail(_0x2818bd[_0x55ec91(0x112)](_0x55ec91(0x13b))),_0x236019=Array['isArray'](_0x520e18[_0x55ec91(0x12c)])?_0x520e18[_0x55ec91(0x12c)]:Array[_0x55ec91(0x14f)](_0x520e18[_0x55ec91(0x144)])?_0x520e18[_0x55ec91(0x144)]:[],_0xa2ef2c=_0x236019[_0x55ec91(0x149)](_0x410e2d=>normalizeField(_0x410e2d))[_0x55ec91(0x145)](_0x543e7d=>_0x543e7d!==null),_0x432d94=_0x520e18[_0x55ec91(0x150)]??{},_0x27deef=[];for(const [_0x67df3d,_0x5bc947]of Object[_0x55ec91(0x159)](_0x432d94)){const _0x3a9ad1=normalizeOperationEntry(_0x67df3d,_0x5bc947);if(_0x3a9ad1)_0x27deef['push'](_0x3a9ad1);}const _0x380caf=_0x520e18['dbtableConfig']??{},_0x47d754=_0x520e18[_0x55ec91(0x14a)]??{},_0x4015b8=_0x380caf[_0x55ec91(0x135)]!=null?{'id':_0x380caf[_0x55ec91(0x135)],'name':_0x380caf['dbName']??null}:undefined;let _0x5ca20f;return typeof _0x520e18[_0x55ec91(0x11d)]===_0x55ec91(0x10e)&&(_0x5ca20f=parseJsonMaybe(_0x520e18[_0x55ec91(0x11d)])),{'ok':!![],'data':{'id':_0x520e18[_0x55ec91(0x129)]??_0x520e18['id'],'name':_0x520e18[_0x55ec91(0x116)],'code':_0x520e18[_0x55ec91(0x122)]||_0x520e18['code'],'doVersion':_0x520e18[_0x55ec91(0x12b)],'description':_0x520e18['description']||_0x47d754[_0x55ec91(0x110)]||undefined,'source':_0x520e18[_0x55ec91(0x114)]||_0x47d754[_0x55ec91(0x156)],'table':_0x380caf[_0x55ec91(0x146)]||_0x47d754[_0x55ec91(0x146)],'datasetKey':_0x380caf['datasetKey'],'pk':_0x380caf[_0x55ec91(0x132)],'db':_0x4015b8,'dbtable':summarizeDbtable(_0x380caf),'fields':_0xa2ef2c,'operations':_0x27deef,'indexes':Array['isArray'](_0x47d754['indexes'])?_0x47d754[_0x55ec91(0x117)]:[],'relations':Array[_0x55ec91(0x14f)](_0x520e18[_0x55ec91(0x154)])?_0x520e18[_0x55ec91(0x154)][_0x55ec91(0x149)](_0x3394b4=>({..._0x3394b4[_0x55ec91(0x152)]!=null?{'relationId':_0x3394b4['relationId']}:{},'fromDataset':_0x520e18[_0x55ec91(0x116)],'fromCode':_0x520e18[_0x55ec91(0x122)]||_0x520e18[_0x55ec91(0x13b)],'fromTable':_0x380caf[_0x55ec91(0x146)]||_0x47d754[_0x55ec91(0x146)],'fromField':_0x3394b4[_0x55ec91(0x15f)],'toDataset':_0x3394b4[_0x55ec91(0x13c)],'toCode':_0x3394b4['toDatasetCode'],'toTable':_0x3394b4[_0x55ec91(0x11c)],'toField':_0x3394b4['toField'],'labelField':_0x3394b4[_0x55ec91(0x143)]||undefined,'cardinality':_0x3394b4[_0x55ec91(0x127)]||undefined,'bizRelationType':_0x3394b4[_0x55ec91(0x136)]===_0x55ec91(0x13f)?_0x55ec91(0x13f):null})):[],'relatedPages':normalizeRelatedPages(_0x520e18[_0x55ec91(0x158)]),...Array[_0x55ec91(0x14f)](_0x520e18[_0x55ec91(0x131)])?{'columnCodeListWithDeleted':_0x520e18[_0x55ec91(0x131)]}:{},'formatRules':Array[_0x55ec91(0x14f)](_0x520e18[_0x55ec91(0x11f)])?_0x520e18[_0x55ec91(0x11f)]:[],'validateRules':Array[_0x55ec91(0x14f)](_0x520e18['validateRules'])?_0x520e18[_0x55ec91(0x148)]:[],..._0x5ca20f!==undefined?{'extend':_0x5ca20f}:{},'stats':{'fieldCount':_0xa2ef2c[_0x55ec91(0x142)],'operationCount':_0x27deef[_0x55ec91(0x142)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a63_0x2de992=a63_0x242f;(function(_0x5b0b6b,_0x520f43){const _0x5481fe=a63_0x242f,_0x499d41=_0x5b0b6b();while(!![]){try{const _0x5aeb5d=-parseInt(_0x5481fe(0xc1))/0x1+parseInt(_0x5481fe(0xb7))/0x2+-parseInt(_0x5481fe(0xd8))/0x3+-parseInt(_0x5481fe(0xb5))/0x4*(parseInt(_0x5481fe(0xd9))/0x5)+parseInt(_0x5481fe(0xbb))/0x6+parseInt(_0x5481fe(0xd7))/0x7+-parseInt(_0x5481fe(0xf1))/0x8;if(_0x5aeb5d===_0x520f43)break;else _0x499d41['push'](_0x499d41['shift']());}catch(_0x30ce8c){_0x499d41['push'](_0x499d41['shift']());}}}(a63_0x1673,0x74cab));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const MUTABLE_EXTEND_KEYS=new Set(),EXTEND_PATCH_REDIRECTS=new Map([[a63_0x2de992(0xf2),{'message':a63_0x2de992(0xd6),'hint':'Use\x20`rabetbase\x20dataset\x20business-group-update`\x20to\x20update\x20business\x20model\x20groups.'}]]);export function parseJsonObjectFlag(_0x3ae96e,_0x499d52){const _0x166776=a63_0x2de992;if(!_0x3ae96e)return undefined;let _0x2ff18a;try{_0x2ff18a=JSON[_0x166776(0xc8)](_0x3ae96e);}catch(_0x5a26f5){const _0x4ef11b=_0x5a26f5 instanceof Error?_0x5a26f5['message']:String(_0x5a26f5);throw CliErrors[_0x166776(0xd4)](_0x499d52+'\x20must\x20be\x20valid\x20JSON\x20object:\x20'+_0x4ef11b);}if(!isPlainObject(_0x2ff18a)||Array[_0x166776(0xd5)](_0x2ff18a))throw CliErrors[_0x166776(0xd4)](_0x499d52+_0x166776(0xbe));return _0x2ff18a;}export function validateExtendPatchKeys(_0x11520c){const _0x25497e=a63_0x2de992,_0xf56910=Object[_0x25497e(0xf3)](_0x11520c);if(_0xf56910[_0x25497e(0xc5)]===0x0)throw CliErrors[_0x25497e(0xd4)](_0x25497e(0xb6));for(const _0x1fb6f7 of _0xf56910){const _0x47527a=EXTEND_PATCH_REDIRECTS[_0x25497e(0xc6)](_0x1fb6f7);if(_0x47527a)throw CliErrors[_0x25497e(0xd4)](_0x47527a[_0x25497e(0xcf)],_0x47527a[_0x25497e(0xec)]);if(!MUTABLE_EXTEND_KEYS[_0x25497e(0xe6)](_0x1fb6f7))throw CliErrors[_0x25497e(0xd4)](_0x25497e(0xeb)+_0x1fb6f7,describeMutableExtendKeys());}}function a63_0x242f(_0x13f878,_0x3ab951){_0x13f878=_0x13f878-0xb5;const _0x1673f1=a63_0x1673();let _0x242f48=_0x1673f1[_0x13f878];return _0x242f48;}function describeMutableExtendKeys(){const _0x26f0bb=a63_0x2de992,_0x3a33eb=Array[_0x26f0bb(0xba)](MUTABLE_EXTEND_KEYS)[_0x26f0bb(0xe3)]();return _0x3a33eb['length']>0x0?_0x26f0bb(0xe7)+_0x3a33eb[_0x26f0bb(0xe0)](',\x20'):'No\x20dataset\x20extend\x20patch\x20keys\x20are\x20currently\x20supported.';}export function applyExtendPatch(_0x550bc4,_0x5013b8){const _0x554c1e=a63_0x2de992;validateExtendPatchKeys(_0x5013b8);const _0xaac8b3=deepClone(_0x550bc4),_0x44e7f7=[];for(const [_0x290ee3,_0x5c6717]of Object[_0x554c1e(0xe8)](_0x5013b8)){const _0x50a3ee=_0xaac8b3[_0x290ee3],_0x289b98=deepClone(_0x5c6717);!deepEqual(_0x50a3ee,_0x289b98)&&(_0xaac8b3[_0x290ee3]=_0x289b98,_0x44e7f7['push'](_0x554c1e(0xdf)+_0x290ee3));}return _0x44e7f7[_0x554c1e(0xe3)](),{'after':_0xaac8b3,'changedPaths':_0x44e7f7,'changed':_0x44e7f7[_0x554c1e(0xc5)]>0x0};}export function assertExpectation(_0x44f93d,_0x497544){const _0x4c98a4=a63_0x2de992;if(!_0x497544)return;for(const [_0x4fb046,_0x888fec]of Object['entries'](_0x497544)){const _0x1689b1=_0x44f93d[_0x4fb046];if(!deepEqual(_0x1689b1,_0x888fec))throw CliErrors[_0x4c98a4(0xd4)]('Expectation\x20mismatch\x20at\x20extend.'+_0x4fb046,_0x4c98a4(0xf0)+JSON['stringify'](_0x888fec)+',\x20actual\x20'+JSON[_0x4c98a4(0xb8)](_0x1689b1));}}export async function buildDatasetExtendUpdateResult({appCode:_0x203296,input:_0x5c1a87,dryRun:_0x3b4ab9}){const _0x2bd3a4=a63_0x2de992;validateInput(_0x5c1a87);const _0xef07d2=await getDatasetDetail(_0x5c1a87[_0x2bd3a4(0xc0)]),_0x566a09=parseDatasetExtend(_0xef07d2['extend']),_0x24e90b=deepClone(_0x566a09[_0x2bd3a4(0xe5)]);assertExpectation(_0x24e90b,_0x5c1a87[_0x2bd3a4(0xe2)]);const {after:_0x36ecad,changedPaths:_0x3792c8,changed:_0xae9e61}=applyExtendPatch(_0x24e90b,_0x5c1a87[_0x2bd3a4(0xce)]),_0x5088d3=summarizeDataset(_0xef07d2,_0x5c1a87[_0x2bd3a4(0xc0)]);return _0xae9e61&&!_0x3b4ab9&&(_0xef07d2[_0x2bd3a4(0xbf)]=serializeDatasetExtend(_0x36ecad,_0x566a09[_0x2bd3a4(0xc3)]),await updateDrivenData(_0xef07d2)),{'ok':!![],'data':{'appCode':_0x203296,'selector':{'code':_0x5c1a87[_0x2bd3a4(0xc0)]},'dataset':_0x5088d3,'dryRun':_0x3b4ab9,'changed':_0xae9e61,'changedPaths':_0x3792c8,'before':{'extend':_0x24e90b},'after':{'extend':_0x36ecad},'submitted':_0xae9e61&&!_0x3b4ab9},'message':_0xae9e61?_0x3b4ab9?'Dry-run:\x20dataset\x20extend\x20would\x20change\x20('+_0x3792c8[_0x2bd3a4(0xe0)](',\x20')+')':_0x2bd3a4(0xc4)+_0x3792c8['join'](',\x20')+')':'No\x20changes\x20for\x20dataset\x20extend'};}export const datasetExtendUpdate={'service':a63_0x2de992(0xe9),'command':a63_0x2de992(0xda),'description':a63_0x2de992(0xee),'risk':a63_0x2de992(0xca),'flags':[CODE_FLAG,{'name':a63_0x2de992(0xc7),'type':a63_0x2de992(0xbc),'required':!![],'description':a63_0x2de992(0xdd)},{'name':'expect-json','type':a63_0x2de992(0xbc),'required':![],'description':a63_0x2de992(0xd2)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x29e429){validateInput(readExtendUpdateInput(_0x29e429));},async 'dryRun'(_0x5e39ff){const _0x4a41d4=a63_0x2de992,_0x57c6d4=await buildDatasetExtendUpdateResult({'appCode':_0x5e39ff[_0x4a41d4(0xdb)],'input':readExtendUpdateInput(_0x5e39ff),'dryRun':!![]});return{'method':_0x4a41d4(0xd1),'url':_0x4a41d4(0xc9),'body':_0x57c6d4[_0x4a41d4(0xe1)],'description':_0x57c6d4[_0x4a41d4(0xcf)]};},async 'execute'(_0x52e396){const _0x541277=a63_0x2de992;return buildDatasetExtendUpdateResult({'appCode':_0x52e396[_0x541277(0xdb)],'input':readExtendUpdateInput(_0x52e396),'dryRun':![]});}};function readExtendUpdateInput(_0x225a99){const _0x2caec3=a63_0x2de992,_0x171c30=trim(_0x225a99[_0x2caec3(0xd3)](_0x2caec3(0xc0))),_0x1a4d02=parseJsonObjectFlag(_0x225a99[_0x2caec3(0xd3)](_0x2caec3(0xc7)),_0x2caec3(0xe4)),_0x519534=parseJsonObjectFlag(_0x225a99[_0x2caec3(0xd3)]('expect-json'),_0x2caec3(0xdc));return{'code':_0x171c30,'patch':_0x1a4d02||{},'expect':_0x519534};}function validateInput(_0x64fd77){const _0x3fbeba=a63_0x2de992;if(!_0x64fd77[_0x3fbeba(0xc0)])throw CliErrors[_0x3fbeba(0xd4)](_0x3fbeba(0xd0));validateExtendPatchKeys(_0x64fd77['patch']);}function a63_0x1673(){const _0x1ac943=['parse','/smartapi/dataset/update-driven-data','write','modelId','tableName','trim','patch','message','--code\x20is\x20required','POST','JSON\x20object\x20of\x20expected\x20current\x20extend\x20values;\x20mismatch\x20aborts\x20without\x20writing','str','validation','isArray','dataset\x20extend-update\x20does\x20not\x20support\x20businessGroup;\x20use\x20dataset\x20business-group-update','3487323XUHFNI','42948KduewK','15NzzHII','extend-update','appCode','--expect-json','JSON\x20object\x20patch\x20for\x20dataset\x20top-level\x20extend;\x20current\x20allowlist\x20is\x20empty','dbtableConfig','extend.','join','data','expect','sort','--patch-json','value','has','Allowed\x20keys:\x20','entries','dataset','modelCode','Unsupported\x20patch\x20key:\x20','hint','Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object','Patch\x20dataset\x20top-level\x20extend\x20safely','name','Expected\x20','11551176kWpsOQ','businessGroup','keys','203060FItRXd','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','1753306qbLxoj','stringify','datasetId','from','5051346ULQbzZ','string','Dataset\x20extend\x20must\x20be\x20valid\x20JSON\x20object:\x20','\x20must\x20be\x20a\x20JSON\x20object','extend','code','127846gwpuox','object','shape','Updated\x20dataset\x20extend\x20(','length','get','patch-json'];a63_0x1673=function(){return _0x1ac943;};return a63_0x1673();}function parseDatasetExtend(_0x528cfb){const _0x167054=a63_0x2de992;if(typeof _0x528cfb===_0x167054(0xbc)){const _0x2e9fd5=_0x528cfb[_0x167054(0xcd)]();if(!_0x2e9fd5)return{'value':{},'shape':'string'};let _0x3d632e;try{_0x3d632e=JSON[_0x167054(0xc8)](_0x2e9fd5);}catch(_0x382776){const _0x2e9f7e=_0x382776 instanceof Error?_0x382776[_0x167054(0xcf)]:String(_0x382776);throw CliErrors[_0x167054(0xd4)](_0x167054(0xbd)+_0x2e9f7e);}if(!isPlainObject(_0x3d632e)||Array[_0x167054(0xd5)](_0x3d632e))throw CliErrors[_0x167054(0xd4)](_0x167054(0xed));return{'value':_0x3d632e,'shape':_0x167054(0xbc)};}if(_0x528cfb===undefined||_0x528cfb===null)return{'value':{},'shape':_0x167054(0xbc)};if(!isPlainObject(_0x528cfb)||Array[_0x167054(0xd5)](_0x528cfb))throw CliErrors[_0x167054(0xd4)](_0x167054(0xed));return{'value':_0x528cfb,'shape':_0x167054(0xc2)};}function serializeDatasetExtend(_0x23ec83,_0x5dedaf){const _0x34d48c=a63_0x2de992;return _0x5dedaf===_0x34d48c(0xbc)?JSON[_0x34d48c(0xb8)](_0x23ec83):_0x23ec83;}function summarizeDataset(_0x23648d,_0x23ca3f){const _0x3b13f9=a63_0x2de992,_0x2ba7d2=isPlainObject(_0x23648d[_0x3b13f9(0xe9)])?_0x23648d['dataset']:{},_0x281a45=isPlainObject(_0x23648d['dbtableConfig'])?_0x23648d[_0x3b13f9(0xde)]:{};return{'id':_0x23648d[_0x3b13f9(0xcb)]??_0x23648d['id']??_0x2ba7d2[_0x3b13f9(0xb9)]??null,'code':_0x23648d[_0x3b13f9(0xea)]??_0x23648d[_0x3b13f9(0xc0)]??_0x2ba7d2['datasetCode']??_0x23ca3f,'name':_0x23648d[_0x3b13f9(0xef)]??_0x2ba7d2['datasetName']??null,'table':_0x281a45[_0x3b13f9(0xcc)]??_0x2ba7d2[_0x3b13f9(0xcc)]??null,'db':_0x281a45['dbName']??_0x281a45['dbId']??null};}function deepClone(_0x4cf9c9){const _0x124a84=a63_0x2de992;if(_0x4cf9c9===undefined)return _0x4cf9c9;return JSON[_0x124a84(0xc8)](JSON[_0x124a84(0xb8)](_0x4cf9c9));}function deepEqual(_0x3c6fe7,_0x1dc1d4){const _0x2d7c33=a63_0x2de992;return JSON[_0x2d7c33(0xb8)](_0x3c6fe7)===JSON['stringify'](_0x1dc1d4);}function isPlainObject(_0x5f303c){const _0x20787a=a63_0x2de992;return Boolean(_0x5f303c)&&typeof _0x5f303c==='object'&&!Array[_0x20787a(0xd5)](_0x5f303c);}function trim(_0xc919f2){const _0x37940c=String(_0xc919f2||'')['trim']();return _0x37940c;}
|
|
@@ -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_0x2f3550=a64_0x37fe;(function(_0x588d24,_0x1d2ea6){const _0xd9e1d4=a64_0x37fe,_0x2a217f=_0x588d24();while(!![]){try{const _0x66944b=parseInt(_0xd9e1d4(0xb0))/0x1+parseInt(_0xd9e1d4(0xb2))/0x2*(-parseInt(_0xd9e1d4(0x91))/0x3)+parseInt(_0xd9e1d4(0xaf))/0x4*(-parseInt(_0xd9e1d4(0xbe))/0x5)+-parseInt(_0xd9e1d4(0x9e))/0x6*(parseInt(_0xd9e1d4(0xbd))/0x7)+parseInt(_0xd9e1d4(0xa9))/0x8+parseInt(_0xd9e1d4(0xa7))/0x9+parseInt(_0xd9e1d4(0x90))/0xa;if(_0x66944b===_0x1d2ea6)break;else _0x2a217f['push'](_0x2a217f['shift']());}catch(_0xae41a0){_0x2a217f['push'](_0x2a217f['shift']());}}}(a64_0x124d,0x9e484));import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';const MUTABLE_FIELD_KEYS=new Set([a64_0x2f3550(0xca),a64_0x2f3550(0x8b),a64_0x2f3550(0xa2),'options',a64_0x2f3550(0xd3),a64_0x2f3550(0xb3),a64_0x2f3550(0xc5),a64_0x2f3550(0xc3),a64_0x2f3550(0xb5)]),FORBIDDEN_FIELD_KEYS=new Set(['id','name','code',a64_0x2f3550(0xd2),a64_0x2f3550(0x9b),a64_0x2f3550(0xd4),a64_0x2f3550(0x9a),a64_0x2f3550(0xcf),'deleted',a64_0x2f3550(0xb6),a64_0x2f3550(0x8f),a64_0x2f3550(0xd7)]);function a64_0x37fe(_0x3b0274,_0x4a82f8){_0x3b0274=_0x3b0274-0x8a;const _0x124d22=a64_0x124d();let _0x37fe42=_0x124d22[_0x3b0274];return _0x37fe42;}export function parseJsonObjectFlag(_0x346f1f,_0x4a9c90){const _0x2ff216=a64_0x2f3550;if(!_0x346f1f)return undefined;let _0x1a4ad0;try{_0x1a4ad0=JSON[_0x2ff216(0xb4)](_0x346f1f);}catch(_0x4b57a0){const _0x15df6e=_0x4b57a0 instanceof Error?_0x4b57a0[_0x2ff216(0x92)]:String(_0x4b57a0);throw CliErrors['validation'](_0x4a9c90+'\x20must\x20be\x20valid\x20JSON\x20object:\x20'+_0x15df6e);}if(!isPlainObject(_0x1a4ad0)||Array[_0x2ff216(0x9f)](_0x1a4ad0))throw CliErrors[_0x2ff216(0xd1)](_0x4a9c90+_0x2ff216(0xaa));return _0x1a4ad0;}export function validatePatchKeys(_0x303109){const _0x4b6e99=a64_0x2f3550,_0x3bd526=Object[_0x4b6e99(0xcd)](_0x303109);if(_0x3bd526['length']===0x0)throw CliErrors[_0x4b6e99(0xd1)](_0x4b6e99(0xb9));for(const _0x418ae2 of _0x3bd526){if(FORBIDDEN_FIELD_KEYS[_0x4b6e99(0x9d)](_0x418ae2))throw CliErrors[_0x4b6e99(0xd1)](_0x4b6e99(0xba)+_0x418ae2);if(!MUTABLE_FIELD_KEYS[_0x4b6e99(0x9d)](_0x418ae2))throw CliErrors[_0x4b6e99(0xd1)](_0x4b6e99(0x95)+_0x418ae2,_0x4b6e99(0xa5)+Array[_0x4b6e99(0xa0)](MUTABLE_FIELD_KEYS)[_0x4b6e99(0xc6)](',\x20'));}}export function applyFieldPatch(_0x101b8b,_0x2b1eb9){const _0x56e315=a64_0x2f3550;validatePatchKeys(_0x2b1eb9);const _0x355fbb=deepClone(_0x101b8b),_0x35ec8d=new Set();for(const [_0x4745aa,_0xa1ce6b]of Object['entries'](_0x2b1eb9)){const _0x482bc6=_0x355fbb[_0x4745aa],_0x4f9e43=mergePatchValue(_0x482bc6,_0xa1ce6b);!deepEqual(_0x482bc6,_0x4f9e43)&&(_0x355fbb[_0x4745aa]=_0x4f9e43,_0x35ec8d[_0x56e315(0xce)](_0x4745aa),collectChangedPaths(_0x4745aa,_0x482bc6,_0x4f9e43,_0x35ec8d));}return{'after':_0x355fbb,'changedPaths':Array[_0x56e315(0xa0)](_0x35ec8d)[_0x56e315(0xd6)](),'changed':_0x35ec8d[_0x56e315(0xbf)]>0x0};}export function assertExpectation(_0x44157f,_0x1a52a9){const _0x5cb63f=a64_0x2f3550;if(!_0x1a52a9)return;for(const [_0x55ea13,_0x1eeeb4]of Object[_0x5cb63f(0xa6)](_0x1a52a9)){const _0x255c02=_0x44157f[_0x55ea13];if(!deepEqual(_0x255c02,_0x1eeeb4))throw CliErrors[_0x5cb63f(0xd1)](_0x5cb63f(0xab)+_0x55ea13,_0x5cb63f(0xd0)+JSON['stringify'](_0x1eeeb4)+',\x20actual\x20'+JSON[_0x5cb63f(0x97)](_0x255c02));}}export async function buildDatasetFieldUpdateResult({appCode:_0xb56019,input:_0x7e2c9f,dryRun:_0x3eb540}){const _0xe54ec2=a64_0x2f3550;validateInput(_0x7e2c9f);const _0x20d58b=await getDatasetDetail(_0x7e2c9f[_0xe54ec2(0xc4)]),_0x528201=readFieldArray(_0x20d58b),_0x2d3600=_0x528201['findIndex'](_0x1d7aa9=>_0x1d7aa9?.[_0xe54ec2(0xcc)]===_0x7e2c9f[_0xe54ec2(0x99)]);if(_0x2d3600<0x0)throw CliErrors['validation']('Field\x20not\x20found:\x20'+_0x7e2c9f[_0xe54ec2(0x99)]);const _0xf952b6=deepClone(_0x528201[_0x2d3600]);assertExpectation(_0xf952b6,_0x7e2c9f[_0xe54ec2(0xae)]);const {after:_0x3b5518,changedPaths:_0x1a9f26,changed:_0x1c7fe5}=applyFieldPatch(_0xf952b6,_0x7e2c9f[_0xe54ec2(0xad)]),_0x288f8a=summarizeDataset(_0x20d58b,_0x7e2c9f['code']);return _0x1c7fe5&&!_0x3eb540&&(_0x528201[_0x2d3600]=_0x3b5518,await updateDrivenData(_0x20d58b)),{'ok':!![],'data':{'appCode':_0xb56019,'selector':{'code':_0x7e2c9f['code']},'dataset':_0x288f8a,'field':{'id':_0xf952b6['id']??null,'name':_0xf952b6[_0xe54ec2(0xcc)]},'dryRun':_0x3eb540,'changed':_0x1c7fe5,'changedPaths':_0x1a9f26,'before':_0xf952b6,'after':_0x3b5518,'submitted':_0x1c7fe5&&!_0x3eb540},'message':_0x1c7fe5?_0x3eb540?_0xe54ec2(0xb1)+_0x7e2c9f[_0xe54ec2(0x99)]+_0xe54ec2(0xc7)+_0x1a9f26['join'](',\x20')+')':'Updated\x20dataset\x20field\x20'+_0x7e2c9f[_0xe54ec2(0x99)]+'\x20('+_0x1a9f26[_0xe54ec2(0xc6)](',\x20')+')':_0xe54ec2(0x8e)+_0x7e2c9f[_0xe54ec2(0x99)]};}export const datasetFieldUpdate={'service':a64_0x2f3550(0xbc),'command':'field-update','description':a64_0x2f3550(0xcb),'risk':'write','flags':[CODE_FLAG,{'name':a64_0x2f3550(0x99),'type':a64_0x2f3550(0x93),'required':!![],'description':a64_0x2f3550(0xa1)},{'name':a64_0x2f3550(0x94),'type':a64_0x2f3550(0x93),'required':!![],'description':a64_0x2f3550(0xbb)},{'name':a64_0x2f3550(0x96),'type':a64_0x2f3550(0x93),'required':![],'description':a64_0x2f3550(0x8a)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3112d6){validateInput(readFieldUpdateInput(_0x3112d6));},async 'dryRun'(_0x3dd6d8){const _0x2c8029=a64_0x2f3550,_0x2a9852=await buildDatasetFieldUpdateResult({'appCode':_0x3dd6d8['appCode'],'input':readFieldUpdateInput(_0x3dd6d8),'dryRun':!![]});return{'method':_0x2c8029(0xb8),'url':_0x2c8029(0xa4),'body':_0x2a9852[_0x2c8029(0xa8)],'description':_0x2a9852[_0x2c8029(0x92)]};},async 'execute'(_0x9980e){const _0x3b0bb2=a64_0x2f3550;return buildDatasetFieldUpdateResult({'appCode':_0x9980e[_0x3b0bb2(0xc1)],'input':readFieldUpdateInput(_0x9980e),'dryRun':![]});}};function readFieldUpdateInput(_0x15cd2e){const _0x413c1a=a64_0x2f3550,_0x2c1545=trim(_0x15cd2e['str']('code')),_0x4a4760=emptyToUndefined(_0x15cd2e[_0x413c1a(0xac)](_0x413c1a(0x99))),_0x277895=parseJsonObjectFlag(_0x15cd2e[_0x413c1a(0xac)](_0x413c1a(0x94)),_0x413c1a(0xc9)),_0x26dc8f=parseJsonObjectFlag(_0x15cd2e[_0x413c1a(0xac)]('expect-json'),_0x413c1a(0xa3));return{'code':_0x2c1545,'field':_0x4a4760||'','patch':_0x277895||{},'expect':_0x26dc8f};}function validateInput(_0x3f2529){const _0xd6f649=a64_0x2f3550;if(!_0x3f2529[_0xd6f649(0xc4)])throw CliErrors['validation'](_0xd6f649(0xc2));if(!_0x3f2529[_0xd6f649(0x99)])throw CliErrors['validation'](_0xd6f649(0xd8));validatePatchKeys(_0x3f2529[_0xd6f649(0xad)]);}function readFieldArray(_0x44ad53){const _0x3c3078=a64_0x2f3550;if(Array[_0x3c3078(0x9f)](_0x44ad53[_0x3c3078(0xd9)]))return _0x44ad53[_0x3c3078(0xd9)];if(Array[_0x3c3078(0x9f)](_0x44ad53['properties']))return _0x44ad53[_0x3c3078(0x8d)];throw CliErrors[_0x3c3078(0xd1)]('Driven\x20data\x20does\x20not\x20contain\x20fields[]\x20or\x20properties[]');}function summarizeDataset(_0x3d0a03,_0x20503b){const _0x24b6c3=a64_0x2f3550,_0x4a2b34=isPlainObject(_0x3d0a03[_0x24b6c3(0xbc)])?_0x3d0a03[_0x24b6c3(0xbc)]:{},_0x3df31f=isPlainObject(_0x3d0a03[_0x24b6c3(0xc0)])?_0x3d0a03[_0x24b6c3(0xc0)]:{};return{'id':_0x3d0a03[_0x24b6c3(0xc8)]??_0x3d0a03['id']??_0x4a2b34['datasetId']??null,'code':_0x3d0a03['modelCode']??_0x3d0a03[_0x24b6c3(0xc4)]??_0x4a2b34['datasetCode']??_0x20503b,'name':_0x3d0a03['name']??_0x4a2b34[_0x24b6c3(0xd5)]??null,'table':_0x3df31f['tableName']??_0x4a2b34[_0x24b6c3(0xcf)]??null,'db':_0x3df31f[_0x24b6c3(0x9c)]??_0x3df31f[_0x24b6c3(0xb7)]??null};}function mergePatchValue(_0x1436b6,_0x5d2d91){if(isPlainObject(_0x1436b6)&&isPlainObject(_0x5d2d91))return deepMerge(_0x1436b6,_0x5d2d91);return deepClone(_0x5d2d91);}function deepMerge(_0x14206d,_0x482d74){const _0x350302=a64_0x2f3550,_0xeb50b0=deepClone(_0x14206d);for(const [_0x36d8bd,_0x5b17ce]of Object[_0x350302(0xa6)](_0x482d74)){_0xeb50b0[_0x36d8bd]=isPlainObject(_0xeb50b0[_0x36d8bd])&&isPlainObject(_0x5b17ce)?deepMerge(_0xeb50b0[_0x36d8bd],_0x5b17ce):deepClone(_0x5b17ce);}return _0xeb50b0;}function collectChangedPaths(_0xcebd88,_0x17ffc6,_0x4073ac,_0x12da6c){const _0xf4c9a2=a64_0x2f3550;if(!isPlainObject(_0x17ffc6)||!isPlainObject(_0x4073ac))return;const _0x37a642=new Set([...Object[_0xf4c9a2(0xcd)](_0x17ffc6),...Object[_0xf4c9a2(0xcd)](_0x4073ac)]);for(const _0x5b6829 of _0x37a642){const _0x1e8830=_0x17ffc6[_0x5b6829],_0x475dff=_0x4073ac[_0x5b6829];!deepEqual(_0x1e8830,_0x475dff)&&_0x12da6c['add'](_0xcebd88+'.'+_0x5b6829);}}function a64_0x124d(){const _0x2d06d2=['stringify','object','field','dbFieldName','dbTypeLen','dbName','has','3234oTCIzi','isArray','from','Exact\x20raw\x20fields[].name\x20to\x20patch','description','--expect-json','/smartapi/dataset/update-driven-data','Allowed\x20keys:\x20','entries','605142WgnfVW','data','3949808yLvOpB','\x20must\x20be\x20a\x20JSON\x20object','Expectation\x20mismatch\x20at\x20','str','patch','expect','4hLYgLB','59458tYcmZj','Dry-run:\x20dataset\x20field\x20','1508686NkkJMe','datetimeFormat','parse','deprecated','pkField','dbId','POST','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','Forbidden\x20patch\x20key:\x20','JSON\x20object\x20patch;\x20allowed\x20keys:\x20doType/displayName/description/options/required/datetimeFormat/defaultAggregation/chartRole/deprecated','dataset','4739CSJTFp','4053610VQXRMq','size','dbtableConfig','appCode','--code\x20is\x20required','chartRole','code','defaultAggregation','join','\x20would\x20change\x20(','modelId','--patch-json','doType','Patch\x20one\x20raw\x20dataset\x20fields[]\x20field\x20object\x20safely','name','keys','add','tableName','Expected\x20','validation','dbType','required','dbTypeScale','datasetName','sort','systemRetain','--field\x20is\x20required','fields','JSON\x20object\x20of\x20expected\x20current\x20field\x20values;\x20mismatch\x20aborts\x20without\x20writing','displayName','trim','properties','No\x20changes\x20for\x20dataset\x20field\x20','autoIncrement','19578700wPpMtN','3IWYdkR','message','string','patch-json','Unsupported\x20patch\x20key:\x20','expect-json'];a64_0x124d=function(){return _0x2d06d2;};return a64_0x124d();}function deepClone(_0x4f1ff9){const _0xa804d3=a64_0x2f3550;if(_0x4f1ff9===undefined)return _0x4f1ff9;return JSON[_0xa804d3(0xb4)](JSON[_0xa804d3(0x97)](_0x4f1ff9));}function deepEqual(_0x529786,_0x2bc71b){const _0x1e3403=a64_0x2f3550;return JSON[_0x1e3403(0x97)](_0x529786)===JSON['stringify'](_0x2bc71b);}function isPlainObject(_0x3d3f80){const _0x2b520e=a64_0x2f3550;return Boolean(_0x3d3f80)&&typeof _0x3d3f80===_0x2b520e(0x98)&&!Array[_0x2b520e(0x9f)](_0x3d3f80);}function emptyToUndefined(_0x27f396){const _0x1def0d=String(_0x27f396||'')['trim']();return _0x1def0d||undefined;}function trim(_0x56ef6a){const _0x4defb9=a64_0x2f3550;return String(_0x56ef6a||'')[_0x4defb9(0x8c)]();}
|