Skip to content

Commit

Permalink
Merge pull request #315 from conceptadev/chore/consolidate-common
Browse files Browse the repository at this point in the history
chore: consolidation into nestjs-common module
  • Loading branch information
MrMaz authored Dec 13, 2024
2 parents 842ea86 + fb9f47c commit 567819a
Show file tree
Hide file tree
Showing 460 changed files with 703 additions and 958 deletions.
9 changes: 7 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"eslint.workingDirectories": [
{ "pattern": "packages/*" }
]
}
],
"files.exclude": {
"**/node_modules": true,
"**/*dist*": true,
"**/*coverage*": true,
}
}
4 changes: 2 additions & 2 deletions packages/nestjs-auth-apple/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ For a detailed implementation example, refer to:
```ts
import { Injectable } from '@nestjs/common';
import { JwtIssueService } from '@concepta/nestjs-jwt';
import { AuthenticationResponseInterface } from '@concepta/ts-common';
import { AuthenticationResponseInterface } from '@concepta/nestjs-common';
import { IssueTokenServiceInterface } from '../interfaces/issue-token-service.interface';

@Injectable()
Expand Down Expand Up @@ -360,7 +360,7 @@ import {
import {
AuthenticatedUserInterface,
AuthenticationResponseInterface,
} from '@concepta/ts-common';
} from '@concepta/nestjs-common';
import { Controller, Get, UseGuards } from '@nestjs/common';
import { AuthAppleGuard } from '@concepta/nestjs-auth-apple';

Expand Down
3 changes: 0 additions & 3 deletions packages/nestjs-auth-apple/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@
"dependencies": {
"@concepta/nestjs-authentication": "^5.1.0",
"@concepta/nestjs-common": "^5.1.0",
"@concepta/nestjs-core": "^5.1.0",
"@concepta/nestjs-exception": "^5.1.0",
"@concepta/nestjs-federated": "^5.1.0",
"@concepta/nestjs-jwt": "^5.1.0",
"@concepta/ts-common": "^5.1.0",
"@concepta/ts-core": "^5.1.0",
"@nestjs/common": "^10.4.1",
"@nestjs/config": "^3.2.3",
"@nestjs/core": "^10.4.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/nestjs-auth-apple/src/auth-apple.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ApiOkResponse, ApiTags } from '@nestjs/swagger';
import {
AuthenticatedUserInterface,
AuthenticationResponseInterface,
} from '@concepta/ts-common';
} from '@concepta/nestjs-common';
import {
AuthUser,
IssueTokenServiceInterface,
Expand Down
2 changes: 1 addition & 1 deletion packages/nestjs-auth-apple/src/dto/auth-apple-login.dto.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IsString } from 'class-validator';
import { Exclude, Expose } from 'class-transformer';
import { ApiProperty } from '@nestjs/swagger';
import { AuthenticationCodeInterface } from '@concepta/ts-common';
import { AuthenticationCodeInterface } from '@concepta/nestjs-common';

@Exclude()
export class AuthAppleLoginDto implements AuthenticationCodeInterface {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
ReferenceEmailInterface,
ReferenceIdInterface,
} from '@concepta/ts-core';
} from '@concepta/nestjs-common';

export interface AuthAppleCredentialsInterface
extends ReferenceIdInterface,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { ModuleOptionsSettingsInterface } from '@concepta/nestjs-core';
import { IssueTokenServiceInterface } from '@concepta/nestjs-authentication';
import { ModuleOptionsSettingsInterface } from '@concepta/nestjs-common';
import { JwtVerifyServiceInterface } from '@concepta/nestjs-jwt';
import { AuthAppleSettingsInterface } from './auth-apple-settings.interface';
import { AuthAppleServiceInterface } from './auth-apple-service.interface';
import { AuthAppleSettingsInterface } from './auth-apple-settings.interface';

export interface AuthAppleOptionsInterface
extends ModuleOptionsSettingsInterface<AuthAppleSettingsInterface> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReferenceEmailInterface } from '@concepta/ts-core';
import { ReferenceEmailInterface } from '@concepta/nestjs-common';

export interface AuthAppleProfileInterface
extends Partial<ReferenceEmailInterface> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { AuthenticateOptions } from 'passport-apple';
import { Type } from '@nestjs/common';
import { AuthenticationCodeInterface } from '@concepta/ts-common';
import { AuthenticationCodeInterface } from '@concepta/nestjs-common';
import { MapProfile } from '../auth-apple.types';

export interface AuthAppleSettingsInterface extends AuthenticateOptions {
Expand Down
4 changes: 2 additions & 2 deletions packages/nestjs-auth-github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ For a detailed implementation example, refer to:
```ts
import { Injectable } from '@nestjs/common';
import { JwtIssueService } from '@concepta/nestjs-jwt';
import { AuthenticationResponseInterface } from '@concepta/ts-common';
import { AuthenticationResponseInterface } from '@concepta/nestjs-common';
import { IssueTokenServiceInterface } from '../interfaces/issue-token-service.interface';

@Injectable()
Expand Down Expand Up @@ -280,7 +280,7 @@ import {
import {
AuthenticatedUserInterface,
AuthenticationResponseInterface,
} from '@concepta/ts-common';
} from '@concepta/nestjs-common';
import { Controller, Get, UseGuards } from '@nestjs/common';
import { AuthGithubGuard } from '@concepta/nestjs-auth-github';

Expand Down
3 changes: 0 additions & 3 deletions packages/nestjs-auth-github/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@
"dependencies": {
"@concepta/nestjs-authentication": "^5.1.0",
"@concepta/nestjs-common": "^5.1.0",
"@concepta/nestjs-core": "^5.1.0",
"@concepta/nestjs-exception": "^5.1.0",
"@concepta/nestjs-federated": "^5.1.0",
"@concepta/ts-common": "^5.1.0",
"@concepta/ts-core": "^5.1.0",
"@nestjs/common": "^10.4.1",
"@nestjs/config": "^3.2.3",
"@nestjs/core": "^10.4.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/nestjs-auth-github/src/auth-github.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ApiOkResponse, ApiTags } from '@nestjs/swagger';
import {
AuthenticatedUserInterface,
AuthenticationResponseInterface,
} from '@concepta/ts-common';
} from '@concepta/nestjs-common';
import {
AuthUser,
IssueTokenServiceInterface,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IsString } from 'class-validator';
import { Exclude, Expose } from 'class-transformer';
import { ApiProperty } from '@nestjs/swagger';
import { AuthenticationCodeInterface } from '@concepta/ts-common';
import { AuthenticationCodeInterface } from '@concepta/nestjs-common';

@Exclude()
export class AuthGithubLoginDto implements AuthenticationCodeInterface {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
ReferenceEmailInterface,
ReferenceIdInterface,
} from '@concepta/ts-core';
} from '@concepta/nestjs-common';

export interface AuthGithubCredentialsInterface
extends ReferenceIdInterface,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IssueTokenServiceInterface } from '@concepta/nestjs-authentication';
import { ModuleOptionsSettingsInterface } from '@concepta/nestjs-core';
import { ModuleOptionsSettingsInterface } from '@concepta/nestjs-common';
import { AuthGithubSettingsInterface } from './auth-github-settings.interface';

export interface AuthGithubOptionsInterface
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
ReferenceEmailInterface,
ReferenceIdInterface,
ReferenceUsernameInterface,
} from '@concepta/ts-core';
} from '@concepta/nestjs-common';
import { AuthGithubEmailsInterface } from './auth-github-emails.interface';

export interface AuthGithubProfileInterface
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { AuthenticationCodeInterface } from '@concepta/ts-common';
import { AuthenticationCodeInterface } from '@concepta/nestjs-common';
import { Type } from '@nestjs/common';
import { MapProfile } from '../auth-github.types';

Expand Down
4 changes: 2 additions & 2 deletions packages/nestjs-auth-google/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ For a detailed implementation example, refer to:
```ts
import { Injectable } from '@nestjs/common';
import { JwtIssueService } from '@concepta/nestjs-jwt';
import { AuthenticationResponseInterface } from '@concepta/ts-common';
import { AuthenticationResponseInterface } from '@concepta/nestjs-common';
import { IssueTokenServiceInterface } from '../interfaces/issue-token-service.interface';

@Injectable()
Expand Down Expand Up @@ -281,7 +281,7 @@ import {
import {
AuthenticatedUserInterface,
AuthenticationResponseInterface,
} from '@concepta/ts-common';
} from '@concepta/nestjs-common';
import { Controller, Get, UseGuards } from '@nestjs/common';
import { AuthGoogleGuard } from '@concepta/nestjs-auth-google';

Expand Down
3 changes: 0 additions & 3 deletions packages/nestjs-auth-google/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@
"dependencies": {
"@concepta/nestjs-authentication": "^5.1.0",
"@concepta/nestjs-common": "^5.1.0",
"@concepta/nestjs-core": "^5.1.0",
"@concepta/nestjs-exception": "^5.1.0",
"@concepta/nestjs-federated": "^5.1.0",
"@concepta/ts-common": "^5.1.0",
"@concepta/ts-core": "^5.1.0",
"@nestjs/common": "^10.4.1",
"@nestjs/config": "^3.2.3",
"@nestjs/core": "^10.4.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/nestjs-auth-google/src/auth-google.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ApiOkResponse, ApiTags } from '@nestjs/swagger';
import {
AuthenticatedUserInterface,
AuthenticationResponseInterface,
} from '@concepta/ts-common';
} from '@concepta/nestjs-common';
import {
AuthUser,
IssueTokenServiceInterface,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IsString } from 'class-validator';
import { Exclude, Expose } from 'class-transformer';
import { ApiProperty } from '@nestjs/swagger';
import { AuthenticationCodeInterface } from '@concepta/ts-common';
import { AuthenticationCodeInterface } from '@concepta/nestjs-common';

@Exclude()
export class AuthGoogleLoginDto implements AuthenticationCodeInterface {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
ReferenceEmailInterface,
ReferenceIdInterface,
} from '@concepta/ts-core';
} from '@concepta/nestjs-common';

export interface AuthGoogleCredentialsInterface
extends ReferenceIdInterface,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IssueTokenServiceInterface } from '@concepta/nestjs-authentication';
import { ModuleOptionsSettingsInterface } from '@concepta/nestjs-core';
import { ModuleOptionsSettingsInterface } from '@concepta/nestjs-common';
import { AuthGoogleSettingsInterface } from './auth-google-settings.interface';

export interface AuthGoogleOptionsInterface
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import {
ReferenceEmailInterface,
ReferenceIdInterface,
} from '@concepta/ts-core';
} from '@concepta/nestjs-common';
import { AuthGoogleEmailsInterface } from './auth-google-emails.interface';

export interface AuthGoogleProfileInterface
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { StrategyOptions } from 'passport-google-oauth20';
import { Type } from '@nestjs/common';
import { AuthenticationCodeInterface } from '@concepta/ts-common';
import { AuthenticationCodeInterface } from '@concepta/nestjs-common';
import { MapProfile } from '../auth-google.types';

export interface AuthGoogleSettingsInterface extends StrategyOptions {
Expand Down
8 changes: 4 additions & 4 deletions packages/nestjs-auth-jwt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ dependencies from npm or yarn:
npm install class-transformer
npm install class-validator
npm install @nestjs/jwt
npm install @concepta/ts-core
npm install @concepta/nestjs-common
npm install @concepta/nestjs-authentication
npm install @concepta/nestjs-jwt
npm install @concepta/nestjs-auth-jwt
Expand All @@ -120,7 +120,7 @@ or
yarn add class-transformer
yarn add class-validator
yarn add @nestjs/jwt
yarn add @concepta/ts-core
yarn add @concepta/nestjs-common
yarn add @concepta/nestjs-authentication
yarn add @concepta/nestjs-jwt
yarn add @concepta/nestjs-auth-jwt
Expand Down Expand Up @@ -217,7 +217,7 @@ export class UserService {
```ts
// user-lookup.service.ts
import { AuthJwtUserLookupServiceInterface } from '@concepta/nestjs-auth-jwt';
import { ReferenceIdInterface, ReferenceSubject } from '@concepta/ts-core';
import { ReferenceIdInterface, ReferenceSubject } from '@concepta/nestjs-common';
import { InjectRepository } from '@nestjs/typeorm';
import { Repository } from 'typeorm';

Expand Down Expand Up @@ -575,7 +575,7 @@ and must be provided to the module.

```ts
import { AuthJwtUserLookupServiceInterface } from '@concepta/nestjs-auth-jwt';
import { ReferenceIdInterface, ReferenceSubject } from '@concepta/ts-core';
import { ReferenceIdInterface, ReferenceSubject } from '@concepta/nestjs-common';

export class UserLookupService implements AuthJwtUserLookupServiceInterface {
async bySubject(subject: ReferenceSubject): Promise<ReferenceIdInterface> {
Expand Down
2 changes: 0 additions & 2 deletions packages/nestjs-auth-jwt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
"@concepta/nestjs-common": "^5.1.0",
"@concepta/nestjs-exception": "^5.1.0",
"@concepta/nestjs-jwt": "^5.1.0",
"@concepta/ts-common": "^5.1.0",
"@concepta/ts-core": "^5.1.0",
"@concepta/typeorm-common": "^5.1.0",
"@nestjs/common": "^10.4.1",
"@nestjs/config": "^3.2.3",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { Injectable } from '@nestjs/common';
import { ReferenceIdInterface, ReferenceSubject } from '@concepta/ts-core';
import {
ReferenceIdInterface,
ReferenceSubject,
} from '@concepta/nestjs-common';
import { AuthJwtUserLookupServiceInterface } from '../../interfaces/auth-jwt-user-lookup-service.interface';

@Injectable()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ReferenceIdInterface } from '@concepta/ts-core';
import { ReferenceIdInterface } from '@concepta/nestjs-common';
import { Entity } from 'typeorm';

@Entity()
Expand Down
2 changes: 1 addition & 1 deletion packages/nestjs-auth-jwt/src/auth-jwt.guard.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AuthGuard } from '@concepta/nestjs-authentication';
import { ReferenceIdInterface } from '@concepta/ts-core';
import { ReferenceIdInterface } from '@concepta/nestjs-common';
import { Injectable, UnauthorizedException } from '@nestjs/common';

import { AUTH_JWT_STRATEGY_NAME } from './auth-jwt.constants';
Expand Down
2 changes: 1 addition & 1 deletion packages/nestjs-auth-jwt/src/auth-jwt.strategy.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AuthJwtUserLookupServiceInterface } from './interfaces/auth-jwt-user-lo
import { AuthJwtStrategy } from './auth-jwt.strategy';
import { UserFixture } from './__fixtures__/user/user.entity.fixture';
import { randomUUID } from 'crypto';
import { AuthorizationPayloadInterface } from '@concepta/ts-common';
import { AuthorizationPayloadInterface } from '@concepta/nestjs-common';
import { AuthJwtSettingsInterface } from './interfaces/auth-jwt-settings.interface';
import { VerifyTokenServiceInterface } from '@concepta/nestjs-authentication';
import { AuthJwtUnauthorizedException } from './exceptions/auth-jwt-unauthorized.exception';
Expand Down
6 changes: 4 additions & 2 deletions packages/nestjs-auth-jwt/src/auth-jwt.strategy.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Inject, Injectable } from '@nestjs/common';
import { ReferenceIdInterface } from '@concepta/ts-core';
import { AuthorizationPayloadInterface } from '@concepta/ts-common';
import {
ReferenceIdInterface,
AuthorizationPayloadInterface,
} from '@concepta/nestjs-common';
import {
PassportStrategyFactory,
VerifyTokenServiceInterface,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {
LookupSubjectInterface,
ReferenceIdInterface,
ReferenceSubject,
} from '@concepta/ts-core';
} from '@concepta/nestjs-common';
import { QueryOptionsInterface } from '@concepta/typeorm-common';

export interface AuthJwtUserLookupServiceInterface
Expand Down
10 changes: 5 additions & 5 deletions packages/nestjs-auth-local/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ token issuance, and password validation.
```sh
npm install class-transformer
npm install class-validator
npm install @concepta/ts-core
npm install @concepta/nestjs-common
npm install @concepta/nestjs-authentication
npm install @concepta/nestjs-password
npm install @concepta/nestjs-jwt
Expand All @@ -91,7 +91,7 @@ or

yarn add class-transformer
yarn add class-validator
yarn add @concepta/ts-core
yarn add @concepta/nestjs-common
yarn add @concepta/nestjs-authentication
yarn add @concepta/nestjs-password
yarn add @concepta/nestjs-jwt
Expand Down Expand Up @@ -162,7 +162,7 @@ in the `AuthLocalModule`.
```ts
// user-lookup.service.ts
import { Injectable } from '@nestjs/common';
import { ReferenceUsername } from '@concepta/ts-core';
import { ReferenceUsername } from '@concepta/nestjs-common';
import { AuthLocalUserLookupServiceInterface } from '@concepta/nestjs-auth-local';
import { AuthLocalCredentialsInterface } from '@concepta/nestjs-auth-local/dist/interfaces/auth-local-credentials.interface';

Expand Down Expand Up @@ -406,7 +406,7 @@ advantage of the default implementation.
```ts
// my-auth-local-validate-user.service.ts
import { Injectable } from '@nestjs/common';
import { ReferenceActiveInterface, ReferenceIdInterface } from '@concepta/ts-core';
import { ReferenceActiveInterface, ReferenceIdInterface } from '@concepta/nestjs-common';
import {
AuthLocalValidateUserInterface,
AuthLocalValidateUserService
Expand Down Expand Up @@ -436,7 +436,7 @@ export class MyAuthLocalValidateUserService
```ts
// my-auth-local-validate-user.service.ts
import { Injectable } from '@nestjs/common';
import { ReferenceActiveInterface, ReferenceIdInterface } from '@concepta/ts-core';
import { ReferenceActiveInterface, ReferenceIdInterface } from '@concepta/nestjs-common';
import {
AuthLocalValidateUserInterface,
AuthLocalValidateUserServiceInterface
Expand Down
Loading

0 comments on commit 567819a

Please sign in to comment.