@lovrabet/rabetbase-cli 2.5.0-beta.6 → 2.5.0
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-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.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/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +1 -1
- package/skills/rabetbase.manifest.json +3 -3
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a35_0x257a(){const _0x51fc2e=['30ShouHt','length','128621XAvPOX','string','Return\x20full\x20script\x20objects','2458255kzMTjN','2297628kpRJDq','boolean','read','30099135ubFUDz','List\x20Backend\x20Function\x20scripts','name','Script\x20type\x20filter','120zaGkTQ','bool','ENDPOINT','1964322GQeSGM','14lgRaPg','map','type','str','720524xYFWJA','verbose','list','6Jxaedk','COMMON','3675648lsFbML'];a35_0x257a=function(){return _0x51fc2e;};return a35_0x257a();}const a35_0x26fa53=a35_0x2035;(function(_0x52c234,_0x364807){const _0x1ca31e=a35_0x2035,_0x5aa04c=_0x52c234();while(!![]){try{const _0xb9cd42=parseInt(_0x1ca31e(0xfe))/0x1*(parseInt(_0x1ca31e(0x10d))/0x2)+-parseInt(_0x1ca31e(0x10c))/0x3+-parseInt(_0x1ca31e(0xfb))/0x4+parseInt(_0x1ca31e(0x101))/0x5*(-parseInt(_0x1ca31e(0x114))/0x6)+-parseInt(_0x1ca31e(0x111))/0x7*(parseInt(_0x1ca31e(0x109))/0x8)+-parseInt(_0x1ca31e(0x102))/0x9*(-parseInt(_0x1ca31e(0xfc))/0xa)+parseInt(_0x1ca31e(0x105))/0xb;if(_0xb9cd42===_0x364807)break;else _0x5aa04c['push'](_0x5aa04c['shift']());}catch(_0x302eda){_0x5aa04c['push'](_0x5aa04c['shift']());}}}(a35_0x257a,0xc1a67));function a35_0x2035(_0x5e0011,_0x1ecabf){_0x5e0011=_0x5e0011-0xfb;const _0x257a8a=a35_0x257a();let _0x203588=_0x257a8a[_0x5e0011];return _0x203588;}import{listBffScripts}from'../../core/api-client.js';export const bffList={'service':'bff','command':a35_0x26fa53(0x113),'description':a35_0x26fa53(0x106),'risk':a35_0x26fa53(0x104),'flags':[{'name':a35_0x26fa53(0x10f),'type':a35_0x26fa53(0xff),'description':a35_0x26fa53(0x108),'default':a35_0x26fa53(0x10b),'enum':[a35_0x26fa53(0x10b),a35_0x26fa53(0x115)]},{'name':a35_0x26fa53(0x107),'type':'string','description':'Filter\x20by\x20script\x20name'},{'name':a35_0x26fa53(0x112),'type':a35_0x26fa53(0x103),'description':a35_0x26fa53(0x100)}],async 'execute'(_0xc5f47f){const _0x9670db=a35_0x26fa53,_0x3c667b=await listBffScripts(_0xc5f47f['appCode'],_0xc5f47f['str'](_0x9670db(0x10f)),{'scriptName':_0xc5f47f[_0x9670db(0x110)](_0x9670db(0x107))||undefined}),_0xca2e50=_0xc5f47f[_0x9670db(0x10a)]('verbose');return{'ok':!![],'data':_0xca2e50?_0x3c667b:_0x3c667b[_0x9670db(0x10e)](_0x2aa611=>({'id':_0x2aa611['id'],'functionName':_0x2aa611['functionName']??'','description':_0x2aa611['description']||'(unnamed)','scriptType':_0x2aa611['scriptType']})),'message':_0x3c667b[_0x9670db(0xfd)]===0x0?'No\x20Backend\x20Function\x20scripts\x20found.':undefined};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x11a8ee=a36_0x4c35;(function(_0x3abafd,_0x15d62d){const _0x1b4802=a36_0x4c35,_0x50a1be=_0x3abafd();while(!![]){try{const _0x4b856c=-parseInt(_0x1b4802(0x225))/0x1+parseInt(_0x1b4802(0x22e))/0x2+-parseInt(_0x1b4802(0x22b))/0x3+-parseInt(_0x1b4802(0x1f3))/0x4*(parseInt(_0x1b4802(0x20a))/0x5)+parseInt(_0x1b4802(0x1f5))/0x6+parseInt(_0x1b4802(0x1fd))/0x7*(-parseInt(_0x1b4802(0x210))/0x8)+parseInt(_0x1b4802(0x20f))/0x9*(parseInt(_0x1b4802(0x230))/0xa);if(_0x4b856c===_0x15d62d)break;else _0x50a1be['push'](_0x50a1be['shift']());}catch(_0xe0c4bd){_0x50a1be['push'](_0x50a1be['shift']());}}}(a36_0x4f82,0x907e8));import{createInterface}from'node:readline';function a36_0x4c35(_0x1f22b7,_0x16ccee){_0x1f22b7=_0x1f22b7-0x1f3;const _0x4f827f=a36_0x4f82();let _0x4c35b3=_0x4f827f[_0x1f22b7];return _0x4c35b3;}import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,ensureParentDirectory,fileExists,normalizeBffType,resolveRemoteScriptTarget}from'../../core/bff/file-system.js';import{computeContentHash,computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{CliErrors}from'../../errors.js';export const bffPull={'service':a36_0x11a8ee(0x211),'command':'pull','description':'Pull\x20remote\x20Backend\x20Function\x20scripts\x20to\x20local','risk':'read','flags':[{'name':'type','type':a36_0x11a8ee(0x235),'description':a36_0x11a8ee(0x200),'enum':[a36_0x11a8ee(0x1fa),a36_0x11a8ee(0x228),a36_0x11a8ee(0x215)]},{'name':'force','type':a36_0x11a8ee(0x204),'description':a36_0x11a8ee(0x1f7)}],async 'dryRun'(_0x32f2b4){const _0x3df29e=a36_0x11a8ee,_0x33d1b8=loadBffProjectConfig(_0x32f2b4[_0x3df29e(0x220)]),_0xdd29b2=await readBffLockFile(_0x33d1b8[_0x3df29e(0x231)]),{appLock:_0x2882ec}=ensureLockScope(_0xdd29b2??createEmptyBffLock(),_0x32f2b4[_0x3df29e(0x220)],_0x33d1b8[_0x3df29e(0x201)],_0x3df29e(0x222)),_0x25fac0=normalizeBffType(_0x32f2b4[_0x3df29e(0x1ff)]('type'))??undefined,_0x4b4dfe=buildDatasetCodeToAliasMap(_0x32f2b4[_0x3df29e(0x218)],_0x32f2b4['appCode']),[_0x5a9201,_0x43c258]=await Promise[_0x3df29e(0x236)]([listBffScripts(_0x32f2b4['appCode'],_0x25fac0),getBffScriptStatistics(_0x32f2b4[_0x3df29e(0x220)])]),_0x42e068=createHookLocationMap(_0x43c258),_0x34675e=[];for(const _0x53805b of _0x5a9201){const _0x2df931=resolveRemoteScriptTarget(_0x33d1b8,_0x53805b,_0x42e068,_0x2882ec['functions'],_0x4b4dfe);if(!_0x2df931){_0x34675e[_0x3df29e(0x22c)]({'scriptType':_0x53805b[_0x3df29e(0x213)],'functionName':_0x53805b['functionName']??'','status':_0x3df29e(0x20b),'reason':_0x3df29e(0x22a)});continue;}const _0x2a4068=_0x2882ec[_0x3df29e(0x203)][_0x2df931[_0x3df29e(0x21e)]],_0x3c7ca9=_0x53805b[_0x3df29e(0x214)]!=null?computeContentHash(_0x53805b[_0x3df29e(0x214)]):undefined,_0x3ed42b=await hasUnsyncedLocalChanges(_0x2df931['filePath'],_0x2a4068,_0x3c7ca9);_0x34675e[_0x3df29e(0x22c)]({'lockKey':_0x2df931['lockKey'],'filePath':_0x2df931[_0x3df29e(0x227)],'remoteId':_0x53805b['id']??null,'status':_0x3ed42b?_0x3df29e(0x1fc):_0x3df29e(0x20e)});}return{'method':'GET','url':_0x3df29e(0x238)+_0x32f2b4[_0x3df29e(0x220)]+(_0x25fac0?_0x3df29e(0x223)+_0x25fac0:''),'body':{'appCode':_0x32f2b4[_0x3df29e(0x220)],'filterType':_0x25fac0??null,'files':_0x34675e},'description':_0x3df29e(0x206)+_0x34675e[_0x3df29e(0x207)]+_0x3df29e(0x216)};},async 'execute'(_0x5e0ed0){const _0x2eabd5=a36_0x11a8ee,_0x4f6aff=loadBffProjectConfig(_0x5e0ed0[_0x2eabd5(0x220)]),_0x27e603=await readBffLockFile(_0x4f6aff[_0x2eabd5(0x231)]),{lockData:_0x13d86d,appLock:_0x49b946}=ensureLockScope(_0x27e603??createEmptyBffLock(),_0x5e0ed0[_0x2eabd5(0x220)],_0x4f6aff[_0x2eabd5(0x201)],_0x2eabd5(0x222)),_0xea573b=normalizeBffType(_0x5e0ed0[_0x2eabd5(0x1ff)](_0x2eabd5(0x1f4)))??undefined;if(_0x5e0ed0[_0x2eabd5(0x1ff)](_0x2eabd5(0x1f4))&&!_0xea573b)throw CliErrors[_0x2eabd5(0x202)]('--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.');const [_0x56452a,_0x2b7354]=await Promise[_0x2eabd5(0x236)]([listBffScripts(_0x5e0ed0[_0x2eabd5(0x220)],_0xea573b),getBffScriptStatistics(_0x5e0ed0[_0x2eabd5(0x220)])]);if(_0x56452a[_0x2eabd5(0x207)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x2eabd5(0x233)};const _0x13cd03=_0x5e0ed0[_0x2eabd5(0x217)](_0x2eabd5(0x21c));if(_0x13cd03&&!_0x5e0ed0['nonInteractive']){const _0x9fc4f=await confirmForce();if(!_0x9fc4f)throw CliErrors[_0x2eabd5(0x239)](_0x2eabd5(0x21b));}if(_0x13cd03&&_0x5e0ed0['nonInteractive']){}const _0xe84ab0=buildDatasetCodeToAliasMap(_0x5e0ed0[_0x2eabd5(0x218)],_0x5e0ed0[_0x2eabd5(0x220)]),_0x4bc613=createHookLocationMap(_0x2b7354),_0x4d7cd3=JSON['parse'](JSON['stringify'](_0x13d86d)),_0x283c96=_0x5e0ed0[_0x2eabd5(0x220)],_0x593555=_0x4d7cd3[_0x2eabd5(0x22f)][_0x283c96];if(!_0x593555)throw new Error(_0x2eabd5(0x237)+_0x283c96+_0x2eabd5(0x205));const _0x309e57=[],_0x28932a=[],_0x56d36a=[];for(const _0x2d5d3e of _0x56452a){const _0x17a69c=resolveRemoteScriptTarget(_0x4f6aff,_0x2d5d3e,_0x4bc613,_0x49b946[_0x2eabd5(0x203)],_0xe84ab0);if(!_0x17a69c){_0x28932a[_0x2eabd5(0x22c)]({'lockKey':_0x2d5d3e[_0x2eabd5(0x213)]+'/'+_0x2d5d3e[_0x2eabd5(0x219)],'reason':'unresolvable\x20target\x20path'});continue;}const _0xa10408=_0x49b946[_0x2eabd5(0x203)][_0x17a69c[_0x2eabd5(0x21e)]];try{if(!_0x2d5d3e['id'])throw new Error(_0x2eabd5(0x20c));if(_0x2d5d3e[_0x2eabd5(0x214)]==null)throw new Error(_0x2eabd5(0x234));const _0x552727=_0x2d5d3e[_0x2eabd5(0x214)],_0x1b0444=computeContentHash(_0x552727);if(!_0x13cd03){const _0x420e3a=await hasUnsyncedLocalChanges(_0x17a69c['filePath'],_0xa10408,_0x1b0444);if(_0x420e3a){_0x28932a[_0x2eabd5(0x22c)]({'lockKey':_0x17a69c[_0x2eabd5(0x21e)],'reason':'local\x20unsynced\x20changes'});continue;}}await ensureParentDirectory(_0x17a69c['filePath']),await writeFile(_0x17a69c[_0x2eabd5(0x227)],_0x552727,'utf8');const _0x1eec58={'hash':_0x1b0444,'remoteId':_0x2d5d3e['id'],'version':_0x2d5d3e[_0x2eabd5(0x212)]};_0x17a69c['type']===_0x2eabd5(0x215)&&_0x17a69c['hookLocation']&&(_0x1eec58[_0x2eabd5(0x21d)]=_0x17a69c[_0x2eabd5(0x224)][_0x2eabd5(0x21d)],_0x1eec58[_0x2eabd5(0x1f8)]=_0x17a69c[_0x2eabd5(0x224)][_0x2eabd5(0x1f8)],_0x1eec58[_0x2eabd5(0x1f9)]=_0x17a69c['hookLocation'][_0x2eabd5(0x1f9)],_0x1eec58['functionNode']=_0x17a69c['hookLocation']['functionNode']),_0x593555[_0x2eabd5(0x203)][_0x17a69c[_0x2eabd5(0x21e)]]=_0x1eec58,_0x309e57[_0x2eabd5(0x22c)]({'lockKey':_0x17a69c[_0x2eabd5(0x21e)],'remoteId':_0x2d5d3e['id']});}catch(_0x1e85c5){_0x56d36a['push']({'lockKey':_0x17a69c['lockKey'],'error':_0x1e85c5 instanceof Error?_0x1e85c5[_0x2eabd5(0x1fb)]:String(_0x1e85c5)});}}return _0x593555[_0x2eabd5(0x20d)]=new Date()['toISOString'](),await writeBffLockFile(_0x4f6aff[_0x2eabd5(0x231)],_0x4d7cd3),{'ok':_0x56d36a[_0x2eabd5(0x207)]===0x0,'data':{'pulled':_0x309e57,'skipped':_0x28932a,'failed':_0x56d36a},'message':'Pull\x20complete:\x20'+_0x309e57[_0x2eabd5(0x207)]+_0x2eabd5(0x21a)+_0x28932a[_0x2eabd5(0x207)]+'\x20skipped,\x20'+_0x56d36a[_0x2eabd5(0x207)]+_0x2eabd5(0x229)};}};async function hasUnsyncedLocalChanges(_0x2b87a1,_0x218763,_0x4a5ff3){const _0x3a3ccf=a36_0x11a8ee;if(!await fileExists(_0x2b87a1))return![];const _0xb86b04=await computeFileHash(_0x2b87a1);if(!_0x218763)return _0x4a5ff3?_0xb86b04!==_0x4a5ff3:!![];return _0xb86b04!==_0x218763[_0x3a3ccf(0x1f6)];}function buildDatasetCodeToAliasMap(_0x5e2567,_0x223d8d){const _0x1c2d0e=a36_0x11a8ee,_0x4857b8=loadAliasMap(_0x5e2567,undefined,resolveApiFilePath(_0x5e2567,_0x223d8d));return new Map(_0x4857b8[_0x1c2d0e(0x221)](_0x3a4d85=>[_0x3a4d85[_0x1c2d0e(0x1f8)],_0x3a4d85[_0x1c2d0e(0x21d)]]));}function a36_0x4f82(){const _0x395653=['apiDir','functionName','\x20pulled,\x20','Force\x20pull\x20cancelled.','force','alias','lockKey','stderr','appCode','map','pull','&type=','hookLocation','1115840eFUsgy','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','filePath','ENDPOINT','\x20failed','unresolvable\x20target\x20path','2993460zeKfOc','push','toLowerCase','1833474RScHfz','apps','50xigbzu','lockFilePath','includes','No\x20remote\x20Backend\x20Function\x20scripts\x20found.','Remote\x20script\x20missing\x20content.','string','all','Lock\x20scope\x20for\x20app\x20\x22','/api/management/library/scripts/list?appCode=','cancelled','232zFszTz','type','4976442Dsyptf','hash','Force\x20overwrite\x20local\x20unsynced\x20changes','datasetCode','operationType','COMMON','message','conflict','483zyYvNU','stdin','str','Pull\x20only\x20this\x20script\x20type','scriptsRoot','validation','functions','boolean','\x22\x20not\x20found\x20after\x20ensureLockScope.','Would\x20inspect\x20','length','yes','question','40620dWnfEN','skipped','Remote\x20script\x20missing\x20id.','lastSync','would_pull','3004857OdxnDL','27688BTueJV','bff','version','scriptType','scriptContent','HOOK','\x20remote\x20Backend\x20Function\x20script(s)\x20for\x20pull','bool'];a36_0x4f82=function(){return _0x395653;};return a36_0x4f82();}async function confirmForce(){const _0x326c90=a36_0x11a8ee,_0x2e17cf=createInterface({'input':process[_0x326c90(0x1fe)],'output':process[_0x326c90(0x21f)]}),_0x22fc7c=await new Promise(_0x52cf2f=>{const _0x2793f1=_0x326c90;_0x2e17cf[_0x2793f1(0x209)](_0x2793f1(0x226),_0x52cf2f);});return _0x2e17cf['close'](),['y',_0x326c90(0x208)][_0x326c90(0x232)](_0x22fc7c['trim']()[_0x326c90(0x22d)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a37_0x51d2ca=a37_0x200d;(function(_0x1e6e1a,_0x4a49cf){const _0x1cb48e=a37_0x200d,_0x544c8f=_0x1e6e1a();while(!![]){try{const _0x4ee8b6=-parseInt(_0x1cb48e(0x142))/0x1*(-parseInt(_0x1cb48e(0x14f))/0x2)+-parseInt(_0x1cb48e(0x157))/0x3*(parseInt(_0x1cb48e(0x17b))/0x4)+parseInt(_0x1cb48e(0x146))/0x5+-parseInt(_0x1cb48e(0x14a))/0x6*(parseInt(_0x1cb48e(0x16f))/0x7)+parseInt(_0x1cb48e(0x179))/0x8+-parseInt(_0x1cb48e(0x15f))/0x9+parseInt(_0x1cb48e(0x17c))/0xa;if(_0x4ee8b6===_0x4a49cf)break;else _0x544c8f['push'](_0x544c8f['shift']());}catch(_0x10737c){_0x544c8f['push'](_0x544c8f['shift']());}}}(a37_0x1f9a,0xd7044));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';function a37_0x200d(_0xb9e3c0,_0x3367e3){_0xb9e3c0=_0xb9e3c0-0x140;const _0x1f9a12=a37_0x1f9a();let _0x200ddc=_0x1f9a12[_0xb9e3c0];return _0x200ddc;}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':a37_0x51d2ca(0x144),'command':a37_0x51d2ca(0x14e),'description':a37_0x51d2ca(0x167),'risk':a37_0x51d2ca(0x183),'flags':[{'name':a37_0x51d2ca(0x189),'type':a37_0x51d2ca(0x184),'description':a37_0x51d2ca(0x173),'enum':[a37_0x51d2ca(0x178),a37_0x51d2ca(0x153),a37_0x51d2ca(0x196)]},{'name':a37_0x51d2ca(0x152),'type':a37_0x51d2ca(0x184),'description':a37_0x51d2ca(0x150)},{'name':a37_0x51d2ca(0x147),'type':a37_0x51d2ca(0x161),'description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x820cbe){const _0x30a6d4=a37_0x51d2ca,_0x3bb3af=loadBffProjectConfig(_0x820cbe['appCode']),_0x4b87ce=await readBffLockFile(_0x3bb3af[_0x30a6d4(0x169)]),{appLock:_0x4e2608}=ensureLockScope(_0x4b87ce??createEmptyBffLock(),_0x820cbe['appCode'],_0x3bb3af[_0x30a6d4(0x163)],_0x30a6d4(0x14e)),_0x473f21=await getTargetFunctions(_0x3bb3af,_0x820cbe),_0x501e83=_0x820cbe[_0x30a6d4(0x168)]('force'),_0x90eab5=[];for(const _0xa1c386 of _0x473f21){const _0x2314a8=await computeFileHash(_0xa1c386[_0x30a6d4(0x15c)]),_0x45d7a5=_0x4e2608['functions'][_0xa1c386[_0x30a6d4(0x160)]],_0x511328=!!_0x45d7a5&&_0x45d7a5[_0x30a6d4(0x170)]===_0x2314a8;_0x90eab5[_0x30a6d4(0x14e)]({'lockKey':_0xa1c386[_0x30a6d4(0x160)],'filePath':_0xa1c386[_0x30a6d4(0x15c)],'remoteId':_0x45d7a5?.[_0x30a6d4(0x15d)]??null,'mode':_0x45d7a5?.[_0x30a6d4(0x15d)]?'update':_0x30a6d4(0x18b),'status':!_0x501e83&&_0x511328?_0x30a6d4(0x141):_0x30a6d4(0x18e)});}return{'method':_0x30a6d4(0x172),'url':_0x30a6d4(0x16b),'body':{'appCode':_0x820cbe[_0x30a6d4(0x17a)],'force':_0x501e83,'files':_0x90eab5,'cacheClearAtRuntime':_0x90eab5[_0x30a6d4(0x176)](_0x132650=>_0x132650[_0x30a6d4(0x166)]===_0x30a6d4(0x18e)),'cacheClearAtRuntimeTimes':_0x90eab5[_0x30a6d4(0x176)](_0x56899b=>_0x56899b[_0x30a6d4(0x166)]===_0x30a6d4(0x18e))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x30a6d4(0x148)+_0x90eab5[_0x30a6d4(0x18a)]+_0x30a6d4(0x175)};},async 'execute'(_0x6148b2){const _0x2980db=a37_0x51d2ca,_0x41cf19=loadBffProjectConfig(_0x6148b2[_0x2980db(0x17a)]),_0x4dc125=await readBffLockFile(_0x41cf19[_0x2980db(0x169)]),{lockData:_0x75730,appLock:_0x3885dd}=ensureLockScope(_0x4dc125??createEmptyBffLock(),_0x6148b2['appCode'],_0x41cf19[_0x2980db(0x163)],_0x2980db(0x14e)),_0x5cc906=await getTargetFunctions(_0x41cf19,_0x6148b2);if(_0x5cc906[_0x2980db(0x18a)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x2980db(0x18c)};const _0x4054d1=_0x6148b2[_0x2980db(0x168)](_0x2980db(0x147)),_0x2e5f44=JSON[_0x2980db(0x162)](JSON[_0x2980db(0x149)](_0x75730)),_0x485437=_0x2e5f44[_0x2980db(0x194)][_0x6148b2[_0x2980db(0x17a)]];if(!_0x485437)throw new Error(_0x2980db(0x195)+_0x6148b2[_0x2980db(0x17a)]+_0x2980db(0x180));const _0x349c10=await buildHookMaps(_0x6148b2[_0x2980db(0x17a)],_0x6148b2[_0x2980db(0x188)],_0x5cc906,_0x485437),_0x53829a=[],_0x28e30d=[],_0x14fda5=[];for(const _0x5d40d3 of _0x5cc906){const _0x25d690=await computeFileHash(_0x5d40d3[_0x2980db(0x15c)]),_0x421c2f=_0x485437[_0x2980db(0x185)][_0x5d40d3[_0x2980db(0x160)]];if(!_0x4054d1&&_0x421c2f&&_0x421c2f[_0x2980db(0x170)]===_0x25d690){_0x28e30d['push']({'lockKey':_0x5d40d3[_0x2980db(0x160)],'reason':'unchanged'});continue;}try{await uploadSingleFunction(_0x6148b2[_0x2980db(0x17a)],_0x5d40d3,_0x485437,_0x349c10);const _0x82ea5=_0x485437['functions'][_0x5d40d3[_0x2980db(0x160)]];_0x53829a[_0x2980db(0x14e)]({'lockKey':_0x5d40d3[_0x2980db(0x160)],'remoteId':_0x82ea5?.[_0x2980db(0x15d)]??0x0});}catch(_0x5cf54f){_0x14fda5[_0x2980db(0x14e)]({'lockKey':_0x5d40d3[_0x2980db(0x160)],'error':_0x5cf54f instanceof Error?_0x5cf54f['message']:String(_0x5cf54f)});}}_0x485437['lastSync']=new Date()[_0x2980db(0x191)](),await writeBffLockFile(_0x41cf19['lockFilePath'],_0x2e5f44),await waitForUploadedLockEntries(_0x41cf19[_0x2980db(0x169)],_0x6148b2[_0x2980db(0x17a)],_0x53829a[_0x2980db(0x16a)](_0x3fb329=>_0x3fb329[_0x2980db(0x160)]));let _0x5e508b={'attempted':![],'cleared':![]};if(_0x53829a[_0x2980db(0x18a)]>0x0)try{let _0x152c79='';for(let _0x1bc719=0x0;_0x1bc719<CACHE_CLEAR_ATTEMPTS;_0x1bc719+=0x1){_0x152c79=await clearBffScriptCache(),_0x1bc719<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x5e508b={'attempted':!![],'cleared':!![],'message':_0x152c79||'Runtime\x20script\x20cache\x20cleared.'};}catch(_0x5da54b){_0x5e508b={'attempted':!![],'cleared':![],'error':_0x5da54b instanceof Error?_0x5da54b['message']:String(_0x5da54b)};}const _0xe8db9e=_0x14fda5[_0x2980db(0x18a)]===0x0&&(_0x5e508b['attempted']?_0x5e508b[_0x2980db(0x15b)]:!![]),_0x3efe95=_0x5e508b[_0x2980db(0x16e)]?_0x5e508b['cleared']?_0x2980db(0x14c):_0x2980db(0x156):_0x2980db(0x193);return{'ok':_0xe8db9e,'data':{'uploaded':_0x53829a,'skipped':_0x28e30d,'failed':_0x14fda5,'cacheClear':_0x5e508b},'message':'Push\x20complete:\x20'+_0x53829a['length']+'\x20uploaded,\x20'+_0x28e30d[_0x2980db(0x18a)]+_0x2980db(0x187)+_0x14fda5[_0x2980db(0x18a)]+_0x2980db(0x18d)+_0x3efe95};}};function a37_0x1f9a(){const _0xa09d7c=['bool','lockFilePath','map','/api/management/library/scripts/save','Run\x20`',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','attempted','56126GtajCx','hash','datasetCode','POST','Push\x20only\x20this\x20script\x20type','has','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','some','functionNode','COMMON','13536552zsDnKo','appCode','12sMLWEF','14522590QUOmsn','version','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','str','\x22\x20not\x20found\x20after\x20ensureLockScope.','script','Incomplete\x20HOOK\x20path:\x20','write','string','functions','every','\x20skipped,\x20','apiDir','type','length','create','No\x20local\x20Backend\x20Function\x20scripts\x20found.','\x20failed,\x20','would_push','Local\x20function\x20not\x20found:\x20','datasetCodeToDataset','toISOString','description','runtime\x20cache\x20not\x20needed','apps','Lock\x20scope\x20for\x20app\x20\x22','HOOK','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','unchanged','5YcBsIK','get','bff','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','185155ULsqjQ','force','Would\x20inspect\x20','stringify','630kYrnHN','join','runtime\x20cache\x20cleared','set','push','189058AkbDzk','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','alias','name','ENDPOINT','datasetId','\x22.\x20','runtime\x20cache\x20clear\x20failed','1679892qfpsgj','validation','utf8','operationType','cleared','filePath','remoteId','aliasToDatasetCode','2263626JRjiLn','lockKey','boolean','parse','scriptsRoot','values','filter','status','Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote'];a37_0x1f9a=function(){return _0xa09d7c;};return a37_0x1f9a();}async function getTargetFunctions(_0x1fbd29,_0x126b61){const _0x4051e2=a37_0x51d2ca,_0x2840dd=_0x126b61['str'](_0x4051e2(0x189)),_0x3f1336=_0x126b61[_0x4051e2(0x17f)](_0x4051e2(0x152)),_0x107a23=normalizeBffType(_0x2840dd)??undefined;if(_0x3f1336&&!_0x107a23)throw CliErrors[_0x4051e2(0x158)](_0x4051e2(0x140));const _0x49b5eb=await scanLocalBffFunctions(_0x1fbd29,_0x107a23);if(_0x3f1336){const _0x44f631=_0x49b5eb[_0x4051e2(0x165)](_0x4eee7a=>_0x4eee7a['name']===_0x3f1336);if(_0x44f631[_0x4051e2(0x18a)]===0x0)throw CliErrors['validation'](_0x4051e2(0x18f)+_0x107a23+'/'+_0x3f1336);return _0x44f631;}return _0x49b5eb;}async function buildHookMaps(_0x3b86ce,_0x7bbb83,_0x16f595,_0x2ef63a){const _0x37f5a2=a37_0x51d2ca,_0x552eb7=_0x16f595['some'](_0x588d5f=>_0x588d5f[_0x37f5a2(0x189)]===_0x37f5a2(0x196));if(!_0x552eb7)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x316c39=loadAliasMap(_0x7bbb83,undefined,resolveApiFilePath(_0x7bbb83,_0x3b86ce)),_0x4d13a6=new Map(_0x316c39[_0x37f5a2(0x16a)](_0x505d37=>[_0x505d37[_0x37f5a2(0x151)],_0x505d37[_0x37f5a2(0x171)]]));for(const _0x30fb2b of Object[_0x37f5a2(0x164)](_0x2ef63a[_0x37f5a2(0x185)])){_0x30fb2b[_0x37f5a2(0x151)]&&_0x30fb2b[_0x37f5a2(0x171)]&&!_0x4d13a6['has'](_0x30fb2b[_0x37f5a2(0x151)])&&_0x4d13a6[_0x37f5a2(0x14d)](_0x30fb2b[_0x37f5a2(0x151)],_0x30fb2b[_0x37f5a2(0x171)]);}const _0x5cf932=await listDatasets(_0x3b86ce),_0x464a15=new Map(_0x5cf932['map'](_0x5df823=>[_0x5df823['code'],_0x5df823]));return{'aliasToDatasetCode':_0x4d13a6,'datasetCodeToDataset':_0x464a15};}async function uploadSingleFunction(_0x249e64,_0x26d9dd,_0x5b4e31,_0x15fb52){const _0x49f2c8=a37_0x51d2ca,_0x3b4684=await readFile(_0x26d9dd[_0x49f2c8(0x15c)],_0x49f2c8(0x159)),_0x2527ea=await computeFileHash(_0x26d9dd[_0x49f2c8(0x15c)]),_0x2d6342=_0x5b4e31['functions'][_0x26d9dd[_0x49f2c8(0x160)]];if(_0x2d6342?.[_0x49f2c8(0x15d)]&&_0x2d6342[_0x49f2c8(0x17d)]==null)throw CliErrors[_0x49f2c8(0x158)](_0x26d9dd[_0x49f2c8(0x160)]+_0x49f2c8(0x16d));let _0x253cea=extractScriptDescription(_0x3b4684);if(!_0x253cea&&_0x2d6342?.[_0x49f2c8(0x15d)]){const _0x317d2a=await getBffScriptInfo(_0x2d6342['remoteId']);_0x253cea=_0x317d2a[_0x49f2c8(0x192)]||undefined;}const _0x2c5705={'appCode':_0x249e64,'functionName':_0x26d9dd[_0x49f2c8(0x152)],'scriptType':_0x26d9dd[_0x49f2c8(0x189)],'scriptContent':_0x3b4684};if(_0x2d6342?.['remoteId'])_0x2c5705['id']=_0x2d6342[_0x49f2c8(0x15d)];if(_0x2d6342?.['version']!=null)_0x2c5705[_0x49f2c8(0x17d)]=_0x2d6342[_0x49f2c8(0x17d)];if(_0x253cea)_0x2c5705[_0x49f2c8(0x192)]=_0x253cea;if(_0x26d9dd['type']===_0x49f2c8(0x196)){const _0xdf949d=_0x26d9dd[_0x49f2c8(0x151)];if(!_0xdf949d||!_0x26d9dd[_0x49f2c8(0x15a)]||!_0x26d9dd[_0x49f2c8(0x177)])throw CliErrors[_0x49f2c8(0x158)](_0x49f2c8(0x182)+_0x26d9dd[_0x49f2c8(0x160)]);const _0x51e454=_0x15fb52[_0x49f2c8(0x15e)]['get'](_0xdf949d)??_0x2d6342?.[_0x49f2c8(0x171)]??_0xdf949d,_0x116cc1=_0x15fb52[_0x49f2c8(0x190)]['get'](_0x51e454);if(!_0x116cc1)throw CliErrors[_0x49f2c8(0x158)]('Cannot\x20resolve\x20dataset\x20for\x20\x22'+_0xdf949d+_0x49f2c8(0x155)+(_0x49f2c8(0x16c)+CLI_BIN_NAME+_0x49f2c8(0x17e)));_0x2c5705[_0x49f2c8(0x154)]=_0x116cc1['id'],_0x2c5705[_0x49f2c8(0x15a)]=_0x26d9dd[_0x49f2c8(0x15a)],_0x2c5705[_0x49f2c8(0x177)]=_0x26d9dd[_0x49f2c8(0x177)];}const _0x1f373e=await saveBffScript(_0x2c5705),_0x5e772c=_0x1f373e['id'],_0x54797c=_0x1f373e[_0x49f2c8(0x181)]??await getBffScriptInfo(_0x5e772c),_0x4a16b2={'hash':_0x2527ea,'remoteId':_0x5e772c,'version':_0x54797c[_0x49f2c8(0x17d)]};if(_0x26d9dd['type']===_0x49f2c8(0x196)){const _0x27f009=_0x26d9dd[_0x49f2c8(0x151)],_0x5480=_0x15fb52['aliasToDatasetCode'][_0x49f2c8(0x143)](_0x27f009)??_0x2d6342?.[_0x49f2c8(0x171)]??_0x27f009;_0x15fb52[_0x49f2c8(0x15e)][_0x49f2c8(0x174)](_0x27f009)?_0x4a16b2[_0x49f2c8(0x151)]=_0x27f009:_0x4a16b2['alias']=_0x2d6342?.['alias'],_0x4a16b2[_0x49f2c8(0x171)]=_0x5480,_0x4a16b2['operationType']=_0x26d9dd[_0x49f2c8(0x15a)],_0x4a16b2[_0x49f2c8(0x177)]=_0x26d9dd[_0x49f2c8(0x177)];}_0x5b4e31[_0x49f2c8(0x185)][_0x26d9dd['lockKey']]=_0x4a16b2;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x24da50,_0x451893,_0x34774d){const _0x3cd6e3=a37_0x51d2ca;if(_0x34774d[_0x3cd6e3(0x18a)]===0x0)return;for(let _0x3766d4=0x0;_0x3766d4<LOCK_SETTLE_RETRY_COUNT;_0x3766d4+=0x1){const _0x1c2309=await readBffLockFile(_0x24da50),_0x127b03=_0x1c2309?.[_0x3cd6e3(0x194)]?.[_0x451893]?.[_0x3cd6e3(0x185)]??{},_0x50547e=_0x34774d[_0x3cd6e3(0x186)](_0x1c636f=>!!_0x127b03[_0x1c636f]?.[_0x3cd6e3(0x15d)]);if(_0x50547e)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x3cd6e3(0x145)+_0x34774d[_0x3cd6e3(0x14b)](',\x20')+'.');}
|
|
1
|
+
const a37_0x242601=a37_0x49b2;(function(_0x10b0e5,_0x2f9573){const _0x31f946=a37_0x49b2,_0x469c06=_0x10b0e5();while(!![]){try{const _0x103ad3=parseInt(_0x31f946(0xd4))/0x1*(-parseInt(_0x31f946(0xf7))/0x2)+-parseInt(_0x31f946(0x105))/0x3+parseInt(_0x31f946(0x10e))/0x4*(-parseInt(_0x31f946(0x10a))/0x5)+parseInt(_0x31f946(0xcf))/0x6+-parseInt(_0x31f946(0x111))/0x7+-parseInt(_0x31f946(0x10c))/0x8*(-parseInt(_0x31f946(0xdc))/0x9)+parseInt(_0x31f946(0xe0))/0xa;if(_0x103ad3===_0x2f9573)break;else _0x469c06['push'](_0x469c06['shift']());}catch(_0xa00b3b){_0x469c06['push'](_0x469c06['shift']());}}}(a37_0x1b3d,0xb2de6));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';function a37_0x1b3d(){const _0x1b7060=['Runtime\x20script\x20cache\x20cleared.','8698986YVoFMD','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','No\x20local\x20Backend\x20Function\x20scripts\x20found.','\x20skipped,\x20','datasetId','963887zyCgCc','stringify','filePath','get','lastSync','set','map','hash','1160955UFLAeB','filter','script','some','14145530CloWZe','message','operationType','functionNode','push','string','force','str','appCode','COMMON','alias',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','POST','status','attempted','validation','name','has','would_push','every','runtime\x20cache\x20cleared','apps','update','2qFERxO','cleared','values','Incomplete\x20HOOK\x20path:\x20','remoteId','description','apiDir','HOOK','/api/management/library/scripts/save','aliasToDatasetCode','Cannot\x20resolve\x20dataset\x20for\x20\x22','version','Force\x20push\x20ignoring\x20hash\x20protection','length','969318uJVjqe','bool','bff','join','\x22.\x20','6869440oXuDer','Push\x20complete:\x20','56heFsXB','parse','4ytrCKh','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','unchanged','2616754BSFbJo','lockKey','ENDPOINT','datasetCode','functions','lockFilePath','Push\x20only\x20this\x20script\x20type','\x22\x20not\x20found\x20after\x20ensureLockScope.','scriptsRoot','code','datasetCodeToDataset','runtime\x20cache\x20clear\x20failed','type','\x20local\x20Backend\x20Function\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','write'];a37_0x1b3d=function(){return _0x1b7060;};return a37_0x1b3d();}import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':a37_0x242601(0x107),'command':a37_0x242601(0xe4),'description':'Push\x20local\x20Backend\x20Function\x20scripts\x20to\x20remote','risk':a37_0x242601(0xcd),'flags':[{'name':'type','type':a37_0x242601(0xe5),'description':a37_0x242601(0x117),'enum':[a37_0x242601(0xe9),a37_0x242601(0x113),'HOOK']},{'name':'name','type':a37_0x242601(0xe5),'description':a37_0x242601(0xd0)},{'name':a37_0x242601(0xe6),'type':'boolean','description':a37_0x242601(0x103)}],async 'dryRun'(_0x26c3ed){const _0x4898bf=a37_0x242601,_0x2ce6e4=loadBffProjectConfig(_0x26c3ed[_0x4898bf(0xe8)]),_0x328867=await readBffLockFile(_0x2ce6e4['lockFilePath']),{appLock:_0x465fe4}=ensureLockScope(_0x328867??createEmptyBffLock(),_0x26c3ed['appCode'],_0x2ce6e4[_0x4898bf(0x119)],'push'),_0x39eb07=await getTargetFunctions(_0x2ce6e4,_0x26c3ed),_0x5a224a=_0x26c3ed[_0x4898bf(0x106)]('force'),_0xb791c=[];for(const _0x300790 of _0x39eb07){const _0xfb7d92=await computeFileHash(_0x300790[_0x4898bf(0xd6)]),_0xd38609=_0x465fe4['functions'][_0x300790[_0x4898bf(0x112)]],_0x4dd554=!!_0xd38609&&_0xd38609['hash']===_0xfb7d92;_0xb791c[_0x4898bf(0xe4)]({'lockKey':_0x300790[_0x4898bf(0x112)],'filePath':_0x300790['filePath'],'remoteId':_0xd38609?.['remoteId']??null,'mode':_0xd38609?.[_0x4898bf(0xfb)]?_0x4898bf(0xf6):'create','status':!_0x5a224a&&_0x4dd554?_0x4898bf(0x110):_0x4898bf(0xf2)});}return{'method':_0x4898bf(0xec),'url':_0x4898bf(0xff),'body':{'appCode':_0x26c3ed[_0x4898bf(0xe8)],'force':_0x5a224a,'files':_0xb791c,'cacheClearAtRuntime':_0xb791c['some'](_0x57b215=>_0x57b215[_0x4898bf(0xed)]==='would_push'),'cacheClearAtRuntimeTimes':_0xb791c[_0x4898bf(0xdf)](_0x22dd75=>_0x22dd75[_0x4898bf(0xed)]===_0x4898bf(0xf2))?CACHE_CLEAR_ATTEMPTS:0x0},'description':'Would\x20inspect\x20'+_0xb791c[_0x4898bf(0x104)]+_0x4898bf(0xcc)};},async 'execute'(_0x11a4dd){const _0x2773c7=a37_0x242601,_0x274ce3=loadBffProjectConfig(_0x11a4dd[_0x2773c7(0xe8)]),_0x5e3d7a=await readBffLockFile(_0x274ce3[_0x2773c7(0x116)]),{lockData:_0x3c5271,appLock:_0x11fddd}=ensureLockScope(_0x5e3d7a??createEmptyBffLock(),_0x11a4dd[_0x2773c7(0xe8)],_0x274ce3[_0x2773c7(0x119)],_0x2773c7(0xe4)),_0x2f5063=await getTargetFunctions(_0x274ce3,_0x11a4dd);if(_0x2f5063[_0x2773c7(0x104)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0x2773c7(0xd1)};const _0x47b896=_0x11a4dd[_0x2773c7(0x106)](_0x2773c7(0xe6)),_0x181f18=JSON[_0x2773c7(0x10d)](JSON[_0x2773c7(0xd5)](_0x3c5271)),_0x47d68c=_0x181f18[_0x2773c7(0xf5)][_0x11a4dd[_0x2773c7(0xe8)]];if(!_0x47d68c)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x11a4dd['appCode']+_0x2773c7(0x118));const _0x287a3a=await buildHookMaps(_0x11a4dd[_0x2773c7(0xe8)],_0x11a4dd[_0x2773c7(0xfd)],_0x2f5063,_0x47d68c),_0x4675cb=[],_0xf9408d=[],_0xb32920=[];for(const _0x5aa2a6 of _0x2f5063){const _0x583c1c=await computeFileHash(_0x5aa2a6[_0x2773c7(0xd6)]),_0x183cb3=_0x47d68c['functions'][_0x5aa2a6[_0x2773c7(0x112)]];if(!_0x47b896&&_0x183cb3&&_0x183cb3[_0x2773c7(0xdb)]===_0x583c1c){_0xf9408d[_0x2773c7(0xe4)]({'lockKey':_0x5aa2a6['lockKey'],'reason':_0x2773c7(0x110)});continue;}try{await uploadSingleFunction(_0x11a4dd['appCode'],_0x5aa2a6,_0x47d68c,_0x287a3a);const _0x44c896=_0x47d68c[_0x2773c7(0x115)][_0x5aa2a6['lockKey']];_0x4675cb['push']({'lockKey':_0x5aa2a6[_0x2773c7(0x112)],'remoteId':_0x44c896?.[_0x2773c7(0xfb)]??0x0});}catch(_0x3a9438){_0xb32920['push']({'lockKey':_0x5aa2a6['lockKey'],'error':_0x3a9438 instanceof Error?_0x3a9438[_0x2773c7(0xe1)]:String(_0x3a9438)});}}_0x47d68c[_0x2773c7(0xd8)]=new Date()['toISOString'](),await writeBffLockFile(_0x274ce3['lockFilePath'],_0x181f18),await waitForUploadedLockEntries(_0x274ce3[_0x2773c7(0x116)],_0x11a4dd[_0x2773c7(0xe8)],_0x4675cb[_0x2773c7(0xda)](_0x1f1254=>_0x1f1254['lockKey']));let _0x42722d={'attempted':![],'cleared':![]};if(_0x4675cb[_0x2773c7(0x104)]>0x0)try{let _0x4ea5ad='';for(let _0x450ab1=0x0;_0x450ab1<CACHE_CLEAR_ATTEMPTS;_0x450ab1+=0x1){_0x4ea5ad=await clearBffScriptCache(),_0x450ab1<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x42722d={'attempted':!![],'cleared':!![],'message':_0x4ea5ad||_0x2773c7(0xce)};}catch(_0x12138f){_0x42722d={'attempted':!![],'cleared':![],'error':_0x12138f instanceof Error?_0x12138f['message']:String(_0x12138f)};}const _0x565c01=_0xb32920[_0x2773c7(0x104)]===0x0&&(_0x42722d['attempted']?_0x42722d[_0x2773c7(0xf8)]:!![]),_0x333dfe=_0x42722d[_0x2773c7(0xee)]?_0x42722d['cleared']?_0x2773c7(0xf4):_0x2773c7(0xca):'runtime\x20cache\x20not\x20needed';return{'ok':_0x565c01,'data':{'uploaded':_0x4675cb,'skipped':_0xf9408d,'failed':_0xb32920,'cacheClear':_0x42722d},'message':_0x2773c7(0x10b)+_0x4675cb[_0x2773c7(0x104)]+'\x20uploaded,\x20'+_0xf9408d['length']+_0x2773c7(0xd2)+_0xb32920['length']+'\x20failed,\x20'+_0x333dfe};}};function a37_0x49b2(_0x16a02a,_0x2e28ba){_0x16a02a=_0x16a02a-0xca;const _0x1b3de0=a37_0x1b3d();let _0x49b2ce=_0x1b3de0[_0x16a02a];return _0x49b2ce;}async function getTargetFunctions(_0x670354,_0x33b966){const _0x41699d=a37_0x242601,_0x25a016=_0x33b966[_0x41699d(0xe7)](_0x41699d(0xcb)),_0x224c3c=_0x33b966[_0x41699d(0xe7)](_0x41699d(0xf0)),_0x543802=normalizeBffType(_0x25a016)??undefined;if(_0x224c3c&&!_0x543802)throw CliErrors[_0x41699d(0xef)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x470db1=await scanLocalBffFunctions(_0x670354,_0x543802);if(_0x224c3c){const _0x230d91=_0x470db1[_0x41699d(0xdd)](_0x2c878c=>_0x2c878c[_0x41699d(0xf0)]===_0x224c3c);if(_0x230d91['length']===0x0)throw CliErrors[_0x41699d(0xef)]('Local\x20function\x20not\x20found:\x20'+_0x543802+'/'+_0x224c3c);return _0x230d91;}return _0x470db1;}async function buildHookMaps(_0x59133c,_0x2e1c86,_0x5240b2,_0x529ed2){const _0x458d77=a37_0x242601,_0x3625cb=_0x5240b2[_0x458d77(0xdf)](_0xf03e68=>_0xf03e68[_0x458d77(0xcb)]===_0x458d77(0xfe));if(!_0x3625cb)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0xdcbba3=loadAliasMap(_0x2e1c86,undefined,resolveApiFilePath(_0x2e1c86,_0x59133c)),_0x629b18=new Map(_0xdcbba3['map'](_0x50837c=>[_0x50837c[_0x458d77(0xea)],_0x50837c[_0x458d77(0x114)]]));for(const _0x31d2b2 of Object[_0x458d77(0xf9)](_0x529ed2[_0x458d77(0x115)])){_0x31d2b2[_0x458d77(0xea)]&&_0x31d2b2[_0x458d77(0x114)]&&!_0x629b18[_0x458d77(0xf1)](_0x31d2b2[_0x458d77(0xea)])&&_0x629b18[_0x458d77(0xd9)](_0x31d2b2[_0x458d77(0xea)],_0x31d2b2[_0x458d77(0x114)]);}const _0x2a552b=await listDatasets(_0x59133c),_0x11891d=new Map(_0x2a552b[_0x458d77(0xda)](_0x594c1b=>[_0x594c1b[_0x458d77(0x11a)],_0x594c1b]));return{'aliasToDatasetCode':_0x629b18,'datasetCodeToDataset':_0x11891d};}async function uploadSingleFunction(_0x2f89f3,_0x2519a5,_0x1f6e57,_0x497853){const _0x319064=a37_0x242601,_0x323806=await readFile(_0x2519a5[_0x319064(0xd6)],'utf8'),_0x39dcac=await computeFileHash(_0x2519a5[_0x319064(0xd6)]),_0x21ede6=_0x1f6e57[_0x319064(0x115)][_0x2519a5[_0x319064(0x112)]];if(_0x21ede6?.[_0x319064(0xfb)]&&_0x21ede6['version']==null)throw CliErrors[_0x319064(0xef)](_0x2519a5[_0x319064(0x112)]+_0x319064(0xeb));let _0x38e803=extractScriptDescription(_0x323806);if(!_0x38e803&&_0x21ede6?.['remoteId']){const _0xb1a260=await getBffScriptInfo(_0x21ede6[_0x319064(0xfb)]);_0x38e803=_0xb1a260[_0x319064(0xfc)]||undefined;}const _0x3e37da={'appCode':_0x2f89f3,'functionName':_0x2519a5[_0x319064(0xf0)],'scriptType':_0x2519a5[_0x319064(0xcb)],'scriptContent':_0x323806};if(_0x21ede6?.[_0x319064(0xfb)])_0x3e37da['id']=_0x21ede6['remoteId'];if(_0x21ede6?.[_0x319064(0x102)]!=null)_0x3e37da['version']=_0x21ede6[_0x319064(0x102)];if(_0x38e803)_0x3e37da['description']=_0x38e803;if(_0x2519a5['type']===_0x319064(0xfe)){const _0x261376=_0x2519a5[_0x319064(0xea)];if(!_0x261376||!_0x2519a5['operationType']||!_0x2519a5[_0x319064(0xe3)])throw CliErrors[_0x319064(0xef)](_0x319064(0xfa)+_0x2519a5['lockKey']);const _0x5c065e=_0x497853['aliasToDatasetCode'][_0x319064(0xd7)](_0x261376)??_0x21ede6?.[_0x319064(0x114)]??_0x261376,_0x1c57a9=_0x497853[_0x319064(0x11b)][_0x319064(0xd7)](_0x5c065e);if(!_0x1c57a9)throw CliErrors['validation'](_0x319064(0x101)+_0x261376+_0x319064(0x109)+('Run\x20`'+CLI_BIN_NAME+'\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.'));_0x3e37da[_0x319064(0xd3)]=_0x1c57a9['id'],_0x3e37da[_0x319064(0xe2)]=_0x2519a5[_0x319064(0xe2)],_0x3e37da[_0x319064(0xe3)]=_0x2519a5[_0x319064(0xe3)];}const _0x175235=await saveBffScript(_0x3e37da),_0xa39d1a=_0x175235['id'],_0x5e2525=_0x175235[_0x319064(0xde)]??await getBffScriptInfo(_0xa39d1a),_0x33457b={'hash':_0x39dcac,'remoteId':_0xa39d1a,'version':_0x5e2525[_0x319064(0x102)]};if(_0x2519a5[_0x319064(0xcb)]===_0x319064(0xfe)){const _0x1bc731=_0x2519a5[_0x319064(0xea)],_0x28dbb3=_0x497853[_0x319064(0x100)][_0x319064(0xd7)](_0x1bc731)??_0x21ede6?.[_0x319064(0x114)]??_0x1bc731;_0x497853['aliasToDatasetCode'][_0x319064(0xf1)](_0x1bc731)?_0x33457b[_0x319064(0xea)]=_0x1bc731:_0x33457b[_0x319064(0xea)]=_0x21ede6?.['alias'],_0x33457b[_0x319064(0x114)]=_0x28dbb3,_0x33457b['operationType']=_0x2519a5[_0x319064(0xe2)],_0x33457b[_0x319064(0xe3)]=_0x2519a5['functionNode'];}_0x1f6e57[_0x319064(0x115)][_0x2519a5[_0x319064(0x112)]]=_0x33457b;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x16c82b,_0x264413,_0x5c2986){const _0x364823=a37_0x242601;if(_0x5c2986['length']===0x0)return;for(let _0x27ab37=0x0;_0x27ab37<LOCK_SETTLE_RETRY_COUNT;_0x27ab37+=0x1){const _0x1fbcb9=await readBffLockFile(_0x16c82b),_0x5e2b07=_0x1fbcb9?.[_0x364823(0xf5)]?.[_0x264413]?.[_0x364823(0x115)]??{},_0x2e6216=_0x5c2986[_0x364823(0xf3)](_0x1ecf8f=>!!_0x5e2b07[_0x1ecf8f]?.[_0x364823(0xfb)]);if(_0x2e6216)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x364823(0x10f)+_0x5c2986[_0x364823(0x108)](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a38_0xb2eb(_0xc2c8ae,_0x136c79){_0xc2c8ae=_0xc2c8ae-0x17f;const _0x320446=a38_0x3204();let _0xb2ebc3=_0x320446[_0xc2c8ae];return _0xb2ebc3;}const a38_0x4f2ad8=a38_0xb2eb;function a38_0x3204(){const _0x3776fe=['lockFilePath','2573068oVCzXW','\x20unchanged','488947kmnqdj','1240FzKmqR','remote','apiDir','boolean','\x20modified,\x20','bool','hash','873RQWbQJ','2vbpTeO','filePath','bff','785935WrcIXg','read','\x20remote-only','3681846bLWkxs','status','appCode','functions','scriptsRoot','length','Check\x20local\x20Backend\x20Function\x20sync\x20status\x20against\x20lock\x20file','418551xfBcMR','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','6790qbiyCF','push','118410fzRqkd','has','all','lockKey','datasetCode'];a38_0x3204=function(){return _0x3776fe;};return a38_0x3204();}(function(_0x162192,_0x307903){const _0x8991ef=a38_0xb2eb,_0x133d9a=_0x162192();while(!![]){try{const _0x10ed36=parseInt(_0x8991ef(0x186))/0x1*(parseInt(_0x8991ef(0x18f))/0x2)+parseInt(_0x8991ef(0x19c))/0x3+parseInt(_0x8991ef(0x184))/0x4+-parseInt(_0x8991ef(0x192))/0x5+parseInt(_0x8991ef(0x195))/0x6+parseInt(_0x8991ef(0x19e))/0x7*(-parseInt(_0x8991ef(0x187))/0x8)+parseInt(_0x8991ef(0x18e))/0x9*(-parseInt(_0x8991ef(0x1a0))/0xa);if(_0x10ed36===_0x307903)break;else _0x133d9a['push'](_0x133d9a['shift']());}catch(_0x50b540){_0x133d9a['push'](_0x133d9a['shift']());}}}(a38_0x3204,0x68cca));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_0x4f2ad8(0x191),'command':a38_0x4f2ad8(0x196),'description':a38_0x4f2ad8(0x19b),'risk':a38_0x4f2ad8(0x193),'flags':[{'name':'remote','type':a38_0x4f2ad8(0x18a),'description':a38_0x4f2ad8(0x19d)}],async 'execute'(_0x1041c3){const _0x51f9d1=a38_0x4f2ad8,_0xbff9c1=loadBffProjectConfig(_0x1041c3[_0x51f9d1(0x197)]),_0x5db2df=await readBffLockFile(_0xbff9c1[_0x51f9d1(0x183)]),{appLock:_0xdb59f7}=ensureLockScope(_0x5db2df??createEmptyBffLock(),_0x1041c3['appCode'],_0xbff9c1[_0x51f9d1(0x199)],_0x51f9d1(0x196)),_0xcbb2cf=await scanLocalBffFunctions(_0xbff9c1),_0x14ba9=[],_0x3f29fd=[],_0x431b6e=[];for(const _0x171bf9 of _0xcbb2cf){const _0x3eeba8=await computeFileHash(_0x171bf9[_0x51f9d1(0x190)]),_0x16b29d=_0xdb59f7[_0x51f9d1(0x198)][_0x171bf9[_0x51f9d1(0x181)]];if(!_0x16b29d)_0x14ba9['push'](_0x171bf9[_0x51f9d1(0x181)]);else _0x16b29d[_0x51f9d1(0x18d)]!==_0x3eeba8?_0x3f29fd[_0x51f9d1(0x19f)](_0x171bf9[_0x51f9d1(0x181)]):_0x431b6e['push'](_0x171bf9['lockKey']);}const _0x51a66c=[];if(_0x1041c3[_0x51f9d1(0x18c)](_0x51f9d1(0x188))){const _0x564dbf=loadAliasMap(_0x1041c3[_0x51f9d1(0x189)],undefined,resolveApiFilePath(_0x1041c3['apiDir'],_0x1041c3[_0x51f9d1(0x197)])),_0xbfabb=new Map(_0x564dbf['map'](_0x4bb5b0=>[_0x4bb5b0[_0x51f9d1(0x182)],_0x4bb5b0['alias']])),[_0x10770e,_0x4dd8c8]=await Promise[_0x51f9d1(0x180)]([listBffScripts(_0x1041c3[_0x51f9d1(0x197)]),getBffScriptStatistics(_0x1041c3[_0x51f9d1(0x197)])]),_0x292561=createHookLocationMap(_0x4dd8c8),_0x4735a7=new Set(_0xcbb2cf['map'](_0x1b4d44=>_0x1b4d44[_0x51f9d1(0x181)]));for(const _0x49ca06 of _0x10770e){const _0x71f4fa=resolveRemoteScriptTarget(_0xbff9c1,_0x49ca06,_0x292561,_0xdb59f7[_0x51f9d1(0x198)],_0xbfabb);_0x71f4fa&&!_0x4735a7[_0x51f9d1(0x17f)](_0x71f4fa['lockKey'])&&_0x51a66c[_0x51f9d1(0x19f)](_0x71f4fa[_0x51f9d1(0x181)]);}}const _0x2836e7=_0x14ba9[_0x51f9d1(0x19a)]===0x0&&_0x3f29fd[_0x51f9d1(0x19a)]===0x0&&_0x51a66c[_0x51f9d1(0x19a)]===0x0;return{'ok':!![],'data':{'added':_0x14ba9,'modified':_0x3f29fd,'unchanged':_0x431b6e,'remoteOnly':_0x51a66c},'message':_0x2836e7?'All\x20Backend\x20Function\x20scripts\x20are\x20in\x20sync.':_0x14ba9[_0x51f9d1(0x19a)]+'\x20added,\x20'+_0x3f29fd[_0x51f9d1(0x19a)]+_0x51f9d1(0x18b)+_0x431b6e[_0x51f9d1(0x19a)]+_0x51f9d1(0x185)+(_0x51a66c[_0x51f9d1(0x19a)]>0x0?',\x20'+_0x51a66c['length']+_0x51f9d1(0x194):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a39_0x37f5c2=a39_0x5850;function a39_0x5850(_0x557b78,_0x36cf11){_0x557b78=_0x557b78-0x1b0;const _0x39aa84=a39_0x39aa();let _0x585061=_0x39aa84[_0x557b78];return _0x585061;}(function(_0x5e98f6,_0x3ffd11){const _0x106713=a39_0x5850,_0xd13b00=_0x5e98f6();while(!![]){try{const _0x5e1e43=parseInt(_0x106713(0x1c7))/0x1+-parseInt(_0x106713(0x1b8))/0x2*(parseInt(_0x106713(0x1cc))/0x3)+-parseInt(_0x106713(0x1c9))/0x4*(parseInt(_0x106713(0x1b5))/0x5)+-parseInt(_0x106713(0x1c3))/0x6+-parseInt(_0x106713(0x1bd))/0x7*(-parseInt(_0x106713(0x1c4))/0x8)+parseInt(_0x106713(0x1b7))/0x9+parseInt(_0x106713(0x1cf))/0xa;if(_0x5e1e43===_0x3ffd11)break;else _0xd13b00['push'](_0xd13b00['shift']());}catch(_0x2e09ee){_0xd13b00['push'](_0xd13b00['shift']());}}}(a39_0x39aa,0x9e615));import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';function a39_0x39aa(){const _0x468f80=['Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.','205876WvIpIB','changed','4TMZhci','log',']:\x20','45579gImHQp','info','CLI\x20Built-in\x20Skill\x20','4147810BOCFaG','cli-skill-install','\x20via\x20skills@latest','unknown','nonInteractive','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','setLogPath','installedPath','1035270xxbUEv','apiError','10472760QDLjnw','112EQRLjl','code','repairCommand','\x20at\x20','skillVersion','1515752ggUgpX','inherit','install','cli-skill','pipe','\x20is\x20already\x20current','1765476XiSbBM','8tgEOJL','error'];a39_0x39aa=function(){return _0x468f80;};return a39_0x39aa();}import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a39_0x37f5c2(0x1c0),'command':a39_0x37f5c2(0x1bf),'description':a39_0x37f5c2(0x1b2),'risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0xefb43c){const _0x338af5=a39_0x37f5c2;logger[_0x338af5(0x1b3)](process['cwd']()),logger[_0x338af5(0x1cd)](_0x338af5(0x1d0),_0x338af5(0x1c6));const _0x52b4a2=installBuiltinSkill({'stdio':_0xefb43c[_0x338af5(0x1b1)]?_0x338af5(0x1c1):_0x338af5(0x1be)});if(!_0x52b4a2['ok'])throw CliErrors[_0x338af5(0x1b6)]('Built-in\x20Skill\x20install\x20failed\x20['+_0x52b4a2[_0x338af5(0x1b9)]+_0x338af5(0x1cb)+(_0x52b4a2[_0x338af5(0x1c5)]||_0x338af5(0x1b0)),'Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20'+_0x52b4a2[_0x338af5(0x1ba)]);return console[_0x338af5(0x1ca)](_0x52b4a2[_0x338af5(0x1c8)]?_0x338af5(0x1ce)+_0x52b4a2['skillVersion']+'\x20installed'+(_0x52b4a2['installedPath']?_0x338af5(0x1bb)+_0x52b4a2['installedPath']:_0x338af5(0x1d1)):_0x338af5(0x1ce)+_0x52b4a2[_0x338af5(0x1bc)]+_0x338af5(0x1c2)+(_0x52b4a2[_0x338af5(0x1b4)]?_0x338af5(0x1bb)+_0x52b4a2['installedPath']:'')),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a40_0x3f5b0d=a40_0x4d40;(function(_0x3b7e36,_0x2f9911){const _0x136cbc=a40_0x4d40,_0x45ad3b=_0x3b7e36();while(!![]){try{const _0x10953a=-parseInt(_0x136cbc(0xba))/0x1*(parseInt(_0x136cbc(0xab))/0x2)+-parseInt(_0x136cbc(0xd6))/0x3*(parseInt(_0x136cbc(0x9b))/0x4)+-parseInt(_0x136cbc(0xcc))/0x5*(parseInt(_0x136cbc(0xb7))/0x6)+parseInt(_0x136cbc(0xbe))/0x7+parseInt(_0x136cbc(0xc2))/0x8+parseInt(_0x136cbc(0xdd))/0x9+parseInt(_0x136cbc(0xbc))/0xa;if(_0x10953a===_0x2f9911)break;else _0x45ad3b['push'](_0x45ad3b['shift']());}catch(_0x320573){_0x45ad3b['push'](_0x45ad3b['shift']());}}}(a40_0x1f70,0x99b0c));import a40_0x4a8031 from'chalk';import a40_0x16641d from'ora';import a40_0x43f7bd 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';function a40_0x1f70(){const _0x4148b0=['Update\x20available:\x20','string','@latest','4997176UEISpu','beta','version','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag',',\x20found\x20','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','/dist-tags','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','fail','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','12415Hiqdff','bool','Already\x20up\x20to\x20date\x20(v','...','Version\x20comparison\x20failed','gray','update','state','Requested\x20version:\x20',']:\x20','14631CuqBEP','Invalid\x20version:\x20','warn','\x20install\x20-g\x20','includes','pipe','object','9834417uKfjcv','\x20is\x20up\x20to\x20date.','message','fromEntries','read','Updated\x20to\x20v','https://registry.npmjs.org/-/package/','succeed','current','skillVersion','code','Current\x20version\x20v','filter','install','\x20→\x20','\x20cli-skill\x20install','\x20\x20Run\x20manually:\x20','\x20is\x20newer\x20than\x20npm\x20latest\x20v','entries','repairCommand','520tfDfvF','validation','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','str','Beta\x20version:\x20','trim','slice','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','start','Current\x20version:\x20','valid','Updating\x20via\x20','log','timeout','run','\x20\x20CLI\x20Built-in\x20Skill\x20','766acoibm','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','source','green','red','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','yellow','latest','json','\x20\x20Try\x20manually:\x20','Update\x20failed','npm','2748QqlWTQ','info','unknown','968jPOSiE','Checking\x20for\x20updates...','8564000zrGtzf','boolean','1384068aDRzeG'];a40_0x1f70=function(){return _0x4148b0;};return a40_0x1f70();}import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x1868e8=a40_0x4d40;return GIT_COMMIT!==_0x1868e8(0xb9)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x1868e8(0xa1)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x490a94=a40_0x4d40,_0x22ee94=process['execPath']['toLowerCase']();if(_0x22ee94[_0x490a94(0xda)]('bun'))return'bun';return _0x490a94(0xb6);}const updateFlags=[{'name':'beta','type':a40_0x3f5b0d(0xbd),'description':a40_0x3f5b0d(0xc5),'default':![]},{'name':a40_0x3f5b0d(0xc4),'type':a40_0x3f5b0d(0xc0),'description':'Install\x20a\x20specific\x20CLI\x20version'}];function getRequestedVersion(_0x4df23b){const _0x3ec33b=a40_0x3f5b0d;return _0x4df23b[_0x3ec33b(0x9e)](_0x3ec33b(0xc4))[_0x3ec33b(0xa0)]();}async function validateUpdateFlags(_0x16d1bd){const _0x21c7e9=a40_0x3f5b0d,_0x458481=_0x16d1bd['bool'](_0x21c7e9(0xc3)),_0x5202f2=getRequestedVersion(_0x16d1bd);if(_0x458481&&_0x5202f2)throw CliErrors[_0x21c7e9(0x9c)](_0x21c7e9(0x9d),'Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.');if(_0x5202f2&&!a40_0x43f7bd[_0x21c7e9(0xa5)](_0x5202f2))throw CliErrors[_0x21c7e9(0x9c)](_0x21c7e9(0xd7)+_0x5202f2,_0x21c7e9(0xc9));}async function fetchNpmDistTags(){const _0x3ab091=a40_0x3f5b0d;try{const _0x4e09c1=await fetch(_0x3ab091(0xe3)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x3ab091(0xc8),{'signal':AbortSignal[_0x3ab091(0xa8)](0x2710)});if(!_0x4e09c1['ok'])return null;const _0x19f73d=await _0x4e09c1[_0x3ab091(0xb3)]();if(!_0x19f73d||typeof _0x19f73d!==_0x3ab091(0xdc))return null;return Object[_0x3ab091(0xe0)](Object[_0x3ab091(0x99)](_0x19f73d)[_0x3ab091(0xe9)](([,_0x7c0111])=>typeof _0x7c0111==='string'&&_0x7c0111[_0x3ab091(0xa0)]()['length']>0x0)['map'](([_0x1a7822,_0x353bc3])=>[_0x1a7822,String(_0x353bc3)[_0x3ab091(0xa0)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x5df1b7){const _0x410331=await fetchNpmDistTags();return _0x410331?.[_0x5df1b7]??null;}async function fetchLatestVersion(){const _0x1e37fd=a40_0x3f5b0d;return fetchNpmDistTagVersion(_0x1e37fd(0xb2));}function a40_0x4d40(_0x1bb79a,_0x5190b4){_0x1bb79a=_0x1bb79a-0x98;const _0x1f7096=a40_0x1f70();let _0x4d4072=_0x1f7096[_0x1bb79a];return _0x4d4072;}async function resolveTargetVersion(_0x29211d){const _0x3cce3b=a40_0x3f5b0d,_0x48802a=getRequestedVersion(_0x29211d);if(_0x48802a)return{'version':_0x48802a,'source':_0x3cce3b(0xc4)};if(_0x29211d[_0x3cce3b(0xcd)](_0x3cce3b(0xc3))){const _0x207c02=await fetchNpmDistTagVersion(_0x3cce3b(0xc3));if(!_0x207c02)return null;return{'version':_0x207c02,'source':_0x3cce3b(0xc3)};}const _0x2a9887=await fetchLatestVersion();if(!_0x2a9887)return null;return{'version':_0x2a9887,'source':_0x3cce3b(0xb2)};}function shouldInstallTarget(_0x281c65,_0x3362ba){const _0xe3a908=a40_0x3f5b0d;if(_0x3362ba['source']==='version'||_0x3362ba[_0xe3a908(0xad)]===_0xe3a908(0xc3))return!a40_0x43f7bd['eq'](_0x281c65,_0x3362ba[_0xe3a908(0xc4)]);return a40_0x43f7bd['lt'](_0x281c65,_0x3362ba['version']);}function getInstallPlanLabel(_0x475822,_0x2d22c6){const _0x175cac=a40_0x3f5b0d;switch(_0x2d22c6[_0x175cac(0xad)]){case _0x175cac(0xc3):return _0x175cac(0x9f)+a40_0x4a8031['yellow'](_0x475822)+_0x175cac(0xeb)+a40_0x4a8031[_0x175cac(0xae)](_0x2d22c6[_0x175cac(0xc4)]);case _0x175cac(0xc4):return _0x175cac(0xd4)+a40_0x4a8031[_0x175cac(0xb1)](_0x475822)+_0x175cac(0xeb)+a40_0x4a8031[_0x175cac(0xae)](_0x2d22c6[_0x175cac(0xc4)]);case _0x175cac(0xb2):default:return _0x175cac(0xbf)+a40_0x4a8031[_0x175cac(0xb1)](_0x475822)+_0x175cac(0xeb)+a40_0x4a8031[_0x175cac(0xae)](_0x2d22c6['version']);}}function repairCurrentBuiltinSkill(){const _0x1bf887=a40_0x3f5b0d;console[_0x1bf887(0xa7)](a40_0x4a8031[_0x1bf887(0xd1)]('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x1103af=installBuiltinSkill();if(_0x1103af['ok'])return console[_0x1bf887(0xa7)](a40_0x4a8031[_0x1bf887(0xd1)](_0x1bf887(0xaa)+_0x1103af[_0x1bf887(0xe6)]+_0x1bf887(0xde))),!![];return console[_0x1bf887(0xd8)](a40_0x4a8031[_0x1bf887(0xb1)]('\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20['+_0x1103af[_0x1bf887(0xe7)]+_0x1bf887(0xd5)+(_0x1103af['error']||_0x1bf887(0xb9)))),console['log'](a40_0x4a8031[_0x1bf887(0xd1)](_0x1bf887(0xed)+CLI_BIN_NAME+_0x1bf887(0xec))),![];}function verifyUpdatedBuiltinSkill(_0x1a7d22){const _0x56fcda=a40_0x3f5b0d,_0x29ade5=inspectInstalledBuiltinSkillVersion(_0x1a7d22);if(_0x29ade5[_0x56fcda(0xd3)]===_0x56fcda(0xe5))return console[_0x56fcda(0xa7)](a40_0x4a8031['gray'](_0x56fcda(0xaa)+_0x1a7d22+_0x56fcda(0xde))),!![];const _0x2b5540=_0x29ade5['skillVersion']?'expected\x20'+_0x1a7d22+_0x56fcda(0xc6)+_0x29ade5[_0x56fcda(0xe6)]:'expected\x20'+_0x1a7d22+',\x20state\x20'+_0x29ade5[_0x56fcda(0xd3)];return console[_0x56fcda(0xd8)](a40_0x4a8031[_0x56fcda(0xb1)]('\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20'+_0x2b5540)),console[_0x56fcda(0xa7)](a40_0x4a8031[_0x56fcda(0xd1)]('\x20\x20Run\x20manually:\x20'+_0x29ade5[_0x56fcda(0x9a)])),![];}async function execute(_0xe4e03d){const _0x5b056e=a40_0x3f5b0d;await validateUpdateFlags(_0xe4e03d);const _0x3e13c0=getCurrentVersion();console[_0x5b056e(0xa7)](_0x5b056e(0xa4)+_0x3e13c0);const _0x5504b8=a40_0x16641d(_0x5b056e(0xbb))[_0x5b056e(0xa3)](),_0x4b6435=await resolveTargetVersion(_0xe4e03d);if(!_0x4b6435){const _0x430467=_0xe4e03d['bool'](_0x5b056e(0xc3))?_0x5b056e(0xa2):_0x5b056e(0xb0);return _0x5504b8['fail'](_0x430467),console[_0x5b056e(0xa7)](a40_0x4a8031[_0x5b056e(0xd1)](_0x5b056e(0xc7)+NPM_PACKAGE_NAME+_0x5b056e(0xc1))),{'ok':![],'message':_0x430467};}const _0x18ec46=a40_0x43f7bd['valid'](VERSION),_0x4c2fb2=a40_0x43f7bd[_0x5b056e(0xa5)](_0x4b6435[_0x5b056e(0xc4)]);if(!_0x18ec46||!_0x4c2fb2)return _0x5504b8[_0x5b056e(0xca)](_0x5b056e(0xd0)),{'ok':![],'message':_0x5b056e(0xd0)};if(!shouldInstallTarget(_0x18ec46,_0x4b6435)){const _0xc3a22b=_0x4b6435[_0x5b056e(0xad)]==='version'?'Already\x20on\x20requested\x20version\x20(v'+_0x4b6435[_0x5b056e(0xc4)]+')':a40_0x43f7bd['gt'](_0x18ec46,_0x4c2fb2)?_0x5b056e(0xe8)+_0x3e13c0+_0x5b056e(0x98)+_0x4b6435[_0x5b056e(0xc4)]:_0x5b056e(0xce)+_0x4b6435[_0x5b056e(0xc4)]+')';return _0x5504b8[_0x5b056e(0xe4)](_0xc3a22b),{'ok':repairCurrentBuiltinSkill()};}_0x5504b8[_0x5b056e(0xb8)](getInstallPlanLabel(_0x3e13c0,_0x4b6435));const _0x382bcd=detectPackageManager(),_0x17f9de=_0x382bcd==='npm'?resolveNpmBin('npm'):_0x382bcd,_0x116696=a40_0x16641d(_0x5b056e(0xa6)+_0x382bcd+_0x5b056e(0xcf))[_0x5b056e(0xa3)]();try{return await execa(_0x17f9de,[_0x5b056e(0xea),'-g',NPM_PACKAGE_NAME+'@'+_0x4b6435[_0x5b056e(0xc4)]],{'stdio':_0x5b056e(0xdb)}),_0x116696['succeed'](_0x5b056e(0xe2)+_0x4b6435[_0x5b056e(0xc4)]),console['log'](a40_0x4a8031['gray'](_0x5b056e(0xac))),{'ok':verifyUpdatedBuiltinSkill(_0x4b6435[_0x5b056e(0xc4)])};}catch(_0x2ec4a6){return _0x116696[_0x5b056e(0xca)](_0x5b056e(0xb5)),console['error'](a40_0x4a8031[_0x5b056e(0xaf)]('\x20\x20'+_0x2ec4a6[_0x5b056e(0xdf)])),console[_0x5b056e(0xa7)](a40_0x4a8031[_0x5b056e(0xd1)](_0x5b056e(0xb4)+_0x382bcd+_0x5b056e(0xd9)+NPM_PACKAGE_NAME+'@'+_0x4b6435[_0x5b056e(0xc4)])),{'ok':![],'message':_0x2ec4a6['message']};}}export const updateDefinition={'service':a40_0x3f5b0d(0xd2),'command':a40_0x3f5b0d(0xa9),'description':a40_0x3f5b0d(0xcb),'risk':a40_0x3f5b0d(0xe1),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a40_0x76add2=a40_0x3013;(function(_0x40d696,_0x2b4056){const _0x26a307=a40_0x3013,_0x131b53=_0x40d696();while(!![]){try{const _0x365c55=parseInt(_0x26a307(0x106))/0x1*(parseInt(_0x26a307(0x11b))/0x2)+-parseInt(_0x26a307(0x12c))/0x3+-parseInt(_0x26a307(0x136))/0x4*(parseInt(_0x26a307(0x110))/0x5)+parseInt(_0x26a307(0x10d))/0x6+-parseInt(_0x26a307(0x120))/0x7+parseInt(_0x26a307(0xf5))/0x8+-parseInt(_0x26a307(0xef))/0x9*(-parseInt(_0x26a307(0x104))/0xa);if(_0x365c55===_0x2b4056)break;else _0x131b53['push'](_0x131b53['shift']());}catch(_0x3cbe22){_0x131b53['push'](_0x131b53['shift']());}}}(a40_0x105d,0xc1de2));import a40_0x429607 from'chalk';function a40_0x3013(_0x36ec23,_0x3bffc7){_0x36ec23=_0x36ec23-0xec;const _0x105d14=a40_0x105d();let _0x301382=_0x105d14[_0x36ec23];return _0x301382;}import a40_0x1f1d24 from'ora';import a40_0x1fa3ff from'semver';import{execa}from'execa';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{VERSION,GIT_COMMIT,BUILD_TIME}from'../generated/build-info.js';import{CliErrors}from'../errors.js';import{inspectInstalledBuiltinSkillVersion,installBuiltinSkill}from'../skills/builtin-skill.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x4ddcde=a40_0x3013;return GIT_COMMIT!==_0x4ddcde(0x116)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME['slice'](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x357790=a40_0x3013,_0x5be328=process[_0x357790(0x102)][_0x357790(0xfb)]();if(_0x5be328[_0x357790(0x125)](_0x357790(0x11e)))return _0x357790(0x11e);return _0x357790(0x100);}const updateFlags=[{'name':a40_0x76add2(0x126),'type':a40_0x76add2(0xee),'description':a40_0x76add2(0x12f),'default':![]},{'name':a40_0x76add2(0xfa),'type':'string','description':a40_0x76add2(0x121)}];function getRequestedVersion(_0x56ea7f){const _0x203c00=a40_0x76add2;return _0x56ea7f[_0x203c00(0x105)](_0x203c00(0xfa))['trim']();}async function validateUpdateFlags(_0x4e2f18){const _0x27dc00=a40_0x76add2,_0x54033b=_0x4e2f18[_0x27dc00(0xfd)](_0x27dc00(0x126)),_0x97be2d=getRequestedVersion(_0x4e2f18);if(_0x54033b&&_0x97be2d)throw CliErrors[_0x27dc00(0x133)](_0x27dc00(0x11f),_0x27dc00(0x115));if(_0x97be2d&&!a40_0x1fa3ff[_0x27dc00(0xf2)](_0x97be2d))throw CliErrors[_0x27dc00(0x133)]('Invalid\x20version:\x20'+_0x97be2d,_0x27dc00(0x135));}async function fetchNpmDistTags(){const _0x158d3a=a40_0x76add2;try{const _0x214490=await fetch(_0x158d3a(0x128)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x158d3a(0x12a),{'signal':AbortSignal['timeout'](0x2710)});if(!_0x214490['ok'])return null;const _0x221599=await _0x214490['json']();if(!_0x221599||typeof _0x221599!=='object')return null;return Object['fromEntries'](Object[_0x158d3a(0x118)](_0x221599)[_0x158d3a(0xfc)](([,_0x41456c])=>typeof _0x41456c===_0x158d3a(0xf8)&&_0x41456c[_0x158d3a(0x138)]()[_0x158d3a(0x123)]>0x0)['map'](([_0x56425e,_0x32faec])=>[_0x56425e,String(_0x32faec)[_0x158d3a(0x138)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x1a0129){const _0x4156fc=await fetchNpmDistTags();return _0x4156fc?.[_0x1a0129]??null;}async function fetchLatestVersion(){const _0x4cfbf3=a40_0x76add2;return fetchNpmDistTagVersion(_0x4cfbf3(0xf6));}async function resolveTargetVersion(_0x3d844a){const _0x3f2706=a40_0x76add2,_0x4e9859=getRequestedVersion(_0x3d844a);if(_0x4e9859)return{'version':_0x4e9859,'source':_0x3f2706(0xfa)};if(_0x3d844a[_0x3f2706(0xfd)]('beta')){const _0x3ac927=await fetchNpmDistTagVersion('beta');if(!_0x3ac927)return null;return{'version':_0x3ac927,'source':_0x3f2706(0x126)};}const _0x5e23b2=await fetchLatestVersion();if(!_0x5e23b2)return null;return{'version':_0x5e23b2,'source':_0x3f2706(0xf6)};}function shouldInstallTarget(_0x250a45,_0x1683ab){const _0x4a2e38=a40_0x76add2;if(_0x1683ab[_0x4a2e38(0x132)]===_0x4a2e38(0xfa)||_0x1683ab[_0x4a2e38(0x132)]===_0x4a2e38(0x126))return!a40_0x1fa3ff['eq'](_0x250a45,_0x1683ab[_0x4a2e38(0xfa)]);return a40_0x1fa3ff['lt'](_0x250a45,_0x1683ab['version']);}function a40_0x105d(){const _0x4f16e7=['toLowerCase','filter','bool','Version\x20comparison\x20failed','Current\x20version\x20v','npm','run','execPath','\x20\x20Try\x20manually:\x20','20oERlKN','str','289ZykWZY','start','install','error','log','yellow','Checking\x20CLI\x20Built-in\x20Skill...','6792360Vlvqps','Requested\x20version:\x20','Update\x20failed','4147510zbJKhz','\x20install\x20-g\x20','repairCommand','\x20is\x20newer\x20than\x20npm\x20latest\x20v','\x20is\x20up\x20to\x20date.','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','unknown','message','entries','current','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','8470yOjTXS','...','gray','bun','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','8562890pStkcA','Install\x20a\x20specific\x20CLI\x20version','code','length','succeed','includes','beta','\x20\x20CLI\x20Built-in\x20Skill\x20','https://registry.npmjs.org/-/package/','Beta\x20version:\x20','/dist-tags','Already\x20on\x20requested\x20version\x20(v','3553035WXSjjm','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm',',\x20state\x20','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20','skillVersion','source','validation',',\x20found\x20','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','4aFhfMh','update','trim','warn','expected\x20','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','\x20→\x20','green','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','boolean','5085504umfpsu','fail','Current\x20version:\x20','valid','red','state','4360896NtmZRP','latest','\x20cli-skill\x20install','string','\x20\x20Run\x20manually:\x20','version'];a40_0x105d=function(){return _0x4f16e7;};return a40_0x105d();}function getInstallPlanLabel(_0x166bba,_0x3d84a4){const _0xb55fae=a40_0x76add2;switch(_0x3d84a4[_0xb55fae(0x132)]){case _0xb55fae(0x126):return _0xb55fae(0x129)+a40_0x429607[_0xb55fae(0x10b)](_0x166bba)+_0xb55fae(0x13c)+a40_0x429607['green'](_0x3d84a4[_0xb55fae(0xfa)]);case _0xb55fae(0xfa):return _0xb55fae(0x10e)+a40_0x429607['yellow'](_0x166bba)+_0xb55fae(0x13c)+a40_0x429607['green'](_0x3d84a4[_0xb55fae(0xfa)]);case _0xb55fae(0xf6):default:return'Update\x20available:\x20'+a40_0x429607['yellow'](_0x166bba)+_0xb55fae(0x13c)+a40_0x429607[_0xb55fae(0x13d)](_0x3d84a4[_0xb55fae(0xfa)]);}}function repairCurrentBuiltinSkill(){const _0x59615f=a40_0x76add2;console[_0x59615f(0x10a)](a40_0x429607[_0x59615f(0x11d)](_0x59615f(0x10c)));const _0x562a6f=installBuiltinSkill();if(_0x562a6f['ok'])return console[_0x59615f(0x10a)](a40_0x429607['gray']('\x20\x20CLI\x20Built-in\x20Skill\x20'+_0x562a6f['skillVersion']+_0x59615f(0x114))),!![];return console[_0x59615f(0x139)](a40_0x429607[_0x59615f(0x10b)](_0x59615f(0x11a)+_0x562a6f[_0x59615f(0x122)]+']:\x20'+(_0x562a6f['error']||_0x59615f(0x116)))),console['log'](a40_0x429607[_0x59615f(0x11d)](_0x59615f(0xf9)+CLI_BIN_NAME+_0x59615f(0xf7))),![];}function verifyUpdatedBuiltinSkill(_0x45aa98){const _0x4163e5=a40_0x76add2,_0x2c5c99=inspectInstalledBuiltinSkillVersion(_0x45aa98);if(_0x2c5c99[_0x4163e5(0xf4)]===_0x4163e5(0x119))return console[_0x4163e5(0x10a)](a40_0x429607['gray'](_0x4163e5(0x127)+_0x45aa98+_0x4163e5(0x114))),!![];const _0x37fa8a=_0x2c5c99[_0x4163e5(0x131)]?_0x4163e5(0x13a)+_0x45aa98+_0x4163e5(0x134)+_0x2c5c99['skillVersion']:_0x4163e5(0x13a)+_0x45aa98+_0x4163e5(0x12e)+_0x2c5c99[_0x4163e5(0xf4)];return console['warn'](a40_0x429607[_0x4163e5(0x10b)](_0x4163e5(0x130)+_0x37fa8a)),console[_0x4163e5(0x10a)](a40_0x429607['gray']('\x20\x20Run\x20manually:\x20'+_0x2c5c99[_0x4163e5(0x112)])),![];}async function execute(_0x46775f){const _0x4093a2=a40_0x76add2;await validateUpdateFlags(_0x46775f);const _0x3edbcf=getCurrentVersion();console['log'](_0x4093a2(0xf1)+_0x3edbcf);const _0x447ae1=a40_0x1f1d24('Checking\x20for\x20updates...')[_0x4093a2(0x107)](),_0x428120=await resolveTargetVersion(_0x46775f);if(!_0x428120){const _0x2ada5b=_0x46775f[_0x4093a2(0xfd)]('beta')?_0x4093a2(0x12d):_0x4093a2(0xec);return _0x447ae1[_0x4093a2(0xf0)](_0x2ada5b),console['log'](a40_0x429607[_0x4093a2(0x11d)](_0x4093a2(0x13b)+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x2ada5b};}const _0x212757=a40_0x1fa3ff[_0x4093a2(0xf2)](VERSION),_0xdbd350=a40_0x1fa3ff['valid'](_0x428120[_0x4093a2(0xfa)]);if(!_0x212757||!_0xdbd350)return _0x447ae1['fail'](_0x4093a2(0xfe)),{'ok':![],'message':_0x4093a2(0xfe)};if(!shouldInstallTarget(_0x212757,_0x428120)){const _0x447986=_0x428120[_0x4093a2(0x132)]===_0x4093a2(0xfa)?_0x4093a2(0x12b)+_0x428120[_0x4093a2(0xfa)]+')':a40_0x1fa3ff['gt'](_0x212757,_0xdbd350)?_0x4093a2(0xff)+_0x3edbcf+_0x4093a2(0x113)+_0x428120[_0x4093a2(0xfa)]:'Already\x20up\x20to\x20date\x20(v'+_0x428120[_0x4093a2(0xfa)]+')';return _0x447ae1[_0x4093a2(0x124)](_0x447986),{'ok':repairCurrentBuiltinSkill()};}_0x447ae1['info'](getInstallPlanLabel(_0x3edbcf,_0x428120));const _0x9d44fb=detectPackageManager(),_0x411c8c=_0x9d44fb===_0x4093a2(0x100)?resolveNpmBin(_0x4093a2(0x100)):_0x9d44fb,_0x398d9c=a40_0x1f1d24('Updating\x20via\x20'+_0x9d44fb+_0x4093a2(0x11c))[_0x4093a2(0x107)]();try{return await execa(_0x411c8c,[_0x4093a2(0x108),'-g',NPM_PACKAGE_NAME+'@'+_0x428120[_0x4093a2(0xfa)]],{'stdio':'pipe'}),_0x398d9c[_0x4093a2(0x124)]('Updated\x20to\x20v'+_0x428120[_0x4093a2(0xfa)]),console[_0x4093a2(0x10a)](a40_0x429607[_0x4093a2(0x11d)](_0x4093a2(0xed))),{'ok':verifyUpdatedBuiltinSkill(_0x428120['version'])};}catch(_0x59f4fa){return _0x398d9c[_0x4093a2(0xf0)](_0x4093a2(0x10f)),console[_0x4093a2(0x109)](a40_0x429607[_0x4093a2(0xf3)]('\x20\x20'+_0x59f4fa[_0x4093a2(0x117)])),console[_0x4093a2(0x10a)](a40_0x429607[_0x4093a2(0x11d)](_0x4093a2(0x103)+_0x9d44fb+_0x4093a2(0x111)+NPM_PACKAGE_NAME+'@'+_0x428120[_0x4093a2(0xfa)])),{'ok':![],'message':_0x59f4fa['message']};}}export const updateDefinition={'service':a40_0x76add2(0x137),'command':a40_0x76add2(0x101),'description':'Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','risk':'read','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x448752,_0x204c15){const _0x65b0ed=a41_0x4dce,_0x44330b=_0x448752();while(!![]){try{const _0x5cd386=-parseInt(_0x65b0ed(0x1d4))/0x1*(-parseInt(_0x65b0ed(0x1cb))/0x2)+parseInt(_0x65b0ed(0x1cd))/0x3+parseInt(_0x65b0ed(0x1d0))/0x4*(parseInt(_0x65b0ed(0x1d1))/0x5)+-parseInt(_0x65b0ed(0x1ce))/0x6*(parseInt(_0x65b0ed(0x1d5))/0x7)+-parseInt(_0x65b0ed(0x1cf))/0x8*(-parseInt(_0x65b0ed(0x1ca))/0x9)+-parseInt(_0x65b0ed(0x1d3))/0xa+parseInt(_0x65b0ed(0x1d2))/0xb*(-parseInt(_0x65b0ed(0x1cc))/0xc);if(_0x5cd386===_0x204c15)break;else _0x44330b['push'](_0x44330b['shift']());}catch(_0x5dc1ca){_0x44330b['push'](_0x44330b['shift']());}}}(a41_0x5dd8,0x33e03));import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';function a41_0x5dd8(){const _0x2b53f3=['4XUbhye','2412rXUAEH','1005135SwZVNW','486uxEzRR','8GtgFMx','4MASIMD','889165gHmitZ','23771gnOkVd','1075180LlGTJI','123629LUVyBv','7231zZIaWk','701091kXWJNL'];a41_0x5dd8=function(){return _0x2b53f3;};return a41_0x5dd8();}function a41_0x4dce(_0x5408b1,_0x12dafe){_0x5408b1=_0x5408b1-0x1ca;const _0x5dd8e9=a41_0x5dd8();let _0x4dcea9=_0x5dd8e9[_0x5408b1];return _0x4dcea9;}export const codegenDefinitions=[codegenSdk,codegenSql];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x2d56df=a42_0xedd3;(function(_0x2a207d,_0xeb2d0e){const _0xa38584=a42_0xedd3,_0x213ee6=_0x2a207d();while(!![]){try{const _0x22ac78=-parseInt(_0xa38584(0x10f))/0x1+-parseInt(_0xa38584(0x10b))/0x2+-parseInt(_0xa38584(0x113))/0x3+-parseInt(_0xa38584(0x114))/0x4*(-parseInt(_0xa38584(0x118))/0x5)+parseInt(_0xa38584(0x109))/0x6+parseInt(_0xa38584(0x115))/0x7+parseInt(_0xa38584(0x10d))/0x8;if(_0x22ac78===_0xeb2d0e)break;else _0x213ee6['push'](_0x213ee6['shift']());}catch(_0x77741b){_0x213ee6['push'](_0x213ee6['shift']());}}}(a42_0x50c3,0x4f19d));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';function a42_0x50c3(){const _0x385a0d=['str','1214430ogXHtn','alias','11939976UwXwJx','codegen','489036ZLXzyI','Omit\x20import\x20statements\x20from\x20generated\x20code','skip-imports','Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)','924030KETrHk','235772UQBMfI','21742eNZUAN','sdk','operation','5ZIWOPY','boolean','code','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)','appCode','bool','1042272wDxzzr'];a42_0x50c3=function(){return _0x385a0d;};return a42_0x50c3();}import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a42_0xedd3(_0x5ad668,_0x39408e){_0x5ad668=_0x5ad668-0x107;const _0x50c31e=a42_0x50c3();let _0xedd3ea=_0x50c31e[_0x5ad668];return _0xedd3ea;}export const codegenSdk={'service':a42_0x2d56df(0x10e),'command':a42_0x2d56df(0x116),'description':a42_0x2d56df(0x11b),'risk':'read','flags':[CODE_FLAG_OPTIONAL,{'name':a42_0x2d56df(0x10c),'type':'string','description':a42_0x2d56df(0x11c)},{'name':a42_0x2d56df(0x117),'type':'string','required':!![],'description':a42_0x2d56df(0x112)},{'name':a42_0x2d56df(0x111),'type':a42_0x2d56df(0x119),'description':a42_0x2d56df(0x110)}],async 'execute'(_0x589ad1){const _0x61789b=a42_0x2d56df,{dataset:_0x1741af,operation:_0x246c3d}=await getOperationDetail(_0x589ad1[_0x61789b(0x107)],_0x589ad1['str'](_0x61789b(0x11a)),_0x589ad1[_0x61789b(0x10a)](_0x61789b(0x117))),_0x3dc5b3=generateSdkCode(_0x1741af,_0x246c3d,{'includeImports':!_0x589ad1[_0x61789b(0x108)](_0x61789b(0x111))});return{'ok':!![],'data':{'dataset':{'name':_0x1741af['name'],'code':_0x1741af['code'],'tableName':_0x1741af['tableName']},'operation':_0x589ad1[_0x61789b(0x10a)]('operation'),'code':_0x3dc5b3}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0xf5ff99=a43_0xed68;(function(_0x94ee4e,_0x219da6){const _0x5936cc=a43_0xed68,_0x1115bb=_0x94ee4e();while(!![]){try{const _0x135efb=parseInt(_0x5936cc(0x162))/0x1+parseInt(_0x5936cc(0x167))/0x2+parseInt(_0x5936cc(0x170))/0x3*(parseInt(_0x5936cc(0x174))/0x4)+parseInt(_0x5936cc(0x177))/0x5+-parseInt(_0x5936cc(0x17a))/0x6*(parseInt(_0x5936cc(0x16d))/0x7)+-parseInt(_0x5936cc(0x173))/0x8*(-parseInt(_0x5936cc(0x16c))/0x9)+-parseInt(_0x5936cc(0x164))/0xa*(parseInt(_0x5936cc(0x171))/0xb);if(_0x135efb===_0x219da6)break;else _0x1115bb['push'](_0x1115bb['shift']());}catch(_0x2ef187){_0x1115bb['push'](_0x1115bb['shift']());}}}(a43_0x3a63,0x959ca));function a43_0xed68(_0x57089c,_0x595319){_0x57089c=_0x57089c-0x161;const _0x3a63fb=a43_0x3a63();let _0xed68d3=_0x3a63fb[_0x57089c];return _0xed68d3;}import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a43_0x3a63(){const _0x42dc02=['1128BrIvqf','sql','boolean','no-imports','1097792ucEqNb','str','14657680sZtjMD','bff','Omit\x20import\x20statements\x20from\x20generated\x20code','225860gtGjbT','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','read','sqlCode','codegen','28773ohabgB','32291kmZFFB','target','bool','3178329ENjptC','22eluyHE','Code\x20target:\x20sdk\x20(default)\x20or\x20bff','2824mjOCUe','4fPPcOi','sqlcode','sdk','5064420nwkLzc','appCode','string'];a43_0x3a63=function(){return _0x42dc02;};return a43_0x3a63();}export const codegenSql={'service':a43_0xf5ff99(0x16b),'command':a43_0xf5ff99(0x17b),'description':a43_0xf5ff99(0x168),'risk':a43_0xf5ff99(0x169),'flags':[SQLCODE_FLAG,{'name':a43_0xf5ff99(0x16e),'type':a43_0xf5ff99(0x179),'description':a43_0xf5ff99(0x172),'default':'sdk','enum':[a43_0xf5ff99(0x176),a43_0xf5ff99(0x165)]},{'name':a43_0xf5ff99(0x161),'type':a43_0xf5ff99(0x17c),'description':a43_0xf5ff99(0x166)}],async 'execute'(_0x2a1d5d){const _0x5455fc=a43_0xf5ff99,_0x3231f0=await getSqlQueryInfo(_0x2a1d5d[_0x5455fc(0x178)],_0x2a1d5d[_0x5455fc(0x163)](_0x5455fc(0x175))),_0x4903c2=_0x2a1d5d[_0x5455fc(0x163)](_0x5455fc(0x16e))||_0x5455fc(0x176),_0x1440fd=generateSqlCodeTemplate(_0x3231f0,{'target':_0x4903c2,'includeImports':!_0x2a1d5d[_0x5455fc(0x16f)]('no-imports')});return{'ok':!![],'data':{'sqlCode':_0x3231f0[_0x5455fc(0x16a)],'sqlName':_0x3231f0['sqlName'],'target':_0x4903c2,'code':_0x1440fd}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4d4185,_0x10eb2a){const _0x2f3c03=a44_0x49fb,_0x1899f3=_0x4d4185();while(!![]){try{const _0xb4f586=-parseInt(_0x2f3c03(0x1ad))/0x1+parseInt(_0x2f3c03(0x1a0))/0x2+parseInt(_0x2f3c03(0x1ab))/0x3*(-parseInt(_0x2f3c03(0x1a7))/0x4)+parseInt(_0x2f3c03(0x1a6))/0x5*(-parseInt(_0x2f3c03(0x1ca))/0x6)+parseInt(_0x2f3c03(0x1a2))/0x7+-parseInt(_0x2f3c03(0x1c9))/0x8+parseInt(_0x2f3c03(0x1ac))/0x9*(parseInt(_0x2f3c03(0x1b3))/0xa);if(_0xb4f586===_0x10eb2a)break;else _0x1899f3['push'](_0x1899f3['shift']());}catch(_0x31b7a4){_0x1899f3['push'](_0x1899f3['shift']());}}}(a44_0x30d7,0x459e1));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{collectAppProfileOverrides,getAppProfileFlagDefs,normalizeStoredDefaultApp}from'../../config/schema.js';import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';export function buildAppAddFlags(){const _0x500471=a44_0x49fb;return[{'name':_0x500471(0x1c5),'type':_0x500471(0x1a9),'description':_0x500471(0x1b8),'required':!![]},{'name':_0x500471(0x1ba),'type':_0x500471(0x1c3),'description':_0x500471(0x1c7),'default':![]},...getAppProfileFlagDefs()];}export function buildAppRemoveFlags(){return[{'name':'global','type':'boolean','description':'Use\x20global\x20config\x20scope','default':![]}];}export async function validateAppName(_0x4a144e,_0x20c917){const _0x11234b=a44_0x49fb,_0x4ec71a=_0x4a144e['args'][0x0]?.[_0x11234b(0x1a5)]();if(!_0x4ec71a)throw CliErrors[_0x11234b(0x1b9)](_0x11234b(0x1b1),_0x11234b(0x1a3)+CLI_BIN_NAME+'\x20'+_0x20c917+_0x11234b(0x1c2));}function a44_0x30d7(){const _0x2ed5df=['\x20config.','App\x20code','validation','global','flagMissing','\x22\x20(appcode:\x20','project','\x20Remaining\x20app\x20\x22','bool','globalConfig','args','\x20<name>','boolean','object','appcode','Updated','Use\x20global\x20config\x20scope','\x20Default\x20app\x20changed\x20to\x20\x22','2938032DlbHeU','19614kuBjZk','length','705424MJHmVV','App\x20\x22','1339037bBCyhn','Usage:\x20','\x20Note:\x20app\x20\x22','trim','615cOFtYi','4ufPMCG','\x22\x20still\x20defined\x20in\x20','string','defaultApp','167499YnFKIO','369WvLEvh','250683oWwwCQ','\x22\x20not\x20found.','apps','keys','Missing\x20app\x20name.','\x20<name>\x20[--global]','199270OImEDg','projectConfig','Added','str'];a44_0x30d7=function(){return _0x2ed5df;};return a44_0x30d7();}export async function runAppAdd(_0x15b28e,_0x4751a8){const _0x1d99c3=a44_0x49fb,_0x5c602e=_0x15b28e[_0x1d99c3(0x1c1)][0x0]?.['trim']();if(!_0x5c602e)throw CliErrors[_0x1d99c3(0x1b9)](_0x1d99c3(0x1b1),_0x1d99c3(0x1a3)+CLI_BIN_NAME+'\x20'+_0x4751a8+'\x20<name>\x20--appcode\x20<code>');const _0x5ca6f6=_0x15b28e[_0x1d99c3(0x1b6)](_0x1d99c3(0x1c5));if(!_0x5ca6f6)throw CliErrors[_0x1d99c3(0x1bb)]('appcode',_0x1d99c3(0x1a3)+CLI_BIN_NAME+'\x20'+_0x4751a8+'\x20<name>\x20--appcode\x20<code>');const _0x3f603b={'global':_0x15b28e[_0x1d99c3(0x1bf)]('global')},_0x5f2918=readConfig(_0x3f603b);if(!_0x5f2918[_0x1d99c3(0x1af)])_0x5f2918[_0x1d99c3(0x1af)]={};const _0x4af25e={'appcode':_0x5ca6f6,...collectAppProfileOverrides(_0x5394a9=>_0x15b28e[_0x1d99c3(0x1b6)](_0x5394a9))},_0x410918=_0x5f2918['apps'],_0x503450=Object['keys'](_0x410918),_0x43c597=typeof _0x5f2918[_0x1d99c3(0x1aa)]===_0x1d99c3(0x1a9)&&_0x410918[_0x5f2918[_0x1d99c3(0x1aa)]]?_0x5f2918[_0x1d99c3(0x1aa)]:_0x503450['length']===0x1?_0x503450[0x0]:undefined,_0x1e23b2=!!_0x410918[_0x5c602e];_0x410918[_0x5c602e]=_0x4af25e;const _0x24fac2=normalizeStoredDefaultApp(_0x5f2918,_0x43c597);writeConfig(_0x5f2918,_0x3f603b);const _0x322b37=!_0x1e23b2&&_0x24fac2?'\x20Default\x20app\x20is\x20\x22'+_0x24fac2+'\x22.':'',_0xd7d833=(_0x1e23b2?_0x1d99c3(0x1c6):_0x1d99c3(0x1b5))+'\x20app\x20\x22'+_0x5c602e+_0x1d99c3(0x1bc)+_0x5ca6f6+')'+scopeLabel(_0x3f603b)+'.'+_0x322b37;return{'ok':!![],'message':_0xd7d833};}function a44_0x49fb(_0x1e8abc,_0x80da2){_0x1e8abc=_0x1e8abc-0x19f;const _0x30d7c8=a44_0x30d7();let _0x49fbd1=_0x30d7c8[_0x1e8abc];return _0x49fbd1;}export async function runAppRemove(_0x60378f,_0x19d13f){const _0x25ede3=a44_0x49fb,_0x18f95c=_0x60378f[_0x25ede3(0x1c1)][0x0]?.[_0x25ede3(0x1a5)]();if(!_0x18f95c)throw CliErrors['validation'](_0x25ede3(0x1b1),_0x25ede3(0x1a3)+CLI_BIN_NAME+'\x20'+_0x19d13f+_0x25ede3(0x1b2));const _0x5d52af=_0x60378f[_0x25ede3(0x1bf)](_0x25ede3(0x1ba)),{config:_0x247297,layers:_0x149be1}=readRawConfigWithLayers(),_0xd18b51=_0x247297[_0x25ede3(0x1af)]??{};if(!_0xd18b51[_0x18f95c])throw CliErrors['validation'](_0x25ede3(0x1a1)+_0x18f95c+'\x22\x20not\x20found.');const _0x4b0b29=_0x149be1[_0x25ede3(0x1c0)][_0x25ede3(0x1af)]&&typeof _0x149be1[_0x25ede3(0x1c0)][_0x25ede3(0x1af)]===_0x25ede3(0x1c4)?_0x149be1[_0x25ede3(0x1c0)][_0x25ede3(0x1af)]:{},_0x690481=_0x149be1[_0x25ede3(0x1b4)][_0x25ede3(0x1af)]&&typeof _0x149be1[_0x25ede3(0x1b4)][_0x25ede3(0x1af)]===_0x25ede3(0x1c4)?_0x149be1['projectConfig'][_0x25ede3(0x1af)]:{},_0x4e3fdc=appDefinedIn(_0x18f95c,_0x4b0b29,_0x690481),_0x4be060=resolveAppScopeForWrite(_0x18f95c,_0x5d52af,_0x149be1),_0x2b8076={'global':_0x4be060==='global'},_0x14c928=readConfig(_0x2b8076),_0x28a2f9=_0x14c928['apps'];if(!_0x28a2f9||!_0x28a2f9[_0x18f95c])throw CliErrors['validation'](_0x25ede3(0x1a1)+_0x18f95c+_0x25ede3(0x1ae));delete _0x28a2f9[_0x18f95c];let _0x312401='';const _0x45f8b0=typeof _0x14c928[_0x25ede3(0x1aa)]===_0x25ede3(0x1a9)?_0x14c928[_0x25ede3(0x1aa)]:undefined,_0x2dfda0=Object[_0x25ede3(0x1b0)](_0x28a2f9),_0x41a6ce=_0x45f8b0===_0x18f95c?_0x2dfda0[0x0]:_0x45f8b0,_0x1693f9=normalizeStoredDefaultApp(_0x14c928,_0x41a6ce);if(_0x45f8b0===_0x18f95c&&_0x2dfda0[_0x25ede3(0x19f)]===0x1)_0x312401=_0x25ede3(0x1be)+_0x2dfda0[0x0]+'\x22\x20is\x20selected\x20automatically.';else _0x45f8b0===_0x18f95c&&_0x1693f9&&(_0x312401=_0x25ede3(0x1c8)+_0x1693f9+'\x22.');Object['keys'](_0x28a2f9)['length']===0x0&&(delete _0x14c928[_0x25ede3(0x1af)],delete _0x14c928[_0x25ede3(0x1aa)]);writeConfig(_0x14c928,_0x2b8076);const _0x591051=_0x4e3fdc==='both'?_0x25ede3(0x1a4)+_0x18f95c+_0x25ede3(0x1a8)+(_0x4be060==='project'?'global':_0x25ede3(0x1bd))+_0x25ede3(0x1b7):'';return{'ok':!![],'message':'Removed\x20app\x20\x22'+_0x18f95c+'\x22'+scopeLabel(_0x2b8076)+'.'+_0x312401+_0x591051};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5d3c60,_0x49c9b8){const _0x2401c0=a45_0x2df6,_0x8f54ba=_0x5d3c60();while(!![]){try{const _0x12b810=-parseInt(_0x2401c0(0x16f))/0x1+-parseInt(_0x2401c0(0x165))/0x2+parseInt(_0x2401c0(0x17d))/0x3+-parseInt(_0x2401c0(0x178))/0x4+parseInt(_0x2401c0(0x177))/0x5+parseInt(_0x2401c0(0x17a))/0x6+parseInt(_0x2401c0(0x163))/0x7*(-parseInt(_0x2401c0(0x17f))/0x8);if(_0x12b810===_0x49c9b8)break;else _0x8f54ba['push'](_0x8f54ba['shift']());}catch(_0x5c1c1b){_0x8f54ba['push'](_0x8f54ba['shift']());}}}(a45_0x4770,0xc0a1e));import{input,checkbox,select}from'@inquirer/prompts';import a45_0x27a9b2 from'chalk';function a45_0x4770(){const _0x68ce8a=['appCode','454165zHCBEe','length','✎\x20Enter\x20manually','skip','includes','gray','valid','trim','3049310EvtybP','4793432nNyoPZ','cyan','4989270aDbTqr','yellow','message','4229349caqAyo','custom','708272gINgFQ','(Skip;\x20configure\x20later\x20with\x20config\x20set\x20appcode)','find','map','(Skip;\x20configure\x20later)','App\x20Code:','7lLeAiW','(No\x20login\x20session.\x20Enter\x20an\x20App\x20Code\x20manually\x20or\x20skip.)','642222OXBlmC','Invalid\x20App\x20Code','Found\x20','\x20apps.\x20Select\x20with\x20space,\x20a=all,\x20i=invert:','No\x20available\x20apps\x20found.','✎\x20Enter\x20appcode\x20manually','Fetching\x20available\x20apps...','\x20\x20(','Could\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.'];a45_0x4770=function(){return _0x68ce8a;};return a45_0x4770();}function a45_0x2df6(_0x526dcd,_0x187fc2){_0x526dcd=_0x526dcd-0x15f;const _0x47706d=a45_0x4770();let _0x2df626=_0x47706d[_0x526dcd];return _0x2df626;}import{validateAppcode}from'../../commands/common/validate.js';import{listRemoteApps}from'../../core/api-client.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';export async function promptCustomAppcode(){const _0xe1b0eb=a45_0x2df6,_0x537bf6=await input({'message':_0xe1b0eb(0x162),'validate':_0x17e326=>{const _0x5aac00=_0xe1b0eb,_0x195de7=validateAppcode(_0x17e326[_0x5aac00(0x176)]());return _0x195de7[_0x5aac00(0x175)]||_0x195de7[_0x5aac00(0x17c)]||_0x5aac00(0x166);}});return _0x537bf6[_0xe1b0eb(0x176)]();}export async function promptAppSelection(_0x4ed2c9){const _0x220cae=a45_0x2df6,_0x40582c=[{'name':a45_0x27a9b2['yellow']('✎\x20Enter\x20appcode\x20manually'),'value':-0x1},..._0x4ed2c9['map']((_0x1f8a0f,_0x446464)=>({'name':_0x1f8a0f['appName']+'\x20\x20'+a45_0x27a9b2[_0x220cae(0x174)]('('+_0x1f8a0f['appCode']+')'),'value':_0x446464}))],_0x56d612=await checkbox({'message':_0x220cae(0x167)+a45_0x27a9b2[_0x220cae(0x179)](_0x4ed2c9[_0x220cae(0x170)])+_0x220cae(0x168),'choices':_0x40582c,'loop':![]});if(_0x56d612[_0x220cae(0x173)](-0x1))return _0x220cae(0x17e);if(_0x56d612[_0x220cae(0x170)]===0x0)return'custom';return _0x56d612[_0x220cae(0x160)](_0xd60609=>_0x4ed2c9[_0xd60609]);}export async function promptSingleAppSelection(_0x18d2b1){const _0x4e1af7=a45_0x2df6,_0x45484e=[{'name':a45_0x27a9b2[_0x4e1af7(0x174)](_0x4e1af7(0x180)),'value':'skip'},{'name':a45_0x27a9b2['yellow'](_0x4e1af7(0x16a)),'value':'custom'},..._0x18d2b1['map'](_0x35aaa3=>({'name':_0x35aaa3['appName']+'\x20\x20'+a45_0x27a9b2['gray']('('+_0x35aaa3[_0x4e1af7(0x16e)]+')'),'value':_0x35aaa3[_0x4e1af7(0x16e)]}))],_0x225e8a=await select({'message':'Select\x20the\x20app\x20to\x20bind:','choices':_0x45484e});if(_0x225e8a===_0x4e1af7(0x172))return _0x4e1af7(0x172);if(_0x225e8a===_0x4e1af7(0x17e))return _0x4e1af7(0x17e);return _0x18d2b1[_0x4e1af7(0x15f)](_0x2bbf67=>_0x2bbf67[_0x4e1af7(0x16e)]===_0x225e8a);}export async function selectSingleAppcode(_0x222fd0){const _0xba84ad=a45_0x2df6;if(!_0x222fd0)return writeCliSideChannelLine(a45_0x27a9b2['gray'](_0xba84ad(0x164))),_fallbackOrSkip();writeCliSideChannelLine('Fetching\x20available\x20apps...');let _0x27f18a;try{_0x27f18a=await withActiveCookie(_0x222fd0,()=>listRemoteApps());}catch(_0x108740){writeCliSideChannelLine(a45_0x27a9b2[_0xba84ad(0x17b)](_0xba84ad(0x16d)));if(_0x108740 instanceof Error)writeCliSideChannelLine(a45_0x27a9b2['gray']('\x20\x20('+_0x108740[_0xba84ad(0x17c)]+')'));return _fallbackOrSkip();}if(_0x27f18a[_0xba84ad(0x170)]===0x0)return writeCliSideChannelLine(a45_0x27a9b2['yellow'](_0xba84ad(0x169))),_fallbackOrSkip();const _0xe52391=await promptSingleAppSelection(_0x27f18a);if(_0xe52391===_0xba84ad(0x172))return'';if(_0xe52391===_0xba84ad(0x17e))return promptCustomAppcode();return _0xe52391[_0xba84ad(0x16e)];}export async function selectMultipleApps(_0x2da549){const _0x19ea9d=a45_0x2df6;writeCliSideChannelLine(_0x19ea9d(0x16b));let _0x15a9de;try{_0x15a9de=await withActiveCookie(_0x2da549,()=>listRemoteApps());}catch(_0x4bb60e){writeCliSideChannelLine('\x0aCould\x20not\x20fetch\x20the\x20remote\x20app\x20list.\x20Enter\x20an\x20App\x20Code\x20manually.');if(_0x4bb60e instanceof Error)writeCliSideChannelLine(_0x19ea9d(0x16c)+_0x4bb60e[_0x19ea9d(0x17c)]+')');return'custom';}if(_0x15a9de['length']===0x0)return writeCliSideChannelLine('\x0aNo\x20available\x20apps\x20found.'),_0x19ea9d(0x17e);return promptAppSelection(_0x15a9de);}async function _fallbackOrSkip(){const _0x56da52=a45_0x2df6,_0x7b6459=await select({'message':_0x56da52(0x162),'choices':[{'name':a45_0x27a9b2['gray'](_0x56da52(0x161)),'value':'skip'},{'name':a45_0x27a9b2[_0x56da52(0x17b)](_0x56da52(0x171)),'value':'manual'}]});if(_0x7b6459==='skip')return'';return promptCustomAppcode();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a46_0x129e(){const _0xe91882=['2257312tCmnwm','PROCESSING','toUpperCase','\x20--format\x20compress','string','apiError','errorMessage','trim','replace','\x20response\x20did\x20not\x20contain\x20a\x20status.','PENDING','Task\x20','802516JyBIeN','8835110BihLke','FAILED','has','SUCCESS','\x20failed:\x20','\x20task\x20status\x20--task-id\x20','\x20--appcode\x20','Async\x20task\x20response\x20did\x20not\x20contain\x20a\x20taskId.','7cdKpIq','1381746wfVatQ','taskId','2473895tWLXqw','\x20returned\x20unknown\x20status\x20','18nmMEZS','1525584JIetRw','499655QZiUNC','\x27\x5c\x27\x27','status','4KNNwlh'];a46_0x129e=function(){return _0xe91882;};return a46_0x129e();}const a46_0x4782c2=a46_0x318b;(function(_0x4b5e03,_0x2c4726){const _0x1cb20b=a46_0x318b,_0x438862=_0x4b5e03();while(!![]){try{const _0x2c282e=-parseInt(_0x1cb20b(0xc7))/0x1+-parseInt(_0x1cb20b(0xb7))/0x2+-parseInt(_0x1cb20b(0xc6))/0x3+parseInt(_0x1cb20b(0xca))/0x4*(parseInt(_0x1cb20b(0xc3))/0x5)+-parseInt(_0x1cb20b(0xc1))/0x6+-parseInt(_0x1cb20b(0xc0))/0x7*(parseInt(_0x1cb20b(0xcb))/0x8)+-parseInt(_0x1cb20b(0xc5))/0x9*(-parseInt(_0x1cb20b(0xb8))/0xa);if(_0x2c282e===_0x2c4726)break;else _0x438862['push'](_0x438862['shift']());}catch(_0x518c0c){_0x438862['push'](_0x438862['shift']());}}}(a46_0x129e,0x52fc1));import{CLI_BIN_NAME}from'../../constant/cli.js';function a46_0x318b(_0x399a39,_0x3f08a2){_0x399a39=_0x399a39-0xb2;const _0x129e25=a46_0x129e();let _0x318bfa=_0x129e25[_0x399a39];return _0x318bfa;}import{CliErrors}from'../../errors.js';const TERMINAL_STATUSES=new Set([a46_0x4782c2(0xbb),a46_0x4782c2(0xb9)]),NON_TERMINAL_STATUSES=new Set([a46_0x4782c2(0xb5),a46_0x4782c2(0xcc)]);export function normalizeAsyncTask(_0x3330a1){const _0x33249a=a46_0x4782c2,_0x30c38c=typeof _0x3330a1?.[_0x33249a(0xc2)]==='string'?_0x3330a1['taskId'][_0x33249a(0xb2)]():'';if(!_0x30c38c)throw CliErrors[_0x33249a(0xd0)](_0x33249a(0xbf));const _0x419710=typeof _0x3330a1[_0x33249a(0xc9)]==='string'?_0x3330a1[_0x33249a(0xc9)][_0x33249a(0xb2)]()[_0x33249a(0xcd)]():'';if(!_0x419710)throw CliErrors[_0x33249a(0xd0)]('Async\x20task\x20'+_0x30c38c+_0x33249a(0xb4));return{'taskId':_0x30c38c,'status':_0x419710,'errorMessage':typeof _0x3330a1['errorMessage']===_0x33249a(0xcf)&&_0x3330a1[_0x33249a(0xd1)][_0x33249a(0xb2)]()?_0x3330a1[_0x33249a(0xd1)][_0x33249a(0xb2)]():null,'isTerminal':TERMINAL_STATUSES[_0x33249a(0xba)](_0x419710),'knownStatus':TERMINAL_STATUSES[_0x33249a(0xba)](_0x419710)||NON_TERMINAL_STATUSES[_0x33249a(0xba)](_0x419710)};}export function buildAsyncTaskStatusCommand(_0x1d5fac,_0x4bae59){const _0x57062c=a46_0x4782c2;return CLI_BIN_NAME+_0x57062c(0xbd)+quoteShellArg(_0x1d5fac)+_0x57062c(0xbe)+quoteShellArg(_0x4bae59)+_0x57062c(0xce);}export function asyncTaskMessage(_0x433a9d){const _0x34445d=a46_0x4782c2;switch(_0x433a9d[_0x34445d(0xc9)]){case _0x34445d(0xb5):return _0x34445d(0xb6)+_0x433a9d[_0x34445d(0xc2)]+'\x20is\x20pending.';case'PROCESSING':return'Task\x20'+_0x433a9d[_0x34445d(0xc2)]+'\x20is\x20processing.';case _0x34445d(0xbb):return _0x34445d(0xb6)+_0x433a9d[_0x34445d(0xc2)]+'\x20completed\x20successfully.';case _0x34445d(0xb9):return _0x433a9d['errorMessage']?_0x34445d(0xb6)+_0x433a9d['taskId']+_0x34445d(0xbc)+_0x433a9d[_0x34445d(0xd1)]:_0x34445d(0xb6)+_0x433a9d['taskId']+'\x20failed.';default:return _0x34445d(0xb6)+_0x433a9d['taskId']+_0x34445d(0xc4)+_0x433a9d['status']+'.';}}function quoteShellArg(_0x281de9){const _0x36e4e5=a46_0x4782c2;return'\x27'+_0x281de9[_0x36e4e5(0xb3)](/'/g,_0x36e4e5(0xc8))+'\x27';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a47_0x2dfe(){var _0x194be6=['3jJXGPq','1988LZUgDT','170401UdkEPK','5368QJKipg','2187wbTwQO','description','6fqXMuX','115493SFGsxH','114824YhvzUO','1749VRYlik','2088200djLLIP','4563744vWPahl','defineProperties','280bbLFLD','url'];a47_0x2dfe=function(){return _0x194be6;};return a47_0x2dfe();}(function(_0x1467aa,_0x39883b){var _0x22684e=a47_0x49db,_0x1ded15=_0x1467aa();while(!![]){try{var _0x717c=parseInt(_0x22684e(0x198))/0x1*(parseInt(_0x22684e(0x1a0))/0x2)+parseInt(_0x22684e(0x1a1))/0x3*(parseInt(_0x22684e(0x199))/0x4)+-parseInt(_0x22684e(0x1a2))/0x5+-parseInt(_0x22684e(0x19e))/0x6*(parseInt(_0x22684e(0x19f))/0x7)+parseInt(_0x22684e(0x19b))/0x8*(parseInt(_0x22684e(0x19c))/0x9)+parseInt(_0x22684e(0x1a5))/0xa*(parseInt(_0x22684e(0x19a))/0xb)+-parseInt(_0x22684e(0x1a3))/0xc;if(_0x717c===_0x39883b)break;else _0x1ded15['push'](_0x1ded15['shift']());}catch(_0x2117eb){_0x1ded15['push'](_0x1ded15['shift']());}}}(a47_0x2dfe,0x3ba71));function a47_0x49db(_0xd9376,_0x12db3e){_0xd9376=_0xd9376-0x198;var _0x2dfecd=a47_0x2dfe();var _0x49db81=_0x2dfecd[_0xd9376];return _0x49db81;}export function asDryRunResult(_0x1be98f,_0x597cb4){var _0x3e45b3=a47_0x49db;return Object[_0x3e45b3(0x1a4)](_0x1be98f,{'method':{'value':_0x597cb4['method'],'enumerable':![]},'url':{'value':_0x597cb4[_0x3e45b3(0x1a6)],'enumerable':![]},..._0x597cb4[_0x3e45b3(0x19d)]?{'description':{'value':_0x597cb4[_0x3e45b3(0x19d)],'enumerable':![]}}:{}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0xe1e08c=a48_0x1ed6;(function(_0x4a478c,_0x215569){const _0xf21c66=a48_0x1ed6,_0x42ac9f=_0x4a478c();while(!![]){try{const _0x2bf033=-parseInt(_0xf21c66(0x18a))/0x1+parseInt(_0xf21c66(0x17e))/0x2+-parseInt(_0xf21c66(0x185))/0x3+parseInt(_0xf21c66(0x17d))/0x4+-parseInt(_0xf21c66(0x195))/0x5*(parseInt(_0xf21c66(0x182))/0x6)+-parseInt(_0xf21c66(0x192))/0x7+-parseInt(_0xf21c66(0x18c))/0x8*(-parseInt(_0xf21c66(0x17f))/0x9);if(_0x2bf033===_0x215569)break;else _0x42ac9f['push'](_0x42ac9f['shift']());}catch(_0x568e44){_0x42ac9f['push'](_0x42ac9f['shift']());}}}(a48_0x31d2,0x548cb));function a48_0x1ed6(_0xc11187,_0x20a319){_0xc11187=_0xc11187-0x17d;const _0x31d220=a48_0x31d2();let _0x1ed60b=_0x31d220[_0xc11187];return _0x1ed60b;}export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}(?:_[^_\s]+_[^_\s]+)?$/i,'description':a48_0xe1e08c(0x194)};export const CODE_FLAG={'name':'code','type':a48_0xe1e08c(0x18b),'required':!![],'description':a48_0xe1e08c(0x193),'pattern':DATASET_CODE_PATTERN};export const CODE_FLAG_OPTIONAL={...CODE_FLAG,'required':![]};export const DATASETCODE_FLAG_OPTIONAL={...CODE_FLAG_OPTIONAL,'name':'datasetcode','description':a48_0xe1e08c(0x193)};export const SQLCODE_FLAG={'name':a48_0xe1e08c(0x181),'type':a48_0xe1e08c(0x18b),'required':!![],'description':'SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a48_0xe1e08c(0x190)}};export const APPCODE_FLAG_OPTIONAL={'name':a48_0xe1e08c(0x186),'type':a48_0xe1e08c(0x18b),'required':![],'description':a48_0xe1e08c(0x183)};export const APPCODE_FLAG={...APPCODE_FLAG_OPTIONAL,'required':!![],'description':a48_0xe1e08c(0x191)};function a48_0x31d2(){const _0x3fd5ce=['POSTGRESQL','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','App\x20code\x20(e.g.\x20app-xxxxx)','4428186rkVLIJ','Dataset\x20code\x20(32-char\x20hex,\x20optionally\x20with\x20_xx_xx\x20suffix)','a\x2032-character\x20hex\x20code,\x20optionally\x20with\x20`_xx_xx`\x20suffix\x20(e.g.\x2099a909313f1fa7153186431e1c551588\x20or\x2099a909313f1fa7153186431e1c551588_75_3c7120aa)','450085PMyQSI','656284Vsfsri','737496sAaQSS','11123793OgRPWH','dbtype','sqlcode','18lUILtV','App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)','Database\x20product\x20type','1158717JcEyqD','appcode','MYSQL','boolean','skip-connection-test','133593Vhepff','string','8sFgvgt','Skip\x20testing\x20the\x20unsaved\x20database\x20configuration\x20before\x20create/update','number'];a48_0x31d2=function(){return _0x3fd5ce;};return a48_0x31d2();}export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};export const DBLINK_ID_FLAG={'name':'id','type':a48_0xe1e08c(0x18e),'required':!![],'description':'Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)'};export const DB_TYPE_FLAG={'name':a48_0xe1e08c(0x180),'type':a48_0xe1e08c(0x18b),'required':!![],'description':a48_0xe1e08c(0x184),'enum':[a48_0xe1e08c(0x187),a48_0xe1e08c(0x18f)]};export const SKIP_CONNECTION_TEST_FLAG={'name':a48_0xe1e08c(0x189),'type':a48_0xe1e08c(0x188),'description':a48_0xe1e08c(0x18d)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a49_0x1264(_0xf249ce,_0x24c360){_0xf249ce=_0xf249ce-0x1a1;const _0x51991d=a49_0x5199();let _0x126414=_0x51991d[_0xf249ce];return _0x126414;}(function(_0x2a2171,_0x1a0ed0){const _0x192b0e=a49_0x1264,_0x5a0c37=_0x2a2171();while(!![]){try{const _0x1c642a=-parseInt(_0x192b0e(0x1ae))/0x1*(-parseInt(_0x192b0e(0x1a9))/0x2)+parseInt(_0x192b0e(0x1b0))/0x3*(parseInt(_0x192b0e(0x1a5))/0x4)+parseInt(_0x192b0e(0x1a8))/0x5*(parseInt(_0x192b0e(0x1a4))/0x6)+-parseInt(_0x192b0e(0x1a1))/0x7+-parseInt(_0x192b0e(0x1a7))/0x8+parseInt(_0x192b0e(0x1b1))/0x9*(parseInt(_0x192b0e(0x1aa))/0xa)+-parseInt(_0x192b0e(0x1a2))/0xb;if(_0x1c642a===_0x1a0ed0)break;else _0x5a0c37['push'](_0x5a0c37['shift']());}catch(_0x148460){_0x5a0c37['push'](_0x5a0c37['shift']());}}}(a49_0x5199,0xc5023));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(_0xc83127){const _0x4293de=a49_0x1264;if(_0xc83127>=BYTES_PER_MB){const _0x10ba12=Math[_0x4293de(0x1af)](_0xc83127/BYTES_PER_MB*0x64)/0x64;return _0x10ba12['toFixed'](0x2)+'\x20MB';}return _0xc83127+'\x20B';}export function requireDevelopmentUploadFile(_0x494d1c,_0x5ca21c){const _0x4e415a=a49_0x1264,_0x3da5e6=_0x494d1c[_0x4e415a(0x1ad)]();if(!_0x3da5e6)throw CliErrors[_0x4e415a(0x1ac)](_0x5ca21c+'\x20path\x20is\x20required.');if(!existsSync(_0x3da5e6))throw CliErrors['validation']('File\x20not\x20found:\x20'+_0x3da5e6);const _0x4a83c7=statSync(_0x3da5e6);if(!_0x4a83c7[_0x4e415a(0x1a3)]())throw CliErrors[_0x4e415a(0x1ac)](_0x4e415a(0x1ab)+_0x3da5e6);if(_0x4a83c7['size']>DEVELOPMENT_UPLOAD_MAX_BYTES)throw CliErrors[_0x4e415a(0x1ac)](_0x4e415a(0x1a6)+_0x3da5e6+'\x20('+formatBytes(_0x4a83c7[_0x4e415a(0x1b2)])+')');return{'path':_0x3da5e6,'size':_0x4a83c7[_0x4e415a(0x1b2)]};}function a49_0x5199(){const _0x492266=['83311qFtVve','ceil','33mrNpfF','9GXCDFB','size','1455748GiwiEU','9965296JwjuaG','isFile','6BbfenV','87804bSsCsU','File\x20exceeds\x20the\x20development\x20upload\x20limit\x20of\x2050\x20MB:\x20','12876840ZmrFwI','7916555ooKfmh','38asFXjw','1227710qwZRPo','File\x20is\x20not\x20a\x20regular\x20file:\x20','validation','trim'];a49_0x5199=function(){return _0x492266;};return a49_0x5199();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x615c44,_0x490b0a){const _0x429c08=a50_0x2703,_0x25e66e=_0x615c44();while(!![]){try{const _0x42323a=parseInt(_0x429c08(0x1f6))/0x1+parseInt(_0x429c08(0x1f1))/0x2+parseInt(_0x429c08(0x1f9))/0x3+parseInt(_0x429c08(0x1f4))/0x4*(parseInt(_0x429c08(0x1ed))/0x5)+-parseInt(_0x429c08(0x1fa))/0x6*(-parseInt(_0x429c08(0x1ea))/0x7)+-parseInt(_0x429c08(0x1ee))/0x8*(-parseInt(_0x429c08(0x1ef))/0x9)+parseInt(_0x429c08(0x1f3))/0xa*(-parseInt(_0x429c08(0x1ec))/0xb);if(_0x42323a===_0x490b0a)break;else _0x25e66e['push'](_0x25e66e['shift']());}catch(_0x185029){_0x25e66e['push'](_0x25e66e['shift']());}}}(a50_0x558b,0xedb22));function a50_0x2703(_0x20a0fb,_0x3ffaee){_0x20a0fb=_0x20a0fb-0x1ea;const _0x558b31=a50_0x558b();let _0x270348=_0x558b31[_0x20a0fb];return _0x270348;}export function validateAppcode(_0x5073f3){const _0x1bbde1=a50_0x2703,_0x1e98cb=_0x5073f3[_0x1bbde1(0x1f8)]();if(!_0x1e98cb)return{'valid':![],'message':_0x1bbde1(0x1f5)};if(_0x1e98cb[_0x1bbde1(0x1f2)]>0x64)return{'valid':![],'message':_0x1bbde1(0x1f7)};if(!/^[A-Za-z0-9_-]+$/[_0x1bbde1(0x1f0)](_0x1e98cb))return{'valid':![],'message':_0x1bbde1(0x1eb)};return{'valid':!![]};}function a50_0x558b(){const _0x22f7e5=['35784460VXmoEl','862056JDyOBb','App\x20Code\x20cannot\x20be\x20empty','266781iGuMfV','App\x20Code\x20cannot\x20exceed\x20100\x20characters','trim','4508730oZnXiW','830154ybuDFI','14IFrIUG','Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed','11BBSmDF','25KPPiSS','678544tXJKeY','117owycKe','test','650870vffJhr','length'];a50_0x558b=function(){return _0x22f7e5;};return a50_0x558b();}
|