Skip to content

Commit

Permalink
docs: updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony133 committed Mar 17, 2024
1 parent c5eee1a commit 1b8ab63
Show file tree
Hide file tree
Showing 27 changed files with 87 additions and 141 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The `GraphQLFastifyParser` parser for the `OgmaInterceptor`. This plugin class p

## Installation

Nothing special, standard `npm i @ogma/platform-graphql-fastify` or `yarn add @ogma/platform-graphql-fastify`
Nothing special, standard `npm i @ogma/platform-graphql-fastify` or `yarn add @ogma/platform-graphql-fastify` or `pnpm add @ogma/platform-graphql-fastify`

## Usage

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/pages/en/nestjs/graphql/platform-graphql.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The `GraphQLParser` parser for the `OgmaInterceptor`. This plugin class parses G

## Installation

Nothing special, standard `npm i @ogma/platform-graphql` or `yarn add @ogma/platform-graphql`
Nothing special, standard `npm i @ogma/platform-graphql` or `yarn add @ogma/platform-graphql` or `pnpm add @ogma/platform-graphql`

## Usage

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/pages/en/nestjs/http/platform-express.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The `ExpressInterceptorParser` parser for the `OgmaInterceptor`. This plugin cla

## Installation

Nothing special, standard `npm i @ogma/platform-express` or `yarn add @ogma/platform-express`
Nothing special, standard `npm i @ogma/platform-express` or `yarn add @ogma/platform-express` or `pnpm add @ogma/platform-express`

## Usage

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/pages/en/nestjs/http/platform-fastify.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The `FastifyInterceptorParser` parser for the `OgmaInterceptor`. This plugin cla

## Installation

Nothing special, standard `npm i @ogma/platform-fastify` or `yarn add @ogma/platform-fastify`
Nothing special, standard `npm i @ogma/platform-fastify` or `yarn add @ogma/platform-fastify` or `pnpm add @ogma/platform-fastify`

## Usage

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/pages/en/nestjs/rpc/grpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The `GrpcParser` parser for the `OgmaInterceptor`. This plugin class parses gRPC

## Installation

Nothing special, standard `npm i @ogma/platform-grpc` or `yarn add @ogma/platform-grpc`
Nothing special, standard `npm i @ogma/platform-grpc` or `yarn add @ogma/platform-grpc` or `pnpm add @ogma/platform-grpc`

## Usage

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/pages/en/nestjs/rpc/kafka.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The `KafkaParser` parser for the `OgmaInterceptor`. This plugin class parses Kaf

## Installation

Nothing special, standard `npm i @ogma/platform-kafka` or `yarn add @ogma/platform-kafka`
Nothing special, standard `npm i @ogma/platform-kafka` or `yarn add @ogma/platform-kafka` or `pnpm add @ogma/platform-kafka`

## Usage

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/pages/en/nestjs/rpc/mqtt.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The `MqttParser` parser for the `OgmaInterceptor`. This plugin class parses MQTT

## Installation

Nothing special, standard `npm i @ogma/platform-mqtt` or `yarn add @ogma/platform-mqtt`
Nothing special, standard `npm i @ogma/platform-mqtt` or `yarn add @ogma/platform-mqtt` or `pnpm add @ogma/platform-mqtt`

## Usage

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/pages/en/nestjs/rpc/nats.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The `NatsParser` parser for the `OgmaInterceptor`. This plugin class parses NATS

## Installation

Nothing special, standard `npm i @ogma/platform-nats` or `yarn add @ogma/platform-nats`
Nothing special, standard `npm i @ogma/platform-nats` or `yarn add @ogma/platform-nats` or `pnpm add @ogma/platform-nats`

## Usage

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/pages/en/nestjs/rpc/rabbitmq.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The `RabbitMqParser` parser for the `OgmaInterceptor`. This plugin class parses

## Installation

Nothing special, standard `npm i @ogma/platform-rabbitmq` or `yarn add @ogma/platform-rabbitmq`
Nothing special, standard `npm i @ogma/platform-rabbitmq` or `yarn add @ogma/platform-rabbitmq` or `pnpm add @ogma/platform-rabbitmq`

## Usage

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/pages/en/nestjs/rpc/redis.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The `RedisParser` parser for the `OgmaInterceptor`. This plugin class parses Red

## Installation

Nothing special, standard `npm i @ogma/platform-redis` or `yarn add @ogma/platform-redis`
Nothing special, standard `npm i @ogma/platform-redis` or `yarn add @ogma/platform-redis` or `pnpm add @ogma/platform-redis`

## Usage

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/pages/en/nestjs/rpc/tcp.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The `TcpParser` parser for the `OgmaInterceptor`. This plugin class parses TCP r

## Installation

Nothing special, standard `npm i @ogma/platform-tcp` or `yarn add @ogma/platform-tcp`
Nothing special, standard `npm i @ogma/platform-tcp` or `yarn add @ogma/platform-tcp` or `pnpm add @ogma/platform-tcp`

## Usage

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/pages/en/nestjs/ws/socket.io.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The `SocketIOParser` parser for the `OgmaInterceptor`. This plugin class parses

## Installation

Nothing special, standard `npm i @ogma/platform-socket.io` or `yarn add @ogma/platform-socket.io`
Nothing special, standard `npm i @ogma/platform-socket.io` or `yarn add @ogma/platform-socket.io` or `pnpm add @ogma/platform-socket.io`

## Usage

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/pages/en/nestjs/ws/ws.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The `WsParser` parser for the `OgmaInterceptor`. This plugin class parses TCP re

## Installation

Nothing special, standard `npm i @ogma/platform-ws` or `yarn add @ogma/platform-ws`
Nothing special, standard `npm i @ogma/platform-ws` or `yarn add @ogma/platform-ws` or `pnpm add @ogma/platform-ws`

## Usage

Expand Down
33 changes: 7 additions & 26 deletions packages/nestjs-module/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A [NestJS module](https://docs.nestjs.com) for the [Ogma](https://github.com/jmc

## Installation

Installation is pretty simple, just `npm i @ogma/nestjs-module` or `yarn add @ogma/nestjs-module`
Installation is pretty simple, just `npm i @ogma/nestjs-module` or `yarn add @ogma/nestjs-module` or `pnpm add @ogma/nestjs-module`

## Usage

Expand All @@ -21,22 +21,13 @@ In your root module, import `OgmaModule.forRoot` or `OgmaModule.forRootAsync` to
```ts
import { APP_INTERCEPTOR } from '@nestjs/core';
import { OgmaInterceptor, OgmaModule } from '@ogma/nestjs-module';
import { ExpressParser } from '@ogma/platform-express';

@Module({
imports: [
OgmaModule.forRoot({
service: {
color: true,
json: false,
application: 'NestJS'
},
interceptor: {
http: ExpressParser,
ws: false,
gql: false,
rpc: false
}
color: true,
json: false,
application: 'NestJS'
})
],
providers: [
Expand Down Expand Up @@ -76,12 +67,6 @@ import { appendFile } from 'fs';
},
application: config.getAppName()
},
interceptor: {
http: ExpressParser,
ws: false,
gql: false,
rpc: false
}
}),
inject: [ConfigService]
})
Expand Down Expand Up @@ -199,7 +184,6 @@ As the pre-built parsers are built around Object Oriented Typescript, if you wan
Okay, so now we're ready to add the `OgmaModule` to our Application. Let's assume we have a `CatsService`, `CatsController` and `CatsModule` and a `ConfigService` and `ConfigModule` in our Application. Let's also assume we want to use a class to asynchronously configure out `OgmaModule`. For now, assume the methods exist on the `ConfigService`. Let's also assume we want to log things in color to our `process.stdout`.

```ts
import { FastifyParser } from '@ogma/platform-fastify';
import { OgmaModuleOptions } from '@ogma/nestjs-module';

@Injectable()
Expand All @@ -208,22 +192,18 @@ export class OgmaModuleConfig {

createModuleConfig(): OgmaModuleOptions {
return {
service: {
// returns one of Ogma's log levels, or 'ALL'.
logLevel: this.configService.getLogLevel(),
color: true,
// could be something like 'MyAwesomeNestApp'
application: this.configService.getAppName()
},
interceptor: {
http: FastifyParser
}
};
}
}
```

Next, in our `AppModule` we can import the `OgmaModule` like so
Next, in our `AppModule` we can import the `OgmaModule` and `FastifyParser` like so

```ts
@Module({
Expand All @@ -235,7 +215,8 @@ Next, in our `AppModule` we can import the `OgmaModule` like so
useClass: OgmaModuleConfig,
imports: [ConfigModule]
})
]
],
providers: [FastifyParser]
})
export class AppModule {}
```
Expand Down
13 changes: 5 additions & 8 deletions packages/platform-express/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@ The `ExpressInterceptorParser` parser for the `OgmaInterceptor`. This plugin cla

## Installation

Nothing special, standard `npm i @ogma/platform-express` or `yarn add @ogma/platform-express`
Nothing special, standard `npm i @ogma/platform-express` or `yarn add @ogma/platform-express` or `pnpm add @ogma/platform-express`

## Usage

This plugin is to be used in the `OgmaInterceptorOptions` portion of the `OgmaModule` during `forRoot` or `forRootAsync` registration. It can be used like so:

```ts
@Module(
OgmaModule.forRoot({
interceptor: {
http: ExpressParser
}
})
)
@Module({
imports: [OgmaModule.forRoot({})],
providers: [ExpressParser]
})
export class AppModule {}
```
13 changes: 5 additions & 8 deletions packages/platform-fastify/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@ The `FastifyInterceptorParser` parser for the `OgmaInterceptor`. This plugin cla

## Installation

Nothing special, standard `npm i @ogma/platform-fastify` or `yarn add @ogma/platform-fastify`
Nothing special, standard `npm i @ogma/platform-fastify` or `yarn add @ogma/platform-fastify` or `pnpm add @ogma/platform-fastify`

## Usage

This plugin is to be used in the `OgmaInterceptorOptions` portion of the `OgmaModule` during `forRoot` or `forRootAsync` registration. It can be used like so:

```ts
@Module(
OgmaModule.forRoot({
interceptor: {
http: FastifyParser
}
})
)
@Module({
imports: [OgmaModule.forRoot({})],
providers: [FastifyParser]
})
export class AppModule {}
```
15 changes: 7 additions & 8 deletions packages/platform-graphql-fastify/README.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
# `@ogma/platform-graphql-fastify`

> Note: If you are using `@nestjs/apollo` make sure you are using fastify v3 and `@nestjs/common` version 8. If you are using`@nestjs/mercurius`you may use fastify v4 and`@nestjs/common` version 9.
The `GraphQLFastifyParser` parser for the `OgmaInterceptor`. This plugin class parses GraphQL request and response object to be able to successfully log the data about the request. For more information, check out [the @ogma/nestjs-module](../nestjs-module/README.md) documentation.

## Installation

Nothing special, standard `npm i @ogma/platform-graphql-fastify` or `yarn add @ogma/platform-graphql-fastify`
Nothing special, standard `npm i @ogma/platform-graphql-fastify` or `yarn add @ogma/platform-graphql-fastify` or `pnpm add @ogma/platform-graphql-fastify`

## Usage

This plugin is to be used in the `OgmaInterceptorOptions` portion of the `OgmaModule` during `forRoot` or `forRootAsync` registration. It can be used like so:

```ts
@Module(
OgmaModule.forRoot({
interceptor: {
gql: GraphQLFastifyParser
}
})
)
@Module({
imports: [OgmaModule.forRoot({})],
providers: [GraphQLFastifyParser]
})
export class AppModule {}
```

Expand Down
13 changes: 5 additions & 8 deletions packages/platform-graphql/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@ The `GraphQLParser` parser for the `OgmaInterceptor`. This plugin class parses G

## Installation

Nothing special, standard `npm i @ogma/platform-graphql` or `yarn add @ogma/platform-graphql`
Nothing special, standard `npm i @ogma/platform-graphql` or `yarn add @ogma/platform-graphql` or `pnpm add @ogma/platform-graphql`

## Usage

This plugin is to be used in the `OgmaInterceptorOptions` portion of the `OgmaModule` during `forRoot` or `forRootAsync` registration. It can be used like so:

```ts
@Module(
OgmaModule.forRoot({
interceptor: {
gql: GraphQLParser
}
})
)
@Module({
imports: [OgmaModule.forRoot({})],
providers: [GraphQLParser]
})
export class AppModule {}
```

Expand Down
12 changes: 5 additions & 7 deletions packages/platform-grpc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@ The `GrpcParser` parser for the `OgmaInterceptor`. This plugin class parses Kafk

## Installation

Nothing special, standard `npm i @ogma/platform-grpc` or `yarn add @ogma/platform-grpc`
Nothing special, standard `npm i @ogma/platform-grpc` or `yarn add @ogma/platform-grpc` or `pnpm add @ogma/platform-grpc`

## Usage

This plugin is to be used in the `OgmaInterceptorOptions` portion of the `OgmaModule` during `forRoot` or `forRootAsync` registration. It can be used like so:

```ts
@Module(
OgmaModule.forRoot({
interceptor: {
rpc: GrpcParser
})
)
@Module({
imports: [OgmaModule.forRoot({})],
providers: [GrpcParser]
})
export class AppModule {}
```

Expand Down
12 changes: 5 additions & 7 deletions packages/platform-kafka/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,17 @@ The `KafkaParser` parser for the `OgmaInterceptor`. This plugin class parses Kaf

## Installation

Nothing special, standard `npm i @ogma/platform-kafka` or `yarn add @ogma/platform-kafka`
Nothing special, standard `npm i @ogma/platform-kafka` or `yarn add @ogma/platform-kafka` or `pnpm add @ogma/platform-kafka`

## Usage

This plugin is to be used in the `OgmaInterceptorOptions` portion of the `OgmaModule` during `forRoot` or `forRootAsync` registration. It can be used like so:

```ts
@Module(
OgmaModule.forRoot({
interceptor: {
rpc: KafkaParser
})
)
@Module({
imports: [OgmaModule.forRoot({})],
providers: [KafkaParser]
})
export class AppModule {}
```

Expand Down
13 changes: 5 additions & 8 deletions packages/platform-mqtt/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,17 @@ The `MqttParser` parser for the `OgmaInterceptor`. This plugin class parses MQTT

## Installation

Nothing special, standard `npm i @ogma/platform-mqtt` or `yarn add @ogma/platform-mqtt`
Nothing special, standard `npm i @ogma/platform-mqtt` or `yarn add @ogma/platform-mqtt` or `pnpm add @ogma/platform-mqtt`

## Usage

This plugin is to be used in the `OgmaInterceptorOptions` portion of the `OgmaModule` during `forRoot` or `forRootAsync` registration. It can be used like so:

```ts
@Module(
OgmaModule.forRoot({
interceptor: {
rpc: MqttParser
}
})
)
@Module({
imports: [OgmaModule.forRoot({})],
providers: [MqttParser]
})
export class AppModule {}
```

Expand Down
Loading

0 comments on commit 1b8ab63

Please sign in to comment.