@kopai/core 0.5.0 → 0.7.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/dist/{chunk-Bo1DHCg-.mjs → chunk-DQk6qfdC.mjs} +3 -3
- package/dist/index.cjs +57 -8
- package/dist/index.d.cts +76 -12
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +75 -11
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +49 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { t as __exportAll } from "./chunk-
|
|
1
|
+
import { t as __exportAll } from "./chunk-DQk6qfdC.mjs";
|
|
2
2
|
import z$1, { z } from "zod";
|
|
3
|
+
import { z as z$2 } from "zod/v4";
|
|
3
4
|
|
|
4
5
|
//#region src/denormalized-signals-zod.ts
|
|
5
6
|
var denormalized_signals_zod_exports = /* @__PURE__ */ __exportAll({
|
|
@@ -90,7 +91,7 @@ const otelSumSchema = metricsBaseSchema.extend({
|
|
|
90
91
|
MetricType: z.literal("Sum").describe("Sum metric type."),
|
|
91
92
|
Value: z.number().describe("Scalar sum value."),
|
|
92
93
|
Flags: z.number().optional().describe("Flags that apply to this data point (see DataPointFlags)."),
|
|
93
|
-
|
|
94
|
+
AggregationTemporality: z.string().optional().describe("Aggregation temporality (DELTA or CUMULATIVE)."),
|
|
94
95
|
IsMonotonic: z.number().optional().describe("Whether the sum is monotonic (0 = false, 1 = true).")
|
|
95
96
|
});
|
|
96
97
|
const otelHistogramSchema = metricsBaseSchema.extend({
|
|
@@ -101,7 +102,7 @@ const otelHistogramSchema = metricsBaseSchema.extend({
|
|
|
101
102
|
Max: z.number().nullable().optional().describe("Maximum value recorded."),
|
|
102
103
|
BucketCounts: z.array(z.number()).optional().describe("Count of values in each bucket."),
|
|
103
104
|
ExplicitBounds: z.array(z.number()).optional().describe("Bucket boundaries."),
|
|
104
|
-
|
|
105
|
+
AggregationTemporality: z.string().optional().describe("Aggregation temporality (DELTA or CUMULATIVE).")
|
|
105
106
|
});
|
|
106
107
|
const otelExponentialHistogramSchema = metricsBaseSchema.extend({
|
|
107
108
|
MetricType: z.literal("ExponentialHistogram").describe("Exponential histogram metric type."),
|
|
@@ -115,7 +116,8 @@ const otelExponentialHistogramSchema = metricsBaseSchema.extend({
|
|
|
115
116
|
PositiveOffset: z.number().optional().describe("Offset for positive bucket indices."),
|
|
116
117
|
NegativeBucketCounts: z.array(z.number()).optional().describe("Counts for negative value buckets."),
|
|
117
118
|
NegativeOffset: z.number().optional().describe("Offset for negative bucket indices."),
|
|
118
|
-
|
|
119
|
+
ZeroThreshold: z.number().optional().describe("Width of the zero region. Values within [-ZeroThreshold, ZeroThreshold] go to the zero count bucket."),
|
|
120
|
+
AggregationTemporality: z.string().optional().describe("Aggregation temporality (DELTA or CUMULATIVE).")
|
|
119
121
|
});
|
|
120
122
|
const otelSummarySchema = metricsBaseSchema.extend({
|
|
121
123
|
MetricType: z.literal("Summary").describe("Summary metric type."),
|
|
@@ -134,7 +136,7 @@ const otelMetricsSchema = z.discriminatedUnion("MetricType", [
|
|
|
134
136
|
|
|
135
137
|
//#endregion
|
|
136
138
|
//#region src/telemetry-datasource.ts
|
|
137
|
-
var telemetry_datasource_exports = {};
|
|
139
|
+
var telemetry_datasource_exports = /* @__PURE__ */ __exportAll({});
|
|
138
140
|
|
|
139
141
|
//#endregion
|
|
140
142
|
//#region src/otlp-generated.ts
|
|
@@ -389,7 +391,7 @@ let DataPointFlags = /* @__PURE__ */ function(DataPointFlags) {
|
|
|
389
391
|
|
|
390
392
|
//#endregion
|
|
391
393
|
//#region src/otlp-metrics-generated.ts
|
|
392
|
-
var otlp_metrics_generated_exports = {};
|
|
394
|
+
var otlp_metrics_generated_exports = /* @__PURE__ */ __exportAll({});
|
|
393
395
|
|
|
394
396
|
//#endregion
|
|
395
397
|
//#region src/otlp-zod.ts
|
|
@@ -964,10 +966,50 @@ const metricsDataFilterSchema = z$1.object({
|
|
|
964
966
|
sortOrder: z$1.enum(["ASC", "DESC"]).optional().describe("Sort by timestamp. ASC = oldest first, DESC = newest first.")
|
|
965
967
|
});
|
|
966
968
|
|
|
969
|
+
//#endregion
|
|
970
|
+
//#region src/dynamic-dashboard-datasource.ts
|
|
971
|
+
var dynamic_dashboard_datasource_exports = /* @__PURE__ */ __exportAll({
|
|
972
|
+
createDashboardParams: () => createDashboardParams,
|
|
973
|
+
dashboardSchema: () => dashboardSchema,
|
|
974
|
+
regexSemverNumberedGroups: () => regexSemverNumberedGroups,
|
|
975
|
+
searchDashboardsFilter: () => searchDashboardsFilter,
|
|
976
|
+
semverSchema: () => semverSchema
|
|
977
|
+
});
|
|
978
|
+
/**
|
|
979
|
+
* https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string
|
|
980
|
+
*/
|
|
981
|
+
const regexSemverNumberedGroups = /^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;
|
|
982
|
+
const semverSchema = z$2.string().regex(regexSemverNumberedGroups).brand();
|
|
983
|
+
const dashboardSchema = z$2.object({
|
|
984
|
+
name: z$2.string(),
|
|
985
|
+
id: z$2.string(),
|
|
986
|
+
createdAt: z$2.iso.datetime(),
|
|
987
|
+
metadata: z$2.record(z$2.string(), z$2.unknown()),
|
|
988
|
+
uiTreeVersion: semverSchema,
|
|
989
|
+
uiTree: z$2.looseObject({}).describe("free-form object representing a uiTree to be rendered by @kopai/ui")
|
|
990
|
+
});
|
|
991
|
+
const createDashboardParams = z$2.object({
|
|
992
|
+
name: z$2.string(),
|
|
993
|
+
metadata: z$2.record(z$2.string(), z$2.unknown()).optional().default({}),
|
|
994
|
+
uiTreeVersion: semverSchema,
|
|
995
|
+
uiTree: z$2.looseObject({}).describe("free-form object representing a uiTree to be rendered by @kopai/ui")
|
|
996
|
+
});
|
|
997
|
+
const searchDashboardsFilter = z$2.object({
|
|
998
|
+
name: z$2.string().optional(),
|
|
999
|
+
createdAtMin: z$2.iso.datetime().optional(),
|
|
1000
|
+
createdAtMax: z$2.iso.datetime().optional(),
|
|
1001
|
+
uiTreeVersion: semverSchema.optional(),
|
|
1002
|
+
uiTreeVersionCompatible: semverSchema.optional(),
|
|
1003
|
+
metadata: z$2.record(z$2.string(), z$2.string()).optional(),
|
|
1004
|
+
limit: z$2.number().int().min(1).max(1e3).optional().default(100),
|
|
1005
|
+
cursor: z$2.string().optional(),
|
|
1006
|
+
sortOrder: z$2.enum(["ASC", "DESC"]).optional().default("DESC")
|
|
1007
|
+
});
|
|
1008
|
+
|
|
967
1009
|
//#endregion
|
|
968
1010
|
//#region src/index.ts
|
|
969
1011
|
const name = "@kopai/core";
|
|
970
1012
|
|
|
971
1013
|
//#endregion
|
|
972
|
-
export { data_filters_zod_exports as dataFilterSchemas, telemetry_datasource_exports as datasource, denormalized_signals_zod_exports as denormalizedSignals, name, otlp_generated_exports as otlp, otlp_metrics_generated_exports as otlpMetrics, otlp_metrics_zod_exports as otlpMetricsZod, otlp_zod_exports as otlpZod };
|
|
1014
|
+
export { dynamic_dashboard_datasource_exports as dashboardDatasource, data_filters_zod_exports as dataFilterSchemas, telemetry_datasource_exports as datasource, denormalized_signals_zod_exports as denormalizedSignals, name, otlp_generated_exports as otlp, otlp_metrics_generated_exports as otlpMetrics, otlp_metrics_zod_exports as otlpMetricsZod, otlp_zod_exports as otlpZod };
|
|
973
1015
|
//# sourceMappingURL=index.mjs.map
|