@deadair/sdk 0.69.1 → 0.70.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.
@@ -0,0 +1,17 @@
1
+ import type { SdkFetch } from '../sdk-options.js';
2
+ import type { MetricNames, MetricSeriesPage, MetricSeriesQuery } from './types/metrics.types.js';
3
+ export declare class MetricsClient {
4
+ private fetch;
5
+ constructor(fetch: SdkFetch);
6
+ /**
7
+ * @name Read metric series
8
+ * @description Trends over a range, at minute resolution for two days or less and hourly beyond
9
+ */
10
+ readMetricSeries(query?: MetricSeriesQuery): Promise<MetricSeriesPage>;
11
+ /**
12
+ * @name Read metric names
13
+ * @description Every metric the station holds, with its labels and when it was last measured
14
+ */
15
+ readMetricNames(): Promise<MetricNames>;
16
+ }
17
+ //# sourceMappingURL=metrics.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics.client.d.ts","sourceRoot":"","sources":["../../src/metrics/metrics.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,WAAW,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAGjG,qBAAa,aAAa;IACV,OAAO,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAEnC;;;OAGG;IACG,gBAAgB,CAAC,KAAK,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAQ5E;;;OAGG;IACG,eAAe,IAAI,OAAO,CAAC,WAAW,CAAC;CAIhD"}
@@ -0,0 +1,2 @@
1
+ export * from './metrics.types.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/metrics/types/index.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAC"}
@@ -0,0 +1,115 @@
1
+ import { DateTime } from 'luxon';
2
+ /**
3
+ * How wide one point is. Chosen by the station from the range asked for: minutes for two days or less, hours beyond
4
+ * generated from [MetricResolution](../../../../../apps/api/data/contracts/metrics/metrics.types.ck)
5
+ */
6
+ export type MetricResolution = 'minute' | 'hour';
7
+ /**
8
+ * The trends to read, over one range
9
+ * generated from [MetricSeriesQuery](../../../../../apps/api/data/contracts/metrics/metrics.types.ck)
10
+ */
11
+ export interface MetricSeriesQuery {
12
+ /** Comma-separated metric names, at most twenty: `station.listeners,work.job.ms` */
13
+ names: string;
14
+ /** The start of the range, inclusive */
15
+ from: DateTime;
16
+ /** The end of the range, exclusive. At most four hundred days after `from` */
17
+ to: DateTime;
18
+ }
19
+ /** Rehydrates every wire-encoded scalar in a MetricSeriesQuery into its runtime type. Mutates and returns `raw`. */
20
+ export declare function reviveMetricSeriesQuery(raw: MetricSeriesQuery): MetricSeriesQuery;
21
+ /**
22
+ * One series over one minute or hour
23
+ * generated from [MetricPoint](../../../../../apps/api/data/contracts/metrics/metrics.types.ck)
24
+ */
25
+ export interface MetricPoint {
26
+ /** The start of the minute or hour */
27
+ at: DateTime;
28
+ /** How many observations were folded in */
29
+ count: number;
30
+ /** Their total: a counter's value, or with `count` a duration's mean */
31
+ sum: number;
32
+ /** The smallest observation */
33
+ min: number;
34
+ /** The largest observation: a duration's worst */
35
+ max: number;
36
+ /** The latest observation: a gauge's value */
37
+ last: number;
38
+ }
39
+ /** Rehydrates every wire-encoded scalar in a MetricPoint into its runtime type. Mutates and returns `raw`. */
40
+ export declare function reviveMetricPoint(raw: MetricPoint): MetricPoint;
41
+ /**
42
+ * A metric the station holds, for a picker
43
+ * generated from [MetricName](../../../../../apps/api/data/contracts/metrics/metrics.types.ck)
44
+ */
45
+ export interface MetricName {
46
+ name: string;
47
+ source: string;
48
+ /** Every label any of its series carries, sorted */
49
+ labelKeys: string[];
50
+ /** The newest point held for it, at either resolution */
51
+ lastSeen: DateTime;
52
+ }
53
+ /** Rehydrates every wire-encoded scalar in a MetricName into its runtime type. Mutates and returns `raw`. */
54
+ export declare function reviveMetricName(raw: MetricName): MetricName;
55
+ /**
56
+ * An OTLP/HTTP metrics export, sent as JSON. Only the top level is checked here; the station reads the rest itself and counts what it cannot use rather than refusing the whole request
57
+ * generated from [OtlpMetricsExport](../../../../../apps/api/data/contracts/metrics/metrics.types.ck)
58
+ */
59
+ export interface OtlpMetricsExport {
60
+ resourceMetrics: Record<string, unknown>[];
61
+ }
62
+ /**
63
+ * OTLP's answer when some points were not taken
64
+ * generated from [OtlpPartialSuccess](../../../../../apps/api/data/contracts/metrics/metrics.types.ck)
65
+ */
66
+ export interface OtlpPartialSuccess {
67
+ /** How many, as OTLP writes a 64-bit count: a digit string */
68
+ rejectedDataPoints: string;
69
+ errorMessage: string;
70
+ }
71
+ /**
72
+ * One metric and one set of labels, its points oldest first
73
+ * generated from [MetricSeries](../../../../../apps/api/data/contracts/metrics/metrics.types.ck)
74
+ */
75
+ export interface MetricSeries {
76
+ name: string;
77
+ /** What tells this series from the metric's others: `{ "queue": "catalog.sync" }`. Empty for a metric with one series */
78
+ labels: Record<string, string>;
79
+ /** `station` for what the station measured itself, `otlp` for what another service sent it */
80
+ source: string;
81
+ /** Only the buckets that hold something. A gap is a stretch nothing was measured, which a chart should draw as a gap */
82
+ points: MetricPoint[];
83
+ }
84
+ /** Rehydrates every wire-encoded scalar in a MetricSeries into its runtime type. Mutates and returns `raw`. */
85
+ export declare function reviveMetricSeries(raw: MetricSeries): MetricSeries;
86
+ /**
87
+ * generated from [MetricNames](../../../../../apps/api/data/contracts/metrics/metrics.types.ck)
88
+ */
89
+ export interface MetricNames {
90
+ /** Sorted by name */
91
+ names: MetricName[];
92
+ }
93
+ /** Rehydrates every wire-encoded scalar in a MetricNames into its runtime type. Mutates and returns `raw`. */
94
+ export declare function reviveMetricNames(raw: MetricNames): MetricNames;
95
+ /**
96
+ * OTLP's answer to an export. Empty when every point was taken
97
+ * generated from [OtlpExportResponse](../../../../../apps/api/data/contracts/metrics/metrics.types.ck)
98
+ */
99
+ export interface OtlpExportResponse {
100
+ partialSuccess?: OtlpPartialSuccess;
101
+ }
102
+ /**
103
+ * generated from [MetricSeriesPage](../../../../../apps/api/data/contracts/metrics/metrics.types.ck)
104
+ */
105
+ export interface MetricSeriesPage {
106
+ /** The width the points were read at */
107
+ resolution: MetricResolution;
108
+ from: DateTime;
109
+ to: DateTime;
110
+ /** Empty when nothing was measured in the range, which is not an error */
111
+ series: MetricSeries[];
112
+ }
113
+ /** Rehydrates every wire-encoded scalar in a MetricSeriesPage into its runtime type. Mutates and returns `raw`. */
114
+ export declare function reviveMetricSeriesPage(raw: MetricSeriesPage): MetricSeriesPage;
115
+ //# sourceMappingURL=metrics.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metrics.types.d.ts","sourceRoot":"","sources":["../../../src/metrics/types/metrics.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAUjC;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEjD;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAC9B,oFAAoF;IACpF,KAAK,EAAE,MAAM,CAAC;IACd,wCAAwC;IACxC,IAAI,EAAE,QAAQ,CAAC;IACf,8EAA8E;IAC9E,EAAE,EAAE,QAAQ,CAAC;CAChB;AAED,oHAAoH;AACpH,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,iBAAiB,GAAG,iBAAiB,CAKjF;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IACxB,sCAAsC;IACtC,EAAE,EAAE,QAAQ,CAAC;IACb,2CAA2C;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,wEAAwE;IACxE,GAAG,EAAE,MAAM,CAAC;IACZ,+BAA+B;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,kDAAkD;IAClD,GAAG,EAAE,MAAM,CAAC;IACZ,8CAA8C;IAC9C,IAAI,EAAE,MAAM,CA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AwC;IACxC,UAAU,EAAE,gBAAgB,CAAC;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,EAAE,EAAE,QAAQ,CAAC;IACb,0EAA0E;IAC1E,MAAM,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED,mHAAmH;AACnH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,gBAAgB,GAAG,gBAAgB,CAW9E"}
@@ -3,7 +3,7 @@ import type { ConfigFieldDescriptor } from '../../plugins/types/plugins.types.js
3
3
  * Which part of the console owns a setting. Every one of these but `schedule`, `personas`, `phrasings` and `providers` is a section of the settings page; `schedule` is edited on the schedule page, beside the timetable it describes, `personas` on the characters page, beside the names it stands behind, `phrasings` on the Voice page's Phrasings tab, beside everything else about what the station says, and `providers` on the Providers section, which draws each capability beside the plugins that answer it rather than as a form of text fields.
4
4
  * generated from [SettingGroup](../../../../../apps/api/data/contracts/settings/settings.types.ck)
5
5
  */
6
- export type SettingGroup = 'station' | 'stream' | 'housekeeping' | 'mail' | 'signin' | 'rotation' | 'breaks' | 'bulletins' | 'playout' | 'render' | 'llm' | 'analysis' | 'schedule' | 'personas' | 'phrasings' | 'providers';
6
+ export type SettingGroup = 'station' | 'stream' | 'housekeeping' | 'mail' | 'signin' | 'telemetry' | 'rotation' | 'breaks' | 'bulletins' | 'playout' | 'render' | 'llm' | 'analysis' | 'schedule' | 'personas' | 'phrasings' | 'providers';
7
7
  /**
8
8
  * A submitted settings form. Partial: a key that is present is written, a key that is absent is left
9
9
  * alone, so a console may send one field. A secret submitted blank clears it
@@ -1 +1 @@
1
- {"version":3,"file":"settings.types.d.ts","sourceRoot":"","sources":["../../../src/settings/types/settings.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAElF;;;GAGG;AACH,MAAM,MAAM,YAAY,GAClB,SAAS,GACT,QAAQ,GACR,cAAc,GACd,MAAM,GACN,QAAQ,GACR,UAAU,GACV,QAAQ,GACR,WAA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AO,CAAC,CAAC;IAChC,kGAAkG;IAClG,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,6wBAA6wB;IAC7wB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC"}
1
+ {"version":3,"file":"settings.types.d.ts","sourceRoot":"","sources":["../../../src/settings/types/settings.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAElF;;;GAGG;AACH,MAAM,MAAM,YAAY,GAClB,SAAS,GACT,QAAQ,GACR,cAAc,GACd,MAAM,GACN,QAAQ,GACR,WAAW,GACX,UAAU,GACV,QAAQ,GACR,WAAW,GACX,SAAS,GACT,QAAQ,GACR,KAAK,GACL,UAAU,GACV,UAAU,GACV,UAAU,GACV,WAAW,GACX,WAAW,CAAC;AAElB;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAChC,qBAAqB;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,gCAAgC;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,0EAA0E;IAC1E,EAAE,EAAE,OAAO,CAAC;IACZ,sDAAsD;IACtD,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACnC,6HAA6H;IAC7H,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC;CAC9B;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAC9B,uBAAuB;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,8KAA8K;IAC9K,UAAU,EAAE,OAAO,CAAC;IACpB,wGAAwG;IACxG,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,MAAM,WAAW,wBAAyB,SAAQ,qBAAqB;IACnE,KAAK,EAAE,YAAY,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACjC,uCAAuC;IACvC,SAAS,EAAE,mBAAmB,EAAE,CAAC;IACjC,gJAAgJ;IAChJ,QAAQ,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC5B,WAAW,EAAE,wBAAwB,EAAE,CAAC;IACxC,mFAAmF;IACnF,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,kGAAkG;IAClG,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,6wBAA6wB;IAC7wB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deadair/sdk",
3
- "version": "0.69.1",
3
+ "version": "0.70.1",
4
4
  "description": "A typed client for the deadair station's HTTP API, generated from the same contracts the station serves.",
5
5
  "keywords": [
6
6
  "deadair",