@brightchain/brightchain-api-lib 0.27.1 → 0.29.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 +5 -5
- package/src/index.d.ts +0 -1
- package/src/index.d.ts.map +1 -1
- package/src/index.js +0 -1
- package/src/index.js.map +1 -1
- package/src/lib/application.d.ts +0 -5
- package/src/lib/application.d.ts.map +1 -1
- package/src/lib/application.js +0 -6
- package/src/lib/application.js.map +1 -1
- package/src/lib/controllers/api/brightpass.d.ts +2 -0
- package/src/lib/controllers/api/brightpass.d.ts.map +1 -1
- package/src/lib/controllers/api/brightpass.js +51 -1
- package/src/lib/controllers/api/brightpass.js.map +1 -1
- package/src/lib/controllers/api/quorum.d.ts.map +1 -1
- package/src/lib/controllers/api/quorum.js +7 -3
- package/src/lib/controllers/api/quorum.js.map +1 -1
- package/src/lib/controllers/api/user.d.ts +17 -31
- package/src/lib/controllers/api/user.d.ts.map +1 -1
- package/src/lib/controllers/api/user.js +58 -697
- package/src/lib/controllers/api/user.js.map +1 -1
- package/src/lib/enumerations/schema-collection.d.ts +1 -29
- package/src/lib/enumerations/schema-collection.d.ts.map +1 -1
- package/src/lib/enumerations/schema-collection.js +2 -30
- package/src/lib/enumerations/schema-collection.js.map +1 -1
- package/src/lib/interfaces/auth-credentials.d.ts +1 -5
- package/src/lib/interfaces/auth-credentials.d.ts.map +1 -1
- package/src/lib/interfaces/auth-token.d.ts +1 -5
- package/src/lib/interfaces/auth-token.d.ts.map +1 -1
- package/src/lib/interfaces/brightchain-init-result.d.ts +6 -11
- package/src/lib/interfaces/brightchain-init-result.d.ts.map +1 -1
- package/src/lib/interfaces/brightchain-init-result.js +0 -6
- package/src/lib/interfaces/brightchain-init-result.js.map +1 -1
- package/src/lib/interfaces/responses/api-backup-codes-response.d.ts +1 -3
- package/src/lib/interfaces/responses/api-backup-codes-response.d.ts.map +1 -1
- package/src/lib/interfaces/responses/api-code-count-response.d.ts +1 -3
- package/src/lib/interfaces/responses/api-code-count-response.d.ts.map +1 -1
- package/src/lib/interfaces/responses/api-login-response.d.ts +1 -3
- package/src/lib/interfaces/responses/api-login-response.d.ts.map +1 -1
- package/src/lib/interfaces/responses/api-password-change-response.d.ts +1 -3
- package/src/lib/interfaces/responses/api-password-change-response.d.ts.map +1 -1
- package/src/lib/interfaces/responses/api-recovery-response.d.ts +1 -3
- package/src/lib/interfaces/responses/api-recovery-response.d.ts.map +1 -1
- package/src/lib/interfaces/responses/api-request-user-response.d.ts +1 -3
- package/src/lib/interfaces/responses/api-request-user-response.d.ts.map +1 -1
- package/src/lib/interfaces/token-payload.d.ts +1 -8
- package/src/lib/interfaces/token-payload.d.ts.map +1 -1
- package/src/lib/interfaces/userApiResponse.d.ts +1 -16
- package/src/lib/interfaces/userApiResponse.d.ts.map +1 -1
- package/src/lib/middlewares.d.ts.map +1 -1
- package/src/lib/middlewares.js +1 -0
- package/src/lib/middlewares.js.map +1 -1
- package/src/lib/routers/api.d.ts +18 -6
- package/src/lib/routers/api.d.ts.map +1 -1
- package/src/lib/routers/api.js +20 -12
- package/src/lib/routers/api.js.map +1 -1
- package/src/lib/routers/app.d.ts +16 -32
- package/src/lib/routers/app.d.ts.map +1 -1
- package/src/lib/routers/app.js +23 -120
- package/src/lib/routers/app.js.map +1 -1
- package/src/lib/secureEnclaveKeyring.js +2 -2
- package/src/lib/secureEnclaveKeyring.js.map +1 -1
- package/src/lib/services/auth.d.ts +15 -20
- package/src/lib/services/auth.d.ts.map +1 -1
- package/src/lib/services/auth.js +45 -211
- package/src/lib/services/auth.js.map +1 -1
- package/src/lib/services/brighthub/feedService.d.ts.map +1 -1
- package/src/lib/services/brighthub/feedService.js +1 -0
- package/src/lib/services/brighthub/feedService.js.map +1 -1
- package/src/lib/services/brighthub/messagingService.test-helpers.js +3 -36
- package/src/lib/services/brighthub/messagingService.test-helpers.js.map +1 -1
- package/src/lib/services/brighthub/notificationService.test-helpers.js +3 -36
- package/src/lib/services/brighthub/notificationService.test-helpers.js.map +1 -1
- package/src/lib/services/brighthub/postService.d.ts.map +1 -1
- package/src/lib/services/brighthub/postService.js +4 -0
- package/src/lib/services/brighthub/postService.js.map +1 -1
- package/src/lib/services/brighthub/threadService.d.ts.map +1 -1
- package/src/lib/services/brighthub/threadService.js +2 -0
- package/src/lib/services/brighthub/threadService.js.map +1 -1
- package/src/lib/services/brightpass.d.ts +18 -2
- package/src/lib/services/brightpass.d.ts.map +1 -1
- package/src/lib/services/brightpass.js +31 -5
- package/src/lib/services/brightpass.js.map +1 -1
- package/src/lib/services/emailGateway/emailGatewayService.d.ts.map +1 -1
- package/src/lib/services/emailGateway/emailGatewayService.js +2 -1
- package/src/lib/services/emailGateway/emailGatewayService.js.map +1 -1
- package/src/lib/services/index.d.ts +1 -0
- package/src/lib/services/index.d.ts.map +1 -1
- package/src/lib/services/index.js +1 -0
- package/src/lib/services/index.js.map +1 -1
- package/src/lib/services/mnemonic-hmac.service.d.ts +35 -0
- package/src/lib/services/mnemonic-hmac.service.d.ts.map +1 -0
- package/src/lib/services/mnemonic-hmac.service.js +47 -0
- package/src/lib/services/mnemonic-hmac.service.js.map +1 -0
- package/src/lib/services/role.d.ts +11 -11
- package/src/lib/services/role.d.ts.map +1 -1
- package/src/lib/services/role.js +17 -5
- package/src/lib/services/role.js.map +1 -1
- package/src/lib/stores/diskBlockStore.js +1 -34
- package/src/lib/stores/diskBlockStore.js.map +1 -1
- package/src/lib/systemKeyring.js +2 -35
- package/src/lib/systemKeyring.js.map +1 -1
- package/src/lib/utils/type-converters.d.ts +0 -7
- package/src/lib/utils/type-converters.d.ts.map +0 -1
- package/src/lib/utils/type-converters.js +0 -42
- package/src/lib/utils/type-converters.js.map +0 -1
|
@@ -1,42 +1,28 @@
|
|
|
1
|
-
import { CoreLanguageCode } from '@digitaldefiance/i18n-lib';
|
|
2
1
|
import { PlatformID } from '@digitaldefiance/node-ecies-lib';
|
|
3
|
-
import { ApiErrorResponse,
|
|
2
|
+
import { ApiErrorResponse, IApiMessageResponse, IStatusCodeResponse } from '@digitaldefiance/node-express-suite';
|
|
3
|
+
import { BrightDbUserController, IApiLoginResponse } from '@brightchain/node-express-suite';
|
|
4
4
|
import type { NextFunction, Request, Response } from 'express';
|
|
5
5
|
import { IBrightChainApplication } from '../../interfaces/application';
|
|
6
|
-
import { IApiLoginResponse, IApiRequestUserResponse } from '../../interfaces/responses';
|
|
7
6
|
import { DefaultBackendIdType } from '../../shared-types';
|
|
8
|
-
|
|
7
|
+
/**
|
|
8
|
+
* BrightChain domain-specific UserController.
|
|
9
|
+
*
|
|
10
|
+
* Extends BrightDbUserController with:
|
|
11
|
+
* - BrightHub social profile creation on registration
|
|
12
|
+
* - Backup code routes (generate, regenerate, get count, recover-with-backup)
|
|
13
|
+
* - Direct challenge verification route (ECIES signature-based login)
|
|
14
|
+
*/
|
|
15
|
+
export declare class UserController<TID extends PlatformID = DefaultBackendIdType> extends BrightDbUserController<TID> {
|
|
9
16
|
constructor(application: IBrightChainApplication<TID>);
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Hook called after successful registration.
|
|
19
|
+
* Creates a BrightHub social profile for the new user.
|
|
20
|
+
*/
|
|
21
|
+
protected onPostRegister(memberId: string, username: string): Promise<void>;
|
|
22
|
+
directChallenge(req: Request, _res: Response, _next: NextFunction): Promise<IStatusCodeResponse<IApiLoginResponse | ApiErrorResponse>>;
|
|
15
23
|
generateBackupCodes(req: Request, _res: Response, _next: NextFunction): Promise<IStatusCodeResponse<IApiMessageResponse | ApiErrorResponse>>;
|
|
16
24
|
regenerateBackupCodes(req: Request, _res: Response, _next: NextFunction): Promise<IStatusCodeResponse<IApiMessageResponse | ApiErrorResponse>>;
|
|
17
25
|
getBackupCodeCount(req: Request, _res: Response, _next: NextFunction): Promise<IStatusCodeResponse<IApiMessageResponse | ApiErrorResponse>>;
|
|
18
26
|
recoverWithBackupCode(req: Request, _res: Response, _next: NextFunction): Promise<IStatusCodeResponse<IApiMessageResponse | ApiErrorResponse>>;
|
|
19
|
-
recover(req: Request, _res: Response, _next: NextFunction): Promise<IStatusCodeResponse<IApiMessageResponse | ApiErrorResponse>>;
|
|
20
|
-
logout(req: Request, _res: Response, _next: NextFunction): Promise<IStatusCodeResponse<IApiMessageResponse | ApiErrorResponse>>;
|
|
21
|
-
requestDirectLogin(_req: Request, _res: Response, _next: NextFunction): Promise<IStatusCodeResponse<IApiChallengeResponse | ApiErrorResponse>>;
|
|
22
|
-
directChallenge(req: Request, _res: Response, _next: NextFunction): Promise<IStatusCodeResponse<IApiLoginResponse | ApiErrorResponse>>;
|
|
23
|
-
/**
|
|
24
|
-
* GET /verify — returns the authenticated user's DTO.
|
|
25
|
-
* The auth middleware already populates req.user with a full IRequestUserDTO
|
|
26
|
-
* via buildRequestUserDTO, so we just return it.
|
|
27
|
-
*/
|
|
28
|
-
verify(req: Request, _res: Response, _next: NextFunction): Promise<IStatusCodeResponse<IApiRequestUserResponse | ApiErrorResponse>>;
|
|
29
|
-
/**
|
|
30
|
-
* GET /settings — returns the authenticated user's settings.
|
|
31
|
-
*/
|
|
32
|
-
getSettings(req: Request, _res: Response, _next: NextFunction): Promise<IStatusCodeResponse<IApiMessageResponse | ApiErrorResponse>>;
|
|
33
|
-
/**
|
|
34
|
-
* POST /settings — updates the authenticated user's settings.
|
|
35
|
-
*/
|
|
36
|
-
updateSettings(req: Request, _res: Response, _next: NextFunction): Promise<IStatusCodeResponse<IApiRequestUserResponse | ApiErrorResponse>>;
|
|
37
|
-
/**
|
|
38
|
-
* GET /refresh-token — re-signs the JWT and returns a new token + user DTO.
|
|
39
|
-
*/
|
|
40
|
-
refreshToken(req: Request, _res: Response, _next: NextFunction): Promise<IStatusCodeResponse<IApiLoginResponse | ApiErrorResponse>>;
|
|
41
27
|
}
|
|
42
28
|
//# sourceMappingURL=user.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../../../brightchain-api-lib/src/lib/controllers/api/user.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"user.d.ts","sourceRoot":"","sources":["../../../../../../brightchain-api-lib/src/lib/controllers/api/user.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAC7D,OAAO,EACL,gBAAgB,EAGhB,mBAAmB,EACnB,mBAAmB,EAGpB,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EACL,sBAAsB,EAGtB,iBAAiB,EAClB,MAAM,iCAAiC,CAAC;AAOzC,OAAO,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAKvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAoB1D;;;;;;;GAOG;AACH,qBACa,cAAc,CACzB,GAAG,SAAS,UAAU,GAAG,oBAAoB,CAC7C,SAAQ,sBAAsB,CAAC,GAAG,CAAC;gBACvB,WAAW,EAAE,uBAAuB,CAAC,GAAG,CAAC;IAKrD;;;OAGG;cACsB,cAAc,CACrC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,IAAI,CAAC;IAkBV,eAAe,CACnB,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,mBAAmB,CAAC,iBAAiB,GAAG,gBAAgB,CAAC,CAAC;IA+E/D,mBAAmB,CACvB,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,mBAAmB,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAAC;IAmDjE,qBAAqB,CACzB,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,mBAAmB,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAAC;IAmDjE,kBAAkB,CACtB,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,mBAAmB,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAAC;IAmDjE,qBAAqB,CACzB,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,QAAQ,EACd,KAAK,EAAE,YAAY,GAClB,OAAO,CAAC,mBAAmB,CAAC,mBAAmB,GAAG,gBAAgB,CAAC,CAAC;CAmFxE"}
|