@lovrabet/rabetbase-cli 2.3.2 → 2.3.3-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/discover.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.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-selector.js +1 -1
- package/lib/commands/common/flags.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 -0
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1f6ab1,_0x49a4cb){const _0x1d87ec=a49_0x2e1b,_0x3aa50a=_0x1f6ab1();while(!![]){try{const _0x15bcca=parseInt(_0x1d87ec(0x1c5))/0x1+-parseInt(_0x1d87ec(0x1c4))/0x2+-parseInt(_0x1d87ec(0x1ce))/0x3*(-parseInt(_0x1d87ec(0x1cd))/0x4)+-parseInt(_0x1d87ec(0x1cc))/0x5*(parseInt(_0x1d87ec(0x1c6))/0x6)+parseInt(_0x1d87ec(0x1c9))/0x7*(-parseInt(_0x1d87ec(0x1ca))/0x8)+parseInt(_0x1d87ec(0x1c7))/0x9*(-parseInt(_0x1d87ec(0x1c8))/0xa)+parseInt(_0x1d87ec(0x1cb))/0xb;if(_0x15bcca===_0x49a4cb)break;else _0x3aa50a['push'](_0x3aa50a['shift']());}catch(_0x5f4c46){_0x3aa50a['push'](_0x3aa50a['shift']());}}}(a49_0x3884,0xd25e7));function a49_0x2e1b(_0x128db8,_0x5ac1d0){_0x128db8=_0x128db8-0x1c4;const _0x388481=a49_0x3884();let _0x2e1b5e=_0x388481[_0x128db8];return _0x2e1b5e;}import{configListDefinition}from'../../commands/config/list.js';import{configGetDefinition}from'../../commands/config/get.js';import{configSetDefinition}from'../../commands/config/set.js';export const configDefinitions=[configListDefinition,configGetDefinition,configSetDefinition];function a49_0x3884(){const _0x350fce=['788FbDrfm','11172agSQwN','3036512azyNws','264816eBsclM','5806038EAbbZj','123354DwwVKb','10zYlvfU','7rWJqfY','11835152yYSGTV','42264816QFftFY','5QiuhCn'];a49_0x3884=function(){return _0x350fce;};return a49_0x3884();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a50_0x24c352=a50_0x18bb;(function(_0x2e9f17,_0x138d0a){const _0x352290=a50_0x18bb,_0x116440=_0x2e9f17();while(!![]){try{const _0x1f2fed=-parseInt(_0x352290(0x1a5))/0x1+-parseInt(_0x352290(0x1ad))/0x2+parseInt(_0x352290(0x1a4))/0x3*(parseInt(_0x352290(0x1a8))/0x4)+parseInt(_0x352290(0x1b0))/0x5+-parseInt(_0x352290(0x1a3))/0x6+-parseInt(_0x352290(0x1aa))/0x7+-parseInt(_0x352290(0x1ab))/0x8*(-parseInt(_0x352290(0x1ac))/0x9);if(_0x1f2fed===_0x138d0a)break;else _0x116440['push'](_0x116440['shift']());}catch(_0x1cab6d){_0x116440['push'](_0x116440['shift']());}}}(a50_0x45da,0xd11e2));function a50_0x45da(){const _0x4b9c60=['54KQADTr','1677844cCeMtb','global','list','3361585RIuBVP','Show\x20global\x20config\x20only\x20(~/.rabetbase.json)','read','6415110GFpheW','1515PPwvYr','407868rEYrYN','boolean','config','12676svlmVR','bool','7057323UzyZWF','2544064kifDHj'];a50_0x45da=function(){return _0x4b9c60;};return a50_0x45da();}import{readScopedConfig}from'../../commands/config/shared.js';import{readConfig}from'../../utils/config.js';async function execute(_0x373a26){const _0x4f70cd=a50_0x18bb,_0x58b8d3=_0x373a26[_0x4f70cd(0x1a9)](_0x4f70cd(0x1ae))?readScopedConfig(_0x4f70cd(0x1ae)):readConfig();return{'ok':!![],'data':_0x58b8d3};}function a50_0x18bb(_0x56bf54,_0x48e5f5){_0x56bf54=_0x56bf54-0x1a1;const _0x45dac9=a50_0x45da();let _0x18bb6b=_0x45dac9[_0x56bf54];return _0x18bb6b;}export const configListDefinition={'service':a50_0x24c352(0x1a7),'command':a50_0x24c352(0x1af),'description':'List\x20all\x20config\x20values','risk':a50_0x24c352(0x1a2),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a50_0x24c352(0x1ae),'type':a50_0x24c352(0x1a6),'description':a50_0x24c352(0x1a1),'default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a51_0x2106cc=a51_0x1146;function a51_0x5768(){const _0x20db0b=['str','501RtLlMB','riskLevel','env','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','Project','appcode','Invalid\x20locale\x20value.','6obAPtU','\x22.\x20Allowed:\x20','config','5521352bfYhRo','445700mBnYkz','\x20app\x20add\x20<name>\x20--appcode\x20','write','Invalid\x20value\x20for\x20env.\x20Allowed:\x20production,\x20daily.','Config\x20value\x20is\x20invalid\x20or\x20too\x20long.','string','16056PgLlQt','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','Usage:\x20','1903713aewtdW','join','Settable\x20top-level\x20keys:\x20','1568200tyDawa','775104lQXnrd','`,\x20`','Config\x20value','Legacy\x20alias\x20\x22online\x22\x20is\x20accepted\x20and\x20stored\x20as\x20production.','Top-level\x20key\x20\x22','\x20(stored\x20as\x20apps\x20+\x20defaultApp)','value','Use\x20`','object','key','1810efUJEy','apps','Set\x20a\x20config\x20value','9zPpemf','\x22\x20is\x20not\x20settable.','length','includes','global','locale','app','\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>','validation','set','Invalid\x20value\x20for\x20\x22','Missing\x20key.','556CoFCXh','boolean','\x20app\x20use\x20<name>`,\x20or\x20pass\x20`--appcode`\x20on\x20the\x20command.','keys'];a51_0x5768=function(){return _0x20db0b;};return a51_0x5768();}function a51_0x1146(_0x1788d5,_0x11c5da){_0x1788d5=_0x1788d5-0xb3;const _0x576886=a51_0x5768();let _0x114618=_0x576886[_0x1788d5];return _0x114618;}(function(_0x64539e,_0x5554ab){const _0x4dd67b=a51_0x1146,_0x497792=_0x64539e();while(!![]){try{const _0x5eebc6=-parseInt(_0x4dd67b(0xdd))/0x1*(-parseInt(_0x4dd67b(0xce))/0x2)+parseInt(_0x4dd67b(0xe2))/0x3*(-parseInt(_0x4dd67b(0xbd))/0x4)+-parseInt(_0x4dd67b(0xb7))/0x5+-parseInt(_0x4dd67b(0xb3))/0x6*(-parseInt(_0x4dd67b(0xc0))/0x7)+parseInt(_0x4dd67b(0xb6))/0x8*(parseInt(_0x4dd67b(0xd1))/0x9)+-parseInt(_0x4dd67b(0xc3))/0xa+-parseInt(_0x4dd67b(0xc4))/0xb;if(_0x5eebc6===_0x5554ab)break;else _0x497792['push'](_0x497792['shift']());}catch(_0x37518a){_0x497792['push'](_0x497792['shift']());}}}(a51_0x5768,0x74d52));import{CliErrors}from'../../errors.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';import{CLI_BIN_NAME,CONFIG_ENUM_VALUES,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale,resolveWriteScope,readScopedConfig,writeScopedConfig}from'../../commands/config/shared.js';import{normalizeEnv,isProduction,isDaily}from'../../constant/env.js';async function execute(_0x35e00d){const _0x34e318=a51_0x1146,_0x139035=_0x35e00d[_0x34e318(0xe1)](_0x34e318(0xcd)),_0x1ff1af=_0x35e00d[_0x34e318(0xe1)]('value');if(!_0x139035)throw CliErrors['validation'](_0x34e318(0xdc),_0x34e318(0xbf)+CLI_BIN_NAME+_0x34e318(0xd8));if(_0x1ff1af===undefined||_0x1ff1af==='')throw CliErrors[_0x34e318(0xd9)]('Missing\x20value.',_0x34e318(0xbf)+CLI_BIN_NAME+_0x34e318(0xd8));if(_0x1ff1af['length']>0x1f4)throw CliErrors[_0x34e318(0xd9)](_0x34e318(0xbb));if(!isTopLevelConfigKey(_0x139035))throw CliErrors[_0x34e318(0xd9)](_0x34e318(0xc8)+_0x139035+_0x34e318(0xd2),_0x34e318(0xc2)+getTopLevelConfigKeySummary());if(_0x139035===_0x34e318(0xe3))throw CliErrors['validation'](_0x34e318(0xbe));if(CONFIG_ENUM_VALUES[_0x139035]&&!CONFIG_ENUM_VALUES[_0x139035][_0x34e318(0xd4)](_0x1ff1af))throw CliErrors[_0x34e318(0xd9)](_0x34e318(0xdb)+_0x139035+_0x34e318(0xb4)+CONFIG_ENUM_VALUES[_0x139035][_0x34e318(0xc1)](',\x20'));if(_0x139035===_0x34e318(0xd6)&&!normalizeLocale(_0x1ff1af))throw CliErrors[_0x34e318(0xd9)](_0x34e318(0xe8),_0x34e318(0xe5));const _0x40d936={'global':_0x35e00d['bool'](_0x34e318(0xd5))},_0x8693fc=resolveWriteScope(_0x40d936),_0x295867=readScopedConfig(_0x8693fc);let _0x2d8833=_0x139035,_0x21e17e=_0x1ff1af;_0x139035===_0x34e318(0xd7)&&(_0x2d8833=_0x34e318(0xe7),delete _0x295867['app']);_0x139035===_0x34e318(0xd6)&&(_0x21e17e=normalizeLocale(_0x1ff1af));if(_0x139035===_0x34e318(0xe4)){_0x21e17e=normalizeEnv(_0x1ff1af);if(!isProduction(_0x21e17e)&&!isDaily(_0x21e17e))throw CliErrors[_0x34e318(0xd9)](_0x34e318(0xba),_0x34e318(0xc7));}if(_0x139035===_0x34e318(0xe7)){const _0x259ebf=_0x295867[_0x34e318(0xcf)]&&typeof _0x295867[_0x34e318(0xcf)]===_0x34e318(0xcc)?Object[_0x34e318(0xe0)](_0x295867[_0x34e318(0xcf)]):[];if(_0x259ebf[_0x34e318(0xd3)]>0x0)throw CliErrors[_0x34e318(0xd9)]('Cannot\x20set\x20top-level\x20\x22appcode\x22\x20when\x20multi-app\x20config\x20already\x20exists.',_0x34e318(0xcb)+CLI_BIN_NAME+_0x34e318(0xb8)+_0x21e17e+_0x34e318(0xc5)+CLI_BIN_NAME+_0x34e318(0xdf));const _0x1c61f7=buildCanonicalProjectConfig({..._0x295867},{'appCodes':[_0x21e17e],'env':typeof _0x295867['env']===_0x34e318(0xbc)?_0x295867['env']:undefined});writeScopedConfig(_0x1c61f7,_0x8693fc);const _0x2ba959=_0x8693fc===_0x34e318(0xd5)?'Global':'Project';return{'ok':!![],'message':'✓\x20'+_0x2ba959+'\x20appcode\x20set\x20to:\x20'+_0x21e17e+_0x34e318(0xc9)};}_0x295867[_0x2d8833]=_0x21e17e,writeScopedConfig(_0x295867,_0x8693fc);const _0x20c0fd=_0x8693fc===_0x34e318(0xd5)?'Global':_0x34e318(0xe6);return{'ok':!![],'message':'✓\x20'+_0x20c0fd+'\x20'+_0x2d8833+'\x20set\x20to:\x20'+_0x21e17e};}export const configSetDefinition={'service':a51_0x2106cc(0xb5),'command':a51_0x2106cc(0xda),'description':a51_0x2106cc(0xd0),'risk':a51_0x2106cc(0xb9),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a51_0x2106cc(0xcd),'type':'string','description':getConfigCommandKeyDescription(),'required':!![]},{'name':a51_0x2106cc(0xca),'type':a51_0x2106cc(0xbc),'description':a51_0x2106cc(0xc6),'required':!![]},{'name':a51_0x2106cc(0xd5),'type':a51_0x2106cc(0xde),'description':'Write\x20to\x20global\x20config\x20(~/.rabetbase.json)','default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x12cb42,_0x2b0b3c){var _0x9de955=a52_0x4789,_0xe0fc70=_0x12cb42();while(!![]){try{var _0x49d17d=-parseInt(_0x9de955(0x1d6))/0x1+-parseInt(_0x9de955(0x1e0))/0x2*(-parseInt(_0x9de955(0x1e5))/0x3)+parseInt(_0x9de955(0x1d8))/0x4*(parseInt(_0x9de955(0x1dd))/0x5)+parseInt(_0x9de955(0x1d9))/0x6*(parseInt(_0x9de955(0x1dc))/0x7)+parseInt(_0x9de955(0x1db))/0x8+parseInt(_0x9de955(0x1e3))/0x9*(-parseInt(_0x9de955(0x1e2))/0xa)+-parseInt(_0x9de955(0x1e4))/0xb;if(_0x49d17d===_0x2b0b3c)break;else _0xe0fc70['push'](_0xe0fc70['shift']());}catch(_0x1304b9){_0xe0fc70['push'](_0xe0fc70['shift']());}}}(a52_0x3ca2,0x947a6));import{CLI_BIN_NAME}from'../../constant/cli.js';import{isInProject,resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';function a52_0x4789(_0x495b3d,_0x2b6241){_0x495b3d=_0x495b3d-0x1d6;var _0x3ca2fb=a52_0x3ca2();var _0x478910=_0x3ca2fb[_0x495b3d];return _0x478910;}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};function a52_0x3ca2(){var _0xac56b4=['7812761MWRkhV','3pCJNbX','368942QzjUsX','project','20WjoHov','13626tUlguG','validation','5453864CBtFHS','3171wUWthC','84155XjCtFs','Add\x20--global\x20to\x20write\x20to\x20~/.rabetbase.json,\x20or\x20run\x20`','global','1789534yKBDru','\x20init`\x20first.','10HuaDeW','9018531KLTJkQ'];a52_0x3ca2=function(){return _0xac56b4;};return a52_0x3ca2();}export{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey};export function resolveWriteScope(_0x4db2fe){var _0x26defa=a52_0x4789;if(_0x4db2fe[_0x26defa(0x1df)])return _0x26defa(0x1df);if(!isInProject())throw CliErrors[_0x26defa(0x1da)]('Not\x20inside\x20a\x20project\x20(no\x20.rabetbase.json\x20found).',_0x26defa(0x1de)+CLI_BIN_NAME+_0x26defa(0x1e1));return _0x26defa(0x1d7);}export function readScopedConfig(_0x5cac06){return readConfigFile(resolveWriteConfigPath(_0x5cac06));}export function writeScopedConfig(_0x3f9968,_0x433a5f){writeConfigFile(resolveWriteConfigPath(_0x433a5f),_0x3f9968);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a53_0x1d75(){const _0x408465=['join','\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}]','995160DFwLUz','Filter\x20dataset\x20records\x20with\x20query\x20conditions','filter','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','7715EfbXjJ','\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]','70666OHhEYi','114413yWuzsw','126132mPsMGe','5322282ZZfTdR','526422TLgMji','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\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)'];a53_0x1d75=function(){return _0x408465;};return a53_0x1d75();}const a53_0xbb2484=a53_0x2c71;(function(_0x4c4286,_0xed1ab5){const _0x27deba=a53_0x2c71,_0x57767a=_0x4c4286();while(!![]){try{const _0x27924d=-parseInt(_0x27deba(0x150))/0x1+-parseInt(_0x27deba(0x14f))/0x2+-parseInt(_0x27deba(0x151))/0x3+-parseInt(_0x27deba(0x149))/0x4+parseInt(_0x27deba(0x14d))/0x5+parseInt(_0x27deba(0x144))/0x6+parseInt(_0x27deba(0x152))/0x7;if(_0x27924d===_0xed1ab5)break;else _0x57767a['push'](_0x57767a['shift']());}catch(_0x1062b3){_0x57767a['push'](_0x57767a['shift']());}}}(a53_0x1d75,0x63dc2));import{buildDataCommand}from'../../commands/data/shared.js';function a53_0x2c71(_0x1d09ea,_0x697c6f){_0x1d09ea=_0x1d09ea-0x144;const _0x1d75b3=a53_0x1d75();let _0x2c71ad=_0x1d75b3[_0x1d09ea];return _0x2c71ad;}export const dataFilter=buildDataCommand({'command':a53_0xbb2484(0x14b),'operation':a53_0xbb2484(0x14b),'description':a53_0xbb2484(0x14a),'paramsRequired':![],'paramsHint':a53_0xbb2484(0x145),'helpExtra':[a53_0xbb2484(0x146),'\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions',a53_0xbb2484(0x14e),a53_0xbb2484(0x148),a53_0xbb2484(0x14c),'\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page'][a53_0xbb2484(0x147)]('\x0a')});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a54_0x5ef270=a54_0x189c;function a54_0x75f2(){const _0x194400=['JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','760170QkZnyW','28TqtlDa','5048424zwaYLu','getOne','291515nvOITO','79877eCakor','6001616xhkBHG','1761333vHDMju','Get\x20a\x20single\x20record\x20by\x20ID','318DIktBK','631131BjQMhb'];a54_0x75f2=function(){return _0x194400;};return a54_0x75f2();}(function(_0x2bd444,_0x490865){const _0x1b52c0=a54_0x189c,_0x500447=_0x2bd444();while(!![]){try{const _0x5b8674=parseInt(_0x1b52c0(0x168))/0x1+parseInt(_0x1b52c0(0x15e))/0x2+parseInt(_0x1b52c0(0x165))/0x3+-parseInt(_0x1b52c0(0x15f))/0x4*(parseInt(_0x1b52c0(0x162))/0x5)+-parseInt(_0x1b52c0(0x167))/0x6*(parseInt(_0x1b52c0(0x163))/0x7)+-parseInt(_0x1b52c0(0x164))/0x8+parseInt(_0x1b52c0(0x160))/0x9;if(_0x5b8674===_0x490865)break;else _0x500447['push'](_0x500447['shift']());}catch(_0x7c368a){_0x500447['push'](_0x500447['shift']());}}}(a54_0x75f2,0x60b7d));function a54_0x189c(_0x5a99bd,_0x1d8d2c){_0x5a99bd=_0x5a99bd-0x15d;const _0x75f2d2=a54_0x75f2();let _0x189cba=_0x75f2d2[_0x5a99bd];return _0x189cba;}import{buildDataCommand}from'../../commands/data/shared.js';export const dataGetOne=buildDataCommand({'command':a54_0x5ef270(0x161),'operation':'getOne','description':a54_0x5ef270(0x166),'paramsRequired':!![],'paramsHint':a54_0x5ef270(0x15d)});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x27f5bf,_0x14f713){const _0x4deb5c=a55_0x4152,_0x1c32e6=_0x27f5bf();while(!![]){try{const _0x28aaa9=parseInt(_0x4deb5c(0x10b))/0x1+-parseInt(_0x4deb5c(0x10f))/0x2+-parseInt(_0x4deb5c(0x10a))/0x3+parseInt(_0x4deb5c(0x10d))/0x4+-parseInt(_0x4deb5c(0x110))/0x5*(-parseInt(_0x4deb5c(0x109))/0x6)+parseInt(_0x4deb5c(0x10e))/0x7*(parseInt(_0x4deb5c(0x10c))/0x8)+parseInt(_0x4deb5c(0x111))/0x9;if(_0x28aaa9===_0x14f713)break;else _0x1c32e6['push'](_0x1c32e6['shift']());}catch(_0xac6b21){_0x1c32e6['push'](_0x1c32e6['shift']());}}}(a55_0x1ab2,0xad232));function a55_0x1ab2(){const _0x34d0bf=['12805956LrigZh','3936PWzXWZ','1774944TiLTxY','129964btFniy','7088hVwBsV','2050464MzmkDl','245qIcAxs','2066256cauWwm','1810xnuYyF'];a55_0x1ab2=function(){return _0x34d0bf;};return a55_0x1ab2();}function a55_0x4152(_0x54d046,_0x474969){_0x54d046=_0x54d046-0x109;const _0x1ab24d=a55_0x1ab2();let _0x415231=_0x1ab24d[_0x54d046];return _0x415231;}import{dataFilter}from'../../commands/data/filter.js';import{dataGetOne}from'../../commands/data/getOne.js';export const dataDefinitions=[dataFilter,dataGetOne];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1ead63,_0x57062b){const _0x4bd52c=a56_0x373d,_0x5cdde2=_0x1ead63();while(!![]){try{const _0x2840f2=-parseInt(_0x4bd52c(0x172))/0x1*(parseInt(_0x4bd52c(0x164))/0x2)+-parseInt(_0x4bd52c(0x17d))/0x3*(-parseInt(_0x4bd52c(0x16b))/0x4)+parseInt(_0x4bd52c(0x168))/0x5+parseInt(_0x4bd52c(0x16a))/0x6*(-parseInt(_0x4bd52c(0x16d))/0x7)+-parseInt(_0x4bd52c(0x16e))/0x8*(parseInt(_0x4bd52c(0x161))/0x9)+parseInt(_0x4bd52c(0x15f))/0xa+parseInt(_0x4bd52c(0x17b))/0xb;if(_0x2840f2===_0x57062b)break;else _0x5cdde2['push'](_0x5cdde2['shift']());}catch(_0x3f1198){_0x5cdde2['push'](_0x5cdde2['shift']());}}}(a56_0x551b,0xb04fa));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 a56_0x551b(){const _0x577446=['params','9DCksdC','alias','description','127766vpOWTq','paramsRequired','compress','flagMissing','4357680PLWBat','Example:\x20--params\x20\x27{\x22id\x22:123}\x27','132240xcYcrl','124dwwkcn','str','343dUesFD','436336wreajJ','paramsHint','validation','appCode','22aVEDJE','helpExtra','getOne','string','now','data','operation','code','data\x20','18650016VjABKy','\x20completed\x20in\x20','5790LYXISH','command','6352760vmKsFZ'];a56_0x551b=function(){return _0x577446;};return a56_0x551b();}function a56_0x373d(_0x30698a,_0x1c1ae1){_0x30698a=_0x30698a-0x15f;const _0x551b0e=a56_0x551b();let _0x373d57=_0x551b0e[_0x30698a];return _0x373d57;}function assertGetOneId(_0x51df47){const _0x543958=a56_0x373d;if(!_0x51df47)throw CliErrors[_0x543958(0x167)](_0x543958(0x160),'Provide\x20--params\x20\x27{\x22id\x22:123}\x27\x20for\x20data\x20getOne.');const _0x32dfe0=_0x51df47['id'];if(_0x32dfe0===undefined||_0x32dfe0===null||_0x32dfe0==='')throw CliErrors[_0x543958(0x170)]('data\x20getOne\x20requires\x20\x22id\x22\x20in\x20--params',_0x543958(0x169));}function parseCommandParams(_0x1a4a0a){return parseJsonParams(_0x1a4a0a)??{};}export function buildDataCommand(_0x17c02f){const _0x4eb053=a56_0x373d,_0x3fce46='Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically';return{'service':_0x4eb053(0x177),'command':_0x17c02f[_0x4eb053(0x17e)],'description':_0x17c02f[_0x4eb053(0x163)],'risk':'read','defaultOutputFormat':_0x4eb053(0x166),'helpExtra':_0x17c02f[_0x4eb053(0x173)],'flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':_0x4eb053(0x162),'type':_0x4eb053(0x175),'description':_0x3fce46},{'name':_0x4eb053(0x160),'type':'string','description':_0x17c02f[_0x4eb053(0x16f)]}],async 'validate'(_0x549b88){const _0x5179ec=_0x4eb053,_0x2e3021=_0x549b88[_0x5179ec(0x16c)](_0x5179ec(0x160));if(_0x17c02f[_0x5179ec(0x165)]&&!_0x2e3021)throw CliErrors[_0x5179ec(0x167)](_0x5179ec(0x160),_0x17c02f[_0x5179ec(0x16f)]);const _0x3b4118=parseJsonParams(_0x2e3021);_0x17c02f[_0x5179ec(0x178)]===_0x5179ec(0x174)&&assertGetOneId(_0x3b4118);},async 'execute'(_0x219b69){const _0x507684=_0x4eb053,_0x21ceb1=parseCommandParams(_0x219b69[_0x507684(0x16c)](_0x507684(0x160))),_0x28ceec=Date[_0x507684(0x176)](),_0x2dac09=await executeDatasetDataOperation(_0x219b69[_0x507684(0x171)],_0x219b69['str'](_0x507684(0x179)),_0x17c02f[_0x507684(0x178)],_0x21ceb1),_0x32c423=Date[_0x507684(0x176)]()-_0x28ceec;return{'ok':!![],'data':{'result':_0x2dac09,'elapsed':_0x32c423},'message':_0x507684(0x17a)+_0x17c02f['command']+_0x507684(0x17c)+_0x32c423+'ms'};}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a57_0x1e858c=a57_0x1e20;(function(_0x2fa26c,_0x219445){const _0xc10822=a57_0x1e20,_0x1e108e=_0x2fa26c();while(!![]){try{const _0xf0234d=parseInt(_0xc10822(0x117))/0x1+parseInt(_0xc10822(0x115))/0x2+parseInt(_0xc10822(0x133))/0x3+parseInt(_0xc10822(0x137))/0x4+-parseInt(_0xc10822(0x12d))/0x5*(-parseInt(_0xc10822(0x138))/0x6)+-parseInt(_0xc10822(0x13e))/0x7*(parseInt(_0xc10822(0x143))/0x8)+-parseInt(_0xc10822(0x132))/0x9*(parseInt(_0xc10822(0x10d))/0xa);if(_0xf0234d===_0x219445)break;else _0x1e108e['push'](_0x1e108e['shift']());}catch(_0x4e28f8){_0x1e108e['push'](_0x1e108e['shift']());}}}(a57_0x1886,0xea2c7));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=a57_0x1e858c(0x127);export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x3bf148,input:_0x136bef,dryRun:_0x2d98f0}){const _0x2aaca9=a57_0x1e858c;validateInput(_0x136bef);const _0x5ab20b=normalizeBusinessGroup(_0x136bef['businessGroup']),_0x221e7c=await getDatasetDetail(_0x136bef['code']),_0xc2fcc8=resolveBusinessGroupDataset(_0x221e7c,_0x136bef[_0x2aaca9(0x141)]),_0x599cd2=loadCurrentBusinessGroup(_0x221e7c,_0xc2fcc8);assertExpectedBusinessGroup(_0x599cd2,_0x136bef[_0x2aaca9(0x147)]);const _0x2d3ddd=buildBackendPayload(_0x3bf148,_0xc2fcc8,_0x5ab20b),_0x4a0ada=_0x599cd2!==_0x5ab20b;let _0x2b9dbe;if(_0x4a0ada&&!_0x2d98f0){await updateErBusinessGroup(_0x2d3ddd);const _0x818f7b=await getDatasetDetail(_0xc2fcc8[_0x2aaca9(0x141)]),_0x227fd0=resolveBusinessGroupDataset(_0x818f7b,_0xc2fcc8[_0x2aaca9(0x141)]),_0x3f0abe=loadCurrentBusinessGroup(_0x818f7b,_0x227fd0);if(_0x3f0abe!==_0x5ab20b)throw CliErrors['apiError'](_0x2aaca9(0x131),_0x2aaca9(0x10e)+JSON[_0x2aaca9(0x130)](_0x5ab20b)+_0x2aaca9(0x123)+JSON[_0x2aaca9(0x130)](_0x3f0abe)+'.');_0x2b9dbe={'verified':!![],'status':'matched','afterReadback':{'businessGroup':_0x3f0abe}};}else!_0x4a0ada&&(_0x2b9dbe={'verified':!![],'status':_0x2aaca9(0x139),'afterReadback':{'businessGroup':_0x599cd2}});const _0x52f17b={'operation':_0x2aaca9(0x13d),'appCode':_0x3bf148,'selector':{'code':_0xc2fcc8[_0x2aaca9(0x141)]},'dataset':_0xc2fcc8,'before':{'businessGroup':_0x599cd2},'after':{'businessGroup':_0x5ab20b},'changed':_0x4a0ada,'dryRun':_0x2d98f0,'submitted':_0x4a0ada&&!_0x2d98f0,'backend':{'method':_0x2aaca9(0x145),'path':BACKEND_PATH,'payload':_0x2d3ddd},..._0x2b9dbe?{'verification':_0x2b9dbe}:{},'warnings':[]};return{'ok':!![],'data':_0x52f17b,'message':_0x4a0ada?_0x2d98f0?_0x2aaca9(0x121)+_0xc2fcc8[_0x2aaca9(0x141)]:'Updated\x20business\x20model\x20group\x20for\x20dataset\x20'+_0xc2fcc8['code']:_0x2aaca9(0x118)+_0xc2fcc8[_0x2aaca9(0x141)]};}export const datasetBusinessGroupUpdate={'service':a57_0x1e858c(0x11c),'command':a57_0x1e858c(0x140),'description':a57_0x1e858c(0x142),'risk':'write','flags':[CODE_FLAG,{'name':'business-group','type':a57_0x1e858c(0x113),'required':!![],'description':a57_0x1e858c(0x112)},{'name':a57_0x1e858c(0x129),'type':a57_0x1e858c(0x113),'required':![],'description':a57_0x1e858c(0x125)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x23fe1b){validateInput(readBusinessGroupUpdateInput(_0x23fe1b));},async 'dryRun'(_0x11ff4f){const _0x4d7b8e=a57_0x1e858c,_0x36710d=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x11ff4f[_0x4d7b8e(0x122)],'input':readBusinessGroupUpdateInput(_0x11ff4f),'dryRun':!![]});return{'method':'POST','url':BACKEND_PATH,'body':_0x36710d['data'][_0x4d7b8e(0x116)][_0x4d7b8e(0x134)],'description':_0x36710d[_0x4d7b8e(0x10f)],..._0x36710d[_0x4d7b8e(0x13b)]};},async 'execute'(_0x4c9c3d){return buildDatasetBusinessGroupUpdateResult({'appCode':_0x4c9c3d['appCode'],'input':readBusinessGroupUpdateInput(_0x4c9c3d),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x13c38d){const _0xdb5bc5=a57_0x1e858c,_0x588db1=_0x13c38d[_0xdb5bc5(0x128)](_0xdb5bc5(0x129));return{'code':trim(_0x13c38d['str'](_0xdb5bc5(0x141))),'businessGroup':_0x13c38d[_0xdb5bc5(0x128)](_0xdb5bc5(0x12a)),'expectBusinessGroup':_0x588db1===undefined||_0x588db1===''?undefined:_0x588db1};}function validateInput(_0x5afcc3){const _0x3d01f0=a57_0x1e858c;if(!trim(_0x5afcc3[_0x3d01f0(0x141)]))throw CliErrors[_0x3d01f0(0x12c)](_0x3d01f0(0x12f));if(_0x5afcc3[_0x3d01f0(0x13f)]===undefined)throw CliErrors[_0x3d01f0(0x12c)](_0x3d01f0(0x126));}function resolveBusinessGroupDataset(_0x5ef027,_0x2dd505){const _0x5f0fb6=a57_0x1e858c,_0xcfc9ec=asPlainObject(_0x5ef027[_0x5f0fb6(0x11c)]),_0x589bc4=asPlainObject(_0x5ef027[_0x5f0fb6(0x11a)]),_0x35a5d4=resolveSourceType(_0x5ef027,_0xcfc9ec,_0x589bc4),_0x5bd544=firstString(_0x5ef027['modelCode'],_0x5ef027[_0x5f0fb6(0x141)],_0xcfc9ec['datasetCode'],_0x2dd505)||_0x2dd505;return{'id':firstNumber(_0x5ef027[_0x5f0fb6(0x11f)],_0x5ef027['id'],_0xcfc9ec['datasetId'])??firstString(_0x5ef027['modelId'],_0x5ef027['id'],_0xcfc9ec[_0x5f0fb6(0x120)])??null,'code':_0x5bd544,'name':firstString(_0x5ef027[_0x5f0fb6(0x12b)],_0xcfc9ec[_0x5f0fb6(0x110)],_0xcfc9ec[_0x5f0fb6(0x12b)])||null,'sourceType':_0x35a5d4};}function a57_0x1e20(_0x4c540b,_0x610b3c){_0x4c540b=_0x4c540b-0x10d;const _0x1886bd=a57_0x1886();let _0x1e205e=_0x1886bd[_0x4c540b];return _0x1e205e;}function resolveSourceType(_0x53599,_0x5d6e03,_0x312029){const _0xb5e33f=a57_0x1e858c,_0x2ac2ef=firstString(_0x53599['source'],_0x53599[_0xb5e33f(0x124)],_0x5d6e03['source'],_0x5d6e03[_0xb5e33f(0x124)])?.[_0xb5e33f(0x148)]()[_0xb5e33f(0x114)]();if(_0x2ac2ef===_0xb5e33f(0x119)||_0x2ac2ef===_0xb5e33f(0x136))return _0x2ac2ef;if(Object['keys'](_0x312029)['length']>0x0)return _0xb5e33f(0x119);throw CliErrors[_0xb5e33f(0x12c)](_0xb5e33f(0x149));}function loadCurrentBusinessGroup(_0x307dd9,_0x56435e){const _0x14404a=a57_0x1e858c,_0x4ab2fc=readBusinessGroupFromDatasetDetail(_0x307dd9,_0x56435e[_0x14404a(0x124)]);if(_0x4ab2fc[_0x14404a(0x11b)])return normalizeBusinessGroup(_0x4ab2fc['value']);if(_0x56435e[_0x14404a(0x124)]===_0x14404a(0x136))return'';throw CliErrors[_0x14404a(0x12c)](_0x14404a(0x135),_0x14404a(0x12e));}function readBusinessGroupFromDatasetDetail(_0x191ed1,_0x2d18d3){const _0x5487ea=a57_0x1e858c,_0xdd4c55=asPlainObject(_0x191ed1[_0x5487ea(0x11c)]),_0x4c5186=firstPresent(_0x191ed1[_0x5487ea(0x13f)]);if(_0x4c5186[_0x5487ea(0x11b)])return _0x4c5186;const _0x33dfdb=firstPresent(_0xdd4c55[_0x5487ea(0x13f)]);if(_0x33dfdb[_0x5487ea(0x11b)])return _0x33dfdb;if(_0x2d18d3==='DB_TABLE')return{'found':![]};const _0x2c91df=readBusinessGroupFromExtend(_0x191ed1[_0x5487ea(0x144)]);if(_0x2c91df[_0x5487ea(0x11b)])return _0x2c91df;return readBusinessGroupFromExtend(_0xdd4c55[_0x5487ea(0x144)]);}function readBusinessGroupFromExtend(_0x6121c3){const _0x47cfb6=a57_0x1e858c;if(_0x6121c3===undefined||_0x6121c3===null||_0x6121c3==='')return{'found':![]};if(typeof _0x6121c3===_0x47cfb6(0x113))try{const _0x40366a=JSON[_0x47cfb6(0x11e)](_0x6121c3);return readBusinessGroupFromExtend(_0x40366a);}catch{return{'found':![]};}const _0x589957=asPlainObject(_0x6121c3);if(Object[_0x47cfb6(0x11d)]['hasOwnProperty'][_0x47cfb6(0x111)](_0x589957,_0x47cfb6(0x13f)))return{'found':!![],'value':_0x589957['businessGroup']};return{'found':![]};}function firstPresent(..._0x52a2d1){for(const _0x45dc50 of _0x52a2d1){if(_0x45dc50!==undefined&&_0x45dc50!==null)return{'found':!![],'value':_0x45dc50};}return{'found':![]};}function a57_0x1886(){const _0x390b6b=['modelId','datasetId','Dry-run:\x20business\x20model\x20group\x20would\x20change\x20for\x20dataset\x20','appCode',',\x20actual\x20','sourceType','Expected\x20current\x20business\x20model\x20group;\x20mismatch\x20aborts\x20without\x20writing','--business-group\x20is\x20required','/smartapi/question/er-config/business-group/edit','str','expect-business-group','business-group','name','validation','7414010OEeRWj','Business\x20model\x20group\x20readback\x20must\x20be\x20available\x20by\x20datasetCode;\x20upgrade\x20the\x20backend\x20read\x20contract\x20instead\x20of\x20using\x20dblinkId/tableName.','--code\x20is\x20required','stringify','Business\x20model\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','9cgsgzz','3992127MmdmBf','payload','Dataset\x20detail\x20does\x20not\x20expose\x20businessGroup.','METADATA','3479184msflpF','6CEhgsj','unchanged','isFinite','data','Expectation\x20mismatch\x20at\x20businessGroup','update','24661FAwOHz','businessGroup','business-group-update','code','Update\x20business\x20model\x20group','88xIdECK','extend','POST','number','expectBusinessGroup','trim','Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.','55487230OUJJqT','Expected\x20','message','datasetName','call','New\x20business\x20model\x20group\x20value;\x20empty\x20string\x20clears\x20it','string','toUpperCase','1964336WFxFhZ','backend','1881176FvlUhT','No\x20changes\x20for\x20business\x20model\x20group\x20on\x20dataset\x20','DB_TABLE','dbtableConfig','found','dataset','prototype','parse'];a57_0x1886=function(){return _0x390b6b;};return a57_0x1886();}function assertExpectedBusinessGroup(_0x2afd11,_0x260579){const _0x24d6e6=a57_0x1e858c;if(_0x260579===undefined)return;const _0x422e80=normalizeBusinessGroup(_0x260579);if(_0x2afd11!==_0x422e80)throw CliErrors['validation'](_0x24d6e6(0x13c),'Expected\x20'+JSON[_0x24d6e6(0x130)](_0x422e80)+_0x24d6e6(0x123)+JSON[_0x24d6e6(0x130)](_0x2afd11));}function buildBackendPayload(_0xe5789,_0x5ad1ac,_0x267b23){return{'appCode':_0xe5789,'datasetCode':_0x5ad1ac['code'],'businessGroup':_0x267b23};}function normalizeBusinessGroup(_0x307b6f){const _0x31f8bc=a57_0x1e858c;if(_0x307b6f===undefined||_0x307b6f===null)return'';return String(_0x307b6f)[_0x31f8bc(0x148)]();}function asPlainObject(_0x21e81f){if(!_0x21e81f||typeof _0x21e81f!=='object'||Array['isArray'](_0x21e81f))return{};return _0x21e81f;}function firstString(..._0x143660){const _0x2223e6=a57_0x1e858c;for(const _0x15da55 of _0x143660){if(typeof _0x15da55==='string'&&_0x15da55['trim']())return _0x15da55['trim']();if(typeof _0x15da55===_0x2223e6(0x146)&&Number[_0x2223e6(0x13a)](_0x15da55))return String(_0x15da55);}return undefined;}function firstNumber(..._0x4fa1b6){const _0x5914e1=a57_0x1e858c;for(const _0x473390 of _0x4fa1b6){if(typeof _0x473390==='number'&&Number['isFinite'](_0x473390))return _0x473390;if(typeof _0x473390==='string'&&_0x473390[_0x5914e1(0x148)]()&&Number['isFinite'](Number(_0x473390)))return Number(_0x473390);}return null;}function trim(_0x5ed085){const _0x2c42e0=a57_0x1e858c;return String(_0x5ed085||'')[_0x2c42e0(0x148)]();}
|
|
1
|
+
const a57_0x1beb24=a57_0x2c80;(function(_0x3c4525,_0x5cf881){const _0x500821=a57_0x2c80,_0x598e4f=_0x3c4525();while(!![]){try{const _0x1ef915=parseInt(_0x500821(0x170))/0x1*(-parseInt(_0x500821(0x17d))/0x2)+-parseInt(_0x500821(0x179))/0x3+-parseInt(_0x500821(0x183))/0x4+parseInt(_0x500821(0x15c))/0x5+-parseInt(_0x500821(0x180))/0x6*(parseInt(_0x500821(0x187))/0x7)+parseInt(_0x500821(0x184))/0x8*(parseInt(_0x500821(0x17c))/0x9)+parseInt(_0x500821(0x165))/0xa;if(_0x1ef915===_0x5cf881)break;else _0x598e4f['push'](_0x598e4f['shift']());}catch(_0x2d1994){_0x598e4f['push'](_0x598e4f['shift']());}}}(a57_0x3da0,0xbd9eb));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateErBusinessGroup}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const BACKEND_PATH='/smartapi/question/er-config/business-group/edit';export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x52bdb7,input:_0x4ff54c,dryRun:_0x51b8d8}){const _0x13e671=a57_0x2c80;validateInput(_0x4ff54c);const _0x5e379a=normalizeBusinessGroup(_0x4ff54c['businessGroup']),_0x34de1f=await getDatasetDetail(_0x4ff54c[_0x13e671(0x169)]),_0x1e66af=resolveBusinessGroupDataset(_0x34de1f,_0x4ff54c[_0x13e671(0x169)]),_0x67b4ee=loadCurrentBusinessGroup(_0x34de1f,_0x1e66af);assertExpectedBusinessGroup(_0x67b4ee,_0x4ff54c[_0x13e671(0x171)]);const _0x81476=buildBackendPayload(_0x52bdb7,_0x1e66af,_0x5e379a),_0x44be23=_0x67b4ee!==_0x5e379a;let _0x41bb80;if(_0x44be23&&!_0x51b8d8){await updateErBusinessGroup(_0x81476);const _0x57fd50=await getDatasetDetail(_0x1e66af[_0x13e671(0x169)]),_0x55eb20=resolveBusinessGroupDataset(_0x57fd50,_0x1e66af[_0x13e671(0x169)]),_0x378222=loadCurrentBusinessGroup(_0x57fd50,_0x55eb20);if(_0x378222!==_0x5e379a)throw CliErrors[_0x13e671(0x15a)](_0x13e671(0x18a),_0x13e671(0x186)+JSON[_0x13e671(0x176)](_0x5e379a)+_0x13e671(0x178)+JSON[_0x13e671(0x176)](_0x378222)+'.');_0x41bb80={'verified':!![],'status':_0x13e671(0x189),'afterReadback':{'businessGroup':_0x378222}};}else!_0x44be23&&(_0x41bb80={'verified':!![],'status':_0x13e671(0x15e),'afterReadback':{'businessGroup':_0x67b4ee}});const _0x4aa861={'operation':_0x13e671(0x167),'appCode':_0x52bdb7,'selector':{'code':_0x1e66af['code']},'dataset':_0x1e66af,'before':{'businessGroup':_0x67b4ee},'after':{'businessGroup':_0x5e379a},'changed':_0x44be23,'dryRun':_0x51b8d8,'submitted':_0x44be23&&!_0x51b8d8,'backend':{'method':'POST','path':BACKEND_PATH,'payload':_0x81476},..._0x41bb80?{'verification':_0x41bb80}:{},'warnings':[]};return{'ok':!![],'data':_0x4aa861,'message':_0x44be23?_0x51b8d8?_0x13e671(0x18d)+_0x1e66af['code']:'Updated\x20business\x20model\x20group\x20for\x20dataset\x20'+_0x1e66af[_0x13e671(0x169)]:'No\x20changes\x20for\x20business\x20model\x20group\x20on\x20dataset\x20'+_0x1e66af[_0x13e671(0x169)]};}export const datasetBusinessGroupUpdate={'service':a57_0x1beb24(0x192),'command':'business-group-update','description':a57_0x1beb24(0x173),'risk':'write','flags':[CODE_FLAG,{'name':'business-group','type':'string','required':!![],'description':a57_0x1beb24(0x18f)},{'name':a57_0x1beb24(0x16b),'type':a57_0x1beb24(0x160),'required':![],'description':a57_0x1beb24(0x17a)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x21dbf0){validateInput(readBusinessGroupUpdateInput(_0x21dbf0));},async 'dryRun'(_0x41ed15){const _0x16b54a=a57_0x1beb24,_0x520bfc=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x41ed15[_0x16b54a(0x16a)],'input':readBusinessGroupUpdateInput(_0x41ed15),'dryRun':!![]});return{'method':_0x16b54a(0x163),'url':BACKEND_PATH,'body':_0x520bfc['data']['backend'][_0x16b54a(0x181)],'description':_0x520bfc[_0x16b54a(0x161)],..._0x520bfc[_0x16b54a(0x15f)]};},async 'execute'(_0x1cf2d5){const _0x224501=a57_0x1beb24;return buildDatasetBusinessGroupUpdateResult({'appCode':_0x1cf2d5[_0x224501(0x16a)],'input':readBusinessGroupUpdateInput(_0x1cf2d5),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x51b0e9){const _0x22588c=a57_0x1beb24,_0x20aa94=_0x51b0e9[_0x22588c(0x164)](_0x22588c(0x16b));return{'code':trim(_0x51b0e9[_0x22588c(0x164)](_0x22588c(0x169))),'businessGroup':_0x51b0e9[_0x22588c(0x164)](_0x22588c(0x18b)),'expectBusinessGroup':_0x20aa94===undefined||_0x20aa94===''?undefined:_0x20aa94};}function validateInput(_0xfb61e0){const _0x21428e=a57_0x1beb24;if(!trim(_0xfb61e0[_0x21428e(0x169)]))throw CliErrors['validation'](_0x21428e(0x191));if(_0xfb61e0[_0x21428e(0x166)]===undefined)throw CliErrors[_0x21428e(0x177)]('--business-group\x20is\x20required');}function a57_0x3da0(){const _0x3ea537=['trim','stringify','validation',',\x20actual\x20','1926231aBXeOb','Expected\x20current\x20business\x20model\x20group;\x20mismatch\x20aborts\x20without\x20writing','name','63uQzQHd','4mALPBN','number','datasetCode','198744wxkZpn','payload','Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.','2908464KwVTtT','1429888rGZktZ','isArray','Expected\x20','56dKzvuL','datasetName','matched','Business\x20model\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','business-group','call','Dry-run:\x20business\x20model\x20group\x20would\x20change\x20for\x20dataset\x20','sourceType','New\x20business\x20model\x20group\x20value;\x20empty\x20string\x20clears\x20it','found','--code\x20is\x20required','dataset','Expectation\x20mismatch\x20at\x20businessGroup','apiError','parse','7617865bnYsMr','isFinite','unchanged','data','string','message','Business\x20model\x20group\x20readback\x20must\x20be\x20available\x20by\x20datasetCode;\x20upgrade\x20the\x20backend\x20read\x20contract\x20instead\x20of\x20using\x20dblinkId/tableName.','POST','str','8979530joQMEJ','businessGroup','update','extend','code','appCode','expect-business-group','DB_TABLE','modelCode','length','modelId','630905hmTboq','expectBusinessGroup','datasetId','Update\x20business\x20model\x20group','source'];a57_0x3da0=function(){return _0x3ea537;};return a57_0x3da0();}function resolveBusinessGroupDataset(_0x5e3fd2,_0xced15e){const _0x1556d1=a57_0x1beb24,_0x58a786=asPlainObject(_0x5e3fd2[_0x1556d1(0x192)]),_0x20b920=asPlainObject(_0x5e3fd2['dbtableConfig']),_0x39b739=resolveSourceType(_0x5e3fd2,_0x58a786,_0x20b920),_0xb5bd91=firstString(_0x5e3fd2[_0x1556d1(0x16d)],_0x5e3fd2[_0x1556d1(0x169)],_0x58a786[_0x1556d1(0x17f)],_0xced15e)||_0xced15e;return{'id':firstNumber(_0x5e3fd2[_0x1556d1(0x16f)],_0x5e3fd2['id'],_0x58a786[_0x1556d1(0x172)])??firstString(_0x5e3fd2['modelId'],_0x5e3fd2['id'],_0x58a786['datasetId'])??null,'code':_0xb5bd91,'name':firstString(_0x5e3fd2[_0x1556d1(0x17b)],_0x58a786[_0x1556d1(0x188)],_0x58a786[_0x1556d1(0x17b)])||null,'sourceType':_0x39b739};}function resolveSourceType(_0x41efd0,_0x48fb3e,_0x52ce28){const _0x9ecf0=a57_0x1beb24,_0x2c9846=firstString(_0x41efd0['source'],_0x41efd0[_0x9ecf0(0x18e)],_0x48fb3e[_0x9ecf0(0x174)],_0x48fb3e[_0x9ecf0(0x18e)])?.[_0x9ecf0(0x175)]()['toUpperCase']();if(_0x2c9846===_0x9ecf0(0x16c)||_0x2c9846==='METADATA')return _0x2c9846;if(Object['keys'](_0x52ce28)[_0x9ecf0(0x16e)]>0x0)return _0x9ecf0(0x16c);throw CliErrors[_0x9ecf0(0x177)](_0x9ecf0(0x182));}function loadCurrentBusinessGroup(_0x4ff44a,_0x2865f1){const _0x3ecfd0=a57_0x1beb24,_0x3fa731=readBusinessGroupFromDatasetDetail(_0x4ff44a,_0x2865f1['sourceType']);if(_0x3fa731[_0x3ecfd0(0x190)])return normalizeBusinessGroup(_0x3fa731['value']);if(_0x2865f1[_0x3ecfd0(0x18e)]==='METADATA')return'';throw CliErrors[_0x3ecfd0(0x177)]('Dataset\x20detail\x20does\x20not\x20expose\x20businessGroup.',_0x3ecfd0(0x162));}function readBusinessGroupFromDatasetDetail(_0x2b2e90,_0x28e3ae){const _0x131f55=a57_0x1beb24,_0x488f45=asPlainObject(_0x2b2e90[_0x131f55(0x192)]),_0x8fa25c=firstPresent(_0x2b2e90[_0x131f55(0x166)]);if(_0x8fa25c['found'])return _0x8fa25c;const _0x13fee5=firstPresent(_0x488f45[_0x131f55(0x166)]);if(_0x13fee5[_0x131f55(0x190)])return _0x13fee5;if(_0x28e3ae===_0x131f55(0x16c))return{'found':![]};const _0x520d5a=readBusinessGroupFromExtend(_0x2b2e90[_0x131f55(0x168)]);if(_0x520d5a[_0x131f55(0x190)])return _0x520d5a;return readBusinessGroupFromExtend(_0x488f45['extend']);}function readBusinessGroupFromExtend(_0x271b4a){const _0x31762d=a57_0x1beb24;if(_0x271b4a===undefined||_0x271b4a===null||_0x271b4a==='')return{'found':![]};if(typeof _0x271b4a===_0x31762d(0x160))try{const _0x2f4830=JSON[_0x31762d(0x15b)](_0x271b4a);return readBusinessGroupFromExtend(_0x2f4830);}catch{return{'found':![]};}const _0x4533fa=asPlainObject(_0x271b4a);if(Object['prototype']['hasOwnProperty'][_0x31762d(0x18c)](_0x4533fa,_0x31762d(0x166)))return{'found':!![],'value':_0x4533fa[_0x31762d(0x166)]};return{'found':![]};}function firstPresent(..._0x4b6f95){for(const _0xf4c08e of _0x4b6f95){if(_0xf4c08e!==undefined&&_0xf4c08e!==null)return{'found':!![],'value':_0xf4c08e};}return{'found':![]};}function assertExpectedBusinessGroup(_0x552081,_0x18fc95){const _0x449199=a57_0x1beb24;if(_0x18fc95===undefined)return;const _0x1a6c4d=normalizeBusinessGroup(_0x18fc95);if(_0x552081!==_0x1a6c4d)throw CliErrors[_0x449199(0x177)](_0x449199(0x193),_0x449199(0x186)+JSON[_0x449199(0x176)](_0x1a6c4d)+_0x449199(0x178)+JSON[_0x449199(0x176)](_0x552081));}function buildBackendPayload(_0x53fc90,_0x156b07,_0x4ba735){const _0x6f4cb4=a57_0x1beb24;return{'appCode':_0x53fc90,'datasetCode':_0x156b07[_0x6f4cb4(0x169)],'businessGroup':_0x4ba735};}function a57_0x2c80(_0x165f3e,_0x3a604a){_0x165f3e=_0x165f3e-0x15a;const _0x3da0ac=a57_0x3da0();let _0x2c8044=_0x3da0ac[_0x165f3e];return _0x2c8044;}function normalizeBusinessGroup(_0x181b04){const _0x6e842d=a57_0x1beb24;if(_0x181b04===undefined||_0x181b04===null)return'';return String(_0x181b04)[_0x6e842d(0x175)]();}function asPlainObject(_0x186705){const _0x3a087b=a57_0x1beb24;if(!_0x186705||typeof _0x186705!=='object'||Array[_0x3a087b(0x185)](_0x186705))return{};return _0x186705;}function firstString(..._0x56f1db){const _0x518fc8=a57_0x1beb24;for(const _0x4cecdd of _0x56f1db){if(typeof _0x4cecdd==='string'&&_0x4cecdd[_0x518fc8(0x175)]())return _0x4cecdd[_0x518fc8(0x175)]();if(typeof _0x4cecdd==='number'&&Number[_0x518fc8(0x15d)](_0x4cecdd))return String(_0x4cecdd);}return undefined;}function firstNumber(..._0x210be0){const _0x32496d=a57_0x1beb24;for(const _0x378fb4 of _0x210be0){if(typeof _0x378fb4===_0x32496d(0x17e)&&Number[_0x32496d(0x15d)](_0x378fb4))return _0x378fb4;if(typeof _0x378fb4===_0x32496d(0x160)&&_0x378fb4['trim']()&&Number['isFinite'](Number(_0x378fb4)))return Number(_0x378fb4);}return null;}function trim(_0x548285){const _0x5a0127=a57_0x1beb24;return String(_0x548285||'')[_0x5a0127(0x175)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a58_0x5143db=a58_0x4cfe;(function(_0xd0e81a,_0xe1497a){const _0x6926a1=a58_0x4cfe,_0x27295b=_0xd0e81a();while(!![]){try{const _0x3f4e53=parseInt(_0x6926a1(0x79))/0x1+parseInt(_0x6926a1(0x74))/0x2+-parseInt(_0x6926a1(0x6e))/0x3+-parseInt(_0x6926a1(0x70))/0x4*(parseInt(_0x6926a1(0x6c))/0x5)+-parseInt(_0x6926a1(0x71))/0x6*(parseInt(_0x6926a1(0x75))/0x7)+-parseInt(_0x6926a1(0x83))/0x8*(parseInt(_0x6926a1(0x8c))/0x9)+parseInt(_0x6926a1(0x6d))/0xa;if(_0x3f4e53===_0xe1497a)break;else _0x27295b['push'](_0x27295b['shift']());}catch(_0x15a316){_0x27295b['push'](_0x27295b['shift']());}}}(a58_0x3a75,0xea88d));function a58_0x4cfe(_0x1a6199,_0x41d1f2){_0x1a6199=_0x1a6199-0x6b;const _0x3a7583=a58_0x3a75();let _0x4cfe17=_0x3a7583[_0x1a6199];return _0x4cfe17;}import{CliErrors}from'../../errors.js';export const RUNTIME_DATA_ACCESS_COMMANDS={'cli':a58_0x5143db(0x8e),'filter':a58_0x5143db(0x6b),'getOne':a58_0x5143db(0x8b)};export const RUNTIME_DATA_ACCESS_SUMMARY=a58_0x5143db(0x87);function valueToString(_0x5f1f16){return _0x5f1f16==null?'':String(_0x5f1f16)['trim']();}function getDatasetCode(_0x4ecb50){const _0x45e7c5=a58_0x5143db;return valueToString(_0x4ecb50[_0x45e7c5(0x80)]??_0x4ecb50[_0x45e7c5(0x7a)]??_0x4ecb50[_0x45e7c5(0x85)]?.[_0x45e7c5(0x86)]);}function getDatasetName(_0x362a79){const _0x27059a=a58_0x5143db;return valueToString(_0x362a79[_0x27059a(0x7e)]??_0x362a79[_0x27059a(0x85)]?.[_0x27059a(0x8d)])||'unknown';}function a58_0x3a75(){const _0x54d77f=['SQL\x20schema\x20validation','lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27<json>\x27\x20--format\x20compress','1199895GNHkqv','42195980SsVoYc','4576536HzbjJU','tableName','28uKjwlG','3872214scPsQZ','join','toUpperCase','1969396NgFiXu','7nRMmGr','filter','validation','原因:schema\x20introspection\x20与\x20custom\x20SQL\x20需要\x20source=DB_TABLE、dbtableConfig.dbId、dbtableConfig.tableName\x20与数据库连接上下文。','412549WbikgL','modelCode','如果只是查看运行态真实行数据,请切换到\x20lovrabet\x20CLI:','当前数据集\x20\x22','getOne','name','sourceType','code','\x20是\x20','\x20的\x20DB_TABLE\x20数据源上下文。','48lGtonI','dbtableConfig','dataset','datasetCode','Use\x20lovrabet\x20data\x20filter/getOne\x20for\x20real\x20runtime\x20records.','METADATA','UNKNOWN','dbtable','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27\x20--format\x20compress','1208187wOFaUN','datasetName','lovrabet'];a58_0x3a75=function(){return _0x54d77f;};return a58_0x3a75();}function getDatasetSource(_0x3e08c4){const _0x2576d4=a58_0x5143db;return valueToString(_0x3e08c4['source']??_0x3e08c4[_0x2576d4(0x85)]?.[_0x2576d4(0x7f)])[_0x2576d4(0x73)]();}function getDbtableConfig(_0x39c300){const _0x63fe93=a58_0x5143db,_0x15d58e=_0x39c300[_0x63fe93(0x84)]??_0x39c300[_0x63fe93(0x8a)];return _0x15d58e&&typeof _0x15d58e==='object'?_0x15d58e:{};}export function isDbTableBackedDataset(_0x52b43f){const _0x4146c7=a58_0x5143db,_0x4d959c=getDatasetSource(_0x52b43f);if(_0x4d959c===_0x4146c7(0x88))return![];const _0x2b7fe0=getDbtableConfig(_0x52b43f),_0xfce00f=_0x2b7fe0['dbId']??_0x2b7fe0['id'],_0x24fe6f=valueToString(_0x2b7fe0[_0x4146c7(0x6f)]??_0x52b43f[_0x4146c7(0x6f)]??_0x52b43f['dataset']?.['tableName']);return _0xfce00f!==undefined&&_0xfce00f!==null&&_0x24fe6f['length']>0x0;}export function filterDbTableBackedDatasets(_0x4eb98e){const _0x490b17=a58_0x5143db;return _0x4eb98e[_0x490b17(0x76)](_0x36abef=>isDbTableBackedDataset(_0x36abef));}export function buildDbTableBackedRequirementMessage(_0x28b567,_0x58dd52=a58_0x5143db(0x8f)){const _0x332f1f=a58_0x5143db,_0x25eb2e=getDatasetSource(_0x28b567)||_0x332f1f(0x89),_0xc9b6db=getDatasetName(_0x28b567),_0x3537c0=getDatasetCode(_0x28b567),_0x2147b5=_0x3537c0?'\x20('+_0x3537c0+')':'';return[_0x332f1f(0x7c)+_0xc9b6db+'\x22'+_0x2147b5+_0x332f1f(0x81)+_0x25eb2e+'\x20类型,没有可用于\x20'+_0x58dd52+_0x332f1f(0x82),_0x332f1f(0x78),'请先将该数据集升级/迁移为\x20DB_TABLE\x20数据集,再基于新的\x20dataset\x20code\x20继续开发。',_0x332f1f(0x7b)+RUNTIME_DATA_ACCESS_COMMANDS[_0x332f1f(0x76)]+';'+RUNTIME_DATA_ACCESS_COMMANDS[_0x332f1f(0x7d)]+'。'][_0x332f1f(0x72)]('\x20');}export function assertDatasetIsDbTableBacked(_0xf44af0,_0x5c2932){const _0x27b406=a58_0x5143db;if(!isDbTableBackedDataset(_0xf44af0))throw CliErrors[_0x27b406(0x77)](buildDbTableBackedRequirementMessage(_0xf44af0,_0x5c2932));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a59_0xe72775=a59_0x1b8a;(function(_0x5b8a22,_0x10025a){const _0x1f8260=a59_0x1b8a,_0x4852c4=_0x5b8a22();while(!![]){try{const _0x31b7c4=parseInt(_0x1f8260(0xaf))/0x1+parseInt(_0x1f8260(0xab))/0x2+parseInt(_0x1f8260(0xc6))/0x3*(-parseInt(_0x1f8260(0xc1))/0x4)+-parseInt(_0x1f8260(0xa4))/0x5+-parseInt(_0x1f8260(0xcd))/0x6*(parseInt(_0x1f8260(0xb9))/0x7)+parseInt(_0x1f8260(0x9c))/0x8*(parseInt(_0x1f8260(0xb5))/0x9)+-parseInt(_0x1f8260(0xce))/0xa;if(_0x31b7c4===_0x10025a)break;else _0x4852c4['push'](_0x4852c4['shift']());}catch(_0x37be2e){_0x4852c4['push'](_0x4852c4['shift']());}}}(a59_0x2c19,0x942f0));import{deleteDataset,listDatasets}from'../../core/api-client.js';function a59_0x2c19(){const _0x554c6b=['1035895MJPSAT','Delete\x20all\x20datasets\x20under\x20this\x20database\x20connection\x20id','num','dbid=','description','Required\x20to\x20execute\x20dataset\x20deletion','str','1527742XlrebO','dbName','One\x20of\x20--id,\x20--code,\x20or\x20--dbid\x20is\x20required.','/smartapi/dataset/delete-dataset','597688scixSP','high-risk-write','delete','expected-count','isArray','dataset','36DRVjwD','code','\x20dataset(s);\x20','Deleted\x20','1622971VUyhrE','dbtableConfig','appCode','No\x20undeleted\x20dataset\x20found\x20for\x20','push','length','dbid','name','49732IkjIfZ','relationPages','map','Delete\x20dataset\x20metadata\x20by\x20id/code\x20or\x20all\x20datasets\x20under\x20a\x20db\x20id','tableName','57KrGfYs','Dataset\x20id','confirm','\x20failed','Abort\x20unless\x20the\x20matched\x20dataset\x20count\x20equals\x20this\x20value','\x20dataset(s)','filter','6qTpock','11323520iulfwP','POST','message','2106024EKSTsg','Use\x20only\x20one\x20of\x20--id,\x20--code,\x20or\x20--dbid.','Would\x20delete\x20','number','bool','--confirm\x20is\x20required\x20to\x20delete\x20datasets.','id=','validation'];a59_0x2c19=function(){return _0x554c6b;};return a59_0x2c19();}import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL,CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const DATASET_ID_FLAG={'name':'id','type':a59_0xe72775(0x9f),'description':a59_0xe72775(0xc7)},DBID_FLAG={'name':a59_0xe72775(0xbf),'type':a59_0xe72775(0x9f),'description':a59_0xe72775(0xa5)},CONFIRM_FLAG={'name':a59_0xe72775(0xc8),'type':'boolean','description':a59_0xe72775(0xa9)},EXPECTED_COUNT_FLAG={'name':a59_0xe72775(0xb2),'type':a59_0xe72775(0x9f),'description':a59_0xe72775(0xca)};export const datasetDelete={'service':a59_0xe72775(0xb4),'command':a59_0xe72775(0xb1),'description':a59_0xe72775(0xc4),'risk':a59_0xe72775(0xb0),'flags':[DATASET_ID_FLAG,CODE_FLAG_OPTIONAL,DBID_FLAG,CONFIRM_FLAG,EXPECTED_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4b63c0){const _0x284dd2=a59_0xe72775,_0x27b5eb=_0x4b63c0[_0x284dd2(0xa6)]('id'),_0x5f1fd9=_0x4b63c0[_0x284dd2(0xaa)](_0x284dd2(0xb6)),_0x48f140=_0x4b63c0[_0x284dd2(0xa6)](_0x284dd2(0xbf)),_0x4df4a6=[_0x27b5eb>0x0,Boolean(_0x5f1fd9),_0x48f140>0x0][_0x284dd2(0xcc)](Boolean);if(_0x4df4a6[_0x284dd2(0xbe)]===0x0)throw CliErrors[_0x284dd2(0xa3)](_0x284dd2(0xad));if(_0x4df4a6[_0x284dd2(0xbe)]>0x1)throw CliErrors[_0x284dd2(0xa3)](_0x284dd2(0x9d));},async 'dryRun'(_0x49b69a){const _0x39eb00=a59_0xe72775,_0x4fd5be=await resolveTargets(_0x49b69a);return{'method':_0x39eb00(0x9a),'url':_0x39eb00(0xae),'body':{'appCode':_0x49b69a[_0x39eb00(0xbb)],'count':_0x4fd5be[_0x39eb00(0xbe)],'datasets':_0x4fd5be},'description':_0x39eb00(0x9e)+_0x4fd5be['length']+'\x20dataset(s).\x20This\x20only\x20deletes\x20platform\x20dataset\x20metadata\x20and\x20related\x20page/menu\x20records,\x20not\x20physical\x20databases\x20or\x20tables.'};},async 'execute'(_0x106d58){const _0x288e48=a59_0xe72775;if(!_0x106d58[_0x288e48(0xa0)](_0x288e48(0xc8)))throw CliErrors[_0x288e48(0xa3)](_0x288e48(0xa1),'Run\x20with\x20--dry-run\x20first,\x20then\x20add\x20--confirm\x20when\x20the\x20target\x20list\x20is\x20correct.');const _0x1b072e=await resolveTargets(_0x106d58),_0x24229e=[],_0x11c729=[];for(const _0x363bd3 of _0x1b072e){try{await deleteDataset(_0x106d58[_0x288e48(0xbb)],_0x363bd3['id']),_0x24229e[_0x288e48(0xbd)](_0x363bd3);}catch(_0x5cbf5b){_0x11c729[_0x288e48(0xbd)]({..._0x363bd3,'error':_0x5cbf5b instanceof Error?_0x5cbf5b[_0x288e48(0x9b)]:String(_0x5cbf5b)});}}if(_0x11c729[_0x288e48(0xbe)]>0x0)return{'ok':![],'data':{'requested':_0x1b072e[_0x288e48(0xbe)],'deletedCount':_0x24229e['length'],'failedCount':_0x11c729[_0x288e48(0xbe)],'deleted':_0x24229e,'failed':_0x11c729},'message':_0x288e48(0xb8)+_0x24229e['length']+'/'+_0x1b072e[_0x288e48(0xbe)]+_0x288e48(0xb7)+_0x11c729[_0x288e48(0xbe)]+_0x288e48(0xc9)};return{'ok':!![],'data':{'requested':_0x1b072e[_0x288e48(0xbe)],'deletedCount':_0x24229e[_0x288e48(0xbe)],'deleted':_0x24229e},'message':_0x288e48(0xb8)+_0x24229e['length']+_0x288e48(0xcb)};}};async function resolveTargets(_0x4a54bb){const _0x3af20c=a59_0xe72775,_0x585621=_0x4a54bb[_0x3af20c(0xa6)]('id'),_0x54f293=_0x4a54bb[_0x3af20c(0xaa)](_0x3af20c(0xb6)),_0x24b884=_0x4a54bb[_0x3af20c(0xa6)](_0x3af20c(0xbf));let _0x163734;_0x54f293?(_0x163734=await listDatasets(_0x4a54bb[_0x3af20c(0xbb)],{'code':_0x54f293}),_0x163734=_0x163734[_0x3af20c(0xcc)](_0x558970=>_0x558970[_0x3af20c(0xb6)]===_0x54f293)):(_0x163734=await listDatasets(_0x4a54bb['appCode']),_0x585621>0x0&&(_0x163734=_0x163734[_0x3af20c(0xcc)](_0x4747ee=>_0x4747ee['id']===_0x585621)),_0x24b884>0x0&&(_0x163734=_0x163734[_0x3af20c(0xcc)](_0x48a23a=>_0x48a23a[_0x3af20c(0xba)]?.['dbId']===_0x24b884)));const _0x31ec09=_0x163734[_0x3af20c(0xc3)](normalizeTarget);if(_0x31ec09[_0x3af20c(0xbe)]===0x0){const _0x28b43b=_0x54f293||(_0x585621>0x0?_0x3af20c(0xa2)+_0x585621:_0x3af20c(0xa7)+_0x24b884);throw CliErrors['validation'](_0x3af20c(0xbc)+_0x28b43b+'.');}const _0x5c10f3=_0x4a54bb[_0x3af20c(0xa6)](_0x3af20c(0xb2));if(_0x5c10f3>0x0&&_0x31ec09[_0x3af20c(0xbe)]!==_0x5c10f3)throw CliErrors['validation']('Matched\x20'+_0x31ec09[_0x3af20c(0xbe)]+'\x20dataset(s),\x20but\x20--expected-count\x20is\x20'+_0x5c10f3+'.');return _0x31ec09;}function a59_0x1b8a(_0x205236,_0x21f9a8){_0x205236=_0x205236-0x9a;const _0x2c19bc=a59_0x2c19();let _0x1b8a32=_0x2c19bc[_0x205236];return _0x1b8a32;}function normalizeTarget(_0x2488b2){const _0xa5348c=a59_0xe72775,_0x1bde2a=_0x2488b2[_0xa5348c(0xba)]??{};return{'id':_0x2488b2['id'],'code':_0x2488b2[_0xa5348c(0xb6)],'name':_0x2488b2[_0xa5348c(0xc0)],'description':_0x2488b2[_0xa5348c(0xa8)],'source':_0x2488b2['source'],'dbId':_0x1bde2a['dbId'],'dbName':_0x1bde2a[_0xa5348c(0xac)],'tableName':_0x1bde2a[_0xa5348c(0xc5)],'relatedPageCount':Array[_0xa5348c(0xb3)](_0x2488b2[_0xa5348c(0xc2)])?_0x2488b2[_0xa5348c(0xc2)][_0xa5348c(0xbe)]:undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a60_0x193483=a60_0x1299;(function(_0xe7112c,_0x5f4cd7){const _0x59a69c=a60_0x1299,_0xf3ec9f=_0xe7112c();while(!![]){try{const _0x46d1c5=parseInt(_0x59a69c(0x8b))/0x1*(-parseInt(_0x59a69c(0x90))/0x2)+-parseInt(_0x59a69c(0x7a))/0x3*(-parseInt(_0x59a69c(0x79))/0x4)+-parseInt(_0x59a69c(0x69))/0x5*(parseInt(_0x59a69c(0xaf))/0x6)+-parseInt(_0x59a69c(0x8f))/0x7+parseInt(_0x59a69c(0x94))/0x8+parseInt(_0x59a69c(0x95))/0x9+parseInt(_0x59a69c(0x9d))/0xa;if(_0x46d1c5===_0x5f4cd7)break;else _0xf3ec9f['push'](_0xf3ec9f['shift']());}catch(_0x503e6b){_0xf3ec9f['push'](_0xf3ec9f['shift']());}}}(a60_0x1b63,0x64078));import{getDatasetDetail}from'../../core/api-client.js';import{CODE_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a60_0x1299(_0x30a5cf,_0x57ef44){_0x30a5cf=_0x30a5cf-0x64;const _0x1b63d5=a60_0x1b63();let _0x129918=_0x1b63d5[_0x30a5cf];return _0x129918;}function normalizeField(_0x269434){const _0x3282cc=a60_0x1299;if(_0x269434[_0x3282cc(0x7e)])return null;const _0x23f9e2=Boolean(_0x269434[_0x3282cc(0x67)]!==undefined||_0x269434[_0x3282cc(0x7c)]!==undefined);let _0x24980a={};if(!_0x23f9e2&&typeof _0x269434[_0x3282cc(0xad)]===_0x3282cc(0x85))try{_0x24980a=JSON[_0x3282cc(0x7d)](_0x269434['extend']);}catch{}const _0x3bf49e=_0x23f9e2?_0x269434[_0x3282cc(0xa3)]:_0x269434['code'],_0xae124d=_0x23f9e2?_0x269434[_0x3282cc(0x67)]:_0x269434[_0x3282cc(0xa3)],_0x1a71f1=_0x23f9e2?_0x269434[_0x3282cc(0x7c)]:_0x269434['type']||_0x269434['dataType'],_0x574c66=_0x23f9e2?_0x269434[_0x3282cc(0xac)]===!![]:_0x24980a[_0x3282cc(0xac)]===!![],_0x3d28fe=_0x23f9e2?_0x269434['required']===!![]:_0x24980a[_0x3282cc(0x9f)]===!![],_0x1784d1=_0x23f9e2?_0x269434[_0x3282cc(0xb0)]??null:_0x24980a[_0x3282cc(0xb0)]??null,_0x105db6={'name':_0x3bf49e,'displayName':_0xae124d||_0x3bf49e,'type':_0x1a71f1,'dbType':_0x269434[_0x3282cc(0x74)],'pk':_0x574c66,'required':_0x3d28fe,'description':_0x269434[_0x3282cc(0x93)]||undefined};return Array[_0x3282cc(0x98)](_0x1784d1)&&_0x1784d1[_0x3282cc(0x86)]>0x0&&(_0x105db6[_0x3282cc(0xb0)]=_0x1784d1),_0x105db6;}function parseJsonMaybe(_0x2d63a9){const _0x26dd72=a60_0x1299;if(typeof _0x2d63a9!=='string')return _0x2d63a9;try{return JSON[_0x26dd72(0x7d)](_0x2d63a9);}catch{return _0x2d63a9;}}function normalizeOperationEntry(_0x4708c0,_0x32061b){const _0x408650=a60_0x1299;if(!_0x32061b||typeof _0x32061b!=='object')return null;if(!_0x32061b['method']||!_0x32061b[_0x408650(0x92)])return null;const _0x3041d1={'name':_0x4708c0,'method':_0x32061b[_0x408650(0x73)],'path':_0x32061b[_0x408650(0x92)]};if(_0x32061b[_0x408650(0x6f)])_0x3041d1[_0x408650(0x6f)]=_0x32061b[_0x408650(0x6f)];if(_0x32061b['requestBody']!=null){const _0x127ce8=parseJsonMaybe(_0x32061b[_0x408650(0xa1)]);_0x3041d1['requestBody']=_0x127ce8;}if(_0x32061b['responseBody']!=null){const _0x44a358=parseJsonMaybe(_0x32061b[_0x408650(0x91)]);_0x3041d1['responseBody']=_0x44a358;}if(_0x32061b[_0x408650(0xa4)]!=null)_0x3041d1[_0x408650(0xa4)]=_0x32061b[_0x408650(0xa4)];if(_0x32061b[_0x408650(0x68)]!=null)_0x3041d1[_0x408650(0x68)]=_0x32061b[_0x408650(0x68)];if(Array[_0x408650(0x98)](_0x32061b[_0x408650(0x8e)]))_0x3041d1[_0x408650(0x8e)]=_0x32061b[_0x408650(0x8e)];if(Array[_0x408650(0x98)](_0x32061b['responseFields']))_0x3041d1[_0x408650(0xaa)]=_0x32061b[_0x408650(0xaa)];return _0x3041d1;}function summarizeDbtable(_0x5ac295){const _0x29770b=a60_0x1299,_0x17b34c={},_0x157d13=[_0x29770b(0xa9),_0x29770b(0x80),_0x29770b(0x9c),_0x29770b(0x6c),_0x29770b(0xac),_0x29770b(0x96),'logicField','createTimeField',_0x29770b(0x66),_0x29770b(0x82),_0x29770b(0xb3),_0x29770b(0xa2),_0x29770b(0x72),_0x29770b(0x76),'dblinkInfoDTO'];for(const _0x4fbeab of _0x157d13){if(_0x5ac295[_0x4fbeab]!==undefined)_0x17b34c[_0x4fbeab]=_0x5ac295[_0x4fbeab];}return typeof _0x17b34c[_0x29770b(0x96)]===_0x29770b(0x85)&&_0x17b34c[_0x29770b(0x96)][_0x29770b(0x86)]>0x0&&(_0x17b34c[_0x29770b(0x6d)]=_0x17b34c['allFields']['split'](',')[_0x29770b(0xa5)](_0x1b6643=>_0x1b6643[_0x29770b(0x9e)]())['filter'](Boolean)),_0x17b34c;}function normalizeRelatedPages(_0x2d3dac){const _0x3e22d1=a60_0x1299;if(!Array[_0x3e22d1(0x98)](_0x2d3dac))return[];return _0x2d3dac[_0x3e22d1(0x65)](_0x48e934=>_0x48e934&&typeof _0x48e934===_0x3e22d1(0xae))[_0x3e22d1(0xa5)](_0x56479b=>({'id':_0x56479b['id'],'type':_0x56479b[_0x3e22d1(0xa8)],'code':_0x56479b[_0x3e22d1(0x77)],'title':_0x56479b[_0x3e22d1(0x97)],'deleted':_0x56479b[_0x3e22d1(0x7e)]===!![]}));}function a60_0x1b63(){const _0x4b23df=['datasetKey','allFieldNames','properties','host','indexes','relatedPageInfoList','modifierNameField','method','dbType','relations','labelField','code','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically','4gofRxb','1513179QxQhgh','toDatasetCode','doType','parse','deleted','dbtableConfig','dbName','push','creatorIdField','formatRules','fields','string','length','modelId','toDatasetName','toFieldLabel','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','213Jzecbp','doVersion','modelCode','requestFields','3680334QeUfmm','1670GAvnUP','responseBody','path','description','2389480YMUcPh','5833926warFov','allFields','title','isArray','read','columnCodeListWithDeleted','source','tableName','271260hqoHpl','trim','required','sourceType','requestBody','modifierIdField','name','beforeScriptId','map','dataset','validateRules','type','dbId','responseFields','toField','pkField','extend','object','6JpUajE','options','str','detail','creatorNameField','alias','operations','filter','updateTimeField','displayName','afterScriptId','1825405xzqKEL','fromField','tableComment'];a60_0x1b63=function(){return _0x4b23df;};return a60_0x1b63();}export const datasetDetail={'service':a60_0x193483(0xa6),'command':a60_0x193483(0xb2),'description':a60_0x193483(0x8a),'risk':a60_0x193483(0x99),'flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':a60_0x193483(0xb4),'type':'string','description':a60_0x193483(0x78)}],async 'execute'(_0x56da18){const _0x32201f=a60_0x193483,_0x12b0ab=await getDatasetDetail(_0x56da18[_0x32201f(0xb1)](_0x32201f(0x77))),_0x57196c=Array[_0x32201f(0x98)](_0x12b0ab[_0x32201f(0x84)])?_0x12b0ab['fields']:Array[_0x32201f(0x98)](_0x12b0ab[_0x32201f(0x6e)])?_0x12b0ab[_0x32201f(0x6e)]:[],_0x4fc7ab=_0x57196c[_0x32201f(0xa5)](_0x345bbc=>normalizeField(_0x345bbc))[_0x32201f(0x65)](_0x5eef66=>_0x5eef66!==null),_0xf640dd=_0x12b0ab[_0x32201f(0x64)]??{},_0x439d66=[];for(const [_0x2739bd,_0x36b2c4]of Object['entries'](_0xf640dd)){const _0x15d39b=normalizeOperationEntry(_0x2739bd,_0x36b2c4);if(_0x15d39b)_0x439d66[_0x32201f(0x81)](_0x15d39b);}const _0x2ff4c6=_0x12b0ab[_0x32201f(0x7f)]??{},_0x277359=_0x12b0ab[_0x32201f(0xa6)]??{},_0x33e81c=_0x2ff4c6['dbId']!=null?{'id':_0x2ff4c6[_0x32201f(0xa9)],'name':_0x2ff4c6[_0x32201f(0x80)]??null}:undefined;let _0x26b13f;return typeof _0x12b0ab[_0x32201f(0xad)]==='string'&&(_0x26b13f=parseJsonMaybe(_0x12b0ab[_0x32201f(0xad)])),{'ok':!![],'data':{'id':_0x12b0ab[_0x32201f(0x87)]??_0x12b0ab['id'],'name':_0x12b0ab[_0x32201f(0xa3)],'code':_0x12b0ab[_0x32201f(0x8d)]||_0x12b0ab[_0x32201f(0x77)],'doVersion':_0x12b0ab[_0x32201f(0x8c)],'description':_0x12b0ab[_0x32201f(0x93)]||_0x277359[_0x32201f(0x6b)]||undefined,'source':_0x12b0ab[_0x32201f(0x9b)]||_0x277359[_0x32201f(0xa0)],'table':_0x2ff4c6[_0x32201f(0x9c)]||_0x277359['tableName'],'datasetKey':_0x2ff4c6[_0x32201f(0x6c)],'pk':_0x2ff4c6[_0x32201f(0xac)],'db':_0x33e81c,'dbtable':summarizeDbtable(_0x2ff4c6),'fields':_0x4fc7ab,'operations':_0x439d66,'indexes':Array['isArray'](_0x277359[_0x32201f(0x70)])?_0x277359[_0x32201f(0x70)]:[],'relations':Array[_0x32201f(0x98)](_0x12b0ab['relations'])?_0x12b0ab[_0x32201f(0x75)][_0x32201f(0xa5)](_0x1cf0a3=>({'fromField':_0x1cf0a3[_0x32201f(0x6a)],'toDataset':_0x1cf0a3[_0x32201f(0x88)],'toCode':_0x1cf0a3[_0x32201f(0x7b)],'toTable':_0x1cf0a3['toTableName'],'toField':_0x1cf0a3[_0x32201f(0xab)],'labelField':_0x1cf0a3[_0x32201f(0x89)]||undefined})):[],'relatedPages':normalizeRelatedPages(_0x12b0ab[_0x32201f(0x71)]),...Array[_0x32201f(0x98)](_0x12b0ab[_0x32201f(0x9a)])?{'columnCodeListWithDeleted':_0x12b0ab['columnCodeListWithDeleted']}:{},'formatRules':Array['isArray'](_0x12b0ab[_0x32201f(0x83)])?_0x12b0ab[_0x32201f(0x83)]:[],'validateRules':Array['isArray'](_0x12b0ab[_0x32201f(0xa7)])?_0x12b0ab[_0x32201f(0xa7)]:[],..._0x26b13f!==undefined?{'extend':_0x26b13f}:{},'stats':{'fieldCount':_0x4fc7ab[_0x32201f(0x86)],'operationCount':_0x439d66['length']}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a61_0x157d29=a61_0x44de;(function(_0x31e09f,_0x12a4bf){const _0x247c1a=a61_0x44de,_0x5bceb4=_0x31e09f();while(!![]){try{const _0x395ee8=parseInt(_0x247c1a(0x1e0))/0x1+parseInt(_0x247c1a(0x1ed))/0x2*(parseInt(_0x247c1a(0x21a))/0x3)+-parseInt(_0x247c1a(0x1ea))/0x4*(parseInt(_0x247c1a(0x207))/0x5)+-parseInt(_0x247c1a(0x1f8))/0x6*(parseInt(_0x247c1a(0x216))/0x7)+-parseInt(_0x247c1a(0x200))/0x8*(parseInt(_0x247c1a(0x1e2))/0x9)+-parseInt(_0x247c1a(0x1de))/0xa+parseInt(_0x247c1a(0x21d))/0xb*(parseInt(_0x247c1a(0x20d))/0xc);if(_0x395ee8===_0x12a4bf)break;else _0x5bceb4['push'](_0x5bceb4['shift']());}catch(_0x5bde33){_0x5bceb4['push'](_0x5bceb4['shift']());}}}(a61_0x484c,0x5ea9c));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([[a61_0x157d29(0x205),{'message':'dataset\x20extend-update\x20does\x20not\x20support\x20businessGroup;\x20use\x20dataset\x20business-group-update','hint':'Use\x20`rabetbase\x20dataset\x20business-group-update`\x20to\x20update\x20business\x20model\x20groups.'}]]);export function parseJsonObjectFlag(_0x2a6d48,_0x48f69e){const _0x585314=a61_0x157d29;if(!_0x2a6d48)return undefined;let _0x4e9436;try{_0x4e9436=JSON[_0x585314(0x20e)](_0x2a6d48);}catch(_0x2c5864){const _0x14c26c=_0x2c5864 instanceof Error?_0x2c5864['message']:String(_0x2c5864);throw CliErrors[_0x585314(0x1fa)](_0x48f69e+'\x20must\x20be\x20valid\x20JSON\x20object:\x20'+_0x14c26c);}if(!isPlainObject(_0x4e9436)||Array['isArray'](_0x4e9436))throw CliErrors[_0x585314(0x1fa)](_0x48f69e+_0x585314(0x218));return _0x4e9436;}export function validateExtendPatchKeys(_0x2d4742){const _0x92ffe3=a61_0x157d29,_0x16b87f=Object[_0x92ffe3(0x1df)](_0x2d4742);if(_0x16b87f[_0x92ffe3(0x1f4)]===0x0)throw CliErrors[_0x92ffe3(0x1fa)](_0x92ffe3(0x21c));for(const _0x3843b6 of _0x16b87f){const _0x5258e4=EXTEND_PATCH_REDIRECTS[_0x92ffe3(0x21e)](_0x3843b6);if(_0x5258e4)throw CliErrors[_0x92ffe3(0x1fa)](_0x5258e4['message'],_0x5258e4['hint']);if(!MUTABLE_EXTEND_KEYS[_0x92ffe3(0x1ee)](_0x3843b6))throw CliErrors[_0x92ffe3(0x1fa)](_0x92ffe3(0x1eb)+_0x3843b6,describeMutableExtendKeys());}}function describeMutableExtendKeys(){const _0x135992=a61_0x157d29,_0x16999b=Array['from'](MUTABLE_EXTEND_KEYS)[_0x135992(0x1ec)]();return _0x16999b[_0x135992(0x1f4)]>0x0?'Allowed\x20keys:\x20'+_0x16999b[_0x135992(0x20f)](',\x20'):'No\x20dataset\x20extend\x20patch\x20keys\x20are\x20currently\x20supported.';}export function applyExtendPatch(_0x4cb940,_0x161a9e){const _0x533828=a61_0x157d29;validateExtendPatchKeys(_0x161a9e);const _0x263a1f=deepClone(_0x4cb940),_0x5b34dc=[];for(const [_0xd9dd4d,_0x3aa9d9]of Object['entries'](_0x161a9e)){const _0x246359=_0x263a1f[_0xd9dd4d],_0x200956=deepClone(_0x3aa9d9);!deepEqual(_0x246359,_0x200956)&&(_0x263a1f[_0xd9dd4d]=_0x200956,_0x5b34dc[_0x533828(0x1e9)]('extend.'+_0xd9dd4d));}return _0x5b34dc[_0x533828(0x1ec)](),{'after':_0x263a1f,'changedPaths':_0x5b34dc,'changed':_0x5b34dc[_0x533828(0x1f4)]>0x0};}export function assertExpectation(_0x4c6edb,_0x186617){const _0xa1cc02=a61_0x157d29;if(!_0x186617)return;for(const [_0xed54e8,_0x495f4f]of Object['entries'](_0x186617)){const _0x173e78=_0x4c6edb[_0xed54e8];if(!deepEqual(_0x173e78,_0x495f4f))throw CliErrors[_0xa1cc02(0x1fa)](_0xa1cc02(0x1e8)+_0xed54e8,'Expected\x20'+JSON['stringify'](_0x495f4f)+_0xa1cc02(0x1ff)+JSON[_0xa1cc02(0x201)](_0x173e78));}}export async function buildDatasetExtendUpdateResult({appCode:_0x4ed986,input:_0x2ec986,dryRun:_0x179cae}){const _0x42b91c=a61_0x157d29;validateInput(_0x2ec986);const _0x2b9e5b=await getDatasetDetail(_0x2ec986[_0x42b91c(0x1e7)]),_0x2da8d5=parseDatasetExtend(_0x2b9e5b[_0x42b91c(0x204)]),_0xe263d8=deepClone(_0x2da8d5[_0x42b91c(0x1f5)]);assertExpectation(_0xe263d8,_0x2ec986['expect']);const {after:_0x52a7d4,changedPaths:_0x1aa802,changed:_0x2c9220}=applyExtendPatch(_0xe263d8,_0x2ec986[_0x42b91c(0x1f9)]),_0x4cb11f=summarizeDataset(_0x2b9e5b,_0x2ec986[_0x42b91c(0x1e7)]);return _0x2c9220&&!_0x179cae&&(_0x2b9e5b[_0x42b91c(0x204)]=serializeDatasetExtend(_0x52a7d4,_0x2da8d5[_0x42b91c(0x209)]),await updateDrivenData(_0x2b9e5b)),{'ok':!![],'data':{'appCode':_0x4ed986,'selector':{'code':_0x2ec986[_0x42b91c(0x1e7)]},'dataset':_0x4cb11f,'dryRun':_0x179cae,'changed':_0x2c9220,'changedPaths':_0x1aa802,'before':{'extend':_0xe263d8},'after':{'extend':_0x52a7d4},'submitted':_0x2c9220&&!_0x179cae},'message':_0x2c9220?_0x179cae?_0x42b91c(0x206)+_0x1aa802[_0x42b91c(0x20f)](',\x20')+')':_0x42b91c(0x21b)+_0x1aa802[_0x42b91c(0x20f)](',\x20')+')':'No\x20changes\x20for\x20dataset\x20extend'};}export const datasetExtendUpdate={'service':a61_0x157d29(0x1e5),'command':a61_0x157d29(0x1fe),'description':a61_0x157d29(0x1f7),'risk':'write','flags':[CODE_FLAG,{'name':a61_0x157d29(0x20c),'type':a61_0x157d29(0x211),'required':!![],'description':a61_0x157d29(0x1e3)},{'name':a61_0x157d29(0x212),'type':a61_0x157d29(0x211),'required':![],'description':a61_0x157d29(0x1f3)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x26a959){validateInput(readExtendUpdateInput(_0x26a959));},async 'dryRun'(_0x3d6dbb){const _0x36c8ef=a61_0x157d29,_0x156af4=await buildDatasetExtendUpdateResult({'appCode':_0x3d6dbb[_0x36c8ef(0x210)],'input':readExtendUpdateInput(_0x3d6dbb),'dryRun':!![]});return{'method':_0x36c8ef(0x215),'url':_0x36c8ef(0x1f2),'body':_0x156af4[_0x36c8ef(0x1e4)],'description':_0x156af4[_0x36c8ef(0x208)]};},async 'execute'(_0xb5c4aa){const _0x1fbd27=a61_0x157d29;return buildDatasetExtendUpdateResult({'appCode':_0xb5c4aa[_0x1fbd27(0x210)],'input':readExtendUpdateInput(_0xb5c4aa),'dryRun':![]});}};function readExtendUpdateInput(_0x407a3c){const _0xf82d2e=a61_0x157d29,_0x56806d=trim(_0x407a3c['str'](_0xf82d2e(0x1e7))),_0x3ab828=parseJsonObjectFlag(_0x407a3c[_0xf82d2e(0x20a)](_0xf82d2e(0x20c)),_0xf82d2e(0x1fc)),_0x47bf7e=parseJsonObjectFlag(_0x407a3c[_0xf82d2e(0x20a)](_0xf82d2e(0x212)),_0xf82d2e(0x1e6));return{'code':_0x56806d,'patch':_0x3ab828||{},'expect':_0x47bf7e};}function a61_0x44de(_0x15b1ea,_0x23576c){_0x15b1ea=_0x15b1ea-0x1de;const _0x484cad=a61_0x484c();let _0x44de07=_0x484cad[_0x15b1ea];return _0x44de07;}function validateInput(_0x1b6efc){const _0x4f7076=a61_0x157d29;if(!_0x1b6efc[_0x4f7076(0x1e7)])throw CliErrors[_0x4f7076(0x1fa)](_0x4f7076(0x202));validateExtendPatchKeys(_0x1b6efc[_0x4f7076(0x1f9)]);}function parseDatasetExtend(_0x4f0126){const _0x5cb593=a61_0x157d29;if(typeof _0x4f0126===_0x5cb593(0x211)){const _0x58a6bc=_0x4f0126[_0x5cb593(0x1fb)]();if(!_0x58a6bc)return{'value':{},'shape':_0x5cb593(0x211)};let _0x2061e0;try{_0x2061e0=JSON[_0x5cb593(0x20e)](_0x58a6bc);}catch(_0x23d631){const _0x31ac4a=_0x23d631 instanceof Error?_0x23d631['message']:String(_0x23d631);throw CliErrors['validation'](_0x5cb593(0x213)+_0x31ac4a);}if(!isPlainObject(_0x2061e0)||Array[_0x5cb593(0x1fd)](_0x2061e0))throw CliErrors[_0x5cb593(0x1fa)](_0x5cb593(0x203));return{'value':_0x2061e0,'shape':_0x5cb593(0x211)};}if(_0x4f0126===undefined||_0x4f0126===null)return{'value':{},'shape':'string'};if(!isPlainObject(_0x4f0126)||Array[_0x5cb593(0x1fd)](_0x4f0126))throw CliErrors[_0x5cb593(0x1fa)]('Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object');return{'value':_0x4f0126,'shape':'object'};}function serializeDatasetExtend(_0x5ae879,_0x346e61){const _0x12ec98=a61_0x157d29;return _0x346e61==='string'?JSON[_0x12ec98(0x201)](_0x5ae879):_0x5ae879;}function summarizeDataset(_0xe070c1,_0x32426f){const _0x323c80=a61_0x157d29,_0x35e938=isPlainObject(_0xe070c1['dataset'])?_0xe070c1[_0x323c80(0x1e5)]:{},_0x436489=isPlainObject(_0xe070c1[_0x323c80(0x1f0)])?_0xe070c1[_0x323c80(0x1f0)]:{};return{'id':_0xe070c1[_0x323c80(0x1ef)]??_0xe070c1['id']??_0x35e938['datasetId']??null,'code':_0xe070c1[_0x323c80(0x1f6)]??_0xe070c1['code']??_0x35e938[_0x323c80(0x1f1)]??_0x32426f,'name':_0xe070c1[_0x323c80(0x219)]??_0x35e938['datasetName']??null,'table':_0x436489[_0x323c80(0x20b)]??_0x35e938[_0x323c80(0x20b)]??null,'db':_0x436489[_0x323c80(0x1e1)]??_0x436489[_0x323c80(0x217)]??null};}function deepClone(_0x4a9f2a){const _0x5caf27=a61_0x157d29;if(_0x4a9f2a===undefined)return _0x4a9f2a;return JSON[_0x5caf27(0x20e)](JSON[_0x5caf27(0x201)](_0x4a9f2a));}function deepEqual(_0x3c4a8e,_0x23c6c7){const _0x2545b1=a61_0x157d29;return JSON[_0x2545b1(0x201)](_0x3c4a8e)===JSON['stringify'](_0x23c6c7);}function isPlainObject(_0xa92b0f){const _0x568230=a61_0x157d29;return Boolean(_0xa92b0f)&&typeof _0xa92b0f===_0x568230(0x214)&&!Array[_0x568230(0x1fd)](_0xa92b0f);}function a61_0x484c(){const _0x21093e=['JSON\x20object\x20of\x20expected\x20current\x20extend\x20values;\x20mismatch\x20aborts\x20without\x20writing','length','value','modelCode','Patch\x20dataset\x20top-level\x20extend\x20safely','1164OtSwPK','patch','validation','trim','--patch-json','isArray','extend-update',',\x20actual\x20','24OWCoNH','stringify','--code\x20is\x20required','Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object','extend','businessGroup','Dry-run:\x20dataset\x20extend\x20would\x20change\x20(','13410TdwwwF','message','shape','str','tableName','patch-json','168gkjtRc','parse','join','appCode','string','expect-json','Dataset\x20extend\x20must\x20be\x20valid\x20JSON\x20object:\x20','object','POST','12593XyAKLW','dbId','\x20must\x20be\x20a\x20JSON\x20object','name','96AIKQtq','Updated\x20dataset\x20extend\x20(','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','553619wlhhGr','get','1240370OpifWp','keys','249865MBMXWf','dbName','699822xIoqfr','JSON\x20object\x20patch\x20for\x20dataset\x20top-level\x20extend;\x20current\x20allowlist\x20is\x20empty','data','dataset','--expect-json','code','Expectation\x20mismatch\x20at\x20extend.','push','876CMnxdx','Unsupported\x20patch\x20key:\x20','sort','45434msUVlw','has','modelId','dbtableConfig','datasetCode','/smartapi/dataset/update-driven-data'];a61_0x484c=function(){return _0x21093e;};return a61_0x484c();}function trim(_0x33d6f1){const _0x261ca3=a61_0x157d29,_0x77affe=String(_0x33d6f1||'')[_0x261ca3(0x1fb)]();return _0x77affe;}
|
|
1
|
+
const a61_0x594ebe=a61_0x5d27;(function(_0x24c60e,_0x73b355){const _0x21f17e=a61_0x5d27,_0x4a5e74=_0x24c60e();while(!![]){try{const _0x4c986e=-parseInt(_0x21f17e(0x109))/0x1+-parseInt(_0x21f17e(0xe2))/0x2+-parseInt(_0x21f17e(0x116))/0x3+parseInt(_0x21f17e(0xed))/0x4*(parseInt(_0x21f17e(0x102))/0x5)+-parseInt(_0x21f17e(0xd7))/0x6+parseInt(_0x21f17e(0xfe))/0x7+parseInt(_0x21f17e(0xe9))/0x8;if(_0x4c986e===_0x73b355)break;else _0x4a5e74['push'](_0x4a5e74['shift']());}catch(_0x36b791){_0x4a5e74['push'](_0x4a5e74['shift']());}}}(a61_0x49f4,0xb1338));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a61_0x49f4(){const _0x354d29=['Expected\x20','Dry-run:\x20dataset\x20extend\x20would\x20change\x20(','validation','message','--patch-json','str','data','dbId','shape','4442956HwYbCS','object','value','isArray','262505igTuax','extend','Use\x20`rabetbase\x20dataset\x20business-group-update`\x20to\x20update\x20business\x20model\x20groups.','get','join','patch-json','keys','106862DJAcpr','patch','string','trim','businessGroup','datasetCode','--expect-json','stringify','write','JSON\x20object\x20patch\x20for\x20dataset\x20top-level\x20extend;\x20current\x20allowlist\x20is\x20empty','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','length','push','3897921nWcBSW','parse','3753840pmBLdA','\x20must\x20be\x20valid\x20JSON\x20object:\x20','Dataset\x20extend\x20must\x20be\x20valid\x20JSON\x20object:\x20','modelCode','dataset','Allowed\x20keys:\x20','Updated\x20dataset\x20extend\x20(','Patch\x20dataset\x20top-level\x20extend\x20safely','hint','\x20must\x20be\x20a\x20JSON\x20object','code','2459520onozZC','extend-update','datasetName','dbtableConfig','modelId','extend.','expect-json','22201328LtyTcC','JSON\x20object\x20of\x20expected\x20current\x20extend\x20values;\x20mismatch\x20aborts\x20without\x20writing','Expectation\x20mismatch\x20at\x20extend.','tableName','44XsBKWG','Unsupported\x20patch\x20key:\x20','entries','Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object','sort','appCode','POST','No\x20changes\x20for\x20dataset\x20extend'];a61_0x49f4=function(){return _0x354d29;};return a61_0x49f4();}const MUTABLE_EXTEND_KEYS=new Set(),EXTEND_PATCH_REDIRECTS=new Map([[a61_0x594ebe(0x10d),{'message':'dataset\x20extend-update\x20does\x20not\x20support\x20businessGroup;\x20use\x20dataset\x20business-group-update','hint':a61_0x594ebe(0x104)}]]);export function parseJsonObjectFlag(_0x38a742,_0x53f7cb){const _0xc1c79f=a61_0x594ebe;if(!_0x38a742)return undefined;let _0xdae526;try{_0xdae526=JSON[_0xc1c79f(0x117)](_0x38a742);}catch(_0x278e73){const _0x37c16d=_0x278e73 instanceof Error?_0x278e73[_0xc1c79f(0xf8)]:String(_0x278e73);throw CliErrors[_0xc1c79f(0xf7)](_0x53f7cb+_0xc1c79f(0xd8)+_0x37c16d);}if(!isPlainObject(_0xdae526)||Array[_0xc1c79f(0x101)](_0xdae526))throw CliErrors[_0xc1c79f(0xf7)](_0x53f7cb+_0xc1c79f(0xe0));return _0xdae526;}export function validateExtendPatchKeys(_0x55c61c){const _0x194622=a61_0x594ebe,_0x53f202=Object[_0x194622(0x108)](_0x55c61c);if(_0x53f202['length']===0x0)throw CliErrors[_0x194622(0xf7)](_0x194622(0x113));for(const _0x54400f of _0x53f202){const _0x5c5f13=EXTEND_PATCH_REDIRECTS[_0x194622(0x105)](_0x54400f);if(_0x5c5f13)throw CliErrors[_0x194622(0xf7)](_0x5c5f13[_0x194622(0xf8)],_0x5c5f13[_0x194622(0xdf)]);if(!MUTABLE_EXTEND_KEYS['has'](_0x54400f))throw CliErrors[_0x194622(0xf7)](_0x194622(0xee)+_0x54400f,describeMutableExtendKeys());}}function describeMutableExtendKeys(){const _0x385c44=a61_0x594ebe,_0x707ee4=Array['from'](MUTABLE_EXTEND_KEYS)[_0x385c44(0xf1)]();return _0x707ee4[_0x385c44(0x114)]>0x0?_0x385c44(0xdc)+_0x707ee4['join'](',\x20'):'No\x20dataset\x20extend\x20patch\x20keys\x20are\x20currently\x20supported.';}export function applyExtendPatch(_0x47a84c,_0x4190c9){const _0x303ecb=a61_0x594ebe;validateExtendPatchKeys(_0x4190c9);const _0x1848bb=deepClone(_0x47a84c),_0x4f22e4=[];for(const [_0x46430b,_0x43891a]of Object[_0x303ecb(0xef)](_0x4190c9)){const _0x27888c=_0x1848bb[_0x46430b],_0x2fc2cd=deepClone(_0x43891a);!deepEqual(_0x27888c,_0x2fc2cd)&&(_0x1848bb[_0x46430b]=_0x2fc2cd,_0x4f22e4[_0x303ecb(0x115)](_0x303ecb(0xe7)+_0x46430b));}return _0x4f22e4[_0x303ecb(0xf1)](),{'after':_0x1848bb,'changedPaths':_0x4f22e4,'changed':_0x4f22e4[_0x303ecb(0x114)]>0x0};}export function assertExpectation(_0x25e48a,_0x50b892){const _0x32200c=a61_0x594ebe;if(!_0x50b892)return;for(const [_0x45997c,_0x41839f]of Object[_0x32200c(0xef)](_0x50b892)){const _0x34da11=_0x25e48a[_0x45997c];if(!deepEqual(_0x34da11,_0x41839f))throw CliErrors[_0x32200c(0xf7)](_0x32200c(0xeb)+_0x45997c,_0x32200c(0xf5)+JSON[_0x32200c(0x110)](_0x41839f)+',\x20actual\x20'+JSON['stringify'](_0x34da11));}}export async function buildDatasetExtendUpdateResult({appCode:_0x202c33,input:_0x48c2eb,dryRun:_0x73d073}){const _0x3b42c6=a61_0x594ebe;validateInput(_0x48c2eb);const _0x4fd173=await getDatasetDetail(_0x48c2eb[_0x3b42c6(0xe1)]),_0x9517f6=parseDatasetExtend(_0x4fd173[_0x3b42c6(0x103)]),_0x8e1a4c=deepClone(_0x9517f6[_0x3b42c6(0x100)]);assertExpectation(_0x8e1a4c,_0x48c2eb['expect']);const {after:_0x16cdd5,changedPaths:_0x2078d4,changed:_0x258f0d}=applyExtendPatch(_0x8e1a4c,_0x48c2eb[_0x3b42c6(0x10a)]),_0x438d26=summarizeDataset(_0x4fd173,_0x48c2eb[_0x3b42c6(0xe1)]);return _0x258f0d&&!_0x73d073&&(_0x4fd173[_0x3b42c6(0x103)]=serializeDatasetExtend(_0x16cdd5,_0x9517f6[_0x3b42c6(0xfd)]),await updateDrivenData(_0x4fd173)),{'ok':!![],'data':{'appCode':_0x202c33,'selector':{'code':_0x48c2eb['code']},'dataset':_0x438d26,'dryRun':_0x73d073,'changed':_0x258f0d,'changedPaths':_0x2078d4,'before':{'extend':_0x8e1a4c},'after':{'extend':_0x16cdd5},'submitted':_0x258f0d&&!_0x73d073},'message':_0x258f0d?_0x73d073?_0x3b42c6(0xf6)+_0x2078d4[_0x3b42c6(0x106)](',\x20')+')':_0x3b42c6(0xdd)+_0x2078d4[_0x3b42c6(0x106)](',\x20')+')':_0x3b42c6(0xf4)};}export const datasetExtendUpdate={'service':a61_0x594ebe(0xdb),'command':a61_0x594ebe(0xe3),'description':a61_0x594ebe(0xde),'risk':a61_0x594ebe(0x111),'flags':[CODE_FLAG,{'name':a61_0x594ebe(0x107),'type':a61_0x594ebe(0x10b),'required':!![],'description':a61_0x594ebe(0x112)},{'name':a61_0x594ebe(0xe8),'type':'string','required':![],'description':a61_0x594ebe(0xea)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3c4242){validateInput(readExtendUpdateInput(_0x3c4242));},async 'dryRun'(_0x20dee0){const _0x4e4eff=a61_0x594ebe,_0x4c2bfb=await buildDatasetExtendUpdateResult({'appCode':_0x20dee0[_0x4e4eff(0xf2)],'input':readExtendUpdateInput(_0x20dee0),'dryRun':!![]});return{'method':_0x4e4eff(0xf3),'url':'/smartapi/dataset/update-driven-data','body':_0x4c2bfb[_0x4e4eff(0xfb)],'description':_0x4c2bfb[_0x4e4eff(0xf8)]};},async 'execute'(_0x2cb4d5){const _0x27f33f=a61_0x594ebe;return buildDatasetExtendUpdateResult({'appCode':_0x2cb4d5[_0x27f33f(0xf2)],'input':readExtendUpdateInput(_0x2cb4d5),'dryRun':![]});}};function readExtendUpdateInput(_0x483e3e){const _0x55d4d9=a61_0x594ebe,_0x1d2e97=trim(_0x483e3e['str']('code')),_0x583f0f=parseJsonObjectFlag(_0x483e3e['str'](_0x55d4d9(0x107)),_0x55d4d9(0xf9)),_0x6389dc=parseJsonObjectFlag(_0x483e3e[_0x55d4d9(0xfa)](_0x55d4d9(0xe8)),_0x55d4d9(0x10f));return{'code':_0x1d2e97,'patch':_0x583f0f||{},'expect':_0x6389dc};}function validateInput(_0x176ec3){const _0x5b5340=a61_0x594ebe;if(!_0x176ec3[_0x5b5340(0xe1)])throw CliErrors['validation']('--code\x20is\x20required');validateExtendPatchKeys(_0x176ec3[_0x5b5340(0x10a)]);}function parseDatasetExtend(_0x6006e9){const _0x4af572=a61_0x594ebe;if(typeof _0x6006e9===_0x4af572(0x10b)){const _0x15ecf3=_0x6006e9[_0x4af572(0x10c)]();if(!_0x15ecf3)return{'value':{},'shape':_0x4af572(0x10b)};let _0x1410ff;try{_0x1410ff=JSON[_0x4af572(0x117)](_0x15ecf3);}catch(_0x5ae586){const _0x92b8e=_0x5ae586 instanceof Error?_0x5ae586[_0x4af572(0xf8)]:String(_0x5ae586);throw CliErrors[_0x4af572(0xf7)](_0x4af572(0xd9)+_0x92b8e);}if(!isPlainObject(_0x1410ff)||Array[_0x4af572(0x101)](_0x1410ff))throw CliErrors['validation'](_0x4af572(0xf0));return{'value':_0x1410ff,'shape':_0x4af572(0x10b)};}if(_0x6006e9===undefined||_0x6006e9===null)return{'value':{},'shape':'string'};if(!isPlainObject(_0x6006e9)||Array[_0x4af572(0x101)](_0x6006e9))throw CliErrors[_0x4af572(0xf7)](_0x4af572(0xf0));return{'value':_0x6006e9,'shape':_0x4af572(0xff)};}function serializeDatasetExtend(_0x542dcb,_0xacd550){const _0x21d163=a61_0x594ebe;return _0xacd550===_0x21d163(0x10b)?JSON[_0x21d163(0x110)](_0x542dcb):_0x542dcb;}function summarizeDataset(_0x4d3978,_0x2d0935){const _0x960b4c=a61_0x594ebe,_0x3b1583=isPlainObject(_0x4d3978['dataset'])?_0x4d3978[_0x960b4c(0xdb)]:{},_0x3620f9=isPlainObject(_0x4d3978[_0x960b4c(0xe5)])?_0x4d3978[_0x960b4c(0xe5)]:{};return{'id':_0x4d3978[_0x960b4c(0xe6)]??_0x4d3978['id']??_0x3b1583['datasetId']??null,'code':_0x4d3978[_0x960b4c(0xda)]??_0x4d3978[_0x960b4c(0xe1)]??_0x3b1583[_0x960b4c(0x10e)]??_0x2d0935,'name':_0x4d3978['name']??_0x3b1583[_0x960b4c(0xe4)]??null,'table':_0x3620f9['tableName']??_0x3b1583[_0x960b4c(0xec)]??null,'db':_0x3620f9['dbName']??_0x3620f9[_0x960b4c(0xfc)]??null};}function deepClone(_0x6b647c){if(_0x6b647c===undefined)return _0x6b647c;return JSON['parse'](JSON['stringify'](_0x6b647c));}function a61_0x5d27(_0x2f638a,_0x43dee6){_0x2f638a=_0x2f638a-0xd7;const _0x49f4ab=a61_0x49f4();let _0x5d2757=_0x49f4ab[_0x2f638a];return _0x5d2757;}function deepEqual(_0x4cce05,_0xac22d2){const _0x334f7a=a61_0x594ebe;return JSON['stringify'](_0x4cce05)===JSON[_0x334f7a(0x110)](_0xac22d2);}function isPlainObject(_0x10516a){const _0x5b1545=a61_0x594ebe;return Boolean(_0x10516a)&&typeof _0x10516a===_0x5b1545(0xff)&&!Array[_0x5b1545(0x101)](_0x10516a);}function trim(_0x29c68c){const _0x2a1979=a61_0x594ebe,_0x3d20e5=String(_0x29c68c||'')[_0x2a1979(0x10c)]();return _0x3d20e5;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a62_0x2b7532=a62_0x5309;(function(_0x62e138,_0x74c27d){const _0x22ad79=a62_0x5309,_0x3b08d5=_0x62e138();while(!![]){try{const _0x465238=-parseInt(_0x22ad79(0x1c2))/0x1*(-parseInt(_0x22ad79(0x19a))/0x2)+parseInt(_0x22ad79(0x1ce))/0x3*(parseInt(_0x22ad79(0x1d0))/0x4)+parseInt(_0x22ad79(0x1cd))/0x5+-parseInt(_0x22ad79(0x1c6))/0x6*(-parseInt(_0x22ad79(0x1b9))/0x7)+-parseInt(_0x22ad79(0x1e4))/0x8*(parseInt(_0x22ad79(0x1d9))/0x9)+-parseInt(_0x22ad79(0x1b4))/0xa*(parseInt(_0x22ad79(0x1ba))/0xb)+-parseInt(_0x22ad79(0x1e7))/0xc;if(_0x465238===_0x74c27d)break;else _0x3b08d5['push'](_0x3b08d5['shift']());}catch(_0x17ccda){_0x3b08d5['push'](_0x3b08d5['shift']());}}}(a62_0x4da7,0x35a3a));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([a62_0x2b7532(0x1ea),a62_0x2b7532(0x1c9),a62_0x2b7532(0x1d6),a62_0x2b7532(0x1db),a62_0x2b7532(0x1ab),a62_0x2b7532(0x1d5),a62_0x2b7532(0x1b2),a62_0x2b7532(0x1a8),a62_0x2b7532(0x199)]),FORBIDDEN_FIELD_KEYS=new Set(['id',a62_0x2b7532(0x19f),a62_0x2b7532(0x198),a62_0x2b7532(0x1a5),a62_0x2b7532(0x196),a62_0x2b7532(0x1d2),'dbFieldName',a62_0x2b7532(0x1b8),a62_0x2b7532(0x1e3),a62_0x2b7532(0x1dd),a62_0x2b7532(0x1e2),'systemRetain']);export function parseJsonObjectFlag(_0x36c508,_0x43bf57){const _0x41674a=a62_0x2b7532;if(!_0x36c508)return undefined;let _0x368bdd;try{_0x368bdd=JSON[_0x41674a(0x1eb)](_0x36c508);}catch(_0xcbc842){const _0x1bdf96=_0xcbc842 instanceof Error?_0xcbc842[_0x41674a(0x1d4)]:String(_0xcbc842);throw CliErrors[_0x41674a(0x19b)](_0x43bf57+_0x41674a(0x1e9)+_0x1bdf96);}if(!isPlainObject(_0x368bdd)||Array['isArray'](_0x368bdd))throw CliErrors[_0x41674a(0x19b)](_0x43bf57+_0x41674a(0x1e8));return _0x368bdd;}function a62_0x5309(_0x387ca9,_0x155e87){_0x387ca9=_0x387ca9-0x195;const _0x4da764=a62_0x4da7();let _0x530967=_0x4da764[_0x387ca9];return _0x530967;}export function validatePatchKeys(_0x3a72a8){const _0x30d081=a62_0x2b7532,_0x437c40=Object[_0x30d081(0x1a4)](_0x3a72a8);if(_0x437c40['length']===0x0)throw CliErrors['validation'](_0x30d081(0x1c1));for(const _0x1c0995 of _0x437c40){if(FORBIDDEN_FIELD_KEYS[_0x30d081(0x1ec)](_0x1c0995))throw CliErrors[_0x30d081(0x19b)](_0x30d081(0x1ac)+_0x1c0995);if(!MUTABLE_FIELD_KEYS[_0x30d081(0x1ec)](_0x1c0995))throw CliErrors[_0x30d081(0x19b)](_0x30d081(0x1a9)+_0x1c0995,_0x30d081(0x19c)+Array[_0x30d081(0x195)](MUTABLE_FIELD_KEYS)[_0x30d081(0x1b1)](',\x20'));}}export function applyFieldPatch(_0x458ec7,_0x43d6d5){const _0x2a525a=a62_0x2b7532;validatePatchKeys(_0x43d6d5);const _0x5396d1=deepClone(_0x458ec7),_0x38fb73=new Set();for(const [_0x411002,_0x12cf22]of Object[_0x2a525a(0x1c7)](_0x43d6d5)){const _0x39b2ad=_0x5396d1[_0x411002],_0x141eb2=mergePatchValue(_0x39b2ad,_0x12cf22);!deepEqual(_0x39b2ad,_0x141eb2)&&(_0x5396d1[_0x411002]=_0x141eb2,_0x38fb73[_0x2a525a(0x1de)](_0x411002),collectChangedPaths(_0x411002,_0x39b2ad,_0x141eb2,_0x38fb73));}return{'after':_0x5396d1,'changedPaths':Array[_0x2a525a(0x195)](_0x38fb73)[_0x2a525a(0x1cb)](),'changed':_0x38fb73[_0x2a525a(0x1a6)]>0x0};}export function assertExpectation(_0x517694,_0x19b5b5){const _0x382ebb=a62_0x2b7532;if(!_0x19b5b5)return;for(const [_0xe9a3f5,_0x5bd8a9]of Object[_0x382ebb(0x1c7)](_0x19b5b5)){const _0x236ad6=_0x517694[_0xe9a3f5];if(!deepEqual(_0x236ad6,_0x5bd8a9))throw CliErrors[_0x382ebb(0x19b)](_0x382ebb(0x1c0)+_0xe9a3f5,_0x382ebb(0x1ca)+JSON[_0x382ebb(0x1a1)](_0x5bd8a9)+',\x20actual\x20'+JSON[_0x382ebb(0x1a1)](_0x236ad6));}}export async function buildDatasetFieldUpdateResult({appCode:_0x3be336,input:_0x1e49f6,dryRun:_0x45bc61}){const _0x584bae=a62_0x2b7532;validateInput(_0x1e49f6);const _0x6ef1b9=await getDatasetDetail(_0x1e49f6[_0x584bae(0x198)]),_0xb5bac=readFieldArray(_0x6ef1b9),_0x57bc57=_0xb5bac[_0x584bae(0x1d3)](_0x21795b=>_0x21795b?.['name']===_0x1e49f6[_0x584bae(0x1c3)]);if(_0x57bc57<0x0)throw CliErrors[_0x584bae(0x19b)](_0x584bae(0x1cf)+_0x1e49f6[_0x584bae(0x1c3)]);const _0x6d60c9=deepClone(_0xb5bac[_0x57bc57]);assertExpectation(_0x6d60c9,_0x1e49f6[_0x584bae(0x1c5)]);const {after:_0x211953,changedPaths:_0x5cd69c,changed:_0x15870c}=applyFieldPatch(_0x6d60c9,_0x1e49f6[_0x584bae(0x1d1)]),_0x2ce740=summarizeDataset(_0x6ef1b9,_0x1e49f6[_0x584bae(0x198)]);return _0x15870c&&!_0x45bc61&&(_0xb5bac[_0x57bc57]=_0x211953,await updateDrivenData(_0x6ef1b9)),{'ok':!![],'data':{'appCode':_0x3be336,'selector':{'code':_0x1e49f6['code']},'dataset':_0x2ce740,'field':{'id':_0x6d60c9['id']??null,'name':_0x6d60c9[_0x584bae(0x19f)]},'dryRun':_0x45bc61,'changed':_0x15870c,'changedPaths':_0x5cd69c,'before':_0x6d60c9,'after':_0x211953,'submitted':_0x15870c&&!_0x45bc61},'message':_0x15870c?_0x45bc61?_0x584bae(0x1b5)+_0x1e49f6[_0x584bae(0x1c3)]+_0x584bae(0x1ae)+_0x5cd69c[_0x584bae(0x1b1)](',\x20')+')':_0x584bae(0x1ad)+_0x1e49f6[_0x584bae(0x1c3)]+'\x20('+_0x5cd69c[_0x584bae(0x1b1)](',\x20')+')':_0x584bae(0x1af)+_0x1e49f6[_0x584bae(0x1c3)]};}export const datasetFieldUpdate={'service':a62_0x2b7532(0x1e0),'command':a62_0x2b7532(0x1e1),'description':a62_0x2b7532(0x1bf),'risk':a62_0x2b7532(0x197),'flags':[CODE_FLAG,{'name':a62_0x2b7532(0x1c3),'type':a62_0x2b7532(0x1aa),'required':!![],'description':a62_0x2b7532(0x1e6)},{'name':a62_0x2b7532(0x1a3),'type':'string','required':!![],'description':a62_0x2b7532(0x1e5)},{'name':a62_0x2b7532(0x1d7),'type':'string','required':![],'description':a62_0x2b7532(0x19e)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x5df5cb){validateInput(readFieldUpdateInput(_0x5df5cb));},async 'dryRun'(_0x1be69b){const _0x3e5610=a62_0x2b7532,_0x3e240c=await buildDatasetFieldUpdateResult({'appCode':_0x1be69b[_0x3e5610(0x1a2)],'input':readFieldUpdateInput(_0x1be69b),'dryRun':!![]});return{'method':_0x3e5610(0x1dc),'url':'/smartapi/dataset/update-driven-data','body':_0x3e240c['data'],'description':_0x3e240c['message']};},async 'execute'(_0x37a734){const _0x28f9e7=a62_0x2b7532;return buildDatasetFieldUpdateResult({'appCode':_0x37a734[_0x28f9e7(0x1a2)],'input':readFieldUpdateInput(_0x37a734),'dryRun':![]});}};function readFieldUpdateInput(_0x5a6a4a){const _0x473805=a62_0x2b7532,_0x52fa71=trim(_0x5a6a4a[_0x473805(0x1a0)](_0x473805(0x198))),_0xba2349=emptyToUndefined(_0x5a6a4a['str'](_0x473805(0x1c3))),_0x2678ac=parseJsonObjectFlag(_0x5a6a4a[_0x473805(0x1a0)](_0x473805(0x1a3)),_0x473805(0x1d8)),_0x53f137=parseJsonObjectFlag(_0x5a6a4a[_0x473805(0x1a0)](_0x473805(0x1d7)),_0x473805(0x1da));return{'code':_0x52fa71,'field':_0xba2349||'','patch':_0x2678ac||{},'expect':_0x53f137};}function validateInput(_0x1f2b47){const _0x3916c8=a62_0x2b7532;if(!_0x1f2b47[_0x3916c8(0x198)])throw CliErrors[_0x3916c8(0x19b)](_0x3916c8(0x1bc));if(!_0x1f2b47[_0x3916c8(0x1c3)])throw CliErrors[_0x3916c8(0x19b)](_0x3916c8(0x1c8));validatePatchKeys(_0x1f2b47[_0x3916c8(0x1d1)]);}function a62_0x4da7(){const _0x3c81e7=['isArray','Patch\x20one\x20raw\x20dataset\x20fields[]\x20field\x20object\x20safely','Expectation\x20mismatch\x20at\x20','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','127JRSuwf','field','object','expect','1157220VEiVSo','entries','--field\x20is\x20required','displayName','Expected\x20','sort','datasetId','109975WotuVp','117255KyBAgy','Field\x20not\x20found:\x20','36hhxteg','patch','dbTypeScale','findIndex','message','datetimeFormat','description','expect-json','--patch-json','1756827davIxx','--expect-json','options','POST','pkField','add','dbName','dataset','field-update','autoIncrement','deleted','8csdBJp','JSON\x20object\x20patch;\x20allowed\x20keys:\x20doType/displayName/description/options/required/datetimeFormat/defaultAggregation/chartRole/deprecated','Exact\x20raw\x20fields[].name\x20to\x20patch','1086840HstLWQ','\x20must\x20be\x20a\x20JSON\x20object','\x20must\x20be\x20valid\x20JSON\x20object:\x20','doType','parse','has','from','dbTypeLen','write','code','deprecated','2588CVlPUE','validation','Allowed\x20keys:\x20','properties','JSON\x20object\x20of\x20expected\x20current\x20field\x20values;\x20mismatch\x20aborts\x20without\x20writing','name','str','stringify','appCode','patch-json','keys','dbType','size','fields','chartRole','Unsupported\x20patch\x20key:\x20','string','required','Forbidden\x20patch\x20key:\x20','Updated\x20dataset\x20field\x20','\x20would\x20change\x20(','No\x20changes\x20for\x20dataset\x20field\x20','modelId','join','defaultAggregation','dbId','110yuIPty','Dry-run:\x20dataset\x20field\x20','datasetCode','modelCode','tableName','7tGFfoA','225489yfWTyL','dbtableConfig','--code\x20is\x20required','Driven\x20data\x20does\x20not\x20contain\x20fields[]\x20or\x20properties[]'];a62_0x4da7=function(){return _0x3c81e7;};return a62_0x4da7();}function readFieldArray(_0x1ed24a){const _0x5c45ec=a62_0x2b7532;if(Array[_0x5c45ec(0x1be)](_0x1ed24a[_0x5c45ec(0x1a7)]))return _0x1ed24a[_0x5c45ec(0x1a7)];if(Array[_0x5c45ec(0x1be)](_0x1ed24a[_0x5c45ec(0x19d)]))return _0x1ed24a[_0x5c45ec(0x19d)];throw CliErrors['validation'](_0x5c45ec(0x1bd));}function summarizeDataset(_0x3c627e,_0x59ae1f){const _0x141c50=a62_0x2b7532,_0x24e82d=isPlainObject(_0x3c627e[_0x141c50(0x1e0)])?_0x3c627e[_0x141c50(0x1e0)]:{},_0x1a72ef=isPlainObject(_0x3c627e[_0x141c50(0x1bb)])?_0x3c627e[_0x141c50(0x1bb)]:{};return{'id':_0x3c627e[_0x141c50(0x1b0)]??_0x3c627e['id']??_0x24e82d[_0x141c50(0x1cc)]??null,'code':_0x3c627e[_0x141c50(0x1b7)]??_0x3c627e[_0x141c50(0x198)]??_0x24e82d[_0x141c50(0x1b6)]??_0x59ae1f,'name':_0x3c627e[_0x141c50(0x19f)]??_0x24e82d['datasetName']??null,'table':_0x1a72ef[_0x141c50(0x1b8)]??_0x24e82d[_0x141c50(0x1b8)]??null,'db':_0x1a72ef[_0x141c50(0x1df)]??_0x1a72ef[_0x141c50(0x1b3)]??null};}function mergePatchValue(_0xa1028d,_0x2c5b4e){if(isPlainObject(_0xa1028d)&&isPlainObject(_0x2c5b4e))return deepMerge(_0xa1028d,_0x2c5b4e);return deepClone(_0x2c5b4e);}function deepMerge(_0x6fc74d,_0x1aa4aa){const _0x1391eb=deepClone(_0x6fc74d);for(const [_0x4704fb,_0x122569]of Object['entries'](_0x1aa4aa)){_0x1391eb[_0x4704fb]=isPlainObject(_0x1391eb[_0x4704fb])&&isPlainObject(_0x122569)?deepMerge(_0x1391eb[_0x4704fb],_0x122569):deepClone(_0x122569);}return _0x1391eb;}function collectChangedPaths(_0x264896,_0x587418,_0x8417ed,_0x1ffa1f){const _0x3d1274=a62_0x2b7532;if(!isPlainObject(_0x587418)||!isPlainObject(_0x8417ed))return;const _0x3a4fe2=new Set([...Object[_0x3d1274(0x1a4)](_0x587418),...Object[_0x3d1274(0x1a4)](_0x8417ed)]);for(const _0xa47f79 of _0x3a4fe2){const _0x12c5d8=_0x587418[_0xa47f79],_0x123a8=_0x8417ed[_0xa47f79];!deepEqual(_0x12c5d8,_0x123a8)&&_0x1ffa1f['add'](_0x264896+'.'+_0xa47f79);}}function deepClone(_0x52ba33){const _0x260e84=a62_0x2b7532;if(_0x52ba33===undefined)return _0x52ba33;return JSON['parse'](JSON[_0x260e84(0x1a1)](_0x52ba33));}function deepEqual(_0x51bb3b,_0x5a575e){const _0x21e519=a62_0x2b7532;return JSON[_0x21e519(0x1a1)](_0x51bb3b)===JSON[_0x21e519(0x1a1)](_0x5a575e);}function isPlainObject(_0x34a56b){const _0x3b6977=a62_0x2b7532;return Boolean(_0x34a56b)&&typeof _0x34a56b===_0x3b6977(0x1c4)&&!Array[_0x3b6977(0x1be)](_0x34a56b);}function emptyToUndefined(_0x2d8848){const _0x5b367c=String(_0x2d8848||'')['trim']();return _0x5b367c||undefined;}function trim(_0x4bd287){return String(_0x4bd287||'')['trim']();}
|
|
1
|
+
const a62_0x26e6e0=a62_0x2690;(function(_0xb20830,_0xbb6bfa){const _0x3f762e=a62_0x2690,_0x6e2db1=_0xb20830();while(!![]){try{const _0xcc9b6f=-parseInt(_0x3f762e(0xd2))/0x1+-parseInt(_0x3f762e(0x90))/0x2+parseInt(_0x3f762e(0xaa))/0x3*(-parseInt(_0x3f762e(0xa9))/0x4)+-parseInt(_0x3f762e(0xbd))/0x5+parseInt(_0x3f762e(0xa8))/0x6*(parseInt(_0x3f762e(0xb6))/0x7)+parseInt(_0x3f762e(0x91))/0x8+parseInt(_0x3f762e(0xca))/0x9;if(_0xcc9b6f===_0xbb6bfa)break;else _0x6e2db1['push'](_0x6e2db1['shift']());}catch(_0x1fb8ff){_0x6e2db1['push'](_0x6e2db1['shift']());}}}(a62_0x472a,0x76d5d));import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';function a62_0x2690(_0x54f733,_0x25bcee){_0x54f733=_0x54f733-0x8b;const _0x472a58=a62_0x472a();let _0x269072=_0x472a58[_0x54f733];return _0x269072;}const MUTABLE_FIELD_KEYS=new Set([a62_0x26e6e0(0xb4),'displayName',a62_0x26e6e0(0xa2),'options',a62_0x26e6e0(0xd6),'datetimeFormat',a62_0x26e6e0(0xa4),a62_0x26e6e0(0xab),'deprecated']),FORBIDDEN_FIELD_KEYS=new Set(['id',a62_0x26e6e0(0xba),'code',a62_0x26e6e0(0xce),'dbTypeLen',a62_0x26e6e0(0xd4),a62_0x26e6e0(0x9d),'tableName',a62_0x26e6e0(0xa3),a62_0x26e6e0(0x92),a62_0x26e6e0(0xc3),a62_0x26e6e0(0xc4)]);export function parseJsonObjectFlag(_0xc29f25,_0x5c8b83){const _0x7f0f41=a62_0x26e6e0;if(!_0xc29f25)return undefined;let _0x441a80;try{_0x441a80=JSON[_0x7f0f41(0xc6)](_0xc29f25);}catch(_0x231721){const _0x2dc3e3=_0x231721 instanceof Error?_0x231721[_0x7f0f41(0x99)]:String(_0x231721);throw CliErrors[_0x7f0f41(0xa5)](_0x5c8b83+_0x7f0f41(0x96)+_0x2dc3e3);}if(!isPlainObject(_0x441a80)||Array[_0x7f0f41(0xb1)](_0x441a80))throw CliErrors['validation'](_0x5c8b83+_0x7f0f41(0xd0));return _0x441a80;}export function validatePatchKeys(_0x8c79ff){const _0x23906b=a62_0x26e6e0,_0x38a52f=Object['keys'](_0x8c79ff);if(_0x38a52f[_0x23906b(0xc1)]===0x0)throw CliErrors['validation'](_0x23906b(0xb3));for(const _0x3e0c5e of _0x38a52f){if(FORBIDDEN_FIELD_KEYS[_0x23906b(0xad)](_0x3e0c5e))throw CliErrors['validation']('Forbidden\x20patch\x20key:\x20'+_0x3e0c5e);if(!MUTABLE_FIELD_KEYS[_0x23906b(0xad)](_0x3e0c5e))throw CliErrors[_0x23906b(0xa5)](_0x23906b(0x9f)+_0x3e0c5e,'Allowed\x20keys:\x20'+Array[_0x23906b(0xbf)](MUTABLE_FIELD_KEYS)[_0x23906b(0xd1)](',\x20'));}}export function applyFieldPatch(_0x1990c3,_0x50270a){const _0x1e45a2=a62_0x26e6e0;validatePatchKeys(_0x50270a);const _0xee6948=deepClone(_0x1990c3),_0x492d75=new Set();for(const [_0x56fa84,_0xe93418]of Object[_0x1e45a2(0x8f)](_0x50270a)){const _0xba6d30=_0xee6948[_0x56fa84],_0x158dbf=mergePatchValue(_0xba6d30,_0xe93418);!deepEqual(_0xba6d30,_0x158dbf)&&(_0xee6948[_0x56fa84]=_0x158dbf,_0x492d75['add'](_0x56fa84),collectChangedPaths(_0x56fa84,_0xba6d30,_0x158dbf,_0x492d75));}return{'after':_0xee6948,'changedPaths':Array[_0x1e45a2(0xbf)](_0x492d75)[_0x1e45a2(0xae)](),'changed':_0x492d75[_0x1e45a2(0xc9)]>0x0};}export function assertExpectation(_0x53742a,_0x4dfa8c){const _0x50c048=a62_0x26e6e0;if(!_0x4dfa8c)return;for(const [_0x52fb04,_0xf14715]of Object[_0x50c048(0x8f)](_0x4dfa8c)){const _0x4b06ba=_0x53742a[_0x52fb04];if(!deepEqual(_0x4b06ba,_0xf14715))throw CliErrors['validation'](_0x50c048(0xa0)+_0x52fb04,_0x50c048(0xaf)+JSON[_0x50c048(0xbe)](_0xf14715)+_0x50c048(0x8c)+JSON[_0x50c048(0xbe)](_0x4b06ba));}}export async function buildDatasetFieldUpdateResult({appCode:_0x549305,input:_0x1519ce,dryRun:_0x313a82}){const _0x500171=a62_0x26e6e0;validateInput(_0x1519ce);const _0x43a408=await getDatasetDetail(_0x1519ce['code']),_0x310268=readFieldArray(_0x43a408),_0x4193ca=_0x310268['findIndex'](_0x5900ef=>_0x5900ef?.[_0x500171(0xba)]===_0x1519ce[_0x500171(0xbc)]);if(_0x4193ca<0x0)throw CliErrors[_0x500171(0xa5)](_0x500171(0xa1)+_0x1519ce[_0x500171(0xbc)]);const _0x2e500f=deepClone(_0x310268[_0x4193ca]);assertExpectation(_0x2e500f,_0x1519ce[_0x500171(0x9a)]);const {after:_0x587f2f,changedPaths:_0x23d795,changed:_0x390bff}=applyFieldPatch(_0x2e500f,_0x1519ce[_0x500171(0xd8)]),_0x5a7288=summarizeDataset(_0x43a408,_0x1519ce['code']);return _0x390bff&&!_0x313a82&&(_0x310268[_0x4193ca]=_0x587f2f,await updateDrivenData(_0x43a408)),{'ok':!![],'data':{'appCode':_0x549305,'selector':{'code':_0x1519ce['code']},'dataset':_0x5a7288,'field':{'id':_0x2e500f['id']??null,'name':_0x2e500f[_0x500171(0xba)]},'dryRun':_0x313a82,'changed':_0x390bff,'changedPaths':_0x23d795,'before':_0x2e500f,'after':_0x587f2f,'submitted':_0x390bff&&!_0x313a82},'message':_0x390bff?_0x313a82?_0x500171(0x9e)+_0x1519ce[_0x500171(0xbc)]+'\x20would\x20change\x20('+_0x23d795[_0x500171(0xd1)](',\x20')+')':'Updated\x20dataset\x20field\x20'+_0x1519ce['field']+'\x20('+_0x23d795[_0x500171(0xd1)](',\x20')+')':_0x500171(0x8b)+_0x1519ce[_0x500171(0xbc)]};}function a62_0x472a(){const _0x1b64e2=['str','Driven\x20data\x20does\x20not\x20contain\x20fields[]\x20or\x20properties[]','field-update','dbType','modelCode','\x20must\x20be\x20a\x20JSON\x20object','join','634643dlDNDS','modelId','dbTypeScale','trim','required','data','patch','No\x20changes\x20for\x20dataset\x20field\x20',',\x20actual\x20','datasetCode','datasetId','entries','1792852HOVhgG','804288vlWPle','pkField','--expect-json','object','string','\x20must\x20be\x20valid\x20JSON\x20object:\x20','POST','add','message','expect','JSON\x20object\x20of\x20expected\x20current\x20field\x20values;\x20mismatch\x20aborts\x20without\x20writing','code','dbFieldName','Dry-run:\x20dataset\x20field\x20','Unsupported\x20patch\x20key:\x20','Expectation\x20mismatch\x20at\x20','Field\x20not\x20found:\x20','description','deleted','defaultAggregation','validation','tableName','properties','6azdXCA','52SaQqBq','18579ESxdXG','chartRole','dbtableConfig','has','sort','Expected\x20','write','isArray','Exact\x20raw\x20fields[].name\x20to\x20patch','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','doType','appCode','4614162PIwyZc','/smartapi/dataset/update-driven-data','expect-json','dataset','name','--patch-json','field','512410psCiph','stringify','from','dbId','length','keys','autoIncrement','systemRetain','fields','parse','dbName','--code\x20is\x20required','size','12969963CTecLv'];a62_0x472a=function(){return _0x1b64e2;};return a62_0x472a();}export const datasetFieldUpdate={'service':'dataset','command':a62_0x26e6e0(0xcd),'description':'Patch\x20one\x20raw\x20dataset\x20fields[]\x20field\x20object\x20safely','risk':a62_0x26e6e0(0xb0),'flags':[CODE_FLAG,{'name':a62_0x26e6e0(0xbc),'type':a62_0x26e6e0(0x95),'required':!![],'description':a62_0x26e6e0(0xb2)},{'name':'patch-json','type':'string','required':!![],'description':'JSON\x20object\x20patch;\x20allowed\x20keys:\x20doType/displayName/description/options/required/datetimeFormat/defaultAggregation/chartRole/deprecated'},{'name':a62_0x26e6e0(0xb8),'type':a62_0x26e6e0(0x95),'required':![],'description':a62_0x26e6e0(0x9b)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0xc147fe){validateInput(readFieldUpdateInput(_0xc147fe));},async 'dryRun'(_0x99d082){const _0x417688=a62_0x26e6e0,_0x49ac15=await buildDatasetFieldUpdateResult({'appCode':_0x99d082[_0x417688(0xb5)],'input':readFieldUpdateInput(_0x99d082),'dryRun':!![]});return{'method':_0x417688(0x97),'url':_0x417688(0xb7),'body':_0x49ac15[_0x417688(0xd7)],'description':_0x49ac15['message']};},async 'execute'(_0x521b17){const _0x3743f7=a62_0x26e6e0;return buildDatasetFieldUpdateResult({'appCode':_0x521b17[_0x3743f7(0xb5)],'input':readFieldUpdateInput(_0x521b17),'dryRun':![]});}};function readFieldUpdateInput(_0x4ca7e3){const _0x3399c6=a62_0x26e6e0,_0x5e599e=trim(_0x4ca7e3['str'](_0x3399c6(0x9c))),_0x172365=emptyToUndefined(_0x4ca7e3[_0x3399c6(0xcb)]('field')),_0x2a6898=parseJsonObjectFlag(_0x4ca7e3[_0x3399c6(0xcb)]('patch-json'),_0x3399c6(0xbb)),_0x5d75ef=parseJsonObjectFlag(_0x4ca7e3[_0x3399c6(0xcb)](_0x3399c6(0xb8)),_0x3399c6(0x93));return{'code':_0x5e599e,'field':_0x172365||'','patch':_0x2a6898||{},'expect':_0x5d75ef};}function validateInput(_0x566696){const _0x1f9fab=a62_0x26e6e0;if(!_0x566696['code'])throw CliErrors[_0x1f9fab(0xa5)](_0x1f9fab(0xc8));if(!_0x566696[_0x1f9fab(0xbc)])throw CliErrors[_0x1f9fab(0xa5)]('--field\x20is\x20required');validatePatchKeys(_0x566696['patch']);}function readFieldArray(_0x433d04){const _0x1b1283=a62_0x26e6e0;if(Array[_0x1b1283(0xb1)](_0x433d04['fields']))return _0x433d04[_0x1b1283(0xc5)];if(Array[_0x1b1283(0xb1)](_0x433d04[_0x1b1283(0xa7)]))return _0x433d04[_0x1b1283(0xa7)];throw CliErrors[_0x1b1283(0xa5)](_0x1b1283(0xcc));}function summarizeDataset(_0x30fa00,_0x39f3cd){const _0x2852c3=a62_0x26e6e0,_0xa537bd=isPlainObject(_0x30fa00['dataset'])?_0x30fa00[_0x2852c3(0xb9)]:{},_0x3a1079=isPlainObject(_0x30fa00[_0x2852c3(0xac)])?_0x30fa00['dbtableConfig']:{};return{'id':_0x30fa00[_0x2852c3(0xd3)]??_0x30fa00['id']??_0xa537bd[_0x2852c3(0x8e)]??null,'code':_0x30fa00[_0x2852c3(0xcf)]??_0x30fa00[_0x2852c3(0x9c)]??_0xa537bd[_0x2852c3(0x8d)]??_0x39f3cd,'name':_0x30fa00[_0x2852c3(0xba)]??_0xa537bd['datasetName']??null,'table':_0x3a1079[_0x2852c3(0xa6)]??_0xa537bd[_0x2852c3(0xa6)]??null,'db':_0x3a1079[_0x2852c3(0xc7)]??_0x3a1079[_0x2852c3(0xc0)]??null};}function mergePatchValue(_0x1a210c,_0x408cb1){if(isPlainObject(_0x1a210c)&&isPlainObject(_0x408cb1))return deepMerge(_0x1a210c,_0x408cb1);return deepClone(_0x408cb1);}function deepMerge(_0xc06063,_0x5d8522){const _0x153625=a62_0x26e6e0,_0x580983=deepClone(_0xc06063);for(const [_0x560569,_0x8fbbc6]of Object[_0x153625(0x8f)](_0x5d8522)){_0x580983[_0x560569]=isPlainObject(_0x580983[_0x560569])&&isPlainObject(_0x8fbbc6)?deepMerge(_0x580983[_0x560569],_0x8fbbc6):deepClone(_0x8fbbc6);}return _0x580983;}function collectChangedPaths(_0x119f61,_0x216640,_0x237591,_0x42a2c7){const _0x2d8192=a62_0x26e6e0;if(!isPlainObject(_0x216640)||!isPlainObject(_0x237591))return;const _0x46df30=new Set([...Object[_0x2d8192(0xc2)](_0x216640),...Object[_0x2d8192(0xc2)](_0x237591)]);for(const _0x3c9f43 of _0x46df30){const _0x43557c=_0x216640[_0x3c9f43],_0x30b57c=_0x237591[_0x3c9f43];!deepEqual(_0x43557c,_0x30b57c)&&_0x42a2c7[_0x2d8192(0x98)](_0x119f61+'.'+_0x3c9f43);}}function deepClone(_0x143129){const _0x382607=a62_0x26e6e0;if(_0x143129===undefined)return _0x143129;return JSON[_0x382607(0xc6)](JSON[_0x382607(0xbe)](_0x143129));}function deepEqual(_0x5de51a,_0xf25d05){const _0x1b34ae=a62_0x26e6e0;return JSON[_0x1b34ae(0xbe)](_0x5de51a)===JSON[_0x1b34ae(0xbe)](_0xf25d05);}function isPlainObject(_0x103520){const _0x275f9a=a62_0x26e6e0;return Boolean(_0x103520)&&typeof _0x103520===_0x275f9a(0x94)&&!Array['isArray'](_0x103520);}function emptyToUndefined(_0x30401e){const _0x2cefc0=a62_0x26e6e0,_0x3e2b8b=String(_0x30401e||'')[_0x2cefc0(0xd5)]();return _0x3e2b8b||undefined;}function trim(_0x5440a2){const _0x13877b=a62_0x26e6e0;return String(_0x5440a2||'')[_0x13877b(0xd5)]();}
|