@moovio/sdk 26.2.6 → 26.3.0

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 (46) hide show
  1. package/README.md +30 -2
  2. package/bin/mcp-server.js +63 -15
  3. package/bin/mcp-server.js.map +12 -11
  4. package/hooks/access-token-hook.d.ts +25 -0
  5. package/hooks/access-token-hook.d.ts.map +1 -0
  6. package/hooks/access-token-hook.js +60 -0
  7. package/hooks/access-token-hook.js.map +1 -0
  8. package/hooks/registration.d.ts.map +1 -1
  9. package/hooks/registration.js +4 -0
  10. package/hooks/registration.js.map +1 -1
  11. package/jsr.json +1 -1
  12. package/lib/config.d.ts +7 -3
  13. package/lib/config.d.ts.map +1 -1
  14. package/lib/config.js +3 -3
  15. package/lib/config.js.map +1 -1
  16. package/mcp-server/cli/start/command.d.ts.map +1 -1
  17. package/mcp-server/cli/start/command.js +8 -0
  18. package/mcp-server/cli/start/command.js.map +1 -1
  19. package/mcp-server/cli/start/impl.d.ts +1 -0
  20. package/mcp-server/cli/start/impl.d.ts.map +1 -1
  21. package/mcp-server/cli/start/impl.js +2 -0
  22. package/mcp-server/cli/start/impl.js.map +1 -1
  23. package/mcp-server/mcp-server.js +1 -1
  24. package/mcp-server/server.d.ts +1 -0
  25. package/mcp-server/server.d.ts.map +1 -1
  26. package/mcp-server/server.js +2 -1
  27. package/mcp-server/server.js.map +1 -1
  28. package/models/components/webhookdata.d.ts +2 -2
  29. package/models/components/webhookdata.d.ts.map +1 -1
  30. package/models/components/webhookdata.js +2 -2
  31. package/models/components/webhookdata.js.map +1 -1
  32. package/models/components/webhookdatabankaccountdeleted.d.ts +3 -0
  33. package/models/components/webhookdatabankaccountdeleted.d.ts.map +1 -1
  34. package/models/components/webhookdatabankaccountdeleted.js +3 -0
  35. package/models/components/webhookdatabankaccountdeleted.js.map +1 -1
  36. package/package.json +1 -1
  37. package/src/hooks/access-token-hook.ts +73 -0
  38. package/src/hooks/registration.ts +5 -0
  39. package/src/lib/config.ts +8 -3
  40. package/src/mcp-server/cli/start/command.ts +9 -0
  41. package/src/mcp-server/cli/start/impl.ts +3 -0
  42. package/src/mcp-server/mcp-server.ts +1 -1
  43. package/src/mcp-server/server.ts +3 -1
  44. package/src/models/components/webhookdata.ts +4 -4
  45. package/src/models/components/webhookdatabankaccountdeleted.ts +9 -0
  46. package/test/tests/accessToken.test.ts +86 -0
package/README.md CHANGED
@@ -95,7 +95,8 @@ Add the following server definition to your `claude_desktop_config.json` file:
95
95
  "--",
96
96
  "mcp", "start",
97
97
  "--username", "...",
98
- "--password", "..."
98
+ "--password", "...",
99
+ "--access-token", "..."
99
100
  ]
100
101
  }
101
102
  }
@@ -119,7 +120,8 @@ Create a `.cursor/mcp.json` file in your project root with the following content
119
120
  "--",
120
121
  "mcp", "start",
121
122
  "--username", "...",
122
- "--password", "..."
123
+ "--password", "...",
124
+ "--access-token", "..."
123
125
  ]
124
126
  }
125
127
  }
@@ -238,6 +240,32 @@ run();
238
240
  ```
239
241
  <!-- End Authentication [security] -->
240
242
 
243
+ Client-side authentication is supported through the `accessToken` parameter. For example:
244
+ ```typescript
245
+ import { Moov } from "@moovio/sdk";
246
+
247
+ const moov = new Moov({
248
+ accessToken: "",
249
+ });
250
+
251
+ async function run() {
252
+ const result = await moov.accounts.create({
253
+ accountType: "business",
254
+ profile: {
255
+ business: {
256
+ legalBusinessName: "Whole Body Fitness LLC",
257
+ },
258
+ },
259
+ });
260
+
261
+ console.log(result);
262
+ }
263
+
264
+ run();
265
+
266
+ ```
267
+ See the [Moov authentication docs](https://docs.moov.io/api/authentication/api-authentication/) for more information.
268
+
241
269
  <!-- Start Available Resources and Operations [operations] -->
242
270
  ## Available Resources and Operations
243
271
 
package/bin/mcp-server.js CHANGED
@@ -52835,6 +52835,36 @@ var init_mcp = __esm(() => {
52835
52835
  };
52836
52836
  });
52837
52837
 
52838
+ // src/hooks/access-token-hook.ts
52839
+ class AccessTokenHook {
52840
+ sdkInit(opts) {
52841
+ const token = opts.accessToken;
52842
+ const hasToken = typeof token === "string" && token.length > 0;
52843
+ if (hasToken && opts.security != null) {
52844
+ throw new Error("Moov SDK: `accessToken` and `security.username`/`password` cannot " + "both be set. Use `accessToken` for OAuth2 bearer auth " + "(typically client-side) or `security.username`/`password` for " + "HTTP Basic auth with API keys (server-side).");
52845
+ }
52846
+ if (isBrowserLike && opts.security != null) {
52847
+ throw new Error("Moov SDK: HTTP Basic credentials were provided in a browser-like " + "environment. API keys must never be embedded in client-side " + "code. Mint a short-lived OAuth2 access token on your server " + "and pass it via the `accessToken` option instead.");
52848
+ }
52849
+ return opts;
52850
+ }
52851
+ beforeRequest(ctx, request) {
52852
+ const token = ctx.options.accessToken;
52853
+ if (!token || request.headers.has("Authorization")) {
52854
+ return request;
52855
+ }
52856
+ const next = new Request(request);
52857
+ next.headers.set("Authorization", `Bearer ${token}`);
52858
+ return next;
52859
+ }
52860
+ }
52861
+ var gt, webWorkerLike, isBrowserLike;
52862
+ var init_access_token_hook = __esm(() => {
52863
+ gt = typeof globalThis === "undefined" ? null : globalThis;
52864
+ webWorkerLike = typeof gt === "object" && gt != null && "importScripts" in gt && typeof gt["importScripts"] === "function";
52865
+ isBrowserLike = webWorkerLike || typeof navigator !== "undefined" && "serviceWorker" in navigator || typeof window === "object" && typeof window.document !== "undefined";
52866
+ });
52867
+
52838
52868
  // src/lib/url.ts
52839
52869
  function pathToFunc(pathPattern, options) {
52840
52870
  const paramRE = /\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g;
@@ -52879,9 +52909,9 @@ var init_config = __esm(() => {
52879
52909
  SDK_METADATA = {
52880
52910
  language: "typescript",
52881
52911
  openapiDocVersion: "v2026.01.00",
52882
- sdkVersion: "26.2.6",
52883
- genVersion: "2.882.0",
52884
- userAgent: "speakeasy-sdk/typescript 26.2.6 2.882.0 v2026.01.00 @moovio/sdk"
52912
+ sdkVersion: "26.3.0",
52913
+ genVersion: "2.884.4",
52914
+ userAgent: "speakeasy-sdk/typescript 26.3.0 2.884.4 v2026.01.00 @moovio/sdk"
52885
52915
  };
52886
52916
  });
52887
52917
 
@@ -52901,8 +52931,12 @@ var init_moov_version_hook = __esm(() => {
52901
52931
  function initHooks(hooks) {
52902
52932
  const versionHook = new MoovVersionHook;
52903
52933
  hooks.registerBeforeRequestHook(versionHook);
52934
+ const accessTokenHook = new AccessTokenHook;
52935
+ hooks.registerSDKInitHook(accessTokenHook);
52936
+ hooks.registerBeforeRequestHook(accessTokenHook);
52904
52937
  }
52905
52938
  var init_registration = __esm(() => {
52939
+ init_access_token_hook();
52906
52940
  init_moov_version_hook();
52907
52941
  });
52908
52942
 
@@ -53685,7 +53719,7 @@ class ClientSDK {
53685
53719
  for (const [k2, v2] of userHeaders) {
53686
53720
  headers.set(k2, v2);
53687
53721
  }
53688
- if (!isBrowserLike) {
53722
+ if (!isBrowserLike2) {
53689
53723
  headers.set(conf.uaHeader ?? "user-agent", conf.userAgent ?? SDK_METADATA.userAgent);
53690
53724
  }
53691
53725
  const fetchOptions = {
@@ -53830,7 +53864,7 @@ async function logResponse(logger, res, req) {
53830
53864
  logger.groupEnd();
53831
53865
  logger.groupEnd();
53832
53866
  }
53833
- var gt, webWorkerLike, isBrowserLike, jsonLikeContentTypeRE, jsonlLikeContentTypeRE;
53867
+ var gt2, webWorkerLike2, isBrowserLike2, jsonLikeContentTypeRE, jsonlLikeContentTypeRE;
53834
53868
  var init_sdks = __esm(() => {
53835
53869
  init_hooks();
53836
53870
  init_httpclienterrors();
@@ -53839,9 +53873,9 @@ var init_sdks = __esm(() => {
53839
53873
  init_encodings();
53840
53874
  init_http();
53841
53875
  init_retries();
53842
- gt = typeof globalThis === "undefined" ? null : globalThis;
53843
- webWorkerLike = typeof gt === "object" && gt != null && "importScripts" in gt && typeof gt["importScripts"] === "function";
53844
- isBrowserLike = webWorkerLike || typeof navigator !== "undefined" && "serviceWorker" in navigator || typeof window === "object" && typeof window.document !== "undefined";
53876
+ gt2 = typeof globalThis === "undefined" ? null : globalThis;
53877
+ webWorkerLike2 = typeof gt2 === "object" && gt2 != null && "importScripts" in gt2 && typeof gt2["importScripts"] === "function";
53878
+ isBrowserLike2 = webWorkerLike2 || typeof navigator !== "undefined" && "serviceWorker" in navigator || typeof window === "object" && typeof window.document !== "undefined";
53845
53879
  jsonLikeContentTypeRE = /^(application|text)\/([^+]+\+)*json.*/;
53846
53880
  jsonlLikeContentTypeRE = /^(application|text)\/([^+]+\+)*(jsonl|x-ndjson)\b.*/;
53847
53881
  });
@@ -67808,13 +67842,16 @@ var init_webhookdatabankaccountcreated = __esm(() => {
67808
67842
  var WebhookDataBankAccountDeleted$inboundSchema, WebhookDataBankAccountDeleted$outboundSchema;
67809
67843
  var init_webhookdatabankaccountdeleted = __esm(() => {
67810
67844
  init_esm();
67845
+ init_bankaccountstatus();
67811
67846
  WebhookDataBankAccountDeleted$inboundSchema = objectType({
67812
67847
  bankAccountID: stringType(),
67813
- accountID: stringType()
67848
+ accountID: stringType(),
67849
+ status: BankAccountStatus$inboundSchema
67814
67850
  });
67815
67851
  WebhookDataBankAccountDeleted$outboundSchema = objectType({
67816
67852
  bankAccountID: stringType(),
67817
- accountID: stringType()
67853
+ accountID: stringType(),
67854
+ status: BankAccountStatus$outboundSchema
67818
67855
  });
67819
67856
  });
67820
67857
 
@@ -68446,6 +68483,7 @@ var init_webhookdata = __esm(() => {
68446
68483
  WebhookDataRefundUpdated$inboundSchema,
68447
68484
  WebhookDataWalletTransactionUpdated$inboundSchema,
68448
68485
  WebhookDataBankAccountCreated$inboundSchema,
68486
+ WebhookDataBankAccountDeleted$inboundSchema,
68449
68487
  WebhookDataCancellationCreated$inboundSchema,
68450
68488
  WebhookDataCancellationUpdated$inboundSchema,
68451
68489
  WebhookDataCardAutoUpdated$inboundSchema,
@@ -68459,7 +68497,6 @@ var init_webhookdata = __esm(() => {
68459
68497
  WebhookDataTransferCreated$inboundSchema,
68460
68498
  WebhookDataWalletUpdated$inboundSchema,
68461
68499
  WebhookDataBalanceUpdated$inboundSchema,
68462
- WebhookDataBankAccountDeleted$inboundSchema,
68463
68500
  WebhookDataCapabilityRequested$inboundSchema,
68464
68501
  WebhookDataInvoiceCreated$inboundSchema,
68465
68502
  WebhookDataRepresentativeCreated$inboundSchema,
@@ -68485,6 +68522,7 @@ var init_webhookdata = __esm(() => {
68485
68522
  WebhookDataRefundUpdated$outboundSchema,
68486
68523
  WebhookDataWalletTransactionUpdated$outboundSchema,
68487
68524
  WebhookDataBankAccountCreated$outboundSchema,
68525
+ WebhookDataBankAccountDeleted$outboundSchema,
68488
68526
  WebhookDataCancellationCreated$outboundSchema,
68489
68527
  WebhookDataCancellationUpdated$outboundSchema,
68490
68528
  WebhookDataCardAutoUpdated$outboundSchema,
@@ -68498,7 +68536,6 @@ var init_webhookdata = __esm(() => {
68498
68536
  WebhookDataTransferCreated$outboundSchema,
68499
68537
  WebhookDataWalletUpdated$outboundSchema,
68500
68538
  WebhookDataBalanceUpdated$outboundSchema,
68501
- WebhookDataBankAccountDeleted$outboundSchema,
68502
68539
  WebhookDataCapabilityRequested$outboundSchema,
68503
68540
  WebhookDataInvoiceCreated$outboundSchema,
68504
68541
  WebhookDataRepresentativeCreated$outboundSchema,
@@ -98351,10 +98388,11 @@ var init_webhooksUpdate2 = __esm(() => {
98351
98388
  function createMCPServer(deps) {
98352
98389
  const server = new McpServer({
98353
98390
  name: "Moov",
98354
- version: "26.2.6"
98391
+ version: "26.3.0"
98355
98392
  });
98356
98393
  const client = new MoovCore({
98357
98394
  security: deps.security,
98395
+ accessToken: deps.accessToken,
98358
98396
  serverURL: deps.serverURL,
98359
98397
  serverIdx: deps.serverIdx
98360
98398
  });
@@ -98748,6 +98786,7 @@ async function startStdio(flags) {
98748
98786
  username: flags.username ?? "",
98749
98787
  password: flags.password ?? ""
98750
98788
  }),
98789
+ accessToken: flags["access-token"],
98751
98790
  serverURL: flags["server-url"],
98752
98791
  serverIdx: flags["server-index"]
98753
98792
  });
@@ -98769,6 +98808,7 @@ async function startSSE(flags) {
98769
98808
  username: flags.username ?? "",
98770
98809
  password: flags.password ?? ""
98771
98810
  }),
98811
+ accessToken: flags["access-token"],
98772
98812
  serverURL: flags["server-url"],
98773
98813
  serverIdx: flags["server-index"]
98774
98814
  });
@@ -99849,6 +99889,14 @@ var startCommand = tn({
99849
99889
  return stringType().parse(value);
99850
99890
  }
99851
99891
  },
99892
+ "access-token": {
99893
+ kind: "parsed",
99894
+ brief: "Allows setting the accessToken parameter for all supported operations",
99895
+ optional: true,
99896
+ parse: (value) => {
99897
+ return stringType().parse(value);
99898
+ }
99899
+ },
99852
99900
  "server-url": {
99853
99901
  kind: "parsed",
99854
99902
  brief: "Overrides the default server URL used by the SDK",
@@ -99908,7 +99956,7 @@ var routes = rn({
99908
99956
  var app = Ve(routes, {
99909
99957
  name: "mcp",
99910
99958
  versionInfo: {
99911
- currentVersion: "26.2.6"
99959
+ currentVersion: "26.3.0"
99912
99960
  }
99913
99961
  });
99914
99962
  _t(app, process3.argv.slice(2), buildContext(process3));
@@ -99916,5 +99964,5 @@ export {
99916
99964
  app
99917
99965
  };
99918
99966
 
99919
- //# debugId=44A5CD7BA5E26B7764756E2164756E21
99967
+ //# debugId=2E0782758D2E3D8464756E2164756E21
99920
99968
  //# sourceMappingURL=mcp-server.js.map