@lovrabet/rabetbase-cli 2.3.9-beta.2 → 2.3.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/api-doc.js +1 -1
- package/lib/api/fetch-model-list.js +1 -1
- package/lib/api/generate-api-file.js +1 -1
- package/lib/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -0
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/delete.js +1 -0
- package/lib/commands/menu/group-create.js +1 -0
- package/lib/commands/menu/group-update.js +1 -0
- package/lib/commands/menu/index.js +1 -1
- package/lib/commands/menu/list.js +1 -1
- package/lib/commands/menu/regroup-start.js +1 -0
- package/lib/commands/menu/shared/compare-table.js +1 -1
- package/lib/commands/menu/shared/delete-plan.js +1 -0
- package/lib/commands/menu/shared/facts.js +1 -0
- 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 -0
- package/lib/commands/menu/shared/service.js +1 -1
- package/lib/commands/menu/shared/sync-core.js +1 -1
- package/lib/commands/menu/shared/update-core.js +1 -1
- package/lib/commands/menu/shared/valid-url.js +1 -1
- package/lib/commands/menu/sync.js +1 -1
- package/lib/commands/menu/update.js +1 -1
- package/lib/commands/notification/config-list.js +1 -1
- package/lib/commands/notification/index.js +1 -1
- package/lib/commands/page/generate-start.js +1 -1
- package/lib/commands/page/generate-status.js +1 -1
- package/lib/commands/page/index.js +1 -1
- package/lib/commands/page/pull.js +1 -1
- package/lib/commands/page/push.js +1 -1
- package/lib/commands/page/relation-audit.js +1 -1
- package/lib/commands/page/shared.js +1 -1
- package/lib/commands/page/standard-page-status.js +1 -1
- package/lib/commands/page/sync.js +1 -1
- package/lib/commands/permit/index.js +1 -1
- package/lib/commands/permit/page-get.js +1 -1
- package/lib/commands/permit/page-set.js +1 -1
- package/lib/commands/permit/role-apis-set.js +1 -1
- package/lib/commands/permit/role-menus-set.js +1 -1
- package/lib/commands/permit/role-menus.js +1 -1
- package/lib/commands/permit/shared.js +1 -1
- package/lib/commands/project/create/enhanced-guided-create.js +1 -1
- package/lib/commands/project/create/format-elapsed.js +1 -1
- package/lib/commands/project/create/main.js +1 -1
- package/lib/commands/project/create/non-interactive.js +1 -1
- package/lib/commands/project/create/project-template-path.js +1 -1
- package/lib/commands/project/create/use-copy-project-template.js +1 -1
- package/lib/commands/project/create/use-format-code.js +1 -1
- package/lib/commands/project/create/use-install-dependencies.js +1 -1
- package/lib/commands/project/index.js +1 -1
- package/lib/commands/project/init.js +1 -1
- package/lib/commands/project/upgrade.js +1 -1
- package/lib/commands/registry.js +1 -1
- package/lib/commands/role/create.js +1 -1
- package/lib/commands/role/delete.js +1 -1
- package/lib/commands/role/detail.js +1 -1
- package/lib/commands/role/index.js +1 -1
- package/lib/commands/role/list.js +1 -1
- package/lib/commands/role/shared.js +1 -1
- package/lib/commands/role/update.js +1 -1
- package/lib/commands/role/user-add.js +1 -1
- package/lib/commands/role/user-remove.js +1 -1
- package/lib/commands/role/user-resolve.js +1 -1
- package/lib/commands/run/index.js +1 -1
- package/lib/commands/schema.js +1 -1
- package/lib/commands/sql/create.js +1 -1
- package/lib/commands/sql/delete.js +1 -1
- package/lib/commands/sql/detail.js +1 -1
- package/lib/commands/sql/exec.js +1 -1
- package/lib/commands/sql/index.js +1 -1
- package/lib/commands/sql/list.js +1 -1
- package/lib/commands/sql/pull.js +1 -1
- package/lib/commands/sql/push.js +1 -1
- package/lib/commands/sql/save.js +1 -1
- package/lib/commands/sql/shared.js +1 -1
- package/lib/commands/sql/status.js +1 -1
- package/lib/commands/sql/validate.js +1 -1
- package/lib/commands/task/index.js +1 -0
- package/lib/commands/task/status.js +1 -0
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -0
- 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 -0
- package/lib/framework/explicit-yes.js +1 -0
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/telemetry/cli-command-trace.js +1 -1
- package/lib/telemetry/cli-help-trace.js +1 -1
- package/lib/telemetry/ensure-cli-otel-config.js +1 -1
- package/lib/telemetry/register-otel-exit-shutdown.js +1 -1
- package/lib/telemetry/send-cli-trace-log.js +1 -1
- package/lib/telemetry/send-platform-issue-collect-log.js +1 -1
- package/lib/utils/ai_config.js +1 -1
- package/lib/utils/apply-jq-filter.js +1 -1
- package/lib/utils/cdn-config.js +1 -1
- package/lib/utils/check-sdk-version.js +1 -1
- package/lib/utils/cli-version-check.js +1 -1
- package/lib/utils/cli-version-policy.js +1 -1
- package/lib/utils/config.js +1 -1
- package/lib/utils/copy-directory.js +1 -1
- package/lib/utils/entity-with-id.js +1 -1
- package/lib/utils/file-utils.js +1 -1
- package/lib/utils/guides-cdn.js +1 -1
- package/lib/utils/http-client.js +1 -1
- package/lib/utils/is-non-interactive.js +1 -1
- package/lib/utils/logger.js +1 -1
- package/lib/utils/params.js +1 -1
- package/lib/utils/platform.js +1 -1
- package/lib/utils/rules-cdn.js +1 -1
- package/lib/utils/sleep.js +1 -1
- package/lib/utils/template-replacer.js +1 -1
- package/lib/utils/update-notice.js +1 -1
- package/lib/utils/version.js +1 -1
- package/lib/utils/with-active-cookie.js +1 -1
- package/lib/utils/write-cli-side-channel.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a132_0x3ba3dc=a132_0x9499;(function(_0x10f0db,_0x25af95){const _0x4d30b7=a132_0x9499,_0x3312a0=_0x10f0db();while(!![]){try{const _0x2415fb=parseInt(_0x4d30b7(0x1cd))/0x1*(parseInt(_0x4d30b7(0x1bc))/0x2)+-parseInt(_0x4d30b7(0x1d4))/0x3+-parseInt(_0x4d30b7(0x1b7))/0x4*(parseInt(_0x4d30b7(0x1bb))/0x5)+-parseInt(_0x4d30b7(0x1cb))/0x6*(-parseInt(_0x4d30b7(0x1ce))/0x7)+parseInt(_0x4d30b7(0x1c9))/0x8*(parseInt(_0x4d30b7(0x1d0))/0x9)+-parseInt(_0x4d30b7(0x1c2))/0xa*(-parseInt(_0x4d30b7(0x1d2))/0xb)+-parseInt(_0x4d30b7(0x1d5))/0xc*(parseInt(_0x4d30b7(0x1d1))/0xd);if(_0x2415fb===_0x25af95)break;else _0x3312a0['push'](_0x3312a0['shift']());}catch(_0x58fb5a){_0x3312a0['push'](_0x3312a0['shift']());}}}(a132_0x358a,0xe7662));import{APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a132_0x358a(){const _0x418239=['compress','19420pvygHk','/smartapi/lovrabet/dataset/','code','alias','length','page','sync','2551608ZhFRbh','同步成功','1790442DEKWHs','isArray','1NlaRcP','21QhIyDc','undeletedPages','9MKMWUR','2109796erpEqd','4477bsZRcM','dataset','1471857wTVoqu','84WYOxNe','\x20undeleted\x20related\x20page(s)\x20found','failedPages','string','200YhNBTE','fieldCount','name','appCode','102415gSSDOu','3188114RUKuDc','Sync\x20dataset\x20changes\x20to\x20related\x20Smart\x20List\x20Pages','relatedPages','/sync-to-pages','部分页面同步失败'];a132_0x358a=function(){return _0x418239;};return a132_0x358a();}function a132_0x9499(_0x3c5cf6,_0x47d0ad){_0x3c5cf6=_0x3c5cf6-0x1b7;const _0x358a75=a132_0x358a();let _0x94999b=_0x358a75[_0x3c5cf6];return _0x94999b;}import{loadDatasetDetailForPage,prepareDatasetAction,serializeDryRunDescription,validateDatasetSelector}from'../../commands/page/shared.js';import{syncStandardPages}from'../../core/api-client.js';export const pageSync={'service':a132_0x3ba3dc(0x1c7),'command':a132_0x3ba3dc(0x1c8),'description':a132_0x3ba3dc(0x1bd),'risk':'write','defaultOutputFormat':a132_0x3ba3dc(0x1c1),'flags':[APPCODE_FLAG_OPTIONAL,DATASETCODE_FLAG_OPTIONAL,{'name':a132_0x3ba3dc(0x1c5),'type':a132_0x3ba3dc(0x1d8),'description':'Dataset\x20alias\x20from\x20api.ts\x20(resolves\x20to\x20dataset\x20code\x20automatically)'}],async 'validate'(_0x4dca95){validateDatasetSelector(_0x4dca95);},async 'dryRun'(_0x4655dd){const _0x2af828=a132_0x3ba3dc,_0x1acf77=await prepare(_0x4655dd);return{'method':'POST','url':_0x2af828(0x1c3)+_0x1acf77[_0x2af828(0x1d3)][_0x2af828(0x1c4)]+_0x2af828(0x1bf),'body':{'appCode':_0x4655dd[_0x2af828(0x1ba)]},'description':serializeDryRunDescription({'dataset':{'id':_0x1acf77[_0x2af828(0x1d3)]['id'],'code':_0x1acf77[_0x2af828(0x1d3)][_0x2af828(0x1c4)],'name':_0x1acf77[_0x2af828(0x1d3)][_0x2af828(0x1b9)],'fieldCount':_0x1acf77[_0x2af828(0x1d3)][_0x2af828(0x1b8)]},'relatedPages':{'total':_0x1acf77['dataset'][_0x2af828(0x1be)][_0x2af828(0x1c6)],'undeletedCount':_0x1acf77['undeletedPages'][_0x2af828(0x1c6)]},'action':_0x2af828(0x1c8),'reason':_0x1acf77[_0x2af828(0x1cf)]['length']+_0x2af828(0x1d6)})};},async 'execute'(_0x4ab5dd){const _0x4665e0=a132_0x3ba3dc,_0x250c6c=await prepare(_0x4ab5dd),_0x1215b4=await syncStandardPages(_0x4ab5dd[_0x4665e0(0x1ba)],_0x250c6c[_0x4665e0(0x1d3)][_0x4665e0(0x1c4)]),_0x128b2d=Array[_0x4665e0(0x1cc)](_0x1215b4['failedPages'])&&_0x1215b4[_0x4665e0(0x1d7)][_0x4665e0(0x1c6)]>0x0,_0x40957c=_0x128b2d?_0x4665e0(0x1c0):_0x4665e0(0x1ca);return{'ok':!![],'message':_0x40957c,'data':{'datasetCode':_0x250c6c['dataset'][_0x4665e0(0x1c4)],..._0x1215b4}};}};async function prepare(_0x5182a3){const _0x30d065=a132_0x3ba3dc,_0x42f954=await loadDatasetDetailForPage(_0x5182a3);return prepareDatasetAction(_0x42f954,_0x30d065(0x1c8));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1f738c,_0x5ee69b){const _0x3d7f5d=a133_0x3425,_0x2817d1=_0x1f738c();while(!![]){try{const _0x200efa=-parseInt(_0x3d7f5d(0x14d))/0x1*(parseInt(_0x3d7f5d(0x151))/0x2)+parseInt(_0x3d7f5d(0x158))/0x3*(parseInt(_0x3d7f5d(0x156))/0x4)+-parseInt(_0x3d7f5d(0x154))/0x5*(-parseInt(_0x3d7f5d(0x155))/0x6)+parseInt(_0x3d7f5d(0x150))/0x7+parseInt(_0x3d7f5d(0x14e))/0x8*(parseInt(_0x3d7f5d(0x153))/0x9)+parseInt(_0x3d7f5d(0x152))/0xa*(parseInt(_0x3d7f5d(0x14f))/0xb)+-parseInt(_0x3d7f5d(0x157))/0xc;if(_0x200efa===_0x5ee69b)break;else _0x2817d1['push'](_0x2817d1['shift']());}catch(_0x152a74){_0x2817d1['push'](_0x2817d1['shift']());}}}(a133_0x1e0d,0x9a647));import{permitPageGet}from'../../commands/permit/page-get.js';import{permitPageSet}from'../../commands/permit/page-set.js';function a133_0x3425(_0x4843fe,_0x1af6d8){_0x4843fe=_0x4843fe-0x14d;const _0x1e0da2=a133_0x1e0d();let _0x3425f9=_0x1e0da2[_0x4843fe];return _0x3425f9;}import{permitRoleMenus}from'../../commands/permit/role-menus.js';function a133_0x1e0d(){const _0x5a9a44=['3SklzpR','1bryoWk','2319184mnDjgk','11AtNROE','3810450PnhclZ','1379464sKtfMs','5683190xqluQK','9DWyQQI','4789495qHgltB','6cdhqmt','4084604jnOYXi','24713928wpwWCN'];a133_0x1e0d=function(){return _0x5a9a44;};return a133_0x1e0d();}import{permitRoleMenusSet}from'../../commands/permit/role-menus-set.js';import{permitRoleApisSet}from'../../commands/permit/role-apis-set.js';export const permitDefinitions=[permitPageGet,permitPageSet,permitRoleMenus,permitRoleMenusSet,permitRoleApisSet];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a134_0x1189a3=a134_0x21f5;(function(_0x47b681,_0x599d38){const _0x1340bd=a134_0x21f5,_0x497b38=_0x47b681();while(!![]){try{const _0x183690=-parseInt(_0x1340bd(0xc9))/0x1*(-parseInt(_0x1340bd(0xce))/0x2)+-parseInt(_0x1340bd(0xc6))/0x3*(parseInt(_0x1340bd(0xc5))/0x4)+parseInt(_0x1340bd(0xc7))/0x5*(parseInt(_0x1340bd(0xc4))/0x6)+parseInt(_0x1340bd(0xc0))/0x7*(-parseInt(_0x1340bd(0xc2))/0x8)+-parseInt(_0x1340bd(0xc1))/0x9*(parseInt(_0x1340bd(0xca))/0xa)+parseInt(_0x1340bd(0xcb))/0xb+parseInt(_0x1340bd(0xc3))/0xc*(parseInt(_0x1340bd(0xbf))/0xd);if(_0x183690===_0x599d38)break;else _0x497b38['push'](_0x497b38['shift']());}catch(_0xb0aa87){_0x497b38['push'](_0x497b38['shift']());}}}(a134_0x5308,0xd1c45));import{getPagePermit}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{MENU_ID_FLAG,projectPagePermit}from'../../commands/permit/shared.js';function a134_0x21f5(_0x52cea5,_0x29b4cd){_0x52cea5=_0x52cea5-0xbf;const _0x53087c=a134_0x5308();let _0x21f57f=_0x53087c[_0x52cea5];return _0x21f57f;}export const permitPageGet={'service':a134_0x1189a3(0xcd),'command':'page-get','description':a134_0x1189a3(0xc8),'risk':'read','flags':[MENU_ID_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x465a36){const _0x58a73b=a134_0x1189a3,_0x293f86=_0x465a36['num']('menu-id'),_0x2cf6e9=await getPagePermit(_0x293f86);return{'ok':!![],'data':{'page':projectPagePermit(_0x2cf6e9)},'message':_0x58a73b(0xcc)+_0x293f86};}};function a134_0x5308(){const _0x1f2fee=['Show\x20the\x20page\x20permission\x20snapshot\x20for\x20a\x20menu','2yEuaTc','3917530HKTBUR','1582174hSDqHN','Page\x20permit\x20for\x20menu\x20','permit','1420770pjUSAB','1847079HTKgSi','35VILKAz','18rhaUqN','2045128CWhxaU','48GhjEPw','102852CLjjYC','184QiJBaU','51462hvvtBH','460layhLD'];a134_0x5308=function(){return _0x1f2fee;};return a134_0x5308();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a135_0x4e1758=a135_0x48e9;(function(_0x3a3411,_0x30eaeb){const _0xfbe412=a135_0x48e9,_0x431a69=_0x3a3411();while(!![]){try{const _0x13144d=parseInt(_0xfbe412(0x14f))/0x1*(parseInt(_0xfbe412(0x13c))/0x2)+parseInt(_0xfbe412(0x13d))/0x3*(parseInt(_0xfbe412(0x14e))/0x4)+parseInt(_0xfbe412(0x155))/0x5*(-parseInt(_0xfbe412(0x15c))/0x6)+parseInt(_0xfbe412(0x146))/0x7*(-parseInt(_0xfbe412(0x13a))/0x8)+-parseInt(_0xfbe412(0x143))/0x9*(-parseInt(_0xfbe412(0x14c))/0xa)+parseInt(_0xfbe412(0x152))/0xb*(-parseInt(_0xfbe412(0x154))/0xc)+parseInt(_0xfbe412(0x153))/0xd;if(_0x13144d===_0x30eaeb)break;else _0x431a69['push'](_0x431a69['shift']());}catch(_0x1bd485){_0x431a69['push'](_0x431a69['shift']());}}}(a135_0x505f,0x513a4));import{getPagePermit,savePagePermit}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{MENU_ID_FLAG,PAGE_SET_ROLE_FLAGS,PAGE_SLOT_SPECS,projectPageSlot,resolvePermitRoles,splitList}from'../../commands/permit/shared.js';function a135_0x505f(){const _0xdd3c98=['POST','page-set','/smartapi/permit/page/save','menu-id','1200wpQyGD','map','6484YHZLnC','350769ZIDbJS','spec','high-risk-write','6920331nIJVRC','3949660MMgyvp','12DXqIfn','5KIXMQw','Set\x20page\x20permissions\x20for\x20a\x20menu\x20(menu/create/update/delete/detail/export/row\x20roles);\x20requires\x20--yes','Only\x20slots\x20present\x20in\x20`permit\x20page-get`\x20can\x20be\x20set.','key','selector','length','num','123384BRMmMR','This\x20page\x20has\x20no\x20\x22','49112gmMjjO','appCode','2gckNiD','399mgmrbu','label','push','rolePermit','Nothing\x20to\x20set.','\x22\x20permission\x20slot\x20(','22689cVvtZh','join','validation','217nmOPDo','flag'];a135_0x505f=function(){return _0xdd3c98;};return a135_0x505f();}const SAVE_PATH=a135_0x4e1758(0x14a);function collectRequestedSlots(_0x4a9f85){const _0x404b46=a135_0x4e1758,_0x18fe7a=[];for(const _0x9d48a4 of PAGE_SLOT_SPECS){const _0x52a125=_0x4a9f85[_0x404b46(0x147)](_0x9d48a4['flag']);if(_0x52a125===undefined||_0x52a125===null)continue;const _0x54e08c=splitList(String(_0x52a125));if(_0x54e08c[_0x404b46(0x15a)]===0x0)throw CliErrors[_0x404b46(0x145)]('--'+_0x9d48a4[_0x404b46(0x147)]+'\x20cannot\x20be\x20empty.','Pass\x20at\x20least\x20one\x20role,\x20or\x20omit\x20the\x20flag.\x20Clearing\x20permissions\x20is\x20not\x20supported\x20by\x20this\x20command.');_0x18fe7a[_0x404b46(0x13f)]({'spec':_0x9d48a4,'refs':_0x54e08c});}return _0x18fe7a;}function a135_0x48e9(_0x23943b,_0x1fbb56){_0x23943b=_0x23943b-0x13a;const _0x505fbc=a135_0x505f();let _0x48e9e8=_0x505fbc[_0x23943b];return _0x48e9e8;}async function buildPlan(_0x211933,_0x28b240){const _0x3dafe2=a135_0x4e1758,_0x4816fd=_0x211933[_0x3dafe2(0x15b)](_0x3dafe2(0x14b)),_0x4a8d65=collectRequestedSlots(_0x211933);if(_0x4a8d65[_0x3dafe2(0x15a)]===0x0)throw CliErrors[_0x3dafe2(0x145)](_0x3dafe2(0x141),'Pass\x20at\x20least\x20one\x20of:\x20'+PAGE_SLOT_SPECS[_0x3dafe2(0x14d)](_0x256559=>'--'+_0x256559['flag'])[_0x3dafe2(0x144)](',\x20')+'.');const _0x157644=await getPagePermit(_0x4816fd),_0x34a8ee={},_0x128969={},_0x9cd5d5=[];for(const {spec:_0x2d1e49,refs:_0x3d95bd}of _0x4a8d65){const _0x31c953=_0x157644[_0x2d1e49[_0x3dafe2(0x158)]];if(!_0x31c953)throw CliErrors[_0x3dafe2(0x145)](_0x3dafe2(0x15d)+_0x2d1e49[_0x3dafe2(0x13e)]+_0x3dafe2(0x142)+_0x2d1e49['key']+').',_0x3dafe2(0x157));_0x34a8ee[_0x2d1e49[_0x3dafe2(0x158)]]=projectPageSlot(_0x31c953);const _0x1b6841=await resolvePermitRoles(_0x211933[_0x3dafe2(0x13b)],_0x3d95bd,{'allowSelf':_0x2d1e49['allowSelf'],'label':_0x2d1e49['label']});_0x31c953[_0x3dafe2(0x140)]=_0x1b6841,_0x128969[_0x2d1e49[_0x3dafe2(0x158)]]=projectPageSlot(_0x31c953);}const _0x5e6277={'operation':_0x3dafe2(0x149),'selector':{'appCode':_0x211933[_0x3dafe2(0x13b)],'menuId':_0x4816fd,'slots':_0x4a8d65['map'](_0x1e6a42=>_0x1e6a42[_0x3dafe2(0x150)][_0x3dafe2(0x158)])},'before':_0x34a8ee,'after':_0x128969,'dryRun':_0x28b240,'backend':{'method':_0x3dafe2(0x148),'path':SAVE_PATH},'warnings':_0x9cd5d5};return{'page':_0x157644,'mutation':_0x5e6277};}export const permitPageSet={'service':'permit','command':a135_0x4e1758(0x149),'description':a135_0x4e1758(0x156),'risk':a135_0x4e1758(0x151),'flags':[MENU_ID_FLAG,...PAGE_SET_ROLE_FLAGS,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x450ec6){const _0x58b149=a135_0x4e1758,_0x1145c6=collectRequestedSlots(_0x450ec6);if(_0x1145c6[_0x58b149(0x15a)]===0x0)throw CliErrors[_0x58b149(0x145)](_0x58b149(0x141),'Pass\x20at\x20least\x20one\x20of:\x20'+PAGE_SLOT_SPECS['map'](_0x590866=>'--'+_0x590866[_0x58b149(0x147)])['join'](',\x20')+'.');},async 'dryRun'(_0x40a9c9){const {mutation:_0xeccca9}=await buildPlan(_0x40a9c9,!![]);return asDryRunResult(_0xeccca9,{'method':'POST','url':SAVE_PATH});},async 'execute'(_0x55f80e){const _0x56c8b4=a135_0x4e1758,{page:_0x1df297,mutation:_0x2e20f1}=await buildPlan(_0x55f80e,![]);return await savePagePermit(_0x1df297),{'ok':!![],'data':_0x2e20f1,'message':'Updated\x20page\x20permit\x20for\x20menu\x20'+_0x2e20f1[_0x56c8b4(0x159)]['menuId']};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a136_0x961d7=a136_0x4f28;(function(_0x3ab034,_0x1c91ac){const _0x299162=a136_0x4f28,_0x3ae69d=_0x3ab034();while(!![]){try{const _0x27d99e=parseInt(_0x299162(0xee))/0x1+-parseInt(_0x299162(0xec))/0x2+parseInt(_0x299162(0xfa))/0x3*(parseInt(_0x299162(0xe0))/0x4)+parseInt(_0x299162(0xdc))/0x5+parseInt(_0x299162(0xf2))/0x6*(-parseInt(_0x299162(0xdd))/0x7)+-parseInt(_0x299162(0xdb))/0x8+parseInt(_0x299162(0xf6))/0x9;if(_0x27d99e===_0x1c91ac)break;else _0x3ae69d['push'](_0x3ae69d['shift']());}catch(_0x5db6e8){_0x3ae69d['push'](_0x3ae69d['shift']());}}}(a136_0xe1b2,0xb2388));import{getRoleApiResources,updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';function a136_0xe1b2(){const _0x2b6f2b=['role-apis-set\x20currently\x20supports\x20revoking\x20dataset\x20API\x20access\x20(use\x20case\x204).','Missing\x20--revoke.','get','high-risk-write','permit','Revoke\x20a\x20role\x27s\x20dataset\x20API\x20access\x20by\x20datasetCode\x20(roleType\x20API);\x20requires\x20--yes','POST','length','str','1273478QzisFS','roleName','1219747jjNetY','action','Verify\x20the\x20datasetCode,\x20or\x20check\x20the\x20role\x27s\x20API\x20resource\x20matrix.','API','180jcxgKj','Unknown\x20datasetCode(s)\x20for\x20this\x20role\x27s\x20API\x20resources:\x20','has','set','16578009lwkxho','\x20dataset(s)\x20on\x20role\x20','filter','validation','93018vslnCd','appCode','flagMissing','Revoked\x20API\x20access\x20for\x20','datasets','selector','join','7587008wxUtyd','2508505DUhEwx','312984WymWHp','bool','revoke','12doLwVR','role-apis-set','push'];a136_0xe1b2=function(){return _0x2b6f2b;};return a136_0xe1b2();}import{asDryRunResult}from'../../commands/common/dry-run.js';import{buildPermits,DATASETS_FLAG,flattenApiResources,readRoleRef,REVOKE_FLAG,ROLE_REF_FLAG,splitList}from'../../commands/permit/shared.js';import{assertPermConfigurable,resolveRoleRef}from'../../commands/role/shared.js';const UPDATE_PATH='/smartapi/permit/role/update';async function buildPlan(_0x13b74a,_0xc0ae6e){const _0x6bbddf=a136_0x4f28,_0x5135cc=await resolveRoleRef(_0x13b74a['appCode'],readRoleRef(_0x13b74a));assertPermConfigurable(_0x5135cc);if(!_0x13b74a[_0x6bbddf(0xde)](_0x6bbddf(0xdf)))throw CliErrors[_0x6bbddf(0xf9)](_0x6bbddf(0xe4),_0x6bbddf(0xe3));const _0x3f475d=splitList(_0x13b74a[_0x6bbddf(0xeb)](_0x6bbddf(0xfe)));if(_0x3f475d[_0x6bbddf(0xea)]===0x0)throw CliErrors['flagMissing']('datasets','Pass\x20--datasets\x20<datasetCode,...>.');const _0x43d246=await getRoleApiResources(_0x13b74a[_0x6bbddf(0xfb)],_0x5135cc['id']),{byCode:_0xb104a6,byDataset:_0x102338}=flattenApiResources(_0x43d246),_0x4f04ed=_0x3f475d[_0x6bbddf(0xf8)](_0x26590b=>!_0x102338[_0x6bbddf(0xf4)](_0x26590b));if(_0x4f04ed[_0x6bbddf(0xea)]>0x0)throw CliErrors[_0x6bbddf(0xf9)](_0x6bbddf(0xf3)+_0x4f04ed[_0x6bbddf(0xda)](',\x20')+'.',_0x6bbddf(0xf0));const _0x44576d=new Map(),_0x12b9ef=[],_0x42cb48=[];for(const _0x521e80 of _0x3f475d){for(const _0x11592a of _0x102338[_0x6bbddf(0xe5)](_0x521e80)){const _0x4b091a=_0xb104a6[_0x6bbddf(0xe5)](_0x11592a);_0x44576d[_0x6bbddf(0xf5)](_0x11592a,'0'),_0x12b9ef['push']({'resourceCode':_0x11592a,'datasetCode':_0x521e80,'action':_0x4b091a[_0x6bbddf(0xef)]}),_0x42cb48[_0x6bbddf(0xe2)]({'resourceCode':_0x11592a,'datasetCode':_0x521e80,'action':'0'});}}const _0x4f910f=buildPermits(_0xb104a6,_0x44576d),_0x2d4e8f={'operation':'api-revoke','selector':{'appCode':_0x13b74a[_0x6bbddf(0xfb)],'roleId':_0x5135cc['id'],'roleName':_0x5135cc[_0x6bbddf(0xed)],'datasetCodes':_0x3f475d},'before':_0x12b9ef,'after':_0x42cb48,'dryRun':_0xc0ae6e,'backend':{'method':_0x6bbddf(0xe9),'path':UPDATE_PATH,'roleType':_0x6bbddf(0xf1)},'warnings':[]};return{'role':_0x5135cc,'permits':_0x4f910f,'mutation':_0x2d4e8f};}function a136_0x4f28(_0x4caad7,_0x223821){_0x4caad7=_0x4caad7-0xda;const _0xe1b24a=a136_0xe1b2();let _0x4f2893=_0xe1b24a[_0x4caad7];return _0x4f2893;}export const permitRoleApisSet={'service':a136_0x961d7(0xe7),'command':a136_0x961d7(0xe1),'description':a136_0x961d7(0xe8),'risk':a136_0x961d7(0xe6),'flags':[ROLE_REF_FLAG,REVOKE_FLAG,DATASETS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x999606){const _0x730fdb=a136_0x961d7;if(!_0x999606[_0x730fdb(0xde)](_0x730fdb(0xdf)))throw CliErrors[_0x730fdb(0xf9)](_0x730fdb(0xe4),_0x730fdb(0xe3));if(splitList(_0x999606[_0x730fdb(0xeb)](_0x730fdb(0xfe)))['length']===0x0)throw CliErrors[_0x730fdb(0xfc)]('datasets','Pass\x20--datasets\x20<datasetCode,...>.');},async 'dryRun'(_0x6866e4){const {mutation:_0x19f602}=await buildPlan(_0x6866e4,!![]);return asDryRunResult(_0x19f602,{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x3d5fed){const _0x5c98a3=a136_0x961d7,{role:_0x4be395,permits:_0xa30a10,mutation:_0x5b7e46}=await buildPlan(_0x3d5fed,![]);return await updateAppRole({'id':_0x4be395['id'],'appCode':_0x3d5fed[_0x5c98a3(0xfb)],'roleType':_0x5c98a3(0xf1),'permits':_0xa30a10}),{'ok':!![],'data':_0x5b7e46,'message':_0x5c98a3(0xfd)+_0x5b7e46[_0x5c98a3(0xff)]['datasetCodes'][_0x5c98a3(0xea)]+_0x5c98a3(0xf7)+_0x4be395[_0x5c98a3(0xed)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a137_0x40f8e9=a137_0x5287;(function(_0x596fc9,_0xdc4706){const _0x372115=a137_0x5287,_0x2cf57c=_0x596fc9();while(!![]){try{const _0x220dbd=parseInt(_0x372115(0x19c))/0x1+-parseInt(_0x372115(0x19e))/0x2*(parseInt(_0x372115(0x17e))/0x3)+parseInt(_0x372115(0x189))/0x4+-parseInt(_0x372115(0x19b))/0x5*(-parseInt(_0x372115(0x17b))/0x6)+-parseInt(_0x372115(0x188))/0x7*(-parseInt(_0x372115(0x18a))/0x8)+-parseInt(_0x372115(0x180))/0x9*(-parseInt(_0x372115(0x192))/0xa)+-parseInt(_0x372115(0x190))/0xb;if(_0x220dbd===_0xdc4706)break;else _0x2cf57c['push'](_0x2cf57c['shift']());}catch(_0x5258ac){_0x2cf57c['push'](_0x2cf57c['shift']());}}}(a137_0x3bd9,0x19cec));import{getRoleMenuResources,updateAppRole}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';function a137_0x5287(_0x4ed761,_0x3ac8ce){_0x4ed761=_0x4ed761-0x17b;const _0x3bd9c0=a137_0x3bd9();let _0x5287b3=_0x3bd9c0[_0x4ed761];return _0x5287b3;}import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{asDryRunResult}from'../../commands/common/dry-run.js';import{buildPermits,flattenMenuResources,GRANT_FLAG,MENUS_FLAG,readGrantRevoke,readRoleRef,REVOKE_FLAG,ROLE_REF_FLAG,splitList}from'../../commands/permit/shared.js';import{assertPermConfigurable,resolveRoleRef}from'../../commands/role/shared.js';const UPDATE_PATH=a137_0x40f8e9(0x17f);async function buildPlan(_0x1f0a7a,_0x5e7e8){const _0x28db47=a137_0x40f8e9,_0x4d946c=await resolveRoleRef(_0x1f0a7a[_0x28db47(0x193)],readRoleRef(_0x1f0a7a));assertPermConfigurable(_0x4d946c);const _0x34688b=readGrantRevoke(_0x1f0a7a),_0x4314ff=splitList(_0x1f0a7a['str']('menus'));if(_0x4314ff['length']===0x0)throw CliErrors[_0x28db47(0x18c)](_0x28db47(0x17d),'Pass\x20--menus\x20<resourceCode,...>.');const _0x17e65c=await getRoleMenuResources(_0x1f0a7a[_0x28db47(0x193)],_0x4d946c['id']),_0x5992e2=flattenMenuResources(_0x17e65c),_0x584d0e=_0x4314ff[_0x28db47(0x17c)](_0x2cda6f=>!_0x5992e2[_0x28db47(0x195)](_0x2cda6f));if(_0x584d0e['length']>0x0)throw CliErrors[_0x28db47(0x181)](_0x28db47(0x19f)+_0x584d0e['join'](',\x20')+'.',_0x28db47(0x18e));const _0x26261b=new Map(),_0x29cc82=[],_0x2692fe=[];for(const _0x561830 of _0x4314ff){const _0x2e686c=_0x5992e2[_0x28db47(0x18d)](_0x561830);_0x26261b['set'](_0x561830,_0x34688b),_0x29cc82[_0x28db47(0x182)]({'resourceCode':_0x561830,'action':_0x2e686c[_0x28db47(0x19a)]}),_0x2692fe[_0x28db47(0x182)]({'resourceCode':_0x561830,'action':_0x34688b});}const _0x2b368f=buildPermits(_0x5992e2,_0x26261b),_0x153a64={'operation':_0x34688b===_0x28db47(0x184)?_0x28db47(0x186):_0x28db47(0x18f),'selector':{'appCode':_0x1f0a7a[_0x28db47(0x193)],'roleId':_0x4d946c['id'],'roleName':_0x4d946c[_0x28db47(0x191)],'resourceCodes':_0x4314ff},'before':_0x29cc82,'after':_0x2692fe,'dryRun':_0x5e7e8,'backend':{'method':_0x28db47(0x185),'path':UPDATE_PATH,'roleType':_0x28db47(0x187)},'warnings':[]};return{'role':_0x4d946c,'permits':_0x2b368f,'mutation':_0x153a64};}export const permitRoleMenusSet={'service':a137_0x40f8e9(0x19d),'command':a137_0x40f8e9(0x18b),'description':a137_0x40f8e9(0x198),'risk':'high-risk-write','flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x59dbf7){const _0x5379dc=a137_0x40f8e9;readGrantRevoke(_0x59dbf7);if(splitList(_0x59dbf7['str'](_0x5379dc(0x17d)))[_0x5379dc(0x199)]===0x0)throw CliErrors[_0x5379dc(0x18c)](_0x5379dc(0x17d),_0x5379dc(0x196));},async 'dryRun'(_0x265427){const _0x330156=a137_0x40f8e9,{mutation:_0x17f5b4}=await buildPlan(_0x265427,!![]);return asDryRunResult(_0x17f5b4,{'method':_0x330156(0x185),'url':UPDATE_PATH});},async 'execute'(_0x33f4df){const _0x66b34a=a137_0x40f8e9,{role:_0x3cc572,permits:_0x2cee14,mutation:_0xb9e97}=await buildPlan(_0x33f4df,![]);return await updateAppRole({'id':_0x3cc572['id'],'appCode':_0x33f4df[_0x66b34a(0x193)],'roleType':_0x66b34a(0x187),'permits':_0x2cee14}),{'ok':!![],'data':_0xb9e97,'message':_0x66b34a(0x197)+_0xb9e97['selector'][_0x66b34a(0x183)][_0x66b34a(0x199)]+_0x66b34a(0x194)+_0x3cc572[_0x66b34a(0x191)]};}};function a137_0x3bd9(){const _0x231d46=['validation','push','resourceCodes','access','POST','menu-grant','PAGE','7OkgNzt','189992WAiHRw','135176zdYmzD','role-menus-set','flagMissing','get','Run\x20`permit\x20role-menus\x20--role\x20<id>`\x20to\x20see\x20valid\x20resourceCodes.','menu-revoke','4214430DFKaDM','roleName','50uZaLCS','appCode','\x20menu\x20permit(s)\x20for\x20role\x20','has','Pass\x20--menus\x20<resourceCode,...>.','Updated\x20','Grant\x20or\x20revoke\x20a\x20role\x27s\x20menu\x20access\x20by\x20resourceCode\x20(roleType\x20PAGE);\x20requires\x20--yes','length','action','5jKkhHm','118357IaaOxv','permit','978BgOgeA','Unknown\x20menu\x20resourceCode(s):\x20','1062162pqVQHI','filter','menus','117csWhYx','/smartapi/permit/role/update','266634boszEt'];a137_0x3bd9=function(){return _0x231d46;};return a137_0x3bd9();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a138_0x4fa62c=a138_0x3b99;(function(_0x70432e,_0x53393a){const _0x459552=a138_0x3b99,_0x18d3b6=_0x70432e();while(!![]){try{const _0x2ce3bf=parseInt(_0x459552(0xa3))/0x1*(-parseInt(_0x459552(0xa4))/0x2)+-parseInt(_0x459552(0x9d))/0x3+parseInt(_0x459552(0xa9))/0x4+parseInt(_0x459552(0xa8))/0x5+parseInt(_0x459552(0x96))/0x6*(parseInt(_0x459552(0xaa))/0x7)+parseInt(_0x459552(0xa5))/0x8+-parseInt(_0x459552(0x93))/0x9;if(_0x2ce3bf===_0x53393a)break;else _0x18d3b6['push'](_0x18d3b6['shift']());}catch(_0x95f670){_0x18d3b6['push'](_0x18d3b6['shift']());}}}(a138_0x3732,0x4b98d));import{getRoleMenuResources}from'../../core/api-client.js';import{APPCODE_FLAG_OPTIONAL}from'../../commands/common/flags.js';import{flattenMenuResources,readRoleRef,ROLE_REF_FLAG}from'../../commands/permit/shared.js';function a138_0x3b99(_0x296f7e,_0x5f41bd){_0x296f7e=_0x296f7e-0x93;const _0x3732d2=a138_0x3732();let _0x3b994f=_0x3732d2[_0x296f7e];return _0x3b994f;}import{resolveRoleRef}from'../../commands/role/shared.js';function a138_0x3732(){const _0x3f73f8=['resourceCode','2255005aEohvh','1208784nfbSAh','1585647vaqKxo','4290480dPBWDA','filter','from','12zircSK','length','access','\x20has\x20','roleName','action','Show\x20a\x20role\x27s\x20current\x20menu\x20permission\x20matrix','922329iqPPRJ','Role\x20','appCode','read','\x20menu(s)\x20allowed','map','54596UhBBcu','6IOhmQc','410856DEFYAu','allowed'];a138_0x3732=function(){return _0x3f73f8;};return a138_0x3732();}export const permitRoleMenus={'service':'permit','command':'role-menus','description':a138_0x4fa62c(0x9c),'risk':a138_0x4fa62c(0xa0),'flags':[ROLE_REF_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x15ff4a){const _0x4b1729=a138_0x4fa62c,_0x74d2ad=await resolveRoleRef(_0x15ff4a[_0x4b1729(0x9f)],readRoleRef(_0x15ff4a)),_0x1f7661=await getRoleMenuResources(_0x15ff4a[_0x4b1729(0x9f)],_0x74d2ad['id']),_0x583ac0=flattenMenuResources(_0x1f7661),_0x199b78=Array[_0x4b1729(0x95)](_0x583ac0['values']())[_0x4b1729(0xa2)](_0x186e90=>({'resourceCode':_0x186e90[_0x4b1729(0xa7)],'resourceName':_0x186e90['resourceName'],'allowed':_0x186e90[_0x4b1729(0x9b)]===_0x4b1729(0x98),'action':_0x186e90[_0x4b1729(0x9b)]}));return{'ok':!![],'data':{'selector':{'appCode':_0x15ff4a['appCode'],'roleId':_0x74d2ad['id'],'roleName':_0x74d2ad[_0x4b1729(0x9a)]},'menus':_0x199b78},'message':_0x4b1729(0x9e)+_0x74d2ad[_0x4b1729(0x9a)]+_0x4b1729(0x99)+_0x199b78[_0x4b1729(0x94)](_0x34cc59=>_0x34cc59[_0x4b1729(0xa6)])['length']+'/'+_0x199b78[_0x4b1729(0x97)]+_0x4b1729(0xa1)};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a139_0x132a8c=a139_0x9be5;(function(_0x212423,_0x1dd80e){const _0x10d460=a139_0x9be5,_0x119592=_0x212423();while(!![]){try{const _0x4e5bc9=-parseInt(_0x10d460(0x186))/0x1+parseInt(_0x10d460(0x162))/0x2*(-parseInt(_0x10d460(0x16d))/0x3)+-parseInt(_0x10d460(0x1a2))/0x4+parseInt(_0x10d460(0x1a6))/0x5+parseInt(_0x10d460(0x17b))/0x6+parseInt(_0x10d460(0x16e))/0x7*(parseInt(_0x10d460(0x15f))/0x8)+-parseInt(_0x10d460(0x173))/0x9*(-parseInt(_0x10d460(0x18d))/0xa);if(_0x4e5bc9===_0x1dd80e)break;else _0x119592['push'](_0x119592['shift']());}catch(_0x185979){_0x119592['push'](_0x119592['shift']());}}}(a139_0x288a,0x29931));import{listPermitRoles}from'../../core/api-client.js';function a139_0x9be5(_0x1e5d07,_0x36baa1){_0x1e5d07=_0x1e5d07-0x15d;const _0x288af8=a139_0x288a();let _0x9be578=_0x288af8[_0x1e5d07];return _0x9be578;}import{CliErrors}from'../../errors.js';function a139_0x288a(){const _0x3e5835=['apiList','306388gdyPTO','ALL','menu-id','find','--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.','str','Run\x20`role\x20list`.','10pXJGsg','validation','data\x20update','detail-roles','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','bool','trim','dataCreate','rolePermit','Role\x20\x22',';\x20SELF\x20=\x20only\x20own\x20rows','data\x20delete','\x22\x20not\x20found.','pageNodeList','Pass\x20--role\x20<id|name>.','test','Grant\x20access\x20to\x20the\x20listed\x20resources','dataUpdate','split','flag','key','817696yqZNNx','map','row-roles','length','1368835AifqPF','role','menuPermit','roleType','Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for','menu\x20visibility','Menu\x20id\x20(from\x20`menu\x20list`)','access','SELF','menu-roles','number','resourceCode','dataPermit','Special\x20role\x20','8DCqhwp','datasets','create-roles','36454NcOdex','revoke','datasetCode','set','Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke','\x20not\x20found.','Role\x20id\x20','label','Disambiguate\x20with\x20an\x20id.','action','toUpperCase','51jnUdgX','437983oGMScj','resourceName','boolean','string','delete-roles','5075208xsBkHL','SELF\x20is\x20not\x20allowed\x20for\x20','update-roles','grant','allowedActions','appCode','export-roles','filter','544272izKHcU','menuId','Missing\x20action.','Role\x20id\x20or\x20role\x20name','entries','roleName','data\x20create','dataExport','dataDetail','get'];a139_0x288a=function(){return _0x3e5835;};return a139_0x288a();}export const MENU_ID_FLAG={'name':a139_0x132a8c(0x188),'type':a139_0x132a8c(0x1b0),'required':!![],'description':a139_0x132a8c(0x1ac)};export const ROLE_REF_FLAG={'name':'role','type':a139_0x132a8c(0x171),'required':!![],'description':a139_0x132a8c(0x17e)};export const GRANT_FLAG={'name':a139_0x132a8c(0x176),'type':'boolean','required':![],'description':a139_0x132a8c(0x19d)};export const REVOKE_FLAG={'name':'revoke','type':a139_0x132a8c(0x170),'required':![],'description':'Revoke\x20access\x20to\x20the\x20listed\x20resources'};export const MENUS_FLAG={'name':'menus','type':a139_0x132a8c(0x171),'required':!![],'description':a139_0x132a8c(0x166)};export const DATASETS_FLAG={'name':a139_0x132a8c(0x160),'type':a139_0x132a8c(0x171),'required':!![],'description':a139_0x132a8c(0x1aa)};export const PAGE_SLOT_SPECS=[{'flag':a139_0x132a8c(0x1af),'key':a139_0x132a8c(0x1a8),'allowSelf':![],'label':a139_0x132a8c(0x1ab)},{'flag':a139_0x132a8c(0x161),'key':a139_0x132a8c(0x194),'allowSelf':![],'label':a139_0x132a8c(0x181)},{'flag':a139_0x132a8c(0x175),'key':a139_0x132a8c(0x19e),'allowSelf':![],'label':a139_0x132a8c(0x18f)},{'flag':a139_0x132a8c(0x172),'key':'dataDelete','allowSelf':![],'label':a139_0x132a8c(0x198)},{'flag':a139_0x132a8c(0x190),'key':a139_0x132a8c(0x183),'allowSelf':![],'label':'data\x20detail'},{'flag':a139_0x132a8c(0x179),'key':a139_0x132a8c(0x182),'allowSelf':![],'label':'data\x20export'},{'flag':a139_0x132a8c(0x1a4),'key':a139_0x132a8c(0x15d),'allowSelf':!![],'label':'row\x20visibility'}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS[a139_0x132a8c(0x1a3)](_0x15dfcc=>({'name':_0x15dfcc[a139_0x132a8c(0x1a0)],'type':a139_0x132a8c(0x171),'required':![],'description':'Roles\x20for\x20'+_0x15dfcc[a139_0x132a8c(0x169)]+'\x20(comma-separated\x20SELF/ALL/id/name)'+(_0x15dfcc['allowSelf']?a139_0x132a8c(0x197):'')}));export function splitList(_0x5c049d){const _0x38fc2d=a139_0x132a8c;return _0x5c049d[_0x38fc2d(0x19f)](',')[_0x38fc2d(0x1a3)](_0x443646=>_0x443646['trim']())[_0x38fc2d(0x17a)](Boolean);}export function projectRoleRef(_0xbec2d1){const _0x5bc6d7=a139_0x132a8c;return{'id':_0xbec2d1['id'],'roleName':_0xbec2d1[_0x5bc6d7(0x180)],'roleType':_0xbec2d1['roleType']};}export async function resolvePermitRoles(_0x321e4c,_0x3a8b1a,_0x4c0f1c){const _0x44616f=a139_0x132a8c,_0x562f40=await listPermitRoles(_0x321e4c,{'needSelf':!![],'needPublic':!![]}),_0x4d3d59=[];for(const _0x5e6aed of _0x3a8b1a){const _0x1b37e5=resolveOnePermitRole(_0x562f40,_0x5e6aed);if(!_0x4c0f1c['allowSelf']&&_0x1b37e5['roleType']===_0x44616f(0x1ae))throw CliErrors[_0x44616f(0x18e)](_0x44616f(0x174)+_0x4c0f1c['label']+'.',_0x44616f(0x191));if(!_0x4d3d59['some'](_0x3baac7=>_0x3baac7['id']===_0x1b37e5['id']))_0x4d3d59['push'](_0x1b37e5);}return _0x4d3d59;}function resolveOnePermitRole(_0x20c12d,_0x1dd911){const _0x83aa8d=a139_0x132a8c,_0x42eb4a=_0x1dd911[_0x83aa8d(0x193)](),_0x1736e5=_0x42eb4a[_0x83aa8d(0x16c)]();if(_0x1736e5===_0x83aa8d(0x1ae)||_0x1736e5===_0x83aa8d(0x187)){const _0x2d3f1e=_0x20c12d[_0x83aa8d(0x189)](_0x5450de=>_0x5450de[_0x83aa8d(0x1a9)]===_0x1736e5);if(!_0x2d3f1e)throw CliErrors['validation'](_0x83aa8d(0x15e)+_0x1736e5+'\x20is\x20not\x20available\x20for\x20this\x20app.');return _0x2d3f1e;}if(/^-?\d+$/[_0x83aa8d(0x19c)](_0x42eb4a)){const _0x4c0c69=Number(_0x42eb4a),_0x29d8a0=_0x20c12d['find'](_0x3fc1ff=>_0x3fc1ff['id']===_0x4c0c69);if(!_0x29d8a0)throw CliErrors[_0x83aa8d(0x18e)](_0x83aa8d(0x168)+_0x4c0c69+_0x83aa8d(0x167),_0x83aa8d(0x18c));return _0x29d8a0;}const _0x3e054a=_0x20c12d['filter'](_0x345a77=>_0x345a77[_0x83aa8d(0x180)]===_0x42eb4a);if(_0x3e054a[_0x83aa8d(0x1a5)]===0x0)throw CliErrors[_0x83aa8d(0x18e)](_0x83aa8d(0x196)+_0x42eb4a+_0x83aa8d(0x199),'Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.');if(_0x3e054a[_0x83aa8d(0x1a5)]>0x1)throw CliErrors[_0x83aa8d(0x18e)]('Role\x20\x22'+_0x42eb4a+'\x22\x20is\x20ambiguous\x20(ids:\x20'+_0x3e054a[_0x83aa8d(0x1a3)](_0x128c92=>_0x128c92['id'])['join'](',\x20')+').',_0x83aa8d(0x16a));return _0x3e054a[0x0];}export function projectPageSlot(_0x471481){const _0x3ca6dd=a139_0x132a8c;if(!_0x471481)return null;return{'resourceCode':_0x471481[_0x3ca6dd(0x1b1)],'roles':(_0x471481[_0x3ca6dd(0x195)]??[])[_0x3ca6dd(0x1a3)](projectRoleRef)};}export function projectPagePermit(_0x47f66e){const _0xd1f568=a139_0x132a8c,_0x4a807e={'menuId':_0x47f66e[_0xd1f568(0x17c)],'appCode':_0x47f66e[_0xd1f568(0x178)],'menuPermit':projectPageSlot(_0x47f66e['menuPermit'])};for(const _0x1bab09 of PAGE_SLOT_SPECS){if(_0x1bab09[_0xd1f568(0x1a1)]==='menuPermit')continue;_0x4a807e[_0x1bab09[_0xd1f568(0x1a1)]]=projectPageSlot(_0x47f66e[_0x1bab09[_0xd1f568(0x1a1)]]);}return _0x4a807e;}export function flattenMenuResources(_0x4b8655){const _0x3c6d52=new Map(),_0x73145d=_0x1001aa=>{const _0x4a07e1=a139_0x9be5;for(const _0x15b996 of _0x1001aa??[]){_0x3c6d52[_0x4a07e1(0x165)](_0x15b996[_0x4a07e1(0x1b1)],{'resourceCode':_0x15b996[_0x4a07e1(0x1b1)],'resourceName':_0x15b996[_0x4a07e1(0x16f)],'action':_0x15b996[_0x4a07e1(0x177)]?.[0x0]??'0'});if(_0x15b996['pageNodeList'])_0x73145d(_0x15b996[_0x4a07e1(0x19a)]);}};return _0x73145d(_0x4b8655),_0x3c6d52;}export function flattenApiResources(_0x5da6ae){const _0x393306=a139_0x132a8c,_0x1cbe11=new Map(),_0x358adf=new Map();for(const _0x23800a of _0x5da6ae){const _0x452b94=_0x23800a[_0x393306(0x185)]??{};for(const [_0x417827,_0x2b6301]of Object[_0x393306(0x17f)](_0x452b94)){_0x1cbe11[_0x393306(0x165)](_0x417827,{'resourceCode':_0x417827,'resourceName':_0x23800a[_0x393306(0x16f)],'datasetCode':_0x23800a['datasetCode'],'action':_0x2b6301?.[0x0]??'0'});const _0x570b34=_0x358adf[_0x393306(0x184)](_0x23800a[_0x393306(0x164)])??[];_0x570b34['push'](_0x417827),_0x358adf['set'](_0x23800a[_0x393306(0x164)],_0x570b34);}}return{'byCode':_0x1cbe11,'byDataset':_0x358adf};}export function buildPermits(_0xbef186,_0x28cc41){const _0x5ba8a6=a139_0x132a8c,_0x258d60={};for(const [_0x12bdc2,_0x5a8658]of _0xbef186){const _0x24c57a=_0x28cc41[_0x5ba8a6(0x184)](_0x12bdc2)??_0x5a8658[_0x5ba8a6(0x16b)];_0x258d60[_0x12bdc2]=[_0x24c57a];}return _0x258d60;}export function readRoleRef(_0x3c8a98){const _0x32ac66=a139_0x132a8c,_0x47e389=_0x3c8a98[_0x32ac66(0x18b)](_0x32ac66(0x1a7))[_0x32ac66(0x193)]();if(!_0x47e389)throw CliErrors['flagMissing']('role',_0x32ac66(0x19b));return _0x47e389;}export function readGrantRevoke(_0x58d5ec){const _0x143891=a139_0x132a8c,_0x5be499=_0x58d5ec[_0x143891(0x192)]('grant'),_0x247760=_0x58d5ec[_0x143891(0x192)](_0x143891(0x163));if(_0x5be499&&_0x247760)throw CliErrors['validation'](_0x143891(0x18a));if(!_0x5be499&&!_0x247760)throw CliErrors[_0x143891(0x18e)](_0x143891(0x17d),'Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.');return _0x5be499?_0x143891(0x1ad):'0';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4b7d77,_0x394867){const _0x4fbf39=a140_0x26fb,_0x15231f=_0x4b7d77();while(!![]){try{const _0x4950b2=-parseInt(_0x4fbf39(0x181))/0x1+-parseInt(_0x4fbf39(0x17f))/0x2+-parseInt(_0x4fbf39(0x188))/0x3*(-parseInt(_0x4fbf39(0x18b))/0x4)+-parseInt(_0x4fbf39(0x17e))/0x5+-parseInt(_0x4fbf39(0x183))/0x6*(-parseInt(_0x4fbf39(0x18a))/0x7)+-parseInt(_0x4fbf39(0x185))/0x8+parseInt(_0x4fbf39(0x179))/0x9*(parseInt(_0x4fbf39(0x171))/0xa);if(_0x4950b2===_0x394867)break;else _0x15231f['push'](_0x15231f['shift']());}catch(_0x86c77c){_0x15231f['push'](_0x15231f['shift']());}}}(a140_0x19a5,0x5206b));import{existsSync}from'node:fs';import a140_0x33a9b8 from'node:path';import a140_0x23802b from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';function a140_0x19a5(){const _0x3fdc3c=['No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','1586564MVxUuC','37048bEvbWi','test','resolve','Project\x20name:','Directory\x20\x22','√\x20Project\x20Name:\x20','10bGSgyt','trim','length','√\x20App\x20Code:\x20','Project\x20name\x20cannot\x20exceed\x2050\x20characters','my-app','Login\x20failed','cyan','9465174IQnSLZ','Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_','production','Skipped','Not\x20set','2660930HXFgyf','63676VVjgUh','√\x20Login\x20status:\x20','448880ARmnOS','log','12qGMsOs','env','1693432SCwTva','cwd','green','18NNbeGB'];a140_0x19a5=function(){return _0x3fdc3c;};return a140_0x19a5();}import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';function a140_0x26fb(_0x2a6a4f,_0x178a41){_0x2a6a4f=_0x2a6a4f-0x171;const _0x19a5f3=a140_0x19a5();let _0x26fbec=_0x19a5f3[_0x2a6a4f];return _0x26fbec;}import{selectSingleAppcode}from'../../../commands/common/app-selector.js';export async function guidedCreateProject(_0x418164,_0x165665,_0x6f7a1){const _0x1790f5=a140_0x26fb,_0x3521d5=_0x1790f5(0x176),_0x3ec7e8=readConfig(),_0x72d472=typeof _0x3ec7e8[_0x1790f5(0x184)]==='string'?_0x3ec7e8[_0x1790f5(0x184)]:undefined,_0x70c89d=await input({'message':_0x1790f5(0x18e),'default':_0x3521d5,'validate':_0x4c92ef=>{const _0x46b7cc=_0x1790f5,_0x5cd811=_0x4c92ef[_0x46b7cc(0x172)]()||_0x3521d5;if(_0x5cd811[_0x46b7cc(0x173)]>0x32)return _0x46b7cc(0x175);const _0x640c4a=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x5cd811&&!_0x640c4a[_0x46b7cc(0x18c)](_0x5cd811))return _0x46b7cc(0x17a);const _0x5b3b64=a140_0x33a9b8[_0x46b7cc(0x18d)](process[_0x46b7cc(0x186)](),_0x5cd811);if(existsSync(_0x5b3b64))return _0x46b7cc(0x18f)+_0x5cd811+'\x22\x20already\x20exists';return!![];}});console[_0x1790f5(0x182)](a140_0x23802b['green'](_0x1790f5(0x190)+a140_0x23802b[_0x1790f5(0x178)](_0x70c89d)));const _0xd84084=await selectSingleAppcode(_0x6f7a1);console[_0x1790f5(0x182)](a140_0x23802b[_0x1790f5(0x187)](_0x1790f5(0x174)+a140_0x23802b[_0x1790f5(0x178)](_0xd84084||_0x1790f5(0x17d))));if(_0xd84084){const _0x1994a4=await getIsSessionValid();if(!_0x1994a4){const _0x2f7e78=await confirm({'message':_0x1790f5(0x189),'default':!![]});if(_0x2f7e78){const _0x4fab87=await authServer({'silent':!![]});console['log'](a140_0x23802b[_0x1790f5(0x187)]('√\x20Login\x20status:\x20'+a140_0x23802b[_0x1790f5(0x178)](_0x4fab87?'Logged\x20in':_0x1790f5(0x177))));}else console['log'](a140_0x23802b[_0x1790f5(0x187)](_0x1790f5(0x180)+a140_0x23802b[_0x1790f5(0x178)](_0x1790f5(0x17c))));}await _0x418164({'projectName':_0x70c89d,'appCode':_0xd84084,'env':_0x165665||_0x72d472||'production'});}else await _0x418164({'projectName':_0x70c89d,'env':_0x165665||_0x72d472||_0x1790f5(0x17b)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x5793cf,_0x12b57f){const _0x39eb1c=a141_0x34f4,_0x173c74=_0x5793cf();while(!![]){try{const _0x1c4f09=parseInt(_0x39eb1c(0x92))/0x1+-parseInt(_0x39eb1c(0x8c))/0x2*(parseInt(_0x39eb1c(0x8b))/0x3)+-parseInt(_0x39eb1c(0x89))/0x4*(-parseInt(_0x39eb1c(0x88))/0x5)+parseInt(_0x39eb1c(0x8a))/0x6+-parseInt(_0x39eb1c(0x93))/0x7*(-parseInt(_0x39eb1c(0x95))/0x8)+-parseInt(_0x39eb1c(0x90))/0x9*(parseInt(_0x39eb1c(0x8e))/0xa)+-parseInt(_0x39eb1c(0x91))/0xb*(parseInt(_0x39eb1c(0x8f))/0xc);if(_0x1c4f09===_0x12b57f)break;else _0x173c74['push'](_0x173c74['shift']());}catch(_0x25b599){_0x173c74['push'](_0x173c74['shift']());}}}(a141_0x3446,0xd0676));export function formatElapsed(_0x22919f){const _0x1c8ba6=a141_0x34f4,_0x2b2278=Date[_0x1c8ba6(0x8d)]()-_0x22919f;if(_0x2b2278<0x3e8)return _0x2b2278+'ms';const _0x373c98=(_0x2b2278/0x3e8)[_0x1c8ba6(0x94)](0x2),_0x25a317=_0x373c98['replace'](/\.?0+$/u,'');return _0x25a317+'s';}function a141_0x34f4(_0x227cab,_0x2f2d6b){_0x227cab=_0x227cab-0x88;const _0x34463a=a141_0x3446();let _0x34f4fa=_0x34463a[_0x227cab];return _0x34f4fa;}function a141_0x3446(){const _0x232a03=['25wroYJn','906532tEnpBA','9738174IAwFcl','28494MmMIia','130VMnnHM','now','20SVlmsw','12aJjhqp','4235571YpAoUI','32883004xaIYBC','1635941NYVtue','3941pJuolI','toFixed','14344pkjfYe'];a141_0x3446=function(){return _0x232a03;};return a141_0x3446();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2ba51d,_0x488b42){const _0xb0f4b0=a134_0x23ef,_0x717eef=_0x2ba51d();while(!![]){try{const _0x550cf6=parseInt(_0xb0f4b0(0x200))/0x1*(parseInt(_0xb0f4b0(0x1ec))/0x2)+parseInt(_0xb0f4b0(0x22a))/0x3*(parseInt(_0xb0f4b0(0x1e0))/0x4)+parseInt(_0xb0f4b0(0x22d))/0x5+-parseInt(_0xb0f4b0(0x21a))/0x6+-parseInt(_0xb0f4b0(0x1e3))/0x7*(-parseInt(_0xb0f4b0(0x214))/0x8)+-parseInt(_0xb0f4b0(0x1fe))/0x9+-parseInt(_0xb0f4b0(0x1fa))/0xa*(parseInt(_0xb0f4b0(0x222))/0xb);if(_0x550cf6===_0x488b42)break;else _0x717eef['push'](_0x717eef['shift']());}catch(_0x3aa210){_0x717eef['push'](_0x717eef['shift']());}}}(a134_0x2037,0x68ab3));import a134_0x54649b from'path';import a134_0x43768b from'fs';function a134_0x23ef(_0xfb2aaa,_0xd0d476){_0xfb2aaa=_0xfb2aaa-0x1cc;const _0x2037aa=a134_0x2037();let _0x23ef13=_0x2037aa[_0xfb2aaa];return _0x23ef13;}import a134_0x414975 from'chalk';import a134_0x16be23 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{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';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';function a134_0x2037(){const _0x394800=['projectName','create','\x20model(s)','cwd','更新\x20package.json\x20name','4nwCIsV','cyan','parse','174475coBmsq','production','清理项目目录失败:\x20','stringify','√\x20Configuration\x20file\x20created,\x20Apps:\x20','existsSync','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','repeat','trim','2906MxygXC','🚀\x20Next\x20Steps:','env','error','API\x20配置拉取异常','warn','bold','package.json','fail','readFileSync','Install\x20dependencies','W_OK','needsUpgrade','配置应用AppCode失败','20FjoTAy','更新\x20package.json\x20失败','Project\x20directory\x20','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','9900CeRcyr','toLocaleString','562rawqvW','\x20|\x20Default:\x20','\x20dataset(s),\x20generated\x20','apps','stableVersion','\x20\x201.\x20Start\x20project:\x20','Format\x20code','resolve','*\x20Pulling\x20API\x20configuration...','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','success','\x20run\x20start','*\x20Configuring\x20AppCode\x20for\x20project\x20','belowMinimum','modelCount','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','join','projectCode','CLI\x20版本检查','224BXbKdd','writeFileSync','setLogPath','accessSync','\x20\x202.\x20Pull\x20API\x20configuration:\x20','start','2381904LebzdB','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','defaultApp','appCode','API\x20configuration\x20pulled:\x20','\x20api\x20pull','\x20config\x20set\x20appcode\x20<app-code>\x27','1.0.0','7357009yDhidU','description','Project\x20name\x20cannot\x20be\x20empty','\x20|\x20AppCode:\x20','version','项目创建失败:\x20','utf8','项目创建完成:\x20','188955LbwwOG','\x20&&\x20','√\x20Pulled\x20','2934870WcpiMX','green','\x20√\x20','配置应用AppCode:\x20','√\x20package.json\x20updated:\x20name=','开始创建项目:\x20','length','keys','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','cookie','chdir','gray','log','...','message','info'];a134_0x2037=function(){return _0x394800;};return a134_0x2037();}import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x1e887f){const _0x34a7b8=a134_0x23ef,_0x3dc0b5=await checkCliVersion();(_0x3dc0b5[_0x34a7b8(0x1f8)]||_0x3dc0b5[_0x34a7b8(0x20d)])&&(printCliUpgradeWarning(_0x3dc0b5),assertCliVersionSupported(_0x3dc0b5),logger['info'](_0x34a7b8(0x1dc),_0x34a7b8(0x213),{'currentVersion':_0x3dc0b5['currentVersion'],'stableVersion':_0x3dc0b5[_0x34a7b8(0x204)],'minimumVersion':_0x3dc0b5['minimumVersion'],'needsUpgrade':_0x3dc0b5['needsUpgrade'],'belowMinimum':_0x3dc0b5[_0x34a7b8(0x20d)]}));if(_0x1e887f[_0x34a7b8(0x212)]&&_0x1e887f[_0x34a7b8(0x21d)])await runCreate({'projectName':_0x1e887f[_0x34a7b8(0x212)],'appCode':_0x1e887f[_0x34a7b8(0x21d)],'env':_0x1e887f[_0x34a7b8(0x1ee)]},_0x1e887f);else{if(_0x1e887f[_0x34a7b8(0x212)]){const _0x55f8ca=await selectSingleAppcode(_0x1e887f[_0x34a7b8(0x1d4)]);await runCreate({'projectName':_0x1e887f[_0x34a7b8(0x212)],'appCode':_0x55f8ca||undefined,'env':_0x1e887f[_0x34a7b8(0x1ee)]},_0x1e887f);}else await guidedCreateProject(_0x45db3b=>runCreate(_0x45db3b,_0x1e887f),_0x1e887f['env'],_0x1e887f['cookie']);}}async function runCreate(_0x3bfd4d,_0x789576){const _0x1103dd=a134_0x23ef;if(!_0x3bfd4d[_0x1103dd(0x1db)]||_0x3bfd4d[_0x1103dd(0x1db)][_0x1103dd(0x1eb)]()==='')throw new Error(_0x1103dd(0x224));const _0x22d8a4=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x22d8a4['test'](_0x3bfd4d[_0x1103dd(0x1db)]))throw new Error(_0x1103dd(0x1fd));if(_0x3bfd4d[_0x1103dd(0x1db)]['length']>0x64)throw new Error(_0x1103dd(0x20f));const _0x149045=a134_0x54649b[_0x1103dd(0x207)](process['cwd'](),_0x3bfd4d['projectName']);if(a134_0x43768b['existsSync'](_0x149045))throw new Error(_0x1103dd(0x1fc)+_0x3bfd4d[_0x1103dd(0x1db)]+'\x20already\x20exists');try{a134_0x43768b[_0x1103dd(0x217)](a134_0x54649b['dirname'](_0x149045),a134_0x43768b['constants'][_0x1103dd(0x1f7)]);}catch{throw new Error(_0x1103dd(0x1e9));}logger[_0x1103dd(0x216)](_0x149045),logger['info']('create',_0x1103dd(0x1d0)+_0x3bfd4d[_0x1103dd(0x1db)],{'projectDir':_0x149045,'appCode':_0x3bfd4d[_0x1103dd(0x21d)]}),console['log'](),console[_0x1103dd(0x1d7)](a134_0x414975[_0x1103dd(0x1cc)](_0x1103dd(0x1cd))+'Project\x20name:\x20'+a134_0x414975[_0x1103dd(0x1cc)](_0x3bfd4d[_0x1103dd(0x1db)])+(_0x3bfd4d[_0x1103dd(0x21d)]?_0x1103dd(0x225)+a134_0x414975[_0x1103dd(0x1e1)](_0x3bfd4d[_0x1103dd(0x21d)]):''));try{await runTask('Copy\x20project\x20files',()=>copyProjectTemplate(_0x3bfd4d[_0x1103dd(0x1db)])),await updatePackageJsonName(_0x3bfd4d[_0x1103dd(0x1db)]),await runTask(_0x1103dd(0x1f6),()=>installDependencies(_0x3bfd4d[_0x1103dd(0x1db)])),await runTask(_0x1103dd(0x206),()=>formatProjectCode(_0x3bfd4d[_0x1103dd(0x1db)])),await configureAppCode(_0x3bfd4d['projectName'],_0x3bfd4d['appCode']||'',_0x3bfd4d[_0x1103dd(0x1ee)]);let _0x33a75f=![];if(_0x3bfd4d[_0x1103dd(0x21d)]){console[_0x1103dd(0x1d7)](_0x1103dd(0x208));const _0x50e22d=process['cwd']();try{process[_0x1103dd(0x1d5)](_0x149045);const _0xe241a5=_0x3bfd4d[_0x1103dd(0x1ee)]||_0x1103dd(0x1e4);initEnv(_0xe241a5);const {configArray:_0x1f4694}=await fetchModelList(_0x3bfd4d[_0x1103dd(0x21d)],_0x789576[_0x1103dd(0x1d4)]||''),_0x39787=DEFAULT_API_DIR,_0x4ff1f2=await generateApiFile(_0x1f4694,'',_0x3bfd4d[_0x1103dd(0x21d)],!![],_0xe241a5,_0x39787);console['log'](_0x1103dd(0x22c)+_0x1f4694[_0x1103dd(0x1d1)]+_0x1103dd(0x202)+_0x4ff1f2[_0x1103dd(0x20e)]+_0x1103dd(0x1dd)),logger['info']('create',_0x1103dd(0x21e)+_0x3bfd4d['appCode']);}catch(_0x247721){_0x33a75f=!![],console[_0x1103dd(0x1d7)](_0x1103dd(0x209)),logger['warn']('create',_0x1103dd(0x1f0),{'error':_0x247721 instanceof Error?_0x247721['message']:String(_0x247721)});}finally{process[_0x1103dd(0x1d5)](_0x50e22d);}}logger[_0x1103dd(0x20a)](_0x1103dd(0x1dc),_0x1103dd(0x229)+_0x3bfd4d[_0x1103dd(0x1db)]),console[_0x1103dd(0x1d7)](),console['log'](a134_0x414975[_0x1103dd(0x1cc)]('─'[_0x1103dd(0x1ea)](0x3c))),console[_0x1103dd(0x1d7)](a134_0x414975['cyan'][_0x1103dd(0x1f2)](_0x1103dd(0x1ed))),console[_0x1103dd(0x1d7)](),console[_0x1103dd(0x1d7)](_0x1103dd(0x205)+a134_0x414975[_0x1103dd(0x1e1)][_0x1103dd(0x1f2)]('cd\x20'+_0x3bfd4d[_0x1103dd(0x1db)]+_0x1103dd(0x22b)+CLI_BIN_NAME+_0x1103dd(0x20b))),_0x33a75f&&console['log'](_0x1103dd(0x218)+a134_0x414975[_0x1103dd(0x1e1)][_0x1103dd(0x1f2)](CLI_BIN_NAME+_0x1103dd(0x21f))),console['log'](a134_0x414975[_0x1103dd(0x1cc)]('─'[_0x1103dd(0x1ea)](0x3c)));}catch(_0x58cdc8){logger['error']('create',_0x1103dd(0x227)+_0x3bfd4d['projectName'],{'error':_0x58cdc8 instanceof Error?_0x58cdc8[_0x1103dd(0x1d9)]:String(_0x58cdc8)});try{a134_0x43768b[_0x1103dd(0x1e8)](_0x149045)&&(console[_0x1103dd(0x1d7)](_0x1103dd(0x1d3)+_0x149045),a134_0x43768b['rmSync'](_0x149045,{'recursive':!![],'force':!![]}));}catch{logger[_0x1103dd(0x1f1)](_0x1103dd(0x1dc),_0x1103dd(0x1e5)+_0x149045);}throw _0x58cdc8;}}async function runTask(_0x3413ff,_0x261cb0){const _0x272535=a134_0x23ef,_0x4cb933=a134_0x16be23(_0x3413ff+_0x272535(0x1d8))[_0x272535(0x219)]();try{const _0x24b219=await _0x261cb0();_0x4cb933['stop'](),console[_0x272535(0x1d7)](''+a134_0x414975[_0x272535(0x1cc)](_0x272535(0x1cd))+_0x3413ff+'\x20'+a134_0x414975[_0x272535(0x1d6)]('['+_0x24b219+']'));}catch(_0x38dc6c){_0x4cb933[_0x272535(0x1f4)](_0x3413ff);throw _0x38dc6c;}}async function updatePackageJsonName(_0x43fc17){const _0xb4f46d=a134_0x23ef,_0x523c02=a134_0x54649b[_0xb4f46d(0x207)](process[_0xb4f46d(0x1de)](),_0x43fc17),_0x1621ce=a134_0x54649b[_0xb4f46d(0x211)](_0x523c02,_0xb4f46d(0x1f3));try{console[_0xb4f46d(0x1d7)](_0xb4f46d(0x210));const _0x5537f8=getRabetbaseCliPackageRoot(),_0x3ee268=a134_0x54649b['join'](_0x5537f8,_0xb4f46d(0x1f3));let _0x5aafeb='1.0.0';try{const _0x50f6e8=JSON[_0xb4f46d(0x1e2)](a134_0x43768b['readFileSync'](_0x3ee268,_0xb4f46d(0x228)));_0x5aafeb=_0x50f6e8[_0xb4f46d(0x226)]||_0xb4f46d(0x221);}catch{}const _0x386e9e=a134_0x43768b['readFileSync'](_0x1621ce,_0xb4f46d(0x228)),_0x5f3546=JSON['parse'](_0x386e9e);_0x5f3546['name']=_0x43fc17,_0x5f3546[_0xb4f46d(0x223)]=_0x43fc17+'\x20Generated\x20by\x20rabetbase\x20cli\x20'+_0x5aafeb,a134_0x43768b[_0xb4f46d(0x215)](_0x1621ce,JSON[_0xb4f46d(0x1e6)](_0x5f3546,null,0x2)+'\x0a','utf8'),console[_0xb4f46d(0x1d7)](_0xb4f46d(0x1cf)+_0x43fc17),logger[_0xb4f46d(0x1da)](_0xb4f46d(0x1dc),_0xb4f46d(0x1df));}catch(_0x5f5491){logger['error'](_0xb4f46d(0x1dc),_0xb4f46d(0x1fb));throw _0x5f5491;}}async function configureAppCode(_0x203d92,_0x5ebe1c,_0x429149){const _0x41b7be=a134_0x23ef,_0x4180be=a134_0x54649b['resolve'](process[_0x41b7be(0x1de)](),_0x203d92),_0x19b422=a134_0x54649b[_0x41b7be(0x211)](_0x4180be,NEW_CONFIG_NAME);try{_0x5ebe1c?console[_0x41b7be(0x1d7)](_0x41b7be(0x20c)+_0x203d92+':\x20'+_0x5ebe1c):console[_0x41b7be(0x1d7)]('*\x20Creating\x20configuration\x20file\x20for\x20project\x20'+_0x203d92);const _0x3260b7=getRabetbaseCliPackageRoot(),_0x39619f=a134_0x54649b['join'](_0x3260b7,'package.json');let _0x79be45=_0x41b7be(0x221);try{const _0x23fb7f=JSON['parse'](a134_0x43768b[_0x41b7be(0x1f5)](_0x39619f,_0x41b7be(0x228)));_0x79be45=_0x23fb7f[_0x41b7be(0x226)]||'1.0.0';}catch{}const _0x25cd7c=readConfig(),_0x3f99a6=typeof _0x25cd7c[_0x41b7be(0x1ee)]==='string'?_0x25cd7c['env']:undefined,_0x123e8b={};for(const _0x18f86d of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x25cd7c[_0x18f86d]!=null)_0x123e8b[_0x18f86d]=_0x25cd7c[_0x18f86d];}const _0xba0c29=buildCanonicalProjectConfig(_0x123e8b,{'appCodes':_0x5ebe1c?[_0x5ebe1c]:[],'env':_0x429149||_0x3f99a6||_0x41b7be(0x1e4),'metadata':{'createdAt':new Date()[_0x41b7be(0x1ff)](),'version':_0x79be45}});writeConfigFile(_0x19b422,_0xba0c29),_0x5ebe1c?console[_0x41b7be(0x1d7)](_0x41b7be(0x1e7)+Object[_0x41b7be(0x1d2)](_0xba0c29[_0x41b7be(0x203)]||{})[_0x41b7be(0x211)](',\x20')+_0x41b7be(0x201)+_0xba0c29[_0x41b7be(0x21c)]):console[_0x41b7be(0x1d7)](_0x41b7be(0x21b)+CLI_BIN_NAME+_0x41b7be(0x220)),logger[_0x41b7be(0x1da)]('create',_0x41b7be(0x1ce)+_0x5ebe1c);}catch(_0x4f54ed){logger[_0x41b7be(0x1ef)](_0x41b7be(0x1dc),_0x41b7be(0x1f9));}}
|
|
1
|
+
(function(_0xd1962b,_0x2c7899){const _0x4bb57c=a142_0x1ca8,_0x110fe8=_0xd1962b();while(!![]){try{const _0x588eea=parseInt(_0x4bb57c(0x1fc))/0x1+parseInt(_0x4bb57c(0x1c9))/0x2+parseInt(_0x4bb57c(0x1cd))/0x3*(-parseInt(_0x4bb57c(0x202))/0x4)+-parseInt(_0x4bb57c(0x1b8))/0x5*(-parseInt(_0x4bb57c(0x1e3))/0x6)+parseInt(_0x4bb57c(0x1b4))/0x7*(parseInt(_0x4bb57c(0x1e2))/0x8)+parseInt(_0x4bb57c(0x206))/0x9*(parseInt(_0x4bb57c(0x1fd))/0xa)+parseInt(_0x4bb57c(0x1d9))/0xb*(-parseInt(_0x4bb57c(0x1f6))/0xc);if(_0x588eea===_0x2c7899)break;else _0x110fe8['push'](_0x110fe8['shift']());}catch(_0x2b13d8){_0x110fe8['push'](_0x110fe8['shift']());}}}(a142_0x2913,0x1cc43));import a142_0x346fd5 from'path';import a142_0x1b7ea0 from'fs';import a142_0x5394ff from'chalk';import a142_0x1349c9 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{readConfig}from'../../../utils/config.js';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{copyProjectTemplate}from'../../../commands/project/create/use-copy-project-template.js';import{installDependencies}from'../../../commands/project/create/use-install-dependencies.js';import{formatProjectCode}from'../../../commands/project/create/use-format-code.js';import{logger}from'../../../utils/logger.js';function a142_0x2913(){const _0x50a6c9=['\x20|\x20AppCode:\x20','*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20','name','projectCode','version','length','warn','join','description','utf8','readFileSync','string','Copy\x20project\x20files','1.0.0','resolve','27276zgPnKB','projectName','appCode','\x20model(s)','log','√\x20package.json\x20updated:\x20name=','45080rwWhPP','20MVcRIC','√\x20Configuration\x20file\x20created,\x20Apps:\x20','dirname','cwd','message','4vqmmCc','配置应用AppCode失败','existsSync','repeat','1038051mXvKMt','trim','cookie','🚀\x20Next\x20Steps:','\x20config\x20set\x20appcode\x20<app-code>\x27','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','start','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','更新\x20package.json\x20name','326732UDkuod','cd\x20','\x20dataset(s),\x20generated\x20','\x20already\x20exists','1555aPQegj','\x20api\x20pull','更新\x20package.json\x20失败','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','needsUpgrade','apps','error','Project\x20name\x20cannot\x20be\x20empty','green','\x20run\x20start','cyan','belowMinimum','production','info','stringify','\x20\x201.\x20Start\x20project:\x20','env','1072gEFdoY','package.json','bold','API\x20配置拉取异常','3777WTtiXI','...','API\x20configuration\x20pulled:\x20','minimumVersion','\x20|\x20Default:\x20','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','*\x20Pulling\x20API\x20configuration...','modelCount','parse','chdir','Format\x20code','currentVersion','2123ZkiBAm','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','stop','Project\x20directory\x20','create','项目创建完成:\x20','defaultApp','gray','开始创建项目:\x20','8OszqFZ','4530nXyDLy','\x20Generated\x20by\x20rabetbase\x20cli\x20','*\x20Configuring\x20AppCode\x20for\x20project\x20','keys'];a142_0x2913=function(){return _0x50a6c9;};return a142_0x2913();}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';function a142_0x1ca8(_0x3d2639,_0x15ec65){_0x3d2639=_0x3d2639-0x1ae;const _0x29139f=a142_0x2913();let _0x1ca867=_0x29139f[_0x3d2639];return _0x1ca867;}import{getRabetbaseCliPackageRoot}from'../../../commands/project/create/project-template-path.js';export async function createApp(_0x1af98c){const _0x40403c=a142_0x1ca8,_0x1b5b3e=await checkCliVersion();(_0x1b5b3e[_0x40403c(0x1bc)]||_0x1b5b3e[_0x40403c(0x1c3)])&&(printCliUpgradeWarning(_0x1b5b3e),assertCliVersionSupported(_0x1b5b3e),logger[_0x40403c(0x1c5)](_0x40403c(0x1dd),'CLI\x20版本检查',{'currentVersion':_0x1b5b3e[_0x40403c(0x1d8)],'stableVersion':_0x1b5b3e['stableVersion'],'minimumVersion':_0x1b5b3e[_0x40403c(0x1d0)],'needsUpgrade':_0x1b5b3e[_0x40403c(0x1bc)],'belowMinimum':_0x1b5b3e[_0x40403c(0x1c3)]}));if(_0x1af98c[_0x40403c(0x1ea)]&&_0x1af98c[_0x40403c(0x1f8)])await runCreate({'projectName':_0x1af98c[_0x40403c(0x1ea)],'appCode':_0x1af98c[_0x40403c(0x1f8)],'env':_0x1af98c[_0x40403c(0x1c8)]},_0x1af98c);else{if(_0x1af98c[_0x40403c(0x1ea)]){const _0x187e87=await selectSingleAppcode(_0x1af98c['cookie']);await runCreate({'projectName':_0x1af98c[_0x40403c(0x1ea)],'appCode':_0x187e87||undefined,'env':_0x1af98c[_0x40403c(0x1c8)]},_0x1af98c);}else await guidedCreateProject(_0x324760=>runCreate(_0x324760,_0x1af98c),_0x1af98c[_0x40403c(0x1c8)],_0x1af98c[_0x40403c(0x208)]);}}async function runCreate(_0x51d397,_0x2c9cb6){const _0x432ca1=a142_0x1ca8;if(!_0x51d397[_0x432ca1(0x1f7)]||_0x51d397[_0x432ca1(0x1f7)][_0x432ca1(0x207)]()==='')throw new Error(_0x432ca1(0x1bf));const _0x588ae3=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x588ae3['test'](_0x51d397['projectName']))throw new Error(_0x432ca1(0x1b0));if(_0x51d397['projectName'][_0x432ca1(0x1ec)]>0x64)throw new Error('Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters');const _0x155a5e=a142_0x346fd5['resolve'](process[_0x432ca1(0x200)](),_0x51d397[_0x432ca1(0x1f7)]);if(a142_0x1b7ea0[_0x432ca1(0x204)](_0x155a5e))throw new Error(_0x432ca1(0x1dc)+_0x51d397[_0x432ca1(0x1f7)]+_0x432ca1(0x1b7));try{a142_0x1b7ea0['accessSync'](a142_0x346fd5[_0x432ca1(0x1ff)](_0x155a5e),a142_0x1b7ea0['constants']['W_OK']);}catch{throw new Error(_0x432ca1(0x1b2));}logger['setLogPath'](_0x155a5e),logger[_0x432ca1(0x1c5)](_0x432ca1(0x1dd),_0x432ca1(0x1e1)+_0x51d397[_0x432ca1(0x1f7)],{'projectDir':_0x155a5e,'appCode':_0x51d397[_0x432ca1(0x1f8)]}),console[_0x432ca1(0x1fa)](),console[_0x432ca1(0x1fa)](a142_0x5394ff['green']('\x20√\x20')+'Project\x20name:\x20'+a142_0x5394ff['green'](_0x51d397['projectName'])+(_0x51d397[_0x432ca1(0x1f8)]?_0x432ca1(0x1e7)+a142_0x5394ff[_0x432ca1(0x1c2)](_0x51d397[_0x432ca1(0x1f8)]):''));try{await runTask(_0x432ca1(0x1f3),()=>copyProjectTemplate(_0x51d397[_0x432ca1(0x1f7)])),await updatePackageJsonName(_0x51d397[_0x432ca1(0x1f7)]),await runTask('Install\x20dependencies',()=>installDependencies(_0x51d397[_0x432ca1(0x1f7)])),await runTask(_0x432ca1(0x1d7),()=>formatProjectCode(_0x51d397[_0x432ca1(0x1f7)])),await configureAppCode(_0x51d397[_0x432ca1(0x1f7)],_0x51d397[_0x432ca1(0x1f8)]||'',_0x51d397[_0x432ca1(0x1c8)]);let _0x3c5f73=![];if(_0x51d397[_0x432ca1(0x1f8)]){console['log'](_0x432ca1(0x1d3));const _0xf8b985=process[_0x432ca1(0x200)]();try{process[_0x432ca1(0x1d6)](_0x155a5e);const _0x321a69=_0x51d397['env']||_0x432ca1(0x1c4);initEnv(_0x321a69);const {configArray:_0x514a49}=await fetchModelList(_0x51d397[_0x432ca1(0x1f8)],_0x2c9cb6[_0x432ca1(0x208)]||''),_0x98e66b=DEFAULT_API_DIR,_0x2ef20d=await generateApiFile(_0x514a49,'',_0x51d397[_0x432ca1(0x1f8)],!![],_0x321a69,_0x98e66b);console[_0x432ca1(0x1fa)]('√\x20Pulled\x20'+_0x514a49[_0x432ca1(0x1ec)]+_0x432ca1(0x1b6)+_0x2ef20d[_0x432ca1(0x1d4)]+_0x432ca1(0x1f9)),logger[_0x432ca1(0x1c5)](_0x432ca1(0x1dd),_0x432ca1(0x1cf)+_0x51d397['appCode']);}catch(_0x4789f2){_0x3c5f73=!![],console[_0x432ca1(0x1fa)](_0x432ca1(0x1d2)),logger[_0x432ca1(0x1ed)](_0x432ca1(0x1dd),_0x432ca1(0x1cc),{'error':_0x4789f2 instanceof Error?_0x4789f2[_0x432ca1(0x201)]:String(_0x4789f2)});}finally{process[_0x432ca1(0x1d6)](_0xf8b985);}}logger['success'](_0x432ca1(0x1dd),_0x432ca1(0x1de)+_0x51d397[_0x432ca1(0x1f7)]),console[_0x432ca1(0x1fa)](),console[_0x432ca1(0x1fa)](a142_0x5394ff['green']('─'[_0x432ca1(0x205)](0x3c))),console[_0x432ca1(0x1fa)](a142_0x5394ff['cyan']['bold'](_0x432ca1(0x1ae))),console[_0x432ca1(0x1fa)](),console[_0x432ca1(0x1fa)](_0x432ca1(0x1c7)+a142_0x5394ff['cyan'][_0x432ca1(0x1cb)](_0x432ca1(0x1b5)+_0x51d397['projectName']+'\x20&&\x20'+CLI_BIN_NAME+_0x432ca1(0x1c1))),_0x3c5f73&&console[_0x432ca1(0x1fa)]('\x20\x202.\x20Pull\x20API\x20configuration:\x20'+a142_0x5394ff[_0x432ca1(0x1c2)][_0x432ca1(0x1cb)](CLI_BIN_NAME+_0x432ca1(0x1b9))),console[_0x432ca1(0x1fa)](a142_0x5394ff[_0x432ca1(0x1c0)]('─'['repeat'](0x3c)));}catch(_0x40d423){logger[_0x432ca1(0x1be)](_0x432ca1(0x1dd),'项目创建失败:\x20'+_0x51d397[_0x432ca1(0x1f7)],{'error':_0x40d423 instanceof Error?_0x40d423[_0x432ca1(0x201)]:String(_0x40d423)});try{a142_0x1b7ea0[_0x432ca1(0x204)](_0x155a5e)&&(console[_0x432ca1(0x1fa)](_0x432ca1(0x1e8)+_0x155a5e),a142_0x1b7ea0['rmSync'](_0x155a5e,{'recursive':!![],'force':!![]}));}catch{logger['warn'](_0x432ca1(0x1dd),'清理项目目录失败:\x20'+_0x155a5e);}throw _0x40d423;}}async function runTask(_0x265281,_0x891ac9){const _0x23fe38=a142_0x1ca8,_0x124290=a142_0x1349c9(_0x265281+_0x23fe38(0x1ce))[_0x23fe38(0x1b1)]();try{const _0x29c0cb=await _0x891ac9();_0x124290[_0x23fe38(0x1db)](),console['log'](''+a142_0x5394ff['green']('\x20√\x20')+_0x265281+'\x20'+a142_0x5394ff[_0x23fe38(0x1e0)]('['+_0x29c0cb+']'));}catch(_0x435c9b){_0x124290['fail'](_0x265281);throw _0x435c9b;}}async function updatePackageJsonName(_0x430dfc){const _0x2daecd=a142_0x1ca8,_0x28cef9=a142_0x346fd5[_0x2daecd(0x1f5)](process[_0x2daecd(0x200)](),_0x430dfc),_0x5b9f30=a142_0x346fd5['join'](_0x28cef9,_0x2daecd(0x1ca));try{console['log'](_0x2daecd(0x1bb));const _0x21f84f=getRabetbaseCliPackageRoot(),_0x1cb93a=a142_0x346fd5['join'](_0x21f84f,_0x2daecd(0x1ca));let _0x4d207c=_0x2daecd(0x1f4);try{const _0x2d02a2=JSON[_0x2daecd(0x1d5)](a142_0x1b7ea0[_0x2daecd(0x1f1)](_0x1cb93a,_0x2daecd(0x1f0)));_0x4d207c=_0x2d02a2['version']||_0x2daecd(0x1f4);}catch{}const _0x5dacb4=a142_0x1b7ea0['readFileSync'](_0x5b9f30,_0x2daecd(0x1f0)),_0x25a156=JSON['parse'](_0x5dacb4);_0x25a156[_0x2daecd(0x1e9)]=_0x430dfc,_0x25a156[_0x2daecd(0x1ef)]=_0x430dfc+_0x2daecd(0x1e4)+_0x4d207c,a142_0x1b7ea0['writeFileSync'](_0x5b9f30,JSON[_0x2daecd(0x1c6)](_0x25a156,null,0x2)+'\x0a',_0x2daecd(0x1f0)),console[_0x2daecd(0x1fa)](_0x2daecd(0x1fb)+_0x430dfc),logger[_0x2daecd(0x1c5)](_0x2daecd(0x1dd),_0x2daecd(0x1b3));}catch(_0x5438fd){logger['error'](_0x2daecd(0x1dd),_0x2daecd(0x1ba));throw _0x5438fd;}}async function configureAppCode(_0x37a9c5,_0x2d9864,_0x2f5ed5){const _0x5c4957=a142_0x1ca8,_0x246b82=a142_0x346fd5[_0x5c4957(0x1f5)](process['cwd'](),_0x37a9c5),_0x2885ea=a142_0x346fd5[_0x5c4957(0x1ee)](_0x246b82,NEW_CONFIG_NAME);try{_0x2d9864?console['log'](_0x5c4957(0x1e5)+_0x37a9c5+':\x20'+_0x2d9864):console['log']('*\x20Creating\x20configuration\x20file\x20for\x20project\x20'+_0x37a9c5);const _0x124366=getRabetbaseCliPackageRoot(),_0x4c7edb=a142_0x346fd5[_0x5c4957(0x1ee)](_0x124366,'package.json');let _0x15f350=_0x5c4957(0x1f4);try{const _0x1d4d67=JSON['parse'](a142_0x1b7ea0[_0x5c4957(0x1f1)](_0x4c7edb,_0x5c4957(0x1f0)));_0x15f350=_0x1d4d67[_0x5c4957(0x1eb)]||_0x5c4957(0x1f4);}catch{}const _0x523148=readConfig(),_0x353ad1=typeof _0x523148[_0x5c4957(0x1c8)]===_0x5c4957(0x1f2)?_0x523148[_0x5c4957(0x1c8)]:undefined,_0x4157e0={};for(const _0x37bf58 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x523148[_0x37bf58]!=null)_0x4157e0[_0x37bf58]=_0x523148[_0x37bf58];}const _0x3d811f=buildCanonicalProjectConfig(_0x4157e0,{'appCodes':_0x2d9864?[_0x2d9864]:[],'env':_0x2f5ed5||_0x353ad1||_0x5c4957(0x1c4),'metadata':{'createdAt':new Date()['toLocaleString'](),'version':_0x15f350}});writeConfigFile(_0x2885ea,_0x3d811f),_0x2d9864?console['log'](_0x5c4957(0x1fe)+Object[_0x5c4957(0x1e6)](_0x3d811f[_0x5c4957(0x1bd)]||{})[_0x5c4957(0x1ee)](',\x20')+_0x5c4957(0x1d1)+_0x3d811f[_0x5c4957(0x1df)]):console[_0x5c4957(0x1fa)](_0x5c4957(0x1da)+CLI_BIN_NAME+_0x5c4957(0x1af)),logger[_0x5c4957(0x1c5)](_0x5c4957(0x1dd),'配置应用AppCode:\x20'+_0x2d9864);}catch(_0x16ef18){logger['error']('create',_0x5c4957(0x203));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5bf916,_0x2dabe6){const _0x1300cb=a143_0x25f5,_0x30b303=_0x5bf916();while(!![]){try{const _0x48ff32=parseInt(_0x1300cb(0x186))/0x1*(-parseInt(_0x1300cb(0x18b))/0x2)+parseInt(_0x1300cb(0x15e))/0x3+-parseInt(_0x1300cb(0x177))/0x4*(parseInt(_0x1300cb(0x188))/0x5)+parseInt(_0x1300cb(0x175))/0x6+parseInt(_0x1300cb(0x195))/0x7*(-parseInt(_0x1300cb(0x168))/0x8)+parseInt(_0x1300cb(0x178))/0x9+-parseInt(_0x1300cb(0x17e))/0xa*(parseInt(_0x1300cb(0x16d))/0xb);if(_0x48ff32===_0x2dabe6)break;else _0x30b303['push'](_0x30b303['shift']());}catch(_0x1892a1){_0x30b303['push'](_0x30b303['shift']());}}}(a143_0x46e7,0xbea9b));import a143_0x55d6b3 from'path';import a143_0x30eaf7 from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';import{DEFAULT_API_DIR}from'../../../constant/paths.js';function a143_0x25f5(_0x3a687c,_0x4cb6bc){_0x3a687c=_0x3a687c-0x15e;const _0x46e751=a143_0x46e7();let _0x25f55f=_0x46e751[_0x3a687c];return _0x25f55f;}function a143_0x46e7(){const _0x549013=['\x20api\x20pull`\x20manually\x20later.','production','chdir','modelCount','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','7VozTcJ','Use\x20a\x20different\x20project\x20name.','npm','string','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','dirname','3588684EdHkjh','env','name','description','\x0a\x20\x20cd\x20','join','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','\x20created\x20successfully!','length','\x20\x20√\x20Pulled\x20','3792720MqpZfI','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','bun\x20run\x20format','package.json','readFile','4153501tZwnGP','Project\x20name\x20cannot\x20be\x20empty.','cwd','\x20dataset(s),\x20generated\x20','ignore','*\x20Creating\x20project\x20','belowMinimum','validation','4078392QVZNbz','bun\x20--version','894328YXvtsd','8894556ASOCJu','...','\x20\x20Installing\x20dependencies...','resolve','\x0a√\x20Project\x20','W_OK','10kHtRGB','\x20\x20√\x20Code\x20formatted','Project\x20directory\x20\x22','writeFile','\x20\x20√\x20package.json\x20updated','Cannot\x20create\x20project\x20in\x20current\x20directory.','stringify','\x20model(s)','53054rknyWX','\x22\x20already\x20exists.','5dqirZW','test','needsUpgrade','38sfgAIp','log','toLocaleString','\x20\x20√\x20Project\x20template\x20created','bun'];a143_0x46e7=function(){return _0x549013;};return a143_0x46e7();}import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';import{assertCliVersionSupported,checkCliVersion,printCliUpgradeWarning}from'../../../utils/cli-version-check.js';import{writeConfigFile,NEW_CONFIG_NAME}from'../../../context.js';import{readConfig}from'../../../utils/config.js';import{getCliVersion}from'../../../utils/version.js';import{CliErrors}from'../../../errors.js';import{fetchModelList}from'../../../core/api-client.js';import{generateApiFile}from'../../../api/generate-api-file.js';import{initEnv}from'../../../constant/env.js';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';import{PROJECT_CREATE_INHERITABLE_KEYS,buildCanonicalProjectConfig}from'../../../config/schema.js';const execAsync=promisify(exec);export async function createProjectNonInteractive(_0x5ecc6e,_0x4c438b,_0x32c8ce,_0x383fa2){const _0x456e0b=a143_0x25f5,_0x37813c=await checkCliVersion();(_0x37813c[_0x456e0b(0x18a)]||_0x37813c[_0x456e0b(0x173)])&&(printCliUpgradeWarning(_0x37813c),assertCliVersionSupported(_0x37813c));if(!_0x5ecc6e||_0x5ecc6e['trim']()==='')throw CliErrors[_0x456e0b(0x174)](_0x456e0b(0x16e));const _0x3c862c=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x3c862c[_0x456e0b(0x189)](_0x5ecc6e))throw CliErrors['validation']('Project\x20name\x20contains\x20invalid\x20characters.',_0x456e0b(0x164));if(_0x5ecc6e[_0x456e0b(0x166)]>0x64)throw CliErrors[_0x456e0b(0x174)](_0x456e0b(0x199));const _0x1c560e=a143_0x55d6b3[_0x456e0b(0x17b)](process[_0x456e0b(0x16f)](),_0x5ecc6e);if(existsSync(_0x1c560e))throw CliErrors[_0x456e0b(0x174)](_0x456e0b(0x180)+_0x5ecc6e+_0x456e0b(0x187),_0x456e0b(0x196));try{const _0x14b84a=a143_0x55d6b3[_0x456e0b(0x19a)](_0x1c560e);await a143_0x30eaf7['access'](_0x14b84a,a143_0x30eaf7['constants'][_0x456e0b(0x17d)]);}catch{throw CliErrors[_0x456e0b(0x174)](_0x456e0b(0x183),'Check\x20directory\x20permissions.');}try{console['log'](_0x456e0b(0x172)+_0x5ecc6e+_0x456e0b(0x179));const _0x4f4999=getSubAppReactDemoTemplateDir();await copyDirectory(_0x4f4999,_0x1c560e),console[_0x456e0b(0x18c)](_0x456e0b(0x18e)),await updatePackageJsonName(_0x5ecc6e),console[_0x456e0b(0x18c)](_0x456e0b(0x182)),console[_0x456e0b(0x18c)](_0x456e0b(0x17a)),console[_0x456e0b(0x18c)](_0x456e0b(0x194)),await formatCode(_0x1c560e),console[_0x456e0b(0x18c)](_0x456e0b(0x17f)),await configureProject(_0x5ecc6e,_0x32c8ce,_0x4c438b),console[_0x456e0b(0x18c)]('\x20\x20√\x20Configuration\x20file\x20created'),_0x32c8ce&&await pullApiConfig(_0x1c560e,_0x32c8ce,_0x4c438b,_0x383fa2),console[_0x456e0b(0x18c)](_0x456e0b(0x17c)+_0x5ecc6e+_0x456e0b(0x165)),console[_0x456e0b(0x18c)](_0x456e0b(0x162)+_0x5ecc6e),console['log']('\x20\x20rabetbase\x20run\x20start\x0a');}catch(_0x3b04d6){try{existsSync(_0x1c560e)&&await a143_0x30eaf7['rm'](_0x1c560e,{'recursive':!![],'force':!![]});}catch{}throw _0x3b04d6;}}async function updatePackageJsonName(_0x1d301f){const _0x3a0b1d=a143_0x25f5,_0x5d757f=a143_0x55d6b3['resolve'](process[_0x3a0b1d(0x16f)](),_0x1d301f),_0x25a1db=a143_0x55d6b3[_0x3a0b1d(0x163)](_0x5d757f,_0x3a0b1d(0x16b)),_0x5002fb=await a143_0x30eaf7[_0x3a0b1d(0x16c)](_0x25a1db,'utf-8'),_0x2d819b=JSON['parse'](_0x5002fb);_0x2d819b[_0x3a0b1d(0x160)]=_0x1d301f,_0x2d819b[_0x3a0b1d(0x161)]='A\x20project\x20created\x20with\x20Lovrabet\x20CLI',await a143_0x30eaf7[_0x3a0b1d(0x181)](_0x25a1db,JSON[_0x3a0b1d(0x184)](_0x2d819b,null,0x2)+'\x0a');}function detectPackageManager(){const _0x14e71e=a143_0x25f5;try{return execSync(_0x14e71e(0x176),{'stdio':_0x14e71e(0x171)}),_0x14e71e(0x18f);}catch{return _0x14e71e(0x197);}}async function formatCode(_0x2b7a8d){const _0x52eb1b=a143_0x25f5;try{await execAsync(_0x52eb1b(0x16a),{'cwd':_0x2b7a8d});}catch{}}async function configureProject(_0x29efc2,_0x500319,_0x45beff){const _0x5950fb=a143_0x25f5,_0x5861c6=a143_0x55d6b3[_0x5950fb(0x17b)](process[_0x5950fb(0x16f)](),_0x29efc2),_0x38da8f=a143_0x55d6b3['join'](_0x5861c6,NEW_CONFIG_NAME),_0x478c55=readConfig(),_0x21d56e=typeof _0x478c55[_0x5950fb(0x15f)]===_0x5950fb(0x198)?_0x478c55[_0x5950fb(0x15f)]:undefined,_0x20313a={};for(const _0x251054 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x478c55[_0x251054]!=null)_0x20313a[_0x251054]=_0x478c55[_0x251054];}const _0x2ced85=buildCanonicalProjectConfig(_0x20313a,{'appCodes':_0x500319?[_0x500319]:[],'env':_0x45beff||_0x21d56e||_0x5950fb(0x191),'metadata':{'createdAt':new Date()[_0x5950fb(0x18d)](),'version':getCliVersion()}});writeConfigFile(_0x38da8f,_0x2ced85);}async function pullApiConfig(_0xc5e44e,_0x4ce5c0,_0x2378fc,_0x539b9e){const _0x1ad725=a143_0x25f5,_0x16d2fd=process[_0x1ad725(0x16f)]();try{process['chdir'](_0xc5e44e);const _0x373ea2=_0x2378fc||_0x1ad725(0x191);initEnv(_0x373ea2),console[_0x1ad725(0x18c)]('\x20\x20Pulling\x20API\x20configuration...');const {configArray:_0x189fc8}=await fetchModelList(_0x4ce5c0,_0x539b9e||''),_0x14a870=await generateApiFile(_0x189fc8,'',_0x4ce5c0,!![],_0x373ea2,DEFAULT_API_DIR);console[_0x1ad725(0x18c)](_0x1ad725(0x167)+_0x189fc8[_0x1ad725(0x166)]+_0x1ad725(0x170)+_0x14a870[_0x1ad725(0x193)]+_0x1ad725(0x185));}catch(_0x241864){console[_0x1ad725(0x18c)](_0x1ad725(0x169)+CLI_BIN_NAME+_0x1ad725(0x190));}finally{process[_0x1ad725(0x192)](_0x16d2fd);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a144_0x56a98f=a144_0x3633;(function(_0x2ea429,_0x5736b7){const _0x52d2c5=a144_0x3633,_0x22af3d=_0x2ea429();while(!![]){try{const _0x2efa84=-parseInt(_0x52d2c5(0x1c8))/0x1+-parseInt(_0x52d2c5(0x1c9))/0x2*(-parseInt(_0x52d2c5(0x1cd))/0x3)+parseInt(_0x52d2c5(0x1d0))/0x4*(-parseInt(_0x52d2c5(0x1c6))/0x5)+-parseInt(_0x52d2c5(0x1cc))/0x6*(-parseInt(_0x52d2c5(0x1d3))/0x7)+-parseInt(_0x52d2c5(0x1ca))/0x8*(-parseInt(_0x52d2c5(0x1d2))/0x9)+-parseInt(_0x52d2c5(0x1cf))/0xa+parseInt(_0x52d2c5(0x1d4))/0xb;if(_0x2efa84===_0x5736b7)break;else _0x22af3d['push'](_0x22af3d['shift']());}catch(_0x116a20){_0x22af3d['push'](_0x22af3d['shift']());}}}(a144_0x50b0,0xe0ee8));function a144_0x3633(_0x1fbd9c,_0x236e3e){_0x1fbd9c=_0x1fbd9c-0x1c6;const _0x50b038=a144_0x50b0();let _0x3633a0=_0x50b038[_0x1fbd9c];return _0x3633a0;}import a144_0x388cdf from'node:path';import{fileURLToPath}from'node:url';const __dirname=a144_0x388cdf[a144_0x56a98f(0x1c7)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x4faea5=a144_0x56a98f;return a144_0x388cdf[_0x4faea5(0x1d1)](__dirname,_0x4faea5(0x1ce));}export function getSubAppReactDemoTemplateDir(){const _0x42affc=a144_0x56a98f;return a144_0x388cdf['join'](getRabetbaseCliPackageRoot(),'templates',_0x42affc(0x1cb),'sub-app-react-demo');}function a144_0x50b0(){const _0x5465ae=['27378439DYKyDo','71125aXghwX','dirname','165617sYoXTY','46fXzttq','351280VmuznZ','projects','12oZIWiS','32217ceWuVU','../../../../','13549980rXCFcL','140JEWrcI','resolve','27rmrSHe','252469XGMlJN'];a144_0x50b0=function(){return _0x5465ae;};return a144_0x50b0();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x12d969,_0x42a2b8){const _0x5b2d6a=a145_0x1d27,_0x2ab504=_0x12d969();while(!![]){try{const _0x4f4710=parseInt(_0x5b2d6a(0x12f))/0x1*(parseInt(_0x5b2d6a(0x12e))/0x2)+-parseInt(_0x5b2d6a(0x130))/0x3+-parseInt(_0x5b2d6a(0x12d))/0x4*(-parseInt(_0x5b2d6a(0x124))/0x5)+-parseInt(_0x5b2d6a(0x135))/0x6+-parseInt(_0x5b2d6a(0x129))/0x7*(-parseInt(_0x5b2d6a(0x12b))/0x8)+parseInt(_0x5b2d6a(0x132))/0x9+parseInt(_0x5b2d6a(0x128))/0xa*(-parseInt(_0x5b2d6a(0x125))/0xb);if(_0x4f4710===_0x42a2b8)break;else _0x2ab504['push'](_0x2ab504['shift']());}catch(_0x1f67ca){_0x2ab504['push'](_0x2ab504['shift']());}}}(a145_0x5d7e,0xae744));import a145_0x553525 from'node:path';import{copyDirectory}from'../../../utils/copy-directory.js';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';function a145_0x1d27(_0x1be448,_0x3f17e0){_0x1be448=_0x1be448-0x123;const _0x5d7ed9=a145_0x5d7e();let _0x1d271e=_0x5d7ed9[_0x1be448];return _0x1d271e;}function a145_0x5d7e(){const _0x3c8977=['6587BuEQnP','项目模板复制完成','11224vVmgcq','copy','3276332zWcQja','754NlHKqJ','2811KOZwDP','2599155cikLEg','success','7727121BOwHkz','开始复制项目模板','info','6473634zwZftH','resolve','cwd','5KhUjkF','22lQWWLv','now','error','6988670XtMZAu'];a145_0x5d7e=function(){return _0x3c8977;};return a145_0x5d7e();}import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x4ca49b){const _0x18179b=a145_0x1d27,_0x3daef9=Date['now'](),_0x1d632e=a145_0x553525[_0x18179b(0x136)](process[_0x18179b(0x123)](),_0x4ca49b);try{logger[_0x18179b(0x134)](_0x18179b(0x12c),_0x18179b(0x133),{'projectCode':_0x4ca49b,'templateDir':templateDir}),await copyDirectory(templateDir,_0x1d632e);const _0x5de33d=Date[_0x18179b(0x126)]()-_0x3daef9;logger[_0x18179b(0x131)](_0x18179b(0x12c),_0x18179b(0x12a),_0x5de33d,{'projectCode':_0x4ca49b});}catch(_0x405a36){const _0x329da9=Date[_0x18179b(0x126)]()-_0x3daef9;logger[_0x18179b(0x127)]('copy','项目模板复制失败',{'projectCode':_0x4ca49b,'error':_0x405a36 instanceof Error?_0x405a36['message']:String(_0x405a36),'duration':_0x329da9});throw _0x405a36;}return formatElapsed(_0x3daef9);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a146_0x540c(_0x5817bf,_0x68d865){_0x5817bf=_0x5817bf-0xc6;const _0x5c20c6=a146_0x5c20();let _0x540c90=_0x5c20c6[_0x5817bf];return _0x540c90;}(function(_0x552ecd,_0x1aec39){const _0x93248d=a146_0x540c,_0x43f160=_0x552ecd();while(!![]){try{const _0x292608=-parseInt(_0x93248d(0xc8))/0x1*(parseInt(_0x93248d(0xcc))/0x2)+-parseInt(_0x93248d(0xc6))/0x3+-parseInt(_0x93248d(0xca))/0x4*(parseInt(_0x93248d(0xd7))/0x5)+parseInt(_0x93248d(0xcb))/0x6+parseInt(_0x93248d(0xd2))/0x7*(parseInt(_0x93248d(0xd5))/0x8)+-parseInt(_0x93248d(0xc9))/0x9*(-parseInt(_0x93248d(0xda))/0xa)+parseInt(_0x93248d(0xd1))/0xb;if(_0x292608===_0x1aec39)break;else _0x43f160['push'](_0x43f160['shift']());}catch(_0x6dab3){_0x43f160['push'](_0x43f160['shift']());}}}(a146_0x5c20,0xa14fd));import a146_0x4ec831 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a146_0x5c20(){const _0x5acb79=['success','代码格式化失败','now','9641357QAusAv','54299ubeTwJ','npx','error','104HVTsta','开始格式化代码','5xZWRuP','cwd','message','30uFIhfF','代码格式化完成','3100581tMONgO','format','31107GWUnJa','3640122OsCwAs','2365148jWXZAx','1128996gBRaRq','6oymHDv','resolve'];a146_0x5c20=function(){return _0x5acb79;};return a146_0x5c20();}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0x2b17da){const _0x5b886d=a146_0x540c,_0x5d9c6b=Date[_0x5b886d(0xd0)](),_0x2d47e7=a146_0x4ec831[_0x5b886d(0xcd)](process[_0x5b886d(0xd8)](),_0x2b17da);try{logger['info']('format',_0x5b886d(0xd6),{'projectCode':_0x2b17da}),await execa(resolveNpmBin(_0x5b886d(0xd3)),['prettier','--write','.'],{'cwd':_0x2d47e7});const _0x58ddbf=Date[_0x5b886d(0xd0)]()-_0x5d9c6b;logger[_0x5b886d(0xce)](_0x5b886d(0xc7),_0x5b886d(0xdb),_0x58ddbf,{'projectCode':_0x2b17da});}catch(_0x1dcced){const _0x38d43c=Date[_0x5b886d(0xd0)]()-_0x5d9c6b;logger[_0x5b886d(0xd4)](_0x5b886d(0xc7),_0x5b886d(0xcf),{'projectCode':_0x2b17da,'error':_0x1dcced instanceof Error?_0x1dcced[_0x5b886d(0xd9)]:String(_0x1dcced),'duration':_0x38d43c});throw _0x1dcced;}return formatElapsed(_0x5d9c6b);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x570e54,_0x2fd474){const _0x5db526=a147_0x255e,_0x122b72=_0x570e54();while(!![]){try{const _0x56805c=-parseInt(_0x5db526(0x9b))/0x1+parseInt(_0x5db526(0x9e))/0x2+parseInt(_0x5db526(0x95))/0x3*(parseInt(_0x5db526(0xa2))/0x4)+parseInt(_0x5db526(0x93))/0x5+-parseInt(_0x5db526(0x9d))/0x6*(parseInt(_0x5db526(0x9c))/0x7)+parseInt(_0x5db526(0x92))/0x8+parseInt(_0x5db526(0x8f))/0x9*(-parseInt(_0x5db526(0x90))/0xa);if(_0x56805c===_0x2fd474)break;else _0x122b72['push'](_0x122b72['shift']());}catch(_0x3af18e){_0x122b72['push'](_0x122b72['shift']());}}}(a147_0x282a,0x510ad));import a147_0x5a618d from'node:path';import{execa}from'execa';function a147_0x255e(_0x51fd2d,_0x1a71a8){_0x51fd2d=_0x51fd2d-0x8f;const _0x282a22=a147_0x282a();let _0x255e5d=_0x282a22[_0x51fd2d];return _0x255e5d;}function a147_0x282a(){const _0x570285=['error','success','664NcTELF','6336KWdlPf','2200INjFZE','npm','3084368GDGoAj','1973090gxIkmz','install','1839WEKxSU','info','依赖安装失败','--registry','依赖安装完成','now','82123enoQLs','1862ykgsqB','8862anPtdC','159824WFzvIU','https://registry.npmmirror.com'];a147_0x282a=function(){return _0x570285;};return a147_0x282a();}import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function installDependencies(_0x455c9f){const _0x153b23=a147_0x255e,_0x40fc2f=Date[_0x153b23(0x9a)](),_0x20aac8=a147_0x5a618d['resolve'](process['cwd'](),_0x455c9f);try{logger[_0x153b23(0x96)](_0x153b23(0x94),'开始安装依赖',{'projectCode':_0x455c9f,'registry':_0x153b23(0x9f)}),await execa(resolveNpmBin(_0x153b23(0x91)),[_0x153b23(0x94),_0x153b23(0x98),_0x153b23(0x9f)],{'cwd':_0x20aac8});const _0x466dff=Date['now']()-_0x40fc2f;logger[_0x153b23(0xa1)]('install',_0x153b23(0x99),_0x466dff,{'projectCode':_0x455c9f});}catch(_0x2dc795){const _0x16181b=Date[_0x153b23(0x9a)]()-_0x40fc2f;logger[_0x153b23(0xa0)](_0x153b23(0x94),_0x153b23(0x97),{'projectCode':_0x455c9f,'error':_0x2dc795 instanceof Error?_0x2dc795['message']:String(_0x2dc795),'duration':_0x16181b});throw _0x2dc795;}return formatElapsed(_0x40fc2f);}
|