@lovrabet/rabetbase-cli 2.5.2-beta.3 → 2.5.2-beta.4
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/README.md +1 -1
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/auto-sync.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-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/deployment/sync.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.d.ts +0 -8
- 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.d.ts +4 -0
- 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.d.ts +5 -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 -26
- 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.d.ts +43 -0
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/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 +2 -1
- package/skills/rabetbase/SKILL.md +5 -5
- package/skills/rabetbase/guides/custom-page-workflow.md +35 -17
- package/skills/rabetbase/guides/page-development-workflow.md +1 -1
- package/skills/rabetbase/knowledge/components.md +292 -0
- package/skills/rabetbase/knowledge/custom-page/generation-standards.md +74 -4
- package/skills/rabetbase/knowledge/custom-page/page-templates.md +68 -0
- package/skills/rabetbase/references/rabetbase-page-create.md +21 -9
- package/skills/rabetbase/references/rabetbase-page-custom-detail.md +1 -1
- package/skills/rabetbase/references/rabetbase-page-custom-update.md +13 -9
- package/skills/rabetbase/references/rabetbase-project-create.md +5 -2
- package/skills/rabetbase/references/rabetbase-project-domain-routing-sync.md +2 -2
- package/skills/rabetbase/references/rabetbase-run.md +1 -0
- package/skills/rabetbase.manifest.json +5 -4
- package/templates/README.md +10 -4
- package/templates/custom-pages/blank.json +5 -0
- package/templates/custom-pages/dashboard.json +5 -0
- package/templates/custom-pages/onepage.json +5 -0
- package/templates/generate-api/api.ts.tpl +1 -1
- package/lib/commands/page/custom/template.d.ts +0 -8
- package/lib/commands/page/custom/template.js +0 -1
- package/skills/rabetbase/knowledge/custom-page/components.md +0 -225
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a33_0x3849(_0x319dad,_0x1d2bd0){_0x319dad=_0x319dad-0xd9;const _0x12d0c6=a33_0x12d0();let _0x38495c=_0x12d0c6[_0x319dad];return _0x38495c;}const a33_0x58ca3a=a33_0x3849;(function(_0x3cafe3,_0x45264f){const _0x1b553f=a33_0x3849,_0x4157d2=_0x3cafe3();while(!![]){try{const _0x4e3526=parseInt(_0x1b553f(0xe0))/0x1+parseInt(_0x1b553f(0xed))/0x2*(parseInt(_0x1b553f(0xea))/0x3)+parseInt(_0x1b553f(0xe2))/0x4*(parseInt(_0x1b553f(0xdc))/0x5)+-parseInt(_0x1b553f(0xe6))/0x6*(-parseInt(_0x1b553f(0xe5))/0x7)+-parseInt(_0x1b553f(0xdb))/0x8*(parseInt(_0x1b553f(0xec))/0x9)+parseInt(_0x1b553f(0xde))/0xa+-parseInt(_0x1b553f(0xf0))/0xb;if(_0x4e3526===_0x45264f)break;else _0x4157d2['push'](_0x4157d2['shift']());}catch(_0x15cc42){_0x4157d2['push'](_0x4157d2['shift']());}}}(a33_0x12d0,0x18ca7));import{getBffScriptInfo}from'../../core/api-client.js';export const bffDetail={'service':'bff','command':a33_0x58ca3a(0xe8),'description':a33_0x58ca3a(0xdf),'risk':a33_0x58ca3a(0xe4),'flags':[{'name':'id','type':'number','required':!![],'description':a33_0x58ca3a(0xee)},{'name':'verbose','type':a33_0x58ca3a(0xef),'description':a33_0x58ca3a(0xdd)}],async 'execute'(_0x546721){const _0xd214b8=a33_0x58ca3a,_0x351abc=await getBffScriptInfo(_0x546721['num']('id')),_0x55eaed=_0x546721['bool'](_0xd214b8(0xe1));if(_0x55eaed)return{'ok':!![],'data':_0x351abc};return{'ok':!![],'data':{'id':_0x351abc['id'],'functionName':_0x351abc[_0xd214b8(0xeb)]??'','version':_0x351abc[_0xd214b8(0xda)]??'','updateUserName':_0x351abc[_0xd214b8(0xe3)]??'','appCode':_0x351abc[_0xd214b8(0xf1)],'scriptType':_0x351abc[_0xd214b8(0xd9)],'description':_0x351abc[_0xd214b8(0xf2)]||_0xd214b8(0xe7),'createdTime':_0x351abc['createdTime']??'','updatedTime':_0x351abc['updatedTime']??'','scriptContent':_0x351abc[_0xd214b8(0xe9)]??''}};}};function a33_0x12d0(){const _0xee78e5=['scriptType','version','1448kaPzcJ','16735zLDFiX','Return\x20full\x20raw\x20script\x20object','1960730mocsWL','Get\x20Backend\x20Function\x20script\x20details\x20by\x20ID','149186ywllCo','verbose','232xPDWPM','updateUserName','read','536669xcFlxS','6tZxENk','(none)','detail','scriptContent','6APNiqf','functionName','1791sfZTVq','179650BRMsiG','Script\x20ID','boolean','7239540VQqujP','appCode','description'];a33_0x12d0=function(){return _0xee78e5;};return a33_0x12d0();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2c2877,_0x115731){const _0xb6dff7=a34_0x110e,_0x505d5a=_0x2c2877();while(!![]){try{const _0x5320ee=-parseInt(_0xb6dff7(0x6c))/0x1+parseInt(_0xb6dff7(0x69))/0x2+-parseInt(_0xb6dff7(0x6e))/0x3+-parseInt(_0xb6dff7(0x66))/0x4+-parseInt(_0xb6dff7(0x6d))/0x5*(parseInt(_0xb6dff7(0x68))/0x6)+-parseInt(_0xb6dff7(0x67))/0x7+parseInt(_0xb6dff7(0x6b))/0x8*(parseInt(_0xb6dff7(0x6a))/0x9);if(_0x5320ee===_0x115731)break;else _0x505d5a['push'](_0x505d5a['shift']());}catch(_0x5ca353){_0x505d5a['push'](_0x505d5a['shift']());}}}(a34_0x15ab,0xa0caf));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';function a34_0x15ab(){const _0x3069c0=['2873500xDUOMf','735162NzkTEo','602242ubOxoC','1017DWcQno','154944SjMLzb','419791fxJhWW','35uPsSJX','280128jMZDMt','198968nISJvn'];a34_0x15ab=function(){return _0x3069c0;};return a34_0x15ab();}import{bffCreate}from'../../commands/bff/create.js';function a34_0x110e(_0x2ae98e,_0x543d0a){_0x2ae98e=_0x2ae98e-0x66;const _0x15ab0b=a34_0x15ab();let _0x110e4b=_0x15ab0b[_0x2ae98e];return _0x110e4b;}import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a35_0x3fb8(_0x3d44a5,_0x2e0270){_0x3d44a5=_0x3d44a5-0x134;const _0x166a06=a35_0x166a();let _0x3fb82e=_0x166a06[_0x3d44a5];return _0x3fb82e;}const a35_0x4a91d1=a35_0x3fb8;(function(_0x2d05ce,_0x31b244){const _0x46da42=a35_0x3fb8,_0x5b9297=_0x2d05ce();while(!![]){try{const _0x17cb38=-parseInt(_0x46da42(0x13a))/0x1*(parseInt(_0x46da42(0x13d))/0x2)+-parseInt(_0x46da42(0x143))/0x3*(parseInt(_0x46da42(0x135))/0x4)+parseInt(_0x46da42(0x145))/0x5+-parseInt(_0x46da42(0x14f))/0x6+parseInt(_0x46da42(0x146))/0x7*(parseInt(_0x46da42(0x141))/0x8)+parseInt(_0x46da42(0x14b))/0x9+parseInt(_0x46da42(0x136))/0xa;if(_0x17cb38===_0x31b244)break;else _0x5b9297['push'](_0x5b9297['shift']());}catch(_0x5382b8){_0x5b9297['push'](_0x5b9297['shift']());}}}(a35_0x166a,0x975b5));function a35_0x166a(){const _0x39b513=['7741062miHvoz','string','name','No\x20Backend\x20Function\x20scripts\x20found.','2713890qfRMXR','boolean','(unnamed)','29572xwmRHi','3223790QcIHVO','description','bool','Script\x20type\x20filter','21269BIsyFg','ENDPOINT','List\x20Backend\x20Function\x20scripts','102XbcsCP','verbose','list','functionName','3708728EnvRMD','Filter\x20by\x20script\x20name','321ObNLrt','read','4191815sNfmNI','14KnVKCG','str','type','map','length'];a35_0x166a=function(){return _0x39b513;};return a35_0x166a();}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':'bff','command':a35_0x4a91d1(0x13f),'description':a35_0x4a91d1(0x13c),'risk':a35_0x4a91d1(0x144),'flags':[{'name':a35_0x4a91d1(0x148),'type':a35_0x4a91d1(0x14c),'description':a35_0x4a91d1(0x139),'default':a35_0x4a91d1(0x13b),'enum':['ENDPOINT','COMMON']},{'name':a35_0x4a91d1(0x14d),'type':'string','description':a35_0x4a91d1(0x142)},{'name':a35_0x4a91d1(0x13e),'type':a35_0x4a91d1(0x150),'description':'Return\x20full\x20script\x20objects'}],async 'execute'(_0x952299){const _0x16a914=a35_0x4a91d1,_0x171970=await listBffScripts(_0x952299['appCode'],_0x952299[_0x16a914(0x147)](_0x16a914(0x148)),{'scriptName':_0x952299[_0x16a914(0x147)](_0x16a914(0x14d))||undefined}),_0x361015=_0x952299[_0x16a914(0x138)](_0x16a914(0x13e));return{'ok':!![],'data':_0x361015?_0x171970:_0x171970[_0x16a914(0x149)](_0x37938c=>({'id':_0x37938c['id'],'functionName':_0x37938c[_0x16a914(0x140)]??'','description':_0x37938c[_0x16a914(0x137)]||_0x16a914(0x134),'scriptType':_0x37938c['scriptType']})),'message':_0x171970[_0x16a914(0x14a)]===0x0?_0x16a914(0x14e):undefined};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x3bcfd7=a36_0x2a94;(function(_0x112c9c,_0x54e6ea){const _0x4ef6cf=a36_0x2a94,_0x8da5fc=_0x112c9c();while(!![]){try{const _0x136e2d=-parseInt(_0x4ef6cf(0x182))/0x1+parseInt(_0x4ef6cf(0x18d))/0x2*(parseInt(_0x4ef6cf(0x17a))/0x3)+-parseInt(_0x4ef6cf(0x16e))/0x4+-parseInt(_0x4ef6cf(0x17c))/0x5*(-parseInt(_0x4ef6cf(0x19a))/0x6)+-parseInt(_0x4ef6cf(0x189))/0x7+-parseInt(_0x4ef6cf(0x188))/0x8+parseInt(_0x4ef6cf(0x199))/0x9;if(_0x136e2d===_0x54e6ea)break;else _0x8da5fc['push'](_0x8da5fc['shift']());}catch(_0xc8542c){_0x8da5fc['push'](_0x8da5fc['shift']());}}}(a36_0x4e48,0xd7d83));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';function a36_0x4e48(){const _0x53c8ee=['Remote\x20script\x20missing\x20id.','1501609zkZqNn','COMMON','functionName','toLowerCase','parse','force','9988032jaELPD','7705327vabZtG','unresolvable\x20target\x20path','filePath','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','544754VxbZxp','scriptContent','\x20pulled,\x20','lockKey','ENDPOINT','local\x20unsynced\x20changes','close','length','Pull\x20complete:\x20','Pull\x20only\x20this\x20script\x20type','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','functions','33295302LTlkTM','6pkqHfm','all','str','datasetCode','lockFilePath','question','appCode','stringify','lastSync','Force\x20pull\x20cancelled.','\x22\x20not\x20found\x20after\x20ensureLockScope.','Lock\x20scope\x20for\x20app\x20\x22','would_pull','nonInteractive','scriptsRoot','push','read','map','conflict','pull','stdin','scriptType','HOOK','apps','&type=','2379888lBbvqg','includes','utf8','cancelled','string','message','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','alias','\x20failed','hash','functionNode','bff','15ijihBu','apiDir','1342910qOSzfQ','type','GET','\x20skipped,\x20','hookLocation'];a36_0x4e48=function(){return _0x53c8ee;};return a36_0x4e48();}import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a36_0x3bcfd7(0x179),'command':a36_0x3bcfd7(0x1ad),'description':a36_0x3bcfd7(0x18c),'risk':a36_0x3bcfd7(0x1aa),'flags':[{'name':a36_0x3bcfd7(0x17d),'type':a36_0x3bcfd7(0x172),'description':a36_0x3bcfd7(0x196),'enum':[a36_0x3bcfd7(0x183),a36_0x3bcfd7(0x191),'HOOK']},{'name':a36_0x3bcfd7(0x187),'type':'boolean','description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x1bc4fe){const _0x3e7b7f=a36_0x3bcfd7,_0xf064e3=loadBffProjectConfig(_0x1bc4fe[_0x3e7b7f(0x1a0)]),_0x1595ef=await readBffLockFile(_0xf064e3[_0x3e7b7f(0x19e)]),{appLock:_0x403cac}=ensureLockScope(_0x1595ef??createEmptyBffLock(),_0x1bc4fe[_0x3e7b7f(0x1a0)],_0xf064e3[_0x3e7b7f(0x1a8)],_0x3e7b7f(0x1ad)),_0x1120c1=normalizeBffType(_0x1bc4fe[_0x3e7b7f(0x19c)](_0x3e7b7f(0x17d)))??undefined,_0x459e37=buildDatasetCodeToAliasMap(_0x1bc4fe[_0x3e7b7f(0x17b)],_0x1bc4fe[_0x3e7b7f(0x1a0)]),[_0x5601ed,_0x40b255]=await Promise[_0x3e7b7f(0x19b)]([listBffScripts(_0x1bc4fe[_0x3e7b7f(0x1a0)],_0x1120c1),getBffScriptStatistics(_0x1bc4fe[_0x3e7b7f(0x1a0)])]),_0x3b502c=createHookLocationMap(_0x40b255),_0x364bcf=[];for(const _0x1903ac of _0x5601ed){const _0x5667df=resolveRemoteScriptTarget(_0xf064e3,_0x1903ac,_0x3b502c,_0x403cac[_0x3e7b7f(0x198)],_0x459e37);if(!_0x5667df){_0x364bcf['push']({'scriptType':_0x1903ac['scriptType'],'functionName':_0x1903ac['functionName']??'','status':'skipped','reason':_0x3e7b7f(0x18a)});continue;}const _0x5e03c8=_0x403cac[_0x3e7b7f(0x198)][_0x5667df[_0x3e7b7f(0x190)]],_0x3d22d7=_0x1903ac[_0x3e7b7f(0x18e)]!=null?computeContentHash(_0x1903ac[_0x3e7b7f(0x18e)]):undefined,_0x45872e=await hasUnsyncedLocalChanges(_0x5667df[_0x3e7b7f(0x18b)],_0x5e03c8,_0x3d22d7);_0x364bcf['push']({'lockKey':_0x5667df['lockKey'],'filePath':_0x5667df['filePath'],'remoteId':_0x1903ac['id']??null,'status':_0x45872e?_0x3e7b7f(0x1ac):_0x3e7b7f(0x1a6)});}return{'method':_0x3e7b7f(0x17e),'url':'/api/management/library/scripts/list?appCode='+_0x1bc4fe[_0x3e7b7f(0x1a0)]+(_0x1120c1?_0x3e7b7f(0x16d)+_0x1120c1:''),'body':{'appCode':_0x1bc4fe[_0x3e7b7f(0x1a0)],'filterType':_0x1120c1??null,'files':_0x364bcf},'description':'Would\x20inspect\x20'+_0x364bcf[_0x3e7b7f(0x194)]+_0x3e7b7f(0x197)};},async 'execute'(_0x40f536){const _0x522df4=a36_0x3bcfd7,_0x38c0aa=loadBffProjectConfig(_0x40f536[_0x522df4(0x1a0)]),_0xf589b8=await readBffLockFile(_0x38c0aa[_0x522df4(0x19e)]),{lockData:_0x339823,appLock:_0x3b6033}=ensureLockScope(_0xf589b8??createEmptyBffLock(),_0x40f536[_0x522df4(0x1a0)],_0x38c0aa[_0x522df4(0x1a8)],'pull'),_0x2868ec=normalizeBffType(_0x40f536[_0x522df4(0x19c)](_0x522df4(0x17d)))??undefined;if(_0x40f536[_0x522df4(0x19c)](_0x522df4(0x17d))&&!_0x2868ec)throw CliErrors['validation'](_0x522df4(0x174));const [_0x3a9d5f,_0x1789e2]=await Promise[_0x522df4(0x19b)]([listBffScripts(_0x40f536[_0x522df4(0x1a0)],_0x2868ec),getBffScriptStatistics(_0x40f536[_0x522df4(0x1a0)])]);if(_0x3a9d5f[_0x522df4(0x194)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':'No\x20remote\x20Backend\x20Function\x20scripts\x20found.'};const _0xbd5ac4=_0x40f536['bool']('force');if(_0xbd5ac4&&!_0x40f536['nonInteractive']){const _0x2bd262=await confirmForce();if(!_0x2bd262)throw CliErrors[_0x522df4(0x171)](_0x522df4(0x1a3));}if(_0xbd5ac4&&_0x40f536[_0x522df4(0x1a7)]){}const _0x46c73e=buildDatasetCodeToAliasMap(_0x40f536[_0x522df4(0x17b)],_0x40f536['appCode']),_0x451905=createHookLocationMap(_0x1789e2),_0x2bc126=JSON[_0x522df4(0x186)](JSON[_0x522df4(0x1a1)](_0x339823)),_0x429f61=_0x40f536['appCode'],_0x18bd4c=_0x2bc126[_0x522df4(0x16c)][_0x429f61];if(!_0x18bd4c)throw new Error(_0x522df4(0x1a5)+_0x429f61+_0x522df4(0x1a4));const _0x15ede4=[],_0x1c3c88=[],_0x5bc9ae=[];for(const _0x61c22a of _0x3a9d5f){const _0xb0d2ef=resolveRemoteScriptTarget(_0x38c0aa,_0x61c22a,_0x451905,_0x3b6033[_0x522df4(0x198)],_0x46c73e);if(!_0xb0d2ef){_0x1c3c88[_0x522df4(0x1a9)]({'lockKey':_0x61c22a[_0x522df4(0x1af)]+'/'+_0x61c22a[_0x522df4(0x184)],'reason':_0x522df4(0x18a)});continue;}const _0x33ff8a=_0x3b6033[_0x522df4(0x198)][_0xb0d2ef[_0x522df4(0x190)]];try{if(!_0x61c22a['id'])throw new Error(_0x522df4(0x181));if(_0x61c22a[_0x522df4(0x18e)]==null)throw new Error('Remote\x20script\x20missing\x20content.');const _0x4ded90=_0x61c22a[_0x522df4(0x18e)],_0xefe192=computeContentHash(_0x4ded90);if(!_0xbd5ac4){const _0x2a6eff=await hasUnsyncedLocalChanges(_0xb0d2ef['filePath'],_0x33ff8a,_0xefe192);if(_0x2a6eff){_0x1c3c88[_0x522df4(0x1a9)]({'lockKey':_0xb0d2ef['lockKey'],'reason':_0x522df4(0x192)});continue;}}await ensureParentDirectory(_0xb0d2ef[_0x522df4(0x18b)]),await writeFile(_0xb0d2ef[_0x522df4(0x18b)],_0x4ded90,_0x522df4(0x170));const _0x1dc574={'hash':_0xefe192,'remoteId':_0x61c22a['id'],'version':_0x61c22a['version']};_0xb0d2ef[_0x522df4(0x17d)]===_0x522df4(0x16b)&&_0xb0d2ef['hookLocation']&&(_0x1dc574[_0x522df4(0x175)]=_0xb0d2ef[_0x522df4(0x180)]['alias'],_0x1dc574[_0x522df4(0x19d)]=_0xb0d2ef[_0x522df4(0x180)][_0x522df4(0x19d)],_0x1dc574['operationType']=_0xb0d2ef[_0x522df4(0x180)]['operationType'],_0x1dc574[_0x522df4(0x178)]=_0xb0d2ef['hookLocation'][_0x522df4(0x178)]),_0x18bd4c['functions'][_0xb0d2ef['lockKey']]=_0x1dc574,_0x15ede4['push']({'lockKey':_0xb0d2ef[_0x522df4(0x190)],'remoteId':_0x61c22a['id']});}catch(_0x3ddd8f){_0x5bc9ae[_0x522df4(0x1a9)]({'lockKey':_0xb0d2ef[_0x522df4(0x190)],'error':_0x3ddd8f instanceof Error?_0x3ddd8f[_0x522df4(0x173)]:String(_0x3ddd8f)});}}return _0x18bd4c[_0x522df4(0x1a2)]=new Date()['toISOString'](),await writeBffLockFile(_0x38c0aa['lockFilePath'],_0x2bc126),{'ok':_0x5bc9ae[_0x522df4(0x194)]===0x0,'data':{'pulled':_0x15ede4,'skipped':_0x1c3c88,'failed':_0x5bc9ae},'message':_0x522df4(0x195)+_0x15ede4[_0x522df4(0x194)]+_0x522df4(0x18f)+_0x1c3c88[_0x522df4(0x194)]+_0x522df4(0x17f)+_0x5bc9ae[_0x522df4(0x194)]+_0x522df4(0x176)};}};async function hasUnsyncedLocalChanges(_0xbbb00f,_0x365025,_0x3b59ce){const _0x2590c8=a36_0x3bcfd7;if(!await fileExists(_0xbbb00f))return![];const _0x2a624a=await computeFileHash(_0xbbb00f);if(!_0x365025)return _0x3b59ce?_0x2a624a!==_0x3b59ce:!![];return _0x2a624a!==_0x365025[_0x2590c8(0x177)];}function buildDatasetCodeToAliasMap(_0x1d2754,_0x18836d){const _0x3ceb17=a36_0x3bcfd7,_0x28df8d=loadAliasMap(_0x1d2754,undefined,resolveApiFilePath(_0x1d2754,_0x18836d));return new Map(_0x28df8d[_0x3ceb17(0x1ab)](_0xcf6e1c=>[_0xcf6e1c['datasetCode'],_0xcf6e1c[_0x3ceb17(0x175)]]));}function a36_0x2a94(_0x4715b0,_0x10e241){_0x4715b0=_0x4715b0-0x16b;const _0x4e488e=a36_0x4e48();let _0x2a9482=_0x4e488e[_0x4715b0];return _0x2a9482;}async function confirmForce(){const _0x521b31=a36_0x3bcfd7,_0x17aa81=createInterface({'input':process[_0x521b31(0x1ae)],'output':process['stderr']}),_0x17f396=await new Promise(_0x265d84=>{const _0x4ec8b7=_0x521b31;_0x17aa81[_0x4ec8b7(0x19f)]('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x265d84);});return _0x17aa81[_0x521b31(0x193)](),['y','yes'][_0x521b31(0x16f)](_0x17f396['trim']()[_0x521b31(0x185)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a37_0x5080b8=a37_0x9607;(function(_0x22eaf8,_0xe1ef73){const _0xac72e4=a37_0x9607,_0x42b767=_0x22eaf8();while(!![]){try{const _0x4ffd24=-parseInt(_0xac72e4(0x1dc))/0x1+-parseInt(_0xac72e4(0x1bf))/0x2*(parseInt(_0xac72e4(0x1dd))/0x3)+parseInt(_0xac72e4(0x1ab))/0x4+-parseInt(_0xac72e4(0x19d))/0x5+-parseInt(_0xac72e4(0x1ca))/0x6*(parseInt(_0xac72e4(0x1b4))/0x7)+parseInt(_0xac72e4(0x1c0))/0x8+parseInt(_0xac72e4(0x198))/0x9*(parseInt(_0xac72e4(0x1b6))/0xa);if(_0x4ffd24===_0xe1ef73)break;else _0x42b767['push'](_0x42b767['shift']());}catch(_0x1500f5){_0x42b767['push'](_0x42b767['shift']());}}}(a37_0x3d62,0x25956));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';function a37_0x3d62(){const _0x2db308=['status','script','operationType','force','bff','values','7210CRDFSp','5178hUqrJd','map','update','appCode','utf8','some','push','\x20skipped,\x20','aliasToDatasetCode','description','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','datasetCodeToDataset','scriptsRoot','lockFilePath','Force\x20push\x20ignoring\x20hash\x20protection','Run\x20`','every','333nfPeSi','join','code','datasetId','Incomplete\x20HOOK\x20path:\x20','1398730fDwhVj','write','type','create','POST','Cannot\x20resolve\x20dataset\x20for\x20\x22','get','runtime\x20cache\x20clear\x20failed','cleared','runtime\x20cache\x20cleared','runtime\x20cache\x20not\x20needed','filePath','\x20uploaded,\x20','Would\x20inspect\x20','42744lnpQgZ','datasetCode','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','Runtime\x20script\x20cache\x20cleared.','remoteId','parse','Push\x20complete:\x20','string','version','502411DCMdfm',',\x20deployment\x20sync\x20','176830VASSXf','set','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','message','functionNode','alias','lastSync','\x22.\x20','boolean','300tHDcfh','1427096xvJySM','lockKey','length','No\x20local\x20Backend\x20Function\x20scripts\x20found.','Lock\x20scope\x20for\x20app\x20\x22','name','bool','COMMON','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','toISOString','12eCLiSm','apiDir','apps','attempted','functions','has','would_push','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','str','\x22\x20not\x20found\x20after\x20ensureLockScope.','validation','HOOK'];a37_0x3d62=function(){return _0x2db308;};return a37_0x3d62();}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':'bff','command':a37_0x5080b8(0x18d),'description':a37_0x5080b8(0x1d1),'risk':a37_0x5080b8(0x19e),'flags':[{'name':a37_0x5080b8(0x19f),'type':a37_0x5080b8(0x1b2),'description':'Push\x20only\x20this\x20script\x20type','enum':[a37_0x5080b8(0x1c7),'ENDPOINT','HOOK']},{'name':a37_0x5080b8(0x1c5),'type':a37_0x5080b8(0x1b2),'description':a37_0x5080b8(0x191)},{'name':a37_0x5080b8(0x1d9),'type':a37_0x5080b8(0x1be),'description':a37_0x5080b8(0x195)}],async 'dryRun'(_0x214844){const _0x36a43e=a37_0x5080b8,_0x584a05=loadBffProjectConfig(_0x214844[_0x36a43e(0x1e0)]),_0x5d3b58=await readBffLockFile(_0x584a05['lockFilePath']),{appLock:_0x4f67a9}=ensureLockScope(_0x5d3b58??createEmptyBffLock(),_0x214844['appCode'],_0x584a05[_0x36a43e(0x193)],'push'),_0x2f0978=await getTargetFunctions(_0x584a05,_0x214844),_0x41e901=_0x214844[_0x36a43e(0x1c6)](_0x36a43e(0x1d9)),_0xd7c300=[],_0x18c45e=[];for(const _0x19763b of _0x2f0978){const _0x4bbb48=await computeFileHash(_0x19763b[_0x36a43e(0x1a8)]),_0x3ef21e=_0x4f67a9[_0x36a43e(0x1ce)][_0x19763b[_0x36a43e(0x1c1)]],_0x7856=!!_0x3ef21e&&_0x3ef21e['hash']===_0x4bbb48,_0x469930=!_0x41e901&&_0x7856?'unchanged':_0x36a43e(0x1d0);_0xd7c300[_0x36a43e(0x18d)]({'lockKey':_0x19763b[_0x36a43e(0x1c1)],'filePath':_0x19763b[_0x36a43e(0x1a8)],'remoteId':_0x3ef21e?.[_0x36a43e(0x1af)]??null,'mode':_0x3ef21e?.[_0x36a43e(0x1af)]?_0x36a43e(0x1df):_0x36a43e(0x1a0),'status':_0x469930});if(_0x469930===_0x36a43e(0x1d0))_0x18c45e[_0x36a43e(0x18d)](_0x19763b[_0x36a43e(0x1c5)]);}return{'method':_0x36a43e(0x1a1),'url':'/api/management/library/scripts/save','deploymentSync':buildAutomaticDeploymentSyncPreview(_0x36a43e(0x1da),_0x18c45e),'body':{'appCode':_0x214844[_0x36a43e(0x1e0)],'force':_0x41e901,'files':_0xd7c300,'cacheClearAtRuntime':_0xd7c300[_0x36a43e(0x1e2)](_0x1357fe=>_0x1357fe[_0x36a43e(0x1d6)]===_0x36a43e(0x1d0)),'cacheClearAtRuntimeTimes':_0xd7c300[_0x36a43e(0x1e2)](_0x155583=>_0x155583[_0x36a43e(0x1d6)]==='would_push')?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x36a43e(0x1aa)+_0xd7c300[_0x36a43e(0x1c2)]+_0x36a43e(0x1ad)};},async 'execute'(_0x3727a0){const _0x45af42=a37_0x5080b8,_0x1e6e79=loadBffProjectConfig(_0x3727a0[_0x45af42(0x1e0)]),_0xf00cda=await readBffLockFile(_0x1e6e79['lockFilePath']),{lockData:_0x161ef9,appLock:_0x15646d}=ensureLockScope(_0xf00cda??createEmptyBffLock(),_0x3727a0[_0x45af42(0x1e0)],_0x1e6e79[_0x45af42(0x193)],_0x45af42(0x18d)),_0x5d0a63=await getTargetFunctions(_0x1e6e79,_0x3727a0);if(_0x5d0a63['length']===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x45af42(0x1c3)};const _0x5e62f3=_0x3727a0[_0x45af42(0x1c6)](_0x45af42(0x1d9)),_0x595a95=JSON[_0x45af42(0x1b0)](JSON['stringify'](_0x161ef9)),_0x48f64e=_0x595a95[_0x45af42(0x1cc)][_0x3727a0['appCode']];if(!_0x48f64e)throw new Error(_0x45af42(0x1c4)+_0x3727a0[_0x45af42(0x1e0)]+_0x45af42(0x1d3));const _0x333bb4=await buildHookMaps(_0x3727a0['appCode'],_0x3727a0[_0x45af42(0x1cb)],_0x5d0a63,_0x48f64e),_0x9b7d81=[],_0x3e64fd=[],_0x1abc64=[],_0x1f9105=[];for(const _0x5050ab of _0x5d0a63){const _0xaba31=await computeFileHash(_0x5050ab[_0x45af42(0x1a8)]),_0x3a6735=_0x48f64e['functions'][_0x5050ab['lockKey']];if(!_0x5e62f3&&_0x3a6735&&_0x3a6735['hash']===_0xaba31){_0x1abc64['push']({'lockKey':_0x5050ab[_0x45af42(0x1c1)],'reason':'unchanged'});continue;}try{await uploadSingleFunction(_0x3727a0[_0x45af42(0x1e0)],_0x5050ab,_0x48f64e,_0x333bb4);const _0x44ae83=_0x48f64e[_0x45af42(0x1ce)][_0x5050ab[_0x45af42(0x1c1)]];_0x9b7d81[_0x45af42(0x18d)]({'lockKey':_0x5050ab['lockKey'],'remoteId':_0x44ae83?.['remoteId']??0x0}),_0x3e64fd[_0x45af42(0x18d)](_0x5050ab[_0x45af42(0x1c5)]);}catch(_0x2fc739){_0x1f9105[_0x45af42(0x18d)]({'lockKey':_0x5050ab[_0x45af42(0x1c1)],'error':_0x2fc739 instanceof Error?_0x2fc739[_0x45af42(0x1b9)]:String(_0x2fc739)});}}_0x48f64e[_0x45af42(0x1bc)]=new Date()[_0x45af42(0x1c9)](),await writeBffLockFile(_0x1e6e79[_0x45af42(0x194)],_0x595a95),await waitForUploadedLockEntries(_0x1e6e79[_0x45af42(0x194)],_0x3727a0['appCode'],_0x9b7d81[_0x45af42(0x1de)](_0x11e51b=>_0x11e51b[_0x45af42(0x1c1)]));let _0x20afde={'attempted':![],'cleared':![]};if(_0x9b7d81['length']>0x0)try{let _0x33b092='';for(let _0x518763=0x0;_0x518763<CACHE_CLEAR_ATTEMPTS;_0x518763+=0x1){_0x33b092=await clearBffScriptCache(),_0x518763<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x20afde={'attempted':!![],'cleared':!![],'message':_0x33b092||_0x45af42(0x1ae)};}catch(_0x299fd1){_0x20afde={'attempted':!![],'cleared':![],'error':_0x299fd1 instanceof Error?_0x299fd1[_0x45af42(0x1b9)]:String(_0x299fd1)};}const _0x14f4a8=_0x1f9105[_0x45af42(0x1c2)]===0x0&&(_0x20afde[_0x45af42(0x1cd)]?_0x20afde[_0x45af42(0x1a5)]:!![]),_0x5e4e67=await runAutomaticDeploymentSync(_0x3727a0,'bff',_0x3e64fd,_0x14f4a8),_0x1752e4=_0x14f4a8&&automaticDeploymentSyncSucceeded(_0x5e4e67),_0x1f1267=_0x20afde[_0x45af42(0x1cd)]?_0x20afde['cleared']?_0x45af42(0x1a6):_0x45af42(0x1a4):_0x45af42(0x1a7),_0x81e6e7=_0x45af42(0x1b5)+_0x5e4e67[_0x45af42(0x1d6)];return{'ok':_0x1752e4,'data':{'uploaded':_0x9b7d81,'skipped':_0x1abc64,'failed':_0x1f9105,'cacheClear':_0x20afde,'deploymentSync':_0x5e4e67},'message':_0x45af42(0x1b1)+_0x9b7d81[_0x45af42(0x1c2)]+_0x45af42(0x1a9)+_0x1abc64[_0x45af42(0x1c2)]+_0x45af42(0x18e)+_0x1f9105['length']+'\x20failed,\x20'+_0x1f1267+_0x81e6e7};}};async function getTargetFunctions(_0x2e15f0,_0x54854f){const _0x13f2bd=a37_0x5080b8,_0x4307df=_0x54854f[_0x13f2bd(0x1d2)](_0x13f2bd(0x19f)),_0x394dbf=_0x54854f[_0x13f2bd(0x1d2)](_0x13f2bd(0x1c5)),_0x3c283d=normalizeBffType(_0x4307df)??undefined;if(_0x394dbf&&!_0x3c283d)throw CliErrors[_0x13f2bd(0x1d4)](_0x13f2bd(0x1c8));const _0x3e2d0f=await scanLocalBffFunctions(_0x2e15f0,_0x3c283d);if(_0x394dbf){const _0x2ac994=_0x3e2d0f['filter'](_0xe7fe29=>_0xe7fe29[_0x13f2bd(0x1c5)]===_0x394dbf);if(_0x2ac994[_0x13f2bd(0x1c2)]===0x0)throw CliErrors['validation']('Local\x20function\x20not\x20found:\x20'+_0x3c283d+'/'+_0x394dbf);return _0x2ac994;}return _0x3e2d0f;}async function buildHookMaps(_0x2e0be0,_0x1b0e14,_0x2bee8e,_0x5549ed){const _0x478d6c=a37_0x5080b8,_0x264554=_0x2bee8e[_0x478d6c(0x1e2)](_0x5d8343=>_0x5d8343[_0x478d6c(0x19f)]==='HOOK');if(!_0x264554)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x371230=loadAliasMap(_0x1b0e14,undefined,resolveApiFilePath(_0x1b0e14,_0x2e0be0)),_0x56f09a=new Map(_0x371230['map'](_0x45f8ba=>[_0x45f8ba[_0x478d6c(0x1bb)],_0x45f8ba[_0x478d6c(0x1ac)]]));for(const _0x31db04 of Object[_0x478d6c(0x1db)](_0x5549ed[_0x478d6c(0x1ce)])){_0x31db04[_0x478d6c(0x1bb)]&&_0x31db04['datasetCode']&&!_0x56f09a[_0x478d6c(0x1cf)](_0x31db04['alias'])&&_0x56f09a[_0x478d6c(0x1b7)](_0x31db04[_0x478d6c(0x1bb)],_0x31db04['datasetCode']);}const _0x3c7a17=await listDatasets(_0x2e0be0),_0x5c9acc=new Map(_0x3c7a17[_0x478d6c(0x1de)](_0x15d7bc=>[_0x15d7bc[_0x478d6c(0x19a)],_0x15d7bc]));return{'aliasToDatasetCode':_0x56f09a,'datasetCodeToDataset':_0x5c9acc};}async function uploadSingleFunction(_0x5598d0,_0x1a8542,_0x591547,_0x2d6352){const _0x36d819=a37_0x5080b8,_0x187437=await readFile(_0x1a8542[_0x36d819(0x1a8)],_0x36d819(0x1e1)),_0x56bb1a=await computeFileHash(_0x1a8542['filePath']),_0x440b07=_0x591547[_0x36d819(0x1ce)][_0x1a8542['lockKey']];if(_0x440b07?.[_0x36d819(0x1af)]&&_0x440b07[_0x36d819(0x1b3)]==null)throw CliErrors[_0x36d819(0x1d4)](_0x1a8542[_0x36d819(0x1c1)]+':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.');let _0x26ddbd=extractScriptDescription(_0x187437);if(!_0x26ddbd&&_0x440b07?.[_0x36d819(0x1af)]){const _0x53bc03=await getBffScriptInfo(_0x440b07['remoteId']);_0x26ddbd=_0x53bc03['description']||undefined;}const _0x5532bd={'appCode':_0x5598d0,'functionName':_0x1a8542[_0x36d819(0x1c5)],'scriptType':_0x1a8542['type'],'scriptContent':_0x187437};if(_0x440b07?.[_0x36d819(0x1af)])_0x5532bd['id']=_0x440b07[_0x36d819(0x1af)];if(_0x440b07?.['version']!=null)_0x5532bd['version']=_0x440b07['version'];if(_0x26ddbd)_0x5532bd[_0x36d819(0x190)]=_0x26ddbd;if(_0x1a8542[_0x36d819(0x19f)]===_0x36d819(0x1d5)){const _0x265df4=_0x1a8542[_0x36d819(0x1bb)];if(!_0x265df4||!_0x1a8542[_0x36d819(0x1d8)]||!_0x1a8542[_0x36d819(0x1ba)])throw CliErrors[_0x36d819(0x1d4)](_0x36d819(0x19c)+_0x1a8542['lockKey']);const _0x5623de=_0x2d6352[_0x36d819(0x18f)][_0x36d819(0x1a3)](_0x265df4)??_0x440b07?.[_0x36d819(0x1ac)]??_0x265df4,_0x37023b=_0x2d6352[_0x36d819(0x192)]['get'](_0x5623de);if(!_0x37023b)throw CliErrors[_0x36d819(0x1d4)](_0x36d819(0x1a2)+_0x265df4+_0x36d819(0x1bd)+(_0x36d819(0x196)+CLI_BIN_NAME+_0x36d819(0x1b8)));_0x5532bd[_0x36d819(0x19b)]=_0x37023b['id'],_0x5532bd['operationType']=_0x1a8542[_0x36d819(0x1d8)],_0x5532bd[_0x36d819(0x1ba)]=_0x1a8542['functionNode'];}const _0x43a66f=await saveBffScript(_0x5532bd),_0x37f31a=_0x43a66f['id'],_0x5dfa50=_0x43a66f[_0x36d819(0x1d7)]??await getBffScriptInfo(_0x37f31a),_0x7a5e9d={'hash':_0x56bb1a,'remoteId':_0x37f31a,'version':_0x5dfa50[_0x36d819(0x1b3)]};if(_0x1a8542['type']===_0x36d819(0x1d5)){const _0x314b13=_0x1a8542['alias'],_0x4734a9=_0x2d6352['aliasToDatasetCode'][_0x36d819(0x1a3)](_0x314b13)??_0x440b07?.[_0x36d819(0x1ac)]??_0x314b13;_0x2d6352[_0x36d819(0x18f)][_0x36d819(0x1cf)](_0x314b13)?_0x7a5e9d[_0x36d819(0x1bb)]=_0x314b13:_0x7a5e9d[_0x36d819(0x1bb)]=_0x440b07?.[_0x36d819(0x1bb)],_0x7a5e9d[_0x36d819(0x1ac)]=_0x4734a9,_0x7a5e9d[_0x36d819(0x1d8)]=_0x1a8542[_0x36d819(0x1d8)],_0x7a5e9d[_0x36d819(0x1ba)]=_0x1a8542[_0x36d819(0x1ba)];}_0x591547[_0x36d819(0x1ce)][_0x1a8542['lockKey']]=_0x7a5e9d;}function a37_0x9607(_0x36835c,_0x41bb77){_0x36835c=_0x36835c-0x18d;const _0x3d6219=a37_0x3d62();let _0x960775=_0x3d6219[_0x36835c];return _0x960775;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x34ab2a,_0xfb1aa1,_0x2e707a){const _0x38a989=a37_0x5080b8;if(_0x2e707a['length']===0x0)return;for(let _0x3d6aa5=0x0;_0x3d6aa5<LOCK_SETTLE_RETRY_COUNT;_0x3d6aa5+=0x1){const _0x12b451=await readBffLockFile(_0x34ab2a),_0x4ae598=_0x12b451?.[_0x38a989(0x1cc)]?.[_0xfb1aa1]?.[_0x38a989(0x1ce)]??{},_0x1f5209=_0x2e707a[_0x38a989(0x197)](_0x2f0ab0=>!!_0x4ae598[_0x2f0ab0]?.[_0x38a989(0x1af)]);if(_0x1f5209)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error('Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20'+_0x2e707a[_0x38a989(0x199)](',\x20')+'.');}
|
|
1
|
+
const a37_0x366196=a37_0x3241;function a37_0x52fb(){const _0x19f1ff=['version','operationType','\x22\x20not\x20found\x20after\x20ensureLockScope.','2437130xCIqMY','Push\x20only\x20this\x20script\x20type','cleared','code','utf8','runtime\x20cache\x20not\x20needed','datasetCode','values','27TepRnX','Local\x20function\x20not\x20found:\x20','functionNode','datasetId','281986MbgrVH',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','validation','create','scriptsRoot','lockKey','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','datasetCodeToDataset','toISOString','/api/management/library/scripts/save','649368VURfNm','would_push','filePath','name','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','map','30ckMsKN','alias','15474FokNJN','HOOK','No\x20local\x20Backend\x20Function\x20scripts\x20found.','Force\x20push\x20ignoring\x20hash\x20protection','POST','unchanged','aliasToDatasetCode','force','Incomplete\x20HOOK\x20path:\x20','script','type','status','Lock\x20scope\x20for\x20app\x20\x22','Push\x20complete:\x20','set','remoteId','boolean','COMMON','Runtime\x20script\x20cache\x20cleared.','204564EFEdDU','\x22.\x20','Would\x20inspect\x20','push','bool','bff','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','description','2338608ukLsBE','length','has','66OsdQGR','130HqJHFv','string','runtime\x20cache\x20clear\x20failed','\x20uploaded,\x20','\x20skipped,\x20','filter','str','update','appCode','apps','runtime\x20cache\x20cleared','stringify','some','1920436ClYiEs','lastSync',',\x20deployment\x20sync\x20','6flNkLX','lockFilePath','get','functions','attempted'];a37_0x52fb=function(){return _0x19f1ff;};return a37_0x52fb();}(function(_0x5bc47e,_0x253cd6){const _0x40a15a=a37_0x3241,_0x1911ce=_0x5bc47e();while(!![]){try{const _0x118b77=-parseInt(_0x40a15a(0x206))/0x1*(-parseInt(_0x40a15a(0x21a))/0x2)+parseInt(_0x40a15a(0x22b))/0x3*(-parseInt(_0x40a15a(0x240))/0x4)+-parseInt(_0x40a15a(0x1f6))/0x5*(parseInt(_0x40a15a(0x22d))/0x6)+-parseInt(_0x40a15a(0x203))/0x7+parseInt(_0x40a15a(0x225))/0x8+parseInt(_0x40a15a(0x216))/0x9*(-parseInt(_0x40a15a(0x20e))/0xa)+parseInt(_0x40a15a(0x1f5))/0xb*(parseInt(_0x40a15a(0x1f2))/0xc);if(_0x118b77===_0x253cd6)break;else _0x1911ce['push'](_0x1911ce['shift']());}catch(_0x3dff0b){_0x1911ce['push'](_0x1911ce['shift']());}}}(a37_0x52fb,0x7d1e2));import{readFile}from'node:fs/promises';function a37_0x3241(_0x3aeac5,_0x309f51){_0x3aeac5=_0x3aeac5-0x1ef;const _0x52fb91=a37_0x52fb();let _0x324107=_0x52fb91[_0x3aeac5];return _0x324107;}import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{automaticDeploymentSyncSucceeded,buildAutomaticDeploymentSyncPreview,runAutomaticDeploymentSync}from'../../commands/deployment/auto-sync.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':'push','description':a37_0x366196(0x1f0),'risk':'write','flags':[{'name':a37_0x366196(0x237),'type':'string','description':a37_0x366196(0x20f),'enum':[a37_0x366196(0x23e),'ENDPOINT','HOOK']},{'name':a37_0x366196(0x228),'type':a37_0x366196(0x1f7),'description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':a37_0x366196(0x234),'type':a37_0x366196(0x23d),'description':a37_0x366196(0x230)}],async 'dryRun'(_0x322d9c){const _0x4e7478=a37_0x366196,_0x3525cf=loadBffProjectConfig(_0x322d9c[_0x4e7478(0x1fe)]),_0x313ef9=await readBffLockFile(_0x3525cf[_0x4e7478(0x207)]),{appLock:_0x343627}=ensureLockScope(_0x313ef9??createEmptyBffLock(),_0x322d9c[_0x4e7478(0x1fe)],_0x3525cf[_0x4e7478(0x21e)],_0x4e7478(0x243)),_0x51e99b=await getTargetFunctions(_0x3525cf,_0x322d9c),_0x1a6e48=_0x322d9c['bool'](_0x4e7478(0x234)),_0x153e1a=[],_0x1bcafb=[];for(const _0x349850 of _0x51e99b){const _0x17814e=await computeFileHash(_0x349850[_0x4e7478(0x227)]),_0x3fdff5=_0x343627[_0x4e7478(0x209)][_0x349850[_0x4e7478(0x21f)]],_0x11f36c=!!_0x3fdff5&&_0x3fdff5['hash']===_0x17814e,_0x29c309=!_0x1a6e48&&_0x11f36c?'unchanged':_0x4e7478(0x226);_0x153e1a[_0x4e7478(0x243)]({'lockKey':_0x349850[_0x4e7478(0x21f)],'filePath':_0x349850[_0x4e7478(0x227)],'remoteId':_0x3fdff5?.[_0x4e7478(0x23c)]??null,'mode':_0x3fdff5?.['remoteId']?_0x4e7478(0x1fd):_0x4e7478(0x21d),'status':_0x29c309});if(_0x29c309===_0x4e7478(0x226))_0x1bcafb[_0x4e7478(0x243)](_0x349850[_0x4e7478(0x228)]);}return{'method':_0x4e7478(0x231),'url':_0x4e7478(0x224),'deploymentSync':buildAutomaticDeploymentSyncPreview('bff',_0x1bcafb),'body':{'appCode':_0x322d9c[_0x4e7478(0x1fe)],'force':_0x1a6e48,'files':_0x153e1a,'cacheClearAtRuntime':_0x153e1a[_0x4e7478(0x202)](_0x3f6efe=>_0x3f6efe[_0x4e7478(0x238)]===_0x4e7478(0x226)),'cacheClearAtRuntimeTimes':_0x153e1a[_0x4e7478(0x202)](_0x156650=>_0x156650[_0x4e7478(0x238)]===_0x4e7478(0x226))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x4e7478(0x242)+_0x153e1a[_0x4e7478(0x1f3)]+_0x4e7478(0x221)};},async 'execute'(_0x47a211){const _0x29e298=a37_0x366196,_0x22f732=loadBffProjectConfig(_0x47a211[_0x29e298(0x1fe)]),_0x4033f3=await readBffLockFile(_0x22f732[_0x29e298(0x207)]),{lockData:_0x13f318,appLock:_0x558684}=ensureLockScope(_0x4033f3??createEmptyBffLock(),_0x47a211['appCode'],_0x22f732[_0x29e298(0x21e)],'push'),_0x3722c3=await getTargetFunctions(_0x22f732,_0x47a211);if(_0x3722c3['length']===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x29e298(0x22f)};const _0x4e6989=_0x47a211[_0x29e298(0x244)](_0x29e298(0x234)),_0x48f11c=JSON['parse'](JSON[_0x29e298(0x201)](_0x13f318)),_0x3a79bc=_0x48f11c[_0x29e298(0x1ff)][_0x47a211[_0x29e298(0x1fe)]];if(!_0x3a79bc)throw new Error(_0x29e298(0x239)+_0x47a211['appCode']+_0x29e298(0x20d));const _0x7de08d=await buildHookMaps(_0x47a211['appCode'],_0x47a211['apiDir'],_0x3722c3,_0x3a79bc),_0x2b25ff=[],_0x261425=[],_0x3d9184=[],_0x5ed73e=[];for(const _0x1dc3e9 of _0x3722c3){const _0x119a92=await computeFileHash(_0x1dc3e9[_0x29e298(0x227)]),_0x44ee1c=_0x3a79bc['functions'][_0x1dc3e9[_0x29e298(0x21f)]];if(!_0x4e6989&&_0x44ee1c&&_0x44ee1c['hash']===_0x119a92){_0x3d9184[_0x29e298(0x243)]({'lockKey':_0x1dc3e9[_0x29e298(0x21f)],'reason':_0x29e298(0x232)});continue;}try{await uploadSingleFunction(_0x47a211['appCode'],_0x1dc3e9,_0x3a79bc,_0x7de08d);const _0x43ec8a=_0x3a79bc[_0x29e298(0x209)][_0x1dc3e9[_0x29e298(0x21f)]];_0x2b25ff[_0x29e298(0x243)]({'lockKey':_0x1dc3e9['lockKey'],'remoteId':_0x43ec8a?.[_0x29e298(0x23c)]??0x0}),_0x261425[_0x29e298(0x243)](_0x1dc3e9[_0x29e298(0x228)]);}catch(_0x798947){_0x5ed73e['push']({'lockKey':_0x1dc3e9['lockKey'],'error':_0x798947 instanceof Error?_0x798947['message']:String(_0x798947)});}}_0x3a79bc[_0x29e298(0x204)]=new Date()[_0x29e298(0x223)](),await writeBffLockFile(_0x22f732[_0x29e298(0x207)],_0x48f11c),await waitForUploadedLockEntries(_0x22f732[_0x29e298(0x207)],_0x47a211[_0x29e298(0x1fe)],_0x2b25ff[_0x29e298(0x22a)](_0x3849bd=>_0x3849bd[_0x29e298(0x21f)]));let _0x37816b={'attempted':![],'cleared':![]};if(_0x2b25ff[_0x29e298(0x1f3)]>0x0)try{let _0x49c28b='';for(let _0xf6df56=0x0;_0xf6df56<CACHE_CLEAR_ATTEMPTS;_0xf6df56+=0x1){_0x49c28b=await clearBffScriptCache(),_0xf6df56<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x37816b={'attempted':!![],'cleared':!![],'message':_0x49c28b||_0x29e298(0x23f)};}catch(_0x202980){_0x37816b={'attempted':!![],'cleared':![],'error':_0x202980 instanceof Error?_0x202980['message']:String(_0x202980)};}const _0xdeed78=_0x5ed73e[_0x29e298(0x1f3)]===0x0&&(_0x37816b[_0x29e298(0x20a)]?_0x37816b[_0x29e298(0x210)]:!![]),_0x1c7bfc=await runAutomaticDeploymentSync(_0x47a211,_0x29e298(0x245),_0x261425,_0xdeed78),_0x294f60=_0xdeed78&&automaticDeploymentSyncSucceeded(_0x1c7bfc),_0x4391fb=_0x37816b['attempted']?_0x37816b[_0x29e298(0x210)]?_0x29e298(0x200):_0x29e298(0x1f8):_0x29e298(0x213),_0x842809=_0x29e298(0x205)+_0x1c7bfc['status'];return{'ok':_0x294f60,'data':{'uploaded':_0x2b25ff,'skipped':_0x3d9184,'failed':_0x5ed73e,'cacheClear':_0x37816b,'deploymentSync':_0x1c7bfc},'message':_0x29e298(0x23a)+_0x2b25ff[_0x29e298(0x1f3)]+_0x29e298(0x1f9)+_0x3d9184[_0x29e298(0x1f3)]+_0x29e298(0x1fa)+_0x5ed73e[_0x29e298(0x1f3)]+'\x20failed,\x20'+_0x4391fb+_0x842809};}};async function getTargetFunctions(_0x4f09d5,_0x3a2f2a){const _0x3b3722=a37_0x366196,_0x29d077=_0x3a2f2a['str']('type'),_0x24a7c3=_0x3a2f2a[_0x3b3722(0x1fc)]('name'),_0x3c46ba=normalizeBffType(_0x29d077)??undefined;if(_0x24a7c3&&!_0x3c46ba)throw CliErrors['validation'](_0x3b3722(0x229));const _0x3ca95c=await scanLocalBffFunctions(_0x4f09d5,_0x3c46ba);if(_0x24a7c3){const _0x19f49f=_0x3ca95c[_0x3b3722(0x1fb)](_0xf36f75=>_0xf36f75[_0x3b3722(0x228)]===_0x24a7c3);if(_0x19f49f[_0x3b3722(0x1f3)]===0x0)throw CliErrors['validation'](_0x3b3722(0x217)+_0x3c46ba+'/'+_0x24a7c3);return _0x19f49f;}return _0x3ca95c;}async function buildHookMaps(_0x13020d,_0x3f299d,_0x5613ad,_0x14defc){const _0xa37306=a37_0x366196,_0x536ad0=_0x5613ad[_0xa37306(0x202)](_0x489509=>_0x489509[_0xa37306(0x237)]===_0xa37306(0x22e));if(!_0x536ad0)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x2df0db=loadAliasMap(_0x3f299d,undefined,resolveApiFilePath(_0x3f299d,_0x13020d)),_0x22d8fd=new Map(_0x2df0db[_0xa37306(0x22a)](_0x50f7ca=>[_0x50f7ca[_0xa37306(0x22c)],_0x50f7ca[_0xa37306(0x214)]]));for(const _0x427e73 of Object[_0xa37306(0x215)](_0x14defc['functions'])){_0x427e73[_0xa37306(0x22c)]&&_0x427e73[_0xa37306(0x214)]&&!_0x22d8fd[_0xa37306(0x1f4)](_0x427e73[_0xa37306(0x22c)])&&_0x22d8fd[_0xa37306(0x23b)](_0x427e73[_0xa37306(0x22c)],_0x427e73[_0xa37306(0x214)]);}const _0x3dca3b=await listDatasets(_0x13020d),_0x3e4f86=new Map(_0x3dca3b[_0xa37306(0x22a)](_0x3dd250=>[_0x3dd250[_0xa37306(0x211)],_0x3dd250]));return{'aliasToDatasetCode':_0x22d8fd,'datasetCodeToDataset':_0x3e4f86};}async function uploadSingleFunction(_0x491f94,_0x3cd60f,_0xec32b,_0x406698){const _0x330f5a=a37_0x366196,_0x3392ca=await readFile(_0x3cd60f[_0x330f5a(0x227)],_0x330f5a(0x212)),_0x18633f=await computeFileHash(_0x3cd60f[_0x330f5a(0x227)]),_0x47e9dc=_0xec32b[_0x330f5a(0x209)][_0x3cd60f[_0x330f5a(0x21f)]];if(_0x47e9dc?.[_0x330f5a(0x23c)]&&_0x47e9dc[_0x330f5a(0x20b)]==null)throw CliErrors['validation'](_0x3cd60f['lockKey']+_0x330f5a(0x21b));let _0x413cf3=extractScriptDescription(_0x3392ca);if(!_0x413cf3&&_0x47e9dc?.[_0x330f5a(0x23c)]){const _0x157a3d=await getBffScriptInfo(_0x47e9dc[_0x330f5a(0x23c)]);_0x413cf3=_0x157a3d[_0x330f5a(0x1f1)]||undefined;}const _0x1cfae9={'appCode':_0x491f94,'functionName':_0x3cd60f[_0x330f5a(0x228)],'scriptType':_0x3cd60f['type'],'scriptContent':_0x3392ca};if(_0x47e9dc?.[_0x330f5a(0x23c)])_0x1cfae9['id']=_0x47e9dc[_0x330f5a(0x23c)];if(_0x47e9dc?.[_0x330f5a(0x20b)]!=null)_0x1cfae9[_0x330f5a(0x20b)]=_0x47e9dc[_0x330f5a(0x20b)];if(_0x413cf3)_0x1cfae9[_0x330f5a(0x1f1)]=_0x413cf3;if(_0x3cd60f['type']===_0x330f5a(0x22e)){const _0x53a205=_0x3cd60f[_0x330f5a(0x22c)];if(!_0x53a205||!_0x3cd60f[_0x330f5a(0x20c)]||!_0x3cd60f[_0x330f5a(0x218)])throw CliErrors['validation'](_0x330f5a(0x235)+_0x3cd60f[_0x330f5a(0x21f)]);const _0x347f01=_0x406698['aliasToDatasetCode']['get'](_0x53a205)??_0x47e9dc?.[_0x330f5a(0x214)]??_0x53a205,_0x338d04=_0x406698[_0x330f5a(0x222)][_0x330f5a(0x208)](_0x347f01);if(!_0x338d04)throw CliErrors[_0x330f5a(0x21c)]('Cannot\x20resolve\x20dataset\x20for\x20\x22'+_0x53a205+_0x330f5a(0x241)+('Run\x20`'+CLI_BIN_NAME+_0x330f5a(0x220)));_0x1cfae9[_0x330f5a(0x219)]=_0x338d04['id'],_0x1cfae9[_0x330f5a(0x20c)]=_0x3cd60f['operationType'],_0x1cfae9[_0x330f5a(0x218)]=_0x3cd60f[_0x330f5a(0x218)];}const _0x51fa77=await saveBffScript(_0x1cfae9),_0x2c1789=_0x51fa77['id'],_0x33fcf6=_0x51fa77[_0x330f5a(0x236)]??await getBffScriptInfo(_0x2c1789),_0x1cad00={'hash':_0x18633f,'remoteId':_0x2c1789,'version':_0x33fcf6[_0x330f5a(0x20b)]};if(_0x3cd60f[_0x330f5a(0x237)]==='HOOK'){const _0xb0445b=_0x3cd60f[_0x330f5a(0x22c)],_0x10c2ff=_0x406698[_0x330f5a(0x233)][_0x330f5a(0x208)](_0xb0445b)??_0x47e9dc?.['datasetCode']??_0xb0445b;_0x406698[_0x330f5a(0x233)]['has'](_0xb0445b)?_0x1cad00[_0x330f5a(0x22c)]=_0xb0445b:_0x1cad00[_0x330f5a(0x22c)]=_0x47e9dc?.[_0x330f5a(0x22c)],_0x1cad00[_0x330f5a(0x214)]=_0x10c2ff,_0x1cad00[_0x330f5a(0x20c)]=_0x3cd60f[_0x330f5a(0x20c)],_0x1cad00[_0x330f5a(0x218)]=_0x3cd60f[_0x330f5a(0x218)];}_0xec32b[_0x330f5a(0x209)][_0x3cd60f[_0x330f5a(0x21f)]]=_0x1cad00;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x4e44b7,_0x5880a9,_0x15206d){const _0x7a7263=a37_0x366196;if(_0x15206d['length']===0x0)return;for(let _0x33327b=0x0;_0x33327b<LOCK_SETTLE_RETRY_COUNT;_0x33327b+=0x1){const _0xc6ad7b=await readBffLockFile(_0x4e44b7),_0x29c9d9=_0xc6ad7b?.['apps']?.[_0x5880a9]?.[_0x7a7263(0x209)]??{},_0x55a7bf=_0x15206d['every'](_0xc49505=>!!_0x29c9d9[_0xc49505]?.[_0x7a7263(0x23c)]);if(_0x55a7bf)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x7a7263(0x1ef)+_0x15206d['join'](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x4192bf=a38_0x1296;(function(_0x5ebd4c,_0x2e76fc){const _0x4b80b8=a38_0x1296,_0x2ac774=_0x5ebd4c();while(!![]){try{const _0x211fc1=parseInt(_0x4b80b8(0x157))/0x1*(parseInt(_0x4b80b8(0x153))/0x2)+parseInt(_0x4b80b8(0x161))/0x3+parseInt(_0x4b80b8(0x158))/0x4+-parseInt(_0x4b80b8(0x15b))/0x5+-parseInt(_0x4b80b8(0x15f))/0x6*(parseInt(_0x4b80b8(0x163))/0x7)+parseInt(_0x4b80b8(0x154))/0x8+-parseInt(_0x4b80b8(0x155))/0x9;if(_0x211fc1===_0x2e76fc)break;else _0x2ac774['push'](_0x2ac774['shift']());}catch(_0x34af75){_0x2ac774['push'](_0x2ac774['shift']());}}}(a38_0x363c,0xa9d39));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a38_0x1296(_0x4116e2,_0x36b8ea){_0x4116e2=_0x4116e2-0x146;const _0x363c85=a38_0x363c();let _0x12963c=_0x363c85[_0x4116e2];return _0x12963c;}import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';function a38_0x363c(){const _0x468a2a=['read','length','lockKey','bool','alias','appCode','bff','scriptsRoot','datasetCode','remote','push','status','all','2112722BFJNQe','1301720nKCXQu','10441116uXRWgN','\x20unchanged','1WKXmNG','3909484tdrgcH','functions','filePath','2856570dFadaP','Check\x20local\x20Backend\x20Function\x20sync\x20status\x20against\x20lock\x20file','lockFilePath','All\x20Backend\x20Function\x20scripts\x20are\x20in\x20sync.','5922pwVOvG','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','1748877EMMZEH','map','2499mvzHzr','apiDir'];a38_0x363c=function(){return _0x468a2a;};return a38_0x363c();}import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a38_0x4192bf(0x14c),'command':'status','description':a38_0x4192bf(0x15c),'risk':a38_0x4192bf(0x146),'flags':[{'name':a38_0x4192bf(0x14f),'type':'boolean','description':a38_0x4192bf(0x160)}],async 'execute'(_0x3478fc){const _0x22b578=a38_0x4192bf,_0x2bc594=loadBffProjectConfig(_0x3478fc[_0x22b578(0x14b)]),_0x2618fb=await readBffLockFile(_0x2bc594[_0x22b578(0x15d)]),{appLock:_0x5869fc}=ensureLockScope(_0x2618fb??createEmptyBffLock(),_0x3478fc[_0x22b578(0x14b)],_0x2bc594[_0x22b578(0x14d)],_0x22b578(0x151)),_0xa9f31c=await scanLocalBffFunctions(_0x2bc594),_0x2bf89c=[],_0x216266=[],_0x255141=[];for(const _0x2d0de0 of _0xa9f31c){const _0x2b0837=await computeFileHash(_0x2d0de0[_0x22b578(0x15a)]),_0x1579cc=_0x5869fc[_0x22b578(0x159)][_0x2d0de0[_0x22b578(0x148)]];if(!_0x1579cc)_0x2bf89c['push'](_0x2d0de0[_0x22b578(0x148)]);else _0x1579cc['hash']!==_0x2b0837?_0x216266[_0x22b578(0x150)](_0x2d0de0[_0x22b578(0x148)]):_0x255141[_0x22b578(0x150)](_0x2d0de0['lockKey']);}const _0x1e4665=[];if(_0x3478fc[_0x22b578(0x149)](_0x22b578(0x14f))){const _0x121f5c=loadAliasMap(_0x3478fc[_0x22b578(0x164)],undefined,resolveApiFilePath(_0x3478fc[_0x22b578(0x164)],_0x3478fc['appCode'])),_0xc12dba=new Map(_0x121f5c[_0x22b578(0x162)](_0x390846=>[_0x390846[_0x22b578(0x14e)],_0x390846[_0x22b578(0x14a)]])),[_0x5d73f8,_0x40ef70]=await Promise[_0x22b578(0x152)]([listBffScripts(_0x3478fc[_0x22b578(0x14b)]),getBffScriptStatistics(_0x3478fc[_0x22b578(0x14b)])]),_0x73b336=createHookLocationMap(_0x40ef70),_0x4c9977=new Set(_0xa9f31c[_0x22b578(0x162)](_0x57b181=>_0x57b181[_0x22b578(0x148)]));for(const _0x49747e of _0x5d73f8){const _0x55f1ab=resolveRemoteScriptTarget(_0x2bc594,_0x49747e,_0x73b336,_0x5869fc[_0x22b578(0x159)],_0xc12dba);_0x55f1ab&&!_0x4c9977['has'](_0x55f1ab[_0x22b578(0x148)])&&_0x1e4665[_0x22b578(0x150)](_0x55f1ab[_0x22b578(0x148)]);}}const _0xd02aa9=_0x2bf89c[_0x22b578(0x147)]===0x0&&_0x216266[_0x22b578(0x147)]===0x0&&_0x1e4665['length']===0x0;return{'ok':!![],'data':{'added':_0x2bf89c,'modified':_0x216266,'unchanged':_0x255141,'remoteOnly':_0x1e4665},'message':_0xd02aa9?_0x22b578(0x15e):_0x2bf89c['length']+'\x20added,\x20'+_0x216266[_0x22b578(0x147)]+'\x20modified,\x20'+_0x255141[_0x22b578(0x147)]+_0x22b578(0x156)+(_0x1e4665[_0x22b578(0x147)]>0x0?',\x20'+_0x1e4665[_0x22b578(0x147)]+'\x20remote-only':'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a39_0x1d96(_0x20362f,_0x4673e1){_0x20362f=_0x20362f-0xe0;const _0x560ab7=a39_0x560a();let _0x1d968f=_0x560ab7[_0x20362f];return _0x1d968f;}const a39_0x185beb=a39_0x1d96;(function(_0x2e5579,_0x4e2404){const _0x3df623=a39_0x1d96,_0x59e2a3=_0x2e5579();while(!![]){try{const _0x4871e5=parseInt(_0x3df623(0xea))/0x1*(-parseInt(_0x3df623(0xf1))/0x2)+-parseInt(_0x3df623(0xe9))/0x3*(parseInt(_0x3df623(0xfb))/0x4)+-parseInt(_0x3df623(0xe8))/0x5+-parseInt(_0x3df623(0xe4))/0x6*(-parseInt(_0x3df623(0xeb))/0x7)+parseInt(_0x3df623(0xf8))/0x8+-parseInt(_0x3df623(0xe1))/0x9+parseInt(_0x3df623(0xfd))/0xa;if(_0x4871e5===_0x4e2404)break;else _0x59e2a3['push'](_0x59e2a3['shift']());}catch(_0xf4d434){_0x59e2a3['push'](_0x59e2a3['shift']());}}}(a39_0x560a,0xa87f8));function a39_0x560a(){const _0x5b22b5=['2667766zmEPCp','nonInteractive','repairCommand','CLI\x20Built-in\x20Skill\x20',']:\x20','setLogPath','cli-skill-install','4976936BrUJKe','\x20at\x20','inherit','115448xnbxCL','apiError','25940170VnnDKY','info','\x20installed','error','cli-skill','10531611zndADT','installedPath','changed','6126LQbyjj','Built-in\x20Skill\x20install\x20failed\x20[','Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20','\x20is\x20already\x20current','631210DFYiEg','132HkhyhJ','1vTUgKw','9422VwLVLa','read','code','unknown','install','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.'];a39_0x560a=function(){return _0x5b22b5;};return a39_0x560a();}import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a39_0x185beb(0xe0),'command':a39_0x185beb(0xef),'description':'Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','risk':a39_0x185beb(0xec),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0xfe541e){const _0x42cd1a=a39_0x185beb;logger[_0x42cd1a(0xf6)](process['cwd']()),logger[_0x42cd1a(0xfe)](_0x42cd1a(0xf7),_0x42cd1a(0xf0));const _0x3c88b2=installBuiltinSkill({'stdio':_0xfe541e[_0x42cd1a(0xf2)]?'pipe':_0x42cd1a(0xfa)});if(!_0x3c88b2['ok'])throw CliErrors[_0x42cd1a(0xfc)](_0x42cd1a(0xe5)+_0x3c88b2[_0x42cd1a(0xed)]+_0x42cd1a(0xf5)+(_0x3c88b2[_0x42cd1a(0x100)]||_0x42cd1a(0xee)),_0x42cd1a(0xe6)+_0x3c88b2[_0x42cd1a(0xf3)]);return console['log'](_0x3c88b2[_0x42cd1a(0xe3)]?_0x42cd1a(0xf4)+_0x3c88b2['skillVersion']+_0x42cd1a(0xff)+(_0x3c88b2[_0x42cd1a(0xe2)]?_0x42cd1a(0xf9)+_0x3c88b2[_0x42cd1a(0xe2)]:'\x20via\x20skills@latest'):_0x42cd1a(0xf4)+_0x3c88b2['skillVersion']+_0x42cd1a(0xe7)+(_0x3c88b2['installedPath']?_0x42cd1a(0xf9)+_0x3c88b2['installedPath']:'')),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a40_0x2ba156=a40_0x5437;(function(_0x2ddb09,_0x32d5bd){const _0x32c378=a40_0x5437,_0x20d8a4=_0x2ddb09();while(!![]){try{const _0x268874=-parseInt(_0x32c378(0x147))/0x1+-parseInt(_0x32c378(0xfe))/0x2*(-parseInt(_0x32c378(0xff))/0x3)+-parseInt(_0x32c378(0x10b))/0x4+-parseInt(_0x32c378(0x134))/0x5+-parseInt(_0x32c378(0x14e))/0x6+-parseInt(_0x32c378(0x110))/0x7+parseInt(_0x32c378(0x140))/0x8*(parseInt(_0x32c378(0x118))/0x9);if(_0x268874===_0x32d5bd)break;else _0x20d8a4['push'](_0x20d8a4['shift']());}catch(_0x47e982){_0x20d8a4['push'](_0x20d8a4['shift']());}}}(a40_0x3d56,0x99d62));import a40_0x4cbf60 from'chalk';import a40_0x3f0641 from'ora';import a40_0x37f509 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 _0x55ab9d=a40_0x5437;return GIT_COMMIT!=='unknown'?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x55ab9d(0x13a)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x4aa7af=a40_0x5437,_0x18d45c=process[_0x4aa7af(0x153)]['toLowerCase']();if(_0x18d45c[_0x4aa7af(0x114)](_0x4aa7af(0x100)))return _0x4aa7af(0x100);return'npm';}const updateFlags=[{'name':a40_0x2ba156(0x119),'type':'boolean','description':a40_0x2ba156(0x11d),'default':![]},{'name':a40_0x2ba156(0x135),'type':a40_0x2ba156(0x107),'description':a40_0x2ba156(0x143)}];function getRequestedVersion(_0x586744){const _0x3ea31e=a40_0x2ba156;return _0x586744[_0x3ea31e(0x11f)](_0x3ea31e(0x135))[_0x3ea31e(0x104)]();}async function validateUpdateFlags(_0xc40b9c){const _0x334016=a40_0x2ba156,_0x22177b=_0xc40b9c[_0x334016(0x102)](_0x334016(0x119)),_0x5ee54d=getRequestedVersion(_0xc40b9c);if(_0x22177b&&_0x5ee54d)throw CliErrors[_0x334016(0x12d)](_0x334016(0x145),_0x334016(0x13b));if(_0x5ee54d&&!a40_0x37f509['valid'](_0x5ee54d))throw CliErrors['validation'](_0x334016(0x10c)+_0x5ee54d,_0x334016(0x106));}async function fetchNpmDistTags(){const _0xe46fbc=a40_0x2ba156;try{const _0x5560ea=await fetch(_0xe46fbc(0x101)+encodeURIComponent(NPM_PACKAGE_NAME)+_0xe46fbc(0x10f),{'signal':AbortSignal[_0xe46fbc(0x12b)](0x2710)});if(!_0x5560ea['ok'])return null;const _0x3b1400=await _0x5560ea['json']();if(!_0x3b1400||typeof _0x3b1400!==_0xe46fbc(0x137))return null;return Object[_0xe46fbc(0x115)](Object['entries'](_0x3b1400)[_0xe46fbc(0x125)](([,_0x3b70ee])=>typeof _0x3b70ee===_0xe46fbc(0x107)&&_0x3b70ee[_0xe46fbc(0x104)]()[_0xe46fbc(0x122)]>0x0)['map'](([_0x58094b,_0x5d18a2])=>[_0x58094b,String(_0x5d18a2)[_0xe46fbc(0x104)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x25de2d){const _0x115b88=await fetchNpmDistTags();return _0x115b88?.[_0x25de2d]??null;}async function fetchLatestVersion(){const _0x51cabe=a40_0x2ba156;return fetchNpmDistTagVersion(_0x51cabe(0x123));}async function resolveTargetVersion(_0x54e002){const _0x13a046=a40_0x2ba156,_0x1f7fcd=getRequestedVersion(_0x54e002);if(_0x1f7fcd)return{'version':_0x1f7fcd,'source':_0x13a046(0x135)};if(_0x54e002[_0x13a046(0x102)](_0x13a046(0x119))){const _0x4418fc=await fetchNpmDistTagVersion(_0x13a046(0x119));if(!_0x4418fc)return null;return{'version':_0x4418fc,'source':'beta'};}const _0x58a712=await fetchLatestVersion();if(!_0x58a712)return null;return{'version':_0x58a712,'source':_0x13a046(0x123)};}function shouldInstallTarget(_0x539e4a,_0x574973){const _0x4f02aa=a40_0x2ba156;if(_0x574973[_0x4f02aa(0x116)]==='version'||_0x574973[_0x4f02aa(0x116)]===_0x4f02aa(0x119))return!a40_0x37f509['eq'](_0x539e4a,_0x574973[_0x4f02aa(0x135)]);return a40_0x37f509['lt'](_0x539e4a,_0x574973[_0x4f02aa(0x135)]);}function getInstallPlanLabel(_0x3f1e8b,_0x4ae839){const _0x1b390a=a40_0x2ba156;switch(_0x4ae839['source']){case _0x1b390a(0x119):return _0x1b390a(0x142)+a40_0x4cbf60[_0x1b390a(0x12a)](_0x3f1e8b)+'\x20→\x20'+a40_0x4cbf60['green'](_0x4ae839['version']);case _0x1b390a(0x135):return _0x1b390a(0x11c)+a40_0x4cbf60['yellow'](_0x3f1e8b)+_0x1b390a(0x150)+a40_0x4cbf60['green'](_0x4ae839[_0x1b390a(0x135)]);case _0x1b390a(0x123):default:return _0x1b390a(0x109)+a40_0x4cbf60[_0x1b390a(0x12a)](_0x3f1e8b)+'\x20→\x20'+a40_0x4cbf60[_0x1b390a(0x10a)](_0x4ae839[_0x1b390a(0x135)]);}}function a40_0x5437(_0x6ba389,_0x19c01f){_0x6ba389=_0x6ba389-0xfe;const _0x3d5632=a40_0x3d56();let _0x543770=_0x3d5632[_0x6ba389];return _0x543770;}function repairCurrentBuiltinSkill(){const _0x3d8919=a40_0x2ba156;console[_0x3d8919(0x131)](a40_0x4cbf60['gray'](_0x3d8919(0x10e)));const _0x178f30=installBuiltinSkill();if(_0x178f30['ok'])return console[_0x3d8919(0x131)](a40_0x4cbf60[_0x3d8919(0x144)](_0x3d8919(0x14b)+_0x178f30[_0x3d8919(0x112)]+_0x3d8919(0x13d))),!![];return console[_0x3d8919(0x14c)](a40_0x4cbf60[_0x3d8919(0x12a)](_0x3d8919(0x151)+_0x178f30[_0x3d8919(0x133)]+_0x3d8919(0x12f)+(_0x178f30[_0x3d8919(0x11b)]||_0x3d8919(0x149)))),console[_0x3d8919(0x131)](a40_0x4cbf60[_0x3d8919(0x144)]('\x20\x20Run\x20manually:\x20'+CLI_BIN_NAME+_0x3d8919(0x105))),![];}function verifyUpdatedBuiltinSkill(_0xf46875){const _0x12eb5e=a40_0x2ba156,_0x47b702=inspectInstalledBuiltinSkillVersion(_0xf46875);if(_0x47b702['state']==='current')return console[_0x12eb5e(0x131)](a40_0x4cbf60[_0x12eb5e(0x144)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0xf46875+_0x12eb5e(0x13d))),!![];const _0x5c30a0=_0x47b702[_0x12eb5e(0x112)]?_0x12eb5e(0x120)+_0xf46875+_0x12eb5e(0x129)+_0x47b702[_0x12eb5e(0x112)]:_0x12eb5e(0x120)+_0xf46875+_0x12eb5e(0x138)+_0x47b702[_0x12eb5e(0x130)];return console[_0x12eb5e(0x14c)](a40_0x4cbf60['yellow']('\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20'+_0x5c30a0)),console[_0x12eb5e(0x131)](a40_0x4cbf60[_0x12eb5e(0x144)](_0x12eb5e(0x14a)+_0x47b702[_0x12eb5e(0x141)])),![];}async function execute(_0x20fb42){const _0x2a538d=a40_0x2ba156;await validateUpdateFlags(_0x20fb42);const _0x5676bd=getCurrentVersion();console[_0x2a538d(0x131)](_0x2a538d(0x14d)+_0x5676bd);const _0x1103f4=a40_0x3f0641(_0x2a538d(0x146))[_0x2a538d(0x124)](),_0x11587e=await resolveTargetVersion(_0x20fb42);if(!_0x11587e){const _0x5c8f99=_0x20fb42[_0x2a538d(0x102)](_0x2a538d(0x119))?_0x2a538d(0x136):_0x2a538d(0x10d);return _0x1103f4[_0x2a538d(0x12e)](_0x5c8f99),console[_0x2a538d(0x131)](a40_0x4cbf60[_0x2a538d(0x144)]('\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20'+NPM_PACKAGE_NAME+_0x2a538d(0x11a))),{'ok':![],'message':_0x5c8f99};}const _0x3b12e5=a40_0x37f509[_0x2a538d(0x11e)](VERSION),_0x9660cf=a40_0x37f509[_0x2a538d(0x11e)](_0x11587e[_0x2a538d(0x135)]);if(!_0x3b12e5||!_0x9660cf)return _0x1103f4[_0x2a538d(0x12e)](_0x2a538d(0x111)),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0x3b12e5,_0x11587e)){const _0x20389b=_0x11587e[_0x2a538d(0x116)]===_0x2a538d(0x135)?_0x2a538d(0x139)+_0x11587e[_0x2a538d(0x135)]+')':a40_0x37f509['gt'](_0x3b12e5,_0x9660cf)?'Current\x20version\x20v'+_0x5676bd+_0x2a538d(0x13f)+_0x11587e['version']:'Already\x20up\x20to\x20date\x20(v'+_0x11587e[_0x2a538d(0x135)]+')';return _0x1103f4[_0x2a538d(0x14f)](_0x20389b),{'ok':repairCurrentBuiltinSkill()};}_0x1103f4[_0x2a538d(0x127)](getInstallPlanLabel(_0x5676bd,_0x11587e));const _0x33bf5e=detectPackageManager(),_0x577e79=_0x33bf5e===_0x2a538d(0x13c)?resolveNpmBin(_0x2a538d(0x13c)):_0x33bf5e,_0x204d8d=a40_0x3f0641('Updating\x20via\x20'+_0x33bf5e+_0x2a538d(0x117))[_0x2a538d(0x124)]();try{return await execa(_0x577e79,[_0x2a538d(0x12c),'-g',NPM_PACKAGE_NAME+'@'+_0x11587e[_0x2a538d(0x135)]],{'stdio':_0x2a538d(0x126)}),_0x204d8d[_0x2a538d(0x14f)](_0x2a538d(0x148)+_0x11587e['version']),console[_0x2a538d(0x131)](a40_0x4cbf60['gray'](_0x2a538d(0x113))),{'ok':verifyUpdatedBuiltinSkill(_0x11587e['version'])};}catch(_0x1e96fb){return _0x204d8d[_0x2a538d(0x12e)](_0x2a538d(0x132)),console[_0x2a538d(0x11b)](a40_0x4cbf60['red']('\x20\x20'+_0x1e96fb[_0x2a538d(0x128)])),console[_0x2a538d(0x131)](a40_0x4cbf60[_0x2a538d(0x144)]('\x20\x20Try\x20manually:\x20'+_0x33bf5e+_0x2a538d(0x103)+NPM_PACKAGE_NAME+'@'+_0x11587e['version'])),{'ok':![],'message':_0x1e96fb['message']};}}function a40_0x3d56(){const _0x4add8d=['...','36nutmVY','beta','@latest','error','Requested\x20version:\x20','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','valid','str','expected\x20','update','length','latest','start','filter','pipe','info','message',',\x20found\x20','yellow','timeout','install','validation','fail',']:\x20','state','log','Update\x20failed','code','2138005xhtoIh','version','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','object',',\x20state\x20','Already\x20on\x20requested\x20version\x20(v','slice','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','npm','\x20is\x20up\x20to\x20date.','read','\x20is\x20newer\x20than\x20npm\x20latest\x20v','8363736ReAMhK','repairCommand','Beta\x20version:\x20','Install\x20a\x20specific\x20CLI\x20version','gray','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','Checking\x20for\x20updates...','726640dNRABf','Updated\x20to\x20v','unknown','\x20\x20Run\x20manually:\x20','\x20\x20CLI\x20Built-in\x20Skill\x20','warn','Current\x20version:\x20','2706066jncnHs','succeed','\x20→\x20','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','run','execPath','202owfGku','13341jyBdJF','bun','https://registry.npmjs.org/-/package/','bool','\x20install\x20-g\x20','trim','\x20cli-skill\x20install','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','string','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','Update\x20available:\x20','green','4588732JKcfbv','Invalid\x20version:\x20','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','Checking\x20CLI\x20Built-in\x20Skill...','/dist-tags','8739262TwQXaS','Version\x20comparison\x20failed','skillVersion','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','includes','fromEntries','source'];a40_0x3d56=function(){return _0x4add8d;};return a40_0x3d56();}export const updateDefinition={'service':a40_0x2ba156(0x121),'command':a40_0x2ba156(0x152),'description':a40_0x2ba156(0x108),'risk':a40_0x2ba156(0x13e),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a40_0xe7baf=a40_0x3e54;(function(_0xb9a69b,_0x4fd177){const _0x54d9a3=a40_0x3e54,_0x5ac09f=_0xb9a69b();while(!![]){try{const _0x157dd6=-parseInt(_0x54d9a3(0x164))/0x1+-parseInt(_0x54d9a3(0x188))/0x2+parseInt(_0x54d9a3(0x15a))/0x3*(parseInt(_0x54d9a3(0x174))/0x4)+parseInt(_0x54d9a3(0x149))/0x5+-parseInt(_0x54d9a3(0x151))/0x6+-parseInt(_0x54d9a3(0x15e))/0x7+parseInt(_0x54d9a3(0x18d))/0x8;if(_0x157dd6===_0x4fd177)break;else _0x5ac09f['push'](_0x5ac09f['shift']());}catch(_0x3669a4){_0x5ac09f['push'](_0x5ac09f['shift']());}}}(a40_0x1166,0x99f02));function a40_0x3e54(_0x4996ec,_0x9387be){_0x4996ec=_0x4996ec-0x142;const _0x11660f=a40_0x1166();let _0x3e5469=_0x11660f[_0x4996ec];return _0x3e5469;}import a40_0x62de63 from'chalk';import a40_0x2ead4e from'ora';import a40_0x47df77 from'semver';import{execa}from'execa';function a40_0x1166(){const _0x259ed3=['toLowerCase','Current\x20version:\x20','1938912SPMavA','run','Update\x20available:\x20','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','bun','unknown','warn','json','Already\x20up\x20to\x20date\x20(v','381eBwsUQ','npm','source','Update\x20failed','8095941LNgqem','error','yellow','expected\x20','\x20\x20Run\x20manually:\x20','code','205565VQaXqV','\x20\x20CLI\x20Built-in\x20Skill\x20','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','slice','valid','version','Beta\x20version:\x20','log','@latest','\x20→\x20','boolean','trim','/dist-tags','Current\x20version\x20v','update','30956RQSIGo','\x20cli-skill\x20install','includes','filter','beta','validation','start','Already\x20on\x20requested\x20version\x20(v','Requested\x20version:\x20','latest','red','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','Version\x20comparison\x20failed','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','info','\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20','succeed','\x20is\x20newer\x20than\x20npm\x20latest\x20v','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)',',\x20found\x20','1824112GLFdVY','str','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','execPath','Invalid\x20version:\x20','10256784MdUCNJ','\x20install\x20-g\x20','fail','Checking\x20for\x20updates...','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','current','...','message','string','object','Updating\x20via\x20','https://registry.npmjs.org/-/package/','timeout','green','state','fromEntries','skillVersion','4814575hxLnvi','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','entries','bool','gray','Checking\x20CLI\x20Built-in\x20Skill...'];a40_0x1166=function(){return _0x259ed3;};return a40_0x1166();}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 _0x4d8d54=a40_0x3e54;return GIT_COMMIT!==_0x4d8d54(0x156)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x4d8d54(0x168)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x337618=a40_0x3e54,_0x59da06=process[_0x337618(0x18b)][_0x337618(0x14f)]();if(_0x59da06[_0x337618(0x176)](_0x337618(0x155)))return _0x337618(0x155);return _0x337618(0x15b);}const updateFlags=[{'name':a40_0xe7baf(0x178),'type':a40_0xe7baf(0x16f),'description':a40_0xe7baf(0x191),'default':![]},{'name':a40_0xe7baf(0x16a),'type':a40_0xe7baf(0x196),'description':'Install\x20a\x20specific\x20CLI\x20version'}];function getRequestedVersion(_0x3f5d38){const _0x3cbc84=a40_0xe7baf;return _0x3f5d38[_0x3cbc84(0x189)](_0x3cbc84(0x16a))[_0x3cbc84(0x170)]();}async function validateUpdateFlags(_0x4bec93){const _0xe85b70=a40_0xe7baf,_0x35df06=_0x4bec93[_0xe85b70(0x14c)](_0xe85b70(0x178)),_0x3c56b0=getRequestedVersion(_0x4bec93);if(_0x35df06&&_0x3c56b0)throw CliErrors['validation'](_0xe85b70(0x192),_0xe85b70(0x154));if(_0x3c56b0&&!a40_0x47df77[_0xe85b70(0x169)](_0x3c56b0))throw CliErrors[_0xe85b70(0x179)](_0xe85b70(0x18c)+_0x3c56b0,_0xe85b70(0x167));}async function fetchNpmDistTags(){const _0x20b561=a40_0xe7baf;try{const _0x206974=await fetch(_0x20b561(0x143)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x20b561(0x171),{'signal':AbortSignal[_0x20b561(0x144)](0x2710)});if(!_0x206974['ok'])return null;const _0x11c008=await _0x206974[_0x20b561(0x158)]();if(!_0x11c008||typeof _0x11c008!==_0x20b561(0x197))return null;return Object[_0x20b561(0x147)](Object[_0x20b561(0x14b)](_0x11c008)[_0x20b561(0x177)](([,_0x3e888d])=>typeof _0x3e888d===_0x20b561(0x196)&&_0x3e888d[_0x20b561(0x170)]()['length']>0x0)['map'](([_0x2fedca,_0x55704e])=>[_0x2fedca,String(_0x55704e)[_0x20b561(0x170)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x8d3449){const _0x1fffcd=await fetchNpmDistTags();return _0x1fffcd?.[_0x8d3449]??null;}async function fetchLatestVersion(){const _0x598dd5=a40_0xe7baf;return fetchNpmDistTagVersion(_0x598dd5(0x17d));}async function resolveTargetVersion(_0x4402aa){const _0x4adb3e=a40_0xe7baf,_0x350dea=getRequestedVersion(_0x4402aa);if(_0x350dea)return{'version':_0x350dea,'source':'version'};if(_0x4402aa[_0x4adb3e(0x14c)](_0x4adb3e(0x178))){const _0x24527d=await fetchNpmDistTagVersion(_0x4adb3e(0x178));if(!_0x24527d)return null;return{'version':_0x24527d,'source':'beta'};}const _0x31dcab=await fetchLatestVersion();if(!_0x31dcab)return null;return{'version':_0x31dcab,'source':_0x4adb3e(0x17d)};}function shouldInstallTarget(_0x43f68d,_0x3dd855){const _0x31f47d=a40_0xe7baf;if(_0x3dd855[_0x31f47d(0x15c)]==='version'||_0x3dd855[_0x31f47d(0x15c)]===_0x31f47d(0x178))return!a40_0x47df77['eq'](_0x43f68d,_0x3dd855[_0x31f47d(0x16a)]);return a40_0x47df77['lt'](_0x43f68d,_0x3dd855[_0x31f47d(0x16a)]);}function getInstallPlanLabel(_0x6ce6c0,_0x2c5792){const _0x328cb8=a40_0xe7baf;switch(_0x2c5792[_0x328cb8(0x15c)]){case _0x328cb8(0x178):return _0x328cb8(0x16b)+a40_0x62de63[_0x328cb8(0x160)](_0x6ce6c0)+_0x328cb8(0x16e)+a40_0x62de63[_0x328cb8(0x145)](_0x2c5792[_0x328cb8(0x16a)]);case _0x328cb8(0x16a):return _0x328cb8(0x17c)+a40_0x62de63[_0x328cb8(0x160)](_0x6ce6c0)+_0x328cb8(0x16e)+a40_0x62de63[_0x328cb8(0x145)](_0x2c5792[_0x328cb8(0x16a)]);case _0x328cb8(0x17d):default:return _0x328cb8(0x153)+a40_0x62de63[_0x328cb8(0x160)](_0x6ce6c0)+_0x328cb8(0x16e)+a40_0x62de63[_0x328cb8(0x145)](_0x2c5792[_0x328cb8(0x16a)]);}}function repairCurrentBuiltinSkill(){const _0x2b7137=a40_0xe7baf;console[_0x2b7137(0x16c)](a40_0x62de63[_0x2b7137(0x14d)](_0x2b7137(0x14e)));const _0x6d7d24=installBuiltinSkill();if(_0x6d7d24['ok'])return console[_0x2b7137(0x16c)](a40_0x62de63[_0x2b7137(0x14d)](_0x2b7137(0x165)+_0x6d7d24[_0x2b7137(0x148)]+'\x20is\x20up\x20to\x20date.')),!![];return console['warn'](a40_0x62de63[_0x2b7137(0x160)](_0x2b7137(0x18a)+_0x6d7d24[_0x2b7137(0x163)]+']:\x20'+(_0x6d7d24[_0x2b7137(0x15f)]||'unknown'))),console[_0x2b7137(0x16c)](a40_0x62de63['gray'](_0x2b7137(0x162)+CLI_BIN_NAME+_0x2b7137(0x175))),![];}function verifyUpdatedBuiltinSkill(_0x71a7e1){const _0x56d775=a40_0xe7baf,_0x2e7951=inspectInstalledBuiltinSkillVersion(_0x71a7e1);if(_0x2e7951[_0x56d775(0x146)]===_0x56d775(0x193))return console['log'](a40_0x62de63[_0x56d775(0x14d)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x71a7e1+'\x20is\x20up\x20to\x20date.')),!![];const _0x57aa52=_0x2e7951[_0x56d775(0x148)]?_0x56d775(0x161)+_0x71a7e1+_0x56d775(0x187)+_0x2e7951[_0x56d775(0x148)]:_0x56d775(0x161)+_0x71a7e1+',\x20state\x20'+_0x2e7951[_0x56d775(0x146)];return console[_0x56d775(0x157)](a40_0x62de63[_0x56d775(0x160)](_0x56d775(0x183)+_0x57aa52)),console[_0x56d775(0x16c)](a40_0x62de63[_0x56d775(0x14d)]('\x20\x20Run\x20manually:\x20'+_0x2e7951['repairCommand'])),![];}async function execute(_0x9db0a0){const _0xe34d64=a40_0xe7baf;await validateUpdateFlags(_0x9db0a0);const _0x1b9b11=getCurrentVersion();console[_0xe34d64(0x16c)](_0xe34d64(0x150)+_0x1b9b11);const _0x8c59c2=a40_0x2ead4e(_0xe34d64(0x190))['start'](),_0x18ecd7=await resolveTargetVersion(_0x9db0a0);if(!_0x18ecd7){const _0x589b95=_0x9db0a0[_0xe34d64(0x14c)]('beta')?_0xe34d64(0x181):_0xe34d64(0x186);return _0x8c59c2[_0xe34d64(0x18f)](_0x589b95),console[_0xe34d64(0x16c)](a40_0x62de63[_0xe34d64(0x14d)](_0xe34d64(0x14a)+NPM_PACKAGE_NAME+_0xe34d64(0x16d))),{'ok':![],'message':_0x589b95};}const _0x24f579=a40_0x47df77[_0xe34d64(0x169)](VERSION),_0x55046b=a40_0x47df77[_0xe34d64(0x169)](_0x18ecd7[_0xe34d64(0x16a)]);if(!_0x24f579||!_0x55046b)return _0x8c59c2[_0xe34d64(0x18f)](_0xe34d64(0x180)),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0x24f579,_0x18ecd7)){const _0x475927=_0x18ecd7[_0xe34d64(0x15c)]==='version'?_0xe34d64(0x17b)+_0x18ecd7[_0xe34d64(0x16a)]+')':a40_0x47df77['gt'](_0x24f579,_0x55046b)?_0xe34d64(0x172)+_0x1b9b11+_0xe34d64(0x185)+_0x18ecd7[_0xe34d64(0x16a)]:_0xe34d64(0x159)+_0x18ecd7[_0xe34d64(0x16a)]+')';return _0x8c59c2[_0xe34d64(0x184)](_0x475927),{'ok':repairCurrentBuiltinSkill()};}_0x8c59c2[_0xe34d64(0x182)](getInstallPlanLabel(_0x1b9b11,_0x18ecd7));const _0x3c842d=detectPackageManager(),_0x42f4e9=_0x3c842d===_0xe34d64(0x15b)?resolveNpmBin(_0xe34d64(0x15b)):_0x3c842d,_0x10d1c8=a40_0x2ead4e(_0xe34d64(0x142)+_0x3c842d+_0xe34d64(0x194))[_0xe34d64(0x17a)]();try{return await execa(_0x42f4e9,['install','-g',NPM_PACKAGE_NAME+'@'+_0x18ecd7[_0xe34d64(0x16a)]],{'stdio':'pipe'}),_0x10d1c8[_0xe34d64(0x184)]('Updated\x20to\x20v'+_0x18ecd7['version']),console[_0xe34d64(0x16c)](a40_0x62de63[_0xe34d64(0x14d)](_0xe34d64(0x17f))),{'ok':verifyUpdatedBuiltinSkill(_0x18ecd7[_0xe34d64(0x16a)])};}catch(_0x562411){return _0x10d1c8[_0xe34d64(0x18f)](_0xe34d64(0x15d)),console['error'](a40_0x62de63[_0xe34d64(0x17e)]('\x20\x20'+_0x562411[_0xe34d64(0x195)])),console['log'](a40_0x62de63[_0xe34d64(0x14d)]('\x20\x20Try\x20manually:\x20'+_0x3c842d+_0xe34d64(0x18e)+NPM_PACKAGE_NAME+'@'+_0x18ecd7[_0xe34d64(0x16a)])),{'ok':![],'message':_0x562411['message']};}}export const updateDefinition={'service':a40_0xe7baf(0x173),'command':a40_0xe7baf(0x152),'description':a40_0xe7baf(0x166),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2903b4,_0x10103f){const _0x3b3e17=a41_0x4da3,_0x5a62d1=_0x2903b4();while(!![]){try{const _0x4372d9=parseInt(_0x3b3e17(0x123))/0x1+parseInt(_0x3b3e17(0x128))/0x2*(-parseInt(_0x3b3e17(0x126))/0x3)+-parseInt(_0x3b3e17(0x12a))/0x4*(-parseInt(_0x3b3e17(0x12c))/0x5)+-parseInt(_0x3b3e17(0x124))/0x6+-parseInt(_0x3b3e17(0x127))/0x7+-parseInt(_0x3b3e17(0x12b))/0x8*(parseInt(_0x3b3e17(0x125))/0x9)+parseInt(_0x3b3e17(0x129))/0xa;if(_0x4372d9===_0x10103f)break;else _0x5a62d1['push'](_0x5a62d1['shift']());}catch(_0x4246dc){_0x5a62d1['push'](_0x5a62d1['shift']());}}}(a41_0x280a,0xd0a42));function a41_0x4da3(_0x45d8d4,_0x4f7584){_0x45d8d4=_0x45d8d4-0x123;const _0x280a2a=a41_0x280a();let _0x4da379=_0x280a2a[_0x45d8d4];return _0x4da379;}function a41_0x280a(){const _0x30b602=['682884cVkshd','8718948bWnHGl','4rlVSjZ','32231040sxFQgs','241996atVIJb','2723944IXsRMN','5jpYiuj','14603JbbyQU','2413794Xucdpq','9hHKgeL'];a41_0x280a=function(){return _0x30b602;};return a41_0x280a();}import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x28f355=a42_0x3dcf;(function(_0x59284d,_0x46426a){const _0x254d0d=a42_0x3dcf,_0x22e14e=_0x59284d();while(!![]){try{const _0x3e8742=parseInt(_0x254d0d(0x19a))/0x1+-parseInt(_0x254d0d(0x18c))/0x2+parseInt(_0x254d0d(0x188))/0x3*(-parseInt(_0x254d0d(0x1a0))/0x4)+-parseInt(_0x254d0d(0x19b))/0x5*(parseInt(_0x254d0d(0x18a))/0x6)+parseInt(_0x254d0d(0x18e))/0x7*(-parseInt(_0x254d0d(0x186))/0x8)+-parseInt(_0x254d0d(0x199))/0x9*(parseInt(_0x254d0d(0x1a1))/0xa)+-parseInt(_0x254d0d(0x193))/0xb*(-parseInt(_0x254d0d(0x187))/0xc);if(_0x3e8742===_0x46426a)break;else _0x22e14e['push'](_0x22e14e['shift']());}catch(_0x3e9795){_0x22e14e['push'](_0x22e14e['shift']());}}}(a42_0x2c41,0xad313));function a42_0x3dcf(_0xc7137d,_0x1fddb1){_0xc7137d=_0xc7137d-0x185;const _0x2c4174=a42_0x2c41();let _0x3dcfec=_0x2c4174[_0xc7137d];return _0x3dcfec;}import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a42_0x2c41(){const _0x2e81de=['codegen','name','120gwnJDm','2785356AsRfGO','305367sEWXjD','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','4310832pmmQYw','skip-imports','236600zDZhwk','str','524111wZUAja','read','tableName','string','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','176jZiyTU','operation','sdk','bool','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','boolean','8027991BDquml','356398pMuxRo','5dyvAmP','code','alias','Omit\x20import\x20statements\x20from\x20generated\x20code','appCode','20KJfztS','10whBmhT'];a42_0x2c41=function(){return _0x2e81de;};return a42_0x2c41();}export const codegenSdk={'service':a42_0x28f355(0x1a2),'command':a42_0x28f355(0x195),'description':a42_0x28f355(0x192),'risk':a42_0x28f355(0x18f),'flags':[CODE_FLAG_OPTIONAL,{'name':a42_0x28f355(0x19d),'type':a42_0x28f355(0x191),'description':a42_0x28f355(0x189)},{'name':'operation','type':a42_0x28f355(0x191),'required':!![],'description':a42_0x28f355(0x197)},{'name':a42_0x28f355(0x18b),'type':a42_0x28f355(0x198),'description':a42_0x28f355(0x19e)}],async 'execute'(_0x4dddbd){const _0x420f5d=a42_0x28f355,{dataset:_0x87311c,operation:_0x5d71c9}=await getOperationDetail(_0x4dddbd[_0x420f5d(0x19f)],_0x4dddbd[_0x420f5d(0x18d)](_0x420f5d(0x19c)),_0x4dddbd['str'](_0x420f5d(0x194))),_0x126274=generateSdkCode(_0x87311c,_0x5d71c9,{'includeImports':!_0x4dddbd[_0x420f5d(0x196)](_0x420f5d(0x18b))});return{'ok':!![],'data':{'dataset':{'name':_0x87311c[_0x420f5d(0x185)],'code':_0x87311c[_0x420f5d(0x19c)],'tableName':_0x87311c[_0x420f5d(0x190)]},'operation':_0x4dddbd['str']('operation'),'code':_0x126274}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x4d5389=a43_0x21f8;(function(_0x3eccd3,_0x49ba41){const _0x2c3649=a43_0x21f8,_0x32b1bc=_0x3eccd3();while(!![]){try{const _0x167837=-parseInt(_0x2c3649(0xb5))/0x1+-parseInt(_0x2c3649(0xbc))/0x2+-parseInt(_0x2c3649(0xab))/0x3+parseInt(_0x2c3649(0xb2))/0x4+-parseInt(_0x2c3649(0xac))/0x5*(-parseInt(_0x2c3649(0xb0))/0x6)+parseInt(_0x2c3649(0xad))/0x7+parseInt(_0x2c3649(0xb8))/0x8;if(_0x167837===_0x49ba41)break;else _0x32b1bc['push'](_0x32b1bc['shift']());}catch(_0x38e03f){_0x32b1bc['push'](_0x32b1bc['shift']());}}}(a43_0x5eea,0x5db42));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';function a43_0x21f8(_0x151ffb,_0xd5ed29){_0x151ffb=_0x151ffb-0xa9;const _0x5eea0d=a43_0x5eea();let _0x21f80d=_0x5eea0d[_0x151ffb];return _0x21f80d;}function a43_0x5eea(){const _0x2740ef=['821862qXdwOl','5efyPeF','2456587pNAOgw','no-imports','bool','1508958epjYMg','sqlcode','2571960BMtxbd','sqlCode','sdk','531951yDxssT','str','codegen','2187840UumewU','sql','target','Omit\x20import\x20statements\x20from\x20generated\x20code','658378nSWMQu','read','sqlName'];a43_0x5eea=function(){return _0x2740ef;};return a43_0x5eea();}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':a43_0x4d5389(0xb7),'command':a43_0x4d5389(0xb9),'description':'Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','risk':a43_0x4d5389(0xa9),'flags':[SQLCODE_FLAG,{'name':a43_0x4d5389(0xba),'type':'string','description':'Code\x20target:\x20sdk\x20(default)\x20or\x20bff','default':a43_0x4d5389(0xb4),'enum':[a43_0x4d5389(0xb4),'bff']},{'name':a43_0x4d5389(0xae),'type':'boolean','description':a43_0x4d5389(0xbb)}],async 'execute'(_0x5d4a14){const _0x5ddf1=a43_0x4d5389,_0x4bbc12=await getSqlQueryInfo(_0x5d4a14['appCode'],_0x5d4a14[_0x5ddf1(0xb6)](_0x5ddf1(0xb1))),_0x170752=_0x5d4a14[_0x5ddf1(0xb6)]('target')||_0x5ddf1(0xb4),_0x3fef13=generateSqlCodeTemplate(_0x4bbc12,{'target':_0x170752,'includeImports':!_0x5d4a14[_0x5ddf1(0xaf)]('no-imports')});return{'ok':!![],'data':{'sqlCode':_0x4bbc12[_0x5ddf1(0xb3)],'sqlName':_0x4bbc12[_0x5ddf1(0xaa)],'target':_0x170752,'code':_0x3fef13}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a44_0x3abb(_0x30d9bd,_0x472664){_0x30d9bd=_0x30d9bd-0x1ed;const _0x1bf1f0=a44_0x1bf1();let _0x3abbd6=_0x1bf1f0[_0x30d9bd];return _0x3abbd6;}(function(_0x3b4173,_0x2967fb){const _0x3f13c2=a44_0x3abb,_0x283365=_0x3b4173();while(!![]){try{const _0x28313b=-parseInt(_0x3f13c2(0x215))/0x1+parseInt(_0x3f13c2(0x20d))/0x2+parseInt(_0x3f13c2(0x1ed))/0x3*(parseInt(_0x3f13c2(0x211))/0x4)+-parseInt(_0x3f13c2(0x20f))/0x5+-parseInt(_0x3f13c2(0x1ef))/0x6*(-parseInt(_0x3f13c2(0x213))/0x7)+-parseInt(_0x3f13c2(0x201))/0x8+parseInt(_0x3f13c2(0x208))/0x9;if(_0x28313b===_0x2967fb)break;else _0x283365['push'](_0x283365['shift']());}catch(_0xfec0bd){_0x283365['push'](_0x283365['shift']());}}}(a44_0x1bf1,0x4944e));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';export function buildAppAddFlags(){const _0x3c0449=a44_0x3abb;return[{'name':_0x3c0449(0x1ff),'type':_0x3c0449(0x20b),'description':_0x3c0449(0x204),'required':!![]},{'name':'global','type':_0x3c0449(0x206),'description':_0x3c0449(0x1f0),'default':![]},...getAppProfileFlagDefs()];}function a44_0x1bf1(){const _0x8cd931=['\x20config.','\x20<name>\x20[--global]','validation','appcode','apps','2204000nfHSDa','Usage:\x20','\x22\x20still\x20defined\x20in\x20','App\x20code','\x20Note:\x20app\x20\x22','boolean','str','8191008oVxwuR','keys','project','string','globalConfig','777324leDSgN','App\x20\x22','2895525xwCKBQ','Updated','4yYEJNk','bool','11494iCESPs','trim','553256CWnZzi','\x20<name>','\x20<name>\x20--appcode\x20<code>','defaultApp','args','153723DEhGpV','Added','1308bhfhMe','Use\x20global\x20config\x20scope','Removed\x20app\x20\x22','\x22\x20not\x20found.','\x22\x20(appcode:\x20','projectConfig','\x20app\x20\x22','global','Missing\x20app\x20name.','\x20Default\x20app\x20changed\x20to\x20\x22','length','object','\x20Default\x20app\x20is\x20\x22'];a44_0x1bf1=function(){return _0x8cd931;};return a44_0x1bf1();}export function buildAppRemoveFlags(){const _0x34a9ed=a44_0x3abb;return[{'name':_0x34a9ed(0x1f6),'type':_0x34a9ed(0x206),'description':_0x34a9ed(0x1f0),'default':![]}];}export async function validateAppName(_0x20456c,_0x1672d7){const _0x438d77=a44_0x3abb,_0x104110=_0x20456c[_0x438d77(0x219)][0x0]?.[_0x438d77(0x214)]();if(!_0x104110)throw CliErrors[_0x438d77(0x1fe)](_0x438d77(0x1f7),_0x438d77(0x202)+CLI_BIN_NAME+'\x20'+_0x1672d7+_0x438d77(0x216));}export async function runAppAdd(_0x4715d4,_0x285d47){const _0x330f98=a44_0x3abb,_0x234963=_0x4715d4[_0x330f98(0x219)][0x0]?.['trim']();if(!_0x234963)throw CliErrors['validation'](_0x330f98(0x1f7),_0x330f98(0x202)+CLI_BIN_NAME+'\x20'+_0x285d47+_0x330f98(0x217));const _0x50e5a3=_0x4715d4[_0x330f98(0x207)](_0x330f98(0x1ff));if(!_0x50e5a3)throw CliErrors['flagMissing']('appcode',_0x330f98(0x202)+CLI_BIN_NAME+'\x20'+_0x285d47+_0x330f98(0x217));const _0x34e38a={'global':_0x4715d4[_0x330f98(0x212)]('global')},_0x57feeb=readConfig(_0x34e38a);if(!_0x57feeb[_0x330f98(0x200)])_0x57feeb[_0x330f98(0x200)]={};const _0x26735c={'appcode':_0x50e5a3,...collectAppProfileOverrides(_0x15e803=>_0x4715d4[_0x330f98(0x207)](_0x15e803))},_0x19fbe0=_0x57feeb[_0x330f98(0x200)],_0x10264c=Object[_0x330f98(0x209)](_0x19fbe0),_0xcd2b12=typeof _0x57feeb[_0x330f98(0x218)]==='string'&&_0x19fbe0[_0x57feeb[_0x330f98(0x218)]]?_0x57feeb[_0x330f98(0x218)]:_0x10264c[_0x330f98(0x1f9)]===0x1?_0x10264c[0x0]:undefined,_0x1b7128=!!_0x19fbe0[_0x234963];_0x19fbe0[_0x234963]=_0x26735c;const _0x258c2a=normalizeStoredDefaultApp(_0x57feeb,_0xcd2b12);writeConfig(_0x57feeb,_0x34e38a);const _0xa0db40=!_0x1b7128&&_0x258c2a?_0x330f98(0x1fb)+_0x258c2a+'\x22.':'',_0x5e68a6=(_0x1b7128?_0x330f98(0x210):_0x330f98(0x1ee))+_0x330f98(0x1f5)+_0x234963+_0x330f98(0x1f3)+_0x50e5a3+')'+scopeLabel(_0x34e38a)+'.'+_0xa0db40;return{'ok':!![],'message':_0x5e68a6};}export async function runAppRemove(_0xaf56b0,_0x173c13){const _0x5d90fa=a44_0x3abb,_0x44fb4f=_0xaf56b0[_0x5d90fa(0x219)][0x0]?.[_0x5d90fa(0x214)]();if(!_0x44fb4f)throw CliErrors[_0x5d90fa(0x1fe)](_0x5d90fa(0x1f7),_0x5d90fa(0x202)+CLI_BIN_NAME+'\x20'+_0x173c13+_0x5d90fa(0x1fd));const _0x319d49=_0xaf56b0[_0x5d90fa(0x212)]('global'),{config:_0x4a1837,layers:_0x3bdba5}=readRawConfigWithLayers(),_0x58eff7=_0x4a1837[_0x5d90fa(0x200)]??{};if(!_0x58eff7[_0x44fb4f])throw CliErrors['validation'](_0x5d90fa(0x20e)+_0x44fb4f+_0x5d90fa(0x1f2));const _0x2d9c04=_0x3bdba5[_0x5d90fa(0x20c)]['apps']&&typeof _0x3bdba5[_0x5d90fa(0x20c)]['apps']==='object'?_0x3bdba5[_0x5d90fa(0x20c)][_0x5d90fa(0x200)]:{},_0x3d3a5e=_0x3bdba5[_0x5d90fa(0x1f4)]['apps']&&typeof _0x3bdba5['projectConfig'][_0x5d90fa(0x200)]===_0x5d90fa(0x1fa)?_0x3bdba5[_0x5d90fa(0x1f4)][_0x5d90fa(0x200)]:{},_0x51ecf9=appDefinedIn(_0x44fb4f,_0x2d9c04,_0x3d3a5e),_0x4cedcf=resolveAppScopeForWrite(_0x44fb4f,_0x319d49,_0x3bdba5),_0x1952dc={'global':_0x4cedcf==='global'},_0x2e18ff=readConfig(_0x1952dc),_0x2fd863=_0x2e18ff[_0x5d90fa(0x200)];if(!_0x2fd863||!_0x2fd863[_0x44fb4f])throw CliErrors[_0x5d90fa(0x1fe)]('App\x20\x22'+_0x44fb4f+_0x5d90fa(0x1f2));delete _0x2fd863[_0x44fb4f];let _0xa3c404='';const _0x85aedc=typeof _0x2e18ff['defaultApp']===_0x5d90fa(0x20b)?_0x2e18ff['defaultApp']:undefined,_0x37af81=Object[_0x5d90fa(0x209)](_0x2fd863),_0x444add=_0x85aedc===_0x44fb4f?_0x37af81[0x0]:_0x85aedc,_0x4739c1=normalizeStoredDefaultApp(_0x2e18ff,_0x444add);if(_0x85aedc===_0x44fb4f&&_0x37af81[_0x5d90fa(0x1f9)]===0x1)_0xa3c404='\x20Remaining\x20app\x20\x22'+_0x37af81[0x0]+'\x22\x20is\x20selected\x20automatically.';else _0x85aedc===_0x44fb4f&&_0x4739c1&&(_0xa3c404=_0x5d90fa(0x1f8)+_0x4739c1+'\x22.');Object[_0x5d90fa(0x209)](_0x2fd863)[_0x5d90fa(0x1f9)]===0x0&&(delete _0x2e18ff['apps'],delete _0x2e18ff[_0x5d90fa(0x218)]);writeConfig(_0x2e18ff,_0x1952dc);const _0xce1d96=_0x51ecf9==='both'?_0x5d90fa(0x205)+_0x44fb4f+_0x5d90fa(0x203)+(_0x4cedcf==='project'?_0x5d90fa(0x1f6):_0x5d90fa(0x20a))+_0x5d90fa(0x1fc):'';return{'ok':!![],'message':_0x5d90fa(0x1f1)+_0x44fb4f+'\x22'+scopeLabel(_0x1952dc)+'.'+_0xa3c404+_0xce1d96};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5da7f7,_0x42806e){const _0x1d761d=a45_0x2002,_0x569311=_0x5da7f7();while(!![]){try{const _0xbfacda=parseInt(_0x1d761d(0x76))/0x1*(parseInt(_0x1d761d(0x91))/0x2)+parseInt(_0x1d761d(0x7e))/0x3*(-parseInt(_0x1d761d(0x97))/0x4)+-parseInt(_0x1d761d(0x79))/0x5*(parseInt(_0x1d761d(0x8a))/0x6)+parseInt(_0x1d761d(0x94))/0x7*(-parseInt(_0x1d761d(0x75))/0x8)+-parseInt(_0x1d761d(0x93))/0x9+-parseInt(_0x1d761d(0x7d))/0xa+parseInt(_0x1d761d(0x8c))/0xb*(parseInt(_0x1d761d(0x7c))/0xc);if(_0xbfacda===_0x42806e)break;else _0x569311['push'](_0x569311['shift']());}catch(_0x2949bc){_0x569311['push'](_0x569311['shift']());}}}(a45_0x4a88,0xb9fae));import{input,checkbox,select}from'@inquirer/prompts';function a45_0x2002(_0x442cf2,_0x159e1a){_0x442cf2=_0x442cf2-0x73;const _0x4a8815=a45_0x4a88();let _0x20026f=_0x4a8815[_0x442cf2];return _0x20026f;}function a45_0x4a88(){const _0x2d128f=['trim','21972qpQkGu','318880dfhhZr','15300TMSQgW','App\x20Code:','length','\x0aCould\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.','Could\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.','Fetching\x20available\x20apps...','(No\x20login\x20session.\x20Enter\x20an\x20App\x20Code\x20manually\x20or\x20skip.)','custom','manual','gray','(Skip;\x20configure\x20later)','yellow','534PkFmGX','appName','17996ouzVRC','✎\x20Enter\x20appcode\x20manually','\x20apps.\x20Select\x20with\x20space,\x20a=all,\x20i=invert:','\x20\x20(','cyan','123982YVWLoE','map','1114902dKLQqo','14WpwXzy','message','✎\x20Enter\x20manually','872aoEgKO','appCode','No\x20available\x20apps\x20found.','Select\x20the\x20app\x20to\x20bind:','skip','521064wcYjzw','9GklKeb','includes','Invalid\x20App\x20Code','78305uyFDzK','valid'];a45_0x4a88=function(){return _0x2d128f;};return a45_0x4a88();}import a45_0x4406a5 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 _0x149614=await input({'message':'App\x20Code:','validate':_0x2e313b=>{const _0x5e8f84=a45_0x2002,_0x217ae5=validateAppcode(_0x2e313b[_0x5e8f84(0x7b)]());return _0x217ae5[_0x5e8f84(0x7a)]||_0x217ae5['message']||_0x5e8f84(0x78);}});return _0x149614['trim']();}export async function promptAppSelection(_0x573077){const _0x560873=a45_0x2002,_0x346d24=[{'name':a45_0x4406a5[_0x560873(0x89)](_0x560873(0x8d)),'value':-0x1},..._0x573077[_0x560873(0x92)]((_0x1d52c0,_0x52ef84)=>({'name':_0x1d52c0[_0x560873(0x8b)]+'\x20\x20'+a45_0x4406a5[_0x560873(0x87)]('('+_0x1d52c0[_0x560873(0x98)]+')'),'value':_0x52ef84}))],_0x449356=await checkbox({'message':'Found\x20'+a45_0x4406a5[_0x560873(0x90)](_0x573077[_0x560873(0x80)])+_0x560873(0x8e),'choices':_0x346d24,'loop':![]});if(_0x449356[_0x560873(0x77)](-0x1))return _0x560873(0x85);if(_0x449356[_0x560873(0x80)]===0x0)return _0x560873(0x85);return _0x449356['map'](_0xa11e24=>_0x573077[_0xa11e24]);}export async function promptSingleAppSelection(_0x227e8e){const _0x296eda=a45_0x2002,_0x340db6=[{'name':a45_0x4406a5['gray']('(Skip;\x20configure\x20later\x20with\x20config\x20set\x20appcode)'),'value':_0x296eda(0x74)},{'name':a45_0x4406a5[_0x296eda(0x89)](_0x296eda(0x8d)),'value':_0x296eda(0x85)},..._0x227e8e[_0x296eda(0x92)](_0x4db2e9=>({'name':_0x4db2e9[_0x296eda(0x8b)]+'\x20\x20'+a45_0x4406a5[_0x296eda(0x87)]('('+_0x4db2e9[_0x296eda(0x98)]+')'),'value':_0x4db2e9[_0x296eda(0x98)]}))],_0x1232bf=await select({'message':_0x296eda(0x73),'choices':_0x340db6});if(_0x1232bf===_0x296eda(0x74))return'skip';if(_0x1232bf===_0x296eda(0x85))return _0x296eda(0x85);return _0x227e8e['find'](_0x228348=>_0x228348[_0x296eda(0x98)]===_0x1232bf);}export async function selectSingleAppcode(_0x2965d1){const _0x5312b4=a45_0x2002;if(!_0x2965d1)return writeCliSideChannelLine(a45_0x4406a5[_0x5312b4(0x87)](_0x5312b4(0x84))),_fallbackOrSkip();writeCliSideChannelLine(_0x5312b4(0x83));let _0x1727b2;try{_0x1727b2=await withActiveCookie(_0x2965d1,()=>listRemoteApps());}catch(_0xd83663){writeCliSideChannelLine(a45_0x4406a5[_0x5312b4(0x89)](_0x5312b4(0x82)));if(_0xd83663 instanceof Error)writeCliSideChannelLine(a45_0x4406a5[_0x5312b4(0x87)]('\x20\x20('+_0xd83663[_0x5312b4(0x95)]+')'));return _fallbackOrSkip();}if(_0x1727b2[_0x5312b4(0x80)]===0x0)return writeCliSideChannelLine(a45_0x4406a5[_0x5312b4(0x89)](_0x5312b4(0x99))),_fallbackOrSkip();const _0x141654=await promptSingleAppSelection(_0x1727b2);if(_0x141654==='skip')return'';if(_0x141654===_0x5312b4(0x85))return promptCustomAppcode();return _0x141654[_0x5312b4(0x98)];}export async function selectMultipleApps(_0xe18a1){const _0xee3acf=a45_0x2002;writeCliSideChannelLine(_0xee3acf(0x83));let _0x5370fa;try{_0x5370fa=await withActiveCookie(_0xe18a1,()=>listRemoteApps());}catch(_0x18144a){writeCliSideChannelLine(_0xee3acf(0x81));if(_0x18144a instanceof Error)writeCliSideChannelLine(_0xee3acf(0x8f)+_0x18144a[_0xee3acf(0x95)]+')');return _0xee3acf(0x85);}if(_0x5370fa['length']===0x0)return writeCliSideChannelLine('\x0aNo\x20available\x20apps\x20found.'),'custom';return promptAppSelection(_0x5370fa);}async function _fallbackOrSkip(){const _0x4338a2=a45_0x2002,_0xe7578b=await select({'message':_0x4338a2(0x7f),'choices':[{'name':a45_0x4406a5['gray'](_0x4338a2(0x88)),'value':_0x4338a2(0x74)},{'name':a45_0x4406a5[_0x4338a2(0x89)](_0x4338a2(0x96)),'value':_0x4338a2(0x86)}]});if(_0xe7578b===_0x4338a2(0x74))return'';return promptCustomAppcode();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x3ad6fc=a46_0x58f4;(function(_0x329127,_0x3b5d38){const _0x4a3ead=a46_0x58f4,_0x12f8cd=_0x329127();while(!![]){try{const _0x112dc6=-parseInt(_0x4a3ead(0xe2))/0x1*(parseInt(_0x4a3ead(0xe4))/0x2)+parseInt(_0x4a3ead(0xe6))/0x3+-parseInt(_0x4a3ead(0xd8))/0x4+parseInt(_0x4a3ead(0xea))/0x5+parseInt(_0x4a3ead(0xdc))/0x6+-parseInt(_0x4a3ead(0xd9))/0x7*(-parseInt(_0x4a3ead(0xdf))/0x8)+-parseInt(_0x4a3ead(0xd2))/0x9*(parseInt(_0x4a3ead(0xd1))/0xa);if(_0x112dc6===_0x3b5d38)break;else _0x12f8cd['push'](_0x12f8cd['shift']());}catch(_0x4795ad){_0x12f8cd['push'](_0x12f8cd['shift']());}}}(a46_0xf0aa,0x5b73c));import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';const TERMINAL_STATUSES=new Set([a46_0x3ad6fc(0xcf),a46_0x3ad6fc(0xe3)]),NON_TERMINAL_STATUSES=new Set([a46_0x3ad6fc(0xed),'PROCESSING']);function a46_0xf0aa(){const _0x532299=['has','360774GZzjGa','errorMessage','\x20is\x20pending.','2694752Rexnzi','\x20completed\x20successfully.','\x20failed.','839fsavSF','FAILED','564pqCBEI','Async\x20task\x20response\x20did\x20not\x20contain\x20a\x20taskId.','2174916pMQYAX','replace','\x27\x5c\x27\x27','trim','524505RFTFzC','apiError','\x20response\x20did\x20not\x20contain\x20a\x20status.','PENDING','Task\x20','toUpperCase','taskId','string','\x20returned\x20unknown\x20status\x20','SUCCESS','Async\x20task\x20','10ljWrEd','1860309sLNtYQ','PROCESSING','\x20is\x20processing.','\x20--appcode\x20','\x20task\x20status\x20--task-id\x20','status','1635836tpAonF','7tseBDi','\x20failed:\x20'];a46_0xf0aa=function(){return _0x532299;};return a46_0xf0aa();}export function normalizeAsyncTask(_0xb8b463){const _0x101449=a46_0x3ad6fc,_0x1c7f44=typeof _0xb8b463?.['taskId']===_0x101449(0xcd)?_0xb8b463['taskId'][_0x101449(0xe9)]():'';if(!_0x1c7f44)throw CliErrors[_0x101449(0xeb)](_0x101449(0xe5));const _0x5933b5=typeof _0xb8b463['status']===_0x101449(0xcd)?_0xb8b463[_0x101449(0xd7)][_0x101449(0xe9)]()[_0x101449(0xef)]():'';if(!_0x5933b5)throw CliErrors[_0x101449(0xeb)](_0x101449(0xd0)+_0x1c7f44+_0x101449(0xec));return{'taskId':_0x1c7f44,'status':_0x5933b5,'errorMessage':typeof _0xb8b463[_0x101449(0xdd)]==='string'&&_0xb8b463[_0x101449(0xdd)]['trim']()?_0xb8b463[_0x101449(0xdd)][_0x101449(0xe9)]():null,'isTerminal':TERMINAL_STATUSES[_0x101449(0xdb)](_0x5933b5),'knownStatus':TERMINAL_STATUSES[_0x101449(0xdb)](_0x5933b5)||NON_TERMINAL_STATUSES[_0x101449(0xdb)](_0x5933b5)};}export function buildAsyncTaskStatusCommand(_0x2f7f67,_0x2423be){const _0x21db71=a46_0x3ad6fc;return CLI_BIN_NAME+_0x21db71(0xd6)+quoteShellArg(_0x2f7f67)+_0x21db71(0xd5)+quoteShellArg(_0x2423be)+'\x20--format\x20compress';}function a46_0x58f4(_0xa2cbff,_0x50e5f0){_0xa2cbff=_0xa2cbff-0xcc;const _0xf0aa81=a46_0xf0aa();let _0x58f419=_0xf0aa81[_0xa2cbff];return _0x58f419;}export function asyncTaskMessage(_0x1afca6){const _0x49161c=a46_0x3ad6fc;switch(_0x1afca6[_0x49161c(0xd7)]){case _0x49161c(0xed):return _0x49161c(0xee)+_0x1afca6['taskId']+_0x49161c(0xde);case _0x49161c(0xd3):return _0x49161c(0xee)+_0x1afca6[_0x49161c(0xcc)]+_0x49161c(0xd4);case _0x49161c(0xcf):return _0x49161c(0xee)+_0x1afca6[_0x49161c(0xcc)]+_0x49161c(0xe0);case _0x49161c(0xe3):return _0x1afca6['errorMessage']?_0x49161c(0xee)+_0x1afca6['taskId']+_0x49161c(0xda)+_0x1afca6[_0x49161c(0xdd)]:_0x49161c(0xee)+_0x1afca6[_0x49161c(0xcc)]+_0x49161c(0xe1);default:return _0x49161c(0xee)+_0x1afca6[_0x49161c(0xcc)]+_0x49161c(0xce)+_0x1afca6[_0x49161c(0xd7)]+'.';}}function quoteShellArg(_0x5c121a){const _0x513a26=a46_0x3ad6fc;return'\x27'+_0x5c121a[_0x513a26(0xe7)](/'/g,_0x513a26(0xe8))+'\x27';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a47_0x326e(_0x332881,_0x57cfa5){_0x332881=_0x332881-0x19f;var _0x5e93bd=a47_0x5e93();var _0x326ee6=_0x5e93bd[_0x332881];return _0x326ee6;}function a47_0x5e93(){var _0x5f1522=['method','2393937QLjmTT','376152DFdLEF','url','2254090eyKTxF','4ekhzSo','1932504jCyXhG','1799816rJdAUC','810WRWkkR','description','4708qiVkIY','1280hPiRcY','7IYbxHy','472vphQyo'];a47_0x5e93=function(){return _0x5f1522;};return a47_0x5e93();}(function(_0x57a408,_0xf29bc5){var _0x475c4f=a47_0x326e,_0x5cc100=_0x57a408();while(!![]){try{var _0xc886b8=parseInt(_0x475c4f(0x1a4))/0x1*(parseInt(_0x475c4f(0x1a2))/0x2)+-parseInt(_0x475c4f(0x1a7))/0x3*(parseInt(_0x475c4f(0x1aa))/0x4)+parseInt(_0x475c4f(0x1a9))/0x5+-parseInt(_0x475c4f(0x1ab))/0x6+parseInt(_0x475c4f(0x1a3))/0x7*(parseInt(_0x475c4f(0x1ac))/0x8)+-parseInt(_0x475c4f(0x1a6))/0x9+-parseInt(_0x475c4f(0x19f))/0xa*(parseInt(_0x475c4f(0x1a1))/0xb);if(_0xc886b8===_0xf29bc5)break;else _0x5cc100['push'](_0x5cc100['shift']());}catch(_0x389adf){_0x5cc100['push'](_0x5cc100['shift']());}}}(a47_0x5e93,0x38172));export function asDryRunResult(_0x363f79,_0x250c30){var _0x5799b2=a47_0x326e;return Object['defineProperties'](_0x363f79,{'method':{'value':_0x250c30[_0x5799b2(0x1a5)],'enumerable':![]},'url':{'value':_0x250c30[_0x5799b2(0x1a8)],'enumerable':![]},..._0x250c30[_0x5799b2(0x1a0)]?{'description':{'value':_0x250c30[_0x5799b2(0x1a0)],'enumerable':![]}}:{}});}
|