@azure-tools/typespec-ts 0.29.0 → 0.30.0-alpha.20240628.1

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 (230) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/src/contextManager.d.ts +70 -0
  3. package/dist/src/contextManager.d.ts.map +1 -0
  4. package/dist/src/contextManager.js +59 -0
  5. package/dist/src/contextManager.js.map +1 -0
  6. package/dist/src/index.d.ts.map +1 -1
  7. package/dist/src/index.js +38 -28
  8. package/dist/src/index.js.map +1 -1
  9. package/dist/src/lib.d.ts +2 -1
  10. package/dist/src/lib.d.ts.map +1 -1
  11. package/dist/src/lib.js +3 -2
  12. package/dist/src/lib.js.map +1 -1
  13. package/dist/src/metaTree.d.ts +12 -0
  14. package/dist/src/metaTree.d.ts.map +1 -0
  15. package/dist/src/metaTree.js +2 -0
  16. package/dist/src/metaTree.js.map +1 -0
  17. package/dist/src/modular/buildClassicalClient.d.ts +1 -1
  18. package/dist/src/modular/buildClassicalClient.d.ts.map +1 -1
  19. package/dist/src/modular/buildClassicalClient.js +22 -16
  20. package/dist/src/modular/buildClassicalClient.js.map +1 -1
  21. package/dist/src/modular/buildClassicalOperationGroups.d.ts +3 -2
  22. package/dist/src/modular/buildClassicalOperationGroups.d.ts.map +1 -1
  23. package/dist/src/modular/buildClassicalOperationGroups.js +5 -5
  24. package/dist/src/modular/buildClassicalOperationGroups.js.map +1 -1
  25. package/dist/src/modular/buildClientContext.d.ts +1 -1
  26. package/dist/src/modular/buildClientContext.d.ts.map +1 -1
  27. package/dist/src/modular/buildClientContext.js +7 -6
  28. package/dist/src/modular/buildClientContext.js.map +1 -1
  29. package/dist/src/modular/buildCodeModel.d.ts +2 -2
  30. package/dist/src/modular/buildCodeModel.d.ts.map +1 -1
  31. package/dist/src/modular/buildCodeModel.js +69 -43
  32. package/dist/src/modular/buildCodeModel.js.map +1 -1
  33. package/dist/src/modular/buildHelperSerializers.d.ts +3 -0
  34. package/dist/src/modular/buildHelperSerializers.d.ts.map +1 -0
  35. package/dist/src/modular/buildHelperSerializers.js +60 -0
  36. package/dist/src/modular/buildHelperSerializers.js.map +1 -0
  37. package/dist/src/modular/buildLroFiles.d.ts +1 -1
  38. package/dist/src/modular/buildLroFiles.d.ts.map +1 -1
  39. package/dist/src/modular/buildLroFiles.js +25 -31
  40. package/dist/src/modular/buildLroFiles.js.map +1 -1
  41. package/dist/src/modular/buildOperations.d.ts +3 -2
  42. package/dist/src/modular/buildOperations.d.ts.map +1 -1
  43. package/dist/src/modular/buildOperations.js +25 -12
  44. package/dist/src/modular/buildOperations.js.map +1 -1
  45. package/dist/src/modular/buildPagingFiles.d.ts.map +1 -1
  46. package/dist/src/modular/buildPagingFiles.js.map +1 -1
  47. package/dist/src/modular/buildProjectFiles.d.ts.map +1 -1
  48. package/dist/src/modular/buildProjectFiles.js.map +1 -1
  49. package/dist/src/modular/buildRootIndex.d.ts.map +1 -1
  50. package/dist/src/modular/buildRootIndex.js +1 -1
  51. package/dist/src/modular/buildRootIndex.js.map +1 -1
  52. package/dist/src/modular/buildSerializeUtils.d.ts +2 -2
  53. package/dist/src/modular/buildSerializeUtils.d.ts.map +1 -1
  54. package/dist/src/modular/buildSerializeUtils.js +15 -8
  55. package/dist/src/modular/buildSerializeUtils.js.map +1 -1
  56. package/dist/src/modular/buildSubpathIndex.d.ts.map +1 -1
  57. package/dist/src/modular/buildSubpathIndex.js +6 -0
  58. package/dist/src/modular/buildSubpathIndex.js.map +1 -1
  59. package/dist/src/modular/emitModels.d.ts +5 -5
  60. package/dist/src/modular/emitModels.d.ts.map +1 -1
  61. package/dist/src/modular/emitModels.js +78 -21
  62. package/dist/src/modular/emitModels.js.map +1 -1
  63. package/dist/src/modular/helpers/classicalOperationHelpers.d.ts +3 -1
  64. package/dist/src/modular/helpers/classicalOperationHelpers.d.ts.map +1 -1
  65. package/dist/src/modular/helpers/classicalOperationHelpers.js +32 -15
  66. package/dist/src/modular/helpers/classicalOperationHelpers.js.map +1 -1
  67. package/dist/src/modular/helpers/clientHelpers.d.ts +3 -2
  68. package/dist/src/modular/helpers/clientHelpers.d.ts.map +1 -1
  69. package/dist/src/modular/helpers/clientHelpers.js +14 -5
  70. package/dist/src/modular/helpers/clientHelpers.js.map +1 -1
  71. package/dist/src/modular/helpers/namingHelpers.d.ts +5 -1
  72. package/dist/src/modular/helpers/namingHelpers.d.ts.map +1 -1
  73. package/dist/src/modular/helpers/namingHelpers.js +25 -1
  74. package/dist/src/modular/helpers/namingHelpers.js.map +1 -1
  75. package/dist/src/modular/helpers/operationHelpers.d.ts +11 -3
  76. package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -1
  77. package/dist/src/modular/helpers/operationHelpers.js +160 -66
  78. package/dist/src/modular/helpers/operationHelpers.js.map +1 -1
  79. package/dist/src/modular/helpers/typeHelpers.d.ts +3 -0
  80. package/dist/src/modular/helpers/typeHelpers.d.ts.map +1 -1
  81. package/dist/src/modular/helpers/typeHelpers.js +50 -19
  82. package/dist/src/modular/helpers/typeHelpers.js.map +1 -1
  83. package/dist/src/modular/modularCodeModel.d.ts +9 -5
  84. package/dist/src/modular/modularCodeModel.d.ts.map +1 -1
  85. package/dist/src/modular/serialization/buildSerializerFunction.d.ts +4 -0
  86. package/dist/src/modular/serialization/buildSerializerFunction.d.ts.map +1 -0
  87. package/dist/src/modular/serialization/buildSerializerFunction.js +160 -0
  88. package/dist/src/modular/serialization/buildSerializerFunction.js.map +1 -0
  89. package/dist/src/modular/serialization/collectionUtils.d.ts +3 -0
  90. package/dist/src/modular/serialization/collectionUtils.d.ts.map +1 -0
  91. package/dist/src/modular/serialization/collectionUtils.js +17 -0
  92. package/dist/src/modular/serialization/collectionUtils.js.map +1 -0
  93. package/dist/src/modular/serialization/index.d.ts +5 -0
  94. package/dist/src/modular/serialization/index.d.ts.map +1 -0
  95. package/dist/src/modular/serialization/index.js +156 -0
  96. package/dist/src/modular/serialization/index.js.map +1 -0
  97. package/dist/src/modular/serialization/operationHelpers.d.ts +37 -0
  98. package/dist/src/modular/serialization/operationHelpers.d.ts.map +1 -0
  99. package/dist/src/modular/serialization/operationHelpers.js +457 -0
  100. package/dist/src/modular/serialization/operationHelpers.js.map +1 -0
  101. package/dist/src/modular/serialization/serializeArray.d.ts +5 -0
  102. package/dist/src/modular/serialization/serializeArray.d.ts.map +1 -0
  103. package/dist/src/modular/serialization/serializeArray.js +33 -0
  104. package/dist/src/modular/serialization/serializeArray.js.map +1 -0
  105. package/dist/src/modular/serialization/serializeDateTime.d.ts +4 -0
  106. package/dist/src/modular/serialization/serializeDateTime.d.ts.map +1 -0
  107. package/dist/src/modular/serialization/serializeDateTime.js +19 -0
  108. package/dist/src/modular/serialization/serializeDateTime.js.map +1 -0
  109. package/dist/src/modular/serialization/serializeHeaders.d.ts +7 -0
  110. package/dist/src/modular/serialization/serializeHeaders.d.ts.map +1 -0
  111. package/dist/src/modular/serialization/serializeHeaders.js +44 -0
  112. package/dist/src/modular/serialization/serializeHeaders.js.map +1 -0
  113. package/dist/src/modular/serialization/serializers.d.ts +17 -0
  114. package/dist/src/modular/serialization/serializers.d.ts.map +1 -0
  115. package/dist/src/modular/serialization/serializers.js +176 -0
  116. package/dist/src/modular/serialization/serializers.js.map +1 -0
  117. package/dist/src/modular/serialization/util.d.ts +26 -0
  118. package/dist/src/modular/serialization/util.d.ts.map +1 -0
  119. package/dist/src/modular/serialization/util.js +112 -0
  120. package/dist/src/modular/serialization/util.js.map +1 -0
  121. package/dist/src/reify/index.d.ts +12 -0
  122. package/dist/src/reify/index.d.ts.map +1 -0
  123. package/dist/src/reify/index.js +22 -0
  124. package/dist/src/reify/index.js.map +1 -0
  125. package/dist/src/testing/index.d.ts +2 -0
  126. package/dist/src/testing/index.d.ts.map +1 -0
  127. package/dist/src/testing/index.js +7 -0
  128. package/dist/src/testing/index.js.map +1 -0
  129. package/dist/src/transform/transform.d.ts +1 -1
  130. package/dist/src/transform/transform.d.ts.map +1 -1
  131. package/dist/src/transform/transform.js +11 -11
  132. package/dist/src/transform/transform.js.map +1 -1
  133. package/dist/src/transform/transformApiVersionInfo.d.ts +1 -1
  134. package/dist/src/transform/transformApiVersionInfo.d.ts.map +1 -1
  135. package/dist/src/transform/transformApiVersionInfo.js +16 -6
  136. package/dist/src/transform/transformApiVersionInfo.js.map +1 -1
  137. package/dist/src/transform/transformHelperFunctionDetails.d.ts +1 -1
  138. package/dist/src/transform/transformHelperFunctionDetails.d.ts.map +1 -1
  139. package/dist/src/transform/transformHelperFunctionDetails.js +1 -1
  140. package/dist/src/transform/transformHelperFunctionDetails.js.map +1 -1
  141. package/dist/src/transform/transformParameters.d.ts +1 -1
  142. package/dist/src/transform/transformParameters.d.ts.map +1 -1
  143. package/dist/src/transform/transformParameters.js +3 -3
  144. package/dist/src/transform/transformParameters.js.map +1 -1
  145. package/dist/src/transform/transformPaths.d.ts +1 -1
  146. package/dist/src/transform/transformPaths.d.ts.map +1 -1
  147. package/dist/src/transform/transformPaths.js +3 -4
  148. package/dist/src/transform/transformPaths.js.map +1 -1
  149. package/dist/src/transform/transformResponses.d.ts +1 -1
  150. package/dist/src/transform/transformResponses.d.ts.map +1 -1
  151. package/dist/src/transform/transformResponses.js +12 -9
  152. package/dist/src/transform/transformResponses.js.map +1 -1
  153. package/dist/src/transform/transformSchemas.d.ts.map +1 -1
  154. package/dist/src/transform/transformSchemas.js +10 -4
  155. package/dist/src/transform/transformSchemas.js.map +1 -1
  156. package/dist/src/transform/transformTelemetryInfo.d.ts.map +1 -1
  157. package/dist/src/transform/transformTelemetryInfo.js +1 -1
  158. package/dist/src/transform/transformTelemetryInfo.js.map +1 -1
  159. package/dist/src/transform/transfromRLCOptions.d.ts.map +1 -1
  160. package/dist/src/transform/transfromRLCOptions.js +11 -5
  161. package/dist/src/transform/transfromRLCOptions.js.map +1 -1
  162. package/dist/src/utils/clientUtils.js.map +1 -1
  163. package/dist/src/utils/emitUtil.d.ts +1 -2
  164. package/dist/src/utils/emitUtil.d.ts.map +1 -1
  165. package/dist/src/utils/emitUtil.js.map +1 -1
  166. package/dist/src/utils/importHelper.d.ts +10 -0
  167. package/dist/src/utils/importHelper.d.ts.map +1 -0
  168. package/dist/src/utils/importHelper.js +54 -0
  169. package/dist/src/utils/importHelper.js.map +1 -0
  170. package/dist/src/utils/modelUtils.d.ts +1 -1
  171. package/dist/src/utils/modelUtils.d.ts.map +1 -1
  172. package/dist/src/utils/modelUtils.js +41 -25
  173. package/dist/src/utils/modelUtils.js.map +1 -1
  174. package/dist/src/utils/namespaceUtils.d.ts.map +1 -1
  175. package/dist/src/utils/namespaceUtils.js.map +1 -1
  176. package/dist/src/utils/operationUtil.d.ts +3 -4
  177. package/dist/src/utils/operationUtil.d.ts.map +1 -1
  178. package/dist/src/utils/operationUtil.js +4 -5
  179. package/dist/src/utils/operationUtil.js.map +1 -1
  180. package/dist/tsconfig.tsbuildinfo +1 -1
  181. package/package.json +55 -35
  182. package/src/contextManager.ts +99 -0
  183. package/src/index.ts +66 -55
  184. package/src/lib.ts +6 -4
  185. package/src/metaTree.ts +14 -0
  186. package/src/modular/buildClassicalClient.ts +36 -18
  187. package/src/modular/buildClassicalOperationGroups.ts +16 -8
  188. package/src/modular/buildClientContext.ts +13 -12
  189. package/src/modular/buildCodeModel.ts +141 -99
  190. package/src/modular/buildHelperSerializers.ts +71 -0
  191. package/src/modular/buildLroFiles.ts +29 -33
  192. package/src/modular/buildOperations.ts +70 -32
  193. package/src/modular/buildPagingFiles.ts +1 -1
  194. package/src/modular/buildProjectFiles.ts +1 -1
  195. package/src/modular/buildRootIndex.ts +1 -1
  196. package/src/modular/buildSerializeUtils.ts +33 -25
  197. package/src/modular/buildSubpathIndex.ts +10 -0
  198. package/src/modular/emitModels.ts +115 -32
  199. package/src/modular/helpers/classicalOperationHelpers.ts +48 -11
  200. package/src/modular/helpers/clientHelpers.ts +19 -6
  201. package/src/modular/helpers/namingHelpers.ts +59 -4
  202. package/src/modular/helpers/operationHelpers.ts +247 -111
  203. package/src/modular/helpers/typeHelpers.ts +54 -17
  204. package/src/modular/modularCodeModel.ts +17 -5
  205. package/src/modular/serialization/buildSerializerFunction.ts +224 -0
  206. package/src/modular/serialization/collectionUtils.ts +20 -0
  207. package/src/modular/serialization/index.ts +263 -0
  208. package/src/modular/serialization/operationHelpers.ts +660 -0
  209. package/src/modular/serialization/serializeArray.ts +51 -0
  210. package/src/modular/serialization/serializeDateTime.ts +22 -0
  211. package/src/modular/serialization/serializeHeaders.ts +64 -0
  212. package/src/modular/serialization/serializers.ts +304 -0
  213. package/src/modular/serialization/util.ts +167 -0
  214. package/src/reify/index.ts +41 -0
  215. package/src/testing/index.ts +10 -0
  216. package/src/transform/transform.ts +15 -15
  217. package/src/transform/transformApiVersionInfo.ts +29 -16
  218. package/src/transform/transformHelperFunctionDetails.ts +8 -8
  219. package/src/transform/transformParameters.ts +15 -15
  220. package/src/transform/transformPaths.ts +12 -12
  221. package/src/transform/transformResponses.ts +21 -18
  222. package/src/transform/transformSchemas.ts +17 -8
  223. package/src/transform/transformTelemetryInfo.ts +4 -4
  224. package/src/transform/transfromRLCOptions.ts +14 -7
  225. package/src/utils/clientUtils.ts +2 -2
  226. package/src/utils/emitUtil.ts +6 -3
  227. package/src/utils/importHelper.ts +64 -0
  228. package/src/utils/modelUtils.ts +79 -47
  229. package/src/utils/namespaceUtils.ts +1 -1
  230. package/src/utils/operationUtil.ts +22 -24
@@ -1,9 +1,9 @@
1
1
  import { NameType } from "@azure-tools/rlc-common";
2
+ import { importLroCoreDependencies } from "./buildLroFiles.js";
3
+ import { importModels, importPagingDependencies } from "./buildOperations.js";
2
4
  import { getClassicalOperation } from "./helpers/classicalOperationHelpers.js";
3
5
  import { getClassicalLayerPrefix } from "./helpers/namingHelpers.js";
4
- import { importModels, importPagingDependencies } from "./buildOperations.js";
5
- import { importLroCoreDependencies } from "./buildLroFiles.js";
6
- export function buildClassicOperationFiles(codeModel, client) {
6
+ export function buildClassicOperationFiles(dpgContext, codeModel, client) {
7
7
  var _a, _b;
8
8
  const classicOperationFiles = new Map();
9
9
  for (const operationGroup of client.operationGroups) {
@@ -16,7 +16,7 @@ export function buildClassicOperationFiles(codeModel, client) {
16
16
  const subfolder = client.subfolder;
17
17
  const srcPath = codeModel.modularOptions.sourceRoot;
18
18
  const classicFile = (_a = classicOperationFiles.get(classicOperationFileName)) !== null && _a !== void 0 ? _a : codeModel.project.createSourceFile(`${srcPath}/${subfolder && subfolder !== "" ? subfolder + "/" : ""}classic/${classicOperationFileName}.ts`);
19
- getClassicalOperation(classicFile, client, operationGroup);
19
+ getClassicalOperation(dpgContext, client, classicFile, operationGroup);
20
20
  // Import models used from ./models.ts
21
21
  // We SHOULD keep this because otherwise ts-morph will "helpfully" try to import models from the rest layer when we call fixMissingImports().
22
22
  importModels(srcPath, classicFile, codeModel.project, subfolder, operationGroup.namespaceHierarchies.length);
@@ -40,7 +40,7 @@ export function buildClassicOperationFiles(codeModel, client) {
40
40
  const subfolder = client.subfolder;
41
41
  const srcPath = codeModel.modularOptions.sourceRoot;
42
42
  const classicFile = (_b = classicOperationFiles.get(classicOperationFileName)) !== null && _b !== void 0 ? _b : codeModel.project.createSourceFile(`${srcPath}/${subfolder && subfolder !== "" ? subfolder + "/" : ""}classic/${classicOperationFileName}.ts`);
43
- getClassicalOperation(classicFile, client, operationGroup, layer);
43
+ getClassicalOperation(dpgContext, client, classicFile, operationGroup, layer);
44
44
  // Import models used from ./models.ts
45
45
  // We SHOULD keep this because otherwise ts-morph will "helpfully" try to import models from the rest layer when we call fixMissingImports().
46
46
  importModels(srcPath, classicFile, codeModel.project, subfolder, layer);
@@ -1 +1 @@
1
- {"version":3,"file":"buildClassicalOperationGroups.js","sourceRoot":"","sources":["../../../src/modular/buildClassicalOperationGroups.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wCAAwC,CAAC;AAC/E,OAAO,EAAE,uBAA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AAM,OAAO,GAAG,gBAAgB,CAAC,OAAO,CAAC,aAAa,CACpD,GAAG,OAAO,IACR,SAAS,IAAI,SAAS,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,EACpD,OAAO,wBAAwB,KAAK,CACrC,CAAC;IAEF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO;IACT,CAAC;IAED,MAAM,QAAQ,GAAG,CAAC,GAAG,OAAO,CAAC,uBAAuB,EAAE,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;QAC1E,OAAO,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;IAC5B,CAAC,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG,WAAW,CAAC,qBAAqB,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE;QACtE,OAAO,CAAC;aACL,uBAAuB,EAAE;aACzB,QAAQ,CAAC,UAAU,wBAAwB,EAAE,CAAC,CAAC;IACpD,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IACN,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;QAC3C,WAAW,CAAC,oBAAoB,CAAC;YAC/B,eAAe,EAAE,GAAG,KAAK,CAAC,MAAM,CAC9B,cAAc,CAAC,oBAAoB,CAAC,MAAM,GAAG,CAAC,CAC/C,OAAO,wBAAwB,KAAK;YACrC,YAAY,EAAE,QAAQ;SACvB,CAAC,CAAC;IACL,CAAC;AACH,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { SourceFile } from "ts-morph";
2
- import { Client, ModularCodeModel } from "./modularCodeModel.js";
3
2
  import { SdkContext } from "../utils/interfaces.js";
3
+ import { Client, ModularCodeModel } from "./modularCodeModel.js";
4
4
  /**
5
5
  * This function creates the file containing the modular client context
6
6
  */
@@ -1 +1 @@
1
- {"version":3,"file":"buildClientContext.d.ts","sourceRoot":"","sources":["../../../src/modular/buildClientContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAMtC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAIjE,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAQpD;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,gBAAgB,GAC1B,UAAU,CAgHZ"}
1
+ {"version":3,"file":"buildClientContext.d.ts","sourceRoot":"","sources":["../../../src/modular/buildClientContext.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AASpD,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAEjE;;GAEG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,gBAAgB,GAC1B,UAAU,CAiHZ"}
@@ -1,9 +1,9 @@
1
- import { getClientParameters, importCredential } from "./helpers/clientHelpers.js";
2
- import { getClientName } from "./helpers/namingHelpers.js";
1
+ import { getImportSpecifier, NameType, normalizeName } from "@azure-tools/rlc-common";
3
2
  import { isRLCMultiEndpoint } from "../utils/clientUtils.js";
4
- import { getDocsFromDescription } from "./helpers/docsHelpers.js";
5
3
  import { importModels } from "./buildOperations.js";
6
- import { getImportSpecifier, normalizeName, NameType } from "@azure-tools/rlc-common";
4
+ import { getClientParameters, importCredential } from "./helpers/clientHelpers.js";
5
+ import { getDocsFromDescription } from "./helpers/docsHelpers.js";
6
+ import { getClientName } from "./helpers/namingHelpers.js";
7
7
  import { getType } from "./helpers/typeHelpers.js";
8
8
  /**
9
9
  * This function creates the file containing the modular client context
@@ -11,7 +11,7 @@ import { getType } from "./helpers/typeHelpers.js";
11
11
  export function buildClientContext(client, dpgContext, codeModel) {
12
12
  const { description, subfolder } = client;
13
13
  const name = getClientName(client);
14
- const params = getClientParameters(client);
14
+ const params = getClientParameters(client, dpgContext);
15
15
  const srcPath = codeModel.modularOptions.sourceRoot;
16
16
  const clientContextFile = codeModel.project.createSourceFile(`${srcPath}/${subfolder && subfolder !== "" ? subfolder + "/" : ""}/api/${normalizeName(name, NameType.File)}Context.ts`);
17
17
  let factoryFunction;
@@ -36,7 +36,8 @@ export function buildClientContext(client, dpgContext, codeModel) {
36
36
  hasQuestionToken: true,
37
37
  docs: getDocsFromDescription(p.description)
38
38
  };
39
- })
39
+ }),
40
+ docs: ["Optional parameters for the client."]
40
41
  });
41
42
  if (isRLCMultiEndpoint(dpgContext)) {
42
43
  clientContextFile.addImportDeclaration({
@@ -1 +1 @@
1
- {"version":3,"file":"buildClientContext.js","sourceRoot":"","sources":["../../../src/modular/buildClientContext.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EACjB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAE3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,OAAO,EACL,kBAAkB,EAClB,aAAa,EACb,QAAQ,EACT,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,0BAA0B,CAAC;AAEnD;;GAEG;AACH,MAAM,UAAU,kBAAkB,CAChC,MAAc,EACd,UAAsB,EACtB,SAA2B;IAE3B,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;IAC1C,MAAM,IAAI,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IACnC,MAAM,MAAM,GAAG,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IAAI,EAAE,SAAS,IAAI,EAAE;YACrB,UAAU,EAAE,GAAG,aAAa,EAAE;YAC9B,UAAU,EAAE,MAAM;YAClB,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;IACL,CAAC;IAED,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAC7C,MAAM,kBAAkB,GAAG,mCAAmC,UAAU,CAAC,IAAI,CAC3E,GAAG,CACJ,GAAG,CAAC;IAEL,eAAe,CAAC,aAAa,CAAC,CAAC,kBAAkB,EAAE,uBAAuB,CAAC,CAAC,CAAC;IAE7E,IAAI,kBAAkB,CAAC,UAAU,CAAC,EAAE,CAAC;QACnC,iBAAiB,CAAC,qBAAqB,CAAC;YACtC;gBACE,eAAe,EAAE,cAAc,SAAS,WAAW;gBACnD,YAAY,EAAE,CAAC,2BAA2B,CAAC;aAC5C;SACF,CAAC,CAAC;IACL,CAAC;SAAM,CAAC;QACN,iBAAiB,CAAC,qBAAqB,CAAC;YACtC;gBACE,eAAe,EAAE,GACf,SAAS,IAAI,SAAS,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAC1C,kBAAkB;gBAClB,aAAa,EAAE,WAAW;aAC3B;SACF,CAAC,CAAC;IACL,CAAC;IAED,iBAAiB,CAAC,iBAAiB,CACjC,EAAE,EACF,EAAE,2BAA2B,EAAE,IAAI,EAAE,CACtC,CAAC;IAEF,iBAAiB,CAAC,oBAAoB,EAAE,CAAC;IACzC,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
1
+ {"version":3,"file":"buildClientContext.js","sourceRoot":"","sources":["../../../src/modular/buildClientContext.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,EAClB,QAAQ,EACR,aAAa,EACd,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,OAAO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I,SAAS,KAAK,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAC1C,kBAAkB;gBAClB,aAAa,EAAE,WAAW;aAC3B;SACF,CAAC,CAAC;IACL,CAAC;IAED,iBAAiB,CAAC,iBAAiB,CACjC,EAAE,EACF,EAAE,2BAA2B,EAAE,IAAI,EAAE,CACtC,CAAC;IAEF,iBAAiB,CAAC,oBAAoB,EAAE,CAAC;IACzC,OAAO,iBAAiB,CAAC;AAC3B,CAAC"}
@@ -1,7 +1,7 @@
1
- import { ModularCodeModel } from "./modularCodeModel.js";
2
1
  import { RLCModel } from "@azure-tools/rlc-common";
3
- import { SdkContext } from "../utils/interfaces.js";
4
2
  import { Project } from "ts-morph";
3
+ import { SdkContext } from "../utils/interfaces.js";
4
+ import { ModularCodeModel } from "./modularCodeModel.js";
5
5
  export interface EmitterOptions {
6
6
  "basic-setup-py"?: boolean;
7
7
  "package-version"?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"buildCodeModel.d.ts","sourceRoot":"","sources":["../../../src/modular/buildCodeModel.ts"],"names":[],"mappings":"AAsEA,OAAO,EACL,gBAAgB,EASjB,MAAM,uBAAuB,CAAC;AAU/B,OAAO,EACL,QAAQ,EAIT,MAAM,yBAAyB,CAAC;AAUjC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AA2BnC,MAAM,WAAW,cAAc;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AA6nDD,wBAAgB,aAAa,CAC3B,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,EACnC,kBAAkB,EAAE,MAAM,EAC1B,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE;IAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAA;CAAwB,GAC3D,gBAAgB,CAyDlB"}
1
+ {"version":3,"file":"buildCodeModel.d.ts","sourceRoot":"","sources":["../../../src/modular/buildCodeModel.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,QAAQ,EACT,MAAM,yBAAyB,CAAC;AA0EjC,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAGnC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAsBpD,OAAO,EAGL,gBAAgB,EAOjB,MAAM,uBAAuB,CAAC;AAuB/B,MAAM,WAAW,cAAc;IAC7B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAiqDD,wBAAgB,aAAa,CAC3B,UAAU,EAAE,UAAU,EACtB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,EACnC,kBAAkB,EAAE,MAAM,EAC1B,OAAO,EAAE,OAAO,EAChB,OAAO,GAAE;IAAE,MAAM,EAAE,OAAO,GAAG,OAAO,CAAA;CAAwB,GAC3D,gBAAgB,CA0DlB"}
@@ -1,17 +1,17 @@
1
- import { getPagedResult, getLroMetadata } from "@azure-tools/typespec-azure-core";
2
- import { getDoc, getFriendlyName, getMaxLength, getMaxValue, getMinLength, getMinValue, getPattern, getSummary, getVisibility, ignoreDiagnostics, isErrorModel, isNeverType, getDiscriminator, isStringType, getPropertyType, isNumericType, getMinItems, getMaxItems, listServices, isNullType, getEncode, isTemplateDeclarationOrInstance, UsageFlags, isVoidType } from "@typespec/compiler";
3
- import { getAuthentication, getServers, getHttpOperation, isSharedRoute } from "@typespec/http";
1
+ import { buildRuntimeImports, getClientName, NameType, normalizeName } from "@azure-tools/rlc-common";
2
+ import { getLroMetadata, getPagedResult } from "@azure-tools/typespec-azure-core";
3
+ import { getAllModels, getClientNamespaceString, getClientType, getDefaultApiVersion, getLibraryName, getSdkBuiltInType, getSdkUnion, getWireName, isApiVersion, listClients, listOperationGroups, listOperationsInOperationGroup } from "@azure-tools/typespec-client-generator-core";
4
+ import { getDiscriminator, getDoc, getEncode, getFriendlyName, getMaxItems, getMaxLength, getMaxValue, getMinItems, getMinLength, getMinValue, getPattern, getPropertyType, getSummary, getVisibility, ignoreDiagnostics, isErrorModel, isNeverType, isNullType, isNumericType, isStringType, isTemplateDeclarationOrInstance, isType, isVoidType, listServices, UsageFlags } from "@typespec/compiler";
5
+ import { getAuthentication, getHttpOperation, getServers, isSharedRoute } from "@typespec/http";
4
6
  import { getAddedOnVersions } from "@typespec/versioning";
5
- import { listClients, listOperationGroups, listOperationsInOperationGroup, isApiVersion, getDefaultApiVersion, getClientNamespaceString, getSdkUnion, getAllModels, getSdkBuiltInType, getLibraryName, getWireName } from "@azure-tools/typespec-client-generator-core";
6
- import { buildCoreTypeInfo, getBodyType, getDefaultApiVersionString, getEffectiveSchemaType, isAzureCoreErrorType, isSchemaProperty } from "../utils/modelUtils.js";
7
+ import { reportDiagnostic } from "../lib.js";
7
8
  import { camelToSnakeCase, toCamelCase } from "../utils/casingUtils.js";
8
- import { getClientName, NameType, normalizeName } from "@azure-tools/rlc-common";
9
- import { getOperationGroupName, getOperationName, isBinaryPayload, isIgnoredHeaderParam, isLongRunningOperation, parseItemName, parseNextLinkName } from "../utils/operationUtil.js";
10
- import { buildRuntimeImports } from "@azure-tools/rlc-common";
9
+ import { buildCoreTypeInfo, getBodyType, getDefaultApiVersionString, getEffectiveSchemaType, isAzureCoreErrorType, isSchemaProperty } from "../utils/modelUtils.js";
11
10
  import { getModelNamespaceName } from "../utils/namespaceUtils.js";
12
- import { reportDiagnostic } from "../lib.js";
13
- import { getType as getTypeName } from "./helpers/typeHelpers.js";
11
+ import { extractPagedMetadataNested, getOperationGroupName, getOperationName, isBinaryPayload, isIgnoredHeaderParam, isLongRunningOperation, parseItemName, parseNextLinkName } from "../utils/operationUtil.js";
14
12
  import { isModelWithAdditionalProperties } from "./emitModels.js";
13
+ import { getType as getTypeName } from "./helpers/typeHelpers.js";
14
+ import { useContext } from "../contextManager.js";
15
15
  let CASING = "snake";
16
16
  function applyCasing(name, options = { casing: "snake" }) {
17
17
  if (options.casing === "camel") {
@@ -143,6 +143,7 @@ function isEmptyAnonymousModel(type) {
143
143
  }
144
144
  function getType(context, type, options = {}) {
145
145
  var _a, _b;
146
+ const modularMetatree = useContext("modularMetaTree");
146
147
  // don't cache simple type(string, int, etc) since decorators may change the result
147
148
  const enableCache = !isSimpleType(context.program, type);
148
149
  const effectiveModel = !options.disableEffectiveModel &&
@@ -166,6 +167,11 @@ function getType(context, type, options = {}) {
166
167
  if (type.kind === "ModelProperty" || type.kind === "Scalar") {
167
168
  newValue = applyEncoding(context.program, type, newValue);
168
169
  }
170
+ if (isTypespecType(type)) {
171
+ newValue.tcgcType = getClientType(context, type);
172
+ newValue.__raw = type;
173
+ modularMetatree.set(type, newValue);
174
+ }
169
175
  if (enableCache) {
170
176
  if (!options.disableEffectiveModel) {
171
177
  typesMap.set(effectiveModel, newValue);
@@ -187,7 +193,8 @@ function getType(context, type, options = {}) {
187
193
  }
188
194
  }
189
195
  else {
190
- const key = JSON.stringify(newValue);
196
+ const { __raw, tcgcType, ...keyableValue } = newValue;
197
+ const key = JSON.stringify(keyableValue);
191
198
  const value = simpleTypesMap.get(key);
192
199
  if (value) {
193
200
  newValue = value;
@@ -209,6 +216,9 @@ function getType(context, type, options = {}) {
209
216
  }
210
217
  return newValue;
211
218
  }
219
+ function isTypespecType(type) {
220
+ return type.kind !== "Credential" && type.kind !== "CredentialTypeUnion";
221
+ }
212
222
  // To pass the yaml dump
213
223
  function getAddedOnVersion(p, t) {
214
224
  var _a, _b;
@@ -243,29 +253,33 @@ function emitParamBase(context, parameter) {
243
253
  clientName: applyCasing(name, { casing: CASING }),
244
254
  restApiName,
245
255
  inOverload: false,
246
- format
256
+ format,
257
+ tcgcType: getClientType(context, parameter)
247
258
  };
248
259
  }
249
260
  function emitBodyParameter(context, httpOperation) {
250
261
  var _a;
251
262
  const params = httpOperation.parameters;
252
263
  const body = params.body;
253
- const base = emitParamBase(context, (_a = body.parameter) !== null && _a !== void 0 ? _a : body.type);
254
- let contentTypes = body.contentTypes;
255
- if (contentTypes.length === 0) {
256
- contentTypes = ["application/json"];
264
+ if (body.bodyKind === "single") {
265
+ const base = emitParamBase(context, (_a = body.parameter) !== null && _a !== void 0 ? _a : body.type);
266
+ let contentTypes = body.contentTypes;
267
+ if (contentTypes.length === 0) {
268
+ contentTypes = ["application/json"];
269
+ }
270
+ const type = getType(context, getBodyType(context.program, httpOperation), {
271
+ disableEffectiveModel: true,
272
+ usage: UsageFlags.Input
273
+ });
274
+ return {
275
+ contentTypes,
276
+ type,
277
+ location: "body",
278
+ ...base,
279
+ isBinaryPayload: isBinaryPayload(context, body.type, contentTypes)
280
+ };
257
281
  }
258
- const type = getType(context, getBodyType(context.program, httpOperation), {
259
- disableEffectiveModel: true,
260
- usage: UsageFlags.Input
261
- });
262
- return {
263
- contentTypes,
264
- type,
265
- location: "body",
266
- ...base,
267
- isBinaryPayload: isBinaryPayload(context, body.type, contentTypes)
268
- };
282
+ return undefined;
269
283
  }
270
284
  function emitParameter(context, parameter, implementation) {
271
285
  var _a;
@@ -637,7 +651,7 @@ function getName(program, type) {
637
651
  type.templateMapper.args &&
638
652
  type.templateMapper.args.length > 0) {
639
653
  return (type.name +
640
- type.templateMapper.args
654
+ type.templateMapper.args.filter((it) => isType(it))
641
655
  .map((it) => (it.kind === "Model" ? it.name : ""))
642
656
  .join(""));
643
657
  }
@@ -675,7 +689,7 @@ function emitModel(context, type, usage) {
675
689
  type.templateMapper.args.length > 0 &&
676
690
  getPagedResult(context.program, type)) {
677
691
  modelName =
678
- type.templateMapper.args
692
+ type.templateMapper.args.filter((it) => isType(it))
679
693
  .map((it) => {
680
694
  switch (it.kind) {
681
695
  case "Model":
@@ -688,9 +702,11 @@ function emitModel(context, type, usage) {
688
702
  })
689
703
  .join("") + "List";
690
704
  }
705
+ const page = extractPagedMetadataNested(context.program, type);
706
+ const isPaging = page && page.itemsSegments && page.itemsSegments.length > 0;
691
707
  return {
692
708
  type: "model",
693
- name: modelName,
709
+ name: `${isPaging ? "_" : ""}${modelName}`,
694
710
  description: getDocStr(context.program, type),
695
711
  parents: baseModel ? [baseModel] : [],
696
712
  discriminatedSubtypes: [],
@@ -724,10 +740,13 @@ function emitEnum(context, type) {
724
740
  description: getDocStr(program, m)
725
741
  });
726
742
  }
743
+ const name = normalizeName(getLibraryName(context, type) ? getLibraryName(context, type) : type.name, NameType.Interface);
727
744
  return {
728
745
  type: "enum",
729
- name: normalizeName(getLibraryName(context, type) ? getLibraryName(context, type) : type.name, NameType.Interface),
730
- description: getDocStr(program, type),
746
+ name,
747
+ description: getDocStr(program, type) === ""
748
+ ? `Type of ${name}`
749
+ : getDocStr(program, type),
731
750
  valueType: { type: enumMemberType(type.members.values().next().value) },
732
751
  values: enumValues,
733
752
  isFixed: true,
@@ -949,8 +968,12 @@ function mapTypeSpecType(context, type, usage) {
949
968
  }
950
969
  }
951
970
  function emitUnion(context, type, usage) {
952
- var _a;
953
- const sdkType = getSdkUnion(context, type);
971
+ var _a, _b, _c;
972
+ let sdkType = getSdkUnion(context, type);
973
+ const isNull = false;
974
+ if (sdkType.kind === "nullable") {
975
+ sdkType = sdkType.type;
976
+ }
954
977
  const nonNullOptions = getNonNullOptions(type);
955
978
  if (sdkType === undefined) {
956
979
  throw Error("Should not have an empty union");
@@ -971,7 +994,7 @@ function emitUnion(context, type, usage) {
971
994
  ? normalizeName(unionName, NameType.Interface)
972
995
  : undefined;
973
996
  return {
974
- nullable: sdkType.nullable,
997
+ nullable: isNull,
975
998
  name: unionTypeName,
976
999
  description: `Type of ${unionTypeName}`,
977
1000
  internal: true,
@@ -983,7 +1006,8 @@ function emitUnion(context, type, usage) {
983
1006
  alias: unionName === "" || unionName === undefined ? undefined : unionName,
984
1007
  aliasType: unionName === "" || unionName === undefined
985
1008
  ? undefined
986
- : variantTypes.map((x) => getTypeName(x).name).join(" | ")
1009
+ : variantTypes.map((x) => getTypeName(x).name).join(" | "),
1010
+ tcgcType: sdkType
987
1011
  };
988
1012
  }
989
1013
  else if (sdkType.kind === "enum") {
@@ -997,13 +1021,14 @@ function emitUnion(context, type, usage) {
997
1021
  : undefined;
998
1022
  return {
999
1023
  name: typeName,
1000
- nullable: sdkType.nullable,
1024
+ nullable: isNull,
1001
1025
  description: sdkType.description || `Type of ${typeName}`,
1002
1026
  internal: true,
1003
1027
  type: sdkType.kind,
1004
1028
  valueType: emitSimpleType(context, sdkType.valueType),
1005
1029
  values: sdkType.values.map((x) => emitEnumMember(context, x)),
1006
1030
  isFixed: sdkType.isFixed,
1031
+ isNonExhaustive: (_c = (_b = context.rlcOptions) === null || _b === void 0 ? void 0 : _b.experimentalExtensibleEnums) !== null && _c !== void 0 ? _c : false,
1007
1032
  xmlMetadata: {},
1008
1033
  usage
1009
1034
  };
@@ -1011,13 +1036,13 @@ function emitUnion(context, type, usage) {
1011
1036
  else if (nonNullOptions.length === 1 && nonNullOptions[0]) {
1012
1037
  return {
1013
1038
  ...emitType(context, nonNullOptions[0], usage),
1014
- nullable: sdkType.nullable
1039
+ nullable: isNull
1015
1040
  };
1016
1041
  }
1017
1042
  else {
1018
1043
  return {
1019
1044
  ...emitType(context, sdkType.__raw, usage),
1020
- nullable: sdkType.nullable
1045
+ nullable: isNull
1021
1046
  };
1022
1047
  }
1023
1048
  }
@@ -1049,7 +1074,7 @@ function emitSimpleType(context, type) {
1049
1074
  sdkType = type;
1050
1075
  }
1051
1076
  return {
1052
- nullable: sdkType.nullable,
1077
+ nullable: isNullType(sdkType.__raw),
1053
1078
  type: sdkType.kind === "string" ? "string" : "number", // TODO: handle other types
1054
1079
  doc: "",
1055
1080
  apiVersions: [],
@@ -1358,7 +1383,7 @@ function getNamespaces(context) {
1358
1383
  return namespaces;
1359
1384
  }
1360
1385
  export function emitCodeModel(dpgContext, rlcModelsMap, modularSourcesRoot, project, options = { casing: "snake" }) {
1361
- var _a, _b, _c, _d, _e;
1386
+ var _a, _b, _c, _d, _e, _f;
1362
1387
  CASING = (_a = options.casing) !== null && _a !== void 0 ? _a : CASING;
1363
1388
  const clientNamespaceString = (_b = getClientNamespaceString(dpgContext)) === null || _b === void 0 ? void 0 : _b.toLowerCase();
1364
1389
  // Get types
@@ -1366,14 +1391,15 @@ export function emitCodeModel(dpgContext, rlcModelsMap, modularSourcesRoot, proj
1366
1391
  options: (_c = dpgContext.rlcOptions) !== null && _c !== void 0 ? _c : {},
1367
1392
  modularOptions: {
1368
1393
  sourceRoot: modularSourcesRoot,
1369
- compatibilityMode: !!((_d = dpgContext.rlcOptions) === null || _d === void 0 ? void 0 : _d.compatibilityMode)
1394
+ compatibilityMode: !!((_d = dpgContext.rlcOptions) === null || _d === void 0 ? void 0 : _d.compatibilityMode),
1395
+ experimentalExtensibleEnums: !!((_e = dpgContext.rlcOptions) === null || _e === void 0 ? void 0 : _e.experimentalExtensibleEnums)
1370
1396
  },
1371
1397
  namespace: clientNamespaceString,
1372
1398
  subnamespaceToClients: {},
1373
1399
  clients: [],
1374
1400
  types: [],
1375
1401
  project,
1376
- runtimeImports: buildRuntimeImports((_e = dpgContext.rlcOptions) === null || _e === void 0 ? void 0 : _e.flavor)
1402
+ runtimeImports: buildRuntimeImports((_f = dpgContext.rlcOptions) === null || _f === void 0 ? void 0 : _f.flavor)
1377
1403
  };
1378
1404
  typesMap.clear();
1379
1405
  simpleTypesMap.clear();