@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.
@@ -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: unknown) => AccessRequest<TScope>[]);
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;
@@ -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: unknown) => AccessRequest<TScope>[]);
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;
@@ -199,9 +199,9 @@ const logger = () => {
199
199
  actor: {
200
200
  email: identityContext?.user?.email || "NOT_AUTHORIZED",
201
201
  ...rawUserMetaData?.organizationId ? {
202
- organizationId: rawUserMetaData.organizationId || "NOT_AUTHORIZED"
202
+ organizationId: rawUserMetaData?.organizationId || "NOT_AUTHORIZED"
203
203
  } : rawUserMetaData?.exchangeOfficeId ? {
204
- exchangeOfficeId: rawUserMetaData.exchangeOfficeId || "NOT_AUTHORIZED"
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.organizationId || "NOT_AUTHORIZED"
237
+ organizationId: rawUserMetaData?.organizationId || "NOT_AUTHORIZED"
238
238
  } : rawUserMetaData?.exchangeOfficeId ? {
239
- exchangeOfficeId: rawUserMetaData.exchangeOfficeId || "NOT_AUTHORIZED"
239
+ exchangeOfficeId: rawUserMetaData?.exchangeOfficeId || "NOT_AUTHORIZED"
240
240
  } : null
241
241
  },
242
242
  metadata: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@develit-io/backend-sdk",
3
- "version": "9.4.3",
3
+ "version": "9.5.1",
4
4
  "description": "Develit Backend SDK",
5
5
  "author": "Develit.io",
6
6
  "license": "ISC",