@lovrabet/rabetbase-cli 2.3.9 → 2.3.10-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/auth/auth-server-ui.js +1 -1
- package/lib/auth/auth-server.js +1 -1
- package/lib/auth/constant.js +1 -1
- package/lib/auth/get-cookie.js +1 -1
- package/lib/auth/get-session-user.js +1 -1
- package/lib/auth/is-session-valid.js +1 -1
- package/lib/auth/login-success-html.js +1 -1
- package/lib/auth/logout.js +1 -1
- package/lib/cli-flags.js +1 -1
- package/lib/cli.js +1 -1
- package/lib/commands/api/generate.js +1 -1
- package/lib/commands/api/index.js +1 -1
- package/lib/commands/api/list.js +1 -1
- package/lib/commands/api/pull.js +1 -1
- package/lib/commands/api/shared.js +1 -1
- package/lib/commands/app/add.js +1 -1
- package/lib/commands/app/index.js +1 -1
- package/lib/commands/app/list.js +1 -1
- package/lib/commands/app/remote-directory.js +1 -1
- package/lib/commands/app/remove.js +1 -1
- package/lib/commands/app/shared.js +1 -1
- package/lib/commands/app-config/delete.js +1 -1
- package/lib/commands/app-config/get.js +1 -1
- package/lib/commands/app-config/index.js +1 -1
- package/lib/commands/app-config/list.js +1 -1
- package/lib/commands/app-config/set.js +1 -1
- package/lib/commands/app-config/shared.js +1 -1
- package/lib/commands/auth/index.js +1 -1
- package/lib/commands/bff/create.js +1 -1
- package/lib/commands/bff/delete.js +1 -1
- package/lib/commands/bff/detail.js +1 -1
- package/lib/commands/bff/index.js +1 -1
- package/lib/commands/bff/list.js +1 -1
- package/lib/commands/bff/pull.js +1 -1
- package/lib/commands/bff/push.js +1 -1
- package/lib/commands/bff/status.js +1 -1
- package/lib/commands/cli-skill/index.js +1 -1
- package/lib/commands/cli-update.js +1 -1
- package/lib/commands/codegen/index.js +1 -1
- package/lib/commands/codegen/sdk.js +1 -1
- package/lib/commands/codegen/sql.js +1 -1
- package/lib/commands/common/app-registry.js +1 -1
- package/lib/commands/common/app-selector.js +1 -1
- package/lib/commands/common/async-task.js +1 -1
- package/lib/commands/common/dry-run.js +1 -1
- package/lib/commands/common/flags.js +1 -1
- package/lib/commands/common/local-file.js +1 -1
- package/lib/commands/common/validate.js +1 -1
- package/lib/commands/config/get.js +1 -1
- package/lib/commands/config/index.js +1 -1
- package/lib/commands/config/list.js +1 -1
- package/lib/commands/config/set.js +1 -1
- package/lib/commands/config/shared.js +1 -1
- package/lib/commands/data/filter.js +1 -1
- package/lib/commands/data/getOne.js +1 -1
- package/lib/commands/data/index.js +1 -1
- package/lib/commands/data/shared.js +1 -1
- package/lib/commands/dataset/business-group-update.js +1 -1
- package/lib/commands/dataset/capability.js +1 -1
- package/lib/commands/dataset/delete.js +1 -1
- package/lib/commands/dataset/detail.js +1 -1
- package/lib/commands/dataset/extend-update.js +1 -1
- package/lib/commands/dataset/field-update.js +1 -1
- package/lib/commands/dataset/generate.js +1 -1
- package/lib/commands/dataset/index.js +1 -1
- package/lib/commands/dataset/list.js +1 -1
- package/lib/commands/dataset/operations.js +1 -1
- package/lib/commands/dataset/relation-audit.js +1 -1
- package/lib/commands/dataset/relation-create.js +1 -1
- package/lib/commands/dataset/relation-delete.js +1 -1
- package/lib/commands/dataset/relation-shared.js +1 -1
- package/lib/commands/dataset/relation-update.js +1 -1
- package/lib/commands/dataset/relations.js +1 -1
- package/lib/commands/dataset/rename.js +1 -1
- package/lib/commands/dataset/restore.js +1 -1
- package/lib/commands/db/analysis-batching.js +1 -1
- package/lib/commands/db/analyze-batch-plan.js +1 -1
- package/lib/commands/db/analyze-cancel.js +1 -1
- package/lib/commands/db/analyze-start.js +1 -1
- package/lib/commands/db/analyze-status.js +1 -1
- package/lib/commands/db/create.js +1 -1
- package/lib/commands/db/delete.js +1 -1
- package/lib/commands/db/detail.js +1 -1
- package/lib/commands/db/diff.js +1 -1
- package/lib/commands/db/index.js +1 -1
- package/lib/commands/db/list.js +1 -1
- package/lib/commands/db/shared.js +1 -1
- package/lib/commands/db/tables.js +1 -1
- package/lib/commands/db/test.js +1 -1
- package/lib/commands/db/update.js +1 -1
- package/lib/commands/doctor.js +1 -1
- package/lib/commands/file/index.js +1 -1
- package/lib/commands/init/index.js +1 -1
- package/lib/commands/issue/index.js +1 -1
- package/lib/commands/issue/nudge.js +1 -1
- package/lib/commands/issue/report.js +1 -1
- package/lib/commands/issue/shared.js +1 -1
- package/lib/commands/logs/index.js +1 -1
- package/lib/commands/menu/delete.js +1 -1
- package/lib/commands/menu/external-link-create.js +1 -0
- 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/regroup-start.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/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 -1
- package/lib/commands/task/status.js +1 -1
- package/lib/commands/workspace/add.js +1 -1
- package/lib/commands/workspace/index.js +1 -1
- package/lib/commands/workspace/remove.js +1 -1
- package/lib/config/schema.js +1 -1
- package/lib/constant/cdn.js +1 -1
- package/lib/constant/cli.js +1 -1
- package/lib/constant/defaults.js +1 -1
- package/lib/constant/domain.js +1 -1
- package/lib/constant/env.js +1 -1
- package/lib/constant/output.js +1 -1
- package/lib/constant/paths.js +1 -1
- package/lib/constant/risk.js +1 -1
- package/lib/context/app-resolver.js +1 -1
- package/lib/context/auth-resolver.js +1 -1
- package/lib/context/config-loader.js +1 -1
- package/lib/context.js +1 -1
- package/lib/core/alias-resolver.js +1 -1
- package/lib/core/api-client.js +1 -1
- package/lib/core/bff/config.js +1 -1
- package/lib/core/bff/file-system.js +1 -1
- package/lib/core/bff/hash.js +1 -1
- package/lib/core/bff/lock.js +1 -1
- package/lib/core/bff/utils.js +1 -1
- package/lib/core/db-resolver.js +1 -1
- package/lib/core/page/file-system.js +1 -1
- package/lib/core/page/hash.js +1 -1
- package/lib/core/page/lock.js +1 -1
- package/lib/core/sql-index-auditor.js +1 -1
- package/lib/core/sql-sync/config.js +1 -1
- package/lib/core/sql-sync/file-system.js +1 -1
- package/lib/core/sql-sync/hash.js +1 -1
- package/lib/core/sql-sync/lock.js +1 -1
- package/lib/core/sql-sync/utils.js +1 -1
- package/lib/core/sql-validator.js +1 -1
- package/lib/errors.js +1 -1
- package/lib/framework/build-all-flags.js +1 -1
- package/lib/framework/error-output.js +1 -1
- package/lib/framework/explicit-yes.js +1 -1
- package/lib/framework/flags.js +1 -1
- package/lib/framework/help.js +1 -1
- package/lib/framework/index.js +1 -1
- package/lib/framework/output.js +1 -1
- package/lib/framework/response.js +1 -1
- package/lib/framework/runner-alias.js +1 -1
- package/lib/framework/runner.js +1 -1
- package/lib/framework/schema-export.js +1 -1
- package/lib/framework/types.js +1 -1
- package/lib/generated/build-info.js +1 -1
- package/lib/help.js +1 -1
- package/lib/skills/main.js +1 -1
- package/lib/skills/npx-skills-add.js +1 -1
- package/lib/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 a137_0x59ddf2=a137_0x3178;function a137_0x3cbc(){const _0x369ca1=['revoke','appCode','814174WkWuOS','permit','selector','2817563FYDjqY','Unknown\x20datasetCode(s)\x20for\x20this\x20role\x27s\x20API\x20resources:\x20','length','datasets','POST','validation','833234quvNlC','1957221dmyYnS','bool','Pass\x20--datasets\x20<datasetCode,...>.','Verify\x20the\x20datasetCode,\x20or\x20check\x20the\x20role\x27s\x20API\x20resource\x20matrix.','push','19971100fUjbJY','\x20dataset(s)\x20on\x20role\x20','/smartapi/permit/role/update','filter','has','1181784zLNKAg','flagMissing','get','api-revoke','8ikgTFV','role-apis-set','str','join','roleName','Missing\x20--revoke.','role-apis-set\x20currently\x20supports\x20revoking\x20dataset\x20API\x20access\x20(use\x20case\x204).','high-risk-write','Revoked\x20API\x20access\x20for\x20','88CQTHMw','5feEXDg','130365JsLlGA'];a137_0x3cbc=function(){return _0x369ca1;};return a137_0x3cbc();}(function(_0x1085c0,_0x478319){const _0x170371=a137_0x3178,_0x96334d=_0x1085c0();while(!![]){try{const _0x475990=parseInt(_0x170371(0x169))/0x1+parseInt(_0x170371(0x160))/0x2+-parseInt(_0x170371(0x15d))/0x3*(-parseInt(_0x170371(0x15b))/0x4)+-parseInt(_0x170371(0x15c))/0x5*(parseInt(_0x170371(0x14e))/0x6)+parseInt(_0x170371(0x163))/0x7+-parseInt(_0x170371(0x152))/0x8*(-parseInt(_0x170371(0x16a))/0x9)+-parseInt(_0x170371(0x16f))/0xa;if(_0x475990===_0x478319)break;else _0x96334d['push'](_0x96334d['shift']());}catch(_0x9c751e){_0x96334d['push'](_0x96334d['shift']());}}}(a137_0x3cbc,0x97e9b));import{getRoleApiResources,updateAppRole}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';function a137_0x3178(_0x4646c9,_0x12c9a9){_0x4646c9=_0x4646c9-0x14c;const _0x3cbc2a=a137_0x3cbc();let _0x31785b=_0x3cbc2a[_0x4646c9];return _0x31785b;}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=a137_0x59ddf2(0x171);async function buildPlan(_0x499788,_0x3c331c){const _0x124297=a137_0x59ddf2,_0x4b827e=await resolveRoleRef(_0x499788[_0x124297(0x15f)],readRoleRef(_0x499788));assertPermConfigurable(_0x4b827e);if(!_0x499788[_0x124297(0x16b)](_0x124297(0x15e)))throw CliErrors[_0x124297(0x168)](_0x124297(0x157),_0x124297(0x158));const _0xe89e84=splitList(_0x499788[_0x124297(0x154)](_0x124297(0x166)));if(_0xe89e84[_0x124297(0x165)]===0x0)throw CliErrors[_0x124297(0x14f)](_0x124297(0x166),_0x124297(0x16c));const _0x3b2873=await getRoleApiResources(_0x499788[_0x124297(0x15f)],_0x4b827e['id']),{byCode:_0x7a2bb0,byDataset:_0x319526}=flattenApiResources(_0x3b2873),_0x5637e1=_0xe89e84[_0x124297(0x14c)](_0xf612a6=>!_0x319526[_0x124297(0x14d)](_0xf612a6));if(_0x5637e1['length']>0x0)throw CliErrors['validation'](_0x124297(0x164)+_0x5637e1[_0x124297(0x155)](',\x20')+'.',_0x124297(0x16d));const _0x5d5a5a=new Map(),_0x2b5265=[],_0x178245=[];for(const _0x23739b of _0xe89e84){for(const _0x319d4f of _0x319526[_0x124297(0x150)](_0x23739b)){const _0x3e78fb=_0x7a2bb0[_0x124297(0x150)](_0x319d4f);_0x5d5a5a['set'](_0x319d4f,'0'),_0x2b5265['push']({'resourceCode':_0x319d4f,'datasetCode':_0x23739b,'action':_0x3e78fb['action']}),_0x178245[_0x124297(0x16e)]({'resourceCode':_0x319d4f,'datasetCode':_0x23739b,'action':'0'});}}const _0x495426=buildPermits(_0x7a2bb0,_0x5d5a5a),_0x2491f3={'operation':_0x124297(0x151),'selector':{'appCode':_0x499788[_0x124297(0x15f)],'roleId':_0x4b827e['id'],'roleName':_0x4b827e[_0x124297(0x156)],'datasetCodes':_0xe89e84},'before':_0x2b5265,'after':_0x178245,'dryRun':_0x3c331c,'backend':{'method':_0x124297(0x167),'path':UPDATE_PATH,'roleType':'API'},'warnings':[]};return{'role':_0x4b827e,'permits':_0x495426,'mutation':_0x2491f3};}export const permitRoleApisSet={'service':a137_0x59ddf2(0x161),'command':a137_0x59ddf2(0x153),'description':'Revoke\x20a\x20role\x27s\x20dataset\x20API\x20access\x20by\x20datasetCode\x20(roleType\x20API);\x20requires\x20--yes','risk':a137_0x59ddf2(0x159),'flags':[ROLE_REF_FLAG,REVOKE_FLAG,DATASETS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x6ea9b6){const _0x55174c=a137_0x59ddf2;if(!_0x6ea9b6[_0x55174c(0x16b)](_0x55174c(0x15e)))throw CliErrors[_0x55174c(0x168)](_0x55174c(0x157),_0x55174c(0x158));if(splitList(_0x6ea9b6[_0x55174c(0x154)](_0x55174c(0x166)))[_0x55174c(0x165)]===0x0)throw CliErrors[_0x55174c(0x14f)](_0x55174c(0x166),'Pass\x20--datasets\x20<datasetCode,...>.');},async 'dryRun'(_0x26bc1a){const {mutation:_0x275947}=await buildPlan(_0x26bc1a,!![]);return asDryRunResult(_0x275947,{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x28d150){const _0x54e487=a137_0x59ddf2,{role:_0x66a413,permits:_0x2be7c3,mutation:_0x2d7baa}=await buildPlan(_0x28d150,![]);return await updateAppRole({'id':_0x66a413['id'],'appCode':_0x28d150[_0x54e487(0x15f)],'roleType':'API','permits':_0x2be7c3}),{'ok':!![],'data':_0x2d7baa,'message':_0x54e487(0x15a)+_0x2d7baa[_0x54e487(0x162)]['datasetCodes']['length']+_0x54e487(0x170)+_0x66a413[_0x54e487(0x156)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a138_0x44fc09=a138_0xf3a9;(function(_0x383618,_0x1eb35b){const _0x36a8e5=a138_0xf3a9,_0x52e46e=_0x383618();while(!![]){try{const _0x125be7=parseInt(_0x36a8e5(0xe0))/0x1*(parseInt(_0x36a8e5(0xf3))/0x2)+parseInt(_0x36a8e5(0xed))/0x3+-parseInt(_0x36a8e5(0xdf))/0x4+parseInt(_0x36a8e5(0xf4))/0x5*(parseInt(_0x36a8e5(0xf1))/0x6)+-parseInt(_0x36a8e5(0xf6))/0x7*(-parseInt(_0x36a8e5(0xf2))/0x8)+-parseInt(_0x36a8e5(0xf7))/0x9+parseInt(_0x36a8e5(0xfb))/0xa;if(_0x125be7===_0x1eb35b)break;else _0x52e46e['push'](_0x52e46e['shift']());}catch(_0x40cd8c){_0x52e46e['push'](_0x52e46e['shift']());}}}(a138_0x18a0,0x41e6e));import{getRoleMenuResources,updateAppRole}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';function a138_0xf3a9(_0x1743b3,_0x34b698){_0x1743b3=_0x1743b3-0xdf;const _0x18a093=a138_0x18a0();let _0xf3a92a=_0x18a093[_0x1743b3];return _0xf3a92a;}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';function a138_0x18a0(){const _0xbaef5c=['validation','14604ECkASX','2585720TFnetu','58COnllo','40GapPeE','length','7inDKMZ','4051989mmXmKR','str','menu-grant','POST','2142060PUhdki','1631648YaEbYG','4003bjKEKq','flagMissing','Updated\x20','roleName','Pass\x20--menus\x20<resourceCode,...>.','join','menus','permit','push','menu-revoke','appCode','PAGE','filter','1365261bPqGeF','/smartapi/permit/role/update','Unknown\x20menu\x20resourceCode(s):\x20'];a138_0x18a0=function(){return _0xbaef5c;};return a138_0x18a0();}const UPDATE_PATH=a138_0x44fc09(0xee);async function buildPlan(_0x298139,_0x593741){const _0x1c22dc=a138_0x44fc09,_0x490d66=await resolveRoleRef(_0x298139['appCode'],readRoleRef(_0x298139));assertPermConfigurable(_0x490d66);const _0x4643a6=readGrantRevoke(_0x298139),_0x56891f=splitList(_0x298139[_0x1c22dc(0xf8)](_0x1c22dc(0xe6)));if(_0x56891f[_0x1c22dc(0xf5)]===0x0)throw CliErrors[_0x1c22dc(0xe1)](_0x1c22dc(0xe6),_0x1c22dc(0xe4));const _0x39e52c=await getRoleMenuResources(_0x298139[_0x1c22dc(0xea)],_0x490d66['id']),_0x44ac7c=flattenMenuResources(_0x39e52c),_0x360f4f=_0x56891f[_0x1c22dc(0xec)](_0x4ba004=>!_0x44ac7c['has'](_0x4ba004));if(_0x360f4f['length']>0x0)throw CliErrors[_0x1c22dc(0xf0)](_0x1c22dc(0xef)+_0x360f4f[_0x1c22dc(0xe5)](',\x20')+'.','Run\x20`permit\x20role-menus\x20--role\x20<id>`\x20to\x20see\x20valid\x20resourceCodes.');const _0x4b5bab=new Map(),_0x3eb1a5=[],_0x54787d=[];for(const _0x2ce3ac of _0x56891f){const _0x2c1059=_0x44ac7c['get'](_0x2ce3ac);_0x4b5bab['set'](_0x2ce3ac,_0x4643a6),_0x3eb1a5[_0x1c22dc(0xe8)]({'resourceCode':_0x2ce3ac,'action':_0x2c1059['action']}),_0x54787d[_0x1c22dc(0xe8)]({'resourceCode':_0x2ce3ac,'action':_0x4643a6});}const _0xa5ae8b=buildPermits(_0x44ac7c,_0x4b5bab),_0x4f7af0={'operation':_0x4643a6==='access'?_0x1c22dc(0xf9):_0x1c22dc(0xe9),'selector':{'appCode':_0x298139[_0x1c22dc(0xea)],'roleId':_0x490d66['id'],'roleName':_0x490d66[_0x1c22dc(0xe3)],'resourceCodes':_0x56891f},'before':_0x3eb1a5,'after':_0x54787d,'dryRun':_0x593741,'backend':{'method':_0x1c22dc(0xfa),'path':UPDATE_PATH,'roleType':_0x1c22dc(0xeb)},'warnings':[]};return{'role':_0x490d66,'permits':_0xa5ae8b,'mutation':_0x4f7af0};}export const permitRoleMenusSet={'service':a138_0x44fc09(0xe7),'command':'role-menus-set','description':'Grant\x20or\x20revoke\x20a\x20role\x27s\x20menu\x20access\x20by\x20resourceCode\x20(roleType\x20PAGE);\x20requires\x20--yes','risk':'high-risk-write','flags':[ROLE_REF_FLAG,GRANT_FLAG,REVOKE_FLAG,MENUS_FLAG,APPCODE_FLAG_OPTIONAL],async 'validate'(_0x3e957c){const _0x404468=a138_0x44fc09;readGrantRevoke(_0x3e957c);if(splitList(_0x3e957c[_0x404468(0xf8)](_0x404468(0xe6)))[_0x404468(0xf5)]===0x0)throw CliErrors['flagMissing'](_0x404468(0xe6),_0x404468(0xe4));},async 'dryRun'(_0x225553){const {mutation:_0x4cd626}=await buildPlan(_0x225553,!![]);return asDryRunResult(_0x4cd626,{'method':'POST','url':UPDATE_PATH});},async 'execute'(_0x5a51ef){const _0x259e7c=a138_0x44fc09,{role:_0x32030e,permits:_0x3fd172,mutation:_0x214e87}=await buildPlan(_0x5a51ef,![]);return await updateAppRole({'id':_0x32030e['id'],'appCode':_0x5a51ef[_0x259e7c(0xea)],'roleType':'PAGE','permits':_0x3fd172}),{'ok':!![],'data':_0x214e87,'message':_0x259e7c(0xe2)+_0x214e87['selector']['resourceCodes'][_0x259e7c(0xf5)]+'\x20menu\x20permit(s)\x20for\x20role\x20'+_0x32030e[_0x259e7c(0xe3)]};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a139_0x1e59b9=a139_0x3684;(function(_0x119628,_0x4d4240){const _0x1d620f=a139_0x3684,_0x524449=_0x119628();while(!![]){try{const _0x15c270=-parseInt(_0x1d620f(0x168))/0x1*(-parseInt(_0x1d620f(0x174))/0x2)+parseInt(_0x1d620f(0x16e))/0x3+-parseInt(_0x1d620f(0x162))/0x4+parseInt(_0x1d620f(0x173))/0x5+-parseInt(_0x1d620f(0x176))/0x6*(-parseInt(_0x1d620f(0x171))/0x7)+parseInt(_0x1d620f(0x16f))/0x8*(parseInt(_0x1d620f(0x166))/0x9)+parseInt(_0x1d620f(0x16c))/0xa*(-parseInt(_0x1d620f(0x16d))/0xb);if(_0x15c270===_0x4d4240)break;else _0x524449['push'](_0x524449['shift']());}catch(_0x3dfb69){_0x524449['push'](_0x524449['shift']());}}}(a139_0x6293,0x2bbef));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 a139_0x6293(){const _0x9f633=['1334808QOrGON','read','7OwOOYJ','access','1180880xiVCEm','2fojTRt','action','1381746BbydgW','allowed','resourceName','values','map','permit','appCode','572188HaeIWC','filter','length','role-menus','18eKPPbe','\x20has\x20','307841NKFFxW','Show\x20a\x20role\x27s\x20current\x20menu\x20permission\x20matrix','roleName','Role\x20','80UxeUxC','1213663UQdFQw','290652OcjVIZ'];a139_0x6293=function(){return _0x9f633;};return a139_0x6293();}function a139_0x3684(_0x4718aa,_0x56f658){_0x4718aa=_0x4718aa-0x162;const _0x629318=a139_0x6293();let _0x368479=_0x629318[_0x4718aa];return _0x368479;}import{resolveRoleRef}from'../../commands/role/shared.js';export const permitRoleMenus={'service':a139_0x1e59b9(0x17b),'command':a139_0x1e59b9(0x165),'description':a139_0x1e59b9(0x169),'risk':a139_0x1e59b9(0x170),'flags':[ROLE_REF_FLAG,APPCODE_FLAG_OPTIONAL],async 'execute'(_0x243450){const _0x137520=a139_0x1e59b9,_0x54c857=await resolveRoleRef(_0x243450[_0x137520(0x17c)],readRoleRef(_0x243450)),_0xb79c2e=await getRoleMenuResources(_0x243450[_0x137520(0x17c)],_0x54c857['id']),_0x25731c=flattenMenuResources(_0xb79c2e),_0x3ed4ce=Array['from'](_0x25731c[_0x137520(0x179)]())[_0x137520(0x17a)](_0x296207=>({'resourceCode':_0x296207['resourceCode'],'resourceName':_0x296207[_0x137520(0x178)],'allowed':_0x296207[_0x137520(0x175)]===_0x137520(0x172),'action':_0x296207[_0x137520(0x175)]}));return{'ok':!![],'data':{'selector':{'appCode':_0x243450['appCode'],'roleId':_0x54c857['id'],'roleName':_0x54c857['roleName']},'menus':_0x3ed4ce},'message':_0x137520(0x16b)+_0x54c857[_0x137520(0x16a)]+_0x137520(0x167)+_0x3ed4ce[_0x137520(0x163)](_0x2f91fa=>_0x2f91fa[_0x137520(0x177)])[_0x137520(0x164)]+'/'+_0x3ed4ce[_0x137520(0x164)]+'\x20menu(s)\x20allowed'};}};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a140_0x44dbb7=a140_0x1b88;function a140_0x2014(){const _0x5449ab=['delete-roles','menu\x20visibility','3465412PfdBvf','Role\x20id\x20or\x20role\x20name','datasets','length','bool','roleType','menu-id','Pass\x20exactly\x20one\x20of\x20--grant\x20/\x20--revoke.','21kumwBD','allowedActions','set','dataUpdate','SELF\x20(row-level)\x20applies\x20only\x20to\x20--row-roles.','Run\x20`role\x20list`,\x20or\x20use\x20SELF/ALL/<id>.',';\x20SELF\x20=\x20only\x20own\x20rows','data\x20create','filter','role','some','action','entries','trim','find','data\x20detail','apiList','rolePermit','5652360zzlQvC','data\x20export','--grant\x20and\x20--revoke\x20are\x20mutually\x20exclusive.','revoke','SELF\x20is\x20not\x20allowed\x20for\x20','data\x20delete','join','create-roles','2969232BzVouZ','ALL','menu-roles','menuPermit','Role\x20id\x20','Special\x20role\x20','118734avYmIA','key','split','map','110osaZWg','test','Missing\x20action.','appCode','datasetCode','str','push','\x22\x20not\x20found.','\x20(comma-separated\x20SELF/ALL/id/name)','dataDetail','flagMissing','resourceName','Comma-separated\x20datasetCodes\x20to\x20revoke\x20API\x20access\x20for','228882iPrDgN','access','SELF','pageNodeList','roleName','resourceCode','number','grant','string','menus','Run\x20`role\x20list`.','\x22\x20is\x20ambiguous\x20(ids:\x20','boolean','allowSelf','Disambiguate\x20with\x20an\x20id.','330190JuRglC','dataCreate','dataDelete','Menu\x20id\x20(from\x20`menu\x20list`)','\x20not\x20found.','validation','detail-roles','export-roles','1326288TtXhzv','get'];a140_0x2014=function(){return _0x5449ab;};return a140_0x2014();}(function(_0x5ad67a,_0x3d251c){const _0x12a49f=a140_0x1b88,_0xc3ec89=_0x5ad67a();while(!![]){try{const _0xd6d572=-parseInt(_0x12a49f(0x198))/0x1+-parseInt(_0x12a49f(0x164))/0x2+-parseInt(_0x12a49f(0x16c))/0x3+-parseInt(_0x12a49f(0x170))/0x4+parseInt(_0x12a49f(0x19c))/0x5*(parseInt(_0x12a49f(0x155))/0x6)+-parseInt(_0x12a49f(0x178))/0x7*(-parseInt(_0x12a49f(0x192))/0x8)+parseInt(_0x12a49f(0x18a))/0x9;if(_0xd6d572===_0x3d251c)break;else _0xc3ec89['push'](_0xc3ec89['shift']());}catch(_0xcd83d7){_0xc3ec89['push'](_0xc3ec89['shift']());}}}(a140_0x2014,0xf152a));import{listPermitRoles}from'../../core/api-client.js';import{CliErrors}from'../../errors.js';export const MENU_ID_FLAG={'name':a140_0x44dbb7(0x176),'type':a140_0x44dbb7(0x15b),'required':!![],'description':a140_0x44dbb7(0x167)};export const ROLE_REF_FLAG={'name':a140_0x44dbb7(0x181),'type':a140_0x44dbb7(0x15d),'required':!![],'description':a140_0x44dbb7(0x171)};export const GRANT_FLAG={'name':a140_0x44dbb7(0x15c),'type':a140_0x44dbb7(0x161),'required':![],'description':'Grant\x20access\x20to\x20the\x20listed\x20resources'};export const REVOKE_FLAG={'name':'revoke','type':a140_0x44dbb7(0x161),'required':![],'description':'Revoke\x20access\x20to\x20the\x20listed\x20resources'};export const MENUS_FLAG={'name':a140_0x44dbb7(0x15e),'type':'string','required':!![],'description':'Comma-separated\x20menu\x20resourceCodes\x20to\x20grant/revoke'};export const DATASETS_FLAG={'name':a140_0x44dbb7(0x172),'type':a140_0x44dbb7(0x15d),'required':!![],'description':a140_0x44dbb7(0x154)};export const PAGE_SLOT_SPECS=[{'flag':a140_0x44dbb7(0x194),'key':a140_0x44dbb7(0x195),'allowSelf':![],'label':a140_0x44dbb7(0x16f)},{'flag':a140_0x44dbb7(0x191),'key':a140_0x44dbb7(0x165),'allowSelf':![],'label':a140_0x44dbb7(0x17f)},{'flag':'update-roles','key':a140_0x44dbb7(0x17b),'allowSelf':![],'label':'data\x20update'},{'flag':a140_0x44dbb7(0x16e),'key':a140_0x44dbb7(0x166),'allowSelf':![],'label':a140_0x44dbb7(0x18f)},{'flag':a140_0x44dbb7(0x16a),'key':a140_0x44dbb7(0x151),'allowSelf':![],'label':a140_0x44dbb7(0x187)},{'flag':a140_0x44dbb7(0x16b),'key':'dataExport','allowSelf':![],'label':a140_0x44dbb7(0x18b)},{'flag':'row-roles','key':'dataPermit','allowSelf':!![],'label':'row\x20visibility'}];export const PAGE_SET_ROLE_FLAGS=PAGE_SLOT_SPECS[a140_0x44dbb7(0x19b)](_0x33c879=>({'name':_0x33c879['flag'],'type':a140_0x44dbb7(0x15d),'required':![],'description':'Roles\x20for\x20'+_0x33c879['label']+a140_0x44dbb7(0x150)+(_0x33c879[a140_0x44dbb7(0x162)]?a140_0x44dbb7(0x17e):'')}));export function splitList(_0x5b0522){const _0x505c30=a140_0x44dbb7;return _0x5b0522[_0x505c30(0x19a)](',')[_0x505c30(0x19b)](_0x23b847=>_0x23b847[_0x505c30(0x185)]())[_0x505c30(0x180)](Boolean);}export function projectRoleRef(_0x50827a){const _0x3c9234=a140_0x44dbb7;return{'id':_0x50827a['id'],'roleName':_0x50827a[_0x3c9234(0x159)],'roleType':_0x50827a['roleType']};}export async function resolvePermitRoles(_0x3b0061,_0x19e0c6,_0x1b512d){const _0x4329c4=a140_0x44dbb7,_0x28f37f=await listPermitRoles(_0x3b0061,{'needSelf':!![],'needPublic':!![]}),_0x45138f=[];for(const _0x5caa7a of _0x19e0c6){const _0x4a6a58=resolveOnePermitRole(_0x28f37f,_0x5caa7a);if(!_0x1b512d[_0x4329c4(0x162)]&&_0x4a6a58[_0x4329c4(0x175)]===_0x4329c4(0x157))throw CliErrors['validation'](_0x4329c4(0x18e)+_0x1b512d['label']+'.',_0x4329c4(0x17c));if(!_0x45138f[_0x4329c4(0x182)](_0x2d1e81=>_0x2d1e81['id']===_0x4a6a58['id']))_0x45138f[_0x4329c4(0x14e)](_0x4a6a58);}return _0x45138f;}function resolveOnePermitRole(_0x24701e,_0x111009){const _0x55972b=a140_0x44dbb7,_0x21199c=_0x111009[_0x55972b(0x185)](),_0x1a0203=_0x21199c['toUpperCase']();if(_0x1a0203===_0x55972b(0x157)||_0x1a0203===_0x55972b(0x193)){const _0x2c42c3=_0x24701e['find'](_0x203015=>_0x203015[_0x55972b(0x175)]===_0x1a0203);if(!_0x2c42c3)throw CliErrors[_0x55972b(0x169)](_0x55972b(0x197)+_0x1a0203+'\x20is\x20not\x20available\x20for\x20this\x20app.');return _0x2c42c3;}if(/^-?\d+$/[_0x55972b(0x19d)](_0x21199c)){const _0x4cab19=Number(_0x21199c),_0x41ad1c=_0x24701e[_0x55972b(0x186)](_0x581008=>_0x581008['id']===_0x4cab19);if(!_0x41ad1c)throw CliErrors[_0x55972b(0x169)](_0x55972b(0x196)+_0x4cab19+_0x55972b(0x168),_0x55972b(0x15f));return _0x41ad1c;}const _0x23cd5d=_0x24701e[_0x55972b(0x180)](_0x3c6bc8=>_0x3c6bc8[_0x55972b(0x159)]===_0x21199c);if(_0x23cd5d[_0x55972b(0x173)]===0x0)throw CliErrors[_0x55972b(0x169)]('Role\x20\x22'+_0x21199c+_0x55972b(0x14f),_0x55972b(0x17d));if(_0x23cd5d['length']>0x1)throw CliErrors[_0x55972b(0x169)]('Role\x20\x22'+_0x21199c+_0x55972b(0x160)+_0x23cd5d[_0x55972b(0x19b)](_0x2abd09=>_0x2abd09['id'])[_0x55972b(0x190)](',\x20')+').',_0x55972b(0x163));return _0x23cd5d[0x0];}export function projectPageSlot(_0x47676f){const _0x585d54=a140_0x44dbb7;if(!_0x47676f)return null;return{'resourceCode':_0x47676f[_0x585d54(0x15a)],'roles':(_0x47676f[_0x585d54(0x189)]??[])[_0x585d54(0x19b)](projectRoleRef)};}export function projectPagePermit(_0x519664){const _0x53de6c=a140_0x44dbb7,_0x5818fe={'menuId':_0x519664['menuId'],'appCode':_0x519664[_0x53de6c(0x14b)],'menuPermit':projectPageSlot(_0x519664[_0x53de6c(0x195)])};for(const _0x1e7f9c of PAGE_SLOT_SPECS){if(_0x1e7f9c['key']===_0x53de6c(0x195))continue;_0x5818fe[_0x1e7f9c[_0x53de6c(0x199)]]=projectPageSlot(_0x519664[_0x1e7f9c[_0x53de6c(0x199)]]);}return _0x5818fe;}export function flattenMenuResources(_0x2896d0){const _0x51e0dc=new Map(),_0x4ed3ce=_0xabb6c4=>{const _0x5a490b=a140_0x1b88;for(const _0x8be821 of _0xabb6c4??[]){_0x51e0dc[_0x5a490b(0x17a)](_0x8be821['resourceCode'],{'resourceCode':_0x8be821[_0x5a490b(0x15a)],'resourceName':_0x8be821[_0x5a490b(0x153)],'action':_0x8be821[_0x5a490b(0x179)]?.[0x0]??'0'});if(_0x8be821[_0x5a490b(0x158)])_0x4ed3ce(_0x8be821[_0x5a490b(0x158)]);}};return _0x4ed3ce(_0x2896d0),_0x51e0dc;}function a140_0x1b88(_0x203097,_0x4158e1){_0x203097=_0x203097-0x14b;const _0x201419=a140_0x2014();let _0x1b88e1=_0x201419[_0x203097];return _0x1b88e1;}export function flattenApiResources(_0x163d68){const _0x2e708d=a140_0x44dbb7,_0xf04e01=new Map(),_0x3c9e9f=new Map();for(const _0x5ed704 of _0x163d68){const _0x2f8142=_0x5ed704[_0x2e708d(0x188)]??{};for(const [_0x1fddc9,_0x3d7410]of Object[_0x2e708d(0x184)](_0x2f8142)){_0xf04e01[_0x2e708d(0x17a)](_0x1fddc9,{'resourceCode':_0x1fddc9,'resourceName':_0x5ed704[_0x2e708d(0x153)],'datasetCode':_0x5ed704[_0x2e708d(0x14c)],'action':_0x3d7410?.[0x0]??'0'});const _0x3927a5=_0x3c9e9f[_0x2e708d(0x16d)](_0x5ed704[_0x2e708d(0x14c)])??[];_0x3927a5[_0x2e708d(0x14e)](_0x1fddc9),_0x3c9e9f[_0x2e708d(0x17a)](_0x5ed704['datasetCode'],_0x3927a5);}}return{'byCode':_0xf04e01,'byDataset':_0x3c9e9f};}export function buildPermits(_0x4a349c,_0x3cd3f7){const _0x48f07d=a140_0x44dbb7,_0x3e10a4={};for(const [_0x4b1a58,_0x2b8d80]of _0x4a349c){const _0x3b468a=_0x3cd3f7[_0x48f07d(0x16d)](_0x4b1a58)??_0x2b8d80[_0x48f07d(0x183)];_0x3e10a4[_0x4b1a58]=[_0x3b468a];}return _0x3e10a4;}export function readRoleRef(_0x5a4e19){const _0x42b9b6=a140_0x44dbb7,_0xaf472b=_0x5a4e19[_0x42b9b6(0x14d)](_0x42b9b6(0x181))[_0x42b9b6(0x185)]();if(!_0xaf472b)throw CliErrors[_0x42b9b6(0x152)](_0x42b9b6(0x181),'Pass\x20--role\x20<id|name>.');return _0xaf472b;}export function readGrantRevoke(_0x1f2b8a){const _0x3a1928=a140_0x44dbb7,_0x2a099f=_0x1f2b8a[_0x3a1928(0x174)](_0x3a1928(0x15c)),_0x4d184e=_0x1f2b8a[_0x3a1928(0x174)](_0x3a1928(0x18d));if(_0x2a099f&&_0x4d184e)throw CliErrors[_0x3a1928(0x169)](_0x3a1928(0x18c));if(!_0x2a099f&&!_0x4d184e)throw CliErrors['validation'](_0x3a1928(0x19e),_0x3a1928(0x177));return _0x2a099f?_0x3a1928(0x156):'0';}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4b8c35,_0x37502b){const _0x1ec591=a141_0x2278,_0x399ee2=_0x4b8c35();while(!![]){try{const _0x5b983a=-parseInt(_0x1ec591(0x7b))/0x1*(-parseInt(_0x1ec591(0x70))/0x2)+parseInt(_0x1ec591(0x72))/0x3+parseInt(_0x1ec591(0x77))/0x4+-parseInt(_0x1ec591(0x8c))/0x5+-parseInt(_0x1ec591(0x75))/0x6*(parseInt(_0x1ec591(0x71))/0x7)+-parseInt(_0x1ec591(0x8a))/0x8+parseInt(_0x1ec591(0x86))/0x9;if(_0x5b983a===_0x37502b)break;else _0x399ee2['push'](_0x399ee2['shift']());}catch(_0x2058c4){_0x399ee2['push'](_0x399ee2['shift']());}}}(a141_0x3295,0x98475));import{existsSync}from'node:fs';function a141_0x3295(){const _0x58e91d=['1041488PohDXp','497teJoZI','174777msjyLB','trim','env','138Civkkd','length','356504ihEopr','string','cyan','No\x20valid\x20login\x20detected.\x20Login\x20first\x20to\x20pull\x20API\x20config?','1HPcFVN','√\x20Login\x20status:\x20','Login\x20failed','production','\x22\x20already\x20exists','Project\x20name\x20cannot\x20exceed\x2050\x20characters','cwd','√\x20Project\x20Name:\x20','Skipped','resolve','green','7566318AOYAJy','my-app','Project\x20name:','Directory\x20\x22','1362464GQvjNy','log','3565785MTHjzE','Not\x20set','test'];a141_0x3295=function(){return _0x58e91d;};return a141_0x3295();}import a141_0x3ca5d7 from'node:path';import a141_0x31919a from'chalk';import{input,confirm}from'@inquirer/prompts';import{getIsSessionValid}from'../../../auth/is-session-valid.js';function a141_0x2278(_0x18d6b3,_0x45e996){_0x18d6b3=_0x18d6b3-0x6f;const _0x329571=a141_0x3295();let _0x22780b=_0x329571[_0x18d6b3];return _0x22780b;}import{authServer}from'../../../auth/auth-server.js';import{readConfig}from'../../../utils/config.js';import{selectSingleAppcode}from'../../../commands/common/app-selector.js';export async function guidedCreateProject(_0x531fc3,_0x3360aa,_0x261801){const _0x38830d=a141_0x2278,_0x2ce3f2=_0x38830d(0x87),_0x5895fa=readConfig(),_0x12aee8=typeof _0x5895fa[_0x38830d(0x74)]===_0x38830d(0x78)?_0x5895fa[_0x38830d(0x74)]:undefined,_0x341cbc=await input({'message':_0x38830d(0x88),'default':_0x2ce3f2,'validate':_0xc4bcdb=>{const _0x154296=_0x38830d,_0x75eb36=_0xc4bcdb[_0x154296(0x73)]()||_0x2ce3f2;if(_0x75eb36[_0x154296(0x76)]>0x32)return _0x154296(0x80);const _0x10224e=/^[A-Za-z0-9][A-Za-z0-9_-]*$/;if(_0x75eb36&&!_0x10224e[_0x154296(0x6f)](_0x75eb36))return'Must\x20start\x20with\x20a\x20letter/number\x20and\x20only\x20contain\x20letters,\x20numbers,\x20-\x20and\x20_';const _0x429428=a141_0x3ca5d7[_0x154296(0x84)](process[_0x154296(0x81)](),_0x75eb36);if(existsSync(_0x429428))return _0x154296(0x89)+_0x75eb36+_0x154296(0x7f);return!![];}});console[_0x38830d(0x8b)](a141_0x31919a['green'](_0x38830d(0x82)+a141_0x31919a[_0x38830d(0x79)](_0x341cbc)));const _0x63ff8b=await selectSingleAppcode(_0x261801);console['log'](a141_0x31919a[_0x38830d(0x85)]('√\x20App\x20Code:\x20'+a141_0x31919a[_0x38830d(0x79)](_0x63ff8b||_0x38830d(0x8d))));if(_0x63ff8b){const _0x2e2a3a=await getIsSessionValid();if(!_0x2e2a3a){const _0x2bc2e3=await confirm({'message':_0x38830d(0x7a),'default':!![]});if(_0x2bc2e3){const _0x223029=await authServer({'silent':!![]});console[_0x38830d(0x8b)](a141_0x31919a[_0x38830d(0x85)](_0x38830d(0x7c)+a141_0x31919a[_0x38830d(0x79)](_0x223029?'Logged\x20in':_0x38830d(0x7d))));}else console[_0x38830d(0x8b)](a141_0x31919a[_0x38830d(0x85)](_0x38830d(0x7c)+a141_0x31919a[_0x38830d(0x79)](_0x38830d(0x83))));}await _0x531fc3({'projectName':_0x341cbc,'appCode':_0x63ff8b,'env':_0x3360aa||_0x12aee8||_0x38830d(0x7e)});}else await _0x531fc3({'projectName':_0x341cbc,'env':_0x3360aa||_0x12aee8||_0x38830d(0x7e)});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a142_0x2e86(_0x421647,_0x4f5c33){_0x421647=_0x421647-0x175;const _0x567b97=a142_0x567b();let _0x2e86e5=_0x567b97[_0x421647];return _0x2e86e5;}(function(_0x2b36d0,_0x2e0ac3){const _0x17af80=a142_0x2e86,_0x2a1e8c=_0x2b36d0();while(!![]){try{const _0x178d73=parseInt(_0x17af80(0x175))/0x1+parseInt(_0x17af80(0x17f))/0x2*(parseInt(_0x17af80(0x17d))/0x3)+parseInt(_0x17af80(0x17c))/0x4+parseInt(_0x17af80(0x17b))/0x5+parseInt(_0x17af80(0x179))/0x6*(parseInt(_0x17af80(0x176))/0x7)+parseInt(_0x17af80(0x181))/0x8*(-parseInt(_0x17af80(0x178))/0x9)+parseInt(_0x17af80(0x177))/0xa*(-parseInt(_0x17af80(0x17a))/0xb);if(_0x178d73===_0x2e0ac3)break;else _0x2a1e8c['push'](_0x2a1e8c['shift']());}catch(_0x2675bd){_0x2a1e8c['push'](_0x2a1e8c['shift']());}}}(a142_0x567b,0xc491c));export function formatElapsed(_0x2e385c){const _0x1e8665=a142_0x2e86,_0x596d08=Date[_0x1e8665(0x180)]()-_0x2e385c;if(_0x596d08<0x3e8)return _0x596d08+'ms';const _0x4e9522=(_0x596d08/0x3e8)['toFixed'](0x2),_0x56f2c5=_0x4e9522[_0x1e8665(0x17e)](/\.?0+$/u,'');return _0x56f2c5+'s';}function a142_0x567b(){const _0x4d8639=['replace','757994bIDFJb','now','2488oFFKej','1316747VJmBTr','7DQveLB','94570fehlaN','19593mRjTsI','2517306fekSZt','3014hnvKxU','2312240BGwAnN','4466692WryhWj','6jGSoAQ'];a142_0x567b=function(){return _0x4d8639;};return a142_0x567b();}
|
|
@@ -1 +1 @@
|
|
|
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
|
+
(function(_0x3413bd,_0x117d28){const _0x1f6d30=a143_0x57ff,_0x4f08f7=_0x3413bd();while(!![]){try{const _0x5cafc3=parseInt(_0x1f6d30(0x21a))/0x1*(-parseInt(_0x1f6d30(0x217))/0x2)+-parseInt(_0x1f6d30(0x223))/0x3*(parseInt(_0x1f6d30(0x24c))/0x4)+parseInt(_0x1f6d30(0x1f2))/0x5*(-parseInt(_0x1f6d30(0x231))/0x6)+-parseInt(_0x1f6d30(0x243))/0x7*(parseInt(_0x1f6d30(0x20c))/0x8)+-parseInt(_0x1f6d30(0x1f1))/0x9*(parseInt(_0x1f6d30(0x229))/0xa)+-parseInt(_0x1f6d30(0x23c))/0xb*(-parseInt(_0x1f6d30(0x20a))/0xc)+parseInt(_0x1f6d30(0x212))/0xd*(parseInt(_0x1f6d30(0x1fa))/0xe);if(_0x5cafc3===_0x117d28)break;else _0x4f08f7['push'](_0x4f08f7['shift']());}catch(_0x1c74f3){_0x4f08f7['push'](_0x4f08f7['shift']());}}}(a143_0x49d1,0x8c3d4));import a143_0x544674 from'path';import a143_0x2b8d26 from'fs';import a143_0x520a72 from'chalk';import a143_0x15c5a9 from'ora';import{guidedCreateProject}from'../../../commands/project/create/enhanced-guided-create.js';import{fetchModelList}from'../../../core/api-client.js';function a143_0x49d1(){const _0x1f18d9=['1.0.0','*\x20Creating\x20configuration\x20file\x20for\x20project\x20','projectCode','245102oWeabZ','writeFileSync','create','3AWKqkA','gray','W_OK','cd\x20','modelCount','log','name','Project\x20directory\x20','setLogPath','147954BGfJVT','join','√\x20package.json\x20updated:\x20name=','readFileSync','warn','√\x20Configuration\x20file\x20created,\x20you\x20can\x20configure\x20later\x20with\x20\x27','11051470KhjRYJ','...','\x20Generated\x20by\x20rabetbase\x20cli\x20','CLI\x20版本检查','\x20√\x20','start','resolve','bold','12GXElXb','apps','\x20api\x20pull','cyan','green','*\x20Configuring\x20AppCode\x20for\x20project\x20','constants','\x20\x202.\x20Pull\x20API\x20configuration:\x20','项目创建完成:\x20','rmSync','!\x20API\x20configuration\x20pull\x20error,\x20you\x20can\x20manually\x20run:\x20rabetbase\x20api\x20pull','11pUodpr','清理项目目录失败:\x20','description','\x20|\x20Default:\x20','配置应用AppCode失败','*\x20Updating\x20package.json\x20name\x20and\x20description\x20fields','\x20config\x20set\x20appcode\x20<app-code>\x27','2544983MKIUQb','info','🚀\x20Next\x20Steps:','version','\x20\x201.\x20Start\x20project:\x20','√\x20Pulled\x20','defaultApp','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters','package.json','68VqaBbN','projectName','stringify','*\x20Pulling\x20API\x20configuration...','项目创建失败:\x20','配置应用AppCode:\x20','length','9oCGkxi','1111960MqAatd','开始创建项目:\x20','API\x20配置拉取异常','production','\x20&&\x20','Invalid\x20characters\x20in\x20project\x20name.\x20Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','repeat','fail','896WzViKC','cookie','cwd','\x20|\x20AppCode:\x20','appCode','success','env','needsUpgrade','更新\x20package.json\x20name','existsSync','Format\x20code','currentVersion','minimumVersion','stop','parse','Cannot\x20create\x20project\x20in\x20current\x20directory,\x20please\x20check\x20directory\x20permissions','330972tUyArx','message','24PUSDqm','accessSync','chdir','Project\x20name:\x20','keys','Project\x20name\x20cannot\x20be\x20empty','892437pbuPor','utf8'];a143_0x49d1=function(){return _0x1f18d9;};return a143_0x49d1();}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';function a143_0x57ff(_0x2698ec,_0x95c510){_0x2698ec=_0x2698ec-0x1ee;const _0x49d1ab=a143_0x49d1();let _0x57ff2f=_0x49d1ab[_0x2698ec];return _0x57ff2f;}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';export async function createApp(_0x252313){const _0x570754=a143_0x57ff,_0x1c2e21=await checkCliVersion();(_0x1c2e21[_0x570754(0x201)]||_0x1c2e21['belowMinimum'])&&(printCliUpgradeWarning(_0x1c2e21),assertCliVersionSupported(_0x1c2e21),logger[_0x570754(0x244)](_0x570754(0x219),_0x570754(0x22c),{'currentVersion':_0x1c2e21[_0x570754(0x205)],'stableVersion':_0x1c2e21['stableVersion'],'minimumVersion':_0x1c2e21[_0x570754(0x206)],'needsUpgrade':_0x1c2e21['needsUpgrade'],'belowMinimum':_0x1c2e21['belowMinimum']}));if(_0x252313[_0x570754(0x216)]&&_0x252313[_0x570754(0x1fe)])await runCreate({'projectName':_0x252313['projectCode'],'appCode':_0x252313[_0x570754(0x1fe)],'env':_0x252313[_0x570754(0x200)]},_0x252313);else{if(_0x252313[_0x570754(0x216)]){const _0x2017a7=await selectSingleAppcode(_0x252313[_0x570754(0x1fb)]);await runCreate({'projectName':_0x252313[_0x570754(0x216)],'appCode':_0x2017a7||undefined,'env':_0x252313['env']},_0x252313);}else await guidedCreateProject(_0x291b56=>runCreate(_0x291b56,_0x252313),_0x252313[_0x570754(0x200)],_0x252313[_0x570754(0x1fb)]);}}async function runCreate(_0x11283a,_0x3e8425){const _0x213e78=a143_0x57ff;if(!_0x11283a[_0x213e78(0x24d)]||_0x11283a[_0x213e78(0x24d)]['trim']()==='')throw new Error(_0x213e78(0x211));const _0x555065=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x555065['test'](_0x11283a['projectName']))throw new Error(_0x213e78(0x1f7));if(_0x11283a['projectName'][_0x213e78(0x1f0)]>0x64)throw new Error(_0x213e78(0x24a));const _0x200cd3=a143_0x544674[_0x213e78(0x22f)](process[_0x213e78(0x1fc)](),_0x11283a[_0x213e78(0x24d)]);if(a143_0x2b8d26[_0x213e78(0x203)](_0x200cd3))throw new Error(_0x213e78(0x221)+_0x11283a['projectName']+'\x20already\x20exists');try{a143_0x2b8d26[_0x213e78(0x20d)](a143_0x544674['dirname'](_0x200cd3),a143_0x2b8d26[_0x213e78(0x237)][_0x213e78(0x21c)]);}catch{throw new Error(_0x213e78(0x209));}logger[_0x213e78(0x222)](_0x200cd3),logger['info'](_0x213e78(0x219),_0x213e78(0x1f3)+_0x11283a['projectName'],{'projectDir':_0x200cd3,'appCode':_0x11283a[_0x213e78(0x1fe)]}),console[_0x213e78(0x21f)](),console['log'](a143_0x520a72[_0x213e78(0x235)](_0x213e78(0x22d))+_0x213e78(0x20f)+a143_0x520a72['green'](_0x11283a[_0x213e78(0x24d)])+(_0x11283a[_0x213e78(0x1fe)]?_0x213e78(0x1fd)+a143_0x520a72[_0x213e78(0x234)](_0x11283a[_0x213e78(0x1fe)]):''));try{await runTask('Copy\x20project\x20files',()=>copyProjectTemplate(_0x11283a[_0x213e78(0x24d)])),await updatePackageJsonName(_0x11283a[_0x213e78(0x24d)]),await runTask('Install\x20dependencies',()=>installDependencies(_0x11283a[_0x213e78(0x24d)])),await runTask(_0x213e78(0x204),()=>formatProjectCode(_0x11283a[_0x213e78(0x24d)])),await configureAppCode(_0x11283a[_0x213e78(0x24d)],_0x11283a['appCode']||'',_0x11283a[_0x213e78(0x200)]);let _0x4866be=![];if(_0x11283a['appCode']){console[_0x213e78(0x21f)](_0x213e78(0x24f));const _0xb9a489=process['cwd']();try{process[_0x213e78(0x20e)](_0x200cd3);const _0x16b917=_0x11283a[_0x213e78(0x200)]||_0x213e78(0x1f5);initEnv(_0x16b917);const {configArray:_0x3db896}=await fetchModelList(_0x11283a[_0x213e78(0x1fe)],_0x3e8425[_0x213e78(0x1fb)]||''),_0x30c5df=DEFAULT_API_DIR,_0x1df86a=await generateApiFile(_0x3db896,'',_0x11283a[_0x213e78(0x1fe)],!![],_0x16b917,_0x30c5df);console['log'](_0x213e78(0x248)+_0x3db896[_0x213e78(0x1f0)]+'\x20dataset(s),\x20generated\x20'+_0x1df86a[_0x213e78(0x21e)]+'\x20model(s)'),logger[_0x213e78(0x244)](_0x213e78(0x219),'API\x20configuration\x20pulled:\x20'+_0x11283a['appCode']);}catch(_0x6a34c3){_0x4866be=!![],console[_0x213e78(0x21f)](_0x213e78(0x23b)),logger[_0x213e78(0x227)](_0x213e78(0x219),_0x213e78(0x1f4),{'error':_0x6a34c3 instanceof Error?_0x6a34c3[_0x213e78(0x20b)]:String(_0x6a34c3)});}finally{process[_0x213e78(0x20e)](_0xb9a489);}}logger[_0x213e78(0x1ff)](_0x213e78(0x219),_0x213e78(0x239)+_0x11283a[_0x213e78(0x24d)]),console[_0x213e78(0x21f)](),console[_0x213e78(0x21f)](a143_0x520a72[_0x213e78(0x235)]('─'['repeat'](0x3c))),console[_0x213e78(0x21f)](a143_0x520a72[_0x213e78(0x234)]['bold'](_0x213e78(0x245))),console[_0x213e78(0x21f)](),console[_0x213e78(0x21f)](_0x213e78(0x247)+a143_0x520a72[_0x213e78(0x234)][_0x213e78(0x230)](_0x213e78(0x21d)+_0x11283a[_0x213e78(0x24d)]+_0x213e78(0x1f6)+CLI_BIN_NAME+'\x20run\x20start')),_0x4866be&&console[_0x213e78(0x21f)](_0x213e78(0x238)+a143_0x520a72[_0x213e78(0x234)][_0x213e78(0x230)](CLI_BIN_NAME+_0x213e78(0x233))),console[_0x213e78(0x21f)](a143_0x520a72[_0x213e78(0x235)]('─'[_0x213e78(0x1f8)](0x3c)));}catch(_0xd9362e){logger['error'](_0x213e78(0x219),_0x213e78(0x1ee)+_0x11283a[_0x213e78(0x24d)],{'error':_0xd9362e instanceof Error?_0xd9362e[_0x213e78(0x20b)]:String(_0xd9362e)});try{a143_0x2b8d26[_0x213e78(0x203)](_0x200cd3)&&(console[_0x213e78(0x21f)]('*\x20Cleaning\x20up\x20failed\x20project\x20directory:\x20'+_0x200cd3),a143_0x2b8d26[_0x213e78(0x23a)](_0x200cd3,{'recursive':!![],'force':!![]}));}catch{logger[_0x213e78(0x227)]('create',_0x213e78(0x23d)+_0x200cd3);}throw _0xd9362e;}}async function runTask(_0x556e67,_0x552eff){const _0x39a1f5=a143_0x57ff,_0x21d6f0=a143_0x15c5a9(_0x556e67+_0x39a1f5(0x22a))[_0x39a1f5(0x22e)]();try{const _0x5ac5ab=await _0x552eff();_0x21d6f0[_0x39a1f5(0x207)](),console[_0x39a1f5(0x21f)](''+a143_0x520a72[_0x39a1f5(0x235)](_0x39a1f5(0x22d))+_0x556e67+'\x20'+a143_0x520a72[_0x39a1f5(0x21b)]('['+_0x5ac5ab+']'));}catch(_0x489ef9){_0x21d6f0[_0x39a1f5(0x1f9)](_0x556e67);throw _0x489ef9;}}async function updatePackageJsonName(_0x163c61){const _0x19bc72=a143_0x57ff,_0x2dad67=a143_0x544674[_0x19bc72(0x22f)](process['cwd'](),_0x163c61),_0x1c92de=a143_0x544674[_0x19bc72(0x224)](_0x2dad67,_0x19bc72(0x24b));try{console[_0x19bc72(0x21f)](_0x19bc72(0x241));const _0x3c91d9=getRabetbaseCliPackageRoot(),_0x57f80c=a143_0x544674['join'](_0x3c91d9,'package.json');let _0x3966af=_0x19bc72(0x214);try{const _0x4444f9=JSON['parse'](a143_0x2b8d26[_0x19bc72(0x226)](_0x57f80c,_0x19bc72(0x213)));_0x3966af=_0x4444f9[_0x19bc72(0x246)]||_0x19bc72(0x214);}catch{}const _0x5e514c=a143_0x2b8d26[_0x19bc72(0x226)](_0x1c92de,_0x19bc72(0x213)),_0x1cc08a=JSON[_0x19bc72(0x208)](_0x5e514c);_0x1cc08a[_0x19bc72(0x220)]=_0x163c61,_0x1cc08a[_0x19bc72(0x23e)]=_0x163c61+_0x19bc72(0x22b)+_0x3966af,a143_0x2b8d26[_0x19bc72(0x218)](_0x1c92de,JSON[_0x19bc72(0x24e)](_0x1cc08a,null,0x2)+'\x0a','utf8'),console[_0x19bc72(0x21f)](_0x19bc72(0x225)+_0x163c61),logger['info'](_0x19bc72(0x219),_0x19bc72(0x202));}catch(_0x209131){logger['error'](_0x19bc72(0x219),'更新\x20package.json\x20失败');throw _0x209131;}}async function configureAppCode(_0x3a4bb7,_0x2b8427,_0x1512eb){const _0x423395=a143_0x57ff,_0x2aee15=a143_0x544674[_0x423395(0x22f)](process[_0x423395(0x1fc)](),_0x3a4bb7),_0x2dcc23=a143_0x544674[_0x423395(0x224)](_0x2aee15,NEW_CONFIG_NAME);try{_0x2b8427?console['log'](_0x423395(0x236)+_0x3a4bb7+':\x20'+_0x2b8427):console[_0x423395(0x21f)](_0x423395(0x215)+_0x3a4bb7);const _0x3027d3=getRabetbaseCliPackageRoot(),_0x460975=a143_0x544674[_0x423395(0x224)](_0x3027d3,_0x423395(0x24b));let _0x5dd327=_0x423395(0x214);try{const _0x1d9419=JSON[_0x423395(0x208)](a143_0x2b8d26['readFileSync'](_0x460975,'utf8'));_0x5dd327=_0x1d9419[_0x423395(0x246)]||_0x423395(0x214);}catch{}const _0x471e18=readConfig(),_0x205184=typeof _0x471e18[_0x423395(0x200)]==='string'?_0x471e18[_0x423395(0x200)]:undefined,_0x4b18a8={};for(const _0x31dca6 of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x471e18[_0x31dca6]!=null)_0x4b18a8[_0x31dca6]=_0x471e18[_0x31dca6];}const _0x127db8=buildCanonicalProjectConfig(_0x4b18a8,{'appCodes':_0x2b8427?[_0x2b8427]:[],'env':_0x1512eb||_0x205184||'production','metadata':{'createdAt':new Date()['toLocaleString'](),'version':_0x5dd327}});writeConfigFile(_0x2dcc23,_0x127db8),_0x2b8427?console[_0x423395(0x21f)]('√\x20Configuration\x20file\x20created,\x20Apps:\x20'+Object[_0x423395(0x210)](_0x127db8[_0x423395(0x232)]||{})[_0x423395(0x224)](',\x20')+_0x423395(0x23f)+_0x127db8[_0x423395(0x249)]):console[_0x423395(0x21f)](_0x423395(0x228)+CLI_BIN_NAME+_0x423395(0x242)),logger['info'](_0x423395(0x219),_0x423395(0x1ef)+_0x2b8427);}catch(_0x5455d7){logger['error'](_0x423395(0x219),_0x423395(0x240));}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x47dc19,_0x3b22d5){const _0x516866=a144_0x4c79,_0x21c8f5=_0x47dc19();while(!![]){try{const _0x255889=-parseInt(_0x516866(0xae))/0x1*(parseInt(_0x516866(0xb7))/0x2)+-parseInt(_0x516866(0x96))/0x3*(-parseInt(_0x516866(0xa6))/0x4)+-parseInt(_0x516866(0xb6))/0x5*(parseInt(_0x516866(0xac))/0x6)+parseInt(_0x516866(0xca))/0x7*(-parseInt(_0x516866(0x9b))/0x8)+-parseInt(_0x516866(0xb2))/0x9*(-parseInt(_0x516866(0x8e))/0xa)+-parseInt(_0x516866(0xc6))/0xb*(parseInt(_0x516866(0x91))/0xc)+parseInt(_0x516866(0xc1))/0xd*(parseInt(_0x516866(0xc4))/0xe);if(_0x255889===_0x3b22d5)break;else _0x21c8f5['push'](_0x21c8f5['shift']());}catch(_0x34a0a4){_0x21c8f5['push'](_0x21c8f5['shift']());}}}(a144_0x2356,0x8dded));import a144_0x46c4cf from'path';import a144_0x6a4dca from'fs/promises';import{existsSync}from'fs';import{CLI_BIN_NAME}from'../../../constant/cli.js';function a144_0x4c79(_0x3ab7e8,_0x43f392){_0x3ab7e8=_0x3ab7e8-0x8d;const _0x2356ac=a144_0x2356();let _0x4c79e7=_0x2356ac[_0x3ab7e8];return _0x4c79e7;}import{DEFAULT_API_DIR}from'../../../constant/paths.js';import{exec,execSync}from'child_process';import{copyDirectory}from'../../../utils/copy-directory.js';import{promisify}from'util';function a144_0x2356(){const _0x4f5734=['\x20\x20√\x20Project\x20template\x20created','chdir','207335NdijrO','1951030vkfvIS','join','\x20\x20Pulling\x20API\x20configuration...','\x20\x20√\x20Code\x20formatted','description','dirname','\x20\x20√\x20package.json\x20updated','modelCount','\x20dataset(s),\x20generated\x20','access','13oLOqmd','bun\x20run\x20format','*\x20Creating\x20project\x20','44782514OkYkrj','\x20api\x20pull`\x20manually\x20later.','5855839DLZZlZ','Check\x20directory\x20permissions.','resolve','Not\x20allowed:\x20<\x20>\x20:\x20\x22\x20|\x20?\x20*\x20and\x20control\x20characters','21qMxLdY','\x0a√\x20Project\x20','bun','string','W_OK','1130nxyvxq','\x20\x20!\x20API\x20pull\x20failed,\x20run\x20`','log','24LpJLtW','validation','...','length','readFile','31470rphQXL','npm','writeFile','bun\x20--version','Project\x20directory\x20\x22','1367096TBdVDn','stringify','test','\x20created\x20successfully!','\x20\x20√\x20Configuration\x20file\x20created','\x20\x20√\x20Pulled\x20','name','cwd','utf-8','\x22\x20already\x20exists.','production','20ZSufLr','toLocaleString','constants','\x20\x20rabetbase\x20run\x20start\x0a','trim','\x0a\x20\x20cd\x20','102irIKDw','Cannot\x20create\x20project\x20in\x20current\x20directory.','1jPLFxR','Project\x20name\x20is\x20too\x20long,\x20maximum\x20100\x20characters.','\x20\x20√\x20Dependency\x20install\x20skipped\x20(non-interactive)','\x20\x20Installing\x20dependencies...','46809tWvEVf','env'];a144_0x2356=function(){return _0x4f5734;};return a144_0x2356();}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(_0x4861b7,_0x5dca88,_0x2d24d1,_0x15334c){const _0x51d2d5=a144_0x4c79,_0x3d779d=await checkCliVersion();(_0x3d779d['needsUpgrade']||_0x3d779d['belowMinimum'])&&(printCliUpgradeWarning(_0x3d779d),assertCliVersionSupported(_0x3d779d));if(!_0x4861b7||_0x4861b7[_0x51d2d5(0xaa)]()==='')throw CliErrors[_0x51d2d5(0x92)]('Project\x20name\x20cannot\x20be\x20empty.');const _0x466afe=/[<>:"|?*\x00-\x1f\x7f]/;if(_0x466afe[_0x51d2d5(0x9d)](_0x4861b7))throw CliErrors[_0x51d2d5(0x92)]('Project\x20name\x20contains\x20invalid\x20characters.',_0x51d2d5(0xc9));if(_0x4861b7[_0x51d2d5(0x94)]>0x64)throw CliErrors[_0x51d2d5(0x92)](_0x51d2d5(0xaf));const _0x455caa=a144_0x46c4cf[_0x51d2d5(0xc8)](process[_0x51d2d5(0xa2)](),_0x4861b7);if(existsSync(_0x455caa))throw CliErrors['validation'](_0x51d2d5(0x9a)+_0x4861b7+_0x51d2d5(0xa4),'Use\x20a\x20different\x20project\x20name.');try{const _0x289c14=a144_0x46c4cf[_0x51d2d5(0xbc)](_0x455caa);await a144_0x6a4dca[_0x51d2d5(0xc0)](_0x289c14,a144_0x6a4dca[_0x51d2d5(0xa8)][_0x51d2d5(0x8d)]);}catch{throw CliErrors['validation'](_0x51d2d5(0xad),_0x51d2d5(0xc7));}try{console[_0x51d2d5(0x90)](_0x51d2d5(0xc3)+_0x4861b7+_0x51d2d5(0x93));const _0x1a761b=getSubAppReactDemoTemplateDir();await copyDirectory(_0x1a761b,_0x455caa),console[_0x51d2d5(0x90)](_0x51d2d5(0xb4)),await updatePackageJsonName(_0x4861b7),console['log'](_0x51d2d5(0xbd)),console['log'](_0x51d2d5(0xb1)),console[_0x51d2d5(0x90)](_0x51d2d5(0xb0)),await formatCode(_0x455caa),console[_0x51d2d5(0x90)](_0x51d2d5(0xba)),await configureProject(_0x4861b7,_0x2d24d1,_0x5dca88),console[_0x51d2d5(0x90)](_0x51d2d5(0x9f)),_0x2d24d1&&await pullApiConfig(_0x455caa,_0x2d24d1,_0x5dca88,_0x15334c),console[_0x51d2d5(0x90)](_0x51d2d5(0xcb)+_0x4861b7+_0x51d2d5(0x9e)),console[_0x51d2d5(0x90)](_0x51d2d5(0xab)+_0x4861b7),console[_0x51d2d5(0x90)](_0x51d2d5(0xa9));}catch(_0x16b0be){try{existsSync(_0x455caa)&&await a144_0x6a4dca['rm'](_0x455caa,{'recursive':!![],'force':!![]});}catch{}throw _0x16b0be;}}async function updatePackageJsonName(_0x46e726){const _0x43f4b2=a144_0x4c79,_0xabbb54=a144_0x46c4cf[_0x43f4b2(0xc8)](process[_0x43f4b2(0xa2)](),_0x46e726),_0x38bf9c=a144_0x46c4cf[_0x43f4b2(0xb8)](_0xabbb54,'package.json'),_0x3ec82d=await a144_0x6a4dca[_0x43f4b2(0x95)](_0x38bf9c,_0x43f4b2(0xa3)),_0xd1a88a=JSON['parse'](_0x3ec82d);_0xd1a88a[_0x43f4b2(0xa1)]=_0x46e726,_0xd1a88a[_0x43f4b2(0xbb)]='A\x20project\x20created\x20with\x20Lovrabet\x20CLI',await a144_0x6a4dca[_0x43f4b2(0x98)](_0x38bf9c,JSON[_0x43f4b2(0x9c)](_0xd1a88a,null,0x2)+'\x0a');}function detectPackageManager(){const _0x59c738=a144_0x4c79;try{return execSync(_0x59c738(0x99),{'stdio':'ignore'}),_0x59c738(0xcc);}catch{return _0x59c738(0x97);}}async function formatCode(_0x18738e){const _0x2d2f1d=a144_0x4c79;try{await execAsync(_0x2d2f1d(0xc2),{'cwd':_0x18738e});}catch{}}async function configureProject(_0x48631b,_0x50f1b3,_0xdce1dd){const _0x387ad5=a144_0x4c79,_0x194b39=a144_0x46c4cf[_0x387ad5(0xc8)](process['cwd'](),_0x48631b),_0x5ae3c9=a144_0x46c4cf['join'](_0x194b39,NEW_CONFIG_NAME),_0x1b6543=readConfig(),_0x5a018e=typeof _0x1b6543[_0x387ad5(0xb3)]===_0x387ad5(0xcd)?_0x1b6543[_0x387ad5(0xb3)]:undefined,_0x53767b={};for(const _0x59904a of PROJECT_CREATE_INHERITABLE_KEYS){if(_0x1b6543[_0x59904a]!=null)_0x53767b[_0x59904a]=_0x1b6543[_0x59904a];}const _0x1e3543=buildCanonicalProjectConfig(_0x53767b,{'appCodes':_0x50f1b3?[_0x50f1b3]:[],'env':_0xdce1dd||_0x5a018e||_0x387ad5(0xa5),'metadata':{'createdAt':new Date()[_0x387ad5(0xa7)](),'version':getCliVersion()}});writeConfigFile(_0x5ae3c9,_0x1e3543);}async function pullApiConfig(_0x474c84,_0x2e2a69,_0x284320,_0x1690c3){const _0x4852ad=a144_0x4c79,_0x36bdc3=process[_0x4852ad(0xa2)]();try{process[_0x4852ad(0xb5)](_0x474c84);const _0x117c6b=_0x284320||'production';initEnv(_0x117c6b),console[_0x4852ad(0x90)](_0x4852ad(0xb9));const {configArray:_0x2b41aa}=await fetchModelList(_0x2e2a69,_0x1690c3||''),_0x23b6ee=await generateApiFile(_0x2b41aa,'',_0x2e2a69,!![],_0x117c6b,DEFAULT_API_DIR);console[_0x4852ad(0x90)](_0x4852ad(0xa0)+_0x2b41aa[_0x4852ad(0x94)]+_0x4852ad(0xbf)+_0x23b6ee[_0x4852ad(0xbe)]+'\x20model(s)');}catch(_0x5b354a){console[_0x4852ad(0x90)](_0x4852ad(0x8f)+CLI_BIN_NAME+_0x4852ad(0xc5));}finally{process[_0x4852ad(0xb5)](_0x36bdc3);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a145_0x398cba=a145_0x4131;(function(_0x52848b,_0x18bf26){const _0x12112e=a145_0x4131,_0x109b21=_0x52848b();while(!![]){try{const _0x5825ac=-parseInt(_0x12112e(0xcf))/0x1*(parseInt(_0x12112e(0xc8))/0x2)+-parseInt(_0x12112e(0xcd))/0x3+-parseInt(_0x12112e(0xd3))/0x4+-parseInt(_0x12112e(0xc6))/0x5+-parseInt(_0x12112e(0xce))/0x6*(parseInt(_0x12112e(0xd5))/0x7)+-parseInt(_0x12112e(0xc9))/0x8+parseInt(_0x12112e(0xd2))/0x9*(parseInt(_0x12112e(0xd1))/0xa);if(_0x5825ac===_0x18bf26)break;else _0x109b21['push'](_0x109b21['shift']());}catch(_0x31b7ad){_0x109b21['push'](_0x109b21['shift']());}}}(a145_0x23d4,0x1fa71));import a145_0x4d91c5 from'node:path';function a145_0x23d4(){const _0x4ef382=['15012MPsGDp','17ygofld','resolve','847330zBYfTt','72eKBRjF','232304rTSScg','projects','112jUPwmu','94950KDfihT','dirname','17080WenFBt','367768Jcxztq','join','sub-app-react-demo','templates','719898ECIeJH'];a145_0x23d4=function(){return _0x4ef382;};return a145_0x23d4();}import{fileURLToPath}from'node:url';const __dirname=a145_0x4d91c5[a145_0x398cba(0xc7)](fileURLToPath(import.meta.url));export function getRabetbaseCliPackageRoot(){const _0x33851f=a145_0x398cba;return a145_0x4d91c5[_0x33851f(0xd0)](__dirname,'../../../../');}function a145_0x4131(_0x3834a9,_0x6cd7b6){_0x3834a9=_0x3834a9-0xc6;const _0x23d40f=a145_0x23d4();let _0x41314c=_0x23d40f[_0x3834a9];return _0x41314c;}export function getSubAppReactDemoTemplateDir(){const _0x177446=a145_0x398cba;return a145_0x4d91c5[_0x177446(0xca)](getRabetbaseCliPackageRoot(),_0x177446(0xcc),_0x177446(0xd4),_0x177446(0xcb));}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x13e05f,_0x3914de){const _0x1aa028=a146_0x3146,_0x1f61ad=_0x13e05f();while(!![]){try{const _0xd90180=parseInt(_0x1aa028(0x1e7))/0x1*(parseInt(_0x1aa028(0x1e9))/0x2)+-parseInt(_0x1aa028(0x1f6))/0x3+parseInt(_0x1aa028(0x1ee))/0x4*(parseInt(_0x1aa028(0x1f3))/0x5)+parseInt(_0x1aa028(0x1eb))/0x6+-parseInt(_0x1aa028(0x1e6))/0x7+-parseInt(_0x1aa028(0x1ec))/0x8*(parseInt(_0x1aa028(0x1e8))/0x9)+parseInt(_0x1aa028(0x1f2))/0xa;if(_0xd90180===_0x3914de)break;else _0x1f61ad['push'](_0x1f61ad['shift']());}catch(_0x55f5ed){_0x1f61ad['push'](_0x1f61ad['shift']());}}}(a146_0x1485,0xaaae6));function a146_0x3146(_0x2709fa,_0x3b976c){_0x2709fa=_0x2709fa-0x1e6;const _0x148515=a146_0x1485();let _0x314620=_0x148515[_0x2709fa];return _0x314620;}import a146_0x261206 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';import{getSubAppReactDemoTemplateDir}from'../../../commands/project/create/project-template-path.js';function a146_0x1485(){const _0x268f85=['8SbzKGz','info','16ntVxCd','开始复制项目模板','now','项目模板复制失败','5509990pFzyRx','377830HbJzLw','error','项目模板复制完成','1439508qQsZOe','535465hghLIE','325762sPMROQ','170514QsChrc','2xlAyom','copy','572172kNxWxM'];a146_0x1485=function(){return _0x268f85;};return a146_0x1485();}const templateDir=getSubAppReactDemoTemplateDir();export async function copyProjectTemplate(_0x51c0a3){const _0x154fd8=a146_0x3146,_0x5607a8=Date[_0x154fd8(0x1f0)](),_0x351ad0=a146_0x261206['resolve'](process['cwd'](),_0x51c0a3);try{logger[_0x154fd8(0x1ed)]('copy',_0x154fd8(0x1ef),{'projectCode':_0x51c0a3,'templateDir':templateDir}),await copyDirectory(templateDir,_0x351ad0);const _0x479c5a=Date[_0x154fd8(0x1f0)]()-_0x5607a8;logger['success'](_0x154fd8(0x1ea),_0x154fd8(0x1f5),_0x479c5a,{'projectCode':_0x51c0a3});}catch(_0x5c9d2b){const _0x1f3915=Date[_0x154fd8(0x1f0)]()-_0x5607a8;logger[_0x154fd8(0x1f4)](_0x154fd8(0x1ea),_0x154fd8(0x1f1),{'projectCode':_0x51c0a3,'error':_0x5c9d2b instanceof Error?_0x5c9d2b['message']:String(_0x5c9d2b),'duration':_0x1f3915});throw _0x5c9d2b;}return formatElapsed(_0x5607a8);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a147_0x3b0b(_0x1955a1,_0x199574){_0x1955a1=_0x1955a1-0x12b;const _0x790fa4=a147_0x790f();let _0x3b0b88=_0x790fa4[_0x1955a1];return _0x3b0b88;}(function(_0x508c5e,_0x2d592c){const _0x1c6ac8=a147_0x3b0b,_0x17682e=_0x508c5e();while(!![]){try{const _0x4cee5a=parseInt(_0x1c6ac8(0x132))/0x1+-parseInt(_0x1c6ac8(0x13f))/0x2*(parseInt(_0x1c6ac8(0x13b))/0x3)+parseInt(_0x1c6ac8(0x139))/0x4+parseInt(_0x1c6ac8(0x13c))/0x5+parseInt(_0x1c6ac8(0x140))/0x6+parseInt(_0x1c6ac8(0x12d))/0x7+parseInt(_0x1c6ac8(0x137))/0x8*(-parseInt(_0x1c6ac8(0x131))/0x9);if(_0x4cee5a===_0x2d592c)break;else _0x17682e['push'](_0x17682e['shift']());}catch(_0x8a12ed){_0x17682e['push'](_0x17682e['shift']());}}}(a147_0x790f,0x54215));import a147_0x24aa27 from'node:path';import{execa}from'execa';import{formatElapsed}from'../../../commands/project/create/format-elapsed.js';function a147_0x790f(){const _0x33d8e4=['4658290GMHPpk','resolve','message','npx','9NHHUQn','688105VQBzdm','代码格式化完成','cwd','--write','开始格式化代码','8407408mkaZMx','now','142428YXznqd','prettier','1914882MDvsJP','2023855BVseXt','success','format','2OxUyMq','1439184suCylL','代码格式化失败','error'];a147_0x790f=function(){return _0x33d8e4;};return a147_0x790f();}import{logger}from'../../../utils/logger.js';import{resolveNpmBin}from'../../../utils/platform.js';export async function formatProjectCode(_0xf6f55e){const _0x27fddc=a147_0x3b0b,_0x284fdf=Date[_0x27fddc(0x138)](),_0x20e522=a147_0x24aa27[_0x27fddc(0x12e)](process[_0x27fddc(0x134)](),_0xf6f55e);try{logger['info'](_0x27fddc(0x13e),_0x27fddc(0x136),{'projectCode':_0xf6f55e}),await execa(resolveNpmBin(_0x27fddc(0x130)),[_0x27fddc(0x13a),_0x27fddc(0x135),'.'],{'cwd':_0x20e522});const _0x5e96d3=Date[_0x27fddc(0x138)]()-_0x284fdf;logger[_0x27fddc(0x13d)](_0x27fddc(0x13e),_0x27fddc(0x133),_0x5e96d3,{'projectCode':_0xf6f55e});}catch(_0x4f20d6){const _0x59d56e=Date[_0x27fddc(0x138)]()-_0x284fdf;logger[_0x27fddc(0x12c)]('format',_0x27fddc(0x12b),{'projectCode':_0xf6f55e,'error':_0x4f20d6 instanceof Error?_0x4f20d6[_0x27fddc(0x12f)]:String(_0x4f20d6),'duration':_0x59d56e});throw _0x4f20d6;}return formatElapsed(_0x284fdf);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4f4f83,_0x295aa9){const _0x1acbf2=a148_0x3c07,_0x3e022d=_0x4f4f83();while(!![]){try{const _0x668762=parseInt(_0x1acbf2(0x1f2))/0x1*(parseInt(_0x1acbf2(0x1f1))/0x2)+parseInt(_0x1acbf2(0x1ef))/0x3*(-parseInt(_0x1acbf2(0x1f9))/0x4)+-parseInt(_0x1acbf2(0x1fa))/0x5*(-parseInt(_0x1acbf2(0x206))/0x6)+parseInt(_0x1acbf2(0x1f5))/0x7*(-parseInt(_0x1acbf2(0x1fc))/0x8)+-parseInt(_0x1acbf2(0x1f6))/0x9*(parseInt(_0x1acbf2(0x201))/0xa)+parseInt(_0x1acbf2(0x204))/0xb+-parseInt(_0x1acbf2(0x200))/0xc*(-parseInt(_0x1acbf2(0x1fb))/0xd);if(_0x668762===_0x295aa9)break;else _0x3e022d['push'](_0x3e022d['shift']());}catch(_0x3ff26f){_0x3e022d['push'](_0x3e022d['shift']());}}}(a148_0x59c7,0x924de));import a148_0x3d84f8 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';export async function installDependencies(_0x45d6a3){const _0x387c50=a148_0x3c07,_0x2616ff=Date[_0x387c50(0x207)](),_0x3656d4=a148_0x3d84f8[_0x387c50(0x1f4)](process[_0x387c50(0x1ff)](),_0x45d6a3);try{logger[_0x387c50(0x1f0)](_0x387c50(0x1f8),_0x387c50(0x1f7),{'projectCode':_0x45d6a3,'registry':'https://registry.npmmirror.com'}),await execa(resolveNpmBin('npm'),['install',_0x387c50(0x1ee),_0x387c50(0x202)],{'cwd':_0x3656d4});const _0x2ebe7e=Date[_0x387c50(0x207)]()-_0x2616ff;logger[_0x387c50(0x205)](_0x387c50(0x1f8),_0x387c50(0x1fe),_0x2ebe7e,{'projectCode':_0x45d6a3});}catch(_0x565b93){const _0xe2dbed=Date[_0x387c50(0x207)]()-_0x2616ff;logger[_0x387c50(0x1f3)](_0x387c50(0x1f8),_0x387c50(0x203),{'projectCode':_0x45d6a3,'error':_0x565b93 instanceof Error?_0x565b93[_0x387c50(0x1fd)]:String(_0x565b93),'duration':_0xe2dbed});throw _0x565b93;}return formatElapsed(_0x2616ff);}function a148_0x3c07(_0x39cdb5,_0x4bd131){_0x39cdb5=_0x39cdb5-0x1ee;const _0x59c74b=a148_0x59c7();let _0x3c07f5=_0x59c74b[_0x39cdb5];return _0x3c07f5;}function a148_0x59c7(){const _0x48831d=['依赖安装失败','8260285pNQlru','success','6XlUEVv','now','--registry','3BiOxpk','info','322vafvGw','1383cowUzM','error','resolve','1127833AcXCYx','717993usXSKB','开始安装依赖','install','4244648VxiKjy','1088155dbsNne','691938IllKux','56YaZUow','message','依赖安装完成','cwd','432dicbaS','40OELtiZ','https://registry.npmmirror.com'];a148_0x59c7=function(){return _0x48831d;};return a148_0x59c7();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a149_0x4e4592=a149_0x4c9f;(function(_0x204347,_0x4f616b){const _0x2db96b=a149_0x4c9f,_0x403fd4=_0x204347();while(!![]){try{const _0x1db709=-parseInt(_0x2db96b(0x1b5))/0x1*(-parseInt(_0x2db96b(0x1ae))/0x2)+-parseInt(_0x2db96b(0x1bd))/0x3+-parseInt(_0x2db96b(0x1b4))/0x4*(-parseInt(_0x2db96b(0x198))/0x5)+parseInt(_0x2db96b(0x1ba))/0x6*(parseInt(_0x2db96b(0x1c1))/0x7)+-parseInt(_0x2db96b(0x1a6))/0x8*(-parseInt(_0x2db96b(0x1a2))/0x9)+parseInt(_0x2db96b(0x1a9))/0xa*(-parseInt(_0x2db96b(0x1a4))/0xb)+-parseInt(_0x2db96b(0x1b1))/0xc;if(_0x1db709===_0x4f616b)break;else _0x403fd4['push'](_0x403fd4['shift']());}catch(_0x218ccd){_0x403fd4['push'](_0x403fd4['shift']());}}}(a149_0xd7d2,0xb4541));import{CliErrors}from'../../errors.js';import{CLI_BIN_NAME}from'../../constant/cli.js';import{initConfig}from'../../commands/project/init.js';import{upgradeApp}from'../../commands/project/upgrade.js';function a149_0x4c9f(_0x1c7187,_0x31792e){_0x1c7187=_0x1c7187-0x198;const _0xd7d2fd=a149_0xd7d2();let _0x4c9f3e=_0xd7d2fd[_0x1c7187];return _0x4c9f3e;}const initFlags=[{'name':a149_0x4e4592(0x1a0),'type':a149_0x4e4592(0x1a7),'description':a149_0x4e4592(0x19f)},{'name':a149_0x4e4592(0x1a8),'type':a149_0x4e4592(0x1a7),'description':a149_0x4e4592(0x1bb)},{'name':a149_0x4e4592(0x19d),'type':a149_0x4e4592(0x1be),'description':a149_0x4e4592(0x19a),'default':![]}],createFlags=[{'name':'name','type':a149_0x4e4592(0x1a7),'description':'Project\x20name'},{'name':a149_0x4e4592(0x1a8),'type':a149_0x4e4592(0x1a7),'description':'Target\x20environment'},{'name':a149_0x4e4592(0x1a0),'type':a149_0x4e4592(0x1a7),'description':a149_0x4e4592(0x1a3)}],upgradeFlags=[{'name':a149_0x4e4592(0x19d),'type':a149_0x4e4592(0x1be),'description':'Skip\x20confirmation\x20prompt','default':![]}];function a149_0xd7d2(){const _0xeb4ec4=['yes','project-name','App\x20code\x20to\x20initialize','appcode','trim','1035mNNXOK','App\x20code\x20to\x20bind\x20(skips\x20interactive\x20selection)','121stCGSn','Usage:\x20','6344JtQsSH','string','env','292740xIcyiE','2026-07','\x20project\x20create\x20<project-name>\x20[--appcode\x20<code>]','create','Deprecated:\x20use\x20workspace\x20init\x20to\x20bind\x20the\x20current\x20directory\x20to\x20an\x20app','897740QyqMLl','write','upgrade','6274968TTzMUR','project','Non-interactive\x20mode\x20requires\x20a\x20project\x20name.','1667740JtkCoV','2oZLWiu','nonInteractive','str','\x20workspace\x20init','args','36GgTJdA','Target\x20environment','init','1799574EEbjcr','boolean','cookie','name','420707COHCDY','10OpjTFc','Project\x20code/name\x20(optional,\x20prompts\x20if\x20omitted)','Auto-confirm\x20prompts','../../commands/project/create/main.js','bool'];a149_0xd7d2=function(){return _0xeb4ec4;};return a149_0xd7d2();}export const projectDefinitions=[{'service':'project','command':a149_0x4e4592(0x1bc),'description':a149_0x4e4592(0x1ad),'risk':a149_0x4e4592(0x1af),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'hidden':!![],'deprecated':{'replacement':CLI_BIN_NAME+a149_0x4e4592(0x1b8),'since':a149_0x4e4592(0x1aa)},'flags':initFlags,async 'execute'(_0x4b4c70){const _0x1e3674=a149_0x4e4592;return await initConfig({'appcode':_0x4b4c70[_0x1e3674(0x1b7)](_0x1e3674(0x1a0))||undefined,'env':_0x4b4c70[_0x1e3674(0x1b7)]('env')||undefined,'autoYes':_0x4b4c70[_0x1e3674(0x19c)](_0x1e3674(0x19d))}),{'ok':!![]};}},{'service':a149_0x4e4592(0x1b2),'command':a149_0x4e4592(0x1ac),'description':'Create\x20a\x20new\x20project','risk':a149_0x4e4592(0x1af),'requiresAuth':!![],'requiresAppCode':![],'hasFormat':![],'args':[{'name':a149_0x4e4592(0x19e),'description':a149_0x4e4592(0x199),'required':![]}],'flags':createFlags,async 'execute'(_0x1a8be1){const _0x1887b2=a149_0x4e4592,{createApp:_0x5c65d6}=await import(_0x1887b2(0x19b)),{createProjectNonInteractive:_0x587bd3}=await import('../../commands/project/create/non-interactive.js'),_0x429e4c=_0x1a8be1[_0x1887b2(0x1b7)](_0x1887b2(0x1c0))[_0x1887b2(0x1a1)]()||_0x1a8be1[_0x1887b2(0x1b9)][0x0]?.[_0x1887b2(0x1a1)](),_0xf7ff05=_0x1a8be1[_0x1887b2(0x1b7)](_0x1887b2(0x1a8))||undefined,_0x2777ec=_0x1a8be1[_0x1887b2(0x1b7)](_0x1887b2(0x1a0))||undefined;if(_0x1a8be1[_0x1887b2(0x1b6)]){if(!_0x429e4c)throw CliErrors['validation'](_0x1887b2(0x1b3),_0x1887b2(0x1a5)+CLI_BIN_NAME+_0x1887b2(0x1ab));await _0x587bd3(_0x429e4c,_0xf7ff05,_0x2777ec,_0x1a8be1[_0x1887b2(0x1bf)]);}else await _0x5c65d6({'projectCode':_0x429e4c,'appCode':_0x2777ec,'env':_0xf7ff05,'cookie':_0x1a8be1[_0x1887b2(0x1bf)]});return{'ok':!![]};}},{'service':a149_0x4e4592(0x1b2),'command':a149_0x4e4592(0x1b0),'description':'Upgrade\x20from\x20lovrabet-cli\x20to\x20rabetbase-cli','risk':a149_0x4e4592(0x1af),'requiresAuth':![],'requiresAppCode':![],'hasFormat':![],'flags':upgradeFlags,async 'execute'(_0x106c04){const _0x223ea5=a149_0x4e4592;return await upgradeApp(_0x106c04[_0x223ea5(0x1b6)],{'yes':_0x106c04[_0x223ea5(0x19c)](_0x223ea5(0x19d))}),{'ok':!![]};}}];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x195806,_0x423f07){const _0x406356=a150_0x396c,_0x2ae99a=_0x195806();while(!![]){try{const _0x51b36c=-parseInt(_0x406356(0xd6))/0x1+-parseInt(_0x406356(0xc8))/0x2*(-parseInt(_0x406356(0xd1))/0x3)+-parseInt(_0x406356(0xdc))/0x4*(parseInt(_0x406356(0xd4))/0x5)+-parseInt(_0x406356(0xce))/0x6+-parseInt(_0x406356(0xc3))/0x7+-parseInt(_0x406356(0xca))/0x8*(-parseInt(_0x406356(0xeb))/0x9)+parseInt(_0x406356(0xe7))/0xa*(parseInt(_0x406356(0xba))/0xb);if(_0x51b36c===_0x423f07)break;else _0x2ae99a['push'](_0x2ae99a['shift']());}catch(_0x44b260){_0x2ae99a['push'](_0x2ae99a['shift']());}}}(a150_0x299e,0x3a8dd));import{readFileSync,existsSync,renameSync}from'node:fs';import{resolve,dirname,basename}from'node:path';import{fileURLToPath}from'node:url';import a150_0x3d970b from'chalk';function a150_0x396c(_0x137a39,_0xf33104){_0x137a39=_0x137a39-0xb8;const _0x299e8f=a150_0x299e();let _0x396c98=_0x299e8f[_0x137a39];return _0x396c98;}import{input,confirm}from'@inquirer/prompts';import{CLI_BIN_NAME}from'../../constant/cli.js';import{logger}from'../../utils/logger.js';import{readRawConfig,getProjectConfigPath,writeConfigFile,NEW_CONFIG_NAME,LEGACY_CONFIG_NAMES}from'../../context.js';import{validateAppcode}from'../../commands/common/validate.js';import{buildCanonicalProjectConfig}from'../../config/schema.js';export async function initConfig(_0x2ee05f){const _0x15c928=a150_0x396c,{appcode:_0x827a7,env:_0x500f5c,autoYes:_0x38b4c1}=_0x2ee05f,_0x5594aa=process[_0x15c928(0xcf)]();if(getProjectConfigPath())throw new Error('.rabetbase.json\x20already\x20exists\x20in\x20current\x20directory.\x20Nothing\x20to\x20do.');let _0x145959;for(const _0x1811e3 of LEGACY_CONFIG_NAMES){const _0x38c9ee=resolve(_0x5594aa,_0x1811e3);if(existsSync(_0x38c9ee)){_0x145959=_0x38c9ee;break;}}if(_0x145959){let _0x4bc813={};try{_0x4bc813=JSON[_0x15c928(0xe4)](readFileSync(_0x145959,'utf8'));}catch{}const _0x2bd287=basename(_0x145959),_0x4c785c=_0x4bc813?.[_0x15c928(0xbb)]||_0x4bc813?.[_0x15c928(0xe0)];let _0x35b295=_0x38b4c1;!_0x38b4c1&&(console['log'](a150_0x3d970b[_0x15c928(0xbd)](_0x15c928(0xc1)+a150_0x3d970b['bold'](_0x2bd287))),_0x4c785c&&console[_0x15c928(0xc4)](a150_0x3d970b[_0x15c928(0xdb)](_0x15c928(0xc6)+_0x4c785c)),_0x35b295=await confirm({'message':_0x15c928(0xc2)+a150_0x3d970b[_0x15c928(0xe1)](_0x15c928(0xe9))+_0x15c928(0xcc),'default':!![]}));if(!_0x35b295){console[_0x15c928(0xc4)]('Migration\x20cancelled.\x20Run\x20`'+CLI_BIN_NAME+_0x15c928(0xd8));return;}const _0x496f13=resolve(_0x5594aa,NEW_CONFIG_NAME),_0x3bc2c2=getCliVersionFromPkg(),_0x4f6de6=readRawConfig(),_0x1176ea=_0x827a7||(typeof _0x4bc813?.[_0x15c928(0xbb)]===_0x15c928(0xc9)?_0x4bc813['appcode']:undefined)||(typeof _0x4bc813?.[_0x15c928(0xe0)]===_0x15c928(0xc9)?_0x4bc813['app']:undefined)||await askAppcode(),_0x18059d=typeof _0x4bc813?.[_0x15c928(0xe3)]===_0x15c928(0xc9)?_0x4bc813[_0x15c928(0xe3)]:typeof _0x4f6de6['env']===_0x15c928(0xc9)?_0x4f6de6[_0x15c928(0xe3)]:'production',_0xc90df=buildCanonicalProjectConfig({..._0x4f6de6,..._0x4bc813},{'appCodes':[_0x1176ea],'env':_0x18059d,'metadata':{'version':_0x3bc2c2,'migratedAt':new Date()[_0x15c928(0xb9)](),'migratedFrom':_0x145959}});writeConfigFile(_0x496f13,_0xc90df);const _0x400c5e=_0x145959+_0x15c928(0xdf);renameSync(_0x145959,_0x400c5e),logger['setLogPath'](_0x5594aa),logger['info'](_0x15c928(0xe8),_0x15c928(0xe5),{'from':_0x145959,'to':_0x496f13,'appcode':_0x1176ea,'env':_0xc90df[_0x15c928(0xe3)]}),console[_0x15c928(0xc4)](a150_0x3d970b['green'](_0x15c928(0xe2)+_0x2bd287+_0x15c928(0xc0))),console['log'](a150_0x3d970b['cyan']('\x20\x20Apps:\x20'+Object[_0x15c928(0xd3)](_0xc90df[_0x15c928(0xb8)]||{})[_0x15c928(0xd7)](',\x20'))),console[_0x15c928(0xc4)](a150_0x3d970b[_0x15c928(0xdb)](_0x15c928(0xde)+_0xc90df[_0x15c928(0xec)])),console['log'](a150_0x3d970b[_0x15c928(0xc5)](_0x15c928(0xd9)+_0x2bd287+'.bak'));return;}const _0x5a6463=_0x827a7||await askAppcode(),_0x3c3afe=resolve(_0x5594aa,NEW_CONFIG_NAME),_0xe98d7=getCliVersionFromPkg(),_0x46ccbc=readRawConfig(),_0x2956ac=typeof _0x46ccbc[_0x15c928(0xe3)]===_0x15c928(0xc9)?_0x46ccbc[_0x15c928(0xe3)]:undefined,_0xf9474d=buildCanonicalProjectConfig({},{'appCodes':[_0x5a6463],'env':_0x500f5c||_0x2956ac||_0x15c928(0xd0),'metadata':{'version':_0xe98d7,'createdAt':new Date()[_0x15c928(0xb9)]()}});writeConfigFile(_0x3c3afe,_0xf9474d),logger[_0x15c928(0xcb)](_0x5594aa),logger['info']('init','初始化项目配置文件成功',{'appcode':_0x5a6463,'env':_0xf9474d[_0x15c928(0xe3)],'version':_0xf9474d['version'],'configPath':_0x3c3afe}),console[_0x15c928(0xc4)](a150_0x3d970b[_0x15c928(0xea)]('✓\x20Successfully\x20initialized\x20.rabetbase.json\x20in\x20current\x20directory')),console['log'](a150_0x3d970b['cyan'](_0x15c928(0xda)+Object[_0x15c928(0xd3)](_0xf9474d[_0x15c928(0xb8)]||{})[_0x15c928(0xd7)](',\x20'))),console[_0x15c928(0xc4)](a150_0x3d970b[_0x15c928(0xdb)](_0x15c928(0xde)+_0xf9474d[_0x15c928(0xec)])),console[_0x15c928(0xc4)](_0x15c928(0xbf)+CLI_BIN_NAME+_0x15c928(0xd5)+CLI_BIN_NAME+_0x15c928(0xbc));}function a150_0x299e(){const _0x2a034b=['Please\x20enter\x20App\x20Code:','45494RCyHqI','string','712pxdHRC','setLogPath','?\x20(Old\x20file\x20→\x20*.bak)','utf8','904416rBAlEU','cwd','production','33ZfWPyH','version','keys','80peoFjB','\x20api\x20generate\x27\x20and\x20\x27','8804hbaIyy','join','\x20workspace\x20init`\x20to\x20start\x20fresh.','\x20\x20Old\x20file\x20backed\x20up\x20as\x20','\x20\x20Apps:\x20','cyan','86116kGrijz','Invalid\x20App\x20Code','\x20\x20Default:\x20','.bak','app','bold','✓\x20Upgraded\x20','env','parse','从旧配置文件升级成功','trim','10BDVmVP','init','.rabetbase.json','green','41841NazWKH','defaultApp','apps','toLocaleString','1595957gAZOix','appcode','\x20api\x20pull\x27','yellow','1.0.0','\x20\x20You\x20can\x20now\x20use\x20commands\x20like\x20\x27','\x20→\x20.rabetbase.json','⚠\x20Found\x20legacy\x20configuration\x20file:\x20','Upgrade\x20it\x20to\x20','456568JUOEjg','log','gray','\x20\x20appcode:\x20'];a150_0x299e=function(){return _0x2a034b;};return a150_0x299e();}function askAppcode(){const _0x251b46=a150_0x396c;return input({'message':_0x251b46(0xc7),'validate':_0x2c17cf=>{const _0x545c9a=_0x251b46;if(!_0x2c17cf[_0x545c9a(0xe6)]())return'App\x20Code\x20cannot\x20be\x20empty';const {valid:_0x6b8480,message:_0x1f8734}=validateAppcode(_0x2c17cf[_0x545c9a(0xe6)]());return _0x6b8480||_0x1f8734||_0x545c9a(0xdd);}});}function getCliVersionFromPkg(){const _0x10bf9c=a150_0x396c;try{const _0x4b8642=fileURLToPath(import.meta.url),_0x2b24be=resolve(dirname(_0x4b8642),'../..'),_0x53a411=JSON[_0x10bf9c(0xe4)](readFileSync(resolve(_0x2b24be,'package.json'),_0x10bf9c(0xcd)));return _0x53a411[_0x10bf9c(0xd2)]||'1.0.0';}catch{return _0x10bf9c(0xbe);}}
|