@lovrabet/rabetbase-cli 2.5.0 → 2.5.1-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.d.ts +7 -0
- 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-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-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/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/domain-config.d.ts +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-routing.d.ts +30 -0
- package/lib/config/project-routing.js +1 -0
- 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 +7 -2
- 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.d.ts +2 -2
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.d.ts +115 -0
- package/lib/constant/routing-profile.js +1 -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.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/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 -2
- package/skills/rabetbase/SKILL.md +10 -5
- package/skills/rabetbase/guides/frontend-development.md +2 -0
- package/skills/rabetbase/guides/sdk-client-generation.md +3 -2
- package/skills/rabetbase/guides/typescript-sdk.md +42 -0
- package/skills/rabetbase/references/rabetbase-api-pull.md +5 -3
- package/skills/rabetbase/references/rabetbase-config.md +9 -5
- package/skills/rabetbase/references/rabetbase-init.md +11 -5
- package/skills/rabetbase/references/rabetbase-project-create.md +6 -5
- package/skills/rabetbase.manifest.json +3 -3
- package/templates/README.md +13 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x26e9ee,_0x46d2d4){const _0x1c0f20=a34_0x3183,_0x5371e4=_0x26e9ee();while(!![]){try{const _0x209940=parseInt(_0x1c0f20(0xab))/0x1*(parseInt(_0x1c0f20(0xa9))/0x2)+parseInt(_0x1c0f20(0xa8))/0x3+parseInt(_0x1c0f20(0xac))/0x4*(parseInt(_0x1c0f20(0xae))/0x5)+-parseInt(_0x1c0f20(0xa6))/0x6*(parseInt(_0x1c0f20(0xaa))/0x7)+-parseInt(_0x1c0f20(0xaf))/0x8+parseInt(_0x1c0f20(0xa7))/0x9*(parseInt(_0x1c0f20(0xa5))/0xa)+-parseInt(_0x1c0f20(0xad))/0xb;if(_0x209940===_0x46d2d4)break;else _0x5371e4['push'](_0x5371e4['shift']());}catch(_0x37a7c3){_0x5371e4['push'](_0x5371e4['shift']());}}}(a34_0x3ddf,0xac2f9));import{bffList}from'../../commands/bff/list.js';function a34_0x3ddf(){const _0x5f1c25=['459753TuczLQ','9633meUXzF','468UkDGcX','20599744SSCOfQ','35345gVugJJ','141704gxRaDG','10MRLzaT','18DSJvuJ','7800048jVOBUC','551541iLqMPD','190lHJHHk'];a34_0x3ddf=function(){return _0x5f1c25;};return a34_0x3ddf();}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_0x3183(_0x6de6,_0x280e9e){_0x6de6=_0x6de6-0xa5;const _0x3ddf10=a34_0x3ddf();let _0x31831f=_0x3ddf10[_0x6de6];return _0x31831f;}import{bffDelete}from'../../commands/bff/delete.js';export const bffDefinitions=[bffList,bffDetail,bffStatus,bffCreate,bffPush,bffPull,bffDelete];
|
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a35_0x2478(){const _0x598e9e=['3156797KNCxWQ','bool','appCode','128250RwJRcX','12uuLuEY','6wzESwL','(unnamed)','COMMON','ENDPOINT','Script\x20type\x20filter','read','List\x20Backend\x20Function\x20scripts','string','138063GLAQru','1278wcodXe','44809193SessaJ','functionName','3660910vOwiRD','8YdHnzx','name','299595KGkpgM','No\x20Backend\x20Function\x20scripts\x20found.','Return\x20full\x20script\x20objects','11403576akzvXO','scriptType','boolean','str','Filter\x20by\x20script\x20name','24sYcNpH','bff','type','verbose','map'];a35_0x2478=function(){return _0x598e9e;};return a35_0x2478();}const a35_0x6db9ad=a35_0x171b;function a35_0x171b(_0x368fc7,_0x5ee877){_0x368fc7=_0x368fc7-0x1a8;const _0x247880=a35_0x2478();let _0x171b79=_0x247880[_0x368fc7];return _0x171b79;}(function(_0x324f62,_0x157046){const _0x370b7c=a35_0x171b,_0x9ba99a=_0x324f62();while(!![]){try{const _0x487f9c=-parseInt(_0x370b7c(0x1b9))/0x1+parseInt(_0x370b7c(0x1c1))/0x2*(-parseInt(_0x370b7c(0x1b2))/0x3)+-parseInt(_0x370b7c(0x1b7))/0x4*(parseInt(_0x370b7c(0x1b6))/0x5)+-parseInt(_0x370b7c(0x1aa))/0x6*(parseInt(_0x370b7c(0x1c6))/0x7)+parseInt(_0x370b7c(0x1bc))/0x8+parseInt(_0x370b7c(0x1b3))/0x9*(-parseInt(_0x370b7c(0x1a8))/0xa)+parseInt(_0x370b7c(0x1b4))/0xb*(parseInt(_0x370b7c(0x1a9))/0xc);if(_0x487f9c===_0x157046)break;else _0x9ba99a['push'](_0x9ba99a['shift']());}catch(_0x58dc47){_0x9ba99a['push'](_0x9ba99a['shift']());}}}(a35_0x2478,0xde556));import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':a35_0x6db9ad(0x1c2),'command':'list','description':a35_0x6db9ad(0x1b0),'risk':a35_0x6db9ad(0x1af),'flags':[{'name':a35_0x6db9ad(0x1c3),'type':a35_0x6db9ad(0x1b1),'description':a35_0x6db9ad(0x1ae),'default':a35_0x6db9ad(0x1ad),'enum':[a35_0x6db9ad(0x1ad),a35_0x6db9ad(0x1ac)]},{'name':a35_0x6db9ad(0x1b8),'type':a35_0x6db9ad(0x1b1),'description':a35_0x6db9ad(0x1c0)},{'name':a35_0x6db9ad(0x1c4),'type':a35_0x6db9ad(0x1be),'description':a35_0x6db9ad(0x1bb)}],async 'execute'(_0x5df8d0){const _0x3d1736=a35_0x6db9ad,_0x62b575=await listBffScripts(_0x5df8d0[_0x3d1736(0x1c8)],_0x5df8d0['str']('type'),{'scriptName':_0x5df8d0[_0x3d1736(0x1bf)](_0x3d1736(0x1b8))||undefined}),_0x33308b=_0x5df8d0[_0x3d1736(0x1c7)](_0x3d1736(0x1c4));return{'ok':!![],'data':_0x33308b?_0x62b575:_0x62b575[_0x3d1736(0x1c5)](_0x296f1c=>({'id':_0x296f1c['id'],'functionName':_0x296f1c[_0x3d1736(0x1b5)]??'','description':_0x296f1c['description']||_0x3d1736(0x1ab),'scriptType':_0x296f1c[_0x3d1736(0x1bd)]})),'message':_0x62b575['length']===0x0?_0x3d1736(0x1ba):undefined};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x2b4001=a36_0x3624;(function(_0x1d4994,_0xd5d4fe){const _0x2da2a4=a36_0x3624,_0x4f6735=_0x1d4994();while(!![]){try{const _0x5dfc75=-parseInt(_0x2da2a4(0xbc))/0x1*(parseInt(_0x2da2a4(0xb9))/0x2)+parseInt(_0x2da2a4(0xc7))/0x3*(parseInt(_0x2da2a4(0xbd))/0x4)+-parseInt(_0x2da2a4(0xa2))/0x5+-parseInt(_0x2da2a4(0x96))/0x6*(parseInt(_0x2da2a4(0x8e))/0x7)+parseInt(_0x2da2a4(0xb7))/0x8*(-parseInt(_0x2da2a4(0xb1))/0x9)+parseInt(_0x2da2a4(0xd3))/0xa*(parseInt(_0x2da2a4(0xa1))/0xb)+parseInt(_0x2da2a4(0x9a))/0xc;if(_0x5dfc75===_0xd5d4fe)break;else _0x4f6735['push'](_0x4f6735['shift']());}catch(_0x1d090b){_0x4f6735['push'](_0x4f6735['shift']());}}}(a36_0x4b46,0xd4d95));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';function a36_0x3624(_0x5a133e,_0x25bf49){_0x5a133e=_0x5a133e-0x87;const _0x4b46b9=a36_0x4b46();let _0x362496=_0x4b46b9[_0x5a133e];return _0x362496;}import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':'bff','command':a36_0x2b4001(0xac),'description':a36_0x2b4001(0xb5),'risk':a36_0x2b4001(0x8c),'flags':[{'name':a36_0x2b4001(0xa9),'type':'string','description':a36_0x2b4001(0xb4),'enum':['COMMON','ENDPOINT','HOOK']},{'name':a36_0x2b4001(0xa7),'type':a36_0x2b4001(0x91),'description':a36_0x2b4001(0xbb)}],async 'dryRun'(_0x368a5a){const _0x27a305=a36_0x2b4001,_0x8e73da=loadBffProjectConfig(_0x368a5a[_0x27a305(0xd0)]),_0x5becac=await readBffLockFile(_0x8e73da[_0x27a305(0x8f)]),{appLock:_0x4e9db7}=ensureLockScope(_0x5becac??createEmptyBffLock(),_0x368a5a['appCode'],_0x8e73da['scriptsRoot'],_0x27a305(0xac)),_0x532260=normalizeBffType(_0x368a5a[_0x27a305(0xcc)](_0x27a305(0xa9)))??undefined,_0x129598=buildDatasetCodeToAliasMap(_0x368a5a[_0x27a305(0xd2)],_0x368a5a[_0x27a305(0xd0)]),[_0x3827f6,_0x505482]=await Promise[_0x27a305(0xaa)]([listBffScripts(_0x368a5a[_0x27a305(0xd0)],_0x532260),getBffScriptStatistics(_0x368a5a['appCode'])]),_0x1de996=createHookLocationMap(_0x505482),_0x5e2555=[];for(const _0x551fb3 of _0x3827f6){const _0x581736=resolveRemoteScriptTarget(_0x8e73da,_0x551fb3,_0x1de996,_0x4e9db7['functions'],_0x129598);if(!_0x581736){_0x5e2555[_0x27a305(0xab)]({'scriptType':_0x551fb3[_0x27a305(0xba)],'functionName':_0x551fb3[_0x27a305(0xc8)]??'','status':_0x27a305(0xca),'reason':_0x27a305(0xae)});continue;}const _0x1bc0b9=_0x4e9db7[_0x27a305(0xa6)][_0x581736[_0x27a305(0x99)]],_0x4caf5d=_0x551fb3[_0x27a305(0xc0)]!=null?computeContentHash(_0x551fb3[_0x27a305(0xc0)]):undefined,_0x4844cf=await hasUnsyncedLocalChanges(_0x581736[_0x27a305(0xa5)],_0x1bc0b9,_0x4caf5d);_0x5e2555['push']({'lockKey':_0x581736[_0x27a305(0x99)],'filePath':_0x581736[_0x27a305(0xa5)],'remoteId':_0x551fb3['id']??null,'status':_0x4844cf?_0x27a305(0xc9):'would_pull'});}return{'method':_0x27a305(0x8a),'url':_0x27a305(0xb8)+_0x368a5a[_0x27a305(0xd0)]+(_0x532260?_0x27a305(0x9d)+_0x532260:''),'body':{'appCode':_0x368a5a['appCode'],'filterType':_0x532260??null,'files':_0x5e2555},'description':_0x27a305(0x8d)+_0x5e2555[_0x27a305(0x9f)]+_0x27a305(0x92)};},async 'execute'(_0x27b118){const _0x4a62f3=a36_0x2b4001,_0x3dfe21=loadBffProjectConfig(_0x27b118[_0x4a62f3(0xd0)]),_0x2505c2=await readBffLockFile(_0x3dfe21[_0x4a62f3(0x8f)]),{lockData:_0x1a495a,appLock:_0x4f3389}=ensureLockScope(_0x2505c2??createEmptyBffLock(),_0x27b118['appCode'],_0x3dfe21['scriptsRoot'],_0x4a62f3(0xac)),_0x3df14f=normalizeBffType(_0x27b118['str'](_0x4a62f3(0xa9)))??undefined;if(_0x27b118['str']('type')&&!_0x3df14f)throw CliErrors[_0x4a62f3(0x8b)](_0x4a62f3(0xb6));const [_0xe9991b,_0x4ac901]=await Promise[_0x4a62f3(0xaa)]([listBffScripts(_0x27b118['appCode'],_0x3df14f),getBffScriptStatistics(_0x27b118[_0x4a62f3(0xd0)])]);if(_0xe9991b[_0x4a62f3(0x9f)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x4a62f3(0xa8)};const _0x47a0ab=_0x27b118[_0x4a62f3(0x9b)](_0x4a62f3(0xa7));if(_0x47a0ab&&!_0x27b118['nonInteractive']){const _0x1f199d=await confirmForce();if(!_0x1f199d)throw CliErrors['cancelled'](_0x4a62f3(0xcb));}if(_0x47a0ab&&_0x27b118[_0x4a62f3(0xc1)]){}const _0x539f49=buildDatasetCodeToAliasMap(_0x27b118[_0x4a62f3(0xd2)],_0x27b118['appCode']),_0x287d22=createHookLocationMap(_0x4ac901),_0x510639=JSON[_0x4a62f3(0xc4)](JSON[_0x4a62f3(0x87)](_0x1a495a)),_0x36bbb6=_0x27b118[_0x4a62f3(0xd0)],_0xdc1010=_0x510639[_0x4a62f3(0xc2)][_0x36bbb6];if(!_0xdc1010)throw new Error(_0x4a62f3(0x94)+_0x36bbb6+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x4523d2=[],_0x568f70=[],_0x1b9eb9=[];for(const _0x27a117 of _0xe9991b){const _0x333d2a=resolveRemoteScriptTarget(_0x3dfe21,_0x27a117,_0x287d22,_0x4f3389['functions'],_0x539f49);if(!_0x333d2a){_0x568f70[_0x4a62f3(0xab)]({'lockKey':_0x27a117['scriptType']+'/'+_0x27a117[_0x4a62f3(0xc8)],'reason':_0x4a62f3(0xae)});continue;}const _0x576800=_0x4f3389[_0x4a62f3(0xa6)][_0x333d2a[_0x4a62f3(0x99)]];try{if(!_0x27a117['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0x27a117[_0x4a62f3(0xc0)]==null)throw new Error(_0x4a62f3(0xa3));const _0x49986e=_0x27a117[_0x4a62f3(0xc0)],_0x4c9a5b=computeContentHash(_0x49986e);if(!_0x47a0ab){const _0x4186a8=await hasUnsyncedLocalChanges(_0x333d2a[_0x4a62f3(0xa5)],_0x576800,_0x4c9a5b);if(_0x4186a8){_0x568f70[_0x4a62f3(0xab)]({'lockKey':_0x333d2a[_0x4a62f3(0x99)],'reason':_0x4a62f3(0xad)});continue;}}await ensureParentDirectory(_0x333d2a[_0x4a62f3(0xa5)]),await writeFile(_0x333d2a[_0x4a62f3(0xa5)],_0x49986e,_0x4a62f3(0xaf));const _0x346ebb={'hash':_0x4c9a5b,'remoteId':_0x27a117['id'],'version':_0x27a117[_0x4a62f3(0x95)]};_0x333d2a[_0x4a62f3(0xa9)]===_0x4a62f3(0x89)&&_0x333d2a[_0x4a62f3(0xce)]&&(_0x346ebb[_0x4a62f3(0xbf)]=_0x333d2a[_0x4a62f3(0xce)][_0x4a62f3(0xbf)],_0x346ebb['datasetCode']=_0x333d2a['hookLocation'][_0x4a62f3(0xa0)],_0x346ebb[_0x4a62f3(0xd1)]=_0x333d2a['hookLocation'][_0x4a62f3(0xd1)],_0x346ebb['functionNode']=_0x333d2a['hookLocation'][_0x4a62f3(0xc5)]),_0xdc1010['functions'][_0x333d2a[_0x4a62f3(0x99)]]=_0x346ebb,_0x4523d2[_0x4a62f3(0xab)]({'lockKey':_0x333d2a[_0x4a62f3(0x99)],'remoteId':_0x27a117['id']});}catch(_0x1b97af){_0x1b9eb9[_0x4a62f3(0xab)]({'lockKey':_0x333d2a[_0x4a62f3(0x99)],'error':_0x1b97af instanceof Error?_0x1b97af['message']:String(_0x1b97af)});}}return _0xdc1010[_0x4a62f3(0xcf)]=new Date()[_0x4a62f3(0xcd)](),await writeBffLockFile(_0x3dfe21[_0x4a62f3(0x8f)],_0x510639),{'ok':_0x1b9eb9[_0x4a62f3(0x9f)]===0x0,'data':{'pulled':_0x4523d2,'skipped':_0x568f70,'failed':_0x1b9eb9},'message':_0x4a62f3(0x9c)+_0x4523d2[_0x4a62f3(0x9f)]+_0x4a62f3(0xa4)+_0x568f70[_0x4a62f3(0x9f)]+_0x4a62f3(0xb2)+_0x1b9eb9[_0x4a62f3(0x9f)]+_0x4a62f3(0xbe)};}};async function hasUnsyncedLocalChanges(_0x6c9a3a,_0x41a477,_0x18e363){const _0x348d24=a36_0x2b4001;if(!await fileExists(_0x6c9a3a))return![];const _0x28fe87=await computeFileHash(_0x6c9a3a);if(!_0x41a477)return _0x18e363?_0x28fe87!==_0x18e363:!![];return _0x28fe87!==_0x41a477[_0x348d24(0xb3)];}function buildDatasetCodeToAliasMap(_0x1aca2d,_0x2527b5){const _0x126c80=a36_0x2b4001,_0x373f7d=loadAliasMap(_0x1aca2d,undefined,resolveApiFilePath(_0x1aca2d,_0x2527b5));return new Map(_0x373f7d[_0x126c80(0xc3)](_0x4b7ef5=>[_0x4b7ef5[_0x126c80(0xa0)],_0x4b7ef5[_0x126c80(0xbf)]]));}function a36_0x4b46(){const _0x80e1d9=['/api/management/library/scripts/list?appCode=','563642DcvmdG','scriptType','Force\x20overwrite\x20local\x20unsynced\x20changes','6xQqiAt','932IuPuWG','\x20failed','alias','scriptContent','nonInteractive','apps','map','parse','functionNode','toLowerCase','7263KUqtvY','functionName','conflict','skipped','Force\x20pull\x20cancelled.','str','toISOString','hookLocation','lastSync','appCode','operationType','apiDir','40czqxBZ','stringify','question','HOOK','GET','validation','read','Would\x20inspect\x20','15232HQcoIh','lockFilePath','stderr','boolean','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','stdin','Lock\x20scope\x20for\x20app\x20\x22','version','264SgAbeF','includes','yes','lockKey','39683220OTAzUO','bool','Pull\x20complete:\x20','&type=','trim','length','datasetCode','629783OzPJPm','993870BJFDsI','Remote\x20script\x20missing\x20content.','\x20pulled,\x20','filePath','functions','force','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','type','all','push','pull','local\x20unsynced\x20changes','unresolvable\x20target\x20path','utf8','close','9noZQGv','\x20skipped,\x20','hash','Pull\x20only\x20this\x20script\x20type','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','9942136fbGplB'];a36_0x4b46=function(){return _0x80e1d9;};return a36_0x4b46();}async function confirmForce(){const _0x3fea20=a36_0x2b4001,_0x16a4b7=createInterface({'input':process[_0x3fea20(0x93)],'output':process[_0x3fea20(0x90)]}),_0x139be5=await new Promise(_0x5b8c62=>{const _0x3b87db=_0x3fea20;_0x16a4b7[_0x3b87db(0x88)]('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x5b8c62);});return _0x16a4b7[_0x3fea20(0xb0)](),['y',_0x3fea20(0x98)][_0x3fea20(0x97)](_0x139be5[_0x3fea20(0x9e)]()[_0x3fea20(0xc6)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a37_0x242601=a37_0x49b2;(function(_0x10b0e5,_0x2f9573){const _0x31f946=a37_0x49b2,_0x469c06=_0x10b0e5();while(!![]){try{const _0x103ad3=parseInt(_0x31f946(0xd4))/0x1*(-parseInt(_0x31f946(0xf7))/0x2)+-parseInt(_0x31f946(0x105))/0x3+parseInt(_0x31f946(0x10e))/0x4*(-parseInt(_0x31f946(0x10a))/0x5)+parseInt(_0x31f946(0xcf))/0x6+-parseInt(_0x31f946(0x111))/0x7+-parseInt(_0x31f946(0x10c))/0x8*(-parseInt(_0x31f946(0xdc))/0x9)+parseInt(_0x31f946(0xe0))/0xa;if(_0x103ad3===_0x2f9573)break;else _0x469c06['push'](_0x469c06['shift']());}catch(_0xa00b3b){_0x469c06['push'](_0x469c06['shift']());}}}(a37_0x1b3d,0xb2de6));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';function a37_0x1b3d(){const _0x1b7060=['Runtime\x20script\x20cache\x20cleared.','8698986YVoFMD','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','No\x20local\x20Backend\x20Function\x20scripts\x20found.','\x20skipped,\x20','datasetId','963887zyCgCc','stringify','filePath','get','lastSync','set','map','hash','1160955UFLAeB','filter','script','some','14145530CloWZe','message','operationType','functionNode','push','string','force','str','appCode','COMMON','alias',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','POST','status','attempted','validation','name','has','would_push','every','runtime\x20cache\x20cleared','apps','update','2qFERxO','cleared','values','Incomplete\x20HOOK\x20path:\x20','remoteId','description','apiDir','HOOK','/api/management/library/scripts/save','aliasToDatasetCode','Cannot\x20resolve\x20dataset\x20for\x20\x22','version','Force\x20push\x20ignoring\x20hash\x20protection','length','969318uJVjqe','bool','bff','join','\x22.\x20','6869440oXuDer','Push\x20complete:\x20','56heFsXB','parse','4ytrCKh','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','unchanged','2616754BSFbJo','lockKey','ENDPOINT','datasetCode','functions','lockFilePath','Push\x20only\x20this\x20script\x20type','\x22\x20not\x20found\x20after\x20ensureLockScope.','scriptsRoot','code','datasetCodeToDataset','runtime\x20cache\x20clear\x20failed','type','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','write'];a37_0x1b3d=function(){return _0x1b7060;};return a37_0x1b3d();}import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':a37_0x242601(0x107),'command':a37_0x242601(0xe4),'description':'Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','risk':a37_0x242601(0xcd),'flags':[{'name':'type','type':a37_0x242601(0xe5),'description':a37_0x242601(0x117),'enum':[a37_0x242601(0xe9),a37_0x242601(0x113),'HOOK']},{'name':'name','type':a37_0x242601(0xe5),'description':a37_0x242601(0xd0)},{'name':a37_0x242601(0xe6),'type':'boolean','description':a37_0x242601(0x103)}],async 'dryRun'(_0x26c3ed){const _0x4898bf=a37_0x242601,_0x2ce6e4=loadBffProjectConfig(_0x26c3ed[_0x4898bf(0xe8)]),_0x328867=await readBffLockFile(_0x2ce6e4['lockFilePath']),{appLock:_0x465fe4}=ensureLockScope(_0x328867??createEmptyBffLock(),_0x26c3ed['appCode'],_0x2ce6e4[_0x4898bf(0x119)],'push'),_0x39eb07=await getTargetFunctions(_0x2ce6e4,_0x26c3ed),_0x5a224a=_0x26c3ed[_0x4898bf(0x106)]('force'),_0xb791c=[];for(const _0x300790 of _0x39eb07){const _0xfb7d92=await computeFileHash(_0x300790[_0x4898bf(0xd6)]),_0xd38609=_0x465fe4['functions'][_0x300790[_0x4898bf(0x112)]],_0x4dd554=!!_0xd38609&&_0xd38609['hash']===_0xfb7d92;_0xb791c[_0x4898bf(0xe4)]({'lockKey':_0x300790[_0x4898bf(0x112)],'filePath':_0x300790['filePath'],'remoteId':_0xd38609?.['remoteId']??null,'mode':_0xd38609?.[_0x4898bf(0xfb)]?_0x4898bf(0xf6):'create','status':!_0x5a224a&&_0x4dd554?_0x4898bf(0x110):_0x4898bf(0xf2)});}return{'method':_0x4898bf(0xec),'url':_0x4898bf(0xff),'body':{'appCode':_0x26c3ed[_0x4898bf(0xe8)],'force':_0x5a224a,'files':_0xb791c,'cacheClearAtRuntime':_0xb791c['some'](_0x57b215=>_0x57b215[_0x4898bf(0xed)]==='would_push'),'cacheClearAtRuntimeTimes':_0xb791c[_0x4898bf(0xdf)](_0x22dd75=>_0x22dd75[_0x4898bf(0xed)]===_0x4898bf(0xf2))?CACHE_CLEAR_ATTEMPTS:0x0},'description':'Would\x20inspect\x20'+_0xb791c[_0x4898bf(0x104)]+_0x4898bf(0xcc)};},async 'execute'(_0x11a4dd){const _0x2773c7=a37_0x242601,_0x274ce3=loadBffProjectConfig(_0x11a4dd[_0x2773c7(0xe8)]),_0x5e3d7a=await readBffLockFile(_0x274ce3[_0x2773c7(0x116)]),{lockData:_0x3c5271,appLock:_0x11fddd}=ensureLockScope(_0x5e3d7a??createEmptyBffLock(),_0x11a4dd[_0x2773c7(0xe8)],_0x274ce3[_0x2773c7(0x119)],_0x2773c7(0xe4)),_0x2f5063=await getTargetFunctions(_0x274ce3,_0x11a4dd);if(_0x2f5063[_0x2773c7(0x104)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x2773c7(0xd1)};const _0x47b896=_0x11a4dd[_0x2773c7(0x106)](_0x2773c7(0xe6)),_0x181f18=JSON[_0x2773c7(0x10d)](JSON[_0x2773c7(0xd5)](_0x3c5271)),_0x47d68c=_0x181f18[_0x2773c7(0xf5)][_0x11a4dd[_0x2773c7(0xe8)]];if(!_0x47d68c)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x11a4dd['appCode']+_0x2773c7(0x118));const _0x287a3a=await buildHookMaps(_0x11a4dd[_0x2773c7(0xe8)],_0x11a4dd[_0x2773c7(0xfd)],_0x2f5063,_0x47d68c),_0x4675cb=[],_0xf9408d=[],_0xb32920=[];for(const _0x5aa2a6 of _0x2f5063){const _0x583c1c=await computeFileHash(_0x5aa2a6[_0x2773c7(0xd6)]),_0x183cb3=_0x47d68c['functions'][_0x5aa2a6[_0x2773c7(0x112)]];if(!_0x47b896&&_0x183cb3&&_0x183cb3[_0x2773c7(0xdb)]===_0x583c1c){_0xf9408d[_0x2773c7(0xe4)]({'lockKey':_0x5aa2a6['lockKey'],'reason':_0x2773c7(0x110)});continue;}try{await uploadSingleFunction(_0x11a4dd['appCode'],_0x5aa2a6,_0x47d68c,_0x287a3a);const _0x44c896=_0x47d68c[_0x2773c7(0x115)][_0x5aa2a6['lockKey']];_0x4675cb['push']({'lockKey':_0x5aa2a6[_0x2773c7(0x112)],'remoteId':_0x44c896?.[_0x2773c7(0xfb)]??0x0});}catch(_0x3a9438){_0xb32920['push']({'lockKey':_0x5aa2a6['lockKey'],'error':_0x3a9438 instanceof Error?_0x3a9438[_0x2773c7(0xe1)]:String(_0x3a9438)});}}_0x47d68c[_0x2773c7(0xd8)]=new Date()['toISOString'](),await writeBffLockFile(_0x274ce3['lockFilePath'],_0x181f18),await waitForUploadedLockEntries(_0x274ce3[_0x2773c7(0x116)],_0x11a4dd[_0x2773c7(0xe8)],_0x4675cb[_0x2773c7(0xda)](_0x1f1254=>_0x1f1254['lockKey']));let _0x42722d={'attempted':![],'cleared':![]};if(_0x4675cb[_0x2773c7(0x104)]>0x0)try{let _0x4ea5ad='';for(let _0x450ab1=0x0;_0x450ab1<CACHE_CLEAR_ATTEMPTS;_0x450ab1+=0x1){_0x4ea5ad=await clearBffScriptCache(),_0x450ab1<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x42722d={'attempted':!![],'cleared':!![],'message':_0x4ea5ad||_0x2773c7(0xce)};}catch(_0x12138f){_0x42722d={'attempted':!![],'cleared':![],'error':_0x12138f instanceof Error?_0x12138f['message']:String(_0x12138f)};}const _0x565c01=_0xb32920[_0x2773c7(0x104)]===0x0&&(_0x42722d['attempted']?_0x42722d[_0x2773c7(0xf8)]:!![]),_0x333dfe=_0x42722d[_0x2773c7(0xee)]?_0x42722d['cleared']?_0x2773c7(0xf4):_0x2773c7(0xca):'runtime\x20cache\x20not\x20needed';return{'ok':_0x565c01,'data':{'uploaded':_0x4675cb,'skipped':_0xf9408d,'failed':_0xb32920,'cacheClear':_0x42722d},'message':_0x2773c7(0x10b)+_0x4675cb[_0x2773c7(0x104)]+'\x20uploaded,\x20'+_0xf9408d['length']+_0x2773c7(0xd2)+_0xb32920['length']+'\x20failed,\x20'+_0x333dfe};}};function a37_0x49b2(_0x16a02a,_0x2e28ba){_0x16a02a=_0x16a02a-0xca;const _0x1b3de0=a37_0x1b3d();let _0x49b2ce=_0x1b3de0[_0x16a02a];return _0x49b2ce;}async function getTargetFunctions(_0x670354,_0x33b966){const _0x41699d=a37_0x242601,_0x25a016=_0x33b966[_0x41699d(0xe7)](_0x41699d(0xcb)),_0x224c3c=_0x33b966[_0x41699d(0xe7)](_0x41699d(0xf0)),_0x543802=normalizeBffType(_0x25a016)??undefined;if(_0x224c3c&&!_0x543802)throw CliErrors[_0x41699d(0xef)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x470db1=await scanLocalBffFunctions(_0x670354,_0x543802);if(_0x224c3c){const _0x230d91=_0x470db1[_0x41699d(0xdd)](_0x2c878c=>_0x2c878c[_0x41699d(0xf0)]===_0x224c3c);if(_0x230d91['length']===0x0)throw CliErrors[_0x41699d(0xef)]('Local\x20function\x20not\x20found:\x20'+_0x543802+'/'+_0x224c3c);return _0x230d91;}return _0x470db1;}async function buildHookMaps(_0x59133c,_0x2e1c86,_0x5240b2,_0x529ed2){const _0x458d77=a37_0x242601,_0x3625cb=_0x5240b2[_0x458d77(0xdf)](_0xf03e68=>_0xf03e68[_0x458d77(0xcb)]===_0x458d77(0xfe));if(!_0x3625cb)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0xdcbba3=loadAliasMap(_0x2e1c86,undefined,resolveApiFilePath(_0x2e1c86,_0x59133c)),_0x629b18=new Map(_0xdcbba3['map'](_0x50837c=>[_0x50837c[_0x458d77(0xea)],_0x50837c[_0x458d77(0x114)]]));for(const _0x31d2b2 of Object[_0x458d77(0xf9)](_0x529ed2[_0x458d77(0x115)])){_0x31d2b2[_0x458d77(0xea)]&&_0x31d2b2[_0x458d77(0x114)]&&!_0x629b18[_0x458d77(0xf1)](_0x31d2b2[_0x458d77(0xea)])&&_0x629b18[_0x458d77(0xd9)](_0x31d2b2[_0x458d77(0xea)],_0x31d2b2[_0x458d77(0x114)]);}const _0x2a552b=await listDatasets(_0x59133c),_0x11891d=new Map(_0x2a552b[_0x458d77(0xda)](_0x594c1b=>[_0x594c1b[_0x458d77(0x11a)],_0x594c1b]));return{'aliasToDatasetCode':_0x629b18,'datasetCodeToDataset':_0x11891d};}async function uploadSingleFunction(_0x2f89f3,_0x2519a5,_0x1f6e57,_0x497853){const _0x319064=a37_0x242601,_0x323806=await readFile(_0x2519a5[_0x319064(0xd6)],'utf8'),_0x39dcac=await computeFileHash(_0x2519a5[_0x319064(0xd6)]),_0x21ede6=_0x1f6e57[_0x319064(0x115)][_0x2519a5[_0x319064(0x112)]];if(_0x21ede6?.[_0x319064(0xfb)]&&_0x21ede6['version']==null)throw CliErrors[_0x319064(0xef)](_0x2519a5[_0x319064(0x112)]+_0x319064(0xeb));let _0x38e803=extractScriptDescription(_0x323806);if(!_0x38e803&&_0x21ede6?.['remoteId']){const _0xb1a260=await getBffScriptInfo(_0x21ede6[_0x319064(0xfb)]);_0x38e803=_0xb1a260[_0x319064(0xfc)]||undefined;}const _0x3e37da={'appCode':_0x2f89f3,'functionName':_0x2519a5[_0x319064(0xf0)],'scriptType':_0x2519a5[_0x319064(0xcb)],'scriptContent':_0x323806};if(_0x21ede6?.[_0x319064(0xfb)])_0x3e37da['id']=_0x21ede6['remoteId'];if(_0x21ede6?.[_0x319064(0x102)]!=null)_0x3e37da['version']=_0x21ede6[_0x319064(0x102)];if(_0x38e803)_0x3e37da['description']=_0x38e803;if(_0x2519a5['type']===_0x319064(0xfe)){const _0x261376=_0x2519a5[_0x319064(0xea)];if(!_0x261376||!_0x2519a5['operationType']||!_0x2519a5[_0x319064(0xe3)])throw CliErrors[_0x319064(0xef)](_0x319064(0xfa)+_0x2519a5['lockKey']);const _0x5c065e=_0x497853['aliasToDatasetCode'][_0x319064(0xd7)](_0x261376)??_0x21ede6?.[_0x319064(0x114)]??_0x261376,_0x1c57a9=_0x497853[_0x319064(0x11b)][_0x319064(0xd7)](_0x5c065e);if(!_0x1c57a9)throw CliErrors['validation'](_0x319064(0x101)+_0x261376+_0x319064(0x109)+('Run\x20`'+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.'));_0x3e37da[_0x319064(0xd3)]=_0x1c57a9['id'],_0x3e37da[_0x319064(0xe2)]=_0x2519a5[_0x319064(0xe2)],_0x3e37da[_0x319064(0xe3)]=_0x2519a5[_0x319064(0xe3)];}const _0x175235=await saveBffScript(_0x3e37da),_0xa39d1a=_0x175235['id'],_0x5e2525=_0x175235[_0x319064(0xde)]??await getBffScriptInfo(_0xa39d1a),_0x33457b={'hash':_0x39dcac,'remoteId':_0xa39d1a,'version':_0x5e2525[_0x319064(0x102)]};if(_0x2519a5[_0x319064(0xcb)]===_0x319064(0xfe)){const _0x1bc731=_0x2519a5[_0x319064(0xea)],_0x28dbb3=_0x497853[_0x319064(0x100)][_0x319064(0xd7)](_0x1bc731)??_0x21ede6?.[_0x319064(0x114)]??_0x1bc731;_0x497853['aliasToDatasetCode'][_0x319064(0xf1)](_0x1bc731)?_0x33457b[_0x319064(0xea)]=_0x1bc731:_0x33457b[_0x319064(0xea)]=_0x21ede6?.['alias'],_0x33457b[_0x319064(0x114)]=_0x28dbb3,_0x33457b['operationType']=_0x2519a5[_0x319064(0xe2)],_0x33457b[_0x319064(0xe3)]=_0x2519a5['functionNode'];}_0x1f6e57[_0x319064(0x115)][_0x2519a5[_0x319064(0x112)]]=_0x33457b;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x16c82b,_0x264413,_0x5c2986){const _0x364823=a37_0x242601;if(_0x5c2986['length']===0x0)return;for(let _0x27ab37=0x0;_0x27ab37<LOCK_SETTLE_RETRY_COUNT;_0x27ab37+=0x1){const _0x1fbcb9=await readBffLockFile(_0x16c82b),_0x5e2b07=_0x1fbcb9?.[_0x364823(0xf5)]?.[_0x264413]?.[_0x364823(0x115)]??{},_0x2e6216=_0x5c2986[_0x364823(0xf3)](_0x1ecf8f=>!!_0x5e2b07[_0x1ecf8f]?.[_0x364823(0xfb)]);if(_0x2e6216)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x364823(0x10f)+_0x5c2986[_0x364823(0x108)](',\x20')+'.');}
|
|
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 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a38_0x44f045=a38_0x3daf;function a38_0x3daf(_0x48bf15,_0x97006e){_0x48bf15=_0x48bf15-0xcd;const _0x176913=a38_0x1769();let _0x3daf09=_0x176913[_0x48bf15];return _0x3daf09;}(function(_0x1d6ad1,_0x231a68){const _0x52ef1a=a38_0x3daf,_0x39be5e=_0x1d6ad1();while(!![]){try{const _0x5b4db3=parseInt(_0x52ef1a(0xd5))/0x1+parseInt(_0x52ef1a(0xdf))/0x2+-parseInt(_0x52ef1a(0xd7))/0x3*(-parseInt(_0x52ef1a(0xe0))/0x4)+-parseInt(_0x52ef1a(0xdd))/0x5*(-parseInt(_0x52ef1a(0xe4))/0x6)+-parseInt(_0x52ef1a(0xd9))/0x7+parseInt(_0x52ef1a(0xd6))/0x8*(-parseInt(_0x52ef1a(0xe2))/0x9)+-parseInt(_0x52ef1a(0xce))/0xa*(parseInt(_0x52ef1a(0xde))/0xb);if(_0x5b4db3===_0x231a68)break;else _0x39be5e['push'](_0x39be5e['shift']());}catch(_0x49ef36){_0x39be5e['push'](_0x39be5e['shift']());}}}(a38_0x1769,0x6b8cc));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';function a38_0x1769(){const _0x317946=['36020KzwcrK','1625063kFevLr','416454EOCeFk','4xHcTpd','scriptsRoot','135612xxuerl','functions','282hzzdJZ','appCode','status','remote','\x20unchanged','All\x20Backend\x20Function\x20scripts\x20are\x20in\x20sync.','push','lockFilePath','map','apiDir','length','10EjvXBV','Check\x20local\x20Backend\x20Function\x20sync\x20status\x20against\x20lock\x20file','all','has','boolean','lockKey','read','248163ALxmOi','8IiFZzA','1108407SySUvC','\x20modified,\x20','3927854RIxRaX','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','datasetCode','bff'];a38_0x1769=function(){return _0x317946;};return a38_0x1769();}import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a38_0x44f045(0xdc),'command':a38_0x44f045(0xe6),'description':a38_0x44f045(0xcf),'risk':a38_0x44f045(0xd4),'flags':[{'name':a38_0x44f045(0xe7),'type':a38_0x44f045(0xd2),'description':a38_0x44f045(0xda)}],async 'execute'(_0x5ed2ea){const _0x37cecc=a38_0x44f045,_0x3728c8=loadBffProjectConfig(_0x5ed2ea[_0x37cecc(0xe5)]),_0x3d7476=await readBffLockFile(_0x3728c8[_0x37cecc(0xeb)]),{appLock:_0x283daa}=ensureLockScope(_0x3d7476??createEmptyBffLock(),_0x5ed2ea[_0x37cecc(0xe5)],_0x3728c8[_0x37cecc(0xe1)],'status'),_0x4679ae=await scanLocalBffFunctions(_0x3728c8),_0x282a73=[],_0x149799=[],_0x146568=[];for(const _0x5646b5 of _0x4679ae){const _0x2a0612=await computeFileHash(_0x5646b5['filePath']),_0x1e5e9f=_0x283daa['functions'][_0x5646b5['lockKey']];if(!_0x1e5e9f)_0x282a73[_0x37cecc(0xea)](_0x5646b5[_0x37cecc(0xd3)]);else _0x1e5e9f['hash']!==_0x2a0612?_0x149799['push'](_0x5646b5[_0x37cecc(0xd3)]):_0x146568[_0x37cecc(0xea)](_0x5646b5[_0x37cecc(0xd3)]);}const _0x3b408a=[];if(_0x5ed2ea['bool']('remote')){const _0x51b4d0=loadAliasMap(_0x5ed2ea[_0x37cecc(0xed)],undefined,resolveApiFilePath(_0x5ed2ea[_0x37cecc(0xed)],_0x5ed2ea[_0x37cecc(0xe5)])),_0x1106c8=new Map(_0x51b4d0[_0x37cecc(0xec)](_0x1e9cc3=>[_0x1e9cc3[_0x37cecc(0xdb)],_0x1e9cc3['alias']])),[_0x7b1a53,_0x2212c1]=await Promise[_0x37cecc(0xd0)]([listBffScripts(_0x5ed2ea['appCode']),getBffScriptStatistics(_0x5ed2ea[_0x37cecc(0xe5)])]),_0x14f83f=createHookLocationMap(_0x2212c1),_0x1553fe=new Set(_0x4679ae['map'](_0x548a17=>_0x548a17[_0x37cecc(0xd3)]));for(const _0x34c8af of _0x7b1a53){const _0xb17104=resolveRemoteScriptTarget(_0x3728c8,_0x34c8af,_0x14f83f,_0x283daa[_0x37cecc(0xe3)],_0x1106c8);_0xb17104&&!_0x1553fe[_0x37cecc(0xd1)](_0xb17104[_0x37cecc(0xd3)])&&_0x3b408a[_0x37cecc(0xea)](_0xb17104['lockKey']);}}const _0x4867bc=_0x282a73[_0x37cecc(0xcd)]===0x0&&_0x149799[_0x37cecc(0xcd)]===0x0&&_0x3b408a[_0x37cecc(0xcd)]===0x0;return{'ok':!![],'data':{'added':_0x282a73,'modified':_0x149799,'unchanged':_0x146568,'remoteOnly':_0x3b408a},'message':_0x4867bc?_0x37cecc(0xe9):_0x282a73[_0x37cecc(0xcd)]+'\x20added,\x20'+_0x149799[_0x37cecc(0xcd)]+_0x37cecc(0xd8)+_0x146568['length']+_0x37cecc(0xe8)+(_0x3b408a[_0x37cecc(0xcd)]>0x0?',\x20'+_0x3b408a[_0x37cecc(0xcd)]+'\x20remote-only':'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a39_0x25f9(_0x578e12,_0x52d979){_0x578e12=_0x578e12-0x141;const _0x2f3d13=a39_0x2f3d();let _0x25f98a=_0x2f3d13[_0x578e12];return _0x25f98a;}const a39_0x334ca1=a39_0x25f9;(function(_0x138c11,_0x367b1f){const _0x4aa315=a39_0x25f9,_0x5682a3=_0x138c11();while(!![]){try{const _0x129ff0=parseInt(_0x4aa315(0x14f))/0x1+parseInt(_0x4aa315(0x14a))/0x2+parseInt(_0x4aa315(0x14c))/0x3+parseInt(_0x4aa315(0x156))/0x4*(-parseInt(_0x4aa315(0x150))/0x5)+-parseInt(_0x4aa315(0x144))/0x6*(parseInt(_0x4aa315(0x14e))/0x7)+parseInt(_0x4aa315(0x14d))/0x8+parseInt(_0x4aa315(0x14b))/0x9*(-parseInt(_0x4aa315(0x15e))/0xa);if(_0x129ff0===_0x367b1f)break;else _0x5682a3['push'](_0x5682a3['shift']());}catch(_0x1aec7e){_0x5682a3['push'](_0x5682a3['shift']());}}}(a39_0x2f3d,0x44263));import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';function a39_0x2f3d(){const _0x1918a2=['repairCommand','1899880iwoLUX','skillVersion','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.','\x20at\x20','560892eeHXsW','nonInteractive','CLI\x20Built-in\x20Skill\x20','cli-skill-install','pipe','log','831402UHExXM','18Idvbki','599547ISGnqc','2894104yVmgae','14KFhuiN','41148UgZHSQ','70waxLmN','read','\x20via\x20skills@latest','\x20is\x20already\x20current','cli-skill','installedPath','49252epQAoc','cwd','install','error','code','changed','Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20'];a39_0x2f3d=function(){return _0x1918a2;};return a39_0x2f3d();}import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a39_0x334ca1(0x154),'command':a39_0x334ca1(0x158),'description':'Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','risk':a39_0x334ca1(0x151),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x819a5a){const _0x50706d=a39_0x334ca1;logger['setLogPath'](process[_0x50706d(0x157)]()),logger['info'](_0x50706d(0x147),_0x50706d(0x142));const _0x19add9=installBuiltinSkill({'stdio':_0x819a5a[_0x50706d(0x145)]?_0x50706d(0x148):'inherit'});if(!_0x19add9['ok'])throw CliErrors['apiError']('Built-in\x20Skill\x20install\x20failed\x20['+_0x19add9[_0x50706d(0x15a)]+']:\x20'+(_0x19add9[_0x50706d(0x159)]||'unknown'),_0x50706d(0x15c)+_0x19add9[_0x50706d(0x15d)]);return console[_0x50706d(0x149)](_0x19add9[_0x50706d(0x15b)]?_0x50706d(0x146)+_0x19add9[_0x50706d(0x141)]+'\x20installed'+(_0x19add9['installedPath']?_0x50706d(0x143)+_0x19add9['installedPath']:_0x50706d(0x152)):_0x50706d(0x146)+_0x19add9['skillVersion']+_0x50706d(0x153)+(_0x19add9[_0x50706d(0x155)]?_0x50706d(0x143)+_0x19add9[_0x50706d(0x155)]:'')),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a40_0x76add2=a40_0x3013;(function(_0x40d696,_0x2b4056){const _0x26a307=a40_0x3013,_0x131b53=_0x40d696();while(!![]){try{const _0x365c55=parseInt(_0x26a307(0x106))/0x1*(parseInt(_0x26a307(0x11b))/0x2)+-parseInt(_0x26a307(0x12c))/0x3+-parseInt(_0x26a307(0x136))/0x4*(parseInt(_0x26a307(0x110))/0x5)+parseInt(_0x26a307(0x10d))/0x6+-parseInt(_0x26a307(0x120))/0x7+parseInt(_0x26a307(0xf5))/0x8+-parseInt(_0x26a307(0xef))/0x9*(-parseInt(_0x26a307(0x104))/0xa);if(_0x365c55===_0x2b4056)break;else _0x131b53['push'](_0x131b53['shift']());}catch(_0x3cbe22){_0x131b53['push'](_0x131b53['shift']());}}}(a40_0x105d,0xc1de2));import a40_0x429607 from'chalk';function a40_0x3013(_0x36ec23,_0x3bffc7){_0x36ec23=_0x36ec23-0xec;const _0x105d14=a40_0x105d();let _0x301382=_0x105d14[_0x36ec23];return _0x301382;}import a40_0x1f1d24 from'ora';import a40_0x1fa3ff 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 _0x4ddcde=a40_0x3013;return GIT_COMMIT!==_0x4ddcde(0x116)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME['slice'](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x357790=a40_0x3013,_0x5be328=process[_0x357790(0x102)][_0x357790(0xfb)]();if(_0x5be328[_0x357790(0x125)](_0x357790(0x11e)))return _0x357790(0x11e);return _0x357790(0x100);}const updateFlags=[{'name':a40_0x76add2(0x126),'type':a40_0x76add2(0xee),'description':a40_0x76add2(0x12f),'default':![]},{'name':a40_0x76add2(0xfa),'type':'string','description':a40_0x76add2(0x121)}];function getRequestedVersion(_0x56ea7f){const _0x203c00=a40_0x76add2;return _0x56ea7f[_0x203c00(0x105)](_0x203c00(0xfa))['trim']();}async function validateUpdateFlags(_0x4e2f18){const _0x27dc00=a40_0x76add2,_0x54033b=_0x4e2f18[_0x27dc00(0xfd)](_0x27dc00(0x126)),_0x97be2d=getRequestedVersion(_0x4e2f18);if(_0x54033b&&_0x97be2d)throw CliErrors[_0x27dc00(0x133)](_0x27dc00(0x11f),_0x27dc00(0x115));if(_0x97be2d&&!a40_0x1fa3ff[_0x27dc00(0xf2)](_0x97be2d))throw CliErrors[_0x27dc00(0x133)]('Invalid\x20version:\x20'+_0x97be2d,_0x27dc00(0x135));}async function fetchNpmDistTags(){const _0x158d3a=a40_0x76add2;try{const _0x214490=await fetch(_0x158d3a(0x128)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x158d3a(0x12a),{'signal':AbortSignal['timeout'](0x2710)});if(!_0x214490['ok'])return null;const _0x221599=await _0x214490['json']();if(!_0x221599||typeof _0x221599!=='object')return null;return Object['fromEntries'](Object[_0x158d3a(0x118)](_0x221599)[_0x158d3a(0xfc)](([,_0x41456c])=>typeof _0x41456c===_0x158d3a(0xf8)&&_0x41456c[_0x158d3a(0x138)]()[_0x158d3a(0x123)]>0x0)['map'](([_0x56425e,_0x32faec])=>[_0x56425e,String(_0x32faec)[_0x158d3a(0x138)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x1a0129){const _0x4156fc=await fetchNpmDistTags();return _0x4156fc?.[_0x1a0129]??null;}async function fetchLatestVersion(){const _0x4cfbf3=a40_0x76add2;return fetchNpmDistTagVersion(_0x4cfbf3(0xf6));}async function resolveTargetVersion(_0x3d844a){const _0x3f2706=a40_0x76add2,_0x4e9859=getRequestedVersion(_0x3d844a);if(_0x4e9859)return{'version':_0x4e9859,'source':_0x3f2706(0xfa)};if(_0x3d844a[_0x3f2706(0xfd)]('beta')){const _0x3ac927=await fetchNpmDistTagVersion('beta');if(!_0x3ac927)return null;return{'version':_0x3ac927,'source':_0x3f2706(0x126)};}const _0x5e23b2=await fetchLatestVersion();if(!_0x5e23b2)return null;return{'version':_0x5e23b2,'source':_0x3f2706(0xf6)};}function shouldInstallTarget(_0x250a45,_0x1683ab){const _0x4a2e38=a40_0x76add2;if(_0x1683ab[_0x4a2e38(0x132)]===_0x4a2e38(0xfa)||_0x1683ab[_0x4a2e38(0x132)]===_0x4a2e38(0x126))return!a40_0x1fa3ff['eq'](_0x250a45,_0x1683ab[_0x4a2e38(0xfa)]);return a40_0x1fa3ff['lt'](_0x250a45,_0x1683ab['version']);}function a40_0x105d(){const _0x4f16e7=['toLowerCase','filter','bool','Version\x20comparison\x20failed','Current\x20version\x20v','npm','run','execPath','\x20\x20Try\x20manually:\x20','20oERlKN','str','289ZykWZY','start','install','error','log','yellow','Checking\x20CLI\x20Built-in\x20Skill...','6792360Vlvqps','Requested\x20version:\x20','Update\x20failed','4147510zbJKhz','\x20install\x20-g\x20','repairCommand','\x20is\x20newer\x20than\x20npm\x20latest\x20v','\x20is\x20up\x20to\x20date.','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','unknown','message','entries','current','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','8470yOjTXS','...','gray','bun','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','8562890pStkcA','Install\x20a\x20specific\x20CLI\x20version','code','length','succeed','includes','beta','\x20\x20CLI\x20Built-in\x20Skill\x20','https://registry.npmjs.org/-/package/','Beta\x20version:\x20','/dist-tags','Already\x20on\x20requested\x20version\x20(v','3553035WXSjjm','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm',',\x20state\x20','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20','skillVersion','source','validation',',\x20found\x20','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','4aFhfMh','update','trim','warn','expected\x20','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','\x20→\x20','green','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','boolean','5085504umfpsu','fail','Current\x20version:\x20','valid','red','state','4360896NtmZRP','latest','\x20cli-skill\x20install','string','\x20\x20Run\x20manually:\x20','version'];a40_0x105d=function(){return _0x4f16e7;};return a40_0x105d();}function getInstallPlanLabel(_0x166bba,_0x3d84a4){const _0xb55fae=a40_0x76add2;switch(_0x3d84a4[_0xb55fae(0x132)]){case _0xb55fae(0x126):return _0xb55fae(0x129)+a40_0x429607[_0xb55fae(0x10b)](_0x166bba)+_0xb55fae(0x13c)+a40_0x429607['green'](_0x3d84a4[_0xb55fae(0xfa)]);case _0xb55fae(0xfa):return _0xb55fae(0x10e)+a40_0x429607['yellow'](_0x166bba)+_0xb55fae(0x13c)+a40_0x429607['green'](_0x3d84a4[_0xb55fae(0xfa)]);case _0xb55fae(0xf6):default:return'Update\x20available:\x20'+a40_0x429607['yellow'](_0x166bba)+_0xb55fae(0x13c)+a40_0x429607[_0xb55fae(0x13d)](_0x3d84a4[_0xb55fae(0xfa)]);}}function repairCurrentBuiltinSkill(){const _0x59615f=a40_0x76add2;console[_0x59615f(0x10a)](a40_0x429607[_0x59615f(0x11d)](_0x59615f(0x10c)));const _0x562a6f=installBuiltinSkill();if(_0x562a6f['ok'])return console[_0x59615f(0x10a)](a40_0x429607['gray']('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x562a6f['skillVersion']+_0x59615f(0x114))),!![];return console[_0x59615f(0x139)](a40_0x429607[_0x59615f(0x10b)](_0x59615f(0x11a)+_0x562a6f[_0x59615f(0x122)]+']:\x20'+(_0x562a6f['error']||_0x59615f(0x116)))),console['log'](a40_0x429607[_0x59615f(0x11d)](_0x59615f(0xf9)+CLI_BIN_NAME+_0x59615f(0xf7))),![];}function verifyUpdatedBuiltinSkill(_0x45aa98){const _0x4163e5=a40_0x76add2,_0x2c5c99=inspectInstalledBuiltinSkillVersion(_0x45aa98);if(_0x2c5c99[_0x4163e5(0xf4)]===_0x4163e5(0x119))return console[_0x4163e5(0x10a)](a40_0x429607['gray'](_0x4163e5(0x127)+_0x45aa98+_0x4163e5(0x114))),!![];const _0x37fa8a=_0x2c5c99[_0x4163e5(0x131)]?_0x4163e5(0x13a)+_0x45aa98+_0x4163e5(0x134)+_0x2c5c99['skillVersion']:_0x4163e5(0x13a)+_0x45aa98+_0x4163e5(0x12e)+_0x2c5c99[_0x4163e5(0xf4)];return console['warn'](a40_0x429607[_0x4163e5(0x10b)](_0x4163e5(0x130)+_0x37fa8a)),console[_0x4163e5(0x10a)](a40_0x429607['gray']('\x20\x20Run\x20manually:\x20'+_0x2c5c99[_0x4163e5(0x112)])),![];}async function execute(_0x46775f){const _0x4093a2=a40_0x76add2;await validateUpdateFlags(_0x46775f);const _0x3edbcf=getCurrentVersion();console['log'](_0x4093a2(0xf1)+_0x3edbcf);const _0x447ae1=a40_0x1f1d24('Checking\x20for\x20updates...')[_0x4093a2(0x107)](),_0x428120=await resolveTargetVersion(_0x46775f);if(!_0x428120){const _0x2ada5b=_0x46775f[_0x4093a2(0xfd)]('beta')?_0x4093a2(0x12d):_0x4093a2(0xec);return _0x447ae1[_0x4093a2(0xf0)](_0x2ada5b),console['log'](a40_0x429607[_0x4093a2(0x11d)](_0x4093a2(0x13b)+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x2ada5b};}const _0x212757=a40_0x1fa3ff[_0x4093a2(0xf2)](VERSION),_0xdbd350=a40_0x1fa3ff['valid'](_0x428120[_0x4093a2(0xfa)]);if(!_0x212757||!_0xdbd350)return _0x447ae1['fail'](_0x4093a2(0xfe)),{'ok':![],'message':_0x4093a2(0xfe)};if(!shouldInstallTarget(_0x212757,_0x428120)){const _0x447986=_0x428120[_0x4093a2(0x132)]===_0x4093a2(0xfa)?_0x4093a2(0x12b)+_0x428120[_0x4093a2(0xfa)]+')':a40_0x1fa3ff['gt'](_0x212757,_0xdbd350)?_0x4093a2(0xff)+_0x3edbcf+_0x4093a2(0x113)+_0x428120[_0x4093a2(0xfa)]:'Already\x20up\x20to\x20date\x20(v'+_0x428120[_0x4093a2(0xfa)]+')';return _0x447ae1[_0x4093a2(0x124)](_0x447986),{'ok':repairCurrentBuiltinSkill()};}_0x447ae1['info'](getInstallPlanLabel(_0x3edbcf,_0x428120));const _0x9d44fb=detectPackageManager(),_0x411c8c=_0x9d44fb===_0x4093a2(0x100)?resolveNpmBin(_0x4093a2(0x100)):_0x9d44fb,_0x398d9c=a40_0x1f1d24('Updating\x20via\x20'+_0x9d44fb+_0x4093a2(0x11c))[_0x4093a2(0x107)]();try{return await execa(_0x411c8c,[_0x4093a2(0x108),'-g',NPM_PACKAGE_NAME+'@'+_0x428120[_0x4093a2(0xfa)]],{'stdio':'pipe'}),_0x398d9c[_0x4093a2(0x124)]('Updated\x20to\x20v'+_0x428120[_0x4093a2(0xfa)]),console[_0x4093a2(0x10a)](a40_0x429607[_0x4093a2(0x11d)](_0x4093a2(0xed))),{'ok':verifyUpdatedBuiltinSkill(_0x428120['version'])};}catch(_0x59f4fa){return _0x398d9c[_0x4093a2(0xf0)](_0x4093a2(0x10f)),console[_0x4093a2(0x109)](a40_0x429607[_0x4093a2(0xf3)]('\x20\x20'+_0x59f4fa[_0x4093a2(0x117)])),console[_0x4093a2(0x10a)](a40_0x429607[_0x4093a2(0x11d)](_0x4093a2(0x103)+_0x9d44fb+_0x4093a2(0x111)+NPM_PACKAGE_NAME+'@'+_0x428120[_0x4093a2(0xfa)])),{'ok':![],'message':_0x59f4fa['message']};}}export const updateDefinition={'service':a40_0x76add2(0x137),'command':a40_0x76add2(0x101),'description':'Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
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 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x8cf35c,_0x1ab9da){const _0x3edcb1=a41_0x1e57,_0x4255e4=_0x8cf35c();while(!![]){try{const _0x2c8f2e=parseInt(_0x3edcb1(0x18b))/0x1*(-parseInt(_0x3edcb1(0x192))/0x2)+-parseInt(_0x3edcb1(0x18e))/0x3+-parseInt(_0x3edcb1(0x18a))/0x4+-parseInt(_0x3edcb1(0x191))/0x5*(parseInt(_0x3edcb1(0x18d))/0x6)+-parseInt(_0x3edcb1(0x190))/0x7*(-parseInt(_0x3edcb1(0x18f))/0x8)+parseInt(_0x3edcb1(0x189))/0x9*(-parseInt(_0x3edcb1(0x193))/0xa)+parseInt(_0x3edcb1(0x18c))/0xb*(parseInt(_0x3edcb1(0x194))/0xc);if(_0x2c8f2e===_0x1ab9da)break;else _0x4255e4['push'](_0x4255e4['shift']());}catch(_0x1ef4e8){_0x4255e4['push'](_0x4255e4['shift']());}}}(a41_0x23f3,0xcbfd9));function a41_0x1e57(_0x31e09c,_0xeb0c2c){_0x31e09c=_0x31e09c-0x189;const _0x23f38d=a41_0x23f3();let _0x1e5785=_0x23f38d[_0x31e09c];return _0x1e5785;}import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];function a41_0x23f3(){const _0x3a8b5c=['378hKszfD','6251468gUoNtl','1595122RJtSxf','47913701SvFDGQ','887988OrTuaM','1133931bAfQXB','64RKnGbK','1106434sFOhJa','5RTmRDw','2DCvBct','262090QqugdI','12culNIJ'];a41_0x23f3=function(){return _0x3a8b5c;};return a41_0x23f3();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x5ba3fd=a42_0x4859;(function(_0x5793b2,_0x3080ef){const _0x3957ba=a42_0x4859,_0x36e1c4=_0x5793b2();while(!![]){try{const _0x50ee13=-parseInt(_0x3957ba(0xad))/0x1+parseInt(_0x3957ba(0xba))/0x2+parseInt(_0x3957ba(0xb7))/0x3*(parseInt(_0x3957ba(0xaf))/0x4)+-parseInt(_0x3957ba(0xbc))/0x5+-parseInt(_0x3957ba(0xb2))/0x6*(parseInt(_0x3957ba(0xbb))/0x7)+parseInt(_0x3957ba(0xbf))/0x8*(-parseInt(_0x3957ba(0xb4))/0x9)+parseInt(_0x3957ba(0xae))/0xa;if(_0x50ee13===_0x3080ef)break;else _0x36e1c4['push'](_0x36e1c4['shift']());}catch(_0x111fd5){_0x36e1c4['push'](_0x36e1c4['shift']());}}}(a42_0x188c,0x25770));function a42_0x188c(){const _0x3fee1a=['96iANpXu','appCode','codegen','445978eKgCac','15470ZyxPKH','138010pKlXPA','str','read','49048ttJtJi','string','code','alias','operation','tableName','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','53319ITBDGT','2304690qynCnu','4348YLiNzy','skip-imports','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','606eVyTlx','boolean','45MPsZst','bool','Omit\x20import\x20statements\x20from\x20generated\x20code'];a42_0x188c=function(){return _0x3fee1a;};return a42_0x188c();}import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a42_0x4859(_0x3b8297,_0x129c3d){_0x3b8297=_0x3b8297-0xa8;const _0x188c78=a42_0x188c();let _0x485984=_0x188c78[_0x3b8297];return _0x485984;}export const codegenSdk={'service':a42_0x5ba3fd(0xb9),'command':'sdk','description':a42_0x5ba3fd(0xac),'risk':a42_0x5ba3fd(0xbe),'flags':[CODE_FLAG_OPTIONAL,{'name':a42_0x5ba3fd(0xa9),'type':'string','description':a42_0x5ba3fd(0xb1)},{'name':'operation','type':a42_0x5ba3fd(0xc0),'required':!![],'description':'Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)'},{'name':'skip-imports','type':a42_0x5ba3fd(0xb3),'description':a42_0x5ba3fd(0xb6)}],async 'execute'(_0x459025){const _0x147b60=a42_0x5ba3fd,{dataset:_0x2c81dc,operation:_0x5dc1dd}=await getOperationDetail(_0x459025[_0x147b60(0xb8)],_0x459025[_0x147b60(0xbd)](_0x147b60(0xa8)),_0x459025[_0x147b60(0xbd)]('operation')),_0x2c14c2=generateSdkCode(_0x2c81dc,_0x5dc1dd,{'includeImports':!_0x459025[_0x147b60(0xb5)](_0x147b60(0xb0))});return{'ok':!![],'data':{'dataset':{'name':_0x2c81dc['name'],'code':_0x2c81dc[_0x147b60(0xa8)],'tableName':_0x2c81dc[_0x147b60(0xab)]},'operation':_0x459025[_0x147b60(0xbd)](_0x147b60(0xaa)),'code':_0x2c14c2}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x2053d3=a43_0x37e9;(function(_0x44a0d1,_0x5c74cf){const _0x29d9e8=a43_0x37e9,_0xfd0222=_0x44a0d1();while(!![]){try{const _0x9d6623=-parseInt(_0x29d9e8(0x167))/0x1+parseInt(_0x29d9e8(0x178))/0x2+parseInt(_0x29d9e8(0x176))/0x3+-parseInt(_0x29d9e8(0x16b))/0x4+-parseInt(_0x29d9e8(0x173))/0x5*(parseInt(_0x29d9e8(0x172))/0x6)+parseInt(_0x29d9e8(0x171))/0x7+-parseInt(_0x29d9e8(0x166))/0x8*(-parseInt(_0x29d9e8(0x177))/0x9);if(_0x9d6623===_0x5c74cf)break;else _0xfd0222['push'](_0xfd0222['shift']());}catch(_0x55c1bd){_0xfd0222['push'](_0xfd0222['shift']());}}}(a43_0x135e,0x52b0e));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':a43_0x2053d3(0x16a),'command':a43_0x2053d3(0x175),'description':'Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','risk':a43_0x2053d3(0x179),'flags':[SQLCODE_FLAG,{'name':'target','type':'string','description':a43_0x2053d3(0x16e),'default':a43_0x2053d3(0x16f),'enum':[a43_0x2053d3(0x16f),a43_0x2053d3(0x164)]},{'name':'no-imports','type':a43_0x2053d3(0x16c),'description':'Omit\x20import\x20statements\x20from\x20generated\x20code'}],async 'execute'(_0x1c6a18){const _0x3b7a85=a43_0x2053d3,_0x4a74d1=await getSqlQueryInfo(_0x1c6a18['appCode'],_0x1c6a18[_0x3b7a85(0x174)](_0x3b7a85(0x169))),_0x311a98=_0x1c6a18['str']('target')||_0x3b7a85(0x16f),_0x3edb2d=generateSqlCodeTemplate(_0x4a74d1,{'target':_0x311a98,'includeImports':!_0x1c6a18[_0x3b7a85(0x168)](_0x3b7a85(0x165))});return{'ok':!![],'data':{'sqlCode':_0x4a74d1[_0x3b7a85(0x170)],'sqlName':_0x4a74d1[_0x3b7a85(0x16d)],'target':_0x311a98,'code':_0x3edb2d}};}};function a43_0x37e9(_0x3fae05,_0x290703){_0x3fae05=_0x3fae05-0x164;const _0x135ed2=a43_0x135e();let _0x37e94f=_0x135ed2[_0x3fae05];return _0x37e94f;}function a43_0x135e(){const _0xd9171=['1384386uILipD','10lrAAKN','str','sql','1621683aqXrkc','1233NJjpRJ','637292WyElpf','read','bff','no-imports','45912HMxSGd','567778cQNlhU','bool','sqlcode','codegen','1700032vmhwJJ','boolean','sqlName','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','sdk','sqlCode','1032500CuARzN'];a43_0x135e=function(){return _0xd9171;};return a43_0x135e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xf387d,_0x21e254){const _0x18c566=a44_0x3f0a,_0x1074b6=_0xf387d();while(!![]){try{const _0x164056=-parseInt(_0x18c566(0xbf))/0x1+parseInt(_0x18c566(0xbe))/0x2+-parseInt(_0x18c566(0xb0))/0x3+-parseInt(_0x18c566(0xab))/0x4*(-parseInt(_0x18c566(0x9e))/0x5)+parseInt(_0x18c566(0xb9))/0x6*(-parseInt(_0x18c566(0xa9))/0x7)+-parseInt(_0x18c566(0xb4))/0x8*(-parseInt(_0x18c566(0xa1))/0x9)+-parseInt(_0x18c566(0xad))/0xa*(parseInt(_0x18c566(0xb7))/0xb);if(_0x164056===_0x21e254)break;else _0x1074b6['push'](_0x1074b6['shift']());}catch(_0x399670){_0x1074b6['push'](_0x1074b6['shift']());}}}(a44_0x4f72,0x72cf9));function a44_0x4f72(){const _0x191291=['\x22\x20still\x20defined\x20in\x20','defaultApp','4711ZZwSio','\x22\x20not\x20found.','1829540EJhdsg','\x20Default\x20app\x20is\x20\x22','26310kYuzDB','Missing\x20app\x20name.','both','779871MwkQtv','\x22\x20is\x20selected\x20automatically.','length','global','1184QkdgBn','apps','bool','1364iLzmfd','trim','1074NLkOuV','Usage:\x20','\x20config.','\x20app\x20\x22','project','1623264VODIgn','885660TNtohJ','keys','Use\x20global\x20config\x20scope','\x20<name>','Added','validation','\x22\x20(appcode:\x20','string','Removed\x20app\x20\x22','flagMissing','object','args','5DVzLpn','App\x20\x22','globalConfig','48258AANbOi','\x20Note:\x20app\x20\x22','appcode','str','\x20<name>\x20--appcode\x20<code>','projectConfig'];a44_0x4f72=function(){return _0x191291;};return a44_0x4f72();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{collectAppProfileOverrides,getAppProfileFlagDefs,normalizeStoredDefaultApp}from'../../config/schema.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';export function buildAppAddFlags(){const _0x356d11=a44_0x3f0a;return[{'name':'appcode','type':_0x356d11(0xc6),'description':'App\x20code','required':!![]},{'name':_0x356d11(0xb3),'type':'boolean','description':_0x356d11(0xc1),'default':![]},...getAppProfileFlagDefs()];}function a44_0x3f0a(_0x2b12d4,_0x478d0b){_0x2b12d4=_0x2b12d4-0x9e;const _0x4f728e=a44_0x4f72();let _0x3f0ac3=_0x4f728e[_0x2b12d4];return _0x3f0ac3;}export function buildAppRemoveFlags(){const _0x333c56=a44_0x3f0a;return[{'name':'global','type':'boolean','description':_0x333c56(0xc1),'default':![]}];}export async function validateAppName(_0x1b8bb2,_0x4b096f){const _0x308c50=a44_0x3f0a,_0x523397=_0x1b8bb2['args'][0x0]?.[_0x308c50(0xb8)]();if(!_0x523397)throw CliErrors[_0x308c50(0xc4)](_0x308c50(0xae),'Usage:\x20'+CLI_BIN_NAME+'\x20'+_0x4b096f+_0x308c50(0xc2));}export async function runAppAdd(_0x460725,_0x8cddbf){const _0x1e772a=a44_0x3f0a,_0x5a54fe=_0x460725['args'][0x0]?.[_0x1e772a(0xb8)]();if(!_0x5a54fe)throw CliErrors[_0x1e772a(0xc4)](_0x1e772a(0xae),_0x1e772a(0xba)+CLI_BIN_NAME+'\x20'+_0x8cddbf+_0x1e772a(0xa5));const _0x286728=_0x460725[_0x1e772a(0xa4)](_0x1e772a(0xa3));if(!_0x286728)throw CliErrors[_0x1e772a(0xc8)](_0x1e772a(0xa3),'Usage:\x20'+CLI_BIN_NAME+'\x20'+_0x8cddbf+_0x1e772a(0xa5));const _0x22d015={'global':_0x460725[_0x1e772a(0xb6)](_0x1e772a(0xb3))},_0x239dd6=readConfig(_0x22d015);if(!_0x239dd6[_0x1e772a(0xb5)])_0x239dd6[_0x1e772a(0xb5)]={};const _0x3deea4={'appcode':_0x286728,...collectAppProfileOverrides(_0x3d91d0=>_0x460725[_0x1e772a(0xa4)](_0x3d91d0))},_0x1a3ab8=_0x239dd6[_0x1e772a(0xb5)],_0x3efa5=Object[_0x1e772a(0xc0)](_0x1a3ab8),_0x212a49=typeof _0x239dd6[_0x1e772a(0xa8)]===_0x1e772a(0xc6)&&_0x1a3ab8[_0x239dd6[_0x1e772a(0xa8)]]?_0x239dd6[_0x1e772a(0xa8)]:_0x3efa5[_0x1e772a(0xb2)]===0x1?_0x3efa5[0x0]:undefined,_0x28b8e9=!!_0x1a3ab8[_0x5a54fe];_0x1a3ab8[_0x5a54fe]=_0x3deea4;const _0x43fc4f=normalizeStoredDefaultApp(_0x239dd6,_0x212a49);writeConfig(_0x239dd6,_0x22d015);const _0x50d0ce=!_0x28b8e9&&_0x43fc4f?_0x1e772a(0xac)+_0x43fc4f+'\x22.':'',_0xca9b36=(_0x28b8e9?'Updated':_0x1e772a(0xc3))+_0x1e772a(0xbc)+_0x5a54fe+_0x1e772a(0xc5)+_0x286728+')'+scopeLabel(_0x22d015)+'.'+_0x50d0ce;return{'ok':!![],'message':_0xca9b36};}export async function runAppRemove(_0x526dbb,_0x1d9814){const _0x38c226=a44_0x3f0a,_0x482176=_0x526dbb[_0x38c226(0xca)][0x0]?.[_0x38c226(0xb8)]();if(!_0x482176)throw CliErrors[_0x38c226(0xc4)]('Missing\x20app\x20name.','Usage:\x20'+CLI_BIN_NAME+'\x20'+_0x1d9814+'\x20<name>\x20[--global]');const _0x20a740=_0x526dbb[_0x38c226(0xb6)](_0x38c226(0xb3)),{config:_0x378d02,layers:_0x19bc54}=readRawConfigWithLayers(),_0xfa5d50=_0x378d02[_0x38c226(0xb5)]??{};if(!_0xfa5d50[_0x482176])throw CliErrors[_0x38c226(0xc4)](_0x38c226(0x9f)+_0x482176+_0x38c226(0xaa));const _0x885b8d=_0x19bc54[_0x38c226(0xa0)]['apps']&&typeof _0x19bc54[_0x38c226(0xa0)][_0x38c226(0xb5)]===_0x38c226(0xc9)?_0x19bc54[_0x38c226(0xa0)][_0x38c226(0xb5)]:{},_0x14d764=_0x19bc54[_0x38c226(0xa6)]['apps']&&typeof _0x19bc54[_0x38c226(0xa6)]['apps']===_0x38c226(0xc9)?_0x19bc54[_0x38c226(0xa6)][_0x38c226(0xb5)]:{},_0x14ee97=appDefinedIn(_0x482176,_0x885b8d,_0x14d764),_0x1d2214=resolveAppScopeForWrite(_0x482176,_0x20a740,_0x19bc54),_0x52807f={'global':_0x1d2214===_0x38c226(0xb3)},_0x53958d=readConfig(_0x52807f),_0x3ae51e=_0x53958d[_0x38c226(0xb5)];if(!_0x3ae51e||!_0x3ae51e[_0x482176])throw CliErrors[_0x38c226(0xc4)](_0x38c226(0x9f)+_0x482176+'\x22\x20not\x20found.');delete _0x3ae51e[_0x482176];let _0x45363d='';const _0x3a8c01=typeof _0x53958d['defaultApp']==='string'?_0x53958d[_0x38c226(0xa8)]:undefined,_0x35bea8=Object[_0x38c226(0xc0)](_0x3ae51e),_0x550552=_0x3a8c01===_0x482176?_0x35bea8[0x0]:_0x3a8c01,_0x3598d5=normalizeStoredDefaultApp(_0x53958d,_0x550552);if(_0x3a8c01===_0x482176&&_0x35bea8['length']===0x1)_0x45363d='\x20Remaining\x20app\x20\x22'+_0x35bea8[0x0]+_0x38c226(0xb1);else _0x3a8c01===_0x482176&&_0x3598d5&&(_0x45363d='\x20Default\x20app\x20changed\x20to\x20\x22'+_0x3598d5+'\x22.');Object['keys'](_0x3ae51e)[_0x38c226(0xb2)]===0x0&&(delete _0x53958d[_0x38c226(0xb5)],delete _0x53958d[_0x38c226(0xa8)]);writeConfig(_0x53958d,_0x52807f);const _0x324524=_0x14ee97===_0x38c226(0xaf)?_0x38c226(0xa2)+_0x482176+_0x38c226(0xa7)+(_0x1d2214===_0x38c226(0xbd)?_0x38c226(0xb3):_0x38c226(0xbd))+_0x38c226(0xbb):'';return{'ok':!![],'message':_0x38c226(0xc7)+_0x482176+'\x22'+scopeLabel(_0x52807f)+'.'+_0x45363d+_0x324524};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5c08ae,_0x5d9643){const _0x5b7d26=a45_0x20f2,_0x31f40f=_0x5c08ae();while(!![]){try{const _0x50cb3c=parseInt(_0x5b7d26(0xb8))/0x1+-parseInt(_0x5b7d26(0xc0))/0x2*(parseInt(_0x5b7d26(0xd2))/0x3)+-parseInt(_0x5b7d26(0xc6))/0x4*(parseInt(_0x5b7d26(0xbd))/0x5)+-parseInt(_0x5b7d26(0xcc))/0x6*(parseInt(_0x5b7d26(0xce))/0x7)+-parseInt(_0x5b7d26(0xc4))/0x8+parseInt(_0x5b7d26(0xbf))/0x9+-parseInt(_0x5b7d26(0xd3))/0xa*(-parseInt(_0x5b7d26(0xc8))/0xb);if(_0x50cb3c===_0x5d9643)break;else _0x31f40f['push'](_0x31f40f['shift']());}catch(_0x293a77){_0x31f40f['push'](_0x31f40f['shift']());}}}(a45_0x4cd2,0x4a5b0));import{input,checkbox,select}from'@inquirer/prompts';import a45_0x961ee1 from'chalk';import{validateAppcode}from'../../commands/common/validate.js';import{listRemoteApps}from'../../core/api-client.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';function a45_0x20f2(_0x2cc84e,_0x14420c){_0x2cc84e=_0x2cc84e-0xb4;const _0x4cd2aa=a45_0x4cd2();let _0x20f24f=_0x4cd2aa[_0x2cc84e];return _0x20f24f;}import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';export async function promptCustomAppcode(){const _0x208101=a45_0x20f2,_0xe3401e=await input({'message':'App\x20Code:','validate':_0x12e04d=>{const _0x375e4c=a45_0x20f2,_0x34c5af=validateAppcode(_0x12e04d[_0x375e4c(0xc1)]());return _0x34c5af[_0x375e4c(0xcd)]||_0x34c5af['message']||_0x375e4c(0xb5);}});return _0xe3401e[_0x208101(0xc1)]();}export async function promptAppSelection(_0x454607){const _0x199476=a45_0x20f2,_0x461110=[{'name':a45_0x961ee1[_0x199476(0xcb)](_0x199476(0xc9)),'value':-0x1},..._0x454607[_0x199476(0xb7)]((_0x1f2ce9,_0x4577f1)=>({'name':_0x1f2ce9[_0x199476(0xd7)]+'\x20\x20'+a45_0x961ee1[_0x199476(0xc2)]('('+_0x1f2ce9['appCode']+')'),'value':_0x4577f1}))],_0x3d4de5=await checkbox({'message':_0x199476(0xb6)+a45_0x961ee1['cyan'](_0x454607[_0x199476(0xd6)])+_0x199476(0xbe),'choices':_0x461110,'loop':![]});if(_0x3d4de5[_0x199476(0xb9)](-0x1))return _0x199476(0xd1);if(_0x3d4de5[_0x199476(0xd6)]===0x0)return _0x199476(0xd1);return _0x3d4de5['map'](_0x3f35ae=>_0x454607[_0x3f35ae]);}function a45_0x4cd2(){const _0x1104fd=['Fetching\x20available\x20apps...','Invalid\x20App\x20Code','Found\x20','map','431516eIDfKk','includes','\x0aNo\x20available\x20apps\x20found.','No\x20available\x20apps\x20found.','appCode','15800NUjpsL','\x20apps.\x20Select\x20with\x20space,\x20a=all,\x20i=invert:','1055844hGSCIt','4YSfEtK','trim','gray','\x20\x20(','179496UTwyzE','skip','252dEcSYa','(Skip;\x20configure\x20later)','154XgJkIE','✎\x20Enter\x20appcode\x20manually','find','yellow','18rZdpma','valid','420861uyUIZE','message','Select\x20the\x20app\x20to\x20bind:','custom','46848HkvGqT','134890bkzDHa','(Skip;\x20configure\x20later\x20with\x20config\x20set\x20appcode)','(No\x20login\x20session.\x20Enter\x20an\x20App\x20Code\x20manually\x20or\x20skip.)','length','appName','✎\x20Enter\x20manually','App\x20Code:'];a45_0x4cd2=function(){return _0x1104fd;};return a45_0x4cd2();}export async function promptSingleAppSelection(_0x37bbfb){const _0x494e2d=a45_0x20f2,_0x26d3d3=[{'name':a45_0x961ee1[_0x494e2d(0xc2)](_0x494e2d(0xd4)),'value':_0x494e2d(0xc5)},{'name':a45_0x961ee1[_0x494e2d(0xcb)](_0x494e2d(0xc9)),'value':_0x494e2d(0xd1)},..._0x37bbfb[_0x494e2d(0xb7)](_0x581df5=>({'name':_0x581df5['appName']+'\x20\x20'+a45_0x961ee1['gray']('('+_0x581df5['appCode']+')'),'value':_0x581df5[_0x494e2d(0xbc)]}))],_0x593282=await select({'message':_0x494e2d(0xd0),'choices':_0x26d3d3});if(_0x593282===_0x494e2d(0xc5))return _0x494e2d(0xc5);if(_0x593282===_0x494e2d(0xd1))return _0x494e2d(0xd1);return _0x37bbfb[_0x494e2d(0xca)](_0x428081=>_0x428081[_0x494e2d(0xbc)]===_0x593282);}export async function selectSingleAppcode(_0x13d728){const _0x3cb8de=a45_0x20f2;if(!_0x13d728)return writeCliSideChannelLine(a45_0x961ee1[_0x3cb8de(0xc2)](_0x3cb8de(0xd5))),_fallbackOrSkip();writeCliSideChannelLine('Fetching\x20available\x20apps...');let _0x2ab512;try{_0x2ab512=await withActiveCookie(_0x13d728,()=>listRemoteApps());}catch(_0x4420fc){writeCliSideChannelLine(a45_0x961ee1[_0x3cb8de(0xcb)]('Could\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.'));if(_0x4420fc instanceof Error)writeCliSideChannelLine(a45_0x961ee1[_0x3cb8de(0xc2)](_0x3cb8de(0xc3)+_0x4420fc[_0x3cb8de(0xcf)]+')'));return _fallbackOrSkip();}if(_0x2ab512[_0x3cb8de(0xd6)]===0x0)return writeCliSideChannelLine(a45_0x961ee1[_0x3cb8de(0xcb)](_0x3cb8de(0xbb))),_fallbackOrSkip();const _0x12ad87=await promptSingleAppSelection(_0x2ab512);if(_0x12ad87===_0x3cb8de(0xc5))return'';if(_0x12ad87===_0x3cb8de(0xd1))return promptCustomAppcode();return _0x12ad87[_0x3cb8de(0xbc)];}export async function selectMultipleApps(_0x24ba1e){const _0x564c83=a45_0x20f2;writeCliSideChannelLine(_0x564c83(0xb4));let _0x4f3e99;try{_0x4f3e99=await withActiveCookie(_0x24ba1e,()=>listRemoteApps());}catch(_0x794f7e){writeCliSideChannelLine('\x0aCould\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.');if(_0x794f7e instanceof Error)writeCliSideChannelLine(_0x564c83(0xc3)+_0x794f7e['message']+')');return _0x564c83(0xd1);}if(_0x4f3e99['length']===0x0)return writeCliSideChannelLine(_0x564c83(0xba)),_0x564c83(0xd1);return promptAppSelection(_0x4f3e99);}async function _fallbackOrSkip(){const _0x5e33d7=a45_0x20f2,_0x59dacc=await select({'message':_0x5e33d7(0xd9),'choices':[{'name':a45_0x961ee1[_0x5e33d7(0xc2)](_0x5e33d7(0xc7)),'value':'skip'},{'name':a45_0x961ee1['yellow'](_0x5e33d7(0xd8)),'value':'manual'}]});if(_0x59dacc===_0x5e33d7(0xc5))return'';return promptCustomAppcode();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a46_0x1e7bb2=a46_0x56cd;(function(_0xcee493,_0x5ca6a0){const _0x198806=a46_0x56cd,_0x32bea2=_0xcee493();while(!![]){try{const _0x56c285=parseInt(_0x198806(0x9e))/0x1+-parseInt(_0x198806(0xa3))/0x2+parseInt(_0x198806(0xb6))/0x3*(-parseInt(_0x198806(0xac))/0x4)+-parseInt(_0x198806(0xb3))/0x5*(-parseInt(_0x198806(0x99))/0x6)+-parseInt(_0x198806(0xaf))/0x7+parseInt(_0x198806(0xaa))/0x8+parseInt(_0x198806(0xa9))/0x9;if(_0x56c285===_0x5ca6a0)break;else _0x32bea2['push'](_0x32bea2['shift']());}catch(_0x31b93c){_0x32bea2['push'](_0x32bea2['shift']());}}}(a46_0x4e45,0xca3f8));function a46_0x56cd(_0x2159f4,_0x513b9a){_0x2159f4=_0x2159f4-0x98;const _0x4e45fd=a46_0x4e45();let _0x56cd00=_0x4e45fd[_0x2159f4];return _0x56cd00;}import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';const TERMINAL_STATUSES=new Set([a46_0x1e7bb2(0x98),a46_0x1e7bb2(0xab)]),NON_TERMINAL_STATUSES=new Set([a46_0x1e7bb2(0xb9),a46_0x1e7bb2(0xa4)]);export function normalizeAsyncTask(_0x2d8f24){const _0x1ad6b6=a46_0x1e7bb2,_0x41355e=typeof _0x2d8f24?.[_0x1ad6b6(0x9c)]===_0x1ad6b6(0x9a)?_0x2d8f24['taskId']['trim']():'';if(!_0x41355e)throw CliErrors[_0x1ad6b6(0xa1)](_0x1ad6b6(0x9b));const _0x4d85b9=typeof _0x2d8f24[_0x1ad6b6(0xa7)]===_0x1ad6b6(0x9a)?_0x2d8f24[_0x1ad6b6(0xa7)][_0x1ad6b6(0xb7)]()['toUpperCase']():'';if(!_0x4d85b9)throw CliErrors[_0x1ad6b6(0xa1)](_0x1ad6b6(0xa2)+_0x41355e+_0x1ad6b6(0xa5));return{'taskId':_0x41355e,'status':_0x4d85b9,'errorMessage':typeof _0x2d8f24[_0x1ad6b6(0xb2)]===_0x1ad6b6(0x9a)&&_0x2d8f24[_0x1ad6b6(0xb2)][_0x1ad6b6(0xb7)]()?_0x2d8f24['errorMessage'][_0x1ad6b6(0xb7)]():null,'isTerminal':TERMINAL_STATUSES['has'](_0x4d85b9),'knownStatus':TERMINAL_STATUSES[_0x1ad6b6(0xa8)](_0x4d85b9)||NON_TERMINAL_STATUSES['has'](_0x4d85b9)};}export function buildAsyncTaskStatusCommand(_0xbf0836,_0x4ff4e0){const _0x325bcf=a46_0x1e7bb2;return CLI_BIN_NAME+_0x325bcf(0xb1)+quoteShellArg(_0xbf0836)+_0x325bcf(0xae)+quoteShellArg(_0x4ff4e0)+_0x325bcf(0xad);}export function asyncTaskMessage(_0x4b1dd9){const _0xc4aedb=a46_0x1e7bb2;switch(_0x4b1dd9[_0xc4aedb(0xa7)]){case _0xc4aedb(0xb9):return _0xc4aedb(0xa6)+_0x4b1dd9[_0xc4aedb(0x9c)]+_0xc4aedb(0xb0);case _0xc4aedb(0xa4):return _0xc4aedb(0xa6)+_0x4b1dd9[_0xc4aedb(0x9c)]+'\x20is\x20processing.';case _0xc4aedb(0x98):return _0xc4aedb(0xa6)+_0x4b1dd9['taskId']+_0xc4aedb(0xb8);case _0xc4aedb(0xab):return _0x4b1dd9[_0xc4aedb(0xb2)]?_0xc4aedb(0xa6)+_0x4b1dd9[_0xc4aedb(0x9c)]+_0xc4aedb(0xb4)+_0x4b1dd9[_0xc4aedb(0xb2)]:_0xc4aedb(0xa6)+_0x4b1dd9[_0xc4aedb(0x9c)]+_0xc4aedb(0xb5);default:return'Task\x20'+_0x4b1dd9['taskId']+_0xc4aedb(0x9d)+_0x4b1dd9[_0xc4aedb(0xa7)]+'.';}}function quoteShellArg(_0x25f7e5){const _0x8c3da1=a46_0x1e7bb2;return'\x27'+_0x25f7e5[_0x8c3da1(0xa0)](/'/g,_0x8c3da1(0x9f))+'\x27';}function a46_0x4e45(){const _0x576fed=['7203708uNYJrV','9458472xifAPq','FAILED','5901572AoDxZG','\x20--format\x20compress','\x20--appcode\x20','3922842vZdNrh','\x20is\x20pending.','\x20task\x20status\x20--task-id\x20','errorMessage','3260rrcujV','\x20failed:\x20','\x20failed.','3mpHKTi','trim','\x20completed\x20successfully.','PENDING','SUCCESS','10410NDUaEa','string','Async\x20task\x20response\x20did\x20not\x20contain\x20a\x20taskId.','taskId','\x20returned\x20unknown\x20status\x20','752825rQqXwp','\x27\x5c\x27\x27','replace','apiError','Async\x20task\x20','2005118YqQZPo','PROCESSING','\x20response\x20did\x20not\x20contain\x20a\x20status.','Task\x20','status','has'];a46_0x4e45=function(){return _0x576fed;};return a46_0x4e45();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a47_0x404d(){var _0x505660=['7820415yeJDnI','url','12sBHQKC','132580QWgvWI','220rakwCV','1dZBzpJ','8637300igCpDL','method','35994aepyol','5936249gMbbOz','120288DBzKOd','42iLwhfM','description','defineProperties','1330721eNEjCz','24KxTFOO'];a47_0x404d=function(){return _0x505660;};return a47_0x404d();}function a47_0x5ef3(_0x2ac29b,_0x51721c){_0x2ac29b=_0x2ac29b-0x194;var _0x404d62=a47_0x404d();var _0x5ef3d9=_0x404d62[_0x2ac29b];return _0x5ef3d9;}(function(_0x2de8d3,_0x1ec2c1){var _0xf1d085=a47_0x5ef3,_0x3d6a4e=_0x2de8d3();while(!![]){try{var _0x4175c6=parseInt(_0xf1d085(0x19c))/0x1*(parseInt(_0xf1d085(0x19a))/0x2)+-parseInt(_0xf1d085(0x1a2))/0x3*(parseInt(_0xf1d085(0x1a1))/0x4)+parseInt(_0xf1d085(0x19b))/0x5*(-parseInt(_0xf1d085(0x19f))/0x6)+-parseInt(_0xf1d085(0x195))/0x7*(-parseInt(_0xf1d085(0x196))/0x8)+parseInt(_0xf1d085(0x197))/0x9+-parseInt(_0xf1d085(0x19d))/0xa+parseInt(_0xf1d085(0x1a0))/0xb*(parseInt(_0xf1d085(0x199))/0xc);if(_0x4175c6===_0x1ec2c1)break;else _0x3d6a4e['push'](_0x3d6a4e['shift']());}catch(_0x3bf79f){_0x3d6a4e['push'](_0x3d6a4e['shift']());}}}(a47_0x404d,0x79373));export function asDryRunResult(_0x3b6f04,_0x52e28e){var _0x119f74=a47_0x5ef3;return Object[_0x119f74(0x194)](_0x3b6f04,{'method':{'value':_0x52e28e[_0x119f74(0x19e)],'enumerable':![]},'url':{'value':_0x52e28e[_0x119f74(0x198)],'enumerable':![]},..._0x52e28e['description']?{'description':{'value':_0x52e28e[_0x119f74(0x1a3)],'enumerable':![]}}:{}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x13b341=a48_0x46d7;(function(_0xb2739,_0x491089){const _0x5122db=a48_0x46d7,_0x34664b=_0xb2739();while(!![]){try{const _0x105b02=-parseInt(_0x5122db(0x1d3))/0x1+parseInt(_0x5122db(0x1e1))/0x2*(-parseInt(_0x5122db(0x1cc))/0x3)+-parseInt(_0x5122db(0x1d5))/0x4+-parseInt(_0x5122db(0x1d8))/0x5+parseInt(_0x5122db(0x1ce))/0x6+-parseInt(_0x5122db(0x1da))/0x7*(-parseInt(_0x5122db(0x1d1))/0x8)+parseInt(_0x5122db(0x1cf))/0x9;if(_0x105b02===_0x491089)break;else _0x34664b['push'](_0x34664b['shift']());}catch(_0x441092){_0x34664b['push'](_0x34664b['shift']());}}}(a48_0x2606,0x85582));function a48_0x2606(){const _0x2c7435=['94664zqAxpm','number','325821FYGgvJ','sqlcode','1552888vQweiP','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','MYSQL','2350255ckxPmo','App\x20code\x20(e.g.\x20app-xxxxx)','7sRsQPE','boolean','Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)','POSTGRESQL','appcode','string','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','44334taKQUO','code','42LnoaMU','datasetcode','1901166dIOzOk','15407244cuGJGF','App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)'];a48_0x2606=function(){return _0x2c7435;};return a48_0x2606();}export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}(?:_[^_\s]+_[^_\s]+)?$/i,'description':'a\x2032-character\x20hex\x20code,\x20optionally\x20with\x20`_xx_xx`\x20suffix\x20(e.g.\x2099a909313f1fa7153186431e1c551588\x20or\x2099a909313f1fa7153186431e1c551588_75_3c7120aa)'};export const CODE_FLAG={'name':a48_0x13b341(0x1cb),'type':a48_0x13b341(0x1df),'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_0x13b341(0x1cd),'description':'Dataset\x20code\x20(32-char\x20hex,\x20optionally\x20with\x20_xx_xx\x20suffix)'};export const SQLCODE_FLAG={'name':a48_0x13b341(0x1d4),'type':a48_0x13b341(0x1df),'required':!![],'description':a48_0x13b341(0x1e0),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a48_0x13b341(0x1d6)}};export const APPCODE_FLAG_OPTIONAL={'name':a48_0x13b341(0x1de),'type':a48_0x13b341(0x1df),'required':![],'description':a48_0x13b341(0x1d0)};export const APPCODE_FLAG={...APPCODE_FLAG_OPTIONAL,'required':!![],'description':a48_0x13b341(0x1d9)};export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};export const DBLINK_ID_FLAG={'name':'id','type':a48_0x13b341(0x1d2),'required':!![],'description':a48_0x13b341(0x1dc)};export const DB_TYPE_FLAG={'name':'dbtype','type':a48_0x13b341(0x1df),'required':!![],'description':'Database\x20product\x20type','enum':[a48_0x13b341(0x1d7),a48_0x13b341(0x1dd)]};function a48_0x46d7(_0x58e96b,_0x534caf){_0x58e96b=_0x58e96b-0x1cb;const _0x2606de=a48_0x2606();let _0x46d7ce=_0x2606de[_0x58e96b];return _0x46d7ce;}export const SKIP_CONNECTION_TEST_FLAG={'name':'skip-connection-test','type':a48_0x13b341(0x1db),'description':'Skip\x20testing\x20the\x20unsaved\x20database\x20configuration\x20before\x20create/update'};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4ff15c,_0x249b9d){const _0x5d2cb6=a49_0x15fc,_0x32bffc=_0x4ff15c();while(!![]){try{const _0x69c408=parseInt(_0x5d2cb6(0xf4))/0x1+parseInt(_0x5d2cb6(0xff))/0x2*(parseInt(_0x5d2cb6(0xf7))/0x3)+-parseInt(_0x5d2cb6(0x100))/0x4+-parseInt(_0x5d2cb6(0xf6))/0x5*(-parseInt(_0x5d2cb6(0xf5))/0x6)+-parseInt(_0x5d2cb6(0xfb))/0x7+-parseInt(_0x5d2cb6(0xf3))/0x8+parseInt(_0x5d2cb6(0x103))/0x9;if(_0x69c408===_0x249b9d)break;else _0x32bffc['push'](_0x32bffc['shift']());}catch(_0x357723){_0x32bffc['push'](_0x32bffc['shift']());}}}(a49_0x1910,0xe98c2));import{existsSync,statSync}from'node:fs';import{CliErrors}from'../../errors.js';const BYTES_PER_MB=0x400*0x400;export const DEVELOPMENT_UPLOAD_MAX_BYTES=0x32*BYTES_PER_MB;function a49_0x15fc(_0x482b76,_0x24036a){_0x482b76=_0x482b76-0xf3;const _0x1910ef=a49_0x1910();let _0x15fc89=_0x1910ef[_0x482b76];return _0x15fc89;}function formatBytes(_0x1aa2da){const _0x218450=a49_0x15fc;if(_0x1aa2da>=BYTES_PER_MB){const _0x4c8c54=Math[_0x218450(0x104)](_0x1aa2da/BYTES_PER_MB*0x64)/0x64;return _0x4c8c54[_0x218450(0x102)](0x2)+_0x218450(0xf8);}return _0x1aa2da+'\x20B';}function a49_0x1910(){const _0x1a5c74=['4256952NePYYz','File\x20is\x20not\x20a\x20regular\x20file:\x20','toFixed','19103742EsMXOY','ceil','8730672TNdQAy','1091579hoaGZs','1392jJLyzx','15915RZWtgw','3sPFhOz','\x20MB','trim','\x20path\x20is\x20required.','12098730INkKAE','isFile','size','validation','1775798WnoHaG'];a49_0x1910=function(){return _0x1a5c74;};return a49_0x1910();}export function requireDevelopmentUploadFile(_0x119018,_0x3a125a){const _0x3bb864=a49_0x15fc,_0x2ff84c=_0x119018[_0x3bb864(0xf9)]();if(!_0x2ff84c)throw CliErrors[_0x3bb864(0xfe)](_0x3a125a+_0x3bb864(0xfa));if(!existsSync(_0x2ff84c))throw CliErrors[_0x3bb864(0xfe)]('File\x20not\x20found:\x20'+_0x2ff84c);const _0xb89d71=statSync(_0x2ff84c);if(!_0xb89d71[_0x3bb864(0xfc)]())throw CliErrors[_0x3bb864(0xfe)](_0x3bb864(0x101)+_0x2ff84c);if(_0xb89d71[_0x3bb864(0xfd)]>DEVELOPMENT_UPLOAD_MAX_BYTES)throw CliErrors[_0x3bb864(0xfe)]('File\x20exceeds\x20the\x20development\x20upload\x20limit\x20of\x2050\x20MB:\x20'+_0x2ff84c+'\x20('+formatBytes(_0xb89d71[_0x3bb864(0xfd)])+')');return{'path':_0x2ff84c,'size':_0xb89d71['size']};}
|