Skip to content

Commit

Permalink
update graphql schema
Browse files Browse the repository at this point in the history
  • Loading branch information
fiskus committed Aug 6, 2024
1 parent 30ac664 commit be87486
Show file tree
Hide file tree
Showing 8 changed files with 201 additions and 6 deletions.
6 changes: 6 additions & 0 deletions catalog/app/containers/Admin/UsersAndRoles/Roles.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,9 @@ function Delete({ role, close }: DeleteProps) {
`Unable to delete role "${role.name}" assigned to some user(s). Unassign this role from everyone and try again.`,
)
return
case 'RoleNameUsedBySsoConfig':
push("Shouldn't happen")
return

Check warning on line 344 in catalog/app/containers/Admin/UsersAndRoles/Roles.tsx

View check run for this annotation

Codecov / codecov/patch/informational

catalog/app/containers/Admin/UsersAndRoles/Roles.tsx#L342-L344

Added lines #L342 - L344 were not covered by tests
default:
assertNever(r)
}
Expand Down Expand Up @@ -388,6 +391,8 @@ function SetDefault({ role, close }: SetDefaultProps) {
throw new Error(r.__typename)
case 'RoleSetDefaultSuccess':
return
case 'SsoConfigExists':
return

Check warning on line 395 in catalog/app/containers/Admin/UsersAndRoles/Roles.tsx

View check run for this annotation

Codecov / codecov/patch/informational

catalog/app/containers/Admin/UsersAndRoles/Roles.tsx#L394-L395

Added lines #L394 - L395 were not covered by tests
default:
assertNever(r)
}
Expand Down Expand Up @@ -488,6 +493,7 @@ function Edit({ role, close }: EditProps) {
return { policies: 'Too many policies to attach' }
case 'RoleIsManaged':
case 'RoleIsUnmanaged':
case 'RoleNameUsedBySsoConfig':

Check warning on line 496 in catalog/app/containers/Admin/UsersAndRoles/Roles.tsx

View check run for this annotation

Codecov / codecov/patch/informational

catalog/app/containers/Admin/UsersAndRoles/Roles.tsx#L496

Added line #L496 was not covered by tests
throw new Error(r.__typename)
default:
return assertNever(r)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export type containers_Admin_UsersAndRoles_gql_RoleDeleteMutation = {
| { readonly __typename: 'RoleDeleteSuccess' }
| { readonly __typename: 'RoleDoesNotExist' }
| { readonly __typename: 'RoleNameReserved' }
| { readonly __typename: 'RoleNameUsedBySsoConfig' }
| { readonly __typename: 'RoleAssigned' }
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type containers_Admin_UsersAndRoles_gql_RoleSetDefaultMutation = {
| ({ readonly __typename: 'ManagedRole' } & Pick<Types.ManagedRole, 'id'>)
})
| { readonly __typename: 'RoleDoesNotExist' }
| { readonly __typename: 'SsoConfigExists' }
}

export const containers_Admin_UsersAndRoles_gql_RoleSetDefaultDocument = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export type containers_Admin_UsersAndRoles_gql_RoleUpdateManagedMutation = {
| { readonly __typename: 'RoleNameReserved' }
| { readonly __typename: 'RoleNameExists' }
| { readonly __typename: 'RoleNameInvalid' }
| { readonly __typename: 'RoleNameUsedBySsoConfig' }
| { readonly __typename: 'RoleIsManaged' }
| { readonly __typename: 'RoleIsUnmanaged' }
| { readonly __typename: 'RoleHasTooManyPoliciesToAttach' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export type containers_Admin_UsersAndRoles_gql_RoleUpdateUnmanagedMutation = {
| { readonly __typename: 'RoleNameReserved' }
| { readonly __typename: 'RoleNameExists' }
| { readonly __typename: 'RoleNameInvalid' }
| { readonly __typename: 'RoleNameUsedBySsoConfig' }
| { readonly __typename: 'RoleIsManaged' }
| { readonly __typename: 'RoleIsUnmanaged' }
| { readonly __typename: 'RoleHasTooManyPoliciesToAttach' }
Expand Down
143 changes: 139 additions & 4 deletions catalog/app/model/graphql/schema.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,34 @@ export default {
},
args: [],
},
{
name: 'setSsoConfig',
type: {
kind: 'NON_NULL',
ofType: {
kind: 'UNION',
name: 'SetSsoConfigResult',
ofType: null,
},
},
args: [
{
name: 'config',
type: {
kind: 'SCALAR',
name: 'String',
ofType: null,
},
},
],
},
],
interfaces: [],
},
{
kind: 'SCALAR',
name: 'String',
},
{
kind: 'OBJECT',
name: 'AdminQueries',
Expand All @@ -117,6 +142,15 @@ export default {
},
args: [],
},
{
name: 'ssoConfig',
type: {
kind: 'OBJECT',
name: 'SsoConfig',
ofType: null,
},
args: [],
},
],
interfaces: [],
},
Expand Down Expand Up @@ -144,10 +178,6 @@ export default {
},
],
},
{
kind: 'SCALAR',
name: 'String',
},
{
kind: 'SCALAR',
name: 'Boolean',
Expand Down Expand Up @@ -4276,6 +4306,10 @@ export default {
kind: 'OBJECT',
name: 'RoleNameReserved',
},
{
kind: 'OBJECT',
name: 'RoleNameUsedBySsoConfig',
},
{
kind: 'OBJECT',
name: 'RoleAssigned',
Expand Down Expand Up @@ -4410,6 +4444,22 @@ export default {
],
interfaces: [],
},
{
kind: 'OBJECT',
name: 'RoleNameUsedBySsoConfig',
fields: [
{
name: '_',
type: {
kind: 'SCALAR',
name: 'Boolean',
ofType: null,
},
args: [],
},
],
interfaces: [],
},
{
kind: 'UNION',
name: 'RoleSetDefaultResult',
Expand All @@ -4422,6 +4472,10 @@ export default {
kind: 'OBJECT',
name: 'RoleDoesNotExist',
},
{
kind: 'OBJECT',
name: 'SsoConfigExists',
},
],
},
{
Expand Down Expand Up @@ -4463,6 +4517,10 @@ export default {
kind: 'OBJECT',
name: 'RoleNameInvalid',
},
{
kind: 'OBJECT',
name: 'RoleNameUsedBySsoConfig',
},
{
kind: 'OBJECT',
name: 'RoleIsManaged',
Expand Down Expand Up @@ -4721,6 +4779,24 @@ export default {
],
interfaces: [],
},
{
kind: 'UNION',
name: 'SetSsoConfigResult',
possibleTypes: [
{
kind: 'OBJECT',
name: 'Ok',
},
{
kind: 'OBJECT',
name: 'InvalidInput',
},
{
kind: 'OBJECT',
name: 'OperationError',
},
],
},
{
kind: 'OBJECT',
name: 'SnsInvalid',
Expand All @@ -4737,6 +4813,65 @@ export default {
],
interfaces: [],
},
{
kind: 'OBJECT',
name: 'SsoConfig',
fields: [
{
name: 'text',
type: {
kind: 'NON_NULL',
ofType: {
kind: 'SCALAR',
name: 'String',
ofType: null,
},
},
args: [],
},
{
name: 'timestamp',
type: {
kind: 'NON_NULL',
ofType: {
kind: 'SCALAR',
name: 'Datetime',
ofType: null,
},
},
args: [],
},
{
name: 'uploader',
type: {
kind: 'NON_NULL',
ofType: {
kind: 'OBJECT',
name: 'User',
ofType: null,
},
},
args: [],
},
],
interfaces: [],
},
{
kind: 'OBJECT',
name: 'SsoConfigExists',
fields: [
{
name: '_',
type: {
kind: 'SCALAR',
name: 'Boolean',
ofType: null,
},
args: [],
},
],
interfaces: [],
},
{
kind: 'OBJECT',
name: 'Status',
Expand Down
32 changes: 31 additions & 1 deletion catalog/app/model/graphql/types.generated.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,17 @@ export interface AccessCounts {
export interface AdminMutations {
readonly __typename: 'AdminMutations'
readonly user: UserAdminMutations
readonly setSsoConfig: SetSsoConfigResult
}

export interface AdminMutationssetSsoConfigArgs {
config: Maybe<Scalars['String']>
}

export interface AdminQueries {
readonly __typename: 'AdminQueries'
readonly user: UserAdminQueries
readonly ssoConfig: Maybe<SsoConfig>
}

export interface BooleanPackageUserMetaFacet extends IPackageUserMetaFacet {
Expand Down Expand Up @@ -924,6 +930,7 @@ export type RoleDeleteResult =
| RoleDeleteSuccess
| RoleDoesNotExist
| RoleNameReserved
| RoleNameUsedBySsoConfig
| RoleAssigned

export interface RoleDeleteSuccess {
Expand Down Expand Up @@ -966,7 +973,15 @@ export interface RoleNameReserved {
readonly _: Maybe<Scalars['Boolean']>
}

export type RoleSetDefaultResult = RoleSetDefaultSuccess | RoleDoesNotExist
export interface RoleNameUsedBySsoConfig {
readonly __typename: 'RoleNameUsedBySsoConfig'
readonly _: Maybe<Scalars['Boolean']>
}

export type RoleSetDefaultResult =
| RoleSetDefaultSuccess
| RoleDoesNotExist
| SsoConfigExists

export interface RoleSetDefaultSuccess {
readonly __typename: 'RoleSetDefaultSuccess'
Expand All @@ -978,6 +993,7 @@ export type RoleUpdateResult =
| RoleNameReserved
| RoleNameExists
| RoleNameInvalid
| RoleNameUsedBySsoConfig
| RoleIsManaged
| RoleIsUnmanaged
| RoleHasTooManyPoliciesToAttach
Expand Down Expand Up @@ -1019,6 +1035,8 @@ export enum SearchResultOrder {
OLDEST = 'OLDEST',
}

export type SetSsoConfigResult = Ok | InvalidInput | OperationError

export interface SnsInvalid {
readonly __typename: 'SnsInvalid'
readonly _: Maybe<Scalars['Boolean']>
Expand All @@ -1029,6 +1047,18 @@ export enum SortDirection {
DESC = 'DESC',
}

export interface SsoConfig {
readonly __typename: 'SsoConfig'
readonly text: Scalars['String']
readonly timestamp: Scalars['Datetime']
readonly uploader: User
}

export interface SsoConfigExists {
readonly __typename: 'SsoConfigExists'
readonly _: Maybe<Scalars['Boolean']>
}

export interface Status {
readonly __typename: 'Status'
readonly canaries: ReadonlyArray<Canary>
Expand Down
Loading

0 comments on commit be87486

Please sign in to comment.