@flutchai/flutch-sdk 0.7.6 → 0.7.7

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.cts CHANGED
@@ -1635,6 +1635,7 @@ declare class UniversalGraphService implements IGraphService {
1635
1635
  declare function bootstrap(AppModule: any, options?: {
1636
1636
  port?: number;
1637
1637
  globalPrefix?: string;
1638
+ bodyLimit?: string;
1638
1639
  }): Promise<_nestjs_common.INestApplication<any>>;
1639
1640
 
1640
1641
  interface ApiCallTracerOptions {
package/dist/index.d.ts CHANGED
@@ -1635,6 +1635,7 @@ declare class UniversalGraphService implements IGraphService {
1635
1635
  declare function bootstrap(AppModule: any, options?: {
1636
1636
  port?: number;
1637
1637
  globalPrefix?: string;
1638
+ bodyLimit?: string;
1638
1639
  }): Promise<_nestjs_common.INestApplication<any>>;
1639
1640
 
1640
1641
  interface ApiCallTracerOptions {
package/dist/index.js CHANGED
@@ -6,10 +6,10 @@ import * as fs from 'fs';
6
6
  import * as path2 from 'path';
7
7
  import * as os from 'os';
8
8
  import { ConfigService, ConfigModule } from '@nestjs/config';
9
+ import { Response, json, urlencoded } from 'express';
9
10
  import * as net from 'net';
10
11
  import mongoose from 'mongoose';
11
12
  import { MongoDBSaver } from '@langchain/langgraph-checkpoint-mongodb';
12
- import { Response } from 'express';
13
13
  import * as crypto from 'crypto';
14
14
  import { randomUUID, createHash, randomBytes } from 'crypto';
15
15
  import { Registry, collectDefaultMetrics, Counter, Histogram, Gauge } from 'prom-client';
@@ -1960,6 +1960,14 @@ async function bootstrap(AppModule, options = {}) {
1960
1960
  setupRedisMock();
1961
1961
  const app = await NestFactory.create(AppModule);
1962
1962
  const logger3 = new Logger("Bootstrap");
1963
+ const bodyLimit = options.bodyLimit || process.env.GRAPH_BODY_LIMIT || "10mb";
1964
+ app.use(json({
1965
+ limit: bodyLimit
1966
+ }));
1967
+ app.use(urlencoded({
1968
+ limit: bodyLimit,
1969
+ extended: true
1970
+ }));
1963
1971
  const requestedPort = options.port || parseInt(process.env.PORT || "3100", 10);
1964
1972
  const port = await findAvailablePort(requestedPort);
1965
1973
  const globalPrefix = options.globalPrefix;
@@ -7122,8 +7130,8 @@ function toolSearchTerms(text) {
7122
7130
  }
7123
7131
  __name(toolSearchTerms, "toolSearchTerms");
7124
7132
  function schemaParams(schema) {
7125
- const json = schema;
7126
- const properties = json?.properties ?? json?.shape ?? {};
7133
+ const json2 = schema;
7134
+ const properties = json2?.properties ?? json2?.shape ?? {};
7127
7135
  return Object.entries(properties).flatMap(([name, property]) => property?.description ? [
7128
7136
  name,
7129
7137
  property.description
@@ -8838,8 +8846,8 @@ var IV_LENGTH = 16;
8838
8846
  function encryptTokens(tokens, key) {
8839
8847
  const iv = crypto.randomBytes(IV_LENGTH);
8840
8848
  const cipher = crypto.createCipheriv(ALGORITHM, Buffer.from(key), iv);
8841
- const json = JSON.stringify(tokens);
8842
- let encrypted = cipher.update(json, "utf8", "hex");
8849
+ const json2 = JSON.stringify(tokens);
8850
+ let encrypted = cipher.update(json2, "utf8", "hex");
8843
8851
  encrypted += cipher.final("hex");
8844
8852
  return iv.toString("hex") + ":" + encrypted;
8845
8853
  }