import type { FromSchema } from 'json-schema-to-ts';

import { SSO_PROVIDER_TYPE } from './constants.js';

export const ssoConfigSchema = {
  type: 'object',
  properties: {
    type: { type: 'string', const: SSO_PROVIDER_TYPE },
    title: { type: 'string' },
    env: { type: 'string' },
    apiBaseUrl: { type: 'string' },
  },
  required: ['type'],
  additionalProperties: false,
} as const;

export type GraviteeSsoConfig = FromSchema<typeof ssoConfigSchema>;
