diff --git a/package-lock.json b/package-lock.json index 49c5c017..ba87a321 100644 --- a/package-lock.json +++ b/package-lock.json @@ -17,7 +17,7 @@ "@seamapi/blueprint": "^1.5.1", "@seamapi/fake-seam-connect": "^2.0.4", "@seamapi/smith": "^1.1.0", - "@seamapi/types": "1.1001.0", + "@seamapi/types": "1.1011.0", "@types/jsonwebtoken": "^9.0.6", "@types/node": "^24.10.9", "ava": "^8.0.1", @@ -1091,9 +1091,9 @@ } }, "node_modules/@seamapi/types": { - "version": "1.1001.0", - "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1001.0.tgz", - "integrity": "sha512-pwIEqMYCdOLlIHUzzLlMq/4K6QwAM3kWXooSxNWOlPyCeWk21SvrbTN/joXwZtky504g3unLPKMbFad1mlQyfQ==", + "version": "1.1011.0", + "resolved": "https://registry.npmjs.org/@seamapi/types/-/types-1.1011.0.tgz", + "integrity": "sha512-pf3ZnckX/L0cSOaOpU4JJNRzkJ5d9IknK5WPqhnBlOWDqeHkECIb1vXhkIJfXiF7aLLKZJGdN4h3hx1pKdtUKw==", "dev": true, "license": "MIT", "engines": { @@ -1692,9 +1692,6 @@ "arm64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1709,9 +1706,6 @@ "arm64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1726,9 +1720,6 @@ "loong64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1743,9 +1734,6 @@ "loong64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1760,9 +1748,6 @@ "ppc64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1777,9 +1762,6 @@ "riscv64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1794,9 +1776,6 @@ "riscv64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ @@ -1811,9 +1790,6 @@ "s390x" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1828,9 +1804,6 @@ "x64" ], "dev": true, - "libc": [ - "glibc" - ], "license": "MIT", "optional": true, "os": [ @@ -1845,9 +1818,6 @@ "x64" ], "dev": true, - "libc": [ - "musl" - ], "license": "MIT", "optional": true, "os": [ diff --git a/package.json b/package.json index b45e5138..4dc859a7 100644 --- a/package.json +++ b/package.json @@ -87,7 +87,7 @@ "@seamapi/blueprint": "^1.5.1", "@seamapi/fake-seam-connect": "^2.0.4", "@seamapi/smith": "^1.1.0", - "@seamapi/types": "1.1001.0", + "@seamapi/types": "1.1011.0", "@types/jsonwebtoken": "^9.0.6", "@types/node": "^24.10.9", "ava": "^8.0.1", diff --git a/src/lib/resources/access-code.ts b/src/lib/resources/access-code.ts index b156c55f..d354b143 100644 --- a/src/lib/resources/access-code.ts +++ b/src/lib/resources/access-code.ts @@ -270,6 +270,28 @@ export type AccessCode = { */ is_access_code_error: boolean + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + message: string + } /** + * 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`. + */ + | { + /** + * Date and time at which Seam created the error. + */ + created_at?: string | undefined + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + */ + error_code: 'code_constraints_violated' + + /** + * Indicates that this is an access code error. + */ + is_access_code_error: boolean + /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ diff --git a/src/lib/resources/access-grant.ts b/src/lib/resources/access-grant.ts index ddaa271b..facd9e5e 100644 --- a/src/lib/resources/access-grant.ts +++ b/src/lib/resources/access-grant.ts @@ -39,6 +39,11 @@ export type AccessGrant = { */ display_name: string + /** + * Human-readable sentence answering whether the user can currently get in, for example `Awaiting encoding` on an access method or `Upcoming` here. 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 `starts_at`, `ends_at`, `errors`, and the access methods' own fields. + */ + display_status: string + /** * Date and time at which the Access Grant ends. */ diff --git a/src/lib/resources/access-method.ts b/src/lib/resources/access-method.ts index 60b5cc84..a058c1cb 100644 --- a/src/lib/resources/access-method.ts +++ b/src/lib/resources/access-method.ts @@ -34,6 +34,11 @@ export type AccessMethod = { */ display_name: string + /** + * 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`. + */ + display_status: string + /** * Errors associated with the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). */ diff --git a/src/lib/resources/action-attempt.ts b/src/lib/resources/action-attempt.ts index 56c207a8..b90721da 100644 --- a/src/lib/resources/action-attempt.ts +++ b/src/lib/resources/action-attempt.ts @@ -1100,6 +1100,11 @@ export type ActionAttempt = */ display_name: string + /** + * 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`. + */ + display_status: string + /** * Errors associated with the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). */ diff --git a/src/lib/resources/unmanaged-access-code.ts b/src/lib/resources/unmanaged-access-code.ts index e281b5a7..e86acdc9 100644 --- a/src/lib/resources/unmanaged-access-code.ts +++ b/src/lib/resources/unmanaged-access-code.ts @@ -276,6 +276,28 @@ export type UnmanagedAccessCode = { */ is_access_code_error: boolean + /** + * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. + */ + message: string + } /** + * 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`. + */ + | { + /** + * Date and time at which Seam created the error. + */ + created_at?: string | undefined + /** + * Unique identifier of the type of error. Enables quick recognition and categorization of the issue. + */ + error_code: 'code_constraints_violated' + + /** + * Indicates that this is an access code error. + */ + is_access_code_error: boolean + /** * Detailed description of the error. Provides insights into the issue and potentially how to rectify it. */ diff --git a/src/lib/resources/unmanaged-access-method.ts b/src/lib/resources/unmanaged-access-method.ts index fd55a5e9..6999e22a 100644 --- a/src/lib/resources/unmanaged-access-method.ts +++ b/src/lib/resources/unmanaged-access-method.ts @@ -26,6 +26,11 @@ export type UnmanagedAccessMethod = { */ display_name: string + /** + * 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`. + */ + display_status: string + /** * Errors associated with the [access method](https://docs.seam.co/use-cases/granting-access/creating-an-access-grant). */ diff --git a/src/lib/resources/unmanaged-user-identity.ts b/src/lib/resources/unmanaged-user-identity.ts index d2aee55f..2fa18145 100644 --- a/src/lib/resources/unmanaged-user-identity.ts +++ b/src/lib/resources/unmanaged-user-identity.ts @@ -65,6 +65,16 @@ export type UnmanagedUserIdentity = { * Full name of the user associated with the user identity. */ full_name: string | null + /** + * 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. + */ + merged_user_identity_ids: Array + + /** + * 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. + */ + merged_user_identity_keys: Array + /** * Unique phone number for the user identity in [E.164 format](https://www.itu.int/rec/T-REC-E.164/en) (for example, +15555550100). */ diff --git a/src/lib/resources/user-identity.ts b/src/lib/resources/user-identity.ts index fe09f91a..56cfb247 100644 --- a/src/lib/resources/user-identity.ts +++ b/src/lib/resources/user-identity.ts @@ -65,6 +65,16 @@ export type UserIdentity = { * Full name of the user associated with the user identity. */ full_name: string | null + /** + * 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. + */ + merged_user_identity_ids: Array + + /** + * 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. + */ + merged_user_identity_keys: Array + /** * Unique phone number for the user identity in [E.164 format](https://www.itu.int/rec/T-REC-E.164/en) (for example, +15555550100). */ diff --git a/src/lib/routes/acs/credentials/credentials.ts b/src/lib/routes/acs/credentials/credentials.ts index 8a8ea004..4d433164 100644 --- a/src/lib/routes/acs/credentials/credentials.ts +++ b/src/lib/routes/acs/credentials/credentials.ts @@ -470,18 +470,14 @@ export type AcsCredentialsGetRequest = SeamHttpRequest< export interface AcsCredentialsGetOptions {} export type AcsCredentialsListParameters = { - /** - * ID of the access system user for which you want to retrieve all credentials. - */ - acs_user_id?: string | undefined /** * ID of the access system for which you want to retrieve all credentials. */ acs_system_id?: string | undefined /** - * ID of the user identity for which you want to retrieve all credentials. + * ID of the access system user for which you want to retrieve all credentials. */ - user_identity_id?: string | undefined + acs_user_id?: string | undefined /** * 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. */ @@ -502,6 +498,10 @@ export type AcsCredentialsListParameters = { * 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`. */ search?: string | undefined + /** + * ID of the user identity for which you want to retrieve all credentials. + */ + user_identity_id?: string | undefined } /** diff --git a/src/lib/routes/acs/encoders/encoders.ts b/src/lib/routes/acs/encoders/encoders.ts index 6b0473be..6805ff07 100644 --- a/src/lib/routes/acs/encoders/encoders.ts +++ b/src/lib/routes/acs/encoders/encoders.ts @@ -326,6 +326,10 @@ export type AcsEncodersGetRequest = SeamHttpRequest< export interface AcsEncodersGetOptions {} export type AcsEncodersListParameters = { + /** + * IDs of the encoders that you want to retrieve. + */ + acs_encoder_ids?: Array | undefined /** * ID of the access system for which you want to retrieve all encoders. */ @@ -334,10 +338,6 @@ export type AcsEncodersListParameters = { * IDs of the access systems for which you want to retrieve all encoders. */ acs_system_ids?: Array | undefined - /** - * IDs of the encoders that you want to retrieve. - */ - acs_encoder_ids?: Array | undefined /** * Number of encoders to return. */ diff --git a/src/lib/routes/seam-http-endpoints.ts b/src/lib/routes/seam-http-endpoints.ts index ed260485..960cf178 100644 --- a/src/lib/routes/seam-http-endpoints.ts +++ b/src/lib/routes/seam-http-endpoints.ts @@ -699,6 +699,9 @@ import { type UserIdentitiesListOptions, type UserIdentitiesListParameters, type UserIdentitiesListRequest, + type UserIdentitiesMergeOptions, + type UserIdentitiesMergeParameters, + type UserIdentitiesMergeRequest, type UserIdentitiesRemoveAcsUserOptions, type UserIdentitiesRemoveAcsUserParameters, type UserIdentitiesRemoveAcsUserRequest, @@ -3970,6 +3973,28 @@ export class SeamHttpEndpoints { } } + /** + * 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. + * + * 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`. + * + * Access grants, access system users, client sessions and other resources belonging to the merged user identities are moved to the primary user identity. + * + * 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. + */ + get '/user_identities/merge'(): ( + parameters: UserIdentitiesMergeParameters, + options?: UserIdentitiesMergeOptions, + ) => UserIdentitiesMergeRequest { + const { client, defaults } = this + return function userIdentitiesMerge( + ...args: Parameters + ): ReturnType { + const seam = SeamHttpUserIdentities.fromClient(client, defaults) + return seam.merge(...args) + } + } + /** * 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). */ @@ -4442,6 +4467,7 @@ export type SeamHttpEndpointMutationPaths = | '/user_identities/delete' | '/user_identities/generate_instant_key' | '/user_identities/grant_access_to_device' + | '/user_identities/merge' | '/user_identities/remove_acs_user' | '/user_identities/revoke_access_to_device' | '/user_identities/update' diff --git a/src/lib/routes/user-identities/user-identities.ts b/src/lib/routes/user-identities/user-identities.ts index 7eb18631..bb88bc74 100644 --- a/src/lib/routes/user-identities/user-identities.ts +++ b/src/lib/routes/user-identities/user-identities.ts @@ -386,6 +386,31 @@ export class SeamHttpUserIdentities { }) } + /** + * 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. + * + * 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`. + * + * Access grants, access system users, client sessions and other resources belonging to the merged user identities are moved to the primary user identity. + * + * 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. + */ + merge( + parameters: UserIdentitiesMergeParameters, + options: UserIdentitiesMergeOptions = {}, + ): UserIdentitiesMergeRequest { + return new SeamHttpRequest(this, { + pathname: '/user_identities/merge', + method: 'POST', + body: parameters, + parameters, + hasRequiredParameters: true, + requiredParameterNames: [], + responseKey: undefined, + options, + }) + } + /** * 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). */ @@ -714,6 +739,34 @@ export type UserIdentitiesListAcsUsersRequest = SeamHttpRequest< export interface UserIdentitiesListAcsUsersOptions {} +export type UserIdentitiesMergeParameters = RequireAtLeastOne<{ + /** + * IDs of the user identities to merge into the primary user identity. These user identities are deleted. + */ + merged_user_identity_ids?: Array | undefined + /** + * ID of the primary user identity to keep. + */ + user_identity_id?: string | undefined + /** + * Keys of the user identities to merge into the primary user identity. These user identities are deleted. + */ + merged_user_identity_keys?: Array | undefined + /** + * Key of the primary user identity to keep. + */ + user_identity_key?: string | undefined +}> + +/** + * @deprecated Use UserIdentitiesMergeRequest instead. + */ +export type UserIdentitiesMergeResponse = void + +export type UserIdentitiesMergeRequest = SeamHttpRequest + +export interface UserIdentitiesMergeOptions {} + export type UserIdentitiesRemoveAcsUserParameters = { /** * ID of the access system user that you want to remove from the user identity..