@typespec/http 0.52.0-dev.1 → 0.52.0-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/auth.tsp +10 -8
- package/lib/http.tsp +8 -7
- package/package.json +1 -1
package/lib/auth.tsp
CHANGED
|
@@ -82,35 +82,37 @@ enum ApiKeyLocation {
|
|
|
82
82
|
* Cookie: X-API-KEY=abcdef12345
|
|
83
83
|
* ```
|
|
84
84
|
*
|
|
85
|
-
* @template
|
|
86
|
-
* @template
|
|
85
|
+
* @template Location The location of the API key
|
|
86
|
+
* @template Name The name of the API key
|
|
87
87
|
*/
|
|
88
88
|
@doc("")
|
|
89
|
-
model ApiKeyAuth<
|
|
89
|
+
model ApiKeyAuth<Location extends ApiKeyLocation, Name extends string> {
|
|
90
90
|
@doc("API key authentication")
|
|
91
91
|
type: AuthType.apiKey;
|
|
92
92
|
|
|
93
93
|
@doc("location of the API key")
|
|
94
|
-
in:
|
|
94
|
+
in: Location;
|
|
95
95
|
|
|
96
96
|
@doc("name of the API key")
|
|
97
|
-
name:
|
|
97
|
+
name: Name;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
101
|
* OAuth 2.0 is an authorization protocol that gives an API client limited access to user data on a web server.
|
|
102
|
+
*
|
|
102
103
|
* OAuth relies on authentication scenarios called flows, which allow the resource owner (user) to share the protected content from the resource server without sharing their credentials.
|
|
103
104
|
* For that purpose, an OAuth 2.0 server issues access tokens that the client applications can use to access protected resources on behalf of the resource owner.
|
|
104
105
|
* For more information about OAuth 2.0, see oauth.net and RFC 6749.
|
|
105
|
-
*
|
|
106
|
+
*
|
|
107
|
+
* @template Flows The list of supported OAuth2 flows
|
|
106
108
|
*/
|
|
107
109
|
@doc("")
|
|
108
|
-
model OAuth2Auth<
|
|
110
|
+
model OAuth2Auth<Flows extends OAuth2Flow[]> {
|
|
109
111
|
@doc("OAuth2 authentication")
|
|
110
112
|
type: AuthType.oauth2;
|
|
111
113
|
|
|
112
114
|
@doc("Supported OAuth2 flows")
|
|
113
|
-
flows:
|
|
115
|
+
flows: Flows;
|
|
114
116
|
}
|
|
115
117
|
|
|
116
118
|
@doc("Describes the OAuth2 flow type")
|
package/lib/http.tsp
CHANGED
|
@@ -21,16 +21,16 @@ model Response<Status> {
|
|
|
21
21
|
/**
|
|
22
22
|
* Defines a model with a single property of the given type, marked with `@body`.
|
|
23
23
|
*
|
|
24
|
-
* This can be useful in situations where you cannot use a bare
|
|
24
|
+
* This can be useful in situations where you cannot use a bare type as the body
|
|
25
25
|
* and it is awkward to add a property.
|
|
26
26
|
*
|
|
27
|
-
* @template
|
|
27
|
+
* @template Type The type of the model's `body` property.
|
|
28
28
|
*/
|
|
29
29
|
@doc("")
|
|
30
|
-
model Body<
|
|
30
|
+
model Body<Type> {
|
|
31
31
|
@body
|
|
32
32
|
@doc("The body type of the operation request or response.")
|
|
33
|
-
body:
|
|
33
|
+
body: Type;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/**
|
|
@@ -97,9 +97,10 @@ model ConflictResponse is Response<409>;
|
|
|
97
97
|
/**
|
|
98
98
|
* Produces a new model with the same properties as T, but with `@query`,
|
|
99
99
|
* `@header`, `@body`, and `@path` decorators removed from all properties.
|
|
100
|
-
*
|
|
100
|
+
*
|
|
101
|
+
* @template Data The model to spread as the plain data.
|
|
101
102
|
*/
|
|
102
103
|
@plainData
|
|
103
|
-
model PlainData<
|
|
104
|
-
...
|
|
104
|
+
model PlainData<Data> {
|
|
105
|
+
...Data;
|
|
105
106
|
}
|