@superdurable/connector-elevenlabs 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -19
- package/dex-connector.json +492 -4
- package/dist/chunk-UBMQRHWH.js +481 -0
- package/dist/connection-BWnmpStG.d.ts +347 -0
- package/dist/index.d.ts +460 -8
- package/dist/index.js +693 -28
- package/dist/mock.d.ts +159 -5
- package/dist/mock.js +385 -4
- package/package.json +4 -3
- package/dist/chunk-GIQKY62E.js +0 -134
- package/dist/connection-DFnhV-HC.d.ts +0 -117
package/dist/chunk-GIQKY62E.js
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
// src/generated/models.ts
|
|
2
|
-
import { z } from "zod";
|
|
3
|
-
var ConfigSchema = z.object({
|
|
4
|
-
"baseUrl": z.string().optional(),
|
|
5
|
-
"timeoutMs": z.number().int().optional(),
|
|
6
|
-
"maxResponseBytes": z.number().int().optional()
|
|
7
|
-
});
|
|
8
|
-
var ListVoicesInputSchema = z.strictObject({
|
|
9
|
-
"pageSize": z.number().int().optional(),
|
|
10
|
-
"nextPageToken": z.string().optional()
|
|
11
|
-
});
|
|
12
|
-
var VoiceSchema = z.strictObject({
|
|
13
|
-
"voiceId": z.string(),
|
|
14
|
-
"name": z.string()
|
|
15
|
-
});
|
|
16
|
-
var ListVoicesOutputSchema = z.strictObject({
|
|
17
|
-
"voices": z.array(VoiceSchema).nullable(),
|
|
18
|
-
"hasMore": z.boolean(),
|
|
19
|
-
"nextPageToken": z.string().optional()
|
|
20
|
-
});
|
|
21
|
-
var CreateSpeechInputSchema = z.strictObject({
|
|
22
|
-
"voiceId": z.string(),
|
|
23
|
-
"text": z.string(),
|
|
24
|
-
"modelId": z.string().optional()
|
|
25
|
-
});
|
|
26
|
-
var CreateSpeechOutputSchema = z.strictObject({
|
|
27
|
-
"audioBase64": z.string(),
|
|
28
|
-
"contentType": z.string()
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
// src/generated/definitions.ts
|
|
32
|
-
var ConnectorID = "elevenlabs";
|
|
33
|
-
var ProviderID = "elevenlabs";
|
|
34
|
-
var ListVoicesBranch = {
|
|
35
|
-
Listed: "listed",
|
|
36
|
-
ProviderRejected: "providerRejected",
|
|
37
|
-
InvalidResponse: "invalidResponse",
|
|
38
|
-
Defect: "defect"
|
|
39
|
-
};
|
|
40
|
-
var ListVoicesBranchListed = ListVoicesBranch.Listed;
|
|
41
|
-
var ListVoicesBranchProviderRejected = ListVoicesBranch.ProviderRejected;
|
|
42
|
-
var ListVoicesBranchInvalidResponse = ListVoicesBranch.InvalidResponse;
|
|
43
|
-
var ListVoicesBranchDefect = ListVoicesBranch.Defect;
|
|
44
|
-
var ListVoicesDefinition = {
|
|
45
|
-
operation: { connectorId: ConnectorID, operationId: "listVoices" },
|
|
46
|
-
branches: [
|
|
47
|
-
{ id: "listed", description: "ElevenLabs returned the requested result." },
|
|
48
|
-
{ id: "providerRejected", description: "The provider conclusively rejected the request.", optional: true },
|
|
49
|
-
{ id: "invalidResponse", description: "The provider returned malformed or oversized data.", optional: true },
|
|
50
|
-
{ id: "defect", description: "Local input or credentials are invalid.", optional: true }
|
|
51
|
-
],
|
|
52
|
-
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
53
|
-
};
|
|
54
|
-
var ListVoicesMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
55
|
-
var CreateSpeechBranch = {
|
|
56
|
-
Created: "created",
|
|
57
|
-
ProviderRejected: "providerRejected",
|
|
58
|
-
InvalidResponse: "invalidResponse",
|
|
59
|
-
Defect: "defect"
|
|
60
|
-
};
|
|
61
|
-
var CreateSpeechBranchCreated = CreateSpeechBranch.Created;
|
|
62
|
-
var CreateSpeechBranchProviderRejected = CreateSpeechBranch.ProviderRejected;
|
|
63
|
-
var CreateSpeechBranchInvalidResponse = CreateSpeechBranch.InvalidResponse;
|
|
64
|
-
var CreateSpeechBranchDefect = CreateSpeechBranch.Defect;
|
|
65
|
-
var CreateSpeechDefinition = {
|
|
66
|
-
operation: { connectorId: ConnectorID, operationId: "createSpeech" },
|
|
67
|
-
branches: [
|
|
68
|
-
{ id: "created", description: "ElevenLabs returned the requested result." },
|
|
69
|
-
{ id: "providerRejected", description: "The provider conclusively rejected the request.", optional: true },
|
|
70
|
-
{ id: "invalidResponse", description: "The provider returned malformed or oversized data.", optional: true },
|
|
71
|
-
{ id: "defect", description: "Local input or credentials are invalid.", optional: true }
|
|
72
|
-
],
|
|
73
|
-
stepDefaults: { executeMethodTimeoutMs: 15e4, executeDurability: "sync", executeRetry: { initialIntervalMs: 2e3, backoffCoefficient: 2, maximumIntervalMs: 3e4, maximumAttempts: 3, totalDurationMs: 3e5 } }
|
|
74
|
-
};
|
|
75
|
-
var CreateSpeechMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
76
|
-
|
|
77
|
-
// src/generated/connection.ts
|
|
78
|
-
import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
|
|
79
|
-
var Connection = class {
|
|
80
|
-
/** Stable provider and connection name. */
|
|
81
|
-
reference;
|
|
82
|
-
/** Bound provider operations. */
|
|
83
|
-
operations;
|
|
84
|
-
/** Validate a reference and bind operations. */
|
|
85
|
-
constructor(reference, operations) {
|
|
86
|
-
this.reference = ConnectionRefSchema.parse(reference);
|
|
87
|
-
if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
|
|
88
|
-
if (!operations) throw new TypeError("connector operations are required");
|
|
89
|
-
this.operations = operations;
|
|
90
|
-
}
|
|
91
|
-
};
|
|
92
|
-
function newConnection(client, reference) {
|
|
93
|
-
if (!client) throw new TypeError("connector client is required");
|
|
94
|
-
return new Connection(reference, client);
|
|
95
|
-
}
|
|
96
|
-
function newConnectionWithOperations(operations, reference) {
|
|
97
|
-
return new Connection(reference, operations);
|
|
98
|
-
}
|
|
99
|
-
function newProjectConnection(project, connectionName, createClient) {
|
|
100
|
-
if (!project) throw new TypeError("loaded project is required");
|
|
101
|
-
const reference = ConnectionRefSchema.parse({ provider: ProviderID, name: connectionName });
|
|
102
|
-
const selected = project.configuration.connections.find((entry) => entry.connectorId === ConnectorID && entry.connectionName === connectionName);
|
|
103
|
-
if (!selected || selected.provider !== ProviderID) throw new TypeError("project connection is not configured");
|
|
104
|
-
return newConnection(createClient(project, connectionName), reference);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
export {
|
|
108
|
-
ConfigSchema,
|
|
109
|
-
ListVoicesInputSchema,
|
|
110
|
-
VoiceSchema,
|
|
111
|
-
ListVoicesOutputSchema,
|
|
112
|
-
CreateSpeechInputSchema,
|
|
113
|
-
CreateSpeechOutputSchema,
|
|
114
|
-
ConnectorID,
|
|
115
|
-
ProviderID,
|
|
116
|
-
ListVoicesBranch,
|
|
117
|
-
ListVoicesBranchListed,
|
|
118
|
-
ListVoicesBranchProviderRejected,
|
|
119
|
-
ListVoicesBranchInvalidResponse,
|
|
120
|
-
ListVoicesBranchDefect,
|
|
121
|
-
ListVoicesDefinition,
|
|
122
|
-
ListVoicesMetadata,
|
|
123
|
-
CreateSpeechBranch,
|
|
124
|
-
CreateSpeechBranchCreated,
|
|
125
|
-
CreateSpeechBranchProviderRejected,
|
|
126
|
-
CreateSpeechBranchInvalidResponse,
|
|
127
|
-
CreateSpeechBranchDefect,
|
|
128
|
-
CreateSpeechDefinition,
|
|
129
|
-
CreateSpeechMetadata,
|
|
130
|
-
Connection,
|
|
131
|
-
newConnection,
|
|
132
|
-
newConnectionWithOperations,
|
|
133
|
-
newProjectConnection
|
|
134
|
-
};
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
import { SecretString, CredentialProvider, Query, ConnectionRef } from '@superdurable/connectors-sdk';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
/** Connector configuration; omitted fields use manifest defaults. */
|
|
5
|
-
interface Config {
|
|
6
|
-
/** Public ElevenLabs API base URL. Leave blank for the displayed default; override only for a trusted compatible gateway or a loopback test server. */
|
|
7
|
-
baseUrl?: string;
|
|
8
|
-
/** Maximum duration of one provider HTTP request, as a positive Go duration such as 15s or 1m. Leave blank for the displayed default; increase only for slow responses. Runtime value in milliseconds. */
|
|
9
|
-
timeoutMs?: number;
|
|
10
|
-
/** Positive maximum response size in bytes. Leave blank for the displayed default; increase only for a known larger response. Oversized replies select invalidResponse. */
|
|
11
|
-
maxResponseBytes?: number;
|
|
12
|
-
}
|
|
13
|
-
/** Runtime schema for manifest configuration. */
|
|
14
|
-
declare const ConfigSchema: z.ZodObject<{
|
|
15
|
-
baseUrl: z.ZodOptional<z.ZodString>;
|
|
16
|
-
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
17
|
-
maxResponseBytes: z.ZodOptional<z.ZodNumber>;
|
|
18
|
-
}, z.core.$strip>;
|
|
19
|
-
/** Private connector credentials resolved by the host. */
|
|
20
|
-
interface Credentials {
|
|
21
|
-
/** Secret API key from ElevenLabs > Developers > API Keys > Create API Key at https://elevenlabs.io/app/developers/api-keys. Copy the provider-issued string into this field; blank makes calls select defect. It is stored as a secret and sent only in the HTTP authorization header. */
|
|
22
|
-
apiKey: SecretString;
|
|
23
|
-
}
|
|
24
|
-
/** Host-owned source of private connector credentials. */
|
|
25
|
-
type CredentialSource = CredentialProvider<Credentials>;
|
|
26
|
-
/** ListVoicesInput selects one page of account voices. */
|
|
27
|
-
interface ListVoicesInput {
|
|
28
|
-
/** PageSize is the requested page size; zero uses the provider default. */
|
|
29
|
-
"pageSize"?: number | undefined;
|
|
30
|
-
/** NextPageToken is a token returned by the preceding page; blank starts at page one. */
|
|
31
|
-
"nextPageToken"?: string | undefined;
|
|
32
|
-
}
|
|
33
|
-
/** Voice identifies an ElevenLabs voice. */
|
|
34
|
-
interface Voice {
|
|
35
|
-
/** VoiceID is the stable provider voice identifier. */
|
|
36
|
-
"voiceId": string;
|
|
37
|
-
/** Name is the display name. */
|
|
38
|
-
"name": string;
|
|
39
|
-
}
|
|
40
|
-
/** ListVoicesOutput holds one voice page. */
|
|
41
|
-
interface ListVoicesOutput {
|
|
42
|
-
/** Voices is the page of available voices. */
|
|
43
|
-
"voices": Array<Voice> | null;
|
|
44
|
-
/** HasMore reports whether another page is available. */
|
|
45
|
-
"hasMore": boolean;
|
|
46
|
-
/** NextPageToken selects the next page when HasMore is true. */
|
|
47
|
-
"nextPageToken"?: string | undefined;
|
|
48
|
-
}
|
|
49
|
-
/** CreateSpeechInput selects a voice and the text to synthesize. */
|
|
50
|
-
interface CreateSpeechInput {
|
|
51
|
-
/** VoiceID is returned by listVoices or shown in the ElevenLabs voice library. */
|
|
52
|
-
"voiceId": string;
|
|
53
|
-
/** Text is the text to speak. */
|
|
54
|
-
"text": string;
|
|
55
|
-
/** ModelID selects a text-to-speech model; blank uses eleven_multilingual_v2. */
|
|
56
|
-
"modelId"?: string | undefined;
|
|
57
|
-
}
|
|
58
|
-
/** CreateSpeechOutput holds bounded MP3 audio as base64. */
|
|
59
|
-
interface CreateSpeechOutput {
|
|
60
|
-
/** AudioBase64 is the MP3 payload encoded for Dex persistence. */
|
|
61
|
-
"audioBase64": string;
|
|
62
|
-
/** ContentType identifies the MP3 format. */
|
|
63
|
-
"contentType": string;
|
|
64
|
-
}
|
|
65
|
-
/** Runtime validator for ListVoicesInput. */
|
|
66
|
-
declare const ListVoicesInputSchema: z.ZodObject<{
|
|
67
|
-
pageSize: z.ZodOptional<z.ZodNumber>;
|
|
68
|
-
nextPageToken: z.ZodOptional<z.ZodString>;
|
|
69
|
-
}, z.core.$strict>;
|
|
70
|
-
/** Runtime validator for Voice. */
|
|
71
|
-
declare const VoiceSchema: z.ZodObject<{
|
|
72
|
-
voiceId: z.ZodString;
|
|
73
|
-
name: z.ZodString;
|
|
74
|
-
}, z.core.$strict>;
|
|
75
|
-
/** Runtime validator for ListVoicesOutput. */
|
|
76
|
-
declare const ListVoicesOutputSchema: z.ZodObject<{
|
|
77
|
-
voices: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
78
|
-
voiceId: z.ZodString;
|
|
79
|
-
name: z.ZodString;
|
|
80
|
-
}, z.core.$strict>>>;
|
|
81
|
-
hasMore: z.ZodBoolean;
|
|
82
|
-
nextPageToken: z.ZodOptional<z.ZodString>;
|
|
83
|
-
}, z.core.$strict>;
|
|
84
|
-
/** Runtime validator for CreateSpeechInput. */
|
|
85
|
-
declare const CreateSpeechInputSchema: z.ZodObject<{
|
|
86
|
-
voiceId: z.ZodString;
|
|
87
|
-
text: z.ZodString;
|
|
88
|
-
modelId: z.ZodOptional<z.ZodString>;
|
|
89
|
-
}, z.core.$strict>;
|
|
90
|
-
/** Runtime validator for CreateSpeechOutput. */
|
|
91
|
-
declare const CreateSpeechOutputSchema: z.ZodObject<{
|
|
92
|
-
audioBase64: z.ZodString;
|
|
93
|
-
contentType: z.ZodString;
|
|
94
|
-
}, z.core.$strict>;
|
|
95
|
-
|
|
96
|
-
/** Typed operations supplied by a client or mock. */
|
|
97
|
-
interface Operations {
|
|
98
|
-
/** Invoke listVoices through this connection. */
|
|
99
|
-
listVoices(): Query<ListVoicesInput, ListVoicesOutput>;
|
|
100
|
-
/** Invoke createSpeech through this connection. */
|
|
101
|
-
createSpeech(): Query<CreateSpeechInput, CreateSpeechOutput>;
|
|
102
|
-
}
|
|
103
|
-
/** Named connector connection kept outside Flow state. */
|
|
104
|
-
declare class Connection<BoundOperations = Operations> {
|
|
105
|
-
/** Stable provider and connection name. */
|
|
106
|
-
readonly reference: ConnectionRef;
|
|
107
|
-
/** Bound provider operations. */
|
|
108
|
-
readonly operations: BoundOperations;
|
|
109
|
-
/** Validate a reference and bind operations. */
|
|
110
|
-
constructor(reference: ConnectionRef, operations: BoundOperations);
|
|
111
|
-
}
|
|
112
|
-
/** Bind a client to a named connection. */
|
|
113
|
-
declare function newConnection(client: Operations, reference: ConnectionRef): Connection;
|
|
114
|
-
/** Bind scripted operations to a named connection. */
|
|
115
|
-
declare function newConnectionWithOperations(operations: Operations, reference: ConnectionRef): Connection;
|
|
116
|
-
|
|
117
|
-
export { type CreateSpeechInput as C, type ListVoicesInput as L, type Operations as O, type Voice as V, type CreateSpeechOutput as a, Connection as b, type ListVoicesOutput as c, type Config as d, type Credentials as e, ConfigSchema as f, CreateSpeechInputSchema as g, CreateSpeechOutputSchema as h, type CredentialSource as i, ListVoicesInputSchema as j, ListVoicesOutputSchema as k, VoiceSchema as l, newConnectionWithOperations as m, newConnection as n };
|