@lovrabet/rabetbase-cli 2.5.0 → 2.5.1-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/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/api/generate-sdk-config-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.d.ts +7 -0
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/members-list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/delete.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/init.d.ts +1 -1
- package/lib/commands/config/init.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/business-groups.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-restore.d.ts +107 -0
- package/lib/commands/dataset/field-restore.js +1 -0
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/dataset/user-deleted-field-list.d.ts +36 -0
- package/lib/commands/dataset/user-deleted-field-list.js +1 -0
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff-refresh-start.js +1 -1
- package/lib/commands/db/diff-refresh-status.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/table-diff-shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/deployment/auto-sync.d.ts +28 -0
- package/lib/commands/deployment/auto-sync.js +1 -0
- package/lib/commands/deployment/index.d.ts +2 -0
- package/lib/commands/deployment/index.js +1 -0
- package/lib/commands/deployment/sync.d.ts +2 -0
- package/lib/commands/deployment/sync.js +1 -0
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/kb/create.js +1 -1
- package/lib/commands/kb/delete.js +1 -1
- package/lib/commands/kb/detail.js +1 -1
- package/lib/commands/kb/index.js +1 -1
- package/lib/commands/kb/list.js +1 -1
- package/lib/commands/kb/search.js +1 -1
- package/lib/commands/kb/shared.js +1 -1
- package/lib/commands/kb/update.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/asset-update.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -1
- package/lib/commands/menu/external-link-update.js +1 -1
- package/lib/commands/menu/group-create.js +1 -1
- package/lib/commands/menu/group-update.js +1 -1
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/move.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -1
- package/lib/commands/menu/rename.js +1 -1
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -1
- package/lib/commands/menu/shared/facts.js +1 -1
- package/lib/commands/menu/shared/index.js +1 -1
- package/lib/commands/menu/shared/inquirer.js +1 -1
- package/lib/commands/menu/shared/local-pages.js +1 -1
- package/lib/commands/menu/shared/logic.js +1 -1
- package/lib/commands/menu/shared/mutations.js +1 -1
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/visibility-update.js +1 -1
- package/lib/commands/notification/config-create.js +1 -1
- package/lib/commands/notification/config-delete.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/config-update.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/notification/shared.js +1 -1
- package/lib/commands/ocr/index.js +1 -1
- package/lib/commands/page/create.js +1 -1
- package/lib/commands/page/custom/detail.js +1 -1
- package/lib/commands/page/custom/list.js +1 -1
- package/lib/commands/page/custom/publish.js +1 -1
- package/lib/commands/page/custom/shared.js +1 -1
- package/lib/commands/page/custom/syntax.js +1 -1
- package/lib/commands/page/custom/template.js +1 -1
- package/lib/commands/page/custom/update.js +1 -1
- package/lib/commands/page/data-list-status.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/restore.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/materialize-project-template.js +1 -1
- package/lib/commands/project/create/project-name.js +1 -1
- package/lib/commands/project/create/project-template-archive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/tenant/index.js +1 -1
- package/lib/commands/tenant/members-list.js +1 -1
- package/lib/commands/tenant/shared.js +1 -1
- package/lib/commands/user-account/dingding-sandbox-bind.js +1 -1
- package/lib/commands/user-account/index.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/deployment-sync.d.ts +10 -0
- package/lib/config/deployment-sync.js +1 -0
- package/lib/config/domain-config.d.ts +1 -1
- package/lib/config/domain-config.js +1 -1
- package/lib/config/project-routing.d.ts +30 -0
- package/lib/config/project-routing.js +1 -0
- package/lib/config/schema.d.ts +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.d.ts +7 -2
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/region.d.ts +2 -2
- package/lib/constant/region.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/constant/routing-profile.d.ts +115 -0
- package/lib/constant/routing-profile.js +1 -0
- package/lib/context/app-resolver.d.ts +2 -0
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.d.ts +35 -0
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.d.ts +4 -0
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.d.ts +4 -4
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/postinstall.js +1 -1
- package/lib/runtime/confirmation.js +1 -1
- package/lib/runtime/event.js +1 -1
- package/lib/runtime/index.js +1 -1
- package/lib/runtime/queue.js +1 -1
- package/lib/runtime/resolve.js +1 -1
- package/lib/skills/builtin-skill.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/skills/skill-presence.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -2
- package/skills/rabetbase/SKILL.md +20 -9
- package/skills/rabetbase/guides/frontend-development.md +2 -0
- package/skills/rabetbase/guides/sdk-client-generation.md +3 -2
- package/skills/rabetbase/guides/typescript-sdk.md +42 -0
- package/skills/rabetbase/references/rabetbase-api-pull.md +5 -3
- package/skills/rabetbase/references/rabetbase-config.md +9 -5
- package/skills/rabetbase/references/rabetbase-dataset-business-group-update.md +9 -9
- package/skills/rabetbase/references/rabetbase-dataset-business-groups.md +1 -1
- package/skills/rabetbase/references/rabetbase-dataset-field-restore.md +59 -0
- package/skills/rabetbase/references/rabetbase-dataset-user-deleted-field-list.md +47 -0
- package/skills/rabetbase/references/rabetbase-deployment-sync.md +92 -0
- package/skills/rabetbase/references/rabetbase-init.md +11 -5
- package/skills/rabetbase/references/rabetbase-project-create.md +6 -5
- package/skills/rabetbase.manifest.json +6 -3
- package/templates/README.md +13 -17
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2fa054,_0x126fe0){const _0x1cf8f7=a159_0x11d7,_0x3cdedf=_0x2fa054();while(!![]){try{const _0xc0f99d=-parseInt(_0x1cf8f7(0xf0))/0x1+-parseInt(_0x1cf8f7(0x10c))/0x2+parseInt(_0x1cf8f7(0x105))/0x3*(-parseInt(_0x1cf8f7(0xf2))/0x4)+-parseInt(_0x1cf8f7(0x169))/0x5+parseInt(_0x1cf8f7(0xec))/0x6+-parseInt(_0x1cf8f7(0x166))/0x7*(-parseInt(_0x1cf8f7(0xfa))/0x8)+parseInt(_0x1cf8f7(0x117))/0x9;if(_0xc0f99d===_0x126fe0)break;else _0x3cdedf['push'](_0x3cdedf['shift']());}catch(_0x2c2b2b){_0x3cdedf['push'](_0x3cdedf['shift']());}}}(a159_0x9264,0x8d49b));import{randomUUID}from'node:crypto';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getDatasetDetail,getPageDetail,tryGetDataListPageStatus}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(_0x8269e9){const _0x1a0adc=a159_0x11d7,_0x51e112=_0x8269e9[_0x1a0adc(0xf1)]('id');if(typeof _0x51e112===_0x1a0adc(0x120)&&Number[_0x1a0adc(0x118)](_0x51e112)&&_0x51e112>0x0)return _0x51e112;return undefined;}export function validateDatasetSelector(_0x131f84){const _0x3dd4fe=a159_0x11d7,_0x1c1912=Boolean(_0x131f84[_0x3dd4fe(0x12e)]('datasetcode')),_0x400a4c=Boolean(_0x131f84[_0x3dd4fe(0x12e)](_0x3dd4fe(0x129)));if(_0x1c1912&&_0x400a4c)throw CliErrors[_0x3dd4fe(0xf9)](_0x3dd4fe(0x132));if(!_0x1c1912&&!_0x400a4c)throw CliErrors[_0x3dd4fe(0xf9)](_0x3dd4fe(0x14c));}export function validateGenerateOperationSelector(_0x17eb13){const _0x55736d=a159_0x11d7,_0xc5ed71=Boolean(_0x17eb13[_0x55736d(0x12e)](_0x55736d(0x10f))),_0x245180=Boolean(_0x17eb13[_0x55736d(0x12e)](_0x55736d(0x14e))),_0x107c3f=Boolean(_0x17eb13[_0x55736d(0x12e)]('client-operation-id')),_0x40b28a=[_0xc5ed71,_0x245180,_0x107c3f][_0x55736d(0x112)](Boolean)['length'];if(_0x40b28a>0x1)throw CliErrors['validation'](_0x55736d(0x161));if(_0x40b28a===0x0)throw CliErrors[_0x55736d(0xf9)](_0x55736d(0x13e));}export function validatePageTargetSelector(_0x27c230){const _0xf4ffa3=a159_0x11d7,_0x5c3315=getPageIdFlag(_0x27c230)!==undefined,_0x59ade6=Boolean(_0x27c230['str']('datasetcode')||_0x27c230[_0xf4ffa3(0x12e)](_0xf4ffa3(0x129)));if(_0x5c3315&&_0x59ade6)throw CliErrors[_0xf4ffa3(0xf9)](_0xf4ffa3(0x12a));if(!_0x5c3315&&!_0x59ade6)throw CliErrors[_0xf4ffa3(0xf9)](_0xf4ffa3(0x139));if(_0x27c230[_0xf4ffa3(0x12e)](_0xf4ffa3(0x135))&&!_0x59ade6)throw CliErrors[_0xf4ffa3(0xf9)](_0xf4ffa3(0x158));}export function resolveDatasetCode(_0x450f9f){const _0x5a30f6=a159_0x11d7;validateDatasetSelector(_0x450f9f);const _0xcb138b=_0x450f9f['str'](_0x5a30f6(0x113));if(_0xcb138b)return _0xcb138b;const _0x408322=_0x450f9f['str'](_0x5a30f6(0x129)),_0x4d482d=resolveApiFilePath(_0x450f9f[_0x5a30f6(0x10a)],_0x450f9f[_0x5a30f6(0x121)]),_0x3f3a2a=resolveAlias(_0x450f9f[_0x5a30f6(0x10a)],_0x408322,undefined,_0x4d482d);if(_0x3f3a2a)return _0x3f3a2a;const _0x3a8b59=loadAliasMap(_0x450f9f[_0x5a30f6(0x10a)],undefined,_0x4d482d),_0x2a7dd4=_0x3a8b59['length']>0x0?_0x5a30f6(0x116)+_0x3a8b59['map'](_0x352940=>_0x352940[_0x5a30f6(0x129)])['join'](',\x20'):'Run\x20`'+CLI_BIN_NAME+_0x5a30f6(0x13f);throw CliErrors[_0x5a30f6(0xf9)]('Alias\x20\x22'+_0x408322+_0x5a30f6(0x114)+_0x2a7dd4);}function a159_0x9264(){const _0x3cd15d=['validation','5011432VNFokR','type','string','\x22,\x20but\x20Data\x20List\x20Page\x20facts\x20are\x20unavailable.','operation_pending','\x20--appcode\x20','<empty>','\x22\x20belongs\x20to\x20app\x20\x22','\x22\x20has\x20no\x20Data\x20List\x20Pages\x20yet.','\x20page\x20generate-status\x20--datasetcode\x20','set','69RzdUpe','already_exists_complete_set','run_generate_start','dataset','fields','apiDir','properties','1355360ZKoQBL','incompleteSets','map','task-id','Query\x20the\x20page\x20facts\x20first\x20and\x20resolve\x20manually\x20before\x20retrying\x20generate.','relatedPageInfoList','filter','datasetcode','\x22\x20not\x20found.\x20','join','Available\x20aliases:\x20','12255228zTqilr','isFinite','\x22\x20returned\x20an\x20unsupported\x20Data\x20List\x20Page\x20state.','hasMenu','relatedPages','status','toUpperCase','datasetId','trim','number','appCode','\x22,\x20not\x20current\x20app\x20\x22','CANCELING','taskId','versionTag','\x22\x20has\x20undeleted\x20related\x20pages\x20under\x20legacy\x20fallback\x20precheck.','generate','Dataset\x20\x22','alias','Use\x20either\x20--id\x20or\x20--datasetcode/--alias,\x20not\x20both.','operationId','run_sync','Switch\x20app\x20with\x20`','str','Data\x20List\x20Page\x20generation\x20is\x20pending\x20for\x20dataset\x20\x22','UNKNOWN','\x20page\x20generate-start\x20--datasetcode\x20','Use\x20either\x20--datasetcode\x20or\x20--alias,\x20not\x20both.','stringify','unknown_reconcile_failed','version-tag','isArray','complete','query_operation_status','One\x20of\x20--id\x20or\x20--datasetcode/--alias\x20is\x20required.','operation_running','menuPath','datasetIds','config','One\x20of\x20--task-id,\x20--operation-id,\x20or\x20--client-operation-id\x20is\x20required.','\x20api\x20pull`\x20first,\x20or\x20pass\x20--datasetcode\x20directly.','data-list-status','blocked_incomplete_sets','no_data_list_pages_found','`\x20instead.','length','name','CANCELLED','Run\x20`','\x22\x20already\x20has\x20one\x20complete\x20Data\x20List\x20Page\x20set.','menuVisible','\x20page\x20data-list-status\x20--datasetcode\x20','\x22,\x20but\x20no\x20Data\x20List\x20Pages\x20were\x20found\x20during\x20reconcile.','One\x20of\x20--datasetcode\x20or\x20--alias\x20is\x20required.','Page\x20\x22','operation-id','\x20workspace\x20use\x20--app\x20<name>`\x20or\x20pass\x20--appcode.','totalSets','RUNNING','\x20--operation-id\x20<id>`\x20until\x20it\x20reaches\x20a\x20terminal\x20state.','\x20--task-id\x20','Data\x20List\x20Page\x20generation\x20failed\x20for\x20dataset\x20\x22','pages','\x20--client-operation-id\x20','menuPages','--version-tag\x20is\x20only\x20supported\x20with\x20--datasetcode\x20or\x20--alias.','Data\x20List\x20Page\x20generation\x20is\x20running\x20for\x20dataset\x20\x22','\x22\x20has\x20multiple\x20or\x20incomplete\x20Data\x20List\x20Page\x20sets.','\x22\x20has\x20multiple\x20complete\x20Data\x20List\x20Page\x20sets.','\x20page\x20sync\x20--datasetcode\x20','fallbackUndeletedPages','\x22\x20now\x20has\x20one\x20complete\x20Data\x20List\x20Page\x20set.','pageId','generated_complete_set','Use\x20exactly\x20one\x20of\x20--task-id,\x20--operation-id,\x20or\x20--client-operation-id.','\x20--operation-id\x20','\x22\x20has\x20one\x20complete\x20set\x20plus\x20residual\x20pages.','FAILED','operation_failed','7tfmixZ','successStatus','deleted','1806940TybthO','pageVersion','from','title','\x22\x20already\x20has\x20undeleted\x20related\x20pages.','PARTIAL_SUCCESS','__EMPTY__','\x20--format\x20json','get','Operation\x20finished\x20for\x20dataset\x20\x22','\x22\x20not\x20found.','residualPages','4876146JrNpud','blocked_complete_plus_residual_sets','manual_resolution_required','SUCCESS','469615YwSVyx','flag','124072kjFUwe','completeSets','clientOperationId','RETRYING','page-','Multiple\x20page\x20groups\x20found\x20for\x20this\x20dataset.','code'];a159_0x9264=function(){return _0x3cd15d;};return a159_0x9264();}export async function loadDatasetDetailForPage(_0x5ab942){const _0x2c508b=a159_0x11d7,_0x2b5374=resolveDatasetCode(_0x5ab942),_0x1813e8=await getDatasetDetail(_0x2b5374),_0x10ec16=normalizeDatasetDetail(_0x1813e8,_0x2b5374);return ensureAppOwnership(_0x5ab942[_0x2c508b(0x121)],_0x10ec16['appCode'],_0x2c508b(0x128)+_0x10ec16[_0x2c508b(0xf8)]+_0x2c508b(0x101)+_0x10ec16[_0x2c508b(0x121)]+_0x2c508b(0x122)+_0x5ab942[_0x2c508b(0x121)]+'\x22.'),_0x10ec16;}export async function loadPageDetailForPage(_0x29561d,_0x3dcc79){const _0x572a56=a159_0x11d7,_0x511d9d=await getPageDetail(_0x3dcc79),_0x101939=normalizePageDetail(_0x511d9d);return ensureAppOwnership(_0x29561d[_0x572a56(0x121)],_0x101939[_0x572a56(0x121)],_0x572a56(0x14d)+_0x3dcc79+_0x572a56(0x101)+_0x101939[_0x572a56(0x121)]+_0x572a56(0x122)+_0x29561d['appCode']+'\x22.'),_0x101939;}export function getUndeletedRelatedPages(_0x470a2d){const _0x4ab460=a159_0x11d7;return _0x470a2d[_0x4ab460(0x11b)][_0x4ab460(0x112)](_0x263212=>!_0x263212['deleted']);}export function buildPageGenerateOperationStatusQueryCommand(_0x302508,_0x1ffc0c){const _0x1fdc68=a159_0x11d7,_0x5bcf46=_0x1ffc0c?.['appCode']&&_0x1ffc0c[_0x1fdc68(0x121)][_0x1fdc68(0x11f)]()!==''?_0x1fdc68(0xff)+_0x1ffc0c['appCode']:'',_0x1257d1=_0x1ffc0c?.[_0x1fdc68(0x124)]&&_0x1ffc0c[_0x1fdc68(0x124)][_0x1fdc68(0x11f)]()!==''?_0x1fdc68(0x153)+_0x1ffc0c[_0x1fdc68(0x124)]:_0x1ffc0c?.[_0x1fdc68(0x12b)]&&_0x1ffc0c[_0x1fdc68(0x12b)][_0x1fdc68(0x11f)]()!==''?_0x1fdc68(0x162)+_0x1ffc0c[_0x1fdc68(0x12b)]:_0x1ffc0c?.['clientOperationId']&&_0x1ffc0c[_0x1fdc68(0xf4)][_0x1fdc68(0x11f)]()!==''?_0x1fdc68(0x156)+_0x1ffc0c[_0x1fdc68(0xf4)]:'';return CLI_BIN_NAME+_0x1fdc68(0x103)+_0x302508+_0x5bcf46+_0x1257d1+_0x1fdc68(0x170);}export function createPageGenerateClientOperationId(){return'page-generate-'+randomUUID();}export function buildDataListPageStatusQueryCommand(_0xc47aa5,_0x2be87d){const _0x372b25=a159_0x11d7,_0x56986d=_0x2be87d&&_0x2be87d['trim']()!==''?'\x20--appcode\x20'+_0x2be87d:'';return CLI_BIN_NAME+_0x372b25(0x14a)+_0xc47aa5+_0x56986d+_0x372b25(0x170);}export function prepareDatasetAction(_0x3c0c8c,_0x13b52b){const _0x5c24fb=a159_0x11d7,_0x454f69=getUndeletedRelatedPages(_0x3c0c8c);if(_0x13b52b===_0x5c24fb(0x127)&&_0x454f69[_0x5c24fb(0x144)]>0x0)throw CliErrors['validation'](_0x5c24fb(0x128)+_0x3c0c8c[_0x5c24fb(0xf8)]+_0x5c24fb(0x16d),_0x5c24fb(0x147)+CLI_BIN_NAME+_0x5c24fb(0x15c)+_0x3c0c8c[_0x5c24fb(0xf8)]+_0x5c24fb(0x143));if(_0x13b52b==='sync'&&_0x454f69['length']===0x0)throw CliErrors['validation'](_0x5c24fb(0x128)+_0x3c0c8c[_0x5c24fb(0xf8)]+'\x22\x20has\x20no\x20undeleted\x20related\x20pages.',_0x5c24fb(0x147)+CLI_BIN_NAME+_0x5c24fb(0x131)+_0x3c0c8c['code']+'`\x20first,\x20then\x20poll\x20`'+CLI_BIN_NAME+_0x5c24fb(0x103)+_0x3c0c8c[_0x5c24fb(0xf8)]+_0x5c24fb(0x152));return{'dataset':_0x3c0c8c,'undeletedPages':_0x454f69};}export function prepareGenerateDatasetAction(_0x3cc1a1,_0x2391a4){const _0x1a5731=a159_0x11d7,_0x4906c8=getUndeletedRelatedPages(_0x3cc1a1);if(!_0x2391a4){if(_0x4906c8[_0x1a5731(0x144)]>0x0)throw CliErrors[_0x1a5731(0xf9)](_0x1a5731(0x128)+_0x3cc1a1[_0x1a5731(0xf8)]+_0x1a5731(0x16d),_0x1a5731(0x147)+CLI_BIN_NAME+_0x1a5731(0x15c)+_0x3cc1a1['code']+'`\x20instead.');return{'dataset':_0x3cc1a1,'undeletedPages':_0x4906c8,'dataListPageStatus':null};}const _0x21a36d=_0x2391a4['completeSets'],_0x20a9de=_0x2391a4[_0x1a5731(0x10d)],_0x16bc8c=_0x2391a4[_0x1a5731(0xeb)][_0x1a5731(0x144)];if(_0x21a36d===0x0&&_0x20a9de===0x0&&_0x16bc8c===0x0)return{'dataset':_0x3cc1a1,'undeletedPages':_0x4906c8,'dataListPageStatus':_0x2391a4};if(_0x21a36d===0x1&&_0x20a9de===0x0&&_0x16bc8c===0x0)throw CliErrors[_0x1a5731(0xf9)]('Dataset\x20\x22'+_0x3cc1a1[_0x1a5731(0xf8)]+'\x22\x20already\x20has\x20one\x20complete\x20Data\x20List\x20Page\x20set.',_0x1a5731(0x147)+CLI_BIN_NAME+'\x20page\x20sync\x20--datasetcode\x20'+_0x3cc1a1[_0x1a5731(0xf8)]+_0x1a5731(0x143));throw CliErrors['validation'](_0x1a5731(0x128)+_0x3cc1a1[_0x1a5731(0xf8)]+_0x1a5731(0x15a),_0x1a5731(0x110));}export function assessDataListPageState(_0x49bc01,_0x3e345d,_0x4f3205){const _0x1084ac=a159_0x11d7,_0x477956=_0x4f3205?.[_0x1084ac(0x167)]??_0x1084ac(0x106),_0x5b5c9e=_0x4f3205?.[_0x1084ac(0x15d)]??[];if(!_0x3e345d){if(_0x5b5c9e[_0x1084ac(0x144)]>0x0)return{'status':_0x1084ac(0x141),'allowGenerate':![],'manualResolutionRequired':!![],'message':_0x1084ac(0x128)+_0x49bc01+_0x1084ac(0x126),'nextAction':_0x1084ac(0xee)};return{'status':_0x1084ac(0x142),'allowGenerate':!![],'manualResolutionRequired':![],'message':_0x1084ac(0x128)+_0x49bc01+_0x1084ac(0x102),'nextAction':_0x1084ac(0x107)};}const _0x2448a7=_0x3e345d[_0x1084ac(0xf3)],_0x42224a=_0x3e345d['incompleteSets'],_0x47274b=_0x3e345d[_0x1084ac(0xeb)][_0x1084ac(0x144)];if(_0x2448a7===0x0&&_0x42224a===0x0&&_0x47274b===0x0)return{'status':'no_data_list_pages_found','allowGenerate':!![],'manualResolutionRequired':![],'message':'Dataset\x20\x22'+_0x49bc01+_0x1084ac(0x102),'nextAction':'run_generate_start'};if(_0x2448a7>0x1)return{'status':'blocked_multiple_complete_sets','allowGenerate':![],'manualResolutionRequired':!![],'message':_0x1084ac(0x128)+_0x49bc01+_0x1084ac(0x15b),'nextAction':_0x1084ac(0xee)};if(_0x42224a>0x0)return{'status':'blocked_incomplete_sets','allowGenerate':![],'manualResolutionRequired':!![],'message':_0x1084ac(0x128)+_0x49bc01+'\x22\x20has\x20incomplete\x20Data\x20List\x20Page\x20sets.','nextAction':_0x1084ac(0xee)};if(_0x2448a7===0x1&&_0x47274b>0x0)return{'status':_0x1084ac(0xed),'allowGenerate':![],'manualResolutionRequired':!![],'message':_0x1084ac(0x128)+_0x49bc01+_0x1084ac(0x163),'nextAction':_0x1084ac(0xee)};if(_0x2448a7===0x1)return{'status':_0x477956,'allowGenerate':![],'manualResolutionRequired':![],'message':_0x477956===_0x1084ac(0x160)?'Dataset\x20\x22'+_0x49bc01+_0x1084ac(0x15e):_0x1084ac(0x128)+_0x49bc01+_0x1084ac(0x148),'nextAction':_0x477956==='generated_complete_set'?undefined:_0x1084ac(0x12c)};return{'status':'unknown_reconcile_failed','allowGenerate':![],'manualResolutionRequired':![],'message':_0x1084ac(0x128)+_0x49bc01+_0x1084ac(0x119),'nextAction':_0x1084ac(0x138)};}export function assessGenerateOperationState(_0x5da967,_0x1030d8,_0x2b75ab){const _0x232110=a159_0x11d7,_0x95b0f4=String(_0x1030d8||'')[_0x232110(0x11f)]()[_0x232110(0x11d)]();if(_0x95b0f4==='PENDING')return{'status':_0x232110(0xfe),'manualResolutionRequired':![],'message':_0x232110(0x12f)+_0x5da967+'\x22.','nextAction':_0x232110(0x138)};if(_0x95b0f4===_0x232110(0x151)||_0x95b0f4===_0x232110(0xf5)||_0x95b0f4===_0x232110(0x123))return{'status':_0x232110(0x13a),'manualResolutionRequired':![],'message':_0x232110(0x159)+_0x5da967+'\x22.','nextAction':_0x232110(0x138)};if(_0x95b0f4===_0x232110(0xef)||_0x95b0f4===_0x232110(0x16e)){if(!_0x2b75ab)return{'status':_0x232110(0x134),'manualResolutionRequired':![],'message':_0x232110(0xe9)+_0x5da967+_0x232110(0xfd),'nextAction':'query_operation_status'};const _0x4b051f=assessDataListPageState(_0x5da967,_0x2b75ab,{'successStatus':_0x232110(0x160)});if(_0x4b051f[_0x232110(0x11c)]===_0x232110(0x142))return{'status':_0x232110(0x134),'manualResolutionRequired':![],'message':_0x232110(0xe9)+_0x5da967+_0x232110(0x14b),'nextAction':'query_operation_status'};return _0x4b051f;}if(_0x95b0f4===_0x232110(0x164)||_0x95b0f4===_0x232110(0x146)||_0x95b0f4==='')return{'status':_0x232110(0x165),'manualResolutionRequired':![],'message':_0x232110(0x154)+_0x5da967+'\x22.','nextAction':_0x232110(0x138)};return{'status':_0x232110(0x134),'manualResolutionRequired':![],'message':_0x232110(0x128)+_0x5da967+'\x22\x20returned\x20unsupported\x20operation\x20status\x20\x22'+_0x95b0f4+'\x22.','nextAction':_0x232110(0x138)};}export function normalizePageDetail(_0x39685d){const _0x425d11=a159_0x11d7;return{'pageId':Number(_0x39685d['pageId']),'appCode':_0x39685d[_0x425d11(0x121)],'name':_0x39685d[_0x425d11(0x145)]||_0x425d11(0xf6)+_0x39685d[_0x425d11(0x15f)],'code':_0x39685d[_0x425d11(0xf8)]||'','type':_0x39685d['type']?String(_0x39685d[_0x425d11(0xfb)]):_0x425d11(0x130),'datasetIds':Array['isArray'](_0x39685d[_0x425d11(0x13c)])?_0x39685d['datasetIds'][_0x425d11(0x10e)](_0x49c280=>Number(_0x49c280))['filter'](_0x21a8e6=>Number['isFinite'](_0x21a8e6)):[],'pageVersion':_0x39685d[_0x425d11(0x13d)]&&typeof _0x39685d[_0x425d11(0x13d)]['pageVersion']===_0x425d11(0x120)?_0x39685d[_0x425d11(0x13d)][_0x425d11(0x16a)]:null,'versionTag':_0x39685d[_0x425d11(0x13d)]&&typeof _0x39685d[_0x425d11(0x13d)][_0x425d11(0x125)]===_0x425d11(0xfc)&&_0x39685d[_0x425d11(0x13d)][_0x425d11(0x125)][_0x425d11(0x11f)]()!==''?_0x39685d[_0x425d11(0x13d)][_0x425d11(0x125)]:null,'relatedPages':normalizeRelatedPages(_0x39685d[_0x425d11(0x111)]),'raw':_0x39685d};}function a159_0x11d7(_0x833f3f,_0x183202){_0x833f3f=_0x833f3f-0xe8;const _0x92641d=a159_0x9264();let _0x11d746=_0x92641d[_0x833f3f];return _0x11d746;}export function serializeDryRunDescription(_0x4b7ef8){const _0x778039=a159_0x11d7;return JSON[_0x778039(0x133)](_0x4b7ef8,null,0x2);}export async function loadDataListPageStatusForGenerate(_0x39c054,_0x419b09){const _0x339c12=await tryGetDataListPageStatus(_0x39c054['appCode'],_0x419b09);if(!_0x339c12)return null;return normalizeDataListPageStatus(_0x339c12,_0x419b09);}export function selectVersionTagGroup(_0x3cd505,_0x101ef9,_0x4d0025){const _0x3bb897=a159_0x11d7,_0xc75aa9=new Map();for(const _0x24065a of _0x3cd505){const _0x257bb0=normalizeVersionTag(_0x101ef9(_0x24065a)),_0xddff72=_0xc75aa9[_0x3bb897(0xe8)](_0x257bb0)??[];_0xddff72['push'](_0x24065a),_0xc75aa9[_0x3bb897(0x104)](_0x257bb0,_0xddff72);}const _0x26d685=Array[_0x3bb897(0x16b)](_0xc75aa9['keys']());if(_0x26d685[_0x3bb897(0x144)]<=0x1&&!_0x4d0025)return{'items':_0x3cd505,'availableTags':_0x26d685};if(_0x4d0025){const _0xdfc48b=normalizeVersionTag(_0x4d0025),_0x453cac=_0xc75aa9[_0x3bb897(0xe8)](_0xdfc48b);if(!_0x453cac)throw CliErrors[_0x3bb897(0xf9)]('Version\x20tag\x20\x22'+_0x4d0025+_0x3bb897(0xea),buildVersionTagHint(_0x26d685));return{'items':_0x453cac,'availableTags':_0x26d685};}throw CliErrors[_0x3bb897(0xf9)](_0x3bb897(0xf7),buildVersionTagHint(_0x26d685));}function normalizeDatasetDetail(_0x4fa8f9,_0x145755){const _0x21ebd8=a159_0x11d7,_0x198b62=Array[_0x21ebd8(0x136)](_0x4fa8f9[_0x21ebd8(0x109)])?_0x4fa8f9[_0x21ebd8(0x109)]:Array[_0x21ebd8(0x136)](_0x4fa8f9['properties'])?_0x4fa8f9[_0x21ebd8(0x10b)]:[];return{'id':Number(_0x4fa8f9['id']??_0x4fa8f9['modelId']??0x0),'code':String(_0x4fa8f9[_0x21ebd8(0xf8)]||_0x4fa8f9['modelCode']||_0x145755),'name':String(_0x4fa8f9[_0x21ebd8(0x145)]||_0x145755),'appCode':_0x4fa8f9[_0x21ebd8(0x121)]||_0x4fa8f9[_0x21ebd8(0x108)]?.[_0x21ebd8(0x121)],'fieldCount':_0x198b62['length'],'relatedPages':normalizeRelatedPages(_0x4fa8f9['relatedPageInfoList']),'raw':_0x4fa8f9};}function normalizeDataListPageStatus(_0xbc1a54,_0x4d8057){const _0x4c3c88=a159_0x11d7,_0x49ebd9=_0x525506=>({'pageId':Number(_0x525506[_0x4c3c88(0x15f)]??_0x525506['id']??0x0),'title':String(_0x525506[_0x4c3c88(0x16c)]||_0x525506[_0x4c3c88(0x145)]||_0x4c3c88(0xf6)+(_0x525506['pageId']??_0x525506['id']??'unknown')),'type':_0x525506['type']?String(_0x525506['type']):_0x4c3c88(0x130),'deleted':_0x525506[_0x4c3c88(0x168)]===!![],'hasMenu':_0x525506[_0x4c3c88(0x11a)]===!![],'menuVisible':typeof _0x525506[_0x4c3c88(0x149)]==='boolean'?_0x525506[_0x4c3c88(0x149)]:null,'menuPath':typeof _0x525506[_0x4c3c88(0x13b)]===_0x4c3c88(0xfc)&&_0x525506[_0x4c3c88(0x13b)][_0x4c3c88(0x11f)]()!==''?_0x525506[_0x4c3c88(0x13b)]:null}),_0x4e4c0c=Array[_0x4c3c88(0x136)](_0xbc1a54['pageSets'])?_0xbc1a54['pageSets'][_0x4c3c88(0x10e)](_0x18cf95=>({'versionTag':typeof _0x18cf95['versionTag']==='string'&&_0x18cf95[_0x4c3c88(0x125)][_0x4c3c88(0x11f)]()!==''?_0x18cf95[_0x4c3c88(0x125)]:null,'complete':_0x18cf95[_0x4c3c88(0x137)]===!![],'pages':Array['isArray'](_0x18cf95['pages'])?_0x18cf95[_0x4c3c88(0x155)][_0x4c3c88(0x10e)](_0x49ebd9):[]})):[];return{'datasetId':typeof _0xbc1a54[_0x4c3c88(0x11e)]===_0x4c3c88(0x120)&&Number['isFinite'](_0xbc1a54['datasetId'])?_0xbc1a54[_0x4c3c88(0x11e)]:null,'datasetCode':typeof _0xbc1a54['datasetCode']==='string'&&_0xbc1a54['datasetCode'][_0x4c3c88(0x11f)]()!==''?_0xbc1a54['datasetCode']:_0x4d8057,'pageSets':_0x4e4c0c,'totalSets':typeof _0xbc1a54[_0x4c3c88(0x150)]===_0x4c3c88(0x120)&&Number['isFinite'](_0xbc1a54[_0x4c3c88(0x150)])?_0xbc1a54['totalSets']:_0x4e4c0c[_0x4c3c88(0x144)],'completeSets':typeof _0xbc1a54['completeSets']===_0x4c3c88(0x120)&&Number[_0x4c3c88(0x118)](_0xbc1a54['completeSets'])?_0xbc1a54[_0x4c3c88(0xf3)]:_0x4e4c0c[_0x4c3c88(0x112)](_0x5aa947=>_0x5aa947['complete'])['length'],'incompleteSets':typeof _0xbc1a54[_0x4c3c88(0x10d)]==='number'&&Number[_0x4c3c88(0x118)](_0xbc1a54['incompleteSets'])?_0xbc1a54['incompleteSets']:_0x4e4c0c[_0x4c3c88(0x112)](_0x147f29=>!_0x147f29[_0x4c3c88(0x137)]&&_0x147f29[_0x4c3c88(0x155)][_0x4c3c88(0x144)]>0x0)['length'],'residualPages':Array['isArray'](_0xbc1a54[_0x4c3c88(0xeb)])?_0xbc1a54[_0x4c3c88(0xeb)][_0x4c3c88(0x10e)](_0x49ebd9):[],'menuPages':Array[_0x4c3c88(0x136)](_0xbc1a54[_0x4c3c88(0x157)])?_0xbc1a54[_0x4c3c88(0x157)][_0x4c3c88(0x10e)](_0x49ebd9):[],'source':_0x4c3c88(0x140)};}function normalizeRelatedPages(_0x893f45){const _0x3f9095=a159_0x11d7;if(!Array[_0x3f9095(0x136)](_0x893f45))return[];return _0x893f45[_0x3f9095(0x112)](_0x2ef368=>_0x2ef368&&typeof _0x2ef368==='object')['map'](_0x4eda97=>({'id':Number(_0x4eda97['id']),'type':_0x4eda97['type']?String(_0x4eda97[_0x3f9095(0xfb)]):_0x3f9095(0x130),'code':_0x4eda97[_0x3f9095(0xf8)]||undefined,'title':_0x4eda97[_0x3f9095(0x16c)]||_0x4eda97[_0x3f9095(0x145)]||_0x3f9095(0xf6)+_0x4eda97['id'],'deleted':_0x4eda97[_0x3f9095(0x168)]===!![]}))[_0x3f9095(0x112)](_0x2c4044=>Number[_0x3f9095(0x118)](_0x2c4044['id']));}function ensureAppOwnership(_0x15fcba,_0x3063cd,_0x44b05f){const _0xdbc197=a159_0x11d7;if(!_0x3063cd)return;if(_0x3063cd!==_0x15fcba)throw CliErrors[_0xdbc197(0xf9)](_0x44b05f,_0xdbc197(0x12d)+CLI_BIN_NAME+_0xdbc197(0x14f));}function normalizeVersionTag(_0x3cd40f){const _0x289952=a159_0x11d7;return _0x3cd40f&&_0x3cd40f[_0x289952(0x11f)]()!==''?_0x3cd40f:'__EMPTY__';}function buildVersionTagHint(_0x10a60){const _0x211019=a159_0x11d7,_0x26a482=_0x10a60[_0x211019(0x10e)](_0x57369d=>_0x57369d===_0x211019(0x16f)?_0x211019(0x100):_0x57369d)[_0x211019(0x115)](',\x20');return'Use\x20`--version-tag\x20<tag>`.\x20Available\x20groups:\x20'+_0x26a482;}
|
|
1
|
+
(function(_0x43e9a6,_0x239297){const _0x289134=a164_0x1e2b,_0x2b6df2=_0x43e9a6();while(!![]){try{const _0x430656=-parseInt(_0x289134(0x188))/0x1*(-parseInt(_0x289134(0x16e))/0x2)+-parseInt(_0x289134(0x189))/0x3*(parseInt(_0x289134(0x1aa))/0x4)+parseInt(_0x289134(0x12d))/0x5*(-parseInt(_0x289134(0x15d))/0x6)+parseInt(_0x289134(0x151))/0x7*(-parseInt(_0x289134(0x128))/0x8)+parseInt(_0x289134(0x1a0))/0x9+parseInt(_0x289134(0x129))/0xa+parseInt(_0x289134(0x179))/0xb;if(_0x430656===_0x239297)break;else _0x2b6df2['push'](_0x2b6df2['shift']());}catch(_0x1927ea){_0x2b6df2['push'](_0x2b6df2['shift']());}}}(a164_0x3c50,0x97bda));import{randomUUID}from'node:crypto';import{CLI_BIN_NAME}from'../../constant/cli.js';import{getDatasetDetail,getPageDetail,tryGetDataListPageStatus}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(_0x18cfb5){const _0x4da571=a164_0x1e2b,_0x645def=_0x18cfb5[_0x4da571(0x127)]('id');if(typeof _0x645def===_0x4da571(0x159)&&Number[_0x4da571(0x185)](_0x645def)&&_0x645def>0x0)return _0x645def;return undefined;}export function validateDatasetSelector(_0x1eeede){const _0x244869=a164_0x1e2b,_0xa474f7=Boolean(_0x1eeede[_0x244869(0x161)](_0x244869(0x18b))),_0xe6302a=Boolean(_0x1eeede[_0x244869(0x161)](_0x244869(0x132)));if(_0xa474f7&&_0xe6302a)throw CliErrors[_0x244869(0x171)](_0x244869(0x12a));if(!_0xa474f7&&!_0xe6302a)throw CliErrors[_0x244869(0x171)]('One\x20of\x20--datasetcode\x20or\x20--alias\x20is\x20required.');}export function validateGenerateOperationSelector(_0x22ec16){const _0x4cd089=a164_0x1e2b,_0x3ab7dc=Boolean(_0x22ec16[_0x4cd089(0x161)]('task-id')),_0x179f65=Boolean(_0x22ec16['str'](_0x4cd089(0x148))),_0x1db7e5=Boolean(_0x22ec16[_0x4cd089(0x161)](_0x4cd089(0x19d))),_0x537d4d=[_0x3ab7dc,_0x179f65,_0x1db7e5][_0x4cd089(0x13a)](Boolean)[_0x4cd089(0x14d)];if(_0x537d4d>0x1)throw CliErrors[_0x4cd089(0x171)](_0x4cd089(0x144));if(_0x537d4d===0x0)throw CliErrors[_0x4cd089(0x171)](_0x4cd089(0x13c));}export function validatePageTargetSelector(_0x3390dc){const _0x3e531f=a164_0x1e2b,_0x4ecda3=getPageIdFlag(_0x3390dc)!==undefined,_0x1b040e=Boolean(_0x3390dc[_0x3e531f(0x161)](_0x3e531f(0x18b))||_0x3390dc[_0x3e531f(0x161)]('alias'));if(_0x4ecda3&&_0x1b040e)throw CliErrors[_0x3e531f(0x171)](_0x3e531f(0x13d));if(!_0x4ecda3&&!_0x1b040e)throw CliErrors['validation']('One\x20of\x20--id\x20or\x20--datasetcode/--alias\x20is\x20required.');if(_0x3390dc[_0x3e531f(0x161)](_0x3e531f(0x14b))&&!_0x1b040e)throw CliErrors[_0x3e531f(0x171)](_0x3e531f(0x15a));}export function resolveDatasetCode(_0x183b54){const _0x24307d=a164_0x1e2b;validateDatasetSelector(_0x183b54);const _0x15e92a=_0x183b54[_0x24307d(0x161)](_0x24307d(0x18b));if(_0x15e92a)return _0x15e92a;const _0x3d8fbd=_0x183b54[_0x24307d(0x161)](_0x24307d(0x132)),_0x9be752=resolveApiFilePath(_0x183b54['apiDir'],_0x183b54[_0x24307d(0x136)]),_0x2ecbe9=resolveAlias(_0x183b54[_0x24307d(0x165)],_0x3d8fbd,undefined,_0x9be752);if(_0x2ecbe9)return _0x2ecbe9;const _0x140299=loadAliasMap(_0x183b54[_0x24307d(0x165)],undefined,_0x9be752),_0x409904=_0x140299[_0x24307d(0x14d)]>0x0?'Available\x20aliases:\x20'+_0x140299[_0x24307d(0x19e)](_0xd6e836=>_0xd6e836[_0x24307d(0x132)])[_0x24307d(0x130)](',\x20'):_0x24307d(0x17e)+CLI_BIN_NAME+_0x24307d(0x17d);throw CliErrors[_0x24307d(0x171)](_0x24307d(0x18d)+_0x3d8fbd+'\x22\x20not\x20found.\x20'+_0x409904);}export async function loadDatasetDetailForPage(_0x41e529){const _0x49514a=a164_0x1e2b,_0x479f28=resolveDatasetCode(_0x41e529),_0x3a9b3f=await getDatasetDetail(_0x479f28),_0x432255=normalizeDatasetDetail(_0x3a9b3f,_0x479f28);return ensureAppOwnership(_0x41e529[_0x49514a(0x136)],_0x432255[_0x49514a(0x136)],_0x49514a(0x154)+_0x432255['code']+_0x49514a(0x166)+_0x432255[_0x49514a(0x136)]+_0x49514a(0x12b)+_0x41e529[_0x49514a(0x136)]+'\x22.'),_0x432255;}export async function loadPageDetailForPage(_0x3d64a0,_0x6282bd){const _0x4e454b=a164_0x1e2b,_0x1e510c=await getPageDetail(_0x6282bd),_0x4d7efa=normalizePageDetail(_0x1e510c);return ensureAppOwnership(_0x3d64a0[_0x4e454b(0x136)],_0x4d7efa['appCode'],_0x4e454b(0x181)+_0x6282bd+'\x22\x20belongs\x20to\x20app\x20\x22'+_0x4d7efa['appCode']+_0x4e454b(0x12b)+_0x3d64a0['appCode']+'\x22.'),_0x4d7efa;}export function getUndeletedRelatedPages(_0x1b2aa2){const _0x1a5a92=a164_0x1e2b;return _0x1b2aa2[_0x1a5a92(0x155)][_0x1a5a92(0x13a)](_0x45f0d5=>!_0x45f0d5['deleted']);}function a164_0x3c50(){const _0xff2641=['push','__EMPTY__','operation-id','Data\x20List\x20Page\x20generation\x20failed\x20for\x20dataset\x20\x22','`\x20first,\x20then\x20poll\x20`','version-tag','pageId','length','keys','totalSets','\x20--operation-id\x20','191338ZWMlht','Version\x20tag\x20\x22','datasetId','Dataset\x20\x22','relatedPages','Operation\x20finished\x20for\x20dataset\x20\x22','sync','successStatus','number','--version-tag\x20is\x20only\x20supported\x20with\x20--datasetcode\x20or\x20--alias.','SUCCESS','PENDING','107934gdLKiD','\x20--format\x20json','page-','type','str','RETRYING','\x22\x20now\x20has\x20one\x20complete\x20Data\x20List\x20Page\x20set.','query_operation_status','apiDir','\x22\x20belongs\x20to\x20app\x20\x22','\x22\x20has\x20undeleted\x20related\x20pages\x20under\x20legacy\x20fallback\x20precheck.','Data\x20List\x20Page\x20generation\x20is\x20running\x20for\x20dataset\x20\x22','relatedPageInfoList','menuPages','completeSets','\x22\x20has\x20no\x20undeleted\x20related\x20pages.','datasetIds','12DIigXS','already_exists_complete_set','\x22\x20already\x20has\x20undeleted\x20related\x20pages.','validation','Query\x20the\x20page\x20facts\x20first\x20and\x20resolve\x20manually\x20before\x20retrying\x20generate.','\x22\x20returned\x20unsupported\x20operation\x20status\x20\x22','run_generate_start','\x22\x20has\x20one\x20complete\x20set\x20plus\x20residual\x20pages.','\x22\x20not\x20found.','\x20page\x20sync\x20--datasetcode\x20','manual_resolution_required','1587245KrtoJH','unknown_reconcile_failed','no_data_list_pages_found','from','\x20api\x20pull`\x20first,\x20or\x20pass\x20--datasetcode\x20directly.','Run\x20`','fallbackUndeletedPages','blocked_incomplete_sets','Page\x20\x22','Use\x20`--version-tag\x20<tag>`.\x20Available\x20groups:\x20','data-list-status','taskId','isFinite','\x20page\x20generate-start\x20--datasetcode\x20','menuPath','6621RmxGXb','96027RczGPB','boolean','datasetcode','incompleteSets','Alias\x20\x22','code','residualPages','pageVersion','trim','generated_complete_set','deleted','Switch\x20app\x20with\x20`','config','get','\x22\x20has\x20no\x20Data\x20List\x20Pages\x20yet.','\x20--appcode\x20','pageSets','\x22\x20returned\x20an\x20unsupported\x20Data\x20List\x20Page\x20state.','clientOperationId','\x20workspace\x20use\x20--app\x20<name>`\x20or\x20pass\x20--appcode.','client-operation-id','map','pages','3988359iEjbes','string','\x20--task-id\x20','title','\x22,\x20but\x20no\x20Data\x20List\x20Pages\x20were\x20found\x20during\x20reconcile.','status','menuVisible','FAILED','name','CANCELING','44hFXXJx','complete','\x22\x20has\x20incomplete\x20Data\x20List\x20Page\x20sets.','flag','216XpnaXP','11384420dAvfos','Use\x20either\x20--datasetcode\x20or\x20--alias,\x20not\x20both.','\x22,\x20not\x20current\x20app\x20\x22','blocked_complete_plus_residual_sets','15OteMhq','UNKNOWN','\x20--operation-id\x20<id>`\x20until\x20it\x20reaches\x20a\x20terminal\x20state.','join','\x20page\x20generate-status\x20--datasetcode\x20','alias','Multiple\x20page\x20groups\x20found\x20for\x20this\x20dataset.','isArray','object','appCode','properties','hasMenu','datasetCode','filter','RUNNING','One\x20of\x20--task-id,\x20--operation-id,\x20or\x20--client-operation-id\x20is\x20required.','Use\x20either\x20--id\x20or\x20--datasetcode/--alias,\x20not\x20both.','page-generate-','`\x20instead.','\x22\x20has\x20multiple\x20complete\x20Data\x20List\x20Page\x20sets.','modelCode','unknown','versionTag','Use\x20exactly\x20one\x20of\x20--task-id,\x20--operation-id,\x20or\x20--client-operation-id.','Data\x20List\x20Page\x20generation\x20is\x20pending\x20for\x20dataset\x20\x22'];a164_0x3c50=function(){return _0xff2641;};return a164_0x3c50();}export function buildPageGenerateOperationStatusQueryCommand(_0x3fc295,_0x2431e5){const _0x5873dd=a164_0x1e2b,_0x4a47e8=_0x2431e5?.[_0x5873dd(0x136)]&&_0x2431e5[_0x5873dd(0x136)][_0x5873dd(0x191)]()!==''?_0x5873dd(0x198)+_0x2431e5[_0x5873dd(0x136)]:'',_0x412518=_0x2431e5?.[_0x5873dd(0x184)]&&_0x2431e5[_0x5873dd(0x184)]['trim']()!==''?_0x5873dd(0x1a2)+_0x2431e5[_0x5873dd(0x184)]:_0x2431e5?.['operationId']&&_0x2431e5['operationId']['trim']()!==''?_0x5873dd(0x150)+_0x2431e5['operationId']:_0x2431e5?.['clientOperationId']&&_0x2431e5[_0x5873dd(0x19b)][_0x5873dd(0x191)]()!==''?'\x20--client-operation-id\x20'+_0x2431e5[_0x5873dd(0x19b)]:'';return CLI_BIN_NAME+_0x5873dd(0x131)+_0x3fc295+_0x4a47e8+_0x412518+_0x5873dd(0x15e);}export function createPageGenerateClientOperationId(){const _0x34ae8b=a164_0x1e2b;return _0x34ae8b(0x13e)+randomUUID();}export function buildDataListPageStatusQueryCommand(_0x1e8bb8,_0x209176){const _0x448650=a164_0x1e2b,_0x400e5a=_0x209176&&_0x209176['trim']()!==''?_0x448650(0x198)+_0x209176:'';return CLI_BIN_NAME+'\x20page\x20data-list-status\x20--datasetcode\x20'+_0x1e8bb8+_0x400e5a+'\x20--format\x20json';}export function prepareDatasetAction(_0x3b6f42,_0x3c7340){const _0x3d944e=a164_0x1e2b,_0x352803=getUndeletedRelatedPages(_0x3b6f42);if(_0x3c7340==='generate'&&_0x352803[_0x3d944e(0x14d)]>0x0)throw CliErrors[_0x3d944e(0x171)](_0x3d944e(0x154)+_0x3b6f42[_0x3d944e(0x18e)]+_0x3d944e(0x170),_0x3d944e(0x17e)+CLI_BIN_NAME+_0x3d944e(0x177)+_0x3b6f42[_0x3d944e(0x18e)]+_0x3d944e(0x13f));if(_0x3c7340===_0x3d944e(0x157)&&_0x352803[_0x3d944e(0x14d)]===0x0)throw CliErrors[_0x3d944e(0x171)](_0x3d944e(0x154)+_0x3b6f42[_0x3d944e(0x18e)]+_0x3d944e(0x16c),_0x3d944e(0x17e)+CLI_BIN_NAME+_0x3d944e(0x186)+_0x3b6f42[_0x3d944e(0x18e)]+_0x3d944e(0x14a)+CLI_BIN_NAME+_0x3d944e(0x131)+_0x3b6f42['code']+_0x3d944e(0x12f));return{'dataset':_0x3b6f42,'undeletedPages':_0x352803};}export function prepareGenerateDatasetAction(_0x17c561,_0x4b951e){const _0x1f60b4=a164_0x1e2b,_0x5d0f9d=getUndeletedRelatedPages(_0x17c561);if(!_0x4b951e){if(_0x5d0f9d[_0x1f60b4(0x14d)]>0x0)throw CliErrors[_0x1f60b4(0x171)](_0x1f60b4(0x154)+_0x17c561[_0x1f60b4(0x18e)]+_0x1f60b4(0x170),_0x1f60b4(0x17e)+CLI_BIN_NAME+_0x1f60b4(0x177)+_0x17c561[_0x1f60b4(0x18e)]+'`\x20instead.');return{'dataset':_0x17c561,'undeletedPages':_0x5d0f9d,'dataListPageStatus':null};}const _0x5a071c=_0x4b951e[_0x1f60b4(0x16b)],_0x4f95bc=_0x4b951e[_0x1f60b4(0x18c)],_0x2a54e5=_0x4b951e[_0x1f60b4(0x18f)][_0x1f60b4(0x14d)];if(_0x5a071c===0x0&&_0x4f95bc===0x0&&_0x2a54e5===0x0)return{'dataset':_0x17c561,'undeletedPages':_0x5d0f9d,'dataListPageStatus':_0x4b951e};if(_0x5a071c===0x1&&_0x4f95bc===0x0&&_0x2a54e5===0x0)throw CliErrors['validation'](_0x1f60b4(0x154)+_0x17c561['code']+'\x22\x20already\x20has\x20one\x20complete\x20Data\x20List\x20Page\x20set.',_0x1f60b4(0x17e)+CLI_BIN_NAME+'\x20page\x20sync\x20--datasetcode\x20'+_0x17c561[_0x1f60b4(0x18e)]+'`\x20instead.');throw CliErrors[_0x1f60b4(0x171)](_0x1f60b4(0x154)+_0x17c561['code']+'\x22\x20has\x20multiple\x20or\x20incomplete\x20Data\x20List\x20Page\x20sets.',_0x1f60b4(0x172));}export function assessDataListPageState(_0x64688,_0x2c2df9,_0x1229d0){const _0x58eebb=a164_0x1e2b,_0x25df65=_0x1229d0?.[_0x58eebb(0x158)]??_0x58eebb(0x16f),_0xeb740e=_0x1229d0?.[_0x58eebb(0x17f)]??[];if(!_0x2c2df9){if(_0xeb740e['length']>0x0)return{'status':_0x58eebb(0x180),'allowGenerate':![],'manualResolutionRequired':!![],'message':'Dataset\x20\x22'+_0x64688+_0x58eebb(0x167),'nextAction':_0x58eebb(0x178)};return{'status':'no_data_list_pages_found','allowGenerate':!![],'manualResolutionRequired':![],'message':_0x58eebb(0x154)+_0x64688+_0x58eebb(0x197),'nextAction':_0x58eebb(0x174)};}const _0x3fea93=_0x2c2df9[_0x58eebb(0x16b)],_0x325869=_0x2c2df9[_0x58eebb(0x18c)],_0x1cb899=_0x2c2df9[_0x58eebb(0x18f)][_0x58eebb(0x14d)];if(_0x3fea93===0x0&&_0x325869===0x0&&_0x1cb899===0x0)return{'status':_0x58eebb(0x17b),'allowGenerate':!![],'manualResolutionRequired':![],'message':_0x58eebb(0x154)+_0x64688+_0x58eebb(0x197),'nextAction':'run_generate_start'};if(_0x3fea93>0x1)return{'status':'blocked_multiple_complete_sets','allowGenerate':![],'manualResolutionRequired':!![],'message':_0x58eebb(0x154)+_0x64688+_0x58eebb(0x140),'nextAction':'manual_resolution_required'};if(_0x325869>0x0)return{'status':'blocked_incomplete_sets','allowGenerate':![],'manualResolutionRequired':!![],'message':_0x58eebb(0x154)+_0x64688+_0x58eebb(0x1ac),'nextAction':_0x58eebb(0x178)};if(_0x3fea93===0x1&&_0x1cb899>0x0)return{'status':_0x58eebb(0x12c),'allowGenerate':![],'manualResolutionRequired':!![],'message':_0x58eebb(0x154)+_0x64688+_0x58eebb(0x175),'nextAction':_0x58eebb(0x178)};if(_0x3fea93===0x1)return{'status':_0x25df65,'allowGenerate':![],'manualResolutionRequired':![],'message':_0x25df65===_0x58eebb(0x192)?_0x58eebb(0x154)+_0x64688+_0x58eebb(0x163):'Dataset\x20\x22'+_0x64688+'\x22\x20already\x20has\x20one\x20complete\x20Data\x20List\x20Page\x20set.','nextAction':_0x25df65==='generated_complete_set'?undefined:'run_sync'};return{'status':_0x58eebb(0x17a),'allowGenerate':![],'manualResolutionRequired':![],'message':_0x58eebb(0x154)+_0x64688+_0x58eebb(0x19a),'nextAction':_0x58eebb(0x164)};}export function assessGenerateOperationState(_0xb30749,_0x12fdd2,_0x8662de){const _0x37873e=a164_0x1e2b,_0x4ff317=String(_0x12fdd2||'')['trim']()['toUpperCase']();if(_0x4ff317===_0x37873e(0x15c))return{'status':'operation_pending','manualResolutionRequired':![],'message':_0x37873e(0x145)+_0xb30749+'\x22.','nextAction':'query_operation_status'};if(_0x4ff317===_0x37873e(0x13b)||_0x4ff317===_0x37873e(0x162)||_0x4ff317===_0x37873e(0x1a9))return{'status':'operation_running','manualResolutionRequired':![],'message':_0x37873e(0x168)+_0xb30749+'\x22.','nextAction':_0x37873e(0x164)};if(_0x4ff317===_0x37873e(0x15b)||_0x4ff317==='PARTIAL_SUCCESS'){if(!_0x8662de)return{'status':_0x37873e(0x17a),'manualResolutionRequired':![],'message':'Operation\x20finished\x20for\x20dataset\x20\x22'+_0xb30749+'\x22,\x20but\x20Data\x20List\x20Page\x20facts\x20are\x20unavailable.','nextAction':'query_operation_status'};const _0x529af3=assessDataListPageState(_0xb30749,_0x8662de,{'successStatus':_0x37873e(0x192)});if(_0x529af3[_0x37873e(0x1a5)]===_0x37873e(0x17b))return{'status':'unknown_reconcile_failed','manualResolutionRequired':![],'message':_0x37873e(0x156)+_0xb30749+_0x37873e(0x1a4),'nextAction':'query_operation_status'};return _0x529af3;}if(_0x4ff317===_0x37873e(0x1a7)||_0x4ff317==='CANCELLED'||_0x4ff317==='')return{'status':'operation_failed','manualResolutionRequired':![],'message':_0x37873e(0x149)+_0xb30749+'\x22.','nextAction':_0x37873e(0x164)};return{'status':_0x37873e(0x17a),'manualResolutionRequired':![],'message':'Dataset\x20\x22'+_0xb30749+_0x37873e(0x173)+_0x4ff317+'\x22.','nextAction':_0x37873e(0x164)};}export function normalizePageDetail(_0x31222e){const _0x2720ab=a164_0x1e2b;return{'pageId':Number(_0x31222e['pageId']),'appCode':_0x31222e[_0x2720ab(0x136)],'name':_0x31222e[_0x2720ab(0x1a8)]||'page-'+_0x31222e['pageId'],'code':_0x31222e['code']||'','type':_0x31222e['type']?String(_0x31222e[_0x2720ab(0x160)]):'UNKNOWN','datasetIds':Array['isArray'](_0x31222e[_0x2720ab(0x16d)])?_0x31222e[_0x2720ab(0x16d)][_0x2720ab(0x19e)](_0x2e92c1=>Number(_0x2e92c1))[_0x2720ab(0x13a)](_0x88b47f=>Number[_0x2720ab(0x185)](_0x88b47f)):[],'pageVersion':_0x31222e[_0x2720ab(0x195)]&&typeof _0x31222e[_0x2720ab(0x195)][_0x2720ab(0x190)]===_0x2720ab(0x159)?_0x31222e[_0x2720ab(0x195)][_0x2720ab(0x190)]:null,'versionTag':_0x31222e[_0x2720ab(0x195)]&&typeof _0x31222e[_0x2720ab(0x195)][_0x2720ab(0x143)]===_0x2720ab(0x1a1)&&_0x31222e[_0x2720ab(0x195)][_0x2720ab(0x143)][_0x2720ab(0x191)]()!==''?_0x31222e[_0x2720ab(0x195)][_0x2720ab(0x143)]:null,'relatedPages':normalizeRelatedPages(_0x31222e[_0x2720ab(0x169)]),'raw':_0x31222e};}function a164_0x1e2b(_0x56a2ea,_0x501876){_0x56a2ea=_0x56a2ea-0x127;const _0x3c50a9=a164_0x3c50();let _0x1e2b78=_0x3c50a9[_0x56a2ea];return _0x1e2b78;}export function serializeDryRunDescription(_0x833c9a){return JSON['stringify'](_0x833c9a,null,0x2);}export async function loadDataListPageStatusForGenerate(_0x576deb,_0x4e7b21){const _0x36fe13=await tryGetDataListPageStatus(_0x576deb['appCode'],_0x4e7b21);if(!_0x36fe13)return null;return normalizeDataListPageStatus(_0x36fe13,_0x4e7b21);}export function selectVersionTagGroup(_0xf24cfb,_0x38cd0f,_0x4b1d03){const _0x4fb5ad=a164_0x1e2b,_0xe16ec1=new Map();for(const _0x69f903 of _0xf24cfb){const _0x1190d3=normalizeVersionTag(_0x38cd0f(_0x69f903)),_0x3168c1=_0xe16ec1[_0x4fb5ad(0x196)](_0x1190d3)??[];_0x3168c1[_0x4fb5ad(0x146)](_0x69f903),_0xe16ec1['set'](_0x1190d3,_0x3168c1);}const _0x47814c=Array[_0x4fb5ad(0x17c)](_0xe16ec1[_0x4fb5ad(0x14e)]());if(_0x47814c[_0x4fb5ad(0x14d)]<=0x1&&!_0x4b1d03)return{'items':_0xf24cfb,'availableTags':_0x47814c};if(_0x4b1d03){const _0x46d56d=normalizeVersionTag(_0x4b1d03),_0x4a5195=_0xe16ec1[_0x4fb5ad(0x196)](_0x46d56d);if(!_0x4a5195)throw CliErrors[_0x4fb5ad(0x171)](_0x4fb5ad(0x152)+_0x4b1d03+_0x4fb5ad(0x176),buildVersionTagHint(_0x47814c));return{'items':_0x4a5195,'availableTags':_0x47814c};}throw CliErrors['validation'](_0x4fb5ad(0x133),buildVersionTagHint(_0x47814c));}function normalizeDatasetDetail(_0x1f4262,_0xb9b8d){const _0x11057a=a164_0x1e2b,_0x11b696=Array[_0x11057a(0x134)](_0x1f4262['fields'])?_0x1f4262['fields']:Array['isArray'](_0x1f4262[_0x11057a(0x137)])?_0x1f4262['properties']:[];return{'id':Number(_0x1f4262['id']??_0x1f4262['modelId']??0x0),'code':String(_0x1f4262[_0x11057a(0x18e)]||_0x1f4262[_0x11057a(0x141)]||_0xb9b8d),'name':String(_0x1f4262[_0x11057a(0x1a8)]||_0xb9b8d),'appCode':_0x1f4262[_0x11057a(0x136)]||_0x1f4262['dataset']?.[_0x11057a(0x136)],'fieldCount':_0x11b696[_0x11057a(0x14d)],'relatedPages':normalizeRelatedPages(_0x1f4262[_0x11057a(0x169)]),'raw':_0x1f4262};}function normalizeDataListPageStatus(_0x3350d4,_0x37fbdf){const _0x491774=a164_0x1e2b,_0x28787c=_0x29367f=>({'pageId':Number(_0x29367f[_0x491774(0x14c)]??_0x29367f['id']??0x0),'title':String(_0x29367f['title']||_0x29367f[_0x491774(0x1a8)]||_0x491774(0x15f)+(_0x29367f['pageId']??_0x29367f['id']??_0x491774(0x142))),'type':_0x29367f[_0x491774(0x160)]?String(_0x29367f[_0x491774(0x160)]):_0x491774(0x12e),'deleted':_0x29367f[_0x491774(0x193)]===!![],'hasMenu':_0x29367f[_0x491774(0x138)]===!![],'menuVisible':typeof _0x29367f[_0x491774(0x1a6)]===_0x491774(0x18a)?_0x29367f['menuVisible']:null,'menuPath':typeof _0x29367f[_0x491774(0x187)]===_0x491774(0x1a1)&&_0x29367f[_0x491774(0x187)][_0x491774(0x191)]()!==''?_0x29367f['menuPath']:null}),_0x2967c7=Array[_0x491774(0x134)](_0x3350d4[_0x491774(0x199)])?_0x3350d4[_0x491774(0x199)][_0x491774(0x19e)](_0x20c7c8=>({'versionTag':typeof _0x20c7c8[_0x491774(0x143)]===_0x491774(0x1a1)&&_0x20c7c8['versionTag'][_0x491774(0x191)]()!==''?_0x20c7c8[_0x491774(0x143)]:null,'complete':_0x20c7c8[_0x491774(0x1ab)]===!![],'pages':Array[_0x491774(0x134)](_0x20c7c8[_0x491774(0x19f)])?_0x20c7c8[_0x491774(0x19f)][_0x491774(0x19e)](_0x28787c):[]})):[];return{'datasetId':typeof _0x3350d4[_0x491774(0x153)]===_0x491774(0x159)&&Number[_0x491774(0x185)](_0x3350d4[_0x491774(0x153)])?_0x3350d4[_0x491774(0x153)]:null,'datasetCode':typeof _0x3350d4[_0x491774(0x139)]===_0x491774(0x1a1)&&_0x3350d4[_0x491774(0x139)][_0x491774(0x191)]()!==''?_0x3350d4[_0x491774(0x139)]:_0x37fbdf,'pageSets':_0x2967c7,'totalSets':typeof _0x3350d4[_0x491774(0x14f)]===_0x491774(0x159)&&Number[_0x491774(0x185)](_0x3350d4[_0x491774(0x14f)])?_0x3350d4['totalSets']:_0x2967c7[_0x491774(0x14d)],'completeSets':typeof _0x3350d4[_0x491774(0x16b)]===_0x491774(0x159)&&Number['isFinite'](_0x3350d4[_0x491774(0x16b)])?_0x3350d4['completeSets']:_0x2967c7[_0x491774(0x13a)](_0x2e983b=>_0x2e983b[_0x491774(0x1ab)])[_0x491774(0x14d)],'incompleteSets':typeof _0x3350d4['incompleteSets']==='number'&&Number[_0x491774(0x185)](_0x3350d4['incompleteSets'])?_0x3350d4['incompleteSets']:_0x2967c7['filter'](_0x1e1f69=>!_0x1e1f69['complete']&&_0x1e1f69['pages']['length']>0x0)[_0x491774(0x14d)],'residualPages':Array['isArray'](_0x3350d4[_0x491774(0x18f)])?_0x3350d4[_0x491774(0x18f)][_0x491774(0x19e)](_0x28787c):[],'menuPages':Array['isArray'](_0x3350d4[_0x491774(0x16a)])?_0x3350d4[_0x491774(0x16a)][_0x491774(0x19e)](_0x28787c):[],'source':_0x491774(0x183)};}function normalizeRelatedPages(_0x94f8a7){const _0x47baa6=a164_0x1e2b;if(!Array['isArray'](_0x94f8a7))return[];return _0x94f8a7['filter'](_0x2e4cdc=>_0x2e4cdc&&typeof _0x2e4cdc===_0x47baa6(0x135))['map'](_0x203f08=>({'id':Number(_0x203f08['id']),'type':_0x203f08[_0x47baa6(0x160)]?String(_0x203f08['type']):_0x47baa6(0x12e),'code':_0x203f08[_0x47baa6(0x18e)]||undefined,'title':_0x203f08[_0x47baa6(0x1a3)]||_0x203f08[_0x47baa6(0x1a8)]||_0x47baa6(0x15f)+_0x203f08['id'],'deleted':_0x203f08[_0x47baa6(0x193)]===!![]}))['filter'](_0xad0ce2=>Number['isFinite'](_0xad0ce2['id']));}function ensureAppOwnership(_0x48db39,_0x4f660e,_0x523bf6){const _0x543b3b=a164_0x1e2b;if(!_0x4f660e)return;if(_0x4f660e!==_0x48db39)throw CliErrors[_0x543b3b(0x171)](_0x523bf6,_0x543b3b(0x194)+CLI_BIN_NAME+_0x543b3b(0x19c));}function normalizeVersionTag(_0x35cd4c){const _0xc7962c=a164_0x1e2b;return _0x35cd4c&&_0x35cd4c[_0xc7962c(0x191)]()!==''?_0x35cd4c:_0xc7962c(0x147);}function buildVersionTagHint(_0x3caaf9){const _0x80684c=a164_0x1e2b,_0x589015=_0x3caaf9[_0x80684c(0x19e)](_0x54ae14=>_0x54ae14===_0x80684c(0x147)?'<empty>':_0x54ae14)[_0x80684c(0x130)](',\x20');return _0x80684c(0x182)+_0x589015;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a165_0x845e46=a165_0x4ca6;(function(_0x56329a,_0x437536){const _0x3c37b3=a165_0x4ca6,_0x36fe08=_0x56329a();while(!![]){try{const _0x3c19f4=-parseInt(_0x3c37b3(0x1a0))/0x1+-parseInt(_0x3c37b3(0x1a4))/0x2*(parseInt(_0x3c37b3(0x1b2))/0x3)+-parseInt(_0x3c37b3(0x1af))/0x4+-parseInt(_0x3c37b3(0x1b6))/0x5+parseInt(_0x3c37b3(0x1ab))/0x6+parseInt(_0x3c37b3(0x1b8))/0x7*(parseInt(_0x3c37b3(0x1b7))/0x8)+parseInt(_0x3c37b3(0x1b1))/0x9;if(_0x3c19f4===_0x437536)break;else _0x36fe08['push'](_0x36fe08['shift']());}catch(_0x2d74cb){_0x36fe08['push'](_0x36fe08['shift']());}}}(a165_0x56be,0x3ae13));import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a165_0x4ca6(_0x2cdfa7,_0x2ad550){_0x2cdfa7=_0x2cdfa7-0x19d;const _0x56bee3=a165_0x56be();let _0x4ca688=_0x56bee3[_0x2cdfa7];return _0x4ca688;}import{loadDatasetDetailForPage,prepareDatasetAction,serializeDryRunDescription,validateDatasetSelector}from'../../commands/page/shared.js';import{syncDataListPages}from'../../core/api-client.js';export const pageSync={'service':a165_0x845e46(0x1b4),'command':a165_0x845e46(0x1a3),'description':a165_0x845e46(0x1ba),'risk':a165_0x845e46(0x1a5),'defaultOutputFormat':'compress','flags':[APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL,{'name':a165_0x845e46(0x19d),'type':a165_0x845e46(0x1aa),'description':a165_0x845e46(0x1ac)}],async 'validate'(_0x2baa7f){validateDatasetSelector(_0x2baa7f);},async 'dryRun'(_0x5e5ab0){const _0x440955=a165_0x845e46,_0x57a86f=await prepare(_0x5e5ab0);return{'method':_0x440955(0x1ae),'url':'/smartapi/lovrabet/dataset/'+_0x57a86f[_0x440955(0x1a2)][_0x440955(0x19e)]+_0x440955(0x1b3),'body':{'appCode':_0x5e5ab0['appCode']},'description':serializeDryRunDescription({'dataset':{'id':_0x57a86f[_0x440955(0x1a2)]['id'],'code':_0x57a86f[_0x440955(0x1a2)][_0x440955(0x19e)],'name':_0x57a86f['dataset'][_0x440955(0x1b0)],'fieldCount':_0x57a86f[_0x440955(0x1a2)][_0x440955(0x1a6)]},'relatedPages':{'total':_0x57a86f[_0x440955(0x1a2)][_0x440955(0x1b9)][_0x440955(0x19f)],'undeletedCount':_0x57a86f[_0x440955(0x1b5)][_0x440955(0x19f)]},'action':_0x440955(0x1a3),'reason':_0x57a86f[_0x440955(0x1b5)][_0x440955(0x19f)]+'\x20undeleted\x20related\x20page(s)\x20found'})};},async 'execute'(_0x32c21d){const _0x2b93e5=a165_0x845e46,_0x1f4b9d=await prepare(_0x32c21d),_0x2f6079=await syncDataListPages(_0x32c21d[_0x2b93e5(0x1a1)],_0x1f4b9d['dataset'][_0x2b93e5(0x19e)]),_0x2cf93e=Array[_0x2b93e5(0x1ad)](_0x2f6079[_0x2b93e5(0x1a9)])&&_0x2f6079['failedPages']['length']>0x0,_0x275b08=_0x2cf93e?_0x2b93e5(0x1a7):_0x2b93e5(0x1a8);return{'ok':!![],'message':_0x275b08,'data':{'datasetCode':_0x1f4b9d[_0x2b93e5(0x1a2)][_0x2b93e5(0x19e)],..._0x2f6079}};}};function a165_0x56be(){const _0xcd169d=['1565956sZJstS','name','7771356pksKae','87TmVbaV','/sync-to-pages','page','undeletedPages','1464605rGLVuk','231320McnGOl','84oMeWXz','relatedPages','Sync\x20dataset\x20changes\x20to\x20related\x20Data\x20List\x20Pages','alias','code','length','448186hVQWVy','appCode','dataset','sync','3466yFtOIP','write','fieldCount','Some\x20pages\x20failed\x20to\x20sync','Sync\x20succeeded','failedPages','string','1281360HmRpcr','Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)','isArray','POST'];a165_0x56be=function(){return _0xcd169d;};return a165_0x56be();}async function prepare(_0x3a45bf){const _0x308d42=a165_0x845e46,_0x3e94dd=await loadDatasetDetailForPage(_0x3a45bf);return prepareDatasetAction(_0x3e94dd,_0x308d42(0x1a3));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3b8f58,_0x2b7eca){const _0x4bea41=a166_0x5a21,_0x923d8a=_0x3b8f58();while(!![]){try{const _0x1b1b17=-parseInt(_0x4bea41(0x1a2))/0x1*(parseInt(_0x4bea41(0x1a6))/0x2)+-parseInt(_0x4bea41(0x194))/0x3*(parseInt(_0x4bea41(0x1a4))/0x4)+-parseInt(_0x4bea41(0x1a5))/0x5*(-parseInt(_0x4bea41(0x1a1))/0x6)+parseInt(_0x4bea41(0x195))/0x7+parseInt(_0x4bea41(0x18d))/0x8+parseInt(_0x4bea41(0x1a3))/0x9*(-parseInt(_0x4bea41(0x190))/0xa)+-parseInt(_0x4bea41(0x198))/0xb*(parseInt(_0x4bea41(0x1a7))/0xc);if(_0x1b1b17===_0x2b7eca)break;else _0x923d8a['push'](_0x923d8a['shift']());}catch(_0x4b5c24){_0x923d8a['push'](_0x923d8a['shift']());}}}(a166_0x1281,0x57daa));import{existsSync}from'node:fs';import a166_0x2d8ab8 from'node:path';import a166_0x4e0465 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';function a166_0x5a21(_0x3b90d5,_0x1b88f2){_0x3b90d5=_0x3b90d5-0x18b;const _0x128120=a166_0x1281();let _0x5a21e1=_0x128120[_0x3b90d5];return _0x5a21e1;}import{selectSingleAppcode}from'../../../commands/common/app-selector.js';import{getProjectNameValidationError}from'../../../commands/project/create/project-name.js';export async function guidedCreateProject(_0x2dcc80,_0x41161e,_0x5fb5e){const _0x462e98=a166_0x5a21,_0x492559=_0x462e98(0x18f),_0x56250c=readConfig(),_0x2cfab3=typeof _0x56250c[_0x462e98(0x193)]===_0x462e98(0x19a)?_0x56250c[_0x462e98(0x193)]:undefined,_0x311d28=await input({'message':'Project\x20name:','default':_0x492559,'validate':_0x273af0=>{const _0x544ef5=_0x462e98,_0x4043d3=_0x273af0[_0x544ef5(0x192)]()||_0x492559,_0x84fb87=getProjectNameValidationError(_0x4043d3);if(_0x84fb87)return _0x84fb87;const _0x56a670=a166_0x2d8ab8[_0x544ef5(0x197)](process[_0x544ef5(0x18e)](),_0x4043d3);if(existsSync(_0x56a670))return'Directory\x20\x22'+_0x4043d3+_0x544ef5(0x19c);return!![];}});console[_0x462e98(0x19f)](a166_0x4e0465[_0x462e98(0x19d)]('√\x20Project\x20Name:\x20'+a166_0x4e0465[_0x462e98(0x18b)](_0x311d28)));const _0x3c1137=await selectSingleAppcode(_0x5fb5e);console[_0x462e98(0x19f)](a166_0x4e0465[_0x462e98(0x19d)](_0x462e98(0x196)+a166_0x4e0465[_0x462e98(0x18b)](_0x3c1137||'Not\x20set')));if(_0x3c1137){const _0x3e9c94=await getIsSessionValid();if(!_0x3e9c94){const _0x3d26e0=await confirm({'message':_0x462e98(0x18c),'default':!![]});if(_0x3d26e0){const _0x5443d8=await authServer({'silent':!![]});console[_0x462e98(0x19f)](a166_0x4e0465['green'](_0x462e98(0x199)+a166_0x4e0465[_0x462e98(0x18b)](_0x5443d8?_0x462e98(0x1a0):_0x462e98(0x19b))));}else console[_0x462e98(0x19f)](a166_0x4e0465['green']('√\x20Login\x20status:\x20'+a166_0x4e0465[_0x462e98(0x18b)](_0x462e98(0x191))));}await _0x2dcc80({'projectName':_0x311d28,'appCode':_0x3c1137,'env':_0x41161e||_0x2cfab3||'production'});}else await _0x2dcc80({'projectName':_0x311d28,'env':_0x41161e||_0x2cfab3||_0x462e98(0x19e)});}function a166_0x1281(){const _0x2affa9=['197749DgxNni','1569105BRGDmk','24tgwgEs','947855xhayGI','2JUrtBE','3612072hmKHtT','cyan','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','3427720lUIqSA','cwd','my-app','30xveQfH','Skipped','trim','env','513FMpYkb','2698416OKUcSN','√\x20App\x20Code:\x20','resolve','11ijJSwi','√\x20Login\x20status:\x20','string','Login\x20failed','\x22\x20already\x20exists','green','production','log','Logged\x20in','18dIhfuO'];a166_0x1281=function(){return _0x2affa9;};return a166_0x1281();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x9c53e1,_0x5208f3){const _0x23dd50=a167_0x1fe2,_0x21974c=_0x9c53e1();while(!![]){try{const _0x139803=parseInt(_0x23dd50(0x93))/0x1*(parseInt(_0x23dd50(0x8f))/0x2)+parseInt(_0x23dd50(0x95))/0x3+parseInt(_0x23dd50(0x92))/0x4*(parseInt(_0x23dd50(0x8e))/0x5)+-parseInt(_0x23dd50(0x97))/0x6*(-parseInt(_0x23dd50(0x99))/0x7)+parseInt(_0x23dd50(0x9a))/0x8+parseInt(_0x23dd50(0x90))/0x9*(parseInt(_0x23dd50(0x98))/0xa)+-parseInt(_0x23dd50(0x96))/0xb;if(_0x139803===_0x5208f3)break;else _0x21974c['push'](_0x21974c['shift']());}catch(_0x3eb0da){_0x21974c['push'](_0x21974c['shift']());}}}(a167_0x1318,0x4f906));function a167_0x1fe2(_0x5374d5,_0x3af6d0){_0x5374d5=_0x5374d5-0x8d;const _0x131833=a167_0x1318();let _0x1fe22b=_0x131833[_0x5374d5];return _0x1fe22b;}export function formatElapsed(_0x2e33c8){const _0x3839e8=a167_0x1fe2,_0xcff994=Date[_0x3839e8(0x91)]()-_0x2e33c8;if(_0xcff994<0x3e8)return _0xcff994+'ms';const _0x5692d5=(_0xcff994/0x3e8)[_0x3839e8(0x94)](0x2),_0x20de6e=_0x5692d5[_0x3839e8(0x8d)](/\.?0+$/u,'');return _0x20de6e+'s';}function a167_0x1318(){const _0xe67b3d=['replace','1425965RPIIPh','89282TIIcdj','9USBKAs','now','4JrJFrn','2SHGNyb','toFixed','1116183dzGEGk','11783937bdBvaK','6xVpsZF','2926480AnroQI','1820112yRnEQu','783688JqYiIT'];a167_0x1318=function(){return _0xe67b3d;};return a167_0x1318();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x101ada,_0x2419ec){const _0x3826aa=a163_0x1693,_0x1ad79d=_0x101ada();while(!![]){try{const _0x236a21=-parseInt(_0x3826aa(0x1db))/0x1*(-parseInt(_0x3826aa(0x1fa))/0x2)+-parseInt(_0x3826aa(0x1cb))/0x3+parseInt(_0x3826aa(0x1cd))/0x4*(parseInt(_0x3826aa(0x209))/0x5)+parseInt(_0x3826aa(0x218))/0x6*(-parseInt(_0x3826aa(0x21d))/0x7)+parseInt(_0x3826aa(0x1c7))/0x8*(-parseInt(_0x3826aa(0x1ef))/0x9)+-parseInt(_0x3826aa(0x20b))/0xa+parseInt(_0x3826aa(0x1fd))/0xb;if(_0x236a21===_0x2419ec)break;else _0x1ad79d['push'](_0x1ad79d['shift']());}catch(_0x584ad4){_0x1ad79d['push'](_0x1ad79d['shift']());}}}(a163_0x4ec9,0x6f2d5));import a163_0x404bc9 from'path';import a163_0x52d993 from'fs';import a163_0x26756d from'chalk';import a163_0x4fc7bb from'ora';function a163_0x4ec9(){const _0x417901=['dev','\x20run\x20start','production','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','stableVersion','info','\x20dataset(s),\x20generated\x20','API\x20configuration\x20pull\x20failed','projectCode','\x20|\x20Default:\x20implicit\x20(single\x20app)','Updating\x20package.json\x20name','Format\x20code','env','text','Unable\x20to\x20verify\x20ownership\x20of\x20the\x20created\x20project\x20directory','9tcwChd','warn','Resolving\x20project\x20template','existsSync','utf8','cookie','string','repeat','toLocaleString','Project\x20template\x20ready','√\x20package.json\x20updated:\x20name=','138664TXjyAJ','🚀\x20Next\x20Steps:','fail','27022325vuJVpI','minimumVersion','Project\x20created:\x20','\x20Generated\x20by\x20rabetbase\x20cli\x20','dirname','projectName','*\x20Configuring\x20AppCode\x20for\x20project\x20','Failed\x20to\x20clean\x20up\x20project\x20directory:\x20','bold','parse','success','log','2041895DdJhQx','verifying','88140EUpjjg','ino','create','Project\x20directory\x20','cyan','name','\x20√\x20','Project\x20creation\x20failed:\x20','Starting\x20project\x20creation:\x20','modelCount','join','message','resolve','194226cLnLRG','setLogPath','description','isDirectory','\x20config\x20set\x20appcode\x20<app-code>\x27','196zOLVGY','Install\x20dependencies','cd\x20','appCode','Copying\x20local\x20template\x20source','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','stringify','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','downloading','accessSync','green','*\x20Pulling\x20API\x20configuration...','apps','extracting','Failed\x20to\x20configure\x20app\x20AppCode','5908528jQvAtV','chdir','readFileSync','nonInteractive','2475411Lhtrdm','writeFileSync','4Miiguu','gray','needsUpgrade','cwd','belowMinimum','constants','Verifying\x20project\x20template','version','W_OK','...','package.json','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','resolving','keys','1vhaLNE','start','error','1.0.0','Skip\x20cleanup:\x20project\x20directory\x20ownership\x20changed:\x20'];a163_0x4ec9=function(){return _0x417901;};return a163_0x4ec9();}import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{loadRawConfigLayers,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 a163_0x1693(_0x3b31dc,_0x3594ef){_0x3b31dc=_0x3b31dc-0x1b9;const _0x4ec973=a163_0x4ec9();let _0x169328=_0x4ec973[_0x3b31dc];return _0x169328;}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';import{validateProjectName}from'../../../commands/project/create/project-name.js';import{getSdkClientRoutingConfig}from'../../../constant/domain.js';import{generateSdkConfigFile}from'../../../api/generate-sdk-config-file.js';function readDirectoryIdentity(_0x8f8b6c){const _0x84e145=a163_0x1693;try{const _0x1ff83f=a163_0x52d993['lstatSync'](_0x8f8b6c);if(!_0x1ff83f[_0x84e145(0x21b)]())return null;return{'dev':_0x1ff83f[_0x84e145(0x1e0)],'ino':_0x1ff83f[_0x84e145(0x20c)]};}catch{return null;}}export async function createApp(_0x46f2a9){const _0x3f42cb=a163_0x1693,_0x31ef7a=await checkCliVersion();(_0x31ef7a['needsUpgrade']||_0x31ef7a[_0x3f42cb(0x1d1)])&&(printCliUpgradeWarning(_0x31ef7a),assertCliVersionSupported(_0x31ef7a),logger[_0x3f42cb(0x1e5)]('create','CLI\x20version\x20check',{'currentVersion':_0x31ef7a['currentVersion'],'stableVersion':_0x31ef7a[_0x3f42cb(0x1e4)],'minimumVersion':_0x31ef7a[_0x3f42cb(0x1fe)],'needsUpgrade':_0x31ef7a[_0x3f42cb(0x1cf)],'belowMinimum':_0x31ef7a[_0x3f42cb(0x1d1)]}));if(_0x46f2a9[_0x3f42cb(0x1e8)]&&(_0x46f2a9[_0x3f42cb(0x1bb)]||_0x46f2a9[_0x3f42cb(0x1ca)]))await runCreate({'projectName':_0x46f2a9['projectCode'],'appCode':_0x46f2a9[_0x3f42cb(0x1bb)],'env':_0x46f2a9[_0x3f42cb(0x1ec)]},_0x46f2a9);else{if(_0x46f2a9[_0x3f42cb(0x1e8)]){const _0x1b6609=await selectSingleAppcode(_0x46f2a9[_0x3f42cb(0x1f4)]);await runCreate({'projectName':_0x46f2a9[_0x3f42cb(0x1e8)],'appCode':_0x1b6609||undefined,'env':_0x46f2a9[_0x3f42cb(0x1ec)]},_0x46f2a9);}else await guidedCreateProject(_0x4e0166=>runCreate(_0x4e0166,_0x46f2a9),_0x46f2a9['env'],_0x46f2a9[_0x3f42cb(0x1f4)]);}}async function runCreate(_0x22e498,_0x1f3a2d){const _0x394420=a163_0x1693;_0x22e498[_0x394420(0x202)]=validateProjectName(_0x22e498['projectName']);const _0xa3ed3b=a163_0x404bc9[_0x394420(0x217)](process[_0x394420(0x1d0)](),_0x22e498[_0x394420(0x202)]);if(a163_0x52d993[_0x394420(0x1f2)](_0xa3ed3b))throw new Error(_0x394420(0x20e)+_0x22e498[_0x394420(0x202)]+'\x20already\x20exists');let _0x497cbb=null;try{a163_0x52d993[_0x394420(0x1c1)](a163_0x404bc9[_0x394420(0x201)](_0xa3ed3b),a163_0x52d993[_0x394420(0x1d2)][_0x394420(0x1d5)]);}catch{throw new Error('Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions');}logger[_0x394420(0x1e5)](_0x394420(0x20d),_0x394420(0x213)+_0x22e498[_0x394420(0x202)],{'projectDir':_0xa3ed3b,'appCode':_0x22e498['appCode']}),console[_0x394420(0x208)](),console[_0x394420(0x208)](a163_0x26756d[_0x394420(0x1c2)](_0x394420(0x211))+'Project\x20name:\x20'+a163_0x26756d[_0x394420(0x1c2)](_0x22e498[_0x394420(0x202)])+(_0x22e498[_0x394420(0x1bb)]?'\x20|\x20AppCode:\x20'+a163_0x26756d[_0x394420(0x20f)](_0x22e498['appCode']):''));try{await runTask(_0x394420(0x1f1),_0x3fee43=>copyProjectTemplate(_0x22e498['projectName'],_0x169b25=>_0x3fee43(projectTemplateStageLabel(_0x169b25)),_0x1f3a2d['templateSource']),_0x394420(0x1f8)),_0x497cbb=readDirectoryIdentity(_0xa3ed3b);if(!_0x497cbb)throw new Error(_0x394420(0x1ee));await updatePackageJsonName(_0x22e498[_0x394420(0x202)]),await runTask(_0x394420(0x1b9),()=>installDependencies(_0x22e498[_0x394420(0x202)])),await runTask(_0x394420(0x1eb),()=>formatProjectCode(_0x22e498[_0x394420(0x202)])),await configureAppCode(_0x22e498[_0x394420(0x202)],_0x22e498[_0x394420(0x1bb)]||'',_0x22e498[_0x394420(0x1ec)]);let _0x1a23bc=![];if(_0x22e498['appCode']){console[_0x394420(0x208)](_0x394420(0x1c3));const _0x1177b3=process[_0x394420(0x1d0)]();try{process[_0x394420(0x1c8)](_0xa3ed3b);const _0x42ae77=_0x22e498[_0x394420(0x1ec)]||_0x394420(0x1e2);initEnv(_0x42ae77);const {configArray:_0x48d176}=await fetchModelList(_0x22e498[_0x394420(0x1bb)],_0x1f3a2d[_0x394420(0x1f4)]||''),_0x179c4a=DEFAULT_API_DIR,_0xff6f49=await generateApiFile(_0x48d176,'',_0x22e498[_0x394420(0x1bb)],!![],_0x42ae77,_0x179c4a,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':!![]});console[_0x394420(0x208)]('√\x20Pulled\x20'+_0x48d176['length']+_0x394420(0x1e6)+_0xff6f49[_0x394420(0x214)]+'\x20model(s)'),logger[_0x394420(0x1e5)]('create','API\x20configuration\x20pulled:\x20'+_0x22e498[_0x394420(0x1bb)]);}catch(_0x19c456){_0x1a23bc=!![],console[_0x394420(0x208)](_0x394420(0x1bf)),logger[_0x394420(0x1f0)](_0x394420(0x20d),_0x394420(0x1e7),{'error':_0x19c456 instanceof Error?_0x19c456[_0x394420(0x216)]:String(_0x19c456)});}finally{process[_0x394420(0x1c8)](_0x1177b3);}}logger[_0x394420(0x219)](_0xa3ed3b),logger[_0x394420(0x207)]('create',_0x394420(0x1ff)+_0x22e498[_0x394420(0x202)]),console[_0x394420(0x208)](),console['log'](a163_0x26756d[_0x394420(0x1c2)]('─'[_0x394420(0x1f6)](0x3c))),console[_0x394420(0x208)](a163_0x26756d['cyan'][_0x394420(0x205)](_0x394420(0x1fb))),console[_0x394420(0x208)](),console['log']('\x20\x201.\x20Start\x20project:\x20'+a163_0x26756d['cyan'][_0x394420(0x205)](_0x394420(0x1ba)+_0x22e498['projectName']+'\x20&&\x20'+CLI_BIN_NAME+_0x394420(0x1e1))),_0x1a23bc&&console[_0x394420(0x208)]('\x20\x202.\x20Pull\x20API\x20configuration:\x20'+a163_0x26756d[_0x394420(0x20f)][_0x394420(0x205)](CLI_BIN_NAME+'\x20api\x20pull')),console[_0x394420(0x208)](a163_0x26756d[_0x394420(0x1c2)]('─'[_0x394420(0x1f6)](0x3c)));}catch(_0x5f1028){logger[_0x394420(0x1dd)](_0x394420(0x20d),_0x394420(0x212)+_0x22e498[_0x394420(0x202)],{'error':_0x5f1028 instanceof Error?_0x5f1028['message']:String(_0x5f1028)});try{const _0xe9d1d4=readDirectoryIdentity(_0xa3ed3b);if(_0x497cbb&&_0xe9d1d4?.[_0x394420(0x1e0)]===_0x497cbb[_0x394420(0x1e0)]&&_0xe9d1d4['ino']===_0x497cbb[_0x394420(0x20c)])console[_0x394420(0x208)]('*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20'+_0xa3ed3b),a163_0x52d993['rmSync'](_0xa3ed3b,{'recursive':!![],'force':!![]});else _0xe9d1d4&&logger[_0x394420(0x1f0)](_0x394420(0x20d),_0x394420(0x1df)+_0xa3ed3b);}catch{logger[_0x394420(0x1f0)](_0x394420(0x20d),_0x394420(0x204)+_0xa3ed3b);}throw _0x5f1028;}}async function runTask(_0x138fe8,_0x36a7a6,_0x3c6627=_0x138fe8){const _0x23c547=a163_0x1693,_0x1590c7=a163_0x4fc7bb(_0x138fe8+_0x23c547(0x1d6))[_0x23c547(0x1dc)]();try{const _0x3a973f=await _0x36a7a6(_0x496ccd=>{const _0x475357=_0x23c547;_0x1590c7[_0x475357(0x1ed)]=_0x496ccd+_0x475357(0x1d6);});_0x1590c7['stop'](),console[_0x23c547(0x208)](''+a163_0x26756d['green'](_0x23c547(0x211))+_0x3c6627+'\x20'+a163_0x26756d[_0x23c547(0x1ce)]('['+_0x3a973f+']'));}catch(_0x16fe31){_0x1590c7[_0x23c547(0x1fc)](_0x138fe8);throw _0x16fe31;}}function projectTemplateStageLabel(_0x20d3ed){const _0x4e6ee7=a163_0x1693;switch(_0x20d3ed){case _0x4e6ee7(0x1d9):return _0x4e6ee7(0x1f1);case _0x4e6ee7(0x1c0):return'Downloading\x20project\x20template';case _0x4e6ee7(0x20a):return _0x4e6ee7(0x1d3);case _0x4e6ee7(0x1c5):return'Extracting\x20project\x20template';case'copying':return _0x4e6ee7(0x1bc);}}async function updatePackageJsonName(_0x4e9b31){const _0x5609f7=a163_0x1693,_0x2d768d=a163_0x404bc9['resolve'](process[_0x5609f7(0x1d0)](),_0x4e9b31),_0x2c01d4=a163_0x404bc9[_0x5609f7(0x215)](_0x2d768d,_0x5609f7(0x1d7));try{console['log'](_0x5609f7(0x1bd));const _0x53c074=getRabetbaseCliPackageRoot(),_0xdb9178=a163_0x404bc9['join'](_0x53c074,_0x5609f7(0x1d7));let _0x3bad0b=_0x5609f7(0x1de);try{const _0xa4269=JSON[_0x5609f7(0x206)](a163_0x52d993[_0x5609f7(0x1c9)](_0xdb9178,_0x5609f7(0x1f3)));_0x3bad0b=_0xa4269[_0x5609f7(0x1d4)]||_0x5609f7(0x1de);}catch{}const _0x6631ff=a163_0x52d993['readFileSync'](_0x2c01d4,_0x5609f7(0x1f3)),_0xf13772=JSON[_0x5609f7(0x206)](_0x6631ff);_0xf13772[_0x5609f7(0x210)]=_0x4e9b31,_0xf13772[_0x5609f7(0x21a)]=_0x4e9b31+_0x5609f7(0x200)+_0x3bad0b,a163_0x52d993[_0x5609f7(0x1cc)](_0x2c01d4,JSON[_0x5609f7(0x1be)](_0xf13772,null,0x2)+'\x0a',_0x5609f7(0x1f3)),console[_0x5609f7(0x208)](_0x5609f7(0x1f9)+_0x4e9b31),logger[_0x5609f7(0x1e5)](_0x5609f7(0x20d),_0x5609f7(0x1ea));}catch(_0x2d981f){logger[_0x5609f7(0x1dd)](_0x5609f7(0x20d),'Failed\x20to\x20update\x20package.json');throw _0x2d981f;}}async function configureAppCode(_0x86b1b5,_0x3598cc,_0x5cbfe9){const _0x1c6aad=a163_0x1693,_0x59d54b=a163_0x404bc9[_0x1c6aad(0x217)](process[_0x1c6aad(0x1d0)](),_0x86b1b5),_0x2eb68f=a163_0x404bc9[_0x1c6aad(0x215)](_0x59d54b,NEW_CONFIG_NAME);try{_0x3598cc?console[_0x1c6aad(0x208)](_0x1c6aad(0x203)+_0x86b1b5+':\x20'+_0x3598cc):console[_0x1c6aad(0x208)](_0x1c6aad(0x1e3)+_0x86b1b5);const _0x3ca3c6=getRabetbaseCliPackageRoot(),_0x27c53a=a163_0x404bc9[_0x1c6aad(0x215)](_0x3ca3c6,'package.json');let _0x4ab6ab='1.0.0';try{const _0x1a2c18=JSON[_0x1c6aad(0x206)](a163_0x52d993[_0x1c6aad(0x1c9)](_0x27c53a,_0x1c6aad(0x1f3)));_0x4ab6ab=_0x1a2c18[_0x1c6aad(0x1d4)]||_0x1c6aad(0x1de);}catch{}const {globalConfig:_0x20578d}=loadRawConfigLayers(),_0x3065ef=typeof _0x20578d[_0x1c6aad(0x1ec)]===_0x1c6aad(0x1f5)?_0x20578d[_0x1c6aad(0x1ec)]:undefined,_0x285105={};for(const _0x4ccdbc of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x20578d[_0x4ccdbc]!=null)_0x285105[_0x4ccdbc]=_0x20578d[_0x4ccdbc];}const _0x1d1a57=buildCanonicalProjectConfig(_0x285105,{'appCodes':_0x3598cc?[_0x3598cc]:[],'env':_0x5cbfe9||_0x3065ef||'production','metadata':{'createdAt':new Date()[_0x1c6aad(0x1f7)](),'version':_0x4ab6ab}});writeConfigFile(_0x2eb68f,_0x1d1a57),await generateSdkConfigFile(a163_0x404bc9[_0x1c6aad(0x215)](_0x59d54b,DEFAULT_API_DIR),getSdkClientRoutingConfig()),_0x3598cc?console[_0x1c6aad(0x208)]('√\x20Configuration\x20file\x20created,\x20Apps:\x20'+Object[_0x1c6aad(0x1da)](_0x1d1a57[_0x1c6aad(0x1c4)]||{})['join'](',\x20')+_0x1c6aad(0x1e9)):console[_0x1c6aad(0x208)](_0x1c6aad(0x1d8)+CLI_BIN_NAME+_0x1c6aad(0x21c)),logger[_0x1c6aad(0x1e5)]('create','Configured\x20app\x20AppCode:\x20'+_0x3598cc);}catch(_0x45a7fa){logger[_0x1c6aad(0x1dd)]('create',_0x1c6aad(0x1c6));throw _0x45a7fa;}}
|
|
1
|
+
(function(_0x463a51,_0x423e08){const _0x2e9bd7=a168_0x348d,_0x1cb07a=_0x463a51();while(!![]){try{const _0x2b080e=parseInt(_0x2e9bd7(0x178))/0x1*(parseInt(_0x2e9bd7(0x141))/0x2)+-parseInt(_0x2e9bd7(0x18d))/0x3+-parseInt(_0x2e9bd7(0x127))/0x4+parseInt(_0x2e9bd7(0x14c))/0x5+parseInt(_0x2e9bd7(0x189))/0x6*(parseInt(_0x2e9bd7(0x170))/0x7)+parseInt(_0x2e9bd7(0x15a))/0x8+parseInt(_0x2e9bd7(0x161))/0x9*(-parseInt(_0x2e9bd7(0x165))/0xa);if(_0x2b080e===_0x423e08)break;else _0x1cb07a['push'](_0x1cb07a['shift']());}catch(_0x51fdf2){_0x1cb07a['push'](_0x1cb07a['shift']());}}}(a168_0x5577,0x436f9));import a168_0x51e0b2 from'path';import a168_0x3f459f from'fs';import a168_0x4c0b1b from'chalk';import a168_0x228a6b from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{loadRawConfigLayers,writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';function a168_0x5577(){const _0x40754a=['accessSync','API\x20configuration\x20pull\x20failed','🚀\x20Next\x20Steps:','cookie','verifying','31466dGPVMp','Skip\x20cleanup:\x20project\x20directory\x20ownership\x20changed:\x20','Extracting\x20project\x20template','Project\x20name:\x20','lstatSync','belowMinimum','projectName','Unable\x20to\x20verify\x20ownership\x20of\x20the\x20created\x20project\x20directory','log','appCode','Project\x20template\x20ready','1645560EEmJiW','utf8','Verifying\x20project\x20template','keys','Project\x20created:\x20','version','\x20&&\x20','\x20config\x20set\x20appcode\x20<app-code>\x27','stringify','writeFileSync','constants','Resolving\x20project\x20template','gray','...','3243472UYluSG','downloading','*\x20Pulling\x20API\x20configuration...','warn','description','\x20model(s)','join','513Xutdno','\x20|\x20AppCode:\x20','string','\x20√\x20','41630GvKyXx','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','Copying\x20local\x20template\x20source','minimumVersion','\x20run\x20start','dev','Failed\x20to\x20update\x20package.json','Format\x20code','copying','green','7FYUtAO','env','1.0.0','readFileSync','resolving','\x20dataset(s),\x20generated\x20','\x20Generated\x20by\x20rabetbase\x20cli\x20','√\x20Configuration\x20file\x20created,\x20Apps:\x20','6PbuaBu','repeat','bold','success','package.json','needsUpgrade','parse','extracting','*\x20Configuring\x20AppCode\x20for\x20project\x20','Failed\x20to\x20configure\x20app\x20AppCode','projectCode','error','cyan','rmSync','cwd','resolve','\x20api\x20pull','2116518cTPVoF','templateSource','setLogPath','\x20already\x20exists','1311006SSejMZ','chdir','toLocaleString','Install\x20dependencies','create','modelCount','924748HhNbpj','√\x20package.json\x20updated:\x20name=','ino','info','apps','Starting\x20project\x20creation:\x20','Project\x20creation\x20failed:\x20','isDirectory','√\x20Pulled\x20','Project\x20directory\x20','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','text','Configured\x20app\x20AppCode:\x20','currentVersion','\x20|\x20Default:\x20implicit\x20(single\x20app)','nonInteractive','name','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','cd\x20','production'];a168_0x5577=function(){return _0x40754a;};return a168_0x5577();}function a168_0x348d(_0xcc3633,_0xf23637){_0xcc3633=_0xcc3633-0x126;const _0x5577ca=a168_0x5577();let _0x348d84=_0x5577ca[_0xcc3633];return _0x348d84;}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';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';import{validateProjectName}from'../../../commands/project/create/project-name.js';import{getSdkClientRoutingConfig}from'../../../constant/domain.js';import{generateSdkConfigFile}from'../../../api/generate-sdk-config-file.js';import{writeProjectRoutingManifest}from'../../../config/project-routing.js';function readDirectoryIdentity(_0x5f48ce){const _0x2b3765=a168_0x348d;try{const _0x5826b4=a168_0x3f459f[_0x2b3765(0x145)](_0x5f48ce);if(!_0x5826b4[_0x2b3765(0x12e)]())return null;return{'dev':_0x5826b4['dev'],'ino':_0x5826b4['ino']};}catch{return null;}}export async function createApp(_0xa4e41d){const _0x2b01a7=a168_0x348d,_0x37c660=await checkCliVersion();(_0x37c660['needsUpgrade']||_0x37c660[_0x2b01a7(0x146)])&&(printCliUpgradeWarning(_0x37c660),assertCliVersionSupported(_0x37c660),logger[_0x2b01a7(0x12a)](_0x2b01a7(0x191),'CLI\x20version\x20check',{'currentVersion':_0x37c660[_0x2b01a7(0x135)],'stableVersion':_0x37c660['stableVersion'],'minimumVersion':_0x37c660[_0x2b01a7(0x169)],'needsUpgrade':_0x37c660[_0x2b01a7(0x17d)],'belowMinimum':_0x37c660[_0x2b01a7(0x146)]}));if(_0xa4e41d[_0x2b01a7(0x182)]&&(_0xa4e41d['appCode']||_0xa4e41d[_0x2b01a7(0x137)]))await runCreate({'projectName':_0xa4e41d['projectCode'],'appCode':_0xa4e41d['appCode'],'env':_0xa4e41d['env']},_0xa4e41d);else{if(_0xa4e41d[_0x2b01a7(0x182)]){const _0x326f75=await selectSingleAppcode(_0xa4e41d[_0x2b01a7(0x13f)]);await runCreate({'projectName':_0xa4e41d['projectCode'],'appCode':_0x326f75||undefined,'env':_0xa4e41d[_0x2b01a7(0x171)]},_0xa4e41d);}else await guidedCreateProject(_0x50c92e=>runCreate(_0x50c92e,_0xa4e41d),_0xa4e41d['env'],_0xa4e41d[_0x2b01a7(0x13f)]);}}async function runCreate(_0x2ce2c7,_0x46314c){const _0x59053b=a168_0x348d;_0x2ce2c7['projectName']=validateProjectName(_0x2ce2c7['projectName']);const _0x4e662f=a168_0x51e0b2['resolve'](process[_0x59053b(0x186)](),_0x2ce2c7[_0x59053b(0x147)]);if(a168_0x3f459f['existsSync'](_0x4e662f))throw new Error(_0x59053b(0x130)+_0x2ce2c7[_0x59053b(0x147)]+_0x59053b(0x18c));let _0x1694d8=null;try{a168_0x3f459f[_0x59053b(0x13c)](a168_0x51e0b2['dirname'](_0x4e662f),a168_0x3f459f[_0x59053b(0x156)]['W_OK']);}catch{throw new Error(_0x59053b(0x139));}logger['info'](_0x59053b(0x191),_0x59053b(0x12c)+_0x2ce2c7[_0x59053b(0x147)],{'projectDir':_0x4e662f,'appCode':_0x2ce2c7[_0x59053b(0x14a)]}),console[_0x59053b(0x149)](),console[_0x59053b(0x149)](a168_0x4c0b1b[_0x59053b(0x16f)]('\x20√\x20')+_0x59053b(0x144)+a168_0x4c0b1b[_0x59053b(0x16f)](_0x2ce2c7[_0x59053b(0x147)])+(_0x2ce2c7[_0x59053b(0x14a)]?_0x59053b(0x162)+a168_0x4c0b1b[_0x59053b(0x184)](_0x2ce2c7[_0x59053b(0x14a)]):''));try{await runTask(_0x59053b(0x157),_0x147d4b=>copyProjectTemplate(_0x2ce2c7[_0x59053b(0x147)],_0x568ff8=>_0x147d4b(projectTemplateStageLabel(_0x568ff8)),_0x46314c[_0x59053b(0x18a)]),_0x59053b(0x14b)),_0x1694d8=readDirectoryIdentity(_0x4e662f);if(!_0x1694d8)throw new Error(_0x59053b(0x148));await updatePackageJsonName(_0x2ce2c7[_0x59053b(0x147)]),await runTask(_0x59053b(0x190),()=>installDependencies(_0x2ce2c7[_0x59053b(0x147)])),await runTask(_0x59053b(0x16d),()=>formatProjectCode(_0x2ce2c7[_0x59053b(0x147)])),await configureAppCode(_0x2ce2c7['projectName'],_0x2ce2c7[_0x59053b(0x14a)]||'',_0x2ce2c7[_0x59053b(0x171)]);let _0x4ef245=![];if(_0x2ce2c7[_0x59053b(0x14a)]){console[_0x59053b(0x149)](_0x59053b(0x15c));const _0x4b5ac0=process[_0x59053b(0x186)]();try{process['chdir'](_0x4e662f);const _0x37d04c=_0x2ce2c7['env']||_0x59053b(0x13b);initEnv(_0x37d04c);const {configArray:_0x408bb9}=await fetchModelList(_0x2ce2c7[_0x59053b(0x14a)],_0x46314c[_0x59053b(0x13f)]||''),_0x15c8f7=DEFAULT_API_DIR,_0x3163e7=await generateApiFile(_0x408bb9,'',_0x2ce2c7[_0x59053b(0x14a)],!![],_0x37d04c,_0x15c8f7,undefined,getSdkClientRoutingConfig(),{'overwriteTypescript':!![]});console[_0x59053b(0x149)](_0x59053b(0x12f)+_0x408bb9['length']+_0x59053b(0x175)+_0x3163e7[_0x59053b(0x126)]+_0x59053b(0x15f)),logger[_0x59053b(0x12a)]('create','API\x20configuration\x20pulled:\x20'+_0x2ce2c7[_0x59053b(0x14a)]);}catch(_0x16a605){_0x4ef245=!![],console[_0x59053b(0x149)](_0x59053b(0x131)),logger[_0x59053b(0x15d)](_0x59053b(0x191),_0x59053b(0x13d),{'error':_0x16a605 instanceof Error?_0x16a605['message']:String(_0x16a605)});}finally{process[_0x59053b(0x18e)](_0x4b5ac0);}}logger[_0x59053b(0x18b)](_0x4e662f),logger[_0x59053b(0x17b)](_0x59053b(0x191),_0x59053b(0x150)+_0x2ce2c7[_0x59053b(0x147)]),console[_0x59053b(0x149)](),console[_0x59053b(0x149)](a168_0x4c0b1b[_0x59053b(0x16f)]('─'[_0x59053b(0x179)](0x3c))),console[_0x59053b(0x149)](a168_0x4c0b1b[_0x59053b(0x184)][_0x59053b(0x17a)](_0x59053b(0x13e))),console[_0x59053b(0x149)](),console[_0x59053b(0x149)]('\x20\x201.\x20Start\x20project:\x20'+a168_0x4c0b1b[_0x59053b(0x184)][_0x59053b(0x17a)](_0x59053b(0x13a)+_0x2ce2c7[_0x59053b(0x147)]+_0x59053b(0x152)+CLI_BIN_NAME+_0x59053b(0x16a))),_0x4ef245&&console[_0x59053b(0x149)]('\x20\x202.\x20Pull\x20API\x20configuration:\x20'+a168_0x4c0b1b[_0x59053b(0x184)][_0x59053b(0x17a)](CLI_BIN_NAME+_0x59053b(0x188))),console[_0x59053b(0x149)](a168_0x4c0b1b['green']('─'[_0x59053b(0x179)](0x3c)));}catch(_0x1b84e1){logger[_0x59053b(0x183)](_0x59053b(0x191),_0x59053b(0x12d)+_0x2ce2c7['projectName'],{'error':_0x1b84e1 instanceof Error?_0x1b84e1['message']:String(_0x1b84e1)});try{const _0x3c5815=readDirectoryIdentity(_0x4e662f);if(_0x1694d8&&_0x3c5815?.['dev']===_0x1694d8[_0x59053b(0x16b)]&&_0x3c5815[_0x59053b(0x129)]===_0x1694d8[_0x59053b(0x129)])console['log'](_0x59053b(0x166)+_0x4e662f),a168_0x3f459f[_0x59053b(0x185)](_0x4e662f,{'recursive':!![],'force':!![]});else _0x3c5815&&logger[_0x59053b(0x15d)](_0x59053b(0x191),_0x59053b(0x142)+_0x4e662f);}catch{logger[_0x59053b(0x15d)](_0x59053b(0x191),'Failed\x20to\x20clean\x20up\x20project\x20directory:\x20'+_0x4e662f);}throw _0x1b84e1;}}async function runTask(_0x4383d7,_0xe3a3d,_0x46b4a6=_0x4383d7){const _0x48ab96=a168_0x348d,_0x102f33=a168_0x228a6b(_0x4383d7+'...')['start']();try{const _0x7c0184=await _0xe3a3d(_0x3a6330=>{const _0x1e2c4e=a168_0x348d;_0x102f33[_0x1e2c4e(0x133)]=_0x3a6330+_0x1e2c4e(0x159);});_0x102f33['stop'](),console['log'](''+a168_0x4c0b1b[_0x48ab96(0x16f)](_0x48ab96(0x164))+_0x46b4a6+'\x20'+a168_0x4c0b1b[_0x48ab96(0x158)]('['+_0x7c0184+']'));}catch(_0x5bd24d){_0x102f33['fail'](_0x4383d7);throw _0x5bd24d;}}function projectTemplateStageLabel(_0x26c3f0){const _0x382eb8=a168_0x348d;switch(_0x26c3f0){case _0x382eb8(0x174):return _0x382eb8(0x157);case _0x382eb8(0x15b):return'Downloading\x20project\x20template';case _0x382eb8(0x140):return _0x382eb8(0x14e);case _0x382eb8(0x17f):return _0x382eb8(0x143);case _0x382eb8(0x16e):return _0x382eb8(0x168);}}async function updatePackageJsonName(_0x1b00e4){const _0x58c748=a168_0x348d,_0x4dfd37=a168_0x51e0b2[_0x58c748(0x187)](process['cwd'](),_0x1b00e4),_0x53d53c=a168_0x51e0b2['join'](_0x4dfd37,_0x58c748(0x17c));try{console[_0x58c748(0x149)](_0x58c748(0x132));const _0x44f866=getRabetbaseCliPackageRoot(),_0x10bfb0=a168_0x51e0b2[_0x58c748(0x160)](_0x44f866,_0x58c748(0x17c));let _0x1f8b6e=_0x58c748(0x172);try{const _0x30586e=JSON['parse'](a168_0x3f459f[_0x58c748(0x173)](_0x10bfb0,_0x58c748(0x14d)));_0x1f8b6e=_0x30586e[_0x58c748(0x151)]||_0x58c748(0x172);}catch{}const _0x3fa73c=a168_0x3f459f[_0x58c748(0x173)](_0x53d53c,_0x58c748(0x14d)),_0x2076f3=JSON[_0x58c748(0x17e)](_0x3fa73c);_0x2076f3[_0x58c748(0x138)]=_0x1b00e4,_0x2076f3[_0x58c748(0x15e)]=_0x1b00e4+_0x58c748(0x176)+_0x1f8b6e,a168_0x3f459f[_0x58c748(0x155)](_0x53d53c,JSON[_0x58c748(0x154)](_0x2076f3,null,0x2)+'\x0a','utf8'),console['log'](_0x58c748(0x128)+_0x1b00e4),logger['info'](_0x58c748(0x191),'Updating\x20package.json\x20name');}catch(_0x1c3780){logger['error'](_0x58c748(0x191),_0x58c748(0x16c));throw _0x1c3780;}}async function configureAppCode(_0x1e7e10,_0x22636b,_0x1c60dc){const _0x2886b9=a168_0x348d,_0xce0f8f=a168_0x51e0b2['resolve'](process['cwd'](),_0x1e7e10),_0x8de3b7=a168_0x51e0b2[_0x2886b9(0x160)](_0xce0f8f,NEW_CONFIG_NAME);try{_0x22636b?console[_0x2886b9(0x149)](_0x2886b9(0x180)+_0x1e7e10+':\x20'+_0x22636b):console[_0x2886b9(0x149)]('*\x20Creating\x20configuration\x20file\x20for\x20project\x20'+_0x1e7e10);const _0x5418af=getRabetbaseCliPackageRoot(),_0x545c7b=a168_0x51e0b2[_0x2886b9(0x160)](_0x5418af,_0x2886b9(0x17c));let _0x2a0494=_0x2886b9(0x172);try{const _0x951e2d=JSON['parse'](a168_0x3f459f['readFileSync'](_0x545c7b,_0x2886b9(0x14d)));_0x2a0494=_0x951e2d[_0x2886b9(0x151)]||_0x2886b9(0x172);}catch{}const {globalConfig:_0x509719}=loadRawConfigLayers(),_0x3c74f0=typeof _0x509719['env']===_0x2886b9(0x163)?_0x509719['env']:undefined,_0x1c1d10={};for(const _0xd9f7d5 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x509719[_0xd9f7d5]!=null)_0x1c1d10[_0xd9f7d5]=_0x509719[_0xd9f7d5];}const _0xf3076e=buildCanonicalProjectConfig(_0x1c1d10,{'appCodes':_0x22636b?[_0x22636b]:[],'env':_0x1c60dc||_0x3c74f0||'production','metadata':{'createdAt':new Date()[_0x2886b9(0x18f)](),'version':_0x2a0494}});writeConfigFile(_0x8de3b7,_0xf3076e),await generateSdkConfigFile(a168_0x51e0b2[_0x2886b9(0x160)](_0xce0f8f,DEFAULT_API_DIR),getSdkClientRoutingConfig()),writeProjectRoutingManifest(_0xce0f8f),_0x22636b?console[_0x2886b9(0x149)](_0x2886b9(0x177)+Object[_0x2886b9(0x14f)](_0xf3076e[_0x2886b9(0x12b)]||{})[_0x2886b9(0x160)](',\x20')+_0x2886b9(0x136)):console[_0x2886b9(0x149)](_0x2886b9(0x167)+CLI_BIN_NAME+_0x2886b9(0x153)),logger['info'](_0x2886b9(0x191),_0x2886b9(0x134)+_0x22636b);}catch(_0x2cdc45){logger[_0x2886b9(0x183)](_0x2886b9(0x191),_0x2886b9(0x181));throw _0x2cdc45;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a164_0x24f6f0=a164_0x1b8e;(function(_0x3816dd,_0x2f1e4d){const _0x40034e=a164_0x1b8e,_0x55e3ed=_0x3816dd();while(!![]){try{const _0x372fff=parseInt(_0x40034e(0x146))/0x1+parseInt(_0x40034e(0x16a))/0x2*(-parseInt(_0x40034e(0x175))/0x3)+parseInt(_0x40034e(0x137))/0x4+-parseInt(_0x40034e(0x159))/0x5+-parseInt(_0x40034e(0x150))/0x6+parseInt(_0x40034e(0x12c))/0x7*(parseInt(_0x40034e(0x130))/0x8)+-parseInt(_0x40034e(0x13e))/0x9*(-parseInt(_0x40034e(0x160))/0xa);if(_0x372fff===_0x2f1e4d)break;else _0x55e3ed['push'](_0x55e3ed['shift']());}catch(_0x1fe844){_0x55e3ed['push'](_0x55e3ed['shift']());}}}(a164_0x37ea,0xd7923));import{createHash}from'node:crypto';import a164_0x1f8e99 from'node:fs/promises';import a164_0x3d3f9a from'node:path';function a164_0x1b8e(_0x5a23fe,_0x2a19d3){_0x5a23fe=_0x5a23fe-0x10c;const _0x37ea07=a164_0x37ea();let _0x1b8e1d=_0x37ea07[_0x5a23fe];return _0x1b8e1d;}import{PROJECT_TEMPLATE_ASSET_BASE_URL}from'../../../constant/cdn.js';import{extractProjectTemplateArchive}from'../../../commands/project/create/project-template-archive.js';import{getRabetbaseCdnConfig}from'../../../utils/cli-version-policy.js';import{CliErrors}from'../../../errors.js';const TEMPLATE_ID='sub-app-react-demo',ARCHIVE_TIMEOUT_MS=0x3a98,MAX_ARCHIVE_SIZE=0x14*0x400*0x400;function nonEmptyString(_0x31b7ed){const _0x435ec3=a164_0x1b8e;return typeof _0x31b7ed==='string'&&_0x31b7ed[_0x435ec3(0x148)]()?_0x31b7ed[_0x435ec3(0x148)]():null;}function parseDescriptor(_0x2824e){const _0x5b8bff=a164_0x1b8e;if(!_0x2824e||typeof _0x2824e!==_0x5b8bff(0x136))throw new Error(_0x5b8bff(0x17d)+TEMPLATE_ID+'\x22.');const _0x5b4910=_0x2824e,_0x22651c=nonEmptyString(_0x5b4910['version']),_0x3dcf84=nonEmptyString(_0x5b4910[_0x5b8bff(0x154)]),_0x103703=nonEmptyString(_0x5b4910['sha256'])?.[_0x5b8bff(0x179)](),_0x5d93a0=_0x5b4910[_0x5b8bff(0x13a)];if(!_0x22651c||!_0x3dcf84||_0x3dcf84!==a164_0x3d3f9a[_0x5b8bff(0x127)][_0x5b8bff(0x14a)](_0x3dcf84)||_0x3dcf84[_0x5b8bff(0x131)]('\x5c')||!_0x103703||!/^sha256:[a-f0-9]{64}$/[_0x5b8bff(0x164)](_0x103703)||typeof _0x5d93a0!==_0x5b8bff(0x172)||!Number[_0x5b8bff(0x125)](_0x5d93a0)||_0x5d93a0<=0x0||_0x5d93a0>MAX_ARCHIVE_SIZE)throw new Error(_0x5b8bff(0x170)+TEMPLATE_ID+'\x22.');return{'version':_0x22651c,'name':_0x3dcf84,'sha256':_0x103703,'size':_0x5d93a0};}async function fetchWithTimeout(_0x2b10d4,_0x1c43b4,_0x15aad3,_0x263360){const _0x3d00e5=a164_0x1b8e,_0x255093=new AbortController(),_0x213920=setTimeout(()=>_0x255093[_0x3d00e5(0x155)](),_0x1c43b4);try{const _0x3bea62=await fetch(_0x2b10d4,{'headers':{'Accept':_0x15aad3},'signal':_0x255093['signal']});return await _0x263360(_0x3bea62);}finally{clearTimeout(_0x213920);}}async function fetchTemplateDescriptor(){const _0x3eccbd=a164_0x1b8e,_0x57024f=await getRabetbaseCdnConfig();if(!_0x57024f)throw new Error(_0x3eccbd(0x162));return parseDescriptor(_0x57024f[_0x3eccbd(0x115)]);}function resolveArchiveUrl(_0x59a082){const _0x443686=a164_0x1b8e,_0x185fd4=new URL(PROJECT_TEMPLATE_ASSET_BASE_URL+'/'),_0xa56da=new URL(_0x59a082,_0x185fd4);if(_0xa56da[_0x443686(0x165)]!==_0x443686(0x112)||_0xa56da['origin']!==_0x185fd4[_0x443686(0x111)]||!_0xa56da[_0x443686(0x158)][_0x443686(0x11e)](_0x185fd4[_0x443686(0x158)]))throw new Error(_0x443686(0x116));return _0xa56da[_0x443686(0x118)];}async function readResponseBytes(_0x5d299e,_0xea13a6){const _0xdd3bb6=a164_0x1b8e;if(!_0x5d299e[_0xdd3bb6(0x17b)]){const _0x23ce02=Buffer['from'](await _0x5d299e[_0xdd3bb6(0x17c)]());if(_0x23ce02[_0xdd3bb6(0x121)]>_0xea13a6)throw new Error(_0xdd3bb6(0x167));return _0x23ce02;}const _0x294d83=_0x5d299e[_0xdd3bb6(0x17b)][_0xdd3bb6(0x15f)](),_0x26d4b2=[];let _0x65d1a5=0x0;try{while(!![]){const {done:_0x2e0e81,value:_0x5947b0}=await _0x294d83[_0xdd3bb6(0x176)]();if(_0x2e0e81)break;_0x65d1a5+=_0x5947b0[_0xdd3bb6(0x147)];if(_0x65d1a5>_0xea13a6){await _0x294d83[_0xdd3bb6(0x13f)]();throw new Error(_0xdd3bb6(0x167));}_0x26d4b2[_0xdd3bb6(0x156)](Buffer[_0xdd3bb6(0x12b)](_0x5947b0));}}finally{_0x294d83[_0xdd3bb6(0x16b)]();}return Buffer['concat'](_0x26d4b2,_0x65d1a5);}async function downloadArchive(_0xf3845e,_0x54da98,_0x5b134b){const _0x5b1498=a164_0x1b8e,_0x2902bf=await fetchWithTimeout(resolveArchiveUrl(_0xf3845e['name']),ARCHIVE_TIMEOUT_MS,_0x5b1498(0x14e),async _0x403f7d=>{const _0x3959fb=_0x5b1498;if(!_0x403f7d['ok'])throw new Error('CDN\x20project\x20template\x20request\x20failed\x20with\x20HTTP\x20'+_0x403f7d['status']+'.');const _0x51ef48=Number(_0x403f7d[_0x3959fb(0x17a)][_0x3959fb(0x177)](_0x3959fb(0x145)));if(Number[_0x3959fb(0x10c)](_0x51ef48)&&_0x51ef48>MAX_ARCHIVE_SIZE)throw new Error(_0x3959fb(0x128));return readResponseBytes(_0x403f7d,_0xf3845e[_0x3959fb(0x13a)]);});if(_0x2902bf[_0x5b1498(0x121)]!==_0xf3845e[_0x5b1498(0x13a)])throw new Error(_0x5b1498(0x15c)+_0xf3845e[_0x5b1498(0x13a)]+_0x5b1498(0x151)+_0x2902bf[_0x5b1498(0x121)]+'.');_0x5b134b?.(_0x5b1498(0x11d));const _0x462227=_0x5b1498(0x11f)+createHash(_0x5b1498(0x126))['update'](_0x2902bf)['digest']('hex');if(_0x462227!==_0xf3845e['sha256'])throw new Error(_0x5b1498(0x15b));await a164_0x1f8e99[_0x5b1498(0x173)](_0x54da98,_0x2902bf,{'flag':'wx'});}function a164_0x37ea(){const _0x550d55=['Local\x20template\x20source\x20is\x20not\x20a\x20directory:\x20','node_modules','isDirectory','content-length','634220hdzXUm','byteLength','trim','parse','basename','join','.rabetbase-create-','chmod','application/zip','mkdtemp','7987020DJlwtC',',\x20received\x20','readdir','Local\x20project\x20template\x20must\x20not\x20contain\x20symlinks:\x20','name','abort','push','readFile','pathname','2687340KLrHMO','downloading','CDN\x20project\x20template\x20checksum\x20verification\x20failed.','CDN\x20project\x20template\x20size\x20mismatch:\x20expected\x20','.rabetbase','realpath','getReader','10WTFpgn','Local\x20project\x20template\x20contains\x20a\x20local-only\x20entry:\x20','Rabetbase\x20CDN\x20config\x20is\x20unavailable.','has','test','protocol','.DS_Store','CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.','Local\x20template\x20source\x20and\x20project\x20output\x20must\x20not\x20overlap.','dev','14SlTpSp','releaseLock','ENOENT','copying','validation','extracting','CDN\x20config\x20contains\x20an\x20invalid\x20descriptor\x20for\x20\x22','mode','number','writeFile','copyFile','753879cnRRoJ','read','get','resolving','toLowerCase','headers','body','arrayBuffer','CDN\x20config\x20does\x20not\x20define\x20template\x20\x22','isFinite','isAbsolute','dirname','access','relative','origin','https:','.env.','package.json','projectTemplate','CDN\x20project\x20template\x20URL\x20must\x20use\x20the\x20trusted\x20HTTPS\x20origin.','sep','href','Local\x20template\x20source\x20does\x20not\x20exist:\x20','Project\x20directory\x20already\x20exists:\x20','ino','message','verifying','startsWith','sha256:','project','length','Use\x20a\x20different\x20project\x20name.','Pass\x20a\x20directory\x20containing\x20the\x20template\x20source\x20package.json.','isSymbolicLink','isSafeInteger','sha256','posix','CDN\x20project\x20template\x20exceeds\x20the\x2020\x20MB\x20download\x20limit.','utf8','mkdir','from','2555LpQECW','resolve','code','.codegraph','26776XmGani','includes','local','.env','Unable\x20to\x20download\x20a\x20valid\x20project\x20template\x20from\x20CDN.','template.zip','object','4742192KHmcOH','lstat','Project\x20template\x20package.json\x20is\x20invalid.','size','.lovrabet.log','Unable\x20to\x20claim\x20the\x20project\x20directory.','version','13223205duetGZ','cancel','dist','.git'];a164_0x37ea=function(){return _0x550d55;};return a164_0x37ea();}async function assertTemplateRoot(_0x4145d3){const _0x5117e1=a164_0x1b8e,_0x54e1b0=a164_0x3d3f9a[_0x5117e1(0x14b)](_0x4145d3,'package.json'),_0xce27cc=JSON[_0x5117e1(0x149)](await a164_0x1f8e99[_0x5117e1(0x157)](_0x54e1b0,_0x5117e1(0x129)));if(!_0xce27cc||typeof _0xce27cc!==_0x5117e1(0x136))throw new Error(_0x5117e1(0x139));}const LOCAL_FORBIDDEN_NAMES=new Set([a164_0x24f6f0(0x166),a164_0x24f6f0(0x12f),a164_0x24f6f0(0x141),'.idea','.lovrabet.json',a164_0x24f6f0(0x13b),a164_0x24f6f0(0x15d),'.rabetbase.json',a164_0x24f6f0(0x140),a164_0x24f6f0(0x143)]);function isForbiddenTemplateEntry(_0x2a8768){const _0x1c76ff=a164_0x24f6f0;if(LOCAL_FORBIDDEN_NAMES[_0x1c76ff(0x163)](_0x2a8768))return!![];return _0x2a8768===_0x1c76ff(0x133)||_0x2a8768[_0x1c76ff(0x11e)](_0x1c76ff(0x113))&&_0x2a8768!=='.env.example';}function containsPath(_0x57d537,_0x9c7cc6){const _0x481c74=a164_0x24f6f0,_0x2ac608=a164_0x3d3f9a[_0x481c74(0x110)](_0x57d537,_0x9c7cc6);return _0x2ac608===''||!_0x2ac608['startsWith']('..'+a164_0x3d3f9a[_0x481c74(0x117)])&&_0x2ac608!=='..'&&!a164_0x3d3f9a[_0x481c74(0x10d)](_0x2ac608);}async function copyLocalTemplateDirectory(_0x5bafe8,_0xe38925){const _0x11aab1=a164_0x24f6f0;await a164_0x1f8e99[_0x11aab1(0x12a)](_0xe38925,{'recursive':!![]});for(const _0x486382 of await a164_0x1f8e99[_0x11aab1(0x152)](_0x5bafe8,{'withFileTypes':!![]})){const _0x1c54fe=a164_0x3d3f9a[_0x11aab1(0x14b)](_0x5bafe8,_0x486382[_0x11aab1(0x154)]),_0x2be9d4=a164_0x3d3f9a['join'](_0xe38925,_0x486382['name']);if(isForbiddenTemplateEntry(_0x486382[_0x11aab1(0x154)]))throw new Error(_0x11aab1(0x161)+_0x1c54fe);const _0x4e1d4d=await a164_0x1f8e99['lstat'](_0x1c54fe);if(_0x4e1d4d[_0x11aab1(0x124)]())throw new Error(_0x11aab1(0x153)+_0x1c54fe);if(_0x4e1d4d[_0x11aab1(0x144)]()){await copyLocalTemplateDirectory(_0x1c54fe,_0x2be9d4);continue;}if(!_0x4e1d4d['isFile']())continue;await a164_0x1f8e99[_0x11aab1(0x174)](_0x1c54fe,_0x2be9d4),await a164_0x1f8e99[_0x11aab1(0x14d)](_0x2be9d4,_0x4e1d4d[_0x11aab1(0x171)]&0x1ff);}}async function readTemplateVersion(_0x1dd560){const _0x488597=a164_0x24f6f0,_0x277cbc=JSON[_0x488597(0x149)](await a164_0x1f8e99[_0x488597(0x157)](a164_0x3d3f9a[_0x488597(0x14b)](_0x1dd560,_0x488597(0x114)),_0x488597(0x129)));return nonEmptyString(_0x277cbc['version'])||'local';}async function readDirectoryIdentity(_0x36db15){const _0x1cb379=a164_0x24f6f0;try{const _0x27cf69=await a164_0x1f8e99[_0x1cb379(0x138)](_0x36db15);if(!_0x27cf69[_0x1cb379(0x144)]())return null;return{'dev':_0x27cf69[_0x1cb379(0x169)],'ino':_0x27cf69[_0x1cb379(0x11b)]};}catch{return null;}}async function commitStagedProject(_0xacef5c,_0x956064){const _0x5303cf=a164_0x24f6f0;await a164_0x1f8e99['mkdir'](_0x956064);const _0x40d979=await readDirectoryIdentity(_0x956064);if(!_0x40d979)throw new Error(_0x5303cf(0x13c));try{for(const _0x430feb of await a164_0x1f8e99['readdir'](_0xacef5c)){await a164_0x1f8e99['rename'](a164_0x3d3f9a[_0x5303cf(0x14b)](_0xacef5c,_0x430feb),a164_0x3d3f9a[_0x5303cf(0x14b)](_0x956064,_0x430feb));}}catch(_0x556f21){const _0x2559f0=await readDirectoryIdentity(_0x956064);_0x2559f0?.[_0x5303cf(0x169)]===_0x40d979[_0x5303cf(0x169)]&&_0x2559f0[_0x5303cf(0x11b)]===_0x40d979[_0x5303cf(0x11b)]&&await a164_0x1f8e99['rm'](_0x956064,{'recursive':!![],'force':!![]});throw _0x556f21;}}export async function materializeProjectTemplate(_0x2bd712,_0x4b0dd1){const _0x43180a=a164_0x24f6f0,_0x4bd7b4=a164_0x3d3f9a[_0x43180a(0x12d)](_0x2bd712),_0x48c462=a164_0x3d3f9a[_0x43180a(0x10e)](_0x4bd7b4);try{await a164_0x1f8e99[_0x43180a(0x138)](_0x4bd7b4);throw new Error('Project\x20directory\x20already\x20exists:\x20'+_0x4bd7b4);}catch(_0x592eb8){if(_0x592eb8['code']!==_0x43180a(0x16c))throw _0x592eb8;}const _0x3f446b=await a164_0x1f8e99[_0x43180a(0x14f)](a164_0x3d3f9a['join'](_0x48c462,_0x43180a(0x14c))),_0x5808ed=a164_0x3d3f9a[_0x43180a(0x14b)](_0x3f446b,_0x43180a(0x120)),_0x4dca5f=a164_0x3d3f9a[_0x43180a(0x14b)](_0x3f446b,_0x43180a(0x135));try{try{_0x4b0dd1?.(_0x43180a(0x178));const _0xf0d5b7=await fetchTemplateDescriptor();return _0x4b0dd1?.(_0x43180a(0x15a)),await downloadArchive(_0xf0d5b7,_0x4dca5f,_0x4b0dd1),_0x4b0dd1?.(_0x43180a(0x16f)),await extractProjectTemplateArchive(_0x4dca5f,_0x5808ed),await assertTemplateRoot(_0x5808ed),await commitStagedProject(_0x5808ed,_0x4bd7b4),{'source':'cdn','version':_0xf0d5b7[_0x43180a(0x13d)]};}catch(_0x14ca85){if(_0x14ca85['code']==='EEXIST')throw CliErrors[_0x43180a(0x16e)](_0x43180a(0x11a)+_0x4bd7b4,_0x43180a(0x122));const _0x22e07b=_0x14ca85 instanceof Error?_0x14ca85['message']:String(_0x14ca85);throw CliErrors[_0x43180a(0x16e)](_0x43180a(0x134),'Check\x20your\x20network\x20and\x20retry.\x20Details:\x20'+_0x22e07b);}}finally{await a164_0x1f8e99['rm'](_0x3f446b,{'recursive':!![],'force':!![]});}}export async function materializeLocalProjectTemplate(_0x2c2f41,_0x169102,_0x2aea2c){const _0x47a55e=a164_0x24f6f0;let _0x30c16a;try{_0x30c16a=await a164_0x1f8e99[_0x47a55e(0x15e)](a164_0x3d3f9a[_0x47a55e(0x12d)](_0x2c2f41));}catch{throw CliErrors[_0x47a55e(0x16e)](_0x47a55e(0x119)+a164_0x3d3f9a['resolve'](_0x2c2f41),_0x47a55e(0x123));}const _0x1ed13a=await a164_0x1f8e99['lstat'](_0x30c16a);if(!_0x1ed13a[_0x47a55e(0x144)]())throw CliErrors['validation'](_0x47a55e(0x142)+_0x30c16a);const _0x185222=a164_0x3d3f9a[_0x47a55e(0x12d)](_0x169102),_0x16939c=await a164_0x1f8e99[_0x47a55e(0x15e)](a164_0x3d3f9a[_0x47a55e(0x10e)](_0x185222)),_0x1f41c1=a164_0x3d3f9a[_0x47a55e(0x14b)](_0x16939c,a164_0x3d3f9a['basename'](_0x185222));if(containsPath(_0x30c16a,_0x1f41c1)||containsPath(_0x1f41c1,_0x30c16a))throw CliErrors[_0x47a55e(0x16e)](_0x47a55e(0x168),'Choose\x20an\x20output\x20directory\x20outside\x20the\x20template\x20source.');try{await a164_0x1f8e99[_0x47a55e(0x138)](_0x1f41c1);throw CliErrors['validation'](_0x47a55e(0x11a)+_0x1f41c1,'Choose\x20a\x20different\x20project\x20name\x20or\x20remove\x20the\x20directory\x20first.');}catch(_0x530c37){if(_0x530c37[_0x47a55e(0x12e)]!==_0x47a55e(0x16c))throw _0x530c37;}const _0x603610=a164_0x3d3f9a[_0x47a55e(0x10e)](_0x1f41c1);await a164_0x1f8e99[_0x47a55e(0x10f)](_0x603610);const _0x332ebc=await a164_0x1f8e99[_0x47a55e(0x14f)](a164_0x3d3f9a[_0x47a55e(0x14b)](_0x603610,_0x47a55e(0x14c))),_0x4a9f42=a164_0x3d3f9a[_0x47a55e(0x14b)](_0x332ebc,_0x47a55e(0x120));try{_0x2aea2c?.(_0x47a55e(0x16d)),await copyLocalTemplateDirectory(_0x30c16a,_0x4a9f42),await assertTemplateRoot(_0x4a9f42);const _0x2d4dcd=await readTemplateVersion(_0x4a9f42);return await commitStagedProject(_0x4a9f42,_0x1f41c1),{'source':_0x47a55e(0x132),'version':_0x2d4dcd};}catch(_0x399100){const _0x4f81ae=_0x399100 instanceof Error?_0x399100[_0x47a55e(0x11c)]:String(_0x399100);throw CliErrors['validation']('Invalid\x20local\x20template\x20source:\x20'+_0x4f81ae,'Check\x20the\x20source\x20directory\x20and\x20retry.');}finally{await a164_0x1f8e99['rm'](_0x332ebc,{'recursive':!![],'force':!![]});}}
|
|
1
|
+
const a169_0x4f2015=a169_0x573b;function a169_0x573b(_0x2d48f8,_0x37f65a){_0x2d48f8=_0x2d48f8-0x12e;const _0x1257ae=a169_0x1257();let _0x573b06=_0x1257ae[_0x2d48f8];return _0x573b06;}(function(_0x5d0163,_0x44135d){const _0x4eac31=a169_0x573b,_0x2095c7=_0x5d0163();while(!![]){try{const _0x488ca1=-parseInt(_0x4eac31(0x187))/0x1*(parseInt(_0x4eac31(0x175))/0x2)+-parseInt(_0x4eac31(0x185))/0x3*(parseInt(_0x4eac31(0x19c))/0x4)+parseInt(_0x4eac31(0x196))/0x5+-parseInt(_0x4eac31(0x165))/0x6+parseInt(_0x4eac31(0x130))/0x7*(parseInt(_0x4eac31(0x166))/0x8)+-parseInt(_0x4eac31(0x149))/0x9+parseInt(_0x4eac31(0x191))/0xa*(parseInt(_0x4eac31(0x182))/0xb);if(_0x488ca1===_0x44135d)break;else _0x2095c7['push'](_0x2095c7['shift']());}catch(_0x562ecb){_0x2095c7['push'](_0x2095c7['shift']());}}}(a169_0x1257,0x4b0df));import{createHash}from'node:crypto';import a169_0x4a9297 from'node:fs/promises';import a169_0x504e74 from'node:path';import{PROJECT_TEMPLATE_ASSET_BASE_URL}from'../../../constant/cdn.js';import{extractProjectTemplateArchive}from'../../../commands/project/create/project-template-archive.js';import{getRabetbaseCdnConfig}from'../../../utils/cli-version-policy.js';import{CliErrors}from'../../../errors.js';const TEMPLATE_ID='sub-app-react-demo',ARCHIVE_TIMEOUT_MS=0x3a98,MAX_ARCHIVE_SIZE=0x14*0x400*0x400;function nonEmptyString(_0x35c14b){const _0x19eaaf=a169_0x573b;return typeof _0x35c14b==='string'&&_0x35c14b[_0x19eaaf(0x180)]()?_0x35c14b[_0x19eaaf(0x180)]():null;}function parseDescriptor(_0x47db3a){const _0xa4576f=a169_0x573b;if(!_0x47db3a||typeof _0x47db3a!==_0xa4576f(0x132))throw new Error(_0xa4576f(0x140)+TEMPLATE_ID+'\x22.');const _0x423db7=_0x47db3a,_0x28b6f3=nonEmptyString(_0x423db7[_0xa4576f(0x14e)]),_0x427027=nonEmptyString(_0x423db7['name']),_0x12416f=nonEmptyString(_0x423db7[_0xa4576f(0x194)])?.[_0xa4576f(0x133)](),_0xcb3016=_0x423db7[_0xa4576f(0x193)];if(!_0x28b6f3||!_0x427027||_0x427027!==a169_0x504e74['posix'][_0xa4576f(0x136)](_0x427027)||_0x427027['includes']('\x5c')||!_0x12416f||!/^sha256:[a-f0-9]{64}$/[_0xa4576f(0x172)](_0x12416f)||typeof _0xcb3016!==_0xa4576f(0x168)||!Number[_0xa4576f(0x134)](_0xcb3016)||_0xcb3016<=0x0||_0xcb3016>MAX_ARCHIVE_SIZE)throw new Error(_0xa4576f(0x19f)+TEMPLATE_ID+'\x22.');return{'version':_0x28b6f3,'name':_0x427027,'sha256':_0x12416f,'size':_0xcb3016};}async function fetchWithTimeout(_0x69d14c,_0xb059c2,_0x5c75c7,_0x1860d5){const _0x19155c=a169_0x573b,_0x1d55fb=new AbortController(),_0x5952e7=setTimeout(()=>_0x1d55fb[_0x19155c(0x171)](),_0xb059c2);try{const _0x771097=await fetch(_0x69d14c,{'headers':{'Accept':_0x5c75c7},'signal':_0x1d55fb['signal']});return await _0x1860d5(_0x771097);}finally{clearTimeout(_0x5952e7);}}async function fetchTemplateDescriptor(){const _0x2d16f2=a169_0x573b,_0x50782a=await getRabetbaseCdnConfig();if(!_0x50782a)throw new Error(_0x2d16f2(0x190));return parseDescriptor(_0x50782a['projectTemplate']);}function resolveArchiveUrl(_0x20503f){const _0x3f7369=a169_0x573b,_0x29bdc0=new URL(PROJECT_TEMPLATE_ASSET_BASE_URL+'/'),_0x1f44e1=new URL(_0x20503f,_0x29bdc0);if(_0x1f44e1[_0x3f7369(0x167)]!==_0x3f7369(0x18a)||_0x1f44e1['origin']!==_0x29bdc0[_0x3f7369(0x13b)]||!_0x1f44e1[_0x3f7369(0x146)][_0x3f7369(0x16b)](_0x29bdc0[_0x3f7369(0x146)]))throw new Error(_0x3f7369(0x176));return _0x1f44e1['href'];}async function readResponseBytes(_0x1c7d23,_0x3f143e){const _0x2262a7=a169_0x573b;if(!_0x1c7d23[_0x2262a7(0x145)]){const _0x131d1e=Buffer[_0x2262a7(0x14f)](await _0x1c7d23[_0x2262a7(0x184)]());if(_0x131d1e[_0x2262a7(0x163)]>_0x3f143e)throw new Error(_0x2262a7(0x15a));return _0x131d1e;}const _0x482216=_0x1c7d23[_0x2262a7(0x145)]['getReader'](),_0x4e80c0=[];let _0x1bc163=0x0;try{while(!![]){const {done:_0x3b8eba,value:_0x3dab1c}=await _0x482216[_0x2262a7(0x199)]();if(_0x3b8eba)break;_0x1bc163+=_0x3dab1c['byteLength'];if(_0x1bc163>_0x3f143e){await _0x482216[_0x2262a7(0x16d)]();throw new Error('CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.');}_0x4e80c0['push'](Buffer[_0x2262a7(0x14f)](_0x3dab1c));}}finally{_0x482216[_0x2262a7(0x13e)]();}return Buffer[_0x2262a7(0x18f)](_0x4e80c0,_0x1bc163);}async function downloadArchive(_0x369e42,_0xfda001,_0x45e281){const _0x183b0c=a169_0x573b,_0x5ae3d1=await fetchWithTimeout(resolveArchiveUrl(_0x369e42[_0x183b0c(0x139)]),ARCHIVE_TIMEOUT_MS,_0x183b0c(0x17c),async _0x4a5e87=>{const _0x2bb508=_0x183b0c;if(!_0x4a5e87['ok'])throw new Error(_0x2bb508(0x143)+_0x4a5e87[_0x2bb508(0x16f)]+'.');const _0x297811=Number(_0x4a5e87[_0x2bb508(0x150)]['get'](_0x2bb508(0x153)));if(Number['isFinite'](_0x297811)&&_0x297811>MAX_ARCHIVE_SIZE)throw new Error('CDN\x20project\x20template\x20exceeds\x20the\x2020\x20MB\x20download\x20limit.');return readResponseBytes(_0x4a5e87,_0x369e42[_0x2bb508(0x193)]);});if(_0x5ae3d1[_0x183b0c(0x163)]!==_0x369e42[_0x183b0c(0x193)])throw new Error(_0x183b0c(0x162)+_0x369e42[_0x183b0c(0x193)]+_0x183b0c(0x16e)+_0x5ae3d1[_0x183b0c(0x163)]+'.');_0x45e281?.(_0x183b0c(0x17a));const _0x1c850b=_0x183b0c(0x131)+createHash(_0x183b0c(0x194))[_0x183b0c(0x14b)](_0x5ae3d1)['digest'](_0x183b0c(0x197));if(_0x1c850b!==_0x369e42['sha256'])throw new Error(_0x183b0c(0x189));await a169_0x4a9297[_0x183b0c(0x19e)](_0xfda001,_0x5ae3d1,{'flag':'wx'});}function a169_0x1257(){const _0x36f2db=['CDN\x20project\x20template\x20URL\x20must\x20use\x20the\x20trusted\x20HTTPS\x20origin.','ENOENT','validation','resolve','verifying','.codegraph','application/zip','Local\x20template\x20source\x20and\x20project\x20output\x20must\x20not\x20overlap.','sep','resolving','trim','.rabetbase-create-','414711DPihpY','join','arrayBuffer','7284LKqWOB','isSymbolicLink','159KfZvVJ','.git','CDN\x20project\x20template\x20checksum\x20verification\x20failed.','https:','Check\x20the\x20source\x20directory\x20and\x20retry.','code','copyFile','Unable\x20to\x20download\x20a\x20valid\x20project\x20template\x20from\x20CDN.','concat','Rabetbase\x20CDN\x20config\x20is\x20unavailable.','110WMBRtn','Choose\x20an\x20output\x20directory\x20outside\x20the\x20template\x20source.','size','sha256','chmod','1431955XALXAi','hex','Unable\x20to\x20claim\x20the\x20project\x20directory.','read','Project\x20template\x20package.json\x20is\x20invalid.','ino','4zksqlC','EEXIST','writeFile','CDN\x20config\x20contains\x20an\x20invalid\x20descriptor\x20for\x20\x22','template.zip','project','276612zhAQbd','sha256:','object','toLowerCase','isSafeInteger','readFile','basename','.env.','dirname','name','lstat','origin','local','.lovrabet.log','releaseLock','parse','CDN\x20config\x20does\x20not\x20define\x20template\x20\x22','cdn','isDirectory','CDN\x20project\x20template\x20request\x20failed\x20with\x20HTTP\x20','readdir','body','pathname','.DS_Store','rename','581292VXDBad','isFile','update','relative','message','version','from','headers','isAbsolute','.lovrabet.json','content-length','dist','Project\x20directory\x20already\x20exists:\x20','Pass\x20a\x20directory\x20containing\x20the\x20template\x20source\x20package.json.','Local\x20template\x20source\x20does\x20not\x20exist:\x20','.idea','.env','CDN\x20project\x20template\x20exceeds\x20its\x20declared\x20download\x20size.','mkdtemp','realpath','.rabetbase','.env.example','Local\x20project\x20template\x20must\x20not\x20contain\x20symlinks:\x20','downloading','Invalid\x20local\x20template\x20source:\x20','CDN\x20project\x20template\x20size\x20mismatch:\x20expected\x20','length','utf8','1801380tzrKUB','72WEBTnh','protocol','number','Choose\x20a\x20different\x20project\x20name\x20or\x20remove\x20the\x20directory\x20first.','package.json','startsWith','dev','cancel',',\x20received\x20','status','Check\x20your\x20network\x20and\x20retry.\x20Details:\x20','abort','test','extracting','has','4806IKWndU'];a169_0x1257=function(){return _0x36f2db;};return a169_0x1257();}async function assertTemplateRoot(_0x13a2d5){const _0x2475db=a169_0x573b,_0x4a4aae=a169_0x504e74[_0x2475db(0x183)](_0x13a2d5,_0x2475db(0x16a)),_0x27f2d3=JSON[_0x2475db(0x13f)](await a169_0x4a9297[_0x2475db(0x135)](_0x4a4aae,_0x2475db(0x164)));if(!_0x27f2d3||typeof _0x27f2d3!==_0x2475db(0x132))throw new Error(_0x2475db(0x19a));}const LOCAL_FORBIDDEN_NAMES=new Set([a169_0x4f2015(0x147),a169_0x4f2015(0x17b),a169_0x4f2015(0x188),a169_0x4f2015(0x158),a169_0x4f2015(0x152),a169_0x4f2015(0x13d),a169_0x4f2015(0x15d),'.rabetbase.json',a169_0x4f2015(0x154),'node_modules']);function isForbiddenTemplateEntry(_0x50f31b){const _0xe06542=a169_0x4f2015;if(LOCAL_FORBIDDEN_NAMES[_0xe06542(0x174)](_0x50f31b))return!![];return _0x50f31b===_0xe06542(0x159)||_0x50f31b['startsWith'](_0xe06542(0x137))&&_0x50f31b!==_0xe06542(0x15e);}function containsPath(_0x5b4225,_0x256d06){const _0x134266=a169_0x4f2015,_0x3a8509=a169_0x504e74[_0x134266(0x14c)](_0x5b4225,_0x256d06);return _0x3a8509===''||!_0x3a8509[_0x134266(0x16b)]('..'+a169_0x504e74[_0x134266(0x17e)])&&_0x3a8509!=='..'&&!a169_0x504e74[_0x134266(0x151)](_0x3a8509);}async function copyLocalTemplateDirectory(_0x228b58,_0x50dc6a){const _0x1dc48f=a169_0x4f2015;await a169_0x4a9297['mkdir'](_0x50dc6a,{'recursive':!![]});for(const _0x369064 of await a169_0x4a9297[_0x1dc48f(0x144)](_0x228b58,{'withFileTypes':!![]})){const _0x476daa=a169_0x504e74[_0x1dc48f(0x183)](_0x228b58,_0x369064[_0x1dc48f(0x139)]),_0x7a79bd=a169_0x504e74['join'](_0x50dc6a,_0x369064[_0x1dc48f(0x139)]);if(isForbiddenTemplateEntry(_0x369064[_0x1dc48f(0x139)]))throw new Error('Local\x20project\x20template\x20contains\x20a\x20local-only\x20entry:\x20'+_0x476daa);const _0x490864=await a169_0x4a9297['lstat'](_0x476daa);if(_0x490864[_0x1dc48f(0x186)]())throw new Error(_0x1dc48f(0x15f)+_0x476daa);if(_0x490864[_0x1dc48f(0x142)]()){await copyLocalTemplateDirectory(_0x476daa,_0x7a79bd);continue;}if(!_0x490864[_0x1dc48f(0x14a)]())continue;await a169_0x4a9297[_0x1dc48f(0x18d)](_0x476daa,_0x7a79bd),await a169_0x4a9297[_0x1dc48f(0x195)](_0x7a79bd,_0x490864['mode']&0x1ff);}}async function readTemplateVersion(_0x172700){const _0x82032a=a169_0x4f2015,_0x25ff6f=JSON[_0x82032a(0x13f)](await a169_0x4a9297[_0x82032a(0x135)](a169_0x504e74[_0x82032a(0x183)](_0x172700,_0x82032a(0x16a)),'utf8'));return nonEmptyString(_0x25ff6f[_0x82032a(0x14e)])||'local';}async function readDirectoryIdentity(_0x1e121a){const _0x1af6e1=a169_0x4f2015;try{const _0x33bddc=await a169_0x4a9297[_0x1af6e1(0x13a)](_0x1e121a);if(!_0x33bddc[_0x1af6e1(0x142)]())return null;return{'dev':_0x33bddc['dev'],'ino':_0x33bddc[_0x1af6e1(0x19b)]};}catch{return null;}}async function commitStagedProject(_0xc83e78,_0x289e9f){const _0x70e66a=a169_0x4f2015;await a169_0x4a9297['mkdir'](_0x289e9f);const _0x4727b4=await readDirectoryIdentity(_0x289e9f);if(!_0x4727b4)throw new Error(_0x70e66a(0x198));try{for(const _0x5a4592 of await a169_0x4a9297[_0x70e66a(0x144)](_0xc83e78)){await a169_0x4a9297[_0x70e66a(0x148)](a169_0x504e74[_0x70e66a(0x183)](_0xc83e78,_0x5a4592),a169_0x504e74[_0x70e66a(0x183)](_0x289e9f,_0x5a4592));}}catch(_0x1ec99d){const _0x3af55e=await readDirectoryIdentity(_0x289e9f);_0x3af55e?.[_0x70e66a(0x16c)]===_0x4727b4[_0x70e66a(0x16c)]&&_0x3af55e[_0x70e66a(0x19b)]===_0x4727b4[_0x70e66a(0x19b)]&&await a169_0x4a9297['rm'](_0x289e9f,{'recursive':!![],'force':!![]});throw _0x1ec99d;}}export async function materializeProjectTemplate(_0x348270,_0x2d6a02){const _0x2d071a=a169_0x4f2015,_0x1a7564=a169_0x504e74[_0x2d071a(0x179)](_0x348270),_0x109bee=a169_0x504e74['dirname'](_0x1a7564);try{await a169_0x4a9297[_0x2d071a(0x13a)](_0x1a7564);throw new Error(_0x2d071a(0x155)+_0x1a7564);}catch(_0xd41c71){if(_0xd41c71[_0x2d071a(0x18c)]!==_0x2d071a(0x177))throw _0xd41c71;}const _0x532693=await a169_0x4a9297[_0x2d071a(0x15b)](a169_0x504e74[_0x2d071a(0x183)](_0x109bee,_0x2d071a(0x181))),_0x179fb3=a169_0x504e74[_0x2d071a(0x183)](_0x532693,_0x2d071a(0x12f)),_0x4512b4=a169_0x504e74[_0x2d071a(0x183)](_0x532693,_0x2d071a(0x12e));try{try{_0x2d6a02?.(_0x2d071a(0x17f));const _0x25afc2=await fetchTemplateDescriptor();return _0x2d6a02?.(_0x2d071a(0x160)),await downloadArchive(_0x25afc2,_0x4512b4,_0x2d6a02),_0x2d6a02?.(_0x2d071a(0x173)),await extractProjectTemplateArchive(_0x4512b4,_0x179fb3),await assertTemplateRoot(_0x179fb3),await commitStagedProject(_0x179fb3,_0x1a7564),{'source':_0x2d071a(0x141),'version':_0x25afc2[_0x2d071a(0x14e)]};}catch(_0xc57fa0){if(_0xc57fa0[_0x2d071a(0x18c)]===_0x2d071a(0x19d))throw CliErrors['validation'](_0x2d071a(0x155)+_0x1a7564,'Use\x20a\x20different\x20project\x20name.');const _0xf8236d=_0xc57fa0 instanceof Error?_0xc57fa0[_0x2d071a(0x14d)]:String(_0xc57fa0);throw CliErrors[_0x2d071a(0x178)](_0x2d071a(0x18e),_0x2d071a(0x170)+_0xf8236d);}}finally{await a169_0x4a9297['rm'](_0x532693,{'recursive':!![],'force':!![]});}}export async function materializeLocalProjectTemplate(_0x21ad4c,_0x5d364a,_0x246062){const _0x466d06=a169_0x4f2015;let _0x190244;try{_0x190244=await a169_0x4a9297[_0x466d06(0x15c)](a169_0x504e74[_0x466d06(0x179)](_0x21ad4c));}catch{throw CliErrors[_0x466d06(0x178)](_0x466d06(0x157)+a169_0x504e74[_0x466d06(0x179)](_0x21ad4c),_0x466d06(0x156));}const _0xed5c97=await a169_0x4a9297[_0x466d06(0x13a)](_0x190244);if(!_0xed5c97[_0x466d06(0x142)]())throw CliErrors[_0x466d06(0x178)]('Local\x20template\x20source\x20is\x20not\x20a\x20directory:\x20'+_0x190244);const _0x56a36f=a169_0x504e74[_0x466d06(0x179)](_0x5d364a),_0x18cc82=await a169_0x4a9297[_0x466d06(0x15c)](a169_0x504e74['dirname'](_0x56a36f)),_0x433428=a169_0x504e74[_0x466d06(0x183)](_0x18cc82,a169_0x504e74[_0x466d06(0x136)](_0x56a36f));if(containsPath(_0x190244,_0x433428)||containsPath(_0x433428,_0x190244))throw CliErrors['validation'](_0x466d06(0x17d),_0x466d06(0x192));try{await a169_0x4a9297[_0x466d06(0x13a)](_0x433428);throw CliErrors[_0x466d06(0x178)]('Project\x20directory\x20already\x20exists:\x20'+_0x433428,_0x466d06(0x169));}catch(_0x315021){if(_0x315021[_0x466d06(0x18c)]!==_0x466d06(0x177))throw _0x315021;}const _0x5a5bc6=a169_0x504e74[_0x466d06(0x138)](_0x433428);await a169_0x4a9297['access'](_0x5a5bc6);const _0x54ad38=await a169_0x4a9297[_0x466d06(0x15b)](a169_0x504e74['join'](_0x5a5bc6,_0x466d06(0x181))),_0x105ec2=a169_0x504e74[_0x466d06(0x183)](_0x54ad38,_0x466d06(0x12f));try{_0x246062?.('copying'),await copyLocalTemplateDirectory(_0x190244,_0x105ec2),await assertTemplateRoot(_0x105ec2);const _0x36cb82=await readTemplateVersion(_0x105ec2);return await commitStagedProject(_0x105ec2,_0x433428),{'source':_0x466d06(0x13c),'version':_0x36cb82};}catch(_0x2d2678){const _0x56cbd7=_0x2d2678 instanceof Error?_0x2d2678['message']:String(_0x2d2678);throw CliErrors[_0x466d06(0x178)](_0x466d06(0x161)+_0x56cbd7,_0x466d06(0x18b));}finally{await a169_0x4a9297['rm'](_0x54ad38,{'recursive':!![],'force':!![]});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2ef536,_0x5e32a7){const _0x2101e9=a170_0x5ae2,_0x28c2b3=_0x2ef536();while(!![]){try{const _0x220321=parseInt(_0x2101e9(0xf0))/0x1*(parseInt(_0x2101e9(0xe8))/0x2)+-parseInt(_0x2101e9(0xee))/0x3*(-parseInt(_0x2101e9(0xdf))/0x4)+-parseInt(_0x2101e9(0xe3))/0x5*(parseInt(_0x2101e9(0xe5))/0x6)+parseInt(_0x2101e9(0xf1))/0x7+parseInt(_0x2101e9(0xde))/0x8*(parseInt(_0x2101e9(0xe7))/0x9)+parseInt(_0x2101e9(0xdd))/0xa*(parseInt(_0x2101e9(0xe4))/0xb)+-parseInt(_0x2101e9(0xea))/0xc*(parseInt(_0x2101e9(0xe6))/0xd);if(_0x220321===_0x5e32a7)break;else _0x28c2b3['push'](_0x28c2b3['shift']());}catch(_0x860afe){_0x28c2b3['push'](_0x28c2b3['shift']());}}}(a170_0x4620,0x1e596));import{CliErrors}from'../../../errors.js';function a170_0x4620(){const _0x51397c=['\x20characters','41cQOOXc','875406gsyiPu','604250qdHwUj','88MGfYZh','16ykqkJI','Project\x20name\x20\x22','Project\x20name\x20cannot\x20exceed\x20','Project\x20name\x20cannot\x20be\x20empty','70Qldxix','44UhxQtx','13350irMuFp','2483MpwtlS','97731uFbwGK','6810pceKZu','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','44448LclGHX','trim','Use\x20a\x20portable\x20directory\x20name\x20without\x20path\x20separators.','\x22\x20is\x20reserved\x20on\x20Windows','177834WqrxiG'];a170_0x4620=function(){return _0x51397c;};return a170_0x4620();}const PROJECT_NAME_PATTERN=/^[A-Za-z0-9][A-Za-z0-9_-]*$/,WINDOWS_RESERVED_NAME=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])$/i,MAX_PROJECT_NAME_LENGTH=0x64;export function getProjectNameValidationError(_0x5e42d0){const _0x3d63af=a170_0x5ae2,_0x44696b=_0x5e42d0[_0x3d63af(0xeb)]();if(!_0x44696b)return _0x3d63af(0xe2);if(_0x44696b['length']>MAX_PROJECT_NAME_LENGTH)return _0x3d63af(0xe1)+MAX_PROJECT_NAME_LENGTH+_0x3d63af(0xef);if(!PROJECT_NAME_PATTERN['test'](_0x44696b))return _0x3d63af(0xe9);if(WINDOWS_RESERVED_NAME['test'](_0x44696b))return _0x3d63af(0xe0)+_0x44696b+_0x3d63af(0xed);return null;}function a170_0x5ae2(_0x1a9526,_0x5eef76){_0x1a9526=_0x1a9526-0xdd;const _0x4620c9=a170_0x4620();let _0x5ae2f4=_0x4620c9[_0x1a9526];return _0x5ae2f4;}export function validateProjectName(_0x3e0b1e){const _0x316eca=a170_0x5ae2,_0x411cfd=_0x3e0b1e['trim'](),_0xfe53bc=getProjectNameValidationError(_0x411cfd);if(_0xfe53bc)throw CliErrors['validation'](_0xfe53bc,_0x316eca(0xec));return _0x411cfd;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
(function(_0x4e06c3,_0x27d9d8){const _0x1cdda5=a171_0x4d81,_0xbf066=_0x4e06c3();while(!![]){try{const _0xa3b27b=parseInt(_0x1cdda5(0x19b))/0x1+-parseInt(_0x1cdda5(0x1b1))/0x2+parseInt(_0x1cdda5(0x193))/0x3*(parseInt(_0x1cdda5(0x1b6))/0x4)+-parseInt(_0x1cdda5(0x1af))/0x5+parseInt(_0x1cdda5(0x1b0))/0x6*(-parseInt(_0x1cdda5(0x192))/0x7)+-parseInt(_0x1cdda5(0x1b3))/0x8+parseInt(_0x1cdda5(0x1a1))/0x9*(parseInt(_0x1cdda5(0x1aa))/0xa);if(_0xa3b27b===_0x27d9d8)break;else _0xbf066['push'](_0xbf066['shift']());}catch(_0x47b8c5){_0xbf066['push'](_0xbf066['shift']());}}}(a171_0x4a9e,0xcfa9b));import{createWriteStream}from'node:fs';function a171_0x4a9e(){const _0x5f315a=['toLocaleLowerCase','openReadStream','endsWith','startsWith','uncompressedSize','fileName','1435958TcHzuU','Unable\x20to\x20open\x20project\x20template\x20archive.','once','test','add','Project\x20template\x20ZIP\x20exceeds\x20','6816006UXxNvs','mkdir','Symbolic\x20links\x20are\x20not\x20allowed\x20in\x20project\x20templates:\x20','Unable\x20to\x20read\x20ZIP\x20entry:\x20','open','split','resolve','entry','readEntry','50ipZdae','sep','error','en-US','isEncrypted','6172335cnutXW','112740fcbOta','2260980DZwWKD','Duplicate\x20or\x20case-conflicting\x20ZIP\x20entry:\x20','12700296SbShUm','length','dirname','68QWoPKi','Unsafe\x20or\x20non-portable\x20ZIP\x20entry\x20path:\x20','Unsafe\x20absolute\x20ZIP\x20entry\x20path:\x20','slice','Encrypted\x20ZIP\x20entries\x20are\x20not\x20supported:\x20','externalFileAttributes','join','553fBhYXo','187917SNfSnR','Project\x20template\x20ZIP\x20expands\x20beyond\x20the\x2050\x20MB\x20safety\x20limit.'];a171_0x4a9e=function(){return _0x5f315a;};return a171_0x4a9e();}import a171_0x531141 from'node:fs/promises';import a171_0x205fa1 from'node:path';import{pipeline}from'node:stream/promises';import a171_0x2ef305 from'yauzl';const MAX_ENTRY_COUNT=0x7d0,MAX_UNCOMPRESSED_SIZE=0x32*0x400*0x400,WINDOWS_RESERVED_NAME=/^(con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\..*)?$/i,WINDOWS_INVALID_CHAR=/[<>:"|?*\x00-\x1f]/;function openZip(_0x4c97dc){return new Promise((_0x2f9598,_0x318992)=>{const _0x3e0f3f=a171_0x4d81;a171_0x2ef305[_0x3e0f3f(0x1a5)](_0x4c97dc,{'lazyEntries':!![],'decodeStrings':!![],'strictFileNames':!![],'validateEntrySizes':!![]},(_0x2fd9a2,_0x5930f9)=>{const _0x5c1250=_0x3e0f3f;if(_0x2fd9a2||!_0x5930f9){_0x318992(_0x2fd9a2||new Error(_0x5c1250(0x19c)));return;}_0x2f9598(_0x5930f9);});});}function a171_0x4d81(_0x5aca8f,_0x316784){_0x5aca8f=_0x5aca8f-0x18c;const _0x4a9e2a=a171_0x4a9e();let _0x4d81cd=_0x4a9e2a[_0x5aca8f];return _0x4d81cd;}function openEntryStream(_0x3d87f6,_0x59927e){return new Promise((_0x44f4d0,_0x1872de)=>{const _0x491eb3=a171_0x4d81;_0x3d87f6[_0x491eb3(0x196)](_0x59927e,(_0x32f263,_0x99b4e1)=>{const _0x2bb6ba=_0x491eb3;if(_0x32f263||!_0x99b4e1){_0x1872de(_0x32f263||new Error(_0x2bb6ba(0x1a4)+_0x59927e[_0x2bb6ba(0x19a)]));return;}_0x44f4d0(_0x99b4e1);});});}function validateEntryPath(_0x596654){const _0xd057fc=a171_0x4d81,_0x193d17=_0x596654['replace'](/\\/g,'/'),_0x1ee077=_0x193d17[_0xd057fc(0x197)]('/'),_0x286dd3=_0x1ee077?_0x193d17[_0xd057fc(0x18e)](0x0,-0x1):_0x193d17;if(!_0x286dd3||_0x193d17[_0xd057fc(0x198)]('/')||/^[A-Za-z]:\//[_0xd057fc(0x19e)](_0x193d17))throw new Error(_0xd057fc(0x18d)+_0x596654);const _0x1bfe93=_0x286dd3['split']('/');for(const _0x66dc3b of _0x1bfe93){if(!_0x66dc3b||_0x66dc3b==='.'||_0x66dc3b==='..'||_0x66dc3b['endsWith']('.')||_0x66dc3b[_0xd057fc(0x197)]('\x20')||WINDOWS_INVALID_CHAR[_0xd057fc(0x19e)](_0x66dc3b)||WINDOWS_RESERVED_NAME[_0xd057fc(0x19e)](_0x66dc3b))throw new Error(_0xd057fc(0x18c)+_0x596654);}return{'relativePath':_0x1bfe93[_0xd057fc(0x191)](a171_0x205fa1['sep']),'directory':_0x1ee077};}function isSymbolicLink(_0x1be8c9){const _0x33e0f9=a171_0x4d81,_0x5591d7=_0x1be8c9[_0x33e0f9(0x190)]>>>0x10&0xffff;return(_0x5591d7&0xf000)===0xa000;}export async function extractProjectTemplateArchive(_0x35478e,_0x3ed457){const _0x3a43d1=a171_0x4d81,_0x2e0159=await openZip(_0x35478e),_0x1c57e9=a171_0x205fa1[_0x3a43d1(0x1a7)](_0x3ed457),_0xaa3856=new Set(),_0x4659bf=new Map();let _0x3f75a1=0x0,_0x478b48=0x0;await a171_0x531141[_0x3a43d1(0x1a2)](_0x1c57e9,{'recursive':!![]}),await new Promise((_0x9a4ad4,_0x1121ec)=>{const _0x3e563e=_0x3a43d1;let _0x345ad3=![];const _0x4aab27=_0x4d3570=>{if(_0x345ad3)return;_0x345ad3=!![],_0x2e0159['close'](),_0x1121ec(_0x4d3570 instanceof Error?_0x4d3570:new Error(String(_0x4d3570)));};_0x2e0159[_0x3e563e(0x19d)](_0x3e563e(0x1ac),_0x4aab27),_0x2e0159['once']('end',()=>{if(_0x345ad3)return;_0x345ad3=!![],_0x9a4ad4();}),_0x2e0159['on'](_0x3e563e(0x1a8),_0x2ff9dc=>{void(async()=>{const _0x15e884=a171_0x4d81;_0x3f75a1+=0x1,_0x478b48+=_0x2ff9dc[_0x15e884(0x199)];if(_0x3f75a1>MAX_ENTRY_COUNT)throw new Error(_0x15e884(0x1a0)+MAX_ENTRY_COUNT+'\x20entries.');if(_0x478b48>MAX_UNCOMPRESSED_SIZE)throw new Error(_0x15e884(0x194));if(_0x2ff9dc[_0x15e884(0x1ae)]())throw new Error(_0x15e884(0x18f)+_0x2ff9dc[_0x15e884(0x19a)]);if(isSymbolicLink(_0x2ff9dc))throw new Error(_0x15e884(0x1a3)+_0x2ff9dc[_0x15e884(0x19a)]);const {relativePath:_0x2ae76d,directory:_0x4fbdae}=validateEntryPath(_0x2ff9dc[_0x15e884(0x19a)]),_0x291ce6=_0x2ae76d[_0x15e884(0x1a6)](a171_0x205fa1[_0x15e884(0x1ab)]);for(let _0x58987a=0x1;_0x58987a<=_0x291ce6[_0x15e884(0x1b4)];_0x58987a+=0x1){const _0x50316d=_0x291ce6[_0x15e884(0x18e)](0x0,_0x58987a)['join'](a171_0x205fa1['sep']),_0x524981=_0x50316d['toLocaleLowerCase']('en-US'),_0x52ee9e=_0x4659bf['get'](_0x524981);if(_0x52ee9e&&_0x52ee9e!==_0x50316d)throw new Error('Case-conflicting\x20ZIP\x20entry\x20path:\x20'+_0x2ff9dc['fileName']);_0x4659bf['set'](_0x524981,_0x50316d);}const _0x15fd39=_0x2ae76d[_0x15e884(0x195)](_0x15e884(0x1ad));if(_0xaa3856['has'](_0x15fd39))throw new Error(_0x15e884(0x1b2)+_0x2ff9dc['fileName']);_0xaa3856[_0x15e884(0x19f)](_0x15fd39);const _0x3339ce=a171_0x205fa1[_0x15e884(0x1a7)](_0x1c57e9,_0x2ae76d);if(_0x3339ce!==_0x1c57e9&&!_0x3339ce[_0x15e884(0x198)](''+_0x1c57e9+a171_0x205fa1[_0x15e884(0x1ab)]))throw new Error('ZIP\x20entry\x20escapes\x20the\x20destination\x20directory:\x20'+_0x2ff9dc[_0x15e884(0x19a)]);if(_0x4fbdae)await a171_0x531141[_0x15e884(0x1a2)](_0x3339ce,{'recursive':!![]});else{await a171_0x531141[_0x15e884(0x1a2)](a171_0x205fa1[_0x15e884(0x1b5)](_0x3339ce),{'recursive':!![]});const _0x509207=await openEntryStream(_0x2e0159,_0x2ff9dc);await pipeline(_0x509207,createWriteStream(_0x3339ce,{'flags':'wx','mode':0x1a4}));}_0x2e0159[_0x15e884(0x1a9)]();})()['catch'](_0x4aab27);}),_0x2e0159[_0x3e563e(0x1a9)]();});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a172_0xf06ca0=a172_0xd775;(function(_0xdb878,_0x10659f){const _0x2c5aa=a172_0xd775,_0x41eb8b=_0xdb878();while(!![]){try{const _0x4b61c4=-parseInt(_0x2c5aa(0x19d))/0x1+-parseInt(_0x2c5aa(0x1a8))/0x2*(parseInt(_0x2c5aa(0x1a7))/0x3)+-parseInt(_0x2c5aa(0x1a9))/0x4+-parseInt(_0x2c5aa(0x1a2))/0x5*(parseInt(_0x2c5aa(0x1a5))/0x6)+parseInt(_0x2c5aa(0x1a1))/0x7*(-parseInt(_0x2c5aa(0x1a4))/0x8)+-parseInt(_0x2c5aa(0x1a6))/0x9*(parseInt(_0x2c5aa(0x1a0))/0xa)+parseInt(_0x2c5aa(0x19f))/0xb;if(_0x4b61c4===_0x10659f)break;else _0x41eb8b['push'](_0x41eb8b['shift']());}catch(_0x5b2f03){_0x41eb8b['push'](_0x41eb8b['shift']());}}}(a172_0x5dd0,0xca0a9));function a172_0x5dd0(){const _0x2d0669=['1870862FehHVB','20725KrKnTH','dirname','40GsAFGh','210iujfld','10514394ULwHNC','431562ZApbbW','14TRTboo','2198912UeOfdL','../../../../','132054JonizG','resolve','56825912ttUOqO','10wJCOFP'];a172_0x5dd0=function(){return _0x2d0669;};return a172_0x5dd0();}import a172_0x10ca42 from'node:path';function a172_0xd775(_0x43f9c2,_0x260612){_0x43f9c2=_0x43f9c2-0x19c;const _0x5dd09a=a172_0x5dd0();let _0xd77545=_0x5dd09a[_0x43f9c2];return _0xd77545;}import{fileURLToPath}from'node:url';const __dirname=a172_0x10ca42[a172_0xf06ca0(0x1a3)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x43ab01=a172_0xf06ca0;return a172_0x10ca42[_0x43ab01(0x19e)](__dirname,_0x43ab01(0x19c));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x4c093d,_0x465e75){const _0x41eaa0=a173_0x5898,_0x4d0cfc=_0x4c093d();while(!![]){try{const _0x39cedb=parseInt(_0x41eaa0(0x1b7))/0x1*(parseInt(_0x41eaa0(0x1b4))/0x2)+parseInt(_0x41eaa0(0x1b0))/0x3*(-parseInt(_0x41eaa0(0x1b3))/0x4)+parseInt(_0x41eaa0(0x1a8))/0x5+-parseInt(_0x41eaa0(0x1aa))/0x6+-parseInt(_0x41eaa0(0x1a6))/0x7*(-parseInt(_0x41eaa0(0x1b9))/0x8)+-parseInt(_0x41eaa0(0x1b8))/0x9+parseInt(_0x41eaa0(0x1b5))/0xa;if(_0x39cedb===_0x465e75)break;else _0x4d0cfc['push'](_0x4d0cfc['shift']());}catch(_0x518832){_0x4d0cfc['push'](_0x4d0cfc['shift']());}}}(a173_0xcebd,0x7a456));import a173_0x5d63c1 from'node:path';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a173_0x5898(_0x3031f4,_0x5907af){_0x3031f4=_0x3031f4-0x1a6;const _0xcebd9a=a173_0xcebd();let _0x58983b=_0xcebd9a[_0x3031f4];return _0x58983b;}import{logger}from'../../../utils/logger.js';import{materializeLocalProjectTemplate,materializeProjectTemplate}from'../../../commands/project/create/materialize-project-template.js';function a173_0xcebd(){const _0x1bfc3c=['copy','info','1551781NTYYAh','Failed\x20to\x20copy\x20project\x20template','2069545miqQIA','error','109482RsSmcn','resolve','Starting\x20project\x20template\x20creation','now','success','cwd','458511yknczb','source','message','4KycBvm','201996eokRnY','968170MEnWdR','Project\x20template\x20created','1YgjiwT','3448656MsUSOd','16HfJbQe','version'];a173_0xcebd=function(){return _0x1bfc3c;};return a173_0xcebd();}export async function copyProjectTemplate(_0x4011bb,_0x744b1d,_0x4cc4c1){const _0x42a40d=a173_0x5898,_0x2b8170=Date[_0x42a40d(0x1ad)](),_0x19e836=a173_0x5d63c1[_0x42a40d(0x1ab)](process[_0x42a40d(0x1af)](),_0x4011bb);try{logger[_0x42a40d(0x1bc)](_0x42a40d(0x1bb),_0x42a40d(0x1ac),{'projectCode':_0x4011bb});const _0x32ed18=_0x4cc4c1?await materializeLocalProjectTemplate(_0x4cc4c1,_0x19e836,_0x744b1d):await materializeProjectTemplate(_0x19e836,_0x744b1d),_0x4e1ec1=Date[_0x42a40d(0x1ad)]()-_0x2b8170;logger[_0x42a40d(0x1ae)](_0x42a40d(0x1bb),_0x42a40d(0x1b6),_0x4e1ec1,{'projectCode':_0x4011bb,'templateSource':_0x32ed18[_0x42a40d(0x1b1)],'templateVersion':_0x32ed18[_0x42a40d(0x1ba)]});}catch(_0x5ae609){const _0x4e374f=Date[_0x42a40d(0x1ad)]()-_0x2b8170;logger[_0x42a40d(0x1a9)](_0x42a40d(0x1bb),_0x42a40d(0x1a7),{'projectCode':_0x4011bb,'error':_0x5ae609 instanceof Error?_0x5ae609[_0x42a40d(0x1b2)]:String(_0x5ae609),'duration':_0x4e374f});throw _0x5ae609;}return formatElapsed(_0x2b8170);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x473b81,_0x5581e1){const _0x59ae4e=a174_0x5c7e,_0x5cde79=_0x473b81();while(!![]){try{const _0x456dfb=parseInt(_0x59ae4e(0x161))/0x1+-parseInt(_0x59ae4e(0x167))/0x2*(parseInt(_0x59ae4e(0x163))/0x3)+parseInt(_0x59ae4e(0x166))/0x4+parseInt(_0x59ae4e(0x162))/0x5+parseInt(_0x59ae4e(0x154))/0x6*(parseInt(_0x59ae4e(0x158))/0x7)+parseInt(_0x59ae4e(0x168))/0x8*(-parseInt(_0x59ae4e(0x164))/0x9)+parseInt(_0x59ae4e(0x160))/0xa*(parseInt(_0x59ae4e(0x15a))/0xb);if(_0x456dfb===_0x5581e1)break;else _0x5cde79['push'](_0x5cde79['shift']());}catch(_0x5620a1){_0x5cde79['push'](_0x5cde79['shift']());}}}(a174_0x1a0f,0x608cc));import a174_0x129adc 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 a174_0x5c7e(_0x24a77d,_0x2b431c){_0x24a77d=_0x24a77d-0x153;const _0x1a0f3b=a174_0x1a0f();let _0x5c7e19=_0x1a0f3b[_0x24a77d];return _0x5c7e19;}function a174_0x1a0f(){const _0x5d239a=['Starting\x20code\x20format','now','prettier','21deTGLZ','resolve','428593gJqvkw','npx','cwd','format','Code\x20format\x20completed','error','50hLwpoK','400267nEAhni','1604140BdCHnb','1995576dLYaiw','9rdiJBw','--write','123428THZKwD','2nMAStB','2564896hWiDKv','message','869010sJsEuW'];a174_0x1a0f=function(){return _0x5d239a;};return a174_0x1a0f();}export async function formatProjectCode(_0x248470){const _0x3051a3=a174_0x5c7e,_0x436dcb=Date['now'](),_0x561cb3=a174_0x129adc[_0x3051a3(0x159)](process[_0x3051a3(0x15c)](),_0x248470);try{logger['info']('format',_0x3051a3(0x155),{'projectCode':_0x248470}),await execa(resolveNpmBin(_0x3051a3(0x15b)),[_0x3051a3(0x157),_0x3051a3(0x165),'.'],{'cwd':_0x561cb3});const _0x51d8cb=Date[_0x3051a3(0x156)]()-_0x436dcb;logger['success']('format',_0x3051a3(0x15e),_0x51d8cb,{'projectCode':_0x248470});}catch(_0x2a7a2f){const _0x5aee0c=Date[_0x3051a3(0x156)]()-_0x436dcb;logger[_0x3051a3(0x15f)](_0x3051a3(0x15d),'Code\x20format\x20failed',{'projectCode':_0x248470,'error':_0x2a7a2f instanceof Error?_0x2a7a2f[_0x3051a3(0x153)]:String(_0x2a7a2f),'duration':_0x5aee0c});throw _0x2a7a2f;}return formatElapsed(_0x436dcb);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4d7fb2,_0xde469d){const _0xbd2369=a175_0x8088,_0x1867eb=_0x4d7fb2();while(!![]){try{const _0x40b99b=parseInt(_0xbd2369(0xf0))/0x1+-parseInt(_0xbd2369(0xfc))/0x2+parseInt(_0xbd2369(0xef))/0x3*(-parseInt(_0xbd2369(0xfd))/0x4)+parseInt(_0xbd2369(0xfe))/0x5*(parseInt(_0xbd2369(0xf1))/0x6)+-parseInt(_0xbd2369(0xf5))/0x7*(parseInt(_0xbd2369(0xf9))/0x8)+parseInt(_0xbd2369(0xf2))/0x9*(-parseInt(_0xbd2369(0xf8))/0xa)+-parseInt(_0xbd2369(0xff))/0xb*(-parseInt(_0xbd2369(0xf7))/0xc);if(_0x40b99b===_0xde469d)break;else _0x1867eb['push'](_0x1867eb['shift']());}catch(_0x4ee19d){_0x1867eb['push'](_0x1867eb['shift']());}}}(a175_0x1538,0x99baa));import a175_0x4af9d6 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a175_0x8088(_0x308d52,_0x5e4eb9){_0x308d52=_0x308d52-0xeb;const _0x153827=a175_0x1538();let _0x8088e9=_0x153827[_0x308d52];return _0x8088e9;}import{resolveNpmBin}from'../../../utils/platform.js';function a175_0x1538(){const _0x32ef3a=['now','18654LlCMQY','1033949rNdIcf','12aPkCME','1593IuDxsF','error','https://registry.npmmirror.com','301IeZLKi','Dependency\x20install\x20failed','12rtXxin','59810nNKFKK','12120QvznUU','Dependency\x20install\x20completed','success','1640888cgPkfW','404KbAzZo','1726135WoDnLM','16252665HoPYeZ','install','npm','--registry','cwd'];a175_0x1538=function(){return _0x32ef3a;};return a175_0x1538();}export async function installDependencies(_0x52db18){const _0x2cc964=a175_0x8088,_0xfdeebb=Date[_0x2cc964(0xee)](),_0xd7eecb=a175_0x4af9d6['resolve'](process[_0x2cc964(0xed)](),_0x52db18);try{logger['info'](_0x2cc964(0x100),'Starting\x20dependency\x20install',{'projectCode':_0x52db18,'registry':_0x2cc964(0xf4)}),await execa(resolveNpmBin(_0x2cc964(0xeb)),[_0x2cc964(0x100),_0x2cc964(0xec),_0x2cc964(0xf4)],{'cwd':_0xd7eecb});const _0x2c1e96=Date[_0x2cc964(0xee)]()-_0xfdeebb;logger[_0x2cc964(0xfb)](_0x2cc964(0x100),_0x2cc964(0xfa),_0x2c1e96,{'projectCode':_0x52db18});}catch(_0x76b72d){const _0x271e91=Date[_0x2cc964(0xee)]()-_0xfdeebb;logger[_0x2cc964(0xf3)](_0x2cc964(0x100),_0x2cc964(0xf6),{'projectCode':_0x52db18,'error':_0x76b72d instanceof Error?_0x76b72d['message']:String(_0x76b72d),'duration':_0x271e91});throw _0x76b72d;}return formatElapsed(_0xfdeebb);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a176_0x361806=a176_0x3a4c;(function(_0x55709b,_0x3f7bba){const _0x2c1310=a176_0x3a4c,_0x2e531c=_0x55709b();while(!![]){try{const _0x4f5ef4=parseInt(_0x2c1310(0x145))/0x1+parseInt(_0x2c1310(0x139))/0x2*(-parseInt(_0x2c1310(0x146))/0x3)+-parseInt(_0x2c1310(0x12c))/0x4+-parseInt(_0x2c1310(0x12d))/0x5*(-parseInt(_0x2c1310(0x138))/0x6)+-parseInt(_0x2c1310(0x147))/0x7+-parseInt(_0x2c1310(0x132))/0x8+parseInt(_0x2c1310(0x135))/0x9;if(_0x4f5ef4===_0x3f7bba)break;else _0x2e531c['push'](_0x2e531c['shift']());}catch(_0x96aa7f){_0x2e531c['push'](_0x2e531c['shift']());}}}(a176_0x2d66,0xc5485));function a176_0x3a4c(_0x2778d0,_0x2937fc){_0x2778d0=_0x2778d0-0x127;const _0x2d667f=a176_0x2d66();let _0x3a4c6e=_0x2d667f[_0x2778d0];return _0x3a4c6e;}import{CliErrors}from'../../errors.js';function a176_0x2d66(){const _0x106607=['create','../../commands/project/create/main.js','yes','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','env','validation','Create\x20a\x20new\x20project','924162AkBxcU','3501345aOuRAD','7589386rKeLle','Usage:\x20','trim','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','project','Prepared\x20local\x20project\x20template\x20directory','write','nonInteractive','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','356028gvDQAi','19315gZLUGs','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','Project\x20name','project-name','cookie','5239264bWkJYC','string','template-source','21670641pGBgpb','args','Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','732FpKARY','2lnquAU','upgrade','bool','name','boolean'];a176_0x2d66=function(){return _0x106607;};return a176_0x2d66();}import{CLI_BIN_NAME}from'../../constant/cli.js';import{upgradeApp}from'../../commands/project/upgrade.js';const createFlags=[{'name':a176_0x361806(0x13c),'type':'string','description':a176_0x361806(0x12f)},{'name':a176_0x361806(0x142),'type':a176_0x361806(0x133),'description':'Target\x20environment'},{'name':'appcode','type':a176_0x361806(0x133),'description':a176_0x361806(0x141)},{'name':a176_0x361806(0x134),'type':a176_0x361806(0x133),'description':a176_0x361806(0x128)}],upgradeFlags=[{'name':'yes','type':a176_0x361806(0x13d),'description':'Skip\x20confirmation\x20prompt','default':![]}];export const projectDefinitions=[{'service':'project','command':a176_0x361806(0x13e),'description':a176_0x361806(0x144),'risk':a176_0x361806(0x129),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a176_0x361806(0x130),'description':a176_0x361806(0x14a),'required':![]}],'flags':createFlags,async 'execute'(_0x186dea){const _0x3b060e=a176_0x361806,{createApp:_0x150745}=await import(_0x3b060e(0x13f)),_0x4811ca=_0x186dea['str'](_0x3b060e(0x13c))[_0x3b060e(0x149)]()||_0x186dea[_0x3b060e(0x136)][0x0]?.[_0x3b060e(0x149)](),_0x2ff654=_0x186dea['str'](_0x3b060e(0x142))||undefined,_0x50db1d=_0x186dea['str']('appcode')||undefined,_0x3ed0e0=_0x186dea['str'](_0x3b060e(0x134))['trim']()||undefined;if(_0x186dea[_0x3b060e(0x12a)]){if(!_0x4811ca)throw CliErrors[_0x3b060e(0x143)](_0x3b060e(0x12b),_0x3b060e(0x148)+CLI_BIN_NAME+_0x3b060e(0x12e));await _0x150745({'projectCode':_0x4811ca,'appCode':_0x50db1d,'env':_0x2ff654,'cookie':_0x186dea[_0x3b060e(0x131)],'nonInteractive':!![],'templateSource':_0x3ed0e0});}else await _0x150745({'projectCode':_0x4811ca,'appCode':_0x50db1d,'env':_0x2ff654,'cookie':_0x186dea[_0x3b060e(0x131)],'templateSource':_0x3ed0e0});return{'ok':!![]};}},{'service':a176_0x361806(0x127),'command':a176_0x361806(0x13a),'description':a176_0x361806(0x137),'risk':a176_0x361806(0x129),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x3de1e2){const _0x6b98e4=a176_0x361806;return await upgradeApp(_0x3de1e2[_0x6b98e4(0x12a)],{'yes':_0x3de1e2[_0x6b98e4(0x13b)](_0x6b98e4(0x140))}),{'ok':!![]};}}];
|