Skip to content

Commit

Permalink
fix more omnichannel.ts json schemas (work in progress)
Browse files Browse the repository at this point in the history
  • Loading branch information
felipe-rod123 committed May 25, 2022
1 parent c187396 commit 8f93798
Show file tree
Hide file tree
Showing 2 changed files with 418 additions and 67 deletions.
27 changes: 10 additions & 17 deletions packages/rest-typings/src/v1/directory.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,33 @@
import type { IRoom } from '@rocket.chat/core-typings';
import Ajv, { JSONSchemaType } from 'ajv';
import Ajv from 'ajv';

import type { PaginatedRequest } from '../helpers/PaginatedRequest';
import type { PaginatedResult } from '../helpers/PaginatedResult';

const ajv = new Ajv();

type DirectoryProps = {
query: {}; // { [key: string]: number }
count: number;
offset: number;
sort: {}; // { [key: string]: number }
};
type DirectoryProps = PaginatedRequest<{}>;

const DirectorySchema: JSONSchemaType<DirectoryProps> = {
const DirectorySchema = {
type: 'object',
properties: {
query: {
type: 'object',
properties: {
type: 'number',
},
type: 'string',
nullable: true,
},
count: {
type: 'number',
nullable: true,
},
offset: {
type: 'number',
nullable: true,
},
sort: {
type: 'object',
properties: {
type: 'number',
},
type: 'string',
nullable: true,
},
},
required: ['query', 'count', 'offset', 'sort'],
additionalProperties: false,
};

Expand Down
Loading

0 comments on commit 8f93798

Please sign in to comment.