@lovrabet/rabetbase-cli 2.3.7-beta.3 → 2.3.7-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/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/notification/config-list.js +1 -0
- package/lib/commands/notification/index.js +1 -0
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a53_0x4092c3=a53_0x340b;(function(_0x31f6f8,_0x17885a){const _0x3b0ab1=a53_0x340b,_0x112aef=_0x31f6f8();while(!![]){try{const _0x1502b9=-parseInt(_0x3b0ab1(0x161))/0x1*(-parseInt(_0x3b0ab1(0x172))/0x2)+parseInt(_0x3b0ab1(0x178))/0x3+-parseInt(_0x3b0ab1(0x15a))/0x4+parseInt(_0x3b0ab1(0x159))/0x5*(-parseInt(_0x3b0ab1(0x181))/0x6)+parseInt(_0x3b0ab1(0x174))/0x7*(-parseInt(_0x3b0ab1(0x158))/0x8)+parseInt(_0x3b0ab1(0x169))/0x9*(-parseInt(_0x3b0ab1(0x165))/0xa)+parseInt(_0x3b0ab1(0x163))/0xb*(parseInt(_0x3b0ab1(0x17d))/0xc);if(_0x1502b9===_0x17885a)break;else _0x112aef['push'](_0x112aef['shift']());}catch(_0x2e6c40){_0x112aef['push'](_0x112aef['shift']());}}}(a53_0x50a6,0x9dbdb));import{CliErrors}from'../../errors.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';import{CLI_BIN_NAME,CONFIG_ENUM_VALUES,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale,resolveWriteScope,readScopedConfig,writeScopedConfig}from'../../commands/config/shared.js';import{normalizeEnv,isProduction,isDaily}from'../../constant/env.js';function a53_0x50a6(){const _0x516a6a=['588FzefLT','\x20workspace\x20use\x20--app\x20<name>`,\x20or\x20pass\x20`--appcode`\x20on\x20the\x20command.','app','appcode','30EToyAE','string','keys','\x20appcode\x20set\x20to:\x20','includes','Cannot\x20set\x20top-level\x20\x22appcode\x22\x20when\x20multi-app\x20config\x20already\x20exists.','Usage:\x20','str','bool','join','key','write','3412296bQIxcG','194945Hyctmm','2532076zbKWqC','Invalid\x20locale\x20value.','\x20set\x20to:\x20','Global','value','Missing\x20key.','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','1371GzCCRC','Set\x20a\x20config\x20value','146905EMIUTO','Missing\x20value.','10oaBjWr','global','Config\x20value','boolean','2137185jGOpIv','Write\x20to\x20global\x20config\x20(~/.rabetbase.json)','Config\x20value\x20is\x20invalid\x20or\x20too\x20long.','Legacy\x20alias\x20\x22online\x22\x20is\x20accepted\x20and\x20stored\x20as\x20production.','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','length','env','Invalid\x20value\x20for\x20\x22','Settable\x20top-level\x20keys:\x20','434eIoykK','locale','7fKVcrf','object','validation','\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>','3558513Vuklcb','apps','\x22.\x20Allowed:\x20','config','\x22\x20is\x20not\x20settable.'];a53_0x50a6=function(){return _0x516a6a;};return a53_0x50a6();}function a53_0x340b(_0x2c4dee,_0x14b11a){_0x2c4dee=_0x2c4dee-0x152;const _0x50a6f3=a53_0x50a6();let _0x340b34=_0x50a6f3[_0x2c4dee];return _0x340b34;}async function execute(_0x1dd163){const _0x234434=a53_0x340b,_0x1565b9=_0x1dd163[_0x234434(0x153)]('key'),_0x1791f2=_0x1dd163['str']('value');if(!_0x1565b9)throw CliErrors[_0x234434(0x176)](_0x234434(0x15f),_0x234434(0x152)+CLI_BIN_NAME+_0x234434(0x177));if(_0x1791f2===undefined||_0x1791f2==='')throw CliErrors['validation'](_0x234434(0x164),_0x234434(0x152)+CLI_BIN_NAME+_0x234434(0x177));if(_0x1791f2[_0x234434(0x16e)]>0x1f4)throw CliErrors[_0x234434(0x176)](_0x234434(0x16b));if(!isTopLevelConfigKey(_0x1565b9))throw CliErrors[_0x234434(0x176)]('Top-level\x20key\x20\x22'+_0x1565b9+_0x234434(0x17c),_0x234434(0x171)+getTopLevelConfigKeySummary());if(_0x1565b9==='riskLevel')throw CliErrors[_0x234434(0x176)](_0x234434(0x16d));if(CONFIG_ENUM_VALUES[_0x1565b9]&&!CONFIG_ENUM_VALUES[_0x1565b9][_0x234434(0x185)](_0x1791f2))throw CliErrors['validation'](_0x234434(0x170)+_0x1565b9+_0x234434(0x17a)+CONFIG_ENUM_VALUES[_0x1565b9][_0x234434(0x155)](',\x20'));if(_0x1565b9===_0x234434(0x173)&&!normalizeLocale(_0x1791f2))throw CliErrors['validation'](_0x234434(0x15b),_0x234434(0x160));const _0x25f5fb={'global':_0x1dd163[_0x234434(0x154)](_0x234434(0x166))},_0xa1bcb9=resolveWriteScope(_0x25f5fb),_0xaca9c6=readScopedConfig(_0xa1bcb9);let _0x317599=_0x1565b9,_0x166bb2=_0x1791f2;_0x1565b9===_0x234434(0x17f)&&(_0x317599=_0x234434(0x180),delete _0xaca9c6[_0x234434(0x17f)]);_0x1565b9==='locale'&&(_0x166bb2=normalizeLocale(_0x1791f2));if(_0x1565b9===_0x234434(0x16f)){_0x166bb2=normalizeEnv(_0x1791f2);if(!isProduction(_0x166bb2)&&!isDaily(_0x166bb2))throw CliErrors[_0x234434(0x176)]('Invalid\x20value\x20for\x20env.\x20Allowed:\x20production,\x20daily.',_0x234434(0x16c));}if(_0x1565b9==='appcode'){const _0x27490d=_0xaca9c6[_0x234434(0x179)]&&typeof _0xaca9c6['apps']===_0x234434(0x175)?Object[_0x234434(0x183)](_0xaca9c6[_0x234434(0x179)]):[];if(_0x27490d[_0x234434(0x16e)]>0x0)throw CliErrors[_0x234434(0x176)](_0x234434(0x186),'Use\x20`'+CLI_BIN_NAME+'\x20app\x20add\x20<name>\x20--appcode\x20'+_0x166bb2+'`,\x20`'+CLI_BIN_NAME+_0x234434(0x17e));const _0xca5b71=buildCanonicalProjectConfig({..._0xaca9c6},{'appCodes':[_0x166bb2],'env':typeof _0xaca9c6[_0x234434(0x16f)]===_0x234434(0x182)?_0xaca9c6[_0x234434(0x16f)]:undefined});writeScopedConfig(_0xca5b71,_0xa1bcb9);const _0x133202=_0xa1bcb9===_0x234434(0x166)?_0x234434(0x15d):'Project';return{'ok':!![],'message':'✓\x20'+_0x133202+_0x234434(0x184)+_0x166bb2+'\x20(stored\x20as\x20apps\x20+\x20defaultApp)'};}_0xaca9c6[_0x317599]=_0x166bb2,writeScopedConfig(_0xaca9c6,_0xa1bcb9);const _0x3c2263=_0xa1bcb9===_0x234434(0x166)?_0x234434(0x15d):'Project';return{'ok':!![],'message':'✓\x20'+_0x3c2263+'\x20'+_0x317599+_0x234434(0x15c)+_0x166bb2};}export const configSetDefinition={'service':a53_0x4092c3(0x17b),'command':'set','description':a53_0x4092c3(0x162),'risk':a53_0x4092c3(0x157),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a53_0x4092c3(0x156),'type':a53_0x4092c3(0x182),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':a53_0x4092c3(0x15e),'type':a53_0x4092c3(0x182),'description':a53_0x4092c3(0x167),'required':!![]},{'name':a53_0x4092c3(0x166),'type':a53_0x4092c3(0x168),'description':a53_0x4092c3(0x16a),'default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x141a93,_0x46b1c1){var _0x4bdfae=a54_0x5e3e,_0x8d6410=_0x141a93();while(!![]){try{var _0x55d650=-parseInt(_0x4bdfae(0x102))/0x1+parseInt(_0x4bdfae(0x107))/0x2+-parseInt(_0x4bdfae(0x109))/0x3+parseInt(_0x4bdfae(0x105))/0x4*(parseInt(_0x4bdfae(0x101))/0x5)+parseInt(_0x4bdfae(0x10e))/0x6+parseInt(_0x4bdfae(0x103))/0x7+-parseInt(_0x4bdfae(0x104))/0x8;if(_0x55d650===_0x46b1c1)break;else _0x8d6410['push'](_0x8d6410['shift']());}catch(_0x25ccfc){_0x8d6410['push'](_0x8d6410['shift']());}}}(a54_0x2abc,0xbec03));import{CLI_BIN_NAME}from'../../constant/cli.js';import{isInProject,resolveWriteConfigPath,readConfigFile,writeConfigFile}from'../../context.js';import{CliErrors}from'../../errors.js';import{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale}from'../../config/schema.js';export{CLI_BIN_NAME};export{normalizeLocale};export{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey};export function resolveWriteScope(_0x34f6ec){var _0x2ac65d=a54_0x5e3e;if(_0x34f6ec['global'])return _0x2ac65d(0x10d);if(!isInProject())throw CliErrors[_0x2ac65d(0x106)](_0x2ac65d(0x10a),_0x2ac65d(0x10b)+CLI_BIN_NAME+_0x2ac65d(0x10c));return _0x2ac65d(0x108);}function a54_0x2abc(){var _0x3e0322=['932004FqQGxq','validation','2831562KVHXCa','project','3051216MOzpxx','Not\x20inside\x20a\x20project\x20(no\x20.rabetbase.json\x20found).','Add\x20--global\x20to\x20write\x20to\x20~/.rabetbase.json,\x20or\x20run\x20`','\x20init`\x20first.','global','3442368WYhLyn','15sjChzV','1398443CoDrSv','10097143vYDNrT','7473048DCPCuf'];a54_0x2abc=function(){return _0x3e0322;};return a54_0x2abc();}function a54_0x5e3e(_0x54fed1,_0x3b76af){_0x54fed1=_0x54fed1-0x101;var _0x2abc41=a54_0x2abc();var _0x5e3e5b=_0x2abc41[_0x54fed1];return _0x5e3e5b;}export function readScopedConfig(_0x33d8dd){return readConfigFile(resolveWriteConfigPath(_0x33d8dd));}export function writeScopedConfig(_0x2837d7,_0x5d0678){writeConfigFile(resolveWriteConfigPath(_0x5d0678),_0x2837d7);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a55_0x1180c8=a55_0x17d1;(function(_0xec2db4,_0x1f03c9){const _0x188c00=a55_0x17d1,_0x5722f6=_0xec2db4();while(!![]){try{const _0x9eeaa6=parseInt(_0x188c00(0x1a7))/0x1*(parseInt(_0x188c00(0x19b))/0x2)+-parseInt(_0x188c00(0x196))/0x3+-parseInt(_0x188c00(0x19c))/0x4*(-parseInt(_0x188c00(0x195))/0x5)+parseInt(_0x188c00(0x199))/0x6*(parseInt(_0x188c00(0x1a0))/0x7)+-parseInt(_0x188c00(0x1a6))/0x8*(parseInt(_0x188c00(0x1a2))/0x9)+-parseInt(_0x188c00(0x197))/0xa*(-parseInt(_0x188c00(0x1a5))/0xb)+parseInt(_0x188c00(0x1a4))/0xc*(-parseInt(_0x188c00(0x193))/0xd);if(_0x9eeaa6===_0x1f03c9)break;else _0x5722f6['push'](_0x5722f6['shift']());}catch(_0x379dcd){_0x5722f6['push'](_0x5722f6['shift']());}}}(a55_0x3d6b,0x920cf));import{buildDataCommand}from'../../commands/data/shared.js';function a55_0x3d6b(){const _0x6026f8=['\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','31822StNRxk','\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]','29421GulOIb','\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}]','653244aVEcCQ','1381831PPpOdy','488bCTSAu','1KfgEuy','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions','338uBQwLU','filter','2936110FtPaGv','674814JIZYBK','60OSzneM','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page','1200VyVXWw','join','375568cSINcp','4MUxoan','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','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'];a55_0x3d6b=function(){return _0x6026f8;};return a55_0x3d6b();}function a55_0x17d1(_0x326d90,_0x3afdc4){_0x326d90=_0x326d90-0x193;const _0x3d6b6a=a55_0x3d6b();let _0x17d12d=_0x3d6b6a[_0x326d90];return _0x17d12d;}export const dataFilter=buildDataCommand({'command':a55_0x1180c8(0x194),'operation':a55_0x1180c8(0x194),'description':'Filter\x20dataset\x20records\x20with\x20query\x20conditions','paramsRequired':![],'paramsHint':a55_0x1180c8(0x19e),'helpExtra':[a55_0x1180c8(0x19f),a55_0x1180c8(0x1a8),a55_0x1180c8(0x1a1),a55_0x1180c8(0x1a3),a55_0x1180c8(0x19d),a55_0x1180c8(0x198)][a55_0x1180c8(0x19a)]('\x0a')});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a56_0x5725f6=a56_0x324c;(function(_0x4c8545,_0x205e3b){const _0x16941a=a56_0x324c,_0x521d1c=_0x4c8545();while(!![]){try{const _0x470ab6=parseInt(_0x16941a(0x6e))/0x1*(parseInt(_0x16941a(0x66))/0x2)+-parseInt(_0x16941a(0x70))/0x3*(parseInt(_0x16941a(0x6f))/0x4)+parseInt(_0x16941a(0x71))/0x5*(-parseInt(_0x16941a(0x72))/0x6)+-parseInt(_0x16941a(0x6c))/0x7+-parseInt(_0x16941a(0x6a))/0x8+-parseInt(_0x16941a(0x68))/0x9*(-parseInt(_0x16941a(0x69))/0xa)+parseInt(_0x16941a(0x6b))/0xb;if(_0x470ab6===_0x205e3b)break;else _0x521d1c['push'](_0x521d1c['shift']());}catch(_0x3678cb){_0x521d1c['push'](_0x521d1c['shift']());}}}(a56_0x4bb9,0x640d5));function a56_0x324c(_0x300114,_0x499c5a){_0x300114=_0x300114-0x66;const _0x4bb9b8=a56_0x4bb9();let _0x324c67=_0x4bb9b8[_0x300114];return _0x324c67;}function a56_0x4bb9(){const _0x5b67b0=['39841qNBRfP','4TlsXOk','1976838CJpiKT','3920905HMpdxY','6WLCcLd','4OigKMp','Get\x20a\x20single\x20record\x20by\x20ID','60714uKhEAx','1060EvfziS','4395152rvnymk','26446783IDNTUL','5576739YCkAey','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27'];a56_0x4bb9=function(){return _0x5b67b0;};return a56_0x4bb9();}import{buildDataCommand}from'../../commands/data/shared.js';export const dataGetOne=buildDataCommand({'command':'getOne','operation':'getOne','description':a56_0x5725f6(0x67),'paramsRequired':!![],'paramsHint':a56_0x5725f6(0x6d)});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xef1027,_0x10b17c){const _0x151e0a=a57_0x52e3,_0x42b9b3=_0xef1027();while(!![]){try{const _0x44c764=parseInt(_0x151e0a(0x163))/0x1*(parseInt(_0x151e0a(0x161))/0x2)+parseInt(_0x151e0a(0x15f))/0x3+-parseInt(_0x151e0a(0x160))/0x4*(parseInt(_0x151e0a(0x15b))/0x5)+parseInt(_0x151e0a(0x15d))/0x6*(parseInt(_0x151e0a(0x15a))/0x7)+-parseInt(_0x151e0a(0x15e))/0x8*(-parseInt(_0x151e0a(0x164))/0x9)+parseInt(_0x151e0a(0x159))/0xa*(-parseInt(_0x151e0a(0x162))/0xb)+-parseInt(_0x151e0a(0x15c))/0xc;if(_0x44c764===_0x10b17c)break;else _0x42b9b3['push'](_0x42b9b3['shift']());}catch(_0x49371a){_0x42b9b3['push'](_0x42b9b3['shift']());}}}(a57_0x20d7,0xce51c));import{dataFilter}from'../../commands/data/filter.js';function a57_0x20d7(){const _0x1d771d=['329322YwCeXT','5773592mAhkkY','5iFIdrl','27MUhwZS','10QEpWmd','14JgwXkg','1470rrgeOA','15219228kdeyov','1188834qRdJtw','2364608RLUuZa','3103080LOPryt','6836tSiXKA'];a57_0x20d7=function(){return _0x1d771d;};return a57_0x20d7();}function a57_0x52e3(_0x27f45b,_0x53ae90){_0x27f45b=_0x27f45b-0x159;const _0x20d715=a57_0x20d7();let _0x52e3da=_0x20d715[_0x27f45b];return _0x52e3da;}import{dataGetOne}from'../../commands/data/getOne.js';export const dataDefinitions=[dataFilter,dataGetOne];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2a37ab,_0x107b63){const _0x26639d=a58_0x2f1e,_0x1586e4=_0x2a37ab();while(!![]){try{const _0x2ee974=parseInt(_0x26639d(0x1aa))/0x1+parseInt(_0x26639d(0x1b7))/0x2+-parseInt(_0x26639d(0x1bb))/0x3+parseInt(_0x26639d(0x1c2))/0x4*(-parseInt(_0x26639d(0x1b1))/0x5)+-parseInt(_0x26639d(0x1a5))/0x6+parseInt(_0x26639d(0x1a4))/0x7*(parseInt(_0x26639d(0x1bf))/0x8)+parseInt(_0x26639d(0x1b4))/0x9*(parseInt(_0x26639d(0x1c0))/0xa);if(_0x2ee974===_0x107b63)break;else _0x1586e4['push'](_0x1586e4['shift']());}catch(_0x35eba9){_0x1586e4['push'](_0x1586e4['shift']());}}}(a58_0x496e,0xd5770));import{executeDatasetDataOperation}from'../../core/api-client.js';import{CODE_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';function a58_0x496e(){const _0x4c1ff0=['data\x20getOne\x20requires\x20\x22id\x22\x20in\x20--params','appCode','validation','25qVvXBC','paramsHint','data','37386CNiVEV','getOne','str','1448406zHLVTg','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically','alias','data\x20','2056044AKeraR','string','Provide\x20--params\x20\x27{\x22id\x22:123}\x27\x20for\x20data\x20getOne.','flagMissing','16sUXtzh','4150VaNYJe','paramsRequired','1112444qhfYua','read','code','\x20completed\x20in\x20','Example:\x20--params\x20\x27{\x22id\x22:123}\x27','2778167YzXcEa','3725412NVXEpI','params','description','operation','compress','329282aojiYm','command','now','helpExtra'];a58_0x496e=function(){return _0x4c1ff0;};return a58_0x496e();}import{parseJsonParams}from'../../utils/params.js';function assertGetOneId(_0x2c09f9){const _0x15c740=a58_0x2f1e;if(!_0x2c09f9)throw CliErrors['flagMissing'](_0x15c740(0x1a6),_0x15c740(0x1bd));const _0x1b94f3=_0x2c09f9['id'];if(_0x1b94f3===undefined||_0x1b94f3===null||_0x1b94f3==='')throw CliErrors[_0x15c740(0x1b0)](_0x15c740(0x1ae),_0x15c740(0x1c6));}function a58_0x2f1e(_0x1495c0,_0x4af954){_0x1495c0=_0x1495c0-0x1a4;const _0x496e7f=a58_0x496e();let _0x2f1e88=_0x496e7f[_0x1495c0];return _0x2f1e88;}function parseCommandParams(_0x1078b0){return parseJsonParams(_0x1078b0)??{};}export function buildDataCommand(_0x9a9e27){const _0x1f3366=a58_0x2f1e,_0x58cc4e=_0x1f3366(0x1b8);return{'service':_0x1f3366(0x1b3),'command':_0x9a9e27[_0x1f3366(0x1ab)],'description':_0x9a9e27[_0x1f3366(0x1a7)],'risk':_0x1f3366(0x1c3),'defaultOutputFormat':_0x1f3366(0x1a9),'helpExtra':_0x9a9e27[_0x1f3366(0x1ad)],'flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':_0x1f3366(0x1b9),'type':_0x1f3366(0x1bc),'description':_0x58cc4e},{'name':_0x1f3366(0x1a6),'type':_0x1f3366(0x1bc),'description':_0x9a9e27[_0x1f3366(0x1b2)]}],async 'validate'(_0x7608a7){const _0x5d6240=_0x1f3366,_0x142a82=_0x7608a7[_0x5d6240(0x1b6)](_0x5d6240(0x1a6));if(_0x9a9e27[_0x5d6240(0x1c1)]&&!_0x142a82)throw CliErrors[_0x5d6240(0x1be)]('params',_0x9a9e27[_0x5d6240(0x1b2)]);const _0x2e5838=parseJsonParams(_0x142a82);_0x9a9e27[_0x5d6240(0x1a8)]===_0x5d6240(0x1b5)&&assertGetOneId(_0x2e5838);},async 'execute'(_0x38242f){const _0x3dd09f=_0x1f3366,_0xf8aff7=parseCommandParams(_0x38242f[_0x3dd09f(0x1b6)](_0x3dd09f(0x1a6))),_0x5ca1da=Date[_0x3dd09f(0x1ac)](),_0x60afb9=await executeDatasetDataOperation(_0x38242f[_0x3dd09f(0x1af)],_0x38242f[_0x3dd09f(0x1b6)](_0x3dd09f(0x1c4)),_0x9a9e27[_0x3dd09f(0x1a8)],_0xf8aff7),_0x139213=Date[_0x3dd09f(0x1ac)]()-_0x5ca1da;return{'ok':!![],'data':{'result':_0x60afb9,'elapsed':_0x139213},'message':_0x3dd09f(0x1ba)+_0x9a9e27[_0x3dd09f(0x1ab)]+_0x3dd09f(0x1c5)+_0x139213+'ms'};}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a59_0x1f6f3c=a59_0x57bb;(function(_0x2cdc30,_0x528364){const _0x55c72f=a59_0x57bb,_0x4eca7c=_0x2cdc30();while(!![]){try{const _0x267922=parseInt(_0x55c72f(0x181))/0x1+parseInt(_0x55c72f(0x18a))/0x2+-parseInt(_0x55c72f(0x16a))/0x3+parseInt(_0x55c72f(0x163))/0x4*(-parseInt(_0x55c72f(0x15d))/0x5)+parseInt(_0x55c72f(0x179))/0x6*(parseInt(_0x55c72f(0x170))/0x7)+-parseInt(_0x55c72f(0x173))/0x8*(parseInt(_0x55c72f(0x160))/0x9)+parseInt(_0x55c72f(0x17b))/0xa*(-parseInt(_0x55c72f(0x158))/0xb);if(_0x267922===_0x528364)break;else _0x4eca7c['push'](_0x4eca7c['shift']());}catch(_0x9fa0f2){_0x4eca7c['push'](_0x4eca7c['shift']());}}}(a59_0x49ed,0x2cb2e));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:_0x31a1fb,input:_0x218990,dryRun:_0x51b2eb}){const _0x37ec3b=a59_0x57bb;validateInput(_0x218990);const _0x255ef7=normalizeBusinessGroup(_0x218990[_0x37ec3b(0x18c)]),_0x5d3dab=await getDatasetDetail(_0x218990['code']),_0x5a1d6b=resolveBusinessGroupDataset(_0x5d3dab,_0x218990[_0x37ec3b(0x185)]),_0x1ccef1=loadCurrentBusinessGroup(_0x5d3dab,_0x5a1d6b);assertExpectedBusinessGroup(_0x1ccef1,_0x218990[_0x37ec3b(0x18d)]);const _0x3f74d1=buildBackendPayload(_0x31a1fb,_0x5a1d6b,_0x255ef7),_0x20b523=_0x1ccef1!==_0x255ef7;let _0x505e46;if(_0x20b523&&!_0x51b2eb){await updateErBusinessGroup(_0x3f74d1);const _0x59076f=await getDatasetDetail(_0x5a1d6b[_0x37ec3b(0x185)]),_0xece61a=resolveBusinessGroupDataset(_0x59076f,_0x5a1d6b[_0x37ec3b(0x185)]),_0x5ea0de=loadCurrentBusinessGroup(_0x59076f,_0xece61a);if(_0x5ea0de!==_0x255ef7)throw CliErrors[_0x37ec3b(0x18e)](_0x37ec3b(0x187),_0x37ec3b(0x186)+JSON[_0x37ec3b(0x167)](_0x255ef7)+_0x37ec3b(0x180)+JSON['stringify'](_0x5ea0de)+'.');_0x505e46={'verified':!![],'status':'matched','afterReadback':{'businessGroup':_0x5ea0de}};}else!_0x20b523&&(_0x505e46={'verified':!![],'status':_0x37ec3b(0x18f),'afterReadback':{'businessGroup':_0x1ccef1}});const _0x542110={'operation':'update','appCode':_0x31a1fb,'selector':{'code':_0x5a1d6b[_0x37ec3b(0x185)]},'dataset':_0x5a1d6b,'before':{'businessGroup':_0x1ccef1},'after':{'businessGroup':_0x255ef7},'changed':_0x20b523,'dryRun':_0x51b2eb,'submitted':_0x20b523&&!_0x51b2eb,'backend':{'method':_0x37ec3b(0x188),'path':BACKEND_PATH,'payload':_0x3f74d1},..._0x505e46?{'verification':_0x505e46}:{},'warnings':[]};return{'ok':!![],'data':_0x542110,'message':_0x20b523?_0x51b2eb?'Dry-run:\x20business\x20model\x20group\x20would\x20change\x20for\x20dataset\x20'+_0x5a1d6b[_0x37ec3b(0x185)]:_0x37ec3b(0x178)+_0x5a1d6b[_0x37ec3b(0x185)]:_0x37ec3b(0x161)+_0x5a1d6b[_0x37ec3b(0x185)]};}export const datasetBusinessGroupUpdate={'service':a59_0x1f6f3c(0x182),'command':'business-group-update','description':a59_0x1f6f3c(0x16b),'risk':a59_0x1f6f3c(0x16e),'flags':[CODE_FLAG,{'name':a59_0x1f6f3c(0x176),'type':a59_0x1f6f3c(0x183),'required':!![],'description':'New\x20business\x20model\x20group\x20value;\x20empty\x20string\x20clears\x20it'},{'name':a59_0x1f6f3c(0x15f),'type':a59_0x1f6f3c(0x183),'required':![],'description':a59_0x1f6f3c(0x177)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3ef57e){validateInput(readBusinessGroupUpdateInput(_0x3ef57e));},async 'dryRun'(_0x4ddcf5){const _0x5702b1=a59_0x1f6f3c,_0x3b7d9f=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x4ddcf5[_0x5702b1(0x16f)],'input':readBusinessGroupUpdateInput(_0x4ddcf5),'dryRun':!![]});return{'method':_0x5702b1(0x188),'url':BACKEND_PATH,'body':_0x3b7d9f['data']['backend'][_0x5702b1(0x15a)],'description':_0x3b7d9f['message'],..._0x3b7d9f['data']};},async 'execute'(_0xbe10ba){return buildDatasetBusinessGroupUpdateResult({'appCode':_0xbe10ba['appCode'],'input':readBusinessGroupUpdateInput(_0xbe10ba),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x325880){const _0x2bf685=a59_0x1f6f3c,_0xc7ea56=_0x325880['str'](_0x2bf685(0x15f));return{'code':trim(_0x325880[_0x2bf685(0x17f)](_0x2bf685(0x185))),'businessGroup':_0x325880[_0x2bf685(0x17f)]('business-group'),'expectBusinessGroup':_0xc7ea56===undefined||_0xc7ea56===''?undefined:_0xc7ea56};}function validateInput(_0x517427){const _0x3f5cee=a59_0x1f6f3c;if(!trim(_0x517427['code']))throw CliErrors[_0x3f5cee(0x17a)](_0x3f5cee(0x17e));if(_0x517427[_0x3f5cee(0x18c)]===undefined)throw CliErrors[_0x3f5cee(0x17a)](_0x3f5cee(0x15e));}function resolveBusinessGroupDataset(_0x4ea43e,_0x95295){const _0x46f369=a59_0x1f6f3c,_0x11db24=asPlainObject(_0x4ea43e[_0x46f369(0x182)]),_0x1ae082=asPlainObject(_0x4ea43e[_0x46f369(0x16c)]),_0x241831=resolveSourceType(_0x4ea43e,_0x11db24,_0x1ae082),_0x27c363=firstString(_0x4ea43e[_0x46f369(0x191)],_0x4ea43e[_0x46f369(0x185)],_0x11db24[_0x46f369(0x17c)],_0x95295)||_0x95295;return{'id':firstNumber(_0x4ea43e['modelId'],_0x4ea43e['id'],_0x11db24['datasetId'])??firstString(_0x4ea43e[_0x46f369(0x15b)],_0x4ea43e['id'],_0x11db24[_0x46f369(0x165)])??null,'code':_0x27c363,'name':firstString(_0x4ea43e[_0x46f369(0x175)],_0x11db24['datasetName'],_0x11db24[_0x46f369(0x175)])||null,'sourceType':_0x241831};}function resolveSourceType(_0x1b978c,_0x9c6869,_0x1d9f15){const _0x2ac7ef=a59_0x1f6f3c,_0x2e3c57=firstString(_0x1b978c[_0x2ac7ef(0x16d)],_0x1b978c[_0x2ac7ef(0x172)],_0x9c6869['source'],_0x9c6869[_0x2ac7ef(0x172)])?.[_0x2ac7ef(0x166)]()[_0x2ac7ef(0x159)]();if(_0x2e3c57===_0x2ac7ef(0x192)||_0x2e3c57===_0x2ac7ef(0x164))return _0x2e3c57;if(Object['keys'](_0x1d9f15)[_0x2ac7ef(0x18b)]>0x0)return _0x2ac7ef(0x192);throw CliErrors[_0x2ac7ef(0x17a)]('Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.');}function loadCurrentBusinessGroup(_0x580e0e,_0x36291c){const _0xcce396=a59_0x1f6f3c,_0x49725f=readBusinessGroupFromDatasetDetail(_0x580e0e,_0x36291c[_0xcce396(0x172)]);if(_0x49725f['found'])return normalizeBusinessGroup(_0x49725f[_0xcce396(0x162)]);if(_0x36291c[_0xcce396(0x172)]===_0xcce396(0x164))return'';throw CliErrors[_0xcce396(0x17a)]('Dataset\x20detail\x20does\x20not\x20expose\x20businessGroup.','Business\x20model\x20group\x20readback\x20must\x20be\x20available\x20by\x20datasetCode;\x20upgrade\x20the\x20backend\x20read\x20contract\x20instead\x20of\x20using\x20dblinkId/tableName.');}function readBusinessGroupFromDatasetDetail(_0x11587b,_0x3c2f03){const _0x1e0540=a59_0x1f6f3c,_0x116a1d=asPlainObject(_0x11587b[_0x1e0540(0x182)]),_0x1016c1=firstPresent(_0x11587b['businessGroup']);if(_0x1016c1[_0x1e0540(0x171)])return _0x1016c1;const _0x32dba9=firstPresent(_0x116a1d[_0x1e0540(0x18c)]);if(_0x32dba9[_0x1e0540(0x171)])return _0x32dba9;if(_0x3c2f03===_0x1e0540(0x192))return{'found':![]};const _0x104aa2=readBusinessGroupFromExtend(_0x11587b[_0x1e0540(0x17d)]);if(_0x104aa2[_0x1e0540(0x171)])return _0x104aa2;return readBusinessGroupFromExtend(_0x116a1d[_0x1e0540(0x17d)]);}function readBusinessGroupFromExtend(_0x2b7cb1){const _0x2d5924=a59_0x1f6f3c;if(_0x2b7cb1===undefined||_0x2b7cb1===null||_0x2b7cb1==='')return{'found':![]};if(typeof _0x2b7cb1===_0x2d5924(0x183))try{const _0x300ee8=JSON[_0x2d5924(0x174)](_0x2b7cb1);return readBusinessGroupFromExtend(_0x300ee8);}catch{return{'found':![]};}const _0x15ea31=asPlainObject(_0x2b7cb1);if(Object[_0x2d5924(0x15c)]['hasOwnProperty']['call'](_0x15ea31,_0x2d5924(0x18c)))return{'found':!![],'value':_0x15ea31[_0x2d5924(0x18c)]};return{'found':![]};}function firstPresent(..._0x349a34){for(const _0x28e479 of _0x349a34){if(_0x28e479!==undefined&&_0x28e479!==null)return{'found':!![],'value':_0x28e479};}return{'found':![]};}function assertExpectedBusinessGroup(_0x3a5581,_0x451919){const _0x403a8d=a59_0x1f6f3c;if(_0x451919===undefined)return;const _0x49a908=normalizeBusinessGroup(_0x451919);if(_0x3a5581!==_0x49a908)throw CliErrors[_0x403a8d(0x17a)](_0x403a8d(0x168),_0x403a8d(0x186)+JSON['stringify'](_0x49a908)+_0x403a8d(0x180)+JSON['stringify'](_0x3a5581));}function buildBackendPayload(_0x25cd2d,_0x10b131,_0x5e15a5){return{'appCode':_0x25cd2d,'datasetCode':_0x10b131['code'],'businessGroup':_0x5e15a5};}function normalizeBusinessGroup(_0x114568){const _0x24769e=a59_0x1f6f3c;if(_0x114568===undefined||_0x114568===null)return'';return String(_0x114568)[_0x24769e(0x166)]();}function asPlainObject(_0xf64771){const _0x427705=a59_0x1f6f3c;if(!_0xf64771||typeof _0xf64771!==_0x427705(0x190)||Array[_0x427705(0x169)](_0xf64771))return{};return _0xf64771;}function firstString(..._0x16dd10){const _0x48317e=a59_0x1f6f3c;for(const _0x22a52c of _0x16dd10){if(typeof _0x22a52c==='string'&&_0x22a52c['trim']())return _0x22a52c[_0x48317e(0x166)]();if(typeof _0x22a52c===_0x48317e(0x189)&&Number[_0x48317e(0x184)](_0x22a52c))return String(_0x22a52c);}return undefined;}function a59_0x49ed(){const _0xed9632=['code','Expected\x20','Business\x20model\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','POST','number','679682eyQROz','length','businessGroup','expectBusinessGroup','apiError','unchanged','object','modelCode','DB_TABLE','2167plAGPN','toUpperCase','payload','modelId','prototype','235XlHpDQ','--business-group\x20is\x20required','expect-business-group','2289807pfvLmQ','No\x20changes\x20for\x20business\x20model\x20group\x20on\x20dataset\x20','value','1964ieeqhj','METADATA','datasetId','trim','stringify','Expectation\x20mismatch\x20at\x20businessGroup','isArray','42000gaNnVg','Update\x20business\x20model\x20group','dbtableConfig','source','write','appCode','7sYGVGz','found','sourceType','8tfCVAj','parse','name','business-group','Expected\x20current\x20business\x20model\x20group;\x20mismatch\x20aborts\x20without\x20writing','Updated\x20business\x20model\x20group\x20for\x20dataset\x20','1536750hmOAHc','validation','17410uxfNBg','datasetCode','extend','--code\x20is\x20required','str',',\x20actual\x20','221597mLgzft','dataset','string','isFinite'];a59_0x49ed=function(){return _0xed9632;};return a59_0x49ed();}function a59_0x57bb(_0x44ae2c,_0xaf6d41){_0x44ae2c=_0x44ae2c-0x158;const _0x49edb9=a59_0x49ed();let _0x57bb61=_0x49edb9[_0x44ae2c];return _0x57bb61;}function firstNumber(..._0x19fb66){const _0x12127f=a59_0x1f6f3c;for(const _0xf2321 of _0x19fb66){if(typeof _0xf2321==='number'&&Number[_0x12127f(0x184)](_0xf2321))return _0xf2321;if(typeof _0xf2321===_0x12127f(0x183)&&_0xf2321[_0x12127f(0x166)]()&&Number[_0x12127f(0x184)](Number(_0xf2321)))return Number(_0xf2321);}return null;}function trim(_0xbe407b){const _0x1354d8=a59_0x1f6f3c;return String(_0xbe407b||'')[_0x1354d8(0x166)]();}
|
|
1
|
+
const a59_0x4789a5=a59_0x1365;(function(_0x446627,_0xd04579){const _0x1ca79f=a59_0x1365,_0x3799ab=_0x446627();while(!![]){try{const _0x4deec7=parseInt(_0x1ca79f(0x1bd))/0x1+parseInt(_0x1ca79f(0x19c))/0x2*(-parseInt(_0x1ca79f(0x18d))/0x3)+parseInt(_0x1ca79f(0x1be))/0x4*(parseInt(_0x1ca79f(0x1c4))/0x5)+-parseInt(_0x1ca79f(0x1a1))/0x6*(-parseInt(_0x1ca79f(0x1a2))/0x7)+parseInt(_0x1ca79f(0x18f))/0x8+-parseInt(_0x1ca79f(0x1bf))/0x9*(parseInt(_0x1ca79f(0x199))/0xa)+-parseInt(_0x1ca79f(0x1ab))/0xb*(parseInt(_0x1ca79f(0x1b6))/0xc);if(_0x4deec7===_0xd04579)break;else _0x3799ab['push'](_0x3799ab['shift']());}catch(_0x577042){_0x3799ab['push'](_0x3799ab['shift']());}}}(a59_0x3b1d,0x6d6e8));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:_0x34d017,input:_0x28c791,dryRun:_0x478200}){const _0xd2d9b2=a59_0x1365;validateInput(_0x28c791);const _0x22de0d=normalizeBusinessGroup(_0x28c791[_0xd2d9b2(0x18b)]),_0x4958c9=await getDatasetDetail(_0x28c791[_0xd2d9b2(0x1b7)]),_0x23c52b=resolveBusinessGroupDataset(_0x4958c9,_0x28c791[_0xd2d9b2(0x1b7)]),_0x35c9b0=loadCurrentBusinessGroup(_0x4958c9,_0x23c52b);assertExpectedBusinessGroup(_0x35c9b0,_0x28c791[_0xd2d9b2(0x1b9)]);const _0x3fa5aa=buildBackendPayload(_0x34d017,_0x23c52b,_0x22de0d),_0x142a9d=_0x35c9b0!==_0x22de0d;let _0x26c4c1;if(_0x142a9d&&!_0x478200){await updateErBusinessGroup(_0x3fa5aa);const _0x4b796e=await getDatasetDetail(_0x23c52b[_0xd2d9b2(0x1b7)]),_0x322421=resolveBusinessGroupDataset(_0x4b796e,_0x23c52b[_0xd2d9b2(0x1b7)]),_0x566257=loadCurrentBusinessGroup(_0x4b796e,_0x322421);if(_0x566257!==_0x22de0d)throw CliErrors['apiError'](_0xd2d9b2(0x197),'Expected\x20'+JSON[_0xd2d9b2(0x191)](_0x22de0d)+_0xd2d9b2(0x1b3)+JSON[_0xd2d9b2(0x191)](_0x566257)+'.');_0x26c4c1={'verified':!![],'status':_0xd2d9b2(0x189),'afterReadback':{'businessGroup':_0x566257}};}else!_0x142a9d&&(_0x26c4c1={'verified':!![],'status':'unchanged','afterReadback':{'businessGroup':_0x35c9b0}});const _0x39534a={'operation':_0xd2d9b2(0x193),'appCode':_0x34d017,'selector':{'code':_0x23c52b[_0xd2d9b2(0x1b7)]},'dataset':_0x23c52b,'before':{'businessGroup':_0x35c9b0},'after':{'businessGroup':_0x22de0d},'changed':_0x142a9d,'dryRun':_0x478200,'submitted':_0x142a9d&&!_0x478200,'backend':{'method':_0xd2d9b2(0x1a7),'path':BACKEND_PATH,'payload':_0x3fa5aa},..._0x26c4c1?{'verification':_0x26c4c1}:{},'warnings':[]};return{'ok':!![],'data':_0x39534a,'message':_0x142a9d?_0x478200?_0xd2d9b2(0x188)+_0x23c52b[_0xd2d9b2(0x1b7)]:_0xd2d9b2(0x1a5)+_0x23c52b[_0xd2d9b2(0x1b7)]:_0xd2d9b2(0x1a6)+_0x23c52b['code']};}function a59_0x3b1d(){const _0x8ca5c7=['found','businessGroup','length','10215KeEeWf','datasetName','4654488KpuMAJ','validation','stringify','isArray','update','Expected\x20current\x20business\x20model\x20group;\x20mismatch\x20aborts\x20without\x20writing','appCode','message','Business\x20model\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','dbtableConfig','13220xwsFae','--business-group\x20is\x20required','string','16ciNPFB','New\x20business\x20model\x20group\x20value;\x20empty\x20string\x20clears\x20it','DB_TABLE','METADATA','datasetCode','28938CiHham','1057phjhZS','name','prototype','Updated\x20business\x20model\x20group\x20for\x20dataset\x20','No\x20changes\x20for\x20business\x20model\x20group\x20on\x20dataset\x20','POST','trim','expect-business-group','write','16899322ufXguE','Dataset\x20detail\x20does\x20not\x20expose\x20businessGroup.','modelCode','dataset','datasetId','call','extend','Expected\x20',',\x20actual\x20','object','number','12XzQjHv','code','business-group','expectBusinessGroup','sourceType','modelId','str','784099oOMTAE','412CJExaA','5121ZwuTDM','Business\x20model\x20group\x20readback\x20must\x20be\x20available\x20by\x20datasetCode;\x20upgrade\x20the\x20backend\x20read\x20contract\x20instead\x20of\x20using\x20dblinkId/tableName.','data','isFinite','keys','32515ewzNup','value','hasOwnProperty','Expectation\x20mismatch\x20at\x20businessGroup','source','Dry-run:\x20business\x20model\x20group\x20would\x20change\x20for\x20dataset\x20','matched'];a59_0x3b1d=function(){return _0x8ca5c7;};return a59_0x3b1d();}export const datasetBusinessGroupUpdate={'service':'dataset','command':'business-group-update','description':'Update\x20business\x20model\x20group','risk':a59_0x4789a5(0x1aa),'flags':[CODE_FLAG,{'name':'business-group','type':a59_0x4789a5(0x19b),'required':!![],'description':a59_0x4789a5(0x19d)},{'name':'expect-business-group','type':a59_0x4789a5(0x19b),'required':![],'description':a59_0x4789a5(0x194)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2d8504){validateInput(readBusinessGroupUpdateInput(_0x2d8504));},async 'dryRun'(_0x5ca170){const _0xdcb4c=a59_0x4789a5,_0x192844=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x5ca170[_0xdcb4c(0x195)],'input':readBusinessGroupUpdateInput(_0x5ca170),'dryRun':!![]});return{'method':_0xdcb4c(0x1a7),'url':BACKEND_PATH,'body':_0x192844[_0xdcb4c(0x1c1)]['backend']['payload'],'description':_0x192844[_0xdcb4c(0x196)],..._0x192844[_0xdcb4c(0x1c1)]};},async 'execute'(_0x2fbbd8){return buildDatasetBusinessGroupUpdateResult({'appCode':_0x2fbbd8['appCode'],'input':readBusinessGroupUpdateInput(_0x2fbbd8),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x28312e){const _0x427c39=a59_0x4789a5,_0x341ee4=_0x28312e[_0x427c39(0x1bc)](_0x427c39(0x1a9));return{'code':trim(_0x28312e[_0x427c39(0x1bc)](_0x427c39(0x1b7))),'businessGroup':_0x28312e['str'](_0x427c39(0x1b8)),'expectBusinessGroup':_0x341ee4===undefined||_0x341ee4===''?undefined:_0x341ee4};}function validateInput(_0x2d90b1){const _0x231bc6=a59_0x4789a5;if(!trim(_0x2d90b1['code']))throw CliErrors[_0x231bc6(0x190)]('--code\x20is\x20required');if(_0x2d90b1[_0x231bc6(0x18b)]===undefined)throw CliErrors[_0x231bc6(0x190)](_0x231bc6(0x19a));}function resolveBusinessGroupDataset(_0x5719bb,_0x5a917b){const _0x458771=a59_0x4789a5,_0x63b8a1=asPlainObject(_0x5719bb[_0x458771(0x1ae)]),_0x58f0e7=asPlainObject(_0x5719bb[_0x458771(0x198)]),_0x21d5b7=resolveSourceType(_0x5719bb,_0x63b8a1,_0x58f0e7),_0x445c4b=firstString(_0x5719bb[_0x458771(0x1ad)],_0x5719bb[_0x458771(0x1b7)],_0x63b8a1[_0x458771(0x1a0)],_0x5a917b)||_0x5a917b;return{'id':firstNumber(_0x5719bb['modelId'],_0x5719bb['id'],_0x63b8a1['datasetId'])??firstString(_0x5719bb[_0x458771(0x1bb)],_0x5719bb['id'],_0x63b8a1[_0x458771(0x1af)])??null,'code':_0x445c4b,'name':firstString(_0x5719bb[_0x458771(0x1a3)],_0x63b8a1[_0x458771(0x18e)],_0x63b8a1[_0x458771(0x1a3)])||null,'sourceType':_0x21d5b7};}function resolveSourceType(_0x4b4209,_0x378c71,_0x878b0e){const _0x15e27c=a59_0x4789a5,_0x1b947c=firstString(_0x4b4209[_0x15e27c(0x187)],_0x4b4209[_0x15e27c(0x1ba)],_0x378c71[_0x15e27c(0x187)],_0x378c71[_0x15e27c(0x1ba)])?.[_0x15e27c(0x1a8)]()['toUpperCase']();if(_0x1b947c===_0x15e27c(0x19e)||_0x1b947c==='METADATA')return _0x1b947c;if(Object[_0x15e27c(0x1c3)](_0x878b0e)[_0x15e27c(0x18c)]>0x0)return _0x15e27c(0x19e);throw CliErrors[_0x15e27c(0x190)]('Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.');}function loadCurrentBusinessGroup(_0x113993,_0x5463d4){const _0x3c4820=a59_0x4789a5,_0x4f0bbe=readBusinessGroupFromDatasetDetail(_0x113993,_0x5463d4[_0x3c4820(0x1ba)]);if(_0x4f0bbe[_0x3c4820(0x18a)])return normalizeBusinessGroup(_0x4f0bbe[_0x3c4820(0x1c5)]);if(_0x5463d4[_0x3c4820(0x1ba)]===_0x3c4820(0x19f))return'';throw CliErrors[_0x3c4820(0x190)](_0x3c4820(0x1ac),_0x3c4820(0x1c0));}function readBusinessGroupFromDatasetDetail(_0x563710,_0x4f6447){const _0x495a71=a59_0x4789a5,_0x11efe=asPlainObject(_0x563710['dataset']),_0x254dd8=firstPresent(_0x563710['businessGroup']);if(_0x254dd8[_0x495a71(0x18a)])return _0x254dd8;const _0x369209=firstPresent(_0x11efe['businessGroup']);if(_0x369209[_0x495a71(0x18a)])return _0x369209;if(_0x4f6447===_0x495a71(0x19e))return{'found':![]};const _0x1e30ff=readBusinessGroupFromExtend(_0x563710[_0x495a71(0x1b1)]);if(_0x1e30ff['found'])return _0x1e30ff;return readBusinessGroupFromExtend(_0x11efe[_0x495a71(0x1b1)]);}function readBusinessGroupFromExtend(_0x18f4ce){const _0x4d810c=a59_0x4789a5;if(_0x18f4ce===undefined||_0x18f4ce===null||_0x18f4ce==='')return{'found':![]};if(typeof _0x18f4ce==='string')try{const _0x2c03c5=JSON['parse'](_0x18f4ce);return readBusinessGroupFromExtend(_0x2c03c5);}catch{return{'found':![]};}const _0x174d8d=asPlainObject(_0x18f4ce);if(Object[_0x4d810c(0x1a4)][_0x4d810c(0x1c6)][_0x4d810c(0x1b0)](_0x174d8d,_0x4d810c(0x18b)))return{'found':!![],'value':_0x174d8d[_0x4d810c(0x18b)]};return{'found':![]};}function firstPresent(..._0x1f3718){for(const _0x4e4506 of _0x1f3718){if(_0x4e4506!==undefined&&_0x4e4506!==null)return{'found':!![],'value':_0x4e4506};}return{'found':![]};}function assertExpectedBusinessGroup(_0x19c481,_0x390ce0){const _0xafc927=a59_0x4789a5;if(_0x390ce0===undefined)return;const _0x408d65=normalizeBusinessGroup(_0x390ce0);if(_0x19c481!==_0x408d65)throw CliErrors[_0xafc927(0x190)](_0xafc927(0x1c7),_0xafc927(0x1b2)+JSON['stringify'](_0x408d65)+',\x20actual\x20'+JSON['stringify'](_0x19c481));}function a59_0x1365(_0x12f8c2,_0x148858){_0x12f8c2=_0x12f8c2-0x187;const _0x3b1db3=a59_0x3b1d();let _0x1365a1=_0x3b1db3[_0x12f8c2];return _0x1365a1;}function buildBackendPayload(_0x3cd9cc,_0x236dec,_0x2e9bde){return{'appCode':_0x3cd9cc,'datasetCode':_0x236dec['code'],'businessGroup':_0x2e9bde};}function normalizeBusinessGroup(_0x2cc816){const _0x5b6d8b=a59_0x4789a5;if(_0x2cc816===undefined||_0x2cc816===null)return'';return String(_0x2cc816)[_0x5b6d8b(0x1a8)]();}function asPlainObject(_0x533627){const _0x261e27=a59_0x4789a5;if(!_0x533627||typeof _0x533627!==_0x261e27(0x1b4)||Array[_0x261e27(0x192)](_0x533627))return{};return _0x533627;}function firstString(..._0x5d1c2e){const _0x5eb0f5=a59_0x4789a5;for(const _0x271aa6 of _0x5d1c2e){if(typeof _0x271aa6==='string'&&_0x271aa6[_0x5eb0f5(0x1a8)]())return _0x271aa6['trim']();if(typeof _0x271aa6===_0x5eb0f5(0x1b5)&&Number['isFinite'](_0x271aa6))return String(_0x271aa6);}return undefined;}function firstNumber(..._0xc92908){const _0x331604=a59_0x4789a5;for(const _0x4cff5b of _0xc92908){if(typeof _0x4cff5b===_0x331604(0x1b5)&&Number[_0x331604(0x1c2)](_0x4cff5b))return _0x4cff5b;if(typeof _0x4cff5b==='string'&&_0x4cff5b[_0x331604(0x1a8)]()&&Number[_0x331604(0x1c2)](Number(_0x4cff5b)))return Number(_0x4cff5b);}return null;}function trim(_0x4f39e7){return String(_0x4f39e7||'')['trim']();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a60_0xf5009d=a60_0x54b6;(function(_0x1cb464,_0x211c1d){const _0xff9288=a60_0x54b6,_0x3e49ce=_0x1cb464();while(!![]){try{const _0x5c7e2b=-parseInt(_0xff9288(0x152))/0x1*(parseInt(_0xff9288(0x16a))/0x2)+-parseInt(_0xff9288(0x150))/0x3+-parseInt(_0xff9288(0x166))/0x4+parseInt(_0xff9288(0x161))/0x5*(parseInt(_0xff9288(0x171))/0x6)+-parseInt(_0xff9288(0x162))/0x7*(parseInt(_0xff9288(0x155))/0x8)+-parseInt(_0xff9288(0x16f))/0x9*(-parseInt(_0xff9288(0x154))/0xa)+parseInt(_0xff9288(0x167))/0xb;if(_0x5c7e2b===_0x211c1d)break;else _0x3e49ce['push'](_0x3e49ce['shift']());}catch(_0x526ac2){_0x3e49ce['push'](_0x3e49ce['shift']());}}}(a60_0x3fab,0x2acf6));import{CliErrors}from'../../errors.js';export const RUNTIME_DATA_ACCESS_COMMANDS={'cli':a60_0xf5009d(0x15f),'filter':'lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27<json>\x27\x20--format\x20compress','getOne':a60_0xf5009d(0x16b)};function a60_0x54b6(_0xdfdf3b,_0x1dc294){_0xdfdf3b=_0xdfdf3b-0x150;const _0x3fab20=a60_0x3fab();let _0x54b651=_0x3fab20[_0xdfdf3b];return _0x54b651;}export const RUNTIME_DATA_ACCESS_SUMMARY='Use\x20lovrabet\x20data\x20filter/getOne\x20for\x20real\x20runtime\x20records.';function valueToString(_0x5839c8){return _0x5839c8==null?'':String(_0x5839c8)['trim']();}function getDatasetCode(_0x42f94b){const _0x703c50=a60_0xf5009d;return valueToString(_0x42f94b['code']??_0x42f94b[_0x703c50(0x163)]??_0x42f94b[_0x703c50(0x16c)]?.['datasetCode']);}function getDatasetName(_0x258a2f){const _0x18438d=a60_0xf5009d;return valueToString(_0x258a2f[_0x18438d(0x170)]??_0x258a2f['dataset']?.[_0x18438d(0x15c)])||'unknown';}function getDatasetSource(_0x3da924){const _0xdec405=a60_0xf5009d;return valueToString(_0x3da924[_0xdec405(0x153)]??_0x3da924[_0xdec405(0x16c)]?.[_0xdec405(0x156)])['toUpperCase']();}function getDbtableConfig(_0x2b278b){const _0x359821=a60_0xf5009d,_0x256603=_0x2b278b[_0x359821(0x15b)]??_0x2b278b[_0x359821(0x164)];return _0x256603&&typeof _0x256603==='object'?_0x256603:{};}export function isDbTableBackedDataset(_0x4d02aa){const _0x4c7286=a60_0xf5009d,_0xc930a4=getDatasetSource(_0x4d02aa);if(_0xc930a4===_0x4c7286(0x168))return![];const _0xfa3ca=getDbtableConfig(_0x4d02aa),_0x5e6044=_0xfa3ca['dbId']??_0xfa3ca['id'],_0x15f031=valueToString(_0xfa3ca[_0x4c7286(0x160)]??_0x4d02aa['tableName']??_0x4d02aa['dataset']?.['tableName']);return _0x5e6044!==undefined&&_0x5e6044!==null&&_0x15f031[_0x4c7286(0x158)]>0x0;}export function filterDbTableBackedDatasets(_0x46c8ac){const _0x566749=a60_0xf5009d;return _0x46c8ac[_0x566749(0x16e)](_0xb7a30b=>isDbTableBackedDataset(_0xb7a30b));}export function buildDbTableBackedRequirementMessage(_0x5166ef,_0x2c586c=a60_0xf5009d(0x15a)){const _0x4f525a=a60_0xf5009d,_0x4910cb=getDatasetSource(_0x5166ef)||_0x4f525a(0x151),_0x4d00fc=getDatasetName(_0x5166ef),_0x58a8aa=getDatasetCode(_0x5166ef),_0x37fe3c=_0x58a8aa?'\x20('+_0x58a8aa+')':'';return['当前数据集\x20\x22'+_0x4d00fc+'\x22'+_0x37fe3c+_0x4f525a(0x165)+_0x4910cb+'\x20类型,没有可用于\x20'+_0x2c586c+_0x4f525a(0x159),_0x4f525a(0x15e),'请先将该数据集升级/迁移为\x20DB_TABLE\x20数据集,再基于新的\x20dataset\x20code\x20继续开发。',_0x4f525a(0x157)+RUNTIME_DATA_ACCESS_COMMANDS[_0x4f525a(0x16e)]+';'+RUNTIME_DATA_ACCESS_COMMANDS[_0x4f525a(0x169)]+'。'][_0x4f525a(0x16d)]('\x20');}export function assertDatasetIsDbTableBacked(_0x25e54c,_0x3591aa){const _0x516b4c=a60_0xf5009d;if(!isDbTableBackedDataset(_0x25e54c))throw CliErrors[_0x516b4c(0x15d)](buildDbTableBackedRequirementMessage(_0x25e54c,_0x3591aa));}function a60_0x3fab(){const _0x5c5174=['datasetName','validation','原因:schema\x20introspection\x20与\x20custom\x20SQL\x20需要\x20source=DB_TABLE、dbtableConfig.dbId、dbtableConfig.tableName\x20与数据库连接上下文。','lovrabet','tableName','15mYWNLP','7SADCMt','modelCode','dbtable','\x20是\x20','820124nnWnUd','5295730wQhJdy','METADATA','getOne','62KCxhfo','lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27\x20--format\x20compress','dataset','join','filter','2437191MFKlpU','name','405282yxXkCx','567069vDWZNC','UNKNOWN','9940MLzLHz','source','10eDrNad','618608OiwCNo','sourceType','如果只是查看运行态真实行数据,请切换到\x20lovrabet\x20CLI:','length','\x20的\x20DB_TABLE\x20数据源上下文。','SQL\x20schema\x20validation','dbtableConfig'];a60_0x3fab=function(){return _0x5c5174;};return a60_0x3fab();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a61_0x4be044=a61_0x117d;function a61_0x117d(_0x292dfb,_0x167f61){_0x292dfb=_0x292dfb-0x1d0;const _0xa1f923=a61_0xa1f9();let _0x117d20=_0xa1f923[_0x292dfb];return _0x117d20;}(function(_0x144140,_0x27b2d5){const _0x5c03cb=a61_0x117d,_0x2bc03c=_0x144140();while(!![]){try{const _0xa5b80=parseInt(_0x5c03cb(0x1ef))/0x1+parseInt(_0x5c03cb(0x1d2))/0x2+-parseInt(_0x5c03cb(0x1f5))/0x3*(-parseInt(_0x5c03cb(0x1f7))/0x4)+parseInt(_0x5c03cb(0x1eb))/0x5*(-parseInt(_0x5c03cb(0x1e0))/0x6)+-parseInt(_0x5c03cb(0x1e3))/0x7+-parseInt(_0x5c03cb(0x1f4))/0x8+parseInt(_0x5c03cb(0x1e1))/0x9*(parseInt(_0x5c03cb(0x1fb))/0xa);if(_0xa5b80===_0x27b2d5)break;else _0x2bc03c['push'](_0x2bc03c['shift']());}catch(_0x46f2a5){_0x2bc03c['push'](_0x2bc03c['shift']());}}}(a61_0xa1f9,0xd3978));import{deleteDataset,listDatasets}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL,CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const DATASET_ID_FLAG={'name':'id','type':'number','description':'Dataset\x20id'},DBID_FLAG={'name':'dbid','type':a61_0x4be044(0x1db),'description':a61_0x4be044(0x1fa)},CONFIRM_FLAG={'name':a61_0x4be044(0x1d6),'type':a61_0x4be044(0x1d5),'description':a61_0x4be044(0x1dd)},EXPECTED_COUNT_FLAG={'name':a61_0x4be044(0x1f1),'type':a61_0x4be044(0x1db),'description':a61_0x4be044(0x1d1)};function a61_0xa1f9(){const _0x2bc526=['relationPages','dbid','471008qoagqY','\x20failed','expected-count','name','POST','3910176YLIJNk','113289Qwvpzn','source','88OhwOUw','Delete\x20dataset\x20metadata\x20by\x20id/code\x20or\x20all\x20datasets\x20under\x20a\x20db\x20id','dataset','Delete\x20all\x20datasets\x20under\x20this\x20database\x20connection\x20id','10350cqLqZS','dbName','map','tableName','Deleted\x20','validation','No\x20undeleted\x20dataset\x20found\x20for\x20','high-risk-write','num','Abort\x20unless\x20the\x20matched\x20dataset\x20count\x20equals\x20this\x20value','2107922DtFKvb','Use\x20only\x20one\x20of\x20--id,\x20--code,\x20or\x20--dbid.','appCode','boolean','confirm','str','code','Run\x20with\x20--dry-run\x20first,\x20then\x20add\x20--confirm\x20when\x20the\x20target\x20list\x20is\x20correct.','length','number','description','Required\x20to\x20execute\x20dataset\x20deletion','dbtableConfig','push','138ZEqPWF','5139auGewz','delete','6506885MnicGo','Would\x20delete\x20','bool','filter','dbId','--confirm\x20is\x20required\x20to\x20delete\x20datasets.','dbid=','One\x20of\x20--id,\x20--code,\x20or\x20--dbid\x20is\x20required.','143855ukvdDf','\x20dataset(s).\x20This\x20only\x20deletes\x20platform\x20dataset\x20metadata\x20and\x20related\x20page/menu\x20records,\x20not\x20physical\x20databases\x20or\x20tables.'];a61_0xa1f9=function(){return _0x2bc526;};return a61_0xa1f9();}export const datasetDelete={'service':a61_0x4be044(0x1f9),'command':a61_0x4be044(0x1e2),'description':a61_0x4be044(0x1f8),'risk':a61_0x4be044(0x202),'flags':[DATASET_ID_FLAG,CODE_FLAG_OPTIONAL,DBID_FLAG,CONFIRM_FLAG,EXPECTED_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x407f3c){const _0x5e063d=a61_0x4be044,_0x58861b=_0x407f3c['num']('id'),_0x393fb7=_0x407f3c[_0x5e063d(0x1d7)](_0x5e063d(0x1d8)),_0x186a0e=_0x407f3c['num'](_0x5e063d(0x1ee)),_0x37c382=[_0x58861b>0x0,Boolean(_0x393fb7),_0x186a0e>0x0][_0x5e063d(0x1e6)](Boolean);if(_0x37c382[_0x5e063d(0x1da)]===0x0)throw CliErrors[_0x5e063d(0x200)](_0x5e063d(0x1ea));if(_0x37c382[_0x5e063d(0x1da)]>0x1)throw CliErrors[_0x5e063d(0x200)](_0x5e063d(0x1d3));},async 'dryRun'(_0x2e3be2){const _0x424ef1=a61_0x4be044,_0xa417e2=await resolveTargets(_0x2e3be2);return{'method':_0x424ef1(0x1f3),'url':'/smartapi/dataset/delete-dataset','body':{'appCode':_0x2e3be2[_0x424ef1(0x1d4)],'count':_0xa417e2['length'],'datasets':_0xa417e2},'description':_0x424ef1(0x1e4)+_0xa417e2[_0x424ef1(0x1da)]+_0x424ef1(0x1ec)};},async 'execute'(_0x1392b7){const _0x3f0fb0=a61_0x4be044;if(!_0x1392b7[_0x3f0fb0(0x1e5)](_0x3f0fb0(0x1d6)))throw CliErrors['validation'](_0x3f0fb0(0x1e8),_0x3f0fb0(0x1d9));const _0x385379=await resolveTargets(_0x1392b7),_0x3cd032=[],_0x2db56d=[];for(const _0x4bafc9 of _0x385379){try{await deleteDataset(_0x1392b7[_0x3f0fb0(0x1d4)],_0x4bafc9['id']),_0x3cd032['push'](_0x4bafc9);}catch(_0x5b8391){_0x2db56d[_0x3f0fb0(0x1df)]({..._0x4bafc9,'error':_0x5b8391 instanceof Error?_0x5b8391['message']:String(_0x5b8391)});}}if(_0x2db56d[_0x3f0fb0(0x1da)]>0x0)return{'ok':![],'data':{'requested':_0x385379['length'],'deletedCount':_0x3cd032[_0x3f0fb0(0x1da)],'failedCount':_0x2db56d[_0x3f0fb0(0x1da)],'deleted':_0x3cd032,'failed':_0x2db56d},'message':_0x3f0fb0(0x1ff)+_0x3cd032[_0x3f0fb0(0x1da)]+'/'+_0x385379[_0x3f0fb0(0x1da)]+'\x20dataset(s);\x20'+_0x2db56d[_0x3f0fb0(0x1da)]+_0x3f0fb0(0x1f0)};return{'ok':!![],'data':{'requested':_0x385379[_0x3f0fb0(0x1da)],'deletedCount':_0x3cd032[_0x3f0fb0(0x1da)],'deleted':_0x3cd032},'message':_0x3f0fb0(0x1ff)+_0x3cd032['length']+'\x20dataset(s)'};}};async function resolveTargets(_0x453809){const _0x12fca8=a61_0x4be044,_0x1696a3=_0x453809[_0x12fca8(0x1d0)]('id'),_0x1b9594=_0x453809['str'](_0x12fca8(0x1d8)),_0x2cbd0b=_0x453809[_0x12fca8(0x1d0)](_0x12fca8(0x1ee));let _0x114700;_0x1b9594?(_0x114700=await listDatasets(_0x453809[_0x12fca8(0x1d4)],{'code':_0x1b9594}),_0x114700=_0x114700[_0x12fca8(0x1e6)](_0xa2dea3=>_0xa2dea3['code']===_0x1b9594)):(_0x114700=await listDatasets(_0x453809[_0x12fca8(0x1d4)]),_0x1696a3>0x0&&(_0x114700=_0x114700[_0x12fca8(0x1e6)](_0x323c08=>_0x323c08['id']===_0x1696a3)),_0x2cbd0b>0x0&&(_0x114700=_0x114700[_0x12fca8(0x1e6)](_0x2e23f7=>_0x2e23f7[_0x12fca8(0x1de)]?.[_0x12fca8(0x1e7)]===_0x2cbd0b)));const _0x1bebbc=_0x114700[_0x12fca8(0x1fd)](normalizeTarget);if(_0x1bebbc[_0x12fca8(0x1da)]===0x0){const _0x1c4560=_0x1b9594||(_0x1696a3>0x0?'id='+_0x1696a3:_0x12fca8(0x1e9)+_0x2cbd0b);throw CliErrors[_0x12fca8(0x200)](_0x12fca8(0x201)+_0x1c4560+'.');}const _0x50bd67=_0x453809['num'](_0x12fca8(0x1f1));if(_0x50bd67>0x0&&_0x1bebbc[_0x12fca8(0x1da)]!==_0x50bd67)throw CliErrors[_0x12fca8(0x200)]('Matched\x20'+_0x1bebbc[_0x12fca8(0x1da)]+'\x20dataset(s),\x20but\x20--expected-count\x20is\x20'+_0x50bd67+'.');return _0x1bebbc;}function normalizeTarget(_0xfe33d9){const _0x505abf=a61_0x4be044,_0xa813bd=_0xfe33d9[_0x505abf(0x1de)]??{};return{'id':_0xfe33d9['id'],'code':_0xfe33d9[_0x505abf(0x1d8)],'name':_0xfe33d9[_0x505abf(0x1f2)],'description':_0xfe33d9[_0x505abf(0x1dc)],'source':_0xfe33d9[_0x505abf(0x1f6)],'dbId':_0xa813bd['dbId'],'dbName':_0xa813bd[_0x505abf(0x1fc)],'tableName':_0xa813bd[_0x505abf(0x1fe)],'relatedPageCount':Array['isArray'](_0xfe33d9[_0x505abf(0x1ed)])?_0xfe33d9[_0x505abf(0x1ed)]['length']:undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a62_0x5a2739=a62_0x3c4b;(function(_0x3db7d7,_0x178aaa){const _0x3c1be1=a62_0x3c4b,_0x46673d=_0x3db7d7();while(!![]){try{const _0x4feff2=parseInt(_0x3c1be1(0xa8))/0x1*(-parseInt(_0x3c1be1(0x87))/0x2)+-parseInt(_0x3c1be1(0x9f))/0x3*(parseInt(_0x3c1be1(0x81))/0x4)+parseInt(_0x3c1be1(0xb2))/0x5+parseInt(_0x3c1be1(0x74))/0x6*(parseInt(_0x3c1be1(0x99))/0x7)+-parseInt(_0x3c1be1(0xbf))/0x8*(parseInt(_0x3c1be1(0xad))/0x9)+parseInt(_0x3c1be1(0x8d))/0xa+parseInt(_0x3c1be1(0xa1))/0xb;if(_0x4feff2===_0x178aaa)break;else _0x46673d['push'](_0x46673d['shift']());}catch(_0xbf501d){_0x46673d['push'](_0x46673d['shift']());}}}(a62_0x268e,0x665a1));import{getDatasetDetail}from'../../core/api-client.js';import{CODE_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function normalizeField(_0x515ed1){const _0x58c893=a62_0x3c4b;if(_0x515ed1[_0x58c893(0x6f)])return null;const _0x2ea585=Boolean(_0x515ed1[_0x58c893(0xb9)]!==undefined||_0x515ed1[_0x58c893(0x8b)]!==undefined);let _0x6fe95e={};if(!_0x2ea585&&typeof _0x515ed1[_0x58c893(0x93)]===_0x58c893(0x9b))try{_0x6fe95e=JSON[_0x58c893(0x96)](_0x515ed1[_0x58c893(0x93)]);}catch{}const _0x12f974=_0x2ea585?_0x515ed1[_0x58c893(0xa4)]:_0x515ed1[_0x58c893(0x84)],_0xe9247a=_0x2ea585?_0x515ed1[_0x58c893(0xb9)]:_0x515ed1[_0x58c893(0xa4)],_0x24f167=_0x2ea585?_0x515ed1['doType']:_0x515ed1[_0x58c893(0x92)]||_0x515ed1[_0x58c893(0xa2)],_0x56f932=_0x2ea585?_0x515ed1[_0x58c893(0x7e)]===!![]:_0x6fe95e['pkField']===!![],_0x26d6bd=_0x2ea585?_0x515ed1[_0x58c893(0x89)]===!![]:_0x6fe95e[_0x58c893(0x89)]===!![],_0x3bb47d=_0x2ea585?_0x515ed1['options']??null:_0x6fe95e['options']??null,_0x567ff0={'name':_0x12f974,'displayName':_0xe9247a||_0x12f974,'type':_0x24f167,'dbType':_0x515ed1[_0x58c893(0x97)],'pk':_0x56f932,'required':_0x26d6bd,'deprecated':_0x515ed1[_0x58c893(0x90)]===!![],'description':_0x515ed1['description']||undefined};return Array[_0x58c893(0x86)](_0x3bb47d)&&_0x3bb47d['length']>0x0&&(_0x567ff0[_0x58c893(0xb6)]=_0x3bb47d),_0x567ff0;}function a62_0x3c4b(_0x57d877,_0x4e369f){_0x57d877=_0x57d877-0x6e;const _0x268e11=a62_0x268e();let _0x3c4b55=_0x268e11[_0x57d877];return _0x3c4b55;}function parseJsonMaybe(_0x564175){if(typeof _0x564175!=='string')return _0x564175;try{return JSON['parse'](_0x564175);}catch{return _0x564175;}}function normalizeOperationEntry(_0x58bc26,_0x3d3628){const _0x11a598=a62_0x3c4b;if(!_0x3d3628||typeof _0x3d3628!==_0x11a598(0xbb))return null;if(!_0x3d3628[_0x11a598(0xb1)]||!_0x3d3628[_0x11a598(0x88)])return null;const _0x184ade={'name':_0x58bc26,'method':_0x3d3628['method'],'path':_0x3d3628[_0x11a598(0x88)]};if(_0x3d3628['host'])_0x184ade[_0x11a598(0x94)]=_0x3d3628[_0x11a598(0x94)];if(_0x3d3628['requestBody']!=null){const _0x2c466f=parseJsonMaybe(_0x3d3628[_0x11a598(0xba)]);_0x184ade[_0x11a598(0xba)]=_0x2c466f;}if(_0x3d3628[_0x11a598(0x7a)]!=null){const _0x20ba62=parseJsonMaybe(_0x3d3628['responseBody']);_0x184ade[_0x11a598(0x7a)]=_0x20ba62;}if(_0x3d3628[_0x11a598(0x7b)]!=null)_0x184ade['beforeScriptId']=_0x3d3628[_0x11a598(0x7b)];if(_0x3d3628[_0x11a598(0x75)]!=null)_0x184ade[_0x11a598(0x75)]=_0x3d3628[_0x11a598(0x75)];if(Array[_0x11a598(0x86)](_0x3d3628[_0x11a598(0xbe)]))_0x184ade[_0x11a598(0xbe)]=_0x3d3628['requestFields'];if(Array[_0x11a598(0x86)](_0x3d3628[_0x11a598(0x77)]))_0x184ade[_0x11a598(0x77)]=_0x3d3628['responseFields'];return _0x184ade;}function summarizeDbtable(_0xb32325){const _0x240051=a62_0x3c4b,_0x1d48bc={},_0x149436=['dbId','dbName',_0x240051(0x78),_0x240051(0xb5),_0x240051(0x7e),_0x240051(0xbd),_0x240051(0x80),'createTimeField','updateTimeField',_0x240051(0x9c),_0x240051(0xa6),'modifierIdField',_0x240051(0xc0),_0x240051(0x7d),_0x240051(0x76)];for(const _0x5d7a06 of _0x149436){if(_0xb32325[_0x5d7a06]!==undefined)_0x1d48bc[_0x5d7a06]=_0xb32325[_0x5d7a06];}return typeof _0x1d48bc['allFields']==='string'&&_0x1d48bc[_0x240051(0xbd)][_0x240051(0xb8)]>0x0&&(_0x1d48bc[_0x240051(0xaf)]=_0x1d48bc[_0x240051(0xbd)]['split'](',')['map'](_0x16bec9=>_0x16bec9[_0x240051(0x8f)]())[_0x240051(0xbc)](Boolean)),_0x1d48bc;}function a62_0x268e(){const _0x49b8d4=['4622653qbSBgr','read','string','creatorIdField','relatedPageInfoList','bizRelationType','135qNUVYP','alias','2973322UjcWFg','dataType','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically','name','title','creatorNameField','toFieldLabel','1LSVtUs','relationId','fromField','toDatasetName','toTableName','18774rMiVoG','doVersion','allFieldNames','dbtableConfig','method','3033745lkAifP','entries','source','datasetKey','options','toField','length','displayName','requestBody','object','filter','allFields','requestFields','2104REsahI','modifierNameField','columnCodeListWithDeleted','deleted','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','validateRules','tableComment','relations','6Vbrmad','afterScriptId','dblinkInfoDTO','responseFields','tableName','dbId','responseBody','beforeScriptId','main_sub','labelField','pkField','properties','logicField','50156HqKoqA','modelCode','detail','code','fields','isArray','137642MeAxLy','path','required','modelId','doType','push','634970FyzOHq','indexes','trim','deprecated','toDatasetCode','type','extend','host','dataset','parse','dbType','cardinality'];a62_0x268e=function(){return _0x49b8d4;};return a62_0x268e();}function normalizeRelatedPages(_0x500e94){const _0x59a51e=a62_0x3c4b;if(!Array[_0x59a51e(0x86)](_0x500e94))return[];return _0x500e94['filter'](_0x2f6668=>_0x2f6668&&typeof _0x2f6668===_0x59a51e(0xbb))['map'](_0x484680=>({'id':_0x484680['id'],'type':_0x484680[_0x59a51e(0x92)],'code':_0x484680[_0x59a51e(0x84)],'title':_0x484680[_0x59a51e(0xa5)],'deleted':_0x484680['deleted']===!![]}));}export const datasetDetail={'service':a62_0x5a2739(0x95),'command':a62_0x5a2739(0x83),'description':a62_0x5a2739(0x70),'risk':a62_0x5a2739(0x9a),'flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':a62_0x5a2739(0xa0),'type':a62_0x5a2739(0x9b),'description':a62_0x5a2739(0xa3)}],async 'execute'(_0xca067f){const _0x182df3=a62_0x5a2739,_0x4380bd=await getDatasetDetail(_0xca067f['str'](_0x182df3(0x84))),_0x19a11f=Array[_0x182df3(0x86)](_0x4380bd[_0x182df3(0x85)])?_0x4380bd['fields']:Array[_0x182df3(0x86)](_0x4380bd['properties'])?_0x4380bd[_0x182df3(0x7f)]:[],_0x5a080b=_0x19a11f['map'](_0x19e79d=>normalizeField(_0x19e79d))[_0x182df3(0xbc)](_0x487be5=>_0x487be5!==null),_0x44a8b3=_0x4380bd['operations']??{},_0x2eeb1a=[];for(const [_0x1e1508,_0x9ed6f0]of Object[_0x182df3(0xb3)](_0x44a8b3)){const _0x5f565e=normalizeOperationEntry(_0x1e1508,_0x9ed6f0);if(_0x5f565e)_0x2eeb1a[_0x182df3(0x8c)](_0x5f565e);}const _0x32c8e3=_0x4380bd[_0x182df3(0xb0)]??{},_0x570d93=_0x4380bd[_0x182df3(0x95)]??{},_0x107af8=_0x32c8e3[_0x182df3(0x79)]!=null?{'id':_0x32c8e3[_0x182df3(0x79)],'name':_0x32c8e3['dbName']??null}:undefined;let _0x2ecef7;return typeof _0x4380bd['extend']===_0x182df3(0x9b)&&(_0x2ecef7=parseJsonMaybe(_0x4380bd[_0x182df3(0x93)])),{'ok':!![],'data':{'id':_0x4380bd[_0x182df3(0x8a)]??_0x4380bd['id'],'name':_0x4380bd[_0x182df3(0xa4)],'code':_0x4380bd[_0x182df3(0x82)]||_0x4380bd[_0x182df3(0x84)],'doVersion':_0x4380bd[_0x182df3(0xae)],'description':_0x4380bd['description']||_0x570d93[_0x182df3(0x72)]||undefined,'source':_0x4380bd[_0x182df3(0xb4)]||_0x570d93['sourceType'],'table':_0x32c8e3[_0x182df3(0x78)]||_0x570d93[_0x182df3(0x78)],'datasetKey':_0x32c8e3[_0x182df3(0xb5)],'pk':_0x32c8e3[_0x182df3(0x7e)],'db':_0x107af8,'dbtable':summarizeDbtable(_0x32c8e3),'fields':_0x5a080b,'operations':_0x2eeb1a,'indexes':Array[_0x182df3(0x86)](_0x570d93[_0x182df3(0x8e)])?_0x570d93[_0x182df3(0x8e)]:[],'relations':Array[_0x182df3(0x86)](_0x4380bd[_0x182df3(0x73)])?_0x4380bd[_0x182df3(0x73)]['map'](_0x321267=>({..._0x321267[_0x182df3(0xa9)]!=null?{'relationId':_0x321267[_0x182df3(0xa9)]}:{},'fromDataset':_0x4380bd[_0x182df3(0xa4)],'fromCode':_0x4380bd[_0x182df3(0x82)]||_0x4380bd[_0x182df3(0x84)],'fromTable':_0x32c8e3['tableName']||_0x570d93[_0x182df3(0x78)],'fromField':_0x321267[_0x182df3(0xaa)],'toDataset':_0x321267[_0x182df3(0xab)],'toCode':_0x321267[_0x182df3(0x91)],'toTable':_0x321267[_0x182df3(0xac)],'toField':_0x321267[_0x182df3(0xb7)],'labelField':_0x321267[_0x182df3(0xa7)]||undefined,'cardinality':_0x321267[_0x182df3(0x98)]||undefined,'bizRelationType':_0x321267[_0x182df3(0x9e)]===_0x182df3(0x7c)?_0x182df3(0x7c):null})):[],'relatedPages':normalizeRelatedPages(_0x4380bd[_0x182df3(0x9d)]),...Array[_0x182df3(0x86)](_0x4380bd[_0x182df3(0x6e)])?{'columnCodeListWithDeleted':_0x4380bd[_0x182df3(0x6e)]}:{},'formatRules':Array[_0x182df3(0x86)](_0x4380bd['formatRules'])?_0x4380bd['formatRules']:[],'validateRules':Array['isArray'](_0x4380bd[_0x182df3(0x71)])?_0x4380bd[_0x182df3(0x71)]:[],..._0x2ecef7!==undefined?{'extend':_0x2ecef7}:{},'stats':{'fieldCount':_0x5a080b[_0x182df3(0xb8)],'operationCount':_0x2eeb1a[_0x182df3(0xb8)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a63_0x59413a=a63_0x2bfc;(function(_0x3178b7,_0x28615f){const _0x917bb2=a63_0x2bfc,_0x4ec46a=_0x3178b7();while(!![]){try{const _0x58cf9d=parseInt(_0x917bb2(0x13c))/0x1+-parseInt(_0x917bb2(0x119))/0x2*(-parseInt(_0x917bb2(0x138))/0x3)+parseInt(_0x917bb2(0x133))/0x4+parseInt(_0x917bb2(0x140))/0x5+parseInt(_0x917bb2(0x139))/0x6+parseInt(_0x917bb2(0x147))/0x7+-parseInt(_0x917bb2(0x121))/0x8;if(_0x58cf9d===_0x28615f)break;else _0x4ec46a['push'](_0x4ec46a['shift']());}catch(_0x5d4ba0){_0x4ec46a['push'](_0x4ec46a['shift']());}}}(a63_0x3ea6,0xeb129));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const MUTABLE_EXTEND_KEYS=new Set(),EXTEND_PATCH_REDIRECTS=new Map([[a63_0x59413a(0x12c),{'message':'dataset\x20extend-update\x20does\x20not\x20support\x20businessGroup;\x20use\x20dataset\x20business-group-update','hint':a63_0x59413a(0x130)}]]);function a63_0x2bfc(_0x161ff7,_0x4a4b6b){_0x161ff7=_0x161ff7-0x111;const _0x3ea62e=a63_0x3ea6();let _0x2bfc02=_0x3ea62e[_0x161ff7];return _0x2bfc02;}export function parseJsonObjectFlag(_0x345100,_0x3b6ac0){const _0x279e5b=a63_0x59413a;if(!_0x345100)return undefined;let _0xd48395;try{_0xd48395=JSON['parse'](_0x345100);}catch(_0x10be8a){const _0x21cfff=_0x10be8a instanceof Error?_0x10be8a['message']:String(_0x10be8a);throw CliErrors['validation'](_0x3b6ac0+_0x279e5b(0x144)+_0x21cfff);}if(!isPlainObject(_0xd48395)||Array[_0x279e5b(0x134)](_0xd48395))throw CliErrors[_0x279e5b(0x13e)](_0x3b6ac0+_0x279e5b(0x126));return _0xd48395;}export function validateExtendPatchKeys(_0x3a4c97){const _0x41140f=a63_0x59413a,_0x50a9ad=Object[_0x41140f(0x11c)](_0x3a4c97);if(_0x50a9ad[_0x41140f(0x14b)]===0x0)throw CliErrors[_0x41140f(0x13e)](_0x41140f(0x151));for(const _0x4b65d1 of _0x50a9ad){const _0x24566f=EXTEND_PATCH_REDIRECTS[_0x41140f(0x135)](_0x4b65d1);if(_0x24566f)throw CliErrors[_0x41140f(0x13e)](_0x24566f[_0x41140f(0x13d)],_0x24566f[_0x41140f(0x118)]);if(!MUTABLE_EXTEND_KEYS[_0x41140f(0x127)](_0x4b65d1))throw CliErrors[_0x41140f(0x13e)]('Unsupported\x20patch\x20key:\x20'+_0x4b65d1,describeMutableExtendKeys());}}function describeMutableExtendKeys(){const _0x32f68a=a63_0x59413a,_0x476614=Array[_0x32f68a(0x129)](MUTABLE_EXTEND_KEYS)[_0x32f68a(0x136)]();return _0x476614['length']>0x0?_0x32f68a(0x132)+_0x476614[_0x32f68a(0x11e)](',\x20'):_0x32f68a(0x11a);}export function applyExtendPatch(_0x1a784c,_0x55ef6f){const _0x3aa2bd=a63_0x59413a;validateExtendPatchKeys(_0x55ef6f);const _0x467341=deepClone(_0x1a784c),_0xecfa7e=[];for(const [_0x20d68c,_0xb56ea6]of Object[_0x3aa2bd(0x146)](_0x55ef6f)){const _0x59d38f=_0x467341[_0x20d68c],_0x5bcca0=deepClone(_0xb56ea6);!deepEqual(_0x59d38f,_0x5bcca0)&&(_0x467341[_0x20d68c]=_0x5bcca0,_0xecfa7e[_0x3aa2bd(0x117)](_0x3aa2bd(0x131)+_0x20d68c));}return _0xecfa7e['sort'](),{'after':_0x467341,'changedPaths':_0xecfa7e,'changed':_0xecfa7e[_0x3aa2bd(0x14b)]>0x0};}export function assertExpectation(_0x2e9b2f,_0x5c72b1){const _0x20fe8f=a63_0x59413a;if(!_0x5c72b1)return;for(const [_0x38eb77,_0x485f03]of Object[_0x20fe8f(0x146)](_0x5c72b1)){const _0x319609=_0x2e9b2f[_0x38eb77];if(!deepEqual(_0x319609,_0x485f03))throw CliErrors['validation'](_0x20fe8f(0x152)+_0x38eb77,_0x20fe8f(0x111)+JSON['stringify'](_0x485f03)+_0x20fe8f(0x13f)+JSON[_0x20fe8f(0x149)](_0x319609));}}function a63_0x3ea6(){const _0x27270e=['entries','3551681tBARrD','tableName','stringify','dbName','length','dbtableConfig','No\x20changes\x20for\x20dataset\x20extend','expect-json','POST','patch','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','Expectation\x20mismatch\x20at\x20extend.','Expected\x20','code','string','expect','Dataset\x20extend\x20must\x20be\x20valid\x20JSON\x20object:\x20','datasetName','push','hint','14whkPvn','No\x20dataset\x20extend\x20patch\x20keys\x20are\x20currently\x20supported.','Updated\x20dataset\x20extend\x20(','keys','appCode','join','data','dataset','45538504hOoqpP','trim','extend','name','Patch\x20dataset\x20top-level\x20extend\x20safely','\x20must\x20be\x20a\x20JSON\x20object','has','Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object','from','str','shape','businessGroup','value','--patch-json','extend-update','Use\x20`rabetbase\x20dataset\x20business-group-update`\x20to\x20update\x20business\x20model\x20groups.','extend.','Allowed\x20keys:\x20','6411000avTQCf','isArray','get','sort','datasetCode','306546fJBGwo','3104790nqSdLK','--code\x20is\x20required','patch-json','1877461nQGiqg','message','validation',',\x20actual\x20','7174185IbfDex','parse','modelCode','JSON\x20object\x20patch\x20for\x20dataset\x20top-level\x20extend;\x20current\x20allowlist\x20is\x20empty','\x20must\x20be\x20valid\x20JSON\x20object:\x20','datasetId'];a63_0x3ea6=function(){return _0x27270e;};return a63_0x3ea6();}export async function buildDatasetExtendUpdateResult({appCode:_0x36e626,input:_0x14b39a,dryRun:_0x1c9691}){const _0x3180cd=a63_0x59413a;validateInput(_0x14b39a);const _0x1971b9=await getDatasetDetail(_0x14b39a[_0x3180cd(0x112)]),_0x5e1d89=parseDatasetExtend(_0x1971b9[_0x3180cd(0x123)]),_0x542c0b=deepClone(_0x5e1d89[_0x3180cd(0x12d)]);assertExpectation(_0x542c0b,_0x14b39a[_0x3180cd(0x114)]);const {after:_0x441597,changedPaths:_0x2a66b2,changed:_0x448fb9}=applyExtendPatch(_0x542c0b,_0x14b39a['patch']),_0x53191f=summarizeDataset(_0x1971b9,_0x14b39a['code']);return _0x448fb9&&!_0x1c9691&&(_0x1971b9[_0x3180cd(0x123)]=serializeDatasetExtend(_0x441597,_0x5e1d89[_0x3180cd(0x12b)]),await updateDrivenData(_0x1971b9)),{'ok':!![],'data':{'appCode':_0x36e626,'selector':{'code':_0x14b39a[_0x3180cd(0x112)]},'dataset':_0x53191f,'dryRun':_0x1c9691,'changed':_0x448fb9,'changedPaths':_0x2a66b2,'before':{'extend':_0x542c0b},'after':{'extend':_0x441597},'submitted':_0x448fb9&&!_0x1c9691},'message':_0x448fb9?_0x1c9691?'Dry-run:\x20dataset\x20extend\x20would\x20change\x20('+_0x2a66b2['join'](',\x20')+')':_0x3180cd(0x11b)+_0x2a66b2[_0x3180cd(0x11e)](',\x20')+')':_0x3180cd(0x14d)};}export const datasetExtendUpdate={'service':a63_0x59413a(0x120),'command':a63_0x59413a(0x12f),'description':a63_0x59413a(0x125),'risk':'write','flags':[CODE_FLAG,{'name':a63_0x59413a(0x13b),'type':a63_0x59413a(0x113),'required':!![],'description':a63_0x59413a(0x143)},{'name':a63_0x59413a(0x14e),'type':a63_0x59413a(0x113),'required':![],'description':'JSON\x20object\x20of\x20expected\x20current\x20extend\x20values;\x20mismatch\x20aborts\x20without\x20writing'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x59f9c8){validateInput(readExtendUpdateInput(_0x59f9c8));},async 'dryRun'(_0x4f6be8){const _0xdd2c5=a63_0x59413a,_0x1ed278=await buildDatasetExtendUpdateResult({'appCode':_0x4f6be8[_0xdd2c5(0x11d)],'input':readExtendUpdateInput(_0x4f6be8),'dryRun':!![]});return{'method':_0xdd2c5(0x14f),'url':'/smartapi/dataset/update-driven-data','body':_0x1ed278[_0xdd2c5(0x11f)],'description':_0x1ed278['message']};},async 'execute'(_0x4eb22b){return buildDatasetExtendUpdateResult({'appCode':_0x4eb22b['appCode'],'input':readExtendUpdateInput(_0x4eb22b),'dryRun':![]});}};function readExtendUpdateInput(_0x2ddca5){const _0x19d558=a63_0x59413a,_0x3bacd0=trim(_0x2ddca5[_0x19d558(0x12a)](_0x19d558(0x112))),_0x25cc48=parseJsonObjectFlag(_0x2ddca5[_0x19d558(0x12a)](_0x19d558(0x13b)),_0x19d558(0x12e)),_0x5f3a44=parseJsonObjectFlag(_0x2ddca5[_0x19d558(0x12a)]('expect-json'),'--expect-json');return{'code':_0x3bacd0,'patch':_0x25cc48||{},'expect':_0x5f3a44};}function validateInput(_0xa6198){const _0x543699=a63_0x59413a;if(!_0xa6198[_0x543699(0x112)])throw CliErrors[_0x543699(0x13e)](_0x543699(0x13a));validateExtendPatchKeys(_0xa6198[_0x543699(0x150)]);}function parseDatasetExtend(_0x5b0e66){const _0x5537b0=a63_0x59413a;if(typeof _0x5b0e66===_0x5537b0(0x113)){const _0x11d9d0=_0x5b0e66[_0x5537b0(0x122)]();if(!_0x11d9d0)return{'value':{},'shape':_0x5537b0(0x113)};let _0x334941;try{_0x334941=JSON[_0x5537b0(0x141)](_0x11d9d0);}catch(_0x1cc9ee){const _0x577c01=_0x1cc9ee instanceof Error?_0x1cc9ee[_0x5537b0(0x13d)]:String(_0x1cc9ee);throw CliErrors[_0x5537b0(0x13e)](_0x5537b0(0x115)+_0x577c01);}if(!isPlainObject(_0x334941)||Array['isArray'](_0x334941))throw CliErrors[_0x5537b0(0x13e)](_0x5537b0(0x128));return{'value':_0x334941,'shape':_0x5537b0(0x113)};}if(_0x5b0e66===undefined||_0x5b0e66===null)return{'value':{},'shape':'string'};if(!isPlainObject(_0x5b0e66)||Array[_0x5537b0(0x134)](_0x5b0e66))throw CliErrors[_0x5537b0(0x13e)]('Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object');return{'value':_0x5b0e66,'shape':'object'};}function serializeDatasetExtend(_0x4d7acd,_0x24e36b){const _0x4af1ef=a63_0x59413a;return _0x24e36b===_0x4af1ef(0x113)?JSON[_0x4af1ef(0x149)](_0x4d7acd):_0x4d7acd;}function summarizeDataset(_0x341870,_0x1ca068){const _0x4ef7b8=a63_0x59413a,_0x4869ca=isPlainObject(_0x341870[_0x4ef7b8(0x120)])?_0x341870[_0x4ef7b8(0x120)]:{},_0x331c41=isPlainObject(_0x341870[_0x4ef7b8(0x14c)])?_0x341870[_0x4ef7b8(0x14c)]:{};return{'id':_0x341870['modelId']??_0x341870['id']??_0x4869ca[_0x4ef7b8(0x145)]??null,'code':_0x341870[_0x4ef7b8(0x142)]??_0x341870[_0x4ef7b8(0x112)]??_0x4869ca[_0x4ef7b8(0x137)]??_0x1ca068,'name':_0x341870[_0x4ef7b8(0x124)]??_0x4869ca[_0x4ef7b8(0x116)]??null,'table':_0x331c41['tableName']??_0x4869ca[_0x4ef7b8(0x148)]??null,'db':_0x331c41[_0x4ef7b8(0x14a)]??_0x331c41['dbId']??null};}function deepClone(_0x230dd7){const _0x1bd956=a63_0x59413a;if(_0x230dd7===undefined)return _0x230dd7;return JSON[_0x1bd956(0x141)](JSON['stringify'](_0x230dd7));}function deepEqual(_0x3d0a24,_0x208d81){const _0x53d6de=a63_0x59413a;return JSON[_0x53d6de(0x149)](_0x3d0a24)===JSON[_0x53d6de(0x149)](_0x208d81);}function isPlainObject(_0x52738c){return Boolean(_0x52738c)&&typeof _0x52738c==='object'&&!Array['isArray'](_0x52738c);}function trim(_0x313bb4){const _0x35ab32=a63_0x59413a,_0x293e7f=String(_0x313bb4||'')[_0x35ab32(0x122)]();return _0x293e7f;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a64_0x271f65=a64_0x45d5;(function(_0x877b8b,_0x55a4ee){const _0x33573a=a64_0x45d5,_0x485d2d=_0x877b8b();while(!![]){try{const _0xd366e7=parseInt(_0x33573a(0x1bf))/0x1+parseInt(_0x33573a(0x1e8))/0x2+parseInt(_0x33573a(0x1d1))/0x3*(parseInt(_0x33573a(0x1a9))/0x4)+-parseInt(_0x33573a(0x1db))/0x5+-parseInt(_0x33573a(0x1f4))/0x6*(parseInt(_0x33573a(0x1ce))/0x7)+-parseInt(_0x33573a(0x1cd))/0x8*(parseInt(_0x33573a(0x1e9))/0x9)+parseInt(_0x33573a(0x1dd))/0xa*(parseInt(_0x33573a(0x1d0))/0xb);if(_0xd366e7===_0x55a4ee)break;else _0x485d2d['push'](_0x485d2d['shift']());}catch(_0x6c58f7){_0x485d2d['push'](_0x485d2d['shift']());}}}(a64_0x4039,0xd8ded));import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';const MUTABLE_FIELD_KEYS=new Set([a64_0x271f65(0x1e6),a64_0x271f65(0x1a6),'description',a64_0x271f65(0x1e3),'required',a64_0x271f65(0x1bc),a64_0x271f65(0x1e7),a64_0x271f65(0x1b0),'deprecated']),FORBIDDEN_FIELD_KEYS=new Set(['id',a64_0x271f65(0x1bd),'code',a64_0x271f65(0x1ab),a64_0x271f65(0x1ca),a64_0x271f65(0x1b6),a64_0x271f65(0x1d8),a64_0x271f65(0x1e0),a64_0x271f65(0x1f5),a64_0x271f65(0x1cf),'autoIncrement',a64_0x271f65(0x1d3)]);export function parseJsonObjectFlag(_0x58e6a7,_0x1d57fc){const _0x558cb2=a64_0x271f65;if(!_0x58e6a7)return undefined;let _0x280075;try{_0x280075=JSON[_0x558cb2(0x1aa)](_0x58e6a7);}catch(_0x22dada){const _0x1be9d6=_0x22dada instanceof Error?_0x22dada[_0x558cb2(0x1d2)]:String(_0x22dada);throw CliErrors[_0x558cb2(0x1e5)](_0x1d57fc+'\x20must\x20be\x20valid\x20JSON\x20object:\x20'+_0x1be9d6);}if(!isPlainObject(_0x280075)||Array[_0x558cb2(0x1c8)](_0x280075))throw CliErrors[_0x558cb2(0x1e5)](_0x1d57fc+_0x558cb2(0x1df));return _0x280075;}export function validatePatchKeys(_0x46efeb){const _0x231a04=a64_0x271f65,_0x586bea=Object[_0x231a04(0x1ae)](_0x46efeb);if(_0x586bea[_0x231a04(0x1c5)]===0x0)throw CliErrors['validation'](_0x231a04(0x1b7));for(const _0x411900 of _0x586bea){if(FORBIDDEN_FIELD_KEYS[_0x231a04(0x1c0)](_0x411900))throw CliErrors[_0x231a04(0x1e5)](_0x231a04(0x1bb)+_0x411900);if(!MUTABLE_FIELD_KEYS['has'](_0x411900))throw CliErrors[_0x231a04(0x1e5)](_0x231a04(0x1ac)+_0x411900,_0x231a04(0x1cc)+Array[_0x231a04(0x1c3)](MUTABLE_FIELD_KEYS)['join'](',\x20'));}}function a64_0x4039(){const _0x5006d7=['dbName','dbFieldName','/smartapi/dataset/update-driven-data','object','4599835bFOFKO','write','1040XJCakr','string','\x20must\x20be\x20a\x20JSON\x20object','tableName','datasetCode','size','options','JSON\x20object\x20of\x20expected\x20current\x20field\x20values;\x20mismatch\x20aborts\x20without\x20writing','validation','doType','defaultAggregation','746636LVhbBP','450awjfxV','appCode','findIndex','Exact\x20raw\x20fields[].name\x20to\x20patch','--code\x20is\x20required','patch-json','--field\x20is\x20required','str','POST','stringify','dbtableConfig','2802pplGLo','deleted','displayName','field','add','168rgQgSy','parse','dbType','Unsupported\x20patch\x20key:\x20','--expect-json','keys','JSON\x20object\x20patch;\x20allowed\x20keys:\x20doType/displayName/description/options/required/datetimeFormat/defaultAggregation/chartRole/deprecated','chartRole','patch','\x20would\x20change\x20(','join','datasetName','properties','dbTypeScale','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','modelId','trim','entries','Forbidden\x20patch\x20key:\x20','datetimeFormat','name','dataset','34027iTXVob','has','code',',\x20actual\x20','from','Patch\x20one\x20raw\x20dataset\x20fields[]\x20field\x20object\x20safely','length','Expected\x20','expect-json','isArray','fields','dbTypeLen','Field\x20not\x20found:\x20','Allowed\x20keys:\x20','233968MCKyRq','3633UNjkQe','pkField','254441vDQzak','49998Yodqxy','message','systemRetain','--patch-json','No\x20changes\x20for\x20dataset\x20field\x20','sort'];a64_0x4039=function(){return _0x5006d7;};return a64_0x4039();}export function applyFieldPatch(_0x399f16,_0x9dc86c){const _0x183346=a64_0x271f65;validatePatchKeys(_0x9dc86c);const _0x4aab8f=deepClone(_0x399f16),_0x304a87=new Set();for(const [_0x3a27c7,_0x16d537]of Object[_0x183346(0x1ba)](_0x9dc86c)){const _0x45c949=_0x4aab8f[_0x3a27c7],_0x5813ce=mergePatchValue(_0x45c949,_0x16d537);!deepEqual(_0x45c949,_0x5813ce)&&(_0x4aab8f[_0x3a27c7]=_0x5813ce,_0x304a87[_0x183346(0x1a8)](_0x3a27c7),collectChangedPaths(_0x3a27c7,_0x45c949,_0x5813ce,_0x304a87));}return{'after':_0x4aab8f,'changedPaths':Array[_0x183346(0x1c3)](_0x304a87)[_0x183346(0x1d6)](),'changed':_0x304a87[_0x183346(0x1e2)]>0x0};}export function assertExpectation(_0x7650b2,_0x38035d){const _0x4cf05e=a64_0x271f65;if(!_0x38035d)return;for(const [_0x1fb58a,_0x57ce34]of Object['entries'](_0x38035d)){const _0x53172a=_0x7650b2[_0x1fb58a];if(!deepEqual(_0x53172a,_0x57ce34))throw CliErrors[_0x4cf05e(0x1e5)]('Expectation\x20mismatch\x20at\x20'+_0x1fb58a,_0x4cf05e(0x1c6)+JSON[_0x4cf05e(0x1f2)](_0x57ce34)+_0x4cf05e(0x1c2)+JSON[_0x4cf05e(0x1f2)](_0x53172a));}}export async function buildDatasetFieldUpdateResult({appCode:_0x3b5027,input:_0x57a088,dryRun:_0x36a0f7}){const _0x14b83e=a64_0x271f65;validateInput(_0x57a088);const _0x3aef4c=await getDatasetDetail(_0x57a088[_0x14b83e(0x1c1)]),_0x5e1deb=readFieldArray(_0x3aef4c),_0xa1e347=_0x5e1deb[_0x14b83e(0x1eb)](_0x284ad7=>_0x284ad7?.[_0x14b83e(0x1bd)]===_0x57a088['field']);if(_0xa1e347<0x0)throw CliErrors[_0x14b83e(0x1e5)](_0x14b83e(0x1cb)+_0x57a088['field']);const _0x3baec2=deepClone(_0x5e1deb[_0xa1e347]);assertExpectation(_0x3baec2,_0x57a088['expect']);const {after:_0x55f54b,changedPaths:_0x26277c,changed:_0x30577b}=applyFieldPatch(_0x3baec2,_0x57a088[_0x14b83e(0x1b1)]),_0x3a381c=summarizeDataset(_0x3aef4c,_0x57a088['code']);return _0x30577b&&!_0x36a0f7&&(_0x5e1deb[_0xa1e347]=_0x55f54b,await updateDrivenData(_0x3aef4c)),{'ok':!![],'data':{'appCode':_0x3b5027,'selector':{'code':_0x57a088['code']},'dataset':_0x3a381c,'field':{'id':_0x3baec2['id']??null,'name':_0x3baec2['name']},'dryRun':_0x36a0f7,'changed':_0x30577b,'changedPaths':_0x26277c,'before':_0x3baec2,'after':_0x55f54b,'submitted':_0x30577b&&!_0x36a0f7},'message':_0x30577b?_0x36a0f7?'Dry-run:\x20dataset\x20field\x20'+_0x57a088[_0x14b83e(0x1a7)]+_0x14b83e(0x1b2)+_0x26277c[_0x14b83e(0x1b3)](',\x20')+')':'Updated\x20dataset\x20field\x20'+_0x57a088[_0x14b83e(0x1a7)]+'\x20('+_0x26277c[_0x14b83e(0x1b3)](',\x20')+')':_0x14b83e(0x1d5)+_0x57a088['field']};}export const datasetFieldUpdate={'service':a64_0x271f65(0x1be),'command':'field-update','description':a64_0x271f65(0x1c4),'risk':a64_0x271f65(0x1dc),'flags':[CODE_FLAG,{'name':'field','type':a64_0x271f65(0x1de),'required':!![],'description':a64_0x271f65(0x1ec)},{'name':a64_0x271f65(0x1ee),'type':a64_0x271f65(0x1de),'required':!![],'description':a64_0x271f65(0x1af)},{'name':a64_0x271f65(0x1c7),'type':a64_0x271f65(0x1de),'required':![],'description':a64_0x271f65(0x1e4)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x4a280a){validateInput(readFieldUpdateInput(_0x4a280a));},async 'dryRun'(_0x2d6932){const _0x282988=a64_0x271f65,_0x3c7833=await buildDatasetFieldUpdateResult({'appCode':_0x2d6932[_0x282988(0x1ea)],'input':readFieldUpdateInput(_0x2d6932),'dryRun':!![]});return{'method':_0x282988(0x1f1),'url':_0x282988(0x1d9),'body':_0x3c7833['data'],'description':_0x3c7833[_0x282988(0x1d2)]};},async 'execute'(_0x5db709){const _0x227f99=a64_0x271f65;return buildDatasetFieldUpdateResult({'appCode':_0x5db709[_0x227f99(0x1ea)],'input':readFieldUpdateInput(_0x5db709),'dryRun':![]});}};function readFieldUpdateInput(_0x33055f){const _0x527e80=a64_0x271f65,_0x5b4c58=trim(_0x33055f[_0x527e80(0x1f0)](_0x527e80(0x1c1))),_0x504391=emptyToUndefined(_0x33055f[_0x527e80(0x1f0)](_0x527e80(0x1a7))),_0x286249=parseJsonObjectFlag(_0x33055f[_0x527e80(0x1f0)]('patch-json'),_0x527e80(0x1d4)),_0xf01ea8=parseJsonObjectFlag(_0x33055f[_0x527e80(0x1f0)](_0x527e80(0x1c7)),_0x527e80(0x1ad));return{'code':_0x5b4c58,'field':_0x504391||'','patch':_0x286249||{},'expect':_0xf01ea8};}function validateInput(_0x319144){const _0x3fe6a1=a64_0x271f65;if(!_0x319144[_0x3fe6a1(0x1c1)])throw CliErrors['validation'](_0x3fe6a1(0x1ed));if(!_0x319144[_0x3fe6a1(0x1a7)])throw CliErrors['validation'](_0x3fe6a1(0x1ef));validatePatchKeys(_0x319144[_0x3fe6a1(0x1b1)]);}function readFieldArray(_0x38c7d2){const _0x30dfc4=a64_0x271f65;if(Array[_0x30dfc4(0x1c8)](_0x38c7d2['fields']))return _0x38c7d2[_0x30dfc4(0x1c9)];if(Array[_0x30dfc4(0x1c8)](_0x38c7d2[_0x30dfc4(0x1b5)]))return _0x38c7d2['properties'];throw CliErrors[_0x30dfc4(0x1e5)]('Driven\x20data\x20does\x20not\x20contain\x20fields[]\x20or\x20properties[]');}function summarizeDataset(_0x53d615,_0x135593){const _0x3ce85f=a64_0x271f65,_0x13137c=isPlainObject(_0x53d615['dataset'])?_0x53d615['dataset']:{},_0x3c3e84=isPlainObject(_0x53d615[_0x3ce85f(0x1f3)])?_0x53d615['dbtableConfig']:{};return{'id':_0x53d615[_0x3ce85f(0x1b8)]??_0x53d615['id']??_0x13137c['datasetId']??null,'code':_0x53d615['modelCode']??_0x53d615['code']??_0x13137c[_0x3ce85f(0x1e1)]??_0x135593,'name':_0x53d615['name']??_0x13137c[_0x3ce85f(0x1b4)]??null,'table':_0x3c3e84[_0x3ce85f(0x1e0)]??_0x13137c[_0x3ce85f(0x1e0)]??null,'db':_0x3c3e84[_0x3ce85f(0x1d7)]??_0x3c3e84['dbId']??null};}function mergePatchValue(_0xc25cca,_0x12b321){if(isPlainObject(_0xc25cca)&&isPlainObject(_0x12b321))return deepMerge(_0xc25cca,_0x12b321);return deepClone(_0x12b321);}function deepMerge(_0x2d7f8a,_0x38a929){const _0x2bd9d9=deepClone(_0x2d7f8a);for(const [_0x24bbf4,_0x1a34a2]of Object['entries'](_0x38a929)){_0x2bd9d9[_0x24bbf4]=isPlainObject(_0x2bd9d9[_0x24bbf4])&&isPlainObject(_0x1a34a2)?deepMerge(_0x2bd9d9[_0x24bbf4],_0x1a34a2):deepClone(_0x1a34a2);}return _0x2bd9d9;}function collectChangedPaths(_0x3c2f87,_0x46c2c0,_0x345e33,_0x3f002b){const _0x4d554c=a64_0x271f65;if(!isPlainObject(_0x46c2c0)||!isPlainObject(_0x345e33))return;const _0x3d643a=new Set([...Object[_0x4d554c(0x1ae)](_0x46c2c0),...Object[_0x4d554c(0x1ae)](_0x345e33)]);for(const _0x4e5136 of _0x3d643a){const _0x3d0280=_0x46c2c0[_0x4e5136],_0x1078f4=_0x345e33[_0x4e5136];!deepEqual(_0x3d0280,_0x1078f4)&&_0x3f002b['add'](_0x3c2f87+'.'+_0x4e5136);}}function deepClone(_0x2c91e1){const _0x44ee0f=a64_0x271f65;if(_0x2c91e1===undefined)return _0x2c91e1;return JSON[_0x44ee0f(0x1aa)](JSON['stringify'](_0x2c91e1));}function deepEqual(_0x416cf5,_0x3bdc76){const _0x565de4=a64_0x271f65;return JSON[_0x565de4(0x1f2)](_0x416cf5)===JSON[_0x565de4(0x1f2)](_0x3bdc76);}function isPlainObject(_0x2bc616){const _0x4981b1=a64_0x271f65;return Boolean(_0x2bc616)&&typeof _0x2bc616===_0x4981b1(0x1da)&&!Array[_0x4981b1(0x1c8)](_0x2bc616);}function a64_0x45d5(_0x4dbc72,_0xcfd25e){_0x4dbc72=_0x4dbc72-0x1a6;const _0x40392b=a64_0x4039();let _0x45d56e=_0x40392b[_0x4dbc72];return _0x45d56e;}function emptyToUndefined(_0x457e33){const _0x2a0029=a64_0x271f65,_0x518535=String(_0x457e33||'')[_0x2a0029(0x1b9)]();return _0x518535||undefined;}function trim(_0x5c143a){const _0x553518=a64_0x271f65;return String(_0x5c143a||'')[_0x553518(0x1b9)]();}
|
|
1
|
+
const a64_0x126eee=a64_0x4902;(function(_0x227d72,_0x326846){const _0x5e8793=a64_0x4902,_0x499c3d=_0x227d72();while(!![]){try{const _0x23985f=-parseInt(_0x5e8793(0x23c))/0x1*(-parseInt(_0x5e8793(0x201))/0x2)+-parseInt(_0x5e8793(0x1f2))/0x3+parseInt(_0x5e8793(0x1f5))/0x4*(parseInt(_0x5e8793(0x204))/0x5)+parseInt(_0x5e8793(0x228))/0x6+parseInt(_0x5e8793(0x20f))/0x7+-parseInt(_0x5e8793(0x238))/0x8+-parseInt(_0x5e8793(0x205))/0x9*(-parseInt(_0x5e8793(0x224))/0xa);if(_0x23985f===_0x326846)break;else _0x499c3d['push'](_0x499c3d['shift']());}catch(_0x20d1ef){_0x499c3d['push'](_0x499c3d['shift']());}}}(a64_0x5b7c,0xcbc70));import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';const MUTABLE_FIELD_KEYS=new Set([a64_0x126eee(0x1f8),'displayName',a64_0x126eee(0x209),'options',a64_0x126eee(0x230),'datetimeFormat','defaultAggregation',a64_0x126eee(0x223),a64_0x126eee(0x1f9)]),FORBIDDEN_FIELD_KEYS=new Set(['id',a64_0x126eee(0x1fc),a64_0x126eee(0x231),a64_0x126eee(0x1f7),a64_0x126eee(0x227),'dbTypeScale','dbFieldName',a64_0x126eee(0x206),a64_0x126eee(0x214),a64_0x126eee(0x1f3),'autoIncrement','systemRetain']);function a64_0x4902(_0x1cd768,_0x57d77d){_0x1cd768=_0x1cd768-0x1f2;const _0x5b7c3a=a64_0x5b7c();let _0x490277=_0x5b7c3a[_0x1cd768];return _0x490277;}export function parseJsonObjectFlag(_0x37b7b5,_0x105d23){const _0x73ae7=a64_0x126eee;if(!_0x37b7b5)return undefined;let _0x3d2240;try{_0x3d2240=JSON['parse'](_0x37b7b5);}catch(_0x4ceec7){const _0x513512=_0x4ceec7 instanceof Error?_0x4ceec7[_0x73ae7(0x220)]:String(_0x4ceec7);throw CliErrors[_0x73ae7(0x200)](_0x105d23+_0x73ae7(0x212)+_0x513512);}if(!isPlainObject(_0x3d2240)||Array[_0x73ae7(0x22a)](_0x3d2240))throw CliErrors[_0x73ae7(0x200)](_0x105d23+'\x20must\x20be\x20a\x20JSON\x20object');return _0x3d2240;}export function validatePatchKeys(_0x2a3d24){const _0x302162=a64_0x126eee,_0x229f57=Object[_0x302162(0x221)](_0x2a3d24);if(_0x229f57[_0x302162(0x1f4)]===0x0)throw CliErrors['validation'](_0x302162(0x208));for(const _0x5d24f4 of _0x229f57){if(FORBIDDEN_FIELD_KEYS['has'](_0x5d24f4))throw CliErrors[_0x302162(0x200)](_0x302162(0x225)+_0x5d24f4);if(!MUTABLE_FIELD_KEYS[_0x302162(0x203)](_0x5d24f4))throw CliErrors[_0x302162(0x200)](_0x302162(0x1fa)+_0x5d24f4,_0x302162(0x23d)+Array[_0x302162(0x22e)](MUTABLE_FIELD_KEYS)[_0x302162(0x1f6)](',\x20'));}}export function applyFieldPatch(_0x58aab0,_0x3964f9){const _0x455e2b=a64_0x126eee;validatePatchKeys(_0x3964f9);const _0x29dcc0=deepClone(_0x58aab0),_0x4e237e=new Set();for(const [_0x5ea9a5,_0x9d1af7]of Object[_0x455e2b(0x222)](_0x3964f9)){const _0x5d1e35=_0x29dcc0[_0x5ea9a5],_0x37898c=mergePatchValue(_0x5d1e35,_0x9d1af7);!deepEqual(_0x5d1e35,_0x37898c)&&(_0x29dcc0[_0x5ea9a5]=_0x37898c,_0x4e237e[_0x455e2b(0x20c)](_0x5ea9a5),collectChangedPaths(_0x5ea9a5,_0x5d1e35,_0x37898c,_0x4e237e));}return{'after':_0x29dcc0,'changedPaths':Array[_0x455e2b(0x22e)](_0x4e237e)[_0x455e2b(0x23f)](),'changed':_0x4e237e[_0x455e2b(0x235)]>0x0};}export function assertExpectation(_0x1df3b0,_0x35f492){const _0xb09524=a64_0x126eee;if(!_0x35f492)return;for(const [_0x582ad0,_0x24dc48]of Object[_0xb09524(0x222)](_0x35f492)){const _0x2cbdab=_0x1df3b0[_0x582ad0];if(!deepEqual(_0x2cbdab,_0x24dc48))throw CliErrors['validation'](_0xb09524(0x216)+_0x582ad0,_0xb09524(0x211)+JSON[_0xb09524(0x21d)](_0x24dc48)+_0xb09524(0x20e)+JSON[_0xb09524(0x21d)](_0x2cbdab));}}export async function buildDatasetFieldUpdateResult({appCode:_0x17ff64,input:_0x5b172d,dryRun:_0x2e20ce}){const _0x191ba2=a64_0x126eee;validateInput(_0x5b172d);const _0x1f3db0=await getDatasetDetail(_0x5b172d['code']),_0x1910bc=readFieldArray(_0x1f3db0),_0x456d70=_0x1910bc[_0x191ba2(0x23e)](_0x2cd017=>_0x2cd017?.['name']===_0x5b172d[_0x191ba2(0x1fb)]);if(_0x456d70<0x0)throw CliErrors[_0x191ba2(0x200)]('Field\x20not\x20found:\x20'+_0x5b172d['field']);const _0x4b7f9c=deepClone(_0x1910bc[_0x456d70]);assertExpectation(_0x4b7f9c,_0x5b172d[_0x191ba2(0x21b)]);const {after:_0x566604,changedPaths:_0x162b6d,changed:_0x19eedf}=applyFieldPatch(_0x4b7f9c,_0x5b172d[_0x191ba2(0x218)]),_0x3b2f11=summarizeDataset(_0x1f3db0,_0x5b172d[_0x191ba2(0x231)]);return _0x19eedf&&!_0x2e20ce&&(_0x1910bc[_0x456d70]=_0x566604,await updateDrivenData(_0x1f3db0)),{'ok':!![],'data':{'appCode':_0x17ff64,'selector':{'code':_0x5b172d['code']},'dataset':_0x3b2f11,'field':{'id':_0x4b7f9c['id']??null,'name':_0x4b7f9c['name']},'dryRun':_0x2e20ce,'changed':_0x19eedf,'changedPaths':_0x162b6d,'before':_0x4b7f9c,'after':_0x566604,'submitted':_0x19eedf&&!_0x2e20ce},'message':_0x19eedf?_0x2e20ce?'Dry-run:\x20dataset\x20field\x20'+_0x5b172d[_0x191ba2(0x1fb)]+_0x191ba2(0x22c)+_0x162b6d['join'](',\x20')+')':_0x191ba2(0x21c)+_0x5b172d[_0x191ba2(0x1fb)]+'\x20('+_0x162b6d[_0x191ba2(0x1f6)](',\x20')+')':'No\x20changes\x20for\x20dataset\x20field\x20'+_0x5b172d[_0x191ba2(0x1fb)]};}export const datasetFieldUpdate={'service':a64_0x126eee(0x21a),'command':a64_0x126eee(0x1fd),'description':'Patch\x20one\x20raw\x20dataset\x20fields[]\x20field\x20object\x20safely','risk':a64_0x126eee(0x233),'flags':[CODE_FLAG,{'name':a64_0x126eee(0x1fb),'type':a64_0x126eee(0x22b),'required':!![],'description':a64_0x126eee(0x207)},{'name':a64_0x126eee(0x215),'type':'string','required':!![],'description':a64_0x126eee(0x213)},{'name':a64_0x126eee(0x21e),'type':a64_0x126eee(0x22b),'required':![],'description':a64_0x126eee(0x23a)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x487b39){validateInput(readFieldUpdateInput(_0x487b39));},async 'dryRun'(_0x37d5a5){const _0x15d6ab=a64_0x126eee,_0x128ddb=await buildDatasetFieldUpdateResult({'appCode':_0x37d5a5['appCode'],'input':readFieldUpdateInput(_0x37d5a5),'dryRun':!![]});return{'method':_0x15d6ab(0x237),'url':_0x15d6ab(0x219),'body':_0x128ddb[_0x15d6ab(0x236)],'description':_0x128ddb[_0x15d6ab(0x220)]};},async 'execute'(_0xa4c910){const _0x528a32=a64_0x126eee;return buildDatasetFieldUpdateResult({'appCode':_0xa4c910[_0x528a32(0x234)],'input':readFieldUpdateInput(_0xa4c910),'dryRun':![]});}};function readFieldUpdateInput(_0x59ab00){const _0x28a45b=a64_0x126eee,_0x249f9d=trim(_0x59ab00['str'](_0x28a45b(0x231))),_0x4afb8f=emptyToUndefined(_0x59ab00['str']('field')),_0x4511a5=parseJsonObjectFlag(_0x59ab00[_0x28a45b(0x202)]('patch-json'),'--patch-json'),_0x895ce6=parseJsonObjectFlag(_0x59ab00[_0x28a45b(0x202)](_0x28a45b(0x21e)),_0x28a45b(0x20a));return{'code':_0x249f9d,'field':_0x4afb8f||'','patch':_0x4511a5||{},'expect':_0x895ce6};}function validateInput(_0x1cdb33){const _0x5e2644=a64_0x126eee;if(!_0x1cdb33[_0x5e2644(0x231)])throw CliErrors[_0x5e2644(0x200)](_0x5e2644(0x1ff));if(!_0x1cdb33[_0x5e2644(0x1fb)])throw CliErrors['validation'](_0x5e2644(0x232));validatePatchKeys(_0x1cdb33['patch']);}function readFieldArray(_0x3017ae){const _0x4acd0a=a64_0x126eee;if(Array[_0x4acd0a(0x22a)](_0x3017ae[_0x4acd0a(0x1fe)]))return _0x3017ae['fields'];if(Array[_0x4acd0a(0x22a)](_0x3017ae[_0x4acd0a(0x21f)]))return _0x3017ae['properties'];throw CliErrors['validation'](_0x4acd0a(0x226));}function summarizeDataset(_0x3b1ed7,_0x4a05b8){const _0x140612=a64_0x126eee,_0x41e57e=isPlainObject(_0x3b1ed7['dataset'])?_0x3b1ed7['dataset']:{},_0xd3c87a=isPlainObject(_0x3b1ed7[_0x140612(0x210)])?_0x3b1ed7['dbtableConfig']:{};return{'id':_0x3b1ed7[_0x140612(0x22f)]??_0x3b1ed7['id']??_0x41e57e[_0x140612(0x229)]??null,'code':_0x3b1ed7[_0x140612(0x20b)]??_0x3b1ed7['code']??_0x41e57e[_0x140612(0x217)]??_0x4a05b8,'name':_0x3b1ed7[_0x140612(0x1fc)]??_0x41e57e['datasetName']??null,'table':_0xd3c87a[_0x140612(0x206)]??_0x41e57e[_0x140612(0x206)]??null,'db':_0xd3c87a['dbName']??_0xd3c87a[_0x140612(0x20d)]??null};}function a64_0x5b7c(){const _0x5a6ab2=['7731464YpFkTg','parse','JSON\x20object\x20of\x20expected\x20current\x20field\x20values;\x20mismatch\x20aborts\x20without\x20writing','object','19913kYLpGt','Allowed\x20keys:\x20','findIndex','sort','4884186TzCtlU','pkField','length','120VKNNbS','join','dbType','doType','deprecated','Unsupported\x20patch\x20key:\x20','field','name','field-update','fields','--code\x20is\x20required','validation','66fwVouI','str','has','204275UNyShV','9WkgAKz','tableName','Exact\x20raw\x20fields[].name\x20to\x20patch','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','description','--expect-json','modelCode','add','dbId',',\x20actual\x20','3206420yErPbZ','dbtableConfig','Expected\x20','\x20must\x20be\x20valid\x20JSON\x20object:\x20','JSON\x20object\x20patch;\x20allowed\x20keys:\x20doType/displayName/description/options/required/datetimeFormat/defaultAggregation/chartRole/deprecated','deleted','patch-json','Expectation\x20mismatch\x20at\x20','datasetCode','patch','/smartapi/dataset/update-driven-data','dataset','expect','Updated\x20dataset\x20field\x20','stringify','expect-json','properties','message','keys','entries','chartRole','6781550LaPYQC','Forbidden\x20patch\x20key:\x20','Driven\x20data\x20does\x20not\x20contain\x20fields[]\x20or\x20properties[]','dbTypeLen','2461038KbWtpk','datasetId','isArray','string','\x20would\x20change\x20(','trim','from','modelId','required','code','--field\x20is\x20required','write','appCode','size','data','POST'];a64_0x5b7c=function(){return _0x5a6ab2;};return a64_0x5b7c();}function mergePatchValue(_0x4f7d20,_0x295aee){if(isPlainObject(_0x4f7d20)&&isPlainObject(_0x295aee))return deepMerge(_0x4f7d20,_0x295aee);return deepClone(_0x295aee);}function deepMerge(_0x5aa9a5,_0x2a5f80){const _0x2e0922=a64_0x126eee,_0x33c245=deepClone(_0x5aa9a5);for(const [_0x340e10,_0x49ceeb]of Object[_0x2e0922(0x222)](_0x2a5f80)){_0x33c245[_0x340e10]=isPlainObject(_0x33c245[_0x340e10])&&isPlainObject(_0x49ceeb)?deepMerge(_0x33c245[_0x340e10],_0x49ceeb):deepClone(_0x49ceeb);}return _0x33c245;}function collectChangedPaths(_0x2c65c3,_0x3042ab,_0x2ab3c8,_0x20ec64){const _0x411b54=a64_0x126eee;if(!isPlainObject(_0x3042ab)||!isPlainObject(_0x2ab3c8))return;const _0x41a72f=new Set([...Object['keys'](_0x3042ab),...Object[_0x411b54(0x221)](_0x2ab3c8)]);for(const _0x539a5e of _0x41a72f){const _0x948973=_0x3042ab[_0x539a5e],_0x4cd612=_0x2ab3c8[_0x539a5e];!deepEqual(_0x948973,_0x4cd612)&&_0x20ec64[_0x411b54(0x20c)](_0x2c65c3+'.'+_0x539a5e);}}function deepClone(_0x15c1cb){const _0x57c536=a64_0x126eee;if(_0x15c1cb===undefined)return _0x15c1cb;return JSON[_0x57c536(0x239)](JSON[_0x57c536(0x21d)](_0x15c1cb));}function deepEqual(_0x357f91,_0x52af4f){const _0x430eb8=a64_0x126eee;return JSON[_0x430eb8(0x21d)](_0x357f91)===JSON[_0x430eb8(0x21d)](_0x52af4f);}function isPlainObject(_0x4f2fbd){const _0x41a0e9=a64_0x126eee;return Boolean(_0x4f2fbd)&&typeof _0x4f2fbd===_0x41a0e9(0x23b)&&!Array[_0x41a0e9(0x22a)](_0x4f2fbd);}function emptyToUndefined(_0x5df7b5){const _0x3f0094=a64_0x126eee,_0x5b6341=String(_0x5df7b5||'')[_0x3f0094(0x22d)]();return _0x5b6341||undefined;}function trim(_0x1a9b41){return String(_0x1a9b41||'')['trim']();}
|