@lovrabet/rabetbase-cli 2.3.1-beta.2 → 2.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/discover.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app/use.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/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-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a49_0x5534(_0xfde80d,_0x4030aa){_0xfde80d=_0xfde80d-0x153;const _0x1a746c=a49_0x1a74();let _0x553486=_0x1a746c[_0xfde80d];return _0x553486;}function a49_0x1a74(){const _0x2455ab=['24406gRVLLm','1076728pjDGrd','7566SPIGQY','1135CJcZbo','4066425MzXeQy','3218100TjnriH','5776TitvKN','6176577Naezob','7mjAeMw','888XHauBK','1mekEmJ'];a49_0x1a74=function(){return _0x2455ab;};return a49_0x1a74();}(function(_0x3d1ee1,_0x24f580){const _0x1819a7=a49_0x5534,_0x557be2=_0x3d1ee1();while(!![]){try{const _0x837bf=parseInt(_0x1819a7(0x15a))/0x1*(parseInt(_0x1819a7(0x15b))/0x2)+-parseInt(_0x1819a7(0x159))/0x3*(-parseInt(_0x1819a7(0x156))/0x4)+parseInt(_0x1819a7(0x153))/0x5*(parseInt(_0x1819a7(0x15d))/0x6)+-parseInt(_0x1819a7(0x158))/0x7*(-parseInt(_0x1819a7(0x15c))/0x8)+-parseInt(_0x1819a7(0x154))/0x9+-parseInt(_0x1819a7(0x155))/0xa+parseInt(_0x1819a7(0x157))/0xb;if(_0x837bf===_0x24f580)break;else _0x557be2['push'](_0x557be2['shift']());}catch(_0x27028c){_0x557be2['push'](_0x557be2['shift']());}}}(a49_0x1a74,0x9e491));import{configListDefinition}from'../../commands/config/list.js';import{configGetDefinition}from'../../commands/config/get.js';import{configSetDefinition}from'../../commands/config/set.js';export const configDefinitions=[configListDefinition,configGetDefinition,configSetDefinition];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a50_0x383c5f=a50_0x18d2;(function(_0xd3ed4a,_0x286f8b){const _0x5a0fe9=a50_0x18d2,_0x16f371=_0xd3ed4a();while(!![]){try{const _0x547e92=-parseInt(_0x5a0fe9(0x1e9))/0x1*(-parseInt(_0x5a0fe9(0x1e2))/0x2)+parseInt(_0x5a0fe9(0x1ed))/0x3*(-parseInt(_0x5a0fe9(0x1e4))/0x4)+-parseInt(_0x5a0fe9(0x1e3))/0x5+parseInt(_0x5a0fe9(0x1f0))/0x6*(parseInt(_0x5a0fe9(0x1de))/0x7)+-parseInt(_0x5a0fe9(0x1e6))/0x8*(-parseInt(_0x5a0fe9(0x1e1))/0x9)+parseInt(_0x5a0fe9(0x1ee))/0xa*(-parseInt(_0x5a0fe9(0x1e8))/0xb)+parseInt(_0x5a0fe9(0x1e0))/0xc;if(_0x547e92===_0x286f8b)break;else _0x16f371['push'](_0x16f371['shift']());}catch(_0x5bff3){_0x16f371['push'](_0x16f371['shift']());}}}(a50_0x7660,0x9dde7));import{readScopedConfig}from'../../commands/config/shared.js';import{readConfig}from'../../utils/config.js';async function execute(_0x46bb9e){const _0x337460=a50_0x18d2,_0x4fa33a=_0x46bb9e[_0x337460(0x1eb)](_0x337460(0x1ec))?readScopedConfig('global'):readConfig();return{'ok':!![],'data':_0x4fa33a};}function a50_0x18d2(_0x21ee80,_0x48f1b3){_0x21ee80=_0x21ee80-0x1de;const _0x7660f6=a50_0x7660();let _0x18d27c=_0x7660f6[_0x21ee80];return _0x18d27c;}export const configListDefinition={'service':a50_0x383c5f(0x1e7),'command':a50_0x383c5f(0x1ea),'description':a50_0x383c5f(0x1e5),'risk':'read','requiresAuth':![],'requiresAppCode':![],'flags':[{'name':a50_0x383c5f(0x1ec),'type':a50_0x383c5f(0x1ef),'description':a50_0x383c5f(0x1df),'default':![]}],'execute':execute};function a50_0x7660(){const _0x32f5ae=['630347oUBgBb','list','bool','global','9SzDTTk','134360xgUzmi','boolean','24mpTCkX','773626hLsqPF','Show\x20global\x20config\x20only\x20(~/.rabetbase.json)','13942560ldZMZR','117cJnUht','2uDtVSr','2741960amfKOw','1068036FwIsSS','List\x20all\x20config\x20values','465240pnuxiS','config','814qcEFfe'];a50_0x7660=function(){return _0x32f5ae;};return a50_0x7660();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a51_0x43843b=a51_0x4dd2;(function(_0x56a5c4,_0x4a3ae6){const _0x82f665=a51_0x4dd2,_0x5094dc=_0x56a5c4();while(!![]){try{const _0x3dd171=-parseInt(_0x82f665(0xf5))/0x1*(parseInt(_0x82f665(0x122))/0x2)+parseInt(_0x82f665(0x113))/0x3+parseInt(_0x82f665(0x115))/0x4*(-parseInt(_0x82f665(0xf7))/0x5)+parseInt(_0x82f665(0xfb))/0x6*(-parseInt(_0x82f665(0x11f))/0x7)+parseInt(_0x82f665(0xfd))/0x8*(parseInt(_0x82f665(0x104))/0x9)+-parseInt(_0x82f665(0x10d))/0xa*(-parseInt(_0x82f665(0x11a))/0xb)+parseInt(_0x82f665(0xff))/0xc;if(_0x3dd171===_0x4a3ae6)break;else _0x5094dc['push'](_0x5094dc['shift']());}catch(_0x1fb9a1){_0x5094dc['push'](_0x5094dc['shift']());}}}(a51_0x48aa,0x2e366));function a51_0x4dd2(_0x74ac4d,_0x5e5ca5){_0x74ac4d=_0x74ac4d-0xef;const _0x48aa94=a51_0x48aa();let _0x4dd242=_0x48aa94[_0x74ac4d];return _0x4dd242;}import{CliErrors}from'../../errors.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';import{CLI_BIN_NAME,CONFIG_ENUM_VALUES,getConfigCommandKeyDescription,getTopLevelConfigKeySummary,isTopLevelConfigKey,normalizeLocale,resolveWriteScope,readScopedConfig,writeScopedConfig}from'../../commands/config/shared.js';import{normalizeEnv,isProduction,isDaily}from'../../constant/env.js';async function execute(_0x5c073e){const _0x4364b6=a51_0x4dd2,_0x76166b=_0x5c073e[_0x4364b6(0x105)](_0x4364b6(0x11e)),_0x4688a8=_0x5c073e[_0x4364b6(0x105)](_0x4364b6(0x102));if(!_0x76166b)throw CliErrors['validation']('Missing\x20key.',_0x4364b6(0xf8)+CLI_BIN_NAME+'\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>');if(_0x4688a8===undefined||_0x4688a8==='')throw CliErrors[_0x4364b6(0x110)]('Missing\x20value.',_0x4364b6(0xf8)+CLI_BIN_NAME+_0x4364b6(0x10b));if(_0x4688a8['length']>0x1f4)throw CliErrors[_0x4364b6(0x110)](_0x4364b6(0xf1));if(!isTopLevelConfigKey(_0x76166b))throw CliErrors[_0x4364b6(0x110)](_0x4364b6(0xf0)+_0x76166b+_0x4364b6(0xf9),_0x4364b6(0x117)+getTopLevelConfigKeySummary());if(_0x76166b===_0x4364b6(0x103))throw CliErrors[_0x4364b6(0x110)](_0x4364b6(0xfa));if(CONFIG_ENUM_VALUES[_0x76166b]&&!CONFIG_ENUM_VALUES[_0x76166b]['includes'](_0x4688a8))throw CliErrors[_0x4364b6(0x110)](_0x4364b6(0xef)+_0x76166b+_0x4364b6(0xfc)+CONFIG_ENUM_VALUES[_0x76166b]['join'](',\x20'));if(_0x76166b===_0x4364b6(0x118)&&!normalizeLocale(_0x4688a8))throw CliErrors['validation']('Invalid\x20locale\x20value.',_0x4364b6(0x11d));const _0x1422c1={'global':_0x5c073e[_0x4364b6(0xf2)](_0x4364b6(0xf4))},_0x4d7554=resolveWriteScope(_0x1422c1),_0x2105b4=readScopedConfig(_0x4d7554);let _0x4329db=_0x76166b,_0x43d15d=_0x4688a8;_0x76166b==='app'&&(_0x4329db=_0x4364b6(0x101),delete _0x2105b4[_0x4364b6(0x114)]);_0x76166b===_0x4364b6(0x118)&&(_0x43d15d=normalizeLocale(_0x4688a8));if(_0x76166b==='env'){_0x43d15d=normalizeEnv(_0x4688a8);if(!isProduction(_0x43d15d)&&!isDaily(_0x43d15d))throw CliErrors[_0x4364b6(0x110)](_0x4364b6(0x10a),_0x4364b6(0x106));}if(_0x76166b==='appcode'){const _0x14b150=_0x2105b4[_0x4364b6(0x109)]&&typeof _0x2105b4[_0x4364b6(0x109)]===_0x4364b6(0x11b)?Object['keys'](_0x2105b4['apps']):[];if(_0x14b150[_0x4364b6(0x112)]>0x0)throw CliErrors[_0x4364b6(0x110)]('Cannot\x20set\x20top-level\x20\x22appcode\x22\x20when\x20multi-app\x20config\x20already\x20exists.',_0x4364b6(0x10e)+CLI_BIN_NAME+_0x4364b6(0x111)+_0x43d15d+'`,\x20`'+CLI_BIN_NAME+'\x20app\x20use\x20<name>`,\x20or\x20pass\x20`--appcode`\x20on\x20the\x20command.');const _0x5caf36=buildCanonicalProjectConfig({..._0x2105b4},{'appCodes':[_0x43d15d],'env':typeof _0x2105b4[_0x4364b6(0xfe)]==='string'?_0x2105b4[_0x4364b6(0xfe)]:undefined});writeScopedConfig(_0x5caf36,_0x4d7554);const _0x307569=_0x4d7554===_0x4364b6(0xf4)?_0x4364b6(0x100):_0x4364b6(0x116);return{'ok':!![],'message':'✓\x20'+_0x307569+_0x4364b6(0x107)+_0x43d15d+_0x4364b6(0x10f)};}_0x2105b4[_0x4329db]=_0x43d15d,writeScopedConfig(_0x2105b4,_0x4d7554);const _0x2e1682=_0x4d7554===_0x4364b6(0xf4)?'Global':_0x4364b6(0x116);return{'ok':!![],'message':'✓\x20'+_0x2e1682+'\x20'+_0x4329db+_0x4364b6(0xf3)+_0x43d15d};}function a51_0x48aa(){const _0x1699c6=['appcode','value','riskLevel','153qweQAM','str','Legacy\x20alias\x20\x22online\x22\x20is\x20accepted\x20and\x20stored\x20as\x20production.','\x20appcode\x20set\x20to:\x20','config','apps','Invalid\x20value\x20for\x20env.\x20Allowed:\x20production,\x20daily.','\x20config\x20set\x20--key\x20<key>\x20--value\x20<value>','string','2010KBrIoX','Use\x20`','\x20(stored\x20as\x20apps\x20+\x20defaultApp)','validation','\x20app\x20add\x20<name>\x20--appcode\x20','length','34149AicCmC','app','4KRxVwk','Project','Settable\x20top-level\x20keys:\x20','locale','Config\x20value','11451gJToly','object','write','Supported:\x20zh,\x20en,\x20zh-CN,\x20en-US','key','7Zlkofi','Write\x20to\x20global\x20config\x20(~/.rabetbase.json)','Set\x20a\x20config\x20value','191236KBzkFD','Invalid\x20value\x20for\x20\x22','Top-level\x20key\x20\x22','Config\x20value\x20is\x20invalid\x20or\x20too\x20long.','bool','\x20set\x20to:\x20','global','2MwrDdF','set','1528665fXraon','Usage:\x20','\x22\x20is\x20not\x20settable.','\x22riskLevel\x22\x20cannot\x20be\x20changed\x20via\x20the\x20CLI.','2199210guUlkD','\x22.\x20Allowed:\x20','135752SvqcPs','env','6524316oCkgTt','Global'];a51_0x48aa=function(){return _0x1699c6;};return a51_0x48aa();}export const configSetDefinition={'service':a51_0x43843b(0x108),'command':a51_0x43843b(0xf6),'description':a51_0x43843b(0x121),'risk':a51_0x43843b(0x11c),'requiresAuth':![],'requiresAppCode':![],'flags':[{'name':'key','type':a51_0x43843b(0x10c),'description':getConfigCommandKeyDescription(),'required':!![]},{'name':'value','type':a51_0x43843b(0x10c),'description':a51_0x43843b(0x119),'required':!![]},{'name':'global','type':'boolean','description':a51_0x43843b(0x120),'default':![]}],'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x3e484a,_0x5f093b){var _0x35c780=a52_0x2669,_0x17f17d=_0x3e484a();while(!![]){try{var _0x4238cf=parseInt(_0x35c780(0x12c))/0x1*(parseInt(_0x35c780(0x11f))/0x2)+-parseInt(_0x35c780(0x120))/0x3*(parseInt(_0x35c780(0x12b))/0x4)+-parseInt(_0x35c780(0x12d))/0x5*(parseInt(_0x35c780(0x12a))/0x6)+-parseInt(_0x35c780(0x123))/0x7*(-parseInt(_0x35c780(0x128))/0x8)+-parseInt(_0x35c780(0x129))/0x9+parseInt(_0x35c780(0x126))/0xa*(parseInt(_0x35c780(0x124))/0xb)+parseInt(_0x35c780(0x121))/0xc;if(_0x4238cf===_0x5f093b)break;else _0x17f17d['push'](_0x17f17d['shift']());}catch(_0x46de83){_0x17f17d['push'](_0x17f17d['shift']());}}}(a52_0x27c3,0x57d11));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};function a52_0x2669(_0x1a16d,_0x51a348){_0x1a16d=_0x1a16d-0x11f;var _0x27c313=a52_0x27c3();var _0x266908=_0x27c313[_0x1a16d];return _0x266908;}export{CONFIG_ENUM_VALUES,TOP_LEVEL_CONFIG_KEYS,getConfigCommandKeyDescription,getTopLevelConfigKeyList,getTopLevelConfigKeySummary,isTopLevelConfigKey};export function resolveWriteScope(_0x3ee328){var _0x4be632=a52_0x2669;if(_0x3ee328[_0x4be632(0x125)])return'global';if(!isInProject())throw CliErrors[_0x4be632(0x122)]('Not\x20inside\x20a\x20project\x20(no\x20.rabetbase.json\x20found).','Add\x20--global\x20to\x20write\x20to\x20~/.rabetbase.json,\x20or\x20run\x20`'+CLI_BIN_NAME+'\x20init`\x20first.');return _0x4be632(0x127);}function a52_0x27c3(){var _0x268ea1=['330bVDlJZ','922goWimk','6OqQAYr','5400504AmqSmk','validation','196rzbgHk','11dobAvD','global','2922560XMIRsS','project','176216VAOzCG','3844431nKgfKY','59994gulSTC','943836OJUreJ','1214xGxVit'];a52_0x27c3=function(){return _0x268ea1;};return a52_0x27c3();}export function readScopedConfig(_0x2b18b1){return readConfigFile(resolveWriteConfigPath(_0x2b18b1));}export function writeScopedConfig(_0x26575d,_0x430081){writeConfigFile(resolveWriteConfigPath(_0x430081),_0x26575d);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a53_0x575f0b=a53_0x3779;(function(_0x1c64dd,_0x47ac15){const _0xd25bb=a53_0x3779,_0x56ebee=_0x1c64dd();while(!![]){try{const _0x222b8c=parseInt(_0xd25bb(0x18e))/0x1+-parseInt(_0xd25bb(0x185))/0x2+parseInt(_0xd25bb(0x180))/0x3+parseInt(_0xd25bb(0x186))/0x4+parseInt(_0xd25bb(0x188))/0x5+parseInt(_0xd25bb(0x181))/0x6+-parseInt(_0xd25bb(0x187))/0x7*(parseInt(_0xd25bb(0x182))/0x8);if(_0x222b8c===_0x47ac15)break;else _0x56ebee['push'](_0x56ebee['shift']());}catch(_0x6e21c8){_0x56ebee['push'](_0x56ebee['shift']());}}}(a53_0x1616,0x9bd0d));function a53_0x1616(){const _0x466012=['3604616iJYtcE','7LvXSeM','1646515IsTCkV','\x20\x20\x20\x20where\x20\x20\x20\x20\x20\x20\x20\x20\x20Object\x20\x20\x20Query\x20conditions','\x20\x20\x20\x20select\x20\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Fields\x20to\x20return,\x20e.g.\x20[\x22id\x22,\x22name\x22,\x22status\x22]','\x20\x20\x20\x20pageSize\x20\x20\x20\x20\x20\x20Number\x20\x20\x20Records\x20per\x20page','\x20\x20\x20\x20currentPage\x20\x20\x20Number\x20\x20\x20Page\x20number\x20(starts\x20from\x201)','join','205311DzFUnB','JSON\x20body\x20for\x20filter\x20API.\x20Fields:\x20where,\x20select,\x20orderBy,\x20currentPage,\x20pageSize.\x20Example:\x20\x27{\x22where\x22:{\x22status\x22:{\x22$eq\x22:\x22active\x22}},\x22currentPage\x22:1,\x22pageSize\x22:20}\x27','\x20\x20\x20\x20orderBy\x20\x20\x20\x20\x20\x20\x20Array\x20\x20\x20\x20Sort\x20order,\x20e.g.\x20[{\x22id\x22:\x22desc\x22},{\x22name\x22:\x22asc\x22}]','Filter\x20dataset\x20records\x20with\x20query\x20conditions','2669433pRgNdo','5868348XFvJEU','17664216pRFvVP','\x20\x20JSON\x20BODY\x20FIELDS\x20(pass\x20inside\x20--params)','filter','914778UQVscD'];a53_0x1616=function(){return _0x466012;};return a53_0x1616();}function a53_0x3779(_0x540cad,_0x5be20c){_0x540cad=_0x540cad-0x17f;const _0x16163f=a53_0x1616();let _0x377940=_0x16163f[_0x540cad];return _0x377940;}import{buildDataCommand}from'../../commands/data/shared.js';export const dataFilter=buildDataCommand({'command':a53_0x575f0b(0x184),'operation':a53_0x575f0b(0x184),'description':a53_0x575f0b(0x17f),'paramsRequired':![],'paramsHint':a53_0x575f0b(0x18f),'helpExtra':[a53_0x575f0b(0x183),a53_0x575f0b(0x189),a53_0x575f0b(0x18a),a53_0x575f0b(0x190),a53_0x575f0b(0x18c),a53_0x575f0b(0x18b)][a53_0x575f0b(0x18d)]('\x0a')});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a54_0x51456=a54_0x2403;(function(_0x4b2c38,_0xb4a2c4){const _0x5dd661=a54_0x2403,_0x1dfadf=_0x4b2c38();while(!![]){try{const _0x21519b=parseInt(_0x5dd661(0xb5))/0x1*(-parseInt(_0x5dd661(0xba))/0x2)+parseInt(_0x5dd661(0xbc))/0x3*(parseInt(_0x5dd661(0xb9))/0x4)+parseInt(_0x5dd661(0xb7))/0x5+parseInt(_0x5dd661(0xbe))/0x6+-parseInt(_0x5dd661(0xc0))/0x7*(-parseInt(_0x5dd661(0xbf))/0x8)+parseInt(_0x5dd661(0xb6))/0x9+-parseInt(_0x5dd661(0xb4))/0xa;if(_0x21519b===_0xb4a2c4)break;else _0x1dfadf['push'](_0x1dfadf['shift']());}catch(_0x2c602a){_0x1dfadf['push'](_0x1dfadf['shift']());}}}(a54_0x4d37,0x6ea20));import{buildDataCommand}from'../../commands/data/shared.js';function a54_0x2403(_0x1219bd,_0x143e21){_0x1219bd=_0x1219bd-0xb4;const _0x4d3744=a54_0x4d37();let _0x240346=_0x4d3744[_0x1219bd];return _0x240346;}export const dataGetOne=buildDataCommand({'command':'getOne','operation':a54_0x51456(0xbb),'description':a54_0x51456(0xbd),'paramsRequired':!![],'paramsHint':a54_0x51456(0xb8)});function a54_0x4d37(){const _0x2e5a39=['17257100GJtZXA','12833HuqjMJ','483912auWQsM','3704810baRHZi','JSON\x20with\x20record\x20id.\x20Example:\x20\x27{\x22id\x22:123}\x27','27512LbfsvQ','2sdqYRw','getOne','165QovSXa','Get\x20a\x20single\x20record\x20by\x20ID','2527818ogVgau','1592992JtXVAR','21LSoqcp'];a54_0x4d37=function(){return _0x2e5a39;};return a54_0x4d37();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x32ce32,_0x2ea0d0){const _0x906d45=a55_0x12ab,_0x415c59=_0x32ce32();while(!![]){try{const _0xf7af63=-parseInt(_0x906d45(0x1db))/0x1*(parseInt(_0x906d45(0x1d8))/0x2)+parseInt(_0x906d45(0x1e2))/0x3*(parseInt(_0x906d45(0x1e1))/0x4)+-parseInt(_0x906d45(0x1dd))/0x5*(-parseInt(_0x906d45(0x1df))/0x6)+parseInt(_0x906d45(0x1dc))/0x7+-parseInt(_0x906d45(0x1d7))/0x8*(parseInt(_0x906d45(0x1e0))/0x9)+-parseInt(_0x906d45(0x1d9))/0xa*(parseInt(_0x906d45(0x1de))/0xb)+-parseInt(_0x906d45(0x1da))/0xc*(-parseInt(_0x906d45(0x1e3))/0xd);if(_0xf7af63===_0x2ea0d0)break;else _0x415c59['push'](_0x415c59['shift']());}catch(_0x449ec5){_0x415c59['push'](_0x415c59['shift']());}}}(a55_0x3e88,0x4be87));import{dataFilter}from'../../commands/data/filter.js';function a55_0x3e88(){const _0x54fa35=['3236bUqumM','741DUdaek','1898zQdLEP','6088GDfKkX','4yqdGXx','340VvUnZP','11580qqGXSh','86718gWHsWt','2770194vpOnmW','465275KidwcX','147466MHghLW','36SoyaKs','4194ZvNZHY'];a55_0x3e88=function(){return _0x54fa35;};return a55_0x3e88();}import{dataGetOne}from'../../commands/data/getOne.js';function a55_0x12ab(_0xc84d3f,_0x36e957){_0xc84d3f=_0xc84d3f-0x1d7;const _0x3e88fc=a55_0x3e88();let _0x12ab96=_0x3e88fc[_0xc84d3f];return _0x12ab96;}export const dataDefinitions=[dataFilter,dataGetOne];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a56_0x5ad7(_0x47dd73,_0x283d80){_0x47dd73=_0x47dd73-0xab;const _0x292f02=a56_0x292f();let _0x5ad79b=_0x292f02[_0x47dd73];return _0x5ad79b;}(function(_0x183ae7,_0x5c736d){const _0x1b1def=a56_0x5ad7,_0x1e116e=_0x183ae7();while(!![]){try{const _0x2b68a5=-parseInt(_0x1b1def(0xc0))/0x1*(-parseInt(_0x1b1def(0xb1))/0x2)+parseInt(_0x1b1def(0xac))/0x3*(parseInt(_0x1b1def(0xbe))/0x4)+parseInt(_0x1b1def(0xc1))/0x5+-parseInt(_0x1b1def(0xbf))/0x6*(-parseInt(_0x1b1def(0xb2))/0x7)+parseInt(_0x1b1def(0xc7))/0x8+parseInt(_0x1b1def(0xc9))/0x9+parseInt(_0x1b1def(0xbb))/0xa*(-parseInt(_0x1b1def(0xc6))/0xb);if(_0x2b68a5===_0x5c736d)break;else _0x1e116e['push'](_0x1e116e['shift']());}catch(_0x5ad36e){_0x1e116e['push'](_0x1e116e['shift']());}}}(a56_0x292f,0x44a17));import{executeDatasetDataOperation}from'../../core/api-client.js';import{CODE_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';import{parseJsonParams}from'../../utils/params.js';function assertGetOneId(_0x541c50){const _0x55ddbb=a56_0x5ad7;if(!_0x541c50)throw CliErrors[_0x55ddbb(0xba)](_0x55ddbb(0xb8),_0x55ddbb(0xbc));const _0xa4cad8=_0x541c50['id'];if(_0xa4cad8===undefined||_0xa4cad8===null||_0xa4cad8==='')throw CliErrors['validation'](_0x55ddbb(0xb6),_0x55ddbb(0xad));}function a56_0x292f(){const _0x28a991=['appCode','165046yxlUxZ','844473iWRdKA','string','read','data\x20','data\x20getOne\x20requires\x20\x22id\x22\x20in\x20--params','paramsHint','params','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically','flagMissing','20wzeGtk','Provide\x20--params\x20\x27{\x22id\x22:123}\x27\x20for\x20data\x20getOne.','command','12380GLpSUP','6bRNAFs','5uNbdnc','186180PeKTUE','operation','code','\x20completed\x20in\x20','str','7236482ttRefd','3588648mouZhk','getOne','882351hkeIsH','paramsRequired','465MyLbDd','Example:\x20--params\x20\x27{\x22id\x22:123}\x27','description','compress'];a56_0x292f=function(){return _0x28a991;};return a56_0x292f();}function parseCommandParams(_0x5b80f8){return parseJsonParams(_0x5b80f8)??{};}export function buildDataCommand(_0x18038a){const _0x22b79c=a56_0x5ad7,_0xb90ed8=_0x22b79c(0xb9);return{'service':'data','command':_0x18038a['command'],'description':_0x18038a[_0x22b79c(0xae)],'risk':_0x22b79c(0xb4),'defaultOutputFormat':_0x22b79c(0xaf),'helpExtra':_0x18038a['helpExtra'],'flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':'alias','type':'string','description':_0xb90ed8},{'name':'params','type':_0x22b79c(0xb3),'description':_0x18038a[_0x22b79c(0xb7)]}],async 'validate'(_0x53b34c){const _0x2859f0=_0x22b79c,_0x3b02cb=_0x53b34c[_0x2859f0(0xc5)](_0x2859f0(0xb8));if(_0x18038a[_0x2859f0(0xab)]&&!_0x3b02cb)throw CliErrors[_0x2859f0(0xba)](_0x2859f0(0xb8),_0x18038a['paramsHint']);const _0x3999a2=parseJsonParams(_0x3b02cb);_0x18038a[_0x2859f0(0xc2)]===_0x2859f0(0xc8)&&assertGetOneId(_0x3999a2);},async 'execute'(_0x106762){const _0x43a9dc=_0x22b79c,_0x438a33=parseCommandParams(_0x106762['str'](_0x43a9dc(0xb8))),_0x2fb5cc=Date['now'](),_0x5abfe7=await executeDatasetDataOperation(_0x106762[_0x43a9dc(0xb0)],_0x106762[_0x43a9dc(0xc5)](_0x43a9dc(0xc3)),_0x18038a[_0x43a9dc(0xc2)],_0x438a33),_0x4f7ab7=Date['now']()-_0x2fb5cc;return{'ok':!![],'data':{'result':_0x5abfe7,'elapsed':_0x4f7ab7},'message':_0x43a9dc(0xb5)+_0x18038a[_0x43a9dc(0xbd)]+_0x43a9dc(0xc4)+_0x4f7ab7+'ms'};}};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a57_0x20ad51=a57_0x18e7;(function(_0x315b18,_0x3ccf96){const _0x123433=a57_0x18e7,_0x15cd39=_0x315b18();while(!![]){try{const _0x1f66e1=parseInt(_0x123433(0x15e))/0x1*(parseInt(_0x123433(0x153))/0x2)+parseInt(_0x123433(0x17f))/0x3+-parseInt(_0x123433(0x150))/0x4*(parseInt(_0x123433(0x15c))/0x5)+-parseInt(_0x123433(0x14b))/0x6+parseInt(_0x123433(0x179))/0x7*(parseInt(_0x123433(0x164))/0x8)+parseInt(_0x123433(0x185))/0x9+-parseInt(_0x123433(0x16a))/0xa;if(_0x1f66e1===_0x3ccf96)break;else _0x15cd39['push'](_0x15cd39['shift']());}catch(_0x48001e){_0x15cd39['push'](_0x15cd39['shift']());}}}(a57_0x2382,0x1be58));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 PROTOCOL=a57_0x20ad51(0x158),BACKEND_PATH=a57_0x20ad51(0x160);export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x5af7bc,input:_0x5d58ec,dryRun:_0x53af67}){const _0x576cc3=a57_0x20ad51;validateInput(_0x5d58ec);const _0x5e3ae8=normalizeBusinessGroup(_0x5d58ec[_0x576cc3(0x167)]),_0xea42c=await getDatasetDetail(_0x5d58ec[_0x576cc3(0x184)]),_0x128e2b=resolveBusinessGroupDataset(_0xea42c,_0x5d58ec[_0x576cc3(0x184)]),_0x2ad83d=loadCurrentBusinessGroup(_0xea42c,_0x128e2b);assertExpectedBusinessGroup(_0x2ad83d,_0x5d58ec[_0x576cc3(0x17d)]);const _0x137d6b=buildBackendPayload(_0x5af7bc,_0x128e2b,_0x5e3ae8),_0x5f0467=_0x2ad83d!==_0x5e3ae8;let _0x45eed6;if(_0x5f0467&&!_0x53af67){await updateErBusinessGroup(_0x137d6b);const _0x2db068=await getDatasetDetail(_0x128e2b[_0x576cc3(0x184)]),_0x7f80f5=resolveBusinessGroupDataset(_0x2db068,_0x128e2b[_0x576cc3(0x184)]),_0x33b9cf=loadCurrentBusinessGroup(_0x2db068,_0x7f80f5);if(_0x33b9cf!==_0x5e3ae8)throw CliErrors[_0x576cc3(0x171)](_0x576cc3(0x176),_0x576cc3(0x14e)+JSON['stringify'](_0x5e3ae8)+_0x576cc3(0x14d)+JSON[_0x576cc3(0x178)](_0x33b9cf)+'.');_0x45eed6={'verified':!![],'status':'matched','afterReadback':{'businessGroup':_0x33b9cf}};}else!_0x5f0467&&(_0x45eed6={'verified':!![],'status':_0x576cc3(0x168),'afterReadback':{'businessGroup':_0x2ad83d}});const _0x45fc96={'protocol':PROTOCOL,'operation':'update','appCode':_0x5af7bc,'selector':{'code':_0x128e2b[_0x576cc3(0x184)]},'dataset':_0x128e2b,'before':{'businessGroup':_0x2ad83d},'after':{'businessGroup':_0x5e3ae8},'changed':_0x5f0467,'dryRun':_0x53af67,'submitted':_0x5f0467&&!_0x53af67,'backend':{'method':'POST','path':BACKEND_PATH,'payload':_0x137d6b},..._0x45eed6?{'verification':_0x45eed6}:{},'warnings':[]};return{'ok':!![],'data':_0x45fc96,'message':_0x5f0467?_0x53af67?_0x576cc3(0x162)+_0x128e2b[_0x576cc3(0x184)]:'Updated\x20business\x20model\x20group\x20for\x20dataset\x20'+_0x128e2b[_0x576cc3(0x184)]:_0x576cc3(0x187)+_0x128e2b[_0x576cc3(0x184)]};}export const datasetBusinessGroupUpdate={'service':a57_0x20ad51(0x152),'command':a57_0x20ad51(0x14a),'description':a57_0x20ad51(0x16f),'risk':a57_0x20ad51(0x174),'flags':[CODE_FLAG,{'name':a57_0x20ad51(0x16c),'type':a57_0x20ad51(0x151),'required':!![],'description':a57_0x20ad51(0x15b)},{'name':'expect-business-group','type':'string','required':![],'description':'Expected\x20current\x20business\x20model\x20group;\x20mismatch\x20aborts\x20without\x20writing'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x368409){validateInput(readBusinessGroupUpdateInput(_0x368409));},async 'dryRun'(_0x2ea0da){const _0x1f9f5c=a57_0x20ad51,_0x1ababa=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x2ea0da[_0x1f9f5c(0x15d)],'input':readBusinessGroupUpdateInput(_0x2ea0da),'dryRun':!![]});return{'method':_0x1f9f5c(0x186),'url':BACKEND_PATH,'body':_0x1ababa[_0x1f9f5c(0x170)][_0x1f9f5c(0x155)][_0x1f9f5c(0x16d)],'description':_0x1ababa[_0x1f9f5c(0x14f)],..._0x1ababa[_0x1f9f5c(0x170)]};},async 'execute'(_0x44dc7f){const _0x1f616d=a57_0x20ad51;return buildDatasetBusinessGroupUpdateResult({'appCode':_0x44dc7f[_0x1f616d(0x15d)],'input':readBusinessGroupUpdateInput(_0x44dc7f),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x1d106c){const _0xf23240=a57_0x20ad51,_0xafd29=_0x1d106c['str'](_0xf23240(0x165));return{'code':trim(_0x1d106c[_0xf23240(0x169)]('code')),'businessGroup':_0x1d106c[_0xf23240(0x169)](_0xf23240(0x16c)),'expectBusinessGroup':_0xafd29===undefined||_0xafd29===''?undefined:_0xafd29};}function validateInput(_0x10c520){const _0x93bdf1=a57_0x20ad51;if(!trim(_0x10c520[_0x93bdf1(0x184)]))throw CliErrors[_0x93bdf1(0x159)](_0x93bdf1(0x17a));if(_0x10c520['businessGroup']===undefined)throw CliErrors['validation'](_0x93bdf1(0x163));}function a57_0x2382(){const _0x5117db=['Business\x20model\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','prototype','stringify','1337mTsZFJ','--code\x20is\x20required','sourceType','object','expectBusinessGroup','isFinite','321939EnMBsg','isArray','source','DB_TABLE','extend','code','827208eENApV','POST','No\x20changes\x20for\x20business\x20model\x20group\x20on\x20dataset\x20','found','business-group-update','247200UuuuRf','toUpperCase',',\x20actual\x20','Expected\x20','message','167284BWtWFD','string','dataset','218XQySOV','datasetId','backend','name','value','dataset-business-group-update.v1','validation','hasOwnProperty','New\x20business\x20model\x20group\x20value;\x20empty\x20string\x20clears\x20it','10FgdOzO','appCode','1741HcZYow','Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.','/smartapi/question/er-config/business-group/edit','number','Dry-run:\x20business\x20model\x20group\x20would\x20change\x20for\x20dataset\x20','--business-group\x20is\x20required','7856SvHqHP','expect-business-group','datasetCode','businessGroup','unchanged','str','3374500bZwmQk','modelId','business-group','payload','dbtableConfig','Update\x20business\x20model\x20group','data','apiError','METADATA','modelCode','write','trim'];a57_0x2382=function(){return _0x5117db;};return a57_0x2382();}function resolveBusinessGroupDataset(_0x597815,_0x243310){const _0x40a8b3=a57_0x20ad51,_0x11c6d0=asPlainObject(_0x597815[_0x40a8b3(0x152)]),_0xaca1cc=asPlainObject(_0x597815[_0x40a8b3(0x16e)]),_0x36ca55=resolveSourceType(_0x597815,_0x11c6d0,_0xaca1cc),_0x397f78=firstString(_0x597815[_0x40a8b3(0x173)],_0x597815[_0x40a8b3(0x184)],_0x11c6d0[_0x40a8b3(0x166)],_0x243310)||_0x243310;return{'id':firstNumber(_0x597815[_0x40a8b3(0x16b)],_0x597815['id'],_0x11c6d0[_0x40a8b3(0x154)])??firstString(_0x597815[_0x40a8b3(0x16b)],_0x597815['id'],_0x11c6d0[_0x40a8b3(0x154)])??null,'code':_0x397f78,'name':firstString(_0x597815[_0x40a8b3(0x156)],_0x11c6d0['datasetName'],_0x11c6d0[_0x40a8b3(0x156)])||null,'sourceType':_0x36ca55};}function resolveSourceType(_0x408998,_0x343b21,_0x5b4c82){const _0x4a5495=a57_0x20ad51,_0x4e2c52=firstString(_0x408998[_0x4a5495(0x181)],_0x408998[_0x4a5495(0x17b)],_0x343b21[_0x4a5495(0x181)],_0x343b21['sourceType'])?.[_0x4a5495(0x175)]()[_0x4a5495(0x14c)]();if(_0x4e2c52===_0x4a5495(0x182)||_0x4e2c52===_0x4a5495(0x172))return _0x4e2c52;if(Object['keys'](_0x5b4c82)['length']>0x0)return _0x4a5495(0x182);throw CliErrors['validation'](_0x4a5495(0x15f));}function loadCurrentBusinessGroup(_0x3b727f,_0xa69646){const _0x9682c8=a57_0x20ad51,_0x1cf6f2=readBusinessGroupFromDatasetDetail(_0x3b727f,_0xa69646['sourceType']);if(_0x1cf6f2[_0x9682c8(0x188)])return normalizeBusinessGroup(_0x1cf6f2[_0x9682c8(0x157)]);if(_0xa69646['sourceType']===_0x9682c8(0x172))return'';throw CliErrors[_0x9682c8(0x159)]('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(_0x2e9cf9,_0x37db6e){const _0x324222=a57_0x20ad51,_0x359404=asPlainObject(_0x2e9cf9[_0x324222(0x152)]),_0x28967b=firstPresent(_0x2e9cf9[_0x324222(0x167)]);if(_0x28967b['found'])return _0x28967b;const _0x706b69=firstPresent(_0x359404[_0x324222(0x167)]);if(_0x706b69[_0x324222(0x188)])return _0x706b69;if(_0x37db6e===_0x324222(0x182))return{'found':![]};const _0x2c95c7=readBusinessGroupFromExtend(_0x2e9cf9[_0x324222(0x183)]);if(_0x2c95c7['found'])return _0x2c95c7;return readBusinessGroupFromExtend(_0x359404['extend']);}function a57_0x18e7(_0x5e819d,_0x582e57){_0x5e819d=_0x5e819d-0x14a;const _0x2382dd=a57_0x2382();let _0x18e7ff=_0x2382dd[_0x5e819d];return _0x18e7ff;}function readBusinessGroupFromExtend(_0x5c04a2){const _0x570e81=a57_0x20ad51;if(_0x5c04a2===undefined||_0x5c04a2===null||_0x5c04a2==='')return{'found':![]};if(typeof _0x5c04a2==='string')try{const _0x4819d0=JSON['parse'](_0x5c04a2);return readBusinessGroupFromExtend(_0x4819d0);}catch{return{'found':![]};}const _0x589ae0=asPlainObject(_0x5c04a2);if(Object[_0x570e81(0x177)][_0x570e81(0x15a)]['call'](_0x589ae0,'businessGroup'))return{'found':!![],'value':_0x589ae0['businessGroup']};return{'found':![]};}function firstPresent(..._0x2998c9){for(const _0x1a9809 of _0x2998c9){if(_0x1a9809!==undefined&&_0x1a9809!==null)return{'found':!![],'value':_0x1a9809};}return{'found':![]};}function assertExpectedBusinessGroup(_0x4aa5fa,_0x5495c3){const _0x1b75a6=a57_0x20ad51;if(_0x5495c3===undefined)return;const _0x5f8665=normalizeBusinessGroup(_0x5495c3);if(_0x4aa5fa!==_0x5f8665)throw CliErrors[_0x1b75a6(0x159)]('Expectation\x20mismatch\x20at\x20businessGroup',_0x1b75a6(0x14e)+JSON[_0x1b75a6(0x178)](_0x5f8665)+',\x20actual\x20'+JSON[_0x1b75a6(0x178)](_0x4aa5fa));}function buildBackendPayload(_0x38e4bd,_0x428c3c,_0x53d2c6){const _0x3da890=a57_0x20ad51;return{'appCode':_0x38e4bd,'datasetCode':_0x428c3c[_0x3da890(0x184)],'businessGroup':_0x53d2c6};}function normalizeBusinessGroup(_0x4fc130){const _0x40b8f0=a57_0x20ad51;if(_0x4fc130===undefined||_0x4fc130===null)return'';return String(_0x4fc130)[_0x40b8f0(0x175)]();}function asPlainObject(_0x5351ee){const _0x4d60c3=a57_0x20ad51;if(!_0x5351ee||typeof _0x5351ee!==_0x4d60c3(0x17c)||Array[_0x4d60c3(0x180)](_0x5351ee))return{};return _0x5351ee;}function firstString(..._0x2d3666){const _0x4bfb62=a57_0x20ad51;for(const _0x122029 of _0x2d3666){if(typeof _0x122029===_0x4bfb62(0x151)&&_0x122029['trim']())return _0x122029[_0x4bfb62(0x175)]();if(typeof _0x122029===_0x4bfb62(0x161)&&Number['isFinite'](_0x122029))return String(_0x122029);}return undefined;}function firstNumber(..._0x2e7e1f){const _0x31846b=a57_0x20ad51;for(const _0x5f5b3d of _0x2e7e1f){if(typeof _0x5f5b3d===_0x31846b(0x161)&&Number[_0x31846b(0x17e)](_0x5f5b3d))return _0x5f5b3d;if(typeof _0x5f5b3d===_0x31846b(0x151)&&_0x5f5b3d['trim']()&&Number[_0x31846b(0x17e)](Number(_0x5f5b3d)))return Number(_0x5f5b3d);}return null;}function trim(_0x54051e){const _0x4d9b83=a57_0x20ad51;return String(_0x54051e||'')[_0x4d9b83(0x175)]();}
|
|
1
|
+
const a57_0x429451=a57_0x1aab;(function(_0x18b597,_0x27cf8b){const _0x392001=a57_0x1aab,_0x3981ae=_0x18b597();while(!![]){try{const _0x454035=parseInt(_0x392001(0x1e1))/0x1+-parseInt(_0x392001(0x1d7))/0x2+parseInt(_0x392001(0x1de))/0x3*(-parseInt(_0x392001(0x1d9))/0x4)+parseInt(_0x392001(0x1d3))/0x5+parseInt(_0x392001(0x1e9))/0x6*(-parseInt(_0x392001(0x1cc))/0x7)+parseInt(_0x392001(0x1e0))/0x8*(parseInt(_0x392001(0x201))/0x9)+-parseInt(_0x392001(0x1fe))/0xa*(parseInt(_0x392001(0x200))/0xb);if(_0x454035===_0x27cf8b)break;else _0x3981ae['push'](_0x3981ae['shift']());}catch(_0x3061b3){_0x3981ae['push'](_0x3981ae['shift']());}}}(a57_0x4aa3,0xd6ee3));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';function a57_0x1aab(_0x1f946c,_0x5de353){_0x1f946c=_0x1f946c-0x1c1;const _0x4aa3ad=a57_0x4aa3();let _0x1aab15=_0x4aa3ad[_0x1f946c];return _0x1aab15;}import{getDatasetDetail,updateErBusinessGroup}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const PROTOCOL=a57_0x429451(0x1cb),BACKEND_PATH=a57_0x429451(0x1eb);export async function buildDatasetBusinessGroupUpdateResult({appCode:_0x92061f,input:_0xef0ba3,dryRun:_0x654d1a}){const _0x246cf2=a57_0x429451;validateInput(_0xef0ba3);const _0x171f51=normalizeBusinessGroup(_0xef0ba3['businessGroup']),_0xb82d3d=await getDatasetDetail(_0xef0ba3[_0x246cf2(0x1f7)]),_0x560a30=resolveBusinessGroupDataset(_0xb82d3d,_0xef0ba3[_0x246cf2(0x1f7)]),_0x3487b4=loadCurrentBusinessGroup(_0xb82d3d,_0x560a30);assertExpectedBusinessGroup(_0x3487b4,_0xef0ba3[_0x246cf2(0x1e6)]);const _0x57e319=buildBackendPayload(_0x92061f,_0x560a30,_0x171f51),_0x24c0e3=_0x3487b4!==_0x171f51;let _0x2804ca;if(_0x24c0e3&&!_0x654d1a){await updateErBusinessGroup(_0x57e319);const _0x22950f=await getDatasetDetail(_0x560a30[_0x246cf2(0x1f7)]),_0x4cf9ff=resolveBusinessGroupDataset(_0x22950f,_0x560a30[_0x246cf2(0x1f7)]),_0x3411e4=loadCurrentBusinessGroup(_0x22950f,_0x4cf9ff);if(_0x3411e4!==_0x171f51)throw CliErrors[_0x246cf2(0x1cf)](_0x246cf2(0x1d5),_0x246cf2(0x1ed)+JSON[_0x246cf2(0x1dc)](_0x171f51)+_0x246cf2(0x1fa)+JSON[_0x246cf2(0x1dc)](_0x3411e4)+'.');_0x2804ca={'verified':!![],'status':_0x246cf2(0x1d1),'afterReadback':{'businessGroup':_0x3411e4}};}else!_0x24c0e3&&(_0x2804ca={'verified':!![],'status':'unchanged','afterReadback':{'businessGroup':_0x3487b4}});const _0x4aa86f={'protocol':PROTOCOL,'operation':'update','appCode':_0x92061f,'selector':{'code':_0x560a30['code']},'dataset':_0x560a30,'before':{'businessGroup':_0x3487b4},'after':{'businessGroup':_0x171f51},'changed':_0x24c0e3,'dryRun':_0x654d1a,'submitted':_0x24c0e3&&!_0x654d1a,'backend':{'method':'POST','path':BACKEND_PATH,'payload':_0x57e319},..._0x2804ca?{'verification':_0x2804ca}:{},'warnings':[]};return{'ok':!![],'data':_0x4aa86f,'message':_0x24c0e3?_0x654d1a?_0x246cf2(0x1ff)+_0x560a30[_0x246cf2(0x1f7)]:_0x246cf2(0x1ea)+_0x560a30[_0x246cf2(0x1f7)]:_0x246cf2(0x1ee)+_0x560a30['code']};}export const datasetBusinessGroupUpdate={'service':'dataset','command':a57_0x429451(0x1db),'description':a57_0x429451(0x1f2),'risk':a57_0x429451(0x1f3),'flags':[CODE_FLAG,{'name':a57_0x429451(0x1df),'type':a57_0x429451(0x1e4),'required':!![],'description':a57_0x429451(0x1c3)},{'name':a57_0x429451(0x1c4),'type':a57_0x429451(0x1e4),'required':![],'description':a57_0x429451(0x1ce)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x111e20){validateInput(readBusinessGroupUpdateInput(_0x111e20));},async 'dryRun'(_0x32a7ed){const _0x4ffa4c=a57_0x429451,_0x704882=await buildDatasetBusinessGroupUpdateResult({'appCode':_0x32a7ed[_0x4ffa4c(0x1f5)],'input':readBusinessGroupUpdateInput(_0x32a7ed),'dryRun':!![]});return{'method':'POST','url':BACKEND_PATH,'body':_0x704882['data']['backend'][_0x4ffa4c(0x1c9)],'description':_0x704882[_0x4ffa4c(0x1fc)],..._0x704882[_0x4ffa4c(0x1d4)]};},async 'execute'(_0x4e8bd3){return buildDatasetBusinessGroupUpdateResult({'appCode':_0x4e8bd3['appCode'],'input':readBusinessGroupUpdateInput(_0x4e8bd3),'dryRun':![]});}};function readBusinessGroupUpdateInput(_0x3938de){const _0x3255ff=a57_0x429451,_0x5264=_0x3938de['str'](_0x3255ff(0x1c4));return{'code':trim(_0x3938de['str']('code')),'businessGroup':_0x3938de[_0x3255ff(0x1c8)](_0x3255ff(0x1df)),'expectBusinessGroup':_0x5264===undefined||_0x5264===''?undefined:_0x5264};}function validateInput(_0x2250b7){const _0x411288=a57_0x429451;if(!trim(_0x2250b7[_0x411288(0x1f7)]))throw CliErrors['validation'](_0x411288(0x1ca));if(_0x2250b7[_0x411288(0x1f9)]===undefined)throw CliErrors[_0x411288(0x1e8)](_0x411288(0x1d8));}function resolveBusinessGroupDataset(_0x2c6673,_0x11c099){const _0x430b5f=a57_0x429451,_0x2c1531=asPlainObject(_0x2c6673['dataset']),_0x14fdb1=asPlainObject(_0x2c6673['dbtableConfig']),_0xa6bef3=resolveSourceType(_0x2c6673,_0x2c1531,_0x14fdb1),_0x2a7b3e=firstString(_0x2c6673[_0x430b5f(0x1f6)],_0x2c6673[_0x430b5f(0x1f7)],_0x2c1531['datasetCode'],_0x11c099)||_0x11c099;return{'id':firstNumber(_0x2c6673['modelId'],_0x2c6673['id'],_0x2c1531[_0x430b5f(0x1fd)])??firstString(_0x2c6673[_0x430b5f(0x1f4)],_0x2c6673['id'],_0x2c1531[_0x430b5f(0x1fd)])??null,'code':_0x2a7b3e,'name':firstString(_0x2c6673['name'],_0x2c1531[_0x430b5f(0x1e3)],_0x2c1531[_0x430b5f(0x1c2)])||null,'sourceType':_0xa6bef3};}function resolveSourceType(_0x233349,_0x516507,_0x477ceb){const _0x5b950f=a57_0x429451,_0x390823=firstString(_0x233349[_0x5b950f(0x1c1)],_0x233349[_0x5b950f(0x1da)],_0x516507[_0x5b950f(0x1c1)],_0x516507[_0x5b950f(0x1da)])?.['trim']()[_0x5b950f(0x1d2)]();if(_0x390823===_0x5b950f(0x1e2)||_0x390823==='METADATA')return _0x390823;if(Object[_0x5b950f(0x1c7)](_0x477ceb)['length']>0x0)return _0x5b950f(0x1e2);throw CliErrors[_0x5b950f(0x1e8)]('Dataset\x20sourceType\x20is\x20required\x20and\x20must\x20be\x20DB_TABLE\x20or\x20METADATA.');}function a57_0x4aa3(){const _0x3cfa3e=['Expected\x20','No\x20changes\x20for\x20business\x20model\x20group\x20on\x20dataset\x20','dataset','call','prototype','Update\x20business\x20model\x20group','write','modelId','appCode','modelCode','code','METADATA','businessGroup',',\x20actual\x20','hasOwnProperty','message','datasetId','25730OmGdJd','Dry-run:\x20business\x20model\x20group\x20would\x20change\x20for\x20dataset\x20','3509IblClg','82377WiOCPF','source','name','New\x20business\x20model\x20group\x20value;\x20empty\x20string\x20clears\x20it','expect-business-group','extend','Expectation\x20mismatch\x20at\x20businessGroup','keys','str','payload','--code\x20is\x20required','dataset-business-group-update.v1','14VIKWna','Dataset\x20detail\x20does\x20not\x20expose\x20businessGroup.','Expected\x20current\x20business\x20model\x20group;\x20mismatch\x20aborts\x20without\x20writing','apiError','number','matched','toUpperCase','4774415GZpvhh','data','Business\x20model\x20group\x20update\x20did\x20not\x20match\x20dataset\x20detail\x20readback.','isArray','1863644LCUQOk','--business-group\x20is\x20required','4tqrkBe','sourceType','business-group-update','stringify','trim','4035849bEKQUX','business-group','1480dDhxTC','1678987vuqXck','DB_TABLE','datasetName','string','found','expectBusinessGroup','isFinite','validation','1046784rKcThy','Updated\x20business\x20model\x20group\x20for\x20dataset\x20','/smartapi/question/er-config/business-group/edit','object'];a57_0x4aa3=function(){return _0x3cfa3e;};return a57_0x4aa3();}function loadCurrentBusinessGroup(_0x2625e2,_0x4c9ce4){const _0x57dd4a=a57_0x429451,_0x8ac9ac=readBusinessGroupFromDatasetDetail(_0x2625e2,_0x4c9ce4[_0x57dd4a(0x1da)]);if(_0x8ac9ac[_0x57dd4a(0x1e5)])return normalizeBusinessGroup(_0x8ac9ac['value']);if(_0x4c9ce4[_0x57dd4a(0x1da)]===_0x57dd4a(0x1f8))return'';throw CliErrors[_0x57dd4a(0x1e8)](_0x57dd4a(0x1cd),'Business\x20model\x20group\x20readback\x20must\x20be\x20available\x20by\x20datasetCode;\x20upgrade\x20the\x20backend\x20read\x20contract\x20instead\x20of\x20using\x20dblinkId/tableName.');}function readBusinessGroupFromDatasetDetail(_0x4526cc,_0x7516fd){const _0x3de602=a57_0x429451,_0x4598df=asPlainObject(_0x4526cc[_0x3de602(0x1ef)]),_0x13b275=firstPresent(_0x4526cc[_0x3de602(0x1f9)]);if(_0x13b275[_0x3de602(0x1e5)])return _0x13b275;const _0x430353=firstPresent(_0x4598df[_0x3de602(0x1f9)]);if(_0x430353['found'])return _0x430353;if(_0x7516fd===_0x3de602(0x1e2))return{'found':![]};const _0xf3afe3=readBusinessGroupFromExtend(_0x4526cc[_0x3de602(0x1c5)]);if(_0xf3afe3[_0x3de602(0x1e5)])return _0xf3afe3;return readBusinessGroupFromExtend(_0x4598df[_0x3de602(0x1c5)]);}function readBusinessGroupFromExtend(_0x29b04c){const _0x14e64c=a57_0x429451;if(_0x29b04c===undefined||_0x29b04c===null||_0x29b04c==='')return{'found':![]};if(typeof _0x29b04c===_0x14e64c(0x1e4))try{const _0x35b3fd=JSON['parse'](_0x29b04c);return readBusinessGroupFromExtend(_0x35b3fd);}catch{return{'found':![]};}const _0x2f3360=asPlainObject(_0x29b04c);if(Object[_0x14e64c(0x1f1)][_0x14e64c(0x1fb)][_0x14e64c(0x1f0)](_0x2f3360,_0x14e64c(0x1f9)))return{'found':!![],'value':_0x2f3360[_0x14e64c(0x1f9)]};return{'found':![]};}function firstPresent(..._0x4caa6d){for(const _0x231280 of _0x4caa6d){if(_0x231280!==undefined&&_0x231280!==null)return{'found':!![],'value':_0x231280};}return{'found':![]};}function assertExpectedBusinessGroup(_0xbcce40,_0x4c97dd){const _0x570b63=a57_0x429451;if(_0x4c97dd===undefined)return;const _0x17bb6a=normalizeBusinessGroup(_0x4c97dd);if(_0xbcce40!==_0x17bb6a)throw CliErrors[_0x570b63(0x1e8)](_0x570b63(0x1c6),_0x570b63(0x1ed)+JSON[_0x570b63(0x1dc)](_0x17bb6a)+_0x570b63(0x1fa)+JSON[_0x570b63(0x1dc)](_0xbcce40));}function buildBackendPayload(_0x5dd295,_0x324b4f,_0x57aa6f){const _0x24afcf=a57_0x429451;return{'appCode':_0x5dd295,'datasetCode':_0x324b4f[_0x24afcf(0x1f7)],'businessGroup':_0x57aa6f};}function normalizeBusinessGroup(_0x26154b){const _0x838377=a57_0x429451;if(_0x26154b===undefined||_0x26154b===null)return'';return String(_0x26154b)[_0x838377(0x1dd)]();}function asPlainObject(_0x504824){const _0x31614e=a57_0x429451;if(!_0x504824||typeof _0x504824!==_0x31614e(0x1ec)||Array[_0x31614e(0x1d6)](_0x504824))return{};return _0x504824;}function firstString(..._0x4194d1){const _0x209c42=a57_0x429451;for(const _0x3c278a of _0x4194d1){if(typeof _0x3c278a===_0x209c42(0x1e4)&&_0x3c278a[_0x209c42(0x1dd)]())return _0x3c278a[_0x209c42(0x1dd)]();if(typeof _0x3c278a===_0x209c42(0x1d0)&&Number[_0x209c42(0x1e7)](_0x3c278a))return String(_0x3c278a);}return undefined;}function firstNumber(..._0x350099){const _0x4481bf=a57_0x429451;for(const _0x2ab647 of _0x350099){if(typeof _0x2ab647===_0x4481bf(0x1d0)&&Number[_0x4481bf(0x1e7)](_0x2ab647))return _0x2ab647;if(typeof _0x2ab647==='string'&&_0x2ab647[_0x4481bf(0x1dd)]()&&Number[_0x4481bf(0x1e7)](Number(_0x2ab647)))return Number(_0x2ab647);}return null;}function trim(_0x587589){const _0x2df0a3=a57_0x429451;return String(_0x587589||'')[_0x2df0a3(0x1dd)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a58_0x9973bb=a58_0x352c;(function(_0x251ba1,_0x293aff){const _0x46574a=a58_0x352c,_0x578dfb=_0x251ba1();while(!![]){try{const _0x5a0a93=parseInt(_0x46574a(0x147))/0x1*(parseInt(_0x46574a(0x134))/0x2)+parseInt(_0x46574a(0x149))/0x3+-parseInt(_0x46574a(0x131))/0x4+parseInt(_0x46574a(0x148))/0x5+parseInt(_0x46574a(0x145))/0x6*(-parseInt(_0x46574a(0x14a))/0x7)+-parseInt(_0x46574a(0x12f))/0x8+parseInt(_0x46574a(0x14e))/0x9;if(_0x5a0a93===_0x293aff)break;else _0x578dfb['push'](_0x578dfb['shift']());}catch(_0x1e2ddc){_0x578dfb['push'](_0x578dfb['shift']());}}}(a58_0xb84e,0xf2967));import{CliErrors}from'../../errors.js';export const RUNTIME_DATA_ACCESS_COMMANDS={'cli':a58_0x9973bb(0x14c),'filter':'lovrabet\x20data\x20filter\x20--code\x20<datasetCode>\x20--params\x20\x27<json>\x27\x20--format\x20compress','getOne':'lovrabet\x20data\x20getOne\x20--code\x20<datasetCode>\x20--params\x20\x27{\x22id\x22:123}\x27\x20--format\x20compress'};export const RUNTIME_DATA_ACCESS_SUMMARY=a58_0x9973bb(0x14b);function valueToString(_0x28bb0b){return _0x28bb0b==null?'':String(_0x28bb0b)['trim']();}function a58_0xb84e(){const _0x85e14=['UNKNOWN','\x20是\x20','当前数据集\x20\x22','6TnFThK','dataset','6fOJwpx','6066565tVYiBU','1559502egXYul','12814669nZurSZ','Use\x20lovrabet\x20data\x20filter/getOne\x20for\x20real\x20runtime\x20records.','lovrabet','source','17638956fZssVa','SQL\x20schema\x20validation','dbId','1173888jquxFS','filter','7484100sUoPnJ','datasetCode','如果只是查看运行态真实行数据,请切换到\x20lovrabet\x20CLI:','383012CkdlOI','dbtableConfig','\x20的\x20DB_TABLE\x20数据源上下文。','name','modelCode','请先将该数据集升级/迁移为\x20DB_TABLE\x20数据集,再基于新的\x20dataset\x20code\x20继续开发。','code','validation','length','unknown','join','datasetName','METADATA','tableName'];a58_0xb84e=function(){return _0x85e14;};return a58_0xb84e();}function getDatasetCode(_0x443450){const _0x682a3b=a58_0x9973bb;return valueToString(_0x443450[_0x682a3b(0x13a)]??_0x443450[_0x682a3b(0x138)]??_0x443450[_0x682a3b(0x146)]?.[_0x682a3b(0x132)]);}function getDatasetName(_0x4c1c7a){const _0x2c5693=a58_0x9973bb;return valueToString(_0x4c1c7a[_0x2c5693(0x137)]??_0x4c1c7a['dataset']?.[_0x2c5693(0x13f)])||_0x2c5693(0x13d);}function getDatasetSource(_0xa1d4e5){const _0x421a67=a58_0x9973bb;return valueToString(_0xa1d4e5[_0x421a67(0x14d)]??_0xa1d4e5['dataset']?.['sourceType'])['toUpperCase']();}function getDbtableConfig(_0x6e44e3){const _0x5868f2=a58_0x9973bb,_0x48370d=_0x6e44e3[_0x5868f2(0x135)]??_0x6e44e3['dbtable'];return _0x48370d&&typeof _0x48370d==='object'?_0x48370d:{};}function a58_0x352c(_0x4e166b,_0x3435cb){_0x4e166b=_0x4e166b-0x12f;const _0xb84ee8=a58_0xb84e();let _0x352cfb=_0xb84ee8[_0x4e166b];return _0x352cfb;}export function isDbTableBackedDataset(_0x150e59){const _0x566096=a58_0x9973bb,_0x5e31e8=getDatasetSource(_0x150e59);if(_0x5e31e8===_0x566096(0x140))return![];const _0xebcca9=getDbtableConfig(_0x150e59),_0x10fd32=_0xebcca9[_0x566096(0x150)]??_0xebcca9['id'],_0x3cc9f2=valueToString(_0xebcca9[_0x566096(0x141)]??_0x150e59[_0x566096(0x141)]??_0x150e59['dataset']?.['tableName']);return _0x10fd32!==undefined&&_0x10fd32!==null&&_0x3cc9f2[_0x566096(0x13c)]>0x0;}export function filterDbTableBackedDatasets(_0x1a9573){const _0x179e44=a58_0x9973bb;return _0x1a9573[_0x179e44(0x130)](_0xe34122=>isDbTableBackedDataset(_0xe34122));}export function buildDbTableBackedRequirementMessage(_0x298569,_0x578b14=a58_0x9973bb(0x14f)){const _0x5a21e5=a58_0x9973bb,_0x29d269=getDatasetSource(_0x298569)||_0x5a21e5(0x142),_0x36b7e6=getDatasetName(_0x298569),_0x212369=getDatasetCode(_0x298569),_0x442e7b=_0x212369?'\x20('+_0x212369+')':'';return[_0x5a21e5(0x144)+_0x36b7e6+'\x22'+_0x442e7b+_0x5a21e5(0x143)+_0x29d269+'\x20类型,没有可用于\x20'+_0x578b14+_0x5a21e5(0x136),'原因:schema\x20introspection\x20与\x20custom\x20SQL\x20需要\x20source=DB_TABLE、dbtableConfig.dbId、dbtableConfig.tableName\x20与数据库连接上下文。',_0x5a21e5(0x139),_0x5a21e5(0x133)+RUNTIME_DATA_ACCESS_COMMANDS[_0x5a21e5(0x130)]+';'+RUNTIME_DATA_ACCESS_COMMANDS['getOne']+'。'][_0x5a21e5(0x13e)]('\x20');}export function assertDatasetIsDbTableBacked(_0x57c307,_0x299d0c){const _0x189e29=a58_0x9973bb;if(!isDbTableBackedDataset(_0x57c307))throw CliErrors[_0x189e29(0x13b)](buildDbTableBackedRequirementMessage(_0x57c307,_0x299d0c));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a59_0x4ab409=a59_0x3afa;(function(_0x37a65a,_0x46d1e6){const _0x494580=a59_0x3afa,_0x161c3d=_0x37a65a();while(!![]){try{const _0x4fe044=parseInt(_0x494580(0x10e))/0x1+parseInt(_0x494580(0xe5))/0x2*(parseInt(_0x494580(0xed))/0x3)+-parseInt(_0x494580(0xf3))/0x4*(-parseInt(_0x494580(0xfa))/0x5)+parseInt(_0x494580(0x114))/0x6*(-parseInt(_0x494580(0x103))/0x7)+-parseInt(_0x494580(0xf7))/0x8+-parseInt(_0x494580(0xfd))/0x9*(-parseInt(_0x494580(0xe8))/0xa)+parseInt(_0x494580(0x110))/0xb;if(_0x4fe044===_0x46d1e6)break;else _0x161c3d['push'](_0x161c3d['shift']());}catch(_0x5d5a83){_0x161c3d['push'](_0x161c3d['shift']());}}}(a59_0x56b6,0xc9e12));import{deleteDataset,listDatasets}from'../../core/api-client.js';function a59_0x3afa(_0x270150,_0x4bb456){_0x270150=_0x270150-0xe5;const _0x56b6a6=a59_0x56b6();let _0x3afa46=_0x56b6a6[_0x270150];return _0x3afa46;}import{CliErrors}from'../../errors.js';function a59_0x56b6(){const _0x5693ea=['str','--confirm\x20is\x20required\x20to\x20delete\x20datasets.','10583573dsqGuF','tableName','name','num','length','Would\x20delete\x20','Run\x20with\x20--dry-run\x20first,\x20then\x20add\x20--confirm\x20when\x20the\x20target\x20list\x20is\x20correct.','id=','isArray','dbName','Delete\x20all\x20datasets\x20under\x20this\x20database\x20connection\x20id','1253057GPbwkH','source','639034HylYeP','dbId','\x20dataset(s).\x20This\x20only\x20deletes\x20platform\x20dataset\x20metadata\x20and\x20related\x20page/menu\x20records,\x20not\x20physical\x20databases\x20or\x20tables.','/smartapi/dataset/delete-dataset','6hIAOnM','filter','dbtableConfig','82gyekMF','\x20dataset(s);\x20','description','534430CCHYKm','Deleted\x20','message','bool','boolean','18852zeSfZg','\x20dataset(s),\x20but\x20--expected-count\x20is\x20','No\x20undeleted\x20dataset\x20found\x20for\x20','number','Required\x20to\x20execute\x20dataset\x20deletion','One\x20of\x20--id,\x20--code,\x20or\x20--dbid\x20is\x20required.','31592PzHBYj','Matched\x20','relationPages','validation','9679864KcFQDd','appCode','Delete\x20dataset\x20metadata\x20by\x20id/code\x20or\x20all\x20datasets\x20under\x20a\x20db\x20id','340MWthVD','delete','confirm','243iDDSFL','dbid','code','dataset'];a59_0x56b6=function(){return _0x5693ea;};return a59_0x56b6();}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':a59_0x4ab409(0xfe),'type':'number','description':a59_0x4ab409(0x10d)},CONFIRM_FLAG={'name':a59_0x4ab409(0xfc),'type':a59_0x4ab409(0xec),'description':a59_0x4ab409(0xf1)},EXPECTED_COUNT_FLAG={'name':'expected-count','type':a59_0x4ab409(0xf0),'description':'Abort\x20unless\x20the\x20matched\x20dataset\x20count\x20equals\x20this\x20value'};export const datasetDelete={'service':a59_0x4ab409(0x100),'command':a59_0x4ab409(0xfb),'description':a59_0x4ab409(0xf9),'risk':'high-risk-write','flags':[DATASET_ID_FLAG,CODE_FLAG_OPTIONAL,DBID_FLAG,CONFIRM_FLAG,EXPECTED_COUNT_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x32eaea){const _0x21421f=a59_0x4ab409,_0x578593=_0x32eaea[_0x21421f(0x106)]('id'),_0x32bd1f=_0x32eaea[_0x21421f(0x101)](_0x21421f(0xff)),_0xf2035c=_0x32eaea[_0x21421f(0x106)]('dbid'),_0x1bd401=[_0x578593>0x0,Boolean(_0x32bd1f),_0xf2035c>0x0]['filter'](Boolean);if(_0x1bd401['length']===0x0)throw CliErrors[_0x21421f(0xf6)](_0x21421f(0xf2));if(_0x1bd401[_0x21421f(0x107)]>0x1)throw CliErrors[_0x21421f(0xf6)]('Use\x20only\x20one\x20of\x20--id,\x20--code,\x20or\x20--dbid.');},async 'dryRun'(_0x36f13d){const _0x1ab6af=a59_0x4ab409,_0xf650e3=await resolveTargets(_0x36f13d);return{'method':'POST','url':_0x1ab6af(0x113),'body':{'appCode':_0x36f13d[_0x1ab6af(0xf8)],'count':_0xf650e3['length'],'datasets':_0xf650e3},'description':_0x1ab6af(0x108)+_0xf650e3[_0x1ab6af(0x107)]+_0x1ab6af(0x112)};},async 'execute'(_0x349595){const _0x51b5ef=a59_0x4ab409;if(!_0x349595[_0x51b5ef(0xeb)](_0x51b5ef(0xfc)))throw CliErrors[_0x51b5ef(0xf6)](_0x51b5ef(0x102),_0x51b5ef(0x109));const _0xa7701b=await resolveTargets(_0x349595),_0x5f05d0=[],_0x15c603=[];for(const _0xcaf324 of _0xa7701b){try{await deleteDataset(_0x349595[_0x51b5ef(0xf8)],_0xcaf324['id']),_0x5f05d0['push'](_0xcaf324);}catch(_0x121b66){_0x15c603['push']({..._0xcaf324,'error':_0x121b66 instanceof Error?_0x121b66[_0x51b5ef(0xea)]:String(_0x121b66)});}}if(_0x15c603[_0x51b5ef(0x107)]>0x0)return{'ok':![],'data':{'requested':_0xa7701b[_0x51b5ef(0x107)],'deletedCount':_0x5f05d0[_0x51b5ef(0x107)],'failedCount':_0x15c603[_0x51b5ef(0x107)],'deleted':_0x5f05d0,'failed':_0x15c603},'message':_0x51b5ef(0xe9)+_0x5f05d0[_0x51b5ef(0x107)]+'/'+_0xa7701b[_0x51b5ef(0x107)]+_0x51b5ef(0xe6)+_0x15c603[_0x51b5ef(0x107)]+'\x20failed'};return{'ok':!![],'data':{'requested':_0xa7701b[_0x51b5ef(0x107)],'deletedCount':_0x5f05d0[_0x51b5ef(0x107)],'deleted':_0x5f05d0},'message':'Deleted\x20'+_0x5f05d0[_0x51b5ef(0x107)]+'\x20dataset(s)'};}};async function resolveTargets(_0x57c988){const _0x1489a1=a59_0x4ab409,_0x5a862d=_0x57c988[_0x1489a1(0x106)]('id'),_0x3995b5=_0x57c988[_0x1489a1(0x101)](_0x1489a1(0xff)),_0xc4cc8c=_0x57c988[_0x1489a1(0x106)](_0x1489a1(0xfe));let _0x3bd2f1;_0x3995b5?(_0x3bd2f1=await listDatasets(_0x57c988['appCode'],{'code':_0x3995b5}),_0x3bd2f1=_0x3bd2f1[_0x1489a1(0x115)](_0x2fc390=>_0x2fc390['code']===_0x3995b5)):(_0x3bd2f1=await listDatasets(_0x57c988[_0x1489a1(0xf8)]),_0x5a862d>0x0&&(_0x3bd2f1=_0x3bd2f1['filter'](_0x5b2782=>_0x5b2782['id']===_0x5a862d)),_0xc4cc8c>0x0&&(_0x3bd2f1=_0x3bd2f1[_0x1489a1(0x115)](_0x1bbd0f=>_0x1bbd0f['dbtableConfig']?.[_0x1489a1(0x111)]===_0xc4cc8c)));const _0x11899c=_0x3bd2f1['map'](normalizeTarget);if(_0x11899c[_0x1489a1(0x107)]===0x0){const _0x2cad98=_0x3995b5||(_0x5a862d>0x0?_0x1489a1(0x10a)+_0x5a862d:'dbid='+_0xc4cc8c);throw CliErrors[_0x1489a1(0xf6)](_0x1489a1(0xef)+_0x2cad98+'.');}const _0x5cca90=_0x57c988['num']('expected-count');if(_0x5cca90>0x0&&_0x11899c[_0x1489a1(0x107)]!==_0x5cca90)throw CliErrors[_0x1489a1(0xf6)](_0x1489a1(0xf4)+_0x11899c[_0x1489a1(0x107)]+_0x1489a1(0xee)+_0x5cca90+'.');return _0x11899c;}function normalizeTarget(_0x320985){const _0x2d5756=a59_0x4ab409,_0x587111=_0x320985[_0x2d5756(0x116)]??{};return{'id':_0x320985['id'],'code':_0x320985[_0x2d5756(0xff)],'name':_0x320985[_0x2d5756(0x105)],'description':_0x320985[_0x2d5756(0xe7)],'source':_0x320985[_0x2d5756(0x10f)],'dbId':_0x587111[_0x2d5756(0x111)],'dbName':_0x587111[_0x2d5756(0x10c)],'tableName':_0x587111[_0x2d5756(0x104)],'relatedPageCount':Array[_0x2d5756(0x10b)](_0x320985[_0x2d5756(0xf5)])?_0x320985[_0x2d5756(0xf5)]['length']:undefined};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a60_0x21bfeb=a60_0x1961;function a60_0x1961(_0xd49a6f,_0x322261){_0xd49a6f=_0xd49a6f-0xad;const _0x3e7fcd=a60_0x3e7f();let _0x196185=_0x3e7fcd[_0xd49a6f];return _0x196185;}(function(_0x760469,_0x4df978){const _0xbc5855=a60_0x1961,_0x54d9e5=_0x760469();while(!![]){try{const _0x53f930=-parseInt(_0xbc5855(0xf9))/0x1+parseInt(_0xbc5855(0xd3))/0x2*(-parseInt(_0xbc5855(0xe5))/0x3)+parseInt(_0xbc5855(0xc4))/0x4+-parseInt(_0xbc5855(0xd9))/0x5*(parseInt(_0xbc5855(0xe7))/0x6)+parseInt(_0xbc5855(0xf4))/0x7*(-parseInt(_0xbc5855(0xf3))/0x8)+parseInt(_0xbc5855(0xee))/0x9*(parseInt(_0xbc5855(0xae))/0xa)+parseInt(_0xbc5855(0xaf))/0xb;if(_0x53f930===_0x4df978)break;else _0x54d9e5['push'](_0x54d9e5['shift']());}catch(_0x5a7219){_0x54d9e5['push'](_0x54d9e5['shift']());}}}(a60_0x3e7f,0x4915a));import{getDatasetDetail}from'../../core/api-client.js';import{CODE_FLAG,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function normalizeField(_0x4fc293){const _0x458e98=a60_0x1961;if(_0x4fc293['deleted'])return null;const _0x24dfe5=Boolean(_0x4fc293[_0x458e98(0xc7)]!==undefined||_0x4fc293[_0x458e98(0xde)]!==undefined);let _0x5c7e07={};if(!_0x24dfe5&&typeof _0x4fc293[_0x458e98(0xc3)]===_0x458e98(0xeb))try{_0x5c7e07=JSON[_0x458e98(0xd8)](_0x4fc293[_0x458e98(0xc3)]);}catch{}const _0x436240=_0x24dfe5?_0x4fc293['name']:_0x4fc293[_0x458e98(0xcf)],_0x5a6f17=_0x24dfe5?_0x4fc293[_0x458e98(0xc7)]:_0x4fc293['name'],_0x389ece=_0x24dfe5?_0x4fc293[_0x458e98(0xde)]:_0x4fc293[_0x458e98(0xad)]||_0x4fc293[_0x458e98(0xe8)],_0xa05609=_0x24dfe5?_0x4fc293['pkField']===!![]:_0x5c7e07[_0x458e98(0xc8)]===!![],_0x5b7ad2=_0x24dfe5?_0x4fc293[_0x458e98(0xb2)]===!![]:_0x5c7e07[_0x458e98(0xb2)]===!![],_0x283353=_0x24dfe5?_0x4fc293[_0x458e98(0xe0)]??null:_0x5c7e07[_0x458e98(0xe0)]??null,_0x30926b={'name':_0x436240,'displayName':_0x5a6f17||_0x436240,'type':_0x389ece,'dbType':_0x4fc293[_0x458e98(0xea)],'pk':_0xa05609,'required':_0x5b7ad2,'description':_0x4fc293['description']||undefined};return Array[_0x458e98(0xba)](_0x283353)&&_0x283353[_0x458e98(0xdb)]>0x0&&(_0x30926b[_0x458e98(0xe0)]=_0x283353),_0x30926b;}function parseJsonMaybe(_0x599ce8){const _0x51f686=a60_0x1961;if(typeof _0x599ce8!==_0x51f686(0xeb))return _0x599ce8;try{return JSON[_0x51f686(0xd8)](_0x599ce8);}catch{return _0x599ce8;}}function normalizeOperationEntry(_0x32727b,_0x1d139f){const _0xcd993c=a60_0x1961;if(!_0x1d139f||typeof _0x1d139f!=='object')return null;if(!_0x1d139f[_0xcd993c(0xe1)]||!_0x1d139f[_0xcd993c(0xbf)])return null;const _0x127f41={'name':_0x32727b,'method':_0x1d139f[_0xcd993c(0xe1)],'path':_0x1d139f[_0xcd993c(0xbf)]};if(_0x1d139f[_0xcd993c(0xbc)])_0x127f41[_0xcd993c(0xbc)]=_0x1d139f['host'];if(_0x1d139f[_0xcd993c(0xc9)]!=null){const _0x550300=parseJsonMaybe(_0x1d139f[_0xcd993c(0xc9)]);_0x127f41[_0xcd993c(0xc9)]=_0x550300;}if(_0x1d139f[_0xcd993c(0xd4)]!=null){const _0x1d6095=parseJsonMaybe(_0x1d139f[_0xcd993c(0xd4)]);_0x127f41['responseBody']=_0x1d6095;}if(_0x1d139f[_0xcd993c(0xd2)]!=null)_0x127f41['beforeScriptId']=_0x1d139f[_0xcd993c(0xd2)];if(_0x1d139f[_0xcd993c(0xb5)]!=null)_0x127f41[_0xcd993c(0xb5)]=_0x1d139f[_0xcd993c(0xb5)];if(Array[_0xcd993c(0xba)](_0x1d139f[_0xcd993c(0xcb)]))_0x127f41[_0xcd993c(0xcb)]=_0x1d139f[_0xcd993c(0xcb)];if(Array[_0xcd993c(0xba)](_0x1d139f[_0xcd993c(0xc6)]))_0x127f41['responseFields']=_0x1d139f[_0xcd993c(0xc6)];return _0x127f41;}function a60_0x3e7f(){const _0x8d0c05=['requestBody','properties','requestFields','alias','split','relations','code','relatedPageInfoList','allFields','beforeScriptId','12086BeGxyI','responseBody','creatorNameField','columnCodeListWithDeleted','allFieldNames','parse','5gvpCZJ','operations','length','source','modelId','doType','push','options','method','sourceType','trim','dblinkInfoDTO','159IpbnFp','modifierIdField','1995138TBioBD','dataType','fromField','dbType','string','deleted','datasetKey','227061bWjHlJ','str','filter','dbName','modifierNameField','55000qZBxGM','329dhMduK','detail','fields','doVersion','modelCode','159646SAhIpI','type','170yEjeot','5612640JlyCLJ','object','toField','required','title','tableName','afterScriptId','name','Get\x20dataset\x20detail\x20including\x20fields\x20and\x20operations','dataset','createTimeField','isArray','dbId','host','indexes','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon).\x20Resolves\x20to\x20dataset\x20code\x20automatically','path','map','formatRules','dbtableConfig','extend','1983176SCxjMP','entries','responseFields','displayName','pkField'];a60_0x3e7f=function(){return _0x8d0c05;};return a60_0x3e7f();}function summarizeDbtable(_0x7ed523){const _0x4fd659=a60_0x1961,_0x12ec13={},_0x272a45=['dbId','dbName',_0x4fd659(0xb4),_0x4fd659(0xed),'pkField','allFields','logicField',_0x4fd659(0xb9),'updateTimeField','creatorIdField',_0x4fd659(0xd5),_0x4fd659(0xe6),_0x4fd659(0xf2),'labelField',_0x4fd659(0xe4)];for(const _0x5e4ed1 of _0x272a45){if(_0x7ed523[_0x5e4ed1]!==undefined)_0x12ec13[_0x5e4ed1]=_0x7ed523[_0x5e4ed1];}return typeof _0x12ec13[_0x4fd659(0xd1)]===_0x4fd659(0xeb)&&_0x12ec13[_0x4fd659(0xd1)][_0x4fd659(0xdb)]>0x0&&(_0x12ec13[_0x4fd659(0xd7)]=_0x12ec13['allFields'][_0x4fd659(0xcd)](',')[_0x4fd659(0xc0)](_0x26ecac=>_0x26ecac[_0x4fd659(0xe3)]())['filter'](Boolean)),_0x12ec13;}function normalizeRelatedPages(_0x19a1e9){const _0x232617=a60_0x1961;if(!Array['isArray'](_0x19a1e9))return[];return _0x19a1e9[_0x232617(0xf0)](_0x38260a=>_0x38260a&&typeof _0x38260a===_0x232617(0xb0))['map'](_0x35bb3c=>({'id':_0x35bb3c['id'],'type':_0x35bb3c[_0x232617(0xad)],'code':_0x35bb3c[_0x232617(0xcf)],'title':_0x35bb3c[_0x232617(0xb3)],'deleted':_0x35bb3c[_0x232617(0xec)]===!![]}));}export const datasetDetail={'service':a60_0x21bfeb(0xb8),'command':a60_0x21bfeb(0xf5),'description':a60_0x21bfeb(0xb7),'risk':'read','flags':[CODE_FLAG,APPCODE_FLAG_OPTIONAL,{'name':a60_0x21bfeb(0xcc),'type':a60_0x21bfeb(0xeb),'description':a60_0x21bfeb(0xbe)}],async 'execute'(_0x44aed0){const _0x27c3c9=a60_0x21bfeb,_0x53d73a=await getDatasetDetail(_0x44aed0[_0x27c3c9(0xef)](_0x27c3c9(0xcf))),_0x5400f8=Array[_0x27c3c9(0xba)](_0x53d73a[_0x27c3c9(0xf6)])?_0x53d73a[_0x27c3c9(0xf6)]:Array['isArray'](_0x53d73a['properties'])?_0x53d73a[_0x27c3c9(0xca)]:[],_0x162b05=_0x5400f8[_0x27c3c9(0xc0)](_0x26560f=>normalizeField(_0x26560f))[_0x27c3c9(0xf0)](_0x11e709=>_0x11e709!==null),_0x52096e=_0x53d73a[_0x27c3c9(0xda)]??{},_0x1d86c7=[];for(const [_0x106dd4,_0x5da237]of Object[_0x27c3c9(0xc5)](_0x52096e)){const _0x157152=normalizeOperationEntry(_0x106dd4,_0x5da237);if(_0x157152)_0x1d86c7[_0x27c3c9(0xdf)](_0x157152);}const _0xaa10=_0x53d73a[_0x27c3c9(0xc2)]??{},_0x38f880=_0x53d73a[_0x27c3c9(0xb8)]??{},_0x5cd708=_0xaa10['dbId']!=null?{'id':_0xaa10[_0x27c3c9(0xbb)],'name':_0xaa10[_0x27c3c9(0xf1)]??null}:undefined;let _0x104370;return typeof _0x53d73a[_0x27c3c9(0xc3)]===_0x27c3c9(0xeb)&&(_0x104370=parseJsonMaybe(_0x53d73a[_0x27c3c9(0xc3)])),{'ok':!![],'data':{'id':_0x53d73a[_0x27c3c9(0xdd)]??_0x53d73a['id'],'name':_0x53d73a[_0x27c3c9(0xb6)],'code':_0x53d73a[_0x27c3c9(0xf8)]||_0x53d73a[_0x27c3c9(0xcf)],'doVersion':_0x53d73a[_0x27c3c9(0xf7)],'description':_0x53d73a['description']||_0x38f880['tableComment']||undefined,'source':_0x53d73a[_0x27c3c9(0xdc)]||_0x38f880[_0x27c3c9(0xe2)],'table':_0xaa10[_0x27c3c9(0xb4)]||_0x38f880[_0x27c3c9(0xb4)],'datasetKey':_0xaa10['datasetKey'],'pk':_0xaa10[_0x27c3c9(0xc8)],'db':_0x5cd708,'dbtable':summarizeDbtable(_0xaa10),'fields':_0x162b05,'operations':_0x1d86c7,'indexes':Array[_0x27c3c9(0xba)](_0x38f880[_0x27c3c9(0xbd)])?_0x38f880[_0x27c3c9(0xbd)]:[],'relations':Array[_0x27c3c9(0xba)](_0x53d73a[_0x27c3c9(0xce)])?_0x53d73a[_0x27c3c9(0xce)]['map'](_0x4bf9a2=>({'fromField':_0x4bf9a2[_0x27c3c9(0xe9)],'toDataset':_0x4bf9a2['toDatasetName'],'toCode':_0x4bf9a2['toDatasetCode'],'toTable':_0x4bf9a2['toTableName'],'toField':_0x4bf9a2[_0x27c3c9(0xb1)],'labelField':_0x4bf9a2['toFieldLabel']||undefined})):[],'relatedPages':normalizeRelatedPages(_0x53d73a[_0x27c3c9(0xd0)]),...Array[_0x27c3c9(0xba)](_0x53d73a[_0x27c3c9(0xd6)])?{'columnCodeListWithDeleted':_0x53d73a['columnCodeListWithDeleted']}:{},'formatRules':Array[_0x27c3c9(0xba)](_0x53d73a[_0x27c3c9(0xc1)])?_0x53d73a[_0x27c3c9(0xc1)]:[],'validateRules':Array[_0x27c3c9(0xba)](_0x53d73a['validateRules'])?_0x53d73a['validateRules']:[],..._0x104370!==undefined?{'extend':_0x104370}:{},'stats':{'fieldCount':_0x162b05['length'],'operationCount':_0x1d86c7[_0x27c3c9(0xdb)]}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a61_0x1cdbe4=a61_0x41e3;(function(_0x515d7d,_0x3b0734){const _0x21d670=a61_0x41e3,_0x3fb8ec=_0x515d7d();while(!![]){try{const _0x185c9c=-parseInt(_0x21d670(0x1f6))/0x1*(-parseInt(_0x21d670(0x1fd))/0x2)+parseInt(_0x21d670(0x20c))/0x3*(parseInt(_0x21d670(0x224))/0x4)+-parseInt(_0x21d670(0x200))/0x5+-parseInt(_0x21d670(0x207))/0x6*(-parseInt(_0x21d670(0x1f2))/0x7)+-parseInt(_0x21d670(0x202))/0x8*(-parseInt(_0x21d670(0x217))/0x9)+-parseInt(_0x21d670(0x226))/0xa*(parseInt(_0x21d670(0x212))/0xb)+-parseInt(_0x21d670(0x205))/0xc;if(_0x185c9c===_0x3b0734)break;else _0x3fb8ec['push'](_0x3fb8ec['shift']());}catch(_0x3aaa5c){_0x3fb8ec['push'](_0x3fb8ec['shift']());}}}(a61_0x5b6c,0xc443a));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const MUTABLE_EXTEND_KEYS=new Set(),EXTEND_PATCH_REDIRECTS=new Map([[a61_0x1cdbe4(0x1ed),{'message':a61_0x1cdbe4(0x1f8),'hint':a61_0x1cdbe4(0x21e)}]]);export function parseJsonObjectFlag(_0x2cd7b0,_0x55082b){const _0x4d8a67=a61_0x1cdbe4;if(!_0x2cd7b0)return undefined;let _0x25a615;try{_0x25a615=JSON[_0x4d8a67(0x211)](_0x2cd7b0);}catch(_0x3d1bbc){const _0x5f2118=_0x3d1bbc instanceof Error?_0x3d1bbc[_0x4d8a67(0x213)]:String(_0x3d1bbc);throw CliErrors['validation'](_0x55082b+_0x4d8a67(0x204)+_0x5f2118);}if(!isPlainObject(_0x25a615)||Array[_0x4d8a67(0x20d)](_0x25a615))throw CliErrors['validation'](_0x55082b+_0x4d8a67(0x21d));return _0x25a615;}export function validateExtendPatchKeys(_0x9fbf9e){const _0x361a8d=a61_0x1cdbe4,_0x3991d6=Object[_0x361a8d(0x1f9)](_0x9fbf9e);if(_0x3991d6[_0x361a8d(0x229)]===0x0)throw CliErrors[_0x361a8d(0x230)](_0x361a8d(0x1fe));for(const _0x36f2a9 of _0x3991d6){const _0x2c2e8c=EXTEND_PATCH_REDIRECTS['get'](_0x36f2a9);if(_0x2c2e8c)throw CliErrors[_0x361a8d(0x230)](_0x2c2e8c[_0x361a8d(0x213)],_0x2c2e8c[_0x361a8d(0x20e)]);if(!MUTABLE_EXTEND_KEYS[_0x361a8d(0x22f)](_0x36f2a9))throw CliErrors['validation'](_0x361a8d(0x201)+_0x36f2a9,describeMutableExtendKeys());}}function a61_0x41e3(_0x1954c8,_0x190fa5){_0x1954c8=_0x1954c8-0x1ed;const _0x5b6ca9=a61_0x5b6c();let _0x41e32d=_0x5b6ca9[_0x1954c8];return _0x41e32d;}function a61_0x5b6c(){const _0x443c5c=[',\x20actual\x20','\x20must\x20be\x20a\x20JSON\x20object','Use\x20`rabetbase\x20dataset\x20business-group-update`\x20to\x20update\x20business\x20model\x20groups.','join','object','--code\x20is\x20required','datasetCode','dbtableConfig','3521528AGFOcQ','tableName','10RFduDI','extend','push','length','Allowed\x20keys:\x20','No\x20dataset\x20extend\x20patch\x20keys\x20are\x20currently\x20supported.','dataset','stringify','expect-json','has','validation','dbName','name','shape','businessGroup','JSON\x20object\x20patch\x20for\x20dataset\x20top-level\x20extend;\x20current\x20allowlist\x20is\x20empty','Updated\x20dataset\x20extend\x20(','patch-json','dbId','2020676uMlzwf','extend-update','entries','patch','274179coypZC','trim','dataset\x20extend-update\x20does\x20not\x20support\x20businessGroup;\x20use\x20dataset\x20business-group-update','keys','extend.','JSON\x20object\x20of\x20expected\x20current\x20extend\x20values;\x20mismatch\x20aborts\x20without\x20writing','Expected\x20','10mIjkpt','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','/smartapi/dataset/update-driven-data','4175665fDrzmn','Unsupported\x20patch\x20key:\x20','63608guMlCW','data','\x20must\x20be\x20valid\x20JSON\x20object:\x20','8942328EtMzgl','POST','6jNFDxg','datasetId','sort','value','Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object','3TYXALh','isArray','hint','code','--patch-json','parse','7048041zoglbI','message','modelCode','appCode','string','549kltuAP','No\x20changes\x20for\x20dataset\x20extend','str','datasetName','write'];a61_0x5b6c=function(){return _0x443c5c;};return a61_0x5b6c();}function describeMutableExtendKeys(){const _0x55dfd7=a61_0x1cdbe4,_0x343fce=Array['from'](MUTABLE_EXTEND_KEYS)[_0x55dfd7(0x209)]();return _0x343fce[_0x55dfd7(0x229)]>0x0?_0x55dfd7(0x22a)+_0x343fce[_0x55dfd7(0x21f)](',\x20'):_0x55dfd7(0x22b);}export function applyExtendPatch(_0x2595a6,_0x19b79d){const _0x5a69eb=a61_0x1cdbe4;validateExtendPatchKeys(_0x19b79d);const _0x41e335=deepClone(_0x2595a6),_0x525254=[];for(const [_0xe4a200,_0x48f3bf]of Object[_0x5a69eb(0x1f4)](_0x19b79d)){const _0x60b56a=_0x41e335[_0xe4a200],_0x4946c6=deepClone(_0x48f3bf);!deepEqual(_0x60b56a,_0x4946c6)&&(_0x41e335[_0xe4a200]=_0x4946c6,_0x525254[_0x5a69eb(0x228)](_0x5a69eb(0x1fa)+_0xe4a200));}return _0x525254[_0x5a69eb(0x209)](),{'after':_0x41e335,'changedPaths':_0x525254,'changed':_0x525254[_0x5a69eb(0x229)]>0x0};}export function assertExpectation(_0x331de3,_0x4c5803){const _0x216e12=a61_0x1cdbe4;if(!_0x4c5803)return;for(const [_0x3d8739,_0x1d92ff]of Object['entries'](_0x4c5803)){const _0x39629c=_0x331de3[_0x3d8739];if(!deepEqual(_0x39629c,_0x1d92ff))throw CliErrors['validation']('Expectation\x20mismatch\x20at\x20extend.'+_0x3d8739,_0x216e12(0x1fc)+JSON[_0x216e12(0x22d)](_0x1d92ff)+_0x216e12(0x21c)+JSON[_0x216e12(0x22d)](_0x39629c));}}export async function buildDatasetExtendUpdateResult({appCode:_0x16056c,input:_0x22be24,dryRun:_0x304a6f}){const _0x2f4234=a61_0x1cdbe4;validateInput(_0x22be24);const _0x32c1f4=await getDatasetDetail(_0x22be24[_0x2f4234(0x20f)]),_0xd58e05=parseDatasetExtend(_0x32c1f4[_0x2f4234(0x227)]),_0x144a70=deepClone(_0xd58e05[_0x2f4234(0x20a)]);assertExpectation(_0x144a70,_0x22be24['expect']);const {after:_0x12e338,changedPaths:_0xab0a8f,changed:_0x5774bd}=applyExtendPatch(_0x144a70,_0x22be24[_0x2f4234(0x1f5)]),_0x495930=summarizeDataset(_0x32c1f4,_0x22be24['code']);return _0x5774bd&&!_0x304a6f&&(_0x32c1f4[_0x2f4234(0x227)]=serializeDatasetExtend(_0x12e338,_0xd58e05[_0x2f4234(0x233)]),await updateDrivenData(_0x32c1f4)),{'ok':!![],'data':{'protocol':'dataset-extend-update.v1','appCode':_0x16056c,'selector':{'code':_0x22be24[_0x2f4234(0x20f)]},'dataset':_0x495930,'dryRun':_0x304a6f,'changed':_0x5774bd,'changedPaths':_0xab0a8f,'before':{'extend':_0x144a70},'after':{'extend':_0x12e338},'submitted':_0x5774bd&&!_0x304a6f},'message':_0x5774bd?_0x304a6f?'Dry-run:\x20dataset\x20extend\x20would\x20change\x20('+_0xab0a8f[_0x2f4234(0x21f)](',\x20')+')':_0x2f4234(0x1ef)+_0xab0a8f[_0x2f4234(0x21f)](',\x20')+')':_0x2f4234(0x218)};}export const datasetExtendUpdate={'service':a61_0x1cdbe4(0x22c),'command':a61_0x1cdbe4(0x1f3),'description':'Patch\x20dataset\x20top-level\x20extend\x20safely','risk':a61_0x1cdbe4(0x21b),'flags':[CODE_FLAG,{'name':a61_0x1cdbe4(0x1f0),'type':a61_0x1cdbe4(0x216),'required':!![],'description':a61_0x1cdbe4(0x1ee)},{'name':a61_0x1cdbe4(0x22e),'type':'string','required':![],'description':a61_0x1cdbe4(0x1fb)},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x1ed581){validateInput(readExtendUpdateInput(_0x1ed581));},async 'dryRun'(_0x5cd844){const _0x27f2c6=a61_0x1cdbe4,_0x5cad8f=await buildDatasetExtendUpdateResult({'appCode':_0x5cd844[_0x27f2c6(0x215)],'input':readExtendUpdateInput(_0x5cd844),'dryRun':!![]});return{'method':_0x27f2c6(0x206),'url':_0x27f2c6(0x1ff),'body':_0x5cad8f[_0x27f2c6(0x203)],'description':_0x5cad8f['message']};},async 'execute'(_0x4d442b){const _0x380084=a61_0x1cdbe4;return buildDatasetExtendUpdateResult({'appCode':_0x4d442b[_0x380084(0x215)],'input':readExtendUpdateInput(_0x4d442b),'dryRun':![]});}};function readExtendUpdateInput(_0x548346){const _0x64939b=a61_0x1cdbe4,_0x49f31f=trim(_0x548346[_0x64939b(0x219)]('code')),_0x466d76=parseJsonObjectFlag(_0x548346['str']('patch-json'),_0x64939b(0x210)),_0x238839=parseJsonObjectFlag(_0x548346['str'](_0x64939b(0x22e)),'--expect-json');return{'code':_0x49f31f,'patch':_0x466d76||{},'expect':_0x238839};}function validateInput(_0x2a34a3){const _0x162f0b=a61_0x1cdbe4;if(!_0x2a34a3['code'])throw CliErrors[_0x162f0b(0x230)](_0x162f0b(0x221));validateExtendPatchKeys(_0x2a34a3[_0x162f0b(0x1f5)]);}function parseDatasetExtend(_0x1e63f1){const _0x278676=a61_0x1cdbe4;if(typeof _0x1e63f1===_0x278676(0x216)){const _0xfe58b9=_0x1e63f1[_0x278676(0x1f7)]();if(!_0xfe58b9)return{'value':{},'shape':_0x278676(0x216)};let _0xe38700;try{_0xe38700=JSON[_0x278676(0x211)](_0xfe58b9);}catch(_0x54d34d){const _0x5ac367=_0x54d34d instanceof Error?_0x54d34d[_0x278676(0x213)]:String(_0x54d34d);throw CliErrors['validation']('Dataset\x20extend\x20must\x20be\x20valid\x20JSON\x20object:\x20'+_0x5ac367);}if(!isPlainObject(_0xe38700)||Array['isArray'](_0xe38700))throw CliErrors[_0x278676(0x230)](_0x278676(0x20b));return{'value':_0xe38700,'shape':'string'};}if(_0x1e63f1===undefined||_0x1e63f1===null)return{'value':{},'shape':'string'};if(!isPlainObject(_0x1e63f1)||Array[_0x278676(0x20d)](_0x1e63f1))throw CliErrors[_0x278676(0x230)](_0x278676(0x20b));return{'value':_0x1e63f1,'shape':_0x278676(0x220)};}function serializeDatasetExtend(_0x137c40,_0x435139){const _0xf578b5=a61_0x1cdbe4;return _0x435139==='string'?JSON[_0xf578b5(0x22d)](_0x137c40):_0x137c40;}function summarizeDataset(_0x107d8c,_0x263bf5){const _0x48b9fd=a61_0x1cdbe4,_0x4e1b45=isPlainObject(_0x107d8c[_0x48b9fd(0x22c)])?_0x107d8c[_0x48b9fd(0x22c)]:{},_0x3b6e0f=isPlainObject(_0x107d8c[_0x48b9fd(0x223)])?_0x107d8c['dbtableConfig']:{};return{'id':_0x107d8c['modelId']??_0x107d8c['id']??_0x4e1b45[_0x48b9fd(0x208)]??null,'code':_0x107d8c[_0x48b9fd(0x214)]??_0x107d8c[_0x48b9fd(0x20f)]??_0x4e1b45[_0x48b9fd(0x222)]??_0x263bf5,'name':_0x107d8c[_0x48b9fd(0x232)]??_0x4e1b45[_0x48b9fd(0x21a)]??null,'table':_0x3b6e0f[_0x48b9fd(0x225)]??_0x4e1b45[_0x48b9fd(0x225)]??null,'db':_0x3b6e0f[_0x48b9fd(0x231)]??_0x3b6e0f[_0x48b9fd(0x1f1)]??null};}function deepClone(_0x187fac){if(_0x187fac===undefined)return _0x187fac;return JSON['parse'](JSON['stringify'](_0x187fac));}function deepEqual(_0x1b5553,_0x4ad77f){const _0x3014f4=a61_0x1cdbe4;return JSON[_0x3014f4(0x22d)](_0x1b5553)===JSON[_0x3014f4(0x22d)](_0x4ad77f);}function isPlainObject(_0x1195c2){const _0x51b993=a61_0x1cdbe4;return Boolean(_0x1195c2)&&typeof _0x1195c2===_0x51b993(0x220)&&!Array[_0x51b993(0x20d)](_0x1195c2);}function trim(_0x364b8c){const _0x22fc74=String(_0x364b8c||'')['trim']();return _0x22fc74;}
|
|
1
|
+
const a61_0x1b4902=a61_0x20b5;(function(_0x2c1981,_0x3c0fc1){const _0x9a8f5=a61_0x20b5,_0x4df4c1=_0x2c1981();while(!![]){try{const _0x4b4c1a=-parseInt(_0x9a8f5(0x16c))/0x1*(-parseInt(_0x9a8f5(0x188))/0x2)+-parseInt(_0x9a8f5(0x177))/0x3*(parseInt(_0x9a8f5(0x182))/0x4)+parseInt(_0x9a8f5(0x174))/0x5*(-parseInt(_0x9a8f5(0x185))/0x6)+parseInt(_0x9a8f5(0x18f))/0x7*(parseInt(_0x9a8f5(0x16d))/0x8)+-parseInt(_0x9a8f5(0x15a))/0x9*(-parseInt(_0x9a8f5(0x172))/0xa)+-parseInt(_0x9a8f5(0x16b))/0xb+parseInt(_0x9a8f5(0x166))/0xc;if(_0x4b4c1a===_0x3c0fc1)break;else _0x4df4c1['push'](_0x4df4c1['shift']());}catch(_0x58f361){_0x4df4c1['push'](_0x4df4c1['shift']());}}}(a61_0x7c3b,0xb6aa2));import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';const MUTABLE_EXTEND_KEYS=new Set(),EXTEND_PATCH_REDIRECTS=new Map([[a61_0x1b4902(0x16a),{'message':'dataset\x20extend-update\x20does\x20not\x20support\x20businessGroup;\x20use\x20dataset\x20business-group-update','hint':a61_0x1b4902(0x173)}]]);export function parseJsonObjectFlag(_0x32c955,_0x558a1a){const _0x2f3540=a61_0x1b4902;if(!_0x32c955)return undefined;let _0x169bd5;try{_0x169bd5=JSON[_0x2f3540(0x183)](_0x32c955);}catch(_0x42b3f9){const _0x3448c1=_0x42b3f9 instanceof Error?_0x42b3f9[_0x2f3540(0x14f)]:String(_0x42b3f9);throw CliErrors[_0x2f3540(0x157)](_0x558a1a+_0x2f3540(0x162)+_0x3448c1);}if(!isPlainObject(_0x169bd5)||Array[_0x2f3540(0x180)](_0x169bd5))throw CliErrors['validation'](_0x558a1a+_0x2f3540(0x170));return _0x169bd5;}export function validateExtendPatchKeys(_0x9b8112){const _0x1ce4c1=a61_0x1b4902,_0x379b60=Object['keys'](_0x9b8112);if(_0x379b60['length']===0x0)throw CliErrors['validation'](_0x1ce4c1(0x18c));for(const _0x1dd7ca of _0x379b60){const _0x486c89=EXTEND_PATCH_REDIRECTS[_0x1ce4c1(0x164)](_0x1dd7ca);if(_0x486c89)throw CliErrors['validation'](_0x486c89[_0x1ce4c1(0x14f)],_0x486c89[_0x1ce4c1(0x190)]);if(!MUTABLE_EXTEND_KEYS[_0x1ce4c1(0x15f)](_0x1dd7ca))throw CliErrors['validation']('Unsupported\x20patch\x20key:\x20'+_0x1dd7ca,describeMutableExtendKeys());}}function describeMutableExtendKeys(){const _0x5bc5ec=a61_0x1b4902,_0x18a148=Array['from'](MUTABLE_EXTEND_KEYS)[_0x5bc5ec(0x15e)]();return _0x18a148[_0x5bc5ec(0x17e)]>0x0?_0x5bc5ec(0x15d)+_0x18a148[_0x5bc5ec(0x150)](',\x20'):_0x5bc5ec(0x17f);}export function applyExtendPatch(_0x3a053e,_0x314713){const _0x2c6406=a61_0x1b4902;validateExtendPatchKeys(_0x314713);const _0x34355a=deepClone(_0x3a053e),_0x301605=[];for(const [_0x555828,_0x541da4]of Object['entries'](_0x314713)){const _0x1bcb64=_0x34355a[_0x555828],_0x2e9f0d=deepClone(_0x541da4);!deepEqual(_0x1bcb64,_0x2e9f0d)&&(_0x34355a[_0x555828]=_0x2e9f0d,_0x301605[_0x2c6406(0x18b)](_0x2c6406(0x16f)+_0x555828));}return _0x301605['sort'](),{'after':_0x34355a,'changedPaths':_0x301605,'changed':_0x301605[_0x2c6406(0x17e)]>0x0};}export function assertExpectation(_0x5257d7,_0x2eeaa1){const _0x12418e=a61_0x1b4902;if(!_0x2eeaa1)return;for(const [_0x263f42,_0x5ddc3f]of Object[_0x12418e(0x14e)](_0x2eeaa1)){const _0x292ea0=_0x5257d7[_0x263f42];if(!deepEqual(_0x292ea0,_0x5ddc3f))throw CliErrors[_0x12418e(0x157)](_0x12418e(0x156)+_0x263f42,_0x12418e(0x155)+JSON[_0x12418e(0x15c)](_0x5ddc3f)+_0x12418e(0x158)+JSON[_0x12418e(0x15c)](_0x292ea0));}}export async function buildDatasetExtendUpdateResult({appCode:_0x4ca60c,input:_0x53f89c,dryRun:_0x25d459}){const _0x57c245=a61_0x1b4902;validateInput(_0x53f89c);const _0x1b5b51=await getDatasetDetail(_0x53f89c['code']),_0x13fd78=parseDatasetExtend(_0x1b5b51[_0x57c245(0x165)]),_0x3e8f9d=deepClone(_0x13fd78[_0x57c245(0x160)]);assertExpectation(_0x3e8f9d,_0x53f89c['expect']);const {after:_0x5d3c73,changedPaths:_0x5881d,changed:_0x38d56e}=applyExtendPatch(_0x3e8f9d,_0x53f89c['patch']),_0x267f8c=summarizeDataset(_0x1b5b51,_0x53f89c['code']);return _0x38d56e&&!_0x25d459&&(_0x1b5b51['extend']=serializeDatasetExtend(_0x5d3c73,_0x13fd78[_0x57c245(0x18d)]),await updateDrivenData(_0x1b5b51)),{'ok':!![],'data':{'protocol':_0x57c245(0x18a),'appCode':_0x4ca60c,'selector':{'code':_0x53f89c[_0x57c245(0x186)]},'dataset':_0x267f8c,'dryRun':_0x25d459,'changed':_0x38d56e,'changedPaths':_0x5881d,'before':{'extend':_0x3e8f9d},'after':{'extend':_0x5d3c73},'submitted':_0x38d56e&&!_0x25d459},'message':_0x38d56e?_0x25d459?_0x57c245(0x179)+_0x5881d['join'](',\x20')+')':_0x57c245(0x163)+_0x5881d[_0x57c245(0x150)](',\x20')+')':_0x57c245(0x161)};}function a61_0x20b5(_0x1ef788,_0x1d83a3){_0x1ef788=_0x1ef788-0x14e;const _0x7c3b77=a61_0x7c3b();let _0x20b588=_0x7c3b77[_0x1ef788];return _0x20b588;}export const datasetExtendUpdate={'service':a61_0x1b4902(0x17c),'command':a61_0x1b4902(0x178),'description':'Patch\x20dataset\x20top-level\x20extend\x20safely','risk':a61_0x1b4902(0x17d),'flags':[CODE_FLAG,{'name':a61_0x1b4902(0x153),'type':a61_0x1b4902(0x189),'required':!![],'description':a61_0x1b4902(0x169)},{'name':a61_0x1b4902(0x159),'type':a61_0x1b4902(0x189),'required':![],'description':'JSON\x20object\x20of\x20expected\x20current\x20extend\x20values;\x20mismatch\x20aborts\x20without\x20writing'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2c2d31){validateInput(readExtendUpdateInput(_0x2c2d31));},async 'dryRun'(_0x5315eb){const _0x592629=a61_0x1b4902,_0x46c297=await buildDatasetExtendUpdateResult({'appCode':_0x5315eb['appCode'],'input':readExtendUpdateInput(_0x5315eb),'dryRun':!![]});return{'method':_0x592629(0x17b),'url':'/smartapi/dataset/update-driven-data','body':_0x46c297['data'],'description':_0x46c297['message']};},async 'execute'(_0x27937c){const _0x5bedce=a61_0x1b4902;return buildDatasetExtendUpdateResult({'appCode':_0x27937c[_0x5bedce(0x15b)],'input':readExtendUpdateInput(_0x27937c),'dryRun':![]});}};function a61_0x7c3b(){const _0x36c9d1=['56kNADuy','hint','entries','message','join','--code\x20is\x20required','dbName','patch-json','Dataset\x20extend\x20must\x20be\x20a\x20JSON\x20object','Expected\x20','Expectation\x20mismatch\x20at\x20extend.','validation',',\x20actual\x20','expect-json','5229063eYpVWw','appCode','stringify','Allowed\x20keys:\x20','sort','has','value','No\x20changes\x20for\x20dataset\x20extend','\x20must\x20be\x20valid\x20JSON\x20object:\x20','Updated\x20dataset\x20extend\x20(','get','extend','15226284HlXcHl','datasetCode','tableName','JSON\x20object\x20patch\x20for\x20dataset\x20top-level\x20extend;\x20current\x20allowlist\x20is\x20empty','businessGroup','10116117sqnSTQ','57AhNUPs','469992XNsjNq','modelCode','extend.','\x20must\x20be\x20a\x20JSON\x20object','modelId','10fuGkNc','Use\x20`rabetbase\x20dataset\x20business-group-update`\x20to\x20update\x20business\x20model\x20groups.','10LYyGuK','name','str','15HUyXOS','extend-update','Dry-run:\x20dataset\x20extend\x20would\x20change\x20(','dbtableConfig','POST','dataset','write','length','No\x20dataset\x20extend\x20patch\x20keys\x20are\x20currently\x20supported.','isArray','dbId','1044952ZsrsGE','parse','object','1475088wsGIss','code','datasetName','40206prucGy','string','dataset-extend-update.v1','push','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','shape','trim'];a61_0x7c3b=function(){return _0x36c9d1;};return a61_0x7c3b();}function readExtendUpdateInput(_0x3a5baf){const _0x4a85c9=a61_0x1b4902,_0x8333c3=trim(_0x3a5baf['str']('code')),_0x5af9c0=parseJsonObjectFlag(_0x3a5baf['str'](_0x4a85c9(0x153)),'--patch-json'),_0x5e29d9=parseJsonObjectFlag(_0x3a5baf[_0x4a85c9(0x176)](_0x4a85c9(0x159)),'--expect-json');return{'code':_0x8333c3,'patch':_0x5af9c0||{},'expect':_0x5e29d9};}function validateInput(_0x43c501){const _0x5ec740=a61_0x1b4902;if(!_0x43c501[_0x5ec740(0x186)])throw CliErrors[_0x5ec740(0x157)](_0x5ec740(0x151));validateExtendPatchKeys(_0x43c501['patch']);}function parseDatasetExtend(_0x2dba55){const _0xfc9713=a61_0x1b4902;if(typeof _0x2dba55===_0xfc9713(0x189)){const _0x2d58d4=_0x2dba55[_0xfc9713(0x18e)]();if(!_0x2d58d4)return{'value':{},'shape':'string'};let _0x4c8f3e;try{_0x4c8f3e=JSON[_0xfc9713(0x183)](_0x2d58d4);}catch(_0x123725){const _0x59392d=_0x123725 instanceof Error?_0x123725[_0xfc9713(0x14f)]:String(_0x123725);throw CliErrors['validation']('Dataset\x20extend\x20must\x20be\x20valid\x20JSON\x20object:\x20'+_0x59392d);}if(!isPlainObject(_0x4c8f3e)||Array[_0xfc9713(0x180)](_0x4c8f3e))throw CliErrors[_0xfc9713(0x157)](_0xfc9713(0x154));return{'value':_0x4c8f3e,'shape':_0xfc9713(0x189)};}if(_0x2dba55===undefined||_0x2dba55===null)return{'value':{},'shape':'string'};if(!isPlainObject(_0x2dba55)||Array[_0xfc9713(0x180)](_0x2dba55))throw CliErrors[_0xfc9713(0x157)](_0xfc9713(0x154));return{'value':_0x2dba55,'shape':_0xfc9713(0x184)};}function serializeDatasetExtend(_0x549181,_0x5b06ed){const _0x26ad3a=a61_0x1b4902;return _0x5b06ed===_0x26ad3a(0x189)?JSON[_0x26ad3a(0x15c)](_0x549181):_0x549181;}function summarizeDataset(_0x2f8483,_0x2ea666){const _0x2f61a1=a61_0x1b4902,_0x2f60c6=isPlainObject(_0x2f8483[_0x2f61a1(0x17c)])?_0x2f8483['dataset']:{},_0x3460f0=isPlainObject(_0x2f8483[_0x2f61a1(0x17a)])?_0x2f8483[_0x2f61a1(0x17a)]:{};return{'id':_0x2f8483[_0x2f61a1(0x171)]??_0x2f8483['id']??_0x2f60c6['datasetId']??null,'code':_0x2f8483[_0x2f61a1(0x16e)]??_0x2f8483[_0x2f61a1(0x186)]??_0x2f60c6[_0x2f61a1(0x167)]??_0x2ea666,'name':_0x2f8483[_0x2f61a1(0x175)]??_0x2f60c6[_0x2f61a1(0x187)]??null,'table':_0x3460f0['tableName']??_0x2f60c6[_0x2f61a1(0x168)]??null,'db':_0x3460f0[_0x2f61a1(0x152)]??_0x3460f0[_0x2f61a1(0x181)]??null};}function deepClone(_0x15fcca){const _0x23d8bf=a61_0x1b4902;if(_0x15fcca===undefined)return _0x15fcca;return JSON[_0x23d8bf(0x183)](JSON['stringify'](_0x15fcca));}function deepEqual(_0x2413e5,_0x50cb76){const _0x353179=a61_0x1b4902;return JSON[_0x353179(0x15c)](_0x2413e5)===JSON[_0x353179(0x15c)](_0x50cb76);}function isPlainObject(_0x3db597){const _0x9baecf=a61_0x1b4902;return Boolean(_0x3db597)&&typeof _0x3db597===_0x9baecf(0x184)&&!Array[_0x9baecf(0x180)](_0x3db597);}function trim(_0x1cc5a4){const _0x3e6f5b=a61_0x1b4902,_0x31eadc=String(_0x1cc5a4||'')[_0x3e6f5b(0x18e)]();return _0x31eadc;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a62_0x25d2d6=a62_0xe51b;(function(_0x262b58,_0x43af3b){const _0x516bab=a62_0xe51b,_0x1beb1c=_0x262b58();while(!![]){try{const _0x29522a=parseInt(_0x516bab(0xfb))/0x1*(-parseInt(_0x516bab(0xd8))/0x2)+parseInt(_0x516bab(0xf1))/0x3+-parseInt(_0x516bab(0x111))/0x4+-parseInt(_0x516bab(0xf4))/0x5+parseInt(_0x516bab(0xdf))/0x6*(parseInt(_0x516bab(0xd5))/0x7)+parseInt(_0x516bab(0xf3))/0x8+parseInt(_0x516bab(0x114))/0x9;if(_0x29522a===_0x43af3b)break;else _0x1beb1c['push'](_0x1beb1c['shift']());}catch(_0x5db73e){_0x1beb1c['push'](_0x1beb1c['shift']());}}}(a62_0x204c,0x6debe));import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';const MUTABLE_FIELD_KEYS=new Set([a62_0x25d2d6(0xed),a62_0x25d2d6(0xec),'description',a62_0x25d2d6(0xe4),a62_0x25d2d6(0xe6),a62_0x25d2d6(0xd3),a62_0x25d2d6(0xcf),'chartRole',a62_0x25d2d6(0xe8)]),FORBIDDEN_FIELD_KEYS=new Set(['id',a62_0x25d2d6(0xd4),a62_0x25d2d6(0xd1),a62_0x25d2d6(0xd6),'dbTypeLen','dbTypeScale',a62_0x25d2d6(0x103),'tableName',a62_0x25d2d6(0xde),a62_0x25d2d6(0x105),a62_0x25d2d6(0x10e),a62_0x25d2d6(0xf0)]);export function parseJsonObjectFlag(_0x2ad7b5,_0x50f25f){const _0x56f73b=a62_0x25d2d6;if(!_0x2ad7b5)return undefined;let _0x3caf6d;try{_0x3caf6d=JSON[_0x56f73b(0xe1)](_0x2ad7b5);}catch(_0x505138){const _0x1656d0=_0x505138 instanceof Error?_0x505138[_0x56f73b(0xef)]:String(_0x505138);throw CliErrors[_0x56f73b(0x104)](_0x50f25f+_0x56f73b(0xe5)+_0x1656d0);}if(!isPlainObject(_0x3caf6d)||Array[_0x56f73b(0x106)](_0x3caf6d))throw CliErrors['validation'](_0x50f25f+'\x20must\x20be\x20a\x20JSON\x20object');return _0x3caf6d;}export function validatePatchKeys(_0x21230a){const _0x354aa2=a62_0x25d2d6,_0x13e8f3=Object[_0x354aa2(0xe3)](_0x21230a);if(_0x13e8f3[_0x354aa2(0xf7)]===0x0)throw CliErrors[_0x354aa2(0x104)](_0x354aa2(0x112));for(const _0x5c7329 of _0x13e8f3){if(FORBIDDEN_FIELD_KEYS[_0x354aa2(0xf5)](_0x5c7329))throw CliErrors[_0x354aa2(0x104)](_0x354aa2(0x110)+_0x5c7329);if(!MUTABLE_FIELD_KEYS[_0x354aa2(0xf5)](_0x5c7329))throw CliErrors[_0x354aa2(0x104)](_0x354aa2(0x116)+_0x5c7329,_0x354aa2(0xf9)+Array[_0x354aa2(0xfa)](MUTABLE_FIELD_KEYS)[_0x354aa2(0xdd)](',\x20'));}}export function applyFieldPatch(_0x2b0d60,_0x5e5019){const _0xb6852d=a62_0x25d2d6;validatePatchKeys(_0x5e5019);const _0xb3e398=deepClone(_0x2b0d60),_0x58bba5=new Set();for(const [_0x3870b2,_0x137731]of Object[_0xb6852d(0xd7)](_0x5e5019)){const _0x3658f1=_0xb3e398[_0x3870b2],_0x48f2b7=mergePatchValue(_0x3658f1,_0x137731);!deepEqual(_0x3658f1,_0x48f2b7)&&(_0xb3e398[_0x3870b2]=_0x48f2b7,_0x58bba5['add'](_0x3870b2),collectChangedPaths(_0x3870b2,_0x3658f1,_0x48f2b7,_0x58bba5));}return{'after':_0xb3e398,'changedPaths':Array[_0xb6852d(0xfa)](_0x58bba5)[_0xb6852d(0xe7)](),'changed':_0x58bba5[_0xb6852d(0xfc)]>0x0};}export function assertExpectation(_0x4827ae,_0x59e340){const _0x126152=a62_0x25d2d6;if(!_0x59e340)return;for(const [_0x5390d4,_0x14fe4a]of Object[_0x126152(0xd7)](_0x59e340)){const _0x543a9e=_0x4827ae[_0x5390d4];if(!deepEqual(_0x543a9e,_0x14fe4a))throw CliErrors[_0x126152(0x104)](_0x126152(0xfd)+_0x5390d4,_0x126152(0x115)+JSON[_0x126152(0xff)](_0x14fe4a)+',\x20actual\x20'+JSON[_0x126152(0xff)](_0x543a9e));}}export async function buildDatasetFieldUpdateResult({appCode:_0xd2590f,input:_0x2b571b,dryRun:_0x13fd55}){const _0x13d6a9=a62_0x25d2d6;validateInput(_0x2b571b);const _0x524018=await getDatasetDetail(_0x2b571b[_0x13d6a9(0xd1)]),_0x86037d=readFieldArray(_0x524018),_0x117e8f=_0x86037d['findIndex'](_0x22386f=>_0x22386f?.['name']===_0x2b571b[_0x13d6a9(0xf6)]);if(_0x117e8f<0x0)throw CliErrors[_0x13d6a9(0x104)](_0x13d6a9(0x108)+_0x2b571b[_0x13d6a9(0xf6)]);const _0x3d1140=deepClone(_0x86037d[_0x117e8f]);assertExpectation(_0x3d1140,_0x2b571b[_0x13d6a9(0x102)]);const {after:_0x40e8a3,changedPaths:_0x200506,changed:_0x4623e7}=applyFieldPatch(_0x3d1140,_0x2b571b['patch']),_0x162717=summarizeDataset(_0x524018,_0x2b571b[_0x13d6a9(0xd1)]);return _0x4623e7&&!_0x13fd55&&(_0x86037d[_0x117e8f]=_0x40e8a3,await updateDrivenData(_0x524018)),{'ok':!![],'data':{'protocol':_0x13d6a9(0xea),'appCode':_0xd2590f,'selector':{'code':_0x2b571b[_0x13d6a9(0xd1)]},'dataset':_0x162717,'field':{'id':_0x3d1140['id']??null,'name':_0x3d1140[_0x13d6a9(0xd4)]},'dryRun':_0x13fd55,'changed':_0x4623e7,'changedPaths':_0x200506,'before':_0x3d1140,'after':_0x40e8a3,'submitted':_0x4623e7&&!_0x13fd55},'message':_0x4623e7?_0x13fd55?_0x13d6a9(0xcc)+_0x2b571b[_0x13d6a9(0xf6)]+_0x13d6a9(0xf8)+_0x200506[_0x13d6a9(0xdd)](',\x20')+')':_0x13d6a9(0xf2)+_0x2b571b[_0x13d6a9(0xf6)]+'\x20('+_0x200506[_0x13d6a9(0xdd)](',\x20')+')':_0x13d6a9(0xc8)+_0x2b571b[_0x13d6a9(0xf6)]};}export const datasetFieldUpdate={'service':a62_0x25d2d6(0x107),'command':a62_0x25d2d6(0xdb),'description':a62_0x25d2d6(0x113),'risk':a62_0x25d2d6(0xeb),'flags':[CODE_FLAG,{'name':'field','type':a62_0x25d2d6(0xd0),'required':!![],'description':a62_0x25d2d6(0x117)},{'name':a62_0x25d2d6(0x10a),'type':a62_0x25d2d6(0xd0),'required':!![],'description':a62_0x25d2d6(0xc9)},{'name':a62_0x25d2d6(0x10b),'type':a62_0x25d2d6(0xd0),'required':![],'description':'JSON\x20object\x20of\x20expected\x20current\x20field\x20values;\x20mismatch\x20aborts\x20without\x20writing'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x495efd){validateInput(readFieldUpdateInput(_0x495efd));},async 'dryRun'(_0x569a29){const _0xf0eadf=a62_0x25d2d6,_0x3f7961=await buildDatasetFieldUpdateResult({'appCode':_0x569a29['appCode'],'input':readFieldUpdateInput(_0x569a29),'dryRun':!![]});return{'method':'POST','url':_0xf0eadf(0x10d),'body':_0x3f7961[_0xf0eadf(0xce)],'description':_0x3f7961[_0xf0eadf(0xef)]};},async 'execute'(_0x897f9a){const _0x14f340=a62_0x25d2d6;return buildDatasetFieldUpdateResult({'appCode':_0x897f9a[_0x14f340(0x10c)],'input':readFieldUpdateInput(_0x897f9a),'dryRun':![]});}};function readFieldUpdateInput(_0x31ca90){const _0xfdfdcb=a62_0x25d2d6,_0x2d4030=trim(_0x31ca90[_0xfdfdcb(0xcd)](_0xfdfdcb(0xd1))),_0x384f07=emptyToUndefined(_0x31ca90[_0xfdfdcb(0xcd)](_0xfdfdcb(0xf6))),_0x293dfa=parseJsonObjectFlag(_0x31ca90['str'](_0xfdfdcb(0x10a)),_0xfdfdcb(0x10f)),_0x7bd80a=parseJsonObjectFlag(_0x31ca90[_0xfdfdcb(0xcd)](_0xfdfdcb(0x10b)),_0xfdfdcb(0xee));return{'code':_0x2d4030,'field':_0x384f07||'','patch':_0x293dfa||{},'expect':_0x7bd80a};}function validateInput(_0x167807){const _0x249c51=a62_0x25d2d6;if(!_0x167807[_0x249c51(0xd1)])throw CliErrors[_0x249c51(0x104)]('--code\x20is\x20required');if(!_0x167807[_0x249c51(0xf6)])throw CliErrors[_0x249c51(0x104)]('--field\x20is\x20required');validatePatchKeys(_0x167807[_0x249c51(0x101)]);}function readFieldArray(_0x2667e1){const _0x1fc760=a62_0x25d2d6;if(Array[_0x1fc760(0x106)](_0x2667e1[_0x1fc760(0xca)]))return _0x2667e1['fields'];if(Array[_0x1fc760(0x106)](_0x2667e1[_0x1fc760(0xd9)]))return _0x2667e1['properties'];throw CliErrors['validation'](_0x1fc760(0xda));}function summarizeDataset(_0x9ec46a,_0x2b5bf4){const _0x238f8e=a62_0x25d2d6,_0x17abb8=isPlainObject(_0x9ec46a[_0x238f8e(0x107)])?_0x9ec46a[_0x238f8e(0x107)]:{},_0x4f6f7d=isPlainObject(_0x9ec46a[_0x238f8e(0xe0)])?_0x9ec46a[_0x238f8e(0xe0)]:{};return{'id':_0x9ec46a['modelId']??_0x9ec46a['id']??_0x17abb8['datasetId']??null,'code':_0x9ec46a[_0x238f8e(0x100)]??_0x9ec46a[_0x238f8e(0xd1)]??_0x17abb8[_0x238f8e(0xfe)]??_0x2b5bf4,'name':_0x9ec46a['name']??_0x17abb8[_0x238f8e(0xcb)]??null,'table':_0x4f6f7d[_0x238f8e(0xe9)]??_0x17abb8[_0x238f8e(0xe9)]??null,'db':_0x4f6f7d[_0x238f8e(0xdc)]??_0x4f6f7d[_0x238f8e(0x109)]??null};}function mergePatchValue(_0x47e57f,_0x37fec1){if(isPlainObject(_0x47e57f)&&isPlainObject(_0x37fec1))return deepMerge(_0x47e57f,_0x37fec1);return deepClone(_0x37fec1);}function deepMerge(_0x1ebc9,_0x58939d){const _0x2810ac=a62_0x25d2d6,_0x26ff9f=deepClone(_0x1ebc9);for(const [_0x44a02b,_0x10bea7]of Object[_0x2810ac(0xd7)](_0x58939d)){_0x26ff9f[_0x44a02b]=isPlainObject(_0x26ff9f[_0x44a02b])&&isPlainObject(_0x10bea7)?deepMerge(_0x26ff9f[_0x44a02b],_0x10bea7):deepClone(_0x10bea7);}return _0x26ff9f;}function collectChangedPaths(_0x12d050,_0x166cc3,_0x4f6760,_0x4cf12d){const _0xcd3c9b=a62_0x25d2d6;if(!isPlainObject(_0x166cc3)||!isPlainObject(_0x4f6760))return;const _0x3a7fd3=new Set([...Object[_0xcd3c9b(0xe3)](_0x166cc3),...Object[_0xcd3c9b(0xe3)](_0x4f6760)]);for(const _0x2888a8 of _0x3a7fd3){const _0x45c1e4=_0x166cc3[_0x2888a8],_0x12d960=_0x4f6760[_0x2888a8];!deepEqual(_0x45c1e4,_0x12d960)&&_0x4cf12d['add'](_0x12d050+'.'+_0x2888a8);}}function deepClone(_0x4e1373){const _0x3c3966=a62_0x25d2d6;if(_0x4e1373===undefined)return _0x4e1373;return JSON[_0x3c3966(0xe1)](JSON[_0x3c3966(0xff)](_0x4e1373));}function deepEqual(_0x38ef6b,_0x360cbe){const _0x229eb2=a62_0x25d2d6;return JSON[_0x229eb2(0xff)](_0x38ef6b)===JSON['stringify'](_0x360cbe);}function isPlainObject(_0x31b297){const _0x185c03=a62_0x25d2d6;return Boolean(_0x31b297)&&typeof _0x31b297===_0x185c03(0xd2)&&!Array[_0x185c03(0x106)](_0x31b297);}function emptyToUndefined(_0x113458){const _0x4c57b6=a62_0x25d2d6,_0x59ad2f=String(_0x113458||'')[_0x4c57b6(0xe2)]();return _0x59ad2f||undefined;}function a62_0xe51b(_0x5dc65e,_0x4364fc){_0x5dc65e=_0x5dc65e-0xc8;const _0x204c71=a62_0x204c();let _0xe51b24=_0x204c71[_0x5dc65e];return _0xe51b24;}function a62_0x204c(){const _0x1528d3=['Forbidden\x20patch\x20key:\x20','2671720uLXTOt','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','Patch\x20one\x20raw\x20dataset\x20fields[]\x20field\x20object\x20safely','3823011EAAegP','Expected\x20','Unsupported\x20patch\x20key:\x20','Exact\x20raw\x20fields[].name\x20to\x20patch','No\x20changes\x20for\x20dataset\x20field\x20','JSON\x20object\x20patch;\x20allowed\x20keys:\x20doType/displayName/description/options/required/datetimeFormat/defaultAggregation/chartRole/deprecated','fields','datasetName','Dry-run:\x20dataset\x20field\x20','str','data','defaultAggregation','string','code','object','datetimeFormat','name','7cFFynF','dbType','entries','106586DAddkB','properties','Driven\x20data\x20does\x20not\x20contain\x20fields[]\x20or\x20properties[]','field-update','dbName','join','deleted','877428qtIAVT','dbtableConfig','parse','trim','keys','options','\x20must\x20be\x20valid\x20JSON\x20object:\x20','required','sort','deprecated','tableName','dataset-field-update.v1','write','displayName','doType','--expect-json','message','systemRetain','2277897cKgqxL','Updated\x20dataset\x20field\x20','5698360tWeoda','358775cTSgav','has','field','length','\x20would\x20change\x20(','Allowed\x20keys:\x20','from','16kejXyd','size','Expectation\x20mismatch\x20at\x20','datasetCode','stringify','modelCode','patch','expect','dbFieldName','validation','pkField','isArray','dataset','Field\x20not\x20found:\x20','dbId','patch-json','expect-json','appCode','/smartapi/dataset/update-driven-data','autoIncrement','--patch-json'];a62_0x204c=function(){return _0x1528d3;};return a62_0x204c();}function trim(_0x4d0f15){const _0x19c0e8=a62_0x25d2d6;return String(_0x4d0f15||'')[_0x19c0e8(0xe2)]();}
|
|
1
|
+
const a62_0x308ef0=a62_0x5c50;(function(_0x7a0692,_0xbdd626){const _0xc8d8d9=a62_0x5c50,_0x253443=_0x7a0692();while(!![]){try{const _0xf22ad3=parseInt(_0xc8d8d9(0x1dc))/0x1*(parseInt(_0xc8d8d9(0x1e1))/0x2)+parseInt(_0xc8d8d9(0x1d2))/0x3*(parseInt(_0xc8d8d9(0x1d5))/0x4)+-parseInt(_0xc8d8d9(0x1b9))/0x5*(-parseInt(_0xc8d8d9(0x1c1))/0x6)+-parseInt(_0xc8d8d9(0x1f6))/0x7*(-parseInt(_0xc8d8d9(0x1e9))/0x8)+-parseInt(_0xc8d8d9(0x1cb))/0x9+-parseInt(_0xc8d8d9(0x1cc))/0xa*(-parseInt(_0xc8d8d9(0x1ec))/0xb)+parseInt(_0xc8d8d9(0x1c0))/0xc*(-parseInt(_0xc8d8d9(0x1f3))/0xd);if(_0xf22ad3===_0xbdd626)break;else _0x253443['push'](_0x253443['shift']());}catch(_0x2808c3){_0x253443['push'](_0x253443['shift']());}}}(a62_0x14f0,0x44104));function a62_0x14f0(){const _0x5b0c86=['from','dbTypeLen','length','290HqVRzZ','trim','entries','findIndex','parse','size','modelId','12eIgsAs','6414QKxsnw','datasetName','has',',\x20actual\x20','dbType','displayName','options','name','validation','doType','2043270wxzaUR','10kYbQaV','description','chartRole','Forbidden\x20patch\x20key:\x20','isArray','sort','3zVsePi','datasetId','dataset','1222120vpszRv','object','JSON\x20object\x20patch;\x20allowed\x20keys:\x20doType/displayName/description/options/required/datetimeFormat/defaultAggregation/chartRole/deprecated','\x20must\x20be\x20valid\x20JSON\x20object:\x20','expect-json','/smartapi/dataset/update-driven-data','data','22789eoPINU','--patch-json','--code\x20is\x20required','join','tableName','36fDzBhw','dbtableConfig','systemRetain','dbFieldName','pkField','patch-json','--field\x20is\x20required','Expectation\x20mismatch\x20at\x20','664OGLsUv','POST','expect','3591940pwTiRK','dbName','Dry-run:\x20dataset\x20field\x20','str','string','field-update','--patch-json\x20must\x20contain\x20at\x20least\x20one\x20key','11335233CVLqrD','--expect-json','Patch\x20one\x20raw\x20dataset\x20fields[]\x20field\x20object\x20safely','23065SaNyex','deprecated','message','add','Updated\x20dataset\x20field\x20','appCode','properties','modelCode','code','stringify','autoIncrement','keys','field'];a62_0x14f0=function(){return _0x5b0c86;};return a62_0x14f0();}import{getDatasetDetail,updateDrivenData}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL,CODE_FLAG}from'../../commands/common/flags.js';import{CliErrors}from'../../errors.js';const MUTABLE_FIELD_KEYS=new Set([a62_0x308ef0(0x1ca),a62_0x308ef0(0x1c6),a62_0x308ef0(0x1cd),a62_0x308ef0(0x1c7),'required','datetimeFormat','defaultAggregation',a62_0x308ef0(0x1ce),a62_0x308ef0(0x1f7)]),FORBIDDEN_FIELD_KEYS=new Set(['id',a62_0x308ef0(0x1c8),a62_0x308ef0(0x1fe),a62_0x308ef0(0x1c5),a62_0x308ef0(0x1b7),'dbTypeScale',a62_0x308ef0(0x1e4),a62_0x308ef0(0x1e0),'deleted',a62_0x308ef0(0x1e5),a62_0x308ef0(0x200),a62_0x308ef0(0x1e3)]);export function parseJsonObjectFlag(_0x100051,_0x72057f){const _0x362c35=a62_0x308ef0;if(!_0x100051)return undefined;let _0x538b11;try{_0x538b11=JSON[_0x362c35(0x1bd)](_0x100051);}catch(_0x1ef353){const _0x8946f9=_0x1ef353 instanceof Error?_0x1ef353[_0x362c35(0x1f8)]:String(_0x1ef353);throw CliErrors['validation'](_0x72057f+_0x362c35(0x1d8)+_0x8946f9);}if(!isPlainObject(_0x538b11)||Array[_0x362c35(0x1d0)](_0x538b11))throw CliErrors[_0x362c35(0x1c9)](_0x72057f+'\x20must\x20be\x20a\x20JSON\x20object');return _0x538b11;}export function validatePatchKeys(_0x8bcffb){const _0x5c298d=a62_0x308ef0,_0x32025b=Object['keys'](_0x8bcffb);if(_0x32025b[_0x5c298d(0x1b8)]===0x0)throw CliErrors[_0x5c298d(0x1c9)](_0x5c298d(0x1f2));for(const _0x4cd4d7 of _0x32025b){if(FORBIDDEN_FIELD_KEYS[_0x5c298d(0x1c3)](_0x4cd4d7))throw CliErrors[_0x5c298d(0x1c9)](_0x5c298d(0x1cf)+_0x4cd4d7);if(!MUTABLE_FIELD_KEYS[_0x5c298d(0x1c3)](_0x4cd4d7))throw CliErrors['validation']('Unsupported\x20patch\x20key:\x20'+_0x4cd4d7,'Allowed\x20keys:\x20'+Array[_0x5c298d(0x1b6)](MUTABLE_FIELD_KEYS)[_0x5c298d(0x1df)](',\x20'));}}export function applyFieldPatch(_0x12c1d6,_0x12a97c){const _0x5e53ed=a62_0x308ef0;validatePatchKeys(_0x12a97c);const _0x3e29af=deepClone(_0x12c1d6),_0x2f88ac=new Set();for(const [_0x5ea1e6,_0x1473de]of Object[_0x5e53ed(0x1bb)](_0x12a97c)){const _0x5abcf2=_0x3e29af[_0x5ea1e6],_0x3d528a=mergePatchValue(_0x5abcf2,_0x1473de);!deepEqual(_0x5abcf2,_0x3d528a)&&(_0x3e29af[_0x5ea1e6]=_0x3d528a,_0x2f88ac['add'](_0x5ea1e6),collectChangedPaths(_0x5ea1e6,_0x5abcf2,_0x3d528a,_0x2f88ac));}return{'after':_0x3e29af,'changedPaths':Array[_0x5e53ed(0x1b6)](_0x2f88ac)[_0x5e53ed(0x1d1)](),'changed':_0x2f88ac[_0x5e53ed(0x1be)]>0x0};}export function assertExpectation(_0x36b004,_0x2884a0){const _0x5a5c93=a62_0x308ef0;if(!_0x2884a0)return;for(const [_0x280beb,_0x2175e7]of Object[_0x5a5c93(0x1bb)](_0x2884a0)){const _0x57715d=_0x36b004[_0x280beb];if(!deepEqual(_0x57715d,_0x2175e7))throw CliErrors[_0x5a5c93(0x1c9)](_0x5a5c93(0x1e8)+_0x280beb,'Expected\x20'+JSON[_0x5a5c93(0x1ff)](_0x2175e7)+_0x5a5c93(0x1c4)+JSON[_0x5a5c93(0x1ff)](_0x57715d));}}export async function buildDatasetFieldUpdateResult({appCode:_0xc13355,input:_0x4271cd,dryRun:_0x376796}){const _0x25254c=a62_0x308ef0;validateInput(_0x4271cd);const _0x593d50=await getDatasetDetail(_0x4271cd[_0x25254c(0x1fe)]),_0x1f55cf=readFieldArray(_0x593d50),_0x50e8ca=_0x1f55cf[_0x25254c(0x1bc)](_0x39acf4=>_0x39acf4?.[_0x25254c(0x1c8)]===_0x4271cd[_0x25254c(0x1b5)]);if(_0x50e8ca<0x0)throw CliErrors['validation']('Field\x20not\x20found:\x20'+_0x4271cd[_0x25254c(0x1b5)]);const _0x19478c=deepClone(_0x1f55cf[_0x50e8ca]);assertExpectation(_0x19478c,_0x4271cd[_0x25254c(0x1eb)]);const {after:_0x48c2cc,changedPaths:_0x4eb4f6,changed:_0x1e4d68}=applyFieldPatch(_0x19478c,_0x4271cd['patch']),_0x5401bf=summarizeDataset(_0x593d50,_0x4271cd[_0x25254c(0x1fe)]);return _0x1e4d68&&!_0x376796&&(_0x1f55cf[_0x50e8ca]=_0x48c2cc,await updateDrivenData(_0x593d50)),{'ok':!![],'data':{'protocol':'dataset-field-update.v1','appCode':_0xc13355,'selector':{'code':_0x4271cd[_0x25254c(0x1fe)]},'dataset':_0x5401bf,'field':{'id':_0x19478c['id']??null,'name':_0x19478c['name']},'dryRun':_0x376796,'changed':_0x1e4d68,'changedPaths':_0x4eb4f6,'before':_0x19478c,'after':_0x48c2cc,'submitted':_0x1e4d68&&!_0x376796},'message':_0x1e4d68?_0x376796?_0x25254c(0x1ee)+_0x4271cd['field']+'\x20would\x20change\x20('+_0x4eb4f6[_0x25254c(0x1df)](',\x20')+')':_0x25254c(0x1fa)+_0x4271cd[_0x25254c(0x1b5)]+'\x20('+_0x4eb4f6[_0x25254c(0x1df)](',\x20')+')':'No\x20changes\x20for\x20dataset\x20field\x20'+_0x4271cd[_0x25254c(0x1b5)]};}export const datasetFieldUpdate={'service':a62_0x308ef0(0x1d4),'command':a62_0x308ef0(0x1f1),'description':a62_0x308ef0(0x1f5),'risk':'write','flags':[CODE_FLAG,{'name':a62_0x308ef0(0x1b5),'type':a62_0x308ef0(0x1f0),'required':!![],'description':'Exact\x20raw\x20fields[].name\x20to\x20patch'},{'name':a62_0x308ef0(0x1e6),'type':'string','required':!![],'description':a62_0x308ef0(0x1d7)},{'name':'expect-json','type':a62_0x308ef0(0x1f0),'required':![],'description':'JSON\x20object\x20of\x20expected\x20current\x20field\x20values;\x20mismatch\x20aborts\x20without\x20writing'},APPCODE_FLAG_OPTIONAL],async 'validate'(_0x2d23d3){validateInput(readFieldUpdateInput(_0x2d23d3));},async 'dryRun'(_0x4f9cd6){const _0x2b9024=a62_0x308ef0,_0x1d49dc=await buildDatasetFieldUpdateResult({'appCode':_0x4f9cd6['appCode'],'input':readFieldUpdateInput(_0x4f9cd6),'dryRun':!![]});return{'method':_0x2b9024(0x1ea),'url':_0x2b9024(0x1da),'body':_0x1d49dc[_0x2b9024(0x1db)],'description':_0x1d49dc[_0x2b9024(0x1f8)]};},async 'execute'(_0x49a464){const _0x3ccbd2=a62_0x308ef0;return buildDatasetFieldUpdateResult({'appCode':_0x49a464[_0x3ccbd2(0x1fb)],'input':readFieldUpdateInput(_0x49a464),'dryRun':![]});}};function readFieldUpdateInput(_0x22e548){const _0x17aa1e=a62_0x308ef0,_0x41deaa=trim(_0x22e548[_0x17aa1e(0x1ef)](_0x17aa1e(0x1fe))),_0x36a5bc=emptyToUndefined(_0x22e548['str'](_0x17aa1e(0x1b5))),_0x2bcd2b=parseJsonObjectFlag(_0x22e548['str'](_0x17aa1e(0x1e6)),_0x17aa1e(0x1dd)),_0xccd914=parseJsonObjectFlag(_0x22e548[_0x17aa1e(0x1ef)](_0x17aa1e(0x1d9)),_0x17aa1e(0x1f4));return{'code':_0x41deaa,'field':_0x36a5bc||'','patch':_0x2bcd2b||{},'expect':_0xccd914};}function validateInput(_0x52b82a){const _0x51f014=a62_0x308ef0;if(!_0x52b82a[_0x51f014(0x1fe)])throw CliErrors['validation'](_0x51f014(0x1de));if(!_0x52b82a['field'])throw CliErrors[_0x51f014(0x1c9)](_0x51f014(0x1e7));validatePatchKeys(_0x52b82a['patch']);}function readFieldArray(_0xac27fe){const _0x5bc8d6=a62_0x308ef0;if(Array['isArray'](_0xac27fe['fields']))return _0xac27fe['fields'];if(Array[_0x5bc8d6(0x1d0)](_0xac27fe[_0x5bc8d6(0x1fc)]))return _0xac27fe[_0x5bc8d6(0x1fc)];throw CliErrors[_0x5bc8d6(0x1c9)]('Driven\x20data\x20does\x20not\x20contain\x20fields[]\x20or\x20properties[]');}function summarizeDataset(_0x2f732a,_0x473c98){const _0xf98a81=a62_0x308ef0,_0x1092e9=isPlainObject(_0x2f732a[_0xf98a81(0x1d4)])?_0x2f732a[_0xf98a81(0x1d4)]:{},_0x18b2dc=isPlainObject(_0x2f732a[_0xf98a81(0x1e2)])?_0x2f732a[_0xf98a81(0x1e2)]:{};return{'id':_0x2f732a[_0xf98a81(0x1bf)]??_0x2f732a['id']??_0x1092e9[_0xf98a81(0x1d3)]??null,'code':_0x2f732a[_0xf98a81(0x1fd)]??_0x2f732a[_0xf98a81(0x1fe)]??_0x1092e9['datasetCode']??_0x473c98,'name':_0x2f732a[_0xf98a81(0x1c8)]??_0x1092e9[_0xf98a81(0x1c2)]??null,'table':_0x18b2dc[_0xf98a81(0x1e0)]??_0x1092e9[_0xf98a81(0x1e0)]??null,'db':_0x18b2dc[_0xf98a81(0x1ed)]??_0x18b2dc['dbId']??null};}function mergePatchValue(_0x411bfc,_0x4a2991){if(isPlainObject(_0x411bfc)&&isPlainObject(_0x4a2991))return deepMerge(_0x411bfc,_0x4a2991);return deepClone(_0x4a2991);}function deepMerge(_0x583675,_0x2e85db){const _0x71bdb4=deepClone(_0x583675);for(const [_0x259ef0,_0x3d5fee]of Object['entries'](_0x2e85db)){_0x71bdb4[_0x259ef0]=isPlainObject(_0x71bdb4[_0x259ef0])&&isPlainObject(_0x3d5fee)?deepMerge(_0x71bdb4[_0x259ef0],_0x3d5fee):deepClone(_0x3d5fee);}return _0x71bdb4;}function collectChangedPaths(_0x3014ea,_0x3082c0,_0x4f3613,_0x1c80c7){const _0x590539=a62_0x308ef0;if(!isPlainObject(_0x3082c0)||!isPlainObject(_0x4f3613))return;const _0x1b2493=new Set([...Object[_0x590539(0x1b4)](_0x3082c0),...Object[_0x590539(0x1b4)](_0x4f3613)]);for(const _0x2ff03a of _0x1b2493){const _0x17466f=_0x3082c0[_0x2ff03a],_0x50abfd=_0x4f3613[_0x2ff03a];!deepEqual(_0x17466f,_0x50abfd)&&_0x1c80c7[_0x590539(0x1f9)](_0x3014ea+'.'+_0x2ff03a);}}function deepClone(_0x40b10a){const _0x25c4fd=a62_0x308ef0;if(_0x40b10a===undefined)return _0x40b10a;return JSON['parse'](JSON[_0x25c4fd(0x1ff)](_0x40b10a));}function deepEqual(_0x55cd84,_0x2603f6){const _0x16eb5c=a62_0x308ef0;return JSON['stringify'](_0x55cd84)===JSON[_0x16eb5c(0x1ff)](_0x2603f6);}function isPlainObject(_0x1f4712){const _0x1b76d8=a62_0x308ef0;return Boolean(_0x1f4712)&&typeof _0x1f4712===_0x1b76d8(0x1d6)&&!Array[_0x1b76d8(0x1d0)](_0x1f4712);}function a62_0x5c50(_0x20734f,_0x7e8132){_0x20734f=_0x20734f-0x1b4;const _0x14f042=a62_0x14f0();let _0x5c5012=_0x14f042[_0x20734f];return _0x5c5012;}function emptyToUndefined(_0x33ad4d){const _0x280050=String(_0x33ad4d||'')['trim']();return _0x280050||undefined;}function trim(_0x587c3c){const _0x358529=a62_0x308ef0;return String(_0x587c3c||'')[_0x358529(0x1ba)]();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4c0df2,_0xec0e31){const _0x44f094=a63_0x2974,_0x2cb9f0=_0x4c0df2();while(!![]){try{const _0x49ec3e=-parseInt(_0x44f094(0x1bb))/0x1+-parseInt(_0x44f094(0x1b2))/0x2*(-parseInt(_0x44f094(0x1b1))/0x3)+parseInt(_0x44f094(0x1b9))/0x4*(parseInt(_0x44f094(0x1b3))/0x5)+parseInt(_0x44f094(0x1b4))/0x6*(parseInt(_0x44f094(0x1b6))/0x7)+parseInt(_0x44f094(0x1ba))/0x8+-parseInt(_0x44f094(0x1b5))/0x9+parseInt(_0x44f094(0x1b8))/0xa*(-parseInt(_0x44f094(0x1b7))/0xb);if(_0x49ec3e===_0xec0e31)break;else _0x2cb9f0['push'](_0x2cb9f0['shift']());}catch(_0x4d9b70){_0x2cb9f0['push'](_0x2cb9f0['shift']());}}}(a63_0x33ba,0xd61c7));import{datasetList}from'../../commands/dataset/list.js';function a63_0x33ba(){const _0x255549=['6PGvDWN','1654464mpXTfC','155aeGMJb','5319804qJRxXM','1696968sBFmOu','7EOXnXg','26889346Sxvmow','10ZNCFbg','137152SgbIDB','9981648GIXMio','1341695zyMuiA'];a63_0x33ba=function(){return _0x255549;};return a63_0x33ba();}import{datasetDetail}from'../../commands/dataset/detail.js';import{datasetOperations}from'../../commands/dataset/operations.js';import{datasetRelations}from'../../commands/dataset/relations.js';function a63_0x2974(_0x44b33e,_0x2dbd46){_0x44b33e=_0x44b33e-0x1b1;const _0x33bae6=a63_0x33ba();let _0x29744a=_0x33bae6[_0x44b33e];return _0x29744a;}import{datasetRelationCreate}from'../../commands/dataset/relation-create.js';import{datasetRelationUpdate}from'../../commands/dataset/relation-update.js';import{datasetRelationDelete}from'../../commands/dataset/relation-delete.js';import{datasetDelete}from'../../commands/dataset/delete.js';import{datasetRestore}from'../../commands/dataset/restore.js';import{datasetFieldUpdate}from'../../commands/dataset/field-update.js';import{datasetRename}from'../../commands/dataset/rename.js';import{datasetExtendUpdate}from'../../commands/dataset/extend-update.js';import{datasetBusinessGroupUpdate}from'../../commands/dataset/business-group-update.js';export const datasetDefinitions=[datasetList,datasetDetail,datasetOperations,datasetRelations,datasetRelationCreate,datasetRelationUpdate,datasetRelationDelete,datasetDelete,datasetRestore,datasetFieldUpdate,datasetRename,datasetExtendUpdate,datasetBusinessGroupUpdate];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a64_0x41ad9b=a64_0x444f;function a64_0x444f(_0x584af3,_0xdb8053){_0x584af3=_0x584af3-0x15c;const _0x6d9145=a64_0x6d91();let _0x444f6a=_0x6d9145[_0x584af3];return _0x444f6a;}(function(_0x4a2451,_0x5f49eb){const _0x278fc9=a64_0x444f,_0x131b2c=_0x4a2451();while(!![]){try{const _0x26afca=-parseInt(_0x278fc9(0x174))/0x1*(-parseInt(_0x278fc9(0x16b))/0x2)+-parseInt(_0x278fc9(0x15d))/0x3+-parseInt(_0x278fc9(0x160))/0x4+-parseInt(_0x278fc9(0x16f))/0x5+-parseInt(_0x278fc9(0x169))/0x6+-parseInt(_0x278fc9(0x170))/0x7*(-parseInt(_0x278fc9(0x173))/0x8)+-parseInt(_0x278fc9(0x167))/0x9*(-parseInt(_0x278fc9(0x161))/0xa);if(_0x26afca===_0x5f49eb)break;else _0x131b2c['push'](_0x131b2c['shift']());}catch(_0xb25073){_0x131b2c['push'](_0x131b2c['shift']());}}}(a64_0x6d91,0xe480e));import{listDatasets}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL,APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';const DO_V2_DATASET_SOURCES=new Set([a64_0x41ad9b(0x16c),a64_0x41ad9b(0x178)]);function a64_0x6d91(){const _0x423777=['name','datasetKey','dataset','METADATA','appCode','allFields','dbtableConfig','3938409SCQRoP','toUpperCase','has','5303664SIQMzG','20dguqIh','trim','string','filter','pkField','Filter\x20datasets\x20by\x20source\x20type','15505902gvhefq','read','2053476slcYqP','source','1754098gQXqaz','DB_TABLE','code','Filter\x20datasets\x20by\x20name\x20(server-side\x20fuzzy\x20match)','7331595upkQGT','7423003YaWYFg','str','List\x20DO\x20V2\x20datasets\x20in\x20the\x20app','8WyoodT','1DjjDJZ'];a64_0x6d91=function(){return _0x423777;};return a64_0x6d91();}function normalizeSource(_0x2b0fbd){const _0xde3991=a64_0x41ad9b;return _0x2b0fbd==null?'':String(_0x2b0fbd)[_0xde3991(0x162)]()[_0xde3991(0x15e)]();}export const datasetList={'service':a64_0x41ad9b(0x177),'command':'list','description':a64_0x41ad9b(0x172),'risk':a64_0x41ad9b(0x168),'flags':[{'name':a64_0x41ad9b(0x175),'type':a64_0x41ad9b(0x163),'description':a64_0x41ad9b(0x16e)},CODE_FLAG_OPTIONAL,APPCODE_FLAG_OPTIONAL,{'name':'source','type':'string','description':a64_0x41ad9b(0x166),'enum':['DB_TABLE',a64_0x41ad9b(0x178)]}],async 'execute'(_0x451335){const _0x2d5ca1=a64_0x41ad9b,_0x3abf49=_0x451335[_0x2d5ca1(0x171)](_0x2d5ca1(0x175)),_0xcc7508=_0x451335[_0x2d5ca1(0x171)]('code'),_0x1bd42f=normalizeSource(_0x451335['str'](_0x2d5ca1(0x16a))),_0x1eb29=await listDatasets(_0x451335[_0x2d5ca1(0x179)],{..._0x3abf49&&{'name':_0x3abf49},..._0xcc7508&&{'code':_0xcc7508}}),_0x29278d=_0x1eb29[_0x2d5ca1(0x164)](_0x371098=>DO_V2_DATASET_SOURCES[_0x2d5ca1(0x15f)](normalizeSource(_0x371098[_0x2d5ca1(0x16a)]))),_0x2e2032=_0x1bd42f?_0x29278d[_0x2d5ca1(0x164)](_0x1b3849=>normalizeSource(_0x1b3849['source'])===_0x1bd42f):_0x29278d,_0x674f72=_0x2e2032['map'](_0x29f3de=>{const _0x527770=_0x2d5ca1,_0xa84983=_0x29f3de[_0x527770(0x15c)]??{};return{'id':_0x29f3de['id'],'name':_0x29f3de[_0x527770(0x175)],'code':_0x29f3de[_0x527770(0x16d)],'description':_0x29f3de['description'],'source':_0x29f3de['source'],'db':_0xa84983['dbName'],'table':_0xa84983['tableName'],'datasetKey':_0xa84983[_0x527770(0x176)],'pk':_0xa84983[_0x527770(0x165)],'fields':_0xa84983['allFields']?_0xa84983[_0x527770(0x17a)]['split'](',')['map'](_0x3cfe5a=>_0x3cfe5a[_0x527770(0x162)]()):[]};});return{'ok':!![],'data':{'total':_0x674f72['length'],'datasets':_0x674f72},'message':'Found\x20'+_0x674f72['length']+'\x20dataset(s)'};}};
|