nicot 1.2.7 → 1.2.10

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.
@@ -93,7 +93,10 @@ export declare class CrudBase<T extends ValidCrudEntity<T>> {
93
93
  operation<R>(id: EntityId<T>, cb: (ent: T, ctx: {
94
94
  repo: Repository<T>;
95
95
  flush: () => Promise<void>;
96
- }) => Awaitable<R>, extraOptions?: FindOneOptions<T>): Promise<GenericReturnMessageDto<R>>;
96
+ }) => Awaitable<R>, options?: {
97
+ find?: FindOneOptions<T>;
98
+ repo?: Repository<T>;
99
+ }): Promise<GenericReturnMessageDto<R>>;
97
100
  _loadFullTextIndex(): Promise<void>;
98
101
  onModuleInit(): Promise<void>;
99
102
  }
@@ -168,7 +171,10 @@ export declare function CrudService<T extends ValidCrudEntity<T>>(entityClass: C
168
171
  operation<R>(id: EntityId<T>, cb: (ent: T, ctx: {
169
172
  repo: Repository<T>;
170
173
  flush: () => Promise<void>;
171
- }) => Awaitable<R>, extraOptions?: FindOneOptions<T>): Promise<GenericReturnMessageDto<R>>;
174
+ }) => Awaitable<R>, options?: {
175
+ find?: FindOneOptions<T>;
176
+ repo?: Repository<T>;
177
+ }): Promise<GenericReturnMessageDto<R>>;
172
178
  _loadFullTextIndex(): Promise<void>;
173
179
  onModuleInit(): Promise<void>;
174
180
  };
@@ -56,4 +56,6 @@ export declare const NotColumn: (options?: OpenAPIOptions<any>, specials?: {
56
56
  keepInCreate?: boolean;
57
57
  }) => PropertyDecorator;
58
58
  export declare const QueryColumn: (options?: OpenAPIOptions<any>) => PropertyDecorator;
59
+ export declare const InternalColumn: () => PropertyDecorator;
60
+ export declare const CreateOnlyColumn: () => PropertyDecorator;
59
61
  export declare const RelationComputed: (type?: () => AnyClass) => PropertyDecorator;
@@ -19,6 +19,9 @@ export interface RestfulFactoryOptions<T, O extends keyof T = never, W extends k
19
19
  relations?: (string | RelationDef)[];
20
20
  skipNonQueryableFields?: boolean;
21
21
  }
22
+ export interface ResourceOptions extends Partial<OperationObject> {
23
+ prefix?: string;
24
+ }
22
25
  export declare class RestfulFactory<T extends {
23
26
  id: any;
24
27
  }, O extends keyof T = never, W extends keyof T = never, C extends keyof T = never, U extends keyof T = never, F extends keyof T = never, R extends keyof T = never> {
@@ -65,21 +68,20 @@ export declare class RestfulFactory<T extends {
65
68
  }[]>;
66
69
  get idType(): StringConstructor | NumberConstructor;
67
70
  private usePrefix;
68
- create(extras?: Partial<OperationObject>): MethodDecorator;
71
+ create(extras?: ResourceOptions): MethodDecorator;
69
72
  createParam(): ParameterDecorator;
70
- findOne(extras?: Partial<OperationObject>): MethodDecorator;
73
+ findOne(extras?: ResourceOptions): MethodDecorator;
71
74
  idParam(): ParameterDecorator;
72
- findAll(extras?: Partial<OperationObject>): MethodDecorator;
73
- findAllCursorPaginated(extras?: Partial<OperationObject>): MethodDecorator;
75
+ findAll(extras?: ResourceOptions): MethodDecorator;
76
+ findAllCursorPaginated(extras?: ResourceOptions): MethodDecorator;
74
77
  private getMutatorColumns;
75
78
  findAllParam(): ParameterDecorator;
76
- update(extras?: Partial<OperationObject>): MethodDecorator;
79
+ update(extras?: ResourceOptions): MethodDecorator;
77
80
  updateParam(): ParameterDecorator;
78
- delete(extras?: Partial<OperationObject>): MethodDecorator;
79
- import(extras?: Partial<OperationObject>): MethodDecorator;
80
- operation(operationName: string, options?: {
81
+ delete(extras?: ResourceOptions): MethodDecorator;
82
+ import(extras?: ResourceOptions): MethodDecorator;
83
+ operation(operationName: string, options?: ResourceOptions & {
81
84
  returnType?: AnyClass;
82
- operationExtras?: Partial<OperationObject>;
83
85
  }): MethodDecorator;
84
86
  baseController<Options extends Partial<{
85
87
  paginateType: RestfulPaginateType;
@@ -172,7 +174,10 @@ export declare class RestfulFactory<T extends {
172
174
  operation<R_1>(id: import("./crud-base").EntityId<T>, cb: (ent: T, ctx: {
173
175
  repo: Repository<T>;
174
176
  flush: () => Promise<void>;
175
- }) => import("nesties").Awaitable<R_1>, extraOptions?: import("typeorm").FindOneOptions<T>): Promise<import("nesties").GenericReturnMessageDto<R_1>>;
177
+ }) => import("nesties").Awaitable<R_1>, options?: {
178
+ find?: import("typeorm").FindOneOptions<T>;
179
+ repo?: Repository<T>;
180
+ }): Promise<import("nesties").GenericReturnMessageDto<R_1>>;
176
181
  _loadFullTextIndex(): Promise<void>;
177
182
  onModuleInit(): Promise<void>;
178
183
  };
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.2.7",
4
+ "version": "1.2.10",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
7
7
  "types": "dist/index.d.ts",
@@ -96,7 +96,7 @@
96
96
  "dependencies": {
97
97
  "lodash": "^4.17.21",
98
98
  "nesties": "^1.1.16",
99
- "nfkit": "^1.0.12",
99
+ "nfkit": "^1.0.13",
100
100
  "p-queue": "6.6.2",
101
101
  "superjson": "1.13.3",
102
102
  "typed-reflector": "^1.0.14"
@@ -1 +0,0 @@
1
- export declare const Memorize: () => (_target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;