@microsoft/typespec-msgraph 0.0.1-Preview.6 → 0.0.1-Preview.8

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 (148) hide show
  1. package/dist/src/components/annotations.d.ts +5 -5
  2. package/dist/src/components/annotations.d.ts.map +1 -1
  3. package/dist/src/components/annotations.js +21 -20
  4. package/dist/src/components/annotations.js.map +1 -1
  5. package/dist/src/components/count-restrictions-annotation.d.ts +1 -1
  6. package/dist/src/components/count-restrictions-annotation.d.ts.map +1 -1
  7. package/dist/src/components/count-restrictions-annotation.js +2 -2
  8. package/dist/src/components/count-restrictions-annotation.js.map +1 -1
  9. package/dist/src/components/expand-restrictions-annotation.d.ts +1 -1
  10. package/dist/src/components/expand-restrictions-annotation.d.ts.map +1 -1
  11. package/dist/src/components/expand-restrictions-annotation.js +3 -3
  12. package/dist/src/components/expand-restrictions-annotation.js.map +1 -1
  13. package/dist/src/components/filter-restrictions-annotation.d.ts +6 -0
  14. package/dist/src/components/filter-restrictions-annotation.d.ts.map +1 -0
  15. package/dist/src/components/filter-restrictions-annotation.js +10 -0
  16. package/dist/src/components/filter-restrictions-annotation.js.map +1 -0
  17. package/dist/src/components/immutable-annotation.d.ts +5 -0
  18. package/dist/src/components/immutable-annotation.d.ts.map +1 -0
  19. package/dist/src/components/immutable-annotation.js +6 -0
  20. package/dist/src/components/immutable-annotation.js.map +1 -0
  21. package/dist/src/components/insert-restrictions-annotation.d.ts +6 -0
  22. package/dist/src/components/insert-restrictions-annotation.d.ts.map +1 -0
  23. package/dist/src/components/insert-restrictions-annotation.js +10 -0
  24. package/dist/src/components/insert-restrictions-annotation.js.map +1 -0
  25. package/dist/src/components/property-element.d.ts.map +1 -1
  26. package/dist/src/components/property-element.js +4 -2
  27. package/dist/src/components/property-element.js.map +1 -1
  28. package/dist/src/components/schema-element.d.ts.map +1 -1
  29. package/dist/src/components/schema-element.js +6 -6
  30. package/dist/src/components/schema-element.js.map +1 -1
  31. package/dist/src/components/search-restrictions-annotation.d.ts +1 -1
  32. package/dist/src/components/search-restrictions-annotation.d.ts.map +1 -1
  33. package/dist/src/components/search-restrictions-annotation.js +2 -2
  34. package/dist/src/components/search-restrictions-annotation.js.map +1 -1
  35. package/dist/src/components/skip-supported-annotation.d.ts +1 -1
  36. package/dist/src/components/skip-supported-annotation.d.ts.map +1 -1
  37. package/dist/src/components/skip-supported-annotation.js +1 -1
  38. package/dist/src/components/skip-supported-annotation.js.map +1 -1
  39. package/dist/src/components/sort-restrictions-annotation.d.ts +1 -1
  40. package/dist/src/components/sort-restrictions-annotation.d.ts.map +1 -1
  41. package/dist/src/components/sort-restrictions-annotation.js +3 -3
  42. package/dist/src/components/sort-restrictions-annotation.js.map +1 -1
  43. package/dist/src/components/top-supported-annotation.d.ts +1 -1
  44. package/dist/src/components/top-supported-annotation.d.ts.map +1 -1
  45. package/dist/src/components/top-supported-annotation.js +2 -2
  46. package/dist/src/components/top-supported-annotation.js.map +1 -1
  47. package/dist/src/decorators/action.d.ts +10 -0
  48. package/dist/src/decorators/action.d.ts.map +1 -0
  49. package/dist/src/decorators/action.js +16 -0
  50. package/dist/src/decorators/action.js.map +1 -0
  51. package/dist/src/decorators/filter.d.ts +11 -0
  52. package/dist/src/decorators/filter.d.ts.map +1 -0
  53. package/dist/src/decorators/filter.js +27 -0
  54. package/dist/src/decorators/filter.js.map +1 -0
  55. package/dist/src/decorators/graph-route.d.ts +1 -1
  56. package/dist/src/decorators/graph-route.d.ts.map +1 -1
  57. package/dist/src/decorators/graph-route.js +12 -7
  58. package/dist/src/decorators/graph-route.js.map +1 -1
  59. package/dist/src/decorators/immutable.d.ts +8 -0
  60. package/dist/src/decorators/immutable.d.ts.map +1 -0
  61. package/dist/src/decorators/immutable.js +12 -0
  62. package/dist/src/decorators/immutable.js.map +1 -0
  63. package/dist/src/decorators/index.d.ts +4 -0
  64. package/dist/src/decorators/index.d.ts.map +1 -1
  65. package/dist/src/decorators/index.js +4 -0
  66. package/dist/src/decorators/index.js.map +1 -1
  67. package/dist/src/decorators/required-for-create.d.ts +10 -0
  68. package/dist/src/decorators/required-for-create.d.ts.map +1 -0
  69. package/dist/src/decorators/required-for-create.js +14 -0
  70. package/dist/src/decorators/required-for-create.js.map +1 -0
  71. package/dist/src/entities/annotations.d.ts +20 -17
  72. package/dist/src/entities/annotations.d.ts.map +1 -1
  73. package/dist/src/entities/annotations.js +69 -48
  74. package/dist/src/entities/annotations.js.map +1 -1
  75. package/dist/src/entities/entity-container.js +1 -1
  76. package/dist/src/entities/entity-container.js.map +1 -1
  77. package/dist/src/entities/model.d.ts +1 -0
  78. package/dist/src/entities/model.d.ts.map +1 -1
  79. package/dist/src/entities/model.js +2 -1
  80. package/dist/src/entities/model.js.map +1 -1
  81. package/dist/src/entities/namespace.d.ts +3 -3
  82. package/dist/src/entities/namespace.d.ts.map +1 -1
  83. package/dist/src/entities/namespace.js +34 -8
  84. package/dist/src/entities/namespace.js.map +1 -1
  85. package/dist/src/entities/operation.d.ts.map +1 -1
  86. package/dist/src/entities/operation.js +1 -2
  87. package/dist/src/entities/operation.js.map +1 -1
  88. package/dist/src/entities/property.d.ts.map +1 -1
  89. package/dist/src/entities/property.js +3 -0
  90. package/dist/src/entities/property.js.map +1 -1
  91. package/dist/src/entities/revision-definition.d.ts +1 -1
  92. package/dist/src/entities/revision-definition.js +3 -3
  93. package/dist/src/lib.d.ts +16 -0
  94. package/dist/src/lib.d.ts.map +1 -1
  95. package/dist/src/lib.js +4 -0
  96. package/dist/src/lib.js.map +1 -1
  97. package/dist/src/linter.d.ts.map +1 -1
  98. package/dist/src/linter.js +4 -0
  99. package/dist/src/linter.js.map +1 -1
  100. package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts +2 -0
  101. package/dist/src/rules/collection-navigation-properties-not-nullable.d.ts.map +1 -0
  102. package/dist/src/rules/collection-navigation-properties-not-nullable.js +28 -0
  103. package/dist/src/rules/collection-navigation-properties-not-nullable.js.map +1 -0
  104. package/dist/src/rules/count.js +2 -2
  105. package/dist/src/rules/count.js.map +1 -1
  106. package/dist/src/rules/disallowed-typespec-decorators.d.ts +2 -0
  107. package/dist/src/rules/disallowed-typespec-decorators.d.ts.map +1 -0
  108. package/dist/src/rules/disallowed-typespec-decorators.js +33 -0
  109. package/dist/src/rules/disallowed-typespec-decorators.js.map +1 -0
  110. package/dist/src/rules/extends-on-same-type.d.ts +2 -0
  111. package/dist/src/rules/extends-on-same-type.d.ts.map +1 -0
  112. package/dist/src/rules/extends-on-same-type.js +38 -0
  113. package/dist/src/rules/extends-on-same-type.js.map +1 -0
  114. package/dist/src/rules/filter.d.ts +4 -0
  115. package/dist/src/rules/filter.d.ts.map +1 -0
  116. package/dist/src/rules/filter.js +92 -0
  117. package/dist/src/rules/filter.js.map +1 -0
  118. package/dist/src/rules/graph-route.d.ts +5 -0
  119. package/dist/src/rules/graph-route.d.ts.map +1 -0
  120. package/dist/src/rules/graph-route.js +39 -0
  121. package/dist/src/rules/graph-route.js.map +1 -0
  122. package/dist/src/rules/index.d.ts +7 -3
  123. package/dist/src/rules/index.d.ts.map +1 -1
  124. package/dist/src/rules/index.js +7 -89
  125. package/dist/src/rules/index.js.map +1 -1
  126. package/dist/src/rules/operation-inside-interface.d.ts +2 -0
  127. package/dist/src/rules/operation-inside-interface.d.ts.map +1 -0
  128. package/dist/src/rules/operation-inside-interface.js +25 -0
  129. package/dist/src/rules/operation-inside-interface.js.map +1 -0
  130. package/dist/src/rules/order-by.js +2 -2
  131. package/dist/src/rules/order-by.js.map +1 -1
  132. package/dist/src/rules/required-for-create.d.ts +2 -0
  133. package/dist/src/rules/required-for-create.d.ts.map +1 -0
  134. package/dist/src/rules/required-for-create.js +40 -0
  135. package/dist/src/rules/required-for-create.js.map +1 -0
  136. package/dist/src/rules/search.js +2 -2
  137. package/dist/src/rules/search.js.map +1 -1
  138. package/dist/src/rules/skip.js +2 -2
  139. package/dist/src/rules/skip.js.map +1 -1
  140. package/dist/src/rules/top.js +2 -2
  141. package/dist/src/rules/top.js.map +1 -1
  142. package/dist/src/utils.d.ts +16 -4
  143. package/dist/src/utils.d.ts.map +1 -1
  144. package/dist/src/utils.js +81 -31
  145. package/dist/src/utils.js.map +1 -1
  146. package/lib/decorators.tsp +32 -0
  147. package/lib/lib.tsp +4 -15
  148. package/package.json +1 -2
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter.js","sourceRoot":"","sources":["../../../src/rules/filter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAS,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAEpE,MAAM,CAAC,MAAM,qDAAqD,GAAG,UAAU,CAAC;IAC9E,IAAI,EAAE,0DAA0D;IAChE,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE;gBACvB,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE;oBACjC,OAAO;iBACR;gBAED,IAAI,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,KAAK,EAAE;oBAClD,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;oBACxC,MAAM,YAAY,GAAG,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;oBAC3D,IAAI,YAAY,EAAE;wBAChB,OAAO;qBACR;iBACF;gBAED,gBAAgB,CAAC,OAAO,EAAE;oBACxB,IAAI,EAAE,uBAAuB;oBAC7B,MAAM,EAAE,SAAS;oBACjB,SAAS,EAAE,WAAW;o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wBACrB,UAAU,EAAE,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC;qBAC/C;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,kCAAkC,GAAG,UAAU,CAAC;IAC3D,IAAI,EAAE,qCAAqC;IAC3C,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE;gBACvB,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE;oBACjC,OAAO;iBACR;gBAED,MAAM,gBAAgB,GAAG,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;gBACvD,IAAI,gBAAgB,CAAC,MAAM,EAAE;oBAC3B,OAAO;iBACR;gBAED,gBAAgB,CAAC,OAAO,EAAE;oBACxB,IAAI,EAAE,uBAAuB;oBAC7B,MAAM,EAAE,SAAS;oBACjB,SAAS,EAAE,UAAU;oBACrB,MAAM,EAAE;wBACN,SAAS,EAAE,SAAS;wBACpB,UAAU,EAAE,mBAAmB;qBAChC;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @graphRoute should not have a leading forward slash
3
+ */
4
+ export declare const graphRouteLeadingSlashRule: import("@typespec/lint").LintRule;
5
+ //# sourceMappingURL=graph-route.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph-route.d.ts","sourceRoot":"","sources":["../../../src/rules/graph-route.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,eAAO,MAAM,0BAA0B,mCAYrC,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { createRule } from "@typespec/lint";
2
+ import { reportDiagnostic } from "../lib.js";
3
+ import { getGraphRoutePath, hasGraphRoute } from "../index.js";
4
+ /**
5
+ * @graphRoute should not have a leading forward slash
6
+ */
7
+ export const graphRouteLeadingSlashRule = createRule({
8
+ name: "graph-route-leading-slash",
9
+ create({ program }) {
10
+ return {
11
+ interface: (interface_) => {
12
+ applyDiagnostics(program, interface_);
13
+ },
14
+ operation: (operation) => {
15
+ applyDiagnostics(program, operation);
16
+ }
17
+ };
18
+ },
19
+ });
20
+ const applyDiagnostics = (program, target) => {
21
+ if (!hasGraphRoute(program, target)) {
22
+ return;
23
+ }
24
+ const paths = getGraphRoutePath(program, target);
25
+ if (paths === undefined) {
26
+ return;
27
+ }
28
+ if (paths[0].startsWith("/")) {
29
+ reportDiagnostic(program, {
30
+ code: "decorator-invalid-use",
31
+ target: target,
32
+ messageId: 'graphRoute',
33
+ format: {
34
+ decorator: "@graphRoute",
35
+ }
36
+ });
37
+ }
38
+ };
39
+ //# sourceMappingURL=graph-route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graph-route.js","sourceRoot":"","sources":["../../../src/rules/graph-route.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAG/D;;GAEG;AAEH,MAAM,CAAC,MAAM,0BAA0B,GAAG,UAAU,CAAC;IACnD,IAAI,EAAE,2BAA2B;IACjC,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,SAAS,EAAE,CAAC,UAAU,EAAE,EAAE;gBACxB,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;YACxC,CAAC;YACD,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE;gBACvB,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;YACvC,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG,CAAC,OAAgB,EAAE,MAAY,EAAE,EAAE;IAC1D,IAAG,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;QAClC,OAAO;KACR;IACD,MAAM,KAAK,GAAG,iBAAiB,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAC/C,IAAG,KAAK,KAAK,SAAS,EAAE;QACtB,OAAO;KACR;IAED,IAAG,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;QAC3B,gBAAgB,CAAC,OAAO,EAAE;YACxB,IAAI,EAAE,uBAAuB;YAC7B,MAAM,EAAE,MAAM;YACd,SAAS,EAAE,YAAY;YACvB,MAAM,EAAE;gBACN,SAAS,EAAE,aAAa;aACzB;SACF,CAAC,CAAC;KACJ;AACL,CAAC,CAAA"}
@@ -1,20 +1,24 @@
1
1
  export * from "./abstract.js";
2
2
  export * from "./alternate-key.js";
3
+ export * from "./collection-navigation-properties-not-nullable.js";
3
4
  export * from "./computed.js";
4
5
  export * from "./contains.js";
5
6
  export * from "./count.js";
7
+ export * from "./disallowed-typespec-decorators.js";
6
8
  export * from "./entity.js";
7
9
  export * from "./enum.js";
8
10
  export * from "./expand.js";
11
+ export * from "./extends-on-same-type.js";
12
+ export * from "./filter.js";
9
13
  export * from "./function.js";
10
14
  export * from "./has-stream.js";
11
15
  export * from "./open.js";
16
+ export * from "./operation-inside-interface.js";
12
17
  export * from "./order-by.js";
13
18
  export * from "./references.js";
19
+ export * from "./required-for-create.js";
14
20
  export * from "./search.js";
15
21
  export * from "./skip.js";
16
22
  export * from "./top.js";
17
- export declare const disallowedTypeSpecDecoratorsRule: import("@typespec/lint").LintRule;
18
- export declare const extendsOnSameTypeRule: import("@typespec/lint").LintRule;
19
- export declare const operationInsideInterfaceRule: import("@typespec/lint").LintRule;
23
+ export * from "./graph-route.js";
20
24
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
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,mCAuBvC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rules/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,oDAAoD,CAAC;AACnE,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,YAAY,CAAC;AAC3B,cAAc,qCAAqC,CAAC;AACpD,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,2BAA2B,CAAC;AAC1C,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iCAAiC,CAAC;AAChD,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC"}
@@ -1,106 +1,24 @@
1
- import { createRule } from "@typespec/lint";
2
- import { isComplex, isEntity } from "../index.js";
3
- import { reportDiagnostic } from "../lib.js";
4
- import { isExcludedCoreType } from "../utils.js";
5
1
  export * from "./abstract.js";
6
2
  export * from "./alternate-key.js";
3
+ export * from "./collection-navigation-properties-not-nullable.js";
7
4
  export * from "./computed.js";
8
5
  export * from "./contains.js";
9
6
  export * from "./count.js";
7
+ export * from "./disallowed-typespec-decorators.js";
10
8
  export * from "./entity.js";
11
9
  export * from "./enum.js";
12
10
  export * from "./expand.js";
11
+ export * from "./extends-on-same-type.js";
12
+ export * from "./filter.js";
13
13
  export * from "./function.js";
14
14
  export * from "./has-stream.js";
15
15
  export * from "./open.js";
16
+ export * from "./operation-inside-interface.js";
16
17
  export * from "./order-by.js";
17
18
  export * from "./references.js";
19
+ export * from "./required-for-create.js";
18
20
  export * from "./search.js";
19
21
  export * from "./skip.js";
20
22
  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
- });
51
- export const extendsOnSameTypeRule = createRule({
52
- name: "extends-on-same-type",
53
- create({ program }) {
54
- return {
55
- model: (model) => {
56
- if (!model.baseModel) {
57
- return;
58
- }
59
- if (isExcludedCoreType(program, model)) {
60
- return;
61
- }
62
- if (isEntity(program, model) && !isEntity(program, model.baseModel)) {
63
- reportDiagnostic(program, {
64
- code: "extends-invalid-use",
65
- target: model,
66
- format: {
67
- type: "@entity",
68
- },
69
- });
70
- }
71
- if (isComplex(program, model) && !isComplex(program, model.baseModel)) {
72
- reportDiagnostic(program, {
73
- code: "extends-invalid-use",
74
- target: model,
75
- format: {
76
- type: "@complex",
77
- },
78
- });
79
- }
80
- },
81
- };
82
- },
83
- });
84
- export const operationInsideInterfaceRule = createRule({
85
- name: "operation-inside-interface",
86
- create({ program }) {
87
- return {
88
- operation: (operation) => {
89
- if (operation.interface) {
90
- return;
91
- }
92
- if (isExcludedCoreType(program, operation)) {
93
- return;
94
- }
95
- return; // TODO: Work out the compiler bug and get it fixed. See #138
96
- reportDiagnostic(program, {
97
- code: "element-missing-dependencies",
98
- target: operation,
99
- messageId: "operation",
100
- format: {},
101
- });
102
- },
103
- };
104
- },
105
- });
23
+ export * from "./graph-route.js";
106
24
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/rules/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEjD,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,MAAM,CAAC,MAAM,gCAAgC,GA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B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iCAAiC,CAAC;AAChD,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,0BAA0B,CAAC;AACzC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const operationInsideInterfaceRule: import("@typespec/lint").LintRule;
2
+ //# sourceMappingURL=operation-inside-interface.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-inside-interface.d.ts","sourceRoot":"","sources":["../../../src/rules/operation-inside-interface.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,4BAA4B,mCAsBvC,CAAC"}
@@ -0,0 +1,25 @@
1
+ import { createRule } from "@typespec/lint";
2
+ import { reportDiagnostic } from "../lib.js";
3
+ import { isExcludedCoreType } from "../utils.js";
4
+ export const operationInsideInterfaceRule = createRule({
5
+ name: "operation-inside-interface",
6
+ create({ program }) {
7
+ return {
8
+ operation: (operation) => {
9
+ if (operation.interface) {
10
+ return;
11
+ }
12
+ if (isExcludedCoreType(program, operation)) {
13
+ return;
14
+ }
15
+ reportDiagnostic(program, {
16
+ code: "element-missing-dependencies",
17
+ target: operation,
18
+ messageId: "operation",
19
+ format: {},
20
+ });
21
+ },
22
+ };
23
+ },
24
+ });
25
+ //# sourceMappingURL=operation-inside-interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"operation-inside-interface.js","sourceRoot":"","sources":["../../../src/rules/operation-inside-interface.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,4BAA4B,GAAG,UAAU,CAAC;IACrD,IAAI,EAAE,4BAA4B;IAClC,MAAM,CAAC,EAAE,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"}
@@ -2,7 +2,7 @@ import { walkPropertiesInherited } from "@typespec/compiler";
2
2
  import { createRule } from "@typespec/lint";
3
3
  import { getOperationVerb } from "@typespec/http";
4
4
  import { getOrderBy, isContains, isOrderBy, isReferences } from "../index.js";
5
- import { isReturnTypeCollection } from "../utils.js";
5
+ import { isTypeCollection } from "../utils.js";
6
6
  import { reportDiagnostic } from "../lib.js";
7
7
  import { getNavigationSourceType } from "../utils.js";
8
8
  export const orderByAppliesToGetOperationsThatReturnCollectionsRule = createRule({
@@ -15,7 +15,7 @@ export const orderByAppliesToGetOperationsThatReturnCollectionsRule = createRule
15
15
  }
16
16
  if (getOperationVerb(program, operation) === "get") {
17
17
  const returnType = operation.returnType;
18
- const isCollection = isReturnTypeCollection(program, returnType);
18
+ const isCollection = isTypeCollection(program, returnType);
19
19
  if (isCollection) {
20
20
  return;
21
21
  }
@@ -1 +1 @@
1
- {"version":3,"file":"order-by.js","sourceRoot":"","sources":["../../../src/rules/order-by.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAg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AC"}
@@ -0,0 +1,2 @@
1
+ export declare const requiredRequestParametersRule: import("@typespec/lint").LintRule;
2
+ //# sourceMappingURL=required-for-create.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"required-for-create.d.ts","sourceRoot":"","sources":["../../../src/rules/required-for-create.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,6BAA6B,mCAsCxC,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { createRule } from "@typespec/lint";
2
+ import { isComputed, isRequiredForCreate } from "../index.js";
3
+ import { getIdForType, isTypeNullable } from "../utils.js";
4
+ import { getOperationVerb } from "@typespec/http";
5
+ import { reportDiagnostic } from "../lib.js";
6
+ export const requiredRequestParametersRule = createRule({
7
+ name: "required-request-parameters",
8
+ create({ program }) {
9
+ return {
10
+ interface: (theInterface) => {
11
+ const postOperations = [...theInterface.operations]
12
+ .map(([_, operation]) => operation)
13
+ .filter((operation) => getOperationVerb(program, operation) === "post");
14
+ postOperations.forEach((operation) => {
15
+ if (operation.parameters.properties.has("body")) {
16
+ const body = operation.parameters.properties.get("body");
17
+ const model = body.type;
18
+ [...model.properties].forEach(([_, property]) => {
19
+ if (!(isRequiredForCreate(program, property) ||
20
+ isTypeNullable(program, property.type) ||
21
+ isComputed(program, property) ||
22
+ property.default)) {
23
+ reportDiagnostic(program, {
24
+ code: "element-missing-dependencies",
25
+ target: property,
26
+ messageId: "propertyRequiredForCreate",
27
+ format: {
28
+ property: property.name,
29
+ model: getIdForType(program, property.model),
30
+ },
31
+ });
32
+ }
33
+ });
34
+ }
35
+ });
36
+ },
37
+ };
38
+ },
39
+ });
40
+ //# sourceMappingURL=required-for-create.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"required-for-create.js","sourceRoot":"","sources":["../../../src/rules/required-for-create.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC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EAAE,8BAA8B;oCACpC,MAAM,EAAE,QAAQ;oCAChB,SAAS,EAAE,2BAA2B;oCACtC,MAAM,EAAE;wCACN,QAAQ,EAAE,QAAQ,CAAC,IAAI;wCACvB,KAAK,EAAE,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,KAAM,CAAC;qCAC9C;iCACF,CAAC,CAAC;6BACJ;wBACH,CAAC,CAAC,CAAC;qBACJ;gBACH,CAAC,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { createRule } from "@typespec/lint";
2
2
  import { getOperationVerb } from "@typespec/http";
3
3
  import { isSearch } from "../index.js";
4
- import { isReturnTypeCollection } from "../utils.js";
4
+ import { isTypeCollection } from "../utils.js";
5
5
  import { reportDiagnostic } from "../lib.js";
6
6
  /**
7
7
  * @search applies to get operations that return collections.
@@ -16,7 +16,7 @@ export const searchAppliesToGetOperationsThatReturnCollectionsRule = createRule(
16
16
  }
17
17
  if (getOperationVerb(program, operation) === "get") {
18
18
  const returnType = operation.returnType;
19
- const isCollection = isReturnTypeCollection(program, returnType);
19
+ const isCollection = isTypeCollection(program, returnType);
20
20
  if (isCollection) {
21
21
  return;
22
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"search.js","sourceRoot":"","sources":["../../../src/rules/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,qDAAqD,GAAG,UAAU,CAAC;IAC9E,IAAI,EAAE,0DAA0D;IAChE,MAAM,CAAC,EAAE,OAAO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,IAAI,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,KAAK,EAAE;oBAClD,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;oBACxC,MAAM,YAAY,GAAG,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;oBAC3D,IAAI,YAAY,EAAE;wBAChB,OAAO;qBACR;iBACF;gBAED,gBAAgB,CAAC,OAAO,EAAE;oBACxB,IAAI,EAAE,uBAAuB;oBAC7B,MAAM,EAAE,SAAS;oBACjB,SAAS,EAAE,WAAW;oBACtB,MAAM,EAAE;wBACN,SAAS,EAAE,SAAS;wBACpB,MAAM,EAAE,yCAAyC;qBAClD;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { createRule } from "@typespec/lint";
2
2
  import { getOperationVerb } from "@typespec/http";
3
3
  import { isSkip } from "../index.js";
4
- import { isReturnTypeCollection } from "../utils.js";
4
+ import { isTypeCollection } from "../utils.js";
5
5
  import { reportDiagnostic } from "../lib.js";
6
6
  /**
7
7
  * @skip applies to get operations that return collections.
@@ -16,7 +16,7 @@ export const skipAppliesToGetOperationsThatReturnCollectionsRule = createRule({
16
16
  }
17
17
  if (getOperationVerb(program, operation) === "get") {
18
18
  const returnType = operation.returnType;
19
- const isCollection = isReturnTypeCollection(program, returnType);
19
+ const isCollection = isTypeCollection(program, returnType);
20
20
  if (isCollection) {
21
21
  return;
22
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"skip.js","sourceRoot":"","sources":["../../../src/rules/skip.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAA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,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE;gBACvB,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE;oBAC/B,OAAO;iBACR;gBAED,IAAI,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,KAAK,EAAE;oBAClD,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;oBACxC,MAAM,YAAY,GAAG,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;oBAC3D,IAAI,YAAY,EAAE;wBAChB,OAAO;qBACR;iBACF;gBAED,gBAAgB,CAAC,OAAO,EAAE;oBACxB,IAAI,EAAE,uBAAuB;oBAC7B,MAAM,EAAE,SAAS;oBACjB,SAAS,EAAE,WAAW;oBACtB,MAAM,EAAE;wBACN,SAAS,EAAE,OAAO;wBAClB,MAAM,EAAE,yCAAyC;qBAClD;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { createRule } from "@typespec/lint";
2
2
  import { getOperationVerb } from "@typespec/http";
3
3
  import { isTop } from "../index.js";
4
- import { isReturnTypeCollection } from "../utils.js";
4
+ import { isTypeCollection } from "../utils.js";
5
5
  import { reportDiagnostic } from "../lib.js";
6
6
  /**
7
7
  * @top applies to get operations that return collections.
@@ -16,7 +16,7 @@ export const topAppliesToGetOperationsThatReturnCollectionsRule = createRule({
16
16
  }
17
17
  if (getOperationVerb(program, operation) === "get") {
18
18
  const returnType = operation.returnType;
19
- const isCollection = isReturnTypeCollection(program, returnType);
19
+ const isCollection = isTypeCollection(program, returnType);
20
20
  if (isCollection) {
21
21
  return;
22
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"top.js","sourceRoot":"","sources":["../../../src/rules/top.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC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;AAC/C,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C;;GAEG;AACH,MAAM,CAAC,MAAM,kDAAkD,GAAG,UAAU,CAAC;IAC3E,IAAI,EAAE,uDAAuD;IAC7D,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,SAAS,EAAE,CAAC,SAAS,EAAE,EAAE;gBACvB,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,SAAS,CAAC,EAAE;oBAC9B,OAAO;iBACR;gBAED,IAAI,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,KAAK,EAAE;oBAClD,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC;oBACxC,MAAM,YAAY,GAAG,gBAAgB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;oBAC3D,IAAI,YAAY,EAAE;wBAChB,OAAO;qBACR;iBACF;gBAED,gBAAgB,CAAC,OAAO,EAAE;oBACxB,IAAI,EAAE,uBAAuB;oBAC7B,MAAM,EAAE,SAAS;oBACjB,SAAS,EAAE,WAAW;oBACtB,MAAM,EAAE;wBACN,SAAS,EAAE,MAAM;wBACjB,MAAM,EAAE,yCAAyC;qBAClD;iBACF,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
@@ -1,8 +1,8 @@
1
1
  import { Enum, Interface, Model, ModelProperty, Namespace, Operation, Program, Scalar, Type, Union } from "@typespec/compiler";
2
2
  export interface MsGraphInterface {
3
- key: string;
4
3
  theInterface: Interface;
5
4
  operations: Operation[];
5
+ path: string;
6
6
  }
7
7
  export declare function getNameForType(program: Program, type: Type): string;
8
8
  export declare function getNameForModelType(program: Program, type: Model | Scalar): string;
@@ -14,11 +14,11 @@ export declare function isTypeNullable(program: Program, type: Type): boolean;
14
14
  export declare function extractTypesFromUnion(type: Union): Type[];
15
15
  export declare function getSingletonTypeId(program: Program, singletonType: string | null, getOperation: Operation | undefined): string | undefined;
16
16
  /**
17
- * Returns whether a type used as a return type matches Graph's definition of a collection
17
+ * Returns whether a type matches Graph's definition of a collection
18
18
  * @param program
19
- * @param returnType
19
+ * @param type
20
20
  */
21
- export declare function isReturnTypeCollection(program: Program, returnType: Type): boolean;
21
+ export declare function isTypeCollection(Program: Program, type: Type): boolean;
22
22
  /**
23
23
  * Imported from typespec-azure
24
24
  * Returns the full namespace name for the given type, if available.
@@ -38,6 +38,18 @@ export declare function isExcludedCoreType(program: Program, type: Model | Scala
38
38
  export declare function isExcludedLibraryType(program: Program, type: Model | Scalar | Operation | ModelProperty | Interface | Namespace | Enum): boolean;
39
39
  export declare function isNavigationProperty(program: Program, property: ModelProperty): boolean;
40
40
  export declare function isNavigationSource(theInterface: Interface): boolean;
41
+ export declare function isTopLevelNavigationSource(program: Program, theInterface: MsGraphInterface): boolean;
42
+ /**
43
+ * Check if a @graphRoute returns a single resource of a collection.
44
+ *
45
+ * `Example`
46
+ *
47
+ * @graphRoute("users/{id}")
48
+ * interface UsersById extends Resource<user> {
49
+ * get is GraphOps.GetResource;
50
+ * }
51
+ */
52
+ export declare function isCollectionResource(program: Program, theInterface: MsGraphInterface): boolean;
41
53
  export declare function getInterfaceNavigationSourceType(program: Program, theInterface: Interface): Model | undefined;
42
54
  export declare function getNavigationSourceType(program: Program, operation: Operation): Model | undefined;
43
55
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAEJ,SAAS,EAET,KAAK,EACL,aAAa,EACb,SAAS,EACT,SAAS,EACT,OAAO,EACP,MAAM,EACN,IAAI,EACJ,KAAK,EACN,MAAM,oBAAoB,CAAC;AAI5B,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,SAAS,CAAC;IACxB,UAAU,EAAE,SAAS,EAAE,CAAC;CACzB;AAED,wBAAgB,cAAc,CA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