@moovio/sdk 0.6.1 → 0.7.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/FUNCTIONS.md +1 -0
- package/README.md +25 -0
- package/bin/mcp-server.js +814 -275
- package/bin/mcp-server.js.map +26 -14
- package/docs/sdks/accounts/README.md +2 -0
- package/docs/sdks/onboarding/README.md +2 -0
- package/docs/sdks/receipts/README.md +189 -0
- package/funcs/receiptsCreate.d.ts +18 -0
- package/funcs/receiptsCreate.d.ts.map +1 -0
- package/funcs/receiptsCreate.js +133 -0
- package/funcs/receiptsCreate.js.map +1 -0
- package/funcs/receiptsList.d.ts +16 -0
- package/funcs/receiptsList.d.ts.map +1 -0
- package/funcs/receiptsList.js +121 -0
- package/funcs/receiptsList.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/mcp-server/extensions.d.ts +9 -0
- package/mcp-server/extensions.d.ts.map +1 -0
- package/mcp-server/extensions.js +6 -0
- package/mcp-server/extensions.js.map +1 -0
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/resources.d.ts +9 -4
- package/mcp-server/resources.d.ts.map +1 -1
- package/mcp-server/resources.js +36 -9
- package/mcp-server/resources.js.map +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +10 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/receiptsCreate.d.ts +9 -0
- package/mcp-server/tools/receiptsCreate.d.ts.map +1 -0
- package/mcp-server/tools/receiptsCreate.js +66 -0
- package/mcp-server/tools/receiptsCreate.js.map +1 -0
- package/mcp-server/tools/receiptsList.d.ts +8 -0
- package/mcp-server/tools/receiptsList.d.ts.map +1 -0
- package/mcp-server/tools/receiptsList.js +65 -0
- package/mcp-server/tools/receiptsList.js.map +1 -0
- package/models/components/achtransactiondetails.d.ts +2 -0
- package/models/components/achtransactiondetails.d.ts.map +1 -1
- package/models/components/achtransactiondetails.js +3 -0
- package/models/components/achtransactiondetails.js.map +1 -1
- package/models/components/achtransactionstatus.d.ts +3 -0
- package/models/components/achtransactionstatus.d.ts.map +1 -1
- package/models/components/achtransactionstatus.js +1 -0
- package/models/components/achtransactionstatus.js.map +1 -1
- package/models/components/createaccount.d.ts +6 -0
- package/models/components/createaccount.d.ts.map +1 -1
- package/models/components/createaccount.js +3 -0
- package/models/components/createaccount.js.map +1 -1
- package/models/components/createterminalapplication.d.ts +4 -4
- package/models/components/index.d.ts +4 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +4 -0
- package/models/components/index.js.map +1 -1
- package/models/components/receiptkind.d.ts +31 -0
- package/models/components/receiptkind.d.ts.map +1 -0
- package/models/components/receiptkind.js +63 -0
- package/models/components/receiptkind.js.map +1 -0
- package/models/components/receiptrequest.d.ts +76 -0
- package/models/components/receiptrequest.d.ts.map +1 -0
- package/models/components/receiptrequest.js +80 -0
- package/models/components/receiptrequest.js.map +1 -0
- package/models/components/receiptresponse.d.ts +94 -0
- package/models/components/receiptresponse.d.ts.map +1 -0
- package/models/components/receiptresponse.js +90 -0
- package/models/components/receiptresponse.js.map +1 -0
- package/models/components/sentreceipt.d.ts +42 -0
- package/models/components/sentreceipt.d.ts.map +1 -0
- package/models/components/sentreceipt.js +73 -0
- package/models/components/sentreceipt.js.map +1 -0
- package/models/components/terminalapplication.d.ts +4 -4
- package/models/errors/index.d.ts +1 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +1 -0
- package/models/errors/index.js.map +1 -1
- package/models/errors/receiptvalidationerror.d.ts +46 -0
- package/models/errors/receiptvalidationerror.d.ts.map +1 -0
- package/models/errors/receiptvalidationerror.js +98 -0
- package/models/errors/receiptvalidationerror.js.map +1 -0
- package/models/operations/createreceipts.d.ts +74 -0
- package/models/operations/createreceipts.d.ts.map +1 -0
- package/models/operations/createreceipts.js +118 -0
- package/models/operations/createreceipts.js.map +1 -0
- package/models/operations/index.d.ts +2 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +2 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listreceipts.d.ts +102 -0
- package/models/operations/listreceipts.d.ts.map +1 -0
- package/models/operations/listreceipts.js +145 -0
- package/models/operations/listreceipts.js.map +1 -0
- package/package.json +1 -1
- package/sdk/receipts.d.ts +20 -0
- package/sdk/receipts.d.ts.map +1 -0
- package/sdk/receipts.js +32 -0
- package/sdk/receipts.js.map +1 -0
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -0
- package/sdk/sdk.js.map +1 -1
- package/src/funcs/receiptsCreate.ts +190 -0
- package/src/funcs/receiptsList.ts +171 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/extensions.ts +13 -0
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/resources.ts +75 -14
- package/src/mcp-server/server.ts +20 -1
- package/src/mcp-server/tools/receiptsCreate.ts +39 -0
- package/src/mcp-server/tools/receiptsList.ts +38 -0
- package/src/models/components/achtransactiondetails.ts +5 -0
- package/src/models/components/achtransactionstatus.ts +1 -0
- package/src/models/components/createaccount.ts +8 -0
- package/src/models/components/createterminalapplication.ts +4 -4
- package/src/models/components/index.ts +4 -0
- package/src/models/components/receiptkind.ts +36 -0
- package/src/models/components/receiptrequest.ts +123 -0
- package/src/models/components/receiptresponse.ts +157 -0
- package/src/models/components/sentreceipt.ts +79 -0
- package/src/models/components/terminalapplication.ts +4 -4
- package/src/models/errors/index.ts +1 -0
- package/src/models/errors/receiptvalidationerror.ts +99 -0
- package/src/models/operations/createreceipts.ts +161 -0
- package/src/models/operations/index.ts +2 -0
- package/src/models/operations/listreceipts.ts +222 -0
- package/src/sdk/receipts.ts +46 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { MoovCore } from "../core.js";
|
|
6
|
+
import { encodeFormQuery, encodeSimple } from "../lib/encodings.js";
|
|
7
|
+
import * as M from "../lib/matchers.js";
|
|
8
|
+
import { compactMap } from "../lib/primitives.js";
|
|
9
|
+
import { safeParse } from "../lib/schemas.js";
|
|
10
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
11
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
12
|
+
import { pathToFunc } from "../lib/url.js";
|
|
13
|
+
import { APIError } from "../models/errors/apierror.js";
|
|
14
|
+
import {
|
|
15
|
+
ConnectionError,
|
|
16
|
+
InvalidRequestError,
|
|
17
|
+
RequestAbortedError,
|
|
18
|
+
RequestTimeoutError,
|
|
19
|
+
UnexpectedClientError,
|
|
20
|
+
} from "../models/errors/httpclienterrors.js";
|
|
21
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
|
+
import * as operations from "../models/operations/index.js";
|
|
23
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
24
|
+
import { Result } from "../types/fp.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* List receipts by trasnferID, scheduleID, or occurrenceID.
|
|
28
|
+
*
|
|
29
|
+
* To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
30
|
+
* you'll need to specify the `/accounts/{accountID}/transfers.read` scope.
|
|
31
|
+
*/
|
|
32
|
+
export function receiptsList(
|
|
33
|
+
client: MoovCore,
|
|
34
|
+
request: operations.ListReceiptsRequest,
|
|
35
|
+
options?: RequestOptions,
|
|
36
|
+
): APIPromise<
|
|
37
|
+
Result<
|
|
38
|
+
operations.ListReceiptsResponse,
|
|
39
|
+
| APIError
|
|
40
|
+
| SDKValidationError
|
|
41
|
+
| UnexpectedClientError
|
|
42
|
+
| InvalidRequestError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| ConnectionError
|
|
46
|
+
>
|
|
47
|
+
> {
|
|
48
|
+
return new APIPromise($do(
|
|
49
|
+
client,
|
|
50
|
+
request,
|
|
51
|
+
options,
|
|
52
|
+
));
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
async function $do(
|
|
56
|
+
client: MoovCore,
|
|
57
|
+
request: operations.ListReceiptsRequest,
|
|
58
|
+
options?: RequestOptions,
|
|
59
|
+
): Promise<
|
|
60
|
+
[
|
|
61
|
+
Result<
|
|
62
|
+
operations.ListReceiptsResponse,
|
|
63
|
+
| APIError
|
|
64
|
+
| SDKValidationError
|
|
65
|
+
| UnexpectedClientError
|
|
66
|
+
| InvalidRequestError
|
|
67
|
+
| RequestAbortedError
|
|
68
|
+
| RequestTimeoutError
|
|
69
|
+
| ConnectionError
|
|
70
|
+
>,
|
|
71
|
+
APICall,
|
|
72
|
+
]
|
|
73
|
+
> {
|
|
74
|
+
const parsed = safeParse(
|
|
75
|
+
request,
|
|
76
|
+
(value) => operations.ListReceiptsRequest$outboundSchema.parse(value),
|
|
77
|
+
"Input validation failed",
|
|
78
|
+
);
|
|
79
|
+
if (!parsed.ok) {
|
|
80
|
+
return [parsed, { status: "invalid" }];
|
|
81
|
+
}
|
|
82
|
+
const payload = parsed.value;
|
|
83
|
+
const body = null;
|
|
84
|
+
|
|
85
|
+
const path = pathToFunc("/receipts")();
|
|
86
|
+
|
|
87
|
+
const query = encodeFormQuery({
|
|
88
|
+
"id": payload.id,
|
|
89
|
+
}, { explode: false });
|
|
90
|
+
|
|
91
|
+
const headers = new Headers(compactMap({
|
|
92
|
+
Accept: "application/json",
|
|
93
|
+
"x-moov-version": encodeSimple(
|
|
94
|
+
"x-moov-version",
|
|
95
|
+
client._options.xMoovVersion,
|
|
96
|
+
{ explode: false, charEncoding: "none" },
|
|
97
|
+
),
|
|
98
|
+
}));
|
|
99
|
+
|
|
100
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
101
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
102
|
+
|
|
103
|
+
const context = {
|
|
104
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
105
|
+
operationID: "listReceipts",
|
|
106
|
+
oAuth2Scopes: [],
|
|
107
|
+
|
|
108
|
+
resolvedSecurity: requestSecurity,
|
|
109
|
+
|
|
110
|
+
securitySource: client._options.security,
|
|
111
|
+
retryConfig: options?.retries
|
|
112
|
+
|| client._options.retryConfig
|
|
113
|
+
|| { strategy: "none" },
|
|
114
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const requestRes = client._createRequest(context, {
|
|
118
|
+
security: requestSecurity,
|
|
119
|
+
method: "GET",
|
|
120
|
+
baseURL: options?.serverURL,
|
|
121
|
+
path: path,
|
|
122
|
+
headers: headers,
|
|
123
|
+
query: query,
|
|
124
|
+
body: body,
|
|
125
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
126
|
+
}, options);
|
|
127
|
+
if (!requestRes.ok) {
|
|
128
|
+
return [requestRes, { status: "invalid" }];
|
|
129
|
+
}
|
|
130
|
+
const req = requestRes.value;
|
|
131
|
+
|
|
132
|
+
const doResult = await client._do(req, {
|
|
133
|
+
context,
|
|
134
|
+
errorCodes: ["401", "403", "429", "4XX", "500", "504", "5XX"],
|
|
135
|
+
retryConfig: context.retryConfig,
|
|
136
|
+
retryCodes: context.retryCodes,
|
|
137
|
+
});
|
|
138
|
+
if (!doResult.ok) {
|
|
139
|
+
return [doResult, { status: "request-error", request: req }];
|
|
140
|
+
}
|
|
141
|
+
const response = doResult.value;
|
|
142
|
+
|
|
143
|
+
const responseFields = {
|
|
144
|
+
HttpMeta: { Response: response, Request: req },
|
|
145
|
+
};
|
|
146
|
+
|
|
147
|
+
const [result] = await M.match<
|
|
148
|
+
operations.ListReceiptsResponse,
|
|
149
|
+
| APIError
|
|
150
|
+
| SDKValidationError
|
|
151
|
+
| UnexpectedClientError
|
|
152
|
+
| InvalidRequestError
|
|
153
|
+
| RequestAbortedError
|
|
154
|
+
| RequestTimeoutError
|
|
155
|
+
| ConnectionError
|
|
156
|
+
>(
|
|
157
|
+
M.json(200, operations.ListReceiptsResponse$inboundSchema, {
|
|
158
|
+
hdrs: true,
|
|
159
|
+
key: "Result",
|
|
160
|
+
}),
|
|
161
|
+
M.fail([401, 403, 429]),
|
|
162
|
+
M.fail([500, 504]),
|
|
163
|
+
M.fail("4XX"),
|
|
164
|
+
M.fail("5XX"),
|
|
165
|
+
)(response, { extraFields: responseFields });
|
|
166
|
+
if (!result.ok) {
|
|
167
|
+
return [result, { status: "complete", request: req, response }];
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return [result, { status: "complete", request: req, response }];
|
|
171
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -69,7 +69,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
69
69
|
export const SDK_METADATA = {
|
|
70
70
|
language: "typescript",
|
|
71
71
|
openapiDocVersion: "latest",
|
|
72
|
-
sdkVersion: "0.
|
|
73
|
-
genVersion: "2.
|
|
74
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
72
|
+
sdkVersion: "0.7.0",
|
|
73
|
+
genVersion: "2.545.2",
|
|
74
|
+
userAgent: "speakeasy-sdk/typescript 0.7.0 2.545.2 latest @moovio/sdk",
|
|
75
75
|
} as const;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { ZodRawShape } from "zod";
|
|
6
|
+
import { ResourceDefinition, ResourceTemplateDefinition } from "./resources.js";
|
|
7
|
+
import { ToolDefinition } from "./tools.js";
|
|
8
|
+
|
|
9
|
+
export type Register = {
|
|
10
|
+
tool: <A extends ZodRawShape | undefined>(def: ToolDefinition<A>) => void;
|
|
11
|
+
resource: (def: ResourceDefinition) => void;
|
|
12
|
+
resourceTemplate: (def: ResourceTemplateDefinition) => void;
|
|
13
|
+
};
|
|
@@ -2,12 +2,16 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
McpServer,
|
|
7
|
+
ResourceMetadata,
|
|
8
|
+
ResourceTemplate,
|
|
9
|
+
} from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
6
10
|
import { RequestHandlerExtra } from "@modelcontextprotocol/sdk/shared/protocol.js";
|
|
7
11
|
import { Variables } from "@modelcontextprotocol/sdk/shared/uriTemplate.js";
|
|
8
12
|
import { ReadResourceResult } from "@modelcontextprotocol/sdk/types.js";
|
|
9
13
|
import { MoovCore } from "../core.js";
|
|
10
|
-
import {
|
|
14
|
+
import { ConsoleLogger } from "./console-logger.js";
|
|
11
15
|
import { MCPScope } from "./scopes.js";
|
|
12
16
|
import { isAsyncIterable, isBinaryData, valueToBase64 } from "./shared.js";
|
|
13
17
|
|
|
@@ -19,7 +23,8 @@ export type ReadResourceCallback = (
|
|
|
19
23
|
|
|
20
24
|
export type ResourceDefinition = {
|
|
21
25
|
name: string;
|
|
22
|
-
description
|
|
26
|
+
description?: string;
|
|
27
|
+
metadata?: ResourceMetadata;
|
|
23
28
|
scopes?: MCPScope[];
|
|
24
29
|
resource: string;
|
|
25
30
|
read: ReadResourceCallback;
|
|
@@ -35,30 +40,27 @@ export type ReadResourceTemplateCallback = (
|
|
|
35
40
|
export type ResourceTemplateDefinition = {
|
|
36
41
|
name: string;
|
|
37
42
|
description: string;
|
|
43
|
+
metadata?: ResourceMetadata;
|
|
38
44
|
scopes?: MCPScope[];
|
|
39
45
|
resource: ResourceTemplate;
|
|
40
46
|
read: ReadResourceTemplateCallback;
|
|
41
47
|
};
|
|
42
48
|
|
|
43
49
|
export async function formatResult(
|
|
44
|
-
|
|
50
|
+
value: unknown,
|
|
45
51
|
uri: URL,
|
|
46
|
-
init: { response?: Response | undefined },
|
|
52
|
+
init: { mimeType?: string | undefined; response?: Response | undefined },
|
|
47
53
|
): Promise<ReadResourceResult> {
|
|
48
|
-
if (!result.ok) {
|
|
49
|
-
throw result.error;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const { value } = result;
|
|
53
54
|
if (typeof value === "undefined") {
|
|
54
55
|
return { contents: [] };
|
|
55
56
|
}
|
|
56
57
|
|
|
57
|
-
const { response } = init;
|
|
58
|
-
const mimeType = response?.headers.get("content-type") ?? "";
|
|
59
58
|
let contents: ReadResourceResult["contents"] = [];
|
|
60
59
|
|
|
61
|
-
|
|
60
|
+
const mimeType = init.mimeType ?? init.response?.headers.get("content-type")
|
|
61
|
+
?? "";
|
|
62
|
+
|
|
63
|
+
if (mimeType.search(/\bjson\b/g) !== -1) {
|
|
62
64
|
contents = [{ uri: uri.toString(), mimeType, text: JSON.stringify(value) }];
|
|
63
65
|
} else if (
|
|
64
66
|
mimeType.startsWith("text/event-stream")
|
|
@@ -71,7 +73,10 @@ export async function formatResult(
|
|
|
71
73
|
text: await stringifySSEToJSON(value),
|
|
72
74
|
},
|
|
73
75
|
];
|
|
74
|
-
} else if (
|
|
76
|
+
} else if (
|
|
77
|
+
(mimeType.startsWith("text/") || mimeType.startsWith("application/"))
|
|
78
|
+
&& typeof value === "string"
|
|
79
|
+
) {
|
|
75
80
|
contents = [{ uri: uri.toString(), mimeType, text: value }];
|
|
76
81
|
} else if (isBinaryData(value)) {
|
|
77
82
|
const blob = await valueToBase64(value);
|
|
@@ -94,3 +99,59 @@ async function stringifySSEToJSON(
|
|
|
94
99
|
|
|
95
100
|
return JSON.stringify(payloads);
|
|
96
101
|
}
|
|
102
|
+
|
|
103
|
+
export function createRegisterResource(
|
|
104
|
+
logger: ConsoleLogger,
|
|
105
|
+
server: McpServer,
|
|
106
|
+
sdk: MoovCore,
|
|
107
|
+
allowedScopes: Set<MCPScope>,
|
|
108
|
+
): (resource: ResourceDefinition) => void {
|
|
109
|
+
return (resource: ResourceDefinition): void => {
|
|
110
|
+
const scopes = resource.scopes ?? [];
|
|
111
|
+
if (!scopes.every((s: MCPScope) => allowedScopes.has(s))) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const metadata: ResourceMetadata = {
|
|
116
|
+
...resource.metadata,
|
|
117
|
+
description: resource.description,
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
server.resource(
|
|
121
|
+
resource.name,
|
|
122
|
+
resource.resource,
|
|
123
|
+
metadata,
|
|
124
|
+
async (uri, ctx) => resource.read(sdk, uri, ctx),
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
logger.debug("Registered resource", { name: resource.name });
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function createRegisterResourceTemplate(
|
|
132
|
+
logger: ConsoleLogger,
|
|
133
|
+
server: McpServer,
|
|
134
|
+
sdk: MoovCore,
|
|
135
|
+
allowedScopes: Set<MCPScope>,
|
|
136
|
+
): (resource: ResourceTemplateDefinition) => void {
|
|
137
|
+
return (resource: ResourceTemplateDefinition): void => {
|
|
138
|
+
const scopes = resource.scopes ?? [];
|
|
139
|
+
if (!scopes.every((s: MCPScope) => allowedScopes.has(s))) {
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
const metadata: ResourceMetadata = {
|
|
144
|
+
...resource.metadata,
|
|
145
|
+
description: resource.description,
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
server.resource(
|
|
149
|
+
resource.name,
|
|
150
|
+
resource.resource,
|
|
151
|
+
metadata,
|
|
152
|
+
async (uri, vars, ctx) => resource.read(sdk, uri, vars, ctx),
|
|
153
|
+
);
|
|
154
|
+
|
|
155
|
+
logger.debug("Registered resource template", { name: resource.name });
|
|
156
|
+
};
|
|
157
|
+
}
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -6,6 +6,10 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
|
6
6
|
import { MoovCore } from "../core.js";
|
|
7
7
|
import { SDKOptions } from "../lib/config.js";
|
|
8
8
|
import type { ConsoleLogger } from "./console-logger.js";
|
|
9
|
+
import {
|
|
10
|
+
createRegisterResource,
|
|
11
|
+
createRegisterResourceTemplate,
|
|
12
|
+
} from "./resources.js";
|
|
9
13
|
import { MCPScope, mcpScopes } from "./scopes.js";
|
|
10
14
|
import { createRegisterTool } from "./tools.js";
|
|
11
15
|
import { tool$accountsAssignCountries } from "./tools/accountsAssignCountries.js";
|
|
@@ -99,6 +103,8 @@ import { tool$paymentLinksUpdate } from "./tools/paymentLinksUpdate.js";
|
|
|
99
103
|
import { tool$paymentMethodsGet } from "./tools/paymentMethodsGet.js";
|
|
100
104
|
import { tool$paymentMethodsList } from "./tools/paymentMethodsList.js";
|
|
101
105
|
import { tool$pingPing } from "./tools/pingPing.js";
|
|
106
|
+
import { tool$receiptsCreate } from "./tools/receiptsCreate.js";
|
|
107
|
+
import { tool$receiptsList } from "./tools/receiptsList.js";
|
|
102
108
|
import { tool$representativesCreate } from "./tools/representativesCreate.js";
|
|
103
109
|
import { tool$representativesDelete } from "./tools/representativesDelete.js";
|
|
104
110
|
import { tool$representativesGet } from "./tools/representativesGet.js";
|
|
@@ -149,7 +155,7 @@ export function createMCPServer(deps: {
|
|
|
149
155
|
}) {
|
|
150
156
|
const server = new McpServer({
|
|
151
157
|
name: "Moov",
|
|
152
|
-
version: "0.
|
|
158
|
+
version: "0.7.0",
|
|
153
159
|
});
|
|
154
160
|
|
|
155
161
|
const client = new MoovCore({
|
|
@@ -158,7 +164,9 @@ export function createMCPServer(deps: {
|
|
|
158
164
|
serverURL: deps.serverURL,
|
|
159
165
|
serverIdx: deps.serverIdx,
|
|
160
166
|
});
|
|
167
|
+
|
|
161
168
|
const scopes = new Set(deps.scopes ?? mcpScopes);
|
|
169
|
+
|
|
162
170
|
const allowedTools = deps.allowedTools && new Set(deps.allowedTools);
|
|
163
171
|
const tool = createRegisterTool(
|
|
164
172
|
deps.logger,
|
|
@@ -167,6 +175,15 @@ export function createMCPServer(deps: {
|
|
|
167
175
|
scopes,
|
|
168
176
|
allowedTools,
|
|
169
177
|
);
|
|
178
|
+
const resource = createRegisterResource(deps.logger, server, client, scopes);
|
|
179
|
+
const resourceTemplate = createRegisterResourceTemplate(
|
|
180
|
+
deps.logger,
|
|
181
|
+
server,
|
|
182
|
+
client,
|
|
183
|
+
scopes,
|
|
184
|
+
);
|
|
185
|
+
const register = { tool, resource, resourceTemplate };
|
|
186
|
+
void register; // suppress unused warnings
|
|
170
187
|
|
|
171
188
|
tool(tool$accountsCreate);
|
|
172
189
|
tool(tool$accountsList);
|
|
@@ -293,6 +310,8 @@ export function createMCPServer(deps: {
|
|
|
293
310
|
tool(tool$onboardingGetInvite);
|
|
294
311
|
tool(tool$onboardingRevokeInvite);
|
|
295
312
|
tool(tool$pingPing);
|
|
313
|
+
tool(tool$receiptsCreate);
|
|
314
|
+
tool(tool$receiptsList);
|
|
296
315
|
tool(tool$terminalApplicationsCreate);
|
|
297
316
|
tool(tool$terminalApplicationsList);
|
|
298
317
|
tool(tool$terminalApplicationsGet);
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { receiptsCreate } from "../../funcs/receiptsCreate.js";
|
|
7
|
+
import * as components from "../../models/components/index.js";
|
|
8
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
9
|
+
|
|
10
|
+
const args = {
|
|
11
|
+
request: z.array(components.ReceiptRequest$inboundSchema),
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const tool$receiptsCreate: ToolDefinition<typeof args> = {
|
|
15
|
+
name: "receipts_create",
|
|
16
|
+
description: ` Create receipts for transfers and scheduled transfers.
|
|
17
|
+
|
|
18
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
19
|
+
you'll need to specify the \`/accounts/{accountID}/transfers.write\` scope.`,
|
|
20
|
+
args,
|
|
21
|
+
tool: async (client, args, ctx) => {
|
|
22
|
+
const [result, apiCall] = await receiptsCreate(
|
|
23
|
+
client,
|
|
24
|
+
args.request,
|
|
25
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
26
|
+
).$inspect();
|
|
27
|
+
|
|
28
|
+
if (!result.ok) {
|
|
29
|
+
return {
|
|
30
|
+
content: [{ type: "text", text: result.error.message }],
|
|
31
|
+
isError: true,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const value = result.value.result;
|
|
36
|
+
|
|
37
|
+
return formatResult(value, apiCall);
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { receiptsList } from "../../funcs/receiptsList.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.ListReceiptsRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$receiptsList: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "receipts_list",
|
|
15
|
+
description: `List receipts by trasnferID, scheduleID, or occurrenceID.
|
|
16
|
+
|
|
17
|
+
To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
18
|
+
you'll need to specify the \`/accounts/{accountID}/transfers.read\` scope.`,
|
|
19
|
+
args,
|
|
20
|
+
tool: async (client, args, ctx) => {
|
|
21
|
+
const [result, apiCall] = await receiptsList(
|
|
22
|
+
client,
|
|
23
|
+
args.request,
|
|
24
|
+
{ fetchOptions: { signal: ctx.signal } },
|
|
25
|
+
).$inspect();
|
|
26
|
+
|
|
27
|
+
if (!result.ok) {
|
|
28
|
+
return {
|
|
29
|
+
content: [{ type: "text", text: result.error.message }],
|
|
30
|
+
isError: true,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const value = result.value.result;
|
|
35
|
+
|
|
36
|
+
return formatResult(value, apiCall);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
@@ -51,6 +51,7 @@ export type ACHTransactionDetails = {
|
|
|
51
51
|
* Code used to identify the ACH authorization method.
|
|
52
52
|
*/
|
|
53
53
|
secCode?: SECCode | undefined;
|
|
54
|
+
canceledOn?: Date | undefined;
|
|
54
55
|
initiatedOn?: Date | undefined;
|
|
55
56
|
originatedOn?: Date | undefined;
|
|
56
57
|
correctedOn?: Date | undefined;
|
|
@@ -76,6 +77,8 @@ export const ACHTransactionDetails$inboundSchema: z.ZodType<
|
|
|
76
77
|
companyEntryDescription: z.string().optional(),
|
|
77
78
|
originatingCompanyName: z.string().optional(),
|
|
78
79
|
secCode: SECCode$inboundSchema.optional(),
|
|
80
|
+
canceledOn: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
81
|
+
.optional(),
|
|
79
82
|
initiatedOn: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
80
83
|
.optional(),
|
|
81
84
|
originatedOn: z.string().datetime({ offset: true }).transform(v =>
|
|
@@ -101,6 +104,7 @@ export type ACHTransactionDetails$Outbound = {
|
|
|
101
104
|
companyEntryDescription?: string | undefined;
|
|
102
105
|
originatingCompanyName?: string | undefined;
|
|
103
106
|
secCode?: string | undefined;
|
|
107
|
+
canceledOn?: string | undefined;
|
|
104
108
|
initiatedOn?: string | undefined;
|
|
105
109
|
originatedOn?: string | undefined;
|
|
106
110
|
correctedOn?: string | undefined;
|
|
@@ -123,6 +127,7 @@ export const ACHTransactionDetails$outboundSchema: z.ZodType<
|
|
|
123
127
|
companyEntryDescription: z.string().optional(),
|
|
124
128
|
originatingCompanyName: z.string().optional(),
|
|
125
129
|
secCode: SECCode$outboundSchema.optional(),
|
|
130
|
+
canceledOn: z.date().transform(v => v.toISOString()).optional(),
|
|
126
131
|
initiatedOn: z.date().transform(v => v.toISOString()).optional(),
|
|
127
132
|
originatedOn: z.date().transform(v => v.toISOString()).optional(),
|
|
128
133
|
correctedOn: z.date().transform(v => v.toISOString()).optional(),
|
|
@@ -34,6 +34,7 @@ import {
|
|
|
34
34
|
ManualTermsOfService$Outbound,
|
|
35
35
|
ManualTermsOfService$outboundSchema,
|
|
36
36
|
} from "./manualtermsofservice.js";
|
|
37
|
+
import { Mode, Mode$inboundSchema, Mode$outboundSchema } from "./mode.js";
|
|
37
38
|
import {
|
|
38
39
|
Settings,
|
|
39
40
|
Settings$inboundSchema,
|
|
@@ -78,6 +79,10 @@ export type CreateAccount = {
|
|
|
78
79
|
*/
|
|
79
80
|
settings?: Settings | undefined;
|
|
80
81
|
capabilities?: Array<CapabilityID> | undefined;
|
|
82
|
+
/**
|
|
83
|
+
* The operating mode for an account.
|
|
84
|
+
*/
|
|
85
|
+
mode?: Mode | undefined;
|
|
81
86
|
};
|
|
82
87
|
|
|
83
88
|
/** @internal */
|
|
@@ -155,6 +160,7 @@ export const CreateAccount$inboundSchema: z.ZodType<
|
|
|
155
160
|
customerSupport: CustomerSupport$inboundSchema.optional(),
|
|
156
161
|
settings: Settings$inboundSchema.optional(),
|
|
157
162
|
capabilities: z.array(CapabilityID$inboundSchema).optional(),
|
|
163
|
+
mode: Mode$inboundSchema.optional(),
|
|
158
164
|
});
|
|
159
165
|
|
|
160
166
|
/** @internal */
|
|
@@ -170,6 +176,7 @@ export type CreateAccount$Outbound = {
|
|
|
170
176
|
customerSupport?: CustomerSupport$Outbound | undefined;
|
|
171
177
|
settings?: Settings$Outbound | undefined;
|
|
172
178
|
capabilities?: Array<string> | undefined;
|
|
179
|
+
mode?: string | undefined;
|
|
173
180
|
};
|
|
174
181
|
|
|
175
182
|
/** @internal */
|
|
@@ -189,6 +196,7 @@ export const CreateAccount$outboundSchema: z.ZodType<
|
|
|
189
196
|
customerSupport: CustomerSupport$outboundSchema.optional(),
|
|
190
197
|
settings: Settings$outboundSchema.optional(),
|
|
191
198
|
capabilities: z.array(CapabilityID$outboundSchema).optional(),
|
|
199
|
+
mode: Mode$outboundSchema.optional(),
|
|
192
200
|
});
|
|
193
201
|
|
|
194
202
|
/**
|
|
@@ -21,19 +21,19 @@ export type CreateTerminalApplication = {
|
|
|
21
21
|
*/
|
|
22
22
|
platform: TerminalApplicationPlatform;
|
|
23
23
|
/**
|
|
24
|
-
* The app bundle identifier of the terminal application. Required if platform is ios
|
|
24
|
+
* The app bundle identifier of the terminal application. Required if platform is `ios`.
|
|
25
25
|
*/
|
|
26
26
|
appBundleID?: string | undefined;
|
|
27
27
|
/**
|
|
28
|
-
* The app package name of the terminal application. Required if platform is android
|
|
28
|
+
* The app package name of the terminal application. Required if platform is `android`.
|
|
29
29
|
*/
|
|
30
30
|
packageName?: string | undefined;
|
|
31
31
|
/**
|
|
32
|
-
* The app version of the terminal application. Required if paltform is android
|
|
32
|
+
* The app version of the terminal application. Required if paltform is `android`.
|
|
33
33
|
*/
|
|
34
34
|
sha256Digest?: string | undefined;
|
|
35
35
|
/**
|
|
36
|
-
* The app version of the terminal application. Required if platform is android
|
|
36
|
+
* The app version of the terminal application. Required if platform is `android`.
|
|
37
37
|
*/
|
|
38
38
|
versionCode?: string | undefined;
|
|
39
39
|
};
|
|
@@ -269,6 +269,9 @@ export * from "./profile.js";
|
|
|
269
269
|
export * from "./pullfromcardpaymentmethod.js";
|
|
270
270
|
export * from "./pushtocardpaymentmethod.js";
|
|
271
271
|
export * from "./qrcode.js";
|
|
272
|
+
export * from "./receiptkind.js";
|
|
273
|
+
export * from "./receiptrequest.js";
|
|
274
|
+
export * from "./receiptresponse.js";
|
|
272
275
|
export * from "./recur.js";
|
|
273
276
|
export * from "./refundcarddetails.js";
|
|
274
277
|
export * from "./refundcardstatus.js";
|
|
@@ -296,6 +299,7 @@ export * from "./schedulepaymentmethod.js";
|
|
|
296
299
|
export * from "./scheduleresponse.js";
|
|
297
300
|
export * from "./seccode.js";
|
|
298
301
|
export * from "./security.js";
|
|
302
|
+
export * from "./sentreceipt.js";
|
|
299
303
|
export * from "./settings.js";
|
|
300
304
|
export * from "./sourcedestinationoptions.js";
|
|
301
305
|
export * from "./sweep.js";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { ClosedEnum } from "../../types/enums.js";
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* The type of receipt being requested.
|
|
10
|
+
*/
|
|
11
|
+
export const ReceiptKind = {
|
|
12
|
+
SaleCustomerV1: "sale.customer.v1",
|
|
13
|
+
} as const;
|
|
14
|
+
/**
|
|
15
|
+
* The type of receipt being requested.
|
|
16
|
+
*/
|
|
17
|
+
export type ReceiptKind = ClosedEnum<typeof ReceiptKind>;
|
|
18
|
+
|
|
19
|
+
/** @internal */
|
|
20
|
+
export const ReceiptKind$inboundSchema: z.ZodNativeEnum<typeof ReceiptKind> = z
|
|
21
|
+
.nativeEnum(ReceiptKind);
|
|
22
|
+
|
|
23
|
+
/** @internal */
|
|
24
|
+
export const ReceiptKind$outboundSchema: z.ZodNativeEnum<typeof ReceiptKind> =
|
|
25
|
+
ReceiptKind$inboundSchema;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @internal
|
|
29
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
30
|
+
*/
|
|
31
|
+
export namespace ReceiptKind$ {
|
|
32
|
+
/** @deprecated use `ReceiptKind$inboundSchema` instead. */
|
|
33
|
+
export const inboundSchema = ReceiptKind$inboundSchema;
|
|
34
|
+
/** @deprecated use `ReceiptKind$outboundSchema` instead. */
|
|
35
|
+
export const outboundSchema = ReceiptKind$outboundSchema;
|
|
36
|
+
}
|