@lovrabet/rabetbase-cli 2.4.1-beta.1 → 2.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/react/create.js +1 -1
- package/lib/commands/page/react/detail.js +1 -1
- package/lib/commands/page/react/list.js +1 -1
- package/lib/commands/page/react/publish.js +1 -1
- package/lib/commands/page/react/shared.js +1 -1
- package/lib/commands/page/react/syntax.js +1 -1
- package/lib/commands/page/react/template.js +1 -1
- package/lib/commands/page/react/update.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a34_0x1554(_0x594b95,_0x486a8c){_0x594b95=_0x594b95-0x12f;const _0x383da2=a34_0x383d();let _0x1554c6=_0x383da2[_0x594b95];return _0x1554c6;}const a34_0x56b325=a34_0x1554;(function(_0x241ad0,_0x4773fe){const _0x37027d=a34_0x1554,_0x593193=_0x241ad0();while(!![]){try{const _0xec2a15=parseInt(_0x37027d(0x13a))/0x1*(-parseInt(_0x37027d(0x140))/0x2)+parseInt(_0x37027d(0x148))/0x3+-parseInt(_0x37027d(0x14c))/0x4*(-parseInt(_0x37027d(0x131))/0x5)+parseInt(_0x37027d(0x144))/0x6*(parseInt(_0x37027d(0x130))/0x7)+parseInt(_0x37027d(0x136))/0x8+-parseInt(_0x37027d(0x142))/0x9*(-parseInt(_0x37027d(0x145))/0xa)+parseInt(_0x37027d(0x13f))/0xb*(-parseInt(_0x37027d(0x133))/0xc);if(_0xec2a15===_0x4773fe)break;else _0x593193['push'](_0x593193['shift']());}catch(_0x33f39d){_0x593193['push'](_0x593193['shift']());}}}(a34_0x383d,0x788da));import{listBffScripts}from'../../core/api-client.js';function a34_0x383d(){const _0x4234d1=['24pGPsrK','description','functionName','string','bff','882665bGNzhk','129435tSMOuB','name','12hqEVFk','appCode','ENDPOINT','2683400XYnEkm','boolean','str','map','3zdYYHB','verbose','Filter\x20by\x20script\x20name','read','bool','8404638elVFev','348658FvnouS','COMMON','63prqIdp','(unnamed)','42NnAsAF','67360gVxQhn','type','List\x20BFF\x20scripts','1080801QTzMhi','scriptType','length','Return\x20full\x20script\x20objects'];a34_0x383d=function(){return _0x4234d1;};return a34_0x383d();}export const bffList={'service':a34_0x56b325(0x12f),'command':'list','description':a34_0x56b325(0x147),'risk':a34_0x56b325(0x13d),'flags':[{'name':a34_0x56b325(0x146),'type':a34_0x56b325(0x14f),'description':'Script\x20type\x20filter','default':'ENDPOINT','enum':[a34_0x56b325(0x135),a34_0x56b325(0x141)]},{'name':'name','type':a34_0x56b325(0x14f),'description':a34_0x56b325(0x13c)},{'name':a34_0x56b325(0x13b),'type':a34_0x56b325(0x137),'description':a34_0x56b325(0x14b)}],async 'execute'(_0x2d82f2){const _0xed9b96=a34_0x56b325,_0x1547b4=await listBffScripts(_0x2d82f2[_0xed9b96(0x134)],_0x2d82f2['str'](_0xed9b96(0x146)),{'scriptName':_0x2d82f2[_0xed9b96(0x138)](_0xed9b96(0x132))||undefined}),_0xd293ce=_0x2d82f2[_0xed9b96(0x13e)](_0xed9b96(0x13b));return{'ok':!![],'data':_0xd293ce?_0x1547b4:_0x1547b4[_0xed9b96(0x139)](_0x159635=>({'id':_0x159635['id'],'functionName':_0x159635[_0xed9b96(0x14e)]??'','description':_0x159635[_0xed9b96(0x14d)]||_0xed9b96(0x143),'scriptType':_0x159635[_0xed9b96(0x149)]})),'message':_0x1547b4[_0xed9b96(0x14a)]===0x0?'No\x20BFF\x20scripts\x20found.':undefined};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a35_0xd6b844=a35_0x5140;function a35_0x5140(_0x352138,_0x6ee7ab){_0x352138=_0x352138-0xde;const _0x159531=a35_0x1595();let _0x5140a9=_0x159531[_0x352138];return _0x5140a9;}(function(_0x3f6757,_0x3621d3){const _0xbafdf2=a35_0x5140,_0x2738bc=_0x3f6757();while(!![]){try{const _0x36f37f=parseInt(_0xbafdf2(0x123))/0x1*(-parseInt(_0xbafdf2(0xe6))/0x2)+parseInt(_0xbafdf2(0x11e))/0x3+-parseInt(_0xbafdf2(0x101))/0x4+-parseInt(_0xbafdf2(0xf7))/0x5*(-parseInt(_0xbafdf2(0xed))/0x6)+-parseInt(_0xbafdf2(0x109))/0x7+parseInt(_0xbafdf2(0xf0))/0x8+parseInt(_0xbafdf2(0xfb))/0x9;if(_0x36f37f===_0x3621d3)break;else _0x2738bc['push'](_0x2738bc['shift']());}catch(_0x16ceeb){_0x2738bc['push'](_0x2738bc['shift']());}}}(a35_0x1595,0x42e8d));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';import{CliErrors}from'../../errors.js';export const bffPull={'service':a35_0xd6b844(0xf6),'command':a35_0xd6b844(0x11a),'description':'Pull\x20remote\x20BFF\x20scripts\x20to\x20local','risk':a35_0xd6b844(0x106),'flags':[{'name':a35_0xd6b844(0xee),'type':a35_0xd6b844(0x11b),'description':a35_0xd6b844(0x10c),'enum':[a35_0xd6b844(0xdf),a35_0xd6b844(0xeb),a35_0xd6b844(0x10a)]},{'name':a35_0xd6b844(0xe5),'type':a35_0xd6b844(0xfc),'description':a35_0xd6b844(0xe2)}],async 'dryRun'(_0x2062e0){const _0x1a71ab=a35_0xd6b844,_0x59f23c=loadBffProjectConfig(_0x2062e0[_0x1a71ab(0x120)]),_0x11e11e=await readBffLockFile(_0x59f23c[_0x1a71ab(0x121)]),{appLock:_0x53884a}=ensureLockScope(_0x11e11e??createEmptyBffLock(),_0x2062e0[_0x1a71ab(0x120)],_0x59f23c[_0x1a71ab(0x115)],_0x1a71ab(0x11a)),_0x96c47b=normalizeBffType(_0x2062e0[_0x1a71ab(0xfe)](_0x1a71ab(0xee)))??undefined,_0x6efbce=buildDatasetCodeToAliasMap(_0x2062e0[_0x1a71ab(0xe8)],_0x2062e0[_0x1a71ab(0x120)]),[_0x14b17e,_0x2bdeb6]=await Promise[_0x1a71ab(0xff)]([listBffScripts(_0x2062e0[_0x1a71ab(0x120)],_0x96c47b),getBffScriptStatistics(_0x2062e0[_0x1a71ab(0x120)])]),_0x7f153f=createHookLocationMap(_0x2bdeb6),_0x5ee83b=[];for(const _0x347492 of _0x14b17e){const _0x41ad42=resolveRemoteScriptTarget(_0x59f23c,_0x347492,_0x7f153f,_0x53884a[_0x1a71ab(0xde)],_0x6efbce);if(!_0x41ad42){_0x5ee83b[_0x1a71ab(0x11f)]({'scriptType':_0x347492['scriptType'],'functionName':_0x347492[_0x1a71ab(0x10f)]??'','status':_0x1a71ab(0xf2),'reason':_0x1a71ab(0x112)});continue;}const _0x34e436=_0x53884a[_0x1a71ab(0xde)][_0x41ad42[_0x1a71ab(0x114)]],_0x24285f=_0x347492[_0x1a71ab(0x110)]!=null?computeContentHash(_0x347492[_0x1a71ab(0x110)]):undefined,_0x234047=await hasUnsyncedLocalChanges(_0x41ad42[_0x1a71ab(0xe0)],_0x34e436,_0x24285f);_0x5ee83b['push']({'lockKey':_0x41ad42[_0x1a71ab(0x114)],'filePath':_0x41ad42[_0x1a71ab(0xe0)],'remoteId':_0x347492['id']??null,'status':_0x234047?_0x1a71ab(0xea):_0x1a71ab(0xe9)});}return{'method':_0x1a71ab(0x117),'url':'/api/management/library/scripts/list?appCode='+_0x2062e0['appCode']+(_0x96c47b?_0x1a71ab(0xf8)+_0x96c47b:''),'body':{'appCode':_0x2062e0[_0x1a71ab(0x120)],'filterType':_0x96c47b??null,'files':_0x5ee83b},'description':_0x1a71ab(0x124)+_0x5ee83b['length']+_0x1a71ab(0x111)};},async 'execute'(_0x4e59a8){const _0x305a2a=a35_0xd6b844,_0x278b65=loadBffProjectConfig(_0x4e59a8[_0x305a2a(0x120)]),_0x4a5e22=await readBffLockFile(_0x278b65[_0x305a2a(0x121)]),{lockData:_0x310be3,appLock:_0x10520b}=ensureLockScope(_0x4a5e22??createEmptyBffLock(),_0x4e59a8['appCode'],_0x278b65[_0x305a2a(0x115)],_0x305a2a(0x11a)),_0x235878=normalizeBffType(_0x4e59a8[_0x305a2a(0xfe)](_0x305a2a(0xee)))??undefined;if(_0x4e59a8[_0x305a2a(0xfe)]('type')&&!_0x235878)throw CliErrors[_0x305a2a(0xe1)](_0x305a2a(0x10d));const [_0x21903a,_0x87e19]=await Promise[_0x305a2a(0xff)]([listBffScripts(_0x4e59a8[_0x305a2a(0x120)],_0x235878),getBffScriptStatistics(_0x4e59a8[_0x305a2a(0x120)])]);if(_0x21903a[_0x305a2a(0x107)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x305a2a(0x104)};const _0x39ad62=_0x4e59a8['bool'](_0x305a2a(0xe5));if(_0x39ad62&&!_0x4e59a8['nonInteractive']){const _0x3aef01=await confirmForce();if(!_0x3aef01)throw CliErrors[_0x305a2a(0x102)](_0x305a2a(0x11d));}if(_0x39ad62&&_0x4e59a8[_0x305a2a(0xf9)]){}const _0x5be287=buildDatasetCodeToAliasMap(_0x4e59a8[_0x305a2a(0xe8)],_0x4e59a8[_0x305a2a(0x120)]),_0x143a9c=createHookLocationMap(_0x87e19),_0xb7487d=JSON[_0x305a2a(0xfa)](JSON[_0x305a2a(0x11c)](_0x310be3)),_0x4b992d=_0x4e59a8[_0x305a2a(0x120)],_0x13b628=_0xb7487d['apps'][_0x4b992d];if(!_0x13b628)throw new Error(_0x305a2a(0x10b)+_0x4b992d+_0x305a2a(0x105));const _0x388ec2=[],_0x3f07c6=[],_0x310086=[];for(const _0x32e80a of _0x21903a){const _0x26473e=resolveRemoteScriptTarget(_0x278b65,_0x32e80a,_0x143a9c,_0x10520b[_0x305a2a(0xde)],_0x5be287);if(!_0x26473e){_0x3f07c6[_0x305a2a(0x11f)]({'lockKey':_0x32e80a['scriptType']+'/'+_0x32e80a['functionName'],'reason':_0x305a2a(0x112)});continue;}const _0xb0bd9b=_0x10520b[_0x305a2a(0xde)][_0x26473e[_0x305a2a(0x114)]];try{if(!_0x32e80a['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0x32e80a[_0x305a2a(0x110)]==null)throw new Error('Remote\x20script\x20missing\x20content.');const _0x3d63b1=_0x32e80a['scriptContent'],_0x4cd1cb=computeContentHash(_0x3d63b1);if(!_0x39ad62){const _0x27b67f=await hasUnsyncedLocalChanges(_0x26473e['filePath'],_0xb0bd9b,_0x4cd1cb);if(_0x27b67f){_0x3f07c6['push']({'lockKey':_0x26473e[_0x305a2a(0x114)],'reason':_0x305a2a(0x100)});continue;}}await ensureParentDirectory(_0x26473e[_0x305a2a(0xe0)]),await writeFile(_0x26473e[_0x305a2a(0xe0)],_0x3d63b1,_0x305a2a(0x125));const _0x3a814b={'hash':_0x4cd1cb,'remoteId':_0x32e80a['id'],'version':_0x32e80a['version']};_0x26473e['type']==='HOOK'&&_0x26473e[_0x305a2a(0x10e)]&&(_0x3a814b[_0x305a2a(0x113)]=_0x26473e[_0x305a2a(0x10e)]['alias'],_0x3a814b[_0x305a2a(0xe3)]=_0x26473e[_0x305a2a(0x10e)]['datasetCode'],_0x3a814b[_0x305a2a(0x119)]=_0x26473e['hookLocation'][_0x305a2a(0x119)],_0x3a814b[_0x305a2a(0x116)]=_0x26473e[_0x305a2a(0x10e)][_0x305a2a(0x116)]),_0x13b628[_0x305a2a(0xde)][_0x26473e[_0x305a2a(0x114)]]=_0x3a814b,_0x388ec2[_0x305a2a(0x11f)]({'lockKey':_0x26473e[_0x305a2a(0x114)],'remoteId':_0x32e80a['id']});}catch(_0x544449){_0x310086[_0x305a2a(0x11f)]({'lockKey':_0x26473e[_0x305a2a(0x114)],'error':_0x544449 instanceof Error?_0x544449['message']:String(_0x544449)});}}return _0x13b628[_0x305a2a(0xf1)]=new Date()[_0x305a2a(0x103)](),await writeBffLockFile(_0x278b65['lockFilePath'],_0xb7487d),{'ok':_0x310086[_0x305a2a(0x107)]===0x0,'data':{'pulled':_0x388ec2,'skipped':_0x3f07c6,'failed':_0x310086},'message':'Pull\x20complete:\x20'+_0x388ec2[_0x305a2a(0x107)]+'\x20pulled,\x20'+_0x3f07c6[_0x305a2a(0x107)]+_0x305a2a(0xe4)+_0x310086[_0x305a2a(0x107)]+_0x305a2a(0xf3)};}};async function hasUnsyncedLocalChanges(_0x3a242b,_0x21c0db,_0x42604f){const _0x4595d1=a35_0xd6b844;if(!await fileExists(_0x3a242b))return![];const _0x215970=await computeFileHash(_0x3a242b);if(!_0x21c0db)return _0x42604f?_0x215970!==_0x42604f:!![];return _0x215970!==_0x21c0db[_0x4595d1(0xf5)];}function a35_0x1595(){const _0x12a60a=['conflict','ENDPOINT','trim','2580060VDnsIO','type','question','257432KpxZIm','lastSync','skipped','\x20failed','stdin','hash','bff','5oKJMlI','&type=','nonInteractive','parse','3685653oPwPYV','boolean','yes','str','all','local\x20unsynced\x20changes','608440QKsnPY','cancelled','toISOString','No\x20remote\x20BFF\x20scripts\x20found.','\x22\x20not\x20found\x20after\x20ensureLockScope.','read','length','stderr','3804633tcQuqF','HOOK','Lock\x20scope\x20for\x20app\x20\x22','Pull\x20only\x20this\x20script\x20type','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','hookLocation','functionName','scriptContent','\x20remote\x20BFF\x20script(s)\x20for\x20pull','unresolvable\x20target\x20path','alias','lockKey','scriptsRoot','functionNode','GET','close','operationType','pull','string','stringify','Force\x20pull\x20cancelled.','1424880imMoOX','push','appCode','lockFilePath','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','8VGQaEv','Would\x20inspect\x20','utf8','functions','COMMON','filePath','validation','Force\x20overwrite\x20local\x20unsynced\x20changes','datasetCode','\x20skipped,\x20','force','94244unwuFG','includes','apiDir','would_pull'];a35_0x1595=function(){return _0x12a60a;};return a35_0x1595();}function buildDatasetCodeToAliasMap(_0x563c31,_0x404c7c){const _0x2d9861=a35_0xd6b844,_0x3d04ec=loadAliasMap(_0x563c31,undefined,resolveApiFilePath(_0x563c31,_0x404c7c));return new Map(_0x3d04ec['map'](_0x2507ab=>[_0x2507ab[_0x2d9861(0xe3)],_0x2507ab[_0x2d9861(0x113)]]));}async function confirmForce(){const _0x570a3c=a35_0xd6b844,_0x30f898=createInterface({'input':process[_0x570a3c(0xf4)],'output':process[_0x570a3c(0x108)]}),_0x51e2cb=await new Promise(_0x2e27e0=>{const _0x998fd7=_0x570a3c;_0x30f898[_0x998fd7(0xef)](_0x998fd7(0x122),_0x2e27e0);});return _0x30f898[_0x570a3c(0x118)](),['y',_0x570a3c(0xfd)][_0x570a3c(0xe7)](_0x51e2cb[_0x570a3c(0xec)]()['toLowerCase']());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a36_0x55ae30=a36_0x204e;(function(_0xdbc290,_0x2b36dc){const _0x143e0f=a36_0x204e,_0x3a1b9e=_0xdbc290();while(!![]){try{const _0x12ca4a=-parseInt(_0x143e0f(0x19f))/0x1*(-parseInt(_0x143e0f(0x1c9))/0x2)+-parseInt(_0x143e0f(0x1b1))/0x3+parseInt(_0x143e0f(0x188))/0x4+-parseInt(_0x143e0f(0x1be))/0x5+parseInt(_0x143e0f(0x18d))/0x6+parseInt(_0x143e0f(0x1ae))/0x7*(-parseInt(_0x143e0f(0x1a7))/0x8)+-parseInt(_0x143e0f(0x1ad))/0x9*(parseInt(_0x143e0f(0x1c7))/0xa);if(_0x12ca4a===_0x2b36dc)break;else _0x3a1b9e['push'](_0x3a1b9e['shift']());}catch(_0x1442b2){_0x3a1b9e['push'](_0x3a1b9e['shift']());}}}(a36_0x72f2,0x240dc));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';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_0x55ae30(0x1b5),'description':'Push\x20local\x20BFF\x20scripts\x20to\x20remote','risk':a36_0x55ae30(0x1ca),'flags':[{'name':'type','type':a36_0x55ae30(0x18a),'description':'Push\x20only\x20this\x20script\x20type','enum':[a36_0x55ae30(0x180),a36_0x55ae30(0x1a4),a36_0x55ae30(0x19e)]},{'name':a36_0x55ae30(0x1bf),'type':'string','description':a36_0x55ae30(0x1aa)},{'name':a36_0x55ae30(0x17f),'type':a36_0x55ae30(0x1b3),'description':a36_0x55ae30(0x198)}],async 'dryRun'(_0x449cff){const _0x3f36e2=a36_0x55ae30,_0x277e99=loadBffProjectConfig(_0x449cff[_0x3f36e2(0x1c2)]),_0x540757=await readBffLockFile(_0x277e99[_0x3f36e2(0x17e)]),{appLock:_0x1d9b27}=ensureLockScope(_0x540757??createEmptyBffLock(),_0x449cff[_0x3f36e2(0x1c2)],_0x277e99[_0x3f36e2(0x1bd)],_0x3f36e2(0x1b5)),_0x143288=await getTargetFunctions(_0x277e99,_0x449cff),_0x5b138d=_0x449cff[_0x3f36e2(0x194)](_0x3f36e2(0x17f)),_0x347fa4=[];for(const _0x1ef7f1 of _0x143288){const _0x1bfbaa=await computeFileHash(_0x1ef7f1[_0x3f36e2(0x1a6)]),_0x295c8f=_0x1d9b27[_0x3f36e2(0x18e)][_0x1ef7f1[_0x3f36e2(0x1a0)]],_0x6fcc7d=!!_0x295c8f&&_0x295c8f[_0x3f36e2(0x1b6)]===_0x1bfbaa;_0x347fa4[_0x3f36e2(0x1b5)]({'lockKey':_0x1ef7f1[_0x3f36e2(0x1a0)],'filePath':_0x1ef7f1['filePath'],'remoteId':_0x295c8f?.['remoteId']??null,'mode':_0x295c8f?.[_0x3f36e2(0x17a)]?_0x3f36e2(0x182):_0x3f36e2(0x1a5),'status':!_0x5b138d&&_0x6fcc7d?_0x3f36e2(0x1b2):_0x3f36e2(0x19a)});}return{'method':_0x3f36e2(0x1bb),'url':_0x3f36e2(0x199),'body':{'appCode':_0x449cff[_0x3f36e2(0x1c2)],'force':_0x5b138d,'files':_0x347fa4,'cacheClearAtRuntime':_0x347fa4[_0x3f36e2(0x1a2)](_0x2cbbd4=>_0x2cbbd4['status']===_0x3f36e2(0x19a)),'cacheClearAtRuntimeTimes':_0x347fa4[_0x3f36e2(0x1a2)](_0x56b75e=>_0x56b75e['status']==='would_push')?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x3f36e2(0x1c1)+_0x347fa4['length']+_0x3f36e2(0x1a1)};},async 'execute'(_0x49df16){const _0x10f32e=a36_0x55ae30,_0x5b2e11=loadBffProjectConfig(_0x49df16[_0x10f32e(0x1c2)]),_0x1a2c78=await readBffLockFile(_0x5b2e11['lockFilePath']),{lockData:_0xb0c5eb,appLock:_0x4b96a5}=ensureLockScope(_0x1a2c78??createEmptyBffLock(),_0x49df16[_0x10f32e(0x1c2)],_0x5b2e11[_0x10f32e(0x1bd)],_0x10f32e(0x1b5)),_0x9c80c=await getTargetFunctions(_0x5b2e11,_0x49df16);if(_0x9c80c[_0x10f32e(0x1c8)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x10f32e(0x193)};const _0x519fae=_0x49df16[_0x10f32e(0x194)]('force'),_0x10915c=JSON[_0x10f32e(0x1b9)](JSON[_0x10f32e(0x1a3)](_0xb0c5eb)),_0x156019=_0x10915c['apps'][_0x49df16[_0x10f32e(0x1c2)]];if(!_0x156019)throw new Error(_0x10f32e(0x17b)+_0x49df16[_0x10f32e(0x1c2)]+_0x10f32e(0x190));const _0x30a96b=await buildHookMaps(_0x49df16[_0x10f32e(0x1c2)],_0x49df16['apiDir'],_0x9c80c,_0x156019),_0x30bf10=[],_0x57e1d7=[],_0x2b3b9c=[];for(const _0x1698da of _0x9c80c){const _0x18f6ba=await computeFileHash(_0x1698da['filePath']),_0xa61433=_0x156019[_0x10f32e(0x18e)][_0x1698da[_0x10f32e(0x1a0)]];if(!_0x519fae&&_0xa61433&&_0xa61433[_0x10f32e(0x1b6)]===_0x18f6ba){_0x57e1d7[_0x10f32e(0x1b5)]({'lockKey':_0x1698da[_0x10f32e(0x1a0)],'reason':_0x10f32e(0x1b2)});continue;}try{await uploadSingleFunction(_0x49df16['appCode'],_0x1698da,_0x156019,_0x30a96b);const _0xc0f951=_0x156019['functions'][_0x1698da[_0x10f32e(0x1a0)]];_0x30bf10[_0x10f32e(0x1b5)]({'lockKey':_0x1698da[_0x10f32e(0x1a0)],'remoteId':_0xc0f951?.['remoteId']??0x0});}catch(_0x11b4c2){_0x2b3b9c[_0x10f32e(0x1b5)]({'lockKey':_0x1698da['lockKey'],'error':_0x11b4c2 instanceof Error?_0x11b4c2[_0x10f32e(0x191)]:String(_0x11b4c2)});}}_0x156019[_0x10f32e(0x1cb)]=new Date()[_0x10f32e(0x1a8)](),await writeBffLockFile(_0x5b2e11['lockFilePath'],_0x10915c),await waitForUploadedLockEntries(_0x5b2e11[_0x10f32e(0x17e)],_0x49df16[_0x10f32e(0x1c2)],_0x30bf10[_0x10f32e(0x1af)](_0x5aa369=>_0x5aa369[_0x10f32e(0x1a0)]));let _0xdfe3ff={'attempted':![],'cleared':![]};if(_0x30bf10[_0x10f32e(0x1c8)]>0x0)try{let _0x3f6525='';for(let _0x345a56=0x0;_0x345a56<CACHE_CLEAR_ATTEMPTS;_0x345a56+=0x1){_0x3f6525=await clearBffScriptCache(),_0x345a56<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0xdfe3ff={'attempted':!![],'cleared':!![],'message':_0x3f6525||_0x10f32e(0x192)};}catch(_0x1a12ca){_0xdfe3ff={'attempted':!![],'cleared':![],'error':_0x1a12ca instanceof Error?_0x1a12ca[_0x10f32e(0x191)]:String(_0x1a12ca)};}const _0x55702a=_0x2b3b9c[_0x10f32e(0x1c8)]===0x0&&(_0xdfe3ff['attempted']?_0xdfe3ff['cleared']:!![]),_0x12b586=_0xdfe3ff['attempted']?_0xdfe3ff[_0x10f32e(0x17c)]?_0x10f32e(0x1c3):'runtime\x20cache\x20clear\x20failed':_0x10f32e(0x18b);return{'ok':_0x55702a,'data':{'uploaded':_0x30bf10,'skipped':_0x57e1d7,'failed':_0x2b3b9c,'cacheClear':_0xdfe3ff},'message':_0x10f32e(0x186)+_0x30bf10[_0x10f32e(0x1c8)]+_0x10f32e(0x183)+_0x57e1d7['length']+_0x10f32e(0x196)+_0x2b3b9c[_0x10f32e(0x1c8)]+_0x10f32e(0x197)+_0x12b586};}};async function getTargetFunctions(_0x25200e,_0xcbc451){const _0x262376=a36_0x55ae30,_0xb0869b=_0xcbc451['str'](_0x262376(0x1c6)),_0x53d61e=_0xcbc451['str'](_0x262376(0x1bf)),_0x2154d3=normalizeBffType(_0xb0869b)??undefined;if(_0x53d61e&&!_0x2154d3)throw CliErrors['validation']('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x4d6b7e=await scanLocalBffFunctions(_0x25200e,_0x2154d3);if(_0x53d61e){const _0x4edce5=_0x4d6b7e[_0x262376(0x1b8)](_0x3adbd7=>_0x3adbd7[_0x262376(0x1bf)]===_0x53d61e);if(_0x4edce5[_0x262376(0x1c8)]===0x0)throw CliErrors[_0x262376(0x18c)](_0x262376(0x189)+_0x2154d3+'/'+_0x53d61e);return _0x4edce5;}return _0x4d6b7e;}async function buildHookMaps(_0x2b40bb,_0x430a14,_0x3699dc,_0x4415cd){const _0x2b4d03=a36_0x55ae30,_0x591d14=_0x3699dc[_0x2b4d03(0x1a2)](_0x5a7148=>_0x5a7148['type']===_0x2b4d03(0x19e));if(!_0x591d14)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x5a3a8d=loadAliasMap(_0x430a14,undefined,resolveApiFilePath(_0x430a14,_0x2b40bb)),_0x46acf6=new Map(_0x5a3a8d[_0x2b4d03(0x1af)](_0x2c6f85=>[_0x2c6f85['alias'],_0x2c6f85[_0x2b4d03(0x1c4)]]));for(const _0x1bd21f of Object[_0x2b4d03(0x18f)](_0x4415cd[_0x2b4d03(0x18e)])){_0x1bd21f[_0x2b4d03(0x1c5)]&&_0x1bd21f[_0x2b4d03(0x1c4)]&&!_0x46acf6[_0x2b4d03(0x17d)](_0x1bd21f[_0x2b4d03(0x1c5)])&&_0x46acf6['set'](_0x1bd21f['alias'],_0x1bd21f[_0x2b4d03(0x1c4)]);}const _0x4dafdf=await listDatasets(_0x2b40bb),_0x3fdc3f=new Map(_0x4dafdf[_0x2b4d03(0x1af)](_0x1098f1=>[_0x1098f1[_0x2b4d03(0x195)],_0x1098f1]));return{'aliasToDatasetCode':_0x46acf6,'datasetCodeToDataset':_0x3fdc3f};}async function uploadSingleFunction(_0x84c760,_0x5530ba,_0xa31b4,_0x200d00){const _0x2f6a12=a36_0x55ae30,_0xa25c8f=await readFile(_0x5530ba['filePath'],_0x2f6a12(0x19c)),_0x39dbe0=await computeFileHash(_0x5530ba[_0x2f6a12(0x1a6)]),_0xec5115=_0xa31b4[_0x2f6a12(0x18e)][_0x5530ba[_0x2f6a12(0x1a0)]];if(_0xec5115?.[_0x2f6a12(0x17a)]&&_0xec5115[_0x2f6a12(0x1ba)]==null)throw CliErrors[_0x2f6a12(0x18c)](_0x5530ba[_0x2f6a12(0x1a0)]+_0x2f6a12(0x1b0));let _0x49b046=extractScriptDescription(_0xa25c8f);if(!_0x49b046&&_0xec5115?.[_0x2f6a12(0x17a)]){const _0x23ef45=await getBffScriptInfo(_0xec5115[_0x2f6a12(0x17a)]);_0x49b046=_0x23ef45[_0x2f6a12(0x184)]||undefined;}const _0x7dc96b={'appCode':_0x84c760,'functionName':_0x5530ba[_0x2f6a12(0x1bf)],'scriptType':_0x5530ba[_0x2f6a12(0x1c6)],'scriptContent':_0xa25c8f};if(_0xec5115?.[_0x2f6a12(0x17a)])_0x7dc96b['id']=_0xec5115[_0x2f6a12(0x17a)];if(_0xec5115?.[_0x2f6a12(0x1ba)]!=null)_0x7dc96b[_0x2f6a12(0x1ba)]=_0xec5115[_0x2f6a12(0x1ba)];if(_0x49b046)_0x7dc96b[_0x2f6a12(0x184)]=_0x49b046;if(_0x5530ba['type']===_0x2f6a12(0x19e)){const _0x1f2083=_0x5530ba[_0x2f6a12(0x1c5)];if(!_0x1f2083||!_0x5530ba[_0x2f6a12(0x19b)]||!_0x5530ba[_0x2f6a12(0x185)])throw CliErrors[_0x2f6a12(0x18c)](_0x2f6a12(0x1c0)+_0x5530ba[_0x2f6a12(0x1a0)]);const _0x132229=_0x200d00[_0x2f6a12(0x1ac)][_0x2f6a12(0x1ab)](_0x1f2083)??_0xec5115?.[_0x2f6a12(0x1c4)]??_0x1f2083,_0x2a6458=_0x200d00[_0x2f6a12(0x1b4)]['get'](_0x132229);if(!_0x2a6458)throw CliErrors['validation'](_0x2f6a12(0x1b7)+_0x1f2083+_0x2f6a12(0x1a9)+(_0x2f6a12(0x181)+CLI_BIN_NAME+_0x2f6a12(0x187)));_0x7dc96b['datasetId']=_0x2a6458['id'],_0x7dc96b[_0x2f6a12(0x19b)]=_0x5530ba[_0x2f6a12(0x19b)],_0x7dc96b[_0x2f6a12(0x185)]=_0x5530ba[_0x2f6a12(0x185)];}const _0x4389b8=await saveBffScript(_0x7dc96b),_0x2f5cb7=_0x4389b8['id'],_0x378342=_0x4389b8['script']??await getBffScriptInfo(_0x2f5cb7),_0x2a2673={'hash':_0x39dbe0,'remoteId':_0x2f5cb7,'version':_0x378342[_0x2f6a12(0x1ba)]};if(_0x5530ba['type']===_0x2f6a12(0x19e)){const _0x2b444f=_0x5530ba[_0x2f6a12(0x1c5)],_0x16021a=_0x200d00['aliasToDatasetCode'][_0x2f6a12(0x1ab)](_0x2b444f)??_0xec5115?.[_0x2f6a12(0x1c4)]??_0x2b444f;_0x200d00[_0x2f6a12(0x1ac)][_0x2f6a12(0x17d)](_0x2b444f)?_0x2a2673[_0x2f6a12(0x1c5)]=_0x2b444f:_0x2a2673[_0x2f6a12(0x1c5)]=_0xec5115?.[_0x2f6a12(0x1c5)],_0x2a2673['datasetCode']=_0x16021a,_0x2a2673['operationType']=_0x5530ba['operationType'],_0x2a2673[_0x2f6a12(0x185)]=_0x5530ba[_0x2f6a12(0x185)];}_0xa31b4[_0x2f6a12(0x18e)][_0x5530ba[_0x2f6a12(0x1a0)]]=_0x2a2673;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0xfd6763,_0x5ccc53,_0x58bf32){const _0x38a9c3=a36_0x55ae30;if(_0x58bf32[_0x38a9c3(0x1c8)]===0x0)return;for(let _0x35e2c0=0x0;_0x35e2c0<LOCK_SETTLE_RETRY_COUNT;_0x35e2c0+=0x1){const _0xe5f61e=await readBffLockFile(_0xfd6763),_0x4f8fca=_0xe5f61e?.[_0x38a9c3(0x19d)]?.[_0x5ccc53]?.[_0x38a9c3(0x18e)]??{},_0x49f42b=_0x58bf32['every'](_0x30d276=>!!_0x4f8fca[_0x30d276]?.[_0x38a9c3(0x17a)]);if(_0x49f42b)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error('Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20'+_0x58bf32[_0x38a9c3(0x1bc)](',\x20')+'.');}function a36_0x204e(_0x5b8bcb,_0x302ebf){_0x5b8bcb=_0x5b8bcb-0x17a;const _0x72f2c2=a36_0x72f2();let _0x204eaf=_0x72f2c2[_0x5b8bcb];return _0x204eaf;}function a36_0x72f2(){const _0x1e1161=['350540tOUbBv','name','Incomplete\x20HOOK\x20path:\x20','Would\x20inspect\x20','appCode','runtime\x20cache\x20cleared','datasetCode','alias','type','490msITIH','length','8xhDHHq','high-risk-write','lastSync','remoteId','Lock\x20scope\x20for\x20app\x20\x22','cleared','has','lockFilePath','force','COMMON','Run\x20`','update','\x20uploaded,\x20','description','functionNode','Push\x20complete:\x20','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','920748TCVzRy','Local\x20function\x20not\x20found:\x20','string','runtime\x20cache\x20not\x20needed','validation','767352GnLdTt','functions','values','\x22\x20not\x20found\x20after\x20ensureLockScope.','message','Runtime\x20script\x20cache\x20cleared.','No\x20local\x20BFF\x20functions\x20found.','bool','code','\x20skipped,\x20','\x20failed,\x20','Force\x20push\x20ignoring\x20hash\x20protection','/api/management/library/scripts/save','would_push','operationType','utf8','apps','HOOK','20211HAIFnB','lockKey','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','some','stringify','ENDPOINT','create','filePath','8GVcoTP','toISOString','\x22.\x20','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','get','aliasToDatasetCode','13401fyoQLm','732389IoaTht','map',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','130653bTLyZW','unchanged','boolean','datasetCodeToDataset','push','hash','Cannot\x20resolve\x20dataset\x20for\x20\x22','filter','parse','version','POST','join','scriptsRoot'];a36_0x72f2=function(){return _0x1e1161;};return a36_0x72f2();}
|
|
1
|
+
const a36_0x15615a=a36_0x202b;(function(_0x14607c,_0x647575){const _0x53fcb2=a36_0x202b,_0x333d90=_0x14607c();while(!![]){try{const _0xdd5e1b=-parseInt(_0x53fcb2(0xb6))/0x1*(parseInt(_0x53fcb2(0xaf))/0x2)+parseInt(_0x53fcb2(0xbe))/0x3*(-parseInt(_0x53fcb2(0x8f))/0x4)+-parseInt(_0x53fcb2(0xc3))/0x5+-parseInt(_0x53fcb2(0xd8))/0x6*(parseInt(_0x53fcb2(0xbf))/0x7)+-parseInt(_0x53fcb2(0xa8))/0x8+parseInt(_0x53fcb2(0x96))/0x9+parseInt(_0x53fcb2(0xb8))/0xa;if(_0xdd5e1b===_0x647575)break;else _0x333d90['push'](_0x333d90['shift']());}catch(_0x26ffde){_0x333d90['push'](_0x333d90['shift']());}}}(a36_0x4239,0x6adbb));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';function a36_0x202b(_0xc2635f,_0x500cb1){_0xc2635f=_0xc2635f-0x8f;const _0x42390e=a36_0x4239();let _0x202bf6=_0x42390e[_0xc2635f];return _0x202bf6;}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';function a36_0x4239(){const _0x43e7e5=['2165406AjbFTh','script','map','would_push','alias','Run\x20`','lastSync','values','create','type','Lock\x20scope\x20for\x20app\x20\x22','validation','has','4LhFdmz','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','get','push','\x20failed,\x20','/api/management/library/scripts/save','\x22\x20not\x20found\x20after\x20ensureLockScope.','49554xkOIsj','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','set','datasetCode','boolean','scriptsRoot','stringify','\x20skipped,\x20','filter','length','datasetId','version','filePath','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','POST','str','Local\x20function\x20not\x20found:\x20','update','2094736dXUogM','description','aliasToDatasetCode','remoteId','Runtime\x20script\x20cache\x20cleared.','runtime\x20cache\x20clear\x20failed','attempted','7558ZPzXbP','Incomplete\x20HOOK\x20path:\x20','\x22.\x20','high-risk-write','Push\x20only\x20this\x20script\x20type','status','appCode','13nLDPXl','Push\x20local\x20BFF\x20scripts\x20to\x20remote','25878590IMKWVO','operationType','utf8','HOOK','Cannot\x20resolve\x20dataset\x20for\x20\x22','message','2625516LnGCjP','7AXoCtC','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','Push\x20complete:\x20','bool','3043160EvbcGm','functionNode','\x20uploaded,\x20','apiDir','lockKey','force','some','ENDPOINT',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','cleared','lockFilePath','string','apps','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','name','code','functions','unchanged','No\x20local\x20BFF\x20functions\x20found.','Would\x20inspect\x20','runtime\x20cache\x20cleared'];a36_0x4239=function(){return _0x43e7e5;};return a36_0x4239();}const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':a36_0x15615a(0x92),'description':a36_0x15615a(0xb7),'risk':a36_0x15615a(0xb2),'flags':[{'name':a36_0x15615a(0xe1),'type':a36_0x15615a(0xce),'description':a36_0x15615a(0xb3),'enum':['COMMON',a36_0x15615a(0xca),'HOOK']},{'name':'name','type':a36_0x15615a(0xce),'description':a36_0x15615a(0xc0)},{'name':a36_0x15615a(0xc8),'type':a36_0x15615a(0x9a),'description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x4197c2){const _0x26756f=a36_0x15615a,_0x1573a6=loadBffProjectConfig(_0x4197c2[_0x26756f(0xb5)]),_0x3d8ce8=await readBffLockFile(_0x1573a6['lockFilePath']),{appLock:_0x5505ec}=ensureLockScope(_0x3d8ce8??createEmptyBffLock(),_0x4197c2[_0x26756f(0xb5)],_0x1573a6[_0x26756f(0x9b)],_0x26756f(0x92)),_0x113a19=await getTargetFunctions(_0x1573a6,_0x4197c2),_0x275021=_0x4197c2[_0x26756f(0xc2)]('force'),_0x5d2e83=[];for(const _0x5d170d of _0x113a19){const _0x5eb78c=await computeFileHash(_0x5d170d[_0x26756f(0xa2)]),_0x29a958=_0x5505ec[_0x26756f(0xd3)][_0x5d170d[_0x26756f(0xc7)]],_0x1bc963=!!_0x29a958&&_0x29a958['hash']===_0x5eb78c;_0x5d2e83[_0x26756f(0x92)]({'lockKey':_0x5d170d['lockKey'],'filePath':_0x5d170d[_0x26756f(0xa2)],'remoteId':_0x29a958?.['remoteId']??null,'mode':_0x29a958?.[_0x26756f(0xab)]?_0x26756f(0xa7):_0x26756f(0xe0),'status':!_0x275021&&_0x1bc963?_0x26756f(0xd4):_0x26756f(0xdb)});}return{'method':_0x26756f(0xa4),'url':_0x26756f(0x94),'body':{'appCode':_0x4197c2['appCode'],'force':_0x275021,'files':_0x5d2e83,'cacheClearAtRuntime':_0x5d2e83[_0x26756f(0xc9)](_0x4d75d5=>_0x4d75d5[_0x26756f(0xb4)]===_0x26756f(0xdb)),'cacheClearAtRuntimeTimes':_0x5d2e83[_0x26756f(0xc9)](_0x22f2ec=>_0x22f2ec[_0x26756f(0xb4)]===_0x26756f(0xdb))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x26756f(0xd6)+_0x5d2e83[_0x26756f(0x9f)]+_0x26756f(0x97)};},async 'execute'(_0x2e5f57){const _0x29f29c=a36_0x15615a,_0x5d2da5=loadBffProjectConfig(_0x2e5f57[_0x29f29c(0xb5)]),_0x4ffb1f=await readBffLockFile(_0x5d2da5[_0x29f29c(0xcd)]),{lockData:_0x47a73e,appLock:_0x202353}=ensureLockScope(_0x4ffb1f??createEmptyBffLock(),_0x2e5f57[_0x29f29c(0xb5)],_0x5d2da5['scriptsRoot'],_0x29f29c(0x92)),_0x5693ac=await getTargetFunctions(_0x5d2da5,_0x2e5f57);if(_0x5693ac[_0x29f29c(0x9f)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x29f29c(0xd5)};const _0x18e0b0=_0x2e5f57[_0x29f29c(0xc2)](_0x29f29c(0xc8)),_0xb7a93f=JSON['parse'](JSON[_0x29f29c(0x9c)](_0x47a73e)),_0x54f78f=_0xb7a93f['apps'][_0x2e5f57[_0x29f29c(0xb5)]];if(!_0x54f78f)throw new Error(_0x29f29c(0xe2)+_0x2e5f57[_0x29f29c(0xb5)]+_0x29f29c(0x95));const _0x21d7c3=await buildHookMaps(_0x2e5f57[_0x29f29c(0xb5)],_0x2e5f57[_0x29f29c(0xc6)],_0x5693ac,_0x54f78f),_0x4c7736=[],_0x6ffd0e=[],_0x190b30=[];for(const _0x3c71a4 of _0x5693ac){const _0x5d1ad1=await computeFileHash(_0x3c71a4[_0x29f29c(0xa2)]),_0x364394=_0x54f78f[_0x29f29c(0xd3)][_0x3c71a4[_0x29f29c(0xc7)]];if(!_0x18e0b0&&_0x364394&&_0x364394['hash']===_0x5d1ad1){_0x6ffd0e['push']({'lockKey':_0x3c71a4[_0x29f29c(0xc7)],'reason':_0x29f29c(0xd4)});continue;}try{await uploadSingleFunction(_0x2e5f57[_0x29f29c(0xb5)],_0x3c71a4,_0x54f78f,_0x21d7c3);const _0x470f59=_0x54f78f[_0x29f29c(0xd3)][_0x3c71a4[_0x29f29c(0xc7)]];_0x4c7736[_0x29f29c(0x92)]({'lockKey':_0x3c71a4[_0x29f29c(0xc7)],'remoteId':_0x470f59?.[_0x29f29c(0xab)]??0x0});}catch(_0x3cb391){_0x190b30['push']({'lockKey':_0x3c71a4[_0x29f29c(0xc7)],'error':_0x3cb391 instanceof Error?_0x3cb391[_0x29f29c(0xbd)]:String(_0x3cb391)});}}_0x54f78f[_0x29f29c(0xde)]=new Date()['toISOString'](),await writeBffLockFile(_0x5d2da5[_0x29f29c(0xcd)],_0xb7a93f),await waitForUploadedLockEntries(_0x5d2da5[_0x29f29c(0xcd)],_0x2e5f57[_0x29f29c(0xb5)],_0x4c7736[_0x29f29c(0xda)](_0x35c78b=>_0x35c78b[_0x29f29c(0xc7)]));let _0x169aee={'attempted':![],'cleared':![]};if(_0x4c7736[_0x29f29c(0x9f)]>0x0)try{let _0xa9a1f5='';for(let _0x35fa25=0x0;_0x35fa25<CACHE_CLEAR_ATTEMPTS;_0x35fa25+=0x1){_0xa9a1f5=await clearBffScriptCache(),_0x35fa25<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x169aee={'attempted':!![],'cleared':!![],'message':_0xa9a1f5||_0x29f29c(0xac)};}catch(_0x255df1){_0x169aee={'attempted':!![],'cleared':![],'error':_0x255df1 instanceof Error?_0x255df1['message']:String(_0x255df1)};}const _0x14a3c0=_0x190b30[_0x29f29c(0x9f)]===0x0&&(_0x169aee['attempted']?_0x169aee['cleared']:!![]),_0x4f8908=_0x169aee[_0x29f29c(0xae)]?_0x169aee[_0x29f29c(0xcc)]?_0x29f29c(0xd7):_0x29f29c(0xad):'runtime\x20cache\x20not\x20needed';return{'ok':_0x14a3c0,'data':{'uploaded':_0x4c7736,'skipped':_0x6ffd0e,'failed':_0x190b30,'cacheClear':_0x169aee},'message':_0x29f29c(0xc1)+_0x4c7736[_0x29f29c(0x9f)]+_0x29f29c(0xc5)+_0x6ffd0e['length']+_0x29f29c(0x9d)+_0x190b30[_0x29f29c(0x9f)]+_0x29f29c(0x93)+_0x4f8908};}};async function getTargetFunctions(_0x5576a6,_0x258dd7){const _0x28743c=a36_0x15615a,_0x4343ca=_0x258dd7[_0x28743c(0xa5)](_0x28743c(0xe1)),_0x2fbd08=_0x258dd7[_0x28743c(0xa5)](_0x28743c(0xd1)),_0x2fc04e=normalizeBffType(_0x4343ca)??undefined;if(_0x2fbd08&&!_0x2fc04e)throw CliErrors['validation'](_0x28743c(0x90));const _0x17ea5d=await scanLocalBffFunctions(_0x5576a6,_0x2fc04e);if(_0x2fbd08){const _0x57ed5a=_0x17ea5d[_0x28743c(0x9e)](_0x1b974d=>_0x1b974d[_0x28743c(0xd1)]===_0x2fbd08);if(_0x57ed5a[_0x28743c(0x9f)]===0x0)throw CliErrors['validation'](_0x28743c(0xa6)+_0x2fc04e+'/'+_0x2fbd08);return _0x57ed5a;}return _0x17ea5d;}async function buildHookMaps(_0x390576,_0x2c1c2f,_0x1601a8,_0x5ae88f){const _0x24bf7d=a36_0x15615a,_0x1be2dc=_0x1601a8[_0x24bf7d(0xc9)](_0x11b7c5=>_0x11b7c5[_0x24bf7d(0xe1)]==='HOOK');if(!_0x1be2dc)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x33af9c=loadAliasMap(_0x2c1c2f,undefined,resolveApiFilePath(_0x2c1c2f,_0x390576)),_0x2c0e80=new Map(_0x33af9c['map'](_0x26c12b=>[_0x26c12b[_0x24bf7d(0xdc)],_0x26c12b['datasetCode']]));for(const _0x552a15 of Object[_0x24bf7d(0xdf)](_0x5ae88f[_0x24bf7d(0xd3)])){_0x552a15['alias']&&_0x552a15[_0x24bf7d(0x99)]&&!_0x2c0e80[_0x24bf7d(0xe4)](_0x552a15[_0x24bf7d(0xdc)])&&_0x2c0e80[_0x24bf7d(0x98)](_0x552a15[_0x24bf7d(0xdc)],_0x552a15[_0x24bf7d(0x99)]);}const _0x3239f8=await listDatasets(_0x390576),_0x49bc4d=new Map(_0x3239f8[_0x24bf7d(0xda)](_0x3215bd=>[_0x3215bd[_0x24bf7d(0xd2)],_0x3215bd]));return{'aliasToDatasetCode':_0x2c0e80,'datasetCodeToDataset':_0x49bc4d};}async function uploadSingleFunction(_0x42b889,_0x1e8391,_0x50beda,_0x4b41a0){const _0x3176d0=a36_0x15615a,_0x1b096e=await readFile(_0x1e8391[_0x3176d0(0xa2)],_0x3176d0(0xba)),_0x55979e=await computeFileHash(_0x1e8391[_0x3176d0(0xa2)]),_0x568d4e=_0x50beda[_0x3176d0(0xd3)][_0x1e8391[_0x3176d0(0xc7)]];if(_0x568d4e?.['remoteId']&&_0x568d4e[_0x3176d0(0xa1)]==null)throw CliErrors['validation'](_0x1e8391[_0x3176d0(0xc7)]+_0x3176d0(0xcb));let _0x3e6811=extractScriptDescription(_0x1b096e);if(!_0x3e6811&&_0x568d4e?.[_0x3176d0(0xab)]){const _0x5f3861=await getBffScriptInfo(_0x568d4e['remoteId']);_0x3e6811=_0x5f3861['description']||undefined;}const _0x142351={'appCode':_0x42b889,'functionName':_0x1e8391['name'],'scriptType':_0x1e8391['type'],'scriptContent':_0x1b096e};if(_0x568d4e?.[_0x3176d0(0xab)])_0x142351['id']=_0x568d4e[_0x3176d0(0xab)];if(_0x568d4e?.[_0x3176d0(0xa1)]!=null)_0x142351[_0x3176d0(0xa1)]=_0x568d4e[_0x3176d0(0xa1)];if(_0x3e6811)_0x142351[_0x3176d0(0xa9)]=_0x3e6811;if(_0x1e8391['type']===_0x3176d0(0xbb)){const _0x4efc2d=_0x1e8391[_0x3176d0(0xdc)];if(!_0x4efc2d||!_0x1e8391[_0x3176d0(0xb9)]||!_0x1e8391['functionNode'])throw CliErrors['validation'](_0x3176d0(0xb0)+_0x1e8391[_0x3176d0(0xc7)]);const _0x14314b=_0x4b41a0[_0x3176d0(0xaa)][_0x3176d0(0x91)](_0x4efc2d)??_0x568d4e?.[_0x3176d0(0x99)]??_0x4efc2d,_0x2c9b50=_0x4b41a0['datasetCodeToDataset']['get'](_0x14314b);if(!_0x2c9b50)throw CliErrors[_0x3176d0(0xe3)](_0x3176d0(0xbc)+_0x4efc2d+_0x3176d0(0xb1)+(_0x3176d0(0xdd)+CLI_BIN_NAME+_0x3176d0(0xd0)));_0x142351[_0x3176d0(0xa0)]=_0x2c9b50['id'],_0x142351[_0x3176d0(0xb9)]=_0x1e8391['operationType'],_0x142351[_0x3176d0(0xc4)]=_0x1e8391[_0x3176d0(0xc4)];}const _0x2cdf66=await saveBffScript(_0x142351),_0x458b08=_0x2cdf66['id'],_0x52cd27=_0x2cdf66[_0x3176d0(0xd9)]??await getBffScriptInfo(_0x458b08),_0x57530a={'hash':_0x55979e,'remoteId':_0x458b08,'version':_0x52cd27[_0x3176d0(0xa1)]};if(_0x1e8391[_0x3176d0(0xe1)]===_0x3176d0(0xbb)){const _0x35455b=_0x1e8391['alias'],_0x5816c9=_0x4b41a0[_0x3176d0(0xaa)][_0x3176d0(0x91)](_0x35455b)??_0x568d4e?.[_0x3176d0(0x99)]??_0x35455b;_0x4b41a0['aliasToDatasetCode'][_0x3176d0(0xe4)](_0x35455b)?_0x57530a['alias']=_0x35455b:_0x57530a[_0x3176d0(0xdc)]=_0x568d4e?.[_0x3176d0(0xdc)],_0x57530a['datasetCode']=_0x5816c9,_0x57530a[_0x3176d0(0xb9)]=_0x1e8391[_0x3176d0(0xb9)],_0x57530a[_0x3176d0(0xc4)]=_0x1e8391['functionNode'];}_0x50beda['functions'][_0x1e8391[_0x3176d0(0xc7)]]=_0x57530a;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x31d28c,_0x3403cb,_0x55e5a3){const _0x6f26d1=a36_0x15615a;if(_0x55e5a3['length']===0x0)return;for(let _0x5b9241=0x0;_0x5b9241<LOCK_SETTLE_RETRY_COUNT;_0x5b9241+=0x1){const _0x3cc510=await readBffLockFile(_0x31d28c),_0x5b29ef=_0x3cc510?.[_0x6f26d1(0xcf)]?.[_0x3403cb]?.['functions']??{},_0xe6df58=_0x55e5a3['every'](_0x41af13=>!!_0x5b29ef[_0x41af13]?.[_0x6f26d1(0xab)]);if(_0xe6df58)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x6f26d1(0xa3)+_0x55e5a3['join'](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a37_0x504a(_0x27636b,_0x1816ed){_0x27636b=_0x27636b-0x196;const _0x511a7a=a37_0x511a();let _0x504ab4=_0x511a7a[_0x27636b];return _0x504ab4;}const a37_0x5098fe=a37_0x504a;(function(_0x130125,_0x52cde4){const _0x40e2c8=a37_0x504a,_0x2e0afe=_0x130125();while(!![]){try{const _0x38cd42=parseInt(_0x40e2c8(0x19b))/0x1+parseInt(_0x40e2c8(0x1b1))/0x2+parseInt(_0x40e2c8(0x1b5))/0x3*(parseInt(_0x40e2c8(0x198))/0x4)+parseInt(_0x40e2c8(0x1b3))/0x5+parseInt(_0x40e2c8(0x19f))/0x6*(-parseInt(_0x40e2c8(0x196))/0x7)+-parseInt(_0x40e2c8(0x1ae))/0x8+parseInt(_0x40e2c8(0x1b4))/0x9*(-parseInt(_0x40e2c8(0x1aa))/0xa);if(_0x38cd42===_0x52cde4)break;else _0x2e0afe['push'](_0x2e0afe['shift']());}catch(_0x469fdf){_0x2e0afe['push'](_0x2e0afe['shift']());}}}(a37_0x511a,0x55e2c));function a37_0x511a(){const _0xca460a=['all','634699YgGncL','filePath','map','scriptsRoot','6EJyllh','appCode','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','apiDir','All\x20BFF\x20scripts\x20are\x20in\x20sync.','datasetCode','\x20added,\x20','\x20remote-only','lockKey','length','remote','10evDmFj','hash','lockFilePath','alias','5239624xziBKZ','read','bool','754944BUvMzC','push','2241350CQlJMO','4678794phrYsI','16707GOzasp','has','\x20modified,\x20','status','2148699GbWBYh','\x20unchanged','268moYLLt','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally'];a37_0x511a=function(){return _0xca460a;};return a37_0x511a();}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,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_0x5098fe(0x1b8),'description':a37_0x5098fe(0x1a1),'risk':a37_0x5098fe(0x1af),'flags':[{'name':'remote','type':'boolean','description':a37_0x5098fe(0x199)}],async 'execute'(_0x3cbbc1){const _0x386fbb=a37_0x5098fe,_0x2b9970=loadBffProjectConfig(_0x3cbbc1[_0x386fbb(0x1a0)]),_0x2561ac=await readBffLockFile(_0x2b9970[_0x386fbb(0x1ac)]),{appLock:_0x22f80c}=ensureLockScope(_0x2561ac??createEmptyBffLock(),_0x3cbbc1[_0x386fbb(0x1a0)],_0x2b9970[_0x386fbb(0x19e)],_0x386fbb(0x1b8)),_0x1481de=await scanLocalBffFunctions(_0x2b9970),_0x34192a=[],_0x108cf9=[],_0x3a44f5=[];for(const _0x16d321 of _0x1481de){const _0x37d10b=await computeFileHash(_0x16d321[_0x386fbb(0x19c)]),_0x15db01=_0x22f80c['functions'][_0x16d321[_0x386fbb(0x1a7)]];if(!_0x15db01)_0x34192a[_0x386fbb(0x1b2)](_0x16d321['lockKey']);else _0x15db01[_0x386fbb(0x1ab)]!==_0x37d10b?_0x108cf9[_0x386fbb(0x1b2)](_0x16d321[_0x386fbb(0x1a7)]):_0x3a44f5['push'](_0x16d321['lockKey']);}const _0x543fae=[];if(_0x3cbbc1[_0x386fbb(0x1b0)](_0x386fbb(0x1a9))){const _0x4f9743=loadAliasMap(_0x3cbbc1[_0x386fbb(0x1a2)],undefined,resolveApiFilePath(_0x3cbbc1[_0x386fbb(0x1a2)],_0x3cbbc1[_0x386fbb(0x1a0)])),_0x4129ad=new Map(_0x4f9743[_0x386fbb(0x19d)](_0x385fb8=>[_0x385fb8[_0x386fbb(0x1a4)],_0x385fb8[_0x386fbb(0x1ad)]])),[_0x3339c8,_0x3be78d]=await Promise[_0x386fbb(0x19a)]([listBffScripts(_0x3cbbc1[_0x386fbb(0x1a0)]),getBffScriptStatistics(_0x3cbbc1['appCode'])]),_0x6c2991=createHookLocationMap(_0x3be78d),_0x31f2e1=new Set(_0x1481de[_0x386fbb(0x19d)](_0x257ee9=>_0x257ee9[_0x386fbb(0x1a7)]));for(const _0x4de8b4 of _0x3339c8){const _0x110b1e=resolveRemoteScriptTarget(_0x2b9970,_0x4de8b4,_0x6c2991,_0x22f80c['functions'],_0x4129ad);_0x110b1e&&!_0x31f2e1[_0x386fbb(0x1b6)](_0x110b1e[_0x386fbb(0x1a7)])&&_0x543fae[_0x386fbb(0x1b2)](_0x110b1e[_0x386fbb(0x1a7)]);}}const _0x2e865d=_0x34192a[_0x386fbb(0x1a8)]===0x0&&_0x108cf9['length']===0x0&&_0x543fae[_0x386fbb(0x1a8)]===0x0;return{'ok':!![],'data':{'added':_0x34192a,'modified':_0x108cf9,'unchanged':_0x3a44f5,'remoteOnly':_0x543fae},'message':_0x2e865d?_0x386fbb(0x1a3):_0x34192a[_0x386fbb(0x1a8)]+_0x386fbb(0x1a5)+_0x108cf9['length']+_0x386fbb(0x1b7)+_0x3a44f5[_0x386fbb(0x1a8)]+_0x386fbb(0x197)+(_0x543fae[_0x386fbb(0x1a8)]>0x0?',\x20'+_0x543fae[_0x386fbb(0x1a8)]+_0x386fbb(0x1a6):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0xe91ce1=a38_0x1107;(function(_0x332f7b,_0xa28e66){const _0x53f51f=a38_0x1107,_0x406870=_0x332f7b();while(!![]){try{const _0x277552=-parseInt(_0x53f51f(0x1f0))/0x1*(-parseInt(_0x53f51f(0x1e4))/0x2)+parseInt(_0x53f51f(0x1ed))/0x3*(-parseInt(_0x53f51f(0x1ec))/0x4)+-parseInt(_0x53f51f(0x1e5))/0x5*(parseInt(_0x53f51f(0x1ef))/0x6)+parseInt(_0x53f51f(0x1ea))/0x7+-parseInt(_0x53f51f(0x1eb))/0x8*(-parseInt(_0x53f51f(0x1f5))/0x9)+parseInt(_0x53f51f(0x1fb))/0xa*(parseInt(_0x53f51f(0x1dc))/0xb)+-parseInt(_0x53f51f(0x1f7))/0xc;if(_0x277552===_0xa28e66)break;else _0x406870['push'](_0x406870['shift']());}catch(_0x28b1bf){_0x406870['push'](_0x406870['shift']());}}}(a38_0x19a6,0xe8edb));import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';function a38_0x1107(_0x272afd,_0x54f84f){_0x272afd=_0x272afd-0x1d9;const _0x19a60a=a38_0x19a6();let _0x1107ae=_0x19a60a[_0x272afd];return _0x1107ae;}function a38_0x19a6(){const _0x4e7703=['cwd','10yunTxk','cli-skill','pipe','info','CLI\x20Built-in\x20Skill\x20','14545729UibQue','\x20installed','Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20','repairCommand','installedPath','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','cli-skill-install','changed','4018WjifpV','15BnLoVx','log','skillVersion','\x20is\x20already\x20current','apiError','7758219HFwslz','320qbYQOd','4MrcXam','4292790nmMpnj','install','267390JcoZaG','617CuSzfJ','Built-in\x20Skill\x20install\x20failed\x20[','code',']:\x20','\x20at\x20','183672EjZmYy','read','23613948QauMPa','unknown','setLogPath'];a38_0x19a6=function(){return _0x4e7703;};return a38_0x19a6();}import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a38_0xe91ce1(0x1fc),'command':a38_0xe91ce1(0x1ee),'description':a38_0xe91ce1(0x1e1),'risk':a38_0xe91ce1(0x1f6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x41c768){const _0x595658=a38_0xe91ce1;logger[_0x595658(0x1f9)](process[_0x595658(0x1fa)]()),logger[_0x595658(0x1da)](_0x595658(0x1e2),'Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.');const _0x21224b=installBuiltinSkill({'stdio':_0x41c768['nonInteractive']?_0x595658(0x1d9):'inherit'});if(!_0x21224b['ok'])throw CliErrors[_0x595658(0x1e9)](_0x595658(0x1f1)+_0x21224b[_0x595658(0x1f2)]+_0x595658(0x1f3)+(_0x21224b['error']||_0x595658(0x1f8)),_0x595658(0x1de)+_0x21224b[_0x595658(0x1df)]);return console[_0x595658(0x1e6)](_0x21224b[_0x595658(0x1e3)]?_0x595658(0x1db)+_0x21224b[_0x595658(0x1e7)]+_0x595658(0x1dd)+(_0x21224b[_0x595658(0x1e0)]?'\x20at\x20'+_0x21224b['installedPath']:'\x20via\x20skills@latest'):'CLI\x20Built-in\x20Skill\x20'+_0x21224b[_0x595658(0x1e7)]+_0x595658(0x1e8)+(_0x21224b[_0x595658(0x1e0)]?_0x595658(0x1f4)+_0x21224b[_0x595658(0x1e0)]:'')),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0x2ad843=a39_0x1a85;(function(_0x21d668,_0xc67619){const _0x49105c=a39_0x1a85,_0x7cb0e3=_0x21d668();while(!![]){try{const _0x2ce657=parseInt(_0x49105c(0x224))/0x1*(-parseInt(_0x49105c(0x22a))/0x2)+-parseInt(_0x49105c(0x203))/0x3+-parseInt(_0x49105c(0x1f5))/0x4*(-parseInt(_0x49105c(0x1fe))/0x5)+-parseInt(_0x49105c(0x1f4))/0x6+parseInt(_0x49105c(0x217))/0x7+-parseInt(_0x49105c(0x22b))/0x8+parseInt(_0x49105c(0x223))/0x9*(parseInt(_0x49105c(0x1f8))/0xa);if(_0x2ce657===_0xc67619)break;else _0x7cb0e3['push'](_0x7cb0e3['shift']());}catch(_0x348f00){_0x7cb0e3['push'](_0x7cb0e3['shift']());}}}(a39_0x9d13,0x7a814));import a39_0x476aa0 from'chalk';import a39_0x392902 from'ora';function a39_0x1a85(_0x126a81,_0x2db9b8){_0x126a81=_0x126a81-0x1e1;const _0x9d1372=a39_0x9d13();let _0x1a8563=_0x9d1372[_0x126a81];return _0x1a8563;}import a39_0x54f4ee 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 getCurrentVersion(){const _0x18eeaa=a39_0x1a85;return GIT_COMMIT!==_0x18eeaa(0x1eb)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x18eeaa(0x1f9)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x24eff8=a39_0x1a85,_0x4c15c8=process['execPath']['toLowerCase']();if(_0x4c15c8['includes'](_0x24eff8(0x1ed)))return'bun';return _0x24eff8(0x1f0);}const updateFlags=[{'name':a39_0x2ad843(0x207),'type':'boolean','description':a39_0x2ad843(0x202),'default':![]},{'name':'version','type':a39_0x2ad843(0x225),'description':a39_0x2ad843(0x20e)}];function getRequestedVersion(_0x3df882){const _0x74a468=a39_0x2ad843;return _0x3df882[_0x74a468(0x21a)]('version')[_0x74a468(0x1e1)]();}async function validateUpdateFlags(_0x30bb7d){const _0xb9c4cf=a39_0x2ad843,_0x335987=_0x30bb7d[_0xb9c4cf(0x1fa)]('beta'),_0x2c8fb2=getRequestedVersion(_0x30bb7d);if(_0x335987&&_0x2c8fb2)throw CliErrors[_0xb9c4cf(0x228)](_0xb9c4cf(0x1fb),_0xb9c4cf(0x205));if(_0x2c8fb2&&!a39_0x54f4ee[_0xb9c4cf(0x209)](_0x2c8fb2))throw CliErrors['validation'](_0xb9c4cf(0x1f6)+_0x2c8fb2,_0xb9c4cf(0x21f));}async function fetchNpmDistTags(){const _0x581718=a39_0x2ad843;try{const _0x401f15=await fetch('https://registry.npmjs.org/-/package/'+encodeURIComponent(NPM_PACKAGE_NAME)+_0x581718(0x1e3),{'signal':AbortSignal[_0x581718(0x20f)](0x2710)});if(!_0x401f15['ok'])return null;const _0x54aeb3=await _0x401f15['json']();if(!_0x54aeb3||typeof _0x54aeb3!==_0x581718(0x213))return null;return Object[_0x581718(0x21e)](Object[_0x581718(0x210)](_0x54aeb3)[_0x581718(0x1f7)](([,_0x5292b8])=>typeof _0x5292b8===_0x581718(0x225)&&_0x5292b8[_0x581718(0x1e1)]()[_0x581718(0x1ea)]>0x0)[_0x581718(0x222)](([_0xa29aa5,_0x52bc5f])=>[_0xa29aa5,String(_0x52bc5f)['trim']()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x4d4f7f){const _0x4b0f8c=await fetchNpmDistTags();return _0x4b0f8c?.[_0x4d4f7f]??null;}async function fetchLatestVersion(){const _0x427dc3=a39_0x2ad843;return fetchNpmDistTagVersion(_0x427dc3(0x1ef));}function a39_0x9d13(){const _0x190467=['error','Current\x20version:\x20','trim','\x20\x20Run\x20manually:\x20','/dist-tags','Updating\x20via\x20',',\x20found\x20','red','gray','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','succeed','length','unknown','\x20\x20CLI\x20Built-in\x20Skill\x20','bun','warn','latest','npm','start','\x20install\x20-g\x20','state','551976vWzIlq','16VXmrbV','Invalid\x20version:\x20','filter','7740690IYzvxl','slice','bool','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','version','Beta\x20version:\x20','70EFntuO','Updated\x20to\x20v','skillVersion','\x20→\x20','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','2185128JsVISd','Update\x20failed','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','pipe','beta','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','valid','\x20\x20Try\x20manually:\x20','run','Version\x20comparison\x20failed','install','Install\x20a\x20specific\x20CLI\x20version','timeout','entries','\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20','log','object','green','current','yellow','3080273wytGcw','...','source','str','fail','expected\x20','\x20is\x20up\x20to\x20date.','fromEntries','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.',']:\x20','read','map','27ptukYe','677FlPuIB','string','Update\x20available:\x20','code','validation','info','1998lkQEzD','6110616vXnodF','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm'];a39_0x9d13=function(){return _0x190467;};return a39_0x9d13();}async function resolveTargetVersion(_0x2e4709){const _0x38e69d=a39_0x2ad843,_0x4b8274=getRequestedVersion(_0x2e4709);if(_0x4b8274)return{'version':_0x4b8274,'source':_0x38e69d(0x1fc)};if(_0x2e4709[_0x38e69d(0x1fa)](_0x38e69d(0x207))){const _0x47fadf=await fetchNpmDistTagVersion(_0x38e69d(0x207));if(!_0x47fadf)return null;return{'version':_0x47fadf,'source':_0x38e69d(0x207)};}const _0xbeb460=await fetchLatestVersion();if(!_0xbeb460)return null;return{'version':_0xbeb460,'source':_0x38e69d(0x1ef)};}function shouldInstallTarget(_0x50cb59,_0x105f16){const _0x37a509=a39_0x2ad843;if(_0x105f16[_0x37a509(0x219)]===_0x37a509(0x1fc)||_0x105f16[_0x37a509(0x219)]===_0x37a509(0x207))return!a39_0x54f4ee['eq'](_0x50cb59,_0x105f16[_0x37a509(0x1fc)]);return a39_0x54f4ee['lt'](_0x50cb59,_0x105f16[_0x37a509(0x1fc)]);}function getInstallPlanLabel(_0x42c424,_0x24bcb6){const _0x512572=a39_0x2ad843;switch(_0x24bcb6[_0x512572(0x219)]){case _0x512572(0x207):return _0x512572(0x1fd)+a39_0x476aa0[_0x512572(0x216)](_0x42c424)+_0x512572(0x201)+a39_0x476aa0[_0x512572(0x214)](_0x24bcb6[_0x512572(0x1fc)]);case _0x512572(0x1fc):return'Requested\x20version:\x20'+a39_0x476aa0[_0x512572(0x216)](_0x42c424)+'\x20→\x20'+a39_0x476aa0[_0x512572(0x214)](_0x24bcb6[_0x512572(0x1fc)]);case _0x512572(0x1ef):default:return _0x512572(0x226)+a39_0x476aa0[_0x512572(0x216)](_0x42c424)+'\x20→\x20'+a39_0x476aa0[_0x512572(0x214)](_0x24bcb6[_0x512572(0x1fc)]);}}function repairCurrentBuiltinSkill(){const _0x2b0ac8=a39_0x2ad843;console[_0x2b0ac8(0x212)](a39_0x476aa0[_0x2b0ac8(0x1e7)]('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x4a8f55=installBuiltinSkill();if(_0x4a8f55['ok'])return console[_0x2b0ac8(0x212)](a39_0x476aa0[_0x2b0ac8(0x1e7)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x4a8f55[_0x2b0ac8(0x200)]+_0x2b0ac8(0x21d))),!![];return console['warn'](a39_0x476aa0[_0x2b0ac8(0x216)]('\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20['+_0x4a8f55[_0x2b0ac8(0x227)]+_0x2b0ac8(0x220)+(_0x4a8f55[_0x2b0ac8(0x22d)]||'unknown'))),console['log'](a39_0x476aa0['gray'](_0x2b0ac8(0x1e2)+CLI_BIN_NAME+'\x20cli-skill\x20install')),![];}function verifyUpdatedBuiltinSkill(_0x3e3503){const _0x43b271=a39_0x2ad843,_0xb850d=inspectInstalledBuiltinSkillVersion(_0x3e3503);if(_0xb850d[_0x43b271(0x1f3)]===_0x43b271(0x215))return console[_0x43b271(0x212)](a39_0x476aa0['gray'](_0x43b271(0x1ec)+_0x3e3503+_0x43b271(0x21d))),!![];const _0x4bcec4=_0xb850d[_0x43b271(0x200)]?'expected\x20'+_0x3e3503+_0x43b271(0x1e5)+_0xb850d['skillVersion']:_0x43b271(0x21c)+_0x3e3503+',\x20state\x20'+_0xb850d[_0x43b271(0x1f3)];return console[_0x43b271(0x1ee)](a39_0x476aa0[_0x43b271(0x216)](_0x43b271(0x211)+_0x4bcec4)),console[_0x43b271(0x212)](a39_0x476aa0[_0x43b271(0x1e7)](_0x43b271(0x1e2)+_0xb850d['repairCommand'])),![];}async function execute(_0x28b220){const _0xdae04f=a39_0x2ad843;await validateUpdateFlags(_0x28b220);const _0x4b4a33=getCurrentVersion();console[_0xdae04f(0x212)](_0xdae04f(0x22e)+_0x4b4a33);const _0x25ac76=a39_0x392902('Checking\x20for\x20updates...')[_0xdae04f(0x1f1)](),_0x3be4d6=await resolveTargetVersion(_0x28b220);if(!_0x3be4d6){const _0x395240=_0x28b220[_0xdae04f(0x1fa)](_0xdae04f(0x207))?_0xdae04f(0x22c):_0xdae04f(0x208);return _0x25ac76[_0xdae04f(0x21b)](_0x395240),console['log'](a39_0x476aa0[_0xdae04f(0x1e7)]('\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x395240};}const _0x20a16c=a39_0x54f4ee[_0xdae04f(0x209)](VERSION),_0x436122=a39_0x54f4ee[_0xdae04f(0x209)](_0x3be4d6[_0xdae04f(0x1fc)]);if(!_0x20a16c||!_0x436122)return _0x25ac76['fail'](_0xdae04f(0x20c)),{'ok':![],'message':_0xdae04f(0x20c)};if(!shouldInstallTarget(_0x20a16c,_0x3be4d6)){const _0x320462=_0x3be4d6[_0xdae04f(0x219)]===_0xdae04f(0x1fc)?'Already\x20on\x20requested\x20version\x20(v'+_0x3be4d6[_0xdae04f(0x1fc)]+')':'Already\x20up\x20to\x20date\x20(v'+_0x3be4d6['version']+')';return _0x25ac76['succeed'](_0x320462),{'ok':repairCurrentBuiltinSkill()};}_0x25ac76[_0xdae04f(0x229)](getInstallPlanLabel(_0x4b4a33,_0x3be4d6));const _0x2d1e15=detectPackageManager(),_0xbd18be=_0x2d1e15===_0xdae04f(0x1f0)?resolveNpmBin(_0xdae04f(0x1f0)):_0x2d1e15,_0x1e0c61=a39_0x392902(_0xdae04f(0x1e4)+_0x2d1e15+_0xdae04f(0x218))['start']();try{return await execa(_0xbd18be,[_0xdae04f(0x20d),'-g',NPM_PACKAGE_NAME+'@'+_0x3be4d6[_0xdae04f(0x1fc)]],{'stdio':_0xdae04f(0x206)}),_0x1e0c61[_0xdae04f(0x1e9)](_0xdae04f(0x1ff)+_0x3be4d6['version']),console[_0xdae04f(0x212)](a39_0x476aa0[_0xdae04f(0x1e7)](_0xdae04f(0x1e8))),{'ok':verifyUpdatedBuiltinSkill(_0x3be4d6[_0xdae04f(0x1fc)])};}catch(_0x5f09f2){return _0x1e0c61['fail'](_0xdae04f(0x204)),console[_0xdae04f(0x22d)](a39_0x476aa0[_0xdae04f(0x1e6)]('\x20\x20'+_0x5f09f2['message'])),console[_0xdae04f(0x212)](a39_0x476aa0[_0xdae04f(0x1e7)](_0xdae04f(0x20a)+_0x2d1e15+_0xdae04f(0x1f2)+NPM_PACKAGE_NAME+'@'+_0x3be4d6[_0xdae04f(0x1fc)])),{'ok':![],'message':_0x5f09f2['message']};}}export const updateDefinition={'service':'update','command':a39_0x2ad843(0x20b),'description':'Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','risk':a39_0x2ad843(0x221),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a39_0x9a45b9=a39_0x56e0;(function(_0xf4ea99,_0x124656){const _0x30054c=a39_0x56e0,_0x45ffa7=_0xf4ea99();while(!![]){try{const _0x384940=parseInt(_0x30054c(0x1bf))/0x1*(parseInt(_0x30054c(0x1a1))/0x2)+parseInt(_0x30054c(0x197))/0x3+-parseInt(_0x30054c(0x1d9))/0x4*(parseInt(_0x30054c(0x1ba))/0x5)+parseInt(_0x30054c(0x1c2))/0x6*(-parseInt(_0x30054c(0x19a))/0x7)+parseInt(_0x30054c(0x1d7))/0x8+parseInt(_0x30054c(0x190))/0x9*(-parseInt(_0x30054c(0x18c))/0xa)+parseInt(_0x30054c(0x19c))/0xb;if(_0x384940===_0x124656)break;else _0x45ffa7['push'](_0x45ffa7['shift']());}catch(_0x4fbf6c){_0x45ffa7['push'](_0x45ffa7['shift']());}}}(a39_0x5490,0x896cf));import a39_0x54ef4d from'chalk';import a39_0x4ee566 from'ora';import a39_0x1819b4 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 getCurrentVersion(){const _0x4250f0=a39_0x56e0;return GIT_COMMIT!==_0x4250f0(0x1c0)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x4250f0(0x1af)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x5d41b8=a39_0x56e0,_0x9bf920=process[_0x5d41b8(0x191)]['toLowerCase']();if(_0x9bf920[_0x5d41b8(0x1cc)](_0x5d41b8(0x192)))return _0x5d41b8(0x192);return _0x5d41b8(0x1c9);}function a39_0x56e0(_0x159bfb,_0x29dd56){_0x159bfb=_0x159bfb-0x184;const _0x5490a6=a39_0x5490();let _0x56e07e=_0x5490a6[_0x159bfb];return _0x56e07e;}const updateFlags=[{'name':a39_0x9a45b9(0x1d4),'type':a39_0x9a45b9(0x1c8),'description':'Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','default':![]},{'name':a39_0x9a45b9(0x18e),'type':a39_0x9a45b9(0x1bb),'description':a39_0x9a45b9(0x189)}];function getRequestedVersion(_0x1c32d4){const _0x211e48=a39_0x9a45b9;return _0x1c32d4[_0x211e48(0x195)](_0x211e48(0x18e))[_0x211e48(0x1a0)]();}async function validateUpdateFlags(_0xc75c0){const _0x1994cc=a39_0x9a45b9,_0x616e64=_0xc75c0[_0x1994cc(0x1c7)](_0x1994cc(0x1d4)),_0x44d06c=getRequestedVersion(_0xc75c0);if(_0x616e64&&_0x44d06c)throw CliErrors[_0x1994cc(0x187)]('--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.',_0x1994cc(0x1ca));if(_0x44d06c&&!a39_0x1819b4[_0x1994cc(0x18a)](_0x44d06c))throw CliErrors[_0x1994cc(0x187)](_0x1994cc(0x1b3)+_0x44d06c,_0x1994cc(0x1d2));}async function fetchNpmDistTags(){const _0x1f1665=a39_0x9a45b9;try{const _0x37b3ac=await fetch(_0x1f1665(0x1cf)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x1f1665(0x1b5),{'signal':AbortSignal[_0x1f1665(0x1c4)](0x2710)});if(!_0x37b3ac['ok'])return null;const _0x3c45bc=await _0x37b3ac[_0x1f1665(0x1ae)]();if(!_0x3c45bc||typeof _0x3c45bc!==_0x1f1665(0x1c3))return null;return Object['fromEntries'](Object[_0x1f1665(0x199)](_0x3c45bc)[_0x1f1665(0x194)](([,_0x1c0588])=>typeof _0x1c0588==='string'&&_0x1c0588[_0x1f1665(0x1a0)]()[_0x1f1665(0x19d)]>0x0)[_0x1f1665(0x1a9)](([_0x411f3f,_0x280877])=>[_0x411f3f,String(_0x280877)[_0x1f1665(0x1a0)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x4116b1){const _0x1b1302=await fetchNpmDistTags();return _0x1b1302?.[_0x4116b1]??null;}function a39_0x5490(){const _0x2235b8=['Beta\x20version:\x20','expected\x20','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','json','slice','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','latest','\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20','Invalid\x20version:\x20','red','/dist-tags','warn','skillVersion','Updating\x20via\x20','run','1945isybwN','string','fail','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','state','1rJkUfP','unknown','\x20\x20Run\x20manually:\x20','12SSZuag','object','timeout','pipe','Update\x20available:\x20','bool','boolean','npm','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','message','includes','Checking\x20for\x20updates...','start','https://registry.npmjs.org/-/package/','read','Requested\x20version:\x20','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','\x20install\x20-g\x20','beta','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','\x20\x20Try\x20manually:\x20','1492400aXFmbC','error','6872aWmOUK','Update\x20failed','\x20is\x20up\x20to\x20date.','info','validation','green','Install\x20a\x20specific\x20CLI\x20version','valid','repairCommand','203430pSOiep','gray','version','yellow','495RacfrE','execPath','bun','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','filter','str','install','890010TTuaPg','@latest','entries','3575362QAHTLM','Updated\x20to\x20v','28496193krgVJz','length',',\x20found\x20','Already\x20up\x20to\x20date\x20(v','trim','595622uKuZlI','succeed','\x20\x20CLI\x20Built-in\x20Skill\x20','\x20→\x20','log','source',']:\x20','...','map','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.'];a39_0x5490=function(){return _0x2235b8;};return a39_0x5490();}async function fetchLatestVersion(){const _0x3204e9=a39_0x9a45b9;return fetchNpmDistTagVersion(_0x3204e9(0x1b1));}async function resolveTargetVersion(_0x41ad3a){const _0x8e903a=a39_0x9a45b9,_0x191da6=getRequestedVersion(_0x41ad3a);if(_0x191da6)return{'version':_0x191da6,'source':_0x8e903a(0x18e)};if(_0x41ad3a[_0x8e903a(0x1c7)]('beta')){const _0x548447=await fetchNpmDistTagVersion('beta');if(!_0x548447)return null;return{'version':_0x548447,'source':_0x8e903a(0x1d4)};}const _0x560e6b=await fetchLatestVersion();if(!_0x560e6b)return null;return{'version':_0x560e6b,'source':_0x8e903a(0x1b1)};}function shouldInstallTarget(_0x35242d,_0x22cb29){const _0x1ea915=a39_0x9a45b9;if(_0x22cb29[_0x1ea915(0x1a6)]===_0x1ea915(0x18e)||_0x22cb29[_0x1ea915(0x1a6)]===_0x1ea915(0x1d4))return!a39_0x1819b4['eq'](_0x35242d,_0x22cb29['version']);return a39_0x1819b4['lt'](_0x35242d,_0x22cb29['version']);}function getInstallPlanLabel(_0x1e51a8,_0x48970d){const _0x15da2f=a39_0x9a45b9;switch(_0x48970d[_0x15da2f(0x1a6)]){case'beta':return _0x15da2f(0x1ab)+a39_0x54ef4d[_0x15da2f(0x18f)](_0x1e51a8)+_0x15da2f(0x1a4)+a39_0x54ef4d[_0x15da2f(0x188)](_0x48970d[_0x15da2f(0x18e)]);case _0x15da2f(0x18e):return _0x15da2f(0x1d1)+a39_0x54ef4d[_0x15da2f(0x18f)](_0x1e51a8)+_0x15da2f(0x1a4)+a39_0x54ef4d[_0x15da2f(0x188)](_0x48970d['version']);case _0x15da2f(0x1b1):default:return _0x15da2f(0x1c6)+a39_0x54ef4d[_0x15da2f(0x18f)](_0x1e51a8)+_0x15da2f(0x1a4)+a39_0x54ef4d[_0x15da2f(0x188)](_0x48970d[_0x15da2f(0x18e)]);}}function repairCurrentBuiltinSkill(){const _0x515130=a39_0x9a45b9;console[_0x515130(0x1a5)](a39_0x54ef4d[_0x515130(0x18d)]('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x58de24=installBuiltinSkill();if(_0x58de24['ok'])return console[_0x515130(0x1a5)](a39_0x54ef4d[_0x515130(0x18d)](_0x515130(0x1a3)+_0x58de24[_0x515130(0x1b7)]+_0x515130(0x185))),!![];return console[_0x515130(0x1b6)](a39_0x54ef4d['yellow'](_0x515130(0x1d5)+_0x58de24['code']+_0x515130(0x1a7)+(_0x58de24[_0x515130(0x1d8)]||_0x515130(0x1c0)))),console['log'](a39_0x54ef4d[_0x515130(0x18d)]('\x20\x20Run\x20manually:\x20'+CLI_BIN_NAME+'\x20cli-skill\x20install')),![];}function verifyUpdatedBuiltinSkill(_0x5b502f){const _0x360862=a39_0x9a45b9,_0x3dce41=inspectInstalledBuiltinSkillVersion(_0x5b502f);if(_0x3dce41[_0x360862(0x1be)]==='current')return console[_0x360862(0x1a5)](a39_0x54ef4d['gray'](_0x360862(0x1a3)+_0x5b502f+_0x360862(0x185))),!![];const _0xb41c08=_0x3dce41[_0x360862(0x1b7)]?_0x360862(0x1ac)+_0x5b502f+_0x360862(0x19e)+_0x3dce41[_0x360862(0x1b7)]:'expected\x20'+_0x5b502f+',\x20state\x20'+_0x3dce41[_0x360862(0x1be)];return console['warn'](a39_0x54ef4d[_0x360862(0x18f)](_0x360862(0x1b2)+_0xb41c08)),console['log'](a39_0x54ef4d['gray'](_0x360862(0x1c1)+_0x3dce41[_0x360862(0x18b)])),![];}async function execute(_0x222006){const _0x3db470=a39_0x9a45b9;await validateUpdateFlags(_0x222006);const _0x155f2b=getCurrentVersion();console[_0x3db470(0x1a5)]('Current\x20version:\x20'+_0x155f2b);const _0x3ee541=a39_0x4ee566(_0x3db470(0x1cd))[_0x3db470(0x1ce)](),_0x3fceb6=await resolveTargetVersion(_0x222006);if(!_0x3fceb6){const _0x26c6df=_0x222006[_0x3db470(0x1c7)](_0x3db470(0x1d4))?_0x3db470(0x1ad):_0x3db470(0x1bd);return _0x3ee541[_0x3db470(0x1bc)](_0x26c6df),console[_0x3db470(0x1a5)](a39_0x54ef4d[_0x3db470(0x18d)](_0x3db470(0x1b0)+NPM_PACKAGE_NAME+_0x3db470(0x198))),{'ok':![],'message':_0x26c6df};}const _0x3ff701=a39_0x1819b4[_0x3db470(0x18a)](VERSION),_0x2e918b=a39_0x1819b4[_0x3db470(0x18a)](_0x3fceb6[_0x3db470(0x18e)]);if(!_0x3ff701||!_0x2e918b)return _0x3ee541[_0x3db470(0x1bc)]('Version\x20comparison\x20failed'),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0x3ff701,_0x3fceb6)){const _0x74debc=_0x3fceb6[_0x3db470(0x1a6)]===_0x3db470(0x18e)?'Already\x20on\x20requested\x20version\x20(v'+_0x3fceb6[_0x3db470(0x18e)]+')':_0x3db470(0x19f)+_0x3fceb6['version']+')';return _0x3ee541[_0x3db470(0x1a2)](_0x74debc),{'ok':repairCurrentBuiltinSkill()};}_0x3ee541[_0x3db470(0x186)](getInstallPlanLabel(_0x155f2b,_0x3fceb6));const _0x4f3963=detectPackageManager(),_0x4cd20e=_0x4f3963===_0x3db470(0x1c9)?resolveNpmBin('npm'):_0x4f3963,_0x550f60=a39_0x4ee566(_0x3db470(0x1b8)+_0x4f3963+_0x3db470(0x1a8))[_0x3db470(0x1ce)]();try{return await execa(_0x4cd20e,[_0x3db470(0x196),'-g',NPM_PACKAGE_NAME+'@'+_0x3fceb6['version']],{'stdio':_0x3db470(0x1c5)}),_0x550f60[_0x3db470(0x1a2)](_0x3db470(0x19b)+_0x3fceb6[_0x3db470(0x18e)]),console[_0x3db470(0x1a5)](a39_0x54ef4d[_0x3db470(0x18d)](_0x3db470(0x1aa))),{'ok':verifyUpdatedBuiltinSkill(_0x3fceb6[_0x3db470(0x18e)])};}catch(_0x587b4f){return _0x550f60[_0x3db470(0x1bc)](_0x3db470(0x184)),console[_0x3db470(0x1d8)](a39_0x54ef4d[_0x3db470(0x1b4)]('\x20\x20'+_0x587b4f['message'])),console[_0x3db470(0x1a5)](a39_0x54ef4d['gray'](_0x3db470(0x1d6)+_0x4f3963+_0x3db470(0x1d3)+NPM_PACKAGE_NAME+'@'+_0x3fceb6[_0x3db470(0x18e)])),{'ok':![],'message':_0x587b4f[_0x3db470(0x1cb)]};}}export const updateDefinition={'service':'update','command':a39_0x9a45b9(0x1b9),'description':a39_0x9a45b9(0x193),'risk':a39_0x9a45b9(0x1d0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x455479,_0x1c6fdb){const _0x18f3c8=a40_0x772d,_0x1367ce=_0x455479();while(!![]){try{const _0x1c587d=parseInt(_0x18f3c8(0xc5))/0x1+-parseInt(_0x18f3c8(0xc6))/0x2*(-parseInt(_0x18f3c8(0xcc))/0x3)+parseInt(_0x18f3c8(0xc8))/0x4+parseInt(_0x18f3c8(0xca))/0x5+-parseInt(_0x18f3c8(0xcb))/0x6+parseInt(_0x18f3c8(0xc7))/0x7*(parseInt(_0x18f3c8(0xc9))/0x8)+-parseInt(_0x18f3c8(0xcd))/0x9;if(_0x1c587d===_0x1c6fdb)break;else _0x1367ce['push'](_0x1367ce['shift']());}catch(_0x202fd4){_0x1367ce['push'](_0x1367ce['shift']());}}}(a40_0x51c6,0x5403b));import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';function a40_0x51c6(){const _0x25b059=['2182710IFXuyx','1600176JMZENQ','3SQzchr','5530536RkCLJr','289074rStzCa','182796rYbzCp','35WbnVQd','987176HnFkGd','258424HLKYGn'];a40_0x51c6=function(){return _0x25b059;};return a40_0x51c6();}function a40_0x772d(_0x199770,_0x49456a){_0x199770=_0x199770-0xc5;const _0x51c669=a40_0x51c6();let _0x772d4=_0x51c669[_0x199770];return _0x772d4;}export const codegenDefinitions=[codegenSdk,codegenSql];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a41_0x52bd(_0xbacecc,_0x26dbe5){_0xbacecc=_0xbacecc-0x1f4;const _0x1c9fd8=a41_0x1c9f();let _0x52bda1=_0x1c9fd8[_0xbacecc];return _0x52bda1;}const a41_0x145366=a41_0x52bd;(function(_0xd2a6e2,_0x3cb544){const _0x18a717=a41_0x52bd,_0x3e4d24=_0xd2a6e2();while(!![]){try{const _0x42925f=-parseInt(_0x18a717(0x1f6))/0x1*(parseInt(_0x18a717(0x205))/0x2)+-parseInt(_0x18a717(0x1f7))/0x3*(-parseInt(_0x18a717(0x1fb))/0x4)+parseInt(_0x18a717(0x1f4))/0x5+-parseInt(_0x18a717(0x202))/0x6*(parseInt(_0x18a717(0x200))/0x7)+-parseInt(_0x18a717(0x1fa))/0x8+parseInt(_0x18a717(0x1fe))/0x9+parseInt(_0x18a717(0x1f5))/0xa*(parseInt(_0x18a717(0x1ff))/0xb);if(_0x42925f===_0x3cb544)break;else _0x3e4d24['push'](_0x3e4d24['shift']());}catch(_0x517a49){_0x3e4d24['push'](_0x3e4d24['shift']());}}}(a41_0x1c9f,0x86187));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a41_0x1c9f(){const _0x2a14b6=['Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','sdk','string','name','tableName','read','1011580VLxslL','1622230QzwCCh','1bNfxiN','687AmFckE','code','operation','5162712eOkCQW','12676uCvNAT','Omit\x20import\x20statements\x20from\x20generated\x20code','bool','798264govRFn','44OdyIIG','14EHnmgB','str','1408410KGwcYe','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','skip-imports','3082QefZpu','codegen'];a41_0x1c9f=function(){return _0x2a14b6;};return a41_0x1c9f();}export const codegenSdk={'service':a41_0x145366(0x206),'command':a41_0x145366(0x208),'description':a41_0x145366(0x207),'risk':a41_0x145366(0x20c),'flags':[CODE_FLAG_OPTIONAL,{'name':'alias','type':a41_0x145366(0x209),'description':'Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)'},{'name':a41_0x145366(0x1f9),'type':'string','required':!![],'description':a41_0x145366(0x203)},{'name':a41_0x145366(0x204),'type':'boolean','description':a41_0x145366(0x1fc)}],async 'execute'(_0x347dfd){const _0x54cffd=a41_0x145366,{dataset:_0x2a9111,operation:_0xd69b69}=await getOperationDetail(_0x347dfd['appCode'],_0x347dfd[_0x54cffd(0x201)](_0x54cffd(0x1f8)),_0x347dfd[_0x54cffd(0x201)](_0x54cffd(0x1f9))),_0xcca719=generateSdkCode(_0x2a9111,_0xd69b69,{'includeImports':!_0x347dfd[_0x54cffd(0x1fd)](_0x54cffd(0x204))});return{'ok':!![],'data':{'dataset':{'name':_0x2a9111[_0x54cffd(0x20a)],'code':_0x2a9111[_0x54cffd(0x1f8)],'tableName':_0x2a9111[_0x54cffd(0x20b)]},'operation':_0x347dfd[_0x54cffd(0x201)](_0x54cffd(0x1f9)),'code':_0xcca719}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a42_0x4381(_0x4f3544,_0x1edbe9){_0x4f3544=_0x4f3544-0x1c5;const _0x458ae1=a42_0x458a();let _0x43813e=_0x458ae1[_0x4f3544];return _0x43813e;}const a42_0xe0a7c6=a42_0x4381;(function(_0x4cab93,_0x2919f0){const _0x10bee0=a42_0x4381,_0x3a43bc=_0x4cab93();while(!![]){try{const _0x346469=-parseInt(_0x10bee0(0x1cc))/0x1+-parseInt(_0x10bee0(0x1db))/0x2*(-parseInt(_0x10bee0(0x1ce))/0x3)+-parseInt(_0x10bee0(0x1d2))/0x4*(-parseInt(_0x10bee0(0x1c8))/0x5)+-parseInt(_0x10bee0(0x1c7))/0x6*(parseInt(_0x10bee0(0x1d5))/0x7)+-parseInt(_0x10bee0(0x1d0))/0x8+parseInt(_0x10bee0(0x1d8))/0x9*(-parseInt(_0x10bee0(0x1c6))/0xa)+parseInt(_0x10bee0(0x1c9))/0xb;if(_0x346469===_0x2919f0)break;else _0x3a43bc['push'](_0x3a43bc['shift']());}catch(_0x21a7ae){_0x3a43bc['push'](_0x3a43bc['shift']());}}}(a42_0x458a,0x3d345));function a42_0x458a(){const _0x36aeaf=['197767zvUSYz','Omit\x20import\x20statements\x20from\x20generated\x20code','1371549VybhRj','sqlName','1317856ACUgFk','codegen','4dbJSPK','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','sdk','7jBXuTb','appCode','no-imports','585wfKLNU','str','sqlcode','2dMBEEi','sqlCode','bool','56810xpzKWY','1672446pNCYSh','603265PERBmw','7516982rmdGuV','read','target'];a42_0x458a=function(){return _0x36aeaf;};return a42_0x458a();}import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':a42_0xe0a7c6(0x1d1),'command':'sql','description':a42_0xe0a7c6(0x1d3),'risk':a42_0xe0a7c6(0x1ca),'flags':[SQLCODE_FLAG,{'name':a42_0xe0a7c6(0x1cb),'type':'string','description':'Code\x20target:\x20sdk\x20(default)\x20or\x20bff','default':a42_0xe0a7c6(0x1d4),'enum':[a42_0xe0a7c6(0x1d4),'bff']},{'name':a42_0xe0a7c6(0x1d7),'type':'boolean','description':a42_0xe0a7c6(0x1cd)}],async 'execute'(_0x502fa1){const _0x5d33ae=a42_0xe0a7c6,_0x4a8568=await getSqlQueryInfo(_0x502fa1[_0x5d33ae(0x1d6)],_0x502fa1[_0x5d33ae(0x1d9)](_0x5d33ae(0x1da))),_0x105993=_0x502fa1[_0x5d33ae(0x1d9)](_0x5d33ae(0x1cb))||_0x5d33ae(0x1d4),_0x1ed213=generateSqlCodeTemplate(_0x4a8568,{'target':_0x105993,'includeImports':!_0x502fa1[_0x5d33ae(0x1c5)](_0x5d33ae(0x1d7))});return{'ok':!![],'data':{'sqlCode':_0x4a8568[_0x5d33ae(0x1dc)],'sqlName':_0x4a8568[_0x5d33ae(0x1cf)],'target':_0x105993,'code':_0x1ed213}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3abc2c,_0x492a0f){const _0x3b20a7=a43_0x2428,_0x5ad46a=_0x3abc2c();while(!![]){try{const _0x3798b7=-parseInt(_0x3b20a7(0x8d))/0x1+-parseInt(_0x3b20a7(0x8c))/0x2+parseInt(_0x3b20a7(0x88))/0x3*(parseInt(_0x3b20a7(0x90))/0x4)+-parseInt(_0x3b20a7(0x91))/0x5+parseInt(_0x3b20a7(0x72))/0x6*(-parseInt(_0x3b20a7(0x7f))/0x7)+parseInt(_0x3b20a7(0x78))/0x8+parseInt(_0x3b20a7(0x74))/0x9;if(_0x3798b7===_0x492a0f)break;else _0x5ad46a['push'](_0x5ad46a['shift']());}catch(_0x4d385b){_0x5ad46a['push'](_0x5ad46a['shift']());}}}(a43_0x4674,0x3b42c));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 _0x2cd9e2=a43_0x2428;return[{'name':'appcode','type':'string','description':_0x2cd9e2(0x80),'required':!![]},{'name':_0x2cd9e2(0x70),'type':_0x2cd9e2(0x8f),'description':_0x2cd9e2(0x7b),'default':![]},...getAppProfileFlagDefs()];}export function buildAppRemoveFlags(){const _0x1cb939=a43_0x2428;return[{'name':_0x1cb939(0x70),'type':'boolean','description':_0x1cb939(0x7b),'default':![]}];}export async function validateAppName(_0x15dc78,_0x313378){const _0x952d2d=a43_0x2428,_0x213ec5=_0x15dc78[_0x952d2d(0x79)][0x0]?.['trim']();if(!_0x213ec5)throw CliErrors[_0x952d2d(0x82)](_0x952d2d(0x9b),_0x952d2d(0x8e)+CLI_BIN_NAME+'\x20'+_0x313378+_0x952d2d(0x7d));}export async function runAppAdd(_0x3aadb1,_0x50f252){const _0x1ad6e4=a43_0x2428,_0x625cee=_0x3aadb1[_0x1ad6e4(0x79)][0x0]?.['trim']();if(!_0x625cee)throw CliErrors[_0x1ad6e4(0x82)](_0x1ad6e4(0x9b),_0x1ad6e4(0x8e)+CLI_BIN_NAME+'\x20'+_0x50f252+_0x1ad6e4(0x92));const _0x237641=_0x3aadb1[_0x1ad6e4(0x97)]('appcode');if(!_0x237641)throw CliErrors[_0x1ad6e4(0x8a)]('appcode','Usage:\x20'+CLI_BIN_NAME+'\x20'+_0x50f252+'\x20<name>\x20--appcode\x20<code>');const _0x5daae4={'global':_0x3aadb1[_0x1ad6e4(0x7c)](_0x1ad6e4(0x70))},_0x25126d=readConfig(_0x5daae4);if(!_0x25126d[_0x1ad6e4(0x6f)])_0x25126d['apps']={};const _0x2cec83={'appcode':_0x237641,...collectAppProfileOverrides(_0x5a2b3b=>_0x3aadb1['str'](_0x5a2b3b))},_0x13df00=_0x25126d['apps'],_0x4a395c=!!_0x13df00[_0x625cee];_0x13df00[_0x625cee]=_0x2cec83;if(!_0x25126d[_0x1ad6e4(0x75)])_0x25126d[_0x1ad6e4(0x75)]=_0x625cee;writeConfig(_0x25126d,_0x5daae4);const _0x14a675=!_0x4a395c&&_0x25126d[_0x1ad6e4(0x75)]===_0x625cee?_0x1ad6e4(0x7a):'',_0x483ddf=(_0x4a395c?_0x1ad6e4(0x93):_0x1ad6e4(0x83))+_0x1ad6e4(0x76)+_0x625cee+_0x1ad6e4(0x86)+_0x237641+')'+scopeLabel(_0x5daae4)+'.'+_0x14a675;return{'ok':!![],'message':_0x483ddf};}function a43_0x4674(){const _0x4f19c3=['Updated','App\x20\x22','keys','\x20config.','str','\x22\x20still\x20defined\x20in\x20','\x20Note:\x20app\x20\x22','both','Missing\x20app\x20name.','project','apps','global','globalConfig','78YvppOm','\x20<name>\x20[--global]','8094519yrlWJB','defaultApp','\x20app\x20\x22','\x20Default\x20app\x20changed\x20to\x20\x22','1618888Gzrund','args','\x20Set\x20as\x20default\x20app.','Use\x20global\x20config\x20scope','bool','\x20<name>','inherit','248990kZnPym','App\x20code','object','validation','Added','projectConfig','\x22\x20not\x20found.','\x22\x20(appcode:\x20','trim','4053vdJfEl','Removed\x20app\x20\x22','flagMissing','length','541374qpZiqb','356387vOaEsI','Usage:\x20','boolean','1436tlYaFB','1272725fDpTpQ','\x20<name>\x20--appcode\x20<code>'];a43_0x4674=function(){return _0x4f19c3;};return a43_0x4674();}function a43_0x2428(_0xfefa6d,_0x330a8f){_0xfefa6d=_0xfefa6d-0x6e;const _0x467490=a43_0x4674();let _0x24282a=_0x467490[_0xfefa6d];return _0x24282a;}export async function runAppRemove(_0x1a8922,_0x25d3b0){const _0x3e3987=a43_0x2428,_0x534fe6=_0x1a8922['args'][0x0]?.[_0x3e3987(0x87)]();if(!_0x534fe6)throw CliErrors[_0x3e3987(0x82)](_0x3e3987(0x9b),'Usage:\x20'+CLI_BIN_NAME+'\x20'+_0x25d3b0+_0x3e3987(0x73));const _0x33c5f8=_0x1a8922[_0x3e3987(0x7c)](_0x3e3987(0x70)),{config:_0x4d648d,layers:_0x1db523}=readRawConfigWithLayers(),_0x4c5084=_0x4d648d['apps']??{};if(!_0x4c5084[_0x534fe6])throw CliErrors[_0x3e3987(0x82)]('App\x20\x22'+_0x534fe6+_0x3e3987(0x85));const _0x380e76=_0x1db523['globalConfig'][_0x3e3987(0x6f)]&&typeof _0x1db523[_0x3e3987(0x71)]['apps']===_0x3e3987(0x81)?_0x1db523[_0x3e3987(0x71)][_0x3e3987(0x6f)]:{},_0x5959b4=_0x1db523['projectConfig'][_0x3e3987(0x6f)]&&typeof _0x1db523[_0x3e3987(0x84)][_0x3e3987(0x6f)]===_0x3e3987(0x81)?_0x1db523[_0x3e3987(0x84)][_0x3e3987(0x6f)]:{},_0x147f52=appDefinedIn(_0x534fe6,_0x380e76,_0x5959b4,_0x1db523['projectConfig'][_0x3e3987(0x7e)]===![]),_0x5a2ca2=resolveAppScopeForWrite(_0x534fe6,_0x33c5f8,_0x1db523),_0x5ce4e5={'global':_0x5a2ca2==='global'},_0x8cbec1=readConfig(_0x5ce4e5),_0x5873dc=_0x8cbec1[_0x3e3987(0x6f)];if(!_0x5873dc||!_0x5873dc[_0x534fe6])throw CliErrors['validation'](_0x3e3987(0x94)+_0x534fe6+_0x3e3987(0x85));delete _0x5873dc[_0x534fe6];let _0x3aaa31='';if(_0x8cbec1[_0x3e3987(0x75)]===_0x534fe6){const _0xd00443=Object[_0x3e3987(0x95)](_0x5873dc);_0x8cbec1[_0x3e3987(0x75)]=_0xd00443[_0x3e3987(0x8b)]>0x0?_0xd00443[0x0]:undefined,_0x8cbec1[_0x3e3987(0x75)]?_0x3aaa31=_0x3e3987(0x77)+_0x8cbec1['defaultApp']+'\x22.':delete _0x8cbec1[_0x3e3987(0x75)];}Object[_0x3e3987(0x95)](_0x5873dc)[_0x3e3987(0x8b)]===0x0&&(delete _0x8cbec1[_0x3e3987(0x6f)],delete _0x8cbec1['defaultApp']);writeConfig(_0x8cbec1,_0x5ce4e5);const _0x5a7c44=_0x147f52===_0x3e3987(0x9a)?_0x3e3987(0x99)+_0x534fe6+_0x3e3987(0x98)+(_0x5a2ca2===_0x3e3987(0x6e)?_0x3e3987(0x70):_0x3e3987(0x6e))+_0x3e3987(0x96):'';return{'ok':!![],'message':_0x3e3987(0x89)+_0x534fe6+'\x22'+scopeLabel(_0x5ce4e5)+'.'+_0x3aaa31+_0x5a7c44};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1f6e91,_0x538ada){const _0x3800aa=a44_0x8f8a,_0x34d9b9=_0x1f6e91();while(!![]){try{const _0x12e75d=-parseInt(_0x3800aa(0x1b8))/0x1+-parseInt(_0x3800aa(0x1c8))/0x2*(-parseInt(_0x3800aa(0x1ac))/0x3)+-parseInt(_0x3800aa(0x1b7))/0x4*(parseInt(_0x3800aa(0x1b5))/0x5)+parseInt(_0x3800aa(0x1a6))/0x6+-parseInt(_0x3800aa(0x1c7))/0x7+parseInt(_0x3800aa(0x1c2))/0x8+parseInt(_0x3800aa(0x1af))/0x9;if(_0x12e75d===_0x538ada)break;else _0x34d9b9['push'](_0x34d9b9['shift']());}catch(_0x44d7b0){_0x34d9b9['push'](_0x34d9b9['shift']());}}}(a44_0x2ca1,0x5e26f));import{input,checkbox,select}from'@inquirer/prompts';import a44_0x33bbce from'chalk';function a44_0x8f8a(_0x4fb41d,_0x362475){_0x4fb41d=_0x4fb41d-0x1a6;const _0x2ca12d=a44_0x2ca1();let _0x8f8a36=_0x2ca12d[_0x4fb41d];return _0x8f8a36;}import{validateAppcode}from'../../commands/common/validate.js';import{listRemoteApps}from'../../core/api-client.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';function a44_0x2ca1(){const _0x39bdce=['9777249jPbeZP','skip','find','\x0a无法获取远程应用列表,请手动输入。','appName','length','26395hYPEgQ','\x0a未找到可用应用。','580yayYAg','151205vfqXQf','(跳过,稍后配置)','无法获取远程应用列表,请手动输入。','message','(未检测到登录态,请手动输入\x20App\x20Code\x20或直接跳过)','custom','valid','cyan','yellow','正在获取可用应用列表...','2246408qyclUn','✎\x20自定义输入\x20appcode','appCode','\x20个应用,请选择\x20(空格勾选,\x20a=全选,\x20i=反选):','请输入\x20App\x20Code:','2701748HJOavA','6134VCGfTP','map','\x20\x20(','822534MznQtV','Invalid\x20App\x20Code','App\x20Code:','gray','trim','未找到可用应用。','180qvwMXk','manual','includes'];a44_0x2ca1=function(){return _0x39bdce;};return a44_0x2ca1();}import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';export async function promptCustomAppcode(){const _0x233195=a44_0x8f8a,_0x12da60=await input({'message':_0x233195(0x1c6),'validate':_0x53c531=>{const _0x34e18a=_0x233195,_0x5c05fe=validateAppcode(_0x53c531['trim']());return _0x5c05fe[_0x34e18a(0x1be)]||_0x5c05fe[_0x34e18a(0x1bb)]||_0x34e18a(0x1a7);}});return _0x12da60[_0x233195(0x1aa)]();}export async function promptAppSelection(_0x515a01){const _0x4569c0=a44_0x8f8a,_0x17da56=[{'name':a44_0x33bbce['yellow'](_0x4569c0(0x1c3)),'value':-0x1},..._0x515a01[_0x4569c0(0x1c9)]((_0x5be979,_0x1bd9ac)=>({'name':_0x5be979[_0x4569c0(0x1b3)]+'\x20\x20'+a44_0x33bbce[_0x4569c0(0x1a9)]('('+_0x5be979[_0x4569c0(0x1c4)]+')'),'value':_0x1bd9ac}))],_0x5c0b13=await checkbox({'message':'获取到\x20'+a44_0x33bbce[_0x4569c0(0x1bf)](_0x515a01[_0x4569c0(0x1b4)])+_0x4569c0(0x1c5),'choices':_0x17da56,'loop':![]});if(_0x5c0b13[_0x4569c0(0x1ae)](-0x1))return _0x4569c0(0x1bd);if(_0x5c0b13[_0x4569c0(0x1b4)]===0x0)return _0x4569c0(0x1bd);return _0x5c0b13[_0x4569c0(0x1c9)](_0x2436ce=>_0x515a01[_0x2436ce]);}export async function promptSingleAppSelection(_0x44c250){const _0x37ace2=a44_0x8f8a,_0x3eee5a=[{'name':a44_0x33bbce[_0x37ace2(0x1a9)]('(跳过,稍后通过\x20config\x20set\x20appcode\x20配置)'),'value':_0x37ace2(0x1b0)},{'name':a44_0x33bbce[_0x37ace2(0x1c0)]('✎\x20自定义输入\x20appcode'),'value':_0x37ace2(0x1bd)},..._0x44c250[_0x37ace2(0x1c9)](_0x177e5f=>({'name':_0x177e5f[_0x37ace2(0x1b3)]+'\x20\x20'+a44_0x33bbce[_0x37ace2(0x1a9)]('('+_0x177e5f[_0x37ace2(0x1c4)]+')'),'value':_0x177e5f[_0x37ace2(0x1c4)]}))],_0x1ebfde=await select({'message':'请选择要绑定的应用:','choices':_0x3eee5a});if(_0x1ebfde==='skip')return'skip';if(_0x1ebfde===_0x37ace2(0x1bd))return _0x37ace2(0x1bd);return _0x44c250[_0x37ace2(0x1b1)](_0x37e60e=>_0x37e60e['appCode']===_0x1ebfde);}export async function selectSingleAppcode(_0x271843){const _0x3e9c8c=a44_0x8f8a;if(!_0x271843)return writeCliSideChannelLine(a44_0x33bbce[_0x3e9c8c(0x1a9)](_0x3e9c8c(0x1bc))),_fallbackOrSkip();writeCliSideChannelLine(_0x3e9c8c(0x1c1));let _0x4af017;try{_0x4af017=await withActiveCookie(_0x271843,()=>listRemoteApps());}catch(_0x32323b){writeCliSideChannelLine(a44_0x33bbce[_0x3e9c8c(0x1c0)](_0x3e9c8c(0x1ba)));if(_0x32323b instanceof Error)writeCliSideChannelLine(a44_0x33bbce['gray'](_0x3e9c8c(0x1ca)+_0x32323b[_0x3e9c8c(0x1bb)]+')'));return _fallbackOrSkip();}if(_0x4af017[_0x3e9c8c(0x1b4)]===0x0)return writeCliSideChannelLine(a44_0x33bbce[_0x3e9c8c(0x1c0)](_0x3e9c8c(0x1ab))),_fallbackOrSkip();const _0x3fe701=await promptSingleAppSelection(_0x4af017);if(_0x3fe701===_0x3e9c8c(0x1b0))return'';if(_0x3fe701===_0x3e9c8c(0x1bd))return promptCustomAppcode();return _0x3fe701['appCode'];}export async function selectMultipleApps(_0x50a73e){const _0x1374f0=a44_0x8f8a;writeCliSideChannelLine(_0x1374f0(0x1c1));let _0x175148;try{_0x175148=await withActiveCookie(_0x50a73e,()=>listRemoteApps());}catch(_0xf43908){writeCliSideChannelLine(_0x1374f0(0x1b2));if(_0xf43908 instanceof Error)writeCliSideChannelLine('\x20\x20('+_0xf43908['message']+')');return _0x1374f0(0x1bd);}if(_0x175148[_0x1374f0(0x1b4)]===0x0)return writeCliSideChannelLine(_0x1374f0(0x1b6)),_0x1374f0(0x1bd);return promptAppSelection(_0x175148);}async function _fallbackOrSkip(){const _0xf843ee=a44_0x8f8a,_0x67bf9a=await select({'message':_0xf843ee(0x1a8),'choices':[{'name':a44_0x33bbce[_0xf843ee(0x1a9)](_0xf843ee(0x1b9)),'value':'skip'},{'name':a44_0x33bbce[_0xf843ee(0x1c0)]('✎\x20手动输入'),'value':_0xf843ee(0x1ad)}]});if(_0x67bf9a==='skip')return'';return promptCustomAppcode();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a45_0x5f5d3a=a45_0x2443;(function(_0x3173b5,_0x40508f){const _0x478531=a45_0x2443,_0x892479=_0x3173b5();while(!![]){try{const _0x3e0296=-parseInt(_0x478531(0x1be))/0x1+-parseInt(_0x478531(0x1bb))/0x2*(parseInt(_0x478531(0x1bd))/0x3)+-parseInt(_0x478531(0x1c9))/0x4*(-parseInt(_0x478531(0x1cb))/0x5)+-parseInt(_0x478531(0x1da))/0x6*(parseInt(_0x478531(0x1d3))/0x7)+parseInt(_0x478531(0x1d7))/0x8+-parseInt(_0x478531(0x1bc))/0x9*(parseInt(_0x478531(0x1c4))/0xa)+parseInt(_0x478531(0x1ba))/0xb;if(_0x3e0296===_0x40508f)break;else _0x892479['push'](_0x892479['shift']());}catch(_0x175de2){_0x892479['push'](_0x892479['shift']());}}}(a45_0x9309,0xb2225));import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';const TERMINAL_STATUSES=new Set([a45_0x5f5d3a(0x1ca),'FAILED']),NON_TERMINAL_STATUSES=new Set(['PENDING',a45_0x5f5d3a(0x1d6)]);function a45_0x2443(_0x7ba15e,_0x5284c1){_0x7ba15e=_0x7ba15e-0x1ba;const _0x930945=a45_0x9309();let _0x24433d=_0x930945[_0x7ba15e];return _0x24433d;}export function normalizeAsyncTask(_0x47417b){const _0x21644f=a45_0x5f5d3a,_0x45a894=typeof _0x47417b?.[_0x21644f(0x1c7)]==='string'?_0x47417b['taskId'][_0x21644f(0x1d5)]():'';if(!_0x45a894)throw CliErrors[_0x21644f(0x1c8)](_0x21644f(0x1d9));const _0x51ff87=typeof _0x47417b[_0x21644f(0x1d8)]===_0x21644f(0x1d0)?_0x47417b['status'][_0x21644f(0x1d5)]()[_0x21644f(0x1cd)]():'';if(!_0x51ff87)throw CliErrors[_0x21644f(0x1c8)](_0x21644f(0x1ce)+_0x45a894+_0x21644f(0x1cc));return{'taskId':_0x45a894,'status':_0x51ff87,'errorMessage':typeof _0x47417b[_0x21644f(0x1c0)]===_0x21644f(0x1d0)&&_0x47417b[_0x21644f(0x1c0)][_0x21644f(0x1d5)]()?_0x47417b[_0x21644f(0x1c0)]['trim']():null,'isTerminal':TERMINAL_STATUSES[_0x21644f(0x1c6)](_0x51ff87),'knownStatus':TERMINAL_STATUSES[_0x21644f(0x1c6)](_0x51ff87)||NON_TERMINAL_STATUSES['has'](_0x51ff87)};}export function buildAsyncTaskStatusCommand(_0x44482a,_0x425262){const _0x195cc4=a45_0x5f5d3a;return CLI_BIN_NAME+_0x195cc4(0x1c1)+quoteShellArg(_0x44482a)+'\x20--appcode\x20'+quoteShellArg(_0x425262)+'\x20--format\x20compress';}export function asyncTaskMessage(_0x54336b){const _0x26df3b=a45_0x5f5d3a;switch(_0x54336b[_0x26df3b(0x1d8)]){case _0x26df3b(0x1c2):return'Task\x20'+_0x54336b['taskId']+'\x20is\x20pending.';case _0x26df3b(0x1d6):return'Task\x20'+_0x54336b[_0x26df3b(0x1c7)]+_0x26df3b(0x1d1);case _0x26df3b(0x1ca):return _0x26df3b(0x1c5)+_0x54336b[_0x26df3b(0x1c7)]+_0x26df3b(0x1cf);case _0x26df3b(0x1d2):return _0x54336b[_0x26df3b(0x1c0)]?_0x26df3b(0x1c5)+_0x54336b['taskId']+'\x20failed:\x20'+_0x54336b[_0x26df3b(0x1c0)]:_0x26df3b(0x1c5)+_0x54336b[_0x26df3b(0x1c7)]+_0x26df3b(0x1db);default:return _0x26df3b(0x1c5)+_0x54336b['taskId']+_0x26df3b(0x1c3)+_0x54336b[_0x26df3b(0x1d8)]+'.';}}function a45_0x9309(){const _0x33ddb4=['9SgrFSV','246WyKEgG','819332tOtgsm','replace','errorMessage','\x20task\x20status\x20--task-id\x20','PENDING','\x20returned\x20unknown\x20status\x20','14057430AgKrei','Task\x20','has','taskId','apiError','4azbpsD','SUCCESS','7207335MjETCV','\x20response\x20did\x20not\x20contain\x20a\x20status.','toUpperCase','Async\x20task\x20','\x20completed\x20successfully.','string','\x20is\x20processing.','FAILED','462QIURgQ','\x27\x5c\x27\x27','trim','PROCESSING','3410848XrOuVa','status','Async\x20task\x20response\x20did\x20not\x20contain\x20a\x20taskId.','114756rVbSgj','\x20failed.','37845973YwdXSl','26618VzZadC'];a45_0x9309=function(){return _0x33ddb4;};return a45_0x9309();}function quoteShellArg(_0x13d228){const _0x2023c0=a45_0x5f5d3a;return'\x27'+_0x13d228[_0x2023c0(0x1bf)](/'/g,_0x2023c0(0x1d4))+'\x27';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a46_0x50e5(_0x2d0123,_0x2e39a1){_0x2d0123=_0x2d0123-0x19b;var _0x1f0703=a46_0x1f07();var _0x50e5ca=_0x1f0703[_0x2d0123];return _0x50e5ca;}(function(_0x2bc0a6,_0x142a82){var _0x5b570d=a46_0x50e5,_0xac2554=_0x2bc0a6();while(!![]){try{var _0x5b60c4=-parseInt(_0x5b570d(0x1a3))/0x1+parseInt(_0x5b570d(0x1a2))/0x2+-parseInt(_0x5b570d(0x19e))/0x3+-parseInt(_0x5b570d(0x1a1))/0x4*(parseInt(_0x5b570d(0x1a8))/0x5)+-parseInt(_0x5b570d(0x1a0))/0x6+parseInt(_0x5b570d(0x19d))/0x7*(parseInt(_0x5b570d(0x19f))/0x8)+parseInt(_0x5b570d(0x19c))/0x9*(parseInt(_0x5b570d(0x1a5))/0xa);if(_0x5b60c4===_0x142a82)break;else _0xac2554['push'](_0xac2554['shift']());}catch(_0x57b369){_0xac2554['push'](_0xac2554['shift']());}}}(a46_0x1f07,0x49093));function a46_0x1f07(){var _0x2f3677=['description','4125DevJZm','url','6957eccWMu','4613VdxUPX','671091xpwnei','4328UMrlGx','1099920eLjlNp','1204yzapQY','358884pExEiU','587137GSZvCk','method','13010STmjnb','defineProperties'];a46_0x1f07=function(){return _0x2f3677;};return a46_0x1f07();}export function asDryRunResult(_0x23f459,_0x4be4dd){var _0x5c39be=a46_0x50e5;return Object[_0x5c39be(0x1a6)](_0x23f459,{'method':{'value':_0x4be4dd[_0x5c39be(0x1a4)],'enumerable':![]},'url':{'value':_0x4be4dd[_0x5c39be(0x19b)],'enumerable':![]},..._0x4be4dd[_0x5c39be(0x1a7)]?{'description':{'value':_0x4be4dd[_0x5c39be(0x1a7)],'enumerable':![]}}:{}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a47_0x9323ae=a47_0x56b2;(function(_0x481389,_0x4aab8d){const _0x32a76e=a47_0x56b2,_0x327819=_0x481389();while(!![]){try{const _0x47200c=parseInt(_0x32a76e(0x18e))/0x1*(-parseInt(_0x32a76e(0x18c))/0x2)+-parseInt(_0x32a76e(0x190))/0x3*(-parseInt(_0x32a76e(0x18f))/0x4)+parseInt(_0x32a76e(0x185))/0x5+parseInt(_0x32a76e(0x183))/0x6+-parseInt(_0x32a76e(0x186))/0x7*(-parseInt(_0x32a76e(0x181))/0x8)+-parseInt(_0x32a76e(0x188))/0x9+-parseInt(_0x32a76e(0x189))/0xa;if(_0x47200c===_0x4aab8d)break;else _0x327819['push'](_0x327819['shift']());}catch(_0x376c43){_0x327819['push'](_0x327819['shift']());}}}(a47_0x25ed,0xcae88));function a47_0x25ed(){const _0x1fe142=['a\x2032-character\x20hex\x20code,\x20optionally\x20with\x20`_xx_xx`\x20suffix\x20(e.g.\x2099a909313f1fa7153186431e1c551588\x20or\x2099a909313f1fa7153186431e1c551588_75_3c7120aa)','24EBKsjt','appcode','6837012sDhOzj','string','717215VgpECP','1009813UydwHa','dbtype','1303434pkiXrm','93360cYHxLo','Dataset\x20code\x20(32-char\x20hex,\x20optionally\x20with\x20_xx_xx\x20suffix)','Database\x20product\x20type','395878kESpgj','App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)','5rTZGHY','4UKgoyj','777741ZeFxxJ','App\x20code\x20(e.g.\x20app-xxxxx)','code','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','sqlcode','MYSQL'];a47_0x25ed=function(){return _0x1fe142;};return a47_0x25ed();}export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}(?:_[^_\s]+_[^_\s]+)?$/i,'description':a47_0x9323ae(0x180)};export const CODE_FLAG={'name':a47_0x9323ae(0x192),'type':a47_0x9323ae(0x184),'required':!![],'description':a47_0x9323ae(0x18a),'pattern':DATASET_CODE_PATTERN};export const CODE_FLAG_OPTIONAL={...CODE_FLAG,'required':![]};export const DATASETCODE_FLAG_OPTIONAL={...CODE_FLAG_OPTIONAL,'name':'datasetcode','description':a47_0x9323ae(0x18a)};export const SQLCODE_FLAG={'name':a47_0x9323ae(0x194),'type':a47_0x9323ae(0x184),'required':!![],'description':'SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a47_0x9323ae(0x193)}};export const APPCODE_FLAG_OPTIONAL={'name':a47_0x9323ae(0x182),'type':'string','required':![],'description':a47_0x9323ae(0x18d)};export const APPCODE_FLAG={...APPCODE_FLAG_OPTIONAL,'required':!![],'description':a47_0x9323ae(0x191)};export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};export const DBLINK_ID_FLAG={'name':'id','type':'number','required':!![],'description':'Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)'};function a47_0x56b2(_0x313a35,_0x4c22c5){_0x313a35=_0x313a35-0x17f;const _0x25eda4=a47_0x25ed();let _0x56b2da=_0x25eda4[_0x313a35];return _0x56b2da;}export const DB_TYPE_FLAG={'name':a47_0x9323ae(0x187),'type':a47_0x9323ae(0x184),'required':!![],'description':a47_0x9323ae(0x18b),'enum':[a47_0x9323ae(0x17f),'POSTGRESQL']};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a48_0x5cc9(_0x223989,_0x20ba0a){_0x223989=_0x223989-0xf3;const _0x32e175=a48_0x32e1();let _0x5cc943=_0x32e175[_0x223989];return _0x5cc943;}(function(_0x63292d,_0x250b26){const _0x143b64=a48_0x5cc9,_0x3f2f69=_0x63292d();while(!![]){try{const _0x389b84=-parseInt(_0x143b64(0x100))/0x1+parseInt(_0x143b64(0xfe))/0x2*(parseInt(_0x143b64(0x103))/0x3)+-parseInt(_0x143b64(0x101))/0x4*(-parseInt(_0x143b64(0xf9))/0x5)+parseInt(_0x143b64(0xfd))/0x6+-parseInt(_0x143b64(0xf5))/0x7+parseInt(_0x143b64(0xf6))/0x8+-parseInt(_0x143b64(0xf7))/0x9*(parseInt(_0x143b64(0x104))/0xa);if(_0x389b84===_0x250b26)break;else _0x3f2f69['push'](_0x3f2f69['shift']());}catch(_0x27e617){_0x3f2f69['push'](_0x3f2f69['shift']());}}}(a48_0x32e1,0x4eb10));import{existsSync,statSync}from'node:fs';import{CliErrors}from'../../errors.js';const BYTES_PER_MB=0x400*0x400;export const DEVELOPMENT_UPLOAD_MAX_BYTES=0x32*BYTES_PER_MB;function formatBytes(_0x446f7e){const _0x201ccc=a48_0x5cc9;if(_0x446f7e>=BYTES_PER_MB){const _0x49910a=Math[_0x201ccc(0xf4)](_0x446f7e/BYTES_PER_MB*0x64)/0x64;return _0x49910a['toFixed'](0x2)+_0x201ccc(0xff);}return _0x446f7e+'\x20B';}export function requireDevelopmentUploadFile(_0x2ab20d,_0x26d8b8){const _0x307ac3=a48_0x5cc9,_0x2bcda8=_0x2ab20d['trim']();if(!_0x2bcda8)throw CliErrors[_0x307ac3(0x102)](_0x26d8b8+'\x20path\x20is\x20required.');if(!existsSync(_0x2bcda8))throw CliErrors['validation'](_0x307ac3(0xfc)+_0x2bcda8);const _0x497bdf=statSync(_0x2bcda8);if(!_0x497bdf[_0x307ac3(0xf8)]())throw CliErrors[_0x307ac3(0x102)](_0x307ac3(0xfa)+_0x2bcda8);if(_0x497bdf['size']>DEVELOPMENT_UPLOAD_MAX_BYTES)throw CliErrors['validation'](_0x307ac3(0xf3)+_0x2bcda8+'\x20('+formatBytes(_0x497bdf[_0x307ac3(0xfb)])+')');return{'path':_0x2bcda8,'size':_0x497bdf[_0x307ac3(0xfb)]};}function a48_0x32e1(){const _0x22accf=['230724HkTusB','\x20MB','6913uJYZqZ','4cqaDGb','validation','12RXOgRb','170yxLUfn','File\x20exceeds\x20the\x20development\x20upload\x20limit\x20of\x2050\x20MB:\x20','ceil','3179652iqNXEy','3245968JfQRnj','253404eWLymx','isFile','1458240SVIPOE','File\x20is\x20not\x20a\x20regular\x20file:\x20','size','File\x20not\x20found:\x20','619674Ilvirc'];a48_0x32e1=function(){return _0x22accf;};return a48_0x32e1();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a49_0x4782(_0x574d60,_0x31b886){_0x574d60=_0x574d60-0x1df;const _0x4765d4=a49_0x4765();let _0x478221=_0x4765d4[_0x574d60];return _0x478221;}(function(_0x3cea51,_0xfdbadd){const _0x27721f=a49_0x4782,_0x2483d7=_0x3cea51();while(!![]){try{const _0x580c2b=-parseInt(_0x27721f(0x1e2))/0x1+parseInt(_0x27721f(0x1ee))/0x2+-parseInt(_0x27721f(0x1e0))/0x3*(parseInt(_0x27721f(0x1e5))/0x4)+-parseInt(_0x27721f(0x1e8))/0x5*(-parseInt(_0x27721f(0x1e9))/0x6)+-parseInt(_0x27721f(0x1ec))/0x7*(-parseInt(_0x27721f(0x1e1))/0x8)+parseInt(_0x27721f(0x1e7))/0x9+-parseInt(_0x27721f(0x1eb))/0xa*(-parseInt(_0x27721f(0x1e3))/0xb);if(_0x580c2b===_0xfdbadd)break;else _0x2483d7['push'](_0x2483d7['shift']());}catch(_0x4c8b53){_0x2483d7['push'](_0x2483d7['shift']());}}}(a49_0x4765,0x9e4b2));export function validateAppcode(_0x8305ec){const _0x3e999e=a49_0x4782,_0x265d22=_0x8305ec[_0x3e999e(0x1df)]();if(!_0x265d22)return{'valid':![],'message':_0x3e999e(0x1ea)};if(_0x265d22['length']>0x64)return{'valid':![],'message':_0x3e999e(0x1e6)};if(!/^[A-Za-z0-9_-]+$/[_0x3e999e(0x1ed)](_0x265d22))return{'valid':![],'message':_0x3e999e(0x1e4)};return{'valid':!![]};}function a49_0x4765(){const _0x3bdca4=['1113cHFvPL','test','1887206mOrXza','trim','69MzVCPa','41152JDFuhE','577135OfJNVA','22GVFhto','Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed','154856pxnUiw','App\x20Code\x20cannot\x20exceed\x20100\x20characters','1247967uukPXg','745NYoGhF','2502tPggTC','App\x20Code\x20cannot\x20be\x20empty','768160aUpDbk'];a49_0x4765=function(){return _0x3bdca4;};return a49_0x4765();}
|