@microsoft/typespec-msgraph 0.0.1-Preview.12 → 0.0.1-Preview.13

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 (208) hide show
  1. package/dist/src/components/annotations.js +21 -3
  2. package/dist/src/components/annotations.js.map +1 -1
  3. package/dist/src/components/operation-element.d.ts.map +1 -1
  4. package/dist/src/components/operation-element.js +15 -4
  5. package/dist/src/components/operation-element.js.map +1 -1
  6. package/dist/src/components/revisions-annotation.d.ts.map +1 -1
  7. package/dist/src/components/revisions-annotation.js +2 -1
  8. package/dist/src/components/revisions-annotation.js.map +1 -1
  9. package/dist/src/components/schema-element.d.ts.map +1 -1
  10. package/dist/src/components/schema-element.js +5 -3
  11. package/dist/src/components/schema-element.js.map +1 -1
  12. package/dist/src/components/term-element.d.ts +9 -0
  13. package/dist/src/components/term-element.d.ts.map +1 -0
  14. package/dist/src/components/term-element.js +8 -0
  15. package/dist/src/components/term-element.js.map +1 -0
  16. package/dist/src/decorators/ags-attribute.d.ts +2 -1
  17. package/dist/src/decorators/ags-attribute.d.ts.map +1 -1
  18. package/dist/src/decorators/ags-attribute.js +34 -1
  19. package/dist/src/decorators/ags-attribute.js.map +1 -1
  20. package/dist/src/decorators/global-operation.d.ts +9 -0
  21. package/dist/src/decorators/global-operation.d.ts.map +1 -0
  22. package/dist/src/decorators/global-operation.js +13 -0
  23. package/dist/src/decorators/global-operation.js.map +1 -0
  24. package/dist/src/decorators/graph-deprecated.d.ts +11 -0
  25. package/dist/src/decorators/graph-deprecated.d.ts.map +1 -0
  26. package/dist/src/decorators/graph-deprecated.js +19 -0
  27. package/dist/src/decorators/graph-deprecated.js.map +1 -0
  28. package/dist/src/decorators/index.d.ts +4 -0
  29. package/dist/src/decorators/index.d.ts.map +1 -1
  30. package/dist/src/decorators/index.js +4 -0
  31. package/dist/src/decorators/index.js.map +1 -1
  32. package/dist/src/decorators/is-owner.js +1 -1
  33. package/dist/src/decorators/ownerless.d.ts +8 -0
  34. package/dist/src/decorators/ownerless.d.ts.map +1 -0
  35. package/dist/src/decorators/ownerless.js +12 -0
  36. package/dist/src/decorators/ownerless.js.map +1 -0
  37. package/dist/src/decorators/public-namespace.d.ts.map +1 -1
  38. package/dist/src/decorators/public-namespace.js +4 -1
  39. package/dist/src/decorators/public-namespace.js.map +1 -1
  40. package/dist/src/decorators/term.d.ts +13 -0
  41. package/dist/src/decorators/term.d.ts.map +1 -0
  42. package/dist/src/decorators/term.js +14 -0
  43. package/dist/src/decorators/term.js.map +1 -0
  44. package/dist/src/entities/annotations.d.ts +4 -0
  45. package/dist/src/entities/annotations.d.ts.map +1 -1
  46. package/dist/src/entities/annotations.js +15 -0
  47. package/dist/src/entities/annotations.js.map +1 -1
  48. package/dist/src/entities/enum.js.map +1 -1
  49. package/dist/src/entities/model.d.ts.map +1 -1
  50. package/dist/src/entities/model.js +53 -4
  51. package/dist/src/entities/model.js.map +1 -1
  52. package/dist/src/entities/namespace.d.ts +6 -1
  53. package/dist/src/entities/namespace.d.ts.map +1 -1
  54. package/dist/src/entities/namespace.js +82 -6
  55. package/dist/src/entities/namespace.js.map +1 -1
  56. package/dist/src/entities/operation.d.ts +4 -0
  57. package/dist/src/entities/operation.d.ts.map +1 -1
  58. package/dist/src/entities/operation.js +16 -7
  59. package/dist/src/entities/operation.js.map +1 -1
  60. package/dist/src/entities/revision-definition.d.ts +1 -0
  61. package/dist/src/entities/revision-definition.d.ts.map +1 -1
  62. package/dist/src/entities/revision-definition.js +3 -3
  63. package/dist/src/entities/revision-definition.js.map +1 -1
  64. package/dist/src/entities/term.d.ts +8 -0
  65. package/dist/src/entities/term.d.ts.map +1 -0
  66. package/dist/src/entities/term.js +14 -0
  67. package/dist/src/entities/term.js.map +1 -0
  68. package/dist/src/index.d.ts +1 -1
  69. package/dist/src/index.d.ts.map +1 -1
  70. package/dist/src/index.js +1 -1
  71. package/dist/src/index.js.map +1 -1
  72. package/dist/src/lib.d.ts +59 -146
  73. package/dist/src/lib.d.ts.map +1 -1
  74. package/dist/src/lib.js +19 -10
  75. package/dist/src/lib.js.map +1 -1
  76. package/dist/src/rules/allowed-values.d.ts +2 -1
  77. package/dist/src/rules/allowed-values.d.ts.map +1 -1
  78. package/dist/src/rules/allowed-values.js +7 -7
  79. package/dist/src/rules/allowed-values.js.map +1 -1
  80. package/dist/src/rules/alternate-key.d.ts +4 -3
  81. package/dist/src/rules/alternate-key.d.ts.map +1 -1
  82. package/dist/src/rules/alternate-key.js +23 -23
  83. package/dist/src/rules/alternate-key.js.map +1 -1
  84. package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts +2 -1
  85. package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts.map +1 -1
  86. package/dist/src/rules/collection-navigation-properties-not-nullable.js +9 -9
  87. package/dist/src/rules/collection-navigation-properties-not-nullable.js.map +1 -1
  88. package/dist/src/rules/computed.d.ts +2 -1
  89. package/dist/src/rules/computed.d.ts.map +1 -1
  90. package/dist/src/rules/computed.js +9 -8
  91. package/dist/src/rules/computed.js.map +1 -1
  92. package/dist/src/rules/contains.d.ts +2 -1
  93. package/dist/src/rules/contains.d.ts.map +1 -1
  94. package/dist/src/rules/contains.js +9 -8
  95. package/dist/src/rules/contains.js.map +1 -1
  96. package/dist/src/rules/count.d.ts +2 -1
  97. package/dist/src/rules/count.d.ts.map +1 -1
  98. package/dist/src/rules/count.js +9 -8
  99. package/dist/src/rules/count.js.map +1 -1
  100. package/dist/src/rules/disallowed-typespec-decorators.d.ts +2 -1
  101. package/dist/src/rules/disallowed-typespec-decorators.d.ts.map +1 -1
  102. package/dist/src/rules/disallowed-typespec-decorators.js +29 -25
  103. package/dist/src/rules/disallowed-typespec-decorators.js.map +1 -1
  104. package/dist/src/rules/entity.d.ts +5 -2
  105. package/dist/src/rules/entity.d.ts.map +1 -1
  106. package/dist/src/rules/entity.js +102 -19
  107. package/dist/src/rules/entity.js.map +1 -1
  108. package/dist/src/rules/enum.d.ts +3 -1
  109. package/dist/src/rules/enum.d.ts.map +1 -1
  110. package/dist/src/rules/enum.js +9 -6
  111. package/dist/src/rules/enum.js.map +1 -1
  112. package/dist/src/rules/expand.d.ts +3 -2
  113. package/dist/src/rules/expand.d.ts.map +1 -1
  114. package/dist/src/rules/expand.js +16 -16
  115. package/dist/src/rules/expand.js.map +1 -1
  116. package/dist/src/rules/extends-on-same-type.d.ts +2 -1
  117. package/dist/src/rules/extends-on-same-type.d.ts.map +1 -1
  118. package/dist/src/rules/extends-on-same-type.js +9 -8
  119. package/dist/src/rules/extends-on-same-type.js.map +1 -1
  120. package/dist/src/rules/filter.d.ts +4 -3
  121. package/dist/src/rules/filter.d.ts.map +1 -1
  122. package/dist/src/rules/filter.js +23 -23
  123. package/dist/src/rules/filter.js.map +1 -1
  124. package/dist/src/rules/function.d.ts +2 -1
  125. package/dist/src/rules/function.d.ts.map +1 -1
  126. package/dist/src/rules/function.js +9 -9
  127. package/dist/src/rules/function.js.map +1 -1
  128. package/dist/src/rules/global-operation.d.ts +4 -0
  129. package/dist/src/rules/global-operation.d.ts.map +1 -0
  130. package/dist/src/rules/global-operation.js +60 -0
  131. package/dist/src/rules/global-operation.js.map +1 -0
  132. package/dist/src/rules/graph-deprecated.d.ts +8 -0
  133. package/dist/src/rules/graph-deprecated.d.ts.map +1 -0
  134. package/dist/src/rules/graph-deprecated.js +152 -0
  135. package/dist/src/rules/graph-deprecated.js.map +1 -0
  136. package/dist/src/rules/graph-route.d.ts +4 -2
  137. package/dist/src/rules/graph-route.d.ts.map +1 -1
  138. package/dist/src/rules/graph-route.js +55 -15
  139. package/dist/src/rules/graph-route.js.map +1 -1
  140. package/dist/src/rules/has-stream.d.ts +2 -1
  141. package/dist/src/rules/has-stream.d.ts.map +1 -1
  142. package/dist/src/rules/has-stream.js +9 -8
  143. package/dist/src/rules/has-stream.js.map +1 -1
  144. package/dist/src/rules/index.d.ts +3 -0
  145. package/dist/src/rules/index.d.ts.map +1 -1
  146. package/dist/src/rules/index.js +3 -0
  147. package/dist/src/rules/index.js.map +1 -1
  148. package/dist/src/rules/namespace.d.ts +4 -3
  149. package/dist/src/rules/namespace.d.ts.map +1 -1
  150. package/dist/src/rules/namespace.js +58 -73
  151. package/dist/src/rules/namespace.js.map +1 -1
  152. package/dist/src/rules/open.d.ts +2 -1
  153. package/dist/src/rules/open.d.ts.map +1 -1
  154. package/dist/src/rules/open.js +9 -8
  155. package/dist/src/rules/open.js.map +1 -1
  156. package/dist/src/rules/operation-inside-interface.d.ts +2 -1
  157. package/dist/src/rules/operation-inside-interface.d.ts.map +1 -1
  158. package/dist/src/rules/operation-inside-interface.js +9 -8
  159. package/dist/src/rules/operation-inside-interface.js.map +1 -1
  160. package/dist/src/rules/order-by.d.ts +3 -2
  161. package/dist/src/rules/order-by.d.ts.map +1 -1
  162. package/dist/src/rules/order-by.js +16 -16
  163. package/dist/src/rules/order-by.js.map +1 -1
  164. package/dist/src/rules/ownerless.d.ts +10 -0
  165. package/dist/src/rules/ownerless.d.ts.map +1 -0
  166. package/dist/src/rules/ownerless.js +155 -0
  167. package/dist/src/rules/ownerless.js.map +1 -0
  168. package/dist/src/rules/partial.d.ts +2 -1
  169. package/dist/src/rules/partial.d.ts.map +1 -1
  170. package/dist/src/rules/partial.js +9 -8
  171. package/dist/src/rules/partial.js.map +1 -1
  172. package/dist/src/rules/references.d.ts +2 -1
  173. package/dist/src/rules/references.d.ts.map +1 -1
  174. package/dist/src/rules/references.js +9 -8
  175. package/dist/src/rules/references.js.map +1 -1
  176. package/dist/src/rules/required-for-create.d.ts +2 -1
  177. package/dist/src/rules/required-for-create.d.ts.map +1 -1
  178. package/dist/src/rules/required-for-create.js +9 -8
  179. package/dist/src/rules/required-for-create.js.map +1 -1
  180. package/dist/src/rules/search.d.ts +2 -1
  181. package/dist/src/rules/search.d.ts.map +1 -1
  182. package/dist/src/rules/search.js +9 -8
  183. package/dist/src/rules/search.js.map +1 -1
  184. package/dist/src/rules/skip.d.ts +2 -1
  185. package/dist/src/rules/skip.d.ts.map +1 -1
  186. package/dist/src/rules/skip.js +9 -8
  187. package/dist/src/rules/skip.js.map +1 -1
  188. package/dist/src/rules/top.d.ts +2 -1
  189. package/dist/src/rules/top.d.ts.map +1 -1
  190. package/dist/src/rules/top.js +9 -8
  191. package/dist/src/rules/top.js.map +1 -1
  192. package/dist/src/testing/index.d.ts +1 -0
  193. package/dist/src/testing/index.d.ts.map +1 -1
  194. package/dist/src/testing/index.js +21 -0
  195. package/dist/src/testing/index.js.map +1 -1
  196. package/dist/src/utils.d.ts +3 -0
  197. package/dist/src/utils.d.ts.map +1 -1
  198. package/dist/src/utils.js +19 -5
  199. package/dist/src/utils.js.map +1 -1
  200. package/dist/src/{linter.d.ts → validate.d.ts} +1 -1
  201. package/dist/src/validate.d.ts.map +1 -0
  202. package/dist/src/validate.js +51 -0
  203. package/dist/src/validate.js.map +1 -0
  204. package/lib/decorators.tsp +28 -0
  205. package/package.json +5 -7
  206. package/dist/src/linter.d.ts.map +0 -1
  207. package/dist/src/linter.js +0 -44
  208. package/dist/src/linter.js.map +0 -1
@@ -81,6 +81,13 @@ extern dec count(target: Operation);
81
81
  */
82
82
  extern dec deltaCollection(target: Model);
83
83
 
84
+ /**
85
+ * `@graphDeprecated` - mark an entity as graphDeprecated.
86
+ *
87
+ * `@graphDeprecated` can be applied to Model, ModelProperty, Enum, EnumMember, Operation, Namespace, Interface.
88
+ */
89
+ extern dec graphDeprecated(target: Model | ModelProperty | Enum | EnumMember | Operation | Namespace | Interface, name: valueof string);
90
+
84
91
  /**
85
92
  * `@deprecatedDefinition` - Allow us create a reusable deprecation definition.
86
93
  * `@deprecatedDefinition` - Applies only to namespaces.
@@ -141,6 +148,14 @@ extern dec flags(target: Enum);
141
148
  */
142
149
  extern dec function(target: Operation, name?: valueof string);
143
150
 
151
+ /**
152
+ * `@globalOperation` - mark an operation as a globalOperation
153
+ *
154
+ * `@globalOperation` can only be applied to operations.
155
+ */
156
+ extern dec globalOperation(target: Operation);
157
+
158
+
144
159
  /**
145
160
  * `@graphRoute` - mark an interface or operation with an HTTP route.
146
161
  *
@@ -165,6 +180,13 @@ extern dec hasStream(target: Model, ...mediaTypes: valueof string[]);
165
180
  */
166
181
  extern dec immutable(target: ModelProperty);
167
182
 
183
+ /**
184
+ * `@ownerless` - mark an interface as ownerless.
185
+ *
186
+ * `@ownerless` can only be applied to interfaces.
187
+ */
188
+ extern dec ownerless(target: Interface);
189
+
168
190
  /**
169
191
  * `@open` - mark a model type as open
170
192
  *
@@ -273,6 +295,12 @@ extern dec search(target: Operation);
273
295
  */
274
296
  extern dec skip(target: Operation);
275
297
 
298
+ /**
299
+ * `@term` - Applies to: namespaces.
300
+ * Indicates that a workload wishes to require or return instance annotations in their request / response packets at runtime.
301
+ */
302
+ extern dec term(target: Namespace, name: valueof string, type: Scalar, description: valueof string);
303
+
276
304
  /**
277
305
  * `@top` - Applies to: get operations that return collections.
278
306
  * Indicates that the get operation supports the OData $top query parameter.
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.13",
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.51.0",
57
+ "@typespec/http": "~0.51.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.51.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"}