@seidor-cloud-produtos/orbit-backend-lib 2.0.88 → 2.0.90
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/dist/clean-arch/infra/http/handle-authorizer-headers.d.ts +2 -0
- package/dist/clean-arch/infra/http/handle-authorizer-headers.js +2 -1
- package/dist/clean-arch/infra/validations/zod/schemas/common-validation.d.ts +10 -10
- package/dist/clean-arch/infra/validations/zod/schemas/common-validation.js +1 -1
- package/package.json +1 -1
|
@@ -6,6 +6,7 @@ type HeadersProps = {
|
|
|
6
6
|
['app-id']?: string;
|
|
7
7
|
['app-name']?: string;
|
|
8
8
|
tenantid: string;
|
|
9
|
+
['x-trace-id']: string;
|
|
9
10
|
};
|
|
10
11
|
export type AuthorizerHeaders = {
|
|
11
12
|
userName?: string;
|
|
@@ -13,6 +14,7 @@ export type AuthorizerHeaders = {
|
|
|
13
14
|
appName?: string;
|
|
14
15
|
tenantId: string;
|
|
15
16
|
entityId: string;
|
|
17
|
+
traceId?: string;
|
|
16
18
|
};
|
|
17
19
|
export declare function handleAuthorizerHeaders(headers: HeadersProps): AuthorizerHeaders;
|
|
18
20
|
/**
|
|
@@ -6,8 +6,9 @@ function handleAuthorizerHeaders(headers) {
|
|
|
6
6
|
userName: headers.username,
|
|
7
7
|
userEmail: headers.useremail,
|
|
8
8
|
appName: headers['app-name'],
|
|
9
|
-
entityId:
|
|
9
|
+
entityId: headers.userid || headers['app-id'] || headers.useremail,
|
|
10
10
|
tenantId: headers.tenantid,
|
|
11
|
+
traceId: headers['x-trace-id'],
|
|
11
12
|
};
|
|
12
13
|
}
|
|
13
14
|
exports.handleAuthorizerHeaders = handleAuthorizerHeaders;
|
|
@@ -46,19 +46,19 @@ export declare const tenantIdSchema: z.ZodObject<{
|
|
|
46
46
|
export declare const userSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
47
47
|
username: z.ZodString;
|
|
48
48
|
useremail: z.ZodString;
|
|
49
|
-
userid: z.ZodString
|
|
49
|
+
userid: z.ZodOptional<z.ZodString>;
|
|
50
50
|
}, {
|
|
51
51
|
tenantid: z.ZodString;
|
|
52
52
|
}>, "strip", z.ZodTypeAny, {
|
|
53
53
|
username: string;
|
|
54
54
|
tenantid: string;
|
|
55
55
|
useremail: string;
|
|
56
|
-
userid
|
|
56
|
+
userid?: string | undefined;
|
|
57
57
|
}, {
|
|
58
58
|
username: string;
|
|
59
59
|
tenantid: string;
|
|
60
60
|
useremail: string;
|
|
61
|
-
userid
|
|
61
|
+
userid?: string | undefined;
|
|
62
62
|
}>;
|
|
63
63
|
export declare const appSchema: z.ZodObject<z.objectUtil.extendShape<{
|
|
64
64
|
"app-name": z.ZodString;
|
|
@@ -86,8 +86,8 @@ export declare const integrationHeaders: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
86
86
|
}, {
|
|
87
87
|
"x-trace-id": z.ZodDefault<z.ZodString>;
|
|
88
88
|
}>, "strip", z.ZodTypeAny, {
|
|
89
|
-
tenantid: string;
|
|
90
89
|
"x-trace-id": string;
|
|
90
|
+
tenantid: string;
|
|
91
91
|
}, {
|
|
92
92
|
tenantid: string;
|
|
93
93
|
"x-trace-id"?: string | undefined;
|
|
@@ -95,19 +95,19 @@ export declare const integrationHeaders: z.ZodObject<z.objectUtil.extendShape<{
|
|
|
95
95
|
export declare const authorizerHeaders: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<{
|
|
96
96
|
username: z.ZodString;
|
|
97
97
|
useremail: z.ZodString;
|
|
98
|
-
userid: z.ZodString
|
|
98
|
+
userid: z.ZodOptional<z.ZodString>;
|
|
99
99
|
}, {
|
|
100
100
|
tenantid: z.ZodString;
|
|
101
101
|
}>, "strip", z.ZodTypeAny, {
|
|
102
102
|
username: string;
|
|
103
103
|
tenantid: string;
|
|
104
104
|
useremail: string;
|
|
105
|
-
userid
|
|
105
|
+
userid?: string | undefined;
|
|
106
106
|
}, {
|
|
107
107
|
username: string;
|
|
108
108
|
tenantid: string;
|
|
109
109
|
useremail: string;
|
|
110
|
-
userid
|
|
110
|
+
userid?: string | undefined;
|
|
111
111
|
}>, z.ZodObject<z.objectUtil.extendShape<{
|
|
112
112
|
"app-name": z.ZodString;
|
|
113
113
|
"app-id": z.ZodString;
|
|
@@ -125,7 +125,7 @@ export declare const authorizerHeaders: z.ZodUnion<[z.ZodObject<z.objectUtil.ext
|
|
|
125
125
|
export declare const authorizerHeadersWithFiscalIds: z.ZodUnion<[z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
126
126
|
username: z.ZodString;
|
|
127
127
|
useremail: z.ZodString;
|
|
128
|
-
userid: z.ZodString
|
|
128
|
+
userid: z.ZodOptional<z.ZodString>;
|
|
129
129
|
}, {
|
|
130
130
|
tenantid: z.ZodString;
|
|
131
131
|
}>, {
|
|
@@ -135,13 +135,13 @@ export declare const authorizerHeadersWithFiscalIds: z.ZodUnion<[z.ZodObject<z.o
|
|
|
135
135
|
username: string;
|
|
136
136
|
tenantid: string;
|
|
137
137
|
useremail: string;
|
|
138
|
-
userid
|
|
138
|
+
userid?: string | undefined;
|
|
139
139
|
}, {
|
|
140
140
|
fiscalidsfromtenant: string;
|
|
141
141
|
username: string;
|
|
142
142
|
tenantid: string;
|
|
143
143
|
useremail: string;
|
|
144
|
-
userid
|
|
144
|
+
userid?: string | undefined;
|
|
145
145
|
}>, z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
|
|
146
146
|
"app-name": z.ZodString;
|
|
147
147
|
"app-id": z.ZodString;
|
|
@@ -30,7 +30,7 @@ exports.userSchema = zod_1.z
|
|
|
30
30
|
.object({
|
|
31
31
|
username: zod_1.z.string(),
|
|
32
32
|
useremail: zod_1.z.string().email(),
|
|
33
|
-
userid: zod_1.z.string().uuid(),
|
|
33
|
+
userid: zod_1.z.string().uuid().optional(),
|
|
34
34
|
})
|
|
35
35
|
.merge(exports.tenantIdSchema);
|
|
36
36
|
exports.appSchema = zod_1.z
|