@rawdash/core 0.3.0 → 0.5.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 ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
package/README.md CHANGED
@@ -68,11 +68,11 @@ Validates and returns a `Dashboard`. Widget keys must be URL-safe (`[a-zA-Z0-9_-
68
68
 
69
69
  ### `defineMetric(options)`
70
70
 
71
- Returns a `ResolvedMetric` that can be used in stat, timeseries, and distribution widgets.
71
+ Returns a `ComputedMetric` that can be used in stat, timeseries, and distribution widgets.
72
72
 
73
73
  ### `secret(name)`
74
74
 
75
- Returns a `SecretRef` that resolves the named environment variable at runtime. Connectors that accept a `token` or API key should use this to avoid hardcoding credentials.
75
+ Returns a `Secret` that resolves the named environment variable at runtime. Connectors that accept a `token` or API key should use this to avoid hardcoding credentials.
76
76
 
77
77
  ### `defineConnector(options)`
78
78
 
package/dist/index.d.ts CHANGED
@@ -1,20 +1,206 @@
1
- import { E as Event, M as Metric, D as Distribution, S as StorageHandle, C as Connector, a as ServerStorage, W as WidgetEntry, b as SyncState } from './server-storage-BGSLkDoF.js';
2
- export { B as BaseConnector, c as CredentialEntry, d as CredentialSchema, e as DistributionQuery, f as Edge, g as EdgeQuery, h as Entity, i as EntityQuery, j as EnvSecretsResolver, k as EventQuery, I as InferCredentialInput, l as InferCredentials, J as JSONValue, m as MetricQuery, n as SecretRef, o as SecretsResolver, p as SyncRequest, q as defineConnector, r as isSecretRef, s as resolveSecretRefs, t as secret } from './server-storage-BGSLkDoF.js';
3
1
  import { z } from 'zod';
4
2
 
3
+ type Secret = {
4
+ $secret: string;
5
+ };
6
+ declare function secret(name: string): Secret;
7
+ declare function isSecret(value: unknown): value is Secret;
8
+ interface SecretsResolver {
9
+ resolve(name: string): string | undefined;
10
+ }
11
+ declare class EnvSecretsResolver implements SecretsResolver {
12
+ resolve(name: string): string | undefined;
13
+ }
14
+ declare function extractSecretNames(value: unknown): string[];
15
+ declare function resolveSecrets<T>(obj: T, resolver: SecretsResolver): T;
16
+
17
+ type JSONValue = string | number | boolean | null | JSONValue[] | {
18
+ [key: string]: JSONValue;
19
+ };
20
+ interface Event {
21
+ name: string;
22
+ start_ts: number;
23
+ end_ts: number | null;
24
+ attributes: Record<string, JSONValue>;
25
+ }
26
+ interface Entity {
27
+ type: string;
28
+ id: string;
29
+ attributes: Record<string, JSONValue>;
30
+ updated_at: number;
31
+ }
32
+ interface MetricSample {
33
+ name: string;
34
+ ts: number;
35
+ value: number;
36
+ attributes: Record<string, JSONValue>;
37
+ }
38
+ interface Edge {
39
+ from_type: string;
40
+ from_id: string;
41
+ kind: string;
42
+ to_type: string;
43
+ to_id: string;
44
+ attributes: Record<string, JSONValue>;
45
+ updated_at: number;
46
+ }
47
+ type Distribution = {
48
+ name: string;
49
+ ts: number;
50
+ kind: 'histogram';
51
+ data: {
52
+ buckets: Array<{
53
+ le: number;
54
+ count: number;
55
+ }>;
56
+ count: number;
57
+ sum: number;
58
+ };
59
+ attributes: Record<string, JSONValue>;
60
+ } | {
61
+ name: string;
62
+ ts: number;
63
+ kind: 'summary';
64
+ data: {
65
+ quantiles: Array<{
66
+ q: number;
67
+ value: number;
68
+ }>;
69
+ count: number;
70
+ sum: number;
71
+ };
72
+ attributes: Record<string, JSONValue>;
73
+ };
74
+ interface EventQuery {
75
+ name?: string;
76
+ start?: number;
77
+ end?: number;
78
+ }
79
+ interface EntityQuery {
80
+ type: string;
81
+ }
82
+ interface MetricQuery {
83
+ name?: string;
84
+ start?: number;
85
+ end?: number;
86
+ }
87
+ interface EdgeQuery {
88
+ fromType?: string;
89
+ fromId?: string;
90
+ kind?: string;
91
+ toType?: string;
92
+ toId?: string;
93
+ }
94
+ interface DistributionQuery {
95
+ name?: string;
96
+ start?: number;
97
+ end?: number;
98
+ }
99
+ interface StorageHandle {
100
+ event(e: Event): Promise<void>;
101
+ entity(e: Entity): Promise<void>;
102
+ metric(m: MetricSample): Promise<void>;
103
+ edge(e: Edge): Promise<void>;
104
+ distribution(d: Distribution): Promise<void>;
105
+ events(es: Event[], scope?: {
106
+ names?: string[];
107
+ }): Promise<void>;
108
+ entities(es: Entity[], scope?: {
109
+ types?: string[];
110
+ }): Promise<void>;
111
+ metrics(ms: MetricSample[], scope?: {
112
+ names?: string[];
113
+ }): Promise<void>;
114
+ edges(es: Edge[], scope?: {
115
+ kinds?: string[];
116
+ }): Promise<void>;
117
+ distributions(ds: Distribution[], scope?: {
118
+ names?: string[];
119
+ }): Promise<void>;
120
+ queryEvents(q: EventQuery): Promise<Event[]>;
121
+ getEntity(type: string, id: string): Promise<Entity | null>;
122
+ queryEntities(q: EntityQuery): Promise<Entity[]>;
123
+ queryMetrics(q: MetricQuery): Promise<MetricSample[]>;
124
+ traverse(q: EdgeQuery): Promise<Edge[]>;
125
+ queryDistributions(q: DistributionQuery): Promise<Distribution[]>;
126
+ deleteOlderThan(shape: 'events' | 'metrics' | 'distributions', tsUnixMs: number): Promise<{
127
+ rowsDeleted: number;
128
+ }>;
129
+ }
130
+ interface CredentialField {
131
+ description: string;
132
+ auth?: 'none' | 'optional' | 'required';
133
+ }
134
+ type CredentialsSchema = Record<string, CredentialField>;
135
+ type InferCredentials<TCreds extends CredentialsSchema> = {
136
+ [K in keyof TCreds]: TCreds[K] extends {
137
+ auth: 'required';
138
+ } ? string : string | undefined;
139
+ };
140
+ type InferCredentialInput<TCreds extends CredentialsSchema> = {
141
+ [K in keyof TCreds]: TCreds[K] extends {
142
+ auth: 'required';
143
+ } ? string | Secret : string | Secret | undefined;
144
+ };
145
+ interface SyncOptions {
146
+ mode: 'full' | 'latest';
147
+ since?: string;
148
+ }
149
+ interface Connector {
150
+ readonly id: string;
151
+ readonly credentials?: CredentialsSchema;
152
+ serializeConfig(): Record<string, unknown>;
153
+ sync(options: SyncOptions, storage: StorageHandle, signal?: AbortSignal): Promise<void>;
154
+ }
155
+ interface RetryPolicy {
156
+ maxAttempts?: number;
157
+ initialDelayMs?: number;
158
+ maxDelayMs?: number;
159
+ signal?: AbortSignal;
160
+ }
161
+ declare abstract class BaseConnector<TSettings = unknown, TCreds extends CredentialsSchema = CredentialsSchema> implements Connector {
162
+ abstract readonly id: string;
163
+ readonly credentials?: TCreds;
164
+ protected settings: TSettings;
165
+ protected creds: InferCredentials<TCreds>;
166
+ private rawCredInput;
167
+ constructor(settings: TSettings, creds?: InferCredentialInput<TCreds>);
168
+ serializeConfig(): Record<string, unknown>;
169
+ protected sleep(ms: number, signal?: AbortSignal): Promise<void>;
170
+ protected withRetry<T>(fn: (signal?: AbortSignal) => Promise<{
171
+ status: 'done';
172
+ value: T;
173
+ } | {
174
+ status: 'retry';
175
+ }>, options?: RetryPolicy): Promise<T | null>;
176
+ abstract sync(options: SyncOptions, storage: StorageHandle, signal?: AbortSignal): Promise<void>;
177
+ }
178
+ declare function defineConnector<TSettings>(): <TCreds extends CredentialsSchema = Record<string, never>>(def: {
179
+ id: string;
180
+ credentials?: TCreds;
181
+ sync: (this: {
182
+ settings: TSettings;
183
+ creds: InferCredentials<TCreds>;
184
+ }, options: SyncOptions, storage: StorageHandle, signal?: AbortSignal) => Promise<void>;
185
+ }) => {
186
+ new (settings: TSettings, creds?: InferCredentialInput<TCreds>): Connector;
187
+ readonly id: string;
188
+ readonly credentials: TCreds | undefined;
189
+ };
190
+
5
191
  interface RetentionConfig {
6
192
  maxAge?: number;
7
193
  maxSize?: number;
8
194
  floor?: number;
9
195
  intervalMs?: number;
10
196
  }
11
- interface RetentionCandidates {
197
+ interface RetentionDeletionPlan {
12
198
  events: Event[];
13
- metrics: Metric[];
199
+ metrics: MetricSample[];
14
200
  distributions: Distribution[];
15
201
  }
16
202
  declare function selectForDeletion<T>(rows: T[], getTs: (row: T) => number, config: RetentionConfig, nowMs?: number): T[];
17
- declare function computeRetention(handle: StorageHandle, config: RetentionConfig, nowMs?: number): Promise<RetentionCandidates>;
203
+ declare function computeRetention(handle: StorageHandle, config: RetentionConfig, nowMs?: number): Promise<RetentionDeletionPlan>;
18
204
 
19
205
  declare const shapeSchema: z.ZodEnum<{
20
206
  event: "event";
@@ -90,7 +276,7 @@ declare const groupBySchema: z.ZodObject<{
90
276
  month: "month";
91
277
  }>;
92
278
  }, z.core.$strip>;
93
- declare const resolvedMetricSchema: z.ZodObject<{
279
+ declare const computedMetricSchema: z.ZodObject<{
94
280
  connectorId: z.ZodString;
95
281
  shape: z.ZodEnum<{
96
282
  event: "event";
@@ -986,7 +1172,7 @@ interface GroupBy {
986
1172
  field: string;
987
1173
  granularity: 'hour' | 'day' | 'week' | 'month';
988
1174
  }
989
- interface MetricDef {
1175
+ interface Metric {
990
1176
  connector: {
991
1177
  id: string;
992
1178
  };
@@ -999,7 +1185,7 @@ interface MetricDef {
999
1185
  filter?: FilterClause[];
1000
1186
  groupBy?: GroupBy;
1001
1187
  }
1002
- interface ResolvedMetric {
1188
+ interface ComputedMetric {
1003
1189
  readonly connectorId: string;
1004
1190
  readonly shape: Shape;
1005
1191
  readonly name?: string;
@@ -1013,7 +1199,7 @@ interface ResolvedMetric {
1013
1199
  interface StatWidget {
1014
1200
  kind: 'stat';
1015
1201
  title: string;
1016
- metric: ResolvedMetric;
1202
+ metric: ComputedMetric;
1017
1203
  window?: string;
1018
1204
  compare?: 'none' | 'previous-period';
1019
1205
  }
@@ -1025,41 +1211,62 @@ interface StatusWidget {
1025
1211
  interface TimeseriesWidget {
1026
1212
  kind: 'timeseries';
1027
1213
  title: string;
1028
- metric: ResolvedMetric;
1214
+ metric: ComputedMetric;
1029
1215
  window: string;
1030
1216
  granularity?: 'hour' | 'day' | 'week';
1031
1217
  }
1032
1218
  interface DistributionWidget {
1033
1219
  kind: 'distribution';
1034
1220
  title: string;
1035
- metric: ResolvedMetric;
1221
+ metric: ComputedMetric;
1036
1222
  window: string;
1037
1223
  }
1038
1224
  type Widget = StatWidget | StatusWidget | TimeseriesWidget | DistributionWidget;
1039
1225
 
1040
- interface ConnectorEntry {
1226
+ interface ConfiguredConnector {
1041
1227
  connector: Connector;
1042
1228
  }
1043
1229
  interface Dashboard {
1044
1230
  widgets: Record<string, Widget>;
1045
1231
  }
1046
1232
  interface DashboardConfig {
1047
- connectors: ConnectorEntry[];
1233
+ connectors: ConfiguredConnector[];
1048
1234
  dashboards: Record<string, Dashboard>;
1049
1235
  retention?: RetentionConfig;
1050
1236
  }
1051
1237
  declare function defineDashboard(options: {
1052
1238
  widgets: Record<string, Widget>;
1053
1239
  }): Dashboard;
1054
- declare function defineMetric(options: MetricDef): ResolvedMetric;
1240
+ declare function defineMetric(options: Metric): ComputedMetric;
1055
1241
  declare function defineConfig(config: DashboardConfig): DashboardConfig;
1056
1242
 
1243
+ interface CachedWidget {
1244
+ id: string;
1245
+ widgetId: string;
1246
+ connectorId: string;
1247
+ data: unknown;
1248
+ cachedAt: string | null;
1249
+ }
1250
+ interface SyncState {
1251
+ status: 'idle' | 'syncing' | 'error';
1252
+ lastSyncAt: string | null;
1253
+ lastError: string | null;
1254
+ }
1255
+
1057
1256
  type ConfigFieldsSchema = z.ZodObject<z.ZodRawShape>;
1058
1257
  declare function defineConfigFields<T extends z.ZodRawShape>(schema: z.ZodObject<T>): z.ZodObject<T>;
1059
1258
 
1060
- declare function computeMetric(storage: StorageHandle, metric: ResolvedMetric): Promise<unknown>;
1259
+ declare function computeMetric(storage: StorageHandle, metric: ComputedMetric): Promise<unknown>;
1260
+
1261
+ interface ServerStorage {
1262
+ getStorageHandle(connectorId: string): StorageHandle;
1263
+ getSyncState(): Promise<SyncState>;
1264
+ setSyncing(): Promise<boolean>;
1265
+ setSyncSuccess(): Promise<void>;
1266
+ setSyncError(error: string): Promise<void>;
1267
+ }
1061
1268
 
1062
- declare function resolveWidget(id: string, widget: Widget, connectors: ConnectorEntry[] | readonly string[] | undefined, storage: ServerStorage): Promise<WidgetEntry | undefined>;
1269
+ declare function resolveWidget(id: string, widget: Widget, connectors: ConfiguredConnector[] | readonly string[] | undefined, storage: ServerStorage): Promise<CachedWidget | undefined>;
1063
1270
 
1064
1271
  declare class InMemoryStorage implements ServerStorage {
1065
1272
  private eventStore;
@@ -1075,4 +1282,39 @@ declare class InMemoryStorage implements ServerStorage {
1075
1282
  setSyncError(error: string): Promise<void>;
1076
1283
  }
1077
1284
 
1078
- export { type AggFn, type ConfigFieldsSchema, Connector, type ConnectorEntry, type Dashboard, type DashboardConfig, Distribution, type DistributionWidget, Event, type FilterClause, type FilterCondition, type FilterOperator, type GroupBy, InMemoryStorage, Metric, type MetricDef, type ResolvedMetric, type RetentionCandidates, type RetentionConfig, ServerStorage, type Shape, type StatWidget, type StatusWidget, StorageHandle, SyncState, type TimeseriesWidget, type Widget, WidgetEntry, type WidgetKind, aggFnSchema, computeMetric, computeRetention, defineConfig, defineConfigFields, defineDashboard, defineMetric, distributionWidgetSchema, filterClauseSchema, filterConditionSchema, filterOperatorSchema, getWidgetSchema, groupBySchema, resolveWidget, resolvedMetricSchema, selectForDeletion, shapeSchema, statWidgetSchema, statusWidgetSchema, timeseriesWidgetSchema, widgetSchema, widgetSchemas };
1285
+ declare const wireConnectorSchema: z.ZodObject<{
1286
+ name: z.ZodString;
1287
+ connectorId: z.ZodString;
1288
+ displayName: z.ZodOptional<z.ZodString>;
1289
+ config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1290
+ syncIntervalSeconds: z.ZodOptional<z.ZodNumber>;
1291
+ enabled: z.ZodOptional<z.ZodBoolean>;
1292
+ }, z.core.$strip>;
1293
+ declare const wireDashboardSchema: z.ZodObject<{
1294
+ id: z.ZodOptional<z.ZodString>;
1295
+ name: z.ZodString;
1296
+ slug: z.ZodString;
1297
+ config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1298
+ }, z.core.$strip>;
1299
+ declare const wireConfigSchema: z.ZodObject<{
1300
+ connectors: z.ZodOptional<z.ZodArray<z.ZodObject<{
1301
+ name: z.ZodString;
1302
+ connectorId: z.ZodString;
1303
+ displayName: z.ZodOptional<z.ZodString>;
1304
+ config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1305
+ syncIntervalSeconds: z.ZodOptional<z.ZodNumber>;
1306
+ enabled: z.ZodOptional<z.ZodBoolean>;
1307
+ }, z.core.$strip>>>;
1308
+ dashboards: z.ZodOptional<z.ZodArray<z.ZodObject<{
1309
+ id: z.ZodOptional<z.ZodString>;
1310
+ name: z.ZodString;
1311
+ slug: z.ZodString;
1312
+ config: z.ZodRecord<z.ZodString, z.ZodUnknown>;
1313
+ }, z.core.$strip>>>;
1314
+ }, z.core.$strip>;
1315
+ type WireConnector = z.infer<typeof wireConnectorSchema>;
1316
+ type WireDashboard = z.infer<typeof wireDashboardSchema>;
1317
+ type WireConfig = z.infer<typeof wireConfigSchema>;
1318
+ declare function toWireConfig(config: DashboardConfig): WireConfig;
1319
+
1320
+ export { type AggFn, BaseConnector, type CachedWidget, type ComputedMetric, type ConfigFieldsSchema, type ConfiguredConnector, type Connector, type CredentialField, type CredentialsSchema, type Dashboard, type DashboardConfig, type Distribution, type DistributionQuery, type DistributionWidget, type Edge, type EdgeQuery, type Entity, type EntityQuery, EnvSecretsResolver, type Event, type EventQuery, type FilterClause, type FilterCondition, type FilterOperator, type GroupBy, InMemoryStorage, type InferCredentialInput, type InferCredentials, type JSONValue, type Metric, type MetricQuery, type MetricSample, type RetentionConfig, type RetentionDeletionPlan, type Secret, type SecretsResolver, type ServerStorage, type Shape, type StatWidget, type StatusWidget, type StorageHandle, type SyncOptions, type SyncState, type TimeseriesWidget, type Widget, type WidgetKind, type WireConfig, type WireConnector, type WireDashboard, aggFnSchema, computeMetric, computeRetention, computedMetricSchema, defineConfig, defineConfigFields, defineConnector, defineDashboard, defineMetric, distributionWidgetSchema, extractSecretNames, filterClauseSchema, filterConditionSchema, filterOperatorSchema, getWidgetSchema, groupBySchema, isSecret, resolveSecrets, resolveWidget, secret, selectForDeletion, shapeSchema, statWidgetSchema, statusWidgetSchema, timeseriesWidgetSchema, toWireConfig, widgetSchema, widgetSchemas, wireConfigSchema, wireConnectorSchema, wireDashboardSchema };