syllable-sdk 1.0.1 → 1.0.2-rc.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 +6 -0
- package/bin/mcp-server.js +480 -84
- package/bin/mcp-server.js.map +18 -7
- package/docs/sdks/batches/README.md +4 -4
- package/docs/sdks/pronunciations/README.md +207 -0
- package/docs/sdks/workflows/README.md +8 -8
- package/examples/package-lock.json +1 -1
- package/funcs/pronunciationsPronunciationsDownloadCsv.d.ts +13 -0
- package/funcs/pronunciationsPronunciationsDownloadCsv.d.ts.map +1 -0
- package/funcs/pronunciationsPronunciationsDownloadCsv.js +101 -0
- package/funcs/pronunciationsPronunciationsDownloadCsv.js.map +1 -0
- package/funcs/pronunciationsPronunciationsGet.d.ts +14 -0
- package/funcs/pronunciationsPronunciationsGet.d.ts.map +1 -0
- package/funcs/pronunciationsPronunciationsGet.js +101 -0
- package/funcs/pronunciationsPronunciationsGet.js.map +1 -0
- package/funcs/pronunciationsPronunciationsGetMetadata.d.ts +14 -0
- package/funcs/pronunciationsPronunciationsGetMetadata.d.ts.map +1 -0
- package/funcs/pronunciationsPronunciationsGetMetadata.js +101 -0
- package/funcs/pronunciationsPronunciationsGetMetadata.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/lib/config.js.map +1 -1
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/mcp-server.js.map +1 -1
- package/mcp-server/server.d.ts.map +1 -1
- package/mcp-server/server.js +7 -1
- package/mcp-server/server.js.map +1 -1
- package/mcp-server/tools/pronunciationsPronunciationsDownloadCsv.d.ts +3 -0
- package/mcp-server/tools/pronunciationsPronunciationsDownloadCsv.d.ts.map +1 -0
- package/mcp-server/tools/pronunciationsPronunciationsDownloadCsv.js +23 -0
- package/mcp-server/tools/pronunciationsPronunciationsDownloadCsv.js.map +1 -0
- package/mcp-server/tools/pronunciationsPronunciationsGet.d.ts +3 -0
- package/mcp-server/tools/pronunciationsPronunciationsGet.d.ts.map +1 -0
- package/mcp-server/tools/pronunciationsPronunciationsGet.js +24 -0
- package/mcp-server/tools/pronunciationsPronunciationsGet.js.map +1 -0
- package/mcp-server/tools/pronunciationsPronunciationsGetMetadata.d.ts +3 -0
- package/mcp-server/tools/pronunciationsPronunciationsGetMetadata.d.ts.map +1 -0
- package/mcp-server/tools/pronunciationsPronunciationsGetMetadata.js +24 -0
- package/mcp-server/tools/pronunciationsPronunciationsGetMetadata.js.map +1 -0
- package/models/components/dictionarymetadata.d.ts +36 -0
- package/models/components/dictionarymetadata.d.ts.map +1 -0
- package/models/components/dictionarymetadata.js +73 -0
- package/models/components/dictionarymetadata.js.map +1 -0
- package/models/components/index.d.ts +5 -0
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +5 -0
- package/models/components/index.js.map +1 -1
- package/models/components/matchtype.d.ts +31 -0
- package/models/components/matchtype.d.ts.map +1 -0
- package/models/components/matchtype.js +63 -0
- package/models/components/matchtype.js.map +1 -0
- package/models/components/pronunciationoverride.d.ts +73 -0
- package/models/components/pronunciationoverride.d.ts.map +1 -0
- package/models/components/pronunciationoverride.js +120 -0
- package/models/components/pronunciationoverride.js.map +1 -0
- package/models/components/pronunciationoverridesdictionary.d.ts +68 -0
- package/models/components/pronunciationoverridesdictionary.d.ts.map +1 -0
- package/models/components/pronunciationoverridesdictionary.js +78 -0
- package/models/components/pronunciationoverridesdictionary.js.map +1 -0
- package/models/components/voicedisplayinfo.d.ts +34 -0
- package/models/components/voicedisplayinfo.d.ts.map +1 -0
- package/models/components/voicedisplayinfo.js +80 -0
- package/models/components/voicedisplayinfo.js.map +1 -0
- package/openapi.json +284 -33
- package/package.json +1 -1
- package/sdk/pronunciations.d.ts +12 -0
- package/sdk/pronunciations.d.ts.map +1 -1
- package/sdk/pronunciations.js +21 -0
- package/sdk/pronunciations.js.map +1 -1
- package/src/funcs/pronunciationsPronunciationsDownloadCsv.ts +139 -0
- package/src/funcs/pronunciationsPronunciationsGet.ts +139 -0
- package/src/funcs/pronunciationsPronunciationsGetMetadata.ts +139 -0
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +7 -1
- package/src/mcp-server/tools/pronunciationsPronunciationsDownloadCsv.ts +26 -0
- package/src/mcp-server/tools/pronunciationsPronunciationsGet.ts +28 -0
- package/src/mcp-server/tools/pronunciationsPronunciationsGetMetadata.ts +28 -0
- package/src/models/components/dictionarymetadata.ts +77 -0
- package/src/models/components/index.ts +5 -0
- package/src/models/components/matchtype.ts +36 -0
- package/src/models/components/pronunciationoverride.ts +166 -0
- package/src/models/components/pronunciationoverridesdictionary.ts +124 -0
- package/src/models/components/voicedisplayinfo.ts +82 -0
- package/src/sdk/pronunciations.ts +39 -0
|
@@ -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,51 @@
|
|
|
2
2
|
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
import { pronunciationsPronunciationsDownloadCsv } from "../funcs/pronunciationsPronunciationsDownloadCsv.js";
|
|
6
|
+
import { pronunciationsPronunciationsGet } from "../funcs/pronunciationsPronunciationsGet.js";
|
|
7
|
+
import { pronunciationsPronunciationsGetMetadata } from "../funcs/pronunciationsPronunciationsGetMetadata.js";
|
|
5
8
|
import { pronunciationsPronunciationsUploadCsv } from "../funcs/pronunciationsPronunciationsUploadCsv.js";
|
|
6
9
|
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
7
10
|
import * as components from "../models/components/index.js";
|
|
8
11
|
import { unwrapAsync } from "../types/fp.js";
|
|
9
12
|
|
|
10
13
|
export class Pronunciations extends ClientSDK {
|
|
14
|
+
/**
|
|
15
|
+
* Get Pronunciations Dictionary
|
|
16
|
+
*/
|
|
17
|
+
async pronunciationsGet(
|
|
18
|
+
options?: RequestOptions,
|
|
19
|
+
): Promise<components.PronunciationOverridesDictionary> {
|
|
20
|
+
return unwrapAsync(pronunciationsPronunciationsGet(
|
|
21
|
+
this,
|
|
22
|
+
options,
|
|
23
|
+
));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Get Pronunciations Metadata
|
|
28
|
+
*/
|
|
29
|
+
async pronunciationsGetMetadata(
|
|
30
|
+
options?: RequestOptions,
|
|
31
|
+
): Promise<components.DictionaryMetadata> {
|
|
32
|
+
return unwrapAsync(pronunciationsPronunciationsGetMetadata(
|
|
33
|
+
this,
|
|
34
|
+
options,
|
|
35
|
+
));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Download Pronunciations Csv
|
|
40
|
+
*/
|
|
41
|
+
async pronunciationsDownloadCsv(
|
|
42
|
+
options?: RequestOptions,
|
|
43
|
+
): Promise<void> {
|
|
44
|
+
return unwrapAsync(pronunciationsPronunciationsDownloadCsv(
|
|
45
|
+
this,
|
|
46
|
+
options,
|
|
47
|
+
));
|
|
48
|
+
}
|
|
49
|
+
|
|
11
50
|
/**
|
|
12
51
|
* Upload Pronunciations Csv
|
|
13
52
|
*/
|