@financeable/lenders 0.5.4 → 0.5.5

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.
Files changed (82) hide show
  1. package/README.md +11 -7
  2. package/bin/mcp-server.js +19 -14
  3. package/bin/mcp-server.js.map +11 -11
  4. package/dist/commonjs/lib/config.d.ts +3 -3
  5. package/dist/commonjs/lib/config.js +3 -3
  6. package/dist/commonjs/lib/config.js.map +1 -1
  7. package/dist/commonjs/lib/encodings.d.ts +1 -0
  8. package/dist/commonjs/lib/encodings.d.ts.map +1 -1
  9. package/dist/commonjs/lib/encodings.js +27 -5
  10. package/dist/commonjs/lib/encodings.js.map +1 -1
  11. package/dist/commonjs/lib/files.d.ts +13 -0
  12. package/dist/commonjs/lib/files.d.ts.map +1 -1
  13. package/dist/commonjs/lib/files.js +19 -0
  14. package/dist/commonjs/lib/files.js.map +1 -1
  15. package/dist/commonjs/lib/matchers.d.ts.map +1 -1
  16. package/dist/commonjs/lib/matchers.js +0 -1
  17. package/dist/commonjs/lib/matchers.js.map +1 -1
  18. package/dist/commonjs/lib/sdks.d.ts.map +1 -1
  19. package/dist/commonjs/lib/sdks.js +8 -4
  20. package/dist/commonjs/lib/sdks.js.map +1 -1
  21. package/dist/commonjs/lib/security.d.ts.map +1 -1
  22. package/dist/commonjs/lib/security.js +1 -2
  23. package/dist/commonjs/lib/security.js.map +1 -1
  24. package/dist/commonjs/lib/url.d.ts.map +1 -1
  25. package/dist/commonjs/lib/url.js +4 -2
  26. package/dist/commonjs/lib/url.js.map +1 -1
  27. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  28. package/dist/commonjs/mcp-server/server.js +1 -1
  29. package/dist/commonjs/mcp-server/shared.js +1 -1
  30. package/dist/commonjs/mcp-server/shared.js.map +1 -1
  31. package/dist/commonjs/models/components/customerprofile.d.ts +2 -0
  32. package/dist/commonjs/models/components/customerprofile.d.ts.map +1 -1
  33. package/dist/commonjs/models/components/customerprofile.js +2 -0
  34. package/dist/commonjs/models/components/customerprofile.js.map +1 -1
  35. package/dist/esm/lib/config.d.ts +3 -3
  36. package/dist/esm/lib/config.js +3 -3
  37. package/dist/esm/lib/config.js.map +1 -1
  38. package/dist/esm/lib/encodings.d.ts +1 -0
  39. package/dist/esm/lib/encodings.d.ts.map +1 -1
  40. package/dist/esm/lib/encodings.js +26 -5
  41. package/dist/esm/lib/encodings.js.map +1 -1
  42. package/dist/esm/lib/files.d.ts +13 -0
  43. package/dist/esm/lib/files.d.ts.map +1 -1
  44. package/dist/esm/lib/files.js +18 -0
  45. package/dist/esm/lib/files.js.map +1 -1
  46. package/dist/esm/lib/matchers.d.ts.map +1 -1
  47. package/dist/esm/lib/matchers.js +0 -1
  48. package/dist/esm/lib/matchers.js.map +1 -1
  49. package/dist/esm/lib/sdks.d.ts.map +1 -1
  50. package/dist/esm/lib/sdks.js +8 -4
  51. package/dist/esm/lib/sdks.js.map +1 -1
  52. package/dist/esm/lib/security.d.ts.map +1 -1
  53. package/dist/esm/lib/security.js +1 -2
  54. package/dist/esm/lib/security.js.map +1 -1
  55. package/dist/esm/lib/url.d.ts.map +1 -1
  56. package/dist/esm/lib/url.js +4 -2
  57. package/dist/esm/lib/url.js.map +1 -1
  58. package/dist/esm/mcp-server/mcp-server.js +1 -1
  59. package/dist/esm/mcp-server/server.js +1 -1
  60. package/dist/esm/mcp-server/shared.js +1 -1
  61. package/dist/esm/mcp-server/shared.js.map +1 -1
  62. package/dist/esm/models/components/customerprofile.d.ts +2 -0
  63. package/dist/esm/models/components/customerprofile.d.ts.map +1 -1
  64. package/dist/esm/models/components/customerprofile.js +2 -0
  65. package/dist/esm/models/components/customerprofile.js.map +1 -1
  66. package/jsr.json +1 -1
  67. package/package.json +2 -2
  68. package/src/lib/config.ts +3 -3
  69. package/src/lib/encodings.ts +32 -4
  70. package/src/lib/files.ts +22 -0
  71. package/src/lib/matchers.ts +3 -2
  72. package/src/lib/sdks.ts +7 -5
  73. package/src/lib/security.ts +1 -2
  74. package/src/lib/url.ts +16 -14
  75. package/src/mcp-server/mcp-server.ts +1 -1
  76. package/src/mcp-server/server.ts +1 -1
  77. package/src/mcp-server/shared.ts +2 -2
  78. package/src/models/components/customerprofile.ts +4 -0
  79. package/.devcontainer/devcontainer.json +0 -45
  80. package/examples/package-lock.json +0 -620
  81. package/examples/package.json +0 -18
  82. package/tsconfig.json +0 -40
package/README.md CHANGED
@@ -439,19 +439,23 @@ The `HTTPClient` constructor takes an optional `fetcher` argument that can be
439
439
  used to integrate a third-party HTTP client or when writing tests to mock out
440
440
  the HTTP client and feed in fixtures.
441
441
 
442
- The following example shows how to use the `"beforeRequest"` hook to to add a
443
- custom header and a timeout to requests and how to use the `"requestError"` hook
444
- to log errors:
442
+ The following example shows how to:
443
+ - route requests through a proxy server using [undici](https://www.npmjs.com/package/undici)'s ProxyAgent
444
+ - use the `"beforeRequest"` hook to add a custom header and a timeout to requests
445
+ - use the `"requestError"` hook to log errors
445
446
 
446
447
  ```typescript
447
448
  import { FinanceableLenders } from "@financeable/lenders";
449
+ import { ProxyAgent } from "undici";
448
450
  import { HTTPClient } from "@financeable/lenders/lib/http";
449
451
 
452
+ const dispatcher = new ProxyAgent("http://proxy.example.com:8080");
453
+
450
454
  const httpClient = new HTTPClient({
451
- // fetcher takes a function that has the same signature as native `fetch`.
452
- fetcher: (request) => {
453
- return fetch(request);
454
- }
455
+ // 'fetcher' takes a function that has the same signature as native 'fetch'.
456
+ fetcher: (input, init) =>
457
+ // 'dispatcher' is specific to undici and not part of the standard Fetch API.
458
+ fetch(input, { ...init, dispatcher } as RequestInit),
455
459
  });
456
460
 
457
461
  httpClient.addHook("beforeRequest", (request) => {
package/bin/mcp-server.js CHANGED
@@ -47521,7 +47521,7 @@ function pathToFunc(pathPattern, options) {
47521
47521
  throw new Error(`Parameter '${placeholder}' must be a string or number`);
47522
47522
  }
47523
47523
  return options?.charEncoding === "percent" ? encodeURIComponent(`${value}`) : `${value}`;
47524
- });
47524
+ }).replace(/^\/+/, "");
47525
47525
  };
47526
47526
  }
47527
47527
  var hasOwn;
@@ -47552,9 +47552,9 @@ var init_config = __esm(() => {
47552
47552
  SDK_METADATA = {
47553
47553
  language: "typescript",
47554
47554
  openapiDocVersion: "0.1.0",
47555
- sdkVersion: "0.5.4",
47556
- genVersion: "2.816.0",
47557
- userAgent: "speakeasy-sdk/typescript 0.5.4 2.816.0 0.1.0 @financeable/lenders"
47555
+ sdkVersion: "0.5.5",
47556
+ genVersion: "2.879.11",
47557
+ userAgent: "speakeasy-sdk/typescript 0.5.5 2.879.11 0.1.0 @financeable/lenders"
47558
47558
  };
47559
47559
  });
47560
47560
 
@@ -48129,12 +48129,15 @@ class ClientSDK {
48129
48129
  if (!base) {
48130
48130
  return ERR(new InvalidRequestError("No base URL provided for operation"));
48131
48131
  }
48132
- const reqURL = new URL(base);
48133
- const inputURL = new URL(path, reqURL);
48132
+ const baseURL = new URL(base);
48133
+ let reqURL;
48134
48134
  if (path) {
48135
- reqURL.pathname += reqURL.pathname.endsWith("/") ? "" : "/";
48136
- reqURL.pathname += inputURL.pathname.replace(/^\/+/, "");
48135
+ baseURL.pathname = baseURL.pathname.replace(/\/+$/, "") + "/";
48136
+ reqURL = new URL(path, baseURL);
48137
+ } else {
48138
+ reqURL = baseURL;
48137
48139
  }
48140
+ reqURL.hash = "";
48138
48141
  let finalQuery = query || "";
48139
48142
  const secQuery = [];
48140
48143
  for (const [k2, v2] of Object.entries(security?.queryParams || {})) {
@@ -48377,7 +48380,7 @@ async function consumeStream(stream) {
48377
48380
  while (true) {
48378
48381
  const { done, value } = await reader.read();
48379
48382
  if (value != null)
48380
- chunks.push(value);
48383
+ chunks.push(new Uint8Array(value).buffer);
48381
48384
  if (done)
48382
48385
  break;
48383
48386
  }
@@ -49759,7 +49762,8 @@ var init_customerprofile = __esm(() => {
49759
49762
  contactNumber: stringType().optional(),
49760
49763
  shareOfExpenses: numberType().optional(),
49761
49764
  rentAmount: stringType().optional(),
49762
- landlordName: stringType().optional()
49765
+ landlordName: stringType().optional(),
49766
+ serviceabilitySurplus: numberType().optional()
49763
49767
  }).transform((v2) => {
49764
49768
  return remap(v2, {
49765
49769
  _id: "id"
@@ -49774,7 +49778,8 @@ var init_customerprofile = __esm(() => {
49774
49778
  contactNumber: stringType().optional(),
49775
49779
  shareOfExpenses: numberType().optional(),
49776
49780
  rentAmount: stringType().optional(),
49777
- landlordName: stringType().optional()
49781
+ landlordName: stringType().optional(),
49782
+ serviceabilitySurplus: numberType().optional()
49778
49783
  }).transform((v2) => {
49779
49784
  return remap(v2, {
49780
49785
  id: "_id"
@@ -52858,7 +52863,7 @@ var init_createPersonalSubmission2 = __esm(() => {
52858
52863
  function createMCPServer(deps) {
52859
52864
  const server = new McpServer({
52860
52865
  name: "FinanceableLenders",
52861
- version: "0.5.4"
52866
+ version: "0.5.5"
52862
52867
  });
52863
52868
  const client = new FinanceableLendersCore({
52864
52869
  serverURL: deps.serverURL,
@@ -54053,7 +54058,7 @@ var routes = rn({
54053
54058
  var app = Ve(routes, {
54054
54059
  name: "mcp",
54055
54060
  versionInfo: {
54056
- currentVersion: "0.5.4"
54061
+ currentVersion: "0.5.5"
54057
54062
  }
54058
54063
  });
54059
54064
  _t(app, process3.argv.slice(2), buildContext(process3));
@@ -54061,5 +54066,5 @@ export {
54061
54066
  app
54062
54067
  };
54063
54068
 
54064
- //# debugId=0561E5485A63907764756E2164756E21
54069
+ //# debugId=4318FDDCE3D6112D64756E2164756E21
54065
54070
  //# sourceMappingURL=mcp-server.js.map