@azure-tools/typespec-ts 0.12.0 → 0.13.0

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 (269) hide show
  1. package/.rush/temp/operation/build/all.log +1 -0
  2. package/.rush/temp/operation/build/state.json +3 -0
  3. package/.rush/temp/package-deps_build.json +205 -190
  4. package/.rush/temp/shrinkwrap-deps.json +488 -471
  5. package/CHANGELOG.md +7 -0
  6. package/dist/src/index.d.ts.map +1 -1
  7. package/dist/src/index.js +2 -1
  8. package/dist/src/index.js.map +1 -1
  9. package/dist/src/modelUtils.d.ts +1 -1
  10. package/dist/src/modelUtils.d.ts.map +1 -1
  11. package/dist/src/modelUtils.js +79 -56
  12. package/dist/src/modelUtils.js.map +1 -1
  13. package/dist/src/operationUtil.d.ts +26 -0
  14. package/dist/src/operationUtil.d.ts.map +1 -1
  15. package/dist/src/operationUtil.js +76 -17
  16. package/dist/src/operationUtil.js.map +1 -1
  17. package/dist/src/transform/transform.d.ts.map +1 -1
  18. package/dist/src/transform/transform.js +9 -6
  19. package/dist/src/transform/transform.js.map +1 -1
  20. package/dist/src/transform/transformApiVersionInfo.d.ts.map +1 -1
  21. package/dist/src/transform/transformApiVersionInfo.js +3 -3
  22. package/dist/src/transform/transformApiVersionInfo.js.map +1 -1
  23. package/dist/src/transform/transformHelperFunctionDetails.d.ts +6 -0
  24. package/dist/src/transform/transformHelperFunctionDetails.d.ts.map +1 -0
  25. package/dist/src/transform/{transformAnnotationDetails.js → transformHelperFunctionDetails.js} +2 -2
  26. package/dist/src/transform/transformHelperFunctionDetails.js.map +1 -0
  27. package/dist/src/transform/transformParameters.d.ts.map +1 -1
  28. package/dist/src/transform/transformParameters.js +41 -33
  29. package/dist/src/transform/transformParameters.js.map +1 -1
  30. package/dist/src/transform/transformPaths.d.ts.map +1 -1
  31. package/dist/src/transform/transformPaths.js +20 -12
  32. package/dist/src/transform/transformPaths.js.map +1 -1
  33. package/dist/src/transform/transformResponses.d.ts.map +1 -1
  34. package/dist/src/transform/transformResponses.js +29 -8
  35. package/dist/src/transform/transformResponses.js.map +1 -1
  36. package/dist/src/transform/transformSchemas.js +1 -1
  37. package/dist/src/transform/transformSchemas.js.map +1 -1
  38. package/dist/tsconfig.tsbuildinfo +1 -1
  39. package/package.json +41 -38
  40. package/src/index.ts +2 -0
  41. package/src/modelUtils.ts +143 -47
  42. package/src/operationUtil.ts +111 -22
  43. package/src/transform/transform.ts +20 -5
  44. package/src/transform/transformApiVersionInfo.ts +18 -3
  45. package/src/transform/{transformAnnotationDetails.ts → transformHelperFunctionDetails.ts} +3 -3
  46. package/src/transform/transformParameters.ts +71 -20
  47. package/src/transform/transformPaths.ts +30 -15
  48. package/src/transform/transformResponses.ts +50 -6
  49. package/src/transform/transformSchemas.ts +1 -1
  50. package/test/commands/cadl-ranch-list.ts +25 -28
  51. package/test/commands/gen-cadl-ranch.ts +6 -2
  52. package/test/integration/arrayItemTypes.spec.ts +2 -2
  53. package/test/integration/azurecore.spec.ts +64 -24
  54. package/test/integration/collectionFormat.spec.ts +44 -0
  55. package/test/integration/dictionary.spec.ts +2 -2
  56. package/test/integration/extensibleEnums.spec.ts +8 -8
  57. package/test/integration/fixedEnums.spec.ts +7 -7
  58. package/test/integration/generated/arrays/itemTypes/src/arrayItemTypesClient.ts +5 -1
  59. package/test/integration/generated/arrays/itemTypes/src/clientDefinitions.ts +20 -20
  60. package/test/integration/generated/arrays/itemTypes/src/logger.ts +5 -0
  61. package/test/integration/generated/authentication/apiKey/package.json +1 -1
  62. package/test/integration/generated/authentication/apiKey/src/authApiKeyClient.ts +6 -2
  63. package/test/integration/generated/authentication/apiKey/src/logger.ts +5 -0
  64. package/test/integration/generated/authentication/oauth2/src/authOauth2Client.ts +6 -2
  65. package/test/integration/generated/authentication/oauth2/src/logger.ts +5 -0
  66. package/test/integration/generated/authentication/union/src/authUnionClient.ts +6 -2
  67. package/test/integration/generated/authentication/union/src/logger.ts +5 -0
  68. package/test/integration/generated/azure/core/package.json +1 -1
  69. package/test/integration/generated/azure/core/src/azureCoreClient.ts +5 -1
  70. package/test/integration/generated/azure/core/src/clientDefinitions.ts +22 -8
  71. package/test/integration/generated/azure/core/src/isUnexpected.ts +18 -7
  72. package/test/integration/generated/azure/core/src/logger.ts +5 -0
  73. package/test/integration/generated/azure/core/src/outputModels.ts +7 -0
  74. package/test/integration/generated/azure/core/src/paginateHelper.ts +55 -5
  75. package/test/integration/generated/azure/core/src/parameters.ts +1 -0
  76. package/test/integration/generated/azure/core/src/responses.ts +23 -1
  77. package/test/integration/generated/azure/core-traits/package.json +1 -1
  78. package/test/integration/generated/azure/core-traits/src/azureCoreTraitsClient.ts +5 -1
  79. package/test/integration/generated/azure/core-traits/src/clientDefinitions.ts +7 -25
  80. package/test/integration/generated/azure/core-traits/src/isUnexpected.ts +6 -19
  81. package/test/integration/generated/azure/core-traits/src/logger.ts +5 -0
  82. package/test/integration/generated/azure/core-traits/src/outputModels.ts +15 -0
  83. package/test/integration/generated/azure/core-traits/src/parameters.ts +4 -19
  84. package/test/integration/generated/azure/core-traits/src/responses.ts +6 -30
  85. package/test/integration/generated/dictionary/package.json +1 -1
  86. package/test/integration/generated/dictionary/src/clientDefinitions.ts +22 -22
  87. package/test/integration/generated/dictionary/src/dictClient.ts +5 -1
  88. package/test/integration/generated/dictionary/src/logger.ts +5 -0
  89. package/test/integration/generated/enums/extensible/README.md +3 -3
  90. package/test/integration/generated/enums/extensible/package.json +1 -1
  91. package/test/integration/generated/enums/extensible/src/clientDefinitions.ts +5 -5
  92. package/test/integration/generated/enums/extensible/src/index.ts +3 -3
  93. package/test/integration/generated/enums/extensible/src/logger.ts +5 -0
  94. package/test/integration/generated/enums/extensible/src/{enumsExtensible.ts → typeEnumExtensible.ts} +9 -5
  95. package/test/integration/generated/enums/fixed/README.md +3 -3
  96. package/test/integration/generated/enums/fixed/package.json +1 -1
  97. package/test/integration/generated/enums/fixed/src/clientDefinitions.ts +5 -5
  98. package/test/integration/generated/enums/fixed/src/index.ts +3 -3
  99. package/test/integration/generated/enums/fixed/src/logger.ts +5 -0
  100. package/test/integration/generated/enums/fixed/src/{enumsFixed.ts → typeEnumFixed.ts} +9 -5
  101. package/test/integration/generated/internal/src/clientDefinitions.ts +38 -12
  102. package/test/integration/generated/internal/src/index.ts +0 -1
  103. package/test/integration/generated/internal/src/internalClient.ts +5 -1
  104. package/test/integration/generated/internal/src/logger.ts +5 -0
  105. package/test/integration/generated/internal/src/outputModels.ts +9 -5
  106. package/test/integration/generated/internal/src/parameters.ts +32 -8
  107. package/test/integration/generated/internal/src/responses.ts +18 -5
  108. package/test/integration/generated/lro/lroCore/README.md +3 -3
  109. package/test/integration/generated/lro/lroCore/package.json +2 -2
  110. package/test/integration/generated/lro/lroCore/src/clientDefinitions.ts +8 -5
  111. package/test/integration/generated/lro/lroCore/src/index.ts +3 -3
  112. package/test/integration/generated/lro/lroCore/src/isUnexpected.ts +14 -7
  113. package/test/integration/generated/lro/lroCore/src/logger.ts +5 -0
  114. package/test/integration/generated/lro/lroCore/src/pollingHelper.ts +38 -0
  115. package/test/integration/generated/lro/lroCore/src/responses.ts +18 -0
  116. package/test/integration/generated/lro/lroCore/src/{azureLroCore.ts → specsAzureCoreLroStandard.ts} +9 -5
  117. package/test/integration/generated/lro/{lroBasic → lroRPC}/README.md +7 -7
  118. package/test/integration/generated/lro/{lroBasic → lroRPC}/api-extractor.json +1 -1
  119. package/test/integration/generated/lro/{lroBasic → lroRPC}/package.json +6 -6
  120. package/test/integration/generated/lro/lroRPC/src/clientDefinitions.ts +79 -0
  121. package/test/integration/generated/{resiliency/devDriven → lro/lroRPC}/src/index.ts +4 -4
  122. package/test/integration/generated/{resiliency/devDriven → lro/lroRPC}/src/isUnexpected.ts +57 -21
  123. package/test/integration/generated/lro/lroRPC/src/logger.ts +5 -0
  124. package/test/integration/generated/lro/lroRPC/src/models.ts +8 -0
  125. package/test/integration/generated/lro/lroRPC/src/outputModels.ts +40 -0
  126. package/test/integration/generated/lro/lroRPC/src/parameters.ts +20 -0
  127. package/test/integration/generated/lro/{lroBasic → lroRPC}/src/pollingHelper.ts +52 -0
  128. package/test/integration/generated/lro/lroRPC/src/responses.ts +124 -0
  129. package/test/integration/generated/lro/lroRPC/src/specsAzureCoreLroRpc.ts +35 -0
  130. package/test/integration/generated/lro/{lroBasic → lroRPC}/tspconfig.yaml +2 -2
  131. package/test/integration/generated/models/inheritance/README.md +3 -3
  132. package/test/integration/generated/models/inheritance/package.json +1 -1
  133. package/test/integration/generated/models/inheritance/src/clientDefinitions.ts +13 -11
  134. package/test/integration/generated/models/inheritance/src/index.ts +3 -3
  135. package/test/integration/generated/models/inheritance/src/logger.ts +5 -0
  136. package/test/integration/generated/models/inheritance/src/{modelsInheritance.ts → typeModelInheritance.ts} +9 -5
  137. package/test/integration/generated/models/propertyNullable/README.md +3 -3
  138. package/test/integration/generated/models/propertyNullable/package.json +1 -1
  139. package/test/integration/generated/models/propertyNullable/src/clientDefinitions.ts +43 -43
  140. package/test/integration/generated/models/propertyNullable/src/index.ts +3 -3
  141. package/test/integration/generated/models/propertyNullable/src/logger.ts +5 -0
  142. package/test/integration/generated/models/propertyNullable/src/parameters.ts +14 -12
  143. package/test/integration/generated/models/propertyNullable/src/responses.ts +4 -4
  144. package/test/integration/generated/models/propertyNullable/src/{modelsPropertyNullable.ts → typePropertyNullable.ts} +9 -5
  145. package/test/integration/generated/models/propertyOptional/README.md +3 -3
  146. package/test/integration/generated/models/propertyOptional/package.json +1 -1
  147. package/test/integration/generated/models/propertyOptional/src/clientDefinitions.ts +47 -47
  148. package/test/integration/generated/models/propertyOptional/src/index.ts +3 -3
  149. package/test/integration/generated/models/propertyOptional/src/logger.ts +5 -0
  150. package/test/integration/generated/models/propertyOptional/src/parameters.ts +7 -6
  151. package/test/integration/generated/models/propertyOptional/src/responses.ts +4 -4
  152. package/test/integration/generated/models/propertyOptional/src/{modelsPropertyOptional.ts → typePropertyOptional.ts} +9 -5
  153. package/test/integration/generated/models/propertyTypes/README.md +3 -3
  154. package/test/integration/generated/models/propertyTypes/package.json +1 -1
  155. package/test/integration/generated/models/propertyTypes/src/clientDefinitions.ts +123 -47
  156. package/test/integration/generated/models/propertyTypes/src/index.ts +3 -3
  157. package/test/integration/generated/models/propertyTypes/src/logger.ts +5 -0
  158. package/test/integration/generated/models/propertyTypes/src/models.ts +24 -0
  159. package/test/integration/generated/models/propertyTypes/src/outputModels.ts +24 -0
  160. package/test/integration/generated/models/propertyTypes/src/parameters.ts +48 -6
  161. package/test/integration/generated/models/propertyTypes/src/responses.ts +52 -4
  162. package/test/integration/generated/models/propertyTypes/src/{modelsPropertyTypes.ts → typePropertyValueTypes.ts} +9 -5
  163. package/test/integration/generated/models/usage/README.md +3 -3
  164. package/test/integration/generated/models/usage/package.json +1 -1
  165. package/test/integration/generated/models/usage/src/clientDefinitions.ts +7 -7
  166. package/test/integration/generated/models/usage/src/index.ts +3 -3
  167. package/test/integration/generated/models/usage/src/logger.ts +5 -0
  168. package/test/integration/generated/models/usage/src/{modelsUsage.ts → typeModelUsage.ts} +9 -5
  169. package/test/integration/generated/models/visibility/README.md +3 -3
  170. package/test/integration/generated/models/visibility/package.json +1 -1
  171. package/test/integration/generated/models/visibility/src/clientDefinitions.ts +3 -3
  172. package/test/integration/generated/models/visibility/src/index.ts +3 -3
  173. package/test/integration/generated/models/visibility/src/logger.ts +5 -0
  174. package/test/integration/generated/models/visibility/src/{modelsVisibilityAutomatic.ts → typeModelVisibility.ts} +9 -5
  175. package/test/integration/generated/parameters/collection-format/src/clientDefinitions.ts +24 -0
  176. package/test/integration/generated/parameters/collection-format/src/collectionFormatClient.ts +5 -1
  177. package/test/integration/generated/parameters/collection-format/src/logger.ts +5 -0
  178. package/test/integration/generated/parameters/collection-format/src/parameters.ts +33 -0
  179. package/test/integration/generated/parameters/collection-format/src/responses.ts +15 -0
  180. package/test/integration/generated/parameters/collection-format/src/serializeHelper.ts +12 -0
  181. package/test/integration/generated/parameters/spread/src/clientDefinitions.ts +61 -0
  182. package/test/integration/generated/{lro/lroBasic → parameters/spread}/src/index.ts +4 -5
  183. package/test/integration/generated/parameters/spread/src/logger.ts +5 -0
  184. package/test/integration/generated/{lro/lroBasic/src/outputModels.ts → parameters/spread/src/models.ts} +2 -3
  185. package/test/integration/generated/parameters/spread/src/parameters.ts +61 -0
  186. package/test/integration/generated/{lro/lroBasic/src/azureLro.ts → parameters/spread/src/parametersSpread.ts} +10 -6
  187. package/test/integration/generated/parameters/spread/src/responses.ts +25 -0
  188. package/test/integration/generated/{resiliency/devDriven → parameters/spread}/tspconfig.yaml +2 -4
  189. package/test/integration/generated/projection/src/clientDefinitions.ts +47 -21
  190. package/test/integration/generated/projection/src/logger.ts +5 -0
  191. package/test/integration/generated/projection/src/models.ts +18 -7
  192. package/test/integration/generated/projection/src/parameters.ts +32 -10
  193. package/test/integration/generated/projection/src/projectionClient.ts +5 -1
  194. package/test/integration/generated/projection/src/responses.ts +18 -3
  195. package/test/integration/generated/resiliency/srvDriven1/README.md +4 -4
  196. package/test/integration/generated/resiliency/srvDriven1/package.json +1 -1
  197. package/test/integration/generated/resiliency/srvDriven1/src/clientDefinitions.ts +25 -49
  198. package/test/integration/generated/resiliency/srvDriven1/src/index.ts +3 -5
  199. package/test/integration/generated/resiliency/srvDriven1/src/logger.ts +5 -0
  200. package/test/integration/generated/resiliency/srvDriven1/src/parameters.ts +11 -32
  201. package/test/integration/generated/resiliency/srvDriven1/src/responses.ts +9 -24
  202. package/test/integration/generated/resiliency/srvDriven1/src/serviceDrivenOldClient.ts +43 -0
  203. package/test/integration/generated/resiliency/srvDriven1/tspconfig.yaml +1 -0
  204. package/test/integration/generated/resiliency/srvDriven2/README.md +13 -4
  205. package/test/integration/generated/resiliency/srvDriven2/package.json +1 -1
  206. package/test/integration/generated/resiliency/srvDriven2/src/clientDefinitions.ts +32 -68
  207. package/test/integration/generated/resiliency/srvDriven2/src/index.ts +3 -5
  208. package/test/integration/generated/resiliency/srvDriven2/src/logger.ts +5 -0
  209. package/test/integration/generated/resiliency/srvDriven2/src/parameters.ts +19 -42
  210. package/test/integration/generated/resiliency/srvDriven2/src/responses.ts +10 -31
  211. package/test/integration/generated/resiliency/srvDriven2/src/serviceDrivenNewClient.ts +43 -0
  212. package/test/integration/generated/resiliency/srvDriven2/tspconfig.yaml +1 -0
  213. package/test/integration/generated/server/path/multiple/src/logger.ts +5 -0
  214. package/test/integration/generated/server/path/multiple/src/multipleParamInServerPathClient.ts +6 -2
  215. package/test/integration/generated/server/path/single/src/logger.ts +5 -0
  216. package/test/integration/generated/server/path/single/src/singleParamInServerPathClient.ts +6 -2
  217. package/test/integration/generated/specialWords/src/logger.ts +5 -0
  218. package/test/integration/generated/specialWords/src/specialWordsClient.ts +5 -1
  219. package/test/integration/generated/unions/src/clientDefinitions.ts +8 -8
  220. package/test/integration/generated/unions/src/logger.ts +5 -0
  221. package/test/integration/generated/unions/src/unionsClient.ts +5 -1
  222. package/test/integration/internal.spec.ts +45 -12
  223. package/test/integration/lroCore.spec.ts +89 -0
  224. package/test/integration/modelInheritance.spec.ts +13 -13
  225. package/test/integration/modelPropertyNullable.spec.ts +8 -8
  226. package/test/integration/modelPropertyOptional.spec.ts +32 -32
  227. package/test/integration/modelPropertyType.spec.ts +22 -6
  228. package/test/integration/modelUsage.spec.ts +7 -7
  229. package/test/integration/projection.spec.ts +62 -15
  230. package/test/integration/resiliencyDpgCustomization.spec.ts +133 -38
  231. package/test/integration/spreadParameters.spec.ts +82 -0
  232. package/test/integration/unions.spec.ts +4 -4
  233. package/test/unit/apiVersion.spec.ts +19 -7
  234. package/test/unit/clientFactoryGenerator.spec.ts +44 -16
  235. package/test/unit/modelsGenerator.spec.ts +212 -2
  236. package/test/unit/util/emitUtil.ts +13 -4
  237. package/test/unit/util/testUtil.ts +7 -2
  238. package/typespec-ts.build.log +0 -1
  239. package/dist/src/transform/transformAnnotationDetails.d.ts +0 -6
  240. package/dist/src/transform/transformAnnotationDetails.d.ts.map +0 -1
  241. package/dist/src/transform/transformAnnotationDetails.js.map +0 -1
  242. package/test/integration/generated/internal/src/models.ts +0 -8
  243. package/test/integration/generated/lro/lroBasic/src/clientDefinitions.ts +0 -37
  244. package/test/integration/generated/lro/lroBasic/src/parameters.ts +0 -8
  245. package/test/integration/generated/lro/lroBasic/src/responses.ts +0 -23
  246. package/test/integration/generated/resiliency/devDriven/.eslintrc.json +0 -11
  247. package/test/integration/generated/resiliency/devDriven/README.md +0 -56
  248. package/test/integration/generated/resiliency/devDriven/api-extractor.json +0 -18
  249. package/test/integration/generated/resiliency/devDriven/package.json +0 -81
  250. package/test/integration/generated/resiliency/devDriven/rollup.config.js +0 -118
  251. package/test/integration/generated/resiliency/devDriven/src/clientDefinitions.ts +0 -75
  252. package/test/integration/generated/resiliency/devDriven/src/models.ts +0 -8
  253. package/test/integration/generated/resiliency/devDriven/src/outputModels.ts +0 -25
  254. package/test/integration/generated/resiliency/devDriven/src/paginateHelper.ts +0 -154
  255. package/test/integration/generated/resiliency/devDriven/src/parameters.ts +0 -17
  256. package/test/integration/generated/resiliency/devDriven/src/resiliencyDevDriven.ts +0 -31
  257. package/test/integration/generated/resiliency/devDriven/src/responses.ts +0 -62
  258. package/test/integration/generated/resiliency/devDriven/tsconfig.json +0 -25
  259. package/test/integration/generated/resiliency/srvDriven1/src/models.ts +0 -6
  260. package/test/integration/generated/resiliency/srvDriven1/src/outputModels.ts +0 -6
  261. package/test/integration/generated/resiliency/srvDriven1/src/resiliencyServiceDriven1.ts +0 -31
  262. package/test/integration/generated/resiliency/srvDriven2/src/models.ts +0 -6
  263. package/test/integration/generated/resiliency/srvDriven2/src/outputModels.ts +0 -6
  264. package/test/integration/generated/resiliency/srvDriven2/src/resiliencyServiceDriven2.ts +0 -31
  265. package/test/integration/helloWorld.spec.ts +0 -20
  266. package/test/integration/lroBasic.spec.ts +0 -25
  267. /package/test/integration/generated/lro/{lroBasic → lroRPC}/.eslintrc.json +0 -0
  268. /package/test/integration/generated/lro/{lroBasic → lroRPC}/rollup.config.js +0 -0
  269. /package/test/integration/generated/lro/{lroBasic → lroRPC}/tsconfig.json +0 -0
@@ -0,0 +1,35 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+
4
+ import { getClient, ClientOptions } from "@azure-rest/core-client";
5
+ import { logger } from "./logger";
6
+ import { SpecsAzureCoreLroRpcClient } from "./clientDefinitions";
7
+
8
+ /**
9
+ * Initialize a new instance of `SpecsAzureCoreLroRpcClient`
10
+ * @param options - the parameter for all optional parameters
11
+ */
12
+ export default function createClient(
13
+ options: ClientOptions = {}
14
+ ): SpecsAzureCoreLroRpcClient {
15
+ const baseUrl = options.baseUrl ?? `http://localhost:3000`;
16
+ options.apiVersion = options.apiVersion ?? "2022-12-01-preview";
17
+ const userAgentInfo = `azsdk-js-lro-rpc-rest/1.0.0`;
18
+ const userAgentPrefix =
19
+ options.userAgentOptions && options.userAgentOptions.userAgentPrefix
20
+ ? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
21
+ : `${userAgentInfo}`;
22
+ options = {
23
+ ...options,
24
+ userAgentOptions: {
25
+ userAgentPrefix,
26
+ },
27
+ loggingOptions: {
28
+ logger: options.loggingOptions?.logger ?? logger.info,
29
+ },
30
+ };
31
+
32
+ const client = getClient(baseUrl, options) as SpecsAzureCoreLroRpcClient;
33
+
34
+ return client;
35
+ }
@@ -9,6 +9,6 @@ options:
9
9
  azureSdkForJs: false
10
10
  isCadlTest: true
11
11
  packageDetails:
12
- name: "@msinternal/lro-basic"
13
- description: "LRO Basic Test Service"
12
+ name: "@msinternal/lro-rpc"
13
+ description: "LRO RPC Test Service"
14
14
  version: "1.0.0"
@@ -1,4 +1,4 @@
1
- # ModelsInheritance REST client library for JavaScript
1
+ # TypeModelInheritance REST client library for JavaScript
2
2
 
3
3
  Illustrates inheritance and polymorphic model.
4
4
 
@@ -20,13 +20,13 @@ Key links:
20
20
 
21
21
  ### Install the `@msinternal/model-inheritance` package
22
22
 
23
- Install the ModelsInheritance REST client REST client library for JavaScript with `npm`:
23
+ Install the TypeModelInheritance REST client REST client library for JavaScript with `npm`:
24
24
 
25
25
  ```bash
26
26
  npm install @msinternal/model-inheritance
27
27
  ```
28
28
 
29
- ### Create and authenticate a `ModelsInheritanceClient`
29
+ ### Create and authenticate a `TypeModelInheritanceClient`
30
30
 
31
31
  To use an [Azure Active Directory (AAD) token credential](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token),
32
32
  provide an instance of the desired credential type obtained from the
@@ -52,7 +52,7 @@
52
52
  "autoPublish": false,
53
53
  "dependencies": {
54
54
  "@azure/core-auth": "^1.3.0",
55
- "@azure-rest/core-client": "^1.1.2",
55
+ "@azure-rest/core-client": "^1.1.3",
56
56
  "@azure/core-rest-pipeline": "^1.8.0",
57
57
  "@azure/logger": "^1.0.0",
58
58
  "tslib": "^2.2.0"
@@ -58,22 +58,24 @@ export interface GetWrongDiscriminator {
58
58
  }
59
59
 
60
60
  export interface Routes {
61
- /** Resource for '/models/inheritance/valid' has methods for the following verbs: post, get, put */
62
- (path: "/models/inheritance/valid"): PostValid;
63
- /** Resource for '/models/inheritance/discriminated/model' has methods for the following verbs: get, put */
64
- (path: "/models/inheritance/discriminated/model"): GetModel;
65
- /** Resource for '/models/inheritance/discriminated/recursivemodel' has methods for the following verbs: get, put */
66
- (path: "/models/inheritance/discriminated/recursivemodel"): GetRecursiveModel;
67
- /** Resource for '/models/inheritance/discriminated/missingdiscriminator' has methods for the following verbs: get */
61
+ /** Resource for '/type/model/inheritance/valid' has methods for the following verbs: post, get, put */
62
+ (path: "/type/model/inheritance/valid"): PostValid;
63
+ /** Resource for '/type/model/inheritance/discriminated/model' has methods for the following verbs: get, put */
64
+ (path: "/type/model/inheritance/discriminated/model"): GetModel;
65
+ /** Resource for '/type/model/inheritance/discriminated/recursivemodel' has methods for the following verbs: get, put */
68
66
  (
69
- path: "/models/inheritance/discriminated/missingdiscriminator"
67
+ path: "/type/model/inheritance/discriminated/recursivemodel"
68
+ ): GetRecursiveModel;
69
+ /** Resource for '/type/model/inheritance/discriminated/missingdiscriminator' has methods for the following verbs: get */
70
+ (
71
+ path: "/type/model/inheritance/discriminated/missingdiscriminator"
70
72
  ): GetMissingDiscriminator;
71
- /** Resource for '/models/inheritance/discriminated/wrongdiscriminator' has methods for the following verbs: get */
73
+ /** Resource for '/type/model/inheritance/discriminated/wrongdiscriminator' has methods for the following verbs: get */
72
74
  (
73
- path: "/models/inheritance/discriminated/wrongdiscriminator"
75
+ path: "/type/model/inheritance/discriminated/wrongdiscriminator"
74
76
  ): GetWrongDiscriminator;
75
77
  }
76
78
 
77
- export type ModelsInheritanceClient = Client & {
79
+ export type TypeModelInheritanceClient = Client & {
78
80
  path: Routes;
79
81
  };
@@ -1,13 +1,13 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
3
 
4
- import ModelsInheritance from "./modelsInheritance";
4
+ import TypeModelInheritance from "./typeModelInheritance";
5
5
 
6
- export * from "./modelsInheritance";
6
+ export * from "./typeModelInheritance";
7
7
  export * from "./parameters";
8
8
  export * from "./responses";
9
9
  export * from "./clientDefinitions";
10
10
  export * from "./models";
11
11
  export * from "./outputModels";
12
12
 
13
- export default ModelsInheritance;
13
+ export default TypeModelInheritance;
@@ -0,0 +1,5 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+
4
+ import { createClientLogger } from "@azure/logger";
5
+ export const logger = createClientLogger("model-inheritance");
@@ -2,15 +2,16 @@
2
2
  // Licensed under the MIT license.
3
3
 
4
4
  import { getClient, ClientOptions } from "@azure-rest/core-client";
5
- import { ModelsInheritanceClient } from "./clientDefinitions";
5
+ import { logger } from "./logger";
6
+ import { TypeModelInheritanceClient } from "./clientDefinitions";
6
7
 
7
8
  /**
8
- * Initialize a new instance of `ModelsInheritanceClient`
9
- * @param options type: ClientOptions, the parameter for all optional parameters
9
+ * Initialize a new instance of `TypeModelInheritanceClient`
10
+ * @param options - the parameter for all optional parameters
10
11
  */
11
12
  export default function createClient(
12
13
  options: ClientOptions = {}
13
- ): ModelsInheritanceClient {
14
+ ): TypeModelInheritanceClient {
14
15
  const baseUrl = options.baseUrl ?? `http://localhost:3000`;
15
16
  options.apiVersion = options.apiVersion ?? "1.0.0";
16
17
  const userAgentInfo = `azsdk-js-model-inheritance-rest/1.0.0`;
@@ -23,9 +24,12 @@ export default function createClient(
23
24
  userAgentOptions: {
24
25
  userAgentPrefix,
25
26
  },
27
+ loggingOptions: {
28
+ logger: options.loggingOptions?.logger ?? logger.info,
29
+ },
26
30
  };
27
31
 
28
- const client = getClient(baseUrl, options) as ModelsInheritanceClient;
32
+ const client = getClient(baseUrl, options) as TypeModelInheritanceClient;
29
33
 
30
34
  return client;
31
35
  }
@@ -1,4 +1,4 @@
1
- # ModelsPropertyNullable REST client library for JavaScript
1
+ # TypePropertyNullable REST client library for JavaScript
2
2
 
3
3
  Illustrates models with nullable properties.
4
4
 
@@ -20,13 +20,13 @@ Key links:
20
20
 
21
21
  ### Install the `@msinternal/nullable-property` package
22
22
 
23
- Install the ModelsPropertyNullable REST client REST client library for JavaScript with `npm`:
23
+ Install the TypePropertyNullable REST client REST client library for JavaScript with `npm`:
24
24
 
25
25
  ```bash
26
26
  npm install @msinternal/nullable-property
27
27
  ```
28
28
 
29
- ### Create and authenticate a `ModelsPropertyNullableClient`
29
+ ### Create and authenticate a `TypePropertyNullableClient`
30
30
 
31
31
  To use an [Azure Active Directory (AAD) token credential](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token),
32
32
  provide an instance of the desired credential type obtained from the
@@ -52,7 +52,7 @@
52
52
  "autoPublish": false,
53
53
  "dependencies": {
54
54
  "@azure/core-auth": "^1.3.0",
55
- "@azure-rest/core-client": "^1.1.2",
55
+ "@azure-rest/core-client": "^1.1.3",
56
56
  "@azure/core-rest-pipeline": "^1.8.0",
57
57
  "@azure/logger": "^1.0.0",
58
58
  "tslib": "^2.2.0"
@@ -2,10 +2,10 @@
2
2
  // Licensed under the MIT license.
3
3
 
4
4
  import {
5
- StringGetNonNullParameters,
6
- StringPatchNonNullParameters,
7
- StringGetNullParameters,
8
- StringPatchNullParameters,
5
+ StringModelGetNonNullParameters,
6
+ StringModelPatchNonNullParameters,
7
+ StringModelGetNullParameters,
8
+ StringModelPatchNullParameters,
9
9
  BytesGetNonNullParameters,
10
10
  BytesPatchNonNullParameters,
11
11
  BytesGetNullParameters,
@@ -28,10 +28,10 @@ import {
28
28
  CollectionsModelPatchNullParameters,
29
29
  } from "./parameters";
30
30
  import {
31
- StringGetNonNull200Response,
32
- StringPatchNonNull204Response,
33
- StringGetNull200Response,
34
- StringPatchNull204Response,
31
+ StringModelGetNonNull200Response,
32
+ StringModelPatchNonNull204Response,
33
+ StringModelGetNull200Response,
34
+ StringModelPatchNull204Response,
35
35
  BytesGetNonNull200Response,
36
36
  BytesPatchNonNull204Response,
37
37
  BytesGetNull200Response,
@@ -55,26 +55,26 @@ import {
55
55
  } from "./responses";
56
56
  import { Client, StreamableMethod } from "@azure-rest/core-client";
57
57
 
58
- export interface StringGetNonNull {
58
+ export interface StringModelGetNonNull {
59
59
  /** Get models that will return all properties in the model */
60
60
  get(
61
- options?: StringGetNonNullParameters
62
- ): StreamableMethod<StringGetNonNull200Response>;
61
+ options?: StringModelGetNonNullParameters
62
+ ): StreamableMethod<StringModelGetNonNull200Response>;
63
63
  /** Put a body with all properties present. */
64
64
  patch(
65
- options: StringPatchNonNullParameters
66
- ): StreamableMethod<StringPatchNonNull204Response>;
65
+ options: StringModelPatchNonNullParameters
66
+ ): StreamableMethod<StringModelPatchNonNull204Response>;
67
67
  }
68
68
 
69
- export interface StringGetNull {
69
+ export interface StringModelGetNull {
70
70
  /** Get models that will return the default object */
71
71
  get(
72
- options?: StringGetNullParameters
73
- ): StreamableMethod<StringGetNull200Response>;
72
+ options?: StringModelGetNullParameters
73
+ ): StreamableMethod<StringModelGetNull200Response>;
74
74
  /** Put a body with default properties. */
75
75
  patch(
76
- options: StringPatchNullParameters
77
- ): StreamableMethod<StringPatchNull204Response>;
76
+ options: StringModelPatchNullParameters
77
+ ): StreamableMethod<StringModelPatchNull204Response>;
78
78
  }
79
79
 
80
80
  export interface BytesGetNonNull {
@@ -188,40 +188,40 @@ export interface CollectionsModelGetNull {
188
188
  }
189
189
 
190
190
  export interface Routes {
191
- /** Resource for '/models/properties/nullable/string/non-null' has methods for the following verbs: get, patch */
192
- (path: "/models/properties/nullable/string/non-null"): StringGetNonNull;
193
- /** Resource for '/models/properties/nullable/string/null' has methods for the following verbs: get, patch */
194
- (path: "/models/properties/nullable/string/null"): StringGetNull;
195
- /** Resource for '/models/properties/nullable/bytes/non-null' has methods for the following verbs: get, patch */
196
- (path: "/models/properties/nullable/bytes/non-null"): BytesGetNonNull;
197
- /** Resource for '/models/properties/nullable/bytes/null' has methods for the following verbs: get, patch */
198
- (path: "/models/properties/nullable/bytes/null"): BytesGetNull;
199
- /** Resource for '/models/properties/nullable/datetime/non-null' has methods for the following verbs: get, patch */
200
- (path: "/models/properties/nullable/datetime/non-null"): DatetimeGetNonNull;
201
- /** Resource for '/models/properties/nullable/datetime/null' has methods for the following verbs: get, patch */
202
- (path: "/models/properties/nullable/datetime/null"): DatetimeGetNull;
203
- /** Resource for '/models/properties/nullable/duration/non-null' has methods for the following verbs: get, patch */
204
- (path: "/models/properties/nullable/duration/non-null"): DurationGetNonNull;
205
- /** Resource for '/models/properties/nullable/duration/null' has methods for the following verbs: get, patch */
206
- (path: "/models/properties/nullable/duration/null"): DurationGetNull;
207
- /** Resource for '/models/properties/nullable/collections/bytes/non-null' has methods for the following verbs: get, patch */
191
+ /** Resource for '/type/property/nullable/string/non-null' has methods for the following verbs: get, patch */
192
+ (path: "/type/property/nullable/string/non-null"): StringModelGetNonNull;
193
+ /** Resource for '/type/property/nullable/string/null' has methods for the following verbs: get, patch */
194
+ (path: "/type/property/nullable/string/null"): StringModelGetNull;
195
+ /** Resource for '/type/property/nullable/bytes/non-null' has methods for the following verbs: get, patch */
196
+ (path: "/type/property/nullable/bytes/non-null"): BytesGetNonNull;
197
+ /** Resource for '/type/property/nullable/bytes/null' has methods for the following verbs: get, patch */
198
+ (path: "/type/property/nullable/bytes/null"): BytesGetNull;
199
+ /** Resource for '/type/property/nullable/datetime/non-null' has methods for the following verbs: get, patch */
200
+ (path: "/type/property/nullable/datetime/non-null"): DatetimeGetNonNull;
201
+ /** Resource for '/type/property/nullable/datetime/null' has methods for the following verbs: get, patch */
202
+ (path: "/type/property/nullable/datetime/null"): DatetimeGetNull;
203
+ /** Resource for '/type/property/nullable/duration/non-null' has methods for the following verbs: get, patch */
204
+ (path: "/type/property/nullable/duration/non-null"): DurationGetNonNull;
205
+ /** Resource for '/type/property/nullable/duration/null' has methods for the following verbs: get, patch */
206
+ (path: "/type/property/nullable/duration/null"): DurationGetNull;
207
+ /** Resource for '/type/property/nullable/collections/bytes/non-null' has methods for the following verbs: get, patch */
208
208
  (
209
- path: "/models/properties/nullable/collections/bytes/non-null"
209
+ path: "/type/property/nullable/collections/bytes/non-null"
210
210
  ): CollectionsByteGetNonNull;
211
- /** Resource for '/models/properties/nullable/collections/bytes/null' has methods for the following verbs: get, patch */
211
+ /** Resource for '/type/property/nullable/collections/bytes/null' has methods for the following verbs: get, patch */
212
212
  (
213
- path: "/models/properties/nullable/collections/bytes/null"
213
+ path: "/type/property/nullable/collections/bytes/null"
214
214
  ): CollectionsByteGetNull;
215
- /** Resource for '/models/properties/nullable/collections/model/non-null' has methods for the following verbs: get, patch */
215
+ /** Resource for '/type/property/nullable/collections/model/non-null' has methods for the following verbs: get, patch */
216
216
  (
217
- path: "/models/properties/nullable/collections/model/non-null"
217
+ path: "/type/property/nullable/collections/model/non-null"
218
218
  ): CollectionsModelGetNonNull;
219
- /** Resource for '/models/properties/nullable/collections/model/null' has methods for the following verbs: get, patch */
219
+ /** Resource for '/type/property/nullable/collections/model/null' has methods for the following verbs: get, patch */
220
220
  (
221
- path: "/models/properties/nullable/collections/model/null"
221
+ path: "/type/property/nullable/collections/model/null"
222
222
  ): CollectionsModelGetNull;
223
223
  }
224
224
 
225
- export type ModelsPropertyNullableClient = Client & {
225
+ export type TypePropertyNullableClient = Client & {
226
226
  path: Routes;
227
227
  };
@@ -1,13 +1,13 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
3
 
4
- import ModelsPropertyNullable from "./modelsPropertyNullable";
4
+ import TypePropertyNullable from "./typePropertyNullable";
5
5
 
6
- export * from "./modelsPropertyNullable";
6
+ export * from "./typePropertyNullable";
7
7
  export * from "./parameters";
8
8
  export * from "./responses";
9
9
  export * from "./clientDefinitions";
10
10
  export * from "./models";
11
11
  export * from "./outputModels";
12
12
 
13
- export default ModelsPropertyNullable;
13
+ export default TypePropertyNullable;
@@ -0,0 +1,5 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+
4
+ import { createClientLogger } from "@azure/logger";
5
+ export const logger = createClientLogger("nullable-property");
@@ -11,35 +11,37 @@ import {
11
11
  CollectionsModelProperty,
12
12
  } from "./models";
13
13
 
14
- export type StringGetNonNullParameters = RequestParameters;
15
- export type StringGetNullParameters = RequestParameters;
14
+ export type StringModelGetNonNullParameters = RequestParameters;
15
+ export type StringModelGetNullParameters = RequestParameters;
16
16
  export type StringPropertyResourceMergeAndPatch = Partial<StringProperty>;
17
17
 
18
- export interface StringPatchNonNullBodyParam {
18
+ export interface StringModelPatchNonNullBodyParam {
19
19
  body: StringPropertyResourceMergeAndPatch;
20
20
  }
21
21
 
22
- export interface StringPatchNonNullMediaTypesParam {
22
+ export interface StringModelPatchNonNullMediaTypesParam {
23
23
  /** content-type is application/merge-patch+json */
24
24
  contentType: "application/merge-patch+json";
25
25
  }
26
26
 
27
- export type StringPatchNonNullParameters = StringPatchNonNullMediaTypesParam &
28
- StringPatchNonNullBodyParam &
29
- RequestParameters;
27
+ export type StringModelPatchNonNullParameters =
28
+ StringModelPatchNonNullMediaTypesParam &
29
+ StringModelPatchNonNullBodyParam &
30
+ RequestParameters;
30
31
 
31
- export interface StringPatchNullBodyParam {
32
+ export interface StringModelPatchNullBodyParam {
32
33
  body: StringPropertyResourceMergeAndPatch;
33
34
  }
34
35
 
35
- export interface StringPatchNullMediaTypesParam {
36
+ export interface StringModelPatchNullMediaTypesParam {
36
37
  /** content-type is application/merge-patch+json */
37
38
  contentType: "application/merge-patch+json";
38
39
  }
39
40
 
40
- export type StringPatchNullParameters = StringPatchNullMediaTypesParam &
41
- StringPatchNullBodyParam &
42
- RequestParameters;
41
+ export type StringModelPatchNullParameters =
42
+ StringModelPatchNullMediaTypesParam &
43
+ StringModelPatchNullBodyParam &
44
+ RequestParameters;
43
45
  export type BytesGetNonNullParameters = RequestParameters;
44
46
  export type BytesGetNullParameters = RequestParameters;
45
47
  export type BytesPropertyResourceMergeAndPatch = Partial<BytesProperty>;
@@ -12,24 +12,24 @@ import {
12
12
  } from "./outputModels";
13
13
 
14
14
  /** The request has succeeded. */
15
- export interface StringGetNonNull200Response extends HttpResponse {
15
+ export interface StringModelGetNonNull200Response extends HttpResponse {
16
16
  status: "200";
17
17
  body: StringPropertyOutput;
18
18
  }
19
19
 
20
20
  /** The request has succeeded. */
21
- export interface StringGetNull200Response extends HttpResponse {
21
+ export interface StringModelGetNull200Response extends HttpResponse {
22
22
  status: "200";
23
23
  body: StringPropertyOutput;
24
24
  }
25
25
 
26
26
  /** There is no content to send for this request, but the headers may be useful. */
27
- export interface StringPatchNonNull204Response extends HttpResponse {
27
+ export interface StringModelPatchNonNull204Response extends HttpResponse {
28
28
  status: "204";
29
29
  }
30
30
 
31
31
  /** There is no content to send for this request, but the headers may be useful. */
32
- export interface StringPatchNull204Response extends HttpResponse {
32
+ export interface StringModelPatchNull204Response extends HttpResponse {
33
33
  status: "204";
34
34
  }
35
35
 
@@ -2,15 +2,16 @@
2
2
  // Licensed under the MIT license.
3
3
 
4
4
  import { getClient, ClientOptions } from "@azure-rest/core-client";
5
- import { ModelsPropertyNullableClient } from "./clientDefinitions";
5
+ import { logger } from "./logger";
6
+ import { TypePropertyNullableClient } from "./clientDefinitions";
6
7
 
7
8
  /**
8
- * Initialize a new instance of `ModelsPropertyNullableClient`
9
- * @param options type: ClientOptions, the parameter for all optional parameters
9
+ * Initialize a new instance of `TypePropertyNullableClient`
10
+ * @param options - the parameter for all optional parameters
10
11
  */
11
12
  export default function createClient(
12
13
  options: ClientOptions = {}
13
- ): ModelsPropertyNullableClient {
14
+ ): TypePropertyNullableClient {
14
15
  const baseUrl = options.baseUrl ?? `http://localhost:3000`;
15
16
  options.apiVersion = options.apiVersion ?? "1.0.0";
16
17
  const userAgentInfo = `azsdk-js-nullable-property-rest/1.0.0`;
@@ -23,9 +24,12 @@ export default function createClient(
23
24
  userAgentOptions: {
24
25
  userAgentPrefix,
25
26
  },
27
+ loggingOptions: {
28
+ logger: options.loggingOptions?.logger ?? logger.info,
29
+ },
26
30
  };
27
31
 
28
- const client = getClient(baseUrl, options) as ModelsPropertyNullableClient;
32
+ const client = getClient(baseUrl, options) as TypePropertyNullableClient;
29
33
 
30
34
  return client;
31
35
  }
@@ -1,4 +1,4 @@
1
- # ModelsPropertyOptional REST client library for JavaScript
1
+ # TypePropertyOptional REST client library for JavaScript
2
2
 
3
3
  Illustrates models with optional properties.
4
4
 
@@ -20,13 +20,13 @@ Key links:
20
20
 
21
21
  ### Install the `@msinternal/optional-property` package
22
22
 
23
- Install the ModelsPropertyOptional REST client REST client library for JavaScript with `npm`:
23
+ Install the TypePropertyOptional REST client REST client library for JavaScript with `npm`:
24
24
 
25
25
  ```bash
26
26
  npm install @msinternal/optional-property
27
27
  ```
28
28
 
29
- ### Create and authenticate a `ModelsPropertyOptionalClient`
29
+ ### Create and authenticate a `TypePropertyOptionalClient`
30
30
 
31
31
  To use an [Azure Active Directory (AAD) token credential](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token),
32
32
  provide an instance of the desired credential type obtained from the
@@ -52,7 +52,7 @@
52
52
  "autoPublish": false,
53
53
  "dependencies": {
54
54
  "@azure/core-auth": "^1.3.0",
55
- "@azure-rest/core-client": "^1.1.2",
55
+ "@azure-rest/core-client": "^1.1.3",
56
56
  "@azure/core-rest-pipeline": "^1.8.0",
57
57
  "@azure/logger": "^1.0.0",
58
58
  "tslib": "^2.2.0"