1.0.14 • Published 4 years ago

@axel-duval/univ3rse v1.0.14

Weekly downloads
-
License
MIT
Repository
-
Last release
4 years ago

Univ3rse

The global interface for deep space microservices.

Installation

$ npm i @axel-duval/univ3rse

Use

For schemas:

import { IToken } from '@axel-duval/univ3rse/dist/schemas/token.schema';
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document, SchemaTypes } from 'mongoose';

@Schema({ timestamps: true, strict: true })
export class Token extends Document implements IToken {
  @Prop({ type: [SchemaTypes.ObjectId] })
  _id: string;

  @Prop({ unique: true })
  clientId: string;

  @Prop()
  access: string;

  @Prop()
  refresh: string;

  @Prop({ default: 0 })
  version: number;
}
export const TokenSchema = SchemaFactory.createForClass(Token);

For queues:

import {
  Deliv3ryPattern,
  Deliv3ryPayload,
  Deliv3ryReturn
} from '@axel-duval/univ3rse/dist/queues/index';
import { MessagePattern, Payload } from '@nestjs/microservices';

@MessagePattern<Deliv3ryPattern>({ cmd: 'queue_cmd' })
  async doSomething(
    @Payload() payload: Deliv3ryPayload<'queue_cmd'>,
  ): Promise<Deliv3ryReturn<'queue_cmd'>> {
    return 1;
  }
1.0.14

4 years ago

1.0.13

4 years ago

1.0.12

4 years ago

1.0.11

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago