RocketChat/Rocket.Chat

View on GitHub
packages/rest-typings/src/v1/oauthapps/OAuthAppsGetParamsGET.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { ajv } from '../Ajv';

export type OauthAppsGetParams = { clientId: string } | { appId: string } | { _id: string };

const oauthAppsGetParamsSchema = {
    oneOf: [
        {
            type: 'object',
            properties: {
                _id: {
                    type: 'string',
                },
            },
            required: ['_id'],
            additionalProperties: false,
        },
        {
            type: 'object',
            properties: {
                clientId: {
                    type: 'string',
                },
            },
            required: ['clientId'],
            additionalProperties: false,
        },
        {
            type: 'object',
            properties: {
                appId: {
                    type: 'string',
                },
            },
            required: ['appId'],
            additionalProperties: false,
        },
    ],
};

export const isOauthAppsGetParams = ajv.compile<OauthAppsGetParams>(oauthAppsGetParamsSchema);