1.0.14 • Published 5 years ago

@axel-duval/univ3rse v1.0.14

Weekly downloads
-
License
MIT
Repository
-
Last release
5 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

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago