@seamapi/types 1.1113.0 → 1.1115.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamapi/types",
3
- "version": "1.1113.0",
3
+ "version": "1.1115.0",
4
4
  "description": "TypeScript types for the Seam API.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -58,6 +58,7 @@ export {
58
58
  guest_resource,
59
59
  instant_key,
60
60
  instant_key_preview,
61
+ instant_key_theme,
61
62
  listing_resource,
62
63
  lock_device_type,
63
64
  magic_link,
@@ -7,3 +7,33 @@ export const hex_color_code = z.string().refine((value) => {
7
7
 
8
8
  return true
9
9
  }, 'Must be a hex color')
10
+
11
+ const css_number = String.raw`[+-]?(?:\d+\.?\d*|\.\d+)`
12
+ const css_alpha = String.raw`(?:\s*/\s*${css_number}%?)?`
13
+ const css_color_patterns = [
14
+ /^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i,
15
+ new RegExp(
16
+ String.raw`^oklch\(\s*${css_number}%?\s+${css_number}%?\s+${css_number}(?:deg)?${css_alpha}\s*\)$`,
17
+ 'i',
18
+ ),
19
+ new RegExp(
20
+ String.raw`^rgba?\(\s*${css_number}%?(?:\s*,\s*|\s+)${css_number}%?(?:\s*,\s*|\s+)${css_number}%?(?:(?:\s*,\s*|\s*/\s*)${css_number}%?)?\s*\)$`,
21
+ 'i',
22
+ ),
23
+ new RegExp(
24
+ String.raw`^hsla?\(\s*${css_number}(?:deg)?(?:\s*,\s*|\s+)${css_number}%(?:\s*,\s*|\s+)${css_number}%(?:(?:\s*,\s*|\s*/\s*)${css_number}%?)?\s*\)$`,
25
+ 'i',
26
+ ),
27
+ new RegExp(String.raw`^${css_number}\s+${css_number}%\s+${css_number}%$`),
28
+ ]
29
+
30
+ export const css_color = z
31
+ .string()
32
+ .max(100)
33
+ .refine(
34
+ (value) =>
35
+ css_color_patterns.some((css_color_pattern) =>
36
+ css_color_pattern.test(value.trim()),
37
+ ),
38
+ 'Must be a CSS color: a hex code, `oklch()`, `rgb()`, or `hsl()`',
39
+ )
@@ -1,6 +1,6 @@
1
1
  import * as z from 'zod/v3'
2
2
 
3
- import { hex_color_code } from '../colors.js'
3
+ import { css_color, hex_color_code } from '../colors.js'
4
4
  import { datetime } from '../datetime.js'
5
5
 
6
6
  export const customer_portal_theme = z.object({
@@ -12,6 +12,98 @@ export const customer_portal_theme = z.object({
12
12
  mono_font_family: z.string().optional(),
13
13
  })
14
14
 
15
+ const instant_key_theme_colors = z
16
+ .object({
17
+ background: css_color.optional().describe('App background.'),
18
+ foreground: css_color.optional().describe('Default text color.'),
19
+ card: css_color.optional().describe('Card background.'),
20
+ card_foreground: css_color.optional().describe('Text color on cards.'),
21
+ popover: css_color.optional().describe('Dialog and sheet background.'),
22
+ popover_foreground: css_color
23
+ .optional()
24
+ .describe('Text color on dialogs and sheets.'),
25
+ primary: css_color.optional().describe('Primary buttons and highlights.'),
26
+ primary_foreground: css_color
27
+ .optional()
28
+ .describe('Text color on `primary`.'),
29
+ secondary: css_color.optional().describe('Secondary buttons.'),
30
+ secondary_foreground: css_color
31
+ .optional()
32
+ .describe('Text color on `secondary`.'),
33
+ muted: css_color
34
+ .optional()
35
+ .describe('Subtle backgrounds, such as the unlock sheet header.'),
36
+ muted_foreground: css_color.optional().describe('Secondary text.'),
37
+ accent: css_color.optional().describe('Pressed and hovered backgrounds.'),
38
+ accent_foreground: css_color.optional().describe('Text color on `accent`.'),
39
+ destructive: css_color
40
+ .optional()
41
+ .describe('Errors and destructive actions.'),
42
+ destructive_foreground: css_color
43
+ .optional()
44
+ .describe('Text color on `destructive`.'),
45
+ border: css_color.optional().describe('Borders and dividers.'),
46
+ input: css_color.optional().describe('Input borders.'),
47
+ ring: css_color.optional().describe('Focus rings.'),
48
+ success: css_color.optional().describe('Successful unlocks.'),
49
+ success_foreground: css_color
50
+ .optional()
51
+ .describe('Text color on `success`.'),
52
+ key_card: css_color.optional().describe('Start of the key card gradient.'),
53
+ key_card_end: css_color
54
+ .optional()
55
+ .describe('End of the key card gradient.'),
56
+ key_card_foreground: css_color
57
+ .optional()
58
+ .describe('Text and logo color on the key card.'),
59
+ unlock: css_color
60
+ .optional()
61
+ .describe('Start of the unlock button gradient.'),
62
+ unlock_end: css_color
63
+ .optional()
64
+ .describe('End of the unlock button gradient.'),
65
+ unlock_foreground: css_color
66
+ .optional()
67
+ .describe('Icon color on the unlock button.'),
68
+ })
69
+ .strict()
70
+
71
+ export const instant_key_theme = z.object({
72
+ radius: z
73
+ .string()
74
+ .regex(
75
+ /^(?:\d+\.?\d*|\.\d+)(?:rem|px)?$/,
76
+ 'Must be a length in `rem` or `px`, like `0.875rem` or `14px`',
77
+ )
78
+ .optional()
79
+ .describe(
80
+ 'Corner radius for the Instant Key UI, as a CSS length such as `0.875rem` or `14px`.',
81
+ ),
82
+ font_family: z
83
+ .string()
84
+ .max(200)
85
+ .optional()
86
+ .describe(
87
+ 'Font family for the Instant Key UI. The apps use the closest system typeface: sans-serif, serif, or monospace.',
88
+ ),
89
+ key_card_texture: z
90
+ .enum(['default', 'none'])
91
+ .optional()
92
+ .describe(
93
+ 'Whether the key card shows its default texture over the key card gradient, or the gradient alone.',
94
+ ),
95
+ light: instant_key_theme_colors
96
+ .optional()
97
+ .describe(
98
+ "Light-mode colors, named after shadcn/ui's CSS variables in snake_case. Values are CSS colors in hex, `oklch()`, `rgb()`, or `hsl()` form. Colors you omit use the Seam default.",
99
+ ),
100
+ dark: instant_key_theme_colors
101
+ .optional()
102
+ .describe(
103
+ 'Dark-mode colors, in the same form as `light`. When omitted, dark mode uses the Seam default with your `primary`, `primary_foreground`, and `ring` colors.',
104
+ ),
105
+ })
106
+
15
107
  export const message_overrides = z.record(
16
108
  z.string(),
17
109
  z.record(z.string(), z.string()),
@@ -32,6 +124,9 @@ export const customization_profile = z.object({
32
124
  primary_color: z.string().optional(),
33
125
  secondary_color: z.string().optional(),
34
126
  customer_portal_theme: customer_portal_theme.optional(),
127
+ instant_key_theme: instant_key_theme
128
+ .optional()
129
+ .describe('Theme for the Instant Keys apps.'),
35
130
  message_overrides: message_overrides.optional(),
36
131
  }).describe(`
37
132
  ---
@@ -997,12 +997,11 @@ export const device_metadata = z
997
997
  .string()
998
998
  .optional()
999
999
  .describe(`Product type for a Sensi device.`),
1000
+ /** @deprecated Seam no longer sets this field. */
1000
1001
  dual_setpoints_not_supported: z
1001
1002
  .boolean()
1002
1003
  .optional()
1003
- .describe(
1004
- `Set to true when the device does not support the /dual-setpoints API endpoint.`,
1005
- ),
1004
+ .describe(`Deprecated. Seam no longer sets this field.`),
1006
1005
  })
1007
1006
  .partial()
1008
1007
  .describe(`Metadata for a Sensi device.`),
@@ -1,5 +1,6 @@
1
1
  import * as z from 'zod/v3'
2
2
 
3
+ import { instant_key_theme } from '../customization-profiles/customization-profile.js'
3
4
  import { datetime } from '../datetime.js'
4
5
 
5
6
  export const instant_key = z.object({
@@ -50,6 +51,12 @@ export const instant_key = z.object({
50
51
  .url()
51
52
  .optional()
52
53
  .describe('URL of the logo displayed on the Instant Key.'),
54
+ instant_key_theme: instant_key_theme.optional().describe(`
55
+ ---
56
+ undocumented: Unreleased.
57
+ ---
58
+ Theme for the Instant Keys apps, from the customization profile's \`instant_key_theme\`. Omitted when the profile has none, in which case the apps use the Seam default theme.
59
+ `),
53
60
  })
54
61
  .optional()
55
62
  .describe('Customization applied to the Instant Key UI.'),