@microsoft/typespec-msgraph 0.0.1-Preview.18 → 0.0.1-Preview.19

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 (155) hide show
  1. package/dist/src/components/acceptable-media-types-annotation.js.map +1 -1
  2. package/dist/src/components/alternate-keys-annotation.js.map +1 -1
  3. package/dist/src/components/common-elements.d.ts +1 -1
  4. package/dist/src/components/common-elements.d.ts.map +1 -1
  5. package/dist/src/components/common-elements.js.map +1 -1
  6. package/dist/src/components/delta-annotation.d.ts +6 -0
  7. package/dist/src/components/delta-annotation.d.ts.map +1 -0
  8. package/dist/src/components/delta-annotation.js +18 -0
  9. package/dist/src/components/delta-annotation.js.map +1 -0
  10. package/dist/src/components/entity-container-element.d.ts.map +1 -1
  11. package/dist/src/components/entity-container-element.js +4 -1
  12. package/dist/src/components/entity-container-element.js.map +1 -1
  13. package/dist/src/components/is-url-annotation.d.ts +5 -0
  14. package/dist/src/components/is-url-annotation.d.ts.map +1 -0
  15. package/dist/src/components/is-url-annotation.js +6 -0
  16. package/dist/src/components/is-url-annotation.js.map +1 -0
  17. package/dist/src/components/operation-element.d.ts.map +1 -1
  18. package/dist/src/components/operation-element.js +4 -2
  19. package/dist/src/components/operation-element.js.map +1 -1
  20. package/dist/src/components/permissions-annotation.js.map +1 -1
  21. package/dist/src/components/property-element.d.ts.map +1 -1
  22. package/dist/src/components/property-element.js +6 -2
  23. package/dist/src/components/property-element.js.map +1 -1
  24. package/dist/src/components/revisions-annotation.js.map +1 -1
  25. package/dist/src/components/schema-element.js.map +1 -1
  26. package/dist/src/decorators/ags-attribute.js.map +1 -1
  27. package/dist/src/decorators/allowed-values.js.map +1 -1
  28. package/dist/src/decorators/delta.d.ts +10 -0
  29. package/dist/src/decorators/delta.d.ts.map +1 -0
  30. package/dist/src/decorators/delta.js +14 -0
  31. package/dist/src/decorators/delta.js.map +1 -0
  32. package/dist/src/decorators/expand.d.ts +1 -0
  33. package/dist/src/decorators/expand.d.ts.map +1 -1
  34. package/dist/src/decorators/expand.js +5 -1
  35. package/dist/src/decorators/expand.js.map +1 -1
  36. package/dist/src/decorators/filter.js +4 -4
  37. package/dist/src/decorators/filter.js.map +1 -1
  38. package/dist/src/decorators/function.d.ts.map +1 -1
  39. package/dist/src/decorators/function.js +3 -0
  40. package/dist/src/decorators/function.js.map +1 -1
  41. package/dist/src/decorators/graph-route.js.map +1 -1
  42. package/dist/src/decorators/index.d.ts +2 -0
  43. package/dist/src/decorators/index.d.ts.map +1 -1
  44. package/dist/src/decorators/index.js +2 -0
  45. package/dist/src/decorators/index.js.map +1 -1
  46. package/dist/src/decorators/public-namespace.js.map +1 -1
  47. package/dist/src/decorators/reference-target.js.map +1 -1
  48. package/dist/src/decorators/return-source.d.ts +9 -0
  49. package/dist/src/decorators/return-source.d.ts.map +1 -0
  50. package/dist/src/decorators/return-source.js +26 -0
  51. package/dist/src/decorators/return-source.js.map +1 -0
  52. package/dist/src/decorators/workload-namespace.js.map +1 -1
  53. package/dist/src/dom/error-interceptor.js.map +1 -1
  54. package/dist/src/dom/reconciler.js.map +1 -1
  55. package/dist/src/dom/renderer.js.map +1 -1
  56. package/dist/src/emitter.d.ts.map +1 -1
  57. package/dist/src/emitter.js +21 -2
  58. package/dist/src/emitter.js.map +1 -1
  59. package/dist/src/entities/address-url.js.map +1 -1
  60. package/dist/src/entities/annotations.d.ts.map +1 -1
  61. package/dist/src/entities/annotations.js +9 -22
  62. package/dist/src/entities/annotations.js.map +1 -1
  63. package/dist/src/entities/entity-container.d.ts +2 -0
  64. package/dist/src/entities/entity-container.d.ts.map +1 -1
  65. package/dist/src/entities/entity-container.js +4 -1
  66. package/dist/src/entities/entity-container.js.map +1 -1
  67. package/dist/src/entities/model.d.ts +6 -0
  68. package/dist/src/entities/model.d.ts.map +1 -1
  69. package/dist/src/entities/model.js +37 -1
  70. package/dist/src/entities/model.js.map +1 -1
  71. package/dist/src/entities/ms-graph-route.js.map +1 -1
  72. package/dist/src/entities/namespace.d.ts.map +1 -1
  73. package/dist/src/entities/namespace.js.map +1 -1
  74. package/dist/src/entities/operation.d.ts +1 -0
  75. package/dist/src/entities/operation.d.ts.map +1 -1
  76. package/dist/src/entities/operation.js +3 -2
  77. package/dist/src/entities/operation.js.map +1 -1
  78. package/dist/src/entities/property.js.map +1 -1
  79. package/dist/src/entities/revision-definition.js.map +1 -1
  80. package/dist/src/lib.d.ts +22 -0
  81. package/dist/src/lib.d.ts.map +1 -1
  82. package/dist/src/lib.js +11 -0
  83. package/dist/src/lib.js.map +1 -1
  84. package/dist/src/rules/abstract.js.map +1 -1
  85. package/dist/src/rules/address-url.js.map +1 -1
  86. package/dist/src/rules/allowed-values.js.map +1 -1
  87. package/dist/src/rules/alternate-key.js.map +1 -1
  88. package/dist/src/rules/collection-navigation-properties-not-nullable.js.map +1 -1
  89. package/dist/src/rules/complex.d.ts +3 -0
  90. package/dist/src/rules/complex.d.ts.map +1 -0
  91. package/dist/src/rules/complex.js +27 -0
  92. package/dist/src/rules/complex.js.map +1 -0
  93. package/dist/src/rules/computed.js.map +1 -1
  94. package/dist/src/rules/contains.js.map +1 -1
  95. package/dist/src/rules/count.js.map +1 -1
  96. package/dist/src/rules/delta.d.ts +8 -0
  97. package/dist/src/rules/delta.d.ts.map +1 -0
  98. package/dist/src/rules/delta.js +204 -0
  99. package/dist/src/rules/delta.js.map +1 -0
  100. package/dist/src/rules/disallowed-typespec-decorators.js.map +1 -1
  101. package/dist/src/rules/entity.d.ts +1 -0
  102. package/dist/src/rules/entity.d.ts.map +1 -1
  103. package/dist/src/rules/entity.js +19 -1
  104. package/dist/src/rules/entity.js.map +1 -1
  105. package/dist/src/rules/enum.js.map +1 -1
  106. package/dist/src/rules/expand.d.ts.map +1 -1
  107. package/dist/src/rules/expand.js +7 -1
  108. package/dist/src/rules/expand.js.map +1 -1
  109. package/dist/src/rules/extends-on-same-type.js.map +1 -1
  110. package/dist/src/rules/filter.d.ts +1 -0
  111. package/dist/src/rules/filter.d.ts.map +1 -1
  112. package/dist/src/rules/filter.js +45 -25
  113. package/dist/src/rules/filter.js.map +1 -1
  114. package/dist/src/rules/function.js.map +1 -1
  115. package/dist/src/rules/global-operation.js.map +1 -1
  116. package/dist/src/rules/graph-deprecated.js.map +1 -1
  117. package/dist/src/rules/graph-route.js.map +1 -1
  118. package/dist/src/rules/index.d.ts +3 -0
  119. package/dist/src/rules/index.d.ts.map +1 -1
  120. package/dist/src/rules/index.js +3 -0
  121. package/dist/src/rules/index.js.map +1 -1
  122. package/dist/src/rules/limited-charset.js.map +1 -1
  123. package/dist/src/rules/media.js.map +1 -1
  124. package/dist/src/rules/model.js.map +1 -1
  125. package/dist/src/rules/namespace.js.map +1 -1
  126. package/dist/src/rules/open.js.map +1 -1
  127. package/dist/src/rules/operation-inside-interface.d.ts +1 -0
  128. package/dist/src/rules/operation-inside-interface.d.ts.map +1 -1
  129. package/dist/src/rules/operation-inside-interface.js +38 -2
  130. package/dist/src/rules/operation-inside-interface.js.map +1 -1
  131. package/dist/src/rules/order-by.js.map +1 -1
  132. package/dist/src/rules/ownerless.js.map +1 -1
  133. package/dist/src/rules/partial.js.map +1 -1
  134. package/dist/src/rules/record-t.js.map +1 -1
  135. package/dist/src/rules/reference-target.js.map +1 -1
  136. package/dist/src/rules/references.js.map +1 -1
  137. package/dist/src/rules/required-for-create.js.map +1 -1
  138. package/dist/src/rules/return-source.d.ts +3 -0
  139. package/dist/src/rules/return-source.d.ts.map +1 -0
  140. package/dist/src/rules/return-source.js +27 -0
  141. package/dist/src/rules/return-source.js.map +1 -0
  142. package/dist/src/rules/search.js.map +1 -1
  143. package/dist/src/rules/skip.js.map +1 -1
  144. package/dist/src/rules/top.js.map +1 -1
  145. package/dist/src/utils.d.ts +9 -3
  146. package/dist/src/utils.d.ts.map +1 -1
  147. package/dist/src/utils.js +210 -33
  148. package/dist/src/utils.js.map +1 -1
  149. package/dist/src/validate.d.ts.map +1 -1
  150. package/dist/src/validate.js +11 -0
  151. package/dist/src/validate.js.map +1 -1
  152. package/lib/decorators.tsp +15 -1
  153. package/lib/lib.tsp +3 -1
  154. package/lib/porcelain.tsp +19 -4
  155. package/package.json +13 -12
@@ -104,6 +104,14 @@ extern dec contains(target: ModelProperty);
104
104
  */
105
105
  extern dec count(target: Operation);
106
106
 
107
+ /**
108
+ * `@delta` - mark an operation as a delta operation
109
+ *
110
+ * `@delta` can only be applied to operations.
111
+ */
112
+
113
+ extern dec delta(target: Operation);
114
+
107
115
  /**
108
116
  * `@deltaCollection` - mark a model as representing a delta paged collection.
109
117
  *
@@ -202,7 +210,7 @@ extern dec flags(target: Enum);
202
210
  *
203
211
  * `@function` can only be applied to operations.
204
212
  */
205
- extern dec function(target: Operation, name?: valueof string, isComposable?: valueof boolean);
213
+ extern dec function(target: Operation, name?: valueof string | null, isComposable?: valueof boolean);
206
214
 
207
215
  /**
208
216
  * `@globalOperation` - mark an operation as a globalOperation
@@ -383,6 +391,12 @@ extern dec references(target: ModelProperty);
383
391
  */
384
392
  extern dec requiredForCreate(target: ModelProperty);
385
393
 
394
+ /**
395
+ * '@returnSource' - mark an action or a function as having an entitysetpath.
396
+ * '@returnSource' - can only be applied to action and function operations.
397
+ */
398
+ extern dec returnSource(target: Operation, path : valueof string | null);
399
+
386
400
  /**
387
401
  * `@search` - Applies to: get operations that return collections.
388
402
  * Indicates that the get operation supports the OData $search query parameter.
package/lib/lib.tsp CHANGED
@@ -4,7 +4,9 @@ import "@typespec/http";
4
4
  using TypeSpec.Http;
5
5
  namespace MsGraph;
6
6
 
7
- scalar date;
7
+ alias date=plainDate;
8
+ alias dateTimeOffset=offsetDateTime;
9
+ alias timeOfDay=plainTime;
8
10
 
9
11
  scalar stream;
10
12
 
package/lib/porcelain.tsp CHANGED
@@ -11,6 +11,7 @@ using TypeSpec.Http;
11
11
  using MsGraph;
12
12
  using MsGraph.SharedModels;
13
13
  using MsGraph.Responses;
14
+ using MsGraph.Bodies;
14
15
 
15
16
  namespace MsGraph;
16
17
 
@@ -144,22 +145,36 @@ namespace MsGraph;
144
145
  TResource, TParams, TResponse, TErrorResponse>;
145
146
 
146
147
 
147
- @action op Action<
148
+ @action @returnSource(TSourceRoute) op Action<
148
149
  TReturnType = void,
149
150
  TActionParams extends {} = {},
150
151
  TResource = Automatic.CalculatedResourceType,
151
152
  TParams = {... Automatic.GraphRouteParams, ... TActionParams},
152
153
  TResponse = TReturnType,
153
- TErrorResponse = MsGraph.Responses.OperationErrorResponse
154
+ TErrorResponse = MsGraph.Responses.OperationErrorResponse,
155
+ TSourceRoute extends valueof string | null = null
154
156
  >(...TParams): TResponse | TErrorResponse;
155
157
 
156
- @function op Function<
158
+ @function(TNameOverride, TComposable) @returnSource(TSourceRoute) op Function<
157
159
  TReturnType,
158
160
  TFunctionParams extends {} = {},
159
161
  TResource = Automatic.CalculatedResourceType,
160
162
  TParams = {... Automatic.GraphRouteParams, ... TFunctionParams},
161
163
  TResponse = TReturnType,
162
- TErrorResponse = MsGraph.Responses.OperationErrorResponse
164
+ TErrorResponse = MsGraph.Responses.OperationErrorResponse,
165
+ TComposable extends valueof boolean = false,
166
+ TNameOverride extends valueof string | null = null,
167
+ TSourceRoute extends valueof string | null = null
168
+ >(...TParams): TResponse | TErrorResponse;
169
+
170
+ @delta @function @returnSource(TSourceRoute) op Delta<
171
+ TReturnType=DeltaCollectionBody<Automatic.CalculatedResourceType>,
172
+ TFunctionParams extends {} = {},
173
+ TResource = Automatic.CalculatedResourceType,
174
+ TParams = {... Automatic.GraphRouteParams, ... TFunctionParams},
175
+ TResponse = TReturnType,
176
+ TErrorResponse = MsGraph.Responses.OperationErrorResponse,
177
+ TSourceRoute extends valueof string | null = null
163
178
  >(...TParams): TResponse | TErrorResponse;
164
179
 
165
180
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/typespec-msgraph",
3
- "version": "0.0.1-Preview.18",
3
+ "version": "0.0.1-Preview.19",
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",
@@ -55,23 +55,24 @@
55
55
  "@xmldom/xmldom": "~0.8.4",
56
56
  "@typespec/compiler": "~0.55.0",
57
57
  "@typespec/http": "~0.55.0",
58
- "prettier": "~3.1.1",
59
- "react-dom": "~18.2.0",
60
- "react": "~18.2.0",
61
- "react-reconciler": "~0.27.0"
58
+ "prettier": "~3.2.5",
59
+ "react-dom": "~18.3.1",
60
+ "react": "~18.3.1",
61
+ "react-reconciler": "~0.29.0"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@types/mocha": "~10.0.1",
65
- "@types/node": "~18.11.9",
66
- "@types/react": "~18.0.5",
65
+ "@types/node": "~20.12.7",
66
+ "@types/react": "~18.3.1",
67
67
  "@types/react-reconciler": "~0.28.0",
68
68
  "@typespec/eslint-config-typespec": "~0.55.0",
69
- "c8": "~8.0.1",
70
- "eslint": "^8.49.0",
71
- "mocha": "~10.2.0",
69
+ "c8": "~9.1.0",
70
+ "eslint": "^9.1.1",
71
+ "mocha": "~10.4.0",
72
72
  "rimraf": "~5.0.1",
73
- "typescript": "~5.2.2",
73
+ "typescript": "~5.4.5",
74
74
  "xpath": "~0.0.32",
75
- "tsx": "~3.12.3"
75
+ "tsx": "~4.8.1",
76
+ "source-map-support": "latest"
76
77
  }
77
78
  }