@lovrabet/rabetbase-cli 2.5.2-beta.4 → 2.5.2-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.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/dataset/user-deleted-field-list.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/index.js +1 -1
- package/lib/commands/deployment/sync-all.js +1 -1
- package/lib/commands/deployment/sync-jobs.js +1 -1
- package/lib/commands/deployment/sync-status.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/instant-api-policy/current.js +1 -1
- package/lib/commands/instant-api-policy/index.js +1 -1
- package/lib/commands/instant-api-policy/init.js +1 -1
- package/lib/commands/instant-api-policy/publish.js +1 -1
- package/lib/commands/instant-api-policy/pull.js +1 -1
- package/lib/commands/instant-api-policy/revision.js +1 -1
- package/lib/commands/instant-api-policy/revisions.js +1 -1
- package/lib/commands/instant-api-policy/rollback.js +1 -1
- package/lib/commands/instant-api-policy/shared.js +1 -1
- package/lib/commands/instant-api-policy/validate.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/domain-routing-sync.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/rule/get.js +1 -1
- package/lib/commands/rule/index.js +1 -1
- package/lib/commands/rule/list.js +1 -1
- package/lib/commands/rule/set.js +1 -1
- package/lib/commands/rule/shared.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-domain-routing.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +0 -17
- 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/instant-api-policy/config.js +1 -1
- package/lib/core/kb-search-client.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/supported-flags.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/generated/official-routing.js +1 -1
- package/lib/generated/routing-contract.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.d.ts +6 -5
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
- package/skills/rabetbase/SKILL.md +5 -6
- package/skills/rabetbase/references/rabetbase-deployment-sync-all.md +56 -0
- package/skills/rabetbase.manifest.json +4 -4
- package/lib/commands/deployment/auto-sync.d.ts +0 -20
- package/lib/commands/deployment/auto-sync.js +0 -1
- package/lib/commands/deployment/sync.d.ts +0 -2
- package/lib/commands/deployment/sync.js +0 -1
- package/skills/rabetbase/references/rabetbase-deployment-sync.md +0 -100
package/lib/utils/guides-cdn.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a312_0x528f(_0x314c47,_0xfc57d5){_0x314c47=_0x314c47-0x110;const _0x3583de=a312_0x3583();let _0x528f9b=_0x3583de[_0x314c47];return _0x528f9b;}const a312_0x74f0a9=a312_0x528f;(function(_0x594371,_0x3d3087){const _0x405cb6=a312_0x528f,_0x4996ac=_0x594371();while(!![]){try{const _0x3c79b4=parseInt(_0x405cb6(0x123))/0x1*(-parseInt(_0x405cb6(0x12a))/0x2)+parseInt(_0x405cb6(0x121))/0x3*(parseInt(_0x405cb6(0x110))/0x4)+parseInt(_0x405cb6(0x117))/0x5*(-parseInt(_0x405cb6(0x111))/0x6)+parseInt(_0x405cb6(0x118))/0x7*(-parseInt(_0x405cb6(0x131))/0x8)+parseInt(_0x405cb6(0x11f))/0x9*(-parseInt(_0x405cb6(0x115))/0xa)+parseInt(_0x405cb6(0x12b))/0xb*(parseInt(_0x405cb6(0x133))/0xc)+parseInt(_0x405cb6(0x11c))/0xd*(parseInt(_0x405cb6(0x134))/0xe);if(_0x3c79b4===_0x3d3087)break;else _0x4996ac['push'](_0x4996ac['shift']());}catch(_0x37db23){_0x4996ac['push'](_0x4996ac['shift']());}}}(a312_0x3583,0x57ef6));import{mkdirSync,writeFileSync}from'node:fs';import{dirname,join}from'node:path';import{homedir}from'node:os';import{getTemplateBaseUrl}from'../utils/config.js';function getGuidesCdnUrl(){const _0x4544f0=getTemplateBaseUrl();return _0x4544f0+'/skills/guides.json';}function a312_0x3583(){const _0x682d18=['title','trimEnd','object','2iOGUWh','11CssqnR','cache','status','lastUpdated','json','length','280GlqImM','join','4788804XIUuJY','16688ectAze','guides','application/json','1121556fIQIYc','3661212NRlxjy','.lovrabet','utf-8','statusText','20XgzRHP','skillTemplate','5rNrNGd','28973kDDoln','entries','.md','.lovrabet/skill/guides','10309DDpWvo','CDN\x20data\x20is\x20missing\x20skillTemplate','\x0a\x0a>更新时间:','2484018FcwrJH','content','6StDZOP','replace','237848ccZyWM','extendContent','CDN\x20returned\x20invalid\x20data','push'];a312_0x3583=function(){return _0x682d18;};return a312_0x3583();}const CACHE_DIR=join(homedir(),a312_0x74f0a9(0x112),a312_0x74f0a9(0x12c));export async function fetchGuidesFromCDN(){const _0x4c5de0=a312_0x74f0a9,_0xff9a4c=getGuidesCdnUrl(),_0x47936b=await fetch(_0xff9a4c,{'headers':{'Accept':_0x4c5de0(0x136)}});if(!_0x47936b['ok'])throw new Error('CDN\x20request\x20failed:\x20'+_0x47936b[_0x4c5de0(0x12d)]+'\x20'+_0x47936b[_0x4c5de0(0x114)]);const _0x2d5626=await _0x47936b[_0x4c5de0(0x12f)]();if(!_0x2d5626[_0x4c5de0(0x135)]||typeof _0x2d5626['guides']!==_0x4c5de0(0x129))throw new Error(_0x4c5de0(0x125));return _0x2d5626;}export function writeGuidesToProject(_0x3ab540,_0x4b3c57,_0x354dda=a312_0x74f0a9(0x11b),_0xffa963){const _0x374a04=a312_0x74f0a9,_0x280fc1=join(_0x4b3c57,_0x354dda);mkdirSync(_0x280fc1,{'recursive':!![]});for(const [_0x11efcd,_0x3375c2]of Object[_0x374a04(0x119)](_0x3ab540[_0x374a04(0x135)])){let _0x2f73fc=_0x3375c2[_0x374a04(0x120)];_0x3375c2[_0x374a04(0x12e)]&&(_0x2f73fc=appendUpdateTime(_0x2f73fc,_0x3375c2[_0x374a04(0x12e)])),writeFileSync(join(_0x280fc1,_0x11efcd+_0x374a04(0x11a)),_0x2f73fc,_0x374a04(0x113));}}export function appendUpdateTime(_0x3c819a,_0x132aaa){const _0x5254c1=a312_0x74f0a9;return _0x3c819a=_0x3c819a[_0x5254c1(0x122)](/\n*>更新时间:.*$/m,''),_0x3c819a[_0x5254c1(0x128)]()+(_0x5254c1(0x11e)+_0x132aaa);}export function getSkillTemplate(_0x21e8da){const _0x243ad8=a312_0x74f0a9;return _0x21e8da[_0x243ad8(0x116)]?.[_0x243ad8(0x120)]||'';}export function appendExtendContents(_0x327ffe,_0x4f1e0a,_0x4e766d){const _0x293e2e=a312_0x74f0a9,_0x4c19c2=[];for(const [,_0x5d1447]of Object[_0x293e2e(0x119)](_0x4f1e0a[_0x293e2e(0x135)])){_0x5d1447[_0x293e2e(0x124)]&&_0x4c19c2[_0x293e2e(0x126)](_0x5d1447[_0x293e2e(0x124)][_0x293e2e(0x128)]());}if(_0x4c19c2[_0x293e2e(0x130)]===0x0)return _0x327ffe;return _0x327ffe['trimEnd']()+'\x0a\x0a'+_0x4c19c2[_0x293e2e(0x132)]('\x0a\x0a')+'\x0a';}export function writeSkillFile(_0x270d90,_0x19ad84,_0x2bfadb){const _0x1debba=a312_0x74f0a9,_0x406b96=getSkillTemplate(_0x270d90);if(!_0x406b96)throw new Error(_0x1debba(0x11d));const _0x28f0cc=dirname(_0x19ad84);mkdirSync(_0x28f0cc,{'recursive':!![]});let _0x1cdc5d=_0x406b96['replace'](/\{\{IDE_NAME\}\}/g,_0x2bfadb);_0x1cdc5d=appendExtendContents(_0x1cdc5d,_0x270d90),_0x270d90[_0x1debba(0x116)][_0x1debba(0x12e)]&&(_0x1cdc5d=appendUpdateTime(_0x1cdc5d,_0x270d90[_0x1debba(0x116)]['lastUpdated'])),writeFileSync(_0x19ad84,_0x1cdc5d,'utf-8');}export async function installGuides(_0x3113b5){const _0x346cdc=a312_0x74f0a9,_0x28f1a8=await fetchGuidesFromCDN();return writeGuidesToProject(_0x28f1a8,_0x3113b5),Object['keys'](_0x28f1a8['guides'])[_0x346cdc(0x130)];}export function getGuidesSummary(_0x51d070){const _0x286cfa=a312_0x74f0a9;return Object[_0x286cfa(0x119)](_0x51d070['guides'])['map'](([_0x166a65,_0x37a346])=>({'key':_0x166a65,'title':_0x37a346[_0x286cfa(0x127)],'path':_0x37a346['path']}));}
|
package/lib/utils/http-client.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a313_0x4e47(_0x30efed,_0xd6c704){_0x30efed=_0x30efed-0x7d;const _0x16abaa=a313_0x16ab();let _0x4e4763=_0x16abaa[_0x30efed];return _0x4e4763;}(function(_0xc3babd,_0x173e10){const _0xc600d3=a313_0x4e47,_0x4aa2c0=_0xc3babd();while(!![]){try{const _0x3fa8b9=parseInt(_0xc600d3(0x83))/0x1+parseInt(_0xc600d3(0x86))/0x2*(parseInt(_0xc600d3(0x8d))/0x3)+parseInt(_0xc600d3(0x7e))/0x4+-parseInt(_0xc600d3(0x8a))/0x5*(parseInt(_0xc600d3(0x81))/0x6)+-parseInt(_0xc600d3(0x88))/0x7*(parseInt(_0xc600d3(0x92))/0x8)+-parseInt(_0xc600d3(0x7f))/0x9*(-parseInt(_0xc600d3(0x95))/0xa)+parseInt(_0xc600d3(0x87))/0xb*(parseInt(_0xc600d3(0x89))/0xc);if(_0x3fa8b9===_0x173e10)break;else _0x4aa2c0['push'](_0x4aa2c0['shift']());}catch(_0x19fa71){_0x4aa2c0['push'](_0x4aa2c0['shift']());}}}(a313_0x16ab,0x4eb17));export async function httpRequest(_0x157773,_0x368cd1={}){const _0xa227d9=a313_0x4e47,{timeout:timeout=0x7530,retries:retries=0x3,retryDelay:retryDelay=0x3e8,headers:headers={}}=_0x368cd1;let _0x29943b=null;for(let _0x1d57b0=0x0;_0x1d57b0<=retries;_0x1d57b0++){try{const _0x3c67fc=new AbortController(),_0x1e7dfc=setTimeout(()=>_0x3c67fc['abort'](),timeout),_0x450864=await fetch(_0x157773,{'headers':headers,'signal':_0x3c67fc[_0xa227d9(0x8f)]});clearTimeout(_0x1e7dfc);let _0x17b86c;const _0x43f81d=_0x450864[_0xa227d9(0x90)][_0xa227d9(0x96)]('content-type');return _0x43f81d?.['includes']('application/json')?_0x17b86c=await _0x450864[_0xa227d9(0x8c)]():_0x17b86c=await _0x450864[_0xa227d9(0x85)](),{'ok':_0x450864['ok'],'status':_0x450864[_0xa227d9(0x93)],'statusText':_0x450864[_0xa227d9(0x7d)],'data':_0x17b86c,'headers':_0x450864[_0xa227d9(0x90)],'url':_0x450864['url'],'text':()=>_0x450864[_0xa227d9(0x85)]()};}catch(_0x2ec7bc){_0x29943b=_0x2ec7bc instanceof Error?_0x2ec7bc:new Error(String(_0x2ec7bc));if(_0x1d57b0===retries)break;if(shouldRetry(_0x2ec7bc)){console['log']('*\x20Request\x20failed;\x20retry\x20'+(_0x1d57b0+0x1)+'\x20in\x20'+retryDelay+_0xa227d9(0x82)),await sleep(retryDelay);continue;}else break;}}throw _0x29943b||new Error('Request\x20failed');}function shouldRetry(_0x184f6a){const _0xdb52bb=a313_0x4e47;if(_0x184f6a instanceof Error){if(_0x184f6a['name']===_0xdb52bb(0x8b))return![];if(_0x184f6a[_0xdb52bb(0x94)]===_0xdb52bb(0x84)&&_0x184f6a[_0xdb52bb(0x8e)][_0xdb52bb(0x91)](_0xdb52bb(0x80)))return!![];if(_0x184f6a[_0xdb52bb(0x8e)]['includes']('ECONNRESET'))return!![];if(_0x184f6a['message'][_0xdb52bb(0x91)]('ENOTFOUND'))return![];}return![];}function sleep(_0x54831d){return new Promise(_0x39671b=>setTimeout(_0x39671b,_0x54831d));}function a313_0x16ab(){const _0x572975=['includes','3652424QQOQEj','status','name','10JeSCom','get','statusText','896956UjWPGo','2054799XjqLpD','fetch','66nDqenh','ms...','181211VQBrnd','TypeError','text','4JejzkQ','1259368qVupSP','7XicaEU','12YbfKgH','224355oZAbPv','AbortError','json','786318PlEglp','message','signal','headers'];a313_0x16ab=function(){return _0x572975;};return a313_0x16ab();}export function validateUrl(_0x84568d){try{return new URL(_0x84568d),!![];}catch{return![];}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a314_0x29b3(_0x4aaa08,_0x4473f5){_0x4aaa08=_0x4aaa08-0x73;const _0x26dc9e=a314_0x26dc();let _0x29b3bf=_0x26dc9e[_0x4aaa08];return _0x29b3bf;}(function(_0x26c616,_0x53b268){const _0x7ab071=a314_0x29b3,_0x44309f=_0x26c616();while(!![]){try{const _0x20a11c=-parseInt(_0x7ab071(0x7b))/0x1*(parseInt(_0x7ab071(0x7d))/0x2)+parseInt(_0x7ab071(0x81))/0x3+-parseInt(_0x7ab071(0x7a))/0x4+-parseInt(_0x7ab071(0x77))/0x5+-parseInt(_0x7ab071(0x80))/0x6+parseInt(_0x7ab071(0x76))/0x7+-parseInt(_0x7ab071(0x78))/0x8*(-parseInt(_0x7ab071(0x7c))/0x9);if(_0x20a11c===_0x53b268)break;else _0x44309f['push'](_0x44309f['shift']());}catch(_0x25ead5){_0x44309f['push'](_0x44309f['shift']());}}}(a314_0x26dc,0xbee97));function a314_0x26dc(){const _0x2c7d85=['9308019lbbwCX','1359975wPOZfU','4376rCjnyg','stdin','4805640zDFTfS','2cWeBVj','39132WyMlKr','1140994MisHDk','isTTY','isRaw','5653836RKDmZL','1891821MVwfUJ','true','setRawMode','nonInteractive'];a314_0x26dc=function(){return _0x2c7d85;};return a314_0x26dc();}function env(_0x5bcca4){return process.env[`RABETBASE_${_0x5bcca4}`]||process.env[`LOVRABET_${_0x5bcca4}`]||undefined;}export function isNonInteractive(_0xb436f){const _0x38234f=a314_0x29b3;return!!(_0xb436f[_0x38234f(0x75)]||_0xb436f['ci']||env('CI')===_0x38234f(0x73)||process.env.CI===_0x38234f(0x73)||!process['stdout'][_0x38234f(0x7e)]||!isStdinRawModeSupported());}function isStdinRawModeSupported(){const _0x2ed7ce=a314_0x29b3;if(!process[_0x2ed7ce(0x79)][_0x2ed7ce(0x7e)])return![];try{const _0x371bb7=process[_0x2ed7ce(0x79)][_0x2ed7ce(0x7f)];return process[_0x2ed7ce(0x79)]['setRawMode'](!![]),process[_0x2ed7ce(0x79)][_0x2ed7ce(0x74)](_0x371bb7??![]),!![];}catch{return![];}}
|
package/lib/utils/logger.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a315_0x378e(_0x38a580,_0x1fd960){_0x38a580=_0x38a580-0x1ce;const _0x5e5f51=a315_0x5e5f();let _0x378e0c=_0x5e5f51[_0x38a580];return _0x378e0c;}const a315_0x3f7ccf=a315_0x378e;(function(_0x33c1dc,_0x5ddf86){const _0xf7be17=a315_0x378e,_0x219903=_0x33c1dc();while(!![]){try{const _0x764eaf=parseInt(_0xf7be17(0x1d7))/0x1*(parseInt(_0xf7be17(0x206))/0x2)+-parseInt(_0xf7be17(0x208))/0x3+-parseInt(_0xf7be17(0x1e7))/0x4+-parseInt(_0xf7be17(0x1d0))/0x5+-parseInt(_0xf7be17(0x1e4))/0x6*(-parseInt(_0xf7be17(0x1d3))/0x7)+-parseInt(_0xf7be17(0x1d9))/0x8*(parseInt(_0xf7be17(0x1fb))/0x9)+parseInt(_0xf7be17(0x1f8))/0xa*(parseInt(_0xf7be17(0x1f0))/0xb);if(_0x764eaf===_0x5ddf86)break;else _0x219903['push'](_0x219903['shift']());}catch(_0x51ec9a){_0x219903['push'](_0x219903['shift']());}}}(a315_0x5e5f,0x9ff9b));import a315_0x58e18b from'winston';import a315_0x273d7b from'node:fs';import a315_0x5a0778 from'node:path';class Logger{[a315_0x3f7ccf(0x1fe)];[a315_0x3f7ccf(0x1f6)];[a315_0x3f7ccf(0x202)]='';constructor(){const _0x546b82=a315_0x3f7ccf;this[_0x546b82(0x1f6)]='';}[a315_0x3f7ccf(0x1cf)](_0x3d8c8c){this['currentRawCommand']=_0x3d8c8c;}['initWinstonLogger'](){const _0xfc1663=a315_0x3f7ccf,_0x327134=a315_0x5a0778[_0xfc1663(0x200)](this[_0xfc1663(0x1f6)]);!a315_0x273d7b[_0xfc1663(0x207)](_0x327134)&&a315_0x273d7b[_0xfc1663(0x1ce)](_0x327134,{'recursive':!![]});const _0xa8584d=a315_0x58e18b['format'][_0xfc1663(0x1ee)](a315_0x58e18b[_0xfc1663(0x1da)][_0xfc1663(0x1ed)](),a315_0x58e18b[_0xfc1663(0x1da)]['errors']({'stack':!![]}),a315_0x58e18b[_0xfc1663(0x1da)][_0xfc1663(0x1f3)](_0x4823db=>{const _0xa4c59e=_0xfc1663,_0x34ba50={'timestamp':_0x4823db['timestamp']||new Date()['toISOString'](),'level':_0x4823db[_0xa4c59e(0x1de)]||_0xa4c59e(0x1e2),'command':_0x4823db[_0xa4c59e(0x1d4)]||_0xa4c59e(0x1db),'rawCommand':_0x4823db[_0xa4c59e(0x1f5)]||this[_0xa4c59e(0x202)]||undefined,'message':_0x4823db['message']||'','duration':_0x4823db[_0xa4c59e(0x1e8)]||undefined,'details':_0x4823db[_0xa4c59e(0x1f1)]||undefined};return JSON[_0xa4c59e(0x201)](_0x34ba50);}));this['winstonLogger']=a315_0x58e18b[_0xfc1663(0x1ea)]({'level':_0xfc1663(0x1e2),'format':_0xa8584d,'transports':[new a315_0x58e18b['transports'][(_0xfc1663(0x1e3))]({'filename':this[_0xfc1663(0x1f6)],'level':_0xfc1663(0x1e2)})],'silent':![]}),a315_0x58e18b[_0xfc1663(0x1e5)]({'success':_0xfc1663(0x1fc),'error':_0xfc1663(0x1d2),'warn':'yellow','info':_0xfc1663(0x1fd)});}['setLogPath'](_0x5c76be){const _0x5de31a=a315_0x3f7ccf;this[_0x5de31a(0x1f6)]=a315_0x5a0778[_0x5de31a(0x1f2)](_0x5c76be,_0x5de31a(0x1ef)),this['winstonLogger']&&this['winstonLogger'][_0x5de31a(0x1ff)](),this[_0x5de31a(0x1f4)]();}[a315_0x3f7ccf(0x1e2)](_0x4d9373,_0x5d0428,_0x515e0f){const _0x4dc310=a315_0x3f7ccf;if(!this[_0x4dc310(0x1f6)]||!this[_0x4dc310(0x1fe)])return;this[_0x4dc310(0x1fe)][_0x4dc310(0x1e2)](_0x5d0428,{'command':_0x4d9373,'details':_0x515e0f});}['success'](_0x29fa0e,_0x54a313,_0x1c262d,_0x23b053){const _0x3a2fc9=a315_0x3f7ccf;if(!this['logFilePath']||!this[_0x3a2fc9(0x1fe)])return;this[_0x3a2fc9(0x1fe)][_0x3a2fc9(0x1d6)]('info',_0x54a313,{'level':'success','command':_0x29fa0e,'duration':_0x1c262d,'details':_0x23b053});}['error'](_0x1dfb81,_0x4fa917,_0x4b162a){const _0x505400=a315_0x3f7ccf;if(!this[_0x505400(0x1f6)]||!this[_0x505400(0x1fe)])return;this[_0x505400(0x1fe)][_0x505400(0x1dd)](_0x4fa917,{'command':_0x1dfb81,'details':_0x4b162a});}['warn'](_0x5ac6d8,_0x2d1454,_0xe41e01){const _0x550fc2=a315_0x3f7ccf;if(!this[_0x550fc2(0x1f6)]||!this[_0x550fc2(0x1fe)])return;this[_0x550fc2(0x1fe)]['warn'](_0x2d1454,{'command':_0x5ac6d8,'details':_0xe41e01});}async[a315_0x3f7ccf(0x1eb)](_0x32a553,_0x555ff8,_0x3945a9){const _0x5d29dd=a315_0x3f7ccf,_0x482df9=Date[_0x5d29dd(0x203)]();this[_0x5d29dd(0x1e2)](_0x32a553,_0x5d29dd(0x1e9)+_0x555ff8);try{const _0x30a4ee=await _0x3945a9(),_0x4c3eed=Date[_0x5d29dd(0x203)]()-_0x482df9;return this[_0x5d29dd(0x1e6)](_0x32a553,_0x5d29dd(0x1dc)+_0x555ff8,_0x4c3eed),_0x30a4ee;}catch(_0x4f9692){const _0x4699c8=Date['now']()-_0x482df9;this['error'](_0x32a553,'Failed:\x20'+_0x555ff8,{'error':_0x4f9692 instanceof Error?_0x4f9692['message']:String(_0x4f9692),'duration':_0x4699c8});throw _0x4f9692;}}[a315_0x3f7ccf(0x205)](){const _0x49f922=a315_0x3f7ccf;try{if(!a315_0x273d7b[_0x49f922(0x207)](this[_0x49f922(0x1f6)]))return[];const _0x441e11=a315_0x273d7b['readFileSync'](this['logFilePath'],_0x49f922(0x1ec));return _0x441e11['split']('\x0a')[_0x49f922(0x1f9)](_0xa67521=>_0xa67521[_0x49f922(0x1f7)]())[_0x49f922(0x1d1)](_0x4c6453=>JSON[_0x49f922(0x204)](_0x4c6453));}catch(_0x44ad5a){return console[_0x49f922(0x1fa)](_0x49f922(0x1df),_0x44ad5a),[];}}[a315_0x3f7ccf(0x1e0)](){const _0x28485f=a315_0x3f7ccf;try{a315_0x273d7b['existsSync'](this[_0x28485f(0x1f6)])&&a315_0x273d7b[_0x28485f(0x1d5)](this[_0x28485f(0x1f6)],'',_0x28485f(0x1ec));}catch(_0x5d1de0){console[_0x28485f(0x1fa)](_0x28485f(0x1d8),_0x5d1de0);}}[a315_0x3f7ccf(0x1e1)](){const _0x5ca7ae=a315_0x3f7ccf;return this[_0x5ca7ae(0x1fe)];}}function a315_0x5e5f(){const _0x302b90=['stringify','currentRawCommand','now','parse','readLogs','1873762vJUSlL','existsSync','1627698VdugkO','mkdirSync','setRawCommand','674600jElmYe','map','red','48328HmQyZD','command','writeFileSync','log','1qfzPRZ','Failed\x20to\x20clear\x20logs:','8WFHjWP','format','unknown','Completed:\x20','error','level','Failed\x20to\x20read\x20logs:','clearLogs','getWinstonInstance','info','File','42qNUfBl','addColors','success','5118876daMYEz','duration','Starting:\x20','createLogger','logTask','utf8','timestamp','combine','.lovrabet.log','258753SbwFbI','details','join','printf','initWinstonLogger','rawCommand','logFilePath','trim','1240NJvToB','filter','warn','11606373UBcECY','green','blue','winstonLogger','clear','dirname'];a315_0x5e5f=function(){return _0x302b90;};return a315_0x5e5f();}export const logger=new Logger();
|
package/lib/utils/params.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4965c4,_0x1cb9c8){const _0x359b66=a316_0xa07d,_0x5d7462=_0x4965c4();while(!![]){try{const _0xc603f8=parseInt(_0x359b66(0x112))/0x1*(parseInt(_0x359b66(0x11e))/0x2)+parseInt(_0x359b66(0x10f))/0x3+-parseInt(_0x359b66(0x113))/0x4*(parseInt(_0x359b66(0x118))/0x5)+parseInt(_0x359b66(0x110))/0x6+-parseInt(_0x359b66(0x119))/0x7+parseInt(_0x359b66(0x11b))/0x8+-parseInt(_0x359b66(0x114))/0x9;if(_0xc603f8===_0x1cb9c8)break;else _0x5d7462['push'](_0x5d7462['shift']());}catch(_0x5055bf){_0x5d7462['push'](_0x5d7462['shift']());}}}(a316_0x1682,0xedaad));import{CliErrors}from'../errors.js';function a316_0xa07d(_0x4e99aa,_0x403aab){_0x4e99aa=_0x4e99aa-0x10f;const _0x1682f7=a316_0x1682();let _0xa07d21=_0x1682f7[_0x4e99aa];return _0xa07d21;}function a316_0x1682(){const _0x13a320=['isArray','33IFVLUo','32rqUgkz','35356869YQXreI','Example:\x20--params\x20\x27{\x22id\x22:123}\x27','Invalid\x20JSON\x20for\x20--params:\x20','--params\x20must\x20be\x20a\x20JSON\x20object','506645dmSwHS','1381639qCxIPW','object','11609168xDBQAI','parse','validation','105572gRRGZm','4297722gmFlhi','7706262HvPQCn'];a316_0x1682=function(){return _0x13a320;};return a316_0x1682();}export function parseJsonParams(_0x2708d1){const _0x6e4450=a316_0xa07d;if(!_0x2708d1)return undefined;let _0x2bfa1c;try{_0x2bfa1c=JSON[_0x6e4450(0x11c)](_0x2708d1);}catch{throw CliErrors['validation'](_0x6e4450(0x116)+_0x2708d1);}if(!_0x2bfa1c||typeof _0x2bfa1c!==_0x6e4450(0x11a)||Array[_0x6e4450(0x111)](_0x2bfa1c))throw CliErrors[_0x6e4450(0x11d)](_0x6e4450(0x117),_0x6e4450(0x115));return _0x2bfa1c;}
|
package/lib/utils/platform.d.ts
CHANGED
|
@@ -2,17 +2,18 @@
|
|
|
2
2
|
* Platform-specific utilities for cross-platform CLI execution.
|
|
3
3
|
*
|
|
4
4
|
* On Windows, npm-installed CLIs (npm, npx, pnpm, yarn) are .cmd batch
|
|
5
|
-
* wrappers.
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
* wrappers. Execa resolves these wrappers cross-platform when given the
|
|
6
|
+
* unmodified command name. Native spawn/spawnSync callers must not assume that
|
|
7
|
+
* appending `.cmd` makes a batch wrapper directly executable with shell disabled.
|
|
8
8
|
*
|
|
9
9
|
* NOTE: Native executables like bun.exe do NOT need this treatment.
|
|
10
10
|
* Only use resolveNpmBin for npm-ecosystem batch wrappers.
|
|
11
11
|
*/
|
|
12
12
|
export declare const isWindows: boolean;
|
|
13
13
|
/**
|
|
14
|
-
* Resolve the
|
|
15
|
-
*
|
|
14
|
+
* Resolve the historical executable name used by existing Execa callers.
|
|
15
|
+
* New cross-platform calls should prefer passing the unmodified command name
|
|
16
|
+
* directly to Execa. Do not use this helper with native spawn/spawnSync.
|
|
16
17
|
*
|
|
17
18
|
* @example
|
|
18
19
|
* resolveNpmBin("npx") // "npx" on macOS/Linux, "npx.cmd" on Windows
|
package/lib/utils/platform.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a317_0x38b06c=a317_0x43e8;function a317_0xee28(){const _0x3a671f=['181128GcZQep','1265110dVAoKD','171Swtgue','platform','331095BZZuhr','70zpEkaq','103016YXSaSx','75SIJOWa','4259100hOLFxN','1733510apTpfH','.cmd','1059108pJbqaA'];a317_0xee28=function(){return _0x3a671f;};return a317_0xee28();}(function(_0x4be0bc,_0x42801f){const _0x2fc76d=a317_0x43e8,_0x4958f2=_0x4be0bc();while(!![]){try{const _0x579409=-parseInt(_0x2fc76d(0x1da))/0x1+-parseInt(_0x2fc76d(0x1e1))/0x2+parseInt(_0x2fc76d(0x1dd))/0x3*(-parseInt(_0x2fc76d(0x1dc))/0x4)+-parseInt(_0x2fc76d(0x1e3))/0x5+-parseInt(_0x2fc76d(0x1de))/0x6+-parseInt(_0x2fc76d(0x1db))/0x7*(parseInt(_0x2fc76d(0x1e2))/0x8)+-parseInt(_0x2fc76d(0x1e4))/0x9*(-parseInt(_0x2fc76d(0x1df))/0xa);if(_0x579409===_0x42801f)break;else _0x4958f2['push'](_0x4958f2['shift']());}catch(_0x2dae59){_0x4958f2['push'](_0x4958f2['shift']());}}}(a317_0xee28,0x92750));function a317_0x43e8(_0x44e343,_0xbeed1){_0x44e343=_0x44e343-0x1da;const _0xee2828=a317_0xee28();let _0x43e80d=_0xee2828[_0x44e343];return _0x43e80d;}export const isWindows=process[a317_0x38b06c(0x1e5)]==='win32';export function resolveNpmBin(_0x51269f){const _0x9ee8d9=a317_0x38b06c;return isWindows?_0x51269f+_0x9ee8d9(0x1e0):_0x51269f;}
|
package/lib/utils/sleep.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export function sleep(
|
|
1
|
+
export function sleep(_0x24126d){return new Promise(_0x5c45ed=>setTimeout(_0x5c45ed,_0x24126d));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a319_0x582160=a319_0x3ea8;function a319_0x19b3(){const _0x37f842=['push','join','name:\x20\x22','.tpl','.scss','8EWAqJq','formatLocalTimestamp','processFile','toUpperCase','getSeconds','29037700MSZyKS','writeFile','pop','extname','map','info','isDirectory','slice','Template\x20content\x20replacement\x20completed','getFullYear','toISOString','default','name','promises','readdir','\x20},','now','5015178uxknAQ','endsWith','replaceContent','message','7699531LRWrty','success','mkdir','\x0a\x20\x20\x20\x20{\x20','toComponentName','toLowerCase','4980580PGxQsk','datasetCode:\x20\x22','.md','6tvEoox','error','5425152MtpoGz','422teEpXj','datasetCode','.jsx','readFile','tableName:\x20\x22','processDirectory','getHours','replace','includes','copyFile','padStart','pad','.js','.ts','.tsx','alias','1445428AJocRO','alias:\x20\x22','4079bCmLEt','.json','Template\x20content\x20replacement\x20failed','isFile','getMonth','charAt','template','split','.css','utf8','getMinutes'];a319_0x19b3=function(){return _0x37f842;};return a319_0x19b3();}(function(_0x16ba16,_0x31e086){const _0x47260d=a319_0x3ea8,_0xcb7a65=_0x16ba16();while(!![]){try{const _0x1928bc=parseInt(_0x47260d(0x19e))/0x1*(-parseInt(_0x47260d(0x1d4))/0x2)+-parseInt(_0x47260d(0x1d1))/0x3*(parseInt(_0x47260d(0x19c))/0x4)+-parseInt(_0x47260d(0x1ce))/0x5+parseInt(_0x47260d(0x1d3))/0x6+parseInt(_0x47260d(0x1c8))/0x7*(-parseInt(_0x47260d(0x1ae))/0x8)+parseInt(_0x47260d(0x1c4))/0x9+parseInt(_0x47260d(0x1b3))/0xa;if(_0x1928bc===_0x31e086)break;else _0xcb7a65['push'](_0xcb7a65['shift']());}catch(_0x4ec77f){_0xcb7a65['push'](_0xcb7a65['shift']());}}}(a319_0x19b3,0xa76cc));import a319_0x361831 from'node:fs';import a319_0x4eb0c2 from'node:path';function a319_0x3ea8(_0x3155c7,_0x497e09){_0x3155c7=_0x3155c7-0x19b;const _0x19b33a=a319_0x19b3();let _0x3ea82b=_0x19b33a[_0x3155c7];return _0x3ea82b;}import{logger}from'../utils/logger.js';import{getCliVersion}from'../utils/version.js';const CLI_VERSION=getCliVersion();export class TemplateReplacer{static[a319_0x582160(0x1df)](_0x256b5e){const _0x4e06f9=a319_0x582160;return String(_0x256b5e)[_0x4e06f9(0x1de)](0x2,'0');}static[a319_0x582160(0x1af)](_0x2955ec){const _0x3716fd=a319_0x582160,_0x22af8a=_0x2955ec[_0x3716fd(0x1bc)](),_0x2e9f36=this[_0x3716fd(0x1df)](_0x2955ec[_0x3716fd(0x1a2)]()+0x1),_0x398af1=this[_0x3716fd(0x1df)](_0x2955ec['getDate']()),_0x30a053=this[_0x3716fd(0x1df)](_0x2955ec[_0x3716fd(0x1da)]()),_0x3264db=this[_0x3716fd(0x1df)](_0x2955ec[_0x3716fd(0x1a8)]()),_0x458d04=this[_0x3716fd(0x1df)](_0x2955ec[_0x3716fd(0x1b2)]());return{'createdAt':_0x22af8a+'-'+_0x2e9f36+'-'+_0x398af1+'\x20'+_0x30a053+':'+_0x3264db+':'+_0x458d04,'createdDate':_0x22af8a+'-'+_0x2e9f36+'-'+_0x398af1,'createdTime':_0x30a053+':'+_0x3264db+':'+_0x458d04};}static[a319_0x582160(0x1cc)](_0x1fe942){const _0x1e09ad=a319_0x582160,_0x293405=_0x1fe942[_0x1e09ad(0x1a5)]('/')[_0x1e09ad(0x1b5)]()||_0x1fe942;return _0x293405[_0x1e09ad(0x1a5)]('-')['map'](_0x5472f7=>_0x5472f7['charAt'](0x0)[_0x1e09ad(0x1b1)]()+_0x5472f7['slice'](0x1)[_0x1e09ad(0x1cd)]())['join']('');}static['toDisplayTitle'](_0x29f235){const _0xf9f02f=a319_0x582160,_0x7d3b39=_0x29f235['split']('/')[_0xf9f02f(0x1b5)]()||_0x29f235;return _0x7d3b39['split']('-')[_0xf9f02f(0x1b7)](_0x4f6ce8=>_0x4f6ce8[_0xf9f02f(0x1a3)](0x0)[_0xf9f02f(0x1b1)]()+_0x4f6ce8[_0xf9f02f(0x1ba)](0x1)[_0xf9f02f(0x1cd)]())[_0xf9f02f(0x1aa)]('\x20');}static[a319_0x582160(0x1c6)](_0x2bb8b7,_0x588c01,_0x15b73b){const _0x567221=a319_0x582160,_0x571453=this['toComponentName'](_0x588c01),_0x4339a7=this['toDisplayTitle'](_0x588c01),{createdAt:_0x15154c,createdDate:_0x32649e,createdTime:_0xeab2cd}=this[_0x567221(0x1af)](new Date());let _0x6f9b6e=_0x2bb8b7[_0x567221(0x1db)](/\{CliVersion\}/g,CLI_VERSION)[_0x567221(0x1db)](/\{ComponentName\}/g,_0x571453)[_0x567221(0x1db)](/\{DisplayTitle\}/g,_0x4339a7)[_0x567221(0x1db)](/\{PageName\}/g,_0x588c01)['replace'](/\{TemplateName\}/g,_0x15b73b)[_0x567221(0x1db)](/\{CreatedAt\}/g,_0x15154c)[_0x567221(0x1db)](/\{CreatedDate\}/g,_0x32649e)[_0x567221(0x1db)](/\{CreatedTime\}/g,_0xeab2cd);return _0x6f9b6e;}static['replaceApiContent'](_0x581cb4,_0x1ec738,_0x49036b,_0x316261,_0x5535c4,_0x3e0dd1,_0x2fa7e7,_0x75b4df){const _0x25e046=a319_0x582160,_0x32075b=new Date(),_0x535b09=_0x32075b[_0x25e046(0x1bd)](),_0x18ff3f=_0x49036b[_0x25e046(0x1b7)](_0x37159e=>{const _0x572dce=_0x25e046,_0x8822cf=[_0x572dce(0x1cf)+_0x37159e[_0x572dce(0x1d5)]+'\x22',_0x572dce(0x1d8)+_0x37159e['tableName']+'\x22',_0x572dce(0x1ab)+_0x37159e[_0x572dce(0x1bf)]+'\x22'];return _0x37159e[_0x572dce(0x19b)]&&_0x8822cf[_0x572dce(0x1a9)](_0x572dce(0x19d)+_0x37159e[_0x572dce(0x19b)]+'\x22'),_0x572dce(0x1cb)+_0x8822cf[_0x572dce(0x1aa)](',\x20')+_0x572dce(0x1c2);})['join'](''),_0x49d26d=_0x316261||_0x49036b[0x0]?.[_0x25e046(0x19b)]||'YourModel';let _0x5d9f59=_0x581cb4[_0x25e046(0x1db)](/\{AppCode\}/g,_0x1ec738)[_0x25e046(0x1db)](/\{ModelConfigs\}/g,_0x18ff3f)[_0x25e046(0x1db)](/\{ExampleModelName\}/g,_0x49d26d)[_0x25e046(0x1db)](/\{ApiFileName\}/g,_0x5535c4||'api')[_0x25e046(0x1db)](/\{ConfigName\}/g,_0x3e0dd1||_0x25e046(0x1be))[_0x25e046(0x1db)](/\{ClientConfigParam\}/g,_0x2fa7e7||'')[_0x25e046(0x1db)](/\{VarPrefix\}/g,_0x75b4df||'LOVRABET')[_0x25e046(0x1db)](/\{CreatedAt\}/g,_0x535b09);return _0x5d9f59;}static async['processTemplate'](_0x42a200,_0x33ec8e,_0x1abd8d,_0x33abfa,_0x4c57e7=!![]){const _0x2fd691=a319_0x582160,_0x169f70=Date['now']();try{_0x4c57e7&&logger[_0x2fd691(0x1b8)](_0x2fd691(0x1a4),'Starting\x20template\x20content\x20replacement',{'templatePath':_0x42a200,'targetPath':_0x33ec8e,'pageName':_0x1abd8d,'templateName':_0x33abfa});await a319_0x361831['promises'][_0x2fd691(0x1ca)](_0x33ec8e,{'recursive':!![]}),await this['processDirectory'](_0x42a200,_0x33ec8e,_0x1abd8d,_0x33abfa);if(_0x4c57e7){const _0x52de49=Date['now']()-_0x169f70;logger[_0x2fd691(0x1c9)](_0x2fd691(0x1a4),_0x2fd691(0x1bb),_0x52de49,{'pageName':_0x1abd8d,'templateName':_0x33abfa});}}catch(_0x55da47){if(_0x4c57e7){const _0x10e927=Date[_0x2fd691(0x1c3)]()-_0x169f70;logger[_0x2fd691(0x1d2)]('template',_0x2fd691(0x1a0),{'templatePath':_0x42a200,'targetPath':_0x33ec8e,'pageName':_0x1abd8d,'templateName':_0x33abfa,'error':_0x55da47 instanceof Error?_0x55da47[_0x2fd691(0x1c7)]:String(_0x55da47),'duration':_0x10e927});}throw _0x55da47;}}static async[a319_0x582160(0x1d9)](_0x471573,_0x23ce06,_0x2419f3,_0xa21c39){const _0x5a0c56=a319_0x582160,_0x55eb6f=await a319_0x361831[_0x5a0c56(0x1c0)][_0x5a0c56(0x1c1)](_0x471573,{'withFileTypes':!![]});for(const _0x46c13b of _0x55eb6f){const _0x15a56d=a319_0x4eb0c2[_0x5a0c56(0x1aa)](_0x471573,_0x46c13b[_0x5a0c56(0x1bf)]);let _0x138113=a319_0x4eb0c2[_0x5a0c56(0x1aa)](_0x23ce06,_0x46c13b[_0x5a0c56(0x1bf)]);_0x46c13b[_0x5a0c56(0x1bf)]['endsWith'](_0x5a0c56(0x1ac))&&(_0x138113=a319_0x4eb0c2[_0x5a0c56(0x1aa)](_0x23ce06,_0x46c13b[_0x5a0c56(0x1bf)][_0x5a0c56(0x1db)](/\.tpl$/,'')));if(_0x46c13b[_0x5a0c56(0x1b9)]())await a319_0x361831[_0x5a0c56(0x1c0)]['mkdir'](_0x138113,{'recursive':!![]}),await this[_0x5a0c56(0x1d9)](_0x15a56d,_0x138113,_0x2419f3,_0xa21c39);else _0x46c13b[_0x5a0c56(0x1a1)]()&&await this[_0x5a0c56(0x1b0)](_0x15a56d,_0x138113,_0x2419f3,_0xa21c39);}}static async[a319_0x582160(0x1b0)](_0x30f10d,_0x2214f0,_0x57c4c4,_0x2e4b26){const _0x5858e9=a319_0x582160,_0x392268=a319_0x4eb0c2[_0x5858e9(0x1b6)](_0x30f10d)[_0x5858e9(0x1cd)]();_0x30f10d[_0x5858e9(0x1c5)](_0x5858e9(0x1ac))&&(_0x2214f0=_0x2214f0[_0x5858e9(0x1db)](/\.tpl$/,''));const _0x4fe3b9=[_0x5858e9(0x1e2),_0x5858e9(0x1e1),_0x5858e9(0x1d6),_0x5858e9(0x1e0),_0x5858e9(0x19f),_0x5858e9(0x1d0),_0x5858e9(0x1a6),_0x5858e9(0x1ad),_0x5858e9(0x1ac)];if(_0x4fe3b9[_0x5858e9(0x1dc)](_0x392268)||_0x30f10d[_0x5858e9(0x1c5)](_0x5858e9(0x1ac))){const _0x42d32f=await a319_0x361831['promises'][_0x5858e9(0x1d7)](_0x30f10d,_0x5858e9(0x1a7)),_0x21bf41=this[_0x5858e9(0x1c6)](_0x42d32f,_0x57c4c4,_0x2e4b26);await a319_0x361831['promises'][_0x5858e9(0x1b4)](_0x2214f0,_0x21bf41,_0x5858e9(0x1a7));}else await a319_0x361831[_0x5858e9(0x1c0)][_0x5858e9(0x1dd)](_0x30f10d,_0x2214f0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a320_0x304c(){const _0x453337=['number','true','valid','410432wDsaGU','utf8','774300mteFyr','stableVersion','1515650xrKADf','gte','55uXcypZ','rabetbase-cli','/v/','latest','1gtXvSm','trim','object','stringify','5qNbjWW','88590uFJMKc','toLowerCase','28NJNiNe','410762jWGxtH','lastNotifiedAt','2226663UoCaBC','yes','\x20available,\x20current\x20','parse','update-check.json','lastNotifiedVersion','183828TPskdJ','checkedAt'];a320_0x304c=function(){return _0x453337;};return a320_0x304c();}(function(_0xccaa91,_0x58c516){const _0x3ad17d=a320_0x4f6a,_0x48f804=_0xccaa91();while(!![]){try{const _0x21b2d5=parseInt(_0x3ad17d(0x15a))/0x1*(-parseInt(_0x3ad17d(0x162))/0x2)+-parseInt(_0x3ad17d(0x15f))/0x3+parseInt(_0x3ad17d(0x171))/0x4*(-parseInt(_0x3ad17d(0x15e))/0x5)+parseInt(_0x3ad17d(0x16a))/0x6*(parseInt(_0x3ad17d(0x161))/0x7)+-parseInt(_0x3ad17d(0x16f))/0x8+-parseInt(_0x3ad17d(0x164))/0x9+-parseInt(_0x3ad17d(0x154))/0xa*(-parseInt(_0x3ad17d(0x156))/0xb);if(_0x21b2d5===_0x58c516)break;else _0x48f804['push'](_0x48f804['shift']());}catch(_0x3fb2c7){_0x48f804['push'](_0x48f804['shift']());}}}(a320_0x304c,0x2565c));import{mkdir,readFile,writeFile}from'node:fs/promises';import{homedir}from'node:os';import{dirname,join}from'node:path';import a320_0x1570b9 from'semver';import{CLI_BIN_NAME,NPM_PACKAGE_NAME}from'../constant/cli.js';import{getCliVersionPolicy}from'../utils/cli-version-policy.js';import{getCliVersion}from'../utils/version.js';const UPDATE_CHECK_TTL_MS=0xc*0x3c*0x3c*0x3e8,UPDATE_NOTICE_TTL_MS=0x18*0x3c*0x3c*0x3e8;function isUpdateNoticeDisabled(){const _0x2bc436=a320_0x4f6a,_0x2326b0=process.env.RABETBASE_NO_UPDATE_NOTICE?.['trim']()[_0x2bc436(0x160)]();return _0x2326b0==='1'||_0x2326b0===_0x2bc436(0x16d)||_0x2326b0===_0x2bc436(0x165);}function cacheRoot(){return process.env.XDG_CACHE_HOME||process.env.LOCALAPPDATA||join(homedir(),'.cache');}export function getUpdateNoticeCachePath(){const _0x131d0c=a320_0x4f6a;return join(cacheRoot(),_0x131d0c(0x157),_0x131d0c(0x168));}async function readUpdateNoticeCache(){const _0x220972=a320_0x4f6a;try{const _0x2d203d=await readFile(getUpdateNoticeCachePath(),_0x220972(0x170)),_0x258f4=JSON[_0x220972(0x167)](_0x2d203d);if(!_0x258f4||typeof _0x258f4!==_0x220972(0x15c))return{};return _0x258f4;}catch{return{};}}function a320_0x4f6a(_0x39ffcd,_0x375573){_0x39ffcd=_0x39ffcd-0x153;const _0x304c78=a320_0x304c();let _0x4f6a88=_0x304c78[_0x39ffcd];return _0x4f6a88;}async function writeUpdateNoticeCache(_0x2ae0b8){const _0x2b17b1=a320_0x4f6a;try{const _0x5a711a=getUpdateNoticeCachePath();await mkdir(dirname(_0x5a711a),{'recursive':!![]}),await writeFile(_0x5a711a,JSON[_0x2b17b1(0x15d)](_0x2ae0b8,null,0x2)+'\x0a','utf8');}catch{}}function isFreshCheck(_0xc9be3d,_0x5c48dc){const _0x2ab7d0=a320_0x4f6a;return typeof _0xc9be3d['checkedAt']===_0x2ab7d0(0x16c)&&_0x5c48dc-_0xc9be3d[_0x2ab7d0(0x16b)]<UPDATE_CHECK_TTL_MS;}function isRecentlyNotified(_0x401b9d,_0x3f70f3,_0x4284e4){const _0x557c62=a320_0x4f6a;return _0x401b9d[_0x557c62(0x169)]===_0x3f70f3&&typeof _0x401b9d[_0x557c62(0x163)]===_0x557c62(0x16c)&&_0x4284e4-_0x401b9d['lastNotifiedAt']<UPDATE_NOTICE_TTL_MS;}export function buildNpmVersionUrl(_0xbc81f6){const _0x15b016=a320_0x4f6a;return'https://www.npmjs.com/package/'+NPM_PACKAGE_NAME+_0x15b016(0x158)+_0xbc81f6;}export async function resolveLatestUpdateNotice(){const _0x4f21e8=a320_0x4f6a;if(isUpdateNoticeDisabled())return null;try{const _0x474c51=Date['now'](),_0x11a4ff=getCliVersion(),_0xf43b69=await readUpdateNoticeCache();let _0x537d4e=isFreshCheck(_0xf43b69,_0x474c51)?_0xf43b69[_0x4f21e8(0x159)]?.[_0x4f21e8(0x15b)]():undefined;if(!_0x537d4e&&!isFreshCheck(_0xf43b69,_0x474c51)){const _0x1392fd=await getCliVersionPolicy();_0x537d4e=_0x1392fd?.[_0x4f21e8(0x153)]?.[_0x4f21e8(0x15b)]()||undefined,await writeUpdateNoticeCache({..._0xf43b69,'checkedAt':_0x474c51,'latest':_0x537d4e,'failed':!_0x537d4e});}if(!_0x537d4e||!a320_0x1570b9['valid'](_0x11a4ff)||!a320_0x1570b9[_0x4f21e8(0x16e)](_0x537d4e))return null;if(a320_0x1570b9[_0x4f21e8(0x155)](_0x11a4ff,_0x537d4e))return null;if(isRecentlyNotified(_0xf43b69,_0x537d4e,_0x474c51))return null;const _0x262104=CLI_BIN_NAME+'\x20update';return await writeUpdateNoticeCache({..._0xf43b69,'checkedAt':isFreshCheck(_0xf43b69,_0x474c51)?_0xf43b69['checkedAt']:_0x474c51,'latest':_0x537d4e,'failed':![],'lastNotifiedVersion':_0x537d4e,'lastNotifiedAt':_0x474c51}),{'command':_0x262104,'current':_0x11a4ff,'latest':_0x537d4e,'url':buildNpmVersionUrl(_0x537d4e),'message':CLI_BIN_NAME+'\x20'+_0x537d4e+_0x4f21e8(0x166)+_0x11a4ff+',\x20run:\x20'+_0x262104};}catch{return null;}}
|
package/lib/utils/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x348c4a,_0x58742f){var _0x53f578=a321_0x453b,_0x1216e=_0x348c4a();while(!![]){try{var _0xab2c34=parseInt(_0x53f578(0xf7))/0x1+parseInt(_0x53f578(0xf5))/0x2*(-parseInt(_0x53f578(0xf2))/0x3)+parseInt(_0x53f578(0xf1))/0x4+parseInt(_0x53f578(0xf3))/0x5+parseInt(_0x53f578(0xf4))/0x6+parseInt(_0x53f578(0xf6))/0x7+-parseInt(_0x53f578(0xf8))/0x8;if(_0xab2c34===_0x58742f)break;else _0x1216e['push'](_0x1216e['shift']());}catch(_0x44c5c8){_0x1216e['push'](_0x1216e['shift']());}}}(a321_0x1ef8,0x5c277));import{VERSION}from'../generated/build-info.js';function a321_0x1ef8(){var _0x1fda22=['278hEbyUb','1621893ALrvJC','244272WPBqKt','4095952WgOBoc','470336JqpVGS','10089hXrBVU','385760ADPTuN','4117242bjUQKj'];a321_0x1ef8=function(){return _0x1fda22;};return a321_0x1ef8();}function a321_0x453b(_0x4a37c2,_0x4cb373){_0x4a37c2=_0x4a37c2-0xf1;var _0x1ef842=a321_0x1ef8();var _0x453b32=_0x1ef842[_0x4a37c2];return _0x453b32;}export function getCliVersion(){return VERSION;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2ae8dc,_0x3f7733){var _0x23379d=a322_0xa88e,_0x4a06b5=_0x2ae8dc();while(!![]){try{var _0x5e3173=-parseInt(_0x23379d(0xd3))/0x1+parseInt(_0x23379d(0xd0))/0x2*(-parseInt(_0x23379d(0xd1))/0x3)+parseInt(_0x23379d(0xd5))/0x4+parseInt(_0x23379d(0xd8))/0x5*(parseInt(_0x23379d(0xd9))/0x6)+-parseInt(_0x23379d(0xd7))/0x7+-parseInt(_0x23379d(0xd4))/0x8+-parseInt(_0x23379d(0xd6))/0x9*(-parseInt(_0x23379d(0xd2))/0xa);if(_0x5e3173===_0x3f7733)break;else _0x4a06b5['push'](_0x4a06b5['shift']());}catch(_0x107855){_0x4a06b5['push'](_0x4a06b5['shift']());}}}(a322_0x399e,0x46730));import{setActiveCookie,clearActiveCookie}from'../core/api-client.js';export async function withActiveCookie(_0x148538,_0x29c553){setActiveCookie(_0x148538);try{return await _0x29c553();}finally{clearActiveCookie();}}function a322_0xa88e(_0x5d2c16,_0x15074f){_0x5d2c16=_0x5d2c16-0xd0;var _0x399e77=a322_0x399e();var _0xa88e47=_0x399e77[_0x5d2c16];return _0xa88e47;}function a322_0x399e(){var _0x2fc6a8=['40249tcmEQW','3101832QFFcRk','534840MMdnBv','6640506pFZHxl','813106EvygDE','1045rwYQtx','2580TFlEFU','36iSrBlx','21453UFVTuL','10GhtvzK'];a322_0x399e=function(){return _0x2fc6a8;};return a322_0x399e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a323_0x205e(){var _0x1fd3eb=['55901PUDAEL','7029285OmQdee','44402314DXvKLI','write','32aAfdju','4293855NWlMYz','21MGLHrL','2045907ftnobl','4QkGbXB','40jHUqIo','14011500UkPLcW','2983662cmDfZV'];a323_0x205e=function(){return _0x1fd3eb;};return a323_0x205e();}(function(_0x33fdae,_0x563cec){var _0x3cd1b7=a323_0x3b09,_0x4d5e=_0x33fdae();while(!![]){try{var _0x3b23fb=parseInt(_0x3cd1b7(0x179))/0x1*(parseInt(_0x3cd1b7(0x176))/0x2)+-parseInt(_0x3cd1b7(0x17e))/0x3+-parseInt(_0x3cd1b7(0x175))/0x4*(-parseInt(_0x3cd1b7(0x17a))/0x5)+parseInt(_0x3cd1b7(0x178))/0x6*(parseInt(_0x3cd1b7(0x17f))/0x7)+-parseInt(_0x3cd1b7(0x17d))/0x8*(-parseInt(_0x3cd1b7(0x180))/0x9)+parseInt(_0x3cd1b7(0x177))/0xa+-parseInt(_0x3cd1b7(0x17b))/0xb;if(_0x3b23fb===_0x563cec)break;else _0x4d5e['push'](_0x4d5e['shift']());}catch(_0x3af7bc){_0x4d5e['push'](_0x4d5e['shift']());}}}(a323_0x205e,0xd18b3));function a323_0x3b09(_0x2b3642,_0x40ea68){_0x2b3642=_0x2b3642-0x175;var _0x205e7b=a323_0x205e();var _0x3b0953=_0x205e7b[_0x2b3642];return _0x3b0953;}export function writeCliSideChannelLine(_0x5dc8ab){var _0x2d45d5=a323_0x3b09;process['stderr'][_0x2d45d5(0x17c)](_0x5dc8ab+'\x0a');}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lovrabet/rabetbase-cli",
|
|
3
|
-
"version": "2.5.2-beta.
|
|
3
|
+
"version": "2.5.2-beta.6",
|
|
4
4
|
"description": "Developer CLI for Lovrabet apps, datasets, pages, SQL, Backend Function, database connections, skills, and AI agent workflows.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"keywords": [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: rabetbase
|
|
3
|
-
version: 2.5.2-beta.
|
|
3
|
+
version: 2.5.2-beta.6
|
|
4
4
|
description: "Use for Lovrabet development work through the rabetbase CLI: create or bind projects (including creating an AppCode project in the current folder), pull Dataset/API facts and maintain SDK clients, or manage datasets, Instant API access policies, database connections, pages, SQL, Backend Functions, menus, notifications, knowledge bases and kb search, Agent Context Rules, roles, files, OCR, deployment metadata, platform issues, and 钉钉沙箱账号绑定. Trigger when the user mentions rabetbase, Lovrabet development, AppCode, Dataset, Instant API allow/deny/route policy, project creation, api pull/codegen, dblink, page, SQL, BFF, menu, notification, knowledge base, kb search, Agent Context Rules, RULES.md, DATABASE.md, rule list/get/set, role, file/OCR, or related development workflows."
|
|
5
5
|
metadata:
|
|
6
6
|
requires:
|
|
@@ -54,7 +54,7 @@ metadata:
|
|
|
54
54
|
- 需要了解数据集关联关系时用 `rabetbase dataset relations --format compress`(或 `json`);需要审计关系事实错误和人工复核项时用 `rabetbase dataset relation-audit --format compress`
|
|
55
55
|
- 需要从文本需求创建新的 `METADATA` 数据集时,先读 [`dataset generate-start/status`](references/rabetbase-dataset-generate.md),执行 preview 写出 design 文件,审阅后用 `generate-start --apply --design-file` 提交任务,再用 `generate-status` 查询到成功
|
|
56
56
|
- **管理物理库连接 / 测连 / 同步表结构分析**时用 `rabetbase db …`(先 [`db list`](references/rabetbase-db-list.md),trace/plan id 见 [`database-connection-workflow.md`](guides/database-connection-workflow.md))
|
|
57
|
-
-
|
|
57
|
+
- 研发资源保存后的增量同步由服务端自动处理;仅在管理员明确要求首次初始化、历史回填或故障恢复时读 [`deployment sync-all`](references/rabetbase-deployment-sync-all.md),在停止编辑的安静窗口执行;提交成功后按 jobId 查询状态,提交结果未知时用 `sync-jobs` 恢复任务事实
|
|
58
58
|
- DBAgent 增量分析默认先执行一次异步差异刷新:调用 `db diff-refresh-start`,保存 traceId,并用 `db diff-refresh-status` 查询同一任务到终态;成功后按原始意图执行 `db diff --all`(差异表)或 `db tables`(全部表)。无论 `tableCount` 大小都执行刷新;只有用户明确表示“不需要分析”“不刷新”或“只看现有结果”时才跳过异步刷新,并说明结果可能不是最新事实
|
|
59
59
|
- 需要查看全部表(含无差异表)或主动重新分析既有表时,用 `db tables`;它固定聚合全表分页。`db diff --all` 只聚合全部差异分页
|
|
60
60
|
- DB 增量分析先对完整 `toAnalyzeTables` 执行 `db analyze-batch-plan`;它生成的是本地批次方案,不是服务端 `planId`,也不会创建任务。再严格按批次顺序启动;每批独立保存 `planId`(即 `analyze-start` 返回值),当前批次到达已知终态前不得启动下一批
|
|
@@ -197,7 +197,7 @@ metadata:
|
|
|
197
197
|
- **不要猜字段名** — 必须从 `dataset detail` 返回值获取真实字段名、类型、枚举值
|
|
198
198
|
- **不要跳过 validate 与 dry-run** — 修改已有 SQL 并准备 `sql push` 前,必须先跑 `sql validate`;创建 SQL 或执行高风险同步前至少确认过 `sql create --dry-run`、`sql push --dry-run` 或 `sql delete --dry-run` 的预览
|
|
199
199
|
- **不要手动拼 API URL** — 所有操作通过 CLI 命令完成,不要直接调 HTTP 接口
|
|
200
|
-
-
|
|
200
|
+
- **不要把 `sync-all` 当成日常发布或精确镜像** — 它只用于管理员首次初始化、历史回填或故障恢复,按源端现存记录 UPSERT,不删除目标端额外记录;在停止编辑的安静窗口执行,提交结果不确定时先用 `deployment sync-jobs` 恢复任务事实,不自动重提
|
|
201
201
|
- **不要向产品用户展开研发实现** — 回答角色权限操作时,不输出工程仓库、Controller、数据库表、接口路径、MR 排查或迁移过程;只说明 CLI 命令、角色边界、风险和可验证结果
|
|
202
202
|
- **不要臆测 sqlCode / id** — 从 `sql list` 或 `bff list` 获取真实标识
|
|
203
203
|
- **不要臆测 dblink id 或分析 trace/plan id** — 从 `db list` / `db detail` / `db analyze-start` 的返回字段获取(见 [database-connection-workflow.md](guides/database-connection-workflow.md))
|
|
@@ -372,8 +372,7 @@ const result = await client.bff.execute<DashboardData>({
|
|
|
372
372
|
| 推送本地数据列表页 schema | [`rabetbase page push --id <pageId>`](references/rabetbase-page-push.md) | 推送后自动回拉 canonical schema 覆盖本地 |
|
|
373
373
|
| 恢复已删除页面 | [`rabetbase page restore --id <pageId>`](references/rabetbase-page-restore.md) | 支持 `DATA_LIST|CUSTOM` 自动识别;跨类型同 ID 时显式传 `--page-type` |
|
|
374
374
|
| 数据库连接(dblink)/ 测连 / 结构分析 | [`rabetbase db list`](references/rabetbase-db-list.md) 起 | **`id`**、**trace/plan id** 与“终态 + 复跑 diff”完成口径见 [database-connection-workflow.md](guides/database-connection-workflow.md);各子命令见 `references/rabetbase-db-*.md` |
|
|
375
|
-
|
|
|
376
|
-
| 独立部署应用范围同步 | [`rabetbase deployment sync-all`](references/rabetbase-deployment-sync.md) | `write`;只提交 appCode;保存 jobId 后查询状态,结果未知时用 `sync-jobs` 恢复任务事实,不自动重提 |
|
|
375
|
+
| 独立部署应用范围补偿同步 | [`rabetbase deployment sync-all`](references/rabetbase-deployment-sync-all.md) | 管理员首次初始化、历史回填或故障恢复时使用;`write`,只提交 appCode;在停止编辑的安静窗口执行,保存 jobId 后查询状态,结果未知时用 `sync-jobs` 恢复任务事实,不自动重提;不是精确镜像 |
|
|
377
376
|
| 生成 / 更新 API 客户端代码 | [`rabetbase api pull`](references/rabetbase-api-pull.md) → [`sdk-client-generation.md`](guides/sdk-client-generation.md) | `api pull` 拉 Dataset 事实并刷新 `sdk-config.ts`;已有 `api.ts`/`client.ts` 按 guide 合并更新 |
|
|
378
377
|
| 查看生成的 API 模型 | [`rabetbase api list`](references/rabetbase-api-list.md) | 列出已生成的数据模型 |
|
|
379
378
|
| 查看现有 SQL | [`rabetbase sql list --name "xxx"`](references/rabetbase-sql-list.md) | 分页,按名称过滤;默认查当前决议到的单个应用 |
|
|
@@ -438,7 +437,7 @@ const result = await client.bff.execute<DashboardData>({
|
|
|
438
437
|
| Data List Page commands | [`generate-start`](references/rabetbase-page-generate-start.md) / [`generate-status`](references/rabetbase-page-generate-status.md) / [`data-list-status`](references/rabetbase-data-list-status.md) / [`relation-audit`](references/rabetbase-page-relation-binding.md) / [`sync`](references/rabetbase-page-sync.md) / [`pull`](references/rabetbase-page-pull.md) / [`push`](references/rabetbase-page-push.md) |
|
|
439
438
|
| Custom Page commands | [`create`](references/rabetbase-page-create.md) / [`custom-list`](references/rabetbase-page-custom-list.md) / [`custom-detail`](references/rabetbase-page-custom-detail.md) / [`custom-update`](references/rabetbase-page-custom-update.md) / [`custom-publish`](references/rabetbase-page-custom-publish.md) |
|
|
440
439
|
| Database Connections (`db`) | [`list`](references/rabetbase-db-list.md) / [`detail`](references/rabetbase-db-detail.md) / [`create`](references/rabetbase-db-create.md) / [`update`](references/rabetbase-db-update.md) / [`delete`](references/rabetbase-db-delete.md) / [`test`](references/rabetbase-db-test.md) / [`analyze`](references/rabetbase-db-analyze.md) / [`tables`](references/rabetbase-db-tables.md) / [`diff`](references/rabetbase-db-diff.md) / [`diff-refresh-start/status`](references/rabetbase-db-diff-refresh.md) |
|
|
441
|
-
| Deployment | [`sync
|
|
440
|
+
| Deployment | [`sync-all` / `sync-status` / `sync-jobs`](references/rabetbase-deployment-sync-all.md)(管理员初始化、回填与恢复) |
|
|
442
441
|
| api commands | [`pull`](references/rabetbase-api-pull.md) / [`list`](references/rabetbase-api-list.md) |
|
|
443
442
|
| sql commands | [`list`](references/rabetbase-sql-list.md) / [`detail`](references/rabetbase-sql-detail.md) / [`create`](references/rabetbase-sql-create.md) / [`status`](references/rabetbase-sql-status.md) / [`pull`](references/rabetbase-sql-pull.md) / [`push`](references/rabetbase-sql-push.md) / [`delete`](references/rabetbase-sql-delete.md) / [`validate`](references/rabetbase-sql-validate.md) / [`save`(deprecated)](references/rabetbase-sql-save.md) / [`exec`](references/rabetbase-sql-exec.md) |
|
|
444
443
|
| bff commands | [`list`](references/rabetbase-bff-list.md) / [`detail`](references/rabetbase-bff-detail.md) / [`create`](references/rabetbase-bff-create.md) / [`status`](references/rabetbase-bff-status.md) / [`pull`](references/rabetbase-bff-pull.md) / [`push`](references/rabetbase-bff-push.md) / [`delete`](references/rabetbase-bff-delete.md) |
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# rabetbase deployment sync-all
|
|
2
|
+
|
|
3
|
+
研发资源保存后的增量同步由服务端自动处理。`deployment sync` 已移除,`bff push` 与 `sql push` 也不再追加客户端同步请求。
|
|
4
|
+
|
|
5
|
+
`sync-all` 是管理员补偿工具,仅用于以下场景:
|
|
6
|
+
|
|
7
|
+
- 独立部署环境首次初始化。
|
|
8
|
+
- 服务端自动同步启用前的历史数据回填。
|
|
9
|
+
- 已确认自动同步遗漏后的故障恢复。
|
|
10
|
+
|
|
11
|
+
它不属于日常研发发布步骤,也不能证明目标环境与源环境完全一致。服务端对源端现存记录执行 UPSERT,不删除目标端额外存在的历史记录。
|
|
12
|
+
|
|
13
|
+
## 使用前确认
|
|
14
|
+
|
|
15
|
+
- 已完成 rabetbase 认证,并明确目标应用的 `appCode`。
|
|
16
|
+
- 已确认属于初始化、回填或恢复场景,而不是普通资源保存或发布。
|
|
17
|
+
- 应用已停止编辑,当前处于安静窗口,避免全量任务与服务端自动增量同步并行。
|
|
18
|
+
- 已准备在任务结束后执行独立的业务验收。
|
|
19
|
+
|
|
20
|
+
## 先预览
|
|
21
|
+
|
|
22
|
+
dry-run 只生成本地计划,不调用服务端,也不验证部署目标:
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
rabetbase deployment sync-all \
|
|
26
|
+
--appcode <appCode> \
|
|
27
|
+
--dry-run \
|
|
28
|
+
--format compress
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 正式执行
|
|
32
|
+
|
|
33
|
+
经用户确认后复用同一 appCode;CI 或非交互环境需要全局 `--yes`:
|
|
34
|
+
|
|
35
|
+
```sh
|
|
36
|
+
rabetbase deployment sync-all \
|
|
37
|
+
--appcode <appCode> \
|
|
38
|
+
--confirm \
|
|
39
|
+
--yes \
|
|
40
|
+
--format compress
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
- `outcome=not_needed`:服务端判定当前应用无需创建任务,属于正常完成。
|
|
44
|
+
- `outcome=submitted`:保存 `jobId`,再查询同一任务。
|
|
45
|
+
- 提交结果未知:不得再次执行 `sync-all`;先用 `sync-jobs` 恢复任务事实。
|
|
46
|
+
|
|
47
|
+
## 查询任务
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
rabetbase deployment sync-status --job-id <jobId> --format compress
|
|
51
|
+
rabetbase deployment sync-jobs --appcode <appCode> --format compress
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
只根据 `isTerminal` 判断是否为已知终态;若为 `null`,保留服务端状态并交给用户判断。逐项资源类型和 action 是服务端开放字符串,不建立枚举闭集,也不因新值自动重提。
|
|
55
|
+
|
|
56
|
+
任务成功只表示服务端完成了当前支持范围内的 UPSERT。目标端额外记录不会被删除,且任务明细可能受服务端保留上限影响,因此完成后仍需按业务事实验收。
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"name": "rabetbase",
|
|
4
4
|
"packageName": "@lovrabet/rabetbase-cli",
|
|
5
|
-
"packageVersion": "2.5.2-beta.
|
|
6
|
-
"skillVersion": "2.5.2-beta.
|
|
5
|
+
"packageVersion": "2.5.2-beta.6",
|
|
6
|
+
"skillVersion": "2.5.2-beta.6",
|
|
7
7
|
"files": [
|
|
8
8
|
"SKILL.md",
|
|
9
9
|
"guides/backend-function.md",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"references/rabetbase-db-tables.md",
|
|
83
83
|
"references/rabetbase-db-test.md",
|
|
84
84
|
"references/rabetbase-db-update.md",
|
|
85
|
-
"references/rabetbase-deployment-sync.md",
|
|
85
|
+
"references/rabetbase-deployment-sync-all.md",
|
|
86
86
|
"references/rabetbase-doctor.md",
|
|
87
87
|
"references/rabetbase-file.md",
|
|
88
88
|
"references/rabetbase-init.md",
|
|
@@ -140,5 +140,5 @@
|
|
|
140
140
|
"references/rabetbase-user-account.md",
|
|
141
141
|
"references/rabetbase-workspace.md"
|
|
142
142
|
],
|
|
143
|
-
"digest": "
|
|
143
|
+
"digest": "2179549731ba41ea874331d418e157fb27c71879a1b2584cc9baee7c224eb0d8"
|
|
144
144
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { type DeploymentSyncItem, type DeploymentSyncType } from "../../core/api-client.js";
|
|
2
|
-
import type { RuntimeContext } from "../../framework/types.js";
|
|
3
|
-
export type AutomaticDeploymentSyncStatus = "not_needed" | "skipped_primary_failed" | "succeeded" | "partial_failure" | "failed" | "outcome_unknown";
|
|
4
|
-
export interface AutomaticDeploymentSyncResult {
|
|
5
|
-
attempted: boolean;
|
|
6
|
-
status: AutomaticDeploymentSyncStatus;
|
|
7
|
-
bizType: DeploymentSyncType;
|
|
8
|
-
bizCodes: string[];
|
|
9
|
-
items?: DeploymentSyncItem[];
|
|
10
|
-
recoveryCommand?: string;
|
|
11
|
-
error?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface AutomaticDeploymentSyncPreview {
|
|
14
|
-
status: "not_needed" | "would_sync";
|
|
15
|
-
bizType: DeploymentSyncType;
|
|
16
|
-
bizCodes: string[];
|
|
17
|
-
}
|
|
18
|
-
export declare function buildAutomaticDeploymentSyncPreview(bizType: DeploymentSyncType, rawCodes: string[]): AutomaticDeploymentSyncPreview;
|
|
19
|
-
export declare function runAutomaticDeploymentSync(ctx: RuntimeContext, bizType: DeploymentSyncType, rawCodes: string[], primarySucceeded: boolean): Promise<AutomaticDeploymentSyncResult>;
|
|
20
|
-
export declare function automaticDeploymentSyncSucceeded(result: AutomaticDeploymentSyncResult): boolean;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(function(_0x2f1e48,_0x1b3cf1){const _0x575ff5=a97_0xcd08,_0x2269be=_0x2f1e48();while(!![]){try{const _0xdc4da=-parseInt(_0x575ff5(0x78))/0x1+parseInt(_0x575ff5(0x89))/0x2*(-parseInt(_0x575ff5(0x80))/0x3)+parseInt(_0x575ff5(0x77))/0x4+-parseInt(_0x575ff5(0x81))/0x5+parseInt(_0x575ff5(0x90))/0x6*(parseInt(_0x575ff5(0x86))/0x7)+parseInt(_0x575ff5(0x88))/0x8*(-parseInt(_0x575ff5(0x83))/0x9)+parseInt(_0x575ff5(0x7b))/0xa;if(_0xdc4da===_0x1b3cf1)break;else _0x2269be['push'](_0x2269be['shift']());}catch(_0x1a2214){_0x2269be['push'](_0x2269be['shift']());}}}(a97_0x62ec,0x9261c));import{CLI_BIN_NAME}from'../../constant/cli.js';function a97_0x62ec(){const _0x57e178=['\x20codes;\x20run\x20deployment\x20sync\x20manually\x20in\x20batches.','length','failed','175173kvnHxI','382810nqigFX','has','214173Bdwvuc','filter','not_needed','7Gfeyac','FAILED','112tYgXjN','16NVvYUo','deployment','would_sync','skipped_primary_failed','action','replace','partial_failure','6443910KQCikv','--type','status','--appcode','succeeded','--codes','\x27\x5c\x27\x27','appCode','join','Automatic\x20deployment\x20sync\x20supports\x20at\x20most\x20','878184bzfCdO','910491tFdXmq','test','map','10933880ScwYxC','bizCode'];a97_0x62ec=function(){return _0x57e178;};return a97_0x62ec();}import{isPlatformTransportFailure,syncDeploymentMetadata}from'../../core/api-client.js';const MAX_SYNC_CODES=0x64;export function buildAutomaticDeploymentSyncPreview(_0x5b70e2,_0x5c807f){const _0x126a73=a97_0xcd08,_0x2fdaa2=normalizeCodes(_0x5c807f);if(_0x2fdaa2[_0x126a73(0x7e)]===0x0)return{'status':_0x126a73(0x85),'bizType':_0x5b70e2,'bizCodes':_0x2fdaa2};return{'status':_0x126a73(0x8b),'bizType':_0x5b70e2,'bizCodes':_0x2fdaa2};}export async function runAutomaticDeploymentSync(_0x4cb304,_0x867488,_0x43ba2e,_0x51fc84){const _0x47fcc6=a97_0xcd08,_0x3e6986=normalizeCodes(_0x43ba2e);if(!_0x51fc84)return{'attempted':![],'status':'skipped_primary_failed','bizType':_0x867488,'bizCodes':_0x3e6986};if(_0x3e6986[_0x47fcc6(0x7e)]===0x0)return{'attempted':![],'status':_0x47fcc6(0x85),'bizType':_0x867488,'bizCodes':_0x3e6986};const _0x522019={'bizType':_0x867488,'bizCodes':_0x3e6986};if(_0x3e6986[_0x47fcc6(0x7e)]>MAX_SYNC_CODES)return{..._0x522019,'attempted':![],'status':_0x47fcc6(0x7f),'error':_0x47fcc6(0x76)+MAX_SYNC_CODES+_0x47fcc6(0x7d)};try{const {items:_0x38fd14}=await syncDeploymentMetadata({'appCode':_0x4cb304[_0x47fcc6(0x74)],'bizType':_0x867488,'bizCodes':_0x3e6986}),_0x4b9148=_0x38fd14['some'](_0x23bdf9=>_0x23bdf9[_0x47fcc6(0x8d)]===_0x47fcc6(0x87)),_0x409f26=new Set(_0x38fd14[_0x47fcc6(0x84)](_0xac4f3c=>_0xac4f3c['action']===_0x47fcc6(0x87))[_0x47fcc6(0x7a)](_0x28da54=>_0x28da54[_0x47fcc6(0x7c)])),_0x41db33=_0x3e6986[_0x47fcc6(0x84)](_0x5ccf9f=>_0x409f26[_0x47fcc6(0x82)](_0x5ccf9f));return{..._0x522019,'attempted':!![],'status':_0x4b9148?_0x47fcc6(0x8f):_0x47fcc6(0x94),'items':_0x38fd14,..._0x4b9148&&_0x41db33[_0x47fcc6(0x7e)]>0x0?{'recoveryCommand':buildRecoveryCommand(_0x4cb304[_0x47fcc6(0x74)],_0x867488,_0x41db33)}:{}};}catch(_0x219d86){return{..._0x522019,'attempted':!![],'status':isPlatformTransportFailure(_0x219d86)?'outcome_unknown':_0x47fcc6(0x7f),'recoveryCommand':buildRecoveryCommand(_0x4cb304[_0x47fcc6(0x74)],_0x867488,_0x3e6986),'error':_0x219d86 instanceof Error?_0x219d86['message']:String(_0x219d86)};}}function normalizeCodes(_0x186f8f){const _0x394cb0=a97_0xcd08;return[...new Set(_0x186f8f[_0x394cb0(0x7a)](_0x51cedb=>_0x51cedb['trim']())[_0x394cb0(0x84)](Boolean))];}export function automaticDeploymentSyncSucceeded(_0x49325f){const _0x383e69=a97_0xcd08;return _0x49325f['status']==='not_needed'||_0x49325f['status']===_0x383e69(0x8c)||_0x49325f[_0x383e69(0x92)]===_0x383e69(0x94);}function buildRecoveryCommand(_0x12513d,_0x1015a7,_0x14887a){const _0x231625=a97_0xcd08;return[CLI_BIN_NAME,_0x231625(0x8a),'sync',_0x231625(0x93),shellArg(_0x12513d),_0x231625(0x91),shellArg(_0x1015a7),_0x231625(0x95),shellArg(_0x14887a[_0x231625(0x75)](',')),'--confirm'][_0x231625(0x75)]('\x20');}function a97_0xcd08(_0x5f468a,_0x4c625c){_0x5f468a=_0x5f468a-0x74;const _0x62ec49=a97_0x62ec();let _0xcd088f=_0x62ec49[_0x5f468a];return _0xcd088f;}function shellArg(_0x2b64a7){const _0x441200=a97_0xcd08;return/^[A-Za-z0-9._:/,-]+$/[_0x441200(0x79)](_0x2b64a7)?_0x2b64a7:'\x27'+_0x2b64a7[_0x441200(0x8e)](/'/g,_0x441200(0x96))+'\x27';}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const a102_0x1f34b9=a102_0x156e;(function(_0x38ce63,_0x4d4b29){const _0x2a9469=a102_0x156e,_0x113fb4=_0x38ce63();while(!![]){try{const _0x2260c1=parseInt(_0x2a9469(0x126))/0x1*(-parseInt(_0x2a9469(0x116))/0x2)+parseInt(_0x2a9469(0x127))/0x3+-parseInt(_0x2a9469(0x119))/0x4+parseInt(_0x2a9469(0x106))/0x5*(parseInt(_0x2a9469(0x111))/0x6)+-parseInt(_0x2a9469(0x11c))/0x7*(parseInt(_0x2a9469(0x139))/0x8)+parseInt(_0x2a9469(0x110))/0x9+-parseInt(_0x2a9469(0x12e))/0xa;if(_0x2260c1===_0x4d4b29)break;else _0x113fb4['push'](_0x113fb4['shift']());}catch(_0xf71183){_0x113fb4['push'](_0x113fb4['shift']());}}}(a102_0x40ff,0x52cd0));import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{isPlatformTransportFailure,syncDeploymentMetadata}from'../../core/api-client.js';import{CliError,CliErrors}from'../../errors.js';const SYNC_PATH='/smartapi/data-sync/sync',SYNC_TYPES=['dataset',a102_0x1f34b9(0x10e),a102_0x1f34b9(0x141)],TYPE_FLAG={'name':'type','type':a102_0x1f34b9(0x125),'required':!![],'enum':[...SYNC_TYPES],'description':a102_0x1f34b9(0x129)},CODES_FLAG={'name':a102_0x1f34b9(0x11a),'type':a102_0x1f34b9(0x125),'required':!![],'description':'Comma-separated\x20Dataset,\x20Backend\x20Function,\x20or\x20SQL\x20codes\x20(maximum\x20100)'},CONFIRM_FLAG={'name':a102_0x1f34b9(0x12c),'type':'boolean','description':'Confirm\x20the\x20metadata\x20codes\x20and\x20start\x20synchronization'};export const deploymentSync={'service':a102_0x1f34b9(0x115),'command':a102_0x1f34b9(0x113),'description':a102_0x1f34b9(0x117),'risk':a102_0x1f34b9(0x112),'strictFlags':!![],'structuredErrors':!![],'confirmationDescription':'Synchronize\x20selected\x20development\x20metadata\x20into\x20the\x20server-managed\x20deployment\x20target.','flags':[TYPE_FLAG,CODES_FLAG,CONFIRM_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x53cf60){buildSyncPlan(_0x53cf60);},async 'dryRun'(_0x177c7c){const _0x4567cf=a102_0x1f34b9,_0x31ac35=buildSyncPlan(_0x177c7c);return asDryRunResult(buildOutput(_0x31ac35,[],!![],_0x4567cf(0x122)),{'method':_0x4567cf(0x135),'url':SYNC_PATH,'description':_0x4567cf(0x114)+_0x31ac35[_0x4567cf(0x131)][_0x4567cf(0x10f)][_0x4567cf(0x10d)]+'\x20'+_0x31ac35[_0x4567cf(0x131)][_0x4567cf(0x12b)]+_0x4567cf(0x108)});},async 'execute'(_0x408620){const _0x88be4a=a102_0x1f34b9,_0x2afe75=buildSyncPlan(_0x408620);if(!_0x408620[_0x88be4a(0x13b)]('confirm'))throw CliErrors['validation'](_0x88be4a(0x13e),'Run\x20with\x20--dry-run\x20first,\x20verify\x20the\x20target\x20and\x20codes,\x20then\x20add\x20--confirm.');let _0x1a3b6e;try{_0x1a3b6e=(await syncDeploymentMetadata(_0x2afe75[_0x88be4a(0x131)]))['items'];}catch(_0x5e4d2b){if(!isPlatformTransportFailure(_0x5e4d2b))throw _0x5e4d2b;const _0x2697d8=new CliError(_0x88be4a(0x11d),0x2,'Deployment\x20sync\x20response\x20was\x20unavailable;\x20the\x20target\x20outcome\x20is\x20unknown.',_0x88be4a(0x11e));attachErrorData(_0x2697d8,buildOutput(_0x2afe75,[],![],'unknown'));throw _0x2697d8;}const _0x4d34de=_0x1a3b6e[_0x88be4a(0x12a)](_0x3994c5=>_0x3994c5[_0x88be4a(0x109)]===_0x88be4a(0x105)),_0x2bdf29=_0x4d34de['length']>0x0?_0x88be4a(0x13c):'succeeded',_0x465a5c=buildOutput(_0x2afe75,_0x1a3b6e,![],_0x2bdf29);if(_0x4d34de[_0x88be4a(0x10d)]>0x0){const _0x224ddb=new CliError(_0x88be4a(0x13d),0x1,_0x88be4a(0x12d)+_0x4d34de[_0x88be4a(0x10d)]+'/'+_0x1a3b6e['length']+_0x88be4a(0x140),_0x88be4a(0x138));attachErrorData(_0x224ddb,_0x465a5c);throw _0x224ddb;}return{'ok':!![],'data':_0x465a5c,'message':_0x88be4a(0x133)+_0x1a3b6e['length']+_0x88be4a(0x12f)};}};function buildSyncPlan(_0x2c0894){const _0x4a3d2a=a102_0x1f34b9,_0x15947f=_0x2c0894[_0x4a3d2a(0x13a)](_0x4a3d2a(0x123))[_0x4a3d2a(0x130)]();if(!SYNC_TYPES[_0x4a3d2a(0x132)](_0x15947f))throw CliErrors[_0x4a3d2a(0x10a)](_0x4a3d2a(0x124)+SYNC_TYPES['join'](',\x20')+'.');const _0x46f969=normalizeCodes(_0x2c0894[_0x4a3d2a(0x13a)](_0x4a3d2a(0x11a)));if(_0x46f969[_0x4a3d2a(0x10d)]===0x0)throw CliErrors[_0x4a3d2a(0x10a)](_0x4a3d2a(0x11b));if(_0x46f969[_0x4a3d2a(0x10d)]>0x64)throw CliErrors[_0x4a3d2a(0x10a)](_0x4a3d2a(0x107));const _0x565cf8={'appCode':_0x2c0894['appCode'],'bizType':_0x15947f,'bizCodes':_0x46f969},_0x22c12d=[_0x4a3d2a(0x118),_0x4a3d2a(0x128)];return _0x15947f===_0x4a3d2a(0x10b)&&_0x22c12d['unshift']('Dataset\x20sync\x20may\x20commit\x20target\x20connection\x20metadata\x20before\x20item\x20synchronization;\x20that\x20change\x20is\x20not\x20rolled\x20back\x20when\x20later\x20items\x20fail.'),{'input':_0x565cf8,'selector':{'appCode':_0x2c0894[_0x4a3d2a(0x120)],'bizType':_0x15947f,'bizCodes':_0x46f969},'warnings':_0x22c12d};}function normalizeCodes(_0x43d908){const _0x426dda=a102_0x1f34b9;return[...new Set(_0x43d908[_0x426dda(0x10c)](',')[_0x426dda(0x136)](_0x463aa5=>_0x463aa5['trim']())[_0x426dda(0x12a)](Boolean))];}function buildOutput(_0x456b78,_0x32106c,_0x3a3d0e,_0x19bc31){const _0x1741a8=a102_0x1f34b9,_0xb5baf2=_0x19bc31==='succeeded'||_0x19bc31===_0x1741a8(0x13c),_0x31c9a2=_0x32106c[_0x1741a8(0x134)]((_0xa75d8a,_0x10e67b)=>{const _0x5ee6f8=_0x1741a8;return _0xa75d8a[_0x10e67b[_0x5ee6f8(0x109)]]=(_0xa75d8a[_0x10e67b['action']]??0x0)+0x1,_0xa75d8a;},{});return{'operation':'deployment_metadata_sync','selector':_0x456b78[_0x1741a8(0x121)],'before':null,'after':null,'dryRun':_0x3a3d0e,'backend':{'submitted':_0x19bc31!==_0x1741a8(0x122),'method':'POST','path':SYNC_PATH,'outcome':_0x19bc31},'summary':{'requested':_0x456b78[_0x1741a8(0x131)][_0x1741a8(0x10f)][_0x1741a8(0x10d)],'total':_0xb5baf2?_0x32106c[_0x1741a8(0x10d)]:_0x456b78[_0x1741a8(0x131)][_0x1741a8(0x10f)][_0x1741a8(0x10d)],'created':_0x32106c[_0x1741a8(0x12a)](_0x56e374=>_0x56e374['action']==='CREATED')[_0x1741a8(0x10d)],'updated':_0x32106c[_0x1741a8(0x12a)](_0x5d00cb=>_0x5d00cb['action']==='UPDATED')[_0x1741a8(0x10d)],'failed':_0x32106c[_0x1741a8(0x12a)](_0x4d4106=>_0x4d4106[_0x1741a8(0x109)]===_0x1741a8(0x105))[_0x1741a8(0x10d)],'byAction':_0x31c9a2},'items':_0x32106c,'verification':{'performed':![],'reason':'target_read_api_unavailable'},'warnings':_0x456b78[_0x1741a8(0x11f)]};}function a102_0x156e(_0x1b3599,_0x59787f){_0x1b3599=_0x1b3599-0x105;const _0x40ffb2=a102_0x40ff();let _0x156ea3=_0x40ffb2[_0x1b3599];return _0x156ea3;}function attachErrorData(_0x594cdf,_0x8885fe){const _0x54aad9=a102_0x1f34b9;Object[_0x54aad9(0x137)](_0x594cdf,_0x54aad9(0x13f),{'value':_0x8885fe,'enumerable':!![]});}function a102_0x40ff(){const _0x19952b=['action','validation','dataset','split','length','bff','bizCodes','4164489sLQILQ','6TuYTOI','write','sync','Would\x20synchronize\x20','deployment','450122qbZcpp','Synchronize\x20selected\x20development\x20metadata\x20to\x20the\x20server-managed\x20deployment\x20target','Target\x20state\x20is\x20not\x20read\x20back\x20because\x20no\x20target\x20metadata\x20read\x20API\x20is\x20available.','842060DbtgXz','codes','--codes\x20must\x20contain\x20at\x20least\x20one\x20non-blank\x20code.','7nWoBPO','deployment_sync_outcome_unknown','Inspect\x20the\x20target\x20database\x20before\x20retrying.\x20Do\x20not\x20resubmit\x20automatically.','warnings','appCode','selector','not_submitted','type','--type\x20must\x20be\x20one\x20of:\x20','string','1wBRCGm','1472595xxRbGu','Do\x20not\x20retry\x20automatically\x20when\x20the\x20request\x20outcome\x20is\x20unknown.','Metadata\x20type\x20to\x20synchronize','filter','bizType','confirm','Deployment\x20sync\x20completed\x20with\x20','4253690rIOUjU','\x20deployment\x20metadata\x20item(s).','trim','input','includes','Synchronized\x20','reduce','POST','map','defineProperty','Review\x20data.items\x20with\x20--format\x20json\x20or\x20--format\x20compress\x20before\x20deciding\x20whether\x20to\x20retry\x20failed\x20codes.','3302360SOvZfB','str','bool','partial_failure','deployment_sync_partial_failure','--confirm\x20is\x20required\x20to\x20synchronize\x20deployment\x20metadata.','data','\x20failed\x20item(s).','sql','FAILED','3296530rNJPHx','--codes\x20supports\x20at\x20most\x20100\x20unique\x20codes.','\x20item(s).'];a102_0x40ff=function(){return _0x19952b;};return a102_0x40ff();}
|