@lovrabet/rabetbase-cli 2.3.11 → 2.3.12-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/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.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 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.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/mutations.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/notification/config-list.js +1 -1
- package/lib/commands/notification/index.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/task/index.js +1 -1
- package/lib/commands/task/status.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-index-auditor.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/error-output.js +1 -1
- package/lib/framework/explicit-yes.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
|
-
function
|
|
1
|
+
function a52_0x1594(){const _0x577292=['3818691qnownO','860276zkvQPI','24frPnjH','3042456zelDey','3820397zFjTEr','4375368RBEeeA','8WcvMEI','1749565zLSzQv','23714ftLhKP'];a52_0x1594=function(){return _0x577292;};return a52_0x1594();}function a52_0x5da6(_0x20b19a,_0x3b026e){_0x20b19a=_0x20b19a-0x184;const _0x1594e8=a52_0x1594();let _0x5da67d=_0x1594e8[_0x20b19a];return _0x5da67d;}(function(_0x280c66,_0x295b77){const _0x45167b=a52_0x5da6,_0x327f10=_0x280c66();while(!![]){try{const _0x55b37d=-parseInt(_0x45167b(0x189))/0x1*(parseInt(_0x45167b(0x18c))/0x2)+parseInt(_0x45167b(0x184))/0x3+-parseInt(_0x45167b(0x18b))/0x4+parseInt(_0x45167b(0x188))/0x5+parseInt(_0x45167b(0x186))/0x6+parseInt(_0x45167b(0x185))/0x7*(-parseInt(_0x45167b(0x187))/0x8)+-parseInt(_0x45167b(0x18a))/0x9;if(_0x55b37d===_0x295b77)break;else _0x327f10['push'](_0x327f10['shift']());}catch(_0x57367d){_0x327f10['push'](_0x327f10['shift']());}}}(a52_0x1594,0x983e2));import{configListDefinition}from'../../commands/config/list.js';import{configGetDefinition}from'../../commands/config/get.js';import{configSetDefinition}from'../../commands/config/set.js';export const configDefinitions=[configListDefinition,configGetDefinition,configSetDefinition];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a53_0x30b2(){const _0x112d41=['24BNFqNs','72370QgjnxV','read','33639zXQqQk','409125FZqAhg','173607Gapofe','171XBNtHE','603992xiCykD','4ZdwXas','bool','List\x20all\x20config\x20values','boolean','1569536Panswv','global','3364460BQHPUC','10JDSffg'];a53_0x30b2=function(){return _0x112d41;};return a53_0x30b2();}const a53_0x29140d=a53_0x1c20;(function(_0x2d6bb2,_0x537910){const _0x22f726=a53_0x1c20,_0x28c586=_0x2d6bb2();while(!![]){try{const _0x11e2cf=-parseInt(_0x22f726(0xcc))/0x1*(-parseInt(_0x22f726(0xc1))/0x2)+parseInt(_0x22f726(0xcd))/0x3+parseInt(_0x22f726(0xd0))/0x4*(-parseInt(_0x22f726(0xc8))/0x5)+-parseInt(_0x22f726(0xc9))/0x6*(parseInt(_0x22f726(0xce))/0x7)+parseInt(_0x22f726(0xc5))/0x8+parseInt(_0x22f726(0xcf))/0x9*(-parseInt(_0x22f726(0xca))/0xa)+parseInt(_0x22f726(0xc7))/0xb;if(_0x11e2cf===_0x537910)break;else _0x28c586['push'](_0x28c586['shift']());}catch(_0x4a8b94){_0x28c586['push'](_0x28c586['shift']());}}}(a53_0x30b2,0x28c5a));function a53_0x1c20(_0x22db6c,_0x1c999d){_0x22db6c=_0x22db6c-0xc1;const _0x30b227=a53_0x30b2();let _0x1c20ee=_0x30b227[_0x22db6c];return _0x1c20ee;}import{readScopedConfig}from'../../commands/config/shared.js';import{readConfig}from'../../utils/config.js';async function execute(_0x2ef20c){const _0x3d34e9=a53_0x1c20,_0x3447bb=_0x2ef20c[_0x3d34e9(0xc2)](_0x3d34e9(0xc6))?readScopedConfig(_0x3d34e9(0xc6)):readConfig();return{'ok':!![],'data':_0x3447bb};}export const configListDefinition={'service':'config','command':'list','description':a53_0x29140d(0xc3),'risk':a53_0x29140d(0xcb),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a53_0x29140d(0xc6),'type':a53_0x29140d(0xc4),'description':'Show\x20global\x20config\x20only\x20(~/.rabetbase.json)','default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a54_0x1cff7c=a54_0x33e6;(function(_0x2a8b47,_0x504c42){const _0x65df40=a54_0x33e6,_0x4101bd=_0x2a8b47();while(!![]){try{const _0x184e0d=parseInt(_0x65df40(0x1a7))/0x1*(parseInt(_0x65df40(0x18f))/0x2)+-parseInt(_0x65df40(0x189))/0x3+-parseInt(_0x65df40(0x196))/0x4*(-parseInt(_0x65df40(0x1ab))/0x5)+-parseInt(_0x65df40(0x181))/0x6*(parseInt(_0x65df40(0x18a))/0x7)+-parseInt(_0x65df40(0x18c))/0x8*(parseInt(_0x65df40(0x17d))/0x9)+parseInt(_0x65df40(0x18d))/0xa+-parseInt(_0x65df40(0x194))/0xb*(-parseInt(_0x65df40(0x1a4))/0xc);if(_0x184e0d===_0x504c42)break;else _0x4101bd['push'](_0x4101bd['shift']());}catch(_0x2a3cd7){_0x4101bd['push'](_0x4101bd['shift']());}}}(a54_0x4494,0x49108));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 a54_0x33e6(_0x2be770,_0x3a3781){_0x2be770=_0x2be770-0x17c;const _0x4494d4=a54_0x4494();let _0x33e651=_0x4494d4[_0x2be770];return _0x33e651;}function a54_0x4494(){const _0xc8d4be=['app','\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>','78fgWBab','Global','bool','apps','length','`,\x20`','Write\x20to\x20global\x20config\x20(~/.rabetbase.json)','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','1109103wAYcTw','268478lhoFPO','Use\x20`','40552hLQjbC','2682370jZdHfV','\x20(stored\x20as\x20apps\x20+\x20defaultApp)','1684lSmHri','Usage:\x20','Invalid\x20value\x20for\x20\x22','\x20set\x20to:\x20','riskLevel','9361682wZVlNS','\x20app\x20add\x20<name>\x20--appcode\x20','4foeXeW','Project','Config\x20value','env','\x22.\x20Allowed:\x20','keys','locale','string','Settable\x20top-level\x20keys:\x20','global','write','key','config','validation','12dACGej','join','Set\x20a\x20config\x20value','9GMigDy','Invalid\x20value\x20for\x20env.\x20Allowed:\x20production,\x20daily.','object','\x20appcode\x20set\x20to:\x20','1546775yueBfs','Cannot\x20set\x20top-level\x20\x22appcode\x22\x20when\x20multi-app\x20config\x20already\x20exists.','Missing\x20key.','Missing\x20value.','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','477fCpIUp','Top-level\x20key\x20\x22'];a54_0x4494=function(){return _0xc8d4be;};return a54_0x4494();}import{normalizeEnv,isProduction,isDaily}from'../../constant/env.js';async function execute(_0x239d7d){const _0x4aa00b=a54_0x33e6,_0x1d2f83=_0x239d7d['str']('key'),_0x1ee510=_0x239d7d['str']('value');if(!_0x1d2f83)throw CliErrors['validation'](_0x4aa00b(0x1ad),_0x4aa00b(0x190)+CLI_BIN_NAME+'\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>');if(_0x1ee510===undefined||_0x1ee510==='')throw CliErrors['validation'](_0x4aa00b(0x1ae),_0x4aa00b(0x190)+CLI_BIN_NAME+_0x4aa00b(0x180));if(_0x1ee510[_0x4aa00b(0x185)]>0x1f4)throw CliErrors['validation']('Config\x20value\x20is\x20invalid\x20or\x20too\x20long.');if(!isTopLevelConfigKey(_0x1d2f83))throw CliErrors[_0x4aa00b(0x1a3)](_0x4aa00b(0x17e)+_0x1d2f83+'\x22\x20is\x20not\x20settable.',_0x4aa00b(0x19e)+getTopLevelConfigKeySummary());if(_0x1d2f83===_0x4aa00b(0x193))throw CliErrors[_0x4aa00b(0x1a3)](_0x4aa00b(0x188));if(CONFIG_ENUM_VALUES[_0x1d2f83]&&!CONFIG_ENUM_VALUES[_0x1d2f83]['includes'](_0x1ee510))throw CliErrors[_0x4aa00b(0x1a3)](_0x4aa00b(0x191)+_0x1d2f83+_0x4aa00b(0x19a)+CONFIG_ENUM_VALUES[_0x1d2f83][_0x4aa00b(0x1a5)](',\x20'));if(_0x1d2f83===_0x4aa00b(0x19c)&&!normalizeLocale(_0x1ee510))throw CliErrors[_0x4aa00b(0x1a3)]('Invalid\x20locale\x20value.',_0x4aa00b(0x17c));const _0xd01cf6={'global':_0x239d7d[_0x4aa00b(0x183)](_0x4aa00b(0x19f))},_0xa9b71f=resolveWriteScope(_0xd01cf6),_0x4384d9=readScopedConfig(_0xa9b71f);let _0x544bb2=_0x1d2f83,_0x2538bf=_0x1ee510;_0x1d2f83===_0x4aa00b(0x17f)&&(_0x544bb2='appcode',delete _0x4384d9[_0x4aa00b(0x17f)]);_0x1d2f83===_0x4aa00b(0x19c)&&(_0x2538bf=normalizeLocale(_0x1ee510));if(_0x1d2f83===_0x4aa00b(0x199)){_0x2538bf=normalizeEnv(_0x1ee510);if(!isProduction(_0x2538bf)&&!isDaily(_0x2538bf))throw CliErrors[_0x4aa00b(0x1a3)](_0x4aa00b(0x1a8),'Legacy\x20alias\x20\x22online\x22\x20is\x20accepted\x20and\x20stored\x20as\x20production.');}if(_0x1d2f83==='appcode'){const _0x24462c=_0x4384d9[_0x4aa00b(0x184)]&&typeof _0x4384d9[_0x4aa00b(0x184)]===_0x4aa00b(0x1a9)?Object[_0x4aa00b(0x19b)](_0x4384d9[_0x4aa00b(0x184)]):[];if(_0x24462c[_0x4aa00b(0x185)]>0x0)throw CliErrors[_0x4aa00b(0x1a3)](_0x4aa00b(0x1ac),_0x4aa00b(0x18b)+CLI_BIN_NAME+_0x4aa00b(0x195)+_0x2538bf+_0x4aa00b(0x186)+CLI_BIN_NAME+'\x20workspace\x20use\x20--app\x20<name>`,\x20or\x20pass\x20`--appcode`\x20on\x20the\x20command.');const _0x4811cc=buildCanonicalProjectConfig({..._0x4384d9},{'appCodes':[_0x2538bf],'env':typeof _0x4384d9[_0x4aa00b(0x199)]===_0x4aa00b(0x19d)?_0x4384d9[_0x4aa00b(0x199)]:undefined});writeScopedConfig(_0x4811cc,_0xa9b71f);const _0x3f0caf=_0xa9b71f===_0x4aa00b(0x19f)?'Global':_0x4aa00b(0x197);return{'ok':!![],'message':'✓\x20'+_0x3f0caf+_0x4aa00b(0x1aa)+_0x2538bf+_0x4aa00b(0x18e)};}_0x4384d9[_0x544bb2]=_0x2538bf,writeScopedConfig(_0x4384d9,_0xa9b71f);const _0x5c9e93=_0xa9b71f===_0x4aa00b(0x19f)?_0x4aa00b(0x182):_0x4aa00b(0x197);return{'ok':!![],'message':'✓\x20'+_0x5c9e93+'\x20'+_0x544bb2+_0x4aa00b(0x192)+_0x2538bf};}export const configSetDefinition={'service':a54_0x1cff7c(0x1a2),'command':'set','description':a54_0x1cff7c(0x1a6),'risk':a54_0x1cff7c(0x1a0),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a54_0x1cff7c(0x1a1),'type':a54_0x1cff7c(0x19d),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':'value','type':a54_0x1cff7c(0x19d),'description':a54_0x1cff7c(0x198),'required':!![]},{'name':a54_0x1cff7c(0x19f),'type':'boolean','description':a54_0x1cff7c(0x187),'default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x164b19,_0x556bc7){var _0x2a6d47=a55_0x3033,_0x443f75=_0x164b19();while(!![]){try{var _0x29e546=parseInt(_0x2a6d47(0x19c))/0x1+parseInt(_0x2a6d47(0x19f))/0x2+parseInt(_0x2a6d47(0x198))/0x3*(-parseInt(_0x2a6d47(0x1a1))/0x4)+-parseInt(_0x2a6d47(0x1a6))/0x5*(-parseInt(_0x2a6d47(0x1a0))/0x6)+parseInt(_0x2a6d47(0x19b))/0x7*(-parseInt(_0x2a6d47(0x1a7))/0x8)+parseInt(_0x2a6d47(0x1a4))/0x9+parseInt(_0x2a6d47(0x19e))/0xa;if(_0x29e546===_0x556bc7)break;else _0x443f75['push'](_0x443f75['shift']());}catch(_0x30d7af){_0x443f75['push'](_0x443f75['shift']());}}}(a55_0x4f26,0x42cb2));import{CLI_BIN_NAME}from'../../constant/cli.js';import{isInProject,resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';import{CliErrors}from'../../errors.js';import{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale}from'../../config/schema.js';export{CLI_BIN_NAME};export{normalizeLocale};export{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey};export function resolveWriteScope(_0x2c22df){var _0x50a12d=a55_0x3033;if(_0x2c22df[_0x50a12d(0x199)])return _0x50a12d(0x199);if(!isInProject())throw CliErrors[_0x50a12d(0x1a3)](_0x50a12d(0x19d),_0x50a12d(0x1a2)+CLI_BIN_NAME+_0x50a12d(0x1a5));return _0x50a12d(0x19a);}function a55_0x4f26(){var _0x2739ca=['6TQIyZN','1261716ztMZAh','Add\x20--global\x20to\x20write\x20to\x20~/.rabetbase.json,\x20or\x20run\x20`','validation','121599vswhyW','\x20init`\x20first.','116495skBAgh','8hZLYwe','3IXWLyC','global','project','3470411OhpHUB','121229vLpxQV','Not\x20inside\x20a\x20project\x20(no\x20.rabetbase.json\x20found).','8411690wPmwpy','171160RBKqal'];a55_0x4f26=function(){return _0x2739ca;};return a55_0x4f26();}export function readScopedConfig(_0x20d560){return readConfigFile(resolveWriteConfigPath(_0x20d560));}function a55_0x3033(_0x2ce6f9,_0x1ada36){_0x2ce6f9=_0x2ce6f9-0x198;var _0x4f26bb=a55_0x4f26();var _0x3033d5=_0x4f26bb[_0x2ce6f9];return _0x3033d5;}export function writeScopedConfig(_0x5a71c5,_0x4589a4){writeConfigFile(resolveWriteConfigPath(_0x4589a4),_0x5a71c5);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a56_0x2a60(_0x50abd5,_0x151a42){_0x50abd5=_0x50abd5-0x1cd;const _0x5bc987=a56_0x5bc9();let _0x2a60a9=_0x5bc987[_0x50abd5];return _0x2a60a9;}const a56_0x2066cf=a56_0x2a60;function a56_0x5bc9(){const _0x3a8c84=['3591lfHbuE','\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}]','20mWYOMR','3587470UIrSAZ','Filter\x20dataset\x20records\x20with\x20query\x20conditions','526092TYdHyY','206912StsDiL','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','8502290WTSGLc','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','2968CQOIob','filter','1996435WdBrrt','21859JxHYmp','join','6DCvcRD'];a56_0x5bc9=function(){return _0x3a8c84;};return a56_0x5bc9();}(function(_0x2067fb,_0x2bf50f){const _0x280fd9=a56_0x2a60,_0x170f54=_0x2067fb();while(!![]){try{const _0x1b9d36=parseInt(_0x280fd9(0x1d1))/0x1+-parseInt(_0x280fd9(0x1da))/0x2+-parseInt(_0x280fd9(0x1d9))/0x3*(-parseInt(_0x280fd9(0x1d6))/0x4)+-parseInt(_0x280fd9(0x1d7))/0x5+-parseInt(_0x280fd9(0x1d3))/0x6*(parseInt(_0x280fd9(0x1d0))/0x7)+-parseInt(_0x280fd9(0x1ce))/0x8*(-parseInt(_0x280fd9(0x1d4))/0x9)+parseInt(_0x280fd9(0x1dc))/0xa;if(_0x1b9d36===_0x2bf50f)break;else _0x170f54['push'](_0x170f54['shift']());}catch(_0x40eff7){_0x170f54['push'](_0x170f54['shift']());}}}(a56_0x5bc9,0xc10fe));import{buildDataCommand}from'../../commands/data/shared.js';export const dataFilter=buildDataCommand({'command':a56_0x2066cf(0x1cf),'operation':'filter','description':a56_0x2066cf(0x1d8),'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':[a56_0x2066cf(0x1db),a56_0x2066cf(0x1dd),'\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]',a56_0x2066cf(0x1d5),a56_0x2066cf(0x1cd),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page'][a56_0x2066cf(0x1d2)]('\x0a')});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a57_0x1f84fe=a57_0x4578;function a57_0x4578(_0x33502d,_0x3e1a1a){_0x33502d=_0x33502d-0xcc;const _0x36d385=a57_0x36d3();let _0x4578cb=_0x36d385[_0x33502d];return _0x4578cb;}(function(_0x38fb15,_0x340641){const _0x124833=a57_0x4578,_0x114244=_0x38fb15();while(!![]){try{const _0x1e2080=-parseInt(_0x124833(0xd2))/0x1*(parseInt(_0x124833(0xd9))/0x2)+-parseInt(_0x124833(0xcf))/0x3+-parseInt(_0x124833(0xd0))/0x4*(-parseInt(_0x124833(0xcc))/0x5)+parseInt(_0x124833(0xd6))/0x6*(parseInt(_0x124833(0xd1))/0x7)+-parseInt(_0x124833(0xd4))/0x8*(parseInt(_0x124833(0xd5))/0x9)+-parseInt(_0x124833(0xd8))/0xa*(parseInt(_0x124833(0xda))/0xb)+parseInt(_0x124833(0xdb))/0xc*(parseInt(_0x124833(0xcd))/0xd);if(_0x1e2080===_0x340641)break;else _0x114244['push'](_0x114244['shift']());}catch(_0x16edde){_0x114244['push'](_0x114244['shift']());}}}(a57_0x36d3,0xd75d8));import{buildDataCommand}from'../../commands/data/shared.js';export const dataGetOne=buildDataCommand({'command':a57_0x1f84fe(0xd7),'operation':a57_0x1f84fe(0xd7),'description':a57_0x1f84fe(0xce),'paramsRequired':!![],'paramsHint':a57_0x1f84fe(0xd3)});function a57_0x36d3(){const _0x3cbb45=['140032qICKOS','7217hMFoYV','1293024rxWozo','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','96HDIJwn','163467zILDrR','714rsjiQX','getOne','330huruEX','2tqLodb','92697kNIxwG','636PnIJhD','125iQnOJW','668889OWMqlz','Get\x20a\x20single\x20record\x20by\x20ID','3161073qHtiax'];a57_0x36d3=function(){return _0x3cbb45;};return a57_0x36d3();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x32a1c5,_0x53161b){const _0x4e7f83=a58_0x10a9,_0x114e49=_0x32a1c5();while(!![]){try{const _0x386926=parseInt(_0x4e7f83(0x95))/0x1+parseInt(_0x4e7f83(0x92))/0x2*(-parseInt(_0x4e7f83(0x9d))/0x3)+-parseInt(_0x4e7f83(0x99))/0x4*(parseInt(_0x4e7f83(0x94))/0x5)+-parseInt(_0x4e7f83(0x93))/0x6*(parseInt(_0x4e7f83(0x9a))/0x7)+-parseInt(_0x4e7f83(0x96))/0x8*(parseInt(_0x4e7f83(0x98))/0x9)+-parseInt(_0x4e7f83(0x9b))/0xa*(-parseInt(_0x4e7f83(0x9c))/0xb)+parseInt(_0x4e7f83(0x9e))/0xc*(parseInt(_0x4e7f83(0x97))/0xd);if(_0x386926===_0x53161b)break;else _0x114e49['push'](_0x114e49['shift']());}catch(_0x5aa755){_0x114e49['push'](_0x114e49['shift']());}}}(a58_0x226e,0x39af4));import{dataFilter}from'../../commands/data/filter.js';function a58_0x226e(){const _0x35ddc2=['2376639xSzXrw','136smCNqo','63zrcCeX','91990zPazvc','407hgboOf','10431rSmyqG','12xMfLfm','228CiHWdY','31854YZraEQ','1245RogwOf','181982CekXPn','8AyBepC','5598151TRYANS'];a58_0x226e=function(){return _0x35ddc2;};return a58_0x226e();}import{dataGetOne}from'../../commands/data/getOne.js';function a58_0x10a9(_0xd7ec8a,_0x44db0d){_0xd7ec8a=_0xd7ec8a-0x92;const _0x226e3e=a58_0x226e();let _0x10a9ab=_0x226e3e[_0xd7ec8a];return _0x10a9ab;}export const dataDefinitions=[dataFilter,dataGetOne];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x38b78b,_0x5336b6){const _0x4015a2=a59_0x431f,_0x1458c9=_0x38b78b();while(!![]){try{const _0x25ccd8=parseInt(_0x4015a2(0x71))/0x1+parseInt(_0x4015a2(0x80))/0x2*(parseInt(_0x4015a2(0x75))/0x3)+parseInt(_0x4015a2(0x77))/0x4+-parseInt(_0x4015a2(0x7c))/0x5*(-parseInt(_0x4015a2(0x85))/0x6)+parseInt(_0x4015a2(0x6e))/0x7*(parseInt(_0x4015a2(0x7d))/0x8)+parseInt(_0x4015a2(0x76))/0x9*(parseInt(_0x4015a2(0x8b))/0xa)+-parseInt(_0x4015a2(0x86))/0xb*(parseInt(_0x4015a2(0x72))/0xc);if(_0x25ccd8===_0x5336b6)break;else _0x1458c9['push'](_0x1458c9['shift']());}catch(_0x101789){_0x1458c9['push'](_0x1458c9['shift']());}}}(a59_0x1a6b,0xd6d32));function a59_0x431f(_0x265077,_0x12b0fc){_0x265077=_0x265077-0x6e;const _0x1a6bae=a59_0x1a6b();let _0x431f80=_0x1a6bae[_0x265077];return _0x431f80;}function a59_0x1a6b(){const _0x30d00d=['operation','243762ZjxoWa','18dMJnNT','608432JGDjVh','string','helpExtra','appCode','str','309605meuphU','16VWNEun','params','Example:\x20--params\x20\x27{\x22id\x22:123}\x27','18jWXqOd','flagMissing','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically','data\x20getOne\x20requires\x20\x22id\x22\x20in\x20--params','code','114wrAEVw','1903PDLjpK','command','description','validation','paramsHint','4068950taFujc','Provide\x20--params\x20\x27{\x22id\x22:123}\x27\x20for\x20data\x20getOne.','\x20completed\x20in\x20','alias','getOne','748027wQNDgS','now','data','1180376UrSTDZ','234996JgvRRw','read'];a59_0x1a6b=function(){return _0x30d00d;};return a59_0x1a6b();}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(_0x176e14){const _0x334f52=a59_0x431f;if(!_0x176e14)throw CliErrors[_0x334f52(0x81)](_0x334f52(0x7e),_0x334f52(0x8c));const _0x2afe2d=_0x176e14['id'];if(_0x2afe2d===undefined||_0x2afe2d===null||_0x2afe2d==='')throw CliErrors[_0x334f52(0x89)](_0x334f52(0x83),_0x334f52(0x7f));}function parseCommandParams(_0x4e22a6){return parseJsonParams(_0x4e22a6)??{};}export function buildDataCommand(_0x2d5057){const _0x5d6b21=a59_0x431f,_0x471f9e=_0x5d6b21(0x82);return{'service':_0x5d6b21(0x70),'command':_0x2d5057[_0x5d6b21(0x87)],'description':_0x2d5057[_0x5d6b21(0x88)],'risk':_0x5d6b21(0x73),'defaultOutputFormat':'compress','helpExtra':_0x2d5057[_0x5d6b21(0x79)],'flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':_0x5d6b21(0x8e),'type':_0x5d6b21(0x78),'description':_0x471f9e},{'name':'params','type':_0x5d6b21(0x78),'description':_0x2d5057[_0x5d6b21(0x8a)]}],async 'validate'(_0x546149){const _0xa73b3f=_0x5d6b21,_0x42bd2b=_0x546149[_0xa73b3f(0x7b)](_0xa73b3f(0x7e));if(_0x2d5057['paramsRequired']&&!_0x42bd2b)throw CliErrors['flagMissing'](_0xa73b3f(0x7e),_0x2d5057[_0xa73b3f(0x8a)]);const _0x3464e5=parseJsonParams(_0x42bd2b);_0x2d5057[_0xa73b3f(0x74)]===_0xa73b3f(0x8f)&&assertGetOneId(_0x3464e5);},async 'execute'(_0xed89f0){const _0x42f258=_0x5d6b21,_0x1e76de=parseCommandParams(_0xed89f0[_0x42f258(0x7b)]('params')),_0x23ad84=Date[_0x42f258(0x6f)](),_0x1448c7=await executeDatasetDataOperation(_0xed89f0[_0x42f258(0x7a)],_0xed89f0[_0x42f258(0x7b)](_0x42f258(0x84)),_0x2d5057[_0x42f258(0x74)],_0x1e76de),_0x5e446f=Date[_0x42f258(0x6f)]()-_0x23ad84;return{'ok':!![],'data':{'result':_0x1448c7,'elapsed':_0x5e446f},'message':'data\x20'+_0x2d5057[_0x42f258(0x87)]+_0x42f258(0x8d)+_0x5e446f+'ms'};}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a60_0x447e0f=a60_0x37a7;(function(_0x24459b,_0x520df2){const _0x1d1ab6=a60_0x37a7,_0x3e1413=_0x24459b();while(!![]){try{const _0x52b67a=-parseInt(_0x1d1ab6(0x1f3))/0x1+parseInt(_0x1d1ab6(0x204))/0x2+parseInt(_0x1d1ab6(0x21f))/0x3+-parseInt(_0x1d1ab6(0x232))/0x4+parseInt(_0x1d1ab6(0x233))/0x5*(parseInt(_0x1d1ab6(0x223))/0x6)+parseInt(_0x1d1ab6(0x211))/0x7*(-parseInt(_0x1d1ab6(0x224))/0x8)+-parseInt(_0x1d1ab6(0x1f9))/0x9;if(_0x52b67a===_0x520df2)break;else _0x3e1413['push'](_0x3e1413['shift']());}catch(_0xb16bea){_0x3e1413['push'](_0x3e1413['shift']());}}}(a60_0x549a,0xc62a4));function a60_0x37a7(_0x540317,_0x5804c3){_0x540317=_0x540317-0x1f2;const _0x549a41=a60_0x549a();let _0x37a748=_0x549a41[_0x540317];return _0x37a748;}function a60_0x549a(){const _0x51b327=['data','POST','Business\x20scenario\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','business-group','unchanged','526680ppeujn','Dry-run:\x20business\x20scenario\x20group\x20would\x20change\x20for\x20dataset\x20','validation','length','backend','Expectation\x20mismatch\x20at\x20businessGroup','Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.','sourceType',',\x20actual\x20','datasetId','--business-group\x20is\x20required','1724800SoHufY','trim','extend','apiError','code','modelCode','keys','found','datasetName','message','string','name','isArray','4042822IKWrfW','str','Dataset\x20detail\x20does\x20not\x20expose\x20businessGroup.','object','expect-business-group','parse','DB_TABLE','business-group-update','METADATA','stringify','isFinite','Update\x20business\x20scenario\x20group','update','number','3817404WUkKXY','dbtableConfig','payload','Business\x20scenario\x20group\x20(not\x20technical):\x20use\x20<scenario>,\x20or\x20<domain>---<scenario>\x20when\x20needed\x20for\x20disambiguation\x20or\x20an\x20existing\x20hierarchy;\x20empty\x20string\x20clears\x20it','246cudhfP','8ELjcVf','modelId','Expected\x20','--code\x20is\x20required','/smartapi/question/er-config/business-group/edit','value','call','Business\x20scenario\x20group\x20readback\x20must\x20be\x20available\x20by\x20datasetCode;\x20upgrade\x20the\x20backend\x20read\x20contract\x20instead\x20of\x20using\x20dblinkId/tableName.','datasetCode','dataset','Expected\x20current\x20business\x20scenario\x20group;\x20mismatch\x20aborts\x20without\x20writing','appCode','businessGroup','toUpperCase','1821188IqRQpu','133200ijqRMZ','write','Updated\x20business\x20scenario\x20group\x20for\x20dataset\x20','source','1324061tegiBD'];a60_0x549a=function(){return _0x51b327;};return a60_0x549a();}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=a60_0x447e0f(0x228);export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x2d3ab1,input:_0x41f20d,dryRun:_0x2a3c78}){const _0x4df34e=a60_0x447e0f;validateInput(_0x41f20d);const _0xf737bb=normalizeBusinessGroup(_0x41f20d[_0x4df34e(0x230)]),_0x1b4720=await getDatasetDetail(_0x41f20d[_0x4df34e(0x208)]),_0x41df75=resolveBusinessGroupDataset(_0x1b4720,_0x41f20d[_0x4df34e(0x208)]),_0x42fce4=loadCurrentBusinessGroup(_0x1b4720,_0x41df75);assertExpectedBusinessGroup(_0x42fce4,_0x41f20d['expectBusinessGroup']);const _0x32a3e4=buildBackendPayload(_0x2d3ab1,_0x41df75,_0xf737bb),_0x4f0314=_0x42fce4!==_0xf737bb;let _0x13cc98;if(_0x4f0314&&!_0x2a3c78){await updateErBusinessGroup(_0x32a3e4);const _0x1b9297=await getDatasetDetail(_0x41df75[_0x4df34e(0x208)]),_0x1f7ada=resolveBusinessGroupDataset(_0x1b9297,_0x41df75[_0x4df34e(0x208)]),_0x59e601=loadCurrentBusinessGroup(_0x1b9297,_0x1f7ada);if(_0x59e601!==_0xf737bb)throw CliErrors[_0x4df34e(0x207)](_0x4df34e(0x1f6),_0x4df34e(0x226)+JSON[_0x4df34e(0x21a)](_0xf737bb)+_0x4df34e(0x201)+JSON[_0x4df34e(0x21a)](_0x59e601)+'.');_0x13cc98={'verified':!![],'status':'matched','afterReadback':{'businessGroup':_0x59e601}};}else!_0x4f0314&&(_0x13cc98={'verified':!![],'status':_0x4df34e(0x1f8),'afterReadback':{'businessGroup':_0x42fce4}});const _0x103d3e={'operation':_0x4df34e(0x21d),'appCode':_0x2d3ab1,'selector':{'code':_0x41df75['code']},'dataset':_0x41df75,'before':{'businessGroup':_0x42fce4},'after':{'businessGroup':_0xf737bb},'changed':_0x4f0314,'dryRun':_0x2a3c78,'submitted':_0x4f0314&&!_0x2a3c78,'backend':{'method':_0x4df34e(0x1f5),'path':BACKEND_PATH,'payload':_0x32a3e4},..._0x13cc98?{'verification':_0x13cc98}:{},'warnings':[]};return{'ok':!![],'data':_0x103d3e,'message':_0x4f0314?_0x2a3c78?_0x4df34e(0x1fa)+_0x41df75[_0x4df34e(0x208)]:_0x4df34e(0x235)+_0x41df75[_0x4df34e(0x208)]:'No\x20changes\x20for\x20business\x20scenario\x20group\x20on\x20dataset\x20'+_0x41df75['code']};}export const datasetBusinessGroupUpdate={'service':a60_0x447e0f(0x22d),'command':a60_0x447e0f(0x218),'description':a60_0x447e0f(0x21c),'risk':a60_0x447e0f(0x234),'flags':[CODE_FLAG,{'name':a60_0x447e0f(0x1f7),'type':a60_0x447e0f(0x20e),'required':!![],'description':a60_0x447e0f(0x222)},{'name':a60_0x447e0f(0x215),'type':'string','required':![],'description':a60_0x447e0f(0x22e)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x511b2b){validateInput(readBusinessGroupUpdateInput(_0x511b2b));},async 'dryRun'(_0x2cb4c5){const _0x40d204=a60_0x447e0f,_0x13c3cf=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x2cb4c5[_0x40d204(0x22f)],'input':readBusinessGroupUpdateInput(_0x2cb4c5),'dryRun':!![]});return{'method':'POST','url':BACKEND_PATH,'body':_0x13c3cf[_0x40d204(0x1f4)][_0x40d204(0x1fd)][_0x40d204(0x221)],'description':_0x13c3cf[_0x40d204(0x20d)],..._0x13c3cf[_0x40d204(0x1f4)]};},async 'execute'(_0x3dd6f0){const _0x26668b=a60_0x447e0f;return buildDatasetBusinessGroupUpdateResult({'appCode':_0x3dd6f0[_0x26668b(0x22f)],'input':readBusinessGroupUpdateInput(_0x3dd6f0),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x505a0d){const _0x502a01=a60_0x447e0f,_0x1975a6=_0x505a0d[_0x502a01(0x212)](_0x502a01(0x215));return{'code':trim(_0x505a0d[_0x502a01(0x212)]('code')),'businessGroup':_0x505a0d['str'](_0x502a01(0x1f7)),'expectBusinessGroup':_0x1975a6===undefined||_0x1975a6===''?undefined:_0x1975a6};}function validateInput(_0x5b29b5){const _0x33d41f=a60_0x447e0f;if(!trim(_0x5b29b5[_0x33d41f(0x208)]))throw CliErrors[_0x33d41f(0x1fb)](_0x33d41f(0x227));if(_0x5b29b5[_0x33d41f(0x230)]===undefined)throw CliErrors[_0x33d41f(0x1fb)](_0x33d41f(0x203));}function resolveBusinessGroupDataset(_0x35c53b,_0x11c4f3){const _0x26c24b=a60_0x447e0f,_0x2f01af=asPlainObject(_0x35c53b[_0x26c24b(0x22d)]),_0x2b0feb=asPlainObject(_0x35c53b[_0x26c24b(0x220)]),_0x56cd33=resolveSourceType(_0x35c53b,_0x2f01af,_0x2b0feb),_0x370389=firstString(_0x35c53b[_0x26c24b(0x209)],_0x35c53b[_0x26c24b(0x208)],_0x2f01af[_0x26c24b(0x22c)],_0x11c4f3)||_0x11c4f3;return{'id':firstNumber(_0x35c53b[_0x26c24b(0x225)],_0x35c53b['id'],_0x2f01af['datasetId'])??firstString(_0x35c53b[_0x26c24b(0x225)],_0x35c53b['id'],_0x2f01af[_0x26c24b(0x202)])??null,'code':_0x370389,'name':firstString(_0x35c53b[_0x26c24b(0x20f)],_0x2f01af[_0x26c24b(0x20c)],_0x2f01af[_0x26c24b(0x20f)])||null,'sourceType':_0x56cd33};}function resolveSourceType(_0x1a3362,_0x4a0131,_0x22f43d){const _0x1f4717=a60_0x447e0f,_0x1f20f6=firstString(_0x1a3362[_0x1f4717(0x1f2)],_0x1a3362[_0x1f4717(0x200)],_0x4a0131[_0x1f4717(0x1f2)],_0x4a0131[_0x1f4717(0x200)])?.['trim']()[_0x1f4717(0x231)]();if(_0x1f20f6===_0x1f4717(0x217)||_0x1f20f6==='METADATA')return _0x1f20f6;if(Object[_0x1f4717(0x20a)](_0x22f43d)[_0x1f4717(0x1fc)]>0x0)return _0x1f4717(0x217);throw CliErrors[_0x1f4717(0x1fb)](_0x1f4717(0x1ff));}function loadCurrentBusinessGroup(_0x141b31,_0x26b9bd){const _0x1d7914=a60_0x447e0f,_0x2adfce=readBusinessGroupFromDatasetDetail(_0x141b31,_0x26b9bd[_0x1d7914(0x200)]);if(_0x2adfce[_0x1d7914(0x20b)])return normalizeBusinessGroup(_0x2adfce[_0x1d7914(0x229)]);if(_0x26b9bd[_0x1d7914(0x200)]===_0x1d7914(0x219))return'';throw CliErrors[_0x1d7914(0x1fb)](_0x1d7914(0x213),_0x1d7914(0x22b));}function readBusinessGroupFromDatasetDetail(_0x5a1387,_0x44ab77){const _0x5c59a2=a60_0x447e0f,_0x59e2ce=asPlainObject(_0x5a1387[_0x5c59a2(0x22d)]),_0x35a4fa=firstPresent(_0x5a1387[_0x5c59a2(0x230)]);if(_0x35a4fa['found'])return _0x35a4fa;const _0x34eedc=firstPresent(_0x59e2ce[_0x5c59a2(0x230)]);if(_0x34eedc[_0x5c59a2(0x20b)])return _0x34eedc;if(_0x44ab77===_0x5c59a2(0x217))return{'found':![]};const _0x5d4b68=readBusinessGroupFromExtend(_0x5a1387[_0x5c59a2(0x206)]);if(_0x5d4b68[_0x5c59a2(0x20b)])return _0x5d4b68;return readBusinessGroupFromExtend(_0x59e2ce['extend']);}function readBusinessGroupFromExtend(_0x223bae){const _0x5a4534=a60_0x447e0f;if(_0x223bae===undefined||_0x223bae===null||_0x223bae==='')return{'found':![]};if(typeof _0x223bae===_0x5a4534(0x20e))try{const _0x2a0ecb=JSON[_0x5a4534(0x216)](_0x223bae);return readBusinessGroupFromExtend(_0x2a0ecb);}catch{return{'found':![]};}const _0x8e89c9=asPlainObject(_0x223bae);if(Object['prototype']['hasOwnProperty'][_0x5a4534(0x22a)](_0x8e89c9,_0x5a4534(0x230)))return{'found':!![],'value':_0x8e89c9[_0x5a4534(0x230)]};return{'found':![]};}function firstPresent(..._0x484839){for(const _0x2dc5df of _0x484839){if(_0x2dc5df!==undefined&&_0x2dc5df!==null)return{'found':!![],'value':_0x2dc5df};}return{'found':![]};}function assertExpectedBusinessGroup(_0x1281a3,_0x17d3f7){const _0x5e9f32=a60_0x447e0f;if(_0x17d3f7===undefined)return;const _0x545308=normalizeBusinessGroup(_0x17d3f7);if(_0x1281a3!==_0x545308)throw CliErrors[_0x5e9f32(0x1fb)](_0x5e9f32(0x1fe),_0x5e9f32(0x226)+JSON[_0x5e9f32(0x21a)](_0x545308)+_0x5e9f32(0x201)+JSON[_0x5e9f32(0x21a)](_0x1281a3));}function buildBackendPayload(_0x35185b,_0x2602b6,_0x26016b){const _0x418347=a60_0x447e0f;return{'appCode':_0x35185b,'datasetCode':_0x2602b6[_0x418347(0x208)],'businessGroup':_0x26016b};}function normalizeBusinessGroup(_0x580c6e){const _0x328b3c=a60_0x447e0f;if(_0x580c6e===undefined||_0x580c6e===null)return'';return String(_0x580c6e)[_0x328b3c(0x205)]();}function asPlainObject(_0x30d66a){const _0x1da9d1=a60_0x447e0f;if(!_0x30d66a||typeof _0x30d66a!==_0x1da9d1(0x214)||Array[_0x1da9d1(0x210)](_0x30d66a))return{};return _0x30d66a;}function firstString(..._0x876820){const _0x58e36d=a60_0x447e0f;for(const _0x3b18c8 of _0x876820){if(typeof _0x3b18c8===_0x58e36d(0x20e)&&_0x3b18c8[_0x58e36d(0x205)]())return _0x3b18c8[_0x58e36d(0x205)]();if(typeof _0x3b18c8==='number'&&Number[_0x58e36d(0x21b)](_0x3b18c8))return String(_0x3b18c8);}return undefined;}function firstNumber(..._0x24903c){const _0x543143=a60_0x447e0f;for(const _0x10660b of _0x24903c){if(typeof _0x10660b===_0x543143(0x21e)&&Number[_0x543143(0x21b)](_0x10660b))return _0x10660b;if(typeof _0x10660b==='string'&&_0x10660b[_0x543143(0x205)]()&&Number[_0x543143(0x21b)](Number(_0x10660b)))return Number(_0x10660b);}return null;}function trim(_0x347e94){const _0x5a11cd=a60_0x447e0f;return String(_0x347e94||'')[_0x5a11cd(0x205)]();}
|
|
1
|
+
const a60_0x137fde=a60_0xf778;(function(_0x42ca11,_0x1a892b){const _0x1cc16a=a60_0xf778,_0x232c76=_0x42ca11();while(!![]){try{const _0x17373d=parseInt(_0x1cc16a(0x7f))/0x1*(parseInt(_0x1cc16a(0xaa))/0x2)+-parseInt(_0x1cc16a(0x80))/0x3*(parseInt(_0x1cc16a(0xac))/0x4)+parseInt(_0x1cc16a(0x75))/0x5+parseInt(_0x1cc16a(0x74))/0x6*(parseInt(_0x1cc16a(0x7c))/0x7)+-parseInt(_0x1cc16a(0x94))/0x8+parseInt(_0x1cc16a(0x96))/0x9+-parseInt(_0x1cc16a(0x8b))/0xa*(parseInt(_0x1cc16a(0x79))/0xb);if(_0x17373d===_0x1a892b)break;else _0x232c76['push'](_0x232c76['shift']());}catch(_0x1b47fe){_0x232c76['push'](_0x232c76['shift']());}}}(a60_0x5c2d,0xad9ea));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=a60_0x137fde(0xa4);export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x4513e0,input:_0x19b6c8,dryRun:_0x594a1e}){const _0x89f0dc=a60_0x137fde;validateInput(_0x19b6c8);const _0x52d17b=normalizeBusinessGroup(_0x19b6c8['businessGroup']),_0x2aa937=await getDatasetDetail(_0x19b6c8[_0x89f0dc(0x82)]),_0x3dbaf6=resolveBusinessGroupDataset(_0x2aa937,_0x19b6c8[_0x89f0dc(0x82)]),_0xcf901e=loadCurrentBusinessGroup(_0x2aa937,_0x3dbaf6);assertExpectedBusinessGroup(_0xcf901e,_0x19b6c8[_0x89f0dc(0x88)]);const _0x141224=buildBackendPayload(_0x4513e0,_0x3dbaf6,_0x52d17b),_0x3c4b10=_0xcf901e!==_0x52d17b;let _0x571e57;if(_0x3c4b10&&!_0x594a1e){await updateErBusinessGroup(_0x141224);const _0x180ddf=await getDatasetDetail(_0x3dbaf6[_0x89f0dc(0x82)]),_0x472d5c=resolveBusinessGroupDataset(_0x180ddf,_0x3dbaf6[_0x89f0dc(0x82)]),_0x259146=loadCurrentBusinessGroup(_0x180ddf,_0x472d5c);if(_0x259146!==_0x52d17b)throw CliErrors['apiError'](_0x89f0dc(0xa8),'Expected\x20'+JSON[_0x89f0dc(0xab)](_0x52d17b)+_0x89f0dc(0x97)+JSON['stringify'](_0x259146)+'.');_0x571e57={'verified':!![],'status':_0x89f0dc(0x8e),'afterReadback':{'businessGroup':_0x259146}};}else!_0x3c4b10&&(_0x571e57={'verified':!![],'status':_0x89f0dc(0x7a),'afterReadback':{'businessGroup':_0xcf901e}});const _0x43da56={'operation':_0x89f0dc(0x90),'appCode':_0x4513e0,'selector':{'code':_0x3dbaf6[_0x89f0dc(0x82)]},'dataset':_0x3dbaf6,'before':{'businessGroup':_0xcf901e},'after':{'businessGroup':_0x52d17b},'changed':_0x3c4b10,'dryRun':_0x594a1e,'submitted':_0x3c4b10&&!_0x594a1e,'backend':{'method':_0x89f0dc(0x91),'path':BACKEND_PATH,'payload':_0x141224},..._0x571e57?{'verification':_0x571e57}:{},'warnings':[]};return{'ok':!![],'data':_0x43da56,'message':_0x3c4b10?_0x594a1e?_0x89f0dc(0xa3)+_0x3dbaf6[_0x89f0dc(0x82)]:_0x89f0dc(0x9f)+_0x3dbaf6[_0x89f0dc(0x82)]:_0x89f0dc(0x89)+_0x3dbaf6[_0x89f0dc(0x82)]};}export const datasetBusinessGroupUpdate={'service':a60_0x137fde(0xa1),'command':'business-group-update','description':a60_0x137fde(0x71),'risk':a60_0x137fde(0x9b),'flags':[CODE_FLAG,{'name':a60_0x137fde(0x9d),'type':'string','required':!![],'description':a60_0x137fde(0x9a)},{'name':a60_0x137fde(0x73),'type':'string','required':![],'description':a60_0x137fde(0x8d)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x7ff0c9){validateInput(readBusinessGroupUpdateInput(_0x7ff0c9));},async 'dryRun'(_0x17d67a){const _0xaa6a42=a60_0x137fde,_0x1b8ac1=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x17d67a[_0xaa6a42(0x8f)],'input':readBusinessGroupUpdateInput(_0x17d67a),'dryRun':!![]});return{'method':_0xaa6a42(0x91),'url':BACKEND_PATH,'body':_0x1b8ac1[_0xaa6a42(0x95)]['backend']['payload'],'description':_0x1b8ac1[_0xaa6a42(0x93)],..._0x1b8ac1['data']};},async 'execute'(_0x1612f3){return buildDatasetBusinessGroupUpdateResult({'appCode':_0x1612f3['appCode'],'input':readBusinessGroupUpdateInput(_0x1612f3),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x57e78d){const _0x41a17a=a60_0x137fde,_0x188832=_0x57e78d[_0x41a17a(0x6f)](_0x41a17a(0x73));return{'code':trim(_0x57e78d[_0x41a17a(0x6f)](_0x41a17a(0x82))),'businessGroup':_0x57e78d[_0x41a17a(0x6f)](_0x41a17a(0x9d)),'expectBusinessGroup':_0x188832===undefined||_0x188832===''?undefined:_0x188832};}function a60_0x5c2d(){const _0x19d149=['modelCode','Update\x20business\x20scenario\x20group','length','expect-business-group','222RoHrRX','1447325eEsUxC','validation','Expectation\x20mismatch\x20at\x20businessGroup','string','814066XlrGCQ','unchanged','prototype','14175YrdrOh','businessGroup','Business\x20scenario\x20group\x20readback\x20must\x20be\x20available\x20by\x20datasetCode;\x20upgrade\x20the\x20backend\x20read\x20contract\x20instead\x20of\x20using\x20dblinkId/tableName.','1532cZTFzq','6jgCjPE','modelId','code','datasetId','dbtableConfig','toUpperCase','sourceType','source','expectBusinessGroup','No\x20changes\x20for\x20business\x20scenario\x20group\x20on\x20dataset\x20','number','40IaxygP','datasetName','Expected\x20current\x20business\x20scenario\x20group;\x20mismatch\x20aborts\x20without\x20writing','matched','appCode','update','POST','extend','message','1935320cgsjLd','data','6067665dCeFXv',',\x20actual\x20','Dataset\x20detail\x20does\x20not\x20expose\x20businessGroup.','DB_TABLE','Business\x20scenario\x20group\x20(not\x20technical):\x20use\x20<scenario>,\x20or\x20<domain>---<scenario>\x20when\x20needed\x20for\x20disambiguation\x20or\x20an\x20existing\x20hierarchy;\x20empty\x20string\x20clears\x20it','write','--code\x20is\x20required','business-group','trim','Updated\x20business\x20scenario\x20group\x20for\x20dataset\x20','METADATA','dataset','call','Dry-run:\x20business\x20scenario\x20group\x20would\x20change\x20for\x20dataset\x20','/smartapi/question/er-config/business-group/edit','name','found','isArray','Business\x20scenario\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','isFinite','1076Rbothh','stringify','1227412kVimHe','str'];a60_0x5c2d=function(){return _0x19d149;};return a60_0x5c2d();}function validateInput(_0x418bfe){const _0x33a4b7=a60_0x137fde;if(!trim(_0x418bfe[_0x33a4b7(0x82)]))throw CliErrors['validation'](_0x33a4b7(0x9c));if(_0x418bfe[_0x33a4b7(0x7d)]===undefined)throw CliErrors['validation']('--business-group\x20is\x20required');}function resolveBusinessGroupDataset(_0x43b072,_0x47ef52){const _0x5b6107=a60_0x137fde,_0x22260d=asPlainObject(_0x43b072[_0x5b6107(0xa1)]),_0x440980=asPlainObject(_0x43b072[_0x5b6107(0x84)]),_0x40482c=resolveSourceType(_0x43b072,_0x22260d,_0x440980),_0x28ef8b=firstString(_0x43b072[_0x5b6107(0x70)],_0x43b072[_0x5b6107(0x82)],_0x22260d['datasetCode'],_0x47ef52)||_0x47ef52;return{'id':firstNumber(_0x43b072[_0x5b6107(0x81)],_0x43b072['id'],_0x22260d['datasetId'])??firstString(_0x43b072[_0x5b6107(0x81)],_0x43b072['id'],_0x22260d[_0x5b6107(0x83)])??null,'code':_0x28ef8b,'name':firstString(_0x43b072[_0x5b6107(0xa5)],_0x22260d[_0x5b6107(0x8c)],_0x22260d[_0x5b6107(0xa5)])||null,'sourceType':_0x40482c};}function resolveSourceType(_0x1f1427,_0xadcdee,_0x5379d8){const _0x69bf70=a60_0x137fde,_0x5143eb=firstString(_0x1f1427[_0x69bf70(0x87)],_0x1f1427[_0x69bf70(0x86)],_0xadcdee[_0x69bf70(0x87)],_0xadcdee['sourceType'])?.['trim']()[_0x69bf70(0x85)]();if(_0x5143eb===_0x69bf70(0x99)||_0x5143eb===_0x69bf70(0xa0))return _0x5143eb;if(Object['keys'](_0x5379d8)[_0x69bf70(0x72)]>0x0)return _0x69bf70(0x99);throw CliErrors['validation']('Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.');}function a60_0xf778(_0x408279,_0x5ecec3){_0x408279=_0x408279-0x6f;const _0x5c2d0d=a60_0x5c2d();let _0xf778ec=_0x5c2d0d[_0x408279];return _0xf778ec;}function loadCurrentBusinessGroup(_0x56b70d,_0x573625){const _0x23165e=a60_0x137fde,_0x4fcc8a=readBusinessGroupFromDatasetDetail(_0x56b70d,_0x573625[_0x23165e(0x86)]);if(_0x4fcc8a[_0x23165e(0xa6)])return normalizeBusinessGroup(_0x4fcc8a['value']);if(_0x573625[_0x23165e(0x86)]===_0x23165e(0xa0))return'';throw CliErrors[_0x23165e(0x76)](_0x23165e(0x98),_0x23165e(0x7e));}function readBusinessGroupFromDatasetDetail(_0x2cca1b,_0x290e93){const _0x2820fb=a60_0x137fde,_0x2cdc6c=asPlainObject(_0x2cca1b[_0x2820fb(0xa1)]),_0x582731=firstPresent(_0x2cca1b['businessGroup']);if(_0x582731[_0x2820fb(0xa6)])return _0x582731;const _0x5527b7=firstPresent(_0x2cdc6c[_0x2820fb(0x7d)]);if(_0x5527b7[_0x2820fb(0xa6)])return _0x5527b7;if(_0x290e93===_0x2820fb(0x99))return{'found':![]};const _0x47d788=readBusinessGroupFromExtend(_0x2cca1b[_0x2820fb(0x92)]);if(_0x47d788['found'])return _0x47d788;return readBusinessGroupFromExtend(_0x2cdc6c[_0x2820fb(0x92)]);}function readBusinessGroupFromExtend(_0x4b586f){const _0x2aa6ef=a60_0x137fde;if(_0x4b586f===undefined||_0x4b586f===null||_0x4b586f==='')return{'found':![]};if(typeof _0x4b586f===_0x2aa6ef(0x78))try{const _0x5e7c38=JSON['parse'](_0x4b586f);return readBusinessGroupFromExtend(_0x5e7c38);}catch{return{'found':![]};}const _0x52d247=asPlainObject(_0x4b586f);if(Object[_0x2aa6ef(0x7b)]['hasOwnProperty'][_0x2aa6ef(0xa2)](_0x52d247,_0x2aa6ef(0x7d)))return{'found':!![],'value':_0x52d247[_0x2aa6ef(0x7d)]};return{'found':![]};}function firstPresent(..._0x5b52b8){for(const _0x4b0267 of _0x5b52b8){if(_0x4b0267!==undefined&&_0x4b0267!==null)return{'found':!![],'value':_0x4b0267};}return{'found':![]};}function assertExpectedBusinessGroup(_0x286b15,_0x4442f0){const _0x479574=a60_0x137fde;if(_0x4442f0===undefined)return;const _0x571311=normalizeBusinessGroup(_0x4442f0);if(_0x286b15!==_0x571311)throw CliErrors[_0x479574(0x76)](_0x479574(0x77),'Expected\x20'+JSON[_0x479574(0xab)](_0x571311)+_0x479574(0x97)+JSON[_0x479574(0xab)](_0x286b15));}function buildBackendPayload(_0x19e5b8,_0x43fed5,_0x21f2de){return{'appCode':_0x19e5b8,'datasetCode':_0x43fed5['code'],'businessGroup':_0x21f2de};}function normalizeBusinessGroup(_0x5322de){const _0x5834df=a60_0x137fde;if(_0x5322de===undefined||_0x5322de===null)return'';return String(_0x5322de)[_0x5834df(0x9e)]();}function asPlainObject(_0x105017){const _0x40bb95=a60_0x137fde;if(!_0x105017||typeof _0x105017!=='object'||Array[_0x40bb95(0xa7)](_0x105017))return{};return _0x105017;}function firstString(..._0x42b797){const _0x4afa72=a60_0x137fde;for(const _0x4e5cc9 of _0x42b797){if(typeof _0x4e5cc9==='string'&&_0x4e5cc9['trim']())return _0x4e5cc9[_0x4afa72(0x9e)]();if(typeof _0x4e5cc9===_0x4afa72(0x8a)&&Number[_0x4afa72(0xa9)](_0x4e5cc9))return String(_0x4e5cc9);}return undefined;}function firstNumber(..._0x2b3624){const _0x3ba698=a60_0x137fde;for(const _0x1567a3 of _0x2b3624){if(typeof _0x1567a3===_0x3ba698(0x8a)&&Number[_0x3ba698(0xa9)](_0x1567a3))return _0x1567a3;if(typeof _0x1567a3===_0x3ba698(0x78)&&_0x1567a3['trim']()&&Number[_0x3ba698(0xa9)](Number(_0x1567a3)))return Number(_0x1567a3);}return null;}function trim(_0xd48c30){return String(_0xd48c30||'')['trim']();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a61_0x4563de=a61_0x3aa0;function a61_0x3aa0(_0x55fd7f,_0x2f8b1a){_0x55fd7f=_0x55fd7f-0x89;const _0xafab94=a61_0xafab();let _0x3aa056=_0xafab94[_0x55fd7f];return _0x3aa056;}(function(_0x169492,_0x5138ad){const _0x4780c=a61_0x3aa0,_0x1671be=_0x169492();while(!![]){try{const _0x50aaa3=-parseInt(_0x4780c(0xaa))/0x1+parseInt(_0x4780c(0x9e))/0x2+parseInt(_0x4780c(0x96))/0x3*(-parseInt(_0x4780c(0xad))/0x4)+-parseInt(_0x4780c(0x9b))/0x5+parseInt(_0x4780c(0x9a))/0x6*(-parseInt(_0x4780c(0x93))/0x7)+-parseInt(_0x4780c(0xa4))/0x8*(parseInt(_0x4780c(0x91))/0x9)+parseInt(_0x4780c(0xab))/0xa;if(_0x50aaa3===_0x5138ad)break;else _0x1671be['push'](_0x1671be['shift']());}catch(_0x3bacd6){_0x1671be['push'](_0x1671be['shift']());}}}(a61_0xafab,0x74a76));import{CliErrors}from'../../errors.js';export const RUNTIME_DATA_ACCESS_COMMANDS={'cli':a61_0x4563de(0x97),'filter':'lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27<json>\x27\x20--format\x20compress','getOne':a61_0x4563de(0x98)};export const RUNTIME_DATA_ACCESS_SUMMARY=a61_0x4563de(0xa8);function valueToString(_0x4e4f11){const _0xa4c223=a61_0x4563de;return _0x4e4f11==null?'':String(_0x4e4f11)[_0xa4c223(0x9f)]();}function getDatasetCode(_0x3a45e7){const _0x48dc95=a61_0x4563de;return valueToString(_0x3a45e7['code']??_0x3a45e7[_0x48dc95(0x9d)]??_0x3a45e7[_0x48dc95(0x8e)]?.[_0x48dc95(0xa3)]);}function getDatasetName(_0x3db940){const _0x5549a1=a61_0x4563de;return valueToString(_0x3db940[_0x5549a1(0xa6)]??_0x3db940[_0x5549a1(0x8e)]?.[_0x5549a1(0x99)])||_0x5549a1(0x8f);}function getDatasetSource(_0x5bb8bc){const _0x1463c3=a61_0x4563de;return valueToString(_0x5bb8bc[_0x1463c3(0x94)]??_0x5bb8bc[_0x1463c3(0x8e)]?.[_0x1463c3(0x8a)])[_0x1463c3(0xa0)]();}function getDbtableConfig(_0x2d6b7a){const _0x49f2f7=a61_0x4563de,_0x517889=_0x2d6b7a[_0x49f2f7(0xa5)]??_0x2d6b7a[_0x49f2f7(0x9c)];return _0x517889&&typeof _0x517889===_0x49f2f7(0x89)?_0x517889:{};}export function isDbTableBackedDataset(_0x383207){const _0x1c9238=a61_0x4563de,_0x20866a=getDatasetSource(_0x383207);if(_0x20866a===_0x1c9238(0x92))return![];const _0x49ef9a=getDbtableConfig(_0x383207),_0x49affe=_0x49ef9a['dbId']??_0x49ef9a['id'],_0x3d7e11=valueToString(_0x49ef9a['tableName']??_0x383207[_0x1c9238(0x90)]??_0x383207[_0x1c9238(0x8e)]?.[_0x1c9238(0x90)]);return _0x49affe!==undefined&&_0x49affe!==null&&_0x3d7e11['length']>0x0;}function a61_0xafab(){const _0x3175c8=['18yrbtBw','METADATA','322nYgGlv','source','原因:schema\x20introspection\x20与\x20custom\x20SQL\x20需要\x20source=DB_TABLE、dbtableConfig.dbId、dbtableConfig.tableName\x20与数据库连接上下文。','4359KvcDWv','lovrabet','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27\x20--format\x20compress','datasetName','16986sdLTWO','4471980kxJDMv','dbtable','modelCode','28198wrlDJY','trim','toUpperCase','validation','当前数据集\x20\x22','datasetCode','1269840fIwpww','dbtableConfig','name','join','Use\x20lovrabet\x20data\x20filter/getOne\x20for\x20real\x20runtime\x20records.','\x20是\x20','331855WfUxSL','30544950andygR','getOne','2524OOYsSB','object','sourceType','\x20的\x20DB_TABLE\x20数据源上下文。','filter','如果只是查看运行态真实行数据,请切换到\x20lovrabet\x20CLI:','dataset','unknown','tableName'];a61_0xafab=function(){return _0x3175c8;};return a61_0xafab();}export function filterDbTableBackedDatasets(_0xa38613){const _0x4ae3d5=a61_0x4563de;return _0xa38613[_0x4ae3d5(0x8c)](_0x2a4fc4=>isDbTableBackedDataset(_0x2a4fc4));}export function buildDbTableBackedRequirementMessage(_0x56ba56,_0x1e278c='SQL\x20schema\x20validation'){const _0x1452a7=a61_0x4563de,_0x40cd16=getDatasetSource(_0x56ba56)||'UNKNOWN',_0x195339=getDatasetName(_0x56ba56),_0x5021bc=getDatasetCode(_0x56ba56),_0x40df9d=_0x5021bc?'\x20('+_0x5021bc+')':'';return[_0x1452a7(0xa2)+_0x195339+'\x22'+_0x40df9d+_0x1452a7(0xa9)+_0x40cd16+'\x20类型,没有可用于\x20'+_0x1e278c+_0x1452a7(0x8b),_0x1452a7(0x95),'请先将该数据集升级/迁移为\x20DB_TABLE\x20数据集,再基于新的\x20dataset\x20code\x20继续开发。',_0x1452a7(0x8d)+RUNTIME_DATA_ACCESS_COMMANDS[_0x1452a7(0x8c)]+';'+RUNTIME_DATA_ACCESS_COMMANDS[_0x1452a7(0xac)]+'。'][_0x1452a7(0xa7)]('\x20');}export function assertDatasetIsDbTableBacked(_0x4fbc08,_0x371b32){const _0x2bcedf=a61_0x4563de;if(!isDbTableBackedDataset(_0x4fbc08))throw CliErrors[_0x2bcedf(0xa1)](buildDbTableBackedRequirementMessage(_0x4fbc08,_0x371b32));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a62_0x862665=a62_0x1fbe;(function(_0x49b200,_0x364ddc){const _0x10fec9=a62_0x1fbe,_0xf84c4e=_0x49b200();while(!![]){try{const _0x336740=-parseInt(_0x10fec9(0xf0))/0x1*(parseInt(_0x10fec9(0xcc))/0x2)+parseInt(_0x10fec9(0xd6))/0x3*(-parseInt(_0x10fec9(0xd9))/0x4)+parseInt(_0x10fec9(0xf8))/0x5+-parseInt(_0x10fec9(0xfa))/0x6+-parseInt(_0x10fec9(0xe8))/0x7*(-parseInt(_0x10fec9(0xde))/0x8)+parseInt(_0x10fec9(0xf1))/0x9*(-parseInt(_0x10fec9(0xdf))/0xa)+parseInt(_0x10fec9(0xf5))/0xb;if(_0x336740===_0x364ddc)break;else _0xf84c4e['push'](_0xf84c4e['shift']());}catch(_0x4b37a6){_0xf84c4e['push'](_0xf84c4e['shift']());}}}(a62_0x24aa,0x8e4f7));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':a62_0x862665(0xf2),'description':a62_0x862665(0xdb)},DBID_FLAG={'name':a62_0x862665(0xec),'type':a62_0x862665(0xf2),'description':a62_0x862665(0xe0)},CONFIRM_FLAG={'name':a62_0x862665(0xf9),'type':a62_0x862665(0xd4),'description':'Required\x20to\x20execute\x20dataset\x20deletion'},EXPECTED_COUNT_FLAG={'name':a62_0x862665(0xfd),'type':a62_0x862665(0xf2),'description':a62_0x862665(0xcd)};function a62_0x24aa(){const _0x2597b6=['638650nRguce','confirm','6211272pZgNag','No\x20undeleted\x20dataset\x20found\x20for\x20','Delete\x20dataset\x20metadata\x20by\x20id/code\x20or\x20all\x20datasets\x20under\x20a\x20db\x20id','expected-count','push','2084DANiHS','Abort\x20unless\x20the\x20matched\x20dataset\x20count\x20equals\x20this\x20value','dataset','dbid=','isArray','--confirm\x20is\x20required\x20to\x20delete\x20datasets.','map','\x20dataset(s);\x20','boolean','Would\x20delete\x20','38496MlDLCI','validation','/smartapi/dataset/delete-dataset','344XbqkJT','num','Dataset\x20id','Use\x20only\x20one\x20of\x20--id,\x20--code,\x20or\x20--dbid.','Matched\x20','224744VSVjQD','10vBUhCI','Delete\x20all\x20datasets\x20under\x20this\x20database\x20connection\x20id','tableName','appCode','dbId','One\x20of\x20--id,\x20--code,\x20or\x20--dbid\x20is\x20required.','relationPages','code','filter','63emPCPO','source','str','length','dbid','name','dbtableConfig','\x20dataset(s),\x20but\x20--expected-count\x20is\x20','659NPAkuB','1565829azYDSP','number','high-risk-write','\x20failed','35219349fjoQuL','POST','id='];a62_0x24aa=function(){return _0x2597b6;};return a62_0x24aa();}function a62_0x1fbe(_0x5541ba,_0x3beaf8){_0x5541ba=_0x5541ba-0xcc;const _0x24aa90=a62_0x24aa();let _0x1fbe07=_0x24aa90[_0x5541ba];return _0x1fbe07;}export const datasetDelete={'service':a62_0x862665(0xce),'command':'delete','description':a62_0x862665(0xfc),'risk':a62_0x862665(0xf3),'flags':[DATASET_ID_FLAG,CODE_FLAG_OPTIONAL,DBID_FLAG,CONFIRM_FLAG,EXPECTED_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0xf9732a){const _0x1bffe9=a62_0x862665,_0x14cb15=_0xf9732a['num']('id'),_0x32dcc2=_0xf9732a[_0x1bffe9(0xea)](_0x1bffe9(0xe6)),_0x489ab9=_0xf9732a[_0x1bffe9(0xda)]('dbid'),_0x375e7f=[_0x14cb15>0x0,Boolean(_0x32dcc2),_0x489ab9>0x0][_0x1bffe9(0xe7)](Boolean);if(_0x375e7f[_0x1bffe9(0xeb)]===0x0)throw CliErrors['validation'](_0x1bffe9(0xe4));if(_0x375e7f[_0x1bffe9(0xeb)]>0x1)throw CliErrors['validation'](_0x1bffe9(0xdc));},async 'dryRun'(_0x16b713){const _0x2a399b=a62_0x862665,_0x4e2167=await resolveTargets(_0x16b713);return{'method':_0x2a399b(0xf6),'url':_0x2a399b(0xd8),'body':{'appCode':_0x16b713[_0x2a399b(0xe2)],'count':_0x4e2167['length'],'datasets':_0x4e2167},'description':_0x2a399b(0xd5)+_0x4e2167['length']+'\x20dataset(s).\x20This\x20only\x20deletes\x20platform\x20dataset\x20metadata\x20and\x20related\x20page/menu\x20records,\x20not\x20physical\x20databases\x20or\x20tables.'};},async 'execute'(_0x34781a){const _0x35ec48=a62_0x862665;if(!_0x34781a['bool'](_0x35ec48(0xf9)))throw CliErrors[_0x35ec48(0xd7)](_0x35ec48(0xd1),'Run\x20with\x20--dry-run\x20first,\x20then\x20add\x20--confirm\x20when\x20the\x20target\x20list\x20is\x20correct.');const _0x34c86f=await resolveTargets(_0x34781a),_0x5f1409=[],_0x16f60c=[];for(const _0x532fd0 of _0x34c86f){try{await deleteDataset(_0x34781a[_0x35ec48(0xe2)],_0x532fd0['id']),_0x5f1409[_0x35ec48(0xfe)](_0x532fd0);}catch(_0xb09daa){_0x16f60c[_0x35ec48(0xfe)]({..._0x532fd0,'error':_0xb09daa instanceof Error?_0xb09daa['message']:String(_0xb09daa)});}}if(_0x16f60c['length']>0x0)return{'ok':![],'data':{'requested':_0x34c86f[_0x35ec48(0xeb)],'deletedCount':_0x5f1409[_0x35ec48(0xeb)],'failedCount':_0x16f60c[_0x35ec48(0xeb)],'deleted':_0x5f1409,'failed':_0x16f60c},'message':'Deleted\x20'+_0x5f1409[_0x35ec48(0xeb)]+'/'+_0x34c86f[_0x35ec48(0xeb)]+_0x35ec48(0xd3)+_0x16f60c[_0x35ec48(0xeb)]+_0x35ec48(0xf4)};return{'ok':!![],'data':{'requested':_0x34c86f[_0x35ec48(0xeb)],'deletedCount':_0x5f1409[_0x35ec48(0xeb)],'deleted':_0x5f1409},'message':'Deleted\x20'+_0x5f1409[_0x35ec48(0xeb)]+'\x20dataset(s)'};}};async function resolveTargets(_0x3bd582){const _0x356add=a62_0x862665,_0x21ba0b=_0x3bd582[_0x356add(0xda)]('id'),_0x4de895=_0x3bd582[_0x356add(0xea)](_0x356add(0xe6)),_0x502f0e=_0x3bd582[_0x356add(0xda)](_0x356add(0xec));let _0x57d7d1;_0x4de895?(_0x57d7d1=await listDatasets(_0x3bd582[_0x356add(0xe2)],{'code':_0x4de895}),_0x57d7d1=_0x57d7d1['filter'](_0x3dbce6=>_0x3dbce6[_0x356add(0xe6)]===_0x4de895)):(_0x57d7d1=await listDatasets(_0x3bd582['appCode']),_0x21ba0b>0x0&&(_0x57d7d1=_0x57d7d1[_0x356add(0xe7)](_0x39cd7c=>_0x39cd7c['id']===_0x21ba0b)),_0x502f0e>0x0&&(_0x57d7d1=_0x57d7d1[_0x356add(0xe7)](_0x5b16bf=>_0x5b16bf[_0x356add(0xee)]?.[_0x356add(0xe3)]===_0x502f0e)));const _0x1b05b5=_0x57d7d1[_0x356add(0xd2)](normalizeTarget);if(_0x1b05b5['length']===0x0){const _0x56e333=_0x4de895||(_0x21ba0b>0x0?_0x356add(0xf7)+_0x21ba0b:_0x356add(0xcf)+_0x502f0e);throw CliErrors[_0x356add(0xd7)](_0x356add(0xfb)+_0x56e333+'.');}const _0x20c4fb=_0x3bd582[_0x356add(0xda)](_0x356add(0xfd));if(_0x20c4fb>0x0&&_0x1b05b5[_0x356add(0xeb)]!==_0x20c4fb)throw CliErrors[_0x356add(0xd7)](_0x356add(0xdd)+_0x1b05b5['length']+_0x356add(0xef)+_0x20c4fb+'.');return _0x1b05b5;}function normalizeTarget(_0x38a1b0){const _0x388766=a62_0x862665,_0x42b589=_0x38a1b0[_0x388766(0xee)]??{};return{'id':_0x38a1b0['id'],'code':_0x38a1b0['code'],'name':_0x38a1b0[_0x388766(0xed)],'description':_0x38a1b0['description'],'source':_0x38a1b0[_0x388766(0xe9)],'dbId':_0x42b589['dbId'],'dbName':_0x42b589['dbName'],'tableName':_0x42b589[_0x388766(0xe1)],'relatedPageCount':Array[_0x388766(0xd0)](_0x38a1b0[_0x388766(0xe5)])?_0x38a1b0[_0x388766(0xe5)][_0x388766(0xeb)]:undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a63_0x3b2869=a63_0xe3ca;(function(_0x2243df,_0x29e8e7){const _0x593c36=a63_0xe3ca,_0x214647=_0x2243df();while(!![]){try{const _0x4967b9=parseInt(_0x593c36(0x144))/0x1+-parseInt(_0x593c36(0x165))/0x2*(parseInt(_0x593c36(0x186))/0x3)+-parseInt(_0x593c36(0x143))/0x4*(-parseInt(_0x593c36(0x171))/0x5)+-parseInt(_0x593c36(0x17a))/0x6*(-parseInt(_0x593c36(0x167))/0x7)+parseInt(_0x593c36(0x163))/0x8+parseInt(_0x593c36(0x159))/0x9+parseInt(_0x593c36(0x162))/0xa*(-parseInt(_0x593c36(0x13b))/0xb);if(_0x4967b9===_0x29e8e7)break;else _0x214647['push'](_0x214647['shift']());}catch(_0x1e1ac1){_0x214647['push'](_0x214647['shift']());}}}(a63_0x2d7f,0xa71af));function a63_0x2d7f(){const _0x21a5eb=['properties','dbType','modifierNameField','260435jZAWvE','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically','dblinkInfoDTO','updateTimeField','creatorIdField','dbId','string','toFieldLabel','indexes','30sFTjqO','beforeScriptId','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','read','trim','method','str','description','pkField','extend','toTableName','afterScriptId','24DveqZf','columnCodeListWithDeleted','dbName','createTimeField','title','type','toField','parse','deprecated','sourceType','split','entries','2643388gRYcao','filter','modelCode','code','tableName','source','fields','requestFields','28NtJrei','25362vvdSQK','doType','required','displayName','options','deleted','labelField','validateRules','fromField','allFields','datasetKey','length','relations','cardinality','relatedPageInfoList','bizRelationType','path','map','logicField','name','responseBody','5082768jnHRWB','modelId','detail','object','formatRules','allFieldNames','requestBody','operations','host','10PdyAOA','6704840djSRFy','responseFields','341548YthnLg','push','697389OuQLZu','main_sub','dataset','alias','dataType','tableComment','isArray'];a63_0x2d7f=function(){return _0x21a5eb;};return a63_0x2d7f();}import{getDatasetDetail}from'../../core/api-client.js';import{CODE_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function normalizeField(_0x3fb96e){const _0x593327=a63_0xe3ca;if(_0x3fb96e[_0x593327(0x149)])return null;const _0x585b74=Boolean(_0x3fb96e['displayName']!==undefined||_0x3fb96e[_0x593327(0x145)]!==undefined);let _0x43f9d2={};if(!_0x585b74&&typeof _0x3fb96e[_0x593327(0x183)]===_0x593327(0x177))try{_0x43f9d2=JSON[_0x593327(0x18d)](_0x3fb96e[_0x593327(0x183)]);}catch{}const _0xb6c953=_0x585b74?_0x3fb96e[_0x593327(0x157)]:_0x3fb96e[_0x593327(0x13e)],_0x177212=_0x585b74?_0x3fb96e[_0x593327(0x147)]:_0x3fb96e[_0x593327(0x157)],_0x36f498=_0x585b74?_0x3fb96e[_0x593327(0x145)]:_0x3fb96e[_0x593327(0x18b)]||_0x3fb96e[_0x593327(0x16b)],_0x5d84a4=_0x585b74?_0x3fb96e['pkField']===!![]:_0x43f9d2[_0x593327(0x182)]===!![],_0x32032a=_0x585b74?_0x3fb96e[_0x593327(0x146)]===!![]:_0x43f9d2[_0x593327(0x146)]===!![],_0xd32d4f=_0x585b74?_0x3fb96e[_0x593327(0x148)]??null:_0x43f9d2['options']??null,_0x2b3d60={'name':_0xb6c953,'displayName':_0x177212||_0xb6c953,'type':_0x36f498,'dbType':_0x3fb96e[_0x593327(0x16f)],'pk':_0x5d84a4,'required':_0x32032a,'deprecated':_0x3fb96e[_0x593327(0x18e)]===!![],'description':_0x3fb96e[_0x593327(0x181)]||undefined};return Array[_0x593327(0x16d)](_0xd32d4f)&&_0xd32d4f[_0x593327(0x14f)]>0x0&&(_0x2b3d60[_0x593327(0x148)]=_0xd32d4f),_0x2b3d60;}function a63_0xe3ca(_0x35a5a1,_0x259442){_0x35a5a1=_0x35a5a1-0x139;const _0x2d7ffa=a63_0x2d7f();let _0xe3cac6=_0x2d7ffa[_0x35a5a1];return _0xe3cac6;}function parseJsonMaybe(_0x2579a1){const _0x7bf8bf=a63_0xe3ca;if(typeof _0x2579a1!==_0x7bf8bf(0x177))return _0x2579a1;try{return JSON[_0x7bf8bf(0x18d)](_0x2579a1);}catch{return _0x2579a1;}}function normalizeOperationEntry(_0x11779f,_0x10f569){const _0x514469=a63_0xe3ca;if(!_0x10f569||typeof _0x10f569!==_0x514469(0x15c))return null;if(!_0x10f569[_0x514469(0x17f)]||!_0x10f569[_0x514469(0x154)])return null;const _0x4b115a={'name':_0x11779f,'method':_0x10f569['method'],'path':_0x10f569[_0x514469(0x154)]};if(_0x10f569[_0x514469(0x161)])_0x4b115a[_0x514469(0x161)]=_0x10f569[_0x514469(0x161)];if(_0x10f569[_0x514469(0x15f)]!=null){const _0x26c986=parseJsonMaybe(_0x10f569[_0x514469(0x15f)]);_0x4b115a['requestBody']=_0x26c986;}if(_0x10f569[_0x514469(0x158)]!=null){const _0x265950=parseJsonMaybe(_0x10f569[_0x514469(0x158)]);_0x4b115a[_0x514469(0x158)]=_0x265950;}if(_0x10f569[_0x514469(0x17b)]!=null)_0x4b115a['beforeScriptId']=_0x10f569['beforeScriptId'];if(_0x10f569[_0x514469(0x185)]!=null)_0x4b115a[_0x514469(0x185)]=_0x10f569[_0x514469(0x185)];if(Array['isArray'](_0x10f569['requestFields']))_0x4b115a['requestFields']=_0x10f569[_0x514469(0x142)];if(Array[_0x514469(0x16d)](_0x10f569['responseFields']))_0x4b115a['responseFields']=_0x10f569[_0x514469(0x164)];return _0x4b115a;}function summarizeDbtable(_0x13b891){const _0x3d39a0=a63_0xe3ca,_0x35cfdb={},_0x468106=['dbId',_0x3d39a0(0x188),'tableName',_0x3d39a0(0x14e),_0x3d39a0(0x182),_0x3d39a0(0x14d),_0x3d39a0(0x156),_0x3d39a0(0x189),_0x3d39a0(0x174),_0x3d39a0(0x175),'creatorNameField','modifierIdField',_0x3d39a0(0x170),_0x3d39a0(0x14a),_0x3d39a0(0x173)];for(const _0x36d45a of _0x468106){if(_0x13b891[_0x36d45a]!==undefined)_0x35cfdb[_0x36d45a]=_0x13b891[_0x36d45a];}return typeof _0x35cfdb[_0x3d39a0(0x14d)]===_0x3d39a0(0x177)&&_0x35cfdb[_0x3d39a0(0x14d)][_0x3d39a0(0x14f)]>0x0&&(_0x35cfdb[_0x3d39a0(0x15e)]=_0x35cfdb['allFields'][_0x3d39a0(0x139)](',')[_0x3d39a0(0x155)](_0x8cefe=>_0x8cefe[_0x3d39a0(0x17e)]())[_0x3d39a0(0x13c)](Boolean)),_0x35cfdb;}function normalizeRelatedPages(_0x586bf2){const _0xce08b8=a63_0xe3ca;if(!Array['isArray'](_0x586bf2))return[];return _0x586bf2[_0xce08b8(0x13c)](_0x2a2a9e=>_0x2a2a9e&&typeof _0x2a2a9e==='object')[_0xce08b8(0x155)](_0x66a88f=>({'id':_0x66a88f['id'],'type':_0x66a88f['type'],'code':_0x66a88f[_0xce08b8(0x13e)],'title':_0x66a88f[_0xce08b8(0x18a)],'deleted':_0x66a88f[_0xce08b8(0x149)]===!![]}));}export const datasetDetail={'service':a63_0x3b2869(0x169),'command':a63_0x3b2869(0x15b),'description':a63_0x3b2869(0x17c),'risk':a63_0x3b2869(0x17d),'flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':a63_0x3b2869(0x16a),'type':a63_0x3b2869(0x177),'description':a63_0x3b2869(0x172)}],async 'execute'(_0x5a3cef){const _0x3ba02e=a63_0x3b2869,_0xe1166f=await getDatasetDetail(_0x5a3cef[_0x3ba02e(0x180)]('code')),_0x451e13=Array[_0x3ba02e(0x16d)](_0xe1166f[_0x3ba02e(0x141)])?_0xe1166f[_0x3ba02e(0x141)]:Array[_0x3ba02e(0x16d)](_0xe1166f[_0x3ba02e(0x16e)])?_0xe1166f[_0x3ba02e(0x16e)]:[],_0x5773ff=_0x451e13[_0x3ba02e(0x155)](_0x2555c0=>normalizeField(_0x2555c0))['filter'](_0x4f4015=>_0x4f4015!==null),_0x47b007=_0xe1166f[_0x3ba02e(0x160)]??{},_0x209ce4=[];for(const [_0x24d579,_0x8dd9a]of Object[_0x3ba02e(0x13a)](_0x47b007)){const _0x334bd2=normalizeOperationEntry(_0x24d579,_0x8dd9a);if(_0x334bd2)_0x209ce4[_0x3ba02e(0x166)](_0x334bd2);}const _0x115b8a=_0xe1166f['dbtableConfig']??{},_0xe99b12=_0xe1166f[_0x3ba02e(0x169)]??{},_0x1767ff=_0x115b8a[_0x3ba02e(0x176)]!=null?{'id':_0x115b8a[_0x3ba02e(0x176)],'name':_0x115b8a[_0x3ba02e(0x188)]??null}:undefined;let _0x35c944;return typeof _0xe1166f['extend']==='string'&&(_0x35c944=parseJsonMaybe(_0xe1166f[_0x3ba02e(0x183)])),{'ok':!![],'data':{'id':_0xe1166f[_0x3ba02e(0x15a)]??_0xe1166f['id'],'name':_0xe1166f[_0x3ba02e(0x157)],'code':_0xe1166f['modelCode']||_0xe1166f[_0x3ba02e(0x13e)],'doVersion':_0xe1166f['doVersion'],'description':_0xe1166f[_0x3ba02e(0x181)]||_0xe99b12[_0x3ba02e(0x16c)]||undefined,'source':_0xe1166f[_0x3ba02e(0x140)]||_0xe99b12[_0x3ba02e(0x18f)],'table':_0x115b8a[_0x3ba02e(0x13f)]||_0xe99b12[_0x3ba02e(0x13f)],'datasetKey':_0x115b8a[_0x3ba02e(0x14e)],'pk':_0x115b8a[_0x3ba02e(0x182)],'db':_0x1767ff,'dbtable':summarizeDbtable(_0x115b8a),'fields':_0x5773ff,'operations':_0x209ce4,'indexes':Array[_0x3ba02e(0x16d)](_0xe99b12['indexes'])?_0xe99b12[_0x3ba02e(0x179)]:[],'relations':Array[_0x3ba02e(0x16d)](_0xe1166f[_0x3ba02e(0x150)])?_0xe1166f[_0x3ba02e(0x150)][_0x3ba02e(0x155)](_0x5e35a3=>({..._0x5e35a3['relationId']!=null?{'relationId':_0x5e35a3['relationId']}:{},'fromDataset':_0xe1166f[_0x3ba02e(0x157)],'fromCode':_0xe1166f[_0x3ba02e(0x13d)]||_0xe1166f[_0x3ba02e(0x13e)],'fromTable':_0x115b8a[_0x3ba02e(0x13f)]||_0xe99b12[_0x3ba02e(0x13f)],'fromField':_0x5e35a3[_0x3ba02e(0x14c)],'toDataset':_0x5e35a3['toDatasetName'],'toCode':_0x5e35a3['toDatasetCode'],'toTable':_0x5e35a3[_0x3ba02e(0x184)],'toField':_0x5e35a3[_0x3ba02e(0x18c)],'labelField':_0x5e35a3[_0x3ba02e(0x178)]||undefined,'cardinality':_0x5e35a3[_0x3ba02e(0x151)]||undefined,'bizRelationType':_0x5e35a3[_0x3ba02e(0x153)]===_0x3ba02e(0x168)?_0x3ba02e(0x168):null})):[],'relatedPages':normalizeRelatedPages(_0xe1166f[_0x3ba02e(0x152)]),...Array['isArray'](_0xe1166f[_0x3ba02e(0x187)])?{'columnCodeListWithDeleted':_0xe1166f['columnCodeListWithDeleted']}:{},'formatRules':Array[_0x3ba02e(0x16d)](_0xe1166f[_0x3ba02e(0x15d)])?_0xe1166f[_0x3ba02e(0x15d)]:[],'validateRules':Array[_0x3ba02e(0x16d)](_0xe1166f[_0x3ba02e(0x14b)])?_0xe1166f['validateRules']:[],..._0x35c944!==undefined?{'extend':_0x35c944}:{},'stats':{'fieldCount':_0x5773ff[_0x3ba02e(0x14f)],'operationCount':_0x209ce4[_0x3ba02e(0x14f)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a64_0x35b0ce=a64_0x247a;function a64_0x440d(){const _0x2f5c64=['expect-json','614IlofOV','--patch-json','dataset\x20extend-update\x20does\x20not\x20support\x20businessGroup;\x20use\x20dataset\x20business-group-update','datasetName','patch-json','string','length','Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object','keys','--code\x20is\x20required','datasetCode','\x20must\x20be\x20valid\x20JSON\x20object:\x20','value','56gYDIcm','1318508GYmzCg','649tAwdgE','data','\x20must\x20be\x20a\x20JSON\x20object','1643845GTgcSn','6dZbvDS','from','Use\x20`rabetbase\x20dataset\x20business-group-update`\x20to\x20update\x20business\x20model\x20groups.','565FOobgJ','extend-update','hint','extend.','modelId','/smartapi/dataset/update-driven-data','trim','validation','186753RjKHyQ','No\x20dataset\x20extend\x20patch\x20keys\x20are\x20currently\x20supported.','sort','isArray','Patch\x20dataset\x20top-level\x20extend\x20safely','Unsupported\x20patch\x20key:\x20','code','195036GhTJqE','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','shape','message','join','576015vgHtlx','write','entries','patch','expect','stringify','push','object','JSON\x20object\x20patch\x20for\x20dataset\x20top-level\x20extend;\x20current\x20allowlist\x20is\x20empty','parse','name','Expected\x20','modelCode','2870QursMR','Dry-run:\x20dataset\x20extend\x20would\x20change\x20(','extend','JSON\x20object\x20of\x20expected\x20current\x20extend\x20values;\x20mismatch\x20aborts\x20without\x20writing','1593PkMfAl','Updated\x20dataset\x20extend\x20(','appCode','has','dataset','dbtableConfig','str','dbId'];a64_0x440d=function(){return _0x2f5c64;};return a64_0x440d();}(function(_0x21a6b0,_0x372619){const _0x360085=a64_0x247a,_0x164069=_0x21a6b0();while(!![]){try{const _0x597360=-parseInt(_0x360085(0x1b4))/0x1*(parseInt(_0x360085(0x1e2))/0x2)+parseInt(_0x360085(0x1c8))/0x3+-parseInt(_0x360085(0x1f0))/0x4+-parseInt(_0x360085(0x1f4))/0x5*(parseInt(_0x360085(0x1f5))/0x6)+-parseInt(_0x360085(0x1bc))/0x7*(parseInt(_0x360085(0x1ef))/0x8)+parseInt(_0x360085(0x1d9))/0x9*(parseInt(_0x360085(0x1d5))/0xa)+-parseInt(_0x360085(0x1f1))/0xb*(-parseInt(_0x360085(0x1c3))/0xc);if(_0x597360===_0x372619)break;else _0x164069['push'](_0x164069['shift']());}catch(_0x469196){_0x164069['push'](_0x164069['shift']());}}}(a64_0x440d,0x2cb57));function a64_0x247a(_0xca0ee,_0x364718){_0xca0ee=_0xca0ee-0x1b4;const _0x440dc6=a64_0x440d();let _0x247a9f=_0x440dc6[_0xca0ee];return _0x247a9f;}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([['businessGroup',{'message':a64_0x35b0ce(0x1e4),'hint':a64_0x35b0ce(0x1f7)}]]);export function parseJsonObjectFlag(_0x92de40,_0x109645){const _0x4310d5=a64_0x35b0ce;if(!_0x92de40)return undefined;let _0x493954;try{_0x493954=JSON['parse'](_0x92de40);}catch(_0x270559){const _0x4d9335=_0x270559 instanceof Error?_0x270559[_0x4310d5(0x1c6)]:String(_0x270559);throw CliErrors[_0x4310d5(0x1bb)](_0x109645+_0x4310d5(0x1ed)+_0x4d9335);}if(!isPlainObject(_0x493954)||Array[_0x4310d5(0x1bf)](_0x493954))throw CliErrors['validation'](_0x109645+_0x4310d5(0x1f3));return _0x493954;}export function validateExtendPatchKeys(_0x4e6f91){const _0x40f453=a64_0x35b0ce,_0x51e64a=Object[_0x40f453(0x1ea)](_0x4e6f91);if(_0x51e64a[_0x40f453(0x1e8)]===0x0)throw CliErrors['validation'](_0x40f453(0x1c4));for(const _0xaf64e3 of _0x51e64a){const _0x1aa6ca=EXTEND_PATCH_REDIRECTS['get'](_0xaf64e3);if(_0x1aa6ca)throw CliErrors[_0x40f453(0x1bb)](_0x1aa6ca[_0x40f453(0x1c6)],_0x1aa6ca[_0x40f453(0x1b6)]);if(!MUTABLE_EXTEND_KEYS[_0x40f453(0x1dc)](_0xaf64e3))throw CliErrors[_0x40f453(0x1bb)](_0x40f453(0x1c1)+_0xaf64e3,describeMutableExtendKeys());}}function describeMutableExtendKeys(){const _0x13b337=a64_0x35b0ce,_0x239ae8=Array[_0x13b337(0x1f6)](MUTABLE_EXTEND_KEYS)[_0x13b337(0x1be)]();return _0x239ae8[_0x13b337(0x1e8)]>0x0?'Allowed\x20keys:\x20'+_0x239ae8[_0x13b337(0x1c7)](',\x20'):_0x13b337(0x1bd);}export function applyExtendPatch(_0x41ca29,_0x4663e5){const _0x38bedc=a64_0x35b0ce;validateExtendPatchKeys(_0x4663e5);const _0x203cc2=deepClone(_0x41ca29),_0x2cf0aa=[];for(const [_0x2c3b7e,_0x2c4382]of Object[_0x38bedc(0x1ca)](_0x4663e5)){const _0x35318b=_0x203cc2[_0x2c3b7e],_0x22abb8=deepClone(_0x2c4382);!deepEqual(_0x35318b,_0x22abb8)&&(_0x203cc2[_0x2c3b7e]=_0x22abb8,_0x2cf0aa[_0x38bedc(0x1ce)](_0x38bedc(0x1b7)+_0x2c3b7e));}return _0x2cf0aa[_0x38bedc(0x1be)](),{'after':_0x203cc2,'changedPaths':_0x2cf0aa,'changed':_0x2cf0aa[_0x38bedc(0x1e8)]>0x0};}export function assertExpectation(_0x1d210c,_0x54a0e5){const _0xaf8749=a64_0x35b0ce;if(!_0x54a0e5)return;for(const [_0x2c8a4a,_0x5b5690]of Object[_0xaf8749(0x1ca)](_0x54a0e5)){const _0x4925bd=_0x1d210c[_0x2c8a4a];if(!deepEqual(_0x4925bd,_0x5b5690))throw CliErrors[_0xaf8749(0x1bb)]('Expectation\x20mismatch\x20at\x20extend.'+_0x2c8a4a,_0xaf8749(0x1d3)+JSON[_0xaf8749(0x1cd)](_0x5b5690)+',\x20actual\x20'+JSON[_0xaf8749(0x1cd)](_0x4925bd));}}export async function buildDatasetExtendUpdateResult({appCode:_0x4b8156,input:_0x459827,dryRun:_0x1db283}){const _0x4f1c41=a64_0x35b0ce;validateInput(_0x459827);const _0x5c80b2=await getDatasetDetail(_0x459827[_0x4f1c41(0x1c2)]),_0x1355cc=parseDatasetExtend(_0x5c80b2[_0x4f1c41(0x1d7)]),_0x273bfd=deepClone(_0x1355cc[_0x4f1c41(0x1ee)]);assertExpectation(_0x273bfd,_0x459827[_0x4f1c41(0x1cc)]);const {after:_0x39e49d,changedPaths:_0x38e52e,changed:_0xaaef5d}=applyExtendPatch(_0x273bfd,_0x459827[_0x4f1c41(0x1cb)]),_0x6a922=summarizeDataset(_0x5c80b2,_0x459827['code']);return _0xaaef5d&&!_0x1db283&&(_0x5c80b2[_0x4f1c41(0x1d7)]=serializeDatasetExtend(_0x39e49d,_0x1355cc[_0x4f1c41(0x1c5)]),await updateDrivenData(_0x5c80b2)),{'ok':!![],'data':{'appCode':_0x4b8156,'selector':{'code':_0x459827[_0x4f1c41(0x1c2)]},'dataset':_0x6a922,'dryRun':_0x1db283,'changed':_0xaaef5d,'changedPaths':_0x38e52e,'before':{'extend':_0x273bfd},'after':{'extend':_0x39e49d},'submitted':_0xaaef5d&&!_0x1db283},'message':_0xaaef5d?_0x1db283?_0x4f1c41(0x1d6)+_0x38e52e[_0x4f1c41(0x1c7)](',\x20')+')':_0x4f1c41(0x1da)+_0x38e52e[_0x4f1c41(0x1c7)](',\x20')+')':'No\x20changes\x20for\x20dataset\x20extend'};}export const datasetExtendUpdate={'service':a64_0x35b0ce(0x1dd),'command':a64_0x35b0ce(0x1b5),'description':a64_0x35b0ce(0x1c0),'risk':a64_0x35b0ce(0x1c9),'flags':[CODE_FLAG,{'name':a64_0x35b0ce(0x1e6),'type':'string','required':!![],'description':a64_0x35b0ce(0x1d0)},{'name':a64_0x35b0ce(0x1e1),'type':a64_0x35b0ce(0x1e7),'required':![],'description':a64_0x35b0ce(0x1d8)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x29a5f5){validateInput(readExtendUpdateInput(_0x29a5f5));},async 'dryRun'(_0x510907){const _0xe1bc97=a64_0x35b0ce,_0x50ea19=await buildDatasetExtendUpdateResult({'appCode':_0x510907[_0xe1bc97(0x1db)],'input':readExtendUpdateInput(_0x510907),'dryRun':!![]});return{'method':'POST','url':_0xe1bc97(0x1b9),'body':_0x50ea19[_0xe1bc97(0x1f2)],'description':_0x50ea19[_0xe1bc97(0x1c6)]};},async 'execute'(_0x364b6e){const _0x1fba35=a64_0x35b0ce;return buildDatasetExtendUpdateResult({'appCode':_0x364b6e[_0x1fba35(0x1db)],'input':readExtendUpdateInput(_0x364b6e),'dryRun':![]});}};function readExtendUpdateInput(_0x1fdff9){const _0x5807b0=a64_0x35b0ce,_0x1b7b71=trim(_0x1fdff9['str'](_0x5807b0(0x1c2))),_0x109f6a=parseJsonObjectFlag(_0x1fdff9[_0x5807b0(0x1df)](_0x5807b0(0x1e6)),_0x5807b0(0x1e3)),_0x168256=parseJsonObjectFlag(_0x1fdff9[_0x5807b0(0x1df)](_0x5807b0(0x1e1)),'--expect-json');return{'code':_0x1b7b71,'patch':_0x109f6a||{},'expect':_0x168256};}function validateInput(_0x5d06a2){const _0xec08e6=a64_0x35b0ce;if(!_0x5d06a2[_0xec08e6(0x1c2)])throw CliErrors['validation'](_0xec08e6(0x1eb));validateExtendPatchKeys(_0x5d06a2[_0xec08e6(0x1cb)]);}function parseDatasetExtend(_0xb74034){const _0x576b93=a64_0x35b0ce;if(typeof _0xb74034===_0x576b93(0x1e7)){const _0x46bf99=_0xb74034[_0x576b93(0x1ba)]();if(!_0x46bf99)return{'value':{},'shape':_0x576b93(0x1e7)};let _0x45d202;try{_0x45d202=JSON[_0x576b93(0x1d1)](_0x46bf99);}catch(_0x355f70){const _0x5f2f14=_0x355f70 instanceof Error?_0x355f70['message']:String(_0x355f70);throw CliErrors[_0x576b93(0x1bb)]('Dataset\x20extend\x20must\x20be\x20valid\x20JSON\x20object:\x20'+_0x5f2f14);}if(!isPlainObject(_0x45d202)||Array[_0x576b93(0x1bf)](_0x45d202))throw CliErrors[_0x576b93(0x1bb)]('Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object');return{'value':_0x45d202,'shape':_0x576b93(0x1e7)};}if(_0xb74034===undefined||_0xb74034===null)return{'value':{},'shape':_0x576b93(0x1e7)};if(!isPlainObject(_0xb74034)||Array[_0x576b93(0x1bf)](_0xb74034))throw CliErrors['validation'](_0x576b93(0x1e9));return{'value':_0xb74034,'shape':'object'};}function serializeDatasetExtend(_0x25774a,_0x57368f){return _0x57368f==='string'?JSON['stringify'](_0x25774a):_0x25774a;}function summarizeDataset(_0x2edf0c,_0x1a358c){const _0x20b979=a64_0x35b0ce,_0x5d4827=isPlainObject(_0x2edf0c[_0x20b979(0x1dd)])?_0x2edf0c[_0x20b979(0x1dd)]:{},_0x5e0ce4=isPlainObject(_0x2edf0c[_0x20b979(0x1de)])?_0x2edf0c[_0x20b979(0x1de)]:{};return{'id':_0x2edf0c[_0x20b979(0x1b8)]??_0x2edf0c['id']??_0x5d4827['datasetId']??null,'code':_0x2edf0c[_0x20b979(0x1d4)]??_0x2edf0c[_0x20b979(0x1c2)]??_0x5d4827[_0x20b979(0x1ec)]??_0x1a358c,'name':_0x2edf0c[_0x20b979(0x1d2)]??_0x5d4827[_0x20b979(0x1e5)]??null,'table':_0x5e0ce4['tableName']??_0x5d4827['tableName']??null,'db':_0x5e0ce4['dbName']??_0x5e0ce4[_0x20b979(0x1e0)]??null};}function deepClone(_0x36e3e7){const _0x2e7656=a64_0x35b0ce;if(_0x36e3e7===undefined)return _0x36e3e7;return JSON[_0x2e7656(0x1d1)](JSON[_0x2e7656(0x1cd)](_0x36e3e7));}function deepEqual(_0x399286,_0x2225f6){const _0x4c5faa=a64_0x35b0ce;return JSON[_0x4c5faa(0x1cd)](_0x399286)===JSON[_0x4c5faa(0x1cd)](_0x2225f6);}function isPlainObject(_0x2d6d90){const _0x5ad6af=a64_0x35b0ce;return Boolean(_0x2d6d90)&&typeof _0x2d6d90===_0x5ad6af(0x1cf)&&!Array[_0x5ad6af(0x1bf)](_0x2d6d90);}function trim(_0xd331bc){const _0x4edb7d=String(_0xd331bc||'')['trim']();return _0x4edb7d;}
|
|
1
|
+
const a64_0x46f951=a64_0xc08f;(function(_0x20c5a2,_0x36d08d){const _0x5a1616=a64_0xc08f,_0x3703f5=_0x20c5a2();while(!![]){try{const _0x1c90d0=-parseInt(_0x5a1616(0xd1))/0x1*(-parseInt(_0x5a1616(0xf5))/0x2)+-parseInt(_0x5a1616(0xfe))/0x3+-parseInt(_0x5a1616(0xdb))/0x4+parseInt(_0x5a1616(0xce))/0x5*(-parseInt(_0x5a1616(0xcd))/0x6)+parseInt(_0x5a1616(0xf9))/0x7+-parseInt(_0x5a1616(0xe7))/0x8*(-parseInt(_0x5a1616(0xc8))/0x9)+-parseInt(_0x5a1616(0xd8))/0xa*(-parseInt(_0x5a1616(0xf0))/0xb);if(_0x1c90d0===_0x36d08d)break;else _0x3703f5['push'](_0x3703f5['shift']());}catch(_0x1f8e07){_0x3703f5['push'](_0x3703f5['shift']());}}}(a64_0x431b,0x75bd2));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([[a64_0x46f951(0xd5),{'message':a64_0x46f951(0xf8),'hint':a64_0x46f951(0xdc)}]]);export function parseJsonObjectFlag(_0x13cc28,_0x574a37){const _0x493c10=a64_0x46f951;if(!_0x13cc28)return undefined;let _0x2de2ce;try{_0x2de2ce=JSON['parse'](_0x13cc28);}catch(_0x553f15){const _0x130ec1=_0x553f15 instanceof Error?_0x553f15[_0x493c10(0xe2)]:String(_0x553f15);throw CliErrors['validation'](_0x574a37+'\x20must\x20be\x20valid\x20JSON\x20object:\x20'+_0x130ec1);}if(!isPlainObject(_0x2de2ce)||Array[_0x493c10(0xde)](_0x2de2ce))throw CliErrors[_0x493c10(0xda)](_0x574a37+'\x20must\x20be\x20a\x20JSON\x20object');return _0x2de2ce;}export function validateExtendPatchKeys(_0x42f18c){const _0xd64269=a64_0x46f951,_0x5983ce=Object[_0xd64269(0xe0)](_0x42f18c);if(_0x5983ce['length']===0x0)throw CliErrors[_0xd64269(0xda)](_0xd64269(0xe4));for(const _0x13250a of _0x5983ce){const _0x456898=EXTEND_PATCH_REDIRECTS[_0xd64269(0xeb)](_0x13250a);if(_0x456898)throw CliErrors[_0xd64269(0xda)](_0x456898[_0xd64269(0xe2)],_0x456898[_0xd64269(0xf1)]);if(!MUTABLE_EXTEND_KEYS[_0xd64269(0xed)](_0x13250a))throw CliErrors[_0xd64269(0xda)](_0xd64269(0xd3)+_0x13250a,describeMutableExtendKeys());}}function describeMutableExtendKeys(){const _0x4a3777=a64_0x46f951,_0x232a74=Array[_0x4a3777(0xf3)](MUTABLE_EXTEND_KEYS)[_0x4a3777(0xfa)]();return _0x232a74['length']>0x0?_0x4a3777(0x100)+_0x232a74[_0x4a3777(0xd2)](',\x20'):_0x4a3777(0xc7);}export function applyExtendPatch(_0x2fd25c,_0x37967a){const _0x4e02be=a64_0x46f951;validateExtendPatchKeys(_0x37967a);const _0x294af8=deepClone(_0x2fd25c),_0x11c81c=[];for(const [_0x29dbef,_0x29f04c]of Object[_0x4e02be(0xd6)](_0x37967a)){const _0x108d6f=_0x294af8[_0x29dbef],_0xa04377=deepClone(_0x29f04c);!deepEqual(_0x108d6f,_0xa04377)&&(_0x294af8[_0x29dbef]=_0xa04377,_0x11c81c['push'](_0x4e02be(0xd7)+_0x29dbef));}return _0x11c81c[_0x4e02be(0xfa)](),{'after':_0x294af8,'changedPaths':_0x11c81c,'changed':_0x11c81c['length']>0x0};}export function assertExpectation(_0x40e5df,_0x39547f){const _0x432ff9=a64_0x46f951;if(!_0x39547f)return;for(const [_0x7337bf,_0x280328]of Object[_0x432ff9(0xd6)](_0x39547f)){const _0x2eebb2=_0x40e5df[_0x7337bf];if(!deepEqual(_0x2eebb2,_0x280328))throw CliErrors[_0x432ff9(0xda)](_0x432ff9(0xc4)+_0x7337bf,_0x432ff9(0xdf)+JSON[_0x432ff9(0xd0)](_0x280328)+_0x432ff9(0xff)+JSON[_0x432ff9(0xd0)](_0x2eebb2));}}function a64_0xc08f(_0x13ce02,_0x1fec71){_0x13ce02=_0x13ce02-0xc4;const _0x431b76=a64_0x431b();let _0xc08f00=_0x431b76[_0x13ce02];return _0xc08f00;}export async function buildDatasetExtendUpdateResult({appCode:_0x556a1d,input:_0x272133,dryRun:_0x2d8a01}){const _0x3970c4=a64_0x46f951;validateInput(_0x272133);const _0x5bf401=await getDatasetDetail(_0x272133['code']),_0x22e35f=parseDatasetExtend(_0x5bf401[_0x3970c4(0xc9)]),_0x566c5b=deepClone(_0x22e35f[_0x3970c4(0xf6)]);assertExpectation(_0x566c5b,_0x272133[_0x3970c4(0xe5)]);const {after:_0x45693d,changedPaths:_0xb755d3,changed:_0x4ceba5}=applyExtendPatch(_0x566c5b,_0x272133['patch']),_0x1f706d=summarizeDataset(_0x5bf401,_0x272133[_0x3970c4(0xfc)]);return _0x4ceba5&&!_0x2d8a01&&(_0x5bf401[_0x3970c4(0xc9)]=serializeDatasetExtend(_0x45693d,_0x22e35f[_0x3970c4(0x102)]),await updateDrivenData(_0x5bf401)),{'ok':!![],'data':{'appCode':_0x556a1d,'selector':{'code':_0x272133[_0x3970c4(0xfc)]},'dataset':_0x1f706d,'dryRun':_0x2d8a01,'changed':_0x4ceba5,'changedPaths':_0xb755d3,'before':{'extend':_0x566c5b},'after':{'extend':_0x45693d},'submitted':_0x4ceba5&&!_0x2d8a01},'message':_0x4ceba5?_0x2d8a01?_0x3970c4(0xfb)+_0xb755d3['join'](',\x20')+')':'Updated\x20dataset\x20extend\x20('+_0xb755d3['join'](',\x20')+')':_0x3970c4(0xfd)};}export const datasetExtendUpdate={'service':a64_0x46f951(0xf4),'command':'extend-update','description':'Patch\x20dataset\x20top-level\x20extend\x20safely','risk':a64_0x46f951(0xcb),'flags':[CODE_FLAG,{'name':a64_0x46f951(0xf7),'type':'string','required':!![],'description':a64_0x46f951(0xef)},{'name':'expect-json','type':a64_0x46f951(0xe1),'required':![],'description':'JSON\x20object\x20of\x20expected\x20current\x20extend\x20values;\x20mismatch\x20aborts\x20without\x20writing'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x41eca1){validateInput(readExtendUpdateInput(_0x41eca1));},async 'dryRun'(_0x9a84cc){const _0x26c75a=a64_0x46f951,_0xa028b2=await buildDatasetExtendUpdateResult({'appCode':_0x9a84cc['appCode'],'input':readExtendUpdateInput(_0x9a84cc),'dryRun':!![]});return{'method':'POST','url':_0x26c75a(0xf2),'body':_0xa028b2[_0x26c75a(0xc6)],'description':_0xa028b2[_0x26c75a(0xe2)]};},async 'execute'(_0x5b5604){return buildDatasetExtendUpdateResult({'appCode':_0x5b5604['appCode'],'input':readExtendUpdateInput(_0x5b5604),'dryRun':![]});}};function readExtendUpdateInput(_0x10260f){const _0x39a3d9=a64_0x46f951,_0xb3afc=trim(_0x10260f[_0x39a3d9(0xea)](_0x39a3d9(0xfc))),_0x5288cb=parseJsonObjectFlag(_0x10260f['str']('patch-json'),_0x39a3d9(0xe8)),_0xd6698f=parseJsonObjectFlag(_0x10260f['str'](_0x39a3d9(0xd4)),_0x39a3d9(0xe9));return{'code':_0xb3afc,'patch':_0x5288cb||{},'expect':_0xd6698f};}function validateInput(_0x2cfe7e){const _0x5b9577=a64_0x46f951;if(!_0x2cfe7e[_0x5b9577(0xfc)])throw CliErrors['validation'](_0x5b9577(0xcf));validateExtendPatchKeys(_0x2cfe7e[_0x5b9577(0xe3)]);}function parseDatasetExtend(_0x1ef860){const _0x2b00d5=a64_0x46f951;if(typeof _0x1ef860===_0x2b00d5(0xe1)){const _0x36a7f6=_0x1ef860[_0x2b00d5(0xca)]();if(!_0x36a7f6)return{'value':{},'shape':_0x2b00d5(0xe1)};let _0x188cd3;try{_0x188cd3=JSON[_0x2b00d5(0x101)](_0x36a7f6);}catch(_0x1f655f){const _0xf11f5=_0x1f655f instanceof Error?_0x1f655f[_0x2b00d5(0xe2)]:String(_0x1f655f);throw CliErrors[_0x2b00d5(0xda)]('Dataset\x20extend\x20must\x20be\x20valid\x20JSON\x20object:\x20'+_0xf11f5);}if(!isPlainObject(_0x188cd3)||Array[_0x2b00d5(0xde)](_0x188cd3))throw CliErrors[_0x2b00d5(0xda)](_0x2b00d5(0xe6));return{'value':_0x188cd3,'shape':_0x2b00d5(0xe1)};}if(_0x1ef860===undefined||_0x1ef860===null)return{'value':{},'shape':_0x2b00d5(0xe1)};if(!isPlainObject(_0x1ef860)||Array[_0x2b00d5(0xde)](_0x1ef860))throw CliErrors['validation'](_0x2b00d5(0xe6));return{'value':_0x1ef860,'shape':_0x2b00d5(0xc5)};}function serializeDatasetExtend(_0x1c62af,_0x22ab98){const _0xccaff3=a64_0x46f951;return _0x22ab98===_0xccaff3(0xe1)?JSON[_0xccaff3(0xd0)](_0x1c62af):_0x1c62af;}function summarizeDataset(_0x4bba0b,_0x111d34){const _0x5e2c28=a64_0x46f951,_0x13be3d=isPlainObject(_0x4bba0b[_0x5e2c28(0xf4)])?_0x4bba0b[_0x5e2c28(0xf4)]:{},_0xba94d2=isPlainObject(_0x4bba0b[_0x5e2c28(0xdd)])?_0x4bba0b[_0x5e2c28(0xdd)]:{};return{'id':_0x4bba0b[_0x5e2c28(0xd9)]??_0x4bba0b['id']??_0x13be3d['datasetId']??null,'code':_0x4bba0b['modelCode']??_0x4bba0b[_0x5e2c28(0xfc)]??_0x13be3d[_0x5e2c28(0xcc)]??_0x111d34,'name':_0x4bba0b[_0x5e2c28(0xec)]??_0x13be3d['datasetName']??null,'table':_0xba94d2['tableName']??_0x13be3d['tableName']??null,'db':_0xba94d2[_0x5e2c28(0xee)]??_0xba94d2['dbId']??null};}function deepClone(_0x5c8e16){const _0x29561c=a64_0x46f951;if(_0x5c8e16===undefined)return _0x5c8e16;return JSON['parse'](JSON[_0x29561c(0xd0)](_0x5c8e16));}function a64_0x431b(){const _0x24e67a=['No\x20dataset\x20extend\x20patch\x20keys\x20are\x20currently\x20supported.','210465VUqYJa','extend','trim','write','datasetCode','71166YLOYYd','20GpULHa','--code\x20is\x20required','stringify','1511WCYLdy','join','Unsupported\x20patch\x20key:\x20','expect-json','businessGroup','entries','extend.','27250CoHSXv','modelId','validation','145788iumsEr','Use\x20`rabetbase\x20dataset\x20business-group-update`\x20to\x20update\x20business\x20model\x20groups.','dbtableConfig','isArray','Expected\x20','keys','string','message','patch','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','expect','Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object','296wboTKv','--patch-json','--expect-json','str','get','name','has','dbName','JSON\x20object\x20patch\x20for\x20dataset\x20top-level\x20extend;\x20current\x20allowlist\x20is\x20empty','33GDyJSJ','hint','/smartapi/dataset/update-driven-data','from','dataset','424SJTUyW','value','patch-json','dataset\x20extend-update\x20does\x20not\x20support\x20businessGroup;\x20use\x20dataset\x20business-group-update','750169UlfnWD','sort','Dry-run:\x20dataset\x20extend\x20would\x20change\x20(','code','No\x20changes\x20for\x20dataset\x20extend','2204310YkcuYa',',\x20actual\x20','Allowed\x20keys:\x20','parse','shape','Expectation\x20mismatch\x20at\x20extend.','object','data'];a64_0x431b=function(){return _0x24e67a;};return a64_0x431b();}function deepEqual(_0x4194b2,_0xfb52e1){const _0x51cee3=a64_0x46f951;return JSON[_0x51cee3(0xd0)](_0x4194b2)===JSON['stringify'](_0xfb52e1);}function isPlainObject(_0x51c811){const _0x145647=a64_0x46f951;return Boolean(_0x51c811)&&typeof _0x51c811===_0x145647(0xc5)&&!Array[_0x145647(0xde)](_0x51c811);}function trim(_0x270c1c){const _0x34d4d9=a64_0x46f951,_0xb0473d=String(_0x270c1c||'')[_0x34d4d9(0xca)]();return _0xb0473d;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a65_0x21eedf=a65_0x3b8b;(function(_0x483234,_0x3db8f0){const _0x99d85b=a65_0x3b8b,_0x296e7f=_0x483234();while(!![]){try{const _0x1b5824=parseInt(_0x99d85b(0x225))/0x1*(-parseInt(_0x99d85b(0x216))/0x2)+parseInt(_0x99d85b(0x208))/0x3+-parseInt(_0x99d85b(0x1f8))/0x4+-parseInt(_0x99d85b(0x217))/0x5*(-parseInt(_0x99d85b(0x200))/0x6)+parseInt(_0x99d85b(0x1e7))/0x7*(parseInt(_0x99d85b(0x202))/0x8)+parseInt(_0x99d85b(0x231))/0x9*(parseInt(_0x99d85b(0x1f6))/0xa)+-parseInt(_0x99d85b(0x21a))/0xb*(parseInt(_0x99d85b(0x21f))/0xc);if(_0x1b5824===_0x3db8f0)break;else _0x296e7f['push'](_0x296e7f['shift']());}catch(_0x24d594){_0x296e7f['push'](_0x296e7f['shift']());}}}(a65_0x1b0f,0xd02ac));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([a65_0x21eedf(0x21b),'displayName',a65_0x21eedf(0x1f3),'options',a65_0x21eedf(0x222),'datetimeFormat',a65_0x21eedf(0x227),a65_0x21eedf(0x1f1),a65_0x21eedf(0x1f7)]),FORBIDDEN_FIELD_KEYS=new Set(['id','name',a65_0x21eedf(0x214),a65_0x21eedf(0x219),'dbTypeLen','dbTypeScale',a65_0x21eedf(0x22f),a65_0x21eedf(0x1f5),a65_0x21eedf(0x1fc),'pkField',a65_0x21eedf(0x1e6),a65_0x21eedf(0x205)]);export function parseJsonObjectFlag(_0x4971ed,_0x5975f2){const _0x504abc=a65_0x21eedf;if(!_0x4971ed)return undefined;let _0x305817;try{_0x305817=JSON[_0x504abc(0x1e8)](_0x4971ed);}catch(_0xf6d19d){const _0x137f07=_0xf6d19d instanceof Error?_0xf6d19d[_0x504abc(0x1ed)]:String(_0xf6d19d);throw CliErrors[_0x504abc(0x22b)](_0x5975f2+_0x504abc(0x21c)+_0x137f07);}if(!isPlainObject(_0x305817)||Array['isArray'](_0x305817))throw CliErrors[_0x504abc(0x22b)](_0x5975f2+'\x20must\x20be\x20a\x20JSON\x20object');return _0x305817;}function a65_0x1b0f(){const _0x2c5c94=['has','keys','systemRetain','Expectation\x20mismatch\x20at\x20','JSON\x20object\x20of\x20expected\x20current\x20field\x20values;\x20mismatch\x20aborts\x20without\x20writing','3951417KeXZSD','patch','modelId','expect','Dry-run:\x20dataset\x20field\x20','Driven\x20data\x20does\x20not\x20contain\x20fields[]\x20or\x20properties[]','Forbidden\x20patch\x20key:\x20','No\x20changes\x20for\x20dataset\x20field\x20','Unsupported\x20patch\x20key:\x20','isArray','from','dbtableConfig','code','Expected\x20','239386oSHkGs','917685dbfExp','Field\x20not\x20found:\x20','dbType','11qvjvCk','doType','\x20must\x20be\x20valid\x20JSON\x20object:\x20','string','findIndex','110208dMExtb','/smartapi/dataset/update-driven-data','--field\x20is\x20required','required','data','add','11AtIgeJ','join','defaultAggregation','str','datasetId','fields','validation','datasetName','name','properties','dbFieldName','dbId','5661JeKjPe','Patch\x20one\x20raw\x20dataset\x20fields[]\x20field\x20object\x20safely','--patch-json','autoIncrement','769643DuLOpR','parse','--expect-json','\x20would\x20change\x20(','POST','field','message','Updated\x20dataset\x20field\x20','trim','patch-json','chartRole','write','description','appCode','tableName','12130GeAGoG','deprecated','6646828YGMvos','sort','JSON\x20object\x20patch;\x20allowed\x20keys:\x20doType/displayName/description/options/required/datetimeFormat/defaultAggregation/chartRole/deprecated','dataset','deleted','stringify','entries','size','18JJMKzF','expect-json','88pypnbL'];a65_0x1b0f=function(){return _0x2c5c94;};return a65_0x1b0f();}export function validatePatchKeys(_0x4309e5){const _0x2cd6ce=a65_0x21eedf,_0x3b3d3a=Object['keys'](_0x4309e5);if(_0x3b3d3a['length']===0x0)throw CliErrors[_0x2cd6ce(0x22b)]('--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key');for(const _0x207db7 of _0x3b3d3a){if(FORBIDDEN_FIELD_KEYS[_0x2cd6ce(0x203)](_0x207db7))throw CliErrors[_0x2cd6ce(0x22b)](_0x2cd6ce(0x20e)+_0x207db7);if(!MUTABLE_FIELD_KEYS['has'](_0x207db7))throw CliErrors[_0x2cd6ce(0x22b)](_0x2cd6ce(0x210)+_0x207db7,'Allowed\x20keys:\x20'+Array[_0x2cd6ce(0x212)](MUTABLE_FIELD_KEYS)['join'](',\x20'));}}export function applyFieldPatch(_0x1af0c3,_0x247867){const _0x44ebfc=a65_0x21eedf;validatePatchKeys(_0x247867);const _0x444033=deepClone(_0x1af0c3),_0x4372dd=new Set();for(const [_0x2389e7,_0x353b55]of Object[_0x44ebfc(0x1fe)](_0x247867)){const _0x3d94c3=_0x444033[_0x2389e7],_0x44aedd=mergePatchValue(_0x3d94c3,_0x353b55);!deepEqual(_0x3d94c3,_0x44aedd)&&(_0x444033[_0x2389e7]=_0x44aedd,_0x4372dd[_0x44ebfc(0x224)](_0x2389e7),collectChangedPaths(_0x2389e7,_0x3d94c3,_0x44aedd,_0x4372dd));}return{'after':_0x444033,'changedPaths':Array[_0x44ebfc(0x212)](_0x4372dd)[_0x44ebfc(0x1f9)](),'changed':_0x4372dd[_0x44ebfc(0x1ff)]>0x0};}export function assertExpectation(_0x58523b,_0x9e29f5){const _0xc211d2=a65_0x21eedf;if(!_0x9e29f5)return;for(const [_0x242e60,_0x4923dc]of Object[_0xc211d2(0x1fe)](_0x9e29f5)){const _0x109830=_0x58523b[_0x242e60];if(!deepEqual(_0x109830,_0x4923dc))throw CliErrors[_0xc211d2(0x22b)](_0xc211d2(0x206)+_0x242e60,_0xc211d2(0x215)+JSON[_0xc211d2(0x1fd)](_0x4923dc)+',\x20actual\x20'+JSON[_0xc211d2(0x1fd)](_0x109830));}}export async function buildDatasetFieldUpdateResult({appCode:_0x333891,input:_0x42d886,dryRun:_0x2a3773}){const _0x4df271=a65_0x21eedf;validateInput(_0x42d886);const _0x494ca9=await getDatasetDetail(_0x42d886[_0x4df271(0x214)]),_0x264180=readFieldArray(_0x494ca9),_0x3d4c01=_0x264180[_0x4df271(0x21e)](_0x4dce51=>_0x4dce51?.[_0x4df271(0x22d)]===_0x42d886[_0x4df271(0x1ec)]);if(_0x3d4c01<0x0)throw CliErrors['validation'](_0x4df271(0x218)+_0x42d886[_0x4df271(0x1ec)]);const _0x4faf09=deepClone(_0x264180[_0x3d4c01]);assertExpectation(_0x4faf09,_0x42d886[_0x4df271(0x20b)]);const {after:_0x4c44ac,changedPaths:_0x503c1d,changed:_0x98d6b2}=applyFieldPatch(_0x4faf09,_0x42d886[_0x4df271(0x209)]),_0x1d8fb1=summarizeDataset(_0x494ca9,_0x42d886[_0x4df271(0x214)]);return _0x98d6b2&&!_0x2a3773&&(_0x264180[_0x3d4c01]=_0x4c44ac,await updateDrivenData(_0x494ca9)),{'ok':!![],'data':{'appCode':_0x333891,'selector':{'code':_0x42d886[_0x4df271(0x214)]},'dataset':_0x1d8fb1,'field':{'id':_0x4faf09['id']??null,'name':_0x4faf09[_0x4df271(0x22d)]},'dryRun':_0x2a3773,'changed':_0x98d6b2,'changedPaths':_0x503c1d,'before':_0x4faf09,'after':_0x4c44ac,'submitted':_0x98d6b2&&!_0x2a3773},'message':_0x98d6b2?_0x2a3773?_0x4df271(0x20c)+_0x42d886[_0x4df271(0x1ec)]+_0x4df271(0x1ea)+_0x503c1d[_0x4df271(0x226)](',\x20')+')':_0x4df271(0x1ee)+_0x42d886['field']+'\x20('+_0x503c1d[_0x4df271(0x226)](',\x20')+')':_0x4df271(0x20f)+_0x42d886[_0x4df271(0x1ec)]};}export const datasetFieldUpdate={'service':'dataset','command':'field-update','description':a65_0x21eedf(0x232),'risk':a65_0x21eedf(0x1f2),'flags':[CODE_FLAG,{'name':'field','type':a65_0x21eedf(0x21d),'required':!![],'description':'Exact\x20raw\x20fields[].name\x20to\x20patch'},{'name':a65_0x21eedf(0x1f0),'type':a65_0x21eedf(0x21d),'required':!![],'description':a65_0x21eedf(0x1fa)},{'name':a65_0x21eedf(0x201),'type':a65_0x21eedf(0x21d),'required':![],'description':a65_0x21eedf(0x207)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x23f9f8){validateInput(readFieldUpdateInput(_0x23f9f8));},async 'dryRun'(_0x4fcc82){const _0x1e8f71=a65_0x21eedf,_0x243aad=await buildDatasetFieldUpdateResult({'appCode':_0x4fcc82['appCode'],'input':readFieldUpdateInput(_0x4fcc82),'dryRun':!![]});return{'method':_0x1e8f71(0x1eb),'url':_0x1e8f71(0x220),'body':_0x243aad[_0x1e8f71(0x223)],'description':_0x243aad['message']};},async 'execute'(_0x44127e){const _0x1c118d=a65_0x21eedf;return buildDatasetFieldUpdateResult({'appCode':_0x44127e[_0x1c118d(0x1f4)],'input':readFieldUpdateInput(_0x44127e),'dryRun':![]});}};function readFieldUpdateInput(_0x53c64e){const _0x1c87ed=a65_0x21eedf,_0x13f040=trim(_0x53c64e[_0x1c87ed(0x228)](_0x1c87ed(0x214))),_0x8a9321=emptyToUndefined(_0x53c64e['str'](_0x1c87ed(0x1ec))),_0xdf44d4=parseJsonObjectFlag(_0x53c64e['str'](_0x1c87ed(0x1f0)),_0x1c87ed(0x233)),_0x131dda=parseJsonObjectFlag(_0x53c64e[_0x1c87ed(0x228)](_0x1c87ed(0x201)),_0x1c87ed(0x1e9));return{'code':_0x13f040,'field':_0x8a9321||'','patch':_0xdf44d4||{},'expect':_0x131dda};}function validateInput(_0x4cc7d2){const _0x482fb3=a65_0x21eedf;if(!_0x4cc7d2[_0x482fb3(0x214)])throw CliErrors[_0x482fb3(0x22b)]('--code\x20is\x20required');if(!_0x4cc7d2[_0x482fb3(0x1ec)])throw CliErrors['validation'](_0x482fb3(0x221));validatePatchKeys(_0x4cc7d2['patch']);}function readFieldArray(_0x31b90a){const _0x3f02ce=a65_0x21eedf;if(Array[_0x3f02ce(0x211)](_0x31b90a['fields']))return _0x31b90a[_0x3f02ce(0x22a)];if(Array[_0x3f02ce(0x211)](_0x31b90a[_0x3f02ce(0x22e)]))return _0x31b90a[_0x3f02ce(0x22e)];throw CliErrors[_0x3f02ce(0x22b)](_0x3f02ce(0x20d));}function summarizeDataset(_0x5796b2,_0x4725da){const _0x5b9f01=a65_0x21eedf,_0x2aed37=isPlainObject(_0x5796b2[_0x5b9f01(0x1fb)])?_0x5796b2[_0x5b9f01(0x1fb)]:{},_0xac7eca=isPlainObject(_0x5796b2['dbtableConfig'])?_0x5796b2[_0x5b9f01(0x213)]:{};return{'id':_0x5796b2[_0x5b9f01(0x20a)]??_0x5796b2['id']??_0x2aed37[_0x5b9f01(0x229)]??null,'code':_0x5796b2['modelCode']??_0x5796b2[_0x5b9f01(0x214)]??_0x2aed37['datasetCode']??_0x4725da,'name':_0x5796b2[_0x5b9f01(0x22d)]??_0x2aed37[_0x5b9f01(0x22c)]??null,'table':_0xac7eca['tableName']??_0x2aed37[_0x5b9f01(0x1f5)]??null,'db':_0xac7eca['dbName']??_0xac7eca[_0x5b9f01(0x230)]??null};}function mergePatchValue(_0x5f4b5a,_0x4e88f2){if(isPlainObject(_0x5f4b5a)&&isPlainObject(_0x4e88f2))return deepMerge(_0x5f4b5a,_0x4e88f2);return deepClone(_0x4e88f2);}function deepMerge(_0xe5e8d3,_0x4b8032){const _0x346bde=deepClone(_0xe5e8d3);for(const [_0x7369b4,_0xb24b9a]of Object['entries'](_0x4b8032)){_0x346bde[_0x7369b4]=isPlainObject(_0x346bde[_0x7369b4])&&isPlainObject(_0xb24b9a)?deepMerge(_0x346bde[_0x7369b4],_0xb24b9a):deepClone(_0xb24b9a);}return _0x346bde;}function collectChangedPaths(_0x3a4b49,_0x458cfb,_0xd8bb1f,_0x19ea2e){const _0x160e91=a65_0x21eedf;if(!isPlainObject(_0x458cfb)||!isPlainObject(_0xd8bb1f))return;const _0x3078b2=new Set([...Object[_0x160e91(0x204)](_0x458cfb),...Object['keys'](_0xd8bb1f)]);for(const _0x4f0f4b of _0x3078b2){const _0x1ab2d5=_0x458cfb[_0x4f0f4b],_0x334072=_0xd8bb1f[_0x4f0f4b];!deepEqual(_0x1ab2d5,_0x334072)&&_0x19ea2e[_0x160e91(0x224)](_0x3a4b49+'.'+_0x4f0f4b);}}function a65_0x3b8b(_0x3058d6,_0x5a9b96){_0x3058d6=_0x3058d6-0x1e6;const _0x1b0f29=a65_0x1b0f();let _0x3b8be3=_0x1b0f29[_0x3058d6];return _0x3b8be3;}function deepClone(_0x381203){const _0x39ccad=a65_0x21eedf;if(_0x381203===undefined)return _0x381203;return JSON['parse'](JSON[_0x39ccad(0x1fd)](_0x381203));}function deepEqual(_0x2fbca9,_0x27676e){const _0x3751a5=a65_0x21eedf;return JSON[_0x3751a5(0x1fd)](_0x2fbca9)===JSON['stringify'](_0x27676e);}function isPlainObject(_0x542e2a){return Boolean(_0x542e2a)&&typeof _0x542e2a==='object'&&!Array['isArray'](_0x542e2a);}function emptyToUndefined(_0xf613e5){const _0x181c53=a65_0x21eedf,_0x52c56b=String(_0xf613e5||'')[_0x181c53(0x1ef)]();return _0x52c56b||undefined;}function trim(_0x4707c5){const _0x1d33a8=a65_0x21eedf;return String(_0x4707c5||'')[_0x1d33a8(0x1ef)]();}
|
|
1
|
+
const a65_0x4108b3=a65_0x6402;(function(_0x24225c,_0x359517){const _0x2a6f0f=a65_0x6402,_0x1595e7=_0x24225c();while(!![]){try{const _0x4fb94a=-parseInt(_0x2a6f0f(0xa6))/0x1*(parseInt(_0x2a6f0f(0x8c))/0x2)+parseInt(_0x2a6f0f(0xbb))/0x3+parseInt(_0x2a6f0f(0xad))/0x4*(parseInt(_0x2a6f0f(0xca))/0x5)+-parseInt(_0x2a6f0f(0xa2))/0x6*(parseInt(_0x2a6f0f(0x93))/0x7)+-parseInt(_0x2a6f0f(0x8b))/0x8+parseInt(_0x2a6f0f(0xb5))/0x9*(parseInt(_0x2a6f0f(0xaf))/0xa)+-parseInt(_0x2a6f0f(0x89))/0xb*(-parseInt(_0x2a6f0f(0x98))/0xc);if(_0x4fb94a===_0x359517)break;else _0x1595e7['push'](_0x1595e7['shift']());}catch(_0x42f5ca){_0x1595e7['push'](_0x1595e7['shift']());}}}(a65_0x3150,0x917f3));import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';function a65_0x3150(){const _0x3b90d9=['pkField','fields','69971gjqosX','options','7594600UGvmRg','134aZvzXk','dbName','code','autoIncrement','--field\x20is\x20required','Forbidden\x20patch\x20key:\x20','object','75229GKoild','write','deprecated','from','JSON\x20object\x20of\x20expected\x20current\x20field\x20values;\x20mismatch\x20aborts\x20without\x20writing','1308CabIlO','systemRetain','--patch-json','properties','Expectation\x20mismatch\x20at\x20','str','patch-json','--code\x20is\x20required','dbtableConfig','--expect-json','174eevZtp','name','isArray','sort','11458OlpHxF','deleted','string','has','modelCode','dataset','/smartapi/dataset/update-driven-data','9388ewfNEG','Expected\x20','630XGYrym','appCode','tableName','field-update','doType','data','103365cUZSXe','modelId','description','datasetId','dbTypeScale','entries','1841802jjbtjQ','Field\x20not\x20found:\x20','Dry-run:\x20dataset\x20field\x20','JSON\x20object\x20patch;\x20allowed\x20keys:\x20doType/displayName/description/options/required/datetimeFormat/defaultAggregation/chartRole/deprecated','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','validation',',\x20actual\x20','POST','field','expect-json','patch','Driven\x20data\x20does\x20not\x20contain\x20fields[]\x20or\x20properties[]','parse','dbFieldName','\x20would\x20change\x20(','1265mOATqY','Updated\x20dataset\x20field\x20','keys','chartRole','message','stringify','defaultAggregation','Exact\x20raw\x20fields[].name\x20to\x20patch','dbId','size','No\x20changes\x20for\x20dataset\x20field\x20','join','\x20must\x20be\x20valid\x20JSON\x20object:\x20','trim','add','datetimeFormat','required','dbTypeLen'];a65_0x3150=function(){return _0x3b90d9;};return a65_0x3150();}import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';const MUTABLE_FIELD_KEYS=new Set([a65_0x4108b3(0xb3),'displayName',a65_0x4108b3(0xb7),a65_0x4108b3(0x8a),a65_0x4108b3(0xda),a65_0x4108b3(0xd9),a65_0x4108b3(0xd0),a65_0x4108b3(0xcd),a65_0x4108b3(0x95)]),FORBIDDEN_FIELD_KEYS=new Set(['id','name',a65_0x4108b3(0x8e),'dbType',a65_0x4108b3(0xdb),a65_0x4108b3(0xb9),a65_0x4108b3(0xc8),a65_0x4108b3(0xb1),a65_0x4108b3(0xa7),a65_0x4108b3(0xdc),a65_0x4108b3(0x8f),a65_0x4108b3(0x99)]);export function parseJsonObjectFlag(_0x2ed2be,_0xa971d2){const _0xdc2b7e=a65_0x4108b3;if(!_0x2ed2be)return undefined;let _0x1ca096;try{_0x1ca096=JSON[_0xdc2b7e(0xc7)](_0x2ed2be);}catch(_0x448d62){const _0x45aa2a=_0x448d62 instanceof Error?_0x448d62[_0xdc2b7e(0xce)]:String(_0x448d62);throw CliErrors[_0xdc2b7e(0xc0)](_0xa971d2+_0xdc2b7e(0xd6)+_0x45aa2a);}if(!isPlainObject(_0x1ca096)||Array[_0xdc2b7e(0xa4)](_0x1ca096))throw CliErrors[_0xdc2b7e(0xc0)](_0xa971d2+'\x20must\x20be\x20a\x20JSON\x20object');return _0x1ca096;}export function validatePatchKeys(_0x2eacfc){const _0x1f743f=a65_0x4108b3,_0x2d60ee=Object[_0x1f743f(0xcc)](_0x2eacfc);if(_0x2d60ee['length']===0x0)throw CliErrors[_0x1f743f(0xc0)](_0x1f743f(0xbf));for(const _0x34f8fa of _0x2d60ee){if(FORBIDDEN_FIELD_KEYS[_0x1f743f(0xa9)](_0x34f8fa))throw CliErrors[_0x1f743f(0xc0)](_0x1f743f(0x91)+_0x34f8fa);if(!MUTABLE_FIELD_KEYS[_0x1f743f(0xa9)](_0x34f8fa))throw CliErrors['validation']('Unsupported\x20patch\x20key:\x20'+_0x34f8fa,'Allowed\x20keys:\x20'+Array['from'](MUTABLE_FIELD_KEYS)[_0x1f743f(0xd5)](',\x20'));}}export function applyFieldPatch(_0x9ed308,_0x127e12){const _0x300606=a65_0x4108b3;validatePatchKeys(_0x127e12);const _0x4c9902=deepClone(_0x9ed308),_0x25ceef=new Set();for(const [_0x512002,_0x2c35b0]of Object[_0x300606(0xba)](_0x127e12)){const _0x2d53f7=_0x4c9902[_0x512002],_0x4a605f=mergePatchValue(_0x2d53f7,_0x2c35b0);!deepEqual(_0x2d53f7,_0x4a605f)&&(_0x4c9902[_0x512002]=_0x4a605f,_0x25ceef[_0x300606(0xd8)](_0x512002),collectChangedPaths(_0x512002,_0x2d53f7,_0x4a605f,_0x25ceef));}return{'after':_0x4c9902,'changedPaths':Array[_0x300606(0x96)](_0x25ceef)[_0x300606(0xa5)](),'changed':_0x25ceef[_0x300606(0xd3)]>0x0};}export function assertExpectation(_0x58fbed,_0x2eeb04){const _0x3ff84d=a65_0x4108b3;if(!_0x2eeb04)return;for(const [_0x4b9e87,_0x248569]of Object[_0x3ff84d(0xba)](_0x2eeb04)){const _0x3a0b15=_0x58fbed[_0x4b9e87];if(!deepEqual(_0x3a0b15,_0x248569))throw CliErrors['validation'](_0x3ff84d(0x9c)+_0x4b9e87,_0x3ff84d(0xae)+JSON['stringify'](_0x248569)+_0x3ff84d(0xc1)+JSON['stringify'](_0x3a0b15));}}export async function buildDatasetFieldUpdateResult({appCode:_0x32e9ad,input:_0x10ce13,dryRun:_0x386e85}){const _0x7bce6b=a65_0x4108b3;validateInput(_0x10ce13);const _0x272e97=await getDatasetDetail(_0x10ce13[_0x7bce6b(0x8e)]),_0xad6b93=readFieldArray(_0x272e97),_0x24bbe1=_0xad6b93['findIndex'](_0x392102=>_0x392102?.[_0x7bce6b(0xa3)]===_0x10ce13[_0x7bce6b(0xc3)]);if(_0x24bbe1<0x0)throw CliErrors[_0x7bce6b(0xc0)](_0x7bce6b(0xbc)+_0x10ce13[_0x7bce6b(0xc3)]);const _0x38d3c8=deepClone(_0xad6b93[_0x24bbe1]);assertExpectation(_0x38d3c8,_0x10ce13['expect']);const {after:_0x43d88e,changedPaths:_0xf67c1d,changed:_0x24d48b}=applyFieldPatch(_0x38d3c8,_0x10ce13[_0x7bce6b(0xc5)]),_0x2f3fe2=summarizeDataset(_0x272e97,_0x10ce13[_0x7bce6b(0x8e)]);return _0x24d48b&&!_0x386e85&&(_0xad6b93[_0x24bbe1]=_0x43d88e,await updateDrivenData(_0x272e97)),{'ok':!![],'data':{'appCode':_0x32e9ad,'selector':{'code':_0x10ce13[_0x7bce6b(0x8e)]},'dataset':_0x2f3fe2,'field':{'id':_0x38d3c8['id']??null,'name':_0x38d3c8[_0x7bce6b(0xa3)]},'dryRun':_0x386e85,'changed':_0x24d48b,'changedPaths':_0xf67c1d,'before':_0x38d3c8,'after':_0x43d88e,'submitted':_0x24d48b&&!_0x386e85},'message':_0x24d48b?_0x386e85?_0x7bce6b(0xbd)+_0x10ce13['field']+_0x7bce6b(0xc9)+_0xf67c1d[_0x7bce6b(0xd5)](',\x20')+')':_0x7bce6b(0xcb)+_0x10ce13[_0x7bce6b(0xc3)]+'\x20('+_0xf67c1d[_0x7bce6b(0xd5)](',\x20')+')':_0x7bce6b(0xd4)+_0x10ce13[_0x7bce6b(0xc3)]};}export const datasetFieldUpdate={'service':a65_0x4108b3(0xab),'command':a65_0x4108b3(0xb2),'description':'Patch\x20one\x20raw\x20dataset\x20fields[]\x20field\x20object\x20safely','risk':a65_0x4108b3(0x94),'flags':[CODE_FLAG,{'name':a65_0x4108b3(0xc3),'type':a65_0x4108b3(0xa8),'required':!![],'description':a65_0x4108b3(0xd1)},{'name':a65_0x4108b3(0x9e),'type':'string','required':!![],'description':a65_0x4108b3(0xbe)},{'name':a65_0x4108b3(0xc4),'type':a65_0x4108b3(0xa8),'required':![],'description':a65_0x4108b3(0x97)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1f0159){validateInput(readFieldUpdateInput(_0x1f0159));},async 'dryRun'(_0x2bd345){const _0x3cbe91=a65_0x4108b3,_0x371562=await buildDatasetFieldUpdateResult({'appCode':_0x2bd345[_0x3cbe91(0xb0)],'input':readFieldUpdateInput(_0x2bd345),'dryRun':!![]});return{'method':_0x3cbe91(0xc2),'url':_0x3cbe91(0xac),'body':_0x371562[_0x3cbe91(0xb4)],'description':_0x371562['message']};},async 'execute'(_0x4b759e){const _0x5a070e=a65_0x4108b3;return buildDatasetFieldUpdateResult({'appCode':_0x4b759e[_0x5a070e(0xb0)],'input':readFieldUpdateInput(_0x4b759e),'dryRun':![]});}};function readFieldUpdateInput(_0xda7194){const _0x42ba0a=a65_0x4108b3,_0x680b60=trim(_0xda7194['str'](_0x42ba0a(0x8e))),_0x1a776b=emptyToUndefined(_0xda7194[_0x42ba0a(0x9d)]('field')),_0x3d32c3=parseJsonObjectFlag(_0xda7194['str']('patch-json'),_0x42ba0a(0x9a)),_0x1bb10c=parseJsonObjectFlag(_0xda7194['str'](_0x42ba0a(0xc4)),_0x42ba0a(0xa1));return{'code':_0x680b60,'field':_0x1a776b||'','patch':_0x3d32c3||{},'expect':_0x1bb10c};}function validateInput(_0x2eea39){const _0x2da78c=a65_0x4108b3;if(!_0x2eea39[_0x2da78c(0x8e)])throw CliErrors['validation'](_0x2da78c(0x9f));if(!_0x2eea39['field'])throw CliErrors[_0x2da78c(0xc0)](_0x2da78c(0x90));validatePatchKeys(_0x2eea39[_0x2da78c(0xc5)]);}function readFieldArray(_0x56d32f){const _0x36497b=a65_0x4108b3;if(Array['isArray'](_0x56d32f[_0x36497b(0x88)]))return _0x56d32f[_0x36497b(0x88)];if(Array[_0x36497b(0xa4)](_0x56d32f[_0x36497b(0x9b)]))return _0x56d32f[_0x36497b(0x9b)];throw CliErrors[_0x36497b(0xc0)](_0x36497b(0xc6));}function summarizeDataset(_0x3a68d7,_0x355f42){const _0x5bc164=a65_0x4108b3,_0xb13982=isPlainObject(_0x3a68d7['dataset'])?_0x3a68d7['dataset']:{},_0x231980=isPlainObject(_0x3a68d7[_0x5bc164(0xa0)])?_0x3a68d7[_0x5bc164(0xa0)]:{};return{'id':_0x3a68d7[_0x5bc164(0xb6)]??_0x3a68d7['id']??_0xb13982[_0x5bc164(0xb8)]??null,'code':_0x3a68d7[_0x5bc164(0xaa)]??_0x3a68d7[_0x5bc164(0x8e)]??_0xb13982['datasetCode']??_0x355f42,'name':_0x3a68d7[_0x5bc164(0xa3)]??_0xb13982['datasetName']??null,'table':_0x231980[_0x5bc164(0xb1)]??_0xb13982['tableName']??null,'db':_0x231980[_0x5bc164(0x8d)]??_0x231980[_0x5bc164(0xd2)]??null};}function mergePatchValue(_0x334dea,_0x397d90){if(isPlainObject(_0x334dea)&&isPlainObject(_0x397d90))return deepMerge(_0x334dea,_0x397d90);return deepClone(_0x397d90);}function a65_0x6402(_0x3edcb8,_0x4f7b0d){_0x3edcb8=_0x3edcb8-0x88;const _0x31505a=a65_0x3150();let _0x64026a=_0x31505a[_0x3edcb8];return _0x64026a;}function deepMerge(_0x21d597,_0x2f3270){const _0x314cc4=deepClone(_0x21d597);for(const [_0x3c7050,_0x545417]of Object['entries'](_0x2f3270)){_0x314cc4[_0x3c7050]=isPlainObject(_0x314cc4[_0x3c7050])&&isPlainObject(_0x545417)?deepMerge(_0x314cc4[_0x3c7050],_0x545417):deepClone(_0x545417);}return _0x314cc4;}function collectChangedPaths(_0x547198,_0x72f174,_0x1cc9e2,_0x2185c2){const _0x474c3e=a65_0x4108b3;if(!isPlainObject(_0x72f174)||!isPlainObject(_0x1cc9e2))return;const _0x2cacf6=new Set([...Object[_0x474c3e(0xcc)](_0x72f174),...Object['keys'](_0x1cc9e2)]);for(const _0x17f9be of _0x2cacf6){const _0x98bd12=_0x72f174[_0x17f9be],_0x2f82a1=_0x1cc9e2[_0x17f9be];!deepEqual(_0x98bd12,_0x2f82a1)&&_0x2185c2[_0x474c3e(0xd8)](_0x547198+'.'+_0x17f9be);}}function deepClone(_0x39e2d1){if(_0x39e2d1===undefined)return _0x39e2d1;return JSON['parse'](JSON['stringify'](_0x39e2d1));}function deepEqual(_0x3b45ac,_0x169c15){const _0xe166ad=a65_0x4108b3;return JSON[_0xe166ad(0xcf)](_0x3b45ac)===JSON[_0xe166ad(0xcf)](_0x169c15);}function isPlainObject(_0x4b7e11){const _0x12a84e=a65_0x4108b3;return Boolean(_0x4b7e11)&&typeof _0x4b7e11===_0x12a84e(0x92)&&!Array[_0x12a84e(0xa4)](_0x4b7e11);}function emptyToUndefined(_0x135be4){const _0x45b132=a65_0x4108b3,_0x50ec79=String(_0x135be4||'')[_0x45b132(0xd7)]();return _0x50ec79||undefined;}function trim(_0x4d451a){const _0x4d9228=a65_0x4108b3;return String(_0x4d451a||'')[_0x4d9228(0xd7)]();}
|