@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.
Files changed (155) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +109 -0
  3. package/dist/activity/activity.client.d.ts +12 -0
  4. package/dist/activity/activity.client.d.ts.map +1 -0
  5. package/dist/activity/types/activity.types.d.ts +60 -0
  6. package/dist/activity/types/activity.types.d.ts.map +1 -0
  7. package/dist/activity/types/index.d.ts +2 -0
  8. package/dist/activity/types/index.d.ts.map +1 -0
  9. package/dist/art/art.client.d.ts +21 -0
  10. package/dist/art/art.client.d.ts.map +1 -0
  11. package/dist/authentication/authentication.client.d.ts +33 -0
  12. package/dist/authentication/authentication.client.d.ts.map +1 -0
  13. package/dist/authentication/authentication.factor.client.d.ts +41 -0
  14. package/dist/authentication/authentication.factor.client.d.ts.map +1 -0
  15. package/dist/authentication/authentication.sessions.client.d.ts +20 -0
  16. package/dist/authentication/authentication.sessions.client.d.ts.map +1 -0
  17. package/dist/authentication/types/authentication.types.d.ts +846 -0
  18. package/dist/authentication/types/authentication.types.d.ts.map +1 -0
  19. package/dist/authentication/types/index.d.ts +3 -0
  20. package/dist/authentication/types/index.d.ts.map +1 -0
  21. package/dist/authentication/types/registration.types.d.ts +336 -0
  22. package/dist/authentication/types/registration.types.d.ts.map +1 -0
  23. package/dist/catalog/catalog.client.d.ts +96 -0
  24. package/dist/catalog/catalog.client.d.ts.map +1 -0
  25. package/dist/catalog/types/catalog.types.d.ts +593 -0
  26. package/dist/catalog/types/catalog.types.d.ts.map +1 -0
  27. package/dist/catalog/types/index.d.ts +2 -0
  28. package/dist/catalog/types/index.d.ts.map +1 -0
  29. package/dist/charts/charts.client.d.ts +17 -0
  30. package/dist/charts/charts.client.d.ts.map +1 -0
  31. package/dist/charts/types/charts.types.d.ts +54 -0
  32. package/dist/charts/types/charts.types.d.ts.map +1 -0
  33. package/dist/charts/types/index.d.ts +2 -0
  34. package/dist/charts/types/index.d.ts.map +1 -0
  35. package/dist/deadair.sdk.d.ts +49 -0
  36. package/dist/deadair.sdk.d.ts.map +1 -0
  37. package/dist/director/director.client.d.ts +98 -0
  38. package/dist/director/director.client.d.ts.map +1 -0
  39. package/dist/director/types/clock.types.d.ts +57 -0
  40. package/dist/director/types/clock.types.d.ts.map +1 -0
  41. package/dist/director/types/director.types.d.ts +212 -0
  42. package/dist/director/types/director.types.d.ts.map +1 -0
  43. package/dist/director/types/index.d.ts +3 -0
  44. package/dist/director/types/index.d.ts.map +1 -0
  45. package/dist/history/history.client.d.ts +12 -0
  46. package/dist/history/history.client.d.ts.map +1 -0
  47. package/dist/history/types/history.types.d.ts +44 -0
  48. package/dist/history/types/history.types.d.ts.map +1 -0
  49. package/dist/history/types/index.d.ts +2 -0
  50. package/dist/history/types/index.d.ts.map +1 -0
  51. package/dist/index.d.ts +49 -0
  52. package/dist/index.d.ts.map +1 -0
  53. package/dist/index.js +3509 -0
  54. package/dist/index.js.map +1 -0
  55. package/dist/news/news.client.d.ts +17 -0
  56. package/dist/news/news.client.d.ts.map +1 -0
  57. package/dist/news/types/index.d.ts +2 -0
  58. package/dist/news/types/index.d.ts.map +1 -0
  59. package/dist/news/types/news.types.d.ts +61 -0
  60. package/dist/news/types/news.types.d.ts.map +1 -0
  61. package/dist/nowplaying/nowplaying.client.d.ts +12 -0
  62. package/dist/nowplaying/nowplaying.client.d.ts.map +1 -0
  63. package/dist/nowplaying/types/index.d.ts +2 -0
  64. package/dist/nowplaying/types/index.d.ts.map +1 -0
  65. package/dist/nowplaying/types/nowplaying.types.d.ts +59 -0
  66. package/dist/nowplaying/types/nowplaying.types.d.ts.map +1 -0
  67. package/dist/onboarding/onboarding.client.d.ts +11 -0
  68. package/dist/onboarding/onboarding.client.d.ts.map +1 -0
  69. package/dist/onboarding/types/index.d.ts +2 -0
  70. package/dist/onboarding/types/index.d.ts.map +1 -0
  71. package/dist/onboarding/types/onboarding.types.d.ts +41 -0
  72. package/dist/onboarding/types/onboarding.types.d.ts.map +1 -0
  73. package/dist/personas/personas.client.d.ts +167 -0
  74. package/dist/personas/personas.client.d.ts.map +1 -0
  75. package/dist/personas/types/index.d.ts +2 -0
  76. package/dist/personas/types/index.d.ts.map +1 -0
  77. package/dist/personas/types/personas.types.d.ts +545 -0
  78. package/dist/personas/types/personas.types.d.ts.map +1 -0
  79. package/dist/playlists/playlists.client.d.ts +17 -0
  80. package/dist/playlists/playlists.client.d.ts.map +1 -0
  81. package/dist/playlists/types/index.d.ts +2 -0
  82. package/dist/playlists/types/index.d.ts.map +1 -0
  83. package/dist/playlists/types/playlists.types.d.ts +71 -0
  84. package/dist/playlists/types/playlists.types.d.ts.map +1 -0
  85. package/dist/playout/playout.client.d.ts +37 -0
  86. package/dist/playout/playout.client.d.ts.map +1 -0
  87. package/dist/playout/types/index.d.ts +2 -0
  88. package/dist/playout/types/index.d.ts.map +1 -0
  89. package/dist/playout/types/playout.types.d.ts +163 -0
  90. package/dist/playout/types/playout.types.d.ts.map +1 -0
  91. package/dist/plugins/plugins.client.d.ts +107 -0
  92. package/dist/plugins/plugins.client.d.ts.map +1 -0
  93. package/dist/plugins/types/index.d.ts +2 -0
  94. package/dist/plugins/types/index.d.ts.map +1 -0
  95. package/dist/plugins/types/plugins.types.d.ts +330 -0
  96. package/dist/plugins/types/plugins.types.d.ts.map +1 -0
  97. package/dist/productions/productions.client.d.ts +22 -0
  98. package/dist/productions/productions.client.d.ts.map +1 -0
  99. package/dist/productions/types/index.d.ts +2 -0
  100. package/dist/productions/types/index.d.ts.map +1 -0
  101. package/dist/productions/types/productions.types.d.ts +90 -0
  102. package/dist/productions/types/productions.types.d.ts.map +1 -0
  103. package/dist/render/render.client.d.ts +210 -0
  104. package/dist/render/render.client.d.ts.map +1 -0
  105. package/dist/render/types/index.d.ts +2 -0
  106. package/dist/render/types/index.d.ts.map +1 -0
  107. package/dist/render/types/render.types.d.ts +518 -0
  108. package/dist/render/types/render.types.d.ts.map +1 -0
  109. package/dist/schedule/schedule.client.d.ts +37 -0
  110. package/dist/schedule/schedule.client.d.ts.map +1 -0
  111. package/dist/schedule/types/index.d.ts +2 -0
  112. package/dist/schedule/types/index.d.ts.map +1 -0
  113. package/dist/schedule/types/schedule.types.d.ts +119 -0
  114. package/dist/schedule/types/schedule.types.d.ts.map +1 -0
  115. package/dist/sdk-options.d.ts +45 -0
  116. package/dist/sdk-options.d.ts.map +1 -0
  117. package/dist/settings/settings.client.d.ts +17 -0
  118. package/dist/settings/settings.client.d.ts.map +1 -0
  119. package/dist/settings/types/index.d.ts +2 -0
  120. package/dist/settings/types/index.d.ts.map +1 -0
  121. package/dist/settings/types/settings.types.d.ts +35 -0
  122. package/dist/settings/types/settings.types.d.ts.map +1 -0
  123. package/dist/shared/types/index.d.ts +2 -0
  124. package/dist/shared/types/index.d.ts.map +1 -0
  125. package/dist/shared/types/pagination.d.ts +34 -0
  126. package/dist/shared/types/pagination.d.ts.map +1 -0
  127. package/dist/station/station.client.d.ts +49 -0
  128. package/dist/station/station.client.d.ts.map +1 -0
  129. package/dist/station/types/index.d.ts +4 -0
  130. package/dist/station/types/index.d.ts.map +1 -0
  131. package/dist/station/types/logs.types.d.ts +73 -0
  132. package/dist/station/types/logs.types.d.ts.map +1 -0
  133. package/dist/station/types/station.types.d.ts +120 -0
  134. package/dist/station/types/station.types.d.ts.map +1 -0
  135. package/dist/station/types/traces.types.d.ts +91 -0
  136. package/dist/station/types/traces.types.d.ts.map +1 -0
  137. package/dist/storage/storage.client.d.ts +12 -0
  138. package/dist/storage/storage.client.d.ts.map +1 -0
  139. package/dist/storage/types/index.d.ts +2 -0
  140. package/dist/storage/types/index.d.ts.map +1 -0
  141. package/dist/storage/types/storage.types.d.ts +59 -0
  142. package/dist/storage/types/storage.types.d.ts.map +1 -0
  143. package/dist/stream/stream.client.d.ts +32 -0
  144. package/dist/stream/stream.client.d.ts.map +1 -0
  145. package/dist/stream/types/index.d.ts +2 -0
  146. package/dist/stream/types/index.d.ts.map +1 -0
  147. package/dist/stream/types/stream.types.d.ts +47 -0
  148. package/dist/stream/types/stream.types.d.ts.map +1 -0
  149. package/dist/topics/topics.client.d.ts +32 -0
  150. package/dist/topics/topics.client.d.ts.map +1 -0
  151. package/dist/topics/types/index.d.ts +2 -0
  152. package/dist/topics/types/index.d.ts.map +1 -0
  153. package/dist/topics/types/topics.types.d.ts +65 -0
  154. package/dist/topics/types/topics.types.d.ts.map +1 -0
  155. package/package.json +53 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Marooned Software
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,109 @@
1
+ # @deadair/sdk
2
+
3
+ A typed client for a deadair station's HTTP API. It is generated from the same contracts the station
4
+ serves its routes from, so a method, its parameters and the shape it answers are the station's own
5
+ and not a hand-kept copy of them. The console is built on it.
6
+
7
+ ```bash
8
+ npm install @deadair/sdk
9
+ ```
10
+
11
+ It is an ES module only, and it runs anywhere with a global `fetch`: Node 20 and later, Deno, Bun
12
+ and every current browser.
13
+
14
+ ## Which version
15
+
16
+ The SDK is released with the station and carries the station's version: SDK `0.6.0` is the client
17
+ for station `0.6.0`. Use the version that matches the station you talk to. Before 1.0 a minor step
18
+ of the station can change a route, and the SDK changes with it.
19
+
20
+ ## Getting started
21
+
22
+ Every station is self-hosted, so the address is your own. The API is served under `/api` on the
23
+ station's one published port, which on a default install is `http://localhost:8080/api`.
24
+
25
+ ```ts
26
+ import { DeadairSdk } from '@deadair/sdk';
27
+
28
+ const sdk = new DeadairSdk({ baseUrl: 'http://localhost:8080/api' });
29
+
30
+ const now = await sdk.nowplaying.getNowPlaying();
31
+ console.log(now.onAir && now.track ? `${now.track.artist} - ${now.track.title}` : 'off air');
32
+ ```
33
+
34
+ `getNowPlaying` is the one route that needs no sign-in. For the rest, ask for a token with a password
35
+ grant and send it on every request. `headers` may be a function, called once per request, so a token
36
+ you replace later is picked up without building a new client:
37
+
38
+ ```ts
39
+ import { DeadairSdk } from '@deadair/sdk';
40
+
41
+ let token: string | undefined;
42
+ const sdk = new DeadairSdk({
43
+ baseUrl: 'http://localhost:8080/api',
44
+ headers: (): Record<string, string> => (token ? { Authorization: `Bearer ${token}` } : {}),
45
+ });
46
+
47
+ const answer = await sdk.authentication.requestToken({ grant_type: 'password', username: 'you@example.com', password: '...' });
48
+ if (answer.result === 'mfa_required') {
49
+ throw new Error('this account has a second factor to verify before it gets a token');
50
+ }
51
+ token = answer.access_token;
52
+
53
+ const page = await sdk.history.readHistory({ limit: 5 });
54
+ for (const entry of page.entries) {
55
+ console.log(entry.airedAt.toRelative(), entry.artists, '-', entry.title);
56
+ }
57
+ ```
58
+
59
+ What each route needs, what it answers and the permissions behind it are in the
60
+ [API reference](https://deadair.radio/docs/api-reference), which is generated from the same
61
+ contracts and names the method for every route.
62
+
63
+ ## Dates and decimals
64
+
65
+ A date-time field arrives as a [Luxon](https://moment.github.io/luxon/) `DateTime` and a decimal
66
+ field as a [decimal.js](https://mikemcl.github.io/decimal.js/) `Decimal`, revived from the wire
67
+ before the method returns. Both are dependencies of this package, and Luxon's types come with it.
68
+
69
+ Importing the SDK sets decimal.js's `toExpNeg` and `toExpPos` to their limits, so a `Decimal`
70
+ prints as plain digits and never in exponent notation. That setting is global to the copy of
71
+ decimal.js the SDK shares with your code. Use `Decimal.clone()` for a constructor of your own if
72
+ you depend on the defaults.
73
+
74
+ ## Errors
75
+
76
+ A response at or above 400 throws `SdkError`, which carries the `status`, the `statusText`, the
77
+ `headers` and the `body`, parsed as JSON when it is JSON. Every request carries a fresh
78
+ `X-Request-ID` header. Pass `requestIdFactory` to make the ids yourself.
79
+
80
+ ## Your own fetch
81
+
82
+ `fetch` in the options replaces the whole transport: the SDK hands it a path relative to the API
83
+ root and a `RequestInit`, and parses whatever `Response` it returns. `createSdkFetch(options)`
84
+ builds the default one, which is also what throws `SdkError`, so a wrapper can add behaviour around
85
+ it, such as timing every request or retrying a 401 once after refreshing the token:
86
+
87
+ ```ts
88
+ import { createSdkFetch, DeadairSdk, type SdkFetch } from '@deadair/sdk';
89
+
90
+ const base = createSdkFetch({ baseUrl: 'http://localhost:8080/api' });
91
+ const withLogging: SdkFetch = async (url, init) => {
92
+ const started = Date.now();
93
+ try {
94
+ return await base(url, init);
95
+ } finally {
96
+ console.debug(init.method, url, `${Date.now() - started}ms`);
97
+ }
98
+ };
99
+ const sdk = new DeadairSdk({ baseUrl: 'http://localhost:8080/api', fetch: withLogging });
100
+ ```
101
+
102
+ ## Where it comes from
103
+
104
+ Everything under `src/` is generated by ContractKit from the `.ck` contracts in
105
+ [`apps/api/data/contracts`](https://github.com/robert-dean/deadair/tree/main/apps/api/data/contracts),
106
+ and none of it is edited by hand. A change to the client is a change to a contract. The same
107
+ contracts generate the station's routes, the API reference, an
108
+ [OpenAPI document](https://deadair.radio/openapi.yaml) for any other language, and the Kotlin, C#
109
+ and Swift clients the listener apps are built on.
@@ -0,0 +1,12 @@
1
+ import type { SdkFetch } from '../sdk-options.js';
2
+ import type { ActivityPage, ActivityQuery } from './types/activity.types.js';
3
+ export declare class ActivityClient {
4
+ private fetch;
5
+ constructor(fetch: SdkFetch);
6
+ /**
7
+ * @name Read activity
8
+ * @description The feed, newest first, one page at a time
9
+ */
10
+ readActivity(query?: ActivityQuery): Promise<ActivityPage>;
11
+ }
12
+ //# sourceMappingURL=activity.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activity.client.d.ts","sourceRoot":"","sources":["../../src/activity/activity.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAG7E,qBAAa,cAAc;IACX,OAAO,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAEnC;;;OAGG;IACG,YAAY,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;CAOnE"}
@@ -0,0 +1,60 @@
1
+ import { DateTime } from 'luxon';
2
+ /**
3
+ * Which part of the station an entry came from, and the console's one filter axis
4
+ * generated from [ActivityModule](../../../../../apps/api/data/contracts/activity/activity.types.ck#L8)
5
+ */
6
+ export type ActivityModule = 'playout' | 'director' | 'render' | 'catalog' | 'plugins';
7
+ /**
8
+ * How an entry reads, not how bad it is. There is deliberately no `waiting`: a station idling for
9
+ * want of a listener says so in its own words and stays `info`, for the same reason the transport
10
+ * reports it as `ready` rather than as a mild fault
11
+ * generated from [ActivitySeverity](../../../../../apps/api/data/contracts/activity/activity.types.ck#L13)
12
+ */
13
+ export type ActivitySeverity = 'info' | 'warn' | 'fault';
14
+ /**
15
+ * One thing that happened, from whichever of the feed's sources holds it
16
+ * generated from [ActivityEntry](../../../../../apps/api/data/contracts/activity/activity.types.ck#L15)
17
+ */
18
+ export interface ActivityEntry {
19
+ /** Unique across the whole feed, and half of the cursor below */
20
+ id: string;
21
+ /** When it happened, as the database recorded it */
22
+ at: DateTime;
23
+ module: ActivityModule;
24
+ /** Dotted and stable: `silence.cause`, `air.on`, `segment.ready`, `track.aired`. What a console draws a line with, never something a decision is made on */
25
+ kind: string;
26
+ severity: ActivitySeverity;
27
+ /** The sentence a person reads, phrased by whatever produced it */
28
+ detail: string;
29
+ /** The structured half, for a reader that wants to filter or chart rather than read */
30
+ data?: Record<string, unknown>;
31
+ /** The segment this is about, for an entry that came from one */
32
+ segmentId?: string;
33
+ /** The catalog track this is about, for an entry that came from one */
34
+ trackId?: string;
35
+ }
36
+ /** Rehydrates every wire-encoded scalar in a ActivityEntry into its runtime type. Mutates and returns `raw`. */
37
+ export declare function reviveActivityEntry(raw: ActivityEntry): ActivityEntry;
38
+ /**
39
+ * One page of the feed, newest first
40
+ * generated from [ActivityQuery](../../../../../apps/api/data/contracts/activity/activity.types.ck#L27)
41
+ */
42
+ export interface ActivityQuery {
43
+ limit?: number;
44
+ /** Where the previous page ended. Opaque, and a keyset rather than an offset because rows arrive at the head continuously: an offset would re-show a row on every page as the feed grew under it. Pass back whatever `nextBefore` said and nothing else */
45
+ before?: string;
46
+ module?: ActivityModule;
47
+ /** The floor, not the exact match: `warn` answers with warnings and faults. Absent is everything */
48
+ minSeverity?: ActivitySeverity;
49
+ }
50
+ /**
51
+ * generated from [ActivityPage](../../../../../apps/api/data/contracts/activity/activity.types.ck#L34)
52
+ */
53
+ export interface ActivityPage {
54
+ entries: ActivityEntry[];
55
+ /** The cursor for the page after this one, absent once the feed has been read to its end */
56
+ nextBefore?: string;
57
+ }
58
+ /** Rehydrates every wire-encoded scalar in a ActivityPage into its runtime type. Mutates and returns `raw`. */
59
+ export declare function reviveActivityPage(raw: ActivityPage): ActivityPage;
60
+ //# sourceMappingURL=activity.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activity.types.d.ts","sourceRoot":"","sources":["../../../src/activity/types/activity.types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAYjC;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAEvF;;;;;GAKG;AACH,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAEzD;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC1B,iEAAiE;IACjE,EAAE,EAAE,MAAM,CAAC;IACX,oDAAoD;IACpD,EAAE,EAAE,QAAQ,CAAC;IACb,MAAM,EAAE,cAAc,CAAC;IACvB,4JAA4J;IAC5J,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,mEAAmE;IACnE,MAAM,EAAE,MAAM,CAAC;IACf,uFAAuF;IACvF,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,iEAAiE;IACjE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,gHAAgH;AAChH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,aAAa,GAAG,aAAa,CAIrE;AAED;;;GAGG;AACH,MAAM,WAAW,aAAa;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2PAA2P;IAC3P,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,oGAAoG;IACpG,WAAW,CAAC,EAAE,gBAAgB,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IACzB,OAAO,EAAE,aAAa,EAAE,CAAC;IACzB,4FAA4F;IAC5F,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,+GAA+G;AAC/G,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,YAAY,GAAG,YAAY,CASlE"}
@@ -0,0 +1,2 @@
1
+ export * from './activity.types.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/activity/types/index.ts"],"names":[],"mappings":"AACA,cAAc,qBAAqB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { SdkFetch } from '../sdk-options.js';
2
+ export declare class ArtClient {
3
+ private fetch;
4
+ constructor(fetch: SdkFetch);
5
+ /**
6
+ * @name Get art
7
+ * @description The bytes of one cached image
8
+ */
9
+ getArt(id: string): Promise<{
10
+ status: 200;
11
+ contentType: 'image/jpeg' | 'image/png' | 'image/webp' | 'image/gif';
12
+ data: Blob;
13
+ headers: {
14
+ cacheControl?: string;
15
+ etag?: string;
16
+ };
17
+ } | {
18
+ status: 304;
19
+ }>;
20
+ }
21
+ //# sourceMappingURL=art.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"art.client.d.ts","sourceRoot":"","sources":["../../src/art/art.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGlD,qBAAa,SAAS;IACN,OAAO,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAEnC;;;OAGG;IACG,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAC3B;QACI,MAAM,EAAE,GAAG,CAAC;QACZ,WAAW,EAAE,YAAY,GAAG,WAAW,GAAG,YAAY,GAAG,WAAW,CAAC;QACrE,IAAI,EAAE,IAAI,CAAC;QACX,OAAO,EAAE;YAAE,YAAY,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;KACrD,GACD;QAAE,MAAM,EAAE,GAAG,CAAA;KAAE,CACpB;CAiBJ"}
@@ -0,0 +1,33 @@
1
+ import type { SdkFetch } from '../sdk-options.js';
2
+ import type { AuthenticationLoginStart, AuthenticationLoginStartResponse, AuthenticationRegistration, AuthenticationRegistrationInput, AuthenticationRegistrationVerification, AuthenticationRequest, AuthenticationTokenOutput, AuthenticationTokenResponseOutput } from './types/authentication.types.js';
3
+ import { AuthenticationFactorsClient } from './authentication.factor.client.js';
4
+ import { AuthenticationSessionsClient } from './authentication.sessions.client.js';
5
+ export declare class AuthenticationClient {
6
+ private fetch;
7
+ readonly factors: AuthenticationFactorsClient;
8
+ readonly sessions: AuthenticationSessionsClient;
9
+ constructor(fetch: SdkFetch);
10
+ /**
11
+ * @name Request token
12
+ * @description Request authenticated token
13
+ */
14
+ requestToken(body: AuthenticationRequest, options?: {
15
+ contentType?: 'application/x-www-form-urlencoded' | 'application/json';
16
+ }): Promise<AuthenticationTokenResponseOutput>;
17
+ /**
18
+ * @name Register login
19
+ * @description Register a new login
20
+ */
21
+ registerLogin(body: AuthenticationRegistrationInput): Promise<AuthenticationRegistration>;
22
+ /**
23
+ * @name Verify login registration
24
+ * @description Verify a login registration
25
+ */
26
+ verifyLoginRegistration(body: AuthenticationRegistrationVerification): Promise<AuthenticationTokenOutput>;
27
+ /**
28
+ * @name Start login
29
+ * @description Start a password-less login process
30
+ */
31
+ startLogin(body: AuthenticationLoginStart): Promise<AuthenticationLoginStartResponse>;
32
+ }
33
+ //# sourceMappingURL=authentication.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authentication.client.d.ts","sourceRoot":"","sources":["../../src/authentication/authentication.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EACR,wBAAwB,EACxB,gCAAgC,EAChC,0BAA0B,EAC1B,+BAA+B,EAC/B,sCAAsC,EACtC,qBAAqB,EACrB,yBAAyB,EACzB,iCAAiC,EACpC,MAAM,iCAAiC,CAAC;AAMzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,mCAAmC,CAAC;AAChF,OAAO,EAAE,4BAA4B,EAAE,MAAM,qCAAqC,CAAC;AAEnF,qBAAa,oBAAoB;IAIjB,OAAO,CAAC,KAAK;IAHzB,QAAQ,CAAC,OAAO,EAAE,2BAA2B,CAAC;IAC9C,QAAQ,CAAC,QAAQ,EAAE,4BAA4B,CAAC;gBAE5B,KAAK,EAAE,QAAQ;IAKnC;;;OAGG;IACG,YAAY,CACd,IAAI,EAAE,qBAAqB,EAC3B,OAAO,CAAC,EAAE;QAAE,WAAW,CAAC,EAAE,mCAAmC,GAAG,kBAAkB,CAAA;KAAE,GACrF,OAAO,CAAC,iCAAiC,CAAC;IAc7C;;;OAGG;IACG,aAAa,CAAC,IAAI,EAAE,+BAA+B,GAAG,OAAO,CAAC,0BAA0B,CAAC;IAS/F;;;OAGG;IACG,uBAAuB,CAAC,IAAI,EAAE,sCAAsC,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAS/G;;;OAGG;IACG,UAAU,CAAC,IAAI,EAAE,wBAAwB,GAAG,OAAO,CAAC,gCAAgC,CAAC;CAQ9F"}
@@ -0,0 +1,41 @@
1
+ import type { AuthenticationFactor, AuthenticationFactorMethod, AuthenticationTokenOutput, FactorChallengeStartRequest, FactorChallengeStartResponseOutput, StepUpStartRequest, StepUpStartResponseOutput } from './types/authentication.types.js';
2
+ import type { AuthenticationFactorRegistration, AuthenticationFactorRegistrationResponse, AuthenticationFactorRegistrationVerification } from './types/registration.types.js';
3
+ import type { SdkFetch } from '../sdk-options.js';
4
+ /**
5
+ * generated from [authentication.factor.ck](../../../../apps/api/data/contracts/authentication/authentication.factor.ck)
6
+ */
7
+ export declare class AuthenticationFactorsClient {
8
+ private fetch;
9
+ constructor(fetch: SdkFetch);
10
+ /**
11
+ * @name List factors
12
+ * @description List authentication factors
13
+ */
14
+ listFactors(): Promise<AuthenticationFactor[]>;
15
+ /**
16
+ * @name Register factor
17
+ * @description Register an authentication factor
18
+ */
19
+ registerFactor(body: AuthenticationFactorRegistration): Promise<AuthenticationFactorRegistrationResponse>;
20
+ /**
21
+ * @name Verify factor registration
22
+ * @description Verify an authentication factor registration
23
+ */
24
+ verifyFactorRegistration(body: AuthenticationFactorRegistrationVerification): Promise<AuthenticationTokenOutput>;
25
+ /**
26
+ * @name Start factor challenge
27
+ * @description Issue a factor verification challenge for a pending MFA round. Authenticated via the short-lived `mfa_challenge_id` in the body, not by session — this is the only /auth/factors/* route that does not require an authenticated session.
28
+ */
29
+ startFactorChallenge(body: FactorChallengeStartRequest): Promise<FactorChallengeStartResponseOutput>;
30
+ /**
31
+ * @name Start MFA challenge
32
+ * @description Mint a fresh MFA challenge for the *current* authenticated session so the SPA can satisfy a `step_up_required` denial. Optionally filters eligible factors against an inbound `StepUpRequirement` hint. Returns `enrollment_required` when no enrolled factor matches the requirement so the SPA can route the user into enrollment instead of getting stuck.
33
+ */
34
+ startMFAChallenge(body: StepUpStartRequest): Promise<StepUpStartResponseOutput>;
35
+ /**
36
+ * @name Remove factor
37
+ * @description Remove one of the caller's own factors. Answered only for `authenticator` today, and only after a recent strong-factor verification: the same gate enrolment sits behind once a strong factor exists, so a stolen session cannot quietly switch the second factor off. Removing the last authenticator turns the sign-in challenge off for that account.
38
+ */
39
+ removeFactor(method: AuthenticationFactorMethod, methodId: string): Promise<void>;
40
+ }
41
+ //# sourceMappingURL=authentication.factor.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authentication.factor.client.d.ts","sourceRoot":"","sources":["../../src/authentication/authentication.factor.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,oBAAoB,EACpB,0BAA0B,EAC1B,yBAAyB,EACzB,2BAA2B,EAC3B,kCAAkC,EAClC,kBAAkB,EAClB,yBAAyB,EAC5B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EACR,gCAAgC,EAChC,wCAAwC,EACxC,4CAA4C,EAC/C,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGlD;;GAEG;AACH,qBAAa,2BAA2B;IACxB,OAAO,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAEnC;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,oBAAoB,EAAE,CAAC;IAKpD;;;OAGG;IACG,cAAc,CAAC,IAAI,EAAE,gCAAgC,GAAG,OAAO,CAAC,wCAAwC,CAAC;IAS/G;;;OAGG;IACG,wBAAwB,CAAC,IAAI,EAAE,4CAA4C,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAStH;;;OAGG;IACG,oBAAoB,CAAC,IAAI,EAAE,2BAA2B,GAAG,OAAO,CAAC,kCAAkC,CAAC;IAS1G;;;OAGG;IACG,iBAAiB,CAAC,IAAI,EAAE,kBAAkB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IASrF;;;OAGG;IACG,YAAY,CAAC,MAAM,EAAE,0BAA0B,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG1F"}
@@ -0,0 +1,20 @@
1
+ import type { AuthSession } from './types/authentication.types.js';
2
+ import type { SdkFetch } from '../sdk-options.js';
3
+ /**
4
+ * generated from [authentication.sessions.ck](../../../../apps/api/data/contracts/authentication/authentication.sessions.ck)
5
+ */
6
+ export declare class AuthenticationSessionsClient {
7
+ private fetch;
8
+ constructor(fetch: SdkFetch);
9
+ /**
10
+ * @name Logout
11
+ * @description revoke the caller's current session (self sign-out). Deliberately carries no policy gate: signing out must always clear the browser's httpOnly refresh cookie, including for a caller whose access token has already expired. A 401 here would leave a 30-day refresh cookie behind that silently signs the user back in on the next page load. SessionsService revokes the session only when the caller is actually authenticated; an anonymous caller still gets 204 and a cleared cookie.
12
+ */
13
+ logout(): Promise<void>;
14
+ /**
15
+ * @name Read session
16
+ * @description Who the caller is and which platform roles they hold
17
+ */
18
+ readSession(): Promise<AuthSession>;
19
+ }
20
+ //# sourceMappingURL=authentication.sessions.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"authentication.sessions.client.d.ts","sourceRoot":"","sources":["../../src/authentication/authentication.sessions.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iCAAiC,CAAC;AACnE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGlD;;GAEG;AACH,qBAAa,4BAA4B;IACzB,OAAO,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAEnC;;;OAGG;IACG,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;IAI7B;;;OAGG;IACG,WAAW,IAAI,OAAO,CAAC,WAAW,CAAC;CAI5C"}