@lovrabet/rabetbase-cli 2.5.1-beta.5 → 2.5.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/api/generate-sdk-config-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/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.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/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.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/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-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/deployment/auto-sync.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/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/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.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/deployment-sync.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.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/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.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.d.ts +0 -16
- 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/kb-search-client.d.ts +30 -0
- package/lib/core/kb-search-client.js +1 -0
- 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.d.ts +1 -0
- 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/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +3 -3
- package/skills/rabetbase/references/rabetbase-config.md +1 -1
- package/skills/rabetbase/references/rabetbase-database-template.md +36 -0
- package/skills/rabetbase/references/rabetbase-doctor.md +1 -1
- package/skills/rabetbase/references/rabetbase-kb.md +8 -7
- package/skills/rabetbase/references/rabetbase-rule.md +15 -0
- package/skills/rabetbase.manifest.json +4 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a33_0xbb1443=a33_0x34e5;function a33_0x38ea(){const _0x10c35e=['380343WdWtds','12394590kWrrpx','bff','Return\x20full\x20raw\x20script\x20object','scriptType','791545vcuYEu','number','version','description','501702WxdhlP','(none)','4101642aPzZlv','detail','8uVZpPa','scriptContent','verbose','4172wCliJl','12htXCAd','updatedTime','updateUserName','functionName','76769aceVuN','bool','num','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','read','597YPlSIW'];a33_0x38ea=function(){return _0x10c35e;};return a33_0x38ea();}(function(_0x12f27f,_0x475d22){const _0x4a4f97=a33_0x34e5,_0xaa831e=_0x12f27f();while(!![]){try{const _0x42eb3b=-parseInt(_0x4a4f97(0x1fa))/0x1+-parseInt(_0x4a4f97(0x203))/0x2+parseInt(_0x4a4f97(0x1f9))/0x3*(-parseInt(_0x4a4f97(0x20a))/0x4)+parseInt(_0x4a4f97(0x1ff))/0x5*(parseInt(_0x4a4f97(0x20b))/0x6)+parseInt(_0x4a4f97(0x1f4))/0x7+parseInt(_0x4a4f97(0x207))/0x8*(-parseInt(_0x4a4f97(0x205))/0x9)+parseInt(_0x4a4f97(0x1fb))/0xa;if(_0x42eb3b===_0x475d22)break;else _0xaa831e['push'](_0xaa831e['shift']());}catch(_0x4b2333){_0xaa831e['push'](_0xaa831e['shift']());}}}(a33_0x38ea,0x428ab));function a33_0x34e5(_0x3c0c1a,_0x93e3fb){_0x3c0c1a=_0x3c0c1a-0x1f1;const _0x38ea3d=a33_0x38ea();let _0x34e5f5=_0x38ea3d[_0x3c0c1a];return _0x34e5f5;}import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':a33_0xbb1443(0x1fc),'command':a33_0xbb1443(0x206),'description':a33_0xbb1443(0x1f7),'risk':a33_0xbb1443(0x1f8),'flags':[{'name':'id','type':a33_0xbb1443(0x200),'required':!![],'description':'Script\x20ID'},{'name':'verbose','type':'boolean','description':a33_0xbb1443(0x1fd)}],async 'execute'(_0x2d7159){const _0x439d36=a33_0xbb1443,_0x270395=await getBffScriptInfo(_0x2d7159[_0x439d36(0x1f6)]('id')),_0x2ea14b=_0x2d7159[_0x439d36(0x1f5)](_0x439d36(0x209));if(_0x2ea14b)return{'ok':!![],'data':_0x270395};return{'ok':!![],'data':{'id':_0x270395['id'],'functionName':_0x270395[_0x439d36(0x1f3)]??'','version':_0x270395[_0x439d36(0x201)]??'','updateUserName':_0x270395[_0x439d36(0x1f2)]??'','appCode':_0x270395['appCode'],'scriptType':_0x270395[_0x439d36(0x1fe)],'description':_0x270395[_0x439d36(0x202)]||_0x439d36(0x204),'createdTime':_0x270395['createdTime']??'','updatedTime':_0x270395[_0x439d36(0x1f1)]??'','scriptContent':_0x270395[_0x439d36(0x208)]??''}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x456f67,_0x2f7d0d){const _0x2496ff=a34_0x59f3,_0xf95c22=_0x456f67();while(!![]){try{const _0x308106=-parseInt(_0x2496ff(0x9e))/0x1*(-parseInt(_0x2496ff(0x9a))/0x2)+-parseInt(_0x2496ff(0xa1))/0x3*(-parseInt(_0x2496ff(0x9f))/0x4)+parseInt(_0x2496ff(0x9d))/0x5+parseInt(_0x2496ff(0x97))/0x6*(-parseInt(_0x2496ff(0x9c))/0x7)+-parseInt(_0x2496ff(0x9b))/0x8+parseInt(_0x2496ff(0x99))/0x9*(parseInt(_0x2496ff(0x98))/0xa)+-parseInt(_0x2496ff(0xa0))/0xb;if(_0x308106===_0x2f7d0d)break;else _0xf95c22['push'](_0xf95c22['shift']());}catch(_0x64f376){_0xf95c22['push'](_0xf95c22['shift']());}}}(a34_0x419f,0x3506d));function a34_0x419f(){const _0x71783f=['2075315xPVqly','411564rFUkHC','66MWgppn','34790LCzTEa','711YzoUlx','2cZjLIo','1619088ftWoVx','201824FKyPMt','1676090XGKKWI','40965eKmyuK','8kofBXR'];a34_0x419f=function(){return _0x71783f;};return a34_0x419f();}import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';function a34_0x59f3(_0x363ca2,_0x4d73b7){_0x363ca2=_0x363ca2-0x97;const _0x419fa6=a34_0x419f();let _0x59f344=_0x419fa6[_0x363ca2];return _0x59f344;}import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a35_0x32fb(_0x5a710d,_0x4ee5dc){_0x5a710d=_0x5a710d-0x111;const _0x3232cd=a35_0x3232();let _0x32fb79=_0x3232cd[_0x5a710d];return _0x32fb79;}const a35_0x4dad2b=a35_0x32fb;(function(_0x31e47c,_0xba4d57){const _0x241f38=a35_0x32fb,_0x32df50=_0x31e47c();while(!![]){try{const _0x3305f3=-parseInt(_0x241f38(0x122))/0x1+-parseInt(_0x241f38(0x11a))/0x2*(-parseInt(_0x241f38(0x12d))/0x3)+-parseInt(_0x241f38(0x124))/0x4*(parseInt(_0x241f38(0x115))/0x5)+parseInt(_0x241f38(0x113))/0x6+parseInt(_0x241f38(0x125))/0x7*(parseInt(_0x241f38(0x118))/0x8)+parseInt(_0x241f38(0x11c))/0x9+-parseInt(_0x241f38(0x127))/0xa;if(_0x3305f3===_0xba4d57)break;else _0x32df50['push'](_0x32df50['shift']());}catch(_0x2c85d5){_0x32df50['push'](_0x32df50['shift']());}}}(a35_0x3232,0xcfb1a));function a35_0x3232(){const _0x8b663e=['ENDPOINT','7712795yorhLj','appCode','type','32lOBRMf','Return\x20full\x20script\x20objects','2jDYVfR','Script\x20type\x20filter','13174722wiOBxN','(unnamed)','List\x20Backend\x20Function\x20scripts','str','length','read','299789rgrzOk','scriptType','4NWeUbZ','1256241SGmTFz','bff','3897320gArTiV','Filter\x20by\x20script\x20name','No\x20Backend\x20Function\x20scripts\x20found.','name','bool','COMMON','1583457ROzTYe','list','description','verbose','2239590ZjRFvh'];a35_0x3232=function(){return _0x8b663e;};return a35_0x3232();}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a35_0x4dad2b(0x126),'command':a35_0x4dad2b(0x12e),'description':a35_0x4dad2b(0x11e),'risk':a35_0x4dad2b(0x121),'flags':[{'name':'type','type':'string','description':a35_0x4dad2b(0x11b),'default':a35_0x4dad2b(0x114),'enum':[a35_0x4dad2b(0x114),a35_0x4dad2b(0x12c)]},{'name':a35_0x4dad2b(0x12a),'type':'string','description':a35_0x4dad2b(0x128)},{'name':'verbose','type':'boolean','description':a35_0x4dad2b(0x119)}],async 'execute'(_0x5fa03){const _0x3a71af=a35_0x4dad2b,_0x28b1cc=await listBffScripts(_0x5fa03[_0x3a71af(0x116)],_0x5fa03[_0x3a71af(0x11f)](_0x3a71af(0x117)),{'scriptName':_0x5fa03['str'](_0x3a71af(0x12a))||undefined}),_0x412be3=_0x5fa03[_0x3a71af(0x12b)](_0x3a71af(0x112));return{'ok':!![],'data':_0x412be3?_0x28b1cc:_0x28b1cc['map'](_0x5958d6=>({'id':_0x5958d6['id'],'functionName':_0x5958d6['functionName']??'','description':_0x5958d6[_0x3a71af(0x111)]||_0x3a71af(0x11d),'scriptType':_0x5958d6[_0x3a71af(0x123)]})),'message':_0x28b1cc[_0x3a71af(0x120)]===0x0?_0x3a71af(0x129):undefined};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0xa2eb89=a36_0x218a;(function(_0x564224,_0x52231c){const _0x17a44f=a36_0x218a,_0x3fa644=_0x564224();while(!![]){try{const _0x14382f=parseInt(_0x17a44f(0x1d6))/0x1+-parseInt(_0x17a44f(0x1e5))/0x2+-parseInt(_0x17a44f(0x1cd))/0x3*(parseInt(_0x17a44f(0x1ad))/0x4)+-parseInt(_0x17a44f(0x1c5))/0x5*(-parseInt(_0x17a44f(0x1db))/0x6)+parseInt(_0x17a44f(0x1bc))/0x7+parseInt(_0x17a44f(0x1e7))/0x8+-parseInt(_0x17a44f(0x1ce))/0x9;if(_0x14382f===_0x52231c)break;else _0x3fa644['push'](_0x3fa644['shift']());}catch(_0x464564){_0x3fa644['push'](_0x3fa644['shift']());}}}(a36_0x25b5,0xafd1d));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':a36_0xa2eb89(0x1be),'command':a36_0xa2eb89(0x1ef),'description':a36_0xa2eb89(0x1e4),'risk':a36_0xa2eb89(0x1d2),'flags':[{'name':a36_0xa2eb89(0x1b2),'type':'string','description':'Pull\x20only\x20this\x20script\x20type','enum':[a36_0xa2eb89(0x1df),a36_0xa2eb89(0x1c4),a36_0xa2eb89(0x1dc)]},{'name':'force','type':a36_0xa2eb89(0x1b5),'description':a36_0xa2eb89(0x1cb)}],async 'dryRun'(_0x34445b){const _0x2cc67e=a36_0xa2eb89,_0x55d258=loadBffProjectConfig(_0x34445b[_0x2cc67e(0x1e8)]),_0x53d39b=await readBffLockFile(_0x55d258[_0x2cc67e(0x1ed)]),{appLock:_0x308ec5}=ensureLockScope(_0x53d39b??createEmptyBffLock(),_0x34445b['appCode'],_0x55d258[_0x2cc67e(0x1eb)],'pull'),_0x19aa6e=normalizeBffType(_0x34445b[_0x2cc67e(0x1e0)](_0x2cc67e(0x1b2)))??undefined,_0xd47288=buildDatasetCodeToAliasMap(_0x34445b[_0x2cc67e(0x1cc)],_0x34445b[_0x2cc67e(0x1e8)]),[_0x32711c,_0x391276]=await Promise[_0x2cc67e(0x1ca)]([listBffScripts(_0x34445b['appCode'],_0x19aa6e),getBffScriptStatistics(_0x34445b[_0x2cc67e(0x1e8)])]),_0x26943e=createHookLocationMap(_0x391276),_0x184770=[];for(const _0x528712 of _0x32711c){const _0x41ef4b=resolveRemoteScriptTarget(_0x55d258,_0x528712,_0x26943e,_0x308ec5[_0x2cc67e(0x1a9)],_0xd47288);if(!_0x41ef4b){_0x184770['push']({'scriptType':_0x528712[_0x2cc67e(0x1af)],'functionName':_0x528712[_0x2cc67e(0x1d5)]??'','status':_0x2cc67e(0x1de),'reason':_0x2cc67e(0x1c6)});continue;}const _0x1668f4=_0x308ec5[_0x2cc67e(0x1a9)][_0x41ef4b[_0x2cc67e(0x1f1)]],_0x28cc65=_0x528712[_0x2cc67e(0x1e2)]!=null?computeContentHash(_0x528712['scriptContent']):undefined,_0x166436=await hasUnsyncedLocalChanges(_0x41ef4b[_0x2cc67e(0x1b9)],_0x1668f4,_0x28cc65);_0x184770[_0x2cc67e(0x1d1)]({'lockKey':_0x41ef4b[_0x2cc67e(0x1f1)],'filePath':_0x41ef4b[_0x2cc67e(0x1b9)],'remoteId':_0x528712['id']??null,'status':_0x166436?_0x2cc67e(0x1ec):'would_pull'});}return{'method':_0x2cc67e(0x1ba),'url':_0x2cc67e(0x1bd)+_0x34445b[_0x2cc67e(0x1e8)]+(_0x19aa6e?'&type='+_0x19aa6e:''),'body':{'appCode':_0x34445b[_0x2cc67e(0x1e8)],'filterType':_0x19aa6e??null,'files':_0x184770},'description':_0x2cc67e(0x1d3)+_0x184770[_0x2cc67e(0x1b7)]+_0x2cc67e(0x1ab)};},async 'execute'(_0x1618b0){const _0x27991e=a36_0xa2eb89,_0x303056=loadBffProjectConfig(_0x1618b0[_0x27991e(0x1e8)]),_0x2b8690=await readBffLockFile(_0x303056[_0x27991e(0x1ed)]),{lockData:_0xafe405,appLock:_0x28e8b9}=ensureLockScope(_0x2b8690??createEmptyBffLock(),_0x1618b0[_0x27991e(0x1e8)],_0x303056[_0x27991e(0x1eb)],_0x27991e(0x1ef)),_0x210f6d=normalizeBffType(_0x1618b0[_0x27991e(0x1e0)](_0x27991e(0x1b2)))??undefined;if(_0x1618b0[_0x27991e(0x1e0)]('type')&&!_0x210f6d)throw CliErrors[_0x27991e(0x1b4)](_0x27991e(0x1d7));const [_0x11e7d6,_0x2b4f71]=await Promise['all']([listBffScripts(_0x1618b0[_0x27991e(0x1e8)],_0x210f6d),getBffScriptStatistics(_0x1618b0['appCode'])]);if(_0x11e7d6[_0x27991e(0x1b7)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x27991e(0x1e3)};const _0x2a6ee5=_0x1618b0[_0x27991e(0x1ea)](_0x27991e(0x1c2));if(_0x2a6ee5&&!_0x1618b0['nonInteractive']){const _0x3f8e1c=await confirmForce();if(!_0x3f8e1c)throw CliErrors[_0x27991e(0x1d4)](_0x27991e(0x1e6));}if(_0x2a6ee5&&_0x1618b0['nonInteractive']){}const _0x809ea6=buildDatasetCodeToAliasMap(_0x1618b0[_0x27991e(0x1cc)],_0x1618b0['appCode']),_0x4bad73=createHookLocationMap(_0x2b4f71),_0x4e11f6=JSON[_0x27991e(0x1b8)](JSON[_0x27991e(0x1d8)](_0xafe405)),_0xbcc125=_0x1618b0['appCode'],_0x46eb65=_0x4e11f6[_0x27991e(0x1da)][_0xbcc125];if(!_0x46eb65)throw new Error(_0x27991e(0x1b0)+_0xbcc125+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x5aa050=[],_0x225444=[],_0x21f52e=[];for(const _0x56aa86 of _0x11e7d6){const _0x50a9bf=resolveRemoteScriptTarget(_0x303056,_0x56aa86,_0x4bad73,_0x28e8b9[_0x27991e(0x1a9)],_0x809ea6);if(!_0x50a9bf){_0x225444[_0x27991e(0x1d1)]({'lockKey':_0x56aa86['scriptType']+'/'+_0x56aa86[_0x27991e(0x1d5)],'reason':_0x27991e(0x1c6)});continue;}const _0x201613=_0x28e8b9[_0x27991e(0x1a9)][_0x50a9bf[_0x27991e(0x1f1)]];try{if(!_0x56aa86['id'])throw new Error(_0x27991e(0x1aa));if(_0x56aa86[_0x27991e(0x1e2)]==null)throw new Error(_0x27991e(0x1b3));const _0x505f2f=_0x56aa86[_0x27991e(0x1e2)],_0x43fc22=computeContentHash(_0x505f2f);if(!_0x2a6ee5){const _0x5bfedf=await hasUnsyncedLocalChanges(_0x50a9bf[_0x27991e(0x1b9)],_0x201613,_0x43fc22);if(_0x5bfedf){_0x225444[_0x27991e(0x1d1)]({'lockKey':_0x50a9bf[_0x27991e(0x1f1)],'reason':_0x27991e(0x1d9)});continue;}}await ensureParentDirectory(_0x50a9bf[_0x27991e(0x1b9)]),await writeFile(_0x50a9bf[_0x27991e(0x1b9)],_0x505f2f,_0x27991e(0x1d0));const _0x39973f={'hash':_0x43fc22,'remoteId':_0x56aa86['id'],'version':_0x56aa86['version']};_0x50a9bf[_0x27991e(0x1b2)]==='HOOK'&&_0x50a9bf[_0x27991e(0x1ee)]&&(_0x39973f[_0x27991e(0x1c3)]=_0x50a9bf[_0x27991e(0x1ee)]['alias'],_0x39973f[_0x27991e(0x1ae)]=_0x50a9bf['hookLocation'][_0x27991e(0x1ae)],_0x39973f[_0x27991e(0x1c8)]=_0x50a9bf['hookLocation'][_0x27991e(0x1c8)],_0x39973f[_0x27991e(0x1ac)]=_0x50a9bf[_0x27991e(0x1ee)][_0x27991e(0x1ac)]),_0x46eb65['functions'][_0x50a9bf['lockKey']]=_0x39973f,_0x5aa050[_0x27991e(0x1d1)]({'lockKey':_0x50a9bf[_0x27991e(0x1f1)],'remoteId':_0x56aa86['id']});}catch(_0x1b6368){_0x21f52e[_0x27991e(0x1d1)]({'lockKey':_0x50a9bf[_0x27991e(0x1f1)],'error':_0x1b6368 instanceof Error?_0x1b6368[_0x27991e(0x1bf)]:String(_0x1b6368)});}}return _0x46eb65[_0x27991e(0x1e1)]=new Date()[_0x27991e(0x1c1)](),await writeBffLockFile(_0x303056[_0x27991e(0x1ed)],_0x4e11f6),{'ok':_0x21f52e['length']===0x0,'data':{'pulled':_0x5aa050,'skipped':_0x225444,'failed':_0x21f52e},'message':_0x27991e(0x1bb)+_0x5aa050['length']+_0x27991e(0x1b1)+_0x225444[_0x27991e(0x1b7)]+_0x27991e(0x1dd)+_0x21f52e['length']+_0x27991e(0x1c9)};}};function a36_0x218a(_0x952716,_0x1b4d63){_0x952716=_0x952716-0x1a9;const _0x25b527=a36_0x25b5();let _0x218a6c=_0x25b527[_0x952716];return _0x218a6c;}async function hasUnsyncedLocalChanges(_0x2f6449,_0x38d3b0,_0x5eb40e){const _0x55e546=a36_0xa2eb89;if(!await fileExists(_0x2f6449))return![];const _0x3d7216=await computeFileHash(_0x2f6449);if(!_0x38d3b0)return _0x5eb40e?_0x3d7216!==_0x5eb40e:!![];return _0x3d7216!==_0x38d3b0[_0x55e546(0x1cf)];}function buildDatasetCodeToAliasMap(_0x34f07e,_0x2111b7){const _0x40e2fe=a36_0xa2eb89,_0x476896=loadAliasMap(_0x34f07e,undefined,resolveApiFilePath(_0x34f07e,_0x2111b7));return new Map(_0x476896[_0x40e2fe(0x1b6)](_0xe123cb=>[_0xe123cb[_0x40e2fe(0x1ae)],_0xe123cb[_0x40e2fe(0x1c3)]]));}async function confirmForce(){const _0x41d0e3=a36_0xa2eb89,_0x213544=createInterface({'input':process[_0x41d0e3(0x1c0)],'output':process[_0x41d0e3(0x1f2)]}),_0x5b9586=await new Promise(_0x589e4b=>{const _0x31d6f2=_0x41d0e3;_0x213544['question'](_0x31d6f2(0x1c7),_0x589e4b);});return _0x213544['close'](),['y',_0x41d0e3(0x1e9)][_0x41d0e3(0x1f3)](_0x5b9586['trim']()[_0x41d0e3(0x1f0)]());}function a36_0x25b5(){const _0x41ad39=['/api/management/library/scripts/list?appCode=','bff','message','stdin','toISOString','force','alias','ENDPOINT','15LNZbLl','unresolvable\x20target\x20path','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','operationType','\x20failed','all','Force\x20overwrite\x20local\x20unsynced\x20changes','apiDir','3PuHPtC','4929642JmUDQb','hash','utf8','push','read','Would\x20inspect\x20','cancelled','functionName','777915YWcmmj','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','stringify','local\x20unsynced\x20changes','apps','1409802sIFemO','HOOK','\x20skipped,\x20','skipped','COMMON','str','lastSync','scriptContent','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','1545560eAvVsQ','Force\x20pull\x20cancelled.','3492960NJLnNG','appCode','yes','bool','scriptsRoot','conflict','lockFilePath','hookLocation','pull','toLowerCase','lockKey','stderr','includes','functions','Remote\x20script\x20missing\x20id.','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','functionNode','3098276jqWHEB','datasetCode','scriptType','Lock\x20scope\x20for\x20app\x20\x22','\x20pulled,\x20','type','Remote\x20script\x20missing\x20content.','validation','boolean','map','length','parse','filePath','GET','Pull\x20complete:\x20','6270656wyNtnN'];a36_0x25b5=function(){return _0x41ad39;};return a36_0x25b5();}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a37_0x1031ca=a37_0x521e;(function(_0x2e57e9,_0x24f606){const _0x56aee3=a37_0x521e,_0x2075bc=_0x2e57e9();while(!![]){try{const _0x1fbea8=parseInt(_0x56aee3(0x8f))/0x1+-parseInt(_0x56aee3(0x86))/0x2*(parseInt(_0x56aee3(0xab))/0x3)+parseInt(_0x56aee3(0xb6))/0x4*(-parseInt(_0x56aee3(0xcb))/0x5)+parseInt(_0x56aee3(0x93))/0x6+-parseInt(_0x56aee3(0x9c))/0x7*(parseInt(_0x56aee3(0x96))/0x8)+-parseInt(_0x56aee3(0xb9))/0x9*(parseInt(_0x56aee3(0xda))/0xa)+-parseInt(_0x56aee3(0xbd))/0xb*(-parseInt(_0x56aee3(0xc0))/0xc);if(_0x1fbea8===_0x24f606)break;else _0x2075bc['push'](_0x2075bc['shift']());}catch(_0x35449d){_0x2075bc['push'](_0x2075bc['shift']());}}}(a37_0x1100,0x69476));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';function a37_0x521e(_0x7c0901,_0x4b7c4d){_0x7c0901=_0x7c0901-0x86;const _0x110062=a37_0x1100();let _0x521ef0=_0x110062[_0x7c0901];return _0x521ef0;}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';import{automaticDeploymentSyncSucceeded,buildAutomaticDeploymentSyncPreview,runAutomaticDeploymentSync,validateAutomaticDeploymentSync}from'../../commands/deployment/auto-sync.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':a37_0x1031ca(0xc7),'command':a37_0x1031ca(0xaa),'description':a37_0x1031ca(0xba),'risk':a37_0x1031ca(0xaf),'flags':[{'name':a37_0x1031ca(0xa1),'type':a37_0x1031ca(0xd8),'description':'Push\x20only\x20this\x20script\x20type','enum':['COMMON',a37_0x1031ca(0xb7),a37_0x1031ca(0x9d)]},{'name':a37_0x1031ca(0xcd),'type':'string','description':a37_0x1031ca(0xd4)},{'name':'force','type':'boolean','description':a37_0x1031ca(0xa5)}],async 'validate'(_0x3ba62a){validateAutomaticDeploymentSync(_0x3ba62a);},async 'dryRun'(_0x17c5ff){const _0x117b28=a37_0x1031ca,_0x40fbaf=loadBffProjectConfig(_0x17c5ff[_0x117b28(0xbc)]),_0x48e327=await readBffLockFile(_0x40fbaf['lockFilePath']),{appLock:_0x49aa43}=ensureLockScope(_0x48e327??createEmptyBffLock(),_0x17c5ff['appCode'],_0x40fbaf[_0x117b28(0x8c)],_0x117b28(0xaa)),_0x5e6bc9=await getTargetFunctions(_0x40fbaf,_0x17c5ff),_0x23ef5b=_0x17c5ff[_0x117b28(0xc6)]('force'),_0x72023d=[],_0x5d9b25=[];for(const _0x7baa0e of _0x5e6bc9){const _0x246108=await computeFileHash(_0x7baa0e[_0x117b28(0x89)]),_0xe7bf75=_0x49aa43[_0x117b28(0xc2)][_0x7baa0e[_0x117b28(0xad)]],_0x47e407=!!_0xe7bf75&&_0xe7bf75[_0x117b28(0xbf)]===_0x246108,_0x6f7b68=!_0x23ef5b&&_0x47e407?_0x117b28(0xa8):_0x117b28(0xd3);_0x72023d[_0x117b28(0xaa)]({'lockKey':_0x7baa0e[_0x117b28(0xad)],'filePath':_0x7baa0e['filePath'],'remoteId':_0xe7bf75?.[_0x117b28(0x9a)]??null,'mode':_0xe7bf75?.[_0x117b28(0x9a)]?'update':'create','status':_0x6f7b68});if(_0x6f7b68==='would_push')_0x5d9b25[_0x117b28(0xaa)](_0x7baa0e['name']);}return{'method':_0x117b28(0x8d),'url':_0x117b28(0xb4),'deploymentSync':buildAutomaticDeploymentSyncPreview(_0x17c5ff,'bff',_0x5d9b25),'body':{'appCode':_0x17c5ff[_0x117b28(0xbc)],'force':_0x23ef5b,'files':_0x72023d,'cacheClearAtRuntime':_0x72023d[_0x117b28(0x9f)](_0x4741c0=>_0x4741c0[_0x117b28(0xc4)]===_0x117b28(0xd3)),'cacheClearAtRuntimeTimes':_0x72023d[_0x117b28(0x9f)](_0x28991c=>_0x28991c['status']==='would_push')?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x117b28(0x94)+_0x72023d['length']+_0x117b28(0xc9)};},async 'execute'(_0x2c82e3){const _0x2dc385=a37_0x1031ca,_0xc455c=loadBffProjectConfig(_0x2c82e3[_0x2dc385(0xbc)]),_0x119ce5=await readBffLockFile(_0xc455c[_0x2dc385(0x98)]),{lockData:_0x38c6d1,appLock:_0x2d7834}=ensureLockScope(_0x119ce5??createEmptyBffLock(),_0x2c82e3[_0x2dc385(0xbc)],_0xc455c['scriptsRoot'],_0x2dc385(0xaa)),_0x1863fa=await getTargetFunctions(_0xc455c,_0x2c82e3);if(_0x1863fa[_0x2dc385(0xc8)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':'No\x20local\x20Backend\x20Function\x20scripts\x20found.'};const _0x21f5c1=_0x2c82e3[_0x2dc385(0xc6)](_0x2dc385(0xa6)),_0x37bd4a=JSON[_0x2dc385(0xd1)](JSON[_0x2dc385(0xac)](_0x38c6d1)),_0x363e4d=_0x37bd4a[_0x2dc385(0xbe)][_0x2c82e3[_0x2dc385(0xbc)]];if(!_0x363e4d)throw new Error(_0x2dc385(0x9b)+_0x2c82e3[_0x2dc385(0xbc)]+_0x2dc385(0xb0));const _0x92926d=await buildHookMaps(_0x2c82e3[_0x2dc385(0xbc)],_0x2c82e3[_0x2dc385(0xb3)],_0x1863fa,_0x363e4d),_0x340613=[],_0x4063ac=[],_0x2cb369=[],_0xe7da50=[];for(const _0x1497cb of _0x1863fa){const _0x25ec98=await computeFileHash(_0x1497cb[_0x2dc385(0x89)]),_0x4a0b7a=_0x363e4d[_0x2dc385(0xc2)][_0x1497cb[_0x2dc385(0xad)]];if(!_0x21f5c1&&_0x4a0b7a&&_0x4a0b7a[_0x2dc385(0xbf)]===_0x25ec98){_0x2cb369[_0x2dc385(0xaa)]({'lockKey':_0x1497cb['lockKey'],'reason':'unchanged'});continue;}try{await uploadSingleFunction(_0x2c82e3[_0x2dc385(0xbc)],_0x1497cb,_0x363e4d,_0x92926d);const _0x2b9e7e=_0x363e4d['functions'][_0x1497cb[_0x2dc385(0xad)]];_0x340613[_0x2dc385(0xaa)]({'lockKey':_0x1497cb['lockKey'],'remoteId':_0x2b9e7e?.['remoteId']??0x0}),_0x4063ac[_0x2dc385(0xaa)](_0x1497cb[_0x2dc385(0xcd)]);}catch(_0x50cf5e){_0xe7da50[_0x2dc385(0xaa)]({'lockKey':_0x1497cb[_0x2dc385(0xad)],'error':_0x50cf5e instanceof Error?_0x50cf5e[_0x2dc385(0xc5)]:String(_0x50cf5e)});}}_0x363e4d[_0x2dc385(0x8a)]=new Date()['toISOString'](),await writeBffLockFile(_0xc455c[_0x2dc385(0x98)],_0x37bd4a),await waitForUploadedLockEntries(_0xc455c[_0x2dc385(0x98)],_0x2c82e3['appCode'],_0x340613[_0x2dc385(0xae)](_0x481e16=>_0x481e16[_0x2dc385(0xad)]));let _0x34948a={'attempted':![],'cleared':![]};if(_0x340613[_0x2dc385(0xc8)]>0x0)try{let _0x283947='';for(let _0x15229f=0x0;_0x15229f<CACHE_CLEAR_ATTEMPTS;_0x15229f+=0x1){_0x283947=await clearBffScriptCache(),_0x15229f<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x34948a={'attempted':!![],'cleared':!![],'message':_0x283947||_0x2dc385(0xd6)};}catch(_0x3132b8){_0x34948a={'attempted':!![],'cleared':![],'error':_0x3132b8 instanceof Error?_0x3132b8[_0x2dc385(0xc5)]:String(_0x3132b8)};}const _0x1dd8b8=_0xe7da50[_0x2dc385(0xc8)]===0x0&&(_0x34948a[_0x2dc385(0x91)]?_0x34948a[_0x2dc385(0xa3)]:!![]),_0x26a7da=await runAutomaticDeploymentSync(_0x2c82e3,_0x2dc385(0xc7),_0x4063ac,_0x1dd8b8),_0x27392a=_0x1dd8b8&&automaticDeploymentSyncSucceeded(_0x26a7da),_0x469ba4=_0x34948a['attempted']?_0x34948a[_0x2dc385(0xa3)]?_0x2dc385(0xd7):_0x2dc385(0xb8):_0x2dc385(0xb5),_0x1073e7=_0x26a7da[_0x2dc385(0x8e)]?_0x2dc385(0xd0)+_0x26a7da[_0x2dc385(0xc4)]:'';return{'ok':_0x27392a,'data':{'uploaded':_0x340613,'skipped':_0x2cb369,'failed':_0xe7da50,'cacheClear':_0x34948a,'deploymentSync':_0x26a7da},'message':_0x2dc385(0xa0)+_0x340613[_0x2dc385(0xc8)]+_0x2dc385(0xa9)+_0x2cb369[_0x2dc385(0xc8)]+'\x20skipped,\x20'+_0xe7da50['length']+'\x20failed,\x20'+_0x469ba4+_0x1073e7};}};async function getTargetFunctions(_0x1aaa89,_0x5e9c8f){const _0x2a0ebf=a37_0x1031ca,_0x3ed266=_0x5e9c8f[_0x2a0ebf(0xa7)](_0x2a0ebf(0xa1)),_0x55766b=_0x5e9c8f[_0x2a0ebf(0xa7)](_0x2a0ebf(0xcd)),_0x4b171f=normalizeBffType(_0x3ed266)??undefined;if(_0x55766b&&!_0x4b171f)throw CliErrors['validation']('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x46da24=await scanLocalBffFunctions(_0x1aaa89,_0x4b171f);if(_0x55766b){const _0x4a324c=_0x46da24[_0x2a0ebf(0x8b)](_0x3684a3=>_0x3684a3[_0x2a0ebf(0xcd)]===_0x55766b);if(_0x4a324c[_0x2a0ebf(0xc8)]===0x0)throw CliErrors[_0x2a0ebf(0x95)](_0x2a0ebf(0xcc)+_0x4b171f+'/'+_0x55766b);return _0x4a324c;}return _0x46da24;}async function buildHookMaps(_0x4fa1b1,_0x539259,_0x277a9f,_0x18f68c){const _0x42a9ad=a37_0x1031ca,_0x493779=_0x277a9f[_0x42a9ad(0x9f)](_0x2535ca=>_0x2535ca[_0x42a9ad(0xa1)]==='HOOK');if(!_0x493779)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x354f88=loadAliasMap(_0x539259,undefined,resolveApiFilePath(_0x539259,_0x4fa1b1)),_0x5902f7=new Map(_0x354f88[_0x42a9ad(0xae)](_0x33df3f=>[_0x33df3f[_0x42a9ad(0xbb)],_0x33df3f[_0x42a9ad(0xdb)]]));for(const _0x274de5 of Object[_0x42a9ad(0xca)](_0x18f68c['functions'])){_0x274de5['alias']&&_0x274de5['datasetCode']&&!_0x5902f7['has'](_0x274de5[_0x42a9ad(0xbb)])&&_0x5902f7[_0x42a9ad(0xc3)](_0x274de5[_0x42a9ad(0xbb)],_0x274de5[_0x42a9ad(0xdb)]);}const _0x51ca02=await listDatasets(_0x4fa1b1),_0x141876=new Map(_0x51ca02[_0x42a9ad(0xae)](_0x4aad7d=>[_0x4aad7d[_0x42a9ad(0xd5)],_0x4aad7d]));return{'aliasToDatasetCode':_0x5902f7,'datasetCodeToDataset':_0x141876};}async function uploadSingleFunction(_0x43f064,_0x1e11d1,_0x565d06,_0x2b6449){const _0x3dd2f5=a37_0x1031ca,_0x53a1a4=await readFile(_0x1e11d1[_0x3dd2f5(0x89)],'utf8'),_0x1590d0=await computeFileHash(_0x1e11d1['filePath']),_0x5ea07b=_0x565d06[_0x3dd2f5(0xc2)][_0x1e11d1['lockKey']];if(_0x5ea07b?.[_0x3dd2f5(0x9a)]&&_0x5ea07b[_0x3dd2f5(0x9e)]==null)throw CliErrors[_0x3dd2f5(0x95)](_0x1e11d1[_0x3dd2f5(0xad)]+_0x3dd2f5(0xce));let _0x5afd9b=extractScriptDescription(_0x53a1a4);if(!_0x5afd9b&&_0x5ea07b?.['remoteId']){const _0x30ea15=await getBffScriptInfo(_0x5ea07b[_0x3dd2f5(0x9a)]);_0x5afd9b=_0x30ea15[_0x3dd2f5(0x87)]||undefined;}const _0x2d9bba={'appCode':_0x43f064,'functionName':_0x1e11d1[_0x3dd2f5(0xcd)],'scriptType':_0x1e11d1[_0x3dd2f5(0xa1)],'scriptContent':_0x53a1a4};if(_0x5ea07b?.['remoteId'])_0x2d9bba['id']=_0x5ea07b['remoteId'];if(_0x5ea07b?.['version']!=null)_0x2d9bba[_0x3dd2f5(0x9e)]=_0x5ea07b[_0x3dd2f5(0x9e)];if(_0x5afd9b)_0x2d9bba[_0x3dd2f5(0x87)]=_0x5afd9b;if(_0x1e11d1[_0x3dd2f5(0xa1)]===_0x3dd2f5(0x9d)){const _0x552b30=_0x1e11d1[_0x3dd2f5(0xbb)];if(!_0x552b30||!_0x1e11d1[_0x3dd2f5(0xcf)]||!_0x1e11d1[_0x3dd2f5(0xb1)])throw CliErrors[_0x3dd2f5(0x95)](_0x3dd2f5(0x92)+_0x1e11d1[_0x3dd2f5(0xad)]);const _0x2e5d8e=_0x2b6449[_0x3dd2f5(0xb2)][_0x3dd2f5(0x97)](_0x552b30)??_0x5ea07b?.['datasetCode']??_0x552b30,_0x5a30ae=_0x2b6449[_0x3dd2f5(0x90)]['get'](_0x2e5d8e);if(!_0x5a30ae)throw CliErrors['validation'](_0x3dd2f5(0xd2)+_0x552b30+_0x3dd2f5(0xa4)+('Run\x20`'+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.'));_0x2d9bba[_0x3dd2f5(0x88)]=_0x5a30ae['id'],_0x2d9bba[_0x3dd2f5(0xcf)]=_0x1e11d1[_0x3dd2f5(0xcf)],_0x2d9bba[_0x3dd2f5(0xb1)]=_0x1e11d1[_0x3dd2f5(0xb1)];}const _0x56b639=await saveBffScript(_0x2d9bba),_0x5bd03d=_0x56b639['id'],_0x2276bb=_0x56b639[_0x3dd2f5(0xdc)]??await getBffScriptInfo(_0x5bd03d),_0x28a7d1={'hash':_0x1590d0,'remoteId':_0x5bd03d,'version':_0x2276bb[_0x3dd2f5(0x9e)]};if(_0x1e11d1[_0x3dd2f5(0xa1)]===_0x3dd2f5(0x9d)){const _0x40f0a5=_0x1e11d1[_0x3dd2f5(0xbb)],_0x2d1687=_0x2b6449['aliasToDatasetCode']['get'](_0x40f0a5)??_0x5ea07b?.[_0x3dd2f5(0xdb)]??_0x40f0a5;_0x2b6449[_0x3dd2f5(0xb2)][_0x3dd2f5(0xd9)](_0x40f0a5)?_0x28a7d1[_0x3dd2f5(0xbb)]=_0x40f0a5:_0x28a7d1['alias']=_0x5ea07b?.[_0x3dd2f5(0xbb)],_0x28a7d1[_0x3dd2f5(0xdb)]=_0x2d1687,_0x28a7d1[_0x3dd2f5(0xcf)]=_0x1e11d1[_0x3dd2f5(0xcf)],_0x28a7d1[_0x3dd2f5(0xb1)]=_0x1e11d1['functionNode'];}_0x565d06[_0x3dd2f5(0xc2)][_0x1e11d1[_0x3dd2f5(0xad)]]=_0x28a7d1;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;function a37_0x1100(){const _0x4c6bde=['runtime\x20cache\x20clear\x20failed','9mQeRWa','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','alias','appCode','11CkwYwW','apps','hash','17383332NSzAok','join','functions','set','status','message','bool','bff','length','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','values','35mHfyYQ','Local\x20function\x20not\x20found:\x20','name',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','operationType',',\x20deployment\x20sync\x20','parse','Cannot\x20resolve\x20dataset\x20for\x20\x22','would_push','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','code','Runtime\x20script\x20cache\x20cleared.','runtime\x20cache\x20cleared','string','has','5374520UShzRI','datasetCode','script','2OgOYCl','description','datasetId','filePath','lastSync','filter','scriptsRoot','POST','configured','818134JwqVnu','datasetCodeToDataset','attempted','Incomplete\x20HOOK\x20path:\x20','75582hZEdfJ','Would\x20inspect\x20','validation','24onzeqR','get','lockFilePath','every','remoteId','Lock\x20scope\x20for\x20app\x20\x22','1812916ItRdkZ','HOOK','version','some','Push\x20complete:\x20','type','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','cleared','\x22.\x20','Force\x20push\x20ignoring\x20hash\x20protection','force','str','unchanged','\x20uploaded,\x20','push','1416039PRnuwc','stringify','lockKey','map','write','\x22\x20not\x20found\x20after\x20ensureLockScope.','functionNode','aliasToDatasetCode','apiDir','/api/management/library/scripts/save','runtime\x20cache\x20not\x20needed','35252qepmlr','ENDPOINT'];a37_0x1100=function(){return _0x4c6bde;};return a37_0x1100();}async function waitForUploadedLockEntries(_0x471bec,_0x34c688,_0x531318){const _0x3ad5f3=a37_0x1031ca;if(_0x531318['length']===0x0)return;for(let _0x43d020=0x0;_0x43d020<LOCK_SETTLE_RETRY_COUNT;_0x43d020+=0x1){const _0x16c47b=await readBffLockFile(_0x471bec),_0x5a0c86=_0x16c47b?.[_0x3ad5f3(0xbe)]?.[_0x34c688]?.['functions']??{},_0x5dfde0=_0x531318[_0x3ad5f3(0x99)](_0x5b2157=>!!_0x5a0c86[_0x5b2157]?.[_0x3ad5f3(0x9a)]);if(_0x5dfde0)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x3ad5f3(0xa2)+_0x531318[_0x3ad5f3(0xc1)](',\x20')+'.');}
|
|
1
|
+
const a37_0x7cb864=a37_0x4919;(function(_0x42ac1d,_0x5a0e40){const _0x45e97e=a37_0x4919,_0x18721a=_0x42ac1d();while(!![]){try{const _0x374204=parseInt(_0x45e97e(0x1c1))/0x1*(parseInt(_0x45e97e(0x19d))/0x2)+parseInt(_0x45e97e(0x1a6))/0x3*(-parseInt(_0x45e97e(0x1ac))/0x4)+-parseInt(_0x45e97e(0x198))/0x5+-parseInt(_0x45e97e(0x1a1))/0x6+-parseInt(_0x45e97e(0x193))/0x7+-parseInt(_0x45e97e(0x19e))/0x8*(-parseInt(_0x45e97e(0x187))/0x9)+-parseInt(_0x45e97e(0x1a9))/0xa*(-parseInt(_0x45e97e(0x1b0))/0xb);if(_0x374204===_0x5a0e40)break;else _0x18721a['push'](_0x18721a['shift']());}catch(_0x5f1e36){_0x18721a['push'](_0x18721a['shift']());}}}(a37_0x4c09,0x5e8c8));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';function a37_0x4c09(){const _0x25d64a=['Local\x20function\x20not\x20found:\x20','every','Runtime\x20script\x20cache\x20cleared.','Push\x20only\x20this\x20script\x20type','alias','2yezxHi','name','Incomplete\x20HOOK\x20path:\x20','force','Would\x20inspect\x20','Run\x20`','runtime\x20cache\x20not\x20needed','has','Cannot\x20resolve\x20dataset\x20for\x20\x22','would_push','operationType','str','POST','\x20uploaded,\x20','type','runtime\x20cache\x20cleared','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','lastSync','ENDPOINT','lockFilePath','status','apps','string','code','bool',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','remoteId','create','1882107cbtDaV','version','some','hash','No\x20local\x20Backend\x20Function\x20scripts\x20found.','HOOK','push','description','\x20skipped,\x20','script','attempted','validation','4300583KzquZg','aliasToDatasetCode','update','apiDir','set','3712715xvLGTp','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','bff','functionNode','toISOString','458360rHCBIU','16hFrRLV','/api/management/library/scripts/save','filter','1617576XhePKY','filePath','stringify','cleared','write','12hrvRYz','\x22\x20not\x20found\x20after\x20ensureLockScope.','lockKey','20IHYETY','functions','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','688120KSqkgz','appCode','message','\x22.\x20','10039117gzNhAZ','scriptsRoot','unchanged','get','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','length','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','Push\x20complete:\x20','runtime\x20cache\x20clear\x20failed','map','datasetCode','join'];a37_0x4c09=function(){return _0x25d64a;};return a37_0x4c09();}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';import{automaticDeploymentSyncSucceeded,buildAutomaticDeploymentSyncPreview,runAutomaticDeploymentSync,validateAutomaticDeploymentSync}from'../../commands/deployment/auto-sync.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':a37_0x7cb864(0x18d),'description':'Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','risk':a37_0x7cb864(0x1a5),'flags':[{'name':a37_0x7cb864(0x179),'type':a37_0x7cb864(0x181),'description':a37_0x7cb864(0x1bf),'enum':['COMMON',a37_0x7cb864(0x17d),a37_0x7cb864(0x18c)]},{'name':a37_0x7cb864(0x1c2),'type':a37_0x7cb864(0x181),'description':a37_0x7cb864(0x17b)},{'name':a37_0x7cb864(0x1c4),'type':'boolean','description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'validate'(_0x1ff4d6){validateAutomaticDeploymentSync(_0x1ff4d6);},async 'dryRun'(_0x3c4243){const _0x5cd264=a37_0x7cb864,_0x1f5e03=loadBffProjectConfig(_0x3c4243[_0x5cd264(0x1ad)]),_0x210dae=await readBffLockFile(_0x1f5e03[_0x5cd264(0x17e)]),{appLock:_0x1054f6}=ensureLockScope(_0x210dae??createEmptyBffLock(),_0x3c4243['appCode'],_0x1f5e03[_0x5cd264(0x1b1)],_0x5cd264(0x18d)),_0x73a18f=await getTargetFunctions(_0x1f5e03,_0x3c4243),_0x120084=_0x3c4243[_0x5cd264(0x183)]('force'),_0x1a2a65=[],_0xee1df0=[];for(const _0x593b77 of _0x73a18f){const _0x31ac71=await computeFileHash(_0x593b77[_0x5cd264(0x1a2)]),_0x454144=_0x1054f6[_0x5cd264(0x1aa)][_0x593b77[_0x5cd264(0x1a8)]],_0x2554e0=!!_0x454144&&_0x454144['hash']===_0x31ac71,_0x48cc92=!_0x120084&&_0x2554e0?'unchanged':_0x5cd264(0x174);_0x1a2a65[_0x5cd264(0x18d)]({'lockKey':_0x593b77[_0x5cd264(0x1a8)],'filePath':_0x593b77[_0x5cd264(0x1a2)],'remoteId':_0x454144?.[_0x5cd264(0x185)]??null,'mode':_0x454144?.['remoteId']?_0x5cd264(0x195):_0x5cd264(0x186),'status':_0x48cc92});if(_0x48cc92===_0x5cd264(0x174))_0xee1df0[_0x5cd264(0x18d)](_0x593b77[_0x5cd264(0x1c2)]);}return{'method':_0x5cd264(0x177),'url':_0x5cd264(0x19f),'deploymentSync':buildAutomaticDeploymentSyncPreview(_0x3c4243,_0x5cd264(0x19a),_0xee1df0),'body':{'appCode':_0x3c4243[_0x5cd264(0x1ad)],'force':_0x120084,'files':_0x1a2a65,'cacheClearAtRuntime':_0x1a2a65[_0x5cd264(0x189)](_0x23b811=>_0x23b811[_0x5cd264(0x17f)]===_0x5cd264(0x174)),'cacheClearAtRuntimeTimes':_0x1a2a65[_0x5cd264(0x189)](_0x3f6062=>_0x3f6062[_0x5cd264(0x17f)]==='would_push')?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x5cd264(0x1c5)+_0x1a2a65['length']+_0x5cd264(0x1b6)};},async 'execute'(_0x366cec){const _0x237d90=a37_0x7cb864,_0x4972b2=loadBffProjectConfig(_0x366cec[_0x237d90(0x1ad)]),_0x5a8899=await readBffLockFile(_0x4972b2[_0x237d90(0x17e)]),{lockData:_0x45eb9c,appLock:_0x30e36f}=ensureLockScope(_0x5a8899??createEmptyBffLock(),_0x366cec[_0x237d90(0x1ad)],_0x4972b2['scriptsRoot'],_0x237d90(0x18d)),_0x329554=await getTargetFunctions(_0x4972b2,_0x366cec);if(_0x329554[_0x237d90(0x1b5)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x237d90(0x18b)};const _0x47586e=_0x366cec[_0x237d90(0x183)](_0x237d90(0x1c4)),_0x3245e8=JSON['parse'](JSON[_0x237d90(0x1a3)](_0x45eb9c)),_0x159abc=_0x3245e8[_0x237d90(0x180)][_0x366cec[_0x237d90(0x1ad)]];if(!_0x159abc)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x366cec[_0x237d90(0x1ad)]+_0x237d90(0x1a7));const _0x1853f3=await buildHookMaps(_0x366cec[_0x237d90(0x1ad)],_0x366cec[_0x237d90(0x196)],_0x329554,_0x159abc),_0x18e755=[],_0x4b3f77=[],_0x202c63=[],_0x4abe18=[];for(const _0x57bc10 of _0x329554){const _0x4dc89e=await computeFileHash(_0x57bc10[_0x237d90(0x1a2)]),_0x369fa7=_0x159abc['functions'][_0x57bc10['lockKey']];if(!_0x47586e&&_0x369fa7&&_0x369fa7[_0x237d90(0x18a)]===_0x4dc89e){_0x202c63[_0x237d90(0x18d)]({'lockKey':_0x57bc10['lockKey'],'reason':_0x237d90(0x1b2)});continue;}try{await uploadSingleFunction(_0x366cec[_0x237d90(0x1ad)],_0x57bc10,_0x159abc,_0x1853f3);const _0xe99886=_0x159abc['functions'][_0x57bc10[_0x237d90(0x1a8)]];_0x18e755[_0x237d90(0x18d)]({'lockKey':_0x57bc10[_0x237d90(0x1a8)],'remoteId':_0xe99886?.['remoteId']??0x0}),_0x4b3f77[_0x237d90(0x18d)](_0x57bc10['name']);}catch(_0x5ddbca){_0x4abe18['push']({'lockKey':_0x57bc10[_0x237d90(0x1a8)],'error':_0x5ddbca instanceof Error?_0x5ddbca['message']:String(_0x5ddbca)});}}_0x159abc[_0x237d90(0x17c)]=new Date()[_0x237d90(0x19c)](),await writeBffLockFile(_0x4972b2[_0x237d90(0x17e)],_0x3245e8),await waitForUploadedLockEntries(_0x4972b2[_0x237d90(0x17e)],_0x366cec['appCode'],_0x18e755['map'](_0x3f7eea=>_0x3f7eea[_0x237d90(0x1a8)]));let _0x320921={'attempted':![],'cleared':![]};if(_0x18e755[_0x237d90(0x1b5)]>0x0)try{let _0x2eef76='';for(let _0x3ca278=0x0;_0x3ca278<CACHE_CLEAR_ATTEMPTS;_0x3ca278+=0x1){_0x2eef76=await clearBffScriptCache(),_0x3ca278<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x320921={'attempted':!![],'cleared':!![],'message':_0x2eef76||_0x237d90(0x1be)};}catch(_0x29f167){_0x320921={'attempted':!![],'cleared':![],'error':_0x29f167 instanceof Error?_0x29f167[_0x237d90(0x1ae)]:String(_0x29f167)};}const _0x40ec05=_0x4abe18[_0x237d90(0x1b5)]===0x0&&(_0x320921[_0x237d90(0x191)]?_0x320921['cleared']:!![]),_0x1a7643=await runAutomaticDeploymentSync(_0x366cec,_0x237d90(0x19a),_0x4b3f77,_0x40ec05),_0x227ccb=_0x40ec05&&automaticDeploymentSyncSucceeded(_0x1a7643),_0x57c8dc=_0x320921[_0x237d90(0x191)]?_0x320921[_0x237d90(0x1a4)]?_0x237d90(0x17a):_0x237d90(0x1b8):_0x237d90(0x1c7),_0x4a370d=_0x1a7643['configured']?',\x20deployment\x20sync\x20'+_0x1a7643['status']:'';return{'ok':_0x227ccb,'data':{'uploaded':_0x18e755,'skipped':_0x202c63,'failed':_0x4abe18,'cacheClear':_0x320921,'deploymentSync':_0x1a7643},'message':_0x237d90(0x1b7)+_0x18e755[_0x237d90(0x1b5)]+_0x237d90(0x178)+_0x202c63[_0x237d90(0x1b5)]+_0x237d90(0x18f)+_0x4abe18['length']+'\x20failed,\x20'+_0x57c8dc+_0x4a370d};}};async function getTargetFunctions(_0x31a53e,_0x30a764){const _0x1d8aa7=a37_0x7cb864,_0x360101=_0x30a764['str']('type'),_0x3d7dd9=_0x30a764[_0x1d8aa7(0x176)](_0x1d8aa7(0x1c2)),_0x4eba5b=normalizeBffType(_0x360101)??undefined;if(_0x3d7dd9&&!_0x4eba5b)throw CliErrors['validation'](_0x1d8aa7(0x1ab));const _0x5b6b90=await scanLocalBffFunctions(_0x31a53e,_0x4eba5b);if(_0x3d7dd9){const _0x35f64f=_0x5b6b90[_0x1d8aa7(0x1a0)](_0x2722b3=>_0x2722b3[_0x1d8aa7(0x1c2)]===_0x3d7dd9);if(_0x35f64f[_0x1d8aa7(0x1b5)]===0x0)throw CliErrors[_0x1d8aa7(0x192)](_0x1d8aa7(0x1bc)+_0x4eba5b+'/'+_0x3d7dd9);return _0x35f64f;}return _0x5b6b90;}async function buildHookMaps(_0x1eba3b,_0x5f2d2f,_0x5cf788,_0xba94fb){const _0x3d0f38=a37_0x7cb864,_0x36400e=_0x5cf788[_0x3d0f38(0x189)](_0x3d0d26=>_0x3d0d26['type']===_0x3d0f38(0x18c));if(!_0x36400e)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x5ce253=loadAliasMap(_0x5f2d2f,undefined,resolveApiFilePath(_0x5f2d2f,_0x1eba3b)),_0x4d87f3=new Map(_0x5ce253[_0x3d0f38(0x1b9)](_0x32b2dd=>[_0x32b2dd[_0x3d0f38(0x1c0)],_0x32b2dd[_0x3d0f38(0x1ba)]]));for(const _0x365073 of Object['values'](_0xba94fb[_0x3d0f38(0x1aa)])){_0x365073[_0x3d0f38(0x1c0)]&&_0x365073[_0x3d0f38(0x1ba)]&&!_0x4d87f3[_0x3d0f38(0x1c8)](_0x365073[_0x3d0f38(0x1c0)])&&_0x4d87f3[_0x3d0f38(0x197)](_0x365073[_0x3d0f38(0x1c0)],_0x365073['datasetCode']);}const _0x4fd6cb=await listDatasets(_0x1eba3b),_0x2c6d32=new Map(_0x4fd6cb[_0x3d0f38(0x1b9)](_0x438497=>[_0x438497[_0x3d0f38(0x182)],_0x438497]));return{'aliasToDatasetCode':_0x4d87f3,'datasetCodeToDataset':_0x2c6d32};}async function uploadSingleFunction(_0x5adfbc,_0x419ea4,_0x16c30e,_0x44329d){const _0x28cdef=a37_0x7cb864,_0x2dea32=await readFile(_0x419ea4['filePath'],'utf8'),_0x3afc90=await computeFileHash(_0x419ea4[_0x28cdef(0x1a2)]),_0x3995ed=_0x16c30e[_0x28cdef(0x1aa)][_0x419ea4[_0x28cdef(0x1a8)]];if(_0x3995ed?.[_0x28cdef(0x185)]&&_0x3995ed['version']==null)throw CliErrors[_0x28cdef(0x192)](_0x419ea4['lockKey']+_0x28cdef(0x184));let _0x930346=extractScriptDescription(_0x2dea32);if(!_0x930346&&_0x3995ed?.[_0x28cdef(0x185)]){const _0x3a1920=await getBffScriptInfo(_0x3995ed[_0x28cdef(0x185)]);_0x930346=_0x3a1920[_0x28cdef(0x18e)]||undefined;}const _0x39df36={'appCode':_0x5adfbc,'functionName':_0x419ea4[_0x28cdef(0x1c2)],'scriptType':_0x419ea4[_0x28cdef(0x179)],'scriptContent':_0x2dea32};if(_0x3995ed?.['remoteId'])_0x39df36['id']=_0x3995ed[_0x28cdef(0x185)];if(_0x3995ed?.['version']!=null)_0x39df36['version']=_0x3995ed[_0x28cdef(0x188)];if(_0x930346)_0x39df36[_0x28cdef(0x18e)]=_0x930346;if(_0x419ea4[_0x28cdef(0x179)]===_0x28cdef(0x18c)){const _0x43b095=_0x419ea4[_0x28cdef(0x1c0)];if(!_0x43b095||!_0x419ea4[_0x28cdef(0x175)]||!_0x419ea4['functionNode'])throw CliErrors[_0x28cdef(0x192)](_0x28cdef(0x1c3)+_0x419ea4['lockKey']);const _0x4353d4=_0x44329d[_0x28cdef(0x194)][_0x28cdef(0x1b3)](_0x43b095)??_0x3995ed?.[_0x28cdef(0x1ba)]??_0x43b095,_0x39b821=_0x44329d['datasetCodeToDataset'][_0x28cdef(0x1b3)](_0x4353d4);if(!_0x39b821)throw CliErrors[_0x28cdef(0x192)](_0x28cdef(0x1c9)+_0x43b095+_0x28cdef(0x1af)+(_0x28cdef(0x1c6)+CLI_BIN_NAME+_0x28cdef(0x199)));_0x39df36['datasetId']=_0x39b821['id'],_0x39df36[_0x28cdef(0x175)]=_0x419ea4[_0x28cdef(0x175)],_0x39df36[_0x28cdef(0x19b)]=_0x419ea4['functionNode'];}const _0x2b6701=await saveBffScript(_0x39df36),_0x4f6a6b=_0x2b6701['id'],_0x17b5e6=_0x2b6701[_0x28cdef(0x190)]??await getBffScriptInfo(_0x4f6a6b),_0x1c381a={'hash':_0x3afc90,'remoteId':_0x4f6a6b,'version':_0x17b5e6[_0x28cdef(0x188)]};if(_0x419ea4[_0x28cdef(0x179)]==='HOOK'){const _0x21dd91=_0x419ea4[_0x28cdef(0x1c0)],_0x5b81c9=_0x44329d[_0x28cdef(0x194)][_0x28cdef(0x1b3)](_0x21dd91)??_0x3995ed?.[_0x28cdef(0x1ba)]??_0x21dd91;_0x44329d[_0x28cdef(0x194)]['has'](_0x21dd91)?_0x1c381a['alias']=_0x21dd91:_0x1c381a[_0x28cdef(0x1c0)]=_0x3995ed?.[_0x28cdef(0x1c0)],_0x1c381a[_0x28cdef(0x1ba)]=_0x5b81c9,_0x1c381a[_0x28cdef(0x175)]=_0x419ea4['operationType'],_0x1c381a[_0x28cdef(0x19b)]=_0x419ea4[_0x28cdef(0x19b)];}_0x16c30e[_0x28cdef(0x1aa)][_0x419ea4[_0x28cdef(0x1a8)]]=_0x1c381a;}function a37_0x4919(_0x473ac7,_0xe50a57){_0x473ac7=_0x473ac7-0x174;const _0x4c09b5=a37_0x4c09();let _0x491971=_0x4c09b5[_0x473ac7];return _0x491971;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x2f2d93,_0x48eafe,_0x1e2a69){const _0x1feb13=a37_0x7cb864;if(_0x1e2a69[_0x1feb13(0x1b5)]===0x0)return;for(let _0x500e17=0x0;_0x500e17<LOCK_SETTLE_RETRY_COUNT;_0x500e17+=0x1){const _0x686382=await readBffLockFile(_0x2f2d93),_0x5126b2=_0x686382?.[_0x1feb13(0x180)]?.[_0x48eafe]?.['functions']??{},_0x5eafa8=_0x1e2a69[_0x1feb13(0x1bd)](_0x274dfe=>!!_0x5126b2[_0x274dfe]?.['remoteId']);if(_0x5eafa8)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x1feb13(0x1b4)+_0x1e2a69[_0x1feb13(0x1bb)](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x475089=a38_0x104f;function a38_0x5e6f(){const _0x5168b1=['status','all','boolean','bool','scriptsRoot','read','546640DxrEjr','5076ZZkcTS','length','262171iGTGkt','map','58395KRUpIQ','3385488mHHaQK','66ewJmJe','90jtmGGu','\x20unchanged','957205pHlQDE','lockKey','alias','All\x20Backend\x20Function\x20scripts\x20are\x20in\x20sync.','Check\x20local\x20Backend\x20Function\x20sync\x20status\x20against\x20lock\x20file','functions','apiDir','lockFilePath','108zKrGaM','appCode','push','hash','has','\x20remote-only','bff','81qdFfrw','datasetCode','1568436qVmmul','\x20modified,\x20','remote','682ARFoYk'];a38_0x5e6f=function(){return _0x5168b1;};return a38_0x5e6f();}(function(_0x5c16c0,_0x2d2ded){const _0x42b288=a38_0x104f,_0x5b495e=_0x5c16c0();while(!![]){try{const _0xa830fc=-parseInt(_0x42b288(0x92))/0x1+parseInt(_0x42b288(0xa6))/0x2*(parseInt(_0x42b288(0xae))/0x3)+parseInt(_0x42b288(0x9a))/0x4*(-parseInt(_0x42b288(0xb2))/0x5)+parseInt(_0x42b288(0xb5))/0x6*(parseInt(_0x42b288(0xb0))/0x7)+parseInt(_0x42b288(0xb3))/0x8+parseInt(_0x42b288(0xa1))/0x9*(-parseInt(_0x42b288(0xad))/0xa)+parseInt(_0x42b288(0xb4))/0xb*(parseInt(_0x42b288(0xa3))/0xc);if(_0xa830fc===_0x2d2ded)break;else _0x5b495e['push'](_0x5b495e['shift']());}catch(_0x37989a){_0x5b495e['push'](_0x5b495e['shift']());}}}(a38_0x5e6f,0x8e019));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';function a38_0x104f(_0x3709dd,_0x2a1547){_0x3709dd=_0x3709dd-0x91;const _0x5e6fb3=a38_0x5e6f();let _0x104fbb=_0x5e6fb3[_0x3709dd];return _0x104fbb;}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':a38_0x475089(0xa0),'command':'status','description':a38_0x475089(0x96),'risk':a38_0x475089(0xac),'flags':[{'name':a38_0x475089(0xa5),'type':a38_0x475089(0xa9),'description':'Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally'}],async 'execute'(_0x4ef404){const _0x433ce6=a38_0x475089,_0x4e7547=loadBffProjectConfig(_0x4ef404[_0x433ce6(0x9b)]),_0x59d9ab=await readBffLockFile(_0x4e7547[_0x433ce6(0x99)]),{appLock:_0x478693}=ensureLockScope(_0x59d9ab??createEmptyBffLock(),_0x4ef404[_0x433ce6(0x9b)],_0x4e7547[_0x433ce6(0xab)],_0x433ce6(0xa7)),_0x3b8788=await scanLocalBffFunctions(_0x4e7547),_0x3e86dc=[],_0x1f4210=[],_0x4a85b7=[];for(const _0x54d3dd of _0x3b8788){const _0x148a2b=await computeFileHash(_0x54d3dd['filePath']),_0x1ba0b0=_0x478693['functions'][_0x54d3dd[_0x433ce6(0x93)]];if(!_0x1ba0b0)_0x3e86dc[_0x433ce6(0x9c)](_0x54d3dd[_0x433ce6(0x93)]);else _0x1ba0b0[_0x433ce6(0x9d)]!==_0x148a2b?_0x1f4210[_0x433ce6(0x9c)](_0x54d3dd[_0x433ce6(0x93)]):_0x4a85b7[_0x433ce6(0x9c)](_0x54d3dd[_0x433ce6(0x93)]);}const _0x471424=[];if(_0x4ef404[_0x433ce6(0xaa)](_0x433ce6(0xa5))){const _0x33ae20=loadAliasMap(_0x4ef404[_0x433ce6(0x98)],undefined,resolveApiFilePath(_0x4ef404[_0x433ce6(0x98)],_0x4ef404['appCode'])),_0x42cb24=new Map(_0x33ae20[_0x433ce6(0xb1)](_0x405bf3=>[_0x405bf3[_0x433ce6(0xa2)],_0x405bf3[_0x433ce6(0x94)]])),[_0x3a3cc8,_0x415f24]=await Promise[_0x433ce6(0xa8)]([listBffScripts(_0x4ef404[_0x433ce6(0x9b)]),getBffScriptStatistics(_0x4ef404[_0x433ce6(0x9b)])]),_0x3166f2=createHookLocationMap(_0x415f24),_0x2ce266=new Set(_0x3b8788[_0x433ce6(0xb1)](_0x3314dd=>_0x3314dd[_0x433ce6(0x93)]));for(const _0x2e373a of _0x3a3cc8){const _0x461589=resolveRemoteScriptTarget(_0x4e7547,_0x2e373a,_0x3166f2,_0x478693[_0x433ce6(0x97)],_0x42cb24);_0x461589&&!_0x2ce266[_0x433ce6(0x9e)](_0x461589[_0x433ce6(0x93)])&&_0x471424[_0x433ce6(0x9c)](_0x461589[_0x433ce6(0x93)]);}}const _0x4b281b=_0x3e86dc['length']===0x0&&_0x1f4210['length']===0x0&&_0x471424[_0x433ce6(0xaf)]===0x0;return{'ok':!![],'data':{'added':_0x3e86dc,'modified':_0x1f4210,'unchanged':_0x4a85b7,'remoteOnly':_0x471424},'message':_0x4b281b?_0x433ce6(0x95):_0x3e86dc['length']+'\x20added,\x20'+_0x1f4210['length']+_0x433ce6(0xa4)+_0x4a85b7['length']+_0x433ce6(0x91)+(_0x471424[_0x433ce6(0xaf)]>0x0?',\x20'+_0x471424[_0x433ce6(0xaf)]+_0x433ce6(0x9f):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0x3d3ed8=a39_0x35af;function a39_0x35af(_0x2facc4,_0x36ca15){_0x2facc4=_0x2facc4-0x187;const _0x8f2e60=a39_0x8f2e();let _0x35af7a=_0x8f2e60[_0x2facc4];return _0x35af7a;}(function(_0x5953e2,_0x24d3c8){const _0x46c012=a39_0x35af,_0x36088c=_0x5953e2();while(!![]){try{const _0x22c121=-parseInt(_0x46c012(0x199))/0x1*(-parseInt(_0x46c012(0x18f))/0x2)+-parseInt(_0x46c012(0x18a))/0x3+parseInt(_0x46c012(0x192))/0x4+-parseInt(_0x46c012(0x18c))/0x5*(-parseInt(_0x46c012(0x19d))/0x6)+-parseInt(_0x46c012(0x19e))/0x7*(parseInt(_0x46c012(0x197))/0x8)+-parseInt(_0x46c012(0x191))/0x9+-parseInt(_0x46c012(0x1a4))/0xa*(-parseInt(_0x46c012(0x194))/0xb);if(_0x22c121===_0x24d3c8)break;else _0x36088c['push'](_0x36088c['shift']());}catch(_0x246187){_0x36088c['push'](_0x36088c['shift']());}}}(a39_0x8f2e,0x6c5ef));import{CliErrors}from'../../errors.js';function a39_0x8f2e(){const _0x589d72=['10awsNSN','pipe','7747425FItmgQ','2392956VAtOIS','read','3014uBMLNM','cli-skill-install','cwd','472RqHfJK','changed','133106HdjrYu','skillVersion','\x20via\x20skills@latest','repairCommand','6VxtpTk','94381DlWWxG','info','cli-skill','\x20installed','nonInteractive','installedPath','18930KBJLyq','code','unknown','\x20at\x20','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','CLI\x20Built-in\x20Skill\x20','926283GBMzEb','error','3132595OYbLGE','setLogPath','apiError'];a39_0x8f2e=function(){return _0x589d72;};return a39_0x8f2e();}import{installBuiltinSkill}from'../../skills/builtin-skill.js';import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a39_0x3d3ed8(0x1a0),'command':'install','description':a39_0x3d3ed8(0x188),'risk':a39_0x3d3ed8(0x193),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x47b3ef){const _0x4179d=a39_0x3d3ed8;logger[_0x4179d(0x18d)](process[_0x4179d(0x196)]()),logger[_0x4179d(0x19f)](_0x4179d(0x195),_0x4179d(0x187));const _0x13cbdd=installBuiltinSkill({'stdio':_0x47b3ef[_0x4179d(0x1a2)]?_0x4179d(0x190):'inherit'});if(!_0x13cbdd['ok'])throw CliErrors[_0x4179d(0x18e)]('Built-in\x20Skill\x20install\x20failed\x20['+_0x13cbdd[_0x4179d(0x1a5)]+']:\x20'+(_0x13cbdd[_0x4179d(0x18b)]||_0x4179d(0x1a6)),'Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20'+_0x13cbdd[_0x4179d(0x19c)]);return console['log'](_0x13cbdd[_0x4179d(0x198)]?_0x4179d(0x189)+_0x13cbdd[_0x4179d(0x19a)]+_0x4179d(0x1a1)+(_0x13cbdd[_0x4179d(0x1a3)]?_0x4179d(0x1a7)+_0x13cbdd[_0x4179d(0x1a3)]:_0x4179d(0x19b)):_0x4179d(0x189)+_0x13cbdd[_0x4179d(0x19a)]+'\x20is\x20already\x20current'+(_0x13cbdd['installedPath']?'\x20at\x20'+_0x13cbdd['installedPath']:'')),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a40_0x391f1f=a40_0x535e;(function(_0x5a198f,_0x400cf1){const _0x555b63=a40_0x535e,_0x1d7c78=_0x5a198f();while(!![]){try{const _0x469b79=parseInt(_0x555b63(0x1db))/0x1+parseInt(_0x555b63(0x1e7))/0x2*(parseInt(_0x555b63(0x1eb))/0x3)+parseInt(_0x555b63(0x209))/0x4+-parseInt(_0x555b63(0x1fd))/0x5*(-parseInt(_0x555b63(0x201))/0x6)+-parseInt(_0x555b63(0x1de))/0x7+-parseInt(_0x555b63(0x1cc))/0x8+-parseInt(_0x555b63(0x1cb))/0x9;if(_0x469b79===_0x400cf1)break;else _0x1d7c78['push'](_0x1d7c78['shift']());}catch(_0x4f87e6){_0x1d7c78['push'](_0x1d7c78['shift']());}}}(a40_0x287e,0x7d46d));import a40_0x559651 from'chalk';import a40_0x500cad from'ora';import a40_0x31962f 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';function a40_0x287e(){const _0x2de79c=['Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','...','validation','3410592udOZcJ','pipe',']:\x20','\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20','gray','state','\x20install\x20-g\x20','Beta\x20version:\x20','length','Current\x20version:\x20','fail','Already\x20on\x20requested\x20version\x20(v','entries','execPath','toLowerCase','beta','\x20is\x20up\x20to\x20date.','info','succeed','error','boolean','version','expected\x20','13223952AGasTm','1707064IBQPEQ','\x20\x20Try\x20manually:\x20','valid','string','read','update','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','slice','warn','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','npm','map','\x20is\x20newer\x20than\x20npm\x20latest\x20v','latest','green','649352SVrMEJ','run','trim','5524050BFLaKJ','Checking\x20for\x20updates...','red','object','Update\x20failed','message','\x20\x20Run\x20manually:\x20','timeout','Already\x20up\x20to\x20date\x20(v','174dRtPnM','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','yellow','Updating\x20via\x20','32841AQzVKc','log','filter','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version',',\x20state\x20','Version\x20comparison\x20failed','json','str','\x20→\x20','Current\x20version\x20v','@latest','Invalid\x20version:\x20','install','Install\x20a\x20specific\x20CLI\x20version','fromEntries','skillVersion','bool','Update\x20available:\x20','2653025WwDtRZ','\x20cli-skill\x20install','start','bun','6bsTKeu','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','unknown','source','code'];a40_0x287e=function(){return _0x2de79c;};return a40_0x287e();}import{inspectInstalledBuiltinSkillVersion,installBuiltinSkill}from'../skills/builtin-skill.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x313de0=a40_0x535e;return GIT_COMMIT!==_0x313de0(0x203)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x313de0(0x1d3)](0x0,0xa)+')':VERSION;}function a40_0x535e(_0x4e9f8a,_0x84fa18){_0x4e9f8a=_0x4e9f8a-0x1c7;const _0x287e9b=a40_0x287e();let _0x535e85=_0x287e9b[_0x4e9f8a];return _0x535e85;}function detectPackageManager(){const _0x2a1ce4=a40_0x535e,_0x530b47=process[_0x2a1ce4(0x216)][_0x2a1ce4(0x217)]();if(_0x530b47['includes']('bun'))return _0x2a1ce4(0x200);return'npm';}const updateFlags=[{'name':a40_0x391f1f(0x218),'type':a40_0x391f1f(0x1c8),'description':a40_0x391f1f(0x206),'default':![]},{'name':a40_0x391f1f(0x1c9),'type':a40_0x391f1f(0x1cf),'description':a40_0x391f1f(0x1f8)}];function getRequestedVersion(_0x183f49){const _0x53a0e2=a40_0x391f1f;return _0x183f49[_0x53a0e2(0x1f2)]('version')[_0x53a0e2(0x1dd)]();}async function validateUpdateFlags(_0x1747e6){const _0x475de6=a40_0x391f1f,_0x4c6fc3=_0x1747e6[_0x475de6(0x1fb)](_0x475de6(0x218)),_0x77503b=getRequestedVersion(_0x1747e6);if(_0x4c6fc3&&_0x77503b)throw CliErrors[_0x475de6(0x208)]('--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.',_0x475de6(0x1d2));if(_0x77503b&&!a40_0x31962f[_0x475de6(0x1ce)](_0x77503b))throw CliErrors['validation'](_0x475de6(0x1f6)+_0x77503b,_0x475de6(0x202));}async function fetchNpmDistTags(){const _0x27526b=a40_0x391f1f;try{const _0x2c721a=await fetch('https://registry.npmjs.org/-/package/'+encodeURIComponent(NPM_PACKAGE_NAME)+'/dist-tags',{'signal':AbortSignal[_0x27526b(0x1e5)](0x2710)});if(!_0x2c721a['ok'])return null;const _0x14df39=await _0x2c721a[_0x27526b(0x1f1)]();if(!_0x14df39||typeof _0x14df39!==_0x27526b(0x1e1))return null;return Object[_0x27526b(0x1f9)](Object[_0x27526b(0x215)](_0x14df39)[_0x27526b(0x1ed)](([,_0x1168df])=>typeof _0x1168df===_0x27526b(0x1cf)&&_0x1168df['trim']()[_0x27526b(0x211)]>0x0)[_0x27526b(0x1d7)](([_0x1d8108,_0x505b41])=>[_0x1d8108,String(_0x505b41)[_0x27526b(0x1dd)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x3e6ea8){const _0x2537ca=await fetchNpmDistTags();return _0x2537ca?.[_0x3e6ea8]??null;}async function fetchLatestVersion(){const _0x52aacc=a40_0x391f1f;return fetchNpmDistTagVersion(_0x52aacc(0x1d9));}async function resolveTargetVersion(_0x29d3ff){const _0x3c53f4=a40_0x391f1f,_0x556c09=getRequestedVersion(_0x29d3ff);if(_0x556c09)return{'version':_0x556c09,'source':'version'};if(_0x29d3ff[_0x3c53f4(0x1fb)]('beta')){const _0x5c84b8=await fetchNpmDistTagVersion('beta');if(!_0x5c84b8)return null;return{'version':_0x5c84b8,'source':_0x3c53f4(0x218)};}const _0x5bd754=await fetchLatestVersion();if(!_0x5bd754)return null;return{'version':_0x5bd754,'source':_0x3c53f4(0x1d9)};}function shouldInstallTarget(_0x417c6e,_0x3eb5dc){const _0x1caef9=a40_0x391f1f;if(_0x3eb5dc[_0x1caef9(0x204)]===_0x1caef9(0x1c9)||_0x3eb5dc[_0x1caef9(0x204)]===_0x1caef9(0x218))return!a40_0x31962f['eq'](_0x417c6e,_0x3eb5dc[_0x1caef9(0x1c9)]);return a40_0x31962f['lt'](_0x417c6e,_0x3eb5dc[_0x1caef9(0x1c9)]);}function getInstallPlanLabel(_0x75d724,_0x4fbb02){const _0x548133=a40_0x391f1f;switch(_0x4fbb02[_0x548133(0x204)]){case _0x548133(0x218):return _0x548133(0x210)+a40_0x559651[_0x548133(0x1e9)](_0x75d724)+'\x20→\x20'+a40_0x559651[_0x548133(0x1da)](_0x4fbb02['version']);case _0x548133(0x1c9):return'Requested\x20version:\x20'+a40_0x559651[_0x548133(0x1e9)](_0x75d724)+_0x548133(0x1f3)+a40_0x559651[_0x548133(0x1da)](_0x4fbb02['version']);case'latest':default:return _0x548133(0x1fc)+a40_0x559651[_0x548133(0x1e9)](_0x75d724)+_0x548133(0x1f3)+a40_0x559651[_0x548133(0x1da)](_0x4fbb02[_0x548133(0x1c9)]);}}function repairCurrentBuiltinSkill(){const _0x106176=a40_0x391f1f;console['log'](a40_0x559651[_0x106176(0x20d)]('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x6f995b=installBuiltinSkill();if(_0x6f995b['ok'])return console[_0x106176(0x1ec)](a40_0x559651[_0x106176(0x20d)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x6f995b[_0x106176(0x1fa)]+_0x106176(0x219))),!![];return console[_0x106176(0x1d4)](a40_0x559651[_0x106176(0x1e9)](_0x106176(0x1e8)+_0x6f995b[_0x106176(0x205)]+_0x106176(0x20b)+(_0x6f995b[_0x106176(0x1c7)]||_0x106176(0x203)))),console['log'](a40_0x559651[_0x106176(0x20d)]('\x20\x20Run\x20manually:\x20'+CLI_BIN_NAME+_0x106176(0x1fe))),![];}function verifyUpdatedBuiltinSkill(_0x47d4b5){const _0x944498=a40_0x391f1f,_0x2adc11=inspectInstalledBuiltinSkillVersion(_0x47d4b5);if(_0x2adc11[_0x944498(0x20e)]==='current')return console['log'](a40_0x559651[_0x944498(0x20d)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x47d4b5+_0x944498(0x219))),!![];const _0x28e71a=_0x2adc11['skillVersion']?_0x944498(0x1ca)+_0x47d4b5+',\x20found\x20'+_0x2adc11[_0x944498(0x1fa)]:'expected\x20'+_0x47d4b5+_0x944498(0x1ef)+_0x2adc11[_0x944498(0x20e)];return console[_0x944498(0x1d4)](a40_0x559651['yellow'](_0x944498(0x20c)+_0x28e71a)),console[_0x944498(0x1ec)](a40_0x559651['gray'](_0x944498(0x1e4)+_0x2adc11['repairCommand'])),![];}async function execute(_0x4722e3){const _0xdf2c77=a40_0x391f1f;await validateUpdateFlags(_0x4722e3);const _0x150eb1=getCurrentVersion();console[_0xdf2c77(0x1ec)](_0xdf2c77(0x212)+_0x150eb1);const _0x282e34=a40_0x500cad(_0xdf2c77(0x1df))[_0xdf2c77(0x1ff)](),_0x2df09b=await resolveTargetVersion(_0x4722e3);if(!_0x2df09b){const _0x458f48=_0x4722e3[_0xdf2c77(0x1fb)](_0xdf2c77(0x218))?'Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm':'Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)';return _0x282e34['fail'](_0x458f48),console['log'](a40_0x559651['gray']('\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20'+NPM_PACKAGE_NAME+_0xdf2c77(0x1f5))),{'ok':![],'message':_0x458f48};}const _0x39d32d=a40_0x31962f[_0xdf2c77(0x1ce)](VERSION),_0x58dfff=a40_0x31962f['valid'](_0x2df09b[_0xdf2c77(0x1c9)]);if(!_0x39d32d||!_0x58dfff)return _0x282e34[_0xdf2c77(0x213)](_0xdf2c77(0x1f0)),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0x39d32d,_0x2df09b)){const _0xb6da7c=_0x2df09b[_0xdf2c77(0x204)]===_0xdf2c77(0x1c9)?_0xdf2c77(0x214)+_0x2df09b[_0xdf2c77(0x1c9)]+')':a40_0x31962f['gt'](_0x39d32d,_0x58dfff)?_0xdf2c77(0x1f4)+_0x150eb1+_0xdf2c77(0x1d8)+_0x2df09b['version']:_0xdf2c77(0x1e6)+_0x2df09b[_0xdf2c77(0x1c9)]+')';return _0x282e34[_0xdf2c77(0x21b)](_0xb6da7c),{'ok':repairCurrentBuiltinSkill()};}_0x282e34[_0xdf2c77(0x21a)](getInstallPlanLabel(_0x150eb1,_0x2df09b));const _0x461e3f=detectPackageManager(),_0x17f6f1=_0x461e3f===_0xdf2c77(0x1d6)?resolveNpmBin(_0xdf2c77(0x1d6)):_0x461e3f,_0x27cb2c=a40_0x500cad(_0xdf2c77(0x1ea)+_0x461e3f+_0xdf2c77(0x207))[_0xdf2c77(0x1ff)]();try{return await execa(_0x17f6f1,[_0xdf2c77(0x1f7),'-g',NPM_PACKAGE_NAME+'@'+_0x2df09b[_0xdf2c77(0x1c9)]],{'stdio':_0xdf2c77(0x20a)}),_0x27cb2c[_0xdf2c77(0x21b)]('Updated\x20to\x20v'+_0x2df09b['version']),console[_0xdf2c77(0x1ec)](a40_0x559651[_0xdf2c77(0x20d)](_0xdf2c77(0x1d5))),{'ok':verifyUpdatedBuiltinSkill(_0x2df09b['version'])};}catch(_0x1d101e){return _0x27cb2c['fail'](_0xdf2c77(0x1e2)),console[_0xdf2c77(0x1c7)](a40_0x559651[_0xdf2c77(0x1e0)]('\x20\x20'+_0x1d101e[_0xdf2c77(0x1e3)])),console[_0xdf2c77(0x1ec)](a40_0x559651[_0xdf2c77(0x20d)](_0xdf2c77(0x1cd)+_0x461e3f+_0xdf2c77(0x20f)+NPM_PACKAGE_NAME+'@'+_0x2df09b[_0xdf2c77(0x1c9)])),{'ok':![],'message':_0x1d101e['message']};}}export const updateDefinition={'service':a40_0x391f1f(0x1d1),'command':a40_0x391f1f(0x1dc),'description':a40_0x391f1f(0x1ee),'risk':a40_0x391f1f(0x1d0),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a40_0x7e82=a40_0x39a6;(function(_0x2e8e83,_0x137daf){const _0x486872=a40_0x39a6,_0x26942b=_0x2e8e83();while(!![]){try{const _0x590ba1=-parseInt(_0x486872(0x180))/0x1+-parseInt(_0x486872(0x14b))/0x2*(parseInt(_0x486872(0x170))/0x3)+parseInt(_0x486872(0x15e))/0x4+-parseInt(_0x486872(0x16c))/0x5+-parseInt(_0x486872(0x195))/0x6+parseInt(_0x486872(0x158))/0x7+parseInt(_0x486872(0x187))/0x8*(parseInt(_0x486872(0x150))/0x9);if(_0x590ba1===_0x137daf)break;else _0x26942b['push'](_0x26942b['shift']());}catch(_0x3c9c26){_0x26942b['push'](_0x26942b['shift']());}}}(a40_0x1e09,0xbd7f3));import a40_0x5ca547 from'chalk';import a40_0x125fda from'ora';import a40_0x33b70b 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 a40_0x1e09(){const _0x28c51f=['repairCommand','Current\x20version:\x20','current','str','log','\x20install\x20-g\x20','\x20\x20Try\x20manually:\x20','filter','2142588KpWfNP','error','entries','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','https://registry.npmjs.org/-/package/','Already\x20on\x20requested\x20version\x20(v','install','72SQPVvE','warn','message','\x20\x20Run\x20manually:\x20','\x20cli-skill\x20install','18NyIius','bool','Updated\x20to\x20v','green',',\x20state\x20','Already\x20up\x20to\x20date\x20(v','gray','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','9435153DFrMlo','valid','Updating\x20via\x20','Version\x20comparison\x20failed','version','red','3799068mtkTRt','start','slice','bun','boolean','includes','code','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','latest','expected\x20','json','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','\x20→\x20','execPath','6931620eqPReB','yellow','\x20is\x20up\x20to\x20date.','fail','110163aEfMuM','toLowerCase','\x20is\x20newer\x20than\x20npm\x20latest\x20v','source','read','unknown','Current\x20version\x20v','object','Beta\x20version:\x20','timeout','state','Install\x20a\x20specific\x20CLI\x20version','succeed','beta','fromEntries','Invalid\x20version:\x20','388657fwufPr','skillVersion','trim','validation',',\x20found\x20','Checking\x20CLI\x20Built-in\x20Skill...','update','7730272EIcYgk','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','string','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','Update\x20available:\x20','run'];a40_0x1e09=function(){return _0x28c51f;};return a40_0x1e09();}function a40_0x39a6(_0x462b6b,_0x2e5a45){_0x462b6b=_0x462b6b-0x148;const _0x1e09ad=a40_0x1e09();let _0x39a6c7=_0x1e09ad[_0x462b6b];return _0x39a6c7;}function getCurrentVersion(){const _0x5d4b74=a40_0x39a6;return GIT_COMMIT!==_0x5d4b74(0x175)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x5d4b74(0x160)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x1f006d=a40_0x39a6,_0x5646b5=process[_0x1f006d(0x16b)][_0x1f006d(0x171)]();if(_0x5646b5[_0x1f006d(0x163)](_0x1f006d(0x161)))return _0x1f006d(0x161);return'npm';}const updateFlags=[{'name':'beta','type':a40_0x7e82(0x162),'description':a40_0x7e82(0x18a),'default':![]},{'name':a40_0x7e82(0x15c),'type':a40_0x7e82(0x189),'description':a40_0x7e82(0x17b)}];function getRequestedVersion(_0x424fc6){const _0x2741a4=a40_0x7e82;return _0x424fc6[_0x2741a4(0x190)]('version')[_0x2741a4(0x182)]();}async function validateUpdateFlags(_0xf778f1){const _0x1e5117=a40_0x7e82,_0x4087fe=_0xf778f1[_0x1e5117(0x151)](_0x1e5117(0x17d)),_0x36f78d=getRequestedVersion(_0xf778f1);if(_0x4087fe&&_0x36f78d)throw CliErrors[_0x1e5117(0x183)](_0x1e5117(0x165),'Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.');if(_0x36f78d&&!a40_0x33b70b[_0x1e5117(0x159)](_0x36f78d))throw CliErrors[_0x1e5117(0x183)](_0x1e5117(0x17f)+_0x36f78d,_0x1e5117(0x157));}async function fetchNpmDistTags(){const _0x53269d=a40_0x7e82;try{const _0x2bbc07=await fetch(_0x53269d(0x148)+encodeURIComponent(NPM_PACKAGE_NAME)+'/dist-tags',{'signal':AbortSignal[_0x53269d(0x179)](0x2710)});if(!_0x2bbc07['ok'])return null;const _0x10f97b=await _0x2bbc07[_0x53269d(0x168)]();if(!_0x10f97b||typeof _0x10f97b!==_0x53269d(0x177))return null;return Object[_0x53269d(0x17e)](Object[_0x53269d(0x197)](_0x10f97b)[_0x53269d(0x194)](([,_0x4f7517])=>typeof _0x4f7517===_0x53269d(0x189)&&_0x4f7517['trim']()['length']>0x0)['map'](([_0x177286,_0x440ee3])=>[_0x177286,String(_0x440ee3)['trim']()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0xb7f87f){const _0x3000cd=await fetchNpmDistTags();return _0x3000cd?.[_0xb7f87f]??null;}async function fetchLatestVersion(){const _0x13bb7d=a40_0x7e82;return fetchNpmDistTagVersion(_0x13bb7d(0x166));}async function resolveTargetVersion(_0x132dc8){const _0x5c0564=a40_0x7e82,_0x517f13=getRequestedVersion(_0x132dc8);if(_0x517f13)return{'version':_0x517f13,'source':_0x5c0564(0x15c)};if(_0x132dc8[_0x5c0564(0x151)](_0x5c0564(0x17d))){const _0xffd2c6=await fetchNpmDistTagVersion(_0x5c0564(0x17d));if(!_0xffd2c6)return null;return{'version':_0xffd2c6,'source':'beta'};}const _0x30a79d=await fetchLatestVersion();if(!_0x30a79d)return null;return{'version':_0x30a79d,'source':_0x5c0564(0x166)};}function shouldInstallTarget(_0x25da4c,_0x1d233c){const _0x2cc5a3=a40_0x7e82;if(_0x1d233c['source']==='version'||_0x1d233c[_0x2cc5a3(0x173)]==='beta')return!a40_0x33b70b['eq'](_0x25da4c,_0x1d233c[_0x2cc5a3(0x15c)]);return a40_0x33b70b['lt'](_0x25da4c,_0x1d233c[_0x2cc5a3(0x15c)]);}function getInstallPlanLabel(_0x55303c,_0x30bee0){const _0x3bb741=a40_0x7e82;switch(_0x30bee0[_0x3bb741(0x173)]){case _0x3bb741(0x17d):return _0x3bb741(0x178)+a40_0x5ca547[_0x3bb741(0x16d)](_0x55303c)+_0x3bb741(0x16a)+a40_0x5ca547['green'](_0x30bee0['version']);case _0x3bb741(0x15c):return'Requested\x20version:\x20'+a40_0x5ca547[_0x3bb741(0x16d)](_0x55303c)+_0x3bb741(0x16a)+a40_0x5ca547[_0x3bb741(0x153)](_0x30bee0['version']);case _0x3bb741(0x166):default:return _0x3bb741(0x18b)+a40_0x5ca547[_0x3bb741(0x16d)](_0x55303c)+_0x3bb741(0x16a)+a40_0x5ca547[_0x3bb741(0x153)](_0x30bee0[_0x3bb741(0x15c)]);}}function repairCurrentBuiltinSkill(){const _0x447f61=a40_0x7e82;console['log'](a40_0x5ca547[_0x447f61(0x156)](_0x447f61(0x185)));const _0x4078fc=installBuiltinSkill();if(_0x4078fc['ok'])return console[_0x447f61(0x191)](a40_0x5ca547[_0x447f61(0x156)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x4078fc['skillVersion']+_0x447f61(0x16e))),!![];return console[_0x447f61(0x14c)](a40_0x5ca547[_0x447f61(0x16d)]('\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20['+_0x4078fc[_0x447f61(0x164)]+']:\x20'+(_0x4078fc[_0x447f61(0x196)]||_0x447f61(0x175)))),console[_0x447f61(0x191)](a40_0x5ca547[_0x447f61(0x156)]('\x20\x20Run\x20manually:\x20'+CLI_BIN_NAME+_0x447f61(0x14f))),![];}function verifyUpdatedBuiltinSkill(_0x1cb986){const _0x58a45e=a40_0x7e82,_0x528ff=inspectInstalledBuiltinSkillVersion(_0x1cb986);if(_0x528ff['state']===_0x58a45e(0x18f))return console['log'](a40_0x5ca547[_0x58a45e(0x156)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x1cb986+_0x58a45e(0x16e))),!![];const _0x9c81b4=_0x528ff[_0x58a45e(0x181)]?'expected\x20'+_0x1cb986+_0x58a45e(0x184)+_0x528ff[_0x58a45e(0x181)]:_0x58a45e(0x167)+_0x1cb986+_0x58a45e(0x154)+_0x528ff[_0x58a45e(0x17a)];return console[_0x58a45e(0x14c)](a40_0x5ca547[_0x58a45e(0x16d)]('\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20'+_0x9c81b4)),console[_0x58a45e(0x191)](a40_0x5ca547[_0x58a45e(0x156)](_0x58a45e(0x14e)+_0x528ff[_0x58a45e(0x18d)])),![];}async function execute(_0x4f3e39){const _0x287291=a40_0x7e82;await validateUpdateFlags(_0x4f3e39);const _0x2b2249=getCurrentVersion();console[_0x287291(0x191)](_0x287291(0x18e)+_0x2b2249);const _0x45b3a3=a40_0x125fda('Checking\x20for\x20updates...')[_0x287291(0x15f)](),_0x5cfd1f=await resolveTargetVersion(_0x4f3e39);if(!_0x5cfd1f){const _0x295c35=_0x4f3e39[_0x287291(0x151)](_0x287291(0x17d))?'Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm':_0x287291(0x199);return _0x45b3a3[_0x287291(0x16f)](_0x295c35),console[_0x287291(0x191)](a40_0x5ca547[_0x287291(0x156)](_0x287291(0x188)+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x295c35};}const _0x30a1df=a40_0x33b70b[_0x287291(0x159)](VERSION),_0x421782=a40_0x33b70b[_0x287291(0x159)](_0x5cfd1f[_0x287291(0x15c)]);if(!_0x30a1df||!_0x421782)return _0x45b3a3['fail'](_0x287291(0x15b)),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0x30a1df,_0x5cfd1f)){const _0x34c7d2=_0x5cfd1f[_0x287291(0x173)]===_0x287291(0x15c)?_0x287291(0x149)+_0x5cfd1f[_0x287291(0x15c)]+')':a40_0x33b70b['gt'](_0x30a1df,_0x421782)?_0x287291(0x176)+_0x2b2249+_0x287291(0x172)+_0x5cfd1f['version']:_0x287291(0x155)+_0x5cfd1f[_0x287291(0x15c)]+')';return _0x45b3a3['succeed'](_0x34c7d2),{'ok':repairCurrentBuiltinSkill()};}_0x45b3a3['info'](getInstallPlanLabel(_0x2b2249,_0x5cfd1f));const _0x3a2c8c=detectPackageManager(),_0x30d50f=_0x3a2c8c==='npm'?resolveNpmBin('npm'):_0x3a2c8c,_0x6ed613=a40_0x125fda(_0x287291(0x15a)+_0x3a2c8c+'...')[_0x287291(0x15f)]();try{return await execa(_0x30d50f,[_0x287291(0x14a),'-g',NPM_PACKAGE_NAME+'@'+_0x5cfd1f['version']],{'stdio':'pipe'}),_0x6ed613[_0x287291(0x17c)](_0x287291(0x152)+_0x5cfd1f[_0x287291(0x15c)]),console[_0x287291(0x191)](a40_0x5ca547[_0x287291(0x156)](_0x287291(0x169))),{'ok':verifyUpdatedBuiltinSkill(_0x5cfd1f[_0x287291(0x15c)])};}catch(_0x25a833){return _0x6ed613[_0x287291(0x16f)]('Update\x20failed'),console['error'](a40_0x5ca547[_0x287291(0x15d)]('\x20\x20'+_0x25a833['message'])),console['log'](a40_0x5ca547[_0x287291(0x156)](_0x287291(0x193)+_0x3a2c8c+_0x287291(0x192)+NPM_PACKAGE_NAME+'@'+_0x5cfd1f[_0x287291(0x15c)])),{'ok':![],'message':_0x25a833[_0x287291(0x14d)]};}}export const updateDefinition={'service':a40_0x7e82(0x186),'command':a40_0x7e82(0x18c),'description':a40_0x7e82(0x198),'risk':a40_0x7e82(0x174),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4438ae,_0x1d13f7){const _0x342fee=a41_0x4147,_0x14035c=_0x4438ae();while(!![]){try{const _0xb7d28f=-parseInt(_0x342fee(0x1d6))/0x1+parseInt(_0x342fee(0x1d1))/0x2+parseInt(_0x342fee(0x1d3))/0x3+parseInt(_0x342fee(0x1d5))/0x4*(parseInt(_0x342fee(0x1d8))/0x5)+parseInt(_0x342fee(0x1d2))/0x6*(-parseInt(_0x342fee(0x1d4))/0x7)+parseInt(_0x342fee(0x1d9))/0x8*(-parseInt(_0x342fee(0x1da))/0x9)+parseInt(_0x342fee(0x1d7))/0xa;if(_0xb7d28f===_0x1d13f7)break;else _0x14035c['push'](_0x14035c['shift']());}catch(_0x42b119){_0x14035c['push'](_0x14035c['shift']());}}}(a41_0x4f61,0xbabb1));function a41_0x4147(_0x5a16ce,_0x5a6c13){_0x5a16ce=_0x5a16ce-0x1d1;const _0x4f6101=a41_0x4f61();let _0x4147c4=_0x4f6101[_0x5a16ce];return _0x4147c4;}import{codegenSdk}from'../../commands/codegen/sdk.js';function a41_0x4f61(){const _0x3ce3de=['1784502EaAtDK','1208454FbTDvU','14edIitY','438532pqHsDX','1365087YNUuDD','16754880dFYaRO','55PAhATj','88WxPMAq','1065519KgEGpL','1485604kUkRXU'];a41_0x4f61=function(){return _0x3ce3de;};return a41_0x4f61();}import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x154a17=a42_0x5866;function a42_0x5866(_0x218c0d,_0x3c0b4f){_0x218c0d=_0x218c0d-0x9f;const _0x3d76b5=a42_0x3d76();let _0x58666f=_0x3d76b5[_0x218c0d];return _0x58666f;}(function(_0x1edb9c,_0x5d9898){const _0x3140dd=a42_0x5866,_0x28f889=_0x1edb9c();while(!![]){try{const _0x54c5cd=parseInt(_0x3140dd(0xb2))/0x1+-parseInt(_0x3140dd(0xa8))/0x2*(parseInt(_0x3140dd(0x9f))/0x3)+-parseInt(_0x3140dd(0xa2))/0x4*(-parseInt(_0x3140dd(0xa0))/0x5)+-parseInt(_0x3140dd(0xa3))/0x6+parseInt(_0x3140dd(0xac))/0x7*(-parseInt(_0x3140dd(0xba))/0x8)+-parseInt(_0x3140dd(0xbb))/0x9+parseInt(_0x3140dd(0xaa))/0xa*(parseInt(_0x3140dd(0xa1))/0xb);if(_0x54c5cd===_0x5d9898)break;else _0x28f889['push'](_0x28f889['shift']());}catch(_0x593a18){_0x28f889['push'](_0x28f889['shift']());}}}(a42_0x3d76,0x2dd36));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';function a42_0x3d76(){const _0x597500=['15RAWYCN','55kWIlsN','16652nkleKv','644178mtTbHa','boolean','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','Omit\x20import\x20statements\x20from\x20generated\x20code','operation','444874CYTdnG','read','1249570ZaxitC','sdk','174426XmprpD','codegen','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','appCode','tableName','name','115424bvszbP','alias','string','skip-imports','code','str','bool','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','56lhYgwC','546930gbGprQ','3cjMwVd'];a42_0x3d76=function(){return _0x597500;};return a42_0x3d76();}import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':a42_0x154a17(0xad),'command':a42_0x154a17(0xab),'description':a42_0x154a17(0xb9),'risk':a42_0x154a17(0xa9),'flags':[CODE_FLAG_OPTIONAL,{'name':a42_0x154a17(0xb3),'type':a42_0x154a17(0xb4),'description':a42_0x154a17(0xae)},{'name':a42_0x154a17(0xa7),'type':a42_0x154a17(0xb4),'required':!![],'description':a42_0x154a17(0xa5)},{'name':a42_0x154a17(0xb5),'type':a42_0x154a17(0xa4),'description':a42_0x154a17(0xa6)}],async 'execute'(_0x4d2606){const _0x3818b6=a42_0x154a17,{dataset:_0x551363,operation:_0x2011fd}=await getOperationDetail(_0x4d2606[_0x3818b6(0xaf)],_0x4d2606[_0x3818b6(0xb7)]('code'),_0x4d2606['str'](_0x3818b6(0xa7))),_0x2163b0=generateSdkCode(_0x551363,_0x2011fd,{'includeImports':!_0x4d2606[_0x3818b6(0xb8)](_0x3818b6(0xb5))});return{'ok':!![],'data':{'dataset':{'name':_0x551363[_0x3818b6(0xb1)],'code':_0x551363[_0x3818b6(0xb6)],'tableName':_0x551363[_0x3818b6(0xb0)]},'operation':_0x4d2606['str'](_0x3818b6(0xa7)),'code':_0x2163b0}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a43_0xc0526a=a43_0x4b68;function a43_0x4b68(_0x5111e4,_0x19c467){_0x5111e4=_0x5111e4-0xc2;const _0x395af0=a43_0x395a();let _0x4b68ea=_0x395af0[_0x5111e4];return _0x4b68ea;}(function(_0x344a8a,_0x1004dc){const _0x4e7f1e=a43_0x4b68,_0x3ba9a8=_0x344a8a();while(!![]){try{const _0x224b1b=parseInt(_0x4e7f1e(0xcb))/0x1+parseInt(_0x4e7f1e(0xcc))/0x2*(-parseInt(_0x4e7f1e(0xcd))/0x3)+-parseInt(_0x4e7f1e(0xdd))/0x4*(-parseInt(_0x4e7f1e(0xd6))/0x5)+-parseInt(_0x4e7f1e(0xc7))/0x6+-parseInt(_0x4e7f1e(0xc9))/0x7*(parseInt(_0x4e7f1e(0xca))/0x8)+-parseInt(_0x4e7f1e(0xd4))/0x9*(-parseInt(_0x4e7f1e(0xd0))/0xa)+parseInt(_0x4e7f1e(0xc8))/0xb*(parseInt(_0x4e7f1e(0xd8))/0xc);if(_0x224b1b===_0x1004dc)break;else _0x3ba9a8['push'](_0x3ba9a8['shift']());}catch(_0x4b034a){_0x3ba9a8['push'](_0x3ba9a8['shift']());}}}(a43_0x395a,0x6f98a));function a43_0x395a(){const _0x57fd6b=['30hUSbzW','codegen','target','bff','2252763jgieQX','string','11285IIEMtq','str','132MOYAUb','sdk','sqlcode','bool','boolean','72VEpFLW','sqlName','sql','no-imports','read','Omit\x20import\x20statements\x20from\x20generated\x20code','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','5405646GJBaEN','684101lyoNZm','43239veDyjs','16LRpVqn','689601GxxwIb','529904wDEZxe','9tJSMjJ','appCode','sqlCode'];a43_0x395a=function(){return _0x57fd6b;};return a43_0x395a();}import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':a43_0xc0526a(0xd1),'command':a43_0xc0526a(0xdf),'description':a43_0xc0526a(0xc5),'risk':a43_0xc0526a(0xc3),'flags':[SQLCODE_FLAG,{'name':a43_0xc0526a(0xd2),'type':a43_0xc0526a(0xd5),'description':a43_0xc0526a(0xc6),'default':a43_0xc0526a(0xd9),'enum':['sdk',a43_0xc0526a(0xd3)]},{'name':a43_0xc0526a(0xc2),'type':a43_0xc0526a(0xdc),'description':a43_0xc0526a(0xc4)}],async 'execute'(_0x469b5f){const _0xaf707d=a43_0xc0526a,_0x4c0b20=await getSqlQueryInfo(_0x469b5f[_0xaf707d(0xce)],_0x469b5f['str'](_0xaf707d(0xda))),_0x46a4e5=_0x469b5f[_0xaf707d(0xd7)]('target')||_0xaf707d(0xd9),_0x22af62=generateSqlCodeTemplate(_0x4c0b20,{'target':_0x46a4e5,'includeImports':!_0x469b5f[_0xaf707d(0xdb)]('no-imports')});return{'ok':!![],'data':{'sqlCode':_0x4c0b20[_0xaf707d(0xcf)],'sqlName':_0x4c0b20[_0xaf707d(0xde)],'target':_0x46a4e5,'code':_0x22af62}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x96bf2,_0x2e799d){const _0x451314=a44_0x964e,_0x443bda=_0x96bf2();while(!![]){try{const _0x2d26d9=parseInt(_0x451314(0x77))/0x1*(parseInt(_0x451314(0x80))/0x2)+parseInt(_0x451314(0x67))/0x3+parseInt(_0x451314(0x93))/0x4+-parseInt(_0x451314(0x92))/0x5*(-parseInt(_0x451314(0x7f))/0x6)+parseInt(_0x451314(0x6b))/0x7+parseInt(_0x451314(0x84))/0x8*(-parseInt(_0x451314(0x90))/0x9)+parseInt(_0x451314(0x7b))/0xa*(-parseInt(_0x451314(0x8a))/0xb);if(_0x2d26d9===_0x2e799d)break;else _0x443bda['push'](_0x443bda['shift']());}catch(_0x432788){_0x443bda['push'](_0x443bda['shift']());}}}(a44_0x38fa,0x5b9a4));function a44_0x38fa(){const _0x497d5c=['keys','\x20<name>','\x22\x20(appcode:\x20','610002CUDeHH','\x22\x20still\x20defined\x20in\x20','flagMissing','both','4774154LeJjft','project','Added','appcode','Usage:\x20','trim','\x20Default\x20app\x20changed\x20to\x20\x22','\x20Note:\x20app\x20\x22','object','apps','string','\x20app\x20\x22','1ScdFOm','args','Missing\x20app\x20name.','\x20<name>\x20[--global]','30pbUiDt','projectConfig','Use\x20global\x20config\x20scope','\x20config.','270QtJfSA','911698adqDHn','defaultApp','Removed\x20app\x20\x22','App\x20\x22','280PqAKur','str','globalConfig','\x22\x20is\x20selected\x20automatically.','length','global','5295939FwEGXY','\x20<name>\x20--appcode\x20<code>','validation','\x20Remaining\x20app\x20\x22','bool','\x22\x20not\x20found.','75519ZUSuLs','\x20Default\x20app\x20is\x20\x22','58455LlwqzQ','983744wEEkkK'];a44_0x38fa=function(){return _0x497d5c;};return a44_0x38fa();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{collectAppProfileOverrides,getAppProfileFlagDefs,normalizeStoredDefaultApp}from'../../config/schema.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';function a44_0x964e(_0x7f7a03,_0x8710d6){_0x7f7a03=_0x7f7a03-0x65;const _0x38fae7=a44_0x38fa();let _0x964ec8=_0x38fae7[_0x7f7a03];return _0x964ec8;}export function buildAppAddFlags(){const _0x9dad2b=a44_0x964e;return[{'name':_0x9dad2b(0x6e),'type':'string','description':'App\x20code','required':!![]},{'name':_0x9dad2b(0x89),'type':'boolean','description':'Use\x20global\x20config\x20scope','default':![]},...getAppProfileFlagDefs()];}export function buildAppRemoveFlags(){const _0x30b964=a44_0x964e;return[{'name':_0x30b964(0x89),'type':'boolean','description':_0x30b964(0x7d),'default':![]}];}export async function validateAppName(_0x50767e,_0x18956f){const _0x2c43dd=a44_0x964e,_0x4e64e3=_0x50767e['args'][0x0]?.[_0x2c43dd(0x70)]();if(!_0x4e64e3)throw CliErrors['validation'](_0x2c43dd(0x79),_0x2c43dd(0x6f)+CLI_BIN_NAME+'\x20'+_0x18956f+_0x2c43dd(0x65));}export async function runAppAdd(_0x240186,_0x896d09){const _0x2f7a3f=a44_0x964e,_0x349917=_0x240186[_0x2f7a3f(0x78)][0x0]?.[_0x2f7a3f(0x70)]();if(!_0x349917)throw CliErrors[_0x2f7a3f(0x8c)]('Missing\x20app\x20name.','Usage:\x20'+CLI_BIN_NAME+'\x20'+_0x896d09+'\x20<name>\x20--appcode\x20<code>');const _0x592857=_0x240186[_0x2f7a3f(0x85)](_0x2f7a3f(0x6e));if(!_0x592857)throw CliErrors[_0x2f7a3f(0x69)](_0x2f7a3f(0x6e),_0x2f7a3f(0x6f)+CLI_BIN_NAME+'\x20'+_0x896d09+_0x2f7a3f(0x8b));const _0x441900={'global':_0x240186['bool'](_0x2f7a3f(0x89))},_0x1538df=readConfig(_0x441900);if(!_0x1538df['apps'])_0x1538df['apps']={};const _0x500c87={'appcode':_0x592857,...collectAppProfileOverrides(_0x10c9c3=>_0x240186['str'](_0x10c9c3))},_0x2a0c61=_0x1538df[_0x2f7a3f(0x74)],_0x758d12=Object[_0x2f7a3f(0x94)](_0x2a0c61),_0x29dac7=typeof _0x1538df['defaultApp']===_0x2f7a3f(0x75)&&_0x2a0c61[_0x1538df[_0x2f7a3f(0x81)]]?_0x1538df[_0x2f7a3f(0x81)]:_0x758d12[_0x2f7a3f(0x88)]===0x1?_0x758d12[0x0]:undefined,_0x3334e6=!!_0x2a0c61[_0x349917];_0x2a0c61[_0x349917]=_0x500c87;const _0x5062e5=normalizeStoredDefaultApp(_0x1538df,_0x29dac7);writeConfig(_0x1538df,_0x441900);const _0x4fa172=!_0x3334e6&&_0x5062e5?_0x2f7a3f(0x91)+_0x5062e5+'\x22.':'',_0x2ca48e=(_0x3334e6?'Updated':_0x2f7a3f(0x6d))+_0x2f7a3f(0x76)+_0x349917+_0x2f7a3f(0x66)+_0x592857+')'+scopeLabel(_0x441900)+'.'+_0x4fa172;return{'ok':!![],'message':_0x2ca48e};}export async function runAppRemove(_0x2a42b6,_0x263ce5){const _0x2edf68=a44_0x964e,_0x13e366=_0x2a42b6[_0x2edf68(0x78)][0x0]?.[_0x2edf68(0x70)]();if(!_0x13e366)throw CliErrors[_0x2edf68(0x8c)]('Missing\x20app\x20name.',_0x2edf68(0x6f)+CLI_BIN_NAME+'\x20'+_0x263ce5+_0x2edf68(0x7a));const _0x51f0f1=_0x2a42b6[_0x2edf68(0x8e)]('global'),{config:_0x246d87,layers:_0x16afa4}=readRawConfigWithLayers(),_0x11548f=_0x246d87[_0x2edf68(0x74)]??{};if(!_0x11548f[_0x13e366])throw CliErrors['validation'](_0x2edf68(0x83)+_0x13e366+_0x2edf68(0x8f));const _0x5f4820=_0x16afa4[_0x2edf68(0x86)][_0x2edf68(0x74)]&&typeof _0x16afa4['globalConfig'][_0x2edf68(0x74)]===_0x2edf68(0x73)?_0x16afa4[_0x2edf68(0x86)]['apps']:{},_0x2b5aed=_0x16afa4['projectConfig'][_0x2edf68(0x74)]&&typeof _0x16afa4[_0x2edf68(0x7c)][_0x2edf68(0x74)]===_0x2edf68(0x73)?_0x16afa4['projectConfig'][_0x2edf68(0x74)]:{},_0x2a9cbc=appDefinedIn(_0x13e366,_0x5f4820,_0x2b5aed),_0x3d92f3=resolveAppScopeForWrite(_0x13e366,_0x51f0f1,_0x16afa4),_0x554f2f={'global':_0x3d92f3===_0x2edf68(0x89)},_0x1e6a0f=readConfig(_0x554f2f),_0x16786f=_0x1e6a0f[_0x2edf68(0x74)];if(!_0x16786f||!_0x16786f[_0x13e366])throw CliErrors[_0x2edf68(0x8c)]('App\x20\x22'+_0x13e366+_0x2edf68(0x8f));delete _0x16786f[_0x13e366];let _0x1a247b='';const _0x3ed886=typeof _0x1e6a0f[_0x2edf68(0x81)]===_0x2edf68(0x75)?_0x1e6a0f[_0x2edf68(0x81)]:undefined,_0x88de35=Object[_0x2edf68(0x94)](_0x16786f),_0x48d93f=_0x3ed886===_0x13e366?_0x88de35[0x0]:_0x3ed886,_0x423e3b=normalizeStoredDefaultApp(_0x1e6a0f,_0x48d93f);if(_0x3ed886===_0x13e366&&_0x88de35['length']===0x1)_0x1a247b=_0x2edf68(0x8d)+_0x88de35[0x0]+_0x2edf68(0x87);else _0x3ed886===_0x13e366&&_0x423e3b&&(_0x1a247b=_0x2edf68(0x71)+_0x423e3b+'\x22.');Object[_0x2edf68(0x94)](_0x16786f)[_0x2edf68(0x88)]===0x0&&(delete _0x1e6a0f[_0x2edf68(0x74)],delete _0x1e6a0f[_0x2edf68(0x81)]);writeConfig(_0x1e6a0f,_0x554f2f);const _0x18fa58=_0x2a9cbc===_0x2edf68(0x6a)?_0x2edf68(0x72)+_0x13e366+_0x2edf68(0x68)+(_0x3d92f3===_0x2edf68(0x6c)?'global':_0x2edf68(0x6c))+_0x2edf68(0x7e):'';return{'ok':!![],'message':_0x2edf68(0x82)+_0x13e366+'\x22'+scopeLabel(_0x554f2f)+'.'+_0x1a247b+_0x18fa58};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x14b3f6,_0x376062){const _0x252828=a45_0x187f,_0x226fae=_0x14b3f6();while(!![]){try{const _0x52cc5d=-parseInt(_0x252828(0x1c9))/0x1+parseInt(_0x252828(0x1c7))/0x2+parseInt(_0x252828(0x1d8))/0x3+-parseInt(_0x252828(0x1d2))/0x4+parseInt(_0x252828(0x1e6))/0x5*(parseInt(_0x252828(0x1e1))/0x6)+-parseInt(_0x252828(0x1cb))/0x7*(parseInt(_0x252828(0x1cc))/0x8)+-parseInt(_0x252828(0x1dd))/0x9*(-parseInt(_0x252828(0x1c8))/0xa);if(_0x52cc5d===_0x376062)break;else _0x226fae['push'](_0x226fae['shift']());}catch(_0x680b96){_0x226fae['push'](_0x226fae['shift']());}}}(a45_0x46ed,0x88ada));import{input,checkbox,select}from'@inquirer/prompts';import a45_0x5989cb from'chalk';import{validateAppcode}from'../../commands/common/validate.js';import{listRemoteApps}from'../../core/api-client.js';function a45_0x187f(_0x37f872,_0x4fe9aa){_0x37f872=_0x37f872-0x1c7;const _0x46ed9a=a45_0x46ed();let _0x187fcb=_0x46ed9a[_0x37f872];return _0x187fcb;}import{withActiveCookie}from'../../utils/with-active-cookie.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';export async function promptCustomAppcode(){const _0x17c2a0=a45_0x187f,_0x5b570e=await input({'message':_0x17c2a0(0x1d0),'validate':_0x27765b=>{const _0x25f0ce=_0x17c2a0,_0x46671a=validateAppcode(_0x27765b['trim']());return _0x46671a[_0x25f0ce(0x1e3)]||_0x46671a[_0x25f0ce(0x1df)]||'Invalid\x20App\x20Code';}});return _0x5b570e[_0x17c2a0(0x1de)]();}export async function promptAppSelection(_0x59d0d6){const _0x2f4762=a45_0x187f,_0x4d260f=[{'name':a45_0x5989cb[_0x2f4762(0x1d5)](_0x2f4762(0x1e0)),'value':-0x1},..._0x59d0d6[_0x2f4762(0x1e2)]((_0xaea3ec,_0x38e6f8)=>({'name':_0xaea3ec[_0x2f4762(0x1e5)]+'\x20\x20'+a45_0x5989cb[_0x2f4762(0x1d1)]('('+_0xaea3ec[_0x2f4762(0x1e9)]+')'),'value':_0x38e6f8}))],_0x44370f=await checkbox({'message':_0x2f4762(0x1cd)+a45_0x5989cb[_0x2f4762(0x1d9)](_0x59d0d6[_0x2f4762(0x1da)])+_0x2f4762(0x1db),'choices':_0x4d260f,'loop':![]});if(_0x44370f['includes'](-0x1))return _0x2f4762(0x1cf);if(_0x44370f[_0x2f4762(0x1da)]===0x0)return'custom';return _0x44370f[_0x2f4762(0x1e2)](_0x2a816b=>_0x59d0d6[_0x2a816b]);}export async function promptSingleAppSelection(_0x430b69){const _0xcad57f=a45_0x187f,_0x3acb59=[{'name':a45_0x5989cb[_0xcad57f(0x1d1)]('(Skip;\x20configure\x20later\x20with\x20config\x20set\x20appcode)'),'value':_0xcad57f(0x1ce)},{'name':a45_0x5989cb[_0xcad57f(0x1d5)]('✎\x20Enter\x20appcode\x20manually'),'value':_0xcad57f(0x1cf)},..._0x430b69[_0xcad57f(0x1e2)](_0x13dbc7=>({'name':_0x13dbc7['appName']+'\x20\x20'+a45_0x5989cb[_0xcad57f(0x1d1)]('('+_0x13dbc7[_0xcad57f(0x1e9)]+')'),'value':_0x13dbc7['appCode']}))],_0x4b7c12=await select({'message':_0xcad57f(0x1ca),'choices':_0x3acb59});if(_0x4b7c12===_0xcad57f(0x1ce))return'skip';if(_0x4b7c12===_0xcad57f(0x1cf))return _0xcad57f(0x1cf);return _0x430b69[_0xcad57f(0x1ea)](_0x4d4e32=>_0x4d4e32[_0xcad57f(0x1e9)]===_0x4b7c12);}export async function selectSingleAppcode(_0x46d621){const _0x2325f7=a45_0x187f;if(!_0x46d621)return writeCliSideChannelLine(a45_0x5989cb[_0x2325f7(0x1d1)](_0x2325f7(0x1d6))),_fallbackOrSkip();writeCliSideChannelLine(_0x2325f7(0x1d3));let _0x3d2dbb;try{_0x3d2dbb=await withActiveCookie(_0x46d621,()=>listRemoteApps());}catch(_0x36ed53){writeCliSideChannelLine(a45_0x5989cb[_0x2325f7(0x1d5)]('Could\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.'));if(_0x36ed53 instanceof Error)writeCliSideChannelLine(a45_0x5989cb['gray'](_0x2325f7(0x1d7)+_0x36ed53[_0x2325f7(0x1df)]+')'));return _fallbackOrSkip();}if(_0x3d2dbb[_0x2325f7(0x1da)]===0x0)return writeCliSideChannelLine(a45_0x5989cb[_0x2325f7(0x1d5)](_0x2325f7(0x1e7))),_fallbackOrSkip();const _0x3c2134=await promptSingleAppSelection(_0x3d2dbb);if(_0x3c2134===_0x2325f7(0x1ce))return'';if(_0x3c2134===_0x2325f7(0x1cf))return promptCustomAppcode();return _0x3c2134[_0x2325f7(0x1e9)];}export async function selectMultipleApps(_0x146a8b){const _0x2c9198=a45_0x187f;writeCliSideChannelLine(_0x2c9198(0x1d3));let _0x5de1eb;try{_0x5de1eb=await withActiveCookie(_0x146a8b,()=>listRemoteApps());}catch(_0x253812){writeCliSideChannelLine('\x0aCould\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.');if(_0x253812 instanceof Error)writeCliSideChannelLine('\x20\x20('+_0x253812[_0x2c9198(0x1df)]+')');return _0x2c9198(0x1cf);}if(_0x5de1eb[_0x2c9198(0x1da)]===0x0)return writeCliSideChannelLine(_0x2c9198(0x1dc)),_0x2c9198(0x1cf);return promptAppSelection(_0x5de1eb);}function a45_0x46ed(){const _0x2e2098=['1790728JNcwBg','Found\x20','skip','custom','App\x20Code:','gray','1437348oiWzCP','Fetching\x20available\x20apps...','(Skip;\x20configure\x20later)','yellow','(No\x20login\x20session.\x20Enter\x20an\x20App\x20Code\x20manually\x20or\x20skip.)','\x20\x20(','940191HdVKrJ','cyan','length','\x20apps.\x20Select\x20with\x20space,\x20a=all,\x20i=invert:','\x0aNo\x20available\x20apps\x20found.','20152134DCOLzY','trim','message','✎\x20Enter\x20appcode\x20manually','6aUJjQd','map','valid','✎\x20Enter\x20manually','appName','124165GGDajE','No\x20available\x20apps\x20found.','manual','appCode','find','1114714uDimHK','10kFNBBn','1096337wIGqrr','Select\x20the\x20app\x20to\x20bind:','35JZmVtm'];a45_0x46ed=function(){return _0x2e2098;};return a45_0x46ed();}async function _fallbackOrSkip(){const _0x1e2219=a45_0x187f,_0x24b20f=await select({'message':_0x1e2219(0x1d0),'choices':[{'name':a45_0x5989cb[_0x1e2219(0x1d1)](_0x1e2219(0x1d4)),'value':_0x1e2219(0x1ce)},{'name':a45_0x5989cb[_0x1e2219(0x1d5)](_0x1e2219(0x1e4)),'value':_0x1e2219(0x1e8)}]});if(_0x24b20f===_0x1e2219(0x1ce))return'';return promptCustomAppcode();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a46_0x3665(){const _0x56731f=['PENDING','\x20task\x20status\x20--task-id\x20','10962Sitfth','307014ZVLFKE','string','Async\x20task\x20response\x20did\x20not\x20contain\x20a\x20taskId.','Task\x20','1662234JFwetp','apiError','SUCCESS','\x20is\x20processing.','9036prOqGV','32yjRVsg','taskId','\x20is\x20pending.','toUpperCase','\x20returned\x20unknown\x20status\x20','trim','1765BZPGOR','\x27\x5c\x27\x27','\x20failed.','766494RhMgZQ','FAILED','\x20failed:\x20','784ntUwAK','status','replace','2475146iiRKRO','PROCESSING','30EPebOz','\x20--format\x20compress','34797HsBDqz','\x20completed\x20successfully.','errorMessage','5137EdPBBH','has'];a46_0x3665=function(){return _0x56731f;};return a46_0x3665();}function a46_0x3611(_0x2444c8,_0x1fee06){_0x2444c8=_0x2444c8-0x14c;const _0x366541=a46_0x3665();let _0x36116b=_0x366541[_0x2444c8];return _0x36116b;}const a46_0x4fd8f7=a46_0x3611;(function(_0x21f071,_0x1091c1){const _0x3f97a3=a46_0x3611,_0x108b44=_0x21f071();while(!![]){try{const _0x2d437d=parseInt(_0x3f97a3(0x16c))/0x1+-parseInt(_0x3f97a3(0x15c))/0x2+-parseInt(_0x3f97a3(0x168))/0x3*(parseInt(_0x3f97a3(0x14d))/0x4)+-parseInt(_0x3f97a3(0x153))/0x5*(-parseInt(_0x3f97a3(0x167))/0x6)+-parseInt(_0x3f97a3(0x160))/0x7*(-parseInt(_0x3f97a3(0x159))/0x8)+-parseInt(_0x3f97a3(0x156))/0x9*(parseInt(_0x3f97a3(0x15e))/0xa)+parseInt(_0x3f97a3(0x163))/0xb*(parseInt(_0x3f97a3(0x14c))/0xc);if(_0x2d437d===_0x1091c1)break;else _0x108b44['push'](_0x108b44['shift']());}catch(_0x38165b){_0x108b44['push'](_0x108b44['shift']());}}}(a46_0x3665,0xcba97));import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';const TERMINAL_STATUSES=new Set([a46_0x4fd8f7(0x16e),a46_0x4fd8f7(0x157)]),NON_TERMINAL_STATUSES=new Set([a46_0x4fd8f7(0x165),a46_0x4fd8f7(0x15d)]);export function normalizeAsyncTask(_0x13f8f0){const _0x38c0ce=a46_0x4fd8f7,_0x3f48b2=typeof _0x13f8f0?.[_0x38c0ce(0x14e)]===_0x38c0ce(0x169)?_0x13f8f0[_0x38c0ce(0x14e)]['trim']():'';if(!_0x3f48b2)throw CliErrors[_0x38c0ce(0x16d)](_0x38c0ce(0x16a));const _0x3cf9e1=typeof _0x13f8f0[_0x38c0ce(0x15a)]===_0x38c0ce(0x169)?_0x13f8f0['status'][_0x38c0ce(0x152)]()[_0x38c0ce(0x150)]():'';if(!_0x3cf9e1)throw CliErrors[_0x38c0ce(0x16d)]('Async\x20task\x20'+_0x3f48b2+'\x20response\x20did\x20not\x20contain\x20a\x20status.');return{'taskId':_0x3f48b2,'status':_0x3cf9e1,'errorMessage':typeof _0x13f8f0['errorMessage']===_0x38c0ce(0x169)&&_0x13f8f0[_0x38c0ce(0x162)][_0x38c0ce(0x152)]()?_0x13f8f0[_0x38c0ce(0x162)][_0x38c0ce(0x152)]():null,'isTerminal':TERMINAL_STATUSES[_0x38c0ce(0x164)](_0x3cf9e1),'knownStatus':TERMINAL_STATUSES[_0x38c0ce(0x164)](_0x3cf9e1)||NON_TERMINAL_STATUSES[_0x38c0ce(0x164)](_0x3cf9e1)};}export function buildAsyncTaskStatusCommand(_0x1e5814,_0x5a930a){const _0x171d58=a46_0x4fd8f7;return CLI_BIN_NAME+_0x171d58(0x166)+quoteShellArg(_0x1e5814)+'\x20--appcode\x20'+quoteShellArg(_0x5a930a)+_0x171d58(0x15f);}export function asyncTaskMessage(_0x1c5636){const _0x28cfe0=a46_0x4fd8f7;switch(_0x1c5636['status']){case _0x28cfe0(0x165):return'Task\x20'+_0x1c5636[_0x28cfe0(0x14e)]+_0x28cfe0(0x14f);case'PROCESSING':return'Task\x20'+_0x1c5636[_0x28cfe0(0x14e)]+_0x28cfe0(0x16f);case'SUCCESS':return _0x28cfe0(0x16b)+_0x1c5636[_0x28cfe0(0x14e)]+_0x28cfe0(0x161);case'FAILED':return _0x1c5636[_0x28cfe0(0x162)]?_0x28cfe0(0x16b)+_0x1c5636[_0x28cfe0(0x14e)]+_0x28cfe0(0x158)+_0x1c5636[_0x28cfe0(0x162)]:_0x28cfe0(0x16b)+_0x1c5636[_0x28cfe0(0x14e)]+_0x28cfe0(0x155);default:return _0x28cfe0(0x16b)+_0x1c5636[_0x28cfe0(0x14e)]+_0x28cfe0(0x151)+_0x1c5636[_0x28cfe0(0x15a)]+'.';}}function quoteShellArg(_0x1684c5){const _0x2dc70a=a46_0x4fd8f7;return'\x27'+_0x1684c5[_0x2dc70a(0x15b)](/'/g,_0x2dc70a(0x154))+'\x27';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a47_0x5d42(){var _0x430c85=['73240eXnagU','25190726NOFjDr','url','method','description','2466474RfmRYL','40HjWnaD','140qpGzDP','511rLHfFb','752472zlXTnX','54425qsQMdP','38476UsMdSQ','36DfrMEI','1918020AIYBce','defineProperties'];a47_0x5d42=function(){return _0x430c85;};return a47_0x5d42();}function a47_0x371d(_0x471f64,_0x3db07f){_0x471f64=_0x471f64-0x180;var _0x5d42ed=a47_0x5d42();var _0x371d17=_0x5d42ed[_0x471f64];return _0x371d17;}(function(_0x56d6a9,_0xb966da){var _0x4e5d87=a47_0x371d,_0xf7e547=_0x56d6a9();while(!![]){try{var _0x5c74b4=parseInt(_0x4e5d87(0x18c))/0x1*(-parseInt(_0x4e5d87(0x18b))/0x2)+parseInt(_0x4e5d87(0x18d))/0x3+-parseInt(_0x4e5d87(0x187))/0x4*(parseInt(_0x4e5d87(0x18a))/0x5)+-parseInt(_0x4e5d87(0x185))/0x6+parseInt(_0x4e5d87(0x188))/0x7*(-parseInt(_0x4e5d87(0x180))/0x8)+parseInt(_0x4e5d87(0x189))/0x9*(-parseInt(_0x4e5d87(0x186))/0xa)+parseInt(_0x4e5d87(0x181))/0xb;if(_0x5c74b4===_0xb966da)break;else _0xf7e547['push'](_0xf7e547['shift']());}catch(_0x586efc){_0xf7e547['push'](_0xf7e547['shift']());}}}(a47_0x5d42,0x6beb5));export function asDryRunResult(_0x333f1c,_0x653217){var _0x4c9aa3=a47_0x371d;return Object[_0x4c9aa3(0x18e)](_0x333f1c,{'method':{'value':_0x653217[_0x4c9aa3(0x183)],'enumerable':![]},'url':{'value':_0x653217[_0x4c9aa3(0x182)],'enumerable':![]},..._0x653217[_0x4c9aa3(0x184)]?{'description':{'value':_0x653217[_0x4c9aa3(0x184)],'enumerable':![]}}:{}});}
|