@develit-io/backend-sdk 8.6.1 → 8.6.3

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/index.d.mts CHANGED
@@ -453,9 +453,9 @@ interface IdempotencyVariables {
453
453
  key: string;
454
454
  };
455
455
  }
456
- interface UserVariables<T> {
456
+ interface UserVariables {
457
457
  user: AuthUser;
458
- jwt: T;
458
+ jwt: unknown;
459
459
  }
460
460
 
461
461
  declare const paginationQuerySchema: z.$ZodObject<Readonly<Readonly<{
package/dist/index.d.ts CHANGED
@@ -453,9 +453,9 @@ interface IdempotencyVariables {
453
453
  key: string;
454
454
  };
455
455
  }
456
- interface UserVariables<T> {
456
+ interface UserVariables {
457
457
  user: AuthUser;
458
- jwt: T;
458
+ jwt: unknown;
459
459
  }
460
460
 
461
461
  declare const paginationQuerySchema: z.$ZodObject<Readonly<Readonly<{
package/dist/index.mjs CHANGED
@@ -280,7 +280,7 @@ const RPCResponse = {
280
280
  console.error(error.message);
281
281
  return {
282
282
  status: error.status,
283
- message: error.message,
283
+ message: error.code,
284
284
  data: null,
285
285
  error: true
286
286
  };
@@ -1,15 +1,13 @@
1
1
  import { MiddlewareHandler } from 'hono/types';
2
2
 
3
- declare const idempotency: <T extends {
4
- IDEMPOTENCY_KV: KVNamespace;
5
- }>() => MiddlewareHandler;
3
+ declare const idempotency: () => MiddlewareHandler;
6
4
 
7
- declare const jwt: <TAuthService, TJwtPayload>() => MiddlewareHandler;
5
+ declare const jwt: () => MiddlewareHandler;
8
6
 
9
- declare const ip: <TOrganizationService, TJwtPayload>() => MiddlewareHandler;
7
+ declare const ip: () => MiddlewareHandler;
10
8
 
11
9
  declare const logger: () => MiddlewareHandler;
12
10
 
13
- declare const signature: <TOrganizationService, TJwtPayload>() => MiddlewareHandler;
11
+ declare const signature: () => MiddlewareHandler;
14
12
 
15
13
  export { idempotency, ip, jwt, logger, signature };
@@ -1,15 +1,13 @@
1
1
  import { MiddlewareHandler } from 'hono/types';
2
2
 
3
- declare const idempotency: <T extends {
4
- IDEMPOTENCY_KV: KVNamespace;
5
- }>() => MiddlewareHandler;
3
+ declare const idempotency: () => MiddlewareHandler;
6
4
 
7
- declare const jwt: <TAuthService, TJwtPayload>() => MiddlewareHandler;
5
+ declare const jwt: () => MiddlewareHandler;
8
6
 
9
- declare const ip: <TOrganizationService, TJwtPayload>() => MiddlewareHandler;
7
+ declare const ip: () => MiddlewareHandler;
10
8
 
11
9
  declare const logger: () => MiddlewareHandler;
12
10
 
13
- declare const signature: <TOrganizationService, TJwtPayload>() => MiddlewareHandler;
11
+ declare const signature: () => MiddlewareHandler;
14
12
 
15
13
  export { idempotency, ip, jwt, logger, signature };
@@ -75,8 +75,7 @@ const jwt = () => {
75
75
  message: `The Bearer token in the 'Authorization' header value must be a JWT.`
76
76
  });
77
77
  }
78
- const authService = context.env.AUTH_SERVICE;
79
- const { data, error } = await authService.verifyAccessToken({
78
+ const { data, error } = await context.env.AUTH_SERVICE.verifyAccessToken({
80
79
  accessToken: bearerToken
81
80
  });
82
81
  if (!data || error) {
@@ -117,8 +116,7 @@ const ip = () => {
117
116
  message: "Failed to retrieve request organization ID."
118
117
  });
119
118
  }
120
- const organizationService = context.env.ORGANIZATION_SERVICE;
121
- const { data: organization, error } = await organizationService.getOrganization({
119
+ const { data: organization, error } = await context.env.ORGANIZATION_SERVICE.getOrganization({
122
120
  organizationId: user.organizationId
123
121
  });
124
122
  if (!organization || error) {
@@ -195,8 +193,7 @@ const signature = () => {
195
193
  message: "Failed to retrieve request organization ID."
196
194
  });
197
195
  }
198
- const organizationService = context.env.ORGANIZATION_SERVICE;
199
- const { data: organization, error } = await organizationService.getOrganization({
196
+ const { data: organization, error } = await context.env.ORGANIZATION_SERVICE.getOrganization({
200
197
  organizationId: user.organizationId
201
198
  });
202
199
  if (!organization || error) {
package/package.json CHANGED
@@ -1,20 +1,16 @@
1
1
  {
2
2
  "name": "@develit-io/backend-sdk",
3
- "version": "8.6.1",
3
+ "version": "8.6.3",
4
4
  "description": "Develit Backend SDK",
5
5
  "author": "Develit.io",
6
6
  "license": "ISC",
7
7
  "type": "module",
8
8
  "scripts": {
9
9
  "build": "unbuild",
10
- "changelogen": "bunx changelogen@latest --bump",
11
10
  "lint": "biome check",
12
11
  "lint:fix": "biome check --fix",
13
- "prepack": "unbuild",
14
- "release": "bun run build && bunx changelogen@latest --release --push && npm publish --access public",
15
12
  "test": "vitest",
16
- "test:unit": "vitest test/unit",
17
- "typecheck": "tsc"
13
+ "test:unit": "vitest test/unit"
18
14
  },
19
15
  "exports": {
20
16
  ".": {
@@ -33,7 +29,7 @@
33
29
  "dist"
34
30
  ],
35
31
  "dependencies": {
36
- "@cloudflare/workers-types": "4.20251004.0",
32
+ "@cloudflare/workers-types": "4.20251121.0",
37
33
  "comment-json": "^4.4.1",
38
34
  "drizzle-kit": "^0.31.6",
39
35
  "drizzle-orm": "^0.44.7",