@moovio/sdk 25.2.6 → 25.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: "v2025.01.00",
52882
- sdkVersion: "25.2.6",
52883
- genVersion: "2.882.0",
52884
- userAgent: "speakeasy-sdk/typescript 25.2.6 2.882.0 v2025.01.00 @moovio/sdk"
52912
+ sdkVersion: "25.3.0",
52913
+ genVersion: "2.884.4",
52914
+ userAgent: "speakeasy-sdk/typescript 25.3.0 2.884.4 v2025.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
  });
@@ -66735,13 +66769,16 @@ var init_webhookdatabankaccountcreated = __esm(() => {
66735
66769
  var WebhookDataBankAccountDeleted$inboundSchema, WebhookDataBankAccountDeleted$outboundSchema;
66736
66770
  var init_webhookdatabankaccountdeleted = __esm(() => {
66737
66771
  init_esm();
66772
+ init_bankaccountstatus();
66738
66773
  WebhookDataBankAccountDeleted$inboundSchema = objectType({
66739
66774
  bankAccountID: stringType(),
66740
- accountID: stringType()
66775
+ accountID: stringType(),
66776
+ status: BankAccountStatus$inboundSchema
66741
66777
  });
66742
66778
  WebhookDataBankAccountDeleted$outboundSchema = objectType({
66743
66779
  bankAccountID: stringType(),
66744
- accountID: stringType()
66780
+ accountID: stringType(),
66781
+ status: BankAccountStatus$outboundSchema
66745
66782
  });
66746
66783
  });
66747
66784
 
@@ -67373,6 +67410,7 @@ var init_webhookdata = __esm(() => {
67373
67410
  WebhookDataRefundUpdated$inboundSchema,
67374
67411
  WebhookDataWalletTransactionUpdated$inboundSchema,
67375
67412
  WebhookDataBankAccountCreated$inboundSchema,
67413
+ WebhookDataBankAccountDeleted$inboundSchema,
67376
67414
  WebhookDataCancellationCreated$inboundSchema,
67377
67415
  WebhookDataCancellationUpdated$inboundSchema,
67378
67416
  WebhookDataCardAutoUpdated$inboundSchema,
@@ -67386,7 +67424,6 @@ var init_webhookdata = __esm(() => {
67386
67424
  WebhookDataTransferCreated$inboundSchema,
67387
67425
  WebhookDataWalletUpdated$inboundSchema,
67388
67426
  WebhookDataBalanceUpdated$inboundSchema,
67389
- WebhookDataBankAccountDeleted$inboundSchema,
67390
67427
  WebhookDataCapabilityRequested$inboundSchema,
67391
67428
  WebhookDataInvoiceCreated$inboundSchema,
67392
67429
  WebhookDataRepresentativeCreated$inboundSchema,
@@ -67412,6 +67449,7 @@ var init_webhookdata = __esm(() => {
67412
67449
  WebhookDataRefundUpdated$outboundSchema,
67413
67450
  WebhookDataWalletTransactionUpdated$outboundSchema,
67414
67451
  WebhookDataBankAccountCreated$outboundSchema,
67452
+ WebhookDataBankAccountDeleted$outboundSchema,
67415
67453
  WebhookDataCancellationCreated$outboundSchema,
67416
67454
  WebhookDataCancellationUpdated$outboundSchema,
67417
67455
  WebhookDataCardAutoUpdated$outboundSchema,
@@ -67425,7 +67463,6 @@ var init_webhookdata = __esm(() => {
67425
67463
  WebhookDataTransferCreated$outboundSchema,
67426
67464
  WebhookDataWalletUpdated$outboundSchema,
67427
67465
  WebhookDataBalanceUpdated$outboundSchema,
67428
- WebhookDataBankAccountDeleted$outboundSchema,
67429
67466
  WebhookDataCapabilityRequested$outboundSchema,
67430
67467
  WebhookDataInvoiceCreated$outboundSchema,
67431
67468
  WebhookDataRepresentativeCreated$outboundSchema,
@@ -96062,10 +96099,11 @@ var init_webhooksUpdate2 = __esm(() => {
96062
96099
  function createMCPServer(deps) {
96063
96100
  const server = new McpServer({
96064
96101
  name: "Moov",
96065
- version: "25.2.6"
96102
+ version: "25.3.0"
96066
96103
  });
96067
96104
  const client = new MoovCore({
96068
96105
  security: deps.security,
96106
+ accessToken: deps.accessToken,
96069
96107
  serverURL: deps.serverURL,
96070
96108
  serverIdx: deps.serverIdx
96071
96109
  });
@@ -96447,6 +96485,7 @@ async function startStdio(flags) {
96447
96485
  username: flags.username ?? "",
96448
96486
  password: flags.password ?? ""
96449
96487
  }),
96488
+ accessToken: flags["access-token"],
96450
96489
  serverURL: flags["server-url"],
96451
96490
  serverIdx: flags["server-index"]
96452
96491
  });
@@ -96468,6 +96507,7 @@ async function startSSE(flags) {
96468
96507
  username: flags.username ?? "",
96469
96508
  password: flags.password ?? ""
96470
96509
  }),
96510
+ accessToken: flags["access-token"],
96471
96511
  serverURL: flags["server-url"],
96472
96512
  serverIdx: flags["server-index"]
96473
96513
  });
@@ -97548,6 +97588,14 @@ var startCommand = tn({
97548
97588
  return stringType().parse(value);
97549
97589
  }
97550
97590
  },
97591
+ "access-token": {
97592
+ kind: "parsed",
97593
+ brief: "Allows setting the accessToken parameter for all supported operations",
97594
+ optional: true,
97595
+ parse: (value) => {
97596
+ return stringType().parse(value);
97597
+ }
97598
+ },
97551
97599
  "server-url": {
97552
97600
  kind: "parsed",
97553
97601
  brief: "Overrides the default server URL used by the SDK",
@@ -97607,7 +97655,7 @@ var routes = rn({
97607
97655
  var app = Ve(routes, {
97608
97656
  name: "mcp",
97609
97657
  versionInfo: {
97610
- currentVersion: "25.2.6"
97658
+ currentVersion: "25.3.0"
97611
97659
  }
97612
97660
  });
97613
97661
  _t(app, process3.argv.slice(2), buildContext(process3));
@@ -97615,5 +97663,5 @@ export {
97615
97663
  app
97616
97664
  };
97617
97665
 
97618
- //# debugId=841AFCEAE1EF5F0064756E2164756E21
97666
+ //# debugId=8D35B9D310F5D7B964756E2164756E21
97619
97667
  //# sourceMappingURL=mcp-server.js.map