forked from RocketChat/Rocket.Chat
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpush.ts
More file actions
50 lines (43 loc) · 846 Bytes
/
push.ts
File metadata and controls
50 lines (43 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import type { IPushTokenTypes } from '@rocket.chat/core-typings';
import { ajv } from './Ajv';
type PushTokenProps = {
id?: string;
type: IPushTokenTypes;
value: string;
appName: string;
};
const PushTokenPropsSchema = {
type: 'object',
properties: {
id: {
type: 'string',
nullable: true,
},
type: {
type: 'string',
},
value: {
type: 'string',
},
appName: {
type: 'string',
},
},
required: ['type', 'value', 'appName'],
additionalProperties: false,
};
export const isPushTokenProps = ajv.compile<PushTokenProps>(PushTokenPropsSchema);
type PushGetProps = {
id: string;
};
const PushGetPropsSchema = {
type: 'object',
properties: {
id: {
type: 'string',
},
},
required: ['id'],
additionalProperties: false,
};
export const isPushGetProps = ajv.compile<PushGetProps>(PushGetPropsSchema);