@malloy-publisher/server 0.0.382-dev → 0.2.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/README.docker.md +145 -20
- package/README.md +65 -12
- package/dist/app/api-doc.html +5 -0
- package/dist/app/api-doc.yaml +3929 -534
- package/dist/app/assets/EnvironmentPage-CHq5BF4l.js +1 -0
- package/dist/app/assets/HomePage-CIp-pJCa.js +1 -0
- package/dist/app/assets/LightMode-mHHPjEeA.js +1 -0
- package/dist/app/assets/MainPage-CylxO5Yu.js +2 -0
- package/dist/app/assets/MaterializationsPage-a0vjqxib.js +1 -0
- package/dist/app/assets/ModelPage-Cz-MrSZQ.js +1 -0
- package/dist/app/assets/PackagePage-Cdg5D7AN.js +1 -0
- package/dist/app/assets/RouteError-B5SIyn6G.js +1 -0
- package/dist/app/assets/ThemeEditorPage-B62rRc-y.js +1 -0
- package/dist/app/assets/WorkbookPage-45cG1Gx6.js +1 -0
- package/dist/app/assets/{core-CjeTkq8O.es-BqRc6yhC.js → core-DyU47reh.es-DY9b3WjS.js} +1 -1
- package/dist/app/assets/github-dark-DenFmJkN.es-DHJKELXO.js +1 -0
- package/dist/app/assets/index-5eLCcNmP.css +1 -0
- package/dist/app/assets/index-C5ClsnS7.js +1774 -0
- package/dist/app/assets/index-DF9tVqwN.js +1 -0
- package/dist/app/assets/index-DSoCUF-f.js +2725 -0
- package/dist/app/assets/index-DgVRz2wm.js +2 -0
- package/dist/app/assets/index-P-pF8nU5.js +632 -0
- package/dist/app/assets/index-w_0OQJgZ.js +23 -0
- package/dist/app/index.html +8 -4
- package/dist/cpufeatures-1yrn0vtw.node +0 -0
- package/dist/default-publisher.config.json +23 -0
- package/dist/{instrumentation.js → instrumentation.mjs} +10631 -10573
- package/dist/package_load_worker.mjs +15219 -0
- package/dist/runtime/publisher.js +331 -0
- package/dist/{server.js → server.mjs} +141276 -74705
- package/dist/sshcrypto-vd2k5hq9.node +0 -0
- package/package.json +41 -28
- package/publisher.config.example.bigquery.json +33 -0
- package/publisher.config.example.duckdb.json +23 -0
- package/.eslintrc.json +0 -44
- package/.prettierignore +0 -1
- package/.prettierrc +0 -4
- package/build.ts +0 -38
- package/dist/app/assets/HomePage-Dn3E4CuB.js +0 -1
- package/dist/app/assets/MainPage-BzB3yoqi.js +0 -2
- package/dist/app/assets/ModelPage-C9O_sAXT.js +0 -1
- package/dist/app/assets/PackagePage-DcxKEjBX.js +0 -1
- package/dist/app/assets/ProjectPage-BDj307rF.js +0 -1
- package/dist/app/assets/RouteError-DAShbVCG.js +0 -1
- package/dist/app/assets/WorkbookPage-Cs_XYEaB.js +0 -1
- package/dist/app/assets/index-15BOvhp0.js +0 -456
- package/dist/app/assets/index-Bb2jqquW.js +0 -676
- package/dist/app/assets/index-CMlGQMcl.css +0 -1
- package/dist/app/assets/index-D68X76-7.js +0 -1276
- package/dist/app/assets/index.umd-DGBekgSu.js +0 -1145
- package/dxt/malloy_bridge.py +0 -354
- package/dxt/manifest.json +0 -22
- package/eslint.config.mjs +0 -76
- package/k6-tests/README.md +0 -144
- package/k6-tests/bun.lock +0 -797
- package/k6-tests/load-test/load-test-crud-connections.ts +0 -263
- package/k6-tests/load-test/load-test-crud-packages.ts +0 -461
- package/k6-tests/load-test/load-test-crud-projects.ts +0 -160
- package/k6-tests/load-test/load-test-crud.ts +0 -142
- package/k6-tests/load-test/load-test.ts +0 -784
- package/k6-tests/package.json +0 -27
- package/k6-tests/scripts/run-with-otel.sh +0 -50
- package/k6-tests/smoke-test/smoke-test.ts +0 -158
- package/k6-tests/tsconfig.json +0 -29
- package/k6-tests/utils/client_factory.ts +0 -128
- package/k6-tests/utils/common.ts +0 -489
- package/k6-tests/utils/logger.ts +0 -62
- package/k6-tests/utils/types.d.ts +0 -35
- package/malloy_mcp.dxt +0 -0
- package/publisher.config.json +0 -33
- package/src/config.spec.ts +0 -850
- package/src/config.ts +0 -305
- package/src/constants.ts +0 -10
- package/src/controller/compile.controller.ts +0 -35
- package/src/controller/connection.controller.ts +0 -515
- package/src/controller/database.controller.ts +0 -21
- package/src/controller/manifest.controller.ts +0 -29
- package/src/controller/materialization.controller.ts +0 -125
- package/src/controller/model.controller.ts +0 -107
- package/src/controller/package.controller.ts +0 -182
- package/src/controller/query.controller.ts +0 -60
- package/src/controller/watch-mode.controller.ts +0 -98
- package/src/data_styles.ts +0 -71
- package/src/dto/connection.dto.spec.ts +0 -131
- package/src/dto/connection.dto.ts +0 -174
- package/src/dto/index.ts +0 -2
- package/src/dto/package.dto.spec.ts +0 -42
- package/src/dto/package.dto.ts +0 -12
- package/src/dto/validate.spec.ts +0 -76
- package/src/dto/validate.ts +0 -31
- package/src/errors.ts +0 -116
- package/src/health.ts +0 -189
- package/src/instrumentation.ts +0 -148
- package/src/logger.ts +0 -154
- package/src/mcp/error_messages.ts +0 -199
- package/src/mcp/handler_utils.ts +0 -239
- package/src/mcp/mcp_constants.ts +0 -22
- package/src/mcp/prompts/handlers.ts +0 -84
- package/src/mcp/prompts/index.ts +0 -11
- package/src/mcp/prompts/prompt_definitions.ts +0 -160
- package/src/mcp/prompts/prompt_service.ts +0 -67
- package/src/mcp/prompts/utils.ts +0 -62
- package/src/mcp/resource_metadata.ts +0 -47
- package/src/mcp/resources/model_resource.ts +0 -153
- package/src/mcp/resources/notebook_resource.ts +0 -137
- package/src/mcp/resources/package_resource.ts +0 -370
- package/src/mcp/resources/project_resource.ts +0 -184
- package/src/mcp/resources/query_resource.ts +0 -117
- package/src/mcp/resources/source_resource.ts +0 -141
- package/src/mcp/resources/view_resource.ts +0 -136
- package/src/mcp/server.ts +0 -62
- package/src/mcp/tools/discovery_tools.ts +0 -258
- package/src/mcp/tools/execute_query_tool.ts +0 -265
- package/src/server.ts +0 -1195
- package/src/service/connection.spec.ts +0 -1331
- package/src/service/connection.ts +0 -1511
- package/src/service/connection_service.spec.ts +0 -641
- package/src/service/connection_service.ts +0 -181
- package/src/service/db_utils.spec.ts +0 -714
- package/src/service/db_utils.ts +0 -1227
- package/src/service/filter.spec.ts +0 -447
- package/src/service/filter.ts +0 -337
- package/src/service/filter_integration.spec.ts +0 -825
- package/src/service/gcs_s3_utils.ts +0 -427
- package/src/service/manifest_service.spec.ts +0 -201
- package/src/service/manifest_service.ts +0 -106
- package/src/service/materialization_service.spec.ts +0 -648
- package/src/service/materialization_service.ts +0 -929
- package/src/service/materialized_table_gc.spec.ts +0 -383
- package/src/service/materialized_table_gc.ts +0 -279
- package/src/service/model.spec.ts +0 -257
- package/src/service/model.ts +0 -1069
- package/src/service/package.spec.ts +0 -236
- package/src/service/package.ts +0 -463
- package/src/service/project.ts +0 -681
- package/src/service/project_compile.spec.ts +0 -197
- package/src/service/project_store.spec.ts +0 -859
- package/src/service/project_store.ts +0 -1531
- package/src/service/quoting.ts +0 -41
- package/src/service/resolve_project.ts +0 -13
- package/src/storage/BaseRepository.ts +0 -31
- package/src/storage/DatabaseInterface.ts +0 -180
- package/src/storage/StorageManager.mock.ts +0 -59
- package/src/storage/StorageManager.ts +0 -210
- package/src/storage/duckdb/ConnectionRepository.ts +0 -141
- package/src/storage/duckdb/DuckDBConnection.ts +0 -177
- package/src/storage/duckdb/DuckDBManifestStore.ts +0 -70
- package/src/storage/duckdb/DuckDBRepository.ts +0 -224
- package/src/storage/duckdb/ManifestRepository.ts +0 -119
- package/src/storage/duckdb/MaterializationRepository.ts +0 -249
- package/src/storage/duckdb/PackageRepository.ts +0 -135
- package/src/storage/duckdb/ProjectRepository.ts +0 -148
- package/src/storage/duckdb/manifest_store.spec.ts +0 -133
- package/src/storage/duckdb/schema.ts +0 -147
- package/src/storage/ducklake/DuckLakeManifestStore.ts +0 -146
- package/src/utils.ts +0 -13
- package/tests/fixtures/persist-test/data/orders.csv +0 -5
- package/tests/fixtures/persist-test/persist_test.malloy +0 -11
- package/tests/fixtures/persist-test/publisher.json +0 -5
- package/tests/fixtures/publisher.config.json +0 -15
- package/tests/harness/e2e.ts +0 -96
- package/tests/harness/mcp_test_setup.ts +0 -344
- package/tests/harness/mocks.ts +0 -37
- package/tests/harness/rest_e2e.ts +0 -68
- package/tests/harness/uris.ts +0 -31
- package/tests/integration/materialization/materialization_lifecycle.integration.spec.ts +0 -470
- package/tests/integration/mcp/mcp_execute_query_tool.integration.spec.ts +0 -434
- package/tests/integration/mcp/mcp_resource.integration.spec.ts +0 -663
- package/tests/integration/mcp/mcp_transport.integration.spec.ts +0 -122
- package/tests/integration/mcp/setup.spec.ts +0 -5
- package/tests/unit/duckdb/attached_databases.test.ts +0 -1132
- package/tests/unit/ducklake/ducklake.test.ts +0 -950
- package/tests/unit/mcp/prompt_definitions.test.ts +0 -102
- package/tests/unit/mcp/prompt_happy.test.ts +0 -51
- package/tsconfig.json +0 -32
package/k6-tests/package.json
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "k6-tests",
|
|
3
|
-
"devDependencies": {
|
|
4
|
-
"@types/bun": "latest",
|
|
5
|
-
"@types/k6": "^1.5.0",
|
|
6
|
-
"typescript": "^5.9.3"
|
|
7
|
-
},
|
|
8
|
-
"peerDependencies": {
|
|
9
|
-
"typescript": "^5"
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"@grafana/openapi-to-k6": "^0.3.2",
|
|
13
|
-
"k6": "^0.0.0"
|
|
14
|
-
},
|
|
15
|
-
"scripts": {
|
|
16
|
-
"build": "bun run clean && bun run clone-malloy-samples && bun run generate-clients",
|
|
17
|
-
"clone-malloy-samples": "bunx git clone https://github.com/credibledata/malloy-samples.git ./packages",
|
|
18
|
-
"smoke-test": "k6 run smoke-test/smoke-test.ts",
|
|
19
|
-
"load-test-crud": "bun run load-test-crud-projects && bun run load-test-crud-connections && bun run load-test-crud-packages",
|
|
20
|
-
"load-test": "k6 run load-test/load-test.ts",
|
|
21
|
-
"load-test-crud-connections": "k6 run load-test/load-test-crud-connections.ts",
|
|
22
|
-
"load-test-crud-projects": "k6 run load-test/load-test-crud-projects.ts",
|
|
23
|
-
"load-test-crud-packages": "k6 run load-test/load-test-crud-packages.ts",
|
|
24
|
-
"generate-clients": "openapi-to-k6 ../../../api-doc.yaml ./clients --mode tags --disable-analytics --verbose",
|
|
25
|
-
"clean": "rm -rf ./clients && rm -rf ./packages && rm -rf ./results"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
|
|
3
|
-
# Helper script to run k6 tests with OpenTelemetry output to Prometheus
|
|
4
|
-
# Usage: ./run-with-otel.sh <test-file> [additional-k6-args...]
|
|
5
|
-
|
|
6
|
-
set -e
|
|
7
|
-
|
|
8
|
-
# Default OTEL collector endpoint (gRPC)
|
|
9
|
-
# Use 'localhost:4317' when running from host machine
|
|
10
|
-
# Use 'otel-collector:4317' when running from inside Docker (like prober service)
|
|
11
|
-
OTEL_ENDPOINT="${K6_OTEL_GRPC_EXPORTER_ENDPOINT:-localhost:4317}"
|
|
12
|
-
OTEL_SERVICE_NAME="${K6_OTEL_SERVICE_NAME:-k6-load-test}"
|
|
13
|
-
OTEL_EXPORTER_PROTOCOL="${K6_OTEL_EXPORTER_PROTOCOL:-grpc}"
|
|
14
|
-
|
|
15
|
-
# Get the test file (first argument)
|
|
16
|
-
TEST_FILE="${1}"
|
|
17
|
-
if [ -z "$TEST_FILE" ]; then
|
|
18
|
-
echo "Usage: $0 <test-file> [additional-k6-args...]"
|
|
19
|
-
echo "Example: $0 smoke-test/smoke-test.ts"
|
|
20
|
-
echo "Example: $0 load-test/load-test-crud.ts --duration 5m"
|
|
21
|
-
exit 1
|
|
22
|
-
fi
|
|
23
|
-
|
|
24
|
-
# Shift to get remaining arguments
|
|
25
|
-
shift
|
|
26
|
-
|
|
27
|
-
echo "=========================================="
|
|
28
|
-
echo "Running k6 test with OpenTelemetry export"
|
|
29
|
-
echo "=========================================="
|
|
30
|
-
echo "Test file: $TEST_FILE"
|
|
31
|
-
echo "OTEL endpoint: $OTEL_ENDPOINT"
|
|
32
|
-
echo "OTEL service name: $OTEL_SERVICE_NAME"
|
|
33
|
-
echo "OTEL exporter protocol: $OTEL_EXPORTER_PROTOCOL"
|
|
34
|
-
echo "=========================================="
|
|
35
|
-
echo ""
|
|
36
|
-
|
|
37
|
-
# Export k6 metrics to OpenTelemetry
|
|
38
|
-
export K6_OTEL_SERVICE_NAME="$OTEL_SERVICE_NAME"
|
|
39
|
-
export K6_OTEL_EXPORTER_PROTOCOL="$OTEL_EXPORTER_PROTOCOL"
|
|
40
|
-
export K6_OTEL_GRPC_EXPORTER_ENDPOINT="$OTEL_ENDPOINT"
|
|
41
|
-
export K6_OTEL_GRPC_EXPORTER_INSECURE="true" # Disable TLS for plain gRPC
|
|
42
|
-
export K6_OTEL_FLUSH_INTERVAL="1s"
|
|
43
|
-
export K6_OTEL_EXPORT_INTERVAL="2s"
|
|
44
|
-
export K6_OTEL_METRIC_PREFIX="k6_"
|
|
45
|
-
# Run k6 with OTEL output
|
|
46
|
-
# Note: k6 v1.4.0+ uses "opentelemetry" (stable), "experimental-opentelemetry" is for backward compatibility
|
|
47
|
-
k6 run \
|
|
48
|
-
--out "opentelemetry" \
|
|
49
|
-
"$TEST_FILE" \
|
|
50
|
-
"$@"
|
|
@@ -1,158 +0,0 @@
|
|
|
1
|
-
import { check, sleep } from "k6";
|
|
2
|
-
import {
|
|
3
|
-
getAvailablePackages,
|
|
4
|
-
getModelData,
|
|
5
|
-
getModels,
|
|
6
|
-
getPackages,
|
|
7
|
-
getViews,
|
|
8
|
-
queryModelView,
|
|
9
|
-
validateServerIsUpAndInitialized,
|
|
10
|
-
} from "../utils/common.ts";
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Setup function - runs once before all VUs
|
|
14
|
-
* Validates server is up and initialized before running tests
|
|
15
|
-
*/
|
|
16
|
-
export function setup() {
|
|
17
|
-
validateServerIsUpAndInitialized();
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Smoke Test - Basic functionality verification
|
|
22
|
-
*
|
|
23
|
-
* This test verifies that the system's core functionality works correctly
|
|
24
|
-
* under minimal load. It's typically the first test run to ensure basic
|
|
25
|
-
* connectivity and functionality before running more intensive tests.
|
|
26
|
-
*
|
|
27
|
-
* Default configuration:
|
|
28
|
-
* - 5 virtual user
|
|
29
|
-
* - 1 minute duration
|
|
30
|
-
* - 90th percentile response time < 0.8s
|
|
31
|
-
* - 95th percentile response time < 1s
|
|
32
|
-
* - 99th percentile response time < 1.5s
|
|
33
|
-
* - Error rate < 1%
|
|
34
|
-
* - Dropped iterations should be 0
|
|
35
|
-
*/
|
|
36
|
-
export const smokeTest: TestPreset = {
|
|
37
|
-
defaultOptions: {
|
|
38
|
-
vus: 5,
|
|
39
|
-
duration: "1m",
|
|
40
|
-
thresholds: {
|
|
41
|
-
http_req_duration: ["p(90)<800", "p(95)<1000", "p(99)<1500"],
|
|
42
|
-
http_req_failed: ["rate<0.01"],
|
|
43
|
-
http_req_waiting: ["p(95)<1200"],
|
|
44
|
-
checks: ["rate>0.99"],
|
|
45
|
-
dropped_iterations: ["count==0"],
|
|
46
|
-
// Per-operation thresholds
|
|
47
|
-
"http_req_duration{name:list_packages}": [
|
|
48
|
-
"p(90)<800",
|
|
49
|
-
"p(95)<1000",
|
|
50
|
-
"p(99)<1500",
|
|
51
|
-
],
|
|
52
|
-
"http_req_duration{name:list_models}": [
|
|
53
|
-
"p(90)<800",
|
|
54
|
-
"p(95)<1000",
|
|
55
|
-
"p(99)<1500",
|
|
56
|
-
],
|
|
57
|
-
"http_req_duration{name:get_model}": [
|
|
58
|
-
"p(90)<800",
|
|
59
|
-
"p(95)<1000",
|
|
60
|
-
"p(99)<1500",
|
|
61
|
-
],
|
|
62
|
-
"http_req_duration{name:execute_query}": [
|
|
63
|
-
"p(90)<800",
|
|
64
|
-
"p(95)<1000",
|
|
65
|
-
"p(99)<1500",
|
|
66
|
-
],
|
|
67
|
-
},
|
|
68
|
-
},
|
|
69
|
-
run: () => {
|
|
70
|
-
// Test 1: GET /projects/{projectName}/packages - List packages endpoint
|
|
71
|
-
const packages = getPackages();
|
|
72
|
-
if (packages.length === 0) {
|
|
73
|
-
throw new Error(
|
|
74
|
-
"No packages found! Check PUBLISHER_URL and PROJECT_NAME environment variables.",
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
const availablePackages = getAvailablePackages();
|
|
79
|
-
const MAX_VIEWS_PER_MODEL = parseInt(__ENV.K6_MAX_VIEWS_PER_MODEL || "5");
|
|
80
|
-
const DEBUG = __ENV.K6_DEBUG === "true";
|
|
81
|
-
|
|
82
|
-
let packagesTested = 0;
|
|
83
|
-
let modelsTested = 0;
|
|
84
|
-
let queriesTested = 0;
|
|
85
|
-
|
|
86
|
-
for (const pkg of packages) {
|
|
87
|
-
if (!availablePackages.includes(pkg.name)) {
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if (DEBUG) {
|
|
92
|
-
console.log(`Package: ${JSON.stringify(pkg)}`);
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
packagesTested++;
|
|
96
|
-
|
|
97
|
-
// Test 2: GET /projects/{projectName}/packages/{packageName}/models - List models endpoint
|
|
98
|
-
const models = getModels(pkg.name, pkg.versionId);
|
|
99
|
-
if (models.length === 0) {
|
|
100
|
-
continue;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// Test a sample of models (first model per package) to keep test fast
|
|
104
|
-
const modelToTest = models[0];
|
|
105
|
-
if (!modelToTest) {
|
|
106
|
-
continue;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
modelsTested++;
|
|
110
|
-
|
|
111
|
-
// Test 3: GET /projects/{projectName}/packages/{packageName}/models/{modelPath} - Get model endpoint
|
|
112
|
-
const modelData = getModelData(
|
|
113
|
-
pkg.name,
|
|
114
|
-
modelToTest.path,
|
|
115
|
-
pkg.versionId,
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
// Test 4: POST /projects/{projectName}/packages/{packageName}/models/{modelPath}/query - Query endpoint
|
|
119
|
-
const views = Array.from(getViews(modelData));
|
|
120
|
-
if (views.length === 0) {
|
|
121
|
-
continue;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// Test first N views per model (configurable via MAX_VIEWS_PER_MODEL env var)
|
|
125
|
-
const viewsToTest = views.slice(0, MAX_VIEWS_PER_MODEL);
|
|
126
|
-
for (const view of viewsToTest) {
|
|
127
|
-
queriesTested++;
|
|
128
|
-
const queryResponse = queryModelView(
|
|
129
|
-
pkg.name,
|
|
130
|
-
modelToTest.path,
|
|
131
|
-
view.sourceName,
|
|
132
|
-
view.viewName,
|
|
133
|
-
pkg.versionId,
|
|
134
|
-
);
|
|
135
|
-
|
|
136
|
-
if (DEBUG) {
|
|
137
|
-
console.log(
|
|
138
|
-
`Query response status: ${queryResponse.status} for ${pkg.name}/${modelToTest.path}/${view.sourceName}/${view.viewName}`,
|
|
139
|
-
);
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
check(queryResponse, {
|
|
143
|
-
"execute query request successful": (r) => r.status === 200,
|
|
144
|
-
});
|
|
145
|
-
sleep(1);
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
if (DEBUG) {
|
|
150
|
-
console.log(
|
|
151
|
-
`Smoke test summary: ${packagesTested} packages, ${modelsTested} models, ${queriesTested} queries tested`,
|
|
152
|
-
);
|
|
153
|
-
}
|
|
154
|
-
},
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
export const options = smokeTest.defaultOptions;
|
|
158
|
-
export default smokeTest.run;
|
package/k6-tests/tsconfig.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
// Environment setup & latest features
|
|
4
|
-
"lib": ["ESNext"],
|
|
5
|
-
"target": "ESNext",
|
|
6
|
-
"module": "Preserve",
|
|
7
|
-
"moduleDetection": "force",
|
|
8
|
-
"jsx": "react-jsx",
|
|
9
|
-
"allowJs": true,
|
|
10
|
-
|
|
11
|
-
// Bundler mode
|
|
12
|
-
"moduleResolution": "bundler",
|
|
13
|
-
"allowImportingTsExtensions": true,
|
|
14
|
-
"verbatimModuleSyntax": true,
|
|
15
|
-
"noEmit": true,
|
|
16
|
-
|
|
17
|
-
// Best practices
|
|
18
|
-
"strict": true,
|
|
19
|
-
"skipLibCheck": true,
|
|
20
|
-
"noFallthroughCasesInSwitch": true,
|
|
21
|
-
"noUncheckedIndexedAccess": true,
|
|
22
|
-
"noImplicitOverride": true,
|
|
23
|
-
|
|
24
|
-
// Some stricter flags (disabled by default)
|
|
25
|
-
"noUnusedLocals": false,
|
|
26
|
-
"noUnusedParameters": false,
|
|
27
|
-
"noPropertyAccessFromIndexSignature": false
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
import type { Params } from "k6/http";
|
|
2
|
-
import { ConnectionsTestClient } from "../clients/connections-test.ts";
|
|
3
|
-
import { ConnectionsClient } from "../clients/connections.ts";
|
|
4
|
-
import { DatabasesClient } from "../clients/databases.ts";
|
|
5
|
-
import { ModelsClient } from "../clients/models.ts";
|
|
6
|
-
import { NotebooksClient } from "../clients/notebooks.ts";
|
|
7
|
-
import { PackagesClient } from "../clients/packages.ts";
|
|
8
|
-
import { ProjectsClient } from "../clients/projects.ts";
|
|
9
|
-
import { PublisherClient } from "../clients/publisher.ts";
|
|
10
|
-
import { WatchModeClient } from "../clients/watch-mode.ts";
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Creates client options with base URL and authorization header
|
|
14
|
-
*/
|
|
15
|
-
function createClientOptions(
|
|
16
|
-
baseUrl: string,
|
|
17
|
-
authToken?: string,
|
|
18
|
-
): {
|
|
19
|
-
baseUrl: string;
|
|
20
|
-
commonRequestParameters?: Params;
|
|
21
|
-
} {
|
|
22
|
-
const options: {
|
|
23
|
-
baseUrl: string;
|
|
24
|
-
commonRequestParameters?: Params;
|
|
25
|
-
} = {
|
|
26
|
-
baseUrl,
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
if (authToken) {
|
|
30
|
-
options.commonRequestParameters = {
|
|
31
|
-
headers: {
|
|
32
|
-
Authorization: authToken,
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return options;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* Get PackagesClient instance
|
|
42
|
-
*/
|
|
43
|
-
export function getPackagesClient(
|
|
44
|
-
baseUrl: string,
|
|
45
|
-
authToken?: string,
|
|
46
|
-
): PackagesClient {
|
|
47
|
-
return new PackagesClient(createClientOptions(baseUrl, authToken));
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Get ModelsClient instance
|
|
52
|
-
*/
|
|
53
|
-
export function getModelsClient(
|
|
54
|
-
baseUrl: string,
|
|
55
|
-
authToken?: string,
|
|
56
|
-
): ModelsClient {
|
|
57
|
-
return new ModelsClient(createClientOptions(baseUrl, authToken));
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Get NotebooksClient instance
|
|
62
|
-
*/
|
|
63
|
-
export function getNotebooksClient(
|
|
64
|
-
baseUrl: string,
|
|
65
|
-
authToken?: string,
|
|
66
|
-
): NotebooksClient {
|
|
67
|
-
return new NotebooksClient(createClientOptions(baseUrl, authToken));
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Get DatabasesClient instance
|
|
72
|
-
*/
|
|
73
|
-
export function getDatabasesClient(
|
|
74
|
-
baseUrl: string,
|
|
75
|
-
authToken?: string,
|
|
76
|
-
): DatabasesClient {
|
|
77
|
-
return new DatabasesClient(createClientOptions(baseUrl, authToken));
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Get ConnectionsClient instance
|
|
82
|
-
*/
|
|
83
|
-
export function getConnectionsClient(
|
|
84
|
-
baseUrl: string,
|
|
85
|
-
authToken?: string,
|
|
86
|
-
): ConnectionsClient {
|
|
87
|
-
return new ConnectionsClient(createClientOptions(baseUrl, authToken));
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Get ConnectionsTestClient instance
|
|
92
|
-
*/
|
|
93
|
-
export function getConnectionsTestClient(
|
|
94
|
-
baseUrl: string,
|
|
95
|
-
authToken?: string,
|
|
96
|
-
): ConnectionsTestClient {
|
|
97
|
-
return new ConnectionsTestClient(createClientOptions(baseUrl, authToken));
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Get ProjectsClient instance
|
|
102
|
-
*/
|
|
103
|
-
export function getProjectsClient(
|
|
104
|
-
baseUrl: string,
|
|
105
|
-
authToken?: string,
|
|
106
|
-
): ProjectsClient {
|
|
107
|
-
return new ProjectsClient(createClientOptions(baseUrl, authToken));
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
/**
|
|
111
|
-
* Get PublisherClient instance
|
|
112
|
-
*/
|
|
113
|
-
export function getPublisherClient(
|
|
114
|
-
baseUrl: string,
|
|
115
|
-
authToken?: string,
|
|
116
|
-
): PublisherClient {
|
|
117
|
-
return new PublisherClient(createClientOptions(baseUrl, authToken));
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Get WatchModeClient instance
|
|
122
|
-
*/
|
|
123
|
-
export function getWatchModeClient(
|
|
124
|
-
baseUrl: string,
|
|
125
|
-
authToken?: string,
|
|
126
|
-
): WatchModeClient {
|
|
127
|
-
return new WatchModeClient(createClientOptions(baseUrl, authToken));
|
|
128
|
-
}
|