@moovio/sdk 26.4.5 → 26.5.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: "v2026.04.00",
|
|
52882
|
-
sdkVersion: "26.
|
|
52883
|
-
genVersion: "2.
|
|
52884
|
-
userAgent: "speakeasy-sdk/typescript 26.
|
|
52912
|
+
sdkVersion: "26.5.0",
|
|
52913
|
+
genVersion: "2.884.4",
|
|
52914
|
+
userAgent: "speakeasy-sdk/typescript 26.5.0 2.884.4 v2026.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
|
});
|
|
@@ -68933,13 +68967,16 @@ var init_webhookdatabankaccountcreated = __esm(() => {
|
|
|
68933
68967
|
var WebhookDataBankAccountDeleted$inboundSchema, WebhookDataBankAccountDeleted$outboundSchema;
|
|
68934
68968
|
var init_webhookdatabankaccountdeleted = __esm(() => {
|
|
68935
68969
|
init_esm();
|
|
68970
|
+
init_bankaccountstatus();
|
|
68936
68971
|
WebhookDataBankAccountDeleted$inboundSchema = objectType({
|
|
68937
68972
|
bankAccountID: stringType(),
|
|
68938
|
-
accountID: stringType()
|
|
68973
|
+
accountID: stringType(),
|
|
68974
|
+
status: BankAccountStatus$inboundSchema
|
|
68939
68975
|
});
|
|
68940
68976
|
WebhookDataBankAccountDeleted$outboundSchema = objectType({
|
|
68941
68977
|
bankAccountID: stringType(),
|
|
68942
|
-
accountID: stringType()
|
|
68978
|
+
accountID: stringType(),
|
|
68979
|
+
status: BankAccountStatus$outboundSchema
|
|
68943
68980
|
});
|
|
68944
68981
|
});
|
|
68945
68982
|
|
|
@@ -69571,6 +69608,7 @@ var init_webhookdata = __esm(() => {
|
|
|
69571
69608
|
WebhookDataRefundUpdated$inboundSchema,
|
|
69572
69609
|
WebhookDataWalletTransactionUpdated$inboundSchema,
|
|
69573
69610
|
WebhookDataBankAccountCreated$inboundSchema,
|
|
69611
|
+
WebhookDataBankAccountDeleted$inboundSchema,
|
|
69574
69612
|
WebhookDataCancellationCreated$inboundSchema,
|
|
69575
69613
|
WebhookDataCancellationUpdated$inboundSchema,
|
|
69576
69614
|
WebhookDataCardAutoUpdated$inboundSchema,
|
|
@@ -69584,7 +69622,6 @@ var init_webhookdata = __esm(() => {
|
|
|
69584
69622
|
WebhookDataTransferCreated$inboundSchema,
|
|
69585
69623
|
WebhookDataWalletUpdated$inboundSchema,
|
|
69586
69624
|
WebhookDataBalanceUpdated$inboundSchema,
|
|
69587
|
-
WebhookDataBankAccountDeleted$inboundSchema,
|
|
69588
69625
|
WebhookDataCapabilityRequested$inboundSchema,
|
|
69589
69626
|
WebhookDataInvoiceCreated$inboundSchema,
|
|
69590
69627
|
WebhookDataRepresentativeCreated$inboundSchema,
|
|
@@ -69610,6 +69647,7 @@ var init_webhookdata = __esm(() => {
|
|
|
69610
69647
|
WebhookDataRefundUpdated$outboundSchema,
|
|
69611
69648
|
WebhookDataWalletTransactionUpdated$outboundSchema,
|
|
69612
69649
|
WebhookDataBankAccountCreated$outboundSchema,
|
|
69650
|
+
WebhookDataBankAccountDeleted$outboundSchema,
|
|
69613
69651
|
WebhookDataCancellationCreated$outboundSchema,
|
|
69614
69652
|
WebhookDataCancellationUpdated$outboundSchema,
|
|
69615
69653
|
WebhookDataCardAutoUpdated$outboundSchema,
|
|
@@ -69623,7 +69661,6 @@ var init_webhookdata = __esm(() => {
|
|
|
69623
69661
|
WebhookDataTransferCreated$outboundSchema,
|
|
69624
69662
|
WebhookDataWalletUpdated$outboundSchema,
|
|
69625
69663
|
WebhookDataBalanceUpdated$outboundSchema,
|
|
69626
|
-
WebhookDataBankAccountDeleted$outboundSchema,
|
|
69627
69664
|
WebhookDataCapabilityRequested$outboundSchema,
|
|
69628
69665
|
WebhookDataInvoiceCreated$outboundSchema,
|
|
69629
69666
|
WebhookDataRepresentativeCreated$outboundSchema,
|
|
@@ -102257,10 +102294,11 @@ var init_webhooksUpdate2 = __esm(() => {
|
|
|
102257
102294
|
function createMCPServer(deps) {
|
|
102258
102295
|
const server = new McpServer({
|
|
102259
102296
|
name: "Moov",
|
|
102260
|
-
version: "26.
|
|
102297
|
+
version: "26.5.0"
|
|
102261
102298
|
});
|
|
102262
102299
|
const client = new MoovCore({
|
|
102263
102300
|
security: deps.security,
|
|
102301
|
+
accessToken: deps.accessToken,
|
|
102264
102302
|
serverURL: deps.serverURL,
|
|
102265
102303
|
serverIdx: deps.serverIdx
|
|
102266
102304
|
});
|
|
@@ -102684,6 +102722,7 @@ async function startStdio(flags) {
|
|
|
102684
102722
|
username: flags.username ?? "",
|
|
102685
102723
|
password: flags.password ?? ""
|
|
102686
102724
|
}),
|
|
102725
|
+
accessToken: flags["access-token"],
|
|
102687
102726
|
serverURL: flags["server-url"],
|
|
102688
102727
|
serverIdx: flags["server-index"]
|
|
102689
102728
|
});
|
|
@@ -102705,6 +102744,7 @@ async function startSSE(flags) {
|
|
|
102705
102744
|
username: flags.username ?? "",
|
|
102706
102745
|
password: flags.password ?? ""
|
|
102707
102746
|
}),
|
|
102747
|
+
accessToken: flags["access-token"],
|
|
102708
102748
|
serverURL: flags["server-url"],
|
|
102709
102749
|
serverIdx: flags["server-index"]
|
|
102710
102750
|
});
|
|
@@ -103785,6 +103825,14 @@ var startCommand = tn({
|
|
|
103785
103825
|
return stringType().parse(value);
|
|
103786
103826
|
}
|
|
103787
103827
|
},
|
|
103828
|
+
"access-token": {
|
|
103829
|
+
kind: "parsed",
|
|
103830
|
+
brief: "Allows setting the accessToken parameter for all supported operations",
|
|
103831
|
+
optional: true,
|
|
103832
|
+
parse: (value) => {
|
|
103833
|
+
return stringType().parse(value);
|
|
103834
|
+
}
|
|
103835
|
+
},
|
|
103788
103836
|
"server-url": {
|
|
103789
103837
|
kind: "parsed",
|
|
103790
103838
|
brief: "Overrides the default server URL used by the SDK",
|
|
@@ -103844,7 +103892,7 @@ var routes = rn({
|
|
|
103844
103892
|
var app = Ve(routes, {
|
|
103845
103893
|
name: "mcp",
|
|
103846
103894
|
versionInfo: {
|
|
103847
|
-
currentVersion: "26.
|
|
103895
|
+
currentVersion: "26.5.0"
|
|
103848
103896
|
}
|
|
103849
103897
|
});
|
|
103850
103898
|
_t(app, process3.argv.slice(2), buildContext(process3));
|
|
@@ -103852,5 +103900,5 @@ export {
|
|
|
103852
103900
|
app
|
|
103853
103901
|
};
|
|
103854
103902
|
|
|
103855
|
-
//# debugId=
|
|
103903
|
+
//# debugId=1C194E84D5CEAACB64756E2164756E21
|
|
103856
103904
|
//# sourceMappingURL=mcp-server.js.map
|