diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 0ba746dfe0..c49ea09514 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -191,34 +191,34 @@ importers: ../../packages/typespec-test: specifiers: - '@azure-tools/typespec-autorest': '>=0.42.1 <1.0.0' - '@azure-tools/typespec-azure-core': '>=0.42.0 <1.0.0' - '@azure-tools/typespec-azure-resource-manager': 0.42.0 - '@azure-tools/typespec-client-generator-core': '>=0.42 <1.0.0' + '@azure-tools/typespec-autorest': '>=0.43.0 <1.0.0' + '@azure-tools/typespec-azure-core': '>=0.43.0 <1.0.0' + '@azure-tools/typespec-azure-resource-manager': '>=0.43.0 <1.0.0' + '@azure-tools/typespec-client-generator-core': '>=0.43.0 <1.0.0' '@azure-tools/typespec-ts': workspace:^0.29.0 '@types/mocha': ^5.2.7 '@types/node': ^18.0.0 - '@typespec/compiler': '>=0.56.0 <1.0.0' - '@typespec/http': '>=0.56.0 <1.0.0' - '@typespec/openapi': '>=0.56.0 <1.0.0' - '@typespec/openapi3': '>=0.56.0 <1.0.0' - '@typespec/rest': '>=0.56.0 <1.0.0' - '@typespec/versioning': '>=0.56.0 <1.0.0' + '@typespec/compiler': '>=0.57.0 <1.0.0' + '@typespec/http': '>=0.57.0 <1.0.0' + '@typespec/openapi': '>=0.57.0 <1.0.0' + '@typespec/openapi3': '>=0.57.0 <1.0.0' + '@typespec/rest': '>=0.57.0 <1.0.0' + '@typespec/versioning': '>=0.57.0 <1.0.0' prettier: ^3.1.0 ts-node: ^8.5.2 typescript: ~5.4.5 dependencies: - '@azure-tools/typespec-autorest': 0.42.1_uq7okz7y7euyby54kwkjmqmywq - '@azure-tools/typespec-azure-core': 0.42.0_vh6ubjfznouqbteha4a2uzvejq - '@azure-tools/typespec-azure-resource-manager': 0.42.0_uhmhlf4rrtw6krq4zomqwzdgo4 - '@azure-tools/typespec-client-generator-core': 0.42.2_pltw6jvksz75whntgvodyimazu + '@azure-tools/typespec-autorest': 0.43.0_en4mharho4bpqitqejgpmmb37m + '@azure-tools/typespec-azure-core': 0.43.0_2idjsbfb2yn4ycais27dictks4 + '@azure-tools/typespec-azure-resource-manager': 0.43.0_anmwdl6ok3gaj7stcmaljgk3mi + '@azure-tools/typespec-client-generator-core': 0.43.0_uovqfdr3tffszkt2tayxtbnshy '@azure-tools/typespec-ts': link:../typespec-ts - '@typespec/compiler': 0.56.0 - '@typespec/http': 0.56.0_@typespec+compiler@0.56.0 - '@typespec/openapi': 0.56.0_shwv7qwegi6hba73djsyxw3opq - '@typespec/openapi3': 0.56.0_tsyswlnoxygtjnjggqnwoae7cm - '@typespec/rest': 0.56.0_shwv7qwegi6hba73djsyxw3opq - '@typespec/versioning': 0.56.0_@typespec+compiler@0.56.0 + '@typespec/compiler': 0.57.0 + '@typespec/http': 0.57.0_@typespec+compiler@0.57.0 + '@typespec/openapi': 0.57.0_vbvnqkewpm5abpu22tn3mnmkfa + '@typespec/openapi3': 0.57.0_347ayvjnvxpuzy2uklc6ucz2lq + '@typespec/rest': 0.57.0_vbvnqkewpm5abpu22tn3mnmkfa + '@typespec/versioning': 0.57.0_@typespec+compiler@0.57.0 prettier: 3.1.1 devDependencies: '@types/mocha': 5.2.7 @@ -233,10 +233,10 @@ importers: '@azure-tools/cadl-ranch-expect': ^0.13.4 '@azure-tools/cadl-ranch-specs': ^0.33.4 '@azure-tools/rlc-common': workspace:^0.29.0 - '@azure-tools/typespec-autorest': '>=0.42.1 <1.0.0' - '@azure-tools/typespec-azure-core': '>=0.42.0 <1.0.0' - '@azure-tools/typespec-azure-resource-manager': '>=0.42.1 <1.0.0' - '@azure-tools/typespec-client-generator-core': '>=0.42.2 <1.0.0' + '@azure-tools/typespec-autorest': '>=0.43.0 <1.0.0' + '@azure-tools/typespec-azure-core': '>=0.43.0 <1.0.0' + '@azure-tools/typespec-azure-resource-manager': '>=0.43.0 <1.0.0' + '@azure-tools/typespec-client-generator-core': '>=0.43.0 <1.0.0' '@azure/abort-controller': ^2.1.2 '@azure/core-auth': ^1.6.0 '@azure/core-lro': 3.0.0-beta.2 @@ -251,12 +251,12 @@ importers: '@types/node': ^18.0.0 '@typescript-eslint/eslint-plugin': ^6.8.0 '@typescript-eslint/parser': ^6.8.0 - '@typespec/compiler': '>=0.56.0 <1.0.0' - '@typespec/http': '>=0.56.0 <1.0.0' - '@typespec/openapi': '>=0.56.0, <1.0.0' - '@typespec/rest': '>=0.56.0 <1.0.0' + '@typespec/compiler': '>=0.57.0 <1.0.0' + '@typespec/http': '>=0.57.0 <1.0.0' + '@typespec/openapi': '>=0.57.0, <1.0.0' + '@typespec/rest': '>=0.57.0 <1.0.0' '@typespec/ts-http-runtime': 1.0.0-alpha.20240314.2 - '@typespec/versioning': '>=0.56.0 <1.0.0' + '@typespec/versioning': '>=0.57.0 <1.0.0' '@vitest/coverage-istanbul': ~1.6.0 '@vitest/coverage-v8': ~1.6.0 chai: ^4.3.6 @@ -285,13 +285,13 @@ importers: tslib: 2.6.2 devDependencies: '@azure-rest/core-client': 2.0.0 - '@azure-tools/cadl-ranch': 0.12.8_gjthgjp763rka6esv3wt24smmu - '@azure-tools/cadl-ranch-expect': 0.13.4_wzddmpgib6gbs7s6pzox6x7k4u - '@azure-tools/cadl-ranch-specs': 0.33.4_idbalmm5pogybt5joy2fbn3niy - '@azure-tools/typespec-autorest': 0.42.1_uq7okz7y7euyby54kwkjmqmywq - '@azure-tools/typespec-azure-core': 0.42.0_vh6ubjfznouqbteha4a2uzvejq - '@azure-tools/typespec-azure-resource-manager': 0.42.1_uhmhlf4rrtw6krq4zomqwzdgo4 - '@azure-tools/typespec-client-generator-core': 0.42.2_pltw6jvksz75whntgvodyimazu + '@azure-tools/cadl-ranch': 0.12.8_idwqxt3tapfhp2vsjq6tobrmge + '@azure-tools/cadl-ranch-expect': 0.13.4_slesryzarwbyvcf3mhszmr4dlm + '@azure-tools/cadl-ranch-specs': 0.33.4_os3md7h7fcok2eynvsrvyepqoq + '@azure-tools/typespec-autorest': 0.43.0_en4mharho4bpqitqejgpmmb37m + '@azure-tools/typespec-azure-core': 0.43.0_2idjsbfb2yn4ycais27dictks4 + '@azure-tools/typespec-azure-resource-manager': 0.43.0_anmwdl6ok3gaj7stcmaljgk3mi + '@azure-tools/typespec-client-generator-core': 0.43.0_uovqfdr3tffszkt2tayxtbnshy '@azure/abort-controller': 2.1.2 '@azure/core-auth': 1.6.0 '@azure/core-lro': 3.0.0-beta.2 @@ -306,12 +306,12 @@ importers: '@types/node': 18.18.0 '@typescript-eslint/eslint-plugin': 6.8.0_xunbxrh7emkzv2ys2f2orljele '@typescript-eslint/parser': 6.8.0_afxi7czp26kyxjrij76jotv2vq - '@typespec/compiler': 0.56.0 - '@typespec/http': 0.56.0_@typespec+compiler@0.56.0 - '@typespec/openapi': 0.56.0_shwv7qwegi6hba73djsyxw3opq - '@typespec/rest': 0.56.0_shwv7qwegi6hba73djsyxw3opq + '@typespec/compiler': 0.57.0 + '@typespec/http': 0.57.0_@typespec+compiler@0.57.0 + '@typespec/openapi': 0.57.0_vbvnqkewpm5abpu22tn3mnmkfa + '@typespec/rest': 0.57.0_vbvnqkewpm5abpu22tn3mnmkfa '@typespec/ts-http-runtime': 1.0.0-alpha.20240314.2 - '@typespec/versioning': 0.56.0_@typespec+compiler@0.56.0 + '@typespec/versioning': 0.57.0_@typespec+compiler@0.57.0 '@vitest/coverage-istanbul': 1.6.0_vitest@1.6.0 '@vitest/coverage-v8': 1.6.0_vitest@1.6.0 chai: 4.3.8 @@ -429,7 +429,7 @@ packages: - supports-color dev: true - /@azure-tools/cadl-ranch-expect/0.13.4_wzddmpgib6gbs7s6pzox6x7k4u: + /@azure-tools/cadl-ranch-expect/0.13.4_fhusegc7lvzkaimgvkpme6q5wa: resolution: {integrity: sha512-2j9Mxr8tz7zF8j8L/R/KEPhES/cJDt21wUTkQv0TKwZ4Kz5HGHBCsvnOnoBs72H7Q8DHpqOIhNDak40BHCrEGA==} engines: {node: '>=16.0.0'} peerDependencies: @@ -441,10 +441,25 @@ packages: '@typespec/compiler': 0.56.0 '@typespec/http': 0.56.0_@typespec+compiler@0.56.0 '@typespec/rest': 0.56.0_shwv7qwegi6hba73djsyxw3opq - '@typespec/versioning': 0.56.0_@typespec+compiler@0.56.0 + '@typespec/versioning': 0.57.0_@typespec+compiler@0.57.0 dev: true - /@azure-tools/cadl-ranch-specs/0.33.4_idbalmm5pogybt5joy2fbn3niy: + /@azure-tools/cadl-ranch-expect/0.13.4_slesryzarwbyvcf3mhszmr4dlm: + resolution: {integrity: sha512-2j9Mxr8tz7zF8j8L/R/KEPhES/cJDt21wUTkQv0TKwZ4Kz5HGHBCsvnOnoBs72H7Q8DHpqOIhNDak40BHCrEGA==} + engines: {node: '>=16.0.0'} + peerDependencies: + '@typespec/compiler': ~0.56.0 + '@typespec/http': ~0.56.0 + '@typespec/rest': ~0.56.0 + '@typespec/versioning': ~0.56.0 + dependencies: + '@typespec/compiler': 0.57.0 + '@typespec/http': 0.57.0_@typespec+compiler@0.57.0 + '@typespec/rest': 0.57.0_vbvnqkewpm5abpu22tn3mnmkfa + '@typespec/versioning': 0.57.0_@typespec+compiler@0.57.0 + dev: true + + /@azure-tools/cadl-ranch-specs/0.33.4_os3md7h7fcok2eynvsrvyepqoq: resolution: {integrity: sha512-xTTyZIWT8bjXNoFr1M5CA6L7yo3mLBMzSDYPepCCWk3Wx8P2bl0NkK9YS4udfTA9TKlUJPSW23DvHcQfJ2rurQ==} engines: {node: '>=16.0.0'} peerDependencies: @@ -455,28 +470,28 @@ packages: '@typespec/rest': ~0.56.0 '@typespec/versioning': ~0.56.0 dependencies: - '@azure-tools/cadl-ranch': 0.12.8_gjthgjp763rka6esv3wt24smmu + '@azure-tools/cadl-ranch': 0.12.8_idwqxt3tapfhp2vsjq6tobrmge '@azure-tools/cadl-ranch-api': 0.4.3 - '@azure-tools/cadl-ranch-expect': 0.13.4_wzddmpgib6gbs7s6pzox6x7k4u - '@azure-tools/typespec-azure-core': 0.42.0_vh6ubjfznouqbteha4a2uzvejq - '@typespec/compiler': 0.56.0 - '@typespec/http': 0.56.0_@typespec+compiler@0.56.0 - '@typespec/rest': 0.56.0_shwv7qwegi6hba73djsyxw3opq - '@typespec/versioning': 0.56.0_@typespec+compiler@0.56.0 + '@azure-tools/cadl-ranch-expect': 0.13.4_slesryzarwbyvcf3mhszmr4dlm + '@azure-tools/typespec-azure-core': 0.43.0_2idjsbfb2yn4ycais27dictks4 + '@typespec/compiler': 0.57.0 + '@typespec/http': 0.57.0_@typespec+compiler@0.57.0 + '@typespec/rest': 0.57.0_vbvnqkewpm5abpu22tn3mnmkfa + '@typespec/versioning': 0.57.0_@typespec+compiler@0.57.0 transitivePeerDependencies: - '@types/express' - encoding - supports-color dev: true - /@azure-tools/cadl-ranch/0.12.8_gjthgjp763rka6esv3wt24smmu: + /@azure-tools/cadl-ranch/0.12.8_idwqxt3tapfhp2vsjq6tobrmge: resolution: {integrity: sha512-dkVz6YxwFBgwmWtYqpzY1cuncuuHcvQbd8gHx1j9tvl8VjEjd5gVTAEFkp9ZuOM8P9L/VP5x4q14RlRMOMitHQ==} engines: {node: '>=16.0.0'} hasBin: true dependencies: '@azure-tools/cadl-ranch-api': 0.4.3 '@azure-tools/cadl-ranch-coverage-sdk': 0.8.2 - '@azure-tools/cadl-ranch-expect': 0.13.4_wzddmpgib6gbs7s6pzox6x7k4u + '@azure-tools/cadl-ranch-expect': 0.13.4_fhusegc7lvzkaimgvkpme6q5wa '@azure/identity': 3.3.0 '@types/js-yaml': 4.0.6 '@typespec/compiler': 0.56.0 @@ -531,99 +546,75 @@ packages: - supports-color dev: true - /@azure-tools/typespec-autorest/0.42.1_uq7okz7y7euyby54kwkjmqmywq: - resolution: {integrity: sha512-egWR2Ljxde5PvyDwuVu/8Rq8cSW6FW+qMbvwHfzrtm/sULdSnA6k+VnGD/PQ+dk+1SmFeKG1b+0MlaFuBVz1Hw==} + /@azure-tools/typespec-autorest/0.43.0_en4mharho4bpqitqejgpmmb37m: + resolution: {integrity: sha512-tZ9uXXOdxu2y01W9n3mzXf+IEY2MQkP/JaQaKlcOx2+dbklHNQWSDU0Vm6Gmm6l//XiF9QiI8653BiuO97czyw==} engines: {node: '>=18.0.0'} peerDependencies: - '@azure-tools/typespec-azure-core': ~0.42.0 - '@azure-tools/typespec-client-generator-core': ~0.42.0 - '@typespec/compiler': ~0.56.0 - '@typespec/http': ~0.56.0 - '@typespec/openapi': ~0.56.0 - '@typespec/rest': ~0.56.0 - '@typespec/versioning': ~0.56.0 - dependencies: - '@azure-tools/typespec-azure-core': 0.42.0_vh6ubjfznouqbteha4a2uzvejq - '@azure-tools/typespec-client-generator-core': 0.42.2_pltw6jvksz75whntgvodyimazu - '@typespec/compiler': 0.56.0 - '@typespec/http': 0.56.0_@typespec+compiler@0.56.0 - '@typespec/openapi': 0.56.0_shwv7qwegi6hba73djsyxw3opq - '@typespec/rest': 0.56.0_shwv7qwegi6hba73djsyxw3opq - '@typespec/versioning': 0.56.0_@typespec+compiler@0.56.0 - - /@azure-tools/typespec-azure-core/0.42.0_vh6ubjfznouqbteha4a2uzvejq: - resolution: {integrity: sha512-8C96RkgSWtgqsaHRMWCd2iDltFJZTGmFQiTZazZj/uRy0Wn1ikjSriSN8t1puL5SiUPd0BVJP/YXiwAfjfZYDA==} + '@azure-tools/typespec-azure-core': ~0.43.0 + '@azure-tools/typespec-azure-resource-manager': ~0.43.0 + '@azure-tools/typespec-client-generator-core': ~0.43.0 + '@typespec/compiler': ~0.57.0 + '@typespec/http': ~0.57.0 + '@typespec/openapi': ~0.57.0 + '@typespec/rest': ~0.57.0 + '@typespec/versioning': ~0.57.0 + dependencies: + '@azure-tools/typespec-azure-core': 0.43.0_2idjsbfb2yn4ycais27dictks4 + '@azure-tools/typespec-azure-resource-manager': 0.43.0_anmwdl6ok3gaj7stcmaljgk3mi + '@azure-tools/typespec-client-generator-core': 0.43.0_uovqfdr3tffszkt2tayxtbnshy + '@typespec/compiler': 0.57.0 + '@typespec/http': 0.57.0_@typespec+compiler@0.57.0 + '@typespec/openapi': 0.57.0_vbvnqkewpm5abpu22tn3mnmkfa + '@typespec/rest': 0.57.0_vbvnqkewpm5abpu22tn3mnmkfa + '@typespec/versioning': 0.57.0_@typespec+compiler@0.57.0 + + /@azure-tools/typespec-azure-core/0.43.0_2idjsbfb2yn4ycais27dictks4: + resolution: {integrity: sha512-B1r0i3segJ7RuNXxcAMBy8H2t+jTkaf74dkyUWD0HIFPkhETN0uR59nuor+s+LoLU8yI4JypOFSNZt6e1rod8w==} engines: {node: '>=18.0.0'} peerDependencies: - '@typespec/compiler': ~0.56.0 - '@typespec/http': ~0.56.0 - '@typespec/rest': ~0.56.0 + '@typespec/compiler': ~0.57.0 + '@typespec/http': ~0.57.0 + '@typespec/rest': ~0.57.0 dependencies: - '@typespec/compiler': 0.56.0 - '@typespec/http': 0.56.0_@typespec+compiler@0.56.0 - '@typespec/rest': 0.56.0_shwv7qwegi6hba73djsyxw3opq + '@typespec/compiler': 0.57.0 + '@typespec/http': 0.57.0_@typespec+compiler@0.57.0 + '@typespec/rest': 0.57.0_vbvnqkewpm5abpu22tn3mnmkfa - /@azure-tools/typespec-azure-resource-manager/0.42.0_uhmhlf4rrtw6krq4zomqwzdgo4: - resolution: {integrity: sha512-RCqcrhE1yniAih5vDFOC5K4MpDr9XmG8qBB39G49/KyEKnWOQ3Nwvt/6fXaU42D9X2L6kfEAIz/AdiSJ/H5O6w==} + /@azure-tools/typespec-azure-resource-manager/0.43.0_anmwdl6ok3gaj7stcmaljgk3mi: + resolution: {integrity: sha512-0GQL+/o1u+PAB63FpYz3sy3ZgZvCtk5T4sDAnICnV23v2YWIONDMUfxxd0x40xJbY6PkcwwHDpBLNMqajf2H6A==} engines: {node: '>=18.0.0'} peerDependencies: - '@azure-tools/typespec-autorest': ~0.42.0 - '@azure-tools/typespec-azure-core': ~0.42.0 - '@typespec/compiler': ~0.56.0 - '@typespec/http': ~0.56.0 - '@typespec/openapi': ~0.56.0 - '@typespec/rest': ~0.56.0 - '@typespec/versioning': ~0.56.0 - dependencies: - '@azure-tools/typespec-autorest': 0.42.1_uq7okz7y7euyby54kwkjmqmywq - '@azure-tools/typespec-azure-core': 0.42.0_vh6ubjfznouqbteha4a2uzvejq - '@typespec/compiler': 0.56.0 - '@typespec/http': 0.56.0_@typespec+compiler@0.56.0 - '@typespec/openapi': 0.56.0_shwv7qwegi6hba73djsyxw3opq - '@typespec/rest': 0.56.0_shwv7qwegi6hba73djsyxw3opq - '@typespec/versioning': 0.56.0_@typespec+compiler@0.56.0 + '@azure-tools/typespec-azure-core': ~0.43.0 + '@typespec/compiler': ~0.57.0 + '@typespec/http': ~0.57.0 + '@typespec/openapi': ~0.57.0 + '@typespec/rest': ~0.57.0 + '@typespec/versioning': ~0.57.0 + dependencies: + '@azure-tools/typespec-azure-core': 0.43.0_2idjsbfb2yn4ycais27dictks4 + '@typespec/compiler': 0.57.0 + '@typespec/http': 0.57.0_@typespec+compiler@0.57.0 + '@typespec/openapi': 0.57.0_vbvnqkewpm5abpu22tn3mnmkfa + '@typespec/rest': 0.57.0_vbvnqkewpm5abpu22tn3mnmkfa + '@typespec/versioning': 0.57.0_@typespec+compiler@0.57.0 change-case: 5.4.4 pluralize: 8.0.0 - dev: false - /@azure-tools/typespec-azure-resource-manager/0.42.1_uhmhlf4rrtw6krq4zomqwzdgo4: - resolution: {integrity: sha512-vUqmHWS9OrN+16jXfpgUdUXXa1RLrr8Pkrzb1HFQGmdXuRxMZZtLCRcyyEHZJIMYE4RmmpPoB3JJeqiGWxlegQ==} + /@azure-tools/typespec-client-generator-core/0.43.0_uovqfdr3tffszkt2tayxtbnshy: + resolution: {integrity: sha512-rssB/zsg89wstzJC1MWzbd8oPpqbgoftkp9G/NP3BoMb/gCP5uRLggwlSUAgnoU2Lt0jBUKcMlqEiVLTAkY9LA==} engines: {node: '>=18.0.0'} peerDependencies: - '@azure-tools/typespec-autorest': ~0.42.1 - '@azure-tools/typespec-azure-core': ~0.42.0 - '@typespec/compiler': ~0.56.0 - '@typespec/http': ~0.56.0 - '@typespec/openapi': ~0.56.0 - '@typespec/rest': ~0.56.0 - '@typespec/versioning': ~0.56.0 - dependencies: - '@azure-tools/typespec-autorest': 0.42.1_uq7okz7y7euyby54kwkjmqmywq - '@azure-tools/typespec-azure-core': 0.42.0_vh6ubjfznouqbteha4a2uzvejq - '@typespec/compiler': 0.56.0 - '@typespec/http': 0.56.0_@typespec+compiler@0.56.0 - '@typespec/openapi': 0.56.0_shwv7qwegi6hba73djsyxw3opq - '@typespec/rest': 0.56.0_shwv7qwegi6hba73djsyxw3opq - '@typespec/versioning': 0.56.0_@typespec+compiler@0.56.0 - change-case: 5.4.4 - pluralize: 8.0.0 - dev: true - - /@azure-tools/typespec-client-generator-core/0.42.2_pltw6jvksz75whntgvodyimazu: - resolution: {integrity: sha512-Hei86GqNFfKpFhivZPpKo1ktSRQMnZKjLoMwIumklmMpeo5KgyzEgRSpJEiS+zmPZELs2Fu07VgfvpW0IXurUg==} - engines: {node: '>=18.0.0'} - peerDependencies: - '@azure-tools/typespec-azure-core': ~0.42.0 - '@typespec/compiler': ~0.56.0 - '@typespec/http': ~0.56.0 - '@typespec/rest': ~0.56.0 - '@typespec/versioning': ~0.56.0 - dependencies: - '@azure-tools/typespec-azure-core': 0.42.0_vh6ubjfznouqbteha4a2uzvejq - '@typespec/compiler': 0.56.0 - '@typespec/http': 0.56.0_@typespec+compiler@0.56.0 - '@typespec/rest': 0.56.0_shwv7qwegi6hba73djsyxw3opq - '@typespec/versioning': 0.56.0_@typespec+compiler@0.56.0 + '@azure-tools/typespec-azure-core': ~0.43.0 + '@typespec/compiler': ~0.57.0 + '@typespec/http': ~0.57.0 + '@typespec/rest': ~0.57.0 + '@typespec/versioning': ~0.57.0 + dependencies: + '@azure-tools/typespec-azure-core': 0.43.0_2idjsbfb2yn4ycais27dictks4 + '@typespec/compiler': 0.57.0 + '@typespec/http': 0.57.0_@typespec+compiler@0.57.0 + '@typespec/rest': 0.57.0_vbvnqkewpm5abpu22tn3mnmkfa + '@typespec/versioning': 0.57.0_@typespec+compiler@0.57.0 change-case: 5.4.4 pluralize: 8.0.0 @@ -831,20 +822,12 @@ packages: - encoding dev: true - /@babel/code-frame/7.24.2: - resolution: {integrity: sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==} - engines: {node: '>=6.9.0'} - dependencies: - '@babel/highlight': 7.24.7 - picocolors: 1.0.1 - /@babel/code-frame/7.24.7: resolution: {integrity: sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==} engines: {node: '>=6.9.0'} dependencies: '@babel/highlight': 7.24.7 picocolors: 1.0.1 - dev: true /@babel/compat-data/7.24.7: resolution: {integrity: sha512-qJzAIcv03PyaWqxRgO4mSU3lihncDT296vnyuE2O8uA4w3UHWI4S3hgeZd1L8W1Bft40w9JxJ2b412iDUFFRhw==} @@ -1960,18 +1943,38 @@ packages: engines: {node: '>=18.0.0'} hasBin: true dependencies: - '@babel/code-frame': 7.24.2 + '@babel/code-frame': 7.24.7 ajv: 8.12.0 change-case: 5.4.4 globby: 14.0.1 mustache: 4.2.0 - picocolors: 1.0.0 + picocolors: 1.0.1 prettier: 3.2.5 prompts: 2.4.2 - semver: 7.6.0 + semver: 7.6.2 + vscode-languageserver: 9.0.1 + vscode-languageserver-textdocument: 1.0.11 + yaml: 2.4.5 + yargs: 17.7.2 + dev: true + + /@typespec/compiler/0.57.0: + resolution: {integrity: sha512-Z5L7J90Ol21IbzU+rBD2wzKy2vJ2Yg2FIzi+yB5rtb7/c4oBea/CgEByMVHBtT7uw45ZXJpHOiepuGSPVXw2EA==} + engines: {node: '>=18.0.0'} + hasBin: true + dependencies: + '@babel/code-frame': 7.24.7 + ajv: 8.13.0 + change-case: 5.4.4 + globby: 14.0.1 + mustache: 4.2.0 + picocolors: 1.0.1 + prettier: 3.2.5 + prompts: 2.4.2 + semver: 7.6.2 vscode-languageserver: 9.0.1 vscode-languageserver-textdocument: 1.0.11 - yaml: 2.4.1 + yaml: 2.4.5 yargs: 17.7.2 /@typespec/http/0.56.0_@typespec+compiler@0.56.0: @@ -1981,31 +1984,40 @@ packages: '@typespec/compiler': ~0.56.0 dependencies: '@typespec/compiler': 0.56.0 + dev: true - /@typespec/openapi/0.56.0_shwv7qwegi6hba73djsyxw3opq: - resolution: {integrity: sha512-q8+IHRglXBm3slvonRLSNYN2fX7plbWA+ugIiMJZTeyc3enqfxPqMGA8BCiAFV3kwP0uPPpIXbCSIVhHgkONbA==} + /@typespec/http/0.57.0_@typespec+compiler@0.57.0: + resolution: {integrity: sha512-k3bWOTPNqlRB3/TmrXVBtObmxj2J20l2FnhGXvs+tjdtbXLxCQWmvQz6xlne9nkLAtWVB/pQRUn+oMJfhWta3w==} engines: {node: '>=18.0.0'} peerDependencies: - '@typespec/compiler': ~0.56.0 - '@typespec/http': ~0.56.0 + '@typespec/compiler': ~0.57.0 dependencies: - '@typespec/compiler': 0.56.0 - '@typespec/http': 0.56.0_@typespec+compiler@0.56.0 + '@typespec/compiler': 0.57.0 - /@typespec/openapi3/0.56.0_tsyswlnoxygtjnjggqnwoae7cm: - resolution: {integrity: sha512-55JPUP7dFk4iXn4fNKZEs76j7hAdlWfoMWNPsQPRJCP//KWCtNXfTP+/TTVPVv1L/6HztbXyPV0agKZwyS7gDw==} + /@typespec/openapi/0.57.0_vbvnqkewpm5abpu22tn3mnmkfa: + resolution: {integrity: sha512-35wK/BqjOXSlhWuGMwoYN3FSgIYFOKtw8ot4ErcgmxAGuKaS2GkUhZvtQJXUn2ByU0Fl4jqslPmTz8SEcz7rbw==} engines: {node: '>=18.0.0'} peerDependencies: - '@typespec/compiler': ~0.56.0 - '@typespec/http': ~0.56.0 - '@typespec/openapi': ~0.56.0 - '@typespec/versioning': ~0.56.0 + '@typespec/compiler': ~0.57.0 + '@typespec/http': ~0.57.0 dependencies: - '@typespec/compiler': 0.56.0 - '@typespec/http': 0.56.0_@typespec+compiler@0.56.0 - '@typespec/openapi': 0.56.0_shwv7qwegi6hba73djsyxw3opq - '@typespec/versioning': 0.56.0_@typespec+compiler@0.56.0 - yaml: 2.4.1 + '@typespec/compiler': 0.57.0 + '@typespec/http': 0.57.0_@typespec+compiler@0.57.0 + + /@typespec/openapi3/0.57.0_347ayvjnvxpuzy2uklc6ucz2lq: + resolution: {integrity: sha512-spNLzwCTduPISJBTWhqsMLTjuGC3Tdh/FVI1rTGnRunB7ZXjhRyz031o1bCe2BZeW1w1sacZGfe+ba8sXqgMxA==} + engines: {node: '>=18.0.0'} + peerDependencies: + '@typespec/compiler': ~0.57.0 + '@typespec/http': ~0.57.0 + '@typespec/openapi': ~0.57.0 + '@typespec/versioning': ~0.57.0 + dependencies: + '@typespec/compiler': 0.57.0 + '@typespec/http': 0.57.0_@typespec+compiler@0.57.0 + '@typespec/openapi': 0.57.0_vbvnqkewpm5abpu22tn3mnmkfa + '@typespec/versioning': 0.57.0_@typespec+compiler@0.57.0 + yaml: 2.4.5 dev: false /@typespec/rest/0.56.0_shwv7qwegi6hba73djsyxw3opq: @@ -2017,6 +2029,17 @@ packages: dependencies: '@typespec/compiler': 0.56.0 '@typespec/http': 0.56.0_@typespec+compiler@0.56.0 + dev: true + + /@typespec/rest/0.57.0_vbvnqkewpm5abpu22tn3mnmkfa: + resolution: {integrity: sha512-mZj76Kf+cmH38pYA6LT8Zz7QjuR3fdQo5bc8pXhKMwLq9vRqNLz6Z9InbOeo8zY+xP0GfUwEU9kXczmCc8gyRA==} + engines: {node: '>=18.0.0'} + peerDependencies: + '@typespec/compiler': ~0.57.0 + '@typespec/http': ~0.57.0 + dependencies: + '@typespec/compiler': 0.57.0 + '@typespec/http': 0.57.0_@typespec+compiler@0.57.0 /@typespec/ts-http-runtime/1.0.0-alpha.20240314.2: resolution: {integrity: sha512-Rc/bFkKLbrEo9KKXiSdRYNSmosZ1W6ycQKEKScpXvK4jaXFNyCvmS0tLv7rEN4EzEEds2fPzEHNtX4e8gMu/lA==} @@ -2029,13 +2052,13 @@ packages: - supports-color dev: true - /@typespec/versioning/0.56.0_@typespec+compiler@0.56.0: - resolution: {integrity: sha512-j7IN9XFyGn3LH6IOJkinEvk9sDncsxiWPULOAe0VQ+D/dtCfLawDMUALnvklMDRKeD1OOUPSCjjUAp9OB0f7YA==} + /@typespec/versioning/0.57.0_@typespec+compiler@0.57.0: + resolution: {integrity: sha512-kk6zCNSwcqqYB9isNNagTy+Zv6wEIRA4NkcZ/X1riTj2zhJwKsIFNXQWm1yxpZn+BY4+1QtuaQHuBLo8HbgR/w==} engines: {node: '>=18.0.0'} peerDependencies: - '@typespec/compiler': ~0.56.0 + '@typespec/compiler': ~0.57.0 dependencies: - '@typespec/compiler': 0.56.0 + '@typespec/compiler': 0.57.0 /@ungap/promise-all-settled/1.1.2: resolution: {integrity: sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==} @@ -2358,6 +2381,15 @@ packages: json-schema-traverse: 1.0.0 require-from-string: 2.0.2 uri-js: 4.4.1 + dev: true + + /ajv/8.13.0: + resolution: {integrity: sha512-PRA911Blj99jR5RMeTunVbNXMF6Lp4vZXnk5GQjcnUWUTsrXtekg/pnmFFI2u/I36Y/2bITGS30GZCXei6uNkA==} + dependencies: + fast-deep-equal: 3.1.3 + json-schema-traverse: 1.0.0 + require-from-string: 2.0.2 + uri-js: 4.4.1 /ansi-colors/4.1.1: resolution: {integrity: sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==} @@ -4754,7 +4786,7 @@ packages: '@babel/parser': 7.24.7 '@istanbuljs/schema': 0.1.3 istanbul-lib-coverage: 3.2.2 - semver: 7.6.0 + semver: 7.6.2 transitivePeerDependencies: - supports-color dev: true @@ -4908,7 +4940,7 @@ packages: lodash.isstring: 4.0.1 lodash.once: 4.1.1 ms: 2.1.3 - semver: 7.6.0 + semver: 7.6.2 dev: true /jsprim/1.4.2: @@ -5214,7 +5246,7 @@ packages: resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} engines: {node: '>=10'} dependencies: - semver: 7.6.0 + semver: 7.6.2 dev: true /make-error/1.3.6: @@ -5889,6 +5921,7 @@ packages: /picocolors/1.0.0: resolution: {integrity: sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==} + dev: true /picocolors/1.0.1: resolution: {integrity: sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==} @@ -6393,6 +6426,12 @@ packages: hasBin: true dependencies: lru-cache: 6.0.0 + dev: true + + /semver/7.6.2: + resolution: {integrity: sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w==} + engines: {node: '>=10'} + hasBin: true /send/0.18.0: resolution: {integrity: sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==} @@ -7705,8 +7744,8 @@ packages: /yallist/4.0.0: resolution: {integrity: sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==} - /yaml/2.4.1: - resolution: {integrity: sha512-pIXzoImaqmfOrL7teGUBt/T7ZDnyeGBWyXQBvOVhLkWLN37GXv8NMLK406UY6dS51JfcQHsmcW5cJ441bHg6Lg==} + /yaml/2.4.5: + resolution: {integrity: sha512-aBx2bnqDzVOyNKfsysjA2ms5ZlnjSAW2eG3/L5G/CSujfjLJTJsEw1bGw8kCf04KodQWk1pxlGnZ56CRxiawmg==} engines: {node: '>= 14'} hasBin: true diff --git a/packages/typespec-test/package.json b/packages/typespec-test/package.json index 2244098898..11a4d266e0 100644 --- a/packages/typespec-test/package.json +++ b/packages/typespec-test/package.json @@ -4,16 +4,16 @@ "type": "module", "dependencies": { "@azure-tools/typespec-ts": "workspace:^0.29.0", - "@typespec/openapi": ">=0.56.0 <1.0.0", - "@azure-tools/typespec-autorest": ">=0.42.1 <1.0.0", - "@typespec/openapi3": ">=0.56.0 <1.0.0", - "@azure-tools/typespec-azure-core": ">=0.42.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.42 <1.0.0", - "@azure-tools/typespec-azure-resource-manager":"0.42.0", - "@typespec/compiler": ">=0.56.0 <1.0.0", - "@typespec/http": ">=0.56.0 <1.0.0", - "@typespec/rest": ">=0.56.0 <1.0.0", - "@typespec/versioning": ">=0.56.0 <1.0.0", + "@typespec/openapi": ">=0.57.0 <1.0.0", + "@azure-tools/typespec-autorest": ">=0.43.0 <1.0.0", + "@typespec/openapi3": ">=0.57.0 <1.0.0", + "@azure-tools/typespec-azure-core": ">=0.43.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.43.0 <1.0.0", + "@azure-tools/typespec-azure-resource-manager":">=0.43.0 <1.0.0", + "@typespec/compiler": ">=0.57.0 <1.0.0", + "@typespec/http": ">=0.57.0 <1.0.0", + "@typespec/rest": ">=0.57.0 <1.0.0", + "@typespec/versioning": ">=0.57.0 <1.0.0", "prettier": "^3.1.0" }, "devDependencies": { diff --git a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/review/arm-networkanalytics.api.md b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/review/arm-networkanalytics.api.md index 26e2c927f5..43416ad354 100644 --- a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/review/arm-networkanalytics.api.md +++ b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/review/arm-networkanalytics.api.md @@ -28,16 +28,6 @@ export interface AccountSasToken { // @public export type ActionType = string; -// @public -export interface ArmOperationStatus { - readonly endTime?: Date; - readonly error?: ErrorDetail; - readonly name?: string; - readonly percentComplete?: number; - readonly startTime?: Date; - status: ResourceProvisioningState; -} - // @public export interface ConsumptionEndpointsProperties { readonly fileAccessResourceId?: string; @@ -442,7 +432,7 @@ export enum KnownDefaultAction { // @public (undocumented) export enum KnownManagedServiceIdentityType { // (undocumented) - "SystemAssigned, UserAssigned" = "SystemAssigned, UserAssigned", + "SystemAssigned,UserAssigned" = "SystemAssigned,UserAssigned", // (undocumented) None = "None", // (undocumented) @@ -479,16 +469,6 @@ export enum KnownProvisioningState { Updating = "Updating" } -// @public (undocumented) -export enum KnownResourceProvisioningState { - // (undocumented) - Canceled = "Canceled", - // (undocumented) - Failed = "Failed", - // (undocumented) - Succeeded = "Succeeded" -} - // @public export interface ListRoleAssignments { count: number; @@ -506,7 +486,7 @@ export interface ManagedServiceIdentity { readonly principalId?: string; readonly tenantId?: string; type: ManagedServiceIdentityType; - userAssignedIdentities?: UserAssignedIdentities; + userAssignedIdentities?: Record; } // @public @@ -544,6 +524,12 @@ export interface OperationDisplay { resource?: string; } +// @public +export interface OperationListResult { + nextLink?: string; + value: Operation[]; +} + // @public (undocumented) export interface OperationsListOptionalParams extends OperationOptions { } @@ -564,12 +550,6 @@ export interface PagedAsyncIterableIterator>; } -// @public -export interface PagedOperation { - nextLink?: string; - value: Operation[]; -} - // @public export interface PageSettings { continuationToken?: string; @@ -596,9 +576,6 @@ export interface Resource { readonly type?: string; } -// @public -export type ResourceProvisioningState = string; - // @public export function restorePoller(client: NetworkAnalyticsClient, serializedState: string, sourceOperation: (...args: any[]) => PollerLike, TResult>, options?: RestorePollerOptions): PollerLike, TResult>; @@ -632,12 +609,12 @@ export interface RoleAssignmentDetail { // @public export interface SystemData { - readonly createdAt?: Date; - readonly createdBy?: string; - readonly createdByType?: CreatedByType; - readonly lastModifiedAt?: Date; - readonly lastModifiedBy?: string; - readonly lastModifiedByType?: CreatedByType; + createdAt?: Date; + createdBy?: string; + createdByType?: CreatedByType; + lastModifiedAt?: Date; + lastModifiedBy?: string; + lastModifiedByType?: CreatedByType; } // @public @@ -646,14 +623,10 @@ export interface TrackedResource extends Resource { tags?: Record; } -// @public -export interface UserAssignedIdentities extends Record { -} - // @public export interface UserAssignedIdentity { - clientId?: string; - principalId?: string; + readonly clientId?: string; + readonly principalId?: string; } // @public diff --git a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/api/dataProducts/index.ts b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/api/dataProducts/index.ts index 6a682a1cc3..6d47dd8bbf 100644 --- a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/api/dataProducts/index.ts +++ b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/api/dataProducts/index.ts @@ -90,8 +90,8 @@ export function _createSend( .put({ ...operationOptionsToRequestParameters(options), body: { - location: resource["location"], tags: resource["tags"], + location: resource["location"], properties: !resource.properties ? undefined : { @@ -177,8 +177,8 @@ export async function _createDeserialize( result = result as DataProductsCreateLogicalResponse; return { - location: result.body["location"], tags: result.body["tags"], + location: result.body["location"], id: result.body["id"], name: result.body["name"], type: result.body["type"], @@ -292,8 +292,8 @@ export async function _createDeserialize( identity: !result.body.identity ? undefined : { - tenantId: result.body.identity?.["tenantId"], principalId: result.body.identity?.["principalId"], + tenantId: result.body.identity?.["tenantId"], type: result.body.identity?.["type"], userAssignedIdentities: result.body.identity?.["userAssignedIdentities"], @@ -352,8 +352,8 @@ export async function _getDeserialize( } return { - location: result.body["location"], tags: result.body["tags"], + location: result.body["location"], id: result.body["id"], name: result.body["name"], type: result.body["type"], @@ -467,8 +467,8 @@ export async function _getDeserialize( identity: !result.body.identity ? undefined : { - tenantId: result.body.identity?.["tenantId"], principalId: result.body.identity?.["principalId"], + tenantId: result.body.identity?.["tenantId"], type: result.body.identity?.["type"], userAssignedIdentities: result.body.identity?.["userAssignedIdentities"], @@ -553,8 +553,8 @@ export async function _updateDeserialize( result = result as DataProductsUpdateLogicalResponse; return { - location: result.body["location"], tags: result.body["tags"], + location: result.body["location"], id: result.body["id"], name: result.body["name"], type: result.body["type"], @@ -668,8 +668,8 @@ export async function _updateDeserialize( identity: !result.body.identity ? undefined : { - tenantId: result.body.identity?.["tenantId"], principalId: result.body.identity?.["principalId"], + tenantId: result.body.identity?.["tenantId"], type: result.body.identity?.["type"], userAssignedIdentities: result.body.identity?.["userAssignedIdentities"], @@ -1119,8 +1119,8 @@ export async function _listByResourceGroupDeserialize( return { value: result.body["value"].map((p) => ({ - location: p["location"], tags: p["tags"], + location: p["location"], id: p["id"], name: p["name"], type: p["type"], @@ -1220,8 +1220,8 @@ export async function _listByResourceGroupDeserialize( identity: !p.identity ? undefined : { - tenantId: p.identity?.["tenantId"], principalId: p.identity?.["principalId"], + tenantId: p.identity?.["tenantId"], type: p.identity?.["type"], userAssignedIdentities: p.identity?.["userAssignedIdentities"], }, @@ -1282,8 +1282,8 @@ export async function _listBySubscriptionDeserialize( return { value: result.body["value"].map((p) => ({ - location: p["location"], tags: p["tags"], + location: p["location"], id: p["id"], name: p["name"], type: p["type"], @@ -1383,8 +1383,8 @@ export async function _listBySubscriptionDeserialize( identity: !p.identity ? undefined : { - tenantId: p.identity?.["tenantId"], principalId: p.identity?.["principalId"], + tenantId: p.identity?.["tenantId"], type: p.identity?.["type"], userAssignedIdentities: p.identity?.["userAssignedIdentities"], }, diff --git a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/api/operations/index.ts b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/api/operations/index.ts index ae7bcb55cc..4cb53ba5af 100644 --- a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/api/operations/index.ts +++ b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/api/operations/index.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { PagedOperation, Operation } from "../../models/models.js"; +import { OperationListResult, Operation } from "../../models/models.js"; import { PagedAsyncIterableIterator } from "../../models/pagingTypes.js"; import { buildPagedAsyncIterator } from "../pagingHelpers.js"; import { @@ -28,7 +28,7 @@ export function _listSend( export async function _listDeserialize( result: OperationsList200Response | OperationsListDefaultResponse, -): Promise { +): Promise { if (isUnexpected(result)) { throw createRestError(result); } diff --git a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/index.ts b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/index.ts index ef28745c2e..29041aedf2 100644 --- a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/index.ts +++ b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/index.ts @@ -30,15 +30,11 @@ export { ManagedServiceIdentityType, KnownManagedServiceIdentityType, UserAssignedIdentity, - UserAssignedIdentities, ErrorResponse, ErrorDetail, ErrorAdditionalInfo, DataProductUpdate, DataProductUpdateProperties, - ArmOperationStatus, - ResourceProvisioningState, - KnownResourceProvisioningState, AccountSas, AccountSasToken, KeyVaultInfo, @@ -64,7 +60,7 @@ export { DataProductInformation, DataProductVersion, DataProductsCatalogListResult, - PagedOperation, + OperationListResult, Operation, OperationDisplay, Origin, diff --git a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/models/index.ts b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/models/index.ts index 3d4093116c..cdff765863 100644 --- a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/models/index.ts +++ b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/models/index.ts @@ -25,15 +25,11 @@ export { ManagedServiceIdentityType, KnownManagedServiceIdentityType, UserAssignedIdentity, - UserAssignedIdentities, ErrorResponse, ErrorDetail, ErrorAdditionalInfo, DataProductUpdate, DataProductUpdateProperties, - ArmOperationStatus, - ResourceProvisioningState, - KnownResourceProvisioningState, AccountSas, AccountSasToken, KeyVaultInfo, @@ -59,7 +55,7 @@ export { DataProductInformation, DataProductVersion, DataProductsCatalogListResult, - PagedOperation, + OperationListResult, Operation, OperationDisplay, Origin, diff --git a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/models/models.ts b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/models/models.ts index 918a3ad71d..758c4c8ce9 100644 --- a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/models/models.ts +++ b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/models/models.ts @@ -1,7 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -/** Common properties for all Azure Resource Manager resources. */ +/** Common fields that are returned in the response for all Azure Resource Manager resources */ export interface Resource { /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */ readonly id?: string; @@ -16,17 +16,17 @@ export interface Resource { /** Metadata pertaining to creation and last modification of the resource. */ export interface SystemData { /** The identity that created the resource. */ - readonly createdBy?: string; + createdBy?: string; /** The type of identity that created the resource. */ - readonly createdByType?: CreatedByType; - /** The type of identity that created the resource. */ - readonly createdAt?: Date; + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date; /** The identity that last modified the resource. */ - readonly lastModifiedBy?: string; + lastModifiedBy?: string; /** The type of identity that last modified the resource. */ - readonly lastModifiedByType?: CreatedByType; + lastModifiedByType?: CreatedByType; /** The timestamp of resource last modification (UTC) */ - readonly lastModifiedAt?: Date; + lastModifiedAt?: Date; } /** The kind of entity that created the resource. */ @@ -41,10 +41,10 @@ export enum KnownCreatedByType { /** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ export interface TrackedResource extends Resource { - /** The geo-location where the resource lives */ - location: string; /** Resource tags. */ tags?: Record; + /** The geo-location where the resource lives */ + location: string; } /** The data product resource. */ @@ -192,40 +192,36 @@ export interface ConsumptionEndpointsProperties { readonly queryResourceId?: string; } -/** The properties of the managed service identities assigned to this resource. */ +/** Managed service identity (system assigned and/or user assigned identities) */ export interface ManagedServiceIdentity { - /** The Active Directory tenant id of the principal. */ - readonly tenantId?: string; - /** The active directory identifier of this principal. */ + /** The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. */ readonly principalId?: string; + /** The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. */ + readonly tenantId?: string; /** The type of managed identity assigned to this resource. */ type: ManagedServiceIdentityType; /** The identities assigned to this resource by the user. */ - userAssignedIdentities?: UserAssignedIdentities; + userAssignedIdentities?: Record; } -/** The kind of managed identity assigned to this resource. */ +/** Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ export type ManagedServiceIdentityType = string; export enum KnownManagedServiceIdentityType { None = "None", SystemAssigned = "SystemAssigned", UserAssigned = "UserAssigned", - "SystemAssigned, UserAssigned" = "SystemAssigned, UserAssigned", + "SystemAssigned,UserAssigned" = "SystemAssigned,UserAssigned", } -/** A managed identity assigned by the user. */ +/** User assigned identity properties */ export interface UserAssignedIdentity { - /** The active directory client identifier for this principal. */ - clientId?: string; - /** The active directory identifier for this principal. */ - principalId?: string; + /** The principal ID of the assigned identity. */ + readonly principalId?: string; + /** The client ID of the assigned identity. */ + readonly clientId?: string; } -/** The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", */ -export interface UserAssignedIdentities - extends Record {} - /** Common error response for all Azure Resource Manager APIs to return error details for failed operations. */ export interface ErrorResponse { /** The error object. */ @@ -277,31 +273,6 @@ export interface DataProductUpdateProperties { currentMinorVersion?: string; } -/** Standard Azure Resource Manager operation status response */ -export interface ArmOperationStatus { - /** The operation status */ - status: ResourceProvisioningState; - /** The name of the operationStatus resource */ - readonly name?: string; - /** Operation start time */ - readonly startTime?: Date; - /** Operation complete time */ - readonly endTime?: Date; - /** The progress made toward completing the operation */ - readonly percentComplete?: number; - /** Errors that occurred if the operation ended with Canceled or Failed status */ - readonly error?: ErrorDetail; -} - -/** The provisioning state of a resource type. */ -export type ResourceProvisioningState = string; - -export enum KnownResourceProvisioningState { - Succeeded = "Succeeded", - Failed = "Failed", - Canceled = "Canceled", -} - /** The details for storage account sas creation. */ export interface AccountSas { /** Sas token start timestamp. */ @@ -382,7 +353,7 @@ export interface DataProductListResult { nextLink?: string; } -/** The base proxy resource. */ +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ export interface ProxyResource extends Resource {} /** The data type resource. */ @@ -505,7 +476,7 @@ export interface DataProductsCatalogListResult { } /** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ -export interface PagedOperation { +export interface OperationListResult { /** The Operation items on this page */ value: Operation[]; /** The link to the next page of items */ diff --git a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/rest/models.ts b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/rest/models.ts index cc3d483082..03766464ae 100644 --- a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/rest/models.ts +++ b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/rest/models.ts @@ -37,21 +37,34 @@ export interface DataProductVersion { version: string; } -/** The base proxy resource. */ +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ export interface ProxyResource extends Resource {} -/** Common properties for all Azure Resource Manager resources. */ +/** Common fields that are returned in the response for all Azure Resource Manager resources */ export interface Resource {} /** Metadata pertaining to creation and last modification of the resource. */ -export interface SystemData {} +export interface SystemData { + /** The identity that created the resource. */ + createdBy?: string; + /** The type of identity that created the resource. */ + createdByType?: CreatedByType; + /** The timestamp of resource creation (UTC). */ + createdAt?: Date | string; + /** The identity that last modified the resource. */ + lastModifiedBy?: string; + /** The type of identity that last modified the resource. */ + lastModifiedByType?: CreatedByType; + /** The timestamp of resource last modification (UTC) */ + lastModifiedAt?: Date | string; +} /** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ export interface TrackedResource extends Resource { - /** The geo-location where the resource lives */ - location: string; /** Resource tags. */ tags?: Record; + /** The geo-location where the resource lives */ + location: string; } /** The data product resource. */ @@ -145,24 +158,72 @@ export interface ManagedResourceGroupConfiguration { /** Details of Consumption Properties */ export interface ConsumptionEndpointsProperties {} -/** The properties of the managed service identities assigned to this resource. */ +/** Managed service identity (system assigned and/or user assigned identities) */ export interface ManagedServiceIdentity { /** The type of managed identity assigned to this resource. */ type: ManagedServiceIdentityType; /** The identities assigned to this resource by the user. */ - userAssignedIdentities?: UserAssignedIdentities; -} - -/** The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", */ -export interface UserAssignedIdentities - extends Record {} - -/** A managed identity assigned by the user. */ -export interface UserAssignedIdentity { - /** The active directory client identifier for this principal. */ - clientId?: string; - /** The active directory identifier for this principal. */ - principalId?: string; + userAssignedIdentities?: Record; +} + +/** User assigned identity properties */ +export interface UserAssignedIdentity {} + +/** The resource model definition containing the full set of allowed properties for a resource. Except properties bag, there cannot be a top level property outside of this set. */ +export interface ResourceModelWithAllowedPropertySet extends TrackedResource { + /** + * The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. + * If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. + */ + managedBy?: string; + /** + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. + * If supported, the resource provider must validate and persist this value. + */ + kind?: string; + /** + * The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. + * Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), + * If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + */ + eTag?: string; + identity?: Identity; + sku?: Sku; + plan?: Plan; +} + +/** Identity for the resource. */ +export interface Identity { + /** The identity type. */ + type?: ResourceIdentityType; +} + +/** The resource model definition representing SKU */ +export interface Sku { + /** The name of the SKU. Ex - P3. It is typically a letter+number code */ + name: string; + /** This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. */ + tier?: SkuTier; + /** The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. */ + size?: string; + /** If the service has different generations of hardware, for the same SKU, then that can be captured here. */ + family?: string; + /** If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. */ + capacity?: number; +} + +/** Plan for the resource. */ +export interface Plan { + /** A user defined name of the 3rd Party Artifact that is being procured. */ + name: string; + /** The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic */ + publisher: string; + /** The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. */ + product: string; + /** A publisher provided promotion code as provisioned in Data Market for the said product/artifact. */ + promotionCode?: string; + /** The version of the desired product/artifact. */ + version?: string; } /** The base extension resource. */ @@ -171,27 +232,34 @@ export interface ExtensionResource extends Resource {} /** The resource model definition for an Azure Resource Manager resource with an etag. */ export interface AzureEntityResource extends Resource {} +/** A private link resource. */ +export interface PrivateLinkResource extends Resource { + /** Resource properties. */ + properties?: PrivateLinkResourceProperties; +} + +/** Properties of a private link resource. */ +export interface PrivateLinkResourceProperties { + /** The private link resource private link DNS zone name. */ + requiredZoneNames?: string[]; +} + /** The private endpoint connection resource */ -export interface PrivateEndpointConnection extends ProxyResource { +export interface PrivateEndpointConnection extends Resource { /** The private endpoint connection properties */ properties?: PrivateEndpointConnectionProperties; } -/** Properties of he private endpoint connection resource */ +/** Properties of the private endpoint connection. */ export interface PrivateEndpointConnectionProperties { - /** The private endpoint resource */ + /** The private endpoint resource. */ privateEndpoint?: PrivateEndpoint; /** A collection of information about the state of the connection between service consumer and provider. */ privateLinkServiceConnectionState: PrivateLinkServiceConnectionState; - /** The provisioning state of the private endpoint connection resource. */ - provisioningState?: PrivateEndpointConnectionProvisioningState; } -/** The private endpoint resource */ -export interface PrivateEndpoint { - /** The resource identifier for private endpoint */ - id?: string; -} +/** The Private Endpoint resource. */ +export interface PrivateEndpoint {} /** A collection of information about the state of the connection between service consumer and provider. */ export interface PrivateLinkServiceConnectionState { @@ -203,17 +271,6 @@ export interface PrivateLinkServiceConnectionState { actionsRequired?: string; } -export interface PrivateLinkResource extends ProxyResource { - /** Properties of the private link resource. */ - properties?: PrivateLinkResourceProperties; -} - -/** Properties of a private link resource. */ -export interface PrivateLinkResourceProperties { - /** The private link resource private link DNS zone name. */ - requiredZoneNames?: string[]; -} - /** The data type resource. */ export interface DataType extends ProxyResource { /** The resource-specific properties for this resource. */ @@ -342,10 +399,12 @@ export type ControlState = string; export type DefaultAction = string; /** Alias for ManagedServiceIdentityType */ export type ManagedServiceIdentityType = string; +/** Alias for ResourceIdentityType */ +export type ResourceIdentityType = "SystemAssigned"; +/** Alias for SkuTier */ +export type SkuTier = "Free" | "Basic" | "Standard" | "Premium"; /** Alias for PrivateEndpointServiceConnectionStatus */ export type PrivateEndpointServiceConnectionStatus = string; -/** Alias for ResourceProvisioningState */ -export type ResourceProvisioningState = string; /** Alias for PrivateEndpointConnectionProvisioningState */ export type PrivateEndpointConnectionProvisioningState = string; /** Alias for DataTypeState */ diff --git a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/rest/outputModels.ts b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/rest/outputModels.ts index 4b8c29d0bc..7ef3cec54d 100644 --- a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/rest/outputModels.ts +++ b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/rest/outputModels.ts @@ -95,10 +95,10 @@ export interface DataProductVersionOutput { version: string; } -/** The base proxy resource. */ +/** The resource model definition for a Azure Resource Manager proxy resource. It will not have tags and a location */ export interface ProxyResourceOutput extends ResourceOutput {} -/** Common properties for all Azure Resource Manager resources. */ +/** Common fields that are returned in the response for all Azure Resource Manager resources */ export interface ResourceOutput { /** Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} */ readonly id?: string; @@ -113,25 +113,25 @@ export interface ResourceOutput { /** Metadata pertaining to creation and last modification of the resource. */ export interface SystemDataOutput { /** The identity that created the resource. */ - readonly createdBy?: string; + createdBy?: string; /** The type of identity that created the resource. */ - readonly createdByType?: CreatedByTypeOutput; - /** The type of identity that created the resource. */ - readonly createdAt?: string; + createdByType?: CreatedByTypeOutput; + /** The timestamp of resource creation (UTC). */ + createdAt?: string; /** The identity that last modified the resource. */ - readonly lastModifiedBy?: string; + lastModifiedBy?: string; /** The type of identity that last modified the resource. */ - readonly lastModifiedByType?: CreatedByTypeOutput; + lastModifiedByType?: CreatedByTypeOutput; /** The timestamp of resource last modification (UTC) */ - readonly lastModifiedAt?: string; + lastModifiedAt?: string; } /** The resource model definition for an Azure Resource Manager tracked top level resource which has 'tags' and a 'location' */ export interface TrackedResourceOutput extends ResourceOutput { - /** The geo-location where the resource lives */ - location: string; /** Resource tags. */ tags?: Record; + /** The geo-location where the resource lives */ + location: string; } /** The data product resource. */ @@ -250,28 +250,86 @@ export interface ConsumptionEndpointsPropertiesOutput { readonly queryResourceId?: string; } -/** The properties of the managed service identities assigned to this resource. */ +/** Managed service identity (system assigned and/or user assigned identities) */ export interface ManagedServiceIdentityOutput { - /** The Active Directory tenant id of the principal. */ - readonly tenantId?: string; - /** The active directory identifier of this principal. */ + /** The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. */ readonly principalId?: string; + /** The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. */ + readonly tenantId?: string; /** The type of managed identity assigned to this resource. */ type: ManagedServiceIdentityTypeOutput; /** The identities assigned to this resource by the user. */ - userAssignedIdentities?: UserAssignedIdentitiesOutput; + userAssignedIdentities?: Record; } -/** The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests.", */ -export interface UserAssignedIdentitiesOutput - extends Record {} - -/** A managed identity assigned by the user. */ +/** User assigned identity properties */ export interface UserAssignedIdentityOutput { - /** The active directory client identifier for this principal. */ - clientId?: string; - /** The active directory identifier for this principal. */ - principalId?: string; + /** The principal ID of the assigned identity. */ + readonly principalId?: string; + /** The client ID of the assigned identity. */ + readonly clientId?: string; +} + +/** The resource model definition containing the full set of allowed properties for a resource. Except properties bag, there cannot be a top level property outside of this set. */ +export interface ResourceModelWithAllowedPropertySetOutput + extends TrackedResourceOutput { + /** + * The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. + * If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. + */ + managedBy?: string; + /** + * Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. + * If supported, the resource provider must validate and persist this value. + */ + kind?: string; + /** + * The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. + * Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), + * If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + */ + eTag?: string; + identity?: IdentityOutput; + sku?: SkuOutput; + plan?: PlanOutput; +} + +/** Identity for the resource. */ +export interface IdentityOutput { + /** The principal ID of resource identity. The value must be an UUID. */ + readonly principalId?: string; + /** The tenant ID of resource. The value must be an UUID. */ + readonly tenantId?: string; + /** The identity type. */ + type?: ResourceIdentityTypeOutput; +} + +/** The resource model definition representing SKU */ +export interface SkuOutput { + /** The name of the SKU. Ex - P3. It is typically a letter+number code */ + name: string; + /** This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. */ + tier?: SkuTierOutput; + /** The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. */ + size?: string; + /** If the service has different generations of hardware, for the same SKU, then that can be captured here. */ + family?: string; + /** If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. */ + capacity?: number; +} + +/** Plan for the resource. */ +export interface PlanOutput { + /** A user defined name of the 3rd Party Artifact that is being procured. */ + name: string; + /** The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic */ + publisher: string; + /** The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. */ + product: string; + /** A publisher provided promotion code as provisioned in Data Market for the said product/artifact. */ + promotionCode?: string; + /** The version of the desired product/artifact. */ + version?: string; } /** The base extension resource. */ @@ -280,31 +338,45 @@ export interface ExtensionResourceOutput extends ResourceOutput {} /** The resource model definition for an Azure Resource Manager resource with an etag. */ export interface AzureEntityResourceOutput extends ResourceOutput { /** Resource Etag. */ - readonly etag: string; + readonly etag?: string; +} + +/** A private link resource. */ +export interface PrivateLinkResourceOutput extends ResourceOutput { + /** Resource properties. */ + properties?: PrivateLinkResourcePropertiesOutput; +} + +/** Properties of a private link resource. */ +export interface PrivateLinkResourcePropertiesOutput { + /** The private link resource group id. */ + readonly groupId?: string; + /** The private link resource required member names. */ + readonly requiredMembers?: string[]; + /** The private link resource private link DNS zone name. */ + requiredZoneNames?: string[]; } /** The private endpoint connection resource */ -export interface PrivateEndpointConnectionOutput extends ProxyResourceOutput { +export interface PrivateEndpointConnectionOutput extends ResourceOutput { /** The private endpoint connection properties */ properties?: PrivateEndpointConnectionPropertiesOutput; } -/** Properties of he private endpoint connection resource */ +/** Properties of the private endpoint connection. */ export interface PrivateEndpointConnectionPropertiesOutput { - /** The group identifiers for the private endpoint resource */ - readonly groupIds?: string[]; - /** The private endpoint resource */ + /** The private endpoint resource. */ privateEndpoint?: PrivateEndpointOutput; /** A collection of information about the state of the connection between service consumer and provider. */ privateLinkServiceConnectionState: PrivateLinkServiceConnectionStateOutput; /** The provisioning state of the private endpoint connection resource. */ - provisioningState?: PrivateEndpointConnectionProvisioningStateOutput; + readonly provisioningState?: PrivateEndpointConnectionProvisioningStateOutput; } -/** The private endpoint resource */ +/** The Private Endpoint resource. */ export interface PrivateEndpointOutput { /** The resource identifier for private endpoint */ - id?: string; + readonly id?: string; } /** A collection of information about the state of the connection between service consumer and provider. */ @@ -317,21 +389,6 @@ export interface PrivateLinkServiceConnectionStateOutput { actionsRequired?: string; } -export interface PrivateLinkResourceOutput extends ProxyResourceOutput { - /** Properties of the private link resource. */ - properties?: PrivateLinkResourcePropertiesOutput; -} - -/** Properties of a private link resource. */ -export interface PrivateLinkResourcePropertiesOutput { - /** The private link resource group id. */ - readonly groupId?: string; - /** The private link resource required member names. */ - readonly requiredMembers?: string[]; - /** The private link resource private link DNS zone name. */ - requiredZoneNames?: string[]; -} - /** The data type resource. */ export interface DataTypeOutput extends ProxyResourceOutput { /** The resource-specific properties for this resource. */ @@ -395,7 +452,7 @@ export interface ListRoleAssignmentsOutput { } /** A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of results. */ -export type PagedOperationOutput = Paged; +export type OperationListResultOutput = Paged; /** Alias for OriginOutput */ export type OriginOutput = string; /** Alias for ActionTypeOutput */ @@ -410,10 +467,12 @@ export type ControlStateOutput = string; export type DefaultActionOutput = string; /** Alias for ManagedServiceIdentityTypeOutput */ export type ManagedServiceIdentityTypeOutput = string; +/** Alias for ResourceIdentityTypeOutput */ +export type ResourceIdentityTypeOutput = "SystemAssigned"; +/** Alias for SkuTierOutput */ +export type SkuTierOutput = "Free" | "Basic" | "Standard" | "Premium"; /** Alias for PrivateEndpointServiceConnectionStatusOutput */ export type PrivateEndpointServiceConnectionStatusOutput = string; -/** Alias for ResourceProvisioningStateOutput */ -export type ResourceProvisioningStateOutput = string; /** Alias for PrivateEndpointConnectionProvisioningStateOutput */ export type PrivateEndpointConnectionProvisioningStateOutput = string; /** Alias for DataTypeStateOutput */ diff --git a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/rest/responses.ts b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/rest/responses.ts index 050b71813b..a64d35150f 100644 --- a/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/rest/responses.ts +++ b/packages/typespec-test/test/NetworkAnalytics.Management/generated/typespec-ts/src/rest/responses.ts @@ -4,7 +4,7 @@ import { RawHttpHeaders } from "@azure/core-rest-pipeline"; import { HttpResponse } from "@azure-rest/core-client"; import { - PagedOperationOutput, + OperationListResultOutput, ErrorResponseOutput, DataProductsCatalogOutput, DataProductsCatalogListResultOutput, @@ -21,7 +21,7 @@ import { /** Azure operation completed successfully. */ export interface OperationsList200Response extends HttpResponse { status: "200"; - body: PagedOperationOutput; + body: OperationListResultOutput; } export interface OperationsListDefaultResponse extends HttpResponse { @@ -73,6 +73,8 @@ export interface DataTypesCreate200Response extends HttpResponse { } export interface DataTypesCreate201Headers { + /** A link to the status monitor */ + "azure-asyncoperation"?: string; /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ "retry-after"?: number; } @@ -224,6 +226,8 @@ export interface DataProductsCreate200Response extends HttpResponse { } export interface DataProductsCreate201Headers { + /** A link to the status monitor */ + "azure-asyncoperation"?: string; /** The Retry-After header can indicate how long the client should wait before polling the operation status. */ "retry-after"?: number; } diff --git a/packages/typespec-test/test/anomalyDetector/generated/openapi/v1.1/openapi.json b/packages/typespec-test/test/anomalyDetector/generated/openapi/v1.1/openapi.json index e711b82c89..6991cbb2e2 100644 --- a/packages/typespec-test/test/anomalyDetector/generated/openapi/v1.1/openapi.json +++ b/packages/typespec-test/test/anomalyDetector/generated/openapi/v1.1/openapi.json @@ -658,7 +658,7 @@ ], "x-ms-enum": { "name": "DataSchema", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "OneTable", @@ -721,7 +721,7 @@ ], "x-ms-enum": { "name": "FillNAMethod", - "modelAsString": true + "modelAsString": false } }, "Multivariate.ModelInfo": { @@ -1167,7 +1167,7 @@ ], "x-ms-enum": { "name": "AnomalyDetectorErrorCodes", - "modelAsString": true + "modelAsString": false } }, "Univariate.ImputeMode": { @@ -1182,7 +1182,7 @@ ], "x-ms-enum": { "name": "ImputeMode", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "Auto", diff --git a/packages/typespec-test/test/anomalyDetector/generated/typespec-ts/review/ai-anomaly-detector.api.md b/packages/typespec-test/test/anomalyDetector/generated/typespec-ts/review/ai-anomaly-detector.api.md index 0eaa7919e8..f8ee6f4cdd 100644 --- a/packages/typespec-test/test/anomalyDetector/generated/typespec-ts/review/ai-anomaly-detector.api.md +++ b/packages/typespec-test/test/anomalyDetector/generated/typespec-ts/review/ai-anomaly-detector.api.md @@ -9,7 +9,7 @@ import { KeyCredential } from '@azure/core-auth'; import { OperationOptions } from '@azure-rest/core-client'; import { Pipeline } from '@azure/core-rest-pipeline'; -// @public (undocumented) +// @public export type AlignMode = "Inner" | "Outer"; // @public (undocumented) @@ -25,7 +25,7 @@ export interface AnomalyDetectorClientOptions extends ClientOptions { apiVersion?: string; } -// @public (undocumented) +// @public export type AnomalyDetectorErrorCodes = "InvalidCustomInterval" | "BadArgument" | "InvalidGranularity" | "InvalidPeriod" | "InvalidModelArgument" | "InvalidSeries" | "InvalidJsonFormat" | "RequiredGranularity" | "RequiredSeries" | "InvalidImputeMode" | "InvalidImputeFixedValue"; // @public @@ -39,10 +39,10 @@ export type DataSchema = "OneTable" | "MultiTable"; // @public export type FillNAMethod = "Previous" | "Subsequent" | "Linear" | "Zero" | "Fixed"; -// @public (undocumented) +// @public export type ImputeMode = "auto" | "previous" | "linear" | "fixed" | "zero" | "notFill"; -// @public (undocumented) +// @public export type ModelStatus = "CREATED" | "RUNNING" | "READY" | "FAILED"; // @public @@ -82,7 +82,7 @@ export interface MultivariateAnomalyValue { severity: number; } -// @public (undocumented) +// @public export type MultivariateBatchDetectionStatus = "CREATED" | "RUNNING" | "READY" | "FAILED"; // @public @@ -243,7 +243,7 @@ export interface PageSettings { continuationToken?: string; } -// @public (undocumented) +// @public export type TimeGranularity = "yearly" | "monthly" | "weekly" | "daily" | "hourly" | "minutely" | "secondly" | "microsecond" | "none"; // @public @@ -334,7 +334,7 @@ export interface UnivariateUnivariateLastDetectionResult { upperMargin: number; } -// @public (undocumented) +// @public export type Versions = "v1.1"; // (No @packageDocumentation comment for this package) diff --git a/packages/typespec-test/test/anomalyDetector/generated/typespec-ts/src/models/models.ts b/packages/typespec-test/test/anomalyDetector/generated/typespec-ts/src/models/models.ts index e228f3f85a..73a2d1e7b4 100644 --- a/packages/typespec-test/test/anomalyDetector/generated/typespec-ts/src/models/models.ts +++ b/packages/typespec-test/test/anomalyDetector/generated/typespec-ts/src/models/models.ts @@ -26,6 +26,7 @@ export interface MultivariateMultivariateBatchDetectionResultSummary { setupInfo: MultivariateMultivariateBatchDetectionOptions; } +/** Type of MultivariateBatchDetectionStatus */ export type MultivariateBatchDetectionStatus = | "CREATED" | "RUNNING" @@ -196,6 +197,7 @@ export interface MultivariateAlignPolicy { paddingValue?: number; } +/** Type of AlignMode */ export type AlignMode = "Inner" | "Outer"; /** An optional field, indicating how missing values will be filled. One of Previous, Subsequent, Linear, Zero, Fixed. */ export type FillNAMethod = @@ -204,6 +206,7 @@ export type FillNAMethod = | "Linear" | "Zero" | "Fixed"; +/** Type of ModelStatus */ export type ModelStatus = "CREATED" | "RUNNING" | "READY" | "FAILED"; /** Diagnostics information to help inspect the states of model or variable. */ @@ -350,6 +353,7 @@ export interface UnivariateTimeSeriesPoint { value: number; } +/** Type of TimeGranularity */ export type TimeGranularity = | "yearly" | "monthly" @@ -360,6 +364,7 @@ export type TimeGranularity = | "secondly" | "microsecond" | "none"; +/** Type of ImputeMode */ export type ImputeMode = | "auto" | "previous" @@ -432,6 +437,7 @@ export interface UnivariateAnomalyDetectorError { message?: string; } +/** Type of AnomalyDetectorErrorCodes */ export type AnomalyDetectorErrorCodes = | "InvalidCustomInterval" | "BadArgument" @@ -545,4 +551,5 @@ export interface UnivariateUnivariateChangePointDetectionResult { confidenceScores?: number[]; } +/** Type of Versions */ export type Versions = "v1.1"; diff --git a/packages/typespec-test/test/authoring/generated/openapi/2022-05-15-preview/openapi.json b/packages/typespec-test/test/authoring/generated/openapi/2022-05-15-preview/openapi.json index a1c71301fc..de8d628bec 100644 --- a/packages/typespec-test/test/authoring/generated/openapi/2022-05-15-preview/openapi.json +++ b/packages/typespec-test/test/authoring/generated/openapi/2022-05-15-preview/openapi.json @@ -183,6 +183,9 @@ } } }, + "x-ms-long-running-operation-options": { + "final-state-via": "operation-location" + }, "x-ms-long-running-operation": true }, "delete": { @@ -246,6 +249,9 @@ } } }, + "x-ms-long-running-operation-options": { + "final-state-via": "operation-location" + }, "x-ms-long-running-operation": true } }, @@ -292,6 +298,9 @@ } } }, + "x-ms-long-running-operation-options": { + "final-state-via": "operation-location" + }, "x-ms-long-running-operation": true } }, @@ -335,6 +344,9 @@ } } }, + "x-ms-long-running-operation-options": { + "final-state-via": "operation-location" + }, "x-ms-long-running-operation": true } }, @@ -387,6 +399,9 @@ } } }, + "x-ms-long-running-operation-options": { + "final-state-via": "operation-location" + }, "x-ms-long-running-operation": true } }, @@ -546,6 +561,9 @@ } } }, + "x-ms-long-running-operation-options": { + "final-state-via": "original-uri" + }, "x-ms-long-running-operation": true }, "delete": { @@ -616,6 +634,9 @@ } } }, + "x-ms-long-running-operation-options": { + "final-state-via": "operation-location" + }, "x-ms-long-running-operation": true } }, @@ -766,6 +787,9 @@ } } }, + "x-ms-long-running-operation-options": { + "final-state-via": "operation-location" + }, "x-ms-long-running-operation": true } }, diff --git a/packages/typespec-test/test/authoring/generated/typespec-ts/review/authoring.api.md b/packages/typespec-test/test/authoring/generated/typespec-ts/review/authoring.api.md index 6098404b0a..69a4944c1a 100644 --- a/packages/typespec-test/test/authoring/generated/typespec-ts/review/authoring.api.md +++ b/packages/typespec-test/test/authoring/generated/typespec-ts/review/authoring.api.md @@ -729,7 +729,7 @@ export interface ListTrainingConfigVersionsQueryParamProperties { } // @public -export type OperationStateOutput = "NotStarted" | "Running" | "Succeeded" | "Failed" | "Canceled"; +export type OperationStateOutput = string; // @public export interface OperationStatusOutput { diff --git a/packages/typespec-test/test/authoring/generated/typespec-ts/src/outputModels.ts b/packages/typespec-test/test/authoring/generated/typespec-ts/src/outputModels.ts index dc386a6e5c..9631598084 100644 --- a/packages/typespec-test/test/authoring/generated/typespec-ts/src/outputModels.ts +++ b/packages/typespec-test/test/authoring/generated/typespec-ts/src/outputModels.ts @@ -118,13 +118,8 @@ export type ProjectKindOutput = | "CustomSingleLabelClassification" | "CustomMultiLabelClassification" | "CustomEntityRecognition"; -/** Enum describing allowed operation states. */ -export type OperationStateOutput = - | "NotStarted" - | "Running" - | "Succeeded" - | "Failed" - | "Canceled"; +/** Alias for OperationStateOutput */ +export type OperationStateOutput = string; /** Paged collection of Project items */ export type PagedProjectOutput = Paged; /** Paged collection of Deployment items */ diff --git a/packages/typespec-test/test/batch_modular/generated/typespec-ts/src/rest/responses.ts b/packages/typespec-test/test/batch_modular/generated/typespec-ts/src/rest/responses.ts index be7a5c5a64..9b1f085f8b 100644 --- a/packages/typespec-test/test/batch_modular/generated/typespec-ts/src/rest/responses.ts +++ b/packages/typespec-test/test/batch_modular/generated/typespec-ts/src/rest/responses.ts @@ -1320,6 +1320,8 @@ export interface GetTaskFile200Headers { "ocp-batch-file-mode": string; /** The length of the file. */ "content-length": number; + /** Type of content */ + "content-type": "application/octet-stream"; } /** The request has succeeded. */ diff --git a/packages/typespec-test/test/chatApi_modular/generated/typespec-ts/review/ai-chat-protocol.api.md b/packages/typespec-test/test/chatApi_modular/generated/typespec-ts/review/ai-chat-protocol.api.md index 61236fd6a5..e1154ae593 100644 --- a/packages/typespec-test/test/chatApi_modular/generated/typespec-ts/review/ai-chat-protocol.api.md +++ b/packages/typespec-test/test/chatApi_modular/generated/typespec-ts/review/ai-chat-protocol.api.md @@ -10,7 +10,7 @@ import { OperationOptions } from '@azure-rest/core-client'; import { Pipeline } from '@azure/core-rest-pipeline'; import { TokenCredential } from '@azure/core-auth'; -// @public (undocumented) +// @public export type APIVersion = "2023-10-01-preview"; // @public diff --git a/packages/typespec-test/test/chatApi_modular/generated/typespec-ts/src/models/models.ts b/packages/typespec-test/test/chatApi_modular/generated/typespec-ts/src/models/models.ts index 9225f9ce2c..e72a57b869 100644 --- a/packages/typespec-test/test/chatApi_modular/generated/typespec-ts/src/models/models.ts +++ b/packages/typespec-test/test/chatApi_modular/generated/typespec-ts/src/models/models.ts @@ -133,4 +133,5 @@ export interface ChatChoiceRecord { finishReason: FinishReason; } +/** Type of APIVersion */ export type APIVersion = "2023-10-01-preview"; diff --git a/packages/typespec-test/test/contentsafety_modular/generated/typespec-ts/review/ai-content-safety.api.md b/packages/typespec-test/test/contentsafety_modular/generated/typespec-ts/review/ai-content-safety.api.md index 66793bbc49..c802406d72 100644 --- a/packages/typespec-test/test/contentsafety_modular/generated/typespec-ts/review/ai-content-safety.api.md +++ b/packages/typespec-test/test/contentsafety_modular/generated/typespec-ts/review/ai-content-safety.api.md @@ -202,7 +202,7 @@ export interface TextBlocklistMatchResult { // @public export type TextCategory = "Hate" | "SelfHarm" | "Sexual" | "Violence"; -// @public (undocumented) +// @public export type Versions = "2023-10-01"; // (No @packageDocumentation comment for this package) diff --git a/packages/typespec-test/test/contentsafety_modular/generated/typespec-ts/src/models/models.ts b/packages/typespec-test/test/contentsafety_modular/generated/typespec-ts/src/models/models.ts index 13cc2ec676..90b73f20cc 100644 --- a/packages/typespec-test/test/contentsafety_modular/generated/typespec-ts/src/models/models.ts +++ b/packages/typespec-test/test/contentsafety_modular/generated/typespec-ts/src/models/models.ts @@ -127,6 +127,7 @@ export interface TextAnalyzeSeverityResult { severity?: number; } +/** Type of Versions */ export type Versions = "2023-10-01"; /** Paged collection of TextBlocklist items */ diff --git a/packages/typespec-test/test/contoso/generated/openapi/2022-11-01-preview/openapi.json b/packages/typespec-test/test/contoso/generated/openapi/2022-11-01-preview/openapi.json index 3011bb835d..ead6aac2e2 100644 --- a/packages/typespec-test/test/contoso/generated/openapi/2022-11-01-preview/openapi.json +++ b/packages/typespec-test/test/contoso/generated/openapi/2022-11-01-preview/openapi.json @@ -158,6 +158,9 @@ } } }, + "x-ms-long-running-operation-options": { + "final-state-via": "operation-location" + }, "x-ms-long-running-operation": true }, "delete": { @@ -221,6 +224,9 @@ } } }, + "x-ms-long-running-operation-options": { + "final-state-via": "operation-location" + }, "x-ms-long-running-operation": true } }, diff --git a/packages/typespec-test/test/contoso/generated/typespec-ts/review/contosowidgetmanager-rest.api.md b/packages/typespec-test/test/contoso/generated/typespec-ts/review/contosowidgetmanager-rest.api.md index 444ddac818..c74a7f29ef 100644 --- a/packages/typespec-test/test/contoso/generated/typespec-ts/review/contosowidgetmanager-rest.api.md +++ b/packages/typespec-test/test/contoso/generated/typespec-ts/review/contosowidgetmanager-rest.api.md @@ -269,7 +269,7 @@ export interface ListWidgetsDefaultResponse extends HttpResponse { export type ListWidgetsParameters = RequestParameters; // @public -export type OperationStateOutput = "NotStarted" | "Running" | "Succeeded" | "Failed" | "Canceled"; +export type OperationStateOutput = string; // @public export interface OperationStatusOutput { diff --git a/packages/typespec-test/test/contoso/generated/typespec-ts/src/outputModels.ts b/packages/typespec-test/test/contoso/generated/typespec-ts/src/outputModels.ts index 33d855583f..f44266c94c 100644 --- a/packages/typespec-test/test/contoso/generated/typespec-ts/src/outputModels.ts +++ b/packages/typespec-test/test/contoso/generated/typespec-ts/src/outputModels.ts @@ -44,12 +44,7 @@ export interface OperationStatusOutput { error?: ErrorModel; } -/** Enum describing allowed operation states. */ -export type OperationStateOutput = - | "NotStarted" - | "Running" - | "Succeeded" - | "Failed" - | "Canceled"; +/** Alias for OperationStateOutput */ +export type OperationStateOutput = string; /** Paged collection of Widget items */ export type PagedWidgetOutput = Paged; diff --git a/packages/typespec-test/test/eventgrid_modular/generated/typespec-ts/review/eventgrid.api.md b/packages/typespec-test/test/eventgrid_modular/generated/typespec-ts/review/eventgrid.api.md index 56f9ee66d1..869b88df34 100644 --- a/packages/typespec-test/test/eventgrid_modular/generated/typespec-ts/review/eventgrid.api.md +++ b/packages/typespec-test/test/eventgrid_modular/generated/typespec-ts/review/eventgrid.api.md @@ -132,7 +132,7 @@ export interface ReleaseResult { succeededLockTokens: string[]; } -// @public (undocumented) +// @public export type ServiceApiVersions = "2023-06-01-preview"; // (No @packageDocumentation comment for this package) diff --git a/packages/typespec-test/test/eventgrid_modular/generated/typespec-ts/src/models/models.ts b/packages/typespec-test/test/eventgrid_modular/generated/typespec-ts/src/models/models.ts index 5147d86865..e63eb69eb7 100644 --- a/packages/typespec-test/test/eventgrid_modular/generated/typespec-ts/src/models/models.ts +++ b/packages/typespec-test/test/eventgrid_modular/generated/typespec-ts/src/models/models.ts @@ -102,4 +102,5 @@ export interface RejectResult { succeededLockTokens: string[]; } +/** Type of ServiceApiVersions */ export type ServiceApiVersions = "2023-06-01-preview"; diff --git a/packages/typespec-test/test/loadtesting_modular/generated/typespec-ts/review/load-testing.api.md b/packages/typespec-test/test/loadtesting_modular/generated/typespec-ts/review/load-testing.api.md index c1c03a0161..bd33ed34eb 100644 --- a/packages/typespec-test/test/loadtesting_modular/generated/typespec-ts/review/load-testing.api.md +++ b/packages/typespec-test/test/loadtesting_modular/generated/typespec-ts/review/load-testing.api.md @@ -36,10 +36,10 @@ export interface AdministrationOperationsClientOptions extends ClientOptions { apiVersion?: string; } -// @public (undocumented) +// @public export type AggregationType = "Average" | "Count" | "None" | "Total" | "Percentile90" | "Percentile95" | "Percentile99"; -// @public (undocumented) +// @public export type APIVersions = "2022-11-01"; // @public @@ -60,7 +60,7 @@ export interface CertificateMetadata { value?: string; } -// @public (undocumented) +// @public export type CertificateType = "AKV_CERT_URI"; // @public @@ -131,10 +131,10 @@ export interface FileInfo { validationStatus?: FileStatus; } -// @public (undocumented) +// @public export type FileStatus = "NOT_VALIDATED" | "VALIDATION_SUCCESS" | "VALIDATION_FAILURE" | "VALIDATION_INITIATED" | "VALIDATION_NOT_REQUIRED"; -// @public (undocumented) +// @public export type FileType = "JMX_FILE" | "USER_PROPERTIES" | "ADDITIONAL_ARTIFACTS"; // @public (undocumented) @@ -161,7 +161,7 @@ export interface GetTestRunFileOptionalParams extends OperationOptions { export interface GetTestRunOptionalParams extends OperationOptions { } -// @public (undocumented) +// @public export type Interval = "PT5S" | "PT10S" | "PT1M" | "PT5M" | "PT1H"; // @public (undocumented) @@ -259,7 +259,7 @@ export interface MetricRequestPayload { filters?: DimensionFilter[]; } -// @public (undocumented) +// @public export type MetricUnit = "NotSpecified" | "Percent" | "Count" | "Seconds" | "Milliseconds" | "Bytes" | "BytesPerSecond" | "CountPerSecond"; // @public @@ -341,19 +341,19 @@ export interface PassFailMetric { value?: number; } -// @public (undocumented) +// @public export type PFAction = "continue" | "stop"; -// @public (undocumented) +// @public export type PFAgFunc = "count" | "percentage" | "avg" | "p50" | "p90" | "p95" | "p99" | "min" | "max"; -// @public (undocumented) +// @public export type PFMetrics = "response_time_ms" | "latency" | "error" | "requests" | "requests_per_sec"; -// @public (undocumented) +// @public export type PFResult = "passed" | "undetermined" | "failed"; -// @public (undocumented) +// @public export type PFTestResult = "PASSED" | "NOT_APPLICABLE" | "FAILED"; // @public @@ -384,10 +384,10 @@ export interface Secret { value?: string; } -// @public (undocumented) +// @public export type SecretType = "AKV_SECRET_URI" | "SECRET_VALUE"; -// @public (undocumented) +// @public export type Status = "ACCEPTED" | "NOTSTARTED" | "PROVISIONING" | "PROVISIONED" | "CONFIGURING" | "CONFIGURED" | "EXECUTING" | "EXECUTED" | "DEPROVISIONING" | "DEPROVISIONED" | "DONE" | "CANCELLING" | "CANCELLED" | "FAILED" | "VALIDATION_SUCCESS" | "VALIDATION_FAILURE"; // @public (undocumented) @@ -507,10 +507,10 @@ export class TestRunOperationsClient { testRun(testRunId: string, resource: TestRunOperationsClientTestRun, options?: TestRunOptionalParams): PollerLike, TestRunOperationsClientTestRun>; } -// @public (undocumented) +// @public export type TestRunOperationsClientAggregationType = "Average" | "Count" | "None" | "Total" | "Percentile90" | "Percentile95" | "Percentile99"; -// @public (undocumented) +// @public export type TestRunOperationsClientAPIVersions = "2022-11-01"; // @public @@ -531,7 +531,7 @@ export interface TestRunOperationsClientCertificateMetadata { value?: string; } -// @public (undocumented) +// @public export type TestRunOperationsClientCertificateType = "AKV_CERT_URI"; // @public @@ -584,10 +584,10 @@ export interface TestRunOperationsClientFileInfo { validationStatus?: TestRunOperationsClientFileStatus; } -// @public (undocumented) +// @public export type TestRunOperationsClientFileStatus = "NOT_VALIDATED" | "VALIDATION_SUCCESS" | "VALIDATION_FAILURE" | "VALIDATION_INITIATED" | "VALIDATION_NOT_REQUIRED"; -// @public (undocumented) +// @public export type TestRunOperationsClientFileType = "JMX_FILE" | "USER_PROPERTIES" | "ADDITIONAL_ARTIFACTS"; // @public (undocumented) @@ -598,7 +598,7 @@ export interface TestRunOperationsClientGetAppComponentsOptionalParams extends O export interface TestRunOperationsClientGetServerMetricsConfigOptionalParams extends OperationOptions { } -// @public (undocumented) +// @public export type TestRunOperationsClientInterval = "PT5S" | "PT10S" | "PT1M" | "PT5M" | "PT1H"; // @public @@ -647,7 +647,7 @@ export interface TestRunOperationsClientMetricRequestPayload { filters?: TestRunOperationsClientDimensionFilter[]; } -// @public (undocumented) +// @public export type TestRunOperationsClientMetricUnit = "NotSpecified" | "Percent" | "Count" | "Seconds" | "Milliseconds" | "Bytes" | "BytesPerSecond" | "CountPerSecond"; // @public @@ -734,19 +734,19 @@ export interface TestRunOperationsClientPassFailMetric { value?: number; } -// @public (undocumented) +// @public export type TestRunOperationsClientPFAction = "continue" | "stop"; -// @public (undocumented) +// @public export type TestRunOperationsClientPFAgFunc = "count" | "percentage" | "avg" | "p50" | "p90" | "p95" | "p99" | "min" | "max"; -// @public (undocumented) +// @public export type TestRunOperationsClientPFMetrics = "response_time_ms" | "latency" | "error" | "requests" | "requests_per_sec"; -// @public (undocumented) +// @public export type TestRunOperationsClientPFResult = "passed" | "undetermined" | "failed"; -// @public (undocumented) +// @public export type TestRunOperationsClientPFTestResult = "PASSED" | "NOT_APPLICABLE" | "FAILED"; // @public @@ -767,10 +767,10 @@ export interface TestRunOperationsClientSecret { value?: string; } -// @public (undocumented) +// @public export type TestRunOperationsClientSecretType = "AKV_SECRET_URI" | "SECRET_VALUE"; -// @public (undocumented) +// @public export type TestRunOperationsClientStatus = "ACCEPTED" | "NOTSTARTED" | "PROVISIONING" | "PROVISIONED" | "CONFIGURING" | "CONFIGURED" | "EXECUTING" | "EXECUTED" | "DEPROVISIONING" | "DEPROVISIONED" | "DONE" | "CANCELLING" | "CANCELLED" | "FAILED" | "VALIDATION_SUCCESS" | "VALIDATION_FAILURE"; // @public @@ -910,7 +910,7 @@ export interface TestRunOperationsClientTestServerMetricConfig { readonly testId?: string; } -// @public (undocumented) +// @public export type TestRunOperationsClientTimeGrain = "PT5S" | "PT10S" | "PT1M" | "PT5M" | "PT1H"; // @public @@ -970,7 +970,7 @@ export interface TestServerMetricConfig { readonly testId?: string; } -// @public (undocumented) +// @public export type TimeGrain = "PT5S" | "PT10S" | "PT1M" | "PT5M" | "PT1H"; // @public diff --git a/packages/typespec-test/test/loadtesting_modular/generated/typespec-ts/src/administrationOperations/models/models.ts b/packages/typespec-test/test/loadtesting_modular/generated/typespec-ts/src/administrationOperations/models/models.ts index 1e24def656..2bc96d7a75 100644 --- a/packages/typespec-test/test/loadtesting_modular/generated/typespec-ts/src/administrationOperations/models/models.ts +++ b/packages/typespec-test/test/loadtesting_modular/generated/typespec-ts/src/administrationOperations/models/models.ts @@ -77,12 +77,14 @@ export interface PassFailMetric { readonly result?: PFResult; } +/** Type of PFMetrics */ export type PFMetrics = | "response_time_ms" | "latency" | "error" | "requests" | "requests_per_sec"; +/** Type of PFAgFunc */ export type PFAgFunc = | "count" | "percentage" @@ -93,7 +95,9 @@ export type PFAgFunc = | "p99" | "min" | "max"; +/** Type of PFAction */ export type PFAction = "continue" | "stop"; +/** Type of PFResult */ export type PFResult = "passed" | "undetermined" | "failed"; /** Secret */ @@ -104,6 +108,7 @@ export interface Secret { type?: SecretType; } +/** Type of SecretType */ export type SecretType = "AKV_SECRET_URI" | "SECRET_VALUE"; /** Certificates metadata */ @@ -116,6 +121,7 @@ export interface CertificateMetadata { name?: string; } +/** Type of CertificateType */ export type CertificateType = "AKV_CERT_URI"; /** The load test configuration. */ @@ -186,7 +192,9 @@ export interface FileInfo { validationFailureDetails?: string; } +/** Type of FileType */ export type FileType = "JMX_FILE" | "USER_PROPERTIES" | "ADDITIONAL_ARTIFACTS"; +/** Type of FileStatus */ export type FileStatus = | "NOT_VALIDATED" | "VALIDATION_SUCCESS" @@ -298,6 +306,7 @@ export interface PagedTest { nextLink?: string; } +/** Type of APIVersions */ export type APIVersions = "2022-11-01"; /** Load test run model */ @@ -428,7 +437,9 @@ export interface TestRunOutputArtifacts { logsFileInfo?: FileInfo; } +/** Type of PFTestResult */ export type PFTestResult = "PASSED" | "NOT_APPLICABLE" | "FAILED"; +/** Type of Status */ export type Status = | "ACCEPTED" | "NOTSTARTED" @@ -487,6 +498,7 @@ export interface TestRunServerMetricConfig { readonly lastModifiedBy?: string; } +/** Type of Interval */ export type Interval = "PT5S" | "PT10S" | "PT1M" | "PT5M" | "PT1H"; export interface DimensionValueList { @@ -530,6 +542,7 @@ export interface NameAndDesc { name?: string; } +/** Type of AggregationType */ export type AggregationType = | "Average" | "Count" @@ -538,6 +551,7 @@ export type AggregationType = | "Percentile90" | "Percentile95" | "Percentile99"; +/** Type of MetricUnit */ export type MetricUnit = | "NotSpecified" | "Percent" @@ -557,6 +571,7 @@ export interface MetricAvailability { timeGrain?: TimeGrain; } +/** Type of TimeGrain */ export type TimeGrain = "PT5S" | "PT10S" | "PT1M" | "PT5M" | "PT1H"; /** Represents collection of metric namespaces. */ diff --git a/packages/typespec-test/test/loadtesting_modular/generated/typespec-ts/src/testRunOperations/models/models.ts b/packages/typespec-test/test/loadtesting_modular/generated/typespec-ts/src/testRunOperations/models/models.ts index 1e24def656..2bc96d7a75 100644 --- a/packages/typespec-test/test/loadtesting_modular/generated/typespec-ts/src/testRunOperations/models/models.ts +++ b/packages/typespec-test/test/loadtesting_modular/generated/typespec-ts/src/testRunOperations/models/models.ts @@ -77,12 +77,14 @@ export interface PassFailMetric { readonly result?: PFResult; } +/** Type of PFMetrics */ export type PFMetrics = | "response_time_ms" | "latency" | "error" | "requests" | "requests_per_sec"; +/** Type of PFAgFunc */ export type PFAgFunc = | "count" | "percentage" @@ -93,7 +95,9 @@ export type PFAgFunc = | "p99" | "min" | "max"; +/** Type of PFAction */ export type PFAction = "continue" | "stop"; +/** Type of PFResult */ export type PFResult = "passed" | "undetermined" | "failed"; /** Secret */ @@ -104,6 +108,7 @@ export interface Secret { type?: SecretType; } +/** Type of SecretType */ export type SecretType = "AKV_SECRET_URI" | "SECRET_VALUE"; /** Certificates metadata */ @@ -116,6 +121,7 @@ export interface CertificateMetadata { name?: string; } +/** Type of CertificateType */ export type CertificateType = "AKV_CERT_URI"; /** The load test configuration. */ @@ -186,7 +192,9 @@ export interface FileInfo { validationFailureDetails?: string; } +/** Type of FileType */ export type FileType = "JMX_FILE" | "USER_PROPERTIES" | "ADDITIONAL_ARTIFACTS"; +/** Type of FileStatus */ export type FileStatus = | "NOT_VALIDATED" | "VALIDATION_SUCCESS" @@ -298,6 +306,7 @@ export interface PagedTest { nextLink?: string; } +/** Type of APIVersions */ export type APIVersions = "2022-11-01"; /** Load test run model */ @@ -428,7 +437,9 @@ export interface TestRunOutputArtifacts { logsFileInfo?: FileInfo; } +/** Type of PFTestResult */ export type PFTestResult = "PASSED" | "NOT_APPLICABLE" | "FAILED"; +/** Type of Status */ export type Status = | "ACCEPTED" | "NOTSTARTED" @@ -487,6 +498,7 @@ export interface TestRunServerMetricConfig { readonly lastModifiedBy?: string; } +/** Type of Interval */ export type Interval = "PT5S" | "PT10S" | "PT1M" | "PT5M" | "PT1H"; export interface DimensionValueList { @@ -530,6 +542,7 @@ export interface NameAndDesc { name?: string; } +/** Type of AggregationType */ export type AggregationType = | "Average" | "Count" @@ -538,6 +551,7 @@ export type AggregationType = | "Percentile90" | "Percentile95" | "Percentile99"; +/** Type of MetricUnit */ export type MetricUnit = | "NotSpecified" | "Percent" @@ -557,6 +571,7 @@ export interface MetricAvailability { timeGrain?: TimeGrain; } +/** Type of TimeGrain */ export type TimeGrain = "PT5S" | "PT10S" | "PT1M" | "PT5M" | "PT1H"; /** Represents collection of metric namespaces. */ diff --git a/packages/typespec-test/test/openai/generated/openapi/2022-12-01/openapi.json b/packages/typespec-test/test/openai/generated/openapi/2022-12-01/openapi.json index a79f8f890b..c67f6b08c6 100644 --- a/packages/typespec-test/test/openai/generated/openapi/2022-12-01/openapi.json +++ b/packages/typespec-test/test/openai/generated/openapi/2022-12-01/openapi.json @@ -226,7 +226,7 @@ ], "x-ms-enum": { "name": "AzureOpenAIOperationState", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "notRunning", @@ -426,7 +426,7 @@ ], "x-ms-enum": { "name": "ChatRole", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "system", @@ -526,7 +526,7 @@ ], "x-ms-enum": { "name": "CompletionsFinishReason", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "stopped", diff --git a/packages/typespec-test/test/openai/generated/openapi/2023-05-15/openapi.json b/packages/typespec-test/test/openai/generated/openapi/2023-05-15/openapi.json index f95aaa766f..aa2e052bc7 100644 --- a/packages/typespec-test/test/openai/generated/openapi/2023-05-15/openapi.json +++ b/packages/typespec-test/test/openai/generated/openapi/2023-05-15/openapi.json @@ -272,7 +272,7 @@ ], "x-ms-enum": { "name": "AzureOpenAIOperationState", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "notRunning", @@ -472,7 +472,7 @@ ], "x-ms-enum": { "name": "ChatRole", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "system", @@ -572,7 +572,7 @@ ], "x-ms-enum": { "name": "CompletionsFinishReason", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "stopped", diff --git a/packages/typespec-test/test/openai/generated/openapi/2023-06-01-preview/openapi.json b/packages/typespec-test/test/openai/generated/openapi/2023-06-01-preview/openapi.json index c9cb979d37..bcb40001c9 100644 --- a/packages/typespec-test/test/openai/generated/openapi/2023-06-01-preview/openapi.json +++ b/packages/typespec-test/test/openai/generated/openapi/2023-06-01-preview/openapi.json @@ -357,7 +357,7 @@ ], "x-ms-enum": { "name": "AzureOpenAIOperationState", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "notRunning", @@ -608,7 +608,7 @@ ], "x-ms-enum": { "name": "ChatRole", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "system", @@ -722,7 +722,7 @@ ], "x-ms-enum": { "name": "CompletionsFinishReason", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "stopped", @@ -968,7 +968,7 @@ ], "x-ms-enum": { "name": "ContentFilterSeverity", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "safe", @@ -1123,7 +1123,7 @@ ], "x-ms-enum": { "name": "ImageSize", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "Size256x256", @@ -1166,7 +1166,7 @@ ], "x-ms-enum": { "name": "ImageGenerationResponseFormat", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "Url", @@ -1237,7 +1237,7 @@ ], "x-ms-enum": { "name": "ImageSize", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "Size256x256", diff --git a/packages/typespec-test/test/openai/generated/openapi/2023-07-01-preview/openapi.json b/packages/typespec-test/test/openai/generated/openapi/2023-07-01-preview/openapi.json index e5dd8a1dea..c25b46cf3c 100644 --- a/packages/typespec-test/test/openai/generated/openapi/2023-07-01-preview/openapi.json +++ b/packages/typespec-test/test/openai/generated/openapi/2023-07-01-preview/openapi.json @@ -357,7 +357,7 @@ ], "x-ms-enum": { "name": "AzureOpenAIOperationState", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "notRunning", @@ -630,7 +630,7 @@ ], "x-ms-enum": { "name": "ChatRole", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "system", @@ -750,7 +750,7 @@ ], "x-ms-enum": { "name": "CompletionsFinishReason", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "stopped", @@ -1001,7 +1001,7 @@ ], "x-ms-enum": { "name": "ContentFilterSeverity", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "safe", @@ -1158,7 +1158,7 @@ ], "x-ms-enum": { "name": "FunctionCallPreset", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "auto", @@ -1231,7 +1231,7 @@ ], "x-ms-enum": { "name": "ImageSize", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "Size256x256", @@ -1274,7 +1274,7 @@ ], "x-ms-enum": { "name": "ImageGenerationResponseFormat", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "Url", @@ -1345,7 +1345,7 @@ ], "x-ms-enum": { "name": "ImageSize", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "Size256x256", diff --git a/packages/typespec-test/test/openai/generated/openapi/2023-08-01-preview/openapi.json b/packages/typespec-test/test/openai/generated/openapi/2023-08-01-preview/openapi.json index 796b5d4241..279f438f02 100644 --- a/packages/typespec-test/test/openai/generated/openapi/2023-08-01-preview/openapi.json +++ b/packages/typespec-test/test/openai/generated/openapi/2023-08-01-preview/openapi.json @@ -416,7 +416,7 @@ ], "x-ms-enum": { "name": "AzureChatExtensionType", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "azureCognitiveSearch", @@ -550,7 +550,7 @@ ], "x-ms-enum": { "name": "AzureCognitiveSearchQueryType", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "simple", @@ -592,7 +592,7 @@ ], "x-ms-enum": { "name": "AzureOpenAIOperationState", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "notRunning", @@ -878,7 +878,7 @@ ], "x-ms-enum": { "name": "ChatRole", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "system", @@ -1003,7 +1003,7 @@ ], "x-ms-enum": { "name": "CompletionsFinishReason", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "stopped", @@ -1254,7 +1254,7 @@ ], "x-ms-enum": { "name": "ContentFilterSeverity", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "safe", @@ -1411,7 +1411,7 @@ ], "x-ms-enum": { "name": "FunctionCallPreset", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "auto", @@ -1484,7 +1484,7 @@ ], "x-ms-enum": { "name": "ImageSize", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "Size256x256", @@ -1527,7 +1527,7 @@ ], "x-ms-enum": { "name": "ImageGenerationResponseFormat", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "Url", @@ -1598,7 +1598,7 @@ ], "x-ms-enum": { "name": "ImageSize", - "modelAsString": true, + "modelAsString": false, "values": [ { "name": "Size256x256", diff --git a/packages/typespec-test/test/openai_generic/generated/typespec-ts/src/models/models.ts b/packages/typespec-test/test/openai_generic/generated/typespec-ts/src/models/models.ts index 5373dea72e..d0cc3f6894 100644 --- a/packages/typespec-test/test/openai_generic/generated/typespec-ts/src/models/models.ts +++ b/packages/typespec-test/test/openai_generic/generated/typespec-ts/src/models/models.ts @@ -410,7 +410,7 @@ export interface Embedding { object: "embedding"; /** * The embedding vector, which is a list of floats. The length of vector depends on the model as\ - * listed in the [embedding guide](/docs/guides/embeddings). + * * listed in the [embedding guide](/docs/guides/embeddings). */ embedding: number[]; } diff --git a/packages/typespec-test/test/openai_generic/generated/typespec-ts/src/rest/outputModels.ts b/packages/typespec-test/test/openai_generic/generated/typespec-ts/src/rest/outputModels.ts index 6c0b802d8d..c8dc6eb465 100644 --- a/packages/typespec-test/test/openai_generic/generated/typespec-ts/src/rest/outputModels.ts +++ b/packages/typespec-test/test/openai_generic/generated/typespec-ts/src/rest/outputModels.ts @@ -198,7 +198,7 @@ export interface EmbeddingOutput { object: "embedding"; /** * The embedding vector, which is a list of floats. The length of vector depends on the model as\ - * listed in the [embedding guide](/docs/guides/embeddings). + * * listed in the [embedding guide](/docs/guides/embeddings). */ embedding: number[]; } diff --git a/packages/typespec-test/test/openai_modular/generated/typespec-ts/review/openai_modular.api.md b/packages/typespec-test/test/openai_modular/generated/typespec-ts/review/openai_modular.api.md index c2de3981ca..5d6ca0dcc4 100644 --- a/packages/typespec-test/test/openai_modular/generated/typespec-ts/review/openai_modular.api.md +++ b/packages/typespec-test/test/openai_modular/generated/typespec-ts/review/openai_modular.api.md @@ -910,7 +910,7 @@ export interface PineconeFieldMappingOptions { urlField?: string; } -// @public (undocumented) +// @public export type ServiceApiVersions = "2022-12-01" | "2023-05-15" | "2023-06-01-preview" | "2023-07-01-preview" | "2024-02-15-preview"; // @public diff --git a/packages/typespec-test/test/openai_modular/generated/typespec-ts/src/models/models.ts b/packages/typespec-test/test/openai_modular/generated/typespec-ts/src/models/models.ts index ecbd4db006..7466b9597c 100644 --- a/packages/typespec-test/test/openai_modular/generated/typespec-ts/src/models/models.ts +++ b/packages/typespec-test/test/openai_modular/generated/typespec-ts/src/models/models.ts @@ -1721,6 +1721,7 @@ export interface EmbeddingsUsage { totalTokens: number; } +/** Type of ServiceApiVersions */ export type ServiceApiVersions = | "2022-12-01" | "2023-05-15" diff --git a/packages/typespec-test/test/openai_modular/generated/typespec-ts/src/rest/responses.ts b/packages/typespec-test/test/openai_modular/generated/typespec-ts/src/rest/responses.ts index 09b82e50bc..dd28894766 100644 --- a/packages/typespec-test/test/openai_modular/generated/typespec-ts/src/rest/responses.ts +++ b/packages/typespec-test/test/openai_modular/generated/typespec-ts/src/rest/responses.ts @@ -12,11 +12,17 @@ import { EmbeddingsOutput, } from "./outputModels.js"; +export interface GetAudioTranscriptionAsPlainText200Headers { + /** The content type 'text/plain' for the audio text response. */ + "content-type": "text/plain"; +} + /** The request has succeeded. */ export interface GetAudioTranscriptionAsPlainText200Response extends HttpResponse { status: "200"; body: string; + headers: RawHttpHeaders & GetAudioTranscriptionAsPlainText200Headers; } export interface GetAudioTranscriptionAsPlainTextDefaultHeaders { @@ -50,11 +56,17 @@ export interface GetAudioTranscriptionAsResponseObjectDefaultResponse headers: RawHttpHeaders & GetAudioTranscriptionAsResponseObjectDefaultHeaders; } +export interface GetAudioTranslationAsPlainText200Headers { + /** The content type 'text/plain' for the audio text response. */ + "content-type": "text/plain"; +} + /** The request has succeeded. */ export interface GetAudioTranslationAsPlainText200Response extends HttpResponse { status: "200"; body: string; + headers: RawHttpHeaders & GetAudioTranslationAsPlainText200Headers; } export interface GetAudioTranslationAsPlainTextDefaultHeaders { @@ -139,11 +151,17 @@ export interface GetImageGenerationsDefaultResponse extends HttpResponse { headers: RawHttpHeaders & GetImageGenerationsDefaultHeaders; } +export interface GetAudioSpeech200Headers { + /** The content type of the response. Always application/octet-stream for audio/speech responses. */ + "content-type": "application/octet-stream"; +} + /** The request has succeeded. */ export interface GetAudioSpeech200Response extends HttpResponse { status: "200"; /** Value may contain any sequence of octets */ body: Uint8Array; + headers: RawHttpHeaders & GetAudioSpeech200Headers; } export interface GetAudioSpeechDefaultHeaders { diff --git a/packages/typespec-test/test/openai_non_branded/generated/typespec-ts/src/models/models.ts b/packages/typespec-test/test/openai_non_branded/generated/typespec-ts/src/models/models.ts index fb6cce2da7..1c9f5c7d14 100644 --- a/packages/typespec-test/test/openai_non_branded/generated/typespec-ts/src/models/models.ts +++ b/packages/typespec-test/test/openai_non_branded/generated/typespec-ts/src/models/models.ts @@ -409,7 +409,7 @@ export interface Embedding { object: "embedding"; /** * The embedding vector, which is a list of floats. The length of vector depends on the model as\ - * listed in the [embedding guide](/docs/guides/embeddings). + * * listed in the [embedding guide](/docs/guides/embeddings). */ embedding: number[]; } diff --git a/packages/typespec-test/test/openai_non_branded/generated/typespec-ts/src/rest/outputModels.ts b/packages/typespec-test/test/openai_non_branded/generated/typespec-ts/src/rest/outputModels.ts index 7c37da0b82..e4ed9656dc 100644 --- a/packages/typespec-test/test/openai_non_branded/generated/typespec-ts/src/rest/outputModels.ts +++ b/packages/typespec-test/test/openai_non_branded/generated/typespec-ts/src/rest/outputModels.ts @@ -197,7 +197,7 @@ export interface EmbeddingOutput { object: "embedding"; /** * The embedding vector, which is a list of floats. The length of vector depends on the model as\ - * listed in the [embedding guide](/docs/guides/embeddings). + * * listed in the [embedding guide](/docs/guides/embeddings). */ embedding: number[]; } diff --git a/packages/typespec-ts/package.json b/packages/typespec-ts/package.json index e4f31a3d5e..585a6fb95b 100644 --- a/packages/typespec-ts/package.json +++ b/packages/typespec-ts/package.json @@ -66,10 +66,10 @@ "@azure-tools/cadl-ranch-expect": "^0.13.4", "@azure-tools/cadl-ranch-specs": "^0.33.4", "@azure-tools/cadl-ranch": "^0.12.8", - "@azure-tools/typespec-autorest": ">=0.42.1 <1.0.0", - "@azure-tools/typespec-azure-core": ">=0.42.0 <1.0.0", - "@azure-tools/typespec-azure-resource-manager": ">=0.42.1 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.42.2 <1.0.0", + "@azure-tools/typespec-autorest": ">=0.43.0 <1.0.0", + "@azure-tools/typespec-azure-core": ">=0.43.0 <1.0.0", + "@azure-tools/typespec-azure-resource-manager": ">=0.43.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.43.0 <1.0.0", "@azure/abort-controller": "^2.1.2", "@azure/core-auth": "^1.6.0", "@azure/core-lro": "3.0.0-beta.2", @@ -84,12 +84,12 @@ "@types/node": "^18.0.0", "@typescript-eslint/eslint-plugin": "^6.8.0", "@typescript-eslint/parser": "^6.8.0", - "@typespec/compiler": ">=0.56.0 <1.0.0", - "@typespec/http": ">=0.56.0 <1.0.0", - "@typespec/openapi": ">=0.56.0, <1.0.0", - "@typespec/rest": ">=0.56.0 <1.0.0", + "@typespec/compiler": ">=0.57.0 <1.0.0", + "@typespec/http": ">=0.57.0 <1.0.0", + "@typespec/openapi": ">=0.57.0, <1.0.0", + "@typespec/rest": ">=0.57.0 <1.0.0", "@typespec/ts-http-runtime": "1.0.0-alpha.20240314.2", - "@typespec/versioning": ">=0.56.0 <1.0.0", + "@typespec/versioning": ">=0.57.0 <1.0.0", "chai": "^4.3.6", "chalk": "^4.0.0", "cross-env": "^7.0.3", @@ -107,12 +107,12 @@ "@vitest/coverage-istanbul": "~1.6.0" }, "peerDependencies": { - "@azure-tools/typespec-azure-core": ">=0.42.0 <1.0.0", - "@azure-tools/typespec-client-generator-core": ">=0.42.2 <1.0.0", - "@typespec/compiler": ">=0.56.0 <1.0.0", - "@typespec/http": ">=0.56.0 <1.0.0", - "@typespec/rest": ">=0.56.0 <1.0.0", - "@typespec/versioning": ">=0.56.0 <1.0.0" + "@azure-tools/typespec-azure-core": ">=0.43.0 <1.0.0", + "@azure-tools/typespec-client-generator-core": ">=0.43.0 <1.0.0", + "@typespec/compiler": ">=0.57.0 <1.0.0", + "@typespec/http": ">=0.57.0 <1.0.0", + "@typespec/rest": ">=0.57.0 <1.0.0", + "@typespec/versioning": ">=0.57.0 <1.0.0" }, "dependencies": { "@azure-tools/rlc-common": "workspace:^0.29.0", diff --git a/packages/typespec-ts/src/modular/buildCodeModel.ts b/packages/typespec-ts/src/modular/buildCodeModel.ts index b5a7f5bb77..0030720a1b 100644 --- a/packages/typespec-ts/src/modular/buildCodeModel.ts +++ b/packages/typespec-ts/src/modular/buildCodeModel.ts @@ -52,6 +52,7 @@ import { isNumericType, isStringType, isTemplateDeclarationOrInstance, + isType, isVoidType, listServices, Model, @@ -447,26 +448,33 @@ type BodyParameter = ParamBase & { function emitBodyParameter( context: SdkContext, httpOperation: HttpOperation -): BodyParameter { +): BodyParameter | undefined { const params = httpOperation.parameters; const body = params.body!; - const base = emitParamBase(context, body.parameter ?? body.type); - let contentTypes = body.contentTypes; - if (contentTypes.length === 0) { - contentTypes = ["application/json"]; - } - const type = getType(context, getBodyType(context.program, httpOperation)!, { - disableEffectiveModel: true, - usage: UsageFlags.Input - }); + if (body.bodyKind === "single") { + const base = emitParamBase(context, body.parameter ?? body.type); + let contentTypes = body.contentTypes; + if (contentTypes.length === 0) { + contentTypes = ["application/json"]; + } + const type = getType( + context, + getBodyType(context.program, httpOperation)!, + { + disableEffectiveModel: true, + usage: UsageFlags.Input + } + ); - return { - contentTypes, - type, - location: "body", - ...base, - isBinaryPayload: isBinaryPayload(context, body.type, contentTypes) - }; + return { + contentTypes, + type, + location: "body", + ...base, + isBinaryPayload: isBinaryPayload(context, body.type, contentTypes) + }; + } + return undefined; } function emitParameter( @@ -950,7 +958,7 @@ function getName(program: Program, type: Model): string { ) { return ( type.name + - type.templateMapper.args + (type.templateMapper.args.filter((it) => isType(it)) as Type[]) .map((it) => (it.kind === "Model" ? it.name : "")) .join("") ); @@ -1000,7 +1008,7 @@ function emitModel( getPagedResult(context.program, type) ) { modelName = - type.templateMapper.args + (type.templateMapper.args.filter((it) => isType(it)) as Type[]) .map((it) => { switch (it.kind) { case "Model": @@ -1053,13 +1061,17 @@ function emitEnum(context: SdkContext, type: Enum): Record { }); } + const name = normalizeName( + getLibraryName(context, type) ? getLibraryName(context, type) : type.name, + NameType.Interface + ); return { type: "enum", - name: normalizeName( - getLibraryName(context, type) ? getLibraryName(context, type) : type.name, - NameType.Interface - ), - description: getDocStr(program, type), + name, + description: + getDocStr(program, type) === "" + ? `Type of ${name}` + : getDocStr(program, type), valueType: { type: enumMemberType(type.members.values().next().value) }, values: enumValues, isFixed: true, @@ -1329,7 +1341,11 @@ function emitUnion( type: Union, usage: UsageFlags ): Record { - const sdkType = getSdkUnion(context, type); + let sdkType = getSdkUnion(context, type); + const isNull = sdkType.kind === "nullable"; + if (sdkType.kind === "nullable") { + sdkType = sdkType.type; + } const nonNullOptions = getNonNullOptions(type); if (sdkType === undefined) { throw Error("Should not have an empty union"); @@ -1353,7 +1369,7 @@ function emitUnion( ? normalizeName(unionName, NameType.Interface) : undefined; return { - nullable: sdkType.nullable, + nullable: isNull, name: unionTypeName, description: `Type of ${unionTypeName}`, internal: true, @@ -1381,7 +1397,7 @@ function emitUnion( : undefined; return { name: typeName, - nullable: sdkType.nullable, + nullable: isNull, description: sdkType.description || `Type of ${typeName}`, internal: true, type: sdkType.kind, @@ -1395,12 +1411,12 @@ function emitUnion( } else if (nonNullOptions.length === 1 && nonNullOptions[0]) { return { ...emitType(context, nonNullOptions[0], usage), - nullable: sdkType.nullable + nullable: isNull }; } else { return { ...emitType(context, sdkType.__raw!, usage), - nullable: sdkType.nullable + nullable: isNull }; } } @@ -1437,7 +1453,7 @@ function emitSimpleType( } return { - nullable: sdkType.nullable, + nullable: isNullType(sdkType.__raw!), type: sdkType.kind === "string" ? "string" : "number", // TODO: handle other types doc: "", apiVersions: [], diff --git a/packages/typespec-ts/src/modular/serialization/serializers.ts b/packages/typespec-ts/src/modular/serialization/serializers.ts index 1d6bebbdba..93281a94a9 100644 --- a/packages/typespec-ts/src/modular/serialization/serializers.ts +++ b/packages/typespec-ts/src/modular/serialization/serializers.ts @@ -98,7 +98,8 @@ function getSerializeHandler( | "uint8" | "uri" | "url" - | "uuid"; + | "uuid" + | "nullable"; type SerializeHandler< TCGCTypeKind extends (SdkType | SdkModelPropertyType)["kind"] @@ -292,14 +293,12 @@ function getPropertyDeclaration( function getPropertyInitializer( options: SerializeTypeOptions ): string { - const { type, valueExpr } = options; + const { type } = options; const propSerializer = serializeType({ ...options, type: { ...type.type, nullable: false, optional: false } }); - return type.nullable - ? `((${valueExpr}) === null) ? (${valueExpr}) : (${propSerializer})` - : propSerializer; + return propSerializer; } diff --git a/packages/typespec-ts/src/modular/serialization/util.ts b/packages/typespec-ts/src/modular/serialization/util.ts index 53d72f3202..44436f5b5a 100644 --- a/packages/typespec-ts/src/modular/serialization/util.ts +++ b/packages/typespec-ts/src/modular/serialization/util.ts @@ -98,13 +98,14 @@ const dispatch: { if (!keyId || !valueId) { return; } - const valueType = type.nullableValues ? `${valueId} | null` : valueId; + const valueType = valueId; return `Record<${keyId}, ${valueType}>`; }, enumvalue: (_) => "FIXME", constant: (_) => "FIXME", credential: (_) => "FIXME", - endpoint: (_) => "string" + endpoint: (_) => "string", + nullable: (_) => "null" }; export function getModularTypeId( diff --git a/packages/typespec-ts/src/transform/transformResponses.ts b/packages/typespec-ts/src/transform/transformResponses.ts index ab03e56186..5b1eae8c97 100644 --- a/packages/typespec-ts/src/transform/transformResponses.ts +++ b/packages/typespec-ts/src/transform/transformResponses.ts @@ -129,7 +129,10 @@ function transformHeaders( // It may be possible in principle to not error for identically declared // headers. for (const data of response.responses) { - const headers = data?.headers; + const headers = data?.headers ?? {}; + if (data.body?.contentTypeProperty) { + headers["content-type"] = data.body?.contentTypeProperty; + } if (!headers || !Object.keys(headers).length) { continue; } diff --git a/packages/typespec-ts/src/transform/transformSchemas.ts b/packages/typespec-ts/src/transform/transformSchemas.ts index d5f742ddac..fa1bd5bb7a 100644 --- a/packages/typespec-ts/src/transform/transformSchemas.ts +++ b/packages/typespec-ts/src/transform/transformSchemas.ts @@ -87,6 +87,12 @@ export function transformSchemas(client: SdkClient, dpgContext: SdkContext) { getGeneratedModels(value, SchemaContext.Output); } } + if (resps.body?.contentTypeProperty) { + getGeneratedModels( + resps.body.contentTypeProperty, + SchemaContext.Output + ); + } const respModel = resps?.body?.type; if (!respModel) { continue; diff --git a/packages/typespec-ts/src/utils/modelUtils.ts b/packages/typespec-ts/src/utils/modelUtils.ts index cae55260b2..c2270f917e 100644 --- a/packages/typespec-ts/src/utils/modelUtils.ts +++ b/packages/typespec-ts/src/utils/modelUtils.ts @@ -61,7 +61,8 @@ import { StringLiteral, Type, Union, - UnionVariant + UnionVariant, + isType } from "@typespec/compiler"; import { createMetadataInfo, @@ -610,9 +611,12 @@ function getSchemaForModel( model.templateMapper.args.length > 0 && getPagedResult(program, model) ) { + const templateTypes = model.templateMapper.args.filter((it) => + isType(it) + ) as Type[]; name = - model.templateMapper.args - .map((it) => { + templateTypes + .map((it: Type) => { switch (it.kind) { case "Model": return it.name; @@ -661,7 +665,10 @@ function getSchemaForModel( if (paged && paged.itemsProperty) { const items = paged.itemsProperty as unknown as Model; if (items && items.templateMapper && items.templateMapper.args) { - const templateName = items.templateMapper.args + const templateTypes = items.templateMapper.args.filter((it) => + isType(it) + ) as Type[]; + const templateName = templateTypes ?.map((it) => { switch (it.kind) { case "Model": diff --git a/packages/typespec-ts/test/integration/generated/azure/core/lro/rpc/src/outputModels.ts b/packages/typespec-ts/test/integration/generated/azure/core/lro/rpc/src/outputModels.ts index 4062cec654..4b8c2d2b7c 100644 --- a/packages/typespec-ts/test/integration/generated/azure/core/lro/rpc/src/outputModels.ts +++ b/packages/typespec-ts/test/integration/generated/azure/core/lro/rpc/src/outputModels.ts @@ -21,10 +21,5 @@ export interface GenerationResultOutput { data: string; } -/** Enum describing allowed operation states. */ -export type OperationStateOutput = - | "NotStarted" - | "Running" - | "Succeeded" - | "Failed" - | "Canceled"; +/** Alias for OperationStateOutput */ +export type OperationStateOutput = string; diff --git a/packages/typespec-ts/test/integration/generated/azure/core/lro/standard/src/outputModels.ts b/packages/typespec-ts/test/integration/generated/azure/core/lro/standard/src/outputModels.ts index 59ed42a7db..18aa2adfa7 100644 --- a/packages/typespec-ts/test/integration/generated/azure/core/lro/standard/src/outputModels.ts +++ b/packages/typespec-ts/test/integration/generated/azure/core/lro/standard/src/outputModels.ts @@ -41,10 +41,5 @@ export interface ExportedUserOutput { resourceUri: string; } -/** Enum describing allowed operation states. */ -export type OperationStateOutput = - | "NotStarted" - | "Running" - | "Succeeded" - | "Failed" - | "Canceled"; +/** Alias for OperationStateOutput */ +export type OperationStateOutput = string; diff --git a/packages/typespec-ts/test/integration/generated/encode/bytes/src/responses.ts b/packages/typespec-ts/test/integration/generated/encode/bytes/src/responses.ts index b052fa149b..327a7738e2 100644 --- a/packages/typespec-ts/test/integration/generated/encode/bytes/src/responses.ts +++ b/packages/typespec-ts/test/integration/generated/encode/bytes/src/responses.ts @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +import { RawHttpHeaders } from "@azure/core-rest-pipeline"; import { HttpResponse } from "@azure-rest/core-client"; import { DefaultBytesPropertyOutput, @@ -104,11 +105,20 @@ export interface ResponseBodyDefault200Response extends HttpResponse { body: string; } +export interface ResponseBodyOctetStream200Headers { + "content-type": "application/octet-stream"; +} + /** The request has succeeded. */ export interface ResponseBodyOctetStream200Response extends HttpResponse { status: "200"; /** Value may contain any sequence of octets */ body: Uint8Array; + headers: RawHttpHeaders & ResponseBodyOctetStream200Headers; +} + +export interface ResponseBodyCustomContentType200Headers { + "content-type": "image/png"; } /** The request has succeeded. */ @@ -116,6 +126,7 @@ export interface ResponseBodyCustomContentType200Response extends HttpResponse { status: "200"; /** Value may contain any sequence of octets */ body: Uint8Array; + headers: RawHttpHeaders & ResponseBodyCustomContentType200Headers; } /** The request has succeeded. */ diff --git a/packages/typespec-ts/test/integration/generated/payload/content-negotiation/src/responses.ts b/packages/typespec-ts/test/integration/generated/payload/content-negotiation/src/responses.ts index 895cf07641..dea2868f2d 100644 --- a/packages/typespec-ts/test/integration/generated/payload/content-negotiation/src/responses.ts +++ b/packages/typespec-ts/test/integration/generated/payload/content-negotiation/src/responses.ts @@ -1,14 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +import { RawHttpHeaders } from "@azure/core-rest-pipeline"; import { HttpResponse } from "@azure-rest/core-client"; import { PngImageAsJsonOutput } from "./outputModels.js"; +export interface SameBodyGetAvatarAsPng200Headers { + "content-type": "image/png"; +} + /** The request has succeeded. */ export interface SameBodyGetAvatarAsPng200Response extends HttpResponse { status: "200"; /** Value may contain any sequence of octets */ body: Uint8Array; + headers: RawHttpHeaders & SameBodyGetAvatarAsPng200Headers; +} + +export interface SameBodyGetAvatarAsJpeg200Headers { + "content-type": "image/jpeg"; } /** The request has succeeded. */ @@ -16,6 +26,11 @@ export interface SameBodyGetAvatarAsJpeg200Response extends HttpResponse { status: "200"; /** Value may contain any sequence of octets */ body: Uint8Array; + headers: RawHttpHeaders & SameBodyGetAvatarAsJpeg200Headers; +} + +export interface DifferentBodyGetAvatarAsPng200Headers { + "content-type": "image/png"; } /** The request has succeeded. */ @@ -23,10 +38,16 @@ export interface DifferentBodyGetAvatarAsPng200Response extends HttpResponse { status: "200"; /** Value may contain any sequence of octets */ body: Uint8Array; + headers: RawHttpHeaders & DifferentBodyGetAvatarAsPng200Headers; +} + +export interface DifferentBodyGetAvatarAsJson200Headers { + "content-type": "application/json"; } /** The request has succeeded. */ export interface DifferentBodyGetAvatarAsJson200Response extends HttpResponse { status: "200"; body: PngImageAsJsonOutput; + headers: RawHttpHeaders & DifferentBodyGetAvatarAsJson200Headers; } diff --git a/packages/typespec-ts/test/integration/generated/payload/media-type/src/responses.ts b/packages/typespec-ts/test/integration/generated/payload/media-type/src/responses.ts index 3d847d1160..64eeb75b9e 100644 --- a/packages/typespec-ts/test/integration/generated/payload/media-type/src/responses.ts +++ b/packages/typespec-ts/test/integration/generated/payload/media-type/src/responses.ts @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +import { RawHttpHeaders } from "@azure/core-rest-pipeline"; import { HttpResponse } from "@azure-rest/core-client"; /** The request has succeeded. */ @@ -8,10 +9,15 @@ export interface StringBodySendAsText200Response extends HttpResponse { status: "200"; } +export interface StringBodyGetAsText200Headers { + "content-type": "text/plain"; +} + /** The request has succeeded. */ export interface StringBodyGetAsText200Response extends HttpResponse { status: "200"; body: string; + headers: RawHttpHeaders & StringBodyGetAsText200Headers; } /** The request has succeeded. */ @@ -19,8 +25,13 @@ export interface StringBodySendAsJson200Response extends HttpResponse { status: "200"; } +export interface StringBodyGetAsJson200Headers { + "content-type": "application/json"; +} + /** The request has succeeded. */ export interface StringBodyGetAsJson200Response extends HttpResponse { status: "200"; body: string; + headers: RawHttpHeaders & StringBodyGetAsJson200Headers; } diff --git a/packages/typespec-ts/test/modularIntegration/generated/azure/core/lro/rpc/generated/src/index.ts b/packages/typespec-ts/test/modularIntegration/generated/azure/core/lro/rpc/generated/src/index.ts index dcffd62531..26fcd945a9 100644 --- a/packages/typespec-ts/test/modularIntegration/generated/azure/core/lro/rpc/generated/src/index.ts +++ b/packages/typespec-ts/test/modularIntegration/generated/azure/core/lro/rpc/generated/src/index.ts @@ -5,7 +5,6 @@ export { RpcClient, RpcClientOptions } from "./rpcClient.js"; export { restorePoller, RestorePollerOptions } from "./restorePollerHelpers.js"; export { GenerationOptions, - GenerationResponse, GenerationResult, Versions, LongRunningRpcOptionalParams, diff --git a/packages/typespec-ts/test/modularIntegration/generated/azure/core/lro/rpc/generated/src/models/index.ts b/packages/typespec-ts/test/modularIntegration/generated/azure/core/lro/rpc/generated/src/models/index.ts index 879a8cf6ba..ef8b61aba3 100644 --- a/packages/typespec-ts/test/modularIntegration/generated/azure/core/lro/rpc/generated/src/models/index.ts +++ b/packages/typespec-ts/test/modularIntegration/generated/azure/core/lro/rpc/generated/src/models/index.ts @@ -1,10 +1,5 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -export { - GenerationOptions, - GenerationResponse, - GenerationResult, - Versions, -} from "./models.js"; +export { GenerationOptions, GenerationResult, Versions } from "./models.js"; export { LongRunningRpcOptionalParams } from "./options.js"; diff --git a/packages/typespec-ts/test/modularIntegration/generated/azure/core/lro/rpc/generated/src/models/models.ts b/packages/typespec-ts/test/modularIntegration/generated/azure/core/lro/rpc/generated/src/models/models.ts index 0ec623dfa6..e5b6903180 100644 --- a/packages/typespec-ts/test/modularIntegration/generated/azure/core/lro/rpc/generated/src/models/models.ts +++ b/packages/typespec-ts/test/modularIntegration/generated/azure/core/lro/rpc/generated/src/models/models.ts @@ -1,27 +1,12 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. -import { ErrorModel } from "@azure-rest/core-client"; -import { OperationStatus as CoreOperationStatus } from "@azure/core-lro"; - /** Options for the generation. */ export interface GenerationOptions { /** Prompt. */ prompt: string; } -/** Provides status details for long running operations. */ -export interface GenerationResponse { - /** The unique ID of the operation. */ - readonly id: string; - /** The status of the operation */ - status: CoreOperationStatus; - /** Error object that describes the error when status is "Failed". */ - error?: ErrorModel; - /** The result of the operation. */ - result?: GenerationResult; -} - /** Result of the generation. */ export interface GenerationResult { /** The data. */ diff --git a/packages/typespec-ts/test/modularIntegration/generated/azure/core/lro/rpc/generated/src/rest/outputModels.ts b/packages/typespec-ts/test/modularIntegration/generated/azure/core/lro/rpc/generated/src/rest/outputModels.ts index 4062cec654..4b8c2d2b7c 100644 --- a/packages/typespec-ts/test/modularIntegration/generated/azure/core/lro/rpc/generated/src/rest/outputModels.ts +++ b/packages/typespec-ts/test/modularIntegration/generated/azure/core/lro/rpc/generated/src/rest/outputModels.ts @@ -21,10 +21,5 @@ export interface GenerationResultOutput { data: string; } -/** Enum describing allowed operation states. */ -export type OperationStateOutput = - | "NotStarted" - | "Running" - | "Succeeded" - | "Failed" - | "Canceled"; +/** Alias for OperationStateOutput */ +export type OperationStateOutput = string; diff --git a/packages/typespec-ts/test/modularIntegration/generated/azure/core/lro/standard/generated/src/rest/outputModels.ts b/packages/typespec-ts/test/modularIntegration/generated/azure/core/lro/standard/generated/src/rest/outputModels.ts index 59ed42a7db..18aa2adfa7 100644 --- a/packages/typespec-ts/test/modularIntegration/generated/azure/core/lro/standard/generated/src/rest/outputModels.ts +++ b/packages/typespec-ts/test/modularIntegration/generated/azure/core/lro/standard/generated/src/rest/outputModels.ts @@ -41,10 +41,5 @@ export interface ExportedUserOutput { resourceUri: string; } -/** Enum describing allowed operation states. */ -export type OperationStateOutput = - | "NotStarted" - | "Running" - | "Succeeded" - | "Failed" - | "Canceled"; +/** Alias for OperationStateOutput */ +export type OperationStateOutput = string; diff --git a/packages/typespec-ts/test/modularIntegration/generated/client/structure/default/src/models/models.ts b/packages/typespec-ts/test/modularIntegration/generated/client/structure/default/src/models/models.ts index a886b317d0..5894345bb0 100644 --- a/packages/typespec-ts/test/modularIntegration/generated/client/structure/default/src/models/models.ts +++ b/packages/typespec-ts/test/modularIntegration/generated/client/structure/default/src/models/models.ts @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +/** Type of ClientType */ export type ClientType = | "default" | "multi-client" diff --git a/packages/typespec-ts/test/modularIntegration/generated/client/structure/multi-client/src/a/models/models.ts b/packages/typespec-ts/test/modularIntegration/generated/client/structure/multi-client/src/a/models/models.ts index a886b317d0..5894345bb0 100644 --- a/packages/typespec-ts/test/modularIntegration/generated/client/structure/multi-client/src/a/models/models.ts +++ b/packages/typespec-ts/test/modularIntegration/generated/client/structure/multi-client/src/a/models/models.ts @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +/** Type of ClientType */ export type ClientType = | "default" | "multi-client" diff --git a/packages/typespec-ts/test/modularIntegration/generated/client/structure/multi-client/src/b/models/models.ts b/packages/typespec-ts/test/modularIntegration/generated/client/structure/multi-client/src/b/models/models.ts index a886b317d0..5894345bb0 100644 --- a/packages/typespec-ts/test/modularIntegration/generated/client/structure/multi-client/src/b/models/models.ts +++ b/packages/typespec-ts/test/modularIntegration/generated/client/structure/multi-client/src/b/models/models.ts @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +/** Type of ClientType */ export type ClientType = | "default" | "multi-client" diff --git a/packages/typespec-ts/test/modularIntegration/generated/client/structure/renamed-operation/src/models/models.ts b/packages/typespec-ts/test/modularIntegration/generated/client/structure/renamed-operation/src/models/models.ts index a886b317d0..5894345bb0 100644 --- a/packages/typespec-ts/test/modularIntegration/generated/client/structure/renamed-operation/src/models/models.ts +++ b/packages/typespec-ts/test/modularIntegration/generated/client/structure/renamed-operation/src/models/models.ts @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +/** Type of ClientType */ export type ClientType = | "default" | "multi-client" diff --git a/packages/typespec-ts/test/modularIntegration/generated/client/structure/two-operation-group/src/models/models.ts b/packages/typespec-ts/test/modularIntegration/generated/client/structure/two-operation-group/src/models/models.ts index a886b317d0..5894345bb0 100644 --- a/packages/typespec-ts/test/modularIntegration/generated/client/structure/two-operation-group/src/models/models.ts +++ b/packages/typespec-ts/test/modularIntegration/generated/client/structure/two-operation-group/src/models/models.ts @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +/** Type of ClientType */ export type ClientType = | "default" | "multi-client" diff --git a/packages/typespec-ts/test/modularIntegration/generated/encode/bytes/src/rest/responses.ts b/packages/typespec-ts/test/modularIntegration/generated/encode/bytes/src/rest/responses.ts index b052fa149b..327a7738e2 100644 --- a/packages/typespec-ts/test/modularIntegration/generated/encode/bytes/src/rest/responses.ts +++ b/packages/typespec-ts/test/modularIntegration/generated/encode/bytes/src/rest/responses.ts @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +import { RawHttpHeaders } from "@azure/core-rest-pipeline"; import { HttpResponse } from "@azure-rest/core-client"; import { DefaultBytesPropertyOutput, @@ -104,11 +105,20 @@ export interface ResponseBodyDefault200Response extends HttpResponse { body: string; } +export interface ResponseBodyOctetStream200Headers { + "content-type": "application/octet-stream"; +} + /** The request has succeeded. */ export interface ResponseBodyOctetStream200Response extends HttpResponse { status: "200"; /** Value may contain any sequence of octets */ body: Uint8Array; + headers: RawHttpHeaders & ResponseBodyOctetStream200Headers; +} + +export interface ResponseBodyCustomContentType200Headers { + "content-type": "image/png"; } /** The request has succeeded. */ @@ -116,6 +126,7 @@ export interface ResponseBodyCustomContentType200Response extends HttpResponse { status: "200"; /** Value may contain any sequence of octets */ body: Uint8Array; + headers: RawHttpHeaders & ResponseBodyCustomContentType200Headers; } /** The request has succeeded. */ diff --git a/packages/typespec-ts/test/modularIntegration/generated/payload/content-negotiation/src/rest/responses.ts b/packages/typespec-ts/test/modularIntegration/generated/payload/content-negotiation/src/rest/responses.ts index 895cf07641..dea2868f2d 100644 --- a/packages/typespec-ts/test/modularIntegration/generated/payload/content-negotiation/src/rest/responses.ts +++ b/packages/typespec-ts/test/modularIntegration/generated/payload/content-negotiation/src/rest/responses.ts @@ -1,14 +1,24 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +import { RawHttpHeaders } from "@azure/core-rest-pipeline"; import { HttpResponse } from "@azure-rest/core-client"; import { PngImageAsJsonOutput } from "./outputModels.js"; +export interface SameBodyGetAvatarAsPng200Headers { + "content-type": "image/png"; +} + /** The request has succeeded. */ export interface SameBodyGetAvatarAsPng200Response extends HttpResponse { status: "200"; /** Value may contain any sequence of octets */ body: Uint8Array; + headers: RawHttpHeaders & SameBodyGetAvatarAsPng200Headers; +} + +export interface SameBodyGetAvatarAsJpeg200Headers { + "content-type": "image/jpeg"; } /** The request has succeeded. */ @@ -16,6 +26,11 @@ export interface SameBodyGetAvatarAsJpeg200Response extends HttpResponse { status: "200"; /** Value may contain any sequence of octets */ body: Uint8Array; + headers: RawHttpHeaders & SameBodyGetAvatarAsJpeg200Headers; +} + +export interface DifferentBodyGetAvatarAsPng200Headers { + "content-type": "image/png"; } /** The request has succeeded. */ @@ -23,10 +38,16 @@ export interface DifferentBodyGetAvatarAsPng200Response extends HttpResponse { status: "200"; /** Value may contain any sequence of octets */ body: Uint8Array; + headers: RawHttpHeaders & DifferentBodyGetAvatarAsPng200Headers; +} + +export interface DifferentBodyGetAvatarAsJson200Headers { + "content-type": "application/json"; } /** The request has succeeded. */ export interface DifferentBodyGetAvatarAsJson200Response extends HttpResponse { status: "200"; body: PngImageAsJsonOutput; + headers: RawHttpHeaders & DifferentBodyGetAvatarAsJson200Headers; } diff --git a/packages/typespec-ts/test/modularIntegration/generated/payload/media-type/src/rest/responses.ts b/packages/typespec-ts/test/modularIntegration/generated/payload/media-type/src/rest/responses.ts index 4adf334d07..28669ae659 100644 --- a/packages/typespec-ts/test/modularIntegration/generated/payload/media-type/src/rest/responses.ts +++ b/packages/typespec-ts/test/modularIntegration/generated/payload/media-type/src/rest/responses.ts @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. +import { RawHttpHeaders } from "@azure/core-rest-pipeline"; import { HttpResponse } from "@azure-rest/core-client"; /** The request has succeeded. */ @@ -8,10 +9,15 @@ export interface SendAsText200Response extends HttpResponse { status: "200"; } +export interface GetAsText200Headers { + "content-type": "text/plain"; +} + /** The request has succeeded. */ export interface GetAsText200Response extends HttpResponse { status: "200"; body: string; + headers: RawHttpHeaders & GetAsText200Headers; } /** The request has succeeded. */ @@ -19,8 +25,13 @@ export interface SendAsJson200Response extends HttpResponse { status: "200"; } +export interface GetAsJson200Headers { + "content-type": "application/json"; +} + /** The request has succeeded. */ export interface GetAsJson200Response extends HttpResponse { status: "200"; body: string; + headers: RawHttpHeaders & GetAsJson200Headers; } diff --git a/packages/typespec-ts/test/modularIntegration/generated/type/union/src/models/models.ts b/packages/typespec-ts/test/modularIntegration/generated/type/union/src/models/models.ts index deb92b3cf2..8cdcdac042 100644 --- a/packages/typespec-ts/test/modularIntegration/generated/type/union/src/models/models.ts +++ b/packages/typespec-ts/test/modularIntegration/generated/type/union/src/models/models.ts @@ -43,7 +43,9 @@ export interface EnumsOnlyCases { ud: Ud | Ud; } +/** Type of Lr */ export type Lr = "left" | "right"; +/** Type of Ud */ export type Ud = "up" | "down"; export interface Dog { diff --git a/packages/typespec-ts/test/modularIntegration/generated/versioning/added/src/models/models.ts b/packages/typespec-ts/test/modularIntegration/generated/versioning/added/src/models/models.ts index 760dccc54f..212a680f62 100644 --- a/packages/typespec-ts/test/modularIntegration/generated/versioning/added/src/models/models.ts +++ b/packages/typespec-ts/test/modularIntegration/generated/versioning/added/src/models/models.ts @@ -7,6 +7,7 @@ export interface ModelV1 { unionProp: UnionV1; } +/** Type of EnumV1 */ export type EnumV1 = "enumMemberV1" | "enumMemberV2"; export interface ModelV2 { @@ -15,6 +16,7 @@ export interface ModelV2 { unionProp: UnionV2; } +/** Type of EnumV2 */ export type EnumV2 = "enumMember"; /** The version of the API. */ export type Versions = "v1" | "v2"; diff --git a/packages/typespec-ts/test/modularIntegration/generated/versioning/removed/src/models/models.ts b/packages/typespec-ts/test/modularIntegration/generated/versioning/removed/src/models/models.ts index 5305dfe31e..e4b943cfdb 100644 --- a/packages/typespec-ts/test/modularIntegration/generated/versioning/removed/src/models/models.ts +++ b/packages/typespec-ts/test/modularIntegration/generated/versioning/removed/src/models/models.ts @@ -7,6 +7,7 @@ export interface ModelV2 { unionProp: UnionV2; } +/** Type of EnumV2 */ export type EnumV2 = "enumMemberV2"; /** The version of the API. */ export type Versions = "v1" | "v2"; diff --git a/packages/typespec-ts/test/modularIntegration/generated/versioning/renamedFrom/src/models/models.ts b/packages/typespec-ts/test/modularIntegration/generated/versioning/renamedFrom/src/models/models.ts index 6cf3efa501..e5fb461fe6 100644 --- a/packages/typespec-ts/test/modularIntegration/generated/versioning/renamedFrom/src/models/models.ts +++ b/packages/typespec-ts/test/modularIntegration/generated/versioning/renamedFrom/src/models/models.ts @@ -7,6 +7,7 @@ export interface NewModel { unionProp: NewUnion; } +/** Type of NewEnum */ export type NewEnum = "newEnumMember"; /** The version of the API. */ export type Versions = "v1" | "v2"; diff --git a/packages/typespec-ts/test/modularUnit/enumUnion.spec.ts b/packages/typespec-ts/test/modularUnit/enumUnion.spec.ts index 349eff8276..e07bae5a69 100644 --- a/packages/typespec-ts/test/modularUnit/enumUnion.spec.ts +++ b/packages/typespec-ts/test/modularUnit/enumUnion.spec.ts @@ -277,6 +277,7 @@ describe("header parameters", () => { await assertEqualContent( schemaOutput?.getFullText()!, ` + /** Type of JsonContentType */ export type JsonContentType = "application/json; serialization=Avro" | "application/json; serialization=json"; /** Alias for SchemaContentTypeValues */ export type SchemaContentTypeValues = JsonContentType | "text/plain; charset=utf-8" | "text/vnd.ms.protobuf" | string; @@ -412,6 +413,7 @@ describe("header parameters", () => { await assertEqualContent( schemaOutput?.getFullText()!, ` + /** Type of JsonContentType */ export type JsonContentType = "application/json; serialization=Avro" | "application/json; serialization=json"; /** Alias for SchemaContentTypeValues */ export type SchemaContentTypeValues = JsonContentType | "text/plain; charset=utf-8" | "text/vnd.ms.protobuf" | string; @@ -621,6 +623,7 @@ describe("header parameters", () => { await assertEqualContent( schemaOutput?.getFullText()!, ` + /** Type of SchemaContentTypeValues */ export type SchemaContentTypeValues = "application/json; serialization=Avro" | "application/json; serialization=json" | "text/plain; charset=utf-8" | "text/vnd.ms.protobuf";` ); }); @@ -662,6 +665,7 @@ describe("header parameters", () => { await assertEqualContent( schemaOutput?.getFullText()!, ` + /** Type of SchemaContentTypeValues */ export type SchemaContentTypeValues = "application/json; serialization=Avro" | "application/json; serialization=json" | "text/plain; charset=utf-8" | "text/vnd.ms.protobuf";` ); }); @@ -759,6 +763,7 @@ describe("header parameters", () => { await assertEqualContent( schemaOutput?.getFullText()!, ` + /** Type of EnumTest */ export type EnumTest = 1 | 2 | 3 | 4; export interface Foo { @@ -810,6 +815,7 @@ describe("model type", () => { color: "red"; } + /** Type of Color */ export type Color = "red" | "blue"; ` ); @@ -887,6 +893,7 @@ describe("model type", () => { color: 1; } + /** Type of Color */ export type Color = 1 | 2; ` ); @@ -972,7 +979,9 @@ describe("model type", () => { color: Lr | Ud; } + /** Type of Lr */ export type Lr = "left" | "right"; + /** Type of Ud */ export type Ud = "up" | "down"; ` ); @@ -1003,6 +1012,7 @@ describe("model type", () => { /** Type of LeftAndRight */ export type LeftAndRight = "left" | "right"; + /** Type of UpAndDown */ export type UpAndDown = "up" | "down"; ` ); diff --git a/packages/typespec-ts/test/unit/responsesGenerator.spec.ts b/packages/typespec-ts/test/unit/responsesGenerator.spec.ts index fcf1961a10..10f9b7464c 100644 --- a/packages/typespec-ts/test/unit/responsesGenerator.spec.ts +++ b/packages/typespec-ts/test/unit/responsesGenerator.spec.ts @@ -196,13 +196,19 @@ describe("Responses.ts", () => { await assertEqualContent( responses!.content, ` + import { RawHttpHeaders } from "@azure/core-rest-pipeline"; import { HttpResponse } from "@azure-rest/core-client"; + export interface Read200Headers { + "content-type": "image/png"; + } + /** The request has succeeded. */ export interface Read200Response extends HttpResponse { status: "200"; /** Value may contain any sequence of octets */ body: Uint8Array; + headers: RawHttpHeaders & Read200Headers; } ` ); @@ -215,13 +221,19 @@ describe("Responses.ts", () => { await assertEqualContent( responses!.content, ` + import { RawHttpHeaders } from "@azure/core-rest-pipeline"; import { HttpResponse } from "@azure-rest/core-client"; - - /** The request has succeeded. */ - export interface Read200Response extends HttpResponse { - status: "200"; - body: string; + + export interface Read200Headers { + "content-type": "text/plain"; } + + /** The request has succeeded. */ + export interface Read200Response extends HttpResponse { + status: "200"; + body: string; + headers: RawHttpHeaders & Read200Headers; + } ` ); }); @@ -329,6 +341,7 @@ describe("Responses.ts", () => { export interface Read200Headers { foo: string; bar: string; + "content-type": "image/png"; } /** The request has succeeded. */