@perpetualsystems/connector-registry 202605.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/build-entry.d.ts +6 -0
- package/dist/build-entry.d.ts.map +1 -0
- package/dist/build-entry.js +6 -0
- package/dist/build-entry.js.map +1 -0
- package/dist/build-registry.d.ts +36 -0
- package/dist/build-registry.d.ts.map +1 -0
- package/dist/build-registry.js +147 -0
- package/dist/build-registry.js.map +1 -0
- package/dist/bundled-manifest.d.ts +6 -0
- package/dist/bundled-manifest.d.ts.map +1 -0
- package/dist/bundled-manifest.js +23 -0
- package/dist/bundled-manifest.js.map +1 -0
- package/dist/calver.d.ts +20 -0
- package/dist/calver.d.ts.map +1 -0
- package/dist/calver.js +57 -0
- package/dist/calver.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/manifest.json +183 -0
- package/dist/schemas.d.ts +94 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +32 -0
- package/dist/schemas.js.map +1 -0
- package/dist/validate.d.ts +5 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +53 -0
- package/dist/validate.js.map +1 -0
- package/package.json +42 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Build-time exports for scripts and CI (not required at runtime in simba). */
|
|
2
|
+
export { buildConnectorRegistryManifest, connectorKindFromPackageName, DEFAULT_CONNECTORS_ECR_REGISTRY, defaultRepoRoot, discoverConnectorPackageNames, loadConnectorHandler, readConnectorPackageVersion, readPerpetualRegistryMetadata, resolveConnectorsEcrRegistry, resolveEcrImageUrl, settingsSchemaFromZod, type PerpetualRegistryMetadata, } from "./build-registry.js";
|
|
3
|
+
export { calVerBaseFromDate, nextRegistryCalVerVersion, } from "./calver.js";
|
|
4
|
+
export { assertEcrImageUrlImmutable, assertSettingsSchemaInlined, validateConnectorRegistry, } from "./validate.js";
|
|
5
|
+
export { connectorRegistryEntrySchema, connectorRegistryManifestSchema, createConnectorRegistry, DRAFT_07_SCHEMA_URI, parseConnectorRegistryManifest, type ConnectorRegistry, type ConnectorRegistryEntry, type ConnectorRegistryManifest, } from "./schemas.js";
|
|
6
|
+
//# sourceMappingURL=build-entry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-entry.d.ts","sourceRoot":"","sources":["../src/build-entry.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,OAAO,EACL,8BAA8B,EAC9B,4BAA4B,EAC5B,+BAA+B,EAC/B,eAAe,EACf,6BAA6B,EAC7B,oBAAoB,EACpB,2BAA2B,EAC3B,6BAA6B,EAC7B,4BAA4B,EAC5B,kBAAkB,EAClB,qBAAqB,EACrB,KAAK,yBAAyB,GAC/B,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,eAAe,CAAA;AAEtB,OAAO,EACL,4BAA4B,EAC5B,+BAA+B,EAC/B,uBAAuB,EACvB,mBAAmB,EACnB,8BAA8B,EAC9B,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,GAC/B,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Build-time exports for scripts and CI (not required at runtime in simba). */
|
|
2
|
+
export { buildConnectorRegistryManifest, connectorKindFromPackageName, DEFAULT_CONNECTORS_ECR_REGISTRY, defaultRepoRoot, discoverConnectorPackageNames, loadConnectorHandler, readConnectorPackageVersion, readPerpetualRegistryMetadata, resolveConnectorsEcrRegistry, resolveEcrImageUrl, settingsSchemaFromZod, } from "./build-registry.js";
|
|
3
|
+
export { calVerBaseFromDate, nextRegistryCalVerVersion, } from "./calver.js";
|
|
4
|
+
export { assertEcrImageUrlImmutable, assertSettingsSchemaInlined, validateConnectorRegistry, } from "./validate.js";
|
|
5
|
+
export { connectorRegistryEntrySchema, connectorRegistryManifestSchema, createConnectorRegistry, DRAFT_07_SCHEMA_URI, parseConnectorRegistryManifest, } from "./schemas.js";
|
|
6
|
+
//# sourceMappingURL=build-entry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-entry.js","sourceRoot":"","sources":["../src/build-entry.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,OAAO,EACL,8BAA8B,EAC9B,4BAA4B,EAC5B,+BAA+B,EAC/B,eAAe,EACf,6BAA6B,EAC7B,oBAAoB,EACpB,2BAA2B,EAC3B,6BAA6B,EAC7B,4BAA4B,EAC5B,kBAAkB,EAClB,qBAAqB,GAEtB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,EACL,kBAAkB,EAClB,yBAAyB,GAC1B,MAAM,aAAa,CAAA;AAEpB,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,eAAe,CAAA;AAEtB,OAAO,EACL,4BAA4B,EAC5B,+BAA+B,EAC/B,uBAAuB,EACvB,mBAAmB,EACnB,8BAA8B,GAI/B,MAAM,cAAc,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { type AnyConnectorHandler } from "@perpetualsystems/connector-sdk";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { type ConnectorRegistryManifest } from "./schemas.js";
|
|
4
|
+
export declare const defaultRepoRoot: string;
|
|
5
|
+
declare const perpetualRegistrySchema: z.ZodObject<{
|
|
6
|
+
displayName: z.ZodString;
|
|
7
|
+
description: z.ZodOptional<z.ZodString>;
|
|
8
|
+
iconUrl: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
displayName: string;
|
|
11
|
+
iconUrl?: string | undefined;
|
|
12
|
+
description?: string | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
displayName: string;
|
|
15
|
+
iconUrl?: string | undefined;
|
|
16
|
+
description?: string | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
export type PerpetualRegistryMetadata = z.infer<typeof perpetualRegistrySchema>;
|
|
19
|
+
/** Default Perpetual connectors ECR registry (override with CONNECTORS_ECR_REGISTRY). */
|
|
20
|
+
export declare const DEFAULT_CONNECTORS_ECR_REGISTRY = "718287746078.dkr.ecr.us-east-2.amazonaws.com";
|
|
21
|
+
export declare function readConnectorPackageVersion(packageName: string, repoRoot?: string): Promise<string>;
|
|
22
|
+
export declare function discoverConnectorPackageNames(repoRoot?: string): Promise<string[]>;
|
|
23
|
+
export declare function connectorKindFromPackageName(packageName: string): string;
|
|
24
|
+
export declare function resolveConnectorsEcrRegistry(): string;
|
|
25
|
+
export declare function resolveEcrImageUrl(args: {
|
|
26
|
+
packageName: string;
|
|
27
|
+
connectorKind: string;
|
|
28
|
+
connectorVersion: string;
|
|
29
|
+
registry?: string;
|
|
30
|
+
}): string;
|
|
31
|
+
export declare function readPerpetualRegistryMetadata(packageName: string, repoRoot?: string): Promise<PerpetualRegistryMetadata>;
|
|
32
|
+
export declare function settingsSchemaFromZod(config: z.ZodType): Record<string, unknown>;
|
|
33
|
+
export declare function loadConnectorHandler(packageName: string, repoRoot?: string): Promise<AnyConnectorHandler>;
|
|
34
|
+
export declare function buildConnectorRegistryManifest(repoRoot?: string): Promise<ConnectorRegistryManifest>;
|
|
35
|
+
export {};
|
|
36
|
+
//# sourceMappingURL=build-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-registry.d.ts","sourceRoot":"","sources":["../src/build-registry.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,mBAAmB,EAEzB,MAAM,iCAAiC,CAAA;AACxC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAIL,KAAK,yBAAyB,EAC/B,MAAM,cAAc,CAAA;AAEr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{ dirname, join, resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
4
|
+
import { isStreamingConnectorHandler, } from "@perpetualsystems/connector-sdk";
|
|
5
|
+
import { z } from "zod";
|
|
6
|
+
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
7
|
+
import { connectorRegistryManifestSchema, DRAFT_07_SCHEMA_URI, } from "./schemas.js";
|
|
8
|
+
const packageDir = dirname(fileURLToPath(import.meta.url));
|
|
9
|
+
export const defaultRepoRoot = resolve(packageDir, "../../..");
|
|
10
|
+
const PUBLISH_EXCLUDED_PACKAGES = new Set([
|
|
11
|
+
"connector-sdk",
|
|
12
|
+
"connector-cli",
|
|
13
|
+
"connector-registry",
|
|
14
|
+
]);
|
|
15
|
+
const perpetualRegistrySchema = z.object({
|
|
16
|
+
displayName: z.string().min(1),
|
|
17
|
+
description: z.string().optional(),
|
|
18
|
+
iconUrl: z.string().url().optional(),
|
|
19
|
+
});
|
|
20
|
+
/** Default Perpetual connectors ECR registry (override with CONNECTORS_ECR_REGISTRY). */
|
|
21
|
+
export const DEFAULT_CONNECTORS_ECR_REGISTRY = "718287746078.dkr.ecr.us-east-2.amazonaws.com";
|
|
22
|
+
const CONNECTOR_PACKAGE_SUFFIX = "-connector";
|
|
23
|
+
export async function readConnectorPackageVersion(packageName, repoRoot = defaultRepoRoot) {
|
|
24
|
+
const raw = await readFile(join(repoRoot, "packages", packageName, "package.json"), "utf8");
|
|
25
|
+
const pkg = JSON.parse(raw);
|
|
26
|
+
const version = pkg.version?.trim();
|
|
27
|
+
if (!version) {
|
|
28
|
+
throw new Error(`packages/${packageName}/package.json: version is required`);
|
|
29
|
+
}
|
|
30
|
+
if (/^latest$/i.test(version)) {
|
|
31
|
+
throw new Error(`packages/${packageName}/package.json: version must not be "latest"`);
|
|
32
|
+
}
|
|
33
|
+
return version;
|
|
34
|
+
}
|
|
35
|
+
export async function discoverConnectorPackageNames(repoRoot = defaultRepoRoot) {
|
|
36
|
+
const packagesDir = join(repoRoot, "packages");
|
|
37
|
+
const names = await readdir(packagesDir);
|
|
38
|
+
const publishable = [];
|
|
39
|
+
for (const name of names.sort()) {
|
|
40
|
+
if (PUBLISH_EXCLUDED_PACKAGES.has(name)) {
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
const packageJsonPath = join(packagesDir, name, "package.json");
|
|
44
|
+
try {
|
|
45
|
+
const raw = await readFile(packageJsonPath, "utf8");
|
|
46
|
+
const pkg = JSON.parse(raw);
|
|
47
|
+
if (pkg.perpetualRegistry) {
|
|
48
|
+
publishable.push(name);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch {
|
|
52
|
+
// not a connector package
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (publishable.length === 0) {
|
|
56
|
+
throw new Error("No publishable connector packages found (add perpetualRegistry to package.json)");
|
|
57
|
+
}
|
|
58
|
+
return publishable;
|
|
59
|
+
}
|
|
60
|
+
export function connectorKindFromPackageName(packageName) {
|
|
61
|
+
if (packageName.endsWith(CONNECTOR_PACKAGE_SUFFIX)) {
|
|
62
|
+
return packageName.slice(0, -CONNECTOR_PACKAGE_SUFFIX.length);
|
|
63
|
+
}
|
|
64
|
+
return packageName;
|
|
65
|
+
}
|
|
66
|
+
export function resolveConnectorsEcrRegistry() {
|
|
67
|
+
return (process.env.CONNECTORS_ECR_REGISTRY?.replace(/\/$/, "") ??
|
|
68
|
+
DEFAULT_CONNECTORS_ECR_REGISTRY);
|
|
69
|
+
}
|
|
70
|
+
export function resolveEcrImageUrl(args) {
|
|
71
|
+
const kindFromPackage = connectorKindFromPackageName(args.packageName);
|
|
72
|
+
if (args.connectorKind !== kindFromPackage) {
|
|
73
|
+
throw new Error(`Connector id "${args.connectorKind}" must match package name "${args.packageName}" (expected id "${kindFromPackage}")`);
|
|
74
|
+
}
|
|
75
|
+
const registry = args.registry ?? resolveConnectorsEcrRegistry();
|
|
76
|
+
return `${registry}/perpetual-connectors/${args.connectorKind}:${args.connectorVersion}`;
|
|
77
|
+
}
|
|
78
|
+
export async function readPerpetualRegistryMetadata(packageName, repoRoot = defaultRepoRoot) {
|
|
79
|
+
const raw = await readFile(join(repoRoot, "packages", packageName, "package.json"), "utf8");
|
|
80
|
+
const pkg = JSON.parse(raw);
|
|
81
|
+
const parsed = perpetualRegistrySchema.safeParse(pkg.perpetualRegistry);
|
|
82
|
+
if (!parsed.success) {
|
|
83
|
+
throw new Error(`packages/${packageName}/package.json perpetualRegistry: ${parsed.error.message}`);
|
|
84
|
+
}
|
|
85
|
+
return parsed.data;
|
|
86
|
+
}
|
|
87
|
+
export function settingsSchemaFromZod(config) {
|
|
88
|
+
const generated = zodToJsonSchema(config, {
|
|
89
|
+
$refStrategy: "none",
|
|
90
|
+
});
|
|
91
|
+
const { definitions: _definitions, $ref: _ref, ...schema } = generated;
|
|
92
|
+
return {
|
|
93
|
+
...schema,
|
|
94
|
+
$schema: DRAFT_07_SCHEMA_URI,
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
export async function loadConnectorHandler(packageName, repoRoot = defaultRepoRoot) {
|
|
98
|
+
const entryPath = join(repoRoot, "packages", packageName, "dist/index.js");
|
|
99
|
+
const mod = (await import(pathToFileURL(entryPath).href));
|
|
100
|
+
const connector = mod.connector;
|
|
101
|
+
if (!connector?.id || !connector.config) {
|
|
102
|
+
throw new Error(`${packageName} must export \`connector\` from definePollingConnector(...) or defineStreamingConnector(...)`);
|
|
103
|
+
}
|
|
104
|
+
if (isStreamingConnectorHandler(connector)) {
|
|
105
|
+
if (!connector.lagUnit) {
|
|
106
|
+
throw new Error(`${packageName} streaming connector must declare lagUnit`);
|
|
107
|
+
}
|
|
108
|
+
return connector;
|
|
109
|
+
}
|
|
110
|
+
if (!("state" in connector) || !connector.state) {
|
|
111
|
+
throw new Error(`${packageName} polling connector must export state schema from definePollingConnector(...)`);
|
|
112
|
+
}
|
|
113
|
+
return connector;
|
|
114
|
+
}
|
|
115
|
+
export async function buildConnectorRegistryManifest(repoRoot = defaultRepoRoot) {
|
|
116
|
+
const packageNames = await discoverConnectorPackageNames(repoRoot);
|
|
117
|
+
const connectors = [];
|
|
118
|
+
for (const packageName of packageNames) {
|
|
119
|
+
const [handler, metadata, connectorVersion] = await Promise.all([
|
|
120
|
+
loadConnectorHandler(packageName, repoRoot),
|
|
121
|
+
readPerpetualRegistryMetadata(packageName, repoRoot),
|
|
122
|
+
readConnectorPackageVersion(packageName, repoRoot),
|
|
123
|
+
]);
|
|
124
|
+
connectors.push({
|
|
125
|
+
kind: handler.id,
|
|
126
|
+
displayName: metadata.displayName,
|
|
127
|
+
connectorType: isStreamingConnectorHandler(handler)
|
|
128
|
+
? "streaming"
|
|
129
|
+
: "polling",
|
|
130
|
+
...(isStreamingConnectorHandler(handler)
|
|
131
|
+
? { lagUnit: handler.lagUnit }
|
|
132
|
+
: {}),
|
|
133
|
+
ecrImageUrl: resolveEcrImageUrl({
|
|
134
|
+
packageName,
|
|
135
|
+
connectorKind: handler.id,
|
|
136
|
+
connectorVersion,
|
|
137
|
+
}),
|
|
138
|
+
...(metadata.description !== undefined
|
|
139
|
+
? { description: metadata.description }
|
|
140
|
+
: {}),
|
|
141
|
+
...(metadata.iconUrl !== undefined ? { iconUrl: metadata.iconUrl } : {}),
|
|
142
|
+
settingsSchema: settingsSchemaFromZod(handler.config),
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return connectorRegistryManifestSchema.parse({ connectors });
|
|
146
|
+
}
|
|
147
|
+
//# sourceMappingURL=build-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-registry.js","sourceRoot":"","sources":["../src/build-registry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAClD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE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EAAE,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACxE,cAAc,EAAE,qBAAqB,CAAC,OAAO,CAAC,MAAM,CAAC;SACtD,CAAC,CAAA;IACJ,CAAC;IAED,OAAO,+BAA+B,CAAC,KAAK,CAAC,EAAE,UAAU,EAAE,CAAC,CAAA;AAC9D,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type ConnectorRegistry, type ConnectorRegistryManifest } from "./schemas.js";
|
|
2
|
+
/** Manifest JSON shipped in the published package (`dist/manifest.json`). */
|
|
3
|
+
export declare function getBundledConnectorRegistryManifest(): ConnectorRegistryManifest;
|
|
4
|
+
/** Built-in connector lookup from the bundled manifest. */
|
|
5
|
+
export declare function getBundledConnectorRegistry(): ConnectorRegistry;
|
|
6
|
+
//# sourceMappingURL=bundled-manifest.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundled-manifest.d.ts","sourceRoot":"","sources":["../src/bundled-manifest.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,yBAAyB,EAG/B,MAAM,cAAc,CAAA;AAUrB,6EAA6E;AAC7E,wBAAgB,mCAAmC,IAAI,yBAAyB,CAM/E;AAED,2DAA2D;AAC3D,wBAAgB,2BAA2B,IAAI,iBAAiB,CAO/D"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
import { connectorRegistryManifestSchema, createConnectorRegistry, } from "./schemas.js";
|
|
5
|
+
const manifestPath = join(dirname(fileURLToPath(import.meta.url)), "manifest.json");
|
|
6
|
+
let cachedManifest;
|
|
7
|
+
let cachedRegistry;
|
|
8
|
+
/** Manifest JSON shipped in the published package (`dist/manifest.json`). */
|
|
9
|
+
export function getBundledConnectorRegistryManifest() {
|
|
10
|
+
if (!cachedManifest) {
|
|
11
|
+
const raw = readFileSync(manifestPath, "utf8");
|
|
12
|
+
cachedManifest = connectorRegistryManifestSchema.parse(JSON.parse(raw));
|
|
13
|
+
}
|
|
14
|
+
return cachedManifest;
|
|
15
|
+
}
|
|
16
|
+
/** Built-in connector lookup from the bundled manifest. */
|
|
17
|
+
export function getBundledConnectorRegistry() {
|
|
18
|
+
if (!cachedRegistry) {
|
|
19
|
+
cachedRegistry = createConnectorRegistry(getBundledConnectorRegistryManifest());
|
|
20
|
+
}
|
|
21
|
+
return cachedRegistry;
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=bundled-manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundled-manifest.js","sourceRoot":"","sources":["../src/bundled-manifest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AACxC,OAAO,EAGL,+BAA+B,EAC/B,uBAAuB,GACxB,MAAM,cAAc,CAAA;AAErB,MAAM,YAAY,GAAG,IAAI,CACvB,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EACvC,eAAe,CAChB,CAAA;AAED,IAAI,cAAqD,CAAA;AACzD,IAAI,cAA6C,CAAA;AAEjD,6EAA6E;AAC7E,MAAM,UAAU,mCAAmC;IACjD,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,MAAM,GAAG,GAAG,YAAY,CAAC,YAAY,EAAE,MAAM,CAAC,CAAA;QAC9C,cAAc,GAAG,+BAA+B,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAA;IACzE,CAAC;IACD,OAAO,cAAc,CAAA;AACvB,CAAC;AAED,2DAA2D;AAC3D,MAAM,UAAU,2BAA2B;IACzC,IAAI,CAAC,cAAc,EAAE,CAAC;QACpB,cAAc,GAAG,uBAAuB,CACtC,mCAAmC,EAAE,CACtC,CAAA;IACH,CAAC;IACD,OAAO,cAAc,CAAA;AACvB,CAAC"}
|
package/dist/calver.d.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CalVer npm versions for @perpetualsystems/connector-registry.
|
|
3
|
+
*
|
|
4
|
+
* Format: `YYYYMM.D.S` as semver major.minor.patch where YYYYMM is UTC year+month,
|
|
5
|
+
* D is the UTC calendar day (1–31), and S is the same-day publish sequence (1–99).
|
|
6
|
+
* Example: `202605.27.1` = 2026-05-27, first publish that UTC day.
|
|
7
|
+
*/
|
|
8
|
+
export type ParsedRegistryCalVer = {
|
|
9
|
+
year: number;
|
|
10
|
+
month: number;
|
|
11
|
+
day: number;
|
|
12
|
+
seq: number;
|
|
13
|
+
};
|
|
14
|
+
export declare function parseRegistryCalVerVersion(version: string): ParsedRegistryCalVer | null;
|
|
15
|
+
/** Publish on a UTC day; `seq` defaults to 1 (first publish that day). */
|
|
16
|
+
export declare function formatRegistryCalVer(now?: Date, seq?: number): string;
|
|
17
|
+
/** First publish on a UTC day (`YYYYMM.D.1`). */
|
|
18
|
+
export declare function calVerBaseFromDate(now?: Date): string;
|
|
19
|
+
export declare function nextRegistryCalVerVersion(currentVersion: string, now?: Date): string;
|
|
20
|
+
//# sourceMappingURL=calver.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calver.d.ts","sourceRoot":"","sources":["../src/calver.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,oBAAoB,GAAG;IACjC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,MAAM,CAAA;IACX,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAMD,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,GACd,oBAAoB,GAAG,IAAI,CAqB7B;AAED,0EAA0E;AAC1E,wBAAgB,oBAAoB,CAAC,GAAG,OAAa,EAAE,GAAG,SAAI,GAAG,MAAM,CAYtE;AAED,iDAAiD;AACjD,wBAAgB,kBAAkB,CAAC,GAAG,OAAa,GAAG,MAAM,CAE3D;AAED,wBAAgB,yBAAyB,CACvC,cAAc,EAAE,MAAM,EACtB,GAAG,OAAa,GACf,MAAM,CAiBR"}
|
package/dist/calver.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CalVer npm versions for @perpetualsystems/connector-registry.
|
|
3
|
+
*
|
|
4
|
+
* Format: `YYYYMM.D.S` as semver major.minor.patch where YYYYMM is UTC year+month,
|
|
5
|
+
* D is the UTC calendar day (1–31), and S is the same-day publish sequence (1–99).
|
|
6
|
+
* Example: `202605.27.1` = 2026-05-27, first publish that UTC day.
|
|
7
|
+
*/
|
|
8
|
+
function yearMonthKey(year, month) {
|
|
9
|
+
return year * 100 + month;
|
|
10
|
+
}
|
|
11
|
+
export function parseRegistryCalVerVersion(version) {
|
|
12
|
+
const match = /^(\d+)\.(\d+)\.(\d+)$/.exec(version);
|
|
13
|
+
if (!match) {
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
const major = Number(match[1]);
|
|
17
|
+
const day = Number(match[2]);
|
|
18
|
+
const seq = Number(match[3]);
|
|
19
|
+
if (major < 200001 || day < 1 || day > 31 || seq < 1 || seq > 99) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
const month = major % 100;
|
|
23
|
+
const year = Math.floor(major / 100);
|
|
24
|
+
if (month < 1 || month > 12) {
|
|
25
|
+
return null;
|
|
26
|
+
}
|
|
27
|
+
return { year, month, day, seq };
|
|
28
|
+
}
|
|
29
|
+
/** Publish on a UTC day; `seq` defaults to 1 (first publish that day). */
|
|
30
|
+
export function formatRegistryCalVer(now = new Date(), seq = 1) {
|
|
31
|
+
const year = now.getUTCFullYear();
|
|
32
|
+
const month = now.getUTCMonth() + 1;
|
|
33
|
+
const day = now.getUTCDate();
|
|
34
|
+
if (seq < 1 || seq > 99) {
|
|
35
|
+
throw new Error(`Registry CalVer sequence must be 1–99 (got ${seq} for ${year}-${month}-${day} UTC)`);
|
|
36
|
+
}
|
|
37
|
+
return `${yearMonthKey(year, month)}.${day}.${seq}`;
|
|
38
|
+
}
|
|
39
|
+
/** First publish on a UTC day (`YYYYMM.D.1`). */
|
|
40
|
+
export function calVerBaseFromDate(now = new Date()) {
|
|
41
|
+
return formatRegistryCalVer(now, 1);
|
|
42
|
+
}
|
|
43
|
+
export function nextRegistryCalVerVersion(currentVersion, now = new Date()) {
|
|
44
|
+
const year = now.getUTCFullYear();
|
|
45
|
+
const month = now.getUTCMonth() + 1;
|
|
46
|
+
const day = now.getUTCDate();
|
|
47
|
+
const parsed = parseRegistryCalVerVersion(currentVersion);
|
|
48
|
+
if (parsed && parsed.year === year && parsed.month === month && parsed.day === day) {
|
|
49
|
+
const nextSeq = parsed.seq + 1;
|
|
50
|
+
if (nextSeq > 99) {
|
|
51
|
+
throw new Error(`Registry CalVer: exceeded 99 publishes on ${year}-${month}-${day} UTC`);
|
|
52
|
+
}
|
|
53
|
+
return formatRegistryCalVer(now, nextSeq);
|
|
54
|
+
}
|
|
55
|
+
return formatRegistryCalVer(now, 1);
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=calver.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calver.js","sourceRoot":"","sources":["../src/calver.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH,SAAS,YAAY,CAAC,IAAY,EAAE,KAAa;IAC/C,OAAO,IAAI,GAAG,GAAG,GAAG,KAAK,CAAA;AAC3B,CAAC;AAED,MAAM,UAAU,0BAA0B,CACxC,OAAe;IAEf,MAAM,KAAK,GAAG,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IACnD,IAAI,CAAC,KAAK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IAAI,EAAE,KAAK,CAAC,IAAI,GAAG,IAAI,GAAG,EAAE,CAAA;AACrD,CAAC;AAED,iDAAiD;AACjD,MAAM,UAAU,kBAAkB,CAAC,GAAG,GAAG,IAAI,IAAI,EAAE;IACjD,OAAO,oBAAoB,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;AACrC,CAAC;AAED,MAAM,UAAU,yBAAyB,CACvC,cAAsB,EACtB,GAAG,GAAG,IAAI,IAAI,EAAE;IAEhB,MAAM,IAAI,GAAG,GAAG,CAAC,cAAc,EAAE,CAAA;IACjC,MAAM,KAAK,GAAG,GAAG,CAAC,WAAW,EAAE,GAAG,CAAC,CAAA;IACnC,MAAM,GAAG,GAAG,GAAG,CAAC,UAAU,EAAE,CAAA;IAC5B,MAAM,MAAM,GAAG,0BAA0B,CAAC,cAAc,CAAC,CAAA;IAEzD,IAAI,MAAM,IAAI,MAAM,CAAC,IAAI,KAAK,IAAI,IAAI,MAAM,CAAC,KAAK,KAAK,KAAK,IAAI,MAAM,CAAC,GAAG,KAAK,GAAG,EAAE,CAAC;QACnF,MAAM,OAAO,GAAG,MAAM,CAAC,GAAG,GAAG,CAAC,CAAA;QAC9B,IAAI,OAAO,GAAG,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CACb,6CAA6C,IAAI,IAAI,KAAK,IAAI,GAAG,MAAM,CACxE,CAAA;QACH,CAAC;QACD,OAAO,oBAAoB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;IAC3C,CAAC;IAED,OAAO,oBAAoB,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;AACrC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { getBundledConnectorRegistry, getBundledConnectorRegistryManifest, } from "./bundled-manifest.js";
|
|
2
|
+
export { type ConnectorRegistry, type ConnectorRegistryEntry, type ConnectorRegistryManifest, connectorRegistryEntrySchema, connectorRegistryManifestSchema, createConnectorRegistry, DRAFT_07_SCHEMA_URI, parseConnectorRegistryManifest, } from "./schemas.js";
|
|
3
|
+
export { assertEcrImageUrlImmutable, assertSettingsSchemaInlined, validateConnectorRegistry, } from "./validate.js";
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,mCAAmC,GACpC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,yBAAyB,EAC9B,4BAA4B,EAC5B,+BAA+B,EAC/B,uBAAuB,EACvB,mBAAmB,EACnB,8BAA8B,GAC/B,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,eAAe,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { getBundledConnectorRegistry, getBundledConnectorRegistryManifest, } from "./bundled-manifest.js";
|
|
2
|
+
export { connectorRegistryEntrySchema, connectorRegistryManifestSchema, createConnectorRegistry, DRAFT_07_SCHEMA_URI, parseConnectorRegistryManifest, } from "./schemas.js";
|
|
3
|
+
export { assertEcrImageUrlImmutable, assertSettingsSchemaInlined, validateConnectorRegistry, } from "./validate.js";
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,mCAAmC,GACpC,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAIL,4BAA4B,EAC5B,+BAA+B,EAC/B,uBAAuB,EACvB,mBAAmB,EACnB,8BAA8B,GAC/B,MAAM,cAAc,CAAA;AACrB,OAAO,EACL,0BAA0B,EAC1B,2BAA2B,EAC3B,yBAAyB,GAC1B,MAAM,eAAe,CAAA"}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
{
|
|
2
|
+
"connectors": [
|
|
3
|
+
{
|
|
4
|
+
"kind": "atlassian-org-audit",
|
|
5
|
+
"displayName": "Atlassian Organization Audit",
|
|
6
|
+
"ecrImageUrl": "718287746078.dkr.ecr.us-east-2.amazonaws.com/perpetual-connectors/atlassian-org-audit:0.0.1",
|
|
7
|
+
"connectorType": "polling",
|
|
8
|
+
"settingsSchema": {
|
|
9
|
+
"type": "object",
|
|
10
|
+
"properties": {
|
|
11
|
+
"orgId": {
|
|
12
|
+
"type": "string",
|
|
13
|
+
"minLength": 1
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"required": [
|
|
17
|
+
"orgId"
|
|
18
|
+
],
|
|
19
|
+
"additionalProperties": false,
|
|
20
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
21
|
+
},
|
|
22
|
+
"description": "Polls Atlassian organization audit log (events-stream). Requires Atlassian Access/Guard and an organization admin API key."
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"kind": "azure-event-hub",
|
|
26
|
+
"displayName": "Azure Event Hubs",
|
|
27
|
+
"ecrImageUrl": "718287746078.dkr.ecr.us-east-2.amazonaws.com/perpetual-connectors/azure-event-hub:0.0.1",
|
|
28
|
+
"connectorType": "streaming",
|
|
29
|
+
"lagUnit": "milliseconds",
|
|
30
|
+
"settingsSchema": {
|
|
31
|
+
"type": "object",
|
|
32
|
+
"properties": {
|
|
33
|
+
"eventHubName": {
|
|
34
|
+
"type": "string",
|
|
35
|
+
"minLength": 1
|
|
36
|
+
},
|
|
37
|
+
"consumerGroup": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"default": "$Default"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"required": [
|
|
43
|
+
"eventHubName"
|
|
44
|
+
],
|
|
45
|
+
"additionalProperties": false,
|
|
46
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
47
|
+
},
|
|
48
|
+
"description": "Consume events from an Azure Event Hub with S3 checkpoints"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"kind": "bitwarden",
|
|
52
|
+
"displayName": "Bitwarden",
|
|
53
|
+
"ecrImageUrl": "718287746078.dkr.ecr.us-east-2.amazonaws.com/perpetual-connectors/bitwarden:0.0.1",
|
|
54
|
+
"connectorType": "polling",
|
|
55
|
+
"settingsSchema": {
|
|
56
|
+
"type": "object",
|
|
57
|
+
"properties": {
|
|
58
|
+
"region": {
|
|
59
|
+
"type": "string",
|
|
60
|
+
"enum": [
|
|
61
|
+
"global",
|
|
62
|
+
"eu"
|
|
63
|
+
]
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
"required": [
|
|
67
|
+
"region"
|
|
68
|
+
],
|
|
69
|
+
"additionalProperties": false,
|
|
70
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
71
|
+
},
|
|
72
|
+
"description": "Poll Bitwarden organization event logs via the Public API"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"kind": "gcp-pubsub",
|
|
76
|
+
"displayName": "Google Cloud Pub/Sub",
|
|
77
|
+
"ecrImageUrl": "718287746078.dkr.ecr.us-east-2.amazonaws.com/perpetual-connectors/gcp-pubsub:0.0.1",
|
|
78
|
+
"connectorType": "streaming",
|
|
79
|
+
"lagUnit": "milliseconds",
|
|
80
|
+
"settingsSchema": {
|
|
81
|
+
"type": "object",
|
|
82
|
+
"properties": {
|
|
83
|
+
"projectId": {
|
|
84
|
+
"type": "string",
|
|
85
|
+
"minLength": 1
|
|
86
|
+
},
|
|
87
|
+
"subscriptionId": {
|
|
88
|
+
"type": "string",
|
|
89
|
+
"minLength": 1
|
|
90
|
+
},
|
|
91
|
+
"serviceAccountEmail": {
|
|
92
|
+
"type": "string",
|
|
93
|
+
"format": "email"
|
|
94
|
+
},
|
|
95
|
+
"maxMessages": {
|
|
96
|
+
"type": "integer",
|
|
97
|
+
"exclusiveMinimum": 0
|
|
98
|
+
},
|
|
99
|
+
"maxBytes": {
|
|
100
|
+
"type": "integer",
|
|
101
|
+
"exclusiveMinimum": 0
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"required": [
|
|
105
|
+
"projectId",
|
|
106
|
+
"subscriptionId",
|
|
107
|
+
"serviceAccountEmail"
|
|
108
|
+
],
|
|
109
|
+
"additionalProperties": false,
|
|
110
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
111
|
+
},
|
|
112
|
+
"description": "Consume messages from a GCP Pub/Sub subscription"
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
"kind": "one-password",
|
|
116
|
+
"displayName": "1Password",
|
|
117
|
+
"ecrImageUrl": "718287746078.dkr.ecr.us-east-2.amazonaws.com/perpetual-connectors/one-password:0.0.1",
|
|
118
|
+
"connectorType": "polling",
|
|
119
|
+
"settingsSchema": {
|
|
120
|
+
"type": "object",
|
|
121
|
+
"properties": {
|
|
122
|
+
"region": {
|
|
123
|
+
"type": "string",
|
|
124
|
+
"enum": [
|
|
125
|
+
"us",
|
|
126
|
+
"eu",
|
|
127
|
+
"ca"
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
"signinAttempts": {
|
|
131
|
+
"type": "boolean",
|
|
132
|
+
"default": true
|
|
133
|
+
},
|
|
134
|
+
"itemUsages": {
|
|
135
|
+
"type": "boolean",
|
|
136
|
+
"default": true
|
|
137
|
+
},
|
|
138
|
+
"auditEvents": {
|
|
139
|
+
"type": "boolean",
|
|
140
|
+
"default": true
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"required": [
|
|
144
|
+
"region"
|
|
145
|
+
],
|
|
146
|
+
"additionalProperties": false,
|
|
147
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
148
|
+
},
|
|
149
|
+
"description": "Polls 1Password Events API v2 for sign-in attempts, item usages, and audit events."
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"kind": "slack-audit",
|
|
153
|
+
"displayName": "Slack Audit Logs",
|
|
154
|
+
"ecrImageUrl": "718287746078.dkr.ecr.us-east-2.amazonaws.com/perpetual-connectors/slack-audit:0.0.1",
|
|
155
|
+
"connectorType": "polling",
|
|
156
|
+
"settingsSchema": {
|
|
157
|
+
"type": "object",
|
|
158
|
+
"properties": {},
|
|
159
|
+
"additionalProperties": false,
|
|
160
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
161
|
+
},
|
|
162
|
+
"description": "Enterprise Grid audit logs via Slack Audit API. Requires auditlogs:read OAuth user token."
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"kind": "test-fixture",
|
|
166
|
+
"displayName": "Test Fixture",
|
|
167
|
+
"ecrImageUrl": "718287746078.dkr.ecr.us-east-2.amazonaws.com/perpetual-connectors/test-fixture:0.0.1",
|
|
168
|
+
"connectorType": "polling",
|
|
169
|
+
"settingsSchema": {
|
|
170
|
+
"type": "object",
|
|
171
|
+
"properties": {
|
|
172
|
+
"label": {
|
|
173
|
+
"type": "string",
|
|
174
|
+
"default": "fixture"
|
|
175
|
+
}
|
|
176
|
+
},
|
|
177
|
+
"additionalProperties": false,
|
|
178
|
+
"$schema": "http://json-schema.org/draft-07/schema#"
|
|
179
|
+
},
|
|
180
|
+
"description": "Internal noop connector for registry pipeline validation (dev only)"
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const DRAFT_07_SCHEMA_URI = "http://json-schema.org/draft-07/schema#";
|
|
3
|
+
export declare const CONNECTOR_REGISTRY_S3_PREFIX = "connectors";
|
|
4
|
+
export declare const connectorRegistryEntrySchema: z.ZodObject<{
|
|
5
|
+
kind: z.ZodString;
|
|
6
|
+
displayName: z.ZodString;
|
|
7
|
+
ecrImageUrl: z.ZodString;
|
|
8
|
+
connectorType: z.ZodDefault<z.ZodEnum<["polling", "streaming"]>>;
|
|
9
|
+
lagUnit: z.ZodOptional<z.ZodEnum<["milliseconds", "messages"]>>;
|
|
10
|
+
settingsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>, Record<string, unknown>>;
|
|
11
|
+
iconUrl: z.ZodOptional<z.ZodString>;
|
|
12
|
+
description: z.ZodOptional<z.ZodString>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
kind: string;
|
|
15
|
+
displayName: string;
|
|
16
|
+
ecrImageUrl: string;
|
|
17
|
+
connectorType: "polling" | "streaming";
|
|
18
|
+
settingsSchema: Record<string, unknown>;
|
|
19
|
+
lagUnit?: "milliseconds" | "messages" | undefined;
|
|
20
|
+
iconUrl?: string | undefined;
|
|
21
|
+
description?: string | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
kind: string;
|
|
24
|
+
displayName: string;
|
|
25
|
+
ecrImageUrl: string;
|
|
26
|
+
settingsSchema: Record<string, unknown>;
|
|
27
|
+
connectorType?: "polling" | "streaming" | undefined;
|
|
28
|
+
lagUnit?: "milliseconds" | "messages" | undefined;
|
|
29
|
+
iconUrl?: string | undefined;
|
|
30
|
+
description?: string | undefined;
|
|
31
|
+
}>;
|
|
32
|
+
export declare const connectorRegistryManifestSchema: z.ZodObject<{
|
|
33
|
+
connectors: z.ZodArray<z.ZodObject<{
|
|
34
|
+
kind: z.ZodString;
|
|
35
|
+
displayName: z.ZodString;
|
|
36
|
+
ecrImageUrl: z.ZodString;
|
|
37
|
+
connectorType: z.ZodDefault<z.ZodEnum<["polling", "streaming"]>>;
|
|
38
|
+
lagUnit: z.ZodOptional<z.ZodEnum<["milliseconds", "messages"]>>;
|
|
39
|
+
settingsSchema: z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>, Record<string, unknown>>;
|
|
40
|
+
iconUrl: z.ZodOptional<z.ZodString>;
|
|
41
|
+
description: z.ZodOptional<z.ZodString>;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
kind: string;
|
|
44
|
+
displayName: string;
|
|
45
|
+
ecrImageUrl: string;
|
|
46
|
+
connectorType: "polling" | "streaming";
|
|
47
|
+
settingsSchema: Record<string, unknown>;
|
|
48
|
+
lagUnit?: "milliseconds" | "messages" | undefined;
|
|
49
|
+
iconUrl?: string | undefined;
|
|
50
|
+
description?: string | undefined;
|
|
51
|
+
}, {
|
|
52
|
+
kind: string;
|
|
53
|
+
displayName: string;
|
|
54
|
+
ecrImageUrl: string;
|
|
55
|
+
settingsSchema: Record<string, unknown>;
|
|
56
|
+
connectorType?: "polling" | "streaming" | undefined;
|
|
57
|
+
lagUnit?: "milliseconds" | "messages" | undefined;
|
|
58
|
+
iconUrl?: string | undefined;
|
|
59
|
+
description?: string | undefined;
|
|
60
|
+
}>, "many">;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
connectors: {
|
|
63
|
+
kind: string;
|
|
64
|
+
displayName: string;
|
|
65
|
+
ecrImageUrl: string;
|
|
66
|
+
connectorType: "polling" | "streaming";
|
|
67
|
+
settingsSchema: Record<string, unknown>;
|
|
68
|
+
lagUnit?: "milliseconds" | "messages" | undefined;
|
|
69
|
+
iconUrl?: string | undefined;
|
|
70
|
+
description?: string | undefined;
|
|
71
|
+
}[];
|
|
72
|
+
}, {
|
|
73
|
+
connectors: {
|
|
74
|
+
kind: string;
|
|
75
|
+
displayName: string;
|
|
76
|
+
ecrImageUrl: string;
|
|
77
|
+
settingsSchema: Record<string, unknown>;
|
|
78
|
+
connectorType?: "polling" | "streaming" | undefined;
|
|
79
|
+
lagUnit?: "milliseconds" | "messages" | undefined;
|
|
80
|
+
iconUrl?: string | undefined;
|
|
81
|
+
description?: string | undefined;
|
|
82
|
+
}[];
|
|
83
|
+
}>;
|
|
84
|
+
export type ConnectorRegistryEntry = z.infer<typeof connectorRegistryEntrySchema>;
|
|
85
|
+
export type ConnectorRegistryManifest = z.infer<typeof connectorRegistryManifestSchema>;
|
|
86
|
+
/** Lookup API for built-in connector catalog entries. */
|
|
87
|
+
export interface ConnectorRegistry {
|
|
88
|
+
get(kind: string): ConnectorRegistryEntry | undefined;
|
|
89
|
+
list(): ConnectorRegistryEntry[];
|
|
90
|
+
has(kind: string): boolean;
|
|
91
|
+
}
|
|
92
|
+
export declare function parseConnectorRegistryManifest(body: string): ConnectorRegistryManifest;
|
|
93
|
+
export declare function createConnectorRegistry(manifest: ConnectorRegistryManifest): ConnectorRegistry;
|
|
94
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,mBAAmB,4CAA4C,CAAA;AAE5E,eAAO,MAAM,4BAA4B,eAAe,CAAA;AAUxD,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;EASvC,CAAA;AAEF,eAAO,MAAM,+BAA+B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE1C,CAAA;AAEF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,4BAA4B,CAAC,CAAA;AACjF,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,+BAA+B,CACvC,CAAA;AAED,yDAAyD;AACzD,MAAM,WAAW,iBAAiB;IAChC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,sBAAsB,GAAG,SAAS,CAAA;IACrD,IAAI,IAAI,sBAAsB,EAAE,CAAA;IAChC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAA;CAC3B;AAED,wBAAgB,8BAA8B,CAC5C,IAAI,EAAE,MAAM,GACX,yBAAyB,CAG3B;AAED,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,yBAAyB,GAClC,iBAAiB,CASnB"}
|
package/dist/schemas.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export const DRAFT_07_SCHEMA_URI = "http://json-schema.org/draft-07/schema#";
|
|
3
|
+
export const CONNECTOR_REGISTRY_S3_PREFIX = "connectors";
|
|
4
|
+
const jsonSchemaObjectSchema = z
|
|
5
|
+
.record(z.string(), z.unknown())
|
|
6
|
+
.refine((value) => typeof value === "object" && value !== null && !Array.isArray(value), { message: "settingsSchema must be a JSON object" });
|
|
7
|
+
export const connectorRegistryEntrySchema = z.object({
|
|
8
|
+
kind: z.string().min(1),
|
|
9
|
+
displayName: z.string().min(1),
|
|
10
|
+
ecrImageUrl: z.string().min(1),
|
|
11
|
+
connectorType: z.enum(["polling", "streaming"]).default("polling"),
|
|
12
|
+
lagUnit: z.enum(["milliseconds", "messages"]).optional(),
|
|
13
|
+
settingsSchema: jsonSchemaObjectSchema,
|
|
14
|
+
iconUrl: z.string().url().optional(),
|
|
15
|
+
description: z.string().optional(),
|
|
16
|
+
});
|
|
17
|
+
export const connectorRegistryManifestSchema = z.object({
|
|
18
|
+
connectors: z.array(connectorRegistryEntrySchema).min(1),
|
|
19
|
+
});
|
|
20
|
+
export function parseConnectorRegistryManifest(body) {
|
|
21
|
+
const json = JSON.parse(body);
|
|
22
|
+
return connectorRegistryManifestSchema.parse(json);
|
|
23
|
+
}
|
|
24
|
+
export function createConnectorRegistry(manifest) {
|
|
25
|
+
const byKind = new Map(manifest.connectors.map((entry) => [entry.kind, entry]));
|
|
26
|
+
return {
|
|
27
|
+
get: (kind) => byKind.get(kind),
|
|
28
|
+
list: () => [...byKind.values()],
|
|
29
|
+
has: (kind) => byKind.has(kind),
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],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,KAAK,CAAC,4BAA4B,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;CACzD,CAAC,CAAA;AAcF,MAAM,UAAU,8BAA8B,CAC5C,IAAY;IAEZ,MAAM,IAAI,GAAY,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACtC,OAAO,+BAA+B,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;AACpD,CAAC;AAED,MAAM,UAAU,uBAAuB,CACrC,QAAmC;IAEnC,MAAM,MAAM,GAAG,IAAI,GAAG,CACpB,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,CACxD,CAAA;IACD,OAAO;QACL,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;QAC/B,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC;QAChC,GAAG,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC;KAChC,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ConnectorRegistryManifest } from "./schemas.js";
|
|
2
|
+
export declare function assertSettingsSchemaInlined(schema: unknown, path?: string): void;
|
|
3
|
+
export declare function assertEcrImageUrlImmutable(ecrImageUrl: string): void;
|
|
4
|
+
export declare function validateConnectorRegistry(registry: ConnectorRegistryManifest): void;
|
|
5
|
+
//# sourceMappingURL=validate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,yBAAyB,EAE/B,MAAM,cAAc,CAAA;AAErB,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,OAAO,EACf,IAAI,SAAmB,GACtB,IAAI,CAsBN;AAED,wBAAgB,0BAA0B,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CASpE;AAED,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,yBAAyB,GAClC,IAAI,CAkCN"}
|
package/dist/validate.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { DRAFT_07_SCHEMA_URI, } from "./schemas.js";
|
|
2
|
+
export function assertSettingsSchemaInlined(schema, path = "settingsSchema") {
|
|
3
|
+
if (schema === null || typeof schema !== "object") {
|
|
4
|
+
return;
|
|
5
|
+
}
|
|
6
|
+
if (Array.isArray(schema)) {
|
|
7
|
+
for (const [index, item] of schema.entries()) {
|
|
8
|
+
assertSettingsSchemaInlined(item, `${path}[${index}]`);
|
|
9
|
+
}
|
|
10
|
+
return;
|
|
11
|
+
}
|
|
12
|
+
const record = schema;
|
|
13
|
+
if ("$ref" in record) {
|
|
14
|
+
throw new Error(`${path} must not contain $ref (settings schemas must be inlined): ${String(record.$ref)}`);
|
|
15
|
+
}
|
|
16
|
+
for (const [key, value] of Object.entries(record)) {
|
|
17
|
+
assertSettingsSchemaInlined(value, `${path}.${key}`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
export function assertEcrImageUrlImmutable(ecrImageUrl) {
|
|
21
|
+
if (/:latest$/i.test(ecrImageUrl)) {
|
|
22
|
+
throw new Error(`ecrImageUrl must not use the "latest" tag: ${ecrImageUrl}`);
|
|
23
|
+
}
|
|
24
|
+
if (!/\.dkr\.ecr\.[a-z0-9-]+\.amazonaws\.com\/.+:.+$/i.test(ecrImageUrl)) {
|
|
25
|
+
throw new Error(`ecrImageUrl must be a full ECR URI with an immutable tag or digest: ${ecrImageUrl}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
export function validateConnectorRegistry(registry) {
|
|
29
|
+
if (registry.connectors.length === 0) {
|
|
30
|
+
throw new Error("registry must include at least one connector");
|
|
31
|
+
}
|
|
32
|
+
const kinds = new Set();
|
|
33
|
+
for (const entry of registry.connectors) {
|
|
34
|
+
if (kinds.has(entry.kind)) {
|
|
35
|
+
throw new Error(`duplicate connector kind: ${entry.kind}`);
|
|
36
|
+
}
|
|
37
|
+
kinds.add(entry.kind);
|
|
38
|
+
assertEcrImageUrlImmutable(entry.ecrImageUrl);
|
|
39
|
+
if (entry.settingsSchema.$schema !== DRAFT_07_SCHEMA_URI) {
|
|
40
|
+
throw new Error(`settingsSchema for ${entry.kind} must set $schema to ${DRAFT_07_SCHEMA_URI}`);
|
|
41
|
+
}
|
|
42
|
+
assertSettingsSchemaInlined(entry.settingsSchema);
|
|
43
|
+
if (entry.connectorType === "streaming") {
|
|
44
|
+
if (!entry.lagUnit) {
|
|
45
|
+
throw new Error(`streaming connector ${entry.kind} must declare lagUnit in registry`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
else if (entry.lagUnit !== undefined) {
|
|
49
|
+
throw new Error(`polling connector ${entry.kind} must not declare lagUnit in registry`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,GACpB,MAAM,cAAc,CAAA;AAErB,MAAM,UAAU,2BAA2B,CACzC,MAAe,EACf,IAAI,GAAG,gBAAgB;IAEvB,IAAI,MAAM,KAAK,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAClD,OAAM;IACR,CAAC;IAED,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;QAC1B,KAAK,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;YAC7C,2BAA2B,CAAC,IAAI,EAAE,GAAG,IAAI,IAAI,KAAK,GAAG,CAAC,CAAA;QACxD,CAAC;Q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CAAA;QAErB,0BAA0B,CAAC,KAAK,CAAC,WAAW,CAAC,CAAA;QAE7C,IAAI,KAAK,CAAC,cAAc,CAAC,OAAO,KAAK,mBAAmB,EAAE,CAAC;YACzD,MAAM,IAAI,KAAK,CACb,sBAAsB,KAAK,CAAC,IAAI,wBAAwB,mBAAmB,EAAE,CAC9E,CAAA;QACH,CAAC;QAED,2BAA2B,CAAC,KAAK,CAAC,cAAc,CAAC,CAAA;QAEjD,IAAI,KAAK,CAAC,aAAa,KAAK,WAAW,EAAE,CAAC;YACxC,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;gBACnB,MAAM,IAAI,KAAK,CACb,uBAAuB,KAAK,CAAC,IAAI,mCAAmC,CACrE,CAAA;YACH,CAAC;QACH,CAAC;aAAM,IAAI,KAAK,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CACb,qBAAqB,KAAK,CAAC,IAAI,uCAAuC,CACvE,CAAA;QACH,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@perpetualsystems/connector-registry",
|
|
3
|
+
"version": "202605.30.1",
|
|
4
|
+
"description": "Built-in connector catalog manifest for Perpetual management plane",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"import": "./dist/index.js"
|
|
10
|
+
},
|
|
11
|
+
"./build": {
|
|
12
|
+
"types": "./dist/build-entry.d.ts",
|
|
13
|
+
"import": "./dist/build-entry.js"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"main": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "git+https://github.com/perpetualsystems/connectors.git"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "tsc && tsc -p tsconfig.build-tools.json",
|
|
30
|
+
"typecheck": "tsc -p tsconfig.json --noEmit"
|
|
31
|
+
},
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"zod": "^3.24.4"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@perpetualsystems/connector-sdk": "workspace:*",
|
|
37
|
+
"@types/node": "^22.15.21",
|
|
38
|
+
"tsx": "^4.19.4",
|
|
39
|
+
"typescript": "^5.8.3",
|
|
40
|
+
"zod-to-json-schema": "^3.24.5"
|
|
41
|
+
}
|
|
42
|
+
}
|