@lovrabet/rabetbase-cli 2.3.15 → 2.3.16-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/README.md +7 -2
- 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/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/remove.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/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.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 -0
- package/lib/commands/kb/delete.js +1 -0
- package/lib/commands/kb/detail.js +1 -0
- package/lib/commands/kb/index.js +1 -0
- package/lib/commands/kb/list.js +1 -0
- package/lib/commands/kb/shared.js +1 -0
- package/lib/commands/kb/update.js +1 -0
- 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/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/ocr/index.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/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.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/non-interactive.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/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.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/save.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/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.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.js +1 -1
- package/lib/help.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 -0
- 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/copy-directory.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/lib/commands/bff/list.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a35_0x39db98=a35_0x5584;function a35_0x4c17(){const _0x512558=['Filter\x20by\x20script\x20name','70wDmAsh','594196zKeFNR','Script\x20type\x20filter','string','length','3570111XLqqti','63MgUVgb','type','name','list','appCode','boolean','COMMON','6246YZLkqz','622680fBJQsK','ENDPOINT','verbose','(unnamed)','Return\x20full\x20script\x20objects','902793ZbAoKV','description','5032092JZBtOz','List\x20BFF\x20scripts','str','bff','functionName','2155310vyqkLp','2036LeMTau','map'];a35_0x4c17=function(){return _0x512558;};return a35_0x4c17();}(function(_0x2fc949,_0x550e80){const _0x98d7f1=a35_0x5584,_0x524442=_0x2fc949();while(!![]){try{const _0x42226e=-parseInt(_0x98d7f1(0x111))/0x1+parseInt(_0x98d7f1(0xff))/0x2+-parseInt(_0x98d7f1(0x10b))/0x3*(parseInt(_0x98d7f1(0xfb))/0x4)+-parseInt(_0x98d7f1(0xfa))/0x5+-parseInt(_0x98d7f1(0x113))/0x6+-parseInt(_0x98d7f1(0x104))/0x7*(-parseInt(_0x98d7f1(0x10c))/0x8)+parseInt(_0x98d7f1(0x103))/0x9*(parseInt(_0x98d7f1(0xfe))/0xa);if(_0x42226e===_0x550e80)break;else _0x524442['push'](_0x524442['shift']());}catch(_0x510ea8){_0x524442['push'](_0x524442['shift']());}}}(a35_0x4c17,0x8458b));import{listBffScripts}from'../../core/api-client.js';function a35_0x5584(_0x46ebd7,_0x4a56ed){_0x46ebd7=_0x46ebd7-0xf6;const _0x4c1725=a35_0x4c17();let _0x558427=_0x4c1725[_0x46ebd7];return _0x558427;}export const bffList={'service':a35_0x39db98(0xf8),'command':a35_0x39db98(0x107),'description':a35_0x39db98(0xf6),'risk':'read','flags':[{'name':a35_0x39db98(0x105),'type':a35_0x39db98(0x101),'description':a35_0x39db98(0x100),'default':a35_0x39db98(0x10d),'enum':[a35_0x39db98(0x10d),a35_0x39db98(0x10a)]},{'name':a35_0x39db98(0x106),'type':a35_0x39db98(0x101),'description':a35_0x39db98(0xfd)},{'name':a35_0x39db98(0x10e),'type':a35_0x39db98(0x109),'description':a35_0x39db98(0x110)}],async 'execute'(_0x8fe92d){const _0x2de528=a35_0x39db98,_0x19dc33=await listBffScripts(_0x8fe92d[_0x2de528(0x108)],_0x8fe92d[_0x2de528(0xf7)]('type'),{'scriptName':_0x8fe92d[_0x2de528(0xf7)]('name')||undefined}),_0x2b412e=_0x8fe92d['bool']('verbose');return{'ok':!![],'data':_0x2b412e?_0x19dc33:_0x19dc33[_0x2de528(0xfc)](_0x3e2ff0=>({'id':_0x3e2ff0['id'],'functionName':_0x3e2ff0[_0x2de528(0xf9)]??'','description':_0x3e2ff0[_0x2de528(0x112)]||_0x2de528(0x10f),'scriptType':_0x3e2ff0['scriptType']})),'message':_0x19dc33[_0x2de528(0x102)]===0x0?'No\x20BFF\x20scripts\x20found.':undefined};}};
|
package/lib/commands/bff/pull.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0xeeba66=a36_0x89b4;(function(_0x34abe4,_0x192b14){const _0x4b7f34=a36_0x89b4,_0x56f0d2=_0x34abe4();while(!![]){try{const _0x580c9b=-parseInt(_0x4b7f34(0x112))/0x1+-parseInt(_0x4b7f34(0x117))/0x2+parseInt(_0x4b7f34(0x11a))/0x3*(-parseInt(_0x4b7f34(0x102))/0x4)+-parseInt(_0x4b7f34(0xec))/0x5*(-parseInt(_0x4b7f34(0x10c))/0x6)+parseInt(_0x4b7f34(0x10d))/0x7*(parseInt(_0x4b7f34(0x101))/0x8)+parseInt(_0x4b7f34(0xff))/0x9+parseInt(_0x4b7f34(0xe3))/0xa;if(_0x580c9b===_0x192b14)break;else _0x56f0d2['push'](_0x56f0d2['shift']());}catch(_0x1f4c4c){_0x56f0d2['push'](_0x56f0d2['shift']());}}}(a36_0x146f,0x3fbac));import{createInterface}from'node:readline';import{writeFile}from'node:fs/promises';import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';function a36_0x146f(){const _0x43e733=['message','&type=','stdin','scriptContent','apiDir','Force\x20pull\x20cancelled.','scriptsRoot','421305zRowMF','hookLocation','alias','bool','functionName','\x20failed','local\x20unsynced\x20changes','hash','force','lockKey','push','length','filePath','lockFilePath','GET','stringify','\x20skipped,\x20','Remote\x20script\x20missing\x20content.','version','2065752aWZvTp','boolean','164720vKvkRh','1172572nXvkRQ','No\x20remote\x20BFF\x20scripts\x20found.','toLowerCase','type','conflict','scriptType','apps','cancelled','unresolvable\x20target\x20path','bff','12NxcrQA','77MTrLZd','datasetCode','str','Force\x20overwrite\x20local\x20unsynced\x20changes','string','356906FwsOGL','functionNode','appCode','includes','nonInteractive','139638fYgAux','\x20pulled,\x20','functions','3VCBVLD','Would\x20inspect\x20','pull','would_pull','Lock\x20scope\x20for\x20app\x20\x22','/api/management/library/scripts/list?appCode=','Pull\x20only\x20this\x20script\x20type','utf8','Pull\x20remote\x20BFF\x20scripts\x20to\x20local','operationType','Force\x20pull\x20will\x20overwrite\x20local\x20unsynced\x20changes.\x20Continue?\x20[y/N]\x20','HOOK','--type\x20must\x20be\x20COMMON,\x20ENDPOINT,\x20or\x20HOOK.','3563640BLieXG','map'];a36_0x146f=function(){return _0x43e733;};return a36_0x146f();}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';function a36_0x89b4(_0x3b1f5f,_0x36cc5e){_0x3b1f5f=_0x3b1f5f-0xdc;const _0x146fe9=a36_0x146f();let _0x89b449=_0x146fe9[_0x3b1f5f];return _0x89b449;}export const bffPull={'service':a36_0xeeba66(0x10b),'command':a36_0xeeba66(0x11c),'description':a36_0xeeba66(0xde),'risk':'write','flags':[{'name':'type','type':a36_0xeeba66(0x111),'description':a36_0xeeba66(0xdc),'enum':['COMMON','ENDPOINT',a36_0xeeba66(0xe1)]},{'name':'force','type':a36_0xeeba66(0x100),'description':a36_0xeeba66(0x110)}],async 'dryRun'(_0x337206){const _0x3ca8aa=a36_0xeeba66,_0x10b204=loadBffProjectConfig(_0x337206['appCode']),_0x1f1866=await readBffLockFile(_0x10b204[_0x3ca8aa(0xf9)]),{appLock:_0xf57623}=ensureLockScope(_0x1f1866??createEmptyBffLock(),_0x337206[_0x3ca8aa(0x114)],_0x10b204[_0x3ca8aa(0xeb)],_0x3ca8aa(0x11c)),_0x487506=normalizeBffType(_0x337206[_0x3ca8aa(0x10f)](_0x3ca8aa(0x105)))??undefined,_0x30ddda=buildDatasetCodeToAliasMap(_0x337206[_0x3ca8aa(0xe9)],_0x337206['appCode']),[_0x1f33cf,_0x4ed3c6]=await Promise['all']([listBffScripts(_0x337206[_0x3ca8aa(0x114)],_0x487506),getBffScriptStatistics(_0x337206[_0x3ca8aa(0x114)])]),_0x5b19c2=createHookLocationMap(_0x4ed3c6),_0xb7104e=[];for(const _0x3cfb06 of _0x1f33cf){const _0x55adfb=resolveRemoteScriptTarget(_0x10b204,_0x3cfb06,_0x5b19c2,_0xf57623[_0x3ca8aa(0x119)],_0x30ddda);if(!_0x55adfb){_0xb7104e['push']({'scriptType':_0x3cfb06[_0x3ca8aa(0x107)],'functionName':_0x3cfb06['functionName']??'','status':'skipped','reason':_0x3ca8aa(0x10a)});continue;}const _0x5e2452=_0xf57623[_0x3ca8aa(0x119)][_0x55adfb[_0x3ca8aa(0xf5)]],_0x4623ae=_0x3cfb06[_0x3ca8aa(0xe8)]!=null?computeContentHash(_0x3cfb06[_0x3ca8aa(0xe8)]):undefined,_0x4b0bb2=await hasUnsyncedLocalChanges(_0x55adfb[_0x3ca8aa(0xf8)],_0x5e2452,_0x4623ae);_0xb7104e['push']({'lockKey':_0x55adfb['lockKey'],'filePath':_0x55adfb[_0x3ca8aa(0xf8)],'remoteId':_0x3cfb06['id']??null,'status':_0x4b0bb2?_0x3ca8aa(0x106):_0x3ca8aa(0x11d)});}return{'method':_0x3ca8aa(0xfa),'url':_0x3ca8aa(0x11f)+_0x337206[_0x3ca8aa(0x114)]+(_0x487506?_0x3ca8aa(0xe6)+_0x487506:''),'body':{'appCode':_0x337206[_0x3ca8aa(0x114)],'filterType':_0x487506??null,'files':_0xb7104e},'description':_0x3ca8aa(0x11b)+_0xb7104e[_0x3ca8aa(0xf7)]+'\x20remote\x20BFF\x20script(s)\x20for\x20pull'};},async 'execute'(_0x5df8cc){const _0x386870=a36_0xeeba66,_0x59606c=loadBffProjectConfig(_0x5df8cc[_0x386870(0x114)]),_0x4ee569=await readBffLockFile(_0x59606c[_0x386870(0xf9)]),{lockData:_0x3cd4d4,appLock:_0x1c8a89}=ensureLockScope(_0x4ee569??createEmptyBffLock(),_0x5df8cc[_0x386870(0x114)],_0x59606c[_0x386870(0xeb)],'pull'),_0x2ff1c1=normalizeBffType(_0x5df8cc[_0x386870(0x10f)](_0x386870(0x105)))??undefined;if(_0x5df8cc[_0x386870(0x10f)](_0x386870(0x105))&&!_0x2ff1c1)throw CliErrors['validation'](_0x386870(0xe2));const [_0x3039ec,_0x602548]=await Promise['all']([listBffScripts(_0x5df8cc['appCode'],_0x2ff1c1),getBffScriptStatistics(_0x5df8cc['appCode'])]);if(_0x3039ec[_0x386870(0xf7)]===0x0)return{'ok':!![],'data':{'pulled':[],'skipped':[],'failed':[]},'message':_0x386870(0x103)};const _0x3db2be=_0x5df8cc[_0x386870(0xef)](_0x386870(0xf4));if(_0x3db2be&&!_0x5df8cc[_0x386870(0x116)]){const _0x5e97d3=await confirmForce();if(!_0x5e97d3)throw CliErrors[_0x386870(0x109)](_0x386870(0xea));}if(_0x3db2be&&_0x5df8cc[_0x386870(0x116)]){}const _0xd7aef9=buildDatasetCodeToAliasMap(_0x5df8cc[_0x386870(0xe9)],_0x5df8cc['appCode']),_0x264255=createHookLocationMap(_0x602548),_0x4b532a=JSON['parse'](JSON[_0x386870(0xfb)](_0x3cd4d4)),_0x16404b=_0x5df8cc['appCode'],_0x5ea189=_0x4b532a[_0x386870(0x108)][_0x16404b];if(!_0x5ea189)throw new Error(_0x386870(0x11e)+_0x16404b+'\x22\x20not\x20found\x20after\x20ensureLockScope.');const _0x58fa7a=[],_0x401c11=[],_0x11e78b=[];for(const _0x2dbb48 of _0x3039ec){const _0x22a6ba=resolveRemoteScriptTarget(_0x59606c,_0x2dbb48,_0x264255,_0x1c8a89[_0x386870(0x119)],_0xd7aef9);if(!_0x22a6ba){_0x401c11['push']({'lockKey':_0x2dbb48[_0x386870(0x107)]+'/'+_0x2dbb48[_0x386870(0xf0)],'reason':_0x386870(0x10a)});continue;}const _0x521391=_0x1c8a89['functions'][_0x22a6ba['lockKey']];try{if(!_0x2dbb48['id'])throw new Error('Remote\x20script\x20missing\x20id.');if(_0x2dbb48[_0x386870(0xe8)]==null)throw new Error(_0x386870(0xfd));const _0x1ab2a4=_0x2dbb48['scriptContent'],_0x293436=computeContentHash(_0x1ab2a4);if(!_0x3db2be){const _0x8515d1=await hasUnsyncedLocalChanges(_0x22a6ba[_0x386870(0xf8)],_0x521391,_0x293436);if(_0x8515d1){_0x401c11['push']({'lockKey':_0x22a6ba[_0x386870(0xf5)],'reason':_0x386870(0xf2)});continue;}}await ensureParentDirectory(_0x22a6ba[_0x386870(0xf8)]),await writeFile(_0x22a6ba[_0x386870(0xf8)],_0x1ab2a4,_0x386870(0xdd));const _0x3095e7={'hash':_0x293436,'remoteId':_0x2dbb48['id'],'version':_0x2dbb48[_0x386870(0xfe)]};_0x22a6ba[_0x386870(0x105)]===_0x386870(0xe1)&&_0x22a6ba[_0x386870(0xed)]&&(_0x3095e7['alias']=_0x22a6ba[_0x386870(0xed)][_0x386870(0xee)],_0x3095e7[_0x386870(0x10e)]=_0x22a6ba['hookLocation'][_0x386870(0x10e)],_0x3095e7[_0x386870(0xdf)]=_0x22a6ba['hookLocation'][_0x386870(0xdf)],_0x3095e7['functionNode']=_0x22a6ba[_0x386870(0xed)][_0x386870(0x113)]),_0x5ea189[_0x386870(0x119)][_0x22a6ba[_0x386870(0xf5)]]=_0x3095e7,_0x58fa7a[_0x386870(0xf6)]({'lockKey':_0x22a6ba[_0x386870(0xf5)],'remoteId':_0x2dbb48['id']});}catch(_0x5cac94){_0x11e78b['push']({'lockKey':_0x22a6ba[_0x386870(0xf5)],'error':_0x5cac94 instanceof Error?_0x5cac94[_0x386870(0xe5)]:String(_0x5cac94)});}}return _0x5ea189['lastSync']=new Date()['toISOString'](),await writeBffLockFile(_0x59606c['lockFilePath'],_0x4b532a),{'ok':_0x11e78b[_0x386870(0xf7)]===0x0,'data':{'pulled':_0x58fa7a,'skipped':_0x401c11,'failed':_0x11e78b},'message':'Pull\x20complete:\x20'+_0x58fa7a[_0x386870(0xf7)]+_0x386870(0x118)+_0x401c11['length']+_0x386870(0xfc)+_0x11e78b[_0x386870(0xf7)]+_0x386870(0xf1)};}};async function hasUnsyncedLocalChanges(_0x79bdce,_0x5d3c3a,_0x18e65a){const _0xb95f1b=a36_0xeeba66;if(!await fileExists(_0x79bdce))return![];const _0x33df24=await computeFileHash(_0x79bdce);if(!_0x5d3c3a)return _0x18e65a?_0x33df24!==_0x18e65a:!![];return _0x33df24!==_0x5d3c3a[_0xb95f1b(0xf3)];}function buildDatasetCodeToAliasMap(_0x2c8e8e,_0x552a59){const _0x149d84=a36_0xeeba66,_0x4381e6=loadAliasMap(_0x2c8e8e,undefined,resolveApiFilePath(_0x2c8e8e,_0x552a59));return new Map(_0x4381e6[_0x149d84(0xe4)](_0x4295f6=>[_0x4295f6[_0x149d84(0x10e)],_0x4295f6[_0x149d84(0xee)]]));}async function confirmForce(){const _0x2b1e72=a36_0xeeba66,_0x5a360d=createInterface({'input':process[_0x2b1e72(0xe7)],'output':process['stderr']}),_0xd7aa24=await new Promise(_0x126c9e=>{const _0x3e55fc=_0x2b1e72;_0x5a360d['question'](_0x3e55fc(0xe0),_0x126c9e);});return _0x5a360d['close'](),['y','yes'][_0x2b1e72(0x115)](_0xd7aa24['trim']()[_0x2b1e72(0x104)]());}
|
package/lib/commands/bff/push.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a37_0x30a808=a37_0x1910;(function(_0x4d7373,_0x3ae97d){const _0x88ac83=a37_0x1910,_0x5cd0a2=_0x4d7373();while(!![]){try{const _0x4faa08=-parseInt(_0x88ac83(0x1e0))/0x1+parseInt(_0x88ac83(0x218))/0x2+parseInt(_0x88ac83(0x1f3))/0x3*(-parseInt(_0x88ac83(0x1fe))/0x4)+parseInt(_0x88ac83(0x21e))/0x5*(-parseInt(_0x88ac83(0x1fa))/0x6)+parseInt(_0x88ac83(0x21a))/0x7+-parseInt(_0x88ac83(0x1f9))/0x8+parseInt(_0x88ac83(0x1e3))/0x9;if(_0x4faa08===_0x3ae97d)break;else _0x5cd0a2['push'](_0x5cd0a2['shift']());}catch(_0x667363){_0x5cd0a2['push'](_0x5cd0a2['shift']());}}}(a37_0x4da4,0x5bd6a));import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';function a37_0x1910(_0x394e6e,_0x31d8bc){_0x394e6e=_0x394e6e-0x1d9;const _0x4da490=a37_0x4da4();let _0x191061=_0x4da490[_0x394e6e];return _0x191061;}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';function a37_0x4da4(){const _0x41e01c=['str','4079488UemKcm','operationType','Lock\x20scope\x20for\x20app\x20\x22','boolean','1379515Zkryjx','/api/management/library/scripts/save','\x20uploaded,\x20','message','name','Local\x20function\x20not\x20found:\x20','\x20failed,\x20','appCode','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','would_push','validation','bool','unchanged','remoteId','211270BYHeHE','ENDPOINT','map','3993642SguFKM','Incomplete\x20HOOK\x20path:\x20','values','alias','lastSync','script','apps','No\x20local\x20BFF\x20functions\x20found.','scriptsRoot','status','code','update','toISOString','datasetCode','get','HOOK','47694aFtlbB','Cannot\x20resolve\x20dataset\x20for\x20\x22','has','push','lockFilePath','string','3021528DrYfny','6lMWTkQ','version','\x22.\x20','cleared','64tJsDSK','aliasToDatasetCode','\x22\x20not\x20found\x20after\x20ensureLockScope.','functionNode','Push\x20only\x20this\x20script\x20type','apiDir','filePath','functions','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','set','attempted','lockKey','description','runtime\x20cache\x20not\x20needed','\x20skipped,\x20','Force\x20push\x20ignoring\x20hash\x20protection','Would\x20inspect\x20',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','force','Push\x20local\x20BFF\x20scripts\x20to\x20remote','length','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','type','POST','some','937760gAxJJc'];a37_0x4da4=function(){return _0x41e01c;};return a37_0x4da4();}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':'bff','command':a37_0x30a808(0x1f6),'description':a37_0x30a808(0x212),'risk':'high-risk-write','flags':[{'name':a37_0x30a808(0x215),'type':a37_0x30a808(0x1f8),'description':a37_0x30a808(0x202),'enum':['COMMON',a37_0x30a808(0x1e1),a37_0x30a808(0x1f2)]},{'name':a37_0x30a808(0x222),'type':a37_0x30a808(0x1f8),'description':a37_0x30a808(0x1da)},{'name':a37_0x30a808(0x211),'type':a37_0x30a808(0x21d),'description':a37_0x30a808(0x20d)}],async 'dryRun'(_0x366fee){const _0xd834c2=a37_0x30a808,_0x20f556=loadBffProjectConfig(_0x366fee[_0xd834c2(0x1d9)]),_0x4cd1a0=await readBffLockFile(_0x20f556[_0xd834c2(0x1f7)]),{appLock:_0x43c430}=ensureLockScope(_0x4cd1a0??createEmptyBffLock(),_0x366fee[_0xd834c2(0x1d9)],_0x20f556[_0xd834c2(0x1eb)],'push'),_0x3950c2=await getTargetFunctions(_0x20f556,_0x366fee),_0x4b61d1=_0x366fee[_0xd834c2(0x1dd)](_0xd834c2(0x211)),_0x447895=[];for(const _0x2b31eb of _0x3950c2){const _0x5305e6=await computeFileHash(_0x2b31eb[_0xd834c2(0x204)]),_0x57c841=_0x43c430['functions'][_0x2b31eb[_0xd834c2(0x209)]],_0x489cd7=!!_0x57c841&&_0x57c841['hash']===_0x5305e6;_0x447895['push']({'lockKey':_0x2b31eb['lockKey'],'filePath':_0x2b31eb['filePath'],'remoteId':_0x57c841?.[_0xd834c2(0x1df)]??null,'mode':_0x57c841?.[_0xd834c2(0x1df)]?_0xd834c2(0x1ee):'create','status':!_0x4b61d1&&_0x489cd7?'unchanged':_0xd834c2(0x1db)});}return{'method':_0xd834c2(0x216),'url':_0xd834c2(0x21f),'body':{'appCode':_0x366fee['appCode'],'force':_0x4b61d1,'files':_0x447895,'cacheClearAtRuntime':_0x447895['some'](_0xf3ff0f=>_0xf3ff0f[_0xd834c2(0x1ec)]==='would_push'),'cacheClearAtRuntimeTimes':_0x447895[_0xd834c2(0x217)](_0x2dbe2f=>_0x2dbe2f['status']===_0xd834c2(0x1db))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0xd834c2(0x20e)+_0x447895[_0xd834c2(0x213)]+_0xd834c2(0x214)};},async 'execute'(_0x183aa4){const _0xe94b7b=a37_0x30a808,_0x357228=loadBffProjectConfig(_0x183aa4[_0xe94b7b(0x1d9)]),_0x2f9094=await readBffLockFile(_0x357228['lockFilePath']),{lockData:_0x326a5e,appLock:_0x5cfd07}=ensureLockScope(_0x2f9094??createEmptyBffLock(),_0x183aa4[_0xe94b7b(0x1d9)],_0x357228[_0xe94b7b(0x1eb)],_0xe94b7b(0x1f6)),_0x5c90e1=await getTargetFunctions(_0x357228,_0x183aa4);if(_0x5c90e1[_0xe94b7b(0x213)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':_0xe94b7b(0x1ea)};const _0x482257=_0x183aa4[_0xe94b7b(0x1dd)](_0xe94b7b(0x211)),_0x540a87=JSON['parse'](JSON['stringify'](_0x326a5e)),_0x54fe06=_0x540a87[_0xe94b7b(0x1e9)][_0x183aa4[_0xe94b7b(0x1d9)]];if(!_0x54fe06)throw new Error(_0xe94b7b(0x21c)+_0x183aa4['appCode']+_0xe94b7b(0x200));const _0x4e74fe=await buildHookMaps(_0x183aa4[_0xe94b7b(0x1d9)],_0x183aa4[_0xe94b7b(0x203)],_0x5c90e1,_0x54fe06),_0x3344fc=[],_0x2437e5=[],_0x46b355=[];for(const _0x593676 of _0x5c90e1){const _0x9742e6=await computeFileHash(_0x593676['filePath']),_0x1c942c=_0x54fe06[_0xe94b7b(0x205)][_0x593676[_0xe94b7b(0x209)]];if(!_0x482257&&_0x1c942c&&_0x1c942c['hash']===_0x9742e6){_0x2437e5[_0xe94b7b(0x1f6)]({'lockKey':_0x593676[_0xe94b7b(0x209)],'reason':_0xe94b7b(0x1de)});continue;}try{await uploadSingleFunction(_0x183aa4[_0xe94b7b(0x1d9)],_0x593676,_0x54fe06,_0x4e74fe);const _0x1ad068=_0x54fe06['functions'][_0x593676[_0xe94b7b(0x209)]];_0x3344fc[_0xe94b7b(0x1f6)]({'lockKey':_0x593676[_0xe94b7b(0x209)],'remoteId':_0x1ad068?.[_0xe94b7b(0x1df)]??0x0});}catch(_0x13b0e2){_0x46b355['push']({'lockKey':_0x593676[_0xe94b7b(0x209)],'error':_0x13b0e2 instanceof Error?_0x13b0e2[_0xe94b7b(0x221)]:String(_0x13b0e2)});}}_0x54fe06[_0xe94b7b(0x1e7)]=new Date()[_0xe94b7b(0x1ef)](),await writeBffLockFile(_0x357228[_0xe94b7b(0x1f7)],_0x540a87),await waitForUploadedLockEntries(_0x357228[_0xe94b7b(0x1f7)],_0x183aa4['appCode'],_0x3344fc[_0xe94b7b(0x1e2)](_0x57053d=>_0x57053d['lockKey']));let _0x242bef={'attempted':![],'cleared':![]};if(_0x3344fc['length']>0x0)try{let _0x2a10f5='';for(let _0x51fe93=0x0;_0x51fe93<CACHE_CLEAR_ATTEMPTS;_0x51fe93+=0x1){_0x2a10f5=await clearBffScriptCache(),_0x51fe93<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x242bef={'attempted':!![],'cleared':!![],'message':_0x2a10f5||'Runtime\x20script\x20cache\x20cleared.'};}catch(_0x3eb874){_0x242bef={'attempted':!![],'cleared':![],'error':_0x3eb874 instanceof Error?_0x3eb874[_0xe94b7b(0x221)]:String(_0x3eb874)};}const _0x262506=_0x46b355[_0xe94b7b(0x213)]===0x0&&(_0x242bef[_0xe94b7b(0x208)]?_0x242bef[_0xe94b7b(0x1fd)]:!![]),_0x3a2830=_0x242bef[_0xe94b7b(0x208)]?_0x242bef[_0xe94b7b(0x1fd)]?'runtime\x20cache\x20cleared':'runtime\x20cache\x20clear\x20failed':_0xe94b7b(0x20b);return{'ok':_0x262506,'data':{'uploaded':_0x3344fc,'skipped':_0x2437e5,'failed':_0x46b355,'cacheClear':_0x242bef},'message':'Push\x20complete:\x20'+_0x3344fc[_0xe94b7b(0x213)]+_0xe94b7b(0x220)+_0x2437e5[_0xe94b7b(0x213)]+_0xe94b7b(0x20c)+_0x46b355[_0xe94b7b(0x213)]+_0xe94b7b(0x224)+_0x3a2830};}};async function getTargetFunctions(_0x53ff3b,_0x37db0c){const _0x3f7d9a=a37_0x30a808,_0x3ab795=_0x37db0c[_0x3f7d9a(0x219)](_0x3f7d9a(0x215)),_0x37953f=_0x37db0c['str']('name'),_0x3e1d69=normalizeBffType(_0x3ab795)??undefined;if(_0x37953f&&!_0x3e1d69)throw CliErrors[_0x3f7d9a(0x1dc)]('--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.');const _0x5cd795=await scanLocalBffFunctions(_0x53ff3b,_0x3e1d69);if(_0x37953f){const _0x5d6d5e=_0x5cd795['filter'](_0x512e00=>_0x512e00[_0x3f7d9a(0x222)]===_0x37953f);if(_0x5d6d5e[_0x3f7d9a(0x213)]===0x0)throw CliErrors['validation'](_0x3f7d9a(0x223)+_0x3e1d69+'/'+_0x37953f);return _0x5d6d5e;}return _0x5cd795;}async function buildHookMaps(_0x5a4773,_0x20d46b,_0x134e50,_0x32b845){const _0x4c26c7=a37_0x30a808,_0x215b81=_0x134e50[_0x4c26c7(0x217)](_0x34b20b=>_0x34b20b['type']===_0x4c26c7(0x1f2));if(!_0x215b81)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x3aaee6=loadAliasMap(_0x20d46b,undefined,resolveApiFilePath(_0x20d46b,_0x5a4773)),_0x372cc1=new Map(_0x3aaee6['map'](_0x230ff6=>[_0x230ff6['alias'],_0x230ff6['datasetCode']]));for(const _0x283f17 of Object[_0x4c26c7(0x1e5)](_0x32b845[_0x4c26c7(0x205)])){_0x283f17['alias']&&_0x283f17[_0x4c26c7(0x1f0)]&&!_0x372cc1[_0x4c26c7(0x1f5)](_0x283f17[_0x4c26c7(0x1e6)])&&_0x372cc1[_0x4c26c7(0x207)](_0x283f17['alias'],_0x283f17[_0x4c26c7(0x1f0)]);}const _0x451cc6=await listDatasets(_0x5a4773),_0x2bda12=new Map(_0x451cc6[_0x4c26c7(0x1e2)](_0x793e6=>[_0x793e6[_0x4c26c7(0x1ed)],_0x793e6]));return{'aliasToDatasetCode':_0x372cc1,'datasetCodeToDataset':_0x2bda12};}async function uploadSingleFunction(_0x38f297,_0x4dbf33,_0x54e29d,_0x2e38b9){const _0x11d9bc=a37_0x30a808,_0x47053c=await readFile(_0x4dbf33[_0x11d9bc(0x204)],'utf8'),_0xceace8=await computeFileHash(_0x4dbf33[_0x11d9bc(0x204)]),_0x3cb534=_0x54e29d[_0x11d9bc(0x205)][_0x4dbf33[_0x11d9bc(0x209)]];if(_0x3cb534?.['remoteId']&&_0x3cb534[_0x11d9bc(0x1fb)]==null)throw CliErrors['validation'](_0x4dbf33[_0x11d9bc(0x209)]+_0x11d9bc(0x20f));let _0x3130e6=extractScriptDescription(_0x47053c);if(!_0x3130e6&&_0x3cb534?.['remoteId']){const _0x498a47=await getBffScriptInfo(_0x3cb534['remoteId']);_0x3130e6=_0x498a47[_0x11d9bc(0x20a)]||undefined;}const _0x154838={'appCode':_0x38f297,'functionName':_0x4dbf33[_0x11d9bc(0x222)],'scriptType':_0x4dbf33[_0x11d9bc(0x215)],'scriptContent':_0x47053c};if(_0x3cb534?.[_0x11d9bc(0x1df)])_0x154838['id']=_0x3cb534[_0x11d9bc(0x1df)];if(_0x3cb534?.['version']!=null)_0x154838[_0x11d9bc(0x1fb)]=_0x3cb534[_0x11d9bc(0x1fb)];if(_0x3130e6)_0x154838[_0x11d9bc(0x20a)]=_0x3130e6;if(_0x4dbf33['type']===_0x11d9bc(0x1f2)){const _0x299dbd=_0x4dbf33[_0x11d9bc(0x1e6)];if(!_0x299dbd||!_0x4dbf33['operationType']||!_0x4dbf33[_0x11d9bc(0x201)])throw CliErrors[_0x11d9bc(0x1dc)](_0x11d9bc(0x1e4)+_0x4dbf33['lockKey']);const _0x514fb0=_0x2e38b9[_0x11d9bc(0x1ff)][_0x11d9bc(0x1f1)](_0x299dbd)??_0x3cb534?.[_0x11d9bc(0x1f0)]??_0x299dbd,_0x7604d4=_0x2e38b9['datasetCodeToDataset'][_0x11d9bc(0x1f1)](_0x514fb0);if(!_0x7604d4)throw CliErrors[_0x11d9bc(0x1dc)](_0x11d9bc(0x1f4)+_0x299dbd+_0x11d9bc(0x1fc)+('Run\x20`'+CLI_BIN_NAME+_0x11d9bc(0x206)));_0x154838['datasetId']=_0x7604d4['id'],_0x154838[_0x11d9bc(0x21b)]=_0x4dbf33['operationType'],_0x154838[_0x11d9bc(0x201)]=_0x4dbf33[_0x11d9bc(0x201)];}const _0x243052=await saveBffScript(_0x154838),_0x349918=_0x243052['id'],_0x381131=_0x243052[_0x11d9bc(0x1e8)]??await getBffScriptInfo(_0x349918),_0x369ba3={'hash':_0xceace8,'remoteId':_0x349918,'version':_0x381131[_0x11d9bc(0x1fb)]};if(_0x4dbf33[_0x11d9bc(0x215)]===_0x11d9bc(0x1f2)){const _0x446209=_0x4dbf33[_0x11d9bc(0x1e6)],_0x5cbd54=_0x2e38b9[_0x11d9bc(0x1ff)][_0x11d9bc(0x1f1)](_0x446209)??_0x3cb534?.[_0x11d9bc(0x1f0)]??_0x446209;_0x2e38b9['aliasToDatasetCode']['has'](_0x446209)?_0x369ba3['alias']=_0x446209:_0x369ba3[_0x11d9bc(0x1e6)]=_0x3cb534?.[_0x11d9bc(0x1e6)],_0x369ba3[_0x11d9bc(0x1f0)]=_0x5cbd54,_0x369ba3[_0x11d9bc(0x21b)]=_0x4dbf33[_0x11d9bc(0x21b)],_0x369ba3[_0x11d9bc(0x201)]=_0x4dbf33[_0x11d9bc(0x201)];}_0x54e29d[_0x11d9bc(0x205)][_0x4dbf33[_0x11d9bc(0x209)]]=_0x369ba3;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x1299ed,_0x30d30b,_0xae867d){const _0x1c1038=a37_0x30a808;if(_0xae867d[_0x1c1038(0x213)]===0x0)return;for(let _0x4865d1=0x0;_0x4865d1<LOCK_SETTLE_RETRY_COUNT;_0x4865d1+=0x1){const _0x2bb155=await readBffLockFile(_0x1299ed),_0x40873c=_0x2bb155?.[_0x1c1038(0x1e9)]?.[_0x30d30b]?.[_0x1c1038(0x205)]??{},_0x14d6e0=_0xae867d['every'](_0xa59a24=>!!_0x40873c[_0xa59a24]?.[_0x1c1038(0x1df)]);if(_0x14d6e0)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x1c1038(0x210)+_0xae867d['join'](',\x20')+'.');}
|
|
1
|
+
const a37_0x9f4024=a37_0x3e26;(function(_0x53fd78,_0x2946ee){const _0x55c98b=a37_0x3e26,_0x587b10=_0x53fd78();while(!![]){try{const _0x3db054=parseInt(_0x55c98b(0xb4))/0x1*(parseInt(_0x55c98b(0x9d))/0x2)+-parseInt(_0x55c98b(0xdb))/0x3*(-parseInt(_0x55c98b(0xd5))/0x4)+parseInt(_0x55c98b(0xd9))/0x5*(-parseInt(_0x55c98b(0xeb))/0x6)+-parseInt(_0x55c98b(0xea))/0x7+parseInt(_0x55c98b(0xc0))/0x8+-parseInt(_0x55c98b(0xd7))/0x9+-parseInt(_0x55c98b(0xa1))/0xa*(parseInt(_0x55c98b(0xc9))/0xb);if(_0x3db054===_0x2946ee)break;else _0x587b10['push'](_0x587b10['shift']());}catch(_0x95ed74){_0x587b10['push'](_0x587b10['shift']());}}}(a37_0x4901,0x2e506));function a37_0x4901(){const _0x542cc2=['datasetCodeToDataset','would_push','alias','125362FkSxQw','Local\x20function\x20not\x20found:\x20','type','push','validation','functionNode','version','some','Force\x20push\x20ignoring\x20hash\x20protection','Lock\x20file\x20not\x20settled\x20after\x20push\x20for\x20','lastSync','bff','2209576hYVXdj','\x20api\x20pull`\x20to\x20refresh\x20api.ts,\x20or\x20verify\x20the\x20dataset\x20exists.','\x22\x20not\x20found\x20after\x20ensureLockScope.',':\x20missing\x20remote\x20version.\x20Run\x20`push`\x20after\x20`pull`\x20to\x20sync\x20version\x20info.','Push\x20complete:\x20','cleared','force','map','set','25751FUDiKP','join','hash','get','aliasToDatasetCode','filter','appCode','string','filePath','--name\x20requires\x20--type\x20to\x20identify\x20the\x20function.','Runtime\x20script\x20cache\x20cleared.','update','488LCJkkP','unchanged','1585494zYHCQL','remoteId','130835JrCyHc','lockKey','2076dSDbDC','Cannot\x20resolve\x20dataset\x20for\x20\x22','scriptsRoot','datasetId','stringify','/api/management/library/scripts/save','description','values','toISOString','Would\x20inspect\x20','bool','\x20local\x20BFF\x20script(s)\x20for\x20push\x20and\x20clear\x20runtime\x20cache\x20if\x20files\x20are\x20uploaded','attempted','functions','POST','1401449bRUOFV','30jXNVyh','ENDPOINT','\x20skipped,\x20','has','Push\x20only\x20the\x20named\x20function\x20(requires\x20--type)','6ElKdjP','runtime\x20cache\x20clear\x20failed','runtime\x20cache\x20not\x20needed','parse','170YzPJAQ','length','every','create','operationType','apps','name','script','Push\x20only\x20this\x20script\x20type','message','lockFilePath','status','Push\x20local\x20BFF\x20scripts\x20to\x20remote','datasetCode','str','HOOK'];a37_0x4901=function(){return _0x542cc2;};return a37_0x4901();}import{readFile}from'node:fs/promises';import{saveBffScript,getBffScriptInfo,listDatasets,clearBffScriptCache}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{normalizeBffType,scanLocalBffFunctions}from'../../core/bff/file-system.js';import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile,writeBffLockFile}from'../../core/bff/lock.js';import{extractScriptDescription}from'../../core/bff/utils.js';import{sleep}from'../../utils/sleep.js';import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';const CACHE_CLEAR_ATTEMPTS=0x2,CACHE_CLEAR_INTERVAL_MS=0x12c;export const bffPush={'service':a37_0x9f4024(0xbf),'command':'push','description':a37_0x9f4024(0xad),'risk':'high-risk-write','flags':[{'name':a37_0x9f4024(0xb6),'type':a37_0x9f4024(0xd0),'description':a37_0x9f4024(0xa9),'enum':['COMMON',a37_0x9f4024(0xec),a37_0x9f4024(0xb0)]},{'name':a37_0x9f4024(0xa7),'type':a37_0x9f4024(0xd0),'description':a37_0x9f4024(0xef)},{'name':a37_0x9f4024(0xc6),'type':'boolean','description':a37_0x9f4024(0xbc)}],async 'dryRun'(_0x39055d){const _0x4f743a=a37_0x9f4024,_0x40f68c=loadBffProjectConfig(_0x39055d[_0x4f743a(0xcf)]),_0x49ea78=await readBffLockFile(_0x40f68c[_0x4f743a(0xab)]),{appLock:_0x5df1b5}=ensureLockScope(_0x49ea78??createEmptyBffLock(),_0x39055d[_0x4f743a(0xcf)],_0x40f68c[_0x4f743a(0xdd)],'push'),_0x15927c=await getTargetFunctions(_0x40f68c,_0x39055d),_0x3481da=_0x39055d[_0x4f743a(0xe5)]('force'),_0xfecd9b=[];for(const _0x584e47 of _0x15927c){const _0x29d198=await computeFileHash(_0x584e47['filePath']),_0x528bea=_0x5df1b5['functions'][_0x584e47['lockKey']],_0x526691=!!_0x528bea&&_0x528bea['hash']===_0x29d198;_0xfecd9b[_0x4f743a(0xb7)]({'lockKey':_0x584e47[_0x4f743a(0xda)],'filePath':_0x584e47[_0x4f743a(0xd1)],'remoteId':_0x528bea?.[_0x4f743a(0xd8)]??null,'mode':_0x528bea?.[_0x4f743a(0xd8)]?_0x4f743a(0xd4):_0x4f743a(0xa4),'status':!_0x3481da&&_0x526691?'unchanged':_0x4f743a(0xb2)});}return{'method':_0x4f743a(0xe9),'url':_0x4f743a(0xe0),'body':{'appCode':_0x39055d[_0x4f743a(0xcf)],'force':_0x3481da,'files':_0xfecd9b,'cacheClearAtRuntime':_0xfecd9b[_0x4f743a(0xbb)](_0x535f8d=>_0x535f8d[_0x4f743a(0xac)]===_0x4f743a(0xb2)),'cacheClearAtRuntimeTimes':_0xfecd9b[_0x4f743a(0xbb)](_0x3ea4b8=>_0x3ea4b8['status']===_0x4f743a(0xb2))?CACHE_CLEAR_ATTEMPTS:0x0},'description':_0x4f743a(0xe4)+_0xfecd9b['length']+_0x4f743a(0xe6)};},async 'execute'(_0xde2e73){const _0x5da821=a37_0x9f4024,_0x7091ec=loadBffProjectConfig(_0xde2e73[_0x5da821(0xcf)]),_0x1d04a9=await readBffLockFile(_0x7091ec[_0x5da821(0xab)]),{lockData:_0x36ac50,appLock:_0x328e33}=ensureLockScope(_0x1d04a9??createEmptyBffLock(),_0xde2e73['appCode'],_0x7091ec[_0x5da821(0xdd)],_0x5da821(0xb7)),_0x41f39a=await getTargetFunctions(_0x7091ec,_0xde2e73);if(_0x41f39a[_0x5da821(0xa2)]===0x0)return{'ok':!![],'data':{'uploaded':[],'skipped':[],'failed':[]},'message':'No\x20local\x20BFF\x20functions\x20found.'};const _0x412c67=_0xde2e73[_0x5da821(0xe5)](_0x5da821(0xc6)),_0x239a00=JSON[_0x5da821(0xa0)](JSON[_0x5da821(0xdf)](_0x36ac50)),_0x11f15e=_0x239a00[_0x5da821(0xa6)][_0xde2e73['appCode']];if(!_0x11f15e)throw new Error('Lock\x20scope\x20for\x20app\x20\x22'+_0xde2e73[_0x5da821(0xcf)]+_0x5da821(0xc2));const _0x105518=await buildHookMaps(_0xde2e73[_0x5da821(0xcf)],_0xde2e73['apiDir'],_0x41f39a,_0x11f15e),_0x346b0c=[],_0x26de8f=[],_0x4d2628=[];for(const _0x552e8a of _0x41f39a){const _0x4cd627=await computeFileHash(_0x552e8a[_0x5da821(0xd1)]),_0x1a75db=_0x11f15e[_0x5da821(0xe8)][_0x552e8a[_0x5da821(0xda)]];if(!_0x412c67&&_0x1a75db&&_0x1a75db[_0x5da821(0xcb)]===_0x4cd627){_0x26de8f['push']({'lockKey':_0x552e8a[_0x5da821(0xda)],'reason':_0x5da821(0xd6)});continue;}try{await uploadSingleFunction(_0xde2e73[_0x5da821(0xcf)],_0x552e8a,_0x11f15e,_0x105518);const _0x39608a=_0x11f15e[_0x5da821(0xe8)][_0x552e8a[_0x5da821(0xda)]];_0x346b0c[_0x5da821(0xb7)]({'lockKey':_0x552e8a['lockKey'],'remoteId':_0x39608a?.['remoteId']??0x0});}catch(_0x27d8c8){_0x4d2628[_0x5da821(0xb7)]({'lockKey':_0x552e8a[_0x5da821(0xda)],'error':_0x27d8c8 instanceof Error?_0x27d8c8[_0x5da821(0xaa)]:String(_0x27d8c8)});}}_0x11f15e[_0x5da821(0xbe)]=new Date()[_0x5da821(0xe3)](),await writeBffLockFile(_0x7091ec[_0x5da821(0xab)],_0x239a00),await waitForUploadedLockEntries(_0x7091ec[_0x5da821(0xab)],_0xde2e73['appCode'],_0x346b0c[_0x5da821(0xc7)](_0x2f6b01=>_0x2f6b01['lockKey']));let _0x445b61={'attempted':![],'cleared':![]};if(_0x346b0c[_0x5da821(0xa2)]>0x0)try{let _0x205219='';for(let _0x591fea=0x0;_0x591fea<CACHE_CLEAR_ATTEMPTS;_0x591fea+=0x1){_0x205219=await clearBffScriptCache(),_0x591fea<CACHE_CLEAR_ATTEMPTS-0x1&&await sleep(CACHE_CLEAR_INTERVAL_MS);}_0x445b61={'attempted':!![],'cleared':!![],'message':_0x205219||_0x5da821(0xd3)};}catch(_0x1ad20f){_0x445b61={'attempted':!![],'cleared':![],'error':_0x1ad20f instanceof Error?_0x1ad20f[_0x5da821(0xaa)]:String(_0x1ad20f)};}const _0x235926=_0x4d2628[_0x5da821(0xa2)]===0x0&&(_0x445b61['attempted']?_0x445b61['cleared']:!![]),_0x1bb5c8=_0x445b61[_0x5da821(0xe7)]?_0x445b61[_0x5da821(0xc5)]?'runtime\x20cache\x20cleared':_0x5da821(0x9e):_0x5da821(0x9f);return{'ok':_0x235926,'data':{'uploaded':_0x346b0c,'skipped':_0x26de8f,'failed':_0x4d2628,'cacheClear':_0x445b61},'message':_0x5da821(0xc4)+_0x346b0c[_0x5da821(0xa2)]+'\x20uploaded,\x20'+_0x26de8f[_0x5da821(0xa2)]+_0x5da821(0xed)+_0x4d2628[_0x5da821(0xa2)]+'\x20failed,\x20'+_0x1bb5c8};}};async function getTargetFunctions(_0x132011,_0x183ac7){const _0x4dace1=a37_0x9f4024,_0xce966a=_0x183ac7[_0x4dace1(0xaf)]('type'),_0x245166=_0x183ac7[_0x4dace1(0xaf)]('name'),_0x5485f1=normalizeBffType(_0xce966a)??undefined;if(_0x245166&&!_0x5485f1)throw CliErrors[_0x4dace1(0xb8)](_0x4dace1(0xd2));const _0x5cb97c=await scanLocalBffFunctions(_0x132011,_0x5485f1);if(_0x245166){const _0x2c952d=_0x5cb97c[_0x4dace1(0xce)](_0x31face=>_0x31face['name']===_0x245166);if(_0x2c952d['length']===0x0)throw CliErrors['validation'](_0x4dace1(0xb5)+_0x5485f1+'/'+_0x245166);return _0x2c952d;}return _0x5cb97c;}async function buildHookMaps(_0x24c15c,_0x33cc9f,_0x54875e,_0x155b9b){const _0x19771e=a37_0x9f4024,_0x5d2e45=_0x54875e[_0x19771e(0xbb)](_0x5889e1=>_0x5889e1[_0x19771e(0xb6)]==='HOOK');if(!_0x5d2e45)return{'aliasToDatasetCode':new Map(),'datasetCodeToDataset':new Map()};const _0x2fc672=loadAliasMap(_0x33cc9f,undefined,resolveApiFilePath(_0x33cc9f,_0x24c15c)),_0x3c6cca=new Map(_0x2fc672[_0x19771e(0xc7)](_0x292acb=>[_0x292acb[_0x19771e(0xb3)],_0x292acb[_0x19771e(0xae)]]));for(const _0x35cfcd of Object[_0x19771e(0xe2)](_0x155b9b[_0x19771e(0xe8)])){_0x35cfcd[_0x19771e(0xb3)]&&_0x35cfcd[_0x19771e(0xae)]&&!_0x3c6cca['has'](_0x35cfcd['alias'])&&_0x3c6cca[_0x19771e(0xc8)](_0x35cfcd[_0x19771e(0xb3)],_0x35cfcd[_0x19771e(0xae)]);}const _0x5a1a6f=await listDatasets(_0x24c15c),_0x436b57=new Map(_0x5a1a6f[_0x19771e(0xc7)](_0x532571=>[_0x532571['code'],_0x532571]));return{'aliasToDatasetCode':_0x3c6cca,'datasetCodeToDataset':_0x436b57};}async function uploadSingleFunction(_0x2a7331,_0x5f8db,_0x1afd62,_0x1b6809){const _0x50d448=a37_0x9f4024,_0x10a458=await readFile(_0x5f8db[_0x50d448(0xd1)],'utf8'),_0x365f92=await computeFileHash(_0x5f8db[_0x50d448(0xd1)]),_0x5bdcb4=_0x1afd62['functions'][_0x5f8db[_0x50d448(0xda)]];if(_0x5bdcb4?.[_0x50d448(0xd8)]&&_0x5bdcb4[_0x50d448(0xba)]==null)throw CliErrors[_0x50d448(0xb8)](_0x5f8db[_0x50d448(0xda)]+_0x50d448(0xc3));let _0x3297d9=extractScriptDescription(_0x10a458);if(!_0x3297d9&&_0x5bdcb4?.['remoteId']){const _0x1520de=await getBffScriptInfo(_0x5bdcb4['remoteId']);_0x3297d9=_0x1520de[_0x50d448(0xe1)]||undefined;}const _0x661955={'appCode':_0x2a7331,'functionName':_0x5f8db[_0x50d448(0xa7)],'scriptType':_0x5f8db[_0x50d448(0xb6)],'scriptContent':_0x10a458};if(_0x5bdcb4?.[_0x50d448(0xd8)])_0x661955['id']=_0x5bdcb4['remoteId'];if(_0x5bdcb4?.[_0x50d448(0xba)]!=null)_0x661955['version']=_0x5bdcb4['version'];if(_0x3297d9)_0x661955[_0x50d448(0xe1)]=_0x3297d9;if(_0x5f8db[_0x50d448(0xb6)]===_0x50d448(0xb0)){const _0x38c214=_0x5f8db[_0x50d448(0xb3)];if(!_0x38c214||!_0x5f8db[_0x50d448(0xa5)]||!_0x5f8db[_0x50d448(0xb9)])throw CliErrors[_0x50d448(0xb8)]('Incomplete\x20HOOK\x20path:\x20'+_0x5f8db[_0x50d448(0xda)]);const _0x4cdc54=_0x1b6809[_0x50d448(0xcd)][_0x50d448(0xcc)](_0x38c214)??_0x5bdcb4?.[_0x50d448(0xae)]??_0x38c214,_0x593fd8=_0x1b6809[_0x50d448(0xb1)][_0x50d448(0xcc)](_0x4cdc54);if(!_0x593fd8)throw CliErrors[_0x50d448(0xb8)](_0x50d448(0xdc)+_0x38c214+'\x22.\x20'+('Run\x20`'+CLI_BIN_NAME+_0x50d448(0xc1)));_0x661955[_0x50d448(0xde)]=_0x593fd8['id'],_0x661955[_0x50d448(0xa5)]=_0x5f8db[_0x50d448(0xa5)],_0x661955[_0x50d448(0xb9)]=_0x5f8db[_0x50d448(0xb9)];}const _0x3970ee=await saveBffScript(_0x661955),_0x58e00a=_0x3970ee['id'],_0x1a11ed=_0x3970ee[_0x50d448(0xa8)]??await getBffScriptInfo(_0x58e00a),_0x5593db={'hash':_0x365f92,'remoteId':_0x58e00a,'version':_0x1a11ed[_0x50d448(0xba)]};if(_0x5f8db['type']===_0x50d448(0xb0)){const _0x34fc53=_0x5f8db['alias'],_0x3e076a=_0x1b6809[_0x50d448(0xcd)]['get'](_0x34fc53)??_0x5bdcb4?.['datasetCode']??_0x34fc53;_0x1b6809[_0x50d448(0xcd)][_0x50d448(0xee)](_0x34fc53)?_0x5593db['alias']=_0x34fc53:_0x5593db[_0x50d448(0xb3)]=_0x5bdcb4?.[_0x50d448(0xb3)],_0x5593db[_0x50d448(0xae)]=_0x3e076a,_0x5593db[_0x50d448(0xa5)]=_0x5f8db[_0x50d448(0xa5)],_0x5593db[_0x50d448(0xb9)]=_0x5f8db[_0x50d448(0xb9)];}_0x1afd62['functions'][_0x5f8db[_0x50d448(0xda)]]=_0x5593db;}function a37_0x3e26(_0x3b9b26,_0x4f4855){_0x3b9b26=_0x3b9b26-0x9d;const _0x4901e8=a37_0x4901();let _0x3e26b3=_0x4901e8[_0x3b9b26];return _0x3e26b3;}const LOCK_SETTLE_RETRY_COUNT=0x14,LOCK_SETTLE_DELAY_MS=0x64;async function waitForUploadedLockEntries(_0x3dcf3e,_0x7d36c3,_0x39beb6){const _0x101298=a37_0x9f4024;if(_0x39beb6[_0x101298(0xa2)]===0x0)return;for(let _0x448298=0x0;_0x448298<LOCK_SETTLE_RETRY_COUNT;_0x448298+=0x1){const _0x1f2ddf=await readBffLockFile(_0x3dcf3e),_0xce794c=_0x1f2ddf?.['apps']?.[_0x7d36c3]?.[_0x101298(0xe8)]??{},_0x6c8a6b=_0x39beb6[_0x101298(0xa3)](_0x57ca16=>!!_0xce794c[_0x57ca16]?.[_0x101298(0xd8)]);if(_0x6c8a6b)return;await sleep(LOCK_SETTLE_DELAY_MS);}throw new Error(_0x101298(0xbd)+_0x39beb6[_0x101298(0xca)](',\x20')+'.');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x324a33=a38_0x4303;(function(_0xabe151,_0x1a8f03){const _0x15a6fb=a38_0x4303,_0x601b66=_0xabe151();while(!![]){try{const _0x473d40=parseInt(_0x15a6fb(0xdf))/0x1+parseInt(_0x15a6fb(0xeb))/0x2+-parseInt(_0x15a6fb(0xf3))/0x3*(-parseInt(_0x15a6fb(0xee))/0x4)+parseInt(_0x15a6fb(0xe5))/0x5*(parseInt(_0x15a6fb(0xe6))/0x6)+parseInt(_0x15a6fb(0xef))/0x7*(-parseInt(_0x15a6fb(0xf1))/0x8)+-parseInt(_0x15a6fb(0xea))/0x9+-parseInt(_0x15a6fb(0xdc))/0xa*(parseInt(_0x15a6fb(0xe4))/0xb);if(_0x473d40===_0x1a8f03)break;else _0x601b66['push'](_0x601b66['shift']());}catch(_0x1473bf){_0x601b66['push'](_0x601b66['shift']());}}}(a38_0x708a,0x844bb));function a38_0x708a(){const _0x59bdd4=['bff','status','10hUxMFx','length','push','869514rrwSro','All\x20BFF\x20scripts\x20are\x20in\x20sync.','appCode','bool','lockFilePath','10734559tOHhwb','5WQZzil','6162702lkkdpC','functions','scriptsRoot','map','2818197DrlkNI','322390MWjjbo','Also\x20check\x20for\x20remote-only\x20scripts\x20not\x20present\x20locally','\x20remote-only','4jhMctI','7147eyJssE','all','7312gHKtHg','datasetCode','2118759NlmiEu','alias','apiDir','remote','has','\x20unchanged','\x20modified,\x20','lockKey'];a38_0x708a=function(){return _0x59bdd4;};return a38_0x708a();}import{listBffScripts,getBffScriptStatistics}from'../../core/api-client.js';import{loadAliasMap}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{loadBffProjectConfig}from'../../core/bff/config.js';import{createHookLocationMap,resolveRemoteScriptTarget,scanLocalBffFunctions}from'../../core/bff/file-system.js';function a38_0x4303(_0x2f1961,_0x4ca731){_0x2f1961=_0x2f1961-0xdb;const _0x708a37=a38_0x708a();let _0x43036d=_0x708a37[_0x2f1961];return _0x43036d;}import{computeFileHash}from'../../core/bff/hash.js';import{createEmptyBffLock,ensureLockScope,readBffLockFile}from'../../core/bff/lock.js';export const bffStatus={'service':a38_0x324a33(0xfb),'command':a38_0x324a33(0xdb),'description':'Check\x20local\x20BFF\x20sync\x20status\x20against\x20lock\x20file','risk':'read','flags':[{'name':a38_0x324a33(0xf6),'type':'boolean','description':a38_0x324a33(0xec)}],async 'execute'(_0x589739){const _0x36dbc0=a38_0x324a33,_0x254eb5=loadBffProjectConfig(_0x589739[_0x36dbc0(0xe1)]),_0x21cafc=await readBffLockFile(_0x254eb5[_0x36dbc0(0xe3)]),{appLock:_0x42554e}=ensureLockScope(_0x21cafc??createEmptyBffLock(),_0x589739[_0x36dbc0(0xe1)],_0x254eb5[_0x36dbc0(0xe8)],_0x36dbc0(0xdb)),_0x26e15b=await scanLocalBffFunctions(_0x254eb5),_0x20f33b=[],_0x2339a9=[],_0x3cce30=[];for(const _0x1cb7cc of _0x26e15b){const _0x5d83e8=await computeFileHash(_0x1cb7cc['filePath']),_0x57b722=_0x42554e[_0x36dbc0(0xe7)][_0x1cb7cc[_0x36dbc0(0xfa)]];if(!_0x57b722)_0x20f33b[_0x36dbc0(0xde)](_0x1cb7cc['lockKey']);else _0x57b722['hash']!==_0x5d83e8?_0x2339a9[_0x36dbc0(0xde)](_0x1cb7cc['lockKey']):_0x3cce30[_0x36dbc0(0xde)](_0x1cb7cc[_0x36dbc0(0xfa)]);}const _0x2f9140=[];if(_0x589739[_0x36dbc0(0xe2)]('remote')){const _0x42b95e=loadAliasMap(_0x589739[_0x36dbc0(0xf5)],undefined,resolveApiFilePath(_0x589739['apiDir'],_0x589739[_0x36dbc0(0xe1)])),_0x2d323a=new Map(_0x42b95e[_0x36dbc0(0xe9)](_0x2bab38=>[_0x2bab38[_0x36dbc0(0xf2)],_0x2bab38[_0x36dbc0(0xf4)]])),[_0xf76302,_0x178599]=await Promise[_0x36dbc0(0xf0)]([listBffScripts(_0x589739[_0x36dbc0(0xe1)]),getBffScriptStatistics(_0x589739[_0x36dbc0(0xe1)])]),_0x448f8a=createHookLocationMap(_0x178599),_0x579ee3=new Set(_0x26e15b[_0x36dbc0(0xe9)](_0x106fcc=>_0x106fcc[_0x36dbc0(0xfa)]));for(const _0x25a0b9 of _0xf76302){const _0x4365ba=resolveRemoteScriptTarget(_0x254eb5,_0x25a0b9,_0x448f8a,_0x42554e[_0x36dbc0(0xe7)],_0x2d323a);_0x4365ba&&!_0x579ee3[_0x36dbc0(0xf7)](_0x4365ba[_0x36dbc0(0xfa)])&&_0x2f9140[_0x36dbc0(0xde)](_0x4365ba[_0x36dbc0(0xfa)]);}}const _0x5148c4=_0x20f33b['length']===0x0&&_0x2339a9[_0x36dbc0(0xdd)]===0x0&&_0x2f9140[_0x36dbc0(0xdd)]===0x0;return{'ok':!![],'data':{'added':_0x20f33b,'modified':_0x2339a9,'unchanged':_0x3cce30,'remoteOnly':_0x2f9140},'message':_0x5148c4?_0x36dbc0(0xe0):_0x20f33b[_0x36dbc0(0xdd)]+'\x20added,\x20'+_0x2339a9[_0x36dbc0(0xdd)]+_0x36dbc0(0xf9)+_0x3cce30[_0x36dbc0(0xdd)]+_0x36dbc0(0xf8)+(_0x2f9140[_0x36dbc0(0xdd)]>0x0?',\x20'+_0x2f9140[_0x36dbc0(0xdd)]+_0x36dbc0(0xed):'')};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0x27d89a=a39_0x3bfa;function a39_0x3bfa(_0x172701,_0x22872d){_0x172701=_0x172701-0x8c;const _0x168d93=a39_0x168d();let _0x3bfa69=_0x168d93[_0x172701];return _0x3bfa69;}function a39_0x168d(){const _0x300097=['CLI\x20Built-in\x20Skill\x20installed','Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx.','cli-skill-install','write','log','24451760Kholcf','npx\x20skills\x20add\x20failed:\x20','7027132KLEvYW','error','../../skills/npx-skills-add.js','cli-skill','Check\x20network\x20connectivity\x20and\x20try\x20again,\x20or\x20run:\x20','1160295kZBFHp',')...','Skipped\x20npx\x20(RABETBASE_SKIP_NPX_SKILLS=1);\x20assuming\x20CLI\x20Built-in\x20Skill\x20is\x20already\x20present.','inherit','2569584DMulBP','unknown','Install\x20or\x20refresh\x20the\x20Rabetbase\x20CLI\x20Built-in\x20Skill','Installing\x20CLI\x20Built-in\x20Skill\x20via\x20npx\x20(','279FoFqyL','579gyDvVh','9668wAMOlc','197672hFKKVm','skipped','cwd','44EYkhLM','45758nIKKLA'];a39_0x168d=function(){return _0x300097;};return a39_0x168d();}(function(_0x1f13c9,_0x28b39f){const _0x3765cf=a39_0x3bfa,_0x5b854f=_0x1f13c9();while(!![]){try{const _0x412557=-parseInt(_0x3765cf(0x96))/0x1*(parseInt(_0x3765cf(0x97))/0x2)+-parseInt(_0x3765cf(0x91))/0x3*(-parseInt(_0x3765cf(0x92))/0x4)+parseInt(_0x3765cf(0xa4))/0x5+parseInt(_0x3765cf(0x8c))/0x6+-parseInt(_0x3765cf(0x9f))/0x7+parseInt(_0x3765cf(0x93))/0x8*(-parseInt(_0x3765cf(0x90))/0x9)+parseInt(_0x3765cf(0x9d))/0xa;if(_0x412557===_0x28b39f)break;else _0x5b854f['push'](_0x5b854f['shift']());}catch(_0x387e59){_0x5b854f['push'](_0x5b854f['shift']());}}}(a39_0x168d,0xc2339));import{CliErrors}from'../../errors.js';import{logger}from'../../utils/logger.js';export const cliSkillDefinitions=[{'service':a39_0x27d89a(0xa2),'command':'install','description':a39_0x27d89a(0x8e),'risk':a39_0x27d89a(0x9b),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':[],async 'execute'(_0x16d44c){const _0xe1280b=a39_0x27d89a;logger['setLogPath'](process[_0xe1280b(0x95)]()),logger['info'](_0xe1280b(0x9a),_0xe1280b(0x99));const {NPX_SKILLS_ADD_GLOBAL_COMMAND_LINE:_0x571bb8,RABETBASE_SKILL_SOURCE:_0x5cbc97,runNpxSkillsAddGlobal:_0x43f2f7}=await import(_0xe1280b(0xa1)),_0x54254a=_0x16d44c['nonInteractive']?'pipe':_0xe1280b(0xa7);console[_0xe1280b(0x9c)](_0xe1280b(0x8f)+_0x571bb8+_0xe1280b(0xa5));const _0x5bedb8=_0x43f2f7(process[_0xe1280b(0x95)](),_0x5cbc97,{'stdio':_0x54254a});if(_0x5bedb8[_0xe1280b(0x94)])console[_0xe1280b(0x9c)](_0xe1280b(0xa6));else{if(_0x5bedb8['ok'])console['log'](_0xe1280b(0x98));else throw CliErrors['apiError'](_0xe1280b(0x9e)+(_0x5bedb8[_0xe1280b(0xa0)]||_0xe1280b(0x8d)),_0xe1280b(0xa3)+_0x571bb8);}return{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a40_0xa9880=a40_0x3d28;(function(_0x3a7cf5,_0x185539){const _0x2a30b7=a40_0x3d28,_0x461396=_0x3a7cf5();while(!![]){try{const _0x597bfe=parseInt(_0x2a30b7(0x150))/0x1+parseInt(_0x2a30b7(0x143))/0x2+parseInt(_0x2a30b7(0x11e))/0x3+-parseInt(_0x2a30b7(0x12c))/0x4*(-parseInt(_0x2a30b7(0x145))/0x5)+-parseInt(_0x2a30b7(0x153))/0x6*(parseInt(_0x2a30b7(0x136))/0x7)+parseInt(_0x2a30b7(0x108))/0x8+parseInt(_0x2a30b7(0x133))/0x9*(-parseInt(_0x2a30b7(0x118))/0xa);if(_0x597bfe===_0x185539)break;else _0x461396['push'](_0x461396['shift']());}catch(_0x386ac4){_0x461396['push'](_0x461396['shift']());}}}(a40_0x6f92,0xe53f7));function a40_0x6f92(){const _0x3d8706=['skipped','green','version','Invalid\x20version:\x20','fail','988704rcxANI','nonInteractive','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','update','Checking\x20for\x20updates...','write','filter','start','no-skills','\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.','boolean','Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','info','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','/dist-tags','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','160XEqzfJ','@latest','install','source','error','Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','4072059GYEXqO','validation','\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20','\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.','length','pipe','https://registry.npmjs.org/-/package/','Updating\x20via\x20','\x20cli-skill\x20install','unknown','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','\x20\x20Run\x20manually:\x20','\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20','message','4GtIQsE','warn','gray','cwd','bool','skills','\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).','2165391HrrIEm','Already\x20on\x20requested\x20version\x20(v','fromEntries','259lPbxUS','red','npm','bun','succeed','Updated\x20to\x20v','yellow','run','Install\x20a\x20specific\x20CLI\x20version','Requested\x20version:\x20','\x20install\x20-g\x20','beta','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','3677098DJxYuW','trim','6595075wwXTbG','str','latest','Version\x20comparison\x20failed','\x20\x20Try\x20manually:\x20','Update\x20failed','\x20→\x20','Checking\x20CLI\x20Built-in\x20Skill...','slice','log','Current\x20version:\x20','1231884BmQMCU','string','toLowerCase','175428BJhZiU','valid'];a40_0x6f92=function(){return _0x3d8706;};return a40_0x6f92();}import a40_0x373fb8 from'chalk';import a40_0x22ca1e from'ora';import a40_0x29fa1c 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{RABETBASE_SKILL_SOURCE,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x33f374=a40_0x3d28;return GIT_COMMIT!==_0x33f374(0x127)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME[_0x33f374(0x14d)](0x0,0xa)+')':VERSION;}function detectPackageManager(){const _0x43625c=a40_0x3d28,_0x5de0fd=process['execPath'][_0x43625c(0x152)]();if(_0x5de0fd['includes']('bun'))return _0x43625c(0x139);return _0x43625c(0x138);}const updateFlags=[{'name':a40_0xa9880(0x141),'type':a40_0xa9880(0x112),'description':a40_0xa9880(0x142),'default':![]},{'name':a40_0xa9880(0x105),'type':'string','description':a40_0xa9880(0x13e)},{'name':a40_0xa9880(0x110),'type':a40_0xa9880(0x112),'description':a40_0xa9880(0x113),'default':![]},{'name':a40_0xa9880(0x131),'type':a40_0xa9880(0x112),'description':a40_0xa9880(0x11d),'default':!![],'hidden':!![]}];function getRequestedVersion(_0x50ecd6){const _0x4156be=a40_0xa9880;return _0x50ecd6[_0x4156be(0x146)](_0x4156be(0x105))[_0x4156be(0x144)]();}function shouldSkipCliSkill(_0x38d22e){const _0x3cc7ef=a40_0xa9880;return _0x38d22e[_0x3cc7ef(0x130)]('no-skills')||_0x38d22e['flag']('skills')===![];}async function validateUpdateFlags(_0x462e0d){const _0x4bfebb=a40_0xa9880,_0x1b60d1=_0x462e0d[_0x4bfebb(0x130)](_0x4bfebb(0x141)),_0x4a7668=getRequestedVersion(_0x462e0d);if(_0x1b60d1&&_0x4a7668)throw CliErrors['validation'](_0x4bfebb(0x128),'Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.');if(_0x4a7668&&!a40_0x29fa1c['valid'](_0x4a7668))throw CliErrors[_0x4bfebb(0x11f)](_0x4bfebb(0x106)+_0x4a7668,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}async function fetchNpmDistTags(){const _0x2bb079=a40_0xa9880;try{const _0x44ca39=await fetch(_0x2bb079(0x124)+encodeURIComponent(NPM_PACKAGE_NAME)+_0x2bb079(0x116),{'signal':AbortSignal['timeout'](0x2710)});if(!_0x44ca39['ok'])return null;const _0x32321e=await _0x44ca39['json']();if(!_0x32321e||typeof _0x32321e!=='object')return null;return Object[_0x2bb079(0x135)](Object['entries'](_0x32321e)[_0x2bb079(0x10e)](([,_0x134d1b])=>typeof _0x134d1b===_0x2bb079(0x151)&&_0x134d1b[_0x2bb079(0x144)]()[_0x2bb079(0x122)]>0x0)['map'](([_0x3c9596,_0x154ad1])=>[_0x3c9596,String(_0x154ad1)[_0x2bb079(0x144)]()]));}catch{return null;}}function a40_0x3d28(_0x383057,_0x10cd87){_0x383057=_0x383057-0x104;const _0x6f9277=a40_0x6f92();let _0x3d282b=_0x6f9277[_0x383057];return _0x3d282b;}async function fetchNpmDistTagVersion(_0x2a87c6){const _0x727136=await fetchNpmDistTags();return _0x727136?.[_0x2a87c6]??null;}async function fetchLatestVersion(){const _0x5899da=a40_0xa9880;return fetchNpmDistTagVersion(_0x5899da(0x147));}async function resolveTargetVersion(_0x57e877){const _0x39f386=a40_0xa9880,_0x3c1ca9=getRequestedVersion(_0x57e877);if(_0x3c1ca9)return{'version':_0x3c1ca9,'source':_0x39f386(0x105)};if(_0x57e877['bool']('beta')){const _0x3b2746=await fetchNpmDistTagVersion(_0x39f386(0x141));if(!_0x3b2746)return null;return{'version':_0x3b2746,'source':'beta'};}const _0x4e5b0f=await fetchLatestVersion();if(!_0x4e5b0f)return null;return{'version':_0x4e5b0f,'source':_0x39f386(0x147)};}function shouldInstallTarget(_0x38fa66,_0x4ac87e){const _0x342901=a40_0xa9880;if(_0x4ac87e[_0x342901(0x11b)]===_0x342901(0x105)||_0x4ac87e[_0x342901(0x11b)]===_0x342901(0x141))return!a40_0x29fa1c['eq'](_0x38fa66,_0x4ac87e[_0x342901(0x105)]);return a40_0x29fa1c['lt'](_0x38fa66,_0x4ac87e[_0x342901(0x105)]);}function getInstallPlanLabel(_0x140000,_0x2716e3){const _0x5f5c58=a40_0xa9880;switch(_0x2716e3['source']){case'beta':return'Beta\x20version:\x20'+a40_0x373fb8['yellow'](_0x140000)+_0x5f5c58(0x14b)+a40_0x373fb8['green'](_0x2716e3[_0x5f5c58(0x105)]);case _0x5f5c58(0x105):return _0x5f5c58(0x13f)+a40_0x373fb8[_0x5f5c58(0x13c)](_0x140000)+_0x5f5c58(0x14b)+a40_0x373fb8['green'](_0x2716e3[_0x5f5c58(0x105)]);case _0x5f5c58(0x147):default:return'Update\x20available:\x20'+a40_0x373fb8[_0x5f5c58(0x13c)](_0x140000)+_0x5f5c58(0x14b)+a40_0x373fb8[_0x5f5c58(0x104)](_0x2716e3[_0x5f5c58(0x105)]);}}async function installCliSkill(_0x3704bb){const _0x1920f4=a40_0xa9880;console[_0x1920f4(0x14e)](a40_0x373fb8[_0x1920f4(0x12e)](_0x1920f4(0x14c)));const _0x1f35b3=runNpxSkillsAddGlobal(process[_0x1920f4(0x12f)](),RABETBASE_SKILL_SOURCE,{'stdio':_0x3704bb?_0x1920f4(0x123):'inherit'});if(_0x1f35b3[_0x1920f4(0x155)]){console[_0x1920f4(0x14e)](a40_0x373fb8[_0x1920f4(0x12e)](_0x1920f4(0x132)));return;}if(_0x1f35b3['ok']){console[_0x1920f4(0x14e)](a40_0x373fb8[_0x1920f4(0x12e)](_0x1920f4(0x111)));return;}console[_0x1920f4(0x12d)](a40_0x373fb8[_0x1920f4(0x13c)](_0x1920f4(0x12a)+(_0x1f35b3[_0x1920f4(0x11c)]||'unknown'))),console[_0x1920f4(0x14e)](a40_0x373fb8[_0x1920f4(0x12e)](_0x1920f4(0x129)+CLI_BIN_NAME+_0x1920f4(0x126)));}async function execute(_0x55ca74){const _0x2b3e44=a40_0xa9880;await validateUpdateFlags(_0x55ca74);const _0x55402b=getCurrentVersion();console[_0x2b3e44(0x14e)](_0x2b3e44(0x14f)+_0x55402b);const _0x20dc77=a40_0x22ca1e(_0x2b3e44(0x10c))[_0x2b3e44(0x10f)](),_0x257348=await resolveTargetVersion(_0x55ca74);if(!_0x257348){const _0x470f18=_0x55ca74['bool'](_0x2b3e44(0x141))?'Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm':_0x2b3e44(0x10a);return _0x20dc77[_0x2b3e44(0x107)](_0x470f18),console[_0x2b3e44(0x14e)](a40_0x373fb8['gray'](_0x2b3e44(0x120)+NPM_PACKAGE_NAME+_0x2b3e44(0x119))),{'ok':![],'message':_0x470f18};}const _0xabc6f2=a40_0x29fa1c[_0x2b3e44(0x154)](VERSION),_0xb988d4=a40_0x29fa1c[_0x2b3e44(0x154)](_0x257348[_0x2b3e44(0x105)]);if(!_0xabc6f2||!_0xb988d4)return _0x20dc77[_0x2b3e44(0x107)](_0x2b3e44(0x148)),{'ok':![],'message':_0x2b3e44(0x148)};if(!shouldInstallTarget(_0xabc6f2,_0x257348)){const _0x2da88a=_0x257348[_0x2b3e44(0x11b)]===_0x2b3e44(0x105)?_0x2b3e44(0x134)+_0x257348['version']+')':'Already\x20up\x20to\x20date\x20(v'+_0x257348[_0x2b3e44(0x105)]+')';return _0x20dc77[_0x2b3e44(0x13a)](_0x2da88a),shouldSkipCliSkill(_0x55ca74)?console[_0x2b3e44(0x14e)](a40_0x373fb8[_0x2b3e44(0x12e)](_0x2b3e44(0x117))):await installCliSkill(_0x55ca74[_0x2b3e44(0x109)]),{'ok':!![]};}_0x20dc77[_0x2b3e44(0x114)](getInstallPlanLabel(_0x55402b,_0x257348));const _0x25ce1b=detectPackageManager(),_0x59b77b=_0x25ce1b===_0x2b3e44(0x138)?resolveNpmBin('npm'):_0x25ce1b,_0x40cfb1=a40_0x22ca1e(_0x2b3e44(0x125)+_0x25ce1b+'...')['start']();try{return await execa(_0x59b77b,[_0x2b3e44(0x11a),'-g',NPM_PACKAGE_NAME+'@'+_0x257348[_0x2b3e44(0x105)]],{'stdio':_0x2b3e44(0x123)}),_0x40cfb1['succeed'](_0x2b3e44(0x13b)+_0x257348[_0x2b3e44(0x105)]),console[_0x2b3e44(0x14e)](a40_0x373fb8[_0x2b3e44(0x12e)](_0x2b3e44(0x121))),shouldSkipCliSkill(_0x55ca74)?console[_0x2b3e44(0x14e)](a40_0x373fb8[_0x2b3e44(0x12e)](_0x2b3e44(0x117))):await installCliSkill(_0x55ca74[_0x2b3e44(0x109)]),{'ok':!![]};}catch(_0x2b2633){return _0x40cfb1[_0x2b3e44(0x107)](_0x2b3e44(0x14a)),console[_0x2b3e44(0x11c)](a40_0x373fb8[_0x2b3e44(0x137)]('\x20\x20'+_0x2b2633['message'])),console[_0x2b3e44(0x14e)](a40_0x373fb8['gray'](_0x2b3e44(0x149)+_0x25ce1b+_0x2b3e44(0x140)+NPM_PACKAGE_NAME+'@'+_0x257348[_0x2b3e44(0x105)])),{'ok':![],'message':_0x2b2633[_0x2b3e44(0x12b)]};}}export const updateDefinition={'service':a40_0xa9880(0x10b),'command':a40_0xa9880(0x13d),'description':a40_0xa9880(0x115),'risk':a40_0xa9880(0x10d),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
1
|
+
const a40_0x52cc40=a40_0x4e58;(function(_0x22b824,_0x1fa9db){const _0x3d746f=a40_0x4e58,_0x470703=_0x22b824();while(!![]){try{const _0xcf6806=parseInt(_0x3d746f(0x1b8))/0x1+-parseInt(_0x3d746f(0x1ca))/0x2+parseInt(_0x3d746f(0x1bd))/0x3*(parseInt(_0x3d746f(0x1c5))/0x4)+-parseInt(_0x3d746f(0x1e8))/0x5+-parseInt(_0x3d746f(0x1c4))/0x6*(parseInt(_0x3d746f(0x1d0))/0x7)+-parseInt(_0x3d746f(0x1dd))/0x8+parseInt(_0x3d746f(0x1bb))/0x9;if(_0xcf6806===_0x1fa9db)break;else _0x470703['push'](_0x470703['shift']());}catch(_0x4c6b38){_0x470703['push'](_0x470703['shift']());}}}(a40_0x49e0,0x3bc69));import a40_0x391a2c from'chalk';import a40_0x4f9e35 from'ora';import a40_0xfa7069 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{RABETBASE_SKILL_SOURCE,runNpxSkillsAddGlobal}from'../skills/npx-skills-add.js';import{resolveNpmBin}from'../utils/platform.js';function getCurrentVersion(){const _0x24f7ad=a40_0x4e58;return GIT_COMMIT!==_0x24f7ad(0x1f5)?VERSION+'\x20('+GIT_COMMIT+',\x20'+BUILD_TIME['slice'](0x0,0xa)+')':VERSION;}function a40_0x4e58(_0x6c96ba,_0x4665d7){_0x6c96ba=_0x6c96ba-0x1b5;const _0x49e03f=a40_0x49e0();let _0x4e5860=_0x49e03f[_0x6c96ba];return _0x4e5860;}function detectPackageManager(){const _0x1358b7=a40_0x4e58,_0x205320=process[_0x1358b7(0x1f9)][_0x1358b7(0x1f6)]();if(_0x205320[_0x1358b7(0x1cc)](_0x1358b7(0x1d5)))return'bun';return _0x1358b7(0x1ef);}const updateFlags=[{'name':a40_0x52cc40(0x1c8),'type':a40_0x52cc40(0x1b7),'description':a40_0x52cc40(0x1e4),'default':![]},{'name':'version','type':a40_0x52cc40(0x1ba),'description':'Install\x20a\x20specific\x20CLI\x20version'},{'name':a40_0x52cc40(0x1bf),'type':a40_0x52cc40(0x1b7),'description':'Skip\x20CLI\x20Built-in\x20Skill\x20refresh\x20after\x20updating','default':![]},{'name':a40_0x52cc40(0x1d9),'type':a40_0x52cc40(0x1b7),'description':a40_0x52cc40(0x1d4),'default':!![],'hidden':!![]}];function getRequestedVersion(_0x1d498c){const _0x3e7e5e=a40_0x52cc40;return _0x1d498c['str']('version')[_0x3e7e5e(0x1ea)]();}function shouldSkipCliSkill(_0x5da0ce){const _0x4847b1=a40_0x52cc40;return _0x5da0ce[_0x4847b1(0x1c9)](_0x4847b1(0x1bf))||_0x5da0ce['flag'](_0x4847b1(0x1d9))===![];}async function validateUpdateFlags(_0x373d31){const _0x51d334=a40_0x52cc40,_0x13b5ed=_0x373d31[_0x51d334(0x1c9)](_0x51d334(0x1c8)),_0x268e5c=getRequestedVersion(_0x373d31);if(_0x13b5ed&&_0x268e5c)throw CliErrors['validation'](_0x51d334(0x1d6),_0x51d334(0x1f1));if(_0x268e5c&&!a40_0xfa7069[_0x51d334(0x1d7)](_0x268e5c))throw CliErrors[_0x51d334(0x1e6)](_0x51d334(0x1c6)+_0x268e5c,'Use\x20a\x20full\x20semver\x20such\x20as\x202.1.6\x20or\x202.1.6-beta.1.');}async function fetchNpmDistTags(){const _0x21dea0=a40_0x52cc40;try{const _0x29de27=await fetch('https://registry.npmjs.org/-/package/'+encodeURIComponent(NPM_PACKAGE_NAME)+_0x21dea0(0x1da),{'signal':AbortSignal[_0x21dea0(0x1f2)](0x2710)});if(!_0x29de27['ok'])return null;const _0x2496dc=await _0x29de27[_0x21dea0(0x1e9)]();if(!_0x2496dc||typeof _0x2496dc!=='object')return null;return Object[_0x21dea0(0x1cf)](Object[_0x21dea0(0x1de)](_0x2496dc)[_0x21dea0(0x1b9)](([,_0x3d61df])=>typeof _0x3d61df==='string'&&_0x3d61df[_0x21dea0(0x1ea)]()[_0x21dea0(0x1eb)]>0x0)[_0x21dea0(0x1cb)](([_0x2013c8,_0x17a49d])=>[_0x2013c8,String(_0x17a49d)[_0x21dea0(0x1ea)]()]));}catch{return null;}}async function fetchNpmDistTagVersion(_0x101895){const _0x3adae4=await fetchNpmDistTags();return _0x3adae4?.[_0x101895]??null;}async function fetchLatestVersion(){const _0x1879dc=a40_0x52cc40;return fetchNpmDistTagVersion(_0x1879dc(0x1c2));}async function resolveTargetVersion(_0x2c35ac){const _0x4c6465=a40_0x52cc40,_0x4c9e26=getRequestedVersion(_0x2c35ac);if(_0x4c9e26)return{'version':_0x4c9e26,'source':_0x4c6465(0x1e3)};if(_0x2c35ac['bool'](_0x4c6465(0x1c8))){const _0xda27ce=await fetchNpmDistTagVersion(_0x4c6465(0x1c8));if(!_0xda27ce)return null;return{'version':_0xda27ce,'source':_0x4c6465(0x1c8)};}const _0x4fdd37=await fetchLatestVersion();if(!_0x4fdd37)return null;return{'version':_0x4fdd37,'source':'latest'};}function shouldInstallTarget(_0x1d1fc5,_0x1c3df0){const _0x2d8ff3=a40_0x52cc40;if(_0x1c3df0[_0x2d8ff3(0x1bc)]===_0x2d8ff3(0x1e3)||_0x1c3df0[_0x2d8ff3(0x1bc)]===_0x2d8ff3(0x1c8))return!a40_0xfa7069['eq'](_0x1d1fc5,_0x1c3df0[_0x2d8ff3(0x1e3)]);return a40_0xfa7069['lt'](_0x1d1fc5,_0x1c3df0['version']);}function getInstallPlanLabel(_0x361a81,_0x22d2d9){const _0x3939a9=a40_0x52cc40;switch(_0x22d2d9[_0x3939a9(0x1bc)]){case _0x3939a9(0x1c8):return _0x3939a9(0x1ff)+a40_0x391a2c[_0x3939a9(0x1c1)](_0x361a81)+_0x3939a9(0x1dc)+a40_0x391a2c['green'](_0x22d2d9[_0x3939a9(0x1e3)]);case _0x3939a9(0x1e3):return _0x3939a9(0x1c7)+a40_0x391a2c[_0x3939a9(0x1c1)](_0x361a81)+'\x20→\x20'+a40_0x391a2c[_0x3939a9(0x1fc)](_0x22d2d9[_0x3939a9(0x1e3)]);case _0x3939a9(0x1c2):default:return _0x3939a9(0x1f0)+a40_0x391a2c[_0x3939a9(0x1c1)](_0x361a81)+'\x20→\x20'+a40_0x391a2c[_0x3939a9(0x1fc)](_0x22d2d9[_0x3939a9(0x1e3)]);}}async function installCliSkill(_0x2e7da6){const _0x3c89f6=a40_0x52cc40;console['log'](a40_0x391a2c[_0x3c89f6(0x1d3)](_0x3c89f6(0x1fd)));const _0x45d123=runNpxSkillsAddGlobal(process[_0x3c89f6(0x1d1)](),RABETBASE_SKILL_SOURCE,{'stdio':_0x2e7da6?_0x3c89f6(0x1f4):'inherit'});if(_0x45d123['skipped']){console[_0x3c89f6(0x1e1)](a40_0x391a2c[_0x3c89f6(0x1d3)]('\x20\x20Skipped\x20CLI\x20Built-in\x20Skill\x20install\x20(RABETBASE_SKIP_NPX_SKILLS=1).'));return;}if(_0x45d123['ok']){console[_0x3c89f6(0x1e1)](a40_0x391a2c[_0x3c89f6(0x1d3)]('\x20\x20CLI\x20Built-in\x20Skill\x20is\x20up\x20to\x20date.'));return;}console[_0x3c89f6(0x1c0)](a40_0x391a2c[_0x3c89f6(0x1c1)](_0x3c89f6(0x1f8)+(_0x45d123['error']||_0x3c89f6(0x1f5)))),console[_0x3c89f6(0x1e1)](a40_0x391a2c[_0x3c89f6(0x1d3)](_0x3c89f6(0x1f7)+CLI_BIN_NAME+_0x3c89f6(0x1f3)));}async function execute(_0x568a17){const _0x17d392=a40_0x52cc40;await validateUpdateFlags(_0x568a17);const _0x410aa9=getCurrentVersion();console[_0x17d392(0x1e1)]('Current\x20version:\x20'+_0x410aa9);const _0x2ae482=a40_0x4f9e35(_0x17d392(0x1d8))[_0x17d392(0x1cd)](),_0x1b55fc=await resolveTargetVersion(_0x568a17);if(!_0x1b55fc){const _0x3dc0ee=_0x568a17[_0x17d392(0x1c9)](_0x17d392(0x1c8))?_0x17d392(0x202):_0x17d392(0x1ec);return _0x2ae482[_0x17d392(0x1fe)](_0x3dc0ee),console[_0x17d392(0x1e1)](a40_0x391a2c[_0x17d392(0x1d3)]('\x20\x20Run\x20manually:\x20npm\x20install\x20-g\x20'+NPM_PACKAGE_NAME+_0x17d392(0x1d2))),{'ok':![],'message':_0x3dc0ee};}const _0x5af793=a40_0xfa7069['valid'](VERSION),_0x450d01=a40_0xfa7069[_0x17d392(0x1d7)](_0x1b55fc[_0x17d392(0x1e3)]);if(!_0x5af793||!_0x450d01)return _0x2ae482['fail'](_0x17d392(0x1b5)),{'ok':![],'message':'Version\x20comparison\x20failed'};if(!shouldInstallTarget(_0x5af793,_0x1b55fc)){const _0x19ae43=_0x1b55fc[_0x17d392(0x1bc)]==='version'?_0x17d392(0x1b6)+_0x1b55fc[_0x17d392(0x1e3)]+')':_0x17d392(0x1ed)+_0x1b55fc[_0x17d392(0x1e3)]+')';return _0x2ae482[_0x17d392(0x1df)](_0x19ae43),shouldSkipCliSkill(_0x568a17)?console['log'](a40_0x391a2c[_0x17d392(0x1d3)](_0x17d392(0x1e0))):await installCliSkill(_0x568a17[_0x17d392(0x1ce)]),{'ok':!![]};}_0x2ae482[_0x17d392(0x1fb)](getInstallPlanLabel(_0x410aa9,_0x1b55fc));const _0x1a4187=detectPackageManager(),_0x54437e=_0x1a4187===_0x17d392(0x1ef)?resolveNpmBin(_0x17d392(0x1ef)):_0x1a4187,_0x274a24=a40_0x4f9e35(_0x17d392(0x200)+_0x1a4187+_0x17d392(0x1be))[_0x17d392(0x1cd)]();try{return await execa(_0x54437e,['install','-g',NPM_PACKAGE_NAME+'@'+_0x1b55fc[_0x17d392(0x1e3)]],{'stdio':_0x17d392(0x1f4)}),_0x274a24[_0x17d392(0x1df)](_0x17d392(0x1db)+_0x1b55fc[_0x17d392(0x1e3)]),console[_0x17d392(0x1e1)](a40_0x391a2c['gray']('\x20\x20Restart\x20your\x20terminal\x20to\x20use\x20the\x20new\x20version.')),shouldSkipCliSkill(_0x568a17)?console[_0x17d392(0x1e1)](a40_0x391a2c[_0x17d392(0x1d3)](_0x17d392(0x1e0))):await installCliSkill(_0x568a17[_0x17d392(0x1ce)]),{'ok':!![]};}catch(_0x488f41){return _0x274a24[_0x17d392(0x1fe)]('Update\x20failed'),console[_0x17d392(0x1c3)](a40_0x391a2c[_0x17d392(0x1ee)]('\x20\x20'+_0x488f41['message'])),console['log'](a40_0x391a2c[_0x17d392(0x1d3)]('\x20\x20Try\x20manually:\x20'+_0x1a4187+_0x17d392(0x201)+NPM_PACKAGE_NAME+'@'+_0x1b55fc[_0x17d392(0x1e3)])),{'ok':![],'message':_0x488f41[_0x17d392(0x1e7)]};}}function a40_0x49e0(){const _0x518520=['beta','bool','854324MytNqM','map','includes','start','nonInteractive','fromEntries','5782SKCZLK','cwd','@latest','gray','Refresh\x20CLI\x20Built-in\x20Skill\x20after\x20updating','bun','--beta\x20and\x20--version\x20cannot\x20be\x20used\x20together.','valid','Checking\x20for\x20updates...','skills','/dist-tags','Updated\x20to\x20v','\x20→\x20','1266712ufmgbI','entries','succeed','Skipping\x20CLI\x20Built-in\x20Skill\x20refresh\x20(--no-skills).','log','write','version','Install\x20the\x20version\x20from\x20npm\x20beta\x20dist-tag','run','validation','message','30250CuxaPz','json','trim','length','Unable\x20to\x20check\x20for\x20updates\x20(network\x20error)','Already\x20up\x20to\x20date\x20(v','red','npm','Update\x20available:\x20','Choose\x20either\x20npm\x20beta\x20dist-tag\x20or\x20an\x20exact\x20version.','timeout','\x20cli-skill\x20install','pipe','unknown','toLowerCase','\x20\x20Run\x20manually:\x20','\x20\x20CLI\x20Built-in\x20Skill\x20update\x20failed:\x20','execPath','Update\x20rabetbase\x20CLI\x20to\x20the\x20latest\x20version','info','green','Checking\x20CLI\x20Built-in\x20Skill...','fail','Beta\x20version:\x20','Updating\x20via\x20','\x20install\x20-g\x20','Unable\x20to\x20resolve\x20beta\x20version\x20from\x20npm','Version\x20comparison\x20failed','Already\x20on\x20requested\x20version\x20(v','boolean','379307WQaWXG','filter','string','2951451BCIqJF','source','717uBhMIq','...','no-skills','warn','yellow','latest','error','732iTdZGT','3848hKaVfo','Invalid\x20version:\x20','Requested\x20version:\x20'];a40_0x49e0=function(){return _0x518520;};return a40_0x49e0();}export const updateDefinition={'service':'update','command':a40_0x52cc40(0x1e5),'description':a40_0x52cc40(0x1fa),'risk':a40_0x52cc40(0x1e2),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':updateFlags,'validate':validateUpdateFlags,'execute':execute};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a41_0x5321(){const _0x290885=['808088JtDFtj','4581600pQnNqv','24pTQczY','1AOZUpK','24YbXEQu','358535FmKHjF','1711052SavOLE','3OXiDuK','684945JYdacR','3834810qikMGO','2851740ndKMAc','66UIQWPo'];a41_0x5321=function(){return _0x290885;};return a41_0x5321();}(function(_0x3c0c75,_0x5095eb){const _0x35fea9=a41_0x5e15,_0x1c771a=_0x3c0c75();while(!![]){try{const _0x4d2c29=parseInt(_0x35fea9(0x69))/0x1*(parseInt(_0x35fea9(0x72))/0x2)+-parseInt(_0x35fea9(0x6d))/0x3*(-parseInt(_0x35fea9(0x6c))/0x4)+parseInt(_0x35fea9(0x6b))/0x5*(parseInt(_0x35fea9(0x6a))/0x6)+parseInt(_0x35fea9(0x6f))/0x7+parseInt(_0x35fea9(0x68))/0x8*(-parseInt(_0x35fea9(0x6e))/0x9)+parseInt(_0x35fea9(0x67))/0xa+-parseInt(_0x35fea9(0x71))/0xb*(parseInt(_0x35fea9(0x70))/0xc);if(_0x4d2c29===_0x5095eb)break;else _0x1c771a['push'](_0x1c771a['shift']());}catch(_0x5d8a36){_0x1c771a['push'](_0x1c771a['shift']());}}}(a41_0x5321,0x72da8));import{codegenSdk}from'../../commands/codegen/sdk.js';import{codegenSql}from'../../commands/codegen/sql.js';function a41_0x5e15(_0x355c48,_0x48e2bf){_0x355c48=_0x355c48-0x67;const _0x532175=a41_0x5321();let _0x5e15ef=_0x532175[_0x355c48];return _0x5e15ef;}export const codegenDefinitions=[codegenSdk,codegenSql];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a42_0x5acaf4=a42_0xa9ad;(function(_0x486481,_0x454733){const _0x2fd050=a42_0xa9ad,_0x342e16=_0x486481();while(!![]){try{const _0x250ba7=parseInt(_0x2fd050(0x114))/0x1*(parseInt(_0x2fd050(0x113))/0x2)+parseInt(_0x2fd050(0x124))/0x3*(parseInt(_0x2fd050(0x126))/0x4)+parseInt(_0x2fd050(0x10f))/0x5+parseInt(_0x2fd050(0x120))/0x6*(-parseInt(_0x2fd050(0x118))/0x7)+-parseInt(_0x2fd050(0x11a))/0x8*(parseInt(_0x2fd050(0x110))/0x9)+-parseInt(_0x2fd050(0x125))/0xa*(parseInt(_0x2fd050(0x122))/0xb)+-parseInt(_0x2fd050(0x11f))/0xc*(-parseInt(_0x2fd050(0x116))/0xd);if(_0x250ba7===_0x454733)break;else _0x342e16['push'](_0x342e16['shift']());}catch(_0x5f148d){_0x342e16['push'](_0x342e16['shift']());}}}(a42_0xe10a,0xd0f2d));function a42_0xe10a(){const _0x5a5765=['codegen','4092BPYtMX','code','21wkyIle','22040RxbFOm','126868ppTamr','str','453020EXjGTX','520857llslLi','read','skip-imports','2271616odbjPP','1MulbBQ','operation','13YeyeNa','sdk','49CtTqJg','Generate\x20TypeScript\x20SDK\x20code\x20for\x20a\x20dataset\x20operation','232IcwMgY','tableName','string','Omit\x20import\x20statements\x20from\x20generated\x20code','bool','39098172yNCRNz','1159332PRBXhn'];a42_0xe10a=function(){return _0x5a5765;};return a42_0xe10a();}import{getOperationDetail,generateSdkCode}from'../../core/api-client.js';import{CODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a42_0xa9ad(_0xc0f7e3,_0x2948d1){_0xc0f7e3=_0xc0f7e3-0x10f;const _0xe10af1=a42_0xe10a();let _0xa9ad17=_0xe10af1[_0xc0f7e3];return _0xa9ad17;}export const codegenSdk={'service':a42_0x5acaf4(0x121),'command':a42_0x5acaf4(0x117),'description':a42_0x5acaf4(0x119),'risk':a42_0x5acaf4(0x111),'flags':[CODE_FLAG_OPTIONAL,{'name':'alias','type':'string','description':'Dataset\x20alias\x20defined\x20in\x20api.ts\x20(e.g.\x20order,\x20coupon)'},{'name':a42_0x5acaf4(0x115),'type':a42_0x5acaf4(0x11c),'required':!![],'description':'Operation\x20name\x20(e.g.\x20filter,\x20getOne,\x20create,\x20update)'},{'name':a42_0x5acaf4(0x112),'type':'boolean','description':a42_0x5acaf4(0x11d)}],async 'execute'(_0x5e993d){const _0x52bd6e=a42_0x5acaf4,{dataset:_0x292d2e,operation:_0x3370cd}=await getOperationDetail(_0x5e993d['appCode'],_0x5e993d[_0x52bd6e(0x127)](_0x52bd6e(0x123)),_0x5e993d[_0x52bd6e(0x127)](_0x52bd6e(0x115))),_0x9874cd=generateSdkCode(_0x292d2e,_0x3370cd,{'includeImports':!_0x5e993d[_0x52bd6e(0x11e)]('skip-imports')});return{'ok':!![],'data':{'dataset':{'name':_0x292d2e['name'],'code':_0x292d2e['code'],'tableName':_0x292d2e[_0x52bd6e(0x11b)]},'operation':_0x5e993d[_0x52bd6e(0x127)](_0x52bd6e(0x115)),'code':_0x9874cd}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x1f094c=a43_0x5630;function a43_0x3304(){const _0x947595=['str','no-imports','116nMDAEa','1611KcYyjw','10469720MZgHKm','bool','2078982ERMCta','sqlcode','appCode','sql','20686sXjwIU','Omit\x20import\x20statements\x20from\x20generated\x20code','sqlCode','149830VTsxQs','boolean','Generate\x20TypeScript\x20code\x20for\x20a\x20custom\x20SQL\x20query','680250FToJgg','134825JyZWMn','bff','codegen','string','7055699VLhQkP','sdk','85nKUtNI','target'];a43_0x3304=function(){return _0x947595;};return a43_0x3304();}(function(_0x29c8aa,_0x25144f){const _0x31cd3d=a43_0x5630,_0x592a26=_0x29c8aa();while(!![]){try{const _0xfcf04=parseInt(_0x31cd3d(0xf5))/0x1*(-parseInt(_0x31cd3d(0x101))/0x2)+-parseInt(_0x31cd3d(0xfd))/0x3+parseInt(_0x31cd3d(0xf9))/0x4*(-parseInt(_0x31cd3d(0xef))/0x5)+parseInt(_0x31cd3d(0xee))/0x6+-parseInt(_0x31cd3d(0xf3))/0x7+parseInt(_0x31cd3d(0xfb))/0x8+parseInt(_0x31cd3d(0xfa))/0x9*(parseInt(_0x31cd3d(0xeb))/0xa);if(_0xfcf04===_0x25144f)break;else _0x592a26['push'](_0x592a26['shift']());}catch(_0x577a64){_0x592a26['push'](_0x592a26['shift']());}}}(a43_0x3304,0xb5244));import{getSqlQueryInfo,generateSqlCodeTemplate}from'../../core/api-client.js';function a43_0x5630(_0x4ce4b0,_0x5bff4b){_0x4ce4b0=_0x4ce4b0-0xe9;const _0x330478=a43_0x3304();let _0x563093=_0x330478[_0x4ce4b0];return _0x563093;}import{SQLCODE_FLAG}from'../../commands/common/flags.js';export const codegenSql={'service':a43_0x1f094c(0xf1),'command':a43_0x1f094c(0x100),'description':a43_0x1f094c(0xed),'risk':'read','flags':[SQLCODE_FLAG,{'name':a43_0x1f094c(0xf6),'type':a43_0x1f094c(0xf2),'description':'Code\x20target:\x20sdk\x20(default)\x20or\x20bff','default':a43_0x1f094c(0xf4),'enum':['sdk',a43_0x1f094c(0xf0)]},{'name':a43_0x1f094c(0xf8),'type':a43_0x1f094c(0xec),'description':a43_0x1f094c(0xe9)}],async 'execute'(_0x336f0d){const _0x4f0a14=a43_0x1f094c,_0x4e64a7=await getSqlQueryInfo(_0x336f0d[_0x4f0a14(0xff)],_0x336f0d['str'](_0x4f0a14(0xfe))),_0xa63db2=_0x336f0d[_0x4f0a14(0xf7)](_0x4f0a14(0xf6))||_0x4f0a14(0xf4),_0x5ac526=generateSqlCodeTemplate(_0x4e64a7,{'target':_0xa63db2,'includeImports':!_0x336f0d[_0x4f0a14(0xfc)]('no-imports')});return{'ok':!![],'data':{'sqlCode':_0x4e64a7[_0x4f0a14(0xea)],'sqlName':_0x4e64a7['sqlName'],'target':_0xa63db2,'code':_0x5ac526}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1cb941,_0x435252){const _0x1f0243=a44_0x4811,_0x4b0a67=_0x1cb941();while(!![]){try{const _0x2e15ce=-parseInt(_0x1f0243(0x187))/0x1*(-parseInt(_0x1f0243(0x188))/0x2)+-parseInt(_0x1f0243(0x1a7))/0x3*(-parseInt(_0x1f0243(0x19c))/0x4)+-parseInt(_0x1f0243(0x186))/0x5*(parseInt(_0x1f0243(0x19a))/0x6)+-parseInt(_0x1f0243(0x19d))/0x7*(parseInt(_0x1f0243(0x1ab))/0x8)+-parseInt(_0x1f0243(0x1ac))/0x9+parseInt(_0x1f0243(0x1b0))/0xa*(parseInt(_0x1f0243(0x18a))/0xb)+parseInt(_0x1f0243(0x18e))/0xc;if(_0x2e15ce===_0x435252)break;else _0x4b0a67['push'](_0x4b0a67['shift']());}catch(_0x1e362e){_0x4b0a67['push'](_0x4b0a67['shift']());}}}(a44_0x3412,0x4b6dc));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{collectAppProfileOverrides,getAppProfileFlagDefs}from'../../config/schema.js';function a44_0x3412(){const _0x4cdda5=['bool','apps','keys','70zaoMhT','\x22\x20still\x20defined\x20in\x20','\x22\x20not\x20found.','\x20Set\x20as\x20default\x20app.','\x20Default\x20app\x20changed\x20to\x20\x22','\x20config.','length','\x20app\x20\x22','147635mMUfxN','1dwGyqZ','988614tPAjcc','Removed\x20app\x20\x22','74151hIkwfi','project','\x20Note:\x20app\x20\x22','appcode','709800XSxEUu','boolean','inherit','string','args','flagMissing','Updated','str','object','App\x20\x22','\x20<name>\x20[--global]','Missing\x20app\x20name.','24OxENOD','projectConfig','126044wSilOK','99106lJLajR','both','Added','globalConfig','defaultApp','global','\x20<name>\x20--appcode\x20<code>','Use\x20global\x20config\x20scope','\x20<name>','\x22\x20(appcode:\x20','57ZJRGBY','validation','trim','Usage:\x20','184EqvGnb','4019895huzFCC'];a44_0x3412=function(){return _0x4cdda5;};return a44_0x3412();}import{readRawConfigWithLayers}from'../../context.js';import{readConfig,writeConfig,scopeLabel,resolveAppScopeForWrite,appDefinedIn}from'../../commands/app/shared.js';export function buildAppAddFlags(){const _0x18fba9=a44_0x4811;return[{'name':_0x18fba9(0x18d),'type':_0x18fba9(0x191),'description':'App\x20code','required':!![]},{'name':_0x18fba9(0x1a2),'type':_0x18fba9(0x18f),'description':_0x18fba9(0x1a4),'default':![]},...getAppProfileFlagDefs()];}export function buildAppRemoveFlags(){const _0x50ca1b=a44_0x4811;return[{'name':_0x50ca1b(0x1a2),'type':_0x50ca1b(0x18f),'description':_0x50ca1b(0x1a4),'default':![]}];}function a44_0x4811(_0xd1aa1c,_0x15b74b){_0xd1aa1c=_0xd1aa1c-0x17f;const _0x3412e8=a44_0x3412();let _0x48115d=_0x3412e8[_0xd1aa1c];return _0x48115d;}export async function validateAppName(_0xf7ad5c,_0x4dba45){const _0x4ba7fb=a44_0x4811,_0x1660af=_0xf7ad5c[_0x4ba7fb(0x192)][0x0]?.[_0x4ba7fb(0x1a9)]();if(!_0x1660af)throw CliErrors[_0x4ba7fb(0x1a8)](_0x4ba7fb(0x199),_0x4ba7fb(0x1aa)+CLI_BIN_NAME+'\x20'+_0x4dba45+_0x4ba7fb(0x1a5));}export async function runAppAdd(_0x20eaf5,_0x258a12){const _0x5a20c5=a44_0x4811,_0x1d649e=_0x20eaf5[_0x5a20c5(0x192)][0x0]?.['trim']();if(!_0x1d649e)throw CliErrors[_0x5a20c5(0x1a8)](_0x5a20c5(0x199),_0x5a20c5(0x1aa)+CLI_BIN_NAME+'\x20'+_0x258a12+'\x20<name>\x20--appcode\x20<code>');const _0x269167=_0x20eaf5[_0x5a20c5(0x195)]('appcode');if(!_0x269167)throw CliErrors[_0x5a20c5(0x193)]('appcode','Usage:\x20'+CLI_BIN_NAME+'\x20'+_0x258a12+_0x5a20c5(0x1a3));const _0x4ff2aa={'global':_0x20eaf5['bool']('global')},_0xb16e5a=readConfig(_0x4ff2aa);if(!_0xb16e5a[_0x5a20c5(0x1ae)])_0xb16e5a[_0x5a20c5(0x1ae)]={};const _0x3ed01d={'appcode':_0x269167,...collectAppProfileOverrides(_0x589799=>_0x20eaf5[_0x5a20c5(0x195)](_0x589799))},_0x527c18=_0xb16e5a[_0x5a20c5(0x1ae)],_0x35fee1=!!_0x527c18[_0x1d649e];_0x527c18[_0x1d649e]=_0x3ed01d;if(!_0xb16e5a[_0x5a20c5(0x1a1)])_0xb16e5a[_0x5a20c5(0x1a1)]=_0x1d649e;writeConfig(_0xb16e5a,_0x4ff2aa);const _0x3d1cd1=!_0x35fee1&&_0xb16e5a['defaultApp']===_0x1d649e?_0x5a20c5(0x181):'',_0x286aca=(_0x35fee1?_0x5a20c5(0x194):_0x5a20c5(0x19f))+_0x5a20c5(0x185)+_0x1d649e+_0x5a20c5(0x1a6)+_0x269167+')'+scopeLabel(_0x4ff2aa)+'.'+_0x3d1cd1;return{'ok':!![],'message':_0x286aca};}export async function runAppRemove(_0x2c2bd5,_0x467b5c){const _0x2b5d3f=a44_0x4811,_0x4bb824=_0x2c2bd5['args'][0x0]?.[_0x2b5d3f(0x1a9)]();if(!_0x4bb824)throw CliErrors['validation'](_0x2b5d3f(0x199),_0x2b5d3f(0x1aa)+CLI_BIN_NAME+'\x20'+_0x467b5c+_0x2b5d3f(0x198));const _0x56fffa=_0x2c2bd5[_0x2b5d3f(0x1ad)]('global'),{config:_0x12be42,layers:_0x1de810}=readRawConfigWithLayers(),_0xb9bc8=_0x12be42[_0x2b5d3f(0x1ae)]??{};if(!_0xb9bc8[_0x4bb824])throw CliErrors[_0x2b5d3f(0x1a8)]('App\x20\x22'+_0x4bb824+_0x2b5d3f(0x180));const _0x461e72=_0x1de810[_0x2b5d3f(0x1a0)][_0x2b5d3f(0x1ae)]&&typeof _0x1de810[_0x2b5d3f(0x1a0)]['apps']===_0x2b5d3f(0x196)?_0x1de810['globalConfig'][_0x2b5d3f(0x1ae)]:{},_0x7f578e=_0x1de810[_0x2b5d3f(0x19b)]['apps']&&typeof _0x1de810['projectConfig'][_0x2b5d3f(0x1ae)]==='object'?_0x1de810[_0x2b5d3f(0x19b)][_0x2b5d3f(0x1ae)]:{},_0x5ab358=appDefinedIn(_0x4bb824,_0x461e72,_0x7f578e,_0x1de810[_0x2b5d3f(0x19b)][_0x2b5d3f(0x190)]===![]),_0x37ccd5=resolveAppScopeForWrite(_0x4bb824,_0x56fffa,_0x1de810),_0x466a16={'global':_0x37ccd5===_0x2b5d3f(0x1a2)},_0x44ac16=readConfig(_0x466a16),_0x39ab2a=_0x44ac16[_0x2b5d3f(0x1ae)];if(!_0x39ab2a||!_0x39ab2a[_0x4bb824])throw CliErrors[_0x2b5d3f(0x1a8)](_0x2b5d3f(0x197)+_0x4bb824+_0x2b5d3f(0x180));delete _0x39ab2a[_0x4bb824];let _0x104f63='';if(_0x44ac16[_0x2b5d3f(0x1a1)]===_0x4bb824){const _0x351cd6=Object[_0x2b5d3f(0x1af)](_0x39ab2a);_0x44ac16[_0x2b5d3f(0x1a1)]=_0x351cd6[_0x2b5d3f(0x184)]>0x0?_0x351cd6[0x0]:undefined,_0x44ac16[_0x2b5d3f(0x1a1)]?_0x104f63=_0x2b5d3f(0x182)+_0x44ac16['defaultApp']+'\x22.':delete _0x44ac16['defaultApp'];}Object[_0x2b5d3f(0x1af)](_0x39ab2a)[_0x2b5d3f(0x184)]===0x0&&(delete _0x44ac16[_0x2b5d3f(0x1ae)],delete _0x44ac16[_0x2b5d3f(0x1a1)]);writeConfig(_0x44ac16,_0x466a16);const _0x56188a=_0x5ab358===_0x2b5d3f(0x19e)?_0x2b5d3f(0x18c)+_0x4bb824+_0x2b5d3f(0x17f)+(_0x37ccd5===_0x2b5d3f(0x18b)?_0x2b5d3f(0x1a2):_0x2b5d3f(0x18b))+_0x2b5d3f(0x183):'';return{'ok':!![],'message':_0x2b5d3f(0x189)+_0x4bb824+'\x22'+scopeLabel(_0x466a16)+'.'+_0x104f63+_0x56188a};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xed1a0c,_0x227bb5){const _0x3bfacc=a45_0x2747,_0xe68633=_0xed1a0c();while(!![]){try{const _0x1867f0=-parseInt(_0x3bfacc(0x177))/0x1*(-parseInt(_0x3bfacc(0x190))/0x2)+parseInt(_0x3bfacc(0x17a))/0x3+-parseInt(_0x3bfacc(0x18f))/0x4+parseInt(_0x3bfacc(0x179))/0x5+parseInt(_0x3bfacc(0x18c))/0x6*(parseInt(_0x3bfacc(0x192))/0x7)+parseInt(_0x3bfacc(0x185))/0x8*(-parseInt(_0x3bfacc(0x193))/0x9)+parseInt(_0x3bfacc(0x184))/0xa*(-parseInt(_0x3bfacc(0x17e))/0xb);if(_0x1867f0===_0x227bb5)break;else _0xe68633['push'](_0xe68633['shift']());}catch(_0x3d98c8){_0xe68633['push'](_0xe68633['shift']());}}}(a45_0x1953,0x61b96));import{input,checkbox,select}from'@inquirer/prompts';import a45_0x14d654 from'chalk';import{validateAppcode}from'../../commands/common/validate.js';import{listRemoteApps}from'../../core/api-client.js';import{withActiveCookie}from'../../utils/with-active-cookie.js';function a45_0x2747(_0x32e064,_0x4fcd5e){_0x32e064=_0x32e064-0x173;const _0x1953cc=a45_0x1953();let _0x27476f=_0x1953cc[_0x32e064];return _0x27476f;}import{writeCliSideChannelLine}from'../../utils/write-cli-side-channel.js';export async function promptCustomAppcode(){const _0x3b6e42=a45_0x2747,_0x25003c=await input({'message':_0x3b6e42(0x183),'validate':_0x1fb62e=>{const _0x423b21=_0x3b6e42,_0xad7f01=validateAppcode(_0x1fb62e[_0x423b21(0x176)]());return _0xad7f01[_0x423b21(0x178)]||_0xad7f01[_0x423b21(0x186)]||_0x423b21(0x18e);}});return _0x25003c[_0x3b6e42(0x176)]();}export async function promptAppSelection(_0x53e8dd){const _0xbc167d=a45_0x2747,_0x3f8395=[{'name':a45_0x14d654[_0xbc167d(0x198)]('✎\x20自定义输入\x20appcode'),'value':-0x1},..._0x53e8dd[_0xbc167d(0x17f)]((_0x95dab3,_0x191691)=>({'name':_0x95dab3[_0xbc167d(0x18a)]+'\x20\x20'+a45_0x14d654['gray']('('+_0x95dab3[_0xbc167d(0x182)]+')'),'value':_0x191691}))],_0x114acc=await checkbox({'message':_0xbc167d(0x181)+a45_0x14d654['cyan'](_0x53e8dd['length'])+'\x20个应用,请选择\x20(空格勾选,\x20a=全选,\x20i=反选):','choices':_0x3f8395,'loop':![]});if(_0x114acc[_0xbc167d(0x187)](-0x1))return _0xbc167d(0x180);if(_0x114acc['length']===0x0)return _0xbc167d(0x180);return _0x114acc[_0xbc167d(0x17f)](_0x50dc0c=>_0x53e8dd[_0x50dc0c]);}function a45_0x1953(){const _0x53c436=['1686835kHIEmd','1400148nKVczQ','find','正在获取可用应用列表...','无法获取远程应用列表,请手动输入。','11mUrFfR','map','custom','获取到\x20','appCode','请输入\x20App\x20Code:','2731510Mswhxr','280xqPbFd','message','includes','\x0a无法获取远程应用列表,请手动输入。','✎\x20自定义输入\x20appcode','appName','skip','6XWkPaJ','manual','Invalid\x20App\x20Code','1977072zykIUT','88vGLUAy','gray','1182839MVPPcr','129429fATTcb','\x0a未找到可用应用。','✎\x20手动输入','(跳过,稍后配置)','未找到可用应用。','yellow','\x20\x20(','(未检测到登录态,请手动输入\x20App\x20Code\x20或直接跳过)','App\x20Code:','trim','15863fVZxaZ','valid'];a45_0x1953=function(){return _0x53c436;};return a45_0x1953();}export async function promptSingleAppSelection(_0x153ddd){const _0x4d27d2=a45_0x2747,_0x5ef0d3=[{'name':a45_0x14d654[_0x4d27d2(0x191)]('(跳过,稍后通过\x20config\x20set\x20appcode\x20配置)'),'value':_0x4d27d2(0x18b)},{'name':a45_0x14d654[_0x4d27d2(0x198)](_0x4d27d2(0x189)),'value':_0x4d27d2(0x180)},..._0x153ddd[_0x4d27d2(0x17f)](_0x2946e5=>({'name':_0x2946e5[_0x4d27d2(0x18a)]+'\x20\x20'+a45_0x14d654['gray']('('+_0x2946e5[_0x4d27d2(0x182)]+')'),'value':_0x2946e5[_0x4d27d2(0x182)]}))],_0xf12453=await select({'message':'请选择要绑定的应用:','choices':_0x5ef0d3});if(_0xf12453==='skip')return'skip';if(_0xf12453===_0x4d27d2(0x180))return'custom';return _0x153ddd[_0x4d27d2(0x17b)](_0x3f7694=>_0x3f7694['appCode']===_0xf12453);}export async function selectSingleAppcode(_0xbbc5dd){const _0x3b84f9=a45_0x2747;if(!_0xbbc5dd)return writeCliSideChannelLine(a45_0x14d654[_0x3b84f9(0x191)](_0x3b84f9(0x174))),_fallbackOrSkip();writeCliSideChannelLine(_0x3b84f9(0x17c));let _0x452330;try{_0x452330=await withActiveCookie(_0xbbc5dd,()=>listRemoteApps());}catch(_0x36cd62){writeCliSideChannelLine(a45_0x14d654[_0x3b84f9(0x198)](_0x3b84f9(0x17d)));if(_0x36cd62 instanceof Error)writeCliSideChannelLine(a45_0x14d654['gray']('\x20\x20('+_0x36cd62[_0x3b84f9(0x186)]+')'));return _fallbackOrSkip();}if(_0x452330['length']===0x0)return writeCliSideChannelLine(a45_0x14d654[_0x3b84f9(0x198)](_0x3b84f9(0x197))),_fallbackOrSkip();const _0x20da18=await promptSingleAppSelection(_0x452330);if(_0x20da18===_0x3b84f9(0x18b))return'';if(_0x20da18===_0x3b84f9(0x180))return promptCustomAppcode();return _0x20da18['appCode'];}export async function selectMultipleApps(_0x2aca97){const _0x1e3196=a45_0x2747;writeCliSideChannelLine(_0x1e3196(0x17c));let _0x3f9efa;try{_0x3f9efa=await withActiveCookie(_0x2aca97,()=>listRemoteApps());}catch(_0x3629bd){writeCliSideChannelLine(_0x1e3196(0x188));if(_0x3629bd instanceof Error)writeCliSideChannelLine(_0x1e3196(0x173)+_0x3629bd['message']+')');return _0x1e3196(0x180);}if(_0x3f9efa['length']===0x0)return writeCliSideChannelLine(_0x1e3196(0x194)),'custom';return promptAppSelection(_0x3f9efa);}async function _fallbackOrSkip(){const _0x2da472=a45_0x2747,_0x32d08f=await select({'message':_0x2da472(0x175),'choices':[{'name':a45_0x14d654[_0x2da472(0x191)](_0x2da472(0x196)),'value':_0x2da472(0x18b)},{'name':a45_0x14d654['yellow'](_0x2da472(0x195)),'value':_0x2da472(0x18d)}]});if(_0x32d08f===_0x2da472(0x18b))return'';return promptCustomAppcode();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x53c017=a46_0x1017;(function(_0x27cbd2,_0x23b5df){const _0x5cf21c=a46_0x1017,_0x3b56bc=_0x27cbd2();while(!![]){try{const _0x1d390c=-parseInt(_0x5cf21c(0x1af))/0x1*(-parseInt(_0x5cf21c(0x1b3))/0x2)+-parseInt(_0x5cf21c(0x1a8))/0x3*(-parseInt(_0x5cf21c(0x1ba))/0x4)+parseInt(_0x5cf21c(0x1ad))/0x5*(parseInt(_0x5cf21c(0x1a6))/0x6)+parseInt(_0x5cf21c(0x1b0))/0x7+-parseInt(_0x5cf21c(0x1b8))/0x8*(parseInt(_0x5cf21c(0x1b2))/0x9)+-parseInt(_0x5cf21c(0x19d))/0xa*(parseInt(_0x5cf21c(0x1b9))/0xb)+-parseInt(_0x5cf21c(0x1b4))/0xc;if(_0x1d390c===_0x23b5df)break;else _0x3b56bc['push'](_0x3b56bc['shift']());}catch(_0x16e8a9){_0x3b56bc['push'](_0x3b56bc['shift']());}}}(a46_0x527d,0xd733e));function a46_0x527d(){const _0x26c8d8=['apiError','16lXSckL','2353219TfRQjF','3745752QtrNWT','trim','Task\x20','\x20response\x20did\x20not\x20contain\x20a\x20status.','50ZTNEZD','\x20is\x20pending.','taskId','PROCESSING','FAILED','string','toUpperCase','\x20--format\x20compress','PENDING','6154482NkdOiG','replace','3EHGvFd','\x27\x5c\x27\x27','status','\x20--appcode\x20','errorMessage','5yAZhPU','\x20returned\x20unknown\x20status\x20','1YNumuU','11280038gVnTRW','has','5177889QoqlEL','27382lZpPzt','5826636RKfSjU','SUCCESS','\x20completed\x20successfully.'];a46_0x527d=function(){return _0x26c8d8;};return a46_0x527d();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{CliErrors}from'../../errors.js';const TERMINAL_STATUSES=new Set([a46_0x53c017(0x1b5),a46_0x53c017(0x1a1)]),NON_TERMINAL_STATUSES=new Set(['PENDING','PROCESSING']);export function normalizeAsyncTask(_0x153bfd){const _0x5b5087=a46_0x53c017,_0x472f20=typeof _0x153bfd?.[_0x5b5087(0x19f)]===_0x5b5087(0x1a2)?_0x153bfd[_0x5b5087(0x19f)][_0x5b5087(0x1bb)]():'';if(!_0x472f20)throw CliErrors[_0x5b5087(0x1b7)]('Async\x20task\x20response\x20did\x20not\x20contain\x20a\x20taskId.');const _0x109f3f=typeof _0x153bfd[_0x5b5087(0x1aa)]==='string'?_0x153bfd['status'][_0x5b5087(0x1bb)]()[_0x5b5087(0x1a3)]():'';if(!_0x109f3f)throw CliErrors[_0x5b5087(0x1b7)]('Async\x20task\x20'+_0x472f20+_0x5b5087(0x1bd));return{'taskId':_0x472f20,'status':_0x109f3f,'errorMessage':typeof _0x153bfd['errorMessage']==='string'&&_0x153bfd['errorMessage']['trim']()?_0x153bfd['errorMessage']['trim']():null,'isTerminal':TERMINAL_STATUSES['has'](_0x109f3f),'knownStatus':TERMINAL_STATUSES[_0x5b5087(0x1b1)](_0x109f3f)||NON_TERMINAL_STATUSES['has'](_0x109f3f)};}function a46_0x1017(_0x4e5b9f,_0x5bdbb7){_0x4e5b9f=_0x4e5b9f-0x19d;const _0x527df6=a46_0x527d();let _0x101763=_0x527df6[_0x4e5b9f];return _0x101763;}export function buildAsyncTaskStatusCommand(_0x53c7fd,_0x2fd3d9){const _0x5b8a99=a46_0x53c017;return CLI_BIN_NAME+'\x20task\x20status\x20--task-id\x20'+quoteShellArg(_0x53c7fd)+_0x5b8a99(0x1ab)+quoteShellArg(_0x2fd3d9)+_0x5b8a99(0x1a4);}export function asyncTaskMessage(_0x5872be){const _0x58381d=a46_0x53c017;switch(_0x5872be['status']){case _0x58381d(0x1a5):return _0x58381d(0x1bc)+_0x5872be[_0x58381d(0x19f)]+_0x58381d(0x19e);case _0x58381d(0x1a0):return'Task\x20'+_0x5872be[_0x58381d(0x19f)]+'\x20is\x20processing.';case _0x58381d(0x1b5):return _0x58381d(0x1bc)+_0x5872be[_0x58381d(0x19f)]+_0x58381d(0x1b6);case'FAILED':return _0x5872be[_0x58381d(0x1ac)]?_0x58381d(0x1bc)+_0x5872be[_0x58381d(0x19f)]+'\x20failed:\x20'+_0x5872be[_0x58381d(0x1ac)]:'Task\x20'+_0x5872be['taskId']+'\x20failed.';default:return _0x58381d(0x1bc)+_0x5872be[_0x58381d(0x19f)]+_0x58381d(0x1ae)+_0x5872be[_0x58381d(0x1aa)]+'.';}}function quoteShellArg(_0x1c1cca){const _0x52647d=a46_0x53c017;return'\x27'+_0x1c1cca[_0x52647d(0x1a7)](/'/g,_0x52647d(0x1a9))+'\x27';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2b247b,_0x21db22){var _0x5d37fd=a47_0x20e6,_0x2e832a=_0x2b247b();while(!![]){try{var _0x3e2470=parseInt(_0x5d37fd(0x89))/0x1+parseInt(_0x5d37fd(0x88))/0x2+parseInt(_0x5d37fd(0x90))/0x3*(parseInt(_0x5d37fd(0x87))/0x4)+-parseInt(_0x5d37fd(0x8b))/0x5+-parseInt(_0x5d37fd(0x92))/0x6*(parseInt(_0x5d37fd(0x8d))/0x7)+parseInt(_0x5d37fd(0x8e))/0x8+-parseInt(_0x5d37fd(0x86))/0x9*(-parseInt(_0x5d37fd(0x85))/0xa);if(_0x3e2470===_0x21db22)break;else _0x2e832a['push'](_0x2e832a['shift']());}catch(_0x224046){_0x2e832a['push'](_0x2e832a['shift']());}}}(a47_0x1580,0x673cb));export function asDryRunResult(_0x596656,_0x23a215){var _0x296a6a=a47_0x20e6;return Object[_0x296a6a(0x8c)](_0x596656,{'method':{'value':_0x23a215[_0x296a6a(0x8f)],'enumerable':![]},'url':{'value':_0x23a215[_0x296a6a(0x8a)],'enumerable':![]},..._0x23a215[_0x296a6a(0x91)]?{'description':{'value':_0x23a215['description'],'enumerable':![]}}:{}});}function a47_0x20e6(_0x328a4b,_0x474439){_0x328a4b=_0x328a4b-0x85;var _0x158023=a47_0x1580();var _0x20e6bf=_0x158023[_0x328a4b];return _0x20e6bf;}function a47_0x1580(){var _0x58c85f=['130kjTOCN','398961eXNdah','1156388HOwcSv','721838AruzBv','28710RTbIkS','url','3459330SIZOgP','defineProperties','4998490TcxTSY','4590336XwkExH','method','3EVdIJy','description','6gxForW'];a47_0x1580=function(){return _0x58c85f;};return a47_0x1580();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x5987f3=a48_0x77e5;function a48_0x77e5(_0x501ffd,_0x45a881){_0x501ffd=_0x501ffd-0x96;const _0xda82ba=a48_0xda82();let _0x77e537=_0xda82ba[_0x501ffd];return _0x77e537;}(function(_0x411480,_0x342101){const _0x137337=a48_0x77e5,_0x41b28f=_0x411480();while(!![]){try{const _0x3a9300=-parseInt(_0x137337(0xa4))/0x1*(-parseInt(_0x137337(0xaa))/0x2)+-parseInt(_0x137337(0xa9))/0x3*(-parseInt(_0x137337(0x98))/0x4)+parseInt(_0x137337(0xab))/0x5*(-parseInt(_0x137337(0x9f))/0x6)+-parseInt(_0x137337(0xa7))/0x7*(parseInt(_0x137337(0xa1))/0x8)+-parseInt(_0x137337(0x9e))/0x9*(parseInt(_0x137337(0xaf))/0xa)+parseInt(_0x137337(0xa6))/0xb*(parseInt(_0x137337(0xa3))/0xc)+parseInt(_0x137337(0x96))/0xd;if(_0x3a9300===_0x342101)break;else _0x41b28f['push'](_0x41b28f['shift']());}catch(_0x2f81db){_0x41b28f['push'](_0x41b28f['shift']());}}}(a48_0xda82,0x994ab));function a48_0xda82(){const _0x5726a1=['7ThhsSL','number','2302155vqMLSV','23228VEPUMA','5JyrZIz','Dataset\x20code\x20(32-char\x20hex\x20UUID)','Database\x20product\x20type','MYSQL','1058940LcZsWv','21738587xbWfja','string','4tkHVsF','SQL\x20code\x20in\x20format\x20xxxxxxxx-xxxxxxxx\x20(e.g.\x202305f915-dd48cd4c)','a\x2032-character\x20hex\x20string\x20(e.g.\x2099a909313f1fa7153186431e1c551588)','POSTGRESQL','App\x20code\x20(e.g.\x20app-xxxxx)','appcode','81JeWtLy','5761566ZNsoDS','SQL\x20code\x20identifier\x20(format:\x20xxxxxxxx-xxxxxxxx,\x20e.g.\x202305f915-dd48cd4c)','9348824YBFexX','sqlcode','588CUjIQh','31zcoRjj','App\x20code\x20(overrides\x20config\x20file,\x20e.g.\x20app-xxxxx)','204325QujVOI'];a48_0xda82=function(){return _0x5726a1;};return a48_0xda82();}export const DATASET_CODE_PATTERN={'regex':/^[a-f0-9]{32}$/i,'description':a48_0x5987f3(0x9a)};export const CODE_FLAG={'name':'code','type':a48_0x5987f3(0x97),'required':!![],'description':a48_0x5987f3(0xac),'pattern':DATASET_CODE_PATTERN};export const CODE_FLAG_OPTIONAL={...CODE_FLAG,'required':![]};export const DATASETCODE_FLAG_OPTIONAL={...CODE_FLAG_OPTIONAL,'name':'datasetcode','description':a48_0x5987f3(0xac)};export const SQLCODE_FLAG={'name':a48_0x5987f3(0xa2),'type':a48_0x5987f3(0x97),'required':!![],'description':a48_0x5987f3(0xa0),'pattern':{'regex':/^[a-f0-9]{8}-[a-f0-9]{8}$/i,'description':a48_0x5987f3(0x99)}};export const APPCODE_FLAG_OPTIONAL={'name':a48_0x5987f3(0x9d),'type':a48_0x5987f3(0x97),'required':![],'description':a48_0x5987f3(0xa5)};export const APPCODE_FLAG={...APPCODE_FLAG_OPTIONAL,'required':!![],'description':a48_0x5987f3(0x9c)};export const SQLCODE_FLAG_OPTIONAL={...SQLCODE_FLAG,'required':![]};export const DBLINK_ID_FLAG={'name':'id','type':a48_0x5987f3(0xa8),'required':!![],'description':'Database\x20connection\x20ID\x20(dblink\x20id\x20from\x20db\x20list)'};export const DB_TYPE_FLAG={'name':'dbtype','type':a48_0x5987f3(0x97),'required':!![],'description':a48_0x5987f3(0xad),'enum':[a48_0x5987f3(0xae),a48_0x5987f3(0x9b)]};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x60912a,_0x75a48d){const _0x59e093=a49_0x574a,_0x5b8e6d=_0x60912a();while(!![]){try{const _0x5cee30=parseInt(_0x59e093(0x177))/0x1+-parseInt(_0x59e093(0x166))/0x2*(parseInt(_0x59e093(0x173))/0x3)+-parseInt(_0x59e093(0x174))/0x4*(-parseInt(_0x59e093(0x16e))/0x5)+parseInt(_0x59e093(0x16f))/0x6+parseInt(_0x59e093(0x16a))/0x7+-parseInt(_0x59e093(0x170))/0x8*(-parseInt(_0x59e093(0x172))/0x9)+-parseInt(_0x59e093(0x171))/0xa*(parseInt(_0x59e093(0x165))/0xb);if(_0x5cee30===_0x75a48d)break;else _0x5b8e6d['push'](_0x5b8e6d['shift']());}catch(_0x32b7c1){_0x5b8e6d['push'](_0x5b8e6d['shift']());}}}(a49_0x4e31,0x894f6));import{existsSync,statSync}from'node:fs';import{CliErrors}from'../../errors.js';function a49_0x574a(_0x4434e4,_0x4c25fa){_0x4434e4=_0x4434e4-0x165;const _0x4e314a=a49_0x4e31();let _0x574a7c=_0x4e314a[_0x4434e4];return _0x574a7c;}const BYTES_PER_MB=0x400*0x400;export const DEVELOPMENT_UPLOAD_MAX_BYTES=0x32*BYTES_PER_MB;function a49_0x4e31(){const _0xe13ad5=['58322qJVhun','559960YTBLMz','File\x20not\x20found:\x20','validation','\x20MB','1251075ANCxsp','trim','size','File\x20is\x20not\x20a\x20regular\x20file:\x20','2266095nTBJbK','2863566pMSqxU','16nGuYHf','3230FvcLRW','4505562ekhevA','6djlRDo','4YFmWbi','isFile','File\x20exceeds\x20the\x20development\x20upload\x20limit\x20of\x2050\x20MB:\x20','724487zetowI'];a49_0x4e31=function(){return _0xe13ad5;};return a49_0x4e31();}function formatBytes(_0x50181e){const _0x3219b0=a49_0x574a;if(_0x50181e>=BYTES_PER_MB){const _0x1c06a9=Math['ceil'](_0x50181e/BYTES_PER_MB*0x64)/0x64;return _0x1c06a9['toFixed'](0x2)+_0x3219b0(0x169);}return _0x50181e+'\x20B';}export function requireDevelopmentUploadFile(_0x2d0677,_0x2ffcdf){const _0x383ffb=a49_0x574a,_0x247cc5=_0x2d0677[_0x383ffb(0x16b)]();if(!_0x247cc5)throw CliErrors[_0x383ffb(0x168)](_0x2ffcdf+'\x20path\x20is\x20required.');if(!existsSync(_0x247cc5))throw CliErrors[_0x383ffb(0x168)](_0x383ffb(0x167)+_0x247cc5);const _0x4bd257=statSync(_0x247cc5);if(!_0x4bd257[_0x383ffb(0x175)]())throw CliErrors[_0x383ffb(0x168)](_0x383ffb(0x16d)+_0x247cc5);if(_0x4bd257[_0x383ffb(0x16c)]>DEVELOPMENT_UPLOAD_MAX_BYTES)throw CliErrors[_0x383ffb(0x168)](_0x383ffb(0x176)+_0x247cc5+'\x20('+formatBytes(_0x4bd257[_0x383ffb(0x16c)])+')');return{'path':_0x247cc5,'size':_0x4bd257[_0x383ffb(0x16c)]};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x154bca,_0x51d894){const _0x15ef1f=a50_0xf2b5,_0x3e9a49=_0x154bca();while(!![]){try{const _0x4f8192=parseInt(_0x15ef1f(0x163))/0x1*(parseInt(_0x15ef1f(0x16a))/0x2)+parseInt(_0x15ef1f(0x15a))/0x3+parseInt(_0x15ef1f(0x166))/0x4*(parseInt(_0x15ef1f(0x15f))/0x5)+-parseInt(_0x15ef1f(0x161))/0x6+-parseInt(_0x15ef1f(0x168))/0x7*(parseInt(_0x15ef1f(0x169))/0x8)+-parseInt(_0x15ef1f(0x15b))/0x9+-parseInt(_0x15ef1f(0x15c))/0xa*(-parseInt(_0x15ef1f(0x162))/0xb);if(_0x4f8192===_0x51d894)break;else _0x3e9a49['push'](_0x3e9a49['shift']());}catch(_0x3b180a){_0x3e9a49['push'](_0x3e9a49['shift']());}}}(a50_0x5782,0xc10d2));function a50_0x5782(){const _0x5dd79b=['length','28ZWHTHj','1470176kwQezO','79914FvEdjl','2002353HxRzew','5001579ZHFEIV','999010gnDrAZ','trim','App\x20Code\x20cannot\x20exceed\x20100\x20characters','84765YuRqym','Only\x20letters,\x20numbers,\x20-\x20and\x20_\x20are\x20allowed','9388218WGzclG','110huNWyZ','19BNPalp','App\x20Code\x20cannot\x20be\x20empty','test','288LjzfOl'];a50_0x5782=function(){return _0x5dd79b;};return a50_0x5782();}function a50_0xf2b5(_0x3bb742,_0x2c380c){_0x3bb742=_0x3bb742-0x15a;const _0x57821c=a50_0x5782();let _0xf2b5b=_0x57821c[_0x3bb742];return _0xf2b5b;}export function validateAppcode(_0x521730){const _0x174b7b=a50_0xf2b5,_0x27fca3=_0x521730[_0x174b7b(0x15d)]();if(!_0x27fca3)return{'valid':![],'message':_0x174b7b(0x164)};if(_0x27fca3[_0x174b7b(0x167)]>0x64)return{'valid':![],'message':_0x174b7b(0x15e)};if(!/^[A-Za-z0-9_-]+$/[_0x174b7b(0x165)](_0x27fca3))return{'valid':![],'message':_0x174b7b(0x160)};return{'valid':!![]};}
|