@kosha-ai/server 0.5.3 → 0.5.4

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 +1 @@
1
- {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAK/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAI5D;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,gBAAgB,CAAC,CAiF3B;AAED,gCAAgC;AAChC,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,gBAAgB,CAAC,CAkB3B"}
1
+ {"version":3,"file":"bootstrap.d.ts","sourceRoot":"","sources":["../src/bootstrap.ts"],"names":[],"mappings":"AAAA,OAAO,EAA0B,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAM/E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAI5D;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,gBAAgB,CAAC,CAiF3B;AAED,gCAAgC;AAChC,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,WAAW,GAClB,OAAO,CAAC,gBAAgB,CAAC,CAkB3B"}
package/dist/bootstrap.js CHANGED
@@ -3,6 +3,7 @@ import { NestFactory } from '@nestjs/core';
3
3
  import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
4
4
  import express from 'express';
5
5
  import { createAdminProxy } from './admin-proxy.js';
6
+ import { REQUEST_BODY_LIMIT } from './common/body-limit.js';
6
7
  import { resolveConfig } from './config/kosha-config.js';
7
8
  import { KoshaModule } from './kosha.module.js';
8
9
  /**
@@ -45,7 +46,7 @@ export async function createKoshaServer(config) {
45
46
  !contentType.startsWith('application/x-www-form-urlencoded') &&
46
47
  !contentType.startsWith('multipart/form-data'));
47
48
  },
48
- limit: '50mb',
49
+ limit: REQUEST_BODY_LIMIT,
49
50
  }));
50
51
  // `whitelist` strips properties no DTO declares, so an endpoint can only
51
52
  // ever see what it asked for. Better Auth's own routes are mounted by the
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Largest request body Kosha accepts, for raw proxy uploads and for JSON and
3
+ * form bodies alike. Proxied JSON often carries whole files (a Gmail `raw`
4
+ * message is the base64 of a MIME message that itself base64-encodes its
5
+ * attachments), so the parsers' 100 KB default rejects ordinary attachments.
6
+ */
7
+ export declare const REQUEST_BODY_LIMIT = "50mb";
8
+ //# sourceMappingURL=body-limit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"body-limit.d.ts","sourceRoot":"","sources":["../../src/common/body-limit.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,SAAS,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Largest request body Kosha accepts, for raw proxy uploads and for JSON and
3
+ * form bodies alike. Proxied JSON often carries whole files (a Gmail `raw`
4
+ * message is the base64 of a MIME message that itself base64-encodes its
5
+ * attachments), so the parsers' 100 KB default rejects ordinary attachments.
6
+ */
7
+ export const REQUEST_BODY_LIMIT = '50mb';
@@ -1 +1 @@
1
- {"version":3,"file":"kosha.module.d.ts","sourceRoot":"","sources":["../src/kosha.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAGvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAiB5D;;;;GAIG;AACH,qBACa,WAAW;IACtB,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,WAAW,GAAG,aAAa;CAiCnD"}
1
+ {"version":3,"file":"kosha.module.d.ts","sourceRoot":"","sources":["../src/kosha.module.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAU,MAAM,gBAAgB,CAAC;AAIvD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAiB5D;;;;GAIG;AACH,qBACa,WAAW;IACtB,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,WAAW,GAAG,aAAa;CAsCnD"}
@@ -3,6 +3,7 @@ import { __decorate } from "tslib";
3
3
  import { Module } from '@nestjs/common';
4
4
  import { AuthModule } from '@thallesp/nestjs-better-auth';
5
5
  import { createAuth } from './auth/auth.factory.js';
6
+ import { REQUEST_BODY_LIMIT } from './common/body-limit.js';
6
7
  import { resolveConfig } from './config/kosha-config.js';
7
8
  import { ConfigurationsModule } from './configurations/configurations.module.js';
8
9
  import { EnvironmentsModule } from './environments/environments.module.js';
@@ -36,6 +37,11 @@ let KoshaModule = KoshaModule_1 = class KoshaModule {
36
37
  inject: [PrismaService, EnvironmentsService],
37
38
  useFactory: (prisma, environments) => ({
38
39
  auth: createAuth(resolved, prisma, environments),
40
+ // These parsers serve every non-auth route, the proxy included.
41
+ bodyParser: {
42
+ json: { limit: REQUEST_BODY_LIMIT },
43
+ urlencoded: { limit: REQUEST_BODY_LIMIT },
44
+ },
39
45
  }),
40
46
  }),
41
47
  IntegrationsModule.forRoot(resolved.integrations),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kosha-ai/server",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "Kosha server: OAuth handshake, encrypted credential storage, token refresh, and an authenticated request proxy for third-party integrations",
5
5
  "keywords": [
6
6
  "kosha",
@@ -109,7 +109,7 @@
109
109
  "rxjs": "^7.8.0",
110
110
  "tslib": "^2.3.0",
111
111
  "zod": "4.5.4",
112
- "@kosha-ai/integration-sdk": "0.5.3"
112
+ "@kosha-ai/integration-sdk": "0.5.4"
113
113
  },
114
114
  "devDependencies": {
115
115
  "@nestjs/testing": "^11.0.0",
@@ -117,7 +117,7 @@
117
117
  "@types/node-forge": "^1.3.14",
118
118
  "@types/pg": "^8.23.1",
119
119
  "prisma": "^7.10.0",
120
- "@kosha-ai/integration-github": "0.5.3",
121
- "@kosha-ai/integration-slack": "0.5.3"
120
+ "@kosha-ai/integration-github": "0.5.4",
121
+ "@kosha-ai/integration-slack": "0.5.4"
122
122
  }
123
123
  }