Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ npm install -g @sourceloop/cli
$ sl COMMAND
running command...
$ sl (-v|--version|version)
@sourceloop/cli/9.2.3 linux-x64 node-v18.20.5
@sourceloop/cli/9.2.3 darwin-arm64 node-v22.15.0
$ sl --help [COMMAND]
USAGE
$ sl COMMAND
Expand Down Expand Up @@ -136,7 +136,8 @@ OPTIONS

-s, --baseService=(authentication-service|audit-service|chat-service|notification-service|bpmn-service|feature-toggle-
service|in-mail-service|payment-service|scheduler-service|search-service|survey-service|task-service|video-conferencin
g-service|user-tenant-service)
g-service|user-tenant-service|ctrl-plane-tenant-management-service|ctrl-plane-subscription-service|ctrl-plane-orchestr
ator-service)
Base ARC microservice

--[no-]baseOnService
Expand Down
3 changes: 3 additions & 0 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@
"@sourceloop/task-service": "^4.0.2",
"@sourceloop/user-tenant-service": "^3.0.2",
"@sourceloop/video-conferencing-service": "^14.0.2",
"@sourceloop/ctrl-plane-orchestrator-service": "^0.1.1",
"@sourceloop/ctrl-plane-tenant-management-service": "^0.4.1",
"@sourceloop/ctrl-plane-subscription-service": "^0.4.0",
"@sourceloop/audit-log": "^8.0.5",
"@sourceloop/vault": "^7.0.3",
"loopback4-authentication": "^12.1.1",
Expand Down
31 changes: 31 additions & 0 deletions packages/cli/src/enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export enum SERVICES {
TASK = 'task-service',
VIDEO_CONF = 'video-conferencing-service',
USER_TENANT = 'user-tenant-service',
TEANANT_MANAGEMENT = 'ctrl-plane-tenant-management-service',
SUBSCRIPTION = 'ctrl-plane-subscription-service',
ORCHESTRATOR = 'ctrl-plane-orchestrator-service',
}

export enum DATASOURCES {
Expand Down Expand Up @@ -96,6 +99,28 @@ export const BASESERVICEDSLIST: {
],
'chat-service': [],
'user-tenant-service': [],
'ctrl-plane-tenant-management-service': [
{
type: 'store',
name: 'TenantManagementDbSourceName',
fileName: 'tenantManagement',
},
{type: 'cache', name: 'TenantManagementCacheSourceName', fileName: 'redis'},
],

'ctrl-plane-subscription-service': [
{
type: 'store',
name: 'SubscriptionDbSourceName',
fileName: 'subscription',
},
{
type: 'store',
name: 'FeatureToggleDbName',
fileName: 'feature',
},
],
'ctrl-plane-orchestrator-service': [],
};

export const BASESERVICECOMPONENTLIST: {
Expand All @@ -115,6 +140,9 @@ export const BASESERVICECOMPONENTLIST: {
'video-conferencing-service': 'VideoConfServiceComponent',
'chat-service': 'ChatServiceComponent',
'user-tenant-service': 'UserTenantServiceComponent',
'ctrl-plane-tenant-management-service': 'TenantManagementServiceComponent',
'ctrl-plane-subscription-service': 'SubscriptionServiceComponent',
'ctrl-plane-orchestrator-service': 'OrchestratorServiceComponent',
};

export const BASESERVICEBINDINGLIST: {
Expand All @@ -134,6 +162,9 @@ export const BASESERVICEBINDINGLIST: {
'video-conferencing-service': 'VideoChatBindings',
'chat-service': 'ChatServiceBindings',
'user-tenant-service': 'UserTenantServiceComponentBindings',
'ctrl-plane-tenant-management-service': 'TenantManagementServiceComponent',
'ctrl-plane-subscription-service': 'SubscriptionServiceBindings',
'ctrl-plane-orchestrator-service': 'TenantManagementServiceBindings',
};

export enum SEQUELIZESERVICES {
Expand Down
20 changes: 12 additions & 8 deletions packages/cli/src/generators/microservice/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -372,13 +372,18 @@ export default class MicroserviceGenerator extends AppGenerator<MicroserviceOpti
} else {
//do nothing
}

const promises = baseServiceDSList.map(async ds => {
const localProjectInfo = {...this.projectInfo};

if (ds.type === 'store') {
if (!ds.isNotBase) this.projectInfo.baseServiceStoreName = ds.name;
this.projectInfo.datasourceName = ds.fileName;
this.projectInfo.datasourceClassName = this._capitalizeFirstLetter(
if (!ds.isNotBase) localProjectInfo.baseServiceStoreName = ds.name;

localProjectInfo.datasourceName = ds.fileName;
localProjectInfo.datasourceClassName = this._capitalizeFirstLetter(
ds.fileName,
);

/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */
//@ts-ignore
await this.fs.copyTplAsync(
Expand All @@ -387,13 +392,12 @@ export default class MicroserviceGenerator extends AppGenerator<MicroserviceOpti
join('src', 'datasources', `${ds.fileName}.datasource.ts`),
),
{
project: this.projectInfo,
project: localProjectInfo,
},
);

this.projectInfo.baseServiceStoreName = undefined; //so that previous value is not used
} else {
this.projectInfo.baseServiceCacheName = ds.name;
localProjectInfo.baseServiceCacheName = ds.name;

/* eslint-disable-next-line @typescript-eslint/ban-ts-comment */
//@ts-ignore
await this.fs.copyTplAsync(
Expand All @@ -402,7 +406,7 @@ export default class MicroserviceGenerator extends AppGenerator<MicroserviceOpti
join('src', 'datasources', `${ds.fileName}.datasource.ts`),
),
{
project: this.projectInfo,
project: localProjectInfo,
},
);
}
Expand Down