@seamapi/types 1.990.0 → 1.991.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.990.0",
3
+ "version": "1.991.0",
4
4
  "description": "TypeScript types for the Seam API.",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -124,17 +124,6 @@ const no_space_for_access_code_on_device = common_access_code_error.extend({
124
124
  No space for access code on device.
125
125
  `)
126
126
 
127
- const insufficient_permissions = common_access_code_error.extend({
128
- error_code: z
129
- .literal('insufficient_permissions')
130
- .describe(error_code_description),
131
- }).describe(`
132
- ---
133
- resource_type: access_code
134
- ---
135
- Admin role required—insufficient permissions to manage PINs on this device. Please have an admin update your role, or ask them to set the PIN.
136
- `)
137
-
138
127
  const access_code_inactive_error = common_access_code_error.extend({
139
128
  error_code: z
140
129
  .literal('access_code_inactive')
@@ -155,7 +144,6 @@ const access_code_error = z
155
144
  no_space_for_access_code_on_device,
156
145
  conflicting_external_modification_error,
157
146
  access_code_inactive_error,
158
- insufficient_permissions,
159
147
  ])
160
148
  .describe(
161
149
  'Errors associated with the [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes).',
@@ -173,7 +161,6 @@ const _access_code_error_map = z.object({
173
161
  .optional()
174
162
  .nullable(),
175
163
  duplicate_code_on_device: duplicate_code_on_device.optional().nullable(),
176
- insufficient_permissions: insufficient_permissions.optional().nullable(),
177
164
  conflicting_external_modification: conflicting_external_modification_error
178
165
  .optional()
179
166
  .nullable(),
@@ -460,21 +447,9 @@ export const access_code = z.object({
460
447
  .datetime()
461
448
  .describe('Date and time at which the access code was created.'),
462
449
  errors: z.array(
463
- // Deduped on error_code, mirroring how device_and_connected_account_error_options
464
- // already dedupes connected_account against device: a code defined for both an
465
- // access code and a device/connected account would otherwise be a duplicate
466
- // discriminator value and make zod throw at module load. The access-code
467
- // variant wins, since this array hangs off an access code.
468
450
  z.discriminatedUnion('error_code', [
469
451
  ...access_code_error.options,
470
- ...device_and_connected_account_error_options.filter(
471
- (_device_or_connected_account_error) =>
472
- !access_code_error.options.some(
473
- (_access_code_error) =>
474
- _access_code_error.shape.error_code.value ===
475
- _device_or_connected_account_error.shape.error_code.value,
476
- ),
477
- ),
452
+ ...device_and_connected_account_error_options,
478
453
  ]),
479
454
  ).describe(`
480
455
  ---
@@ -285,10 +285,7 @@ const subscription_required = common_device_error.extend({
285
285
  Indicates that a subscription is required to connect.
286
286
  `)
287
287
 
288
- // Named with an `_error` suffix because a device *warning* of the same code
289
- // already exists further down this file (Kwikset member-level access). Both are
290
- // valid: they live in separate maps, and the wire value is identical.
291
- const insufficient_permissions_error = common_device_error.extend({
288
+ const insufficient_permissions = common_device_error.extend({
292
289
  error_code: z
293
290
  .literal('insufficient_permissions')
294
291
  .describe(error_code_description),
@@ -311,7 +308,7 @@ export const device_error = z
311
308
  .discriminatedUnion('error_code', [
312
309
  account_disconnected,
313
310
  salto_ks_subscription_limit_exceeded,
314
- insufficient_permissions_error,
311
+ insufficient_permissions,
315
312
  dormakaba_sites_disconnected,
316
313
  device_offline,
317
314
  device_removed,
@@ -340,9 +337,7 @@ export const device_error_map = z.object({
340
337
  salto_ks_subscription_limit_exceeded: salto_ks_subscription_limit_exceeded
341
338
  .optional()
342
339
  .nullable(),
343
- insufficient_permissions: insufficient_permissions_error
344
- .optional()
345
- .nullable(),
340
+ insufficient_permissions: insufficient_permissions.optional().nullable(),
346
341
  dormakaba_sites_disconnected: dormakaba_sites_disconnected
347
342
  .optional()
348
343
  .nullable(),
@@ -662,17 +657,6 @@ const max_access_codes_reached = common_device_warning.extend({
662
657
  Indicates that the device has reached its maximum number of active access codes. Delete existing codes before creating new ones.
663
658
  `)
664
659
 
665
- const insufficient_permissions = common_device_warning.extend({
666
- warning_code: z
667
- .literal('insufficient_permissions')
668
- .describe(warning_code_description),
669
- }).describe(`
670
- ---
671
- variant_group_key: locks
672
- ---
673
- Indicates that the connected Kwikset account has member-level access to this lock's home. Admin or owner access is required to manage access codes and control the lock remotely.
674
- `)
675
-
676
660
  const device_warning = z.discriminatedUnion('warning_code', [
677
661
  partial_backup_access_code_pool,
678
662
  many_active_backup_codes,
@@ -701,7 +685,6 @@ const device_warning = z.discriminatedUnion('warning_code', [
701
685
  accessory_keypad_setup_required,
702
686
  unreliable_online_status,
703
687
  max_access_codes_reached,
704
- insufficient_permissions,
705
688
  ])
706
689
 
707
690
  export type DeviceWarning = z.infer<typeof device_warning>
@@ -760,7 +743,6 @@ export const device_warning_map = z.object({
760
743
  .nullable(),
761
744
  unreliable_online_status: unreliable_online_status.optional().nullable(),
762
745
  max_access_codes_reached: max_access_codes_reached.optional().nullable(),
763
- insufficient_permissions: insufficient_permissions.optional().nullable(),
764
746
  })
765
747
 
766
748
  export type DeviceWarningMap = z.infer<typeof device_warning_map>
@@ -368,8 +368,7 @@ const openapi: OpenAPISpec = {
368
368
  'x-resource-type': 'access_code',
369
369
  },
370
370
  {
371
- description:
372
- 'Admin role required—insufficient permissions to manage PINs on this device. Please have an admin update your role, or ask them to set the PIN.',
371
+ description: 'Indicates that the account is disconnected.',
373
372
  properties: {
374
373
  created_at: {
375
374
  description:
@@ -380,27 +379,40 @@ const openapi: OpenAPISpec = {
380
379
  error_code: {
381
380
  description:
382
381
  'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.',
383
- enum: ['insufficient_permissions'],
382
+ enum: ['account_disconnected'],
384
383
  type: 'string',
385
384
  },
386
- is_access_code_error: {
385
+ is_connected_account_error: {
387
386
  description:
388
- 'Indicates that this is an access code error.',
387
+ 'Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error.',
389
388
  enum: [true],
390
389
  type: 'boolean',
391
390
  },
391
+ is_device_error: {
392
+ description:
393
+ 'Indicates that the error is not a device error.',
394
+ enum: [false],
395
+ type: 'boolean',
396
+ },
392
397
  message: {
393
398
  description:
394
399
  'Detailed description of the error. Provides insights into the issue and potentially how to rectify it.',
395
400
  type: 'string',
396
401
  },
397
402
  },
398
- required: ['message', 'is_access_code_error', 'error_code'],
403
+ required: [
404
+ 'message',
405
+ 'is_device_error',
406
+ 'created_at',
407
+ 'error_code',
408
+ 'is_connected_account_error',
409
+ ],
399
410
  type: 'object',
400
- 'x-resource-type': 'access_code',
411
+ 'x-resource-type': 'connected_account',
401
412
  },
402
413
  {
403
- description: 'Indicates that the account is disconnected.',
414
+ description:
415
+ 'Indicates that the Salto site user limit has been reached.',
404
416
  properties: {
405
417
  created_at: {
406
418
  description:
@@ -411,7 +423,7 @@ const openapi: OpenAPISpec = {
411
423
  error_code: {
412
424
  description:
413
425
  'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.',
414
- enum: ['account_disconnected'],
426
+ enum: ['salto_ks_subscription_limit_exceeded'],
415
427
  type: 'string',
416
428
  },
417
429
  is_connected_account_error: {
@@ -441,10 +453,11 @@ const openapi: OpenAPISpec = {
441
453
  ],
442
454
  type: 'object',
443
455
  'x-resource-type': 'connected_account',
456
+ 'x-variant-group-key': 'locks',
444
457
  },
445
458
  {
446
459
  description:
447
- 'Indicates that the Salto site user limit has been reached.',
460
+ "Indicates that Seam's integration user does not have sufficient permissions on the provider's system to which this device belongs, so Seam cannot manage access codes or unlock the device. See the error message for specifics, then either reauthorize the connected account in Seam or grant the integration user the required permissions in the provider's system.",
448
461
  properties: {
449
462
  created_at: {
450
463
  description:
@@ -455,7 +468,7 @@ const openapi: OpenAPISpec = {
455
468
  error_code: {
456
469
  description:
457
470
  'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.',
458
- enum: ['salto_ks_subscription_limit_exceeded'],
471
+ enum: ['insufficient_permissions'],
459
472
  type: 'string',
460
473
  },
461
474
  is_connected_account_error: {
@@ -485,7 +498,6 @@ const openapi: OpenAPISpec = {
485
498
  ],
486
499
  type: 'object',
487
500
  'x-resource-type': 'connected_account',
488
- 'x-variant-group-key': 'locks',
489
501
  },
490
502
  {
491
503
  description:
@@ -17338,32 +17350,6 @@ const openapi: OpenAPISpec = {
17338
17350
  type: 'object',
17339
17351
  'x-variant-group-key': 'access_codes',
17340
17352
  },
17341
- {
17342
- description:
17343
- "Indicates that the connected Kwikset account has member-level access to this lock's home. Admin or owner access is required to manage access codes and control the lock remotely.",
17344
- properties: {
17345
- created_at: {
17346
- description:
17347
- 'Date and time at which Seam created the warning.',
17348
- format: 'date-time',
17349
- type: 'string',
17350
- },
17351
- message: {
17352
- description:
17353
- 'Detailed description of the warning. Provides insights into the issue and potentially how to rectify it.',
17354
- type: 'string',
17355
- },
17356
- warning_code: {
17357
- description:
17358
- 'Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.',
17359
- enum: ['insufficient_permissions'],
17360
- type: 'string',
17361
- },
17362
- },
17363
- required: ['message', 'created_at', 'warning_code'],
17364
- type: 'object',
17365
- 'x-variant-group-key': 'locks',
17366
- },
17367
17353
  ],
17368
17354
  },
17369
17355
  type: 'array',
@@ -30117,8 +30103,7 @@ const openapi: OpenAPISpec = {
30117
30103
  'x-resource-type': 'access_code',
30118
30104
  },
30119
30105
  {
30120
- description:
30121
- 'Admin role required—insufficient permissions to manage PINs on this device. Please have an admin update your role, or ask them to set the PIN.',
30106
+ description: 'Indicates that the account is disconnected.',
30122
30107
  properties: {
30123
30108
  created_at: {
30124
30109
  description:
@@ -30129,27 +30114,40 @@ const openapi: OpenAPISpec = {
30129
30114
  error_code: {
30130
30115
  description:
30131
30116
  'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.',
30132
- enum: ['insufficient_permissions'],
30117
+ enum: ['account_disconnected'],
30133
30118
  type: 'string',
30134
30119
  },
30135
- is_access_code_error: {
30120
+ is_connected_account_error: {
30136
30121
  description:
30137
- 'Indicates that this is an access code error.',
30122
+ 'Indicates that the error is a [connected account](https://docs.seam.co/api/connected_accounts) error.',
30138
30123
  enum: [true],
30139
30124
  type: 'boolean',
30140
30125
  },
30126
+ is_device_error: {
30127
+ description:
30128
+ 'Indicates that the error is not a device error.',
30129
+ enum: [false],
30130
+ type: 'boolean',
30131
+ },
30141
30132
  message: {
30142
30133
  description:
30143
30134
  'Detailed description of the error. Provides insights into the issue and potentially how to rectify it.',
30144
30135
  type: 'string',
30145
30136
  },
30146
30137
  },
30147
- required: ['message', 'is_access_code_error', 'error_code'],
30138
+ required: [
30139
+ 'message',
30140
+ 'is_device_error',
30141
+ 'created_at',
30142
+ 'error_code',
30143
+ 'is_connected_account_error',
30144
+ ],
30148
30145
  type: 'object',
30149
- 'x-resource-type': 'access_code',
30146
+ 'x-resource-type': 'connected_account',
30150
30147
  },
30151
30148
  {
30152
- description: 'Indicates that the account is disconnected.',
30149
+ description:
30150
+ 'Indicates that the Salto site user limit has been reached.',
30153
30151
  properties: {
30154
30152
  created_at: {
30155
30153
  description:
@@ -30160,7 +30158,7 @@ const openapi: OpenAPISpec = {
30160
30158
  error_code: {
30161
30159
  description:
30162
30160
  'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.',
30163
- enum: ['account_disconnected'],
30161
+ enum: ['salto_ks_subscription_limit_exceeded'],
30164
30162
  type: 'string',
30165
30163
  },
30166
30164
  is_connected_account_error: {
@@ -30190,10 +30188,11 @@ const openapi: OpenAPISpec = {
30190
30188
  ],
30191
30189
  type: 'object',
30192
30190
  'x-resource-type': 'connected_account',
30191
+ 'x-variant-group-key': 'locks',
30193
30192
  },
30194
30193
  {
30195
30194
  description:
30196
- 'Indicates that the Salto site user limit has been reached.',
30195
+ "Indicates that Seam's integration user does not have sufficient permissions on the provider's system to which this device belongs, so Seam cannot manage access codes or unlock the device. See the error message for specifics, then either reauthorize the connected account in Seam or grant the integration user the required permissions in the provider's system.",
30197
30196
  properties: {
30198
30197
  created_at: {
30199
30198
  description:
@@ -30204,7 +30203,7 @@ const openapi: OpenAPISpec = {
30204
30203
  error_code: {
30205
30204
  description:
30206
30205
  'Unique identifier of the type of error. Enables quick recognition and categorization of the issue.',
30207
- enum: ['salto_ks_subscription_limit_exceeded'],
30206
+ enum: ['insufficient_permissions'],
30208
30207
  type: 'string',
30209
30208
  },
30210
30209
  is_connected_account_error: {
@@ -30234,7 +30233,6 @@ const openapi: OpenAPISpec = {
30234
30233
  ],
30235
30234
  type: 'object',
30236
30235
  'x-resource-type': 'connected_account',
30237
- 'x-variant-group-key': 'locks',
30238
30236
  },
30239
30237
  {
30240
30238
  description:
@@ -35695,32 +35693,6 @@ const openapi: OpenAPISpec = {
35695
35693
  type: 'object',
35696
35694
  'x-variant-group-key': 'access_codes',
35697
35695
  },
35698
- {
35699
- description:
35700
- "Indicates that the connected Kwikset account has member-level access to this lock's home. Admin or owner access is required to manage access codes and control the lock remotely.",
35701
- properties: {
35702
- created_at: {
35703
- description:
35704
- 'Date and time at which Seam created the warning.',
35705
- format: 'date-time',
35706
- type: 'string',
35707
- },
35708
- message: {
35709
- description:
35710
- 'Detailed description of the warning. Provides insights into the issue and potentially how to rectify it.',
35711
- type: 'string',
35712
- },
35713
- warning_code: {
35714
- description:
35715
- 'Unique identifier of the type of warning. Enables quick recognition and categorization of the issue.',
35716
- enum: ['insufficient_permissions'],
35717
- type: 'string',
35718
- },
35719
- },
35720
- required: ['message', 'created_at', 'warning_code'],
35721
- type: 'object',
35722
- 'x-variant-group-key': 'locks',
35723
- },
35724
35696
  ],
35725
35697
  },
35726
35698
  type: 'array',