0.7.0 • Published 7 months ago

@kagari/restful v0.7.0

Weekly downloads
-
License
-
Repository
github
Last release
7 months ago

@kagari/restful

provides a protocol for list query

this package is in develop, may not support every query operator

import { Controller, Get } from '@nestjs/common';
import { ParsedQueryString, QueryProtocol } from '@kagari/restful';

@Controller()
class SomeClass {
  @Get()
  findAll(@QueryProtocol(/* supprts give validate pipe in */) query: ParsedQueryString) {
    // apply the query
  }
}

use in browser

import the entire package will import also @nestjs/* packages. to avoid it, use like below

import { deserialize } from '@kagari/restful/dist/deserialize';
import { getOperatedValue } from '@kagari/restful/dist/helpers';
import { Operations } from '@kagari/restful/dist/types';

const querystring = deserialize({
  $page: 1,
  $pageSize: 20,
  $withDeleted: true,
  createdAt: getOperatedValue(Operations.bw, ['2022-10-01', '2022-10-31'])
})
// $page=1&$pageSize=20&$withDeleted=true&created=$bw(2022-10-01,2022-10-31)
0.6.2

9 months ago

0.6.4

7 months ago

0.7.0

7 months ago

0.5.10

12 months ago

0.5.11

12 months ago

0.6.1

12 months ago

0.4.9

1 year ago

0.4.8

1 year ago

0.5.4

1 year ago

0.4.6

1 year ago

0.5.2

1 year ago

0.2.1

1 year ago

0.1.10

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.12

1 year ago

0.3.1

1 year ago

0.1.0

2 years ago

0.0.4

2 years ago