@silkweave/fastify 1.3.0 → 1.3.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.
@@ -10,9 +10,9 @@
10
10
  CLI Target: es2022
11
11
  CLI Cleaning output folder
12
12
  ESM Build start
13
- ESM build/index.js 4.95 KB
14
- ESM build/index.js.map 8.98 KB
15
- ESM ⚡️ Build success in 9ms
13
+ ESM build/index.js 5.54 KB
14
+ ESM build/index.js.map 9.94 KB
15
+ ESM ⚡️ Build success in 12ms
16
16
  DTS Build start
17
- DTS ⚡️ Build success in 975ms
17
+ DTS ⚡️ Build success in 1144ms
18
18
  DTS build/index.d.ts 455.00 B
@@ -1,13 +1,9 @@
1
-
2
- 
3
- > @silkweave/fastify@1.3.0 check /Users/atomic/projects/ai/silkweave/packages/fastify
4
- > pnpm lint && pnpm typecheck
5
-
6
-
7
- > @silkweave/fastify@1.3.0 lint /Users/atomic/projects/ai/silkweave/packages/fastify
8
- > eslint
9
-
10
-
11
- > @silkweave/fastify@1.3.0 typecheck /Users/atomic/projects/ai/silkweave/packages/fastify
12
- > tsc --noEmit
13
-
1
+
2
+ > @silkweave/fastify@1.3.0 check /Users/atomic/projects/ai/silkweave/packages/fastify
3
+ > pnpm lint && pnpm typecheck
4
+
5
+
6
+ > @silkweave/fastify@1.3.0 lint /Users/atomic/projects/ai/silkweave/packages/fastify
7
+ > eslint
8
+
9
+  ELIFECYCLE  Command failed.
@@ -3,4 +3,3 @@
3
3
  > @silkweave/fastify@1.3.0 lint /Users/atomic/projects/ai/silkweave/packages/fastify
4
4
  > eslint
5
5
 
6
-  ELIFECYCLE  Command failed.
@@ -1,26 +1,26 @@
1
1
 
2
2
  
3
- > @silkweave/fastify@1.3.0 prepack /Users/atomic/projects/ai/mcphero/packages/fastify
3
+ > @silkweave/fastify@1.3.0 prepack /Users/atomic/projects/ai/silkweave/packages/fastify
4
4
  > pnpm clean && pnpm build
5
5
 
6
6
 
7
- > @silkweave/fastify@1.3.0 clean /Users/atomic/projects/ai/mcphero/packages/fastify
7
+ > @silkweave/fastify@1.3.0 clean /Users/atomic/projects/ai/silkweave/packages/fastify
8
8
  > rimraf build
9
9
 
10
10
 
11
- > @silkweave/fastify@1.3.0 build /Users/atomic/projects/ai/mcphero/packages/fastify
11
+ > @silkweave/fastify@1.3.0 build /Users/atomic/projects/ai/silkweave/packages/fastify
12
12
  > tsup
13
13
 
14
14
  CLI Building entry: src/index.ts
15
15
  CLI Using tsconfig: tsconfig.json
16
16
  CLI tsup v8.5.1
17
- CLI Using tsup config: /Users/atomic/projects/ai/mcphero/packages/fastify/tsup.config.ts
17
+ CLI Using tsup config: /Users/atomic/projects/ai/silkweave/packages/fastify/tsup.config.ts
18
18
  CLI Target: es2022
19
19
  CLI Cleaning output folder
20
20
  ESM Build start
21
- ESM build/index.js 4.95 KB
22
- ESM build/index.js.map 8.98 KB
23
- ESM ⚡️ Build success in 6ms
21
+ ESM build/index.js 5.54 KB
22
+ ESM build/index.js.map 9.94 KB
23
+ ESM ⚡️ Build success in 13ms
24
24
  DTS Build start
25
- DTS ⚡️ Build success in 782ms
25
+ DTS ⚡️ Build success in 984ms
26
26
  DTS build/index.d.ts 455.00 B
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @silkweave/fastify
2
2
 
3
- Fastify REST adapter for [Silkweave](https://github.com/atomicbi/silkweave) — expose your actions as a REST API with auto-generated OpenAPI/Swagger documentation.
3
+ Fastify REST adapter for [Silkweave](https://github.com/silkweave/silkweave) — expose your actions as a REST API with auto-generated OpenAPI/Swagger documentation.
4
4
 
5
5
  ## Install
6
6
 
@@ -56,5 +56,5 @@ fastify({
56
56
 
57
57
  ## See Also
58
58
 
59
- - [Silkweave README](https://github.com/atomicbi/silkweave) — Full documentation
59
+ - [Silkweave README](https://github.com/silkweave/silkweave) — Full documentation
60
60
  - [`@silkweave/core`](https://www.npmjs.com/package/@silkweave/core) — Core library
package/build/index.js CHANGED
@@ -1,7 +1,9 @@
1
1
  // src/adapter/fastify.ts
2
2
  import { generateProtectedResourceMetadata, validateToken } from "@silkweave/auth";
3
+ import { SilkweaveError } from "@silkweave/core";
3
4
  import { buildLogLevels } from "@silkweave/logger";
4
5
  import { fastify as fastifyInstance } from "fastify";
6
+ import z from "zod";
5
7
  var PINO_LEVEL_MAP = {
6
8
  emergency: "fatal",
7
9
  alert: "fatal",
@@ -88,6 +90,16 @@ var fastify = ({ host, port, auth, ...fastifyOptions }) => {
88
90
  }
89
91
  });
90
92
  }
93
+ instance.setErrorHandler((error, _request, reply) => {
94
+ if (error instanceof SilkweaveError) {
95
+ return reply.status(error.statusCode).send({ error: error.code, message: error.message });
96
+ }
97
+ if (error instanceof z.ZodError) {
98
+ return reply.status(400).send({ error: "validation_error", issues: error.issues });
99
+ }
100
+ instance.log.error(error);
101
+ return reply.status(500).send({ error: "internal", message: "Internal server error" });
102
+ });
91
103
  for (const action of actions) {
92
104
  const schema = action.input.toJSONSchema();
93
105
  instance.post(`/${action.name}`, {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/adapter/fastify.ts"],"sourcesContent":["import { AuthConfig, AuthInfo, generateProtectedResourceMetadata, OAuthRequest, OAuthResponse, validateToken } from '@silkweave/auth'\nimport { AdapterFactory } from '@silkweave/core'\nimport { buildLogLevels, Logger, LogLevel } from '@silkweave/logger'\nimport { FastifyBaseLogger, FastifyHttpOptions, fastify as fastifyInstance, FastifyReply, FastifyRequest } from 'fastify'\nimport { Server } from 'http'\n\ntype FastifyLogLevel = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace'\n\nconst PINO_LEVEL_MAP: Record<LogLevel, FastifyLogLevel> = {\n emergency: 'fatal',\n alert: 'fatal',\n critical: 'fatal',\n error: 'error',\n warning: 'warn',\n notice: 'debug',\n info: 'info',\n debug: 'debug'\n}\n\nexport interface FastifyAdapterOptions extends FastifyHttpOptions<Server, FastifyBaseLogger> {\n host?: string\n port?: number\n auth?: AuthConfig\n}\n\nexport const fastify: AdapterFactory<FastifyAdapterOptions> = ({ host, port, auth, ...fastifyOptions }) => {\n const instance = fastifyInstance(fastifyOptions)\n return (options, baseContext) => {\n const context = baseContext.fork({ adapter: 'fastify' })\n return {\n context,\n start: async (actions) => {\n await instance.register(import('@fastify/swagger'), {\n openapi: {\n info: {\n title: options.name,\n description: options.description,\n version: options.version\n }\n }\n })\n await instance.register(import('@scalar/fastify-api-reference'), { routePrefix: '/' as `/${string}` })\n\n if (auth?.authorizationServers?.length && auth.resourceUrl) {\n instance.get('/.well-known/oauth-protected-resource', () => {\n return generateProtectedResourceMetadata(auth.resourceUrl!, auth.authorizationServers!)\n })\n }\n\n const oauthPaths = new Set<string>()\n if (auth?.provider) {\n const provider = auth.provider\n const toOAuthReq = (request: FastifyRequest): OAuthRequest => ({\n method: request.method,\n url: new URL(request.url, `http://${request.hostname}`),\n headers: Object.fromEntries(Object.entries(request.headers).map(([k, v]) => [k, Array.isArray(v) ? v[0] : v])),\n body: request.body as Record<string, string> | undefined\n })\n const sendOAuth = (reply: FastifyReply, oauthRes: OAuthResponse) => {\n for (const [key, value] of Object.entries(oauthRes.headers)) { reply.header(key, value) }\n return reply.status(oauthRes.status).send(oauthRes.body)\n }\n\n oauthPaths.add('/.well-known/oauth-authorization-server')\n oauthPaths.add('/authorize')\n oauthPaths.add('/auth/callback')\n oauthPaths.add('/token')\n oauthPaths.add('/register')\n\n instance.get('/.well-known/oauth-authorization-server', async (_req, reply) => {\n return sendOAuth(reply, provider.metadata())\n })\n instance.get('/authorize', async (req, reply) => {\n return sendOAuth(reply, await provider.authorize(toOAuthReq(req)))\n })\n instance.get('/auth/callback', async (req, reply) => {\n return sendOAuth(reply, await provider.callback(toOAuthReq(req)))\n })\n instance.post('/token', async (req, reply) => {\n return sendOAuth(reply, await provider.token(toOAuthReq(req)))\n })\n instance.post('/register', async (req, reply) => {\n return sendOAuth(reply, await provider.register(toOAuthReq(req)))\n })\n }\n\n if (auth) {\n instance.decorateRequest('__silkweave_auth', undefined)\n instance.addHook('onRequest', async (request: FastifyRequest, reply: FastifyReply) => {\n if (request.url.startsWith('/.well-known/') || oauthPaths.has(request.url.split('?')[0])) { return }\n const result = await validateToken(request.headers.authorization, auth)\n if (result.error) {\n for (const [key, value] of Object.entries(result.error.headers)) {\n reply.header(key, value)\n }\n return reply.status(result.error.statusCode).send(result.error.body)\n }\n if (result.auth) {\n (request as FastifyRequest & { __silkweave_auth?: AuthInfo }).__silkweave_auth = result.auth\n }\n })\n }\n\n for (const action of actions) {\n const schema = action.input.toJSONSchema()\n instance.post(`/${action.name}`, {\n schema: {\n description: action.description,\n body: {\n type: 'object',\n properties: schema.properties,\n required: schema.required\n },\n response: {\n 200: { description: 'Successful response' }\n }\n }\n }, (request) => {\n const logger: Logger = {\n ...buildLogLevels((level, data) => {\n const pinoLevel = PINO_LEVEL_MAP[level] ?? 'info'\n instance.log[pinoLevel](data)\n }),\n progress: ({ progress, total, message }) => { instance.log.trace({ progress, total }, message) }\n }\n const authInfo = auth ? (request as FastifyRequest & { __silkweave_auth?: AuthInfo }).__silkweave_auth : undefined\n return action.run(request.body, context.fork({ logger, request, ...(authInfo ? { auth: authInfo } : {}) }))\n })\n }\n await instance.listen({ host, port })\n },\n stop: async () => { await instance.close() }\n }\n }\n}\n"],"mappings":";AAAA,SAA+B,mCAAgE,qBAAqB;AAEpH,SAAS,sBAAwC;AACjD,SAAgD,WAAW,uBAAqD;AAKhH,IAAM,iBAAoD;AAAA,EACxD,WAAW;AAAA,EACX,OAAO;AAAA,EACP,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AACT;AAQO,IAAM,UAAiD,CAAC,EAAE,MAAM,MAAM,MAAM,GAAG,eAAe,MAAM;AACzG,QAAM,WAAW,gBAAgB,cAAc;AAC/C,SAAO,CAAC,SAAS,gBAAgB;AAC/B,UAAM,UAAU,YAAY,KAAK,EAAE,SAAS,UAAU,CAAC;AACvD,WAAO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,UACF,CAAC;AAAA,QACH;AAEA,mBAAW,UAAU,SAAS;AAC5B,gBAAM,SAAS,OAAO,MAAM,aAAa;AACzC,mBAAS,KAAK,IAAI,OAAO,IAAI,IAAI;AAAA,YAC/B,QAAQ;AAAA,cACN,aAAa,OAAO;AAAA,cACpB,MAAM;AAAA,gBACJ,MAAM;AAAA,gBACN,YAAY,OAAO;AAAA,gBACnB,UAAU,OAAO;AAAA,cACnB;AAAA,cACA,UAAU;AAAA,gBACR,KAAK,EAAE,aAAa,sBAAsB;AAAA,cAC5C;AAAA,YACF;AAAA,UACF,GAAG,CAAC,YAAY;AACd,kBAAM,SAAiB;AAAA,cACrB,GAAG,eAAe,CAAC,OAAO,SAAS;AACjC,sBAAM,YAAY,eAAe,KAAK,KAAK;AAC3C,yBAAS,IAAI,SAAS,EAAE,IAAI;AAAA,cAC9B,CAAC;AAAA,cACD,UAAU,CAAC,EAAE,UAAU,OAAO,QAAQ,MAAM;AAAE,yBAAS,IAAI,MAAM,EAAE,UAAU,MAAM,GAAG,OAAO;AAAA,cAAE;AAAA,YACjG;AACA,kBAAM,WAAW,OAAQ,QAA6D,mBAAmB;AACzG,mBAAO,OAAO,IAAI,QAAQ,MAAM,QAAQ,KAAK,EAAE,QAAQ,SAAS,GAAI,WAAW,EAAE,MAAM,SAAS,IAAI,CAAC,EAAG,CAAC,CAAC;AAAA,UAC5G,CAAC;AAAA,QACH;AACA,cAAM,SAAS,OAAO,EAAE,MAAM,KAAK,CAAC;AAAA,MACtC;AAAA,MACA,MAAM,YAAY;AAAE,cAAM,SAAS,MAAM;AAAA,MAAE;AAAA,IAC7C;AAAA,EACF;AACF;","names":[]}
1
+ {"version":3,"sources":["../src/adapter/fastify.ts"],"sourcesContent":["import { AuthConfig, AuthInfo, generateProtectedResourceMetadata, OAuthRequest, OAuthResponse, validateToken } from '@silkweave/auth'\nimport { AdapterFactory, SilkweaveError } from '@silkweave/core'\nimport { buildLogLevels, Logger, LogLevel } from '@silkweave/logger'\nimport { FastifyBaseLogger, FastifyHttpOptions, fastify as fastifyInstance, FastifyReply, FastifyRequest } from 'fastify'\nimport { Server } from 'http'\nimport z from 'zod'\n\ntype FastifyLogLevel = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace'\n\nconst PINO_LEVEL_MAP: Record<LogLevel, FastifyLogLevel> = {\n emergency: 'fatal',\n alert: 'fatal',\n critical: 'fatal',\n error: 'error',\n warning: 'warn',\n notice: 'debug',\n info: 'info',\n debug: 'debug'\n}\n\nexport interface FastifyAdapterOptions extends FastifyHttpOptions<Server, FastifyBaseLogger> {\n host?: string\n port?: number\n auth?: AuthConfig\n}\n\nexport const fastify: AdapterFactory<FastifyAdapterOptions> = ({ host, port, auth, ...fastifyOptions }) => {\n const instance = fastifyInstance(fastifyOptions)\n return (options, baseContext) => {\n const context = baseContext.fork({ adapter: 'fastify' })\n return {\n context,\n start: async (actions) => {\n await instance.register(import('@fastify/swagger'), {\n openapi: {\n info: {\n title: options.name,\n description: options.description,\n version: options.version\n }\n }\n })\n await instance.register(import('@scalar/fastify-api-reference'), { routePrefix: '/' as `/${string}` })\n\n if (auth?.authorizationServers?.length && auth.resourceUrl) {\n instance.get('/.well-known/oauth-protected-resource', () => {\n return generateProtectedResourceMetadata(auth.resourceUrl!, auth.authorizationServers!)\n })\n }\n\n const oauthPaths = new Set<string>()\n if (auth?.provider) {\n const provider = auth.provider\n const toOAuthReq = (request: FastifyRequest): OAuthRequest => ({\n method: request.method,\n url: new URL(request.url, `http://${request.hostname}`),\n headers: Object.fromEntries(Object.entries(request.headers).map(([k, v]) => [k, Array.isArray(v) ? v[0] : v])),\n body: request.body as Record<string, string> | undefined\n })\n const sendOAuth = (reply: FastifyReply, oauthRes: OAuthResponse) => {\n for (const [key, value] of Object.entries(oauthRes.headers)) { reply.header(key, value) }\n return reply.status(oauthRes.status).send(oauthRes.body)\n }\n\n oauthPaths.add('/.well-known/oauth-authorization-server')\n oauthPaths.add('/authorize')\n oauthPaths.add('/auth/callback')\n oauthPaths.add('/token')\n oauthPaths.add('/register')\n\n instance.get('/.well-known/oauth-authorization-server', async (_req, reply) => {\n return sendOAuth(reply, provider.metadata())\n })\n instance.get('/authorize', async (req, reply) => {\n return sendOAuth(reply, await provider.authorize(toOAuthReq(req)))\n })\n instance.get('/auth/callback', async (req, reply) => {\n return sendOAuth(reply, await provider.callback(toOAuthReq(req)))\n })\n instance.post('/token', async (req, reply) => {\n return sendOAuth(reply, await provider.token(toOAuthReq(req)))\n })\n instance.post('/register', async (req, reply) => {\n return sendOAuth(reply, await provider.register(toOAuthReq(req)))\n })\n }\n\n if (auth) {\n instance.decorateRequest('__silkweave_auth', undefined)\n instance.addHook('onRequest', async (request: FastifyRequest, reply: FastifyReply) => {\n if (request.url.startsWith('/.well-known/') || oauthPaths.has(request.url.split('?')[0])) { return }\n const result = await validateToken(request.headers.authorization, auth)\n if (result.error) {\n for (const [key, value] of Object.entries(result.error.headers)) {\n reply.header(key, value)\n }\n return reply.status(result.error.statusCode).send(result.error.body)\n }\n if (result.auth) {\n (request as FastifyRequest & { __silkweave_auth?: AuthInfo }).__silkweave_auth = result.auth\n }\n })\n }\n\n instance.setErrorHandler((error, _request, reply) => {\n if (error instanceof SilkweaveError) {\n return reply.status(error.statusCode).send({ error: error.code, message: error.message })\n }\n if (error instanceof z.ZodError) {\n return reply.status(400).send({ error: 'validation_error', issues: error.issues })\n }\n instance.log.error(error)\n return reply.status(500).send({ error: 'internal', message: 'Internal server error' })\n })\n\n for (const action of actions) {\n const schema = action.input.toJSONSchema()\n instance.post(`/${action.name}`, {\n schema: {\n description: action.description,\n body: {\n type: 'object',\n properties: schema.properties,\n required: schema.required\n },\n response: {\n 200: { description: 'Successful response' }\n }\n }\n }, (request) => {\n const logger: Logger = {\n ...buildLogLevels((level, data) => {\n const pinoLevel = PINO_LEVEL_MAP[level] ?? 'info'\n instance.log[pinoLevel](data)\n }),\n progress: ({ progress, total, message }) => { instance.log.trace({ progress, total }, message) }\n }\n const authInfo = auth ? (request as FastifyRequest & { __silkweave_auth?: AuthInfo }).__silkweave_auth : undefined\n return action.run(request.body, context.fork({ logger, request, ...(authInfo ? { auth: authInfo } : {}) }))\n })\n }\n await instance.listen({ host, port })\n },\n stop: async () => { await instance.close() }\n }\n }\n}\n"],"mappings":";AAAA,SAA+B,mCAAgE,qBAAqB;AACpH,SAAyB,sBAAsB;AAC/C,SAAS,sBAAwC;AACjD,SAAgD,WAAW,uBAAqD;AAEhH,OAAO,OAAO;AAId,IAAM,iBAAoD;AAAA,EACxD,WAAW;AAAA,EACX,OAAO;AAAA,EACP,UAAU;AAAA,EACV,OAAO;AAAA,EACP,SAAS;AAAA,EACT,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,OAAO;AACT;AAQO,IAAM,UAAiD,CAAC,EAAE,MAAM,MAAM,MAAM,GAAG,eAAe,MAAM;AACzG,QAAM,WAAW,gBAAgB,cAAc;AAC/C,SAAO,CAAC,SAAS,gBAAgB;AAC/B,UAAM,UAAU,YAAY,KAAK,EAAE,SAAS,UAAU,CAAC;AACvD,WAAO;AAAA,MACL;AAAA,MACA,OAAO,OAAO,YAAY;AACxB,cAAM,SAAS,SAAS,OAAO,kBAAkB,GAAG;AAAA,UAClD,SAAS;AAAA,YACP,MAAM;AAAA,cACJ,OAAO,QAAQ;AAAA,cACf,aAAa,QAAQ;AAAA,cACrB,SAAS,QAAQ;AAAA,YACnB;AAAA,UACF;AAAA,QACF,CAAC;AACD,cAAM,SAAS,SAAS,OAAO,+BAA+B,GAAG,EAAE,aAAa,IAAoB,CAAC;AAErG,YAAI,MAAM,sBAAsB,UAAU,KAAK,aAAa;AAC1D,mBAAS,IAAI,yCAAyC,MAAM;AAC1D,mBAAO,kCAAkC,KAAK,aAAc,KAAK,oBAAqB;AAAA,UACxF,CAAC;AAAA,QACH;AAEA,cAAM,aAAa,oBAAI,IAAY;AACnC,YAAI,MAAM,UAAU;AAClB,gBAAM,WAAW,KAAK;AACtB,gBAAM,aAAa,CAAC,aAA2C;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AAI;AAAA,YAC/B,QAAQ;AAAA,cACN,aAAa,OAAO;AAAA,cACpB,MAAM;AAAA,gBACJ,MAAM;AAAA,gBACN,YAAY,OAAO;AAAA,gBACnB,UAAU,OAAO;AAAA,cACnB;AAAA,cACA,UAAU;AAAA,gBACR,KAAK,EAAE,aAAa,sBAAsB;AAAA,cAC5C;AAAA,YACF;AAAA,UACF,GAAG,CAAC,YAAY;AACd,kBAAM,SAAiB;AAAA,cACrB,GAAG,eAAe,CAAC,OAAO,SAAS;AACjC,sBAAM,YAAY,eAAe,KAAK,KAAK;AAC3C,yBAAS,IAAI,SAAS,EAAE,IAAI;AAAA,cAC9B,CAAC;AAAA,cACD,UAAU,CAAC,EAAE,UAAU,OAAO,QAAQ,MAAM;AAAE,yBAAS,IAAI,MAAM,EAAE,UAAU,MAAM,GAAG,OAAO;AAAA,cAAE;AAAA,YACjG;AACA,kBAAM,WAAW,OAAQ,QAA6D,mBAAmB;AACzG,mBAAO,OAAO,IAAI,QAAQ,MAAM,QAAQ,KAAK,EAAE,QAAQ,SAAS,GAAI,WAAW,EAAE,MAAM,SAAS,IAAI,CAAC,EAAG,CAAC,CAAC;AAAA,UAC5G,CAAC;AAAA,QACH;AACA,cAAM,SAAS,OAAO,EAAE,MAAM,KAAK,CAAC;AAAA,MACtC;AAAA,MACA,MAAM,YAAY;AAAE,cAAM,SAAS,MAAM;AAAA,MAAE;AAAA,IAC7C;AAAA,EACF;AACF;","names":[]}
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@silkweave/fastify",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Silkweave Fastify REST Adapter",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "git+ssh://git@github.com/atomicbi/silkweave.git",
7
+ "url": "git+ssh://git@github.com/silkweave/silkweave.git",
8
8
  "directory": "packages/fastify"
9
9
  },
10
10
  "type": "module",
@@ -15,9 +15,9 @@
15
15
  "@scalar/fastify-api-reference": "^1.49.0",
16
16
  "fastify": "^5.8.2",
17
17
  "zod": "^4.3.6",
18
- "@silkweave/core": "1.3.0",
19
- "@silkweave/auth": "1.3.0",
20
- "@silkweave/logger": "1.3.0"
18
+ "@silkweave/auth": "1.3.1",
19
+ "@silkweave/logger": "1.3.1",
20
+ "@silkweave/core": "1.3.1"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@eslint/js": "^10.0.1",