@lovrabet/rabetbase-cli 2.5.1-beta.1 → 2.5.1-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/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.d.ts +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.d.ts +107 -0
- package/lib/commands/dataset/field-restore.js +1 -0
- 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.d.ts +36 -0
- package/lib/commands/dataset/user-deleted-field-list.js +1 -0
- 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.d.ts +28 -0
- package/lib/commands/deployment/auto-sync.js +1 -0
- package/lib/commands/deployment/index.d.ts +2 -0
- package/lib/commands/deployment/index.js +1 -0
- package/lib/commands/deployment/sync.d.ts +2 -0
- package/lib/commands/deployment/sync.js +1 -0
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/deployment-sync.d.ts +10 -0
- package/lib/config/deployment-sync.js +1 -0
- package/lib/config/domain-config.d.ts +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-routing.js +1 -1
- package/lib/config/schema.d.ts +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.d.ts +2 -0
- 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.d.ts +2 -0
- 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 +35 -16
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/kb-search-client.d.ts +30 -0
- package/lib/core/kb-search-client.js +1 -0
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.d.ts +5 -0
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +12 -6
- package/skills/rabetbase/references/rabetbase-config.md +4 -1
- package/skills/rabetbase/references/rabetbase-dataset-business-group-update.md +9 -9
- package/skills/rabetbase/references/rabetbase-dataset-business-groups.md +1 -1
- package/skills/rabetbase/references/rabetbase-dataset-field-restore.md +59 -0
- package/skills/rabetbase/references/rabetbase-dataset-user-deleted-field-list.md +47 -0
- package/skills/rabetbase/references/rabetbase-deployment-sync.md +92 -0
- package/skills/rabetbase/references/rabetbase-doctor.md +1 -1
- package/skills/rabetbase/references/rabetbase-init.md +2 -0
- package/skills/rabetbase/references/rabetbase-kb.md +7 -7
- package/skills/rabetbase.manifest.json +6 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x575f3f,_0x2e9efb){const _0x1cf7b2=a34_0x3fc1,_0xe4b506=_0x575f3f();while(!![]){try{const _0x4f1758=-parseInt(_0x1cf7b2(0xe1))/0x1+-parseInt(_0x1cf7b2(0xe0))/0x2+-parseInt(_0x1cf7b2(0xde))/0x3+-parseInt(_0x1cf7b2(0xe2))/0x4*(parseInt(_0x1cf7b2(0xdc))/0x5)+parseInt(_0x1cf7b2(0xdf))/0x6+-parseInt(_0x1cf7b2(0xdb))/0x7+parseInt(_0x1cf7b2(0xdd))/0x8;if(_0x4f1758===_0x2e9efb)break;else _0xe4b506['push'](_0xe4b506['shift']());}catch(_0x89b3f5){_0xe4b506['push'](_0xe4b506['shift']());}}}(a34_0xf6a6,0x314f2));import{bffList}from'../../commands/bff/list.js';import{bffDetail}from'../../commands/bff/detail.js';import{bffStatus}from'../../commands/bff/status.js';import{bffCreate}from'../../commands/bff/create.js';import{bffPush}from'../../commands/bff/push.js';import{bffPull}from'../../commands/bff/pull.js';function a34_0x3fc1(_0x33532a,_0x487f95){_0x33532a=_0x33532a-0xdb;const _0xf6a6f3=a34_0xf6a6();let _0x3fc131=_0xf6a6f3[_0x33532a];return _0x3fc131;}import{bffDelete}from'../../commands/bff/delete.js';function a34_0xf6a6(){const _0x4a3cc8=['448965ynfaTi','601032fCTlUu','75900cpNmso','51869hjBsgY','20vJrzZD','2100511KzWbjS','336460lBSzfA','7822440sLDPyf'];a34_0xf6a6=function(){return _0x4a3cc8;};return a34_0xf6a6();}export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a35_0x5479(_0x12ff8c,_0x353f7a){_0x12ff8c=_0x12ff8c-0x13f;const _0x12187d=a35_0x1218();let _0x547981=_0x12187d[_0x12ff8c];return _0x547981;}const a35_0x16a88d=a35_0x5479;(function(_0x100c87,_0x14874b){const _0x422b3e=a35_0x5479,_0x36de47=_0x100c87();while(!![]){try{const _0x5b1221=parseInt(_0x422b3e(0x148))/0x1+-parseInt(_0x422b3e(0x157))/0x2+-parseInt(_0x422b3e(0x140))/0x3+-parseInt(_0x422b3e(0x151))/0x4+parseInt(_0x422b3e(0x14b))/0x5*(-parseInt(_0x422b3e(0x156))/0x6)+-parseInt(_0x422b3e(0x152))/0x7+-parseInt(_0x422b3e(0x155))/0x8*(-parseInt(_0x422b3e(0x159))/0x9);if(_0x5b1221===_0x14874b)break;else _0x36de47['push'](_0x36de47['shift']());}catch(_0x18f24c){_0x36de47['push'](_0x36de47['shift']());}}}(a35_0x1218,0xbf797));function a35_0x1218(){const _0x2530bb=['348484aArBnZ','9489452yqeFiy','list','type','32GyeMzq','7248UKtWjw','2336236PGZuXo','(unnamed)','12120066SxsMfQ','No\x20Backend\x20Function\x20scripts\x20found.','Filter\x20by\x20script\x20name','1547028qoDaHK','List\x20Backend\x20Function\x20scripts','boolean','appCode','COMMON','scriptType','name','map','52254zIRpPI','Return\x20full\x20script\x20objects','Script\x20type\x20filter','6325nHmJhK','ENDPOINT','string','verbose','bff','length'];a35_0x1218=function(){return _0x2530bb;};return a35_0x1218();}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a35_0x16a88d(0x14f),'command':a35_0x16a88d(0x153),'description':a35_0x16a88d(0x141),'risk':'read','flags':[{'name':a35_0x16a88d(0x154),'type':a35_0x16a88d(0x14d),'description':a35_0x16a88d(0x14a),'default':a35_0x16a88d(0x14c),'enum':[a35_0x16a88d(0x14c),a35_0x16a88d(0x144)]},{'name':'name','type':a35_0x16a88d(0x14d),'description':a35_0x16a88d(0x13f)},{'name':a35_0x16a88d(0x14e),'type':a35_0x16a88d(0x142),'description':a35_0x16a88d(0x149)}],async 'execute'(_0x114357){const _0x4077cc=a35_0x16a88d,_0x5bf6e6=await listBffScripts(_0x114357[_0x4077cc(0x143)],_0x114357['str'](_0x4077cc(0x154)),{'scriptName':_0x114357['str'](_0x4077cc(0x146))||undefined}),_0x5f0433=_0x114357['bool']('verbose');return{'ok':!![],'data':_0x5f0433?_0x5bf6e6:_0x5bf6e6[_0x4077cc(0x147)](_0x533090=>({'id':_0x533090['id'],'functionName':_0x533090['functionName']??'','description':_0x533090['description']||_0x4077cc(0x158),'scriptType':_0x533090[_0x4077cc(0x145)]})),'message':_0x5bf6e6[_0x4077cc(0x150)]===0x0?_0x4077cc(0x15a):undefined};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x422d76=a36_0x23f1;(function(_0x2348b5,_0x200b5a){const _0x374495=a36_0x23f1,_0x5e1e3f=_0x2348b5();while(!![]){try{const _0x1a94cb=-parseInt(_0x374495(0xab))/0x1+-parseInt(_0x374495(0xe0))/0x2*(-parseInt(_0x374495(0xbe))/0x3)+-parseInt(_0x374495(0x98))/0x4*(-parseInt(_0x374495(0xa6))/0x5)+-parseInt(_0x374495(0xc0))/0x6+-parseInt(_0x374495(0xd5))/0x7+parseInt(_0x374495(0xac))/0x8+-parseInt(_0x374495(0xc8))/0x9;if(_0x1a94cb===_0x200b5a)break;else _0x5e1e3f['push'](_0x5e1e3f['shift']());}catch(_0xdbfa6e){_0x5e1e3f['push'](_0x5e1e3f['shift']());}}}(a36_0x5e6e,0x74a7a));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';function a36_0x5e6e(){const _0x4bf796=['question','nonInteractive','skipped','push','string','local\x20unsynced\x20changes','boolean','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','force','functionName','toLowerCase','\x20failed','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','75948rBhqud','scriptType','522660oMUMIs','validation','includes','parse','cancelled','message','would_pull','\x20skipped,\x20','9621468MGKrHK','Remote\x20script\x20missing\x20id.','datasetCode','Pull\x20complete:\x20','&type=','Force\x20overwrite\x20local\x20unsynced\x20changes','ENDPOINT','trim','HOOK','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','\x20pulled,\x20','yes','filePath','1680777mmhlXH','length','COMMON','lockKey','bff','/api/management/library/scripts/list?appCode=','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','operationType','utf8','conflict','lastSync','44HKVABN','version','apps','str','1804FHEBfA','hookLocation','stdin','alias','pull','apiDir','Force\x20pull\x20cancelled.','map','hash','Pull\x20only\x20this\x20script\x20type','appCode','scriptContent','toISOString','close','10435cKWske','all','Remote\x20script\x20missing\x20content.','stringify','lockFilePath','145931FRULcb','4174664QuGpjb','scriptsRoot','type','unresolvable\x20target\x20path','functions'];a36_0x5e6e=function(){return _0x4bf796;};return a36_0x5e6e();}import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';function a36_0x23f1(_0xbf33ff,_0x2898f8){_0xbf33ff=_0xbf33ff-0x96;const _0x5e6e01=a36_0x5e6e();let _0x23f1dc=_0x5e6e01[_0xbf33ff];return _0x23f1dc;}import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a36_0x422d76(0xd9),'command':a36_0x422d76(0x9c),'description':a36_0x422d76(0xd1),'risk':'read','flags':[{'name':a36_0x422d76(0xae),'type':a36_0x422d76(0xb5),'description':a36_0x422d76(0xa1),'enum':[a36_0x422d76(0xd7),a36_0x422d76(0xce),'HOOK']},{'name':a36_0x422d76(0xb9),'type':a36_0x422d76(0xb7),'description':a36_0x422d76(0xcd)}],async 'dryRun'(_0x9bbcd8){const _0x3c03db=a36_0x422d76,_0x3437d2=loadBffProjectConfig(_0x9bbcd8[_0x3c03db(0xa2)]),_0x43a74a=await readBffLockFile(_0x3437d2[_0x3c03db(0xaa)]),{appLock:_0x570d82}=ensureLockScope(_0x43a74a??createEmptyBffLock(),_0x9bbcd8['appCode'],_0x3437d2[_0x3c03db(0xad)],_0x3c03db(0x9c)),_0x11c9b1=normalizeBffType(_0x9bbcd8[_0x3c03db(0x97)](_0x3c03db(0xae)))??undefined,_0x4c509c=buildDatasetCodeToAliasMap(_0x9bbcd8['apiDir'],_0x9bbcd8[_0x3c03db(0xa2)]),[_0x54de22,_0x17baef]=await Promise[_0x3c03db(0xa7)]([listBffScripts(_0x9bbcd8[_0x3c03db(0xa2)],_0x11c9b1),getBffScriptStatistics(_0x9bbcd8['appCode'])]),_0x458789=createHookLocationMap(_0x17baef),_0x431f59=[];for(const _0x4853d2 of _0x54de22){const _0x3668b4=resolveRemoteScriptTarget(_0x3437d2,_0x4853d2,_0x458789,_0x570d82[_0x3c03db(0xb0)],_0x4c509c);if(!_0x3668b4){_0x431f59[_0x3c03db(0xb4)]({'scriptType':_0x4853d2[_0x3c03db(0xbf)],'functionName':_0x4853d2[_0x3c03db(0xba)]??'','status':_0x3c03db(0xb3),'reason':'unresolvable\x20target\x20path'});continue;}const _0x4f7cfc=_0x570d82[_0x3c03db(0xb0)][_0x3668b4[_0x3c03db(0xd8)]],_0x412718=_0x4853d2['scriptContent']!=null?computeContentHash(_0x4853d2[_0x3c03db(0xa3)]):undefined,_0x2cf9f1=await hasUnsyncedLocalChanges(_0x3668b4['filePath'],_0x4f7cfc,_0x412718);_0x431f59[_0x3c03db(0xb4)]({'lockKey':_0x3668b4[_0x3c03db(0xd8)],'filePath':_0x3668b4[_0x3c03db(0xd4)],'remoteId':_0x4853d2['id']??null,'status':_0x2cf9f1?_0x3c03db(0xde):_0x3c03db(0xc6)});}return{'method':'GET','url':_0x3c03db(0xda)+_0x9bbcd8[_0x3c03db(0xa2)]+(_0x11c9b1?_0x3c03db(0xcc)+_0x11c9b1:''),'body':{'appCode':_0x9bbcd8['appCode'],'filterType':_0x11c9b1??null,'files':_0x431f59},'description':'Would\x20inspect\x20'+_0x431f59[_0x3c03db(0xd6)]+'\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull'};},async 'execute'(_0x5b2c20){const _0x372126=a36_0x422d76,_0x5c6ff7=loadBffProjectConfig(_0x5b2c20['appCode']),_0x6cef63=await readBffLockFile(_0x5c6ff7['lockFilePath']),{lockData:_0x4c49d0,appLock:_0x22e43b}=ensureLockScope(_0x6cef63??createEmptyBffLock(),_0x5b2c20[_0x372126(0xa2)],_0x5c6ff7[_0x372126(0xad)],_0x372126(0x9c)),_0x3c14da=normalizeBffType(_0x5b2c20[_0x372126(0x97)]('type'))??undefined;if(_0x5b2c20[_0x372126(0x97)]('type')&&!_0x3c14da)throw CliErrors[_0x372126(0xc1)](_0x372126(0xbd));const [_0x3bc4f0,_0x389a95]=await Promise['all']([listBffScripts(_0x5b2c20[_0x372126(0xa2)],_0x3c14da),getBffScriptStatistics(_0x5b2c20[_0x372126(0xa2)])]);if(_0x3bc4f0[_0x372126(0xd6)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x372126(0xdb)};const _0x1c3119=_0x5b2c20['bool'](_0x372126(0xb9));if(_0x1c3119&&!_0x5b2c20[_0x372126(0xb2)]){const _0x1f953b=await confirmForce();if(!_0x1f953b)throw CliErrors[_0x372126(0xc4)](_0x372126(0x9e));}if(_0x1c3119&&_0x5b2c20[_0x372126(0xb2)]){}const _0x215138=buildDatasetCodeToAliasMap(_0x5b2c20[_0x372126(0x9d)],_0x5b2c20[_0x372126(0xa2)]),_0x45b447=createHookLocationMap(_0x389a95),_0x293c40=JSON[_0x372126(0xc3)](JSON[_0x372126(0xa9)](_0x4c49d0)),_0x52b47e=_0x5b2c20[_0x372126(0xa2)],_0x14b748=_0x293c40[_0x372126(0x96)][_0x52b47e];if(!_0x14b748)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x52b47e+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x5f3a9a=[],_0x180c5a=[],_0x51f807=[];for(const _0x4d417e of _0x3bc4f0){const _0x1dca69=resolveRemoteScriptTarget(_0x5c6ff7,_0x4d417e,_0x45b447,_0x22e43b[_0x372126(0xb0)],_0x215138);if(!_0x1dca69){_0x180c5a[_0x372126(0xb4)]({'lockKey':_0x4d417e['scriptType']+'/'+_0x4d417e['functionName'],'reason':_0x372126(0xaf)});continue;}const _0x249100=_0x22e43b['functions'][_0x1dca69['lockKey']];try{if(!_0x4d417e['id'])throw new Error(_0x372126(0xc9));if(_0x4d417e[_0x372126(0xa3)]==null)throw new Error(_0x372126(0xa8));const _0x8dc1e0=_0x4d417e['scriptContent'],_0x2da50c=computeContentHash(_0x8dc1e0);if(!_0x1c3119){const _0x49c35d=await hasUnsyncedLocalChanges(_0x1dca69[_0x372126(0xd4)],_0x249100,_0x2da50c);if(_0x49c35d){_0x180c5a[_0x372126(0xb4)]({'lockKey':_0x1dca69[_0x372126(0xd8)],'reason':_0x372126(0xb6)});continue;}}await ensureParentDirectory(_0x1dca69[_0x372126(0xd4)]),await writeFile(_0x1dca69[_0x372126(0xd4)],_0x8dc1e0,_0x372126(0xdd));const _0xb0429d={'hash':_0x2da50c,'remoteId':_0x4d417e['id'],'version':_0x4d417e[_0x372126(0xe1)]};_0x1dca69[_0x372126(0xae)]===_0x372126(0xd0)&&_0x1dca69[_0x372126(0x99)]&&(_0xb0429d[_0x372126(0x9b)]=_0x1dca69[_0x372126(0x99)][_0x372126(0x9b)],_0xb0429d[_0x372126(0xca)]=_0x1dca69['hookLocation'][_0x372126(0xca)],_0xb0429d[_0x372126(0xdc)]=_0x1dca69[_0x372126(0x99)]['operationType'],_0xb0429d['functionNode']=_0x1dca69['hookLocation']['functionNode']),_0x14b748[_0x372126(0xb0)][_0x1dca69['lockKey']]=_0xb0429d,_0x5f3a9a[_0x372126(0xb4)]({'lockKey':_0x1dca69[_0x372126(0xd8)],'remoteId':_0x4d417e['id']});}catch(_0x14d68f){_0x51f807[_0x372126(0xb4)]({'lockKey':_0x1dca69[_0x372126(0xd8)],'error':_0x14d68f instanceof Error?_0x14d68f[_0x372126(0xc5)]:String(_0x14d68f)});}}return _0x14b748[_0x372126(0xdf)]=new Date()[_0x372126(0xa4)](),await writeBffLockFile(_0x5c6ff7[_0x372126(0xaa)],_0x293c40),{'ok':_0x51f807[_0x372126(0xd6)]===0x0,'data':{'pulled':_0x5f3a9a,'skipped':_0x180c5a,'failed':_0x51f807},'message':_0x372126(0xcb)+_0x5f3a9a[_0x372126(0xd6)]+_0x372126(0xd2)+_0x180c5a['length']+_0x372126(0xc7)+_0x51f807[_0x372126(0xd6)]+_0x372126(0xbc)};}};async function hasUnsyncedLocalChanges(_0xf3bdce,_0x4db674,_0x3def85){const _0x5f1d04=a36_0x422d76;if(!await fileExists(_0xf3bdce))return![];const _0x13665d=await computeFileHash(_0xf3bdce);if(!_0x4db674)return _0x3def85?_0x13665d!==_0x3def85:!![];return _0x13665d!==_0x4db674[_0x5f1d04(0xa0)];}function buildDatasetCodeToAliasMap(_0x207169,_0x14c130){const _0x570f06=a36_0x422d76,_0x81715a=loadAliasMap(_0x207169,undefined,resolveApiFilePath(_0x207169,_0x14c130));return new Map(_0x81715a[_0x570f06(0x9f)](_0x5d82e9=>[_0x5d82e9[_0x570f06(0xca)],_0x5d82e9['alias']]));}async function confirmForce(){const _0x462d3c=a36_0x422d76,_0x4a3fd5=createInterface({'input':process[_0x462d3c(0x9a)],'output':process['stderr']}),_0x475b6f=await new Promise(_0x23d693=>{const _0x5a518b=_0x462d3c;_0x4a3fd5[_0x5a518b(0xb1)](_0x5a518b(0xb8),_0x23d693);});return _0x4a3fd5[_0x462d3c(0xa5)](),['y',_0x462d3c(0xd3)][_0x462d3c(0xc2)](_0x475b6f[_0x462d3c(0xcf)]()[_0x462d3c(0xbb)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a37_0x440f53=a37_0x2171;(function(_0x45eeb8,_0x521915){const _0x279f8a=a37_0x2171,_0x548bac=_0x45eeb8();while(!![]){try{const _0x2fbd34=parseInt(_0x279f8a(0xa1))/0x1*(-parseInt(_0x279f8a(0xa8))/0x2)+-parseInt(_0x279f8a(0x8a))/0x3*(-parseInt(_0x279f8a(0xa3))/0x4)+parseInt(_0x279f8a(0xb0))/0x5+-parseInt(_0x279f8a(0x94))/0x6+-parseInt(_0x279f8a(0x69))/0x7+-parseInt(_0x279f8a(0x65))/0x8+parseInt(_0x279f8a(0xb1))/0x9*(parseInt(_0x279f8a(0x81))/0xa);if(_0x2fbd34===_0x521915)break;else _0x548bac['push'](_0x548bac['shift']());}catch(_0x48d213){_0x548bac['push'](_0x548bac['shift']());}}}(a37_0x4de5,0xa954c));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a37_0x4de5(){const _0x18d681=['would_push','write','boolean','\x22\x20not\x20found\x20after\x20ensureLockScope.','filePath','1178000nLmuWu','18341847vqrdje','POST','force','runtime\x20cache\x20clear\x20failed','6543432nEOmGW','get','name','scriptsRoot','2699284dYXpNK','functions','code','stringify','unchanged','some','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','push','datasetCode','Lock\x20scope\x20for\x20app\x20\x22','runtime\x20cache\x20cleared','\x22.\x20','status','Would\x20inspect\x20','runtime\x20cache\x20not\x20needed','Force\x20push\x20ignoring\x20hash\x20protection','parse','script','description','apiDir','create','filter','lockFilePath','Push\x20complete:\x20','10tUyUEo','str','operationType','\x20skipped,\x20','has','HOOK','values','alias','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','3uXtkRu','validation','datasetId','aliasToDatasetCode','message','bool','\x20failed,\x20','type','\x20uploaded,\x20','Cannot\x20resolve\x20dataset\x20for\x20\x22','2521776rKwbZM','Local\x20function\x20not\x20found:\x20','/api/management/library/scripts/save','attempted','Runtime\x20script\x20cache\x20cleared.','cleared','version','appCode','toISOString','every','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','update','functionNode','1xTmRmd','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','2901668nWoNgB','lockKey','length','No\x20local\x20Backend\x20Function\x20scripts\x20found.','remoteId','1363166kPGLlr','map','COMMON'];a37_0x4de5=function(){return _0x18d681;};return a37_0x4de5();}import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';function a37_0x2171(_0x47efb1,_0x177845){_0x47efb1=_0x47efb1-0x64;const _0x4de512=a37_0x4de5();let _0x2171d9=_0x4de512[_0x47efb1];return _0x2171d9;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':a37_0x440f53(0x70),'description':'Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','risk':a37_0x440f53(0xac),'flags':[{'name':a37_0x440f53(0x91),'type':'string','description':'Push\x20only\x20this\x20script\x20type','enum':[a37_0x440f53(0xaa),'ENDPOINT',a37_0x440f53(0x86)]},{'name':a37_0x440f53(0x67),'type':'string','description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':a37_0x440f53(0xb3),'type':a37_0x440f53(0xad),'description':a37_0x440f53(0x78)}],async 'dryRun'(_0x176476){const _0x344aa6=a37_0x440f53,_0x3e1a4a=loadBffProjectConfig(_0x176476[_0x344aa6(0x9b)]),_0x2c607b=await readBffLockFile(_0x3e1a4a['lockFilePath']),{appLock:_0x137f2f}=ensureLockScope(_0x2c607b??createEmptyBffLock(),_0x176476[_0x344aa6(0x9b)],_0x3e1a4a['scriptsRoot'],'push'),_0x30d1ef=await getTargetFunctions(_0x3e1a4a,_0x176476),_0x1859a4=_0x176476[_0x344aa6(0x8f)](_0x344aa6(0xb3)),_0x530e3f=[];for(const _0x4512b4 of _0x30d1ef){const _0x1566ce=await computeFileHash(_0x4512b4[_0x344aa6(0xaf)]),_0x448cd7=_0x137f2f[_0x344aa6(0x6a)][_0x4512b4[_0x344aa6(0xa4)]],_0x248979=!!_0x448cd7&&_0x448cd7['hash']===_0x1566ce;_0x530e3f[_0x344aa6(0x70)]({'lockKey':_0x4512b4[_0x344aa6(0xa4)],'filePath':_0x4512b4[_0x344aa6(0xaf)],'remoteId':_0x448cd7?.[_0x344aa6(0xa7)]??null,'mode':_0x448cd7?.['remoteId']?_0x344aa6(0x9f):_0x344aa6(0x7d),'status':!_0x1859a4&&_0x248979?'unchanged':_0x344aa6(0xab)});}return{'method':_0x344aa6(0xb2),'url':_0x344aa6(0x96),'body':{'appCode':_0x176476[_0x344aa6(0x9b)],'force':_0x1859a4,'files':_0x530e3f,'cacheClearAtRuntime':_0x530e3f[_0x344aa6(0x6e)](_0x737f97=>_0x737f97[_0x344aa6(0x75)]===_0x344aa6(0xab)),'cacheClearAtRuntimeTimes':_0x530e3f[_0x344aa6(0x6e)](_0x292484=>_0x292484[_0x344aa6(0x75)]==='would_push')?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x344aa6(0x76)+_0x530e3f['length']+_0x344aa6(0x6f)};},async 'execute'(_0x3875ee){const _0x45b4cb=a37_0x440f53,_0x1d6b9f=loadBffProjectConfig(_0x3875ee['appCode']),_0x48f29b=await readBffLockFile(_0x1d6b9f['lockFilePath']),{lockData:_0x5b47fb,appLock:_0x4d0c31}=ensureLockScope(_0x48f29b??createEmptyBffLock(),_0x3875ee['appCode'],_0x1d6b9f[_0x45b4cb(0x68)],_0x45b4cb(0x70)),_0x4dd21f=await getTargetFunctions(_0x1d6b9f,_0x3875ee);if(_0x4dd21f[_0x45b4cb(0xa5)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x45b4cb(0xa6)};const _0x3f471f=_0x3875ee[_0x45b4cb(0x8f)]('force'),_0x4b2c12=JSON[_0x45b4cb(0x79)](JSON[_0x45b4cb(0x6c)](_0x5b47fb)),_0x43bb00=_0x4b2c12['apps'][_0x3875ee[_0x45b4cb(0x9b)]];if(!_0x43bb00)throw new Error(_0x45b4cb(0x72)+_0x3875ee[_0x45b4cb(0x9b)]+_0x45b4cb(0xae));const _0x40da18=await buildHookMaps(_0x3875ee[_0x45b4cb(0x9b)],_0x3875ee[_0x45b4cb(0x7c)],_0x4dd21f,_0x43bb00),_0x44b9cd=[],_0x161157=[],_0x544d8f=[];for(const _0x29abf9 of _0x4dd21f){const _0xd0f0a=await computeFileHash(_0x29abf9[_0x45b4cb(0xaf)]),_0x574e22=_0x43bb00[_0x45b4cb(0x6a)][_0x29abf9['lockKey']];if(!_0x3f471f&&_0x574e22&&_0x574e22['hash']===_0xd0f0a){_0x161157['push']({'lockKey':_0x29abf9[_0x45b4cb(0xa4)],'reason':_0x45b4cb(0x6d)});continue;}try{await uploadSingleFunction(_0x3875ee['appCode'],_0x29abf9,_0x43bb00,_0x40da18);const _0x5bf9f1=_0x43bb00[_0x45b4cb(0x6a)][_0x29abf9[_0x45b4cb(0xa4)]];_0x44b9cd[_0x45b4cb(0x70)]({'lockKey':_0x29abf9[_0x45b4cb(0xa4)],'remoteId':_0x5bf9f1?.[_0x45b4cb(0xa7)]??0x0});}catch(_0x41ef98){_0x544d8f[_0x45b4cb(0x70)]({'lockKey':_0x29abf9[_0x45b4cb(0xa4)],'error':_0x41ef98 instanceof Error?_0x41ef98[_0x45b4cb(0x8e)]:String(_0x41ef98)});}}_0x43bb00['lastSync']=new Date()[_0x45b4cb(0x9c)](),await writeBffLockFile(_0x1d6b9f[_0x45b4cb(0x7f)],_0x4b2c12),await waitForUploadedLockEntries(_0x1d6b9f['lockFilePath'],_0x3875ee['appCode'],_0x44b9cd[_0x45b4cb(0xa9)](_0x3ec19f=>_0x3ec19f[_0x45b4cb(0xa4)]));let _0x5b9b5f={'attempted':![],'cleared':![]};if(_0x44b9cd[_0x45b4cb(0xa5)]>0x0)try{let _0x2d27f4='';for(let _0x34c559=0x0;_0x34c559<CACHE_CLEAR_ATTEMPTS;_0x34c559+=0x1){_0x2d27f4=await clearBffScriptCache(),_0x34c559<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x5b9b5f={'attempted':!![],'cleared':!![],'message':_0x2d27f4||_0x45b4cb(0x98)};}catch(_0xd6072e){_0x5b9b5f={'attempted':!![],'cleared':![],'error':_0xd6072e instanceof Error?_0xd6072e['message']:String(_0xd6072e)};}const _0x34da1f=_0x544d8f[_0x45b4cb(0xa5)]===0x0&&(_0x5b9b5f[_0x45b4cb(0x97)]?_0x5b9b5f[_0x45b4cb(0x99)]:!![]),_0x73a556=_0x5b9b5f[_0x45b4cb(0x97)]?_0x5b9b5f[_0x45b4cb(0x99)]?_0x45b4cb(0x73):_0x45b4cb(0x64):_0x45b4cb(0x77);return{'ok':_0x34da1f,'data':{'uploaded':_0x44b9cd,'skipped':_0x161157,'failed':_0x544d8f,'cacheClear':_0x5b9b5f},'message':_0x45b4cb(0x80)+_0x44b9cd[_0x45b4cb(0xa5)]+_0x45b4cb(0x92)+_0x161157['length']+_0x45b4cb(0x84)+_0x544d8f[_0x45b4cb(0xa5)]+_0x45b4cb(0x90)+_0x73a556};}};async function getTargetFunctions(_0x140211,_0x2bb6da){const _0x2ee5f4=a37_0x440f53,_0x18f02a=_0x2bb6da[_0x2ee5f4(0x82)]('type'),_0x4a4d99=_0x2bb6da[_0x2ee5f4(0x82)](_0x2ee5f4(0x67)),_0x6b772=normalizeBffType(_0x18f02a)??undefined;if(_0x4a4d99&&!_0x6b772)throw CliErrors[_0x2ee5f4(0x8b)](_0x2ee5f4(0x89));const _0x5cbb50=await scanLocalBffFunctions(_0x140211,_0x6b772);if(_0x4a4d99){const _0x4c3a9d=_0x5cbb50[_0x2ee5f4(0x7e)](_0x26d25d=>_0x26d25d[_0x2ee5f4(0x67)]===_0x4a4d99);if(_0x4c3a9d[_0x2ee5f4(0xa5)]===0x0)throw CliErrors[_0x2ee5f4(0x8b)](_0x2ee5f4(0x95)+_0x6b772+'/'+_0x4a4d99);return _0x4c3a9d;}return _0x5cbb50;}async function buildHookMaps(_0x5c3966,_0x40f917,_0x53ef7e,_0x12dc20){const _0xe9b921=a37_0x440f53,_0x115a81=_0x53ef7e[_0xe9b921(0x6e)](_0x28f12a=>_0x28f12a[_0xe9b921(0x91)]==='HOOK');if(!_0x115a81)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0xcc4e87=loadAliasMap(_0x40f917,undefined,resolveApiFilePath(_0x40f917,_0x5c3966)),_0x1f0e4c=new Map(_0xcc4e87[_0xe9b921(0xa9)](_0x1d3c24=>[_0x1d3c24[_0xe9b921(0x88)],_0x1d3c24[_0xe9b921(0x71)]]));for(const _0x2b376f of Object[_0xe9b921(0x87)](_0x12dc20['functions'])){_0x2b376f[_0xe9b921(0x88)]&&_0x2b376f[_0xe9b921(0x71)]&&!_0x1f0e4c[_0xe9b921(0x85)](_0x2b376f[_0xe9b921(0x88)])&&_0x1f0e4c['set'](_0x2b376f[_0xe9b921(0x88)],_0x2b376f[_0xe9b921(0x71)]);}const _0x299ecb=await listDatasets(_0x5c3966),_0x1e4da6=new Map(_0x299ecb['map'](_0x18f9e2=>[_0x18f9e2[_0xe9b921(0x6b)],_0x18f9e2]));return{'aliasToDatasetCode':_0x1f0e4c,'datasetCodeToDataset':_0x1e4da6};}async function uploadSingleFunction(_0x5ddff2,_0x41f265,_0x530074,_0x129f08){const _0x1e2a43=a37_0x440f53,_0x49fe69=await readFile(_0x41f265['filePath'],'utf8'),_0x34173f=await computeFileHash(_0x41f265[_0x1e2a43(0xaf)]),_0x4f96a8=_0x530074[_0x1e2a43(0x6a)][_0x41f265['lockKey']];if(_0x4f96a8?.[_0x1e2a43(0xa7)]&&_0x4f96a8[_0x1e2a43(0x9a)]==null)throw CliErrors[_0x1e2a43(0x8b)](_0x41f265[_0x1e2a43(0xa4)]+':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.');let _0x475b6a=extractScriptDescription(_0x49fe69);if(!_0x475b6a&&_0x4f96a8?.[_0x1e2a43(0xa7)]){const _0xf40c1d=await getBffScriptInfo(_0x4f96a8[_0x1e2a43(0xa7)]);_0x475b6a=_0xf40c1d['description']||undefined;}const _0x4def52={'appCode':_0x5ddff2,'functionName':_0x41f265['name'],'scriptType':_0x41f265['type'],'scriptContent':_0x49fe69};if(_0x4f96a8?.[_0x1e2a43(0xa7)])_0x4def52['id']=_0x4f96a8[_0x1e2a43(0xa7)];if(_0x4f96a8?.[_0x1e2a43(0x9a)]!=null)_0x4def52[_0x1e2a43(0x9a)]=_0x4f96a8[_0x1e2a43(0x9a)];if(_0x475b6a)_0x4def52[_0x1e2a43(0x7b)]=_0x475b6a;if(_0x41f265[_0x1e2a43(0x91)]===_0x1e2a43(0x86)){const _0x9c56f8=_0x41f265[_0x1e2a43(0x88)];if(!_0x9c56f8||!_0x41f265['operationType']||!_0x41f265['functionNode'])throw CliErrors[_0x1e2a43(0x8b)]('Incomplete\x20HOOK\x20path:\x20'+_0x41f265[_0x1e2a43(0xa4)]);const _0x1d3eb3=_0x129f08[_0x1e2a43(0x8d)][_0x1e2a43(0x66)](_0x9c56f8)??_0x4f96a8?.[_0x1e2a43(0x71)]??_0x9c56f8,_0x3f0805=_0x129f08['datasetCodeToDataset'][_0x1e2a43(0x66)](_0x1d3eb3);if(!_0x3f0805)throw CliErrors[_0x1e2a43(0x8b)](_0x1e2a43(0x93)+_0x9c56f8+_0x1e2a43(0x74)+('Run\x20`'+CLI_BIN_NAME+_0x1e2a43(0xa2)));_0x4def52[_0x1e2a43(0x8c)]=_0x3f0805['id'],_0x4def52['operationType']=_0x41f265[_0x1e2a43(0x83)],_0x4def52[_0x1e2a43(0xa0)]=_0x41f265['functionNode'];}const _0x17f0f1=await saveBffScript(_0x4def52),_0x472b5e=_0x17f0f1['id'],_0x313ece=_0x17f0f1[_0x1e2a43(0x7a)]??await getBffScriptInfo(_0x472b5e),_0x1e36aa={'hash':_0x34173f,'remoteId':_0x472b5e,'version':_0x313ece[_0x1e2a43(0x9a)]};if(_0x41f265['type']===_0x1e2a43(0x86)){const _0x2141a2=_0x41f265[_0x1e2a43(0x88)],_0x1d1cf7=_0x129f08['aliasToDatasetCode'][_0x1e2a43(0x66)](_0x2141a2)??_0x4f96a8?.[_0x1e2a43(0x71)]??_0x2141a2;_0x129f08['aliasToDatasetCode'][_0x1e2a43(0x85)](_0x2141a2)?_0x1e36aa[_0x1e2a43(0x88)]=_0x2141a2:_0x1e36aa[_0x1e2a43(0x88)]=_0x4f96a8?.[_0x1e2a43(0x88)],_0x1e36aa[_0x1e2a43(0x71)]=_0x1d1cf7,_0x1e36aa[_0x1e2a43(0x83)]=_0x41f265[_0x1e2a43(0x83)],_0x1e36aa[_0x1e2a43(0xa0)]=_0x41f265[_0x1e2a43(0xa0)];}_0x530074[_0x1e2a43(0x6a)][_0x41f265[_0x1e2a43(0xa4)]]=_0x1e36aa;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x3b4031,_0x297fa3,_0x1a2827){const _0x539438=a37_0x440f53;if(_0x1a2827[_0x539438(0xa5)]===0x0)return;for(let _0xf0b348=0x0;_0xf0b348<LOCK_SETTLE_RETRY_COUNT;_0xf0b348+=0x1){const _0x3a29fc=await readBffLockFile(_0x3b4031),_0x482658=_0x3a29fc?.['apps']?.[_0x297fa3]?.[_0x539438(0x6a)]??{},_0x312d7f=_0x1a2827[_0x539438(0x9d)](_0xc19f56=>!!_0x482658[_0xc19f56]?.['remoteId']);if(_0x312d7f)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x539438(0x9e)+_0x1a2827['join'](',\x20')+'.');}
|
|
1
|
+
function a37_0x16c3(){const _0x5e05f4=['operationType','cleared','version','bff','apps','3QERyIK','datasetCodeToDataset','3472hxsDiQ','functions','filePath','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','remoteId','scriptsRoot','push','utf8','validation','hash','Incomplete\x20HOOK\x20path:\x20','\x22\x20not\x20found\x20after\x20ensureLockScope.','623466pJZxrh','2255512ZWOxrq','bool','datasetCode','alias','/api/management/library/scripts/save','toISOString','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','810780FGYGlj','name','description','1648cJkxgK','type','force','would_push','lastSync','functionNode','configured','status','Run\x20`','\x22.\x20','apiDir','map','attempted','runtime\x20cache\x20clear\x20failed','aliasToDatasetCode','unchanged','string','appCode','3714222nSECPx','\x20failed,\x20','runtime\x20cache\x20not\x20needed','join','str','HOOK','lockFilePath','length','No\x20local\x20Backend\x20Function\x20scripts\x20found.','code',',\x20deployment\x20sync\x20','stringify','240395dnVJSb','has','Cannot\x20resolve\x20dataset\x20for\x20\x22','7876728xpMsQA','Local\x20function\x20not\x20found:\x20','COMMON','Runtime\x20script\x20cache\x20cleared.','filter','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','POST','create','get','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','some','\x20uploaded,\x20','message','Lock\x20scope\x20for\x20app\x20\x22','Push\x20only\x20this\x20script\x20type','lockKey','Force\x20push\x20ignoring\x20hash\x20protection'];a37_0x16c3=function(){return _0x5e05f4;};return a37_0x16c3();}const a37_0x42ede9=a37_0x40d1;(function(_0x30d441,_0x3a69c7){const _0x385196=a37_0x40d1,_0x457621=_0x30d441();while(!![]){try{const _0x44cd93=-parseInt(_0x385196(0xca))/0x1+-parseInt(_0x385196(0xcb))/0x2*(-parseInt(_0x385196(0xbc))/0x3)+parseInt(_0x385196(0xd2))/0x4+parseInt(_0x385196(0xf3))/0x5+parseInt(_0x385196(0xe7))/0x6+-parseInt(_0x385196(0xbe))/0x7*(-parseInt(_0x385196(0xd5))/0x8)+-parseInt(_0x385196(0xf6))/0x9;if(_0x44cd93===_0x3a69c7)break;else _0x457621['push'](_0x457621['shift']());}catch(_0x50ba4c){_0x457621['push'](_0x457621['shift']());}}}(a37_0x16c3,0x92bfd));import{readFile}from'node:fs/promises';function a37_0x40d1(_0x5cf75a,_0x4adb56){_0x5cf75a=_0x5cf75a-0xb6;const _0x16c388=a37_0x16c3();let _0x40d18c=_0x16c388[_0x5cf75a];return _0x40d18c;}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,validateAutomaticDeploymentSync}from'../../commands/deployment/auto-sync.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':a37_0x42ede9(0xba),'command':a37_0x42ede9(0xc4),'description':a37_0x42ede9(0xfb),'risk':'write','flags':[{'name':a37_0x42ede9(0xd6),'type':a37_0x42ede9(0xe5),'description':a37_0x42ede9(0x104),'enum':[a37_0x42ede9(0xf8),'ENDPOINT','HOOK']},{'name':a37_0x42ede9(0xd3),'type':a37_0x42ede9(0xe5),'description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':a37_0x42ede9(0xd7),'type':'boolean','description':a37_0x42ede9(0xb6)}],async 'validate'(_0x1558a3){validateAutomaticDeploymentSync(_0x1558a3);},async 'dryRun'(_0x2ff5fc){const _0x373901=a37_0x42ede9,_0x45d215=loadBffProjectConfig(_0x2ff5fc['appCode']),_0x253e7a=await readBffLockFile(_0x45d215[_0x373901(0xed)]),{appLock:_0x5ef257}=ensureLockScope(_0x253e7a??createEmptyBffLock(),_0x2ff5fc[_0x373901(0xe6)],_0x45d215['scriptsRoot'],_0x373901(0xc4)),_0x13c7c9=await getTargetFunctions(_0x45d215,_0x2ff5fc),_0x59dd5e=_0x2ff5fc[_0x373901(0xcc)](_0x373901(0xd7)),_0x31c837=[],_0x13ac11=[];for(const _0x423703 of _0x13c7c9){const _0x481ae2=await computeFileHash(_0x423703[_0x373901(0xc0)]),_0x26bbff=_0x5ef257[_0x373901(0xbf)][_0x423703[_0x373901(0x105)]],_0x30a2df=!!_0x26bbff&&_0x26bbff[_0x373901(0xc7)]===_0x481ae2,_0x37fae1=!_0x59dd5e&&_0x30a2df?_0x373901(0xe4):_0x373901(0xd8);_0x31c837[_0x373901(0xc4)]({'lockKey':_0x423703[_0x373901(0x105)],'filePath':_0x423703[_0x373901(0xc0)],'remoteId':_0x26bbff?.[_0x373901(0xc2)]??null,'mode':_0x26bbff?.['remoteId']?'update':_0x373901(0xfd),'status':_0x37fae1});if(_0x37fae1===_0x373901(0xd8))_0x13ac11['push'](_0x423703[_0x373901(0xd3)]);}return{'method':_0x373901(0xfc),'url':_0x373901(0xcf),'deploymentSync':buildAutomaticDeploymentSyncPreview(_0x2ff5fc,_0x373901(0xba),_0x13ac11),'body':{'appCode':_0x2ff5fc[_0x373901(0xe6)],'force':_0x59dd5e,'files':_0x31c837,'cacheClearAtRuntime':_0x31c837[_0x373901(0x100)](_0x592fc7=>_0x592fc7[_0x373901(0xdc)]==='would_push'),'cacheClearAtRuntimeTimes':_0x31c837[_0x373901(0x100)](_0x5a2f9e=>_0x5a2f9e['status']===_0x373901(0xd8))?CACHE_CLEAR_ATTEMPTS:0x0},'description':'Would\x20inspect\x20'+_0x31c837[_0x373901(0xee)]+_0x373901(0xd1)};},async 'execute'(_0x2e2ee6){const _0x470d4a=a37_0x42ede9,_0x4217ce=loadBffProjectConfig(_0x2e2ee6['appCode']),_0x2c47aa=await readBffLockFile(_0x4217ce['lockFilePath']),{lockData:_0x13612e,appLock:_0x50e8a5}=ensureLockScope(_0x2c47aa??createEmptyBffLock(),_0x2e2ee6[_0x470d4a(0xe6)],_0x4217ce[_0x470d4a(0xc3)],_0x470d4a(0xc4)),_0x491da4=await getTargetFunctions(_0x4217ce,_0x2e2ee6);if(_0x491da4[_0x470d4a(0xee)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x470d4a(0xef)};const _0x12d737=_0x2e2ee6[_0x470d4a(0xcc)]('force'),_0x39a3fd=JSON['parse'](JSON[_0x470d4a(0xf2)](_0x13612e)),_0x360516=_0x39a3fd[_0x470d4a(0xbb)][_0x2e2ee6['appCode']];if(!_0x360516)throw new Error(_0x470d4a(0x103)+_0x2e2ee6[_0x470d4a(0xe6)]+_0x470d4a(0xc9));const _0xdd4a05=await buildHookMaps(_0x2e2ee6[_0x470d4a(0xe6)],_0x2e2ee6[_0x470d4a(0xdf)],_0x491da4,_0x360516),_0x7a9cb6=[],_0x20852d=[],_0xf86bd2=[],_0xbbcdde=[];for(const _0x4bf6f6 of _0x491da4){const _0x594904=await computeFileHash(_0x4bf6f6['filePath']),_0x4e7386=_0x360516[_0x470d4a(0xbf)][_0x4bf6f6[_0x470d4a(0x105)]];if(!_0x12d737&&_0x4e7386&&_0x4e7386[_0x470d4a(0xc7)]===_0x594904){_0xf86bd2[_0x470d4a(0xc4)]({'lockKey':_0x4bf6f6[_0x470d4a(0x105)],'reason':_0x470d4a(0xe4)});continue;}try{await uploadSingleFunction(_0x2e2ee6[_0x470d4a(0xe6)],_0x4bf6f6,_0x360516,_0xdd4a05);const _0x494d69=_0x360516[_0x470d4a(0xbf)][_0x4bf6f6['lockKey']];_0x7a9cb6[_0x470d4a(0xc4)]({'lockKey':_0x4bf6f6[_0x470d4a(0x105)],'remoteId':_0x494d69?.[_0x470d4a(0xc2)]??0x0}),_0x20852d[_0x470d4a(0xc4)](_0x4bf6f6[_0x470d4a(0xd3)]);}catch(_0x4f1d5f){_0xbbcdde[_0x470d4a(0xc4)]({'lockKey':_0x4bf6f6[_0x470d4a(0x105)],'error':_0x4f1d5f instanceof Error?_0x4f1d5f[_0x470d4a(0x102)]:String(_0x4f1d5f)});}}_0x360516[_0x470d4a(0xd9)]=new Date()[_0x470d4a(0xd0)](),await writeBffLockFile(_0x4217ce[_0x470d4a(0xed)],_0x39a3fd),await waitForUploadedLockEntries(_0x4217ce[_0x470d4a(0xed)],_0x2e2ee6[_0x470d4a(0xe6)],_0x7a9cb6[_0x470d4a(0xe0)](_0x413b2b=>_0x413b2b[_0x470d4a(0x105)]));let _0x4b31f9={'attempted':![],'cleared':![]};if(_0x7a9cb6['length']>0x0)try{let _0x1edfc4='';for(let _0x84f2cd=0x0;_0x84f2cd<CACHE_CLEAR_ATTEMPTS;_0x84f2cd+=0x1){_0x1edfc4=await clearBffScriptCache(),_0x84f2cd<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x4b31f9={'attempted':!![],'cleared':!![],'message':_0x1edfc4||_0x470d4a(0xf9)};}catch(_0x4c6d2b){_0x4b31f9={'attempted':!![],'cleared':![],'error':_0x4c6d2b instanceof Error?_0x4c6d2b[_0x470d4a(0x102)]:String(_0x4c6d2b)};}const _0x18c6d0=_0xbbcdde[_0x470d4a(0xee)]===0x0&&(_0x4b31f9['attempted']?_0x4b31f9[_0x470d4a(0xb8)]:!![]),_0x28f278=await runAutomaticDeploymentSync(_0x2e2ee6,_0x470d4a(0xba),_0x20852d,_0x18c6d0),_0x50d3f4=_0x18c6d0&&automaticDeploymentSyncSucceeded(_0x28f278),_0x2fa646=_0x4b31f9[_0x470d4a(0xe1)]?_0x4b31f9[_0x470d4a(0xb8)]?'runtime\x20cache\x20cleared':_0x470d4a(0xe2):_0x470d4a(0xe9),_0x27e4d4=_0x28f278[_0x470d4a(0xdb)]?_0x470d4a(0xf1)+_0x28f278[_0x470d4a(0xdc)]:'';return{'ok':_0x50d3f4,'data':{'uploaded':_0x7a9cb6,'skipped':_0xf86bd2,'failed':_0xbbcdde,'cacheClear':_0x4b31f9,'deploymentSync':_0x28f278},'message':'Push\x20complete:\x20'+_0x7a9cb6[_0x470d4a(0xee)]+_0x470d4a(0x101)+_0xf86bd2[_0x470d4a(0xee)]+'\x20skipped,\x20'+_0xbbcdde[_0x470d4a(0xee)]+_0x470d4a(0xe8)+_0x2fa646+_0x27e4d4};}};async function getTargetFunctions(_0x52192f,_0xf06974){const _0x566a21=a37_0x42ede9,_0x171814=_0xf06974[_0x566a21(0xeb)](_0x566a21(0xd6)),_0x14d555=_0xf06974['str']('name'),_0x2c4a2b=normalizeBffType(_0x171814)??undefined;if(_0x14d555&&!_0x2c4a2b)throw CliErrors[_0x566a21(0xc6)](_0x566a21(0xff));const _0x3551aa=await scanLocalBffFunctions(_0x52192f,_0x2c4a2b);if(_0x14d555){const _0x53ce62=_0x3551aa[_0x566a21(0xfa)](_0x2ce883=>_0x2ce883[_0x566a21(0xd3)]===_0x14d555);if(_0x53ce62[_0x566a21(0xee)]===0x0)throw CliErrors[_0x566a21(0xc6)](_0x566a21(0xf7)+_0x2c4a2b+'/'+_0x14d555);return _0x53ce62;}return _0x3551aa;}async function buildHookMaps(_0x2de2c4,_0x3a7178,_0x3d3f25,_0x508245){const _0x1360b1=a37_0x42ede9,_0x145242=_0x3d3f25[_0x1360b1(0x100)](_0x14a85f=>_0x14a85f['type']===_0x1360b1(0xec));if(!_0x145242)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x48fd0c=loadAliasMap(_0x3a7178,undefined,resolveApiFilePath(_0x3a7178,_0x2de2c4)),_0x5d2e08=new Map(_0x48fd0c['map'](_0x4286d8=>[_0x4286d8[_0x1360b1(0xce)],_0x4286d8[_0x1360b1(0xcd)]]));for(const _0x394f62 of Object['values'](_0x508245[_0x1360b1(0xbf)])){_0x394f62[_0x1360b1(0xce)]&&_0x394f62[_0x1360b1(0xcd)]&&!_0x5d2e08[_0x1360b1(0xf4)](_0x394f62[_0x1360b1(0xce)])&&_0x5d2e08['set'](_0x394f62['alias'],_0x394f62[_0x1360b1(0xcd)]);}const _0x2fa51c=await listDatasets(_0x2de2c4),_0x578044=new Map(_0x2fa51c[_0x1360b1(0xe0)](_0x41fbeb=>[_0x41fbeb[_0x1360b1(0xf0)],_0x41fbeb]));return{'aliasToDatasetCode':_0x5d2e08,'datasetCodeToDataset':_0x578044};}async function uploadSingleFunction(_0x56200f,_0x4178d1,_0x17a91d,_0x22868a){const _0x12b647=a37_0x42ede9,_0x1bd2a1=await readFile(_0x4178d1[_0x12b647(0xc0)],_0x12b647(0xc5)),_0x27d991=await computeFileHash(_0x4178d1[_0x12b647(0xc0)]),_0x142915=_0x17a91d[_0x12b647(0xbf)][_0x4178d1[_0x12b647(0x105)]];if(_0x142915?.[_0x12b647(0xc2)]&&_0x142915[_0x12b647(0xb9)]==null)throw CliErrors[_0x12b647(0xc6)](_0x4178d1[_0x12b647(0x105)]+':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.');let _0xf47a66=extractScriptDescription(_0x1bd2a1);if(!_0xf47a66&&_0x142915?.[_0x12b647(0xc2)]){const _0x4eb672=await getBffScriptInfo(_0x142915[_0x12b647(0xc2)]);_0xf47a66=_0x4eb672['description']||undefined;}const _0x1e057b={'appCode':_0x56200f,'functionName':_0x4178d1['name'],'scriptType':_0x4178d1['type'],'scriptContent':_0x1bd2a1};if(_0x142915?.['remoteId'])_0x1e057b['id']=_0x142915[_0x12b647(0xc2)];if(_0x142915?.[_0x12b647(0xb9)]!=null)_0x1e057b[_0x12b647(0xb9)]=_0x142915[_0x12b647(0xb9)];if(_0xf47a66)_0x1e057b[_0x12b647(0xd4)]=_0xf47a66;if(_0x4178d1[_0x12b647(0xd6)]===_0x12b647(0xec)){const _0x484ec=_0x4178d1[_0x12b647(0xce)];if(!_0x484ec||!_0x4178d1[_0x12b647(0xb7)]||!_0x4178d1[_0x12b647(0xda)])throw CliErrors[_0x12b647(0xc6)](_0x12b647(0xc8)+_0x4178d1[_0x12b647(0x105)]);const _0x4cdb2d=_0x22868a[_0x12b647(0xe3)][_0x12b647(0xfe)](_0x484ec)??_0x142915?.['datasetCode']??_0x484ec,_0x47ef76=_0x22868a[_0x12b647(0xbd)][_0x12b647(0xfe)](_0x4cdb2d);if(!_0x47ef76)throw CliErrors['validation'](_0x12b647(0xf5)+_0x484ec+_0x12b647(0xde)+(_0x12b647(0xdd)+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.'));_0x1e057b['datasetId']=_0x47ef76['id'],_0x1e057b[_0x12b647(0xb7)]=_0x4178d1[_0x12b647(0xb7)],_0x1e057b['functionNode']=_0x4178d1[_0x12b647(0xda)];}const _0x5f4593=await saveBffScript(_0x1e057b),_0xed9fec=_0x5f4593['id'],_0x54f966=_0x5f4593['script']??await getBffScriptInfo(_0xed9fec),_0x2c5e9d={'hash':_0x27d991,'remoteId':_0xed9fec,'version':_0x54f966[_0x12b647(0xb9)]};if(_0x4178d1[_0x12b647(0xd6)]===_0x12b647(0xec)){const _0x4acc9a=_0x4178d1[_0x12b647(0xce)],_0x437d50=_0x22868a[_0x12b647(0xe3)][_0x12b647(0xfe)](_0x4acc9a)??_0x142915?.['datasetCode']??_0x4acc9a;_0x22868a[_0x12b647(0xe3)]['has'](_0x4acc9a)?_0x2c5e9d[_0x12b647(0xce)]=_0x4acc9a:_0x2c5e9d[_0x12b647(0xce)]=_0x142915?.[_0x12b647(0xce)],_0x2c5e9d['datasetCode']=_0x437d50,_0x2c5e9d[_0x12b647(0xb7)]=_0x4178d1[_0x12b647(0xb7)],_0x2c5e9d['functionNode']=_0x4178d1['functionNode'];}_0x17a91d[_0x12b647(0xbf)][_0x4178d1['lockKey']]=_0x2c5e9d;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x1daa9f,_0x19ac0c,_0x2136c0){const _0x17f8ad=a37_0x42ede9;if(_0x2136c0[_0x17f8ad(0xee)]===0x0)return;for(let _0x8b69ec=0x0;_0x8b69ec<LOCK_SETTLE_RETRY_COUNT;_0x8b69ec+=0x1){const _0x3a5e32=await readBffLockFile(_0x1daa9f),_0x203c38=_0x3a5e32?.[_0x17f8ad(0xbb)]?.[_0x19ac0c]?.['functions']??{},_0x1dd49c=_0x2136c0['every'](_0xded421=>!!_0x203c38[_0xded421]?.[_0x17f8ad(0xc2)]);if(_0x1dd49c)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x17f8ad(0xc1)+_0x2136c0[_0x17f8ad(0xea)](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x4fa1d2=a38_0x50b6;function a38_0x1984(){const _0x574ba9=['5rzPLbc','42504231RGddFb','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','status','bff','1725316ByLghT','scriptsRoot','3181451DRimfp','filePath','1913672ssrZjI','9ttLusC','lockKey','28zLidMj','\x20remote-only','push','appCode','functions','apiDir','length','has','52058nXPKlr','5024270peGCRB','all','\x20added,\x20','bool','\x20modified,\x20','datasetCode','remote','read','Check\x20local\x20Backend\x20Function\x20sync\x20status\x20against\x20lock\x20file','hash','lockFilePath','3302418DTPbmX','6RLEsNS','map'];a38_0x1984=function(){return _0x574ba9;};return a38_0x1984();}(function(_0x5cb828,_0x5d095a){const _0x1593f4=a38_0x50b6,_0x221e53=_0x5cb828();while(!![]){try{const _0x579ecd=-parseInt(_0x1593f4(0x7a))/0x1*(parseInt(_0x1593f4(0x82))/0x2)+parseInt(_0x1593f4(0x6c))/0x3*(-parseInt(_0x1593f4(0x73))/0x4)+-parseInt(_0x1593f4(0x6e))/0x5*(parseInt(_0x1593f4(0x6b))/0x6)+-parseInt(_0x1593f4(0x75))/0x7+-parseInt(_0x1593f4(0x77))/0x8+parseInt(_0x1593f4(0x78))/0x9*(-parseInt(_0x1593f4(0x83))/0xa)+parseInt(_0x1593f4(0x6f))/0xb;if(_0x579ecd===_0x5d095a)break;else _0x221e53['push'](_0x221e53['shift']());}catch(_0x30d5ea){_0x221e53['push'](_0x221e53['shift']());}}}(a38_0x1984,0x806c3));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';function a38_0x50b6(_0x5cc185,_0x10e93d){_0x5cc185=_0x5cc185-0x6b;const _0x198405=a38_0x1984();let _0x50b625=_0x198405[_0x5cc185];return _0x50b625;}export const bffStatus={'service':a38_0x4fa1d2(0x72),'command':'status','description':a38_0x4fa1d2(0x8b),'risk':a38_0x4fa1d2(0x8a),'flags':[{'name':a38_0x4fa1d2(0x89),'type':'boolean','description':a38_0x4fa1d2(0x70)}],async 'execute'(_0x260171){const _0x5e62b3=a38_0x4fa1d2,_0x206ac0=loadBffProjectConfig(_0x260171[_0x5e62b3(0x7d)]),_0x4219fd=await readBffLockFile(_0x206ac0[_0x5e62b3(0x8d)]),{appLock:_0x16beb4}=ensureLockScope(_0x4219fd??createEmptyBffLock(),_0x260171[_0x5e62b3(0x7d)],_0x206ac0[_0x5e62b3(0x74)],_0x5e62b3(0x71)),_0x1d6ffe=await scanLocalBffFunctions(_0x206ac0),_0x2aa23f=[],_0x200a28=[],_0x4870d4=[];for(const _0x285909 of _0x1d6ffe){const _0x1956d6=await computeFileHash(_0x285909[_0x5e62b3(0x76)]),_0x24da0b=_0x16beb4['functions'][_0x285909[_0x5e62b3(0x79)]];if(!_0x24da0b)_0x2aa23f['push'](_0x285909['lockKey']);else _0x24da0b[_0x5e62b3(0x8c)]!==_0x1956d6?_0x200a28['push'](_0x285909[_0x5e62b3(0x79)]):_0x4870d4[_0x5e62b3(0x7c)](_0x285909[_0x5e62b3(0x79)]);}const _0x2552dd=[];if(_0x260171[_0x5e62b3(0x86)]('remote')){const _0x5e718e=loadAliasMap(_0x260171[_0x5e62b3(0x7f)],undefined,resolveApiFilePath(_0x260171['apiDir'],_0x260171[_0x5e62b3(0x7d)])),_0x224ade=new Map(_0x5e718e[_0x5e62b3(0x6d)](_0x225634=>[_0x225634[_0x5e62b3(0x88)],_0x225634['alias']])),[_0x492eba,_0x1af082]=await Promise[_0x5e62b3(0x84)]([listBffScripts(_0x260171[_0x5e62b3(0x7d)]),getBffScriptStatistics(_0x260171['appCode'])]),_0x5d7c1a=createHookLocationMap(_0x1af082),_0x47b53d=new Set(_0x1d6ffe[_0x5e62b3(0x6d)](_0x211ff5=>_0x211ff5['lockKey']));for(const _0x52d444 of _0x492eba){const _0x56b6dd=resolveRemoteScriptTarget(_0x206ac0,_0x52d444,_0x5d7c1a,_0x16beb4[_0x5e62b3(0x7e)],_0x224ade);_0x56b6dd&&!_0x47b53d[_0x5e62b3(0x81)](_0x56b6dd[_0x5e62b3(0x79)])&&_0x2552dd['push'](_0x56b6dd['lockKey']);}}const _0x5bc99d=_0x2aa23f['length']===0x0&&_0x200a28['length']===0x0&&_0x2552dd[_0x5e62b3(0x80)]===0x0;return{'ok':!![],'data':{'added':_0x2aa23f,'modified':_0x200a28,'unchanged':_0x4870d4,'remoteOnly':_0x2552dd},'message':_0x5bc99d?'All\x20Backend\x20Function\x20scripts\x20are\x20in\x20sync.':_0x2aa23f[_0x5e62b3(0x80)]+_0x5e62b3(0x85)+_0x200a28['length']+_0x5e62b3(0x87)+_0x4870d4['length']+'\x20unchanged'+(_0x2552dd[_0x5e62b3(0x80)]>0x0?',\x20'+_0x2552dd['length']+_0x5e62b3(0x7b):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a39_0xffca60=a39_0x2e9a;(function(_0x91dbae,_0x5ec17f){const _0x39238a=a39_0x2e9a,_0x397534=_0x91dbae();while(!![]){try{const _0x1c64a1=parseInt(_0x39238a(0x1bd))/0x1+-parseInt(_0x39238a(0x1bc))/0x2*(parseInt(_0x39238a(0x1b7))/0x3)+-parseInt(_0x39238a(0x1af))/0x4+-parseInt(_0x39238a(0x1ba))/0x5*(-parseInt(_0x39238a(0x1c7))/0x6)+parseInt(_0x39238a(0x1b0))/0x7*(parseInt(_0x39238a(0x1b8))/0x8)+-parseInt(_0x39238a(0x1a7))/0x9*(parseInt(_0x39238a(0x1ae))/0xa)+parseInt(_0x39238a(0x1b2))/0xb;if(_0x1c64a1===_0x5ec17f)break;else _0x397534['push'](_0x397534['shift']());}catch(_0x5f3335){_0x397534['push'](_0x397534['shift']());}}}(a39_0x2365,0xcae70));import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';import{logger}from'../../utils/logger.js';function a39_0x2365(){const _0x51b648=['2597105jaBSwv','error','4791017NAiycq','cli-skill-install','skillVersion','read','install','1295265IqaBiY','8ltxdGA','log','1524205bOjnRO','cli-skill','2ecmZIZ','801226DWBIvM','\x20installed','\x20at\x20','setLogPath','CLI\x20Built-in\x20Skill\x20','Built-in\x20Skill\x20install\x20failed\x20[','nonInteractive','Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20','repairCommand','apiError','18iFXHpB','unknown','inherit','8163XBEjSW','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','\x20via\x20skills@latest','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.','info','pipe','installedPath','8480uGhLXa','1961328moOrcb'];a39_0x2365=function(){return _0x51b648;};return a39_0x2365();}function a39_0x2e9a(_0x254052,_0x40723b){_0x254052=_0x254052-0x1a5;const _0x23651b=a39_0x2365();let _0x2e9a27=_0x23651b[_0x254052];return _0x2e9a27;}export const cliSkillDefinitions=[{'service':a39_0xffca60(0x1bb),'command':a39_0xffca60(0x1b6),'description':a39_0xffca60(0x1a8),'risk':a39_0xffca60(0x1b5),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x4dcb3d){const _0x274eb8=a39_0xffca60;logger[_0x274eb8(0x1c0)](process['cwd']()),logger[_0x274eb8(0x1ab)](_0x274eb8(0x1b3),_0x274eb8(0x1aa));const _0x2e7c87=installBuiltinSkill({'stdio':_0x4dcb3d[_0x274eb8(0x1c3)]?_0x274eb8(0x1ac):_0x274eb8(0x1a6)});if(!_0x2e7c87['ok'])throw CliErrors[_0x274eb8(0x1c6)](_0x274eb8(0x1c2)+_0x2e7c87['code']+']:\x20'+(_0x2e7c87[_0x274eb8(0x1b1)]||_0x274eb8(0x1a5)),_0x274eb8(0x1c4)+_0x2e7c87[_0x274eb8(0x1c5)]);return console[_0x274eb8(0x1b9)](_0x2e7c87['changed']?_0x274eb8(0x1c1)+_0x2e7c87['skillVersion']+_0x274eb8(0x1be)+(_0x2e7c87[_0x274eb8(0x1ad)]?'\x20at\x20'+_0x2e7c87[_0x274eb8(0x1ad)]:_0x274eb8(0x1a9)):_0x274eb8(0x1c1)+_0x2e7c87[_0x274eb8(0x1b4)]+'\x20is\x20already\x20current'+(_0x2e7c87[_0x274eb8(0x1ad)]?_0x274eb8(0x1bf)+_0x2e7c87[_0x274eb8(0x1ad)]:'')),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a40_0x2ad0ee=a40_0x1ad1;(function(_0x2384a4,_0x8dbf15){const _0x78c6e7=a40_0x1ad1,_0x133b7b=_0x2384a4();while(!![]){try{const _0x28082d=parseInt(_0x78c6e7(0xc5))/0x1*(parseInt(_0x78c6e7(0xa1))/0x2)+parseInt(_0x78c6e7(0xba))/0x3*(-parseInt(_0x78c6e7(0xcb))/0x4)+parseInt(_0x78c6e7(0x86))/0x5+parseInt(_0x78c6e7(0xce))/0x6*(parseInt(_0x78c6e7(0xc1))/0x7)+parseInt(_0x78c6e7(0xaa))/0x8+parseInt(_0x78c6e7(0x9a))/0x9*(parseInt(_0x78c6e7(0xc6))/0xa)+-parseInt(_0x78c6e7(0x99))/0xb;if(_0x28082d===_0x8dbf15)break;else _0x133b7b['push'](_0x133b7b['shift']());}catch(_0x5cc648){_0x133b7b['push'](_0x133b7b['shift']());}}}(a40_0x1523,0x8e31b));import a40_0x4b656b from'chalk';import a40_0x5523ec from'ora';import a40_0x24ba5e 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 _0x26034c=a40_0x1ad1;return GIT_COMMIT!=='unknown'?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x26034c(0xa5)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x475d14=a40_0x1ad1,_0x188a69=process['execPath']['toLowerCase']();if(_0x188a69['includes'](_0x475d14(0xb9)))return _0x475d14(0xb9);return _0x475d14(0x8d);}const updateFlags=[{'name':'beta','type':a40_0x2ad0ee(0xbc),'description':a40_0x2ad0ee(0x81),'default':![]},{'name':a40_0x2ad0ee(0x9e),'type':a40_0x2ad0ee(0x9c),'description':'Install\x20a\x20specific\x20CLI\x20version'}];function getRequestedVersion(_0x4438e0){const _0x3ff3e1=a40_0x2ad0ee;return _0x4438e0[_0x3ff3e1(0xcd)](_0x3ff3e1(0x9e))[_0x3ff3e1(0x8f)]();}async function validateUpdateFlags(_0x4b72b1){const _0x2fbc72=a40_0x2ad0ee,_0x140130=_0x4b72b1[_0x2fbc72(0xb5)](_0x2fbc72(0x85)),_0x5626df=getRequestedVersion(_0x4b72b1);if(_0x140130&&_0x5626df)throw CliErrors['validation']('--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.',_0x2fbc72(0xb6));if(_0x5626df&&!a40_0x24ba5e[_0x2fbc72(0xcf)](_0x5626df))throw CliErrors[_0x2fbc72(0xc2)](_0x2fbc72(0xa0)+_0x5626df,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}async function fetchNpmDistTags(){const _0x11dd30=a40_0x2ad0ee;try{const _0x102c3f=await fetch(_0x11dd30(0x84)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x11dd30(0x8e),{'signal':AbortSignal['timeout'](0x2710)});if(!_0x102c3f['ok'])return null;const _0x2ad390=await _0x102c3f['json']();if(!_0x2ad390||typeof _0x2ad390!==_0x11dd30(0xac))return null;return Object[_0x11dd30(0xb0)](Object[_0x11dd30(0x87)](_0x2ad390)[_0x11dd30(0xc9)](([,_0x20a2e4])=>typeof _0x20a2e4===_0x11dd30(0x9c)&&_0x20a2e4[_0x11dd30(0x8f)]()['length']>0x0)['map'](([_0x40ceb2,_0xc4a8f])=>[_0x40ceb2,String(_0xc4a8f)['trim']()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x46e5ef){const _0x195f40=await fetchNpmDistTags();return _0x195f40?.[_0x46e5ef]??null;}async function fetchLatestVersion(){const _0x29b2ad=a40_0x2ad0ee;return fetchNpmDistTagVersion(_0x29b2ad(0x92));}function a40_0x1ad1(_0x173adb,_0x5a990b){_0x173adb=_0x173adb-0x7f;const _0x15239b=a40_0x1523();let _0x1ad1e2=_0x15239b[_0x173adb];return _0x1ad1e2;}async function resolveTargetVersion(_0x2676fc){const _0x14ee9f=a40_0x2ad0ee,_0x5bfea9=getRequestedVersion(_0x2676fc);if(_0x5bfea9)return{'version':_0x5bfea9,'source':_0x14ee9f(0x9e)};if(_0x2676fc[_0x14ee9f(0xb5)](_0x14ee9f(0x85))){const _0x2396c1=await fetchNpmDistTagVersion(_0x14ee9f(0x85));if(!_0x2396c1)return null;return{'version':_0x2396c1,'source':'beta'};}const _0x11164e=await fetchLatestVersion();if(!_0x11164e)return null;return{'version':_0x11164e,'source':'latest'};}function shouldInstallTarget(_0x24b062,_0x5103b7){const _0x20d243=a40_0x2ad0ee;if(_0x5103b7[_0x20d243(0xa3)]===_0x20d243(0x9e)||_0x5103b7[_0x20d243(0xa3)]===_0x20d243(0x85))return!a40_0x24ba5e['eq'](_0x24b062,_0x5103b7[_0x20d243(0x9e)]);return a40_0x24ba5e['lt'](_0x24b062,_0x5103b7[_0x20d243(0x9e)]);}function getInstallPlanLabel(_0x172482,_0x1fa1da){const _0x1c8b4f=a40_0x2ad0ee;switch(_0x1fa1da[_0x1c8b4f(0xa3)]){case _0x1c8b4f(0x85):return _0x1c8b4f(0xae)+a40_0x4b656b[_0x1c8b4f(0xb4)](_0x172482)+_0x1c8b4f(0x8a)+a40_0x4b656b[_0x1c8b4f(0x97)](_0x1fa1da['version']);case _0x1c8b4f(0x9e):return'Requested\x20version:\x20'+a40_0x4b656b[_0x1c8b4f(0xb4)](_0x172482)+_0x1c8b4f(0x8a)+a40_0x4b656b[_0x1c8b4f(0x97)](_0x1fa1da[_0x1c8b4f(0x9e)]);case _0x1c8b4f(0x92):default:return _0x1c8b4f(0x82)+a40_0x4b656b[_0x1c8b4f(0xb4)](_0x172482)+'\x20→\x20'+a40_0x4b656b[_0x1c8b4f(0x97)](_0x1fa1da[_0x1c8b4f(0x9e)]);}}function repairCurrentBuiltinSkill(){const _0x470188=a40_0x2ad0ee;console[_0x470188(0xb1)](a40_0x4b656b[_0x470188(0x9d)]('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x137081=installBuiltinSkill();if(_0x137081['ok'])return console[_0x470188(0xb1)](a40_0x4b656b[_0x470188(0x9d)](_0x470188(0xc7)+_0x137081[_0x470188(0xa2)]+_0x470188(0xb2))),!![];return console[_0x470188(0xc4)](a40_0x4b656b[_0x470188(0xb4)](_0x470188(0x94)+_0x137081[_0x470188(0x8b)]+_0x470188(0x95)+(_0x137081[_0x470188(0x90)]||_0x470188(0xa6)))),console[_0x470188(0xb1)](a40_0x4b656b['gray'](_0x470188(0xbe)+CLI_BIN_NAME+_0x470188(0xd1))),![];}function verifyUpdatedBuiltinSkill(_0x491936){const _0x3045cd=a40_0x2ad0ee,_0x37810c=inspectInstalledBuiltinSkillVersion(_0x491936);if(_0x37810c['state']===_0x3045cd(0xb8))return console[_0x3045cd(0xb1)](a40_0x4b656b[_0x3045cd(0x9d)](_0x3045cd(0xc7)+_0x491936+'\x20is\x20up\x20to\x20date.')),!![];const _0x26b06a=_0x37810c[_0x3045cd(0xa2)]?_0x3045cd(0xab)+_0x491936+_0x3045cd(0xa7)+_0x37810c['skillVersion']:_0x3045cd(0xab)+_0x491936+_0x3045cd(0x93)+_0x37810c['state'];return console[_0x3045cd(0xc4)](a40_0x4b656b[_0x3045cd(0xb4)](_0x3045cd(0x96)+_0x26b06a)),console[_0x3045cd(0xb1)](a40_0x4b656b[_0x3045cd(0x9d)](_0x3045cd(0xbe)+_0x37810c[_0x3045cd(0x83)])),![];}function a40_0x1523(){const _0x3424cc=['8329192vnWrjv','expected\x20','object','red','Beta\x20version:\x20','start','fromEntries','log','\x20is\x20up\x20to\x20date.','fail','yellow','bool','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','current','bun','15sXiMqn','pipe','boolean','\x20is\x20newer\x20than\x20npm\x20latest\x20v','\x20\x20Run\x20manually:\x20','Already\x20on\x20requested\x20version\x20(v','Current\x20version\x20v','1337kWldov','validation','\x20install\x20-g\x20','warn','4LjLFEm','36470UCSwxa','\x20\x20CLI\x20Built-in\x20Skill\x20','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','filter','@latest','284576NfrCbD','\x20\x20Try\x20manually:\x20','str','3372kiRmPN','valid','Updating\x20via\x20','\x20cli-skill\x20install','Current\x20version:\x20','Updated\x20to\x20v','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','Update\x20available:\x20','repairCommand','https://registry.npmjs.org/-/package/','beta','5593850dwAUPG','entries','read','succeed','\x20→\x20','code','Update\x20failed','npm','/dist-tags','trim','error','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','latest',',\x20state\x20','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[',']:\x20','\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20','green','Version\x20comparison\x20failed','35156572cPStCd','2034mSXayo','install','string','gray','version','Checking\x20for\x20updates...','Invalid\x20version:\x20','521358qpWTgh','skillVersion','source','run','slice','unknown',',\x20found\x20','message','info'];a40_0x1523=function(){return _0x3424cc;};return a40_0x1523();}async function execute(_0xd97cff){const _0x2f555=a40_0x2ad0ee;await validateUpdateFlags(_0xd97cff);const _0x3aa60=getCurrentVersion();console[_0x2f555(0xb1)](_0x2f555(0x7f)+_0x3aa60);const _0x24e259=a40_0x5523ec(_0x2f555(0x9f))['start'](),_0x117e2e=await resolveTargetVersion(_0xd97cff);if(!_0x117e2e){const _0x15a7fb=_0xd97cff[_0x2f555(0xb5)](_0x2f555(0x85))?_0x2f555(0xb7):_0x2f555(0x91);return _0x24e259[_0x2f555(0xb3)](_0x15a7fb),console[_0x2f555(0xb1)](a40_0x4b656b['gray'](_0x2f555(0xc8)+NPM_PACKAGE_NAME+_0x2f555(0xca))),{'ok':![],'message':_0x15a7fb};}const _0x5935e0=a40_0x24ba5e['valid'](VERSION),_0x929642=a40_0x24ba5e[_0x2f555(0xcf)](_0x117e2e[_0x2f555(0x9e)]);if(!_0x5935e0||!_0x929642)return _0x24e259['fail']('Version\x20comparison\x20failed'),{'ok':![],'message':_0x2f555(0x98)};if(!shouldInstallTarget(_0x5935e0,_0x117e2e)){const _0x25c268=_0x117e2e[_0x2f555(0xa3)]===_0x2f555(0x9e)?_0x2f555(0xbf)+_0x117e2e[_0x2f555(0x9e)]+')':a40_0x24ba5e['gt'](_0x5935e0,_0x929642)?_0x2f555(0xc0)+_0x3aa60+_0x2f555(0xbd)+_0x117e2e[_0x2f555(0x9e)]:'Already\x20up\x20to\x20date\x20(v'+_0x117e2e['version']+')';return _0x24e259[_0x2f555(0x89)](_0x25c268),{'ok':repairCurrentBuiltinSkill()};}_0x24e259[_0x2f555(0xa9)](getInstallPlanLabel(_0x3aa60,_0x117e2e));const _0x27ce7c=detectPackageManager(),_0x24aec8=_0x27ce7c===_0x2f555(0x8d)?resolveNpmBin(_0x2f555(0x8d)):_0x27ce7c,_0x314ee3=a40_0x5523ec(_0x2f555(0xd0)+_0x27ce7c+'...')[_0x2f555(0xaf)]();try{return await execa(_0x24aec8,[_0x2f555(0x9b),'-g',NPM_PACKAGE_NAME+'@'+_0x117e2e['version']],{'stdio':_0x2f555(0xbb)}),_0x314ee3['succeed'](_0x2f555(0x80)+_0x117e2e[_0x2f555(0x9e)]),console[_0x2f555(0xb1)](a40_0x4b656b[_0x2f555(0x9d)]('\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.')),{'ok':verifyUpdatedBuiltinSkill(_0x117e2e[_0x2f555(0x9e)])};}catch(_0x1176c7){return _0x314ee3['fail'](_0x2f555(0x8c)),console['error'](a40_0x4b656b[_0x2f555(0xad)]('\x20\x20'+_0x1176c7['message'])),console['log'](a40_0x4b656b[_0x2f555(0x9d)](_0x2f555(0xcc)+_0x27ce7c+_0x2f555(0xc3)+NPM_PACKAGE_NAME+'@'+_0x117e2e[_0x2f555(0x9e)])),{'ok':![],'message':_0x1176c7[_0x2f555(0xa8)]};}}export const updateDefinition={'service':'update','command':a40_0x2ad0ee(0xa4),'description':'Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','risk':a40_0x2ad0ee(0x88),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a40_0x305ca1=a40_0x2be2;(function(_0x4a23f4,_0x35696f){const _0x1104da=a40_0x2be2,_0x42ecb8=_0x4a23f4();while(!![]){try{const _0x29ced1=parseInt(_0x1104da(0x15a))/0x1*(parseInt(_0x1104da(0x125))/0x2)+-parseInt(_0x1104da(0x157))/0x3*(-parseInt(_0x1104da(0x164))/0x4)+parseInt(_0x1104da(0x13c))/0x5*(-parseInt(_0x1104da(0x156))/0x6)+-parseInt(_0x1104da(0x12d))/0x7+parseInt(_0x1104da(0x175))/0x8*(parseInt(_0x1104da(0x11f))/0x9)+parseInt(_0x1104da(0x14c))/0xa+-parseInt(_0x1104da(0x152))/0xb;if(_0x29ced1===_0x35696f)break;else _0x42ecb8['push'](_0x42ecb8['shift']());}catch(_0x4f93b3){_0x42ecb8['push'](_0x42ecb8['shift']());}}}(a40_0x12f1,0x821a8));import a40_0xd67b75 from'chalk';import a40_0x48919d from'ora';import a40_0x955f54 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 _0x382872=a40_0x2be2;return GIT_COMMIT!==_0x382872(0x135)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x382872(0x12a)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x6bcda8=a40_0x2be2,_0x30fb9b=process[_0x6bcda8(0x158)][_0x6bcda8(0x11e)]();if(_0x30fb9b[_0x6bcda8(0x165)](_0x6bcda8(0x168)))return'bun';return _0x6bcda8(0x124);}const updateFlags=[{'name':'beta','type':a40_0x305ca1(0x128),'description':a40_0x305ca1(0x161),'default':![]},{'name':'version','type':'string','description':a40_0x305ca1(0x16b)}];function getRequestedVersion(_0x2d0abb){const _0x125535=a40_0x305ca1;return _0x2d0abb[_0x125535(0x148)](_0x125535(0x149))[_0x125535(0x13f)]();}async function validateUpdateFlags(_0x74fa78){const _0x383af8=a40_0x305ca1,_0x1029b2=_0x74fa78[_0x383af8(0x12b)](_0x383af8(0x132)),_0x598246=getRequestedVersion(_0x74fa78);if(_0x1029b2&&_0x598246)throw CliErrors[_0x383af8(0x14b)]('--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.',_0x383af8(0x162));if(_0x598246&&!a40_0x955f54[_0x383af8(0x146)](_0x598246))throw CliErrors['validation']('Invalid\x20version:\x20'+_0x598246,_0x383af8(0x129));}async function fetchNpmDistTags(){const _0x39a94a=a40_0x305ca1;try{const _0x5b8e48=await fetch(_0x39a94a(0x121)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x39a94a(0x16c),{'signal':AbortSignal[_0x39a94a(0x170)](0x2710)});if(!_0x5b8e48['ok'])return null;const _0x319527=await _0x5b8e48[_0x39a94a(0x173)]();if(!_0x319527||typeof _0x319527!==_0x39a94a(0x13b))return null;return Object['fromEntries'](Object[_0x39a94a(0x15f)](_0x319527)[_0x39a94a(0x16f)](([,_0x12aa62])=>typeof _0x12aa62===_0x39a94a(0x127)&&_0x12aa62['trim']()[_0x39a94a(0x13e)]>0x0)[_0x39a94a(0x151)](([_0x4a603f,_0x5f5c5c])=>[_0x4a603f,String(_0x5f5c5c)['trim']()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x319c08){const _0x38ad79=await fetchNpmDistTags();return _0x38ad79?.[_0x319c08]??null;}async function fetchLatestVersion(){const _0x2ba0ff=a40_0x305ca1;return fetchNpmDistTagVersion(_0x2ba0ff(0x172));}async function resolveTargetVersion(_0x24e57e){const _0x2503e9=a40_0x305ca1,_0x74bb1f=getRequestedVersion(_0x24e57e);if(_0x74bb1f)return{'version':_0x74bb1f,'source':_0x2503e9(0x149)};if(_0x24e57e[_0x2503e9(0x12b)](_0x2503e9(0x132))){const _0x239afb=await fetchNpmDistTagVersion('beta');if(!_0x239afb)return null;return{'version':_0x239afb,'source':_0x2503e9(0x132)};}const _0x356ee9=await fetchLatestVersion();if(!_0x356ee9)return null;return{'version':_0x356ee9,'source':_0x2503e9(0x172)};}function shouldInstallTarget(_0x686f54,_0x298724){const _0x347629=a40_0x305ca1;if(_0x298724['source']===_0x347629(0x149)||_0x298724[_0x347629(0x150)]==='beta')return!a40_0x955f54['eq'](_0x686f54,_0x298724[_0x347629(0x149)]);return a40_0x955f54['lt'](_0x686f54,_0x298724[_0x347629(0x149)]);}function getInstallPlanLabel(_0x1801a1,_0x21a695){const _0x1ff9c3=a40_0x305ca1;switch(_0x21a695[_0x1ff9c3(0x150)]){case _0x1ff9c3(0x132):return _0x1ff9c3(0x120)+a40_0xd67b75[_0x1ff9c3(0x12e)](_0x1801a1)+'\x20→\x20'+a40_0xd67b75['green'](_0x21a695[_0x1ff9c3(0x149)]);case _0x1ff9c3(0x149):return _0x1ff9c3(0x145)+a40_0xd67b75[_0x1ff9c3(0x12e)](_0x1801a1)+_0x1ff9c3(0x122)+a40_0xd67b75[_0x1ff9c3(0x163)](_0x21a695[_0x1ff9c3(0x149)]);case _0x1ff9c3(0x172):default:return _0x1ff9c3(0x12c)+a40_0xd67b75[_0x1ff9c3(0x12e)](_0x1801a1)+_0x1ff9c3(0x122)+a40_0xd67b75[_0x1ff9c3(0x163)](_0x21a695[_0x1ff9c3(0x149)]);}}function repairCurrentBuiltinSkill(){const _0x356d54=a40_0x305ca1;console[_0x356d54(0x14a)](a40_0xd67b75[_0x356d54(0x140)](_0x356d54(0x14d)));const _0x324408=installBuiltinSkill();if(_0x324408['ok'])return console[_0x356d54(0x14a)](a40_0xd67b75[_0x356d54(0x140)]('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x324408[_0x356d54(0x15d)]+_0x356d54(0x155))),!![];return console[_0x356d54(0x171)](a40_0xd67b75['yellow']('\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20['+_0x324408[_0x356d54(0x159)]+']:\x20'+(_0x324408[_0x356d54(0x13a)]||'unknown'))),console['log'](a40_0xd67b75[_0x356d54(0x140)]('\x20\x20Run\x20manually:\x20'+CLI_BIN_NAME+_0x356d54(0x154))),![];}function verifyUpdatedBuiltinSkill(_0x2b443a){const _0xe44cd4=a40_0x305ca1,_0x1ecf20=inspectInstalledBuiltinSkillVersion(_0x2b443a);if(_0x1ecf20['state']==='current')return console[_0xe44cd4(0x14a)](a40_0xd67b75['gray'](_0xe44cd4(0x143)+_0x2b443a+_0xe44cd4(0x155))),!![];const _0xf4fcf9=_0x1ecf20[_0xe44cd4(0x15d)]?_0xe44cd4(0x153)+_0x2b443a+_0xe44cd4(0x15c)+_0x1ecf20[_0xe44cd4(0x15d)]:_0xe44cd4(0x153)+_0x2b443a+',\x20state\x20'+_0x1ecf20[_0xe44cd4(0x174)];return console[_0xe44cd4(0x171)](a40_0xd67b75[_0xe44cd4(0x12e)]('\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20'+_0xf4fcf9)),console[_0xe44cd4(0x14a)](a40_0xd67b75[_0xe44cd4(0x140)](_0xe44cd4(0x131)+_0x1ecf20[_0xe44cd4(0x130)])),![];}function a40_0x12f1(){const _0x25cc50=['boolean','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','slice','bool','Update\x20available:\x20','1094821tPdXfU','yellow','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','repairCommand','\x20\x20Run\x20manually:\x20','beta','Already\x20up\x20to\x20date\x20(v','succeed','unknown','Already\x20on\x20requested\x20version\x20(v','start','fail','red','error','object','10UrHyWF','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','length','trim','gray','Checking\x20for\x20updates...','read','\x20\x20CLI\x20Built-in\x20Skill\x20','@latest','Requested\x20version:\x20','valid','run','str','version','log','validation','10599990ldPrnU','Checking\x20CLI\x20Built-in\x20Skill...','Updating\x20via\x20','\x20install\x20-g\x20','source','map','4429403OsGIZs','expected\x20','\x20cli-skill\x20install','\x20is\x20up\x20to\x20date.','1880922VACqGY','37062JtWlAy','execPath','code','109TzFmAT','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version',',\x20found\x20','skillVersion','\x20is\x20newer\x20than\x20npm\x20latest\x20v','entries','Version\x20comparison\x20failed','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','green','28ywhdQh','includes','install','Updated\x20to\x20v','bun','Current\x20version:\x20','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','Install\x20a\x20specific\x20CLI\x20version','/dist-tags','Update\x20failed','info','filter','timeout','warn','latest','json','state','444728TrNuns','update','toLowerCase','81OaivYb','Beta\x20version:\x20','https://registry.npmjs.org/-/package/','\x20→\x20','Current\x20version\x20v','npm','1324nHyfBI','message','string'];a40_0x12f1=function(){return _0x25cc50;};return a40_0x12f1();}async function execute(_0x384525){const _0x49c2d7=a40_0x305ca1;await validateUpdateFlags(_0x384525);const _0x350fb2=getCurrentVersion();console[_0x49c2d7(0x14a)](_0x49c2d7(0x169)+_0x350fb2);const _0x16606d=a40_0x48919d(_0x49c2d7(0x141))[_0x49c2d7(0x137)](),_0x2a5b94=await resolveTargetVersion(_0x384525);if(!_0x2a5b94){const _0x522c2d=_0x384525['bool']('beta')?_0x49c2d7(0x13d):_0x49c2d7(0x16a);return _0x16606d['fail'](_0x522c2d),console['log'](a40_0xd67b75[_0x49c2d7(0x140)](_0x49c2d7(0x12f)+NPM_PACKAGE_NAME+_0x49c2d7(0x144))),{'ok':![],'message':_0x522c2d};}const _0x34e626=a40_0x955f54[_0x49c2d7(0x146)](VERSION),_0xf327ea=a40_0x955f54[_0x49c2d7(0x146)](_0x2a5b94[_0x49c2d7(0x149)]);if(!_0x34e626||!_0xf327ea)return _0x16606d[_0x49c2d7(0x138)](_0x49c2d7(0x160)),{'ok':![],'message':_0x49c2d7(0x160)};if(!shouldInstallTarget(_0x34e626,_0x2a5b94)){const _0x2b9ff5=_0x2a5b94['source']===_0x49c2d7(0x149)?_0x49c2d7(0x136)+_0x2a5b94['version']+')':a40_0x955f54['gt'](_0x34e626,_0xf327ea)?_0x49c2d7(0x123)+_0x350fb2+_0x49c2d7(0x15e)+_0x2a5b94[_0x49c2d7(0x149)]:_0x49c2d7(0x133)+_0x2a5b94[_0x49c2d7(0x149)]+')';return _0x16606d[_0x49c2d7(0x134)](_0x2b9ff5),{'ok':repairCurrentBuiltinSkill()};}_0x16606d[_0x49c2d7(0x16e)](getInstallPlanLabel(_0x350fb2,_0x2a5b94));const _0x5deca3=detectPackageManager(),_0x334ccd=_0x5deca3===_0x49c2d7(0x124)?resolveNpmBin(_0x49c2d7(0x124)):_0x5deca3,_0x56d8bc=a40_0x48919d(_0x49c2d7(0x14e)+_0x5deca3+'...')['start']();try{return await execa(_0x334ccd,[_0x49c2d7(0x166),'-g',NPM_PACKAGE_NAME+'@'+_0x2a5b94[_0x49c2d7(0x149)]],{'stdio':'pipe'}),_0x56d8bc[_0x49c2d7(0x134)](_0x49c2d7(0x167)+_0x2a5b94[_0x49c2d7(0x149)]),console[_0x49c2d7(0x14a)](a40_0xd67b75[_0x49c2d7(0x140)]('\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.')),{'ok':verifyUpdatedBuiltinSkill(_0x2a5b94[_0x49c2d7(0x149)])};}catch(_0x35539d){return _0x56d8bc[_0x49c2d7(0x138)](_0x49c2d7(0x16d)),console[_0x49c2d7(0x13a)](a40_0xd67b75[_0x49c2d7(0x139)]('\x20\x20'+_0x35539d[_0x49c2d7(0x126)])),console[_0x49c2d7(0x14a)](a40_0xd67b75['gray']('\x20\x20Try\x20manually:\x20'+_0x5deca3+_0x49c2d7(0x14f)+NPM_PACKAGE_NAME+'@'+_0x2a5b94[_0x49c2d7(0x149)])),{'ok':![],'message':_0x35539d[_0x49c2d7(0x126)]};}}function a40_0x2be2(_0x558132,_0x105c8e){_0x558132=_0x558132-0x11e;const _0x12f1ad=a40_0x12f1();let _0x2be239=_0x12f1ad[_0x558132];return _0x2be239;}export const updateDefinition={'service':a40_0x305ca1(0x176),'command':a40_0x305ca1(0x147),'description':a40_0x305ca1(0x15b),'risk':a40_0x305ca1(0x142),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x200d6f,_0x388d60){const _0x2a2dc2=a41_0x21bf,_0x339670=_0x200d6f();while(!![]){try{const _0x4b71b4=-parseInt(_0x2a2dc2(0x15f))/0x1*(parseInt(_0x2a2dc2(0x160))/0x2)+parseInt(_0x2a2dc2(0x15e))/0x3*(-parseInt(_0x2a2dc2(0x15d))/0x4)+parseInt(_0x2a2dc2(0x168))/0x5+parseInt(_0x2a2dc2(0x163))/0x6*(parseInt(_0x2a2dc2(0x161))/0x7)+-parseInt(_0x2a2dc2(0x165))/0x8*(-parseInt(_0x2a2dc2(0x166))/0x9)+parseInt(_0x2a2dc2(0x164))/0xa*(-parseInt(_0x2a2dc2(0x162))/0xb)+parseInt(_0x2a2dc2(0x167))/0xc;if(_0x4b71b4===_0x388d60)break;else _0x339670['push'](_0x339670['shift']());}catch(_0x4cb2b7){_0x339670['push'](_0x339670['shift']());}}}(a41_0x4b6a,0xb5f8f));import{codegenSdk}from'../../commands/codegen/sdk.js';function a41_0x21bf(_0x333c8e,_0x49104a){_0x333c8e=_0x333c8e-0x15d;const _0x4b6afb=a41_0x4b6a();let _0x21bf8c=_0x4b6afb[_0x333c8e];return _0x21bf8c;}function a41_0x4b6a(){const _0x4a7de1=['6591705ePLWMt','4968484WrHkog','3inOmRq','32869YEsekJ','32ScDGKT','28MAUNSH','58586TctQqI','1226562HFigIm','1390uTXGco','147512hfKKMj','9sIqjoV','13190520mkfaID'];a41_0x4b6a=function(){return _0x4a7de1;};return a41_0x4b6a();}import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a42_0x2d69(_0x5b8576,_0x44ff72){_0x5b8576=_0x5b8576-0x85;const _0x22b524=a42_0x22b5();let _0x2d691c=_0x22b524[_0x5b8576];return _0x2d691c;}const a42_0xe42c5a=a42_0x2d69;function a42_0x22b5(){const _0x419fa8=['str','3KdreAW','read','1592073LqcDlp','247401yPQsLx','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','bool','sdk','312080aFlXsv','operation','5XsQZSr','1167832FGpJlK','skip-imports','code','338708PAvlNL','name','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','appCode','1141490fiESEd','160494mhIKVz','tableName'];a42_0x22b5=function(){return _0x419fa8;};return a42_0x22b5();}(function(_0x20fb98,_0x3cd3e7){const _0x4f5e0a=a42_0x2d69,_0x30a1b2=_0x20fb98();while(!![]){try{const _0x8e88e8=parseInt(_0x4f5e0a(0x87))/0x1+parseInt(_0x4f5e0a(0x91))/0x2*(parseInt(_0x4f5e0a(0x99))/0x3)+-parseInt(_0x4f5e0a(0x8b))/0x4+-parseInt(_0x4f5e0a(0x8d))/0x5*(parseInt(_0x4f5e0a(0x96))/0x6)+parseInt(_0x4f5e0a(0x95))/0x7+-parseInt(_0x4f5e0a(0x8e))/0x8+-parseInt(_0x4f5e0a(0x86))/0x9;if(_0x8e88e8===_0x3cd3e7)break;else _0x30a1b2['push'](_0x30a1b2['shift']());}catch(_0x1a3ed2){_0x30a1b2['push'](_0x30a1b2['shift']());}}}(a42_0x22b5,0x25274));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':'codegen','command':a42_0xe42c5a(0x8a),'description':a42_0xe42c5a(0x88),'risk':a42_0xe42c5a(0x85),'flags':[CODE_FLAG_OPTIONAL,{'name':'alias','type':'string','description':'Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)'},{'name':'operation','type':'string','required':!![],'description':a42_0xe42c5a(0x93)},{'name':a42_0xe42c5a(0x8f),'type':'boolean','description':'Omit\x20import\x20statements\x20from\x20generated\x20code'}],async 'execute'(_0x44c516){const _0x4208e8=a42_0xe42c5a,{dataset:_0x3b6eeb,operation:_0x87198c}=await getOperationDetail(_0x44c516[_0x4208e8(0x94)],_0x44c516[_0x4208e8(0x98)](_0x4208e8(0x90)),_0x44c516['str'](_0x4208e8(0x8c))),_0x2f540a=generateSdkCode(_0x3b6eeb,_0x87198c,{'includeImports':!_0x44c516[_0x4208e8(0x89)](_0x4208e8(0x8f))});return{'ok':!![],'data':{'dataset':{'name':_0x3b6eeb[_0x4208e8(0x92)],'code':_0x3b6eeb['code'],'tableName':_0x3b6eeb[_0x4208e8(0x97)]},'operation':_0x44c516[_0x4208e8(0x98)](_0x4208e8(0x8c)),'code':_0x2f540a}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a43_0x2936(_0x1acf50,_0x13319e){_0x1acf50=_0x1acf50-0x188;const _0x1b6141=a43_0x1b61();let _0x293679=_0x1b6141[_0x1acf50];return _0x293679;}function a43_0x1b61(){const _0x336a06=['sdk','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','bff','160361vRiZXL','1568810eKgXKr','appCode','40dgvkZi','Omit\x20import\x20statements\x20from\x20generated\x20code','target','no-imports','sqlName','sqlCode','87546SBbqIh','11976gQuceS','sql','2034100mxfbeI','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','bool','1854QDdOgV','115IaxPiW','codegen','sqlcode','44KjnHpy','read','56163kXDHVX','str','string','3079356gssUOU'];a43_0x1b61=function(){return _0x336a06;};return a43_0x1b61();}const a43_0x23af7b=a43_0x2936;(function(_0x14a37a,_0x4f6af2){const _0x4d5ba8=a43_0x2936,_0x4a9a48=_0x14a37a();while(!![]){try{const _0x4cbece=-parseInt(_0x4d5ba8(0x188))/0x1+-parseInt(_0x4d5ba8(0x18b))/0x2*(parseInt(_0x4d5ba8(0x19d))/0x3)+-parseInt(_0x4d5ba8(0x194))/0x4+parseInt(_0x4d5ba8(0x198))/0x5*(parseInt(_0x4d5ba8(0x191))/0x6)+parseInt(_0x4d5ba8(0x1a0))/0x7+-parseInt(_0x4d5ba8(0x192))/0x8*(-parseInt(_0x4d5ba8(0x197))/0x9)+-parseInt(_0x4d5ba8(0x189))/0xa*(-parseInt(_0x4d5ba8(0x19b))/0xb);if(_0x4cbece===_0x4f6af2)break;else _0x4a9a48['push'](_0x4a9a48['shift']());}catch(_0x23598a){_0x4a9a48['push'](_0x4a9a48['shift']());}}}(a43_0x1b61,0xa31c5));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':a43_0x23af7b(0x199),'command':a43_0x23af7b(0x193),'description':a43_0x23af7b(0x195),'risk':a43_0x23af7b(0x19c),'flags':[SQLCODE_FLAG,{'name':a43_0x23af7b(0x18d),'type':a43_0x23af7b(0x19f),'description':a43_0x23af7b(0x1a2),'default':a43_0x23af7b(0x1a1),'enum':['sdk',a43_0x23af7b(0x1a3)]},{'name':a43_0x23af7b(0x18e),'type':'boolean','description':a43_0x23af7b(0x18c)}],async 'execute'(_0x117e04){const _0x5e420c=a43_0x23af7b,_0x176bca=await getSqlQueryInfo(_0x117e04[_0x5e420c(0x18a)],_0x117e04[_0x5e420c(0x19e)](_0x5e420c(0x19a))),_0x50dbac=_0x117e04[_0x5e420c(0x19e)]('target')||_0x5e420c(0x1a1),_0x4699e7=generateSqlCodeTemplate(_0x176bca,{'target':_0x50dbac,'includeImports':!_0x117e04[_0x5e420c(0x196)](_0x5e420c(0x18e))});return{'ok':!![],'data':{'sqlCode':_0x176bca[_0x5e420c(0x190)],'sqlName':_0x176bca[_0x5e420c(0x18f)],'target':_0x50dbac,'code':_0x4699e7}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x395364,_0x5658d4){const _0x4bf75d=a44_0x342d,_0x260008=_0x395364();while(!![]){try{const _0x3963d7=parseInt(_0x4bf75d(0x1da))/0x1*(parseInt(_0x4bf75d(0x1c5))/0x2)+-parseInt(_0x4bf75d(0x1bf))/0x3+parseInt(_0x4bf75d(0x1e0))/0x4+parseInt(_0x4bf75d(0x1bb))/0x5+-parseInt(_0x4bf75d(0x1c7))/0x6*(-parseInt(_0x4bf75d(0x1c8))/0x7)+parseInt(_0x4bf75d(0x1db))/0x8*(parseInt(_0x4bf75d(0x1ca))/0x9)+-parseInt(_0x4bf75d(0x1cb))/0xa*(parseInt(_0x4bf75d(0x1c0))/0xb);if(_0x3963d7===_0x5658d4)break;else _0x260008['push'](_0x260008['shift']());}catch(_0x359d75){_0x260008['push'](_0x260008['shift']());}}}(a44_0x14bf,0xa7794));import{CliErrors}from'../../errors.js';function a44_0x14bf(){const _0x595d2b=['1740168lCWwIZ','\x20<name>\x20--appcode\x20<code>','defaultApp','\x20<name>','bool','\x20<name>\x20[--global]','\x22\x20not\x20found.','\x20Default\x20app\x20is\x20\x22','510745TEHJbi','App\x20code','string','str','3383787bwbqwW','1353nMQcCf','appcode','\x20Note:\x20app\x20\x22','globalConfig','keys','2ZwYFKz','args','6SITKfH','1385251QJQCsj','Usage:\x20','9sOPqMR','24410SluHsE','Missing\x20app\x20name.','Removed\x20app\x20\x22','validation','App\x20\x22','Use\x20global\x20config\x20scope','\x22\x20still\x20defined\x20in\x20','Updated','\x20config.','length','\x20Default\x20app\x20changed\x20to\x20\x22','project','trim','apps','flagMissing','1256933MxGkPW','977016JhkfsH','projectConfig','\x22\x20(appcode:\x20','global','boolean'];a44_0x14bf=function(){return _0x595d2b;};return a44_0x14bf();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{collectAppProfileOverrides,getAppProfileFlagDefs,normalizeStoredDefaultApp}from'../../config/schema.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';function a44_0x342d(_0x1c7da0,_0xd1287){_0x1c7da0=_0x1c7da0-0x1bb;const _0x14bfa8=a44_0x14bf();let _0x342dd6=_0x14bfa8[_0x1c7da0];return _0x342dd6;}export function buildAppAddFlags(){const _0x4d67fc=a44_0x342d;return[{'name':_0x4d67fc(0x1c1),'type':_0x4d67fc(0x1bd),'description':_0x4d67fc(0x1bc),'required':!![]},{'name':'global','type':_0x4d67fc(0x1df),'description':'Use\x20global\x20config\x20scope','default':![]},...getAppProfileFlagDefs()];}export function buildAppRemoveFlags(){const _0xbdcac7=a44_0x342d;return[{'name':'global','type':'boolean','description':_0xbdcac7(0x1d0),'default':![]}];}export async function validateAppName(_0x430830,_0x593852){const _0x14f16f=a44_0x342d,_0x4f0f6c=_0x430830[_0x14f16f(0x1c6)][0x0]?.[_0x14f16f(0x1d7)]();if(!_0x4f0f6c)throw CliErrors[_0x14f16f(0x1ce)](_0x14f16f(0x1cc),_0x14f16f(0x1c9)+CLI_BIN_NAME+'\x20'+_0x593852+_0x14f16f(0x1e3));}export async function runAppAdd(_0x401f96,_0x1100da){const _0x4f7308=a44_0x342d,_0xa64f1c=_0x401f96[_0x4f7308(0x1c6)][0x0]?.[_0x4f7308(0x1d7)]();if(!_0xa64f1c)throw CliErrors[_0x4f7308(0x1ce)](_0x4f7308(0x1cc),_0x4f7308(0x1c9)+CLI_BIN_NAME+'\x20'+_0x1100da+_0x4f7308(0x1e1));const _0x1071d5=_0x401f96[_0x4f7308(0x1be)]('appcode');if(!_0x1071d5)throw CliErrors[_0x4f7308(0x1d9)](_0x4f7308(0x1c1),_0x4f7308(0x1c9)+CLI_BIN_NAME+'\x20'+_0x1100da+_0x4f7308(0x1e1));const _0x50609f={'global':_0x401f96[_0x4f7308(0x1e4)](_0x4f7308(0x1de))},_0x4544e1=readConfig(_0x50609f);if(!_0x4544e1[_0x4f7308(0x1d8)])_0x4544e1['apps']={};const _0x26ae03={'appcode':_0x1071d5,...collectAppProfileOverrides(_0x4cb1cf=>_0x401f96[_0x4f7308(0x1be)](_0x4cb1cf))},_0x243a25=_0x4544e1[_0x4f7308(0x1d8)],_0x27c47d=Object[_0x4f7308(0x1c4)](_0x243a25),_0x3bfa9a=typeof _0x4544e1['defaultApp']===_0x4f7308(0x1bd)&&_0x243a25[_0x4544e1['defaultApp']]?_0x4544e1[_0x4f7308(0x1e2)]:_0x27c47d['length']===0x1?_0x27c47d[0x0]:undefined,_0x44b65d=!!_0x243a25[_0xa64f1c];_0x243a25[_0xa64f1c]=_0x26ae03;const _0x49fafb=normalizeStoredDefaultApp(_0x4544e1,_0x3bfa9a);writeConfig(_0x4544e1,_0x50609f);const _0x1a1706=!_0x44b65d&&_0x49fafb?_0x4f7308(0x1e7)+_0x49fafb+'\x22.':'',_0x6b5934=(_0x44b65d?_0x4f7308(0x1d2):'Added')+'\x20app\x20\x22'+_0xa64f1c+_0x4f7308(0x1dd)+_0x1071d5+')'+scopeLabel(_0x50609f)+'.'+_0x1a1706;return{'ok':!![],'message':_0x6b5934};}export async function runAppRemove(_0x164a00,_0x225db1){const _0x54c2f4=a44_0x342d,_0x47de5c=_0x164a00['args'][0x0]?.[_0x54c2f4(0x1d7)]();if(!_0x47de5c)throw CliErrors['validation'](_0x54c2f4(0x1cc),_0x54c2f4(0x1c9)+CLI_BIN_NAME+'\x20'+_0x225db1+_0x54c2f4(0x1e5));const _0x58b927=_0x164a00[_0x54c2f4(0x1e4)](_0x54c2f4(0x1de)),{config:_0x419bbd,layers:_0x3be1f9}=readRawConfigWithLayers(),_0x817ae1=_0x419bbd[_0x54c2f4(0x1d8)]??{};if(!_0x817ae1[_0x47de5c])throw CliErrors['validation'](_0x54c2f4(0x1cf)+_0x47de5c+_0x54c2f4(0x1e6));const _0x2e758d=_0x3be1f9[_0x54c2f4(0x1c3)]['apps']&&typeof _0x3be1f9[_0x54c2f4(0x1c3)][_0x54c2f4(0x1d8)]==='object'?_0x3be1f9[_0x54c2f4(0x1c3)][_0x54c2f4(0x1d8)]:{},_0x38a046=_0x3be1f9[_0x54c2f4(0x1dc)][_0x54c2f4(0x1d8)]&&typeof _0x3be1f9['projectConfig']['apps']==='object'?_0x3be1f9[_0x54c2f4(0x1dc)][_0x54c2f4(0x1d8)]:{},_0x21e191=appDefinedIn(_0x47de5c,_0x2e758d,_0x38a046),_0x403429=resolveAppScopeForWrite(_0x47de5c,_0x58b927,_0x3be1f9),_0x147d68={'global':_0x403429===_0x54c2f4(0x1de)},_0x18baea=readConfig(_0x147d68),_0x271d35=_0x18baea[_0x54c2f4(0x1d8)];if(!_0x271d35||!_0x271d35[_0x47de5c])throw CliErrors[_0x54c2f4(0x1ce)](_0x54c2f4(0x1cf)+_0x47de5c+'\x22\x20not\x20found.');delete _0x271d35[_0x47de5c];let _0x1d1370='';const _0x1722ab=typeof _0x18baea[_0x54c2f4(0x1e2)]===_0x54c2f4(0x1bd)?_0x18baea[_0x54c2f4(0x1e2)]:undefined,_0x25b64a=Object[_0x54c2f4(0x1c4)](_0x271d35),_0x28113d=_0x1722ab===_0x47de5c?_0x25b64a[0x0]:_0x1722ab,_0x548724=normalizeStoredDefaultApp(_0x18baea,_0x28113d);if(_0x1722ab===_0x47de5c&&_0x25b64a[_0x54c2f4(0x1d4)]===0x1)_0x1d1370='\x20Remaining\x20app\x20\x22'+_0x25b64a[0x0]+'\x22\x20is\x20selected\x20automatically.';else _0x1722ab===_0x47de5c&&_0x548724&&(_0x1d1370=_0x54c2f4(0x1d5)+_0x548724+'\x22.');Object['keys'](_0x271d35)[_0x54c2f4(0x1d4)]===0x0&&(delete _0x18baea[_0x54c2f4(0x1d8)],delete _0x18baea['defaultApp']);writeConfig(_0x18baea,_0x147d68);const _0x31293a=_0x21e191==='both'?_0x54c2f4(0x1c2)+_0x47de5c+_0x54c2f4(0x1d1)+(_0x403429===_0x54c2f4(0x1d6)?_0x54c2f4(0x1de):'project')+_0x54c2f4(0x1d3):'';return{'ok':!![],'message':_0x54c2f4(0x1cd)+_0x47de5c+'\x22'+scopeLabel(_0x147d68)+'.'+_0x1d1370+_0x31293a};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x311a94,_0x4c441d){const _0x33f57f=a45_0x3afa,_0x42640a=_0x311a94();while(!![]){try{const _0x2c22eb=-parseInt(_0x33f57f(0x18b))/0x1*(parseInt(_0x33f57f(0x190))/0x2)+parseInt(_0x33f57f(0x1ac))/0x3*(parseInt(_0x33f57f(0x1a1))/0x4)+parseInt(_0x33f57f(0x19b))/0x5+parseInt(_0x33f57f(0x1aa))/0x6*(-parseInt(_0x33f57f(0x1a2))/0x7)+parseInt(_0x33f57f(0x1a9))/0x8*(parseInt(_0x33f57f(0x199))/0x9)+parseInt(_0x33f57f(0x18c))/0xa+-parseInt(_0x33f57f(0x1a4))/0xb;if(_0x2c22eb===_0x4c441d)break;else _0x42640a['push'](_0x42640a['shift']());}catch(_0x301ab3){_0x42640a['push'](_0x42640a['shift']());}}}(a45_0x4e7a,0x793f7));import{input,checkbox,select}from'@inquirer/prompts';import a45_0x2f6392 from'chalk';function a45_0x4e7a(){const _0x4cdc35=['(Skip;\x20configure\x20later)','appName','trim','755428DOAvSk','124103rdDccw','map','18420831SAyvuE','includes','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.','104mZpFba','54JVHinr','custom','15ZytGyl','yellow','No\x20available\x20apps\x20found.','29002KotMyl','1053120iObloR','cyan','✎\x20Enter\x20appcode\x20manually','App\x20Code:','18STJcaT','Fetching\x20available\x20apps...','valid','gray','(No\x20login\x20session.\x20Enter\x20an\x20App\x20Code\x20manually\x20or\x20skip.)','\x20apps.\x20Select\x20with\x20space,\x20a=all,\x20i=invert:','Invalid\x20App\x20Code','Select\x20the\x20app\x20to\x20bind:','skip','439623KocwME','(Skip;\x20configure\x20later\x20with\x20config\x20set\x20appcode)','4536115esFSTg','appCode','message'];a45_0x4e7a=function(){return _0x4cdc35;};return a45_0x4e7a();}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 _0x4398f6=a45_0x3afa,_0x2d9d84=await input({'message':'App\x20Code:','validate':_0x178540=>{const _0x336f91=a45_0x3afa,_0x31de2c=validateAppcode(_0x178540[_0x336f91(0x1a0)]());return _0x31de2c[_0x336f91(0x192)]||_0x31de2c[_0x336f91(0x19d)]||_0x336f91(0x196);}});return _0x2d9d84[_0x4398f6(0x1a0)]();}export async function promptAppSelection(_0x4b9cb5){const _0x47bd0e=a45_0x3afa,_0x281f2e=[{'name':a45_0x2f6392[_0x47bd0e(0x1ad)](_0x47bd0e(0x18e)),'value':-0x1},..._0x4b9cb5['map']((_0x1e04d2,_0x289e52)=>({'name':_0x1e04d2['appName']+'\x20\x20'+a45_0x2f6392[_0x47bd0e(0x193)]('('+_0x1e04d2[_0x47bd0e(0x19c)]+')'),'value':_0x289e52}))],_0x545532=await checkbox({'message':'Found\x20'+a45_0x2f6392[_0x47bd0e(0x18d)](_0x4b9cb5[_0x47bd0e(0x1a6)])+_0x47bd0e(0x195),'choices':_0x281f2e,'loop':![]});if(_0x545532[_0x47bd0e(0x1a5)](-0x1))return _0x47bd0e(0x1ab);if(_0x545532['length']===0x0)return _0x47bd0e(0x1ab);return _0x545532[_0x47bd0e(0x1a3)](_0x4fdbfb=>_0x4b9cb5[_0x4fdbfb]);}export async function promptSingleAppSelection(_0x620f5c){const _0x325940=a45_0x3afa,_0x67822b=[{'name':a45_0x2f6392[_0x325940(0x193)](_0x325940(0x19a)),'value':_0x325940(0x198)},{'name':a45_0x2f6392[_0x325940(0x1ad)](_0x325940(0x18e)),'value':_0x325940(0x1ab)},..._0x620f5c[_0x325940(0x1a3)](_0x2ef97d=>({'name':_0x2ef97d[_0x325940(0x19f)]+'\x20\x20'+a45_0x2f6392[_0x325940(0x193)]('('+_0x2ef97d[_0x325940(0x19c)]+')'),'value':_0x2ef97d[_0x325940(0x19c)]}))],_0x413c26=await select({'message':_0x325940(0x197),'choices':_0x67822b});if(_0x413c26===_0x325940(0x198))return _0x325940(0x198);if(_0x413c26===_0x325940(0x1ab))return _0x325940(0x1ab);return _0x620f5c['find'](_0x3471b4=>_0x3471b4[_0x325940(0x19c)]===_0x413c26);}function a45_0x3afa(_0x59c298,_0x11419d){_0x59c298=_0x59c298-0x18b;const _0x4e7a03=a45_0x4e7a();let _0x3afae2=_0x4e7a03[_0x59c298];return _0x3afae2;}export async function selectSingleAppcode(_0x491292){const _0x2a1353=a45_0x3afa;if(!_0x491292)return writeCliSideChannelLine(a45_0x2f6392[_0x2a1353(0x193)](_0x2a1353(0x194))),_fallbackOrSkip();writeCliSideChannelLine(_0x2a1353(0x191));let _0x110635;try{_0x110635=await withActiveCookie(_0x491292,()=>listRemoteApps());}catch(_0x321b99){writeCliSideChannelLine(a45_0x2f6392['yellow'](_0x2a1353(0x1a8)));if(_0x321b99 instanceof Error)writeCliSideChannelLine(a45_0x2f6392['gray']('\x20\x20('+_0x321b99[_0x2a1353(0x19d)]+')'));return _fallbackOrSkip();}if(_0x110635[_0x2a1353(0x1a6)]===0x0)return writeCliSideChannelLine(a45_0x2f6392[_0x2a1353(0x1ad)](_0x2a1353(0x1ae))),_fallbackOrSkip();const _0xf41b37=await promptSingleAppSelection(_0x110635);if(_0xf41b37===_0x2a1353(0x198))return'';if(_0xf41b37===_0x2a1353(0x1ab))return promptCustomAppcode();return _0xf41b37[_0x2a1353(0x19c)];}export async function selectMultipleApps(_0x397239){const _0x1081d5=a45_0x3afa;writeCliSideChannelLine('Fetching\x20available\x20apps...');let _0x4e0cfb;try{_0x4e0cfb=await withActiveCookie(_0x397239,()=>listRemoteApps());}catch(_0x1cc57f){writeCliSideChannelLine(_0x1081d5(0x1a7));if(_0x1cc57f instanceof Error)writeCliSideChannelLine('\x20\x20('+_0x1cc57f[_0x1081d5(0x19d)]+')');return _0x1081d5(0x1ab);}if(_0x4e0cfb[_0x1081d5(0x1a6)]===0x0)return writeCliSideChannelLine('\x0aNo\x20available\x20apps\x20found.'),_0x1081d5(0x1ab);return promptAppSelection(_0x4e0cfb);}async function _fallbackOrSkip(){const _0x299730=a45_0x3afa,_0x2c207c=await select({'message':_0x299730(0x18f),'choices':[{'name':a45_0x2f6392[_0x299730(0x193)](_0x299730(0x19e)),'value':_0x299730(0x198)},{'name':a45_0x2f6392[_0x299730(0x1ad)]('✎\x20Enter\x20manually'),'value':'manual'}]});if(_0x2c207c===_0x299730(0x198))return'';return promptCustomAppcode();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x4161e3=a46_0x1de9;(function(_0x390a51,_0x1257cb){const _0x51710e=a46_0x1de9,_0x5e44f2=_0x390a51();while(!![]){try{const _0x5841bb=-parseInt(_0x51710e(0x198))/0x1*(-parseInt(_0x51710e(0x1a3))/0x2)+parseInt(_0x51710e(0x1a0))/0x3*(parseInt(_0x51710e(0x197))/0x4)+parseInt(_0x51710e(0x187))/0x5*(parseInt(_0x51710e(0x191))/0x6)+-parseInt(_0x51710e(0x195))/0x7*(parseInt(_0x51710e(0x18d))/0x8)+-parseInt(_0x51710e(0x185))/0x9+parseInt(_0x51710e(0x190))/0xa+-parseInt(_0x51710e(0x18b))/0xb;if(_0x5841bb===_0x1257cb)break;else _0x5e44f2['push'](_0x5e44f2['shift']());}catch(_0x2bf166){_0x5e44f2['push'](_0x5e44f2['shift']());}}}(a46_0x47aa,0xb9231));import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';function a46_0x1de9(_0x59b360,_0x2efab2){_0x59b360=_0x59b360-0x183;const _0x47aa14=a46_0x47aa();let _0x1de994=_0x47aa14[_0x59b360];return _0x1de994;}const TERMINAL_STATUSES=new Set([a46_0x4161e3(0x186),a46_0x4161e3(0x18c)]),NON_TERMINAL_STATUSES=new Set([a46_0x4161e3(0x19a),a46_0x4161e3(0x19d)]);function a46_0x47aa(){const _0x1da66f=['11813cEbZPf','\x20failed.','PENDING','Task\x20','status','PROCESSING','\x20returned\x20unknown\x20status\x20','\x20is\x20processing.','51eVpdIR','has','\x20is\x20pending.','218Ixbjew','taskId','trim','\x20response\x20did\x20not\x20contain\x20a\x20status.','\x27\x5c\x27\x27','string','6883938VLOwKw','SUCCESS','20ceXBRG','toUpperCase','\x20--format\x20compress','\x20--appcode\x20','5020818vtjPls','FAILED','8BnuqKY','apiError','\x20task\x20status\x20--task-id\x20','4811100yzSWCw','127854bqITsl','errorMessage','replace','\x20completed\x20successfully.','8707370Tqwkpw','Async\x20task\x20response\x20did\x20not\x20contain\x20a\x20taskId.','322256GcKYpV'];a46_0x47aa=function(){return _0x1da66f;};return a46_0x47aa();}export function normalizeAsyncTask(_0x363a7c){const _0x4c3354=a46_0x4161e3,_0x3ba0e3=typeof _0x363a7c?.[_0x4c3354(0x1a4)]==='string'?_0x363a7c[_0x4c3354(0x1a4)][_0x4c3354(0x1a5)]():'';if(!_0x3ba0e3)throw CliErrors[_0x4c3354(0x18e)](_0x4c3354(0x196));const _0x10a21d=typeof _0x363a7c[_0x4c3354(0x19c)]===_0x4c3354(0x184)?_0x363a7c['status']['trim']()[_0x4c3354(0x188)]():'';if(!_0x10a21d)throw CliErrors[_0x4c3354(0x18e)]('Async\x20task\x20'+_0x3ba0e3+_0x4c3354(0x1a6));return{'taskId':_0x3ba0e3,'status':_0x10a21d,'errorMessage':typeof _0x363a7c['errorMessage']===_0x4c3354(0x184)&&_0x363a7c[_0x4c3354(0x192)][_0x4c3354(0x1a5)]()?_0x363a7c['errorMessage'][_0x4c3354(0x1a5)]():null,'isTerminal':TERMINAL_STATUSES[_0x4c3354(0x1a1)](_0x10a21d),'knownStatus':TERMINAL_STATUSES['has'](_0x10a21d)||NON_TERMINAL_STATUSES[_0x4c3354(0x1a1)](_0x10a21d)};}export function buildAsyncTaskStatusCommand(_0x76cae3,_0x13def0){const _0xb8fe67=a46_0x4161e3;return CLI_BIN_NAME+_0xb8fe67(0x18f)+quoteShellArg(_0x76cae3)+_0xb8fe67(0x18a)+quoteShellArg(_0x13def0)+_0xb8fe67(0x189);}export function asyncTaskMessage(_0x2a3652){const _0x499038=a46_0x4161e3;switch(_0x2a3652['status']){case _0x499038(0x19a):return _0x499038(0x19b)+_0x2a3652[_0x499038(0x1a4)]+_0x499038(0x1a2);case _0x499038(0x19d):return'Task\x20'+_0x2a3652['taskId']+_0x499038(0x19f);case _0x499038(0x186):return _0x499038(0x19b)+_0x2a3652[_0x499038(0x1a4)]+_0x499038(0x194);case _0x499038(0x18c):return _0x2a3652[_0x499038(0x192)]?_0x499038(0x19b)+_0x2a3652[_0x499038(0x1a4)]+'\x20failed:\x20'+_0x2a3652['errorMessage']:'Task\x20'+_0x2a3652[_0x499038(0x1a4)]+_0x499038(0x199);default:return _0x499038(0x19b)+_0x2a3652[_0x499038(0x1a4)]+_0x499038(0x19e)+_0x2a3652[_0x499038(0x19c)]+'.';}}function quoteShellArg(_0x5bdd8b){const _0x550e01=a46_0x4161e3;return'\x27'+_0x5bdd8b[_0x550e01(0x193)](/'/g,_0x550e01(0x183))+'\x27';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a47_0x191c(_0x133a11,_0x57d2d4){_0x133a11=_0x133a11-0xb7;var _0x55ed2d=a47_0x55ed();var _0x191cf0=_0x55ed2d[_0x133a11];return _0x191cf0;}(function(_0x87c8ab,_0x1dac2c){var _0x1bb98d=a47_0x191c,_0x2876b8=_0x87c8ab();while(!![]){try{var _0x4c04ab=-parseInt(_0x1bb98d(0xbe))/0x1*(parseInt(_0x1bb98d(0xc2))/0x2)+parseInt(_0x1bb98d(0xc3))/0x3*(parseInt(_0x1bb98d(0xba))/0x4)+-parseInt(_0x1bb98d(0xb8))/0x5+parseInt(_0x1bb98d(0xc1))/0x6*(parseInt(_0x1bb98d(0xbd))/0x7)+-parseInt(_0x1bb98d(0xb9))/0x8*(parseInt(_0x1bb98d(0xbb))/0x9)+parseInt(_0x1bb98d(0xb7))/0xa+-parseInt(_0x1bb98d(0xbf))/0xb;if(_0x4c04ab===_0x1dac2c)break;else _0x2876b8['push'](_0x2876b8['shift']());}catch(_0x363efa){_0x2876b8['push'](_0x2876b8['shift']());}}}(a47_0x55ed,0xde604));export function asDryRunResult(_0x471826,_0xcc71d8){var _0x4e308e=a47_0x191c;return Object[_0x4e308e(0xbc)](_0x471826,{'method':{'value':_0xcc71d8[_0x4e308e(0xc5)],'enumerable':![]},'url':{'value':_0xcc71d8[_0x4e308e(0xc4)],'enumerable':![]},..._0xcc71d8['description']?{'description':{'value':_0xcc71d8[_0x4e308e(0xc0)],'enumerable':![]}}:{}});}function a47_0x55ed(){var _0x5b0a43=['9clJUGr','defineProperties','35714jgdYyL','392827HDwGEK','6297841ojwRsh','description','252BiNQzh','2kyHHqn','27BDLcUq','url','method','4180350YeEnzR','1017815Pnbgkb','1244072sHFWmO','712428MPGbWz'];a47_0x55ed=function(){return _0x5b0a43;};return a47_0x55ed();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x5601d8=a48_0x13d8;(function(_0x528462,_0x20e6ef){const _0x232c13=a48_0x13d8,_0x4a7c8f=_0x528462();while(!![]){try{const _0x2fb39d=-parseInt(_0x232c13(0x15c))/0x1*(-parseInt(_0x232c13(0x160))/0x2)+-parseInt(_0x232c13(0x153))/0x3*(-parseInt(_0x232c13(0x169))/0x4)+parseInt(_0x232c13(0x159))/0x5+parseInt(_0x232c13(0x165))/0x6+-parseInt(_0x232c13(0x154))/0x7*(-parseInt(_0x232c13(0x156))/0x8)+-parseInt(_0x232c13(0x15a))/0x9+-parseInt(_0x232c13(0x164))/0xa*(parseInt(_0x232c13(0x158))/0xb);if(_0x2fb39d===_0x20e6ef)break;else _0x4a7c8f['push'](_0x4a7c8f['shift']());}catch(_0xff9428){_0x4a7c8f['push'](_0x4a7c8f['shift']());}}}(a48_0x2dd1,0xcee76));export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}(?:_[^_\s]+_[^_\s]+)?$/i,'description':a48_0x5601d8(0x168)};export const CODE_FLAG={'name':'code','type':a48_0x5601d8(0x163),'required':!![],'description':'Dataset\x20code\x20(32-char\x20hex,\x20optionally\x20with\x20_xx_xx\x20suffix)','pattern':DATASET_CODE_PATTERN};export const CODE_FLAG_OPTIONAL={...CODE_FLAG,'required':![]};export const DATASETCODE_FLAG_OPTIONAL={...CODE_FLAG_OPTIONAL,'name':a48_0x5601d8(0x167),'description':a48_0x5601d8(0x152)};export const SQLCODE_FLAG={'name':'sqlcode','type':a48_0x5601d8(0x163),'required':!![],'description':a48_0x5601d8(0x166),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a48_0x5601d8(0x15b)}};function a48_0x13d8(_0x206b76,_0x15b206){_0x206b76=_0x206b76-0x152;const _0x2dd181=a48_0x2dd1();let _0x13d855=_0x2dd181[_0x206b76];return _0x13d855;}export const APPCODE_FLAG_OPTIONAL={'name':a48_0x5601d8(0x161),'type':a48_0x5601d8(0x163),'required':![],'description':'App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)'};export const APPCODE_FLAG={...APPCODE_FLAG_OPTIONAL,'required':!![],'description':a48_0x5601d8(0x15e)};export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};export const DBLINK_ID_FLAG={'name':'id','type':a48_0x5601d8(0x15f),'required':!![],'description':'Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)'};function a48_0x2dd1(){const _0x17139b=['a\x2032-character\x20hex\x20code,\x20optionally\x20with\x20`_xx_xx`\x20suffix\x20(e.g.\x2099a909313f1fa7153186431e1c551588\x20or\x2099a909313f1fa7153186431e1c551588_75_3c7120aa)','444kCMLvr','Dataset\x20code\x20(32-char\x20hex,\x20optionally\x20with\x20_xx_xx\x20suffix)','14103GnSnUU','11511395xaNXGN','skip-connection-test','8XVcZIs','Skip\x20testing\x20the\x20unsaved\x20database\x20configuration\x20before\x20create/update','28424MXoJnP','4777980rBkwFZ','15018165NDHvDl','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','126ZRiQAT','Database\x20product\x20type','App\x20code\x20(e.g.\x20app-xxxxx)','number','916NfSgFq','appcode','POSTGRESQL','string','8270cMApbc','8841186LgTZPy','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','datasetcode'];a48_0x2dd1=function(){return _0x17139b;};return a48_0x2dd1();}export const DB_TYPE_FLAG={'name':'dbtype','type':a48_0x5601d8(0x163),'required':!![],'description':a48_0x5601d8(0x15d),'enum':['MYSQL',a48_0x5601d8(0x162)]};export const SKIP_CONNECTION_TEST_FLAG={'name':a48_0x5601d8(0x155),'type':'boolean','description':a48_0x5601d8(0x157)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2bed6a,_0x4ab6c6){const _0x4f85ca=a49_0x8625,_0x26b5a9=_0x2bed6a();while(!![]){try{const _0x47d881=parseInt(_0x4f85ca(0xee))/0x1+-parseInt(_0x4f85ca(0xe6))/0x2*(-parseInt(_0x4f85ca(0xe4))/0x3)+parseInt(_0x4f85ca(0xe1))/0x4+parseInt(_0x4f85ca(0xe7))/0x5*(-parseInt(_0x4f85ca(0xf2))/0x6)+parseInt(_0x4f85ca(0xe2))/0x7*(parseInt(_0x4f85ca(0xf0))/0x8)+parseInt(_0x4f85ca(0xef))/0x9*(parseInt(_0x4f85ca(0xe5))/0xa)+-parseInt(_0x4f85ca(0xe9))/0xb;if(_0x47d881===_0x4ab6c6)break;else _0x26b5a9['push'](_0x26b5a9['shift']());}catch(_0x541b5e){_0x26b5a9['push'](_0x26b5a9['shift']());}}}(a49_0x4820,0x6177b));function a49_0x4820(){const _0x487d81=['233280NjwTVt','1315517elXJUV','File\x20is\x20not\x20a\x20regular\x20file:\x20','1276737MEFbfA','10lmphjB','2OBFzsY','658255zmPvWF','trim','11890131ORJkEn','\x20path\x20is\x20required.','isFile','size','File\x20exceeds\x20the\x20development\x20upload\x20limit\x20of\x2050\x20MB:\x20','204400DkREyA','3237363PtiNxF','24FkSGmb','\x20MB','6rymTIa','validation','ceil','File\x20not\x20found:\x20'];a49_0x4820=function(){return _0x487d81;};return a49_0x4820();}import{existsSync,statSync}from'node:fs';import{CliErrors}from'../../errors.js';function a49_0x8625(_0x110f46,_0xc03e9d){_0x110f46=_0x110f46-0xe0;const _0x48200c=a49_0x4820();let _0x8625f=_0x48200c[_0x110f46];return _0x8625f;}const BYTES_PER_MB=0x400*0x400;export const DEVELOPMENT_UPLOAD_MAX_BYTES=0x32*BYTES_PER_MB;function formatBytes(_0x46d2a9){const _0x3ae74f=a49_0x8625;if(_0x46d2a9>=BYTES_PER_MB){const _0xffbd42=Math[_0x3ae74f(0xf4)](_0x46d2a9/BYTES_PER_MB*0x64)/0x64;return _0xffbd42['toFixed'](0x2)+_0x3ae74f(0xf1);}return _0x46d2a9+'\x20B';}export function requireDevelopmentUploadFile(_0xfb76f8,_0x2c07da){const _0x269c43=a49_0x8625,_0x26384b=_0xfb76f8[_0x269c43(0xe8)]();if(!_0x26384b)throw CliErrors[_0x269c43(0xf3)](_0x2c07da+_0x269c43(0xea));if(!existsSync(_0x26384b))throw CliErrors['validation'](_0x269c43(0xe0)+_0x26384b);const _0x466860=statSync(_0x26384b);if(!_0x466860[_0x269c43(0xeb)]())throw CliErrors['validation'](_0x269c43(0xe3)+_0x26384b);if(_0x466860[_0x269c43(0xec)]>DEVELOPMENT_UPLOAD_MAX_BYTES)throw CliErrors['validation'](_0x269c43(0xed)+_0x26384b+'\x20('+formatBytes(_0x466860[_0x269c43(0xec)])+')');return{'path':_0x26384b,'size':_0x466860['size']};}
|