@moovio/sdk 0.13.0 → 0.14.1
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 +81 -36
- package/bin/mcp-server.js +1530 -341
- package/bin/mcp-server.js.map +37 -13
- package/docs/sdks/support/README.md +476 -0
- package/funcs/supportCreateTicket.d.ts +18 -0
- package/funcs/supportCreateTicket.d.ts.map +1 -0
- package/funcs/supportCreateTicket.js +139 -0
- package/funcs/supportCreateTicket.js.map +1 -0
- package/funcs/supportGetTicket.d.ts +17 -0
- package/funcs/supportGetTicket.d.ts.map +1 -0
- package/funcs/supportGetTicket.js +129 -0
- package/funcs/supportGetTicket.js.map +1 -0
- package/funcs/supportListTicketMessages.d.ts +17 -0
- package/funcs/supportListTicketMessages.d.ts.map +1 -0
- package/funcs/supportListTicketMessages.js +134 -0
- package/funcs/supportListTicketMessages.js.map +1 -0
- package/funcs/supportListTickets.d.ts +17 -0
- package/funcs/supportListTickets.d.ts.map +1 -0
- package/funcs/supportListTickets.js +130 -0
- package/funcs/supportListTickets.js.map +1 -0
- package/funcs/supportUpdateTicket.d.ts +18 -0
- package/funcs/supportUpdateTicket.d.ts.map +1 -0
- package/funcs/supportUpdateTicket.js +143 -0
- package/funcs/supportUpdateTicket.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/cli/start/command.d.ts.map +1 -1
- package/mcp-server/cli/start/command.js +0 -12
- package/mcp-server/cli/start/command.js.map +1 -1
- package/mcp-server/cli/start/impl.d.ts +0 -2
- package/mcp-server/cli/start/impl.d.ts.map +1 -1
- package/mcp-server/cli/start/impl.js +0 -2
- package/mcp-server/cli/start/impl.js.map +1 -1
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +11 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/supportCreateTicket.d.ts +8 -0
- package/mcp-server/tools/supportCreateTicket.d.ts.map +1 -0
- package/mcp-server/tools/supportCreateTicket.js +65 -0
- package/mcp-server/tools/supportCreateTicket.js.map +1 -0
- package/mcp-server/tools/supportGetTicket.d.ts +8 -0
- package/mcp-server/tools/supportGetTicket.d.ts.map +1 -0
- package/mcp-server/tools/supportGetTicket.js +65 -0
- package/mcp-server/tools/supportGetTicket.js.map +1 -0
- package/mcp-server/tools/supportListTicketMessages.d.ts +8 -0
- package/mcp-server/tools/supportListTicketMessages.d.ts.map +1 -0
- package/mcp-server/tools/supportListTicketMessages.js +65 -0
- package/mcp-server/tools/supportListTicketMessages.js.map +1 -0
- package/mcp-server/tools/supportListTickets.d.ts +8 -0
- package/mcp-server/tools/supportListTickets.d.ts.map +1 -0
- package/mcp-server/tools/supportListTickets.js +65 -0
- package/mcp-server/tools/supportListTickets.js.map +1 -0
- package/mcp-server/tools/supportUpdateTicket.d.ts +8 -0
- package/mcp-server/tools/supportUpdateTicket.d.ts.map +1 -0
- package/mcp-server/tools/supportUpdateTicket.js +65 -0
- package/mcp-server/tools/supportUpdateTicket.js.map +1 -0
- package/models/components/createticket.d.ts +37 -0
- package/models/components/createticket.d.ts.map +1 -0
- package/models/components/createticket.js +74 -0
- package/models/components/createticket.js.map +1 -0
- package/models/components/createticketcontacterror.d.ts +31 -0
- package/models/components/createticketcontacterror.d.ts.map +1 -0
- package/models/components/createticketcontacterror.js +71 -0
- package/models/components/createticketcontacterror.js.map +1 -0
- package/models/components/index.d.ts +8 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +8 -0
- package/models/components/index.js.map +1 -1
- package/models/components/ticket.d.ts +47 -0
- package/models/components/ticket.d.ts.map +1 -0
- package/models/components/ticket.js +89 -0
- package/models/components/ticket.js.map +1 -0
- package/models/components/ticketcontact.d.ts +31 -0
- package/models/components/ticketcontact.d.ts.map +1 -0
- package/models/components/ticketcontact.js +71 -0
- package/models/components/ticketcontact.js.map +1 -0
- package/models/components/ticketmessage.d.ts +33 -0
- package/models/components/ticketmessage.d.ts.map +1 -0
- package/models/components/ticketmessage.js +73 -0
- package/models/components/ticketmessage.js.map +1 -0
- package/models/components/ticketstatus.d.ts +34 -0
- package/models/components/ticketstatus.d.ts.map +1 -0
- package/models/components/ticketstatus.js +62 -0
- package/models/components/ticketstatus.js.map +1 -0
- package/models/components/updateticket.d.ts +33 -0
- package/models/components/updateticket.d.ts.map +1 -0
- package/models/components/updateticket.js +70 -0
- package/models/components/updateticket.js.map +1 -0
- package/models/components/updateticketstatus.d.ts +25 -0
- package/models/components/updateticketstatus.d.ts.map +1 -0
- package/models/components/updateticketstatus.js +59 -0
- package/models/components/updateticketstatus.js.map +1 -0
- package/models/errors/apierror.d.ts.map +1 -1
- package/models/errors/apierror.js +8 -2
- package/models/errors/apierror.js.map +1 -1
- package/models/errors/createticketerror.d.ts +42 -0
- package/models/errors/createticketerror.d.ts.map +1 -0
- package/models/errors/createticketerror.js +93 -0
- package/models/errors/createticketerror.js.map +1 -0
- package/models/errors/index.d.ts +2 -0
- package/models/errors/index.d.ts.map +1 -1
- package/models/errors/index.js +2 -0
- package/models/errors/index.js.map +1 -1
- package/models/errors/updateticketerror.d.ts +36 -0
- package/models/errors/updateticketerror.d.ts.map +1 -0
- package/models/errors/updateticketerror.js +86 -0
- package/models/errors/updateticketerror.js.map +1 -0
- package/models/operations/createticket.d.ts +101 -0
- package/models/operations/createticket.d.ts.map +1 -0
- package/models/operations/createticket.js +155 -0
- package/models/operations/createticket.js.map +1 -0
- package/models/operations/getticket.d.ts +101 -0
- package/models/operations/getticket.d.ts.map +1 -0
- package/models/operations/getticket.js +147 -0
- package/models/operations/getticket.js.map +1 -0
- package/models/operations/index.d.ts +5 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +5 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/listticketmessages.d.ts +105 -0
- package/models/operations/listticketmessages.d.ts.map +1 -0
- package/models/operations/listticketmessages.js +151 -0
- package/models/operations/listticketmessages.js.map +1 -0
- package/models/operations/listtickets.d.ts +103 -0
- package/models/operations/listtickets.d.ts.map +1 -0
- package/models/operations/listtickets.js +149 -0
- package/models/operations/listtickets.js.map +1 -0
- package/models/operations/updateticket.d.ts +103 -0
- package/models/operations/updateticket.d.ts.map +1 -0
- package/models/operations/updateticket.js +157 -0
- package/models/operations/updateticket.js.map +1 -0
- package/package.json +1 -1
- 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/sdk/support.d.ts +40 -0
- package/sdk/support.d.ts.map +1 -0
- package/sdk/support.js +62 -0
- package/sdk/support.js.map +1 -0
- package/src/funcs/supportCreateTicket.ts +201 -0
- package/src/funcs/supportGetTicket.ts +185 -0
- package/src/funcs/supportListTicketMessages.ts +191 -0
- package/src/funcs/supportListTickets.ts +185 -0
- package/src/funcs/supportUpdateTicket.ts +207 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/cli/start/command.ts +0 -13
- package/src/mcp-server/cli/start/impl.ts +0 -4
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +11 -1
- package/src/mcp-server/tools/supportCreateTicket.ts +38 -0
- package/src/mcp-server/tools/supportGetTicket.ts +38 -0
- package/src/mcp-server/tools/supportListTicketMessages.ts +38 -0
- package/src/mcp-server/tools/supportListTickets.ts +38 -0
- package/src/mcp-server/tools/supportUpdateTicket.ts +38 -0
- package/src/models/components/createticket.ts +79 -0
- package/src/models/components/createticketcontacterror.ts +70 -0
- package/src/models/components/index.ts +8 -0
- package/src/models/components/ticket.ts +109 -0
- package/src/models/components/ticketcontact.ts +66 -0
- package/src/models/components/ticketmessage.ts +70 -0
- package/src/models/components/ticketstatus.ts +33 -0
- package/src/models/components/updateticket.ts +70 -0
- package/src/models/components/updateticketstatus.ts +32 -0
- package/src/models/errors/apierror.ts +8 -2
- package/src/models/errors/createticketerror.ts +90 -0
- package/src/models/errors/index.ts +2 -0
- package/src/models/errors/updateticketerror.ts +79 -0
- package/src/models/operations/createticket.ts +231 -0
- package/src/models/operations/getticket.ts +223 -0
- package/src/models/operations/index.ts +5 -0
- package/src/models/operations/listticketmessages.ts +231 -0
- package/src/models/operations/listtickets.ts +227 -0
- package/src/models/operations/updateticket.ts +235 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/support.ts +99 -0
- package/src/__tests__/mockserver/README.md +0 -52
|
@@ -0,0 +1,185 @@
|
|
|
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 {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import { MoovError } from "../models/errors/mooverror.js";
|
|
21
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
22
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
25
|
+
import { Result } from "../types/fp.js";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* List all the support tickets created under a Moov account.
|
|
29
|
+
*
|
|
30
|
+
* To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
31
|
+
* you'll need to specify the `/accounts/{accountID}/support.read` scope.
|
|
32
|
+
*/
|
|
33
|
+
export function supportListTickets(
|
|
34
|
+
client: MoovCore,
|
|
35
|
+
request: operations.ListTicketsRequest,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): APIPromise<
|
|
38
|
+
Result<
|
|
39
|
+
operations.ListTicketsResponse,
|
|
40
|
+
| MoovError
|
|
41
|
+
| ResponseValidationError
|
|
42
|
+
| ConnectionError
|
|
43
|
+
| RequestAbortedError
|
|
44
|
+
| RequestTimeoutError
|
|
45
|
+
| InvalidRequestError
|
|
46
|
+
| UnexpectedClientError
|
|
47
|
+
| SDKValidationError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
return new APIPromise($do(
|
|
51
|
+
client,
|
|
52
|
+
request,
|
|
53
|
+
options,
|
|
54
|
+
));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async function $do(
|
|
58
|
+
client: MoovCore,
|
|
59
|
+
request: operations.ListTicketsRequest,
|
|
60
|
+
options?: RequestOptions,
|
|
61
|
+
): Promise<
|
|
62
|
+
[
|
|
63
|
+
Result<
|
|
64
|
+
operations.ListTicketsResponse,
|
|
65
|
+
| MoovError
|
|
66
|
+
| ResponseValidationError
|
|
67
|
+
| ConnectionError
|
|
68
|
+
| RequestAbortedError
|
|
69
|
+
| RequestTimeoutError
|
|
70
|
+
| InvalidRequestError
|
|
71
|
+
| UnexpectedClientError
|
|
72
|
+
| SDKValidationError
|
|
73
|
+
>,
|
|
74
|
+
APICall,
|
|
75
|
+
]
|
|
76
|
+
> {
|
|
77
|
+
const parsed = safeParse(
|
|
78
|
+
request,
|
|
79
|
+
(value) => operations.ListTicketsRequest$outboundSchema.parse(value),
|
|
80
|
+
"Input validation failed",
|
|
81
|
+
);
|
|
82
|
+
if (!parsed.ok) {
|
|
83
|
+
return [parsed, { status: "invalid" }];
|
|
84
|
+
}
|
|
85
|
+
const payload = parsed.value;
|
|
86
|
+
const body = null;
|
|
87
|
+
|
|
88
|
+
const pathParams = {
|
|
89
|
+
accountID: encodeSimple("accountID", payload.accountID, {
|
|
90
|
+
explode: false,
|
|
91
|
+
charEncoding: "percent",
|
|
92
|
+
}),
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
const path = pathToFunc("/accounts/{accountID}/tickets")(pathParams);
|
|
96
|
+
|
|
97
|
+
const query = encodeFormQuery({
|
|
98
|
+
"count": payload.count,
|
|
99
|
+
"skip": payload.skip,
|
|
100
|
+
}, { explode: false });
|
|
101
|
+
|
|
102
|
+
const headers = new Headers(compactMap({
|
|
103
|
+
Accept: "application/json",
|
|
104
|
+
"x-moov-version": encodeSimple(
|
|
105
|
+
"x-moov-version",
|
|
106
|
+
client._options.xMoovVersion,
|
|
107
|
+
{ explode: false, charEncoding: "none" },
|
|
108
|
+
),
|
|
109
|
+
}));
|
|
110
|
+
|
|
111
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
112
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
113
|
+
|
|
114
|
+
const context = {
|
|
115
|
+
options: client._options,
|
|
116
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
117
|
+
operationID: "listTickets",
|
|
118
|
+
oAuth2Scopes: [],
|
|
119
|
+
|
|
120
|
+
resolvedSecurity: requestSecurity,
|
|
121
|
+
|
|
122
|
+
securitySource: client._options.security,
|
|
123
|
+
retryConfig: options?.retries
|
|
124
|
+
|| client._options.retryConfig
|
|
125
|
+
|| { strategy: "none" },
|
|
126
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
const requestRes = client._createRequest(context, {
|
|
130
|
+
security: requestSecurity,
|
|
131
|
+
method: "GET",
|
|
132
|
+
baseURL: options?.serverURL,
|
|
133
|
+
path: path,
|
|
134
|
+
headers: headers,
|
|
135
|
+
query: query,
|
|
136
|
+
body: body,
|
|
137
|
+
userAgent: client._options.userAgent,
|
|
138
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
139
|
+
}, options);
|
|
140
|
+
if (!requestRes.ok) {
|
|
141
|
+
return [requestRes, { status: "invalid" }];
|
|
142
|
+
}
|
|
143
|
+
const req = requestRes.value;
|
|
144
|
+
|
|
145
|
+
const doResult = await client._do(req, {
|
|
146
|
+
context,
|
|
147
|
+
errorCodes: ["401", "403", "429", "4XX", "500", "504", "5XX"],
|
|
148
|
+
retryConfig: context.retryConfig,
|
|
149
|
+
retryCodes: context.retryCodes,
|
|
150
|
+
});
|
|
151
|
+
if (!doResult.ok) {
|
|
152
|
+
return [doResult, { status: "request-error", request: req }];
|
|
153
|
+
}
|
|
154
|
+
const response = doResult.value;
|
|
155
|
+
|
|
156
|
+
const responseFields = {
|
|
157
|
+
HttpMeta: { Response: response, Request: req },
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const [result] = await M.match<
|
|
161
|
+
operations.ListTicketsResponse,
|
|
162
|
+
| MoovError
|
|
163
|
+
| ResponseValidationError
|
|
164
|
+
| ConnectionError
|
|
165
|
+
| RequestAbortedError
|
|
166
|
+
| RequestTimeoutError
|
|
167
|
+
| InvalidRequestError
|
|
168
|
+
| UnexpectedClientError
|
|
169
|
+
| SDKValidationError
|
|
170
|
+
>(
|
|
171
|
+
M.json(200, operations.ListTicketsResponse$inboundSchema, {
|
|
172
|
+
hdrs: true,
|
|
173
|
+
key: "Result",
|
|
174
|
+
}),
|
|
175
|
+
M.fail([401, 403, 429]),
|
|
176
|
+
M.fail([500, 504]),
|
|
177
|
+
M.fail("4XX"),
|
|
178
|
+
M.fail("5XX"),
|
|
179
|
+
)(response, req, { extraFields: responseFields });
|
|
180
|
+
if (!result.ok) {
|
|
181
|
+
return [result, { status: "complete", request: req, response }];
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
return [result, { status: "complete", request: req, response }];
|
|
185
|
+
}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { MoovCore } from "../core.js";
|
|
6
|
+
import { encodeJSON, 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 {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import * as errors from "../models/errors/index.js";
|
|
21
|
+
import { MoovError } from "../models/errors/mooverror.js";
|
|
22
|
+
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
|
|
23
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
24
|
+
import * as operations from "../models/operations/index.js";
|
|
25
|
+
import { APICall, APIPromise } from "../types/async.js";
|
|
26
|
+
import { Result } from "../types/fp.js";
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Updates a support ticket.
|
|
30
|
+
*
|
|
31
|
+
* To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/)
|
|
32
|
+
* you'll need to specify the `/accounts/{accountID}/support.write` scope.
|
|
33
|
+
*/
|
|
34
|
+
export function supportUpdateTicket(
|
|
35
|
+
client: MoovCore,
|
|
36
|
+
request: operations.UpdateTicketRequest,
|
|
37
|
+
options?: RequestOptions,
|
|
38
|
+
): APIPromise<
|
|
39
|
+
Result<
|
|
40
|
+
operations.UpdateTicketResponse,
|
|
41
|
+
| errors.GenericError
|
|
42
|
+
| errors.UpdateTicketError
|
|
43
|
+
| MoovError
|
|
44
|
+
| ResponseValidationError
|
|
45
|
+
| ConnectionError
|
|
46
|
+
| RequestAbortedError
|
|
47
|
+
| RequestTimeoutError
|
|
48
|
+
| InvalidRequestError
|
|
49
|
+
| UnexpectedClientError
|
|
50
|
+
| SDKValidationError
|
|
51
|
+
>
|
|
52
|
+
> {
|
|
53
|
+
return new APIPromise($do(
|
|
54
|
+
client,
|
|
55
|
+
request,
|
|
56
|
+
options,
|
|
57
|
+
));
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
async function $do(
|
|
61
|
+
client: MoovCore,
|
|
62
|
+
request: operations.UpdateTicketRequest,
|
|
63
|
+
options?: RequestOptions,
|
|
64
|
+
): Promise<
|
|
65
|
+
[
|
|
66
|
+
Result<
|
|
67
|
+
operations.UpdateTicketResponse,
|
|
68
|
+
| errors.GenericError
|
|
69
|
+
| errors.UpdateTicketError
|
|
70
|
+
| MoovError
|
|
71
|
+
| ResponseValidationError
|
|
72
|
+
| ConnectionError
|
|
73
|
+
| RequestAbortedError
|
|
74
|
+
| RequestTimeoutError
|
|
75
|
+
| InvalidRequestError
|
|
76
|
+
| UnexpectedClientError
|
|
77
|
+
| SDKValidationError
|
|
78
|
+
>,
|
|
79
|
+
APICall,
|
|
80
|
+
]
|
|
81
|
+
> {
|
|
82
|
+
const parsed = safeParse(
|
|
83
|
+
request,
|
|
84
|
+
(value) => operations.UpdateTicketRequest$outboundSchema.parse(value),
|
|
85
|
+
"Input validation failed",
|
|
86
|
+
);
|
|
87
|
+
if (!parsed.ok) {
|
|
88
|
+
return [parsed, { status: "invalid" }];
|
|
89
|
+
}
|
|
90
|
+
const payload = parsed.value;
|
|
91
|
+
const body = encodeJSON("body", payload.UpdateTicket, { explode: true });
|
|
92
|
+
|
|
93
|
+
const pathParams = {
|
|
94
|
+
accountID: encodeSimple("accountID", payload.accountID, {
|
|
95
|
+
explode: false,
|
|
96
|
+
charEncoding: "percent",
|
|
97
|
+
}),
|
|
98
|
+
ticketID: encodeSimple("ticketID", payload.ticketID, {
|
|
99
|
+
explode: false,
|
|
100
|
+
charEncoding: "percent",
|
|
101
|
+
}),
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const path = pathToFunc("/accounts/{accountID}/tickets/{ticketID}")(
|
|
105
|
+
pathParams,
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
const headers = new Headers(compactMap({
|
|
109
|
+
"Content-Type": "application/json",
|
|
110
|
+
Accept: "application/json",
|
|
111
|
+
"x-moov-version": encodeSimple(
|
|
112
|
+
"x-moov-version",
|
|
113
|
+
client._options.xMoovVersion,
|
|
114
|
+
{ explode: false, charEncoding: "none" },
|
|
115
|
+
),
|
|
116
|
+
}));
|
|
117
|
+
|
|
118
|
+
const securityInput = await extractSecurity(client._options.security);
|
|
119
|
+
const requestSecurity = resolveGlobalSecurity(securityInput);
|
|
120
|
+
|
|
121
|
+
const context = {
|
|
122
|
+
options: client._options,
|
|
123
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
124
|
+
operationID: "updateTicket",
|
|
125
|
+
oAuth2Scopes: [],
|
|
126
|
+
|
|
127
|
+
resolvedSecurity: requestSecurity,
|
|
128
|
+
|
|
129
|
+
securitySource: client._options.security,
|
|
130
|
+
retryConfig: options?.retries
|
|
131
|
+
|| client._options.retryConfig
|
|
132
|
+
|| { strategy: "none" },
|
|
133
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const requestRes = client._createRequest(context, {
|
|
137
|
+
security: requestSecurity,
|
|
138
|
+
method: "PATCH",
|
|
139
|
+
baseURL: options?.serverURL,
|
|
140
|
+
path: path,
|
|
141
|
+
headers: headers,
|
|
142
|
+
body: body,
|
|
143
|
+
userAgent: client._options.userAgent,
|
|
144
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
145
|
+
}, options);
|
|
146
|
+
if (!requestRes.ok) {
|
|
147
|
+
return [requestRes, { status: "invalid" }];
|
|
148
|
+
}
|
|
149
|
+
const req = requestRes.value;
|
|
150
|
+
|
|
151
|
+
const doResult = await client._do(req, {
|
|
152
|
+
context,
|
|
153
|
+
errorCodes: [
|
|
154
|
+
"400",
|
|
155
|
+
"401",
|
|
156
|
+
"403",
|
|
157
|
+
"404",
|
|
158
|
+
"409",
|
|
159
|
+
"422",
|
|
160
|
+
"429",
|
|
161
|
+
"4XX",
|
|
162
|
+
"500",
|
|
163
|
+
"504",
|
|
164
|
+
"5XX",
|
|
165
|
+
],
|
|
166
|
+
retryConfig: context.retryConfig,
|
|
167
|
+
retryCodes: context.retryCodes,
|
|
168
|
+
});
|
|
169
|
+
if (!doResult.ok) {
|
|
170
|
+
return [doResult, { status: "request-error", request: req }];
|
|
171
|
+
}
|
|
172
|
+
const response = doResult.value;
|
|
173
|
+
|
|
174
|
+
const responseFields = {
|
|
175
|
+
HttpMeta: { Response: response, Request: req },
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
const [result] = await M.match<
|
|
179
|
+
operations.UpdateTicketResponse,
|
|
180
|
+
| errors.GenericError
|
|
181
|
+
| errors.UpdateTicketError
|
|
182
|
+
| MoovError
|
|
183
|
+
| ResponseValidationError
|
|
184
|
+
| ConnectionError
|
|
185
|
+
| RequestAbortedError
|
|
186
|
+
| RequestTimeoutError
|
|
187
|
+
| InvalidRequestError
|
|
188
|
+
| UnexpectedClientError
|
|
189
|
+
| SDKValidationError
|
|
190
|
+
>(
|
|
191
|
+
M.json(200, operations.UpdateTicketResponse$inboundSchema, {
|
|
192
|
+
hdrs: true,
|
|
193
|
+
key: "Result",
|
|
194
|
+
}),
|
|
195
|
+
M.jsonErr([400, 409], errors.GenericError$inboundSchema, { hdrs: true }),
|
|
196
|
+
M.jsonErr(422, errors.UpdateTicketError$inboundSchema, { hdrs: true }),
|
|
197
|
+
M.fail([401, 403, 404, 429]),
|
|
198
|
+
M.fail([500, 504]),
|
|
199
|
+
M.fail("4XX"),
|
|
200
|
+
M.fail("5XX"),
|
|
201
|
+
)(response, req, { extraFields: responseFields });
|
|
202
|
+
if (!result.ok) {
|
|
203
|
+
return [result, { status: "complete", request: req, response }];
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
return [result, { status: "complete", request: req, response }];
|
|
207
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -73,7 +73,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
73
73
|
export const SDK_METADATA = {
|
|
74
74
|
language: "typescript",
|
|
75
75
|
openapiDocVersion: "latest",
|
|
76
|
-
sdkVersion: "0.
|
|
77
|
-
genVersion: "2.
|
|
78
|
-
userAgent: "speakeasy-sdk/typescript 0.
|
|
76
|
+
sdkVersion: "0.14.1",
|
|
77
|
+
genVersion: "2.648.1",
|
|
78
|
+
userAgent: "speakeasy-sdk/typescript 0.14.1 2.648.1 latest @moovio/sdk",
|
|
79
79
|
} as const;
|
|
@@ -6,7 +6,6 @@ import { buildCommand } from "@stricli/core";
|
|
|
6
6
|
import { numberParser } from "@stricli/core";
|
|
7
7
|
import * as z from "zod";
|
|
8
8
|
import { consoleLoggerLevels } from "../../console-logger.js";
|
|
9
|
-
import { mcpScopes } from "../../scopes.js";
|
|
10
9
|
|
|
11
10
|
export const startCommand = buildCommand({
|
|
12
11
|
loader: async () => {
|
|
@@ -37,18 +36,6 @@ export const startCommand = buildCommand({
|
|
|
37
36
|
return z.string().parse(value);
|
|
38
37
|
},
|
|
39
38
|
},
|
|
40
|
-
...(mcpScopes.length
|
|
41
|
-
? {
|
|
42
|
-
scope: {
|
|
43
|
-
kind: "enum",
|
|
44
|
-
brief:
|
|
45
|
-
"Mount tools/resources that match given scope (repeatable flag)",
|
|
46
|
-
values: mcpScopes,
|
|
47
|
-
variadic: true,
|
|
48
|
-
optional: true,
|
|
49
|
-
},
|
|
50
|
-
}
|
|
51
|
-
: {}),
|
|
52
39
|
username: {
|
|
53
40
|
kind: "parsed",
|
|
54
41
|
brief: "Sets the username auth field for the API",
|
|
@@ -12,14 +12,12 @@ import {
|
|
|
12
12
|
ConsoleLoggerLevel,
|
|
13
13
|
createConsoleLogger,
|
|
14
14
|
} from "../../console-logger.js";
|
|
15
|
-
import { MCPScope } from "../../scopes.js";
|
|
16
15
|
import { createMCPServer } from "../../server.js";
|
|
17
16
|
|
|
18
17
|
interface StartCommandFlags {
|
|
19
18
|
readonly transport: "stdio" | "sse";
|
|
20
19
|
readonly port: number;
|
|
21
20
|
readonly tool?: string[];
|
|
22
|
-
readonly scope?: MCPScope[];
|
|
23
21
|
readonly username?: string | undefined;
|
|
24
22
|
readonly password?: string | undefined;
|
|
25
23
|
readonly "x-moov-version"?: SDKOptions["xMoovVersion"] | undefined;
|
|
@@ -52,7 +50,6 @@ async function startStdio(flags: StartCommandFlags) {
|
|
|
52
50
|
const server = createMCPServer({
|
|
53
51
|
logger,
|
|
54
52
|
allowedTools: flags.tool,
|
|
55
|
-
scopes: flags.scope,
|
|
56
53
|
security: allRequired({
|
|
57
54
|
username: flags.username ?? "",
|
|
58
55
|
password: flags.password ?? "",
|
|
@@ -77,7 +74,6 @@ async function startSSE(flags: StartCommandFlags) {
|
|
|
77
74
|
const mcpServer = createMCPServer({
|
|
78
75
|
logger,
|
|
79
76
|
allowedTools: flags.tool,
|
|
80
|
-
scopes: flags.scope,
|
|
81
77
|
security: allRequired({
|
|
82
78
|
username: flags.username ?? "",
|
|
83
79
|
password: flags.password ?? "",
|
package/src/mcp-server/server.ts
CHANGED
|
@@ -122,6 +122,11 @@ import { tool$schedulingGet } from "./tools/schedulingGet.js";
|
|
|
122
122
|
import { tool$schedulingGetOccurrance } from "./tools/schedulingGetOccurrance.js";
|
|
123
123
|
import { tool$schedulingList } from "./tools/schedulingList.js";
|
|
124
124
|
import { tool$schedulingUpdate } from "./tools/schedulingUpdate.js";
|
|
125
|
+
import { tool$supportCreateTicket } from "./tools/supportCreateTicket.js";
|
|
126
|
+
import { tool$supportGetTicket } from "./tools/supportGetTicket.js";
|
|
127
|
+
import { tool$supportListTicketMessages } from "./tools/supportListTicketMessages.js";
|
|
128
|
+
import { tool$supportListTickets } from "./tools/supportListTickets.js";
|
|
129
|
+
import { tool$supportUpdateTicket } from "./tools/supportUpdateTicket.js";
|
|
125
130
|
import { tool$sweepsCreateConfig } from "./tools/sweepsCreateConfig.js";
|
|
126
131
|
import { tool$sweepsGet } from "./tools/sweepsGet.js";
|
|
127
132
|
import { tool$sweepsGetConfig } from "./tools/sweepsGetConfig.js";
|
|
@@ -163,7 +168,7 @@ export function createMCPServer(deps: {
|
|
|
163
168
|
}) {
|
|
164
169
|
const server = new McpServer({
|
|
165
170
|
name: "Moov",
|
|
166
|
-
version: "0.
|
|
171
|
+
version: "0.14.1",
|
|
167
172
|
});
|
|
168
173
|
|
|
169
174
|
const client = new MoovCore({
|
|
@@ -282,6 +287,11 @@ export function createMCPServer(deps: {
|
|
|
282
287
|
tool(tool$accountTerminalApplicationsList);
|
|
283
288
|
tool(tool$accountTerminalApplicationsGet);
|
|
284
289
|
tool(tool$accountTerminalApplicationsGetConfiguration);
|
|
290
|
+
tool(tool$supportCreateTicket);
|
|
291
|
+
tool(tool$supportListTickets);
|
|
292
|
+
tool(tool$supportGetTicket);
|
|
293
|
+
tool(tool$supportUpdateTicket);
|
|
294
|
+
tool(tool$supportListTicketMessages);
|
|
285
295
|
tool(tool$transfersGenerateOptionsForAccount);
|
|
286
296
|
tool(tool$transfersCreate);
|
|
287
297
|
tool(tool$transfersList);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { supportCreateTicket } from "../../funcs/supportCreateTicket.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.CreateTicketRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$supportCreateTicket: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "support-create-ticket",
|
|
15
|
+
description: `Create a support ticket for a Moov account.
|
|
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}/support.write\` scope.`,
|
|
19
|
+
args,
|
|
20
|
+
tool: async (client, args, ctx) => {
|
|
21
|
+
const [result, apiCall] = await supportCreateTicket(
|
|
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
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { supportGetTicket } from "../../funcs/supportGetTicket.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.GetTicketRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$supportGetTicket: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "support-get-ticket",
|
|
15
|
+
description: `Retrieve a support ticket by ID.
|
|
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}/support.read\` scope.`,
|
|
19
|
+
args,
|
|
20
|
+
tool: async (client, args, ctx) => {
|
|
21
|
+
const [result, apiCall] = await supportGetTicket(
|
|
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
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { supportListTicketMessages } from "../../funcs/supportListTicketMessages.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.ListTicketMessagesRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$supportListTicketMessages: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "support-list-ticket-messages",
|
|
15
|
+
description: `List all the messages for a support ticket.
|
|
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}/support.read\` scope.`,
|
|
19
|
+
args,
|
|
20
|
+
tool: async (client, args, ctx) => {
|
|
21
|
+
const [result, apiCall] = await supportListTicketMessages(
|
|
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
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { supportListTickets } from "../../funcs/supportListTickets.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.ListTicketsRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$supportListTickets: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "support-list-tickets",
|
|
15
|
+
description: `List all the support tickets created under a Moov account.
|
|
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}/support.read\` scope.`,
|
|
19
|
+
args,
|
|
20
|
+
tool: async (client, args, ctx) => {
|
|
21
|
+
const [result, apiCall] = await supportListTickets(
|
|
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
|
+
};
|