@lovrabet/rabetbase-cli 2.4.6-beta.3 → 2.4.7-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/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/get.js +1 -1
- package/lib/commands/config/index.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/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/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/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/init/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.d.ts +2 -0
- package/lib/commands/kb/search.js +1 -0
- 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/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/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.d.ts +16 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.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/rules-cdn.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 +4 -4
- package/skills/rabetbase/references/rabetbase-kb.md +13 -3
- package/skills/rabetbase.manifest.json +3 -3
package/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a34_0x4ddd(){const _0x892027=['bff','appCode','bool','str','List\x20BFF\x20scripts','1771965ZNRGjM','ENDPOINT','string','11GQkUgr','list','Return\x20full\x20script\x20objects','1373310MAdtnl','name','117783rzzMxa','2840440rSnmvU','24UKKnEu','1WyuZUx','Filter\x20by\x20script\x20name','332379ootzat','scriptType','verbose','map','Script\x20type\x20filter','No\x20BFF\x20scripts\x20found.','16dHkEHG','type','463578MEuRIL','COMMON','boolean','2089731zHvDQA'];a34_0x4ddd=function(){return _0x892027;};return a34_0x4ddd();}const a34_0x33451d=a34_0x39b5;(function(_0x1509dc,_0x5bebec){const _0x450b00=a34_0x39b5,_0x359344=_0x1509dc();while(!![]){try{const _0x94f47=parseInt(_0x450b00(0xce))/0x1*(parseInt(_0x450b00(0xba))/0x2)+parseInt(_0x450b00(0xcb))/0x3*(-parseInt(_0x450b00(0xcd))/0x4)+parseInt(_0x450b00(0xc3))/0x5+-parseInt(_0x450b00(0xc9))/0x6+parseInt(_0x450b00(0xbd))/0x7+parseInt(_0x450b00(0xb8))/0x8*(parseInt(_0x450b00(0xd0))/0x9)+-parseInt(_0x450b00(0xcc))/0xa*(parseInt(_0x450b00(0xc6))/0xb);if(_0x94f47===_0x5bebec)break;else _0x359344['push'](_0x359344['shift']());}catch(_0x55a132){_0x359344['push'](_0x359344['shift']());}}}(a34_0x4ddd,0x334a2));import{listBffScripts}from'../../core/api-client.js';function a34_0x39b5(_0x25a76f,_0x279dcb){_0x25a76f=_0x25a76f-0xb4;const _0x4ddd9c=a34_0x4ddd();let _0x39b502=_0x4ddd9c[_0x25a76f];return _0x39b502;}export const bffList={'service':a34_0x33451d(0xbe),'command':a34_0x33451d(0xc7),'description':a34_0x33451d(0xc2),'risk':'read','flags':[{'name':a34_0x33451d(0xb9),'type':a34_0x33451d(0xc5),'description':a34_0x33451d(0xb6),'default':a34_0x33451d(0xc4),'enum':[a34_0x33451d(0xc4),a34_0x33451d(0xbb)]},{'name':a34_0x33451d(0xca),'type':a34_0x33451d(0xc5),'description':a34_0x33451d(0xcf)},{'name':a34_0x33451d(0xb4),'type':a34_0x33451d(0xbc),'description':a34_0x33451d(0xc8)}],async 'execute'(_0x14239a){const _0x16a542=a34_0x33451d,_0x21a9bc=await listBffScripts(_0x14239a[_0x16a542(0xbf)],_0x14239a[_0x16a542(0xc1)]('type'),{'scriptName':_0x14239a[_0x16a542(0xc1)]('name')||undefined}),_0x5de23a=_0x14239a[_0x16a542(0xc0)](_0x16a542(0xb4));return{'ok':!![],'data':_0x5de23a?_0x21a9bc:_0x21a9bc[_0x16a542(0xb5)](_0x1fbc01=>({'id':_0x1fbc01['id'],'functionName':_0x1fbc01['functionName']??'','description':_0x1fbc01['description']||'(unnamed)','scriptType':_0x1fbc01[_0x16a542(0xd1)]})),'message':_0x21a9bc['length']===0x0?_0x16a542(0xb7):undefined};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a35_0x3c4436=a35_0x1576;(function(_0x3a6286,_0x22935f){const _0x17c89d=a35_0x1576,_0x2c09d6=_0x3a6286();while(!![]){try{const _0x3bb149=parseInt(_0x17c89d(0x1f8))/0x1*(-parseInt(_0x17c89d(0x1c7))/0x2)+-parseInt(_0x17c89d(0x1eb))/0x3+-parseInt(_0x17c89d(0x207))/0x4+parseInt(_0x17c89d(0x1cd))/0x5+-parseInt(_0x17c89d(0x1e3))/0x6+parseInt(_0x17c89d(0x1d9))/0x7+parseInt(_0x17c89d(0x1d7))/0x8*(parseInt(_0x17c89d(0x1f9))/0x9);if(_0x3bb149===_0x22935f)break;else _0x2c09d6['push'](_0x2c09d6['shift']());}catch(_0x77a29c){_0x2c09d6['push'](_0x2c09d6['shift']());}}}(a35_0x1538,0x9870d));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';function a35_0x1538(){const _0xc74edf=['str','\x22\x20not\x20found\x20after\x20ensureLockScope.','alias','&type=','Pull\x20only\x20this\x20script\x20type','skipped','length','1JAsgEb','765gjYGLt','\x20remote\x20BFF\x20script(s)\x20for\x20pull','appCode','COMMON','functionName','Force\x20pull\x20cancelled.','Pull\x20complete:\x20','stderr','Remote\x20script\x20missing\x20content.','functionNode','yes','datasetCode','bool','stringify','458652mBrSFP','toISOString','functions','read','lockFilePath','nonInteractive','toLowerCase','message','381370TFzBjl','lastSync','\x20skipped,\x20','push','bff','includes','759830OPwUQn','\x20pulled,\x20','trim','local\x20unsynced\x20changes','HOOK','close','No\x20remote\x20BFF\x20scripts\x20found.','filePath','pull','apps','3088SwgalQ','scriptType','8269198GZpDnp','scriptContent','parse','type','validation','scriptsRoot','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','hookLocation','GET','/api/management/library/scripts/list?appCode=','1204740fXwekb','all','map','utf8','Remote\x20script\x20missing\x20id.','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','conflict','operationType','706665XzMrKI','ENDPOINT','apiDir','lockKey','cancelled','force'];a35_0x1538=function(){return _0xc74edf;};return a35_0x1538();}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':a35_0x3c4436(0x1cb),'command':a35_0x3c4436(0x1d5),'description':a35_0x3c4436(0x1df),'risk':a35_0x3c4436(0x20a),'flags':[{'name':a35_0x3c4436(0x1dc),'type':'string','description':a35_0x3c4436(0x1f5),'enum':[a35_0x3c4436(0x1fc),a35_0x3c4436(0x1ec),a35_0x3c4436(0x1d1)]},{'name':'force','type':'boolean','description':'Force\x20overwrite\x20local\x20unsynced\x20changes'}],async 'dryRun'(_0x4e1f73){const _0x281248=a35_0x3c4436,_0x1c8820=loadBffProjectConfig(_0x4e1f73[_0x281248(0x1fb)]),_0x4886dd=await readBffLockFile(_0x1c8820[_0x281248(0x20b)]),{appLock:_0x25fd8f}=ensureLockScope(_0x4886dd??createEmptyBffLock(),_0x4e1f73[_0x281248(0x1fb)],_0x1c8820[_0x281248(0x1de)],'pull'),_0x1ccc5b=normalizeBffType(_0x4e1f73[_0x281248(0x1f1)]('type'))??undefined,_0x53e37c=buildDatasetCodeToAliasMap(_0x4e1f73[_0x281248(0x1ed)],_0x4e1f73[_0x281248(0x1fb)]),[_0x4d0f2d,_0x6aa13e]=await Promise[_0x281248(0x1e4)]([listBffScripts(_0x4e1f73[_0x281248(0x1fb)],_0x1ccc5b),getBffScriptStatistics(_0x4e1f73[_0x281248(0x1fb)])]),_0x2aa8c9=createHookLocationMap(_0x6aa13e),_0x2cf463=[];for(const _0x5e4701 of _0x4d0f2d){const _0x3fcde0=resolveRemoteScriptTarget(_0x1c8820,_0x5e4701,_0x2aa8c9,_0x25fd8f['functions'],_0x53e37c);if(!_0x3fcde0){_0x2cf463[_0x281248(0x1ca)]({'scriptType':_0x5e4701['scriptType'],'functionName':_0x5e4701[_0x281248(0x1fd)]??'','status':_0x281248(0x1f6),'reason':'unresolvable\x20target\x20path'});continue;}const _0x38c33c=_0x25fd8f['functions'][_0x3fcde0[_0x281248(0x1ee)]],_0x1f3da9=_0x5e4701[_0x281248(0x1da)]!=null?computeContentHash(_0x5e4701[_0x281248(0x1da)]):undefined,_0x11f779=await hasUnsyncedLocalChanges(_0x3fcde0[_0x281248(0x1d4)],_0x38c33c,_0x1f3da9);_0x2cf463[_0x281248(0x1ca)]({'lockKey':_0x3fcde0[_0x281248(0x1ee)],'filePath':_0x3fcde0[_0x281248(0x1d4)],'remoteId':_0x5e4701['id']??null,'status':_0x11f779?_0x281248(0x1e9):'would_pull'});}return{'method':_0x281248(0x1e1),'url':_0x281248(0x1e2)+_0x4e1f73[_0x281248(0x1fb)]+(_0x1ccc5b?_0x281248(0x1f4)+_0x1ccc5b:''),'body':{'appCode':_0x4e1f73[_0x281248(0x1fb)],'filterType':_0x1ccc5b??null,'files':_0x2cf463},'description':'Would\x20inspect\x20'+_0x2cf463[_0x281248(0x1f7)]+_0x281248(0x1fa)};},async 'execute'(_0x14bbe1){const _0x3ea148=a35_0x3c4436,_0x1f1da6=loadBffProjectConfig(_0x14bbe1[_0x3ea148(0x1fb)]),_0x58323c=await readBffLockFile(_0x1f1da6['lockFilePath']),{lockData:_0x3de63b,appLock:_0x2ee09d}=ensureLockScope(_0x58323c??createEmptyBffLock(),_0x14bbe1[_0x3ea148(0x1fb)],_0x1f1da6[_0x3ea148(0x1de)],'pull'),_0x278a92=normalizeBffType(_0x14bbe1[_0x3ea148(0x1f1)](_0x3ea148(0x1dc)))??undefined;if(_0x14bbe1[_0x3ea148(0x1f1)]('type')&&!_0x278a92)throw CliErrors[_0x3ea148(0x1dd)]('--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.');const [_0x2bc533,_0x7d145]=await Promise['all']([listBffScripts(_0x14bbe1[_0x3ea148(0x1fb)],_0x278a92),getBffScriptStatistics(_0x14bbe1[_0x3ea148(0x1fb)])]);if(_0x2bc533['length']===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x3ea148(0x1d3)};const _0x381737=_0x14bbe1[_0x3ea148(0x205)](_0x3ea148(0x1f0));if(_0x381737&&!_0x14bbe1['nonInteractive']){const _0x564f5c=await confirmForce();if(!_0x564f5c)throw CliErrors[_0x3ea148(0x1ef)](_0x3ea148(0x1fe));}if(_0x381737&&_0x14bbe1[_0x3ea148(0x20c)]){}const _0x26cad5=buildDatasetCodeToAliasMap(_0x14bbe1[_0x3ea148(0x1ed)],_0x14bbe1[_0x3ea148(0x1fb)]),_0x471ce9=createHookLocationMap(_0x7d145),_0x4e03a7=JSON[_0x3ea148(0x1db)](JSON[_0x3ea148(0x206)](_0x3de63b)),_0x5a0c6b=_0x14bbe1['appCode'],_0x2a9dd6=_0x4e03a7[_0x3ea148(0x1d6)][_0x5a0c6b];if(!_0x2a9dd6)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0x5a0c6b+_0x3ea148(0x1f2));const _0x3e1ac7=[],_0x5a059e=[],_0x2d305d=[];for(const _0x19b59e of _0x2bc533){const _0x1ba663=resolveRemoteScriptTarget(_0x1f1da6,_0x19b59e,_0x471ce9,_0x2ee09d[_0x3ea148(0x209)],_0x26cad5);if(!_0x1ba663){_0x5a059e['push']({'lockKey':_0x19b59e[_0x3ea148(0x1d8)]+'/'+_0x19b59e['functionName'],'reason':'unresolvable\x20target\x20path'});continue;}const _0x410e52=_0x2ee09d['functions'][_0x1ba663[_0x3ea148(0x1ee)]];try{if(!_0x19b59e['id'])throw new Error(_0x3ea148(0x1e7));if(_0x19b59e['scriptContent']==null)throw new Error(_0x3ea148(0x201));const _0x3facca=_0x19b59e[_0x3ea148(0x1da)],_0x58f549=computeContentHash(_0x3facca);if(!_0x381737){const _0x3ffca8=await hasUnsyncedLocalChanges(_0x1ba663['filePath'],_0x410e52,_0x58f549);if(_0x3ffca8){_0x5a059e[_0x3ea148(0x1ca)]({'lockKey':_0x1ba663[_0x3ea148(0x1ee)],'reason':_0x3ea148(0x1d0)});continue;}}await ensureParentDirectory(_0x1ba663[_0x3ea148(0x1d4)]),await writeFile(_0x1ba663['filePath'],_0x3facca,_0x3ea148(0x1e6));const _0x5b3ab6={'hash':_0x58f549,'remoteId':_0x19b59e['id'],'version':_0x19b59e['version']};_0x1ba663[_0x3ea148(0x1dc)]==='HOOK'&&_0x1ba663[_0x3ea148(0x1e0)]&&(_0x5b3ab6[_0x3ea148(0x1f3)]=_0x1ba663[_0x3ea148(0x1e0)][_0x3ea148(0x1f3)],_0x5b3ab6[_0x3ea148(0x204)]=_0x1ba663[_0x3ea148(0x1e0)][_0x3ea148(0x204)],_0x5b3ab6[_0x3ea148(0x1ea)]=_0x1ba663['hookLocation'][_0x3ea148(0x1ea)],_0x5b3ab6[_0x3ea148(0x202)]=_0x1ba663['hookLocation'][_0x3ea148(0x202)]),_0x2a9dd6[_0x3ea148(0x209)][_0x1ba663[_0x3ea148(0x1ee)]]=_0x5b3ab6,_0x3e1ac7[_0x3ea148(0x1ca)]({'lockKey':_0x1ba663[_0x3ea148(0x1ee)],'remoteId':_0x19b59e['id']});}catch(_0x21e25e){_0x2d305d[_0x3ea148(0x1ca)]({'lockKey':_0x1ba663[_0x3ea148(0x1ee)],'error':_0x21e25e instanceof Error?_0x21e25e[_0x3ea148(0x20e)]:String(_0x21e25e)});}}return _0x2a9dd6[_0x3ea148(0x1c8)]=new Date()[_0x3ea148(0x208)](),await writeBffLockFile(_0x1f1da6[_0x3ea148(0x20b)],_0x4e03a7),{'ok':_0x2d305d[_0x3ea148(0x1f7)]===0x0,'data':{'pulled':_0x3e1ac7,'skipped':_0x5a059e,'failed':_0x2d305d},'message':_0x3ea148(0x1ff)+_0x3e1ac7[_0x3ea148(0x1f7)]+_0x3ea148(0x1ce)+_0x5a059e[_0x3ea148(0x1f7)]+_0x3ea148(0x1c9)+_0x2d305d[_0x3ea148(0x1f7)]+'\x20failed'};}};function a35_0x1576(_0x98a7b3,_0x3f7def){_0x98a7b3=_0x98a7b3-0x1c7;const _0x1538f9=a35_0x1538();let _0x157679=_0x1538f9[_0x98a7b3];return _0x157679;}async function hasUnsyncedLocalChanges(_0x1fe5f5,_0x5adb41,_0x2a2010){if(!await fileExists(_0x1fe5f5))return![];const _0x5ac951=await computeFileHash(_0x1fe5f5);if(!_0x5adb41)return _0x2a2010?_0x5ac951!==_0x2a2010:!![];return _0x5ac951!==_0x5adb41['hash'];}function buildDatasetCodeToAliasMap(_0x2590f8,_0x346f7c){const _0x2f6df6=a35_0x3c4436,_0x2945c8=loadAliasMap(_0x2590f8,undefined,resolveApiFilePath(_0x2590f8,_0x346f7c));return new Map(_0x2945c8[_0x2f6df6(0x1e5)](_0x6ae323=>[_0x6ae323['datasetCode'],_0x6ae323[_0x2f6df6(0x1f3)]]));}async function confirmForce(){const _0x222a67=a35_0x3c4436,_0x20683d=createInterface({'input':process['stdin'],'output':process[_0x222a67(0x200)]}),_0x517b60=await new Promise(_0x57ea59=>{const _0x2256e7=_0x222a67;_0x20683d['question'](_0x2256e7(0x1e8),_0x57ea59);});return _0x20683d[_0x222a67(0x1d2)](),['y',_0x222a67(0x203)][_0x222a67(0x1cc)](_0x517b60[_0x222a67(0x1cf)]()[_0x222a67(0x20d)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a36_0x44563e=a36_0x1108;function a36_0x2616(){const _0xe9fcff=['alias','lockFilePath','cleared','runtime\x20cache\x20not\x20needed','remoteId','\x22.\x20','1507077BuZzgq','Lock\x20scope\x20for\x20app\x20\x22','force','validation','COMMON','parse','version','Would\x20inspect\x20','push','\x22\x20not\x20found\x20after\x20ensureLockScope.','unchanged','length','attempted','101151nGCNld','filter','Push\x20only\x20this\x20script\x20type','runtime\x20cache\x20clear\x20failed','aliasToDatasetCode','functionNode','map','stringify','script','every','139yLJUjo','539KCOPVt','toISOString','hash','lockKey','12226QnRsAc','name','datasetCodeToDataset','POST','utf8','set','Push\x20complete:\x20','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','Incomplete\x20HOOK\x20path:\x20','1886826sogKzB','60RyoIpE','4060028fhmKoL','519590UpuLqV','description','write','appCode','would_push','bool','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','values','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','\x20uploaded,\x20','Local\x20function\x20not\x20found:\x20','scriptsRoot','\x20skipped,\x20','functions','apps','has','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','apiDir','type','No\x20local\x20BFF\x20functions\x20found.','34380zzkwAm','280UpmyaC','filePath','string','get','HOOK',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','operationType','str','status','Push\x20local\x20BFF\x20scripts\x20to\x20remote','datasetCode','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','some','runtime\x20cache\x20cleared'];a36_0x2616=function(){return _0xe9fcff;};return a36_0x2616();}(function(_0x18d447,_0x4ca47f){const _0x52d854=a36_0x1108,_0x56fa16=_0x18d447();while(!![]){try{const _0x9d935a=parseInt(_0x52d854(0x157))/0x1*(-parseInt(_0x52d854(0x15c))/0x2)+-parseInt(_0x52d854(0x140))/0x3+-parseInt(_0x52d854(0x166))/0x4*(parseInt(_0x52d854(0x12b))/0x5)+-parseInt(_0x52d854(0x165))/0x6+-parseInt(_0x52d854(0x167))/0x7+parseInt(_0x52d854(0x12c))/0x8*(parseInt(_0x52d854(0x14d))/0x9)+-parseInt(_0x52d854(0x168))/0xa*(-parseInt(_0x52d854(0x158))/0xb);if(_0x9d935a===_0x4ca47f)break;else _0x56fa16['push'](_0x56fa16['shift']());}catch(_0x69d627){_0x56fa16['push'](_0x56fa16['shift']());}}}(a36_0x2616,0x8ff6b));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';function a36_0x1108(_0xbdaec9,_0x2cad99){_0xbdaec9=_0xbdaec9-0x11c;const _0x261614=a36_0x2616();let _0x110833=_0x261614[_0xbdaec9];return _0x110833;}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':'bff','command':a36_0x44563e(0x148),'description':a36_0x44563e(0x135),'risk':a36_0x44563e(0x16a),'flags':[{'name':a36_0x44563e(0x129),'type':a36_0x44563e(0x12e),'description':a36_0x44563e(0x14f),'enum':[a36_0x44563e(0x144),'ENDPOINT',a36_0x44563e(0x130)]},{'name':'name','type':a36_0x44563e(0x12e),'description':a36_0x44563e(0x137)},{'name':a36_0x44563e(0x142),'type':'boolean','description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x502737){const _0x2b38ad=a36_0x44563e,_0x57f77f=loadBffProjectConfig(_0x502737[_0x2b38ad(0x16b)]),_0x42b6e7=await readBffLockFile(_0x57f77f[_0x2b38ad(0x13b)]),{appLock:_0xfa29fa}=ensureLockScope(_0x42b6e7??createEmptyBffLock(),_0x502737[_0x2b38ad(0x16b)],_0x57f77f[_0x2b38ad(0x122)],_0x2b38ad(0x148)),_0x4e8d3d=await getTargetFunctions(_0x57f77f,_0x502737),_0x4d7d82=_0x502737[_0x2b38ad(0x11c)](_0x2b38ad(0x142)),_0x422c0d=[];for(const _0x3ef563 of _0x4e8d3d){const _0x2d49c1=await computeFileHash(_0x3ef563[_0x2b38ad(0x12d)]),_0x393fc5=_0xfa29fa[_0x2b38ad(0x124)][_0x3ef563['lockKey']],_0x3ccfbc=!!_0x393fc5&&_0x393fc5[_0x2b38ad(0x15a)]===_0x2d49c1;_0x422c0d[_0x2b38ad(0x148)]({'lockKey':_0x3ef563['lockKey'],'filePath':_0x3ef563[_0x2b38ad(0x12d)],'remoteId':_0x393fc5?.[_0x2b38ad(0x13e)]??null,'mode':_0x393fc5?.[_0x2b38ad(0x13e)]?'update':'create','status':!_0x4d7d82&&_0x3ccfbc?_0x2b38ad(0x14a):_0x2b38ad(0x16c)});}return{'method':_0x2b38ad(0x15f),'url':'/api/management/library/scripts/save','body':{'appCode':_0x502737[_0x2b38ad(0x16b)],'force':_0x4d7d82,'files':_0x422c0d,'cacheClearAtRuntime':_0x422c0d['some'](_0x16c46f=>_0x16c46f[_0x2b38ad(0x134)]===_0x2b38ad(0x16c)),'cacheClearAtRuntimeTimes':_0x422c0d[_0x2b38ad(0x138)](_0x5b9e50=>_0x5b9e50[_0x2b38ad(0x134)]==='would_push')?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x2b38ad(0x147)+_0x422c0d[_0x2b38ad(0x14b)]+_0x2b38ad(0x163)};},async 'execute'(_0x45a248){const _0xeb62b2=a36_0x44563e,_0x47e171=loadBffProjectConfig(_0x45a248[_0xeb62b2(0x16b)]),_0x4c307f=await readBffLockFile(_0x47e171[_0xeb62b2(0x13b)]),{lockData:_0x5c424d,appLock:_0xf6cc28}=ensureLockScope(_0x4c307f??createEmptyBffLock(),_0x45a248[_0xeb62b2(0x16b)],_0x47e171[_0xeb62b2(0x122)],_0xeb62b2(0x148)),_0x14283c=await getTargetFunctions(_0x47e171,_0x45a248);if(_0x14283c['length']===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0xeb62b2(0x12a)};const _0x289abb=_0x45a248[_0xeb62b2(0x11c)]('force'),_0x3b8a94=JSON[_0xeb62b2(0x145)](JSON[_0xeb62b2(0x154)](_0x5c424d)),_0x1ce08b=_0x3b8a94['apps'][_0x45a248[_0xeb62b2(0x16b)]];if(!_0x1ce08b)throw new Error(_0xeb62b2(0x141)+_0x45a248[_0xeb62b2(0x16b)]+_0xeb62b2(0x149));const _0xc5f50b=await buildHookMaps(_0x45a248['appCode'],_0x45a248[_0xeb62b2(0x128)],_0x14283c,_0x1ce08b),_0x1084f7=[],_0x1d6014=[],_0x4b35f2=[];for(const _0x5b3585 of _0x14283c){const _0xa01c7=await computeFileHash(_0x5b3585['filePath']),_0x59e40a=_0x1ce08b[_0xeb62b2(0x124)][_0x5b3585['lockKey']];if(!_0x289abb&&_0x59e40a&&_0x59e40a[_0xeb62b2(0x15a)]===_0xa01c7){_0x1d6014['push']({'lockKey':_0x5b3585[_0xeb62b2(0x15b)],'reason':_0xeb62b2(0x14a)});continue;}try{await uploadSingleFunction(_0x45a248[_0xeb62b2(0x16b)],_0x5b3585,_0x1ce08b,_0xc5f50b);const _0x130ac2=_0x1ce08b[_0xeb62b2(0x124)][_0x5b3585['lockKey']];_0x1084f7[_0xeb62b2(0x148)]({'lockKey':_0x5b3585[_0xeb62b2(0x15b)],'remoteId':_0x130ac2?.[_0xeb62b2(0x13e)]??0x0});}catch(_0x1ba013){_0x4b35f2[_0xeb62b2(0x148)]({'lockKey':_0x5b3585[_0xeb62b2(0x15b)],'error':_0x1ba013 instanceof Error?_0x1ba013['message']:String(_0x1ba013)});}}_0x1ce08b['lastSync']=new Date()[_0xeb62b2(0x159)](),await writeBffLockFile(_0x47e171[_0xeb62b2(0x13b)],_0x3b8a94),await waitForUploadedLockEntries(_0x47e171['lockFilePath'],_0x45a248[_0xeb62b2(0x16b)],_0x1084f7[_0xeb62b2(0x153)](_0x2641bf=>_0x2641bf[_0xeb62b2(0x15b)]));let _0x1e40a4={'attempted':![],'cleared':![]};if(_0x1084f7[_0xeb62b2(0x14b)]>0x0)try{let _0xe0b246='';for(let _0x33bf78=0x0;_0x33bf78<CACHE_CLEAR_ATTEMPTS;_0x33bf78+=0x1){_0xe0b246=await clearBffScriptCache(),_0x33bf78<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x1e40a4={'attempted':!![],'cleared':!![],'message':_0xe0b246||'Runtime\x20script\x20cache\x20cleared.'};}catch(_0x409ed2){_0x1e40a4={'attempted':!![],'cleared':![],'error':_0x409ed2 instanceof Error?_0x409ed2['message']:String(_0x409ed2)};}const _0x19397f=_0x4b35f2[_0xeb62b2(0x14b)]===0x0&&(_0x1e40a4[_0xeb62b2(0x14c)]?_0x1e40a4[_0xeb62b2(0x13c)]:!![]),_0x2af8d1=_0x1e40a4['attempted']?_0x1e40a4[_0xeb62b2(0x13c)]?_0xeb62b2(0x139):_0xeb62b2(0x150):_0xeb62b2(0x13d);return{'ok':_0x19397f,'data':{'uploaded':_0x1084f7,'skipped':_0x1d6014,'failed':_0x4b35f2,'cacheClear':_0x1e40a4},'message':_0xeb62b2(0x162)+_0x1084f7['length']+_0xeb62b2(0x120)+_0x1d6014[_0xeb62b2(0x14b)]+_0xeb62b2(0x123)+_0x4b35f2[_0xeb62b2(0x14b)]+'\x20failed,\x20'+_0x2af8d1};}};async function getTargetFunctions(_0x133cd5,_0x58daa8){const _0x16a771=a36_0x44563e,_0x43fe8f=_0x58daa8[_0x16a771(0x133)](_0x16a771(0x129)),_0x465882=_0x58daa8[_0x16a771(0x133)]('name'),_0x4ca742=normalizeBffType(_0x43fe8f)??undefined;if(_0x465882&&!_0x4ca742)throw CliErrors[_0x16a771(0x143)](_0x16a771(0x11f));const _0x2e776e=await scanLocalBffFunctions(_0x133cd5,_0x4ca742);if(_0x465882){const _0x23fb18=_0x2e776e[_0x16a771(0x14e)](_0x4d85ea=>_0x4d85ea['name']===_0x465882);if(_0x23fb18['length']===0x0)throw CliErrors[_0x16a771(0x143)](_0x16a771(0x121)+_0x4ca742+'/'+_0x465882);return _0x23fb18;}return _0x2e776e;}async function buildHookMaps(_0x3690e1,_0x5c4780,_0x10618e,_0x7f2085){const _0xec8ad=a36_0x44563e,_0x554503=_0x10618e[_0xec8ad(0x138)](_0x1f3303=>_0x1f3303['type']===_0xec8ad(0x130));if(!_0x554503)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x4c4e34=loadAliasMap(_0x5c4780,undefined,resolveApiFilePath(_0x5c4780,_0x3690e1)),_0x20de6f=new Map(_0x4c4e34[_0xec8ad(0x153)](_0x36782c=>[_0x36782c[_0xec8ad(0x13a)],_0x36782c[_0xec8ad(0x136)]]));for(const _0x4e24f8 of Object[_0xec8ad(0x11e)](_0x7f2085[_0xec8ad(0x124)])){_0x4e24f8['alias']&&_0x4e24f8[_0xec8ad(0x136)]&&!_0x20de6f[_0xec8ad(0x126)](_0x4e24f8['alias'])&&_0x20de6f[_0xec8ad(0x161)](_0x4e24f8['alias'],_0x4e24f8[_0xec8ad(0x136)]);}const _0x26774b=await listDatasets(_0x3690e1),_0x2b9d9a=new Map(_0x26774b['map'](_0x109228=>[_0x109228['code'],_0x109228]));return{'aliasToDatasetCode':_0x20de6f,'datasetCodeToDataset':_0x2b9d9a};}async function uploadSingleFunction(_0x59f8e9,_0x1b093d,_0x6367cf,_0x2a00d6){const _0x4ba075=a36_0x44563e,_0xac564d=await readFile(_0x1b093d[_0x4ba075(0x12d)],_0x4ba075(0x160)),_0x5cc3c2=await computeFileHash(_0x1b093d['filePath']),_0x20a8c6=_0x6367cf[_0x4ba075(0x124)][_0x1b093d[_0x4ba075(0x15b)]];if(_0x20a8c6?.[_0x4ba075(0x13e)]&&_0x20a8c6['version']==null)throw CliErrors[_0x4ba075(0x143)](_0x1b093d[_0x4ba075(0x15b)]+_0x4ba075(0x131));let _0xb50d28=extractScriptDescription(_0xac564d);if(!_0xb50d28&&_0x20a8c6?.['remoteId']){const _0xfd21e6=await getBffScriptInfo(_0x20a8c6[_0x4ba075(0x13e)]);_0xb50d28=_0xfd21e6['description']||undefined;}const _0x28c26f={'appCode':_0x59f8e9,'functionName':_0x1b093d[_0x4ba075(0x15d)],'scriptType':_0x1b093d[_0x4ba075(0x129)],'scriptContent':_0xac564d};if(_0x20a8c6?.[_0x4ba075(0x13e)])_0x28c26f['id']=_0x20a8c6[_0x4ba075(0x13e)];if(_0x20a8c6?.[_0x4ba075(0x146)]!=null)_0x28c26f[_0x4ba075(0x146)]=_0x20a8c6[_0x4ba075(0x146)];if(_0xb50d28)_0x28c26f[_0x4ba075(0x169)]=_0xb50d28;if(_0x1b093d[_0x4ba075(0x129)]==='HOOK'){const _0x51994c=_0x1b093d['alias'];if(!_0x51994c||!_0x1b093d[_0x4ba075(0x132)]||!_0x1b093d['functionNode'])throw CliErrors[_0x4ba075(0x143)](_0x4ba075(0x164)+_0x1b093d[_0x4ba075(0x15b)]);const _0x5b663d=_0x2a00d6[_0x4ba075(0x151)][_0x4ba075(0x12f)](_0x51994c)??_0x20a8c6?.['datasetCode']??_0x51994c,_0x544c00=_0x2a00d6[_0x4ba075(0x15e)][_0x4ba075(0x12f)](_0x5b663d);if(!_0x544c00)throw CliErrors[_0x4ba075(0x143)]('Cannot\x20resolve\x20dataset\x20for\x20\x22'+_0x51994c+_0x4ba075(0x13f)+('Run\x20`'+CLI_BIN_NAME+_0x4ba075(0x127)));_0x28c26f['datasetId']=_0x544c00['id'],_0x28c26f[_0x4ba075(0x132)]=_0x1b093d[_0x4ba075(0x132)],_0x28c26f[_0x4ba075(0x152)]=_0x1b093d[_0x4ba075(0x152)];}const _0x1ead39=await saveBffScript(_0x28c26f),_0xafc3ef=_0x1ead39['id'],_0x318aa0=_0x1ead39[_0x4ba075(0x155)]??await getBffScriptInfo(_0xafc3ef),_0x277977={'hash':_0x5cc3c2,'remoteId':_0xafc3ef,'version':_0x318aa0[_0x4ba075(0x146)]};if(_0x1b093d[_0x4ba075(0x129)]===_0x4ba075(0x130)){const _0x5f4bd6=_0x1b093d[_0x4ba075(0x13a)],_0x50dbf3=_0x2a00d6['aliasToDatasetCode']['get'](_0x5f4bd6)??_0x20a8c6?.[_0x4ba075(0x136)]??_0x5f4bd6;_0x2a00d6['aliasToDatasetCode'][_0x4ba075(0x126)](_0x5f4bd6)?_0x277977[_0x4ba075(0x13a)]=_0x5f4bd6:_0x277977[_0x4ba075(0x13a)]=_0x20a8c6?.[_0x4ba075(0x13a)],_0x277977[_0x4ba075(0x136)]=_0x50dbf3,_0x277977[_0x4ba075(0x132)]=_0x1b093d[_0x4ba075(0x132)],_0x277977[_0x4ba075(0x152)]=_0x1b093d['functionNode'];}_0x6367cf[_0x4ba075(0x124)][_0x1b093d[_0x4ba075(0x15b)]]=_0x277977;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x3b4ff4,_0x301164,_0x56abe9){const _0x12c9ff=a36_0x44563e;if(_0x56abe9['length']===0x0)return;for(let _0x2deaa4=0x0;_0x2deaa4<LOCK_SETTLE_RETRY_COUNT;_0x2deaa4+=0x1){const _0x2a5d94=await readBffLockFile(_0x3b4ff4),_0x4aeb77=_0x2a5d94?.[_0x12c9ff(0x125)]?.[_0x301164]?.[_0x12c9ff(0x124)]??{},_0x4700db=_0x56abe9[_0x12c9ff(0x156)](_0x5a046e=>!!_0x4aeb77[_0x5a046e]?.[_0x12c9ff(0x13e)]);if(_0x4700db)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x12c9ff(0x11d)+_0x56abe9['join'](',\x20')+'.');}
|
|
1
|
+
const a36_0xcb0b31=a36_0x553f;(function(_0x4f0aee,_0x156145){const _0xcf7f46=a36_0x553f,_0x20615e=_0x4f0aee();while(!![]){try{const _0x31aa23=-parseInt(_0xcf7f46(0x10e))/0x1+parseInt(_0xcf7f46(0x117))/0x2+-parseInt(_0xcf7f46(0x12d))/0x3*(parseInt(_0xcf7f46(0x122))/0x4)+-parseInt(_0xcf7f46(0x10d))/0x5+parseInt(_0xcf7f46(0x11d))/0x6+parseInt(_0xcf7f46(0x123))/0x7*(-parseInt(_0xcf7f46(0x126))/0x8)+parseInt(_0xcf7f46(0xfd))/0x9*(parseInt(_0xcf7f46(0x140))/0xa);if(_0x31aa23===_0x156145)break;else _0x20615e['push'](_0x20615e['shift']());}catch(_0x4f6527){_0x20615e['push'](_0x20615e['shift']());}}}(a36_0x5b7b,0x2cdfb));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';function a36_0x5b7b(){const _0x1175ff=['name','force','106080sDAwaP','description','boolean','Push\x20local\x20BFF\x20scripts\x20to\x20remote','every','4556HkDzJa','14OLKptd','apiDir','COMMON','618776tLBBSE','map','would_push','POST','unchanged','string','parse','123TYsZQu','datasetId','Cannot\x20resolve\x20dataset\x20for\x20\x22','scriptsRoot','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','hash','\x22\x20not\x20found\x20after\x20ensureLockScope.','version','\x20skipped,\x20','join','Runtime\x20script\x20cache\x20cleared.','lastSync','update','push','runtime\x20cache\x20clear\x20failed','type','cleared','remoteId','ENDPOINT','10850DjxHhm','datasetCodeToDataset','aliasToDatasetCode','functionNode','datasetCode','\x22.\x20','stringify','Local\x20function\x20not\x20found:\x20','filePath','runtime\x20cache\x20not\x20needed','set','lockKey','Incomplete\x20HOOK\x20path:\x20','lockFilePath','Would\x20inspect\x20','create','Push\x20complete:\x20','status','script','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','5193xGtPYj','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','has','bool','validation',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','filter','bff','alias','get','toISOString','HOOK','code','write','some','functions','1719335uZdBsV','270930mCbysq','utf8','str','operationType','message','values','Push\x20only\x20this\x20script\x20type','apps','length','712536vlDhwS','attempted','appCode','Lock\x20scope\x20for\x20app\x20\x22'];a36_0x5b7b=function(){return _0x1175ff;};return a36_0x5b7b();}import{computeFileHash}from'../../core/bff/hash.js';function a36_0x553f(_0x16801f,_0x38c13b){_0x16801f=_0x16801f-0xf2;const _0x5b7b9b=a36_0x5b7b();let _0x553f93=_0x5b7b9b[_0x16801f];return _0x553f93;}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':a36_0xcb0b31(0x104),'command':'push','description':a36_0xcb0b31(0x120),'risk':a36_0xcb0b31(0x10a),'flags':[{'name':'type','type':a36_0xcb0b31(0x12b),'description':a36_0xcb0b31(0x114),'enum':[a36_0xcb0b31(0x125),a36_0xcb0b31(0x13f),a36_0xcb0b31(0x108)]},{'name':a36_0xcb0b31(0x11b),'type':a36_0xcb0b31(0x12b),'description':a36_0xcb0b31(0xfe)},{'name':a36_0xcb0b31(0x11c),'type':a36_0xcb0b31(0x11f),'description':'Force\x20push\x20ignoring\x20hash\x20protection'}],async 'dryRun'(_0x302e20){const _0x5c8ea1=a36_0xcb0b31,_0x141003=loadBffProjectConfig(_0x302e20[_0x5c8ea1(0x119)]),_0x1f70ce=await readBffLockFile(_0x141003[_0x5c8ea1(0xf6)]),{appLock:_0x441042}=ensureLockScope(_0x1f70ce??createEmptyBffLock(),_0x302e20[_0x5c8ea1(0x119)],_0x141003['scriptsRoot'],_0x5c8ea1(0x13a)),_0x3e2c52=await getTargetFunctions(_0x141003,_0x302e20),_0x5e1ede=_0x302e20['bool'](_0x5c8ea1(0x11c)),_0x2f4132=[];for(const _0x3ce68e of _0x3e2c52){const _0x2b2188=await computeFileHash(_0x3ce68e['filePath']),_0x4a17a3=_0x441042[_0x5c8ea1(0x10c)][_0x3ce68e[_0x5c8ea1(0xf4)]],_0x1359c2=!!_0x4a17a3&&_0x4a17a3[_0x5c8ea1(0x132)]===_0x2b2188;_0x2f4132[_0x5c8ea1(0x13a)]({'lockKey':_0x3ce68e[_0x5c8ea1(0xf4)],'filePath':_0x3ce68e[_0x5c8ea1(0x148)],'remoteId':_0x4a17a3?.[_0x5c8ea1(0x13e)]??null,'mode':_0x4a17a3?.[_0x5c8ea1(0x13e)]?_0x5c8ea1(0x139):_0x5c8ea1(0xf8),'status':!_0x5e1ede&&_0x1359c2?_0x5c8ea1(0x12a):_0x5c8ea1(0x128)});}return{'method':_0x5c8ea1(0x129),'url':'/api/management/library/scripts/save','body':{'appCode':_0x302e20['appCode'],'force':_0x5e1ede,'files':_0x2f4132,'cacheClearAtRuntime':_0x2f4132[_0x5c8ea1(0x10b)](_0x5c5822=>_0x5c5822[_0x5c8ea1(0xfa)]===_0x5c8ea1(0x128)),'cacheClearAtRuntimeTimes':_0x2f4132[_0x5c8ea1(0x10b)](_0x2eb48c=>_0x2eb48c['status']==='would_push')?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x5c8ea1(0xf7)+_0x2f4132[_0x5c8ea1(0x116)]+'\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded'};},async 'execute'(_0x38564d){const _0x55c563=a36_0xcb0b31,_0x3692b2=loadBffProjectConfig(_0x38564d[_0x55c563(0x119)]),_0x554f01=await readBffLockFile(_0x3692b2['lockFilePath']),{lockData:_0x56fb0b,appLock:_0x64f824}=ensureLockScope(_0x554f01??createEmptyBffLock(),_0x38564d['appCode'],_0x3692b2[_0x55c563(0x130)],_0x55c563(0x13a)),_0x3caa72=await getTargetFunctions(_0x3692b2,_0x38564d);if(_0x3caa72['length']===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':'No\x20local\x20BFF\x20functions\x20found.'};const _0x16320d=_0x38564d[_0x55c563(0x100)]('force'),_0x56782b=JSON[_0x55c563(0x12c)](JSON[_0x55c563(0x146)](_0x56fb0b)),_0x58a6a1=_0x56782b[_0x55c563(0x115)][_0x38564d[_0x55c563(0x119)]];if(!_0x58a6a1)throw new Error(_0x55c563(0x11a)+_0x38564d[_0x55c563(0x119)]+_0x55c563(0x133));const _0x1ed007=await buildHookMaps(_0x38564d[_0x55c563(0x119)],_0x38564d[_0x55c563(0x124)],_0x3caa72,_0x58a6a1),_0x4769a4=[],_0x2a4c42=[],_0x5e357f=[];for(const _0xa08a04 of _0x3caa72){const _0x6f6ecd=await computeFileHash(_0xa08a04[_0x55c563(0x148)]),_0x5310f4=_0x58a6a1[_0x55c563(0x10c)][_0xa08a04[_0x55c563(0xf4)]];if(!_0x16320d&&_0x5310f4&&_0x5310f4[_0x55c563(0x132)]===_0x6f6ecd){_0x2a4c42['push']({'lockKey':_0xa08a04[_0x55c563(0xf4)],'reason':_0x55c563(0x12a)});continue;}try{await uploadSingleFunction(_0x38564d['appCode'],_0xa08a04,_0x58a6a1,_0x1ed007);const _0x45d6d9=_0x58a6a1[_0x55c563(0x10c)][_0xa08a04[_0x55c563(0xf4)]];_0x4769a4['push']({'lockKey':_0xa08a04[_0x55c563(0xf4)],'remoteId':_0x45d6d9?.[_0x55c563(0x13e)]??0x0});}catch(_0x27621a){_0x5e357f['push']({'lockKey':_0xa08a04[_0x55c563(0xf4)],'error':_0x27621a instanceof Error?_0x27621a[_0x55c563(0x112)]:String(_0x27621a)});}}_0x58a6a1[_0x55c563(0x138)]=new Date()[_0x55c563(0x107)](),await writeBffLockFile(_0x3692b2['lockFilePath'],_0x56782b),await waitForUploadedLockEntries(_0x3692b2[_0x55c563(0xf6)],_0x38564d[_0x55c563(0x119)],_0x4769a4[_0x55c563(0x127)](_0x1760df=>_0x1760df[_0x55c563(0xf4)]));let _0x390baa={'attempted':![],'cleared':![]};if(_0x4769a4[_0x55c563(0x116)]>0x0)try{let _0x43fa79='';for(let _0x42665c=0x0;_0x42665c<CACHE_CLEAR_ATTEMPTS;_0x42665c+=0x1){_0x43fa79=await clearBffScriptCache(),_0x42665c<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x390baa={'attempted':!![],'cleared':!![],'message':_0x43fa79||_0x55c563(0x137)};}catch(_0x167af3){_0x390baa={'attempted':!![],'cleared':![],'error':_0x167af3 instanceof Error?_0x167af3['message']:String(_0x167af3)};}const _0x3640e8=_0x5e357f[_0x55c563(0x116)]===0x0&&(_0x390baa[_0x55c563(0x118)]?_0x390baa[_0x55c563(0x13d)]:!![]),_0x5848b0=_0x390baa[_0x55c563(0x118)]?_0x390baa[_0x55c563(0x13d)]?'runtime\x20cache\x20cleared':_0x55c563(0x13b):_0x55c563(0xf2);return{'ok':_0x3640e8,'data':{'uploaded':_0x4769a4,'skipped':_0x2a4c42,'failed':_0x5e357f,'cacheClear':_0x390baa},'message':_0x55c563(0xf9)+_0x4769a4[_0x55c563(0x116)]+'\x20uploaded,\x20'+_0x2a4c42[_0x55c563(0x116)]+_0x55c563(0x135)+_0x5e357f[_0x55c563(0x116)]+'\x20failed,\x20'+_0x5848b0};}};async function getTargetFunctions(_0x1aaa80,_0x37e931){const _0x464e62=a36_0xcb0b31,_0x133a56=_0x37e931[_0x464e62(0x110)]('type'),_0x4eb142=_0x37e931[_0x464e62(0x110)](_0x464e62(0x11b)),_0x2fbd52=normalizeBffType(_0x133a56)??undefined;if(_0x4eb142&&!_0x2fbd52)throw CliErrors['validation'](_0x464e62(0x131));const _0x5efe0b=await scanLocalBffFunctions(_0x1aaa80,_0x2fbd52);if(_0x4eb142){const _0x1a07df=_0x5efe0b[_0x464e62(0x103)](_0x5bedf9=>_0x5bedf9[_0x464e62(0x11b)]===_0x4eb142);if(_0x1a07df['length']===0x0)throw CliErrors[_0x464e62(0x101)](_0x464e62(0x147)+_0x2fbd52+'/'+_0x4eb142);return _0x1a07df;}return _0x5efe0b;}async function buildHookMaps(_0x2c8fa5,_0x4ab35c,_0x2cee7f,_0x1f6387){const _0x1943ac=a36_0xcb0b31,_0x393c25=_0x2cee7f[_0x1943ac(0x10b)](_0x3ac100=>_0x3ac100[_0x1943ac(0x13c)]===_0x1943ac(0x108));if(!_0x393c25)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x6b172=loadAliasMap(_0x4ab35c,undefined,resolveApiFilePath(_0x4ab35c,_0x2c8fa5)),_0x5eb49b=new Map(_0x6b172[_0x1943ac(0x127)](_0xb333ec=>[_0xb333ec[_0x1943ac(0x105)],_0xb333ec['datasetCode']]));for(const _0x1656d6 of Object[_0x1943ac(0x113)](_0x1f6387['functions'])){_0x1656d6[_0x1943ac(0x105)]&&_0x1656d6[_0x1943ac(0x144)]&&!_0x5eb49b[_0x1943ac(0xff)](_0x1656d6[_0x1943ac(0x105)])&&_0x5eb49b[_0x1943ac(0xf3)](_0x1656d6[_0x1943ac(0x105)],_0x1656d6[_0x1943ac(0x144)]);}const _0x5dc76c=await listDatasets(_0x2c8fa5),_0x3beb2c=new Map(_0x5dc76c['map'](_0x244d76=>[_0x244d76[_0x1943ac(0x109)],_0x244d76]));return{'aliasToDatasetCode':_0x5eb49b,'datasetCodeToDataset':_0x3beb2c};}async function uploadSingleFunction(_0x29f533,_0x5257c0,_0xfda0ab,_0x35c0f5){const _0x39c3c1=a36_0xcb0b31,_0x244c56=await readFile(_0x5257c0[_0x39c3c1(0x148)],_0x39c3c1(0x10f)),_0x3a2603=await computeFileHash(_0x5257c0[_0x39c3c1(0x148)]),_0x2d168b=_0xfda0ab[_0x39c3c1(0x10c)][_0x5257c0['lockKey']];if(_0x2d168b?.[_0x39c3c1(0x13e)]&&_0x2d168b[_0x39c3c1(0x134)]==null)throw CliErrors[_0x39c3c1(0x101)](_0x5257c0[_0x39c3c1(0xf4)]+_0x39c3c1(0x102));let _0x4773e6=extractScriptDescription(_0x244c56);if(!_0x4773e6&&_0x2d168b?.[_0x39c3c1(0x13e)]){const _0x208659=await getBffScriptInfo(_0x2d168b['remoteId']);_0x4773e6=_0x208659[_0x39c3c1(0x11e)]||undefined;}const _0x38afcd={'appCode':_0x29f533,'functionName':_0x5257c0[_0x39c3c1(0x11b)],'scriptType':_0x5257c0[_0x39c3c1(0x13c)],'scriptContent':_0x244c56};if(_0x2d168b?.[_0x39c3c1(0x13e)])_0x38afcd['id']=_0x2d168b['remoteId'];if(_0x2d168b?.[_0x39c3c1(0x134)]!=null)_0x38afcd['version']=_0x2d168b[_0x39c3c1(0x134)];if(_0x4773e6)_0x38afcd[_0x39c3c1(0x11e)]=_0x4773e6;if(_0x5257c0[_0x39c3c1(0x13c)]===_0x39c3c1(0x108)){const _0x3ebed7=_0x5257c0['alias'];if(!_0x3ebed7||!_0x5257c0[_0x39c3c1(0x111)]||!_0x5257c0[_0x39c3c1(0x143)])throw CliErrors[_0x39c3c1(0x101)](_0x39c3c1(0xf5)+_0x5257c0[_0x39c3c1(0xf4)]);const _0x245229=_0x35c0f5['aliasToDatasetCode'][_0x39c3c1(0x106)](_0x3ebed7)??_0x2d168b?.['datasetCode']??_0x3ebed7,_0x25b63a=_0x35c0f5[_0x39c3c1(0x141)][_0x39c3c1(0x106)](_0x245229);if(!_0x25b63a)throw CliErrors[_0x39c3c1(0x101)](_0x39c3c1(0x12f)+_0x3ebed7+_0x39c3c1(0x145)+('Run\x20`'+CLI_BIN_NAME+_0x39c3c1(0xfc)));_0x38afcd[_0x39c3c1(0x12e)]=_0x25b63a['id'],_0x38afcd[_0x39c3c1(0x111)]=_0x5257c0[_0x39c3c1(0x111)],_0x38afcd[_0x39c3c1(0x143)]=_0x5257c0['functionNode'];}const _0x5253ea=await saveBffScript(_0x38afcd),_0x16eee=_0x5253ea['id'],_0x3b6004=_0x5253ea[_0x39c3c1(0xfb)]??await getBffScriptInfo(_0x16eee),_0x394798={'hash':_0x3a2603,'remoteId':_0x16eee,'version':_0x3b6004[_0x39c3c1(0x134)]};if(_0x5257c0[_0x39c3c1(0x13c)]==='HOOK'){const _0x106040=_0x5257c0[_0x39c3c1(0x105)],_0x1ac65e=_0x35c0f5['aliasToDatasetCode'][_0x39c3c1(0x106)](_0x106040)??_0x2d168b?.[_0x39c3c1(0x144)]??_0x106040;_0x35c0f5[_0x39c3c1(0x142)][_0x39c3c1(0xff)](_0x106040)?_0x394798[_0x39c3c1(0x105)]=_0x106040:_0x394798[_0x39c3c1(0x105)]=_0x2d168b?.['alias'],_0x394798[_0x39c3c1(0x144)]=_0x1ac65e,_0x394798['operationType']=_0x5257c0[_0x39c3c1(0x111)],_0x394798['functionNode']=_0x5257c0[_0x39c3c1(0x143)];}_0xfda0ab[_0x39c3c1(0x10c)][_0x5257c0[_0x39c3c1(0xf4)]]=_0x394798;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0xd9ab2a,_0xe08d26,_0x5e4be9){const _0x13c121=a36_0xcb0b31;if(_0x5e4be9[_0x13c121(0x116)]===0x0)return;for(let _0x3ef9d0=0x0;_0x3ef9d0<LOCK_SETTLE_RETRY_COUNT;_0x3ef9d0+=0x1){const _0x24264d=await readBffLockFile(_0xd9ab2a),_0x3ab1e6=_0x24264d?.['apps']?.[_0xe08d26]?.[_0x13c121(0x10c)]??{},_0x592fbf=_0x5e4be9[_0x13c121(0x121)](_0x467611=>!!_0x3ab1e6[_0x467611]?.[_0x13c121(0x13e)]);if(_0x592fbf)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error('Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20'+_0x5e4be9[_0x13c121(0x136)](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a37_0x48db76=a37_0x144a;(function(_0xb2ad7a,_0x557d0f){const _0x51fd35=a37_0x144a,_0x550632=_0xb2ad7a();while(!![]){try{const _0x335479=-parseInt(_0x51fd35(0x19c))/0x1*(parseInt(_0x51fd35(0x1a9))/0x2)+-parseInt(_0x51fd35(0x1a5))/0x3+-parseInt(_0x51fd35(0x1b8))/0x4+-parseInt(_0x51fd35(0x1aa))/0x5+parseInt(_0x51fd35(0x1b3))/0x6*(-parseInt(_0x51fd35(0x19b))/0x7)+parseInt(_0x51fd35(0x1a8))/0x8+-parseInt(_0x51fd35(0x19e))/0x9*(-parseInt(_0x51fd35(0x1b9))/0xa);if(_0x335479===_0x557d0f)break;else _0x550632['push'](_0x550632['shift']());}catch(_0x1a88c5){_0x550632['push'](_0x550632['shift']());}}}(a37_0x113d,0x3f4bb));import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a37_0x113d(){const _0x541d34=['length','All\x20BFF\x20scripts\x20are\x20in\x20sync.','24rVGTnk','functions','status','read','has','375388ptIykf','590QtKXGq','apiDir','appCode','bff','hash','all','556850wYKMgn','11XgduXy','remote','221679sqVBGI','alias','map','bool','\x20unchanged','\x20modified,\x20','lockKey','843477jJlymg','lockFilePath','filePath','3304008jMWvrN','87938NWNHgi','2150530nFbRMm','Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','datasetCode','\x20remote-only','push','\x20added,\x20','boolean'];a37_0x113d=function(){return _0x541d34;};return a37_0x113d();}import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';function a37_0x144a(_0x1e783d,_0x37d784){_0x1e783d=_0x1e783d-0x198;const _0x113d6c=a37_0x113d();let _0x144afd=_0x113d6c[_0x1e783d];return _0x144afd;}import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a37_0x48db76(0x198),'command':a37_0x48db76(0x1b5),'description':a37_0x48db76(0x1ab),'risk':a37_0x48db76(0x1b6),'flags':[{'name':a37_0x48db76(0x19d),'type':a37_0x48db76(0x1b0),'description':'Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally'}],async 'execute'(_0x3b3221){const _0x2b1bd0=a37_0x48db76,_0x58baf0=loadBffProjectConfig(_0x3b3221['appCode']),_0x5cfab1=await readBffLockFile(_0x58baf0[_0x2b1bd0(0x1a6)]),{appLock:_0x2f2b04}=ensureLockScope(_0x5cfab1??createEmptyBffLock(),_0x3b3221[_0x2b1bd0(0x1bb)],_0x58baf0['scriptsRoot'],_0x2b1bd0(0x1b5)),_0x1309b3=await scanLocalBffFunctions(_0x58baf0),_0x2243ae=[],_0x1ad177=[],_0x1d7328=[];for(const _0x52da08 of _0x1309b3){const _0x3d1aca=await computeFileHash(_0x52da08[_0x2b1bd0(0x1a7)]),_0x4de100=_0x2f2b04[_0x2b1bd0(0x1b4)][_0x52da08[_0x2b1bd0(0x1a4)]];if(!_0x4de100)_0x2243ae[_0x2b1bd0(0x1ae)](_0x52da08[_0x2b1bd0(0x1a4)]);else _0x4de100[_0x2b1bd0(0x199)]!==_0x3d1aca?_0x1ad177[_0x2b1bd0(0x1ae)](_0x52da08[_0x2b1bd0(0x1a4)]):_0x1d7328[_0x2b1bd0(0x1ae)](_0x52da08[_0x2b1bd0(0x1a4)]);}const _0x33b7b1=[];if(_0x3b3221[_0x2b1bd0(0x1a1)](_0x2b1bd0(0x19d))){const _0x4bafa4=loadAliasMap(_0x3b3221[_0x2b1bd0(0x1ba)],undefined,resolveApiFilePath(_0x3b3221[_0x2b1bd0(0x1ba)],_0x3b3221[_0x2b1bd0(0x1bb)])),_0x28d6cc=new Map(_0x4bafa4[_0x2b1bd0(0x1a0)](_0x218648=>[_0x218648[_0x2b1bd0(0x1ac)],_0x218648[_0x2b1bd0(0x19f)]])),[_0x28c72b,_0x5b62b2]=await Promise[_0x2b1bd0(0x19a)]([listBffScripts(_0x3b3221[_0x2b1bd0(0x1bb)]),getBffScriptStatistics(_0x3b3221['appCode'])]),_0x466660=createHookLocationMap(_0x5b62b2),_0x1105c2=new Set(_0x1309b3[_0x2b1bd0(0x1a0)](_0xfd3a7f=>_0xfd3a7f['lockKey']));for(const _0xd1b78b of _0x28c72b){const _0x3050bc=resolveRemoteScriptTarget(_0x58baf0,_0xd1b78b,_0x466660,_0x2f2b04[_0x2b1bd0(0x1b4)],_0x28d6cc);_0x3050bc&&!_0x1105c2[_0x2b1bd0(0x1b7)](_0x3050bc[_0x2b1bd0(0x1a4)])&&_0x33b7b1[_0x2b1bd0(0x1ae)](_0x3050bc['lockKey']);}}const _0x55eda2=_0x2243ae[_0x2b1bd0(0x1b1)]===0x0&&_0x1ad177['length']===0x0&&_0x33b7b1[_0x2b1bd0(0x1b1)]===0x0;return{'ok':!![],'data':{'added':_0x2243ae,'modified':_0x1ad177,'unchanged':_0x1d7328,'remoteOnly':_0x33b7b1},'message':_0x55eda2?_0x2b1bd0(0x1b2):_0x2243ae['length']+_0x2b1bd0(0x1af)+_0x1ad177[_0x2b1bd0(0x1b1)]+_0x2b1bd0(0x1a3)+_0x1d7328[_0x2b1bd0(0x1b1)]+_0x2b1bd0(0x1a2)+(_0x33b7b1[_0x2b1bd0(0x1b1)]>0x0?',\x20'+_0x33b7b1[_0x2b1bd0(0x1b1)]+_0x2b1bd0(0x1ad):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a38_0x1d49(_0x4773e1,_0x1cdc9a){_0x4773e1=_0x4773e1-0x196;const _0x171346=a38_0x1713();let _0x1d4979=_0x171346[_0x4773e1];return _0x1d4979;}const a38_0x53333f=a38_0x1d49;(function(_0x372507,_0x4ea19d){const _0x2a3e29=a38_0x1d49,_0x362c34=_0x372507();while(!![]){try{const _0x467811=-parseInt(_0x2a3e29(0x1a6))/0x1*(parseInt(_0x2a3e29(0x1af))/0x2)+-parseInt(_0x2a3e29(0x1a3))/0x3*(-parseInt(_0x2a3e29(0x1a1))/0x4)+parseInt(_0x2a3e29(0x1b2))/0x5+parseInt(_0x2a3e29(0x19c))/0x6+parseInt(_0x2a3e29(0x1a7))/0x7*(parseInt(_0x2a3e29(0x1b3))/0x8)+-parseInt(_0x2a3e29(0x1b7))/0x9+parseInt(_0x2a3e29(0x19b))/0xa*(-parseInt(_0x2a3e29(0x1b1))/0xb);if(_0x467811===_0x4ea19d)break;else _0x362c34['push'](_0x362c34['shift']());}catch(_0x18e9b5){_0x362c34['push'](_0x362c34['shift']());}}}(a38_0x1713,0xbe670));import{CliErrors}from'../../errors.js';import{installBuiltinSkill}from'../../skills/builtin-skill.js';import{logger}from'../../utils/logger.js';function a38_0x1713(){const _0x190f54=['repairCommand','installedPath','code','info','14650OZPzbs','7920738YXVsUQ','apiError','setLogPath','CLI\x20Built-in\x20Skill\x20','error','1696NkUClX','Installing\x20CLI\x20Built-in\x20Skill\x20from\x20the\x20current\x20package.','9708iILwTl','read','log','17868rSWxoU','2123723mFUFVs','Resolve\x20the\x20Skills\x20CLI\x20installation\x20issue\x20and\x20run:\x20','skillVersion','changed','\x20at\x20','cli-skill-install','cwd','inherit','52fqiBtb','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','14234xPfIkz','1334865ZwrCfN','16KECXvB',']:\x20','\x20via\x20skills@latest','\x20installed','3831948LMEHHU','nonInteractive'];a38_0x1713=function(){return _0x190f54;};return a38_0x1713();}export const cliSkillDefinitions=[{'service':'cli-skill','command':'install','description':a38_0x53333f(0x1b0),'risk':a38_0x53333f(0x1a4),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x3a8ec7){const _0x2f2c2a=a38_0x53333f;logger[_0x2f2c2a(0x19e)](process[_0x2f2c2a(0x1ad)]()),logger[_0x2f2c2a(0x19a)](_0x2f2c2a(0x1ac),_0x2f2c2a(0x1a2));const _0x4b6689=installBuiltinSkill({'stdio':_0x3a8ec7[_0x2f2c2a(0x196)]?'pipe':_0x2f2c2a(0x1ae)});if(!_0x4b6689['ok'])throw CliErrors[_0x2f2c2a(0x19d)]('Built-in\x20Skill\x20install\x20failed\x20['+_0x4b6689[_0x2f2c2a(0x199)]+_0x2f2c2a(0x1b4)+(_0x4b6689[_0x2f2c2a(0x1a0)]||'unknown'),_0x2f2c2a(0x1a8)+_0x4b6689[_0x2f2c2a(0x197)]);return console[_0x2f2c2a(0x1a5)](_0x4b6689[_0x2f2c2a(0x1aa)]?_0x2f2c2a(0x19f)+_0x4b6689[_0x2f2c2a(0x1a9)]+_0x2f2c2a(0x1b6)+(_0x4b6689[_0x2f2c2a(0x198)]?'\x20at\x20'+_0x4b6689[_0x2f2c2a(0x198)]:_0x2f2c2a(0x1b5)):_0x2f2c2a(0x19f)+_0x4b6689[_0x2f2c2a(0x1a9)]+'\x20is\x20already\x20current'+(_0x4b6689[_0x2f2c2a(0x198)]?_0x2f2c2a(0x1ab)+_0x4b6689['installedPath']:'')),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0x291600=a39_0x2482;(function(_0x516339,_0xeed09a){const _0x49e9e0=a39_0x2482,_0x2af6e1=_0x516339();while(!![]){try{const _0x10c466=parseInt(_0x49e9e0(0xf6))/0x1+parseInt(_0x49e9e0(0x101))/0x2*(parseInt(_0x49e9e0(0xfa))/0x3)+parseInt(_0x49e9e0(0x134))/0x4*(-parseInt(_0x49e9e0(0xf4))/0x5)+-parseInt(_0x49e9e0(0x118))/0x6*(parseInt(_0x49e9e0(0x110))/0x7)+-parseInt(_0x49e9e0(0x120))/0x8*(-parseInt(_0x49e9e0(0x119))/0x9)+parseInt(_0x49e9e0(0x12e))/0xa+-parseInt(_0x49e9e0(0x132))/0xb*(-parseInt(_0x49e9e0(0x128))/0xc);if(_0x10c466===_0xeed09a)break;else _0x2af6e1['push'](_0x2af6e1['shift']());}catch(_0x35d9e7){_0x2af6e1['push'](_0x2af6e1['shift']());}}}(a39_0x174b,0xc569c));import a39_0x476f8e from'chalk';import a39_0xc794ce from'ora';import a39_0x2063e1 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 a39_0x2482(_0x2f47b6,_0xd99660){_0x2f47b6=_0x2f47b6-0xe1;const _0x174b0d=a39_0x174b();let _0x2482f0=_0x174b0d[_0x2f47b6];return _0x2482f0;}function getCurrentVersion(){const _0x11195a=a39_0x2482;return GIT_COMMIT!==_0x11195a(0x11c)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x11195a(0x124)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x359e6f=a39_0x2482,_0x3863e0=process[_0x359e6f(0x106)]['toLowerCase']();if(_0x3863e0[_0x359e6f(0x11f)](_0x359e6f(0xe2)))return _0x359e6f(0xe2);return _0x359e6f(0xf5);}const updateFlags=[{'name':a39_0x291600(0xfc),'type':'boolean','description':a39_0x291600(0xe6),'default':![]},{'name':a39_0x291600(0x117),'type':a39_0x291600(0xe7),'description':a39_0x291600(0xec)}];function getRequestedVersion(_0x243e25){const _0x5ff4da=a39_0x291600;return _0x243e25[_0x5ff4da(0x111)](_0x5ff4da(0x117))[_0x5ff4da(0x100)]();}async function validateUpdateFlags(_0x103e35){const _0x295eff=a39_0x291600,_0x5cd30a=_0x103e35[_0x295eff(0xf9)](_0x295eff(0xfc)),_0x58697b=getRequestedVersion(_0x103e35);if(_0x5cd30a&&_0x58697b)throw CliErrors[_0x295eff(0x121)](_0x295eff(0x12c),_0x295eff(0x116));if(_0x58697b&&!a39_0x2063e1[_0x295eff(0x11e)](_0x58697b))throw CliErrors[_0x295eff(0x121)](_0x295eff(0x10f)+_0x58697b,_0x295eff(0x131));}async function fetchNpmDistTags(){const _0x2511a6=a39_0x291600;try{const _0x92dc01=await fetch(_0x2511a6(0x105)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x2511a6(0xfb),{'signal':AbortSignal[_0x2511a6(0xf7)](0x2710)});if(!_0x92dc01['ok'])return null;const _0x3d4729=await _0x92dc01['json']();if(!_0x3d4729||typeof _0x3d4729!==_0x2511a6(0x102))return null;return Object[_0x2511a6(0xe4)](Object['entries'](_0x3d4729)[_0x2511a6(0x107)](([,_0x4039df])=>typeof _0x4039df==='string'&&_0x4039df[_0x2511a6(0x100)]()[_0x2511a6(0xf1)]>0x0)[_0x2511a6(0x12a)](([_0x3cb587,_0x547ccb])=>[_0x3cb587,String(_0x547ccb)[_0x2511a6(0x100)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x38e6c5){const _0x57d458=await fetchNpmDistTags();return _0x57d458?.[_0x38e6c5]??null;}async function fetchLatestVersion(){const _0x7457aa=a39_0x291600;return fetchNpmDistTagVersion(_0x7457aa(0x114));}async function resolveTargetVersion(_0x3c5683){const _0x440c38=a39_0x291600,_0x485cae=getRequestedVersion(_0x3c5683);if(_0x485cae)return{'version':_0x485cae,'source':_0x440c38(0x117)};if(_0x3c5683[_0x440c38(0xf9)](_0x440c38(0xfc))){const _0x436a7c=await fetchNpmDistTagVersion('beta');if(!_0x436a7c)return null;return{'version':_0x436a7c,'source':_0x440c38(0xfc)};}const _0x3c5004=await fetchLatestVersion();if(!_0x3c5004)return null;return{'version':_0x3c5004,'source':_0x440c38(0x114)};}function shouldInstallTarget(_0x1206f8,_0x40d7fe){const _0x5cd999=a39_0x291600;if(_0x40d7fe[_0x5cd999(0x122)]==='version'||_0x40d7fe[_0x5cd999(0x122)]===_0x5cd999(0xfc))return!a39_0x2063e1['eq'](_0x1206f8,_0x40d7fe['version']);return a39_0x2063e1['lt'](_0x1206f8,_0x40d7fe[_0x5cd999(0x117)]);}function getInstallPlanLabel(_0x212982,_0xd86ea7){const _0x14da00=a39_0x291600;switch(_0xd86ea7['source']){case _0x14da00(0xfc):return _0x14da00(0xff)+a39_0x476f8e[_0x14da00(0xe5)](_0x212982)+_0x14da00(0x112)+a39_0x476f8e[_0x14da00(0x10c)](_0xd86ea7[_0x14da00(0x117)]);case _0x14da00(0x117):return'Requested\x20version:\x20'+a39_0x476f8e[_0x14da00(0xe5)](_0x212982)+_0x14da00(0x112)+a39_0x476f8e['green'](_0xd86ea7[_0x14da00(0x117)]);case _0x14da00(0x114):default:return _0x14da00(0xe8)+a39_0x476f8e['yellow'](_0x212982)+_0x14da00(0x112)+a39_0x476f8e[_0x14da00(0x10c)](_0xd86ea7[_0x14da00(0x117)]);}}function repairCurrentBuiltinSkill(){const _0x31eea6=a39_0x291600;console['log'](a39_0x476f8e[_0x31eea6(0xef)]('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x5456f5=installBuiltinSkill();if(_0x5456f5['ok'])return console[_0x31eea6(0x12d)](a39_0x476f8e[_0x31eea6(0xef)](_0x31eea6(0xe3)+_0x5456f5[_0x31eea6(0xe9)]+_0x31eea6(0x127))),!![];return console[_0x31eea6(0xee)](a39_0x476f8e[_0x31eea6(0xe5)](_0x31eea6(0xf3)+_0x5456f5[_0x31eea6(0x103)]+_0x31eea6(0xfd)+(_0x5456f5[_0x31eea6(0x108)]||_0x31eea6(0x11c)))),console[_0x31eea6(0x12d)](a39_0x476f8e[_0x31eea6(0xef)]('\x20\x20Run\x20manually:\x20'+CLI_BIN_NAME+'\x20cli-skill\x20install')),![];}function verifyUpdatedBuiltinSkill(_0x3c9ee9){const _0x17aa6b=a39_0x291600,_0x152150=inspectInstalledBuiltinSkillVersion(_0x3c9ee9);if(_0x152150['state']===_0x17aa6b(0xeb))return console[_0x17aa6b(0x12d)](a39_0x476f8e[_0x17aa6b(0xef)](_0x17aa6b(0xe3)+_0x3c9ee9+'\x20is\x20up\x20to\x20date.')),!![];const _0x3b3c3b=_0x152150[_0x17aa6b(0xe9)]?_0x17aa6b(0xed)+_0x3c9ee9+_0x17aa6b(0x115)+_0x152150[_0x17aa6b(0xe9)]:_0x17aa6b(0xed)+_0x3c9ee9+',\x20state\x20'+_0x152150[_0x17aa6b(0xf2)];return console[_0x17aa6b(0xee)](a39_0x476f8e[_0x17aa6b(0xe5)](_0x17aa6b(0x11b)+_0x3b3c3b)),console[_0x17aa6b(0x12d)](a39_0x476f8e[_0x17aa6b(0xef)](_0x17aa6b(0x11a)+_0x152150[_0x17aa6b(0x104)])),![];}function a39_0x174b(){const _0x2996d4=['\x20→\x20','message','latest',',\x20found\x20','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','version','4962AKSjBm','97857ohVUSD','\x20\x20Run\x20manually:\x20','\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20','unknown','\x20\x20Try\x20manually:\x20','valid','includes','472fJTuRR','validation','source','Updating\x20via\x20','slice','install','Already\x20on\x20requested\x20version\x20(v','\x20is\x20up\x20to\x20date.','12wtLpJZ','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','map','Version\x20comparison\x20failed','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','log','7284070wumisD','red','update','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','2947538YprKvQ','succeed','192044hIxzzM','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','start','bun','\x20\x20CLI\x20Built-in\x20Skill\x20','fromEntries','yellow','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','string','Update\x20available:\x20','skillVersion','Updated\x20to\x20v','current','Install\x20a\x20specific\x20CLI\x20version','expected\x20','warn','gray','pipe','length','state','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','65bmBSgP','npm','96249nyyOKJ','timeout','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','bool','239091qhUHzX','/dist-tags','beta',']:\x20','read','Beta\x20version:\x20','trim','14mkTUCY','object','code','repairCommand','https://registry.npmjs.org/-/package/','execPath','filter','error','Checking\x20for\x20updates...','...','fail','green','Already\x20up\x20to\x20date\x20(v','Current\x20version:\x20','Invalid\x20version:\x20','7273LRjRyi','str'];a39_0x174b=function(){return _0x2996d4;};return a39_0x174b();}async function execute(_0x37576d){const _0xc16c8d=a39_0x291600;await validateUpdateFlags(_0x37576d);const _0x12761f=getCurrentVersion();console[_0xc16c8d(0x12d)](_0xc16c8d(0x10e)+_0x12761f);const _0x929966=a39_0xc794ce(_0xc16c8d(0x109))[_0xc16c8d(0xe1)](),_0x45812a=await resolveTargetVersion(_0x37576d);if(!_0x45812a){const _0x3dd865=_0x37576d[_0xc16c8d(0xf9)](_0xc16c8d(0xfc))?_0xc16c8d(0x129):_0xc16c8d(0xf8);return _0x929966['fail'](_0x3dd865),console[_0xc16c8d(0x12d)](a39_0x476f8e[_0xc16c8d(0xef)]('\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@latest')),{'ok':![],'message':_0x3dd865};}const _0x3feb55=a39_0x2063e1['valid'](VERSION),_0x36974c=a39_0x2063e1[_0xc16c8d(0x11e)](_0x45812a[_0xc16c8d(0x117)]);if(!_0x3feb55||!_0x36974c)return _0x929966[_0xc16c8d(0x10b)](_0xc16c8d(0x12b)),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0x3feb55,_0x45812a)){const _0x4eec3b=_0x45812a[_0xc16c8d(0x122)]===_0xc16c8d(0x117)?_0xc16c8d(0x126)+_0x45812a[_0xc16c8d(0x117)]+')':_0xc16c8d(0x10d)+_0x45812a[_0xc16c8d(0x117)]+')';return _0x929966[_0xc16c8d(0x133)](_0x4eec3b),{'ok':repairCurrentBuiltinSkill()};}_0x929966['info'](getInstallPlanLabel(_0x12761f,_0x45812a));const _0x4ab48b=detectPackageManager(),_0xa67f35=_0x4ab48b===_0xc16c8d(0xf5)?resolveNpmBin(_0xc16c8d(0xf5)):_0x4ab48b,_0x3b06ce=a39_0xc794ce(_0xc16c8d(0x123)+_0x4ab48b+_0xc16c8d(0x10a))[_0xc16c8d(0xe1)]();try{return await execa(_0xa67f35,[_0xc16c8d(0x125),'-g',NPM_PACKAGE_NAME+'@'+_0x45812a[_0xc16c8d(0x117)]],{'stdio':_0xc16c8d(0xf0)}),_0x3b06ce[_0xc16c8d(0x133)](_0xc16c8d(0xea)+_0x45812a[_0xc16c8d(0x117)]),console[_0xc16c8d(0x12d)](a39_0x476f8e[_0xc16c8d(0xef)](_0xc16c8d(0x135))),{'ok':verifyUpdatedBuiltinSkill(_0x45812a[_0xc16c8d(0x117)])};}catch(_0x25cc0a){return _0x3b06ce[_0xc16c8d(0x10b)]('Update\x20failed'),console[_0xc16c8d(0x108)](a39_0x476f8e[_0xc16c8d(0x12f)]('\x20\x20'+_0x25cc0a['message'])),console[_0xc16c8d(0x12d)](a39_0x476f8e[_0xc16c8d(0xef)](_0xc16c8d(0x11d)+_0x4ab48b+'\x20install\x20-g\x20'+NPM_PACKAGE_NAME+'@'+_0x45812a[_0xc16c8d(0x117)])),{'ok':![],'message':_0x25cc0a[_0xc16c8d(0x113)]};}}export const updateDefinition={'service':a39_0x291600(0x130),'command':'run','description':'Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','risk':a39_0x291600(0xfe),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
function a39_0xa816(){const _0x5ac477=['@latest','validation','\x20install\x20-g\x20','boolean','slice','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','Update\x20failed','pipe','4078600XJByCU','info','state','Updating\x20via\x20','message','Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.','1533879vLgQWl','succeed','green','56531wgVdBV','Update\x20available:\x20','\x20\x20CLI\x20Built-in\x20Skill\x20repair\x20failed\x20[','filter','\x20→\x20','Invalid\x20version:\x20','Checking\x20for\x20updates...','\x20\x20Try\x20manually:\x20','5412757QZGIUD','string','red','4XTCCCa','unknown','str','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','start',',\x20state\x20','skillVersion','json','1736876SkenQE','Updated\x20to\x20v','gray','Already\x20up\x20to\x20date\x20(v','read','warn','code','962540VNKGLW','\x20\x20Built-in\x20Skill\x20verification\x20failed:\x20','version','Beta\x20version:\x20','current','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','\x20\x20CLI\x20Built-in\x20Skill\x20','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','run','expected\x20','npm','error','beta','update','yellow','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','timeout','\x20is\x20up\x20to\x20date.','6OIQYGc','repairCommand','Requested\x20version:\x20','/dist-tags','object','length','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','fail','log','32ApncSV','trim','map','source','valid','bun','\x20\x20Run\x20manually:\x20','\x20cli-skill\x20install',',\x20found\x20',']:\x20','Install\x20a\x20specific\x20CLI\x20version','1774266SlZmbs','143NhUWiI','bool','execPath','latest','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','toLowerCase'];a39_0xa816=function(){return _0x5ac477;};return a39_0xa816();}const a39_0x9d77f4=a39_0x5504;(function(_0x1e908b,_0x4e9a54){const _0x5e3a14=a39_0x5504,_0x28e86c=_0x1e908b();while(!![]){try{const _0x53fbda=parseInt(_0x5e3a14(0xdc))/0x1*(parseInt(_0x5e3a14(0xe7))/0x2)+-parseInt(_0x5e3a14(0x11c))/0x3+parseInt(_0x5e3a14(0xef))/0x4+parseInt(_0x5e3a14(0x12b))/0x5+-parseInt(_0x5e3a14(0x108))/0x6*(-parseInt(_0x5e3a14(0xe4))/0x7)+-parseInt(_0x5e3a14(0x111))/0x8*(-parseInt(_0x5e3a14(0xd9))/0x9)+parseInt(_0x5e3a14(0xf6))/0xa*(-parseInt(_0x5e3a14(0x11d))/0xb);if(_0x53fbda===_0x4e9a54)break;else _0x28e86c['push'](_0x28e86c['shift']());}catch(_0x451bd2){_0x28e86c['push'](_0x28e86c['shift']());}}}(a39_0xa816,0xee194));import a39_0x2a0535 from'chalk';import a39_0x3b3b36 from'ora';function a39_0x5504(_0x42648f,_0x4bb476){_0x42648f=_0x42648f-0xd5;const _0xa8165f=a39_0xa816();let _0x550436=_0xa8165f[_0x42648f];return _0x550436;}import a39_0x131e1d 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 _0x55bd89=a39_0x5504;return GIT_COMMIT!==_0x55bd89(0xe8)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x55bd89(0x127)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0xbdc122=a39_0x5504,_0x4ad712=process[_0xbdc122(0x11f)][_0xbdc122(0x122)]();if(_0x4ad712['includes'](_0xbdc122(0x116)))return _0xbdc122(0x116);return _0xbdc122(0x100);}const updateFlags=[{'name':a39_0x9d77f4(0x102),'type':a39_0x9d77f4(0x126),'description':a39_0x9d77f4(0xea),'default':![]},{'name':a39_0x9d77f4(0xf8),'type':'string','description':a39_0x9d77f4(0x11b)}];function getRequestedVersion(_0x3f988d){const _0x15b5c=a39_0x9d77f4;return _0x3f988d[_0x15b5c(0xe9)]('version')[_0x15b5c(0x112)]();}async function validateUpdateFlags(_0x2099ce){const _0x37e8bf=a39_0x9d77f4,_0x111a1c=_0x2099ce[_0x37e8bf(0x11e)](_0x37e8bf(0x102)),_0x32d700=getRequestedVersion(_0x2099ce);if(_0x111a1c&&_0x32d700)throw CliErrors[_0x37e8bf(0x124)](_0x37e8bf(0xfb),_0x37e8bf(0x10e));if(_0x32d700&&!a39_0x131e1d[_0x37e8bf(0x115)](_0x32d700))throw CliErrors[_0x37e8bf(0x124)](_0x37e8bf(0xe1)+_0x32d700,_0x37e8bf(0xd8));}async function fetchNpmDistTags(){const _0x32713d=a39_0x9d77f4;try{const _0x1b690e=await fetch('https://registry.npmjs.org/-/package/'+encodeURIComponent(NPM_PACKAGE_NAME)+_0x32713d(0x10b),{'signal':AbortSignal[_0x32713d(0x106)](0x2710)});if(!_0x1b690e['ok'])return null;const _0x2d6b46=await _0x1b690e[_0x32713d(0xee)]();if(!_0x2d6b46||typeof _0x2d6b46!==_0x32713d(0x10c))return null;return Object['fromEntries'](Object['entries'](_0x2d6b46)[_0x32713d(0xdf)](([,_0x2a2d4e])=>typeof _0x2a2d4e===_0x32713d(0xe5)&&_0x2a2d4e[_0x32713d(0x112)]()[_0x32713d(0x10d)]>0x0)[_0x32713d(0x113)](([_0xc3b21,_0x1cbcac])=>[_0xc3b21,String(_0x1cbcac)[_0x32713d(0x112)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x545fb4){const _0x53433d=await fetchNpmDistTags();return _0x53433d?.[_0x545fb4]??null;}async function fetchLatestVersion(){return fetchNpmDistTagVersion('latest');}async function resolveTargetVersion(_0x381c70){const _0x5ef27c=a39_0x9d77f4,_0xb7b016=getRequestedVersion(_0x381c70);if(_0xb7b016)return{'version':_0xb7b016,'source':'version'};if(_0x381c70['bool']('beta')){const _0x31a295=await fetchNpmDistTagVersion('beta');if(!_0x31a295)return null;return{'version':_0x31a295,'source':_0x5ef27c(0x102)};}const _0x2313fc=await fetchLatestVersion();if(!_0x2313fc)return null;return{'version':_0x2313fc,'source':_0x5ef27c(0x120)};}function shouldInstallTarget(_0x3d6be3,_0x3bfcf8){const _0x31eb89=a39_0x9d77f4;if(_0x3bfcf8['source']==='version'||_0x3bfcf8[_0x31eb89(0x114)]===_0x31eb89(0x102))return!a39_0x131e1d['eq'](_0x3d6be3,_0x3bfcf8['version']);return a39_0x131e1d['lt'](_0x3d6be3,_0x3bfcf8[_0x31eb89(0xf8)]);}function getInstallPlanLabel(_0x31d689,_0x4cacf5){const _0x241e77=a39_0x9d77f4;switch(_0x4cacf5[_0x241e77(0x114)]){case'beta':return _0x241e77(0xf9)+a39_0x2a0535[_0x241e77(0x104)](_0x31d689)+_0x241e77(0xe0)+a39_0x2a0535['green'](_0x4cacf5['version']);case _0x241e77(0xf8):return _0x241e77(0x10a)+a39_0x2a0535[_0x241e77(0x104)](_0x31d689)+'\x20→\x20'+a39_0x2a0535[_0x241e77(0xdb)](_0x4cacf5[_0x241e77(0xf8)]);case'latest':default:return _0x241e77(0xdd)+a39_0x2a0535[_0x241e77(0x104)](_0x31d689)+_0x241e77(0xe0)+a39_0x2a0535[_0x241e77(0xdb)](_0x4cacf5[_0x241e77(0xf8)]);}}function repairCurrentBuiltinSkill(){const _0x229f2a=a39_0x9d77f4;console[_0x229f2a(0x110)](a39_0x2a0535['gray']('Checking\x20CLI\x20Built-in\x20Skill...'));const _0x5e7231=installBuiltinSkill();if(_0x5e7231['ok'])return console['log'](a39_0x2a0535[_0x229f2a(0xf1)](_0x229f2a(0xfc)+_0x5e7231[_0x229f2a(0xed)]+_0x229f2a(0x107))),!![];return console[_0x229f2a(0xf4)](a39_0x2a0535[_0x229f2a(0x104)](_0x229f2a(0xde)+_0x5e7231[_0x229f2a(0xf5)]+_0x229f2a(0x11a)+(_0x5e7231[_0x229f2a(0x101)]||'unknown'))),console['log'](a39_0x2a0535[_0x229f2a(0xf1)]('\x20\x20Run\x20manually:\x20'+CLI_BIN_NAME+_0x229f2a(0x118))),![];}function verifyUpdatedBuiltinSkill(_0x1474cb){const _0x4ee25b=a39_0x9d77f4,_0x233029=inspectInstalledBuiltinSkillVersion(_0x1474cb);if(_0x233029['state']===_0x4ee25b(0xfa))return console[_0x4ee25b(0x110)](a39_0x2a0535[_0x4ee25b(0xf1)](_0x4ee25b(0xfc)+_0x1474cb+_0x4ee25b(0x107))),!![];const _0xef6f86=_0x233029['skillVersion']?_0x4ee25b(0xff)+_0x1474cb+_0x4ee25b(0x119)+_0x233029[_0x4ee25b(0xed)]:'expected\x20'+_0x1474cb+_0x4ee25b(0xec)+_0x233029[_0x4ee25b(0xd5)];return console[_0x4ee25b(0xf4)](a39_0x2a0535[_0x4ee25b(0x104)](_0x4ee25b(0xf7)+_0xef6f86)),console[_0x4ee25b(0x110)](a39_0x2a0535[_0x4ee25b(0xf1)](_0x4ee25b(0x117)+_0x233029[_0x4ee25b(0x109)])),![];}async function execute(_0x5ab4b0){const _0x5a1019=a39_0x9d77f4;await validateUpdateFlags(_0x5ab4b0);const _0x25ceb6=getCurrentVersion();console[_0x5a1019(0x110)]('Current\x20version:\x20'+_0x25ceb6);const _0x40b082=a39_0x3b3b36(_0x5a1019(0xe2))[_0x5a1019(0xeb)](),_0x8281cb=await resolveTargetVersion(_0x5ab4b0);if(!_0x8281cb){const _0x83868a=_0x5ab4b0[_0x5a1019(0x11e)](_0x5a1019(0x102))?'Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm':_0x5a1019(0x128);return _0x40b082[_0x5a1019(0x10f)](_0x83868a),console[_0x5a1019(0x110)](a39_0x2a0535[_0x5a1019(0xf1)](_0x5a1019(0x121)+NPM_PACKAGE_NAME+_0x5a1019(0x123))),{'ok':![],'message':_0x83868a};}const _0x3748c7=a39_0x131e1d[_0x5a1019(0x115)](VERSION),_0x332f26=a39_0x131e1d[_0x5a1019(0x115)](_0x8281cb[_0x5a1019(0xf8)]);if(!_0x3748c7||!_0x332f26)return _0x40b082['fail']('Version\x20comparison\x20failed'),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0x3748c7,_0x8281cb)){const _0x32c056=_0x8281cb['source']===_0x5a1019(0xf8)?'Already\x20on\x20requested\x20version\x20(v'+_0x8281cb[_0x5a1019(0xf8)]+')':_0x5a1019(0xf2)+_0x8281cb[_0x5a1019(0xf8)]+')';return _0x40b082[_0x5a1019(0xda)](_0x32c056),{'ok':repairCurrentBuiltinSkill()};}_0x40b082[_0x5a1019(0x12c)](getInstallPlanLabel(_0x25ceb6,_0x8281cb));const _0x1524fa=detectPackageManager(),_0x362351=_0x1524fa===_0x5a1019(0x100)?resolveNpmBin('npm'):_0x1524fa,_0xcc2e64=a39_0x3b3b36(_0x5a1019(0xd6)+_0x1524fa+'...')['start']();try{return await execa(_0x362351,['install','-g',NPM_PACKAGE_NAME+'@'+_0x8281cb[_0x5a1019(0xf8)]],{'stdio':_0x5a1019(0x12a)}),_0xcc2e64[_0x5a1019(0xda)](_0x5a1019(0xf0)+_0x8281cb[_0x5a1019(0xf8)]),console[_0x5a1019(0x110)](a39_0x2a0535['gray'](_0x5a1019(0xfd))),{'ok':verifyUpdatedBuiltinSkill(_0x8281cb[_0x5a1019(0xf8)])};}catch(_0x4f187a){return _0xcc2e64[_0x5a1019(0x10f)](_0x5a1019(0x129)),console[_0x5a1019(0x101)](a39_0x2a0535[_0x5a1019(0xe6)]('\x20\x20'+_0x4f187a[_0x5a1019(0xd7)])),console[_0x5a1019(0x110)](a39_0x2a0535[_0x5a1019(0xf1)](_0x5a1019(0xe3)+_0x1524fa+_0x5a1019(0x125)+NPM_PACKAGE_NAME+'@'+_0x8281cb['version'])),{'ok':![],'message':_0x4f187a['message']};}}export const updateDefinition={'service':a39_0x9d77f4(0x103),'command':a39_0x9d77f4(0xfe),'description':a39_0x9d77f4(0x105),'risk':a39_0x9d77f4(0xf3),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xdc663e,_0x38003f){const _0x298fd3=a40_0x27c4,_0x22345e=_0xdc663e();while(!![]){try{const _0x493926=-parseInt(_0x298fd3(0x168))/0x1*(parseInt(_0x298fd3(0x160))/0x2)+-parseInt(_0x298fd3(0x165))/0x3*(-parseInt(_0x298fd3(0x169))/0x4)+parseInt(_0x298fd3(0x166))/0x5+-parseInt(_0x298fd3(0x15e))/0x6*(-parseInt(_0x298fd3(0x162))/0x7)+-parseInt(_0x298fd3(0x15f))/0x8*(parseInt(_0x298fd3(0x164))/0x9)+parseInt(_0x298fd3(0x163))/0xa+-parseInt(_0x298fd3(0x167))/0xb*(parseInt(_0x298fd3(0x161))/0xc);if(_0x493926===_0x38003f)break;else _0x22345e['push'](_0x22345e['shift']());}catch(_0x3402b8){_0x22345e['push'](_0x22345e['shift']());}}}(a40_0x534c,0x9a52c));import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';export const codegenDefinitions=[codegenSdk,codegenSql];function a40_0x27c4(_0x2a0d4f,_0x57c323){_0x2a0d4f=_0x2a0d4f-0x15e;const _0x534c79=a40_0x534c();let _0x27c424=_0x534c79[_0x2a0d4f];return _0x27c424;}function a40_0x534c(){const _0x567703=['1633244KexvWx','466284NXapGB','4327918WzqdQL','4007570TMBVNs','666ZZgfDe','3UweIju','3779655PBRpDL','341uNAHXI','1zifHMu','3652148ylQpLb','12pGHGUr','70592yFGzJL'];a40_0x534c=function(){return _0x567703;};return a40_0x534c();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a41_0x264fb5=a41_0x43cb;function a41_0x4794(){const _0x42f3e5=['2234211tuIgvr','bool','alias','5759970pLfckh','operation','2217865fgBRvb','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','8rsOMqX','name','3paCVDV','3910869UfgHWh','745214PDldna','330FlpgXy','8kajWWr','code','appCode','483876YpqfBa','sdk','boolean','skip-imports','14xvlwCx','str','string','1651770BxLvDz'];a41_0x4794=function(){return _0x42f3e5;};return a41_0x4794();}(function(_0x487bf1,_0x5ab48d){const _0xc870ef=a41_0x43cb,_0x97912d=_0x487bf1();while(!![]){try{const _0xeeda5a=parseInt(_0xc870ef(0x117))/0x1*(parseInt(_0xc870ef(0x119))/0x2)+parseInt(_0xc870ef(0x126))/0x3*(-parseInt(_0xc870ef(0x115))/0x4)+-parseInt(_0xc870ef(0x113))/0x5+parseInt(_0xc870ef(0x125))/0x6*(parseInt(_0xc870ef(0x122))/0x7)+parseInt(_0xc870ef(0x11b))/0x8*(parseInt(_0xc870ef(0x118))/0x9)+-parseInt(_0xc870ef(0x129))/0xa+-parseInt(_0xc870ef(0x11a))/0xb*(-parseInt(_0xc870ef(0x11e))/0xc);if(_0xeeda5a===_0x5ab48d)break;else _0x97912d['push'](_0x97912d['shift']());}catch(_0x24d126){_0x97912d['push'](_0x97912d['shift']());}}}(a41_0x4794,0xc430e));import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';function a41_0x43cb(_0x950758,_0x4c8ffc){_0x950758=_0x950758-0x112;const _0x4794ba=a41_0x4794();let _0x43cb7a=_0x4794ba[_0x950758];return _0x43cb7a;}import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';export const codegenSdk={'service':'codegen','command':a41_0x264fb5(0x11f),'description':a41_0x264fb5(0x114),'risk':'read','flags':[CODE_FLAG_OPTIONAL,{'name':a41_0x264fb5(0x128),'type':a41_0x264fb5(0x124),'description':'Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)'},{'name':a41_0x264fb5(0x112),'type':a41_0x264fb5(0x124),'required':!![],'description':'Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)'},{'name':a41_0x264fb5(0x121),'type':a41_0x264fb5(0x120),'description':'Omit\x20import\x20statements\x20from\x20generated\x20code'}],async 'execute'(_0x4030c8){const _0x15ff16=a41_0x264fb5,{dataset:_0x5904f1,operation:_0x3384fc}=await getOperationDetail(_0x4030c8[_0x15ff16(0x11d)],_0x4030c8[_0x15ff16(0x123)](_0x15ff16(0x11c)),_0x4030c8['str'](_0x15ff16(0x112))),_0x2bacbc=generateSdkCode(_0x5904f1,_0x3384fc,{'includeImports':!_0x4030c8[_0x15ff16(0x127)]('skip-imports')});return{'ok':!![],'data':{'dataset':{'name':_0x5904f1[_0x15ff16(0x116)],'code':_0x5904f1[_0x15ff16(0x11c)],'tableName':_0x5904f1['tableName']},'operation':_0x4030c8['str']('operation'),'code':_0x2bacbc}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a42_0x1af1(_0x14b26a,_0x14639e){_0x14b26a=_0x14b26a-0x133;const _0x52bf57=a42_0x52bf();let _0x1af18d=_0x52bf57[_0x14b26a];return _0x1af18d;}const a42_0x5c374f=a42_0x1af1;(function(_0x137c22,_0x9ce624){const _0x10fbb1=a42_0x1af1,_0x41b336=_0x137c22();while(!![]){try{const _0x222232=-parseInt(_0x10fbb1(0x13d))/0x1*(parseInt(_0x10fbb1(0x145))/0x2)+-parseInt(_0x10fbb1(0x136))/0x3+-parseInt(_0x10fbb1(0x139))/0x4+parseInt(_0x10fbb1(0x13e))/0x5+parseInt(_0x10fbb1(0x141))/0x6+parseInt(_0x10fbb1(0x138))/0x7+-parseInt(_0x10fbb1(0x142))/0x8*(-parseInt(_0x10fbb1(0x140))/0x9);if(_0x222232===_0x9ce624)break;else _0x41b336['push'](_0x41b336['shift']());}catch(_0x17925e){_0x41b336['push'](_0x41b336['shift']());}}}(a42_0x52bf,0xceb6d));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';import{SQLCODE_FLAG}from'../../commands/common/flags.js';function a42_0x52bf(){const _0x547035=['Code\x20target:\x20sdk\x20(default)\x20or\x20bff','sdk','sqlName','28225VLogDN','4769135sWvnUI','sqlCode','158013SNTJCq','7968168keTziS','184BggCwl','Omit\x20import\x20statements\x20from\x20generated\x20code','string','78AViCTx','boolean','codegen','sqlcode','str','bool','sql','no-imports','3472890LIBfGn','appCode','6485864HoaKUv','2028448LiNTVa'];a42_0x52bf=function(){return _0x547035;};return a42_0x52bf();}export const codegenSql={'service':a42_0x5c374f(0x147),'command':a42_0x5c374f(0x134),'description':'Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','risk':'read','flags':[SQLCODE_FLAG,{'name':'target','type':a42_0x5c374f(0x144),'description':a42_0x5c374f(0x13a),'default':'sdk','enum':['sdk','bff']},{'name':a42_0x5c374f(0x135),'type':a42_0x5c374f(0x146),'description':a42_0x5c374f(0x143)}],async 'execute'(_0x46086){const _0x4455b8=a42_0x5c374f,_0x42fd3d=await getSqlQueryInfo(_0x46086[_0x4455b8(0x137)],_0x46086['str'](_0x4455b8(0x148))),_0x4c60c1=_0x46086[_0x4455b8(0x149)]('target')||_0x4455b8(0x13b),_0x2128d6=generateSqlCodeTemplate(_0x42fd3d,{'target':_0x4c60c1,'includeImports':!_0x46086[_0x4455b8(0x133)]('no-imports')});return{'ok':!![],'data':{'sqlCode':_0x42fd3d[_0x4455b8(0x13f)],'sqlName':_0x42fd3d[_0x4455b8(0x13c)],'target':_0x4c60c1,'code':_0x2128d6}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2c6a10,_0x593775){const _0x128088=a43_0x3fdd,_0x1fe737=_0x2c6a10();while(!![]){try{const _0x5be165=-parseInt(_0x128088(0x156))/0x1*(-parseInt(_0x128088(0x136))/0x2)+-parseInt(_0x128088(0x14e))/0x3*(parseInt(_0x128088(0x146))/0x4)+parseInt(_0x128088(0x15f))/0x5*(parseInt(_0x128088(0x147))/0x6)+parseInt(_0x128088(0x15b))/0x7+-parseInt(_0x128088(0x151))/0x8*(-parseInt(_0x128088(0x153))/0x9)+-parseInt(_0x128088(0x14b))/0xa+-parseInt(_0x128088(0x137))/0xb*(parseInt(_0x128088(0x155))/0xc);if(_0x5be165===_0x593775)break;else _0x1fe737['push'](_0x1fe737['shift']());}catch(_0x5d78d8){_0x1fe737['push'](_0x1fe737['shift']());}}}(a43_0x4fdd,0x1d08a));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{collectAppProfileOverrides,getAppProfileFlagDefs}from'../../config/schema.js';function a43_0x3fdd(_0xec7ac8,_0x1cd79d){_0xec7ac8=_0xec7ac8-0x133;const _0x4fdddb=a43_0x4fdd();let _0x3fdd48=_0x4fdddb[_0xec7ac8];return _0x3fdd48;}import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';function a43_0x4fdd(){const _0x147beb=['344082HNFhdw','defaultApp','Missing\x20app\x20name.','1366984KmsFFx','\x22\x20(appcode:\x20','9leTfLX','appcode','813828AKgQJV','864QDNolD','string','globalConfig','validation','length','1615019thFLRc','str','Use\x20global\x20config\x20scope','boolean','5zwAccB','\x22\x20still\x20defined\x20in\x20','flagMissing','\x20Default\x20app\x20changed\x20to\x20\x22','232zKBqOj','11YYXlIJ','\x20config.','\x22\x20not\x20found.','Usage:\x20','\x20Note:\x20app\x20\x22','args','object','projectConfig','project','global','Updated','App\x20\x22','\x20Set\x20as\x20default\x20app.','keys','trim','8PzhyGf','765030gAZBQy','bool','apps','Added','2131900PLGoiu','both','\x20<name>\x20--appcode\x20<code>'];a43_0x4fdd=function(){return _0x147beb;};return a43_0x4fdd();}export function buildAppAddFlags(){const _0x370d17=a43_0x3fdd;return[{'name':_0x370d17(0x154),'type':_0x370d17(0x157),'description':'App\x20code','required':!![]},{'name':_0x370d17(0x140),'type':_0x370d17(0x15e),'description':'Use\x20global\x20config\x20scope','default':![]},...getAppProfileFlagDefs()];}export function buildAppRemoveFlags(){const _0x221770=a43_0x3fdd;return[{'name':_0x221770(0x140),'type':_0x221770(0x15e),'description':_0x221770(0x15d),'default':![]}];}export async function validateAppName(_0x2f2d8,_0x411090){const _0x30727e=a43_0x3fdd,_0x53e796=_0x2f2d8[_0x30727e(0x13c)][0x0]?.['trim']();if(!_0x53e796)throw CliErrors[_0x30727e(0x159)](_0x30727e(0x150),_0x30727e(0x13a)+CLI_BIN_NAME+'\x20'+_0x411090+'\x20<name>');}export async function runAppAdd(_0x3e6d0,_0x270735){const _0x51ee64=a43_0x3fdd,_0x3eff8b=_0x3e6d0[_0x51ee64(0x13c)][0x0]?.[_0x51ee64(0x145)]();if(!_0x3eff8b)throw CliErrors[_0x51ee64(0x159)](_0x51ee64(0x150),_0x51ee64(0x13a)+CLI_BIN_NAME+'\x20'+_0x270735+_0x51ee64(0x14d));const _0x5a8ddb=_0x3e6d0['str']('appcode');if(!_0x5a8ddb)throw CliErrors[_0x51ee64(0x134)]('appcode',_0x51ee64(0x13a)+CLI_BIN_NAME+'\x20'+_0x270735+_0x51ee64(0x14d));const _0x2d927f={'global':_0x3e6d0[_0x51ee64(0x148)](_0x51ee64(0x140))},_0x4e6e75=readConfig(_0x2d927f);if(!_0x4e6e75[_0x51ee64(0x149)])_0x4e6e75[_0x51ee64(0x149)]={};const _0x1451b0={'appcode':_0x5a8ddb,...collectAppProfileOverrides(_0x5c59af=>_0x3e6d0[_0x51ee64(0x15c)](_0x5c59af))},_0x18de4a=_0x4e6e75[_0x51ee64(0x149)],_0x5e2626=!!_0x18de4a[_0x3eff8b];_0x18de4a[_0x3eff8b]=_0x1451b0;if(!_0x4e6e75[_0x51ee64(0x14f)])_0x4e6e75[_0x51ee64(0x14f)]=_0x3eff8b;writeConfig(_0x4e6e75,_0x2d927f);const _0x3223e3=!_0x5e2626&&_0x4e6e75[_0x51ee64(0x14f)]===_0x3eff8b?_0x51ee64(0x143):'',_0x490f61=(_0x5e2626?_0x51ee64(0x141):_0x51ee64(0x14a))+'\x20app\x20\x22'+_0x3eff8b+_0x51ee64(0x152)+_0x5a8ddb+')'+scopeLabel(_0x2d927f)+'.'+_0x3223e3;return{'ok':!![],'message':_0x490f61};}export async function runAppRemove(_0x399765,_0x5e2b8b){const _0x50bc3f=a43_0x3fdd,_0x2a91ba=_0x399765['args'][0x0]?.[_0x50bc3f(0x145)]();if(!_0x2a91ba)throw CliErrors['validation']('Missing\x20app\x20name.',_0x50bc3f(0x13a)+CLI_BIN_NAME+'\x20'+_0x5e2b8b+'\x20<name>\x20[--global]');const _0x5175a9=_0x399765['bool'](_0x50bc3f(0x140)),{config:_0x1c8362,layers:_0x16d66e}=readRawConfigWithLayers(),_0x317b4f=_0x1c8362['apps']??{};if(!_0x317b4f[_0x2a91ba])throw CliErrors['validation'](_0x50bc3f(0x142)+_0x2a91ba+'\x22\x20not\x20found.');const _0x3e1e93=_0x16d66e[_0x50bc3f(0x158)]['apps']&&typeof _0x16d66e[_0x50bc3f(0x158)][_0x50bc3f(0x149)]===_0x50bc3f(0x13d)?_0x16d66e[_0x50bc3f(0x158)][_0x50bc3f(0x149)]:{},_0x1515c1=_0x16d66e[_0x50bc3f(0x13e)]['apps']&&typeof _0x16d66e[_0x50bc3f(0x13e)]['apps']===_0x50bc3f(0x13d)?_0x16d66e[_0x50bc3f(0x13e)][_0x50bc3f(0x149)]:{},_0xa30896=appDefinedIn(_0x2a91ba,_0x3e1e93,_0x1515c1,_0x16d66e['projectConfig']['inherit']===![]),_0x2d8356=resolveAppScopeForWrite(_0x2a91ba,_0x5175a9,_0x16d66e),_0x46dcf6={'global':_0x2d8356===_0x50bc3f(0x140)},_0xa53cd=readConfig(_0x46dcf6),_0x27f605=_0xa53cd[_0x50bc3f(0x149)];if(!_0x27f605||!_0x27f605[_0x2a91ba])throw CliErrors[_0x50bc3f(0x159)]('App\x20\x22'+_0x2a91ba+_0x50bc3f(0x139));delete _0x27f605[_0x2a91ba];let _0x315db9='';if(_0xa53cd[_0x50bc3f(0x14f)]===_0x2a91ba){const _0x1b0a66=Object['keys'](_0x27f605);_0xa53cd[_0x50bc3f(0x14f)]=_0x1b0a66[_0x50bc3f(0x15a)]>0x0?_0x1b0a66[0x0]:undefined,_0xa53cd[_0x50bc3f(0x14f)]?_0x315db9=_0x50bc3f(0x135)+_0xa53cd[_0x50bc3f(0x14f)]+'\x22.':delete _0xa53cd[_0x50bc3f(0x14f)];}Object[_0x50bc3f(0x144)](_0x27f605)[_0x50bc3f(0x15a)]===0x0&&(delete _0xa53cd[_0x50bc3f(0x149)],delete _0xa53cd[_0x50bc3f(0x14f)]);writeConfig(_0xa53cd,_0x46dcf6);const _0x463b97=_0xa30896===_0x50bc3f(0x14c)?_0x50bc3f(0x13b)+_0x2a91ba+_0x50bc3f(0x133)+(_0x2d8356===_0x50bc3f(0x13f)?_0x50bc3f(0x140):_0x50bc3f(0x13f))+_0x50bc3f(0x138):'';return{'ok':!![],'message':'Removed\x20app\x20\x22'+_0x2a91ba+'\x22'+scopeLabel(_0x46dcf6)+'.'+_0x315db9+_0x463b97};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a44_0x69db(_0x3e8fb3,_0x28a175){_0x3e8fb3=_0x3e8fb3-0x1bd;const _0x3316b8=a44_0x3316();let _0x69dbbc=_0x3316b8[_0x3e8fb3];return _0x69dbbc;}(function(_0x2711f5,_0xbada1e){const _0x3d99bb=a44_0x69db,_0x93a3cd=_0x2711f5();while(!![]){try{const _0x41e1c2=parseInt(_0x3d99bb(0x1c4))/0x1+parseInt(_0x3d99bb(0x1ce))/0x2*(-parseInt(_0x3d99bb(0x1cc))/0x3)+-parseInt(_0x3d99bb(0x1c7))/0x4+-parseInt(_0x3d99bb(0x1be))/0x5+-parseInt(_0x3d99bb(0x1c6))/0x6*(-parseInt(_0x3d99bb(0x1ca))/0x7)+parseInt(_0x3d99bb(0x1c2))/0x8+-parseInt(_0x3d99bb(0x1d4))/0x9;if(_0x41e1c2===_0xbada1e)break;else _0x93a3cd['push'](_0x93a3cd['shift']());}catch(_0x556230){_0x93a3cd['push'](_0x93a3cd['shift']());}}}(a44_0x3316,0x1fe4d));import{input,checkbox,select}from'@inquirer/prompts';import a44_0x54411f from'chalk';import{validateAppcode}from'../../commands/common/validate.js';import{listRemoteApps}from'../../core/api-client.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';export async function promptCustomAppcode(){const _0x3a038b=a44_0x69db,_0x5ad3bb=await input({'message':_0x3a038b(0x1cb),'validate':_0x2c561b=>{const _0x593dbb=_0x3a038b,_0x56b256=validateAppcode(_0x2c561b['trim']());return _0x56b256['valid']||_0x56b256['message']||_0x593dbb(0x1d2);}});return _0x5ad3bb[_0x3a038b(0x1da)]();}export async function promptAppSelection(_0xe0903c){const _0x5a776c=a44_0x69db,_0x442a40=[{'name':a44_0x54411f[_0x5a776c(0x1bf)](_0x5a776c(0x1c9)),'value':-0x1},..._0xe0903c['map']((_0xfe8a4a,_0x558494)=>({'name':_0xfe8a4a['appName']+'\x20\x20'+a44_0x54411f['gray']('('+_0xfe8a4a['appCode']+')'),'value':_0x558494}))],_0x359345=await checkbox({'message':_0x5a776c(0x1d1)+a44_0x54411f[_0x5a776c(0x1e0)](_0xe0903c[_0x5a776c(0x1c5)])+_0x5a776c(0x1cd),'choices':_0x442a40,'loop':![]});if(_0x359345[_0x5a776c(0x1bd)](-0x1))return'custom';if(_0x359345[_0x5a776c(0x1c5)]===0x0)return _0x5a776c(0x1d9);return _0x359345[_0x5a776c(0x1e1)](_0x1b0247=>_0xe0903c[_0x1b0247]);}export async function promptSingleAppSelection(_0x2cfe14){const _0x595a67=a44_0x69db,_0x2b581e=[{'name':a44_0x54411f['gray'](_0x595a67(0x1c1)),'value':_0x595a67(0x1df)},{'name':a44_0x54411f['yellow'](_0x595a67(0x1c9)),'value':_0x595a67(0x1d9)},..._0x2cfe14[_0x595a67(0x1e1)](_0x3d96ea=>({'name':_0x3d96ea[_0x595a67(0x1d6)]+'\x20\x20'+a44_0x54411f[_0x595a67(0x1c0)]('('+_0x3d96ea[_0x595a67(0x1d8)]+')'),'value':_0x3d96ea[_0x595a67(0x1d8)]}))],_0x4f09ec=await select({'message':_0x595a67(0x1d0),'choices':_0x2b581e});if(_0x4f09ec===_0x595a67(0x1df))return _0x595a67(0x1df);if(_0x4f09ec===_0x595a67(0x1d9))return _0x595a67(0x1d9);return _0x2cfe14['find'](_0x25bb15=>_0x25bb15[_0x595a67(0x1d8)]===_0x4f09ec);}export async function selectSingleAppcode(_0x1a40f9){const _0x2d3fef=a44_0x69db;if(!_0x1a40f9)return writeCliSideChannelLine(a44_0x54411f[_0x2d3fef(0x1c0)](_0x2d3fef(0x1c3))),_fallbackOrSkip();writeCliSideChannelLine(_0x2d3fef(0x1db));let _0x53fcf4;try{_0x53fcf4=await withActiveCookie(_0x1a40f9,()=>listRemoteApps());}catch(_0x40ab73){writeCliSideChannelLine(a44_0x54411f[_0x2d3fef(0x1bf)](_0x2d3fef(0x1dc)));if(_0x40ab73 instanceof Error)writeCliSideChannelLine(a44_0x54411f['gray'](_0x2d3fef(0x1d3)+_0x40ab73['message']+')'));return _fallbackOrSkip();}if(_0x53fcf4[_0x2d3fef(0x1c5)]===0x0)return writeCliSideChannelLine(a44_0x54411f[_0x2d3fef(0x1bf)]('未找到可用应用。')),_fallbackOrSkip();const _0x45a59f=await promptSingleAppSelection(_0x53fcf4);if(_0x45a59f===_0x2d3fef(0x1df))return'';if(_0x45a59f===_0x2d3fef(0x1d9))return promptCustomAppcode();return _0x45a59f[_0x2d3fef(0x1d8)];}function a44_0x3316(){const _0xb342c0=['正在获取可用应用列表...','无法获取远程应用列表,请手动输入。','\x0a无法获取远程应用列表,请手动输入。','✎\x20手动输入','skip','cyan','map','includes','86955MAuNGy','yellow','gray','(跳过,稍后通过\x20config\x20set\x20appcode\x20配置)','1636416njSLTR','(未检测到登录态,请手动输入\x20App\x20Code\x20或直接跳过)','251431UZEnkD','length','11712qpyWCG','572152IVwRpb','message','✎\x20自定义输入\x20appcode','679nzIpqN','请输入\x20App\x20Code:','12dCQopb','\x20个应用,请选择\x20(空格勾选,\x20a=全选,\x20i=反选):','37450mrUKEt','(跳过,稍后配置)','请选择要绑定的应用:','获取到\x20','Invalid\x20App\x20Code','\x20\x20(','2514249JiqsIK','\x0a未找到可用应用。','appName','App\x20Code:','appCode','custom','trim'];a44_0x3316=function(){return _0xb342c0;};return a44_0x3316();}export async function selectMultipleApps(_0x525203){const _0x2bfb10=a44_0x69db;writeCliSideChannelLine(_0x2bfb10(0x1db));let _0x3e1476;try{_0x3e1476=await withActiveCookie(_0x525203,()=>listRemoteApps());}catch(_0x1e9fe7){writeCliSideChannelLine(_0x2bfb10(0x1dd));if(_0x1e9fe7 instanceof Error)writeCliSideChannelLine(_0x2bfb10(0x1d3)+_0x1e9fe7[_0x2bfb10(0x1c8)]+')');return _0x2bfb10(0x1d9);}if(_0x3e1476[_0x2bfb10(0x1c5)]===0x0)return writeCliSideChannelLine(_0x2bfb10(0x1d5)),'custom';return promptAppSelection(_0x3e1476);}async function _fallbackOrSkip(){const _0x208874=a44_0x69db,_0x54be19=await select({'message':_0x208874(0x1d7),'choices':[{'name':a44_0x54411f[_0x208874(0x1c0)](_0x208874(0x1cf)),'value':_0x208874(0x1df)},{'name':a44_0x54411f[_0x208874(0x1bf)](_0x208874(0x1de)),'value':'manual'}]});if(_0x54be19===_0x208874(0x1df))return'';return promptCustomAppcode();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a45_0x5e2251=a45_0x432f;(function(_0x1e25e8,_0x14ab0d){const _0xfc866b=a45_0x432f,_0x293dd6=_0x1e25e8();while(!![]){try{const _0x537fdc=-parseInt(_0xfc866b(0x18e))/0x1*(-parseInt(_0xfc866b(0x173))/0x2)+-parseInt(_0xfc866b(0x17f))/0x3+-parseInt(_0xfc866b(0x17d))/0x4*(parseInt(_0xfc866b(0x17a))/0x5)+parseInt(_0xfc866b(0x16f))/0x6*(-parseInt(_0xfc866b(0x175))/0x7)+parseInt(_0xfc866b(0x188))/0x8*(parseInt(_0xfc866b(0x179))/0x9)+-parseInt(_0xfc866b(0x171))/0xa*(-parseInt(_0xfc866b(0x181))/0xb)+-parseInt(_0xfc866b(0x178))/0xc*(-parseInt(_0xfc866b(0x17c))/0xd);if(_0x537fdc===_0x14ab0d)break;else _0x293dd6['push'](_0x293dd6['shift']());}catch(_0x3a3038){_0x293dd6['push'](_0x293dd6['shift']());}}}(a45_0x47ac,0xf34ae));import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';const TERMINAL_STATUSES=new Set([a45_0x5e2251(0x18b),'FAILED']),NON_TERMINAL_STATUSES=new Set([a45_0x5e2251(0x177),'PROCESSING']);export function normalizeAsyncTask(_0x551c91){const _0xffa111=a45_0x5e2251,_0x361f6a=typeof _0x551c91?.[_0xffa111(0x189)]===_0xffa111(0x16b)?_0x551c91[_0xffa111(0x189)][_0xffa111(0x16e)]():'';if(!_0x361f6a)throw CliErrors[_0xffa111(0x187)](_0xffa111(0x170));const _0x25e5f9=typeof _0x551c91[_0xffa111(0x176)]===_0xffa111(0x16b)?_0x551c91[_0xffa111(0x176)][_0xffa111(0x16e)]()[_0xffa111(0x18c)]():'';if(!_0x25e5f9)throw CliErrors[_0xffa111(0x187)](_0xffa111(0x183)+_0x361f6a+_0xffa111(0x182));return{'taskId':_0x361f6a,'status':_0x25e5f9,'errorMessage':typeof _0x551c91[_0xffa111(0x174)]===_0xffa111(0x16b)&&_0x551c91['errorMessage']['trim']()?_0x551c91['errorMessage']['trim']():null,'isTerminal':TERMINAL_STATUSES[_0xffa111(0x18d)](_0x25e5f9),'knownStatus':TERMINAL_STATUSES[_0xffa111(0x18d)](_0x25e5f9)||NON_TERMINAL_STATUSES[_0xffa111(0x18d)](_0x25e5f9)};}export function buildAsyncTaskStatusCommand(_0x184e6e,_0xfcda31){const _0x3216ac=a45_0x5e2251;return CLI_BIN_NAME+'\x20task\x20status\x20--task-id\x20'+quoteShellArg(_0x184e6e)+_0x3216ac(0x17b)+quoteShellArg(_0xfcda31)+_0x3216ac(0x186);}function a45_0x432f(_0x227c58,_0x202e32){_0x227c58=_0x227c58-0x16b;const _0x47ac7d=a45_0x47ac();let _0x432fae=_0x47ac7d[_0x227c58];return _0x432fae;}export function asyncTaskMessage(_0x242dec){const _0x5a5692=a45_0x5e2251;switch(_0x242dec[_0x5a5692(0x176)]){case _0x5a5692(0x177):return _0x5a5692(0x16d)+_0x242dec[_0x5a5692(0x189)]+_0x5a5692(0x172);case'PROCESSING':return _0x5a5692(0x16d)+_0x242dec[_0x5a5692(0x189)]+'\x20is\x20processing.';case'SUCCESS':return _0x5a5692(0x16d)+_0x242dec['taskId']+_0x5a5692(0x17e);case _0x5a5692(0x184):return _0x242dec['errorMessage']?_0x5a5692(0x16d)+_0x242dec[_0x5a5692(0x189)]+_0x5a5692(0x185)+_0x242dec[_0x5a5692(0x174)]:'Task\x20'+_0x242dec[_0x5a5692(0x189)]+_0x5a5692(0x16c);default:return _0x5a5692(0x16d)+_0x242dec[_0x5a5692(0x189)]+_0x5a5692(0x18f)+_0x242dec[_0x5a5692(0x176)]+'.';}}function quoteShellArg(_0x150b97){const _0x5b123a=a45_0x5e2251;return'\x27'+_0x150b97[_0x5b123a(0x18a)](/'/g,_0x5b123a(0x180))+'\x27';}function a45_0x47ac(){const _0x872912=['Async\x20task\x20response\x20did\x20not\x20contain\x20a\x20taskId.','7660nwZCQN','\x20is\x20pending.','362kUPrZG','errorMessage','11418722fBkQSN','status','PENDING','36DNuIQD','9VmZsdn','908465LpAgrd','\x20--appcode\x20','3543241rvoAeP','4IBpADp','\x20completed\x20successfully.','3464667eJIcbM','\x27\x5c\x27\x27','13783bQHfXW','\x20response\x20did\x20not\x20contain\x20a\x20status.','Async\x20task\x20','FAILED','\x20failed:\x20','\x20--format\x20compress','apiError','5217488lzXLnK','taskId','replace','SUCCESS','toUpperCase','has','8479yDXnLP','\x20returned\x20unknown\x20status\x20','string','\x20failed.','Task\x20','trim','6kOimvT'];a45_0x47ac=function(){return _0x872912;};return a45_0x47ac();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a46_0x4fcc(_0x392726,_0x2585ed){_0x392726=_0x392726-0x144;var _0x3e1c39=a46_0x3e1c();var _0x4fcc71=_0x3e1c39[_0x392726];return _0x4fcc71;}function a46_0x3e1c(){var _0x388aef=['5004210daeqlE','14081816jPwuUN','42491VFRxrj','350dtOUwC','48mHikoL','url','description','108PyFxug','1120935mFTuuk','method','1795584wUlYsP','174228GDlsvd','126540HdGhsh'];a46_0x3e1c=function(){return _0x388aef;};return a46_0x3e1c();}(function(_0x141f2e,_0x5bac0b){var _0x5c8276=a46_0x4fcc,_0x3e6b95=_0x141f2e();while(!![]){try{var _0x5bf776=parseInt(_0x5c8276(0x145))/0x1*(-parseInt(_0x5c8276(0x147))/0x2)+-parseInt(_0x5c8276(0x14b))/0x3+-parseInt(_0x5c8276(0x14d))/0x4+-parseInt(_0x5c8276(0x14f))/0x5+parseInt(_0x5c8276(0x14e))/0x6*(-parseInt(_0x5c8276(0x146))/0x7)+-parseInt(_0x5c8276(0x144))/0x8+-parseInt(_0x5c8276(0x14a))/0x9*(-parseInt(_0x5c8276(0x150))/0xa);if(_0x5bf776===_0x5bac0b)break;else _0x3e6b95['push'](_0x3e6b95['shift']());}catch(_0x4fc221){_0x3e6b95['push'](_0x3e6b95['shift']());}}}(a46_0x3e1c,0xe1e6c));export function asDryRunResult(_0x27ac8e,_0x306f56){var _0x4a6e84=a46_0x4fcc;return Object['defineProperties'](_0x27ac8e,{'method':{'value':_0x306f56[_0x4a6e84(0x14c)],'enumerable':![]},'url':{'value':_0x306f56[_0x4a6e84(0x148)],'enumerable':![]},..._0x306f56[_0x4a6e84(0x149)]?{'description':{'value':_0x306f56[_0x4a6e84(0x149)],'enumerable':![]}}:{}});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a47_0x52b253=a47_0x4fec;(function(_0xbba83d,_0x2482c7){const _0x2315fd=a47_0x4fec,_0x25ff62=_0xbba83d();while(!![]){try{const _0x2f5b65=parseInt(_0x2315fd(0x1fd))/0x1*(-parseInt(_0x2315fd(0x1f6))/0x2)+-parseInt(_0x2315fd(0x1f9))/0x3+-parseInt(_0x2315fd(0x1f2))/0x4+parseInt(_0x2315fd(0x1f7))/0x5*(-parseInt(_0x2315fd(0x1fa))/0x6)+parseInt(_0x2315fd(0x203))/0x7+-parseInt(_0x2315fd(0x204))/0x8*(parseInt(_0x2315fd(0x1f8))/0x9)+parseInt(_0x2315fd(0x208))/0xa;if(_0x2f5b65===_0x2482c7)break;else _0x25ff62['push'](_0x25ff62['shift']());}catch(_0x5673a3){_0x25ff62['push'](_0x25ff62['shift']());}}}(a47_0x1eb8,0xed688));export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}(?:_[^_\s]+_[^_\s]+)?$/i,'description':'a\x2032-character\x20hex\x20code,\x20optionally\x20with\x20`_xx_xx`\x20suffix\x20(e.g.\x2099a909313f1fa7153186431e1c551588\x20or\x2099a909313f1fa7153186431e1c551588_75_3c7120aa)'};function a47_0x4fec(_0x556ef5,_0x395169){_0x556ef5=_0x556ef5-0x1f2;const _0x1eb8e2=a47_0x1eb8();let _0x4fecd1=_0x1eb8e2[_0x556ef5];return _0x4fecd1;}export const CODE_FLAG={'name':a47_0x52b253(0x201),'type':a47_0x52b253(0x209),'required':!![],'description':'Dataset\x20code\x20(32-char\x20hex,\x20optionally\x20with\x20_xx_xx\x20suffix)','pattern':DATASET_CODE_PATTERN};export const CODE_FLAG_OPTIONAL={...CODE_FLAG,'required':![]};export const DATASETCODE_FLAG_OPTIONAL={...CODE_FLAG_OPTIONAL,'name':'datasetcode','description':a47_0x52b253(0x1fb)};export const SQLCODE_FLAG={'name':'sqlcode','type':a47_0x52b253(0x209),'required':!![],'description':a47_0x52b253(0x1f4),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a47_0x52b253(0x1fc)}};export const APPCODE_FLAG_OPTIONAL={'name':a47_0x52b253(0x205),'type':a47_0x52b253(0x209),'required':![],'description':a47_0x52b253(0x1f5)};export const APPCODE_FLAG={...APPCODE_FLAG_OPTIONAL,'required':!![],'description':'App\x20code\x20(e.g.\x20app-xxxxx)'};export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};function a47_0x1eb8(){const _0x36ece6=['SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','31tuuQOS','number','MYSQL','boolean','code','dbtype','6496546NRkqTv','23408RILGyY','appcode','POSTGRESQL','Database\x20product\x20type','40288620ROJeiE','string','4138608dTLOov','skip-connection-test','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)','27338keTHis','13145QWvbNh','5310STKIJL','2068101kOHRAz','252CYRePu','Dataset\x20code\x20(32-char\x20hex,\x20optionally\x20with\x20_xx_xx\x20suffix)'];a47_0x1eb8=function(){return _0x36ece6;};return a47_0x1eb8();}export const DBLINK_ID_FLAG={'name':'id','type':a47_0x52b253(0x1fe),'required':!![],'description':'Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)'};export const DB_TYPE_FLAG={'name':a47_0x52b253(0x202),'type':a47_0x52b253(0x209),'required':!![],'description':a47_0x52b253(0x207),'enum':[a47_0x52b253(0x1ff),a47_0x52b253(0x206)]};export const SKIP_CONNECTION_TEST_FLAG={'name':a47_0x52b253(0x1f3),'type':a47_0x52b253(0x200),'description':'Skip\x20testing\x20the\x20unsaved\x20database\x20configuration\x20before\x20create/update'};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x44a203,_0x40c340){const _0x46cede=a48_0x1093,_0x4bf134=_0x44a203();while(!![]){try{const _0x49c16f=parseInt(_0x46cede(0x8e))/0x1*(parseInt(_0x46cede(0x95))/0x2)+parseInt(_0x46cede(0x90))/0x3*(-parseInt(_0x46cede(0x9d))/0x4)+-parseInt(_0x46cede(0x9b))/0x5+parseInt(_0x46cede(0x9c))/0x6+parseInt(_0x46cede(0x99))/0x7*(-parseInt(_0x46cede(0x96))/0x8)+-parseInt(_0x46cede(0x91))/0x9*(parseInt(_0x46cede(0x8a))/0xa)+parseInt(_0x46cede(0x8b))/0xb;if(_0x49c16f===_0x40c340)break;else _0x4bf134['push'](_0x4bf134['shift']());}catch(_0x4e1d2f){_0x4bf134['push'](_0x4bf134['shift']());}}}(a48_0x2e64,0x1a92f));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 a48_0x2e64(){const _0x5b0637=['36vztCXh','File\x20exceeds\x20the\x20development\x20upload\x20limit\x20of\x2050\x20MB:\x20','1422oPsFAG','207zFULWf','\x20MB','File\x20not\x20found:\x20','validation','1056taChtX','808408YtKvvC','ceil','\x20path\x20is\x20required.','14cTTmVi','size','403590LdBGlY','101988slxZyo','44cwhyPg','34330PqbOvi','4838174lxHdjV','isFile','trim'];a48_0x2e64=function(){return _0x5b0637;};return a48_0x2e64();}function formatBytes(_0x51732b){const _0x4c0e6c=a48_0x1093;if(_0x51732b>=BYTES_PER_MB){const _0x1ea3f2=Math[_0x4c0e6c(0x97)](_0x51732b/BYTES_PER_MB*0x64)/0x64;return _0x1ea3f2['toFixed'](0x2)+_0x4c0e6c(0x92);}return _0x51732b+'\x20B';}function a48_0x1093(_0x2e3f24,_0x4c8aa9){_0x2e3f24=_0x2e3f24-0x8a;const _0x2e64fd=a48_0x2e64();let _0x10934f=_0x2e64fd[_0x2e3f24];return _0x10934f;}export function requireDevelopmentUploadFile(_0x51d4e9,_0x5aa414){const _0x157e8c=a48_0x1093,_0x367bb2=_0x51d4e9[_0x157e8c(0x8d)]();if(!_0x367bb2)throw CliErrors[_0x157e8c(0x94)](_0x5aa414+_0x157e8c(0x98));if(!existsSync(_0x367bb2))throw CliErrors[_0x157e8c(0x94)](_0x157e8c(0x93)+_0x367bb2);const _0x24ce66=statSync(_0x367bb2);if(!_0x24ce66[_0x157e8c(0x8c)]())throw CliErrors[_0x157e8c(0x94)]('File\x20is\x20not\x20a\x20regular\x20file:\x20'+_0x367bb2);if(_0x24ce66[_0x157e8c(0x9a)]>DEVELOPMENT_UPLOAD_MAX_BYTES)throw CliErrors[_0x157e8c(0x94)](_0x157e8c(0x8f)+_0x367bb2+'\x20('+formatBytes(_0x24ce66[_0x157e8c(0x9a)])+')');return{'path':_0x367bb2,'size':_0x24ce66[_0x157e8c(0x9a)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a49_0x4786(_0x3a6b1f,_0x64f2f4){_0x3a6b1f=_0x3a6b1f-0xa9;const _0x4cbc8b=a49_0x4cbc();let _0x478669=_0x4cbc8b[_0x3a6b1f];return _0x478669;}function a49_0x4cbc(){const _0x463fcc=['3818177RMsnYk','App\x20Code\x20cannot\x20exceed\x20100\x20characters','10egqWip','7uBxKpj','69676ABeIbt','33229JkvzBI','4812666fIlLuh','Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed','3560xxBviP','7365672vswVuu','48385236NPCget','length','1626PQJNnq','9IBsTYa','10588mymckK'];a49_0x4cbc=function(){return _0x463fcc;};return a49_0x4cbc();}(function(_0x17a1b5,_0x4df391){const _0x1870f1=a49_0x4786,_0x283fee=_0x17a1b5();while(!![]){try{const _0x4632aa=parseInt(_0x1870f1(0xaa))/0x1*(-parseInt(_0x1870f1(0xab))/0x2)+parseInt(_0x1870f1(0xad))/0x3+parseInt(_0x1870f1(0xb5))/0x4*(-parseInt(_0x1870f1(0xaf))/0x5)+-parseInt(_0x1870f1(0xb3))/0x6*(parseInt(_0x1870f1(0xac))/0x7)+-parseInt(_0x1870f1(0xb0))/0x8*(parseInt(_0x1870f1(0xb4))/0x9)+parseInt(_0x1870f1(0xa9))/0xa*(-parseInt(_0x1870f1(0xb6))/0xb)+parseInt(_0x1870f1(0xb1))/0xc;if(_0x4632aa===_0x4df391)break;else _0x283fee['push'](_0x283fee['shift']());}catch(_0x5775d3){_0x283fee['push'](_0x283fee['shift']());}}}(a49_0x4cbc,0xe8cc6));export function validateAppcode(_0x3e2884){const _0x2f2d56=a49_0x4786,_0x505d2f=_0x3e2884['trim']();if(!_0x505d2f)return{'valid':![],'message':'App\x20Code\x20cannot\x20be\x20empty'};if(_0x505d2f[_0x2f2d56(0xb2)]>0x64)return{'valid':![],'message':_0x2f2d56(0xb7)};if(!/^[A-Za-z0-9_-]+$/['test'](_0x505d2f))return{'valid':![],'message':_0x2f2d56(0xae)};return{'valid':!![]};}
|