nicot 1.1.33 → 1.1.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@ import { ColumnCommonOptions } from 'typeorm/decorator/options/ColumnCommonOptio
2
2
  import { ApiPropertyOptions } from '@nestjs/swagger';
3
3
  import { ColumnWithLengthOptions } from 'typeorm/decorator/options/ColumnWithLengthOptions';
4
4
  import { AnyClass } from 'nesties';
5
- import { WithPrecisionColumnType, WithWidthColumnType } from 'typeorm/driver/types/ColumnTypes';
5
+ import { SimpleColumnType, WithLengthColumnType, WithPrecisionColumnType, WithWidthColumnType } from 'typeorm/driver/types/ColumnTypes';
6
6
  import { ColumnWithWidthOptions } from 'typeorm/decorator/options/ColumnWithWidthOptions';
7
7
  import { ColumnNumericOptions } from 'typeorm/decorator/options/ColumnNumericOptions';
8
8
  import { ClassOrArray, ParseType } from 'nesties';
@@ -15,20 +15,43 @@ export interface OpenAPIOptions<T> {
15
15
  export interface PropertyOptions<T, ColumnEx = unknown> extends OpenAPIOptions<T> {
16
16
  columnExtras?: ColumnCommonOptions & ColumnEx;
17
17
  }
18
- export declare const StringColumn: (length: number, options?: PropertyOptions<string, ColumnWithLengthOptions>) => PropertyDecorator;
18
+ export declare const StringColumn: (length: number, options?: PropertyOptions<string, ColumnWithLengthOptions> & {
19
+ columnType?: WithLengthColumnType;
20
+ }) => PropertyDecorator;
21
+ export declare const TextColumn: (options?: PropertyOptions<string> & {
22
+ columnType?: SimpleColumnType;
23
+ }) => PropertyDecorator;
19
24
  export declare const UuidColumn: (options?: PropertyOptions<string> & {
20
25
  generated?: boolean;
21
26
  }) => PropertyDecorator;
22
27
  export declare const IntColumn: (type: WithWidthColumnType, options?: PropertyOptions<number, ColumnWithWidthOptions> & {
23
28
  unsigned?: boolean;
29
+ range?: {
30
+ min?: number;
31
+ max?: number;
32
+ };
24
33
  }) => PropertyDecorator;
25
34
  export declare const FloatColumn: (type: WithPrecisionColumnType, options?: PropertyOptions<number, ColumnNumericOptions> & {
26
35
  unsigned?: boolean;
36
+ range?: {
37
+ min?: number;
38
+ max?: number;
39
+ };
40
+ }) => PropertyDecorator;
41
+ export declare const DateColumn: (options?: PropertyOptions<Date> & {
42
+ columnType?: SimpleColumnType;
27
43
  }) => PropertyDecorator;
28
- export declare const DateColumn: (options?: PropertyOptions<Date>) => PropertyDecorator;
29
44
  export declare const EnumColumn: <T>(targetEnum: Record<string, T>, options?: PropertyOptions<T>) => PropertyDecorator;
30
45
  export declare const BoolColumn: (options?: PropertyOptions<boolean>) => PropertyDecorator;
31
- export declare const JsonColumn: <C extends ClassOrArray>(definition: C, options?: PropertyOptions<ParseType<C>>) => PropertyDecorator;
46
+ export declare const JsonColumn: <C extends ClassOrArray>(definition: C, options?: PropertyOptions<ParseType<C>> & {
47
+ columnType?: SimpleColumnType;
48
+ }) => PropertyDecorator;
49
+ export declare const SimpleJsonColumn: <C extends ClassOrArray>(definition: C, options?: PropertyOptions<ParseType<C>> & {
50
+ columnType?: SimpleColumnType;
51
+ }) => PropertyDecorator;
52
+ export declare const StringJsonColumn: <C extends ClassOrArray>(definition: C, options?: PropertyOptions<ParseType<C>> & {
53
+ columnType?: SimpleColumnType;
54
+ }) => PropertyDecorator;
32
55
  export declare const NotColumn: (options?: OpenAPIOptions<any>, specials?: {
33
56
  keepInCreate?: boolean;
34
57
  }) => PropertyDecorator;
@@ -6,6 +6,7 @@ export declare const QueryLike: () => PropertyDecorator;
6
6
  export declare const QuerySearch: () => PropertyDecorator;
7
7
  export declare const QueryEqualZeroNullable: () => PropertyDecorator;
8
8
  export declare const QueryMatchBoolean: () => PropertyDecorator;
9
+ export declare const QueryMatchBooleanMySQL: () => PropertyDecorator;
9
10
  export declare const QueryOperator: (operator: string, field?: string) => PropertyDecorator;
10
11
  export declare const createQueryOperator: (operator: string) => (field?: string) => PropertyDecorator;
11
12
  export declare const QueryGreater: (field?: string) => PropertyDecorator;
@@ -54,6 +54,7 @@ export declare class RestfulFactory<T extends {
54
54
  idParam(): ParameterDecorator;
55
55
  findAll(extras?: Partial<OperationObject>): MethodDecorator;
56
56
  findAllCursorPaginated(extras?: Partial<OperationObject>): MethodDecorator;
57
+ private getBoolColumns;
57
58
  findAllParam(): ParameterDecorator;
58
59
  update(extras?: Partial<OperationObject>): MethodDecorator;
59
60
  updateParam(): ParameterDecorator;
@@ -0,0 +1,8 @@
1
+ import { PipeTransform } from '@nestjs/common';
2
+ export declare const parseBool: (value: any) => boolean;
3
+ export declare const parseBoolObject: <T>(obj: T, boolFields: (keyof T)[]) => T;
4
+ export declare class ParseBoolObjectPipe<T> implements PipeTransform {
5
+ private readonly boolFields;
6
+ constructor(boolFields: string[]);
7
+ transform(obj: T): T;
8
+ }
@@ -8,3 +8,4 @@ export declare const applyQueryPropertyLike: <T>(obj: T, qb: SelectQueryBuilder<
8
8
  export declare const applyQueryPropertySearch: <T>(obj: T, qb: SelectQueryBuilder<T>, entityName: string, ...fields: (keyof T & string)[]) => SelectQueryBuilder<T>;
9
9
  export declare const applyQueryPropertyZeroNullable: <T>(obj: T, qb: SelectQueryBuilder<T>, entityName: string, ...fields: (keyof T & string)[]) => SelectQueryBuilder<T>;
10
10
  export declare const applyQueryMatchBoolean: <T>(obj: T, qb: SelectQueryBuilder<T>, entityName: string, ...fields: (keyof T & string)[]) => SelectQueryBuilder<T>;
11
+ export declare const applyQueryMatchBooleanMySQL: <T>(obj: T, qb: SelectQueryBuilder<T>, entityName: string, ...fields: (keyof T & string)[]) => SelectQueryBuilder<T>;
@@ -6,3 +6,7 @@ export declare class TypeTransformer implements ValueTransformer {
6
6
  from(dbValue: any): any;
7
7
  to(entValue: any): any;
8
8
  }
9
+ export declare class TypeTransformerString extends TypeTransformer {
10
+ from(dbValue: any): any;
11
+ to(entValue: any): any;
12
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "nicot",
3
3
  "description": "Nest.js interacting with class-validator + OpenAPI + TypeORM for Nest.js Restful API development.",
4
- "version": "1.1.33",
4
+ "version": "1.1.34",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",