@seamapi/http 2.6.0 → 2.7.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/lib/resources/access-code.d.ts +19 -0
  2. package/lib/resources/access-grant.d.ts +4 -0
  3. package/lib/resources/access-method.d.ts +4 -0
  4. package/lib/resources/action-attempt.d.ts +4 -0
  5. package/lib/resources/event.d.ts +3 -22
  6. package/lib/resources/unmanaged-access-code.d.ts +19 -0
  7. package/lib/resources/unmanaged-access-method.d.ts +4 -0
  8. package/lib/resources/unmanaged-user-identity.d.ts +8 -0
  9. package/lib/resources/user-identity.d.ts +8 -0
  10. package/lib/routes/acs/credentials/credentials.d.ts +6 -6
  11. package/lib/routes/acs/encoders/encoders.d.ts +4 -4
  12. package/lib/routes/seam-http-endpoints.d.ts +12 -2
  13. package/lib/routes/seam-http-endpoints.js +16 -0
  14. package/lib/routes/seam-http-endpoints.js.map +1 -1
  15. package/lib/routes/user-identities/user-identities.d.ts +35 -0
  16. package/lib/routes/user-identities/user-identities.js +21 -0
  17. package/lib/routes/user-identities/user-identities.js.map +1 -1
  18. package/lib/version.d.ts +1 -1
  19. package/lib/version.js +1 -1
  20. package/package.json +2 -2
  21. package/src/lib/resources/access-code.ts +22 -0
  22. package/src/lib/resources/access-grant.ts +5 -0
  23. package/src/lib/resources/access-method.ts +5 -0
  24. package/src/lib/resources/action-attempt.ts +5 -0
  25. package/src/lib/resources/event.ts +3 -134
  26. package/src/lib/resources/unmanaged-access-code.ts +22 -0
  27. package/src/lib/resources/unmanaged-access-method.ts +5 -0
  28. package/src/lib/resources/unmanaged-user-identity.ts +10 -0
  29. package/src/lib/resources/user-identity.ts +10 -0
  30. package/src/lib/routes/acs/credentials/credentials.ts +6 -6
  31. package/src/lib/routes/acs/encoders/encoders.ts +4 -4
  32. package/src/lib/routes/seam-http-endpoints.ts +26 -0
  33. package/src/lib/routes/user-identities/user-identities.ts +53 -0
  34. package/src/lib/version.ts +1 -1
@@ -3,141 +3,10 @@
3
3
  * Do not edit this file.
4
4
  */
5
5
 
6
+ /**
7
+ * An [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes) was created.
8
+ */
6
9
  export type SeamEvent =
7
- | {
8
- /**
9
- * Date and time at which the event was created.
10
- */
11
- created_at?: string | undefined
12
- /**
13
- * Human-readable description of the event. Persisted when the event is created (so the creating code, including a provider, can supply a tailored description) and otherwise derived from the event.
14
- */
15
- event_description?: string | undefined
16
- /**
17
- * ID of the event.
18
- */
19
- event_id?: string | undefined
20
-
21
- event_type?:
22
- | 'access_code.created'
23
- | 'access_code.changed'
24
- | 'access_code.name_changed'
25
- | 'access_code.code_changed'
26
- | 'access_code.time_frame_changed'
27
- | 'access_code.mutations_requested'
28
- | 'access_code.scheduled_on_device'
29
- | 'access_code.set_on_device'
30
- | 'access_code.removed_from_device'
31
- | 'access_code.delay_in_setting_on_device'
32
- | 'access_code.failed_to_set_on_device'
33
- | 'access_code.deleted'
34
- | 'access_code.delay_in_removing_from_device'
35
- | 'access_code.failed_to_remove_from_device'
36
- | 'access_code.modified_external_to_seam'
37
- | 'access_code.deleted_external_to_seam'
38
- | 'access_code.backup_access_code_pulled'
39
- | 'access_code.unmanaged.converted_to_managed'
40
- | 'access_code.unmanaged.failed_to_convert_to_managed'
41
- | 'access_code.unmanaged.created'
42
- | 'access_code.unmanaged.removed'
43
- | 'access_grant.created'
44
- | 'access_grant.deleted'
45
- | 'access_grant.access_granted_to_all_doors'
46
- | 'access_grant.access_granted_to_door'
47
- | 'access_grant.access_to_door_lost'
48
- | 'access_grant.access_times_changed'
49
- | 'access_grant.could_not_create_requested_access_methods'
50
- | 'access_method.issued'
51
- | 'access_method.revoked'
52
- | 'access_method.card_encoding_required'
53
- | 'access_method.deleted'
54
- | 'access_method.reissued'
55
- | 'access_method.created'
56
- | 'access_method.delay_in_issuing'
57
- | 'access_method.failed_to_issue'
58
- | 'acs_system.connected'
59
- | 'acs_system.added'
60
- | 'acs_system.disconnected'
61
- | 'acs_credential.deleted'
62
- | 'acs_credential.issued'
63
- | 'acs_credential.reissued'
64
- | 'acs_credential.invalidated'
65
- | 'acs_user.created'
66
- | 'acs_user.deleted'
67
- | 'acs_encoder.added'
68
- | 'acs_encoder.removed'
69
- | 'acs_access_group.deleted'
70
- | 'acs_entrance.added'
71
- | 'acs_entrance.removed'
72
- | 'client_session.deleted'
73
- | 'connected_account.connected'
74
- | 'connected_account.created'
75
- | 'connected_account.successful_login'
76
- | 'connected_account.disconnected'
77
- | 'connected_account.completed_first_sync'
78
- | 'connected_account.deleted'
79
- | 'connected_account.completed_first_sync_after_reconnection'
80
- | 'connected_account.reauthorization_requested'
81
- | 'action_attempt.lock_door.succeeded'
82
- | 'action_attempt.lock_door.failed'
83
- | 'action_attempt.unlock_door.succeeded'
84
- | 'action_attempt.unlock_door.failed'
85
- | 'action_attempt.simulate_keypad_code_entry.succeeded'
86
- | 'action_attempt.simulate_keypad_code_entry.failed'
87
- | 'action_attempt.simulate_manual_lock_via_keypad.succeeded'
88
- | 'action_attempt.simulate_manual_lock_via_keypad.failed'
89
- | 'connect_webview.login_succeeded'
90
- | 'connect_webview.login_failed'
91
- | 'device.connected'
92
- | 'device.added'
93
- | 'device.converted_to_unmanaged'
94
- | 'device.unmanaged.converted_to_managed'
95
- | 'device.unmanaged.connected'
96
- | 'device.disconnected'
97
- | 'device.unmanaged.disconnected'
98
- | 'device.tampered'
99
- | 'device.low_battery'
100
- | 'device.battery_status_changed'
101
- | 'device.removed'
102
- | 'device.deleted'
103
- | 'device.third_party_integration_detected'
104
- | 'device.third_party_integration_no_longer_detected'
105
- | 'device.salto.privacy_mode_activated'
106
- | 'device.salto.privacy_mode_deactivated'
107
- | 'device.connection_became_flaky'
108
- | 'device.connection_stabilized'
109
- | 'device.error.subscription_required'
110
- | 'device.error.subscription_required.resolved'
111
- | 'device.accessory_keypad_connected'
112
- | 'device.accessory_keypad_disconnected'
113
- | 'noise_sensor.noise_threshold_triggered'
114
- | 'lock.locked'
115
- | 'lock.unlocked'
116
- | 'lock.access_denied'
117
- | 'thermostat.climate_preset_activated'
118
- | 'thermostat.manually_adjusted'
119
- | 'thermostat.temperature_threshold_exceeded'
120
- | 'thermostat.temperature_threshold_no_longer_exceeded'
121
- | 'thermostat.temperature_reached_set_point'
122
- | 'thermostat.temperature_changed'
123
- | 'device.name_changed'
124
- | 'camera.activated'
125
- | 'device.doorbell_rang'
126
- | 'enrollment_automation.deleted'
127
- | 'phone.deactivated'
128
- | 'space.device_membership_changed'
129
- | 'space.created'
130
- | 'space.deleted'
131
- | undefined
132
- /**
133
- * Date and time at which the event occurred.
134
- */
135
- occurred_at?: string | undefined
136
- /**
137
- * ID of the workspace associated with the event.
138
- */
139
- workspace_id?: string | undefined
140
- }
141
10
  | {
142
11
  /**
143
12
  * ID of the affected access code.
@@ -276,6 +276,28 @@ export type UnmanagedAccessCode = {
276
276
  */
277
277
  is_access_code_error: boolean
278
278
 
279
+ /**
280
+ * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
281
+ */
282
+ message: string
283
+ } /**
284
+ * The code cannot be set on the device because it violates the device's code constraints (for example, its length, digits, or a too-simple value). The code will not be retried until you change it. See the device's `code_constraints` and `supported_code_lengths`.
285
+ */
286
+ | {
287
+ /**
288
+ * Date and time at which Seam created the error.
289
+ */
290
+ created_at?: string | undefined
291
+ /**
292
+ * Unique identifier of the type of error. Enables quick recognition and categorization of the issue.
293
+ */
294
+ error_code: 'code_constraints_violated'
295
+
296
+ /**
297
+ * Indicates that this is an access code error.
298
+ */
299
+ is_access_code_error: boolean
300
+
279
301
  /**
280
302
  * Detailed description of the error. Provides insights into the issue and potentially how to rectify it.
281
303
  */
@@ -26,6 +26,11 @@ export type UnmanagedAccessMethod = {
26
26
  */
27
27
  display_name: string
28
28
 
29
+ /**
30
+ * Human-readable sentence describing where the access method sits in its relationship with the device or access system, for example `Awaiting encoding`. For display only. The wording is not stable and is not an enumeration — it may change at any time, so never compare against or branch on it. To make decisions, read `is_issued`, `errors`, and `pending_mutations`.
31
+ */
32
+ display_status: string
33
+
29
34
  /**
30
35
  * Errors associated with the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant).
31
36
  */
@@ -65,6 +65,16 @@ export type UnmanagedUserIdentity = {
65
65
  * Full name of the user associated with the user identity.
66
66
  */
67
67
  full_name: string | null
68
+ /**
69
+ * IDs that other user identities used to have before they were merged into this user identity. Looking up any of them returns this user identity.
70
+ */
71
+ merged_user_identity_ids: Array<string>
72
+
73
+ /**
74
+ * Keys that other user identities used to have before they were merged into this user identity. Looking up any of them returns this user identity.
75
+ */
76
+ merged_user_identity_keys: Array<string>
77
+
68
78
  /**
69
79
  * Unique phone number for the user identity in [E.164 format](https://www.itu.int/rec/T-REC-E.164/en) (for example, +15555550100).
70
80
  */
@@ -65,6 +65,16 @@ export type UserIdentity = {
65
65
  * Full name of the user associated with the user identity.
66
66
  */
67
67
  full_name: string | null
68
+ /**
69
+ * IDs that other user identities used to have before they were merged into this user identity. Looking up any of them returns this user identity.
70
+ */
71
+ merged_user_identity_ids: Array<string>
72
+
73
+ /**
74
+ * Keys that other user identities used to have before they were merged into this user identity. Looking up any of them returns this user identity.
75
+ */
76
+ merged_user_identity_keys: Array<string>
77
+
68
78
  /**
69
79
  * Unique phone number for the user identity in [E.164 format](https://www.itu.int/rec/T-REC-E.164/en) (for example, +15555550100).
70
80
  */
@@ -470,18 +470,14 @@ export type AcsCredentialsGetRequest = SeamHttpRequest<
470
470
  export interface AcsCredentialsGetOptions {}
471
471
 
472
472
  export type AcsCredentialsListParameters = {
473
- /**
474
- * ID of the access system user for which you want to retrieve all credentials.
475
- */
476
- acs_user_id?: string | undefined
477
473
  /**
478
474
  * ID of the access system for which you want to retrieve all credentials.
479
475
  */
480
476
  acs_system_id?: string | undefined
481
477
  /**
482
- * ID of the user identity for which you want to retrieve all credentials.
478
+ * ID of the access system user for which you want to retrieve all credentials.
483
479
  */
484
- user_identity_id?: string | undefined
480
+ acs_user_id?: string | undefined
485
481
  /**
486
482
  * Date and time, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format, before which events to return were created.
487
483
  */
@@ -502,6 +498,10 @@ export type AcsCredentialsListParameters = {
502
498
  * String for which to search. Filters returned credentials to include all records that satisfy a partial match using `display_name`, `code`, `card_number`, `acs_user_id` or `acs_credential_id`.
503
499
  */
504
500
  search?: string | undefined
501
+ /**
502
+ * ID of the user identity for which you want to retrieve all credentials.
503
+ */
504
+ user_identity_id?: string | undefined
505
505
  }
506
506
 
507
507
  /**
@@ -326,6 +326,10 @@ export type AcsEncodersGetRequest = SeamHttpRequest<
326
326
  export interface AcsEncodersGetOptions {}
327
327
 
328
328
  export type AcsEncodersListParameters = {
329
+ /**
330
+ * IDs of the encoders that you want to retrieve.
331
+ */
332
+ acs_encoder_ids?: Array<string> | undefined
329
333
  /**
330
334
  * ID of the access system for which you want to retrieve all encoders.
331
335
  */
@@ -334,10 +338,6 @@ export type AcsEncodersListParameters = {
334
338
  * IDs of the access systems for which you want to retrieve all encoders.
335
339
  */
336
340
  acs_system_ids?: Array<string> | undefined
337
- /**
338
- * IDs of the encoders that you want to retrieve.
339
- */
340
- acs_encoder_ids?: Array<string> | undefined
341
341
  /**
342
342
  * Number of encoders to return.
343
343
  */
@@ -699,6 +699,9 @@ import {
699
699
  type UserIdentitiesListOptions,
700
700
  type UserIdentitiesListParameters,
701
701
  type UserIdentitiesListRequest,
702
+ type UserIdentitiesMergeOptions,
703
+ type UserIdentitiesMergeParameters,
704
+ type UserIdentitiesMergeRequest,
702
705
  type UserIdentitiesRemoveAcsUserOptions,
703
706
  type UserIdentitiesRemoveAcsUserParameters,
704
707
  type UserIdentitiesRemoveAcsUserRequest,
@@ -3970,6 +3973,28 @@ export class SeamHttpEndpoints {
3970
3973
  }
3971
3974
  }
3972
3975
 
3976
+ /**
3977
+ * Merges one or more [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) into a primary user identity, for when the same person ended up with more than one user identity.
3978
+ *
3979
+ * The primary user identity takes on any email address or phone number it was missing from the user identities merged into it, and the merged user identities are then deleted. Their IDs and keys keep working: looking one up returns the primary user identity, and they are listed on it as `merged_user_identity_ids` and `merged_user_identity_keys`.
3980
+ *
3981
+ * Access grants, access system users, client sessions and other resources belonging to the merged user identities are moved to the primary user identity.
3982
+ *
3983
+ * Identify the user identities either by ID or by key, but not both in the same request. Repeating a merge that has already been applied makes no further changes.
3984
+ */
3985
+ get '/user_identities/merge'(): (
3986
+ parameters: UserIdentitiesMergeParameters,
3987
+ options?: UserIdentitiesMergeOptions,
3988
+ ) => UserIdentitiesMergeRequest {
3989
+ const { client, defaults } = this
3990
+ return function userIdentitiesMerge(
3991
+ ...args: Parameters<SeamHttpUserIdentities['merge']>
3992
+ ): ReturnType<SeamHttpUserIdentities['merge']> {
3993
+ const seam = SeamHttpUserIdentities.fromClient(client, defaults)
3994
+ return seam.merge(...args)
3995
+ }
3996
+ }
3997
+
3973
3998
  /**
3974
3999
  * Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity).
3975
4000
  */
@@ -4442,6 +4467,7 @@ export type SeamHttpEndpointMutationPaths =
4442
4467
  | '/user_identities/delete'
4443
4468
  | '/user_identities/generate_instant_key'
4444
4469
  | '/user_identities/grant_access_to_device'
4470
+ | '/user_identities/merge'
4445
4471
  | '/user_identities/remove_acs_user'
4446
4472
  | '/user_identities/revoke_access_to_device'
4447
4473
  | '/user_identities/update'
@@ -386,6 +386,31 @@ export class SeamHttpUserIdentities {
386
386
  })
387
387
  }
388
388
 
389
+ /**
390
+ * Merges one or more [user identities](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity) into a primary user identity, for when the same person ended up with more than one user identity.
391
+ *
392
+ * The primary user identity takes on any email address or phone number it was missing from the user identities merged into it, and the merged user identities are then deleted. Their IDs and keys keep working: looking one up returns the primary user identity, and they are listed on it as `merged_user_identity_ids` and `merged_user_identity_keys`.
393
+ *
394
+ * Access grants, access system users, client sessions and other resources belonging to the merged user identities are moved to the primary user identity.
395
+ *
396
+ * Identify the user identities either by ID or by key, but not both in the same request. Repeating a merge that has already been applied makes no further changes.
397
+ */
398
+ merge(
399
+ parameters: UserIdentitiesMergeParameters,
400
+ options: UserIdentitiesMergeOptions = {},
401
+ ): UserIdentitiesMergeRequest {
402
+ return new SeamHttpRequest(this, {
403
+ pathname: '/user_identities/merge',
404
+ method: 'POST',
405
+ body: parameters,
406
+ parameters,
407
+ hasRequiredParameters: true,
408
+ requiredParameterNames: [],
409
+ responseKey: undefined,
410
+ options,
411
+ })
412
+ }
413
+
389
414
  /**
390
415
  * Removes a specified [access system user](https://docs.seam.co/low-level-apis/access-systems/user-management) from a specified [user identity](https://docs.seam.co/capability-guides/mobile-access/managing-mobile-app-user-accounts-with-user-identities#what-is-a-user-identity).
391
416
  */
@@ -714,6 +739,34 @@ export type UserIdentitiesListAcsUsersRequest = SeamHttpRequest<
714
739
 
715
740
  export interface UserIdentitiesListAcsUsersOptions {}
716
741
 
742
+ export type UserIdentitiesMergeParameters = RequireAtLeastOne<{
743
+ /**
744
+ * IDs of the user identities to merge into the primary user identity. These user identities are deleted.
745
+ */
746
+ merged_user_identity_ids?: Array<string> | undefined
747
+ /**
748
+ * ID of the primary user identity to keep.
749
+ */
750
+ user_identity_id?: string | undefined
751
+ /**
752
+ * Keys of the user identities to merge into the primary user identity. These user identities are deleted.
753
+ */
754
+ merged_user_identity_keys?: Array<string> | undefined
755
+ /**
756
+ * Key of the primary user identity to keep.
757
+ */
758
+ user_identity_key?: string | undefined
759
+ }>
760
+
761
+ /**
762
+ * @deprecated Use UserIdentitiesMergeRequest instead.
763
+ */
764
+ export type UserIdentitiesMergeResponse = void
765
+
766
+ export type UserIdentitiesMergeRequest = SeamHttpRequest<void, undefined>
767
+
768
+ export interface UserIdentitiesMergeOptions {}
769
+
717
770
  export type UserIdentitiesRemoveAcsUserParameters = {
718
771
  /**
719
772
  * ID of the access system user that you want to remove from the user identity..
@@ -1,3 +1,3 @@
1
- const seamapiJavascriptHttpVersion = '2.6.0'
1
+ const seamapiJavascriptHttpVersion = '2.7.0'
2
2
 
3
3
  export default seamapiJavascriptHttpVersion