@lovrabet/rabetbase-cli 2.4.6-beta.2 → 2.4.6-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.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/restore.js +1 -1
- package/lib/commands/page/shared.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/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/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
- package/skills/rabetbase/SKILL.md +3 -3
- package/skills/rabetbase/references/rabetbase-ocr.md +17 -2
- package/skills/rabetbase.manifest.json +3 -3
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a34_0x3085(){const _0x91c7b7=['445426MSAGBz','Return\x20full\x20script\x20objects','string','2218704qhFjdn','map','No\x20BFF\x20scripts\x20found.','36JpwpZF','List\x20BFF\x20scripts','2104926BEytof','1668120ICOcqL','1598990gaPnOC','COMMON','2tnIKyv','1599896FZKOdu','name','type','scriptType','str','description','bool','appCode','1008228XWHDdl','14hLWoSm','verbose','ENDPOINT'];a34_0x3085=function(){return _0x91c7b7;};return a34_0x3085();}const a34_0x6698d8=a34_0x4075;function a34_0x4075(_0x121935,_0x2cd5a5){_0x121935=_0x121935-0xce;const _0x308533=a34_0x3085();let _0x4075f1=_0x308533[_0x121935];return _0x4075f1;}(function(_0x106528,_0x199d0c){const _0x2b4a3c=a34_0x4075,_0x53fc7a=_0x106528();while(!![]){try{const _0x185d1b=-parseInt(_0x2b4a3c(0xe2))/0x1*(parseInt(_0x2b4a3c(0xd6))/0x2)+-parseInt(_0x2b4a3c(0xd9))/0x3+-parseInt(_0x2b4a3c(0xd2))/0x4+parseInt(_0x2b4a3c(0xdf))/0x5+parseInt(_0x2b4a3c(0xde))/0x6*(parseInt(_0x2b4a3c(0xd3))/0x7)+parseInt(_0x2b4a3c(0xe3))/0x8+-parseInt(_0x2b4a3c(0xdc))/0x9*(-parseInt(_0x2b4a3c(0xe0))/0xa);if(_0x185d1b===_0x199d0c)break;else _0x53fc7a['push'](_0x53fc7a['shift']());}catch(_0x630d92){_0x53fc7a['push'](_0x53fc7a['shift']());}}}(a34_0x3085,0x6ae26));import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':'bff','command':'list','description':a34_0x6698d8(0xdd),'risk':'read','flags':[{'name':a34_0x6698d8(0xe5),'type':'string','description':'Script\x20type\x20filter','default':a34_0x6698d8(0xd5),'enum':['ENDPOINT',a34_0x6698d8(0xe1)]},{'name':a34_0x6698d8(0xe4),'type':a34_0x6698d8(0xd8),'description':'Filter\x20by\x20script\x20name'},{'name':a34_0x6698d8(0xd4),'type':'boolean','description':a34_0x6698d8(0xd7)}],async 'execute'(_0x1a1437){const _0x475ea8=a34_0x6698d8,_0xec5c79=await listBffScripts(_0x1a1437[_0x475ea8(0xd1)],_0x1a1437[_0x475ea8(0xce)](_0x475ea8(0xe5)),{'scriptName':_0x1a1437[_0x475ea8(0xce)]('name')||undefined}),_0x1922a0=_0x1a1437[_0x475ea8(0xd0)](_0x475ea8(0xd4));return{'ok':!![],'data':_0x1922a0?_0xec5c79:_0xec5c79[_0x475ea8(0xda)](_0x5af05b=>({'id':_0x5af05b['id'],'functionName':_0x5af05b['functionName']??'','description':_0x5af05b[_0x475ea8(0xcf)]||'(unnamed)','scriptType':_0x5af05b[_0x475ea8(0xe6)]})),'message':_0xec5c79['length']===0x0?_0x475ea8(0xdb):undefined};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a35_0x4a1122=a35_0xbaae;(function(_0x3c7a1c,_0xbfc598){const _0x520a83=a35_0xbaae,_0x4a98d1=_0x3c7a1c();while(!![]){try{const _0x5d923d=-parseInt(_0x520a83(0x170))/0x1+parseInt(_0x520a83(0x15b))/0x2*(-parseInt(_0x520a83(0x197))/0x3)+parseInt(_0x520a83(0x155))/0x4*(parseInt(_0x520a83(0x160))/0x5)+parseInt(_0x520a83(0x19c))/0x6+-parseInt(_0x520a83(0x182))/0x7+parseInt(_0x520a83(0x18d))/0x8+parseInt(_0x520a83(0x17d))/0x9;if(_0x5d923d===_0xbfc598)break;else _0x4a98d1['push'](_0x4a98d1['shift']());}catch(_0x131910){_0x4a98d1['push'](_0x4a98d1['shift']());}}}(a35_0x4cce,0xc100f));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';function a35_0xbaae(_0x3497a4,_0x22b161){_0x3497a4=_0x3497a4-0x153;const _0x4cce9b=a35_0x4cce();let _0xbaaee8=_0x4cce9b[_0x3497a4];return _0xbaaee8;}function a35_0x4cce(){const _0x222ffc=['stdin','version','filePath','1686266EkzcQL','unresolvable\x20target\x20path','pull','nonInteractive','string','22180vuGDKY','message','bff','bool','scriptType','\x20pulled,\x20','length','lockKey','utf8','close','No\x20remote\x20BFF\x20scripts\x20found.','functions','\x20failed','Force\x20overwrite\x20local\x20unsynced\x20changes','skipped','parse','767383uqzrnd','trim','operationType','Pull\x20complete:\x20','toLowerCase','apiDir','includes','appCode','alias','Force\x20pull\x20cancelled.','COMMON','type','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','1385595TwdZUN','conflict','&type=','HOOK','str','8108842scFcXi','boolean','scriptContent','lockFilePath','functionNode','push','GET','hookLocation','map','Remote\x20script\x20missing\x20content.','Remote\x20script\x20missing\x20id.','8862256UCgypA','apps','hash','all','toISOString','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','would_pull','scriptsRoot','\x20remote\x20BFF\x20script(s)\x20for\x20pull','validation','3jNjWNO','Would\x20inspect\x20','functionName','\x22\x20not\x20found\x20after\x20ensureLockScope.','stringify','5987880OQiXAF','lastSync','stderr','datasetCode','1172DtHkNZ','Lock\x20scope\x20for\x20app\x20\x22','ENDPOINT'];a35_0x4cce=function(){return _0x222ffc;};return a35_0x4cce();}import{CliErrors}from'../../errors.js';export const bffPull={'service':a35_0x4a1122(0x162),'command':a35_0x4a1122(0x15d),'description':a35_0x4a1122(0x192),'risk':'read','flags':[{'name':a35_0x4a1122(0x17b),'type':a35_0x4a1122(0x15f),'description':'Pull\x20only\x20this\x20script\x20type','enum':[a35_0x4a1122(0x17a),a35_0x4a1122(0x157),'HOOK']},{'name':'force','type':a35_0x4a1122(0x183),'description':a35_0x4a1122(0x16d)}],async 'dryRun'(_0x1b66cf){const _0x46d2b5=a35_0x4a1122,_0x396f21=loadBffProjectConfig(_0x1b66cf[_0x46d2b5(0x177)]),_0x4578b3=await readBffLockFile(_0x396f21[_0x46d2b5(0x185)]),{appLock:_0x28e22e}=ensureLockScope(_0x4578b3??createEmptyBffLock(),_0x1b66cf['appCode'],_0x396f21['scriptsRoot'],_0x46d2b5(0x15d)),_0x4a1dd0=normalizeBffType(_0x1b66cf[_0x46d2b5(0x181)](_0x46d2b5(0x17b)))??undefined,_0x1646a3=buildDatasetCodeToAliasMap(_0x1b66cf[_0x46d2b5(0x175)],_0x1b66cf[_0x46d2b5(0x177)]),[_0x3ecda0,_0x522203]=await Promise[_0x46d2b5(0x190)]([listBffScripts(_0x1b66cf['appCode'],_0x4a1dd0),getBffScriptStatistics(_0x1b66cf[_0x46d2b5(0x177)])]),_0x3cccc4=createHookLocationMap(_0x522203),_0x36a018=[];for(const _0x22aea4 of _0x3ecda0){const _0x5693a1=resolveRemoteScriptTarget(_0x396f21,_0x22aea4,_0x3cccc4,_0x28e22e[_0x46d2b5(0x16b)],_0x1646a3);if(!_0x5693a1){_0x36a018[_0x46d2b5(0x187)]({'scriptType':_0x22aea4[_0x46d2b5(0x164)],'functionName':_0x22aea4[_0x46d2b5(0x199)]??'','status':_0x46d2b5(0x16e),'reason':_0x46d2b5(0x15c)});continue;}const _0x5a8154=_0x28e22e[_0x46d2b5(0x16b)][_0x5693a1[_0x46d2b5(0x167)]],_0x3245ca=_0x22aea4[_0x46d2b5(0x184)]!=null?computeContentHash(_0x22aea4[_0x46d2b5(0x184)]):undefined,_0x495565=await hasUnsyncedLocalChanges(_0x5693a1['filePath'],_0x5a8154,_0x3245ca);_0x36a018[_0x46d2b5(0x187)]({'lockKey':_0x5693a1[_0x46d2b5(0x167)],'filePath':_0x5693a1[_0x46d2b5(0x15a)],'remoteId':_0x22aea4['id']??null,'status':_0x495565?_0x46d2b5(0x17e):_0x46d2b5(0x193)});}return{'method':_0x46d2b5(0x188),'url':'/api/management/library/scripts/list?appCode='+_0x1b66cf[_0x46d2b5(0x177)]+(_0x4a1dd0?_0x46d2b5(0x17f)+_0x4a1dd0:''),'body':{'appCode':_0x1b66cf['appCode'],'filterType':_0x4a1dd0??null,'files':_0x36a018},'description':_0x46d2b5(0x198)+_0x36a018[_0x46d2b5(0x166)]+_0x46d2b5(0x195)};},async 'execute'(_0x55e693){const _0x2cfcb1=a35_0x4a1122,_0x1d263f=loadBffProjectConfig(_0x55e693[_0x2cfcb1(0x177)]),_0x265fdc=await readBffLockFile(_0x1d263f[_0x2cfcb1(0x185)]),{lockData:_0x572cfc,appLock:_0x2e5c62}=ensureLockScope(_0x265fdc??createEmptyBffLock(),_0x55e693[_0x2cfcb1(0x177)],_0x1d263f[_0x2cfcb1(0x194)],_0x2cfcb1(0x15d)),_0xfd8609=normalizeBffType(_0x55e693[_0x2cfcb1(0x181)](_0x2cfcb1(0x17b)))??undefined;if(_0x55e693[_0x2cfcb1(0x181)](_0x2cfcb1(0x17b))&&!_0xfd8609)throw CliErrors[_0x2cfcb1(0x196)]('--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.');const [_0xf2f0c6,_0x347938]=await Promise[_0x2cfcb1(0x190)]([listBffScripts(_0x55e693[_0x2cfcb1(0x177)],_0xfd8609),getBffScriptStatistics(_0x55e693[_0x2cfcb1(0x177)])]);if(_0xf2f0c6['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x2cfcb1(0x16a)};const _0x4b6032=_0x55e693[_0x2cfcb1(0x163)]('force');if(_0x4b6032&&!_0x55e693[_0x2cfcb1(0x15e)]){const _0x1d8643=await confirmForce();if(!_0x1d8643)throw CliErrors['cancelled'](_0x2cfcb1(0x179));}if(_0x4b6032&&_0x55e693[_0x2cfcb1(0x15e)]){}const _0x4b3011=buildDatasetCodeToAliasMap(_0x55e693[_0x2cfcb1(0x175)],_0x55e693[_0x2cfcb1(0x177)]),_0xcb91be=createHookLocationMap(_0x347938),_0x4a3892=JSON[_0x2cfcb1(0x16f)](JSON[_0x2cfcb1(0x19b)](_0x572cfc)),_0x1533b9=_0x55e693[_0x2cfcb1(0x177)],_0x1c5dac=_0x4a3892[_0x2cfcb1(0x18e)][_0x1533b9];if(!_0x1c5dac)throw new Error(_0x2cfcb1(0x156)+_0x1533b9+_0x2cfcb1(0x19a));const _0x566843=[],_0x2bc667=[],_0x4484a2=[];for(const _0x42e942 of _0xf2f0c6){const _0x3ea8e9=resolveRemoteScriptTarget(_0x1d263f,_0x42e942,_0xcb91be,_0x2e5c62[_0x2cfcb1(0x16b)],_0x4b3011);if(!_0x3ea8e9){_0x2bc667[_0x2cfcb1(0x187)]({'lockKey':_0x42e942[_0x2cfcb1(0x164)]+'/'+_0x42e942[_0x2cfcb1(0x199)],'reason':_0x2cfcb1(0x15c)});continue;}const _0x1fd3d8=_0x2e5c62[_0x2cfcb1(0x16b)][_0x3ea8e9[_0x2cfcb1(0x167)]];try{if(!_0x42e942['id'])throw new Error(_0x2cfcb1(0x18c));if(_0x42e942[_0x2cfcb1(0x184)]==null)throw new Error(_0x2cfcb1(0x18b));const _0x5a5dc6=_0x42e942[_0x2cfcb1(0x184)],_0x3425cd=computeContentHash(_0x5a5dc6);if(!_0x4b6032){const _0x341771=await hasUnsyncedLocalChanges(_0x3ea8e9[_0x2cfcb1(0x15a)],_0x1fd3d8,_0x3425cd);if(_0x341771){_0x2bc667['push']({'lockKey':_0x3ea8e9[_0x2cfcb1(0x167)],'reason':'local\x20unsynced\x20changes'});continue;}}await ensureParentDirectory(_0x3ea8e9[_0x2cfcb1(0x15a)]),await writeFile(_0x3ea8e9[_0x2cfcb1(0x15a)],_0x5a5dc6,_0x2cfcb1(0x168));const _0xca3942={'hash':_0x3425cd,'remoteId':_0x42e942['id'],'version':_0x42e942[_0x2cfcb1(0x159)]};_0x3ea8e9[_0x2cfcb1(0x17b)]===_0x2cfcb1(0x180)&&_0x3ea8e9['hookLocation']&&(_0xca3942[_0x2cfcb1(0x178)]=_0x3ea8e9[_0x2cfcb1(0x189)][_0x2cfcb1(0x178)],_0xca3942[_0x2cfcb1(0x154)]=_0x3ea8e9['hookLocation'][_0x2cfcb1(0x154)],_0xca3942['operationType']=_0x3ea8e9[_0x2cfcb1(0x189)][_0x2cfcb1(0x172)],_0xca3942[_0x2cfcb1(0x186)]=_0x3ea8e9[_0x2cfcb1(0x189)]['functionNode']),_0x1c5dac[_0x2cfcb1(0x16b)][_0x3ea8e9['lockKey']]=_0xca3942,_0x566843['push']({'lockKey':_0x3ea8e9[_0x2cfcb1(0x167)],'remoteId':_0x42e942['id']});}catch(_0xad78f2){_0x4484a2['push']({'lockKey':_0x3ea8e9[_0x2cfcb1(0x167)],'error':_0xad78f2 instanceof Error?_0xad78f2[_0x2cfcb1(0x161)]:String(_0xad78f2)});}}return _0x1c5dac[_0x2cfcb1(0x19d)]=new Date()[_0x2cfcb1(0x191)](),await writeBffLockFile(_0x1d263f[_0x2cfcb1(0x185)],_0x4a3892),{'ok':_0x4484a2[_0x2cfcb1(0x166)]===0x0,'data':{'pulled':_0x566843,'skipped':_0x2bc667,'failed':_0x4484a2},'message':_0x2cfcb1(0x173)+_0x566843[_0x2cfcb1(0x166)]+_0x2cfcb1(0x165)+_0x2bc667[_0x2cfcb1(0x166)]+'\x20skipped,\x20'+_0x4484a2[_0x2cfcb1(0x166)]+_0x2cfcb1(0x16c)};}};async function hasUnsyncedLocalChanges(_0x22302c,_0x21625c,_0x382b11){const _0x1554cb=a35_0x4a1122;if(!await fileExists(_0x22302c))return![];const _0x31013b=await computeFileHash(_0x22302c);if(!_0x21625c)return _0x382b11?_0x31013b!==_0x382b11:!![];return _0x31013b!==_0x21625c[_0x1554cb(0x18f)];}function buildDatasetCodeToAliasMap(_0x45c07a,_0x584995){const _0x314930=a35_0x4a1122,_0x3b5da0=loadAliasMap(_0x45c07a,undefined,resolveApiFilePath(_0x45c07a,_0x584995));return new Map(_0x3b5da0[_0x314930(0x18a)](_0x383fcb=>[_0x383fcb['datasetCode'],_0x383fcb[_0x314930(0x178)]]));}async function confirmForce(){const _0x4e9d47=a35_0x4a1122,_0x16a30e=createInterface({'input':process[_0x4e9d47(0x158)],'output':process[_0x4e9d47(0x153)]}),_0x121694=await new Promise(_0x3d1332=>{const _0x48dde7=_0x4e9d47;_0x16a30e['question'](_0x48dde7(0x17c),_0x3d1332);});return _0x16a30e[_0x4e9d47(0x169)](),['y','yes'][_0x4e9d47(0x176)](_0x121694[_0x4e9d47(0x171)]()[_0x4e9d47(0x174)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a36_0x208ae3=a36_0x1735;(function(_0x192e60,_0x17e882){const _0x25f6b7=a36_0x1735,_0x28843a=_0x192e60();while(!![]){try{const _0x4c896c=-parseInt(_0x25f6b7(0x141))/0x1+parseInt(_0x25f6b7(0x162))/0x2*(parseInt(_0x25f6b7(0x14f))/0x3)+parseInt(_0x25f6b7(0x122))/0x4+parseInt(_0x25f6b7(0x127))/0x5+parseInt(_0x25f6b7(0x13f))/0x6*(-parseInt(_0x25f6b7(0x153))/0x7)+-parseInt(_0x25f6b7(0x152))/0x8*(parseInt(_0x25f6b7(0x140))/0x9)+parseInt(_0x25f6b7(0x137))/0xa;if(_0x4c896c===_0x17e882)break;else _0x28843a['push'](_0x28843a['shift']());}catch(_0x478e30){_0x28843a['push'](_0x28843a['shift']());}}}(a36_0xcb76,0x42aea));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a36_0x1735(_0x38ab34,_0x47df9f){_0x38ab34=_0x38ab34-0x11e;const _0xcb7693=a36_0xcb76();let _0x173513=_0xcb7693[_0x38ab34];return _0x173513;}import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;function a36_0xcb76(){const _0x44343f=['Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','ENDPOINT','map','Incomplete\x20HOOK\x20path:\x20','operationType','lastSync','remoteId','create','1109692qRYXNE','type','Run\x20`','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','hash','246985lUCfGw','scriptsRoot','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','\x22.\x20','bool','attempted','force','string','aliasToDatasetCode','utf8','Runtime\x20script\x20cache\x20cleared.','stringify','description','functionNode','push','length','8837590omfPny','lockFilePath','bff','unchanged','status','would_push','every','runtime\x20cache\x20cleared','30gdUfQM','3748617apiseY','375397tOkMkr','some','\x20skipped,\x20','write','boolean','Lock\x20scope\x20for\x20app\x20\x22','appCode','apiDir','functions','script','str','HOOK','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','341538FzYMYC','join','message','8ynrCDA','363139WvmjIZ','filePath','update','Local\x20function\x20not\x20found:\x20','validation','has','POST','Would\x20inspect\x20','lockKey','name','version','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','apps','datasetCode','toISOString','2GqhCAJ','No\x20local\x20BFF\x20functions\x20found.','alias','parse','get','\x20uploaded,\x20','set','datasetId','code'];a36_0xcb76=function(){return _0x44343f;};return a36_0xcb76();}export const bffPush={'service':a36_0x208ae3(0x139),'command':a36_0x208ae3(0x135),'description':'Push\x20local\x20BFF\x20scripts\x20to\x20remote','risk':a36_0x208ae3(0x144),'flags':[{'name':a36_0x208ae3(0x123),'type':a36_0x208ae3(0x12e),'description':'Push\x20only\x20this\x20script\x20type','enum':['COMMON',a36_0x208ae3(0x16c),a36_0x208ae3(0x14c)]},{'name':'name','type':a36_0x208ae3(0x12e),'description':a36_0x208ae3(0x14d)},{'name':a36_0x208ae3(0x12d),'type':a36_0x208ae3(0x145),'description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x55b4f9){const _0x118326=a36_0x208ae3,_0x1fb96f=loadBffProjectConfig(_0x55b4f9[_0x118326(0x147)]),_0x2e7249=await readBffLockFile(_0x1fb96f[_0x118326(0x138)]),{appLock:_0x1af2ec}=ensureLockScope(_0x2e7249??createEmptyBffLock(),_0x55b4f9[_0x118326(0x147)],_0x1fb96f[_0x118326(0x128)],'push'),_0x5d4c18=await getTargetFunctions(_0x1fb96f,_0x55b4f9),_0x573cdd=_0x55b4f9[_0x118326(0x12b)](_0x118326(0x12d)),_0x3571f7=[];for(const _0x40ff5c of _0x5d4c18){const _0x276876=await computeFileHash(_0x40ff5c[_0x118326(0x154)]),_0x38f995=_0x1af2ec[_0x118326(0x149)][_0x40ff5c[_0x118326(0x15b)]],_0x1b39fe=!!_0x38f995&&_0x38f995[_0x118326(0x126)]===_0x276876;_0x3571f7[_0x118326(0x135)]({'lockKey':_0x40ff5c[_0x118326(0x15b)],'filePath':_0x40ff5c['filePath'],'remoteId':_0x38f995?.['remoteId']??null,'mode':_0x38f995?.[_0x118326(0x120)]?_0x118326(0x155):_0x118326(0x121),'status':!_0x573cdd&&_0x1b39fe?_0x118326(0x13a):'would_push'});}return{'method':_0x118326(0x159),'url':'/api/management/library/scripts/save','body':{'appCode':_0x55b4f9['appCode'],'force':_0x573cdd,'files':_0x3571f7,'cacheClearAtRuntime':_0x3571f7[_0x118326(0x142)](_0x325f9c=>_0x325f9c[_0x118326(0x13b)]===_0x118326(0x13c)),'cacheClearAtRuntimeTimes':_0x3571f7[_0x118326(0x142)](_0xa989d7=>_0xa989d7[_0x118326(0x13b)]===_0x118326(0x13c))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x118326(0x15a)+_0x3571f7[_0x118326(0x136)]+_0x118326(0x129)};},async 'execute'(_0x3f6099){const _0x4d3a7f=a36_0x208ae3,_0x5678d9=loadBffProjectConfig(_0x3f6099[_0x4d3a7f(0x147)]),_0xf746ed=await readBffLockFile(_0x5678d9[_0x4d3a7f(0x138)]),{lockData:_0x5be1b1,appLock:_0x40a943}=ensureLockScope(_0xf746ed??createEmptyBffLock(),_0x3f6099[_0x4d3a7f(0x147)],_0x5678d9[_0x4d3a7f(0x128)],_0x4d3a7f(0x135)),_0x5db2ce=await getTargetFunctions(_0x5678d9,_0x3f6099);if(_0x5db2ce[_0x4d3a7f(0x136)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x4d3a7f(0x163)};const _0x2a627a=_0x3f6099[_0x4d3a7f(0x12b)]('force'),_0xcc009a=JSON[_0x4d3a7f(0x165)](JSON[_0x4d3a7f(0x132)](_0x5be1b1)),_0x477787=_0xcc009a[_0x4d3a7f(0x15f)][_0x3f6099[_0x4d3a7f(0x147)]];if(!_0x477787)throw new Error(_0x4d3a7f(0x146)+_0x3f6099[_0x4d3a7f(0x147)]+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x37d55c=await buildHookMaps(_0x3f6099[_0x4d3a7f(0x147)],_0x3f6099[_0x4d3a7f(0x148)],_0x5db2ce,_0x477787),_0x3c0bf2=[],_0x5f7cc6=[],_0x548465=[];for(const _0x212d9d of _0x5db2ce){const _0x14fb46=await computeFileHash(_0x212d9d[_0x4d3a7f(0x154)]),_0x175e70=_0x477787[_0x4d3a7f(0x149)][_0x212d9d[_0x4d3a7f(0x15b)]];if(!_0x2a627a&&_0x175e70&&_0x175e70[_0x4d3a7f(0x126)]===_0x14fb46){_0x5f7cc6[_0x4d3a7f(0x135)]({'lockKey':_0x212d9d[_0x4d3a7f(0x15b)],'reason':_0x4d3a7f(0x13a)});continue;}try{await uploadSingleFunction(_0x3f6099[_0x4d3a7f(0x147)],_0x212d9d,_0x477787,_0x37d55c);const _0x190855=_0x477787['functions'][_0x212d9d[_0x4d3a7f(0x15b)]];_0x3c0bf2[_0x4d3a7f(0x135)]({'lockKey':_0x212d9d[_0x4d3a7f(0x15b)],'remoteId':_0x190855?.[_0x4d3a7f(0x120)]??0x0});}catch(_0x40a104){_0x548465['push']({'lockKey':_0x212d9d[_0x4d3a7f(0x15b)],'error':_0x40a104 instanceof Error?_0x40a104[_0x4d3a7f(0x151)]:String(_0x40a104)});}}_0x477787[_0x4d3a7f(0x11f)]=new Date()[_0x4d3a7f(0x161)](),await writeBffLockFile(_0x5678d9['lockFilePath'],_0xcc009a),await waitForUploadedLockEntries(_0x5678d9[_0x4d3a7f(0x138)],_0x3f6099['appCode'],_0x3c0bf2[_0x4d3a7f(0x16d)](_0x56f1c6=>_0x56f1c6['lockKey']));let _0x4f9fe4={'attempted':![],'cleared':![]};if(_0x3c0bf2[_0x4d3a7f(0x136)]>0x0)try{let _0x2f2c6b='';for(let _0x3856b6=0x0;_0x3856b6<CACHE_CLEAR_ATTEMPTS;_0x3856b6+=0x1){_0x2f2c6b=await clearBffScriptCache(),_0x3856b6<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x4f9fe4={'attempted':!![],'cleared':!![],'message':_0x2f2c6b||_0x4d3a7f(0x131)};}catch(_0x47154f){_0x4f9fe4={'attempted':!![],'cleared':![],'error':_0x47154f instanceof Error?_0x47154f[_0x4d3a7f(0x151)]:String(_0x47154f)};}const _0x426da6=_0x548465[_0x4d3a7f(0x136)]===0x0&&(_0x4f9fe4[_0x4d3a7f(0x12c)]?_0x4f9fe4['cleared']:!![]),_0x2c16d9=_0x4f9fe4['attempted']?_0x4f9fe4['cleared']?_0x4d3a7f(0x13e):'runtime\x20cache\x20clear\x20failed':'runtime\x20cache\x20not\x20needed';return{'ok':_0x426da6,'data':{'uploaded':_0x3c0bf2,'skipped':_0x5f7cc6,'failed':_0x548465,'cacheClear':_0x4f9fe4},'message':'Push\x20complete:\x20'+_0x3c0bf2[_0x4d3a7f(0x136)]+_0x4d3a7f(0x167)+_0x5f7cc6['length']+_0x4d3a7f(0x143)+_0x548465['length']+'\x20failed,\x20'+_0x2c16d9};}};async function getTargetFunctions(_0x533daa,_0x2bdc7f){const _0x50eca0=a36_0x208ae3,_0x21ac1a=_0x2bdc7f[_0x50eca0(0x14b)](_0x50eca0(0x123)),_0x4ec5c7=_0x2bdc7f['str'](_0x50eca0(0x15c)),_0xfc0a63=normalizeBffType(_0x21ac1a)??undefined;if(_0x4ec5c7&&!_0xfc0a63)throw CliErrors[_0x50eca0(0x157)](_0x50eca0(0x15e));const _0x35d995=await scanLocalBffFunctions(_0x533daa,_0xfc0a63);if(_0x4ec5c7){const _0x3aae34=_0x35d995['filter'](_0x51738f=>_0x51738f[_0x50eca0(0x15c)]===_0x4ec5c7);if(_0x3aae34[_0x50eca0(0x136)]===0x0)throw CliErrors[_0x50eca0(0x157)](_0x50eca0(0x156)+_0xfc0a63+'/'+_0x4ec5c7);return _0x3aae34;}return _0x35d995;}async function buildHookMaps(_0x418a3d,_0x411667,_0x37eea5,_0xc2d8b6){const _0x4486fa=a36_0x208ae3,_0x265261=_0x37eea5[_0x4486fa(0x142)](_0x3efcb1=>_0x3efcb1[_0x4486fa(0x123)]===_0x4486fa(0x14c));if(!_0x265261)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x2ab410=loadAliasMap(_0x411667,undefined,resolveApiFilePath(_0x411667,_0x418a3d)),_0x4512b1=new Map(_0x2ab410[_0x4486fa(0x16d)](_0x268f14=>[_0x268f14[_0x4486fa(0x164)],_0x268f14['datasetCode']]));for(const _0x267098 of Object['values'](_0xc2d8b6[_0x4486fa(0x149)])){_0x267098[_0x4486fa(0x164)]&&_0x267098[_0x4486fa(0x160)]&&!_0x4512b1['has'](_0x267098[_0x4486fa(0x164)])&&_0x4512b1[_0x4486fa(0x168)](_0x267098[_0x4486fa(0x164)],_0x267098[_0x4486fa(0x160)]);}const _0x50ffb1=await listDatasets(_0x418a3d),_0x3a10a1=new Map(_0x50ffb1[_0x4486fa(0x16d)](_0x3766fc=>[_0x3766fc[_0x4486fa(0x16a)],_0x3766fc]));return{'aliasToDatasetCode':_0x4512b1,'datasetCodeToDataset':_0x3a10a1};}async function uploadSingleFunction(_0x40765b,_0x2f2908,_0x53d391,_0x5dd8a7){const _0x3d8ab8=a36_0x208ae3,_0x2807d1=await readFile(_0x2f2908[_0x3d8ab8(0x154)],_0x3d8ab8(0x130)),_0x3ede29=await computeFileHash(_0x2f2908[_0x3d8ab8(0x154)]),_0x302b4e=_0x53d391['functions'][_0x2f2908['lockKey']];if(_0x302b4e?.[_0x3d8ab8(0x120)]&&_0x302b4e['version']==null)throw CliErrors[_0x3d8ab8(0x157)](_0x2f2908[_0x3d8ab8(0x15b)]+_0x3d8ab8(0x14e));let _0x4a7dcf=extractScriptDescription(_0x2807d1);if(!_0x4a7dcf&&_0x302b4e?.[_0x3d8ab8(0x120)]){const _0x15ff7a=await getBffScriptInfo(_0x302b4e[_0x3d8ab8(0x120)]);_0x4a7dcf=_0x15ff7a['description']||undefined;}const _0x43a250={'appCode':_0x40765b,'functionName':_0x2f2908['name'],'scriptType':_0x2f2908[_0x3d8ab8(0x123)],'scriptContent':_0x2807d1};if(_0x302b4e?.[_0x3d8ab8(0x120)])_0x43a250['id']=_0x302b4e[_0x3d8ab8(0x120)];if(_0x302b4e?.['version']!=null)_0x43a250['version']=_0x302b4e[_0x3d8ab8(0x15d)];if(_0x4a7dcf)_0x43a250[_0x3d8ab8(0x133)]=_0x4a7dcf;if(_0x2f2908[_0x3d8ab8(0x123)]===_0x3d8ab8(0x14c)){const _0x5cf2ed=_0x2f2908[_0x3d8ab8(0x164)];if(!_0x5cf2ed||!_0x2f2908[_0x3d8ab8(0x11e)]||!_0x2f2908[_0x3d8ab8(0x134)])throw CliErrors[_0x3d8ab8(0x157)](_0x3d8ab8(0x16e)+_0x2f2908[_0x3d8ab8(0x15b)]);const _0x529892=_0x5dd8a7[_0x3d8ab8(0x12f)][_0x3d8ab8(0x166)](_0x5cf2ed)??_0x302b4e?.['datasetCode']??_0x5cf2ed,_0x147426=_0x5dd8a7['datasetCodeToDataset']['get'](_0x529892);if(!_0x147426)throw CliErrors['validation']('Cannot\x20resolve\x20dataset\x20for\x20\x22'+_0x5cf2ed+_0x3d8ab8(0x12a)+(_0x3d8ab8(0x124)+CLI_BIN_NAME+_0x3d8ab8(0x125)));_0x43a250[_0x3d8ab8(0x169)]=_0x147426['id'],_0x43a250[_0x3d8ab8(0x11e)]=_0x2f2908[_0x3d8ab8(0x11e)],_0x43a250['functionNode']=_0x2f2908[_0x3d8ab8(0x134)];}const _0x5b7485=await saveBffScript(_0x43a250),_0x516c5c=_0x5b7485['id'],_0x61afa8=_0x5b7485[_0x3d8ab8(0x14a)]??await getBffScriptInfo(_0x516c5c),_0x6bf424={'hash':_0x3ede29,'remoteId':_0x516c5c,'version':_0x61afa8[_0x3d8ab8(0x15d)]};if(_0x2f2908[_0x3d8ab8(0x123)]===_0x3d8ab8(0x14c)){const _0x368fae=_0x2f2908[_0x3d8ab8(0x164)],_0x4f9fc9=_0x5dd8a7['aliasToDatasetCode']['get'](_0x368fae)??_0x302b4e?.[_0x3d8ab8(0x160)]??_0x368fae;_0x5dd8a7[_0x3d8ab8(0x12f)][_0x3d8ab8(0x158)](_0x368fae)?_0x6bf424[_0x3d8ab8(0x164)]=_0x368fae:_0x6bf424[_0x3d8ab8(0x164)]=_0x302b4e?.[_0x3d8ab8(0x164)],_0x6bf424[_0x3d8ab8(0x160)]=_0x4f9fc9,_0x6bf424[_0x3d8ab8(0x11e)]=_0x2f2908[_0x3d8ab8(0x11e)],_0x6bf424['functionNode']=_0x2f2908[_0x3d8ab8(0x134)];}_0x53d391[_0x3d8ab8(0x149)][_0x2f2908[_0x3d8ab8(0x15b)]]=_0x6bf424;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x1b8d5e,_0x44a311,_0x16d0c0){const _0x1a9de6=a36_0x208ae3;if(_0x16d0c0['length']===0x0)return;for(let _0x573c13=0x0;_0x573c13<LOCK_SETTLE_RETRY_COUNT;_0x573c13+=0x1){const _0x31b022=await readBffLockFile(_0x1b8d5e),_0x95232=_0x31b022?.[_0x1a9de6(0x15f)]?.[_0x44a311]?.['functions']??{},_0x2f0fec=_0x16d0c0[_0x1a9de6(0x13d)](_0x2e0fcd=>!!_0x95232[_0x2e0fcd]?.[_0x1a9de6(0x120)]);if(_0x2f0fec)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x1a9de6(0x16b)+_0x16d0c0[_0x1a9de6(0x150)](',\x20')+'.');}
|
|
1
|
+
const a36_0x44563e=a36_0x1108;function a36_0x2616(){const _0xe9fcff=['alias','lockFilePath','cleared','runtime\x20cache\x20not\x20needed','remoteId','\x22.\x20','1507077BuZzgq','Lock\x20scope\x20for\x20app\x20\x22','force','validation','COMMON','parse','version','Would\x20inspect\x20','push','\x22\x20not\x20found\x20after\x20ensureLockScope.','unchanged','length','attempted','101151nGCNld','filter','Push\x20only\x20this\x20script\x20type','runtime\x20cache\x20clear\x20failed','aliasToDatasetCode','functionNode','map','stringify','script','every','139yLJUjo','539KCOPVt','toISOString','hash','lockKey','12226QnRsAc','name','datasetCodeToDataset','POST','utf8','set','Push\x20complete:\x20','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','Incomplete\x20HOOK\x20path:\x20','1886826sogKzB','60RyoIpE','4060028fhmKoL','519590UpuLqV','description','write','appCode','would_push','bool','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','values','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','\x20uploaded,\x20','Local\x20function\x20not\x20found:\x20','scriptsRoot','\x20skipped,\x20','functions','apps','has','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','apiDir','type','No\x20local\x20BFF\x20functions\x20found.','34380zzkwAm','280UpmyaC','filePath','string','get','HOOK',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','operationType','str','status','Push\x20local\x20BFF\x20scripts\x20to\x20remote','datasetCode','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','some','runtime\x20cache\x20cleared'];a36_0x2616=function(){return _0xe9fcff;};return a36_0x2616();}(function(_0x18d447,_0x4ca47f){const _0x52d854=a36_0x1108,_0x56fa16=_0x18d447();while(!![]){try{const _0x9d935a=parseInt(_0x52d854(0x157))/0x1*(-parseInt(_0x52d854(0x15c))/0x2)+-parseInt(_0x52d854(0x140))/0x3+-parseInt(_0x52d854(0x166))/0x4*(parseInt(_0x52d854(0x12b))/0x5)+-parseInt(_0x52d854(0x165))/0x6+-parseInt(_0x52d854(0x167))/0x7+parseInt(_0x52d854(0x12c))/0x8*(parseInt(_0x52d854(0x14d))/0x9)+-parseInt(_0x52d854(0x168))/0xa*(-parseInt(_0x52d854(0x158))/0xb);if(_0x9d935a===_0x4ca47f)break;else _0x56fa16['push'](_0x56fa16['shift']());}catch(_0x69d627){_0x56fa16['push'](_0x56fa16['shift']());}}}(a36_0x2616,0x8ff6b));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';function a36_0x1108(_0xbdaec9,_0x2cad99){_0xbdaec9=_0xbdaec9-0x11c;const _0x261614=a36_0x2616();let _0x110833=_0x261614[_0xbdaec9];return _0x110833;}import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':a36_0x44563e(0x148),'description':a36_0x44563e(0x135),'risk':a36_0x44563e(0x16a),'flags':[{'name':a36_0x44563e(0x129),'type':a36_0x44563e(0x12e),'description':a36_0x44563e(0x14f),'enum':[a36_0x44563e(0x144),'ENDPOINT',a36_0x44563e(0x130)]},{'name':'name','type':a36_0x44563e(0x12e),'description':a36_0x44563e(0x137)},{'name':a36_0x44563e(0x142),'type':'boolean','description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x502737){const _0x2b38ad=a36_0x44563e,_0x57f77f=loadBffProjectConfig(_0x502737[_0x2b38ad(0x16b)]),_0x42b6e7=await readBffLockFile(_0x57f77f[_0x2b38ad(0x13b)]),{appLock:_0xfa29fa}=ensureLockScope(_0x42b6e7??createEmptyBffLock(),_0x502737[_0x2b38ad(0x16b)],_0x57f77f[_0x2b38ad(0x122)],_0x2b38ad(0x148)),_0x4e8d3d=await getTargetFunctions(_0x57f77f,_0x502737),_0x4d7d82=_0x502737[_0x2b38ad(0x11c)](_0x2b38ad(0x142)),_0x422c0d=[];for(const _0x3ef563 of _0x4e8d3d){const _0x2d49c1=await computeFileHash(_0x3ef563[_0x2b38ad(0x12d)]),_0x393fc5=_0xfa29fa[_0x2b38ad(0x124)][_0x3ef563['lockKey']],_0x3ccfbc=!!_0x393fc5&&_0x393fc5[_0x2b38ad(0x15a)]===_0x2d49c1;_0x422c0d[_0x2b38ad(0x148)]({'lockKey':_0x3ef563['lockKey'],'filePath':_0x3ef563[_0x2b38ad(0x12d)],'remoteId':_0x393fc5?.[_0x2b38ad(0x13e)]??null,'mode':_0x393fc5?.[_0x2b38ad(0x13e)]?'update':'create','status':!_0x4d7d82&&_0x3ccfbc?_0x2b38ad(0x14a):_0x2b38ad(0x16c)});}return{'method':_0x2b38ad(0x15f),'url':'/api/management/library/scripts/save','body':{'appCode':_0x502737[_0x2b38ad(0x16b)],'force':_0x4d7d82,'files':_0x422c0d,'cacheClearAtRuntime':_0x422c0d['some'](_0x16c46f=>_0x16c46f[_0x2b38ad(0x134)]===_0x2b38ad(0x16c)),'cacheClearAtRuntimeTimes':_0x422c0d[_0x2b38ad(0x138)](_0x5b9e50=>_0x5b9e50[_0x2b38ad(0x134)]==='would_push')?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x2b38ad(0x147)+_0x422c0d[_0x2b38ad(0x14b)]+_0x2b38ad(0x163)};},async 'execute'(_0x45a248){const _0xeb62b2=a36_0x44563e,_0x47e171=loadBffProjectConfig(_0x45a248[_0xeb62b2(0x16b)]),_0x4c307f=await readBffLockFile(_0x47e171[_0xeb62b2(0x13b)]),{lockData:_0x5c424d,appLock:_0xf6cc28}=ensureLockScope(_0x4c307f??createEmptyBffLock(),_0x45a248[_0xeb62b2(0x16b)],_0x47e171[_0xeb62b2(0x122)],_0xeb62b2(0x148)),_0x14283c=await getTargetFunctions(_0x47e171,_0x45a248);if(_0x14283c['length']===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0xeb62b2(0x12a)};const _0x289abb=_0x45a248[_0xeb62b2(0x11c)]('force'),_0x3b8a94=JSON[_0xeb62b2(0x145)](JSON[_0xeb62b2(0x154)](_0x5c424d)),_0x1ce08b=_0x3b8a94['apps'][_0x45a248[_0xeb62b2(0x16b)]];if(!_0x1ce08b)throw new Error(_0xeb62b2(0x141)+_0x45a248[_0xeb62b2(0x16b)]+_0xeb62b2(0x149));const _0xc5f50b=await buildHookMaps(_0x45a248['appCode'],_0x45a248[_0xeb62b2(0x128)],_0x14283c,_0x1ce08b),_0x1084f7=[],_0x1d6014=[],_0x4b35f2=[];for(const _0x5b3585 of _0x14283c){const _0xa01c7=await computeFileHash(_0x5b3585['filePath']),_0x59e40a=_0x1ce08b[_0xeb62b2(0x124)][_0x5b3585['lockKey']];if(!_0x289abb&&_0x59e40a&&_0x59e40a[_0xeb62b2(0x15a)]===_0xa01c7){_0x1d6014['push']({'lockKey':_0x5b3585[_0xeb62b2(0x15b)],'reason':_0xeb62b2(0x14a)});continue;}try{await uploadSingleFunction(_0x45a248[_0xeb62b2(0x16b)],_0x5b3585,_0x1ce08b,_0xc5f50b);const _0x130ac2=_0x1ce08b[_0xeb62b2(0x124)][_0x5b3585['lockKey']];_0x1084f7[_0xeb62b2(0x148)]({'lockKey':_0x5b3585[_0xeb62b2(0x15b)],'remoteId':_0x130ac2?.[_0xeb62b2(0x13e)]??0x0});}catch(_0x1ba013){_0x4b35f2[_0xeb62b2(0x148)]({'lockKey':_0x5b3585[_0xeb62b2(0x15b)],'error':_0x1ba013 instanceof Error?_0x1ba013['message']:String(_0x1ba013)});}}_0x1ce08b['lastSync']=new Date()[_0xeb62b2(0x159)](),await writeBffLockFile(_0x47e171[_0xeb62b2(0x13b)],_0x3b8a94),await waitForUploadedLockEntries(_0x47e171['lockFilePath'],_0x45a248[_0xeb62b2(0x16b)],_0x1084f7[_0xeb62b2(0x153)](_0x2641bf=>_0x2641bf[_0xeb62b2(0x15b)]));let _0x1e40a4={'attempted':![],'cleared':![]};if(_0x1084f7[_0xeb62b2(0x14b)]>0x0)try{let _0xe0b246='';for(let _0x33bf78=0x0;_0x33bf78<CACHE_CLEAR_ATTEMPTS;_0x33bf78+=0x1){_0xe0b246=await clearBffScriptCache(),_0x33bf78<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x1e40a4={'attempted':!![],'cleared':!![],'message':_0xe0b246||'Runtime\x20script\x20cache\x20cleared.'};}catch(_0x409ed2){_0x1e40a4={'attempted':!![],'cleared':![],'error':_0x409ed2 instanceof Error?_0x409ed2['message']:String(_0x409ed2)};}const _0x19397f=_0x4b35f2[_0xeb62b2(0x14b)]===0x0&&(_0x1e40a4[_0xeb62b2(0x14c)]?_0x1e40a4[_0xeb62b2(0x13c)]:!![]),_0x2af8d1=_0x1e40a4['attempted']?_0x1e40a4[_0xeb62b2(0x13c)]?_0xeb62b2(0x139):_0xeb62b2(0x150):_0xeb62b2(0x13d);return{'ok':_0x19397f,'data':{'uploaded':_0x1084f7,'skipped':_0x1d6014,'failed':_0x4b35f2,'cacheClear':_0x1e40a4},'message':_0xeb62b2(0x162)+_0x1084f7['length']+_0xeb62b2(0x120)+_0x1d6014[_0xeb62b2(0x14b)]+_0xeb62b2(0x123)+_0x4b35f2[_0xeb62b2(0x14b)]+'\x20failed,\x20'+_0x2af8d1};}};async function getTargetFunctions(_0x133cd5,_0x58daa8){const _0x16a771=a36_0x44563e,_0x43fe8f=_0x58daa8[_0x16a771(0x133)](_0x16a771(0x129)),_0x465882=_0x58daa8[_0x16a771(0x133)]('name'),_0x4ca742=normalizeBffType(_0x43fe8f)??undefined;if(_0x465882&&!_0x4ca742)throw CliErrors[_0x16a771(0x143)](_0x16a771(0x11f));const _0x2e776e=await scanLocalBffFunctions(_0x133cd5,_0x4ca742);if(_0x465882){const _0x23fb18=_0x2e776e[_0x16a771(0x14e)](_0x4d85ea=>_0x4d85ea['name']===_0x465882);if(_0x23fb18['length']===0x0)throw CliErrors[_0x16a771(0x143)](_0x16a771(0x121)+_0x4ca742+'/'+_0x465882);return _0x23fb18;}return _0x2e776e;}async function buildHookMaps(_0x3690e1,_0x5c4780,_0x10618e,_0x7f2085){const _0xec8ad=a36_0x44563e,_0x554503=_0x10618e[_0xec8ad(0x138)](_0x1f3303=>_0x1f3303['type']===_0xec8ad(0x130));if(!_0x554503)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x4c4e34=loadAliasMap(_0x5c4780,undefined,resolveApiFilePath(_0x5c4780,_0x3690e1)),_0x20de6f=new Map(_0x4c4e34[_0xec8ad(0x153)](_0x36782c=>[_0x36782c[_0xec8ad(0x13a)],_0x36782c[_0xec8ad(0x136)]]));for(const _0x4e24f8 of Object[_0xec8ad(0x11e)](_0x7f2085[_0xec8ad(0x124)])){_0x4e24f8['alias']&&_0x4e24f8[_0xec8ad(0x136)]&&!_0x20de6f[_0xec8ad(0x126)](_0x4e24f8['alias'])&&_0x20de6f[_0xec8ad(0x161)](_0x4e24f8['alias'],_0x4e24f8[_0xec8ad(0x136)]);}const _0x26774b=await listDatasets(_0x3690e1),_0x2b9d9a=new Map(_0x26774b['map'](_0x109228=>[_0x109228['code'],_0x109228]));return{'aliasToDatasetCode':_0x20de6f,'datasetCodeToDataset':_0x2b9d9a};}async function uploadSingleFunction(_0x59f8e9,_0x1b093d,_0x6367cf,_0x2a00d6){const _0x4ba075=a36_0x44563e,_0xac564d=await readFile(_0x1b093d[_0x4ba075(0x12d)],_0x4ba075(0x160)),_0x5cc3c2=await computeFileHash(_0x1b093d['filePath']),_0x20a8c6=_0x6367cf[_0x4ba075(0x124)][_0x1b093d[_0x4ba075(0x15b)]];if(_0x20a8c6?.[_0x4ba075(0x13e)]&&_0x20a8c6['version']==null)throw CliErrors[_0x4ba075(0x143)](_0x1b093d[_0x4ba075(0x15b)]+_0x4ba075(0x131));let _0xb50d28=extractScriptDescription(_0xac564d);if(!_0xb50d28&&_0x20a8c6?.['remoteId']){const _0xfd21e6=await getBffScriptInfo(_0x20a8c6[_0x4ba075(0x13e)]);_0xb50d28=_0xfd21e6['description']||undefined;}const _0x28c26f={'appCode':_0x59f8e9,'functionName':_0x1b093d[_0x4ba075(0x15d)],'scriptType':_0x1b093d[_0x4ba075(0x129)],'scriptContent':_0xac564d};if(_0x20a8c6?.[_0x4ba075(0x13e)])_0x28c26f['id']=_0x20a8c6[_0x4ba075(0x13e)];if(_0x20a8c6?.[_0x4ba075(0x146)]!=null)_0x28c26f[_0x4ba075(0x146)]=_0x20a8c6[_0x4ba075(0x146)];if(_0xb50d28)_0x28c26f[_0x4ba075(0x169)]=_0xb50d28;if(_0x1b093d[_0x4ba075(0x129)]==='HOOK'){const _0x51994c=_0x1b093d['alias'];if(!_0x51994c||!_0x1b093d[_0x4ba075(0x132)]||!_0x1b093d['functionNode'])throw CliErrors[_0x4ba075(0x143)](_0x4ba075(0x164)+_0x1b093d[_0x4ba075(0x15b)]);const _0x5b663d=_0x2a00d6[_0x4ba075(0x151)][_0x4ba075(0x12f)](_0x51994c)??_0x20a8c6?.['datasetCode']??_0x51994c,_0x544c00=_0x2a00d6[_0x4ba075(0x15e)][_0x4ba075(0x12f)](_0x5b663d);if(!_0x544c00)throw CliErrors[_0x4ba075(0x143)]('Cannot\x20resolve\x20dataset\x20for\x20\x22'+_0x51994c+_0x4ba075(0x13f)+('Run\x20`'+CLI_BIN_NAME+_0x4ba075(0x127)));_0x28c26f['datasetId']=_0x544c00['id'],_0x28c26f[_0x4ba075(0x132)]=_0x1b093d[_0x4ba075(0x132)],_0x28c26f[_0x4ba075(0x152)]=_0x1b093d[_0x4ba075(0x152)];}const _0x1ead39=await saveBffScript(_0x28c26f),_0xafc3ef=_0x1ead39['id'],_0x318aa0=_0x1ead39[_0x4ba075(0x155)]??await getBffScriptInfo(_0xafc3ef),_0x277977={'hash':_0x5cc3c2,'remoteId':_0xafc3ef,'version':_0x318aa0[_0x4ba075(0x146)]};if(_0x1b093d[_0x4ba075(0x129)]===_0x4ba075(0x130)){const _0x5f4bd6=_0x1b093d[_0x4ba075(0x13a)],_0x50dbf3=_0x2a00d6['aliasToDatasetCode']['get'](_0x5f4bd6)??_0x20a8c6?.[_0x4ba075(0x136)]??_0x5f4bd6;_0x2a00d6['aliasToDatasetCode'][_0x4ba075(0x126)](_0x5f4bd6)?_0x277977[_0x4ba075(0x13a)]=_0x5f4bd6:_0x277977[_0x4ba075(0x13a)]=_0x20a8c6?.[_0x4ba075(0x13a)],_0x277977[_0x4ba075(0x136)]=_0x50dbf3,_0x277977[_0x4ba075(0x132)]=_0x1b093d[_0x4ba075(0x132)],_0x277977[_0x4ba075(0x152)]=_0x1b093d['functionNode'];}_0x6367cf[_0x4ba075(0x124)][_0x1b093d[_0x4ba075(0x15b)]]=_0x277977;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x3b4ff4,_0x301164,_0x56abe9){const _0x12c9ff=a36_0x44563e;if(_0x56abe9['length']===0x0)return;for(let _0x2deaa4=0x0;_0x2deaa4<LOCK_SETTLE_RETRY_COUNT;_0x2deaa4+=0x1){const _0x2a5d94=await readBffLockFile(_0x3b4ff4),_0x4aeb77=_0x2a5d94?.[_0x12c9ff(0x125)]?.[_0x301164]?.[_0x12c9ff(0x124)]??{},_0x4700db=_0x56abe9[_0x12c9ff(0x156)](_0x5a046e=>!!_0x4aeb77[_0x5a046e]?.[_0x12c9ff(0x13e)]);if(_0x4700db)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x12c9ff(0x11d)+_0x56abe9['join'](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a37_0x4907(_0x4c61c6,_0x3eb566){_0x4c61c6=_0x4c61c6-0xb0;const _0x114996=a37_0x1149();let _0x490786=_0x114996[_0x4c61c6];return _0x490786;}const a37_0x61e6b5=a37_0x4907;(function(_0x5f0245,_0x275226){const _0x5a2f4b=a37_0x4907,_0x124167=_0x5f0245();while(!![]){try{const _0xbcf880=parseInt(_0x5a2f4b(0xb2))/0x1+parseInt(_0x5a2f4b(0xc0))/0x2+parseInt(_0x5a2f4b(0xb0))/0x3*(parseInt(_0x5a2f4b(0xcf))/0x4)+parseInt(_0x5a2f4b(0xc2))/0x5*(-parseInt(_0x5a2f4b(0xca))/0x6)+-parseInt(_0x5a2f4b(0xc7))/0x7*(parseInt(_0x5a2f4b(0xb4))/0x8)+parseInt(_0x5a2f4b(0xc6))/0x9+-parseInt(_0x5a2f4b(0xb6))/0xa*(-parseInt(_0x5a2f4b(0xbe))/0xb);if(_0xbcf880===_0x275226)break;else _0x124167['push'](_0x124167['shift']());}catch(_0x2f837a){_0x124167['push'](_0x124167['shift']());}}}(a37_0x1149,0xc6ec5));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a37_0x1149(){const _0x4e9c19=['lockFilePath','11DKbLWd','filePath','1728828qzrfDn','scriptsRoot','1871210xWGaLN','boolean','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','hash','1910808qANRdz','7usTDKC','\x20added,\x20','apiDir','18Dswxiz','lockKey','map','\x20remote-only','length','4ordwUQ','1177206jqcVAx','appCode','307764nQDjND','status','7221488ZWDybc','alias','10633090cqVJzu','\x20modified,\x20','remote','read','push','functions','datasetCode'];a37_0x1149=function(){return _0x4e9c19;};return a37_0x1149();}import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':'bff','command':a37_0x61e6b5(0xb3),'description':a37_0x61e6b5(0xc4),'risk':a37_0x61e6b5(0xb9),'flags':[{'name':'remote','type':a37_0x61e6b5(0xc3),'description':'Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally'}],async 'execute'(_0x9681a1){const _0x2dc390=a37_0x61e6b5,_0x2982c6=loadBffProjectConfig(_0x9681a1[_0x2dc390(0xb1)]),_0x2b98af=await readBffLockFile(_0x2982c6[_0x2dc390(0xbd)]),{appLock:_0x4d3a7f}=ensureLockScope(_0x2b98af??createEmptyBffLock(),_0x9681a1['appCode'],_0x2982c6[_0x2dc390(0xc1)],_0x2dc390(0xb3)),_0x122a48=await scanLocalBffFunctions(_0x2982c6),_0x7de563=[],_0x45c3c2=[],_0x3922c8=[];for(const _0x510672 of _0x122a48){const _0x1916df=await computeFileHash(_0x510672[_0x2dc390(0xbf)]),_0x133033=_0x4d3a7f[_0x2dc390(0xbb)][_0x510672[_0x2dc390(0xcb)]];if(!_0x133033)_0x7de563[_0x2dc390(0xba)](_0x510672[_0x2dc390(0xcb)]);else _0x133033[_0x2dc390(0xc5)]!==_0x1916df?_0x45c3c2[_0x2dc390(0xba)](_0x510672[_0x2dc390(0xcb)]):_0x3922c8[_0x2dc390(0xba)](_0x510672[_0x2dc390(0xcb)]);}const _0x3f66e8=[];if(_0x9681a1['bool'](_0x2dc390(0xb8))){const _0x2d31b8=loadAliasMap(_0x9681a1[_0x2dc390(0xc9)],undefined,resolveApiFilePath(_0x9681a1[_0x2dc390(0xc9)],_0x9681a1[_0x2dc390(0xb1)])),_0x594595=new Map(_0x2d31b8[_0x2dc390(0xcc)](_0x215d42=>[_0x215d42[_0x2dc390(0xbc)],_0x215d42[_0x2dc390(0xb5)]])),[_0x494961,_0x428f73]=await Promise['all']([listBffScripts(_0x9681a1[_0x2dc390(0xb1)]),getBffScriptStatistics(_0x9681a1[_0x2dc390(0xb1)])]),_0x4f07d8=createHookLocationMap(_0x428f73),_0x1dd924=new Set(_0x122a48['map'](_0x5e087e=>_0x5e087e[_0x2dc390(0xcb)]));for(const _0x2c473b of _0x494961){const _0x12a96a=resolveRemoteScriptTarget(_0x2982c6,_0x2c473b,_0x4f07d8,_0x4d3a7f[_0x2dc390(0xbb)],_0x594595);_0x12a96a&&!_0x1dd924['has'](_0x12a96a[_0x2dc390(0xcb)])&&_0x3f66e8[_0x2dc390(0xba)](_0x12a96a[_0x2dc390(0xcb)]);}}const _0x5df87c=_0x7de563[_0x2dc390(0xce)]===0x0&&_0x45c3c2[_0x2dc390(0xce)]===0x0&&_0x3f66e8[_0x2dc390(0xce)]===0x0;return{'ok':!![],'data':{'added':_0x7de563,'modified':_0x45c3c2,'unchanged':_0x3922c8,'remoteOnly':_0x3f66e8},'message':_0x5df87c?'All\x20BFF\x20scripts\x20are\x20in\x20sync.':_0x7de563[_0x2dc390(0xce)]+_0x2dc390(0xc8)+_0x45c3c2['length']+_0x2dc390(0xb7)+_0x3922c8[_0x2dc390(0xce)]+'\x20unchanged'+(_0x3f66e8['length']>0x0?',\x20'+_0x3f66e8['length']+_0x2dc390(0xcd):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x4fa40e=a38_0x5555;function a38_0x312f(){const _0x16a3a3=['\x20installed','130545qLWigK','4719400YKhDFZ','info','read','164CnieFf','cli-skill-install','24798CLJkiI','11078694uXODFd','inherit','code','61620870KVzHiI','skillVersion','repairCommand','pipe','changed','setLogPath','\x20at\x20','Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20','nonInteractive',']:\x20','14kLBjyG','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.','installedPath','\x20is\x20already\x20current','CLI\x20Built-in\x20Skill\x20','unknown','68181nZFuzg','695lLRcuX','\x20via\x20skills@latest','cwd','7696017lYmnWW','log','Built-in\x20Skill\x20install\x20failed\x20[','apiError','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill'];a38_0x312f=function(){return _0x16a3a3;};return a38_0x312f();}(function(_0x140453,_0x3b3cc6){const _0xcea707=a38_0x5555,_0x52fdd4=_0x140453();while(!![]){try{const _0x586a40=parseInt(_0xcea707(0x14f))/0x1*(-parseInt(_0xcea707(0x13f))/0x2)+-parseInt(_0xcea707(0x145))/0x3*(parseInt(_0xcea707(0x153))/0x4)+-parseInt(_0xcea707(0x146))/0x5*(parseInt(_0xcea707(0x155))/0x6)+-parseInt(_0xcea707(0x149))/0x7+-parseInt(_0xcea707(0x150))/0x8+-parseInt(_0xcea707(0x156))/0x9+parseInt(_0xcea707(0x135))/0xa;if(_0x586a40===_0x3b3cc6)break;else _0x52fdd4['push'](_0x52fdd4['shift']());}catch(_0x17dff4){_0x52fdd4['push'](_0x52fdd4['shift']());}}}(a38_0x312f,0xc8998));import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';function a38_0x5555(_0x1b0de0,_0x32be91){_0x1b0de0=_0x1b0de0-0x133;const _0x312f35=a38_0x312f();let _0x5555e8=_0x312f35[_0x1b0de0];return _0x5555e8;}import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':'cli-skill','command':'install','description':a38_0x4fa40e(0x14d),'risk':a38_0x4fa40e(0x152),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x42507f){const _0x11fbb2=a38_0x4fa40e;logger[_0x11fbb2(0x13a)](process[_0x11fbb2(0x148)]()),logger[_0x11fbb2(0x151)](_0x11fbb2(0x154),_0x11fbb2(0x140));const _0x4b43eb=installBuiltinSkill({'stdio':_0x42507f[_0x11fbb2(0x13d)]?_0x11fbb2(0x138):_0x11fbb2(0x133)});if(!_0x4b43eb['ok'])throw CliErrors[_0x11fbb2(0x14c)](_0x11fbb2(0x14b)+_0x4b43eb[_0x11fbb2(0x134)]+_0x11fbb2(0x13e)+(_0x4b43eb['error']||_0x11fbb2(0x144)),_0x11fbb2(0x13c)+_0x4b43eb[_0x11fbb2(0x137)]);return console[_0x11fbb2(0x14a)](_0x4b43eb[_0x11fbb2(0x139)]?_0x11fbb2(0x143)+_0x4b43eb[_0x11fbb2(0x136)]+_0x11fbb2(0x14e)+(_0x4b43eb['installedPath']?_0x11fbb2(0x13b)+_0x4b43eb[_0x11fbb2(0x141)]:_0x11fbb2(0x147)):_0x11fbb2(0x143)+_0x4b43eb[_0x11fbb2(0x136)]+_0x11fbb2(0x142)+(_0x4b43eb[_0x11fbb2(0x141)]?'\x20at\x20'+_0x4b43eb['installedPath']:'')),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0x59dd80=a39_0x151a;(function(_0x4355e8,_0x1de3cf){const _0x8eec00=a39_0x151a,_0xa619fe=_0x4355e8();while(!![]){try{const _0x2b21e6=parseInt(_0x8eec00(0x97))/0x1*(parseInt(_0x8eec00(0x93))/0x2)+-parseInt(_0x8eec00(0xde))/0x3*(-parseInt(_0x8eec00(0xce))/0x4)+-parseInt(_0x8eec00(0xca))/0x5+parseInt(_0x8eec00(0xb9))/0x6+parseInt(_0x8eec00(0xae))/0x7*(parseInt(_0x8eec00(0xe1))/0x8)+parseInt(_0x8eec00(0xbc))/0x9+parseInt(_0x8eec00(0xa9))/0xa*(-parseInt(_0x8eec00(0xc9))/0xb);if(_0x2b21e6===_0x1de3cf)break;else _0xa619fe['push'](_0xa619fe['shift']());}catch(_0x2d8f76){_0xa619fe['push'](_0xa619fe['shift']());}}}(a39_0x4a9a,0x7a588));import a39_0x3da42f from'chalk';import a39_0x24b1d7 from'ora';import a39_0x4855a9 from'semver';import{execa}from'execa';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';function a39_0x4a9a(){const _0x548067=['run','trim','/dist-tags','update','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','latest','unknown','fromEntries','str','execPath','filter','\x20→\x20','expected\x20','Invalid\x20version:\x20','1070fGPgis','start','npm','fail','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','7rENBtw','Already\x20on\x20requested\x20version\x20(v','toLowerCase','entries','gray','source','\x20cli-skill\x20install','Install\x20a\x20specific\x20CLI\x20version','@latest','yellow','green','73320jrKjAn','info','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','6932691pKLRKG','\x20install\x20-g\x20','warn','timeout','validation','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','red','object','string',']:\x20','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','length','valid','96206NNmZVz','1838440KwlSAm',',\x20found\x20','skillVersion','Already\x20up\x20to\x20date\x20(v','1104ZBlcsg','Requested\x20version:\x20','Update\x20available:\x20','bun','message','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','Updated\x20to\x20v','https://registry.npmjs.org/-/package/','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','Update\x20failed','slice','install','\x20\x20CLI\x20Built-in\x20Skill\x20','code','includes','log','381dZQMBD',',\x20state\x20','bool','4055144ZKreYq','beta','version','state','2292OVpbpD','Version\x20comparison\x20failed','Current\x20version:\x20','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','419ulIpXH','error','current','succeed'];a39_0x4a9a=function(){return _0x548067;};return a39_0x4a9a();}import{CliErrors}from'../errors.js';import{inspectInstalledBuiltinSkillVersion,installBuiltinSkill}from'../skills/builtin-skill.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x11b24e=a39_0x151a;return GIT_COMMIT!==_0x11b24e(0xa1)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x11b24e(0xd8)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x56945b=a39_0x151a,_0x21a251=process[_0x56945b(0xa4)][_0x56945b(0xb0)]();if(_0x21a251[_0x56945b(0xdc)]('bun'))return _0x56945b(0xd1);return _0x56945b(0xab);}const updateFlags=[{'name':a39_0x59dd80(0x90),'type':'boolean','description':a39_0x59dd80(0x9f),'default':![]},{'name':'version','type':a39_0x59dd80(0xc4),'description':a39_0x59dd80(0xb5)}];function getRequestedVersion(_0x5ad522){const _0x172543=a39_0x59dd80;return _0x5ad522[_0x172543(0xa3)](_0x172543(0x91))[_0x172543(0x9c)]();}async function validateUpdateFlags(_0x17f15c){const _0x216721=a39_0x59dd80,_0x237d48=_0x17f15c['bool'](_0x216721(0x90)),_0x2e24b7=getRequestedVersion(_0x17f15c);if(_0x237d48&&_0x2e24b7)throw CliErrors[_0x216721(0xc0)](_0x216721(0xd6),_0x216721(0xad));if(_0x2e24b7&&!a39_0x4855a9[_0x216721(0xc8)](_0x2e24b7))throw CliErrors[_0x216721(0xc0)](_0x216721(0xa8)+_0x2e24b7,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}function a39_0x151a(_0x40b379,_0x32495c){_0x40b379=_0x40b379-0x90;const _0x4a9a07=a39_0x4a9a();let _0x151aab=_0x4a9a07[_0x40b379];return _0x151aab;}async function fetchNpmDistTags(){const _0x21e79d=a39_0x59dd80;try{const _0x537c01=await fetch(_0x21e79d(0xd5)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x21e79d(0x9d),{'signal':AbortSignal[_0x21e79d(0xbf)](0x2710)});if(!_0x537c01['ok'])return null;const _0x217150=await _0x537c01['json']();if(!_0x217150||typeof _0x217150!==_0x21e79d(0xc3))return null;return Object[_0x21e79d(0xa2)](Object[_0x21e79d(0xb1)](_0x217150)[_0x21e79d(0xa5)](([,_0x51f1a8])=>typeof _0x51f1a8==='string'&&_0x51f1a8[_0x21e79d(0x9c)]()[_0x21e79d(0xc7)]>0x0)['map'](([_0x3dd67f,_0x292c0b])=>[_0x3dd67f,String(_0x292c0b)[_0x21e79d(0x9c)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0xfaa59e){const _0x56e6e0=await fetchNpmDistTags();return _0x56e6e0?.[_0xfaa59e]??null;}async function fetchLatestVersion(){const _0x11593f=a39_0x59dd80;return fetchNpmDistTagVersion(_0x11593f(0xa0));}async function resolveTargetVersion(_0x406135){const _0x21532e=a39_0x59dd80,_0x1faff0=getRequestedVersion(_0x406135);if(_0x1faff0)return{'version':_0x1faff0,'source':_0x21532e(0x91)};if(_0x406135['bool'](_0x21532e(0x90))){const _0x428c49=await fetchNpmDistTagVersion(_0x21532e(0x90));if(!_0x428c49)return null;return{'version':_0x428c49,'source':'beta'};}const _0x434c30=await fetchLatestVersion();if(!_0x434c30)return null;return{'version':_0x434c30,'source':_0x21532e(0xa0)};}function shouldInstallTarget(_0x20a3a7,_0x13d372){const _0x5503fa=a39_0x59dd80;if(_0x13d372[_0x5503fa(0xb3)]===_0x5503fa(0x91)||_0x13d372[_0x5503fa(0xb3)]==='beta')return!a39_0x4855a9['eq'](_0x20a3a7,_0x13d372[_0x5503fa(0x91)]);return a39_0x4855a9['lt'](_0x20a3a7,_0x13d372[_0x5503fa(0x91)]);}function getInstallPlanLabel(_0x388d15,_0x22e767){const _0x41fb88=a39_0x59dd80;switch(_0x22e767[_0x41fb88(0xb3)]){case _0x41fb88(0x90):return'Beta\x20version:\x20'+a39_0x3da42f['yellow'](_0x388d15)+_0x41fb88(0xa6)+a39_0x3da42f[_0x41fb88(0xb8)](_0x22e767['version']);case _0x41fb88(0x91):return _0x41fb88(0xcf)+a39_0x3da42f[_0x41fb88(0xb7)](_0x388d15)+_0x41fb88(0xa6)+a39_0x3da42f[_0x41fb88(0xb8)](_0x22e767['version']);case _0x41fb88(0xa0):default:return _0x41fb88(0xd0)+a39_0x3da42f[_0x41fb88(0xb7)](_0x388d15)+_0x41fb88(0xa6)+a39_0x3da42f['green'](_0x22e767[_0x41fb88(0x91)]);}}function repairCurrentBuiltinSkill(){const _0x163390=a39_0x59dd80;console[_0x163390(0xdd)](a39_0x3da42f['gray']('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x4b9e7e=installBuiltinSkill();if(_0x4b9e7e['ok'])return console[_0x163390(0xdd)](a39_0x3da42f[_0x163390(0xb2)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x4b9e7e['skillVersion']+'\x20is\x20up\x20to\x20date.')),!![];return console[_0x163390(0xbe)](a39_0x3da42f['yellow'](_0x163390(0xd3)+_0x4b9e7e[_0x163390(0xdb)]+_0x163390(0xc5)+(_0x4b9e7e['error']||'unknown'))),console['log'](a39_0x3da42f[_0x163390(0xb2)]('\x20\x20Run\x20manually:\x20'+CLI_BIN_NAME+_0x163390(0xb4))),![];}function verifyUpdatedBuiltinSkill(_0x3fb392){const _0xbf67d6=a39_0x59dd80,_0x15eace=inspectInstalledBuiltinSkillVersion(_0x3fb392);if(_0x15eace[_0xbf67d6(0x92)]===_0xbf67d6(0x99))return console['log'](a39_0x3da42f[_0xbf67d6(0xb2)](_0xbf67d6(0xda)+_0x3fb392+'\x20is\x20up\x20to\x20date.')),!![];const _0x1a2ba6=_0x15eace[_0xbf67d6(0xcc)]?_0xbf67d6(0xa7)+_0x3fb392+_0xbf67d6(0xcb)+_0x15eace[_0xbf67d6(0xcc)]:_0xbf67d6(0xa7)+_0x3fb392+_0xbf67d6(0xdf)+_0x15eace['state'];return console[_0xbf67d6(0xbe)](a39_0x3da42f['yellow']('\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20'+_0x1a2ba6)),console['log'](a39_0x3da42f[_0xbf67d6(0xb2)]('\x20\x20Run\x20manually:\x20'+_0x15eace['repairCommand'])),![];}async function execute(_0x36b8bc){const _0x214ba5=a39_0x59dd80;await validateUpdateFlags(_0x36b8bc);const _0x1a4d55=getCurrentVersion();console[_0x214ba5(0xdd)](_0x214ba5(0x95)+_0x1a4d55);const _0x5c346a=a39_0x24b1d7('Checking\x20for\x20updates...')[_0x214ba5(0xaa)](),_0xd25dde=await resolveTargetVersion(_0x36b8bc);if(!_0xd25dde){const _0x46aa0c=_0x36b8bc[_0x214ba5(0xe0)](_0x214ba5(0x90))?_0x214ba5(0xbb):'Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)';return _0x5c346a['fail'](_0x46aa0c),console['log'](a39_0x3da42f['gray'](_0x214ba5(0xc6)+NPM_PACKAGE_NAME+_0x214ba5(0xb6))),{'ok':![],'message':_0x46aa0c};}const _0x3566e4=a39_0x4855a9[_0x214ba5(0xc8)](VERSION),_0xc6917a=a39_0x4855a9[_0x214ba5(0xc8)](_0xd25dde[_0x214ba5(0x91)]);if(!_0x3566e4||!_0xc6917a)return _0x5c346a[_0x214ba5(0xac)](_0x214ba5(0x94)),{'ok':![],'message':_0x214ba5(0x94)};if(!shouldInstallTarget(_0x3566e4,_0xd25dde)){const _0x33069a=_0xd25dde[_0x214ba5(0xb3)]===_0x214ba5(0x91)?_0x214ba5(0xaf)+_0xd25dde[_0x214ba5(0x91)]+')':_0x214ba5(0xcd)+_0xd25dde[_0x214ba5(0x91)]+')';return _0x5c346a[_0x214ba5(0x9a)](_0x33069a),{'ok':repairCurrentBuiltinSkill()};}_0x5c346a[_0x214ba5(0xba)](getInstallPlanLabel(_0x1a4d55,_0xd25dde));const _0x3c602d=detectPackageManager(),_0x5c55c2=_0x3c602d===_0x214ba5(0xab)?resolveNpmBin(_0x214ba5(0xab)):_0x3c602d,_0x15293c=a39_0x24b1d7('Updating\x20via\x20'+_0x3c602d+'...')[_0x214ba5(0xaa)]();try{return await execa(_0x5c55c2,[_0x214ba5(0xd9),'-g',NPM_PACKAGE_NAME+'@'+_0xd25dde['version']],{'stdio':'pipe'}),_0x15293c[_0x214ba5(0x9a)](_0x214ba5(0xd4)+_0xd25dde['version']),console[_0x214ba5(0xdd)](a39_0x3da42f[_0x214ba5(0xb2)](_0x214ba5(0x96))),{'ok':verifyUpdatedBuiltinSkill(_0xd25dde[_0x214ba5(0x91)])};}catch(_0x51d555){return _0x15293c[_0x214ba5(0xac)](_0x214ba5(0xd7)),console[_0x214ba5(0x98)](a39_0x3da42f[_0x214ba5(0xc2)]('\x20\x20'+_0x51d555[_0x214ba5(0xd2)])),console[_0x214ba5(0xdd)](a39_0x3da42f[_0x214ba5(0xb2)]('\x20\x20Try\x20manually:\x20'+_0x3c602d+_0x214ba5(0xbd)+NPM_PACKAGE_NAME+'@'+_0xd25dde[_0x214ba5(0x91)])),{'ok':![],'message':_0x51d555[_0x214ba5(0xd2)]};}}export const updateDefinition={'service':a39_0x59dd80(0x9e),'command':a39_0x59dd80(0x9b),'description':a39_0x59dd80(0xc1),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a39_0x291600=a39_0x2482;(function(_0x516339,_0xeed09a){const _0x49e9e0=a39_0x2482,_0x2af6e1=_0x516339();while(!![]){try{const _0x10c466=parseInt(_0x49e9e0(0xf6))/0x1+parseInt(_0x49e9e0(0x101))/0x2*(parseInt(_0x49e9e0(0xfa))/0x3)+parseInt(_0x49e9e0(0x134))/0x4*(-parseInt(_0x49e9e0(0xf4))/0x5)+-parseInt(_0x49e9e0(0x118))/0x6*(parseInt(_0x49e9e0(0x110))/0x7)+-parseInt(_0x49e9e0(0x120))/0x8*(-parseInt(_0x49e9e0(0x119))/0x9)+parseInt(_0x49e9e0(0x12e))/0xa+-parseInt(_0x49e9e0(0x132))/0xb*(-parseInt(_0x49e9e0(0x128))/0xc);if(_0x10c466===_0xeed09a)break;else _0x2af6e1['push'](_0x2af6e1['shift']());}catch(_0x35d9e7){_0x2af6e1['push'](_0x2af6e1['shift']());}}}(a39_0x174b,0xc569c));import a39_0x476f8e from'chalk';import a39_0xc794ce from'ora';import a39_0x2063e1 from'semver';import{execa}from'execa';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{inspectInstalledBuiltinSkillVersion,installBuiltinSkill}from'../skills/builtin-skill.js';import{resolveNpmBin}from'../utils/platform.js';function a39_0x2482(_0x2f47b6,_0xd99660){_0x2f47b6=_0x2f47b6-0xe1;const _0x174b0d=a39_0x174b();let _0x2482f0=_0x174b0d[_0x2f47b6];return _0x2482f0;}function getCurrentVersion(){const _0x11195a=a39_0x2482;return GIT_COMMIT!==_0x11195a(0x11c)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x11195a(0x124)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x359e6f=a39_0x2482,_0x3863e0=process[_0x359e6f(0x106)]['toLowerCase']();if(_0x3863e0[_0x359e6f(0x11f)](_0x359e6f(0xe2)))return _0x359e6f(0xe2);return _0x359e6f(0xf5);}const updateFlags=[{'name':a39_0x291600(0xfc),'type':'boolean','description':a39_0x291600(0xe6),'default':![]},{'name':a39_0x291600(0x117),'type':a39_0x291600(0xe7),'description':a39_0x291600(0xec)}];function getRequestedVersion(_0x243e25){const _0x5ff4da=a39_0x291600;return _0x243e25[_0x5ff4da(0x111)](_0x5ff4da(0x117))[_0x5ff4da(0x100)]();}async function validateUpdateFlags(_0x103e35){const _0x295eff=a39_0x291600,_0x5cd30a=_0x103e35[_0x295eff(0xf9)](_0x295eff(0xfc)),_0x58697b=getRequestedVersion(_0x103e35);if(_0x5cd30a&&_0x58697b)throw CliErrors[_0x295eff(0x121)](_0x295eff(0x12c),_0x295eff(0x116));if(_0x58697b&&!a39_0x2063e1[_0x295eff(0x11e)](_0x58697b))throw CliErrors[_0x295eff(0x121)](_0x295eff(0x10f)+_0x58697b,_0x295eff(0x131));}async function fetchNpmDistTags(){const _0x2511a6=a39_0x291600;try{const _0x92dc01=await fetch(_0x2511a6(0x105)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x2511a6(0xfb),{'signal':AbortSignal[_0x2511a6(0xf7)](0x2710)});if(!_0x92dc01['ok'])return null;const _0x3d4729=await _0x92dc01['json']();if(!_0x3d4729||typeof _0x3d4729!==_0x2511a6(0x102))return null;return Object[_0x2511a6(0xe4)](Object['entries'](_0x3d4729)[_0x2511a6(0x107)](([,_0x4039df])=>typeof _0x4039df==='string'&&_0x4039df[_0x2511a6(0x100)]()[_0x2511a6(0xf1)]>0x0)[_0x2511a6(0x12a)](([_0x3cb587,_0x547ccb])=>[_0x3cb587,String(_0x547ccb)[_0x2511a6(0x100)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x38e6c5){const _0x57d458=await fetchNpmDistTags();return _0x57d458?.[_0x38e6c5]??null;}async function fetchLatestVersion(){const _0x7457aa=a39_0x291600;return fetchNpmDistTagVersion(_0x7457aa(0x114));}async function resolveTargetVersion(_0x3c5683){const _0x440c38=a39_0x291600,_0x485cae=getRequestedVersion(_0x3c5683);if(_0x485cae)return{'version':_0x485cae,'source':_0x440c38(0x117)};if(_0x3c5683[_0x440c38(0xf9)](_0x440c38(0xfc))){const _0x436a7c=await fetchNpmDistTagVersion('beta');if(!_0x436a7c)return null;return{'version':_0x436a7c,'source':_0x440c38(0xfc)};}const _0x3c5004=await fetchLatestVersion();if(!_0x3c5004)return null;return{'version':_0x3c5004,'source':_0x440c38(0x114)};}function shouldInstallTarget(_0x1206f8,_0x40d7fe){const _0x5cd999=a39_0x291600;if(_0x40d7fe[_0x5cd999(0x122)]==='version'||_0x40d7fe[_0x5cd999(0x122)]===_0x5cd999(0xfc))return!a39_0x2063e1['eq'](_0x1206f8,_0x40d7fe['version']);return a39_0x2063e1['lt'](_0x1206f8,_0x40d7fe[_0x5cd999(0x117)]);}function getInstallPlanLabel(_0x212982,_0xd86ea7){const _0x14da00=a39_0x291600;switch(_0xd86ea7['source']){case _0x14da00(0xfc):return _0x14da00(0xff)+a39_0x476f8e[_0x14da00(0xe5)](_0x212982)+_0x14da00(0x112)+a39_0x476f8e[_0x14da00(0x10c)](_0xd86ea7[_0x14da00(0x117)]);case _0x14da00(0x117):return'Requested\x20version:\x20'+a39_0x476f8e[_0x14da00(0xe5)](_0x212982)+_0x14da00(0x112)+a39_0x476f8e['green'](_0xd86ea7[_0x14da00(0x117)]);case _0x14da00(0x114):default:return _0x14da00(0xe8)+a39_0x476f8e['yellow'](_0x212982)+_0x14da00(0x112)+a39_0x476f8e[_0x14da00(0x10c)](_0xd86ea7[_0x14da00(0x117)]);}}function repairCurrentBuiltinSkill(){const _0x31eea6=a39_0x291600;console['log'](a39_0x476f8e[_0x31eea6(0xef)]('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x5456f5=installBuiltinSkill();if(_0x5456f5['ok'])return console[_0x31eea6(0x12d)](a39_0x476f8e[_0x31eea6(0xef)](_0x31eea6(0xe3)+_0x5456f5[_0x31eea6(0xe9)]+_0x31eea6(0x127))),!![];return console[_0x31eea6(0xee)](a39_0x476f8e[_0x31eea6(0xe5)](_0x31eea6(0xf3)+_0x5456f5[_0x31eea6(0x103)]+_0x31eea6(0xfd)+(_0x5456f5[_0x31eea6(0x108)]||_0x31eea6(0x11c)))),console[_0x31eea6(0x12d)](a39_0x476f8e[_0x31eea6(0xef)]('\x20\x20Run\x20manually:\x20'+CLI_BIN_NAME+'\x20cli-skill\x20install')),![];}function verifyUpdatedBuiltinSkill(_0x3c9ee9){const _0x17aa6b=a39_0x291600,_0x152150=inspectInstalledBuiltinSkillVersion(_0x3c9ee9);if(_0x152150['state']===_0x17aa6b(0xeb))return console[_0x17aa6b(0x12d)](a39_0x476f8e[_0x17aa6b(0xef)](_0x17aa6b(0xe3)+_0x3c9ee9+'\x20is\x20up\x20to\x20date.')),!![];const _0x3b3c3b=_0x152150[_0x17aa6b(0xe9)]?_0x17aa6b(0xed)+_0x3c9ee9+_0x17aa6b(0x115)+_0x152150[_0x17aa6b(0xe9)]:_0x17aa6b(0xed)+_0x3c9ee9+',\x20state\x20'+_0x152150[_0x17aa6b(0xf2)];return console[_0x17aa6b(0xee)](a39_0x476f8e[_0x17aa6b(0xe5)](_0x17aa6b(0x11b)+_0x3b3c3b)),console[_0x17aa6b(0x12d)](a39_0x476f8e[_0x17aa6b(0xef)](_0x17aa6b(0x11a)+_0x152150[_0x17aa6b(0x104)])),![];}function a39_0x174b(){const _0x2996d4=['\x20→\x20','message','latest',',\x20found\x20','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','version','4962AKSjBm','97857ohVUSD','\x20\x20Run\x20manually:\x20','\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20','unknown','\x20\x20Try\x20manually:\x20','valid','includes','472fJTuRR','validation','source','Updating\x20via\x20','slice','install','Already\x20on\x20requested\x20version\x20(v','\x20is\x20up\x20to\x20date.','12wtLpJZ','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','map','Version\x20comparison\x20failed','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','log','7284070wumisD','red','update','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','2947538YprKvQ','succeed','192044hIxzzM','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','start','bun','\x20\x20CLI\x20Built-in\x20Skill\x20','fromEntries','yellow','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','string','Update\x20available:\x20','skillVersion','Updated\x20to\x20v','current','Install\x20a\x20specific\x20CLI\x20version','expected\x20','warn','gray','pipe','length','state','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','65bmBSgP','npm','96249nyyOKJ','timeout','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','bool','239091qhUHzX','/dist-tags','beta',']:\x20','read','Beta\x20version:\x20','trim','14mkTUCY','object','code','repairCommand','https://registry.npmjs.org/-/package/','execPath','filter','error','Checking\x20for\x20updates...','...','fail','green','Already\x20up\x20to\x20date\x20(v','Current\x20version:\x20','Invalid\x20version:\x20','7273LRjRyi','str'];a39_0x174b=function(){return _0x2996d4;};return a39_0x174b();}async function execute(_0x37576d){const _0xc16c8d=a39_0x291600;await validateUpdateFlags(_0x37576d);const _0x12761f=getCurrentVersion();console[_0xc16c8d(0x12d)](_0xc16c8d(0x10e)+_0x12761f);const _0x929966=a39_0xc794ce(_0xc16c8d(0x109))[_0xc16c8d(0xe1)](),_0x45812a=await resolveTargetVersion(_0x37576d);if(!_0x45812a){const _0x3dd865=_0x37576d[_0xc16c8d(0xf9)](_0xc16c8d(0xfc))?_0xc16c8d(0x129):_0xc16c8d(0xf8);return _0x929966['fail'](_0x3dd865),console[_0xc16c8d(0x12d)](a39_0x476f8e[_0xc16c8d(0xef)]('\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x3dd865};}const _0x3feb55=a39_0x2063e1['valid'](VERSION),_0x36974c=a39_0x2063e1[_0xc16c8d(0x11e)](_0x45812a[_0xc16c8d(0x117)]);if(!_0x3feb55||!_0x36974c)return _0x929966[_0xc16c8d(0x10b)](_0xc16c8d(0x12b)),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0x3feb55,_0x45812a)){const _0x4eec3b=_0x45812a[_0xc16c8d(0x122)]===_0xc16c8d(0x117)?_0xc16c8d(0x126)+_0x45812a[_0xc16c8d(0x117)]+')':_0xc16c8d(0x10d)+_0x45812a[_0xc16c8d(0x117)]+')';return _0x929966[_0xc16c8d(0x133)](_0x4eec3b),{'ok':repairCurrentBuiltinSkill()};}_0x929966['info'](getInstallPlanLabel(_0x12761f,_0x45812a));const _0x4ab48b=detectPackageManager(),_0xa67f35=_0x4ab48b===_0xc16c8d(0xf5)?resolveNpmBin(_0xc16c8d(0xf5)):_0x4ab48b,_0x3b06ce=a39_0xc794ce(_0xc16c8d(0x123)+_0x4ab48b+_0xc16c8d(0x10a))[_0xc16c8d(0xe1)]();try{return await execa(_0xa67f35,[_0xc16c8d(0x125),'-g',NPM_PACKAGE_NAME+'@'+_0x45812a[_0xc16c8d(0x117)]],{'stdio':_0xc16c8d(0xf0)}),_0x3b06ce[_0xc16c8d(0x133)](_0xc16c8d(0xea)+_0x45812a[_0xc16c8d(0x117)]),console[_0xc16c8d(0x12d)](a39_0x476f8e[_0xc16c8d(0xef)](_0xc16c8d(0x135))),{'ok':verifyUpdatedBuiltinSkill(_0x45812a[_0xc16c8d(0x117)])};}catch(_0x25cc0a){return _0x3b06ce[_0xc16c8d(0x10b)]('Update\x20failed'),console[_0xc16c8d(0x108)](a39_0x476f8e[_0xc16c8d(0x12f)]('\x20\x20'+_0x25cc0a['message'])),console[_0xc16c8d(0x12d)](a39_0x476f8e[_0xc16c8d(0xef)](_0xc16c8d(0x11d)+_0x4ab48b+'\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@'+_0x45812a[_0xc16c8d(0x117)])),{'ok':![],'message':_0x25cc0a[_0xc16c8d(0x113)]};}}export const updateDefinition={'service':a39_0x291600(0x130),'command':'run','description':'Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','risk':a39_0x291600(0xfe),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a40_0xf922(){const _0x4fdf1a=['218685kyKhxR','213Yrnkrc','115920ClkbQk','688496XKcPRP','7484gYsvGT','1044048CUzDgI','113686WxTMCr','286254DGpTMX'];a40_0xf922=function(){return _0x4fdf1a;};return a40_0xf922();}(function(_0x3c2409,_0x4fa803){const _0x309472=a40_0x15b2,_0x4897bd=_0x3c2409();while(!![]){try{const _0x3da0a8=parseInt(_0x309472(0x186))/0x1+-parseInt(_0x309472(0x187))/0x2+parseInt(_0x309472(0x189))/0x3*(-parseInt(_0x309472(0x184))/0x4)+parseInt(_0x309472(0x188))/0x5+parseInt(_0x309472(0x185))/0x6+-parseInt(_0x309472(0x18a))/0x7+parseInt(_0x309472(0x18b))/0x8;if(_0x3da0a8===_0x4fa803)break;else _0x4897bd['push'](_0x4897bd['shift']());}catch(_0x17bea5){_0x4897bd['push'](_0x4897bd['shift']());}}}(a40_0xf922,0x1e825));import{codegenSdk}from'../../commands/codegen/sdk.js';function a40_0x15b2(_0x335297,_0x16ee1f){_0x335297=_0x335297-0x184;const _0xf922ab=a40_0xf922();let _0x15b25f=_0xf922ab[_0x335297];return _0x15b25f;}import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a41_0x3bdc63=a41_0x13bf;(function(_0x155311,_0xe5e3df){const _0x381ad9=a41_0x13bf,_0x19eb2e=_0x155311();while(!![]){try{const _0x4dfe67=-parseInt(_0x381ad9(0x1a4))/0x1*(parseInt(_0x381ad9(0x1a8))/0x2)+-parseInt(_0x381ad9(0x195))/0x3+-parseInt(_0x381ad9(0x194))/0x4+-parseInt(_0x381ad9(0x190))/0x5*(-parseInt(_0x381ad9(0x1a5))/0x6)+parseInt(_0x381ad9(0x193))/0x7*(parseInt(_0x381ad9(0x1a2))/0x8)+parseInt(_0x381ad9(0x1a3))/0x9+parseInt(_0x381ad9(0x197))/0xa;if(_0x4dfe67===_0xe5e3df)break;else _0x19eb2e['push'](_0x19eb2e['shift']());}catch(_0x599752){_0x19eb2e['push'](_0x19eb2e['shift']());}}}(a41_0x49d6,0xc0c07));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';function a41_0x49d6(){const _0x8f6a87=['3903486edabdP','bool','boolean','2rHEfiJ','str','sdk','5hJJUfZ','string','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','411103UPYQbO','5871148CoXNEX','691389VjTbDU','operation','7352560iXKHGZ','code','tableName','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','alias','Omit\x20import\x20statements\x20from\x20generated\x20code','read','codegen','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','appCode','name','208aSOfmU','6392088VnxyDz','1135262wsFERt'];a41_0x49d6=function(){return _0x8f6a87;};return a41_0x49d6();}function a41_0x13bf(_0x31745e,_0x804b67){_0x31745e=_0x31745e-0x190;const _0x49d6f8=a41_0x49d6();let _0x13bfed=_0x49d6f8[_0x31745e];return _0x13bfed;}import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':a41_0x3bdc63(0x19e),'command':a41_0x3bdc63(0x1aa),'description':a41_0x3bdc63(0x19a),'risk':a41_0x3bdc63(0x19d),'flags':[CODE_FLAG_OPTIONAL,{'name':a41_0x3bdc63(0x19b),'type':a41_0x3bdc63(0x191),'description':a41_0x3bdc63(0x192)},{'name':a41_0x3bdc63(0x196),'type':a41_0x3bdc63(0x191),'required':!![],'description':a41_0x3bdc63(0x19f)},{'name':'skip-imports','type':a41_0x3bdc63(0x1a7),'description':a41_0x3bdc63(0x19c)}],async 'execute'(_0x81ac17){const _0x362b18=a41_0x3bdc63,{dataset:_0x925345,operation:_0x2040ee}=await getOperationDetail(_0x81ac17[_0x362b18(0x1a0)],_0x81ac17[_0x362b18(0x1a9)]('code'),_0x81ac17['str'](_0x362b18(0x196))),_0x2521fe=generateSdkCode(_0x925345,_0x2040ee,{'includeImports':!_0x81ac17[_0x362b18(0x1a6)]('skip-imports')});return{'ok':!![],'data':{'dataset':{'name':_0x925345[_0x362b18(0x1a1)],'code':_0x925345[_0x362b18(0x198)],'tableName':_0x925345[_0x362b18(0x199)]},'operation':_0x81ac17[_0x362b18(0x1a9)](_0x362b18(0x196)),'code':_0x2521fe}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a42_0x492a(_0x1e885e,_0xfc0e82){_0x1e885e=_0x1e885e-0x111;const _0x582379=a42_0x5823();let _0x492a3b=_0x582379[_0x1e885e];return _0x492a3b;}function a42_0x5823(){const _0xb655bc=['Omit\x20import\x20statements\x20from\x20generated\x20code','12QIyePA','bff','3365397RPuDoV','sqlName','sql','bool','str','172417IqsPZH','read','target','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','string','sqlCode','452118ohJScG','no-imports','5965765OPuaPl','8ZYJuIn','898497XGiYJm','12234590cmMHIs','sdk','codegen','102561fvxeyL','appCode','54NqXxdo'];a42_0x5823=function(){return _0xb655bc;};return a42_0x5823();}const a42_0x18d7ce=a42_0x492a;(function(_0x3cde3e,_0x47cae7){const _0x5dd5a9=a42_0x492a,_0xb9766c=_0x3cde3e();while(!![]){try{const _0x15753c=-parseInt(_0x5dd5a9(0x121))/0x1+-parseInt(_0x5dd5a9(0x119))/0x2+-parseInt(_0x5dd5a9(0x11d))/0x3*(-parseInt(_0x5dd5a9(0x125))/0x4)+parseInt(_0x5dd5a9(0x11b))/0x5+-parseInt(_0x5dd5a9(0x123))/0x6*(parseInt(_0x5dd5a9(0x112))/0x7)+parseInt(_0x5dd5a9(0x11c))/0x8*(parseInt(_0x5dd5a9(0x127))/0x9)+-parseInt(_0x5dd5a9(0x11e))/0xa;if(_0x15753c===_0x47cae7)break;else _0xb9766c['push'](_0xb9766c['shift']());}catch(_0x2e6b6b){_0xb9766c['push'](_0xb9766c['shift']());}}}(a42_0x5823,0xa8e71));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':a42_0x18d7ce(0x120),'command':a42_0x18d7ce(0x129),'description':a42_0x18d7ce(0x116),'risk':a42_0x18d7ce(0x113),'flags':[SQLCODE_FLAG,{'name':a42_0x18d7ce(0x114),'type':a42_0x18d7ce(0x117),'description':a42_0x18d7ce(0x115),'default':a42_0x18d7ce(0x11f),'enum':[a42_0x18d7ce(0x11f),a42_0x18d7ce(0x126)]},{'name':a42_0x18d7ce(0x11a),'type':'boolean','description':a42_0x18d7ce(0x124)}],async 'execute'(_0x5a5ad5){const _0x172d44=a42_0x18d7ce,_0x4d2b50=await getSqlQueryInfo(_0x5a5ad5[_0x172d44(0x122)],_0x5a5ad5['str']('sqlcode')),_0x254eee=_0x5a5ad5[_0x172d44(0x111)](_0x172d44(0x114))||_0x172d44(0x11f),_0x4068d0=generateSqlCodeTemplate(_0x4d2b50,{'target':_0x254eee,'includeImports':!_0x5a5ad5[_0x172d44(0x12a)](_0x172d44(0x11a))});return{'ok':!![],'data':{'sqlCode':_0x4d2b50[_0x172d44(0x118)],'sqlName':_0x4d2b50[_0x172d44(0x128)],'target':_0x254eee,'code':_0x4068d0}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3bccd3,_0x151ebc){const _0x831856=a43_0x45e0,_0x4820b1=_0x3bccd3();while(!![]){try{const _0x55eca4=-parseInt(_0x831856(0x76))/0x1*(-parseInt(_0x831856(0x7b))/0x2)+-parseInt(_0x831856(0x90))/0x3+parseInt(_0x831856(0x8b))/0x4*(-parseInt(_0x831856(0x9d))/0x5)+parseInt(_0x831856(0x9c))/0x6+parseInt(_0x831856(0x95))/0x7*(parseInt(_0x831856(0x7f))/0x8)+-parseInt(_0x831856(0x81))/0x9*(-parseInt(_0x831856(0x9e))/0xa)+-parseInt(_0x831856(0x77))/0xb*(parseInt(_0x831856(0x7a))/0xc);if(_0x55eca4===_0x151ebc)break;else _0x4820b1['push'](_0x4820b1['shift']());}catch(_0x72172){_0x4820b1['push'](_0x4820b1['shift']());}}}(a43_0xb081,0x8c930));function a43_0xb081(){const _0x45ccd6=['object','Missing\x20app\x20name.','flagMissing','trim','projectConfig','6727536LahrAc','597590SZHwDx','2290TkyZec','App\x20code','defaultApp','validation','2ylqwFV','13931577CyVlny','\x20<name>\x20--appcode\x20<code>','global','12UGDYLv','439834wokHSi','globalConfig','appcode','length','6070032MEQnqs','str','19692NJDLrr','project','\x20Default\x20app\x20changed\x20to\x20\x22','string','args','keys','Updated','\x20Note:\x20app\x20\x22','\x22\x20not\x20found.','\x20<name>\x20[--global]','8iEBoYz','boolean','\x20app\x20\x22','\x20config.','Usage:\x20','2218683jjRChe','App\x20\x22','both','Use\x20global\x20config\x20scope','inherit','7mxCFeJ','apps'];a43_0xb081=function(){return _0x45ccd6;};return a43_0xb081();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{collectAppProfileOverrides,getAppProfileFlagDefs}from'../../config/schema.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';export function buildAppAddFlags(){const _0x53961c=a43_0x45e0;return[{'name':'appcode','type':_0x53961c(0x84),'description':_0x53961c(0x73),'required':!![]},{'name':_0x53961c(0x79),'type':_0x53961c(0x8c),'description':_0x53961c(0x93),'default':![]},...getAppProfileFlagDefs()];}export function buildAppRemoveFlags(){const _0x23bdc4=a43_0x45e0;return[{'name':_0x23bdc4(0x79),'type':_0x23bdc4(0x8c),'description':_0x23bdc4(0x93),'default':![]}];}export async function validateAppName(_0x36876f,_0x1e26ce){const _0x175f3a=a43_0x45e0,_0x2b42c9=_0x36876f[_0x175f3a(0x85)][0x0]?.['trim']();if(!_0x2b42c9)throw CliErrors[_0x175f3a(0x75)](_0x175f3a(0x98),_0x175f3a(0x8f)+CLI_BIN_NAME+'\x20'+_0x1e26ce+'\x20<name>');}function a43_0x45e0(_0x5fd451,_0x2419cb){_0x5fd451=_0x5fd451-0x73;const _0xb08166=a43_0xb081();let _0x45e0d0=_0xb08166[_0x5fd451];return _0x45e0d0;}export async function runAppAdd(_0x26195f,_0x2b7b1b){const _0x5744a8=a43_0x45e0,_0x45cace=_0x26195f[_0x5744a8(0x85)][0x0]?.[_0x5744a8(0x9a)]();if(!_0x45cace)throw CliErrors['validation'](_0x5744a8(0x98),_0x5744a8(0x8f)+CLI_BIN_NAME+'\x20'+_0x2b7b1b+_0x5744a8(0x78));const _0xdb1115=_0x26195f['str'](_0x5744a8(0x7d));if(!_0xdb1115)throw CliErrors[_0x5744a8(0x99)]('appcode',_0x5744a8(0x8f)+CLI_BIN_NAME+'\x20'+_0x2b7b1b+'\x20<name>\x20--appcode\x20<code>');const _0x5316b0={'global':_0x26195f['bool'](_0x5744a8(0x79))},_0x2a51ba=readConfig(_0x5316b0);if(!_0x2a51ba['apps'])_0x2a51ba[_0x5744a8(0x96)]={};const _0x406ec6={'appcode':_0xdb1115,...collectAppProfileOverrides(_0x1e81cc=>_0x26195f[_0x5744a8(0x80)](_0x1e81cc))},_0x185ece=_0x2a51ba['apps'],_0x536a1e=!!_0x185ece[_0x45cace];_0x185ece[_0x45cace]=_0x406ec6;if(!_0x2a51ba[_0x5744a8(0x74)])_0x2a51ba['defaultApp']=_0x45cace;writeConfig(_0x2a51ba,_0x5316b0);const _0x2dee65=!_0x536a1e&&_0x2a51ba[_0x5744a8(0x74)]===_0x45cace?'\x20Set\x20as\x20default\x20app.':'',_0x20aea9=(_0x536a1e?_0x5744a8(0x87):'Added')+_0x5744a8(0x8d)+_0x45cace+'\x22\x20(appcode:\x20'+_0xdb1115+')'+scopeLabel(_0x5316b0)+'.'+_0x2dee65;return{'ok':!![],'message':_0x20aea9};}export async function runAppRemove(_0x5b7bbe,_0x3291a5){const _0x2671d2=a43_0x45e0,_0x4303e4=_0x5b7bbe['args'][0x0]?.[_0x2671d2(0x9a)]();if(!_0x4303e4)throw CliErrors[_0x2671d2(0x75)](_0x2671d2(0x98),_0x2671d2(0x8f)+CLI_BIN_NAME+'\x20'+_0x3291a5+_0x2671d2(0x8a));const _0x20336b=_0x5b7bbe['bool'](_0x2671d2(0x79)),{config:_0x414e1e,layers:_0x5a061e}=readRawConfigWithLayers(),_0x427eaa=_0x414e1e[_0x2671d2(0x96)]??{};if(!_0x427eaa[_0x4303e4])throw CliErrors[_0x2671d2(0x75)](_0x2671d2(0x91)+_0x4303e4+_0x2671d2(0x89));const _0x445ce8=_0x5a061e[_0x2671d2(0x7c)][_0x2671d2(0x96)]&&typeof _0x5a061e[_0x2671d2(0x7c)][_0x2671d2(0x96)]===_0x2671d2(0x97)?_0x5a061e[_0x2671d2(0x7c)][_0x2671d2(0x96)]:{},_0x2c3ee0=_0x5a061e['projectConfig'][_0x2671d2(0x96)]&&typeof _0x5a061e[_0x2671d2(0x9b)][_0x2671d2(0x96)]==='object'?_0x5a061e[_0x2671d2(0x9b)][_0x2671d2(0x96)]:{},_0x468a10=appDefinedIn(_0x4303e4,_0x445ce8,_0x2c3ee0,_0x5a061e['projectConfig'][_0x2671d2(0x94)]===![]),_0x4280d0=resolveAppScopeForWrite(_0x4303e4,_0x20336b,_0x5a061e),_0x55a2ac={'global':_0x4280d0==='global'},_0x3c6012=readConfig(_0x55a2ac),_0x45b50c=_0x3c6012['apps'];if(!_0x45b50c||!_0x45b50c[_0x4303e4])throw CliErrors[_0x2671d2(0x75)](_0x2671d2(0x91)+_0x4303e4+_0x2671d2(0x89));delete _0x45b50c[_0x4303e4];let _0x5b9b4d='';if(_0x3c6012[_0x2671d2(0x74)]===_0x4303e4){const _0xe19847=Object[_0x2671d2(0x86)](_0x45b50c);_0x3c6012['defaultApp']=_0xe19847[_0x2671d2(0x7e)]>0x0?_0xe19847[0x0]:undefined,_0x3c6012['defaultApp']?_0x5b9b4d=_0x2671d2(0x83)+_0x3c6012[_0x2671d2(0x74)]+'\x22.':delete _0x3c6012[_0x2671d2(0x74)];}Object[_0x2671d2(0x86)](_0x45b50c)[_0x2671d2(0x7e)]===0x0&&(delete _0x3c6012[_0x2671d2(0x96)],delete _0x3c6012[_0x2671d2(0x74)]);writeConfig(_0x3c6012,_0x55a2ac);const _0x9d0f=_0x468a10===_0x2671d2(0x92)?_0x2671d2(0x88)+_0x4303e4+'\x22\x20still\x20defined\x20in\x20'+(_0x4280d0==='project'?_0x2671d2(0x79):_0x2671d2(0x82))+_0x2671d2(0x8e):'';return{'ok':!![],'message':'Removed\x20app\x20\x22'+_0x4303e4+'\x22'+scopeLabel(_0x55a2ac)+'.'+_0x5b9b4d+_0x9d0f};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a44_0x3bee(){const _0x15c2d5=['(未检测到登录态,请手动输入\x20App\x20Code\x20或直接跳过)','custom','2447718UrFSMG','2nEodnz','正在获取可用应用列表...','includes','✎\x20自定义输入\x20appcode','skip','gray','find','yellow','502209RJeenY','128814suHDOH','75668JIepvO','appName','cyan','App\x20Code:','Invalid\x20App\x20Code','message','\x0a无法获取远程应用列表,请手动输入。','16pyYteL','1327239fvujlP','12495300xwDRUe','valid','length','3104982aUZaeN','无法获取远程应用列表,请手动输入。','未找到可用应用。','\x20\x20(','map','appCode','120mMAtLE','\x20个应用,请选择\x20(空格勾选,\x20a=全选,\x20i=反选):'];a44_0x3bee=function(){return _0x15c2d5;};return a44_0x3bee();}(function(_0x95843f,_0x4faa6c){const _0x392fc9=a44_0x3598,_0x126387=_0x95843f();while(!![]){try{const _0x1c13f6=-parseInt(_0x392fc9(0x1ba))/0x1*(-parseInt(_0x392fc9(0x1c3))/0x2)+-parseInt(_0x392fc9(0x1c2))/0x3+-parseInt(_0x392fc9(0x1c4))/0x4*(parseInt(_0x392fc9(0x1b5))/0x5)+-parseInt(_0x392fc9(0x1d0))/0x6+parseInt(_0x392fc9(0x1b9))/0x7+-parseInt(_0x392fc9(0x1cb))/0x8*(parseInt(_0x392fc9(0x1cc))/0x9)+parseInt(_0x392fc9(0x1cd))/0xa;if(_0x1c13f6===_0x4faa6c)break;else _0x126387['push'](_0x126387['shift']());}catch(_0x19aeba){_0x126387['push'](_0x126387['shift']());}}}(a44_0x3bee,0x47d18));import{input,checkbox,select}from'@inquirer/prompts';import a44_0x3bfc94 from'chalk';import{validateAppcode}from'../../commands/common/validate.js';import{listRemoteApps}from'../../core/api-client.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';export async function promptCustomAppcode(){const _0x5c8630=await input({'message':'请输入\x20App\x20Code:','validate':_0x911034=>{const _0x19067d=a44_0x3598,_0x2c2f6c=validateAppcode(_0x911034['trim']());return _0x2c2f6c[_0x19067d(0x1ce)]||_0x2c2f6c['message']||_0x19067d(0x1c8);}});return _0x5c8630['trim']();}export async function promptAppSelection(_0x3353fb){const _0x5af71c=a44_0x3598,_0x506be4=[{'name':a44_0x3bfc94[_0x5af71c(0x1c1)]('✎\x20自定义输入\x20appcode'),'value':-0x1},..._0x3353fb[_0x5af71c(0x1b3)]((_0x3e1cc9,_0x4f539f)=>({'name':_0x3e1cc9['appName']+'\x20\x20'+a44_0x3bfc94[_0x5af71c(0x1bf)]('('+_0x3e1cc9[_0x5af71c(0x1b4)]+')'),'value':_0x4f539f}))],_0xdd7d8b=await checkbox({'message':'获取到\x20'+a44_0x3bfc94[_0x5af71c(0x1c6)](_0x3353fb['length'])+_0x5af71c(0x1b6),'choices':_0x506be4,'loop':![]});if(_0xdd7d8b[_0x5af71c(0x1bc)](-0x1))return _0x5af71c(0x1b8);if(_0xdd7d8b[_0x5af71c(0x1cf)]===0x0)return _0x5af71c(0x1b8);return _0xdd7d8b[_0x5af71c(0x1b3)](_0xf7163e=>_0x3353fb[_0xf7163e]);}export async function promptSingleAppSelection(_0x5a069f){const _0x3fbc88=a44_0x3598,_0x54d258=[{'name':a44_0x3bfc94[_0x3fbc88(0x1bf)]('(跳过,稍后通过\x20config\x20set\x20appcode\x20配置)'),'value':'skip'},{'name':a44_0x3bfc94[_0x3fbc88(0x1c1)](_0x3fbc88(0x1bd)),'value':_0x3fbc88(0x1b8)},..._0x5a069f[_0x3fbc88(0x1b3)](_0x6d2643=>({'name':_0x6d2643[_0x3fbc88(0x1c5)]+'\x20\x20'+a44_0x3bfc94[_0x3fbc88(0x1bf)]('('+_0x6d2643[_0x3fbc88(0x1b4)]+')'),'value':_0x6d2643[_0x3fbc88(0x1b4)]}))],_0x8d6861=await select({'message':'请选择要绑定的应用:','choices':_0x54d258});if(_0x8d6861===_0x3fbc88(0x1be))return _0x3fbc88(0x1be);if(_0x8d6861===_0x3fbc88(0x1b8))return _0x3fbc88(0x1b8);return _0x5a069f[_0x3fbc88(0x1c0)](_0x58499b=>_0x58499b[_0x3fbc88(0x1b4)]===_0x8d6861);}export async function selectSingleAppcode(_0x4b7db4){const _0x31896e=a44_0x3598;if(!_0x4b7db4)return writeCliSideChannelLine(a44_0x3bfc94[_0x31896e(0x1bf)](_0x31896e(0x1b7))),_fallbackOrSkip();writeCliSideChannelLine(_0x31896e(0x1bb));let _0x55a770;try{_0x55a770=await withActiveCookie(_0x4b7db4,()=>listRemoteApps());}catch(_0x268449){writeCliSideChannelLine(a44_0x3bfc94['yellow'](_0x31896e(0x1b0)));if(_0x268449 instanceof Error)writeCliSideChannelLine(a44_0x3bfc94['gray'](_0x31896e(0x1b2)+_0x268449[_0x31896e(0x1c9)]+')'));return _fallbackOrSkip();}if(_0x55a770[_0x31896e(0x1cf)]===0x0)return writeCliSideChannelLine(a44_0x3bfc94[_0x31896e(0x1c1)](_0x31896e(0x1b1))),_fallbackOrSkip();const _0x3725d2=await promptSingleAppSelection(_0x55a770);if(_0x3725d2===_0x31896e(0x1be))return'';if(_0x3725d2===_0x31896e(0x1b8))return promptCustomAppcode();return _0x3725d2['appCode'];}export async function selectMultipleApps(_0x50190f){const _0x46c2bf=a44_0x3598;writeCliSideChannelLine(_0x46c2bf(0x1bb));let _0x1cfa57;try{_0x1cfa57=await withActiveCookie(_0x50190f,()=>listRemoteApps());}catch(_0x576495){writeCliSideChannelLine(_0x46c2bf(0x1ca));if(_0x576495 instanceof Error)writeCliSideChannelLine('\x20\x20('+_0x576495[_0x46c2bf(0x1c9)]+')');return _0x46c2bf(0x1b8);}if(_0x1cfa57[_0x46c2bf(0x1cf)]===0x0)return writeCliSideChannelLine('\x0a未找到可用应用。'),_0x46c2bf(0x1b8);return promptAppSelection(_0x1cfa57);}function a44_0x3598(_0x3352e0,_0x84ea22){_0x3352e0=_0x3352e0-0x1b0;const _0x3bee37=a44_0x3bee();let _0x3598ce=_0x3bee37[_0x3352e0];return _0x3598ce;}async function _fallbackOrSkip(){const _0x9bdae2=a44_0x3598,_0x2b574a=await select({'message':_0x9bdae2(0x1c7),'choices':[{'name':a44_0x3bfc94[_0x9bdae2(0x1bf)]('(跳过,稍后配置)'),'value':_0x9bdae2(0x1be)},{'name':a44_0x3bfc94[_0x9bdae2(0x1c1)]('✎\x20手动输入'),'value':'manual'}]});if(_0x2b574a==='skip')return'';return promptCustomAppcode();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a45_0x45de(){const _0x18aa3c=['\x20completed\x20successfully.','\x20failed:\x20','PROCESSING','187855HfPLNe','3fQLBwu','PENDING','930qvIThX','has','\x20failed.','\x20is\x20processing.','\x27\x5c\x27\x27','string','1516088QhxcGx','79783nfSnhy','\x20task\x20status\x20--task-id\x20','status','Async\x20task\x20','\x20response\x20did\x20not\x20contain\x20a\x20status.','1902ESETmW','Task\x20','trim','\x20returned\x20unknown\x20status\x20','apiError','\x20--format\x20compress','FAILED','298368HsaDnK','SUCCESS','Async\x20task\x20response\x20did\x20not\x20contain\x20a\x20taskId.','714652uxpVuy','errorMessage','3410jzYNiB','63CDQEUa','taskId','\x20--appcode\x20','290014fhYrMt','toUpperCase'];a45_0x45de=function(){return _0x18aa3c;};return a45_0x45de();}const a45_0x19e195=a45_0xa4a4;(function(_0x14d390,_0x45813c){const _0x46fe20=a45_0xa4a4,_0x554818=_0x14d390();while(!![]){try{const _0x7242d8=parseInt(_0x46fe20(0x1f3))/0x1+parseInt(_0x46fe20(0x1ee))/0x2*(-parseInt(_0x46fe20(0x1f4))/0x3)+parseInt(_0x46fe20(0x1e8))/0x4+parseInt(_0x46fe20(0x1ea))/0x5*(-parseInt(_0x46fe20(0x1de))/0x6)+-parseInt(_0x46fe20(0x1fc))/0x7+-parseInt(_0x46fe20(0x1e5))/0x8*(parseInt(_0x46fe20(0x1eb))/0x9)+-parseInt(_0x46fe20(0x1f6))/0xa*(-parseInt(_0x46fe20(0x1fd))/0xb);if(_0x7242d8===_0x45813c)break;else _0x554818['push'](_0x554818['shift']());}catch(_0x14102e){_0x554818['push'](_0x554818['shift']());}}}(a45_0x45de,0x315ce));import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';const TERMINAL_STATUSES=new Set([a45_0x19e195(0x1e6),a45_0x19e195(0x1e4)]),NON_TERMINAL_STATUSES=new Set([a45_0x19e195(0x1f5),a45_0x19e195(0x1f2)]);export function normalizeAsyncTask(_0x5545d5){const _0x538bb8=a45_0x19e195,_0x543ce3=typeof _0x5545d5?.[_0x538bb8(0x1ec)]===_0x538bb8(0x1fb)?_0x5545d5[_0x538bb8(0x1ec)][_0x538bb8(0x1e0)]():'';if(!_0x543ce3)throw CliErrors[_0x538bb8(0x1e2)](_0x538bb8(0x1e7));const _0x31c29b=typeof _0x5545d5[_0x538bb8(0x1ff)]===_0x538bb8(0x1fb)?_0x5545d5['status'][_0x538bb8(0x1e0)]()[_0x538bb8(0x1ef)]():'';if(!_0x31c29b)throw CliErrors['apiError'](_0x538bb8(0x200)+_0x543ce3+_0x538bb8(0x1dd));return{'taskId':_0x543ce3,'status':_0x31c29b,'errorMessage':typeof _0x5545d5[_0x538bb8(0x1e9)]===_0x538bb8(0x1fb)&&_0x5545d5[_0x538bb8(0x1e9)][_0x538bb8(0x1e0)]()?_0x5545d5[_0x538bb8(0x1e9)][_0x538bb8(0x1e0)]():null,'isTerminal':TERMINAL_STATUSES[_0x538bb8(0x1f7)](_0x31c29b),'knownStatus':TERMINAL_STATUSES[_0x538bb8(0x1f7)](_0x31c29b)||NON_TERMINAL_STATUSES['has'](_0x31c29b)};}export function buildAsyncTaskStatusCommand(_0xc4ed29,_0x28974f){const _0x18d163=a45_0x19e195;return CLI_BIN_NAME+_0x18d163(0x1fe)+quoteShellArg(_0xc4ed29)+_0x18d163(0x1ed)+quoteShellArg(_0x28974f)+_0x18d163(0x1e3);}function a45_0xa4a4(_0x47f351,_0x37fdac){_0x47f351=_0x47f351-0x1dd;const _0x45de43=a45_0x45de();let _0xa4a453=_0x45de43[_0x47f351];return _0xa4a453;}export function asyncTaskMessage(_0x387066){const _0x20353d=a45_0x19e195;switch(_0x387066[_0x20353d(0x1ff)]){case'PENDING':return _0x20353d(0x1df)+_0x387066[_0x20353d(0x1ec)]+'\x20is\x20pending.';case _0x20353d(0x1f2):return'Task\x20'+_0x387066['taskId']+_0x20353d(0x1f9);case _0x20353d(0x1e6):return _0x20353d(0x1df)+_0x387066[_0x20353d(0x1ec)]+_0x20353d(0x1f0);case'FAILED':return _0x387066[_0x20353d(0x1e9)]?_0x20353d(0x1df)+_0x387066[_0x20353d(0x1ec)]+_0x20353d(0x1f1)+_0x387066['errorMessage']:_0x20353d(0x1df)+_0x387066[_0x20353d(0x1ec)]+_0x20353d(0x1f8);default:return'Task\x20'+_0x387066[_0x20353d(0x1ec)]+_0x20353d(0x1e1)+_0x387066[_0x20353d(0x1ff)]+'.';}}function quoteShellArg(_0x101563){const _0x305d21=a45_0x19e195;return'\x27'+_0x101563['replace'](/'/g,_0x305d21(0x1fa))+'\x27';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x283bce,_0x306d84){var _0x1fa4de=a46_0x5954,_0x413a9f=_0x283bce();while(!![]){try{var _0x52d635=parseInt(_0x1fa4de(0xb8))/0x1+-parseInt(_0x1fa4de(0xba))/0x2*(-parseInt(_0x1fa4de(0xb4))/0x3)+parseInt(_0x1fa4de(0xbb))/0x4*(-parseInt(_0x1fa4de(0xb5))/0x5)+-parseInt(_0x1fa4de(0xb9))/0x6+-parseInt(_0x1fa4de(0xb6))/0x7+parseInt(_0x1fa4de(0xbd))/0x8*(-parseInt(_0x1fa4de(0xb0))/0x9)+-parseInt(_0x1fa4de(0xb3))/0xa*(-parseInt(_0x1fa4de(0xb7))/0xb);if(_0x52d635===_0x306d84)break;else _0x413a9f['push'](_0x413a9f['shift']());}catch(_0x477496){_0x413a9f['push'](_0x413a9f['shift']());}}}(a46_0x121f,0xe01dd));function a46_0x121f(){var _0x13934a=['7012126lSIhRc','787520nRShZi','10877040ERTeHl','3229958zcLTkj','44VFYqaS','defineProperties','616sPlvut','url','96948cqstQb','description','method','30XKjJHf','3lOLJbN','159745MwQYkd','2822351klZwgp'];a46_0x121f=function(){return _0x13934a;};return a46_0x121f();}function a46_0x5954(_0x17c616,_0x3f588b){_0x17c616=_0x17c616-0xaf;var _0x121f0f=a46_0x121f();var _0x595450=_0x121f0f[_0x17c616];return _0x595450;}export function asDryRunResult(_0x51aac2,_0x2da048){var _0x479242=a46_0x5954;return Object[_0x479242(0xbc)](_0x51aac2,{'method':{'value':_0x2da048[_0x479242(0xb2)],'enumerable':![]},'url':{'value':_0x2da048[_0x479242(0xaf)],'enumerable':![]},..._0x2da048[_0x479242(0xb1)]?{'description':{'value':_0x2da048[_0x479242(0xb1)],'enumerable':![]}}:{}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a47_0x629eb5=a47_0x4040;(function(_0xdf1c9d,_0x2ac838){const _0x402156=a47_0x4040,_0x46e124=_0xdf1c9d();while(!![]){try{const _0xa44dee=parseInt(_0x402156(0x1e5))/0x1*(-parseInt(_0x402156(0x1e7))/0x2)+parseInt(_0x402156(0x1de))/0x3+parseInt(_0x402156(0x1d7))/0x4+parseInt(_0x402156(0x1e4))/0x5*(parseInt(_0x402156(0x1d4))/0x6)+-parseInt(_0x402156(0x1da))/0x7*(parseInt(_0x402156(0x1d8))/0x8)+parseInt(_0x402156(0x1e2))/0x9+-parseInt(_0x402156(0x1e6))/0xa;if(_0xa44dee===_0x2ac838)break;else _0x46e124['push'](_0x46e124['shift']());}catch(_0x3cfcd7){_0x46e124['push'](_0x46e124['shift']());}}}(a47_0x6d5c,0x2b7d3));export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}(?:_[^_\s]+_[^_\s]+)?$/i,'description':a47_0x629eb5(0x1d2)};export const CODE_FLAG={'name':a47_0x629eb5(0x1d9),'type':a47_0x629eb5(0x1df),'required':!![],'description':'Dataset\x20code\x20(32-char\x20hex,\x20optionally\x20with\x20_xx_xx\x20suffix)','pattern':DATASET_CODE_PATTERN};export const CODE_FLAG_OPTIONAL={...CODE_FLAG,'required':![]};export const DATASETCODE_FLAG_OPTIONAL={...CODE_FLAG_OPTIONAL,'name':a47_0x629eb5(0x1e8),'description':a47_0x629eb5(0x1e3)};export const SQLCODE_FLAG={'name':a47_0x629eb5(0x1dc),'type':a47_0x629eb5(0x1df),'required':!![],'description':a47_0x629eb5(0x1d3),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a47_0x629eb5(0x1e0)}};export const APPCODE_FLAG_OPTIONAL={'name':a47_0x629eb5(0x1db),'type':a47_0x629eb5(0x1df),'required':![],'description':a47_0x629eb5(0x1e1)};function a47_0x4040(_0x541250,_0x59a9bd){_0x541250=_0x541250-0x1d2;const _0x6d5c20=a47_0x6d5c();let _0x404048=_0x6d5c20[_0x541250];return _0x404048;}export const APPCODE_FLAG={...APPCODE_FLAG_OPTIONAL,'required':!![],'description':'App\x20code\x20(e.g.\x20app-xxxxx)'};export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};function a47_0x6d5c(){const _0xe43bff=['App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)','2155851XMkaPJ','Dataset\x20code\x20(32-char\x20hex,\x20optionally\x20with\x20_xx_xx\x20suffix)','53965UxTnXu','5InUJIe','6424970FSTBsw','41098aFmORR','datasetcode','boolean','a\x2032-character\x20hex\x20code,\x20optionally\x20with\x20`_xx_xx`\x20suffix\x20(e.g.\x2099a909313f1fa7153186431e1c551588\x20or\x2099a909313f1fa7153186431e1c551588_75_3c7120aa)','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','132HbifpR','number','dbtype','1397168pdoLnl','53776ZPYPOn','code','56EJYShD','appcode','sqlcode','Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)','452616gAFsns','string','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)'];a47_0x6d5c=function(){return _0xe43bff;};return a47_0x6d5c();}export const DBLINK_ID_FLAG={'name':'id','type':a47_0x629eb5(0x1d5),'required':!![],'description':a47_0x629eb5(0x1dd)};export const DB_TYPE_FLAG={'name':a47_0x629eb5(0x1d6),'type':'string','required':!![],'description':'Database\x20product\x20type','enum':['MYSQL','POSTGRESQL']};export const SKIP_CONNECTION_TEST_FLAG={'name':'skip-connection-test','type':a47_0x629eb5(0x1e9),'description':'Skip\x20testing\x20the\x20unsaved\x20database\x20configuration\x20before\x20create/update'};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xd0a1a,_0x3b5e6a){const _0x4fe7f3=a48_0x23a8,_0x4565cf=_0xd0a1a();while(!![]){try{const _0x34622c=-parseInt(_0x4fe7f3(0xa5))/0x1*(parseInt(_0x4fe7f3(0x9d))/0x2)+parseInt(_0x4fe7f3(0xa1))/0x3+-parseInt(_0x4fe7f3(0x99))/0x4+-parseInt(_0x4fe7f3(0x9e))/0x5+parseInt(_0x4fe7f3(0x9b))/0x6*(parseInt(_0x4fe7f3(0x98))/0x7)+-parseInt(_0x4fe7f3(0x97))/0x8+parseInt(_0x4fe7f3(0xa0))/0x9;if(_0x34622c===_0x3b5e6a)break;else _0x4565cf['push'](_0x4565cf['shift']());}catch(_0x777a11){_0x4565cf['push'](_0x4565cf['shift']());}}}(a48_0x3d31,0x71c73));import{existsSync,statSync}from'node:fs';import{CliErrors}from'../../errors.js';function a48_0x23a8(_0x145854,_0x17eaf4){_0x145854=_0x145854-0x92;const _0x3d315e=a48_0x3d31();let _0x23a8e2=_0x3d315e[_0x145854];return _0x23a8e2;}function a48_0x3d31(){const _0x333981=['2546454Mcshwk','ceil','size','File\x20not\x20found:\x20','19OiXeNP','File\x20is\x20not\x20a\x20regular\x20file:\x20','isFile','trim','toFixed','File\x20exceeds\x20the\x20development\x20upload\x20limit\x20of\x2050\x20MB:\x20','5173896sADCat','1962338OfAZCo','588740tJDlSi','\x20path\x20is\x20required.','12pUEcpK','validation','61346UbDJst','962730qYunOE','\x20MB','5632236UWLyOc'];a48_0x3d31=function(){return _0x333981;};return a48_0x3d31();}const BYTES_PER_MB=0x400*0x400;export const DEVELOPMENT_UPLOAD_MAX_BYTES=0x32*BYTES_PER_MB;function formatBytes(_0x1a9883){const _0x5d056a=a48_0x23a8;if(_0x1a9883>=BYTES_PER_MB){const _0xd447e=Math[_0x5d056a(0xa2)](_0x1a9883/BYTES_PER_MB*0x64)/0x64;return _0xd447e[_0x5d056a(0x95)](0x2)+_0x5d056a(0x9f);}return _0x1a9883+'\x20B';}export function requireDevelopmentUploadFile(_0x546f08,_0x32af36){const _0x53dc2d=a48_0x23a8,_0x4e1ce3=_0x546f08[_0x53dc2d(0x94)]();if(!_0x4e1ce3)throw CliErrors['validation'](_0x32af36+_0x53dc2d(0x9a));if(!existsSync(_0x4e1ce3))throw CliErrors[_0x53dc2d(0x9c)](_0x53dc2d(0xa4)+_0x4e1ce3);const _0x4026db=statSync(_0x4e1ce3);if(!_0x4026db[_0x53dc2d(0x93)]())throw CliErrors['validation'](_0x53dc2d(0x92)+_0x4e1ce3);if(_0x4026db['size']>DEVELOPMENT_UPLOAD_MAX_BYTES)throw CliErrors[_0x53dc2d(0x9c)](_0x53dc2d(0x96)+_0x4e1ce3+'\x20('+formatBytes(_0x4026db[_0x53dc2d(0xa3)])+')');return{'path':_0x4e1ce3,'size':_0x4026db[_0x53dc2d(0xa3)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4d2e75,_0xe59659){const _0x41ad63=a49_0x5c52,_0x56d520=_0x4d2e75();while(!![]){try{const _0x5bf971=parseInt(_0x41ad63(0xa2))/0x1*(parseInt(_0x41ad63(0xaa))/0x2)+-parseInt(_0x41ad63(0xab))/0x3*(parseInt(_0x41ad63(0xa3))/0x4)+-parseInt(_0x41ad63(0xac))/0x5*(-parseInt(_0x41ad63(0xae))/0x6)+parseInt(_0x41ad63(0xa8))/0x7+-parseInt(_0x41ad63(0xa5))/0x8*(parseInt(_0x41ad63(0xa9))/0x9)+-parseInt(_0x41ad63(0xa7))/0xa+parseInt(_0x41ad63(0xad))/0xb;if(_0x5bf971===_0xe59659)break;else _0x56d520['push'](_0x56d520['shift']());}catch(_0x5461b6){_0x56d520['push'](_0x56d520['shift']());}}}(a49_0x51bf,0xb17df));function a49_0x5c52(_0x1562c9,_0x55c376){_0x1562c9=_0x1562c9-0xa2;const _0x51bf1e=a49_0x51bf();let _0x5c52af=_0x51bf1e[_0x1562c9];return _0x5c52af;}export function validateAppcode(_0x2a9239){const _0x3ffcf7=a49_0x5c52,_0x401e8d=_0x2a9239[_0x3ffcf7(0xa4)]();if(!_0x401e8d)return{'valid':![],'message':_0x3ffcf7(0xa6)};if(_0x401e8d['length']>0x64)return{'valid':![],'message':'App\x20Code\x20cannot\x20exceed\x20100\x20characters'};if(!/^[A-Za-z0-9_-]+$/['test'](_0x401e8d))return{'valid':![],'message':'Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed'};return{'valid':!![]};}function a49_0x51bf(){const _0x2d63d3=['26608SADifn','trim','10248TAQwSg','App\x20Code\x20cannot\x20be\x20empty','8690980nZKLaU','4114180fzwXEC','387doXGcU','43428deMPMe','225zlOriZ','20nfvKHj','3467508qPRkHj','1675254heEXiB','6NSTJsj'];a49_0x51bf=function(){return _0x2d63d3;};return a49_0x51bf();}
|