Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
seambot committed Dec 15, 2023
1 parent 70a1a79 commit b40d5a3
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 37 deletions.
20 changes: 18 additions & 2 deletions src/lib/seam/connect/openapi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ export default {
type: 'string',
},
email_address: { format: 'email', type: 'string' },
ends_at: { format: 'date-time', type: 'string' },
external_type: {
enum: ['pti_user', 'brivo_user', 'hid_cm_user', 'salto_site_user'],
type: 'string',
Expand All @@ -253,7 +254,9 @@ export default {
full_name: { type: 'string' },
hid_acs_system_id: { format: 'uuid', type: 'string' },
is_suspended: { type: 'boolean' },
is_virtual: { type: 'boolean' },
phone_number: { nullable: true, type: 'string' },
starts_at: { format: 'date-time', type: 'string' },
workspace_id: { format: 'uuid', type: 'string' },
},
required: [
Expand All @@ -262,9 +265,8 @@ export default {
'workspace_id',
'created_at',
'display_name',
'external_type',
'external_type_display_name',
'is_suspended',
'is_virtual',
],
type: 'object',
},
Expand Down Expand Up @@ -2076,6 +2078,7 @@ export default {
is_offline_access_code: { type: 'boolean' },
is_one_time_use: { type: 'boolean' },
max_time_rounding: {
default: '1hour',
enum: ['1hour', '1day', '1h', '1d'],
type: 'string',
},
Expand Down Expand Up @@ -2160,6 +2163,7 @@ export default {
is_offline_access_code: { type: 'boolean' },
is_one_time_use: { type: 'boolean' },
max_time_rounding: {
default: '1hour',
enum: ['1hour', '1day', '1h', '1d'],
type: 'string',
},
Expand Down Expand Up @@ -2241,6 +2245,7 @@ export default {
is_offline_access_code: { type: 'boolean' },
is_one_time_use: { type: 'boolean' },
max_time_rounding: {
default: '1hour',
enum: ['1hour', '1day', '1h', '1d'],
type: 'string',
},
Expand Down Expand Up @@ -2969,6 +2974,7 @@ export default {
is_offline_access_code: { type: 'boolean' },
is_one_time_use: { type: 'boolean' },
max_time_rounding: {
default: '1hour',
enum: ['1hour', '1day', '1h', '1d'],
type: 'string',
},
Expand Down Expand Up @@ -3043,6 +3049,7 @@ export default {
is_offline_access_code: { type: 'boolean' },
is_one_time_use: { type: 'boolean' },
max_time_rounding: {
default: '1hour',
enum: ['1hour', '1day', '1h', '1d'],
type: 'string',
},
Expand Down Expand Up @@ -3119,6 +3126,7 @@ export default {
is_offline_access_code: { type: 'boolean' },
is_one_time_use: { type: 'boolean' },
max_time_rounding: {
default: '1hour',
enum: ['1hour', '1day', '1h', '1d'],
type: 'string',
},
Expand Down Expand Up @@ -4761,6 +4769,14 @@ export default {
'application/json': {
schema: {
properties: {
access_schedule: {
properties: {
ends_at: { format: 'date-time', type: 'string' },
starts_at: { format: 'date-time', type: 'string' },
},
required: ['starts_at', 'ends_at'],
type: 'object',
},
acs_access_group_ids: {
default: [],
items: { format: 'uuid', type: 'string' },
Expand Down
75 changes: 43 additions & 32 deletions src/lib/seam/connect/route-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export interface Routes {
use_offline_access_code?: boolean | undefined
is_offline_access_code?: boolean | undefined
is_one_time_use?: boolean | undefined
max_time_rounding?: ('1hour' | '1day' | '1h' | '1d') | undefined
max_time_rounding?: '1hour' | '1day' | '1h' | '1d'
}
commonParams: {}
formData: {}
Expand Down Expand Up @@ -116,7 +116,7 @@ export interface Routes {
use_offline_access_code?: boolean | undefined
is_offline_access_code?: boolean | undefined
is_one_time_use?: boolean | undefined
max_time_rounding?: ('1hour' | '1day' | '1h' | '1d') | undefined
max_time_rounding?: '1hour' | '1day' | '1h' | '1d'
}
commonParams: {}
formData: {}
Expand Down Expand Up @@ -733,13 +733,14 @@ export interface Routes {
workspace_id: string
created_at: string
display_name: string
external_type:
| 'pti_user'
| 'brivo_user'
| 'hid_cm_user'
| 'salto_site_user'
external_type_display_name: string
external_type?:
| ('pti_user' | 'brivo_user' | 'hid_cm_user' | 'salto_site_user')
| undefined
external_type_display_name?: string | undefined
is_suspended: boolean
starts_at?: string | undefined
ends_at?: string | undefined
is_virtual: boolean
full_name?: string | undefined
/** Deprecated: use email_address. */
email?: string | undefined
Expand Down Expand Up @@ -1123,6 +1124,12 @@ export interface Routes {
jsonBody: {
acs_system_id: string
acs_access_group_ids?: string[]
access_schedule?:
| {
starts_at: string
ends_at: string
}
| undefined
full_name?: string | undefined
/** Deprecated: use email_address. */
email?: string | undefined
Expand All @@ -1139,13 +1146,14 @@ export interface Routes {
workspace_id: string
created_at: string
display_name: string
external_type:
| 'pti_user'
| 'brivo_user'
| 'hid_cm_user'
| 'salto_site_user'
external_type_display_name: string
external_type?:
| ('pti_user' | 'brivo_user' | 'hid_cm_user' | 'salto_site_user')
| undefined
external_type_display_name?: string | undefined
is_suspended: boolean
starts_at?: string | undefined
ends_at?: string | undefined
is_virtual: boolean
full_name?: string | undefined
/** Deprecated: use email_address. */
email?: string | undefined
Expand Down Expand Up @@ -1182,13 +1190,14 @@ export interface Routes {
workspace_id: string
created_at: string
display_name: string
external_type:
| 'pti_user'
| 'brivo_user'
| 'hid_cm_user'
| 'salto_site_user'
external_type_display_name: string
external_type?:
| ('pti_user' | 'brivo_user' | 'hid_cm_user' | 'salto_site_user')
| undefined
external_type_display_name?: string | undefined
is_suspended: boolean
starts_at?: string | undefined
ends_at?: string | undefined
is_virtual: boolean
full_name?: string | undefined
/** Deprecated: use email_address. */
email?: string | undefined
Expand All @@ -1214,13 +1223,14 @@ export interface Routes {
workspace_id: string
created_at: string
display_name: string
external_type:
| 'pti_user'
| 'brivo_user'
| 'hid_cm_user'
| 'salto_site_user'
external_type_display_name: string
external_type?:
| ('pti_user' | 'brivo_user' | 'hid_cm_user' | 'salto_site_user')
| undefined
external_type_display_name?: string | undefined
is_suspended: boolean
starts_at?: string | undefined
ends_at?: string | undefined
is_virtual: boolean
full_name?: string | undefined
/** Deprecated: use email_address. */
email?: string | undefined
Expand Down Expand Up @@ -9134,13 +9144,14 @@ export interface Routes {
workspace_id: string
created_at: string
display_name: string
external_type:
| 'pti_user'
| 'brivo_user'
| 'hid_cm_user'
| 'salto_site_user'
external_type_display_name: string
external_type?:
| ('pti_user' | 'brivo_user' | 'hid_cm_user' | 'salto_site_user')
| undefined
external_type_display_name?: string | undefined
is_suspended: boolean
starts_at?: string | undefined
ends_at?: string | undefined
is_virtual: boolean
full_name?: string | undefined
/** Deprecated: use email_address. */
email?: string | undefined
Expand Down
2 changes: 1 addition & 1 deletion src/lib/seam/connect/unstable/models/acs/access_group.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { z } from 'zod'

// If changed, update seam.acs_access_group.access_group_type check constraint
// If changed, update seam.acs_access_group.external_type generated column
export const acs_access_group_external_type = z.enum([
'pti_unit',
'pti_access_level',
Expand Down
7 changes: 5 additions & 2 deletions src/lib/seam/connect/unstable/models/acs/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,12 @@ export const acs_user = z
workspace_id: z.string().uuid(),
created_at: z.string().datetime(),
display_name: z.string(),
external_type: acs_user_external_type,
external_type_display_name: z.string(),
external_type: acs_user_external_type.optional(),
external_type_display_name: z.string().optional(),
is_suspended: z.boolean(),
starts_at: z.string().datetime().optional(),
ends_at: z.string().datetime().optional(),
is_virtual: z.boolean(),
})
.merge(user_fields)

Expand Down

0 comments on commit b40d5a3

Please sign in to comment.