@lovrabet/rabetbase-cli 2.5.1-beta.1 → 2.5.1-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.d.ts +107 -0
- package/lib/commands/dataset/field-restore.js +1 -0
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.d.ts +36 -0
- package/lib/commands/dataset/user-deleted-field-list.js +1 -0
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/auto-sync.d.ts +28 -0
- package/lib/commands/deployment/auto-sync.js +1 -0
- package/lib/commands/deployment/index.d.ts +2 -0
- package/lib/commands/deployment/index.js +1 -0
- package/lib/commands/deployment/sync.d.ts +2 -0
- package/lib/commands/deployment/sync.js +1 -0
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/deployment-sync.d.ts +10 -0
- package/lib/config/deployment-sync.js +1 -0
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-routing.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.d.ts +2 -0
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +35 -0
- 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.d.ts +4 -0
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +11 -5
- package/skills/rabetbase/references/rabetbase-dataset-business-group-update.md +9 -9
- package/skills/rabetbase/references/rabetbase-dataset-business-groups.md +1 -1
- package/skills/rabetbase/references/rabetbase-dataset-field-restore.md +59 -0
- package/skills/rabetbase/references/rabetbase-dataset-user-deleted-field-list.md +47 -0
- package/skills/rabetbase/references/rabetbase-deployment-sync.md +92 -0
- package/skills/rabetbase.manifest.json +6 -3
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a35_0x46d119=a35_0xbfff;(function(_0x50ab42,_0x52cca5){const _0xe1d5ef=a35_0xbfff,_0x9cb9df=_0x50ab42();while(!![]){try{const _0x39fae0=parseInt(_0xe1d5ef(0xf8))/0x1+parseInt(_0xe1d5ef(0xef))/0x2*(parseInt(_0xe1d5ef(0xe8))/0x3)+-parseInt(_0xe1d5ef(0xe9))/0x4+parseInt(_0xe1d5ef(0xf6))/0x5*(-parseInt(_0xe1d5ef(0xe6))/0x6)+-parseInt(_0xe1d5ef(0xe5))/0x7*(-parseInt(_0xe1d5ef(0xf2))/0x8)+parseInt(_0xe1d5ef(0xdd))/0x9*(parseInt(_0xe1d5ef(0xf7))/0xa)+-parseInt(_0xe1d5ef(0xf1))/0xb;if(_0x39fae0===_0x52cca5)break;else _0x9cb9df['push'](_0x9cb9df['shift']());}catch(_0x464bee){_0x9cb9df['push'](_0x9cb9df['shift']());}}}(a35_0x4eb2,0x57a9f));function a35_0x4eb2(){const _0x118c7b=['name','description','9HuAFyH','Script\x20type\x20filter','COMMON','appCode','map','read','ENDPOINT','No\x20Backend\x20Function\x20scripts\x20found.','14tCvxtB','54Ufmmdu','string','278007tlDQDM','627644eqPaMb','str','List\x20Backend\x20Function\x20scripts','bff','Return\x20full\x20script\x20objects','bool','12uPsDiX','type','9879474WdYMSK','2872448zhLrCp','functionName','list','verbose','368995RJkZLE','1457730wIfGox','658408TXCBdK','Filter\x20by\x20script\x20name'];a35_0x4eb2=function(){return _0x118c7b;};return a35_0x4eb2();}import{listBffScripts}from'../../core/api-client.js';function a35_0xbfff(_0x26e0d3,_0x24ba36){_0x26e0d3=_0x26e0d3-0xda;const _0x4eb24e=a35_0x4eb2();let _0xbfffaa=_0x4eb24e[_0x26e0d3];return _0xbfffaa;}export const bffList={'service':a35_0x46d119(0xec),'command':a35_0x46d119(0xf4),'description':a35_0x46d119(0xeb),'risk':a35_0x46d119(0xe2),'flags':[{'name':'type','type':a35_0x46d119(0xe7),'description':a35_0x46d119(0xde),'default':'ENDPOINT','enum':[a35_0x46d119(0xe3),a35_0x46d119(0xdf)]},{'name':'name','type':a35_0x46d119(0xe7),'description':a35_0x46d119(0xda)},{'name':a35_0x46d119(0xf5),'type':'boolean','description':a35_0x46d119(0xed)}],async 'execute'(_0x38d61e){const _0x265df7=a35_0x46d119,_0x5f77e9=await listBffScripts(_0x38d61e[_0x265df7(0xe0)],_0x38d61e[_0x265df7(0xea)](_0x265df7(0xf0)),{'scriptName':_0x38d61e['str'](_0x265df7(0xdb))||undefined}),_0x346587=_0x38d61e[_0x265df7(0xee)](_0x265df7(0xf5));return{'ok':!![],'data':_0x346587?_0x5f77e9:_0x5f77e9[_0x265df7(0xe1)](_0x54ec7c=>({'id':_0x54ec7c['id'],'functionName':_0x54ec7c[_0x265df7(0xf3)]??'','description':_0x54ec7c[_0x265df7(0xdc)]||'(unnamed)','scriptType':_0x54ec7c['scriptType']})),'message':_0x5f77e9['length']===0x0?_0x265df7(0xe4):undefined};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x443b19=a36_0x2853;(function(_0x2c8b9b,_0x5f508c){const _0x5c466b=a36_0x2853,_0x3cac7a=_0x2c8b9b();while(!![]){try{const _0x3edfd7=-parseInt(_0x5c466b(0x17c))/0x1+-parseInt(_0x5c466b(0x13c))/0x2+parseInt(_0x5c466b(0x178))/0x3*(-parseInt(_0x5c466b(0x176))/0x4)+-parseInt(_0x5c466b(0x16b))/0x5*(parseInt(_0x5c466b(0x15f))/0x6)+-parseInt(_0x5c466b(0x14f))/0x7+-parseInt(_0x5c466b(0x175))/0x8+parseInt(_0x5c466b(0x17a))/0x9*(parseInt(_0x5c466b(0x15d))/0xa);if(_0x3edfd7===_0x5f508c)break;else _0x3cac7a['push'](_0x3cac7a['shift']());}catch(_0x5e0924){_0x3cac7a['push'](_0x3cac7a['shift']());}}}(a36_0x4a2a,0x35994));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a36_0x4a2a(){const _0x5a6fe8=['includes','bool','\x20failed','yes','toLowerCase','map','would_pull','type','question','5kYzIGh','&type=','length','scriptType','stringify','Pull\x20only\x20this\x20script\x20type','\x22\x20not\x20found\x20after\x20ensureLockScope.','COMMON','datasetCode','bff','2178984LxbWQl','4BoICoa','hash','893901DaexbA','functionNode','9aQivMC','apiDir','26823SyPKQT','toISOString','pull','/api/management/library/scripts/list?appCode=','string','alias','filePath','\x20pulled,\x20','str','Remote\x20script\x20missing\x20id.','\x20skipped,\x20','596988cBXjwN','boolean','skipped','utf8','hookLocation','scriptContent','force','close','Pull\x20complete:\x20','all','message','unresolvable\x20target\x20path','lastSync','stdin','scriptsRoot','push','nonInteractive','functionName','read','755293utzzLT','appCode','validation','lockKey','cancelled','Force\x20pull\x20cancelled.','apps','operationType','Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','stderr','Force\x20overwrite\x20local\x20unsynced\x20changes','lockFilePath','HOOK','ENDPOINT','15185650yMCnmG','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','1772814QzPhdZ','functions','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull'];a36_0x4a2a=function(){return _0x5a6fe8;};return a36_0x4a2a();}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';function a36_0x2853(_0x41512d,_0x43ec21){_0x41512d=_0x41512d-0x133;const _0x4a2a98=a36_0x4a2a();let _0x285352=_0x4a2a98[_0x41512d];return _0x285352;}import{CliErrors}from'../../errors.js';export const bffPull={'service':a36_0x443b19(0x174),'command':a36_0x443b19(0x133),'description':a36_0x443b19(0x157),'risk':a36_0x443b19(0x14e),'flags':[{'name':a36_0x443b19(0x169),'type':a36_0x443b19(0x135),'description':a36_0x443b19(0x170),'enum':[a36_0x443b19(0x172),a36_0x443b19(0x15c),'HOOK']},{'name':a36_0x443b19(0x142),'type':a36_0x443b19(0x13d),'description':a36_0x443b19(0x159)}],async 'dryRun'(_0x2f36a0){const _0x52bc61=a36_0x443b19,_0x12140c=loadBffProjectConfig(_0x2f36a0['appCode']),_0x4bc0d5=await readBffLockFile(_0x12140c['lockFilePath']),{appLock:_0x23a4da}=ensureLockScope(_0x4bc0d5??createEmptyBffLock(),_0x2f36a0[_0x52bc61(0x150)],_0x12140c[_0x52bc61(0x14a)],_0x52bc61(0x133)),_0x2d5965=normalizeBffType(_0x2f36a0[_0x52bc61(0x139)]('type'))??undefined,_0x22c544=buildDatasetCodeToAliasMap(_0x2f36a0[_0x52bc61(0x17b)],_0x2f36a0['appCode']),[_0x3114e0,_0xdf5a30]=await Promise[_0x52bc61(0x145)]([listBffScripts(_0x2f36a0[_0x52bc61(0x150)],_0x2d5965),getBffScriptStatistics(_0x2f36a0['appCode'])]),_0x148e72=createHookLocationMap(_0xdf5a30),_0x2fcc39=[];for(const _0xbd8287 of _0x3114e0){const _0x196967=resolveRemoteScriptTarget(_0x12140c,_0xbd8287,_0x148e72,_0x23a4da['functions'],_0x22c544);if(!_0x196967){_0x2fcc39[_0x52bc61(0x14b)]({'scriptType':_0xbd8287[_0x52bc61(0x16e)],'functionName':_0xbd8287[_0x52bc61(0x14d)]??'','status':_0x52bc61(0x13e),'reason':_0x52bc61(0x147)});continue;}const _0x3ca1f5=_0x23a4da[_0x52bc61(0x160)][_0x196967[_0x52bc61(0x152)]],_0xb6895d=_0xbd8287[_0x52bc61(0x141)]!=null?computeContentHash(_0xbd8287[_0x52bc61(0x141)]):undefined,_0x5ede30=await hasUnsyncedLocalChanges(_0x196967[_0x52bc61(0x137)],_0x3ca1f5,_0xb6895d);_0x2fcc39[_0x52bc61(0x14b)]({'lockKey':_0x196967['lockKey'],'filePath':_0x196967['filePath'],'remoteId':_0xbd8287['id']??null,'status':_0x5ede30?'conflict':_0x52bc61(0x168)});}return{'method':'GET','url':_0x52bc61(0x134)+_0x2f36a0[_0x52bc61(0x150)]+(_0x2d5965?_0x52bc61(0x16c)+_0x2d5965:''),'body':{'appCode':_0x2f36a0[_0x52bc61(0x150)],'filterType':_0x2d5965??null,'files':_0x2fcc39},'description':'Would\x20inspect\x20'+_0x2fcc39[_0x52bc61(0x16d)]+_0x52bc61(0x161)};},async 'execute'(_0x27551e){const _0x4cb00b=a36_0x443b19,_0x165a2e=loadBffProjectConfig(_0x27551e[_0x4cb00b(0x150)]),_0x4daece=await readBffLockFile(_0x165a2e[_0x4cb00b(0x15a)]),{lockData:_0x3b6fbe,appLock:_0x13f84d}=ensureLockScope(_0x4daece??createEmptyBffLock(),_0x27551e[_0x4cb00b(0x150)],_0x165a2e[_0x4cb00b(0x14a)],_0x4cb00b(0x133)),_0x311daf=normalizeBffType(_0x27551e[_0x4cb00b(0x139)](_0x4cb00b(0x169)))??undefined;if(_0x27551e[_0x4cb00b(0x139)](_0x4cb00b(0x169))&&!_0x311daf)throw CliErrors[_0x4cb00b(0x151)]('--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.');const [_0x87d7a,_0x29bc73]=await Promise['all']([listBffScripts(_0x27551e[_0x4cb00b(0x150)],_0x311daf),getBffScriptStatistics(_0x27551e['appCode'])]);if(_0x87d7a['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x4cb00b(0x15e)};const _0x443bb9=_0x27551e[_0x4cb00b(0x163)](_0x4cb00b(0x142));if(_0x443bb9&&!_0x27551e['nonInteractive']){const _0x1da0a0=await confirmForce();if(!_0x1da0a0)throw CliErrors[_0x4cb00b(0x153)](_0x4cb00b(0x154));}if(_0x443bb9&&_0x27551e[_0x4cb00b(0x14c)]){}const _0x3d9bfe=buildDatasetCodeToAliasMap(_0x27551e['apiDir'],_0x27551e[_0x4cb00b(0x150)]),_0x383c18=createHookLocationMap(_0x29bc73),_0x408244=JSON['parse'](JSON[_0x4cb00b(0x16f)](_0x3b6fbe)),_0x281072=_0x27551e[_0x4cb00b(0x150)],_0x56e775=_0x408244[_0x4cb00b(0x155)][_0x281072];if(!_0x56e775)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x281072+_0x4cb00b(0x171));const _0x332126=[],_0x5bea17=[],_0x31e09f=[];for(const _0x154c8c of _0x87d7a){const _0x538b4a=resolveRemoteScriptTarget(_0x165a2e,_0x154c8c,_0x383c18,_0x13f84d[_0x4cb00b(0x160)],_0x3d9bfe);if(!_0x538b4a){_0x5bea17[_0x4cb00b(0x14b)]({'lockKey':_0x154c8c[_0x4cb00b(0x16e)]+'/'+_0x154c8c[_0x4cb00b(0x14d)],'reason':_0x4cb00b(0x147)});continue;}const _0x4ed3e3=_0x13f84d['functions'][_0x538b4a[_0x4cb00b(0x152)]];try{if(!_0x154c8c['id'])throw new Error(_0x4cb00b(0x13a));if(_0x154c8c['scriptContent']==null)throw new Error('Remote\x20script\x20missing\x20content.');const _0x5db35a=_0x154c8c[_0x4cb00b(0x141)],_0x43a263=computeContentHash(_0x5db35a);if(!_0x443bb9){const _0x530106=await hasUnsyncedLocalChanges(_0x538b4a['filePath'],_0x4ed3e3,_0x43a263);if(_0x530106){_0x5bea17[_0x4cb00b(0x14b)]({'lockKey':_0x538b4a[_0x4cb00b(0x152)],'reason':'local\x20unsynced\x20changes'});continue;}}await ensureParentDirectory(_0x538b4a[_0x4cb00b(0x137)]),await writeFile(_0x538b4a[_0x4cb00b(0x137)],_0x5db35a,_0x4cb00b(0x13f));const _0x377cc6={'hash':_0x43a263,'remoteId':_0x154c8c['id'],'version':_0x154c8c['version']};_0x538b4a[_0x4cb00b(0x169)]===_0x4cb00b(0x15b)&&_0x538b4a[_0x4cb00b(0x140)]&&(_0x377cc6[_0x4cb00b(0x136)]=_0x538b4a[_0x4cb00b(0x140)][_0x4cb00b(0x136)],_0x377cc6['datasetCode']=_0x538b4a['hookLocation'][_0x4cb00b(0x173)],_0x377cc6['operationType']=_0x538b4a[_0x4cb00b(0x140)][_0x4cb00b(0x156)],_0x377cc6[_0x4cb00b(0x179)]=_0x538b4a['hookLocation'][_0x4cb00b(0x179)]),_0x56e775['functions'][_0x538b4a[_0x4cb00b(0x152)]]=_0x377cc6,_0x332126[_0x4cb00b(0x14b)]({'lockKey':_0x538b4a[_0x4cb00b(0x152)],'remoteId':_0x154c8c['id']});}catch(_0xad11d6){_0x31e09f[_0x4cb00b(0x14b)]({'lockKey':_0x538b4a[_0x4cb00b(0x152)],'error':_0xad11d6 instanceof Error?_0xad11d6[_0x4cb00b(0x146)]:String(_0xad11d6)});}}return _0x56e775[_0x4cb00b(0x148)]=new Date()[_0x4cb00b(0x17d)](),await writeBffLockFile(_0x165a2e[_0x4cb00b(0x15a)],_0x408244),{'ok':_0x31e09f[_0x4cb00b(0x16d)]===0x0,'data':{'pulled':_0x332126,'skipped':_0x5bea17,'failed':_0x31e09f},'message':_0x4cb00b(0x144)+_0x332126['length']+_0x4cb00b(0x138)+_0x5bea17[_0x4cb00b(0x16d)]+_0x4cb00b(0x13b)+_0x31e09f[_0x4cb00b(0x16d)]+_0x4cb00b(0x164)};}};async function hasUnsyncedLocalChanges(_0xa7226c,_0x77e3f1,_0x1dbb36){const _0x2b63c4=a36_0x443b19;if(!await fileExists(_0xa7226c))return![];const _0x2813bf=await computeFileHash(_0xa7226c);if(!_0x77e3f1)return _0x1dbb36?_0x2813bf!==_0x1dbb36:!![];return _0x2813bf!==_0x77e3f1[_0x2b63c4(0x177)];}function buildDatasetCodeToAliasMap(_0x178fb1,_0x2343d9){const _0x5b4bda=a36_0x443b19,_0x3bf243=loadAliasMap(_0x178fb1,undefined,resolveApiFilePath(_0x178fb1,_0x2343d9));return new Map(_0x3bf243[_0x5b4bda(0x167)](_0x173510=>[_0x173510['datasetCode'],_0x173510[_0x5b4bda(0x136)]]));}async function confirmForce(){const _0x48a9c9=a36_0x443b19,_0x30d801=createInterface({'input':process[_0x48a9c9(0x149)],'output':process[_0x48a9c9(0x158)]}),_0x4756bb=await new Promise(_0x50050b=>{const _0x457a55=_0x48a9c9;_0x30d801[_0x457a55(0x16a)]('Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20',_0x50050b);});return _0x30d801[_0x48a9c9(0x143)](),['y',_0x48a9c9(0x165)][_0x48a9c9(0x162)](_0x4756bb['trim']()[_0x48a9c9(0x166)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a37_0x440f53=a37_0x2171;(function(_0x45eeb8,_0x521915){const _0x279f8a=a37_0x2171,_0x548bac=_0x45eeb8();while(!![]){try{const _0x2fbd34=parseInt(_0x279f8a(0xa1))/0x1*(-parseInt(_0x279f8a(0xa8))/0x2)+-parseInt(_0x279f8a(0x8a))/0x3*(-parseInt(_0x279f8a(0xa3))/0x4)+parseInt(_0x279f8a(0xb0))/0x5+-parseInt(_0x279f8a(0x94))/0x6+-parseInt(_0x279f8a(0x69))/0x7+-parseInt(_0x279f8a(0x65))/0x8+parseInt(_0x279f8a(0xb1))/0x9*(parseInt(_0x279f8a(0x81))/0xa);if(_0x2fbd34===_0x521915)break;else _0x548bac['push'](_0x548bac['shift']());}catch(_0x48d213){_0x548bac['push'](_0x548bac['shift']());}}}(a37_0x4de5,0xa954c));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a37_0x4de5(){const _0x18d681=['would_push','write','boolean','\x22\x20not\x20found\x20after\x20ensureLockScope.','filePath','1178000nLmuWu','18341847vqrdje','POST','force','runtime\x20cache\x20clear\x20failed','6543432nEOmGW','get','name','scriptsRoot','2699284dYXpNK','functions','code','stringify','unchanged','some','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','push','datasetCode','Lock\x20scope\x20for\x20app\x20\x22','runtime\x20cache\x20cleared','\x22.\x20','status','Would\x20inspect\x20','runtime\x20cache\x20not\x20needed','Force\x20push\x20ignoring\x20hash\x20protection','parse','script','description','apiDir','create','filter','lockFilePath','Push\x20complete:\x20','10tUyUEo','str','operationType','\x20skipped,\x20','has','HOOK','values','alias','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','3uXtkRu','validation','datasetId','aliasToDatasetCode','message','bool','\x20failed,\x20','type','\x20uploaded,\x20','Cannot\x20resolve\x20dataset\x20for\x20\x22','2521776rKwbZM','Local\x20function\x20not\x20found:\x20','/api/management/library/scripts/save','attempted','Runtime\x20script\x20cache\x20cleared.','cleared','version','appCode','toISOString','every','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','update','functionNode','1xTmRmd','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','2901668nWoNgB','lockKey','length','No\x20local\x20Backend\x20Function\x20scripts\x20found.','remoteId','1363166kPGLlr','map','COMMON'];a37_0x4de5=function(){return _0x18d681;};return a37_0x4de5();}import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';function a37_0x2171(_0x47efb1,_0x177845){_0x47efb1=_0x47efb1-0x64;const _0x4de512=a37_0x4de5();let _0x2171d9=_0x4de512[_0x47efb1];return _0x2171d9;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':a37_0x440f53(0x70),'description':'Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','risk':a37_0x440f53(0xac),'flags':[{'name':a37_0x440f53(0x91),'type':'string','description':'Push\x20only\x20this\x20script\x20type','enum':[a37_0x440f53(0xaa),'ENDPOINT',a37_0x440f53(0x86)]},{'name':a37_0x440f53(0x67),'type':'string','description':'Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)'},{'name':a37_0x440f53(0xb3),'type':a37_0x440f53(0xad),'description':a37_0x440f53(0x78)}],async 'dryRun'(_0x176476){const _0x344aa6=a37_0x440f53,_0x3e1a4a=loadBffProjectConfig(_0x176476[_0x344aa6(0x9b)]),_0x2c607b=await readBffLockFile(_0x3e1a4a['lockFilePath']),{appLock:_0x137f2f}=ensureLockScope(_0x2c607b??createEmptyBffLock(),_0x176476[_0x344aa6(0x9b)],_0x3e1a4a['scriptsRoot'],'push'),_0x30d1ef=await getTargetFunctions(_0x3e1a4a,_0x176476),_0x1859a4=_0x176476[_0x344aa6(0x8f)](_0x344aa6(0xb3)),_0x530e3f=[];for(const _0x4512b4 of _0x30d1ef){const _0x1566ce=await computeFileHash(_0x4512b4[_0x344aa6(0xaf)]),_0x448cd7=_0x137f2f[_0x344aa6(0x6a)][_0x4512b4[_0x344aa6(0xa4)]],_0x248979=!!_0x448cd7&&_0x448cd7['hash']===_0x1566ce;_0x530e3f[_0x344aa6(0x70)]({'lockKey':_0x4512b4[_0x344aa6(0xa4)],'filePath':_0x4512b4[_0x344aa6(0xaf)],'remoteId':_0x448cd7?.[_0x344aa6(0xa7)]??null,'mode':_0x448cd7?.['remoteId']?_0x344aa6(0x9f):_0x344aa6(0x7d),'status':!_0x1859a4&&_0x248979?'unchanged':_0x344aa6(0xab)});}return{'method':_0x344aa6(0xb2),'url':_0x344aa6(0x96),'body':{'appCode':_0x176476[_0x344aa6(0x9b)],'force':_0x1859a4,'files':_0x530e3f,'cacheClearAtRuntime':_0x530e3f[_0x344aa6(0x6e)](_0x737f97=>_0x737f97[_0x344aa6(0x75)]===_0x344aa6(0xab)),'cacheClearAtRuntimeTimes':_0x530e3f[_0x344aa6(0x6e)](_0x292484=>_0x292484[_0x344aa6(0x75)]==='would_push')?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x344aa6(0x76)+_0x530e3f['length']+_0x344aa6(0x6f)};},async 'execute'(_0x3875ee){const _0x45b4cb=a37_0x440f53,_0x1d6b9f=loadBffProjectConfig(_0x3875ee['appCode']),_0x48f29b=await readBffLockFile(_0x1d6b9f['lockFilePath']),{lockData:_0x5b47fb,appLock:_0x4d0c31}=ensureLockScope(_0x48f29b??createEmptyBffLock(),_0x3875ee['appCode'],_0x1d6b9f[_0x45b4cb(0x68)],_0x45b4cb(0x70)),_0x4dd21f=await getTargetFunctions(_0x1d6b9f,_0x3875ee);if(_0x4dd21f[_0x45b4cb(0xa5)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x45b4cb(0xa6)};const _0x3f471f=_0x3875ee[_0x45b4cb(0x8f)]('force'),_0x4b2c12=JSON[_0x45b4cb(0x79)](JSON[_0x45b4cb(0x6c)](_0x5b47fb)),_0x43bb00=_0x4b2c12['apps'][_0x3875ee[_0x45b4cb(0x9b)]];if(!_0x43bb00)throw new Error(_0x45b4cb(0x72)+_0x3875ee[_0x45b4cb(0x9b)]+_0x45b4cb(0xae));const _0x40da18=await buildHookMaps(_0x3875ee[_0x45b4cb(0x9b)],_0x3875ee[_0x45b4cb(0x7c)],_0x4dd21f,_0x43bb00),_0x44b9cd=[],_0x161157=[],_0x544d8f=[];for(const _0x29abf9 of _0x4dd21f){const _0xd0f0a=await computeFileHash(_0x29abf9[_0x45b4cb(0xaf)]),_0x574e22=_0x43bb00[_0x45b4cb(0x6a)][_0x29abf9['lockKey']];if(!_0x3f471f&&_0x574e22&&_0x574e22['hash']===_0xd0f0a){_0x161157['push']({'lockKey':_0x29abf9[_0x45b4cb(0xa4)],'reason':_0x45b4cb(0x6d)});continue;}try{await uploadSingleFunction(_0x3875ee['appCode'],_0x29abf9,_0x43bb00,_0x40da18);const _0x5bf9f1=_0x43bb00[_0x45b4cb(0x6a)][_0x29abf9[_0x45b4cb(0xa4)]];_0x44b9cd[_0x45b4cb(0x70)]({'lockKey':_0x29abf9[_0x45b4cb(0xa4)],'remoteId':_0x5bf9f1?.[_0x45b4cb(0xa7)]??0x0});}catch(_0x41ef98){_0x544d8f[_0x45b4cb(0x70)]({'lockKey':_0x29abf9[_0x45b4cb(0xa4)],'error':_0x41ef98 instanceof Error?_0x41ef98[_0x45b4cb(0x8e)]:String(_0x41ef98)});}}_0x43bb00['lastSync']=new Date()[_0x45b4cb(0x9c)](),await writeBffLockFile(_0x1d6b9f[_0x45b4cb(0x7f)],_0x4b2c12),await waitForUploadedLockEntries(_0x1d6b9f['lockFilePath'],_0x3875ee['appCode'],_0x44b9cd[_0x45b4cb(0xa9)](_0x3ec19f=>_0x3ec19f[_0x45b4cb(0xa4)]));let _0x5b9b5f={'attempted':![],'cleared':![]};if(_0x44b9cd[_0x45b4cb(0xa5)]>0x0)try{let _0x2d27f4='';for(let _0x34c559=0x0;_0x34c559<CACHE_CLEAR_ATTEMPTS;_0x34c559+=0x1){_0x2d27f4=await clearBffScriptCache(),_0x34c559<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x5b9b5f={'attempted':!![],'cleared':!![],'message':_0x2d27f4||_0x45b4cb(0x98)};}catch(_0xd6072e){_0x5b9b5f={'attempted':!![],'cleared':![],'error':_0xd6072e instanceof Error?_0xd6072e['message']:String(_0xd6072e)};}const _0x34da1f=_0x544d8f[_0x45b4cb(0xa5)]===0x0&&(_0x5b9b5f[_0x45b4cb(0x97)]?_0x5b9b5f[_0x45b4cb(0x99)]:!![]),_0x73a556=_0x5b9b5f[_0x45b4cb(0x97)]?_0x5b9b5f[_0x45b4cb(0x99)]?_0x45b4cb(0x73):_0x45b4cb(0x64):_0x45b4cb(0x77);return{'ok':_0x34da1f,'data':{'uploaded':_0x44b9cd,'skipped':_0x161157,'failed':_0x544d8f,'cacheClear':_0x5b9b5f},'message':_0x45b4cb(0x80)+_0x44b9cd[_0x45b4cb(0xa5)]+_0x45b4cb(0x92)+_0x161157['length']+_0x45b4cb(0x84)+_0x544d8f[_0x45b4cb(0xa5)]+_0x45b4cb(0x90)+_0x73a556};}};async function getTargetFunctions(_0x140211,_0x2bb6da){const _0x2ee5f4=a37_0x440f53,_0x18f02a=_0x2bb6da[_0x2ee5f4(0x82)]('type'),_0x4a4d99=_0x2bb6da[_0x2ee5f4(0x82)](_0x2ee5f4(0x67)),_0x6b772=normalizeBffType(_0x18f02a)??undefined;if(_0x4a4d99&&!_0x6b772)throw CliErrors[_0x2ee5f4(0x8b)](_0x2ee5f4(0x89));const _0x5cbb50=await scanLocalBffFunctions(_0x140211,_0x6b772);if(_0x4a4d99){const _0x4c3a9d=_0x5cbb50[_0x2ee5f4(0x7e)](_0x26d25d=>_0x26d25d[_0x2ee5f4(0x67)]===_0x4a4d99);if(_0x4c3a9d[_0x2ee5f4(0xa5)]===0x0)throw CliErrors[_0x2ee5f4(0x8b)](_0x2ee5f4(0x95)+_0x6b772+'/'+_0x4a4d99);return _0x4c3a9d;}return _0x5cbb50;}async function buildHookMaps(_0x5c3966,_0x40f917,_0x53ef7e,_0x12dc20){const _0xe9b921=a37_0x440f53,_0x115a81=_0x53ef7e[_0xe9b921(0x6e)](_0x28f12a=>_0x28f12a[_0xe9b921(0x91)]==='HOOK');if(!_0x115a81)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0xcc4e87=loadAliasMap(_0x40f917,undefined,resolveApiFilePath(_0x40f917,_0x5c3966)),_0x1f0e4c=new Map(_0xcc4e87[_0xe9b921(0xa9)](_0x1d3c24=>[_0x1d3c24[_0xe9b921(0x88)],_0x1d3c24[_0xe9b921(0x71)]]));for(const _0x2b376f of Object[_0xe9b921(0x87)](_0x12dc20['functions'])){_0x2b376f[_0xe9b921(0x88)]&&_0x2b376f[_0xe9b921(0x71)]&&!_0x1f0e4c[_0xe9b921(0x85)](_0x2b376f[_0xe9b921(0x88)])&&_0x1f0e4c['set'](_0x2b376f[_0xe9b921(0x88)],_0x2b376f[_0xe9b921(0x71)]);}const _0x299ecb=await listDatasets(_0x5c3966),_0x1e4da6=new Map(_0x299ecb['map'](_0x18f9e2=>[_0x18f9e2[_0xe9b921(0x6b)],_0x18f9e2]));return{'aliasToDatasetCode':_0x1f0e4c,'datasetCodeToDataset':_0x1e4da6};}async function uploadSingleFunction(_0x5ddff2,_0x41f265,_0x530074,_0x129f08){const _0x1e2a43=a37_0x440f53,_0x49fe69=await readFile(_0x41f265['filePath'],'utf8'),_0x34173f=await computeFileHash(_0x41f265[_0x1e2a43(0xaf)]),_0x4f96a8=_0x530074[_0x1e2a43(0x6a)][_0x41f265['lockKey']];if(_0x4f96a8?.[_0x1e2a43(0xa7)]&&_0x4f96a8[_0x1e2a43(0x9a)]==null)throw CliErrors[_0x1e2a43(0x8b)](_0x41f265[_0x1e2a43(0xa4)]+':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.');let _0x475b6a=extractScriptDescription(_0x49fe69);if(!_0x475b6a&&_0x4f96a8?.[_0x1e2a43(0xa7)]){const _0xf40c1d=await getBffScriptInfo(_0x4f96a8[_0x1e2a43(0xa7)]);_0x475b6a=_0xf40c1d['description']||undefined;}const _0x4def52={'appCode':_0x5ddff2,'functionName':_0x41f265['name'],'scriptType':_0x41f265['type'],'scriptContent':_0x49fe69};if(_0x4f96a8?.[_0x1e2a43(0xa7)])_0x4def52['id']=_0x4f96a8[_0x1e2a43(0xa7)];if(_0x4f96a8?.[_0x1e2a43(0x9a)]!=null)_0x4def52[_0x1e2a43(0x9a)]=_0x4f96a8[_0x1e2a43(0x9a)];if(_0x475b6a)_0x4def52[_0x1e2a43(0x7b)]=_0x475b6a;if(_0x41f265[_0x1e2a43(0x91)]===_0x1e2a43(0x86)){const _0x9c56f8=_0x41f265[_0x1e2a43(0x88)];if(!_0x9c56f8||!_0x41f265['operationType']||!_0x41f265['functionNode'])throw CliErrors[_0x1e2a43(0x8b)]('Incomplete\x20HOOK\x20path:\x20'+_0x41f265[_0x1e2a43(0xa4)]);const _0x1d3eb3=_0x129f08[_0x1e2a43(0x8d)][_0x1e2a43(0x66)](_0x9c56f8)??_0x4f96a8?.[_0x1e2a43(0x71)]??_0x9c56f8,_0x3f0805=_0x129f08['datasetCodeToDataset'][_0x1e2a43(0x66)](_0x1d3eb3);if(!_0x3f0805)throw CliErrors[_0x1e2a43(0x8b)](_0x1e2a43(0x93)+_0x9c56f8+_0x1e2a43(0x74)+('Run\x20`'+CLI_BIN_NAME+_0x1e2a43(0xa2)));_0x4def52[_0x1e2a43(0x8c)]=_0x3f0805['id'],_0x4def52['operationType']=_0x41f265[_0x1e2a43(0x83)],_0x4def52[_0x1e2a43(0xa0)]=_0x41f265['functionNode'];}const _0x17f0f1=await saveBffScript(_0x4def52),_0x472b5e=_0x17f0f1['id'],_0x313ece=_0x17f0f1[_0x1e2a43(0x7a)]??await getBffScriptInfo(_0x472b5e),_0x1e36aa={'hash':_0x34173f,'remoteId':_0x472b5e,'version':_0x313ece[_0x1e2a43(0x9a)]};if(_0x41f265['type']===_0x1e2a43(0x86)){const _0x2141a2=_0x41f265[_0x1e2a43(0x88)],_0x1d1cf7=_0x129f08['aliasToDatasetCode'][_0x1e2a43(0x66)](_0x2141a2)??_0x4f96a8?.[_0x1e2a43(0x71)]??_0x2141a2;_0x129f08['aliasToDatasetCode'][_0x1e2a43(0x85)](_0x2141a2)?_0x1e36aa[_0x1e2a43(0x88)]=_0x2141a2:_0x1e36aa[_0x1e2a43(0x88)]=_0x4f96a8?.[_0x1e2a43(0x88)],_0x1e36aa[_0x1e2a43(0x71)]=_0x1d1cf7,_0x1e36aa[_0x1e2a43(0x83)]=_0x41f265[_0x1e2a43(0x83)],_0x1e36aa[_0x1e2a43(0xa0)]=_0x41f265[_0x1e2a43(0xa0)];}_0x530074[_0x1e2a43(0x6a)][_0x41f265[_0x1e2a43(0xa4)]]=_0x1e36aa;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x3b4031,_0x297fa3,_0x1a2827){const _0x539438=a37_0x440f53;if(_0x1a2827[_0x539438(0xa5)]===0x0)return;for(let _0xf0b348=0x0;_0xf0b348<LOCK_SETTLE_RETRY_COUNT;_0xf0b348+=0x1){const _0x3a29fc=await readBffLockFile(_0x3b4031),_0x482658=_0x3a29fc?.['apps']?.[_0x297fa3]?.[_0x539438(0x6a)]??{},_0x312d7f=_0x1a2827[_0x539438(0x9d)](_0xc19f56=>!!_0x482658[_0xc19f56]?.['remoteId']);if(_0x312d7f)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x539438(0x9e)+_0x1a2827['join'](',\x20')+'.');}
|
|
1
|
+
const a37_0x49114d=a37_0x1db6;(function(_0x2f6a5f,_0x41cc20){const _0x3cf39d=a37_0x1db6,_0x401395=_0x2f6a5f();while(!![]){try{const _0x4e991c=-parseInt(_0x3cf39d(0x22a))/0x1*(parseInt(_0x3cf39d(0x227))/0x2)+parseInt(_0x3cf39d(0x1d7))/0x3*(-parseInt(_0x3cf39d(0x1f6))/0x4)+-parseInt(_0x3cf39d(0x1ed))/0x5+parseInt(_0x3cf39d(0x1fe))/0x6*(-parseInt(_0x3cf39d(0x1e5))/0x7)+parseInt(_0x3cf39d(0x1d2))/0x8*(parseInt(_0x3cf39d(0x1e9))/0x9)+-parseInt(_0x3cf39d(0x200))/0xa+parseInt(_0x3cf39d(0x224))/0xb*(parseInt(_0x3cf39d(0x215))/0xc);if(_0x4e991c===_0x41cc20)break;else _0x401395['push'](_0x401395['shift']());}catch(_0x490055){_0x401395['push'](_0x401395['shift']());}}}(a37_0x38c1,0xe0e82));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';function a37_0x1db6(_0x298835,_0x38db3a){_0x298835=_0x298835-0x1d1;const _0x38c125=a37_0x38c1();let _0x1db632=_0x38c125[_0x298835];return _0x1db632;}import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{automaticDeploymentSyncSucceeded,buildAutomaticDeploymentSyncPreview,runAutomaticDeploymentSync,validateAutomaticDeploymentSync}from'../../commands/deployment/auto-sync.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':'bff','command':a37_0x49114d(0x221),'description':a37_0x49114d(0x1fd),'risk':a37_0x49114d(0x1dc),'flags':[{'name':a37_0x49114d(0x225),'type':a37_0x49114d(0x1ff),'description':a37_0x49114d(0x20f),'enum':[a37_0x49114d(0x20c),a37_0x49114d(0x21b),a37_0x49114d(0x1e2)]},{'name':a37_0x49114d(0x1ee),'type':a37_0x49114d(0x1ff),'description':a37_0x49114d(0x202)},{'name':a37_0x49114d(0x1fb),'type':a37_0x49114d(0x1dd),'description':a37_0x49114d(0x211)}],async 'validate'(_0x5392d5){validateAutomaticDeploymentSync(_0x5392d5);},async 'dryRun'(_0xe3d9a4){const _0x253296=a37_0x49114d,_0x541158=loadBffProjectConfig(_0xe3d9a4['appCode']),_0x410cd4=await readBffLockFile(_0x541158['lockFilePath']),{appLock:_0x590dfe}=ensureLockScope(_0x410cd4??createEmptyBffLock(),_0xe3d9a4[_0x253296(0x222)],_0x541158[_0x253296(0x223)],_0x253296(0x221)),_0x5ea39c=await getTargetFunctions(_0x541158,_0xe3d9a4),_0x26058a=_0xe3d9a4[_0x253296(0x1d5)](_0x253296(0x1fb)),_0xa0f379=[],_0x624887=[];for(const _0x4cea82 of _0x5ea39c){const _0x339676=await computeFileHash(_0x4cea82[_0x253296(0x1e1)]),_0x16ea86=_0x590dfe[_0x253296(0x210)][_0x4cea82[_0x253296(0x1df)]],_0x194689=!!_0x16ea86&&_0x16ea86['hash']===_0x339676,_0x243201=!_0x26058a&&_0x194689?'unchanged':_0x253296(0x1d4);_0xa0f379[_0x253296(0x221)]({'lockKey':_0x4cea82[_0x253296(0x1df)],'filePath':_0x4cea82[_0x253296(0x1e1)],'remoteId':_0x16ea86?.[_0x253296(0x1f4)]??null,'mode':_0x16ea86?.[_0x253296(0x1f4)]?'update':_0x253296(0x206),'status':_0x243201});if(_0x243201===_0x253296(0x1d4))_0x624887[_0x253296(0x221)](_0x4cea82[_0x253296(0x1ee)]);}return{'method':_0x253296(0x214),'url':'/api/management/library/scripts/save','deploymentSync':buildAutomaticDeploymentSyncPreview(_0xe3d9a4,'bff',_0x624887),'body':{'appCode':_0xe3d9a4[_0x253296(0x222)],'force':_0x26058a,'files':_0xa0f379,'cacheClearAtRuntime':_0xa0f379[_0x253296(0x1d8)](_0x57d925=>_0x57d925[_0x253296(0x1fa)]===_0x253296(0x1d4)),'cacheClearAtRuntimeTimes':_0xa0f379[_0x253296(0x1d8)](_0x1e53b1=>_0x1e53b1[_0x253296(0x1fa)]==='would_push')?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x253296(0x1e0)+_0xa0f379[_0x253296(0x220)]+_0x253296(0x207)};},async 'execute'(_0x3b4c84){const _0x528a15=a37_0x49114d,_0xe87ebd=loadBffProjectConfig(_0x3b4c84[_0x528a15(0x222)]),_0x4f28dc=await readBffLockFile(_0xe87ebd[_0x528a15(0x20e)]),{lockData:_0x16c24f,appLock:_0x3d4d6b}=ensureLockScope(_0x4f28dc??createEmptyBffLock(),_0x3b4c84[_0x528a15(0x222)],_0xe87ebd['scriptsRoot'],_0x528a15(0x221)),_0x301490=await getTargetFunctions(_0xe87ebd,_0x3b4c84);if(_0x301490[_0x528a15(0x220)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x528a15(0x1ef)};const _0x48dbe6=_0x3b4c84[_0x528a15(0x1d5)](_0x528a15(0x1fb)),_0x55b8cc=JSON[_0x528a15(0x204)](JSON[_0x528a15(0x1ec)](_0x16c24f)),_0x4ef388=_0x55b8cc[_0x528a15(0x20d)][_0x3b4c84[_0x528a15(0x222)]];if(!_0x4ef388)throw new Error(_0x528a15(0x21a)+_0x3b4c84[_0x528a15(0x222)]+_0x528a15(0x1db));const _0x36640d=await buildHookMaps(_0x3b4c84[_0x528a15(0x222)],_0x3b4c84['apiDir'],_0x301490,_0x4ef388),_0x1c68f1=[],_0x30ead7=[],_0x59f0ff=[],_0x10502f=[];for(const _0x58cc32 of _0x301490){const _0x47281e=await computeFileHash(_0x58cc32[_0x528a15(0x1e1)]),_0x311a62=_0x4ef388[_0x528a15(0x210)][_0x58cc32['lockKey']];if(!_0x48dbe6&&_0x311a62&&_0x311a62['hash']===_0x47281e){_0x59f0ff['push']({'lockKey':_0x58cc32[_0x528a15(0x1df)],'reason':_0x528a15(0x1f1)});continue;}try{await uploadSingleFunction(_0x3b4c84[_0x528a15(0x222)],_0x58cc32,_0x4ef388,_0x36640d);const _0x12ea45=_0x4ef388['functions'][_0x58cc32[_0x528a15(0x1df)]];_0x1c68f1[_0x528a15(0x221)]({'lockKey':_0x58cc32[_0x528a15(0x1df)],'remoteId':_0x12ea45?.[_0x528a15(0x1f4)]??0x0}),_0x30ead7[_0x528a15(0x221)](_0x58cc32[_0x528a15(0x1ee)]);}catch(_0x4423dc){_0x10502f['push']({'lockKey':_0x58cc32[_0x528a15(0x1df)],'error':_0x4423dc instanceof Error?_0x4423dc['message']:String(_0x4423dc)});}}_0x4ef388[_0x528a15(0x218)]=new Date()[_0x528a15(0x1f8)](),await writeBffLockFile(_0xe87ebd[_0x528a15(0x20e)],_0x55b8cc),await waitForUploadedLockEntries(_0xe87ebd[_0x528a15(0x20e)],_0x3b4c84[_0x528a15(0x222)],_0x1c68f1[_0x528a15(0x1eb)](_0x21b360=>_0x21b360[_0x528a15(0x1df)]));let _0xe57007={'attempted':![],'cleared':![]};if(_0x1c68f1['length']>0x0)try{let _0x5f017d='';for(let _0x2879ed=0x0;_0x2879ed<CACHE_CLEAR_ATTEMPTS;_0x2879ed+=0x1){_0x5f017d=await clearBffScriptCache(),_0x2879ed<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0xe57007={'attempted':!![],'cleared':!![],'message':_0x5f017d||_0x528a15(0x201)};}catch(_0xfe8df4){_0xe57007={'attempted':!![],'cleared':![],'error':_0xfe8df4 instanceof Error?_0xfe8df4[_0x528a15(0x20b)]:String(_0xfe8df4)};}const _0x30a36f=_0x10502f['length']===0x0&&(_0xe57007['attempted']?_0xe57007[_0x528a15(0x217)]:!![]),_0x3f4e8f=await runAutomaticDeploymentSync(_0x3b4c84,_0x528a15(0x1fc),_0x30ead7,_0x30a36f),_0xf2fac0=_0x30a36f&&automaticDeploymentSyncSucceeded(_0x3f4e8f),_0x2d255d=_0xe57007[_0x528a15(0x212)]?_0xe57007[_0x528a15(0x217)]?_0x528a15(0x208):_0x528a15(0x1f0):'runtime\x20cache\x20not\x20needed',_0x3b8eca=_0x3f4e8f[_0x528a15(0x1d3)]?_0x528a15(0x20a)+_0x3f4e8f[_0x528a15(0x1fa)]:'';return{'ok':_0xf2fac0,'data':{'uploaded':_0x1c68f1,'skipped':_0x59f0ff,'failed':_0x10502f,'cacheClear':_0xe57007,'deploymentSync':_0x3f4e8f},'message':'Push\x20complete:\x20'+_0x1c68f1[_0x528a15(0x220)]+'\x20uploaded,\x20'+_0x59f0ff['length']+_0x528a15(0x1de)+_0x10502f[_0x528a15(0x220)]+_0x528a15(0x1d6)+_0x2d255d+_0x3b8eca};}};function a37_0x38c1(){const _0x474f61=['\x22.\x20','cleared','lastSync','has','Lock\x20scope\x20for\x20app\x20\x22','ENDPOINT','datasetCodeToDataset','get','str','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','length','push','appCode','scriptsRoot','8640478nvUgFS','type','join','212QtTOhr','operationType','utf8','6771tcHYRT','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','version','7955128DFjlfn','configured','would_push','bool','\x20failed,\x20','9CeUIkV','some','Incomplete\x20HOOK\x20path:\x20','datasetId','\x22\x20not\x20found\x20after\x20ensureLockScope.','write','boolean','\x20skipped,\x20','lockKey','Would\x20inspect\x20','filePath','HOOK','aliasToDatasetCode','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','163121WRIEDZ','functionNode','datasetCode','Run\x20`','9AFgbHH','Local\x20function\x20not\x20found:\x20','map','stringify','5392715LuyyTm','name','No\x20local\x20Backend\x20Function\x20scripts\x20found.','runtime\x20cache\x20clear\x20failed','unchanged','code',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','remoteId','filter','211876HIhlWV','validation','toISOString','description','status','force','bff','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','444PteuSj','string','3210650rgTdlR','Runtime\x20script\x20cache\x20cleared.','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','every','parse','alias','create','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','runtime\x20cache\x20cleared','Cannot\x20resolve\x20dataset\x20for\x20\x22',',\x20deployment\x20sync\x20','message','COMMON','apps','lockFilePath','Push\x20only\x20this\x20script\x20type','functions','Force\x20push\x20ignoring\x20hash\x20protection','attempted','script','POST','60bhXqyn'];a37_0x38c1=function(){return _0x474f61;};return a37_0x38c1();}async function getTargetFunctions(_0x11b74b,_0x14e768){const _0x2eeaca=a37_0x49114d,_0x3d33dd=_0x14e768['str'](_0x2eeaca(0x225)),_0x5e7b75=_0x14e768[_0x2eeaca(0x21e)](_0x2eeaca(0x1ee)),_0x50f1a8=normalizeBffType(_0x3d33dd)??undefined;if(_0x5e7b75&&!_0x50f1a8)throw CliErrors[_0x2eeaca(0x1f7)](_0x2eeaca(0x21f));const _0x36b55f=await scanLocalBffFunctions(_0x11b74b,_0x50f1a8);if(_0x5e7b75){const _0x23f055=_0x36b55f[_0x2eeaca(0x1f5)](_0x1544fb=>_0x1544fb[_0x2eeaca(0x1ee)]===_0x5e7b75);if(_0x23f055[_0x2eeaca(0x220)]===0x0)throw CliErrors[_0x2eeaca(0x1f7)](_0x2eeaca(0x1ea)+_0x50f1a8+'/'+_0x5e7b75);return _0x23f055;}return _0x36b55f;}async function buildHookMaps(_0x4b6155,_0x28387f,_0x53722a,_0x5ba25e){const _0x48d191=a37_0x49114d,_0x35c28e=_0x53722a[_0x48d191(0x1d8)](_0x3b90a8=>_0x3b90a8[_0x48d191(0x225)]===_0x48d191(0x1e2));if(!_0x35c28e)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x4e4277=loadAliasMap(_0x28387f,undefined,resolveApiFilePath(_0x28387f,_0x4b6155)),_0x2196b2=new Map(_0x4e4277[_0x48d191(0x1eb)](_0x316b3d=>[_0x316b3d[_0x48d191(0x205)],_0x316b3d[_0x48d191(0x1e7)]]));for(const _0x4d6de5 of Object['values'](_0x5ba25e[_0x48d191(0x210)])){_0x4d6de5[_0x48d191(0x205)]&&_0x4d6de5[_0x48d191(0x1e7)]&&!_0x2196b2[_0x48d191(0x219)](_0x4d6de5['alias'])&&_0x2196b2['set'](_0x4d6de5['alias'],_0x4d6de5['datasetCode']);}const _0x281097=await listDatasets(_0x4b6155),_0x287e84=new Map(_0x281097[_0x48d191(0x1eb)](_0x55a120=>[_0x55a120[_0x48d191(0x1f2)],_0x55a120]));return{'aliasToDatasetCode':_0x2196b2,'datasetCodeToDataset':_0x287e84};}async function uploadSingleFunction(_0x52065b,_0x314750,_0x3a695e,_0x15910c){const _0x1564cc=a37_0x49114d,_0x343628=await readFile(_0x314750['filePath'],_0x1564cc(0x229)),_0x355ce1=await computeFileHash(_0x314750[_0x1564cc(0x1e1)]),_0x496b2f=_0x3a695e[_0x1564cc(0x210)][_0x314750[_0x1564cc(0x1df)]];if(_0x496b2f?.[_0x1564cc(0x1f4)]&&_0x496b2f[_0x1564cc(0x1d1)]==null)throw CliErrors[_0x1564cc(0x1f7)](_0x314750[_0x1564cc(0x1df)]+_0x1564cc(0x1f3));let _0xff1e9b=extractScriptDescription(_0x343628);if(!_0xff1e9b&&_0x496b2f?.[_0x1564cc(0x1f4)]){const _0x57d757=await getBffScriptInfo(_0x496b2f[_0x1564cc(0x1f4)]);_0xff1e9b=_0x57d757[_0x1564cc(0x1f9)]||undefined;}const _0x433611={'appCode':_0x52065b,'functionName':_0x314750[_0x1564cc(0x1ee)],'scriptType':_0x314750[_0x1564cc(0x225)],'scriptContent':_0x343628};if(_0x496b2f?.[_0x1564cc(0x1f4)])_0x433611['id']=_0x496b2f[_0x1564cc(0x1f4)];if(_0x496b2f?.[_0x1564cc(0x1d1)]!=null)_0x433611['version']=_0x496b2f[_0x1564cc(0x1d1)];if(_0xff1e9b)_0x433611[_0x1564cc(0x1f9)]=_0xff1e9b;if(_0x314750[_0x1564cc(0x225)]===_0x1564cc(0x1e2)){const _0x5ea9b7=_0x314750[_0x1564cc(0x205)];if(!_0x5ea9b7||!_0x314750[_0x1564cc(0x228)]||!_0x314750[_0x1564cc(0x1e6)])throw CliErrors[_0x1564cc(0x1f7)](_0x1564cc(0x1d9)+_0x314750[_0x1564cc(0x1df)]);const _0xe16df2=_0x15910c[_0x1564cc(0x1e3)][_0x1564cc(0x21d)](_0x5ea9b7)??_0x496b2f?.['datasetCode']??_0x5ea9b7,_0x4220a0=_0x15910c[_0x1564cc(0x21c)][_0x1564cc(0x21d)](_0xe16df2);if(!_0x4220a0)throw CliErrors[_0x1564cc(0x1f7)](_0x1564cc(0x209)+_0x5ea9b7+_0x1564cc(0x216)+(_0x1564cc(0x1e8)+CLI_BIN_NAME+_0x1564cc(0x22b)));_0x433611[_0x1564cc(0x1da)]=_0x4220a0['id'],_0x433611[_0x1564cc(0x228)]=_0x314750[_0x1564cc(0x228)],_0x433611[_0x1564cc(0x1e6)]=_0x314750[_0x1564cc(0x1e6)];}const _0x1b06ed=await saveBffScript(_0x433611),_0x33783e=_0x1b06ed['id'],_0x5248f8=_0x1b06ed[_0x1564cc(0x213)]??await getBffScriptInfo(_0x33783e),_0x1acb3f={'hash':_0x355ce1,'remoteId':_0x33783e,'version':_0x5248f8['version']};if(_0x314750['type']==='HOOK'){const _0xb06e2b=_0x314750['alias'],_0x35594c=_0x15910c[_0x1564cc(0x1e3)][_0x1564cc(0x21d)](_0xb06e2b)??_0x496b2f?.[_0x1564cc(0x1e7)]??_0xb06e2b;_0x15910c['aliasToDatasetCode'][_0x1564cc(0x219)](_0xb06e2b)?_0x1acb3f['alias']=_0xb06e2b:_0x1acb3f[_0x1564cc(0x205)]=_0x496b2f?.[_0x1564cc(0x205)],_0x1acb3f[_0x1564cc(0x1e7)]=_0x35594c,_0x1acb3f['operationType']=_0x314750[_0x1564cc(0x228)],_0x1acb3f[_0x1564cc(0x1e6)]=_0x314750[_0x1564cc(0x1e6)];}_0x3a695e[_0x1564cc(0x210)][_0x314750[_0x1564cc(0x1df)]]=_0x1acb3f;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x12f4ee,_0x573f39,_0x232fb2){const _0x255cad=a37_0x49114d;if(_0x232fb2[_0x255cad(0x220)]===0x0)return;for(let _0x2098eb=0x0;_0x2098eb<LOCK_SETTLE_RETRY_COUNT;_0x2098eb+=0x1){const _0xa37f8=await readBffLockFile(_0x12f4ee),_0x50faef=_0xa37f8?.[_0x255cad(0x20d)]?.[_0x573f39]?.[_0x255cad(0x210)]??{},_0x31dfa9=_0x232fb2[_0x255cad(0x203)](_0x4246a3=>!!_0x50faef[_0x4246a3]?.[_0x255cad(0x1f4)]);if(_0x31dfa9)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x255cad(0x1e4)+_0x232fb2[_0x255cad(0x226)](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x14b29f=a38_0x1e8c;(function(_0x5828ae,_0x550035){const _0x54e41b=a38_0x1e8c,_0x1e2612=_0x5828ae();while(!![]){try{const _0x419d0e=-parseInt(_0x54e41b(0x18c))/0x1*(-parseInt(_0x54e41b(0x199))/0x2)+-parseInt(_0x54e41b(0x18d))/0x3+parseInt(_0x54e41b(0x194))/0x4*(-parseInt(_0x54e41b(0x182))/0x5)+parseInt(_0x54e41b(0x184))/0x6+parseInt(_0x54e41b(0x186))/0x7*(-parseInt(_0x54e41b(0x18f))/0x8)+parseInt(_0x54e41b(0x18b))/0x9+parseInt(_0x54e41b(0x196))/0xa;if(_0x419d0e===_0x550035)break;else _0x1e2612['push'](_0x1e2612['shift']());}catch(_0x3440c9){_0x1e2612['push'](_0x1e2612['shift']());}}}(a38_0x5677,0x18916));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a38_0x14b29f(0x188),'command':a38_0x14b29f(0x189),'description':'Check\x20local\x20Backend\x20Function\x20sync\x20status\x20against\x20lock\x20file','risk':a38_0x14b29f(0x183),'flags':[{'name':a38_0x14b29f(0x19d),'type':a38_0x14b29f(0x19e),'description':a38_0x14b29f(0x1a0)}],async 'execute'(_0x1f295f){const _0x21b97e=a38_0x14b29f,_0x4bff55=loadBffProjectConfig(_0x1f295f[_0x21b97e(0x192)]),_0x22d872=await readBffLockFile(_0x4bff55['lockFilePath']),{appLock:_0x210378}=ensureLockScope(_0x22d872??createEmptyBffLock(),_0x1f295f[_0x21b97e(0x192)],_0x4bff55[_0x21b97e(0x195)],_0x21b97e(0x189)),_0x411dd6=await scanLocalBffFunctions(_0x4bff55),_0x2b64e1=[],_0x2ceb7a=[],_0x1d038b=[];for(const _0x3b8d54 of _0x411dd6){const _0x2aae4a=await computeFileHash(_0x3b8d54[_0x21b97e(0x181)]),_0x2039ac=_0x210378['functions'][_0x3b8d54[_0x21b97e(0x193)]];if(!_0x2039ac)_0x2b64e1[_0x21b97e(0x18a)](_0x3b8d54[_0x21b97e(0x193)]);else _0x2039ac['hash']!==_0x2aae4a?_0x2ceb7a['push'](_0x3b8d54[_0x21b97e(0x193)]):_0x1d038b[_0x21b97e(0x18a)](_0x3b8d54['lockKey']);}const _0x79462=[];if(_0x1f295f[_0x21b97e(0x19c)](_0x21b97e(0x19d))){const _0x45615c=loadAliasMap(_0x1f295f[_0x21b97e(0x185)],undefined,resolveApiFilePath(_0x1f295f['apiDir'],_0x1f295f[_0x21b97e(0x192)])),_0x17f8d1=new Map(_0x45615c[_0x21b97e(0x19f)](_0xc51025=>[_0xc51025[_0x21b97e(0x187)],_0xc51025[_0x21b97e(0x191)]])),[_0x2c1471,_0x39c527]=await Promise[_0x21b97e(0x198)]([listBffScripts(_0x1f295f[_0x21b97e(0x192)]),getBffScriptStatistics(_0x1f295f[_0x21b97e(0x192)])]),_0x42af4a=createHookLocationMap(_0x39c527),_0x7c37ed=new Set(_0x411dd6[_0x21b97e(0x19f)](_0x3d5d84=>_0x3d5d84[_0x21b97e(0x193)]));for(const _0x11ee28 of _0x2c1471){const _0x432170=resolveRemoteScriptTarget(_0x4bff55,_0x11ee28,_0x42af4a,_0x210378[_0x21b97e(0x180)],_0x17f8d1);_0x432170&&!_0x7c37ed[_0x21b97e(0x197)](_0x432170[_0x21b97e(0x193)])&&_0x79462[_0x21b97e(0x18a)](_0x432170[_0x21b97e(0x193)]);}}const _0x581c4f=_0x2b64e1[_0x21b97e(0x18e)]===0x0&&_0x2ceb7a[_0x21b97e(0x18e)]===0x0&&_0x79462['length']===0x0;return{'ok':!![],'data':{'added':_0x2b64e1,'modified':_0x2ceb7a,'unchanged':_0x1d038b,'remoteOnly':_0x79462},'message':_0x581c4f?_0x21b97e(0x19a):_0x2b64e1[_0x21b97e(0x18e)]+_0x21b97e(0x190)+_0x2ceb7a['length']+'\x20modified,\x20'+_0x1d038b[_0x21b97e(0x18e)]+_0x21b97e(0x19b)+(_0x79462[_0x21b97e(0x18e)]>0x0?',\x20'+_0x79462['length']+'\x20remote-only':'')};}};function a38_0x1e8c(_0x32cc93,_0x4add62){_0x32cc93=_0x32cc93-0x180;const _0x5677de=a38_0x5677();let _0x1e8c5c=_0x5677de[_0x32cc93];return _0x1e8c5c;}function a38_0x5677(){const _0x4ac38c=['50115cOVxpo','read','1101258nIqNQR','apiDir','384321RYVkih','datasetCode','bff','status','push','1530531WHMpWS','79zQCmEd','555126QmvrRl','length','24hapHkG','\x20added,\x20','alias','appCode','lockKey','76OTVLeb','scriptsRoot','2337330jIZYAR','has','all','1354kSCZwP','All\x20Backend\x20Function\x20scripts\x20are\x20in\x20sync.','\x20unchanged','bool','remote','boolean','map','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','functions','filePath'];a38_0x5677=function(){return _0x4ac38c;};return a38_0x5677();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a39_0x4b9e0f=a39_0x25bb;(function(_0x384b04,_0x1234c9){const _0x9c3ece=a39_0x25bb,_0xd76d67=_0x384b04();while(!![]){try{const _0x1c4275=-parseInt(_0x9c3ece(0x139))/0x1+parseInt(_0x9c3ece(0x13c))/0x2+-parseInt(_0x9c3ece(0x129))/0x3+parseInt(_0x9c3ece(0x126))/0x4*(-parseInt(_0x9c3ece(0x125))/0x5)+-parseInt(_0x9c3ece(0x13a))/0x6*(-parseInt(_0x9c3ece(0x131))/0x7)+-parseInt(_0x9c3ece(0x130))/0x8*(parseInt(_0x9c3ece(0x140))/0x9)+parseInt(_0x9c3ece(0x137))/0xa;if(_0x1c4275===_0x1234c9)break;else _0xd76d67['push'](_0xd76d67['shift']());}catch(_0x44e004){_0xd76d67['push'](_0xd76d67['shift']());}}}(a39_0x351d,0x61d53));function a39_0x25bb(_0x205a21,_0x247ed3){_0x205a21=_0x205a21-0x122;const _0x351d41=a39_0x351d();let _0x25bb6a=_0x351d41[_0x205a21];return _0x25bb6a;}import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';function a39_0x351d(){const _0x32ed08=['\x20at\x20','1357854UXPGah','error','cli-skill',']:\x20','9KKPOBY','code','cli-skill-install','apiError','installedPath','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','pipe','56125HwZurb','284kYTGYL','\x20is\x20already\x20current','read','1050045EbQyjN','nonInteractive','repairCommand','setLogPath','inherit','Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20','Built-in\x20Skill\x20install\x20failed\x20[','2379504MplOev','4558757XvVVuG','\x20via\x20skills@latest','info','install','CLI\x20Built-in\x20Skill\x20','unknown','9549360KQphWy','changed','439963ZcXNkD','6Bxyqif'];a39_0x351d=function(){return _0x32ed08;};return a39_0x351d();}import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a39_0x4b9e0f(0x13e),'command':a39_0x4b9e0f(0x134),'description':a39_0x4b9e0f(0x123),'risk':a39_0x4b9e0f(0x128),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x2236ba){const _0x4e60bf=a39_0x4b9e0f;logger[_0x4e60bf(0x12c)](process['cwd']()),logger[_0x4e60bf(0x133)](_0x4e60bf(0x142),'Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.');const _0x4e3eb3=installBuiltinSkill({'stdio':_0x2236ba[_0x4e60bf(0x12a)]?_0x4e60bf(0x124):_0x4e60bf(0x12d)});if(!_0x4e3eb3['ok'])throw CliErrors[_0x4e60bf(0x143)](_0x4e60bf(0x12f)+_0x4e3eb3[_0x4e60bf(0x141)]+_0x4e60bf(0x13f)+(_0x4e3eb3[_0x4e60bf(0x13d)]||_0x4e60bf(0x136)),_0x4e60bf(0x12e)+_0x4e3eb3[_0x4e60bf(0x12b)]);return console['log'](_0x4e3eb3[_0x4e60bf(0x138)]?_0x4e60bf(0x135)+_0x4e3eb3['skillVersion']+'\x20installed'+(_0x4e3eb3[_0x4e60bf(0x122)]?_0x4e60bf(0x13b)+_0x4e3eb3[_0x4e60bf(0x122)]:_0x4e60bf(0x132)):_0x4e60bf(0x135)+_0x4e3eb3['skillVersion']+_0x4e60bf(0x127)+(_0x4e3eb3[_0x4e60bf(0x122)]?_0x4e60bf(0x13b)+_0x4e3eb3[_0x4e60bf(0x122)]:'')),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a40_0x2ad0ee=a40_0x1ad1;(function(_0x2384a4,_0x8dbf15){const _0x78c6e7=a40_0x1ad1,_0x133b7b=_0x2384a4();while(!![]){try{const _0x28082d=parseInt(_0x78c6e7(0xc5))/0x1*(parseInt(_0x78c6e7(0xa1))/0x2)+parseInt(_0x78c6e7(0xba))/0x3*(-parseInt(_0x78c6e7(0xcb))/0x4)+parseInt(_0x78c6e7(0x86))/0x5+parseInt(_0x78c6e7(0xce))/0x6*(parseInt(_0x78c6e7(0xc1))/0x7)+parseInt(_0x78c6e7(0xaa))/0x8+parseInt(_0x78c6e7(0x9a))/0x9*(parseInt(_0x78c6e7(0xc6))/0xa)+-parseInt(_0x78c6e7(0x99))/0xb;if(_0x28082d===_0x8dbf15)break;else _0x133b7b['push'](_0x133b7b['shift']());}catch(_0x5cc648){_0x133b7b['push'](_0x133b7b['shift']());}}}(a40_0x1523,0x8e31b));import a40_0x4b656b from'chalk';import a40_0x5523ec from'ora';import a40_0x24ba5e from'semver';import{execa}from'execa';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{inspectInstalledBuiltinSkillVersion,installBuiltinSkill}from'../skills/builtin-skill.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x26034c=a40_0x1ad1;return GIT_COMMIT!=='unknown'?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x26034c(0xa5)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x475d14=a40_0x1ad1,_0x188a69=process['execPath']['toLowerCase']();if(_0x188a69['includes'](_0x475d14(0xb9)))return _0x475d14(0xb9);return _0x475d14(0x8d);}const updateFlags=[{'name':'beta','type':a40_0x2ad0ee(0xbc),'description':a40_0x2ad0ee(0x81),'default':![]},{'name':a40_0x2ad0ee(0x9e),'type':a40_0x2ad0ee(0x9c),'description':'Install\x20a\x20specific\x20CLI\x20version'}];function getRequestedVersion(_0x4438e0){const _0x3ff3e1=a40_0x2ad0ee;return _0x4438e0[_0x3ff3e1(0xcd)](_0x3ff3e1(0x9e))[_0x3ff3e1(0x8f)]();}async function validateUpdateFlags(_0x4b72b1){const _0x2fbc72=a40_0x2ad0ee,_0x140130=_0x4b72b1[_0x2fbc72(0xb5)](_0x2fbc72(0x85)),_0x5626df=getRequestedVersion(_0x4b72b1);if(_0x140130&&_0x5626df)throw CliErrors['validation']('--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.',_0x2fbc72(0xb6));if(_0x5626df&&!a40_0x24ba5e[_0x2fbc72(0xcf)](_0x5626df))throw CliErrors[_0x2fbc72(0xc2)](_0x2fbc72(0xa0)+_0x5626df,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}async function fetchNpmDistTags(){const _0x11dd30=a40_0x2ad0ee;try{const _0x102c3f=await fetch(_0x11dd30(0x84)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x11dd30(0x8e),{'signal':AbortSignal['timeout'](0x2710)});if(!_0x102c3f['ok'])return null;const _0x2ad390=await _0x102c3f['json']();if(!_0x2ad390||typeof _0x2ad390!==_0x11dd30(0xac))return null;return Object[_0x11dd30(0xb0)](Object[_0x11dd30(0x87)](_0x2ad390)[_0x11dd30(0xc9)](([,_0x20a2e4])=>typeof _0x20a2e4===_0x11dd30(0x9c)&&_0x20a2e4[_0x11dd30(0x8f)]()['length']>0x0)['map'](([_0x40ceb2,_0xc4a8f])=>[_0x40ceb2,String(_0xc4a8f)['trim']()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x46e5ef){const _0x195f40=await fetchNpmDistTags();return _0x195f40?.[_0x46e5ef]??null;}async function fetchLatestVersion(){const _0x29b2ad=a40_0x2ad0ee;return fetchNpmDistTagVersion(_0x29b2ad(0x92));}function a40_0x1ad1(_0x173adb,_0x5a990b){_0x173adb=_0x173adb-0x7f;const _0x15239b=a40_0x1523();let _0x1ad1e2=_0x15239b[_0x173adb];return _0x1ad1e2;}async function resolveTargetVersion(_0x2676fc){const _0x14ee9f=a40_0x2ad0ee,_0x5bfea9=getRequestedVersion(_0x2676fc);if(_0x5bfea9)return{'version':_0x5bfea9,'source':_0x14ee9f(0x9e)};if(_0x2676fc[_0x14ee9f(0xb5)](_0x14ee9f(0x85))){const _0x2396c1=await fetchNpmDistTagVersion(_0x14ee9f(0x85));if(!_0x2396c1)return null;return{'version':_0x2396c1,'source':'beta'};}const _0x11164e=await fetchLatestVersion();if(!_0x11164e)return null;return{'version':_0x11164e,'source':'latest'};}function shouldInstallTarget(_0x24b062,_0x5103b7){const _0x20d243=a40_0x2ad0ee;if(_0x5103b7[_0x20d243(0xa3)]===_0x20d243(0x9e)||_0x5103b7[_0x20d243(0xa3)]===_0x20d243(0x85))return!a40_0x24ba5e['eq'](_0x24b062,_0x5103b7[_0x20d243(0x9e)]);return a40_0x24ba5e['lt'](_0x24b062,_0x5103b7[_0x20d243(0x9e)]);}function getInstallPlanLabel(_0x172482,_0x1fa1da){const _0x1c8b4f=a40_0x2ad0ee;switch(_0x1fa1da[_0x1c8b4f(0xa3)]){case _0x1c8b4f(0x85):return _0x1c8b4f(0xae)+a40_0x4b656b[_0x1c8b4f(0xb4)](_0x172482)+_0x1c8b4f(0x8a)+a40_0x4b656b[_0x1c8b4f(0x97)](_0x1fa1da['version']);case _0x1c8b4f(0x9e):return'Requested\x20version:\x20'+a40_0x4b656b[_0x1c8b4f(0xb4)](_0x172482)+_0x1c8b4f(0x8a)+a40_0x4b656b[_0x1c8b4f(0x97)](_0x1fa1da[_0x1c8b4f(0x9e)]);case _0x1c8b4f(0x92):default:return _0x1c8b4f(0x82)+a40_0x4b656b[_0x1c8b4f(0xb4)](_0x172482)+'\x20→\x20'+a40_0x4b656b[_0x1c8b4f(0x97)](_0x1fa1da[_0x1c8b4f(0x9e)]);}}function repairCurrentBuiltinSkill(){const _0x470188=a40_0x2ad0ee;console[_0x470188(0xb1)](a40_0x4b656b[_0x470188(0x9d)]('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x137081=installBuiltinSkill();if(_0x137081['ok'])return console[_0x470188(0xb1)](a40_0x4b656b[_0x470188(0x9d)](_0x470188(0xc7)+_0x137081[_0x470188(0xa2)]+_0x470188(0xb2))),!![];return console[_0x470188(0xc4)](a40_0x4b656b[_0x470188(0xb4)](_0x470188(0x94)+_0x137081[_0x470188(0x8b)]+_0x470188(0x95)+(_0x137081[_0x470188(0x90)]||_0x470188(0xa6)))),console[_0x470188(0xb1)](a40_0x4b656b['gray'](_0x470188(0xbe)+CLI_BIN_NAME+_0x470188(0xd1))),![];}function verifyUpdatedBuiltinSkill(_0x491936){const _0x3045cd=a40_0x2ad0ee,_0x37810c=inspectInstalledBuiltinSkillVersion(_0x491936);if(_0x37810c['state']===_0x3045cd(0xb8))return console[_0x3045cd(0xb1)](a40_0x4b656b[_0x3045cd(0x9d)](_0x3045cd(0xc7)+_0x491936+'\x20is\x20up\x20to\x20date.')),!![];const _0x26b06a=_0x37810c[_0x3045cd(0xa2)]?_0x3045cd(0xab)+_0x491936+_0x3045cd(0xa7)+_0x37810c['skillVersion']:_0x3045cd(0xab)+_0x491936+_0x3045cd(0x93)+_0x37810c['state'];return console[_0x3045cd(0xc4)](a40_0x4b656b[_0x3045cd(0xb4)](_0x3045cd(0x96)+_0x26b06a)),console[_0x3045cd(0xb1)](a40_0x4b656b[_0x3045cd(0x9d)](_0x3045cd(0xbe)+_0x37810c[_0x3045cd(0x83)])),![];}function a40_0x1523(){const _0x3424cc=['8329192vnWrjv','expected\x20','object','red','Beta\x20version:\x20','start','fromEntries','log','\x20is\x20up\x20to\x20date.','fail','yellow','bool','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','current','bun','15sXiMqn','pipe','boolean','\x20is\x20newer\x20than\x20npm\x20latest\x20v','\x20\x20Run\x20manually:\x20','Already\x20on\x20requested\x20version\x20(v','Current\x20version\x20v','1337kWldov','validation','\x20install\x20-g\x20','warn','4LjLFEm','36470UCSwxa','\x20\x20CLI\x20Built-in\x20Skill\x20','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','filter','@latest','284576NfrCbD','\x20\x20Try\x20manually:\x20','str','3372kiRmPN','valid','Updating\x20via\x20','\x20cli-skill\x20install','Current\x20version:\x20','Updated\x20to\x20v','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','Update\x20available:\x20','repairCommand','https://registry.npmjs.org/-/package/','beta','5593850dwAUPG','entries','read','succeed','\x20→\x20','code','Update\x20failed','npm','/dist-tags','trim','error','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','latest',',\x20state\x20','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[',']:\x20','\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20','green','Version\x20comparison\x20failed','35156572cPStCd','2034mSXayo','install','string','gray','version','Checking\x20for\x20updates...','Invalid\x20version:\x20','521358qpWTgh','skillVersion','source','run','slice','unknown',',\x20found\x20','message','info'];a40_0x1523=function(){return _0x3424cc;};return a40_0x1523();}async function execute(_0xd97cff){const _0x2f555=a40_0x2ad0ee;await validateUpdateFlags(_0xd97cff);const _0x3aa60=getCurrentVersion();console[_0x2f555(0xb1)](_0x2f555(0x7f)+_0x3aa60);const _0x24e259=a40_0x5523ec(_0x2f555(0x9f))['start'](),_0x117e2e=await resolveTargetVersion(_0xd97cff);if(!_0x117e2e){const _0x15a7fb=_0xd97cff[_0x2f555(0xb5)](_0x2f555(0x85))?_0x2f555(0xb7):_0x2f555(0x91);return _0x24e259[_0x2f555(0xb3)](_0x15a7fb),console[_0x2f555(0xb1)](a40_0x4b656b['gray'](_0x2f555(0xc8)+NPM_PACKAGE_NAME+_0x2f555(0xca))),{'ok':![],'message':_0x15a7fb};}const _0x5935e0=a40_0x24ba5e['valid'](VERSION),_0x929642=a40_0x24ba5e[_0x2f555(0xcf)](_0x117e2e[_0x2f555(0x9e)]);if(!_0x5935e0||!_0x929642)return _0x24e259['fail']('Version\x20comparison\x20failed'),{'ok':![],'message':_0x2f555(0x98)};if(!shouldInstallTarget(_0x5935e0,_0x117e2e)){const _0x25c268=_0x117e2e[_0x2f555(0xa3)]===_0x2f555(0x9e)?_0x2f555(0xbf)+_0x117e2e[_0x2f555(0x9e)]+')':a40_0x24ba5e['gt'](_0x5935e0,_0x929642)?_0x2f555(0xc0)+_0x3aa60+_0x2f555(0xbd)+_0x117e2e[_0x2f555(0x9e)]:'Already\x20up\x20to\x20date\x20(v'+_0x117e2e['version']+')';return _0x24e259[_0x2f555(0x89)](_0x25c268),{'ok':repairCurrentBuiltinSkill()};}_0x24e259[_0x2f555(0xa9)](getInstallPlanLabel(_0x3aa60,_0x117e2e));const _0x27ce7c=detectPackageManager(),_0x24aec8=_0x27ce7c===_0x2f555(0x8d)?resolveNpmBin(_0x2f555(0x8d)):_0x27ce7c,_0x314ee3=a40_0x5523ec(_0x2f555(0xd0)+_0x27ce7c+'...')[_0x2f555(0xaf)]();try{return await execa(_0x24aec8,[_0x2f555(0x9b),'-g',NPM_PACKAGE_NAME+'@'+_0x117e2e['version']],{'stdio':_0x2f555(0xbb)}),_0x314ee3['succeed'](_0x2f555(0x80)+_0x117e2e[_0x2f555(0x9e)]),console[_0x2f555(0xb1)](a40_0x4b656b[_0x2f555(0x9d)]('\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.')),{'ok':verifyUpdatedBuiltinSkill(_0x117e2e[_0x2f555(0x9e)])};}catch(_0x1176c7){return _0x314ee3['fail'](_0x2f555(0x8c)),console['error'](a40_0x4b656b[_0x2f555(0xad)]('\x20\x20'+_0x1176c7['message'])),console['log'](a40_0x4b656b[_0x2f555(0x9d)](_0x2f555(0xcc)+_0x27ce7c+_0x2f555(0xc3)+NPM_PACKAGE_NAME+'@'+_0x117e2e[_0x2f555(0x9e)])),{'ok':![],'message':_0x1176c7[_0x2f555(0xa8)]};}}export const updateDefinition={'service':'update','command':a40_0x2ad0ee(0xa4),'description':'Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','risk':a40_0x2ad0ee(0x88),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a40_0x17eafc=a40_0x2d47;function a40_0x2e43(){const _0x262e09=['pipe','Checking\x20for\x20updates...','warn','947033HSJtRZ','Beta\x20version:\x20','30MAVcFb','includes','\x20install\x20-g\x20','Already\x20on\x20requested\x20version\x20(v','fail','green','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','bun','990ztOjSy','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','\x20is\x20newer\x20than\x20npm\x20latest\x20v','https://registry.npmjs.org/-/package/','7aSHurl','str','\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20','map','validation','\x20cli-skill\x20install','\x20is\x20up\x20to\x20date.','info','Already\x20up\x20to\x20date\x20(v','/dist-tags','8075112dOclgw','Current\x20version:\x20','Version\x20comparison\x20failed','Invalid\x20version:\x20','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','unknown','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','repairCommand','Update\x20failed','gray','succeed','start','latest','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','137964WmHubS','json','update','beta','6276780kinywn','Update\x20available:\x20','log','slice','npm','string','error','message','expected\x20','\x20\x20CLI\x20Built-in\x20Skill\x20','code','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','\x20\x20Run\x20manually:\x20','\x20\x20Try\x20manually:\x20',',\x20state\x20','bool','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm',']:\x20','5726814mKZHtf','toLowerCase','Updated\x20to\x20v','skillVersion','red','6002696tCZzKW','\x20→\x20','current','version',',\x20found\x20','state','77850VmQFWR','valid','timeout','yellow','source','filter'];a40_0x2e43=function(){return _0x262e09;};return a40_0x2e43();}(function(_0x501c77,_0x133a63){const _0xf619e7=a40_0x2d47,_0x282053=_0x501c77();while(!![]){try{const _0x165f87=-parseInt(_0xf619e7(0x16d))/0x1+-parseInt(_0xf619e7(0x16f))/0x2*(parseInt(_0xf619e7(0x142))/0x3)+-parseInt(_0xf619e7(0x15e))/0x4+parseInt(_0xf619e7(0x146))/0x5+parseInt(_0xf619e7(0x159))/0x6*(parseInt(_0xf619e7(0x12a))/0x7)+parseInt(_0xf619e7(0x134))/0x8+-parseInt(_0xf619e7(0x126))/0x9*(-parseInt(_0xf619e7(0x164))/0xa);if(_0x165f87===_0x133a63)break;else _0x282053['push'](_0x282053['shift']());}catch(_0x54ea4a){_0x282053['push'](_0x282053['shift']());}}}(a40_0x2e43,0xe5035));import a40_0x405622 from'chalk';import a40_0x1301d1 from'ora';import a40_0x228ad9 from'semver';import{execa}from'execa';function a40_0x2d47(_0x4c5c18,_0x45ff6a){_0x4c5c18=_0x4c5c18-0x121;const _0x2e4363=a40_0x2e43();let _0x2d470e=_0x2e4363[_0x4c5c18];return _0x2d470e;}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 _0x13ec80=a40_0x2d47;return GIT_COMMIT!==_0x13ec80(0x139)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x13ec80(0x149)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x93700a=a40_0x2d47,_0x1ee2db=process['execPath'][_0x93700a(0x15a)]();if(_0x1ee2db[_0x93700a(0x170)](_0x93700a(0x125)))return _0x93700a(0x125);return'npm';}const updateFlags=[{'name':a40_0x17eafc(0x145),'type':'boolean','description':a40_0x17eafc(0x138),'default':![]},{'name':'version','type':a40_0x17eafc(0x14b),'description':'Install\x20a\x20specific\x20CLI\x20version'}];function getRequestedVersion(_0x38c617){const _0xd29dd3=a40_0x17eafc;return _0x38c617[_0xd29dd3(0x12b)](_0xd29dd3(0x161))['trim']();}async function validateUpdateFlags(_0x433744){const _0x7f7f5e=a40_0x17eafc,_0x440bc4=_0x433744[_0x7f7f5e(0x155)]('beta'),_0x4d9018=getRequestedVersion(_0x433744);if(_0x440bc4&&_0x4d9018)throw CliErrors['validation'](_0x7f7f5e(0x127),_0x7f7f5e(0x151));if(_0x4d9018&&!a40_0x228ad9[_0x7f7f5e(0x165)](_0x4d9018))throw CliErrors[_0x7f7f5e(0x12e)](_0x7f7f5e(0x137)+_0x4d9018,_0x7f7f5e(0x124));}async function fetchNpmDistTags(){const _0x4330ea=a40_0x17eafc;try{const _0x193df8=await fetch(_0x4330ea(0x129)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x4330ea(0x133),{'signal':AbortSignal[_0x4330ea(0x166)](0x2710)});if(!_0x193df8['ok'])return null;const _0x26ef5e=await _0x193df8[_0x4330ea(0x143)]();if(!_0x26ef5e||typeof _0x26ef5e!=='object')return null;return Object['fromEntries'](Object['entries'](_0x26ef5e)[_0x4330ea(0x169)](([,_0x28407d])=>typeof _0x28407d===_0x4330ea(0x14b)&&_0x28407d['trim']()['length']>0x0)[_0x4330ea(0x12d)](([_0x2d4dda,_0xe0b4b0])=>[_0x2d4dda,String(_0xe0b4b0)['trim']()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x1bb281){const _0xb1bcd8=await fetchNpmDistTags();return _0xb1bcd8?.[_0x1bb281]??null;}async function fetchLatestVersion(){const _0x7299e=a40_0x17eafc;return fetchNpmDistTagVersion(_0x7299e(0x140));}async function resolveTargetVersion(_0x484558){const _0x35ca93=a40_0x17eafc,_0x12edb6=getRequestedVersion(_0x484558);if(_0x12edb6)return{'version':_0x12edb6,'source':_0x35ca93(0x161)};if(_0x484558[_0x35ca93(0x155)](_0x35ca93(0x145))){const _0x3c460a=await fetchNpmDistTagVersion(_0x35ca93(0x145));if(!_0x3c460a)return null;return{'version':_0x3c460a,'source':_0x35ca93(0x145)};}const _0x43c9e2=await fetchLatestVersion();if(!_0x43c9e2)return null;return{'version':_0x43c9e2,'source':_0x35ca93(0x140)};}function shouldInstallTarget(_0x19a531,_0x6a238a){const _0x2850fc=a40_0x17eafc;if(_0x6a238a['source']==='version'||_0x6a238a[_0x2850fc(0x168)]==='beta')return!a40_0x228ad9['eq'](_0x19a531,_0x6a238a[_0x2850fc(0x161)]);return a40_0x228ad9['lt'](_0x19a531,_0x6a238a['version']);}function getInstallPlanLabel(_0x19654e,_0x55101b){const _0x38c23b=a40_0x17eafc;switch(_0x55101b[_0x38c23b(0x168)]){case _0x38c23b(0x145):return _0x38c23b(0x16e)+a40_0x405622[_0x38c23b(0x167)](_0x19654e)+'\x20→\x20'+a40_0x405622[_0x38c23b(0x123)](_0x55101b['version']);case _0x38c23b(0x161):return'Requested\x20version:\x20'+a40_0x405622['yellow'](_0x19654e)+_0x38c23b(0x15f)+a40_0x405622[_0x38c23b(0x123)](_0x55101b[_0x38c23b(0x161)]);case _0x38c23b(0x140):default:return _0x38c23b(0x147)+a40_0x405622[_0x38c23b(0x167)](_0x19654e)+'\x20→\x20'+a40_0x405622[_0x38c23b(0x123)](_0x55101b[_0x38c23b(0x161)]);}}function repairCurrentBuiltinSkill(){const _0x473d75=a40_0x17eafc;console['log'](a40_0x405622[_0x473d75(0x13d)]('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x395e70=installBuiltinSkill();if(_0x395e70['ok'])return console['log'](a40_0x405622[_0x473d75(0x13d)](_0x473d75(0x14f)+_0x395e70[_0x473d75(0x15c)]+'\x20is\x20up\x20to\x20date.')),!![];return console[_0x473d75(0x16c)](a40_0x405622[_0x473d75(0x167)](_0x473d75(0x141)+_0x395e70[_0x473d75(0x150)]+_0x473d75(0x158)+(_0x395e70['error']||_0x473d75(0x139)))),console[_0x473d75(0x148)](a40_0x405622['gray'](_0x473d75(0x152)+CLI_BIN_NAME+_0x473d75(0x12f))),![];}function verifyUpdatedBuiltinSkill(_0x3f7189){const _0x3eb913=a40_0x17eafc,_0x55a159=inspectInstalledBuiltinSkillVersion(_0x3f7189);if(_0x55a159[_0x3eb913(0x163)]===_0x3eb913(0x160))return console[_0x3eb913(0x148)](a40_0x405622['gray']('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x3f7189+_0x3eb913(0x130))),!![];const _0xd303da=_0x55a159[_0x3eb913(0x15c)]?'expected\x20'+_0x3f7189+_0x3eb913(0x162)+_0x55a159[_0x3eb913(0x15c)]:_0x3eb913(0x14e)+_0x3f7189+_0x3eb913(0x154)+_0x55a159[_0x3eb913(0x163)];return console[_0x3eb913(0x16c)](a40_0x405622[_0x3eb913(0x167)](_0x3eb913(0x12c)+_0xd303da)),console[_0x3eb913(0x148)](a40_0x405622[_0x3eb913(0x13d)](_0x3eb913(0x152)+_0x55a159[_0x3eb913(0x13b)])),![];}async function execute(_0x48a422){const _0x41dce1=a40_0x17eafc;await validateUpdateFlags(_0x48a422);const _0x2e938c=getCurrentVersion();console[_0x41dce1(0x148)](_0x41dce1(0x135)+_0x2e938c);const _0x42f375=a40_0x1301d1(_0x41dce1(0x16b))[_0x41dce1(0x13f)](),_0x5dbb62=await resolveTargetVersion(_0x48a422);if(!_0x5dbb62){const _0x1b2857=_0x48a422[_0x41dce1(0x155)](_0x41dce1(0x145))?_0x41dce1(0x157):_0x41dce1(0x156);return _0x42f375['fail'](_0x1b2857),console[_0x41dce1(0x148)](a40_0x405622['gray']('\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x1b2857};}const _0x4a8fd5=a40_0x228ad9[_0x41dce1(0x165)](VERSION),_0x362102=a40_0x228ad9[_0x41dce1(0x165)](_0x5dbb62[_0x41dce1(0x161)]);if(!_0x4a8fd5||!_0x362102)return _0x42f375[_0x41dce1(0x122)]('Version\x20comparison\x20failed'),{'ok':![],'message':_0x41dce1(0x136)};if(!shouldInstallTarget(_0x4a8fd5,_0x5dbb62)){const _0x583e84=_0x5dbb62[_0x41dce1(0x168)]===_0x41dce1(0x161)?_0x41dce1(0x121)+_0x5dbb62['version']+')':a40_0x228ad9['gt'](_0x4a8fd5,_0x362102)?'Current\x20version\x20v'+_0x2e938c+_0x41dce1(0x128)+_0x5dbb62[_0x41dce1(0x161)]:_0x41dce1(0x132)+_0x5dbb62[_0x41dce1(0x161)]+')';return _0x42f375['succeed'](_0x583e84),{'ok':repairCurrentBuiltinSkill()};}_0x42f375[_0x41dce1(0x131)](getInstallPlanLabel(_0x2e938c,_0x5dbb62));const _0x47ad5f=detectPackageManager(),_0x58c1fc=_0x47ad5f===_0x41dce1(0x14a)?resolveNpmBin(_0x41dce1(0x14a)):_0x47ad5f,_0x33972d=a40_0x1301d1('Updating\x20via\x20'+_0x47ad5f+'...')[_0x41dce1(0x13f)]();try{return await execa(_0x58c1fc,['install','-g',NPM_PACKAGE_NAME+'@'+_0x5dbb62[_0x41dce1(0x161)]],{'stdio':_0x41dce1(0x16a)}),_0x33972d[_0x41dce1(0x13e)](_0x41dce1(0x15b)+_0x5dbb62['version']),console[_0x41dce1(0x148)](a40_0x405622[_0x41dce1(0x13d)]('\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.')),{'ok':verifyUpdatedBuiltinSkill(_0x5dbb62[_0x41dce1(0x161)])};}catch(_0x550440){return _0x33972d[_0x41dce1(0x122)](_0x41dce1(0x13c)),console[_0x41dce1(0x14c)](a40_0x405622[_0x41dce1(0x15d)]('\x20\x20'+_0x550440[_0x41dce1(0x14d)])),console[_0x41dce1(0x148)](a40_0x405622[_0x41dce1(0x13d)](_0x41dce1(0x153)+_0x47ad5f+_0x41dce1(0x171)+NPM_PACKAGE_NAME+'@'+_0x5dbb62['version'])),{'ok':![],'message':_0x550440['message']};}}export const updateDefinition={'service':a40_0x17eafc(0x144),'command':'run','description':a40_0x17eafc(0x13a),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x326926,_0x4f4687){const _0x499fb9=a41_0x3529,_0x38a4d1=_0x326926();while(!![]){try{const _0x595ed9=-parseInt(_0x499fb9(0x75))/0x1+-parseInt(_0x499fb9(0x76))/0x2+parseInt(_0x499fb9(0x7d))/0x3+parseInt(_0x499fb9(0x7e))/0x4*(parseInt(_0x499fb9(0x7f))/0x5)+-parseInt(_0x499fb9(0x79))/0x6*(parseInt(_0x499fb9(0x7a))/0x7)+-parseInt(_0x499fb9(0x7b))/0x8*(-parseInt(_0x499fb9(0x78))/0x9)+-parseInt(_0x499fb9(0x77))/0xa*(-parseInt(_0x499fb9(0x7c))/0xb);if(_0x595ed9===_0x4f4687)break;else _0x38a4d1['push'](_0x38a4d1['shift']());}catch(_0x591762){_0x38a4d1['push'](_0x38a4d1['shift']());}}}(a41_0x518b,0x61366));import{codegenSdk}from'../../commands/codegen/sdk.js';function a41_0x518b(){const _0x3cc720=['231yFMlcs','1816xnULVt','89771HFlJQq','1859730xKkoMi','40EeIWOv','359270dFDwFM','514457rKbIXk','1165872buCGZE','760vcjPId','9702OAitlX','128694cSBEzU'];a41_0x518b=function(){return _0x3cc720;};return a41_0x518b();}import{codegenSql}from'../../commands/codegen/sql.js';function a41_0x3529(_0x3f9337,_0x3a91c4){_0x3f9337=_0x3f9337-0x75;const _0x518b1c=a41_0x518b();let _0x3529e3=_0x518b1c[_0x3f9337];return _0x3529e3;}export const codegenDefinitions=[codegenSdk,codegenSql];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x52c6cc=a42_0x13fb;(function(_0xfb39c5,_0x257e6c){const _0x50e392=a42_0x13fb,_0x276028=_0xfb39c5();while(!![]){try{const _0x585e05=-parseInt(_0x50e392(0x1a3))/0x1+-parseInt(_0x50e392(0x1a5))/0x2+parseInt(_0x50e392(0x19d))/0x3+parseInt(_0x50e392(0x1a4))/0x4+parseInt(_0x50e392(0x1b2))/0x5*(parseInt(_0x50e392(0x1ab))/0x6)+parseInt(_0x50e392(0x1a2))/0x7+-parseInt(_0x50e392(0x1ae))/0x8;if(_0x585e05===_0x257e6c)break;else _0x276028['push'](_0x276028['shift']());}catch(_0x1054d2){_0x276028['push'](_0x276028['shift']());}}}(a42_0xfbd4,0x9ead0));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';function a42_0xfbd4(){const _0x2b7055=['codegen','7343480pvIOJb','string','skip-imports','sdk','185485ERdnvv','alias','boolean','appCode','2606727QZUjIm','read','str','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','8087275AFhrOU','755871aHHHDG','2836600WgQBYo','2377358zkeItA','tableName','name','bool','operation','Omit\x20import\x20statements\x20from\x20generated\x20code','126NKSPJX','code'];a42_0xfbd4=function(){return _0x2b7055;};return a42_0xfbd4();}function a42_0x13fb(_0x253c53,_0x4bbc91){_0x253c53=_0x253c53-0x19b;const _0xfbd48c=a42_0xfbd4();let _0x13fb8e=_0xfbd48c[_0x253c53];return _0x13fb8e;}import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':a42_0x52c6cc(0x1ad),'command':a42_0x52c6cc(0x1b1),'description':'Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','risk':a42_0x52c6cc(0x19e),'flags':[CODE_FLAG_OPTIONAL,{'name':a42_0x52c6cc(0x1b3),'type':a42_0x52c6cc(0x1af),'description':a42_0x52c6cc(0x1a1)},{'name':a42_0x52c6cc(0x1a9),'type':a42_0x52c6cc(0x1af),'required':!![],'description':a42_0x52c6cc(0x1a0)},{'name':a42_0x52c6cc(0x1b0),'type':a42_0x52c6cc(0x19b),'description':a42_0x52c6cc(0x1aa)}],async 'execute'(_0x233eae){const _0x28b245=a42_0x52c6cc,{dataset:_0x3a2f16,operation:_0x19d98b}=await getOperationDetail(_0x233eae[_0x28b245(0x19c)],_0x233eae[_0x28b245(0x19f)](_0x28b245(0x1ac)),_0x233eae[_0x28b245(0x19f)](_0x28b245(0x1a9))),_0x6da3ed=generateSdkCode(_0x3a2f16,_0x19d98b,{'includeImports':!_0x233eae[_0x28b245(0x1a8)](_0x28b245(0x1b0))});return{'ok':!![],'data':{'dataset':{'name':_0x3a2f16[_0x28b245(0x1a7)],'code':_0x3a2f16['code'],'tableName':_0x3a2f16[_0x28b245(0x1a6)]},'operation':_0x233eae[_0x28b245(0x19f)]('operation'),'code':_0x6da3ed}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x35c1d6=a43_0x4b2b;function a43_0x5c83(){const _0x715dbb=['Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','8BpbhYW','sqlName','target','sqlCode','no-imports','2666619GOeRCg','5290490IiSGAj','bff','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','2005829OhsDAD','sdk','codegen','8tLatQx','read','10350Mnrnzt','738350lQnTYV','20hwWPrE','677478HJuKcT','sqlcode','sql','string','12522XogkTC','str','appCode'];a43_0x5c83=function(){return _0x715dbb;};return a43_0x5c83();}function a43_0x4b2b(_0x46704e,_0x14987b){_0x46704e=_0x46704e-0x15e;const _0x5c83a7=a43_0x5c83();let _0x4b2b13=_0x5c83a7[_0x46704e];return _0x4b2b13;}(function(_0x459e5e,_0x44718e){const _0x1a1690=a43_0x4b2b,_0x396a1b=_0x459e5e();while(!![]){try{const _0x2fe47b=-parseInt(_0x1a1690(0x167))/0x1*(-parseInt(_0x1a1690(0x165))/0x2)+parseInt(_0x1a1690(0x16c))/0x3*(parseInt(_0x1a1690(0x163))/0x4)+parseInt(_0x1a1690(0x166))/0x5+-parseInt(_0x1a1690(0x168))/0x6+-parseInt(_0x1a1690(0x160))/0x7*(-parseInt(_0x1a1690(0x170))/0x8)+parseInt(_0x1a1690(0x175))/0x9+-parseInt(_0x1a1690(0x176))/0xa;if(_0x2fe47b===_0x44718e)break;else _0x396a1b['push'](_0x396a1b['shift']());}catch(_0x277e54){_0x396a1b['push'](_0x396a1b['shift']());}}}(a43_0x5c83,0x30eca));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':a43_0x35c1d6(0x162),'command':a43_0x35c1d6(0x16a),'description':a43_0x35c1d6(0x16f),'risk':a43_0x35c1d6(0x164),'flags':[SQLCODE_FLAG,{'name':a43_0x35c1d6(0x172),'type':a43_0x35c1d6(0x16b),'description':a43_0x35c1d6(0x15f),'default':a43_0x35c1d6(0x161),'enum':['sdk',a43_0x35c1d6(0x15e)]},{'name':a43_0x35c1d6(0x174),'type':'boolean','description':'Omit\x20import\x20statements\x20from\x20generated\x20code'}],async 'execute'(_0x5b31ca){const _0x2edab5=a43_0x35c1d6,_0x207cb1=await getSqlQueryInfo(_0x5b31ca[_0x2edab5(0x16e)],_0x5b31ca['str'](_0x2edab5(0x169))),_0x1e958c=_0x5b31ca[_0x2edab5(0x16d)]('target')||_0x2edab5(0x161),_0x263d97=generateSqlCodeTemplate(_0x207cb1,{'target':_0x1e958c,'includeImports':!_0x5b31ca['bool'](_0x2edab5(0x174))});return{'ok':!![],'data':{'sqlCode':_0x207cb1[_0x2edab5(0x173)],'sqlName':_0x207cb1[_0x2edab5(0x171)],'target':_0x1e958c,'code':_0x263d97}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4145d9,_0xcf2b69){const _0x218705=a44_0x1a74,_0x5b4a32=_0x4145d9();while(!![]){try{const _0x771ab3=-parseInt(_0x218705(0x1a1))/0x1*(parseInt(_0x218705(0x188))/0x2)+parseInt(_0x218705(0x17e))/0x3*(-parseInt(_0x218705(0x181))/0x4)+parseInt(_0x218705(0x17b))/0x5*(parseInt(_0x218705(0x185))/0x6)+-parseInt(_0x218705(0x183))/0x7+-parseInt(_0x218705(0x193))/0x8*(-parseInt(_0x218705(0x194))/0x9)+-parseInt(_0x218705(0x19a))/0xa+parseInt(_0x218705(0x19b))/0xb*(parseInt(_0x218705(0x196))/0xc);if(_0x771ab3===_0xcf2b69)break;else _0x5b4a32['push'](_0x5b4a32['shift']());}catch(_0x11c1ce){_0x5b4a32['push'](_0x5b4a32['shift']());}}}(a44_0x45dc,0x60531));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{collectAppProfileOverrides,getAppProfileFlagDefs,normalizeStoredDefaultApp}from'../../config/schema.js';function a44_0x45dc(){const _0x491b79=['App\x20code','bool','Use\x20global\x20config\x20scope','\x20Note:\x20app\x20\x22','\x22\x20still\x20defined\x20in\x20','App\x20\x22','\x22\x20(appcode:\x20','object','globalConfig','boolean','15zkCrUE','Removed\x20app\x20\x22','defaultApp','93255bYLnyZ','Missing\x20app\x20name.','\x20Remaining\x20app\x20\x22','28wMuYrf','\x22\x20is\x20selected\x20automatically.','1619681xsZajm','length','518106IhDjTa','trim','apps','60lTlLHk','Updated','Usage:\x20','validation','Added','appcode','\x22\x20not\x20found.','str','\x20<name>','args','\x20config.','904ScFRqX','61533idkSgc','string','14796OLJMzq','flagMissing','keys','both','1909850tOmTOQ','4708BDgyso','\x20Default\x20app\x20changed\x20to\x20\x22','\x20<name>\x20--appcode\x20<code>','projectConfig','global','project','17495NRXqhS'];a44_0x45dc=function(){return _0x491b79;};return a44_0x45dc();}import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';function a44_0x1a74(_0x1e6e7f,_0x37cca9){_0x1e6e7f=_0x1e6e7f-0x171;const _0x45dce1=a44_0x45dc();let _0x1a741a=_0x45dce1[_0x1e6e7f];return _0x1a741a;}export function buildAppAddFlags(){const _0x35c422=a44_0x1a74;return[{'name':_0x35c422(0x18d),'type':_0x35c422(0x195),'description':_0x35c422(0x171),'required':!![]},{'name':'global','type':'boolean','description':_0x35c422(0x173),'default':![]},...getAppProfileFlagDefs()];}export function buildAppRemoveFlags(){const _0x5d2504=a44_0x1a74;return[{'name':_0x5d2504(0x19f),'type':_0x5d2504(0x17a),'description':_0x5d2504(0x173),'default':![]}];}export async function validateAppName(_0x19606a,_0x56e89c){const _0x2be355=a44_0x1a74,_0x1b7a14=_0x19606a[_0x2be355(0x191)][0x0]?.[_0x2be355(0x186)]();if(!_0x1b7a14)throw CliErrors[_0x2be355(0x18b)](_0x2be355(0x17f),_0x2be355(0x18a)+CLI_BIN_NAME+'\x20'+_0x56e89c+_0x2be355(0x190));}export async function runAppAdd(_0x2f9ff4,_0x3e3fef){const _0x47ee73=a44_0x1a74,_0x338b6d=_0x2f9ff4[_0x47ee73(0x191)][0x0]?.[_0x47ee73(0x186)]();if(!_0x338b6d)throw CliErrors[_0x47ee73(0x18b)](_0x47ee73(0x17f),_0x47ee73(0x18a)+CLI_BIN_NAME+'\x20'+_0x3e3fef+_0x47ee73(0x19d));const _0x3913a1=_0x2f9ff4[_0x47ee73(0x18f)](_0x47ee73(0x18d));if(!_0x3913a1)throw CliErrors[_0x47ee73(0x197)](_0x47ee73(0x18d),'Usage:\x20'+CLI_BIN_NAME+'\x20'+_0x3e3fef+_0x47ee73(0x19d));const _0x3dcb5c={'global':_0x2f9ff4['bool']('global')},_0x38d3cb=readConfig(_0x3dcb5c);if(!_0x38d3cb[_0x47ee73(0x187)])_0x38d3cb['apps']={};const _0x35c4f8={'appcode':_0x3913a1,...collectAppProfileOverrides(_0x3c8bdd=>_0x2f9ff4[_0x47ee73(0x18f)](_0x3c8bdd))},_0x1f6354=_0x38d3cb[_0x47ee73(0x187)],_0x2a6e7f=Object['keys'](_0x1f6354),_0x4f1cad=typeof _0x38d3cb['defaultApp']===_0x47ee73(0x195)&&_0x1f6354[_0x38d3cb['defaultApp']]?_0x38d3cb[_0x47ee73(0x17d)]:_0x2a6e7f[_0x47ee73(0x184)]===0x1?_0x2a6e7f[0x0]:undefined,_0x3d3798=!!_0x1f6354[_0x338b6d];_0x1f6354[_0x338b6d]=_0x35c4f8;const _0x42a60c=normalizeStoredDefaultApp(_0x38d3cb,_0x4f1cad);writeConfig(_0x38d3cb,_0x3dcb5c);const _0x23ea29=!_0x3d3798&&_0x42a60c?'\x20Default\x20app\x20is\x20\x22'+_0x42a60c+'\x22.':'',_0x19f27a=(_0x3d3798?_0x47ee73(0x189):_0x47ee73(0x18c))+'\x20app\x20\x22'+_0x338b6d+_0x47ee73(0x177)+_0x3913a1+')'+scopeLabel(_0x3dcb5c)+'.'+_0x23ea29;return{'ok':!![],'message':_0x19f27a};}export async function runAppRemove(_0x3b4f82,_0x293c7a){const _0x31a056=a44_0x1a74,_0x25bfa8=_0x3b4f82[_0x31a056(0x191)][0x0]?.['trim']();if(!_0x25bfa8)throw CliErrors[_0x31a056(0x18b)](_0x31a056(0x17f),_0x31a056(0x18a)+CLI_BIN_NAME+'\x20'+_0x293c7a+'\x20<name>\x20[--global]');const _0x44a488=_0x3b4f82[_0x31a056(0x172)](_0x31a056(0x19f)),{config:_0x1a594c,layers:_0x2522f6}=readRawConfigWithLayers(),_0x33c705=_0x1a594c['apps']??{};if(!_0x33c705[_0x25bfa8])throw CliErrors[_0x31a056(0x18b)]('App\x20\x22'+_0x25bfa8+_0x31a056(0x18e));const _0x4e091d=_0x2522f6['globalConfig'][_0x31a056(0x187)]&&typeof _0x2522f6['globalConfig'][_0x31a056(0x187)]==='object'?_0x2522f6[_0x31a056(0x179)][_0x31a056(0x187)]:{},_0x25634f=_0x2522f6[_0x31a056(0x19e)]['apps']&&typeof _0x2522f6[_0x31a056(0x19e)][_0x31a056(0x187)]===_0x31a056(0x178)?_0x2522f6['projectConfig'][_0x31a056(0x187)]:{},_0x4c7f76=appDefinedIn(_0x25bfa8,_0x4e091d,_0x25634f),_0x2d704a=resolveAppScopeForWrite(_0x25bfa8,_0x44a488,_0x2522f6),_0x2df7e5={'global':_0x2d704a==='global'},_0x1da471=readConfig(_0x2df7e5),_0x292c1c=_0x1da471[_0x31a056(0x187)];if(!_0x292c1c||!_0x292c1c[_0x25bfa8])throw CliErrors[_0x31a056(0x18b)](_0x31a056(0x176)+_0x25bfa8+'\x22\x20not\x20found.');delete _0x292c1c[_0x25bfa8];let _0x3c4d1b='';const _0x3b28ea=typeof _0x1da471[_0x31a056(0x17d)]===_0x31a056(0x195)?_0x1da471['defaultApp']:undefined,_0x1b1ed7=Object[_0x31a056(0x198)](_0x292c1c),_0x7988f9=_0x3b28ea===_0x25bfa8?_0x1b1ed7[0x0]:_0x3b28ea,_0xa1c6f9=normalizeStoredDefaultApp(_0x1da471,_0x7988f9);if(_0x3b28ea===_0x25bfa8&&_0x1b1ed7['length']===0x1)_0x3c4d1b=_0x31a056(0x180)+_0x1b1ed7[0x0]+_0x31a056(0x182);else _0x3b28ea===_0x25bfa8&&_0xa1c6f9&&(_0x3c4d1b=_0x31a056(0x19c)+_0xa1c6f9+'\x22.');Object[_0x31a056(0x198)](_0x292c1c)[_0x31a056(0x184)]===0x0&&(delete _0x1da471['apps'],delete _0x1da471[_0x31a056(0x17d)]);writeConfig(_0x1da471,_0x2df7e5);const _0x4e253c=_0x4c7f76===_0x31a056(0x199)?_0x31a056(0x174)+_0x25bfa8+_0x31a056(0x175)+(_0x2d704a==='project'?'global':_0x31a056(0x1a0))+_0x31a056(0x192):'';return{'ok':!![],'message':_0x31a056(0x17c)+_0x25bfa8+'\x22'+scopeLabel(_0x2df7e5)+'.'+_0x3c4d1b+_0x4e253c};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5598ce,_0x1fb8d1){const _0x2cf63b=a45_0x1f2b,_0x3e17c1=_0x5598ce();while(!![]){try{const _0x471e1e=-parseInt(_0x2cf63b(0x7c))/0x1*(-parseInt(_0x2cf63b(0x6b))/0x2)+parseInt(_0x2cf63b(0x81))/0x3+-parseInt(_0x2cf63b(0x7b))/0x4*(-parseInt(_0x2cf63b(0x77))/0x5)+-parseInt(_0x2cf63b(0x72))/0x6*(-parseInt(_0x2cf63b(0x71))/0x7)+parseInt(_0x2cf63b(0x7f))/0x8+parseInt(_0x2cf63b(0x8a))/0x9*(parseInt(_0x2cf63b(0x75))/0xa)+-parseInt(_0x2cf63b(0x7e))/0xb;if(_0x471e1e===_0x1fb8d1)break;else _0x3e17c1['push'](_0x3e17c1['shift']());}catch(_0x1fb29d){_0x3e17c1['push'](_0x3e17c1['shift']());}}}(a45_0x2fe5,0xf0a95));import{input,checkbox,select}from'@inquirer/prompts';import a45_0xdf194e from'chalk';import{validateAppcode}from'../../commands/common/validate.js';import{listRemoteApps}from'../../core/api-client.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';function a45_0x1f2b(_0x5327f7,_0x1c10dd){_0x5327f7=_0x5327f7-0x68;const _0x2fe5c8=a45_0x2fe5();let _0x1f2b2b=_0x2fe5c8[_0x5327f7];return _0x1f2b2b;}export async function promptCustomAppcode(){const _0x3480ff=a45_0x1f2b,_0x47350a=await input({'message':_0x3480ff(0x7d),'validate':_0x261646=>{const _0x58ba43=_0x3480ff,_0x34e620=validateAppcode(_0x261646[_0x58ba43(0x6c)]());return _0x34e620['valid']||_0x34e620[_0x58ba43(0x89)]||_0x58ba43(0x85);}});return _0x47350a[_0x3480ff(0x6c)]();}export async function promptAppSelection(_0x423dcf){const _0x9a3c86=a45_0x1f2b,_0x5c0fc1=[{'name':a45_0xdf194e[_0x9a3c86(0x68)](_0x9a3c86(0x76)),'value':-0x1},..._0x423dcf[_0x9a3c86(0x80)]((_0x49d45b,_0x334287)=>({'name':_0x49d45b[_0x9a3c86(0x83)]+'\x20\x20'+a45_0xdf194e[_0x9a3c86(0x6a)]('('+_0x49d45b[_0x9a3c86(0x6d)]+')'),'value':_0x334287}))],_0x31c024=await checkbox({'message':'Found\x20'+a45_0xdf194e[_0x9a3c86(0x88)](_0x423dcf['length'])+_0x9a3c86(0x70),'choices':_0x5c0fc1,'loop':![]});if(_0x31c024[_0x9a3c86(0x79)](-0x1))return'custom';if(_0x31c024[_0x9a3c86(0x78)]===0x0)return _0x9a3c86(0x86);return _0x31c024[_0x9a3c86(0x80)](_0x3c1d53=>_0x423dcf[_0x3c1d53]);}export async function promptSingleAppSelection(_0x5a4d64){const _0x429fa3=a45_0x1f2b,_0x502ab4=[{'name':a45_0xdf194e[_0x429fa3(0x6a)](_0x429fa3(0x69)),'value':_0x429fa3(0x7a)},{'name':a45_0xdf194e[_0x429fa3(0x68)](_0x429fa3(0x76)),'value':_0x429fa3(0x86)},..._0x5a4d64[_0x429fa3(0x80)](_0x68521c=>({'name':_0x68521c['appName']+'\x20\x20'+a45_0xdf194e[_0x429fa3(0x6a)]('('+_0x68521c[_0x429fa3(0x6d)]+')'),'value':_0x68521c[_0x429fa3(0x6d)]}))],_0x4c01b1=await select({'message':_0x429fa3(0x74),'choices':_0x502ab4});if(_0x4c01b1==='skip')return _0x429fa3(0x7a);if(_0x4c01b1==='custom')return'custom';return _0x5a4d64['find'](_0x530c44=>_0x530c44['appCode']===_0x4c01b1);}function a45_0x2fe5(){const _0xe3aae6=['1888789LNOzFv','6achXrK','(No\x20login\x20session.\x20Enter\x20an\x20App\x20Code\x20manually\x20or\x20skip.)','Select\x20the\x20app\x20to\x20bind:','83300exRLxS','✎\x20Enter\x20appcode\x20manually','64835aRNOpg','length','includes','skip','256QQgIIO','171ryfTuW','App\x20Code:','49373291KUMPPQ','15325368AHwIcm','map','3030060ufozVM','manual','appName','✎\x20Enter\x20manually','Invalid\x20App\x20Code','custom','No\x20available\x20apps\x20found.','cyan','message','639gFopjV','Fetching\x20available\x20apps...','\x20\x20(','yellow','(Skip;\x20configure\x20later\x20with\x20config\x20set\x20appcode)','gray','10028WpivNp','trim','appCode','Could\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.','\x0aNo\x20available\x20apps\x20found.','\x20apps.\x20Select\x20with\x20space,\x20a=all,\x20i=invert:'];a45_0x2fe5=function(){return _0xe3aae6;};return a45_0x2fe5();}export async function selectSingleAppcode(_0x8e6c3){const _0x39095a=a45_0x1f2b;if(!_0x8e6c3)return writeCliSideChannelLine(a45_0xdf194e[_0x39095a(0x6a)](_0x39095a(0x73))),_fallbackOrSkip();writeCliSideChannelLine(_0x39095a(0x8b));let _0xb6728f;try{_0xb6728f=await withActiveCookie(_0x8e6c3,()=>listRemoteApps());}catch(_0x29e665){writeCliSideChannelLine(a45_0xdf194e[_0x39095a(0x68)](_0x39095a(0x6e)));if(_0x29e665 instanceof Error)writeCliSideChannelLine(a45_0xdf194e[_0x39095a(0x6a)]('\x20\x20('+_0x29e665['message']+')'));return _fallbackOrSkip();}if(_0xb6728f[_0x39095a(0x78)]===0x0)return writeCliSideChannelLine(a45_0xdf194e[_0x39095a(0x68)](_0x39095a(0x87))),_fallbackOrSkip();const _0x970c4d=await promptSingleAppSelection(_0xb6728f);if(_0x970c4d===_0x39095a(0x7a))return'';if(_0x970c4d===_0x39095a(0x86))return promptCustomAppcode();return _0x970c4d[_0x39095a(0x6d)];}export async function selectMultipleApps(_0x451ba9){const _0x4cdcba=a45_0x1f2b;writeCliSideChannelLine('Fetching\x20available\x20apps...');let _0x5ccd6c;try{_0x5ccd6c=await withActiveCookie(_0x451ba9,()=>listRemoteApps());}catch(_0x4c2cba){writeCliSideChannelLine('\x0aCould\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.');if(_0x4c2cba instanceof Error)writeCliSideChannelLine(_0x4cdcba(0x8c)+_0x4c2cba[_0x4cdcba(0x89)]+')');return'custom';}if(_0x5ccd6c[_0x4cdcba(0x78)]===0x0)return writeCliSideChannelLine(_0x4cdcba(0x6f)),_0x4cdcba(0x86);return promptAppSelection(_0x5ccd6c);}async function _fallbackOrSkip(){const _0x58ae0e=a45_0x1f2b,_0x1798bd=await select({'message':'App\x20Code:','choices':[{'name':a45_0xdf194e['gray']('(Skip;\x20configure\x20later)'),'value':_0x58ae0e(0x7a)},{'name':a45_0xdf194e[_0x58ae0e(0x68)](_0x58ae0e(0x84)),'value':_0x58ae0e(0x82)}]});if(_0x1798bd===_0x58ae0e(0x7a))return'';return promptCustomAppcode();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a46_0x30c8(){const _0x39f613=['\x20--appcode\x20','1513870XNryzU','\x20completed\x20successfully.','Async\x20task\x20response\x20did\x20not\x20contain\x20a\x20taskId.','has','3868032EZVzpW','\x20task\x20status\x20--task-id\x20','\x20failed.','trim','status','SUCCESS','string','9gZCCzS','Task\x20','49496HOEIWQ','Async\x20task\x20','5080dOAAzv','toUpperCase','\x20is\x20pending.','apiError','3598716awaYZA','7088944GULRDL','475kUGRYt','\x20is\x20processing.','replace','PENDING','4409952jLdgYR','errorMessage','\x20response\x20did\x20not\x20contain\x20a\x20status.','\x20failed:\x20','FAILED','taskId','\x20--format\x20compress','230FZYUYS','PROCESSING'];a46_0x30c8=function(){return _0x39f613;};return a46_0x30c8();}const a46_0x2b029a=a46_0x5220;function a46_0x5220(_0x4be3a6,_0x3ccf4b){_0x4be3a6=_0x4be3a6-0x1f4;const _0x30c86f=a46_0x30c8();let _0x5220d2=_0x30c86f[_0x4be3a6];return _0x5220d2;}(function(_0x320be2,_0x5dd1a5){const _0x3d7cf9=a46_0x5220,_0x29a5f2=_0x320be2();while(!![]){try{const _0x331db1=parseInt(_0x3d7cf9(0x20e))/0x1*(parseInt(_0x3d7cf9(0x208))/0x2)+parseInt(_0x3d7cf9(0x20c))/0x3+-parseInt(_0x3d7cf9(0x206))/0x4*(parseInt(_0x3d7cf9(0x1f6))/0x5)+-parseInt(_0x3d7cf9(0x212))/0x6+parseInt(_0x3d7cf9(0x1fd))/0x7+-parseInt(_0x3d7cf9(0x20d))/0x8+parseInt(_0x3d7cf9(0x204))/0x9*(parseInt(_0x3d7cf9(0x1f9))/0xa);if(_0x331db1===_0x5dd1a5)break;else _0x29a5f2['push'](_0x29a5f2['shift']());}catch(_0x2fe424){_0x29a5f2['push'](_0x29a5f2['shift']());}}}(a46_0x30c8,0xe08a9));import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';const TERMINAL_STATUSES=new Set([a46_0x2b029a(0x202),'FAILED']),NON_TERMINAL_STATUSES=new Set(['PENDING',a46_0x2b029a(0x1f7)]);export function normalizeAsyncTask(_0x3873b6){const _0x421965=a46_0x2b029a,_0x191d67=typeof _0x3873b6?.['taskId']===_0x421965(0x203)?_0x3873b6['taskId'][_0x421965(0x200)]():'';if(!_0x191d67)throw CliErrors['apiError'](_0x421965(0x1fb));const _0x582f04=typeof _0x3873b6[_0x421965(0x201)]===_0x421965(0x203)?_0x3873b6['status'][_0x421965(0x200)]()[_0x421965(0x209)]():'';if(!_0x582f04)throw CliErrors[_0x421965(0x20b)](_0x421965(0x207)+_0x191d67+_0x421965(0x214));return{'taskId':_0x191d67,'status':_0x582f04,'errorMessage':typeof _0x3873b6[_0x421965(0x213)]===_0x421965(0x203)&&_0x3873b6['errorMessage'][_0x421965(0x200)]()?_0x3873b6['errorMessage'][_0x421965(0x200)]():null,'isTerminal':TERMINAL_STATUSES[_0x421965(0x1fc)](_0x582f04),'knownStatus':TERMINAL_STATUSES[_0x421965(0x1fc)](_0x582f04)||NON_TERMINAL_STATUSES['has'](_0x582f04)};}export function buildAsyncTaskStatusCommand(_0x3111c0,_0x1776f8){const _0x286b0c=a46_0x2b029a;return CLI_BIN_NAME+_0x286b0c(0x1fe)+quoteShellArg(_0x3111c0)+_0x286b0c(0x1f8)+quoteShellArg(_0x1776f8)+_0x286b0c(0x1f5);}export function asyncTaskMessage(_0x214a6c){const _0x4cab99=a46_0x2b029a;switch(_0x214a6c[_0x4cab99(0x201)]){case _0x4cab99(0x211):return _0x4cab99(0x205)+_0x214a6c[_0x4cab99(0x1f4)]+_0x4cab99(0x20a);case _0x4cab99(0x1f7):return'Task\x20'+_0x214a6c[_0x4cab99(0x1f4)]+_0x4cab99(0x20f);case _0x4cab99(0x202):return'Task\x20'+_0x214a6c['taskId']+_0x4cab99(0x1fa);case _0x4cab99(0x216):return _0x214a6c[_0x4cab99(0x213)]?'Task\x20'+_0x214a6c[_0x4cab99(0x1f4)]+_0x4cab99(0x215)+_0x214a6c['errorMessage']:_0x4cab99(0x205)+_0x214a6c[_0x4cab99(0x1f4)]+_0x4cab99(0x1ff);default:return _0x4cab99(0x205)+_0x214a6c[_0x4cab99(0x1f4)]+'\x20returned\x20unknown\x20status\x20'+_0x214a6c[_0x4cab99(0x201)]+'.';}}function quoteShellArg(_0x34e4a7){const _0x5e4657=a46_0x2b029a;return'\x27'+_0x34e4a7[_0x5e4657(0x210)](/'/g,'\x27\x5c\x27\x27')+'\x27';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a47_0x3bc0(){var _0x767995=['12336696JLjMdH','1835lcvQmV','136ehbRGK','7878Onkeld','3173890dfirIm','2079NRNFiS','method','414830SLPCcZ','277488YyhwTL','596278JxzaHW','url','22KkeYxL','4204SwwbUK','description','3zHVdJe'];a47_0x3bc0=function(){return _0x767995;};return a47_0x3bc0();}function a47_0x1256(_0x5d1cc5,_0xef2c93){_0x5d1cc5=_0x5d1cc5-0x1f0;var _0x3bc0d0=a47_0x3bc0();var _0x1256f6=_0x3bc0d0[_0x5d1cc5];return _0x1256f6;}(function(_0x4956fd,_0x358a47){var _0x4bdf07=a47_0x1256,_0x191df1=_0x4956fd();while(!![]){try{var _0x308786=parseInt(_0x4bdf07(0x1fd))/0x1+-parseInt(_0x4bdf07(0x1f0))/0x2*(-parseInt(_0x4bdf07(0x1f5))/0x3)+-parseInt(_0x4bdf07(0x1f3))/0x4*(-parseInt(_0x4bdf07(0x1f7))/0x5)+-parseInt(_0x4bdf07(0x1f9))/0x6*(-parseInt(_0x4bdf07(0x1fb))/0x7)+-parseInt(_0x4bdf07(0x1f8))/0x8*(-parseInt(_0x4bdf07(0x1fe))/0x9)+parseInt(_0x4bdf07(0x1fa))/0xa*(-parseInt(_0x4bdf07(0x1f2))/0xb)+-parseInt(_0x4bdf07(0x1f6))/0xc;if(_0x308786===_0x358a47)break;else _0x191df1['push'](_0x191df1['shift']());}catch(_0x365502){_0x191df1['push'](_0x191df1['shift']());}}}(a47_0x3bc0,0x55703));export function asDryRunResult(_0x98dff,_0xf1110f){var _0x240b1a=a47_0x1256;return Object['defineProperties'](_0x98dff,{'method':{'value':_0xf1110f[_0x240b1a(0x1fc)],'enumerable':![]},'url':{'value':_0xf1110f[_0x240b1a(0x1f1)],'enumerable':![]},..._0xf1110f[_0x240b1a(0x1f4)]?{'description':{'value':_0xf1110f['description'],'enumerable':![]}}:{}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x1b7b87=a48_0x157c;(function(_0x282302,_0x419266){const _0x21b349=a48_0x157c,_0x3bf4af=_0x282302();while(!![]){try{const _0x157e20=parseInt(_0x21b349(0x124))/0x1+-parseInt(_0x21b349(0x110))/0x2*(parseInt(_0x21b349(0x118))/0x3)+parseInt(_0x21b349(0x115))/0x4*(-parseInt(_0x21b349(0x11b))/0x5)+parseInt(_0x21b349(0x11c))/0x6+parseInt(_0x21b349(0x113))/0x7+parseInt(_0x21b349(0x116))/0x8*(-parseInt(_0x21b349(0x117))/0x9)+parseInt(_0x21b349(0x125))/0xa*(parseInt(_0x21b349(0x10e))/0xb);if(_0x157e20===_0x419266)break;else _0x3bf4af['push'](_0x3bf4af['shift']());}catch(_0xfa0087){_0x3bf4af['push'](_0x3bf4af['shift']());}}}(a48_0x421b,0xea5d4));export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}(?:_[^_\s]+_[^_\s]+)?$/i,'description':a48_0x1b7b87(0x10f)};export const CODE_FLAG={'name':a48_0x1b7b87(0x10c),'type':a48_0x1b7b87(0x11f),'required':!![],'description':a48_0x1b7b87(0x11e),'pattern':DATASET_CODE_PATTERN};export const CODE_FLAG_OPTIONAL={...CODE_FLAG,'required':![]};export const DATASETCODE_FLAG_OPTIONAL={...CODE_FLAG_OPTIONAL,'name':'datasetcode','description':a48_0x1b7b87(0x11e)};export const SQLCODE_FLAG={'name':a48_0x1b7b87(0x111),'type':a48_0x1b7b87(0x11f),'required':!![],'description':a48_0x1b7b87(0x127),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a48_0x1b7b87(0x126)}};export const APPCODE_FLAG_OPTIONAL={'name':a48_0x1b7b87(0x10b),'type':a48_0x1b7b87(0x11f),'required':![],'description':a48_0x1b7b87(0x10d)};function a48_0x421b(){const _0x2002b5=['boolean','1242050PhbYAK','3912740vfiuRt','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','MYSQL','appcode','code','App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)','55FfOTbF','a\x2032-character\x20hex\x20code,\x20optionally\x20with\x20`_xx_xx`\x20suffix\x20(e.g.\x2099a909313f1fa7153186431e1c551588\x20or\x2099a909313f1fa7153186431e1c551588_75_3c7120aa)','562cwGChL','sqlcode','Skip\x20testing\x20the\x20unsaved\x20database\x20configuration\x20before\x20create/update','13264608LoPyFa','Database\x20product\x20type','4tYbBav','8vaBOry','11987775omWLLr','17367ndwieZ','Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)','POSTGRESQL','7818890tixImL','2334324YKmDLp','number','Dataset\x20code\x20(32-char\x20hex,\x20optionally\x20with\x20_xx_xx\x20suffix)','string','App\x20code\x20(e.g.\x20app-xxxxx)','skip-connection-test','dbtype'];a48_0x421b=function(){return _0x2002b5;};return a48_0x421b();}export const APPCODE_FLAG={...APPCODE_FLAG_OPTIONAL,'required':!![],'description':a48_0x1b7b87(0x120)};export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};export const DBLINK_ID_FLAG={'name':'id','type':a48_0x1b7b87(0x11d),'required':!![],'description':a48_0x1b7b87(0x119)};function a48_0x157c(_0x5e2e3e,_0x1ce7eb){_0x5e2e3e=_0x5e2e3e-0x10b;const _0x421b4b=a48_0x421b();let _0x157cbf=_0x421b4b[_0x5e2e3e];return _0x157cbf;}export const DB_TYPE_FLAG={'name':a48_0x1b7b87(0x122),'type':a48_0x1b7b87(0x11f),'required':!![],'description':a48_0x1b7b87(0x114),'enum':[a48_0x1b7b87(0x128),a48_0x1b7b87(0x11a)]};export const SKIP_CONNECTION_TEST_FLAG={'name':a48_0x1b7b87(0x121),'type':a48_0x1b7b87(0x123),'description':a48_0x1b7b87(0x112)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a49_0x2156(){const _0x8bc79d=['File\x20not\x20found:\x20','1014853IwLXGd','\x20MB','70WdnDDF','toFixed','2260MsyORv','15546YLKbgz','size','validation','42956MQhlYT','File\x20exceeds\x20the\x20development\x20upload\x20limit\x20of\x2050\x20MB:\x20','7045080KmDvkF','3018147nluvwi','\x20path\x20is\x20required.','ceil','2477648kHbAYu','3197786UJiCiY','18AWuDLj','isFile','162EDymUT'];a49_0x2156=function(){return _0x8bc79d;};return a49_0x2156();}(function(_0x5c319d,_0x28fae6){const _0x2afd1d=a49_0x1d90,_0x3459ab=_0x5c319d();while(!![]){try{const _0x57bc69=parseInt(_0x2afd1d(0xc0))/0x1+parseInt(_0x2afd1d(0xbb))/0x2+-parseInt(_0x2afd1d(0xbe))/0x3*(parseInt(_0x2afd1d(0xc8))/0x4)+-parseInt(_0x2afd1d(0xc4))/0x5*(-parseInt(_0x2afd1d(0xc5))/0x6)+-parseInt(_0x2afd1d(0xca))/0x7+parseInt(_0x2afd1d(0xba))/0x8*(parseInt(_0x2afd1d(0xbc))/0x9)+parseInt(_0x2afd1d(0xc2))/0xa*(-parseInt(_0x2afd1d(0xcb))/0xb);if(_0x57bc69===_0x28fae6)break;else _0x3459ab['push'](_0x3459ab['shift']());}catch(_0x36e31f){_0x3459ab['push'](_0x3459ab['shift']());}}}(a49_0x2156,0xdb119));function a49_0x1d90(_0x5496e5,_0xe6a3cc){_0x5496e5=_0x5496e5-0xb8;const _0x215666=a49_0x2156();let _0x1d90f8=_0x215666[_0x5496e5];return _0x1d90f8;}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 formatBytes(_0x5c385e){const _0x1c8d91=a49_0x1d90;if(_0x5c385e>=BYTES_PER_MB){const _0x48c9e9=Math[_0x1c8d91(0xb9)](_0x5c385e/BYTES_PER_MB*0x64)/0x64;return _0x48c9e9[_0x1c8d91(0xc3)](0x2)+_0x1c8d91(0xc1);}return _0x5c385e+'\x20B';}export function requireDevelopmentUploadFile(_0x41de75,_0x17f64c){const _0x4ba47a=a49_0x1d90,_0x27c360=_0x41de75['trim']();if(!_0x27c360)throw CliErrors[_0x4ba47a(0xc7)](_0x17f64c+_0x4ba47a(0xb8));if(!existsSync(_0x27c360))throw CliErrors[_0x4ba47a(0xc7)](_0x4ba47a(0xbf)+_0x27c360);const _0x253be9=statSync(_0x27c360);if(!_0x253be9[_0x4ba47a(0xbd)]())throw CliErrors[_0x4ba47a(0xc7)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x27c360);if(_0x253be9[_0x4ba47a(0xc6)]>DEVELOPMENT_UPLOAD_MAX_BYTES)throw CliErrors[_0x4ba47a(0xc7)](_0x4ba47a(0xc9)+_0x27c360+'\x20('+formatBytes(_0x253be9[_0x4ba47a(0xc6)])+')');return{'path':_0x27c360,'size':_0x253be9['size']};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a50_0x569d(_0x143d5e,_0x2890a0){_0x143d5e=_0x143d5e-0xbb;const _0x23fb39=a50_0x23fb();let _0x569d1a=_0x23fb39[_0x143d5e];return _0x569d1a;}function a50_0x23fb(){const _0x12a962=['7336005MzlLDu','trim','test','1638432xcjzad','length','14jyrsRH','3fHkvZT','Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed','3772gOmfOR','250RgGDDC','5422292TiHMYy','507815MFHfDU','App\x20Code\x20cannot\x20exceed\x20100\x20characters','359HzBLzY','3217482MyAfDh','5245857osscWA'];a50_0x23fb=function(){return _0x12a962;};return a50_0x23fb();}(function(_0x17f888,_0x10e8c0){const _0x2d89a6=a50_0x569d,_0x9ad6cb=_0x17f888();while(!![]){try{const _0x118280=parseInt(_0x2d89a6(0xc9))/0x1*(-parseInt(_0x2d89a6(0xc4))/0x2)+-parseInt(_0x2d89a6(0xc2))/0x3*(parseInt(_0x2d89a6(0xc6))/0x4)+parseInt(_0x2d89a6(0xbc))/0x5+-parseInt(_0x2d89a6(0xca))/0x6*(-parseInt(_0x2d89a6(0xc1))/0x7)+-parseInt(_0x2d89a6(0xbf))/0x8+-parseInt(_0x2d89a6(0xbb))/0x9+parseInt(_0x2d89a6(0xc5))/0xa*(parseInt(_0x2d89a6(0xc7))/0xb);if(_0x118280===_0x10e8c0)break;else _0x9ad6cb['push'](_0x9ad6cb['shift']());}catch(_0x2cb4e9){_0x9ad6cb['push'](_0x9ad6cb['shift']());}}}(a50_0x23fb,0xd5418));export function validateAppcode(_0x1e3a5a){const _0x2992f4=a50_0x569d,_0x2c5101=_0x1e3a5a[_0x2992f4(0xbd)]();if(!_0x2c5101)return{'valid':![],'message':'App\x20Code\x20cannot\x20be\x20empty'};if(_0x2c5101[_0x2992f4(0xc0)]>0x64)return{'valid':![],'message':_0x2992f4(0xc8)};if(!/^[A-Za-z0-9_-]+$/[_0x2992f4(0xbe)](_0x2c5101))return{'valid':![],'message':_0x2992f4(0xc3)};return{'valid':!![]};}
|