@lovrabet/rabetbase-cli 2.3.3 → 2.3.4-beta.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +99 -560
- 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/discover.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.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-selector.js +1 -1
- package/lib/commands/common/flags.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/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/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/logs/index.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/shared/compare-table.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/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/update.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/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/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/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/workspace/index.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-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/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/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 +19 -3
- package/lib/commands/app/use.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1a0658,_0x5d8805){const _0x480d42=a115_0x487a,_0x1e3dc3=_0x1a0658();while(!![]){try{const _0x1831e8=parseInt(_0x480d42(0xe0))/0x1+-parseInt(_0x480d42(0x10d))/0x2+-parseInt(_0x480d42(0xea))/0x3+-parseInt(_0x480d42(0x14b))/0x4+-parseInt(_0x480d42(0xec))/0x5+-parseInt(_0x480d42(0xeb))/0x6+parseInt(_0x480d42(0x10a))/0x7*(parseInt(_0x480d42(0xe4))/0x8);if(_0x1831e8===_0x5d8805)break;else _0x1e3dc3['push'](_0x1e3dc3['shift']());}catch(_0x154dab){_0x1e3dc3['push'](_0x1e3dc3['shift']());}}}(a115_0x5e49,0x47fdf));import{randomUUID}from'node:crypto';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getDatasetDetail,getPageDetail,tryGetStandardPageStatus}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';import{CliErrors}from'../../errors.js';export function getPageIdFlag(_0x9074ee){const _0x21d18f=a115_0x487a,_0x4d1023=_0x9074ee[_0x21d18f(0xfd)]('id');if(typeof _0x4d1023===_0x21d18f(0x115)&&Number[_0x21d18f(0x127)](_0x4d1023)&&_0x4d1023>0x0)return _0x4d1023;return undefined;}export function validateDatasetSelector(_0x338fb3){const _0x237ba0=a115_0x487a,_0x3b49ff=Boolean(_0x338fb3['str'](_0x237ba0(0xd2))),_0xfa0814=Boolean(_0x338fb3[_0x237ba0(0xd9)](_0x237ba0(0xf6)));if(_0x3b49ff&&_0xfa0814)throw CliErrors[_0x237ba0(0xe2)](_0x237ba0(0x103));if(!_0x3b49ff&&!_0xfa0814)throw CliErrors[_0x237ba0(0xe2)](_0x237ba0(0x112));}function a115_0x487a(_0x4aa5e0,_0x34d4c2){_0x4aa5e0=_0x4aa5e0-0xcd;const _0x5e49ba=a115_0x5e49();let _0x487a81=_0x5e49ba[_0x4aa5e0];return _0x487a81;}export function validateGenerateOperationSelector(_0x563d07){const _0x1a1f23=a115_0x487a,_0x420f89=Boolean(_0x563d07[_0x1a1f23(0xd9)]('operation-id')),_0x2c1cc5=Boolean(_0x563d07[_0x1a1f23(0xd9)](_0x1a1f23(0xe5)));if(_0x420f89&&_0x2c1cc5)throw CliErrors[_0x1a1f23(0xe2)](_0x1a1f23(0xd3));if(!_0x420f89&&!_0x2c1cc5)throw CliErrors['validation'](_0x1a1f23(0x11a));}export function validatePageTargetSelector(_0x2c38aa){const _0x2c9bad=a115_0x487a,_0x2159e9=getPageIdFlag(_0x2c38aa)!==undefined,_0x170b4e=Boolean(_0x2c38aa[_0x2c9bad(0xd9)](_0x2c9bad(0xd2))||_0x2c38aa[_0x2c9bad(0xd9)](_0x2c9bad(0xf6)));if(_0x2159e9&&_0x170b4e)throw CliErrors[_0x2c9bad(0xe2)](_0x2c9bad(0x140));if(!_0x2159e9&&!_0x170b4e)throw CliErrors['validation'](_0x2c9bad(0xed));if(_0x2c38aa[_0x2c9bad(0xd9)](_0x2c9bad(0x142))&&!_0x170b4e)throw CliErrors[_0x2c9bad(0xe2)]('--version-tag\x20is\x20only\x20supported\x20with\x20--datasetcode\x20or\x20--alias.');}export function resolveDatasetCode(_0x16a2af){const _0x1274bf=a115_0x487a;validateDatasetSelector(_0x16a2af);const _0x48fdfe=_0x16a2af[_0x1274bf(0xd9)](_0x1274bf(0xd2));if(_0x48fdfe)return _0x48fdfe;const _0x413b4e=_0x16a2af['str'](_0x1274bf(0xf6)),_0x36ad55=resolveApiFilePath(_0x16a2af[_0x1274bf(0xd7)],_0x16a2af[_0x1274bf(0x108)]),_0x576ae4=resolveAlias(_0x16a2af[_0x1274bf(0xd7)],_0x413b4e,undefined,_0x36ad55);if(_0x576ae4)return _0x576ae4;const _0x50ca26=loadAliasMap(_0x16a2af[_0x1274bf(0xd7)],undefined,_0x36ad55),_0x5acce7=_0x50ca26['length']>0x0?_0x1274bf(0x14f)+_0x50ca26[_0x1274bf(0x13b)](_0x12c70e=>_0x12c70e[_0x1274bf(0xf6)])[_0x1274bf(0x12f)](',\x20'):_0x1274bf(0x14d)+CLI_BIN_NAME+_0x1274bf(0x129);throw CliErrors['validation'](_0x1274bf(0x119)+_0x413b4e+'\x22\x20not\x20found.\x20'+_0x5acce7);}export async function loadDatasetDetailForPage(_0x5cb92f){const _0x4c0e40=a115_0x487a,_0x3e679b=resolveDatasetCode(_0x5cb92f),_0x1c6e7f=await getDatasetDetail(_0x3e679b),_0x988727=normalizeDatasetDetail(_0x1c6e7f,_0x3e679b);return ensureAppOwnership(_0x5cb92f[_0x4c0e40(0x108)],_0x988727[_0x4c0e40(0x108)],_0x4c0e40(0xff)+_0x988727[_0x4c0e40(0xf4)]+_0x4c0e40(0x12d)+_0x988727[_0x4c0e40(0x108)]+_0x4c0e40(0xf8)+_0x5cb92f[_0x4c0e40(0x108)]+'\x22.'),_0x988727;}export async function loadPageDetailForPage(_0xbb10b2,_0x36ddf3){const _0x327775=a115_0x487a,_0x27b6c1=await getPageDetail(_0x36ddf3),_0x548447=normalizePageDetail(_0x27b6c1);return ensureAppOwnership(_0xbb10b2['appCode'],_0x548447[_0x327775(0x108)],_0x327775(0x11f)+_0x36ddf3+_0x327775(0x12d)+_0x548447[_0x327775(0x108)]+'\x22,\x20not\x20current\x20app\x20\x22'+_0xbb10b2[_0x327775(0x108)]+'\x22.'),_0x548447;}export function getUndeletedRelatedPages(_0x38d6c3){const _0x58f574=a115_0x487a;return _0x38d6c3['relatedPages'][_0x58f574(0x145)](_0x1483b7=>!_0x1483b7[_0x58f574(0xde)]);}export function buildPageGenerateOperationStatusQueryCommand(_0x252538,_0x47c093){const _0x191231=a115_0x487a,_0x492696=_0x47c093?.['appCode']&&_0x47c093[_0x191231(0x108)][_0x191231(0xe3)]()!==''?_0x191231(0x139)+_0x47c093[_0x191231(0x108)]:'',_0x276fd7=_0x47c093?.[_0x191231(0xf9)]&&_0x47c093[_0x191231(0xf9)][_0x191231(0xe3)]()!==''?'\x20--operation-id\x20'+_0x47c093[_0x191231(0xf9)]:_0x47c093?.[_0x191231(0x131)]&&_0x47c093[_0x191231(0x131)][_0x191231(0xe3)]()!==''?'\x20--client-operation-id\x20'+_0x47c093[_0x191231(0x131)]:'';return CLI_BIN_NAME+'\x20page\x20generate-status\x20--datasetcode\x20'+_0x252538+_0x492696+_0x276fd7+'\x20--format\x20json';}export function createPageGenerateClientOperationId(){const _0x5747e4=a115_0x487a;return _0x5747e4(0xd8)+randomUUID();}export function buildStandardPageStatusQueryCommand(_0x4f3a64,_0x5e4ba9){const _0x53d33e=a115_0x487a,_0x4b3f7b=_0x5e4ba9&&_0x5e4ba9[_0x53d33e(0xe3)]()!==''?_0x53d33e(0x139)+_0x5e4ba9:'';return CLI_BIN_NAME+_0x53d33e(0xe8)+_0x4f3a64+_0x4b3f7b+_0x53d33e(0x13d);}export function prepareDatasetAction(_0x6c9461,_0x4e2979){const _0x374e4e=a115_0x487a,_0x2c44a6=getUndeletedRelatedPages(_0x6c9461);if(_0x4e2979===_0x374e4e(0x10c)&&_0x2c44a6['length']>0x0)throw CliErrors['validation'](_0x374e4e(0xff)+_0x6c9461[_0x374e4e(0xf4)]+_0x374e4e(0x11c),_0x374e4e(0x14d)+CLI_BIN_NAME+'\x20page\x20sync\x20--datasetcode\x20'+_0x6c9461[_0x374e4e(0xf4)]+_0x374e4e(0x136));if(_0x4e2979===_0x374e4e(0x10e)&&_0x2c44a6[_0x374e4e(0x14c)]===0x0)throw CliErrors[_0x374e4e(0xe2)](_0x374e4e(0xff)+_0x6c9461[_0x374e4e(0xf4)]+_0x374e4e(0x128),'Run\x20`'+CLI_BIN_NAME+_0x374e4e(0xd6)+_0x6c9461[_0x374e4e(0xf4)]+_0x374e4e(0x13e)+CLI_BIN_NAME+'\x20page\x20generate-status\x20--datasetcode\x20'+_0x6c9461['code']+_0x374e4e(0x11e));return{'dataset':_0x6c9461,'undeletedPages':_0x2c44a6};}export function prepareGenerateDatasetAction(_0x281057,_0xb1d3ae){const _0x2e1ca3=a115_0x487a,_0x4a60b3=getUndeletedRelatedPages(_0x281057);if(!_0xb1d3ae){if(_0x4a60b3['length']>0x0)throw CliErrors[_0x2e1ca3(0xe2)](_0x2e1ca3(0xff)+_0x281057[_0x2e1ca3(0xf4)]+'\x22\x20already\x20has\x20undeleted\x20related\x20pages.',_0x2e1ca3(0x14d)+CLI_BIN_NAME+'\x20page\x20sync\x20--datasetcode\x20'+_0x281057[_0x2e1ca3(0xf4)]+_0x2e1ca3(0x136));return{'dataset':_0x281057,'undeletedPages':_0x4a60b3,'standardPageStatus':null};}const _0x5b84af=_0xb1d3ae[_0x2e1ca3(0x12a)],_0x3d2d22=_0xb1d3ae[_0x2e1ca3(0x13c)],_0x4fb6ff=_0xb1d3ae[_0x2e1ca3(0x13f)][_0x2e1ca3(0x14c)];if(_0x5b84af===0x0&&_0x3d2d22===0x0&&_0x4fb6ff===0x0)return{'dataset':_0x281057,'undeletedPages':_0x4a60b3,'standardPageStatus':_0xb1d3ae};if(_0x5b84af===0x1&&_0x3d2d22===0x0&&_0x4fb6ff===0x0)throw CliErrors[_0x2e1ca3(0xe2)](_0x2e1ca3(0xff)+_0x281057[_0x2e1ca3(0xf4)]+_0x2e1ca3(0x111),_0x2e1ca3(0x14d)+CLI_BIN_NAME+_0x2e1ca3(0x133)+_0x281057[_0x2e1ca3(0xf4)]+_0x2e1ca3(0x136));throw CliErrors[_0x2e1ca3(0xe2)](_0x2e1ca3(0xff)+_0x281057[_0x2e1ca3(0xf4)]+_0x2e1ca3(0xdd),_0x2e1ca3(0x14e));}export function assessStandardPageState(_0x43aeac,_0x264f7b,_0x5cd095){const _0x1235a4=a115_0x487a,_0x4ca505=_0x5cd095?.[_0x1235a4(0xee)]??_0x1235a4(0xe6),_0x1459e9=_0x5cd095?.['fallbackUndeletedPages']??[];if(!_0x264f7b){if(_0x1459e9['length']>0x0)return{'status':_0x1235a4(0x12b),'allowGenerate':![],'manualResolutionRequired':!![],'message':_0x1235a4(0xff)+_0x43aeac+_0x1235a4(0x150),'nextAction':'manual_resolution_required'};return{'status':_0x1235a4(0xcf),'allowGenerate':!![],'manualResolutionRequired':![],'message':'Dataset\x20\x22'+_0x43aeac+'\x22\x20has\x20no\x20Smart\x20List\x20Pages\x20yet.','nextAction':_0x1235a4(0x10b)};}const _0x1bf5b7=_0x264f7b['completeSets'],_0x25f34d=_0x264f7b[_0x1235a4(0x13c)],_0x1cbff8=_0x264f7b['residualPages'][_0x1235a4(0x14c)];if(_0x1bf5b7===0x0&&_0x25f34d===0x0&&_0x1cbff8===0x0)return{'status':'no_standard_pages_found','allowGenerate':!![],'manualResolutionRequired':![],'message':_0x1235a4(0xff)+_0x43aeac+'\x22\x20has\x20no\x20Smart\x20List\x20Pages\x20yet.','nextAction':_0x1235a4(0x10b)};if(_0x1bf5b7>0x1)return{'status':_0x1235a4(0x143),'allowGenerate':![],'manualResolutionRequired':!![],'message':_0x1235a4(0xff)+_0x43aeac+_0x1235a4(0x118),'nextAction':_0x1235a4(0x122)};if(_0x25f34d>0x0)return{'status':_0x1235a4(0x12b),'allowGenerate':![],'manualResolutionRequired':!![],'message':'Dataset\x20\x22'+_0x43aeac+_0x1235a4(0xdf),'nextAction':_0x1235a4(0x122)};if(_0x1bf5b7===0x1&&_0x1cbff8>0x0)return{'status':_0x1235a4(0x13a),'allowGenerate':![],'manualResolutionRequired':!![],'message':'Dataset\x20\x22'+_0x43aeac+_0x1235a4(0xfc),'nextAction':_0x1235a4(0x122)};if(_0x1bf5b7===0x1)return{'status':_0x4ca505,'allowGenerate':![],'manualResolutionRequired':![],'message':_0x4ca505===_0x1235a4(0xfa)?_0x1235a4(0xff)+_0x43aeac+_0x1235a4(0x12c):_0x1235a4(0xff)+_0x43aeac+_0x1235a4(0x111),'nextAction':_0x4ca505===_0x1235a4(0xfa)?undefined:_0x1235a4(0xf1)};return{'status':_0x1235a4(0xf0),'allowGenerate':![],'manualResolutionRequired':![],'message':'Dataset\x20\x22'+_0x43aeac+_0x1235a4(0xf2),'nextAction':_0x1235a4(0xfe)};}export function assessGenerateOperationState(_0x40747f,_0x270398,_0x36e2a9){const _0x3253a2=a115_0x487a,_0x33d3cb=String(_0x270398||'')[_0x3253a2(0xe3)]()[_0x3253a2(0x125)]();if(_0x33d3cb===_0x3253a2(0xd1))return{'status':_0x3253a2(0x120),'manualResolutionRequired':![],'message':_0x3253a2(0x134)+_0x40747f+'\x22.','nextAction':_0x3253a2(0xfe)};if(_0x33d3cb===_0x3253a2(0x101)||_0x33d3cb===_0x3253a2(0xf7)||_0x33d3cb===_0x3253a2(0x14a))return{'status':_0x3253a2(0x10f),'manualResolutionRequired':![],'message':_0x3253a2(0xd0)+_0x40747f+'\x22.','nextAction':_0x3253a2(0xfe)};if(_0x33d3cb===_0x3253a2(0x148)||_0x33d3cb==='PARTIAL_SUCCESS'){if(!_0x36e2a9)return{'status':_0x3253a2(0xf0),'manualResolutionRequired':![],'message':_0x3253a2(0x147)+_0x40747f+_0x3253a2(0x141),'nextAction':_0x3253a2(0xfe)};const _0x3b7b06=assessStandardPageState(_0x40747f,_0x36e2a9,{'successStatus':_0x3253a2(0xfa)});if(_0x3b7b06['status']==='no_standard_pages_found')return{'status':_0x3253a2(0xf0),'manualResolutionRequired':![],'message':_0x3253a2(0x147)+_0x40747f+_0x3253a2(0xd4),'nextAction':_0x3253a2(0xfe)};return _0x3b7b06;}if(_0x33d3cb==='FAILED'||_0x33d3cb==='CANCELLED'||_0x33d3cb==='')return{'status':_0x3253a2(0x146),'manualResolutionRequired':![],'message':'Smart\x20List\x20Page\x20generation\x20failed\x20for\x20dataset\x20\x22'+_0x40747f+'\x22.','nextAction':'query_operation_status'};return{'status':'unknown_reconcile_failed','manualResolutionRequired':![],'message':_0x3253a2(0xff)+_0x40747f+_0x3253a2(0x117)+_0x33d3cb+'\x22.','nextAction':'query_operation_status'};}export function normalizePageDetail(_0x45495d){const _0x1efd07=a115_0x487a;return{'pageId':Number(_0x45495d['pageId']),'appCode':_0x45495d[_0x1efd07(0x108)],'name':_0x45495d[_0x1efd07(0xe7)]||_0x1efd07(0x114)+_0x45495d[_0x1efd07(0x109)],'code':_0x45495d['code']||'','type':_0x45495d[_0x1efd07(0xf5)]?String(_0x45495d[_0x1efd07(0xf5)]):_0x1efd07(0x130),'datasetIds':Array[_0x1efd07(0x107)](_0x45495d[_0x1efd07(0x113)])?_0x45495d[_0x1efd07(0x113)][_0x1efd07(0x13b)](_0x292a04=>Number(_0x292a04))['filter'](_0x5eefae=>Number[_0x1efd07(0x127)](_0x5eefae)):[],'pageVersion':_0x45495d[_0x1efd07(0x116)]&&typeof _0x45495d[_0x1efd07(0x116)]['pageVersion']===_0x1efd07(0x115)?_0x45495d[_0x1efd07(0x116)][_0x1efd07(0x11b)]:null,'versionTag':_0x45495d[_0x1efd07(0x116)]&&typeof _0x45495d['config'][_0x1efd07(0x138)]==='string'&&_0x45495d[_0x1efd07(0x116)]['versionTag'][_0x1efd07(0xe3)]()!==''?_0x45495d[_0x1efd07(0x116)]['versionTag']:null,'relatedPages':normalizeRelatedPages(_0x45495d[_0x1efd07(0x132)]),'raw':_0x45495d};}export function serializeDryRunDescription(_0x3eef6b){return JSON['stringify'](_0x3eef6b,null,0x2);}function a115_0x5e49(){const _0x48cf38=['\x22\x20has\x20multiple\x20complete\x20Smart\x20List\x20Page\x20sets.','Alias\x20\x22','One\x20of\x20--operation-id\x20or\x20--client-operation-id\x20is\x20required.','pageVersion','\x22\x20already\x20has\x20undeleted\x20related\x20pages.','__EMPTY__','\x20--operation-id\x20<id>`\x20until\x20it\x20reaches\x20a\x20terminal\x20state.','Page\x20\x22','operation_pending','hasMenu','manual_resolution_required','datasetCode','unknown','toUpperCase','totalSets','isFinite','\x22\x20has\x20no\x20undeleted\x20related\x20pages.','\x20api\x20pull`\x20first,\x20or\x20pass\x20--datasetcode\x20directly.','completeSets','blocked_incomplete_sets','\x22\x20now\x20has\x20one\x20complete\x20Smart\x20List\x20Page\x20set.','\x22\x20belongs\x20to\x20app\x20\x22','Version\x20tag\x20\x22','join','UNKNOWN','clientOperationId','relatedPageInfoList','\x20page\x20sync\x20--datasetcode\x20','Smart\x20List\x20Page\x20generation\x20is\x20pending\x20for\x20dataset\x20\x22','Use\x20`--version-tag\x20<tag>`.\x20Available\x20groups:\x20','`\x20instead.','from','versionTag','\x20--appcode\x20','blocked_complete_plus_residual_sets','map','incompleteSets','\x20--format\x20json','`\x20first,\x20then\x20poll\x20`','residualPages','Use\x20either\x20--id\x20or\x20--datasetcode/--alias,\x20not\x20both.','\x22,\x20but\x20Smart\x20List\x20Page\x20facts\x20are\x20unavailable.','version-tag','blocked_multiple_complete_sets','\x22\x20not\x20found.','filter','operation_failed','Operation\x20finished\x20for\x20dataset\x20\x22','SUCCESS','menuPath','CANCELING','638704xyaTGw','length','Run\x20`','Query\x20the\x20page\x20facts\x20first\x20and\x20resolve\x20manually\x20before\x20retrying\x20generate.','Available\x20aliases:\x20','\x22\x20has\x20undeleted\x20related\x20pages\x20under\x20legacy\x20fallback\x20precheck.','pageSets','menuPages','no_standard_pages_found','Smart\x20List\x20Page\x20generation\x20is\x20running\x20for\x20dataset\x20\x22','PENDING','datasetcode','Use\x20either\x20--operation-id\x20or\x20--client-operation-id,\x20not\x20both.','\x22,\x20but\x20no\x20Smart\x20List\x20Pages\x20were\x20found\x20during\x20reconcile.','pages','\x20page\x20generate-start\x20--datasetcode\x20','apiDir','page-generate-','str','dataset','modelId','keys','\x22\x20has\x20multiple\x20or\x20incomplete\x20Smart\x20List\x20Page\x20sets.','deleted','\x22\x20has\x20incomplete\x20Smart\x20List\x20Page\x20sets.','302941gqUjBK','boolean','validation','trim','15216XeqUsG','client-operation-id','already_exists_complete_set','name','\x20page\x20standard-page-status\x20--datasetcode\x20','string','461109GATAFz','1598856uGjLoR','2427155WQMySC','One\x20of\x20--id\x20or\x20--datasetcode/--alias\x20is\x20required.','successStatus','set','unknown_reconcile_failed','run_sync','\x22\x20returned\x20an\x20unsupported\x20Smart\x20List\x20Page\x20state.','fields','code','type','alias','RETRYING','\x22,\x20not\x20current\x20app\x20\x22','operationId','generated_complete_set','object','\x22\x20has\x20one\x20complete\x20set\x20plus\x20residual\x20pages.','flag','query_operation_status','Dataset\x20\x22','properties','RUNNING','datasetId','Use\x20either\x20--datasetcode\x20or\x20--alias,\x20not\x20both.','modelCode','title','menuVisible','isArray','appCode','pageId','5502ptXhiG','run_generate_start','generate','875496RJYbtv','sync','operation_running','complete','\x22\x20already\x20has\x20one\x20complete\x20Smart\x20List\x20Page\x20set.','One\x20of\x20--datasetcode\x20or\x20--alias\x20is\x20required.','datasetIds','page-','number','config','\x22\x20returned\x20unsupported\x20operation\x20status\x20\x22'];a115_0x5e49=function(){return _0x48cf38;};return a115_0x5e49();}export async function loadStandardPageStatusForGenerate(_0x2914e7,_0x5b4006){const _0x652aea=a115_0x487a,_0xa5fb7a=await tryGetStandardPageStatus(_0x2914e7[_0x652aea(0x108)],_0x5b4006);if(!_0xa5fb7a)return null;return normalizeStandardPageStatus(_0xa5fb7a,_0x5b4006);}export function selectVersionTagGroup(_0x411277,_0x409560,_0x5a76d9){const _0x1c6f33=a115_0x487a,_0x4269a6=new Map();for(const _0x382abf of _0x411277){const _0x445969=normalizeVersionTag(_0x409560(_0x382abf)),_0x33005f=_0x4269a6['get'](_0x445969)??[];_0x33005f['push'](_0x382abf),_0x4269a6[_0x1c6f33(0xef)](_0x445969,_0x33005f);}const _0x510e45=Array[_0x1c6f33(0x137)](_0x4269a6[_0x1c6f33(0xdc)]());if(_0x510e45[_0x1c6f33(0x14c)]<=0x1&&!_0x5a76d9)return{'items':_0x411277,'availableTags':_0x510e45};if(_0x5a76d9){const _0x5789e9=normalizeVersionTag(_0x5a76d9),_0xd8e624=_0x4269a6['get'](_0x5789e9);if(!_0xd8e624)throw CliErrors[_0x1c6f33(0xe2)](_0x1c6f33(0x12e)+_0x5a76d9+_0x1c6f33(0x144),buildVersionTagHint(_0x510e45));return{'items':_0xd8e624,'availableTags':_0x510e45};}throw CliErrors[_0x1c6f33(0xe2)]('Multiple\x20page\x20groups\x20found\x20for\x20this\x20dataset.',buildVersionTagHint(_0x510e45));}function normalizeDatasetDetail(_0x5a75a0,_0x1fe353){const _0x456c60=a115_0x487a,_0x1b60e0=Array[_0x456c60(0x107)](_0x5a75a0[_0x456c60(0xf3)])?_0x5a75a0[_0x456c60(0xf3)]:Array[_0x456c60(0x107)](_0x5a75a0[_0x456c60(0x100)])?_0x5a75a0[_0x456c60(0x100)]:[];return{'id':Number(_0x5a75a0['id']??_0x5a75a0[_0x456c60(0xdb)]??0x0),'code':String(_0x5a75a0['code']||_0x5a75a0[_0x456c60(0x104)]||_0x1fe353),'name':String(_0x5a75a0['name']||_0x1fe353),'appCode':_0x5a75a0['appCode']||_0x5a75a0[_0x456c60(0xda)]?.['appCode'],'fieldCount':_0x1b60e0[_0x456c60(0x14c)],'relatedPages':normalizeRelatedPages(_0x5a75a0['relatedPageInfoList']),'raw':_0x5a75a0};}function normalizeStandardPageStatus(_0x166d50,_0x39cc65){const _0x56f01a=a115_0x487a,_0x4e5589=_0x3a3402=>({'pageId':Number(_0x3a3402['pageId']??_0x3a3402['id']??0x0),'title':String(_0x3a3402[_0x56f01a(0x105)]||_0x3a3402[_0x56f01a(0xe7)]||_0x56f01a(0x114)+(_0x3a3402[_0x56f01a(0x109)]??_0x3a3402['id']??_0x56f01a(0x124))),'type':_0x3a3402[_0x56f01a(0xf5)]?String(_0x3a3402[_0x56f01a(0xf5)]):_0x56f01a(0x130),'deleted':_0x3a3402[_0x56f01a(0xde)]===!![],'hasMenu':_0x3a3402[_0x56f01a(0x121)]===!![],'menuVisible':typeof _0x3a3402[_0x56f01a(0x106)]===_0x56f01a(0xe1)?_0x3a3402[_0x56f01a(0x106)]:null,'menuPath':typeof _0x3a3402[_0x56f01a(0x149)]==='string'&&_0x3a3402['menuPath'][_0x56f01a(0xe3)]()!==''?_0x3a3402[_0x56f01a(0x149)]:null}),_0x50b62f=Array[_0x56f01a(0x107)](_0x166d50[_0x56f01a(0xcd)])?_0x166d50[_0x56f01a(0xcd)][_0x56f01a(0x13b)](_0x401332=>({'versionTag':typeof _0x401332[_0x56f01a(0x138)]===_0x56f01a(0xe9)&&_0x401332[_0x56f01a(0x138)][_0x56f01a(0xe3)]()!==''?_0x401332[_0x56f01a(0x138)]:null,'complete':_0x401332['complete']===!![],'pages':Array[_0x56f01a(0x107)](_0x401332['pages'])?_0x401332['pages']['map'](_0x4e5589):[]})):[];return{'datasetId':typeof _0x166d50[_0x56f01a(0x102)]==='number'&&Number[_0x56f01a(0x127)](_0x166d50[_0x56f01a(0x102)])?_0x166d50[_0x56f01a(0x102)]:null,'datasetCode':typeof _0x166d50[_0x56f01a(0x123)]===_0x56f01a(0xe9)&&_0x166d50['datasetCode']['trim']()!==''?_0x166d50[_0x56f01a(0x123)]:_0x39cc65,'pageSets':_0x50b62f,'totalSets':typeof _0x166d50['totalSets']===_0x56f01a(0x115)&&Number[_0x56f01a(0x127)](_0x166d50[_0x56f01a(0x126)])?_0x166d50[_0x56f01a(0x126)]:_0x50b62f['length'],'completeSets':typeof _0x166d50[_0x56f01a(0x12a)]==='number'&&Number[_0x56f01a(0x127)](_0x166d50['completeSets'])?_0x166d50[_0x56f01a(0x12a)]:_0x50b62f[_0x56f01a(0x145)](_0x2385c5=>_0x2385c5[_0x56f01a(0x110)])[_0x56f01a(0x14c)],'incompleteSets':typeof _0x166d50[_0x56f01a(0x13c)]===_0x56f01a(0x115)&&Number[_0x56f01a(0x127)](_0x166d50[_0x56f01a(0x13c)])?_0x166d50[_0x56f01a(0x13c)]:_0x50b62f[_0x56f01a(0x145)](_0x2ff897=>!_0x2ff897[_0x56f01a(0x110)]&&_0x2ff897[_0x56f01a(0xd5)][_0x56f01a(0x14c)]>0x0)[_0x56f01a(0x14c)],'residualPages':Array[_0x56f01a(0x107)](_0x166d50[_0x56f01a(0x13f)])?_0x166d50[_0x56f01a(0x13f)][_0x56f01a(0x13b)](_0x4e5589):[],'menuPages':Array[_0x56f01a(0x107)](_0x166d50[_0x56f01a(0xce)])?_0x166d50[_0x56f01a(0xce)]['map'](_0x4e5589):[],'source':'standard-page-status'};}function normalizeRelatedPages(_0x1634c4){const _0x24b661=a115_0x487a;if(!Array['isArray'](_0x1634c4))return[];return _0x1634c4['filter'](_0x289017=>_0x289017&&typeof _0x289017===_0x24b661(0xfb))[_0x24b661(0x13b)](_0xa15204=>({'id':Number(_0xa15204['id']),'type':_0xa15204['type']?String(_0xa15204[_0x24b661(0xf5)]):'UNKNOWN','code':_0xa15204['code']||undefined,'title':_0xa15204['title']||_0xa15204[_0x24b661(0xe7)]||_0x24b661(0x114)+_0xa15204['id'],'deleted':_0xa15204['deleted']===!![]}))['filter'](_0x3892b1=>Number[_0x24b661(0x127)](_0x3892b1['id']));}function ensureAppOwnership(_0x580fc4,_0x2bee45,_0x508925){const _0x4400c1=a115_0x487a;if(!_0x2bee45)return;if(_0x2bee45!==_0x580fc4)throw CliErrors[_0x4400c1(0xe2)](_0x508925,'Switch\x20app\x20with\x20`'+CLI_BIN_NAME+'\x20app\x20use\x20<name>`\x20or\x20pass\x20--appcode.');}function normalizeVersionTag(_0x2a94e9){return _0x2a94e9&&_0x2a94e9['trim']()!==''?_0x2a94e9:'__EMPTY__';}function buildVersionTagHint(_0x56cad1){const _0xc55d88=a115_0x487a,_0x36196e=_0x56cad1[_0xc55d88(0x13b)](_0xf38d4=>_0xf38d4===_0xc55d88(0x11d)?'<empty>':_0xf38d4)[_0xc55d88(0x12f)](',\x20');return _0xc55d88(0x135)+_0x36196e;}
|
|
1
|
+
(function(_0x100956,_0xb052dc){const _0x23a817=a114_0x3fc4,_0x55b6fa=_0x100956();while(!![]){try{const _0x5b26d4=parseInt(_0x23a817(0x273))/0x1*(-parseInt(_0x23a817(0x256))/0x2)+parseInt(_0x23a817(0x23a))/0x3+parseInt(_0x23a817(0x226))/0x4*(-parseInt(_0x23a817(0x26a))/0x5)+parseInt(_0x23a817(0x238))/0x6+parseInt(_0x23a817(0x265))/0x7+-parseInt(_0x23a817(0x204))/0x8*(-parseInt(_0x23a817(0x231))/0x9)+-parseInt(_0x23a817(0x205))/0xa*(parseInt(_0x23a817(0x211))/0xb);if(_0x5b26d4===_0xb052dc)break;else _0x55b6fa['push'](_0x55b6fa['shift']());}catch(_0x34125a){_0x55b6fa['push'](_0x55b6fa['shift']());}}}(a114_0x400a,0x1ef1c));import{randomUUID}from'node:crypto';function a114_0x400a(){const _0x1e6c0b=['\x22\x20has\x20multiple\x20or\x20incomplete\x20Smart\x20List\x20Page\x20sets.','\x20api\x20pull`\x20first,\x20or\x20pass\x20--datasetcode\x20directly.','pages','Version\x20tag\x20\x22','FAILED','2106AcXmrZ','\x22,\x20but\x20no\x20Smart\x20List\x20Pages\x20were\x20found\x20during\x20reconcile.','Use\x20either\x20--id\x20or\x20--datasetcode/--alias,\x20not\x20both.','\x20--operation-id\x20<id>`\x20until\x20it\x20reaches\x20a\x20terminal\x20state.','sync','datasetIds','hasMenu','filter','datasetCode','object','status','set','modelCode','residualPages','__EMPTY__','stringify','trim','successStatus','page-','clientOperationId','Smart\x20List\x20Page\x20generation\x20failed\x20for\x20dataset\x20\x22','Use\x20either\x20--datasetcode\x20or\x20--alias,\x20not\x20both.','relatedPageInfoList','UNKNOWN','Dataset\x20\x22','\x20page\x20generate-start\x20--datasetcode\x20','get','1404616PTbefE','80YOkslU','RETRYING','generate','operation_pending','\x22\x20now\x20has\x20one\x20complete\x20Smart\x20List\x20Page\x20set.','\x20--operation-id\x20','from','config','relatedPages','apiDir','Smart\x20List\x20Page\x20generation\x20is\x20running\x20for\x20dataset\x20\x22','validation','406978niZlQO','\x22\x20already\x20has\x20undeleted\x20related\x20pages.','totalSets','Use\x20`--version-tag\x20<tag>`.\x20Available\x20groups:\x20','\x22,\x20but\x20Smart\x20List\x20Page\x20facts\x20are\x20unavailable.','menuPath','versionTag','title','menuVisible','datasetId','RUNNING','blocked_incomplete_sets','\x20--format\x20json','complete','\x22\x20has\x20one\x20complete\x20set\x20plus\x20residual\x20pages.','Operation\x20finished\x20for\x20dataset\x20\x22','properties','completeSets','\x22,\x20not\x20current\x20app\x20\x22','page-generate-','\x22\x20has\x20multiple\x20complete\x20Smart\x20List\x20Page\x20sets.','6560GMXgLp','unknown','join','Switch\x20app\x20with\x20`','map','PENDING','blocked_complete_plus_residual_sets','fallbackUndeletedPages','query_operation_status','\x20--appcode\x20','One\x20of\x20--operation-id\x20or\x20--client-operation-id\x20is\x20required.','9rHzXOS','name','boolean','str','pageId','--version-tag\x20is\x20only\x20supported\x20with\x20--datasetcode\x20or\x20--alias.','deleted','405702EXtsRW','appCode','232107ZLFKzo','Available\x20aliases:\x20','SUCCESS','incompleteSets','\x22\x20has\x20no\x20Smart\x20List\x20Pages\x20yet.','no_standard_pages_found','Alias\x20\x22','keys','string','Multiple\x20page\x20groups\x20found\x20for\x20this\x20dataset.','run_generate_start','datasetcode','\x22\x20belongs\x20to\x20app\x20\x22','Page\x20\x22','toUpperCase','operation_running','`\x20instead.','operation-id','type','Query\x20the\x20page\x20facts\x20first\x20and\x20resolve\x20manually\x20before\x20retrying\x20generate.','One\x20of\x20--datasetcode\x20or\x20--alias\x20is\x20required.','\x20page\x20standard-page-status\x20--datasetcode\x20','unknown_reconcile_failed','<empty>','\x22\x20returned\x20an\x20unsupported\x20Smart\x20List\x20Page\x20state.','isFinite','CANCELING','code','2gBykBi','\x22\x20has\x20incomplete\x20Smart\x20List\x20Page\x20sets.','\x22\x20returned\x20unsupported\x20operation\x20status\x20\x22','\x22\x20not\x20found.','pageSets','isArray','\x20workspace\x20use\x20--app\x20<name>`\x20or\x20pass\x20--appcode.','\x22\x20already\x20has\x20one\x20complete\x20Smart\x20List\x20Page\x20set.','already_exists_complete_set','client-operation-id','generated_complete_set','length','manual_resolution_required','alias','operationId','1522045sclMat','\x20--client-operation-id\x20','dataset','PARTIAL_SUCCESS','number','345rUGCfr','menuPages','\x20page\x20generate-status\x20--datasetcode\x20','Run\x20`'];a114_0x400a=function(){return _0x1e6c0b;};return a114_0x400a();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{getDatasetDetail,getPageDetail,tryGetStandardPageStatus}from'../../core/api-client.js';import{loadAliasMap,resolveAlias}from'../../core/alias-resolver.js';import{resolveApiFilePath}from'../../context.js';function a114_0x3fc4(_0x250911,_0x556335){_0x250911=_0x250911-0x1eb;const _0x400a72=a114_0x400a();let _0x3fc492=_0x400a72[_0x250911];return _0x3fc492;}import{CliErrors}from'../../errors.js';export function getPageIdFlag(_0x2915ae){const _0x136702=a114_0x3fc4,_0x186aef=_0x2915ae['flag']('id');if(typeof _0x186aef===_0x136702(0x269)&&Number['isFinite'](_0x186aef)&&_0x186aef>0x0)return _0x186aef;return undefined;}export function validateDatasetSelector(_0x43634b){const _0x1aa364=a114_0x3fc4,_0x43af78=Boolean(_0x43634b[_0x1aa364(0x234)](_0x1aa364(0x245))),_0x287137=Boolean(_0x43634b[_0x1aa364(0x234)](_0x1aa364(0x263)));if(_0x43af78&&_0x287137)throw CliErrors[_0x1aa364(0x210)](_0x1aa364(0x1fe));if(!_0x43af78&&!_0x287137)throw CliErrors['validation'](_0x1aa364(0x24e));}export function validateGenerateOperationSelector(_0x2d849c){const _0x2aee40=a114_0x3fc4,_0xb2cd3d=Boolean(_0x2d849c[_0x2aee40(0x234)](_0x2aee40(0x24b))),_0x415b9b=Boolean(_0x2d849c[_0x2aee40(0x234)](_0x2aee40(0x25f)));if(_0xb2cd3d&&_0x415b9b)throw CliErrors['validation']('Use\x20either\x20--operation-id\x20or\x20--client-operation-id,\x20not\x20both.');if(!_0xb2cd3d&&!_0x415b9b)throw CliErrors['validation'](_0x2aee40(0x230));}export function validatePageTargetSelector(_0x3f0730){const _0x22fade=a114_0x3fc4,_0xc0ec8d=getPageIdFlag(_0x3f0730)!==undefined,_0x3b01ba=Boolean(_0x3f0730[_0x22fade(0x234)](_0x22fade(0x245))||_0x3f0730[_0x22fade(0x234)]('alias'));if(_0xc0ec8d&&_0x3b01ba)throw CliErrors['validation'](_0x22fade(0x1eb));if(!_0xc0ec8d&&!_0x3b01ba)throw CliErrors[_0x22fade(0x210)]('One\x20of\x20--id\x20or\x20--datasetcode/--alias\x20is\x20required.');if(_0x3f0730[_0x22fade(0x234)]('version-tag')&&!_0x3b01ba)throw CliErrors[_0x22fade(0x210)](_0x22fade(0x236));}export function resolveDatasetCode(_0x131ea4){const _0x2c0814=a114_0x3fc4;validateDatasetSelector(_0x131ea4);const _0x377ed0=_0x131ea4[_0x2c0814(0x234)](_0x2c0814(0x245));if(_0x377ed0)return _0x377ed0;const _0x4e1e5b=_0x131ea4['str'](_0x2c0814(0x263)),_0x1ef9b0=resolveApiFilePath(_0x131ea4[_0x2c0814(0x20e)],_0x131ea4[_0x2c0814(0x239)]),_0x443061=resolveAlias(_0x131ea4['apiDir'],_0x4e1e5b,undefined,_0x1ef9b0);if(_0x443061)return _0x443061;const _0xf891bf=loadAliasMap(_0x131ea4[_0x2c0814(0x20e)],undefined,_0x1ef9b0),_0x1bbc85=_0xf891bf['length']>0x0?_0x2c0814(0x23b)+_0xf891bf[_0x2c0814(0x22a)](_0x1c9183=>_0x1c9183[_0x2c0814(0x263)])[_0x2c0814(0x228)](',\x20'):_0x2c0814(0x26d)+CLI_BIN_NAME+_0x2c0814(0x26f);throw CliErrors['validation'](_0x2c0814(0x240)+_0x4e1e5b+'\x22\x20not\x20found.\x20'+_0x1bbc85);}export async function loadDatasetDetailForPage(_0x483b85){const _0x2861e3=a114_0x3fc4,_0x2cec30=resolveDatasetCode(_0x483b85),_0x1ccfbe=await getDatasetDetail(_0x2cec30),_0x4f2477=normalizeDatasetDetail(_0x1ccfbe,_0x2cec30);return ensureAppOwnership(_0x483b85[_0x2861e3(0x239)],_0x4f2477['appCode'],_0x2861e3(0x201)+_0x4f2477[_0x2861e3(0x255)]+_0x2861e3(0x246)+_0x4f2477[_0x2861e3(0x239)]+_0x2861e3(0x223)+_0x483b85['appCode']+'\x22.'),_0x4f2477;}export async function loadPageDetailForPage(_0x2e69c4,_0x4bdabd){const _0xd7be92=a114_0x3fc4,_0x80cab0=await getPageDetail(_0x4bdabd),_0x4065b0=normalizePageDetail(_0x80cab0);return ensureAppOwnership(_0x2e69c4[_0xd7be92(0x239)],_0x4065b0['appCode'],_0xd7be92(0x247)+_0x4bdabd+_0xd7be92(0x246)+_0x4065b0[_0xd7be92(0x239)]+_0xd7be92(0x223)+_0x2e69c4['appCode']+'\x22.'),_0x4065b0;}export function getUndeletedRelatedPages(_0x59e369){const _0xce84b9=a114_0x3fc4;return _0x59e369[_0xce84b9(0x20d)][_0xce84b9(0x1f0)](_0x1ef02c=>!_0x1ef02c[_0xce84b9(0x237)]);}export function buildPageGenerateOperationStatusQueryCommand(_0x5da526,_0x19d722){const _0x545c16=a114_0x3fc4,_0x106c9c=_0x19d722?.[_0x545c16(0x239)]&&_0x19d722[_0x545c16(0x239)][_0x545c16(0x1f9)]()!==''?_0x545c16(0x22f)+_0x19d722[_0x545c16(0x239)]:'',_0x454ec6=_0x19d722?.[_0x545c16(0x264)]&&_0x19d722[_0x545c16(0x264)][_0x545c16(0x1f9)]()!==''?_0x545c16(0x20a)+_0x19d722[_0x545c16(0x264)]:_0x19d722?.[_0x545c16(0x1fc)]&&_0x19d722[_0x545c16(0x1fc)][_0x545c16(0x1f9)]()!==''?_0x545c16(0x266)+_0x19d722['clientOperationId']:'';return CLI_BIN_NAME+'\x20page\x20generate-status\x20--datasetcode\x20'+_0x5da526+_0x106c9c+_0x454ec6+_0x545c16(0x21d);}export function createPageGenerateClientOperationId(){const _0x557d84=a114_0x3fc4;return _0x557d84(0x224)+randomUUID();}export function buildStandardPageStatusQueryCommand(_0x52e8a1,_0x29e52a){const _0x50176e=a114_0x3fc4,_0x25e969=_0x29e52a&&_0x29e52a[_0x50176e(0x1f9)]()!==''?_0x50176e(0x22f)+_0x29e52a:'';return CLI_BIN_NAME+_0x50176e(0x24f)+_0x52e8a1+_0x25e969+_0x50176e(0x21d);}export function prepareDatasetAction(_0x589136,_0x1d8614){const _0x2261d8=a114_0x3fc4,_0x2fdceb=getUndeletedRelatedPages(_0x589136);if(_0x1d8614===_0x2261d8(0x207)&&_0x2fdceb[_0x2261d8(0x261)]>0x0)throw CliErrors['validation']('Dataset\x20\x22'+_0x589136[_0x2261d8(0x255)]+'\x22\x20already\x20has\x20undeleted\x20related\x20pages.','Run\x20`'+CLI_BIN_NAME+'\x20page\x20sync\x20--datasetcode\x20'+_0x589136[_0x2261d8(0x255)]+_0x2261d8(0x24a));if(_0x1d8614===_0x2261d8(0x1ed)&&_0x2fdceb[_0x2261d8(0x261)]===0x0)throw CliErrors['validation'](_0x2261d8(0x201)+_0x589136[_0x2261d8(0x255)]+'\x22\x20has\x20no\x20undeleted\x20related\x20pages.',_0x2261d8(0x26d)+CLI_BIN_NAME+_0x2261d8(0x202)+_0x589136[_0x2261d8(0x255)]+'`\x20first,\x20then\x20poll\x20`'+CLI_BIN_NAME+_0x2261d8(0x26c)+_0x589136[_0x2261d8(0x255)]+_0x2261d8(0x1ec));return{'dataset':_0x589136,'undeletedPages':_0x2fdceb};}export function prepareGenerateDatasetAction(_0x4d4376,_0x2de6f3){const _0x480dbb=a114_0x3fc4,_0x5054bd=getUndeletedRelatedPages(_0x4d4376);if(!_0x2de6f3){if(_0x5054bd['length']>0x0)throw CliErrors[_0x480dbb(0x210)](_0x480dbb(0x201)+_0x4d4376[_0x480dbb(0x255)]+_0x480dbb(0x212),_0x480dbb(0x26d)+CLI_BIN_NAME+'\x20page\x20sync\x20--datasetcode\x20'+_0x4d4376['code']+_0x480dbb(0x24a));return{'dataset':_0x4d4376,'undeletedPages':_0x5054bd,'standardPageStatus':null};}const _0x48a287=_0x2de6f3[_0x480dbb(0x222)],_0x4f81a5=_0x2de6f3[_0x480dbb(0x23d)],_0x321da3=_0x2de6f3[_0x480dbb(0x1f6)][_0x480dbb(0x261)];if(_0x48a287===0x0&&_0x4f81a5===0x0&&_0x321da3===0x0)return{'dataset':_0x4d4376,'undeletedPages':_0x5054bd,'standardPageStatus':_0x2de6f3};if(_0x48a287===0x1&&_0x4f81a5===0x0&&_0x321da3===0x0)throw CliErrors['validation']('Dataset\x20\x22'+_0x4d4376['code']+_0x480dbb(0x25d),_0x480dbb(0x26d)+CLI_BIN_NAME+'\x20page\x20sync\x20--datasetcode\x20'+_0x4d4376['code']+_0x480dbb(0x24a));throw CliErrors[_0x480dbb(0x210)](_0x480dbb(0x201)+_0x4d4376[_0x480dbb(0x255)]+_0x480dbb(0x26e),_0x480dbb(0x24d));}export function assessStandardPageState(_0x4b7af3,_0x2a9d6e,_0x4b01d0){const _0x51d1cb=a114_0x3fc4,_0x3e877f=_0x4b01d0?.[_0x51d1cb(0x1fa)]??_0x51d1cb(0x25e),_0x4047bd=_0x4b01d0?.[_0x51d1cb(0x22d)]??[];if(!_0x2a9d6e){if(_0x4047bd['length']>0x0)return{'status':_0x51d1cb(0x21c),'allowGenerate':![],'manualResolutionRequired':!![],'message':'Dataset\x20\x22'+_0x4b7af3+'\x22\x20has\x20undeleted\x20related\x20pages\x20under\x20legacy\x20fallback\x20precheck.','nextAction':'manual_resolution_required'};return{'status':_0x51d1cb(0x23f),'allowGenerate':!![],'manualResolutionRequired':![],'message':_0x51d1cb(0x201)+_0x4b7af3+'\x22\x20has\x20no\x20Smart\x20List\x20Pages\x20yet.','nextAction':_0x51d1cb(0x244)};}const _0x1e3ff5=_0x2a9d6e[_0x51d1cb(0x222)],_0x225f4a=_0x2a9d6e[_0x51d1cb(0x23d)],_0x1d464e=_0x2a9d6e['residualPages'][_0x51d1cb(0x261)];if(_0x1e3ff5===0x0&&_0x225f4a===0x0&&_0x1d464e===0x0)return{'status':'no_standard_pages_found','allowGenerate':!![],'manualResolutionRequired':![],'message':_0x51d1cb(0x201)+_0x4b7af3+_0x51d1cb(0x23e),'nextAction':_0x51d1cb(0x244)};if(_0x1e3ff5>0x1)return{'status':'blocked_multiple_complete_sets','allowGenerate':![],'manualResolutionRequired':!![],'message':'Dataset\x20\x22'+_0x4b7af3+_0x51d1cb(0x225),'nextAction':_0x51d1cb(0x262)};if(_0x225f4a>0x0)return{'status':_0x51d1cb(0x21c),'allowGenerate':![],'manualResolutionRequired':!![],'message':_0x51d1cb(0x201)+_0x4b7af3+_0x51d1cb(0x257),'nextAction':_0x51d1cb(0x262)};if(_0x1e3ff5===0x1&&_0x1d464e>0x0)return{'status':_0x51d1cb(0x22c),'allowGenerate':![],'manualResolutionRequired':!![],'message':_0x51d1cb(0x201)+_0x4b7af3+_0x51d1cb(0x21f),'nextAction':_0x51d1cb(0x262)};if(_0x1e3ff5===0x1)return{'status':_0x3e877f,'allowGenerate':![],'manualResolutionRequired':![],'message':_0x3e877f===_0x51d1cb(0x260)?_0x51d1cb(0x201)+_0x4b7af3+_0x51d1cb(0x209):_0x51d1cb(0x201)+_0x4b7af3+_0x51d1cb(0x25d),'nextAction':_0x3e877f===_0x51d1cb(0x260)?undefined:'run_sync'};return{'status':_0x51d1cb(0x250),'allowGenerate':![],'manualResolutionRequired':![],'message':'Dataset\x20\x22'+_0x4b7af3+_0x51d1cb(0x252),'nextAction':_0x51d1cb(0x22e)};}export function assessGenerateOperationState(_0x745175,_0x46caf9,_0x2f9135){const _0x593794=a114_0x3fc4,_0x5b947e=String(_0x46caf9||'')[_0x593794(0x1f9)]()[_0x593794(0x248)]();if(_0x5b947e===_0x593794(0x22b))return{'status':_0x593794(0x208),'manualResolutionRequired':![],'message':'Smart\x20List\x20Page\x20generation\x20is\x20pending\x20for\x20dataset\x20\x22'+_0x745175+'\x22.','nextAction':_0x593794(0x22e)};if(_0x5b947e===_0x593794(0x21b)||_0x5b947e===_0x593794(0x206)||_0x5b947e===_0x593794(0x254))return{'status':_0x593794(0x249),'manualResolutionRequired':![],'message':_0x593794(0x20f)+_0x745175+'\x22.','nextAction':'query_operation_status'};if(_0x5b947e===_0x593794(0x23c)||_0x5b947e===_0x593794(0x268)){if(!_0x2f9135)return{'status':'unknown_reconcile_failed','manualResolutionRequired':![],'message':_0x593794(0x220)+_0x745175+_0x593794(0x215),'nextAction':'query_operation_status'};const _0x1ac67c=assessStandardPageState(_0x745175,_0x2f9135,{'successStatus':_0x593794(0x260)});if(_0x1ac67c[_0x593794(0x1f3)]==='no_standard_pages_found')return{'status':_0x593794(0x250),'manualResolutionRequired':![],'message':'Operation\x20finished\x20for\x20dataset\x20\x22'+_0x745175+_0x593794(0x274),'nextAction':_0x593794(0x22e)};return _0x1ac67c;}if(_0x5b947e===_0x593794(0x272)||_0x5b947e==='CANCELLED'||_0x5b947e==='')return{'status':'operation_failed','manualResolutionRequired':![],'message':_0x593794(0x1fd)+_0x745175+'\x22.','nextAction':_0x593794(0x22e)};return{'status':_0x593794(0x250),'manualResolutionRequired':![],'message':_0x593794(0x201)+_0x745175+_0x593794(0x258)+_0x5b947e+'\x22.','nextAction':'query_operation_status'};}export function normalizePageDetail(_0x21dc13){const _0x25d74f=a114_0x3fc4;return{'pageId':Number(_0x21dc13[_0x25d74f(0x235)]),'appCode':_0x21dc13[_0x25d74f(0x239)],'name':_0x21dc13[_0x25d74f(0x232)]||_0x25d74f(0x1fb)+_0x21dc13['pageId'],'code':_0x21dc13['code']||'','type':_0x21dc13['type']?String(_0x21dc13[_0x25d74f(0x24c)]):'UNKNOWN','datasetIds':Array['isArray'](_0x21dc13[_0x25d74f(0x1ee)])?_0x21dc13[_0x25d74f(0x1ee)]['map'](_0x1c7e24=>Number(_0x1c7e24))[_0x25d74f(0x1f0)](_0x57295c=>Number[_0x25d74f(0x253)](_0x57295c)):[],'pageVersion':_0x21dc13['config']&&typeof _0x21dc13[_0x25d74f(0x20c)]['pageVersion']==='number'?_0x21dc13['config']['pageVersion']:null,'versionTag':_0x21dc13[_0x25d74f(0x20c)]&&typeof _0x21dc13[_0x25d74f(0x20c)][_0x25d74f(0x217)]===_0x25d74f(0x242)&&_0x21dc13[_0x25d74f(0x20c)][_0x25d74f(0x217)][_0x25d74f(0x1f9)]()!==''?_0x21dc13[_0x25d74f(0x20c)][_0x25d74f(0x217)]:null,'relatedPages':normalizeRelatedPages(_0x21dc13[_0x25d74f(0x1ff)]),'raw':_0x21dc13};}export function serializeDryRunDescription(_0x1640f2){const _0x1ccfd2=a114_0x3fc4;return JSON[_0x1ccfd2(0x1f8)](_0x1640f2,null,0x2);}export async function loadStandardPageStatusForGenerate(_0x415ea3,_0x1ef7c4){const _0x44c063=a114_0x3fc4,_0x474f36=await tryGetStandardPageStatus(_0x415ea3[_0x44c063(0x239)],_0x1ef7c4);if(!_0x474f36)return null;return normalizeStandardPageStatus(_0x474f36,_0x1ef7c4);}export function selectVersionTagGroup(_0x4dca1a,_0x3941fb,_0x4ddf8a){const _0x3cd91a=a114_0x3fc4,_0x1db957=new Map();for(const _0x34d07a of _0x4dca1a){const _0x2175cc=normalizeVersionTag(_0x3941fb(_0x34d07a)),_0x3d727b=_0x1db957['get'](_0x2175cc)??[];_0x3d727b['push'](_0x34d07a),_0x1db957[_0x3cd91a(0x1f4)](_0x2175cc,_0x3d727b);}const _0x324f77=Array[_0x3cd91a(0x20b)](_0x1db957[_0x3cd91a(0x241)]());if(_0x324f77[_0x3cd91a(0x261)]<=0x1&&!_0x4ddf8a)return{'items':_0x4dca1a,'availableTags':_0x324f77};if(_0x4ddf8a){const _0x460b85=normalizeVersionTag(_0x4ddf8a),_0x443b96=_0x1db957[_0x3cd91a(0x203)](_0x460b85);if(!_0x443b96)throw CliErrors[_0x3cd91a(0x210)](_0x3cd91a(0x271)+_0x4ddf8a+_0x3cd91a(0x259),buildVersionTagHint(_0x324f77));return{'items':_0x443b96,'availableTags':_0x324f77};}throw CliErrors[_0x3cd91a(0x210)](_0x3cd91a(0x243),buildVersionTagHint(_0x324f77));}function normalizeDatasetDetail(_0x249bd9,_0x56d0e6){const _0x32e5d2=a114_0x3fc4,_0x4e3495=Array[_0x32e5d2(0x25b)](_0x249bd9['fields'])?_0x249bd9['fields']:Array['isArray'](_0x249bd9['properties'])?_0x249bd9[_0x32e5d2(0x221)]:[];return{'id':Number(_0x249bd9['id']??_0x249bd9['modelId']??0x0),'code':String(_0x249bd9[_0x32e5d2(0x255)]||_0x249bd9[_0x32e5d2(0x1f5)]||_0x56d0e6),'name':String(_0x249bd9[_0x32e5d2(0x232)]||_0x56d0e6),'appCode':_0x249bd9[_0x32e5d2(0x239)]||_0x249bd9[_0x32e5d2(0x267)]?.[_0x32e5d2(0x239)],'fieldCount':_0x4e3495['length'],'relatedPages':normalizeRelatedPages(_0x249bd9[_0x32e5d2(0x1ff)]),'raw':_0x249bd9};}function normalizeStandardPageStatus(_0x363bce,_0x492fc2){const _0x31bc70=a114_0x3fc4,_0x58367a=_0x31d2ec=>({'pageId':Number(_0x31d2ec['pageId']??_0x31d2ec['id']??0x0),'title':String(_0x31d2ec[_0x31bc70(0x218)]||_0x31d2ec['name']||_0x31bc70(0x1fb)+(_0x31d2ec[_0x31bc70(0x235)]??_0x31d2ec['id']??_0x31bc70(0x227))),'type':_0x31d2ec[_0x31bc70(0x24c)]?String(_0x31d2ec[_0x31bc70(0x24c)]):_0x31bc70(0x200),'deleted':_0x31d2ec[_0x31bc70(0x237)]===!![],'hasMenu':_0x31d2ec[_0x31bc70(0x1ef)]===!![],'menuVisible':typeof _0x31d2ec[_0x31bc70(0x219)]===_0x31bc70(0x233)?_0x31d2ec[_0x31bc70(0x219)]:null,'menuPath':typeof _0x31d2ec['menuPath']===_0x31bc70(0x242)&&_0x31d2ec[_0x31bc70(0x216)][_0x31bc70(0x1f9)]()!==''?_0x31d2ec['menuPath']:null}),_0x1a7b33=Array[_0x31bc70(0x25b)](_0x363bce[_0x31bc70(0x25a)])?_0x363bce[_0x31bc70(0x25a)][_0x31bc70(0x22a)](_0x9f813=>({'versionTag':typeof _0x9f813[_0x31bc70(0x217)]===_0x31bc70(0x242)&&_0x9f813[_0x31bc70(0x217)][_0x31bc70(0x1f9)]()!==''?_0x9f813[_0x31bc70(0x217)]:null,'complete':_0x9f813[_0x31bc70(0x21e)]===!![],'pages':Array['isArray'](_0x9f813[_0x31bc70(0x270)])?_0x9f813[_0x31bc70(0x270)][_0x31bc70(0x22a)](_0x58367a):[]})):[];return{'datasetId':typeof _0x363bce[_0x31bc70(0x21a)]===_0x31bc70(0x269)&&Number[_0x31bc70(0x253)](_0x363bce[_0x31bc70(0x21a)])?_0x363bce[_0x31bc70(0x21a)]:null,'datasetCode':typeof _0x363bce[_0x31bc70(0x1f1)]===_0x31bc70(0x242)&&_0x363bce[_0x31bc70(0x1f1)]['trim']()!==''?_0x363bce[_0x31bc70(0x1f1)]:_0x492fc2,'pageSets':_0x1a7b33,'totalSets':typeof _0x363bce['totalSets']===_0x31bc70(0x269)&&Number['isFinite'](_0x363bce[_0x31bc70(0x213)])?_0x363bce[_0x31bc70(0x213)]:_0x1a7b33[_0x31bc70(0x261)],'completeSets':typeof _0x363bce[_0x31bc70(0x222)]==='number'&&Number['isFinite'](_0x363bce[_0x31bc70(0x222)])?_0x363bce[_0x31bc70(0x222)]:_0x1a7b33['filter'](_0x12ab18=>_0x12ab18[_0x31bc70(0x21e)])[_0x31bc70(0x261)],'incompleteSets':typeof _0x363bce[_0x31bc70(0x23d)]===_0x31bc70(0x269)&&Number[_0x31bc70(0x253)](_0x363bce['incompleteSets'])?_0x363bce[_0x31bc70(0x23d)]:_0x1a7b33[_0x31bc70(0x1f0)](_0x50edc3=>!_0x50edc3[_0x31bc70(0x21e)]&&_0x50edc3['pages']['length']>0x0)[_0x31bc70(0x261)],'residualPages':Array[_0x31bc70(0x25b)](_0x363bce[_0x31bc70(0x1f6)])?_0x363bce['residualPages'][_0x31bc70(0x22a)](_0x58367a):[],'menuPages':Array['isArray'](_0x363bce[_0x31bc70(0x26b)])?_0x363bce[_0x31bc70(0x26b)][_0x31bc70(0x22a)](_0x58367a):[],'source':'standard-page-status'};}function normalizeRelatedPages(_0x41b5bc){const _0x3e007a=a114_0x3fc4;if(!Array['isArray'](_0x41b5bc))return[];return _0x41b5bc[_0x3e007a(0x1f0)](_0xdcfecb=>_0xdcfecb&&typeof _0xdcfecb===_0x3e007a(0x1f2))['map'](_0xff2731=>({'id':Number(_0xff2731['id']),'type':_0xff2731[_0x3e007a(0x24c)]?String(_0xff2731[_0x3e007a(0x24c)]):'UNKNOWN','code':_0xff2731[_0x3e007a(0x255)]||undefined,'title':_0xff2731[_0x3e007a(0x218)]||_0xff2731['name']||_0x3e007a(0x1fb)+_0xff2731['id'],'deleted':_0xff2731['deleted']===!![]}))[_0x3e007a(0x1f0)](_0x2365ae=>Number[_0x3e007a(0x253)](_0x2365ae['id']));}function ensureAppOwnership(_0xdd1300,_0x370447,_0x21a9c1){const _0x2f7885=a114_0x3fc4;if(!_0x370447)return;if(_0x370447!==_0xdd1300)throw CliErrors[_0x2f7885(0x210)](_0x21a9c1,_0x2f7885(0x229)+CLI_BIN_NAME+_0x2f7885(0x25c));}function normalizeVersionTag(_0x53590f){const _0x158a2c=a114_0x3fc4;return _0x53590f&&_0x53590f['trim']()!==''?_0x53590f:_0x158a2c(0x1f7);}function buildVersionTagHint(_0x3ed99e){const _0x532717=a114_0x3fc4,_0x295204=_0x3ed99e[_0x532717(0x22a)](_0x4be986=>_0x4be986===_0x532717(0x1f7)?_0x532717(0x251):_0x4be986)[_0x532717(0x228)](',\x20');return _0x532717(0x214)+_0x295204;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a115_0x26b15e=a115_0x1bfc;(function(_0x5919d8,_0x53abf6){const _0x546807=a115_0x1bfc,_0x488109=_0x5919d8();while(!![]){try{const _0x1e985d=-parseInt(_0x546807(0x156))/0x1*(-parseInt(_0x546807(0x16a))/0x2)+-parseInt(_0x546807(0x152))/0x3+-parseInt(_0x546807(0x16d))/0x4*(-parseInt(_0x546807(0x159))/0x5)+parseInt(_0x546807(0x16c))/0x6*(parseInt(_0x546807(0x168))/0x7)+parseInt(_0x546807(0x167))/0x8*(-parseInt(_0x546807(0x163))/0x9)+-parseInt(_0x546807(0x151))/0xa+-parseInt(_0x546807(0x15e))/0xb*(-parseInt(_0x546807(0x154))/0xc);if(_0x1e985d===_0x53abf6)break;else _0x488109['push'](_0x488109['shift']());}catch(_0x47068a){_0x488109['push'](_0x488109['shift']());}}}(a115_0x40a1,0x47e6a));function a115_0x1bfc(_0x45114d,_0x1524f7){_0x45114d=_0x45114d-0x14f;const _0x40a12d=a115_0x40a1();let _0x1bfcbc=_0x40a12d[_0x45114d];return _0x1bfcbc;}import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{assessStandardPageState,getUndeletedRelatedPages,loadDatasetDetailForPage,loadStandardPageStatusForGenerate,serializeDryRunDescription,validateDatasetSelector}from'../../commands/page/shared.js';function a115_0x40a1(){const _0x2a6a67=['8edLQxn','status','6jblZLp','124CImKfr','code','GET','779780MIAGZC','1299078RyuRcx','standard-page-status','5064spAASe','source','36946UEVcjd','length','Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)','28630dKuyYr','relatedPages','read','query-standard-page-status','related-pages-fallback','13442pUgtfG','string','appCode','/smartapi/lovrabet/dataset/','name','711DiAuur','alias','manualResolutionRequired','nextAction','26872GAgkSM','1609279nRUGhs','Query\x20Smart\x20List\x20Page\x20facts\x20for\x20a\x20dataset'];a115_0x40a1=function(){return _0x2a6a67;};return a115_0x40a1();}export const pageStandardPageStatus={'service':'page','command':a115_0x26b15e(0x153),'description':a115_0x26b15e(0x169),'risk':a115_0x26b15e(0x15b),'defaultOutputFormat':'compress','flags':[APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL,{'name':a115_0x26b15e(0x164),'type':a115_0x26b15e(0x15f),'description':a115_0x26b15e(0x158)}],async 'validate'(_0x5e8a4b){validateDatasetSelector(_0x5e8a4b);},async 'dryRun'(_0x4a3f0d){const _0x28bd1a=a115_0x26b15e,_0x3205e0=await loadDatasetDetailForPage(_0x4a3f0d);return{'method':_0x28bd1a(0x150),'url':_0x28bd1a(0x161)+_0x3205e0[_0x28bd1a(0x14f)]+'/standard-page-status?appCode='+encodeURIComponent(_0x4a3f0d[_0x28bd1a(0x160)]),'description':serializeDryRunDescription({'dataset':{'id':_0x3205e0['id'],'code':_0x3205e0[_0x28bd1a(0x14f)],'name':_0x3205e0[_0x28bd1a(0x162)]},'action':_0x28bd1a(0x15c)})};},async 'execute'(_0x3c1648){const _0x36915d=a115_0x26b15e,_0x421bc3=await loadDatasetDetailForPage(_0x3c1648),_0x22dc60=await loadStandardPageStatusForGenerate(_0x3c1648,_0x421bc3['code']),_0x3bd5dd=getUndeletedRelatedPages(_0x421bc3),_0x3ef926=assessStandardPageState(_0x421bc3[_0x36915d(0x14f)],_0x22dc60,{'fallbackUndeletedPages':_0x3bd5dd});return{'ok':!![],'data':{'datasetCode':_0x421bc3[_0x36915d(0x14f)],'precheckSource':_0x22dc60?.[_0x36915d(0x155)]??_0x36915d(0x15d),'status':_0x3ef926[_0x36915d(0x16b)],'manualResolutionRequired':_0x3ef926[_0x36915d(0x165)],'nextAction':_0x3ef926[_0x36915d(0x166)],'standardPageStatus':_0x22dc60,'relatedPages':{'total':_0x421bc3[_0x36915d(0x15a)][_0x36915d(0x157)],'undeletedCount':_0x3bd5dd['length']}}};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a116_0x36b62f=a116_0x4cb4;(function(_0x24828e,_0xc33a5d){const _0x104e7d=a116_0x4cb4,_0x5a92b8=_0x24828e();while(!![]){try{const _0x24dbfb=parseInt(_0x104e7d(0x151))/0x1+parseInt(_0x104e7d(0x150))/0x2+-parseInt(_0x104e7d(0x159))/0x3+-parseInt(_0x104e7d(0x161))/0x4*(parseInt(_0x104e7d(0x155))/0x5)+parseInt(_0x104e7d(0x15f))/0x6*(-parseInt(_0x104e7d(0x153))/0x7)+parseInt(_0x104e7d(0x154))/0x8+-parseInt(_0x104e7d(0x156))/0x9;if(_0x24dbfb===_0xc33a5d)break;else _0x5a92b8['push'](_0x5a92b8['shift']());}catch(_0x598757){_0x5a92b8['push'](_0x5a92b8['shift']());}}}(a116_0x35ad,0x3ebd2));function a116_0x4cb4(_0x2d7378,_0x4581b6){_0x2d7378=_0x2d7378-0x14a;const _0x35ad01=a116_0x35ad();let _0x4cb4b7=_0x35ad01[_0x2d7378];return _0x4cb4b7;}import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{loadDatasetDetailForPage,prepareDatasetAction,serializeDryRunDescription,validateDatasetSelector}from'../../commands/page/shared.js';import{syncStandardPages}from'../../core/api-client.js';export const pageSync={'service':'page','command':a116_0x36b62f(0x165),'description':a116_0x36b62f(0x163),'risk':'write','defaultOutputFormat':'compress','flags':[APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL,{'name':a116_0x36b62f(0x14d),'type':'string','description':a116_0x36b62f(0x15e)}],async 'validate'(_0x10e2ad){validateDatasetSelector(_0x10e2ad);},async 'dryRun'(_0x4fa073){const _0x48f496=a116_0x36b62f,_0x1186b5=await prepare(_0x4fa073);return{'method':_0x48f496(0x160),'url':_0x48f496(0x15b)+_0x1186b5[_0x48f496(0x14a)]['code']+_0x48f496(0x162),'body':{'appCode':_0x4fa073[_0x48f496(0x15c)]},'description':serializeDryRunDescription({'dataset':{'id':_0x1186b5[_0x48f496(0x14a)]['id'],'code':_0x1186b5[_0x48f496(0x14a)]['code'],'name':_0x1186b5[_0x48f496(0x14a)][_0x48f496(0x14e)],'fieldCount':_0x1186b5['dataset'][_0x48f496(0x157)]},'relatedPages':{'total':_0x1186b5[_0x48f496(0x14a)][_0x48f496(0x14b)][_0x48f496(0x14f)],'undeletedCount':_0x1186b5['undeletedPages'][_0x48f496(0x14f)]},'action':_0x48f496(0x165),'reason':_0x1186b5['undeletedPages'][_0x48f496(0x14f)]+_0x48f496(0x164)})};},async 'execute'(_0x20d19a){const _0x554582=a116_0x36b62f,_0x14eaf9=await prepare(_0x20d19a),_0x47778a=await syncStandardPages(_0x20d19a[_0x554582(0x15c)],_0x14eaf9[_0x554582(0x14a)][_0x554582(0x14c)]),_0x234b3c=Array[_0x554582(0x15a)](_0x47778a[_0x554582(0x15d)])&&_0x47778a[_0x554582(0x15d)][_0x554582(0x14f)]>0x0,_0x2e8f1b=_0x234b3c?_0x554582(0x158):_0x554582(0x152);return{'ok':!![],'message':_0x2e8f1b,'data':{'datasetCode':_0x14eaf9[_0x554582(0x14a)]['code'],..._0x47778a}};}};async function prepare(_0x34c4b2){const _0x15ad66=await loadDatasetDetailForPage(_0x34c4b2);return prepareDatasetAction(_0x15ad66,'sync');}function a116_0x35ad(){const _0x406f51=['40EHmbrs','3768201VLKKGW','fieldCount','部分页面同步失败','1281081LNvhvC','isArray','/smartapi/lovrabet/dataset/','appCode','failedPages','Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)','111450oZIhNm','POST','21836oHjEiM','/sync-to-pages','Sync\x20dataset\x20changes\x20to\x20related\x20Smart\x20List\x20Pages','\x20undeleted\x20related\x20page(s)\x20found','sync','dataset','relatedPages','code','alias','name','length','1015440jKuupJ','288193oLvmbp','同步成功','7riKMvf','2952224iaKBDY'];a116_0x35ad=function(){return _0x406f51;};return a116_0x35ad();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
(function(_0xd61a9b,_0x23bba6){const _0xca8f15=a117_0xf07e,_0x2b04e8=_0xd61a9b();while(!![]){try{const _0x252db8=parseInt(_0xca8f15(0xbd))/0x1+-parseInt(_0xca8f15(0xc8))/0x2*(parseInt(_0xca8f15(0xc0))/0x3)+-parseInt(_0xca8f15(0xc4))/0x4+parseInt(_0xca8f15(0xc3))/0x5*(-parseInt(_0xca8f15(0xb7))/0x6)+-parseInt(_0xca8f15(0xcd))/0x7+parseInt(_0xca8f15(0xc9))/0x8*(parseInt(_0xca8f15(0xb2))/0x9)+parseInt(_0xca8f15(0xb1))/0xa;if(_0x252db8===_0x23bba6)break;else _0x2b04e8['push'](_0x2b04e8['shift']());}catch(_0x3cbdc7){_0x2b04e8['push'](_0x2b04e8['shift']());}}}(a117_0xe926,0x32c31));function a117_0xe926(){const _0x291c01=['cyan','80CpRHCN','1376488lMiWqA','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','√\x20Login\x20status:\x20','Project\x20name:','2TZryiS','528hcHnAI','log','Not\x20set','Skipped','2032583tIfkIK','8610960uoXlar','12591muTfGt','env','Login\x20failed','production','trim','143544LlwqTn','cwd','√\x20App\x20Code:\x20','test','Project\x20name\x20cannot\x20exceed\x2050\x20characters','resolve','413321OWuxym','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','√\x20Project\x20Name:\x20','424665CooJlN','green'];a117_0xe926=function(){return _0x291c01;};return a117_0xe926();}function a117_0xf07e(_0x54e7e7,_0x4dfa5a){_0x54e7e7=_0x54e7e7-0xb1;const _0xe92603=a117_0xe926();let _0xf07ee8=_0xe92603[_0x54e7e7];return _0xf07ee8;}import{existsSync}from'node:fs';import a117_0x515061 from'node:path';import a117_0x1766df from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';export async function guidedCreateProject(_0x101960,_0xcd713c,_0x524b48){const _0x3762cc=a117_0xf07e,_0x583865='my-app',_0x217ad5=readConfig(),_0x3c71b7=typeof _0x217ad5['env']==='string'?_0x217ad5[_0x3762cc(0xb3)]:undefined,_0xd138b7=await input({'message':_0x3762cc(0xc7),'default':_0x583865,'validate':_0x2ff32d=>{const _0x58929a=_0x3762cc,_0x1df7d4=_0x2ff32d[_0x58929a(0xb6)]()||_0x583865;if(_0x1df7d4['length']>0x32)return _0x58929a(0xbb);const _0x326d96=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x1df7d4&&!_0x326d96[_0x58929a(0xba)](_0x1df7d4))return _0x58929a(0xc5);const _0x185762=a117_0x515061[_0x58929a(0xbc)](process[_0x58929a(0xb8)](),_0x1df7d4);if(existsSync(_0x185762))return'Directory\x20\x22'+_0x1df7d4+'\x22\x20already\x20exists';return!![];}});console[_0x3762cc(0xca)](a117_0x1766df[_0x3762cc(0xc1)](_0x3762cc(0xbf)+a117_0x1766df['cyan'](_0xd138b7)));const _0x3fcd6b=await selectSingleAppcode(_0x524b48);console[_0x3762cc(0xca)](a117_0x1766df[_0x3762cc(0xc1)](_0x3762cc(0xb9)+a117_0x1766df['cyan'](_0x3fcd6b||_0x3762cc(0xcb))));if(_0x3fcd6b){const _0x26c91b=await getIsSessionValid();if(!_0x26c91b){const _0x31abcc=await confirm({'message':_0x3762cc(0xbe),'default':!![]});if(_0x31abcc){const _0x1cb4a6=await authServer({'silent':!![]});console[_0x3762cc(0xca)](a117_0x1766df[_0x3762cc(0xc1)](_0x3762cc(0xc6)+a117_0x1766df['cyan'](_0x1cb4a6?'Logged\x20in':_0x3762cc(0xb4))));}else console[_0x3762cc(0xca)](a117_0x1766df[_0x3762cc(0xc1)](_0x3762cc(0xc6)+a117_0x1766df[_0x3762cc(0xc2)](_0x3762cc(0xcc))));}await _0x101960({'projectName':_0xd138b7,'appCode':_0x3fcd6b,'env':_0xcd713c||_0x3c71b7||_0x3762cc(0xb5)});}else await _0x101960({'projectName':_0xd138b7,'env':_0xcd713c||_0x3c71b7||_0x3762cc(0xb5)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a118_0x4d81(_0x55b986,_0x43ba97){_0x55b986=_0x55b986-0x1dd;const _0x4055c0=a118_0x4055();let _0x4d81c1=_0x4055c0[_0x55b986];return _0x4d81c1;}(function(_0x4dccbf,_0x3f1518){const _0x2b3039=a118_0x4d81,_0x80b566=_0x4dccbf();while(!![]){try{const _0x2f5619=-parseInt(_0x2b3039(0x1e1))/0x1*(parseInt(_0x2b3039(0x1ea))/0x2)+-parseInt(_0x2b3039(0x1e9))/0x3*(-parseInt(_0x2b3039(0x1e3))/0x4)+parseInt(_0x2b3039(0x1dd))/0x5*(-parseInt(_0x2b3039(0x1e5))/0x6)+-parseInt(_0x2b3039(0x1df))/0x7+parseInt(_0x2b3039(0x1e7))/0x8+-parseInt(_0x2b3039(0x1e6))/0x9+-parseInt(_0x2b3039(0x1e8))/0xa*(-parseInt(_0x2b3039(0x1e0))/0xb);if(_0x2f5619===_0x3f1518)break;else _0x80b566['push'](_0x80b566['shift']());}catch(_0x18a45d){_0x80b566['push'](_0x80b566['shift']());}}}(a118_0x4055,0x5e584));export function formatElapsed(_0x2c8cc3){const _0x32f5ec=a118_0x4d81,_0x1f75fc=Date[_0x32f5ec(0x1e4)]()-_0x2c8cc3;if(_0x1f75fc<0x3e8)return _0x1f75fc+'ms';const _0x59cb4b=(_0x1f75fc/0x3e8)[_0x32f5ec(0x1e2)](0x2),_0x38b696=_0x59cb4b[_0x32f5ec(0x1de)](/\.?0+$/u,'');return _0x38b696+'s';}function a118_0x4055(){const _0x2d15cc=['171500IFFjKr','1425378HtrQbo','50DXGbgE','5rTEFmg','replace','4090989DTMSXj','1078wpcTKS','16621fhtCnt','toFixed','4qPJlwp','now','2370468ccCVjQ','5557149txsecM','1944808vPYJNE'];a118_0x4055=function(){return _0x2d15cc;};return a118_0x4055();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a120_0x24c4(){const _0x42889f=['\x20run\x20start','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','log','chdir','更新\x20package.json\x20失败','belowMinimum','6037066wvGRae','currentVersion','env','\x20model(s)','√\x20Configuration\x20file\x20created,\x20Apps:\x20','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','2gRcHhD','accessSync','Install\x20dependencies','\x20api\x20pull','2476329sjfNLh','√\x20Pulled\x20','配置应用AppCode失败','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','8754920kNPdxx','readFileSync','3529896ZXJjOf','gray','length','stableVersion','\x20Generated\x20by\x20rabetbase\x20cli\x20','3614140RyKpgn','🚀\x20Next\x20Steps:','description','7518ZaSnib','*\x20Configuring\x20AppCode\x20for\x20project\x20','4590635ydUYNP','dirname','\x20already\x20exists','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','parse','error','stop','resolve','trim','projectName','projectCode','项目创建失败:\x20','1.0.0','warn','version','\x20dataset(s),\x20generated\x20','minimumVersion','package.json','keys','...','cd\x20','cwd','toLocaleString','项目创建完成:\x20','writeFileSync','cyan','开始创建项目:\x20','production','API\x20configuration\x20pulled:\x20','appCode','Format\x20code','API\x20配置拉取异常','utf8','bold','start','constants','message','W_OK','join','test','string','\x20&&\x20','green','defaultApp','modelCount','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','info','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','清理项目目录失败:\x20','\x20|\x20Default:\x20','cookie','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','repeat','Copy\x20project\x20files','create','needsUpgrade','\x20√\x20','Project\x20directory\x20','stringify'];a120_0x24c4=function(){return _0x42889f;};return a120_0x24c4();}(function(_0x465576,_0x17d305){const _0x58ba21=a120_0x2d6f,_0x57e0c1=_0x465576();while(!![]){try{const _0x477b0b=-parseInt(_0x58ba21(0xc5))/0x1+parseInt(_0x58ba21(0xb3))/0x2*(-parseInt(_0x58ba21(0xb7))/0x3)+-parseInt(_0x58ba21(0xc2))/0x4+parseInt(_0x58ba21(0xc7))/0x5+-parseInt(_0x58ba21(0xbd))/0x6+parseInt(_0x58ba21(0xad))/0x7+parseInt(_0x58ba21(0xbb))/0x8;if(_0x477b0b===_0x17d305)break;else _0x57e0c1['push'](_0x57e0c1['shift']());}catch(_0x18b94d){_0x57e0c1['push'](_0x57e0c1['shift']());}}}(a120_0x24c4,0x864e6));import a120_0x2bb128 from'path';import a120_0x22a6fd from'fs';import a120_0x132d74 from'chalk';import a120_0x25ad43 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../api/fetch-model-list.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';function a120_0x2d6f(_0x1893c5,_0x3ce549){_0x1893c5=_0x1893c5-0xa9;const _0x24c4ce=a120_0x24c4();let _0x2d6f59=_0x24c4ce[_0x1893c5];return _0x2d6f59;}import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x102f8b){const _0x4dd2e6=a120_0x2d6f,_0x21201e=await checkCliVersion();(_0x21201e[_0x4dd2e6(0xfe)]||_0x21201e[_0x4dd2e6(0xac)])&&(printCliUpgradeWarning(_0x21201e),assertCliVersionSupported(_0x21201e),logger[_0x4dd2e6(0xf5)](_0x4dd2e6(0xfd),'CLI\x20版本检查',{'currentVersion':_0x21201e[_0x4dd2e6(0xae)],'stableVersion':_0x21201e[_0x4dd2e6(0xc0)],'minimumVersion':_0x21201e[_0x4dd2e6(0xd7)],'needsUpgrade':_0x21201e['needsUpgrade'],'belowMinimum':_0x21201e[_0x4dd2e6(0xac)]}));if(_0x102f8b[_0x4dd2e6(0xd1)]&&_0x102f8b[_0x4dd2e6(0xe4)])await runCreate({'projectName':_0x102f8b['projectCode'],'appCode':_0x102f8b[_0x4dd2e6(0xe4)],'env':_0x102f8b[_0x4dd2e6(0xaf)]},_0x102f8b);else{if(_0x102f8b[_0x4dd2e6(0xd1)]){const _0xeee5f8=await selectSingleAppcode(_0x102f8b[_0x4dd2e6(0xf9)]);await runCreate({'projectName':_0x102f8b[_0x4dd2e6(0xd1)],'appCode':_0xeee5f8||undefined,'env':_0x102f8b[_0x4dd2e6(0xaf)]},_0x102f8b);}else await guidedCreateProject(_0x50755d=>runCreate(_0x50755d,_0x102f8b),_0x102f8b['env'],_0x102f8b[_0x4dd2e6(0xf9)]);}}async function runCreate(_0x22622b,_0x3a5c32){const _0x36f2a2=a120_0x2d6f;if(!_0x22622b['projectName']||_0x22622b[_0x36f2a2(0xd0)][_0x36f2a2(0xcf)]()==='')throw new Error('Project\x20name\x20cannot\x20be\x20empty');const _0x593106=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x593106[_0x36f2a2(0xee)](_0x22622b[_0x36f2a2(0xd0)]))throw new Error(_0x36f2a2(0xf4));if(_0x22622b[_0x36f2a2(0xd0)]['length']>0x64)throw new Error(_0x36f2a2(0xf6));const _0x267706=a120_0x2bb128[_0x36f2a2(0xce)](process['cwd'](),_0x22622b[_0x36f2a2(0xd0)]);if(a120_0x22a6fd['existsSync'](_0x267706))throw new Error(_0x36f2a2(0x100)+_0x22622b[_0x36f2a2(0xd0)]+_0x36f2a2(0xc9));try{a120_0x22a6fd[_0x36f2a2(0xb4)](a120_0x2bb128[_0x36f2a2(0xc8)](_0x267706),a120_0x22a6fd[_0x36f2a2(0xea)][_0x36f2a2(0xec)]);}catch{throw new Error(_0x36f2a2(0xca));}logger['setLogPath'](_0x267706),logger[_0x36f2a2(0xf5)](_0x36f2a2(0xfd),_0x36f2a2(0xe1)+_0x22622b[_0x36f2a2(0xd0)],{'projectDir':_0x267706,'appCode':_0x22622b[_0x36f2a2(0xe4)]}),console[_0x36f2a2(0xa9)](),console[_0x36f2a2(0xa9)](a120_0x132d74[_0x36f2a2(0xf1)](_0x36f2a2(0xff))+'Project\x20name:\x20'+a120_0x132d74[_0x36f2a2(0xf1)](_0x22622b['projectName'])+(_0x22622b[_0x36f2a2(0xe4)]?'\x20|\x20AppCode:\x20'+a120_0x132d74['cyan'](_0x22622b[_0x36f2a2(0xe4)]):''));try{await runTask(_0x36f2a2(0xfc),()=>copyProjectTemplate(_0x22622b[_0x36f2a2(0xd0)])),await updatePackageJsonName(_0x22622b['projectName']),await runTask(_0x36f2a2(0xb5),()=>installDependencies(_0x22622b[_0x36f2a2(0xd0)])),await runTask(_0x36f2a2(0xe5),()=>formatProjectCode(_0x22622b[_0x36f2a2(0xd0)])),await configureAppCode(_0x22622b[_0x36f2a2(0xd0)],_0x22622b[_0x36f2a2(0xe4)]||'',_0x22622b[_0x36f2a2(0xaf)]);let _0x2145c3=![];if(_0x22622b[_0x36f2a2(0xe4)]){console[_0x36f2a2(0xa9)]('*\x20Pulling\x20API\x20configuration...');const _0x3b4e4e=process[_0x36f2a2(0xdc)]();try{process['chdir'](_0x267706);const _0x39748b=_0x22622b['env']||_0x36f2a2(0xe2);initEnv(_0x39748b);const {configArray:_0x464eb3}=await fetchModelList(_0x22622b[_0x36f2a2(0xe4)],_0x3a5c32[_0x36f2a2(0xf9)]||''),_0x5c56c7=DEFAULT_API_DIR,_0x12fe84=await generateApiFile(_0x464eb3,'',_0x22622b[_0x36f2a2(0xe4)],!![],_0x39748b,_0x5c56c7);console[_0x36f2a2(0xa9)](_0x36f2a2(0xb8)+_0x464eb3[_0x36f2a2(0xbf)]+_0x36f2a2(0xd6)+_0x12fe84[_0x36f2a2(0xf3)]+_0x36f2a2(0xb0)),logger[_0x36f2a2(0xf5)]('create',_0x36f2a2(0xe3)+_0x22622b[_0x36f2a2(0xe4)]);}catch(_0x3d938d){_0x2145c3=!![],console[_0x36f2a2(0xa9)]('!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull'),logger[_0x36f2a2(0xd4)](_0x36f2a2(0xfd),_0x36f2a2(0xe6),{'error':_0x3d938d instanceof Error?_0x3d938d[_0x36f2a2(0xeb)]:String(_0x3d938d)});}finally{process[_0x36f2a2(0xaa)](_0x3b4e4e);}}logger['success'](_0x36f2a2(0xfd),_0x36f2a2(0xde)+_0x22622b[_0x36f2a2(0xd0)]),console['log'](),console[_0x36f2a2(0xa9)](a120_0x132d74[_0x36f2a2(0xf1)]('─'[_0x36f2a2(0xfb)](0x3c))),console[_0x36f2a2(0xa9)](a120_0x132d74[_0x36f2a2(0xe0)][_0x36f2a2(0xe8)](_0x36f2a2(0xc3))),console[_0x36f2a2(0xa9)](),console['log']('\x20\x201.\x20Start\x20project:\x20'+a120_0x132d74[_0x36f2a2(0xe0)]['bold'](_0x36f2a2(0xdb)+_0x22622b[_0x36f2a2(0xd0)]+_0x36f2a2(0xf0)+CLI_BIN_NAME+_0x36f2a2(0x102))),_0x2145c3&&console[_0x36f2a2(0xa9)]('\x20\x202.\x20Pull\x20API\x20configuration:\x20'+a120_0x132d74[_0x36f2a2(0xe0)][_0x36f2a2(0xe8)](CLI_BIN_NAME+_0x36f2a2(0xb6))),console[_0x36f2a2(0xa9)](a120_0x132d74[_0x36f2a2(0xf1)]('─'[_0x36f2a2(0xfb)](0x3c)));}catch(_0x5b69ab){logger[_0x36f2a2(0xcc)](_0x36f2a2(0xfd),_0x36f2a2(0xd2)+_0x22622b[_0x36f2a2(0xd0)],{'error':_0x5b69ab instanceof Error?_0x5b69ab[_0x36f2a2(0xeb)]:String(_0x5b69ab)});try{a120_0x22a6fd['existsSync'](_0x267706)&&(console[_0x36f2a2(0xa9)](_0x36f2a2(0x103)+_0x267706),a120_0x22a6fd['rmSync'](_0x267706,{'recursive':!![],'force':!![]}));}catch{logger['warn']('create',_0x36f2a2(0xf7)+_0x267706);}throw _0x5b69ab;}}async function runTask(_0x37d31d,_0x363d05){const _0x3295a7=a120_0x2d6f,_0x4e1162=a120_0x25ad43(_0x37d31d+_0x3295a7(0xda))[_0x3295a7(0xe9)]();try{const _0x11a8b8=await _0x363d05();_0x4e1162[_0x3295a7(0xcd)](),console[_0x3295a7(0xa9)](''+a120_0x132d74[_0x3295a7(0xf1)](_0x3295a7(0xff))+_0x37d31d+'\x20'+a120_0x132d74[_0x3295a7(0xbe)]('['+_0x11a8b8+']'));}catch(_0x18b5d9){_0x4e1162['fail'](_0x37d31d);throw _0x18b5d9;}}async function updatePackageJsonName(_0x235346){const _0x835192=a120_0x2d6f,_0x3515c6=a120_0x2bb128[_0x835192(0xce)](process[_0x835192(0xdc)](),_0x235346),_0x1df046=a120_0x2bb128['join'](_0x3515c6,_0x835192(0xd8));try{console[_0x835192(0xa9)](_0x835192(0xfa));const _0x2c518b=getRabetbaseCliPackageRoot(),_0x1155eb=a120_0x2bb128['join'](_0x2c518b,'package.json');let _0x163d9d=_0x835192(0xd3);try{const _0x1884e0=JSON[_0x835192(0xcb)](a120_0x22a6fd['readFileSync'](_0x1155eb,_0x835192(0xe7)));_0x163d9d=_0x1884e0[_0x835192(0xd5)]||_0x835192(0xd3);}catch{}const _0x4994b3=a120_0x22a6fd['readFileSync'](_0x1df046,_0x835192(0xe7)),_0x140b76=JSON['parse'](_0x4994b3);_0x140b76['name']=_0x235346,_0x140b76[_0x835192(0xc4)]=_0x235346+_0x835192(0xc1)+_0x163d9d,a120_0x22a6fd[_0x835192(0xdf)](_0x1df046,JSON[_0x835192(0x101)](_0x140b76,null,0x2)+'\x0a',_0x835192(0xe7)),console[_0x835192(0xa9)]('√\x20package.json\x20updated:\x20name='+_0x235346),logger['info'](_0x835192(0xfd),'更新\x20package.json\x20name');}catch(_0xe8c4a7){logger[_0x835192(0xcc)]('create',_0x835192(0xab));throw _0xe8c4a7;}}async function configureAppCode(_0x21be7c,_0x6eec53,_0x5a2553){const _0x5eb322=a120_0x2d6f,_0x3b78c3=a120_0x2bb128[_0x5eb322(0xce)](process['cwd'](),_0x21be7c),_0x305f86=a120_0x2bb128['join'](_0x3b78c3,NEW_CONFIG_NAME);try{_0x6eec53?console[_0x5eb322(0xa9)](_0x5eb322(0xc6)+_0x21be7c+':\x20'+_0x6eec53):console['log'](_0x5eb322(0xb2)+_0x21be7c);const _0x38f554=getRabetbaseCliPackageRoot(),_0x272d09=a120_0x2bb128[_0x5eb322(0xed)](_0x38f554,'package.json');let _0x201d3a=_0x5eb322(0xd3);try{const _0x5e2dec=JSON[_0x5eb322(0xcb)](a120_0x22a6fd[_0x5eb322(0xbc)](_0x272d09,_0x5eb322(0xe7)));_0x201d3a=_0x5e2dec[_0x5eb322(0xd5)]||_0x5eb322(0xd3);}catch{}const _0xfb31bf=readConfig(),_0x3fdfa2=typeof _0xfb31bf[_0x5eb322(0xaf)]===_0x5eb322(0xef)?_0xfb31bf['env']:undefined,_0x7429b2={};for(const _0x47742d of PROJECT_CREATE_INHERITABLE_KEYS){if(_0xfb31bf[_0x47742d]!=null)_0x7429b2[_0x47742d]=_0xfb31bf[_0x47742d];}const _0x8e54da=buildCanonicalProjectConfig(_0x7429b2,{'appCodes':_0x6eec53?[_0x6eec53]:[],'env':_0x5a2553||_0x3fdfa2||_0x5eb322(0xe2),'metadata':{'createdAt':new Date()[_0x5eb322(0xdd)](),'version':_0x201d3a}});writeConfigFile(_0x305f86,_0x8e54da),_0x6eec53?console[_0x5eb322(0xa9)](_0x5eb322(0xb1)+Object[_0x5eb322(0xd9)](_0x8e54da['apps']||{})[_0x5eb322(0xed)](',\x20')+_0x5eb322(0xf8)+_0x8e54da[_0x5eb322(0xf2)]):console[_0x5eb322(0xa9)](_0x5eb322(0xba)+CLI_BIN_NAME+'\x20config\x20set\x20appcode\x20<app-code>\x27'),logger['info'](_0x5eb322(0xfd),'配置应用AppCode:\x20'+_0x6eec53);}catch(_0x44395d){logger[_0x5eb322(0xcc)](_0x5eb322(0xfd),_0x5eb322(0xb9));}}
|
|
1
|
+
(function(_0x3d35fe,_0x531cdd){const _0x56058e=a119_0x4faa,_0x8729c=_0x3d35fe();while(!![]){try{const _0x28dde1=parseInt(_0x56058e(0x1e5))/0x1+-parseInt(_0x56058e(0x18f))/0x2+parseInt(_0x56058e(0x18e))/0x3*(-parseInt(_0x56058e(0x191))/0x4)+parseInt(_0x56058e(0x1c4))/0x5*(parseInt(_0x56058e(0x195))/0x6)+-parseInt(_0x56058e(0x1d5))/0x7*(parseInt(_0x56058e(0x1a1))/0x8)+-parseInt(_0x56058e(0x1de))/0x9*(-parseInt(_0x56058e(0x19c))/0xa)+parseInt(_0x56058e(0x1a5))/0xb*(parseInt(_0x56058e(0x1c9))/0xc);if(_0x28dde1===_0x531cdd)break;else _0x8729c['push'](_0x8729c['shift']());}catch(_0x43d664){_0x8729c['push'](_0x8729c['shift']());}}}(a119_0x5b5b,0xaa291));import a119_0x2581f8 from'path';function a119_0x5b5b(){const _0x5f3b26=['12diwYQf','🚀\x20Next\x20Steps:','\x20model(s)','*\x20Pulling\x20API\x20configuration...','CLI\x20版本检查','项目创建完成:\x20','\x20|\x20AppCode:\x20','test','message','*\x20Configuring\x20AppCode\x20for\x20project\x20','log','\x20config\x20set\x20appcode\x20<app-code>\x27','4543eAaLIs','resolve','projectName','\x20&&\x20','production','green','string','env','existsSync','6687WmiGMD','utf8','\x20\x202.\x20Pull\x20API\x20configuration:\x20','error','join','description','\x20run\x20start','181186MSVbbg','配置应用AppCode失败','start','Project\x20name\x20cannot\x20be\x20empty','projectCode','6wpSGWF','723390ThYUCP','Format\x20code','1347492TuVUom','Copy\x20project\x20files','appCode','name','5556606ZwGKGS','rmSync','更新\x20package.json\x20name','length','Project\x20name:\x20','stableVersion','chdir','14990TArpgu','belowMinimum','bold','\x20Generated\x20by\x20rabetbase\x20cli\x20','\x20\x201.\x20Start\x20project:\x20','12984QDoytG','√\x20Pulled\x20','\x20dataset(s),\x20generated\x20','success','6211711qvqucB','√\x20Configuration\x20file\x20created,\x20Apps:\x20','更新\x20package.json\x20失败','\x20api\x20pull','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','needsUpgrade','parse','trim','\x20already\x20exists','1.0.0','version','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','minimumVersion','setLogPath','cd\x20','stringify','gray','create','API\x20configuration\x20pulled:\x20','cookie','清理项目目录失败:\x20','readFileSync','constants','dirname','toLocaleString','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','repeat','...','currentVersion','cwd','info','5EUkMmy','package.json','cyan','开始创建项目:\x20','fail'];a119_0x5b5b=function(){return _0x5f3b26;};return a119_0x5b5b();}import a119_0x304ce8 from'fs';import a119_0x117a6a from'chalk';import a119_0x4cbb86 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../api/fetch-model-list.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';function a119_0x4faa(_0x436082,_0x4b26b3){_0x436082=_0x436082-0x18d;const _0x5b5b55=a119_0x5b5b();let _0x4faa93=_0x5b5b55[_0x436082];return _0x4faa93;}import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0xfd99d6){const _0x441ce9=a119_0x4faa,_0x49ade9=await checkCliVersion();(_0x49ade9[_0x441ce9(0x1aa)]||_0x49ade9['belowMinimum'])&&(printCliUpgradeWarning(_0x49ade9),assertCliVersionSupported(_0x49ade9),logger[_0x441ce9(0x1c3)](_0x441ce9(0x1b6),_0x441ce9(0x1cd),{'currentVersion':_0x49ade9[_0x441ce9(0x1c1)],'stableVersion':_0x49ade9[_0x441ce9(0x19a)],'minimumVersion':_0x49ade9[_0x441ce9(0x1b1)],'needsUpgrade':_0x49ade9[_0x441ce9(0x1aa)],'belowMinimum':_0x49ade9[_0x441ce9(0x19d)]}));if(_0xfd99d6['projectCode']&&_0xfd99d6[_0x441ce9(0x193)])await runCreate({'projectName':_0xfd99d6['projectCode'],'appCode':_0xfd99d6[_0x441ce9(0x193)],'env':_0xfd99d6[_0x441ce9(0x1dc)]},_0xfd99d6);else{if(_0xfd99d6['projectCode']){const _0x3dd46a=await selectSingleAppcode(_0xfd99d6[_0x441ce9(0x1b8)]);await runCreate({'projectName':_0xfd99d6[_0x441ce9(0x18d)],'appCode':_0x3dd46a||undefined,'env':_0xfd99d6[_0x441ce9(0x1dc)]},_0xfd99d6);}else await guidedCreateProject(_0x57a9d7=>runCreate(_0x57a9d7,_0xfd99d6),_0xfd99d6[_0x441ce9(0x1dc)],_0xfd99d6[_0x441ce9(0x1b8)]);}}async function runCreate(_0x37d129,_0x1b68e5){const _0x3532d2=a119_0x4faa;if(!_0x37d129[_0x3532d2(0x1d7)]||_0x37d129[_0x3532d2(0x1d7)][_0x3532d2(0x1ac)]()==='')throw new Error(_0x3532d2(0x1e8));const _0x54a14d=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x54a14d[_0x3532d2(0x1d0)](_0x37d129[_0x3532d2(0x1d7)]))throw new Error('Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters');if(_0x37d129[_0x3532d2(0x1d7)][_0x3532d2(0x198)]>0x64)throw new Error('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters');const _0x21ee86=a119_0x2581f8['resolve'](process[_0x3532d2(0x1c2)](),_0x37d129[_0x3532d2(0x1d7)]);if(a119_0x304ce8[_0x3532d2(0x1dd)](_0x21ee86))throw new Error('Project\x20directory\x20'+_0x37d129[_0x3532d2(0x1d7)]+_0x3532d2(0x1ad));try{a119_0x304ce8['accessSync'](a119_0x2581f8[_0x3532d2(0x1bc)](_0x21ee86),a119_0x304ce8[_0x3532d2(0x1bb)]['W_OK']);}catch{throw new Error(_0x3532d2(0x1be));}logger[_0x3532d2(0x1b2)](_0x21ee86),logger[_0x3532d2(0x1c3)](_0x3532d2(0x1b6),_0x3532d2(0x1c7)+_0x37d129[_0x3532d2(0x1d7)],{'projectDir':_0x21ee86,'appCode':_0x37d129['appCode']}),console[_0x3532d2(0x1d3)](),console[_0x3532d2(0x1d3)](a119_0x117a6a[_0x3532d2(0x1da)]('\x20√\x20')+_0x3532d2(0x199)+a119_0x117a6a[_0x3532d2(0x1da)](_0x37d129[_0x3532d2(0x1d7)])+(_0x37d129['appCode']?_0x3532d2(0x1cf)+a119_0x117a6a['cyan'](_0x37d129[_0x3532d2(0x193)]):''));try{await runTask(_0x3532d2(0x192),()=>copyProjectTemplate(_0x37d129[_0x3532d2(0x1d7)])),await updatePackageJsonName(_0x37d129[_0x3532d2(0x1d7)]),await runTask('Install\x20dependencies',()=>installDependencies(_0x37d129['projectName'])),await runTask(_0x3532d2(0x190),()=>formatProjectCode(_0x37d129[_0x3532d2(0x1d7)])),await configureAppCode(_0x37d129[_0x3532d2(0x1d7)],_0x37d129['appCode']||'',_0x37d129[_0x3532d2(0x1dc)]);let _0xa667e8=![];if(_0x37d129['appCode']){console[_0x3532d2(0x1d3)](_0x3532d2(0x1cc));const _0x286e9c=process[_0x3532d2(0x1c2)]();try{process[_0x3532d2(0x19b)](_0x21ee86);const _0x1c6e32=_0x37d129[_0x3532d2(0x1dc)]||'production';initEnv(_0x1c6e32);const {configArray:_0x5b46af}=await fetchModelList(_0x37d129[_0x3532d2(0x193)],_0x1b68e5[_0x3532d2(0x1b8)]||''),_0x5e8218=DEFAULT_API_DIR,_0x5598a1=await generateApiFile(_0x5b46af,'',_0x37d129[_0x3532d2(0x193)],!![],_0x1c6e32,_0x5e8218);console[_0x3532d2(0x1d3)](_0x3532d2(0x1a2)+_0x5b46af[_0x3532d2(0x198)]+_0x3532d2(0x1a3)+_0x5598a1['modelCount']+_0x3532d2(0x1cb)),logger[_0x3532d2(0x1c3)](_0x3532d2(0x1b6),_0x3532d2(0x1b7)+_0x37d129['appCode']);}catch(_0x1a43b4){_0xa667e8=!![],console['log']('!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull'),logger['warn'](_0x3532d2(0x1b6),'API\x20配置拉取异常',{'error':_0x1a43b4 instanceof Error?_0x1a43b4[_0x3532d2(0x1d1)]:String(_0x1a43b4)});}finally{process[_0x3532d2(0x19b)](_0x286e9c);}}logger[_0x3532d2(0x1a4)](_0x3532d2(0x1b6),_0x3532d2(0x1ce)+_0x37d129[_0x3532d2(0x1d7)]),console['log'](),console[_0x3532d2(0x1d3)](a119_0x117a6a[_0x3532d2(0x1da)]('─'[_0x3532d2(0x1bf)](0x3c))),console[_0x3532d2(0x1d3)](a119_0x117a6a[_0x3532d2(0x1c6)]['bold'](_0x3532d2(0x1ca))),console['log'](),console[_0x3532d2(0x1d3)](_0x3532d2(0x1a0)+a119_0x117a6a[_0x3532d2(0x1c6)][_0x3532d2(0x19e)](_0x3532d2(0x1b3)+_0x37d129[_0x3532d2(0x1d7)]+_0x3532d2(0x1d8)+CLI_BIN_NAME+_0x3532d2(0x1e4))),_0xa667e8&&console[_0x3532d2(0x1d3)](_0x3532d2(0x1e0)+a119_0x117a6a['cyan'][_0x3532d2(0x19e)](CLI_BIN_NAME+_0x3532d2(0x1a8))),console[_0x3532d2(0x1d3)](a119_0x117a6a['green']('─'[_0x3532d2(0x1bf)](0x3c)));}catch(_0x55eb9d){logger[_0x3532d2(0x1e1)](_0x3532d2(0x1b6),'项目创建失败:\x20'+_0x37d129[_0x3532d2(0x1d7)],{'error':_0x55eb9d instanceof Error?_0x55eb9d['message']:String(_0x55eb9d)});try{a119_0x304ce8['existsSync'](_0x21ee86)&&(console['log'](_0x3532d2(0x1a9)+_0x21ee86),a119_0x304ce8[_0x3532d2(0x196)](_0x21ee86,{'recursive':!![],'force':!![]}));}catch{logger['warn'](_0x3532d2(0x1b6),_0x3532d2(0x1b9)+_0x21ee86);}throw _0x55eb9d;}}async function runTask(_0x598a69,_0x105063){const _0x29cbe6=a119_0x4faa,_0x36a976=a119_0x4cbb86(_0x598a69+_0x29cbe6(0x1c0))[_0x29cbe6(0x1e7)]();try{const _0x465322=await _0x105063();_0x36a976['stop'](),console[_0x29cbe6(0x1d3)](''+a119_0x117a6a[_0x29cbe6(0x1da)]('\x20√\x20')+_0x598a69+'\x20'+a119_0x117a6a[_0x29cbe6(0x1b5)]('['+_0x465322+']'));}catch(_0x2dd558){_0x36a976[_0x29cbe6(0x1c8)](_0x598a69);throw _0x2dd558;}}async function updatePackageJsonName(_0x383d49){const _0x57198c=a119_0x4faa,_0x5225f0=a119_0x2581f8[_0x57198c(0x1d6)](process['cwd'](),_0x383d49),_0x4d4b3f=a119_0x2581f8[_0x57198c(0x1e2)](_0x5225f0,_0x57198c(0x1c5));try{console[_0x57198c(0x1d3)]('*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields');const _0x19e67f=getRabetbaseCliPackageRoot(),_0x1ffcab=a119_0x2581f8[_0x57198c(0x1e2)](_0x19e67f,_0x57198c(0x1c5));let _0x1f3d60=_0x57198c(0x1ae);try{const _0x47e13f=JSON[_0x57198c(0x1ab)](a119_0x304ce8[_0x57198c(0x1ba)](_0x1ffcab,'utf8'));_0x1f3d60=_0x47e13f[_0x57198c(0x1af)]||_0x57198c(0x1ae);}catch{}const _0x1cc9f2=a119_0x304ce8[_0x57198c(0x1ba)](_0x4d4b3f,_0x57198c(0x1df)),_0x129e34=JSON[_0x57198c(0x1ab)](_0x1cc9f2);_0x129e34[_0x57198c(0x194)]=_0x383d49,_0x129e34[_0x57198c(0x1e3)]=_0x383d49+_0x57198c(0x19f)+_0x1f3d60,a119_0x304ce8['writeFileSync'](_0x4d4b3f,JSON[_0x57198c(0x1b4)](_0x129e34,null,0x2)+'\x0a','utf8'),console[_0x57198c(0x1d3)]('√\x20package.json\x20updated:\x20name='+_0x383d49),logger[_0x57198c(0x1c3)](_0x57198c(0x1b6),_0x57198c(0x197));}catch(_0xc91ebf){logger[_0x57198c(0x1e1)](_0x57198c(0x1b6),_0x57198c(0x1a7));throw _0xc91ebf;}}async function configureAppCode(_0x35bae4,_0x573b95,_0x5bb0fb){const _0x5c2dd9=a119_0x4faa,_0xccb99=a119_0x2581f8[_0x5c2dd9(0x1d6)](process[_0x5c2dd9(0x1c2)](),_0x35bae4),_0x1cdba4=a119_0x2581f8['join'](_0xccb99,NEW_CONFIG_NAME);try{_0x573b95?console[_0x5c2dd9(0x1d3)](_0x5c2dd9(0x1d2)+_0x35bae4+':\x20'+_0x573b95):console[_0x5c2dd9(0x1d3)](_0x5c2dd9(0x1b0)+_0x35bae4);const _0x30881e=getRabetbaseCliPackageRoot(),_0x2b1d09=a119_0x2581f8[_0x5c2dd9(0x1e2)](_0x30881e,'package.json');let _0x1901c0='1.0.0';try{const _0x28da7b=JSON[_0x5c2dd9(0x1ab)](a119_0x304ce8[_0x5c2dd9(0x1ba)](_0x2b1d09,_0x5c2dd9(0x1df)));_0x1901c0=_0x28da7b[_0x5c2dd9(0x1af)]||_0x5c2dd9(0x1ae);}catch{}const _0x31f956=readConfig(),_0x24904e=typeof _0x31f956[_0x5c2dd9(0x1dc)]===_0x5c2dd9(0x1db)?_0x31f956[_0x5c2dd9(0x1dc)]:undefined,_0x26a023={};for(const _0x4b192a of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x31f956[_0x4b192a]!=null)_0x26a023[_0x4b192a]=_0x31f956[_0x4b192a];}const _0x1dda7c=buildCanonicalProjectConfig(_0x26a023,{'appCodes':_0x573b95?[_0x573b95]:[],'env':_0x5bb0fb||_0x24904e||_0x5c2dd9(0x1d9),'metadata':{'createdAt':new Date()[_0x5c2dd9(0x1bd)](),'version':_0x1901c0}});writeConfigFile(_0x1cdba4,_0x1dda7c),_0x573b95?console[_0x5c2dd9(0x1d3)](_0x5c2dd9(0x1a6)+Object['keys'](_0x1dda7c['apps']||{})[_0x5c2dd9(0x1e2)](',\x20')+'\x20|\x20Default:\x20'+_0x1dda7c['defaultApp']):console[_0x5c2dd9(0x1d3)]('√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27'+CLI_BIN_NAME+_0x5c2dd9(0x1d4)),logger[_0x5c2dd9(0x1c3)](_0x5c2dd9(0x1b6),'配置应用AppCode:\x20'+_0x573b95);}catch(_0x48c093){logger[_0x5c2dd9(0x1e1)](_0x5c2dd9(0x1b6),_0x5c2dd9(0x1e6));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2412cc,_0x5c1be5){const _0x523dbf=a120_0x508e,_0x2efde0=_0x2412cc();while(!![]){try{const _0x2f2897=-parseInt(_0x523dbf(0x1bc))/0x1+-parseInt(_0x523dbf(0x1e2))/0x2+-parseInt(_0x523dbf(0x1b8))/0x3+parseInt(_0x523dbf(0x1de))/0x4+-parseInt(_0x523dbf(0x1be))/0x5*(-parseInt(_0x523dbf(0x1b9))/0x6)+-parseInt(_0x523dbf(0x1c4))/0x7*(parseInt(_0x523dbf(0x1c9))/0x8)+-parseInt(_0x523dbf(0x1b3))/0x9*(-parseInt(_0x523dbf(0x1e0))/0xa);if(_0x2f2897===_0x5c1be5)break;else _0x2efde0['push'](_0x2efde0['shift']());}catch(_0x16bce6){_0x2efde0['push'](_0x2efde0['shift']());}}}(a120_0x2ab0,0xb2c24));import a120_0x5645dc from'path';import a120_0x360ce6 from'fs/promises';function a120_0x508e(_0x574174,_0x60e853){_0x574174=_0x574174-0x1b2;const _0x2ab08a=a120_0x2ab0();let _0x508e65=_0x2ab08a[_0x574174];return _0x508e65;}import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';function a120_0x2ab0(){const _0x215e10=['W_OK','Cannot\x20create\x20project\x20in\x20current\x20directory.','\x22\x20already\x20exists.','trim','1359009StFVUM','1767462GLQdHs','Project\x20name\x20cannot\x20be\x20empty.','log','1388817jxzORB','validation','15VIKnaM','resolve','\x20\x20√\x20Pulled\x20','parse','join','package.json','190519JJxUSW','A\x20project\x20created\x20with\x20Lovrabet\x20CLI','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','needsUpgrade','ignore','336dacwNk','\x20model(s)','constants','string','bun','dirname','\x20created\x20successfully!','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','name','\x0a√\x20Project\x20','length','npm','stringify','utf-8','\x20\x20√\x20Configuration\x20file\x20created','cwd','\x20\x20√\x20Project\x20template\x20created','bun\x20--version','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','\x20\x20rabetbase\x20run\x20start\x0a','*\x20Creating\x20project\x20','3144884jdhTLd','\x0a\x20\x20cd\x20','110Siamdd','\x20dataset(s),\x20generated\x20','2383830SYwZDv','\x20\x20√\x20package.json\x20updated','\x20api\x20pull`\x20manually\x20later.','\x20\x20Installing\x20dependencies...','belowMinimum','modelCount','...','toLocaleString','production','readFile','description','env','access','2650167mubJPx'];a120_0x2ab0=function(){return _0x215e10;};return a120_0x2ab0();}import{promisify}from'util';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{readConfig}from'../../../utils/config.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';import{fetchModelList}from'../../../api/fetch-model-list.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x2b387b,_0x3a3372,_0x2c0195,_0x19ee7d){const _0x3dd06c=a120_0x508e,_0x23b36f=await checkCliVersion();(_0x23b36f[_0x3dd06c(0x1c7)]||_0x23b36f[_0x3dd06c(0x1e6)])&&(printCliUpgradeWarning(_0x23b36f),assertCliVersionSupported(_0x23b36f));if(!_0x2b387b||_0x2b387b[_0x3dd06c(0x1b7)]()==='')throw CliErrors[_0x3dd06c(0x1bd)](_0x3dd06c(0x1ba));const _0x2a8cde=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x2a8cde['test'](_0x2b387b))throw CliErrors[_0x3dd06c(0x1bd)]('Project\x20name\x20contains\x20invalid\x20characters.',_0x3dd06c(0x1d0));if(_0x2b387b[_0x3dd06c(0x1d3)]>0x64)throw CliErrors[_0x3dd06c(0x1bd)](_0x3dd06c(0x1db));const _0x3303c2=a120_0x5645dc[_0x3dd06c(0x1bf)](process['cwd'](),_0x2b387b);if(existsSync(_0x3303c2))throw CliErrors[_0x3dd06c(0x1bd)]('Project\x20directory\x20\x22'+_0x2b387b+_0x3dd06c(0x1b6),'Use\x20a\x20different\x20project\x20name.');try{const _0x434fb1=a120_0x5645dc[_0x3dd06c(0x1ce)](_0x3303c2);await a120_0x360ce6[_0x3dd06c(0x1b2)](_0x434fb1,a120_0x360ce6[_0x3dd06c(0x1cb)][_0x3dd06c(0x1b4)]);}catch{throw CliErrors[_0x3dd06c(0x1bd)](_0x3dd06c(0x1b5),'Check\x20directory\x20permissions.');}try{console['log'](_0x3dd06c(0x1dd)+_0x2b387b+_0x3dd06c(0x1e8));const _0x4bd1b6=getSubAppReactDemoTemplateDir();await copyDirectory(_0x4bd1b6,_0x3303c2),console[_0x3dd06c(0x1bb)](_0x3dd06c(0x1d9)),await updatePackageJsonName(_0x2b387b),console[_0x3dd06c(0x1bb)](_0x3dd06c(0x1e3)),console[_0x3dd06c(0x1bb)](_0x3dd06c(0x1e5)),console[_0x3dd06c(0x1bb)]('\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)'),await formatCode(_0x3303c2),console['log']('\x20\x20√\x20Code\x20formatted'),await configureProject(_0x2b387b,_0x2c0195,_0x3a3372),console[_0x3dd06c(0x1bb)](_0x3dd06c(0x1d7)),_0x2c0195&&await pullApiConfig(_0x3303c2,_0x2c0195,_0x3a3372,_0x19ee7d),console[_0x3dd06c(0x1bb)](_0x3dd06c(0x1d2)+_0x2b387b+_0x3dd06c(0x1cf)),console[_0x3dd06c(0x1bb)](_0x3dd06c(0x1df)+_0x2b387b),console['log'](_0x3dd06c(0x1dc));}catch(_0x275f3f){try{existsSync(_0x3303c2)&&await a120_0x360ce6['rm'](_0x3303c2,{'recursive':!![],'force':!![]});}catch{}throw _0x275f3f;}}async function updatePackageJsonName(_0x35d762){const _0x4d16d0=a120_0x508e,_0x2283b6=a120_0x5645dc['resolve'](process['cwd'](),_0x35d762),_0x2e9705=a120_0x5645dc[_0x4d16d0(0x1c2)](_0x2283b6,_0x4d16d0(0x1c3)),_0x4e2dcd=await a120_0x360ce6[_0x4d16d0(0x1eb)](_0x2e9705,_0x4d16d0(0x1d6)),_0x3962e5=JSON[_0x4d16d0(0x1c1)](_0x4e2dcd);_0x3962e5[_0x4d16d0(0x1d1)]=_0x35d762,_0x3962e5[_0x4d16d0(0x1ec)]=_0x4d16d0(0x1c5),await a120_0x360ce6['writeFile'](_0x2e9705,JSON[_0x4d16d0(0x1d5)](_0x3962e5,null,0x2)+'\x0a');}function detectPackageManager(){const _0x2eb9fd=a120_0x508e;try{return execSync(_0x2eb9fd(0x1da),{'stdio':_0x2eb9fd(0x1c8)}),_0x2eb9fd(0x1cd);}catch{return _0x2eb9fd(0x1d4);}}async function formatCode(_0x47e35d){try{await execAsync('bun\x20run\x20format',{'cwd':_0x47e35d});}catch{}}async function configureProject(_0x45608c,_0x4df499,_0x59ca9f){const _0x20e3de=a120_0x508e,_0x4031e3=a120_0x5645dc[_0x20e3de(0x1bf)](process[_0x20e3de(0x1d8)](),_0x45608c),_0x36cb94=a120_0x5645dc[_0x20e3de(0x1c2)](_0x4031e3,NEW_CONFIG_NAME),_0x323525=readConfig(),_0x5a1259=typeof _0x323525[_0x20e3de(0x1ed)]===_0x20e3de(0x1cc)?_0x323525[_0x20e3de(0x1ed)]:undefined,_0x29d739={};for(const _0x515552 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x323525[_0x515552]!=null)_0x29d739[_0x515552]=_0x323525[_0x515552];}const _0x5ecbef=buildCanonicalProjectConfig(_0x29d739,{'appCodes':_0x4df499?[_0x4df499]:[],'env':_0x59ca9f||_0x5a1259||_0x20e3de(0x1ea),'metadata':{'createdAt':new Date()[_0x20e3de(0x1e9)](),'version':getCliVersion()}});writeConfigFile(_0x36cb94,_0x5ecbef);}async function pullApiConfig(_0x616c78,_0x1ce323,_0x2e007a,_0x5c5ab9){const _0x1316f3=a120_0x508e,_0x23f7d4=process['cwd']();try{process['chdir'](_0x616c78);const _0x15c79b=_0x2e007a||'production';initEnv(_0x15c79b),console[_0x1316f3(0x1bb)]('\x20\x20Pulling\x20API\x20configuration...');const {configArray:_0x33535a}=await fetchModelList(_0x1ce323,_0x5c5ab9||''),_0xc4de8a=await generateApiFile(_0x33535a,'',_0x1ce323,!![],_0x15c79b,DEFAULT_API_DIR);console['log'](_0x1316f3(0x1c0)+_0x33535a[_0x1316f3(0x1d3)]+_0x1316f3(0x1e1)+_0xc4de8a[_0x1316f3(0x1e7)]+_0x1316f3(0x1ca));}catch(_0x4e001b){console[_0x1316f3(0x1bb)](_0x1316f3(0x1c6)+CLI_BIN_NAME+_0x1316f3(0x1e4));}finally{process['chdir'](_0x23f7d4);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a121_0x2d0b48=a121_0x3c79;(function(_0xf60b90,_0x1edf1d){const _0x578aa7=a121_0x3c79,_0x152564=_0xf60b90();while(!![]){try{const _0x112cc1=-parseInt(_0x578aa7(0x144))/0x1+-parseInt(_0x578aa7(0x142))/0x2+-parseInt(_0x578aa7(0x148))/0x3*(-parseInt(_0x578aa7(0x150))/0x4)+-parseInt(_0x578aa7(0x143))/0x5+-parseInt(_0x578aa7(0x14d))/0x6+-parseInt(_0x578aa7(0x146))/0x7*(parseInt(_0x578aa7(0x14c))/0x8)+parseInt(_0x578aa7(0x149))/0x9*(parseInt(_0x578aa7(0x145))/0xa);if(_0x112cc1===_0x1edf1d)break;else _0x152564['push'](_0x152564['shift']());}catch(_0x2f0767){_0x152564['push'](_0x152564['shift']());}}}(a121_0x35e9,0x3318c));function a121_0x35e9(){const _0x57bc7d=['261591PBGVad','35019ttRceT','resolve','dirname','8AWlKNI','642264amcbLl','sub-app-react-demo','projects','16hfxQLA','templates','690062rdQwPy','1167510pZjJQX','190826oyCCMp','2540ijcsAu','1759849lShhFR','join'];a121_0x35e9=function(){return _0x57bc7d;};return a121_0x35e9();}function a121_0x3c79(_0x4fd775,_0x17a2a2){_0x4fd775=_0x4fd775-0x142;const _0x35e98c=a121_0x35e9();let _0x3c7966=_0x35e98c[_0x4fd775];return _0x3c7966;}import a121_0xd6e23f from'node:path';import{fileURLToPath}from'node:url';const __dirname=a121_0xd6e23f[a121_0x2d0b48(0x14b)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x219984=a121_0x2d0b48;return a121_0xd6e23f[_0x219984(0x14a)](__dirname,'../../../../');}export function getSubAppReactDemoTemplateDir(){const _0x5228f6=a121_0x2d0b48;return a121_0xd6e23f[_0x5228f6(0x147)](getRabetbaseCliPackageRoot(),_0x5228f6(0x151),_0x5228f6(0x14f),_0x5228f6(0x14e));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a122_0x41a4(_0x1d7d38,_0x48b58d){_0x1d7d38=_0x1d7d38-0x1d3;const _0xbff4ee=a122_0xbff4();let _0x41a42b=_0xbff4ee[_0x1d7d38];return _0x41a42b;}(function(_0x16f61c,_0x4b4511){const _0x352e13=a122_0x41a4,_0xbb9855=_0x16f61c();while(!![]){try{const _0x4d86e6=parseInt(_0x352e13(0x1de))/0x1*(parseInt(_0x352e13(0x1e0))/0x2)+-parseInt(_0x352e13(0x1e6))/0x3+-parseInt(_0x352e13(0x1db))/0x4+-parseInt(_0x352e13(0x1dd))/0x5*(parseInt(_0x352e13(0x1e5))/0x6)+parseInt(_0x352e13(0x1e1))/0x7+-parseInt(_0x352e13(0x1d8))/0x8+parseInt(_0x352e13(0x1d5))/0x9*(parseInt(_0x352e13(0x1d3))/0xa);if(_0x4d86e6===_0x4b4511)break;else _0xbb9855['push'](_0xbb9855['shift']());}catch(_0x2a98fd){_0xbb9855['push'](_0xbb9855['shift']());}}}(a122_0xbff4,0xd54c7));import a122_0x4c071f from'node:path';import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a122_0xbff4(){const _0x49756b=['49FWeWsa','error','64426wtyeNX','8141945fmHWJP','开始复制项目模板','message','项目模板复制完成','8286xSujws','5045919xTeRPp','success','5310taqSCI','项目模板复制失败','40347BfPWpN','resolve','copy','8138384vjiRLp','info','cwd','5417528pMIGRR','now','705FJKstS'];a122_0xbff4=function(){return _0x49756b;};return a122_0xbff4();}import{logger}from'../../../utils/logger.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x27a44e){const _0x13d1f6=a122_0x41a4,_0x1dcbcb=Date[_0x13d1f6(0x1dc)](),_0xdb8447=a122_0x4c071f[_0x13d1f6(0x1d6)](process[_0x13d1f6(0x1da)](),_0x27a44e);try{logger[_0x13d1f6(0x1d9)](_0x13d1f6(0x1d7),_0x13d1f6(0x1e2),{'projectCode':_0x27a44e,'templateDir':templateDir}),await copyDirectory(templateDir,_0xdb8447);const _0x3ace0b=Date[_0x13d1f6(0x1dc)]()-_0x1dcbcb;logger[_0x13d1f6(0x1e7)]('copy',_0x13d1f6(0x1e4),_0x3ace0b,{'projectCode':_0x27a44e});}catch(_0x316557){const _0x54ab7b=Date[_0x13d1f6(0x1dc)]()-_0x1dcbcb;logger[_0x13d1f6(0x1df)](_0x13d1f6(0x1d7),_0x13d1f6(0x1d4),{'projectCode':_0x27a44e,'error':_0x316557 instanceof Error?_0x316557[_0x13d1f6(0x1e3)]:String(_0x316557),'duration':_0x54ab7b});throw _0x316557;}return formatElapsed(_0x1dcbcb);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0xf65638,_0x38bc33){const _0xcc322a=a123_0x27c7,_0x16c866=_0xf65638();while(!![]){try{const _0x57b28b=-parseInt(_0xcc322a(0xc2))/0x1+-parseInt(_0xcc322a(0xd5))/0x2+parseInt(_0xcc322a(0xcf))/0x3+parseInt(_0xcc322a(0xc8))/0x4*(parseInt(_0xcc322a(0xbe))/0x5)+parseInt(_0xcc322a(0xc6))/0x6*(-parseInt(_0xcc322a(0xc1))/0x7)+parseInt(_0xcc322a(0xd2))/0x8*(parseInt(_0xcc322a(0xd4))/0x9)+parseInt(_0xcc322a(0xcc))/0xa*(parseInt(_0xcc322a(0xd3))/0xb);if(_0x57b28b===_0x38bc33)break;else _0x16c866['push'](_0x16c866['shift']());}catch(_0x2c6a16){_0x16c866['push'](_0x16c866['shift']());}}}(a123_0x1b75,0x5b8d4));import a123_0x2f6185 from'node:path';function a123_0x27c7(_0xda695e,_0x1635c6){_0xda695e=_0xda695e-0xbe;const _0x1b750f=a123_0x1b75();let _0x27c772=_0x1b750f[_0xda695e];return _0x27c772;}import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x437e7b){const _0xf54b5b=a123_0x27c7,_0x177575=Date[_0xf54b5b(0xc9)](),_0x2a37a8=a123_0x2f6185[_0xf54b5b(0xc3)](process[_0xf54b5b(0xcb)](),_0x437e7b);try{logger[_0xf54b5b(0xce)](_0xf54b5b(0xcd),'开始格式化代码',{'projectCode':_0x437e7b}),await execa(resolveNpmBin(_0xf54b5b(0xc7)),[_0xf54b5b(0xd1),_0xf54b5b(0xbf),'.'],{'cwd':_0x2a37a8});const _0x314d96=Date[_0xf54b5b(0xc9)]()-_0x177575;logger[_0xf54b5b(0xd0)]('format',_0xf54b5b(0xc0),_0x314d96,{'projectCode':_0x437e7b});}catch(_0x56b61e){const _0x234e1e=Date[_0xf54b5b(0xc9)]()-_0x177575;logger[_0xf54b5b(0xca)](_0xf54b5b(0xcd),_0xf54b5b(0xc4),{'projectCode':_0x437e7b,'error':_0x56b61e instanceof Error?_0x56b61e[_0xf54b5b(0xc5)]:String(_0x56b61e),'duration':_0x234e1e});throw _0x56b61e;}return formatElapsed(_0x177575);}function a123_0x1b75(){const _0x4db082=['format','info','1175832vDRRYG','success','prettier','1032008gebwkI','19129gzbyMN','45bJaYQR','702488FevRmJ','955pcqHrR','--write','代码格式化完成','428911shcuqU','583876uCpqIv','resolve','代码格式化失败','message','66BUUzuf','npx','9748BTuzxs','now','error','cwd','2770KehNVh'];a123_0x1b75=function(){return _0x4db082;};return a123_0x1b75();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3303d8,_0x125bfe){const _0x1ac8b2=a124_0x3458,_0xdde244=_0x3303d8();while(!![]){try{const _0x4684b1=parseInt(_0x1ac8b2(0x1a5))/0x1*(parseInt(_0x1ac8b2(0x1b2))/0x2)+parseInt(_0x1ac8b2(0x1aa))/0x3+parseInt(_0x1ac8b2(0x1a7))/0x4*(-parseInt(_0x1ac8b2(0x19f))/0x5)+-parseInt(_0x1ac8b2(0x1a9))/0x6*(parseInt(_0x1ac8b2(0x1a6))/0x7)+-parseInt(_0x1ac8b2(0x1b1))/0x8*(-parseInt(_0x1ac8b2(0x1a0))/0x9)+-parseInt(_0x1ac8b2(0x1a8))/0xa+parseInt(_0x1ac8b2(0x1ab))/0xb;if(_0x4684b1===_0x125bfe)break;else _0xdde244['push'](_0xdde244['shift']());}catch(_0x14a024){_0xdde244['push'](_0xdde244['shift']());}}}(a124_0x506d,0x7adea));import a124_0x504d80 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';function a124_0x3458(_0x9e5762,_0xf99bd9){_0x9e5762=_0x9e5762-0x19d;const _0x506db3=a124_0x506d();let _0x3458d8=_0x506db3[_0x9e5762];return _0x3458d8;}function a124_0x506d(){const _0x290880=['5774945Wsglcw','install','error','依赖安装失败','resolve','success','750072bRUgSB','704138ihXcvX','info','https://registry.npmmirror.com','7035TRYVLm','27JsSonY','开始安装依赖','now','npm','message','1aERAeR','7EYQknJ','708MsSFpv','2959330mSqEkV','3986616JxnSVw','1663023mGiIqJ'];a124_0x506d=function(){return _0x290880;};return a124_0x506d();}export async function installDependencies(_0x37303a){const _0x400b0f=a124_0x3458,_0x4ae6ca=Date[_0x400b0f(0x1a2)](),_0x50ed28=a124_0x504d80[_0x400b0f(0x1af)](process['cwd'](),_0x37303a);try{logger[_0x400b0f(0x19d)](_0x400b0f(0x1ac),_0x400b0f(0x1a1),{'projectCode':_0x37303a,'registry':_0x400b0f(0x19e)}),await execa(resolveNpmBin(_0x400b0f(0x1a3)),[_0x400b0f(0x1ac),'--registry','https://registry.npmmirror.com'],{'cwd':_0x50ed28});const _0x345092=Date[_0x400b0f(0x1a2)]()-_0x4ae6ca;logger[_0x400b0f(0x1b0)](_0x400b0f(0x1ac),'依赖安装完成',_0x345092,{'projectCode':_0x37303a});}catch(_0x432da1){const _0xe8798c=Date[_0x400b0f(0x1a2)]()-_0x4ae6ca;logger[_0x400b0f(0x1ad)](_0x400b0f(0x1ac),_0x400b0f(0x1ae),{'projectCode':_0x37303a,'error':_0x432da1 instanceof Error?_0x432da1[_0x400b0f(0x1a4)]:String(_0x432da1),'duration':_0xe8798c});throw _0x432da1;}return formatElapsed(_0x4ae6ca);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a125_0x3387(_0x73f4af,_0x533035){_0x73f4af=_0x73f4af-0x1bc;const _0x35f1dd=a125_0x35f1();let _0x3387b9=_0x35f1dd[_0x73f4af];return _0x3387b9;}const a125_0x52dbde=a125_0x3387;(function(_0x12248c,_0x45ef84){const _0x4cc54c=a125_0x3387,_0x51f5a0=_0x12248c();while(!![]){try{const _0x34c841=parseInt(_0x4cc54c(0x1dd))/0x1*(parseInt(_0x4cc54c(0x1c2))/0x2)+-parseInt(_0x4cc54c(0x1c8))/0x3+parseInt(_0x4cc54c(0x1c3))/0x4*(-parseInt(_0x4cc54c(0x1d0))/0x5)+parseInt(_0x4cc54c(0x1d6))/0x6+parseInt(_0x4cc54c(0x1c1))/0x7+-parseInt(_0x4cc54c(0x1de))/0x8+parseInt(_0x4cc54c(0x1df))/0x9;if(_0x34c841===_0x45ef84)break;else _0x51f5a0['push'](_0x51f5a0['shift']());}catch(_0x271bae){_0x51f5a0['push'](_0x51f5a0['shift']());}}}(a125_0x35f1,0xee5ea));function a125_0x35f1(){const _0x432dd8=['bool','../../commands/project/create/main.js','1436556jmFCjp','Create\x20a\x20new\x20project','trim','Skip\x20confirmation\x20prompt','args','nonInteractive','project','5ZXiBUy','5682512ixItyG','21883932Tfbcdo','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','Auto-confirm\x20prompts','Usage:\x20','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','init','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','boolean','7770000sTHWmb','350228tPqJyi','5837424bbujkD','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','upgrade','write','appcode','4531536yRWoJR','project-name','string','../../commands/project/create/non-interactive.js','env','Target\x20environment','Project\x20name','yes','5vASVNO','cookie','str','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli'];a125_0x35f1=function(){return _0x432dd8;};return a125_0x35f1();}import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{initConfig}from'../../commands/project/init.js';import{upgradeApp}from'../../commands/project/upgrade.js';const initFlags=[{'name':a125_0x52dbde(0x1c7),'type':a125_0x52dbde(0x1ca),'description':'App\x20code\x20to\x20initialize'},{'name':a125_0x52dbde(0x1cc),'type':a125_0x52dbde(0x1ca),'description':a125_0x52dbde(0x1cd)},{'name':a125_0x52dbde(0x1cf),'type':'boolean','description':a125_0x52dbde(0x1e1),'default':![]}],createFlags=[{'name':'name','type':a125_0x52dbde(0x1ca),'description':a125_0x52dbde(0x1ce)},{'name':'env','type':'string','description':a125_0x52dbde(0x1cd)},{'name':a125_0x52dbde(0x1c7),'type':a125_0x52dbde(0x1ca),'description':a125_0x52dbde(0x1bd)}],upgradeFlags=[{'name':a125_0x52dbde(0x1cf),'type':a125_0x52dbde(0x1c0),'description':a125_0x52dbde(0x1d9),'default':![]}];export const projectDefinitions=[{'service':'project','command':a125_0x52dbde(0x1be),'description':'Initialize\x20.rabetbase.json\x20config\x20in\x20existing\x20project','risk':'write','requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':initFlags,async 'execute'(_0x2182ab){const _0x5ea919=a125_0x52dbde;return await initConfig({'appcode':_0x2182ab[_0x5ea919(0x1d2)]('appcode')||undefined,'env':_0x2182ab['str'](_0x5ea919(0x1cc))||undefined,'autoYes':_0x2182ab['bool'](_0x5ea919(0x1cf))}),{'ok':!![]};}},{'service':a125_0x52dbde(0x1dc),'command':'create','description':a125_0x52dbde(0x1d7),'risk':a125_0x52dbde(0x1c6),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a125_0x52dbde(0x1c9),'description':a125_0x52dbde(0x1c4),'required':![]}],'flags':createFlags,async 'execute'(_0x4841e5){const _0xfedbc4=a125_0x52dbde,{createApp:_0x308c43}=await import(_0xfedbc4(0x1d5)),{createProjectNonInteractive:_0xd156a8}=await import(_0xfedbc4(0x1cb)),_0x2fd68e=_0x4841e5[_0xfedbc4(0x1d2)]('name')[_0xfedbc4(0x1d8)]()||_0x4841e5[_0xfedbc4(0x1da)][0x0]?.[_0xfedbc4(0x1d8)](),_0x1736b1=_0x4841e5[_0xfedbc4(0x1d2)](_0xfedbc4(0x1cc))||undefined,_0xbb95ed=_0x4841e5[_0xfedbc4(0x1d2)](_0xfedbc4(0x1c7))||undefined;if(_0x4841e5[_0xfedbc4(0x1db)]){if(!_0x2fd68e)throw CliErrors['validation'](_0xfedbc4(0x1bf),_0xfedbc4(0x1bc)+CLI_BIN_NAME+_0xfedbc4(0x1e0));await _0xd156a8(_0x2fd68e,_0x1736b1,_0xbb95ed,_0x4841e5[_0xfedbc4(0x1d1)]);}else await _0x308c43({'projectCode':_0x2fd68e,'appCode':_0xbb95ed,'env':_0x1736b1,'cookie':_0x4841e5[_0xfedbc4(0x1d1)]});return{'ok':!![]};}},{'service':a125_0x52dbde(0x1dc),'command':a125_0x52dbde(0x1c5),'description':a125_0x52dbde(0x1d3),'risk':a125_0x52dbde(0x1c6),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x3b3dc4){const _0x42ec4c=a125_0x52dbde;return await upgradeApp(_0x3b3dc4['nonInteractive'],{'yes':_0x3b3dc4[_0x42ec4c(0x1d4)](_0x42ec4c(0x1cf))}),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x139793,_0x2400e4){const _0x3db2e8=a126_0x1a92,_0x188aa2=_0x139793();while(!![]){try{const _0x1e3a68=parseInt(_0x3db2e8(0x129))/0x1+parseInt(_0x3db2e8(0x145))/0x2*(parseInt(_0x3db2e8(0x143))/0x3)+parseInt(_0x3db2e8(0x13b))/0x4+-parseInt(_0x3db2e8(0x112))/0x5*(parseInt(_0x3db2e8(0x12c))/0x6)+-parseInt(_0x3db2e8(0x134))/0x7*(parseInt(_0x3db2e8(0x12b))/0x8)+parseInt(_0x3db2e8(0x147))/0x9+-parseInt(_0x3db2e8(0x130))/0xa*(-parseInt(_0x3db2e8(0x127))/0xb);if(_0x1e3a68===_0x2400e4)break;else _0x188aa2['push'](_0x188aa2['shift']());}catch(_0x588df1){_0x188aa2['push'](_0x188aa2['shift']());}}}(a126_0x1ab6,0x42bd0));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';function a126_0x1a92(_0x485b57,_0x2faf76){_0x485b57=_0x485b57-0x10f;const _0x1ab602=a126_0x1ab6();let _0x1a922f=_0x1ab602[_0x485b57];return _0x1a922f;}import{fileURLToPath}from'node:url';import a126_0x3f1950 from'chalk';import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';import{readRawConfig,getProjectConfigPath,writeConfigFile,NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES}from'../../context.js';function a126_0x1ab6(){const _0x53886e=['.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.','1.0.0','join','\x20api\x20pull\x27','cwd','62572RCGiVX','\x20project\x20init`\x20to\x20start\x20fresh.','.rabetbase.json','\x20→\x20.rabetbase.json','production','App\x20Code\x20cannot\x20be\x20empty','yellow','app','4785LwDRFG','.bak','4bmbjhJ','初始化项目配置文件成功','1142046dFZDvz','Invalid\x20App\x20Code','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','gray','65TBVERr','从旧配置文件升级成功','log','keys','green','\x20\x20appcode:\x20','Upgrade\x20it\x20to\x20','info','appcode','init','\x20api\x20generate\x27\x20and\x20\x27','\x20\x20Apps:\x20','✓\x20Upgraded\x20','toLocaleString','parse','?\x20(Old\x20file\x20→\x20*.bak)','defaultApp','../..','string','version','setLogPath','2875114pcMRkU','trim','318422msPDXC','apps','2156104ZqEwow','84300jkGLsO','Please\x20enter\x20App\x20Code:','\x20\x20Default:\x20','cyan','10HxEbpd','package.json','env','utf8','7FFvGwQ','\x20\x20Old\x20file\x20backed\x20up\x20as\x20'];a126_0x1ab6=function(){return _0x53886e;};return a126_0x1ab6();}import{validateAppcode}from'../../commands/common/validate.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';export async function initConfig(_0x559e39){const _0x323b21=a126_0x1a92,{appcode:_0x5b7a5b,env:_0x1623aa,autoYes:_0x15a1da}=_0x559e39,_0x53a9b2=process[_0x323b21(0x13a)]();if(getProjectConfigPath())throw new Error(_0x323b21(0x136));let _0x484c9f;for(const _0x1ca55a of LEGACY_CONFIG_NAMES){const _0xa9e3d1=resolve(_0x53a9b2,_0x1ca55a);if(existsSync(_0xa9e3d1)){_0x484c9f=_0xa9e3d1;break;}}if(_0x484c9f){let _0x472ae0={};try{_0x472ae0=JSON[_0x323b21(0x120)](readFileSync(_0x484c9f,'utf8'));}catch{}const _0x11c815=basename(_0x484c9f),_0x28b6cb=_0x472ae0?.[_0x323b21(0x11a)]||_0x472ae0?.[_0x323b21(0x142)];let _0x122617=_0x15a1da;!_0x15a1da&&(console[_0x323b21(0x114)](a126_0x3f1950[_0x323b21(0x141)](_0x323b21(0x110)+a126_0x3f1950['bold'](_0x11c815))),_0x28b6cb&&console[_0x323b21(0x114)](a126_0x3f1950[_0x323b21(0x12f)](_0x323b21(0x117)+_0x28b6cb)),_0x122617=await confirm({'message':_0x323b21(0x118)+a126_0x3f1950['bold'](_0x323b21(0x13d))+_0x323b21(0x121),'default':!![]}));if(!_0x122617){console[_0x323b21(0x114)]('Migration\x20cancelled.\x20Run\x20`'+CLI_BIN_NAME+_0x323b21(0x13c));return;}const _0x20d5bc=resolve(_0x53a9b2,NEW_CONFIG_NAME),_0x56bb3d=getCliVersionFromPkg(),_0x58e72f=readRawConfig(),_0x3a6e80=_0x5b7a5b||(typeof _0x472ae0?.[_0x323b21(0x11a)]===_0x323b21(0x124)?_0x472ae0[_0x323b21(0x11a)]:undefined)||(typeof _0x472ae0?.[_0x323b21(0x142)]==='string'?_0x472ae0[_0x323b21(0x142)]:undefined)||await askAppcode(),_0x3a6107=typeof _0x472ae0?.[_0x323b21(0x132)]===_0x323b21(0x124)?_0x472ae0['env']:typeof _0x58e72f[_0x323b21(0x132)]==='string'?_0x58e72f['env']:_0x323b21(0x13f),_0x115600=buildCanonicalProjectConfig({..._0x58e72f,..._0x472ae0},{'appCodes':[_0x3a6e80],'env':_0x3a6107,'metadata':{'version':_0x56bb3d,'migratedAt':new Date()[_0x323b21(0x11f)](),'migratedFrom':_0x484c9f}});writeConfigFile(_0x20d5bc,_0x115600);const _0x5cb3b6=_0x484c9f+_0x323b21(0x144);renameSync(_0x484c9f,_0x5cb3b6),logger[_0x323b21(0x126)](_0x53a9b2),logger[_0x323b21(0x119)](_0x323b21(0x11b),_0x323b21(0x113),{'from':_0x484c9f,'to':_0x20d5bc,'appcode':_0x3a6e80,'env':_0x115600[_0x323b21(0x132)]}),console[_0x323b21(0x114)](a126_0x3f1950['green'](_0x323b21(0x11e)+_0x11c815+_0x323b21(0x13e))),console['log'](a126_0x3f1950['cyan'](_0x323b21(0x11d)+Object[_0x323b21(0x115)](_0x115600[_0x323b21(0x12a)]||{})[_0x323b21(0x138)](',\x20'))),console['log'](a126_0x3f1950['cyan'](_0x323b21(0x12e)+_0x115600['defaultApp'])),console[_0x323b21(0x114)](a126_0x3f1950[_0x323b21(0x111)](_0x323b21(0x135)+_0x11c815+_0x323b21(0x144)));return;}const _0x3d1b94=_0x5b7a5b||await askAppcode(),_0x54dfdc=resolve(_0x53a9b2,NEW_CONFIG_NAME),_0x502b02=getCliVersionFromPkg(),_0x35f417=readRawConfig(),_0x412568=typeof _0x35f417[_0x323b21(0x132)]===_0x323b21(0x124)?_0x35f417['env']:undefined,_0x1ec060=buildCanonicalProjectConfig({},{'appCodes':[_0x3d1b94],'env':_0x1623aa||_0x412568||_0x323b21(0x13f),'metadata':{'version':_0x502b02,'createdAt':new Date()[_0x323b21(0x11f)]()}});writeConfigFile(_0x54dfdc,_0x1ec060),logger[_0x323b21(0x126)](_0x53a9b2),logger[_0x323b21(0x119)](_0x323b21(0x11b),_0x323b21(0x146),{'appcode':_0x3d1b94,'env':_0x1ec060[_0x323b21(0x132)],'version':_0x1ec060['version'],'configPath':_0x54dfdc}),console[_0x323b21(0x114)](a126_0x3f1950[_0x323b21(0x116)]('✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory')),console['log'](a126_0x3f1950[_0x323b21(0x12f)]('\x20\x20Apps:\x20'+Object[_0x323b21(0x115)](_0x1ec060[_0x323b21(0x12a)]||{})[_0x323b21(0x138)](',\x20'))),console[_0x323b21(0x114)](a126_0x3f1950[_0x323b21(0x12f)](_0x323b21(0x12e)+_0x1ec060[_0x323b21(0x122)])),console[_0x323b21(0x114)]('\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27'+CLI_BIN_NAME+_0x323b21(0x11c)+CLI_BIN_NAME+_0x323b21(0x139));}function askAppcode(){const _0x32e7a2=a126_0x1a92;return input({'message':_0x32e7a2(0x12d),'validate':_0x147832=>{const _0x563c6c=_0x32e7a2;if(!_0x147832[_0x563c6c(0x128)]())return _0x563c6c(0x140);const {valid:_0x56912f,message:_0x2b773f}=validateAppcode(_0x147832[_0x563c6c(0x128)]());return _0x56912f||_0x2b773f||_0x563c6c(0x10f);}});}function getCliVersionFromPkg(){const _0x3b434f=a126_0x1a92;try{const _0x124d3=fileURLToPath(import.meta.url),_0x3711c1=resolve(dirname(_0x124d3),_0x3b434f(0x123)),_0x3f3886=JSON[_0x3b434f(0x120)](readFileSync(resolve(_0x3711c1,_0x3b434f(0x131)),_0x3b434f(0x133)));return _0x3f3886[_0x3b434f(0x125)]||_0x3b434f(0x137);}catch{return _0x3b434f(0x137);}}
|