@microsoft/typespec-msgraph 0.0.1-Preview.12 → 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 +24 -3
- 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/operation-element.d.ts.map +1 -1
- package/dist/src/components/operation-element.js +15 -4
- package/dist/src/components/operation-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/revisions-annotation.d.ts.map +1 -1
- package/dist/src/components/revisions-annotation.js +2 -1
- package/dist/src/components/revisions-annotation.js.map +1 -1
- package/dist/src/components/schema-element.d.ts.map +1 -1
- package/dist/src/components/schema-element.js +5 -3
- package/dist/src/components/schema-element.js.map +1 -1
- 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/components/term-element.d.ts +9 -0
- package/dist/src/components/term-element.d.ts.map +1 -0
- package/dist/src/components/term-element.js +8 -0
- package/dist/src/components/term-element.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/ags-attribute.d.ts +2 -1
- package/dist/src/decorators/ags-attribute.d.ts.map +1 -1
- package/dist/src/decorators/ags-attribute.js +34 -1
- package/dist/src/decorators/ags-attribute.js.map +1 -1
- package/dist/src/decorators/global-operation.d.ts +9 -0
- package/dist/src/decorators/global-operation.d.ts.map +1 -0
- package/dist/src/decorators/global-operation.js +13 -0
- package/dist/src/decorators/global-operation.js.map +1 -0
- package/dist/src/decorators/graph-deprecated.d.ts +11 -0
- package/dist/src/decorators/graph-deprecated.d.ts.map +1 -0
- package/dist/src/decorators/graph-deprecated.js +19 -0
- package/dist/src/decorators/graph-deprecated.js.map +1 -0
- package/dist/src/decorators/index.d.ts +7 -0
- package/dist/src/decorators/index.d.ts.map +1 -1
- package/dist/src/decorators/index.js +7 -0
- package/dist/src/decorators/index.js.map +1 -1
- package/dist/src/decorators/is-owner.js +1 -1
- package/dist/src/decorators/ownerless.d.ts +8 -0
- package/dist/src/decorators/ownerless.d.ts.map +1 -0
- package/dist/src/decorators/ownerless.js +12 -0
- package/dist/src/decorators/ownerless.js.map +1 -0
- package/dist/src/decorators/public-namespace.d.ts.map +1 -1
- package/dist/src/decorators/public-namespace.js +4 -1
- package/dist/src/decorators/public-namespace.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/decorators/term.d.ts +13 -0
- package/dist/src/decorators/term.d.ts.map +1 -0
- package/dist/src/decorators/term.js +14 -0
- package/dist/src/decorators/term.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 +6 -0
- package/dist/src/entities/annotations.d.ts.map +1 -1
- package/dist/src/entities/annotations.js +25 -1
- 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/enum.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 +66 -5
- 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 +6 -1
- package/dist/src/entities/namespace.d.ts.map +1 -1
- package/dist/src/entities/namespace.js +107 -11
- package/dist/src/entities/namespace.js.map +1 -1
- package/dist/src/entities/operation.d.ts +4 -0
- package/dist/src/entities/operation.d.ts.map +1 -1
- package/dist/src/entities/operation.js +28 -8
- package/dist/src/entities/operation.js.map +1 -1
- package/dist/src/entities/revision-definition.d.ts +1 -0
- package/dist/src/entities/revision-definition.d.ts.map +1 -1
- package/dist/src/entities/revision-definition.js +3 -3
- package/dist/src/entities/revision-definition.js.map +1 -1
- package/dist/src/entities/term.d.ts +8 -0
- package/dist/src/entities/term.d.ts.map +1 -0
- package/dist/src/entities/term.js +14 -0
- package/dist/src/entities/term.js.map +1 -0
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +69 -146
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +24 -10
- 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/allowed-values.d.ts +2 -1
- package/dist/src/rules/allowed-values.d.ts.map +1 -1
- package/dist/src/rules/allowed-values.js +7 -7
- package/dist/src/rules/allowed-values.js.map +1 -1
- package/dist/src/rules/alternate-key.d.ts +4 -3
- package/dist/src/rules/alternate-key.d.ts.map +1 -1
- package/dist/src/rules/alternate-key.js +23 -23
- package/dist/src/rules/alternate-key.js.map +1 -1
- package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts +2 -1
- package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts.map +1 -1
- package/dist/src/rules/collection-navigation-properties-not-nullable.js +9 -9
- package/dist/src/rules/collection-navigation-properties-not-nullable.js.map +1 -1
- package/dist/src/rules/computed.d.ts +2 -1
- package/dist/src/rules/computed.d.ts.map +1 -1
- package/dist/src/rules/computed.js +9 -8
- package/dist/src/rules/computed.js.map +1 -1
- package/dist/src/rules/contains.d.ts +2 -1
- package/dist/src/rules/contains.d.ts.map +1 -1
- package/dist/src/rules/contains.js +9 -8
- package/dist/src/rules/contains.js.map +1 -1
- package/dist/src/rules/count.d.ts +2 -1
- package/dist/src/rules/count.d.ts.map +1 -1
- package/dist/src/rules/count.js +9 -8
- package/dist/src/rules/count.js.map +1 -1
- package/dist/src/rules/disallowed-typespec-decorators.d.ts +2 -1
- package/dist/src/rules/disallowed-typespec-decorators.d.ts.map +1 -1
- package/dist/src/rules/disallowed-typespec-decorators.js +29 -25
- package/dist/src/rules/disallowed-typespec-decorators.js.map +1 -1
- package/dist/src/rules/entity.d.ts +5 -2
- package/dist/src/rules/entity.d.ts.map +1 -1
- package/dist/src/rules/entity.js +102 -19
- package/dist/src/rules/entity.js.map +1 -1
- package/dist/src/rules/enum.d.ts +3 -1
- package/dist/src/rules/enum.d.ts.map +1 -1
- package/dist/src/rules/enum.js +9 -6
- package/dist/src/rules/enum.js.map +1 -1
- package/dist/src/rules/expand.d.ts +3 -2
- package/dist/src/rules/expand.d.ts.map +1 -1
- package/dist/src/rules/expand.js +16 -16
- package/dist/src/rules/expand.js.map +1 -1
- package/dist/src/rules/extends-on-same-type.d.ts +2 -1
- package/dist/src/rules/extends-on-same-type.d.ts.map +1 -1
- package/dist/src/rules/extends-on-same-type.js +9 -8
- package/dist/src/rules/extends-on-same-type.js.map +1 -1
- package/dist/src/rules/filter.d.ts +4 -3
- package/dist/src/rules/filter.d.ts.map +1 -1
- package/dist/src/rules/filter.js +23 -23
- package/dist/src/rules/filter.js.map +1 -1
- package/dist/src/rules/function.d.ts +2 -1
- package/dist/src/rules/function.d.ts.map +1 -1
- package/dist/src/rules/function.js +9 -9
- package/dist/src/rules/function.js.map +1 -1
- package/dist/src/rules/global-operation.d.ts +4 -0
- package/dist/src/rules/global-operation.d.ts.map +1 -0
- package/dist/src/rules/global-operation.js +60 -0
- package/dist/src/rules/global-operation.js.map +1 -0
- package/dist/src/rules/graph-deprecated.d.ts +8 -0
- package/dist/src/rules/graph-deprecated.d.ts.map +1 -0
- package/dist/src/rules/graph-deprecated.js +152 -0
- package/dist/src/rules/graph-deprecated.js.map +1 -0
- package/dist/src/rules/graph-route.d.ts +8 -2
- package/dist/src/rules/graph-route.d.ts.map +1 -1
- package/dist/src/rules/graph-route.js +80 -16
- package/dist/src/rules/graph-route.js.map +1 -1
- package/dist/src/rules/has-stream.d.ts +2 -1
- package/dist/src/rules/has-stream.d.ts.map +1 -1
- package/dist/src/rules/has-stream.js +9 -8
- package/dist/src/rules/has-stream.js.map +1 -1
- package/dist/src/rules/index.d.ts +5 -0
- package/dist/src/rules/index.d.ts.map +1 -1
- package/dist/src/rules/index.js +5 -0
- package/dist/src/rules/index.js.map +1 -1
- package/dist/src/rules/namespace.d.ts +4 -3
- package/dist/src/rules/namespace.d.ts.map +1 -1
- package/dist/src/rules/namespace.js +58 -73
- package/dist/src/rules/namespace.js.map +1 -1
- package/dist/src/rules/open.d.ts +2 -1
- package/dist/src/rules/open.d.ts.map +1 -1
- package/dist/src/rules/open.js +9 -8
- package/dist/src/rules/open.js.map +1 -1
- package/dist/src/rules/operation-inside-interface.d.ts +2 -1
- package/dist/src/rules/operation-inside-interface.d.ts.map +1 -1
- package/dist/src/rules/operation-inside-interface.js +9 -8
- package/dist/src/rules/operation-inside-interface.js.map +1 -1
- package/dist/src/rules/order-by.d.ts +3 -2
- package/dist/src/rules/order-by.d.ts.map +1 -1
- package/dist/src/rules/order-by.js +16 -16
- package/dist/src/rules/order-by.js.map +1 -1
- package/dist/src/rules/ownerless.d.ts +10 -0
- package/dist/src/rules/ownerless.d.ts.map +1 -0
- package/dist/src/rules/ownerless.js +155 -0
- package/dist/src/rules/ownerless.js.map +1 -0
- package/dist/src/rules/partial.d.ts +2 -1
- package/dist/src/rules/partial.d.ts.map +1 -1
- package/dist/src/rules/partial.js +9 -8
- package/dist/src/rules/partial.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/rules/references.d.ts +2 -1
- package/dist/src/rules/references.d.ts.map +1 -1
- package/dist/src/rules/references.js +9 -8
- package/dist/src/rules/references.js.map +1 -1
- package/dist/src/rules/required-for-create.d.ts +2 -1
- package/dist/src/rules/required-for-create.d.ts.map +1 -1
- package/dist/src/rules/required-for-create.js +9 -8
- package/dist/src/rules/required-for-create.js.map +1 -1
- package/dist/src/rules/search.d.ts +2 -1
- package/dist/src/rules/search.d.ts.map +1 -1
- package/dist/src/rules/search.js +9 -8
- package/dist/src/rules/search.js.map +1 -1
- package/dist/src/rules/skip.d.ts +2 -1
- package/dist/src/rules/skip.d.ts.map +1 -1
- package/dist/src/rules/skip.js +9 -8
- package/dist/src/rules/skip.js.map +1 -1
- package/dist/src/rules/top.d.ts +2 -1
- package/dist/src/rules/top.d.ts.map +1 -1
- package/dist/src/rules/top.js +9 -8
- package/dist/src/rules/top.js.map +1 -1
- package/dist/src/testing/index.d.ts +1 -0
- package/dist/src/testing/index.d.ts.map +1 -1
- package/dist/src/testing/index.js +21 -0
- package/dist/src/testing/index.js.map +1 -1
- package/dist/src/utils.d.ts +19 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +44 -21
- package/dist/src/utils.js.map +1 -1
- package/dist/src/{linter.d.ts → validate.d.ts} +1 -1
- package/dist/src/validate.d.ts.map +1 -0
- package/dist/src/validate.js +56 -0
- package/dist/src/validate.js.map +1 -0
- package/lib/decorators.tsp +114 -17
- package/lib/porcelain.tsp +18 -7
- package/lib/responses.tsp +32 -7
- package/lib/shared-models.tsp +0 -50
- package/package.json +5 -7
- package/dist/src/linter.d.ts.map +0 -1
- package/dist/src/linter.js +0 -44
- package/dist/src/linter.js.map +0 -1
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,10 +53,9 @@
|
|
|
53
53
|
],
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@xmldom/xmldom": "~0.8.4",
|
|
56
|
-
"@typespec/compiler": "~0.
|
|
57
|
-
"@typespec/http": "~0.
|
|
58
|
-
"
|
|
59
|
-
"prettier": "~2.8.7",
|
|
56
|
+
"@typespec/compiler": "~0.52.0",
|
|
57
|
+
"@typespec/http": "~0.52.0",
|
|
58
|
+
"prettier": "~3.1.1",
|
|
60
59
|
"react-dom": "~18.2.0",
|
|
61
60
|
"react": "~18.2.0",
|
|
62
61
|
"react-reconciler": "~0.27.0"
|
|
@@ -64,10 +63,9 @@
|
|
|
64
63
|
"devDependencies": {
|
|
65
64
|
"@types/mocha": "~10.0.1",
|
|
66
65
|
"@types/node": "~18.11.9",
|
|
67
|
-
"@types/prettier": "2.6.0",
|
|
68
66
|
"@types/react": "~18.0.5",
|
|
69
67
|
"@types/react-reconciler": "~0.28.0",
|
|
70
|
-
"@typespec/eslint-config-typespec": "~0.
|
|
68
|
+
"@typespec/eslint-config-typespec": "~0.52.0",
|
|
71
69
|
"c8": "~8.0.1",
|
|
72
70
|
"eslint": "^8.49.0",
|
|
73
71
|
"mocha": "~10.2.0",
|
package/dist/src/linter.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"linter.d.ts","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AA4C7C,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,QAM3C"}
|
package/dist/src/linter.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { getLinter } from "@typespec/lint";
|
|
2
|
-
import { $lib } from "./lib.js";
|
|
3
|
-
import * as theRules from "./rules/index.js";
|
|
4
|
-
const linter = getLinter($lib);
|
|
5
|
-
linter.registerRules([
|
|
6
|
-
theRules.alternateKeyOnKeyRule,
|
|
7
|
-
theRules.alternateKeyOnPrimitivePropertyRule,
|
|
8
|
-
theRules.alternateKeyRequiresKeyRule,
|
|
9
|
-
theRules.computedCannotBeCombinedWithRule,
|
|
10
|
-
theRules.containsOnlyAppliesToNavigationPropertyRule,
|
|
11
|
-
theRules.countAppliesToGetOperationsThatReturnCollectionsRule,
|
|
12
|
-
theRules.disallowedTypeSpecDecoratorsRule,
|
|
13
|
-
theRules.entityMustHaveKeyRule,
|
|
14
|
-
theRules.expandOnlyNavigationPropertiesRule,
|
|
15
|
-
theRules.expandOnlyOnGetNavigationSourceRule,
|
|
16
|
-
theRules.extendsOnSameTypeRule,
|
|
17
|
-
theRules.filterAppliesToGetOperationsThatReturnCollectionsRule,
|
|
18
|
-
theRules.filterOnlyAppliesToModelPropertiesRule,
|
|
19
|
-
theRules.filterPropertiesMustNotBeEmptyRule,
|
|
20
|
-
theRules.hasStreamOnlyOnEntity,
|
|
21
|
-
theRules.invalidPublicNamespaceNameRule,
|
|
22
|
-
theRules.keyOnlyOnEntityNonNullablePrimitivePropertyRule,
|
|
23
|
-
theRules.namespaceIsRequiredRule,
|
|
24
|
-
theRules.openOnlyAppliesToStructuredType,
|
|
25
|
-
theRules.operationInsideInterfaceRule,
|
|
26
|
-
theRules.operationParametersMatchGraphRouteParametersRule,
|
|
27
|
-
theRules.orderByOnlyNonNavigationPropertiesRule,
|
|
28
|
-
theRules.orderByAppliesToGetOperationsThatReturnCollectionsRule,
|
|
29
|
-
theRules.referencesOnlyAppliesToNavigationPropertyRule,
|
|
30
|
-
theRules.searchAppliesToGetOperationsThatReturnCollectionsRule,
|
|
31
|
-
theRules.skipAppliesToGetOperationsThatReturnCollectionsRule,
|
|
32
|
-
theRules.topAppliesToGetOperationsThatReturnCollectionsRule,
|
|
33
|
-
theRules.useEvolvableEnumRule,
|
|
34
|
-
theRules.voidFunctionRule,
|
|
35
|
-
theRules.allowedValuesCannotBeEmptyRule,
|
|
36
|
-
theRules.graphRouteLeadingSlashRule,
|
|
37
|
-
theRules.extendedModelBaseShouldMatchPartialBaseModel,
|
|
38
|
-
], { autoEnable: true });
|
|
39
|
-
export function $onValidate(program) {
|
|
40
|
-
linter.autoEnableRules();
|
|
41
|
-
linter.lintOnValidate(program);
|
|
42
|
-
theRules.validateAbstractOnlyAppliesToStructuredTypes(program);
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=linter.js.map
|
package/dist/src/linter.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"linter.js","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAChC,OAAQ,KAAK,QAAQ,MAAM,kBAAkB,CAAC;AAE9C,MAAM,MAAM,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;AAC/B,MAAM,CAAC,aAAa,CAClB;IACE,QAAQ,CAAC,qBAAqB;IAC9B,QAAQ,CAAC,mCAAmC;IAC5C,QAAQ,CAAC,2BAA2B;IACpC,QAAQ,CAAC,gCAAgC;IACzC,QAAQ,CAAC,2CAA2C;IACpD,QAAQ,CAAC,oDAAoD;IAC7D,QAAQ,CAAC,gCAAgC;IACzC,QAAQ,CAAC,qBAAqB;IAC9B,QAAQ,CAAC,kCAAkC;IAC3C,QAAQ,CAAC,mCAAmC;IAC5C,QAAQ,CAAC,qBAAqB;IAC9B,QAAQ,CAAC,qDAAqD;IAC9D,QAAQ,CAAC,sCAAsC;IAC/C,QAAQ,CAAC,kCAAkC;IAC3C,QAAQ,CAAC,qBAAqB;IAC9B,QAAQ,CAAC,8BAA8B;IACvC,QAAQ,CAAC,+CAA+C;IACxD,QAAQ,CAAC,uBAAuB;IAChC,QAAQ,CAAC,+BAA+B;IACxC,QAAQ,CAAC,4BAA4B;IACrC,QAAQ,CAAC,gDAAgD;IACzD,QAAQ,CAAC,sCAAsC;IAC/C,QAAQ,CAAC,sDAAsD;IAC/D,QAAQ,CAAC,6CAA6C;IACtD,QAAQ,CAAC,qDAAqD;IAC9D,QAAQ,CAAC,mDAAmD;IAC5D,QAAQ,CAAC,kDAAkD;IAC3D,QAAQ,CAAC,oBAAoB;IAC7B,QAAQ,CAAC,gBAAgB;IACzB,QAAQ,CAAC,8BAA8B;IACvC,QAAQ,CAAC,0BAA0B;IACnC,QAAQ,CAAC,4CAA4C;CACtD,EACD,EAAE,UAAU,EAAE,IAAI,EAAE,CACrB,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,OAAgB;IAC1C,MAAM,CAAC,eAAe,EAAE,CAAC;IACzB,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IAE/B,QAAQ,CAAC,4CAA4C,CAAC,OAAO,CAAC,CAAC;AAEjE,CAAC"}
|