1- import { HalLink } from './hal' ;
2-
31/**
42 * Link hints.
53 *
@@ -17,25 +15,13 @@ export interface LinkHints {
1715 * List of supported formats (used in for example GET responses
1816 * or PUT requests
1917 */
20- formats ?: LinkHintFormats ;
21-
22- /**
23- * List of links that exists at the context of the hint.
24- *
25- * This allows to specify links that exists at the target
26- * resource. For example, you might add an 'edit-form' link
27- * on a link, allowing clients to render an edit button
28- * for a target.
29- */
30- links ?: {
31- [ rel : string ] : HalLink ;
32- } ;
18+ formats ?: string [ ] ;
3319
3420 /**
3521 * A list of media-types the target resource supports for
3622 * POST request bodies
3723 */
38- 'accept-post' ?: LinkHintFormats ;
24+ 'accept-post' ?: string [ ] ;
3925
4026 /**
4127 * Array of media-types that the target resource supports for
@@ -69,9 +55,14 @@ export interface LinkHints {
6955
7056 /**
7157 * A list of authentication schemes that are required at the target
72- * resource
58+ * resource, for example 'Basic', 'Digest', 'Bearer'.
7359 */
74- 'auth-schemes' ?: LinkHintAuthScheme [ ] ;
60+ 'auth-schemes' ?: string [ ] ;
61+
62+ /**
63+ * A list of authentication realms available at the target
64+ */
65+ 'auth-realms' ?: string [ ] ;
7566
7667 /**
7768 * A status for the resource.
@@ -82,41 +73,3 @@ export interface LinkHints {
8273 status ?: 'deprecated' | 'gone' ;
8374
8475}
85-
86- /**
87- * A supported format, indexed by media type
88- */
89- interface LinkHintFormats {
90-
91- [ mediaType : string ] : {
92- /**
93- * Relevant links to the format.
94- *
95- * Mainly this could contain a 'profile' or 'describedby'
96- * link. These both describe a schema for the format
97- */
98- links ?: {
99- [ rel : string ] : HalLink ;
100- } ;
101-
102- /**
103- * If set to true, it indicates that this format is
104- * deprecated
105- */
106- deprecated ?: boolean ;
107- } ;
108- }
109-
110- interface LinkHintAuthScheme {
111- /**
112- * A registered authenticaiton scheme such as 'Basic', 'Digest' or 'Bearer'.
113- */
114- scheme : string ;
115-
116- /**
117- * Realm information from the authentation scheme, similar to the "realm"
118- * attribute on the WWW-Authentication header.
119- */
120- realm ?: string ;
121-
122- }
0 commit comments