@microsoft/typespec-msgraph 0.0.1-Preview.2 → 0.0.1-Preview.3

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/acceptable-media-types-annotation.d.ts +3 -4
  2. package/dist/src/components/acceptable-media-types-annotation.d.ts.map +1 -1
  3. package/dist/src/components/acceptable-media-types-annotation.js +2 -6
  4. package/dist/src/components/acceptable-media-types-annotation.js.map +1 -1
  5. package/dist/src/components/alternate-keys-annotation.d.ts +4 -4
  6. package/dist/src/components/alternate-keys-annotation.d.ts.map +1 -1
  7. package/dist/src/components/alternate-keys-annotation.js +5 -13
  8. package/dist/src/components/alternate-keys-annotation.js.map +1 -1
  9. package/dist/src/components/common-elements.d.ts +0 -71
  10. package/dist/src/components/common-elements.d.ts.map +1 -1
  11. package/dist/src/components/common-elements.js +10 -24
  12. package/dist/src/components/common-elements.js.map +1 -1
  13. package/dist/src/components/computed-annotation.d.ts +3 -4
  14. package/dist/src/components/computed-annotation.d.ts.map +1 -1
  15. package/dist/src/components/computed-annotation.js +4 -10
  16. package/dist/src/components/computed-annotation.js.map +1 -1
  17. package/dist/src/components/count-restrictions-annotation.d.ts +3 -4
  18. package/dist/src/components/count-restrictions-annotation.d.ts.map +1 -1
  19. package/dist/src/components/count-restrictions-annotation.js +2 -6
  20. package/dist/src/components/count-restrictions-annotation.js.map +1 -1
  21. package/dist/src/components/description-annotation.d.ts +3 -4
  22. package/dist/src/components/description-annotation.d.ts.map +1 -1
  23. package/dist/src/components/description-annotation.js +4 -11
  24. package/dist/src/components/description-annotation.js.map +1 -1
  25. package/dist/src/components/entity-container-element.d.ts +6 -0
  26. package/dist/src/components/entity-container-element.d.ts.map +1 -0
  27. package/dist/src/components/entity-container-element.js +58 -0
  28. package/dist/src/components/entity-container-element.js.map +1 -0
  29. package/dist/src/components/enum-type-element.d.ts +6 -0
  30. package/dist/src/components/enum-type-element.d.ts.map +1 -0
  31. package/dist/src/components/enum-type-element.js +17 -0
  32. package/dist/src/components/enum-type-element.js.map +1 -0
  33. package/dist/src/components/expand-restrictions-annotation.d.ts +4 -5
  34. package/dist/src/components/expand-restrictions-annotation.d.ts.map +1 -1
  35. package/dist/src/components/expand-restrictions-annotation.js +5 -20
  36. package/dist/src/components/expand-restrictions-annotation.js.map +1 -1
  37. package/dist/src/components/index.d.ts +2 -14
  38. package/dist/src/components/index.d.ts.map +1 -1
  39. package/dist/src/components/index.js +9 -14
  40. package/dist/src/components/index.js.map +1 -1
  41. package/dist/src/components/operation-element.d.ts +6 -0
  42. package/dist/src/components/operation-element.d.ts.map +1 -0
  43. package/dist/src/components/operation-element.js +70 -0
  44. package/dist/src/components/operation-element.js.map +1 -0
  45. package/dist/src/components/permissions-annotation.d.ts +3 -4
  46. package/dist/src/components/permissions-annotation.d.ts.map +1 -1
  47. package/dist/src/components/permissions-annotation.js +2 -10
  48. package/dist/src/components/permissions-annotation.js.map +1 -1
  49. package/dist/src/components/property-element.d.ts +4 -4
  50. package/dist/src/components/property-element.d.ts.map +1 -1
  51. package/dist/src/components/property-element.js +14 -32
  52. package/dist/src/components/property-element.js.map +1 -1
  53. package/dist/src/components/revisions-annotation.d.ts +4 -5
  54. package/dist/src/components/revisions-annotation.d.ts.map +1 -1
  55. package/dist/src/components/revisions-annotation.js +7 -51
  56. package/dist/src/components/revisions-annotation.js.map +1 -1
  57. package/dist/src/components/schema-element.d.ts +6 -0
  58. package/dist/src/components/schema-element.d.ts.map +1 -0
  59. package/dist/src/components/schema-element.js +38 -0
  60. package/dist/src/components/schema-element.js.map +1 -0
  61. package/dist/src/components/search-restrictions-annotation.d.ts +3 -4
  62. package/dist/src/components/search-restrictions-annotation.d.ts.map +1 -1
  63. package/dist/src/components/search-restrictions-annotation.js +2 -6
  64. package/dist/src/components/search-restrictions-annotation.js.map +1 -1
  65. package/dist/src/components/skip-supported-annotation.d.ts +3 -4
  66. package/dist/src/components/skip-supported-annotation.d.ts.map +1 -1
  67. package/dist/src/components/skip-supported-annotation.js +2 -6
  68. package/dist/src/components/skip-supported-annotation.js.map +1 -1
  69. package/dist/src/components/sort-restrictions-annotation.d.ts +4 -5
  70. package/dist/src/components/sort-restrictions-annotation.d.ts.map +1 -1
  71. package/dist/src/components/sort-restrictions-annotation.js +5 -20
  72. package/dist/src/components/sort-restrictions-annotation.js.map +1 -1
  73. package/dist/src/components/structured-type-element.d.ts +10 -4
  74. package/dist/src/components/structured-type-element.d.ts.map +1 -1
  75. package/dist/src/components/structured-type-element.js +18 -58
  76. package/dist/src/components/structured-type-element.js.map +1 -1
  77. package/dist/src/components/top-supported-annotation.d.ts +3 -4
  78. package/dist/src/components/top-supported-annotation.d.ts.map +1 -1
  79. package/dist/src/components/top-supported-annotation.js +2 -6
  80. package/dist/src/components/top-supported-annotation.js.map +1 -1
  81. package/dist/src/decorators/abstract.d.ts.map +1 -1
  82. package/dist/src/decorators/abstract.js +0 -6
  83. package/dist/src/decorators/abstract.js.map +1 -1
  84. package/dist/src/decorators/complex.d.ts.map +1 -1
  85. package/dist/src/decorators/complex.js +0 -6
  86. package/dist/src/decorators/complex.js.map +1 -1
  87. package/dist/src/decorators/decorator-parameter.d.ts +4 -0
  88. package/dist/src/decorators/decorator-parameter.d.ts.map +1 -0
  89. package/dist/src/decorators/decorator-parameter.js +2 -0
  90. package/dist/src/decorators/decorator-parameter.js.map +1 -0
  91. package/dist/src/decorators/deprecated-definition.d.ts +4 -3
  92. package/dist/src/decorators/deprecated-definition.d.ts.map +1 -1
  93. package/dist/src/decorators/deprecated-definition.js +7 -1
  94. package/dist/src/decorators/deprecated-definition.js.map +1 -1
  95. package/dist/src/decorators/entity.d.ts.map +1 -1
  96. package/dist/src/decorators/entity.js +0 -6
  97. package/dist/src/decorators/entity.js.map +1 -1
  98. package/dist/src/decorators/expand.d.ts +2 -1
  99. package/dist/src/decorators/expand.d.ts.map +1 -1
  100. package/dist/src/decorators/expand.js +1 -1
  101. package/dist/src/decorators/expand.js.map +1 -1
  102. package/dist/src/decorators/function.d.ts +11 -0
  103. package/dist/src/decorators/function.d.ts.map +1 -0
  104. package/dist/src/decorators/function.js +16 -0
  105. package/dist/src/decorators/function.js.map +1 -0
  106. package/dist/src/decorators/handlers/custom/additional-query-parameters.d.ts +2 -1
  107. package/dist/src/decorators/handlers/custom/additional-query-parameters.d.ts.map +1 -1
  108. package/dist/src/decorators/handlers/custom/additional-query-parameters.js +3 -1
  109. package/dist/src/decorators/handlers/custom/additional-query-parameters.js.map +1 -1
  110. package/dist/src/decorators/handlers/custom/ags-attribute.d.ts +2 -1
  111. package/dist/src/decorators/handlers/custom/ags-attribute.d.ts.map +1 -1
  112. package/dist/src/decorators/handlers/custom/ags-attribute.js +3 -3
  113. package/dist/src/decorators/handlers/custom/ags-attribute.js.map +1 -1
  114. package/dist/src/decorators/handlers/index.d.ts +4 -3
  115. package/dist/src/decorators/handlers/index.d.ts.map +1 -1
  116. package/dist/src/decorators/handlers/index.js +4 -4
  117. package/dist/src/decorators/handlers/index.js.map +1 -1
  118. package/dist/src/decorators/has-stream.d.ts +3 -3
  119. package/dist/src/decorators/has-stream.d.ts.map +1 -1
  120. package/dist/src/decorators/has-stream.js +2 -15
  121. package/dist/src/decorators/has-stream.js.map +1 -1
  122. package/dist/src/decorators/index.d.ts +5 -1
  123. package/dist/src/decorators/index.d.ts.map +1 -1
  124. package/dist/src/decorators/index.js +5 -1
  125. package/dist/src/decorators/index.js.map +1 -1
  126. package/dist/src/decorators/open.d.ts.map +1 -1
  127. package/dist/src/decorators/open.js +0 -6
  128. package/dist/src/decorators/open.js.map +1 -1
  129. package/dist/src/decorators/{routed-interfaces.d.ts → operation-parameters.d.ts} +3 -11
  130. package/dist/src/decorators/operation-parameters.d.ts.map +1 -0
  131. package/dist/src/decorators/operation-parameters.js +15 -0
  132. package/dist/src/decorators/operation-parameters.js.map +1 -0
  133. package/dist/src/decorators/order-by.d.ts +2 -1
  134. package/dist/src/decorators/order-by.d.ts.map +1 -1
  135. package/dist/src/decorators/order-by.js +1 -1
  136. package/dist/src/decorators/order-by.js.map +1 -1
  137. package/dist/src/decorators/private-preview-definition.d.ts +4 -3
  138. package/dist/src/decorators/private-preview-definition.d.ts.map +1 -1
  139. package/dist/src/decorators/private-preview-definition.js +6 -1
  140. package/dist/src/decorators/private-preview-definition.js.map +1 -1
  141. package/dist/src/decorators/private-preview.d.ts +2 -1
  142. package/dist/src/decorators/private-preview.d.ts.map +1 -1
  143. package/dist/src/decorators/private-preview.js +1 -11
  144. package/dist/src/decorators/private-preview.js.map +1 -1
  145. package/dist/src/emitter.d.ts.map +1 -1
  146. package/dist/src/emitter.js +4 -2
  147. package/dist/src/emitter.js.map +1 -1
  148. package/dist/src/entities/entity-container.d.ts +35 -0
  149. package/dist/src/entities/entity-container.d.ts.map +1 -0
  150. package/dist/src/entities/entity-container.js +132 -0
  151. package/dist/src/entities/entity-container.js.map +1 -0
  152. package/dist/src/entities/enum.d.ts +16 -0
  153. package/dist/src/entities/enum.d.ts.map +1 -0
  154. package/dist/src/entities/enum.js +22 -0
  155. package/dist/src/entities/enum.js.map +1 -0
  156. package/dist/src/entities/model.d.ts +50 -0
  157. package/dist/src/entities/model.d.ts.map +1 -0
  158. package/dist/src/entities/model.js +119 -0
  159. package/dist/src/entities/model.js.map +1 -0
  160. package/dist/src/entities/namespace.d.ts +14 -0
  161. package/dist/src/entities/namespace.d.ts.map +1 -0
  162. package/dist/src/entities/namespace.js +41 -0
  163. package/dist/src/entities/namespace.js.map +1 -0
  164. package/dist/src/entities/operation.d.ts +28 -0
  165. package/dist/src/entities/operation.d.ts.map +1 -0
  166. package/dist/src/entities/operation.js +88 -0
  167. package/dist/src/entities/operation.js.map +1 -0
  168. package/dist/src/entities/property.d.ts +3 -0
  169. package/dist/src/entities/property.d.ts.map +1 -0
  170. package/dist/src/entities/property.js +54 -0
  171. package/dist/src/entities/property.js.map +1 -0
  172. package/dist/src/entities/revision-definition.d.ts +9 -0
  173. package/dist/src/entities/revision-definition.d.ts.map +1 -0
  174. package/dist/src/entities/revision-definition.js +42 -0
  175. package/dist/src/entities/revision-definition.js.map +1 -0
  176. package/dist/src/index.d.ts +0 -3
  177. package/dist/src/index.d.ts.map +1 -1
  178. package/dist/src/index.js +0 -3
  179. package/dist/src/index.js.map +1 -1
  180. package/dist/src/rules/entity.d.ts +1 -0
  181. package/dist/src/rules/entity.d.ts.map +1 -1
  182. package/dist/src/rules/entity.js +36 -0
  183. package/dist/src/rules/entity.js.map +1 -1
  184. package/dist/src/rules/enum.d.ts +2 -0
  185. package/dist/src/rules/enum.d.ts.map +1 -0
  186. package/dist/src/rules/enum.js +26 -0
  187. package/dist/src/rules/enum.js.map +1 -0
  188. package/dist/src/rules/function.d.ts +2 -0
  189. package/dist/src/rules/function.d.ts.map +1 -0
  190. package/dist/src/rules/function.js +26 -0
  191. package/dist/src/rules/function.js.map +1 -0
  192. package/dist/src/rules/index.d.ts +3 -4
  193. package/dist/src/rules/index.d.ts.map +1 -1
  194. package/dist/src/rules/index.js +40 -111
  195. package/dist/src/rules/index.js.map +1 -1
  196. package/lib/decorators.tsp +29 -22
  197. package/package.json +29 -13
  198. package/dist/src/components/program-context.d.ts +0 -4
  199. package/dist/src/components/program-context.d.ts.map +0 -1
  200. package/dist/src/components/program-context.js +0 -3
  201. package/dist/src/components/program-context.js.map +0 -1
  202. package/dist/src/csdl.d.ts +0 -8
  203. package/dist/src/csdl.d.ts.map +0 -1
  204. package/dist/src/csdl.js +0 -298
  205. package/dist/src/csdl.js.map +0 -1
  206. package/dist/src/decorators/routed-interfaces.d.ts.map +0 -1
  207. package/dist/src/decorators/routed-interfaces.js +0 -43
  208. package/dist/src/decorators/routed-interfaces.js.map +0 -1
@@ -0,0 +1,26 @@
1
+ import { createRule } from "@typespec/lint";
2
+ import { reportDiagnostic } from "../lib.js";
3
+ import { isExcludedCoreType } from "../utils.js";
4
+ export const useEvolvableEnumRule = createRule({
5
+ name: "use-evolvable-enum",
6
+ create({ program }) {
7
+ return {
8
+ enum: (enumType) => {
9
+ if (isExcludedCoreType(program, enumType)) {
10
+ return;
11
+ }
12
+ if (enumType.members.has("unknownFutureValue")) {
13
+ return;
14
+ }
15
+ reportDiagnostic(program, {
16
+ code: "use-evolvable-enum",
17
+ target: enumType,
18
+ format: {
19
+ enum: enumType.name,
20
+ },
21
+ });
22
+ },
23
+ };
24
+ },
25
+ });
26
+ //# sourceMappingURL=enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../src/rules/enum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC;IAC7C,IAAI,EAAE,oBAAoB;IAC1B,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,IAAI,EAAE,CAAC,QAAQ,EAAE,EAAE;gBACjB,IAAI,kBAAkB,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE;oBACzC,OAAO;iBACR;gBAED,IAAI,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,EAAE;oBAC9C,OAAO;iBACR;gBAED,gBAAgB,CAAC,OAAO,EAAE;oBACxB,IAAI,EAAE,oBAAoB;oBAC1B,MAAM,EAAE,QAAQ;oBAChB,MAAM,EAAE;wBACN,IAAI,EAAE,QAAQ,CAAC,IAAI;qBACpB;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const voidFunctionRule: import("@typespec/lint").LintRule;
2
+ //# sourceMappingURL=function.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"function.d.ts","sourceRoot":"","sources":["../../../src/rules/function.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,gBAAgB,mCAsB3B,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { isVoidType } from "@typespec/compiler";
2
+ import { createRule } from "@typespec/lint";
3
+ import { isFunction } from "../index.js";
4
+ import { reportDiagnostic } from "../lib.js";
5
+ export const voidFunctionRule = createRule({
6
+ name: "void-function",
7
+ create({ program }) {
8
+ return {
9
+ operation: (operation) => {
10
+ if (!isFunction(program, operation)) {
11
+ return;
12
+ }
13
+ if (!isVoidType(operation.returnType)) {
14
+ return;
15
+ }
16
+ reportDiagnostic(program, {
17
+ code: "decorator-missing-dependencies",
18
+ target: operation,
19
+ messageId: "function",
20
+ format: {},
21
+ });
22
+ },
23
+ };
24
+ },
25
+ });
26
+ //# sourceMappingURL=function.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"function.js","sourceRoot":"","sources":["../../../src/rules/function.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,MAAM,CAAC,MAAM,gBAAgB,GAAG,UAAU,CAAC;IACzC,IAAI,EAAE,eAAe;IACrB,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE;gBACvB,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE;oBACnC,OAAO;iBACR;gBAED,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,EAAE;oBACrC,OAAO;iBACR;gBAED,gBAAgB,CAAC,OAAO,EAAE;oBACxB,IAAI,EAAE,gCAAgC;oBACtC,MAAM,EAAE,SAAS;oBACjB,SAAS,EAAE,UAAU;oBACrB,MAAM,EAAE,EAAE;iBACX,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -4,7 +4,9 @@ export * from "./computed.js";
4
4
  export * from "./contains.js";
5
5
  export * from "./count.js";
6
6
  export * from "./entity.js";
7
+ export * from "./enum.js";
7
8
  export * from "./expand.js";
9
+ export * from "./function.js";
8
10
  export * from "./has-stream.js";
9
11
  export * from "./open.js";
10
12
  export * from "./order-by.js";
@@ -12,10 +14,7 @@ export * from "./references.js";
12
14
  export * from "./search.js";
13
15
  export * from "./skip.js";
14
16
  export * from "./top.js";
17
+ export declare const disallowedTypeSpecDecoratorsRule: import("@typespec/lint").LintRule;
15
18
  export declare const extendsOnSameTypeRule: import("@typespec/lint").LintRule;
16
- export declare const keyOnlyOnEntityNonNullablePrimitivePropertyRule: import("@typespec/lint").LintRule;
17
19
  export declare const operationInsideInterfaceRule: import("@typespec/lint").LintRule;
18
- export declare const voidFunctionRule: import("@typespec/lint").LintRule;
19
- export declare const disallowedTypeSpecDecoratorsRule: import("@typespec/lint").LintRule;
20
- export declare const useEvolvableEnumRule: import("@typespec/lint").LintRule;
21
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rules/index.ts"],"names":[],"mappings":"AAMA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AAEzB,eAAO,MAAM,qBAAqB,mCA+BhC,CAAC;AAEH,eAAO,MAAM,+CAA+C,mCAwC1D,CAAC;AAEH,eAAO,MAAM,4BAA4B,mCAkBvC,CAAC;AAEH,eAAO,MAAM,gBAAgB,mCAsB3B,CAAC;AAEH,eAAO,MAAM,gCAAgC,mCA+B3C,CAAC;AAEH,eAAO,MAAM,oBAAoB,mCAuB/B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rules/index.ts"],"names":[],"mappings":"AAKA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AAEzB,eAAO,MAAM,gCAAgC,mCA+B3C,CAAC;AAEH,eAAO,MAAM,qBAAqB,mCAmChC,CAAC;AAEH,eAAO,MAAM,4BAA4B,mCAsBvC,CAAC"}
@@ -1,15 +1,16 @@
1
- import { isKey, isVoidType } from "@typespec/compiler";
2
1
  import { createRule } from "@typespec/lint";
3
- import { isComplex, isEntity, isFunction } from "../decorators/index.js";
2
+ import { isComplex, isEntity } from "../index.js";
4
3
  import { reportDiagnostic } from "../lib.js";
5
- import { isExcludedCoreType, isTypeNullable } from "../utils.js";
4
+ import { isExcludedCoreType } from "../utils.js";
6
5
  export * from "./abstract.js";
7
6
  export * from "./alternate-key.js";
8
7
  export * from "./computed.js";
9
8
  export * from "./contains.js";
10
9
  export * from "./count.js";
11
10
  export * from "./entity.js";
11
+ export * from "./enum.js";
12
12
  export * from "./expand.js";
13
+ export * from "./function.js";
13
14
  export * from "./has-stream.js";
14
15
  export * from "./open.js";
15
16
  export * from "./order-by.js";
@@ -17,6 +18,36 @@ export * from "./references.js";
17
18
  export * from "./search.js";
18
19
  export * from "./skip.js";
19
20
  export * from "./top.js";
21
+ export const disallowedTypeSpecDecoratorsRule = createRule({
22
+ name: "disallowed-typespec-decorators",
23
+ create({ program }) {
24
+ return {
25
+ decorator: (decorator) => {
26
+ const denyList = [
27
+ "@friendlyName",
28
+ "@secret",
29
+ "@summary",
30
+ "@tag",
31
+ "@visibility",
32
+ "@withVisibility",
33
+ "@withUpdateableProperties",
34
+ "@withDefaultKeyVisibility",
35
+ ];
36
+ if (denyList.indexOf(decorator.name) < 0) {
37
+ return;
38
+ }
39
+ reportDiagnostic(program, {
40
+ code: "decorator-invalid-use",
41
+ target: decorator.target,
42
+ messageId: "disallowedTypeSpecDecorators",
43
+ format: {
44
+ decorator: decorator.name,
45
+ },
46
+ });
47
+ },
48
+ };
49
+ },
50
+ });
20
51
  export const extendsOnSameTypeRule = createRule({
21
52
  name: "extends-on-same-type",
22
53
  create({ program }) {
@@ -25,6 +56,9 @@ export const extendsOnSameTypeRule = createRule({
25
56
  if (!model.baseModel) {
26
57
  return;
27
58
  }
59
+ if (isExcludedCoreType(program, model)) {
60
+ return;
61
+ }
28
62
  if (isEntity(program, model) && !isEntity(program, model.baseModel)) {
29
63
  reportDiagnostic(program, {
30
64
  code: "extends-invalid-use",
@@ -47,41 +81,6 @@ export const extendsOnSameTypeRule = createRule({
47
81
  };
48
82
  },
49
83
  });
50
- export const keyOnlyOnEntityNonNullablePrimitivePropertyRule = createRule({
51
- name: "key-only-on-entity-non-nullable-primitive-property",
52
- create({ program }) {
53
- return {
54
- modelProperty: (property) => {
55
- if (!property.model || !isKey(program, property)) {
56
- return;
57
- }
58
- if (!isEntity(program, property.model)) {
59
- reportDiagnostic(program, {
60
- code: "decorator-missing-dependencies",
61
- target: property,
62
- format: {
63
- decorator: "@key",
64
- required: "@entity",
65
- location: "entity model",
66
- },
67
- });
68
- return;
69
- }
70
- if (isTypeNullable(program, property.type) ||
71
- property.type.kind !== "Scalar" ||
72
- property.name === "Array") {
73
- reportDiagnostic(program, {
74
- code: "decorator-invalid-use",
75
- target: property,
76
- messageId: "key",
77
- format: {},
78
- });
79
- return;
80
- }
81
- },
82
- };
83
- },
84
- });
85
84
  export const operationInsideInterfaceRule = createRule({
86
85
  name: "operation-inside-interface",
87
86
  create({ program }) {
@@ -90,87 +89,17 @@ export const operationInsideInterfaceRule = createRule({
90
89
  if (operation.interface) {
91
90
  return;
92
91
  }
93
- reportDiagnostic(program, {
94
- code: "element-missing-dependencies",
95
- target: operation,
96
- messageId: "operation",
97
- format: {},
98
- });
99
- },
100
- };
101
- },
102
- });
103
- export const voidFunctionRule = createRule({
104
- name: "void-function",
105
- create({ program }) {
106
- return {
107
- operation: (operation) => {
108
- if (!isFunction(program, operation)) {
109
- return;
110
- }
111
- if (!isVoidType(operation.returnType)) {
92
+ if (isExcludedCoreType(program, operation)) {
112
93
  return;
113
94
  }
114
95
  reportDiagnostic(program, {
115
- code: "decorator-missing-dependencies",
96
+ code: "element-missing-dependencies",
116
97
  target: operation,
117
- messageId: "function",
98
+ messageId: "operation",
118
99
  format: {},
119
100
  });
120
101
  },
121
102
  };
122
103
  },
123
104
  });
124
- export const disallowedTypeSpecDecoratorsRule = createRule({
125
- name: "disallowed-typespec-decorators",
126
- create({ program }) {
127
- return {
128
- decorator: (decorator) => {
129
- const denyList = [
130
- "@friendlyName",
131
- "@secret",
132
- "@summary",
133
- "@tag",
134
- "@visibility",
135
- "@withVisibility",
136
- "@withUpdateableProperties",
137
- "@withDefaultKeyVisibility",
138
- ];
139
- if (denyList.indexOf(decorator.name) < 0) {
140
- return;
141
- }
142
- reportDiagnostic(program, {
143
- code: "decorator-invalid-use",
144
- target: decorator.target,
145
- messageId: "disallowedTypeSpecDecorators",
146
- format: {
147
- decorator: decorator.name,
148
- },
149
- });
150
- },
151
- };
152
- },
153
- });
154
- export const useEvolvableEnumRule = createRule({
155
- name: "use-evolvable-enum",
156
- create({ program }) {
157
- return {
158
- enum: (enumType) => {
159
- if (isExcludedCoreType(program, enumType)) {
160
- return;
161
- }
162
- if (enumType.members.has("unknownFutureValue")) {
163
- return;
164
- }
165
- reportDiagnostic(program, {
166
- code: "use-evolvable-enum",
167
- target: enumType,
168
- format: {
169
- enum: enumType.name,
170
- },
171
- });
172
- },
173
- };
174
- },
175
- });
176
105
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEjE,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AAEzB,MAAM,CAAC,MAAM,qBAAqB,GAAG,UAAU,CAAC;IAC9C,IAAI,EAAE,sBAAsB;IAC5B,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,KAAK,EAAE,CAAC,KAAK,EAAE,EAAE;gBACf,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE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E,OAAO,EAAE;QAChB,OAAO;YACL,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE;gBACvB,IAAI,SAAS,CAAC,SAAS,EAAE;oBACvB,OAAO;iBACR;gBAED,IAAI,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE;oBAC1C,OAAO;iBACR;gBAED,gBAAgB,CAAC,OAAO,EAAE;oBACxB,IAAI,EAAE,8BAA8B;oBACpC,MAAM,EAAE,SAAS;oBACjB,SAAS,EAAE,WAAW;oBACtB,MAAM,EAAE,EAAE;iBACX,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -1,14 +1,11 @@
1
1
  using TypeSpec.Reflection;
2
2
 
3
3
  /**
4
- * TODO: Enable this once Model type is supported. https://github.com/microsoft/typespec/issues/1655
5
- *
6
4
  * `@abstract` - mark a model type as abstract
7
5
  *
8
6
  * `@abstract` can only be applied to models.
9
-
7
+ */
10
8
  extern dec abstract(target: Model);
11
- */
12
9
 
13
10
  /**
14
11
  * `@alternateKey` - mark a model property as an alternateKey
@@ -18,14 +15,11 @@ extern dec abstract(target: Model);
18
15
  extern dec alternateKey(target: ModelProperty);
19
16
 
20
17
  /**
21
- * TODO: Enable this once Model type is supported. https://github.com/microsoft/typespec/issues/1655
22
- *
23
18
  * `@complex` - mark a model as an entity type
24
19
  *
25
20
  * `@complex` can only be applied to models.
26
-
27
- extern dec complex(target: Model);
28
21
  */
22
+ extern dec complex(target: Model);
29
23
 
30
24
  /**
31
25
  * `@computed` - mark a model property as a computed property
@@ -62,14 +56,11 @@ extern dec deprecatedDefinition(
62
56
  );
63
57
 
64
58
  /**
65
- * TODO: Enable this once Model type is supported. https://github.com/microsoft/typespec/issues/1655
66
- *
67
59
  * `@entity` - mark a model as an entity type
68
60
  *
69
61
  * `@entity` can only be applied to models.
70
-
71
- extern dec entity(target: Model);
72
62
  */
63
+ extern dec entity(target: Model);
73
64
 
74
65
  /**
75
66
  * `@expand` - Applies to: get operations that return collections or individual instances of models that contain @contains or @references properties.
@@ -81,15 +72,34 @@ extern dec entity(target: Model);
81
72
  extern dec expand(target: Operation, property: string, ...otherProperties: string[]);
82
73
 
83
74
  /**
84
- * TODO: Enable this once Model type is supported. https://github.com/microsoft/typespec/issues/1655
75
+ * `@function` - mark an operation as a function
85
76
  *
77
+ * `@function` can only be applied to operations.
78
+ */
79
+ extern dec function(target: Operation, name?: string);
80
+
81
+ /**
86
82
  * `@hasStream` - indicates that an `@entity` model has a stream.
87
83
  *
88
- * `mediaTypes` - list of media types supported by the stream.
89
- * If not specified, the stream supports any media type.
90
-
91
- extern dec hasStream(target: Model, ...mediaTypes: string[]);
84
+ * `mediaTypes` - list of media types supported by the stream. If not specified, the stream supports any media type.
92
85
  */
86
+ extern dec hasStream(target: Model, ...mediaTypes: string[]);
87
+
88
+ /**
89
+ * `@open` - mark a model type as open
90
+ *
91
+ * `@open` can only be applied to models.
92
+ */
93
+ extern dec open(target: Model);
94
+
95
+ /**
96
+ * `@operationParameters` - A model with this decorator will not be generated in the CSDL
97
+ * and can't be reused by other models through inheritance,
98
+ * or any other way except through being a parameter for an action operation.
99
+ * The purpose of this model is only to define model parameters that would be too verbose.
100
+ * This decorator will be the equivalent of inlining the properties of the model into parameters of the operation.
101
+ */
102
+ extern dec operationParameters(target: Model);
93
103
 
94
104
  /**
95
105
  * `@orderBy` - Applies to: get operations that return collections of @entity or @complex models.
@@ -101,16 +111,13 @@ extern dec expand(target: Operation, property: string, ...otherProperties: strin
101
111
  extern dec orderBy(target: Operation, property: string, ...otherProperties: string[]);
102
112
 
103
113
  /**
104
- * TODO: Enable this once Model type is supported. https://github.com/microsoft/typespec/issues/1655
105
- *
106
114
  * `@privatePreview` - Allow us define a privatePreview element.
107
115
  * `@privatePreview` - Applies to models, model properties, enums, enum members, namespaces and operations.
108
-
116
+ */
109
117
  extern dec privatePreview(
110
118
  target: Model | ModelProperty | EnumMember | Enum | Operation | Namespace,
111
119
  name: string
112
- )
113
- */
120
+ );
114
121
 
115
122
  /**
116
123
  * `@privatePreviewDefinition` - Allow us create a reusable private preview definition.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/typespec-msgraph",
3
- "version": "0.0.1-Preview.2",
3
+ "version": "0.0.1-Preview.3",
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",
@@ -10,8 +10,12 @@
10
10
  "type": "git",
11
11
  "url": "git+https://github.com/microsoftgraph/typespec-msgraph.git"
12
12
  },
13
- "bugs": { "url": "https://github.com/microsoftgraph/typespec-msgraph/issues" },
14
- "keywords": ["typespec"],
13
+ "bugs": {
14
+ "url": "https://github.com/microsoftgraph/typespec-msgraph/issues"
15
+ },
16
+ "keywords": [
17
+ "typespec"
18
+ ],
15
19
  "type": "module",
16
20
  "main": "dist/src/index.js",
17
21
  "tspMain": "lib/msgraph.tsp",
@@ -21,11 +25,17 @@
21
25
  },
22
26
  "typesVersions": {
23
27
  "*": {
24
- "*": ["./dist/src/index.d.ts"],
25
- "testing": ["./dist/src/testing/index.d.ts"]
28
+ "*": [
29
+ "./dist/src/index.d.ts"
30
+ ],
31
+ "testing": [
32
+ "./dist/src/testing/index.d.ts"
33
+ ]
26
34
  }
27
35
  },
28
- "engines": { "node": ">=14.0.0" },
36
+ "engines": {
37
+ "node": ">=14.0.0"
38
+ },
29
39
  "scripts": {
30
40
  "clean": "rimraf ./dist ./temp",
31
41
  "prebuild": "tsx src/decorators/attribute-builder.ts",
@@ -37,8 +47,14 @@
37
47
  "lint": "eslint . --ext .ts,.tsx --max-warnings=0",
38
48
  "lint:fix": "eslint . --fix --ext .ts,.tsx"
39
49
  },
40
- "files": ["lib/*.tsp", "dist/**", "!dist/test/**"],
41
- "peerDependencies": { "@typespec/compiler": "~0.43.0" },
50
+ "files": [
51
+ "lib/*.tsp",
52
+ "dist/**",
53
+ "!dist/test/**"
54
+ ],
55
+ "peerDependencies": {
56
+ "@typespec/compiler": "~0.45.0"
57
+ },
42
58
  "dependencies": {
43
59
  "prettier": "~2.8.7",
44
60
  "react-dom": "~18.2.0",
@@ -51,11 +67,11 @@
51
67
  "@types/prettier": "2.6.0",
52
68
  "@types/react": "~18.0.5",
53
69
  "@types/react-reconciler": "~0.28.0",
54
- "@typespec/compiler": "~0.43.0",
55
- "@typespec/eslint-config-typespec": "~0.6.0",
56
- "@typespec/http": "~0.43.1",
57
- "@typespec/lint": "~0.43.0",
58
- "@typespec/rest": "~0.43.0",
70
+ "@typespec/compiler": "~0.45.0",
71
+ "@typespec/eslint-config-typespec": "~0.7.0",
72
+ "@typespec/http": "~0.45.0",
73
+ "@typespec/lint": "~0.45.0",
74
+ "@typespec/rest": "~0.45.0",
59
75
  "@xmldom/xmldom": "~0.8.2",
60
76
  "c8": "~7.13.0",
61
77
  "eslint": "^8.36.0",
@@ -1,4 +0,0 @@
1
- import { Program } from "@typespec/compiler";
2
- import React from "react";
3
- export declare const ProgramContext: React.Context<Program>;
4
- //# sourceMappingURL=program-context.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"program-context.d.ts","sourceRoot":"","sources":["../../../src/components/program-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,eAAO,MAAM,cAAc,wBAA0C,CAAC"}
@@ -1,3 +0,0 @@
1
- import React from "react";
2
- export const ProgramContext = React.createContext({});
3
- //# sourceMappingURL=program-context.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"program-context.js","sourceRoot":"","sources":["../../../src/components/program-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,MAAM,cAAc,GAAG,KAAK,CAAC,aAAa,CAAU,EAAS,CAAC,CAAC"}
@@ -1,8 +0,0 @@
1
- import { Program } from "@typespec/compiler";
2
- import { FunctionComponent } from "react";
3
- export declare function renderCsdl(program: Program): string;
4
- export interface TypeSpecProgramViewerProps {
5
- program: Program;
6
- }
7
- export declare const TypeSpecProgramViewer: FunctionComponent<TypeSpecProgramViewerProps>;
8
- //# sourceMappingURL=csdl.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"csdl.d.ts","sourceRoot":"","sources":["../../src/csdl.tsx"],"names":[],"mappings":"AAAA,OAAO,EASL,OAAO,EAER,MAAM,oBAAoB,CAAC;AAK5B,OAAc,EAAE,iBAAiB,EAAc,MAAM,OAAO,CAAC;AA6C7D,wBAAgB,UAAU,CAAC,OAAO,EAAE,OAAO,UAK1C;AAED,MAAM,WAAW,0BAA0B;IACzC,OAAO,EAAE,OAAO,CAAC;CAClB;AAWD,eAAO,MAAM,qBAAqB,EAAE,iBAAiB,CAAC,0BAA0B,CAkB/E,CAAC"}