@superdurable/connector-clickhouse 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +2 -2
- package/dex-connector.json +60 -0
- package/dist/chunk-F5PUPLRK.js +105 -0
- package/dist/connection-zXWJ_3zD.d.ts +74 -0
- package/dist/index.d.ts +92 -0
- package/dist/index.js +224 -0
- package/dist/mock.d.ts +33 -0
- package/dist/mock.js +70 -0
- package/package.json +59 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Super Durable
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
#
|
|
1
|
+
# ClickHouse TypeScript connector
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Implements `listTables` with a typed database name, returning up to 100 sorted table names and `hasMore`. Go-recorded conformance checks exact HTTP requests, branches, retries and outputs. Configure the HTTP endpoint, database username and secret password using the [connection guide](../README.md). See the [runnable Dex Flow](examples/table-inspection/README.md). Live provider authorization remains unverified.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
{
|
|
2
|
+
"connectorId": "clickhouse",
|
|
3
|
+
"releaseTag": "connectors/clickhouse/go/v0.1.0",
|
|
4
|
+
"package": {
|
|
5
|
+
"ecosystem": "npm",
|
|
6
|
+
"name": "@superdurable/connector-clickhouse",
|
|
7
|
+
"version": "0.1.0"
|
|
8
|
+
},
|
|
9
|
+
"factories": [
|
|
10
|
+
{
|
|
11
|
+
"name": "newListTablesStep",
|
|
12
|
+
"kind": "query",
|
|
13
|
+
"operationId": "listTables",
|
|
14
|
+
"inputType": "ListTablesInput",
|
|
15
|
+
"description": "Return up to 100 sorted table names in one database and indicate whether more exist.",
|
|
16
|
+
"fields": {
|
|
17
|
+
"stepType": "stepType",
|
|
18
|
+
"annotations": "annotations",
|
|
19
|
+
"connectionName": "connectionName",
|
|
20
|
+
"resultAttribute": "resultAttribute"
|
|
21
|
+
},
|
|
22
|
+
"branches": [
|
|
23
|
+
{
|
|
24
|
+
"id": "listed",
|
|
25
|
+
"field": "listed",
|
|
26
|
+
"optional": false
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"id": "providerRejected",
|
|
30
|
+
"field": "providerRejected",
|
|
31
|
+
"optional": true
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"id": "invalidResponse",
|
|
35
|
+
"field": "invalidResponse",
|
|
36
|
+
"optional": true
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"id": "defect",
|
|
40
|
+
"field": "defect",
|
|
41
|
+
"optional": true
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"inputSchema": {
|
|
45
|
+
"additionalProperties": false,
|
|
46
|
+
"description": "ListTablesInput selects the non-secret ClickHouse database to inspect.",
|
|
47
|
+
"properties": {
|
|
48
|
+
"database": {
|
|
49
|
+
"description": "Database is the exact database name shown by SHOW DATABASES.",
|
|
50
|
+
"type": "string"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"required": [
|
|
54
|
+
"database"
|
|
55
|
+
],
|
|
56
|
+
"type": "object"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
]
|
|
60
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
// src/generated/models.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { SecretString } from "@superdurable/connectors-sdk";
|
|
4
|
+
var ConfigSchema = z.object({
|
|
5
|
+
"baseUrl": z.string(),
|
|
6
|
+
"timeoutMs": z.number().int().optional(),
|
|
7
|
+
"maxResponseBytes": z.number().int().optional()
|
|
8
|
+
});
|
|
9
|
+
function decodeCredentials(value) {
|
|
10
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) throw new TypeError("credential fields are invalid");
|
|
11
|
+
const fields = value;
|
|
12
|
+
const allowed = /* @__PURE__ */ new Set(["password", "username"]);
|
|
13
|
+
if (Object.keys(fields).some((key) => !allowed.has(key))) throw new TypeError("stored credential does not match the connector credential fields");
|
|
14
|
+
if (fields["password"] != null && !(typeof fields["password"] === "string")) throw new TypeError("credential password has an invalid type");
|
|
15
|
+
if (fields["username"] != null && !(typeof fields["username"] === "string")) throw new TypeError("credential username has an invalid type");
|
|
16
|
+
const credentials = {};
|
|
17
|
+
if (!fields["username"]) throw new TypeError("credential username is required");
|
|
18
|
+
credentials.username = fields["username"] ?? "";
|
|
19
|
+
if (!fields["password"]) throw new TypeError("credential password is required");
|
|
20
|
+
credentials.password = new SecretString(fields["password"] ?? "");
|
|
21
|
+
return credentials;
|
|
22
|
+
}
|
|
23
|
+
var ListTablesInputSchema = z.strictObject({
|
|
24
|
+
"database": z.string()
|
|
25
|
+
});
|
|
26
|
+
var TablesPageSchema = z.strictObject({
|
|
27
|
+
"database": z.string(),
|
|
28
|
+
"names": z.array(z.string()).nullable(),
|
|
29
|
+
"hasMore": z.boolean()
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
// src/generated/definitions.ts
|
|
33
|
+
var ConnectorID = "clickhouse";
|
|
34
|
+
var ProviderID = "clickhouse";
|
|
35
|
+
var ListTablesBranch = {
|
|
36
|
+
Listed: "listed",
|
|
37
|
+
ProviderRejected: "providerRejected",
|
|
38
|
+
InvalidResponse: "invalidResponse",
|
|
39
|
+
Defect: "defect"
|
|
40
|
+
};
|
|
41
|
+
var ListTablesBranchListed = ListTablesBranch.Listed;
|
|
42
|
+
var ListTablesBranchProviderRejected = ListTablesBranch.ProviderRejected;
|
|
43
|
+
var ListTablesBranchInvalidResponse = ListTablesBranch.InvalidResponse;
|
|
44
|
+
var ListTablesBranchDefect = ListTablesBranch.Defect;
|
|
45
|
+
var ListTablesDefinition = {
|
|
46
|
+
operation: { connectorId: ConnectorID, operationId: "listTables" },
|
|
47
|
+
branches: [
|
|
48
|
+
{ id: "listed", description: "ClickHouse returned the table names." },
|
|
49
|
+
{ id: "providerRejected", description: "ClickHouse conclusively rejected the metadata query.", optional: true },
|
|
50
|
+
{ id: "invalidResponse", description: "ClickHouse returned malformed or oversized JSON.", optional: true },
|
|
51
|
+
{ id: "defect", description: "Local input or connection credentials are invalid.", optional: true }
|
|
52
|
+
],
|
|
53
|
+
stepDefaults: { executeMethodTimeoutMs: 3e4, executeDurability: "async" }
|
|
54
|
+
};
|
|
55
|
+
var ListTablesMetadata = { kind: "query", idempotency: "none", authorization: "required" };
|
|
56
|
+
|
|
57
|
+
// src/generated/connection.ts
|
|
58
|
+
import { ConnectionRefSchema } from "@superdurable/connectors-sdk";
|
|
59
|
+
var Connection = class {
|
|
60
|
+
/** Stable provider and connection name. */
|
|
61
|
+
reference;
|
|
62
|
+
/** Bound provider operations. */
|
|
63
|
+
operations;
|
|
64
|
+
/** Validate a reference and bind operations. */
|
|
65
|
+
constructor(reference, operations) {
|
|
66
|
+
this.reference = ConnectionRefSchema.parse(reference);
|
|
67
|
+
if (this.reference.provider !== ProviderID) throw new TypeError("connection provider differs from the manifest");
|
|
68
|
+
if (!operations) throw new TypeError("connector operations are required");
|
|
69
|
+
this.operations = operations;
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
function newConnection(client, reference) {
|
|
73
|
+
if (!client) throw new TypeError("connector client is required");
|
|
74
|
+
return new Connection(reference, client);
|
|
75
|
+
}
|
|
76
|
+
function newConnectionWithOperations(operations, reference) {
|
|
77
|
+
return new Connection(reference, operations);
|
|
78
|
+
}
|
|
79
|
+
function newProjectConnection(project, connectionName, createClient) {
|
|
80
|
+
if (!project) throw new TypeError("loaded project is required");
|
|
81
|
+
const reference = ConnectionRefSchema.parse({ provider: ProviderID, name: connectionName });
|
|
82
|
+
const selected = project.configuration.connections.find((entry) => entry.connectorId === ConnectorID && entry.connectionName === connectionName);
|
|
83
|
+
if (!selected || selected.provider !== ProviderID) throw new TypeError("project connection is not configured");
|
|
84
|
+
return newConnection(createClient(project, connectionName), reference);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export {
|
|
88
|
+
ConfigSchema,
|
|
89
|
+
decodeCredentials,
|
|
90
|
+
ListTablesInputSchema,
|
|
91
|
+
TablesPageSchema,
|
|
92
|
+
ConnectorID,
|
|
93
|
+
ProviderID,
|
|
94
|
+
ListTablesBranch,
|
|
95
|
+
ListTablesBranchListed,
|
|
96
|
+
ListTablesBranchProviderRejected,
|
|
97
|
+
ListTablesBranchInvalidResponse,
|
|
98
|
+
ListTablesBranchDefect,
|
|
99
|
+
ListTablesDefinition,
|
|
100
|
+
ListTablesMetadata,
|
|
101
|
+
Connection,
|
|
102
|
+
newConnection,
|
|
103
|
+
newConnectionWithOperations,
|
|
104
|
+
newProjectConnection
|
|
105
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { SecretString, CredentialProvider, Query, ConnectionRef } from '@superdurable/connectors-sdk';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
/** Connector configuration; omitted fields use manifest defaults. */
|
|
5
|
+
interface Config {
|
|
6
|
+
/** HTTPS root of the ClickHouse HTTP interface, typically https://your-service.region.aws.clickhouse.cloud:8443; find the host in ClickHouse Cloud > Services > service > Connect > HTTPS or ask your self-hosted administrator. Do not include credentials, query, database, or path. Blank prevents connection creation. */
|
|
7
|
+
baseUrl: string;
|
|
8
|
+
/** Maximum duration of one metadata query as a positive Go duration such as 15s. Blank uses the displayed default; increase for slow catalogs. Runtime value in milliseconds. */
|
|
9
|
+
timeoutMs?: number;
|
|
10
|
+
/** Maximum complete table-list JSON response in bytes as a positive integer. Blank uses the displayed default; increase for large catalogs. */
|
|
11
|
+
maxResponseBytes?: number;
|
|
12
|
+
}
|
|
13
|
+
/** Runtime schema for manifest configuration. */
|
|
14
|
+
declare const ConfigSchema: z.ZodObject<{
|
|
15
|
+
baseUrl: z.ZodString;
|
|
16
|
+
timeoutMs: z.ZodOptional<z.ZodNumber>;
|
|
17
|
+
maxResponseBytes: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
}, z.core.$strip>;
|
|
19
|
+
/** Private connector credentials resolved by the host. */
|
|
20
|
+
interface Credentials {
|
|
21
|
+
/** Secret password for that ClickHouse database user from Cloud > Services > service > Connect > HTTPS, or from your self-hosted administrator. Enter the complete password; blank prevents calls. Dex stores it only as a credential and sends it in X-ClickHouse-Key. Rotate it in the database user settings. */
|
|
22
|
+
password: SecretString;
|
|
23
|
+
/** Non-secret ClickHouse database username from Cloud > Services > service > Connect > HTTPS, or from your self-hosted administrator. Enter the exact user with SELECT access to system.tables; blank prevents calls. Dex sends it in X-ClickHouse-User. */
|
|
24
|
+
username: string;
|
|
25
|
+
}
|
|
26
|
+
/** Decode private credential fields for the connector. */
|
|
27
|
+
declare function decodeCredentials(value: unknown): Credentials;
|
|
28
|
+
/** Host-owned source of private connector credentials. */
|
|
29
|
+
type CredentialSource = CredentialProvider<Credentials>;
|
|
30
|
+
/** ListTablesInput selects the non-secret ClickHouse database to inspect. */
|
|
31
|
+
interface ListTablesInput {
|
|
32
|
+
/** Database is the exact database name shown by SHOW DATABASES. */
|
|
33
|
+
"database": string;
|
|
34
|
+
}
|
|
35
|
+
/** TablesPage contains at most 100 sorted table names. */
|
|
36
|
+
interface TablesPage {
|
|
37
|
+
/** Database is the database that was inspected. */
|
|
38
|
+
"database": string;
|
|
39
|
+
/** Names contains the first 100 table names in sorted order. */
|
|
40
|
+
"names": Array<string> | null;
|
|
41
|
+
/** HasMore reports whether another table was present after the first 100. */
|
|
42
|
+
"hasMore": boolean;
|
|
43
|
+
}
|
|
44
|
+
/** Runtime validator for ListTablesInput. */
|
|
45
|
+
declare const ListTablesInputSchema: z.ZodObject<{
|
|
46
|
+
database: z.ZodString;
|
|
47
|
+
}, z.core.$strict>;
|
|
48
|
+
/** Runtime validator for TablesPage. */
|
|
49
|
+
declare const TablesPageSchema: z.ZodObject<{
|
|
50
|
+
database: z.ZodString;
|
|
51
|
+
names: z.ZodNullable<z.ZodArray<z.ZodString>>;
|
|
52
|
+
hasMore: z.ZodBoolean;
|
|
53
|
+
}, z.core.$strict>;
|
|
54
|
+
|
|
55
|
+
/** Typed operations supplied by a client or mock. */
|
|
56
|
+
interface Operations {
|
|
57
|
+
/** Invoke listTables through this connection. */
|
|
58
|
+
listTables(): Query<ListTablesInput, TablesPage>;
|
|
59
|
+
}
|
|
60
|
+
/** Named connector connection kept outside Flow state. */
|
|
61
|
+
declare class Connection<BoundOperations = Operations> {
|
|
62
|
+
/** Stable provider and connection name. */
|
|
63
|
+
readonly reference: ConnectionRef;
|
|
64
|
+
/** Bound provider operations. */
|
|
65
|
+
readonly operations: BoundOperations;
|
|
66
|
+
/** Validate a reference and bind operations. */
|
|
67
|
+
constructor(reference: ConnectionRef, operations: BoundOperations);
|
|
68
|
+
}
|
|
69
|
+
/** Bind a client to a named connection. */
|
|
70
|
+
declare function newConnection(client: Operations, reference: ConnectionRef): Connection;
|
|
71
|
+
/** Bind scripted operations to a named connection. */
|
|
72
|
+
declare function newConnectionWithOperations(operations: Operations, reference: ConnectionRef): Connection;
|
|
73
|
+
|
|
74
|
+
export { Connection as C, type ListTablesInput as L, type Operations as O, type TablesPage as T, type Config as a, type Credentials as b, ConfigSchema as c, type CredentialSource as d, ListTablesInputSchema as e, TablesPageSchema as f, decodeCredentials as g, newConnectionWithOperations as h, newConnection as n };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { L as ListTablesInput, T as TablesPage, C as Connection, O as Operations, a as Config, b as Credentials } from './connection-zXWJ_3zD.js';
|
|
2
|
+
export { c as ConfigSchema, d as CredentialSource, e as ListTablesInputSchema, f as TablesPageSchema, g as decodeCredentials, n as newConnection, h as newConnectionWithOperations } from './connection-zXWJ_3zD.js';
|
|
3
|
+
import { QueryDefinition, QueryStepConfig, Query, QueryResult, QueryStep, CredentialProvider, Call, QueryAttempt } from '@superdurable/connectors-sdk';
|
|
4
|
+
import { StepTarget } from '@superdurable/dex';
|
|
5
|
+
import { LoadedProject } from '@superdurable/connectors-sdk/projectconfig';
|
|
6
|
+
import { ProviderRequest, ProviderResponse } from '@superdurable/connectors-sdk/providerhttp';
|
|
7
|
+
import 'zod';
|
|
8
|
+
|
|
9
|
+
/** Stable connector identity. */
|
|
10
|
+
declare const ConnectorID = "clickhouse";
|
|
11
|
+
/** Provider identity for named connections. */
|
|
12
|
+
declare const ProviderID = "clickhouse";
|
|
13
|
+
/** Branch IDs for listTables. */
|
|
14
|
+
declare const ListTablesBranch: {
|
|
15
|
+
readonly Listed: "listed";
|
|
16
|
+
readonly ProviderRejected: "providerRejected";
|
|
17
|
+
readonly InvalidResponse: "invalidResponse";
|
|
18
|
+
readonly Defect: "defect";
|
|
19
|
+
};
|
|
20
|
+
/** ClickHouse returned the table names. */
|
|
21
|
+
declare const ListTablesBranchListed: "listed";
|
|
22
|
+
/** ClickHouse conclusively rejected the metadata query. */
|
|
23
|
+
declare const ListTablesBranchProviderRejected: "providerRejected";
|
|
24
|
+
/** ClickHouse returned malformed or oversized JSON. */
|
|
25
|
+
declare const ListTablesBranchInvalidResponse: "invalidResponse";
|
|
26
|
+
/** Local input or connection credentials are invalid. */
|
|
27
|
+
declare const ListTablesBranchDefect: "defect";
|
|
28
|
+
/** Manifest definition for listTables. */
|
|
29
|
+
declare const ListTablesDefinition: QueryDefinition;
|
|
30
|
+
/** Manifest metadata for listTables. */
|
|
31
|
+
declare const ListTablesMetadata: {
|
|
32
|
+
readonly kind: "query";
|
|
33
|
+
readonly idempotency: "none";
|
|
34
|
+
readonly authorization: "required";
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** Configuration for the listTables connector Step. */
|
|
38
|
+
interface ListTablesStepConfig<StepInput, OperationInput = ListTablesInput, OperationOutput = TablesPage> extends Omit<QueryStepConfig<StepInput, OperationInput, OperationOutput>, 'operation' | 'connection' | 'branches'> {
|
|
39
|
+
/** Named connection supplying this operation. */
|
|
40
|
+
connection: Connection<{
|
|
41
|
+
listTables(): Query<OperationInput, OperationOutput>;
|
|
42
|
+
}>;
|
|
43
|
+
/** Name matching the bound connection. */
|
|
44
|
+
connectionName: string;
|
|
45
|
+
/** ClickHouse returned the table names. */
|
|
46
|
+
listed: StepTarget<QueryResult<OperationOutput>>;
|
|
47
|
+
/** ClickHouse conclusively rejected the metadata query. */
|
|
48
|
+
providerRejected?: StepTarget<QueryResult<OperationOutput>>;
|
|
49
|
+
/** ClickHouse returned malformed or oversized JSON. */
|
|
50
|
+
invalidResponse?: StepTarget<QueryResult<OperationOutput>>;
|
|
51
|
+
/** Local input or connection credentials are invalid. */
|
|
52
|
+
defect?: StepTarget<QueryResult<OperationOutput>>;
|
|
53
|
+
}
|
|
54
|
+
/** Build the listTables Step from a named connection. */
|
|
55
|
+
declare function newListTablesStep<StepInput, OperationInput = ListTablesInput, OperationOutput = TablesPage>(configuration: ListTablesStepConfig<StepInput, OperationInput, OperationOutput>): QueryStep<StepInput, OperationInput, OperationOutput>;
|
|
56
|
+
|
|
57
|
+
/** Open one named ClickHouse connection from Dex project configuration. */
|
|
58
|
+
declare function newProjectConnection(project: LoadedProject, connectionName: string): Connection<Operations>;
|
|
59
|
+
|
|
60
|
+
/** Injectable provider sender for tests and local applications. */
|
|
61
|
+
interface ClickHouseClientOptions {
|
|
62
|
+
/** Provider sender; omitted uses the SDK transport. */ send?: (request: ProviderRequest) => Promise<ProviderResponse>;
|
|
63
|
+
}
|
|
64
|
+
interface Exchange {
|
|
65
|
+
status: number;
|
|
66
|
+
body: Uint8Array;
|
|
67
|
+
retryAfterMs: number;
|
|
68
|
+
error?: 'credential' | 'request' | 'tooLarge';
|
|
69
|
+
}
|
|
70
|
+
/** Authenticated ClickHouse HTTP client for table names. */
|
|
71
|
+
declare class ClickHouseClient {
|
|
72
|
+
private readonly credentials;
|
|
73
|
+
private readonly baseURL;
|
|
74
|
+
private readonly timeoutMs;
|
|
75
|
+
private readonly maxResponseBytes;
|
|
76
|
+
private readonly send;
|
|
77
|
+
/** Validate provider configuration without contacting ClickHouse. */
|
|
78
|
+
constructor(config: Config, credentials: CredentialProvider<Credentials>, options?: ClickHouseClientOptions);
|
|
79
|
+
/** Bind the listTables Query. */ listTables(): ListTablesOperation;
|
|
80
|
+
/** Resolve credentials and send one bounded table query. */
|
|
81
|
+
get(call: Call, database: string): Promise<Exchange>;
|
|
82
|
+
}
|
|
83
|
+
/** List up to 100 sorted table names in one database. */
|
|
84
|
+
declare class ListTablesOperation implements Query<ListTablesInput, TablesPage> {
|
|
85
|
+
private readonly client;
|
|
86
|
+
/** Bind the provider client. */ constructor(client: ClickHouseClient);
|
|
87
|
+
/** Return the generated Query definition. */ definition(): QueryDefinition;
|
|
88
|
+
/** Classify provider outcomes consistently with Go. */
|
|
89
|
+
invoke(call: Call, input: ListTablesInput): Promise<QueryAttempt<TablesPage>>;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export { ClickHouseClient, type ClickHouseClientOptions, Config, Connection, ConnectorID, Credentials, ListTablesBranch, ListTablesBranchDefect, ListTablesBranchInvalidResponse, ListTablesBranchListed, ListTablesBranchProviderRejected, ListTablesDefinition, ListTablesInput, ListTablesMetadata, ListTablesOperation, type ListTablesStepConfig, ProviderID, TablesPage, newListTablesStep, newProjectConnection };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ConfigSchema,
|
|
3
|
+
Connection,
|
|
4
|
+
ConnectorID,
|
|
5
|
+
ListTablesBranch,
|
|
6
|
+
ListTablesBranchDefect,
|
|
7
|
+
ListTablesBranchInvalidResponse,
|
|
8
|
+
ListTablesBranchListed,
|
|
9
|
+
ListTablesBranchProviderRejected,
|
|
10
|
+
ListTablesDefinition,
|
|
11
|
+
ListTablesInputSchema,
|
|
12
|
+
ListTablesMetadata,
|
|
13
|
+
ProviderID,
|
|
14
|
+
TablesPageSchema,
|
|
15
|
+
decodeCredentials,
|
|
16
|
+
newConnection,
|
|
17
|
+
newConnectionWithOperations,
|
|
18
|
+
newProjectConnection
|
|
19
|
+
} from "./chunk-F5PUPLRK.js";
|
|
20
|
+
|
|
21
|
+
// src/generated/steps.ts
|
|
22
|
+
import { goToBranch, newQueryStep } from "@superdurable/connectors-sdk";
|
|
23
|
+
function newListTablesStep(configuration) {
|
|
24
|
+
const { connection, connectionName, listed, providerRejected, invalidResponse, defect, ...stepConfiguration } = configuration;
|
|
25
|
+
if (!connection || connection.reference.name !== connectionName) throw new TypeError("Step connection name differs from the bound connection");
|
|
26
|
+
return newQueryStep({ ...stepConfiguration, operation: connection.operations.listTables(), connection: connection.reference, branches: [
|
|
27
|
+
goToBranch("listed", listed),
|
|
28
|
+
...providerRejected ? [goToBranch("providerRejected", providerRejected)] : [],
|
|
29
|
+
...invalidResponse ? [goToBranch("invalidResponse", invalidResponse)] : [],
|
|
30
|
+
...defect ? [goToBranch("defect", defect)] : []
|
|
31
|
+
] });
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
// src/project.ts
|
|
35
|
+
import { SecretString as SecretString2 } from "@superdurable/connectors-sdk";
|
|
36
|
+
import { z } from "zod";
|
|
37
|
+
|
|
38
|
+
// src/client.ts
|
|
39
|
+
import { SecretString, newQueryBranch, newQueryRetry } from "@superdurable/connectors-sdk";
|
|
40
|
+
import { BodyTooLargeError, isHeaderSafeCredential, parseRetryAfter, sendProviderRequest, validateBaseURL } from "@superdurable/connectors-sdk/providerhttp";
|
|
41
|
+
var listTablesSQL = "SELECT name FROM system.tables WHERE database = {database:String} ORDER BY name LIMIT 101 FORMAT JSON";
|
|
42
|
+
var emptyTables = () => ({ database: "", names: [], hasMore: false });
|
|
43
|
+
var ClickHouseClient = class {
|
|
44
|
+
/** Validate provider configuration without contacting ClickHouse. */
|
|
45
|
+
constructor(config, credentials, options = {}) {
|
|
46
|
+
this.credentials = credentials;
|
|
47
|
+
if (!config || !credentials) throw new TypeError("ClickHouse configuration and credentials are required");
|
|
48
|
+
this.baseURL = validateBaseURL(config.baseUrl).replace(/\/$/, "");
|
|
49
|
+
this.timeoutMs = config.timeoutMs ?? 15e3;
|
|
50
|
+
this.maxResponseBytes = config.maxResponseBytes ?? 1048576;
|
|
51
|
+
if (!Number.isSafeInteger(this.timeoutMs) || this.timeoutMs <= 0 || !Number.isSafeInteger(this.maxResponseBytes) || this.maxResponseBytes <= 0)
|
|
52
|
+
throw new TypeError("ClickHouse request limits must be positive integers");
|
|
53
|
+
this.send = options.send ?? sendProviderRequest;
|
|
54
|
+
}
|
|
55
|
+
credentials;
|
|
56
|
+
baseURL;
|
|
57
|
+
timeoutMs;
|
|
58
|
+
maxResponseBytes;
|
|
59
|
+
send;
|
|
60
|
+
/** Bind the listTables Query. */
|
|
61
|
+
listTables() {
|
|
62
|
+
return new ListTablesOperation(this);
|
|
63
|
+
}
|
|
64
|
+
/** Resolve credentials and send one bounded table query. */
|
|
65
|
+
async get(call, database) {
|
|
66
|
+
let username;
|
|
67
|
+
let password;
|
|
68
|
+
try {
|
|
69
|
+
const credentials = await this.credentials.resolve(call, call.context.cancellationSignal);
|
|
70
|
+
username = credentials.username;
|
|
71
|
+
password = credentials.password instanceof SecretString ? credentials.password.reveal() : "";
|
|
72
|
+
} catch {
|
|
73
|
+
return emptyExchange("credential");
|
|
74
|
+
}
|
|
75
|
+
if (!isHeaderSafeCredential(username) || !isHeaderSafeCredential(password)) return emptyExchange("credential");
|
|
76
|
+
const url = new URL(`${this.baseURL}/`);
|
|
77
|
+
url.searchParams.set("query", listTablesSQL);
|
|
78
|
+
url.searchParams.set("param_database", database);
|
|
79
|
+
const request = {
|
|
80
|
+
url: url.toString(),
|
|
81
|
+
method: "GET",
|
|
82
|
+
headers: { Accept: "application/json", "X-ClickHouse-User": username, "X-ClickHouse-Key": password },
|
|
83
|
+
maxResponseBytes: this.maxResponseBytes,
|
|
84
|
+
timeoutMs: this.timeoutMs,
|
|
85
|
+
addressPolicy: this.baseURL.startsWith("https://") ? "publicHTTPS" : "privateNetworkHTTP",
|
|
86
|
+
signal: call.context.cancellationSignal
|
|
87
|
+
};
|
|
88
|
+
let response;
|
|
89
|
+
let isTooLarge = false;
|
|
90
|
+
try {
|
|
91
|
+
response = await this.send(request);
|
|
92
|
+
} catch (error) {
|
|
93
|
+
if (error instanceof BodyTooLargeError && error.status !== void 0) {
|
|
94
|
+
response = { status: error.status, headers: error.headers ?? {}, body: new Uint8Array() };
|
|
95
|
+
isTooLarge = true;
|
|
96
|
+
} else return emptyExchange("request");
|
|
97
|
+
}
|
|
98
|
+
const retryAfterMs = parseRetryAfter(header(response.headers, "retry-after"));
|
|
99
|
+
if (isTooLarge || response.body.length > this.maxResponseBytes)
|
|
100
|
+
return { status: response.status, body: new Uint8Array(), retryAfterMs, error: "tooLarge" };
|
|
101
|
+
return { status: response.status, body: response.body, retryAfterMs };
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
var ListTablesOperation = class {
|
|
105
|
+
/** Bind the provider client. */
|
|
106
|
+
constructor(client) {
|
|
107
|
+
this.client = client;
|
|
108
|
+
}
|
|
109
|
+
client;
|
|
110
|
+
/** Return the generated Query definition. */
|
|
111
|
+
definition() {
|
|
112
|
+
return ListTablesDefinition;
|
|
113
|
+
}
|
|
114
|
+
/** Classify provider outcomes consistently with Go. */
|
|
115
|
+
async invoke(call, input) {
|
|
116
|
+
if (!isValidDatabase(input?.database))
|
|
117
|
+
return terminal("defect", "VALIDATION", "database must contain 1\u2013128 printable characters");
|
|
118
|
+
const exchange = await this.client.get(call, input.database);
|
|
119
|
+
if (exchange.error === "credential") return terminal("defect", "AUTHENTICATION", "ClickHouse credentials are unavailable or invalid");
|
|
120
|
+
if (exchange.error === "request") return retry("TRANSPORT", "ClickHouse request failed");
|
|
121
|
+
if (exchange.status === 429) return retry("RATE_LIMIT", "ClickHouse rate limited the request", exchange.retryAfterMs);
|
|
122
|
+
if (exchange.status === 408 || exchange.status >= 500) return retry("AVAILABILITY", "ClickHouse is temporarily unavailable", exchange.retryAfterMs);
|
|
123
|
+
if (exchange.status !== 200) return terminal("providerRejected", "PROVIDER_REJECTION", `ClickHouse rejected HTTP ${exchange.status}`);
|
|
124
|
+
if (exchange.error === "tooLarge") return terminal("invalidResponse", "RESPONSE_TOO_LARGE", "ClickHouse response exceeded the configured limit");
|
|
125
|
+
const tables = decodeTables(exchange.body, input.database);
|
|
126
|
+
if (!tables) return terminal("invalidResponse", "PROTOCOL", "ClickHouse returned invalid table-list JSON");
|
|
127
|
+
return newQueryBranch("listed", tables);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
function isValidDatabase(value) {
|
|
131
|
+
return typeof value === "string" && value.length > 0 && value.trim() === value && new TextEncoder().encode(value).length <= 128 && [...value].every((character) => character.codePointAt(0) >= 32 && character.codePointAt(0) !== 127) && !/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF])/.test(value);
|
|
132
|
+
}
|
|
133
|
+
function emptyExchange(error) {
|
|
134
|
+
return { status: 0, body: new Uint8Array(), retryAfterMs: 0, error };
|
|
135
|
+
}
|
|
136
|
+
function failure(kind, message) {
|
|
137
|
+
return { provider: "clickhouse", operation: "listTables", kind, message };
|
|
138
|
+
}
|
|
139
|
+
function terminal(branch, kind, message) {
|
|
140
|
+
return newQueryBranch(branch, emptyTables(), {}, failure(kind, message));
|
|
141
|
+
}
|
|
142
|
+
function retry(kind, message, delay = 0) {
|
|
143
|
+
return newQueryRetry(failure(kind, message), delay);
|
|
144
|
+
}
|
|
145
|
+
function header(headers, name) {
|
|
146
|
+
const entry = Object.entries(headers).find(([key]) => key.toLowerCase() === name.toLowerCase())?.[1];
|
|
147
|
+
return Array.isArray(entry) ? entry[0] ?? "" : entry ?? "";
|
|
148
|
+
}
|
|
149
|
+
function isObject(value) {
|
|
150
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
151
|
+
}
|
|
152
|
+
function decodeTables(body, database) {
|
|
153
|
+
let raw;
|
|
154
|
+
try {
|
|
155
|
+
raw = JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(body));
|
|
156
|
+
} catch {
|
|
157
|
+
return void 0;
|
|
158
|
+
}
|
|
159
|
+
if (!isObject(raw) || !Array.isArray(raw.data) || raw.data.length > 101 || !Number.isSafeInteger(raw.rows) || raw.rows !== raw.data.length) return void 0;
|
|
160
|
+
const names = [];
|
|
161
|
+
for (const row of raw.data) {
|
|
162
|
+
if (!isObject(row) || typeof row.name !== "string" || !row.name) return void 0;
|
|
163
|
+
if (names.length < 100) names.push(row.name);
|
|
164
|
+
}
|
|
165
|
+
return { database, names, hasMore: raw.data.length > 100 };
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// src/project.ts
|
|
169
|
+
function newProjectConnection2(project, connectionName) {
|
|
170
|
+
return newProjectConnection(project, connectionName, (loadedProject, name) => {
|
|
171
|
+
const selected = loadedProject.configuration.connections.find((entry) => entry.connectorId === "clickhouse" && entry.connectionName === name);
|
|
172
|
+
if (!selected) throw new TypeError("ClickHouse project connection is not configured");
|
|
173
|
+
const fields = z.strictObject({ baseUrl: z.string(), timeout: z.union([z.string(), z.number().int()]).optional(), maxResponseBytes: z.number().int().optional() }).parse(selected.configuration);
|
|
174
|
+
const timeoutMs = typeof fields.timeout === "number" ? Math.ceil(fields.timeout / 1e6) : fields.timeout ? parseDurationMilliseconds(fields.timeout) : void 0;
|
|
175
|
+
const config = {
|
|
176
|
+
baseUrl: fields.baseUrl,
|
|
177
|
+
...timeoutMs !== void 0 ? { timeoutMs } : {},
|
|
178
|
+
...fields.maxResponseBytes !== void 0 ? { maxResponseBytes: fields.maxResponseBytes } : {}
|
|
179
|
+
};
|
|
180
|
+
const credentials = {
|
|
181
|
+
async resolve(_call, signal) {
|
|
182
|
+
const privateFields = await loadedProject.resolveCredential("clickhouse", name, signal);
|
|
183
|
+
if (typeof privateFields.username !== "string" || typeof privateFields.password !== "string") throw new TypeError("ClickHouse credentials are unavailable");
|
|
184
|
+
return { username: privateFields.username, password: new SecretString2(privateFields.password) };
|
|
185
|
+
}
|
|
186
|
+
};
|
|
187
|
+
return new ClickHouseClient(config, credentials);
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
function parseDurationMilliseconds(value) {
|
|
191
|
+
let remaining = value;
|
|
192
|
+
let milliseconds = 0;
|
|
193
|
+
const units = { ns: 1e-6, us: 1e-3, "\xB5s": 1e-3, ms: 1, s: 1e3, m: 6e4, h: 36e5 };
|
|
194
|
+
while (remaining) {
|
|
195
|
+
const part = /^(\d+(?:\.\d+)?)(ns|us|µs|ms|s|m|h)/.exec(remaining);
|
|
196
|
+
if (!part) throw new TypeError("ClickHouse timeout must be a positive Go duration");
|
|
197
|
+
milliseconds += Number(part[1]) * (units[part[2] ?? ""] ?? NaN);
|
|
198
|
+
remaining = remaining.slice(part[0].length);
|
|
199
|
+
}
|
|
200
|
+
if (!Number.isSafeInteger(milliseconds) || milliseconds <= 0) throw new TypeError("ClickHouse timeout must resolve to positive whole milliseconds");
|
|
201
|
+
return milliseconds;
|
|
202
|
+
}
|
|
203
|
+
export {
|
|
204
|
+
ClickHouseClient,
|
|
205
|
+
ConfigSchema,
|
|
206
|
+
Connection,
|
|
207
|
+
ConnectorID,
|
|
208
|
+
ListTablesBranch,
|
|
209
|
+
ListTablesBranchDefect,
|
|
210
|
+
ListTablesBranchInvalidResponse,
|
|
211
|
+
ListTablesBranchListed,
|
|
212
|
+
ListTablesBranchProviderRejected,
|
|
213
|
+
ListTablesDefinition,
|
|
214
|
+
ListTablesInputSchema,
|
|
215
|
+
ListTablesMetadata,
|
|
216
|
+
ListTablesOperation,
|
|
217
|
+
ProviderID,
|
|
218
|
+
TablesPageSchema,
|
|
219
|
+
decodeCredentials,
|
|
220
|
+
newConnection,
|
|
221
|
+
newConnectionWithOperations,
|
|
222
|
+
newListTablesStep,
|
|
223
|
+
newProjectConnection2 as newProjectConnection
|
|
224
|
+
};
|
package/dist/mock.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { MockQuery, Case } from '@superdurable/connectors-sdk/connectormock';
|
|
2
|
+
import { Failure } from '@superdurable/connectors-sdk';
|
|
3
|
+
import { O as Operations, C as Connection, L as ListTablesInput, T as TablesPage } from './connection-zXWJ_3zD.js';
|
|
4
|
+
import 'zod';
|
|
5
|
+
|
|
6
|
+
/** Go zero value for ListTablesInput in scripted cases. */
|
|
7
|
+
declare const emptyListTablesInput: ListTablesInput;
|
|
8
|
+
/** Go zero value for TablesPage in scripted cases. */
|
|
9
|
+
declare const emptyTablesPage: TablesPage;
|
|
10
|
+
/** Script the listed branch. */
|
|
11
|
+
declare function listTablesListed(value: TablesPage, failure?: Failure): Case<TablesPage>;
|
|
12
|
+
/** Script the providerRejected branch. */
|
|
13
|
+
declare function listTablesProviderRejected(value: TablesPage, failure?: Failure): Case<TablesPage>;
|
|
14
|
+
/** Script the invalidResponse branch. */
|
|
15
|
+
declare function listTablesInvalidResponse(value: TablesPage, failure?: Failure): Case<TablesPage>;
|
|
16
|
+
/** Script the defect branch. */
|
|
17
|
+
declare function listTablesDefect(value: TablesPage, failure?: Failure): Case<TablesPage>;
|
|
18
|
+
/** Script a safe retry of listTables. */
|
|
19
|
+
declare function listTablesRetry(failure: Failure, retryAfterMs?: number): Case<TablesPage>;
|
|
20
|
+
/** Manifest scenario listedDefault for listTables. */
|
|
21
|
+
declare function listTablesListedDefault(): Case<TablesPage>;
|
|
22
|
+
/** Default listTables scenario. */
|
|
23
|
+
declare function listTablesDefault(): Case<TablesPage>;
|
|
24
|
+
/** Scripted operations and manifest defaults for this connector. */
|
|
25
|
+
declare class GeneratedMock implements Operations {
|
|
26
|
+
#private;
|
|
27
|
+
constructor(connectionName: string);
|
|
28
|
+
connection(): Connection;
|
|
29
|
+
listTables(): MockQuery<ListTablesInput, TablesPage>;
|
|
30
|
+
assertNoFailures(): void;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export { GeneratedMock, GeneratedMock as Mock, emptyListTablesInput, emptyTablesPage, listTablesDefault, listTablesDefect, listTablesInvalidResponse, listTablesListed, listTablesListedDefault, listTablesProviderRejected, listTablesRetry };
|
package/dist/mock.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ListTablesDefinition,
|
|
3
|
+
ListTablesInputSchema,
|
|
4
|
+
ProviderID,
|
|
5
|
+
TablesPageSchema,
|
|
6
|
+
newConnectionWithOperations
|
|
7
|
+
} from "./chunk-F5PUPLRK.js";
|
|
8
|
+
|
|
9
|
+
// src/generated/mock.ts
|
|
10
|
+
import { branchCase, retryCase, newQuery } from "@superdurable/connectors-sdk/connectormock";
|
|
11
|
+
var emptyListTablesInput = ListTablesInputSchema.parse({
|
|
12
|
+
"database": ""
|
|
13
|
+
});
|
|
14
|
+
var emptyTablesPage = TablesPageSchema.parse({
|
|
15
|
+
"database": "",
|
|
16
|
+
"names": [],
|
|
17
|
+
"hasMore": false
|
|
18
|
+
});
|
|
19
|
+
function listTablesListed(value, failure) {
|
|
20
|
+
return branchCase("listed", value, failure);
|
|
21
|
+
}
|
|
22
|
+
function listTablesProviderRejected(value, failure) {
|
|
23
|
+
return branchCase("providerRejected", value, failure);
|
|
24
|
+
}
|
|
25
|
+
function listTablesInvalidResponse(value, failure) {
|
|
26
|
+
return branchCase("invalidResponse", value, failure);
|
|
27
|
+
}
|
|
28
|
+
function listTablesDefect(value, failure) {
|
|
29
|
+
return branchCase("defect", value, failure);
|
|
30
|
+
}
|
|
31
|
+
function listTablesRetry(failure, retryAfterMs = 0) {
|
|
32
|
+
return retryCase(failure, retryAfterMs);
|
|
33
|
+
}
|
|
34
|
+
function listTablesListedDefault() {
|
|
35
|
+
const value = TablesPageSchema.parse({ "database": "analytics", "hasMore": false, "names": ["events", "users"] });
|
|
36
|
+
return branchCase("listed", value);
|
|
37
|
+
}
|
|
38
|
+
function listTablesDefault() {
|
|
39
|
+
return listTablesListedDefault();
|
|
40
|
+
}
|
|
41
|
+
var GeneratedMock = class {
|
|
42
|
+
#listTables;
|
|
43
|
+
#connection;
|
|
44
|
+
constructor(connectionName) {
|
|
45
|
+
this.#listTables = newQuery(ListTablesDefinition).default(listTablesDefault());
|
|
46
|
+
this.#connection = newConnectionWithOperations(this, { provider: ProviderID, name: connectionName });
|
|
47
|
+
}
|
|
48
|
+
connection() {
|
|
49
|
+
return this.#connection;
|
|
50
|
+
}
|
|
51
|
+
listTables() {
|
|
52
|
+
return this.#listTables;
|
|
53
|
+
}
|
|
54
|
+
assertNoFailures() {
|
|
55
|
+
this.#listTables.assertNoFailures();
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
export {
|
|
59
|
+
GeneratedMock,
|
|
60
|
+
GeneratedMock as Mock,
|
|
61
|
+
emptyListTablesInput,
|
|
62
|
+
emptyTablesPage,
|
|
63
|
+
listTablesDefault,
|
|
64
|
+
listTablesDefect,
|
|
65
|
+
listTablesInvalidResponse,
|
|
66
|
+
listTablesListed,
|
|
67
|
+
listTablesListedDefault,
|
|
68
|
+
listTablesProviderRejected,
|
|
69
|
+
listTablesRetry
|
|
70
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,61 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@superdurable/connector-clickhouse",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"description": "ClickHouse connector for Dex TypeScript applications",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/superdurable/dex-connectors-library.git",
|
|
9
|
+
"directory": "connectors/clickhouse/typescript"
|
|
10
|
+
},
|
|
11
|
+
"type": "module",
|
|
12
|
+
"engines": {
|
|
13
|
+
"node": "^22.0.0 || ^24.0.0"
|
|
14
|
+
},
|
|
15
|
+
"module": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./mock": {
|
|
23
|
+
"types": "./dist/mock.d.ts",
|
|
24
|
+
"import": "./dist/mock.js"
|
|
25
|
+
},
|
|
26
|
+
"./dex-connector.json": "./dex-connector.json"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist",
|
|
30
|
+
"README.md",
|
|
31
|
+
"LICENSE",
|
|
32
|
+
"dex-connector.json"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"prepack": "npm run build",
|
|
36
|
+
"build": "tsup src/index.ts src/mock.ts --format esm --dts --clean",
|
|
37
|
+
"typecheck": "tsc --noEmit",
|
|
38
|
+
"lint": "eslint src test examples",
|
|
39
|
+
"test": "vitest run --exclude test/integration/**",
|
|
40
|
+
"test:integration": "vitest run test/integration/*.integration.test.ts",
|
|
41
|
+
"example:worker": "tsx examples/table-inspection/worker.ts",
|
|
42
|
+
"example:start": "tsx examples/table-inspection/start.ts",
|
|
43
|
+
"check": "npm run typecheck && npm run lint && npm test && npm run build"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@superdurable/connectors-sdk": "0.1.1",
|
|
47
|
+
"@superdurable/dex": ">=1.28.0",
|
|
48
|
+
"zod": "^4.1.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@eslint/js": "^9.0.0",
|
|
52
|
+
"@types/node": "^22.0.0",
|
|
53
|
+
"eslint": "^9.0.0",
|
|
54
|
+
"tsup": "^8.0.0",
|
|
55
|
+
"tsx": "^4.23.15",
|
|
56
|
+
"typescript": "^5.9.0",
|
|
57
|
+
"typescript-eslint": "^8.0.0",
|
|
58
|
+
"vitest": "^3.0.0",
|
|
59
|
+
"yaml": "^2.9.1"
|
|
60
|
+
}
|
|
61
|
+
}
|