@moovio/sdk 0.14.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
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { supportUpdateTicket } from "../../funcs/supportUpdateTicket.js";
|
|
6
|
+
import * as operations from "../../models/operations/index.js";
|
|
7
|
+
import { formatResult, ToolDefinition } from "../tools.js";
|
|
8
|
+
|
|
9
|
+
const args = {
|
|
10
|
+
request: operations.UpdateTicketRequest$inboundSchema,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export const tool$supportUpdateTicket: ToolDefinition<typeof args> = {
|
|
14
|
+
name: "support-update-ticket",
|
|
15
|
+
description: `Updates 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.write\` scope.`,
|
|
19
|
+
args,
|
|
20
|
+
tool: async (client, args, ctx) => {
|
|
21
|
+
const [result, apiCall] = await supportUpdateTicket(
|
|
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,79 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
TicketContact,
|
|
11
|
+
TicketContact$inboundSchema,
|
|
12
|
+
TicketContact$Outbound,
|
|
13
|
+
TicketContact$outboundSchema,
|
|
14
|
+
} from "./ticketcontact.js";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Request to create a new support ticket.
|
|
18
|
+
*/
|
|
19
|
+
export type CreateTicket = {
|
|
20
|
+
title: string;
|
|
21
|
+
body: string;
|
|
22
|
+
contact: TicketContact;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
/** @internal */
|
|
26
|
+
export const CreateTicket$inboundSchema: z.ZodType<
|
|
27
|
+
CreateTicket,
|
|
28
|
+
z.ZodTypeDef,
|
|
29
|
+
unknown
|
|
30
|
+
> = z.object({
|
|
31
|
+
title: z.string(),
|
|
32
|
+
body: z.string(),
|
|
33
|
+
contact: TicketContact$inboundSchema,
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export type CreateTicket$Outbound = {
|
|
38
|
+
title: string;
|
|
39
|
+
body: string;
|
|
40
|
+
contact: TicketContact$Outbound;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/** @internal */
|
|
44
|
+
export const CreateTicket$outboundSchema: z.ZodType<
|
|
45
|
+
CreateTicket$Outbound,
|
|
46
|
+
z.ZodTypeDef,
|
|
47
|
+
CreateTicket
|
|
48
|
+
> = z.object({
|
|
49
|
+
title: z.string(),
|
|
50
|
+
body: z.string(),
|
|
51
|
+
contact: TicketContact$outboundSchema,
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* @internal
|
|
56
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
57
|
+
*/
|
|
58
|
+
export namespace CreateTicket$ {
|
|
59
|
+
/** @deprecated use `CreateTicket$inboundSchema` instead. */
|
|
60
|
+
export const inboundSchema = CreateTicket$inboundSchema;
|
|
61
|
+
/** @deprecated use `CreateTicket$outboundSchema` instead. */
|
|
62
|
+
export const outboundSchema = CreateTicket$outboundSchema;
|
|
63
|
+
/** @deprecated use `CreateTicket$Outbound` instead. */
|
|
64
|
+
export type Outbound = CreateTicket$Outbound;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function createTicketToJSON(createTicket: CreateTicket): string {
|
|
68
|
+
return JSON.stringify(CreateTicket$outboundSchema.parse(createTicket));
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function createTicketFromJSON(
|
|
72
|
+
jsonString: string,
|
|
73
|
+
): SafeParseResult<CreateTicket, SDKValidationError> {
|
|
74
|
+
return safeParse(
|
|
75
|
+
jsonString,
|
|
76
|
+
(x) => CreateTicket$inboundSchema.parse(JSON.parse(x)),
|
|
77
|
+
`Failed to parse 'CreateTicket' from JSON`,
|
|
78
|
+
);
|
|
79
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
export type CreateTicketContactError = {
|
|
11
|
+
email?: string | undefined;
|
|
12
|
+
name?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const CreateTicketContactError$inboundSchema: z.ZodType<
|
|
17
|
+
CreateTicketContactError,
|
|
18
|
+
z.ZodTypeDef,
|
|
19
|
+
unknown
|
|
20
|
+
> = z.object({
|
|
21
|
+
email: z.string().optional(),
|
|
22
|
+
name: z.string().optional(),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
/** @internal */
|
|
26
|
+
export type CreateTicketContactError$Outbound = {
|
|
27
|
+
email?: string | undefined;
|
|
28
|
+
name?: string | undefined;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const CreateTicketContactError$outboundSchema: z.ZodType<
|
|
33
|
+
CreateTicketContactError$Outbound,
|
|
34
|
+
z.ZodTypeDef,
|
|
35
|
+
CreateTicketContactError
|
|
36
|
+
> = z.object({
|
|
37
|
+
email: z.string().optional(),
|
|
38
|
+
name: z.string().optional(),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @internal
|
|
43
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
44
|
+
*/
|
|
45
|
+
export namespace CreateTicketContactError$ {
|
|
46
|
+
/** @deprecated use `CreateTicketContactError$inboundSchema` instead. */
|
|
47
|
+
export const inboundSchema = CreateTicketContactError$inboundSchema;
|
|
48
|
+
/** @deprecated use `CreateTicketContactError$outboundSchema` instead. */
|
|
49
|
+
export const outboundSchema = CreateTicketContactError$outboundSchema;
|
|
50
|
+
/** @deprecated use `CreateTicketContactError$Outbound` instead. */
|
|
51
|
+
export type Outbound = CreateTicketContactError$Outbound;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function createTicketContactErrorToJSON(
|
|
55
|
+
createTicketContactError: CreateTicketContactError,
|
|
56
|
+
): string {
|
|
57
|
+
return JSON.stringify(
|
|
58
|
+
CreateTicketContactError$outboundSchema.parse(createTicketContactError),
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function createTicketContactErrorFromJSON(
|
|
63
|
+
jsonString: string,
|
|
64
|
+
): SafeParseResult<CreateTicketContactError, SDKValidationError> {
|
|
65
|
+
return safeParse(
|
|
66
|
+
jsonString,
|
|
67
|
+
(x) => CreateTicketContactError$inboundSchema.parse(JSON.parse(x)),
|
|
68
|
+
`Failed to parse 'CreateTicketContactError' from JSON`,
|
|
69
|
+
);
|
|
70
|
+
}
|
|
@@ -141,6 +141,8 @@ export * from "./createrepresentative.js";
|
|
|
141
141
|
export * from "./createreversal.js";
|
|
142
142
|
export * from "./createsweepconfig.js";
|
|
143
143
|
export * from "./createterminalapplication.js";
|
|
144
|
+
export * from "./createticket.js";
|
|
145
|
+
export * from "./createticketcontacterror.js";
|
|
144
146
|
export * from "./createtransfer.js";
|
|
145
147
|
export * from "./createtransferdestination.js";
|
|
146
148
|
export * from "./createtransferdestinationach.js";
|
|
@@ -368,6 +370,10 @@ export * from "./termsofservice.js";
|
|
|
368
370
|
export * from "./termsofserviceerror.js";
|
|
369
371
|
export * from "./termsofservicetoken.js";
|
|
370
372
|
export * from "./termsofservicetokenupdate.js";
|
|
373
|
+
export * from "./ticket.js";
|
|
374
|
+
export * from "./ticketcontact.js";
|
|
375
|
+
export * from "./ticketmessage.js";
|
|
376
|
+
export * from "./ticketstatus.js";
|
|
371
377
|
export * from "./tokentype.js";
|
|
372
378
|
export * from "./transactionsource.js";
|
|
373
379
|
export * from "./transfer.js";
|
|
@@ -392,6 +398,8 @@ export * from "./updateevidence.js";
|
|
|
392
398
|
export * from "./updateissuedcard.js";
|
|
393
399
|
export * from "./updatepaymentlink.js";
|
|
394
400
|
export * from "./updaterepresentative.js";
|
|
401
|
+
export * from "./updateticket.js";
|
|
402
|
+
export * from "./updateticketstatus.js";
|
|
395
403
|
export * from "./updateunderwriting.js";
|
|
396
404
|
export * from "./upsertschedule.js";
|
|
397
405
|
export * from "./upsertunderwriting.js";
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
TicketContact,
|
|
11
|
+
TicketContact$inboundSchema,
|
|
12
|
+
TicketContact$Outbound,
|
|
13
|
+
TicketContact$outboundSchema,
|
|
14
|
+
} from "./ticketcontact.js";
|
|
15
|
+
import {
|
|
16
|
+
TicketStatus,
|
|
17
|
+
TicketStatus$inboundSchema,
|
|
18
|
+
TicketStatus$outboundSchema,
|
|
19
|
+
} from "./ticketstatus.js";
|
|
20
|
+
|
|
21
|
+
export type Ticket = {
|
|
22
|
+
ticketID: string;
|
|
23
|
+
number: number;
|
|
24
|
+
title: string;
|
|
25
|
+
contact: TicketContact;
|
|
26
|
+
status: TicketStatus;
|
|
27
|
+
createdOn: Date;
|
|
28
|
+
updatedOn: Date;
|
|
29
|
+
latestMessageOn?: Date | undefined;
|
|
30
|
+
closedOn?: Date | undefined;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
/** @internal */
|
|
34
|
+
export const Ticket$inboundSchema: z.ZodType<Ticket, z.ZodTypeDef, unknown> = z
|
|
35
|
+
.object({
|
|
36
|
+
ticketID: z.string(),
|
|
37
|
+
number: z.number().int(),
|
|
38
|
+
title: z.string(),
|
|
39
|
+
contact: TicketContact$inboundSchema,
|
|
40
|
+
status: TicketStatus$inboundSchema,
|
|
41
|
+
createdOn: z.string().datetime({ offset: true }).transform(v =>
|
|
42
|
+
new Date(v)
|
|
43
|
+
),
|
|
44
|
+
updatedOn: z.string().datetime({ offset: true }).transform(v =>
|
|
45
|
+
new Date(v)
|
|
46
|
+
),
|
|
47
|
+
latestMessageOn: z.string().datetime({ offset: true }).transform(v =>
|
|
48
|
+
new Date(v)
|
|
49
|
+
).optional(),
|
|
50
|
+
closedOn: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
51
|
+
.optional(),
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
/** @internal */
|
|
55
|
+
export type Ticket$Outbound = {
|
|
56
|
+
ticketID: string;
|
|
57
|
+
number: number;
|
|
58
|
+
title: string;
|
|
59
|
+
contact: TicketContact$Outbound;
|
|
60
|
+
status: string;
|
|
61
|
+
createdOn: string;
|
|
62
|
+
updatedOn: string;
|
|
63
|
+
latestMessageOn?: string | undefined;
|
|
64
|
+
closedOn?: string | undefined;
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
/** @internal */
|
|
68
|
+
export const Ticket$outboundSchema: z.ZodType<
|
|
69
|
+
Ticket$Outbound,
|
|
70
|
+
z.ZodTypeDef,
|
|
71
|
+
Ticket
|
|
72
|
+
> = z.object({
|
|
73
|
+
ticketID: z.string(),
|
|
74
|
+
number: z.number().int(),
|
|
75
|
+
title: z.string(),
|
|
76
|
+
contact: TicketContact$outboundSchema,
|
|
77
|
+
status: TicketStatus$outboundSchema,
|
|
78
|
+
createdOn: z.date().transform(v => v.toISOString()),
|
|
79
|
+
updatedOn: z.date().transform(v => v.toISOString()),
|
|
80
|
+
latestMessageOn: z.date().transform(v => v.toISOString()).optional(),
|
|
81
|
+
closedOn: z.date().transform(v => v.toISOString()).optional(),
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* @internal
|
|
86
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
87
|
+
*/
|
|
88
|
+
export namespace Ticket$ {
|
|
89
|
+
/** @deprecated use `Ticket$inboundSchema` instead. */
|
|
90
|
+
export const inboundSchema = Ticket$inboundSchema;
|
|
91
|
+
/** @deprecated use `Ticket$outboundSchema` instead. */
|
|
92
|
+
export const outboundSchema = Ticket$outboundSchema;
|
|
93
|
+
/** @deprecated use `Ticket$Outbound` instead. */
|
|
94
|
+
export type Outbound = Ticket$Outbound;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function ticketToJSON(ticket: Ticket): string {
|
|
98
|
+
return JSON.stringify(Ticket$outboundSchema.parse(ticket));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function ticketFromJSON(
|
|
102
|
+
jsonString: string,
|
|
103
|
+
): SafeParseResult<Ticket, SDKValidationError> {
|
|
104
|
+
return safeParse(
|
|
105
|
+
jsonString,
|
|
106
|
+
(x) => Ticket$inboundSchema.parse(JSON.parse(x)),
|
|
107
|
+
`Failed to parse 'Ticket' from JSON`,
|
|
108
|
+
);
|
|
109
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
export type TicketContact = {
|
|
11
|
+
email: string;
|
|
12
|
+
name?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const TicketContact$inboundSchema: z.ZodType<
|
|
17
|
+
TicketContact,
|
|
18
|
+
z.ZodTypeDef,
|
|
19
|
+
unknown
|
|
20
|
+
> = z.object({
|
|
21
|
+
email: z.string(),
|
|
22
|
+
name: z.string().optional(),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
/** @internal */
|
|
26
|
+
export type TicketContact$Outbound = {
|
|
27
|
+
email: string;
|
|
28
|
+
name?: string | undefined;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export const TicketContact$outboundSchema: z.ZodType<
|
|
33
|
+
TicketContact$Outbound,
|
|
34
|
+
z.ZodTypeDef,
|
|
35
|
+
TicketContact
|
|
36
|
+
> = z.object({
|
|
37
|
+
email: z.string(),
|
|
38
|
+
name: z.string().optional(),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @internal
|
|
43
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
44
|
+
*/
|
|
45
|
+
export namespace TicketContact$ {
|
|
46
|
+
/** @deprecated use `TicketContact$inboundSchema` instead. */
|
|
47
|
+
export const inboundSchema = TicketContact$inboundSchema;
|
|
48
|
+
/** @deprecated use `TicketContact$outboundSchema` instead. */
|
|
49
|
+
export const outboundSchema = TicketContact$outboundSchema;
|
|
50
|
+
/** @deprecated use `TicketContact$Outbound` instead. */
|
|
51
|
+
export type Outbound = TicketContact$Outbound;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function ticketContactToJSON(ticketContact: TicketContact): string {
|
|
55
|
+
return JSON.stringify(TicketContact$outboundSchema.parse(ticketContact));
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function ticketContactFromJSON(
|
|
59
|
+
jsonString: string,
|
|
60
|
+
): SafeParseResult<TicketContact, SDKValidationError> {
|
|
61
|
+
return safeParse(
|
|
62
|
+
jsonString,
|
|
63
|
+
(x) => TicketContact$inboundSchema.parse(JSON.parse(x)),
|
|
64
|
+
`Failed to parse 'TicketContact' from JSON`,
|
|
65
|
+
);
|
|
66
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
export type TicketMessage = {
|
|
11
|
+
author: string;
|
|
12
|
+
body: string;
|
|
13
|
+
sentOn: Date;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const TicketMessage$inboundSchema: z.ZodType<
|
|
18
|
+
TicketMessage,
|
|
19
|
+
z.ZodTypeDef,
|
|
20
|
+
unknown
|
|
21
|
+
> = z.object({
|
|
22
|
+
author: z.string(),
|
|
23
|
+
body: z.string(),
|
|
24
|
+
sentOn: z.string().datetime({ offset: true }).transform(v => new Date(v)),
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
/** @internal */
|
|
28
|
+
export type TicketMessage$Outbound = {
|
|
29
|
+
author: string;
|
|
30
|
+
body: string;
|
|
31
|
+
sentOn: string;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/** @internal */
|
|
35
|
+
export const TicketMessage$outboundSchema: z.ZodType<
|
|
36
|
+
TicketMessage$Outbound,
|
|
37
|
+
z.ZodTypeDef,
|
|
38
|
+
TicketMessage
|
|
39
|
+
> = z.object({
|
|
40
|
+
author: z.string(),
|
|
41
|
+
body: z.string(),
|
|
42
|
+
sentOn: z.date().transform(v => v.toISOString()),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @internal
|
|
47
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
48
|
+
*/
|
|
49
|
+
export namespace TicketMessage$ {
|
|
50
|
+
/** @deprecated use `TicketMessage$inboundSchema` instead. */
|
|
51
|
+
export const inboundSchema = TicketMessage$inboundSchema;
|
|
52
|
+
/** @deprecated use `TicketMessage$outboundSchema` instead. */
|
|
53
|
+
export const outboundSchema = TicketMessage$outboundSchema;
|
|
54
|
+
/** @deprecated use `TicketMessage$Outbound` instead. */
|
|
55
|
+
export type Outbound = TicketMessage$Outbound;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function ticketMessageToJSON(ticketMessage: TicketMessage): string {
|
|
59
|
+
return JSON.stringify(TicketMessage$outboundSchema.parse(ticketMessage));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function ticketMessageFromJSON(
|
|
63
|
+
jsonString: string,
|
|
64
|
+
): SafeParseResult<TicketMessage, SDKValidationError> {
|
|
65
|
+
return safeParse(
|
|
66
|
+
jsonString,
|
|
67
|
+
(x) => TicketMessage$inboundSchema.parse(JSON.parse(x)),
|
|
68
|
+
`Failed to parse 'TicketMessage' from JSON`,
|
|
69
|
+
);
|
|
70
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
export const TicketStatus = {
|
|
9
|
+
New: "new",
|
|
10
|
+
InProgress: "in-progress",
|
|
11
|
+
OnHold: "on-hold",
|
|
12
|
+
Closed: "closed",
|
|
13
|
+
} as const;
|
|
14
|
+
export type TicketStatus = ClosedEnum<typeof TicketStatus>;
|
|
15
|
+
|
|
16
|
+
/** @internal */
|
|
17
|
+
export const TicketStatus$inboundSchema: z.ZodNativeEnum<typeof TicketStatus> =
|
|
18
|
+
z.nativeEnum(TicketStatus);
|
|
19
|
+
|
|
20
|
+
/** @internal */
|
|
21
|
+
export const TicketStatus$outboundSchema: z.ZodNativeEnum<typeof TicketStatus> =
|
|
22
|
+
TicketStatus$inboundSchema;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @internal
|
|
26
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
27
|
+
*/
|
|
28
|
+
export namespace TicketStatus$ {
|
|
29
|
+
/** @deprecated use `TicketStatus$inboundSchema` instead. */
|
|
30
|
+
export const inboundSchema = TicketStatus$inboundSchema;
|
|
31
|
+
/** @deprecated use `TicketStatus$outboundSchema` instead. */
|
|
32
|
+
export const outboundSchema = TicketStatus$outboundSchema;
|
|
33
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod";
|
|
6
|
+
import { safeParse } from "../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
import {
|
|
10
|
+
UpdateTicketStatus,
|
|
11
|
+
UpdateTicketStatus$inboundSchema,
|
|
12
|
+
UpdateTicketStatus$outboundSchema,
|
|
13
|
+
} from "./updateticketstatus.js";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Request to update a support ticket.
|
|
17
|
+
*/
|
|
18
|
+
export type UpdateTicket = {
|
|
19
|
+
status?: UpdateTicketStatus | undefined;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export const UpdateTicket$inboundSchema: z.ZodType<
|
|
24
|
+
UpdateTicket,
|
|
25
|
+
z.ZodTypeDef,
|
|
26
|
+
unknown
|
|
27
|
+
> = z.object({
|
|
28
|
+
status: UpdateTicketStatus$inboundSchema.optional(),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export type UpdateTicket$Outbound = {
|
|
33
|
+
status?: string | undefined;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
/** @internal */
|
|
37
|
+
export const UpdateTicket$outboundSchema: z.ZodType<
|
|
38
|
+
UpdateTicket$Outbound,
|
|
39
|
+
z.ZodTypeDef,
|
|
40
|
+
UpdateTicket
|
|
41
|
+
> = z.object({
|
|
42
|
+
status: UpdateTicketStatus$outboundSchema.optional(),
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @internal
|
|
47
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
48
|
+
*/
|
|
49
|
+
export namespace UpdateTicket$ {
|
|
50
|
+
/** @deprecated use `UpdateTicket$inboundSchema` instead. */
|
|
51
|
+
export const inboundSchema = UpdateTicket$inboundSchema;
|
|
52
|
+
/** @deprecated use `UpdateTicket$outboundSchema` instead. */
|
|
53
|
+
export const outboundSchema = UpdateTicket$outboundSchema;
|
|
54
|
+
/** @deprecated use `UpdateTicket$Outbound` instead. */
|
|
55
|
+
export type Outbound = UpdateTicket$Outbound;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function updateTicketToJSON(updateTicket: UpdateTicket): string {
|
|
59
|
+
return JSON.stringify(UpdateTicket$outboundSchema.parse(updateTicket));
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function updateTicketFromJSON(
|
|
63
|
+
jsonString: string,
|
|
64
|
+
): SafeParseResult<UpdateTicket, SDKValidationError> {
|
|
65
|
+
return safeParse(
|
|
66
|
+
jsonString,
|
|
67
|
+
(x) => UpdateTicket$inboundSchema.parse(JSON.parse(x)),
|
|
68
|
+
`Failed to parse 'UpdateTicket' from JSON`,
|
|
69
|
+
);
|
|
70
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
export const UpdateTicketStatus = {
|
|
9
|
+
Closed: "closed",
|
|
10
|
+
} as const;
|
|
11
|
+
export type UpdateTicketStatus = ClosedEnum<typeof UpdateTicketStatus>;
|
|
12
|
+
|
|
13
|
+
/** @internal */
|
|
14
|
+
export const UpdateTicketStatus$inboundSchema: z.ZodNativeEnum<
|
|
15
|
+
typeof UpdateTicketStatus
|
|
16
|
+
> = z.nativeEnum(UpdateTicketStatus);
|
|
17
|
+
|
|
18
|
+
/** @internal */
|
|
19
|
+
export const UpdateTicketStatus$outboundSchema: z.ZodNativeEnum<
|
|
20
|
+
typeof UpdateTicketStatus
|
|
21
|
+
> = UpdateTicketStatus$inboundSchema;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* @internal
|
|
25
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
26
|
+
*/
|
|
27
|
+
export namespace UpdateTicketStatus$ {
|
|
28
|
+
/** @deprecated use `UpdateTicketStatus$inboundSchema` instead. */
|
|
29
|
+
export const inboundSchema = UpdateTicketStatus$inboundSchema;
|
|
30
|
+
/** @deprecated use `UpdateTicketStatus$outboundSchema` instead. */
|
|
31
|
+
export const outboundSchema = UpdateTicketStatus$outboundSchema;
|
|
32
|
+
}
|
|
@@ -25,8 +25,14 @@ export class APIError extends MoovError {
|
|
|
25
25
|
}`;
|
|
26
26
|
}
|
|
27
27
|
const body = httpMeta.body || `""`;
|
|
28
|
-
message += body.length > 100 ? "\n" : " ";
|
|
29
|
-
|
|
28
|
+
message += body.length > 100 ? "\n" : ". ";
|
|
29
|
+
let bodyDisplay = body;
|
|
30
|
+
if (body.length > 10000) {
|
|
31
|
+
const truncated = body.substring(0, 10000);
|
|
32
|
+
const remaining = body.length - 10000;
|
|
33
|
+
bodyDisplay = `${truncated}...and ${remaining} more chars`;
|
|
34
|
+
}
|
|
35
|
+
message += `Body: ${bodyDisplay}`;
|
|
30
36
|
message = message.trim();
|
|
31
37
|
super(message, httpMeta);
|
|
32
38
|
this.name = "APIError";
|