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

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 (215) hide show
  1. package/dist/src/components/alternate-keys-annotation.js +4 -4
  2. package/dist/src/components/alternate-keys-annotation.js.map +1 -1
  3. package/dist/src/components/annotations.d.ts +9 -0
  4. package/dist/src/components/annotations.d.ts.map +1 -0
  5. package/dist/src/components/annotations.js +45 -0
  6. package/dist/src/components/annotations.js.map +1 -0
  7. package/dist/src/components/common-elements.d.ts +17 -4
  8. package/dist/src/components/common-elements.d.ts.map +1 -1
  9. package/dist/src/components/common-elements.js +2 -2
  10. package/dist/src/components/common-elements.js.map +1 -1
  11. package/dist/src/components/computed-annotation.js +1 -1
  12. package/dist/src/components/computed-annotation.js.map +1 -1
  13. package/dist/src/components/count-restrictions-annotation.d.ts.map +1 -1
  14. package/dist/src/components/count-restrictions-annotation.js +3 -8
  15. package/dist/src/components/count-restrictions-annotation.js.map +1 -1
  16. package/dist/src/components/description-annotation.d.ts.map +1 -1
  17. package/dist/src/components/description-annotation.js +1 -0
  18. package/dist/src/components/description-annotation.js.map +1 -1
  19. package/dist/src/components/entity-container-element.d.ts +18 -3
  20. package/dist/src/components/entity-container-element.d.ts.map +1 -1
  21. package/dist/src/components/entity-container-element.js +6 -42
  22. package/dist/src/components/entity-container-element.js.map +1 -1
  23. package/dist/src/components/enum-type-element.js +1 -1
  24. package/dist/src/components/enum-type-element.js.map +1 -1
  25. package/dist/src/components/expand-restrictions-annotation.d.ts.map +1 -1
  26. package/dist/src/components/expand-restrictions-annotation.js +7 -13
  27. package/dist/src/components/expand-restrictions-annotation.js.map +1 -1
  28. package/dist/src/components/operation-element.js +3 -3
  29. package/dist/src/components/operation-element.js.map +1 -1
  30. package/dist/src/components/schema-element.d.ts.map +1 -1
  31. package/dist/src/components/schema-element.js +6 -3
  32. package/dist/src/components/schema-element.js.map +1 -1
  33. package/dist/src/components/search-restrictions-annotation.d.ts.map +1 -1
  34. package/dist/src/components/search-restrictions-annotation.js +3 -8
  35. package/dist/src/components/search-restrictions-annotation.js.map +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 -6
  38. package/dist/src/components/skip-supported-annotation.js.map +1 -1
  39. package/dist/src/components/sort-restrictions-annotation.d.ts.map +1 -1
  40. package/dist/src/components/sort-restrictions-annotation.js +7 -13
  41. package/dist/src/components/sort-restrictions-annotation.js.map +1 -1
  42. package/dist/src/components/structured-type-element.d.ts +4 -7
  43. package/dist/src/components/structured-type-element.d.ts.map +1 -1
  44. package/dist/src/components/structured-type-element.js +21 -23
  45. package/dist/src/components/structured-type-element.js.map +1 -1
  46. package/dist/src/components/top-supported-annotation.d.ts.map +1 -1
  47. package/dist/src/components/top-supported-annotation.js +1 -4
  48. package/dist/src/components/top-supported-annotation.js.map +1 -1
  49. package/dist/src/components/update-restrictions-annotation.d.ts +5 -0
  50. package/dist/src/components/update-restrictions-annotation.d.ts.map +1 -0
  51. package/dist/src/components/update-restrictions-annotation.js +8 -0
  52. package/dist/src/components/update-restrictions-annotation.js.map +1 -0
  53. package/dist/src/decorators/{handlers/custom/additional-query-parameters.d.ts → additional-query-parameters.d.ts} +4 -3
  54. package/dist/src/decorators/additional-query-parameters.d.ts.map +1 -0
  55. package/dist/src/decorators/additional-query-parameters.js +21 -0
  56. package/dist/src/decorators/additional-query-parameters.js.map +1 -0
  57. package/dist/src/decorators/ags-attribute.d.ts +13 -0
  58. package/dist/src/decorators/ags-attribute.d.ts.map +1 -0
  59. package/dist/src/decorators/ags-attribute.js +68 -0
  60. package/dist/src/decorators/ags-attribute.js.map +1 -0
  61. package/dist/src/decorators/delta-collection.d.ts +8 -0
  62. package/dist/src/decorators/delta-collection.d.ts.map +1 -0
  63. package/dist/src/decorators/delta-collection.js +12 -0
  64. package/dist/src/decorators/delta-collection.js.map +1 -0
  65. package/dist/src/decorators/deprecated-definition.d.ts +3 -4
  66. package/dist/src/decorators/deprecated-definition.d.ts.map +1 -1
  67. package/dist/src/decorators/deprecated-definition.js +1 -7
  68. package/dist/src/decorators/deprecated-definition.js.map +1 -1
  69. package/dist/src/decorators/expand.d.ts +1 -2
  70. package/dist/src/decorators/expand.d.ts.map +1 -1
  71. package/dist/src/decorators/expand.js +1 -1
  72. package/dist/src/decorators/expand.js.map +1 -1
  73. package/dist/src/decorators/flags.d.ts +9 -0
  74. package/dist/src/decorators/flags.d.ts.map +1 -0
  75. package/dist/src/decorators/flags.js +13 -0
  76. package/dist/src/decorators/flags.js.map +1 -0
  77. package/dist/src/decorators/function.d.ts +1 -2
  78. package/dist/src/decorators/function.d.ts.map +1 -1
  79. package/dist/src/decorators/function.js +1 -1
  80. package/dist/src/decorators/function.js.map +1 -1
  81. package/dist/src/decorators/graph-route.d.ts +9 -0
  82. package/dist/src/decorators/graph-route.d.ts.map +1 -0
  83. package/dist/src/decorators/graph-route.js +84 -0
  84. package/dist/src/decorators/graph-route.js.map +1 -0
  85. package/dist/src/decorators/has-stream.d.ts +1 -2
  86. package/dist/src/decorators/has-stream.d.ts.map +1 -1
  87. package/dist/src/decorators/has-stream.js +1 -1
  88. package/dist/src/decorators/has-stream.js.map +1 -1
  89. package/dist/src/decorators/index.d.ts +10 -2
  90. package/dist/src/decorators/index.d.ts.map +1 -1
  91. package/dist/src/decorators/index.js +10 -2
  92. package/dist/src/decorators/index.js.map +1 -1
  93. package/dist/src/decorators/is-owner.d.ts +9 -0
  94. package/dist/src/decorators/is-owner.d.ts.map +1 -0
  95. package/dist/src/decorators/is-owner.js +14 -0
  96. package/dist/src/decorators/is-owner.js.map +1 -0
  97. package/dist/src/decorators/order-by.d.ts +1 -2
  98. package/dist/src/decorators/order-by.d.ts.map +1 -1
  99. package/dist/src/decorators/order-by.js +1 -1
  100. package/dist/src/decorators/order-by.js.map +1 -1
  101. package/dist/src/decorators/paged-collection.d.ts +8 -0
  102. package/dist/src/decorators/paged-collection.d.ts.map +1 -0
  103. package/dist/src/decorators/paged-collection.js +12 -0
  104. package/dist/src/decorators/paged-collection.js.map +1 -0
  105. package/dist/src/decorators/private-preview-definition.d.ts +3 -4
  106. package/dist/src/decorators/private-preview-definition.d.ts.map +1 -1
  107. package/dist/src/decorators/private-preview-definition.js +1 -6
  108. package/dist/src/decorators/private-preview-definition.js.map +1 -1
  109. package/dist/src/decorators/private-preview.d.ts +1 -2
  110. package/dist/src/decorators/private-preview.d.ts.map +1 -1
  111. package/dist/src/decorators/private-preview.js +1 -1
  112. package/dist/src/decorators/private-preview.js.map +1 -1
  113. package/dist/src/decorators/privileged.d.ts +9 -0
  114. package/dist/src/decorators/privileged.d.ts.map +1 -0
  115. package/dist/src/decorators/privileged.js +13 -0
  116. package/dist/src/decorators/privileged.js.map +1 -0
  117. package/dist/src/decorators/workload-name-msa.d.ts +9 -0
  118. package/dist/src/decorators/workload-name-msa.d.ts.map +1 -0
  119. package/dist/src/decorators/workload-name-msa.js +13 -0
  120. package/dist/src/decorators/workload-name-msa.js.map +1 -0
  121. package/dist/src/decorators/workload-name.d.ts +9 -0
  122. package/dist/src/decorators/workload-name.d.ts.map +1 -0
  123. package/dist/src/decorators/workload-name.js +13 -0
  124. package/dist/src/decorators/workload-name.js.map +1 -0
  125. package/dist/src/entities/annotations.d.ts +31 -0
  126. package/dist/src/entities/annotations.d.ts.map +1 -0
  127. package/dist/src/entities/annotations.js +99 -0
  128. package/dist/src/entities/annotations.js.map +1 -0
  129. package/dist/src/entities/entity-container.d.ts +4 -24
  130. package/dist/src/entities/entity-container.d.ts.map +1 -1
  131. package/dist/src/entities/entity-container.js +30 -120
  132. package/dist/src/entities/entity-container.js.map +1 -1
  133. package/dist/src/entities/enum.d.ts +1 -0
  134. package/dist/src/entities/enum.d.ts.map +1 -1
  135. package/dist/src/entities/enum.js +5 -3
  136. package/dist/src/entities/enum.js.map +1 -1
  137. package/dist/src/entities/model.d.ts +12 -22
  138. package/dist/src/entities/model.d.ts.map +1 -1
  139. package/dist/src/entities/model.js +64 -101
  140. package/dist/src/entities/model.js.map +1 -1
  141. package/dist/src/entities/namespace.d.ts +8 -3
  142. package/dist/src/entities/namespace.d.ts.map +1 -1
  143. package/dist/src/entities/namespace.js +31 -13
  144. package/dist/src/entities/namespace.js.map +1 -1
  145. package/dist/src/entities/operation.d.ts +2 -2
  146. package/dist/src/entities/operation.d.ts.map +1 -1
  147. package/dist/src/entities/operation.js +30 -14
  148. package/dist/src/entities/operation.js.map +1 -1
  149. package/dist/src/linter.d.ts.map +1 -1
  150. package/dist/src/linter.js +25 -25
  151. package/dist/src/linter.js.map +1 -1
  152. package/dist/src/rules/count.d.ts.map +1 -1
  153. package/dist/src/rules/count.js +3 -1
  154. package/dist/src/rules/count.js.map +1 -1
  155. package/dist/src/rules/entity.d.ts.map +1 -1
  156. package/dist/src/rules/entity.js +4 -1
  157. package/dist/src/rules/entity.js.map +1 -1
  158. package/dist/src/rules/expand.d.ts.map +1 -1
  159. package/dist/src/rules/expand.js +5 -7
  160. package/dist/src/rules/expand.js.map +1 -1
  161. package/dist/src/rules/index.d.ts.map +1 -1
  162. package/dist/src/rules/index.js +1 -0
  163. package/dist/src/rules/index.js.map +1 -1
  164. package/dist/src/rules/order-by.d.ts +1 -1
  165. package/dist/src/rules/order-by.d.ts.map +1 -1
  166. package/dist/src/rules/order-by.js +11 -10
  167. package/dist/src/rules/order-by.js.map +1 -1
  168. package/dist/src/rules/search.d.ts.map +1 -1
  169. package/dist/src/rules/search.js +3 -1
  170. package/dist/src/rules/search.js.map +1 -1
  171. package/dist/src/rules/skip.d.ts.map +1 -1
  172. package/dist/src/rules/skip.js +3 -1
  173. package/dist/src/rules/skip.js.map +1 -1
  174. package/dist/src/rules/top.d.ts.map +1 -1
  175. package/dist/src/rules/top.js +3 -1
  176. package/dist/src/rules/top.js.map +1 -1
  177. package/dist/src/utils.d.ts +16 -0
  178. package/dist/src/utils.d.ts.map +1 -1
  179. package/dist/src/utils.js +87 -1
  180. package/dist/src/utils.js.map +1 -1
  181. package/lib/decorators.tsp +97 -14
  182. package/lib/deployment.tsp +18 -0
  183. package/lib/lib.tsp +9 -14
  184. package/lib/msgraph.tsp +4 -0
  185. package/lib/porcelain.tsp +135 -0
  186. package/lib/responses.tsp +82 -0
  187. package/lib/shared-models.tsp +74 -0
  188. package/package.json +1 -2
  189. package/dist/src/decorators/attribute-builder.d.ts +0 -2
  190. package/dist/src/decorators/attribute-builder.d.ts.map +0 -1
  191. package/dist/src/decorators/attribute-builder.js +0 -166
  192. package/dist/src/decorators/attribute-builder.js.map +0 -1
  193. package/dist/src/decorators/attributes.d.ts +0 -57
  194. package/dist/src/decorators/attributes.d.ts.map +0 -1
  195. package/dist/src/decorators/attributes.js +0 -50
  196. package/dist/src/decorators/attributes.js.map +0 -1
  197. package/dist/src/decorators/decorator-parameter.d.ts +0 -4
  198. package/dist/src/decorators/decorator-parameter.d.ts.map +0 -1
  199. package/dist/src/decorators/decorator-parameter.js +0 -2
  200. package/dist/src/decorators/decorator-parameter.js.map +0 -1
  201. package/dist/src/decorators/handlers/custom/additional-query-parameters.d.ts.map +0 -1
  202. package/dist/src/decorators/handlers/custom/additional-query-parameters.js +0 -38
  203. package/dist/src/decorators/handlers/custom/additional-query-parameters.js.map +0 -1
  204. package/dist/src/decorators/handlers/custom/ags-attribute.d.ts +0 -8
  205. package/dist/src/decorators/handlers/custom/ags-attribute.d.ts.map +0 -1
  206. package/dist/src/decorators/handlers/custom/ags-attribute.js +0 -36
  207. package/dist/src/decorators/handlers/custom/ags-attribute.js.map +0 -1
  208. package/dist/src/decorators/handlers/custom/index.d.ts +0 -3
  209. package/dist/src/decorators/handlers/custom/index.d.ts.map +0 -1
  210. package/dist/src/decorators/handlers/custom/index.js +0 -3
  211. package/dist/src/decorators/handlers/custom/index.js.map +0 -1
  212. package/dist/src/decorators/handlers/index.d.ts +0 -31
  213. package/dist/src/decorators/handlers/index.d.ts.map +0 -1
  214. package/dist/src/decorators/handlers/index.js +0 -121
  215. package/dist/src/decorators/handlers/index.js.map +0 -1
@@ -0,0 +1,99 @@
1
+ import { getDoc, walkPropertiesInherited } from "@typespec/compiler";
2
+ import { getInterfaceNavigationSourceType } from "../utils.js";
3
+ import { getOperationVerb } from "@typespec/http";
4
+ import { getExpand, getOrderBy, isContains, isCount, isExpand, isOrderBy, isReferences, isSearch, isSkip, isTop } from "../index.js";
5
+ export function GetSingletonAnnotations(program, namespaceName, navigationSources) {
6
+ const annotations = new Map();
7
+ navigationSources.forEach((entity, routePath) => {
8
+ annotations.set(routePath, getSingletonAnnotations(program, namespaceName, routePath, entity));
9
+ });
10
+ return annotations;
11
+ }
12
+ function getSingletonAnnotations(program, namespaceName, routePath, entity) {
13
+ const singleton = entity.theInterface;
14
+ const type = getInterfaceNavigationSourceType(program, singleton);
15
+ const operationMethods = [...entity.operations].map(operation => ({
16
+ operation,
17
+ verb: getOperationVerb(program, operation),
18
+ }));
19
+ const [hasExpandOperation, nonExpandableProperties] = getExpandProperties(program, type, singleton);
20
+ const annotations = {
21
+ Target: `${namespaceName}.container/${routePath}`,
22
+ HasGetOnItem: operationMethods.some(({ verb }) => verb === "get"),
23
+ HasPatchOnItem: operationMethods.some(({ verb }) => verb === "patch"),
24
+ HasDeleteOnItem: operationMethods.some(({ verb }) => verb === "delete"),
25
+ HasExpandOperation: hasExpandOperation,
26
+ NonExpandableProperties: nonExpandableProperties,
27
+ Description: getDoc(program, singleton),
28
+ };
29
+ return annotations;
30
+ }
31
+ export function GetEntitySetAnnotations(program, namespaceName, sources) {
32
+ const annotations = new Map();
33
+ sources.forEach((entity, routePath) => {
34
+ annotations.set(routePath, getEntitySetAnnotations(program, namespaceName, routePath, entity));
35
+ });
36
+ return annotations;
37
+ }
38
+ function getEntitySetAnnotations(program, namespaceName, routePath, entity) {
39
+ const entitySet = entity.theInterface;
40
+ const type = getInterfaceNavigationSourceType(program, entitySet);
41
+ const operationMethods = entity.operations.map(operation => ({
42
+ operation,
43
+ verb: getOperationVerb(program, operation),
44
+ hasEmptyParameters: operation.parameters.properties.size === 0,
45
+ }));
46
+ const [hasExpandOperation, nonExpandableProperties] = getExpandProperties(program, type, entitySet);
47
+ const [hasSortOperation, nonSortableProperties] = getSortProperties(program, type, entitySet);
48
+ const annotations = {
49
+ Target: `${namespaceName}.container/${routePath}`,
50
+ HasGetOnCollection: operationMethods.some(({ verb, hasEmptyParameters }) => hasEmptyParameters && verb === "get"),
51
+ HasGetOnItem: operationMethods.some(({ verb, hasEmptyParameters }) => !hasEmptyParameters && verb === "get"),
52
+ HasPostOnCollection: operationMethods.some(({ verb }) => verb === "post"),
53
+ HasPatchOnItem: operationMethods.some(({ verb, hasEmptyParameters }) => !hasEmptyParameters && verb === "patch"),
54
+ HasDeleteOnItem: operationMethods.some(({ verb, hasEmptyParameters }) => !hasEmptyParameters && verb === "delete"),
55
+ HasCountOperation: operationMethods.some(({ operation }) => isCount(program, operation)),
56
+ HasSearchOperation: operationMethods.some(({ operation }) => isSearch(program, operation)),
57
+ HasSkipOperation: operationMethods.some(({ operation }) => isSkip(program, operation)),
58
+ HasExpandOperation: hasExpandOperation,
59
+ NonExpandableProperties: nonExpandableProperties,
60
+ HasSortOperation: hasSortOperation,
61
+ NonSortableProperties: nonSortableProperties,
62
+ HasTopOperation: operationMethods.some(({ operation }) => isTop(program, operation)),
63
+ Description: getDoc(program, entitySet),
64
+ };
65
+ return annotations;
66
+ }
67
+ function getExpandProperties(program, type, entity) {
68
+ const expandedOperation = [...entity.operations].find(([_, operation]) => getOperationVerb(program, operation) === "get" &&
69
+ operation.parameters.properties.size === 0 &&
70
+ isExpand(program, operation));
71
+ if (expandedOperation) {
72
+ // Destructuring to get the operation from the [string, Operation] expandedOperation tuple
73
+ const [_, operation] = expandedOperation;
74
+ const expandableProperties = getExpand(program, operation);
75
+ const navigationProperties = [...walkPropertiesInherited(type)]
76
+ .filter((property) => isContains(program, property) || isReferences(program, property))
77
+ .map((property) => property.name);
78
+ const nonExpandableProperties = navigationProperties.filter((property) => { var _a; return (_a = !(expandableProperties === null || expandableProperties === void 0 ? void 0 : expandableProperties.includes(property))) !== null && _a !== void 0 ? _a : false; });
79
+ return [true, nonExpandableProperties];
80
+ }
81
+ return [false, undefined];
82
+ }
83
+ function getSortProperties(program, type, entity) {
84
+ const sortOperation = [...entity.operations].find(([_, operation]) => getOperationVerb(program, operation) === "get" &&
85
+ operation.parameters.properties.size === 0 &&
86
+ isOrderBy(program, operation));
87
+ if (sortOperation) {
88
+ // Destructuring to get the operation from the [string, Operation] orderedOperation tuple
89
+ const [_, operation] = sortOperation;
90
+ const sortableProperties = getOrderBy(program, operation);
91
+ const nonNavigationProperties = [...walkPropertiesInherited(type)]
92
+ .filter((property) => !isContains(program, property) && !isReferences(program, property))
93
+ .map((property) => property.name);
94
+ const nonSortableProperties = nonNavigationProperties.filter((property) => !sortableProperties.includes(property));
95
+ return [true, nonSortableProperties];
96
+ }
97
+ return [false, undefined];
98
+ }
99
+ //# sourceMappingURL=annotations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"annotations.js","sourceRoot":"","sources":["../../../src/entities/annotations.ts"],"names":[],"mappings":"AAAA,OAAO,EAA6B,MAAM,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,EAAoB,gCAAgC,EAAE,MAAM,aAAa,CAAC;AACjF,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AA8BrI,MAAM,UAAU,uBAAuB,CAAC,OAAgB,EAAE,aAAqB,EAAE,iBAAgD;IAC/H,MAAM,WAAW,GAAG,IAAI,GAAG,EAAgC,CAAC;IAE5D,iBAAiB,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE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E,SAAS,CAAC,CAAA;AAC3B,CAAC;AAED,SAAS,iBAAiB,CAAC,OAAgB,EAAE,IAAW,EAAE,MAAiB;IACzE,MAAM,aAAa,GAAG,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,IAAI,CAC/C,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,EAAE,EAAE,CACjB,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAC,KAAK,KAAK;QAC9C,SAAS,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC;QAC1C,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,CAChC,CAAC;IAEF,IAAI,aAAa,EAAE;QACjB,yFAAyF;QACzF,MAAM,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,aAAa,CAAC;QACrC,MAAM,kBAAkB,GAAG,UAAU,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;QAE1D,MAAM,uBAAuB,GAAG,CAAC,GAAG,uBAAuB,CAAC,IAAI,CAAC,CAAC;aAC/D,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;aACxF,GAAG,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAEpC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,kBAAkB,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;QAEnH,OAAO,CAAC,IAAI,EAAE,qBAAqB,CAAC,CAAC;KACtC;IAED,OAAO,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AAC5B,CAAC"}
@@ -1,35 +1,15 @@
1
- import { Program, Namespace } from "@typespec/compiler";
2
- export interface EntityContainer {
3
- AgsAttributes: Record<string, string>;
4
- SingletonElements: Singleton[];
5
- EntitySetElements: EntitySet[];
6
- }
1
+ import { Program } from "@typespec/compiler";
2
+ import { MsGraphInterface } from "../utils.js";
7
3
  export interface Singleton {
8
4
  Name: string | undefined;
9
5
  TypeName: string;
10
6
  AgsAttributes: Record<string, string>;
11
- HasExpandOperation: boolean;
12
- NonExpandableProperties: string[] | undefined;
13
- Description: string | undefined;
14
7
  }
15
8
  export interface EntitySet {
16
9
  Name: string | undefined;
17
10
  TypeName: string;
18
11
  AgsAttributes: Record<string, string | boolean | undefined>;
19
- HasGetOnCollection: boolean;
20
- HasGetOnItem: boolean;
21
- HasPostOnCollection: boolean;
22
- HasPatchOnItem: boolean;
23
- HasDeleteOnItem: boolean;
24
- HasCountOperation: boolean;
25
- HasExpandOperation: boolean;
26
- NonExpandableProperties: string[] | undefined;
27
- HasSearchOperation: boolean;
28
- HasSkipOperation: boolean;
29
- HasSortOperation: boolean;
30
- NonSortableProperties: string[] | undefined;
31
- HasTopOperation: boolean;
32
- Description: string | undefined;
33
12
  }
34
- export declare function GetEntityContainer(program: Program, namespace: Namespace): EntityContainer;
13
+ export declare function GetSingletons(program: Program, sources: Map<string, MsGraphInterface>): Map<string, Singleton>;
14
+ export declare function GetEntitySets(program: Program, sources: Map<string, MsGraphInterface>): Map<string, EntitySet>;
35
15
  //# sourceMappingURL=entity-container.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"entity-container.d.ts","sourceRoot":"","sources":["../../../src/entities/entity-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAsE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAK3H,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACrC,iBAAiB,EAAE,SAAS,EAAE,CAAA;IAC9B,iBAAiB,EAAE,SAAS,EAAE,CAAA;CAC/B;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;IACxB,QAAQ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AAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACvC;AAED,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;CAC7D;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAQ9G;AAkBD,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAQ9G"}
@@ -1,132 +1,42 @@
1
- import { getDoc, walkPropertiesInherited } from "@typespec/compiler";
2
- import { getRoutePath, getOperationVerb } from "@typespec/http";
3
- import { buildAttributes, isExpand, getExpand, isContains, isReferences, isCount, isSearch, isSkip, isTop, isOrderBy, getOrderBy } from "../index.js";
4
- import { getPropertyTypeName } from "../utils.js";
5
- export function GetEntityContainer(program, namespace) {
6
- const navigationSources = [...namespace.interfaces]
7
- .filter(([_, $interface]) => $interface.operations.has("_isNavigationSource"))
8
- .map(([_, $interface]) => [
9
- $interface.operations.get("_isNavigationSource").returnType,
10
- $interface,
11
- ]);
12
- const entityContainer = {
13
- AgsAttributes: buildAttributes(program, namespace),
14
- SingletonElements: getMsGraphSingletonElements(program, navigationSources),
15
- EntitySetElements: getMsGraphEntitySetElements(program, navigationSources),
16
- };
17
- return entityContainer;
18
- }
19
- function getMsGraphSingletonElements(program, navigationSources) {
20
- const singletons = navigationSources
21
- .filter(([returnType, _]) => returnType.kind === "Model" && returnType.name !== "Array")
22
- .map(([_, $interface]) => $interface);
23
- const elements = singletons.map(singleton => getMsGraphSingletonElement(program, singleton));
24
- return elements;
1
+ import { buildAttributes } from "../decorators/ags-attribute.js";
2
+ import { getPropertyTypeName, getInterfaceNavigationSourceType, } from "../utils.js";
3
+ export function GetSingletons(program, sources) {
4
+ const singletons = new Map();
5
+ sources.forEach((entity, routePath) => {
6
+ singletons.set(routePath, getSingleton(program, routePath, entity));
7
+ });
8
+ return singletons;
25
9
  }
26
- function getMsGraphSingletonElement(program, singleton) {
27
- const routePath = getRoutePath(program, singleton);
28
- const type = singleton.operations.get("_isNavigationSource").returnType;
29
- const element = {
30
- Name: routePath === null || routePath === void 0 ? void 0 : routePath.path.split("/")[0],
10
+ function getSingleton(program, routePath, entity) {
11
+ const singleton = entity.theInterface;
12
+ const type = getInterfaceNavigationSourceType(program, singleton);
13
+ const agsAttributes = { ...getOperationAgsAttributes(program, entity.operations), ...buildAttributes(program, singleton) };
14
+ const entry = {
15
+ Name: routePath,
31
16
  TypeName: getPropertyTypeName(program, type),
32
- AgsAttributes: buildAttributes(program, singleton),
33
- HasExpandOperation: false,
34
- NonExpandableProperties: undefined,
35
- Description: getDoc(program, singleton)
17
+ AgsAttributes: agsAttributes,
36
18
  };
37
- const expandedOperation = [...singleton.operations].find(([_, operation]) => getOperationVerb(program, operation) === "get" &&
38
- operation.parameters.properties.size === 0 &&
39
- isExpand(program, operation));
40
- if (expandedOperation) {
41
- element.HasExpandOperation = true;
42
- // Destructuring to get the operation from the [string, Operation] expandedOperation tuple
43
- const [_, operation] = expandedOperation;
44
- const expandableProperties = getExpand(program, operation);
45
- const navigationProperties = [...walkPropertiesInherited(type)]
46
- .filter((property) => isContains(program, property) || isReferences(program, property))
47
- .map((property) => property.name);
48
- element.NonExpandableProperties = navigationProperties.filter(property => { var _a; return (_a = !(expandableProperties === null || expandableProperties === void 0 ? void 0 : expandableProperties.includes(property))) !== null && _a !== void 0 ? _a : false; });
49
- }
50
- return element;
19
+ return entry;
51
20
  }
52
- function getMsGraphEntitySetElements(program, navigationSources) {
53
- const entitySets = navigationSources
54
- .filter(([returnType, _]) => returnType.kind === "Model" && returnType.name === "Array")
55
- .reduce((map, [_, item]) => {
56
- var _a;
57
- const key = (_a = getRoutePath(program, item)) === null || _a === void 0 ? void 0 : _a.path.split("/")[0];
58
- if (!key) {
59
- return map;
60
- }
61
- const items = [...(map.get(key) || []), ...item.operations.values()];
62
- map.set(key, items);
63
- return map;
64
- }, new Map());
65
- const elements = [...entitySets]
66
- .map(([_, operations]) => getMsGraphEntitySetElement(program, operations))
67
- .filter((element) => !!element);
68
- return elements;
21
+ export function GetEntitySets(program, sources) {
22
+ const entitySets = new Map();
23
+ sources.forEach((entity, routePath) => {
24
+ entitySets.set(routePath, getEntitySet(program, routePath, entity));
25
+ });
26
+ return entitySets;
69
27
  }
70
- function getMsGraphEntitySetElement(program, operations) {
71
- var _a;
72
- const entitySet = operations[0].interface;
73
- if (entitySet === undefined) {
74
- return undefined;
75
- }
76
- let agsAttributes = operations.reduce((attr, item) => ({ ...attr, ...buildAttributes(program, item) }), {});
77
- agsAttributes = { ...agsAttributes, ...buildAttributes(program, entitySet) };
78
- const returnType = entitySet.operations.get("_isNavigationSource").returnType;
79
- const type = returnType.indexer.value;
80
- const operationMethods = operations.map((operation) => ({
81
- operation,
82
- verb: getOperationVerb(program, operation),
83
- hasEmptyParameters: operation.parameters.properties.size === 0,
84
- }));
28
+ function getEntitySet(program, routePath, entity) {
29
+ const entitySet = entity.theInterface;
30
+ const type = getInterfaceNavigationSourceType(program, entitySet);
31
+ const agsAttributes = { ...getOperationAgsAttributes(program, entity.operations), ...buildAttributes(program, entitySet) };
85
32
  const entry = {
86
- Name: (_a = getRoutePath(program, entitySet)) === null || _a === void 0 ? void 0 : _a.path.split("/")[0],
33
+ Name: routePath,
87
34
  TypeName: getPropertyTypeName(program, type),
88
35
  AgsAttributes: agsAttributes,
89
- HasGetOnCollection: operationMethods.some(({ verb, hasEmptyParameters }) => hasEmptyParameters && verb === "get"),
90
- HasGetOnItem: operationMethods.some(({ verb, hasEmptyParameters }) => !hasEmptyParameters && verb === "get"),
91
- HasPostOnCollection: operationMethods.some(({ verb }) => verb === "post"),
92
- HasPatchOnItem: operationMethods.some(({ verb }) => verb === "patch"),
93
- HasDeleteOnItem: operationMethods.some(({ verb }) => verb === "delete"),
94
- HasCountOperation: [...entitySet.operations].some(([_, operation]) => isCount(program, operation)),
95
- HasExpandOperation: false,
96
- NonExpandableProperties: undefined,
97
- HasSearchOperation: [...entitySet.operations].some(([_, operation]) => isSearch(program, operation)),
98
- HasSkipOperation: [...entitySet.operations].some(([_, operation]) => isSkip(program, operation)),
99
- HasSortOperation: false,
100
- NonSortableProperties: undefined,
101
- HasTopOperation: [...entitySet.operations].some(([_, operation]) => isTop(program, operation)),
102
- Description: getDoc(program, entitySet),
103
36
  };
104
- const expandedOperation = [...entitySet.operations].find(([_, operation]) => getOperationVerb(program, operation) === "get" &&
105
- operation.parameters.properties.size === 0 &&
106
- isExpand(program, operation));
107
- if (expandedOperation) {
108
- entry.HasExpandOperation = true;
109
- // Destructuring to get the operation from the [string, Operation] expandedOperation tuple
110
- const [_, operation] = expandedOperation;
111
- const expandableProperties = getExpand(program, operation);
112
- const navigationProperties = [...walkPropertiesInherited(type)]
113
- .filter((property) => isContains(program, property) || isReferences(program, property))
114
- .map((property) => property.name);
115
- entry.NonExpandableProperties = navigationProperties.filter(property => { var _a; return (_a = !(expandableProperties === null || expandableProperties === void 0 ? void 0 : expandableProperties.includes(property))) !== null && _a !== void 0 ? _a : false; });
116
- }
117
- const sortOperation = [...entitySet.operations].find(([_, operation]) => getOperationVerb(program, operation) === "get" &&
118
- operation.parameters.properties.size === 0 &&
119
- isOrderBy(program, operation));
120
- if (sortOperation) {
121
- entry.HasSortOperation = true;
122
- // Destructuring to get the operation from the [string, Operation] orderedOperation tuple
123
- const [_, operation] = sortOperation;
124
- const sortableProperties = getOrderBy(program, operation);
125
- const nonNavigationProperties = [...walkPropertiesInherited(type)]
126
- .filter((property) => !isContains(program, property) && !isReferences(program, property))
127
- .map((property) => property.name);
128
- entry.NonSortableProperties = nonNavigationProperties.filter((property) => !sortableProperties.includes(property));
129
- }
130
37
  return entry;
131
38
  }
39
+ function getOperationAgsAttributes(program, operations) {
40
+ return operations.reduce((attr, item) => ({ ...attr, ...buildAttributes(program, item) }), {});
41
+ }
132
42
  //# sourceMappingURL=entity-container.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"entity-container.js","sourceRoot":"","sources":["../../../src/entities/entity-container.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,MAAM,EAAE,uBAAuB,EAAyC,MAAM,oBAAoB,CAAA;AAC3H,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAC/D,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AACrJ,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAA;AAqCjD,MAAM,UAAU,kBAAkB,CAAC,OAAgB,EAAE,SAAoB;IACvE,MAAM,iBAAiB,GAAwB,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC;SACrE,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;SAC7E,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,EAAqB,EAAE,CAAC;QAC3C,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC,qBAAqB,CAAE,CAAC,UAAU;QAC5D,UAAU;KACX,CAAC,CAAC;IAEL,MAAM,eAAe,GAAoB;QACvC,aAAa,EAAE,eAAe,CAAC,OAAO,EAAE,SAAS,CAAC;QAClD,iBAAiB,EAAE,2BAA2B,CAA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UAAuB;IAC1E,OAAO,UAAU,CAAC,MAAM,CACtB,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,IAAI,EAAE,GAAG,eAAe,CAAC,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,EAChE,EAAE,CACH,CAAC;AACJ,CAAC"}
@@ -5,6 +5,7 @@ export interface MsGraphEnum {
5
5
  AgsAttributes: Record<string, string>;
6
6
  RevisionDefinition: RevisionDefinition | undefined;
7
7
  Elements: MsGraphEnumMember[];
8
+ IsFlags: boolean | undefined;
8
9
  }
9
10
  export interface MsGraphEnumMember {
10
11
  Name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../../src/entities/enum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAc,MAAM,oBAAoB,CAAA;AAE9D,OAAO,EAAyB,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAEpF,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACrC,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,CAAA;IAClD,QAAQ,EAAE,iBAAiB,EAAE,CAAA;CAC9B;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAA;IAClC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IACrC,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,CAAA;CACnD;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,GAAG,WAAW,CASvF"}
1
+ {"version":3,"file":"enum.d.ts","sourceRoot":"","sources":["../../../src/entities/enum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAc,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAyB,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAIrF,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACnD,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,OAAO,EAAE,OAAO,GAAG,SAAS,CAAC;CAC9B;AAED,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACnC,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,kBAAkB,EAAE,kBAAkB,GAAG,SAAS,CAAC;CACpD;AAED,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,GAAG,WAAW,CAUvF"}
@@ -1,11 +1,13 @@
1
- import { buildAttributes } from "../index.js";
2
1
  import { GetRevisionDefinition } from "./revision-definition.js";
2
+ import { buildAttributes } from "../decorators/ags-attribute.js";
3
+ import { isFlags } from "../index.js";
3
4
  export function GetMsGraphEnumTypeElement(program, enumType) {
4
5
  const element = {
5
6
  Name: enumType.name,
6
7
  AgsAttributes: buildAttributes(program, enumType),
7
8
  RevisionDefinition: GetRevisionDefinition(program, enumType, enumType === null || enumType === void 0 ? void 0 : enumType.namespace),
8
- Elements: [...enumType.members].map(([_, m]) => getMsGraphEnumMember(program, m))
9
+ Elements: [...enumType.members].map(([_, m]) => getMsGraphEnumMember(program, m)),
10
+ IsFlags: isFlags(program, enumType),
9
11
  };
10
12
  return element;
11
13
  }
@@ -15,7 +17,7 @@ function getMsGraphEnumMember(program, member) {
15
17
  Name: member.name,
16
18
  Value: member.value,
17
19
  AgsAttributes: buildAttributes(program, member),
18
- RevisionDefinition: GetRevisionDefinition(program, member, (_a = member.enum) === null || _a === void 0 ? void 0 : _a.namespace)
20
+ RevisionDefinition: GetRevisionDefinition(program, member, (_a = member.enum) === null || _a === void 0 ? void 0 : _a.namespace),
19
21
  };
20
22
  return element;
21
23
  }
@@ -1 +1 @@
1
- {"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../src/entities/enum.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,qBAAqB,EAAsB,MAAM,0BAA0B,CAAA;AAgBpF,MAAM,UAAU,yBAAyB,CAAC,OAAgB,EAAE,QAAc;IACxE,MAAM,OAAO,GAAgB;QAC3B,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,aAAa,EAAE,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC;QACjD,kBAAkB,EAAE,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,SAAS,CAAC;QACjF,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,oBAAoB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;KAClF,CAAA;IAED,OAAO,OAAO,CAAA;AAChB,CAAC;AAED,SAAS,oBAAoB,CAAC,OAAgB,EAAE,MAAkB;;IAChE,MAAM,OAAO,GAAsB;QACjC,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,aAAa,EAAE,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC;QAC/C,kBAAkB,EAAE,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAA,MAAM,CAAC,IAAI,0CAAE,SAAS,CAAC;KACnF,CAAA;IAED,OAAO,OAAO,CAAA;AAChB,CAAC"}
1
+ {"version":3,"file":"enum.js","sourceRoot":"","sources":["../../../src/entities/enum.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAsB,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAiBtC,MAAM,UAAU,yBAAyB,CAAC,OAAgB,EAAE,QAAc;IACxE,MAAM,OAAO,GAAgB;QAC3B,IAAI,EAAE,QAAQ,CAAC,IAAI;QACnB,aAAa,EAAE,eAAe,CAAC,OAAO,EAAE,QAAQ,CAAC;QACjD,kBAAkB,EAAE,qBAAqB,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,SAAS,CAAC;QACjF,QAAQ,EAAE,CAAC,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,oBAAoB,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACjF,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC;KACpC,CAAC;IAEF,OAAO,OAAO,CAAC;AACjB,CAAC;AAED,SAAS,oBAAoB,CAAC,OAAgB,EAAE,MAAkB;;IAChE,MAAM,OAAO,GAAsB;QACjC,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,aAAa,EAAE,eAAe,CAAC,OAAO,EAAE,MAAM,CAAC;QAC/C,kBAAkB,EAAE,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAA,MAAM,CAAC,IAAI,0CAAE,SAAS,CAAC;KACnF,CAAC;IAEF,OAAO,OAAO,CAAC;AACjB,CAAC"}
@@ -1,36 +1,25 @@
1
1
  import { Model, ModelProperty, Program } from "@typespec/compiler";
2
2
  import { RevisionDefinition } from "./revision-definition.js";
3
3
  export interface MsGraphModel {
4
- Properties: EntityType | ComplexType | undefined;
5
4
  Kind: MsGraphModelKind;
6
- }
7
- export interface EntityType {
8
- StructuredType: StructuredType;
9
- KeyProperty: [string, ModelProperty] | undefined;
10
- Properties: MsGraphModelProperty[];
11
- AlternateKeys: AlternateKeyProperty[];
12
- StreamTypes: string[];
13
- RevisionDefinition: RevisionDefinition | undefined;
14
- Description: string | undefined;
15
- }
16
- export interface ComplexType {
17
- StructuredType: StructuredType;
5
+ Name: string;
6
+ IsAbstract: boolean;
7
+ BaseType: string | undefined;
8
+ IsOpenType: boolean;
9
+ HasStream: boolean;
10
+ AgsAttributes: Record<string, string>;
18
11
  Properties: MsGraphModelProperty[];
19
12
  RevisionDefinition: RevisionDefinition | undefined;
20
13
  Description: string | undefined;
14
+ KeyProperty: [string, ModelProperty] | undefined;
15
+ AlternateKeys: AlternateKeyProperty[];
16
+ StreamTypes: string[];
21
17
  }
22
18
  export declare enum MsGraphModelKind {
23
19
  Unknown = 0,
24
20
  Entity = 1,
25
21
  Complex = 2
26
22
  }
27
- export interface StructuredType {
28
- Name: string;
29
- Abstract?: string;
30
- BaseType?: string;
31
- Children?: any;
32
- [key: string]: any;
33
- }
34
23
  export interface MsGraphModelProperty {
35
24
  Name: string;
36
25
  IsNavigation: boolean;
@@ -43,8 +32,9 @@ export interface MsGraphModelProperty {
43
32
  RevisionDefinition: RevisionDefinition | undefined;
44
33
  Description: string | undefined;
45
34
  }
46
- export interface AlternateKeyProperty extends ModelProperty {
35
+ export interface AlternateKeyProperty {
47
36
  IsModel: boolean;
37
+ ModelProperty: ModelProperty;
48
38
  }
49
- export declare function GetMsGraphModel(program: Program, model: Model): MsGraphModel;
39
+ export declare function GetMsGraphModels(program: Program, models: Map<string, Model>): Map<string, MsGraphModel>;
50
40
  //# sourceMappingURL=model.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../../src/entities/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,aAA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