@tc-libs/api-key 0.35.0 → 0.37.0
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/package.json +12 -12
- package/src/api-key.module.d.ts +3 -1
- package/src/api-key.module.js +23 -1
- package/src/api-key.module.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tc-libs/api-key",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"tslib": "^2.3.0",
|
|
6
6
|
"@nestjs/common": "^10.0.2",
|
|
7
7
|
"@faker-js/faker": "^8.0.2",
|
|
8
|
-
"@tc-libs/pagination": "0.
|
|
9
|
-
"@tc-libs/authentication": "0.
|
|
10
|
-
"@tc-libs/errors": "0.
|
|
11
|
-
"@tc-libs/request": "0.
|
|
12
|
-
"@tc-libs/response": "0.
|
|
8
|
+
"@tc-libs/pagination": "0.37.0",
|
|
9
|
+
"@tc-libs/authentication": "0.37.0",
|
|
10
|
+
"@tc-libs/errors": "0.37.0",
|
|
11
|
+
"@tc-libs/request": "0.37.0",
|
|
12
|
+
"@tc-libs/response": "0.37.0",
|
|
13
13
|
"@nestjs/swagger": "^7.1.10",
|
|
14
|
-
"@tc-libs/doc": "0.
|
|
14
|
+
"@tc-libs/doc": "0.37.0",
|
|
15
15
|
"class-validator": "^0.14.0",
|
|
16
16
|
"class-transformer": "^0.5.1",
|
|
17
17
|
"@nestjs/core": "^10.0.2",
|
|
18
|
-
"@tc-libs/helper": "0.
|
|
18
|
+
"@tc-libs/helper": "0.37.0",
|
|
19
19
|
"@nestjs/passport": "^10.0.1",
|
|
20
20
|
"passport-headerapikey": "^1.2.2",
|
|
21
|
-
"@tc-libs/user": "0.
|
|
21
|
+
"@tc-libs/user": "0.37.0",
|
|
22
22
|
"@nestjs/mongoose": "^10.0.1",
|
|
23
|
-
"@tc-libs/database": "0.
|
|
23
|
+
"@tc-libs/database": "0.37.0",
|
|
24
24
|
"mongoose": "^7.5.0",
|
|
25
|
-
"@tc-libs/app-cache": "0.
|
|
26
|
-
"@tc-libs/service": "0.
|
|
25
|
+
"@tc-libs/app-cache": "0.37.0",
|
|
26
|
+
"@tc-libs/service": "0.37.0"
|
|
27
27
|
},
|
|
28
28
|
"type": "commonjs",
|
|
29
29
|
"main": "./src/index.js",
|
package/src/api-key.module.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { DynamicModule, Provider } from '@nestjs/common';
|
|
2
|
+
import ApiKeyModuleAsyncOptions, { ApiKeyModuleOptions } from './api-key.module.options';
|
|
2
3
|
export declare class ApiKeyModule {
|
|
3
|
-
static
|
|
4
|
+
static register(userServiceProvider: Provider, options: ApiKeyModuleOptions, isGlobal: boolean): DynamicModule;
|
|
5
|
+
static registerAsync(userServiceProvider: Provider, options: ApiKeyModuleAsyncOptions, isGlobal: boolean): DynamicModule;
|
|
4
6
|
}
|
package/src/api-key.module.js
CHANGED
|
@@ -8,12 +8,34 @@ const guards_1 = require("./guards");
|
|
|
8
8
|
const repository_1 = require("./repository");
|
|
9
9
|
const services_1 = require("./services");
|
|
10
10
|
const api_key_put_to_request_by_user_guard_1 = require("./guards/api-key.put-to-request-by-user.guard");
|
|
11
|
+
const api_key_module_options_1 = require("./api-key.module.options");
|
|
11
12
|
let ApiKeyModule = ApiKeyModule_1 = class ApiKeyModule {
|
|
12
|
-
static
|
|
13
|
+
static register(userServiceProvider, options, isGlobal) {
|
|
13
14
|
return {
|
|
14
15
|
module: ApiKeyModule_1,
|
|
15
16
|
imports: [repository_1.ApiKeyRepositoryModule],
|
|
16
17
|
providers: [
|
|
18
|
+
{ provide: api_key_module_options_1.API_KEY_CONFIG_OPTIONS, useValue: options },
|
|
19
|
+
services_1.ApiKeyService,
|
|
20
|
+
guards_1.ApiKeyXApiKeyStrategy,
|
|
21
|
+
api_key_put_to_request_by_user_guard_1.ApiKeyPutToRequestByUserGuard,
|
|
22
|
+
guards_1.ApiKeyNotFoundGuard,
|
|
23
|
+
userServiceProvider,
|
|
24
|
+
],
|
|
25
|
+
exports: [services_1.ApiKeyService, api_key_put_to_request_by_user_guard_1.ApiKeyPutToRequestByUserGuard],
|
|
26
|
+
global: isGlobal,
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
static registerAsync(userServiceProvider, options, isGlobal) {
|
|
30
|
+
return {
|
|
31
|
+
module: ApiKeyModule_1,
|
|
32
|
+
imports: [repository_1.ApiKeyRepositoryModule],
|
|
33
|
+
providers: [
|
|
34
|
+
{
|
|
35
|
+
provide: api_key_module_options_1.API_KEY_CONFIG_OPTIONS,
|
|
36
|
+
useFactory: options.useFactory,
|
|
37
|
+
inject: options.inject || [],
|
|
38
|
+
},
|
|
17
39
|
services_1.ApiKeyService,
|
|
18
40
|
guards_1.ApiKeyXApiKeyStrategy,
|
|
19
41
|
api_key_put_to_request_by_user_guard_1.ApiKeyPutToRequestByUserGuard,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-key.module.js","sourceRoot":"","sources":["../../../../packages/api-key/src/api-key.module.ts"],"names":[],"mappings":";;;;;AAAA,2CAAiE;AACjE,qCAAsE;AACtE,6CAAsD;AACtD,yCAA2C;AAC3C,wGAA8F;
|
|
1
|
+
{"version":3,"file":"api-key.module.js","sourceRoot":"","sources":["../../../../packages/api-key/src/api-key.module.ts"],"names":[],"mappings":";;;;;AAAA,2CAAiE;AACjE,qCAAsE;AACtE,6CAAsD;AACtD,yCAA2C;AAC3C,wGAA8F;AAC9F,qEAGkC;AAE3B,IAAM,YAAY,oBAAlB,MAAM,YAAY;IACvB,MAAM,CAAC,QAAQ,CACb,mBAA6B,EAC7B,OAA4B,EAC5B,QAAiB;QAEjB,OAAO;YACL,MAAM,EAAE,cAAY;YACpB,OAAO,EAAE,CAAC,mCAAsB,CAAC;YACjC,SAAS,EAAE;gBACT,EAAE,OAAO,EAAE,+CAAsB,EAAE,QAAQ,EAAE,OAAO,EAAE;gBACtD,wBAAa;gBACb,8BAAqB;gBACrB,oEAA6B;gBAC7B,4BAAmB;gBACnB,mBAAmB;aACpB;YACD,OAAO,EAAE,CAAC,wBAAa,EAAE,oEAA6B,CAAC;YACvD,MAAM,EAAE,QAAQ;SACjB,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,aAAa,CAClB,mBAA6B,EAC7B,OAAiC,EACjC,QAAiB;QAEjB,OAAO;YACL,MAAM,EAAE,cAAY;YACpB,OAAO,EAAE,CAAC,mCAAsB,CAAC;YACjC,SAAS,EAAE;gBACT;oBACE,OAAO,EAAE,+CAAsB;oBAC/B,UAAU,EAAE,OAAO,CAAC,UAAU;oBAC9B,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,EAAE;iBAC7B;gBACD,wBAAa;gBACb,8BAAqB;gBACrB,oEAA6B;gBAC7B,4BAAmB;gBACnB,mBAAmB;aACpB;YACD,OAAO,EAAE,CAAC,wBAAa,EAAE,oEAA6B,CAAC;YACvD,MAAM,EAAE,QAAQ;SACjB,CAAC;IACJ,CAAC;CACF,CAAA;AA9CY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,eAAM,EAAC,EAAE,CAAC;GACE,YAAY,CA8CxB"}
|