@develit-io/backend-sdk 9.4.3 → 9.5.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/dist/middlewares.d.mts +2 -1
- package/dist/middlewares.d.ts +2 -1
- package/dist/middlewares.mjs +4 -4
- package/package.json +1 -1
package/dist/middlewares.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MiddlewareHandler } from 'hono/types';
|
|
2
|
+
import { Context } from 'hono';
|
|
2
3
|
|
|
3
4
|
interface AccessMiddlewareOptions {
|
|
4
5
|
errorMessage?: string;
|
|
@@ -8,7 +9,7 @@ interface AccessRequest<TScope extends string = string> {
|
|
|
8
9
|
resourceId?: string;
|
|
9
10
|
resourcePath?: string;
|
|
10
11
|
}
|
|
11
|
-
type AccessRequestResolver<TScope extends string = string> = AccessRequest<TScope>[] | ((context:
|
|
12
|
+
type AccessRequestResolver<TScope extends string = string> = AccessRequest<TScope>[] | ((context: Context) => AccessRequest<TScope>[]);
|
|
12
13
|
declare const access: <TScope extends string = string>(accessRequests: AccessRequestResolver<TScope>, options?: AccessMiddlewareOptions) => MiddlewareHandler;
|
|
13
14
|
|
|
14
15
|
declare const idempotency: () => MiddlewareHandler;
|
package/dist/middlewares.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MiddlewareHandler } from 'hono/types';
|
|
2
|
+
import { Context } from 'hono';
|
|
2
3
|
|
|
3
4
|
interface AccessMiddlewareOptions {
|
|
4
5
|
errorMessage?: string;
|
|
@@ -8,7 +9,7 @@ interface AccessRequest<TScope extends string = string> {
|
|
|
8
9
|
resourceId?: string;
|
|
9
10
|
resourcePath?: string;
|
|
10
11
|
}
|
|
11
|
-
type AccessRequestResolver<TScope extends string = string> = AccessRequest<TScope>[] | ((context:
|
|
12
|
+
type AccessRequestResolver<TScope extends string = string> = AccessRequest<TScope>[] | ((context: Context) => AccessRequest<TScope>[]);
|
|
12
13
|
declare const access: <TScope extends string = string>(accessRequests: AccessRequestResolver<TScope>, options?: AccessMiddlewareOptions) => MiddlewareHandler;
|
|
13
14
|
|
|
14
15
|
declare const idempotency: () => MiddlewareHandler;
|
package/dist/middlewares.mjs
CHANGED
|
@@ -199,9 +199,9 @@ const logger = () => {
|
|
|
199
199
|
actor: {
|
|
200
200
|
email: identityContext?.user?.email || "NOT_AUTHORIZED",
|
|
201
201
|
...rawUserMetaData?.organizationId ? {
|
|
202
|
-
organizationId: rawUserMetaData
|
|
202
|
+
organizationId: rawUserMetaData?.organizationId || "NOT_AUTHORIZED"
|
|
203
203
|
} : rawUserMetaData?.exchangeOfficeId ? {
|
|
204
|
-
exchangeOfficeId: rawUserMetaData
|
|
204
|
+
exchangeOfficeId: rawUserMetaData?.exchangeOfficeId || "NOT_AUTHORIZED"
|
|
205
205
|
} : null
|
|
206
206
|
},
|
|
207
207
|
metadata: {
|
|
@@ -234,9 +234,9 @@ const logger = () => {
|
|
|
234
234
|
actor: {
|
|
235
235
|
email: identityContext?.user?.email || "NOT_AUTHORIZED",
|
|
236
236
|
...rawUserMetaData?.organizationId ? {
|
|
237
|
-
organizationId: rawUserMetaData
|
|
237
|
+
organizationId: rawUserMetaData?.organizationId || "NOT_AUTHORIZED"
|
|
238
238
|
} : rawUserMetaData?.exchangeOfficeId ? {
|
|
239
|
-
exchangeOfficeId: rawUserMetaData
|
|
239
|
+
exchangeOfficeId: rawUserMetaData?.exchangeOfficeId || "NOT_AUTHORIZED"
|
|
240
240
|
} : null
|
|
241
241
|
},
|
|
242
242
|
metadata: {
|