@lovrabet/rabetbase-cli 2.4.2 → 2.4.3-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/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.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/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.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/external-link-update.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/rename.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/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/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/react/create.js +1 -1
- package/lib/commands/page/react/detail.js +1 -1
- package/lib/commands/page/react/list.js +1 -1
- package/lib/commands/page/react/publish.js +1 -1
- package/lib/commands/page/react/shared.js +1 -1
- package/lib/commands/page/react/syntax.js +1 -1
- package/lib/commands/page/react/template.js +1 -1
- package/lib/commands/page/react/update.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.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/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/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/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.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.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.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 +8 -4
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a50_0xafe9(_0x3aea20,_0xf9912){_0x3aea20=_0x3aea20-0x8d;const _0xfef041=a50_0xfef0();let _0xafe9d8=_0xfef041[_0x3aea20];return _0xafe9d8;}function a50_0xfef0(){const _0x3906f1=['\x20config\x20get\x20--key\x20<key>','553VSXIVR','7221000lBPxtG','19578mIaQCU','string','Key\x20not\x20found:\x20','key','Usage:\x20','read','config','3802IWHgus','object','get','app','1410jhUbey','4754820RpYcTv','1271925AlBzQR','6994264pzuAav','str','2915838wRVUuX'];a50_0xfef0=function(){return _0x3906f1;};return a50_0xfef0();}const a50_0x4c7d0a=a50_0xafe9;(function(_0x3d6ac3,_0xc2c19b){const _0x57a92c=a50_0xafe9,_0x262e0e=_0x3d6ac3();while(!![]){try{const _0x52881d=parseInt(_0x57a92c(0x99))/0x1+-parseInt(_0x57a92c(0x93))/0x2*(-parseInt(_0x57a92c(0x97))/0x3)+parseInt(_0x57a92c(0x98))/0x4+-parseInt(_0x57a92c(0x9f))/0x5+parseInt(_0x57a92c(0xa0))/0x6*(parseInt(_0x57a92c(0x9e))/0x7)+-parseInt(_0x57a92c(0x9a))/0x8+-parseInt(_0x57a92c(0x9c))/0x9;if(_0x52881d===_0xc2c19b)break;else _0x262e0e['push'](_0x262e0e['shift']());}catch(_0x33af3d){_0x262e0e['push'](_0x262e0e['shift']());}}}(a50_0xfef0,0xecac4));import{CliErrors}from'../../errors.js';import{readConfig}from'../../utils/config.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getConfigCommandKeyDescription}from'../../commands/config/shared.js';async function execute(_0x3e5071){const _0x4c8f1f=a50_0xafe9,_0x40944f=_0x3e5071[_0x4c8f1f(0x9b)]('key');if(!_0x40944f)throw CliErrors['validation']('Missing\x20key.',_0x4c8f1f(0x90)+CLI_BIN_NAME+_0x4c8f1f(0x9d));const _0x23382f=readConfig(),_0x7ad0be=_0x40944f===_0x4c8f1f(0x96)?'appcode':_0x40944f,_0x546f60=_0x23382f[_0x7ad0be];if(_0x546f60===undefined)throw CliErrors['validation'](_0x4c8f1f(0x8e)+_0x40944f);return{'ok':!![],'data':typeof _0x546f60===_0x4c8f1f(0x94)?_0x546f60:{[_0x7ad0be]:_0x546f60},'message':typeof _0x546f60===_0x4c8f1f(0x94)?undefined:String(_0x546f60)};}export const configGetDefinition={'service':a50_0x4c7d0a(0x92),'command':a50_0x4c7d0a(0x95),'description':'Get\x20a\x20config\x20value\x20by\x20key','risk':a50_0x4c7d0a(0x91),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a50_0x4c7d0a(0x8f),'type':a50_0x4c7d0a(0x8d),'description':getConfigCommandKeyDescription(),'required':!![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x595af6,_0x2ba2d8){const _0x2f4a5c=a51_0x1b34,_0x4406cc=_0x595af6();while(!![]){try{const _0x4aba43=parseInt(_0x2f4a5c(0x8c))/0x1*(-parseInt(_0x2f4a5c(0x93))/0x2)+-parseInt(_0x2f4a5c(0x94))/0x3+-parseInt(_0x2f4a5c(0x8f))/0x4+parseInt(_0x2f4a5c(0x8d))/0x5+-parseInt(_0x2f4a5c(0x91))/0x6+-parseInt(_0x2f4a5c(0x95))/0x7*(-parseInt(_0x2f4a5c(0x90))/0x8)+parseInt(_0x2f4a5c(0x8e))/0x9*(parseInt(_0x2f4a5c(0x92))/0xa);if(_0x4aba43===_0x2ba2d8)break;else _0x4406cc['push'](_0x4406cc['shift']());}catch(_0x1b2ee1){_0x4406cc['push'](_0x4406cc['shift']());}}}(a51_0x1472,0x4280b));function a51_0x1472(){const _0x2a8c32=['842280qMntvq','225hZtssr','749960wrVCKH','24cIfAOI','2610576zMAySK','423130QfuOnW','230TeEpFt','616023DNPAsX','124159phUJTa','1558cmBPTL'];a51_0x1472=function(){return _0x2a8c32;};return a51_0x1472();}import{configListDefinition}from'../../commands/config/list.js';import{configGetDefinition}from'../../commands/config/get.js';function a51_0x1b34(_0x1bb3e2,_0x1aec12){_0x1bb3e2=_0x1bb3e2-0x8c;const _0x14720a=a51_0x1472();let _0x1b3433=_0x14720a[_0x1bb3e2];return _0x1b3433;}import{configSetDefinition}from'../../commands/config/set.js';export const configDefinitions=[configListDefinition,configGetDefinition,configSetDefinition];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a52_0x18c96c=a52_0x19b7;(function(_0x1f8219,_0x20bdb1){const _0x5859eb=a52_0x19b7,_0x25fb82=_0x1f8219();while(!![]){try{const _0x2dcd42=-parseInt(_0x5859eb(0x147))/0x1+parseInt(_0x5859eb(0x150))/0x2*(-parseInt(_0x5859eb(0x143))/0x3)+parseInt(_0x5859eb(0x142))/0x4+-parseInt(_0x5859eb(0x14a))/0x5+-parseInt(_0x5859eb(0x148))/0x6+-parseInt(_0x5859eb(0x151))/0x7+parseInt(_0x5859eb(0x14f))/0x8*(parseInt(_0x5859eb(0x14b))/0x9);if(_0x2dcd42===_0x20bdb1)break;else _0x25fb82['push'](_0x25fb82['shift']());}catch(_0x224510){_0x25fb82['push'](_0x25fb82['shift']());}}}(a52_0x3acd,0xa958f));import{readScopedConfig}from'../../commands/config/shared.js';import{readConfig}from'../../utils/config.js';function a52_0x3acd(){const _0xb57b88=['867933CYijvO','7480806bcFzsc','config','334670yAVQxS','54lGZjsZ','Show\x20global\x20config\x20only\x20(~/.rabetbase.json)','bool','boolean','2910136DtdnBz','58gvXAmq','562954lRWIQQ','4276784oHNRkf','30627JRFINW','List\x20all\x20config\x20values','read','global'];a52_0x3acd=function(){return _0xb57b88;};return a52_0x3acd();}async function execute(_0x33a02d){const _0x591df2=a52_0x19b7,_0x59091a=_0x33a02d[_0x591df2(0x14d)](_0x591df2(0x146))?readScopedConfig(_0x591df2(0x146)):readConfig();return{'ok':!![],'data':_0x59091a};}function a52_0x19b7(_0xbba401,_0x34c0ea){_0xbba401=_0xbba401-0x142;const _0x3acd59=a52_0x3acd();let _0x19b786=_0x3acd59[_0xbba401];return _0x19b786;}export const configListDefinition={'service':a52_0x18c96c(0x149),'command':'list','description':a52_0x18c96c(0x144),'risk':a52_0x18c96c(0x145),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a52_0x18c96c(0x146),'type':a52_0x18c96c(0x14e),'description':a52_0x18c96c(0x14c),'default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a53_0x310489=a53_0x2b80;(function(_0x3f7b4b,_0x3c3e37){const _0x39c55f=a53_0x2b80,_0xdfca98=_0x3f7b4b();while(!![]){try{const _0x2e957c=-parseInt(_0x39c55f(0x1b1))/0x1+parseInt(_0x39c55f(0x1d0))/0x2+-parseInt(_0x39c55f(0x1be))/0x3*(parseInt(_0x39c55f(0x1c8))/0x4)+parseInt(_0x39c55f(0x1c5))/0x5*(-parseInt(_0x39c55f(0x1a3))/0x6)+-parseInt(_0x39c55f(0x1b3))/0x7*(-parseInt(_0x39c55f(0x1a2))/0x8)+-parseInt(_0x39c55f(0x1af))/0x9+parseInt(_0x39c55f(0x1a5))/0xa;if(_0x2e957c===_0x3c3e37)break;else _0xdfca98['push'](_0xdfca98['shift']());}catch(_0x4323e2){_0xdfca98['push'](_0xdfca98['shift']());}}}(a53_0x356c,0x26675));import{CliErrors}from'../../errors.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';import{CLI_BIN_NAME,CONFIG_ENUM_VALUES,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale,resolveWriteScope,readScopedConfig,writeScopedConfig}from'../../commands/config/shared.js';import{normalizeEnv,isProduction,isDaily}from'../../constant/env.js';function a53_0x356c(){const _0x1fc22e=['856551ZPkZfw','Legacy\x20alias\x20\x22online\x22\x20is\x20accepted\x20and\x20stored\x20as\x20production.','appcode','\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>','\x20set\x20to:\x20','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','Global','20955buCOkT','Config\x20value\x20is\x20invalid\x20or\x20too\x20long.','config','4rqTrQe','app','locale','string','Write\x20to\x20global\x20config\x20(~/.rabetbase.json)','riskLevel','Set\x20a\x20config\x20value','length','256686PDmhtJ','bool','144kHvSfG','252uIZWdw','validation','9690890phGPwb','\x20workspace\x20use\x20--app\x20<name>`,\x20or\x20pass\x20`--appcode`\x20on\x20the\x20command.','global','object','\x20(stored\x20as\x20apps\x20+\x20defaultApp)','\x22\x20is\x20not\x20settable.','Cannot\x20set\x20top-level\x20\x22appcode\x22\x20when\x20multi-app\x20config\x20already\x20exists.','Config\x20value','includes','Missing\x20key.','2424798YmzWEm','Top-level\x20key\x20\x22','272206JVGNkJ','value','24514XeMAzV','Project','Invalid\x20value\x20for\x20env.\x20Allowed:\x20production,\x20daily.','Missing\x20value.','Use\x20`','\x20workspace\x20add\x20<name>\x20--appcode\x20','apps','`,\x20`','env','key','boolean'];a53_0x356c=function(){return _0x1fc22e;};return a53_0x356c();}async function execute(_0x134271){const _0x4790af=a53_0x2b80,_0x521cb3=_0x134271['str'](_0x4790af(0x1bc)),_0x574206=_0x134271['str'](_0x4790af(0x1b2));if(!_0x521cb3)throw CliErrors[_0x4790af(0x1a4)](_0x4790af(0x1ae),'Usage:\x20'+CLI_BIN_NAME+_0x4790af(0x1c1));if(_0x574206===undefined||_0x574206==='')throw CliErrors[_0x4790af(0x1a4)](_0x4790af(0x1b6),'Usage:\x20'+CLI_BIN_NAME+'\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>');if(_0x574206[_0x4790af(0x1cf)]>0x1f4)throw CliErrors[_0x4790af(0x1a4)](_0x4790af(0x1c6));if(!isTopLevelConfigKey(_0x521cb3))throw CliErrors[_0x4790af(0x1a4)](_0x4790af(0x1b0)+_0x521cb3+_0x4790af(0x1aa),'Settable\x20top-level\x20keys:\x20'+getTopLevelConfigKeySummary());if(_0x521cb3===_0x4790af(0x1cd))throw CliErrors['validation'](_0x4790af(0x1c3));if(CONFIG_ENUM_VALUES[_0x521cb3]&&!CONFIG_ENUM_VALUES[_0x521cb3][_0x4790af(0x1ad)](_0x574206))throw CliErrors[_0x4790af(0x1a4)]('Invalid\x20value\x20for\x20\x22'+_0x521cb3+'\x22.\x20Allowed:\x20'+CONFIG_ENUM_VALUES[_0x521cb3]['join'](',\x20'));if(_0x521cb3===_0x4790af(0x1ca)&&!normalizeLocale(_0x574206))throw CliErrors[_0x4790af(0x1a4)]('Invalid\x20locale\x20value.','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US');const _0x342bc6={'global':_0x134271[_0x4790af(0x1d1)](_0x4790af(0x1a7))},_0x9907ac=resolveWriteScope(_0x342bc6),_0x4bc164=readScopedConfig(_0x9907ac);let _0xddcaf=_0x521cb3,_0x1fa85c=_0x574206;_0x521cb3==='app'&&(_0xddcaf='appcode',delete _0x4bc164[_0x4790af(0x1c9)]);_0x521cb3===_0x4790af(0x1ca)&&(_0x1fa85c=normalizeLocale(_0x574206));if(_0x521cb3==='env'){_0x1fa85c=normalizeEnv(_0x574206);if(!isProduction(_0x1fa85c)&&!isDaily(_0x1fa85c))throw CliErrors[_0x4790af(0x1a4)](_0x4790af(0x1b5),_0x4790af(0x1bf));}if(_0x521cb3===_0x4790af(0x1c0)){const _0x56959b=_0x4bc164[_0x4790af(0x1b9)]&&typeof _0x4bc164[_0x4790af(0x1b9)]===_0x4790af(0x1a8)?Object['keys'](_0x4bc164[_0x4790af(0x1b9)]):[];if(_0x56959b[_0x4790af(0x1cf)]>0x0)throw CliErrors[_0x4790af(0x1a4)](_0x4790af(0x1ab),_0x4790af(0x1b7)+CLI_BIN_NAME+_0x4790af(0x1b8)+_0x1fa85c+_0x4790af(0x1ba)+CLI_BIN_NAME+_0x4790af(0x1a6));const _0x1b79dd=buildCanonicalProjectConfig({..._0x4bc164},{'appCodes':[_0x1fa85c],'env':typeof _0x4bc164['env']===_0x4790af(0x1cb)?_0x4bc164[_0x4790af(0x1bb)]:undefined});writeScopedConfig(_0x1b79dd,_0x9907ac);const _0x1fd000=_0x9907ac===_0x4790af(0x1a7)?_0x4790af(0x1c4):_0x4790af(0x1b4);return{'ok':!![],'message':'✓\x20'+_0x1fd000+'\x20appcode\x20set\x20to:\x20'+_0x1fa85c+_0x4790af(0x1a9)};}_0x4bc164[_0xddcaf]=_0x1fa85c,writeScopedConfig(_0x4bc164,_0x9907ac);const _0x1136c9=_0x9907ac===_0x4790af(0x1a7)?_0x4790af(0x1c4):_0x4790af(0x1b4);return{'ok':!![],'message':'✓\x20'+_0x1136c9+'\x20'+_0xddcaf+_0x4790af(0x1c2)+_0x1fa85c};}function a53_0x2b80(_0x11c0d8,_0x5b4ce7){_0x11c0d8=_0x11c0d8-0x1a2;const _0x356c82=a53_0x356c();let _0x2b8005=_0x356c82[_0x11c0d8];return _0x2b8005;}export const configSetDefinition={'service':a53_0x310489(0x1c7),'command':'set','description':a53_0x310489(0x1ce),'risk':'write','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'key','type':a53_0x310489(0x1cb),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a53_0x310489(0x1b2),'type':'string','description':a53_0x310489(0x1ac),'required':!![]},{'name':a53_0x310489(0x1a7),'type':a53_0x310489(0x1bd),'description':a53_0x310489(0x1cc),'default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a54_0x2290(){var _0x3f1aaa=['Add\x20--global\x20to\x20write\x20to\x20~/.rabetbase.json,\x20or\x20run\x20`','validation','project','682734WVmQuK','48siqFqo','480294KmMzSr','48RvhXAA','33188cRJAoZ','1365444ppMJhP','1401635FSEMda','503097MILJCJ','598797hMWBnR','\x20init`\x20first.'];a54_0x2290=function(){return _0x3f1aaa;};return a54_0x2290();}(function(_0x3a9129,_0x3142e2){var _0x273e54=a54_0x435f,_0xa756de=_0x3a9129();while(!![]){try{var _0x4801fd=-parseInt(_0x273e54(0x139))/0x1+-parseInt(_0x273e54(0x13b))/0x2*(-parseInt(_0x273e54(0x13a))/0x3)+parseInt(_0x273e54(0x13c))/0x4+-parseInt(_0x273e54(0x13d))/0x5+parseInt(_0x273e54(0x137))/0x6+-parseInt(_0x273e54(0x13e))/0x7+parseInt(_0x273e54(0x138))/0x8*(parseInt(_0x273e54(0x13f))/0x9);if(_0x4801fd===_0x3142e2)break;else _0xa756de['push'](_0xa756de['shift']());}catch(_0x3e623d){_0xa756de['push'](_0xa756de['shift']());}}}(a54_0x2290,0x46280));import{CLI_BIN_NAME}from'../../constant/cli.js';import{isInProject,resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function a54_0x435f(_0x5b6f68,_0x368198){_0x5b6f68=_0x5b6f68-0x133;var _0x2290a4=a54_0x2290();var _0x435ff6=_0x2290a4[_0x5b6f68];return _0x435ff6;}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(_0x4f0489){var _0x221b6e=a54_0x435f;if(_0x4f0489['global'])return'global';if(!isInProject())throw CliErrors[_0x221b6e(0x135)]('Not\x20inside\x20a\x20project\x20(no\x20.rabetbase.json\x20found).',_0x221b6e(0x134)+CLI_BIN_NAME+_0x221b6e(0x133));return _0x221b6e(0x136);}export function readScopedConfig(_0x2037d0){return readConfigFile(resolveWriteConfigPath(_0x2037d0));}export function writeScopedConfig(_0x15b04b,_0x1acfcb){writeConfigFile(resolveWriteConfigPath(_0x1acfcb),_0x15b04b);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a55_0x182f(_0x2b3e9f,_0x39cf43){_0x2b3e9f=_0x2b3e9f-0xc5;const _0x100a34=a55_0x100a();let _0x182fb3=_0x100a34[_0x2b3e9f];return _0x182fb3;}const a55_0x34c0aa=a55_0x182f;(function(_0x494314,_0x1f7e3f){const _0x4e1452=a55_0x182f,_0x2daac4=_0x494314();while(!![]){try{const _0x4c4d21=parseInt(_0x4e1452(0xcf))/0x1+-parseInt(_0x4e1452(0xd1))/0x2+-parseInt(_0x4e1452(0xd4))/0x3+-parseInt(_0x4e1452(0xd5))/0x4*(parseInt(_0x4e1452(0xd0))/0x5)+parseInt(_0x4e1452(0xd2))/0x6*(parseInt(_0x4e1452(0xc7))/0x7)+-parseInt(_0x4e1452(0xc9))/0x8*(parseInt(_0x4e1452(0xc6))/0x9)+parseInt(_0x4e1452(0xc5))/0xa;if(_0x4c4d21===_0x1f7e3f)break;else _0x2daac4['push'](_0x2daac4['shift']());}catch(_0x8bd529){_0x2daac4['push'](_0x2daac4['shift']());}}}(a55_0x100a,0xd2380));function a55_0x100a(){const _0x2de31e=['Filter\x20dataset\x20records\x20with\x20query\x20conditions','108720Uuqhsy','2697535PNnqRH','141804rIndcM','6jiGswk','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions','1461324eyeCbG','12aCJMpW','filter','27252290SzoPmG','171dvfwZE','11843755lDRiAs','\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}]','626664AnGfsH','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','join','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]'];a55_0x100a=function(){return _0x2de31e;};return a55_0x100a();}import{buildDataCommand}from'../../commands/data/shared.js';export const dataFilter=buildDataCommand({'command':a55_0x34c0aa(0xd6),'operation':a55_0x34c0aa(0xd6),'description':a55_0x34c0aa(0xce),'paramsRequired':![],'paramsHint':a55_0x34c0aa(0xcc),'helpExtra':[a55_0x34c0aa(0xca),a55_0x34c0aa(0xd3),a55_0x34c0aa(0xcd),a55_0x34c0aa(0xc8),'\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page'][a55_0x34c0aa(0xcb)]('\x0a')});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a56_0xc1a9(_0x362809,_0x5d930d){_0x362809=_0x362809-0x1b9;const _0x514ccb=a56_0x514c();let _0xc1a90d=_0x514ccb[_0x362809];return _0xc1a90d;}const a56_0x5783c9=a56_0xc1a9;(function(_0x13f635,_0x5d3dda){const _0x204dd2=a56_0xc1a9,_0x5e8f5c=_0x13f635();while(!![]){try{const _0x110672=-parseInt(_0x204dd2(0x1bb))/0x1*(parseInt(_0x204dd2(0x1c4))/0x2)+parseInt(_0x204dd2(0x1bf))/0x3+-parseInt(_0x204dd2(0x1c1))/0x4*(-parseInt(_0x204dd2(0x1c3))/0x5)+parseInt(_0x204dd2(0x1c2))/0x6*(-parseInt(_0x204dd2(0x1b9))/0x7)+parseInt(_0x204dd2(0x1be))/0x8*(parseInt(_0x204dd2(0x1bd))/0x9)+parseInt(_0x204dd2(0x1c0))/0xa+-parseInt(_0x204dd2(0x1ba))/0xb;if(_0x110672===_0x5d3dda)break;else _0x5e8f5c['push'](_0x5e8f5c['shift']());}catch(_0x9eaf16){_0x5e8f5c['push'](_0x5e8f5c['shift']());}}}(a56_0x514c,0xc465d));import{buildDataCommand}from'../../commands/data/shared.js';function a56_0x514c(){const _0x3a9759=['3704193MZZGoK','9906140CbUUgG','3305252YvePCq','4297596LdSrEI','5MDAYzQ','242774QEHbjp','7nvDmUK','1088483Uelmwh','13DZeAoK','getOne','438111BjdsNl','24ZsszgT'];a56_0x514c=function(){return _0x3a9759;};return a56_0x514c();}export const dataGetOne=buildDataCommand({'command':a56_0x5783c9(0x1bc),'operation':'getOne','description':'Get\x20a\x20single\x20record\x20by\x20ID','paramsRequired':!![],'paramsHint':'JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x50146a,_0x5e4c74){const _0x1152cb=a57_0x1001,_0x10eea4=_0x50146a();while(!![]){try{const _0x385423=parseInt(_0x1152cb(0x158))/0x1+-parseInt(_0x1152cb(0x15a))/0x2*(parseInt(_0x1152cb(0x15e))/0x3)+-parseInt(_0x1152cb(0x155))/0x4+-parseInt(_0x1152cb(0x156))/0x5+parseInt(_0x1152cb(0x157))/0x6*(-parseInt(_0x1152cb(0x15d))/0x7)+-parseInt(_0x1152cb(0x159))/0x8*(-parseInt(_0x1152cb(0x15b))/0x9)+parseInt(_0x1152cb(0x15c))/0xa;if(_0x385423===_0x5e4c74)break;else _0x10eea4['push'](_0x10eea4['shift']());}catch(_0x1b813b){_0x10eea4['push'](_0x10eea4['shift']());}}}(a57_0x536d,0x1da22));function a57_0x1001(_0x3cdb6b,_0x4411f4){_0x3cdb6b=_0x3cdb6b-0x155;const _0x536d44=a57_0x536d();let _0x10019b=_0x536d44[_0x3cdb6b];return _0x10019b;}function a57_0x536d(){const _0x338510=['461560EsCUNA','102ktVhEq','142021VGEPtg','216UMuBdb','20rnruGl','66834fdyVfr','1816680ZbOEVS','6209WGoFps','33585usrKRI','733888aaNaQg'];a57_0x536d=function(){return _0x338510;};return a57_0x536d();}import{dataFilter}from'../../commands/data/filter.js';import{dataGetOne}from'../../commands/data/getOne.js';export const dataDefinitions=[dataFilter,dataGetOne];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1543ca,_0x41a8fd){const _0x40eda4=a58_0x39ae,_0x273d20=_0x1543ca();while(!![]){try{const _0x8b5d2d=parseInt(_0x40eda4(0x150))/0x1+-parseInt(_0x40eda4(0x156))/0x2+parseInt(_0x40eda4(0x151))/0x3+-parseInt(_0x40eda4(0x15b))/0x4+-parseInt(_0x40eda4(0x14f))/0x5*(-parseInt(_0x40eda4(0x14b))/0x6)+parseInt(_0x40eda4(0x162))/0x7+-parseInt(_0x40eda4(0x15f))/0x8;if(_0x8b5d2d===_0x41a8fd)break;else _0x273d20['push'](_0x273d20['shift']());}catch(_0x49f0f5){_0x273d20['push'](_0x273d20['shift']());}}}(a58_0x2f0a,0x59687));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 a58_0x2f0a(){const _0x48d14e=['operation','data\x20','4454002shppVJ','Example:\x20--params\x20\x27{\x22id\x22:123}\x27','flagMissing','alias','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically','6PBkURJ','str','getOne','string','2634905wjizXD','400004yfcNDQ','2153310iitSUh','helpExtra','params','paramsHint','data','981194kTgbBN','now','code','read','\x20completed\x20in\x20','1560924ZIOdjm','Provide\x20--params\x20\x27{\x22id\x22:123}\x27\x20for\x20data\x20getOne.','appCode','compress','8271984jCZlDa'];a58_0x2f0a=function(){return _0x48d14e;};return a58_0x2f0a();}function a58_0x39ae(_0x21fda2,_0x59b5d4){_0x21fda2=_0x21fda2-0x14a;const _0x2f0a58=a58_0x2f0a();let _0x39aea4=_0x2f0a58[_0x21fda2];return _0x39aea4;}function assertGetOneId(_0x555a6d){const _0x27f93a=a58_0x39ae;if(!_0x555a6d)throw CliErrors[_0x27f93a(0x164)]('params',_0x27f93a(0x15c));const _0x390511=_0x555a6d['id'];if(_0x390511===undefined||_0x390511===null||_0x390511==='')throw CliErrors['validation']('data\x20getOne\x20requires\x20\x22id\x22\x20in\x20--params',_0x27f93a(0x163));}function parseCommandParams(_0x2a9e02){return parseJsonParams(_0x2a9e02)??{};}export function buildDataCommand(_0x49ad5c){const _0x23af8c=a58_0x39ae,_0x921d5=_0x23af8c(0x14a);return{'service':_0x23af8c(0x155),'command':_0x49ad5c['command'],'description':_0x49ad5c['description'],'risk':_0x23af8c(0x159),'defaultOutputFormat':_0x23af8c(0x15e),'helpExtra':_0x49ad5c[_0x23af8c(0x152)],'flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':_0x23af8c(0x165),'type':'string','description':_0x921d5},{'name':'params','type':_0x23af8c(0x14e),'description':_0x49ad5c[_0x23af8c(0x154)]}],async 'validate'(_0x4babd8){const _0x54e72e=_0x23af8c,_0x54f193=_0x4babd8[_0x54e72e(0x14c)](_0x54e72e(0x153));if(_0x49ad5c['paramsRequired']&&!_0x54f193)throw CliErrors[_0x54e72e(0x164)](_0x54e72e(0x153),_0x49ad5c[_0x54e72e(0x154)]);const _0x13360c=parseJsonParams(_0x54f193);_0x49ad5c['operation']===_0x54e72e(0x14d)&&assertGetOneId(_0x13360c);},async 'execute'(_0x40f381){const _0x3ce09c=_0x23af8c,_0x5a8c6f=parseCommandParams(_0x40f381[_0x3ce09c(0x14c)](_0x3ce09c(0x153))),_0x1e45e4=Date['now'](),_0x3dadd6=await executeDatasetDataOperation(_0x40f381[_0x3ce09c(0x15d)],_0x40f381[_0x3ce09c(0x14c)](_0x3ce09c(0x158)),_0x49ad5c[_0x3ce09c(0x160)],_0x5a8c6f),_0x17f6a6=Date[_0x3ce09c(0x157)]()-_0x1e45e4;return{'ok':!![],'data':{'result':_0x3dadd6,'elapsed':_0x17f6a6},'message':_0x3ce09c(0x161)+_0x49ad5c['command']+_0x3ce09c(0x15a)+_0x17f6a6+'ms'};}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a59_0x182055=a59_0x1bc6;(function(_0x3d4581,_0x5335bb){const _0x4cb5fb=a59_0x1bc6,_0x39ae98=_0x3d4581();while(!![]){try{const _0xcdd59b=-parseInt(_0x4cb5fb(0x221))/0x1*(parseInt(_0x4cb5fb(0x200))/0x2)+-parseInt(_0x4cb5fb(0x22c))/0x3*(-parseInt(_0x4cb5fb(0x1f8))/0x4)+-parseInt(_0x4cb5fb(0x207))/0x5+-parseInt(_0x4cb5fb(0x208))/0x6+-parseInt(_0x4cb5fb(0x229))/0x7*(parseInt(_0x4cb5fb(0x1fc))/0x8)+parseInt(_0x4cb5fb(0x1fd))/0x9*(-parseInt(_0x4cb5fb(0x211))/0xa)+parseInt(_0x4cb5fb(0x20d))/0xb*(parseInt(_0x4cb5fb(0x226))/0xc);if(_0xcdd59b===_0x5335bb)break;else _0x39ae98['push'](_0x39ae98['shift']());}catch(_0x477340){_0x39ae98['push'](_0x39ae98['shift']());}}}(a59_0x1797,0x59142));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateErBusinessGroup}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const BACKEND_PATH=a59_0x182055(0x1f2);export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x1de252,input:_0x133f9,dryRun:_0x4c81fb}){const _0xd8bd69=a59_0x182055;validateInput(_0x133f9);const _0x171314=normalizeBusinessGroup(_0x133f9[_0xd8bd69(0x209)]),_0x254c45=await getDatasetDetail(_0x133f9[_0xd8bd69(0x21b)]),_0x207bb7=resolveBusinessGroupDataset(_0x254c45,_0x133f9[_0xd8bd69(0x21b)]),_0x4976ff=loadCurrentBusinessGroup(_0x254c45,_0x207bb7);assertExpectedBusinessGroup(_0x4976ff,_0x133f9[_0xd8bd69(0x21e)]);const _0x5d2864=buildBackendPayload(_0x1de252,_0x207bb7,_0x171314),_0x4509a0=_0x4976ff!==_0x171314;let _0x300402;if(_0x4509a0&&!_0x4c81fb){await updateErBusinessGroup(_0x5d2864);const _0x182bc2=await getDatasetDetail(_0x207bb7[_0xd8bd69(0x21b)]),_0x1773e3=resolveBusinessGroupDataset(_0x182bc2,_0x207bb7['code']),_0x41f9cf=loadCurrentBusinessGroup(_0x182bc2,_0x1773e3);if(_0x41f9cf!==_0x171314)throw CliErrors['apiError']('Business\x20scenario\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','Expected\x20'+JSON[_0xd8bd69(0x219)](_0x171314)+_0xd8bd69(0x22a)+JSON[_0xd8bd69(0x219)](_0x41f9cf)+'.');_0x300402={'verified':!![],'status':_0xd8bd69(0x22d),'afterReadback':{'businessGroup':_0x41f9cf}};}else!_0x4509a0&&(_0x300402={'verified':!![],'status':_0xd8bd69(0x22e),'afterReadback':{'businessGroup':_0x4976ff}});const _0x4bd5be={'operation':_0xd8bd69(0x20e),'appCode':_0x1de252,'selector':{'code':_0x207bb7[_0xd8bd69(0x21b)]},'dataset':_0x207bb7,'before':{'businessGroup':_0x4976ff},'after':{'businessGroup':_0x171314},'changed':_0x4509a0,'dryRun':_0x4c81fb,'submitted':_0x4509a0&&!_0x4c81fb,'backend':{'method':_0xd8bd69(0x1fe),'path':BACKEND_PATH,'payload':_0x5d2864},..._0x300402?{'verification':_0x300402}:{},'warnings':[]};return{'ok':!![],'data':_0x4bd5be,'message':_0x4509a0?_0x4c81fb?_0xd8bd69(0x20a)+_0x207bb7['code']:'Updated\x20business\x20scenario\x20group\x20for\x20dataset\x20'+_0x207bb7[_0xd8bd69(0x21b)]:'No\x20changes\x20for\x20business\x20scenario\x20group\x20on\x20dataset\x20'+_0x207bb7[_0xd8bd69(0x21b)]};}export const datasetBusinessGroupUpdate={'service':a59_0x182055(0x216),'command':a59_0x182055(0x231),'description':'Update\x20business\x20scenario\x20group','risk':a59_0x182055(0x227),'flags':[CODE_FLAG,{'name':'business-group','type':a59_0x182055(0x204),'required':!![],'description':a59_0x182055(0x217)},{'name':a59_0x182055(0x218),'type':a59_0x182055(0x204),'required':![],'description':'Expected\x20current\x20business\x20scenario\x20group;\x20mismatch\x20aborts\x20without\x20writing'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1dfa7e){validateInput(readBusinessGroupUpdateInput(_0x1dfa7e));},async 'dryRun'(_0x376dcb){const _0x54ed14=a59_0x182055,_0x37cda4=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x376dcb[_0x54ed14(0x21f)],'input':readBusinessGroupUpdateInput(_0x376dcb),'dryRun':!![]});return{'method':'POST','url':BACKEND_PATH,'body':_0x37cda4[_0x54ed14(0x20b)]['backend'][_0x54ed14(0x206)],'description':_0x37cda4[_0x54ed14(0x223)],..._0x37cda4['data']};},async 'execute'(_0x10ce91){const _0x5e2bf1=a59_0x182055;return buildDatasetBusinessGroupUpdateResult({'appCode':_0x10ce91[_0x5e2bf1(0x21f)],'input':readBusinessGroupUpdateInput(_0x10ce91),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x1f3c2a){const _0x5e4a76=a59_0x182055,_0x54275f=_0x1f3c2a['str'](_0x5e4a76(0x218));return{'code':trim(_0x1f3c2a[_0x5e4a76(0x215)]('code')),'businessGroup':_0x1f3c2a[_0x5e4a76(0x215)]('business-group'),'expectBusinessGroup':_0x54275f===undefined||_0x54275f===''?undefined:_0x54275f};}function a59_0x1bc6(_0xcdfa15,_0x3d0bb3){_0xcdfa15=_0xcdfa15-0x1f2;const _0x17973e=a59_0x1797();let _0x1bc635=_0x17973e[_0xcdfa15];return _0x1bc635;}function validateInput(_0x18130b){const _0x5b3910=a59_0x182055;if(!trim(_0x18130b[_0x5b3910(0x21b)]))throw CliErrors[_0x5b3910(0x21a)]('--code\x20is\x20required');if(_0x18130b['businessGroup']===undefined)throw CliErrors[_0x5b3910(0x21a)](_0x5b3910(0x210));}function resolveBusinessGroupDataset(_0x552549,_0x28ef0c){const _0x228c99=a59_0x182055,_0x38cd97=asPlainObject(_0x552549[_0x228c99(0x216)]),_0x5baf0f=asPlainObject(_0x552549[_0x228c99(0x203)]),_0xbf1a17=resolveSourceType(_0x552549,_0x38cd97,_0x5baf0f),_0x579f24=firstString(_0x552549[_0x228c99(0x1fa)],_0x552549['code'],_0x38cd97[_0x228c99(0x225)],_0x28ef0c)||_0x28ef0c;return{'id':firstNumber(_0x552549[_0x228c99(0x1f9)],_0x552549['id'],_0x38cd97[_0x228c99(0x230)])??firstString(_0x552549['modelId'],_0x552549['id'],_0x38cd97[_0x228c99(0x230)])??null,'code':_0x579f24,'name':firstString(_0x552549[_0x228c99(0x1f5)],_0x38cd97[_0x228c99(0x22f)],_0x38cd97[_0x228c99(0x1f5)])||null,'sourceType':_0xbf1a17};}function resolveSourceType(_0x111a84,_0x18071c,_0x329bd9){const _0x28f526=a59_0x182055,_0x16bcc6=firstString(_0x111a84[_0x28f526(0x1f4)],_0x111a84[_0x28f526(0x20f)],_0x18071c[_0x28f526(0x1f4)],_0x18071c[_0x28f526(0x20f)])?.[_0x28f526(0x1fb)]()[_0x28f526(0x212)]();if(_0x16bcc6==='DB_TABLE'||_0x16bcc6===_0x28f526(0x1f6))return _0x16bcc6;if(Object[_0x28f526(0x222)](_0x329bd9)[_0x28f526(0x224)]>0x0)return _0x28f526(0x214);throw CliErrors[_0x28f526(0x21a)](_0x28f526(0x22b));}function loadCurrentBusinessGroup(_0x212656,_0xbc9135){const _0x396b93=a59_0x182055,_0xee5b4a=readBusinessGroupFromDatasetDetail(_0x212656,_0xbc9135[_0x396b93(0x20f)]);if(_0xee5b4a[_0x396b93(0x220)])return normalizeBusinessGroup(_0xee5b4a[_0x396b93(0x228)]);if(_0xbc9135[_0x396b93(0x20f)]===_0x396b93(0x1f6))return'';throw CliErrors[_0x396b93(0x21a)](_0x396b93(0x1f7),_0x396b93(0x21d));}function readBusinessGroupFromDatasetDetail(_0x27a7a0,_0x589ae8){const _0x2e8da8=a59_0x182055,_0x58f63f=asPlainObject(_0x27a7a0['dataset']),_0x54fcc7=firstPresent(_0x27a7a0[_0x2e8da8(0x209)]);if(_0x54fcc7[_0x2e8da8(0x220)])return _0x54fcc7;const _0x59ec9c=firstPresent(_0x58f63f[_0x2e8da8(0x209)]);if(_0x59ec9c[_0x2e8da8(0x220)])return _0x59ec9c;if(_0x589ae8===_0x2e8da8(0x214))return{'found':![]};const _0x2cf196=readBusinessGroupFromExtend(_0x27a7a0['extend']);if(_0x2cf196[_0x2e8da8(0x220)])return _0x2cf196;return readBusinessGroupFromExtend(_0x58f63f[_0x2e8da8(0x1ff)]);}function readBusinessGroupFromExtend(_0x16224a){const _0xd15233=a59_0x182055;if(_0x16224a===undefined||_0x16224a===null||_0x16224a==='')return{'found':![]};if(typeof _0x16224a===_0xd15233(0x204))try{const _0x1e8356=JSON['parse'](_0x16224a);return readBusinessGroupFromExtend(_0x1e8356);}catch{return{'found':![]};}const _0x32f64e=asPlainObject(_0x16224a);if(Object[_0xd15233(0x202)][_0xd15233(0x201)][_0xd15233(0x205)](_0x32f64e,_0xd15233(0x209)))return{'found':!![],'value':_0x32f64e[_0xd15233(0x209)]};return{'found':![]};}function firstPresent(..._0x1b9a91){for(const _0x2a5ac5 of _0x1b9a91){if(_0x2a5ac5!==undefined&&_0x2a5ac5!==null)return{'found':!![],'value':_0x2a5ac5};}return{'found':![]};}function a59_0x1797(){const _0x16c27=['28mtrRqS','modelId','modelCode','trim','4058456xPiVpG','4077558xJrqkY','POST','extend','283468ftVfqQ','hasOwnProperty','prototype','dbtableConfig','string','call','payload','926865qqwxBM','3111564qVWTms','businessGroup','Dry-run:\x20business\x20scenario\x20group\x20would\x20change\x20for\x20dataset\x20','data','Expected\x20','1384251KMcCVV','update','sourceType','--business-group\x20is\x20required','10DwNtZE','toUpperCase','number','DB_TABLE','str','dataset','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','expect-business-group','stringify','validation','code','Expectation\x20mismatch\x20at\x20businessGroup','Business\x20scenario\x20group\x20readback\x20must\x20be\x20available\x20by\x20datasetCode;\x20upgrade\x20the\x20backend\x20read\x20contract\x20instead\x20of\x20using\x20dblinkId/tableName.','expectBusinessGroup','appCode','found','1vzvLHU','keys','message','length','datasetCode','156tyEwvO','write','value','7CcGUYX',',\x20actual\x20','Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.','229287bOGTnY','matched','unchanged','datasetName','datasetId','business-group-update','/smartapi/question/er-config/business-group/edit','isArray','source','name','METADATA','Dataset\x20detail\x20does\x20not\x20expose\x20businessGroup.'];a59_0x1797=function(){return _0x16c27;};return a59_0x1797();}function assertExpectedBusinessGroup(_0x4574cd,_0x481386){const _0x2e8950=a59_0x182055;if(_0x481386===undefined)return;const _0x1b4da8=normalizeBusinessGroup(_0x481386);if(_0x4574cd!==_0x1b4da8)throw CliErrors['validation'](_0x2e8950(0x21c),_0x2e8950(0x20c)+JSON[_0x2e8950(0x219)](_0x1b4da8)+_0x2e8950(0x22a)+JSON[_0x2e8950(0x219)](_0x4574cd));}function buildBackendPayload(_0x2644ed,_0x3bcc34,_0x241cf3){const _0x257aa7=a59_0x182055;return{'appCode':_0x2644ed,'datasetCode':_0x3bcc34[_0x257aa7(0x21b)],'businessGroup':_0x241cf3};}function normalizeBusinessGroup(_0x49525f){if(_0x49525f===undefined||_0x49525f===null)return'';return String(_0x49525f)['trim']();}function asPlainObject(_0x40ff8b){const _0x313c85=a59_0x182055;if(!_0x40ff8b||typeof _0x40ff8b!=='object'||Array[_0x313c85(0x1f3)](_0x40ff8b))return{};return _0x40ff8b;}function firstString(..._0x394d04){const _0xc6f38c=a59_0x182055;for(const _0x3c0232 of _0x394d04){if(typeof _0x3c0232===_0xc6f38c(0x204)&&_0x3c0232[_0xc6f38c(0x1fb)]())return _0x3c0232[_0xc6f38c(0x1fb)]();if(typeof _0x3c0232===_0xc6f38c(0x213)&&Number['isFinite'](_0x3c0232))return String(_0x3c0232);}return undefined;}function firstNumber(..._0x5496e0){const _0x3c5c08=a59_0x182055;for(const _0x2999fa of _0x5496e0){if(typeof _0x2999fa===_0x3c5c08(0x213)&&Number['isFinite'](_0x2999fa))return _0x2999fa;if(typeof _0x2999fa===_0x3c5c08(0x204)&&_0x2999fa[_0x3c5c08(0x1fb)]()&&Number['isFinite'](Number(_0x2999fa)))return Number(_0x2999fa);}return null;}function trim(_0x428638){const _0x44c452=a59_0x182055;return String(_0x428638||'')[_0x44c452(0x1fb)]();}
|
|
1
|
+
const a59_0x4c76e9=a59_0x3d59;(function(_0x119ed2,_0xbf16fb){const _0x2f7775=a59_0x3d59,_0x5a0ca2=_0x119ed2();while(!![]){try{const _0x2d333b=parseInt(_0x2f7775(0x1da))/0x1+-parseInt(_0x2f7775(0x1ae))/0x2+parseInt(_0x2f7775(0x1c9))/0x3*(-parseInt(_0x2f7775(0x1bc))/0x4)+parseInt(_0x2f7775(0x1cb))/0x5*(-parseInt(_0x2f7775(0x1cd))/0x6)+parseInt(_0x2f7775(0x1de))/0x7+-parseInt(_0x2f7775(0x1d9))/0x8+parseInt(_0x2f7775(0x1b0))/0x9;if(_0x2d333b===_0xbf16fb)break;else _0x5a0ca2['push'](_0x5a0ca2['shift']());}catch(_0x1c1f9f){_0x5a0ca2['push'](_0x5a0ca2['shift']());}}}(a59_0x5b03,0x66db7));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateErBusinessGroup}from'../../core/api-client.js';function a59_0x5b03(){const _0x123cff=['Expected\x20current\x20business\x20scenario\x20group;\x20mismatch\x20aborts\x20without\x20writing','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','apiError','unchanged','Update\x20business\x20scenario\x20group','hasOwnProperty','sourceType','string','Updated\x20business\x20scenario\x20group\x20for\x20dataset\x20','backend','Expectation\x20mismatch\x20at\x20businessGroup','Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.','48YuakRf','value','10JZvEaX','code','2233482QllHit','keys','isFinite','prototype','str','stringify','dbtableConfig','appCode','Business\x20scenario\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','business-group-update','datasetName','expect-business-group','293352jnPjIr','560554MSHouS','found','POST','/smartapi/question/er-config/business-group/edit','3991043DeyAWr','modelId','data','datasetId','matched','object','Dataset\x20detail\x20does\x20not\x20expose\x20businessGroup.','toUpperCase','datasetCode','DB_TABLE','208366HoXMdr','dataset','6593562ZxqRoA','METADATA','name','Expected\x20','businessGroup','extend','trim','write',',\x20actual\x20','source','business-group','validation','139168JNyryL'];a59_0x5b03=function(){return _0x123cff;};return a59_0x5b03();}import{CliErrors}from'../../errors.js';const BACKEND_PATH=a59_0x4c76e9(0x1dd);export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x1ef15c,input:_0x12b714,dryRun:_0x2d4240}){const _0xbfe9aa=a59_0x4c76e9;validateInput(_0x12b714);const _0x4cdac1=normalizeBusinessGroup(_0x12b714[_0xbfe9aa(0x1b4)]),_0x553eb8=await getDatasetDetail(_0x12b714[_0xbfe9aa(0x1cc)]),_0x2b427d=resolveBusinessGroupDataset(_0x553eb8,_0x12b714[_0xbfe9aa(0x1cc)]),_0x4340fa=loadCurrentBusinessGroup(_0x553eb8,_0x2b427d);assertExpectedBusinessGroup(_0x4340fa,_0x12b714['expectBusinessGroup']);const _0x54090b=buildBackendPayload(_0x1ef15c,_0x2b427d,_0x4cdac1),_0x4837e2=_0x4340fa!==_0x4cdac1;let _0x4b7f77;if(_0x4837e2&&!_0x2d4240){await updateErBusinessGroup(_0x54090b);const _0x1567af=await getDatasetDetail(_0x2b427d[_0xbfe9aa(0x1cc)]),_0x163cbd=resolveBusinessGroupDataset(_0x1567af,_0x2b427d[_0xbfe9aa(0x1cc)]),_0x3bce1f=loadCurrentBusinessGroup(_0x1567af,_0x163cbd);if(_0x3bce1f!==_0x4cdac1)throw CliErrors[_0xbfe9aa(0x1bf)](_0xbfe9aa(0x1d5),_0xbfe9aa(0x1b3)+JSON[_0xbfe9aa(0x1d2)](_0x4cdac1)+_0xbfe9aa(0x1b8)+JSON[_0xbfe9aa(0x1d2)](_0x3bce1f)+'.');_0x4b7f77={'verified':!![],'status':_0xbfe9aa(0x1a8),'afterReadback':{'businessGroup':_0x3bce1f}};}else!_0x4837e2&&(_0x4b7f77={'verified':!![],'status':_0xbfe9aa(0x1c0),'afterReadback':{'businessGroup':_0x4340fa}});const _0x5a9736={'operation':'update','appCode':_0x1ef15c,'selector':{'code':_0x2b427d[_0xbfe9aa(0x1cc)]},'dataset':_0x2b427d,'before':{'businessGroup':_0x4340fa},'after':{'businessGroup':_0x4cdac1},'changed':_0x4837e2,'dryRun':_0x2d4240,'submitted':_0x4837e2&&!_0x2d4240,'backend':{'method':_0xbfe9aa(0x1dc),'path':BACKEND_PATH,'payload':_0x54090b},..._0x4b7f77?{'verification':_0x4b7f77}:{},'warnings':[]};return{'ok':!![],'data':_0x5a9736,'message':_0x4837e2?_0x2d4240?'Dry-run:\x20business\x20scenario\x20group\x20would\x20change\x20for\x20dataset\x20'+_0x2b427d[_0xbfe9aa(0x1cc)]:_0xbfe9aa(0x1c5)+_0x2b427d[_0xbfe9aa(0x1cc)]:'No\x20changes\x20for\x20business\x20scenario\x20group\x20on\x20dataset\x20'+_0x2b427d[_0xbfe9aa(0x1cc)]};}function a59_0x3d59(_0x487afa,_0xab52c){_0x487afa=_0x487afa-0x1a7;const _0x5b0309=a59_0x5b03();let _0x3d5955=_0x5b0309[_0x487afa];return _0x3d5955;}export const datasetBusinessGroupUpdate={'service':a59_0x4c76e9(0x1af),'command':a59_0x4c76e9(0x1d6),'description':a59_0x4c76e9(0x1c1),'risk':a59_0x4c76e9(0x1b7),'flags':[CODE_FLAG,{'name':a59_0x4c76e9(0x1ba),'type':a59_0x4c76e9(0x1c4),'required':!![],'description':a59_0x4c76e9(0x1be)},{'name':a59_0x4c76e9(0x1d8),'type':a59_0x4c76e9(0x1c4),'required':![],'description':a59_0x4c76e9(0x1bd)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x389070){validateInput(readBusinessGroupUpdateInput(_0x389070));},async 'dryRun'(_0x103822){const _0x9d05b5=a59_0x4c76e9,_0x2deb1c=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x103822['appCode'],'input':readBusinessGroupUpdateInput(_0x103822),'dryRun':!![]});return{'method':_0x9d05b5(0x1dc),'url':BACKEND_PATH,'body':_0x2deb1c[_0x9d05b5(0x1e0)][_0x9d05b5(0x1c6)]['payload'],'description':_0x2deb1c['message'],..._0x2deb1c[_0x9d05b5(0x1e0)]};},async 'execute'(_0x462536){const _0x2e108d=a59_0x4c76e9;return buildDatasetBusinessGroupUpdateResult({'appCode':_0x462536[_0x2e108d(0x1d4)],'input':readBusinessGroupUpdateInput(_0x462536),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x206a0e){const _0x149654=a59_0x4c76e9,_0x3ca3d4=_0x206a0e[_0x149654(0x1d1)]('expect-business-group');return{'code':trim(_0x206a0e[_0x149654(0x1d1)](_0x149654(0x1cc))),'businessGroup':_0x206a0e['str'](_0x149654(0x1ba)),'expectBusinessGroup':_0x3ca3d4===undefined||_0x3ca3d4===''?undefined:_0x3ca3d4};}function validateInput(_0x56bf13){const _0xc1897b=a59_0x4c76e9;if(!trim(_0x56bf13[_0xc1897b(0x1cc)]))throw CliErrors[_0xc1897b(0x1bb)]('--code\x20is\x20required');if(_0x56bf13[_0xc1897b(0x1b4)]===undefined)throw CliErrors[_0xc1897b(0x1bb)]('--business-group\x20is\x20required');}function resolveBusinessGroupDataset(_0x4cfa96,_0x46c621){const _0xf0e230=a59_0x4c76e9,_0x5884db=asPlainObject(_0x4cfa96[_0xf0e230(0x1af)]),_0x28d389=asPlainObject(_0x4cfa96[_0xf0e230(0x1d3)]),_0x8f7d2a=resolveSourceType(_0x4cfa96,_0x5884db,_0x28d389),_0x4a9df7=firstString(_0x4cfa96['modelCode'],_0x4cfa96[_0xf0e230(0x1cc)],_0x5884db[_0xf0e230(0x1ac)],_0x46c621)||_0x46c621;return{'id':firstNumber(_0x4cfa96[_0xf0e230(0x1df)],_0x4cfa96['id'],_0x5884db['datasetId'])??firstString(_0x4cfa96[_0xf0e230(0x1df)],_0x4cfa96['id'],_0x5884db[_0xf0e230(0x1a7)])??null,'code':_0x4a9df7,'name':firstString(_0x4cfa96[_0xf0e230(0x1b2)],_0x5884db[_0xf0e230(0x1d7)],_0x5884db['name'])||null,'sourceType':_0x8f7d2a};}function resolveSourceType(_0x451d46,_0x5d1934,_0x40d03d){const _0x3dc560=a59_0x4c76e9,_0x5e724c=firstString(_0x451d46[_0x3dc560(0x1b9)],_0x451d46[_0x3dc560(0x1c3)],_0x5d1934[_0x3dc560(0x1b9)],_0x5d1934['sourceType'])?.[_0x3dc560(0x1b6)]()[_0x3dc560(0x1ab)]();if(_0x5e724c===_0x3dc560(0x1ad)||_0x5e724c===_0x3dc560(0x1b1))return _0x5e724c;if(Object[_0x3dc560(0x1ce)](_0x40d03d)['length']>0x0)return _0x3dc560(0x1ad);throw CliErrors[_0x3dc560(0x1bb)](_0x3dc560(0x1c8));}function loadCurrentBusinessGroup(_0x19487b,_0x334d75){const _0x58f8b7=a59_0x4c76e9,_0x599d23=readBusinessGroupFromDatasetDetail(_0x19487b,_0x334d75[_0x58f8b7(0x1c3)]);if(_0x599d23['found'])return normalizeBusinessGroup(_0x599d23[_0x58f8b7(0x1ca)]);if(_0x334d75[_0x58f8b7(0x1c3)]===_0x58f8b7(0x1b1))return'';throw CliErrors[_0x58f8b7(0x1bb)](_0x58f8b7(0x1aa),'Business\x20scenario\x20group\x20readback\x20must\x20be\x20available\x20by\x20datasetCode;\x20upgrade\x20the\x20backend\x20read\x20contract\x20instead\x20of\x20using\x20dblinkId/tableName.');}function readBusinessGroupFromDatasetDetail(_0x13d167,_0x3e2f6e){const _0x3fac6b=a59_0x4c76e9,_0x40a827=asPlainObject(_0x13d167[_0x3fac6b(0x1af)]),_0x17da6e=firstPresent(_0x13d167[_0x3fac6b(0x1b4)]);if(_0x17da6e['found'])return _0x17da6e;const _0x591e38=firstPresent(_0x40a827[_0x3fac6b(0x1b4)]);if(_0x591e38[_0x3fac6b(0x1db)])return _0x591e38;if(_0x3e2f6e===_0x3fac6b(0x1ad))return{'found':![]};const _0x2a1765=readBusinessGroupFromExtend(_0x13d167['extend']);if(_0x2a1765[_0x3fac6b(0x1db)])return _0x2a1765;return readBusinessGroupFromExtend(_0x40a827[_0x3fac6b(0x1b5)]);}function readBusinessGroupFromExtend(_0x1748dd){const _0x44ed69=a59_0x4c76e9;if(_0x1748dd===undefined||_0x1748dd===null||_0x1748dd==='')return{'found':![]};if(typeof _0x1748dd===_0x44ed69(0x1c4))try{const _0x51dab1=JSON['parse'](_0x1748dd);return readBusinessGroupFromExtend(_0x51dab1);}catch{return{'found':![]};}const _0x4a3e5d=asPlainObject(_0x1748dd);if(Object[_0x44ed69(0x1d0)][_0x44ed69(0x1c2)]['call'](_0x4a3e5d,_0x44ed69(0x1b4)))return{'found':!![],'value':_0x4a3e5d['businessGroup']};return{'found':![]};}function firstPresent(..._0x159d2c){for(const _0x35f435 of _0x159d2c){if(_0x35f435!==undefined&&_0x35f435!==null)return{'found':!![],'value':_0x35f435};}return{'found':![]};}function assertExpectedBusinessGroup(_0x507c61,_0x518c18){const _0x5ee5ae=a59_0x4c76e9;if(_0x518c18===undefined)return;const _0x59ed3f=normalizeBusinessGroup(_0x518c18);if(_0x507c61!==_0x59ed3f)throw CliErrors['validation'](_0x5ee5ae(0x1c7),_0x5ee5ae(0x1b3)+JSON[_0x5ee5ae(0x1d2)](_0x59ed3f)+',\x20actual\x20'+JSON[_0x5ee5ae(0x1d2)](_0x507c61));}function buildBackendPayload(_0xf28079,_0x4010e5,_0x2ef091){return{'appCode':_0xf28079,'datasetCode':_0x4010e5['code'],'businessGroup':_0x2ef091};}function normalizeBusinessGroup(_0xa50eb9){const _0x909edd=a59_0x4c76e9;if(_0xa50eb9===undefined||_0xa50eb9===null)return'';return String(_0xa50eb9)[_0x909edd(0x1b6)]();}function asPlainObject(_0x1f3c51){const _0x394bf1=a59_0x4c76e9;if(!_0x1f3c51||typeof _0x1f3c51!==_0x394bf1(0x1a9)||Array['isArray'](_0x1f3c51))return{};return _0x1f3c51;}function firstString(..._0x511235){const _0x5e05ce=a59_0x4c76e9;for(const _0x42402a of _0x511235){if(typeof _0x42402a==='string'&&_0x42402a[_0x5e05ce(0x1b6)]())return _0x42402a[_0x5e05ce(0x1b6)]();if(typeof _0x42402a==='number'&&Number[_0x5e05ce(0x1cf)](_0x42402a))return String(_0x42402a);}return undefined;}function firstNumber(..._0x49f040){const _0x562980=a59_0x4c76e9;for(const _0x1a7e22 of _0x49f040){if(typeof _0x1a7e22==='number'&&Number[_0x562980(0x1cf)](_0x1a7e22))return _0x1a7e22;if(typeof _0x1a7e22===_0x562980(0x1c4)&&_0x1a7e22[_0x562980(0x1b6)]()&&Number['isFinite'](Number(_0x1a7e22)))return Number(_0x1a7e22);}return null;}function trim(_0x554550){return String(_0x554550||'')['trim']();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a60_0x26513d=a60_0x55f1;(function(_0x9d4531,_0x1cecf0){const _0x56fecd=a60_0x55f1,_0x30d67d=_0x9d4531();while(!![]){try{const _0x329aca=parseInt(_0x56fecd(0x14d))/0x1*(-parseInt(_0x56fecd(0x159))/0x2)+parseInt(_0x56fecd(0x143))/0x3+-parseInt(_0x56fecd(0x148))/0x4*(-parseInt(_0x56fecd(0x142))/0x5)+parseInt(_0x56fecd(0x15d))/0x6*(-parseInt(_0x56fecd(0x154))/0x7)+-parseInt(_0x56fecd(0x150))/0x8*(-parseInt(_0x56fecd(0x157))/0x9)+parseInt(_0x56fecd(0x15c))/0xa+-parseInt(_0x56fecd(0x149))/0xb;if(_0x329aca===_0x1cecf0)break;else _0x30d67d['push'](_0x30d67d['shift']());}catch(_0x4efd97){_0x30d67d['push'](_0x30d67d['shift']());}}}(a60_0x2d4e,0x8049d));import{CliErrors}from'../../errors.js';export const RUNTIME_DATA_ACCESS_COMMANDS={'cli':a60_0x26513d(0x155),'filter':a60_0x26513d(0x146),'getOne':a60_0x26513d(0x145)};export const RUNTIME_DATA_ACCESS_SUMMARY=a60_0x26513d(0x14c);function valueToString(_0x1882fb){const _0x3486a2=a60_0x26513d;return _0x1882fb==null?'':String(_0x1882fb)[_0x3486a2(0x15b)]();}function getDatasetCode(_0x4fcc16){const _0x57761d=a60_0x26513d;return valueToString(_0x4fcc16[_0x57761d(0x151)]??_0x4fcc16['modelCode']??_0x4fcc16[_0x57761d(0x15e)]?.['datasetCode']);}function a60_0x55f1(_0x5287d0,_0x1ffc21){_0x5287d0=_0x5287d0-0x142;const _0x2d4e0a=a60_0x2d4e();let _0x55f1e6=_0x2d4e0a[_0x5287d0];return _0x55f1e6;}function getDatasetName(_0x4eb2d6){const _0xba3ba8=a60_0x26513d;return valueToString(_0x4eb2d6[_0xba3ba8(0x14b)]??_0x4eb2d6[_0xba3ba8(0x15e)]?.[_0xba3ba8(0x14f)])||_0xba3ba8(0x163);}function getDatasetSource(_0xd38bfc){const _0x9de100=a60_0x26513d;return valueToString(_0xd38bfc[_0x9de100(0x161)]??_0xd38bfc['dataset']?.[_0x9de100(0x144)])[_0x9de100(0x15f)]();}function a60_0x2d4e(){const _0x4b9f3c=['3144440DwAYlK','18tSCjnV','dataset','toUpperCase','\x20类型,没有可用于\x20','source','原因:schema\x20introspection\x20与\x20custom\x20SQL\x20需要\x20source=DB_TABLE、dbtableConfig.dbId、dbtableConfig.tableName\x20与数据库连接上下文。','unknown','dbtableConfig','393830nqwpzH','2312949vbxBps','sourceType','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27\x20--format\x20compress','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27<json>\x27\x20--format\x20compress','validation','24dvLjqb','147994hHLLuU','当前数据集\x20\x22','name','Use\x20lovrabet\x20data\x20filter/getOne\x20for\x20real\x20runtime\x20records.','4BssHnq','tableName','datasetName','8qAEvtX','code','filter','UNKNOWN','1542891HiFzxH','lovrabet','length','5469399XLpBUP','如果只是查看运行态真实行数据,请切换到\x20lovrabet\x20CLI:','482786fUGYAK','请先将该数据集升级/迁移为\x20DB_TABLE\x20数据集,再基于新的\x20dataset\x20code\x20继续开发。','trim'];a60_0x2d4e=function(){return _0x4b9f3c;};return a60_0x2d4e();}function getDbtableConfig(_0x112823){const _0x491463=a60_0x26513d,_0x11fa9a=_0x112823[_0x491463(0x164)]??_0x112823['dbtable'];return _0x11fa9a&&typeof _0x11fa9a==='object'?_0x11fa9a:{};}export function isDbTableBackedDataset(_0x292bd0){const _0x53fed5=a60_0x26513d,_0x4b637a=getDatasetSource(_0x292bd0);if(_0x4b637a==='METADATA')return![];const _0x38c2f7=getDbtableConfig(_0x292bd0),_0x1cc4cc=_0x38c2f7['dbId']??_0x38c2f7['id'],_0x565173=valueToString(_0x38c2f7[_0x53fed5(0x14e)]??_0x292bd0[_0x53fed5(0x14e)]??_0x292bd0['dataset']?.[_0x53fed5(0x14e)]);return _0x1cc4cc!==undefined&&_0x1cc4cc!==null&&_0x565173[_0x53fed5(0x156)]>0x0;}export function filterDbTableBackedDatasets(_0xec0f3b){const _0x548444=a60_0x26513d;return _0xec0f3b[_0x548444(0x152)](_0x2bd4c6=>isDbTableBackedDataset(_0x2bd4c6));}export function buildDbTableBackedRequirementMessage(_0x46b67b,_0x57e07f='SQL\x20schema\x20validation'){const _0x2d04bd=a60_0x26513d,_0x472dde=getDatasetSource(_0x46b67b)||_0x2d04bd(0x153),_0x261707=getDatasetName(_0x46b67b),_0x1a3fe2=getDatasetCode(_0x46b67b),_0x3e10d0=_0x1a3fe2?'\x20('+_0x1a3fe2+')':'';return[_0x2d04bd(0x14a)+_0x261707+'\x22'+_0x3e10d0+'\x20是\x20'+_0x472dde+_0x2d04bd(0x160)+_0x57e07f+'\x20的\x20DB_TABLE\x20数据源上下文。',_0x2d04bd(0x162),_0x2d04bd(0x15a),_0x2d04bd(0x158)+RUNTIME_DATA_ACCESS_COMMANDS[_0x2d04bd(0x152)]+';'+RUNTIME_DATA_ACCESS_COMMANDS['getOne']+'。']['join']('\x20');}export function assertDatasetIsDbTableBacked(_0x288033,_0x6c25c8){const _0x281daa=a60_0x26513d;if(!isDbTableBackedDataset(_0x288033))throw CliErrors[_0x281daa(0x147)](buildDbTableBackedRequirementMessage(_0x288033,_0x6c25c8));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a61_0x4bd1aa=a61_0x24d2;(function(_0x404aba,_0x21dbe5){const _0x9a9842=a61_0x24d2,_0x395d31=_0x404aba();while(!![]){try{const _0x46f7df=parseInt(_0x9a9842(0x16b))/0x1+parseInt(_0x9a9842(0x17b))/0x2*(parseInt(_0x9a9842(0x16c))/0x3)+parseInt(_0x9a9842(0x181))/0x4*(-parseInt(_0x9a9842(0x173))/0x5)+parseInt(_0x9a9842(0x17d))/0x6+-parseInt(_0x9a9842(0x18f))/0x7*(-parseInt(_0x9a9842(0x18d))/0x8)+parseInt(_0x9a9842(0x17f))/0x9+-parseInt(_0x9a9842(0x174))/0xa;if(_0x46f7df===_0x21dbe5)break;else _0x395d31['push'](_0x395d31['shift']());}catch(_0x2b08e1){_0x395d31['push'](_0x395d31['shift']());}}}(a61_0x4ba6,0xa1cd1));import{deleteDataset,getDatasetDetail,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL,CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const DATASET_ID_FLAG={'name':'id','type':a61_0x4bd1aa(0x168),'description':a61_0x4bd1aa(0x187)},DBID_FLAG={'name':a61_0x4bd1aa(0x176),'type':a61_0x4bd1aa(0x168),'description':'Delete\x20all\x20datasets\x20under\x20this\x20database\x20connection\x20id'},CONFIRM_FLAG={'name':'confirm','type':a61_0x4bd1aa(0x16f),'description':'Required\x20to\x20execute\x20dataset\x20deletion'},EXPECTED_COUNT_FLAG={'name':a61_0x4bd1aa(0x189),'type':a61_0x4bd1aa(0x168),'description':a61_0x4bd1aa(0x167)};export const datasetDelete={'service':'dataset','command':'delete','description':'Delete\x20dataset\x20metadata\x20by\x20id/code\x20or\x20all\x20datasets\x20under\x20a\x20db\x20id','risk':'high-risk-write','flags':[DATASET_ID_FLAG,CODE_FLAG_OPTIONAL,DBID_FLAG,CONFIRM_FLAG,EXPECTED_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x549a88){const _0x472906=a61_0x4bd1aa,_0x147518=_0x549a88[_0x472906(0x182)]('id'),_0x269e93=_0x549a88[_0x472906(0x191)](_0x472906(0x18b)),_0xbccb19=_0x549a88['num']('dbid'),_0x543f20=[_0x147518>0x0,Boolean(_0x269e93),_0xbccb19>0x0][_0x472906(0x179)](Boolean);if(_0x543f20[_0x472906(0x170)]===0x0)throw CliErrors[_0x472906(0x17a)]('One\x20of\x20--id,\x20--code,\x20or\x20--dbid\x20is\x20required.');if(_0x543f20[_0x472906(0x170)]>0x1)throw CliErrors['validation'](_0x472906(0x17c));},async 'dryRun'(_0x554dd5){const _0x4f02ae=a61_0x4bd1aa,_0x1e7dc3=await resolveTargets(_0x554dd5);return{'method':'POST','url':_0x4f02ae(0x18e),'body':{'appCode':_0x554dd5[_0x4f02ae(0x185)],'count':_0x1e7dc3[_0x4f02ae(0x170)],'datasets':_0x1e7dc3},'description':_0x4f02ae(0x16e)+_0x1e7dc3[_0x4f02ae(0x170)]+_0x4f02ae(0x169)};},async 'execute'(_0x2d79d4){const _0x24fbf1=a61_0x4bd1aa;if(!_0x2d79d4['bool'](_0x24fbf1(0x190)))throw CliErrors[_0x24fbf1(0x17a)](_0x24fbf1(0x18c),_0x24fbf1(0x171));const _0x5b0e16=await resolveTargets(_0x2d79d4),_0x1adaa0=[],_0xc1de6f=[];for(const _0x396b36 of _0x5b0e16){try{await deleteDataset(_0x2d79d4['appCode'],_0x396b36['id']),_0x1adaa0['push'](_0x396b36);}catch(_0x5c417b){_0xc1de6f[_0x24fbf1(0x180)]({..._0x396b36,'error':_0x5c417b instanceof Error?_0x5c417b[_0x24fbf1(0x178)]:String(_0x5c417b)});}}if(_0xc1de6f[_0x24fbf1(0x170)]>0x0)return{'ok':![],'data':{'requested':_0x5b0e16[_0x24fbf1(0x170)],'deletedCount':_0x1adaa0[_0x24fbf1(0x170)],'failedCount':_0xc1de6f[_0x24fbf1(0x170)],'deleted':_0x1adaa0,'failed':_0xc1de6f},'message':_0x24fbf1(0x184)+_0x1adaa0[_0x24fbf1(0x170)]+'/'+_0x5b0e16[_0x24fbf1(0x170)]+'\x20dataset(s);\x20'+_0xc1de6f[_0x24fbf1(0x170)]+_0x24fbf1(0x192)};return{'ok':!![],'data':{'requested':_0x5b0e16['length'],'deletedCount':_0x1adaa0[_0x24fbf1(0x170)],'deleted':_0x1adaa0},'message':'Deleted\x20'+_0x1adaa0[_0x24fbf1(0x170)]+_0x24fbf1(0x18a)};}};function a61_0x24d2(_0x25f465,_0x4444d9){_0x25f465=_0x25f465-0x167;const _0x4ba682=a61_0x4ba6();let _0x24d234=_0x4ba682[_0x25f465];return _0x24d234;}function a61_0x4ba6(){const _0x593163=['\x20dataset(s).\x20This\x20only\x20deletes\x20platform\x20dataset\x20metadata\x20and\x20related\x20page/menu\x20records,\x20not\x20physical\x20databases\x20or\x20tables.','description','372294wjGNVL','84xHnbsG','source','Would\x20delete\x20','boolean','length','Run\x20with\x20--dry-run\x20first,\x20then\x20add\x20--confirm\x20when\x20the\x20target\x20list\x20is\x20correct.','No\x20undeleted\x20dataset\x20found\x20for\x20','3955uRzpqX','8147940JwySTo','tableName','dbid','id=','message','filter','validation','16312OPHqtx','Use\x20only\x20one\x20of\x20--id,\x20--code,\x20or\x20--dbid.','1213110daHuYp','relatedPageInfoList','73404RLegqJ','push','2056tWAozw','num','object','Deleted\x20','appCode','dbtableConfig','Dataset\x20id','dbId','expected-count','\x20dataset(s)','code','--confirm\x20is\x20required\x20to\x20delete\x20datasets.','16mOfKFC','/smartapi/dataset/delete-dataset','3755857pzWvfu','confirm','str','\x20failed','Abort\x20unless\x20the\x20matched\x20dataset\x20count\x20equals\x20this\x20value','number'];a61_0x4ba6=function(){return _0x593163;};return a61_0x4ba6();}async function resolveTargets(_0x295c64){const _0x446335=a61_0x4bd1aa,_0x1f9f57=_0x295c64['num']('id'),_0x1c2feb=_0x295c64[_0x446335(0x191)](_0x446335(0x18b)),_0x5f0bb1=_0x295c64['num'](_0x446335(0x176));let _0x15b9b3;_0x1c2feb?(_0x15b9b3=await listDatasets(_0x295c64[_0x446335(0x185)],{'code':_0x1c2feb}),_0x15b9b3=_0x15b9b3['filter'](_0x4ab791=>_0x4ab791['code']===_0x1c2feb)):(_0x15b9b3=await listDatasets(_0x295c64['appCode']),_0x1f9f57>0x0&&(_0x15b9b3=_0x15b9b3[_0x446335(0x179)](_0x3c7e88=>_0x3c7e88['id']===_0x1f9f57)),_0x5f0bb1>0x0&&(_0x15b9b3=_0x15b9b3[_0x446335(0x179)](_0x38ba4f=>_0x38ba4f[_0x446335(0x186)]?.['dbId']===_0x5f0bb1)));const _0x2d2fb7=[];for(const _0x15aaf5 of _0x15b9b3){const _0x3f0939=await getDatasetDetail(_0x15aaf5[_0x446335(0x18b)]),_0x503770=Array['isArray'](_0x3f0939[_0x446335(0x17e)])?_0x3f0939[_0x446335(0x17e)][_0x446335(0x179)](_0x51c275=>_0x51c275!=null&&typeof _0x51c275===_0x446335(0x183)&&_0x51c275['deleted']!==!![]):[];_0x2d2fb7[_0x446335(0x180)](normalizeTarget(_0x15aaf5,_0x503770['length']));}if(_0x2d2fb7[_0x446335(0x170)]===0x0){const _0x268567=_0x1c2feb||(_0x1f9f57>0x0?_0x446335(0x177)+_0x1f9f57:'dbid='+_0x5f0bb1);throw CliErrors[_0x446335(0x17a)](_0x446335(0x172)+_0x268567+'.');}const _0x2c8148=_0x295c64[_0x446335(0x182)](_0x446335(0x189));if(_0x2c8148>0x0&&_0x2d2fb7[_0x446335(0x170)]!==_0x2c8148)throw CliErrors[_0x446335(0x17a)]('Matched\x20'+_0x2d2fb7[_0x446335(0x170)]+'\x20dataset(s),\x20but\x20--expected-count\x20is\x20'+_0x2c8148+'.');return _0x2d2fb7;}function normalizeTarget(_0x4870ac,_0x79979c){const _0xdbbbd4=a61_0x4bd1aa,_0x5d03ab=_0x4870ac[_0xdbbbd4(0x186)]??{};return{'id':_0x4870ac['id'],'code':_0x4870ac['code'],'name':_0x4870ac['name'],'description':_0x4870ac[_0xdbbbd4(0x16a)],'source':_0x4870ac[_0xdbbbd4(0x16d)],'dbId':_0x5d03ab[_0xdbbbd4(0x188)],'dbName':_0x5d03ab['dbName'],'tableName':_0x5d03ab[_0xdbbbd4(0x175)],'relatedPageCount':_0x79979c};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a62_0x21011a=a62_0x545e;(function(_0x4f4e71,_0xba3db3){const _0x62f851=a62_0x545e,_0x3a09e1=_0x4f4e71();while(!![]){try{const _0x53f37f=parseInt(_0x62f851(0x1ba))/0x1+parseInt(_0x62f851(0x1d4))/0x2+parseInt(_0x62f851(0x19f))/0x3+-parseInt(_0x62f851(0x1d6))/0x4*(-parseInt(_0x62f851(0x1b2))/0x5)+-parseInt(_0x62f851(0x1a4))/0x6*(parseInt(_0x62f851(0x1b6))/0x7)+parseInt(_0x62f851(0x18b))/0x8+-parseInt(_0x62f851(0x1c4))/0x9*(parseInt(_0x62f851(0x1cc))/0xa);if(_0x53f37f===_0xba3db3)break;else _0x3a09e1['push'](_0x3a09e1['shift']());}catch(_0x562ab2){_0x3a09e1['push'](_0x3a09e1['shift']());}}}(a62_0x8744,0x97768));import{getDatasetDetail}from'../../core/api-client.js';import{CODE_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function normalizeField(_0x45f9d6){const _0xaf522c=a62_0x545e;if(_0x45f9d6[_0xaf522c(0x197)])return null;const _0x453c7a=Boolean(_0x45f9d6[_0xaf522c(0x1b9)]!==undefined||_0x45f9d6[_0xaf522c(0x1ab)]!==undefined);let _0x2c1825={};if(!_0x453c7a&&typeof _0x45f9d6[_0xaf522c(0x19c)]===_0xaf522c(0x1a6))try{_0x2c1825=JSON[_0xaf522c(0x18f)](_0x45f9d6[_0xaf522c(0x19c)]);}catch{}const _0xc38bac=_0x453c7a?_0x45f9d6['name']:_0x45f9d6['code'],_0x4ccbb9=_0x453c7a?_0x45f9d6[_0xaf522c(0x1b9)]:_0x45f9d6[_0xaf522c(0x1ac)],_0x34afb9=_0x453c7a?_0x45f9d6[_0xaf522c(0x1ab)]:_0x45f9d6[_0xaf522c(0x1d2)]||_0x45f9d6[_0xaf522c(0x1a2)],_0x337b99=_0x453c7a?_0x45f9d6['pkField']===!![]:_0x2c1825['pkField']===!![],_0x4295c9=_0x453c7a?_0x45f9d6[_0xaf522c(0x1a8)]===!![]:_0x2c1825[_0xaf522c(0x1a8)]===!![],_0x157939=_0x453c7a?_0x45f9d6[_0xaf522c(0x195)]??null:_0x2c1825['options']??null,_0x11a7bd={'name':_0xc38bac,'displayName':_0x4ccbb9||_0xc38bac,'type':_0x34afb9,'dbType':_0x45f9d6[_0xaf522c(0x1c0)],'pk':_0x337b99,'required':_0x4295c9,'deprecated':_0x45f9d6[_0xaf522c(0x1bf)]===!![],'description':_0x45f9d6[_0xaf522c(0x1d5)]||undefined};return Array[_0xaf522c(0x196)](_0x157939)&&_0x157939[_0xaf522c(0x19e)]>0x0&&(_0x11a7bd[_0xaf522c(0x195)]=_0x157939),_0x11a7bd;}function parseJsonMaybe(_0x5e0052){const _0x3d534e=a62_0x545e;if(typeof _0x5e0052!=='string')return _0x5e0052;try{return JSON[_0x3d534e(0x18f)](_0x5e0052);}catch{return _0x5e0052;}}function normalizeOperationEntry(_0x28565e,_0x203270){const _0x82f26c=a62_0x545e;if(!_0x203270||typeof _0x203270!==_0x82f26c(0x1bd))return null;if(!_0x203270['method']||!_0x203270[_0x82f26c(0x1bb)])return null;const _0x46a298={'name':_0x28565e,'method':_0x203270[_0x82f26c(0x1c9)],'path':_0x203270[_0x82f26c(0x1bb)]};if(_0x203270[_0x82f26c(0x1ce)])_0x46a298[_0x82f26c(0x1ce)]=_0x203270[_0x82f26c(0x1ce)];if(_0x203270[_0x82f26c(0x1c2)]!=null){const _0x286225=parseJsonMaybe(_0x203270[_0x82f26c(0x1c2)]);_0x46a298[_0x82f26c(0x1c2)]=_0x286225;}if(_0x203270[_0x82f26c(0x19a)]!=null){const _0x2e139a=parseJsonMaybe(_0x203270['responseBody']);_0x46a298[_0x82f26c(0x19a)]=_0x2e139a;}if(_0x203270[_0x82f26c(0x1c6)]!=null)_0x46a298[_0x82f26c(0x1c6)]=_0x203270[_0x82f26c(0x1c6)];if(_0x203270[_0x82f26c(0x1b0)]!=null)_0x46a298['afterScriptId']=_0x203270[_0x82f26c(0x1b0)];if(Array[_0x82f26c(0x196)](_0x203270['requestFields']))_0x46a298[_0x82f26c(0x1cf)]=_0x203270[_0x82f26c(0x1cf)];if(Array[_0x82f26c(0x196)](_0x203270[_0x82f26c(0x1d7)]))_0x46a298[_0x82f26c(0x1d7)]=_0x203270[_0x82f26c(0x1d7)];return _0x46a298;}function summarizeDbtable(_0x230ed9){const _0x3bd5cc=a62_0x545e,_0x52950e={},_0x2d399e=[_0x3bd5cc(0x190),'dbName','tableName','datasetKey',_0x3bd5cc(0x1cd),_0x3bd5cc(0x18a),'logicField',_0x3bd5cc(0x1af),_0x3bd5cc(0x1c7),'creatorIdField','creatorNameField',_0x3bd5cc(0x1b5),'modifierNameField',_0x3bd5cc(0x18d),_0x3bd5cc(0x1b8)];for(const _0x187d6b of _0x2d399e){if(_0x230ed9[_0x187d6b]!==undefined)_0x52950e[_0x187d6b]=_0x230ed9[_0x187d6b];}return typeof _0x52950e[_0x3bd5cc(0x18a)]===_0x3bd5cc(0x1a6)&&_0x52950e[_0x3bd5cc(0x18a)]['length']>0x0&&(_0x52950e['allFieldNames']=_0x52950e[_0x3bd5cc(0x18a)][_0x3bd5cc(0x1a0)](',')['map'](_0x5d5b97=>_0x5d5b97[_0x3bd5cc(0x1d8)]())[_0x3bd5cc(0x1d9)](Boolean)),_0x52950e;}function normalizeRelatedPages(_0x58546c){const _0x57a699=a62_0x545e;if(!Array['isArray'](_0x58546c))return[];return _0x58546c[_0x57a699(0x1d9)](_0xd91262=>_0xd91262&&typeof _0xd91262===_0x57a699(0x1bd))[_0x57a699(0x1ae)](_0x135f94=>({'id':_0x135f94['id'],'type':_0x135f94[_0x57a699(0x1d2)],'code':_0x135f94['code'],'title':_0x135f94['title'],'deleted':_0x135f94[_0x57a699(0x197)]===!![]}));}function a62_0x8744(){const _0x4a81e7=['afterScriptId','toField','1772185lweILm','dbName','properties','modifierIdField','216587XbMdrE','doVersion','dblinkInfoDTO','displayName','1207235UyWuEp','path','dataset','object','detail','deprecated','dbType','modelCode','requestBody','cardinality','189pMWbbh','formatRules','beforeScriptId','updateTimeField','modelId','method','relationId','read','1487530IuanYJ','pkField','host','requestFields','source','dbtableConfig','type','sourceType','709828wpFnjk','description','4pBlKOo','responseFields','trim','filter','allFields','9041528qgbdwj','tableName','labelField','columnCodeListWithDeleted','parse','dbId','entries','relatedPageInfoList','toFieldLabel','main_sub','options','isArray','deleted','relations','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically','responseBody','tableComment','extend','toDatasetName','length','2370753hkBvGA','split','code','dataType','indexes','18WeauvB','validateRules','string','toTableName','required','str','alias','doType','name','push','map','createTimeField'];a62_0x8744=function(){return _0x4a81e7;};return a62_0x8744();}function a62_0x545e(_0x2ca08b,_0x1a01ac){_0x2ca08b=_0x2ca08b-0x18a;const _0x8744a9=a62_0x8744();let _0x545e3a=_0x8744a9[_0x2ca08b];return _0x545e3a;}export const datasetDetail={'service':a62_0x21011a(0x1bc),'command':a62_0x21011a(0x1be),'description':'Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','risk':a62_0x21011a(0x1cb),'flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':a62_0x21011a(0x1aa),'type':a62_0x21011a(0x1a6),'description':a62_0x21011a(0x199)}],async 'execute'(_0x2b6e95){const _0x1e1259=a62_0x21011a,_0x4d69ac=await getDatasetDetail(_0x2b6e95[_0x1e1259(0x1a9)](_0x1e1259(0x1a1))),_0x2c1b40=Array[_0x1e1259(0x196)](_0x4d69ac['fields'])?_0x4d69ac['fields']:Array[_0x1e1259(0x196)](_0x4d69ac[_0x1e1259(0x1b4)])?_0x4d69ac[_0x1e1259(0x1b4)]:[],_0xae02ec=_0x2c1b40[_0x1e1259(0x1ae)](_0x39830a=>normalizeField(_0x39830a))['filter'](_0xd3e654=>_0xd3e654!==null),_0x19514b=_0x4d69ac['operations']??{},_0x54b820=[];for(const [_0xf8fd4b,_0x2d70a4]of Object[_0x1e1259(0x191)](_0x19514b)){const _0x300281=normalizeOperationEntry(_0xf8fd4b,_0x2d70a4);if(_0x300281)_0x54b820[_0x1e1259(0x1ad)](_0x300281);}const _0xe0814e=_0x4d69ac[_0x1e1259(0x1d1)]??{},_0x4525aa=_0x4d69ac[_0x1e1259(0x1bc)]??{},_0x2630de=_0xe0814e[_0x1e1259(0x190)]!=null?{'id':_0xe0814e[_0x1e1259(0x190)],'name':_0xe0814e[_0x1e1259(0x1b3)]??null}:undefined;let _0x1345b1;return typeof _0x4d69ac[_0x1e1259(0x19c)]===_0x1e1259(0x1a6)&&(_0x1345b1=parseJsonMaybe(_0x4d69ac[_0x1e1259(0x19c)])),{'ok':!![],'data':{'id':_0x4d69ac[_0x1e1259(0x1c8)]??_0x4d69ac['id'],'name':_0x4d69ac['name'],'code':_0x4d69ac['modelCode']||_0x4d69ac['code'],'doVersion':_0x4d69ac[_0x1e1259(0x1b7)],'description':_0x4d69ac[_0x1e1259(0x1d5)]||_0x4525aa[_0x1e1259(0x19b)]||undefined,'source':_0x4d69ac[_0x1e1259(0x1d0)]||_0x4525aa[_0x1e1259(0x1d3)],'table':_0xe0814e[_0x1e1259(0x18c)]||_0x4525aa[_0x1e1259(0x18c)],'datasetKey':_0xe0814e['datasetKey'],'pk':_0xe0814e['pkField'],'db':_0x2630de,'dbtable':summarizeDbtable(_0xe0814e),'fields':_0xae02ec,'operations':_0x54b820,'indexes':Array[_0x1e1259(0x196)](_0x4525aa[_0x1e1259(0x1a3)])?_0x4525aa[_0x1e1259(0x1a3)]:[],'relations':Array[_0x1e1259(0x196)](_0x4d69ac[_0x1e1259(0x198)])?_0x4d69ac['relations'][_0x1e1259(0x1ae)](_0x48f5a7=>({..._0x48f5a7['relationId']!=null?{'relationId':_0x48f5a7[_0x1e1259(0x1ca)]}:{},'fromDataset':_0x4d69ac[_0x1e1259(0x1ac)],'fromCode':_0x4d69ac[_0x1e1259(0x1c1)]||_0x4d69ac[_0x1e1259(0x1a1)],'fromTable':_0xe0814e[_0x1e1259(0x18c)]||_0x4525aa['tableName'],'fromField':_0x48f5a7['fromField'],'toDataset':_0x48f5a7[_0x1e1259(0x19d)],'toCode':_0x48f5a7['toDatasetCode'],'toTable':_0x48f5a7[_0x1e1259(0x1a7)],'toField':_0x48f5a7[_0x1e1259(0x1b1)],'labelField':_0x48f5a7[_0x1e1259(0x193)]||undefined,'cardinality':_0x48f5a7[_0x1e1259(0x1c3)]||undefined,'bizRelationType':_0x48f5a7['bizRelationType']==='main_sub'?_0x1e1259(0x194):null})):[],'relatedPages':normalizeRelatedPages(_0x4d69ac[_0x1e1259(0x192)]),...Array[_0x1e1259(0x196)](_0x4d69ac[_0x1e1259(0x18e)])?{'columnCodeListWithDeleted':_0x4d69ac[_0x1e1259(0x18e)]}:{},'formatRules':Array[_0x1e1259(0x196)](_0x4d69ac[_0x1e1259(0x1c5)])?_0x4d69ac['formatRules']:[],'validateRules':Array[_0x1e1259(0x196)](_0x4d69ac[_0x1e1259(0x1a5)])?_0x4d69ac['validateRules']:[],..._0x1345b1!==undefined?{'extend':_0x1345b1}:{},'stats':{'fieldCount':_0xae02ec['length'],'operationCount':_0x54b820[_0x1e1259(0x19e)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a63_0x23a7(_0x5303c3,_0xb11bb2){_0x5303c3=_0x5303c3-0xdb;const _0x1effb2=a63_0x1eff();let _0x23a75c=_0x1effb2[_0x5303c3];return _0x23a75c;}const a63_0x45a435=a63_0x23a7;function a63_0x1eff(){const _0x564b97=['13320901PhuDxe','2566DRqhIs','--code\x20is\x20required','No\x20changes\x20for\x20dataset\x20extend',',\x20actual\x20','message','expect-json','18HfJoQX','write','modelId','trim','isArray','dataset','shape','\x20must\x20be\x20valid\x20JSON\x20object:\x20','hint','modelCode','datasetId','198zTWFID','--patch-json','tableName','str','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','stringify','from','entries','extend','keys','16152oqAnBU','dbName','JSON\x20object\x20of\x20expected\x20current\x20extend\x20values;\x20mismatch\x20aborts\x20without\x20writing','appCode','Updated\x20dataset\x20extend\x20(','parse','\x20must\x20be\x20a\x20JSON\x20object','Use\x20`rabetbase\x20dataset\x20business-group-update`\x20to\x20update\x20business\x20model\x20groups.','No\x20dataset\x20extend\x20patch\x20keys\x20are\x20currently\x20supported.','5837490wAdWex','code','Unsupported\x20patch\x20key:\x20','patch','validation','JSON\x20object\x20patch\x20for\x20dataset\x20top-level\x20extend;\x20current\x20allowlist\x20is\x20empty','818240djGRrE','1224114ZmNDno','345VYObAZ','Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object','sort','dbtableConfig','7IzoaTL','/smartapi/dataset/update-driven-data','string','businessGroup','data','Patch\x20dataset\x20top-level\x20extend\x20safely','506406gwUGOu','extend-update','dataset\x20extend-update\x20does\x20not\x20support\x20businessGroup;\x20use\x20dataset\x20business-group-update','join','Allowed\x20keys:\x20','POST','datasetName','length','extend.'];a63_0x1eff=function(){return _0x564b97;};return a63_0x1eff();}(function(_0x26a752,_0x522dbd){const _0x43cdb7=a63_0x23a7,_0xb9fd75=_0x26a752();while(!![]){try{const _0x1f7217=-parseInt(_0x43cdb7(0x104))/0x1+-parseInt(_0x43cdb7(0x10e))/0x2*(parseInt(_0x43cdb7(0xdf))/0x3)+parseInt(_0x43cdb7(0xe9))/0x4*(parseInt(_0x43cdb7(0xfa))/0x5)+parseInt(_0x43cdb7(0xf9))/0x6*(parseInt(_0x43cdb7(0xfe))/0x7)+-parseInt(_0x43cdb7(0xf8))/0x8*(parseInt(_0x43cdb7(0x114))/0x9)+-parseInt(_0x43cdb7(0xf2))/0xa+parseInt(_0x43cdb7(0x10d))/0xb;if(_0x1f7217===_0x522dbd)break;else _0xb9fd75['push'](_0xb9fd75['shift']());}catch(_0x59d904){_0xb9fd75['push'](_0xb9fd75['shift']());}}}(a63_0x1eff,0x4cb7f));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const MUTABLE_EXTEND_KEYS=new Set(),EXTEND_PATCH_REDIRECTS=new Map([[a63_0x45a435(0x101),{'message':a63_0x45a435(0x106),'hint':a63_0x45a435(0xf0)}]]);export function parseJsonObjectFlag(_0x317acd,_0x35bf8d){const _0x1c9211=a63_0x45a435;if(!_0x317acd)return undefined;let _0x1668b7;try{_0x1668b7=JSON[_0x1c9211(0xee)](_0x317acd);}catch(_0x58b65f){const _0x7a7c6e=_0x58b65f instanceof Error?_0x58b65f['message']:String(_0x58b65f);throw CliErrors[_0x1c9211(0xf6)](_0x35bf8d+_0x1c9211(0xdb)+_0x7a7c6e);}if(!isPlainObject(_0x1668b7)||Array[_0x1c9211(0x118)](_0x1668b7))throw CliErrors[_0x1c9211(0xf6)](_0x35bf8d+_0x1c9211(0xef));return _0x1668b7;}export function validateExtendPatchKeys(_0x202ae4){const _0xed7f1d=a63_0x45a435,_0x5c37a2=Object[_0xed7f1d(0xe8)](_0x202ae4);if(_0x5c37a2[_0xed7f1d(0x10b)]===0x0)throw CliErrors['validation'](_0xed7f1d(0xe3));for(const _0x3f8b1b of _0x5c37a2){const _0x7d23dd=EXTEND_PATCH_REDIRECTS['get'](_0x3f8b1b);if(_0x7d23dd)throw CliErrors[_0xed7f1d(0xf6)](_0x7d23dd[_0xed7f1d(0x112)],_0x7d23dd[_0xed7f1d(0xdc)]);if(!MUTABLE_EXTEND_KEYS['has'](_0x3f8b1b))throw CliErrors[_0xed7f1d(0xf6)](_0xed7f1d(0xf4)+_0x3f8b1b,describeMutableExtendKeys());}}function describeMutableExtendKeys(){const _0x16bed6=a63_0x45a435,_0x4710b4=Array[_0x16bed6(0xe5)](MUTABLE_EXTEND_KEYS)[_0x16bed6(0xfc)]();return _0x4710b4[_0x16bed6(0x10b)]>0x0?_0x16bed6(0x108)+_0x4710b4[_0x16bed6(0x107)](',\x20'):_0x16bed6(0xf1);}export function applyExtendPatch(_0x2fa4d9,_0x5ccf81){const _0x351d60=a63_0x45a435;validateExtendPatchKeys(_0x5ccf81);const _0x10a103=deepClone(_0x2fa4d9),_0x3d779f=[];for(const [_0x304757,_0xeff77f]of Object[_0x351d60(0xe6)](_0x5ccf81)){const _0xaf0b8b=_0x10a103[_0x304757],_0x210b9d=deepClone(_0xeff77f);!deepEqual(_0xaf0b8b,_0x210b9d)&&(_0x10a103[_0x304757]=_0x210b9d,_0x3d779f['push'](_0x351d60(0x10c)+_0x304757));}return _0x3d779f['sort'](),{'after':_0x10a103,'changedPaths':_0x3d779f,'changed':_0x3d779f[_0x351d60(0x10b)]>0x0};}export function assertExpectation(_0x58e314,_0x1fa897){const _0x269fe8=a63_0x45a435;if(!_0x1fa897)return;for(const [_0x5002c8,_0x1c3dee]of Object[_0x269fe8(0xe6)](_0x1fa897)){const _0x3129d9=_0x58e314[_0x5002c8];if(!deepEqual(_0x3129d9,_0x1c3dee))throw CliErrors[_0x269fe8(0xf6)]('Expectation\x20mismatch\x20at\x20extend.'+_0x5002c8,'Expected\x20'+JSON[_0x269fe8(0xe4)](_0x1c3dee)+_0x269fe8(0x111)+JSON[_0x269fe8(0xe4)](_0x3129d9));}}export async function buildDatasetExtendUpdateResult({appCode:_0x2d14fa,input:_0x1ad138,dryRun:_0x50c03c}){const _0x46ce03=a63_0x45a435;validateInput(_0x1ad138);const _0x4326c1=await getDatasetDetail(_0x1ad138[_0x46ce03(0xf3)]),_0x4d1a88=parseDatasetExtend(_0x4326c1[_0x46ce03(0xe7)]),_0x24e5a4=deepClone(_0x4d1a88['value']);assertExpectation(_0x24e5a4,_0x1ad138['expect']);const {after:_0x200d9f,changedPaths:_0x5c7fd0,changed:_0x95564d}=applyExtendPatch(_0x24e5a4,_0x1ad138['patch']),_0x4c505b=summarizeDataset(_0x4326c1,_0x1ad138[_0x46ce03(0xf3)]);return _0x95564d&&!_0x50c03c&&(_0x4326c1[_0x46ce03(0xe7)]=serializeDatasetExtend(_0x200d9f,_0x4d1a88[_0x46ce03(0x11a)]),await updateDrivenData(_0x4326c1)),{'ok':!![],'data':{'appCode':_0x2d14fa,'selector':{'code':_0x1ad138[_0x46ce03(0xf3)]},'dataset':_0x4c505b,'dryRun':_0x50c03c,'changed':_0x95564d,'changedPaths':_0x5c7fd0,'before':{'extend':_0x24e5a4},'after':{'extend':_0x200d9f},'submitted':_0x95564d&&!_0x50c03c},'message':_0x95564d?_0x50c03c?'Dry-run:\x20dataset\x20extend\x20would\x20change\x20('+_0x5c7fd0['join'](',\x20')+')':_0x46ce03(0xed)+_0x5c7fd0[_0x46ce03(0x107)](',\x20')+')':_0x46ce03(0x110)};}export const datasetExtendUpdate={'service':a63_0x45a435(0x119),'command':a63_0x45a435(0x105),'description':a63_0x45a435(0x103),'risk':a63_0x45a435(0x115),'flags':[CODE_FLAG,{'name':'patch-json','type':a63_0x45a435(0x100),'required':!![],'description':a63_0x45a435(0xf7)},{'name':'expect-json','type':a63_0x45a435(0x100),'required':![],'description':a63_0x45a435(0xeb)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x10e96f){validateInput(readExtendUpdateInput(_0x10e96f));},async 'dryRun'(_0xa2c103){const _0x28e469=a63_0x45a435,_0x48a6ef=await buildDatasetExtendUpdateResult({'appCode':_0xa2c103['appCode'],'input':readExtendUpdateInput(_0xa2c103),'dryRun':!![]});return{'method':_0x28e469(0x109),'url':_0x28e469(0xff),'body':_0x48a6ef[_0x28e469(0x102)],'description':_0x48a6ef[_0x28e469(0x112)]};},async 'execute'(_0x497488){const _0x249a06=a63_0x45a435;return buildDatasetExtendUpdateResult({'appCode':_0x497488[_0x249a06(0xec)],'input':readExtendUpdateInput(_0x497488),'dryRun':![]});}};function readExtendUpdateInput(_0x5dd871){const _0x5c8d87=a63_0x45a435,_0x1ff7e0=trim(_0x5dd871['str']('code')),_0x502ca2=parseJsonObjectFlag(_0x5dd871[_0x5c8d87(0xe2)]('patch-json'),_0x5c8d87(0xe0)),_0x38bbd2=parseJsonObjectFlag(_0x5dd871[_0x5c8d87(0xe2)](_0x5c8d87(0x113)),'--expect-json');return{'code':_0x1ff7e0,'patch':_0x502ca2||{},'expect':_0x38bbd2};}function validateInput(_0x1a0429){const _0x36d84f=a63_0x45a435;if(!_0x1a0429[_0x36d84f(0xf3)])throw CliErrors[_0x36d84f(0xf6)](_0x36d84f(0x10f));validateExtendPatchKeys(_0x1a0429[_0x36d84f(0xf5)]);}function parseDatasetExtend(_0x5af1e6){const _0x14e480=a63_0x45a435;if(typeof _0x5af1e6===_0x14e480(0x100)){const _0x110571=_0x5af1e6[_0x14e480(0x117)]();if(!_0x110571)return{'value':{},'shape':_0x14e480(0x100)};let _0x47148d;try{_0x47148d=JSON['parse'](_0x110571);}catch(_0x29da9a){const _0x32e45c=_0x29da9a instanceof Error?_0x29da9a['message']:String(_0x29da9a);throw CliErrors[_0x14e480(0xf6)]('Dataset\x20extend\x20must\x20be\x20valid\x20JSON\x20object:\x20'+_0x32e45c);}if(!isPlainObject(_0x47148d)||Array[_0x14e480(0x118)](_0x47148d))throw CliErrors[_0x14e480(0xf6)]('Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object');return{'value':_0x47148d,'shape':_0x14e480(0x100)};}if(_0x5af1e6===undefined||_0x5af1e6===null)return{'value':{},'shape':_0x14e480(0x100)};if(!isPlainObject(_0x5af1e6)||Array['isArray'](_0x5af1e6))throw CliErrors[_0x14e480(0xf6)](_0x14e480(0xfb));return{'value':_0x5af1e6,'shape':'object'};}function serializeDatasetExtend(_0x2366c3,_0x34cc33){const _0x3079d2=a63_0x45a435;return _0x34cc33===_0x3079d2(0x100)?JSON[_0x3079d2(0xe4)](_0x2366c3):_0x2366c3;}function summarizeDataset(_0x721565,_0x1e8a99){const _0x16e12b=a63_0x45a435,_0x3da03d=isPlainObject(_0x721565[_0x16e12b(0x119)])?_0x721565[_0x16e12b(0x119)]:{},_0xf6807a=isPlainObject(_0x721565[_0x16e12b(0xfd)])?_0x721565[_0x16e12b(0xfd)]:{};return{'id':_0x721565[_0x16e12b(0x116)]??_0x721565['id']??_0x3da03d[_0x16e12b(0xde)]??null,'code':_0x721565[_0x16e12b(0xdd)]??_0x721565[_0x16e12b(0xf3)]??_0x3da03d['datasetCode']??_0x1e8a99,'name':_0x721565['name']??_0x3da03d[_0x16e12b(0x10a)]??null,'table':_0xf6807a['tableName']??_0x3da03d[_0x16e12b(0xe1)]??null,'db':_0xf6807a[_0x16e12b(0xea)]??_0xf6807a['dbId']??null};}function deepClone(_0x85e8ee){const _0x11498e=a63_0x45a435;if(_0x85e8ee===undefined)return _0x85e8ee;return JSON['parse'](JSON[_0x11498e(0xe4)](_0x85e8ee));}function deepEqual(_0x14eda8,_0x5522d3){const _0x3cb335=a63_0x45a435;return JSON['stringify'](_0x14eda8)===JSON[_0x3cb335(0xe4)](_0x5522d3);}function isPlainObject(_0x30aace){const _0x48e35a=a63_0x45a435;return Boolean(_0x30aace)&&typeof _0x30aace==='object'&&!Array[_0x48e35a(0x118)](_0x30aace);}function trim(_0x3d000d){const _0x377f2c=a63_0x45a435,_0x372e24=String(_0x3d000d||'')[_0x377f2c(0x117)]();return _0x372e24;}
|
|
1
|
+
function a63_0x368e(){const _0x21b6ad=['9euxPoB','dbId','parse','Allowed\x20keys:\x20','3688713xFSwyo','keys','get','code','entries','dataset','modelCode','message','sort','48udLYFu','1474gAvUiF','patch-json','\x20must\x20be\x20a\x20JSON\x20object','Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object','/smartapi/dataset/update-driven-data','3890PgkKtR','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','6qYbfiL','--patch-json','2711350NMuSdz','trim','name','dbName','No\x20dataset\x20extend\x20patch\x20keys\x20are\x20currently\x20supported.','shape','--code\x20is\x20required','JSON\x20object\x20patch\x20for\x20dataset\x20top-level\x20extend;\x20current\x20allowlist\x20is\x20empty','23804136TDypBk','dataset\x20extend-update\x20does\x20not\x20support\x20businessGroup;\x20use\x20dataset\x20business-group-update','extend.','3044llXHqf','length','data','dbtableConfig','string','datasetName','No\x20changes\x20for\x20dataset\x20extend','join','Patch\x20dataset\x20top-level\x20extend\x20safely','patch','object','1119iRJfON','datasetId','extend','push','validation','datasetCode','write','Updated\x20dataset\x20extend\x20(','Dataset\x20extend\x20must\x20be\x20valid\x20JSON\x20object:\x20','JSON\x20object\x20of\x20expected\x20current\x20extend\x20values;\x20mismatch\x20aborts\x20without\x20writing','str','extend-update','stringify','Use\x20`rabetbase\x20dataset\x20business-group-update`\x20to\x20update\x20business\x20model\x20groups.','from','22094cnxEhx','expect-json','Expected\x20','expect','POST','appCode','isArray','1834904YGKtVr','tableName'];a63_0x368e=function(){return _0x21b6ad;};return a63_0x368e();}const a63_0x505fdf=a63_0x1fde;(function(_0x4169f3,_0x2eec19){const _0xfd0fd3=a63_0x1fde,_0x26aba8=_0x4169f3();while(!![]){try{const _0x5f4638=parseInt(_0xfd0fd3(0x214))/0x1*(-parseInt(_0xfd0fd3(0x1fe))/0x2)+parseInt(_0xfd0fd3(0x1ef))/0x3*(-parseInt(_0xfd0fd3(0x1e4))/0x4)+-parseInt(_0xfd0fd3(0x21e))/0x5+-parseInt(_0xfd0fd3(0x21c))/0x6*(parseInt(_0xfd0fd3(0x20b))/0x7)+parseInt(_0xfd0fd3(0x205))/0x8*(parseInt(_0xfd0fd3(0x207))/0x9)+parseInt(_0xfd0fd3(0x21a))/0xa*(-parseInt(_0xfd0fd3(0x215))/0xb)+parseInt(_0xfd0fd3(0x226))/0xc;if(_0x5f4638===_0x2eec19)break;else _0x26aba8['push'](_0x26aba8['shift']());}catch(_0x234914){_0x26aba8['push'](_0x26aba8['shift']());}}}(a63_0x368e,0x43c49));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';function a63_0x1fde(_0x2e1d96,_0x17c200){_0x2e1d96=_0x2e1d96-0x1e3;const _0x368e1c=a63_0x368e();let _0x1fdeea=_0x368e1c[_0x2e1d96];return _0x1fdeea;}import{CliErrors}from'../../errors.js';const MUTABLE_EXTEND_KEYS=new Set(),EXTEND_PATCH_REDIRECTS=new Map([['businessGroup',{'message':a63_0x505fdf(0x227),'hint':a63_0x505fdf(0x1fc)}]]);export function parseJsonObjectFlag(_0x1a504d,_0x549e93){const _0x15de94=a63_0x505fdf;if(!_0x1a504d)return undefined;let _0x469fbf;try{_0x469fbf=JSON[_0x15de94(0x209)](_0x1a504d);}catch(_0x4d666f){const _0x17273a=_0x4d666f instanceof Error?_0x4d666f[_0x15de94(0x212)]:String(_0x4d666f);throw CliErrors[_0x15de94(0x1f3)](_0x549e93+'\x20must\x20be\x20valid\x20JSON\x20object:\x20'+_0x17273a);}if(!isPlainObject(_0x469fbf)||Array['isArray'](_0x469fbf))throw CliErrors[_0x15de94(0x1f3)](_0x549e93+_0x15de94(0x217));return _0x469fbf;}export function validateExtendPatchKeys(_0x19f8cf){const _0xb6aec0=a63_0x505fdf,_0x2f319d=Object[_0xb6aec0(0x20c)](_0x19f8cf);if(_0x2f319d[_0xb6aec0(0x1e5)]===0x0)throw CliErrors[_0xb6aec0(0x1f3)](_0xb6aec0(0x21b));for(const _0x33a2b9 of _0x2f319d){const _0x40d4f5=EXTEND_PATCH_REDIRECTS[_0xb6aec0(0x20d)](_0x33a2b9);if(_0x40d4f5)throw CliErrors[_0xb6aec0(0x1f3)](_0x40d4f5[_0xb6aec0(0x212)],_0x40d4f5['hint']);if(!MUTABLE_EXTEND_KEYS['has'](_0x33a2b9))throw CliErrors[_0xb6aec0(0x1f3)]('Unsupported\x20patch\x20key:\x20'+_0x33a2b9,describeMutableExtendKeys());}}function describeMutableExtendKeys(){const _0x4fc2cc=a63_0x505fdf,_0x2ec24d=Array[_0x4fc2cc(0x1fd)](MUTABLE_EXTEND_KEYS)[_0x4fc2cc(0x213)]();return _0x2ec24d['length']>0x0?_0x4fc2cc(0x20a)+_0x2ec24d[_0x4fc2cc(0x1eb)](',\x20'):_0x4fc2cc(0x222);}export function applyExtendPatch(_0x111618,_0x63c73){const _0x599e28=a63_0x505fdf;validateExtendPatchKeys(_0x63c73);const _0x559eee=deepClone(_0x111618),_0x40337a=[];for(const [_0x4cb8c3,_0x264f97]of Object['entries'](_0x63c73)){const _0x265b05=_0x559eee[_0x4cb8c3],_0x6d5a48=deepClone(_0x264f97);!deepEqual(_0x265b05,_0x6d5a48)&&(_0x559eee[_0x4cb8c3]=_0x6d5a48,_0x40337a[_0x599e28(0x1f2)](_0x599e28(0x1e3)+_0x4cb8c3));}return _0x40337a[_0x599e28(0x213)](),{'after':_0x559eee,'changedPaths':_0x40337a,'changed':_0x40337a['length']>0x0};}export function assertExpectation(_0x425aeb,_0x8d7901){const _0x8cb0a5=a63_0x505fdf;if(!_0x8d7901)return;for(const [_0x27cc59,_0x26250e]of Object[_0x8cb0a5(0x20f)](_0x8d7901)){const _0x32a25b=_0x425aeb[_0x27cc59];if(!deepEqual(_0x32a25b,_0x26250e))throw CliErrors['validation']('Expectation\x20mismatch\x20at\x20extend.'+_0x27cc59,_0x8cb0a5(0x200)+JSON[_0x8cb0a5(0x1fb)](_0x26250e)+',\x20actual\x20'+JSON[_0x8cb0a5(0x1fb)](_0x32a25b));}}export async function buildDatasetExtendUpdateResult({appCode:_0x39135f,input:_0x24c246,dryRun:_0x20b167}){const _0x25d771=a63_0x505fdf;validateInput(_0x24c246);const _0x58aaa6=await getDatasetDetail(_0x24c246[_0x25d771(0x20e)]),_0x377268=parseDatasetExtend(_0x58aaa6[_0x25d771(0x1f1)]),_0x306469=deepClone(_0x377268['value']);assertExpectation(_0x306469,_0x24c246[_0x25d771(0x201)]);const {after:_0xc166e4,changedPaths:_0x3933ea,changed:_0x65ad86}=applyExtendPatch(_0x306469,_0x24c246[_0x25d771(0x1ed)]),_0x2a2b45=summarizeDataset(_0x58aaa6,_0x24c246[_0x25d771(0x20e)]);return _0x65ad86&&!_0x20b167&&(_0x58aaa6['extend']=serializeDatasetExtend(_0xc166e4,_0x377268[_0x25d771(0x223)]),await updateDrivenData(_0x58aaa6)),{'ok':!![],'data':{'appCode':_0x39135f,'selector':{'code':_0x24c246[_0x25d771(0x20e)]},'dataset':_0x2a2b45,'dryRun':_0x20b167,'changed':_0x65ad86,'changedPaths':_0x3933ea,'before':{'extend':_0x306469},'after':{'extend':_0xc166e4},'submitted':_0x65ad86&&!_0x20b167},'message':_0x65ad86?_0x20b167?'Dry-run:\x20dataset\x20extend\x20would\x20change\x20('+_0x3933ea['join'](',\x20')+')':_0x25d771(0x1f6)+_0x3933ea[_0x25d771(0x1eb)](',\x20')+')':_0x25d771(0x1ea)};}export const datasetExtendUpdate={'service':a63_0x505fdf(0x210),'command':a63_0x505fdf(0x1fa),'description':a63_0x505fdf(0x1ec),'risk':a63_0x505fdf(0x1f5),'flags':[CODE_FLAG,{'name':a63_0x505fdf(0x216),'type':a63_0x505fdf(0x1e8),'required':!![],'description':a63_0x505fdf(0x225)},{'name':a63_0x505fdf(0x1ff),'type':'string','required':![],'description':a63_0x505fdf(0x1f8)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x899f79){validateInput(readExtendUpdateInput(_0x899f79));},async 'dryRun'(_0x1b9d75){const _0x477d81=a63_0x505fdf,_0x40a77b=await buildDatasetExtendUpdateResult({'appCode':_0x1b9d75[_0x477d81(0x203)],'input':readExtendUpdateInput(_0x1b9d75),'dryRun':!![]});return{'method':_0x477d81(0x202),'url':_0x477d81(0x219),'body':_0x40a77b[_0x477d81(0x1e6)],'description':_0x40a77b[_0x477d81(0x212)]};},async 'execute'(_0x2848c9){const _0x59d3c6=a63_0x505fdf;return buildDatasetExtendUpdateResult({'appCode':_0x2848c9[_0x59d3c6(0x203)],'input':readExtendUpdateInput(_0x2848c9),'dryRun':![]});}};function readExtendUpdateInput(_0x794377){const _0x47470f=a63_0x505fdf,_0x3f1d9f=trim(_0x794377[_0x47470f(0x1f9)](_0x47470f(0x20e))),_0x409d10=parseJsonObjectFlag(_0x794377['str']('patch-json'),_0x47470f(0x21d)),_0x357da3=parseJsonObjectFlag(_0x794377[_0x47470f(0x1f9)](_0x47470f(0x1ff)),'--expect-json');return{'code':_0x3f1d9f,'patch':_0x409d10||{},'expect':_0x357da3};}function validateInput(_0x2e39f9){const _0xf61962=a63_0x505fdf;if(!_0x2e39f9['code'])throw CliErrors[_0xf61962(0x1f3)](_0xf61962(0x224));validateExtendPatchKeys(_0x2e39f9[_0xf61962(0x1ed)]);}function parseDatasetExtend(_0x320e1c){const _0x32604e=a63_0x505fdf;if(typeof _0x320e1c===_0x32604e(0x1e8)){const _0x4c9fbc=_0x320e1c[_0x32604e(0x21f)]();if(!_0x4c9fbc)return{'value':{},'shape':_0x32604e(0x1e8)};let _0x394e58;try{_0x394e58=JSON['parse'](_0x4c9fbc);}catch(_0x15b952){const _0x23668f=_0x15b952 instanceof Error?_0x15b952['message']:String(_0x15b952);throw CliErrors[_0x32604e(0x1f3)](_0x32604e(0x1f7)+_0x23668f);}if(!isPlainObject(_0x394e58)||Array['isArray'](_0x394e58))throw CliErrors[_0x32604e(0x1f3)](_0x32604e(0x218));return{'value':_0x394e58,'shape':_0x32604e(0x1e8)};}if(_0x320e1c===undefined||_0x320e1c===null)return{'value':{},'shape':_0x32604e(0x1e8)};if(!isPlainObject(_0x320e1c)||Array[_0x32604e(0x204)](_0x320e1c))throw CliErrors[_0x32604e(0x1f3)](_0x32604e(0x218));return{'value':_0x320e1c,'shape':_0x32604e(0x1ee)};}function serializeDatasetExtend(_0x370d29,_0x331372){const _0x313cd2=a63_0x505fdf;return _0x331372===_0x313cd2(0x1e8)?JSON['stringify'](_0x370d29):_0x370d29;}function summarizeDataset(_0x23a1d6,_0x27b8a){const _0x330e27=a63_0x505fdf,_0x5c9e56=isPlainObject(_0x23a1d6[_0x330e27(0x210)])?_0x23a1d6[_0x330e27(0x210)]:{},_0x1ef9d8=isPlainObject(_0x23a1d6[_0x330e27(0x1e7)])?_0x23a1d6[_0x330e27(0x1e7)]:{};return{'id':_0x23a1d6['modelId']??_0x23a1d6['id']??_0x5c9e56[_0x330e27(0x1f0)]??null,'code':_0x23a1d6[_0x330e27(0x211)]??_0x23a1d6[_0x330e27(0x20e)]??_0x5c9e56[_0x330e27(0x1f4)]??_0x27b8a,'name':_0x23a1d6[_0x330e27(0x220)]??_0x5c9e56[_0x330e27(0x1e9)]??null,'table':_0x1ef9d8[_0x330e27(0x206)]??_0x5c9e56['tableName']??null,'db':_0x1ef9d8[_0x330e27(0x221)]??_0x1ef9d8[_0x330e27(0x208)]??null};}function deepClone(_0x2ba789){if(_0x2ba789===undefined)return _0x2ba789;return JSON['parse'](JSON['stringify'](_0x2ba789));}function deepEqual(_0x3d1184,_0x6f3996){const _0xa15f94=a63_0x505fdf;return JSON[_0xa15f94(0x1fb)](_0x3d1184)===JSON[_0xa15f94(0x1fb)](_0x6f3996);}function isPlainObject(_0x1d5b61){const _0x1b6ab9=a63_0x505fdf;return Boolean(_0x1d5b61)&&typeof _0x1d5b61===_0x1b6ab9(0x1ee)&&!Array['isArray'](_0x1d5b61);}function trim(_0x5da82c){const _0x4e4fdc=String(_0x5da82c||'')['trim']();return _0x4e4fdc;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a64_0x5bf829=a64_0x48ce;(function(_0x2c10e8,_0x1ba025){const _0x3ee527=a64_0x48ce,_0xcf6038=_0x2c10e8();while(!![]){try{const _0x5c468d=parseInt(_0x3ee527(0x125))/0x1+-parseInt(_0x3ee527(0x122))/0x2+parseInt(_0x3ee527(0x165))/0x3*(-parseInt(_0x3ee527(0x14e))/0x4)+-parseInt(_0x3ee527(0x126))/0x5*(-parseInt(_0x3ee527(0x154))/0x6)+-parseInt(_0x3ee527(0x159))/0x7*(parseInt(_0x3ee527(0x133))/0x8)+parseInt(_0x3ee527(0x146))/0x9+parseInt(_0x3ee527(0x157))/0xa;if(_0x5c468d===_0x1ba025)break;else _0xcf6038['push'](_0xcf6038['shift']());}catch(_0x38f27b){_0xcf6038['push'](_0xcf6038['shift']());}}}(a64_0x20e0,0x1f2db));import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';const MUTABLE_FIELD_KEYS=new Set([a64_0x5bf829(0x124),a64_0x5bf829(0x14f),a64_0x5bf829(0x120),a64_0x5bf829(0x12e),a64_0x5bf829(0x158),'datetimeFormat',a64_0x5bf829(0x13e),a64_0x5bf829(0x13c),'deprecated']),FORBIDDEN_FIELD_KEYS=new Set(['id','name',a64_0x5bf829(0x131),a64_0x5bf829(0x11f),'dbTypeLen',a64_0x5bf829(0x14c),a64_0x5bf829(0x14d),a64_0x5bf829(0x139),a64_0x5bf829(0x162),a64_0x5bf829(0x132),'autoIncrement',a64_0x5bf829(0x15c)]);export function parseJsonObjectFlag(_0x5d59a2,_0x4a904a){const _0x27049a=a64_0x5bf829;if(!_0x5d59a2)return undefined;let _0x5dab63;try{_0x5dab63=JSON[_0x27049a(0x123)](_0x5d59a2);}catch(_0x29fd9c){const _0x7984d5=_0x29fd9c instanceof Error?_0x29fd9c[_0x27049a(0x164)]:String(_0x29fd9c);throw CliErrors[_0x27049a(0x15e)](_0x4a904a+_0x27049a(0x128)+_0x7984d5);}if(!isPlainObject(_0x5dab63)||Array[_0x27049a(0x13f)](_0x5dab63))throw CliErrors[_0x27049a(0x15e)](_0x4a904a+_0x27049a(0x151));return _0x5dab63;}export function validatePatchKeys(_0x3c9280){const _0x47edcb=a64_0x5bf829,_0x441317=Object[_0x47edcb(0x13b)](_0x3c9280);if(_0x441317[_0x47edcb(0x140)]===0x0)throw CliErrors[_0x47edcb(0x15e)]('--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key');for(const _0x5cc202 of _0x441317){if(FORBIDDEN_FIELD_KEYS[_0x47edcb(0x155)](_0x5cc202))throw CliErrors[_0x47edcb(0x15e)]('Forbidden\x20patch\x20key:\x20'+_0x5cc202);if(!MUTABLE_FIELD_KEYS[_0x47edcb(0x155)](_0x5cc202))throw CliErrors[_0x47edcb(0x15e)](_0x47edcb(0x160)+_0x5cc202,_0x47edcb(0x150)+Array['from'](MUTABLE_FIELD_KEYS)[_0x47edcb(0x152)](',\x20'));}}export function applyFieldPatch(_0x10abd9,_0x469345){const _0x93b971=a64_0x5bf829;validatePatchKeys(_0x469345);const _0x11adee=deepClone(_0x10abd9),_0x36663b=new Set();for(const [_0x582977,_0x106176]of Object[_0x93b971(0x163)](_0x469345)){const _0x17cf54=_0x11adee[_0x582977],_0x5b20c7=mergePatchValue(_0x17cf54,_0x106176);!deepEqual(_0x17cf54,_0x5b20c7)&&(_0x11adee[_0x582977]=_0x5b20c7,_0x36663b[_0x93b971(0x14a)](_0x582977),collectChangedPaths(_0x582977,_0x17cf54,_0x5b20c7,_0x36663b));}return{'after':_0x11adee,'changedPaths':Array[_0x93b971(0x16a)](_0x36663b)[_0x93b971(0x15a)](),'changed':_0x36663b[_0x93b971(0x148)]>0x0};}export function assertExpectation(_0x579877,_0x3e5eb8){const _0x13ab74=a64_0x5bf829;if(!_0x3e5eb8)return;for(const [_0x3fe393,_0x157228]of Object[_0x13ab74(0x163)](_0x3e5eb8)){const _0x24040d=_0x579877[_0x3fe393];if(!deepEqual(_0x24040d,_0x157228))throw CliErrors[_0x13ab74(0x15e)]('Expectation\x20mismatch\x20at\x20'+_0x3fe393,_0x13ab74(0x15d)+JSON[_0x13ab74(0x12d)](_0x157228)+',\x20actual\x20'+JSON[_0x13ab74(0x12d)](_0x24040d));}}export async function buildDatasetFieldUpdateResult({appCode:_0x10183e,input:_0x3460b0,dryRun:_0x1440d5}){const _0x2761ae=a64_0x5bf829;validateInput(_0x3460b0);const _0x3d86d2=await getDatasetDetail(_0x3460b0[_0x2761ae(0x131)]),_0x5343f3=readFieldArray(_0x3d86d2),_0x300428=_0x5343f3[_0x2761ae(0x156)](_0x30bc1f=>_0x30bc1f?.[_0x2761ae(0x166)]===_0x3460b0[_0x2761ae(0x12c)]);if(_0x300428<0x0)throw CliErrors[_0x2761ae(0x15e)]('Field\x20not\x20found:\x20'+_0x3460b0[_0x2761ae(0x12c)]);const _0x35855f=deepClone(_0x5343f3[_0x300428]);assertExpectation(_0x35855f,_0x3460b0['expect']);const {after:_0x47d1f7,changedPaths:_0x3a26a9,changed:_0x37dd98}=applyFieldPatch(_0x35855f,_0x3460b0[_0x2761ae(0x13a)]),_0x2135fe=summarizeDataset(_0x3d86d2,_0x3460b0[_0x2761ae(0x131)]);return _0x37dd98&&!_0x1440d5&&(_0x5343f3[_0x300428]=_0x47d1f7,await updateDrivenData(_0x3d86d2)),{'ok':!![],'data':{'appCode':_0x10183e,'selector':{'code':_0x3460b0[_0x2761ae(0x131)]},'dataset':_0x2135fe,'field':{'id':_0x35855f['id']??null,'name':_0x35855f[_0x2761ae(0x166)]},'dryRun':_0x1440d5,'changed':_0x37dd98,'changedPaths':_0x3a26a9,'before':_0x35855f,'after':_0x47d1f7,'submitted':_0x37dd98&&!_0x1440d5},'message':_0x37dd98?_0x1440d5?_0x2761ae(0x13d)+_0x3460b0[_0x2761ae(0x12c)]+_0x2761ae(0x167)+_0x3a26a9['join'](',\x20')+')':_0x2761ae(0x144)+_0x3460b0[_0x2761ae(0x12c)]+'\x20('+_0x3a26a9['join'](',\x20')+')':_0x2761ae(0x147)+_0x3460b0[_0x2761ae(0x12c)]};}export const datasetFieldUpdate={'service':a64_0x5bf829(0x12a),'command':a64_0x5bf829(0x134),'description':a64_0x5bf829(0x121),'risk':a64_0x5bf829(0x153),'flags':[CODE_FLAG,{'name':'field','type':a64_0x5bf829(0x12b),'required':!![],'description':a64_0x5bf829(0x15f)},{'name':a64_0x5bf829(0x168),'type':a64_0x5bf829(0x12b),'required':!![],'description':a64_0x5bf829(0x161)},{'name':a64_0x5bf829(0x14b),'type':a64_0x5bf829(0x12b),'required':![],'description':a64_0x5bf829(0x135)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x118292){validateInput(readFieldUpdateInput(_0x118292));},async 'dryRun'(_0x46bdae){const _0x30ab1f=a64_0x5bf829,_0x20a7f5=await buildDatasetFieldUpdateResult({'appCode':_0x46bdae[_0x30ab1f(0x142)],'input':readFieldUpdateInput(_0x46bdae),'dryRun':!![]});return{'method':_0x30ab1f(0x129),'url':_0x30ab1f(0x12f),'body':_0x20a7f5['data'],'description':_0x20a7f5[_0x30ab1f(0x164)]};},async 'execute'(_0x506283){const _0x5bbbaf=a64_0x5bf829;return buildDatasetFieldUpdateResult({'appCode':_0x506283[_0x5bbbaf(0x142)],'input':readFieldUpdateInput(_0x506283),'dryRun':![]});}};function a64_0x48ce(_0x480465,_0x25a982){_0x480465=_0x480465-0x11f;const _0x20e04b=a64_0x20e0();let _0x48ce50=_0x20e04b[_0x480465];return _0x48ce50;}function readFieldUpdateInput(_0x1c8d51){const _0x32d60f=a64_0x5bf829,_0x5bbd23=trim(_0x1c8d51['str'](_0x32d60f(0x131))),_0x1f6c41=emptyToUndefined(_0x1c8d51['str'](_0x32d60f(0x12c))),_0x508b84=parseJsonObjectFlag(_0x1c8d51[_0x32d60f(0x137)]('patch-json'),'--patch-json'),_0x4e23e2=parseJsonObjectFlag(_0x1c8d51[_0x32d60f(0x137)](_0x32d60f(0x14b)),_0x32d60f(0x149));return{'code':_0x5bbd23,'field':_0x1f6c41||'','patch':_0x508b84||{},'expect':_0x4e23e2};}function validateInput(_0x11db04){const _0x1f6a96=a64_0x5bf829;if(!_0x11db04['code'])throw CliErrors[_0x1f6a96(0x15e)]('--code\x20is\x20required');if(!_0x11db04[_0x1f6a96(0x12c)])throw CliErrors[_0x1f6a96(0x15e)]('--field\x20is\x20required');validatePatchKeys(_0x11db04[_0x1f6a96(0x13a)]);}function readFieldArray(_0x1d8be7){const _0xea2815=a64_0x5bf829;if(Array[_0xea2815(0x13f)](_0x1d8be7[_0xea2815(0x15b)]))return _0x1d8be7[_0xea2815(0x15b)];if(Array[_0xea2815(0x13f)](_0x1d8be7[_0xea2815(0x141)]))return _0x1d8be7['properties'];throw CliErrors[_0xea2815(0x15e)](_0xea2815(0x169));}function summarizeDataset(_0x598639,_0x2b2620){const _0xa2ade9=a64_0x5bf829,_0xcce47a=isPlainObject(_0x598639['dataset'])?_0x598639[_0xa2ade9(0x12a)]:{},_0x16cedc=isPlainObject(_0x598639[_0xa2ade9(0x127)])?_0x598639[_0xa2ade9(0x127)]:{};return{'id':_0x598639['modelId']??_0x598639['id']??_0xcce47a['datasetId']??null,'code':_0x598639[_0xa2ade9(0x143)]??_0x598639[_0xa2ade9(0x131)]??_0xcce47a['datasetCode']??_0x2b2620,'name':_0x598639['name']??_0xcce47a[_0xa2ade9(0x138)]??null,'table':_0x16cedc[_0xa2ade9(0x139)]??_0xcce47a[_0xa2ade9(0x139)]??null,'db':_0x16cedc[_0xa2ade9(0x130)]??_0x16cedc[_0xa2ade9(0x145)]??null};}function mergePatchValue(_0x3def3c,_0x101889){if(isPlainObject(_0x3def3c)&&isPlainObject(_0x101889))return deepMerge(_0x3def3c,_0x101889);return deepClone(_0x101889);}function deepMerge(_0x58df06,_0x17f20f){const _0x41cb27=a64_0x5bf829,_0x42ff62=deepClone(_0x58df06);for(const [_0x4f6868,_0x2465fd]of Object[_0x41cb27(0x163)](_0x17f20f)){_0x42ff62[_0x4f6868]=isPlainObject(_0x42ff62[_0x4f6868])&&isPlainObject(_0x2465fd)?deepMerge(_0x42ff62[_0x4f6868],_0x2465fd):deepClone(_0x2465fd);}return _0x42ff62;}function collectChangedPaths(_0xf06bd7,_0x272cd9,_0x23e124,_0x3f70d1){const _0x372f16=a64_0x5bf829;if(!isPlainObject(_0x272cd9)||!isPlainObject(_0x23e124))return;const _0x488179=new Set([...Object[_0x372f16(0x13b)](_0x272cd9),...Object[_0x372f16(0x13b)](_0x23e124)]);for(const _0x989259 of _0x488179){const _0x24b617=_0x272cd9[_0x989259],_0x55a417=_0x23e124[_0x989259];!deepEqual(_0x24b617,_0x55a417)&&_0x3f70d1[_0x372f16(0x14a)](_0xf06bd7+'.'+_0x989259);}}function deepClone(_0x38df7d){const _0x5ac99f=a64_0x5bf829;if(_0x38df7d===undefined)return _0x38df7d;return JSON[_0x5ac99f(0x123)](JSON[_0x5ac99f(0x12d)](_0x38df7d));}function deepEqual(_0xf614dd,_0x13c032){const _0x2494fb=a64_0x5bf829;return JSON['stringify'](_0xf614dd)===JSON[_0x2494fb(0x12d)](_0x13c032);}function a64_0x20e0(){const _0xa6dc4e=['name','\x20would\x20change\x20(','patch-json','Driven\x20data\x20does\x20not\x20contain\x20fields[]\x20or\x20properties[]','from','dbType','description','Patch\x20one\x20raw\x20dataset\x20fields[]\x20field\x20object\x20safely','90560uYMMYu','parse','doType','95600nYrVFb','67415wNIXMU','dbtableConfig','\x20must\x20be\x20valid\x20JSON\x20object:\x20','POST','dataset','string','field','stringify','options','/smartapi/dataset/update-driven-data','dbName','code','pkField','8JIjzdP','field-update','JSON\x20object\x20of\x20expected\x20current\x20field\x20values;\x20mismatch\x20aborts\x20without\x20writing','trim','str','datasetName','tableName','patch','keys','chartRole','Dry-run:\x20dataset\x20field\x20','defaultAggregation','isArray','length','properties','appCode','modelCode','Updated\x20dataset\x20field\x20','dbId','1687842DHzCMj','No\x20changes\x20for\x20dataset\x20field\x20','size','--expect-json','add','expect-json','dbTypeScale','dbFieldName','8pfzJqd','displayName','Allowed\x20keys:\x20','\x20must\x20be\x20a\x20JSON\x20object','join','write','6THEYKq','has','findIndex','729420KFxRHr','required','660338zoXTLh','sort','fields','systemRetain','Expected\x20','validation','Exact\x20raw\x20fields[].name\x20to\x20patch','Unsupported\x20patch\x20key:\x20','JSON\x20object\x20patch;\x20allowed\x20keys:\x20doType/displayName/description/options/required/datetimeFormat/defaultAggregation/chartRole/deprecated','deleted','entries','message','153363dvCylV'];a64_0x20e0=function(){return _0xa6dc4e;};return a64_0x20e0();}function isPlainObject(_0x51ad45){const _0x59d40f=a64_0x5bf829;return Boolean(_0x51ad45)&&typeof _0x51ad45==='object'&&!Array[_0x59d40f(0x13f)](_0x51ad45);}function emptyToUndefined(_0x59086f){const _0x4ac546=a64_0x5bf829,_0x1f8931=String(_0x59086f||'')[_0x4ac546(0x136)]();return _0x1f8931||undefined;}function trim(_0x362ce6){const _0x19e1cc=a64_0x5bf829;return String(_0x362ce6||'')[_0x19e1cc(0x136)]();}
|
|
1
|
+
const a64_0x5e34c1=a64_0x10a6;(function(_0x3b6d4e,_0x5231f3){const _0x22f349=a64_0x10a6,_0x295469=_0x3b6d4e();while(!![]){try{const _0xa88f22=parseInt(_0x22f349(0x185))/0x1*(parseInt(_0x22f349(0x18d))/0x2)+parseInt(_0x22f349(0x18a))/0x3*(-parseInt(_0x22f349(0x19e))/0x4)+-parseInt(_0x22f349(0x1bc))/0x5+-parseInt(_0x22f349(0x196))/0x6+parseInt(_0x22f349(0x182))/0x7+parseInt(_0x22f349(0x19b))/0x8+parseInt(_0x22f349(0x183))/0x9*(parseInt(_0x22f349(0x1b6))/0xa);if(_0xa88f22===_0x5231f3)break;else _0x295469['push'](_0x295469['shift']());}catch(_0x579d7d){_0x295469['push'](_0x295469['shift']());}}}(a64_0x5a0f,0xef6fb));import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';const MUTABLE_FIELD_KEYS=new Set([a64_0x5e34c1(0x19a),'displayName',a64_0x5e34c1(0x1ae),a64_0x5e34c1(0x1a9),a64_0x5e34c1(0x1a6),a64_0x5e34c1(0x1b3),a64_0x5e34c1(0x1b0),a64_0x5e34c1(0x178),a64_0x5e34c1(0x1aa)]),FORBIDDEN_FIELD_KEYS=new Set(['id',a64_0x5e34c1(0x1a2),a64_0x5e34c1(0x1b8),a64_0x5e34c1(0x174),a64_0x5e34c1(0x1ac),a64_0x5e34c1(0x1c1),a64_0x5e34c1(0x1c0),a64_0x5e34c1(0x192),a64_0x5e34c1(0x19c),'pkField',a64_0x5e34c1(0x1a8),a64_0x5e34c1(0x18f)]);export function parseJsonObjectFlag(_0x482409,_0x5641c2){const _0x57b652=a64_0x5e34c1;if(!_0x482409)return undefined;let _0x3a1dd7;try{_0x3a1dd7=JSON[_0x57b652(0x179)](_0x482409);}catch(_0x52adc4){const _0x54da1=_0x52adc4 instanceof Error?_0x52adc4[_0x57b652(0x187)]:String(_0x52adc4);throw CliErrors[_0x57b652(0x194)](_0x5641c2+_0x57b652(0x1b4)+_0x54da1);}if(!isPlainObject(_0x3a1dd7)||Array[_0x57b652(0x197)](_0x3a1dd7))throw CliErrors[_0x57b652(0x194)](_0x5641c2+_0x57b652(0x1a3));return _0x3a1dd7;}export function validatePatchKeys(_0x44cd10){const _0x3fe1a9=a64_0x5e34c1,_0x22b10c=Object[_0x3fe1a9(0x1ad)](_0x44cd10);if(_0x22b10c[_0x3fe1a9(0x19d)]===0x0)throw CliErrors['validation']('--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key');for(const _0x37f666 of _0x22b10c){if(FORBIDDEN_FIELD_KEYS['has'](_0x37f666))throw CliErrors[_0x3fe1a9(0x194)](_0x3fe1a9(0x1a0)+_0x37f666);if(!MUTABLE_FIELD_KEYS[_0x3fe1a9(0x177)](_0x37f666))throw CliErrors[_0x3fe1a9(0x194)](_0x3fe1a9(0x17f)+_0x37f666,_0x3fe1a9(0x191)+Array[_0x3fe1a9(0x17d)](MUTABLE_FIELD_KEYS)[_0x3fe1a9(0x1bd)](',\x20'));}}export function applyFieldPatch(_0x51f9cc,_0x71dd6f){const _0x16250e=a64_0x5e34c1;validatePatchKeys(_0x71dd6f);const _0x51be08=deepClone(_0x51f9cc),_0x25bde1=new Set();for(const [_0x35ca57,_0x5b03d4]of Object['entries'](_0x71dd6f)){const _0x3bfa02=_0x51be08[_0x35ca57],_0x53903e=mergePatchValue(_0x3bfa02,_0x5b03d4);!deepEqual(_0x3bfa02,_0x53903e)&&(_0x51be08[_0x35ca57]=_0x53903e,_0x25bde1[_0x16250e(0x184)](_0x35ca57),collectChangedPaths(_0x35ca57,_0x3bfa02,_0x53903e,_0x25bde1));}return{'after':_0x51be08,'changedPaths':Array[_0x16250e(0x17d)](_0x25bde1)[_0x16250e(0x1c2)](),'changed':_0x25bde1[_0x16250e(0x17c)]>0x0};}export function assertExpectation(_0x5232b0,_0x5e12c0){const _0x37bd02=a64_0x5e34c1;if(!_0x5e12c0)return;for(const [_0x1224e1,_0x11ab4a]of Object[_0x37bd02(0x1bb)](_0x5e12c0)){const _0x19bf02=_0x5232b0[_0x1224e1];if(!deepEqual(_0x19bf02,_0x11ab4a))throw CliErrors[_0x37bd02(0x194)](_0x37bd02(0x199)+_0x1224e1,'Expected\x20'+JSON[_0x37bd02(0x190)](_0x11ab4a)+',\x20actual\x20'+JSON[_0x37bd02(0x190)](_0x19bf02));}}export async function buildDatasetFieldUpdateResult({appCode:_0x4e9ee4,input:_0x2bebcf,dryRun:_0xac05bd}){const _0x34811b=a64_0x5e34c1;validateInput(_0x2bebcf);const _0x28dba8=await getDatasetDetail(_0x2bebcf[_0x34811b(0x1b8)]),_0x26a131=readFieldArray(_0x28dba8),_0x4b1b40=_0x26a131['findIndex'](_0x5125d3=>_0x5125d3?.[_0x34811b(0x1a2)]===_0x2bebcf['field']);if(_0x4b1b40<0x0)throw CliErrors[_0x34811b(0x194)](_0x34811b(0x180)+_0x2bebcf[_0x34811b(0x188)]);const _0x4f3700=deepClone(_0x26a131[_0x4b1b40]);assertExpectation(_0x4f3700,_0x2bebcf[_0x34811b(0x17b)]);const {after:_0x51a919,changedPaths:_0x3e8fe9,changed:_0x136272}=applyFieldPatch(_0x4f3700,_0x2bebcf[_0x34811b(0x198)]),_0x5ed2de=summarizeDataset(_0x28dba8,_0x2bebcf[_0x34811b(0x1b8)]);return _0x136272&&!_0xac05bd&&(_0x26a131[_0x4b1b40]=_0x51a919,await updateDrivenData(_0x28dba8)),{'ok':!![],'data':{'appCode':_0x4e9ee4,'selector':{'code':_0x2bebcf[_0x34811b(0x1b8)]},'dataset':_0x5ed2de,'field':{'id':_0x4f3700['id']??null,'name':_0x4f3700[_0x34811b(0x1a2)]},'dryRun':_0xac05bd,'changed':_0x136272,'changedPaths':_0x3e8fe9,'before':_0x4f3700,'after':_0x51a919,'submitted':_0x136272&&!_0xac05bd},'message':_0x136272?_0xac05bd?_0x34811b(0x1bf)+_0x2bebcf[_0x34811b(0x188)]+_0x34811b(0x17e)+_0x3e8fe9[_0x34811b(0x1bd)](',\x20')+')':_0x34811b(0x1a7)+_0x2bebcf[_0x34811b(0x188)]+'\x20('+_0x3e8fe9['join'](',\x20')+')':'No\x20changes\x20for\x20dataset\x20field\x20'+_0x2bebcf[_0x34811b(0x188)]};}export const datasetFieldUpdate={'service':a64_0x5e34c1(0x17a),'command':a64_0x5e34c1(0x189),'description':a64_0x5e34c1(0x1ab),'risk':'write','flags':[CODE_FLAG,{'name':a64_0x5e34c1(0x188),'type':a64_0x5e34c1(0x193),'required':!![],'description':a64_0x5e34c1(0x1a5)},{'name':'patch-json','type':a64_0x5e34c1(0x193),'required':!![],'description':'JSON\x20object\x20patch;\x20allowed\x20keys:\x20doType/displayName/description/options/required/datetimeFormat/defaultAggregation/chartRole/deprecated'},{'name':a64_0x5e34c1(0x175),'type':a64_0x5e34c1(0x193),'required':![],'description':a64_0x5e34c1(0x19f)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x30c3e1){validateInput(readFieldUpdateInput(_0x30c3e1));},async 'dryRun'(_0x14057a){const _0x1faa1c=a64_0x5e34c1,_0x3e8ca4=await buildDatasetFieldUpdateResult({'appCode':_0x14057a[_0x1faa1c(0x1ba)],'input':readFieldUpdateInput(_0x14057a),'dryRun':!![]});return{'method':_0x1faa1c(0x1be),'url':'/smartapi/dataset/update-driven-data','body':_0x3e8ca4[_0x1faa1c(0x1a4)],'description':_0x3e8ca4[_0x1faa1c(0x187)]};},async 'execute'(_0x4d75da){const _0x5cb4b8=a64_0x5e34c1;return buildDatasetFieldUpdateResult({'appCode':_0x4d75da[_0x5cb4b8(0x1ba)],'input':readFieldUpdateInput(_0x4d75da),'dryRun':![]});}};function readFieldUpdateInput(_0x33f7f0){const _0x3e0942=a64_0x5e34c1,_0x1cf67a=trim(_0x33f7f0[_0x3e0942(0x18b)](_0x3e0942(0x1b8))),_0x4752b1=emptyToUndefined(_0x33f7f0[_0x3e0942(0x18b)](_0x3e0942(0x188))),_0xf0d356=parseJsonObjectFlag(_0x33f7f0['str'](_0x3e0942(0x18c)),'--patch-json'),_0x232f29=parseJsonObjectFlag(_0x33f7f0[_0x3e0942(0x18b)](_0x3e0942(0x175)),'--expect-json');return{'code':_0x1cf67a,'field':_0x4752b1||'','patch':_0xf0d356||{},'expect':_0x232f29};}function validateInput(_0x2ddd24){const _0x49b802=a64_0x5e34c1;if(!_0x2ddd24['code'])throw CliErrors[_0x49b802(0x194)]('--code\x20is\x20required');if(!_0x2ddd24[_0x49b802(0x188)])throw CliErrors[_0x49b802(0x194)]('--field\x20is\x20required');validatePatchKeys(_0x2ddd24['patch']);}function readFieldArray(_0xca853e){const _0x10ecf3=a64_0x5e34c1;if(Array['isArray'](_0xca853e[_0x10ecf3(0x18e)]))return _0xca853e['fields'];if(Array[_0x10ecf3(0x197)](_0xca853e['properties']))return _0xca853e[_0x10ecf3(0x195)];throw CliErrors[_0x10ecf3(0x194)](_0x10ecf3(0x181));}function summarizeDataset(_0x5cf84e,_0x54f32d){const _0x15e891=a64_0x5e34c1,_0x5e9e14=isPlainObject(_0x5cf84e[_0x15e891(0x17a)])?_0x5cf84e[_0x15e891(0x17a)]:{},_0x2e5c72=isPlainObject(_0x5cf84e[_0x15e891(0x1a1)])?_0x5cf84e[_0x15e891(0x1a1)]:{};return{'id':_0x5cf84e['modelId']??_0x5cf84e['id']??_0x5e9e14[_0x15e891(0x1b1)]??null,'code':_0x5cf84e[_0x15e891(0x1b9)]??_0x5cf84e[_0x15e891(0x1b8)]??_0x5e9e14[_0x15e891(0x186)]??_0x54f32d,'name':_0x5cf84e[_0x15e891(0x1a2)]??_0x5e9e14[_0x15e891(0x1b7)]??null,'table':_0x2e5c72[_0x15e891(0x192)]??_0x5e9e14[_0x15e891(0x192)]??null,'db':_0x2e5c72[_0x15e891(0x1b2)]??_0x2e5c72[_0x15e891(0x1b5)]??null};}function mergePatchValue(_0x251522,_0x2b8cff){if(isPlainObject(_0x251522)&&isPlainObject(_0x2b8cff))return deepMerge(_0x251522,_0x2b8cff);return deepClone(_0x2b8cff);}function deepMerge(_0x55ce61,_0x51b81b){const _0x11eb47=deepClone(_0x55ce61);for(const [_0x3a0ee6,_0x55f037]of Object['entries'](_0x51b81b)){_0x11eb47[_0x3a0ee6]=isPlainObject(_0x11eb47[_0x3a0ee6])&&isPlainObject(_0x55f037)?deepMerge(_0x11eb47[_0x3a0ee6],_0x55f037):deepClone(_0x55f037);}return _0x11eb47;}function a64_0x5a0f(){const _0x3c7b74=['\x20must\x20be\x20valid\x20JSON\x20object:\x20','dbId','11976610HQOcZC','datasetName','code','modelCode','appCode','entries','3693065ZMrdXV','join','POST','Dry-run:\x20dataset\x20field\x20','dbFieldName','dbTypeScale','sort','dbType','expect-json','trim','has','chartRole','parse','dataset','expect','size','from','\x20would\x20change\x20(','Unsupported\x20patch\x20key:\x20','Field\x20not\x20found:\x20','Driven\x20data\x20does\x20not\x20contain\x20fields[]\x20or\x20properties[]','8464337LeZhYH','9kRsVlh','add','3KUaQJb','datasetCode','message','field','field-update','6wnsgdV','str','patch-json','388860SPfdhQ','fields','systemRetain','stringify','Allowed\x20keys:\x20','tableName','string','validation','properties','6625698vsyDMz','isArray','patch','Expectation\x20mismatch\x20at\x20','doType','11915048bOtIcR','deleted','length','3311792FhSENV','JSON\x20object\x20of\x20expected\x20current\x20field\x20values;\x20mismatch\x20aborts\x20without\x20writing','Forbidden\x20patch\x20key:\x20','dbtableConfig','name','\x20must\x20be\x20a\x20JSON\x20object','data','Exact\x20raw\x20fields[].name\x20to\x20patch','required','Updated\x20dataset\x20field\x20','autoIncrement','options','deprecated','Patch\x20one\x20raw\x20dataset\x20fields[]\x20field\x20object\x20safely','dbTypeLen','keys','description','object','defaultAggregation','datasetId','dbName','datetimeFormat'];a64_0x5a0f=function(){return _0x3c7b74;};return a64_0x5a0f();}function collectChangedPaths(_0x44421e,_0x57dd72,_0x105527,_0x558757){const _0x246723=a64_0x5e34c1;if(!isPlainObject(_0x57dd72)||!isPlainObject(_0x105527))return;const _0x297580=new Set([...Object[_0x246723(0x1ad)](_0x57dd72),...Object[_0x246723(0x1ad)](_0x105527)]);for(const _0x2525bd of _0x297580){const _0x3cbff4=_0x57dd72[_0x2525bd],_0x35cd86=_0x105527[_0x2525bd];!deepEqual(_0x3cbff4,_0x35cd86)&&_0x558757[_0x246723(0x184)](_0x44421e+'.'+_0x2525bd);}}function deepClone(_0x1bf490){const _0x7ad5e3=a64_0x5e34c1;if(_0x1bf490===undefined)return _0x1bf490;return JSON[_0x7ad5e3(0x179)](JSON[_0x7ad5e3(0x190)](_0x1bf490));}function a64_0x10a6(_0x20c35e,_0x5040f5){_0x20c35e=_0x20c35e-0x174;const _0x5a0f8e=a64_0x5a0f();let _0x10a6ea=_0x5a0f8e[_0x20c35e];return _0x10a6ea;}function deepEqual(_0x40bdf7,_0x16465f){const _0x31c240=a64_0x5e34c1;return JSON[_0x31c240(0x190)](_0x40bdf7)===JSON[_0x31c240(0x190)](_0x16465f);}function isPlainObject(_0xd639ad){const _0x37f1a6=a64_0x5e34c1;return Boolean(_0xd639ad)&&typeof _0xd639ad===_0x37f1a6(0x1af)&&!Array[_0x37f1a6(0x197)](_0xd639ad);}function emptyToUndefined(_0x26d86e){const _0x2ada0b=String(_0x26d86e||'')['trim']();return _0x2ada0b||undefined;}function trim(_0xb59543){const _0x3500df=a64_0x5e34c1;return String(_0xb59543||'')[_0x3500df(0x176)]();}
|