Skip to content

Commit

Permalink
chore(all-services): remove node 16 support in packages ,sandbox and …
Browse files Browse the repository at this point in the history
…services

remove node 16 support in packages,sandbox and services

GH-1673
  • Loading branch information
Surbhi-sharma1 committed Oct 30, 2023
1 parent b2174c1 commit 0237a40
Show file tree
Hide file tree
Showing 48 changed files with 741 additions and 746 deletions.
2 changes: 1 addition & 1 deletion packages/cache/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"build": "lb-tsc",
Expand Down
3 changes: 1 addition & 2 deletions packages/cli/src/generators/microservice/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,8 +175,7 @@ export default class MicroserviceGenerator extends AppGenerator<MicroserviceOpti

writing() {
if (!this.shouldExit()) {
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
if (this.options.baseService || this.options.datasourceName) {
if (this.options.baseService ?? this.options.datasourceName) {
this._createDataSource();
} else {
this._createFacadeRedisDatasource();
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
}
},
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"build": "npm run clean && lb-tsc",
Expand Down
2 changes: 1 addition & 1 deletion packages/custom-sf-changelog/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
],
"author": "Akshat Dubey",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"license": "ISC",
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/feature-toggle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"build": "lb-tsc",
Expand Down
2 changes: 1 addition & 1 deletion sandbox/audit-ms-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"build": "npm run clean && lb-tsc",
Expand Down
2 changes: 1 addition & 1 deletion sandbox/auth-ms-basic-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"build": "npm run clean && lb-tsc",
Expand Down
2 changes: 1 addition & 1 deletion sandbox/auth-multitenant-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"build": "npm run clean && lb-tsc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,7 @@ export class UserExtRepository extends DefaultSoftCrudRepository<
async verifyPassword(username: string, password: string): Promise<User> {
const user = await super.findOne({where: {username}});
const creds = user && (await this.credentials(user.id).get());
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
if (!user || user.deleted || !creds?.password) {
if (!user ?? user?.deleted ?? !creds?.password) {
throw new HttpErrors.Unauthorized(AuthenticateErrorKeys.UserDoesNotExist);
} else if (!(await bcrypt.compare(password, creds.password))) {
throw new HttpErrors.Unauthorized(AuthErrorKeys.InvalidCredentials);
Expand All @@ -152,7 +151,7 @@ export class UserExtRepository extends DefaultSoftCrudRepository<
AuthenticateErrorKeys.TempPasswordLoginDisallowed,
);
} else {
return user;
return user!;
}
}

Expand All @@ -163,8 +162,7 @@ export class UserExtRepository extends DefaultSoftCrudRepository<
): Promise<User> {
const user = await super.findOne({where: {username}});
const creds = user && (await this.credentials(user.id).get());
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
if (!user || user.deleted || !creds?.password) {
if (!user ?? user?.deleted ?? !creds?.password) {
throw new HttpErrors.Unauthorized(AuthenticateErrorKeys.UserDoesNotExist);
} else if (!(await bcrypt.compare(password, creds.password))) {
throw new HttpErrors.Unauthorized(AuthErrorKeys.WrongPassword);
Expand All @@ -175,9 +173,9 @@ export class UserExtRepository extends DefaultSoftCrudRepository<
} else {
// Do nothing
}
await this.credentials(user.id).patch({
await this.credentials(user!.id).patch({
password: await bcrypt.hash(newPassword, saltRounds),
});
return user;
return user!;
}
}
2 changes: 1 addition & 1 deletion sandbox/cache-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"build": "lb-tsc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"private": true,
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"types": "dist/index.d.ts",
"private": true,
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"build": "lb-tsc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"private": true,
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"private": true,
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"types": "dist/index.d.ts",
"private": true,
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"build": "lb-tsc",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"private": true,
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"directory": "examples/socketio"
},
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion sandbox/feature-toggle-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"build": "npm run clean && lb-tsc",
Expand Down
2 changes: 1 addition & 1 deletion sandbox/in-mail-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"build": "lb-tsc",
Expand Down
2 changes: 1 addition & 1 deletion sandbox/notification-socket-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"build": "npm run clean && lb-tsc",
Expand Down
2 changes: 1 addition & 1 deletion sandbox/oauth-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"build": "lb-tsc",
Expand Down
2 changes: 1 addition & 1 deletion sandbox/oidc-basic-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"build": "lb-tsc",
Expand Down
2 changes: 1 addition & 1 deletion sandbox/payment-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"private": true,
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion sandbox/pubnub-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"build": "lb-tsc",
Expand Down
2 changes: 1 addition & 1 deletion sandbox/scheduler-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"build": "lb-tsc",
Expand Down
2 changes: 1 addition & 1 deletion sandbox/search-ms-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"private": true,
"scripts": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": ">=10.16"
"node": "18 || 20"
},
"scripts": {
"build:layers": "scripts/build-dependency-layer.sh",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": ">=10.16"
"node": "18 || 20"
},
"scripts": {
"build:layers": "scripts/build-dependency-layer.sh",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": ">=10.16"
"node": "18 || 20"
},
"scripts": {
"build:layers": "scripts/build-dependency-layer.sh",
Expand Down
2 changes: 1 addition & 1 deletion sandbox/video-conferencing-ms-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"build": "npm run clean && lb-tsc",
Expand Down
2 changes: 1 addition & 1 deletion sandbox/workflow-ms-example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"build": "npm run clean && lb-tsc",
Expand Down
2 changes: 1 addition & 1 deletion services/audit-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"build": "npm run clean && lb-tsc && npm run openapi-spec && npm run apidocs",
Expand Down
6 changes: 2 additions & 4 deletions services/audit-service/src/services/job-processing.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,8 @@ export class JobProcessingService {
(customFilter.actedOn == null ||
filterUsed.actedOn == null ||
filterUsed.actedOn === customFilter.actedOn) &&
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
(customFilter.entityId ||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
filterUsed.entityId ||
(customFilter.entityId ??
filterUsed.entityId ??
filterUsed.entityId === customFilter.entityId) &&
(customFilter.date == null ||
filterUsed.date == null ||
Expand Down
2 changes: 1 addition & 1 deletion services/authentication-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"prebuild": "npm run clean",
Expand Down
2 changes: 1 addition & 1 deletion services/bpmn-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"build": "npm run clean && lb-tsc && npm run openapi-spec && npm run apidocs",
Expand Down
2 changes: 1 addition & 1 deletion services/chat-service/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": "16 || 17 || 18"
"node": "18 || 20"
},
"scripts": {
"openapi-spec": "node ./dist/openapi-spec && npm run apidocs",
Expand Down
Loading

0 comments on commit 0237a40

Please sign in to comment.