@deadair/sdk 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/LICENSE +21 -0
- package/README.md +109 -0
- package/dist/activity/activity.client.d.ts +12 -0
- package/dist/activity/activity.client.d.ts.map +1 -0
- package/dist/activity/types/activity.types.d.ts +60 -0
- package/dist/activity/types/activity.types.d.ts.map +1 -0
- package/dist/activity/types/index.d.ts +2 -0
- package/dist/activity/types/index.d.ts.map +1 -0
- package/dist/art/art.client.d.ts +21 -0
- package/dist/art/art.client.d.ts.map +1 -0
- package/dist/authentication/authentication.client.d.ts +33 -0
- package/dist/authentication/authentication.client.d.ts.map +1 -0
- package/dist/authentication/authentication.factor.client.d.ts +41 -0
- package/dist/authentication/authentication.factor.client.d.ts.map +1 -0
- package/dist/authentication/authentication.sessions.client.d.ts +20 -0
- package/dist/authentication/authentication.sessions.client.d.ts.map +1 -0
- package/dist/authentication/types/authentication.types.d.ts +846 -0
- package/dist/authentication/types/authentication.types.d.ts.map +1 -0
- package/dist/authentication/types/index.d.ts +3 -0
- package/dist/authentication/types/index.d.ts.map +1 -0
- package/dist/authentication/types/registration.types.d.ts +336 -0
- package/dist/authentication/types/registration.types.d.ts.map +1 -0
- package/dist/catalog/catalog.client.d.ts +96 -0
- package/dist/catalog/catalog.client.d.ts.map +1 -0
- package/dist/catalog/types/catalog.types.d.ts +593 -0
- package/dist/catalog/types/catalog.types.d.ts.map +1 -0
- package/dist/catalog/types/index.d.ts +2 -0
- package/dist/catalog/types/index.d.ts.map +1 -0
- package/dist/charts/charts.client.d.ts +17 -0
- package/dist/charts/charts.client.d.ts.map +1 -0
- package/dist/charts/types/charts.types.d.ts +54 -0
- package/dist/charts/types/charts.types.d.ts.map +1 -0
- package/dist/charts/types/index.d.ts +2 -0
- package/dist/charts/types/index.d.ts.map +1 -0
- package/dist/deadair.sdk.d.ts +49 -0
- package/dist/deadair.sdk.d.ts.map +1 -0
- package/dist/director/director.client.d.ts +98 -0
- package/dist/director/director.client.d.ts.map +1 -0
- package/dist/director/types/clock.types.d.ts +57 -0
- package/dist/director/types/clock.types.d.ts.map +1 -0
- package/dist/director/types/director.types.d.ts +212 -0
- package/dist/director/types/director.types.d.ts.map +1 -0
- package/dist/director/types/index.d.ts +3 -0
- package/dist/director/types/index.d.ts.map +1 -0
- package/dist/history/history.client.d.ts +12 -0
- package/dist/history/history.client.d.ts.map +1 -0
- package/dist/history/types/history.types.d.ts +44 -0
- package/dist/history/types/history.types.d.ts.map +1 -0
- package/dist/history/types/index.d.ts +2 -0
- package/dist/history/types/index.d.ts.map +1 -0
- package/dist/index.d.ts +49 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3509 -0
- package/dist/index.js.map +1 -0
- package/dist/news/news.client.d.ts +17 -0
- package/dist/news/news.client.d.ts.map +1 -0
- package/dist/news/types/index.d.ts +2 -0
- package/dist/news/types/index.d.ts.map +1 -0
- package/dist/news/types/news.types.d.ts +61 -0
- package/dist/news/types/news.types.d.ts.map +1 -0
- package/dist/nowplaying/nowplaying.client.d.ts +12 -0
- package/dist/nowplaying/nowplaying.client.d.ts.map +1 -0
- package/dist/nowplaying/types/index.d.ts +2 -0
- package/dist/nowplaying/types/index.d.ts.map +1 -0
- package/dist/nowplaying/types/nowplaying.types.d.ts +59 -0
- package/dist/nowplaying/types/nowplaying.types.d.ts.map +1 -0
- package/dist/onboarding/onboarding.client.d.ts +11 -0
- package/dist/onboarding/onboarding.client.d.ts.map +1 -0
- package/dist/onboarding/types/index.d.ts +2 -0
- package/dist/onboarding/types/index.d.ts.map +1 -0
- package/dist/onboarding/types/onboarding.types.d.ts +41 -0
- package/dist/onboarding/types/onboarding.types.d.ts.map +1 -0
- package/dist/personas/personas.client.d.ts +167 -0
- package/dist/personas/personas.client.d.ts.map +1 -0
- package/dist/personas/types/index.d.ts +2 -0
- package/dist/personas/types/index.d.ts.map +1 -0
- package/dist/personas/types/personas.types.d.ts +545 -0
- package/dist/personas/types/personas.types.d.ts.map +1 -0
- package/dist/playlists/playlists.client.d.ts +17 -0
- package/dist/playlists/playlists.client.d.ts.map +1 -0
- package/dist/playlists/types/index.d.ts +2 -0
- package/dist/playlists/types/index.d.ts.map +1 -0
- package/dist/playlists/types/playlists.types.d.ts +71 -0
- package/dist/playlists/types/playlists.types.d.ts.map +1 -0
- package/dist/playout/playout.client.d.ts +37 -0
- package/dist/playout/playout.client.d.ts.map +1 -0
- package/dist/playout/types/index.d.ts +2 -0
- package/dist/playout/types/index.d.ts.map +1 -0
- package/dist/playout/types/playout.types.d.ts +163 -0
- package/dist/playout/types/playout.types.d.ts.map +1 -0
- package/dist/plugins/plugins.client.d.ts +107 -0
- package/dist/plugins/plugins.client.d.ts.map +1 -0
- package/dist/plugins/types/index.d.ts +2 -0
- package/dist/plugins/types/index.d.ts.map +1 -0
- package/dist/plugins/types/plugins.types.d.ts +330 -0
- package/dist/plugins/types/plugins.types.d.ts.map +1 -0
- package/dist/productions/productions.client.d.ts +22 -0
- package/dist/productions/productions.client.d.ts.map +1 -0
- package/dist/productions/types/index.d.ts +2 -0
- package/dist/productions/types/index.d.ts.map +1 -0
- package/dist/productions/types/productions.types.d.ts +90 -0
- package/dist/productions/types/productions.types.d.ts.map +1 -0
- package/dist/render/render.client.d.ts +210 -0
- package/dist/render/render.client.d.ts.map +1 -0
- package/dist/render/types/index.d.ts +2 -0
- package/dist/render/types/index.d.ts.map +1 -0
- package/dist/render/types/render.types.d.ts +518 -0
- package/dist/render/types/render.types.d.ts.map +1 -0
- package/dist/schedule/schedule.client.d.ts +37 -0
- package/dist/schedule/schedule.client.d.ts.map +1 -0
- package/dist/schedule/types/index.d.ts +2 -0
- package/dist/schedule/types/index.d.ts.map +1 -0
- package/dist/schedule/types/schedule.types.d.ts +119 -0
- package/dist/schedule/types/schedule.types.d.ts.map +1 -0
- package/dist/sdk-options.d.ts +45 -0
- package/dist/sdk-options.d.ts.map +1 -0
- package/dist/settings/settings.client.d.ts +17 -0
- package/dist/settings/settings.client.d.ts.map +1 -0
- package/dist/settings/types/index.d.ts +2 -0
- package/dist/settings/types/index.d.ts.map +1 -0
- package/dist/settings/types/settings.types.d.ts +35 -0
- package/dist/settings/types/settings.types.d.ts.map +1 -0
- package/dist/shared/types/index.d.ts +2 -0
- package/dist/shared/types/index.d.ts.map +1 -0
- package/dist/shared/types/pagination.d.ts +34 -0
- package/dist/shared/types/pagination.d.ts.map +1 -0
- package/dist/station/station.client.d.ts +49 -0
- package/dist/station/station.client.d.ts.map +1 -0
- package/dist/station/types/index.d.ts +4 -0
- package/dist/station/types/index.d.ts.map +1 -0
- package/dist/station/types/logs.types.d.ts +73 -0
- package/dist/station/types/logs.types.d.ts.map +1 -0
- package/dist/station/types/station.types.d.ts +120 -0
- package/dist/station/types/station.types.d.ts.map +1 -0
- package/dist/station/types/traces.types.d.ts +91 -0
- package/dist/station/types/traces.types.d.ts.map +1 -0
- package/dist/storage/storage.client.d.ts +12 -0
- package/dist/storage/storage.client.d.ts.map +1 -0
- package/dist/storage/types/index.d.ts +2 -0
- package/dist/storage/types/index.d.ts.map +1 -0
- package/dist/storage/types/storage.types.d.ts +59 -0
- package/dist/storage/types/storage.types.d.ts.map +1 -0
- package/dist/stream/stream.client.d.ts +32 -0
- package/dist/stream/stream.client.d.ts.map +1 -0
- package/dist/stream/types/index.d.ts +2 -0
- package/dist/stream/types/index.d.ts.map +1 -0
- package/dist/stream/types/stream.types.d.ts +47 -0
- package/dist/stream/types/stream.types.d.ts.map +1 -0
- package/dist/topics/topics.client.d.ts +32 -0
- package/dist/topics/topics.client.d.ts.map +1 -0
- package/dist/topics/types/index.d.ts +2 -0
- package/dist/topics/types/index.d.ts.map +1 -0
- package/dist/topics/types/topics.types.d.ts +65 -0
- package/dist/topics/types/topics.types.d.ts.map +1 -0
- package/package.json +53 -0
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { DateTime } from 'luxon';
|
|
2
|
+
/**
|
|
3
|
+
* Whether a call produced what it was asked for. Two values on purpose: every finer distinction —
|
|
4
|
+
* timed out, was preempted, came back empty — is a fact the caller knew and the recorder did not, so
|
|
5
|
+
* it lives in `detail` where it can be named
|
|
6
|
+
* generated from [TraceOutcome](../../../../../apps/api/data/contracts/station/traces.types.ck#L10)
|
|
7
|
+
*/
|
|
8
|
+
export type TraceOutcome = 'ok' | 'failed';
|
|
9
|
+
/**
|
|
10
|
+
* One decision, folded: a job execution or a request
|
|
11
|
+
* generated from [TraceDecision](../../../../../apps/api/data/contracts/station/traces.types.ck#L22)
|
|
12
|
+
*/
|
|
13
|
+
export interface TraceDecision {
|
|
14
|
+
/** The job id or the request id. Already the station's correlation id, never generated for this */
|
|
15
|
+
id: string;
|
|
16
|
+
/** A queue name, or a method and path */
|
|
17
|
+
kind: string;
|
|
18
|
+
/** The decision that enqueued this one. Absent on a request, a cron job and anything at boot */
|
|
19
|
+
parent?: string;
|
|
20
|
+
/** When its first recorded call ended */
|
|
21
|
+
at: DateTime;
|
|
22
|
+
/** Wall clock, off the `job.run` span. Zero for a decision recorded before that span existed */
|
|
23
|
+
ms: number;
|
|
24
|
+
/** Everything it did, not counting the `job.run` that contains them */
|
|
25
|
+
calls: number;
|
|
26
|
+
/** How many of those did not produce what they were asked for */
|
|
27
|
+
failed: number;
|
|
28
|
+
}
|
|
29
|
+
/** Rehydrates every wire-encoded scalar in a TraceDecision into its runtime type. Mutates and returns `raw`. */
|
|
30
|
+
export declare function reviveTraceDecision(raw: TraceDecision): TraceDecision;
|
|
31
|
+
/**
|
|
32
|
+
* Which slice of the kept window to read
|
|
33
|
+
* generated from [TracesQuery](../../../../../apps/api/data/contracts/station/traces.types.ck#L32)
|
|
34
|
+
*/
|
|
35
|
+
export interface TracesQuery {
|
|
36
|
+
limit?: number;
|
|
37
|
+
/** An exact queue name or route, for reading one kind of decision on its own */
|
|
38
|
+
kind?: string;
|
|
39
|
+
/** Only decisions carrying at least one failed call */
|
|
40
|
+
failedOnly?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* One call inside a decision, and what it cost
|
|
44
|
+
* generated from [TraceSpan](../../../../../apps/api/data/contracts/station/traces.types.ck#L12)
|
|
45
|
+
*/
|
|
46
|
+
export interface TraceSpan {
|
|
47
|
+
/** When the call ended, which is when its cost was known */
|
|
48
|
+
at: DateTime;
|
|
49
|
+
/** Dotted and stable: `job.run`, `plugin.invoke`, `llm.generate` */
|
|
50
|
+
op: string;
|
|
51
|
+
/** Which one: a plugin and its method, or a model */
|
|
52
|
+
target?: string;
|
|
53
|
+
/** How long it held, measured around the call rather than reported by it */
|
|
54
|
+
ms: number;
|
|
55
|
+
outcome: TraceOutcome;
|
|
56
|
+
/** The failure, summarized to a shape rather than a stack */
|
|
57
|
+
error?: string;
|
|
58
|
+
/** Whatever this `op` is worth reading back: tokens, a finish reason, the bound it was given */
|
|
59
|
+
detail?: Record<string, unknown>;
|
|
60
|
+
}
|
|
61
|
+
/** Rehydrates every wire-encoded scalar in a TraceSpan into its runtime type. Mutates and returns `raw`. */
|
|
62
|
+
export declare function reviveTraceSpan(raw: TraceSpan): TraceSpan;
|
|
63
|
+
/**
|
|
64
|
+
* generated from [TracesPage](../../../../../apps/api/data/contracts/station/traces.types.ck#L38)
|
|
65
|
+
*/
|
|
66
|
+
export interface TracesPage {
|
|
67
|
+
/** Newest first */
|
|
68
|
+
decisions: TraceDecision[];
|
|
69
|
+
/** How many the window holds before `limit`, so a page can say it is showing a slice */
|
|
70
|
+
total: number;
|
|
71
|
+
/** How many calls were read to answer, which is the honest cost of this page */
|
|
72
|
+
spans: number;
|
|
73
|
+
}
|
|
74
|
+
/** Rehydrates every wire-encoded scalar in a TracesPage into its runtime type. Mutates and returns `raw`. */
|
|
75
|
+
export declare function reviveTracesPage(raw: TracesPage): TracesPage;
|
|
76
|
+
/**
|
|
77
|
+
* One decision, its calls, and the decisions on either side of it
|
|
78
|
+
* generated from [TraceDetail](../../../../../apps/api/data/contracts/station/traces.types.ck#L44)
|
|
79
|
+
*/
|
|
80
|
+
export interface TraceDetail {
|
|
81
|
+
decision: TraceDecision;
|
|
82
|
+
/** In the order they happened */
|
|
83
|
+
spans: TraceSpan[];
|
|
84
|
+
/** What enqueued this, when that decision is still inside the kept window */
|
|
85
|
+
parent?: TraceDecision;
|
|
86
|
+
/** What this one went on to enqueue */
|
|
87
|
+
caused: TraceDecision[];
|
|
88
|
+
}
|
|
89
|
+
/** Rehydrates every wire-encoded scalar in a TraceDetail into its runtime type. Mutates and returns `raw`. */
|
|
90
|
+
export declare function reviveTraceDetail(raw: TraceDetail): TraceDetail;
|
|
91
|
+
//# sourceMappingURL=traces.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traces.types.d.ts","sourceRoot":"","sources":["../../../src/station/types/traces.types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAYjC;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,IAAI,GAAG,QAAQ,CAAC;AAE3C;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC1B,mGAAmG;IACnG,EAAE,EAAE,MAAM,CAAC;IACX,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,gGAAgG;IAChG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,EAAE,EAAE,QAAQ,CAAC;IACb,gGAAgG;IAChG,EAAE,EAAE,MAAM,CAAC;IACX,uEAAuE;IACvE,KAAK,EAAE,MAAM,CAAC;IACd,iEAAiE;IACjE,MAAM,EAAE,MAAM,CAAC;CAClB;AAED,gHAAgH;AAChH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,aAAa,CAIrE;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gFAAgF;IAChF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uDAAuD;IACvD,UAAU,CAAC,EAAE,OAAO,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACtB,4DAA4D;IAC5D,EAAE,EAAE,QAAQ,CAAC;IACb,oEAAoE;IACpE,EAAE,EAAE,MAAM,CAAC;IACX,qDAAqD;IACrD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4EAA4E;IAC5E,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,YAAY,CAAC;IACtB,6DAA6D;IAC7D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gGAAgG;IAChG,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,4GAA4G;AAC5G,wBAAgB,eAAe,CAAC,GAAG,EAAE,SAAS,GAAG,SAAS,CAIzD;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB,mBAAmB;IACnB,SAAS,EAAE,aAAa,EAAE,CAAC;IAC3B,wFAAwF;IACxF,KAAK,EAAE,MAAM,CAAC;IACd,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,6GAA6G;AAC7G,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,UAAU,GAAG,UAAU,CAS5D;AAED;;;GAGG;AACH,MAAM,WAAW,WAAW;IACxB,QAAQ,EAAE,aAAa,CAAC;IACxB,iCAAiC;IACjC,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,6EAA6E;IAC7E,MAAM,CAAC,EAAE,aAAa,CAAC;IACvB,uCAAuC;IACvC,MAAM,EAAE,aAAa,EAAE,CAAC;CAC3B;AAED,8GAA8G;AAC9G,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,WAAW,GAAG,WAAW,CAmB/D"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SdkFetch } from '../sdk-options.js';
|
|
2
|
+
import type { StorageReport } from './types/storage.types.js';
|
|
3
|
+
export declare class StorageClient {
|
|
4
|
+
private fetch;
|
|
5
|
+
constructor(fetch: SdkFetch);
|
|
6
|
+
/**
|
|
7
|
+
* @name Read storage
|
|
8
|
+
* @description What is on disk, per store, against what the database says should be
|
|
9
|
+
*/
|
|
10
|
+
readStorage(): Promise<StorageReport>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=storage.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.client.d.ts","sourceRoot":"","sources":["../../src/storage/storage.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAG9D,qBAAa,aAAa;IACV,OAAO,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAEnC;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,aAAa,CAAC;CAI9C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/storage/types/index.ts"],"names":[],"mappings":"AACA,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { DateTime } from 'luxon';
|
|
2
|
+
/**
|
|
3
|
+
* Which store, as a stable id the console can key off rather than a name it renders.
|
|
4
|
+
* generated from [StorageStoreId](../../../../../apps/api/data/contracts/storage/storage.types.ck#L8)
|
|
5
|
+
*/
|
|
6
|
+
export type StorageStoreId = 'tracks' | 'art' | 'segments' | 'voices';
|
|
7
|
+
/**
|
|
8
|
+
* One content store: what is on disk, and what the database says should be.
|
|
9
|
+
*
|
|
10
|
+
* The two halves are deliberately separate numbers rather than one reconciled figure. They disagree
|
|
11
|
+
* in two directions and each direction means something different — a file nothing claims is what a
|
|
12
|
+
* crash between writing bytes and writing a row leaves behind, and a row whose file is gone is what
|
|
13
|
+
* an operator emptying a directory leaves. Reporting one number would hide both.
|
|
14
|
+
* generated from [StorageStore](../../../../../apps/api/data/contracts/storage/storage.types.ck#L16)
|
|
15
|
+
*/
|
|
16
|
+
export interface StorageStore {
|
|
17
|
+
id: StorageStoreId;
|
|
18
|
+
/** What to call it on a page */
|
|
19
|
+
label: string;
|
|
20
|
+
/** Where it is, so `du` and this can be compared */
|
|
21
|
+
path: string;
|
|
22
|
+
/** Files actually there */
|
|
23
|
+
files: number;
|
|
24
|
+
/** What they weigh */
|
|
25
|
+
bytes: number;
|
|
26
|
+
/** Rows pointing at a file. Absent when no table backs this store */
|
|
27
|
+
rows?: number;
|
|
28
|
+
/** What those rows say those files weigh. Absent where the table does not record a size */
|
|
29
|
+
accountedBytes?: number;
|
|
30
|
+
/** The limit an operator set, where the store has one. Absent means no limit */
|
|
31
|
+
capBytes?: number;
|
|
32
|
+
/** Files no row claims. Reported and never cleaned up automatically */
|
|
33
|
+
orphanFiles: number;
|
|
34
|
+
orphanBytes: number;
|
|
35
|
+
/** Claims whose file is not there. The station re-fetches or re-renders these */
|
|
36
|
+
rowsWithNoFile: number;
|
|
37
|
+
}
|
|
38
|
+
export interface StorageStoreInput {
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Every store, plus the number an operator actually wants first.
|
|
42
|
+
*
|
|
43
|
+
* `readAt` is not decoration: the figures come from walking directories, which is real I/O on a
|
|
44
|
+
* station holding tens of thousands of files, so the answer is cached for a short while and this is
|
|
45
|
+
* what stops a page mistaking it for live.
|
|
46
|
+
* generated from [StorageReport](../../../../../apps/api/data/contracts/storage/storage.types.ck#L35)
|
|
47
|
+
*/
|
|
48
|
+
export interface StorageReport {
|
|
49
|
+
readAt: DateTime;
|
|
50
|
+
totalFiles: number;
|
|
51
|
+
totalBytes: number;
|
|
52
|
+
stores: StorageStore[];
|
|
53
|
+
}
|
|
54
|
+
export interface StorageReportInput {
|
|
55
|
+
stores: StorageStoreInput[];
|
|
56
|
+
}
|
|
57
|
+
/** Rehydrates every wire-encoded scalar in a StorageReport into its runtime type. Mutates and returns `raw`. */
|
|
58
|
+
export declare function reviveStorageReport(raw: StorageReport): StorageReport;
|
|
59
|
+
//# sourceMappingURL=storage.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.types.d.ts","sourceRoot":"","sources":["../../../src/storage/types/storage.types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAYjC;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,KAAK,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEtE;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IACzB,EAAE,EAAE,cAAc,CAAC;IACnB,gCAAgC;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,IAAI,EAAE,MAAM,CAAC;IACb,2BAA2B;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2FAA2F;IAC3F,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,gFAAgF;IAChF,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uEAAuE;IACvE,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,iFAAiF;IACjF,cAAc,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,iBAAiB;CAAG;AAErC;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC1B,MAAM,EAAE,QAAQ,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,YAAY,EAAE,CAAC;CAC1B;AAED,MAAM,WAAW,kBAAkB;IAC/B,MAAM,EAAE,iBAAiB,EAAE,CAAC;CAC/B;AAED,gHAAgH;AAChH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,aAAa,CAIrE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { SdkFetch } from '../sdk-options.js';
|
|
2
|
+
import type { FetcherAuthorization, FetcherAuthorizationFinished, FetcherAuthorizationInput, FetcherAuthorizationStart } from './types/stream.types.js';
|
|
3
|
+
export declare class StreamClient {
|
|
4
|
+
private fetch;
|
|
5
|
+
constructor(fetch: SdkFetch);
|
|
6
|
+
/**
|
|
7
|
+
* @name Get HLS playlist
|
|
8
|
+
* @description One HLS playlist, and the tick that says somebody is still listening to it
|
|
9
|
+
*/
|
|
10
|
+
getHLSPlaylist(name: string): Promise<{
|
|
11
|
+
data: Blob;
|
|
12
|
+
headers: {
|
|
13
|
+
cacheControl?: string;
|
|
14
|
+
};
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* @name Read fetcher authorization
|
|
18
|
+
* @description What the track fetcher holds by way of a Spotify login, and whether an authorization is already waiting to be finished
|
|
19
|
+
*/
|
|
20
|
+
readFetcherAuthorization(): Promise<FetcherAuthorization>;
|
|
21
|
+
/**
|
|
22
|
+
* @name Start fetcher authorization
|
|
23
|
+
* @description Starts the fetcher's one-time authorization and answers with the URL to open. Starting another replaces whichever was pending
|
|
24
|
+
*/
|
|
25
|
+
startFetcherAuthorization(): Promise<FetcherAuthorizationStart>;
|
|
26
|
+
/**
|
|
27
|
+
* @name Finish fetcher authorization
|
|
28
|
+
* @description Finishes an authorization from the address the operator's browser ended up at
|
|
29
|
+
*/
|
|
30
|
+
finishFetcherAuthorization(body: FetcherAuthorizationInput): Promise<FetcherAuthorizationFinished>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=stream.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.client.d.ts","sourceRoot":"","sources":["../../src/stream/stream.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EACR,oBAAoB,EACpB,4BAA4B,EAC5B,yBAAyB,EACzB,yBAAyB,EAC5B,MAAM,yBAAyB,CAAC;AAEjC,qBAAa,YAAY;IACT,OAAO,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAEnC;;;OAGG;IACG,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,OAAO,EAAE;YAAE,YAAY,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;IAM/F;;;OAGG;IACG,wBAAwB,IAAI,OAAO,CAAC,oBAAoB,CAAC;IAK/D;;;OAGG;IACG,yBAAyB,IAAI,OAAO,CAAC,yBAAyB,CAAC;IAKrE;;;OAGG;IACG,0BAA0B,CAAC,IAAI,EAAE,yBAAyB,GAAG,OAAO,CAAC,4BAA4B,CAAC;CAQ3G"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/stream/types/index.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the station's track fetcher holds by way of a Spotify login
|
|
3
|
+
* generated from [FetcherAuthorization](../../../../../apps/api/data/contracts/stream/stream.types.ck#L8)
|
|
4
|
+
*/
|
|
5
|
+
export interface FetcherAuthorization {
|
|
6
|
+
/** Whether the fetcher answered at all. False makes every field below a default rather than a reading, so a fetcher that is merely down is never reported as one that was never authorized */
|
|
7
|
+
reachable: boolean;
|
|
8
|
+
/** Whether this install has a stream half yet. False means there is nothing here to authorize */
|
|
9
|
+
configured: boolean;
|
|
10
|
+
/** Whether the fetcher holds its OWN stored authorization, which is the only kind Spotify's login accepts. False with a healthy plugin above it is a station that lists playlists perfectly and cannot fetch a single record */
|
|
11
|
+
authorized: boolean;
|
|
12
|
+
/** Whether a login is established right now */
|
|
13
|
+
session: boolean;
|
|
14
|
+
/** The last reason a login was refused. Present is not the same as fatal: a session may have recovered since */
|
|
15
|
+
loginError?: string;
|
|
16
|
+
/** An authorization already started and not yet finished, so an operator who lost the URL is given it back rather than having to start again */
|
|
17
|
+
pendingUrl?: string;
|
|
18
|
+
/** The address the browser will be sent to and will not be able to load. Reported so the console can say which page is expected to fail, rather than leaving that looking like a fault. Absent when the fetcher did not answer, since it is the only thing that knows it */
|
|
19
|
+
callbackUrl?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* An authorization to open in a browser
|
|
23
|
+
* generated from [FetcherAuthorizationStart](../../../../../apps/api/data/contracts/stream/stream.types.ck#L19)
|
|
24
|
+
*/
|
|
25
|
+
export interface FetcherAuthorizationStart {
|
|
26
|
+
/** The Spotify consent page, to be opened by the operator */
|
|
27
|
+
authorizeUrl: string;
|
|
28
|
+
/** How long this URL is good for. Starting another replaces it */
|
|
29
|
+
expiresInMs: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The callback the browser could not deliver, handed over by the operator instead
|
|
33
|
+
* generated from [FetcherAuthorizationInput](../../../../../apps/api/data/contracts/stream/stream.types.ck#L25)
|
|
34
|
+
*/
|
|
35
|
+
export interface FetcherAuthorizationInput {
|
|
36
|
+
/** The address the browser ended up at, pasted whole. Taken apart by the fetcher rather than here, because two readings of one address is one of them being wrong eventually */
|
|
37
|
+
redirectUrl: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Which account the station now fetches as
|
|
41
|
+
* generated from [FetcherAuthorizationFinished](../../../../../apps/api/data/contracts/stream/stream.types.ck#L30)
|
|
42
|
+
*/
|
|
43
|
+
export interface FetcherAuthorizationFinished {
|
|
44
|
+
/** The Spotify account that was authorized. Reported because an operator with two accounts in two browser profiles wants to know which one this station now is */
|
|
45
|
+
username: string;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=stream.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stream.types.d.ts","sourceRoot":"","sources":["../../../src/stream/types/stream.types.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACjC,8LAA8L;IAC9L,SAAS,EAAE,OAAO,CAAC;IACnB,iGAAiG;IACjG,UAAU,EAAE,OAAO,CAAC;IACpB,gOAAgO;IAChO,UAAU,EAAE,OAAO,CAAC;IACpB,+CAA+C;IAC/C,OAAO,EAAE,OAAO,CAAC;IACjB,gHAAgH;IAChH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gJAAgJ;IAChJ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4QAA4Q;IAC5Q,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACtC,6DAA6D;IAC7D,YAAY,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,WAAW,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACtC,gLAAgL;IAChL,WAAW,EAAE,MAAM,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,4BAA4B;IACzC,kKAAkK;IAClK,QAAQ,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { SdkFetch } from '../sdk-options.js';
|
|
2
|
+
import type { TopicInput, TopicKindList, TopicList, TopicQuery } from './types/topics.types.js';
|
|
3
|
+
export declare class TopicsClient {
|
|
4
|
+
private fetch;
|
|
5
|
+
constructor(fetch: SdkFetch);
|
|
6
|
+
/**
|
|
7
|
+
* @name List topics
|
|
8
|
+
* @description Every subject this station has named, for one sort of break or for all of them
|
|
9
|
+
*/
|
|
10
|
+
listTopics(query?: TopicQuery): Promise<TopicList>;
|
|
11
|
+
/**
|
|
12
|
+
* @name Create topic
|
|
13
|
+
* @description Names a new subject. Nothing uses it until something points at it
|
|
14
|
+
*/
|
|
15
|
+
createTopic(body: TopicInput): Promise<TopicList>;
|
|
16
|
+
/**
|
|
17
|
+
* @name List topic kinds
|
|
18
|
+
* @description Which sorts of break have subjects, and the form each one's settings are edited with
|
|
19
|
+
*/
|
|
20
|
+
listTopicKinds(): Promise<TopicKindList>;
|
|
21
|
+
/**
|
|
22
|
+
* @name Update topic
|
|
23
|
+
* @description Rewrites one subject. A break already written keeps the words it was given
|
|
24
|
+
*/
|
|
25
|
+
updateTopic(id: string, body: TopicInput): Promise<TopicList>;
|
|
26
|
+
/**
|
|
27
|
+
* @name Delete topic
|
|
28
|
+
* @description Removes a subject, and any band on the format clock that asked for it
|
|
29
|
+
*/
|
|
30
|
+
deleteTopic(id: string): Promise<TopicList>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=topics.client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topics.client.d.ts","sourceRoot":"","sources":["../../src/topics/topics.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEhG,qBAAa,YAAY;IACT,OAAO,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAEnC;;;OAGG;IACG,UAAU,CAAC,KAAK,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;IAQxD;;;OAGG;IACG,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;IASvD;;;OAGG;IACG,cAAc,IAAI,OAAO,CAAC,aAAa,CAAC;IAK9C;;;OAGG;IACG,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;IASnE;;;OAGG;IACG,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;CAIpD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/topics/types/index.ts"],"names":[],"mappings":"AACA,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { ConfigFieldDescriptor } from '../../plugins/types/plugins.types.js';
|
|
2
|
+
/**
|
|
3
|
+
* What a break can be about: a news category, and later a weather location. The operator's own vocabulary, per sort of break
|
|
4
|
+
* generated from [Topic](../../../../../apps/api/data/contracts/topics/topics.types.ck#L8)
|
|
5
|
+
*/
|
|
6
|
+
export interface Topic {
|
|
7
|
+
id: string;
|
|
8
|
+
/** Which sort of break this is a subject for, as `segments.kind` spells it */
|
|
9
|
+
kind: string;
|
|
10
|
+
/** A stable slug, unique within its kind. What the format clock points a band at and what a seeded topic is recognised by */
|
|
11
|
+
key: string;
|
|
12
|
+
/** What a break calls it out loud, so it is the phrasing you would want to hear */
|
|
13
|
+
label: string;
|
|
14
|
+
/** This sort of break's own settings for this subject, in the fields its kind declares. Nothing generic reads them */
|
|
15
|
+
config: Record<string, unknown>;
|
|
16
|
+
/** Your own order, for the list. Two subjects never contest anything, so it means nothing else */
|
|
17
|
+
position: number;
|
|
18
|
+
}
|
|
19
|
+
export interface TopicInput {
|
|
20
|
+
/** Which sort of break this is a subject for, as `segments.kind` spells it */
|
|
21
|
+
kind: string;
|
|
22
|
+
/** A stable slug, unique within its kind. What the format clock points a band at and what a seeded topic is recognised by */
|
|
23
|
+
key: string;
|
|
24
|
+
/** What a break calls it out loud, so it is the phrasing you would want to hear */
|
|
25
|
+
label: string;
|
|
26
|
+
/** This sort of break's own settings for this subject, in the fields its kind declares. Nothing generic reads them */
|
|
27
|
+
config: Record<string, unknown>;
|
|
28
|
+
/** Your own order, for the list. Two subjects never contest anything, so it means nothing else */
|
|
29
|
+
position: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A sort of break that has subjects at all, and how one of its subjects is edited. `ConfigFieldDescriptor` is the plugins area's, shared for the reason a station setting shares it: one form component renders them all
|
|
33
|
+
* generated from [TopicKindDescriptor](../../../../../apps/api/data/contracts/topics/topics.types.ck#L22)
|
|
34
|
+
*/
|
|
35
|
+
export interface TopicKindDescriptor {
|
|
36
|
+
kind: string;
|
|
37
|
+
/** What to call one of these: a news subject is a category and a weather subject is a location */
|
|
38
|
+
nounOne: string;
|
|
39
|
+
nounMany: string;
|
|
40
|
+
description: string;
|
|
41
|
+
fields: ConfigFieldDescriptor[];
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* generated from [TopicQuery](../../../../../apps/api/data/contracts/topics/topics.types.ck#L34)
|
|
45
|
+
*/
|
|
46
|
+
export interface TopicQuery {
|
|
47
|
+
/** One sort of break, or absent for every subject this station has named */
|
|
48
|
+
kind?: string;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* generated from [TopicList](../../../../../apps/api/data/contracts/topics/topics.types.ck#L17)
|
|
52
|
+
*/
|
|
53
|
+
export interface TopicList {
|
|
54
|
+
topics: Topic[];
|
|
55
|
+
}
|
|
56
|
+
export interface TopicListInput {
|
|
57
|
+
topics: TopicInput[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* generated from [TopicKindList](../../../../../apps/api/data/contracts/topics/topics.types.ck#L30)
|
|
61
|
+
*/
|
|
62
|
+
export interface TopicKindList {
|
|
63
|
+
kinds: TopicKindDescriptor[];
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=topics.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"topics.types.d.ts","sourceRoot":"","sources":["../../../src/topics/types/topics.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,sCAAsC,CAAC;AAElF;;;GAGG;AACH,MAAM,WAAW,KAAK;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,6HAA6H;IAC7H,GAAG,EAAE,MAAM,CAAC;IACZ,mFAAmF;IACnF,KAAK,EAAE,MAAM,CAAC;IACd,sHAAsH;IACtH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,kGAAkG;IAClG,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,UAAU;IACvB,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,6HAA6H;IAC7H,GAAG,EAAE,MAAM,CAAC;IACZ,mFAAmF;IACnF,KAAK,EAAE,MAAM,CAAC;IACd,sHAAsH;IACtH,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,kGAAkG;IAClG,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,kGAAkG;IAClG,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,qBAAqB,EAAE,CAAC;CACnC;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACvB,4EAA4E;IAC5E,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACtB,MAAM,EAAE,KAAK,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,cAAc;IAC3B,MAAM,EAAE,UAAU,EAAE,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC1B,KAAK,EAAE,mBAAmB,EAAE,CAAC;CAChC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@deadair/sdk",
|
|
3
|
+
"version": "0.7.0",
|
|
4
|
+
"description": "A typed client for the deadair station's HTTP API, generated from the same contracts the station serves.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"deadair",
|
|
7
|
+
"radio",
|
|
8
|
+
"sdk",
|
|
9
|
+
"client"
|
|
10
|
+
],
|
|
11
|
+
"homepage": "https://deadair.radio/docs/api-reference",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/robert-dean/deadair/issues"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/robert-dean/deadair.git",
|
|
18
|
+
"directory": "packages/sdk"
|
|
19
|
+
},
|
|
20
|
+
"type": "module",
|
|
21
|
+
"main": "./dist/index.js",
|
|
22
|
+
"module": "./dist/index.js",
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"default": "./dist/index.js"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"license": "MIT",
|
|
31
|
+
"files": [
|
|
32
|
+
"dist/**",
|
|
33
|
+
"LICENSE"
|
|
34
|
+
],
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@types/luxon": "^3.7.3",
|
|
37
|
+
"decimal.js": "^10.6.0",
|
|
38
|
+
"luxon": "^3.7.2"
|
|
39
|
+
},
|
|
40
|
+
"devDependencies": {
|
|
41
|
+
"@repo/config-eslint": "0.0.0",
|
|
42
|
+
"@repo/config-typescript": "0.0.0"
|
|
43
|
+
},
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"access": "public"
|
|
46
|
+
},
|
|
47
|
+
"scripts": {
|
|
48
|
+
"build": "tsup src/index.ts --format esm --sourcemap && tsc --emitDeclarationOnly --declaration",
|
|
49
|
+
"build:ci": "eslint --max-warnings=0 && pnpm run build",
|
|
50
|
+
"lint": "eslint --fix",
|
|
51
|
+
"format": "prettier --write . --ignore-path ../../.prettierignore"
|
|
52
|
+
}
|
|
53
|
+
}
|