forked from legastero/stanza
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathxrd.ts
43 lines (38 loc) · 1.06 KB
/
xrd.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
// ====================================================================
// Extensible Resource Descriptor (XRD)
// --------------------------------------------------------------------
// Source: http://docs.oasis-open.org/xri/xrd/v1.0/xrd-1.0.html
// Version: 1.0
// ====================================================================
import { attribute, childText, DefinitionOptions } from '../jxt';
import { NS_XRD } from '../Namespaces';
export interface XRD {
subject?: string;
links?: XRDLink[];
}
export interface XRDLink {
href?: string;
rel?: string;
type?: string;
}
const Protocol: DefinitionOptions[] = [
{
element: 'XRD',
fields: {
subject: childText(null, 'Subject')
},
namespace: NS_XRD,
path: 'xrd'
},
{
aliases: [{ path: 'xrd.links', multiple: true }],
element: 'Link',
fields: {
href: attribute('href'),
rel: attribute('rel'),
type: attribute('type')
},
namespace: NS_XRD
}
];
export default Protocol;