@superdurable/connector-clickhouse 0.0.0-stage → 0.2.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 +155 -0
- package/dist/chunk-23BBEJPR.js +200 -0
- package/dist/connection-IQqDAR8z.d.ts +142 -0
- package/dist/index.d.ts +216 -0
- package/dist/index.js +410 -0
- package/dist/mock.d.ts +73 -0
- package/dist/mock.js +171 -0
- package/package.json +59 -4
package/dist/mock.d.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { MockQuery, Case } from '@superdurable/connectors-sdk/connectormock';
|
|
2
|
+
import { Failure } from '@superdurable/connectors-sdk';
|
|
3
|
+
import { O as Operations, a as Connection, b as ListDatabasesInput, D as DatabasesPage, c as ListTablesInput, T as TablesPage, L as ListColumnsInput, C as ColumnsPage, f as Column } from './connection-IQqDAR8z.js';
|
|
4
|
+
import 'zod';
|
|
5
|
+
|
|
6
|
+
/** Go zero value for ListDatabasesInput in scripted cases. */
|
|
7
|
+
declare const emptyListDatabasesInput: ListDatabasesInput;
|
|
8
|
+
/** Go zero value for DatabasesPage in scripted cases. */
|
|
9
|
+
declare const emptyDatabasesPage: DatabasesPage;
|
|
10
|
+
/** Go zero value for ListTablesInput in scripted cases. */
|
|
11
|
+
declare const emptyListTablesInput: ListTablesInput;
|
|
12
|
+
/** Go zero value for TablesPage in scripted cases. */
|
|
13
|
+
declare const emptyTablesPage: TablesPage;
|
|
14
|
+
/** Go zero value for ListColumnsInput in scripted cases. */
|
|
15
|
+
declare const emptyListColumnsInput: ListColumnsInput;
|
|
16
|
+
/** Go zero value for Column in scripted cases. */
|
|
17
|
+
declare const emptyColumn: Column;
|
|
18
|
+
/** Go zero value for ColumnsPage in scripted cases. */
|
|
19
|
+
declare const emptyColumnsPage: ColumnsPage;
|
|
20
|
+
/** Script the listed branch. */
|
|
21
|
+
declare function listDatabasesListed(value: DatabasesPage, failure?: Failure): Case<DatabasesPage>;
|
|
22
|
+
/** Script the providerRejected branch. */
|
|
23
|
+
declare function listDatabasesProviderRejected(value: DatabasesPage, failure?: Failure): Case<DatabasesPage>;
|
|
24
|
+
/** Script the invalidResponse branch. */
|
|
25
|
+
declare function listDatabasesInvalidResponse(value: DatabasesPage, failure?: Failure): Case<DatabasesPage>;
|
|
26
|
+
/** Script the defect branch. */
|
|
27
|
+
declare function listDatabasesDefect(value: DatabasesPage, failure?: Failure): Case<DatabasesPage>;
|
|
28
|
+
/** Script a safe retry of listDatabases. */
|
|
29
|
+
declare function listDatabasesRetry(failure: Failure, retryAfterMs?: number): Case<DatabasesPage>;
|
|
30
|
+
/** Manifest scenario listedDefault for listDatabases. */
|
|
31
|
+
declare function listDatabasesListedDefault(): Case<DatabasesPage>;
|
|
32
|
+
/** Default listDatabases scenario. */
|
|
33
|
+
declare function listDatabasesDefault(): Case<DatabasesPage>;
|
|
34
|
+
/** Script the listed branch. */
|
|
35
|
+
declare function listTablesListed(value: TablesPage, failure?: Failure): Case<TablesPage>;
|
|
36
|
+
/** Script the providerRejected branch. */
|
|
37
|
+
declare function listTablesProviderRejected(value: TablesPage, failure?: Failure): Case<TablesPage>;
|
|
38
|
+
/** Script the invalidResponse branch. */
|
|
39
|
+
declare function listTablesInvalidResponse(value: TablesPage, failure?: Failure): Case<TablesPage>;
|
|
40
|
+
/** Script the defect branch. */
|
|
41
|
+
declare function listTablesDefect(value: TablesPage, failure?: Failure): Case<TablesPage>;
|
|
42
|
+
/** Script a safe retry of listTables. */
|
|
43
|
+
declare function listTablesRetry(failure: Failure, retryAfterMs?: number): Case<TablesPage>;
|
|
44
|
+
/** Manifest scenario listedDefault for listTables. */
|
|
45
|
+
declare function listTablesListedDefault(): Case<TablesPage>;
|
|
46
|
+
/** Default listTables scenario. */
|
|
47
|
+
declare function listTablesDefault(): Case<TablesPage>;
|
|
48
|
+
/** Script the listed branch. */
|
|
49
|
+
declare function listColumnsListed(value: ColumnsPage, failure?: Failure): Case<ColumnsPage>;
|
|
50
|
+
/** Script the providerRejected branch. */
|
|
51
|
+
declare function listColumnsProviderRejected(value: ColumnsPage, failure?: Failure): Case<ColumnsPage>;
|
|
52
|
+
/** Script the invalidResponse branch. */
|
|
53
|
+
declare function listColumnsInvalidResponse(value: ColumnsPage, failure?: Failure): Case<ColumnsPage>;
|
|
54
|
+
/** Script the defect branch. */
|
|
55
|
+
declare function listColumnsDefect(value: ColumnsPage, failure?: Failure): Case<ColumnsPage>;
|
|
56
|
+
/** Script a safe retry of listColumns. */
|
|
57
|
+
declare function listColumnsRetry(failure: Failure, retryAfterMs?: number): Case<ColumnsPage>;
|
|
58
|
+
/** Manifest scenario listedDefault for listColumns. */
|
|
59
|
+
declare function listColumnsListedDefault(): Case<ColumnsPage>;
|
|
60
|
+
/** Default listColumns scenario. */
|
|
61
|
+
declare function listColumnsDefault(): Case<ColumnsPage>;
|
|
62
|
+
/** Scripted operations and manifest defaults for this connector. */
|
|
63
|
+
declare class GeneratedMock implements Operations {
|
|
64
|
+
#private;
|
|
65
|
+
constructor(connectionName: string);
|
|
66
|
+
connection(): Connection;
|
|
67
|
+
listDatabases(): MockQuery<ListDatabasesInput, DatabasesPage>;
|
|
68
|
+
listTables(): MockQuery<ListTablesInput, TablesPage>;
|
|
69
|
+
listColumns(): MockQuery<ListColumnsInput, ColumnsPage>;
|
|
70
|
+
assertNoFailures(): void;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { GeneratedMock, GeneratedMock as Mock, emptyColumn, emptyColumnsPage, emptyDatabasesPage, emptyListColumnsInput, emptyListDatabasesInput, emptyListTablesInput, emptyTablesPage, listColumnsDefault, listColumnsDefect, listColumnsInvalidResponse, listColumnsListed, listColumnsListedDefault, listColumnsProviderRejected, listColumnsRetry, listDatabasesDefault, listDatabasesDefect, listDatabasesInvalidResponse, listDatabasesListed, listDatabasesListedDefault, listDatabasesProviderRejected, listDatabasesRetry, listTablesDefault, listTablesDefect, listTablesInvalidResponse, listTablesListed, listTablesListedDefault, listTablesProviderRejected, listTablesRetry };
|
package/dist/mock.js
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ColumnSchema,
|
|
3
|
+
ColumnsPageSchema,
|
|
4
|
+
DatabasesPageSchema,
|
|
5
|
+
ListColumnsDefinition,
|
|
6
|
+
ListColumnsInputSchema,
|
|
7
|
+
ListDatabasesDefinition,
|
|
8
|
+
ListDatabasesInputSchema,
|
|
9
|
+
ListTablesDefinition,
|
|
10
|
+
ListTablesInputSchema,
|
|
11
|
+
ProviderID,
|
|
12
|
+
TablesPageSchema,
|
|
13
|
+
newConnectionWithOperations
|
|
14
|
+
} from "./chunk-23BBEJPR.js";
|
|
15
|
+
|
|
16
|
+
// src/generated/mock.ts
|
|
17
|
+
import { branchCase, retryCase, newQuery } from "@superdurable/connectors-sdk/connectormock";
|
|
18
|
+
var emptyListDatabasesInput = ListDatabasesInputSchema.parse({});
|
|
19
|
+
var emptyDatabasesPage = DatabasesPageSchema.parse({
|
|
20
|
+
"names": [],
|
|
21
|
+
"hasMore": false
|
|
22
|
+
});
|
|
23
|
+
var emptyListTablesInput = ListTablesInputSchema.parse({
|
|
24
|
+
"database": ""
|
|
25
|
+
});
|
|
26
|
+
var emptyTablesPage = TablesPageSchema.parse({
|
|
27
|
+
"database": "",
|
|
28
|
+
"names": [],
|
|
29
|
+
"hasMore": false
|
|
30
|
+
});
|
|
31
|
+
var emptyListColumnsInput = ListColumnsInputSchema.parse({
|
|
32
|
+
"database": "",
|
|
33
|
+
"table": ""
|
|
34
|
+
});
|
|
35
|
+
var emptyColumn = ColumnSchema.parse({
|
|
36
|
+
"name": "",
|
|
37
|
+
"type": ""
|
|
38
|
+
});
|
|
39
|
+
var emptyColumnsPage = ColumnsPageSchema.parse({
|
|
40
|
+
"database": "",
|
|
41
|
+
"table": "",
|
|
42
|
+
"columns": [],
|
|
43
|
+
"hasMore": false
|
|
44
|
+
});
|
|
45
|
+
function listDatabasesListed(value, failure) {
|
|
46
|
+
return branchCase("listed", value, failure);
|
|
47
|
+
}
|
|
48
|
+
function listDatabasesProviderRejected(value, failure) {
|
|
49
|
+
return branchCase("providerRejected", value, failure);
|
|
50
|
+
}
|
|
51
|
+
function listDatabasesInvalidResponse(value, failure) {
|
|
52
|
+
return branchCase("invalidResponse", value, failure);
|
|
53
|
+
}
|
|
54
|
+
function listDatabasesDefect(value, failure) {
|
|
55
|
+
return branchCase("defect", value, failure);
|
|
56
|
+
}
|
|
57
|
+
function listDatabasesRetry(failure, retryAfterMs = 0) {
|
|
58
|
+
return retryCase(failure, retryAfterMs);
|
|
59
|
+
}
|
|
60
|
+
function listDatabasesListedDefault() {
|
|
61
|
+
const value = DatabasesPageSchema.parse({ "hasMore": false, "names": ["analytics", "default"] });
|
|
62
|
+
return branchCase("listed", value);
|
|
63
|
+
}
|
|
64
|
+
function listDatabasesDefault() {
|
|
65
|
+
return listDatabasesListedDefault();
|
|
66
|
+
}
|
|
67
|
+
function listTablesListed(value, failure) {
|
|
68
|
+
return branchCase("listed", value, failure);
|
|
69
|
+
}
|
|
70
|
+
function listTablesProviderRejected(value, failure) {
|
|
71
|
+
return branchCase("providerRejected", value, failure);
|
|
72
|
+
}
|
|
73
|
+
function listTablesInvalidResponse(value, failure) {
|
|
74
|
+
return branchCase("invalidResponse", value, failure);
|
|
75
|
+
}
|
|
76
|
+
function listTablesDefect(value, failure) {
|
|
77
|
+
return branchCase("defect", value, failure);
|
|
78
|
+
}
|
|
79
|
+
function listTablesRetry(failure, retryAfterMs = 0) {
|
|
80
|
+
return retryCase(failure, retryAfterMs);
|
|
81
|
+
}
|
|
82
|
+
function listTablesListedDefault() {
|
|
83
|
+
const value = TablesPageSchema.parse({ "database": "analytics", "hasMore": false, "names": ["events", "users"] });
|
|
84
|
+
return branchCase("listed", value);
|
|
85
|
+
}
|
|
86
|
+
function listTablesDefault() {
|
|
87
|
+
return listTablesListedDefault();
|
|
88
|
+
}
|
|
89
|
+
function listColumnsListed(value, failure) {
|
|
90
|
+
return branchCase("listed", value, failure);
|
|
91
|
+
}
|
|
92
|
+
function listColumnsProviderRejected(value, failure) {
|
|
93
|
+
return branchCase("providerRejected", value, failure);
|
|
94
|
+
}
|
|
95
|
+
function listColumnsInvalidResponse(value, failure) {
|
|
96
|
+
return branchCase("invalidResponse", value, failure);
|
|
97
|
+
}
|
|
98
|
+
function listColumnsDefect(value, failure) {
|
|
99
|
+
return branchCase("defect", value, failure);
|
|
100
|
+
}
|
|
101
|
+
function listColumnsRetry(failure, retryAfterMs = 0) {
|
|
102
|
+
return retryCase(failure, retryAfterMs);
|
|
103
|
+
}
|
|
104
|
+
function listColumnsListedDefault() {
|
|
105
|
+
const value = ColumnsPageSchema.parse({ "columns": [{ "name": "id", "type": "UInt64" }, { "name": "event", "type": "String" }], "database": "analytics", "hasMore": false, "table": "events" });
|
|
106
|
+
return branchCase("listed", value);
|
|
107
|
+
}
|
|
108
|
+
function listColumnsDefault() {
|
|
109
|
+
return listColumnsListedDefault();
|
|
110
|
+
}
|
|
111
|
+
var GeneratedMock = class {
|
|
112
|
+
#listDatabases;
|
|
113
|
+
#listTables;
|
|
114
|
+
#listColumns;
|
|
115
|
+
#connection;
|
|
116
|
+
constructor(connectionName) {
|
|
117
|
+
this.#listDatabases = newQuery(ListDatabasesDefinition).default(listDatabasesDefault());
|
|
118
|
+
this.#listTables = newQuery(ListTablesDefinition).default(listTablesDefault());
|
|
119
|
+
this.#listColumns = newQuery(ListColumnsDefinition).default(listColumnsDefault());
|
|
120
|
+
this.#connection = newConnectionWithOperations(this, { provider: ProviderID, name: connectionName });
|
|
121
|
+
}
|
|
122
|
+
connection() {
|
|
123
|
+
return this.#connection;
|
|
124
|
+
}
|
|
125
|
+
listDatabases() {
|
|
126
|
+
return this.#listDatabases;
|
|
127
|
+
}
|
|
128
|
+
listTables() {
|
|
129
|
+
return this.#listTables;
|
|
130
|
+
}
|
|
131
|
+
listColumns() {
|
|
132
|
+
return this.#listColumns;
|
|
133
|
+
}
|
|
134
|
+
assertNoFailures() {
|
|
135
|
+
this.#listDatabases.assertNoFailures();
|
|
136
|
+
this.#listTables.assertNoFailures();
|
|
137
|
+
this.#listColumns.assertNoFailures();
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
export {
|
|
141
|
+
GeneratedMock,
|
|
142
|
+
GeneratedMock as Mock,
|
|
143
|
+
emptyColumn,
|
|
144
|
+
emptyColumnsPage,
|
|
145
|
+
emptyDatabasesPage,
|
|
146
|
+
emptyListColumnsInput,
|
|
147
|
+
emptyListDatabasesInput,
|
|
148
|
+
emptyListTablesInput,
|
|
149
|
+
emptyTablesPage,
|
|
150
|
+
listColumnsDefault,
|
|
151
|
+
listColumnsDefect,
|
|
152
|
+
listColumnsInvalidResponse,
|
|
153
|
+
listColumnsListed,
|
|
154
|
+
listColumnsListedDefault,
|
|
155
|
+
listColumnsProviderRejected,
|
|
156
|
+
listColumnsRetry,
|
|
157
|
+
listDatabasesDefault,
|
|
158
|
+
listDatabasesDefect,
|
|
159
|
+
listDatabasesInvalidResponse,
|
|
160
|
+
listDatabasesListed,
|
|
161
|
+
listDatabasesListedDefault,
|
|
162
|
+
listDatabasesProviderRejected,
|
|
163
|
+
listDatabasesRetry,
|
|
164
|
+
listTablesDefault,
|
|
165
|
+
listTablesDefect,
|
|
166
|
+
listTablesInvalidResponse,
|
|
167
|
+
listTablesListed,
|
|
168
|
+
listTablesListedDefault,
|
|
169
|
+
listTablesProviderRejected,
|
|
170
|
+
listTablesRetry
|
|
171
|
+
};
|
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.2.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
|
+
}
|