@malloy-publisher/server 0.0.382-dev → 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.
Files changed (175) hide show
  1. package/README.docker.md +145 -20
  2. package/README.md +65 -12
  3. package/dist/app/api-doc.html +5 -0
  4. package/dist/app/api-doc.yaml +3903 -583
  5. package/dist/app/assets/EnvironmentPage-DiUgLuCH.js +1 -0
  6. package/dist/app/assets/HomePage-MhhjhnFj.js +1 -0
  7. package/dist/app/assets/LightMode-BEyvNUzT.js +1 -0
  8. package/dist/app/assets/MainPage-D4Cfee9o.js +2 -0
  9. package/dist/app/assets/MaterializationsPage-nGgGqwSN.js +1 -0
  10. package/dist/app/assets/ModelPage-DLAcEw-F.js +1 -0
  11. package/dist/app/assets/PackagePage-Df0ikH7w.js +1 -0
  12. package/dist/app/assets/RouteError-BFQwtroH.js +1 -0
  13. package/dist/app/assets/ThemeEditorPage-OoskoQYN.js +1 -0
  14. package/dist/app/assets/WorkbookPage-CpFgvUDC.js +1 -0
  15. package/dist/app/assets/{core-CjeTkq8O.es-BqRc6yhC.js → core-lb28vQkR.es-BoVSOc75.js} +1 -1
  16. package/dist/app/assets/github-dark-DenFmJkN.es-DHJKELXO.js +1 -0
  17. package/dist/app/assets/index-5eLCcNmP.css +1 -0
  18. package/dist/app/assets/index-6ypuFH6g.js +1774 -0
  19. package/dist/app/assets/index-B8pnU_V_.js +615 -0
  20. package/dist/app/assets/index-BImcHmVP.js +1 -0
  21. package/dist/app/assets/index-DSoCUF-f.js +2725 -0
  22. package/dist/app/assets/index-DfqzSItA.js +2 -0
  23. package/dist/app/assets/index-w_0OQJgZ.js +23 -0
  24. package/dist/app/index.html +8 -4
  25. package/dist/cpufeatures-1yrn0vtw.node +0 -0
  26. package/dist/default-publisher.config.json +23 -0
  27. package/dist/{instrumentation.js → instrumentation.mjs} +10631 -10573
  28. package/dist/package_load_worker.mjs +15219 -0
  29. package/dist/runtime/publisher.js +331 -0
  30. package/dist/{server.js → server.mjs} +115548 -49590
  31. package/dist/sshcrypto-vd2k5hq9.node +0 -0
  32. package/package.json +41 -28
  33. package/publisher.config.example.bigquery.json +33 -0
  34. package/publisher.config.example.duckdb.json +23 -0
  35. package/.eslintrc.json +0 -44
  36. package/.prettierignore +0 -1
  37. package/.prettierrc +0 -4
  38. package/build.ts +0 -38
  39. package/dist/app/assets/HomePage-Dn3E4CuB.js +0 -1
  40. package/dist/app/assets/MainPage-BzB3yoqi.js +0 -2
  41. package/dist/app/assets/ModelPage-C9O_sAXT.js +0 -1
  42. package/dist/app/assets/PackagePage-DcxKEjBX.js +0 -1
  43. package/dist/app/assets/ProjectPage-BDj307rF.js +0 -1
  44. package/dist/app/assets/RouteError-DAShbVCG.js +0 -1
  45. package/dist/app/assets/WorkbookPage-Cs_XYEaB.js +0 -1
  46. package/dist/app/assets/index-15BOvhp0.js +0 -456
  47. package/dist/app/assets/index-Bb2jqquW.js +0 -676
  48. package/dist/app/assets/index-CMlGQMcl.css +0 -1
  49. package/dist/app/assets/index-D68X76-7.js +0 -1276
  50. package/dist/app/assets/index.umd-DGBekgSu.js +0 -1145
  51. package/dxt/malloy_bridge.py +0 -354
  52. package/dxt/manifest.json +0 -22
  53. package/eslint.config.mjs +0 -76
  54. package/k6-tests/README.md +0 -144
  55. package/k6-tests/bun.lock +0 -797
  56. package/k6-tests/load-test/load-test-crud-connections.ts +0 -263
  57. package/k6-tests/load-test/load-test-crud-packages.ts +0 -461
  58. package/k6-tests/load-test/load-test-crud-projects.ts +0 -160
  59. package/k6-tests/load-test/load-test-crud.ts +0 -142
  60. package/k6-tests/load-test/load-test.ts +0 -784
  61. package/k6-tests/package.json +0 -27
  62. package/k6-tests/scripts/run-with-otel.sh +0 -50
  63. package/k6-tests/smoke-test/smoke-test.ts +0 -158
  64. package/k6-tests/tsconfig.json +0 -29
  65. package/k6-tests/utils/client_factory.ts +0 -128
  66. package/k6-tests/utils/common.ts +0 -489
  67. package/k6-tests/utils/logger.ts +0 -62
  68. package/k6-tests/utils/types.d.ts +0 -35
  69. package/malloy_mcp.dxt +0 -0
  70. package/publisher.config.json +0 -33
  71. package/src/config.spec.ts +0 -850
  72. package/src/config.ts +0 -305
  73. package/src/constants.ts +0 -10
  74. package/src/controller/compile.controller.ts +0 -35
  75. package/src/controller/connection.controller.ts +0 -515
  76. package/src/controller/database.controller.ts +0 -21
  77. package/src/controller/manifest.controller.ts +0 -29
  78. package/src/controller/materialization.controller.ts +0 -125
  79. package/src/controller/model.controller.ts +0 -107
  80. package/src/controller/package.controller.ts +0 -182
  81. package/src/controller/query.controller.ts +0 -60
  82. package/src/controller/watch-mode.controller.ts +0 -98
  83. package/src/data_styles.ts +0 -71
  84. package/src/dto/connection.dto.spec.ts +0 -131
  85. package/src/dto/connection.dto.ts +0 -174
  86. package/src/dto/index.ts +0 -2
  87. package/src/dto/package.dto.spec.ts +0 -42
  88. package/src/dto/package.dto.ts +0 -12
  89. package/src/dto/validate.spec.ts +0 -76
  90. package/src/dto/validate.ts +0 -31
  91. package/src/errors.ts +0 -116
  92. package/src/health.ts +0 -189
  93. package/src/instrumentation.ts +0 -148
  94. package/src/logger.ts +0 -154
  95. package/src/mcp/error_messages.ts +0 -199
  96. package/src/mcp/handler_utils.ts +0 -239
  97. package/src/mcp/mcp_constants.ts +0 -22
  98. package/src/mcp/prompts/handlers.ts +0 -84
  99. package/src/mcp/prompts/index.ts +0 -11
  100. package/src/mcp/prompts/prompt_definitions.ts +0 -160
  101. package/src/mcp/prompts/prompt_service.ts +0 -67
  102. package/src/mcp/prompts/utils.ts +0 -62
  103. package/src/mcp/resource_metadata.ts +0 -47
  104. package/src/mcp/resources/model_resource.ts +0 -153
  105. package/src/mcp/resources/notebook_resource.ts +0 -137
  106. package/src/mcp/resources/package_resource.ts +0 -370
  107. package/src/mcp/resources/project_resource.ts +0 -184
  108. package/src/mcp/resources/query_resource.ts +0 -117
  109. package/src/mcp/resources/source_resource.ts +0 -141
  110. package/src/mcp/resources/view_resource.ts +0 -136
  111. package/src/mcp/server.ts +0 -62
  112. package/src/mcp/tools/discovery_tools.ts +0 -258
  113. package/src/mcp/tools/execute_query_tool.ts +0 -265
  114. package/src/server.ts +0 -1195
  115. package/src/service/connection.spec.ts +0 -1331
  116. package/src/service/connection.ts +0 -1511
  117. package/src/service/connection_service.spec.ts +0 -641
  118. package/src/service/connection_service.ts +0 -181
  119. package/src/service/db_utils.spec.ts +0 -714
  120. package/src/service/db_utils.ts +0 -1227
  121. package/src/service/filter.spec.ts +0 -447
  122. package/src/service/filter.ts +0 -337
  123. package/src/service/filter_integration.spec.ts +0 -825
  124. package/src/service/gcs_s3_utils.ts +0 -427
  125. package/src/service/manifest_service.spec.ts +0 -201
  126. package/src/service/manifest_service.ts +0 -106
  127. package/src/service/materialization_service.spec.ts +0 -648
  128. package/src/service/materialization_service.ts +0 -929
  129. package/src/service/materialized_table_gc.spec.ts +0 -383
  130. package/src/service/materialized_table_gc.ts +0 -279
  131. package/src/service/model.spec.ts +0 -257
  132. package/src/service/model.ts +0 -1069
  133. package/src/service/package.spec.ts +0 -236
  134. package/src/service/package.ts +0 -463
  135. package/src/service/project.ts +0 -681
  136. package/src/service/project_compile.spec.ts +0 -197
  137. package/src/service/project_store.spec.ts +0 -859
  138. package/src/service/project_store.ts +0 -1531
  139. package/src/service/quoting.ts +0 -41
  140. package/src/service/resolve_project.ts +0 -13
  141. package/src/storage/BaseRepository.ts +0 -31
  142. package/src/storage/DatabaseInterface.ts +0 -180
  143. package/src/storage/StorageManager.mock.ts +0 -59
  144. package/src/storage/StorageManager.ts +0 -210
  145. package/src/storage/duckdb/ConnectionRepository.ts +0 -141
  146. package/src/storage/duckdb/DuckDBConnection.ts +0 -177
  147. package/src/storage/duckdb/DuckDBManifestStore.ts +0 -70
  148. package/src/storage/duckdb/DuckDBRepository.ts +0 -224
  149. package/src/storage/duckdb/ManifestRepository.ts +0 -119
  150. package/src/storage/duckdb/MaterializationRepository.ts +0 -249
  151. package/src/storage/duckdb/PackageRepository.ts +0 -135
  152. package/src/storage/duckdb/ProjectRepository.ts +0 -148
  153. package/src/storage/duckdb/manifest_store.spec.ts +0 -133
  154. package/src/storage/duckdb/schema.ts +0 -147
  155. package/src/storage/ducklake/DuckLakeManifestStore.ts +0 -146
  156. package/src/utils.ts +0 -13
  157. package/tests/fixtures/persist-test/data/orders.csv +0 -5
  158. package/tests/fixtures/persist-test/persist_test.malloy +0 -11
  159. package/tests/fixtures/persist-test/publisher.json +0 -5
  160. package/tests/fixtures/publisher.config.json +0 -15
  161. package/tests/harness/e2e.ts +0 -96
  162. package/tests/harness/mcp_test_setup.ts +0 -344
  163. package/tests/harness/mocks.ts +0 -37
  164. package/tests/harness/rest_e2e.ts +0 -68
  165. package/tests/harness/uris.ts +0 -31
  166. package/tests/integration/materialization/materialization_lifecycle.integration.spec.ts +0 -470
  167. package/tests/integration/mcp/mcp_execute_query_tool.integration.spec.ts +0 -434
  168. package/tests/integration/mcp/mcp_resource.integration.spec.ts +0 -663
  169. package/tests/integration/mcp/mcp_transport.integration.spec.ts +0 -122
  170. package/tests/integration/mcp/setup.spec.ts +0 -5
  171. package/tests/unit/duckdb/attached_databases.test.ts +0 -1132
  172. package/tests/unit/ducklake/ducklake.test.ts +0 -950
  173. package/tests/unit/mcp/prompt_definitions.test.ts +0 -102
  174. package/tests/unit/mcp/prompt_happy.test.ts +0 -51
  175. package/tsconfig.json +0 -32
@@ -1,263 +0,0 @@
1
- import { check, group, sleep } from "k6";
2
- import type { Connection } from "../clients/malloyPublisherSemanticModelServingAPI.schemas.ts";
3
- import { ConnectionType as ConnectionTypeEnum } from "../clients/malloyPublisherSemanticModelServingAPI.schemas.ts";
4
- import {
5
- getConnectionsClient,
6
- getProjectsClient,
7
- } from "../utils/client_factory.ts";
8
- import {
9
- AUTH_TOKEN,
10
- BASE_URL,
11
- generateTestName,
12
- validateServerIsUpAndInitialized,
13
- } from "../utils/common.ts";
14
-
15
- const projectsClient = getProjectsClient(BASE_URL, AUTH_TOKEN);
16
- const connectionsClient = getConnectionsClient(BASE_URL, AUTH_TOKEN);
17
-
18
- /**
19
- * Setup data structure for connections test
20
- */
21
- type SetupData = {
22
- projectName: string;
23
- };
24
-
25
- /**
26
- * Setup function - runs once before all VUs
27
- * Creates a project for connection CRUD testing
28
- */
29
- export function setup(): SetupData {
30
- // Validate server is up and initialized before proceeding
31
- validateServerIsUpAndInitialized();
32
-
33
- const projectName = generateTestName("load-test-conn-project");
34
- console.log(
35
- `Setup: Creating project ${projectName} for connections testing`,
36
- );
37
- const setupProjectResponse = projectsClient.createProject(
38
- {
39
- name: projectName,
40
- location: "",
41
- },
42
- { tags: { name: "setup_create_project" } },
43
- );
44
-
45
- const status = setupProjectResponse.response.status;
46
- if (status !== 200 && status !== 201) {
47
- const errorBody =
48
- setupProjectResponse.response.body || "no error details";
49
- const errorMessage =
50
- status === 501
51
- ? `Project creation not available (config may be frozen or endpoint not implemented). Status: ${status}`
52
- : `Failed to setup project for connections. Status: ${status}, Body: ${errorBody}`;
53
- throw new Error(errorMessage);
54
- }
55
-
56
- console.log(`Setup: Created project ${projectName} for connections testing`);
57
- return { projectName };
58
- }
59
-
60
- /**
61
- * Teardown function - runs once after all VUs
62
- * Cleans up the project created in setup
63
- * Gracefully handles cases where server is down
64
- */
65
- export function teardown(data: SetupData) {
66
- if (data && data.projectName) {
67
- console.log(`Teardown: Deleting project ${data.projectName}`);
68
- try {
69
- const deleteResponse = projectsClient.deleteProject(data.projectName, {
70
- tags: { name: "teardown_delete_project" },
71
- });
72
- if (deleteResponse.response.status === 0) {
73
- console.warn(
74
- `Teardown: Could not connect to server to delete project ${data.projectName} (server may be down)`,
75
- );
76
- } else if (
77
- deleteResponse.response.status !== 200 &&
78
- deleteResponse.response.status !== 204
79
- ) {
80
- console.warn(
81
- `Teardown: Failed to delete project ${data.projectName}: HTTP ${deleteResponse.response.status}`,
82
- );
83
- }
84
- } catch (error) {
85
- console.warn(
86
- `Teardown: Error deleting project ${data.projectName}: ${error}`,
87
- );
88
- }
89
- }
90
- }
91
-
92
- /**
93
- * Load Test - CRUD Connections
94
- *
95
- * This test verifies system performance for connection CRUD operations.
96
- * A single project is created at the beginning and reused across all iterations.
97
- * Cleanup happens at the end of the test run.
98
- *
99
- * Default configuration:
100
- * - Stages with ramp-up to 100 VUs
101
- * - 95th percentile response time < 1.5s
102
- * - Error rate < 2%
103
- */
104
- export const loadTestConnections: TestPreset = {
105
- defaultOptions: {
106
- stages: [
107
- { duration: "1m", target: 20 }, // warm-up
108
- { duration: "2m", target: 50 }, // load
109
- { duration: "5m", target: 100 }, // sustained load
110
- { duration: "2m", target: 150 }, // near saturation
111
- { duration: "1m", target: 0 }, // ramp down
112
- ],
113
- thresholds: {
114
- http_req_duration: ["p(90)<1000", "p(95)<1500", "p(99)<2500"],
115
- http_req_waiting: ["p(95)<1200"],
116
- http_req_failed: ["rate<0.02"],
117
- checks: ["rate>0.98"],
118
- dropped_iterations: ["count==0"],
119
- // Per-operation thresholds (C, R, U, D)
120
- "http_req_duration{name:create_connection}": [
121
- "p(90)<1000",
122
- "p(95)<1500",
123
- "p(99)<2500",
124
- ],
125
- "http_req_duration{name:get_connection}": [
126
- "p(90)<1000",
127
- "p(95)<1500",
128
- "p(99)<2500",
129
- ],
130
- "http_req_duration{name:list_connections}": [
131
- "p(90)<1000",
132
- "p(95)<1500",
133
- "p(99)<2500",
134
- ],
135
- "http_req_duration{name:update_connection}": [
136
- "p(90)<1000",
137
- "p(95)<1500",
138
- "p(99)<2500",
139
- ],
140
- "http_req_duration{name:delete_connection}": [
141
- "p(90)<1000",
142
- "p(95)<1500",
143
- "p(99)<2500",
144
- ],
145
- },
146
- },
147
- run: (data: unknown | undefined) => {
148
- const setupData = data as SetupData;
149
- if (!setupData || !setupData.projectName) {
150
- console.error(
151
- "Setup data not available, skipping connection CRUD test",
152
- );
153
- return;
154
- }
155
-
156
- const { projectName } = setupData;
157
- const connectionName = generateTestName("load-test-connection");
158
-
159
- group("Connections CRUD", () => {
160
- // Create connection (using duckdb as it doesn't require external setup)
161
- group("Create Connection", () => {
162
- const testConnection: Connection = {
163
- name: connectionName,
164
- type: ConnectionTypeEnum.duckdb,
165
- attributes: {
166
- dialectName: "duckdb",
167
- isPool: false,
168
- canPersist: true,
169
- canStream: true,
170
- },
171
- duckdbConnection: {},
172
- };
173
-
174
- const createConnectionResponse = connectionsClient.createConnection(
175
- projectName,
176
- connectionName,
177
- testConnection,
178
- { tags: { name: "create_connection" } },
179
- );
180
- check(createConnectionResponse.response, {
181
- "create connection request successful": (r) =>
182
- r.status === 200 || r.status === 201,
183
- });
184
- // Check for connection failure (status 0) or HTTP errors
185
- const createStatus = createConnectionResponse.response.status;
186
- if (createStatus === 0) {
187
- return; // Skip remaining connection tests if server is down
188
- }
189
- if (createStatus !== 200 && createStatus !== 201) {
190
- return; // Skip remaining tests if create failed
191
- }
192
- });
193
-
194
- // Read connection
195
- group("Get Connection", () => {
196
- const getConnectionResponse = connectionsClient.getConnection(
197
- projectName,
198
- connectionName,
199
- { tags: { name: "get_connection" } },
200
- );
201
- const getStatus = getConnectionResponse.response.status;
202
- check(getConnectionResponse.response, {
203
- "get connection request successful": (r) => r.status === 200,
204
- });
205
- if (getStatus === 0) {
206
- return;
207
- }
208
- });
209
-
210
- // List connections
211
- group("List Connections", () => {
212
- const listConnectionsResponse = connectionsClient.listConnections(
213
- projectName,
214
- { tags: { name: "list_connections" } },
215
- );
216
- const listStatus = listConnectionsResponse.response.status;
217
- check(listConnectionsResponse.response, {
218
- "list connections request successful": (r) => r.status === 200,
219
- });
220
- if (listStatus === 0) {
221
- return;
222
- }
223
- });
224
-
225
- // Update connection
226
- group("Update Connection", () => {
227
- const updateConnectionResponse = connectionsClient.updateConnection(
228
- projectName,
229
- connectionName,
230
- {
231
- duckdbConnection: {},
232
- },
233
- { tags: { name: "update_connection" } },
234
- );
235
- const updateStatus = updateConnectionResponse.response.status;
236
- check(updateConnectionResponse.response, {
237
- "update connection request successful": (r) => r.status === 200,
238
- });
239
- if (updateStatus === 0) {
240
- return;
241
- }
242
- });
243
-
244
- // Delete connection
245
- group("Delete Connection", () => {
246
- const deleteConnectionResponse = connectionsClient.deleteConnection(
247
- projectName,
248
- connectionName,
249
- { tags: { name: "delete_connection" } },
250
- );
251
- check(deleteConnectionResponse.response, {
252
- "delete connection request successful": (r) =>
253
- r.status === 200 || r.status === 204,
254
- });
255
- });
256
- });
257
-
258
- sleep(0.1);
259
- },
260
- };
261
-
262
- export const options = loadTestConnections.defaultOptions;
263
- export default loadTestConnections.run;