@jskit-ai/connectors-catalog 0.2.11 → 0.2.13
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/CHANGELOG.md +1 -0
- package/docs/ai-upstream-notices.md +1 -1
- package/docs/ai.md +9 -0
- package/package.json +4 -4
- package/patterns/aws-storage-queries/example/formats/package.json +1 -1
- package/src/shared/ai-definition.js +68 -0
- package/src/shared/ai-framework-models.json +7334 -0
- package/src/shared/ai-models.json +1 -7329
- package/src/shared/ai.js +8 -59
- package/src/shared/definitions.js +2 -2
- package/test/ai.test.js +16 -0
- package/test/airtable.test.js +3 -4
- package/test/algolia.test.js +3 -3
- package/test/amazon-redshift.test.js +3 -3
- package/test/amplitude.test.js +3 -3
- package/test/apify.test.js +3 -4
- package/test/apollo-io.test.js +3 -4
- package/test/asana.test.js +3 -4
- package/test/ashby.test.js +3 -4
- package/test/atlassian.test.js +3 -3
- package/test/attention.test.js +3 -4
- package/test/aws.test.js +3 -3
- package/test/brevo.test.js +3 -4
- package/test/calendly.test.js +4 -5
- package/test/canva.test.js +3 -3
- package/test/chargebee.test.js +3 -3
- package/test/clickhouse.test.js +3 -3
- package/test/confidence.test.js +3 -3
- package/test/databricks.test.js +3 -3
- package/test/dbt-semantic-layer.test.js +3 -3
- package/test/designMcp.test.js +3 -3
- package/test/elevenlabs.test.js +3 -4
- package/test/firebase-cloud-messaging.test.js +3 -3
- package/test/firecrawl.test.js +3 -4
- package/test/gemini-enterprise.test.js +3 -3
- package/test/github-api.test.js +4 -5
- package/test/gitlab-api.test.js +4 -5
- package/test/gong.test.js +3 -3
- package/test/google-ads.test.js +3 -3
- package/test/google-maps-platform.test.js +3 -3
- package/test/google.test.js +3 -4
- package/test/granola.test.js +3 -3
- package/test/hex.test.js +3 -3
- package/test/heygen.test.js +3 -4
- package/test/hubspot.test.js +3 -4
- package/test/inngest.test.js +3 -3
- package/test/lightspeed.test.js +3 -3
- package/test/linear.test.js +3 -4
- package/test/linkedin.test.js +3 -3
- package/test/mailgun.test.js +3 -4
- package/test/mapbox.test.js +3 -3
- package/test/mcp.test.js +3 -3
- package/test/microsoft-fabric.test.js +3 -3
- package/test/microsoft.test.js +3 -3
- package/test/n8nOAuth.test.js +3 -4
- package/test/notionOAuth.test.js +5 -6
- package/test/oura.test.js +3 -3
- package/test/paddlePermissions.test.js +3 -4
- package/test/pipedriveOAuth.test.js +3 -4
- package/test/posthog.test.js +3 -3
- package/test/prestashop.test.js +3 -3
- package/test/resend.test.js +3 -3
- package/test/salesforce.test.js +3 -3
- package/test/semrush.test.js +3 -3
- package/test/sharedCatalogModels.test.js +21 -0
- package/test/shopify.test.js +3 -3
- package/test/slack.test.js +3 -3
- package/test/snowflake.test.js +3 -3
- package/test/tally.test.js +3 -4
- package/test/telegram.test.js +3 -4
- package/test/testDirectories.test.js +16 -0
- package/test/tiktok.test.js +3 -3
- package/test/tokens.test.js +3 -3
- package/test/twilio.test.js +3 -3
- package/test/twitch.test.js +3 -3
- package/test/wave.test.js +3 -3
- package/test/wix.test.js +3 -3
- package/test/wiz.test.js +3 -3
- package/test/wordpress-com.test.js +3 -3
- package/test/wordpress.test.js +3 -3
- package/test/workday.test.js +3 -3
- package/test/x-twitter.test.js +3 -3
- package/test/xero.test.js +3 -3
- package/test/zoho-books.test.js +3 -3
- package/test/zoho-crm.test.js +3 -3
package/src/shared/ai.js
CHANGED
|
@@ -1,73 +1,22 @@
|
|
|
1
|
-
import
|
|
1
|
+
import framework from "./ai-framework-models.json" with { type: "json" };
|
|
2
|
+
import { aiAccessLabels, aiDefinition, byAccessThenKey, catalogueProvider, configurableProviders } from "./ai-definition.js";
|
|
2
3
|
import snapshot from "./ai-models.json" with { type: "json" };
|
|
3
4
|
|
|
4
|
-
//
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
unknown: "jskit.connectors.ai.access.unknown"
|
|
10
|
-
});
|
|
11
|
-
const selectedModelHints = Object.freeze({
|
|
12
|
-
"free-no-setup": "jskit.connectors.ai.fields.model.selectedHint.freeNoSetup",
|
|
13
|
-
"free-with-connection": "jskit.connectors.ai.fields.model.selectedHint.freeWithConnection",
|
|
14
|
-
paid: "jskit.connectors.ai.fields.model.selectedHint.paid",
|
|
15
|
-
unknown: "jskit.connectors.ai.fields.model.selectedHint.unknown"
|
|
16
|
-
});
|
|
17
|
-
// These direct API-key routes need no coding subscription or cloud identity
|
|
18
|
-
// exchange. Other upstream entries remain available as framework metadata.
|
|
19
|
-
const directProviders = new Set(["opencode", "zai", "openai", "anthropic", "deepseek", "google", "openrouter",
|
|
20
|
-
"groq", "mistral", "xai", "cerebras", "togetherai", "perplexity"]);
|
|
21
|
-
const aiCatalogue = Object.freeze({ ...snapshot, providers: Object.freeze(snapshot.providers.map((provider) => Object.freeze({
|
|
22
|
-
...provider, connection: directProviders.has(provider.id) ? "api-key" : "framework",
|
|
23
|
-
models: Object.freeze(provider.models.map((model) => Object.freeze({ ...model, key: `${provider.id}/${model.id}`, providerId: provider.id })))
|
|
24
|
-
}))) });
|
|
25
|
-
const catalogueDateFormat = Object.freeze({ day: "numeric", month: "long", year: "numeric", timeZone: "UTC" });
|
|
5
|
+
// The whole model catalogue: the configurable providers and the framework-metadata ones (other upstream entries,
|
|
6
|
+
// not configurable), in provider id order.
|
|
7
|
+
const aiCatalogue = Object.freeze({ ...snapshot, providers: Object.freeze([...configurableProviders,
|
|
8
|
+
...framework.providers.map((provider) => catalogueProvider(provider, "framework"))]
|
|
9
|
+
.sort((a, b) => (a.id < b.id ? -1 : 1))) });
|
|
26
10
|
const models = new Map(aiCatalogue.providers.flatMap((provider) => provider.models.map((model) => [model.key, model])));
|
|
27
11
|
|
|
28
12
|
function getAiModel(key) { return models.get(key); }
|
|
29
13
|
|
|
30
14
|
function listAiModels({ providerId, access, includeDeprecated = false, configurableOnly = false } = {}) {
|
|
31
|
-
const order = ["free-no-setup", "free-with-connection", "paid", "unknown"];
|
|
32
15
|
return aiCatalogue.providers.filter((provider) => (!providerId || provider.id === providerId) &&
|
|
33
16
|
(!configurableOnly || provider.connection === "api-key"))
|
|
34
17
|
.flatMap((provider) => provider.models).filter((model) =>
|
|
35
18
|
(includeDeprecated || model.status !== "deprecated") && (!access || model.access === access))
|
|
36
|
-
.sort(
|
|
19
|
+
.sort(byAccessThenKey);
|
|
37
20
|
}
|
|
38
21
|
|
|
39
|
-
const modelItems = Object.freeze(listAiModels({ configurableOnly: true }).map((model) => Object.freeze({
|
|
40
|
-
value: model.key, title: `${model.name} (${model.providerId})`, props: { subtitle: aiAccessLabels[model.access] }
|
|
41
|
-
})));
|
|
42
|
-
const aiDefinition = Object.freeze({
|
|
43
|
-
id: "ai", name: "AI", description: "jskit.connectors.ai.description",
|
|
44
|
-
accountModes: ["shared", "per-user"], authenticationMethods: ["api-key", "none"], scopes: [],
|
|
45
|
-
authenticationMethodsForSettings: (settings = {}) => getAiModel(settings.model)?.access === "free-no-setup"
|
|
46
|
-
? ["none", "api-key"] : ["api-key"],
|
|
47
|
-
authenticationLabels: { none: "jskit.connectors.ai.authenticationLabels.none", "api-key": "jskit.connectors.ai.authenticationLabels.apiKey" },
|
|
48
|
-
authenticationHint: "jskit.connectors.ai.authenticationHint",
|
|
49
|
-
settingsSchema: createSchema({ model: { type: "string", required: true,
|
|
50
|
-
enum: modelItems.map((item) => item.value) } }),
|
|
51
|
-
settingsFields: [{ name: "model", label: "jskit.connectors.ai.fields.model.label", searchable: true, items: modelItems,
|
|
52
|
-
credentialScope: (key) => getAiModel(key)?.providerId,
|
|
53
|
-
// The catalogue date is display text: formatDate (useJskitText's) uses the app's active
|
|
54
|
-
// locale; without an app language it keeps its fixed English form.
|
|
55
|
-
hint: (settings = {}, { formatDate } = {}) => {
|
|
56
|
-
const model = getAiModel(settings.model);
|
|
57
|
-
const date = formatDate ? formatDate(snapshot.extractedAt, catalogueDateFormat)
|
|
58
|
-
: new Date(snapshot.extractedAt).toLocaleDateString("en-GB", catalogueDateFormat);
|
|
59
|
-
return model ? { key: selectedModelHints[model.access], params: { model: model.name, date } }
|
|
60
|
-
: { key: "jskit.connectors.ai.fields.model.hint", params: { date } };
|
|
61
|
-
} }],
|
|
62
|
-
apiKeyReferenceHint: "jskit.connectors.ai.apiKeyReferenceHint",
|
|
63
|
-
setup: {
|
|
64
|
-
url: "https://opencode.ai/docs/zen/",
|
|
65
|
-
steps: [
|
|
66
|
-
"Choose a provider and model; no model is preselected. Create a regular API key in that provider's dashboard. Z.AI's GLM-4.7-Flash uses a regular Z.AI key; its Coding Plan is a different product.",
|
|
67
|
-
"For a shared account, store the administrator's key in Env. For individual accounts, your application must provide private key entry, storage and disconnect controls for each authenticated user.",
|
|
68
|
-
"Saving selects configuration; it does not verify a provider account or install an AI library into your application. Follow the AI connection guide for the selected framework."
|
|
69
|
-
]
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
|
|
73
22
|
export { aiCatalogue, aiAccessLabels, aiDefinition, getAiModel, listAiModels };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { aiDefinition } from "./ai.js";
|
|
2
|
-
export { aiDefinition } from "./ai.js";
|
|
1
|
+
import { aiDefinition } from "./ai-definition.js";
|
|
2
|
+
export { aiDefinition } from "./ai-definition.js";
|
|
3
3
|
import { wizDefinition } from "./wiz.js";
|
|
4
4
|
export { wizDefinition } from "./wiz.js";
|
|
5
5
|
import { shopifyDefinition } from "./shopify.js";
|
package/test/ai.test.js
CHANGED
|
@@ -25,6 +25,22 @@ test("AI retains the attributed snapshot with reviewed current identities and ex
|
|
|
25
25
|
assert.equal(aiCatalogue.providers.find((provider) => provider.id === "amazon-bedrock").connection, "framework");
|
|
26
26
|
});
|
|
27
27
|
|
|
28
|
+
test("the AI definition answers every configurable model as the whole catalogue does", () => {
|
|
29
|
+
const field = aiDefinition.settingsFields[0];
|
|
30
|
+
assert.deepEqual(field.items.map((item) => item.value), listAiModels({ configurableOnly: true }).map((model) => model.key));
|
|
31
|
+
assert.deepEqual(aiDefinition.settingsSchema.getFieldDefinitions().model.enum, field.items.map((item) => item.value));
|
|
32
|
+
const configurable = listAiModels({ configurableOnly: true, includeDeprecated: true });
|
|
33
|
+
assert.equal(new Set(configurable.map((model) => model.providerId)).size, 13);
|
|
34
|
+
for (const model of configurable) {
|
|
35
|
+
assert.equal(field.credentialScope(model.key), model.providerId);
|
|
36
|
+
assert.deepEqual(aiDefinition.authenticationMethodsForSettings({ model: model.key }),
|
|
37
|
+
model.access === "free-no-setup" ? ["none", "api-key"] : ["api-key"]);
|
|
38
|
+
assert.equal(field.hint({ model: model.key }).params.model, model.name);
|
|
39
|
+
}
|
|
40
|
+
assert.deepEqual(aiCatalogue.providers.map((provider) => provider.id),
|
|
41
|
+
aiCatalogue.providers.map((provider) => provider.id).sort());
|
|
42
|
+
});
|
|
43
|
+
|
|
28
44
|
test("DeepSeek retains provider-supported saved aliases and exact current model limits", async () => {
|
|
29
45
|
const current = "deepseek/deepseek-flash";
|
|
30
46
|
assert.equal(getAiModel(current).name, "DeepSeek V4.1 Flash");
|
package/test/airtable.test.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import {
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
5
|
-
import path from "node:path";
|
|
3
|
+
import { rm } from "node:fs/promises";
|
|
6
4
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
7
5
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
8
6
|
import { airtableProvider } from "../src/server/airtable.js";
|
|
7
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
9
8
|
|
|
10
9
|
const context = { applicationId: "records-app", subjectId: "workspace" };
|
|
11
10
|
const baseId = "appFixture";
|
|
@@ -13,7 +12,7 @@ const tableId = "tblFixture";
|
|
|
13
12
|
const recordId = "recFixture";
|
|
14
13
|
|
|
15
14
|
test("Airtable discovers schema, changes tables/fields and completes a paged record lifecycle", async t => {
|
|
16
|
-
const directory = await
|
|
15
|
+
const directory = await makeTestDirectory("airtable-repair-");
|
|
17
16
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
18
17
|
const requests = [];
|
|
19
18
|
let fail = false;
|
package/test/algolia.test.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import {
|
|
3
|
+
import { readdir, readFile, rm } from "node:fs/promises";
|
|
4
4
|
import path from "node:path";
|
|
5
|
-
import { tmpdir } from "node:os";
|
|
6
5
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
7
6
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
8
7
|
import { parseIntegrationConfiguration } from "../../connectors-core/src/shared/configuration.js";
|
|
9
8
|
import { algoliaProvider } from "../src/server/algolia.js";
|
|
9
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
10
10
|
|
|
11
11
|
const context = { applicationId: "app-one", subjectId: "team-one" };
|
|
12
12
|
const input = { context, integrationId: "search" };
|
|
@@ -14,7 +14,7 @@ const indices = { items: [{ name: "products", entries: 20 }], nbPages: 2 };
|
|
|
14
14
|
const hits = { hits: [{ objectID: "product-1", name: "Phone" }], nbHits: 21, nbPages: 2, page: 0, hitsPerPage: 20 };
|
|
15
15
|
|
|
16
16
|
async function fixture(t) {
|
|
17
|
-
const directory = await
|
|
17
|
+
const directory = await makeTestDirectory("algolia-connector-");
|
|
18
18
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
19
19
|
const protection = createCredentialProtection({ keys: { current: new Uint8Array(32).fill(7) }, activeKeyId: "current" });
|
|
20
20
|
const requests = [];
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import {
|
|
3
|
+
import { readdir, readFile, rm } from "node:fs/promises";
|
|
4
4
|
import path from "node:path";
|
|
5
|
-
import { tmpdir } from "node:os";
|
|
6
5
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
7
6
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
8
7
|
import { parseIntegrationConfiguration, getProviderSettingsSchema } from "../../connectors-core/src/shared/configuration.js";
|
|
9
8
|
import { connectorDefinitions } from "../src/shared/definitions.js";
|
|
10
9
|
import { amazonRedshiftProvider as provider } from "../src/server/amazon-redshift.js";
|
|
10
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
11
11
|
|
|
12
12
|
const context = { applicationId: "reports", subjectId: "owner" };
|
|
13
13
|
const input = { context, integrationId: "warehouse" };
|
|
@@ -16,7 +16,7 @@ const columns = [{ name: "id", typeName: "int8" }];
|
|
|
16
16
|
const table = { name: "sales", schema: "public", type: "TABLE" };
|
|
17
17
|
|
|
18
18
|
async function fixture(t, deploymentType = "serverless", databaseUser) {
|
|
19
|
-
const directory = await
|
|
19
|
+
const directory = await makeTestDirectory("redshift-connector-");
|
|
20
20
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
21
21
|
const protection = createCredentialProtection({ keys: { current: new Uint8Array(32).fill(6) }, activeKeyId: "current" });
|
|
22
22
|
const requests = [], resolutions = [];
|
package/test/amplitude.test.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import {
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
3
|
+
import { readdir, readFile, rm } from "node:fs/promises";
|
|
5
4
|
import path from "node:path";
|
|
6
5
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
7
6
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
8
7
|
import { parseIntegrationConfiguration } from "../../connectors-core/src/shared/configuration.js";
|
|
9
8
|
import { amplitudeProvider, registerAmplitudeClient } from "../src/server/amplitude.js";
|
|
9
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
10
10
|
|
|
11
11
|
const context = { applicationId: "assistant-host", subjectId: "account-owner" };
|
|
12
12
|
const input = { context, integrationId: "analytics" };
|
|
@@ -15,7 +15,7 @@ const scopes = ["mcp:read", "offline_access"];
|
|
|
15
15
|
const discovery = { tools: [{ name: "get_amplitude_context", inputSchema: { type: "object", properties: { project_id: { type: "string" } } } }] };
|
|
16
16
|
|
|
17
17
|
async function fixture(t, region = "us") {
|
|
18
|
-
const directory = await
|
|
18
|
+
const directory = await makeTestDirectory("amplitude-connector-");
|
|
19
19
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
20
20
|
const protection = createCredentialProtection({ keys: { current: new Uint8Array(32).fill(3) }, activeKeyId: "current" });
|
|
21
21
|
const origin = region === "eu" ? "https://mcp.eu.amplitude.com" : "https://mcp.amplitude.com";
|
package/test/apify.test.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import {
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
5
|
-
import path from "node:path";
|
|
3
|
+
import { rm } from "node:fs/promises";
|
|
6
4
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
7
5
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
8
6
|
import { apifyProvider } from "../src/server/apify.js";
|
|
7
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
9
8
|
|
|
10
9
|
const context = { applicationId: "scraping-app", subjectId: "workspace" };
|
|
11
10
|
test("Apify submits a bounded run, observes terminal states, aborts and retrieves paged storage results", async t => {
|
|
12
|
-
const directory = await
|
|
11
|
+
const directory = await makeTestDirectory("apify-repair-");
|
|
13
12
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
14
13
|
const requests = [];
|
|
15
14
|
let runStatus = "RUNNING";
|
package/test/apollo-io.test.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import {
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
5
|
-
import path from "node:path";
|
|
3
|
+
import { rm } from "node:fs/promises";
|
|
6
4
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
7
5
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
8
6
|
import { apolloIoProvider } from "../src/server/apollo-io.js";
|
|
7
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
9
8
|
|
|
10
9
|
test("Apollo prospects, explicit enrichment and CRM changes run through the application-owned connection", async t => {
|
|
11
|
-
const directory = await
|
|
10
|
+
const directory = await makeTestDirectory("apollo-repair-");
|
|
12
11
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
13
12
|
const requests = [];
|
|
14
13
|
const state = { response: { accounts: [] }, status: 200, fail: false, deny: false, key: "fixture-apollo-key" };
|
package/test/asana.test.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import {
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
5
|
-
import path from "node:path";
|
|
3
|
+
import { rm } from "node:fs/promises";
|
|
6
4
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
7
5
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
8
6
|
import { asanaProvider } from "../src/server/asana.js";
|
|
7
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
9
8
|
|
|
10
9
|
test("Asana creates a private project, explicitly shares it, tracks tasks and preserves sparse changes", async t => {
|
|
11
|
-
const directory = await
|
|
10
|
+
const directory = await makeTestDirectory("asana-repair-");
|
|
12
11
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
13
12
|
const requests = [];
|
|
14
13
|
const state = { status: 200, response: { data: [{ gid: "123" }] }, fail: false, deny: false, key: "asana-fixture" };
|
package/test/ashby.test.js
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import {
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
5
|
-
import path from "node:path";
|
|
3
|
+
import { rm } from "node:fs/promises";
|
|
6
4
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
7
5
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
8
6
|
import { ashbyProvider } from "../src/server/ashby.js";
|
|
7
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
9
8
|
|
|
10
9
|
const id = "11111111-1111-4111-8111-111111111111";
|
|
11
10
|
const stage = "22222222-2222-4222-8222-222222222222";
|
|
12
11
|
test("Ashby syncs candidates/applications, updates a profile and explicitly advances a sourced application", async t => {
|
|
13
|
-
const directory = await
|
|
12
|
+
const directory = await makeTestDirectory("ashby-repair-");
|
|
14
13
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
15
14
|
const requests = [];
|
|
16
15
|
const state = { status: 200, response: { success: true, results: [], moreDataAvailable: false }, fail: false, deny: false };
|
package/test/atlassian.test.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import {
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
3
|
+
import { readdir, readFile, rm } from "node:fs/promises";
|
|
5
4
|
import path from "node:path";
|
|
6
5
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
7
6
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
8
7
|
import { parseIntegrationConfiguration } from "../../connectors-core/src/shared/configuration.js";
|
|
9
8
|
import { atlassianProvider, registerAtlassianClient } from "../src/server/atlassian.js";
|
|
9
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
10
10
|
|
|
11
11
|
const context = { applicationId: "assistant-host", subjectId: "account-owner" };
|
|
12
12
|
const input = { context, integrationId: "work" };
|
|
@@ -19,7 +19,7 @@ const scopes = ["read:me", "read:jira:agent-interface", "offline_access"];
|
|
|
19
19
|
const discovery = { tools: [{ name: "getJiraIssue", inputSchema: { type: "object", properties: { cloudId: { type: "string" } } } }] };
|
|
20
20
|
|
|
21
21
|
async function fixture(t) {
|
|
22
|
-
const directory = await
|
|
22
|
+
const directory = await makeTestDirectory("atlassian-connector-");
|
|
23
23
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
24
24
|
const protection = createCredentialProtection({ keys: { current: new Uint8Array(32).fill(3) }, activeKeyId: "current" });
|
|
25
25
|
const state = { time: Date.now(), scopes, status: 200, list: discovery, call: { content: [{ type: "text", text: "Project work" }] } };
|
package/test/attention.test.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import {
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
5
|
-
import path from "node:path";
|
|
3
|
+
import { rm } from "node:fs/promises";
|
|
6
4
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
7
5
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
8
6
|
import { attentionProvider } from "../src/server/attention.js";
|
|
7
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
9
8
|
|
|
10
9
|
test("Attention preserves full call content and supports explicit coaching and organization workflows", async t => {
|
|
11
|
-
const directory = await
|
|
10
|
+
const directory = await makeTestDirectory("attention-repair-");
|
|
12
11
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
13
12
|
const requests = [];
|
|
14
13
|
const state = { status: 200, response: { data: [] }, fail: false, deny: false };
|
package/test/aws.test.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import {
|
|
3
|
+
import { readdir, readFile, rm } from "node:fs/promises";
|
|
4
4
|
import path from "node:path";
|
|
5
|
-
import { tmpdir } from "node:os";
|
|
6
5
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
7
6
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
8
7
|
import { parseIntegrationConfiguration } from "../../connectors-core/src/shared/configuration.js";
|
|
9
8
|
import { awsS3Provider } from "../src/server/aws-s3.js";
|
|
10
9
|
import { awsAthenaProvider } from "../src/server/aws-athena.js";
|
|
11
10
|
import { transferS3Object } from "../patterns/aws-storage-queries/example/s3-transfer.js";
|
|
11
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
12
12
|
|
|
13
13
|
const context = { applicationId: "reports", subjectId: "owner" };
|
|
14
14
|
const input = { context, integrationId: "aws" };
|
|
@@ -18,7 +18,7 @@ const query = { QueryExecution: { QueryExecutionId: "query-1", WorkGroup: "prima
|
|
|
18
18
|
const results = { ResultSet: { ResultSetMetadata: { ColumnInfo: [{ Name: "id", Type: "bigint" }] }, Rows: [{ Data: [{ VarCharValue: "id" }] }, { Data: [{}] }] }, NextToken: "opaque +/=", UpdateCount: 0 };
|
|
19
19
|
|
|
20
20
|
async function fixture(t, provider = awsS3Provider) {
|
|
21
|
-
const directory = await
|
|
21
|
+
const directory = await makeTestDirectory("aws-connector-");
|
|
22
22
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
23
23
|
const protection = createCredentialProtection({ keys: { current: new Uint8Array(32).fill(5) }, activeKeyId: "current" });
|
|
24
24
|
const requests = [], resolutions = [];
|
package/test/brevo.test.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import {
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
5
|
-
import path from "node:path";
|
|
3
|
+
import { rm } from "node:fs/promises";
|
|
6
4
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
7
5
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
8
6
|
import { brevoProvider } from "../src/server/brevo.js";
|
|
7
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
9
8
|
|
|
10
9
|
test("Brevo explicitly sends messages and campaigns, manages contacts and retains DNS and delivery state", async t => {
|
|
11
|
-
const directory = await
|
|
10
|
+
const directory = await makeTestDirectory("brevo-repair-"); t.after(() => rm(directory, { recursive: true, force: true }));
|
|
12
11
|
const requests = []; const state = { response: { contacts: [], count: 0 }, status: 200, deny: false, fail: false };
|
|
13
12
|
const identity = { context: { applicationId: "booking-app", subjectId: "owner" }, integrationId: "messaging" };
|
|
14
13
|
const service = createConnectionService({ configuration: { schemaVersion: 1, registrations: {}, integrations: {
|
package/test/calendly.test.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import {
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
5
|
-
import path from "node:path";
|
|
3
|
+
import { rm } from "node:fs/promises";
|
|
6
4
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
7
5
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
8
6
|
import { calendlyProvider } from "../src/server/calendly.js";
|
|
7
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
9
8
|
|
|
10
9
|
test("Calendly web OAuth uses Basic and PKCE, persists rotating refresh tokens and retains personal-token access", async (t) => {
|
|
11
|
-
const directory = await
|
|
10
|
+
const directory = await makeTestDirectory("calendly-test-");
|
|
12
11
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
13
12
|
const callback = "https://example.test/integrations/calendly/callback";
|
|
14
13
|
const context = { applicationId: "app", subjectId: "owner" };
|
|
@@ -88,7 +87,7 @@ test("Calendly web OAuth uses Basic and PKCE, persists rotating refresh tokens a
|
|
|
88
87
|
});
|
|
89
88
|
|
|
90
89
|
test("Calendly scheduling retains booking details, scopes, pagination and explicit write outcomes", async t => {
|
|
91
|
-
const directory = await
|
|
90
|
+
const directory = await makeTestDirectory("calendly-scheduling-"); t.after(() => rm(directory, { recursive: true, force: true }));
|
|
92
91
|
const requests = []; const state = { response: { resource: { uri: "https://api.calendly.com/users/u", name: "Owner" } }, status: 200, fail: false, deny: false };
|
|
93
92
|
const identity = { context: { applicationId: "booking", subjectId: "owner" }, integrationId: "calendar" };
|
|
94
93
|
const service = createConnectionService({ configuration: { schemaVersion: 1, registrations: {}, integrations: {
|
package/test/canva.test.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import {
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
3
|
+
import { readdir, readFile, rm } from "node:fs/promises";
|
|
5
4
|
import path from "node:path";
|
|
6
5
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
7
6
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
@@ -9,6 +8,7 @@ import { parseIntegrationConfiguration } from "../../connectors-core/src/shared/
|
|
|
9
8
|
import { canvaProvider } from "../src/server/canva.js";
|
|
10
9
|
|
|
11
10
|
import { createCanvaClientMetadata } from "../src/shared/canva.js";
|
|
11
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
12
12
|
|
|
13
13
|
const context = { applicationId: "assistant-host", subjectId: "account-owner" };
|
|
14
14
|
const input = { context, integrationId: "work" };
|
|
@@ -21,7 +21,7 @@ const scopes = ["profile:read", "design:meta:read"];
|
|
|
21
21
|
const discovery = { tools: [{ name: "get-design", inputSchema: { type: "object", properties: { design_id: { type: "string" } } } }] };
|
|
22
22
|
|
|
23
23
|
async function fixture(t, selectedScopes = scopes) {
|
|
24
|
-
const directory = await
|
|
24
|
+
const directory = await makeTestDirectory("canva-connector-");
|
|
25
25
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
26
26
|
const protection = createCredentialProtection({ keys: { current: new Uint8Array(32).fill(3) }, activeKeyId: "current" });
|
|
27
27
|
const state = { time: Date.now(), scopes: selectedScopes, status: 200, list: discovery, call: { content: [{ type: "text", text: "Project work" }] } };
|
package/test/chargebee.test.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import {
|
|
3
|
+
import { readdir, readFile, rm } from "node:fs/promises";
|
|
4
4
|
import path from "node:path";
|
|
5
|
-
import { tmpdir } from "node:os";
|
|
6
5
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
7
6
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
8
7
|
import { parseIntegrationConfiguration } from "../../connectors-core/src/shared/configuration.js";
|
|
9
8
|
import { chargebeeProvider } from "../src/server/chargebee.js";
|
|
9
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
10
10
|
|
|
11
11
|
const context = { applicationId: "billing-app", subjectId: "finance-team" };
|
|
12
12
|
const input = { context, integrationId: "billing" };
|
|
13
13
|
const customers = { list: [{ customer: { id: "customer-1", object: "customer", first_name: "Alex" } }] };
|
|
14
14
|
|
|
15
15
|
async function fixture(t) {
|
|
16
|
-
const directory = await
|
|
16
|
+
const directory = await makeTestDirectory("chargebee-connector-");
|
|
17
17
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
18
18
|
const protection = createCredentialProtection({ keys: { current: new Uint8Array(32).fill(6) }, activeKeyId: "current" });
|
|
19
19
|
const requests = [];
|
package/test/clickhouse.test.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import {
|
|
3
|
+
import { readdir, readFile, rm } from "node:fs/promises";
|
|
4
4
|
import path from "node:path";
|
|
5
|
-
import { tmpdir } from "node:os";
|
|
6
5
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
7
6
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
8
7
|
import { parseIntegrationConfiguration } from "../../connectors-core/src/shared/configuration.js";
|
|
9
8
|
import { clickhouseProvider } from "../src/server/clickhouse.js";
|
|
9
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
10
10
|
|
|
11
11
|
const context = { applicationId: "analytics-app", subjectId: "owner" };
|
|
12
12
|
const input = { context, integrationId: "warehouse" };
|
|
13
13
|
const checked = { meta: [{ name: "ok", type: "UInt8" }, { name: "user", type: "String" }], data: [{ ok: 1, user: "reader" }], rows: 1 };
|
|
14
14
|
|
|
15
15
|
async function fixture(t, authentication = { method: "api-key", secretRef: "env:CLICKHOUSE_PASSWORD" }) {
|
|
16
|
-
const directory = await
|
|
16
|
+
const directory = await makeTestDirectory("clickhouse-connector-");
|
|
17
17
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
18
18
|
const protection = createCredentialProtection({ keys: { current: new Uint8Array(32).fill(5) }, activeKeyId: "current" });
|
|
19
19
|
const requests = [];
|
package/test/confidence.test.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import {
|
|
3
|
+
import { readdir, readFile, rm } from "node:fs/promises";
|
|
4
4
|
import path from "node:path";
|
|
5
|
-
import { tmpdir } from "node:os";
|
|
6
5
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
7
6
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
8
7
|
import { parseIntegrationConfiguration } from "../../connectors-core/src/shared/configuration.js";
|
|
9
8
|
import { confidenceFlagsProvider, confidenceExpProvider, registerConfidenceClient } from "../src/server/confidence.js";
|
|
9
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
10
10
|
|
|
11
11
|
const scopes = ["openid", "profile", "email", "offline_access"];
|
|
12
12
|
const context = { applicationId: "assistant", subjectId: "owner" };
|
|
@@ -18,7 +18,7 @@ const specs = [
|
|
|
18
18
|
{ provider: confidenceExpProvider, path: "experiments", name: "get_experiment", arguments: { name: "workflows/abtest/instances/approved" } }
|
|
19
19
|
];
|
|
20
20
|
async function fixture(t, spec) {
|
|
21
|
-
const directory = await
|
|
21
|
+
const directory = await makeTestDirectory("confidence-connector-");
|
|
22
22
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
23
23
|
const requests = [];
|
|
24
24
|
const state = { time: Date.now(), scopes, status: 200,
|
package/test/databricks.test.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import {
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
3
|
+
import { readdir, readFile, rm } from "node:fs/promises";
|
|
5
4
|
import path from "node:path";
|
|
6
5
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
7
6
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
8
7
|
import { getProviderScopes, parseIntegrationConfiguration } from "../../connectors-core/src/shared/configuration.js";
|
|
9
8
|
import { databricksProvider } from "../src/server/databricks.js";
|
|
9
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
10
10
|
|
|
11
11
|
const context = { applicationId: "app-one", subjectId: "owner-one" };
|
|
12
12
|
const args = { context, integrationId: "warehouse" };
|
|
@@ -14,7 +14,7 @@ const callback = "https://app.example.test/oauth/databricks/callback";
|
|
|
14
14
|
const job = { job_id: 123, settings: { name: "Weekly inventory", tasks: [] } };
|
|
15
15
|
|
|
16
16
|
async function fixture(t, grantType = "authorization_code", workspaceUrl = "https://dbc-abc123.cloud.databricks.com") {
|
|
17
|
-
const directory = await
|
|
17
|
+
const directory = await makeTestDirectory("databricks-connector-");
|
|
18
18
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
19
19
|
const machine = grantType === "client_credentials";
|
|
20
20
|
const scopes = machine ? ["jobs"] : ["all-apis", "offline_access"];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import {
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
3
|
+
import { readdir, readFile, rm } from "node:fs/promises";
|
|
5
4
|
import path from "node:path";
|
|
6
5
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
7
6
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
8
7
|
import { parseIntegrationConfiguration } from "../../connectors-core/src/shared/configuration.js";
|
|
9
8
|
import { dbtSemanticLayerProvider } from "../src/server/dbt-semantic-layer.js";
|
|
9
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
10
10
|
|
|
11
11
|
const context = { applicationId: "metrics-app", subjectId: "analytics-team" };
|
|
12
12
|
const input = { context, integrationId: "metrics" };
|
|
@@ -14,7 +14,7 @@ const environmentId = "9007199254740993";
|
|
|
14
14
|
const metric = { name: "order_total", description: null, type: "SIMPLE" };
|
|
15
15
|
const page = (items, values = {}) => ({ items, pageNum: 1, pageSize: 20, totalItems: items.length, totalPages: items.length ? 1 : 0, ...values });
|
|
16
16
|
async function fixture(t, host = "semantic-layer.cloud.getdbt.com") {
|
|
17
|
-
const directory = await
|
|
17
|
+
const directory = await makeTestDirectory("dbt-connector-");
|
|
18
18
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
19
19
|
const requests = [];
|
|
20
20
|
const state = { key: "fixture-dbt-token", status: 200, response: undefined, hang: false, resolutions: 0 };
|
package/test/designMcp.test.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import {
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
3
|
+
import { readdir, readFile, rm } from "node:fs/promises";
|
|
5
4
|
import path from "node:path";
|
|
6
5
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
7
6
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
@@ -10,6 +9,7 @@ import { figmaProvider, registerFigmaClient } from "../src/server/figma.js";
|
|
|
10
9
|
import { miroProvider, registerMiroClient } from "../src/server/miro.js";
|
|
11
10
|
import { sanityProvider, registerSanityClient } from "../src/server/sanity.js";
|
|
12
11
|
import { sentryProvider, registerSentryClient } from "../src/server/sentry.js";
|
|
12
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
13
13
|
|
|
14
14
|
const context = { applicationId: "assistant-host", subjectId: "account-owner" };
|
|
15
15
|
const input = { context, integrationId: "design" };
|
|
@@ -37,7 +37,7 @@ const cases = [
|
|
|
37
37
|
];
|
|
38
38
|
|
|
39
39
|
async function fixture(t, spec) {
|
|
40
|
-
const directory = await
|
|
40
|
+
const directory = await makeTestDirectory(`${spec.provider.id}-connector-`);
|
|
41
41
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
42
42
|
const protection = createCredentialProtection({ keys: { current: new Uint8Array(32).fill(3) }, activeKeyId: "current" });
|
|
43
43
|
const state = { time: Date.now(), scopes: spec.scopes, status: 200,
|
package/test/elevenlabs.test.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
|
-
import {
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
5
|
-
import path from "node:path";
|
|
3
|
+
import { rm } from "node:fs/promises";
|
|
6
4
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
7
5
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
8
6
|
import { elevenlabsProvider } from "../src/server/elevenlabs.js";
|
|
7
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
9
8
|
|
|
10
9
|
test("ElevenLabs returns playable audio and creates a consented voice clone with verification status", async t => {
|
|
11
|
-
const directory = await
|
|
10
|
+
const directory = await makeTestDirectory("elevenlabs-repair-"); t.after(() => rm(directory, { recursive: true, force: true }));
|
|
12
11
|
const context = { applicationId: "voice-app", subjectId: "workspace" }; const requests = [];
|
|
13
12
|
let responseMode = "audio"; let status = 200; let deny = false; let fail = false;
|
|
14
13
|
const service = createConnectionService({
|