@lovrabet/rabetbase-cli 2.5.2-beta.5 → 2.5.2-beta.7
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/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.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/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/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 -17
- 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/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/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 +5 -6
- package/skills/rabetbase/references/rabetbase-deployment-sync-all.md +56 -0
- package/skills/rabetbase.manifest.json +4 -4
- package/lib/commands/deployment/auto-sync.d.ts +0 -20
- package/lib/commands/deployment/auto-sync.js +0 -1
- package/lib/commands/deployment/sync.d.ts +0 -2
- package/lib/commands/deployment/sync.js +0 -1
- package/skills/rabetbase/references/rabetbase-deployment-sync.md +0 -100
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x5b04d9=a33_0x331e;function a33_0x331e(_0x1acc84,_0x3873f4){_0x1acc84=_0x1acc84-0x9b;const _0x8825d7=a33_0x8825();let _0x331e55=_0x8825d7[_0x1acc84];return _0x331e55;}(function(_0xfb723b,_0xf63f03){const _0x45f92a=a33_0x331e,_0x2d6c28=_0xfb723b();while(!![]){try{const _0x44579a=parseInt(_0x45f92a(0xb2))/0x1+parseInt(_0x45f92a(0x9b))/0x2*(parseInt(_0x45f92a(0xb0))/0x3)+parseInt(_0x45f92a(0xa0))/0x4*(parseInt(_0x45f92a(0xac))/0x5)+parseInt(_0x45f92a(0xa3))/0x6+-parseInt(_0x45f92a(0xa4))/0x7*(-parseInt(_0x45f92a(0xa9))/0x8)+parseInt(_0x45f92a(0x9c))/0x9+-parseInt(_0x45f92a(0xa1))/0xa;if(_0x44579a===_0xf63f03)break;else _0x2d6c28['push'](_0x2d6c28['shift']());}catch(_0x670dfa){_0x2d6c28['push'](_0x2d6c28['shift']());}}}(a33_0x8825,0xd072e));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':'bff','command':'detail','description':'Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','risk':'read','flags':[{'name':'id','type':'number','required':!![],'description':a33_0x5b04d9(0x9d)},{'name':a33_0x5b04d9(0xa6),'type':a33_0x5b04d9(0xad),'description':a33_0x5b04d9(0x9e)}],async 'execute'(_0x3a2f32){const _0x52debd=a33_0x5b04d9,_0x1ff261=await getBffScriptInfo(_0x3a2f32[_0x52debd(0xaa)]('id')),_0x11ae0f=_0x3a2f32['bool'](_0x52debd(0xa6));if(_0x11ae0f)return{'ok':!![],'data':_0x1ff261};return{'ok':!![],'data':{'id':_0x1ff261['id'],'functionName':_0x1ff261[_0x52debd(0x9f)]??'','version':_0x1ff261[_0x52debd(0xa7)]??'','updateUserName':_0x1ff261[_0x52debd(0xa5)]??'','appCode':_0x1ff261[_0x52debd(0xa8)],'scriptType':_0x1ff261[_0x52debd(0xab)],'description':_0x1ff261[_0x52debd(0xb1)]||_0x52debd(0xaf),'createdTime':_0x1ff261[_0x52debd(0xae)]??'','updatedTime':_0x1ff261['updatedTime']??'','scriptContent':_0x1ff261[_0x52debd(0xa2)]??''}};}};function a33_0x8825(){const _0x5e5ea7=['description','138875FKVTVX','7094oOrBFC','7057170IQAbkU','Script\x20ID','Return\x20full\x20raw\x20script\x20object','functionName','73492HjkRdy','31807080sVjcen','scriptContent','8722734fqlviw','5822446XMqVHU','updateUserName','verbose','version','appCode','8THMoTu','num','scriptType','135bFMOqQ','boolean','createdTime','(none)','279rSOovz'];a33_0x8825=function(){return _0x5e5ea7;};return a33_0x8825();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x147e1c,_0x5c9bf7){const _0x769d4f=a34_0x32a0,_0x252a5f=_0x147e1c();while(!![]){try{const _0x6bf821=-parseInt(_0x769d4f(0x11c))/0x1+-parseInt(_0x769d4f(0x123))/0x2*(-parseInt(_0x769d4f(0x11f))/0x3)+parseInt(_0x769d4f(0x11e))/0x4+parseInt(_0x769d4f(0x125))/0x5*(parseInt(_0x769d4f(0x122))/0x6)+-parseInt(_0x769d4f(0x11d))/0x7+parseInt(_0x769d4f(0x120))/0x8+-parseInt(_0x769d4f(0x121))/0x9*(-parseInt(_0x769d4f(0x124))/0xa);if(_0x6bf821===_0x5c9bf7)break;else _0x252a5f['push'](_0x252a5f['shift']());}catch(_0x2f788d){_0x252a5f['push'](_0x252a5f['shift']());}}}(a34_0x1c5a,0x638c3));import{bffList}from'../../commands/bff/list.js';function a34_0x32a0(_0x2b344b,_0x37cf08){_0x2b344b=_0x2b344b-0x11c;const _0x1c5a2d=a34_0x1c5a();let _0x32a0d0=_0x1c5a2d[_0x2b344b];return _0x32a0d0;}import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';function a34_0x1c5a(){const _0x5985c9=['23319cPawRr','66mxEpvM','2fxjUeS','410cVPsmb','296695ZFYODI','490751YGjEjH','4627910SrPcSN','768356rpeZNr','573213yhbeMw','3340064EqLxbW'];a34_0x1c5a=function(){return _0x5985c9;};return a34_0x1c5a();}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
|
-
const
|
|
1
|
+
const a35_0x1f9e3f=a35_0x49d4;(function(_0x2d70b7,_0x4c330f){const _0xab0d57=a35_0x49d4,_0x5589fc=_0x2d70b7();while(!![]){try{const _0x17e938=-parseInt(_0xab0d57(0x140))/0x1*(-parseInt(_0xab0d57(0x14b))/0x2)+parseInt(_0xab0d57(0x13f))/0x3*(parseInt(_0xab0d57(0x130))/0x4)+-parseInt(_0xab0d57(0x13b))/0x5*(parseInt(_0xab0d57(0x144))/0x6)+-parseInt(_0xab0d57(0x141))/0x7*(parseInt(_0xab0d57(0x12f))/0x8)+-parseInt(_0xab0d57(0x131))/0x9+parseInt(_0xab0d57(0x12e))/0xa*(parseInt(_0xab0d57(0x137))/0xb)+parseInt(_0xab0d57(0x134))/0xc;if(_0x17e938===_0x4c330f)break;else _0x5589fc['push'](_0x5589fc['shift']());}catch(_0x3008a3){_0x5589fc['push'](_0x5589fc['shift']());}}}(a35_0x459d,0xf2f4f));function a35_0x49d4(_0x49009b,_0x770887){_0x49009b=_0x49009b-0x12e;const _0x459d8c=a35_0x459d();let _0x49d49b=_0x459d8c[_0x49009b];return _0x49d49b;}function a35_0x459d(){const _0x51516d=['bool','functionName','6MboJcS','2NAnWeX','10686907VEdFGm','read','string','839598uNEdLv','Return\x20full\x20script\x20objects','verbose','boolean','Script\x20type\x20filter','length','ENDPOINT','950970FZYEdh','COMMON','List\x20Backend\x20Function\x20scripts','5674630XNfPCf','8xAuwga','3369212qqOwCV','10347111XOvKuH','bff','description','398772JaXaDt','appCode','Filter\x20by\x20script\x20name','33CxQXOJ','map','str','type','25XaHIdL','name'];a35_0x459d=function(){return _0x51516d;};return a35_0x459d();}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a35_0x1f9e3f(0x132),'command':'list','description':a35_0x1f9e3f(0x14d),'risk':a35_0x1f9e3f(0x142),'flags':[{'name':a35_0x1f9e3f(0x13a),'type':'string','description':a35_0x1f9e3f(0x148),'default':'ENDPOINT','enum':[a35_0x1f9e3f(0x14a),a35_0x1f9e3f(0x14c)]},{'name':a35_0x1f9e3f(0x13c),'type':a35_0x1f9e3f(0x143),'description':a35_0x1f9e3f(0x136)},{'name':a35_0x1f9e3f(0x146),'type':a35_0x1f9e3f(0x147),'description':a35_0x1f9e3f(0x145)}],async 'execute'(_0x8836b9){const _0x90140f=a35_0x1f9e3f,_0x4864c6=await listBffScripts(_0x8836b9[_0x90140f(0x135)],_0x8836b9[_0x90140f(0x139)](_0x90140f(0x13a)),{'scriptName':_0x8836b9[_0x90140f(0x139)](_0x90140f(0x13c))||undefined}),_0x3076e8=_0x8836b9[_0x90140f(0x13d)]('verbose');return{'ok':!![],'data':_0x3076e8?_0x4864c6:_0x4864c6[_0x90140f(0x138)](_0x20b189=>({'id':_0x20b189['id'],'functionName':_0x20b189[_0x90140f(0x13e)]??'','description':_0x20b189[_0x90140f(0x133)]||'(unnamed)','scriptType':_0x20b189['scriptType']})),'message':_0x4864c6[_0x90140f(0x149)]===0x0?'No\x20Backend\x20Function\x20scripts\x20found.':undefined};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0xbe77b0=a36_0x3c7a;function a36_0x3c7a(_0x1a59ff,_0x35834f){_0x1a59ff=_0x1a59ff-0x18f;const _0x571525=a36_0x5715();let _0x3c7a8d=_0x571525[_0x1a59ff];return _0x3c7a8d;}(function(_0x1f8fff,_0x5323fe){const _0x7d721f=a36_0x3c7a,_0x574444=_0x1f8fff();while(!![]){try{const _0x3553b9=-parseInt(_0x7d721f(0x19a))/0x1*(parseInt(_0x7d721f(0x1b5))/0x2)+-parseInt(_0x7d721f(0x1d6))/0x3*(-parseInt(_0x7d721f(0x1a2))/0x4)+parseInt(_0x7d721f(0x1a6))/0x5*(-parseInt(_0x7d721f(0x1ab))/0x6)+parseInt(_0x7d721f(0x1ae))/0x7+-parseInt(_0x7d721f(0x197))/0x8+parseInt(_0x7d721f(0x1a4))/0x9*(-parseInt(_0x7d721f(0x1cf))/0xa)+-parseInt(_0x7d721f(0x1ad))/0xb*(-parseInt(_0x7d721f(0x1a8))/0xc);if(_0x3553b9===_0x5323fe)break;else _0x574444['push'](_0x574444['shift']());}catch(_0x351796){_0x574444['push'](_0x574444['shift']());}}}(a36_0x5715,0x4fe2e));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';function a36_0x5715(){const _0x1abf06=['parse','Pull\x20complete:\x20','string','/api/management/library/scripts/list?appCode=','version','message','filePath','Remote\x20script\x20missing\x20content.','yes','Lock\x20scope\x20for\x20app\x20\x22','appCode','cancelled','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','close','\x20skipped,\x20','type','str','alias','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','stringify','COMMON','HOOK','conflict','596540kkLqsH','functions','ENDPOINT','nonInteractive','Pull\x20only\x20this\x20script\x20type','all','toLowerCase','1480341cTrODM','length','boolean','lockKey','force','lockFilePath','unresolvable\x20target\x20path','&type=','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','datasetCode','read','3247448giXIql','would_pull','hookLocation','221043OwUjbv','Force\x20pull\x20cancelled.','functionName','push','\x20failed','stdin','utf8','toISOString','4UmRLFN','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','27SAvfsD','GET','5OLSkSU','includes','12895932fLHaug','validation','pull','2972298IkiiSo','scriptType','11YRRepA','1970276fNISWg','functionNode','operationType','scriptsRoot','skipped','scriptContent','question','4dJVgIl','bool','local\x20unsynced\x20changes'];a36_0x5715=function(){return _0x1abf06;};return a36_0x5715();}import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':'bff','command':a36_0xbe77b0(0x1aa),'description':'Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','risk':a36_0xbe77b0(0x196),'flags':[{'name':'type','type':a36_0xbe77b0(0x1ba),'description':a36_0xbe77b0(0x1d3),'enum':[a36_0xbe77b0(0x1cc),a36_0xbe77b0(0x1d1),a36_0xbe77b0(0x1cd)]},{'name':a36_0xbe77b0(0x190),'type':a36_0xbe77b0(0x1d8),'description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0xc41663){const _0x385332=a36_0xbe77b0,_0x35c7bb=loadBffProjectConfig(_0xc41663[_0x385332(0x1c2)]),_0x4d2436=await readBffLockFile(_0x35c7bb[_0x385332(0x191)]),{appLock:_0x453cd1}=ensureLockScope(_0x4d2436??createEmptyBffLock(),_0xc41663[_0x385332(0x1c2)],_0x35c7bb[_0x385332(0x1b1)],_0x385332(0x1aa)),_0x44aad7=normalizeBffType(_0xc41663[_0x385332(0x1c8)](_0x385332(0x1c7)))??undefined,_0x3d93c7=buildDatasetCodeToAliasMap(_0xc41663['apiDir'],_0xc41663[_0x385332(0x1c2)]),[_0x4b97c4,_0x25256a]=await Promise[_0x385332(0x1d4)]([listBffScripts(_0xc41663[_0x385332(0x1c2)],_0x44aad7),getBffScriptStatistics(_0xc41663['appCode'])]),_0x32c49b=createHookLocationMap(_0x25256a),_0x185d1d=[];for(const _0x1609a9 of _0x4b97c4){const _0x556c2c=resolveRemoteScriptTarget(_0x35c7bb,_0x1609a9,_0x32c49b,_0x453cd1[_0x385332(0x1d0)],_0x3d93c7);if(!_0x556c2c){_0x185d1d[_0x385332(0x19d)]({'scriptType':_0x1609a9['scriptType'],'functionName':_0x1609a9[_0x385332(0x19c)]??'','status':_0x385332(0x1b2),'reason':'unresolvable\x20target\x20path'});continue;}const _0x3a90fb=_0x453cd1[_0x385332(0x1d0)][_0x556c2c[_0x385332(0x18f)]],_0x10dcc1=_0x1609a9[_0x385332(0x1b3)]!=null?computeContentHash(_0x1609a9['scriptContent']):undefined,_0x58b51=await hasUnsyncedLocalChanges(_0x556c2c[_0x385332(0x1be)],_0x3a90fb,_0x10dcc1);_0x185d1d[_0x385332(0x19d)]({'lockKey':_0x556c2c['lockKey'],'filePath':_0x556c2c[_0x385332(0x1be)],'remoteId':_0x1609a9['id']??null,'status':_0x58b51?_0x385332(0x1ce):_0x385332(0x198)});}return{'method':_0x385332(0x1a5),'url':_0x385332(0x1bb)+_0xc41663['appCode']+(_0x44aad7?_0x385332(0x193)+_0x44aad7:''),'body':{'appCode':_0xc41663[_0x385332(0x1c2)],'filterType':_0x44aad7??null,'files':_0x185d1d},'description':'Would\x20inspect\x20'+_0x185d1d[_0x385332(0x1d7)]+_0x385332(0x1a3)};},async 'execute'(_0x2a45e9){const _0x4a5910=a36_0xbe77b0,_0x17d439=loadBffProjectConfig(_0x2a45e9['appCode']),_0x59e817=await readBffLockFile(_0x17d439[_0x4a5910(0x191)]),{lockData:_0x1ecaa5,appLock:_0x30b160}=ensureLockScope(_0x59e817??createEmptyBffLock(),_0x2a45e9[_0x4a5910(0x1c2)],_0x17d439[_0x4a5910(0x1b1)],'pull'),_0x5539b1=normalizeBffType(_0x2a45e9['str'](_0x4a5910(0x1c7)))??undefined;if(_0x2a45e9[_0x4a5910(0x1c8)](_0x4a5910(0x1c7))&&!_0x5539b1)throw CliErrors[_0x4a5910(0x1a9)](_0x4a5910(0x1ca));const [_0x47d73a,_0x1216a9]=await Promise[_0x4a5910(0x1d4)]([listBffScripts(_0x2a45e9[_0x4a5910(0x1c2)],_0x5539b1),getBffScriptStatistics(_0x2a45e9[_0x4a5910(0x1c2)])]);if(_0x47d73a['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x4a5910(0x1c4)};const _0x3d2b73=_0x2a45e9[_0x4a5910(0x1b6)](_0x4a5910(0x190));if(_0x3d2b73&&!_0x2a45e9['nonInteractive']){const _0x116eb6=await confirmForce();if(!_0x116eb6)throw CliErrors[_0x4a5910(0x1c3)](_0x4a5910(0x19b));}if(_0x3d2b73&&_0x2a45e9[_0x4a5910(0x1d2)]){}const _0x2acf5d=buildDatasetCodeToAliasMap(_0x2a45e9['apiDir'],_0x2a45e9[_0x4a5910(0x1c2)]),_0x4ddf0c=createHookLocationMap(_0x1216a9),_0x597435=JSON[_0x4a5910(0x1b8)](JSON[_0x4a5910(0x1cb)](_0x1ecaa5)),_0x469609=_0x2a45e9[_0x4a5910(0x1c2)],_0x8e9aea=_0x597435['apps'][_0x469609];if(!_0x8e9aea)throw new Error(_0x4a5910(0x1c1)+_0x469609+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x34b945=[],_0xa281ac=[],_0x26fdef=[];for(const _0x2b4f96 of _0x47d73a){const _0xe0d50b=resolveRemoteScriptTarget(_0x17d439,_0x2b4f96,_0x4ddf0c,_0x30b160[_0x4a5910(0x1d0)],_0x2acf5d);if(!_0xe0d50b){_0xa281ac[_0x4a5910(0x19d)]({'lockKey':_0x2b4f96[_0x4a5910(0x1ac)]+'/'+_0x2b4f96['functionName'],'reason':_0x4a5910(0x192)});continue;}const _0x5a4806=_0x30b160[_0x4a5910(0x1d0)][_0xe0d50b[_0x4a5910(0x18f)]];try{if(!_0x2b4f96['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0x2b4f96[_0x4a5910(0x1b3)]==null)throw new Error(_0x4a5910(0x1bf));const _0x13e88e=_0x2b4f96[_0x4a5910(0x1b3)],_0x4f0fd1=computeContentHash(_0x13e88e);if(!_0x3d2b73){const _0x504120=await hasUnsyncedLocalChanges(_0xe0d50b[_0x4a5910(0x1be)],_0x5a4806,_0x4f0fd1);if(_0x504120){_0xa281ac[_0x4a5910(0x19d)]({'lockKey':_0xe0d50b[_0x4a5910(0x18f)],'reason':_0x4a5910(0x1b7)});continue;}}await ensureParentDirectory(_0xe0d50b[_0x4a5910(0x1be)]),await writeFile(_0xe0d50b['filePath'],_0x13e88e,_0x4a5910(0x1a0));const _0x3f3bc4={'hash':_0x4f0fd1,'remoteId':_0x2b4f96['id'],'version':_0x2b4f96[_0x4a5910(0x1bc)]};_0xe0d50b[_0x4a5910(0x1c7)]===_0x4a5910(0x1cd)&&_0xe0d50b[_0x4a5910(0x199)]&&(_0x3f3bc4[_0x4a5910(0x1c9)]=_0xe0d50b[_0x4a5910(0x199)][_0x4a5910(0x1c9)],_0x3f3bc4[_0x4a5910(0x195)]=_0xe0d50b['hookLocation']['datasetCode'],_0x3f3bc4[_0x4a5910(0x1b0)]=_0xe0d50b[_0x4a5910(0x199)][_0x4a5910(0x1b0)],_0x3f3bc4[_0x4a5910(0x1af)]=_0xe0d50b[_0x4a5910(0x199)][_0x4a5910(0x1af)]),_0x8e9aea[_0x4a5910(0x1d0)][_0xe0d50b[_0x4a5910(0x18f)]]=_0x3f3bc4,_0x34b945[_0x4a5910(0x19d)]({'lockKey':_0xe0d50b[_0x4a5910(0x18f)],'remoteId':_0x2b4f96['id']});}catch(_0x59bd32){_0x26fdef[_0x4a5910(0x19d)]({'lockKey':_0xe0d50b[_0x4a5910(0x18f)],'error':_0x59bd32 instanceof Error?_0x59bd32[_0x4a5910(0x1bd)]:String(_0x59bd32)});}}return _0x8e9aea['lastSync']=new Date()[_0x4a5910(0x1a1)](),await writeBffLockFile(_0x17d439[_0x4a5910(0x191)],_0x597435),{'ok':_0x26fdef[_0x4a5910(0x1d7)]===0x0,'data':{'pulled':_0x34b945,'skipped':_0xa281ac,'failed':_0x26fdef},'message':_0x4a5910(0x1b9)+_0x34b945[_0x4a5910(0x1d7)]+'\x20pulled,\x20'+_0xa281ac['length']+_0x4a5910(0x1c6)+_0x26fdef[_0x4a5910(0x1d7)]+_0x4a5910(0x19e)};}};async function hasUnsyncedLocalChanges(_0x42e6e7,_0x3c8786,_0x1be440){if(!await fileExists(_0x42e6e7))return![];const _0x154195=await computeFileHash(_0x42e6e7);if(!_0x3c8786)return _0x1be440?_0x154195!==_0x1be440:!![];return _0x154195!==_0x3c8786['hash'];}function buildDatasetCodeToAliasMap(_0x3faf8d,_0x38b0aa){const _0x131919=a36_0xbe77b0,_0x176318=loadAliasMap(_0x3faf8d,undefined,resolveApiFilePath(_0x3faf8d,_0x38b0aa));return new Map(_0x176318['map'](_0x4c8073=>[_0x4c8073[_0x131919(0x195)],_0x4c8073[_0x131919(0x1c9)]]));}async function confirmForce(){const _0x4c7990=a36_0xbe77b0,_0x1d01c6=createInterface({'input':process[_0x4c7990(0x19f)],'output':process['stderr']}),_0x222ca2=await new Promise(_0x786274=>{const _0x455357=_0x4c7990;_0x1d01c6[_0x455357(0x1b4)](_0x455357(0x194),_0x786274);});return _0x1d01c6[_0x4c7990(0x1c5)](),['y',_0x4c7990(0x1c0)][_0x4c7990(0x1a7)](_0x222ca2['trim']()[_0x4c7990(0x1d5)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a37_0x39cf98=a37_0x57de;(function(_0x22f9f2,_0x13d5c6){const _0xe70399=a37_0x57de,_0x26aa49=_0x22f9f2();while(!![]){try{const _0x49271d=-parseInt(_0xe70399(0x17a))/0x1+-parseInt(_0xe70399(0x16b))/0x2*(-parseInt(_0xe70399(0x141))/0x3)+parseInt(_0xe70399(0x16a))/0x4+-parseInt(_0xe70399(0x143))/0x5*(parseInt(_0xe70399(0x130))/0x6)+-parseInt(_0xe70399(0x173))/0x7*(parseInt(_0xe70399(0x14d))/0x8)+-parseInt(_0xe70399(0x15d))/0x9*(-parseInt(_0xe70399(0x135))/0xa)+-parseInt(_0xe70399(0x174))/0xb*(-parseInt(_0xe70399(0x12a))/0xc);if(_0x49271d===_0x13d5c6)break;else _0x26aa49['push'](_0x26aa49['shift']());}catch(_0x4fbc83){_0x26aa49['push'](_0x26aa49['shift']());}}}(a37_0x1cab,0xbcce5));import{readFile}from'node:fs/promises';function a37_0x57de(_0x5cbdee,_0x4bed17){_0x5cbdee=_0x5cbdee-0x12a;const _0x1cab7c=a37_0x1cab();let _0x57de20=_0x1cab7c[_0x5cbdee];return _0x57de20;}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_0x1cab(){const _0x287b49=['Run\x20`','3QbhxKi','Cannot\x20resolve\x20dataset\x20for\x20\x22','1223805nLcUsz','datasetCode','bff',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','scriptsRoot','string','map','Push\x20complete:\x20','description','status','532568rYHSUa','/api/management/library/scripts/save','lastSync','every','apps','hash','join','length','No\x20local\x20Backend\x20Function\x20scripts\x20found.','alias','type','runtime\x20cache\x20cleared','apiDir','set','remoteId','name','819BNtyeT','Would\x20inspect\x20','ENDPOINT','cleared','Force\x20push\x20ignoring\x20hash\x20protection','Lock\x20scope\x20for\x20app\x20\x22','attempted','aliasToDatasetCode',',\x20deployment\x20sync\x20','lockKey','utf8','validation','get','3212204fjqJSs','254614VYbPsx','\x22\x20not\x20found\x20after\x20ensureLockScope.','bool','\x20failed,\x20','boolean','create','update','Runtime\x20script\x20cache\x20cleared.','7qKIRhg','44zJFBoA','filePath','runtime\x20cache\x20not\x20needed','lockFilePath','stringify','datasetCodeToDataset','181591oDdmaw','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','functions','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','980988JmaqmP','HOOK','unchanged','Push\x20only\x20this\x20script\x20type','some','\x22.\x20','6NetFUB','datasetId','would_push','version','appCode','980UeZgvv','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','Incomplete\x20HOOK\x20path:\x20','POST','operationType','script','functionNode','force','push','\x20uploaded,\x20','values'];a37_0x1cab=function(){return _0x287b49;};return a37_0x1cab();}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}from'../../commands/deployment/auto-sync.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':a37_0x39cf98(0x145),'command':a37_0x39cf98(0x13d),'description':'Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','risk':'write','flags':[{'name':'type','type':a37_0x39cf98(0x148),'description':a37_0x39cf98(0x12d),'enum':['COMMON',a37_0x39cf98(0x15f),a37_0x39cf98(0x12b)]},{'name':'name','type':a37_0x39cf98(0x148),'description':a37_0x39cf98(0x136)},{'name':a37_0x39cf98(0x13c),'type':a37_0x39cf98(0x16f),'description':a37_0x39cf98(0x161)}],async 'dryRun'(_0x2c71c5){const _0x8cd7f9=a37_0x39cf98,_0x329fb5=loadBffProjectConfig(_0x2c71c5[_0x8cd7f9(0x134)]),_0x3696f4=await readBffLockFile(_0x329fb5[_0x8cd7f9(0x177)]),{appLock:_0x3f1f49}=ensureLockScope(_0x3696f4??createEmptyBffLock(),_0x2c71c5[_0x8cd7f9(0x134)],_0x329fb5[_0x8cd7f9(0x147)],'push'),_0x210b48=await getTargetFunctions(_0x329fb5,_0x2c71c5),_0x4aea26=_0x2c71c5[_0x8cd7f9(0x16d)](_0x8cd7f9(0x13c)),_0xe3539b=[],_0x8d8d0e=[];for(const _0x17c742 of _0x210b48){const _0x2c684a=await computeFileHash(_0x17c742[_0x8cd7f9(0x175)]),_0x47405e=_0x3f1f49[_0x8cd7f9(0x17c)][_0x17c742['lockKey']],_0x312ecb=!!_0x47405e&&_0x47405e[_0x8cd7f9(0x152)]===_0x2c684a,_0x284ecd=!_0x4aea26&&_0x312ecb?_0x8cd7f9(0x12c):'would_push';_0xe3539b['push']({'lockKey':_0x17c742['lockKey'],'filePath':_0x17c742[_0x8cd7f9(0x175)],'remoteId':_0x47405e?.[_0x8cd7f9(0x15b)]??null,'mode':_0x47405e?.[_0x8cd7f9(0x15b)]?_0x8cd7f9(0x171):_0x8cd7f9(0x170),'status':_0x284ecd});if(_0x284ecd===_0x8cd7f9(0x132))_0x8d8d0e[_0x8cd7f9(0x13d)](_0x17c742[_0x8cd7f9(0x15c)]);}return{'method':_0x8cd7f9(0x138),'url':_0x8cd7f9(0x14e),'deploymentSync':buildAutomaticDeploymentSyncPreview(_0x8cd7f9(0x145),_0x8d8d0e),'body':{'appCode':_0x2c71c5[_0x8cd7f9(0x134)],'force':_0x4aea26,'files':_0xe3539b,'cacheClearAtRuntime':_0xe3539b[_0x8cd7f9(0x12e)](_0x45b5fe=>_0x45b5fe[_0x8cd7f9(0x14c)]===_0x8cd7f9(0x132)),'cacheClearAtRuntimeTimes':_0xe3539b[_0x8cd7f9(0x12e)](_0x317dcf=>_0x317dcf[_0x8cd7f9(0x14c)]==='would_push')?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x8cd7f9(0x15e)+_0xe3539b[_0x8cd7f9(0x154)]+_0x8cd7f9(0x17d)};},async 'execute'(_0x4aff4c){const _0x1a9ecc=a37_0x39cf98,_0x2b4e8e=loadBffProjectConfig(_0x4aff4c[_0x1a9ecc(0x134)]),_0x12249e=await readBffLockFile(_0x2b4e8e[_0x1a9ecc(0x177)]),{lockData:_0x5b7342,appLock:_0x1b63bf}=ensureLockScope(_0x12249e??createEmptyBffLock(),_0x4aff4c['appCode'],_0x2b4e8e[_0x1a9ecc(0x147)],_0x1a9ecc(0x13d)),_0x142d4f=await getTargetFunctions(_0x2b4e8e,_0x4aff4c);if(_0x142d4f[_0x1a9ecc(0x154)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x1a9ecc(0x155)};const _0x1a1b5b=_0x4aff4c[_0x1a9ecc(0x16d)](_0x1a9ecc(0x13c)),_0xcd2bd4=JSON['parse'](JSON[_0x1a9ecc(0x178)](_0x5b7342)),_0x5ce1ef=_0xcd2bd4[_0x1a9ecc(0x151)][_0x4aff4c[_0x1a9ecc(0x134)]];if(!_0x5ce1ef)throw new Error(_0x1a9ecc(0x162)+_0x4aff4c[_0x1a9ecc(0x134)]+_0x1a9ecc(0x16c));const _0x5bd2f3=await buildHookMaps(_0x4aff4c[_0x1a9ecc(0x134)],_0x4aff4c[_0x1a9ecc(0x159)],_0x142d4f,_0x5ce1ef),_0x3efc85=[],_0x14339d=[],_0x5b46b3=[],_0x5030ee=[];for(const _0x3fd603 of _0x142d4f){const _0x4969db=await computeFileHash(_0x3fd603['filePath']),_0x3bb3a0=_0x5ce1ef[_0x1a9ecc(0x17c)][_0x3fd603['lockKey']];if(!_0x1a1b5b&&_0x3bb3a0&&_0x3bb3a0[_0x1a9ecc(0x152)]===_0x4969db){_0x5b46b3[_0x1a9ecc(0x13d)]({'lockKey':_0x3fd603[_0x1a9ecc(0x166)],'reason':_0x1a9ecc(0x12c)});continue;}try{await uploadSingleFunction(_0x4aff4c[_0x1a9ecc(0x134)],_0x3fd603,_0x5ce1ef,_0x5bd2f3);const _0x1885ca=_0x5ce1ef[_0x1a9ecc(0x17c)][_0x3fd603['lockKey']];_0x3efc85[_0x1a9ecc(0x13d)]({'lockKey':_0x3fd603['lockKey'],'remoteId':_0x1885ca?.[_0x1a9ecc(0x15b)]??0x0}),_0x14339d['push'](_0x3fd603[_0x1a9ecc(0x15c)]);}catch(_0x2f7c73){_0x5030ee[_0x1a9ecc(0x13d)]({'lockKey':_0x3fd603[_0x1a9ecc(0x166)],'error':_0x2f7c73 instanceof Error?_0x2f7c73['message']:String(_0x2f7c73)});}}_0x5ce1ef[_0x1a9ecc(0x14f)]=new Date()['toISOString'](),await writeBffLockFile(_0x2b4e8e['lockFilePath'],_0xcd2bd4),await waitForUploadedLockEntries(_0x2b4e8e[_0x1a9ecc(0x177)],_0x4aff4c['appCode'],_0x3efc85[_0x1a9ecc(0x149)](_0x31896e=>_0x31896e[_0x1a9ecc(0x166)]));let _0x545ea7={'attempted':![],'cleared':![]};if(_0x3efc85[_0x1a9ecc(0x154)]>0x0)try{let _0x4267f3='';for(let _0x497741=0x0;_0x497741<CACHE_CLEAR_ATTEMPTS;_0x497741+=0x1){_0x4267f3=await clearBffScriptCache(),_0x497741<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x545ea7={'attempted':!![],'cleared':!![],'message':_0x4267f3||_0x1a9ecc(0x172)};}catch(_0x4d6f6b){_0x545ea7={'attempted':!![],'cleared':![],'error':_0x4d6f6b instanceof Error?_0x4d6f6b['message']:String(_0x4d6f6b)};}const _0x2b9b97=_0x5030ee['length']===0x0&&(_0x545ea7[_0x1a9ecc(0x163)]?_0x545ea7[_0x1a9ecc(0x160)]:!![]),_0x320b9d=await runAutomaticDeploymentSync(_0x4aff4c,_0x1a9ecc(0x145),_0x14339d,_0x2b9b97),_0x42e959=_0x2b9b97&&automaticDeploymentSyncSucceeded(_0x320b9d),_0x4c383d=_0x545ea7[_0x1a9ecc(0x163)]?_0x545ea7['cleared']?_0x1a9ecc(0x158):'runtime\x20cache\x20clear\x20failed':_0x1a9ecc(0x176),_0x2a6080=_0x1a9ecc(0x165)+_0x320b9d[_0x1a9ecc(0x14c)];return{'ok':_0x42e959,'data':{'uploaded':_0x3efc85,'skipped':_0x5b46b3,'failed':_0x5030ee,'cacheClear':_0x545ea7,'deploymentSync':_0x320b9d},'message':_0x1a9ecc(0x14a)+_0x3efc85['length']+_0x1a9ecc(0x13e)+_0x5b46b3[_0x1a9ecc(0x154)]+'\x20skipped,\x20'+_0x5030ee[_0x1a9ecc(0x154)]+_0x1a9ecc(0x16e)+_0x4c383d+_0x2a6080};}};async function getTargetFunctions(_0x195e42,_0x36e528){const _0x2b5d3d=a37_0x39cf98,_0x1e1ddb=_0x36e528['str'](_0x2b5d3d(0x157)),_0x2d5f80=_0x36e528['str'](_0x2b5d3d(0x15c)),_0x2bf215=normalizeBffType(_0x1e1ddb)??undefined;if(_0x2d5f80&&!_0x2bf215)throw CliErrors[_0x2b5d3d(0x168)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x3c599a=await scanLocalBffFunctions(_0x195e42,_0x2bf215);if(_0x2d5f80){const _0x3f66e0=_0x3c599a['filter'](_0x482caa=>_0x482caa[_0x2b5d3d(0x15c)]===_0x2d5f80);if(_0x3f66e0['length']===0x0)throw CliErrors[_0x2b5d3d(0x168)]('Local\x20function\x20not\x20found:\x20'+_0x2bf215+'/'+_0x2d5f80);return _0x3f66e0;}return _0x3c599a;}async function buildHookMaps(_0x3a6c93,_0xc16629,_0x4aeae9,_0x4c12b1){const _0x3c87c0=a37_0x39cf98,_0xc590e1=_0x4aeae9[_0x3c87c0(0x12e)](_0x3173ca=>_0x3173ca['type']===_0x3c87c0(0x12b));if(!_0xc590e1)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x122dfa=loadAliasMap(_0xc16629,undefined,resolveApiFilePath(_0xc16629,_0x3a6c93)),_0x45a05f=new Map(_0x122dfa[_0x3c87c0(0x149)](_0x1299e9=>[_0x1299e9[_0x3c87c0(0x156)],_0x1299e9[_0x3c87c0(0x144)]]));for(const _0x30a533 of Object[_0x3c87c0(0x13f)](_0x4c12b1[_0x3c87c0(0x17c)])){_0x30a533[_0x3c87c0(0x156)]&&_0x30a533[_0x3c87c0(0x144)]&&!_0x45a05f['has'](_0x30a533['alias'])&&_0x45a05f[_0x3c87c0(0x15a)](_0x30a533['alias'],_0x30a533[_0x3c87c0(0x144)]);}const _0x503317=await listDatasets(_0x3a6c93),_0x3bf920=new Map(_0x503317[_0x3c87c0(0x149)](_0x2f0174=>[_0x2f0174['code'],_0x2f0174]));return{'aliasToDatasetCode':_0x45a05f,'datasetCodeToDataset':_0x3bf920};}async function uploadSingleFunction(_0x1918ed,_0x314b55,_0x2e422e,_0x404b34){const _0x5101ff=a37_0x39cf98,_0x419e23=await readFile(_0x314b55[_0x5101ff(0x175)],_0x5101ff(0x167)),_0x413c5f=await computeFileHash(_0x314b55['filePath']),_0x681134=_0x2e422e[_0x5101ff(0x17c)][_0x314b55['lockKey']];if(_0x681134?.[_0x5101ff(0x15b)]&&_0x681134[_0x5101ff(0x133)]==null)throw CliErrors[_0x5101ff(0x168)](_0x314b55[_0x5101ff(0x166)]+_0x5101ff(0x146));let _0x7b574c=extractScriptDescription(_0x419e23);if(!_0x7b574c&&_0x681134?.['remoteId']){const _0x9c7dc6=await getBffScriptInfo(_0x681134['remoteId']);_0x7b574c=_0x9c7dc6[_0x5101ff(0x14b)]||undefined;}const _0x50a57d={'appCode':_0x1918ed,'functionName':_0x314b55[_0x5101ff(0x15c)],'scriptType':_0x314b55['type'],'scriptContent':_0x419e23};if(_0x681134?.[_0x5101ff(0x15b)])_0x50a57d['id']=_0x681134['remoteId'];if(_0x681134?.[_0x5101ff(0x133)]!=null)_0x50a57d[_0x5101ff(0x133)]=_0x681134[_0x5101ff(0x133)];if(_0x7b574c)_0x50a57d[_0x5101ff(0x14b)]=_0x7b574c;if(_0x314b55['type']===_0x5101ff(0x12b)){const _0x30cf31=_0x314b55[_0x5101ff(0x156)];if(!_0x30cf31||!_0x314b55['operationType']||!_0x314b55[_0x5101ff(0x13b)])throw CliErrors[_0x5101ff(0x168)](_0x5101ff(0x137)+_0x314b55[_0x5101ff(0x166)]);const _0x148b09=_0x404b34[_0x5101ff(0x164)][_0x5101ff(0x169)](_0x30cf31)??_0x681134?.[_0x5101ff(0x144)]??_0x30cf31,_0x44789a=_0x404b34[_0x5101ff(0x179)][_0x5101ff(0x169)](_0x148b09);if(!_0x44789a)throw CliErrors[_0x5101ff(0x168)](_0x5101ff(0x142)+_0x30cf31+_0x5101ff(0x12f)+(_0x5101ff(0x140)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.'));_0x50a57d[_0x5101ff(0x131)]=_0x44789a['id'],_0x50a57d['operationType']=_0x314b55[_0x5101ff(0x139)],_0x50a57d[_0x5101ff(0x13b)]=_0x314b55[_0x5101ff(0x13b)];}const _0x5c10ab=await saveBffScript(_0x50a57d),_0x930d8e=_0x5c10ab['id'],_0x3d8051=_0x5c10ab[_0x5101ff(0x13a)]??await getBffScriptInfo(_0x930d8e),_0x160d50={'hash':_0x413c5f,'remoteId':_0x930d8e,'version':_0x3d8051['version']};if(_0x314b55[_0x5101ff(0x157)]===_0x5101ff(0x12b)){const _0x18b3ff=_0x314b55[_0x5101ff(0x156)],_0x1b5c5b=_0x404b34[_0x5101ff(0x164)][_0x5101ff(0x169)](_0x18b3ff)??_0x681134?.[_0x5101ff(0x144)]??_0x18b3ff;_0x404b34[_0x5101ff(0x164)]['has'](_0x18b3ff)?_0x160d50[_0x5101ff(0x156)]=_0x18b3ff:_0x160d50[_0x5101ff(0x156)]=_0x681134?.[_0x5101ff(0x156)],_0x160d50[_0x5101ff(0x144)]=_0x1b5c5b,_0x160d50[_0x5101ff(0x139)]=_0x314b55[_0x5101ff(0x139)],_0x160d50[_0x5101ff(0x13b)]=_0x314b55['functionNode'];}_0x2e422e['functions'][_0x314b55[_0x5101ff(0x166)]]=_0x160d50;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x450d79,_0x1f8b99,_0x4bbd6d){const _0x3a1bb5=a37_0x39cf98;if(_0x4bbd6d[_0x3a1bb5(0x154)]===0x0)return;for(let _0x32e6ab=0x0;_0x32e6ab<LOCK_SETTLE_RETRY_COUNT;_0x32e6ab+=0x1){const _0x3ed457=await readBffLockFile(_0x450d79),_0x124b98=_0x3ed457?.[_0x3a1bb5(0x151)]?.[_0x1f8b99]?.[_0x3a1bb5(0x17c)]??{},_0x3932db=_0x4bbd6d[_0x3a1bb5(0x150)](_0x429d69=>!!_0x124b98[_0x429d69]?.[_0x3a1bb5(0x15b)]);if(_0x3932db)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x3a1bb5(0x17b)+_0x4bbd6d[_0x3a1bb5(0x153)](',\x20')+'.');}
|
|
1
|
+
const a37_0xe8d9c4=a37_0x4c43;(function(_0x19db58,_0x5c0f52){const _0x2271d7=a37_0x4c43,_0x564e6c=_0x19db58();while(!![]){try{const _0x56b263=parseInt(_0x2271d7(0x18f))/0x1+-parseInt(_0x2271d7(0x1c0))/0x2*(parseInt(_0x2271d7(0x172))/0x3)+parseInt(_0x2271d7(0x199))/0x4*(parseInt(_0x2271d7(0x1a6))/0x5)+parseInt(_0x2271d7(0x1bc))/0x6+-parseInt(_0x2271d7(0x1b1))/0x7*(-parseInt(_0x2271d7(0x1b2))/0x8)+parseInt(_0x2271d7(0x1ac))/0x9*(parseInt(_0x2271d7(0x179))/0xa)+-parseInt(_0x2271d7(0x17d))/0xb;if(_0x56b263===_0x5c0f52)break;else _0x564e6c['push'](_0x564e6c['shift']());}catch(_0x1c9789){_0x564e6c['push'](_0x564e6c['shift']());}}}(a37_0x2b4a,0xb5b96));import{readFile}from'node:fs/promises';function a37_0x2b4a(){const _0x4bb915=['remoteId','204280ixoUnv','datasetId','force','runtime\x20cache\x20cleared','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','bool','set','datasetCode','ENDPOINT','aliasToDatasetCode','script','would_push','\x20failed,\x20','110MkvzJH','boolean','validation','write','Force\x20push\x20ignoring\x20hash\x20protection','has','5815089rJSGpY','join','functionNode','push','scriptsRoot','140TEovCp','421936plRWjw','code','version','unchanged','description','runtime\x20cache\x20not\x20needed','get','Push\x20only\x20this\x20script\x20type','parse','\x22.\x20','7194642pIgMJS','stringify','length','lockFilePath','2645782CKRbCa','/api/management/library/scripts/save','Lock\x20scope\x20for\x20app\x20\x22','3WDqpMj','map','bff','HOOK','datasetCodeToDataset','name','functions','10uhAnRU','utf8','every','Would\x20inspect\x20','25400991KzHUQT','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','lastSync','update','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','string','Push\x20complete:\x20','status','filePath','apps','operationType','No\x20local\x20Backend\x20Function\x20scripts\x20found.','Local\x20function\x20not\x20found:\x20','hash','type','\x20skipped,\x20','alias','attempted','352806zYpvzH',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','create','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','lockKey','appCode','COMMON','toISOString','message'];a37_0x2b4a=function(){return _0x4bb915;};return a37_0x2b4a();}import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';function a37_0x4c43(_0x5c3270,_0x57dd83){_0x5c3270=_0x5c3270-0x172;const _0x2b4a86=a37_0x2b4a();let _0x4c43ec=_0x2b4a86[_0x5c3270];return _0x4c43ec;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':a37_0xe8d9c4(0x174),'command':a37_0xe8d9c4(0x1af),'description':a37_0xe8d9c4(0x17e),'risk':a37_0xe8d9c4(0x1a9),'flags':[{'name':a37_0xe8d9c4(0x18b),'type':a37_0xe8d9c4(0x182),'description':a37_0xe8d9c4(0x1b9),'enum':[a37_0xe8d9c4(0x195),a37_0xe8d9c4(0x1a1),'HOOK']},{'name':'name','type':a37_0xe8d9c4(0x182),'description':a37_0xe8d9c4(0x19d)},{'name':a37_0xe8d9c4(0x19b),'type':a37_0xe8d9c4(0x1a7),'description':a37_0xe8d9c4(0x1aa)}],async 'dryRun'(_0x461a87){const _0x244a16=a37_0xe8d9c4,_0x79479f=loadBffProjectConfig(_0x461a87[_0x244a16(0x194)]),_0x43eeb9=await readBffLockFile(_0x79479f[_0x244a16(0x1bf)]),{appLock:_0x1ac7ca}=ensureLockScope(_0x43eeb9??createEmptyBffLock(),_0x461a87[_0x244a16(0x194)],_0x79479f[_0x244a16(0x1b0)],_0x244a16(0x1af)),_0x4f9fac=await getTargetFunctions(_0x79479f,_0x461a87),_0x31b302=_0x461a87['bool'](_0x244a16(0x19b)),_0x294b75=[];for(const _0x37f2c4 of _0x4f9fac){const _0x424a1a=await computeFileHash(_0x37f2c4[_0x244a16(0x185)]),_0x468c6f=_0x1ac7ca[_0x244a16(0x178)][_0x37f2c4[_0x244a16(0x193)]],_0x37be77=!!_0x468c6f&&_0x468c6f[_0x244a16(0x18a)]===_0x424a1a,_0x10d48a=!_0x31b302&&_0x37be77?_0x244a16(0x1b5):_0x244a16(0x1a4);_0x294b75[_0x244a16(0x1af)]({'lockKey':_0x37f2c4[_0x244a16(0x193)],'filePath':_0x37f2c4[_0x244a16(0x185)],'remoteId':_0x468c6f?.[_0x244a16(0x198)]??null,'mode':_0x468c6f?.['remoteId']?_0x244a16(0x180):_0x244a16(0x191),'status':_0x10d48a});}return{'method':'POST','url':_0x244a16(0x1c1),'body':{'appCode':_0x461a87['appCode'],'force':_0x31b302,'files':_0x294b75,'cacheClearAtRuntime':_0x294b75['some'](_0x1b305c=>_0x1b305c['status']===_0x244a16(0x1a4)),'cacheClearAtRuntimeTimes':_0x294b75['some'](_0x13e5aa=>_0x13e5aa[_0x244a16(0x184)]===_0x244a16(0x1a4))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x244a16(0x17c)+_0x294b75[_0x244a16(0x1be)]+_0x244a16(0x192)};},async 'execute'(_0x4d42f7){const _0xa1d88c=a37_0xe8d9c4,_0x52b123=loadBffProjectConfig(_0x4d42f7[_0xa1d88c(0x194)]),_0x1175d9=await readBffLockFile(_0x52b123[_0xa1d88c(0x1bf)]),{lockData:_0x4eb37a,appLock:_0x221ac8}=ensureLockScope(_0x1175d9??createEmptyBffLock(),_0x4d42f7['appCode'],_0x52b123[_0xa1d88c(0x1b0)],'push'),_0x196832=await getTargetFunctions(_0x52b123,_0x4d42f7);if(_0x196832[_0xa1d88c(0x1be)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0xa1d88c(0x188)};const _0x17c409=_0x4d42f7[_0xa1d88c(0x19e)](_0xa1d88c(0x19b)),_0x5b1c4d=JSON[_0xa1d88c(0x1ba)](JSON[_0xa1d88c(0x1bd)](_0x4eb37a)),_0x31c807=_0x5b1c4d[_0xa1d88c(0x186)][_0x4d42f7['appCode']];if(!_0x31c807)throw new Error(_0xa1d88c(0x1c2)+_0x4d42f7[_0xa1d88c(0x194)]+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x5f4b35=await buildHookMaps(_0x4d42f7['appCode'],_0x4d42f7['apiDir'],_0x196832,_0x31c807),_0x142fa8=[],_0x2ba67b=[],_0x510817=[];for(const _0x18d3b1 of _0x196832){const _0x11ec18=await computeFileHash(_0x18d3b1[_0xa1d88c(0x185)]),_0x158b01=_0x31c807['functions'][_0x18d3b1[_0xa1d88c(0x193)]];if(!_0x17c409&&_0x158b01&&_0x158b01[_0xa1d88c(0x18a)]===_0x11ec18){_0x2ba67b[_0xa1d88c(0x1af)]({'lockKey':_0x18d3b1['lockKey'],'reason':_0xa1d88c(0x1b5)});continue;}try{await uploadSingleFunction(_0x4d42f7[_0xa1d88c(0x194)],_0x18d3b1,_0x31c807,_0x5f4b35);const _0x5eaae7=_0x31c807[_0xa1d88c(0x178)][_0x18d3b1['lockKey']];_0x142fa8[_0xa1d88c(0x1af)]({'lockKey':_0x18d3b1[_0xa1d88c(0x193)],'remoteId':_0x5eaae7?.[_0xa1d88c(0x198)]??0x0});}catch(_0x23a0c2){_0x510817['push']({'lockKey':_0x18d3b1[_0xa1d88c(0x193)],'error':_0x23a0c2 instanceof Error?_0x23a0c2[_0xa1d88c(0x197)]:String(_0x23a0c2)});}}_0x31c807[_0xa1d88c(0x17f)]=new Date()[_0xa1d88c(0x196)](),await writeBffLockFile(_0x52b123[_0xa1d88c(0x1bf)],_0x5b1c4d),await waitForUploadedLockEntries(_0x52b123[_0xa1d88c(0x1bf)],_0x4d42f7[_0xa1d88c(0x194)],_0x142fa8['map'](_0xd16274=>_0xd16274[_0xa1d88c(0x193)]));let _0x10d040={'attempted':![],'cleared':![]};if(_0x142fa8[_0xa1d88c(0x1be)]>0x0)try{let _0x3af3fa='';for(let _0x28c313=0x0;_0x28c313<CACHE_CLEAR_ATTEMPTS;_0x28c313+=0x1){_0x3af3fa=await clearBffScriptCache(),_0x28c313<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x10d040={'attempted':!![],'cleared':!![],'message':_0x3af3fa||'Runtime\x20script\x20cache\x20cleared.'};}catch(_0x181489){_0x10d040={'attempted':!![],'cleared':![],'error':_0x181489 instanceof Error?_0x181489['message']:String(_0x181489)};}const _0x266ba5=_0x510817[_0xa1d88c(0x1be)]===0x0&&(_0x10d040[_0xa1d88c(0x18e)]?_0x10d040['cleared']:!![]),_0x5d834b=_0x266ba5,_0x56be2f=_0x10d040['attempted']?_0x10d040['cleared']?_0xa1d88c(0x19c):'runtime\x20cache\x20clear\x20failed':_0xa1d88c(0x1b7);return{'ok':_0x5d834b,'data':{'uploaded':_0x142fa8,'skipped':_0x2ba67b,'failed':_0x510817,'cacheClear':_0x10d040},'message':_0xa1d88c(0x183)+_0x142fa8[_0xa1d88c(0x1be)]+'\x20uploaded,\x20'+_0x2ba67b[_0xa1d88c(0x1be)]+_0xa1d88c(0x18c)+_0x510817['length']+_0xa1d88c(0x1a5)+_0x56be2f};}};async function getTargetFunctions(_0x11fb30,_0x58a5fb){const _0x47fcd1=a37_0xe8d9c4,_0x46e19a=_0x58a5fb['str']('type'),_0x3ac20e=_0x58a5fb['str'](_0x47fcd1(0x177)),_0xef9952=normalizeBffType(_0x46e19a)??undefined;if(_0x3ac20e&&!_0xef9952)throw CliErrors['validation'](_0x47fcd1(0x181));const _0x2345a3=await scanLocalBffFunctions(_0x11fb30,_0xef9952);if(_0x3ac20e){const _0x4a63ac=_0x2345a3['filter'](_0x36c2ee=>_0x36c2ee[_0x47fcd1(0x177)]===_0x3ac20e);if(_0x4a63ac['length']===0x0)throw CliErrors[_0x47fcd1(0x1a8)](_0x47fcd1(0x189)+_0xef9952+'/'+_0x3ac20e);return _0x4a63ac;}return _0x2345a3;}async function buildHookMaps(_0x546de3,_0x21d0a3,_0x2ea399,_0x14b329){const _0x5f3923=a37_0xe8d9c4,_0x4bbfdd=_0x2ea399['some'](_0x4f27ef=>_0x4f27ef[_0x5f3923(0x18b)]===_0x5f3923(0x175));if(!_0x4bbfdd)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x5b1a22=loadAliasMap(_0x21d0a3,undefined,resolveApiFilePath(_0x21d0a3,_0x546de3)),_0x1e71ab=new Map(_0x5b1a22['map'](_0x4c7b26=>[_0x4c7b26[_0x5f3923(0x18d)],_0x4c7b26[_0x5f3923(0x1a0)]]));for(const _0x37b931 of Object['values'](_0x14b329[_0x5f3923(0x178)])){_0x37b931[_0x5f3923(0x18d)]&&_0x37b931[_0x5f3923(0x1a0)]&&!_0x1e71ab[_0x5f3923(0x1ab)](_0x37b931[_0x5f3923(0x18d)])&&_0x1e71ab[_0x5f3923(0x19f)](_0x37b931[_0x5f3923(0x18d)],_0x37b931['datasetCode']);}const _0x31b180=await listDatasets(_0x546de3),_0x1855ed=new Map(_0x31b180[_0x5f3923(0x173)](_0x221f01=>[_0x221f01[_0x5f3923(0x1b3)],_0x221f01]));return{'aliasToDatasetCode':_0x1e71ab,'datasetCodeToDataset':_0x1855ed};}async function uploadSingleFunction(_0x1d8e6f,_0x41c967,_0x323977,_0x2f1e7b){const _0x59ef0e=a37_0xe8d9c4,_0x14ee66=await readFile(_0x41c967[_0x59ef0e(0x185)],_0x59ef0e(0x17a)),_0x1bbfe1=await computeFileHash(_0x41c967[_0x59ef0e(0x185)]),_0x4fab64=_0x323977['functions'][_0x41c967[_0x59ef0e(0x193)]];if(_0x4fab64?.['remoteId']&&_0x4fab64[_0x59ef0e(0x1b4)]==null)throw CliErrors[_0x59ef0e(0x1a8)](_0x41c967[_0x59ef0e(0x193)]+_0x59ef0e(0x190));let _0x41a3a2=extractScriptDescription(_0x14ee66);if(!_0x41a3a2&&_0x4fab64?.[_0x59ef0e(0x198)]){const _0x58a93f=await getBffScriptInfo(_0x4fab64[_0x59ef0e(0x198)]);_0x41a3a2=_0x58a93f[_0x59ef0e(0x1b6)]||undefined;}const _0x588a26={'appCode':_0x1d8e6f,'functionName':_0x41c967['name'],'scriptType':_0x41c967['type'],'scriptContent':_0x14ee66};if(_0x4fab64?.[_0x59ef0e(0x198)])_0x588a26['id']=_0x4fab64['remoteId'];if(_0x4fab64?.['version']!=null)_0x588a26[_0x59ef0e(0x1b4)]=_0x4fab64[_0x59ef0e(0x1b4)];if(_0x41a3a2)_0x588a26[_0x59ef0e(0x1b6)]=_0x41a3a2;if(_0x41c967[_0x59ef0e(0x18b)]==='HOOK'){const _0x44a1a3=_0x41c967[_0x59ef0e(0x18d)];if(!_0x44a1a3||!_0x41c967[_0x59ef0e(0x187)]||!_0x41c967[_0x59ef0e(0x1ae)])throw CliErrors[_0x59ef0e(0x1a8)]('Incomplete\x20HOOK\x20path:\x20'+_0x41c967[_0x59ef0e(0x193)]);const _0x3e136b=_0x2f1e7b[_0x59ef0e(0x1a2)]['get'](_0x44a1a3)??_0x4fab64?.[_0x59ef0e(0x1a0)]??_0x44a1a3,_0x278275=_0x2f1e7b[_0x59ef0e(0x176)]['get'](_0x3e136b);if(!_0x278275)throw CliErrors[_0x59ef0e(0x1a8)]('Cannot\x20resolve\x20dataset\x20for\x20\x22'+_0x44a1a3+_0x59ef0e(0x1bb)+('Run\x20`'+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.'));_0x588a26[_0x59ef0e(0x19a)]=_0x278275['id'],_0x588a26[_0x59ef0e(0x187)]=_0x41c967[_0x59ef0e(0x187)],_0x588a26['functionNode']=_0x41c967[_0x59ef0e(0x1ae)];}const _0x4d1ae4=await saveBffScript(_0x588a26),_0x55f384=_0x4d1ae4['id'],_0x2a1618=_0x4d1ae4[_0x59ef0e(0x1a3)]??await getBffScriptInfo(_0x55f384),_0xbd5c2d={'hash':_0x1bbfe1,'remoteId':_0x55f384,'version':_0x2a1618[_0x59ef0e(0x1b4)]};if(_0x41c967[_0x59ef0e(0x18b)]==='HOOK'){const _0x353cc5=_0x41c967[_0x59ef0e(0x18d)],_0x41d41d=_0x2f1e7b[_0x59ef0e(0x1a2)][_0x59ef0e(0x1b8)](_0x353cc5)??_0x4fab64?.['datasetCode']??_0x353cc5;_0x2f1e7b[_0x59ef0e(0x1a2)][_0x59ef0e(0x1ab)](_0x353cc5)?_0xbd5c2d['alias']=_0x353cc5:_0xbd5c2d[_0x59ef0e(0x18d)]=_0x4fab64?.['alias'],_0xbd5c2d['datasetCode']=_0x41d41d,_0xbd5c2d[_0x59ef0e(0x187)]=_0x41c967[_0x59ef0e(0x187)],_0xbd5c2d[_0x59ef0e(0x1ae)]=_0x41c967[_0x59ef0e(0x1ae)];}_0x323977[_0x59ef0e(0x178)][_0x41c967[_0x59ef0e(0x193)]]=_0xbd5c2d;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x1480d7,_0x26ff6c,_0x4152ba){const _0x2aa164=a37_0xe8d9c4;if(_0x4152ba['length']===0x0)return;for(let _0x1f7cca=0x0;_0x1f7cca<LOCK_SETTLE_RETRY_COUNT;_0x1f7cca+=0x1){const _0xb77961=await readBffLockFile(_0x1480d7),_0x3420ce=_0xb77961?.[_0x2aa164(0x186)]?.[_0x26ff6c]?.['functions']??{},_0x2ef154=_0x4152ba[_0x2aa164(0x17b)](_0x4b0465=>!!_0x3420ce[_0x4b0465]?.[_0x2aa164(0x198)]);if(_0x2ef154)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error('Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20'+_0x4152ba[_0x2aa164(0x1ad)](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a38_0x3453(_0x164498,_0x573cb7){_0x164498=_0x164498-0x94;const _0x3f2f95=a38_0x3f2f();let _0x345316=_0x3f2f95[_0x164498];return _0x345316;}const a38_0x5f15ff=a38_0x3453;(function(_0x4fa31e,_0x3787e8){const _0x450d7b=a38_0x3453,_0x3924a2=_0x4fa31e();while(!![]){try{const _0x271610=-parseInt(_0x450d7b(0xac))/0x1+parseInt(_0x450d7b(0xae))/0x2+-parseInt(_0x450d7b(0xa1))/0x3+-parseInt(_0x450d7b(0xaa))/0x4+parseInt(_0x450d7b(0xa2))/0x5+parseInt(_0x450d7b(0xa7))/0x6+parseInt(_0x450d7b(0x97))/0x7*(parseInt(_0x450d7b(0x9c))/0x8);if(_0x271610===_0x3787e8)break;else _0x3924a2['push'](_0x3924a2['shift']());}catch(_0x4debf6){_0x3924a2['push'](_0x3924a2['shift']());}}}(a38_0x3f2f,0x46e71));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';function a38_0x3f2f(){const _0x5b68fc=['983664YmeyYN','21655KVkgdb','alias','appCode','\x20remote-only','lockKey','1635840SQJUcM','boolean','datasetCode','549968bhbtFb','bool','536506DEJBmb','hash','393104dmGyOe','functions','length','\x20modified,\x20','lockFilePath','read','70SfZLnW','map','remote','apiDir','all','655024hkLUcj','bff','push','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','status'];a38_0x3f2f=function(){return _0x5b68fc;};return a38_0x3f2f();}import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a38_0x5f15ff(0x9d),'command':a38_0x5f15ff(0xa0),'description':'Check\x20local\x20Backend\x20Function\x20sync\x20status\x20against\x20lock\x20file','risk':a38_0x5f15ff(0x96),'flags':[{'name':a38_0x5f15ff(0x99),'type':a38_0x5f15ff(0xa8),'description':a38_0x5f15ff(0x9f)}],async 'execute'(_0x3fb5b8){const _0x2c63e5=a38_0x5f15ff,_0xd36b0=loadBffProjectConfig(_0x3fb5b8[_0x2c63e5(0xa4)]),_0x5d2d6a=await readBffLockFile(_0xd36b0[_0x2c63e5(0x95)]),{appLock:_0x29ae8f}=ensureLockScope(_0x5d2d6a??createEmptyBffLock(),_0x3fb5b8[_0x2c63e5(0xa4)],_0xd36b0['scriptsRoot'],_0x2c63e5(0xa0)),_0x5e5629=await scanLocalBffFunctions(_0xd36b0),_0xf7eec7=[],_0x975eea=[],_0x3f2daa=[];for(const _0x2c6fcd of _0x5e5629){const _0x6cfb32=await computeFileHash(_0x2c6fcd['filePath']),_0x27b44f=_0x29ae8f['functions'][_0x2c6fcd[_0x2c63e5(0xa6)]];if(!_0x27b44f)_0xf7eec7[_0x2c63e5(0x9e)](_0x2c6fcd['lockKey']);else _0x27b44f[_0x2c63e5(0xad)]!==_0x6cfb32?_0x975eea['push'](_0x2c6fcd['lockKey']):_0x3f2daa[_0x2c63e5(0x9e)](_0x2c6fcd[_0x2c63e5(0xa6)]);}const _0x3d424c=[];if(_0x3fb5b8[_0x2c63e5(0xab)](_0x2c63e5(0x99))){const _0x2079e4=loadAliasMap(_0x3fb5b8[_0x2c63e5(0x9a)],undefined,resolveApiFilePath(_0x3fb5b8[_0x2c63e5(0x9a)],_0x3fb5b8['appCode'])),_0xe18096=new Map(_0x2079e4['map'](_0x121984=>[_0x121984[_0x2c63e5(0xa9)],_0x121984[_0x2c63e5(0xa3)]])),[_0x8b0465,_0x2a38eb]=await Promise[_0x2c63e5(0x9b)]([listBffScripts(_0x3fb5b8[_0x2c63e5(0xa4)]),getBffScriptStatistics(_0x3fb5b8['appCode'])]),_0x573e6c=createHookLocationMap(_0x2a38eb),_0xb0ca44=new Set(_0x5e5629[_0x2c63e5(0x98)](_0x46ad88=>_0x46ad88['lockKey']));for(const _0x4d0331 of _0x8b0465){const _0xe6f810=resolveRemoteScriptTarget(_0xd36b0,_0x4d0331,_0x573e6c,_0x29ae8f[_0x2c63e5(0xaf)],_0xe18096);_0xe6f810&&!_0xb0ca44['has'](_0xe6f810[_0x2c63e5(0xa6)])&&_0x3d424c['push'](_0xe6f810['lockKey']);}}const _0x154b2b=_0xf7eec7[_0x2c63e5(0xb0)]===0x0&&_0x975eea[_0x2c63e5(0xb0)]===0x0&&_0x3d424c[_0x2c63e5(0xb0)]===0x0;return{'ok':!![],'data':{'added':_0xf7eec7,'modified':_0x975eea,'unchanged':_0x3f2daa,'remoteOnly':_0x3d424c},'message':_0x154b2b?'All\x20Backend\x20Function\x20scripts\x20are\x20in\x20sync.':_0xf7eec7[_0x2c63e5(0xb0)]+'\x20added,\x20'+_0x975eea['length']+_0x2c63e5(0x94)+_0x3f2daa['length']+'\x20unchanged'+(_0x3d424c[_0x2c63e5(0xb0)]>0x0?',\x20'+_0x3d424c[_0x2c63e5(0xb0)]+_0x2c63e5(0xa5):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5e7af5,_0x5ca588){const _0x3325a7=a39_0x4e2f,_0x108eff=_0x5e7af5();while(!![]){try{const _0x48943a=-parseInt(_0x3325a7(0xee))/0x1*(-parseInt(_0x3325a7(0xed))/0x2)+parseInt(_0x3325a7(0xde))/0x3+-parseInt(_0x3325a7(0xeb))/0x4*(parseInt(_0x3325a7(0xf1))/0x5)+parseInt(_0x3325a7(0xe6))/0x6+parseInt(_0x3325a7(0xe0))/0x7*(parseInt(_0x3325a7(0xea))/0x8)+-parseInt(_0x3325a7(0xe1))/0x9+-parseInt(_0x3325a7(0xe3))/0xa;if(_0x48943a===_0x5ca588)break;else _0x108eff['push'](_0x108eff['shift']());}catch(_0x2b4114){_0x108eff['push'](_0x108eff['shift']());}}}(a39_0x5abf,0x59662));function a39_0x4e2f(_0x42b1aa,_0x3b9189){_0x42b1aa=_0x42b1aa-0xd7;const _0x5abfb0=a39_0x5abf();let _0x4e2fd6=_0x5abfb0[_0x42b1aa];return _0x4e2fd6;}import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':'cli-skill','command':'install','description':'Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x55ee24){const _0x187430=a39_0x4e2f;logger[_0x187430(0xf2)](process[_0x187430(0xec)]()),logger[_0x187430(0xdf)]('cli-skill-install',_0x187430(0xdc));const _0x391b66=installBuiltinSkill({'stdio':_0x55ee24[_0x187430(0xe2)]?'pipe':_0x187430(0xdb)});if(!_0x391b66['ok'])throw CliErrors[_0x187430(0xd7)](_0x187430(0xdd)+_0x391b66['code']+']:\x20'+(_0x391b66[_0x187430(0xe5)]||'unknown'),_0x187430(0xd9)+_0x391b66[_0x187430(0xe9)]);return console[_0x187430(0xf0)](_0x391b66['changed']?'CLI\x20Built-in\x20Skill\x20'+_0x391b66[_0x187430(0xef)]+_0x187430(0xe4)+(_0x391b66[_0x187430(0xda)]?_0x187430(0xe7)+_0x391b66[_0x187430(0xda)]:'\x20via\x20skills@latest'):_0x187430(0xd8)+_0x391b66[_0x187430(0xef)]+_0x187430(0xe8)+(_0x391b66[_0x187430(0xda)]?_0x187430(0xe7)+_0x391b66['installedPath']:'')),{'ok':!![]};}}];function a39_0x5abf(){const _0x2fd663=['repairCommand','84880jPJaRI','342552BeQrcz','cwd','56vTaSIz','575JRWzDZ','skillVersion','log','25aogyHf','setLogPath','apiError','CLI\x20Built-in\x20Skill\x20','Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20','installedPath','inherit','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.','Built-in\x20Skill\x20install\x20failed\x20[','2018031AhgplI','info','287WTXYwW','1503342xYhasW','nonInteractive','4318970pKHzbl','\x20installed','error','1617096XsQpEE','\x20at\x20','\x20is\x20already\x20current'];a39_0x5abf=function(){return _0x2fd663;};return a39_0x5abf();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a40_0x26af69=a40_0x374e;(function(_0x164892,_0x3af0cf){const _0x8964aa=a40_0x374e,_0x2368e0=_0x164892();while(!![]){try{const _0x523a39=parseInt(_0x8964aa(0x1ef))/0x1*(-parseInt(_0x8964aa(0x20f))/0x2)+parseInt(_0x8964aa(0x1d1))/0x3+parseInt(_0x8964aa(0x1da))/0x4*(-parseInt(_0x8964aa(0x1d2))/0x5)+parseInt(_0x8964aa(0x1e1))/0x6+parseInt(_0x8964aa(0x1e6))/0x7+-parseInt(_0x8964aa(0x203))/0x8*(-parseInt(_0x8964aa(0x1e4))/0x9)+-parseInt(_0x8964aa(0x1ea))/0xa*(-parseInt(_0x8964aa(0x1f2))/0xb);if(_0x523a39===_0x3af0cf)break;else _0x2368e0['push'](_0x2368e0['shift']());}catch(_0x6e048d){_0x2368e0['push'](_0x2368e0['shift']());}}}(a40_0x5a4b,0xe7643));import a40_0x4671f4 from'chalk';import a40_0x4e55b3 from'ora';import a40_0x553b63 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_0x374e(_0x36cd54,_0x3ae2cb){_0x36cd54=_0x36cd54-0x1c1;const _0x5a4bd8=a40_0x5a4b();let _0x374e31=_0x5a4bd8[_0x36cd54];return _0x374e31;}import{inspectInstalledBuiltinSkillVersion,installBuiltinSkill}from'../skills/builtin-skill.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x207135=a40_0x374e;return GIT_COMMIT!==_0x207135(0x202)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x207135(0x1f3)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x132aea=a40_0x374e,_0x162d01=process[_0x132aea(0x1d4)][_0x132aea(0x201)]();if(_0x162d01['includes'](_0x132aea(0x1d7)))return _0x132aea(0x1d7);return _0x132aea(0x213);}const updateFlags=[{'name':a40_0x26af69(0x1c9),'type':'boolean','description':a40_0x26af69(0x1cc),'default':![]},{'name':a40_0x26af69(0x1ce),'type':'string','description':'Install\x20a\x20specific\x20CLI\x20version'}];function getRequestedVersion(_0x5e7b75){const _0x764842=a40_0x26af69;return _0x5e7b75[_0x764842(0x1d0)](_0x764842(0x1ce))[_0x764842(0x1eb)]();}async function validateUpdateFlags(_0x3f245e){const _0x2984e6=a40_0x26af69,_0xa47eeb=_0x3f245e[_0x2984e6(0x1e0)](_0x2984e6(0x1c9)),_0x49e1d0=getRequestedVersion(_0x3f245e);if(_0xa47eeb&&_0x49e1d0)throw CliErrors[_0x2984e6(0x1dd)](_0x2984e6(0x209),_0x2984e6(0x210));if(_0x49e1d0&&!a40_0x553b63[_0x2984e6(0x1c5)](_0x49e1d0))throw CliErrors['validation']('Invalid\x20version:\x20'+_0x49e1d0,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}async function fetchNpmDistTags(){const _0x6806ef=a40_0x26af69;try{const _0x31dd66=await fetch(_0x6806ef(0x1e9)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x6806ef(0x1fe),{'signal':AbortSignal[_0x6806ef(0x1c3)](0x2710)});if(!_0x31dd66['ok'])return null;const _0x134f31=await _0x31dd66[_0x6806ef(0x207)]();if(!_0x134f31||typeof _0x134f31!==_0x6806ef(0x211))return null;return Object[_0x6806ef(0x205)](Object[_0x6806ef(0x1d5)](_0x134f31)[_0x6806ef(0x1f6)](([,_0x36cc56])=>typeof _0x36cc56==='string'&&_0x36cc56[_0x6806ef(0x1eb)]()[_0x6806ef(0x208)]>0x0)['map'](([_0xcea7f8,_0x11cd01])=>[_0xcea7f8,String(_0x11cd01)[_0x6806ef(0x1eb)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x33454c){const _0x5a684d=await fetchNpmDistTags();return _0x5a684d?.[_0x33454c]??null;}async function fetchLatestVersion(){const _0x718f1a=a40_0x26af69;return fetchNpmDistTagVersion(_0x718f1a(0x20e));}async function resolveTargetVersion(_0x1bf362){const _0x5c4455=a40_0x26af69,_0x4ec0e5=getRequestedVersion(_0x1bf362);if(_0x4ec0e5)return{'version':_0x4ec0e5,'source':'version'};if(_0x1bf362['bool']('beta')){const _0x54de7e=await fetchNpmDistTagVersion(_0x5c4455(0x1c9));if(!_0x54de7e)return null;return{'version':_0x54de7e,'source':'beta'};}const _0x20ee0f=await fetchLatestVersion();if(!_0x20ee0f)return null;return{'version':_0x20ee0f,'source':_0x5c4455(0x20e)};}function a40_0x5a4b(){const _0x4bb934=['info','str','147615dafear','15CBErcN','skillVersion','execPath','entries',']:\x20','bun',',\x20then\x20verify\x20with:\x20','start','1953172GwmVPs',',\x20state\x20','green','validation','red','Updated\x20to\x20v','bool','5377476QDsNal','\x20doctor','@latest','18rrNIgU','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','8963703tcWpIr','CLI\x20updated\x20to\x20v','pipe','https://registry.npmjs.org/-/package/','10WUtIYg','trim','code','error','...','105WBzffb','Current\x20version:\x20','log','17536673ORANlv','slice','\x20→\x20','gray','filter','repairCommand','succeed','\x20\x20Try\x20manually:\x20','fail','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','state','run','/dist-tags','Beta\x20version:\x20','Requested\x20version:\x20','toLowerCase','unknown','1043960uNktoz','source','fromEntries','apiError','json','length','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','Update\x20failed','\x20is\x20newer\x20than\x20npm\x20latest\x20v','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','Version\x20comparison\x20failed','latest','31782ntFdfg','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','object','Run:\x20','npm','yellow','message',',\x20but\x20Built-in\x20Skill\x20verification\x20failed:\x20','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','timeout','\x20\x20CLI\x20Built-in\x20Skill\x20','valid','\x20is\x20up\x20to\x20date.','Checking\x20for\x20updates...','Already\x20up\x20to\x20date\x20(v','beta','expected\x20','Updating\x20via\x20','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','version'];a40_0x5a4b=function(){return _0x4bb934;};return a40_0x5a4b();}function shouldInstallTarget(_0x2c6107,_0x536c51){const _0xc5f254=a40_0x26af69;if(_0x536c51[_0xc5f254(0x204)]===_0xc5f254(0x1ce)||_0x536c51[_0xc5f254(0x204)]===_0xc5f254(0x1c9))return!a40_0x553b63['eq'](_0x2c6107,_0x536c51[_0xc5f254(0x1ce)]);return a40_0x553b63['lt'](_0x2c6107,_0x536c51[_0xc5f254(0x1ce)]);}function getInstallPlanLabel(_0x317f8b,_0x33dd87){const _0x2dae94=a40_0x26af69;switch(_0x33dd87[_0x2dae94(0x204)]){case _0x2dae94(0x1c9):return _0x2dae94(0x1ff)+a40_0x4671f4['yellow'](_0x317f8b)+'\x20→\x20'+a40_0x4671f4[_0x2dae94(0x1dc)](_0x33dd87['version']);case _0x2dae94(0x1ce):return _0x2dae94(0x200)+a40_0x4671f4[_0x2dae94(0x214)](_0x317f8b)+_0x2dae94(0x1f4)+a40_0x4671f4[_0x2dae94(0x1dc)](_0x33dd87['version']);case _0x2dae94(0x20e):default:return'Update\x20available:\x20'+a40_0x4671f4['yellow'](_0x317f8b)+_0x2dae94(0x1f4)+a40_0x4671f4['green'](_0x33dd87['version']);}}function repairCurrentBuiltinSkill(){const _0x483852=a40_0x26af69;console['log'](a40_0x4671f4[_0x483852(0x1f5)]('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x134c91=installBuiltinSkill();if(_0x134c91['ok']){console[_0x483852(0x1f1)](a40_0x4671f4['gray'](_0x483852(0x1c4)+_0x134c91[_0x483852(0x1d3)]+_0x483852(0x1c6)));return;}throw CliErrors[_0x483852(0x206)](_0x483852(0x1cd)+_0x134c91[_0x483852(0x1ec)]+_0x483852(0x1d6)+(_0x134c91[_0x483852(0x1ed)]||_0x483852(0x202)),'Run:\x20'+_0x134c91['repairCommand']+_0x483852(0x1d8)+CLI_BIN_NAME+_0x483852(0x1e2));}function verifyUpdatedBuiltinSkill(_0x39d4a7){const _0x320458=a40_0x26af69,_0x5847f2=inspectInstalledBuiltinSkillVersion(_0x39d4a7);if(_0x5847f2[_0x320458(0x1fc)]==='current'){console[_0x320458(0x1f1)](a40_0x4671f4[_0x320458(0x1f5)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x39d4a7+_0x320458(0x1c6)));return;}const _0x5dedc3=_0x5847f2['skillVersion']?_0x320458(0x1ca)+_0x39d4a7+',\x20found\x20'+_0x5847f2[_0x320458(0x1d3)]:_0x320458(0x1ca)+_0x39d4a7+_0x320458(0x1db)+_0x5847f2[_0x320458(0x1fc)];throw CliErrors[_0x320458(0x206)](_0x320458(0x1e7)+_0x39d4a7+_0x320458(0x1c1)+_0x5dedc3,_0x320458(0x212)+_0x5847f2[_0x320458(0x1f7)]+_0x320458(0x1d8)+CLI_BIN_NAME+_0x320458(0x1e2));}async function execute(_0x3d37d){const _0x347334=a40_0x26af69;await validateUpdateFlags(_0x3d37d);const _0x24096d=getCurrentVersion();console[_0x347334(0x1f1)](_0x347334(0x1f0)+_0x24096d);const _0x34b2f7=a40_0x4e55b3(_0x347334(0x1c7))[_0x347334(0x1d9)](),_0x4dfac3=await resolveTargetVersion(_0x3d37d);if(!_0x4dfac3){const _0x306587=_0x3d37d[_0x347334(0x1e0)](_0x347334(0x1c9))?_0x347334(0x1fb):_0x347334(0x1c2);return _0x34b2f7[_0x347334(0x1fa)](_0x306587),console[_0x347334(0x1f1)](a40_0x4671f4['gray'](_0x347334(0x20c)+NPM_PACKAGE_NAME+_0x347334(0x1e3))),{'ok':![],'message':_0x306587};}const _0x44c443=a40_0x553b63[_0x347334(0x1c5)](VERSION),_0x390359=a40_0x553b63[_0x347334(0x1c5)](_0x4dfac3[_0x347334(0x1ce)]);if(!_0x44c443||!_0x390359)return _0x34b2f7[_0x347334(0x1fa)](_0x347334(0x20d)),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0x44c443,_0x4dfac3)){const _0x476cde=_0x4dfac3[_0x347334(0x204)]===_0x347334(0x1ce)?'Already\x20on\x20requested\x20version\x20(v'+_0x4dfac3[_0x347334(0x1ce)]+')':a40_0x553b63['gt'](_0x44c443,_0x390359)?'Current\x20version\x20v'+_0x24096d+_0x347334(0x20b)+_0x4dfac3[_0x347334(0x1ce)]:_0x347334(0x1c8)+_0x4dfac3[_0x347334(0x1ce)]+')';return _0x34b2f7[_0x347334(0x1f8)](_0x476cde),repairCurrentBuiltinSkill(),{'ok':!![]};}_0x34b2f7[_0x347334(0x1cf)](getInstallPlanLabel(_0x24096d,_0x4dfac3));const _0x4e7493=detectPackageManager(),_0x330f4a=_0x4e7493===_0x347334(0x213)?resolveNpmBin(_0x347334(0x213)):_0x4e7493,_0x301a81=a40_0x4e55b3(_0x347334(0x1cb)+_0x4e7493+_0x347334(0x1ee))[_0x347334(0x1d9)]();try{await execa(_0x330f4a,['install','-g',NPM_PACKAGE_NAME+'@'+_0x4dfac3[_0x347334(0x1ce)]],{'stdio':_0x347334(0x1e8)}),_0x301a81[_0x347334(0x1f8)](_0x347334(0x1df)+_0x4dfac3[_0x347334(0x1ce)]),console[_0x347334(0x1f1)](a40_0x4671f4[_0x347334(0x1f5)]('\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.'));}catch(_0x24e22e){return _0x301a81[_0x347334(0x1fa)](_0x347334(0x20a)),console['error'](a40_0x4671f4[_0x347334(0x1de)]('\x20\x20'+_0x24e22e[_0x347334(0x215)])),console[_0x347334(0x1f1)](a40_0x4671f4[_0x347334(0x1f5)](_0x347334(0x1f9)+_0x4e7493+'\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@'+_0x4dfac3[_0x347334(0x1ce)])),{'ok':![],'message':_0x24e22e[_0x347334(0x215)]};}return verifyUpdatedBuiltinSkill(_0x4dfac3[_0x347334(0x1ce)]),{'ok':!![]};}export const updateDefinition={'service':'update','command':a40_0x26af69(0x1fd),'description':a40_0x26af69(0x1e5),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a40_0x599362=a40_0x3b3c;(function(_0x149f5b,_0x4f28ce){const _0x2bdaff=a40_0x3b3c,_0xea03f=_0x149f5b();while(!![]){try{const _0x29b58c=parseInt(_0x2bdaff(0x16d))/0x1+-parseInt(_0x2bdaff(0x16b))/0x2+-parseInt(_0x2bdaff(0x16e))/0x3*(parseInt(_0x2bdaff(0x163))/0x4)+parseInt(_0x2bdaff(0x120))/0x5+parseInt(_0x2bdaff(0x16c))/0x6*(-parseInt(_0x2bdaff(0x15e))/0x7)+-parseInt(_0x2bdaff(0x160))/0x8+parseInt(_0x2bdaff(0x12b))/0x9*(parseInt(_0x2bdaff(0x169))/0xa);if(_0x29b58c===_0x4f28ce)break;else _0xea03f['push'](_0xea03f['shift']());}catch(_0x56c444){_0xea03f['push'](_0xea03f['shift']());}}}(a40_0x2193,0x60e86));import a40_0x4b4472 from'chalk';function a40_0x2193(){const _0xd47ae7=['1120fRnWLg','state','2911624xTmFut','green','string','128EqUMqY','\x20→\x20','Update\x20available:\x20','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','Already\x20on\x20requested\x20version\x20(v','boolean','5150njYFPP','...','221734QgHBbx','1842kvAveJ','268019jrwKmY','11499xcZBMT','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','\x20is\x20up\x20to\x20date.',',\x20then\x20verify\x20with:\x20','entries','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','read','yellow','str','3720480tPgSYV','Current\x20version\x20v','length','trim','Updated\x20to\x20v','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','start',']:\x20','\x20is\x20newer\x20than\x20npm\x20latest\x20v','expected\x20','549zhEfJJ','info','Install\x20a\x20specific\x20CLI\x20version','filter','run','latest','https://registry.npmjs.org/-/package/','Beta\x20version:\x20','Version\x20comparison\x20failed','install','bool','execPath',',\x20state\x20','pipe','fromEntries','\x20\x20Try\x20manually:\x20','npm','current','succeed','includes','toLowerCase','Checking\x20CLI\x20Built-in\x20Skill...','beta',',\x20but\x20Built-in\x20Skill\x20verification\x20failed:\x20','slice','red','\x20doctor','bun','object','Requested\x20version:\x20','\x20\x20CLI\x20Built-in\x20Skill\x20','repairCommand','skillVersion','source','error','Run:\x20','CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','apiError','gray','Updating\x20via\x20',',\x20found\x20','valid','/dist-tags','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','code','Current\x20version:\x20','fail','version','validation','message','log'];a40_0x2193=function(){return _0xd47ae7;};return a40_0x2193();}import a40_0x5ab40d from'ora';import a40_0x167437 from'semver';import{execa}from'execa';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{inspectInstalledBuiltinSkillVersion,installBuiltinSkill}from'../skills/builtin-skill.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0xaa9259=a40_0x3b3c;return GIT_COMMIT!=='unknown'?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0xaa9259(0x143)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x42b2d5=a40_0x3b3c,_0x2166c=process[_0x42b2d5(0x136)][_0x42b2d5(0x13f)]();if(_0x2166c[_0x42b2d5(0x13e)](_0x42b2d5(0x146)))return _0x42b2d5(0x146);return _0x42b2d5(0x13b);}const updateFlags=[{'name':a40_0x599362(0x141),'type':a40_0x599362(0x168),'description':a40_0x599362(0x118),'default':![]},{'name':a40_0x599362(0x15a),'type':a40_0x599362(0x162),'description':a40_0x599362(0x12d)}];function getRequestedVersion(_0x256f3c){const _0x272256=a40_0x599362;return _0x256f3c[_0x272256(0x11f)](_0x272256(0x15a))[_0x272256(0x123)]();}async function validateUpdateFlags(_0x3e7794){const _0x418aae=a40_0x599362,_0x2e612c=_0x3e7794[_0x418aae(0x135)]('beta'),_0x15454f=getRequestedVersion(_0x3e7794);if(_0x2e612c&&_0x15454f)throw CliErrors[_0x418aae(0x15b)](_0x418aae(0x166),'Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.');if(_0x15454f&&!a40_0x167437[_0x418aae(0x154)](_0x15454f))throw CliErrors['validation']('Invalid\x20version:\x20'+_0x15454f,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}async function fetchNpmDistTags(){const _0x55bdc0=a40_0x599362;try{const _0x42c605=await fetch(_0x55bdc0(0x131)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x55bdc0(0x155),{'signal':AbortSignal['timeout'](0x2710)});if(!_0x42c605['ok'])return null;const _0x31cc5e=await _0x42c605['json']();if(!_0x31cc5e||typeof _0x31cc5e!==_0x55bdc0(0x147))return null;return Object[_0x55bdc0(0x139)](Object[_0x55bdc0(0x11b)](_0x31cc5e)[_0x55bdc0(0x12e)](([,_0x447c8c])=>typeof _0x447c8c==='string'&&_0x447c8c['trim']()[_0x55bdc0(0x122)]>0x0)['map'](([_0xc76a8,_0x143df7])=>[_0xc76a8,String(_0x143df7)['trim']()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x22ba4e){const _0x43859d=await fetchNpmDistTags();return _0x43859d?.[_0x22ba4e]??null;}async function fetchLatestVersion(){return fetchNpmDistTagVersion('latest');}async function resolveTargetVersion(_0x5b3711){const _0x308c93=a40_0x599362,_0x1c060f=getRequestedVersion(_0x5b3711);if(_0x1c060f)return{'version':_0x1c060f,'source':'version'};if(_0x5b3711[_0x308c93(0x135)]('beta')){const _0x31224a=await fetchNpmDistTagVersion(_0x308c93(0x141));if(!_0x31224a)return null;return{'version':_0x31224a,'source':_0x308c93(0x141)};}const _0x27fd20=await fetchLatestVersion();if(!_0x27fd20)return null;return{'version':_0x27fd20,'source':_0x308c93(0x130)};}function shouldInstallTarget(_0x3df9fe,_0x17bb25){const _0x501b=a40_0x599362;if(_0x17bb25[_0x501b(0x14c)]===_0x501b(0x15a)||_0x17bb25[_0x501b(0x14c)]==='beta')return!a40_0x167437['eq'](_0x3df9fe,_0x17bb25['version']);return a40_0x167437['lt'](_0x3df9fe,_0x17bb25[_0x501b(0x15a)]);}function getInstallPlanLabel(_0x40256e,_0x3efa19){const _0x3edffb=a40_0x599362;switch(_0x3efa19[_0x3edffb(0x14c)]){case _0x3edffb(0x141):return _0x3edffb(0x132)+a40_0x4b4472[_0x3edffb(0x11e)](_0x40256e)+_0x3edffb(0x164)+a40_0x4b4472['green'](_0x3efa19['version']);case _0x3edffb(0x15a):return _0x3edffb(0x148)+a40_0x4b4472[_0x3edffb(0x11e)](_0x40256e)+_0x3edffb(0x164)+a40_0x4b4472[_0x3edffb(0x161)](_0x3efa19['version']);case _0x3edffb(0x130):default:return _0x3edffb(0x165)+a40_0x4b4472[_0x3edffb(0x11e)](_0x40256e)+_0x3edffb(0x164)+a40_0x4b4472[_0x3edffb(0x161)](_0x3efa19['version']);}}function repairCurrentBuiltinSkill(){const _0x3f18e1=a40_0x599362;console[_0x3f18e1(0x15d)](a40_0x4b4472[_0x3f18e1(0x151)](_0x3f18e1(0x140)));const _0x5caca4=installBuiltinSkill();if(_0x5caca4['ok']){console['log'](a40_0x4b4472['gray'](_0x3f18e1(0x149)+_0x5caca4[_0x3f18e1(0x14b)]+'\x20is\x20up\x20to\x20date.'));return;}throw CliErrors['apiError'](_0x3f18e1(0x14f)+_0x5caca4[_0x3f18e1(0x157)]+_0x3f18e1(0x128)+(_0x5caca4['error']||'unknown'),_0x3f18e1(0x14e)+_0x5caca4['repairCommand']+_0x3f18e1(0x11a)+CLI_BIN_NAME+_0x3f18e1(0x145));}function verifyUpdatedBuiltinSkill(_0x48cfdd){const _0x1e56f4=a40_0x599362,_0x4b5a9e=inspectInstalledBuiltinSkillVersion(_0x48cfdd);if(_0x4b5a9e[_0x1e56f4(0x15f)]===_0x1e56f4(0x13c)){console[_0x1e56f4(0x15d)](a40_0x4b4472[_0x1e56f4(0x151)](_0x1e56f4(0x149)+_0x48cfdd+_0x1e56f4(0x119)));return;}const _0x22f4c7=_0x4b5a9e[_0x1e56f4(0x14b)]?_0x1e56f4(0x12a)+_0x48cfdd+_0x1e56f4(0x153)+_0x4b5a9e[_0x1e56f4(0x14b)]:_0x1e56f4(0x12a)+_0x48cfdd+_0x1e56f4(0x137)+_0x4b5a9e[_0x1e56f4(0x15f)];throw CliErrors[_0x1e56f4(0x150)]('CLI\x20updated\x20to\x20v'+_0x48cfdd+_0x1e56f4(0x142)+_0x22f4c7,'Run:\x20'+_0x4b5a9e[_0x1e56f4(0x14a)]+_0x1e56f4(0x11a)+CLI_BIN_NAME+_0x1e56f4(0x145));}function a40_0x3b3c(_0x3fbce9,_0x41e79c){_0x3fbce9=_0x3fbce9-0x118;const _0x219321=a40_0x2193();let _0x3b3c04=_0x219321[_0x3fbce9];return _0x3b3c04;}async function execute(_0x27d9e6){const _0x57d509=a40_0x599362;await validateUpdateFlags(_0x27d9e6);const _0x4eb685=getCurrentVersion();console[_0x57d509(0x15d)](_0x57d509(0x158)+_0x4eb685);const _0x525481=a40_0x5ab40d('Checking\x20for\x20updates...')[_0x57d509(0x127)](),_0x2e0846=await resolveTargetVersion(_0x27d9e6);if(!_0x2e0846){const _0x41c36d=_0x27d9e6['bool'](_0x57d509(0x141))?_0x57d509(0x126):_0x57d509(0x11c);return _0x525481[_0x57d509(0x159)](_0x41c36d),console[_0x57d509(0x15d)](a40_0x4b4472[_0x57d509(0x151)]('\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x41c36d};}const _0x3e0a30=a40_0x167437[_0x57d509(0x154)](VERSION),_0x3ee520=a40_0x167437[_0x57d509(0x154)](_0x2e0846[_0x57d509(0x15a)]);if(!_0x3e0a30||!_0x3ee520)return _0x525481['fail'](_0x57d509(0x133)),{'ok':![],'message':_0x57d509(0x133)};if(!shouldInstallTarget(_0x3e0a30,_0x2e0846)){const _0x978350=_0x2e0846['source']===_0x57d509(0x15a)?_0x57d509(0x167)+_0x2e0846[_0x57d509(0x15a)]+')':a40_0x167437['gt'](_0x3e0a30,_0x3ee520)?_0x57d509(0x121)+_0x4eb685+_0x57d509(0x129)+_0x2e0846[_0x57d509(0x15a)]:'Already\x20up\x20to\x20date\x20(v'+_0x2e0846[_0x57d509(0x15a)]+')';return _0x525481[_0x57d509(0x13d)](_0x978350),repairCurrentBuiltinSkill(),{'ok':!![]};}_0x525481[_0x57d509(0x12c)](getInstallPlanLabel(_0x4eb685,_0x2e0846));const _0x2da2c7=detectPackageManager(),_0x2c8871=_0x2da2c7==='npm'?resolveNpmBin(_0x57d509(0x13b)):_0x2da2c7,_0x232e2c=a40_0x5ab40d(_0x57d509(0x152)+_0x2da2c7+_0x57d509(0x16a))[_0x57d509(0x127)]();try{await execa(_0x2c8871,[_0x57d509(0x134),'-g',NPM_PACKAGE_NAME+'@'+_0x2e0846[_0x57d509(0x15a)]],{'stdio':_0x57d509(0x138)}),_0x232e2c[_0x57d509(0x13d)](_0x57d509(0x124)+_0x2e0846[_0x57d509(0x15a)]),console[_0x57d509(0x15d)](a40_0x4b4472['gray'](_0x57d509(0x125)));}catch(_0x295dec){return _0x232e2c[_0x57d509(0x159)]('Update\x20failed'),console[_0x57d509(0x14d)](a40_0x4b4472[_0x57d509(0x144)]('\x20\x20'+_0x295dec[_0x57d509(0x15c)])),console['log'](a40_0x4b4472[_0x57d509(0x151)](_0x57d509(0x13a)+_0x2da2c7+'\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@'+_0x2e0846['version'])),{'ok':![],'message':_0x295dec['message']};}return verifyUpdatedBuiltinSkill(_0x2e0846[_0x57d509(0x15a)]),{'ok':!![]};}export const updateDefinition={'service':'update','command':a40_0x599362(0x12f),'description':a40_0x599362(0x156),'risk':a40_0x599362(0x11d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x123fee,_0x38f2af){const _0x441ad9=a41_0x5cfc,_0xd1a151=_0x123fee();while(!![]){try{const _0x2cf995=parseInt(_0x441ad9(0x19c))/0x1+-parseInt(_0x441ad9(0x19f))/0x2*(-parseInt(_0x441ad9(0x1a1))/0x3)+parseInt(_0x441ad9(0x1a0))/0x4+-parseInt(_0x441ad9(0x19a))/0x5*(parseInt(_0x441ad9(0x19b))/0x6)+parseInt(_0x441ad9(0x19e))/0x7+parseInt(_0x441ad9(0x1a2))/0x8+-parseInt(_0x441ad9(0x19d))/0x9;if(_0x2cf995===_0x38f2af)break;else _0xd1a151['push'](_0xd1a151['shift']());}catch(_0xa8b57){_0xd1a151['push'](_0xd1a151['shift']());}}}(a41_0x436c,0x78b0e));function a41_0x5cfc(_0x21c46d,_0x310e63){_0x21c46d=_0x21c46d-0x19a;const _0x436cc1=a41_0x436c();let _0x5cfcc5=_0x436cc1[_0x21c46d];return _0x5cfcc5;}import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];function a41_0x436c(){const _0x54f88b=['4100832PRUOXu','2665YhrMjs','2964KzslcQ','559287uUroeu','13447548RTUfFx','1363341eSDQVm','13982VOLucL','2290804HKxvaV','177kropvM'];a41_0x436c=function(){return _0x54f88b;};return a41_0x436c();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x913d8e=a42_0x3bea;(function(_0x588410,_0x3ceea7){const _0x1900ac=a42_0x3bea,_0x40eb29=_0x588410();while(!![]){try{const _0x642b1f=-parseInt(_0x1900ac(0x178))/0x1*(parseInt(_0x1900ac(0x17b))/0x2)+-parseInt(_0x1900ac(0x184))/0x3*(parseInt(_0x1900ac(0x177))/0x4)+parseInt(_0x1900ac(0x182))/0x5*(parseInt(_0x1900ac(0x17c))/0x6)+-parseInt(_0x1900ac(0x176))/0x7*(parseInt(_0x1900ac(0x180))/0x8)+-parseInt(_0x1900ac(0x172))/0x9+parseInt(_0x1900ac(0x170))/0xa+parseInt(_0x1900ac(0x171))/0xb;if(_0x642b1f===_0x3ceea7)break;else _0x40eb29['push'](_0x40eb29['shift']());}catch(_0x4c87dc){_0x40eb29['push'](_0x40eb29['shift']());}}}(a42_0x4838,0x591d1));function a42_0x3bea(_0x4a9f5c,_0x510a2f){_0x4a9f5c=_0x4a9f5c-0x170;const _0x483838=a42_0x4838();let _0x3bea05=_0x483838[_0x4a9f5c];return _0x3bea05;}import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a42_0x4838(){const _0x487b1a=['tableName','229514kUXKeZ','234zIsIiS','operation','bool','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','1072tobImO','codegen','84375XdeRzy','code','2106477zsdFyF','sdk','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','boolean','appCode','6076900jZTSSm','3678345joXwar','557811aGTFut','str','Omit\x20import\x20statements\x20from\x20generated\x20code','string','18613BeqIba','4JMkonu','1eWMNNA','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation'];a42_0x4838=function(){return _0x487b1a;};return a42_0x4838();}export const codegenSdk={'service':a42_0x913d8e(0x181),'command':a42_0x913d8e(0x185),'description':a42_0x913d8e(0x179),'risk':'read','flags':[CODE_FLAG_OPTIONAL,{'name':'alias','type':a42_0x913d8e(0x175),'description':a42_0x913d8e(0x186)},{'name':a42_0x913d8e(0x17d),'type':'string','required':!![],'description':a42_0x913d8e(0x17f)},{'name':'skip-imports','type':a42_0x913d8e(0x187),'description':a42_0x913d8e(0x174)}],async 'execute'(_0x5e9143){const _0x31ef80=a42_0x913d8e,{dataset:_0x1b0b63,operation:_0x41ca0f}=await getOperationDetail(_0x5e9143[_0x31ef80(0x188)],_0x5e9143['str']('code'),_0x5e9143[_0x31ef80(0x173)](_0x31ef80(0x17d))),_0x59e3f1=generateSdkCode(_0x1b0b63,_0x41ca0f,{'includeImports':!_0x5e9143[_0x31ef80(0x17e)]('skip-imports')});return{'ok':!![],'data':{'dataset':{'name':_0x1b0b63['name'],'code':_0x1b0b63[_0x31ef80(0x183)],'tableName':_0x1b0b63[_0x31ef80(0x17a)]},'operation':_0x5e9143[_0x31ef80(0x173)]('operation'),'code':_0x59e3f1}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x8b53d4=a43_0x2b9f;(function(_0x8293db,_0x3cc5d3){const _0x1c89a0=a43_0x2b9f,_0x541861=_0x8293db();while(!![]){try{const _0x4e8b37=-parseInt(_0x1c89a0(0x1ce))/0x1+parseInt(_0x1c89a0(0x1d3))/0x2*(-parseInt(_0x1c89a0(0x1e0))/0x3)+parseInt(_0x1c89a0(0x1d7))/0x4*(-parseInt(_0x1c89a0(0x1d1))/0x5)+-parseInt(_0x1c89a0(0x1cd))/0x6+-parseInt(_0x1c89a0(0x1e1))/0x7+parseInt(_0x1c89a0(0x1cc))/0x8*(-parseInt(_0x1c89a0(0x1cf))/0x9)+parseInt(_0x1c89a0(0x1e2))/0xa*(parseInt(_0x1c89a0(0x1d6))/0xb);if(_0x4e8b37===_0x3cc5d3)break;else _0x541861['push'](_0x541861['shift']());}catch(_0xf8267f){_0x541861['push'](_0x541861['shift']());}}}(a43_0x28fa,0xcb611));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a43_0x2b9f(_0x30fc8e,_0x2c8237){_0x30fc8e=_0x30fc8e-0x1cb;const _0x28fa54=a43_0x28fa();let _0x2b9f93=_0x28fa54[_0x30fc8e];return _0x2b9f93;}export const codegenSql={'service':a43_0x8b53d4(0x1e4),'command':a43_0x8b53d4(0x1db),'description':a43_0x8b53d4(0x1da),'risk':'read','flags':[SQLCODE_FLAG,{'name':'target','type':a43_0x8b53d4(0x1df),'description':a43_0x8b53d4(0x1dc),'default':'sdk','enum':[a43_0x8b53d4(0x1d5),a43_0x8b53d4(0x1d2)]},{'name':a43_0x8b53d4(0x1e3),'type':a43_0x8b53d4(0x1d4),'description':a43_0x8b53d4(0x1d0)}],async 'execute'(_0x588649){const _0x952231=a43_0x8b53d4,_0x1d25c9=await getSqlQueryInfo(_0x588649[_0x952231(0x1e5)],_0x588649['str'](_0x952231(0x1cb))),_0x16b035=_0x588649['str'](_0x952231(0x1d8))||_0x952231(0x1d5),_0x396cf7=generateSqlCodeTemplate(_0x1d25c9,{'target':_0x16b035,'includeImports':!_0x588649[_0x952231(0x1de)](_0x952231(0x1e3))});return{'ok':!![],'data':{'sqlCode':_0x1d25c9[_0x952231(0x1d9)],'sqlName':_0x1d25c9[_0x952231(0x1dd)],'target':_0x16b035,'code':_0x396cf7}};}};function a43_0x28fa(){const _0x1889f9=['sqlName','bool','string','175290RLdJTr','4276475EFxazs','130KowfgO','no-imports','codegen','appCode','sqlcode','824264lmwsTw','7679718DMhaKO','862331NFHTLQ','117LplRbr','Omit\x20import\x20statements\x20from\x20generated\x20code','5qrhjUq','bff','2DdThHU','boolean','sdk','4648501pBxpaa','2038296WnNiGs','target','sqlCode','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','sql','Code\x20target:\x20sdk\x20(default)\x20or\x20bff'];a43_0x28fa=function(){return _0x1889f9;};return a43_0x28fa();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x52e704,_0x4fa89e){const _0x1d27c4=a44_0x1634,_0x5a2658=_0x52e704();while(!![]){try{const _0x256c62=parseInt(_0x1d27c4(0x190))/0x1+-parseInt(_0x1d27c4(0x184))/0x2+-parseInt(_0x1d27c4(0x180))/0x3*(-parseInt(_0x1d27c4(0x170))/0x4)+parseInt(_0x1d27c4(0x186))/0x5+-parseInt(_0x1d27c4(0x178))/0x6*(-parseInt(_0x1d27c4(0x18f))/0x7)+-parseInt(_0x1d27c4(0x179))/0x8*(-parseInt(_0x1d27c4(0x169))/0x9)+-parseInt(_0x1d27c4(0x189))/0xa*(parseInt(_0x1d27c4(0x187))/0xb);if(_0x256c62===_0x4fa89e)break;else _0x5a2658['push'](_0x5a2658['shift']());}catch(_0x806e56){_0x5a2658['push'](_0x5a2658['shift']());}}}(a44_0x5a56,0x543b1));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_0x5a56(){const _0x5b3907=['Updated','7kZDaki','24761JoRcAu','Missing\x20app\x20name.','args','trim','App\x20\x22','\x20Note:\x20app\x20\x22','\x22\x20still\x20defined\x20in\x20','45TkehQO','App\x20code','\x20Default\x20app\x20is\x20\x22','\x20Default\x20app\x20changed\x20to\x20\x22','Use\x20global\x20config\x20scope','\x20<name>\x20--appcode\x20<code>','length','232RHoKAl','validation','appcode','\x20<name>','global','\x22\x20not\x20found.','bool','defaultApp','1941054SfIUuY','552664cifbDu','projectConfig','project','Usage:\x20','object','boolean','\x22\x20is\x20selected\x20automatically.','8469Obodhi','Removed\x20app\x20\x22','keys','string','453644RRZoew','apps','3422845OvSScw','10671727soNByQ','str','10CGMuRJ','\x22\x20(appcode:\x20','flagMissing','\x20Remaining\x20app\x20\x22','\x20config.'];a44_0x5a56=function(){return _0x5b3907;};return a44_0x5a56();}function a44_0x1634(_0x3bc86c,_0x21833c){_0x3bc86c=_0x3bc86c-0x163;const _0x5a5623=a44_0x5a56();let _0x1634eb=_0x5a5623[_0x3bc86c];return _0x1634eb;}export function buildAppAddFlags(){const _0x5f04bc=a44_0x1634;return[{'name':_0x5f04bc(0x172),'type':'string','description':_0x5f04bc(0x16a),'required':!![]},{'name':'global','type':_0x5f04bc(0x17e),'description':'Use\x20global\x20config\x20scope','default':![]},...getAppProfileFlagDefs()];}export function buildAppRemoveFlags(){const _0x49ba8e=a44_0x1634;return[{'name':'global','type':'boolean','description':_0x49ba8e(0x16d),'default':![]}];}export async function validateAppName(_0x4e08c4,_0x36df0d){const _0x33d052=a44_0x1634,_0x166e99=_0x4e08c4[_0x33d052(0x164)][0x0]?.['trim']();if(!_0x166e99)throw CliErrors[_0x33d052(0x171)]('Missing\x20app\x20name.',_0x33d052(0x17c)+CLI_BIN_NAME+'\x20'+_0x36df0d+_0x33d052(0x173));}export async function runAppAdd(_0x5ef4ef,_0x3604f5){const _0xb91080=a44_0x1634,_0x2970e5=_0x5ef4ef['args'][0x0]?.[_0xb91080(0x165)]();if(!_0x2970e5)throw CliErrors['validation'](_0xb91080(0x163),_0xb91080(0x17c)+CLI_BIN_NAME+'\x20'+_0x3604f5+_0xb91080(0x16e));const _0x4aea75=_0x5ef4ef[_0xb91080(0x188)](_0xb91080(0x172));if(!_0x4aea75)throw CliErrors[_0xb91080(0x18b)](_0xb91080(0x172),_0xb91080(0x17c)+CLI_BIN_NAME+'\x20'+_0x3604f5+_0xb91080(0x16e));const _0x131834={'global':_0x5ef4ef[_0xb91080(0x176)]('global')},_0x4a3181=readConfig(_0x131834);if(!_0x4a3181[_0xb91080(0x185)])_0x4a3181[_0xb91080(0x185)]={};const _0x3063f4={'appcode':_0x4aea75,...collectAppProfileOverrides(_0x1b2bca=>_0x5ef4ef['str'](_0x1b2bca))},_0x4b9667=_0x4a3181[_0xb91080(0x185)],_0x41788c=Object[_0xb91080(0x182)](_0x4b9667),_0x29a852=typeof _0x4a3181[_0xb91080(0x177)]===_0xb91080(0x183)&&_0x4b9667[_0x4a3181[_0xb91080(0x177)]]?_0x4a3181[_0xb91080(0x177)]:_0x41788c[_0xb91080(0x16f)]===0x1?_0x41788c[0x0]:undefined,_0x5a3769=!!_0x4b9667[_0x2970e5];_0x4b9667[_0x2970e5]=_0x3063f4;const _0x41e6e8=normalizeStoredDefaultApp(_0x4a3181,_0x29a852);writeConfig(_0x4a3181,_0x131834);const _0x55c333=!_0x5a3769&&_0x41e6e8?_0xb91080(0x16b)+_0x41e6e8+'\x22.':'',_0x4b9182=(_0x5a3769?_0xb91080(0x18e):'Added')+'\x20app\x20\x22'+_0x2970e5+_0xb91080(0x18a)+_0x4aea75+')'+scopeLabel(_0x131834)+'.'+_0x55c333;return{'ok':!![],'message':_0x4b9182};}export async function runAppRemove(_0x44b31,_0x1c7315){const _0x181400=a44_0x1634,_0x589966=_0x44b31['args'][0x0]?.[_0x181400(0x165)]();if(!_0x589966)throw CliErrors[_0x181400(0x171)]('Missing\x20app\x20name.',_0x181400(0x17c)+CLI_BIN_NAME+'\x20'+_0x1c7315+'\x20<name>\x20[--global]');const _0x4344a0=_0x44b31[_0x181400(0x176)]('global'),{config:_0x216a93,layers:_0x4d1d24}=readRawConfigWithLayers(),_0x2f5da5=_0x216a93[_0x181400(0x185)]??{};if(!_0x2f5da5[_0x589966])throw CliErrors['validation']('App\x20\x22'+_0x589966+_0x181400(0x175));const _0x30d6df=_0x4d1d24['globalConfig'][_0x181400(0x185)]&&typeof _0x4d1d24['globalConfig']['apps']==='object'?_0x4d1d24['globalConfig'][_0x181400(0x185)]:{},_0x449dea=_0x4d1d24[_0x181400(0x17a)][_0x181400(0x185)]&&typeof _0x4d1d24[_0x181400(0x17a)][_0x181400(0x185)]===_0x181400(0x17d)?_0x4d1d24['projectConfig'][_0x181400(0x185)]:{},_0x27b4bc=appDefinedIn(_0x589966,_0x30d6df,_0x449dea),_0x9c518d=resolveAppScopeForWrite(_0x589966,_0x4344a0,_0x4d1d24),_0x4db5d0={'global':_0x9c518d===_0x181400(0x174)},_0x3e6356=readConfig(_0x4db5d0),_0x21e753=_0x3e6356[_0x181400(0x185)];if(!_0x21e753||!_0x21e753[_0x589966])throw CliErrors[_0x181400(0x171)](_0x181400(0x166)+_0x589966+_0x181400(0x175));delete _0x21e753[_0x589966];let _0x383ee6='';const _0x1cc5d6=typeof _0x3e6356[_0x181400(0x177)]===_0x181400(0x183)?_0x3e6356['defaultApp']:undefined,_0x23cae5=Object['keys'](_0x21e753),_0x2ee6d8=_0x1cc5d6===_0x589966?_0x23cae5[0x0]:_0x1cc5d6,_0x4bfa3f=normalizeStoredDefaultApp(_0x3e6356,_0x2ee6d8);if(_0x1cc5d6===_0x589966&&_0x23cae5[_0x181400(0x16f)]===0x1)_0x383ee6=_0x181400(0x18c)+_0x23cae5[0x0]+_0x181400(0x17f);else _0x1cc5d6===_0x589966&&_0x4bfa3f&&(_0x383ee6=_0x181400(0x16c)+_0x4bfa3f+'\x22.');Object[_0x181400(0x182)](_0x21e753)[_0x181400(0x16f)]===0x0&&(delete _0x3e6356[_0x181400(0x185)],delete _0x3e6356['defaultApp']);writeConfig(_0x3e6356,_0x4db5d0);const _0x2f61e2=_0x27b4bc==='both'?_0x181400(0x167)+_0x589966+_0x181400(0x168)+(_0x9c518d===_0x181400(0x17b)?_0x181400(0x174):_0x181400(0x17b))+_0x181400(0x18d):'';return{'ok':!![],'message':_0x181400(0x181)+_0x589966+'\x22'+scopeLabel(_0x4db5d0)+'.'+_0x383ee6+_0x2f61e2};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a45_0x4747(){const _0x4996a1=['yellow','✎\x20Enter\x20appcode\x20manually','8186650ztBNhC','\x20\x20(','5584472aOztWr','find','9596iGhzVY','Found\x20','(Skip;\x20configure\x20later)','3953404cOJJbj','appName','message','appCode','97XyDATA','No\x20available\x20apps\x20found.','11984896IebPFe','4724406jmayBg','gray','(Skip;\x20configure\x20later\x20with\x20config\x20set\x20appcode)','3480875rsxxWi','12cyLclw','Could\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.','\x0aCould\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.','✎\x20Enter\x20manually','(No\x20login\x20session.\x20Enter\x20an\x20App\x20Code\x20manually\x20or\x20skip.)','cyan','map','9fVvXAg','includes','Fetching\x20available\x20apps...','skip','trim','\x0aNo\x20available\x20apps\x20found.','\x20apps.\x20Select\x20with\x20space,\x20a=all,\x20i=invert:','length','App\x20Code:','Select\x20the\x20app\x20to\x20bind:','custom','manual'];a45_0x4747=function(){return _0x4996a1;};return a45_0x4747();}(function(_0x251b10,_0x3548c0){const _0x2ab9d6=a45_0x2c3d,_0x10a5f6=_0x251b10();while(!![]){try{const _0x36b078=-parseInt(_0x2ab9d6(0x104))/0x1*(parseInt(_0x2ab9d6(0xfd))/0x2)+parseInt(_0x2ab9d6(0x107))/0x3+-parseInt(_0x2ab9d6(0xfb))/0x4+-parseInt(_0x2ab9d6(0x10a))/0x5+parseInt(_0x2ab9d6(0xe4))/0x6*(parseInt(_0x2ab9d6(0x100))/0x7)+parseInt(_0x2ab9d6(0x106))/0x8+parseInt(_0x2ab9d6(0xeb))/0x9*(-parseInt(_0x2ab9d6(0xf9))/0xa);if(_0x36b078===_0x3548c0)break;else _0x10a5f6['push'](_0x10a5f6['shift']());}catch(_0x27b4a6){_0x10a5f6['push'](_0x10a5f6['shift']());}}}(a45_0x4747,0xc9aee));import{input,checkbox,select}from'@inquirer/prompts';import a45_0xa6f5e9 from'chalk';import{validateAppcode}from'../../commands/common/validate.js';import{listRemoteApps}from'../../core/api-client.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';export async function promptCustomAppcode(){const _0x5e1bbf=a45_0x2c3d,_0x13f172=await input({'message':'App\x20Code:','validate':_0x81dc4f=>{const _0xdb9817=a45_0x2c3d,_0x31c9db=validateAppcode(_0x81dc4f['trim']());return _0x31c9db['valid']||_0x31c9db[_0xdb9817(0x102)]||'Invalid\x20App\x20Code';}});return _0x13f172[_0x5e1bbf(0xef)]();}export async function promptAppSelection(_0x10bd4e){const _0x13185e=a45_0x2c3d,_0x76fcc2=[{'name':a45_0xa6f5e9[_0x13185e(0xf7)](_0x13185e(0xf8)),'value':-0x1},..._0x10bd4e[_0x13185e(0xea)]((_0x8f0f21,_0x449811)=>({'name':_0x8f0f21[_0x13185e(0x101)]+'\x20\x20'+a45_0xa6f5e9['gray']('('+_0x8f0f21['appCode']+')'),'value':_0x449811}))],_0x4d8db3=await checkbox({'message':_0x13185e(0xfe)+a45_0xa6f5e9[_0x13185e(0xe9)](_0x10bd4e[_0x13185e(0xf2)])+_0x13185e(0xf1),'choices':_0x76fcc2,'loop':![]});if(_0x4d8db3[_0x13185e(0xec)](-0x1))return _0x13185e(0xf5);if(_0x4d8db3[_0x13185e(0xf2)]===0x0)return _0x13185e(0xf5);return _0x4d8db3[_0x13185e(0xea)](_0x221a0a=>_0x10bd4e[_0x221a0a]);}export async function promptSingleAppSelection(_0x280ff3){const _0x28a0ae=a45_0x2c3d,_0x5adb48=[{'name':a45_0xa6f5e9[_0x28a0ae(0x108)](_0x28a0ae(0x109)),'value':_0x28a0ae(0xee)},{'name':a45_0xa6f5e9[_0x28a0ae(0xf7)](_0x28a0ae(0xf8)),'value':_0x28a0ae(0xf5)},..._0x280ff3['map'](_0x3169b0=>({'name':_0x3169b0[_0x28a0ae(0x101)]+'\x20\x20'+a45_0xa6f5e9['gray']('('+_0x3169b0[_0x28a0ae(0x103)]+')'),'value':_0x3169b0[_0x28a0ae(0x103)]}))],_0x535d1d=await select({'message':_0x28a0ae(0xf4),'choices':_0x5adb48});if(_0x535d1d===_0x28a0ae(0xee))return _0x28a0ae(0xee);if(_0x535d1d===_0x28a0ae(0xf5))return _0x28a0ae(0xf5);return _0x280ff3[_0x28a0ae(0xfc)](_0x534b81=>_0x534b81['appCode']===_0x535d1d);}export async function selectSingleAppcode(_0x4b8e92){const _0x10a2f7=a45_0x2c3d;if(!_0x4b8e92)return writeCliSideChannelLine(a45_0xa6f5e9[_0x10a2f7(0x108)](_0x10a2f7(0xe8))),_fallbackOrSkip();writeCliSideChannelLine(_0x10a2f7(0xed));let _0x19bc84;try{_0x19bc84=await withActiveCookie(_0x4b8e92,()=>listRemoteApps());}catch(_0x4f98a2){writeCliSideChannelLine(a45_0xa6f5e9['yellow'](_0x10a2f7(0xe5)));if(_0x4f98a2 instanceof Error)writeCliSideChannelLine(a45_0xa6f5e9[_0x10a2f7(0x108)](_0x10a2f7(0xfa)+_0x4f98a2[_0x10a2f7(0x102)]+')'));return _fallbackOrSkip();}if(_0x19bc84['length']===0x0)return writeCliSideChannelLine(a45_0xa6f5e9[_0x10a2f7(0xf7)](_0x10a2f7(0x105))),_fallbackOrSkip();const _0x43d12c=await promptSingleAppSelection(_0x19bc84);if(_0x43d12c==='skip')return'';if(_0x43d12c===_0x10a2f7(0xf5))return promptCustomAppcode();return _0x43d12c[_0x10a2f7(0x103)];}export async function selectMultipleApps(_0x15920e){const _0x51a67a=a45_0x2c3d;writeCliSideChannelLine(_0x51a67a(0xed));let _0x140111;try{_0x140111=await withActiveCookie(_0x15920e,()=>listRemoteApps());}catch(_0x5c3c20){writeCliSideChannelLine(_0x51a67a(0xe6));if(_0x5c3c20 instanceof Error)writeCliSideChannelLine(_0x51a67a(0xfa)+_0x5c3c20['message']+')');return _0x51a67a(0xf5);}if(_0x140111[_0x51a67a(0xf2)]===0x0)return writeCliSideChannelLine(_0x51a67a(0xf0)),_0x51a67a(0xf5);return promptAppSelection(_0x140111);}function a45_0x2c3d(_0x12808b,_0x2106d2){_0x12808b=_0x12808b-0xe4;const _0x47477e=a45_0x4747();let _0x2c3de4=_0x47477e[_0x12808b];return _0x2c3de4;}async function _fallbackOrSkip(){const _0x2a1e34=a45_0x2c3d,_0x1863eb=await select({'message':_0x2a1e34(0xf3),'choices':[{'name':a45_0xa6f5e9[_0x2a1e34(0x108)](_0x2a1e34(0xff)),'value':_0x2a1e34(0xee)},{'name':a45_0xa6f5e9[_0x2a1e34(0xf7)](_0x2a1e34(0xe7)),'value':_0x2a1e34(0xf6)}]});if(_0x1863eb===_0x2a1e34(0xee))return'';return promptCustomAppcode();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a46_0x72d995=a46_0x1556;(function(_0x267444,_0x5dc5b4){const _0xfcf50=a46_0x1556,_0x54e7d9=_0x267444();while(!![]){try{const _0x3c6682=-parseInt(_0xfcf50(0x111))/0x1*(-parseInt(_0xfcf50(0x10f))/0x2)+parseInt(_0xfcf50(0x11a))/0x3+parseInt(_0xfcf50(0x11d))/0x4*(-parseInt(_0xfcf50(0x103))/0x5)+parseInt(_0xfcf50(0x113))/0x6+-parseInt(_0xfcf50(0x117))/0x7+-parseInt(_0xfcf50(0x11e))/0x8*(parseInt(_0xfcf50(0x122))/0x9)+parseInt(_0xfcf50(0x107))/0xa*(parseInt(_0xfcf50(0x11c))/0xb);if(_0x3c6682===_0x5dc5b4)break;else _0x54e7d9['push'](_0x54e7d9['shift']());}catch(_0x210081){_0x54e7d9['push'](_0x54e7d9['shift']());}}}(a46_0xe733,0xaf00d));function a46_0x1556(_0x4d791c,_0x59ff81){_0x4d791c=_0x4d791c-0x101;const _0xe733b7=a46_0xe733();let _0x1556a1=_0xe733b7[_0x4d791c];return _0x1556a1;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';const TERMINAL_STATUSES=new Set([a46_0x72d995(0x120),a46_0x72d995(0x118)]),NON_TERMINAL_STATUSES=new Set([a46_0x72d995(0x101),a46_0x72d995(0x10c)]);export function normalizeAsyncTask(_0x5cc57d){const _0x313139=a46_0x72d995,_0x58f2c8=typeof _0x5cc57d?.[_0x313139(0x102)]===_0x313139(0x106)?_0x5cc57d['taskId'][_0x313139(0x105)]():'';if(!_0x58f2c8)throw CliErrors[_0x313139(0x11f)](_0x313139(0x109));const _0x2e90e9=typeof _0x5cc57d[_0x313139(0x110)]===_0x313139(0x106)?_0x5cc57d['status'][_0x313139(0x105)]()[_0x313139(0x115)]():'';if(!_0x2e90e9)throw CliErrors[_0x313139(0x11f)](_0x313139(0x10d)+_0x58f2c8+_0x313139(0x123));return{'taskId':_0x58f2c8,'status':_0x2e90e9,'errorMessage':typeof _0x5cc57d[_0x313139(0x10b)]===_0x313139(0x106)&&_0x5cc57d[_0x313139(0x10b)]['trim']()?_0x5cc57d[_0x313139(0x10b)]['trim']():null,'isTerminal':TERMINAL_STATUSES[_0x313139(0x10a)](_0x2e90e9),'knownStatus':TERMINAL_STATUSES[_0x313139(0x10a)](_0x2e90e9)||NON_TERMINAL_STATUSES[_0x313139(0x10a)](_0x2e90e9)};}export function buildAsyncTaskStatusCommand(_0x3d9222,_0x4f6c63){const _0x572f26=a46_0x72d995;return CLI_BIN_NAME+_0x572f26(0x10e)+quoteShellArg(_0x3d9222)+_0x572f26(0x11b)+quoteShellArg(_0x4f6c63)+_0x572f26(0x104);}export function asyncTaskMessage(_0x419435){const _0x57ae9b=a46_0x72d995;switch(_0x419435[_0x57ae9b(0x110)]){case _0x57ae9b(0x101):return'Task\x20'+_0x419435['taskId']+'\x20is\x20pending.';case _0x57ae9b(0x10c):return'Task\x20'+_0x419435['taskId']+_0x57ae9b(0x112);case _0x57ae9b(0x120):return'Task\x20'+_0x419435[_0x57ae9b(0x102)]+_0x57ae9b(0x114);case'FAILED':return _0x419435[_0x57ae9b(0x10b)]?'Task\x20'+_0x419435[_0x57ae9b(0x102)]+_0x57ae9b(0x121)+_0x419435[_0x57ae9b(0x10b)]:_0x57ae9b(0x108)+_0x419435[_0x57ae9b(0x102)]+'\x20failed.';default:return'Task\x20'+_0x419435[_0x57ae9b(0x102)]+_0x57ae9b(0x116)+_0x419435['status']+'.';}}function a46_0xe733(){const _0x16ee1a=['FAILED','replace','96348FlZyqj','\x20--appcode\x20','11NocQbO','20DmxRXm','155496npvHXp','apiError','SUCCESS','\x20failed:\x20','441SFAjNo','\x20response\x20did\x20not\x20contain\x20a\x20status.','PENDING','taskId','211555GqkzFO','\x20--format\x20compress','trim','string','14641010byWlTx','Task\x20','Async\x20task\x20response\x20did\x20not\x20contain\x20a\x20taskId.','has','errorMessage','PROCESSING','Async\x20task\x20','\x20task\x20status\x20--task-id\x20','2xTnxYy','status','1256156QmPQdh','\x20is\x20processing.','2185446RAcUbE','\x20completed\x20successfully.','toUpperCase','\x20returned\x20unknown\x20status\x20','8650831pnnfaF'];a46_0xe733=function(){return _0x16ee1a;};return a46_0xe733();}function quoteShellArg(_0x58d96b){const _0x3c886a=a46_0x72d995;return'\x27'+_0x58d96b[_0x3c886a(0x119)](/'/g,'\x27\x5c\x27\x27')+'\x27';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a47_0x26eb(_0x5861cf,_0x52fc97){_0x5861cf=_0x5861cf-0xc5;var _0x1658a7=a47_0x1658();var _0x26ebf5=_0x1658a7[_0x5861cf];return _0x26ebf5;}function a47_0x1658(){var _0x1f87a4=['122419KXJcWp','10anFPaW','11512470YEEwHH','12366DAbGuX','method','627KDIwhB','6SDNwGV','102981zxYUnL','defineProperties','5378405NKFSvz','description','11656155oLUGxP','url','7608gVmcww','1428cKkkLv','10940AQubxy'];a47_0x1658=function(){return _0x1f87a4;};return a47_0x1658();}(function(_0x298c31,_0x252517){var _0x5577b6=a47_0x26eb,_0x3945a7=_0x298c31();while(!![]){try{var _0x3720d6=parseInt(_0x5577b6(0xd0))/0x1*(-parseInt(_0x5577b6(0xca))/0x2)+-parseInt(_0x5577b6(0xce))/0x3*(parseInt(_0x5577b6(0xc8))/0x4)+-parseInt(_0x5577b6(0xd2))/0x5*(parseInt(_0x5577b6(0xcf))/0x6)+parseInt(_0x5577b6(0xd4))/0x7+-parseInt(_0x5577b6(0xc6))/0x8*(-parseInt(_0x5577b6(0xcc))/0x9)+-parseInt(_0x5577b6(0xcb))/0xa+-parseInt(_0x5577b6(0xc9))/0xb*(-parseInt(_0x5577b6(0xc7))/0xc);if(_0x3720d6===_0x252517)break;else _0x3945a7['push'](_0x3945a7['shift']());}catch(_0x4d9e34){_0x3945a7['push'](_0x3945a7['shift']());}}}(a47_0x1658,0xefed6));export function asDryRunResult(_0x2adb20,_0x38fdea){var _0x4a9889=a47_0x26eb;return Object[_0x4a9889(0xd1)](_0x2adb20,{'method':{'value':_0x38fdea[_0x4a9889(0xcd)],'enumerable':![]},'url':{'value':_0x38fdea[_0x4a9889(0xc5)],'enumerable':![]},..._0x38fdea[_0x4a9889(0xd3)]?{'description':{'value':_0x38fdea[_0x4a9889(0xd3)],'enumerable':![]}}:{}});}
|