Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 5 additions & 22 deletions src/lib/seam/connect/models/access-codes/managed-access-code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,16 +134,14 @@ const failed_to_issue = common_access_code_error.extend({
Seam was unable to issue this access code before its start time, so the recipient may be unable to unlock the device. This usually points to a problem that needs attention, such as an offline or disconnected device. Seam keeps retrying, and this error clears automatically if the access code is eventually issued.
`)

const failed_to_apply_mutations = common_access_code_error.extend({
error_code: z
.literal('failed_to_apply_mutations')
.describe(error_code_description),
const failed_to_update = common_access_code_error.extend({
error_code: z.literal('failed_to_update').describe(error_code_description),
}).describe(`
---
resource_type: access_code
undocumented: Unreleased.
---
Seam was unable to apply this access code's pending mutations to the device, so the code on the device does not match its requested state. Seam keeps retrying, and this error clears automatically once the mutations are applied.
Seam was unable to apply this access code's requested update to the device, so the code on the device does not match its requested state. Seam keeps retrying, and this error clears automatically once the update is applied.
`)

const failed_to_expire = common_access_code_error.extend({
Expand Down Expand Up @@ -189,7 +187,7 @@ const access_code_error = z
access_code_inactive_error,
code_constraints_violated,
failed_to_issue,
failed_to_apply_mutations,
failed_to_update,
failed_to_expire,
])
.describe(
Expand All @@ -214,7 +212,7 @@ const _access_code_error_map = z.object({
access_code_inactive: access_code_inactive_error.optional().nullable(),
code_constraints_violated: code_constraints_violated.optional().nullable(),
failed_to_issue: failed_to_issue.optional().nullable(),
failed_to_apply_mutations: failed_to_apply_mutations.optional().nullable(),
failed_to_update: failed_to_update.optional().nullable(),
failed_to_expire: failed_to_expire.optional().nullable(),
})

Expand Down Expand Up @@ -309,17 +307,6 @@ const delay_in_issuing = common_access_code_warning.extend({
Seam has not yet issued this access code, even though its start time is approaching, so access may not be ready when the recipient arrives. Seam is still attempting to issue it, and this warning clears automatically once issuance succeeds.
`)

const delay_in_applying_mutations = common_access_code_warning.extend({
warning_code: z
.literal('delay_in_applying_mutations')
.describe(warning_code_description),
}).describe(`
---
undocumented: Unreleased.
---
Seam has not yet applied this access code's pending mutations to the device, so the code on the device does not yet match its requested state. Seam is still attempting to apply them, and this warning clears automatically once the mutations are applied.
`)

const third_party_integration_detected = common_access_code_warning
.extend({
warning_code: z
Expand Down Expand Up @@ -378,7 +365,6 @@ const access_code_warning = z
delay_in_setting_on_device,
delay_in_removing_from_device,
delay_in_issuing,
delay_in_applying_mutations,
third_party_integration_detected,
igloo_algopin_must_be_used_within_24_hours,
management_transferred,
Expand All @@ -404,9 +390,6 @@ const _access_code_warning_map = z.object({
.optional()
.nullable(),
delay_in_issuing: delay_in_issuing.optional().nullable(),
delay_in_applying_mutations: delay_in_applying_mutations
.optional()
.nullable(),
third_party_integration_detected: third_party_integration_detected
.optional()
.nullable(),
Expand Down
29 changes: 6 additions & 23 deletions src/lib/seam/connect/models/events/access-codes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,36 +345,20 @@ export type AccessCodeFailedToIssueEvent = z.infer<
typeof access_code_failed_to_issue_event
>

export const access_code_delay_in_applying_mutations_event = access_code_event
export const access_code_failed_to_update_event = access_code_event
.extend({
event_type: z.literal('access_code.delay_in_applying_mutations'),
event_type: z.literal('access_code.failed_to_update'),
})
.extend(access_code_event_issue_properties).describe(`
---
route_path: /access_codes
undocumented: Unreleased.
---
Seam has not yet applied this [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes)'s pending mutations to the device, so the code on the device does not yet match its requested state. Seam is still attempting to apply them, and the accompanying \`delay_in_applying_mutations\` warning clears automatically once the mutations are applied.
Seam was unable to apply this [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes)'s requested update to the device, so the code on the device does not match its requested state. Seam keeps retrying, and the accompanying \`failed_to_update\` error clears automatically once the update is applied.
`)

export type AccessCodeDelayInApplyingMutationsEvent = z.infer<
typeof access_code_delay_in_applying_mutations_event
>

export const access_code_failed_to_apply_mutations_event = access_code_event
.extend({
event_type: z.literal('access_code.failed_to_apply_mutations'),
})
.extend(access_code_event_issue_properties).describe(`
---
route_path: /access_codes
undocumented: Unreleased.
---
Seam was unable to apply this [access code](https://docs.seam.co/low-level-apis/smart-locks/access-codes)'s pending mutations to the device, so the code on the device does not match its requested state. Seam keeps retrying, and the accompanying \`failed_to_apply_mutations\` error clears automatically once the mutations are applied.
`)

export type AccessCodeFailedToApplyMutationsEvent = z.infer<
typeof access_code_failed_to_apply_mutations_event
export type AccessCodeFailedToUpdateEvent = z.infer<
typeof access_code_failed_to_update_event
>

export const access_code_failed_to_expire_event = access_code_event
Expand Down Expand Up @@ -556,8 +540,7 @@ export const access_code_events = [
access_code_issued_event,
access_code_delay_in_issuing_event,
access_code_failed_to_issue_event,
access_code_delay_in_applying_mutations_event,
access_code_failed_to_apply_mutations_event,
access_code_failed_to_update_event,
access_code_failed_to_expire_event,
access_code_deleted_event,
access_code_delay_in_removing_from_device_event,
Expand Down
Loading
Loading