@seidor-cloud-produtos/orbit-backend-lib 2.0.76 → 2.0.78

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.
@@ -1,3 +1,4 @@
1
+ import { UserRequestDTO } from '../../domain/entities/common-dto';
1
2
  type HeadersProps = {
2
3
  username?: string;
3
4
  useremail?: string;
@@ -12,4 +13,9 @@ export type AuthorizerHeaders = {
12
13
  entityId: string;
13
14
  };
14
15
  export declare function handleAuthorizerHeaders(headers: HeadersProps): AuthorizerHeaders;
16
+ /**
17
+ *
18
+ * @deprecated E-mail and name not must be recorded as tracing.
19
+ */
20
+ export declare function authorizerToLegacyDefaultHeaders(authorizerHeaders: AuthorizerHeaders): UserRequestDTO;
15
21
  export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.handleAuthorizerHeaders = void 0;
3
+ exports.authorizerToLegacyDefaultHeaders = exports.handleAuthorizerHeaders = void 0;
4
4
  function handleAuthorizerHeaders(headers) {
5
5
  return {
6
6
  userName: headers.username,
@@ -10,3 +10,18 @@ function handleAuthorizerHeaders(headers) {
10
10
  };
11
11
  }
12
12
  exports.handleAuthorizerHeaders = handleAuthorizerHeaders;
13
+ /**
14
+ *
15
+ * @deprecated E-mail and name not must be recorded as tracing.
16
+ */
17
+ function authorizerToLegacyDefaultHeaders(authorizerHeaders) {
18
+ const email = authorizerHeaders.userEmail;
19
+ const name = authorizerHeaders.appName || authorizerHeaders.userName;
20
+ return {
21
+ createdByEmail: email,
22
+ createdByName: name,
23
+ updatedByEmail: email,
24
+ updatedByName: name,
25
+ };
26
+ }
27
+ exports.authorizerToLegacyDefaultHeaders = authorizerToLegacyDefaultHeaders;
@@ -2,13 +2,13 @@ type HeadersProps = {
2
2
  username: string;
3
3
  useremail: string;
4
4
  userid: string;
5
- ['app-id']: string;
5
+ ['app-id']?: string;
6
6
  };
7
7
  export declare function handleUserHeaders(headers: HeadersProps): {
8
8
  createdByName: string;
9
9
  createdByEmail: string;
10
10
  updatedByEmail: string;
11
11
  updatedByName: string;
12
- entityId: string;
12
+ entityId: string | undefined;
13
13
  };
14
14
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seidor-cloud-produtos/orbit-backend-lib",
3
- "version": "2.0.76",
3
+ "version": "2.0.78",
4
4
  "description": "Internal lib for backend components",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",