@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/test/oura.test.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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 { ouraProvider } from "../src/server/oura.js";
|
|
8
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
9
9
|
|
|
10
10
|
const callback = "https://app.example.test/oura/callback";
|
|
11
11
|
const context = { applicationId: "app-one", subjectId: "user-one" };
|
|
@@ -13,7 +13,7 @@ const input = { context, integrationId: "oura" };
|
|
|
13
13
|
const daily = { data: [{ id: "sleep-1", day: "2026-09-01", score: 82 }], next_token: "next +&2" };
|
|
14
14
|
|
|
15
15
|
async function fixture(t) {
|
|
16
|
-
const directory = await
|
|
16
|
+
const directory = await makeTestDirectory("oura-connector-");
|
|
17
17
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
18
18
|
const requests = [];
|
|
19
19
|
const state = { time: Date.now(), tokenCount: 0, tokenScope: undefined, status: 200, response: daily };
|
|
@@ -2,6 +2,7 @@ import test from "node:test";
|
|
|
2
2
|
import assert from "node:assert/strict";
|
|
3
3
|
import { paddleProvider } from "../src/server/paddle.js";
|
|
4
4
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
5
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
5
6
|
|
|
6
7
|
test("Paddle maps reads to the captured permission and requires exact host approval without executing payments", async () => {
|
|
7
8
|
let approved = false;
|
|
@@ -33,11 +34,9 @@ test("Paddle maps reads to the captured permission and requires exact host appro
|
|
|
33
34
|
});
|
|
34
35
|
|
|
35
36
|
test("Paddle product and recurring-price writes validate inputs and do not retry failures", async (t) => {
|
|
36
|
-
const {
|
|
37
|
-
const { tmpdir } = await import("node:os");
|
|
38
|
-
const { join } = await import("node:path");
|
|
37
|
+
const { rm } = await import("node:fs/promises");
|
|
39
38
|
const { createFileConnectionStore, createCredentialProtection } = await import("../../connectors-core/src/server/fileStorage.js");
|
|
40
|
-
const directory = await
|
|
39
|
+
const directory = await makeTestDirectory("paddle-writes-");
|
|
41
40
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
42
41
|
const writes = [];
|
|
43
42
|
let fail = false;
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import test from "node:test";
|
|
2
2
|
import assert from "node:assert/strict";
|
|
3
|
-
import {
|
|
4
|
-
import { tmpdir } from "node:os";
|
|
5
|
-
import { join } from "node:path";
|
|
3
|
+
import { rm } from "node:fs/promises";
|
|
6
4
|
import { pipedriveProvider } from "../src/server/pipedrive.js";
|
|
7
5
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
8
6
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
7
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
9
8
|
|
|
10
9
|
async function fixture(t, fetchImpl) {
|
|
11
|
-
const directory = await
|
|
10
|
+
const directory = await makeTestDirectory("pipedrive-oauth-");
|
|
12
11
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
13
12
|
const protection = createCredentialProtection({ keys: { current: new Uint8Array(32).fill(7) }, activeKeyId: "current" });
|
|
14
13
|
let now = Date.now();
|
package/test/posthog.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 { posthogProvider } from "../src/server/posthog.js";
|
|
9
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
10
10
|
|
|
11
11
|
const context = { applicationId: "app-one", subjectId: "analytics-team" };
|
|
12
12
|
const input = { context, integrationId: "analytics" };
|
|
@@ -16,7 +16,7 @@ const flags = { flags: { checkout: { key: "checkout", enabled: true, variant: "c
|
|
|
16
16
|
errorsWhileComputingFlags: false, requestId: "fixture-request" };
|
|
17
17
|
|
|
18
18
|
async function fixture(t, region = "eu") {
|
|
19
|
-
const directory = await
|
|
19
|
+
const directory = await makeTestDirectory("posthog-connector-");
|
|
20
20
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
21
21
|
const protection = createCredentialProtection({ keys: { current: new Uint8Array(32).fill(9) }, activeKeyId: "current" });
|
|
22
22
|
const requests = [];
|
package/test/prestashop.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 { prestashopProvider } from "../src/server/prestashop.js";
|
|
9
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
10
10
|
|
|
11
11
|
const context = { applicationId: "store-app", subjectId: "merchant" };
|
|
12
12
|
const input = { context, integrationId: "store" };
|
|
@@ -15,7 +15,7 @@ const products = { products: [{ id: "42", reference: "SHIRT", price: "20.000000"
|
|
|
15
15
|
associations: { images: [{ id: "7" }] } }] };
|
|
16
16
|
|
|
17
17
|
async function fixture(t) {
|
|
18
|
-
const directory = await
|
|
18
|
+
const directory = await makeTestDirectory("prestashop-connector-");
|
|
19
19
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
20
20
|
const protection = createCredentialProtection({ keys: { current: new Uint8Array(32).fill(5) }, activeKeyId: "current" });
|
|
21
21
|
const requests = [];
|
package/test/resend.test.js
CHANGED
|
@@ -3,12 +3,12 @@ import test from "node:test";
|
|
|
3
3
|
import { createHash } from "node:crypto";
|
|
4
4
|
import { createLocalAuthService, createLocalFileBackend } from "../../auth-provider-local-core/src/server/lib/index.js";
|
|
5
5
|
import { localServiceOptions } from "../../auth-provider-local-core/test-support/localService.js";
|
|
6
|
-
import {
|
|
7
|
-
import { tmpdir } from "node:os";
|
|
6
|
+
import { readFile, rm } from "node:fs/promises";
|
|
8
7
|
import path from "node:path";
|
|
9
8
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
10
9
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
11
10
|
import { resendProvider } from "../src/server/resend.js";
|
|
11
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
12
12
|
|
|
13
13
|
const context = { applicationId: "mail-app", subjectId: "business-mail" };
|
|
14
14
|
const input = { from: "Support <support@example.com>", to: ["person@example.com"],
|
|
@@ -16,7 +16,7 @@ const input = { from: "Support <support@example.com>", to: ["person@example.com"
|
|
|
16
16
|
idempotencyKey: "recovery/fixture-event" };
|
|
17
17
|
|
|
18
18
|
async function fixture(t) {
|
|
19
|
-
const directory = await
|
|
19
|
+
const directory = await makeTestDirectory("resend-send-");
|
|
20
20
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
21
21
|
const requests = [];
|
|
22
22
|
const state = { fail: false };
|
package/test/salesforce.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 { validateIntegrationConfiguration } from "../../connectors-core/src/shared/configuration.js";
|
|
9
8
|
import { salesforceProvider as provider } from "../src/server/salesforce.js";
|
|
9
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
10
10
|
|
|
11
11
|
const context = { applicationId: "crm-app", subjectId: "user-one" };
|
|
12
12
|
const input = { context, integrationId: "crm" };
|
|
@@ -17,7 +17,7 @@ const cursor = "/services/data/v66.0/query/0r82211CelDTLqEAEX-2000";
|
|
|
17
17
|
const page = { totalSize: 1, done: true, records: [{ attributes: { type: "Account", url: "/services/data/v66.0/sobjects/Account/001000000000001AAA" }, Id: "001000000000001AAA", Name: "Fixture" }] };
|
|
18
18
|
|
|
19
19
|
async function fixture(t, settings = { environment: "production", accountUrl }) {
|
|
20
|
-
const directory = await
|
|
20
|
+
const directory = await makeTestDirectory("salesforce-connector-");
|
|
21
21
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
22
22
|
const origin = new URL(settings.accountUrl).origin;
|
|
23
23
|
const state = { time: Date.now(), grants: 0, requests: [], tokenStatus: 200, status: 200, scope: "api refresh_token", refresh: true,
|
package/test/semrush.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, ConnectorError } 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 { semrushProvider } from "../src/server/semrush.js";
|
|
9
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
10
10
|
|
|
11
11
|
const context = { applicationId: "seo-app", subjectId: "marketing-team" };
|
|
12
12
|
const input = { context, integrationId: "seo" };
|
|
@@ -18,7 +18,7 @@ const meta = { request_id: "fixture-request", status_code: 200, success: true };
|
|
|
18
18
|
const page = { meta: { ...meta, scope: "OWN", limit: 100, offset: 0, total_count: 1 }, data: [project] };
|
|
19
19
|
|
|
20
20
|
async function fixture(t) {
|
|
21
|
-
const directory = await
|
|
21
|
+
const directory = await makeTestDirectory("semrush-connector-");
|
|
22
22
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
23
23
|
const protection = createCredentialProtection({ keys: { current: new Uint8Array(32).fill(8) }, activeKeyId: "current" });
|
|
24
24
|
const requests = [];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { registerHooks } from "node:module";
|
|
3
|
+
import test from "node:test";
|
|
4
|
+
|
|
5
|
+
// Every module this process loads, in order: the browser catalog must not pull in the whole AI model snapshot.
|
|
6
|
+
const loaded = [];
|
|
7
|
+
registerHooks({ load(url, context, nextLoad) { loaded.push(url); return nextLoad(url, context); } });
|
|
8
|
+
const loads = (file) => loaded.some((url) => url.endsWith(`/src/shared/${file}`));
|
|
9
|
+
|
|
10
|
+
test("the browser catalog carries the configurable AI providers without the framework-metadata snapshot", async () => {
|
|
11
|
+
const shared = await import("../src/shared/english-definitions.js");
|
|
12
|
+
assert.ok(shared.connectorDefinitions.some((definition) => definition.id === "ai"));
|
|
13
|
+
assert.ok(shared.aiDefinition.settingsFields[0].items.length > 0);
|
|
14
|
+
assert.equal(loads("ai-models.json"), true);
|
|
15
|
+
assert.equal(loads("ai-framework-models.json"), false);
|
|
16
|
+
|
|
17
|
+
// The whole catalogue (./shared/ai) still loads both files and sees every provider.
|
|
18
|
+
const { aiCatalogue } = await import("../src/shared/english-ai.js");
|
|
19
|
+
assert.equal(loads("ai-framework-models.json"), true);
|
|
20
|
+
assert.equal(aiCatalogue.providers.length, 213);
|
|
21
|
+
});
|
package/test/shopify.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,13 +8,14 @@ import { parseIntegrationConfiguration } from "../../connectors-core/src/shared/
|
|
|
9
8
|
import { shopifyProvider } from "../src/server/shopify.js";
|
|
10
9
|
import { catalogMessage } from "../../kernel/shared/i18n/index.js";
|
|
11
10
|
import en from "../locales/en.json" with { type: "json" };
|
|
11
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
12
12
|
|
|
13
13
|
const context = { applicationId: "app-one", subjectId: "store-one" };
|
|
14
14
|
const args = { context, integrationId: "shopify" };
|
|
15
15
|
const product = { id: "gid://shopify/Product/123", title: "Fixture product", handle: "fixture-product", status: "DRAFT" };
|
|
16
16
|
|
|
17
17
|
async function fixture(t, { method = "oauth2", scopes = ["read_products", "write_products"], assistantPolicy } = {}) {
|
|
18
|
-
const directory = await
|
|
18
|
+
const directory = await makeTestDirectory("shopify-connector-");
|
|
19
19
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
20
20
|
const configuration = { schemaVersion: 1, registrations: method === "oauth2" ? {
|
|
21
21
|
own: { source: "own", grantType: "client_credentials", clientId: "fixture-client", clientSecretRef: "env:SHOPIFY_SECRET" }
|
package/test/slack.test.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { createHmac } from "node:crypto";
|
|
2
2
|
import assert from "node:assert/strict";
|
|
3
3
|
import test from "node:test";
|
|
4
|
-
import {
|
|
4
|
+
import { readdir, readFile, rm } from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
6
|
-
import { tmpdir } from "node:os";
|
|
7
6
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
8
7
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
9
8
|
import { parseIntegrationConfiguration } from "../../connectors-core/src/shared/configuration.js";
|
|
10
9
|
import { slackProvider, verifySlackRequest } from "../src/server/slack.js";
|
|
10
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
11
11
|
|
|
12
12
|
const callback = "https://app.example.test/slack/callback";
|
|
13
13
|
const context = { applicationId: "app-one", subjectId: "user-one" };
|
|
@@ -16,7 +16,7 @@ const scopes = ["channels:read", "groups:read", "im:read", "mpim:read"];
|
|
|
16
16
|
const page = { ok: true, channels: [{ id: "C123", name: "general" }], response_metadata: { next_cursor: "next +&/=" } };
|
|
17
17
|
|
|
18
18
|
async function fixture(t, actor = "user", granted = scopes) {
|
|
19
|
-
const directory = await
|
|
19
|
+
const directory = await makeTestDirectory("slack-connector-");
|
|
20
20
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
21
21
|
const requests = [];
|
|
22
22
|
const state = { time: Date.now(), tokenCount: 0, tokenScope: granted.join(","), tokenStatus: 200, apiStatus: 200, page, rotation: true };
|
package/test/snowflake.test.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
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 { snowflakeProvider } from "../src/server/snowflake.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" };
|
|
13
13
|
const callback = "https://app.example.test/oauth/snowflake/callback";
|
|
14
14
|
const database = { name: "INVENTORY", owner: "REPORTING_READER", kind: "PERMANENT", comment: "Stock", created_on: "2026-09-01T12:00:00Z" };
|
|
15
15
|
async function fixture(t, { role = "REPORTING_READER", accountUrl = "https://myorg-myaccount.snowflakecomputing.com", basic = false, sqlContext = {} } = {}) {
|
|
16
|
-
const directory = await
|
|
16
|
+
const directory = await makeTestDirectory("snowflake-connector-");
|
|
17
17
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
18
18
|
const settings = { accountUrl, ...(role ? { role } : {}), ...sqlContext };
|
|
19
19
|
const scopes = getProviderScopes(snowflakeProvider, settings).map((scope) => scope.value);
|
package/test/tally.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 { tallyProvider } from "../src/server/tally.js";
|
|
7
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
9
8
|
|
|
10
9
|
test("Tally submission retrieval preserves answers and explicit paging with account credentials", async (t) => {
|
|
11
|
-
const directory = await
|
|
10
|
+
const directory = await makeTestDirectory("tally-workflows-");
|
|
12
11
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
13
12
|
const requests = [];
|
|
14
13
|
let response = { items: [], total: 0, hasMore: false }, status = 200;
|
package/test/telegram.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 { telegramProvider } from "../src/server/telegram.js";
|
|
7
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
9
8
|
|
|
10
9
|
test("Telegram sends plain messages and polls without hidden acknowledgement or retry", async (t) => {
|
|
11
|
-
const directory = await
|
|
10
|
+
const directory = await makeTestDirectory("telegram-workflows-");
|
|
12
11
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
13
12
|
const requests = [];
|
|
14
13
|
let response = { ok: true, result: { id: 123, is_bot: true, first_name: "Fixture" } }, status = 200;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { readdirSync, readFileSync } from "node:fs";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
import test from "node:test";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
|
|
7
|
+
const TEST_DIRECTORY = path.dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
|
|
9
|
+
// The file connection store syncs every save to disk; in memory a sync is free, on an SSD it was the suite's largest
|
|
10
|
+
// cost. Every test directory comes from makeTestDirectory, which is in memory where the system offers it.
|
|
11
|
+
test("connector tests make their directories with makeTestDirectory, never in the disk-backed temporary directory", () => {
|
|
12
|
+
const offenders = readdirSync(TEST_DIRECTORY)
|
|
13
|
+
.filter((name) => name.endsWith(".js") && name !== path.basename(fileURLToPath(import.meta.url)))
|
|
14
|
+
.filter((name) => /\b(?:mkdtemp|tmpdir)\(/.test(readFileSync(path.join(TEST_DIRECTORY, name), "utf8")));
|
|
15
|
+
assert.deepEqual(offenders, []);
|
|
16
|
+
});
|
package/test/tiktok.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 { validateIntegrationConfiguration } from "../../connectors-core/src/shared/configuration.js";
|
|
9
8
|
import { tiktokProvider as provider } from "../src/server/tiktok.js";
|
|
9
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
10
10
|
|
|
11
11
|
const context = { applicationId: "tiktok-app", subjectId: "creator-one" };
|
|
12
12
|
const input = { context, integrationId: "tiktok" };
|
|
@@ -15,7 +15,7 @@ const scopes = ["user.info.basic", "user.info.stats", "user.info.profile", "vide
|
|
|
15
15
|
const profile = { data: { user: { open_id: "creator-1", display_name: "Fixture Creator", avatar_url: "https://image.example/avatar" } }, error: { code: "ok" } };
|
|
16
16
|
|
|
17
17
|
async function fixture(t) {
|
|
18
|
-
const directory = await
|
|
18
|
+
const directory = await makeTestDirectory("tiktok-connector-");
|
|
19
19
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
20
20
|
const protection = createCredentialProtection({ keys: { current: new Uint8Array(32).fill(7) }, activeKeyId: "current" });
|
|
21
21
|
const configuration = { schemaVersion: 1, integrations: { tiktok: { provider: "tiktok", accountMode: "per-user", scopes: [...scopes],
|
package/test/tokens.test.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import { createHmac } from "node:crypto";
|
|
3
3
|
import test from "node:test";
|
|
4
|
-
import {
|
|
4
|
+
import { readdir, readFile, rm } from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
6
|
-
import { tmpdir } from "node:os";
|
|
7
6
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
8
7
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
9
8
|
import { airtableProvider } from "../src/server/airtable.js";
|
|
@@ -43,6 +42,7 @@ import { fireworksAiProvider } from "../src/server/fireworks-ai.js";
|
|
|
43
42
|
import { gatewayApiProvider, verifyGatewayApiEvent } from "../src/server/gatewayapi.js";
|
|
44
43
|
import { polarProvider } from "../src/server/polar.js";
|
|
45
44
|
import { storyblokProvider } from "../src/server/storyblok.js";
|
|
45
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
46
46
|
|
|
47
47
|
const cases = [
|
|
48
48
|
{ provider: clayProvider, check: "/public/v0/me", header: "clay-api-key", prefix: "",
|
|
@@ -107,7 +107,7 @@ const cases = [
|
|
|
107
107
|
];
|
|
108
108
|
|
|
109
109
|
async function fixture(t, entry) {
|
|
110
|
-
const directory = await
|
|
110
|
+
const directory = await makeTestDirectory("connector-token-");
|
|
111
111
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
112
112
|
const state = { key: entry.key || "private-fixture-key", status: 200, response: entry.response };
|
|
113
113
|
const requests = [];
|
package/test/twilio.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 { twilioProvider, verifyTwilioRequest } from "../src/server/twilio.js";
|
|
9
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
10
10
|
|
|
11
11
|
const accountSid = `AC${"a".repeat(32)}`;
|
|
12
12
|
const apiKeySid = `SK${"b".repeat(32)}`;
|
|
@@ -86,7 +86,7 @@ test("Twilio rejects invalid or ambiguous sends before transport and preserves t
|
|
|
86
86
|
});
|
|
87
87
|
|
|
88
88
|
async function fixture(t, region = "us1") {
|
|
89
|
-
const directory = await
|
|
89
|
+
const directory = await makeTestDirectory("twilio-connector-");
|
|
90
90
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
91
91
|
const protection = createCredentialProtection({ keys: { current: new Uint8Array(32).fill(8) }, activeKeyId: "current" });
|
|
92
92
|
const requests = [];
|
package/test/twitch.test.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
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 { twitchProvider, parseTwitchEventSubMessage } from "../src/server/twitch.js";
|
|
8
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
9
9
|
|
|
10
10
|
const callback = "https://app.example.test/twitch/callback";
|
|
11
11
|
const context = { applicationId: "app-one", subjectId: "user-one" };
|
|
@@ -14,7 +14,7 @@ const scopes = ["user:read:email", "user:read:follows"];
|
|
|
14
14
|
const followed = { total: 1, data: [{ broadcaster_id: "456", broadcaster_login: "channel", broadcaster_name: "Channel", followed_at: "2026-09-01T00:00:00Z" }], pagination: { cursor: "next +&2" } };
|
|
15
15
|
|
|
16
16
|
async function fixture(t, granted = scopes) {
|
|
17
|
-
const directory = await
|
|
17
|
+
const directory = await makeTestDirectory("twitch-connector-");
|
|
18
18
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
19
19
|
const requests = [];
|
|
20
20
|
const state = {
|
package/test/wave.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 { waveProvider } from "../src/server/wave.js";
|
|
9
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
10
10
|
|
|
11
11
|
const context = { applicationId: "app-one", subjectId: "person-one" };
|
|
12
12
|
const input = { context, integrationId: "wave" };
|
|
@@ -22,7 +22,7 @@ const customer = { id: "Q3VzdG9tZXI6b25l", name: "Customer", email: null };
|
|
|
22
22
|
const invoice = { id: "SW52b2ljZTpvbmU=", invoiceNumber: "001", invoiceDate: "2026-09-09", status: "DRAFT", currency: { code: "USD" } };
|
|
23
23
|
|
|
24
24
|
async function fixture(t, requestedScopes = scopes) {
|
|
25
|
-
const directory = await
|
|
25
|
+
const directory = await makeTestDirectory("wave-connector-");
|
|
26
26
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
27
27
|
const protection = createCredentialProtection({ keys: { current: new Uint8Array(32).fill(7) }, activeKeyId: "current" });
|
|
28
28
|
const requests = [];
|
package/test/wix.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 { validateIntegrationConfiguration } from "../../connectors-core/src/shared/configuration.js";
|
|
9
8
|
import { wixProvider as provider } from "../src/server/wix.js";
|
|
9
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
10
10
|
|
|
11
11
|
const accountId = "01234567-89ab-cdef-0123-456789abcdef";
|
|
12
12
|
const siteId = "12345678-9abc-def0-1234-56789abcdef0";
|
|
@@ -44,7 +44,7 @@ test("Wix retrieves service choices without converting native prices or crossing
|
|
|
44
44
|
});
|
|
45
45
|
|
|
46
46
|
async function fixture(t, settings = {}) {
|
|
47
|
-
const directory = await
|
|
47
|
+
const directory = await makeTestDirectory("wix-connector-");
|
|
48
48
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
49
49
|
const protection = createCredentialProtection({ keys: { current: new Uint8Array(32).fill(7) }, activeKeyId: "current" });
|
|
50
50
|
const requests = [];
|
package/test/wiz.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 { writeFile, readFile, rm, access, mkdir } from "node:fs/promises";
|
|
5
4
|
import path from "node:path";
|
|
6
5
|
import { setTimeout as delay } from "node:timers/promises";
|
|
7
6
|
import { validateIntegrationConfiguration, parseIntegrationConfiguration } from "../../connectors-core/src/shared/configuration.js";
|
|
8
7
|
import { createWizScanner } from "../src/server/wiz.js";
|
|
9
8
|
import { wizDefinition } from "../src/shared/wiz.js";
|
|
9
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
10
10
|
|
|
11
11
|
const context = { applicationId: "project-one", subjectId: "workspace-one" };
|
|
12
12
|
const args = { context, integrationId: "security" };
|
|
@@ -16,7 +16,7 @@ const configuration = () => ({ schemaVersion: 1, registrations: {
|
|
|
16
16
|
authentication: { method: "oauth2", registrationRef: "wiz" }, settings: {} } } });
|
|
17
17
|
|
|
18
18
|
async function fixture(t, patch = {}) {
|
|
19
|
-
const root = await
|
|
19
|
+
const root = await makeTestDirectory("wiz-fixture-");
|
|
20
20
|
t.after(() => rm(root, { recursive: true, force: true }));
|
|
21
21
|
const source = path.join(root, "source with spaces;$literal"); await mkdir(source);
|
|
22
22
|
const executable = path.join(root, "fixture-cli");
|
|
@@ -1,11 +1,11 @@
|
|
|
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 { wordpressComProvider } from "../src/server/wordpress-com.js";
|
|
8
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
9
9
|
|
|
10
10
|
const callback = "https://app.example.test/connections/wordpress/callback";
|
|
11
11
|
const context = { applicationId: "app-one", subjectId: "person-one" };
|
|
@@ -13,7 +13,7 @@ const input = { context, integrationId: "publishing" };
|
|
|
13
13
|
const profile = { ID: 17, username: "editor", display_name: "Editor", token_client_id: 12345, token_site_id: 81, token_scope: ["users", "sites", "posts"] };
|
|
14
14
|
|
|
15
15
|
async function fixture(t, scopes = profile.token_scope) {
|
|
16
|
-
const directory = await
|
|
16
|
+
const directory = await makeTestDirectory("wordpress-com-connector-");
|
|
17
17
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
18
18
|
const requests = [];
|
|
19
19
|
const state = { time: Date.now(), token: {}, profile: { ...structuredClone(profile), token_scope: [...scopes] }, status: 200, response: null };
|
package/test/wordpress.test.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
2
|
import test from "node:test";
|
|
3
3
|
import { createHmac } from "node:crypto";
|
|
4
|
-
import {
|
|
4
|
+
import { readdir, readFile, rm } from "node:fs/promises";
|
|
5
5
|
import path from "node:path";
|
|
6
|
-
import { tmpdir } from "node:os";
|
|
7
6
|
import { createConnectionService } from "../../connectors-core/src/server/index.js";
|
|
8
7
|
import { createFileConnectionStore, createCredentialProtection } from "../../connectors-core/src/server/fileStorage.js";
|
|
9
8
|
import { parseIntegrationConfiguration } from "../../connectors-core/src/shared/configuration.js";
|
|
10
9
|
import { woocommerceProvider, verifyWooCommerceWebhook } from "../src/server/woocommerce.js";
|
|
11
10
|
import { wordpressSelfHostedProvider } from "../src/server/wordpress-self-hosted.js";
|
|
11
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
12
12
|
|
|
13
13
|
const context = { applicationId: "site-app", subjectId: "site-owner" };
|
|
14
14
|
const input = { context, integrationId: "site" };
|
|
@@ -24,7 +24,7 @@ const cases = [
|
|
|
24
24
|
];
|
|
25
25
|
|
|
26
26
|
async function fixture(t, spec) {
|
|
27
|
-
const directory = await
|
|
27
|
+
const directory = await makeTestDirectory("wordpress-connectors-");
|
|
28
28
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
29
29
|
const protection = createCredentialProtection({ keys: { current: new Uint8Array(32).fill(6) }, activeKeyId: "current" });
|
|
30
30
|
const requests = [];
|
package/test/workday.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 { workdayProvider } from "../src/server/workday.js";
|
|
9
|
+
import { makeTestDirectory } from "../../../tooling/test-support/testDirectory.mjs";
|
|
10
10
|
|
|
11
11
|
const context = { applicationId: "app-one", subjectId: "user-one" };
|
|
12
12
|
const args = { context, integrationId: "workday" };
|
|
@@ -14,7 +14,7 @@ const callback = "https://app.example.test/oauth/workday/callback";
|
|
|
14
14
|
const me = { id: "0123456789abcdef0123456789abcdef", descriptor: "Fixture Worker", workerId: "21005", person: { descriptor: "Fixture Person" } };
|
|
15
15
|
|
|
16
16
|
async function fixture(t, { prefix = "/ccx", version = "v1", method = "client_secret_post" } = {}) {
|
|
17
|
-
const directory = await
|
|
17
|
+
const directory = await makeTestDirectory("workday-connector-");
|
|
18
18
|
t.after(() => rm(directory, { recursive: true, force: true }));
|
|
19
19
|
const configuration = { schemaVersion: 1, registrations: { tenant: { source: "own", clientId: "fixture-client",
|
|
20
20
|
clientSecretRef: "env:WORKDAY_SECRET", callbackUrlRef: "env:WORKDAY_CALLBACK", tokenEndpointAuthMethod: method } }, integrations: {
|