@seamapi/types 0.20.1 → 0.21.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.
@@ -138,6 +138,28 @@ export interface Routes {
138
138
  };
139
139
  };
140
140
  };
141
+ '/access_codes/generate_code': {
142
+ route: '/access_codes/generate_code';
143
+ method: 'GET';
144
+ queryParams: {};
145
+ jsonBody: {};
146
+ commonParams: {
147
+ device_id: string;
148
+ };
149
+ formData: {};
150
+ jsonResponse: {
151
+ generated_code: {
152
+ device_id: string;
153
+ code: string;
154
+ is_valid: true;
155
+ conflicts_with_existing_code: false;
156
+ violated_code_constraints: [];
157
+ passed_code_constraints: Array<{
158
+ constraint_type: 'no_zeros' | 'cannot_start_with_12' | 'no_triple_consecutive_ints' | 'cannot_specify_pin_code' | 'pin_code_matches_existing_set' | 'start_date_in_future';
159
+ }>;
160
+ };
161
+ };
162
+ };
141
163
  '/access_codes/get': {
142
164
  route: '/access_codes/get';
143
165
  method: 'GET' | 'POST';
@@ -1,4 +1,24 @@
1
1
  import { z } from 'zod';
2
+ export declare const access_code_code_constraint: z.ZodObject<{
3
+ constraint_type: z.ZodEnum<["no_zeros", "cannot_start_with_12", "no_triple_consecutive_ints", "cannot_specify_pin_code", "pin_code_matches_existing_set", "start_date_in_future"]>;
4
+ }, "strip", z.ZodTypeAny, {
5
+ constraint_type: "no_zeros" | "cannot_start_with_12" | "no_triple_consecutive_ints" | "cannot_specify_pin_code" | "pin_code_matches_existing_set" | "start_date_in_future";
6
+ }, {
7
+ constraint_type: "no_zeros" | "cannot_start_with_12" | "no_triple_consecutive_ints" | "cannot_specify_pin_code" | "pin_code_matches_existing_set" | "start_date_in_future";
8
+ }>;
9
+ export declare const access_code_name_constraint: z.ZodObject<{
10
+ constraint_type: z.ZodLiteral<"name_length">;
11
+ min_length: z.ZodOptional<z.ZodNumber>;
12
+ max_length: z.ZodOptional<z.ZodNumber>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ constraint_type: "name_length";
15
+ min_length?: number | undefined;
16
+ max_length?: number | undefined;
17
+ }, {
18
+ constraint_type: "name_length";
19
+ min_length?: number | undefined;
20
+ max_length?: number | undefined;
21
+ }>;
2
22
  export declare const access_code_constraint: z.ZodUnion<[z.ZodObject<{
3
23
  constraint_type: z.ZodEnum<["no_zeros", "cannot_start_with_12", "no_triple_consecutive_ints", "cannot_specify_pin_code", "pin_code_matches_existing_set", "start_date_in_future"]>;
4
24
  }, "strip", z.ZodTypeAny, {
@@ -6,7 +26,7 @@ export declare const access_code_constraint: z.ZodUnion<[z.ZodObject<{
6
26
  }, {
7
27
  constraint_type: "no_zeros" | "cannot_start_with_12" | "no_triple_consecutive_ints" | "cannot_specify_pin_code" | "pin_code_matches_existing_set" | "start_date_in_future";
8
28
  }>, z.ZodObject<{
9
- constraint_type: z.ZodEnum<["name_length"]>;
29
+ constraint_type: z.ZodLiteral<"name_length">;
10
30
  min_length: z.ZodOptional<z.ZodNumber>;
11
31
  max_length: z.ZodOptional<z.ZodNumber>;
12
32
  }, "strip", z.ZodTypeAny, {
@@ -27,7 +47,7 @@ export declare const access_code_capability_properties: z.ZodObject<{
27
47
  }, {
28
48
  constraint_type: "no_zeros" | "cannot_start_with_12" | "no_triple_consecutive_ints" | "cannot_specify_pin_code" | "pin_code_matches_existing_set" | "start_date_in_future";
29
49
  }>, z.ZodObject<{
30
- constraint_type: z.ZodEnum<["name_length"]>;
50
+ constraint_type: z.ZodLiteral<"name_length">;
31
51
  min_length: z.ZodOptional<z.ZodNumber>;
32
52
  max_length: z.ZodOptional<z.ZodNumber>;
33
53
  }, "strip", z.ZodTypeAny, {
@@ -1,5 +1,5 @@
1
1
  import { z } from 'zod';
2
- const simple_access_code_constraint = z.object({
2
+ export const access_code_code_constraint = z.object({
3
3
  constraint_type: z.enum([
4
4
  'no_zeros',
5
5
  'cannot_start_with_12',
@@ -9,14 +9,14 @@ const simple_access_code_constraint = z.object({
9
9
  'start_date_in_future', // Kwikset
10
10
  ]),
11
11
  });
12
- const complex_access_code_constraint = z.object({
13
- constraint_type: z.enum(['name_length']),
12
+ export const access_code_name_constraint = z.object({
13
+ constraint_type: z.literal('name_length'),
14
14
  min_length: z.number().optional(),
15
15
  max_length: z.number().optional(),
16
16
  });
17
17
  export const access_code_constraint = z.union([
18
- simple_access_code_constraint,
19
- complex_access_code_constraint,
18
+ access_code_code_constraint,
19
+ access_code_name_constraint,
20
20
  ]);
21
21
  export const access_code_capability_properties = z.object({
22
22
  code_constraints: z.array(access_code_constraint).optional(),
@@ -1 +1 @@
1
- {"version":3,"file":"access-code.js","sourceRoot":"","sources":["../../../../../../src/lib/seam/connect/unstable/models/capability-properties/access-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7C,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC;QACtB,UAAU;QACV,sBAAsB;QACtB,4BAA4B;QAC5B,yBAAyB;QACzB,+BAA+B;QAC/B,sBAAsB,EAAE,UAAU;KACnC,CAAC;CACH,CAAC,CAAA;AAEF,MAAM,8BAA8B,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,CAAC;IACxC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC5C,6BAA6B;IAC7B,8BAA8B;CAC/B,CAAC,CAAA;AAIF,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,QAAQ,EAAE;IAC5D,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACtD,0BAA0B,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjD,gCAAgC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACxD,uBAAuB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAChD,CAAC,CAAA"}
1
+ {"version":3,"file":"access-code.js","sourceRoot":"","sources":["../../../../../../src/lib/seam/connect/unstable/models/capability-properties/access-code.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,eAAe,EAAE,CAAC,CAAC,IAAI,CAAC;QACtB,UAAU;QACV,sBAAsB;QACtB,4BAA4B;QAC5B,yBAAyB;QACzB,+BAA+B;QAC/B,sBAAsB,EAAE,UAAU;KACnC,CAAC;CACH,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,CAAC,MAAM,CAAC;IAClD,eAAe,EAAE,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;IACzC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjC,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAClC,CAAC,CAAA;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC;IAC5C,2BAA2B;IAC3B,2BAA2B;CAC5B,CAAC,CAAA;AAIF,MAAM,CAAC,MAAM,iCAAiC,GAAG,CAAC,CAAC,MAAM,CAAC;IACxD,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,QAAQ,EAAE;IAC5D,sBAAsB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;IACtD,0BAA0B,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IACjD,gCAAgC,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;IACxD,uBAAuB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;CAChD,CAAC,CAAA"}
@@ -1,7 +1,7 @@
1
- import { access_code_capability_properties } from './access-code.js';
1
+ import { access_code_capability_properties, access_code_code_constraint } from './access-code.js';
2
2
  import { lock_capability_properties } from './lock.js';
3
3
  import { climate_setting, climate_setting_schedule, hvac_mode_setting, thermostat_capability_properties } from './thermostat.js';
4
- export { access_code_capability_properties, climate_setting, climate_setting_schedule, hvac_mode_setting, lock_capability_properties, thermostat_capability_properties, };
4
+ export { access_code_capability_properties, access_code_code_constraint, climate_setting, climate_setting_schedule, hvac_mode_setting, lock_capability_properties, thermostat_capability_properties, };
5
5
  export declare const capability_properties: import("zod").ZodObject<{
6
6
  code_constraints: import("zod").ZodOptional<import("zod").ZodOptional<import("zod").ZodArray<import("zod").ZodUnion<[import("zod").ZodObject<{
7
7
  constraint_type: import("zod").ZodEnum<["no_zeros", "cannot_start_with_12", "no_triple_consecutive_ints", "cannot_specify_pin_code", "pin_code_matches_existing_set", "start_date_in_future"]>;
@@ -10,7 +10,7 @@ export declare const capability_properties: import("zod").ZodObject<{
10
10
  }, {
11
11
  constraint_type: "no_zeros" | "cannot_start_with_12" | "no_triple_consecutive_ints" | "cannot_specify_pin_code" | "pin_code_matches_existing_set" | "start_date_in_future";
12
12
  }>, import("zod").ZodObject<{
13
- constraint_type: import("zod").ZodEnum<["name_length"]>;
13
+ constraint_type: import("zod").ZodLiteral<"name_length">;
14
14
  min_length: import("zod").ZodOptional<import("zod").ZodNumber>;
15
15
  max_length: import("zod").ZodOptional<import("zod").ZodNumber>;
16
16
  }, "strip", import("zod").ZodTypeAny, {
@@ -1,7 +1,7 @@
1
- import { access_code_capability_properties } from './access-code.js';
1
+ import { access_code_capability_properties, access_code_code_constraint, } from './access-code.js';
2
2
  import { lock_capability_properties } from './lock.js';
3
3
  import { climate_setting, climate_setting_schedule, hvac_mode_setting, thermostat_capability_properties, } from './thermostat.js';
4
- export { access_code_capability_properties, climate_setting, climate_setting_schedule, hvac_mode_setting, lock_capability_properties, thermostat_capability_properties, };
4
+ export { access_code_capability_properties, access_code_code_constraint, climate_setting, climate_setting_schedule, hvac_mode_setting, lock_capability_properties, thermostat_capability_properties, };
5
5
  // todo: discriminate based on capability and remove intersection type
6
6
  export const capability_properties = access_code_capability_properties
7
7
  .partial()
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/lib/seam/connect/unstable/models/capability-properties/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAE,MAAM,kBAAkB,CAAA;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,iBAAiB,EACjB,gCAAgC,GACjC,MAAM,iBAAiB,CAAA;AAExB,OAAO,EACL,iCAAiC,EACjC,eAAe,EACf,wBAAwB,EACxB,iBAAiB,EACjB,0BAA0B,EAC1B,gCAAgC,GACjC,CAAA;AAED,sEAAsE;AACtE,MAAM,CAAC,MAAM,qBAAqB,GAAG,iCAAiC;KACnE,OAAO,EAAE;KACT,KAAK,CAAC,0BAA0B,CAAC,OAAO,EAAE,CAAC;KAC3C,KAAK,CAAC,gCAAgC,CAAC,OAAO,EAAE,CAAC,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../src/lib/seam/connect/unstable/models/capability-properties/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iCAAiC,EACjC,2BAA2B,GAC5B,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,0BAA0B,EAAE,MAAM,WAAW,CAAA;AACtD,OAAO,EACL,eAAe,EACf,wBAAwB,EACxB,iBAAiB,EACjB,gCAAgC,GACjC,MAAM,iBAAiB,CAAA;AAExB,OAAO,EACL,iCAAiC,EACjC,2BAA2B,EAC3B,eAAe,EACf,wBAAwB,EACxB,iBAAiB,EACjB,0BAA0B,EAC1B,gCAAgC,GACjC,CAAA;AAED,sEAAsE;AACtE,MAAM,CAAC,MAAM,qBAAqB,GAAG,iCAAiC;KACnE,OAAO,EAAE;KACT,KAAK,CAAC,0BAA0B,CAAC,OAAO,EAAE,CAAC;KAC3C,KAAK,CAAC,gCAAgC,CAAC,OAAO,EAAE,CAAC,CAAA"}
@@ -852,7 +852,7 @@ export declare const managed_device: z.ZodObject<{
852
852
  }, {
853
853
  constraint_type: "no_zeros" | "cannot_start_with_12" | "no_triple_consecutive_ints" | "cannot_specify_pin_code" | "pin_code_matches_existing_set" | "start_date_in_future";
854
854
  }>, z.ZodObject<{
855
- constraint_type: z.ZodEnum<["name_length"]>;
855
+ constraint_type: z.ZodLiteral<"name_length">;
856
856
  min_length: z.ZodOptional<z.ZodNumber>;
857
857
  max_length: z.ZodOptional<z.ZodNumber>;
858
858
  }, "strip", z.ZodTypeAny, {
@@ -1 +1 @@
1
- export { any_device_type, battery_status, capabilities, climate_setting, climate_setting_schedule, common_device_properties, lock_device_type, managed_device, noise_sensor_device_type, thermostat_device_type, unmanaged_device, } from './models/index.js';
1
+ export { access_code_code_constraint, any_device_type, battery_status, capabilities, climate_setting, climate_setting_schedule, common_device_properties, lock_device_type, managed_device, noise_sensor_device_type, thermostat_device_type, unmanaged_device, } from './models/index.js';
@@ -1,2 +1,2 @@
1
- export { any_device_type, battery_status, capabilities, climate_setting, climate_setting_schedule, common_device_properties, lock_device_type, managed_device, noise_sensor_device_type, thermostat_device_type, unmanaged_device, } from './models/index.js';
1
+ export { access_code_code_constraint, any_device_type, battery_status, capabilities, climate_setting, climate_setting_schedule, common_device_properties, lock_device_type, managed_device, noise_sensor_device_type, thermostat_device_type, unmanaged_device, } from './models/index.js';
2
2
  //# sourceMappingURL=schemas.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../../src/lib/seam/connect/unstable/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,cAAc,EACd,YAAY,EACZ,eAAe,EACf,wBAAwB,EACxB,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,wBAAwB,EACxB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,mBAAmB,CAAA"}
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../../../../src/lib/seam/connect/unstable/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,eAAe,EACf,cAAc,EACd,YAAY,EACZ,eAAe,EACf,wBAAwB,EACxB,wBAAwB,EACxB,gBAAgB,EAChB,cAAc,EACd,wBAAwB,EACxB,sBAAsB,EACtB,gBAAgB,GACjB,MAAM,mBAAmB,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamapi/types",
3
- "version": "0.20.1",
3
+ "version": "0.21.0",
4
4
  "description": "TypeScript types for the Seam API.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -144,6 +144,34 @@ export interface Routes {
144
144
  }
145
145
  }
146
146
  }
147
+ '/access_codes/generate_code': {
148
+ route: '/access_codes/generate_code'
149
+ method: 'GET'
150
+ queryParams: {}
151
+ jsonBody: {}
152
+ commonParams: {
153
+ device_id: string
154
+ }
155
+ formData: {}
156
+ jsonResponse: {
157
+ generated_code: {
158
+ device_id: string
159
+ code: string
160
+ is_valid: true
161
+ conflicts_with_existing_code: false
162
+ violated_code_constraints: []
163
+ passed_code_constraints: Array<{
164
+ constraint_type:
165
+ | 'no_zeros'
166
+ | 'cannot_start_with_12'
167
+ | 'no_triple_consecutive_ints'
168
+ | 'cannot_specify_pin_code'
169
+ | 'pin_code_matches_existing_set'
170
+ | 'start_date_in_future'
171
+ }>
172
+ }
173
+ }
174
+ }
147
175
  '/access_codes/get': {
148
176
  route: '/access_codes/get'
149
177
  method: 'GET' | 'POST'
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod'
2
2
 
3
- const simple_access_code_constraint = z.object({
3
+ export const access_code_code_constraint = z.object({
4
4
  constraint_type: z.enum([
5
5
  'no_zeros', // Nuki
6
6
  'cannot_start_with_12', // Nuki
@@ -11,15 +11,15 @@ const simple_access_code_constraint = z.object({
11
11
  ]),
12
12
  })
13
13
 
14
- const complex_access_code_constraint = z.object({
15
- constraint_type: z.enum(['name_length']), // Nuki, Kwikset
14
+ export const access_code_name_constraint = z.object({
15
+ constraint_type: z.literal('name_length'), // Nuki, Kwikset
16
16
  min_length: z.number().optional(),
17
17
  max_length: z.number().optional(),
18
18
  })
19
19
 
20
20
  export const access_code_constraint = z.union([
21
- simple_access_code_constraint,
22
- complex_access_code_constraint,
21
+ access_code_code_constraint,
22
+ access_code_name_constraint,
23
23
  ])
24
24
 
25
25
  export type AccessCodeConstraint = z.infer<typeof access_code_constraint>
@@ -1,4 +1,7 @@
1
- import { access_code_capability_properties } from './access-code.js'
1
+ import {
2
+ access_code_capability_properties,
3
+ access_code_code_constraint,
4
+ } from './access-code.js'
2
5
  import { lock_capability_properties } from './lock.js'
3
6
  import {
4
7
  climate_setting,
@@ -9,6 +12,7 @@ import {
9
12
 
10
13
  export {
11
14
  access_code_capability_properties,
15
+ access_code_code_constraint,
12
16
  climate_setting,
13
17
  climate_setting_schedule,
14
18
  hvac_mode_setting,
@@ -1,4 +1,5 @@
1
1
  export {
2
+ access_code_code_constraint,
2
3
  any_device_type,
3
4
  battery_status,
4
5
  capabilities,