syllable-sdk 1.0.1 → 1.0.2-rc.2

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.
Files changed (96) hide show
  1. package/README.md +8 -0
  2. package/bin/mcp-server.js +563 -84
  3. package/bin/mcp-server.js.map +20 -7
  4. package/docs/sdks/batches/README.md +4 -4
  5. package/docs/sdks/pronunciations/README.md +277 -1
  6. package/docs/sdks/workflows/README.md +8 -8
  7. package/examples/package-lock.json +1 -1
  8. package/funcs/pronunciationsPronunciationsDeleteCsv.d.ts +13 -0
  9. package/funcs/pronunciationsPronunciationsDeleteCsv.d.ts.map +1 -0
  10. package/funcs/pronunciationsPronunciationsDeleteCsv.js +101 -0
  11. package/funcs/pronunciationsPronunciationsDeleteCsv.js.map +1 -0
  12. package/funcs/pronunciationsPronunciationsDownloadCsv.d.ts +13 -0
  13. package/funcs/pronunciationsPronunciationsDownloadCsv.d.ts.map +1 -0
  14. package/funcs/pronunciationsPronunciationsDownloadCsv.js +101 -0
  15. package/funcs/pronunciationsPronunciationsDownloadCsv.js.map +1 -0
  16. package/funcs/pronunciationsPronunciationsGet.d.ts +14 -0
  17. package/funcs/pronunciationsPronunciationsGet.d.ts.map +1 -0
  18. package/funcs/pronunciationsPronunciationsGet.js +101 -0
  19. package/funcs/pronunciationsPronunciationsGet.js.map +1 -0
  20. package/funcs/pronunciationsPronunciationsGetMetadata.d.ts +14 -0
  21. package/funcs/pronunciationsPronunciationsGetMetadata.d.ts.map +1 -0
  22. package/funcs/pronunciationsPronunciationsGetMetadata.js +101 -0
  23. package/funcs/pronunciationsPronunciationsGetMetadata.js.map +1 -0
  24. package/jsr.json +1 -1
  25. package/lib/config.d.ts +3 -3
  26. package/lib/config.js +3 -3
  27. package/lib/config.js.map +1 -1
  28. package/mcp-server/mcp-server.js +1 -1
  29. package/mcp-server/mcp-server.js.map +1 -1
  30. package/mcp-server/server.d.ts.map +1 -1
  31. package/mcp-server/server.js +9 -1
  32. package/mcp-server/server.js.map +1 -1
  33. package/mcp-server/tools/pronunciationsPronunciationsDeleteCsv.d.ts +3 -0
  34. package/mcp-server/tools/pronunciationsPronunciationsDeleteCsv.d.ts.map +1 -0
  35. package/mcp-server/tools/pronunciationsPronunciationsDeleteCsv.js +23 -0
  36. package/mcp-server/tools/pronunciationsPronunciationsDeleteCsv.js.map +1 -0
  37. package/mcp-server/tools/pronunciationsPronunciationsDownloadCsv.d.ts +3 -0
  38. package/mcp-server/tools/pronunciationsPronunciationsDownloadCsv.d.ts.map +1 -0
  39. package/mcp-server/tools/pronunciationsPronunciationsDownloadCsv.js +23 -0
  40. package/mcp-server/tools/pronunciationsPronunciationsDownloadCsv.js.map +1 -0
  41. package/mcp-server/tools/pronunciationsPronunciationsGet.d.ts +3 -0
  42. package/mcp-server/tools/pronunciationsPronunciationsGet.d.ts.map +1 -0
  43. package/mcp-server/tools/pronunciationsPronunciationsGet.js +24 -0
  44. package/mcp-server/tools/pronunciationsPronunciationsGet.js.map +1 -0
  45. package/mcp-server/tools/pronunciationsPronunciationsGetMetadata.d.ts +3 -0
  46. package/mcp-server/tools/pronunciationsPronunciationsGetMetadata.d.ts.map +1 -0
  47. package/mcp-server/tools/pronunciationsPronunciationsGetMetadata.js +24 -0
  48. package/mcp-server/tools/pronunciationsPronunciationsGetMetadata.js.map +1 -0
  49. package/models/components/dictionarymetadata.d.ts +36 -0
  50. package/models/components/dictionarymetadata.d.ts.map +1 -0
  51. package/models/components/dictionarymetadata.js +73 -0
  52. package/models/components/dictionarymetadata.js.map +1 -0
  53. package/models/components/index.d.ts +5 -0
  54. package/models/components/index.d.ts.map +1 -1
  55. package/models/components/index.js +5 -0
  56. package/models/components/index.js.map +1 -1
  57. package/models/components/matchtype.d.ts +31 -0
  58. package/models/components/matchtype.d.ts.map +1 -0
  59. package/models/components/matchtype.js +63 -0
  60. package/models/components/matchtype.js.map +1 -0
  61. package/models/components/pronunciationoverride.d.ts +73 -0
  62. package/models/components/pronunciationoverride.d.ts.map +1 -0
  63. package/models/components/pronunciationoverride.js +120 -0
  64. package/models/components/pronunciationoverride.js.map +1 -0
  65. package/models/components/pronunciationoverridesdictionary.d.ts +68 -0
  66. package/models/components/pronunciationoverridesdictionary.d.ts.map +1 -0
  67. package/models/components/pronunciationoverridesdictionary.js +78 -0
  68. package/models/components/pronunciationoverridesdictionary.js.map +1 -0
  69. package/models/components/voicedisplayinfo.d.ts +34 -0
  70. package/models/components/voicedisplayinfo.d.ts.map +1 -0
  71. package/models/components/voicedisplayinfo.js +80 -0
  72. package/models/components/voicedisplayinfo.js.map +1 -0
  73. package/openapi.json +301 -33
  74. package/package.json +1 -1
  75. package/sdk/pronunciations.d.ts +16 -0
  76. package/sdk/pronunciations.d.ts.map +1 -1
  77. package/sdk/pronunciations.js +28 -0
  78. package/sdk/pronunciations.js.map +1 -1
  79. package/src/funcs/pronunciationsPronunciationsDeleteCsv.ts +139 -0
  80. package/src/funcs/pronunciationsPronunciationsDownloadCsv.ts +139 -0
  81. package/src/funcs/pronunciationsPronunciationsGet.ts +139 -0
  82. package/src/funcs/pronunciationsPronunciationsGetMetadata.ts +139 -0
  83. package/src/lib/config.ts +3 -3
  84. package/src/mcp-server/mcp-server.ts +1 -1
  85. package/src/mcp-server/server.ts +9 -1
  86. package/src/mcp-server/tools/pronunciationsPronunciationsDeleteCsv.ts +26 -0
  87. package/src/mcp-server/tools/pronunciationsPronunciationsDownloadCsv.ts +26 -0
  88. package/src/mcp-server/tools/pronunciationsPronunciationsGet.ts +28 -0
  89. package/src/mcp-server/tools/pronunciationsPronunciationsGetMetadata.ts +28 -0
  90. package/src/models/components/dictionarymetadata.ts +77 -0
  91. package/src/models/components/index.ts +5 -0
  92. package/src/models/components/matchtype.ts +36 -0
  93. package/src/models/components/pronunciationoverride.ts +166 -0
  94. package/src/models/components/pronunciationoverridesdictionary.ts +124 -0
  95. package/src/models/components/voicedisplayinfo.ts +82 -0
  96. package/src/sdk/pronunciations.ts +52 -0
@@ -0,0 +1,28 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { pronunciationsPronunciationsGetMetadata } from "../../funcs/pronunciationsPronunciationsGetMetadata.js";
6
+ import { formatResult, ToolDefinition } from "../tools.js";
7
+
8
+ export const tool$pronunciationsPronunciationsGetMetadata: ToolDefinition = {
9
+ name: "pronunciations-pronunciations-get-metadata",
10
+ description: `Get Pronunciations Metadata`,
11
+ tool: async (client, ctx) => {
12
+ const [result, apiCall] = await pronunciationsPronunciationsGetMetadata(
13
+ client,
14
+ { fetchOptions: { signal: ctx.signal } },
15
+ ).$inspect();
16
+
17
+ if (!result.ok) {
18
+ return {
19
+ content: [{ type: "text", text: result.error.message }],
20
+ isError: true,
21
+ };
22
+ }
23
+
24
+ const value = result.value;
25
+
26
+ return formatResult(value, apiCall);
27
+ },
28
+ };
@@ -0,0 +1,77 @@
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
+ /**
11
+ * Audit metadata associated with a dictionary.
12
+ */
13
+ export type DictionaryMetadata = {
14
+ entries: number;
15
+ hash: string;
16
+ source?: string | null | undefined;
17
+ };
18
+
19
+ /** @internal */
20
+ export const DictionaryMetadata$inboundSchema: z.ZodType<
21
+ DictionaryMetadata,
22
+ z.ZodTypeDef,
23
+ unknown
24
+ > = z.object({
25
+ entries: z.number().int(),
26
+ hash: z.string(),
27
+ source: z.nullable(z.string()).optional(),
28
+ });
29
+
30
+ /** @internal */
31
+ export type DictionaryMetadata$Outbound = {
32
+ entries: number;
33
+ hash: string;
34
+ source?: string | null | undefined;
35
+ };
36
+
37
+ /** @internal */
38
+ export const DictionaryMetadata$outboundSchema: z.ZodType<
39
+ DictionaryMetadata$Outbound,
40
+ z.ZodTypeDef,
41
+ DictionaryMetadata
42
+ > = z.object({
43
+ entries: z.number().int(),
44
+ hash: z.string(),
45
+ source: z.nullable(z.string()).optional(),
46
+ });
47
+
48
+ /**
49
+ * @internal
50
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
51
+ */
52
+ export namespace DictionaryMetadata$ {
53
+ /** @deprecated use `DictionaryMetadata$inboundSchema` instead. */
54
+ export const inboundSchema = DictionaryMetadata$inboundSchema;
55
+ /** @deprecated use `DictionaryMetadata$outboundSchema` instead. */
56
+ export const outboundSchema = DictionaryMetadata$outboundSchema;
57
+ /** @deprecated use `DictionaryMetadata$Outbound` instead. */
58
+ export type Outbound = DictionaryMetadata$Outbound;
59
+ }
60
+
61
+ export function dictionaryMetadataToJSON(
62
+ dictionaryMetadata: DictionaryMetadata,
63
+ ): string {
64
+ return JSON.stringify(
65
+ DictionaryMetadata$outboundSchema.parse(dictionaryMetadata),
66
+ );
67
+ }
68
+
69
+ export function dictionaryMetadataFromJSON(
70
+ jsonString: string,
71
+ ): SafeParseResult<DictionaryMetadata, SDKValidationError> {
72
+ return safeParse(
73
+ jsonString,
74
+ (x) => DictionaryMetadata$inboundSchema.parse(JSON.parse(x)),
75
+ `Failed to parse 'DictionaryMetadata' from JSON`,
76
+ );
77
+ }
@@ -64,6 +64,7 @@ export * from "./daysofweek.js";
64
64
  export * from "./dialogmessage.js";
65
65
  export * from "./dialogrole.js";
66
66
  export * from "./dialogtoolcall.js";
67
+ export * from "./dictionarymetadata.js";
67
68
  export * from "./event.js";
68
69
  export * from "./eventproperties.js";
69
70
  export * from "./folderdetails.js";
@@ -130,6 +131,7 @@ export * from "./listresponsesessionlabel.js";
130
131
  export * from "./listresponsetoolresponse.js";
131
132
  export * from "./listresponseuserresponse.js";
132
133
  export * from "./logintype.js";
134
+ export * from "./matchtype.js";
133
135
  export * from "./orderbydirection.js";
134
136
  export * from "./organizationchannelconfig.js";
135
137
  export * from "./organizationchannelcreaterequest.js";
@@ -147,6 +149,8 @@ export * from "./promptllmprovider.js";
147
149
  export * from "./promptproperties.js";
148
150
  export * from "./promptresponse.js";
149
151
  export * from "./promptupdaterequest.js";
152
+ export * from "./pronunciationoverride.js";
153
+ export * from "./pronunciationoverridesdictionary.js";
150
154
  export * from "./pronunciationscsvuploadresponse.js";
151
155
  export * from "./requeststatus.js";
152
156
  export * from "./rolecreaterequest.js";
@@ -216,4 +220,5 @@ export * from "./userproperties.js";
216
220
  export * from "./userresponse.js";
217
221
  export * from "./userupdaterequest.js";
218
222
  export * from "./validationerror.js";
223
+ export * from "./voicedisplayinfo.js";
219
224
  export * from "./voicesamplecreaterequest.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
+ * Matching strategy for override text.
10
+ */
11
+ export const MatchType = {
12
+ Exact: "exact",
13
+ } as const;
14
+ /**
15
+ * Matching strategy for override text.
16
+ */
17
+ export type MatchType = ClosedEnum<typeof MatchType>;
18
+
19
+ /** @internal */
20
+ export const MatchType$inboundSchema: z.ZodNativeEnum<typeof MatchType> = z
21
+ .nativeEnum(MatchType);
22
+
23
+ /** @internal */
24
+ export const MatchType$outboundSchema: z.ZodNativeEnum<typeof MatchType> =
25
+ MatchType$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 MatchType$ {
32
+ /** @deprecated use `MatchType$inboundSchema` instead. */
33
+ export const inboundSchema = MatchType$inboundSchema;
34
+ /** @deprecated use `MatchType$outboundSchema` instead. */
35
+ export const outboundSchema = MatchType$outboundSchema;
36
+ }
@@ -0,0 +1,166 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+ import {
11
+ MatchType,
12
+ MatchType$inboundSchema,
13
+ MatchType$outboundSchema,
14
+ } from "./matchtype.js";
15
+
16
+ export type Language = string | Array<string>;
17
+
18
+ /**
19
+ * A single text replacement rule.
20
+ */
21
+ export type PronunciationOverride = {
22
+ text: string;
23
+ replacement: string;
24
+ language?: string | Array<string> | null | undefined;
25
+ provider?: string | null | undefined;
26
+ voice?: string | null | undefined;
27
+ /**
28
+ * Matching strategy for override text.
29
+ */
30
+ matchType?: MatchType | undefined;
31
+ matchOptions?: Array<string> | undefined;
32
+ enabled?: boolean | undefined;
33
+ notes?: string | null | undefined;
34
+ };
35
+
36
+ /** @internal */
37
+ export const Language$inboundSchema: z.ZodType<
38
+ Language,
39
+ z.ZodTypeDef,
40
+ unknown
41
+ > = z.union([z.string(), z.array(z.string())]);
42
+
43
+ /** @internal */
44
+ export type Language$Outbound = string | Array<string>;
45
+
46
+ /** @internal */
47
+ export const Language$outboundSchema: z.ZodType<
48
+ Language$Outbound,
49
+ z.ZodTypeDef,
50
+ Language
51
+ > = z.union([z.string(), z.array(z.string())]);
52
+
53
+ /**
54
+ * @internal
55
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
56
+ */
57
+ export namespace Language$ {
58
+ /** @deprecated use `Language$inboundSchema` instead. */
59
+ export const inboundSchema = Language$inboundSchema;
60
+ /** @deprecated use `Language$outboundSchema` instead. */
61
+ export const outboundSchema = Language$outboundSchema;
62
+ /** @deprecated use `Language$Outbound` instead. */
63
+ export type Outbound = Language$Outbound;
64
+ }
65
+
66
+ export function languageToJSON(language: Language): string {
67
+ return JSON.stringify(Language$outboundSchema.parse(language));
68
+ }
69
+
70
+ export function languageFromJSON(
71
+ jsonString: string,
72
+ ): SafeParseResult<Language, SDKValidationError> {
73
+ return safeParse(
74
+ jsonString,
75
+ (x) => Language$inboundSchema.parse(JSON.parse(x)),
76
+ `Failed to parse 'Language' from JSON`,
77
+ );
78
+ }
79
+
80
+ /** @internal */
81
+ export const PronunciationOverride$inboundSchema: z.ZodType<
82
+ PronunciationOverride,
83
+ z.ZodTypeDef,
84
+ unknown
85
+ > = z.object({
86
+ text: z.string(),
87
+ replacement: z.string(),
88
+ language: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
89
+ provider: z.nullable(z.string()).optional(),
90
+ voice: z.nullable(z.string()).optional(),
91
+ match_type: MatchType$inboundSchema.optional(),
92
+ match_options: z.array(z.string()).optional(),
93
+ enabled: z.boolean().default(true),
94
+ notes: z.nullable(z.string()).optional(),
95
+ }).transform((v) => {
96
+ return remap$(v, {
97
+ "match_type": "matchType",
98
+ "match_options": "matchOptions",
99
+ });
100
+ });
101
+
102
+ /** @internal */
103
+ export type PronunciationOverride$Outbound = {
104
+ text: string;
105
+ replacement: string;
106
+ language?: string | Array<string> | null | undefined;
107
+ provider?: string | null | undefined;
108
+ voice?: string | null | undefined;
109
+ match_type?: string | undefined;
110
+ match_options?: Array<string> | undefined;
111
+ enabled: boolean;
112
+ notes?: string | null | undefined;
113
+ };
114
+
115
+ /** @internal */
116
+ export const PronunciationOverride$outboundSchema: z.ZodType<
117
+ PronunciationOverride$Outbound,
118
+ z.ZodTypeDef,
119
+ PronunciationOverride
120
+ > = z.object({
121
+ text: z.string(),
122
+ replacement: z.string(),
123
+ language: z.nullable(z.union([z.string(), z.array(z.string())])).optional(),
124
+ provider: z.nullable(z.string()).optional(),
125
+ voice: z.nullable(z.string()).optional(),
126
+ matchType: MatchType$outboundSchema.optional(),
127
+ matchOptions: z.array(z.string()).optional(),
128
+ enabled: z.boolean().default(true),
129
+ notes: z.nullable(z.string()).optional(),
130
+ }).transform((v) => {
131
+ return remap$(v, {
132
+ matchType: "match_type",
133
+ matchOptions: "match_options",
134
+ });
135
+ });
136
+
137
+ /**
138
+ * @internal
139
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
140
+ */
141
+ export namespace PronunciationOverride$ {
142
+ /** @deprecated use `PronunciationOverride$inboundSchema` instead. */
143
+ export const inboundSchema = PronunciationOverride$inboundSchema;
144
+ /** @deprecated use `PronunciationOverride$outboundSchema` instead. */
145
+ export const outboundSchema = PronunciationOverride$outboundSchema;
146
+ /** @deprecated use `PronunciationOverride$Outbound` instead. */
147
+ export type Outbound = PronunciationOverride$Outbound;
148
+ }
149
+
150
+ export function pronunciationOverrideToJSON(
151
+ pronunciationOverride: PronunciationOverride,
152
+ ): string {
153
+ return JSON.stringify(
154
+ PronunciationOverride$outboundSchema.parse(pronunciationOverride),
155
+ );
156
+ }
157
+
158
+ export function pronunciationOverrideFromJSON(
159
+ jsonString: string,
160
+ ): SafeParseResult<PronunciationOverride, SDKValidationError> {
161
+ return safeParse(
162
+ jsonString,
163
+ (x) => PronunciationOverride$inboundSchema.parse(JSON.parse(x)),
164
+ `Failed to parse 'PronunciationOverride' from JSON`,
165
+ );
166
+ }
@@ -0,0 +1,124 @@
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
+ DictionaryMetadata,
11
+ DictionaryMetadata$inboundSchema,
12
+ DictionaryMetadata$Outbound,
13
+ DictionaryMetadata$outboundSchema,
14
+ } from "./dictionarymetadata.js";
15
+ import {
16
+ PronunciationOverride,
17
+ PronunciationOverride$inboundSchema,
18
+ PronunciationOverride$Outbound,
19
+ PronunciationOverride$outboundSchema,
20
+ } from "./pronunciationoverride.js";
21
+ import {
22
+ VoiceDisplayInfo,
23
+ VoiceDisplayInfo$inboundSchema,
24
+ VoiceDisplayInfo$Outbound,
25
+ VoiceDisplayInfo$outboundSchema,
26
+ } from "./voicedisplayinfo.js";
27
+
28
+ /**
29
+ * Container for all TTS pronunciation overrides belonging to the sub-organisation.
30
+ *
31
+ * @remarks
32
+ *
33
+ * Stored in the `config_values` table via ConfigDao. The Syllable API persists uploaded CSV
34
+ * pronunciation rules, and Bubblegum's PronunciationOverridesPlugin reads them to apply text
35
+ * replacements before TTS processing.
36
+ *
37
+ * Example:
38
+ * dao = ConfigDao(db_session)
39
+ * await dao.register_model('tts.pronunciations', PronunciationOverridesDictionary)
40
+ *
41
+ * pod = PronunciationOverridesDictionary(
42
+ * pronunciations=[...],
43
+ * metadata=DictionaryMetadata(entries=10, hash='sha256:...'),
44
+ * )
45
+ * result = await dao.upsert('pronunciations_v1', pod)
46
+ *
47
+ * record = await dao.get('pronunciations_v1', PronunciationOverridesDictionary)
48
+ * if record:
49
+ * pronunciations = record.value.pronunciations
50
+ */
51
+ export type PronunciationOverridesDictionary = {
52
+ type?: string | undefined;
53
+ pronunciations: Array<PronunciationOverride>;
54
+ voices?: { [k: string]: VoiceDisplayInfo } | undefined;
55
+ /**
56
+ * Audit metadata associated with a dictionary.
57
+ */
58
+ metadata: DictionaryMetadata;
59
+ };
60
+
61
+ /** @internal */
62
+ export const PronunciationOverridesDictionary$inboundSchema: z.ZodType<
63
+ PronunciationOverridesDictionary,
64
+ z.ZodTypeDef,
65
+ unknown
66
+ > = z.object({
67
+ type: z.string().default("pronunciations_v1"),
68
+ pronunciations: z.array(PronunciationOverride$inboundSchema),
69
+ voices: z.record(VoiceDisplayInfo$inboundSchema).optional(),
70
+ metadata: DictionaryMetadata$inboundSchema,
71
+ });
72
+
73
+ /** @internal */
74
+ export type PronunciationOverridesDictionary$Outbound = {
75
+ type: string;
76
+ pronunciations: Array<PronunciationOverride$Outbound>;
77
+ voices?: { [k: string]: VoiceDisplayInfo$Outbound } | undefined;
78
+ metadata: DictionaryMetadata$Outbound;
79
+ };
80
+
81
+ /** @internal */
82
+ export const PronunciationOverridesDictionary$outboundSchema: z.ZodType<
83
+ PronunciationOverridesDictionary$Outbound,
84
+ z.ZodTypeDef,
85
+ PronunciationOverridesDictionary
86
+ > = z.object({
87
+ type: z.string().default("pronunciations_v1"),
88
+ pronunciations: z.array(PronunciationOverride$outboundSchema),
89
+ voices: z.record(VoiceDisplayInfo$outboundSchema).optional(),
90
+ metadata: DictionaryMetadata$outboundSchema,
91
+ });
92
+
93
+ /**
94
+ * @internal
95
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
96
+ */
97
+ export namespace PronunciationOverridesDictionary$ {
98
+ /** @deprecated use `PronunciationOverridesDictionary$inboundSchema` instead. */
99
+ export const inboundSchema = PronunciationOverridesDictionary$inboundSchema;
100
+ /** @deprecated use `PronunciationOverridesDictionary$outboundSchema` instead. */
101
+ export const outboundSchema = PronunciationOverridesDictionary$outboundSchema;
102
+ /** @deprecated use `PronunciationOverridesDictionary$Outbound` instead. */
103
+ export type Outbound = PronunciationOverridesDictionary$Outbound;
104
+ }
105
+
106
+ export function pronunciationOverridesDictionaryToJSON(
107
+ pronunciationOverridesDictionary: PronunciationOverridesDictionary,
108
+ ): string {
109
+ return JSON.stringify(
110
+ PronunciationOverridesDictionary$outboundSchema.parse(
111
+ pronunciationOverridesDictionary,
112
+ ),
113
+ );
114
+ }
115
+
116
+ export function pronunciationOverridesDictionaryFromJSON(
117
+ jsonString: string,
118
+ ): SafeParseResult<PronunciationOverridesDictionary, SDKValidationError> {
119
+ return safeParse(
120
+ jsonString,
121
+ (x) => PronunciationOverridesDictionary$inboundSchema.parse(JSON.parse(x)),
122
+ `Failed to parse 'PronunciationOverridesDictionary' from JSON`,
123
+ );
124
+ }
@@ -0,0 +1,82 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { Result as SafeParseResult } from "../../types/fp.js";
9
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
10
+
11
+ /**
12
+ * Display metadata for a canonical voice identifier.
13
+ */
14
+ export type VoiceDisplayInfo = {
15
+ displayName: string;
16
+ provider: string;
17
+ };
18
+
19
+ /** @internal */
20
+ export const VoiceDisplayInfo$inboundSchema: z.ZodType<
21
+ VoiceDisplayInfo,
22
+ z.ZodTypeDef,
23
+ unknown
24
+ > = z.object({
25
+ display_name: z.string(),
26
+ provider: z.string(),
27
+ }).transform((v) => {
28
+ return remap$(v, {
29
+ "display_name": "displayName",
30
+ });
31
+ });
32
+
33
+ /** @internal */
34
+ export type VoiceDisplayInfo$Outbound = {
35
+ display_name: string;
36
+ provider: string;
37
+ };
38
+
39
+ /** @internal */
40
+ export const VoiceDisplayInfo$outboundSchema: z.ZodType<
41
+ VoiceDisplayInfo$Outbound,
42
+ z.ZodTypeDef,
43
+ VoiceDisplayInfo
44
+ > = z.object({
45
+ displayName: z.string(),
46
+ provider: z.string(),
47
+ }).transform((v) => {
48
+ return remap$(v, {
49
+ displayName: "display_name",
50
+ });
51
+ });
52
+
53
+ /**
54
+ * @internal
55
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
56
+ */
57
+ export namespace VoiceDisplayInfo$ {
58
+ /** @deprecated use `VoiceDisplayInfo$inboundSchema` instead. */
59
+ export const inboundSchema = VoiceDisplayInfo$inboundSchema;
60
+ /** @deprecated use `VoiceDisplayInfo$outboundSchema` instead. */
61
+ export const outboundSchema = VoiceDisplayInfo$outboundSchema;
62
+ /** @deprecated use `VoiceDisplayInfo$Outbound` instead. */
63
+ export type Outbound = VoiceDisplayInfo$Outbound;
64
+ }
65
+
66
+ export function voiceDisplayInfoToJSON(
67
+ voiceDisplayInfo: VoiceDisplayInfo,
68
+ ): string {
69
+ return JSON.stringify(
70
+ VoiceDisplayInfo$outboundSchema.parse(voiceDisplayInfo),
71
+ );
72
+ }
73
+
74
+ export function voiceDisplayInfoFromJSON(
75
+ jsonString: string,
76
+ ): SafeParseResult<VoiceDisplayInfo, SDKValidationError> {
77
+ return safeParse(
78
+ jsonString,
79
+ (x) => VoiceDisplayInfo$inboundSchema.parse(JSON.parse(x)),
80
+ `Failed to parse 'VoiceDisplayInfo' from JSON`,
81
+ );
82
+ }
@@ -2,12 +2,52 @@
2
2
  * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
3
  */
4
4
 
5
+ import { pronunciationsPronunciationsDeleteCsv } from "../funcs/pronunciationsPronunciationsDeleteCsv.js";
6
+ import { pronunciationsPronunciationsDownloadCsv } from "../funcs/pronunciationsPronunciationsDownloadCsv.js";
7
+ import { pronunciationsPronunciationsGet } from "../funcs/pronunciationsPronunciationsGet.js";
8
+ import { pronunciationsPronunciationsGetMetadata } from "../funcs/pronunciationsPronunciationsGetMetadata.js";
5
9
  import { pronunciationsPronunciationsUploadCsv } from "../funcs/pronunciationsPronunciationsUploadCsv.js";
6
10
  import { ClientSDK, RequestOptions } from "../lib/sdks.js";
7
11
  import * as components from "../models/components/index.js";
8
12
  import { unwrapAsync } from "../types/fp.js";
9
13
 
10
14
  export class Pronunciations extends ClientSDK {
15
+ /**
16
+ * Get Pronunciations Dictionary
17
+ */
18
+ async pronunciationsGet(
19
+ options?: RequestOptions,
20
+ ): Promise<components.PronunciationOverridesDictionary> {
21
+ return unwrapAsync(pronunciationsPronunciationsGet(
22
+ this,
23
+ options,
24
+ ));
25
+ }
26
+
27
+ /**
28
+ * Get Pronunciations Metadata
29
+ */
30
+ async pronunciationsGetMetadata(
31
+ options?: RequestOptions,
32
+ ): Promise<components.DictionaryMetadata> {
33
+ return unwrapAsync(pronunciationsPronunciationsGetMetadata(
34
+ this,
35
+ options,
36
+ ));
37
+ }
38
+
39
+ /**
40
+ * Download Pronunciations Csv
41
+ */
42
+ async pronunciationsDownloadCsv(
43
+ options?: RequestOptions,
44
+ ): Promise<void> {
45
+ return unwrapAsync(pronunciationsPronunciationsDownloadCsv(
46
+ this,
47
+ options,
48
+ ));
49
+ }
50
+
11
51
  /**
12
52
  * Upload Pronunciations Csv
13
53
  */
@@ -21,4 +61,16 @@ export class Pronunciations extends ClientSDK {
21
61
  options,
22
62
  ));
23
63
  }
64
+
65
+ /**
66
+ * Delete Pronunciations Dictionary
67
+ */
68
+ async pronunciationsDeleteCsv(
69
+ options?: RequestOptions,
70
+ ): Promise<void> {
71
+ return unwrapAsync(pronunciationsPronunciationsDeleteCsv(
72
+ this,
73
+ options,
74
+ ));
75
+ }
24
76
  }