Skip to content

Commit

Permalink
Upgrade to TypeSpec 0.66 (#32992)
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeguerin authored Mar 4, 2025
1 parent 341dc7a commit a0dc634
Show file tree
Hide file tree
Showing 585 changed files with 4,600 additions and 4,724 deletions.
1,120 changes: 947 additions & 173 deletions package-lock.json

Large diffs are not rendered by default.

30 changes: 15 additions & 15 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
"name": "azure-rest-api-specs",
"devDependencies": {
"@azure-tools/typespec-apiview": "0.5.1",
"@azure-tools/typespec-autorest": "0.51.0",
"@azure-tools/typespec-azure-core": "0.51.0",
"@azure-tools/typespec-azure-portal-core": "0.51.0",
"@azure-tools/typespec-azure-resource-manager": "0.51.0",
"@azure-tools/typespec-azure-rulesets": "0.51.0",
"@azure-tools/typespec-autorest": "0.52.0",
"@azure-tools/typespec-azure-core": "0.52.0",
"@azure-tools/typespec-azure-portal-core": "0.52.0",
"@azure-tools/typespec-azure-resource-manager": "0.52.0",
"@azure-tools/typespec-azure-rulesets": "0.52.0",
"@azure-tools/typespec-client-generator-cli": "0.15.3",
"@azure-tools/typespec-client-generator-core": "0.51.3",
"@azure-tools/typespec-client-generator-core": "0.52.0",
"@azure-tools/typespec-liftr-base": "0.8.0",
"@azure/avocado": "^0.9.1",
"@autorest/openapi-to-typespec": "0.10.11",
"@typespec/compiler": "0.65.3",
"@typespec/http": "0.65.0",
"@typespec/openapi": "0.65.0",
"@typespec/openapi3": "0.65.0",
"@typespec/prettier-plugin-typespec": "0.65.0",
"@typespec/rest": "0.65.0",
"@typespec/streams": "0.65.0",
"@typespec/versioning": "0.65.0",
"@typespec/xml": "0.65.0",
"@typespec/compiler": "0.66.0",
"@typespec/http": "0.66.0",
"@typespec/openapi": "0.66.0",
"@typespec/openapi3": "0.66.0",
"@typespec/prettier-plugin-typespec": "0.66.0",
"@typespec/rest": "0.66.0",
"@typespec/streams": "0.66.0",
"@typespec/versioning": "0.66.0",
"@typespec/xml": "0.66.0",
"azure-rest-api-specs-eng-tools": "file:eng/tools",
"oav": "^3.5.1",
"prettier": "~3.3.3",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ import "@azure-tools/typespec-azure-resource-manager";
using TypeSpec.Http;
using TypeSpec.Rest;
using TypeSpec.Versioning;
using Azure.Core;
using Azure.ResourceManager;

@armProviderNamespace("Microsoft.AgriculturePlatform")
@service({
title: "Microsoft.AgriculturePlatform",
})
@service(#{ title: "Microsoft.AgriculturePlatform" })
@versioned(Microsoft.AgriculturePlatform.Versions)
namespace Microsoft.AgriculturePlatform;

Expand All @@ -35,7 +32,7 @@ model AgriServiceResource is TrackedResource<AgriServiceResourceProperties> {
@pattern("^[a-zA-Z0-9-]{3,24}$")
@key("agriServiceResourceName")
@segment("agriServices")
@visibility("read")
@visibility(Lifecycle.Read)
@path
name: string;

Expand Down Expand Up @@ -72,26 +69,26 @@ union ProvisioningState {

@doc("Details of the Agriculture AgriDataManager.")
model AgriServiceResourceProperties {
@visibility("read")
@visibility(Lifecycle.Read)
@doc("The status of the last operation.")
provisioningState?: ProvisioningState;

@doc("Config of the AgriService instance.")
@visibility("read", "create", "update")
@visibility(Lifecycle.Read, Lifecycle.Create, Lifecycle.Update)
config?: AgriServiceConfig;

@visibility("read")
@visibility(Lifecycle.Read)
@doc("Managed On Behalf Of Configuration.")
managedOnBehalfOfConfiguration?: ManagedOnBehalfOfConfiguration;

@doc("Data connector credentials of AgriService instance.")
@OpenAPI.extension("x-ms-identifiers", ["key"])
@visibility("read", "create", "update")
@OpenAPI.extension("x-ms-identifiers", #["key"])
@visibility(Lifecycle.Read, Lifecycle.Create, Lifecycle.Update)
dataConnectorCredentials?: DataConnectorCredentialMap[];

@doc("AgriService installed solutions.")
@OpenAPI.extension("x-ms-identifiers", ["key"])
@visibility("read", "create", "update")
@OpenAPI.extension("x-ms-identifiers", #["key"])
@visibility(Lifecycle.Read, Lifecycle.Create, Lifecycle.Update)
installedSolutions?: InstalledSolutionMap[];
}

Expand All @@ -116,66 +113,66 @@ model InstalledSolutionMap {
@doc("Config of the AgriService resource instance.")
model AgriServiceConfig {
@doc("Instance URI of the AgriService instance.")
@visibility("read")
@visibility(Lifecycle.Read)
@minLength(2)
@maxLength(256)
instanceUri?: string;

@doc("Version of AgriService instance.")
@visibility("read")
@visibility(Lifecycle.Read)
@minLength(2)
@maxLength(256)
version?: string;

@doc("App service resource Id.")
@visibility("read")
@visibility(Lifecycle.Read)
@minLength(2)
appServiceResourceId?: string;

@doc("Cosmos Db resource Id.")
@visibility("read")
@visibility(Lifecycle.Read)
@minLength(2)
cosmosDbResourceId?: string;

@doc("Storage account resource Id.")
@visibility("read")
@visibility(Lifecycle.Read)
@minLength(2)
storageAccountResourceId?: string;

@doc("Key vault resource Id.")
@visibility("read")
@visibility(Lifecycle.Read)
@minLength(2)
keyVaultResourceId?: string;

@doc("Redis cache resource Id.")
@visibility("read")
@visibility(Lifecycle.Read)
@minLength(2)
redisCacheResourceId?: string;
}

@doc("The properties related to an AgriService data connector.")
model DataConnectorCredentials {
@doc("Type of credential.")
@visibility("read", "create", "update")
@visibility(Lifecycle.Read, Lifecycle.Create, Lifecycle.Update)
kind?: AuthCredentialsKind;

@doc("Client Id associated with the provider, if type of credentials is OAuthClientCredentials.")
@visibility("read", "create", "update")
@visibility(Lifecycle.Read, Lifecycle.Create, Lifecycle.Update)
@minLength(2)
clientId?: string;

@doc("Uri of the key vault")
@visibility("read", "create", "update")
@visibility(Lifecycle.Read, Lifecycle.Create, Lifecycle.Update)
@minLength(2)
keyVaultUri?: string;

@doc("Name of the key vault key.")
@visibility("read", "create", "update")
@visibility(Lifecycle.Read, Lifecycle.Create, Lifecycle.Update)
@minLength(2)
keyName?: string;

@doc("Version of the key vault key.")
@visibility("read", "create", "update")
@visibility(Lifecycle.Read, Lifecycle.Create, Lifecycle.Update)
@minLength(2)
keyVersion?: string;
}
Expand All @@ -194,39 +191,39 @@ union AuthCredentialsKind {
@doc("Installed data manager for Agriculture solution detail.")
model Solution {
@doc("Application name of the solution.")
@visibility("read", "create", "update")
@visibility(Lifecycle.Read, Lifecycle.Create, Lifecycle.Update)
@minLength(2)
applicationName?: string;

@doc("Partner Id.")
@visibility("read", "create", "update")
@visibility(Lifecycle.Read, Lifecycle.Create, Lifecycle.Update)
@minLength(2)
partnerId?: string;

@doc("Marketplace publisher Id.")
@visibility("read", "create", "update")
@visibility(Lifecycle.Read, Lifecycle.Create, Lifecycle.Update)
@minLength(2)
marketPlacePublisherId?: string;

@doc("Saas subscription Id.")
@visibility("read", "create", "update")
@visibility(Lifecycle.Read, Lifecycle.Create, Lifecycle.Update)
@minLength(2)
saasSubscriptionId?: string;

@doc("Saas subscription name.")
@visibility("read", "create", "update")
@visibility(Lifecycle.Read, Lifecycle.Create, Lifecycle.Update)
@minLength(2)
saasSubscriptionName?: string;

@doc("Plan Id.")
@visibility("read", "create", "update")
@visibility(Lifecycle.Read, Lifecycle.Create, Lifecycle.Update)
@minLength(2)
planId?: string;
}

@doc("Configuration of the managed on behalf of resource.")
model ManagedOnBehalfOfConfiguration {
@visibility("read")
@visibility(Lifecycle.Read)
@doc("Associated MoboBrokerResources.")
moboBrokerResources: MoboBrokerResource[];
}
Expand All @@ -237,7 +234,7 @@ model MoboBrokerResource {
* The fully qualified resource ID of the MoboBroker resource.
* Example: `/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}`
*/
@visibility("read")
@visibility(Lifecycle.Read)
id: string;
}

Expand Down Expand Up @@ -279,7 +276,7 @@ op ArmResourceListActionSync<
@doc("The list of available agri solutions.")
model AvailableAgriSolutionListResult {
@doc("Agri solutions list.")
@OpenAPI.extension("x-ms-identifiers", [])
@identifiers(#[])
solutions: DataManagerForAgricultureSolution[];
}

Expand Down
4 changes: 1 addition & 3 deletions specification/ai/DocumentIntelligence/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ using TypeSpec.Http;
}
]>
)
@service({
title: "Document Intelligence (formerly Form Recognizer)",
})
@service(#{ title: "Document Intelligence (formerly Form Recognizer)" })
@server(
"{endpoint}/documentintelligence",
"Extracts content, layout, and structured data from documents.",
Expand Down
28 changes: 14 additions & 14 deletions specification/ai/DocumentIntelligence/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,7 @@ model ClassifierCopyAuthorization {
model DocumentIntelligenceOperationDetails {
@doc("Operation ID")
@key
@visibility("read", "create")
@visibility(Lifecycle.Read, Lifecycle.Create)
operationId: string;

@doc("Operation status. notStarted, running, completed, or failed")
Expand Down Expand Up @@ -1358,7 +1358,7 @@ model DocumentIntelligenceOperationDetails {
@doc("Document model info.")
model DocumentModelDetails {
@key
@visibility("read", "create")
@visibility(Lifecycle.Read, Lifecycle.Create)
@doc("Unique document model name.")
@pattern("^[a-zA-Z0-9][a-zA-Z0-9._~-]{1,63}$")
modelId: string;
Expand All @@ -1368,40 +1368,40 @@ model DocumentModelDetails {
description?: string;

@doc("Date and time (UTC) when the document model was created.")
@visibility("read")
@visibility(Lifecycle.Read)
createdDateTime: utcDateTime;

@doc("Date and time (UTC) when the document model will expire.")
@visibility("read")
@visibility(Lifecycle.Read)
expirationDateTime?: utcDateTime;

@doc("Date and time (UTC) when the document model was last modified.")
@visibility("read")
@visibility(Lifecycle.Read)
modifiedDateTime?: utcDateTime;

@doc("API version used to create this document model.")
@visibility("read")
@visibility(Lifecycle.Read)
apiVersion?: string;

@doc("List of key-value tag attributes associated with the document model.")
tags?: Record<string>;

@doc("Custom document model build mode.")
@visibility("read")
@visibility(Lifecycle.Read)
buildMode?: DocumentBuildMode;

@doc("""
Azure Blob Storage location containing the training data. Either
azureBlobSource or azureBlobFileListSource must be specified.
""")
@visibility("read")
@visibility(Lifecycle.Read)
azureBlobSource?: AzureBlobContentSource;

@doc("""
Azure Blob Storage file list specifying the training data. Either
azureBlobSource or azureBlobFileListSource must be specified.
""")
@visibility("read")
@visibility(Lifecycle.Read)
azureBlobFileListSource?: AzureBlobFileListContentSource;

@doc("For composed models, the custom classifier to split and classify the input file.")
Expand All @@ -1411,15 +1411,15 @@ model DocumentModelDetails {
split?: SplitMode = SplitMode.none;

@doc("Supported document types.")
@visibility("read")
@visibility(Lifecycle.Read)
docTypes?: Record<DocumentTypeDetails>;

@doc("List of warnings encountered while building the model.")
@visibility("read")
@visibility(Lifecycle.Read)
warnings?: DocumentIntelligenceWarning[];

@doc("Number of V100-equivalent GPU hours consumed for model training.")
@visibility("read")
@visibility(Lifecycle.Read)
trainingHours?: float32;
}

Expand Down Expand Up @@ -1520,7 +1520,7 @@ model ClassifierDocumentTypeDetails {
@resource("documentClassifiers")
model DocumentClassifierDetails {
@key
@visibility("read", "create")
@visibility(Lifecycle.Read, Lifecycle.Create)
@doc("Unique document classifier name.")
@pattern("^[a-zA-Z0-9][a-zA-Z0-9._~-]{1,63}$")
@maxLength(64)
Expand All @@ -1537,7 +1537,7 @@ model DocumentClassifierDetails {
expirationDateTime?: utcDateTime;

@doc("Date and time (UTC) when the document model was last modified.")
@visibility("read")
@visibility(Lifecycle.Read)
modifiedDateTime?: utcDateTime;

@doc("API version used to create this document classifier.")
Expand Down
4 changes: 1 addition & 3 deletions specification/ai/Face/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ using TypeSpec.Rest;
using TypeSpec.Versioning;

@useAuth(KeyAuth | AADToken)
@service({
title: "Azure AI Face API",
})
@service(#{ title: "Azure AI Face API" })
@versioned(Versions)
@server(
"{endpoint}/face/{apiVersion}",
Expand Down
2 changes: 1 addition & 1 deletion specification/ai/Face/models.common.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ model FaceUserData {
@resource("persistedfaces")
model BaseFace {
@key
@visibility("read")
@visibility(Lifecycle.Read)
@doc("Face ID of the face.")
persistedFaceId: uuid;

Expand Down
4 changes: 2 additions & 2 deletions specification/ai/Face/models.facelist.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace Face;
@resource("facelists")
model FaceList is BaseCollection {
@key
@visibility("read")
@visibility(Lifecycle.Read)
@doc("Valid character is letter in lower case or digit or '-' or '_', maximum length is 64.")
faceListId: collectionId;

Expand All @@ -35,7 +35,7 @@ model FaceListFace is BaseFace;
@resource("largefacelists")
model LargeFaceList is BaseCollection {
@key
@visibility("read")
@visibility(Lifecycle.Read)
@doc("Valid character is letter in lower case or digit or '-' or '_', maximum length is 64.")
largeFaceListId: collectionId;
}
Expand Down
Loading

0 comments on commit a0dc634

Please sign in to comment.