@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.
Files changed (258) hide show
  1. package/dist/src/components/annotations.d.ts.map +1 -1
  2. package/dist/src/components/annotations.js +24 -3
  3. package/dist/src/components/annotations.js.map +1 -1
  4. package/dist/src/components/entity-container-element.d.ts.map +1 -1
  5. package/dist/src/components/entity-container-element.js +13 -6
  6. package/dist/src/components/entity-container-element.js.map +1 -1
  7. package/dist/src/components/operation-element.d.ts.map +1 -1
  8. package/dist/src/components/operation-element.js +15 -4
  9. package/dist/src/components/operation-element.js.map +1 -1
  10. package/dist/src/components/property-element.js +1 -1
  11. package/dist/src/components/property-element.js.map +1 -1
  12. package/dist/src/components/reference-target-element.d.ts +9 -0
  13. package/dist/src/components/reference-target-element.d.ts.map +1 -0
  14. package/dist/src/components/reference-target-element.js +3 -0
  15. package/dist/src/components/reference-target-element.js.map +1 -0
  16. package/dist/src/components/revisions-annotation.d.ts.map +1 -1
  17. package/dist/src/components/revisions-annotation.js +2 -1
  18. package/dist/src/components/revisions-annotation.js.map +1 -1
  19. package/dist/src/components/schema-element.d.ts.map +1 -1
  20. package/dist/src/components/schema-element.js +5 -3
  21. package/dist/src/components/schema-element.js.map +1 -1
  22. package/dist/src/components/select-supported-annotation.d.ts +5 -0
  23. package/dist/src/components/select-supported-annotation.d.ts.map +1 -0
  24. package/dist/src/components/select-supported-annotation.js +6 -0
  25. package/dist/src/components/select-supported-annotation.js.map +1 -0
  26. package/dist/src/components/term-element.d.ts +9 -0
  27. package/dist/src/components/term-element.d.ts.map +1 -0
  28. package/dist/src/components/term-element.js +8 -0
  29. package/dist/src/components/term-element.js.map +1 -0
  30. package/dist/src/decorators/address-url.d.ts +16 -0
  31. package/dist/src/decorators/address-url.d.ts.map +1 -0
  32. package/dist/src/decorators/address-url.js +19 -0
  33. package/dist/src/decorators/address-url.js.map +1 -0
  34. package/dist/src/decorators/ags-attribute.d.ts +2 -1
  35. package/dist/src/decorators/ags-attribute.d.ts.map +1 -1
  36. package/dist/src/decorators/ags-attribute.js +34 -1
  37. package/dist/src/decorators/ags-attribute.js.map +1 -1
  38. package/dist/src/decorators/global-operation.d.ts +9 -0
  39. package/dist/src/decorators/global-operation.d.ts.map +1 -0
  40. package/dist/src/decorators/global-operation.js +13 -0
  41. package/dist/src/decorators/global-operation.js.map +1 -0
  42. package/dist/src/decorators/graph-deprecated.d.ts +11 -0
  43. package/dist/src/decorators/graph-deprecated.d.ts.map +1 -0
  44. package/dist/src/decorators/graph-deprecated.js +19 -0
  45. package/dist/src/decorators/graph-deprecated.js.map +1 -0
  46. package/dist/src/decorators/index.d.ts +7 -0
  47. package/dist/src/decorators/index.d.ts.map +1 -1
  48. package/dist/src/decorators/index.js +7 -0
  49. package/dist/src/decorators/index.js.map +1 -1
  50. package/dist/src/decorators/is-owner.js +1 -1
  51. package/dist/src/decorators/ownerless.d.ts +8 -0
  52. package/dist/src/decorators/ownerless.d.ts.map +1 -0
  53. package/dist/src/decorators/ownerless.js +12 -0
  54. package/dist/src/decorators/ownerless.js.map +1 -0
  55. package/dist/src/decorators/public-namespace.d.ts.map +1 -1
  56. package/dist/src/decorators/public-namespace.js +4 -1
  57. package/dist/src/decorators/public-namespace.js.map +1 -1
  58. package/dist/src/decorators/reference-target.d.ts +16 -0
  59. package/dist/src/decorators/reference-target.d.ts.map +1 -0
  60. package/dist/src/decorators/reference-target.js +52 -0
  61. package/dist/src/decorators/reference-target.js.map +1 -0
  62. package/dist/src/decorators/select.d.ts +9 -0
  63. package/dist/src/decorators/select.d.ts.map +1 -0
  64. package/dist/src/decorators/select.js +13 -0
  65. package/dist/src/decorators/select.js.map +1 -0
  66. package/dist/src/decorators/term.d.ts +13 -0
  67. package/dist/src/decorators/term.d.ts.map +1 -0
  68. package/dist/src/decorators/term.js +14 -0
  69. package/dist/src/decorators/term.js.map +1 -0
  70. package/dist/src/entities/address-url.d.ts +4 -0
  71. package/dist/src/entities/address-url.d.ts.map +1 -0
  72. package/dist/src/entities/address-url.js +18 -0
  73. package/dist/src/entities/address-url.js.map +1 -0
  74. package/dist/src/entities/annotations.d.ts +6 -0
  75. package/dist/src/entities/annotations.d.ts.map +1 -1
  76. package/dist/src/entities/annotations.js +25 -1
  77. package/dist/src/entities/annotations.js.map +1 -1
  78. package/dist/src/entities/entity-container.d.ts +10 -0
  79. package/dist/src/entities/entity-container.d.ts.map +1 -1
  80. package/dist/src/entities/entity-container.js +3 -0
  81. package/dist/src/entities/entity-container.js.map +1 -1
  82. package/dist/src/entities/enum.js.map +1 -1
  83. package/dist/src/entities/model.d.ts +2 -0
  84. package/dist/src/entities/model.d.ts.map +1 -1
  85. package/dist/src/entities/model.js +66 -5
  86. package/dist/src/entities/model.js.map +1 -1
  87. package/dist/src/entities/ms-graph-route.d.ts +13 -0
  88. package/dist/src/entities/ms-graph-route.d.ts.map +1 -0
  89. package/dist/src/entities/ms-graph-route.js +70 -0
  90. package/dist/src/entities/ms-graph-route.js.map +1 -0
  91. package/dist/src/entities/namespace.d.ts +6 -1
  92. package/dist/src/entities/namespace.d.ts.map +1 -1
  93. package/dist/src/entities/namespace.js +107 -11
  94. package/dist/src/entities/namespace.js.map +1 -1
  95. package/dist/src/entities/operation.d.ts +4 -0
  96. package/dist/src/entities/operation.d.ts.map +1 -1
  97. package/dist/src/entities/operation.js +28 -8
  98. package/dist/src/entities/operation.js.map +1 -1
  99. package/dist/src/entities/revision-definition.d.ts +1 -0
  100. package/dist/src/entities/revision-definition.d.ts.map +1 -1
  101. package/dist/src/entities/revision-definition.js +3 -3
  102. package/dist/src/entities/revision-definition.js.map +1 -1
  103. package/dist/src/entities/term.d.ts +8 -0
  104. package/dist/src/entities/term.d.ts.map +1 -0
  105. package/dist/src/entities/term.js +14 -0
  106. package/dist/src/entities/term.js.map +1 -0
  107. package/dist/src/index.d.ts +1 -1
  108. package/dist/src/index.d.ts.map +1 -1
  109. package/dist/src/index.js +1 -1
  110. package/dist/src/index.js.map +1 -1
  111. package/dist/src/lib.d.ts +69 -146
  112. package/dist/src/lib.d.ts.map +1 -1
  113. package/dist/src/lib.js +24 -10
  114. package/dist/src/lib.js.map +1 -1
  115. package/dist/src/rules/address-url.d.ts +6 -0
  116. package/dist/src/rules/address-url.d.ts.map +1 -0
  117. package/dist/src/rules/address-url.js +40 -0
  118. package/dist/src/rules/address-url.js.map +1 -0
  119. package/dist/src/rules/allowed-values.d.ts +2 -1
  120. package/dist/src/rules/allowed-values.d.ts.map +1 -1
  121. package/dist/src/rules/allowed-values.js +7 -7
  122. package/dist/src/rules/allowed-values.js.map +1 -1
  123. package/dist/src/rules/alternate-key.d.ts +4 -3
  124. package/dist/src/rules/alternate-key.d.ts.map +1 -1
  125. package/dist/src/rules/alternate-key.js +23 -23
  126. package/dist/src/rules/alternate-key.js.map +1 -1
  127. package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts +2 -1
  128. package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts.map +1 -1
  129. package/dist/src/rules/collection-navigation-properties-not-nullable.js +9 -9
  130. package/dist/src/rules/collection-navigation-properties-not-nullable.js.map +1 -1
  131. package/dist/src/rules/computed.d.ts +2 -1
  132. package/dist/src/rules/computed.d.ts.map +1 -1
  133. package/dist/src/rules/computed.js +9 -8
  134. package/dist/src/rules/computed.js.map +1 -1
  135. package/dist/src/rules/contains.d.ts +2 -1
  136. package/dist/src/rules/contains.d.ts.map +1 -1
  137. package/dist/src/rules/contains.js +9 -8
  138. package/dist/src/rules/contains.js.map +1 -1
  139. package/dist/src/rules/count.d.ts +2 -1
  140. package/dist/src/rules/count.d.ts.map +1 -1
  141. package/dist/src/rules/count.js +9 -8
  142. package/dist/src/rules/count.js.map +1 -1
  143. package/dist/src/rules/disallowed-typespec-decorators.d.ts +2 -1
  144. package/dist/src/rules/disallowed-typespec-decorators.d.ts.map +1 -1
  145. package/dist/src/rules/disallowed-typespec-decorators.js +29 -25
  146. package/dist/src/rules/disallowed-typespec-decorators.js.map +1 -1
  147. package/dist/src/rules/entity.d.ts +5 -2
  148. package/dist/src/rules/entity.d.ts.map +1 -1
  149. package/dist/src/rules/entity.js +102 -19
  150. package/dist/src/rules/entity.js.map +1 -1
  151. package/dist/src/rules/enum.d.ts +3 -1
  152. package/dist/src/rules/enum.d.ts.map +1 -1
  153. package/dist/src/rules/enum.js +9 -6
  154. package/dist/src/rules/enum.js.map +1 -1
  155. package/dist/src/rules/expand.d.ts +3 -2
  156. package/dist/src/rules/expand.d.ts.map +1 -1
  157. package/dist/src/rules/expand.js +16 -16
  158. package/dist/src/rules/expand.js.map +1 -1
  159. package/dist/src/rules/extends-on-same-type.d.ts +2 -1
  160. package/dist/src/rules/extends-on-same-type.d.ts.map +1 -1
  161. package/dist/src/rules/extends-on-same-type.js +9 -8
  162. package/dist/src/rules/extends-on-same-type.js.map +1 -1
  163. package/dist/src/rules/filter.d.ts +4 -3
  164. package/dist/src/rules/filter.d.ts.map +1 -1
  165. package/dist/src/rules/filter.js +23 -23
  166. package/dist/src/rules/filter.js.map +1 -1
  167. package/dist/src/rules/function.d.ts +2 -1
  168. package/dist/src/rules/function.d.ts.map +1 -1
  169. package/dist/src/rules/function.js +9 -9
  170. package/dist/src/rules/function.js.map +1 -1
  171. package/dist/src/rules/global-operation.d.ts +4 -0
  172. package/dist/src/rules/global-operation.d.ts.map +1 -0
  173. package/dist/src/rules/global-operation.js +60 -0
  174. package/dist/src/rules/global-operation.js.map +1 -0
  175. package/dist/src/rules/graph-deprecated.d.ts +8 -0
  176. package/dist/src/rules/graph-deprecated.d.ts.map +1 -0
  177. package/dist/src/rules/graph-deprecated.js +152 -0
  178. package/dist/src/rules/graph-deprecated.js.map +1 -0
  179. package/dist/src/rules/graph-route.d.ts +8 -2
  180. package/dist/src/rules/graph-route.d.ts.map +1 -1
  181. package/dist/src/rules/graph-route.js +80 -16
  182. package/dist/src/rules/graph-route.js.map +1 -1
  183. package/dist/src/rules/has-stream.d.ts +2 -1
  184. package/dist/src/rules/has-stream.d.ts.map +1 -1
  185. package/dist/src/rules/has-stream.js +9 -8
  186. package/dist/src/rules/has-stream.js.map +1 -1
  187. package/dist/src/rules/index.d.ts +5 -0
  188. package/dist/src/rules/index.d.ts.map +1 -1
  189. package/dist/src/rules/index.js +5 -0
  190. package/dist/src/rules/index.js.map +1 -1
  191. package/dist/src/rules/namespace.d.ts +4 -3
  192. package/dist/src/rules/namespace.d.ts.map +1 -1
  193. package/dist/src/rules/namespace.js +58 -73
  194. package/dist/src/rules/namespace.js.map +1 -1
  195. package/dist/src/rules/open.d.ts +2 -1
  196. package/dist/src/rules/open.d.ts.map +1 -1
  197. package/dist/src/rules/open.js +9 -8
  198. package/dist/src/rules/open.js.map +1 -1
  199. package/dist/src/rules/operation-inside-interface.d.ts +2 -1
  200. package/dist/src/rules/operation-inside-interface.d.ts.map +1 -1
  201. package/dist/src/rules/operation-inside-interface.js +9 -8
  202. package/dist/src/rules/operation-inside-interface.js.map +1 -1
  203. package/dist/src/rules/order-by.d.ts +3 -2
  204. package/dist/src/rules/order-by.d.ts.map +1 -1
  205. package/dist/src/rules/order-by.js +16 -16
  206. package/dist/src/rules/order-by.js.map +1 -1
  207. package/dist/src/rules/ownerless.d.ts +10 -0
  208. package/dist/src/rules/ownerless.d.ts.map +1 -0
  209. package/dist/src/rules/ownerless.js +155 -0
  210. package/dist/src/rules/ownerless.js.map +1 -0
  211. package/dist/src/rules/partial.d.ts +2 -1
  212. package/dist/src/rules/partial.d.ts.map +1 -1
  213. package/dist/src/rules/partial.js +9 -8
  214. package/dist/src/rules/partial.js.map +1 -1
  215. package/dist/src/rules/reference-target.d.ts +8 -0
  216. package/dist/src/rules/reference-target.d.ts.map +1 -0
  217. package/dist/src/rules/reference-target.js +119 -0
  218. package/dist/src/rules/reference-target.js.map +1 -0
  219. package/dist/src/rules/references.d.ts +2 -1
  220. package/dist/src/rules/references.d.ts.map +1 -1
  221. package/dist/src/rules/references.js +9 -8
  222. package/dist/src/rules/references.js.map +1 -1
  223. package/dist/src/rules/required-for-create.d.ts +2 -1
  224. package/dist/src/rules/required-for-create.d.ts.map +1 -1
  225. package/dist/src/rules/required-for-create.js +9 -8
  226. package/dist/src/rules/required-for-create.js.map +1 -1
  227. package/dist/src/rules/search.d.ts +2 -1
  228. package/dist/src/rules/search.d.ts.map +1 -1
  229. package/dist/src/rules/search.js +9 -8
  230. package/dist/src/rules/search.js.map +1 -1
  231. package/dist/src/rules/skip.d.ts +2 -1
  232. package/dist/src/rules/skip.d.ts.map +1 -1
  233. package/dist/src/rules/skip.js +9 -8
  234. package/dist/src/rules/skip.js.map +1 -1
  235. package/dist/src/rules/top.d.ts +2 -1
  236. package/dist/src/rules/top.d.ts.map +1 -1
  237. package/dist/src/rules/top.js +9 -8
  238. package/dist/src/rules/top.js.map +1 -1
  239. package/dist/src/testing/index.d.ts +1 -0
  240. package/dist/src/testing/index.d.ts.map +1 -1
  241. package/dist/src/testing/index.js +21 -0
  242. package/dist/src/testing/index.js.map +1 -1
  243. package/dist/src/utils.d.ts +19 -1
  244. package/dist/src/utils.d.ts.map +1 -1
  245. package/dist/src/utils.js +44 -21
  246. package/dist/src/utils.js.map +1 -1
  247. package/dist/src/{linter.d.ts → validate.d.ts} +1 -1
  248. package/dist/src/validate.d.ts.map +1 -0
  249. package/dist/src/validate.js +56 -0
  250. package/dist/src/validate.js.map +1 -0
  251. package/lib/decorators.tsp +114 -17
  252. package/lib/porcelain.tsp +18 -7
  253. package/lib/responses.tsp +32 -7
  254. package/lib/shared-models.tsp +0 -50
  255. package/package.json +5 -7
  256. package/dist/src/linter.d.ts.map +0 -1
  257. package/dist/src/linter.js +0 -44
  258. 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: publicError;
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
- @doc("Response to represent a Microsoft Graph collection response payload.")
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
- @doc("Response to represent a Microsoft Graph paged collection response payload.")
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
- @doc("Response to represent a Microsoft Graph individual resource response payload.")
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
- @doc("Response to represent a Microsoft Graph resource creation response payload.")
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
- @doc("Response to represent a Microsoft Graph empty response payload.")
93
+ /** Response to represent a Microsoft Graph empty response payload. */
70
94
  model EmptyResponse
71
95
  is Http.Response<204>;
72
96
 
73
- @doc("Response to represent a Microsoft Graph error response payload.")
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
  }
@@ -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.12",
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.49.0",
57
- "@typespec/http": "~0.49.0",
58
- "@typespec/lint": "~0.49.0",
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.49.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",
@@ -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"}
@@ -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
@@ -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"}