mongodb-dynamic-api 1.3.0 → 1.3.1
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.
- package/CHANGELOG.md +2 -0
- package/README.md +86 -8
- package/package.json +3 -1
- package/src/dynamic-api.module.d.ts +4 -3
- package/src/dynamic-api.module.js +16 -1
- package/src/interfaces/controller-options.interface.d.ts +8 -0
- package/src/interfaces/dynamic-api-cache-options.interface.d.ts +8 -0
- package/src/interfaces/dynamic-api-options.interface.d.ts +10 -10
- package/src/interfaces/{route-config.interface.d.ts → dynamic-api-route-config.interface.d.ts} +2 -2
- package/src/interfaces/dynamic-api-route-config.interface.js +2 -0
- package/src/interfaces/{service-provider.interface.d.ts → dynamic-api-service-provider.interface.d.ts} +2 -2
- package/src/interfaces/dynamic-api-service-provider.interface.js +2 -0
- package/src/interfaces/index.d.ts +4 -3
- package/src/interfaces/index.js +4 -3
- package/src/modules/create-many/create-many.helper.d.ts +2 -2
- package/src/modules/create-many/create-many.module.d.ts +2 -2
- package/src/modules/create-one/create-one.helper.d.ts +2 -2
- package/src/modules/create-one/create-one.module.d.ts +2 -2
- package/src/modules/delete-many/delete-many.helper.d.ts +2 -2
- package/src/modules/delete-many/delete-many.module.d.ts +2 -2
- package/src/modules/delete-one/delete-one.helper.d.ts +2 -2
- package/src/modules/delete-one/delete-one.module.d.ts +2 -2
- package/src/modules/duplicate-many/duplicate-many.helper.d.ts +2 -2
- package/src/modules/duplicate-many/duplicate-many.module.d.ts +2 -2
- package/src/modules/duplicate-one/duplicate-one.helper.d.ts +2 -2
- package/src/modules/duplicate-one/duplicate-one.module.d.ts +2 -2
- package/src/modules/get-many/get-many.helper.d.ts +2 -2
- package/src/modules/get-many/get-many.module.d.ts +2 -2
- package/src/modules/get-one/get-one.helper.d.ts +2 -2
- package/src/modules/get-one/get-one.module.d.ts +2 -2
- package/src/modules/replace-one/replace-one.helper.d.ts +2 -2
- package/src/modules/replace-one/replace-one.module.d.ts +2 -2
- package/src/modules/update-many/update-many.helper.d.ts +2 -2
- package/src/modules/update-many/update-many.module.d.ts +2 -2
- package/src/modules/update-one/update-one.helper.d.ts +2 -2
- package/src/modules/update-one/update-one.module.d.ts +2 -2
- package/src/version.json +1 -1
- package/tsconfig.tsbuildinfo +1 -1
- /package/src/interfaces/{entity-mappers.interface.js → controller-options.interface.js} +0 -0
- /package/src/interfaces/{route-config.interface.js → dynamic-api-cache-options.interface.js} +0 -0
- /package/src/interfaces/{entity-mappers.interface.d.ts → dynamic-api-entity-mappers.interface.d.ts} +0 -0
- /package/src/interfaces/{service-provider.interface.js → dynamic-api-entity-mappers.interface.js} +0 -0
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -241,8 +241,7 @@ The `enableDynamicAPIValidation` function allow to configure the pipe validation
|
|
|
241
241
|
|
|
242
242
|
You can also define the pipe validation options in the `DynamicApiModule.forFeature` method, either in the controller options,
|
|
243
243
|
or in each route object defined in the routes property.
|
|
244
|
-
|
|
245
|
-
*If the options are specified in 2, the options specified in the route will have priority.*
|
|
244
|
+
<br>*If the options are specified in 2, the options specified in the route will have priority.*
|
|
246
245
|
|
|
247
246
|
```typescript
|
|
248
247
|
// users.module.ts
|
|
@@ -308,6 +307,11 @@ ___
|
|
|
308
307
|
### [Versioning](https://docs.nestjs.com/techniques/versioning) (optional)
|
|
309
308
|
`function enableDynamicAPIVersioning(app: INestApplication, options?: VersioningOptions): void`
|
|
310
309
|
|
|
310
|
+
The `enableDynamicAPIVersioning` function will automatically add versioning to the API.
|
|
311
|
+
<br>By default, it will use the <strong>URI versioning type</strong>.
|
|
312
|
+
<br>This method can be called with a second <strong>optional parameter</strong> to specify custom options.
|
|
313
|
+
<br>*See <strong>nestjs</strong> <a href="https://docs.nestjs.com/techniques/versioning" target="_blank">documentation</a> for more details.*
|
|
314
|
+
|
|
311
315
|
**Configuration**
|
|
312
316
|
|
|
313
317
|
```typescript
|
|
@@ -323,11 +327,6 @@ async function bootstrap() {
|
|
|
323
327
|
}
|
|
324
328
|
```
|
|
325
329
|
|
|
326
|
-
The `enableDynamicAPIVersioning` function will automatically add versioning to the API.
|
|
327
|
-
<br>By default, it will use the <strong>URI versioning type</strong>.
|
|
328
|
-
<br>This method can be called with a second <strong>optional parameter</strong> to specify custom options.
|
|
329
|
-
<br>*See <strong>nestjs</strong> <a href="https://docs.nestjs.com/techniques/versioning" target="_blank">documentation</a> for more details.*
|
|
330
|
-
|
|
331
330
|
**Usage**
|
|
332
331
|
|
|
333
332
|
Pass the `version` property to the `controllerOptions` object or to the `route` object in the `DynamicApiModule.forFeature` method.
|
|
@@ -414,5 +413,84 @@ Great, now you have a versioned User API, and you can access it at the `/v1/user
|
|
|
414
413
|
|
|
415
414
|
___
|
|
416
415
|
|
|
417
|
-
|
|
416
|
+
### [Caching](https://docs.nestjs.com/techniques/caching#in-memory-cache) (enabled by default)
|
|
417
|
+
|
|
418
|
+
By default, the caching is activated globally for all the routes. It uses the nestjs built-in in-memory data store with the default options.
|
|
419
|
+
<br>You can configure the cache options by passing the `cacheOptions` in the second parameter of the `DynamicApiModule.forRoot` method.
|
|
420
|
+
|
|
421
|
+
**Configuration**
|
|
422
|
+
|
|
423
|
+
```typescript
|
|
424
|
+
// app.module.ts
|
|
425
|
+
import { DynamicApiModule } from 'mongodb-dynamic-api';
|
|
426
|
+
|
|
427
|
+
@Module({
|
|
428
|
+
imports: [
|
|
429
|
+
DynamicApiModule.forRoot('...', {
|
|
430
|
+
cacheOptions: {
|
|
431
|
+
ttl: 60, // <- The time to live in milliseconds. This is the maximum amount of time that an item can be in the cache before it is removed.
|
|
432
|
+
max: 100, // <- The maximum number of items that can be stored in the cache.
|
|
433
|
+
},
|
|
434
|
+
}),
|
|
435
|
+
// ...
|
|
436
|
+
],
|
|
437
|
+
controllers: [AppController],
|
|
438
|
+
providers: [AppService],
|
|
439
|
+
})
|
|
440
|
+
export class AppModule {}
|
|
441
|
+
```
|
|
442
|
+
|
|
443
|
+
*See <strong>nestjs</strong> <a href="https://docs.nestjs.com/techniques/caching" target="_blank">documentation</a> for more details.*
|
|
444
|
+
|
|
445
|
+
**[Not recommended]** The cache can also be disabled globally with the `useGlobalCache` property set to `false` in the `DynamicApiModule.forRoot` method.
|
|
446
|
+
|
|
447
|
+
```typescript
|
|
448
|
+
// app.module.ts
|
|
449
|
+
import { DynamicApiModule } from 'mongodb-dynamic-api';
|
|
450
|
+
|
|
451
|
+
@Module({
|
|
452
|
+
imports: [
|
|
453
|
+
DynamicApiModule.forRoot('...', {
|
|
454
|
+
useGlobalCache: false, // <- add this line
|
|
455
|
+
}),
|
|
456
|
+
// ...
|
|
457
|
+
],
|
|
458
|
+
controllers: [AppController],
|
|
459
|
+
providers: [AppService],
|
|
460
|
+
})
|
|
461
|
+
export class AppModule {}
|
|
462
|
+
```
|
|
463
|
+
|
|
464
|
+
**Usage**
|
|
465
|
+
|
|
466
|
+
> When you request the `/users` route with the `GET` method, the response will be cached until the cache expires or until the maximum number of items is reached or until a request like `POST`, `PUT`, `PATCH`, or `DELETE` is made on the same route.
|
|
467
|
+
<br><br>Let's inspect the behavior in the network tab of our browser
|
|
468
|
+
<br>We expected to see a code `200` for the first GET request, a code `304`* for the second GET request, and again a code `200` for the third GET request made after the POST request.
|
|
469
|
+
|
|
470
|
+
**The 304 Not Modified redirect response code indicates that there is no need to retransmit the requested resources. This is an implicit redirection to a cached resource.*
|
|
471
|
+
|
|
472
|
+
```text
|
|
473
|
+
1. GET /users
|
|
474
|
+
```
|
|
475
|
+

|
|
476
|
+
|
|
477
|
+
```text
|
|
478
|
+
2. GET /users
|
|
479
|
+
```
|
|
480
|
+

|
|
481
|
+
```text
|
|
482
|
+
3. POST /users
|
|
483
|
+
```
|
|
484
|
+

|
|
485
|
+
```text
|
|
486
|
+
4. GET /users
|
|
487
|
+
```
|
|
488
|
+

|
|
489
|
+
|
|
490
|
+
___
|
|
491
|
+
|
|
492
|
+
More coming soon...
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
|
|
418
496
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mongodb-dynamic-api",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "Auto generated CRUD API for MongoDB using NestJS",
|
|
5
5
|
"readmeFilename": "README.md",
|
|
6
6
|
"main": "index.js",
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://mikedev75015.github.io",
|
|
40
40
|
"dependencies": {
|
|
41
|
+
"@nestjs/cache-manager": "^2.2.1",
|
|
41
42
|
"@nestjs/common": "^10.3.2",
|
|
42
43
|
"@nestjs/core": "^10.3.2",
|
|
43
44
|
"@nestjs/mongoose": "^10.0.4",
|
|
@@ -45,6 +46,7 @@
|
|
|
45
46
|
"@nestjs/swagger": "^7.3.0",
|
|
46
47
|
"@types/lodash": "^4.14.202",
|
|
47
48
|
"builder-pattern": "^2.2.0",
|
|
49
|
+
"cache-manager": "^5.4.0",
|
|
48
50
|
"class-transformer": "^0.5.1",
|
|
49
51
|
"class-validator": "^0.14.1",
|
|
50
52
|
"lodash": "^4.17.21",
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { DynamicModule } from '@nestjs/common';
|
|
2
|
-
import {
|
|
2
|
+
import { DynamicApiForFeatureOptions, DynamicApiForRootOptions } from './interfaces';
|
|
3
3
|
import { BaseEntity } from './models';
|
|
4
4
|
export declare class DynamicApiModule {
|
|
5
5
|
static readonly connectionName = "dynamic-api-connection";
|
|
6
|
-
static
|
|
7
|
-
static
|
|
6
|
+
static isGlobalCacheEnabled: boolean;
|
|
7
|
+
static forRoot(uri: string, { useGlobalCache, cacheOptions }?: DynamicApiForRootOptions): DynamicModule;
|
|
8
|
+
static forFeature<Entity extends BaseEntity>({ entity, controllerOptions: { path, apiTag, version: controllerVersion, validationPipeOptions: controllerValidationPipeOptions, }, routes, }: DynamicApiForFeatureOptions<Entity>): DynamicModule;
|
|
8
9
|
}
|
|
@@ -8,7 +8,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var DynamicApiModule_1;
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.DynamicApiModule = void 0;
|
|
11
|
+
const cache_manager_1 = require("@nestjs/cache-manager");
|
|
11
12
|
const common_1 = require("@nestjs/common");
|
|
13
|
+
const core_1 = require("@nestjs/core");
|
|
12
14
|
const mongoose_1 = require("@nestjs/mongoose");
|
|
13
15
|
const decorators_1 = require("./decorators");
|
|
14
16
|
const helpers_1 = require("./helpers");
|
|
@@ -17,13 +19,17 @@ const delete_many_1 = require("./modules/delete-many");
|
|
|
17
19
|
const duplicate_many_1 = require("./modules/duplicate-many");
|
|
18
20
|
const update_many_1 = require("./modules/update-many");
|
|
19
21
|
let DynamicApiModule = DynamicApiModule_1 = class DynamicApiModule {
|
|
20
|
-
static forRoot(uri) {
|
|
22
|
+
static forRoot(uri, { useGlobalCache = true, cacheOptions = {} } = {}) {
|
|
21
23
|
if (!uri) {
|
|
22
24
|
throw new Error('You must provide a valid mongodb uri in the forRoot method to use MongoDB Dynamic API');
|
|
23
25
|
}
|
|
26
|
+
if (!useGlobalCache) {
|
|
27
|
+
DynamicApiModule_1.isGlobalCacheEnabled = false;
|
|
28
|
+
}
|
|
24
29
|
return {
|
|
25
30
|
module: DynamicApiModule_1,
|
|
26
31
|
imports: [
|
|
32
|
+
...(useGlobalCache ? [cache_manager_1.CacheModule.register({ isGlobal: true, ...cacheOptions })] : []),
|
|
27
33
|
mongoose_1.MongooseModule.forRoot(uri, { connectionName: DynamicApiModule_1.connectionName }),
|
|
28
34
|
],
|
|
29
35
|
};
|
|
@@ -111,11 +117,20 @@ let DynamicApiModule = DynamicApiModule_1 = class DynamicApiModule {
|
|
|
111
117
|
})
|
|
112
118
|
.filter((module) => module),
|
|
113
119
|
],
|
|
120
|
+
providers: [
|
|
121
|
+
...(DynamicApiModule_1.isGlobalCacheEnabled ? [
|
|
122
|
+
{
|
|
123
|
+
provide: core_1.APP_INTERCEPTOR,
|
|
124
|
+
useClass: cache_manager_1.CacheInterceptor,
|
|
125
|
+
},
|
|
126
|
+
] : []),
|
|
127
|
+
],
|
|
114
128
|
};
|
|
115
129
|
}
|
|
116
130
|
};
|
|
117
131
|
exports.DynamicApiModule = DynamicApiModule;
|
|
118
132
|
DynamicApiModule.connectionName = 'dynamic-api-connection';
|
|
133
|
+
DynamicApiModule.isGlobalCacheEnabled = true;
|
|
119
134
|
exports.DynamicApiModule = DynamicApiModule = DynamicApiModule_1 = __decorate([
|
|
120
135
|
(0, common_1.Module)({})
|
|
121
136
|
], DynamicApiModule);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CacheStore, CacheStoreFactory } from '@nestjs/cache-manager/dist/interfaces/cache-manager.interface';
|
|
2
|
+
interface DynamicApiCacheOptions {
|
|
3
|
+
max?: number;
|
|
4
|
+
ttl?: number;
|
|
5
|
+
store?: string | CacheStoreFactory | CacheStore;
|
|
6
|
+
isCacheableValue?: (value: any) => boolean;
|
|
7
|
+
}
|
|
8
|
+
export { DynamicApiCacheOptions };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Type
|
|
1
|
+
import { Type } from '@nestjs/common';
|
|
2
2
|
import { BaseEntity } from '../models';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
import { ControllerOptions } from './controller-options.interface';
|
|
4
|
+
import { DynamicApiCacheOptions } from './dynamic-api-cache-options.interface';
|
|
5
|
+
import { DynamicAPIRouteConfig } from './dynamic-api-route-config.interface';
|
|
6
|
+
interface DynamicApiForRootOptions {
|
|
7
|
+
useGlobalCache?: boolean;
|
|
8
|
+
cacheOptions?: DynamicApiCacheOptions;
|
|
9
9
|
}
|
|
10
|
-
interface
|
|
10
|
+
interface DynamicApiForFeatureOptions<Entity extends BaseEntity> {
|
|
11
11
|
entity: Type<Entity>;
|
|
12
12
|
controllerOptions: ControllerOptions;
|
|
13
|
-
routes?:
|
|
13
|
+
routes?: DynamicAPIRouteConfig<Entity>[];
|
|
14
14
|
}
|
|
15
|
-
export {
|
|
15
|
+
export { DynamicApiForFeatureOptions, DynamicApiForRootOptions };
|
package/src/interfaces/{route-config.interface.d.ts → dynamic-api-route-config.interface.d.ts}
RENAMED
|
@@ -7,11 +7,11 @@ type DTOsBundle = {
|
|
|
7
7
|
body?: Type;
|
|
8
8
|
presenter?: Type;
|
|
9
9
|
};
|
|
10
|
-
interface
|
|
10
|
+
interface DynamicAPIRouteConfig<Entity extends BaseEntity> {
|
|
11
11
|
type: RouteType;
|
|
12
12
|
description?: string;
|
|
13
13
|
version?: string;
|
|
14
14
|
dTOs?: DTOsBundle;
|
|
15
15
|
validationPipeOptions?: ValidationPipeOptions;
|
|
16
16
|
}
|
|
17
|
-
export { DTOsBundle, RouteType,
|
|
17
|
+
export { DTOsBundle, RouteType, DynamicAPIRouteConfig };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './controller-options.interface';
|
|
2
|
+
export * from './dynamic-api-entity-mappers.interface';
|
|
2
3
|
export * from './dynamic-api-options.interface';
|
|
3
4
|
export * from './dynamic-api-schema-options.interface';
|
|
4
5
|
export * from './dynamic-api-swagger-options.type';
|
|
5
|
-
export * from './route-config.interface';
|
|
6
|
-
export * from './service-provider.interface';
|
|
6
|
+
export * from './dynamic-api-route-config.interface';
|
|
7
|
+
export * from './dynamic-api-service-provider.interface';
|
package/src/interfaces/index.js
CHANGED
|
@@ -14,9 +14,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./controller-options.interface"), exports);
|
|
18
|
+
__exportStar(require("./dynamic-api-entity-mappers.interface"), exports);
|
|
18
19
|
__exportStar(require("./dynamic-api-options.interface"), exports);
|
|
19
20
|
__exportStar(require("./dynamic-api-schema-options.interface"), exports);
|
|
20
21
|
__exportStar(require("./dynamic-api-swagger-options.type"), exports);
|
|
21
|
-
__exportStar(require("./route-config.interface"), exports);
|
|
22
|
-
__exportStar(require("./service-provider.interface"), exports);
|
|
22
|
+
__exportStar(require("./dynamic-api-route-config.interface"), exports);
|
|
23
|
+
__exportStar(require("./dynamic-api-service-provider.interface"), exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { DTOsBundle,
|
|
2
|
+
import { DTOsBundle, DynamicAPIServiceProvider } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
import { CreateManyControllerConstructor } from './create-many-controller.interface';
|
|
5
|
-
declare function createCreateManyServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined):
|
|
5
|
+
declare function createCreateManyServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined): DynamicAPIServiceProvider;
|
|
6
6
|
declare function createCreateManyController<Entity extends BaseEntity>(entity: Type<Entity>, path: string, apiTag?: string, version?: string, description?: string, DTOs?: DTOsBundle, validationPipeOptions?: ValidationPipeOptions): CreateManyControllerConstructor<Entity>;
|
|
7
7
|
export { createCreateManyController, createCreateManyServiceProvider };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DynamicModule, Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { ControllerOptions,
|
|
2
|
+
import { ControllerOptions, DynamicAPIRouteConfig } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
export declare class CreateManyModule {
|
|
5
|
-
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }:
|
|
5
|
+
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }: DynamicAPIRouteConfig<Entity>, version?: string, validationPipeOptions?: ValidationPipeOptions): DynamicModule;
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { DTOsBundle,
|
|
2
|
+
import { DTOsBundle, DynamicAPIServiceProvider } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
import { CreateOneControllerConstructor } from './create-one-controller.interface';
|
|
5
|
-
declare function createCreateOneServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined):
|
|
5
|
+
declare function createCreateOneServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined): DynamicAPIServiceProvider;
|
|
6
6
|
declare function createCreateOneController<Entity extends BaseEntity>(entity: Type<Entity>, path: string, apiTag?: string, version?: string, description?: string, DTOs?: DTOsBundle, validationPipeOptions?: ValidationPipeOptions): CreateOneControllerConstructor<Entity>;
|
|
7
7
|
export { createCreateOneController, createCreateOneServiceProvider };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DynamicModule, Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { ControllerOptions,
|
|
2
|
+
import { ControllerOptions, DynamicAPIRouteConfig } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
export declare class CreateOneModule {
|
|
5
|
-
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }:
|
|
5
|
+
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }: DynamicAPIRouteConfig<Entity>, version?: string, validationPipeOptions?: ValidationPipeOptions): DynamicModule;
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { DTOsBundle,
|
|
2
|
+
import { DTOsBundle, DynamicAPIServiceProvider } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
import { DeleteManyControllerConstructor } from './delete-many-controller.interface';
|
|
5
|
-
declare function createDeleteManyServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined):
|
|
5
|
+
declare function createDeleteManyServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined): DynamicAPIServiceProvider;
|
|
6
6
|
declare function createDeleteManyController<Entity extends BaseEntity>(entity: Type<Entity>, path: string, apiTag?: string, version?: string, description?: string, DTOs?: DTOsBundle, validationPipeOptions?: ValidationPipeOptions): DeleteManyControllerConstructor<Entity>;
|
|
7
7
|
export { createDeleteManyController, createDeleteManyServiceProvider };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DynamicModule, Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { ControllerOptions,
|
|
2
|
+
import { ControllerOptions, DynamicAPIRouteConfig } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
export declare class DeleteManyModule {
|
|
5
|
-
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }:
|
|
5
|
+
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }: DynamicAPIRouteConfig<Entity>, version?: string, validationPipeOptions?: ValidationPipeOptions): DynamicModule;
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { DTOsBundle,
|
|
2
|
+
import { DTOsBundle, DynamicAPIServiceProvider } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
import { DeleteOneControllerConstructor } from './delete-one-controller.interface';
|
|
5
|
-
declare function createDeleteOneServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined):
|
|
5
|
+
declare function createDeleteOneServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined): DynamicAPIServiceProvider;
|
|
6
6
|
declare function createDeleteOneController<Entity extends BaseEntity>(entity: Type<Entity>, path: string, apiTag?: string, version?: string, description?: string, DTOs?: DTOsBundle, validationPipeOptions?: ValidationPipeOptions): DeleteOneControllerConstructor<Entity>;
|
|
7
7
|
export { createDeleteOneController, createDeleteOneServiceProvider };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DynamicModule, Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { ControllerOptions,
|
|
2
|
+
import { ControllerOptions, DynamicAPIRouteConfig } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
export declare class DeleteOneModule {
|
|
5
|
-
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }:
|
|
5
|
+
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }: DynamicAPIRouteConfig<Entity>, version?: string, validationPipeOptions?: ValidationPipeOptions): DynamicModule;
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { DTOsBundle,
|
|
2
|
+
import { DTOsBundle, DynamicAPIServiceProvider } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
import { DuplicateManyControllerConstructor } from './duplicate-many-controller.interface';
|
|
5
|
-
declare function createDuplicateManyServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined):
|
|
5
|
+
declare function createDuplicateManyServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined): DynamicAPIServiceProvider;
|
|
6
6
|
declare function createDuplicateManyController<Entity extends BaseEntity>(entity: Type<Entity>, path: string, apiTag?: string, version?: string, description?: string, DTOs?: DTOsBundle, validationPipeOptions?: ValidationPipeOptions): DuplicateManyControllerConstructor<Entity>;
|
|
7
7
|
export { createDuplicateManyController, createDuplicateManyServiceProvider };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DynamicModule, Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { ControllerOptions,
|
|
2
|
+
import { ControllerOptions, DynamicAPIRouteConfig } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
export declare class DuplicateManyModule {
|
|
5
|
-
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }:
|
|
5
|
+
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }: DynamicAPIRouteConfig<Entity>, version?: string, validationPipeOptions?: ValidationPipeOptions): DynamicModule;
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { DTOsBundle,
|
|
2
|
+
import { DTOsBundle, DynamicAPIServiceProvider } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
import { DuplicateOneControllerConstructor } from './duplicate-one-controller.interface';
|
|
5
|
-
declare function createDuplicateOneServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined):
|
|
5
|
+
declare function createDuplicateOneServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined): DynamicAPIServiceProvider;
|
|
6
6
|
declare function createDuplicateOneController<Entity extends BaseEntity>(entity: Type<Entity>, path: string, apiTag?: string, version?: string, description?: string, DTOs?: DTOsBundle, validationPipeOptions?: ValidationPipeOptions): DuplicateOneControllerConstructor<Entity>;
|
|
7
7
|
export { createDuplicateOneController, createDuplicateOneServiceProvider };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DynamicModule, Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { ControllerOptions,
|
|
2
|
+
import { ControllerOptions, DynamicAPIRouteConfig } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
export declare class DuplicateOneModule {
|
|
5
|
-
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }:
|
|
5
|
+
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }: DynamicAPIRouteConfig<Entity>, version?: string, validationPipeOptions?: ValidationPipeOptions): DynamicModule;
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { DTOsBundle,
|
|
2
|
+
import { DTOsBundle, DynamicAPIServiceProvider } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
import { GetManyControllerConstructor } from './get-many-controller.interface';
|
|
5
|
-
declare function createGetManyServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined):
|
|
5
|
+
declare function createGetManyServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined): DynamicAPIServiceProvider;
|
|
6
6
|
declare function createGetManyController<Entity extends BaseEntity>(entity: Type<Entity>, path: string, apiTag?: string, version?: string, description?: string, DTOs?: DTOsBundle, validationPipeOptions?: ValidationPipeOptions): GetManyControllerConstructor<Entity>;
|
|
7
7
|
export { createGetManyController, createGetManyServiceProvider };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DynamicModule, Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { ControllerOptions,
|
|
2
|
+
import { ControllerOptions, DynamicAPIRouteConfig } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
export declare class GetManyModule {
|
|
5
|
-
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }:
|
|
5
|
+
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }: DynamicAPIRouteConfig<Entity>, version?: string, validationPipeOptions?: ValidationPipeOptions): DynamicModule;
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { DTOsBundle,
|
|
2
|
+
import { DTOsBundle, DynamicAPIServiceProvider } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
import { GetOneControllerConstructor } from './get-one-controller.interface';
|
|
5
|
-
declare function createGetOneServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined):
|
|
5
|
+
declare function createGetOneServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined): DynamicAPIServiceProvider;
|
|
6
6
|
declare function createGetOneController<Entity extends BaseEntity>(entity: Type<Entity>, path: string, apiTag?: string, version?: string, description?: string, DTOs?: DTOsBundle, validationPipeOptions?: ValidationPipeOptions): GetOneControllerConstructor<Entity>;
|
|
7
7
|
export { createGetOneController, createGetOneServiceProvider };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DynamicModule, Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { ControllerOptions,
|
|
2
|
+
import { ControllerOptions, DynamicAPIRouteConfig } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
export declare class GetOneModule {
|
|
5
|
-
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }:
|
|
5
|
+
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }: DynamicAPIRouteConfig<Entity>, version?: string, validationPipeOptions?: ValidationPipeOptions): DynamicModule;
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { DTOsBundle,
|
|
2
|
+
import { DTOsBundle, DynamicAPIServiceProvider } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
import { ReplaceOneControllerConstructor } from './replace-one-controller.interface';
|
|
5
|
-
declare function createReplaceOneServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined):
|
|
5
|
+
declare function createReplaceOneServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined): DynamicAPIServiceProvider;
|
|
6
6
|
declare function createReplaceOneController<Entity extends BaseEntity>(entity: Type<Entity>, path: string, apiTag?: string, version?: string, description?: string, DTOs?: DTOsBundle, validationPipeOptions?: ValidationPipeOptions): ReplaceOneControllerConstructor<Entity>;
|
|
7
7
|
export { createReplaceOneController, createReplaceOneServiceProvider };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DynamicModule, Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { ControllerOptions,
|
|
2
|
+
import { ControllerOptions, DynamicAPIRouteConfig } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
export declare class ReplaceOneModule {
|
|
5
|
-
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }:
|
|
5
|
+
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }: DynamicAPIRouteConfig<Entity>, version?: string, validationPipeOptions?: ValidationPipeOptions): DynamicModule;
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { DTOsBundle,
|
|
2
|
+
import { DTOsBundle, DynamicAPIServiceProvider } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
import { UpdateManyControllerConstructor } from './update-many-controller.interface';
|
|
5
|
-
declare function createUpdateManyServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined):
|
|
5
|
+
declare function createUpdateManyServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined): DynamicAPIServiceProvider;
|
|
6
6
|
declare function createUpdateManyController<Entity extends BaseEntity>(entity: Type<Entity>, path: string, apiTag?: string, version?: string, description?: string, DTOs?: DTOsBundle, validationPipeOptions?: ValidationPipeOptions): UpdateManyControllerConstructor<Entity>;
|
|
7
7
|
export { createUpdateManyController, createUpdateManyServiceProvider };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DynamicModule, Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { ControllerOptions,
|
|
2
|
+
import { ControllerOptions, DynamicAPIRouteConfig } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
export declare class UpdateManyModule {
|
|
5
|
-
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }:
|
|
5
|
+
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }: DynamicAPIRouteConfig<Entity>, version?: string, validationPipeOptions?: ValidationPipeOptions): DynamicModule;
|
|
6
6
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { DTOsBundle,
|
|
2
|
+
import { DTOsBundle, DynamicAPIServiceProvider } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
import { UpdateOneControllerConstructor } from './update-one-controller.interface';
|
|
5
|
-
declare function createUpdateOneServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined):
|
|
5
|
+
declare function createUpdateOneServiceProvider<Entity extends BaseEntity>(entity: Type<Entity>, version: string | undefined): DynamicAPIServiceProvider;
|
|
6
6
|
declare function createUpdateOneController<Entity extends BaseEntity>(entity: Type<Entity>, path: string, apiTag?: string, version?: string, description?: string, DTOs?: DTOsBundle, validationPipeOptions?: ValidationPipeOptions): UpdateOneControllerConstructor<Entity>;
|
|
7
7
|
export { createUpdateOneController, createUpdateOneServiceProvider };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DynamicModule, Type, ValidationPipeOptions } from '@nestjs/common';
|
|
2
|
-
import { ControllerOptions,
|
|
2
|
+
import { ControllerOptions, DynamicAPIRouteConfig } from '../../interfaces';
|
|
3
3
|
import { BaseEntity } from '../../models';
|
|
4
4
|
export declare class UpdateOneModule {
|
|
5
|
-
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }:
|
|
5
|
+
static forFeature<Entity extends BaseEntity>(databaseModule: DynamicModule, entity: Type<Entity>, { path, apiTag }: ControllerOptions, { description, dTOs: DTOs }: DynamicAPIRouteConfig<Entity>, version?: string, validationPipeOptions?: ValidationPipeOptions): DynamicModule;
|
|
6
6
|
}
|
package/src/version.json
CHANGED