From 06ccda4ad77af73bd1e3b27409636a1636db8005 Mon Sep 17 00:00:00 2001 From: Thiago Ramalho Date: Mon, 30 Sep 2024 11:00:24 -0300 Subject: [PATCH] chore: linting --- packages/nestjs-federated/README.md | 40 ++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/packages/nestjs-federated/README.md b/packages/nestjs-federated/README.md index 0f5407fe..704e5122 100644 --- a/packages/nestjs-federated/README.md +++ b/packages/nestjs-federated/README.md @@ -10,7 +10,7 @@ Authenticate via federated login [![GH Contrib](https://img.shields.io/github/contributors/conceptadev/rockets?logo=github)](https://github.com/conceptadev/rockets/graphs/contributors) [![NestJS Dep](https://img.shields.io/github/package-json/dependency-version/conceptadev/rockets/@nestjs/common?label=NestJS&logo=nestjs&filename=packages%2Fnestjs-core%2Fpackage.json)](https://www.npmjs.com/package/@nestjs/common) -# Table of Contents +## Table of Contents 1. [Tutorials](#tutorials) - [Introduction](#introduction) @@ -30,9 +30,9 @@ Authenticate via federated login - [Federated Services](#federated-services) - [Module Options Responsibilities](#module-options-responsibilities) -# Tutorials +## Tutorials -## Introduction +### Introduction Before we begin, you'll need to set up OAuth Apps for the social providers you wish to use (e.g., GitHub, Google, Facebook) to obtain the necessary credentials. @@ -43,7 +43,7 @@ refer to the [`@concepta/nestjs-auth-github`](https://www.rockets.tools/referenc and [`@concepta/nestjs-auth-google`](https://www.rockets.tools/reference/rockets/nestjs-auth-google/README) documentation to use our modules. -## Getting Started with Federated Authentication +### Getting Started with Federated Authentication ### Step 1: Create User Entity @@ -189,13 +189,19 @@ export const mockUser = { // user-lookup.service.ts import { Injectable } from '@nestjs/common'; import { ReferenceEmail } from '@concepta/ts-core'; -import { FederatedUserLookupServiceInterface } from '@concepta/nestjs-federated'; +import { + FederatedUserLookupServiceInterface +} from '@concepta/nestjs-federated'; import { mockUser } from './user.mock'; @Injectable() -export class UserLookupServiceFixture implements FederatedUserLookupServiceInterface { - async byId(id: string): ReturnType { +export class UserLookupServiceFixture + implements FederatedUserLookupServiceInterface +{ + async byId( + id: string + ): ReturnType { if (id === mockUser.id) { return mockUser; } else { @@ -203,7 +209,9 @@ export class UserLookupServiceFixture implements FederatedUserLookupServiceInter } } - async byEmail(email: ReferenceEmail): ReturnType { + async byEmail( + email: ReferenceEmail + ): Promise { return email === mockUser.email ? mockUser : null; } } @@ -215,14 +223,22 @@ Create a service that implements `FederatedUserMutateServiceInterface`: ```ts // user-mutate.service.ts -import { FederatedCredentialsInterface, FederatedUserMutateServiceInterface } from '@concepta/nestjs-federated'; -import { FederatedUserMutateInterface } from '@concepta/nestjs-federated/dist/interfaces/federated-user-mutate.interface'; +import { + FederatedCredentialsInterface, + FederatedUserMutateServiceInterface +} from '@concepta/nestjs-federated'; +import { + FederatedUserMutateInterface +} from '@concepta/nestjs-federated'; import { Injectable } from '@nestjs/common'; import { mockUser } from './user.mock'; @Injectable() -export class UserMutateServiceFixture implements FederatedUserMutateServiceInterface { - async create(_object: FederatedUserMutateInterface): Promise { +export class UserMutateServiceFixture + implements FederatedUserMutateServiceInterface { + async create( + _object: FederatedUserMutateInterface + ): Promise { return mockUser; } }