@tetrascience-npm/tetrascience-react-ui 0.4.0-beta.1.1 → 0.4.0-beta.11.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.
Files changed (62) hide show
  1. package/README.md +90 -5
  2. package/dist/athena.d.ts +167 -0
  3. package/dist/databricks.d.ts +129 -0
  4. package/dist/exceptions-DN25pCDi.cjs +2 -0
  5. package/dist/exceptions-DN25pCDi.cjs.map +1 -0
  6. package/dist/exceptions-jCQ6h5C8.js +33 -0
  7. package/dist/exceptions-jCQ6h5C8.js.map +1 -0
  8. package/dist/index.cjs +2021 -0
  9. package/dist/index.cjs.map +1 -0
  10. package/dist/index.css +1 -1
  11. package/dist/index.d.ts +2165 -1411
  12. package/dist/index.js +9461 -2
  13. package/dist/index.js.map +1 -0
  14. package/dist/logo.png +0 -0
  15. package/dist/providers/athena.cjs +2 -0
  16. package/dist/providers/athena.cjs.map +1 -0
  17. package/dist/providers/athena.d.ts +7 -77
  18. package/dist/providers/athena.js +160 -0
  19. package/dist/providers/athena.js.map +1 -0
  20. package/dist/providers/databricks.cjs +2 -0
  21. package/dist/providers/databricks.cjs.map +1 -0
  22. package/dist/providers/databricks.d.ts +7 -41
  23. package/dist/providers/databricks.js +85 -0
  24. package/dist/providers/databricks.js.map +1 -0
  25. package/dist/providers/snowflake.cjs +2 -0
  26. package/dist/providers/snowflake.cjs.map +1 -0
  27. package/dist/providers/snowflake.d.ts +7 -38
  28. package/dist/providers/snowflake.js +122 -0
  29. package/dist/providers/snowflake.js.map +1 -0
  30. package/dist/server.cjs +2 -0
  31. package/dist/server.cjs.map +1 -0
  32. package/dist/server.d.ts +537 -514
  33. package/dist/server.js +266 -0
  34. package/dist/server.js.map +1 -0
  35. package/dist/{providers/types-Ck4uFaGp.d.ts → snowflake.d.ts} +125 -82
  36. package/dist/vite.svg +1 -0
  37. package/package.json +44 -58
  38. package/dist/cjs/index.js +0 -1986
  39. package/dist/cjs/index.js.map +0 -1
  40. package/dist/cjs/providers/athena.js +0 -2
  41. package/dist/cjs/providers/athena.js.map +0 -1
  42. package/dist/cjs/providers/databricks.js +0 -2
  43. package/dist/cjs/providers/databricks.js.map +0 -1
  44. package/dist/cjs/providers/exceptions-CYktpdqW.js +0 -2
  45. package/dist/cjs/providers/exceptions-CYktpdqW.js.map +0 -1
  46. package/dist/cjs/providers/snowflake.js +0 -2
  47. package/dist/cjs/providers/snowflake.js.map +0 -1
  48. package/dist/cjs/server.js +0 -2
  49. package/dist/cjs/server.js.map +0 -1
  50. package/dist/esm/index.js +0 -1986
  51. package/dist/esm/index.js.map +0 -1
  52. package/dist/esm/providers/athena.js +0 -2
  53. package/dist/esm/providers/athena.js.map +0 -1
  54. package/dist/esm/providers/databricks.js +0 -2
  55. package/dist/esm/providers/databricks.js.map +0 -1
  56. package/dist/esm/providers/exceptions-C3uFWZB2.js +0 -2
  57. package/dist/esm/providers/exceptions-C3uFWZB2.js.map +0 -1
  58. package/dist/esm/providers/snowflake.js +0 -2
  59. package/dist/esm/providers/snowflake.js.map +0 -1
  60. package/dist/esm/server.js +0 -2
  61. package/dist/esm/server.js.map +0 -1
  62. package/src/styles/README.md +0 -56
package/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  React component library for building TetraScience applications.
4
4
 
5
+ [![npm version](https://img.shields.io/npm/v/@tetrascience-npm/tetrascience-react-ui)](https://www.npmjs.com/package/@tetrascience-npm/tetrascience-react-ui) [![CI](https://github.com/tetrascience/ts-lib-ui-kit/actions/workflows/ci.yml/badge.svg)](https://github.com/tetrascience/ts-lib-ui-kit/actions/workflows/ci.yml) 📖 **[Storybook – Live Component Demos](https://ts-lib-ui-kit-storybook.vercel.app/)** | 🛠️ **[Contributing Guide](./CONTRIBUTING.md)**
6
+
5
7
  This library provides:
6
8
 
7
9
  - **UI Components**: Reusable React components following atomic design principles
@@ -9,6 +11,12 @@ This library provides:
9
11
  - **Theming**: Customisable design system with ThemeProvider
10
12
  - **TypeScript**: Full type support with exported prop types
11
13
 
14
+ ## Requirements
15
+
16
+ - **React 19+**
17
+ - **Node.js 18+**
18
+ - **TypeScript 5.5+** (optional, but recommended)
19
+
12
20
  ## Installation
13
21
 
14
22
  ```bash
@@ -121,10 +129,10 @@ import {
121
129
  const userToken = await jwtManager.getTokenFromExpressRequest(req);
122
130
 
123
131
  // Create TDPClient with the user's auth token
132
+ // Other fields (tdpEndpoint, connectorId, orgSlug) are read from environment variables
124
133
  const client = new TDPClient({
125
134
  authToken: userToken,
126
135
  artifactType: 'data-app',
127
- orgSlug: process.env.ORG_SLUG,
128
136
  });
129
137
  await client.init();
130
138
 
@@ -199,6 +207,81 @@ try {
199
207
 
200
208
  > **Note:** Authentication tokens are obtained from the user's JWT via `jwtManager`. The `TS_AUTH_TOKEN` environment variable is only for local development fallback.
201
209
 
210
+ ### Connector Key/Value Store
211
+
212
+ The TDP connector key/value store lets data apps persist small pieces of state (user preferences, cached results, last-run timestamps, etc.) without an external database. The `TDPClient` from `@tetrascience-npm/ts-connectors-sdk` provides `getValue`, `getValues`, `saveValue`, and `saveValues` methods.
213
+
214
+ **Reading and writing values with the user's JWT token:**
215
+
216
+ ```typescript
217
+ import { TDPClient } from '@tetrascience-npm/ts-connectors-sdk';
218
+ import { jwtManager } from '@tetrascience-npm/tetrascience-react-ui/server';
219
+
220
+ // In an Express route handler:
221
+ app.get('/api/kv/:key', async (req, res) => {
222
+ // 1. Get the user's JWT from request cookies
223
+ const userToken = await jwtManager.getTokenFromExpressRequest(req);
224
+ if (!userToken) return res.status(401).json({ error: 'Not authenticated' });
225
+
226
+ // 2. Create a TDPClient authenticated as the user
227
+ // (CONNECTOR_ID, TDP_ENDPOINT, ORG_SLUG are read from env vars)
228
+ const client = new TDPClient({
229
+ authToken: userToken,
230
+ artifactType: 'data-app',
231
+ });
232
+ await client.init();
233
+
234
+ // 3. Read a value
235
+ const value = await client.getValue(req.params.key);
236
+ res.json({ key: req.params.key, value });
237
+ });
238
+
239
+ app.put('/api/kv/:key', async (req, res) => {
240
+ const userToken = await jwtManager.getTokenFromExpressRequest(req);
241
+ if (!userToken) return res.status(401).json({ error: 'Not authenticated' });
242
+
243
+ const client = new TDPClient({
244
+ authToken: userToken,
245
+ artifactType: 'data-app',
246
+ });
247
+ await client.init();
248
+
249
+ // Write a value (any JSON-serialisable type)
250
+ await client.saveValue(req.params.key, req.body.value, { secure: false });
251
+ res.json({ key: req.params.key, saved: true });
252
+ });
253
+ ```
254
+
255
+ **Reading multiple values at once:**
256
+
257
+ ```typescript
258
+ const values = await client.getValues(['theme', 'locale', 'last-run']);
259
+ // values[0] → theme, values[1] → locale, values[2] → last-run
260
+ ```
261
+
262
+ > See the [example app](./examples/vite-themed-app/) for a complete working server with KV store endpoints.
263
+
264
+ ### TDP Search (`server`)
265
+
266
+ **TdpSearchManager** - Server-side handler for the TdpSearch component. Resolves auth from request cookies (via `jwtManager`), calls TDP `searchEql`, and returns the response so the frontend hook works with minimal wiring.
267
+
268
+ ```typescript
269
+ import { tdpSearchManager } from "@tetrascience-npm/tetrascience-react-ui/server";
270
+
271
+ // Express: mount a POST route (e.g. /api/search)
272
+ app.post("/api/search", express.json(), async (req, res) => {
273
+ try {
274
+ const body = req.body; // SearchEqlRequest (searchTerm, from, size, sort, order, ...)
275
+ const response = await tdpSearchManager.handleSearchRequest(req, body);
276
+ res.json(response);
277
+ } catch (err) {
278
+ res.status(401).json({ error: err instanceof Error ? err.message : "Search failed" });
279
+ }
280
+ });
281
+ ```
282
+
283
+ Frontend: use `<TdpSearch columns={...} />` with default `apiEndpoint="/api/search"`, or pass `apiEndpoint` if you use a different path. Auth is taken from cookies (`ts-auth-token` or `ts-token-ref` via `jwtManager`).
284
+
202
285
  ## TypeScript Support
203
286
 
204
287
  Full TypeScript support with exported types:
@@ -210,7 +293,7 @@ import type { ButtonProps, BarGraphProps, BarDataSeries } from '@tetrascience-np
210
293
 
211
294
  ## Examples
212
295
 
213
- The repository includes example applications in the `examples/` directory:
296
+ This repository uses component driven development with storybook.js. To see the examples run the following.
214
297
 
215
298
  ```bash
216
299
  # Clone the repository
@@ -220,14 +303,16 @@ cd ts-lib-ui-kit
220
303
  # Install dependencies
221
304
  yarn
222
305
 
223
- # Run the themed example app
224
- yarn workspace vite-themed-app dev
306
+ # Run the storybook
307
+ yarn dev
225
308
  ```
226
309
 
227
- Visit <http://localhost:5173> to see the example app with custom theming.
310
+ Visit <http://localhost:6006>.
228
311
 
229
312
  ## Documentation
230
313
 
314
+ - [Storybook – Live Component Demos](https://ts-lib-ui-kit-storybook.vercel.app/) - Browse all components with interactive examples
315
+ - [NPM Package](https://www.npmjs.com/package/@tetrascience-npm/tetrascience-react-ui) - Installation and version info
231
316
  - [Getting Started Guide](./get_started_1.md) - Step-by-step tutorial
232
317
  - [Theming Guide](./THEMING.md) - Customise the design system
233
318
  - [Contributing](./CONTRIBUTING.md#development-setup) - Clone the repo and run `yarn storybook`
@@ -0,0 +1,167 @@
1
+ import { AthenaClient as AthenaClient_2 } from '@aws-sdk/client-athena';
2
+ import { awsSdkClientAthena } from '@aws-sdk/client-athena';
3
+
4
+ /**
5
+ * Athena Data Provider
6
+ *
7
+ * TypeScript equivalent of AthenaProvider from
8
+ * ts-lib-ui-kit-streamlit/tetrascience/data_app_providers/provider.py
9
+ *
10
+ * @remarks
11
+ * This provider requires the `@aws-sdk/client-athena` package to be installed.
12
+ * It is an optional peer dependency - install it only if you need Athena support:
13
+ * ```bash
14
+ * npm install @aws-sdk/client-athena
15
+ * # or
16
+ * yarn add @aws-sdk/client-athena
17
+ * ```
18
+ */
19
+ declare type AthenaClient = AthenaClient_2;
20
+
21
+ /**
22
+ * Athena data provider
23
+ */
24
+ export declare class AthenaProvider {
25
+ private client;
26
+ private sdk;
27
+ private workgroup;
28
+ private database;
29
+ private outputLocation?;
30
+ /**
31
+ * Initialize the Athena data provider
32
+ *
33
+ * @param client - AWS Athena client
34
+ * @param sdk - AWS Athena SDK module (for accessing command classes)
35
+ * @param workgroup - Athena workgroup to use
36
+ * @param database - Default database/schema
37
+ * @param outputLocation - Optional S3 output location
38
+ */
39
+ constructor(client: AthenaClient, sdk: AthenaSDK, workgroup: string, database: string, outputLocation?: string);
40
+ /**
41
+ * Query the Athena database
42
+ *
43
+ * @param sqlQuery - SQL query to execute
44
+ * @param _params - Parameters to pass to the query (currently not used - Athena doesn't support parameterized queries)
45
+ * @returns Promise resolving to array of row objects
46
+ *
47
+ * @remarks
48
+ * **Security Note:** AWS Athena does not support parameterized queries.
49
+ * Unlike traditional databases, there is no native way to use bind parameters
50
+ * with Athena. Callers are responsible for properly sanitizing any user input
51
+ * before constructing the SQL query string. This is a known limitation of the
52
+ * Athena service, not a design flaw in this implementation.
53
+ */
54
+ query(sqlQuery: string, _params?: Record<string, unknown>): Promise<Array<Record<string, unknown>>>;
55
+ /**
56
+ * Wait for query to complete
57
+ */
58
+ private waitForQueryCompletion;
59
+ /**
60
+ * Fetch all results from a completed query
61
+ */
62
+ private fetchAllResults;
63
+ /**
64
+ * Close the Athena client (no-op for AWS SDK clients)
65
+ */
66
+ close(): Promise<void>;
67
+ }
68
+
69
+ declare type AthenaSDK = awsSdkClientAthena;
70
+
71
+ /**
72
+ * Get the TDP Athena provider
73
+ *
74
+ * Creates an Athena provider using TDP environment configuration
75
+ *
76
+ * @returns Promise resolving to Athena data provider
77
+ * @throws {InvalidProviderConfigurationError} If @aws-sdk/client-athena is not installed
78
+ * @throws {Error} If ATHENA_S3_OUTPUT_LOCATION is not set when using the 'primary' workgroup
79
+ */
80
+ export declare function getTdpAthenaProvider(): Promise<AthenaProvider>;
81
+
82
+ /**
83
+ * Raised when the provider configuration is invalid
84
+ */
85
+ export declare class InvalidProviderConfigurationError extends ProviderError {
86
+ constructor(message: string);
87
+ }
88
+
89
+ /**
90
+ * Raised when a table is missing in the database
91
+ */
92
+ export declare class MissingTableError extends ProviderError {
93
+ constructor(message: string);
94
+ }
95
+
96
+ /**
97
+ * Data App Provider Types
98
+ *
99
+ * TypeScript equivalents of the Python ProviderConfiguration Pydantic models
100
+ * from ts-lib-ui-kit-streamlit/tetrascience/data_app_providers/provider_typing.py
101
+ */
102
+ /**
103
+ * Configuration model for data providers.
104
+ *
105
+ * This interface represents the configuration needed to connect to various
106
+ * database providers (Snowflake, Databricks, Athena, Benchling, etc.)
107
+ * attached to a data app.
108
+ */
109
+ export declare interface ProviderConfiguration {
110
+ /** Human-readable name of the provider */
111
+ name: string;
112
+ /** Provider type (snowflake, databricks, benchling, custom, etc.) */
113
+ type: string;
114
+ /** Optional URL to the provider's icon */
115
+ iconUrl?: string;
116
+ /** Dictionary containing connection details and credentials */
117
+ fields: Record<string, string | undefined>;
118
+ }
119
+
120
+ /**
121
+ * Raised when connecting to a provider fails
122
+ */
123
+ export declare class ProviderConnectionError extends ProviderError {
124
+ constructor(message: string);
125
+ }
126
+
127
+ /**
128
+ * Provider Exceptions
129
+ *
130
+ * TypeScript equivalents of the Python exceptions from
131
+ * ts-lib-ui-kit-streamlit/tetrascience/data_app_providers/exceptions.py
132
+ */
133
+ /**
134
+ * Base class for provider errors
135
+ */
136
+ export declare class ProviderError extends Error {
137
+ constructor(message: string);
138
+ }
139
+
140
+ /**
141
+ * Raised when a query fails
142
+ */
143
+ export declare class QueryError extends ProviderError {
144
+ constructor(message: string);
145
+ }
146
+
147
+ /**
148
+ * Standardized query result from data providers.
149
+ *
150
+ * This interface provides a consistent shape for query results across
151
+ * all provider types (Snowflake, Databricks, Athena), with optional
152
+ * metadata for API responses.
153
+ */
154
+ export declare interface QueryResult {
155
+ /** Array of row objects returned by the query */
156
+ data: Array<Record<string, unknown>>;
157
+ /** Number of rows returned */
158
+ rowCount: number;
159
+ /** Name of the provider that executed the query */
160
+ provider?: string;
161
+ /** Whether this is mock/demo data */
162
+ mock?: boolean;
163
+ /** Optional message (e.g., for errors or warnings) */
164
+ message?: string;
165
+ }
166
+
167
+ export { }
@@ -0,0 +1,129 @@
1
+ import { DBSQLClient as DBSQLClient_2 } from '@databricks/sql';
2
+ import { default as default_2 } from '@databricks/sql/dist/contracts/IDBSQLSession';
3
+
4
+ /**
5
+ * Build a Databricks data provider from the configuration
6
+ *
7
+ * @param config - Provider configuration
8
+ * @returns Promise resolving to Databricks data provider
9
+ * @throws {InvalidProviderConfigurationError} If @databricks/sql is not installed or config is invalid
10
+ */
11
+ export declare function buildDatabricksProvider(config: ProviderConfiguration): Promise<DatabricksProvider>;
12
+
13
+ /**
14
+ * Databricks data provider
15
+ */
16
+ export declare class DatabricksProvider {
17
+ private client;
18
+ private session;
19
+ /**
20
+ * Initialize the Databricks data provider
21
+ *
22
+ * @param client - Databricks SQL client
23
+ * @param session - Databricks SQL session
24
+ */
25
+ constructor(client: DBSQLClient, session: IDBSQLSession);
26
+ /**
27
+ * Query the Databricks database
28
+ *
29
+ * @param sqlQuery - SQL query to execute
30
+ * @param _params - Parameters to pass to the query (currently not used)
31
+ * @returns Promise resolving to array of row objects
32
+ */
33
+ query(sqlQuery: string, _params?: Record<string, unknown>): Promise<Array<Record<string, unknown>>>;
34
+ /**
35
+ * Close the Databricks connection
36
+ */
37
+ close(): Promise<void>;
38
+ }
39
+
40
+ declare type DBSQLClient = DBSQLClient_2;
41
+
42
+ declare type IDBSQLSession = default_2;
43
+
44
+ /**
45
+ * Raised when the provider configuration is invalid
46
+ */
47
+ export declare class InvalidProviderConfigurationError extends ProviderError {
48
+ constructor(message: string);
49
+ }
50
+
51
+ /**
52
+ * Raised when a table is missing in the database
53
+ */
54
+ export declare class MissingTableError extends ProviderError {
55
+ constructor(message: string);
56
+ }
57
+
58
+ /**
59
+ * Data App Provider Types
60
+ *
61
+ * TypeScript equivalents of the Python ProviderConfiguration Pydantic models
62
+ * from ts-lib-ui-kit-streamlit/tetrascience/data_app_providers/provider_typing.py
63
+ */
64
+ /**
65
+ * Configuration model for data providers.
66
+ *
67
+ * This interface represents the configuration needed to connect to various
68
+ * database providers (Snowflake, Databricks, Athena, Benchling, etc.)
69
+ * attached to a data app.
70
+ */
71
+ export declare interface ProviderConfiguration {
72
+ /** Human-readable name of the provider */
73
+ name: string;
74
+ /** Provider type (snowflake, databricks, benchling, custom, etc.) */
75
+ type: string;
76
+ /** Optional URL to the provider's icon */
77
+ iconUrl?: string;
78
+ /** Dictionary containing connection details and credentials */
79
+ fields: Record<string, string | undefined>;
80
+ }
81
+
82
+ /**
83
+ * Raised when connecting to a provider fails
84
+ */
85
+ export declare class ProviderConnectionError extends ProviderError {
86
+ constructor(message: string);
87
+ }
88
+
89
+ /**
90
+ * Provider Exceptions
91
+ *
92
+ * TypeScript equivalents of the Python exceptions from
93
+ * ts-lib-ui-kit-streamlit/tetrascience/data_app_providers/exceptions.py
94
+ */
95
+ /**
96
+ * Base class for provider errors
97
+ */
98
+ export declare class ProviderError extends Error {
99
+ constructor(message: string);
100
+ }
101
+
102
+ /**
103
+ * Raised when a query fails
104
+ */
105
+ export declare class QueryError extends ProviderError {
106
+ constructor(message: string);
107
+ }
108
+
109
+ /**
110
+ * Standardized query result from data providers.
111
+ *
112
+ * This interface provides a consistent shape for query results across
113
+ * all provider types (Snowflake, Databricks, Athena), with optional
114
+ * metadata for API responses.
115
+ */
116
+ export declare interface QueryResult {
117
+ /** Array of row objects returned by the query */
118
+ data: Array<Record<string, unknown>>;
119
+ /** Number of rows returned */
120
+ rowCount: number;
121
+ /** Name of the provider that executed the query */
122
+ provider?: string;
123
+ /** Whether this is mock/demo data */
124
+ mock?: boolean;
125
+ /** Optional message (e.g., for errors or warnings) */
126
+ message?: string;
127
+ }
128
+
129
+ export { }
@@ -0,0 +1,2 @@
1
+ "use strict";class o extends Error{constructor(r){super(r),this.name="ProviderError"}}class s extends o{constructor(r){super(r),this.name="MissingTableError"}}class n extends o{constructor(r){super(r),this.name="QueryError"}}class i extends o{constructor(r){super(r),this.name="ProviderConnectionError"}}class t extends o{constructor(r){super(r),this.name="InvalidProviderConfigurationError"}}exports.InvalidProviderConfigurationError=t;exports.MissingTableError=s;exports.ProviderConnectionError=i;exports.ProviderError=o;exports.QueryError=n;
2
+ //# sourceMappingURL=exceptions-DN25pCDi.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exceptions-DN25pCDi.cjs","sources":["../src/server/providers/exceptions.ts"],"sourcesContent":["/**\n * Provider Exceptions\n *\n * TypeScript equivalents of the Python exceptions from\n * ts-lib-ui-kit-streamlit/tetrascience/data_app_providers/exceptions.py\n */\n\n/**\n * Base class for provider errors\n */\nexport class ProviderError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"ProviderError\";\n }\n}\n\n/**\n * Raised when a table is missing in the database\n */\nexport class MissingTableError extends ProviderError {\n constructor(message: string) {\n super(message);\n this.name = \"MissingTableError\";\n }\n}\n\n/**\n * Raised when a query fails\n */\nexport class QueryError extends ProviderError {\n constructor(message: string) {\n super(message);\n this.name = \"QueryError\";\n }\n}\n\n/**\n * Raised when connecting to a provider fails\n */\nexport class ProviderConnectionError extends ProviderError {\n constructor(message: string) {\n super(message);\n this.name = \"ProviderConnectionError\";\n }\n}\n\n/**\n * Raised when the provider configuration is invalid\n */\nexport class InvalidProviderConfigurationError extends ProviderError {\n constructor(message: string) {\n super(message);\n this.name = \"InvalidProviderConfigurationError\";\n }\n}\n\n"],"names":["ProviderError","message","MissingTableError","QueryError","ProviderConnectionError","InvalidProviderConfigurationError"],"mappings":"aAUO,MAAMA,UAAsB,KAAM,CACvC,YAAYC,EAAiB,CAC3B,MAAMA,CAAO,EACb,KAAK,KAAO,eACd,CACF,CAKO,MAAMC,UAA0BF,CAAc,CACnD,YAAYC,EAAiB,CAC3B,MAAMA,CAAO,EACb,KAAK,KAAO,mBACd,CACF,CAKO,MAAME,UAAmBH,CAAc,CAC5C,YAAYC,EAAiB,CAC3B,MAAMA,CAAO,EACb,KAAK,KAAO,YACd,CACF,CAKO,MAAMG,UAAgCJ,CAAc,CACzD,YAAYC,EAAiB,CAC3B,MAAMA,CAAO,EACb,KAAK,KAAO,yBACd,CACF,CAKO,MAAMI,UAA0CL,CAAc,CACnE,YAAYC,EAAiB,CAC3B,MAAMA,CAAO,EACb,KAAK,KAAO,mCACd,CACF"}
@@ -0,0 +1,33 @@
1
+ class o extends Error {
2
+ constructor(r) {
3
+ super(r), this.name = "ProviderError";
4
+ }
5
+ }
6
+ class e extends o {
7
+ constructor(r) {
8
+ super(r), this.name = "MissingTableError";
9
+ }
10
+ }
11
+ class n extends o {
12
+ constructor(r) {
13
+ super(r), this.name = "QueryError";
14
+ }
15
+ }
16
+ class t extends o {
17
+ constructor(r) {
18
+ super(r), this.name = "ProviderConnectionError";
19
+ }
20
+ }
21
+ class i extends o {
22
+ constructor(r) {
23
+ super(r), this.name = "InvalidProviderConfigurationError";
24
+ }
25
+ }
26
+ export {
27
+ i as I,
28
+ e as M,
29
+ t as P,
30
+ n as Q,
31
+ o as a
32
+ };
33
+ //# sourceMappingURL=exceptions-jCQ6h5C8.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exceptions-jCQ6h5C8.js","sources":["../src/server/providers/exceptions.ts"],"sourcesContent":["/**\n * Provider Exceptions\n *\n * TypeScript equivalents of the Python exceptions from\n * ts-lib-ui-kit-streamlit/tetrascience/data_app_providers/exceptions.py\n */\n\n/**\n * Base class for provider errors\n */\nexport class ProviderError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"ProviderError\";\n }\n}\n\n/**\n * Raised when a table is missing in the database\n */\nexport class MissingTableError extends ProviderError {\n constructor(message: string) {\n super(message);\n this.name = \"MissingTableError\";\n }\n}\n\n/**\n * Raised when a query fails\n */\nexport class QueryError extends ProviderError {\n constructor(message: string) {\n super(message);\n this.name = \"QueryError\";\n }\n}\n\n/**\n * Raised when connecting to a provider fails\n */\nexport class ProviderConnectionError extends ProviderError {\n constructor(message: string) {\n super(message);\n this.name = \"ProviderConnectionError\";\n }\n}\n\n/**\n * Raised when the provider configuration is invalid\n */\nexport class InvalidProviderConfigurationError extends ProviderError {\n constructor(message: string) {\n super(message);\n this.name = \"InvalidProviderConfigurationError\";\n }\n}\n\n"],"names":["ProviderError","message","MissingTableError","QueryError","ProviderConnectionError","InvalidProviderConfigurationError"],"mappings":"AAUO,MAAMA,UAAsB,MAAM;AAAA,EACvC,YAAYC,GAAiB;AAC3B,UAAMA,CAAO,GACb,KAAK,OAAO;AAAA,EACd;AACF;AAKO,MAAMC,UAA0BF,EAAc;AAAA,EACnD,YAAYC,GAAiB;AAC3B,UAAMA,CAAO,GACb,KAAK,OAAO;AAAA,EACd;AACF;AAKO,MAAME,UAAmBH,EAAc;AAAA,EAC5C,YAAYC,GAAiB;AAC3B,UAAMA,CAAO,GACb,KAAK,OAAO;AAAA,EACd;AACF;AAKO,MAAMG,UAAgCJ,EAAc;AAAA,EACzD,YAAYC,GAAiB;AAC3B,UAAMA,CAAO,GACb,KAAK,OAAO;AAAA,EACd;AACF;AAKO,MAAMI,UAA0CL,EAAc;AAAA,EACnE,YAAYC,GAAiB;AAC3B,UAAMA,CAAO,GACb,KAAK,OAAO;AAAA,EACd;AACF;"}