-
Notifications
You must be signed in to change notification settings - Fork 0
/
manifest.ts
56 lines (53 loc) · 1.22 KB
/
manifest.ts
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
51
52
53
54
55
56
import { Schema, model, Model, Document } from 'mongoose';
import { CatalogSchema, ICatalog } from "./catalog";
import { ContentType, ShortManifestResource } from './stremio';
/**
* Manifest describes the Stremio's Addon general informations.
*/
export interface IManifest extends Document {
id: string
name: string
version: string
description: string
resources: ShortManifestResource[]
types: ContentType[]
catalogs: ICatalog[]
idPrefixes: string[]
}
export const ManifestSchema: Schema = new Schema({
id: {
type: 'String',
required: true,
},
name: {
type: 'String',
required: true,
},
version: {
type: 'String',
required: true,
},
description: {
type: 'String',
required: true,
},
resources: {
type: ['String'],
required: true,
},
types: {
type: ['String'],
required: true,
},
catalogs: {
type: [CatalogSchema],
ref: 'Catalog',
required: true,
},
idPrefixes: {
type: ['String'],
required: true,
},
});
const Manifest: Model<IManifest> = model<IManifest>('Manifest', ManifestSchema);
export default Manifest;