@deadair/sdk 0.14.0 → 0.16.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.
@@ -1,7 +1,23 @@
1
1
  import type { SdkFetch } from '../sdk-options.js';
2
+ import type { BreakArtworkList } from './types/art.types.js';
2
3
  export declare class ArtClient {
3
4
  private fetch;
4
5
  constructor(fetch: SdkFetch);
6
+ /**
7
+ * @name List break artwork
8
+ * @description Every kind the station holds a picture for
9
+ */
10
+ listBreakArtwork(): Promise<BreakArtworkList>;
11
+ /**
12
+ * @name Replace break artwork
13
+ * @description Puts an operator's own picture behind a kind of break. The id does not change, so a URL already on the wire keeps working and the ETag is what says the picture moved
14
+ */
15
+ replaceBreakArtwork(kind: string, body: FormData): Promise<BreakArtworkList>;
16
+ /**
17
+ * @name Revert break artwork
18
+ * @description Puts the picture this repository ships back. The shipped file is read at this moment rather than copied at install, so an upgrade that improved it is what comes back
19
+ */
20
+ revertBreakArtwork(kind: string): Promise<BreakArtworkList>;
5
21
  /**
6
22
  * @name Get art
7
23
  * @description The bytes of one cached image, addressed by its id alone
@@ -1 +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,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AAE,MAAM,EAAE,GAAG,CAAA;KAAE,CACpB;IAkBD;;;OAGG;IACG,UAAU,CACZ,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,MAAM,GACjB,OAAO,CACJ;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,39 @@
1
+ /**
2
+ * The picture one KIND of break wears -- a weather forecast, a news bulletin -- as the console draws
3
+ * it.
4
+ *
5
+ * Only kinds the station actually holds bytes for are listed. A kind with no picture is a break
6
+ * wearing the station's logo on the mount and nothing in a listener's app, which is what every break
7
+ * did before this existed and is not a row worth drawing
8
+ * generated from [BreakArtwork](../../../../../apps/api/data/contracts/art/art.types.ck#L13)
9
+ */
10
+ export interface BreakArtwork {
11
+ /** `segments.kind`, which is what decides which break wears this: `weather`, `news`, or whatever an operator wrote on a format-clock band */
12
+ kind: string;
13
+ /** Where the station serves it, as a path under the API root. The same shape and the same route a record's cover uses */
14
+ url: string;
15
+ /** Whether these are the bytes this repository ships or ones somebody uploaded over them */
16
+ source: 'shipped' | 'operator';
17
+ /** Whether this repository ships a picture for this kind, which is whether reverting has anywhere to go */
18
+ hasShipped: boolean;
19
+ }
20
+ /**
21
+ * A picture arriving from the browser, as multipart form parts.
22
+ *
23
+ * Documentation rather than validation: a multipart body reaches the service as the raw parser and
24
+ * the generated client types the body as `FormData`, so nothing checks this shape. It says what to
25
+ * send
26
+ * generated from [BreakArtworkUpload](../../../../../apps/api/data/contracts/art/art.types.ck#L30)
27
+ */
28
+ export interface BreakArtworkUpload {
29
+ /** The image itself. jpeg, png, webp or gif, decided by its BYTES rather than by its name or its declared type, and at most 4 MB */
30
+ file: Blob;
31
+ }
32
+ /**
33
+ * Every kind the station holds a picture for, kind by kind
34
+ * generated from [BreakArtworkList](../../../../../apps/api/data/contracts/art/art.types.ck#L21)
35
+ */
36
+ export interface BreakArtworkList {
37
+ breaks: BreakArtwork[];
38
+ }
39
+ //# sourceMappingURL=art.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"art.types.d.ts","sourceRoot":"","sources":["../../../src/art/types/art.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,YAAY;IACzB,6IAA6I;IAC7I,IAAI,EAAE,MAAM,CAAC;IACb,yHAAyH;IACzH,GAAG,EAAE,MAAM,CAAC;IACZ,4FAA4F;IAC5F,MAAM,EAAE,SAAS,GAAG,UAAU,CAAC;IAC/B,2GAA2G;IAC3G,UAAU,EAAE,OAAO,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,kBAAkB;IAC/B,oIAAoI;IACpI,IAAI,EAAE,IAAI,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC7B,MAAM,EAAE,YAAY,EAAE,CAAC;CAC1B"}
@@ -0,0 +1,2 @@
1
+ export * from './art.types.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/art/types/index.ts"],"names":[],"mappings":"AACA,cAAc,gBAAgB,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export * from './activity/activity.client.js';
2
2
  export * from './activity/types/index.js';
3
3
  export * from './art/art.client.js';
4
+ export * from './art/types/index.js';
4
5
  export * from './authentication/authentication.apikeys.client.js';
5
6
  export * from './authentication/authentication.client.js';
6
7
  export * from './authentication/authentication.factor.client.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,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CAAC;AAC1C,cAAc,qCAAqC,CAAC;AACpD,cAAc,8BAA8B,CAAC;AAC7C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,yBAAyB,CAAC"}
package/dist/index.js CHANGED
@@ -169,6 +169,37 @@ var ArtClient = class {
169
169
  constructor(fetch2) {
170
170
  this.fetch = fetch2;
171
171
  }
172
+ /**
173
+ * @name List break artwork
174
+ * @description Every kind the station holds a picture for
175
+ */
176
+ async listBreakArtwork() {
177
+ const result = await this.fetch(`/art/breaks`, {
178
+ method: "GET"
179
+ });
180
+ return await parseJson(result);
181
+ }
182
+ /**
183
+ * @name Replace break artwork
184
+ * @description Puts an operator's own picture behind a kind of break. The id does not change, so a URL already on the wire keeps working and the ETag is what says the picture moved
185
+ */
186
+ async replaceBreakArtwork(kind, body) {
187
+ const result = await this.fetch(`/art/breaks/${encodeURIComponent(kind)}`, {
188
+ method: "POST",
189
+ body
190
+ });
191
+ return await parseJson(result);
192
+ }
193
+ /**
194
+ * @name Revert break artwork
195
+ * @description Puts the picture this repository ships back. The shipped file is read at this moment rather than copied at install, so an upgrade that improved it is what comes back
196
+ */
197
+ async revertBreakArtwork(kind) {
198
+ const result = await this.fetch(`/art/breaks/${encodeURIComponent(kind)}`, {
199
+ method: "DELETE"
200
+ });
201
+ return await parseJson(result);
202
+ }
172
203
  /**
173
204
  * @name Get art
174
205
  * @description The bytes of one cached image, addressed by its id alone