@qcobro/common 1.40.1 → 1.43.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.
@@ -5,6 +5,16 @@ export declare const languageSchema: z.ZodEnum<{
5
5
  es: "es";
6
6
  }>;
7
7
  export type Language = z.infer<typeof languageSchema>;
8
+ /**
9
+ * Console appearance preference. `system` follows the operating system's
10
+ * `prefers-color-scheme`; `light` and `dark` pin a theme.
11
+ */
12
+ export declare const themeSchema: z.ZodEnum<{
13
+ system: "system";
14
+ light: "light";
15
+ dark: "dark";
16
+ }>;
17
+ export type Theme = z.infer<typeof themeSchema>;
8
18
  /** The per-user settings record (stored in the app DB, keyed by the Identity userRef). */
9
19
  export declare const userSettingsSchema: z.ZodObject<{
10
20
  userRef: z.ZodString;
@@ -12,6 +22,11 @@ export declare const userSettingsSchema: z.ZodObject<{
12
22
  en: "en";
13
23
  es: "es";
14
24
  }>;
25
+ theme: z.ZodEnum<{
26
+ system: "system";
27
+ light: "light";
28
+ dark: "dark";
29
+ }>;
15
30
  }, z.core.$strip>;
16
31
  export type UserSettings = z.infer<typeof userSettingsSchema>;
17
32
  /** Operator-editable user settings. */
@@ -22,4 +37,12 @@ export declare const updateUserLanguageSchema: z.ZodObject<{
22
37
  }>;
23
38
  }, z.core.$strip>;
24
39
  export type UpdateUserLanguageInput = z.infer<typeof updateUserLanguageSchema>;
40
+ export declare const updateUserThemeSchema: z.ZodObject<{
41
+ theme: z.ZodEnum<{
42
+ system: "system";
43
+ light: "light";
44
+ dark: "dark";
45
+ }>;
46
+ }, z.core.$strip>;
47
+ export type UpdateUserThemeInput = z.infer<typeof updateUserThemeSchema>;
25
48
  //# sourceMappingURL=userSettings.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"userSettings.d.ts","sourceRoot":"","sources":["../../src/schemas/userSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,kFAAkF;AAClF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+1,22 @@
1
1
  import { z } from "zod";
2
2
  /** Supported console languages. Keep in sync with the webapp message catalogs. */
3
3
  export const languageSchema = z.enum(["en", "es"]);
4
+ /**
5
+ * Console appearance preference. `system` follows the operating system's
6
+ * `prefers-color-scheme`; `light` and `dark` pin a theme.
7
+ */
8
+ export const themeSchema = z.enum(["system", "light", "dark"]);
4
9
  /** The per-user settings record (stored in the app DB, keyed by the Identity userRef). */
5
10
  export const userSettingsSchema = z.object({
6
11
  userRef: z.string().min(1),
7
- language: languageSchema
12
+ language: languageSchema,
13
+ theme: themeSchema
8
14
  });
9
15
  /** Operator-editable user settings. */
10
16
  export const updateUserLanguageSchema = z.object({
11
17
  language: languageSchema
12
18
  });
19
+ export const updateUserThemeSchema = z.object({
20
+ theme: themeSchema
21
+ });
13
22
  //# sourceMappingURL=userSettings.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"userSettings.js","sourceRoot":"","sources":["../../src/schemas/userSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,kFAAkF;AAClF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAGnD,0FAA0F;AAC1F,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,QAAQ,EAAE,cAAc;CACzB,CAAC,CAAC;AAGH,uCAAuC;AACvC,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,QAAQ,EAAE,cAAc;CACzB,CAAC,CAAC"}
1
+ {"version":3,"file":"userSettings.js","sourceRoot":"","sources":["../../src/schemas/userSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,kFAAkF;AAClF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAGnD;;;GAGG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC;AAG/D,0FAA0F;AAC1F,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC1B,QAAQ,EAAE,cAAc;IACxB,KAAK,EAAE,WAAW;CACnB,CAAC,CAAC;AAGH,uCAAuC;AACvC,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC/C,QAAQ,EAAE,cAAc;CACzB,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC5C,KAAK,EAAE,WAAW;CACnB,CAAC,CAAC"}
@@ -1,7 +1,8 @@
1
- import type { Language } from "../schemas/userSettings.js";
1
+ import type { Language, Theme } from "../schemas/userSettings.js";
2
2
  export interface UserSettingsRecord {
3
3
  userRef: string;
4
4
  language: Language;
5
+ theme: Theme;
5
6
  createdAt: Date;
6
7
  updatedAt: Date;
7
8
  }
@@ -1 +1 @@
1
- {"version":3,"file":"userSettings.d.ts","sourceRoot":"","sources":["../../src/types/userSettings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAE3D,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,IAAI,CAAC;IAChB,SAAS,EAAE,IAAI,CAAC;CACjB;AAED,6EAA6E;AAC7E,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE;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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qcobro/common",
3
- "version": "1.40.1",
3
+ "version": "1.43.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist"