You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

nestjs-stellate

Package Overview
Dependencies
Maintainers
0
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

nestjs-stellate

Stellate.co Module for Nest Framework


Version published
Maintainers
0
Created

Readme

Source

Nest Logo

Stellate Module for Nest framework

NPM Version Package License NPM Downloads

Description

This's a module for Nest to handle the purge api from Stellate.

Installation

$ npm i --save nestjs-stellate

Quick Start

Using purge Interceptor

app.resolver.ts

  @Mutation()
  @UseInterceptors(new StellatePurgeInterceptor({
        serviceName: "<service-name>",
        purgeToken: "<token>",
  }))
  async upvotePost(@Args('postId') postId: number) {
    ...
  }
Global

If you want to set up interceptor as global, you have to follow Nest instructions here. Something like this.

app.module.ts

import { APP_INTERCEPTOR } from "@nestjs/core";
import { StellatePurgeInterceptor } from "nestjs-stellate";

@Module({
  providers: [
    {
      provide: APP_INTERCEPTOR,
      useValue: new StellatePurgeInterceptor({
        serviceName: "<service-name>",
        purgeToken: "<token>",
      }),
    },
  ],
})
export class ApplicationModule {}

Use purge query decorator

To purge some queries you can now use the StellatePurgeQuery decorator.

app.resolver.ts

import { StellatePurgeQuery } from "nestjs-stellate"

@Mutation()
@StellatePurgeQuery(["<query-name>"])
async upvotePost(@Args('postId') postId: number) {
  ...
}

Use purge type decorator

To purge some type you can now use the StellatePurgeType decorator.

app.resolver.ts

import { StellatePurgeType } from "nestjs-stellate"

@Mutation()
@StellatePurgeType("<type-name>", "<type-id-reference>")
async upvotePost(@Args('postId') postId: number) {
  ...
}

Keywords

FAQs

Package last updated on 17 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc