@microsoft/typespec-msgraph 0.0.1-Preview.13 → 0.0.1-Preview.14
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/dist/src/components/annotations.d.ts.map +1 -1
- package/dist/src/components/annotations.js +3 -0
- package/dist/src/components/annotations.js.map +1 -1
- package/dist/src/components/entity-container-element.d.ts.map +1 -1
- package/dist/src/components/entity-container-element.js +13 -6
- package/dist/src/components/entity-container-element.js.map +1 -1
- package/dist/src/components/property-element.js +1 -1
- package/dist/src/components/property-element.js.map +1 -1
- package/dist/src/components/reference-target-element.d.ts +9 -0
- package/dist/src/components/reference-target-element.d.ts.map +1 -0
- package/dist/src/components/reference-target-element.js +3 -0
- package/dist/src/components/reference-target-element.js.map +1 -0
- package/dist/src/components/select-supported-annotation.d.ts +5 -0
- package/dist/src/components/select-supported-annotation.d.ts.map +1 -0
- package/dist/src/components/select-supported-annotation.js +6 -0
- package/dist/src/components/select-supported-annotation.js.map +1 -0
- package/dist/src/decorators/address-url.d.ts +16 -0
- package/dist/src/decorators/address-url.d.ts.map +1 -0
- package/dist/src/decorators/address-url.js +19 -0
- package/dist/src/decorators/address-url.js.map +1 -0
- package/dist/src/decorators/index.d.ts +3 -0
- package/dist/src/decorators/index.d.ts.map +1 -1
- package/dist/src/decorators/index.js +3 -0
- package/dist/src/decorators/index.js.map +1 -1
- package/dist/src/decorators/reference-target.d.ts +16 -0
- package/dist/src/decorators/reference-target.d.ts.map +1 -0
- package/dist/src/decorators/reference-target.js +52 -0
- package/dist/src/decorators/reference-target.js.map +1 -0
- package/dist/src/decorators/select.d.ts +9 -0
- package/dist/src/decorators/select.d.ts.map +1 -0
- package/dist/src/decorators/select.js +13 -0
- package/dist/src/decorators/select.js.map +1 -0
- package/dist/src/entities/address-url.d.ts +4 -0
- package/dist/src/entities/address-url.d.ts.map +1 -0
- package/dist/src/entities/address-url.js +18 -0
- package/dist/src/entities/address-url.js.map +1 -0
- package/dist/src/entities/annotations.d.ts +2 -0
- package/dist/src/entities/annotations.d.ts.map +1 -1
- package/dist/src/entities/annotations.js +14 -5
- package/dist/src/entities/annotations.js.map +1 -1
- package/dist/src/entities/entity-container.d.ts +10 -0
- package/dist/src/entities/entity-container.d.ts.map +1 -1
- package/dist/src/entities/entity-container.js +3 -0
- package/dist/src/entities/entity-container.js.map +1 -1
- package/dist/src/entities/model.d.ts +2 -0
- package/dist/src/entities/model.d.ts.map +1 -1
- package/dist/src/entities/model.js +13 -1
- package/dist/src/entities/model.js.map +1 -1
- package/dist/src/entities/ms-graph-route.d.ts +13 -0
- package/dist/src/entities/ms-graph-route.d.ts.map +1 -0
- package/dist/src/entities/ms-graph-route.js +70 -0
- package/dist/src/entities/ms-graph-route.js.map +1 -0
- package/dist/src/entities/namespace.d.ts.map +1 -1
- package/dist/src/entities/namespace.js +27 -7
- package/dist/src/entities/namespace.js.map +1 -1
- package/dist/src/entities/operation.d.ts.map +1 -1
- package/dist/src/entities/operation.js +13 -2
- package/dist/src/entities/operation.js.map +1 -1
- package/dist/src/lib.d.ts +10 -0
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +6 -1
- package/dist/src/lib.js.map +1 -1
- package/dist/src/rules/address-url.d.ts +6 -0
- package/dist/src/rules/address-url.d.ts.map +1 -0
- package/dist/src/rules/address-url.js +40 -0
- package/dist/src/rules/address-url.js.map +1 -0
- package/dist/src/rules/graph-route.d.ts +4 -0
- package/dist/src/rules/graph-route.d.ts.map +1 -1
- package/dist/src/rules/graph-route.js +26 -2
- package/dist/src/rules/graph-route.js.map +1 -1
- package/dist/src/rules/index.d.ts +2 -0
- package/dist/src/rules/index.d.ts.map +1 -1
- package/dist/src/rules/index.js +2 -0
- package/dist/src/rules/index.js.map +1 -1
- package/dist/src/rules/reference-target.d.ts +8 -0
- package/dist/src/rules/reference-target.d.ts.map +1 -0
- package/dist/src/rules/reference-target.js +119 -0
- package/dist/src/rules/reference-target.js.map +1 -0
- package/dist/src/utils.d.ts +16 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +25 -16
- package/dist/src/utils.js.map +1 -1
- package/dist/src/validate.d.ts.map +1 -1
- package/dist/src/validate.js +5 -0
- package/dist/src/validate.js.map +1 -1
- package/lib/decorators.tsp +91 -22
- package/lib/porcelain.tsp +18 -7
- package/lib/responses.tsp +32 -7
- package/lib/shared-models.tsp +0 -50
- package/package.json +4 -4
package/lib/decorators.tsp
CHANGED
|
@@ -16,14 +16,31 @@ extern dec action(target: Operation, name?: valueof string);
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* `@additionalQueryParameters` - Appends a key=value pair to the query string of the mapped internal URL for all models defined within the namespace.
|
|
19
|
-
*
|
|
19
|
+
*
|
|
20
20
|
* `@additionalQueryParameters` can only be applied to namespaces
|
|
21
21
|
*/
|
|
22
|
-
extern dec additionalQueryParameters(
|
|
22
|
+
extern dec additionalQueryParameters(
|
|
23
|
+
target: Namespace,
|
|
24
|
+
name: valueof string,
|
|
25
|
+
value: valueof string
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* `@addressUrl` - Specifies the URL to which the operation request is forwarded when the request
|
|
30
|
+
* is authenticated with an AAD account.
|
|
31
|
+
*
|
|
32
|
+
* `@addressUrl` can only be applied to routed interfaces (entity sets, singletons and navigation properties) or action operations.
|
|
33
|
+
*/
|
|
34
|
+
extern dec addressUrl(
|
|
35
|
+
target: Interface | Operation,
|
|
36
|
+
url: valueof string,
|
|
37
|
+
omitRootNavigationSegment?: valueof boolean,
|
|
38
|
+
appendSegmentNameToAddress?: valueof boolean
|
|
39
|
+
);
|
|
23
40
|
|
|
24
41
|
/**
|
|
25
42
|
* `@agsAttribute` - Allows all AGS CSDL extensions that are not yet modelled explicitly in TypeSpec to be maintained
|
|
26
|
-
*
|
|
43
|
+
*
|
|
27
44
|
* `@agsAttribute` - Applies to models.
|
|
28
45
|
*/
|
|
29
46
|
extern dec agsAttribute(
|
|
@@ -34,10 +51,10 @@ extern dec agsAttribute(
|
|
|
34
51
|
|
|
35
52
|
/**
|
|
36
53
|
* `@allowedValues` - mark model property with allowedValues.
|
|
37
|
-
*
|
|
54
|
+
*
|
|
38
55
|
* `@allowedValues` - can only be applied to model properties.
|
|
39
56
|
*/
|
|
40
|
-
|
|
57
|
+
extern dec allowedValues(target: ModelProperty, ...values: valueof unknown[]);
|
|
41
58
|
|
|
42
59
|
/**
|
|
43
60
|
* `@alternateKey` - mark a model property as an alternateKey
|
|
@@ -86,7 +103,17 @@ extern dec deltaCollection(target: Model);
|
|
|
86
103
|
*
|
|
87
104
|
* `@graphDeprecated` can be applied to Model, ModelProperty, Enum, EnumMember, Operation, Namespace, Interface.
|
|
88
105
|
*/
|
|
89
|
-
|
|
106
|
+
extern dec graphDeprecated(
|
|
107
|
+
target:
|
|
108
|
+
| Model
|
|
109
|
+
| ModelProperty
|
|
110
|
+
| Enum
|
|
111
|
+
| EnumMember
|
|
112
|
+
| Operation
|
|
113
|
+
| Namespace
|
|
114
|
+
| Interface,
|
|
115
|
+
name: valueof string
|
|
116
|
+
);
|
|
90
117
|
|
|
91
118
|
/**
|
|
92
119
|
* `@deprecatedDefinition` - Allow us create a reusable deprecation definition.
|
|
@@ -115,14 +142,27 @@ extern dec entity(target: Model);
|
|
|
115
142
|
* `properties` - Property names in the model returned from the get that can be used in a $expand query parameter.
|
|
116
143
|
* At least one property must be specified.
|
|
117
144
|
*/
|
|
118
|
-
extern dec expand(
|
|
145
|
+
extern dec expand(
|
|
146
|
+
target: Operation,
|
|
147
|
+
property: valueof string,
|
|
148
|
+
...otherProperties: valueof string[]
|
|
149
|
+
);
|
|
119
150
|
|
|
120
151
|
/**
|
|
121
152
|
* `@experimental` - mark the entity as experimental
|
|
122
153
|
*
|
|
123
154
|
* `@experimental` can be applied to Model, ModelProperty, Enum, EnumMember, Operation, Namespace, Interface.
|
|
124
155
|
*/
|
|
125
|
-
extern dec experimental(
|
|
156
|
+
extern dec experimental(
|
|
157
|
+
target:
|
|
158
|
+
| Model
|
|
159
|
+
| ModelProperty
|
|
160
|
+
| Enum
|
|
161
|
+
| EnumMember
|
|
162
|
+
| Operation
|
|
163
|
+
| Namespace
|
|
164
|
+
| Interface
|
|
165
|
+
);
|
|
126
166
|
|
|
127
167
|
/**
|
|
128
168
|
* `@filter` - Applies to: get operations that return collections of @entity or @complex models.
|
|
@@ -131,8 +171,11 @@ extern dec experimental(target: Model | ModelProperty | Enum | EnumMember | Oper
|
|
|
131
171
|
* `properties` - array of property names in the model returned
|
|
132
172
|
* from the get operation that can be used in $filter query parameter.
|
|
133
173
|
*/
|
|
134
|
-
extern dec filter(
|
|
135
|
-
|
|
174
|
+
extern dec filter(
|
|
175
|
+
target: Operation,
|
|
176
|
+
property: valueof string,
|
|
177
|
+
...properties: valueof string[]
|
|
178
|
+
);
|
|
136
179
|
|
|
137
180
|
/**
|
|
138
181
|
* `@flags` - mark an enumeration type as a flag.
|
|
@@ -153,18 +196,20 @@ extern dec function(target: Operation, name?: valueof string);
|
|
|
153
196
|
*
|
|
154
197
|
* `@globalOperation` can only be applied to operations.
|
|
155
198
|
*/
|
|
156
|
-
|
|
157
|
-
|
|
199
|
+
extern dec globalOperation(target: Operation);
|
|
158
200
|
|
|
159
201
|
/**
|
|
160
202
|
* `@graphRoute` - mark an interface or operation with an HTTP route.
|
|
161
|
-
*
|
|
203
|
+
*
|
|
162
204
|
* `@graphRoute` - can only be applied to interfaces or operations.
|
|
163
205
|
*/
|
|
164
206
|
// TODO: Using @graphRoute on an operation currently does not work due to the following TypeSpec core issue
|
|
165
207
|
// https://github.com/microsoft/typespec/issues/2106
|
|
166
208
|
// Disabling all related features while we await the outcome.
|
|
167
|
-
extern dec graphRoute(
|
|
209
|
+
extern dec graphRoute(
|
|
210
|
+
target: Interface, /* | Operation */
|
|
211
|
+
path: valueof string
|
|
212
|
+
);
|
|
168
213
|
|
|
169
214
|
/**
|
|
170
215
|
* `@hasStream` - indicates that an `@entity` model has a stream.
|
|
@@ -185,7 +230,7 @@ extern dec immutable(target: ModelProperty);
|
|
|
185
230
|
*
|
|
186
231
|
* `@ownerless` can only be applied to interfaces.
|
|
187
232
|
*/
|
|
188
|
-
|
|
233
|
+
extern dec ownerless(target: Interface);
|
|
189
234
|
|
|
190
235
|
/**
|
|
191
236
|
* `@open` - mark a model type as open
|
|
@@ -210,7 +255,11 @@ extern dec operationParameters(target: Model);
|
|
|
210
255
|
* `properties` - List of property names in the model returned from the get operation that can be used in a $orderBy query parameter.
|
|
211
256
|
* At least one property must be specified.
|
|
212
257
|
*/
|
|
213
|
-
extern dec orderBy(
|
|
258
|
+
extern dec orderBy(
|
|
259
|
+
target: Operation,
|
|
260
|
+
property: valueof string,
|
|
261
|
+
...otherProperties: valueof string[]
|
|
262
|
+
);
|
|
214
263
|
|
|
215
264
|
/**
|
|
216
265
|
* `@pagedCollection` - mark a model as representing a paged collection.
|
|
@@ -252,7 +301,9 @@ extern dec privatePreviewDefinition(
|
|
|
252
301
|
*
|
|
253
302
|
* `@privileged` can be applied to Model, ModelProperty, Enum, EnumMember, Operation, Namespace.
|
|
254
303
|
*/
|
|
255
|
-
extern dec privileged(
|
|
304
|
+
extern dec privileged(
|
|
305
|
+
target: Model | ModelProperty | Enum | EnumMember | Operation | Namespace
|
|
306
|
+
);
|
|
256
307
|
|
|
257
308
|
/**
|
|
258
309
|
* `@publicNamespace` - defines the namespace to be used in generating CSDL output for all elements contained within the namespace
|
|
@@ -275,6 +326,13 @@ extern dec readOnly(target: ModelProperty);
|
|
|
275
326
|
*/
|
|
276
327
|
extern dec references(target: ModelProperty);
|
|
277
328
|
|
|
329
|
+
/**
|
|
330
|
+
* `@referenceTarget` - mark an interface with referenceTarget
|
|
331
|
+
*
|
|
332
|
+
* `@references` can only be applied to interfaces.
|
|
333
|
+
*/
|
|
334
|
+
extern dec referenceTarget(target: Interface, value: valueof string);
|
|
335
|
+
|
|
278
336
|
/**
|
|
279
337
|
* `@requiredForCreate` - mark a model property as required when a request is made to
|
|
280
338
|
* Graph to create or update a resource.
|
|
@@ -295,11 +353,22 @@ extern dec search(target: Operation);
|
|
|
295
353
|
*/
|
|
296
354
|
extern dec skip(target: Operation);
|
|
297
355
|
|
|
356
|
+
/**
|
|
357
|
+
* `@select` - Applies to operations
|
|
358
|
+
* Indicates that the operation supports the OData $select query parameter
|
|
359
|
+
*/
|
|
360
|
+
extern dec select(target: Operation);
|
|
361
|
+
|
|
298
362
|
/**
|
|
299
363
|
* `@term` - Applies to: namespaces.
|
|
300
364
|
* Indicates that a workload wishes to require or return instance annotations in their request / response packets at runtime.
|
|
301
365
|
*/
|
|
302
|
-
extern dec term(
|
|
366
|
+
extern dec term(
|
|
367
|
+
target: Namespace,
|
|
368
|
+
name: valueof string,
|
|
369
|
+
type: Scalar,
|
|
370
|
+
description: valueof string
|
|
371
|
+
);
|
|
303
372
|
|
|
304
373
|
/**
|
|
305
374
|
* `@top` - Applies to: get operations that return collections.
|
|
@@ -315,10 +384,10 @@ extern dec top(target: Operation);
|
|
|
315
384
|
extern dec writeOnly(target: ModelProperty);
|
|
316
385
|
|
|
317
386
|
/**
|
|
318
|
-
* `@isOwner` - specify that this workload is the primary owner of this entity model
|
|
319
|
-
*
|
|
320
|
-
* `@isOwner` can be applied to Model where the model also has an @entity decorator or a ModelProperty where it has either an @contains or @references decorator.
|
|
321
|
-
*/
|
|
387
|
+
* `@isOwner` - specify that this workload is the primary owner of this entity model
|
|
388
|
+
*
|
|
389
|
+
* `@isOwner` can be applied to Model where the model also has an @entity decorator or a ModelProperty where it has either an @contains or @references decorator.
|
|
390
|
+
*/
|
|
322
391
|
extern dec isOwner(target: Model | ModelProperty, value?: valueof boolean);
|
|
323
392
|
|
|
324
393
|
/**
|
package/lib/porcelain.tsp
CHANGED
|
@@ -41,8 +41,6 @@ namespace MsGraph;
|
|
|
41
41
|
@doc("Primary operation shapes for Microsoft Graph")
|
|
42
42
|
interface GraphOps {
|
|
43
43
|
|
|
44
|
-
// TODO: This is how we should make $select standard for Graph. Define a select decorator and use it here.
|
|
45
|
-
// @select("*")
|
|
46
44
|
@get op GetCollection<
|
|
47
45
|
TResource extends {} = Automatic.CalculatedResourceType,
|
|
48
46
|
TParams = {... Automatic.GraphRouteParams},
|
|
@@ -51,7 +49,6 @@ namespace MsGraph;
|
|
|
51
49
|
> is Foundations.GraphFoundations.CollectionOperation<
|
|
52
50
|
TResource, TParams, TResponse, TErrorResponse>;
|
|
53
51
|
|
|
54
|
-
// @select("*")
|
|
55
52
|
@get op GetPagedCollection<
|
|
56
53
|
TResource extends {} = Automatic.CalculatedResourceType,
|
|
57
54
|
TParams = {... Automatic.GraphRouteParams},
|
|
@@ -62,7 +59,6 @@ namespace MsGraph;
|
|
|
62
59
|
|
|
63
60
|
// TODO: GetDelta? FUnction etc.?
|
|
64
61
|
|
|
65
|
-
// @select("*")
|
|
66
62
|
@post op Post<
|
|
67
63
|
TResource extends {} = Automatic.CalculatedResourceType,
|
|
68
64
|
TParams = { ... Automatic.GraphRouteParams, @body body: TResource },
|
|
@@ -71,7 +67,6 @@ namespace MsGraph;
|
|
|
71
67
|
> is Foundations.GraphFoundations.CollectionOperation<
|
|
72
68
|
TResource, TParams, TResponse, TErrorResponse>;
|
|
73
69
|
|
|
74
|
-
// @select("*")
|
|
75
70
|
@get op GetResource<
|
|
76
71
|
TResource extends {} = Automatic.CalculatedResourceType,
|
|
77
72
|
TParams = {... Automatic.GraphRouteParams},
|
|
@@ -96,7 +91,6 @@ namespace MsGraph;
|
|
|
96
91
|
> is Foundations.GraphFoundations.ResourceOperation<
|
|
97
92
|
TResource, TParams, TResponse, TErrorResponse>;
|
|
98
93
|
|
|
99
|
-
// @select("*")
|
|
100
94
|
@patch op PatchWithResponse<
|
|
101
95
|
TResource extends {} = Automatic.CalculatedResourceType,
|
|
102
96
|
TParams = {... Automatic.GraphRouteParams},
|
|
@@ -113,7 +107,6 @@ namespace MsGraph;
|
|
|
113
107
|
> is Foundations.GraphFoundations.ResourceOperation<
|
|
114
108
|
TResource, TParams, TResponse, TErrorResponse>;
|
|
115
109
|
|
|
116
|
-
// @select("*")
|
|
117
110
|
@put op PutWithResponse<
|
|
118
111
|
TResource extends {} = Automatic.CalculatedResourceType,
|
|
119
112
|
TParams = {... Automatic.GraphRouteParams},
|
|
@@ -122,6 +115,24 @@ namespace MsGraph;
|
|
|
122
115
|
> is Foundations.GraphFoundations.ResourceOperation<
|
|
123
116
|
TResource, TParams, TResponse, TErrorResponse>;
|
|
124
117
|
|
|
118
|
+
@action op Action<
|
|
119
|
+
TReturnType = void,
|
|
120
|
+
TActionParams extends {} = {},
|
|
121
|
+
TResource extends {} = Automatic.CalculatedResourceType,
|
|
122
|
+
TParams = {... Automatic.GraphRouteParams, ... TActionParams},
|
|
123
|
+
TResponse = TReturnType,
|
|
124
|
+
TErrorResponse = MsGraph.Responses.OperationErrorResponse
|
|
125
|
+
>(...TParams): TResponse | TErrorResponse;
|
|
126
|
+
|
|
127
|
+
@function op Function<
|
|
128
|
+
TReturnType,
|
|
129
|
+
TFunctionParams extends {} = {},
|
|
130
|
+
TResource extends {} = Automatic.CalculatedResourceType,
|
|
131
|
+
TParams = {... Automatic.GraphRouteParams, ... TFunctionParams},
|
|
132
|
+
TResponse = TReturnType,
|
|
133
|
+
TErrorResponse = MsGraph.Responses.OperationErrorResponse
|
|
134
|
+
>(...TParams): TResponse | TErrorResponse;
|
|
135
|
+
|
|
125
136
|
}
|
|
126
137
|
|
|
127
138
|
namespace Automatic {
|
package/lib/responses.tsp
CHANGED
|
@@ -16,9 +16,27 @@ using MsGraph.SharedModels;
|
|
|
16
16
|
// The content of the types exists for other future emitters that run directly off TypeSpec.
|
|
17
17
|
namespace MsGraph.Responses.Bodies {
|
|
18
18
|
|
|
19
|
+
/** Complex type to represent a nested error that potentially has other recursive nested errors. */
|
|
20
|
+
@error
|
|
21
|
+
model InnerError {
|
|
22
|
+
code: string;
|
|
23
|
+
innererror: InnerError | null; // Small e for error NOT a typo.
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Complex type to represent a standard Microsoft Graph error. */
|
|
27
|
+
@error
|
|
28
|
+
model GraphError {
|
|
29
|
+
code: string;
|
|
30
|
+
message: string;
|
|
31
|
+
localizedMessage: string;
|
|
32
|
+
target: string | null;
|
|
33
|
+
innererror: InnerError | null; // Small e for error NOT a typo.
|
|
34
|
+
details: GraphError[];
|
|
35
|
+
}
|
|
36
|
+
|
|
19
37
|
@error
|
|
20
38
|
model ErrorBody {
|
|
21
|
-
error:
|
|
39
|
+
error: GraphError;
|
|
22
40
|
}
|
|
23
41
|
|
|
24
42
|
model ResourceBody<TResource> {
|
|
@@ -44,33 +62,39 @@ namespace MsGraph.Responses.Bodies {
|
|
|
44
62
|
|
|
45
63
|
// Response models represent the response as a whole, including the status code, headers, and body.
|
|
46
64
|
namespace MsGraph.Responses {
|
|
47
|
-
|
|
65
|
+
/** Response to represent a Microsoft Graph collection response payload. */
|
|
48
66
|
model CollectionResponse<TResource, TStatus = 200, TBody = Bodies.CollectionBody<TResource>>
|
|
49
67
|
is Http.Response<TStatus> {
|
|
50
68
|
...Http.Body<TBody>;
|
|
51
69
|
}
|
|
52
70
|
|
|
53
|
-
|
|
71
|
+
/** Response to represent a Microsoft Graph paged collection response payload. */
|
|
54
72
|
model PagedCollectionResponse<TResource, TStatus = 200, TBody = Bodies.PagedCollectionBody<TResource>>
|
|
55
73
|
is CollectionResponse<TResource, TStatus, TBody>;
|
|
56
74
|
|
|
57
|
-
|
|
75
|
+
/** Response to represent a Microsoft Graph individual resource response payload. */
|
|
58
76
|
model ResourceResponse<TResource, TStatus = 200, TBody = Bodies.ResourceBody<TResource>>
|
|
59
77
|
is Http.Response<TStatus> {
|
|
60
78
|
...Http.Body<TBody>;
|
|
61
79
|
}
|
|
62
80
|
|
|
63
|
-
|
|
81
|
+
/** Response to represent a Microsoft Graph individual resource response payload. */
|
|
82
|
+
model ScalarResponse<TScalar, TStatus = 200, TBody = TScalar>
|
|
83
|
+
is Http.Response<TStatus> {
|
|
84
|
+
...Http.Body<TBody>;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** Response to represent a Microsoft Graph resource creation response payload. */
|
|
64
88
|
model ResourceCreatedResponse<TResource, TStatus = 201, TBody = Bodies.ResourceBody<TResource>>
|
|
65
89
|
is ResourceResponse<TResource, TStatus, TBody> {
|
|
66
90
|
...Http.LocationHeader
|
|
67
91
|
}
|
|
68
92
|
|
|
69
|
-
|
|
93
|
+
/** Response to represent a Microsoft Graph empty response payload. */
|
|
70
94
|
model EmptyResponse
|
|
71
95
|
is Http.Response<204>;
|
|
72
96
|
|
|
73
|
-
|
|
97
|
+
/** Response to represent a Microsoft Graph error response payload. */
|
|
74
98
|
model ErrorResponse<TStatus>
|
|
75
99
|
is Http.Response<TStatus> {
|
|
76
100
|
...Http.Body<Bodies.ErrorBody>;
|
|
@@ -78,5 +102,6 @@ namespace MsGraph.Responses {
|
|
|
78
102
|
|
|
79
103
|
alias ResourceErrorResponse = ErrorResponse<400 | 404 | 429>;
|
|
80
104
|
alias CollectionErrorResponse = ErrorResponse<400 | 429>;
|
|
105
|
+
alias OperationErrorResponse = ErrorResponse<400 | 429>;
|
|
81
106
|
|
|
82
107
|
}
|
package/lib/shared-models.tsp
CHANGED
|
@@ -16,35 +16,6 @@ namespace MsGraph.SharedModels;
|
|
|
16
16
|
@key id: string;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
@doc("Complex type to represent an identity principal by id, when a human-readable name is also useful.")
|
|
20
|
-
@complex
|
|
21
|
-
@open
|
|
22
|
-
model identity {
|
|
23
|
-
id: string;
|
|
24
|
-
displayName: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
@doc("Complex type to represent a group of identity principals used at a point in time, such as createdBy, lastModifiedBy.")
|
|
28
|
-
@complex
|
|
29
|
-
@open
|
|
30
|
-
model identitySet {
|
|
31
|
-
user: identity | null;
|
|
32
|
-
device: identity | null;
|
|
33
|
-
application: identity | null;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
@doc("Enum for identifying the format of a text string.")
|
|
37
|
-
enum bodyType {
|
|
38
|
-
text,
|
|
39
|
-
html
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
@doc("Complex type to represent a chunk of text that could be either plain text or html.")
|
|
43
|
-
@complex
|
|
44
|
-
model itemBody {
|
|
45
|
-
contentType: bodyType;
|
|
46
|
-
content: string;
|
|
47
|
-
}
|
|
48
19
|
|
|
49
20
|
@doc("Scalar type for URLs that would be expected to work in the browser address bar.")
|
|
50
21
|
scalar webUrl extends string;
|
|
@@ -52,24 +23,3 @@ namespace MsGraph.SharedModels;
|
|
|
52
23
|
@doc("Scalar type for URLs that represent Graph APIs.")
|
|
53
24
|
scalar url extends string;
|
|
54
25
|
|
|
55
|
-
@doc("Complex type to represent a nested error that potentially has other recursive nested errors.")
|
|
56
|
-
@complex
|
|
57
|
-
@open
|
|
58
|
-
model innerError {
|
|
59
|
-
code: string;
|
|
60
|
-
innererror: innerError | null;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
@doc("""
|
|
64
|
-
Complex type to represent a standard Microsoft Graph error.
|
|
65
|
-
{code}: The error code.
|
|
66
|
-
""")
|
|
67
|
-
@complex
|
|
68
|
-
@error
|
|
69
|
-
model publicError {
|
|
70
|
-
code: string;
|
|
71
|
-
message: string;
|
|
72
|
-
target: string | null;
|
|
73
|
-
innererror: innerError | null;
|
|
74
|
-
details: publicError[];
|
|
75
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/typespec-msgraph",
|
|
3
|
-
"version": "0.0.1-Preview.
|
|
3
|
+
"version": "0.0.1-Preview.14",
|
|
4
4
|
"author": "Microsoft Corporation",
|
|
5
5
|
"description": "TypeSpec for Microsoft Graph provides a description of the Microsoft Graph APIs. It is used for generating API description languages, client and service code, documentation, and other assets.",
|
|
6
6
|
"homepage": "https://github.com/microsoftgraph/typespec-msgraph",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
],
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@xmldom/xmldom": "~0.8.4",
|
|
56
|
-
"@typespec/compiler": "~0.
|
|
57
|
-
"@typespec/http": "~0.
|
|
56
|
+
"@typespec/compiler": "~0.52.0",
|
|
57
|
+
"@typespec/http": "~0.52.0",
|
|
58
58
|
"prettier": "~3.1.1",
|
|
59
59
|
"react-dom": "~18.2.0",
|
|
60
60
|
"react": "~18.2.0",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"@types/node": "~18.11.9",
|
|
66
66
|
"@types/react": "~18.0.5",
|
|
67
67
|
"@types/react-reconciler": "~0.28.0",
|
|
68
|
-
"@typespec/eslint-config-typespec": "~0.
|
|
68
|
+
"@typespec/eslint-config-typespec": "~0.52.0",
|
|
69
69
|
"c8": "~8.0.1",
|
|
70
70
|
"eslint": "^8.49.0",
|
|
71
71
|
"mocha": "~10.2.0",
|