@deadair/sdk 0.35.0 → 0.35.2

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,37 @@
1
+ import type { SdkFetch } from '../sdk-options.js';
2
+ import type { ConsoleLanguageChoice, ConsoleLanguageList, ConsoleLanguagePack } from './types/languages.types.js';
3
+ export declare class LanguagesClient {
4
+ private fetch;
5
+ constructor(fetch: SdkFetch);
6
+ /**
7
+ * @name Get my console language
8
+ * @description The language you chose for the console, if you chose one
9
+ */
10
+ getMyConsoleLanguage(): Promise<ConsoleLanguageChoice>;
11
+ /**
12
+ * @name Choose my console language
13
+ * @description Chooses the language your console is shown in, or, without one, goes back to following the browser
14
+ */
15
+ chooseMyConsoleLanguage(body: ConsoleLanguageChoice): Promise<ConsoleLanguageChoice>;
16
+ /**
17
+ * @name List console languages
18
+ * @description Every language this station holds a pack for, without the strings
19
+ */
20
+ listConsoleLanguages(): Promise<ConsoleLanguageList>;
21
+ /**
22
+ * @name Get console language
23
+ * @description One language's pack, strings and all, as it was imported
24
+ */
25
+ getConsoleLanguage(locale: string): Promise<ConsoleLanguagePack>;
26
+ /**
27
+ * @name Import console language
28
+ * @description Installs a language pack, replacing any pack already installed for the language. The tag in the path must be the pack's own
29
+ */
30
+ importConsoleLanguage(locale: string, body: ConsoleLanguagePack): Promise<ConsoleLanguageList>;
31
+ /**
32
+ * @name Remove console language
33
+ * @description Removes a language. Anybody who had chosen it sees English
34
+ */
35
+ removeConsoleLanguage(locale: string): Promise<ConsoleLanguageList>;
36
+ }
37
+ //# sourceMappingURL=languages.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"languages.client.d.ts","sourceRoot":"","sources":["../../src/languages/languages.client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,OAAO,KAAK,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAGlH,qBAAa,eAAe;IACZ,OAAO,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAEnC;;;OAGG;IACG,oBAAoB,IAAI,OAAO,CAAC,qBAAqB,CAAC;IAK5D;;;OAGG;IACG,uBAAuB,CAAC,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAS1F;;;OAGG;IACG,oBAAoB,IAAI,OAAO,CAAC,mBAAmB,CAAC;IAK1D;;;OAGG;IACG,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAKtE;;;OAGG;IACG,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,CAAC;IASpG;;;OAGG;IACG,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAI5E"}
@@ -0,0 +1,2 @@
1
+ export * from './languages.types.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/languages/types/index.ts"],"names":[],"mappings":"AACA,cAAc,sBAAsB,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { DateTime } from 'luxon';
2
+ /**
3
+ * A language pack: every word the console says, in one language, as the file a translator made. The same document is exported, imported and stored. The console's language only; what the station broadcasts in is the `stream.language` setting
4
+ * generated from [ConsoleLanguagePack](../../../../../apps/api/data/contracts/languages/languages.types.ck#L8)
5
+ */
6
+ export interface ConsoleLanguagePack {
7
+ /** Says the file is a console language pack */
8
+ format: 'deadair.console-language';
9
+ /** The version of the document's shape. This station reads version 1 */
10
+ version: number;
11
+ /** The language, as a BCP 47 tag such as `de` or `pt-BR`. Never English, which is built into the console */
12
+ locale: string;
13
+ /** The language's name in itself, as the console's picker shows it: `Deutsch`, not `German` */
14
+ name: string;
15
+ /** Which way its text runs */
16
+ direction: 'ltr' | 'rtl';
17
+ /** The console version the pack was translated against. Empty when the file did not say */
18
+ madeFor: string;
19
+ /** The strings, nested by namespace and then by key, in the English catalog's shape. Every value is text or a further level of nesting */
20
+ catalog: Record<string, unknown>;
21
+ }
22
+ /**
23
+ * A language the console can be shown in on this station, without its strings
24
+ * generated from [ConsoleLanguage](../../../../../apps/api/data/contracts/languages/languages.types.ck#L19)
25
+ */
26
+ export interface ConsoleLanguage {
27
+ locale: string;
28
+ name: string;
29
+ direction: 'ltr' | 'rtl';
30
+ madeFor: string;
31
+ /** When the pack now installed for it was imported */
32
+ importedAt: DateTime;
33
+ }
34
+ /** Rehydrates every wire-encoded scalar in a ConsoleLanguage into its runtime type. Mutates and returns `raw`. */
35
+ export declare function reviveConsoleLanguage(raw: ConsoleLanguage): ConsoleLanguage;
36
+ /**
37
+ * The language the signed-in operator chose for the console. Absent means none was chosen, and the console follows the browser's own preference among the languages it has
38
+ * generated from [ConsoleLanguageChoice](../../../../../apps/api/data/contracts/languages/languages.types.ck#L32)
39
+ */
40
+ export interface ConsoleLanguageChoice {
41
+ /** A language this station holds a pack for, or `en` for English whatever the browser prefers */
42
+ locale?: string;
43
+ }
44
+ /**
45
+ * generated from [ConsoleLanguageList](../../../../../apps/api/data/contracts/languages/languages.types.ck#L27)
46
+ */
47
+ export interface ConsoleLanguageList {
48
+ /** In order of their tags. English is built in and is never listed */
49
+ languages: ConsoleLanguage[];
50
+ }
51
+ /** Rehydrates every wire-encoded scalar in a ConsoleLanguageList into its runtime type. Mutates and returns `raw`. */
52
+ export declare function reviveConsoleLanguageList(raw: ConsoleLanguageList): ConsoleLanguageList;
53
+ //# sourceMappingURL=languages.types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"languages.types.d.ts","sourceRoot":"","sources":["../../../src/languages/types/languages.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAUjC;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAChC,+CAA+C;IAC/C,MAAM,EAAE,0BAA0B,CAAC;IACnC,wEAAwE;IACxE,OAAO,EAAE,MAAM,CAAC;IAChB,4GAA4G;IAC5G,MAAM,EAAE,MAAM,CAAC;IACf,+FAA+F;IAC/F,IAAI,EAAE,MAAM,CAAC;IACb,8BAA8B;IAC9B,SAAS,EAAE,KAAK,GAAG,KAAK,CAAC;IACzB,2FAA2F;IAC3F,OAAO,EAAE,MAAM,CAAC;IAChB,0IAA0I;IAC1I,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;;GAGG;AACH,MAAM,WAAW,eAAe;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,KAAK,GAAG,KAAK,CAAC;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,UAAU,EAAE,QAAQ,CAAC;CACxB;AAED,kHAAkH;AAClH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,eAAe,GAAG,eAAe,CAI3E;AAED;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IAClC,iGAAiG;IACjG,MAAM,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAChC,sEAAsE;IACtE,SAAS,EAAE,eAAe,EAAE,CAAC;CAChC;AAED,sHAAsH;AACtH,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,mBAAmB,GAAG,mBAAmB,CASvF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deadair/sdk",
3
- "version": "0.35.0",
3
+ "version": "0.35.2",
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",