@relayfile/adapter-core 0.3.11 → 0.3.12

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.
@@ -0,0 +1,32 @@
1
+ import assert from "node:assert/strict";
2
+ import { readFile } from "node:fs/promises";
3
+ import test from "node:test";
4
+ import { ADAPTERS_WITHOUT_KNOWN_TRIGGERS, KNOWN_TRIGGER_CATALOG } from "../../src/index.js";
5
+ import { findRepoRoot, generateTriggerCatalog, renderTriggerCatalogModule, triggerCatalogPaths, } from "../../src/triggers/catalog-generator.js";
6
+ test("generated trigger catalog is in sync with adapter supportedEvents", async () => {
7
+ const repoRoot = await findRepoRoot();
8
+ const generation = await generateTriggerCatalog(repoRoot);
9
+ const paths = triggerCatalogPaths(repoRoot);
10
+ const catalogJson = JSON.parse(await readFile(paths.catalogJson, "utf8"));
11
+ const noEventJson = JSON.parse(await readFile(paths.noEventJson, "utf8"));
12
+ const catalogTs = await readFile(paths.catalogTs, "utf8");
13
+ assert.deepEqual(catalogJson, generation.catalog);
14
+ assert.deepEqual(noEventJson, generation.adaptersWithoutKnownTriggers);
15
+ assert.equal(catalogTs, renderTriggerCatalogModule(generation));
16
+ assert.deepEqual(KNOWN_TRIGGER_CATALOG, generation.catalog);
17
+ assert.deepEqual(ADAPTERS_WITHOUT_KNOWN_TRIGGERS, generation.adaptersWithoutKnownTriggers);
18
+ const coveredPackagePaths = new Set([
19
+ ...generation.sources.map((source) => source.packagePath),
20
+ ...generation.adaptersWithoutKnownTriggers.map((adapter) => adapter.packagePath),
21
+ ]);
22
+ assert.equal(coveredPackagePaths.size, generation.sources.length + generation.adaptersWithoutKnownTriggers.length);
23
+ });
24
+ test("catalog preserves provider-specific event names verbatim", () => {
25
+ assert.ok(KNOWN_TRIGGER_CATALOG.github.includes("pull_request.opened"));
26
+ assert.ok(KNOWN_TRIGGER_CATALOG.gitlab.includes("note.MergeRequest"));
27
+ assert.ok(KNOWN_TRIGGER_CATALOG.linear.includes("issue.create"));
28
+ assert.ok(KNOWN_TRIGGER_CATALOG.salesforce.includes("Account.created"));
29
+ assert.ok(KNOWN_TRIGGER_CATALOG.slack.includes("message.created"));
30
+ assert.ok(KNOWN_TRIGGER_CATALOG.stripe.includes("invoice.paid"));
31
+ });
32
+ //# sourceMappingURL=catalog-generator.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog-generator.test.js","sourceRoot":"","sources":["../../../tests/triggers/catalog-generator.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,+BAA+B,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EACL,YAAY,EACZ,sBAAsB,EACtB,0BAA0B,EAC1B,mBAAmB,GACpB,MAAM,yCAAyC,CAAC;AAEjD,IAAI,CAAC,mEAAmE,EAAE,KAAK,IAAI,EAAE;IACnF,MAAM,QAAQ,GAAG,MAAM,YAAY,EAAE,CAAC;IACtC,MAAM,UAAU,GAAG,MAAM,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IAC1D,MAAM,KAAK,GAAG,mBAAmB,CAAC,QAAQ,CAAC,CAAC;IAE5C,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1E,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,KAAK,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;IAC1E,MAAM,SAAS,GAAG,MAAM,QAAQ,CAAC,KAAK,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;IAE1D,MAAM,CAAC,SAAS,CAAC,WAAW,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;IAClD,MAAM,CA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AAC,CAAC,CAAC;IACnE,MAAM,CAAC,EAAE,CAAC,qBAAqB,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC,CAAC;AACnE,CAAC,CAAC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@relayfile/adapter-core",
3
- "version": "0.3.11",
3
+ "version": "0.3.12",
4
4
  "description": "Schema-driven relayfile adapter generator and runtime",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",
@@ -16,7 +16,7 @@
16
16
  "scripts": {
17
17
  "build": "rm -rf dist/tests/round-trip && tsc -p tsconfig.json",
18
18
  "clean": "rm -rf dist",
19
- "test": "node --test dist/tests/**/*.test.js dist/src/**/*.test.js",
19
+ "test": "node --import tsx --test dist/tests/**/*.test.js dist/src/**/*.test.js",
20
20
  "test:round-trip": "vitest run tests/round-trip",
21
21
  "prepublishOnly": "npm run build",
22
22
  "typecheck": "tsc --noEmit"
@@ -34,6 +34,7 @@
34
34
  "@agent-relay/sdk": "^6.0.7",
35
35
  "@relayfile/sdk": "^0.6.0",
36
36
  "@types/node": "^24.5.2",
37
+ "tsx": "^4.20.6",
37
38
  "typescript": "^5.9.2",
38
39
  "vitest": "^3.0.0"
39
40
  },