@moovio/sdk 25.5.6 → 25.6.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.
- package/README.md +30 -2
- package/bin/mcp-server.js +63 -15
- package/bin/mcp-server.js.map +12 -11
- package/hooks/access-token-hook.d.ts +25 -0
- package/hooks/access-token-hook.d.ts.map +1 -0
- package/hooks/access-token-hook.js +60 -0
- package/hooks/access-token-hook.js.map +1 -0
- package/hooks/registration.d.ts.map +1 -1
- package/hooks/registration.js +4 -0
- package/hooks/registration.js.map +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +7 -3
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/mcp-server/cli/start/command.d.ts.map +1 -1
- package/mcp-server/cli/start/command.js +8 -0
- package/mcp-server/cli/start/command.js.map +1 -1
- package/mcp-server/cli/start/impl.d.ts +1 -0
- package/mcp-server/cli/start/impl.d.ts.map +1 -1
- package/mcp-server/cli/start/impl.js +2 -0
- package/mcp-server/cli/start/impl.js.map +1 -1
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts +1 -0
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +2 -1
- package/mcp-server/server.js.map +1 -1
- package/models/components/webhookdata.d.ts +2 -2
- package/models/components/webhookdata.d.ts.map +1 -1
- package/models/components/webhookdata.js +2 -2
- package/models/components/webhookdata.js.map +1 -1
- package/models/components/webhookdatabankaccountdeleted.d.ts +3 -0
- package/models/components/webhookdatabankaccountdeleted.d.ts.map +1 -1
- package/models/components/webhookdatabankaccountdeleted.js +3 -0
- package/models/components/webhookdatabankaccountdeleted.js.map +1 -1
- package/package.json +1 -1
- package/src/hooks/access-token-hook.ts +73 -0
- package/src/hooks/registration.ts +5 -0
- package/src/lib/config.ts +8 -3
- package/src/mcp-server/cli/start/command.ts +9 -0
- package/src/mcp-server/cli/start/impl.ts +3 -0
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +3 -1
- package/src/models/components/webhookdata.ts +4 -4
- package/src/models/components/webhookdatabankaccountdeleted.ts +9 -0
- 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.04.00",
|
|
52882
|
-
sdkVersion: "25.
|
|
52883
|
-
genVersion: "2.
|
|
52884
|
-
userAgent: "speakeasy-sdk/typescript 25.
|
|
52912
|
+
sdkVersion: "25.6.0",
|
|
52913
|
+
genVersion: "2.884.4",
|
|
52914
|
+
userAgent: "speakeasy-sdk/typescript 25.6.0 2.884.4 v2025.04.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 (!
|
|
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
|
|
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
|
-
|
|
53843
|
-
|
|
53844
|
-
|
|
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
|
});
|
|
@@ -66878,13 +66912,16 @@ var init_webhookdatabankaccountcreated = __esm(() => {
|
|
|
66878
66912
|
var WebhookDataBankAccountDeleted$inboundSchema, WebhookDataBankAccountDeleted$outboundSchema;
|
|
66879
66913
|
var init_webhookdatabankaccountdeleted = __esm(() => {
|
|
66880
66914
|
init_esm();
|
|
66915
|
+
init_bankaccountstatus();
|
|
66881
66916
|
WebhookDataBankAccountDeleted$inboundSchema = objectType({
|
|
66882
66917
|
bankAccountID: stringType(),
|
|
66883
|
-
accountID: stringType()
|
|
66918
|
+
accountID: stringType(),
|
|
66919
|
+
status: BankAccountStatus$inboundSchema
|
|
66884
66920
|
});
|
|
66885
66921
|
WebhookDataBankAccountDeleted$outboundSchema = objectType({
|
|
66886
66922
|
bankAccountID: stringType(),
|
|
66887
|
-
accountID: stringType()
|
|
66923
|
+
accountID: stringType(),
|
|
66924
|
+
status: BankAccountStatus$outboundSchema
|
|
66888
66925
|
});
|
|
66889
66926
|
});
|
|
66890
66927
|
|
|
@@ -67516,6 +67553,7 @@ var init_webhookdata = __esm(() => {
|
|
|
67516
67553
|
WebhookDataRefundUpdated$inboundSchema,
|
|
67517
67554
|
WebhookDataWalletTransactionUpdated$inboundSchema,
|
|
67518
67555
|
WebhookDataBankAccountCreated$inboundSchema,
|
|
67556
|
+
WebhookDataBankAccountDeleted$inboundSchema,
|
|
67519
67557
|
WebhookDataCancellationCreated$inboundSchema,
|
|
67520
67558
|
WebhookDataCancellationUpdated$inboundSchema,
|
|
67521
67559
|
WebhookDataCardAutoUpdated$inboundSchema,
|
|
@@ -67529,7 +67567,6 @@ var init_webhookdata = __esm(() => {
|
|
|
67529
67567
|
WebhookDataTransferCreated$inboundSchema,
|
|
67530
67568
|
WebhookDataWalletUpdated$inboundSchema,
|
|
67531
67569
|
WebhookDataBalanceUpdated$inboundSchema,
|
|
67532
|
-
WebhookDataBankAccountDeleted$inboundSchema,
|
|
67533
67570
|
WebhookDataCapabilityRequested$inboundSchema,
|
|
67534
67571
|
WebhookDataInvoiceCreated$inboundSchema,
|
|
67535
67572
|
WebhookDataRepresentativeCreated$inboundSchema,
|
|
@@ -67555,6 +67592,7 @@ var init_webhookdata = __esm(() => {
|
|
|
67555
67592
|
WebhookDataRefundUpdated$outboundSchema,
|
|
67556
67593
|
WebhookDataWalletTransactionUpdated$outboundSchema,
|
|
67557
67594
|
WebhookDataBankAccountCreated$outboundSchema,
|
|
67595
|
+
WebhookDataBankAccountDeleted$outboundSchema,
|
|
67558
67596
|
WebhookDataCancellationCreated$outboundSchema,
|
|
67559
67597
|
WebhookDataCancellationUpdated$outboundSchema,
|
|
67560
67598
|
WebhookDataCardAutoUpdated$outboundSchema,
|
|
@@ -67568,7 +67606,6 @@ var init_webhookdata = __esm(() => {
|
|
|
67568
67606
|
WebhookDataTransferCreated$outboundSchema,
|
|
67569
67607
|
WebhookDataWalletUpdated$outboundSchema,
|
|
67570
67608
|
WebhookDataBalanceUpdated$outboundSchema,
|
|
67571
|
-
WebhookDataBankAccountDeleted$outboundSchema,
|
|
67572
67609
|
WebhookDataCapabilityRequested$outboundSchema,
|
|
67573
67610
|
WebhookDataInvoiceCreated$outboundSchema,
|
|
67574
67611
|
WebhookDataRepresentativeCreated$outboundSchema,
|
|
@@ -96211,10 +96248,11 @@ var init_webhooksUpdate2 = __esm(() => {
|
|
|
96211
96248
|
function createMCPServer(deps) {
|
|
96212
96249
|
const server = new McpServer({
|
|
96213
96250
|
name: "Moov",
|
|
96214
|
-
version: "25.
|
|
96251
|
+
version: "25.6.0"
|
|
96215
96252
|
});
|
|
96216
96253
|
const client = new MoovCore({
|
|
96217
96254
|
security: deps.security,
|
|
96255
|
+
accessToken: deps.accessToken,
|
|
96218
96256
|
serverURL: deps.serverURL,
|
|
96219
96257
|
serverIdx: deps.serverIdx
|
|
96220
96258
|
});
|
|
@@ -96596,6 +96634,7 @@ async function startStdio(flags) {
|
|
|
96596
96634
|
username: flags.username ?? "",
|
|
96597
96635
|
password: flags.password ?? ""
|
|
96598
96636
|
}),
|
|
96637
|
+
accessToken: flags["access-token"],
|
|
96599
96638
|
serverURL: flags["server-url"],
|
|
96600
96639
|
serverIdx: flags["server-index"]
|
|
96601
96640
|
});
|
|
@@ -96617,6 +96656,7 @@ async function startSSE(flags) {
|
|
|
96617
96656
|
username: flags.username ?? "",
|
|
96618
96657
|
password: flags.password ?? ""
|
|
96619
96658
|
}),
|
|
96659
|
+
accessToken: flags["access-token"],
|
|
96620
96660
|
serverURL: flags["server-url"],
|
|
96621
96661
|
serverIdx: flags["server-index"]
|
|
96622
96662
|
});
|
|
@@ -97697,6 +97737,14 @@ var startCommand = tn({
|
|
|
97697
97737
|
return stringType().parse(value);
|
|
97698
97738
|
}
|
|
97699
97739
|
},
|
|
97740
|
+
"access-token": {
|
|
97741
|
+
kind: "parsed",
|
|
97742
|
+
brief: "Allows setting the accessToken parameter for all supported operations",
|
|
97743
|
+
optional: true,
|
|
97744
|
+
parse: (value) => {
|
|
97745
|
+
return stringType().parse(value);
|
|
97746
|
+
}
|
|
97747
|
+
},
|
|
97700
97748
|
"server-url": {
|
|
97701
97749
|
kind: "parsed",
|
|
97702
97750
|
brief: "Overrides the default server URL used by the SDK",
|
|
@@ -97756,7 +97804,7 @@ var routes = rn({
|
|
|
97756
97804
|
var app = Ve(routes, {
|
|
97757
97805
|
name: "mcp",
|
|
97758
97806
|
versionInfo: {
|
|
97759
|
-
currentVersion: "25.
|
|
97807
|
+
currentVersion: "25.6.0"
|
|
97760
97808
|
}
|
|
97761
97809
|
});
|
|
97762
97810
|
_t(app, process3.argv.slice(2), buildContext(process3));
|
|
@@ -97764,5 +97812,5 @@ export {
|
|
|
97764
97812
|
app
|
|
97765
97813
|
};
|
|
97766
97814
|
|
|
97767
|
-
//# debugId=
|
|
97815
|
+
//# debugId=6E965C87E14C187864756E2164756E21
|
|
97768
97816
|
//# sourceMappingURL=mcp-server.js.map
|