@seamapi/types 1.249.0 → 1.252.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.
Files changed (34) hide show
  1. package/dist/connect.cjs +254 -51
  2. package/dist/connect.cjs.map +1 -1
  3. package/dist/connect.d.cts +1219 -12
  4. package/lib/seam/connect/models/action-attempts/action-attempt.d.ts +93 -0
  5. package/lib/seam/connect/models/action-attempts/action-attempt.js +2 -0
  6. package/lib/seam/connect/models/action-attempts/action-attempt.js.map +1 -1
  7. package/lib/seam/connect/models/action-attempts/read-card.d.ts +96 -0
  8. package/lib/seam/connect/models/action-attempts/read-card.js +36 -0
  9. package/lib/seam/connect/models/action-attempts/read-card.js.map +1 -0
  10. package/lib/seam/connect/models/events/acs/common.d.ts +3 -3
  11. package/lib/seam/connect/models/events/acs/common.js +2 -1
  12. package/lib/seam/connect/models/events/acs/common.js.map +1 -1
  13. package/lib/seam/connect/models/events/acs/credentials.d.ts +6 -6
  14. package/lib/seam/connect/models/events/acs/index.d.ts +35 -9
  15. package/lib/seam/connect/models/events/acs/systems.d.ts +60 -6
  16. package/lib/seam/connect/models/events/acs/systems.js +9 -1
  17. package/lib/seam/connect/models/events/acs/systems.js.map +1 -1
  18. package/lib/seam/connect/models/events/acs/users.d.ts +6 -6
  19. package/lib/seam/connect/models/events/devices.d.ts +86 -0
  20. package/lib/seam/connect/models/events/devices.js +21 -0
  21. package/lib/seam/connect/models/events/devices.js.map +1 -1
  22. package/lib/seam/connect/models/events/seam-event.d.ts +35 -9
  23. package/lib/seam/connect/openapi.d.ts +138 -1
  24. package/lib/seam/connect/openapi.js +156 -0
  25. package/lib/seam/connect/openapi.js.map +1 -1
  26. package/lib/seam/connect/route-types.d.ts +1104 -153
  27. package/package.json +1 -1
  28. package/src/lib/seam/connect/models/action-attempts/action-attempt.ts +2 -0
  29. package/src/lib/seam/connect/models/action-attempts/read-card.ts +46 -0
  30. package/src/lib/seam/connect/models/events/acs/common.ts +2 -1
  31. package/src/lib/seam/connect/models/events/acs/systems.ts +12 -1
  32. package/src/lib/seam/connect/models/events/devices.ts +33 -0
  33. package/src/lib/seam/connect/openapi.ts +158 -0
  34. package/src/lib/seam/connect/route-types.ts +1115 -55
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seamapi/types",
3
- "version": "1.249.0",
3
+ "version": "1.252.0",
4
4
  "description": "TypeScript types for the Seam API.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -3,6 +3,7 @@ import { z } from 'zod'
3
3
  import { activate_climate_preset_action_attempt } from './activate-climate-preset.js'
4
4
  import { deprecated_action_attempts } from './deprecated.js'
5
5
  import { lock_door_action_attempt } from './lock-door.js'
6
+ import { read_card_action_attempt } from './read-card.js'
6
7
  import { reset_sandbox_workspace_action_attempt } from './reset-sandbox-workspace.js'
7
8
  import { set_cool_action_attempt } from './set-cool.js'
8
9
  import { set_fan_mode_action_attempt } from './set-fan-mode.js'
@@ -14,6 +15,7 @@ import { unlock_door_action_attempt } from './unlock-door.js'
14
15
  export const action_attempt = z.union([
15
16
  ...lock_door_action_attempt.options,
16
17
  ...unlock_door_action_attempt.options,
18
+ ...read_card_action_attempt.options,
17
19
  ...reset_sandbox_workspace_action_attempt.options,
18
20
  ...set_cool_action_attempt.options,
19
21
  ...set_heat_action_attempt.options,
@@ -0,0 +1,46 @@
1
+ import { z } from 'zod'
2
+
3
+ import {
4
+ common_failed_action_attempt,
5
+ common_pending_action_attempt,
6
+ common_succeeded_action_attempt,
7
+ } from './common.js'
8
+
9
+ const action_type = z.literal('READ_CARD')
10
+
11
+ const error = z.object({
12
+ type: z.string(), // TODO This should be typed properly with the possible errors
13
+ message: z.string(),
14
+ })
15
+
16
+ const result = z.object({
17
+ acs_credential_id: z
18
+ .string()
19
+ .uuid()
20
+ .nullable()
21
+ .describe('Matching acs_credential currently encoded on this card.'),
22
+ card_number: z
23
+ .string()
24
+ .nullable()
25
+ .describe('A number or sting that physically identifies this card.'),
26
+ // TODO visionline_metadata: visionline_credential_metadata,
27
+ })
28
+
29
+ export const read_card_action_attempt = z.discriminatedUnion('status', [
30
+ common_pending_action_attempt
31
+ .extend({
32
+ action_type,
33
+ })
34
+ .describe('Reading card data from physical encoder.'),
35
+ common_succeeded_action_attempt
36
+ .extend({
37
+ action_type,
38
+ result,
39
+ })
40
+ .describe('Reading card data from physical encoder succeeded.'),
41
+ common_failed_action_attempt
42
+ .extend({ action_type, error })
43
+ .describe('Reading card data from physical encoder failed.'),
44
+ ])
45
+
46
+ export type ReadCardActionAttempt = z.infer<typeof read_card_action_attempt>
@@ -3,9 +3,10 @@ import { z } from 'zod'
3
3
  import { common_event } from '../common.js'
4
4
 
5
5
  export const common_acs_event = common_event.extend({
6
- connected_account_id: z.string().uuid().describe(`
6
+ connected_account_id: z.string().uuid().optional().describe(`
7
7
  ---
8
8
  title: Connected Account ID
9
+ deprecated: Will be removed.
9
10
  ---
10
11
  ID of the connected account.
11
12
  `),
@@ -12,4 +12,15 @@ export const acs_system_connected_event = acs_system_event
12
12
 
13
13
  export type AcsSystemConnectedEvent = z.infer<typeof acs_system_connected_event>
14
14
 
15
- export const acs_system_events = [acs_system_connected_event] as const
15
+ export const acs_system_added_event = acs_system_event
16
+ .extend({
17
+ event_type: z.literal('acs_system.added'),
18
+ })
19
+ .describe('An ACS system was added.')
20
+
21
+ export type AcsSystemAddedEvent = z.infer<typeof acs_system_added_event>
22
+
23
+ export const acs_system_events = [
24
+ acs_system_connected_event,
25
+ acs_system_added_event,
26
+ ] as const
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod'
2
2
 
3
+ import { climate_setting } from '../thermostats/climate-preset.js'
3
4
  import { common_event } from './common.js'
4
5
 
5
6
  const device_event = common_event.extend({
@@ -341,6 +342,36 @@ export const lock_access_denied_event = device_event
341
342
 
342
343
  export type LockAccessDeniedEvent = z.infer<typeof lock_access_denied_event>
343
344
 
345
+ export const thermostat_climate_preset_activated_event = device_event
346
+ .extend({
347
+ event_type: z.literal('thermostat.climate_preset_activated'),
348
+ thermostat_schedule_id: z.string().uuid().nullable(),
349
+ climate_preset_key: z.string(),
350
+ is_fallback_climate_preset: z.boolean(),
351
+ })
352
+ .describe('A thermostat climate preset was activated.')
353
+
354
+ export type ThermostatClimatePresetActivatedEvent = z.infer<
355
+ typeof thermostat_climate_preset_activated_event
356
+ >
357
+
358
+ export const thermostat_manually_adjusted_event = device_event
359
+ .merge(
360
+ climate_setting.pick({
361
+ fan_mode_setting: true,
362
+ hvac_mode_setting: true,
363
+ cooling_set_point_celsius: true,
364
+ heating_set_point_celsius: true,
365
+ cooling_set_point_fahrenheit: true,
366
+ heating_set_point_fahrenheit: true,
367
+ }),
368
+ )
369
+ .describe('A thermostat was manually adjusted.')
370
+
371
+ export type ThermostatManuallyAdjustedEvent = z.infer<
372
+ typeof thermostat_manually_adjusted_event
373
+ >
374
+
344
375
  export const device_events = [
345
376
  device_connected_event,
346
377
  device_converted_to_unmanaged_event,
@@ -367,4 +398,6 @@ export const device_events = [
367
398
  lock_locked_event,
368
399
  lock_unlocked_event,
369
400
  lock_access_denied_event,
401
+ // thermostat_climate_preset_activated_event,
402
+ // thermostat_manually_adjusted_event,
370
403
  ] as const
@@ -1174,6 +1174,100 @@ export default {
1174
1174
  ],
1175
1175
  type: 'object',
1176
1176
  },
1177
+ {
1178
+ description: 'Reading card data from physical encoder.',
1179
+ properties: {
1180
+ action_attempt_id: {
1181
+ description: 'The ID of the action attempt.',
1182
+ format: 'uuid',
1183
+ type: 'string',
1184
+ 'x-title': 'Action Attempt ID',
1185
+ },
1186
+ action_type: { enum: ['READ_CARD'], type: 'string' },
1187
+ error: { nullable: true },
1188
+ result: { nullable: true },
1189
+ status: { enum: ['pending'], type: 'string' },
1190
+ },
1191
+ required: [
1192
+ 'action_attempt_id',
1193
+ 'status',
1194
+ 'result',
1195
+ 'error',
1196
+ 'action_type',
1197
+ ],
1198
+ type: 'object',
1199
+ },
1200
+ {
1201
+ description: 'Reading card data from physical encoder succeeded.',
1202
+ properties: {
1203
+ action_attempt_id: {
1204
+ description: 'The ID of the action attempt.',
1205
+ format: 'uuid',
1206
+ type: 'string',
1207
+ 'x-title': 'Action Attempt ID',
1208
+ },
1209
+ action_type: { enum: ['READ_CARD'], type: 'string' },
1210
+ error: { nullable: true },
1211
+ result: {
1212
+ properties: {
1213
+ acs_credential_id: {
1214
+ description:
1215
+ 'Matching acs_credential currently encoded on this card.',
1216
+ format: 'uuid',
1217
+ nullable: true,
1218
+ type: 'string',
1219
+ },
1220
+ card_number: {
1221
+ description:
1222
+ 'A number or sting that physically identifies this card.',
1223
+ nullable: true,
1224
+ type: 'string',
1225
+ },
1226
+ },
1227
+ required: ['acs_credential_id', 'card_number'],
1228
+ type: 'object',
1229
+ },
1230
+ status: { enum: ['success'], type: 'string' },
1231
+ },
1232
+ required: [
1233
+ 'action_attempt_id',
1234
+ 'status',
1235
+ 'error',
1236
+ 'action_type',
1237
+ 'result',
1238
+ ],
1239
+ type: 'object',
1240
+ },
1241
+ {
1242
+ description: 'Reading card data from physical encoder failed.',
1243
+ properties: {
1244
+ action_attempt_id: {
1245
+ description: 'The ID of the action attempt.',
1246
+ format: 'uuid',
1247
+ type: 'string',
1248
+ 'x-title': 'Action Attempt ID',
1249
+ },
1250
+ action_type: { enum: ['READ_CARD'], type: 'string' },
1251
+ error: {
1252
+ properties: {
1253
+ message: { type: 'string' },
1254
+ type: { type: 'string' },
1255
+ },
1256
+ required: ['type', 'message'],
1257
+ type: 'object',
1258
+ },
1259
+ result: { nullable: true },
1260
+ status: { enum: ['error'], type: 'string' },
1261
+ },
1262
+ required: [
1263
+ 'action_attempt_id',
1264
+ 'status',
1265
+ 'result',
1266
+ 'action_type',
1267
+ 'error',
1268
+ ],
1269
+ type: 'object',
1270
+ },
1177
1271
  {
1178
1272
  description: 'Resetting sandbox workspace.',
1179
1273
  properties: {
@@ -6716,6 +6810,68 @@ export default {
6716
6810
  'x-fern-sdk-return-value': 'acs_entrances',
6717
6811
  },
6718
6812
  },
6813
+ '/acs/credentials/read_card': {
6814
+ post: {
6815
+ operationId: 'acsCredentialsReadCardPost',
6816
+ requestBody: {
6817
+ content: {
6818
+ 'application/json': {
6819
+ schema: {
6820
+ oneOf: [
6821
+ {
6822
+ properties: {
6823
+ acs_system_id: { format: 'uuid', type: 'string' },
6824
+ device_name: { type: 'string' },
6825
+ },
6826
+ required: ['acs_system_id', 'device_name'],
6827
+ type: 'object',
6828
+ },
6829
+ {
6830
+ properties: {
6831
+ device_id: { format: 'uuid', type: 'string' },
6832
+ },
6833
+ required: ['device_id'],
6834
+ type: 'object',
6835
+ },
6836
+ ],
6837
+ },
6838
+ },
6839
+ },
6840
+ },
6841
+ responses: {
6842
+ 200: {
6843
+ content: {
6844
+ 'application/json': {
6845
+ schema: {
6846
+ properties: {
6847
+ action_attempt: {
6848
+ $ref: '#/components/schemas/action_attempt',
6849
+ },
6850
+ ok: { type: 'boolean' },
6851
+ },
6852
+ required: ['action_attempt', 'ok'],
6853
+ type: 'object',
6854
+ },
6855
+ },
6856
+ },
6857
+ description: 'OK',
6858
+ },
6859
+ 400: { description: 'Bad Request' },
6860
+ 401: { description: 'Unauthorized' },
6861
+ },
6862
+ security: [
6863
+ { pat_with_workspace: [] },
6864
+ { console_session: [] },
6865
+ { api_key: [] },
6866
+ ],
6867
+ summary: '/acs/credentials/read_card',
6868
+ tags: ['/acs'],
6869
+ 'x-fern-sdk-group-name': ['acs', 'credentials'],
6870
+ 'x-fern-sdk-method-name': 'read_card',
6871
+ 'x-fern-sdk-return-value': 'action_attempt',
6872
+ 'x-undocumented': 'Reading a card is currently unimplemented.',
6873
+ },
6874
+ },
6719
6875
  '/acs/credentials/unassign': {
6720
6876
  patch: {
6721
6877
  operationId: 'acsCredentialsUnassignPatch',
@@ -11490,6 +11646,7 @@ export default {
11490
11646
  'connect_webview.login_failed',
11491
11647
  'noise_sensor.noise_threshold_triggered',
11492
11648
  'access_code.backup_access_code_pulled',
11649
+ 'acs_system.added',
11493
11650
  'acs_system.connected',
11494
11651
  'acs_user.deleted',
11495
11652
  'acs_credential.deleted',
@@ -11557,6 +11714,7 @@ export default {
11557
11714
  'connect_webview.login_failed',
11558
11715
  'noise_sensor.noise_threshold_triggered',
11559
11716
  'access_code.backup_access_code_pulled',
11717
+ 'acs_system.added',
11560
11718
  'acs_system.connected',
11561
11719
  'acs_user.deleted',
11562
11720
  'acs_credential.deleted',