@microsoft/typespec-msgraph 0.0.1-Preview.7 → 0.0.1-Preview.9

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 (120) hide show
  1. package/dist/src/components/annotations.d.ts +4 -1
  2. package/dist/src/components/annotations.d.ts.map +1 -1
  3. package/dist/src/components/annotations.js +22 -4
  4. package/dist/src/components/annotations.js.map +1 -1
  5. package/dist/src/components/filter-restrictions-annotation.d.ts +6 -0
  6. package/dist/src/components/filter-restrictions-annotation.d.ts.map +1 -0
  7. package/dist/src/components/filter-restrictions-annotation.js +10 -0
  8. package/dist/src/components/filter-restrictions-annotation.js.map +1 -0
  9. package/dist/src/components/immutable-annotation.d.ts +5 -0
  10. package/dist/src/components/immutable-annotation.d.ts.map +1 -0
  11. package/dist/src/components/immutable-annotation.js +6 -0
  12. package/dist/src/components/immutable-annotation.js.map +1 -0
  13. package/dist/src/components/index.js +3 -3
  14. package/dist/src/components/index.js.map +1 -1
  15. package/dist/src/components/insert-restrictions-annotation.d.ts +6 -0
  16. package/dist/src/components/insert-restrictions-annotation.d.ts.map +1 -0
  17. package/dist/src/components/insert-restrictions-annotation.js +10 -0
  18. package/dist/src/components/insert-restrictions-annotation.js.map +1 -0
  19. package/dist/src/components/property-element.d.ts.map +1 -1
  20. package/dist/src/components/property-element.js +3 -1
  21. package/dist/src/components/property-element.js.map +1 -1
  22. package/dist/src/components/schema-element.d.ts.map +1 -1
  23. package/dist/src/components/schema-element.js +6 -7
  24. package/dist/src/components/schema-element.js.map +1 -1
  25. package/dist/src/decorators/action.d.ts +10 -0
  26. package/dist/src/decorators/action.d.ts.map +1 -0
  27. package/dist/src/decorators/action.js +16 -0
  28. package/dist/src/decorators/action.js.map +1 -0
  29. package/dist/src/decorators/allowed-values.d.ts +13 -0
  30. package/dist/src/decorators/allowed-values.d.ts.map +1 -0
  31. package/dist/src/decorators/allowed-values.js +35 -0
  32. package/dist/src/decorators/allowed-values.js.map +1 -0
  33. package/dist/src/decorators/filter.d.ts +11 -0
  34. package/dist/src/decorators/filter.d.ts.map +1 -0
  35. package/dist/src/decorators/filter.js +27 -0
  36. package/dist/src/decorators/filter.js.map +1 -0
  37. package/dist/src/decorators/graph-route.d.ts +8 -1
  38. package/dist/src/decorators/graph-route.d.ts.map +1 -1
  39. package/dist/src/decorators/graph-route.js +27 -13
  40. package/dist/src/decorators/graph-route.js.map +1 -1
  41. package/dist/src/decorators/immutable.d.ts +8 -0
  42. package/dist/src/decorators/immutable.d.ts.map +1 -0
  43. package/dist/src/decorators/immutable.js +12 -0
  44. package/dist/src/decorators/immutable.js.map +1 -0
  45. package/dist/src/decorators/index.d.ts +6 -0
  46. package/dist/src/decorators/index.d.ts.map +1 -1
  47. package/dist/src/decorators/index.js +6 -0
  48. package/dist/src/decorators/index.js.map +1 -1
  49. package/dist/src/decorators/public-namespace.d.ts +10 -0
  50. package/dist/src/decorators/public-namespace.d.ts.map +1 -0
  51. package/dist/src/decorators/public-namespace.js +16 -0
  52. package/dist/src/decorators/public-namespace.js.map +1 -0
  53. package/dist/src/decorators/required-for-create.d.ts +10 -0
  54. package/dist/src/decorators/required-for-create.d.ts.map +1 -0
  55. package/dist/src/decorators/required-for-create.js +14 -0
  56. package/dist/src/decorators/required-for-create.js.map +1 -0
  57. package/dist/src/emitter.d.ts +2 -1
  58. package/dist/src/emitter.d.ts.map +1 -1
  59. package/dist/src/emitter.js +3 -1
  60. package/dist/src/emitter.js.map +1 -1
  61. package/dist/src/entities/annotations.d.ts +9 -0
  62. package/dist/src/entities/annotations.d.ts.map +1 -1
  63. package/dist/src/entities/annotations.js +42 -1
  64. package/dist/src/entities/annotations.js.map +1 -1
  65. package/dist/src/entities/model.d.ts +6 -0
  66. package/dist/src/entities/model.d.ts.map +1 -1
  67. package/dist/src/entities/model.js +4 -2
  68. package/dist/src/entities/model.js.map +1 -1
  69. package/dist/src/entities/namespace.d.ts +3 -3
  70. package/dist/src/entities/namespace.d.ts.map +1 -1
  71. package/dist/src/entities/namespace.js +26 -10
  72. package/dist/src/entities/namespace.js.map +1 -1
  73. package/dist/src/entities/operation.d.ts.map +1 -1
  74. package/dist/src/entities/operation.js +2 -3
  75. package/dist/src/entities/operation.js.map +1 -1
  76. package/dist/src/entities/property.d.ts.map +1 -1
  77. package/dist/src/entities/property.js +3 -0
  78. package/dist/src/entities/property.js.map +1 -1
  79. package/dist/src/lib.d.ts +45 -2
  80. package/dist/src/lib.d.ts.map +1 -1
  81. package/dist/src/lib.js +23 -1
  82. package/dist/src/lib.js.map +1 -1
  83. package/dist/src/linter.d.ts.map +1 -1
  84. package/dist/src/linter.js +8 -0
  85. package/dist/src/linter.js.map +1 -1
  86. package/dist/src/rules/allowed-values.d.ts +6 -0
  87. package/dist/src/rules/allowed-values.d.ts.map +1 -0
  88. package/dist/src/rules/allowed-values.js +59 -0
  89. package/dist/src/rules/allowed-values.js.map +1 -0
  90. package/dist/src/rules/filter.d.ts +4 -0
  91. package/dist/src/rules/filter.d.ts.map +1 -0
  92. package/dist/src/rules/filter.js +92 -0
  93. package/dist/src/rules/filter.js.map +1 -0
  94. package/dist/src/rules/graph-route.d.ts +6 -0
  95. package/dist/src/rules/graph-route.d.ts.map +1 -0
  96. package/dist/src/rules/graph-route.js +88 -0
  97. package/dist/src/rules/graph-route.js.map +1 -0
  98. package/dist/src/rules/index.d.ts +6 -0
  99. package/dist/src/rules/index.d.ts.map +1 -1
  100. package/dist/src/rules/index.js +6 -0
  101. package/dist/src/rules/index.js.map +1 -1
  102. package/dist/src/rules/namespace.d.ts +3 -0
  103. package/dist/src/rules/namespace.d.ts.map +1 -0
  104. package/dist/src/rules/namespace.js +58 -0
  105. package/dist/src/rules/namespace.js.map +1 -0
  106. package/dist/src/rules/required-for-create.d.ts +2 -0
  107. package/dist/src/rules/required-for-create.d.ts.map +1 -0
  108. package/dist/src/rules/required-for-create.js +40 -0
  109. package/dist/src/rules/required-for-create.js.map +1 -0
  110. package/dist/src/utils.d.ts +3 -0
  111. package/dist/src/utils.d.ts.map +1 -1
  112. package/dist/src/utils.js +73 -21
  113. package/dist/src/utils.js.map +1 -1
  114. package/lib/decorators.tsp +102 -56
  115. package/lib/deployment.tsp +1 -1
  116. package/lib/lib.tsp +5 -16
  117. package/lib/porcelain.tsp +4 -4
  118. package/lib/responses.tsp +6 -6
  119. package/lib/shared-models.tsp +4 -3
  120. package/package.json +11 -12
@@ -44,6 +44,9 @@ export function getDefaultPropertyValue(program, property) {
44
44
  case "Edm.Stream":
45
45
  defaultValueKey = "Binary";
46
46
  break;
47
+ case "Edm.Guid":
48
+ defaultValueKey = "Guid";
49
+ break;
47
50
  case "Edm.Duration":
48
51
  case "Edm.TimeOfDay":
49
52
  default:
@@ -1 +1 @@
1
- {"version":3,"file":"property.js","sourceRoot":"","sources":["../../../src/entities/property.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,UAAU,uBAAuB,CACrC,OAAgB,EAChB,QAAuB;IAEvB,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE;QACrB,OAAO,SAAS,CAAC;KAClB;IAED,IAAI,iBAAiB,GAAQ,SAAS,CAAC;IACvC,QAAQ,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE;QAC7B,KAAK,QAAQ,CAAC;QACd,KAAK,SAAS,CAAC;QACf,KAAK,QAAQ;YACX,iBAAiB,GAAG,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC;YAC3C,MAAM;QACR;YACE,OAAO,SAAS,CAAC;KACpB;IAED,MAAM,QAAQ,GAAG,mBAAmB,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IAE7D,IAAI,eAAe,GAAG,QAAQ,CAAC;IAC/B,QAAQ,QAAQ,EAAE;QAChB,KAAK,YAAY;YACf,eAAe,GAAG,QAAQ,CAAC;YAC3B,MAAM;QACR,KAAK,sBAAsB;YACzB,eAAe,GAAG,QAAQ,CAAC;YAC3B,M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AQ,CAAC;IAC/B,QAAQ,QAAQ,EAAE;QAChB,KAAK,YAAY;YACf,eAAe,GAAG,QAAQ,CAAC;YAC3B,MAAM;QACR,KAAK,sBAAsB;YACzB,eAAe,GAAG,QAAQ,CAAC;YAC3B,MAAM;QACR,KAAK,UAAU,CAAC;QAChB,KAAK,WAAW,CAAC;QACjB,KAAK,WAAW,CAAC;QACjB,KAAK,WAAW;YACd,eAAe,GAAG,KAAK,CAAC;YACxB,MAAM;QACR,KAAK,YAAY,CAAC;QAClB,KAAK,YAAY;YACf,eAAe,GAAG,QAAQ,CAAC;YAC3B,MAAM;QACR,KAAK,UAAU;YACb,eAAe,GAAG,MAAM,CAAC;YACzB,MAAM;QACR,KAAK,oBAAoB;YACvB,eAAe,GAAG,gBAAgB,CAAC;YACnC,MAAM;QACR,KAAK,aAAa;YAChB,eAAe,GAAG,SAAS,CAAC;YAC5B,MAAM;QACR,KAAK,YAAY;YACf,eAAe,GAAG,QAAQ,CAAC;YAC3B,MAAM;QACR,KAAK,UAAU;YACb,eAAe,GAAG,MAAM,CAAC;YACzB,MAAM;QACR,KAAK,cAAc,CAAC;QACpB,KAAK,eAAe,CAAC;QACrB;YACE,OAAO,SAAS,CAAC;KACpB;IAED,OAAO,EAAE,CAAC,eAAe,CAAC,EAAE,iBAAiB,EAAE,CAAC;AAClD,CAAC"}
package/dist/src/lib.d.ts CHANGED
@@ -1,4 +1,8 @@
1
- export declare const namespace = "TypeSpec.MsGraph";
1
+ import { JSONSchemaType } from "@typespec/compiler";
2
+ export declare const namespace = "MsGraph";
3
+ export interface MsGraphEmitterOptions {
4
+ filename?: string;
5
+ }
2
6
  export declare const libDef: {
3
7
  readonly name: "@microsoft/typespec-msgraph";
4
8
  readonly diagnostics: {
@@ -15,6 +19,9 @@ export declare const libDef: {
15
19
  readonly default: import("@typespec/compiler").CallableMessage<["element", "other", "location"]>;
16
20
  readonly operation: import("@typespec/compiler").CallableMessage<[]>;
17
21
  readonly collectionNavigationPropertiesNotNullable: "Collection-valued navigation properties cannot be nullable.";
22
+ readonly propertyRequiredForCreate: import("@typespec/compiler").CallableMessage<["property", "model"]>;
23
+ readonly modelMissingNamespace: import("@typespec/compiler").CallableMessage<["model"]>;
24
+ readonly operationParameterMismatch: import("@typespec/compiler").CallableMessage<["operation", "parameters"]>;
18
25
  };
19
26
  };
20
27
  readonly "decorator-invalid-use": {
@@ -24,10 +31,16 @@ export declare const libDef: {
24
31
  readonly alternateKey: import("@typespec/compiler").CallableMessage<[]>;
25
32
  readonly disallowedTypeSpecDecorators: import("@typespec/compiler").CallableMessage<["decorator"]>;
26
33
  readonly expandProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
34
+ readonly filterProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
27
35
  readonly key: import("@typespec/compiler").CallableMessage<[]>;
28
36
  readonly orderByProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
29
37
  readonly required: import("@typespec/compiler").CallableMessage<["decorator", "parameters"]>;
30
38
  readonly wrongType: import("@typespec/compiler").CallableMessage<["decorator", "target"]>;
39
+ readonly graphRoute: import("@typespec/compiler").CallableMessage<[]>;
40
+ readonly allowedValues: import("@typespec/compiler").CallableMessage<[]>;
41
+ readonly allowedValuesTypeHomogeinity: import("@typespec/compiler").CallableMessage<[]>;
42
+ readonly allowedValuesInvalidType: import("@typespec/compiler").CallableMessage<[]>;
43
+ readonly invalidPublicNamespaceName: import("@typespec/compiler").CallableMessage<["namespace"]>;
31
44
  };
32
45
  };
33
46
  readonly "singleton-invalid-name": {
@@ -49,6 +62,9 @@ export declare const libDef: {
49
62
  };
50
63
  };
51
64
  };
65
+ readonly emitter: {
66
+ readonly options: JSONSchemaType<MsGraphEmitterOptions>;
67
+ };
52
68
  };
53
69
  export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
54
70
  "decorator-missing-dependencies": {
@@ -59,16 +75,25 @@ export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
59
75
  readonly default: import("@typespec/compiler").CallableMessage<["element", "other", "location"]>;
60
76
  readonly operation: import("@typespec/compiler").CallableMessage<[]>;
61
77
  readonly collectionNavigationPropertiesNotNullable: "Collection-valued navigation properties cannot be nullable.";
78
+ readonly propertyRequiredForCreate: import("@typespec/compiler").CallableMessage<["property", "model"]>;
79
+ readonly modelMissingNamespace: import("@typespec/compiler").CallableMessage<["model"]>;
80
+ readonly operationParameterMismatch: import("@typespec/compiler").CallableMessage<["operation", "parameters"]>;
62
81
  };
63
82
  "decorator-invalid-use": {
64
83
  readonly default: import("@typespec/compiler").CallableMessage<["decorator", "other", "location"]>;
65
84
  readonly alternateKey: import("@typespec/compiler").CallableMessage<[]>;
66
85
  readonly disallowedTypeSpecDecorators: import("@typespec/compiler").CallableMessage<["decorator"]>;
67
86
  readonly expandProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
87
+ readonly filterProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
68
88
  readonly key: import("@typespec/compiler").CallableMessage<[]>;
69
89
  readonly orderByProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
70
90
  readonly required: import("@typespec/compiler").CallableMessage<["decorator", "parameters"]>;
71
91
  readonly wrongType: import("@typespec/compiler").CallableMessage<["decorator", "target"]>;
92
+ readonly graphRoute: import("@typespec/compiler").CallableMessage<[]>;
93
+ readonly allowedValues: import("@typespec/compiler").CallableMessage<[]>;
94
+ readonly allowedValuesTypeHomogeinity: import("@typespec/compiler").CallableMessage<[]>;
95
+ readonly allowedValuesInvalidType: import("@typespec/compiler").CallableMessage<[]>;
96
+ readonly invalidPublicNamespaceName: import("@typespec/compiler").CallableMessage<["namespace"]>;
72
97
  };
73
98
  "singleton-invalid-name": {
74
99
  readonly default: import("@typespec/compiler").CallableMessage<["value"]>;
@@ -79,7 +104,7 @@ export declare const $lib: import("@typespec/compiler").TypeSpecLibrary<{
79
104
  "use-evolvable-enum": {
80
105
  readonly default: import("@typespec/compiler").CallableMessage<["enum"]>;
81
106
  };
82
- }, Record<string, any>>;
107
+ }, MsGraphEmitterOptions>;
83
108
  export declare const reportDiagnostic: <C extends "decorator-missing-dependencies" | "element-missing-dependencies" | "decorator-invalid-use" | "singleton-invalid-name" | "extends-invalid-use" | "use-evolvable-enum", M extends keyof {
84
109
  "decorator-missing-dependencies": {
85
110
  readonly default: import("@typespec/compiler").CallableMessage<["decorator", "required", "location"]>;
@@ -89,16 +114,25 @@ export declare const reportDiagnostic: <C extends "decorator-missing-dependencie
89
114
  readonly default: import("@typespec/compiler").CallableMessage<["element", "other", "location"]>;
90
115
  readonly operation: import("@typespec/compiler").CallableMessage<[]>;
91
116
  readonly collectionNavigationPropertiesNotNullable: "Collection-valued navigation properties cannot be nullable.";
117
+ readonly propertyRequiredForCreate: import("@typespec/compiler").CallableMessage<["property", "model"]>;
118
+ readonly modelMissingNamespace: import("@typespec/compiler").CallableMessage<["model"]>;
119
+ readonly operationParameterMismatch: import("@typespec/compiler").CallableMessage<["operation", "parameters"]>;
92
120
  };
93
121
  "decorator-invalid-use": {
94
122
  readonly default: import("@typespec/compiler").CallableMessage<["decorator", "other", "location"]>;
95
123
  readonly alternateKey: import("@typespec/compiler").CallableMessage<[]>;
96
124
  readonly disallowedTypeSpecDecorators: import("@typespec/compiler").CallableMessage<["decorator"]>;
97
125
  readonly expandProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
126
+ readonly filterProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
98
127
  readonly key: import("@typespec/compiler").CallableMessage<[]>;
99
128
  readonly orderByProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
100
129
  readonly required: import("@typespec/compiler").CallableMessage<["decorator", "parameters"]>;
101
130
  readonly wrongType: import("@typespec/compiler").CallableMessage<["decorator", "target"]>;
131
+ readonly graphRoute: import("@typespec/compiler").CallableMessage<[]>;
132
+ readonly allowedValues: import("@typespec/compiler").CallableMessage<[]>;
133
+ readonly allowedValuesTypeHomogeinity: import("@typespec/compiler").CallableMessage<[]>;
134
+ readonly allowedValuesInvalidType: import("@typespec/compiler").CallableMessage<[]>;
135
+ readonly invalidPublicNamespaceName: import("@typespec/compiler").CallableMessage<["namespace"]>;
102
136
  };
103
137
  "singleton-invalid-name": {
104
138
  readonly default: import("@typespec/compiler").CallableMessage<["value"]>;
@@ -118,16 +152,25 @@ export declare const reportDiagnostic: <C extends "decorator-missing-dependencie
118
152
  readonly default: import("@typespec/compiler").CallableMessage<["element", "other", "location"]>;
119
153
  readonly operation: import("@typespec/compiler").CallableMessage<[]>;
120
154
  readonly collectionNavigationPropertiesNotNullable: "Collection-valued navigation properties cannot be nullable.";
155
+ readonly propertyRequiredForCreate: import("@typespec/compiler").CallableMessage<["property", "model"]>;
156
+ readonly modelMissingNamespace: import("@typespec/compiler").CallableMessage<["model"]>;
157
+ readonly operationParameterMismatch: import("@typespec/compiler").CallableMessage<["operation", "parameters"]>;
121
158
  };
122
159
  "decorator-invalid-use": {
123
160
  readonly default: import("@typespec/compiler").CallableMessage<["decorator", "other", "location"]>;
124
161
  readonly alternateKey: import("@typespec/compiler").CallableMessage<[]>;
125
162
  readonly disallowedTypeSpecDecorators: import("@typespec/compiler").CallableMessage<["decorator"]>;
126
163
  readonly expandProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
164
+ readonly filterProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
127
165
  readonly key: import("@typespec/compiler").CallableMessage<[]>;
128
166
  readonly orderByProperties: import("@typespec/compiler").CallableMessage<["properties", "model"]>;
129
167
  readonly required: import("@typespec/compiler").CallableMessage<["decorator", "parameters"]>;
130
168
  readonly wrongType: import("@typespec/compiler").CallableMessage<["decorator", "target"]>;
169
+ readonly graphRoute: import("@typespec/compiler").CallableMessage<[]>;
170
+ readonly allowedValues: import("@typespec/compiler").CallableMessage<[]>;
171
+ readonly allowedValuesTypeHomogeinity: import("@typespec/compiler").CallableMessage<[]>;
172
+ readonly allowedValuesInvalidType: import("@typespec/compiler").CallableMessage<[]>;
173
+ readonly invalidPublicNamespaceName: import("@typespec/compiler").CallableMessage<["namespace"]>;
131
174
  };
132
175
  "singleton-invalid-name": {
133
176
  readonly default: import("@typespec/compiler").CallableMessage<["value"]>;
@@ -1 +1 @@
1
- {"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS,qBAAqB,CAAC;AAE5C,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkDT,CAAC;AAEX,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAAgC,CAAC;AAClD,eAAO,MAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAS,CAAC"}
1
+ {"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAuC,MAAM,oBAAoB,CAAC;AAEzF,eAAO,MAAM,SAAS,YAAY,CAAC;AAEnC,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAeD,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA4DT,CAAC;AAEX,eAAO,MAAM,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;yBAAgC,CAAC;AAClD,eAAO,MAAQ,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAAS,CAAC"}
package/dist/src/lib.js CHANGED
@@ -1,5 +1,17 @@
1
1
  import { createTypeSpecLibrary, paramMessage } from "@typespec/compiler";
2
- export const namespace = "TypeSpec.MsGraph";
2
+ export const namespace = "MsGraph";
3
+ const EmitterOptionsSchema = {
4
+ type: "object",
5
+ additionalProperties: false,
6
+ properties: {
7
+ filename: {
8
+ type: "string",
9
+ nullable: true,
10
+ description: "The name of the generated CSDL file. If not specified, it defaults to `workload.csdl`."
11
+ },
12
+ },
13
+ required: [],
14
+ };
3
15
  export const libDef = {
4
16
  name: "@microsoft/typespec-msgraph",
5
17
  diagnostics: {
@@ -16,6 +28,9 @@ export const libDef = {
16
28
  default: paramMessage `The ${"element"} must be used together with ${"other"} on a ${"location"}.`,
17
29
  operation: paramMessage `Operations must be used inside interfaces.`,
18
30
  collectionNavigationPropertiesNotNullable: `Collection-valued navigation properties cannot be nullable.`,
31
+ propertyRequiredForCreate: paramMessage `The property "${"property"}" on "${"model"}" must be nullable, computed, have a default value or be annotated with @requiredForCreate.`,
32
+ modelMissingNamespace: paramMessage `The model "${"model"}" must be defined in a namespace.`,
33
+ operationParameterMismatch: paramMessage `The operation "${"operation"}" must declare the parameters "${"parameters"}", have a "graphRouteParams" parameter or use the porcelain syntax.`,
19
34
  },
20
35
  },
21
36
  "decorator-invalid-use": {
@@ -25,10 +40,16 @@ export const libDef = {
25
40
  alternateKey: paramMessage `The @alternateKey decorator can only be attached to a non-nullable primitive-typed property.`,
26
41
  disallowedTypeSpecDecorators: paramMessage `The decorator ${"decorator"} may not be used in MSGraph TypeSpec.`,
27
42
  expandProperties: paramMessage `The properties "${"properties"}" defined in the @expand decorator must be defined with @references or @contains in the referenced model "${"model"}" or its inheritance hierarchy.`,
43
+ filterProperties: paramMessage `The properties "${"properties"}" defined in the @filter decorator must be defined in the referenced model "${"model"}" or its inheritance hierarchy.`,
28
44
  key: paramMessage `The @key decorator can only be attached to a non-nullable primitive type.`,
29
45
  orderByProperties: paramMessage `The properties "${"properties"}" defined in the @orderBy decorator must not be defined with @references or @contains in the referenced model "${"model"}" or its inheritance hierarchy.`,
30
46
  required: paramMessage `The ${"decorator"} decorator must define required ${"parameters"}.`,
31
47
  wrongType: paramMessage `The ${"decorator"} decorator can only be applied to a ${"target"}.`,
48
+ graphRoute: paramMessage `@graphRoutes paths must not start with a /`,
49
+ allowedValues: paramMessage `The @allowedValues decorator cannot be empty.`,
50
+ allowedValuesTypeHomogeinity: paramMessage `The types of values passed to @allowedValues must be homegeneous.`,
51
+ allowedValuesInvalidType: paramMessage `The @allowedValues decorator can only be applied with primitive types.`,
52
+ invalidPublicNamespaceName: paramMessage `The @publicNamespace decorator value on namespace "${"namespace"}" should start with "microsoft.graph".`,
32
53
  },
33
54
  },
34
55
  "singleton-invalid-name": {
@@ -50,6 +71,7 @@ export const libDef = {
50
71
  },
51
72
  },
52
73
  },
74
+ emitter: { options: EmitterOptionsSchema },
53
75
  };
54
76
  export const $lib = createTypeSpecLibrary(libDef);
55
77
  export const { reportDiagnostic } = $lib;
@@ -1 +1 @@
1
- {"version":3,"file":"lib.js","sourceRoot":"","sources":["../../src/lib.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEzE,MAAM,CAAC,MAAM,SAAS,GAAG,kBAAkB,CAAC;AAE5C,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI,EAAE,6BAA6B;IACnC,WAAW,EAAE;QACX,gCAAgC,EAAE;YAChC,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,OAAO,WAAW,sDAAsD,UAAU,qBAAqB,UAAU,GAAG;gBACzI,QAAQ,EAAE,YAAY,CAAA,oFAAoF;aAC3G;SACF;QACD,8BAA8B,EAAE;YAC9B,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR,OAAO,EAAE,YAAY,CAAA,OAAO,SAAS,+BAA+B,OAAO,SAAS,UAAU,GAAG;gBACjG,SAAS,EAAE,YAAY,CAAA,4CAA4C;gBACnE,yCAAyC,EAAE,6DAA6D;aACzG;SACF;QACD,uBAAuB,EAAE;YACvB,QAAQ,EAAE,OAAO;YACjB,QAAQ,EAAE;gBACR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E,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAoC7C,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,QAG3C"}
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,QAG3C"}
@@ -15,10 +15,16 @@ linter.registerRules([
15
15
  theRules.expandOnlyNavigationPropertiesRule,
16
16
  theRules.expandOnlyOnGetNavigationSourceRule,
17
17
  theRules.extendsOnSameTypeRule,
18
+ theRules.filterAppliesToGetOperationsThatReturnCollectionsRule,
19
+ theRules.filterOnlyAppliesToModelPropertiesRule,
20
+ theRules.filterPropertiesMustNotBeEmptyRule,
18
21
  theRules.hasStreamOnlyOnEntity,
22
+ theRules.invalidPublicNamespaceNameRule,
19
23
  theRules.keyOnlyOnEntityNonNullablePrimitivePropertyRule,
24
+ theRules.namespaceIsRequiredRule,
20
25
  theRules.openOnlyAppliesToStructuredType,
21
26
  theRules.operationInsideInterfaceRule,
27
+ theRules.operationParametersMatchGraphRouteParametersRule,
22
28
  theRules.orderByOnlyNonNavigationPropertiesRule,
23
29
  theRules.orderByAppliesToGetOperationsThatReturnCollectionsRule,
24
30
  theRules.referencesOnlyAppliesToNavigationPropertyRule,
@@ -27,6 +33,8 @@ linter.registerRules([
27
33
  theRules.topAppliesToGetOperationsThatReturnCollectionsRule,
28
34
  theRules.useEvolvableEnumRule,
29
35
  theRules.voidFunctionRule,
36
+ theRules.allowedValuesCannotBeEmptyRule,
37
+ theRules.graphRouteLeadingSlashRule,
30
38
  ], { autoEnable: true });
31
39
  export function $onValidate(program) {
32
40
  linter.autoEnableRules();
@@ -1 +1 @@
1
- {"version":3,"file":"linter.js","sourceRoot":"","sources":["../../src/linter.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3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 /***
2
+ * @allowedValues can only be applied to string model properties
3
+ * @allowedValues cannot have empty values
4
+ */
5
+ export declare const allowedValuesCannotBeEmptyRule: import("@typespec/lint").LintRule;
6
+ //# sourceMappingURL=allowed-values.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"allowed-values.d.ts","sourceRoot":"","sources":["../../../src/rules/allowed-values.ts"],"names":[],"mappings":"AAIA;;;GAGG;AAEH,eAAO,MAAM,8BAA8B,mCAqDzC,CAAA"}
@@ -0,0 +1,59 @@
1
+ import { createRule } from "@typespec/lint";
2
+ import { getAllowedValues, hasAllowedValues, isAllowedValuesArgumentsEmpty, isAllowedValuesPrimitive } from "../index.js";
3
+ import { reportDiagnostic } from "../lib.js";
4
+ /***
5
+ * @allowedValues can only be applied to string model properties
6
+ * @allowedValues cannot have empty values
7
+ */
8
+ export const allowedValuesCannotBeEmptyRule = createRule({
9
+ name: "allowed-values-cannot-be-empty-rule",
10
+ create({ program }) {
11
+ return {
12
+ modelProperty: (property) => {
13
+ var _a;
14
+ if (!hasAllowedValues(program, property)) {
15
+ return;
16
+ }
17
+ if (isAllowedValuesArgumentsEmpty(program, property)) {
18
+ reportDiagnostic(program, {
19
+ code: "decorator-invalid-use",
20
+ target: property,
21
+ messageId: "allowedValues",
22
+ format: {
23
+ decorator: "@allowedValues"
24
+ },
25
+ });
26
+ }
27
+ const allowedValues = getAllowedValues(program, property);
28
+ if (((_a = allowedValues === null || allowedValues === void 0 ? void 0 : allowedValues.values) === null || _a === void 0 ? void 0 : _a.length) > 0) {
29
+ const values = allowedValues.values;
30
+ const expectedType = typeof values[0];
31
+ for (let i = 1; i < values.length; i++) {
32
+ if (typeof values[i] !== expectedType) {
33
+ reportDiagnostic(program, {
34
+ code: 'decorator-invalid-use',
35
+ target: property,
36
+ messageId: 'allowedValuesTypeHomogeinity',
37
+ format: {
38
+ decorator: '@allowedValues'
39
+ }
40
+ });
41
+ break;
42
+ }
43
+ }
44
+ }
45
+ if (!isAllowedValuesPrimitive(program, property)) {
46
+ reportDiagnostic(program, {
47
+ code: "decorator-invalid-use",
48
+ target: property,
49
+ messageId: "allowedValuesInvalidType",
50
+ format: {
51
+ decorator: "@allowedValues"
52
+ },
53
+ });
54
+ }
55
+ },
56
+ };
57
+ }
58
+ });
59
+ //# sourceMappingURL=allowed-values.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"allowed-values.js","sourceRoot":"","sources":["../../../src/rules/allowed-values.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAC1H,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C;;;GAGG;AAEH,MAAM,CAAC,MAAM,8BAA8B,GAAG,UAAU,CAAC;IACvD,IAAI,EAAE,qCAAqC;IAC3C,MAAM,CAAC,EAAE,OAAO,EAAE;QAChB,OAAO;YACL,aAAa,EAAE,CAAC,QAAQ,EAAE,EAAE;;gBAC1B,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE;oBACxC,OAAO;iBACR;gBAED,IAAG,6BAA6B,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAC;oBAClD,gBAAgB,CAAC,OAAO,EAAE;wBACxB,IAAI,EAAE,uBAAuB;wBAC7B,MAAM,EAAE,QAAQ;wBAChB,SAAS,EAAE,eAAe;wBAC1B,MAAM,EAAE;4BACN,SAAS,EAAE,gBAAgB;yBAC5B;qBACF,CAAC,CAAC;iBACJ;gBAED,MAAM,aAAa,GAAG,gBAAgB,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;gBAC1D,IAAG,CAAA,MAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,MAAM,0CAAE,MAAM,IAAG,CAAC,EAAC;oBACnC,MAAM,MAAM,GAAG,aAAa,CAAC,MAAM,CAAC;oBACpC,MAAM,YAAY,GAAG,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;oBACtC,KAAI,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,MAAM,CAAC,MAAM,EAAE,CAAC,EAAE,EAAC;wBAChC,IAAG,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,YAAY,EAAC;4BACnC,gBAAgB,CAAC,OAAO,EAAE;gCACxB,IAAI,EAAE,uBAAuB;gCAC7B,MAAM,EAAE,QAAQ;gCAChB,SAAS,EAAE,8BAA8B;gCACzC,MAAM,EAAE;oCACN,SAAS,EAAE,gBAAgB;iCAC5B;6BACF,CAAC,CAAC;4BACH,MAAM;yBACP;qBACF;iBACF;gBAED,IAAI,CAAC,wBAAwB,CAAC,OAAO,EAAE,QAAQ,CAAC,EAAE;oBAChD,gBAAgB,CAAC,OAAO,EAAE;wBACxB,IAAI,EAAE,uBAAuB;wBAC7B,MAAM,EAAE,QAAQ;wBAChB,SAAS,EAAE,0BAA0B;wBACrC,MAAM,EAAE;4BACN,SAAS,EAAE,gBAAgB;yBAC5B;qBACF,CAAC,CAAC;iBACJ;YAEH,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAA"}
@@ -0,0 +1,4 @@
1
+ export declare const filterAppliesToGetOperationsThatReturnCollectionsRule: import("@typespec/lint").LintRule;
2
+ export declare const filterOnlyAppliesToModelPropertiesRule: import("@typespec/lint").LintRule;
3
+ export declare const filterPropertiesMustNotBeEmptyRule: import("@typespec/lint").LintRule;
4
+ //# sourceMappingURL=filter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../src/rules/filter.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,qDAAqD,mCA6BhE,CAAC;AAEH,eAAO,MAAM,sCAAsC,mCAuCjD,CAAC;AAEH,eAAO,MAAM,kCAAkC,mCA0B7C,CAAC"}
@@ -0,0 +1,92 @@
1
+ import { createRule } from "@typespec/lint";
2
+ import { getFilter, isFilter } from "../index.js";
3
+ import { getOperationVerb } from "@typespec/http";
4
+ import { getNavigationSourceType, isTypeCollection } from "../utils.js";
5
+ import { reportDiagnostic } from "../lib.js";
6
+ import { walkPropertiesInherited } from "@typespec/compiler";
7
+ export const filterAppliesToGetOperationsThatReturnCollectionsRule = createRule({
8
+ name: "filter-applies-to-get-operations-that-return-collections",
9
+ create({ program }) {
10
+ return {
11
+ operation: (operation) => {
12
+ if (!isFilter(program, operation)) {
13
+ return;
14
+ }
15
+ if (getOperationVerb(program, operation) === "get") {
16
+ const returnType = operation.returnType;
17
+ const isCollection = isTypeCollection(program, returnType);
18
+ if (isCollection) {
19
+ return;
20
+ }
21
+ }
22
+ reportDiagnostic(program, {
23
+ code: "decorator-invalid-use",
24
+ target: operation,
25
+ messageId: "wrongType",
26
+ format: {
27
+ decorator: "@filter",
28
+ target: "get operation that returns a collection",
29
+ },
30
+ });
31
+ },
32
+ };
33
+ },
34
+ });
35
+ export const filterOnlyAppliesToModelPropertiesRule = createRule({
36
+ name: "filter-only-on-model-properties",
37
+ create({ program }) {
38
+ return {
39
+ operation: (operation) => {
40
+ if (!isFilter(program, operation)) {
41
+ return;
42
+ }
43
+ const returnType = getNavigationSourceType(program, operation);
44
+ if (!returnType) {
45
+ return;
46
+ }
47
+ const modelType = returnType.indexer ? returnType.indexer.value : returnType;
48
+ const filterProperties = getFilter(program, operation);
49
+ const modelProperties = [...walkPropertiesInherited(modelType)].map((property) => property.name);
50
+ const invalidFilterProperties = filterProperties.filter((property) => !modelProperties.includes(property));
51
+ if (!invalidFilterProperties.length) {
52
+ return;
53
+ }
54
+ reportDiagnostic(program, {
55
+ code: "decorator-invalid-use",
56
+ target: operation,
57
+ messageId: "filterProperties",
58
+ format: {
59
+ model: modelType.name,
60
+ properties: invalidFilterProperties.join(", "),
61
+ },
62
+ });
63
+ },
64
+ };
65
+ },
66
+ });
67
+ export const filterPropertiesMustNotBeEmptyRule = createRule({
68
+ name: "filter-properties-must-not-be-empty",
69
+ create({ program }) {
70
+ return {
71
+ operation: (operation) => {
72
+ if (!isFilter(program, operation)) {
73
+ return;
74
+ }
75
+ const filterProperties = getFilter(program, operation);
76
+ if (filterProperties.length) {
77
+ return;
78
+ }
79
+ reportDiagnostic(program, {
80
+ code: "decorator-invalid-use",
81
+ target: operation,
82
+ messageId: "required",
83
+ format: {
84
+ decorator: "@filter",
85
+ parameters: "filter properties",
86
+ },
87
+ });
88
+ },
89
+ };
90
+ },
91
+ });
92
+ //# sourceMappingURL=filter.js.map
@@ -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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,IAAI,EAAE,uBAAuB;oBAC7B,MAAM,EAAE,SAAS;oBACjB,SAAS,EAAE,kBAAkB;oBAC7B,MAAM,EAAE;wBACN,KAAK,EAAE,SAAS,CAAC,IAAI;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,6 @@
1
+ /**
2
+ * @graphRoute should not have a leading forward slash
3
+ */
4
+ export declare const graphRouteLeadingSlashRule: import("@typespec/lint").LintRule;
5
+ export declare const operationParametersMatchGraphRouteParametersRule: import("@typespec/lint").LintRule;
6
+ //# 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":"AAMA;;GAEG;AAEH,eAAO,MAAM,0BAA0B,mCAYrC,CAAC;AAyBH,eAAO,MAAM,gDAAgD,mCAY3D,CAAC"}
@@ -0,0 +1,88 @@
1
+ import { createRule } from "@typespec/lint";
2
+ import { reportDiagnostic } from "../lib.js";
3
+ import { extractParamsFromPath, getGraphRoutePaths, hasGraphRoute } from "../index.js";
4
+ import { getIdForType } from "../utils.js";
5
+ /**
6
+ * @graphRoute should not have a leading forward slash
7
+ */
8
+ export const graphRouteLeadingSlashRule = createRule({
9
+ name: "graph-route-leading-slash",
10
+ create({ program }) {
11
+ return {
12
+ interface: (interface_) => {
13
+ applyDiagnostics(program, interface_);
14
+ },
15
+ operation: (operation) => {
16
+ applyDiagnostics(program, operation);
17
+ },
18
+ };
19
+ },
20
+ });
21
+ const applyDiagnostics = (program, target) => {
22
+ if (!hasGraphRoute(program, target)) {
23
+ return;
24
+ }
25
+ const paths = getGraphRoutePaths(program, target);
26
+ if (paths === undefined) {
27
+ return;
28
+ }
29
+ for (const path of paths) {
30
+ if (path.startsWith("/")) {
31
+ reportDiagnostic(program, {
32
+ code: "decorator-invalid-use",
33
+ target: target,
34
+ messageId: "graphRoute",
35
+ format: {
36
+ decorator: "@graphRoute",
37
+ },
38
+ });
39
+ }
40
+ }
41
+ };
42
+ export const operationParametersMatchGraphRouteParametersRule = createRule({
43
+ name: "operation-parameters-match-graph-route-parameters",
44
+ create({ program }) {
45
+ return {
46
+ operation: (operation) => {
47
+ validateParametersForGraphRoute(program, operation);
48
+ },
49
+ interface: (theInterface) => {
50
+ validateParametersForGraphRoute(program, theInterface);
51
+ },
52
+ };
53
+ },
54
+ });
55
+ function validateParametersForGraphRoute(program, target) {
56
+ if (!hasGraphRoute(program, target)) {
57
+ return;
58
+ }
59
+ const routePaths = getGraphRoutePaths(program, target);
60
+ if (routePaths === undefined) {
61
+ return;
62
+ }
63
+ const operations = [];
64
+ if (target.kind === "Operation") {
65
+ operations.push(target);
66
+ }
67
+ else {
68
+ target.operations.forEach((operation) => operations.push(operation));
69
+ }
70
+ for (const operation of operations) {
71
+ for (const path of routePaths) {
72
+ const graphRouteParameters = extractParamsFromPath(path);
73
+ const missingParameters = graphRouteParameters.filter((param) => !operation.parameters.properties.has(param));
74
+ if (missingParameters.length) {
75
+ reportDiagnostic(program, {
76
+ code: "element-missing-dependencies",
77
+ target: operation,
78
+ messageId: "operationParameterMismatch",
79
+ format: {
80
+ operation: getIdForType(program, operation),
81
+ parameters: missingParameters.join(", "),
82
+ },
83
+ });
84
+ }
85
+ }
86
+ }
87
+ }
88
+ //# 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,qBAAqB,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAEvF,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;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,IAAI,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;QACnC,OAAO;KACR;IACD,MAAM,KAAK,GAAG,kBAAkB,CAAC,OAA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AI,CAAC,SAAS,CAAC,CAAC,CAAC;KACtE;IAED,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;QAClC,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE;YAC7B,MAAM,oBAAoB,GAAG,qBAAqB,CAAC,IAAI,CAAC,CAAC;YAEzD,MAAM,iBAAiB,GAAG,oBAAoB,CAAC,MAAM,CACnD,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,CACvD,CAAC;YAEF,IAAI,iBAAiB,CAAC,MAAM,EAAE;gBAC5B,gBAAgB,CAAC,OAAO,EAAE;oBACxB,IAAI,EAAE,8BAA8B;oBACpC,MAAM,EAAE,SAAS;oBACjB,SAAS,EAAE,4BAA4B;oBACvC,MAAM,EAAE;wBACN,SAAS,EAAE,YAAY,CAAC,OAAO,EAAE,SAAS,CAAC;wBAC3C,UAAU,EAAE,iBAAiB,CAAC,IAAI,CAAC,IAAI,CAAC;qBACzC;iBACF,CAAC,CAAC;aACJ;SACF;KACF;AACH,CAAC"}
@@ -9,13 +9,19 @@ export * from "./entity.js";
9
9
  export * from "./enum.js";
10
10
  export * from "./expand.js";
11
11
  export * from "./extends-on-same-type.js";
12
+ export * from "./filter.js";
12
13
  export * from "./function.js";
14
+ export * from "./graph-route.js";
13
15
  export * from "./has-stream.js";
16
+ export * from "./namespace.js";
14
17
  export * from "./open.js";
15
18
  export * from "./operation-inside-interface.js";
16
19
  export * from "./order-by.js";
17
20
  export * from "./references.js";
21
+ export * from "./required-for-create.js";
18
22
  export * from "./search.js";
19
23
  export * from "./skip.js";
20
24
  export * from "./top.js";
25
+ export * from "./allowed-values.js";
26
+ export * from "./graph-route.js";
21
27
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/rules/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAA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9,13 +9,19 @@ export * from "./entity.js";
9
9
  export * from "./enum.js";
10
10
  export * from "./expand.js";
11
11
  export * from "./extends-on-same-type.js";
12
+ export * from "./filter.js";
12
13
  export * from "./function.js";
14
+ export * from "./graph-route.js";
13
15
  export * from "./has-stream.js";
16
+ export * from "./namespace.js";
14
17
  export * from "./open.js";
15
18
  export * from "./operation-inside-interface.js";
16
19
  export * from "./order-by.js";
17
20
  export * from "./references.js";
21
+ export * from "./required-for-create.js";
18
22
  export * from "./search.js";
19
23
  export * from "./skip.js";
20
24
  export * from "./top.js";
25
+ export * from "./allowed-values.js";
26
+ export * from "./graph-route.js";
21
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","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,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,iCAAiC,CAAC;AAChD,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
1
+ {"version":3,"file":"index.js","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,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,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,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const namespaceIsRequiredRule: import("@typespec/lint").LintRule;
2
+ export declare const invalidPublicNamespaceNameRule: import("@typespec/lint").LintRule;
3
+ //# sourceMappingURL=namespace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"namespace.d.ts","sourceRoot":"","sources":["../../../src/rules/namespace.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,uBAAuB,mCA2BlC,CAAC;AAEH,eAAO,MAAM,8BAA8B,mCA6BzC,CAAC"}