Skip to content

Commit

Permalink
feat: Allow optional ends_at for acs_user.access_schedule (#1275)
Browse files Browse the repository at this point in the history
  • Loading branch information
seambot authored Nov 21, 2024
1 parent a5e4b95 commit 027aa41
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 17 deletions.
3 changes: 2 additions & 1 deletion src/lib/seam/connect/models/schedule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export const start_end_schedule = z.object({
.datetime()
.describe(
"Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.",
),
)
.nullable(),
})

// export const schedule = z.union([
Expand Down
16 changes: 11 additions & 5 deletions src/lib/seam/connect/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,7 @@ export default {
description:
"Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.",
format: 'date-time',
nullable: true,
type: 'string',
},
starts_at: {
Expand Down Expand Up @@ -11102,12 +11103,15 @@ export default {
properties: {
access_schedule: {
description:
"`starts_at` and `ends_at` timestamps for the new `acs_user`'s access. If you specify an `access_schedule`, you must include both `starts_at` and `ends_at`. `ends_at` must be a time in the future and after `starts_at`. Only applicable to Salto KS access control systems.",
"`starts_at` and `ends_at` timestamps for the new `acs_user`'s access. If you specify an `access_schedule`, you may include both `starts_at` and `ends_at`. `starts_at` defaults to the current time if not provided. `ends_at` is optional and must be a time in the future and after `starts_at`.",
properties: {
ends_at: { format: 'date-time', type: 'string' },
ends_at: {
format: 'date-time',
nullable: true,
type: 'string',
},
starts_at: { format: 'date-time', type: 'string' },
},
required: ['starts_at', 'ends_at'],
type: 'object',
},
acs_access_group_ids: {
Expand Down Expand Up @@ -11619,6 +11623,7 @@ export default {
description:
"Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.",
format: 'date-time',
nullable: true,
type: 'string',
},
starts_at: {
Expand Down Expand Up @@ -12011,6 +12016,7 @@ export default {
description:
"Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format.",
format: 'date-time',
nullable: true,
type: 'string',
},
starts_at: {
Expand Down Expand Up @@ -12433,7 +12439,7 @@ export default {
properties: {
access_schedule: {
description:
"`starts_at` and `ends_at` timestamps for the `acs_user`'s access. If you specify an `access_schedule`, you must include both `starts_at` and `ends_at`. `ends_at` must be a time in the future and after `starts_at`. Only applicable to Salto KS access control systems.",
"`starts_at` and `ends_at` timestamps for the `acs_user`'s access. If you specify an `access_schedule`, you must include both `starts_at` and `ends_at`. `ends_at` must be a time in the future and after `starts_at`.",
nullable: true,
properties: {
ends_at: { format: 'date-time', type: 'string' },
Expand Down Expand Up @@ -12513,7 +12519,7 @@ export default {
properties: {
access_schedule: {
description:
"`starts_at` and `ends_at` timestamps for the `acs_user`'s access. If you specify an `access_schedule`, you must include both `starts_at` and `ends_at`. `ends_at` must be a time in the future and after `starts_at`. Only applicable to Salto KS access control systems.",
"`starts_at` and `ends_at` timestamps for the `acs_user`'s access. If you specify an `access_schedule`, you must include both `starts_at` and `ends_at`. `ends_at` must be a time in the future and after `starts_at`.",
nullable: true,
properties: {
ends_at: { format: 'date-time', type: 'string' },
Expand Down
22 changes: 11 additions & 11 deletions src/lib/seam/connect/route-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4836,7 +4836,7 @@ export interface Routes {
/** Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
starts_at: string
/** Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
ends_at: string
ends_at: string | null
}
| undefined
/** ID of the user identity associated with the `acs_user`. */
Expand Down Expand Up @@ -8964,11 +8964,11 @@ export interface Routes {
acs_access_group_ids?: string[]
/** ID of the user identity with which to associate the new `acs_user`. */
user_identity_id?: string | undefined
/** `starts_at` and `ends_at` timestamps for the new `acs_user`'s access. If you specify an `access_schedule`, you must include both `starts_at` and `ends_at`. `ends_at` must be a time in the future and after `starts_at`. Only applicable to Salto KS access control systems. */
/** `starts_at` and `ends_at` timestamps for the new `acs_user`'s access. If you specify an `access_schedule`, you may include both `starts_at` and `ends_at`. `starts_at` defaults to the current time if not provided. `ends_at` is optional and must be a time in the future and after `starts_at`. */
access_schedule?:
| {
starts_at: string
ends_at: string
starts_at?: string | undefined
ends_at?: (string | undefined) | null
}
| undefined
/** Full name of the `acs_user`. */
Expand Down Expand Up @@ -9017,7 +9017,7 @@ export interface Routes {
/** Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
starts_at: string
/** Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
ends_at: string
ends_at: string | null
}
| undefined
/** ID of the user identity associated with the `acs_user`. */
Expand Down Expand Up @@ -9152,7 +9152,7 @@ export interface Routes {
/** Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
starts_at: string
/** Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
ends_at: string
ends_at: string | null
}
| undefined
/** ID of the user identity associated with the `acs_user`. */
Expand Down Expand Up @@ -9283,7 +9283,7 @@ export interface Routes {
/** Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
starts_at: string
/** Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
ends_at: string
ends_at: string | null
}
| undefined
/** ID of the user identity associated with the `acs_user`. */
Expand Down Expand Up @@ -9525,7 +9525,7 @@ export interface Routes {
/** Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
starts_at: string
/** Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
ends_at: string
ends_at: string | null
}
| undefined
/** ID of the user identity associated with the `acs_user`. */
Expand Down Expand Up @@ -9651,7 +9651,7 @@ export interface Routes {
/** Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
starts_at: string
/** Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
ends_at: string
ends_at: string | null
}
| undefined
/** ID of the user identity associated with the `acs_user`. */
Expand Down Expand Up @@ -9747,7 +9747,7 @@ export interface Routes {
method: 'PATCH' | 'POST'
queryParams: {}
jsonBody: {
/** `starts_at` and `ends_at` timestamps for the `acs_user`'s access. If you specify an `access_schedule`, you must include both `starts_at` and `ends_at`. `ends_at` must be a time in the future and after `starts_at`. Only applicable to Salto KS access control systems. */
/** `starts_at` and `ends_at` timestamps for the `acs_user`'s access. If you specify an `access_schedule`, you must include both `starts_at` and `ends_at`. `ends_at` must be a time in the future and after `starts_at`. */
access_schedule?:
| ({
starts_at: string
Expand Down Expand Up @@ -35862,7 +35862,7 @@ export interface Routes {
/** Date and time at which the user's access starts, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
starts_at: string
/** Date and time at which the user's access ends, in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html) format. */
ends_at: string
ends_at: string | null
}
| undefined
/** ID of the user identity associated with the `acs_user`. */
Expand Down

0 comments on commit 027aa41

Please sign in to comment.