diff --git a/sdk/formrecognizer/ai-form-recognizer/CHANGELOG.md b/sdk/formrecognizer/ai-form-recognizer/CHANGELOG.md index d2db2edbb187..ee4c0754e372 100644 --- a/sdk/formrecognizer/ai-form-recognizer/CHANGELOG.md +++ b/sdk/formrecognizer/ai-form-recognizer/CHANGELOG.md @@ -1,27 +1,39 @@ # Release History -## 4.1.0 (Unreleased) +## 5.0.0 (2023-08-08) ### Features Added -- `AnalyzeDocumentOptions.features` allows three new features compared to the last beta version: +- Updated the SDK to use the latest Generally Available (GA) version of the Form Recognizer REST API: `2023-07-31`. +- `AnalyzeDocumentOptions.features` accepts three new features compared to the last beta version: - `barcodes`: enables the detection of barcodes in the document. - `keyValuePairs`: enable the detection of general key value pairs (form fields) in the document. - `languages`: enables the detection of the text content language. -- `beginBuildDocumentModel` has a new overload that accepts a `DocumentModelContentSource` in place of a raw `containerUrl`. This allows training document models using the new Azure Blob file list source (that is already supported by document classifiers). The `DocumentModelContentSource` is an object that contains a `containerUrl` property, and if a `fileList` property is also provided it is interpreted as an Azure Blob file list source. Otherwise it is interpreted as an Azure Blob content source with an optional `prefix` property. +- `beginBuildDocumentModel` has a new overload that accepts a `DocumentModelSource` in place of a raw `containerUrl`. This allows training document models using the new Blob File List source (that is already supported by document classifiers). Like with classifiers, the source inputs are specified as an object containing an `azureFileListSource` property or an `azureBlobSource` property containing the respective details of each source type. ### Breaking Changes -- `DocumentAnalysisClient` and `DocumentModelAdministrationClient` now target service API version `2023-07-31` by default. Version `2023-02-28-preview` is not supported. +From the last stable release (4.0.0): + +- Support for passing alternative API versions has been removed from the client. In practice, the client only supported + using a single API version, but types and options for specifying an API version were provided. In version 5.0.0, these options and their associated types were removed: + - The `apiVersion` option that was previously accepted by the `DocumentAnalysisClient` and `DocumentModelAdministrationClient` constructors was removed. This option previously only had one valid value in version 4.0.0, and supporting multiple API versions in a single package weakens the type constraints, so we have chosen to only support the latest Generally Available version of the service in this SDK package. Support for multiple API versions may be reintroduced in a future version. + - The `FormRecognizerApiVersion` type and enum were removed as they no longer serve any purpose. + - The type of `apiVersion` properties of result objects was changed from `FormRecognizerApiVersion` to `string`. This type is more accurate, as these fields reflect the API version used to create the model or start the analysis operation, and not necessarily an API version that the client instance is aware of. + - The `FormRecognizerCommonClientOptions` interface, which both `DocumentAnalysisClientOptions` and `DocumentModelAdministrationClientOptions` inherited from was removed, as it only carried the `apiVersion` option that no longer exists. +- The `languages` and `keyValuePairs` properties of `AnalyzeResult` that were previously returned when using the `prebuilt-document` model are no longer returned unless the corresponding `features` are specified when making the analysis request. + +From the last beta release (4.1.0-beta.1): + - `AnalyzeDocumentOptions.features` changed the following feature names: - `ocr.highResolution` renamed to `ocrHighResolution`. - `ocr.formula` renamed to `formulas`. - `ocr.font` renamed to `styleFont`. -- The following fields have been removed +- The following fields have been removed: - `AnalyzeDocumentOptions.queryFields` - `DocumentPage.kind` and `DocumentPage.images` (`DocumentPageKind` and `DocumentImage` types have been removed too.) - `DocumentKeyValuePair.commonName` -- Changed how content sources are provided when creating document classifiers. The type of content source (`azureBlobContentSource` or `azureBlobFileListSource`) is no longer required in the content source input, and the type is now inferred automatically. If a `fileList` property is provided, it is interpreted as a file list source, and otherwise it is interpreted as a blob content source with optional `prefix`. +- The type of the `docTypes` parameter of `beginBuildDocumentClassifier` was refined slightly. The type will no longer accept _both_ `azureBlobSource` and `azureFileListSource` ## 4.1.0-beta.1 (2023-04-11) diff --git a/sdk/formrecognizer/ai-form-recognizer/package.json b/sdk/formrecognizer/ai-form-recognizer/package.json index 4f15ece282d3..bca4a258763c 100644 --- a/sdk/formrecognizer/ai-form-recognizer/package.json +++ b/sdk/formrecognizer/ai-form-recognizer/package.json @@ -3,7 +3,7 @@ "sdk-type": "client", "author": "Microsoft Corporation", "description": "An isomorphic client library for the Azure Form Recognizer service.", - "version": "4.1.0", + "version": "5.0.0", "keywords": [ "node", "azure", diff --git a/sdk/formrecognizer/ai-form-recognizer/review/ai-form-recognizer.api.md b/sdk/formrecognizer/ai-form-recognizer/review/ai-form-recognizer.api.md index bc72f942f216..d6be862fbc0f 100644 --- a/sdk/formrecognizer/ai-form-recognizer/review/ai-form-recognizer.api.md +++ b/sdk/formrecognizer/ai-form-recognizer/review/ai-form-recognizer.api.md @@ -49,7 +49,7 @@ export interface AnalyzedDocument { // @public export interface AnalyzeDocumentOptions> extends OperationOptions, PollerOptions> { - features?: string[]; + features?: FormRecognizerFeature[]; locale?: string; pages?: string; } @@ -67,7 +67,7 @@ export interface AnalyzeResult extends AnalyzeResul // @public export interface AnalyzeResultCommon { - apiVersion: FormRecognizerApiVersion; + apiVersion: string; content: string; modelId: string; } @@ -76,17 +76,29 @@ export interface AnalyzeResultCommon { export type AnalyzeResultOperationStatus = "notStarted" | "running" | "failed" | "succeeded"; // @public -export interface AzureBlobContentSource { - containerUrl: string; - prefix?: string; +export interface AzureBlobFileListSource { + azureBlobFileListSource: AzureBlobFileListSourceDetails; + azureBlobSource?: undefined; } // @public -export interface AzureBlobFileListContentSource { +export interface AzureBlobFileListSourceDetails { containerUrl: string; fileList: string; } +// @public +export interface AzureBlobSource { + azureBlobFileListSource?: undefined; + azureBlobSource: AzureBlobSourceDetails; +} + +// @public +export interface AzureBlobSourceDetails { + containerUrl: string; + prefix?: string; +} + export { AzureKeyCredential } // @public @@ -113,8 +125,8 @@ export interface BoundingRegion extends HasBoundingPolygon { // @public export interface ClassifierDocumentTypeDetails { - azureBlobFileListSource?: AzureBlobFileListContentSource; - azureBlobSource?: AzureBlobContentSource; + azureBlobFileListSource?: AzureBlobFileListSourceDetails; + azureBlobSource?: AzureBlobSourceDetails; } // @public @@ -181,7 +193,7 @@ export class DocumentAnalysisClient { } // @public -export interface DocumentAnalysisClientOptions extends FormRecognizerCommonClientOptions { +export interface DocumentAnalysisClientOptions extends CommonClientOptions { stringIndexType?: StringIndexType; } @@ -237,9 +249,6 @@ export interface DocumentClassifierBuildOperationDetails extends OperationDetail result?: DocumentClassifierDetails; } -// @public -export type DocumentClassifierContentSource = AzureBlobContentSource | AzureBlobFileListContentSource; - // @public export interface DocumentClassifierDetails { apiVersion: string; @@ -252,6 +261,11 @@ export interface DocumentClassifierDetails { expiresOn?: Date; } +// @public +export interface DocumentClassifierDocumentTypeSources { + [docType: string]: DocumentClassifierSource; +} + // @public export interface DocumentClassifierOperationState extends PollOperationState, ModelAdministrationOperationStateCommon { } @@ -259,6 +273,9 @@ export interface DocumentClassifierOperationState extends PollOperationState; +// @public +export type DocumentClassifierSource = AzureBlobSource | AzureBlobFileListSource; + // @public export interface DocumentCountryRegionField extends DocumentFieldCommon { kind: "countryRegion"; @@ -354,7 +371,7 @@ export interface DocumentLine extends HasBoundingPolygon { // @public export interface DocumentModel { - apiVersion?: FormRecognizerApiVersion; + apiVersion?: string; modelId: string; transformResult: (input: AnalyzeResult) => Result; } @@ -364,11 +381,9 @@ export class DocumentModelAdministrationClient { constructor(endpoint: string, credential: TokenCredential, options?: DocumentModelAdministrationClientOptions); constructor(endpoint: string, credential: KeyCredential, options?: DocumentModelAdministrationClientOptions); constructor(endpoint: string, credential: KeyCredential | TokenCredential, options?: DocumentModelAdministrationClientOptions); - beginBuildDocumentClassifier(classifierId: string, docTypes: { - [docType: string]: DocumentClassifierContentSource; - }, options?: BeginBuildDocumentClassifierOptions): Promise; + beginBuildDocumentClassifier(classifierId: string, docTypeSources: DocumentClassifierDocumentTypeSources, options?: BeginBuildDocumentClassifierOptions): Promise; beginBuildDocumentModel(modelId: string, containerUrl: string, buildMode: DocumentModelBuildMode, options?: BeginBuildDocumentModelOptions): Promise; - beginBuildDocumentModel(modelId: string, contentSource: DocumentModelContentSource, buildMode: DocumentModelBuildMode, options?: BeginBuildDocumentModelOptions): Promise; + beginBuildDocumentModel(modelId: string, contentSource: DocumentModelSource, buildMode: DocumentModelBuildMode, options?: BeginBuildDocumentModelOptions): Promise; beginComposeDocumentModel(modelId: string, componentModelIds: Iterable, options?: BeginComposeDocumentModelOptions): Promise; beginCopyModelTo(sourceModelId: string, authorization: CopyAuthorization, options?: BeginCopyModelOptions): Promise; deleteDocumentClassifier(classifierId: string, options?: OperationOptions): Promise; @@ -384,7 +399,7 @@ export class DocumentModelAdministrationClient { } // @public -export interface DocumentModelAdministrationClientOptions extends FormRecognizerCommonClientOptions { +export interface DocumentModelAdministrationClientOptions extends CommonClientOptions { } // @public @@ -408,9 +423,6 @@ export interface DocumentModelComposeOperationDetails extends OperationDetails { result?: DocumentModelDetails; } -// @public -export type DocumentModelContentSource = AzureBlobContentSource | AzureBlobFileListContentSource; - // @public export interface DocumentModelCopyToOperationDetails extends OperationDetails { kind: "documentModelCopyTo"; @@ -439,6 +451,9 @@ export interface DocumentModelOperationState extends PollOperationState; +// @public +export type DocumentModelSource = AzureBlobSource | AzureBlobFileListSource; + // @public export interface DocumentModelSummary { apiVersion?: string; @@ -607,25 +622,10 @@ export type FontStyle = string; // @public export type FontWeight = string; -// @public -export type FormRecognizerApiVersion = (typeof FormRecognizerApiVersion)[keyof typeof FormRecognizerApiVersion]; - -// @public -export const FormRecognizerApiVersion: { - readonly Latest: "2023-07-31"; - readonly Stable: "2023-07-31"; - readonly "2022-08-31": "2022-08-31"; -}; - -// @public -export interface FormRecognizerCommonClientOptions extends CommonClientOptions { - apiVersion?: FormRecognizerApiVersion; -} - // @public export type FormRecognizerFeature = (typeof FormRecognizerFeature)[keyof typeof FormRecognizerFeature] | (string & {}); -// @public (undocumented) +// @public export const FormRecognizerFeature: { readonly Fonts: "styleFont"; readonly OcrHighResolution: "ocrHighResolution"; @@ -813,7 +813,7 @@ export interface OperationDetails { }; } -// @public (undocumented) +// @public export type OperationDetailsUnion = OperationDetails | DocumentModelBuildOperationDetails | DocumentModelComposeOperationDetails | DocumentModelCopyToOperationDetails | DocumentClassifierBuildOperationDetails; // @public diff --git a/sdk/formrecognizer/ai-form-recognizer/samples-dev/buildClassifier.ts b/sdk/formrecognizer/ai-form-recognizer/samples-dev/buildClassifier.ts index a83a01c8a6d4..0b93506cf9d8 100644 --- a/sdk/formrecognizer/ai-form-recognizer/samples-dev/buildClassifier.ts +++ b/sdk/formrecognizer/ai-form-recognizer/samples-dev/buildClassifier.ts @@ -42,10 +42,14 @@ async function main() { type1: { // `azureBlobSource` isn't the only way to provide training data to the service. For more information, see // the documentation of the `ClassifierDocumentTypeDetails` type. - containerUrl: trainingDataSasUrl1, + azureBlobSource: { + containerUrl: trainingDataSasUrl1, + }, }, type2: { - containerUrl: trainingDataSasUrl2, + azureBlobSource: { + containerUrl: trainingDataSasUrl2, + }, }, }, { diff --git a/sdk/formrecognizer/ai-form-recognizer/samples-dev/buildModel.ts b/sdk/formrecognizer/ai-form-recognizer/samples-dev/buildModel.ts index a8c7cd53d9fb..bd040002d89a 100644 --- a/sdk/formrecognizer/ai-form-recognizer/samples-dev/buildModel.ts +++ b/sdk/formrecognizer/ai-form-recognizer/samples-dev/buildModel.ts @@ -36,7 +36,11 @@ async function main() { const poller = await client.beginBuildDocumentModel( modelId, - trainingDataSasUrl, + { + azureBlobSource: { + containerUrl: trainingDataSasUrl, + }, + }, DocumentModelBuildMode.Template ); const model = await poller.pollUntilDone(); diff --git a/sdk/formrecognizer/ai-form-recognizer/src/constants.ts b/sdk/formrecognizer/ai-form-recognizer/src/constants.ts index 7a1144704839..cf48872ed849 100644 --- a/sdk/formrecognizer/ai-form-recognizer/src/constants.ts +++ b/sdk/formrecognizer/ai-form-recognizer/src/constants.ts @@ -10,4 +10,6 @@ export const DEFAULT_COGNITIVE_SCOPE = "https://cognitiveservices.azure.com/.def /** * @internal */ -export const SDK_VERSION = "4.1.0"; +export const SDK_VERSION = "5.0.0"; + +export const FORM_RECOGNIZER_API_VERSION = "2023-07-31"; diff --git a/sdk/formrecognizer/ai-form-recognizer/src/documentAnalysisClient.ts b/sdk/formrecognizer/ai-form-recognizer/src/documentAnalysisClient.ts index 47263f9bfea6..a4f60c7de56d 100644 --- a/sdk/formrecognizer/ai-form-recognizer/src/documentAnalysisClient.ts +++ b/sdk/formrecognizer/ai-form-recognizer/src/documentAnalysisClient.ts @@ -4,7 +4,7 @@ import { KeyCredential, TokenCredential } from "@azure/core-auth"; import { createTracingClient } from "@azure/core-tracing"; import { TracingClient } from "@azure/core-tracing"; -import { SDK_VERSION } from "./constants"; +import { FORM_RECOGNIZER_API_VERSION, SDK_VERSION } from "./constants"; import { AnalyzeDocumentRequest, AnalyzeResultOperation, @@ -23,11 +23,7 @@ import { } from "./lro/analysis"; import { OperationContext, lro } from "./lro/util/poller"; import { AnalyzeDocumentOptions } from "./options/AnalyzeDocumentOptions"; -import { - DEFAULT_GENERATED_CLIENT_OPTIONS, - DocumentAnalysisClientOptions, - FormRecognizerApiVersion, -} from "./options/FormRecognizerClientOptions"; +import { DocumentAnalysisClientOptions } from "./options/FormRecognizerClientOptions"; import { DocumentModel } from "./documentModel"; import { makeServiceClient, Mappers, SERIALIZER } from "./util"; import { AbortSignalLike } from "@azure/abort-controller"; @@ -66,7 +62,6 @@ import { ClassifyDocumentOptions } from "./options/ClassifyDocumentOptions"; export class DocumentAnalysisClient { private _restClient: GeneratedClient; private _tracing: TracingClient; - private _apiVersion: FormRecognizerApiVersion; /** * Create a `DocumentAnalysisClient` instance from a resource endpoint and a an Azure Identity `TokenCredential`. @@ -137,8 +132,6 @@ export class DocumentAnalysisClient { packageVersion: SDK_VERSION, namespace: "Microsoft.CognitiveServices", }); - - this._apiVersion = options.apiVersion ?? DEFAULT_GENERATED_CLIENT_OPTIONS.apiVersion; } // #region Analysis @@ -418,12 +411,13 @@ export class DocumentAnalysisClient { ? { modelId: model, apiVersion: undefined, transformResult: (v: AnalyzeResult) => v } : model; - if (requestApiVersion && requestApiVersion !== this._apiVersion) { + if (requestApiVersion && requestApiVersion !== FORM_RECOGNIZER_API_VERSION) { throw new Error( [ - `API Version mismatch: the provided model wants version: ${requestApiVersion}, but the client is using ${this._apiVersion}.`, + `API Version mismatch: the provided model wants version: ${requestApiVersion},`, + `but the client is using ${FORM_RECOGNIZER_API_VERSION}.`, "The API version of the model must match the client's API version.", - ].join("\n") + ].join(" ") ); } diff --git a/sdk/formrecognizer/ai-form-recognizer/src/documentModel.ts b/sdk/formrecognizer/ai-form-recognizer/src/documentModel.ts index c69940fdb858..3503c8e6e307 100644 --- a/sdk/formrecognizer/ai-form-recognizer/src/documentModel.ts +++ b/sdk/formrecognizer/ai-form-recognizer/src/documentModel.ts @@ -4,7 +4,6 @@ import { DocumentFieldSchema, DocumentModelDetails } from "./generated"; import { AnalyzedDocument, AnalyzeResult } from "./lro/analysis"; import { DocumentField } from "./models/fields"; -import { FormRecognizerApiVersion } from "./options"; import { isAcronymic, uncapitalize } from "./util"; /** @@ -21,7 +20,7 @@ export interface DocumentModel { /** * The API version of the model. */ - apiVersion?: FormRecognizerApiVersion; + apiVersion?: string; /** * An associated transformation that is used to conver the base (weak) Result type to the strong version. */ @@ -94,7 +93,7 @@ export function createModelFromSchema( ): DocumentModel> { return { modelId: schema.modelId, - apiVersion: schema.apiVersion as FormRecognizerApiVersion, + apiVersion: schema.apiVersion, transformResult(baseResult: AnalyzeResult): AnalyzeResult { const hasDocuments = Object.entries(schema.docTypes ?? {}).length > 0; diff --git a/sdk/formrecognizer/ai-form-recognizer/src/documentModelAdministrationClient.ts b/sdk/formrecognizer/ai-form-recognizer/src/documentModelAdministrationClient.ts index 4e0848ca5065..58fda72429f2 100644 --- a/sdk/formrecognizer/ai-form-recognizer/src/documentModelAdministrationClient.ts +++ b/sdk/formrecognizer/ai-form-recognizer/src/documentModelAdministrationClient.ts @@ -14,7 +14,6 @@ import { OperationSummary, OperationDetails, DocumentClassifierDetails, - ClassifierDocumentTypeDetails, } from "./generated"; import { accept1 } from "./generated/models/parameters"; import { @@ -48,12 +47,11 @@ import { } from "./options/BuildModelOptions"; import { Mappers, SERIALIZER, makeServiceClient } from "./util"; import { FullOperationResponse, OperationOptions } from "@azure/core-client"; -import { DocumentModelContentSource } from "./models"; import { - DocumentClassifierContentSource, - toBuildOptions, - toClassifierDetails, -} from "./models/contentSource"; + DocumentModelSource, + DocumentClassifierDocumentTypeSources, + AzureBlobSource, +} from "./models"; /** * A client for interacting with the Form Recognizer service's model management features, such as creating, reading, @@ -251,21 +249,25 @@ export class DocumentModelAdministrationClient { */ public async beginBuildDocumentModel( modelId: string, - contentSource: DocumentModelContentSource, + contentSource: DocumentModelSource, buildMode: DocumentModelBuildMode, options?: BeginBuildDocumentModelOptions ): Promise; public async beginBuildDocumentModel( modelId: string, - urlOrSource: string | DocumentModelContentSource, + urlOrSource: string | DocumentModelSource, buildMode: DocumentModelBuildMode, options: BeginBuildDocumentModelOptions = {} ): Promise { const sourceInfo = typeof urlOrSource === "string" - ? toBuildOptions({ containerUrl: urlOrSource }) - : toBuildOptions(urlOrSource); + ? ({ + azureBlobSource: { + containerUrl: urlOrSource, + }, + } as AzureBlobSource) + : urlOrSource; return this._tracing.withSpan( "DocumentModelAdministrationClient.beginBuildDocumentModel", @@ -515,21 +517,16 @@ export class DocumentModelAdministrationClient { * ``` * * @param classifierId - the unique ID of the classifier to create - * @param docTypes - the document types to include in the classifier (a map of document type names to `ClassifierDocumentTypeDetails`) + * @param docTypeSources - the document types to include in the classifier and their sources (a map of document type + * names to `ClassifierDocumentTypeDetails`) * @param options - optional settings for the classifier build operation * @returns a long-running operation (poller) that will eventually produce the created classifier details or an error */ public async beginBuildDocumentClassifier( classifierId: string, - docTypes: { [docType: string]: DocumentClassifierContentSource }, + docTypeSources: DocumentClassifierDocumentTypeSources, options: BeginBuildDocumentClassifierOptions = {} ): Promise { - const inputDocTypes: { [docType: string]: ClassifierDocumentTypeDetails } = {}; - - for (const [k, v] of Object.entries(docTypes)) { - inputDocTypes[k] = toClassifierDetails(v); - } - return this._tracing.withSpan( "DocumentModelAdministrationClient.beginBuildDocumentClassifier", options, @@ -541,7 +538,7 @@ export class DocumentModelAdministrationClient { { classifierId, description: finalOptions.description, - docTypes: inputDocTypes, + docTypes: docTypeSources, }, finalOptions ), diff --git a/sdk/formrecognizer/ai-form-recognizer/src/generated/generatedClient.ts b/sdk/formrecognizer/ai-form-recognizer/src/generated/generatedClient.ts index a4a269b4f572..79d1822544c8 100644 --- a/sdk/formrecognizer/ai-form-recognizer/src/generated/generatedClient.ts +++ b/sdk/formrecognizer/ai-form-recognizer/src/generated/generatedClient.ts @@ -49,7 +49,7 @@ export class GeneratedClient extends coreClient.ServiceClient { requestContentType: "application/json; charset=utf-8" }; - const packageDetails = `azsdk-js-ai-form-recognizer/4.1.0`; + const packageDetails = `azsdk-js-ai-form-recognizer/5.0.0`; const userAgentPrefix = options.userAgentOptions && options.userAgentOptions.userAgentPrefix ? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}` diff --git a/sdk/formrecognizer/ai-form-recognizer/src/generated/models/index.ts b/sdk/formrecognizer/ai-form-recognizer/src/generated/models/index.ts index d514f229e9c8..df59bc06f7dc 100644 --- a/sdk/formrecognizer/ai-form-recognizer/src/generated/models/index.ts +++ b/sdk/formrecognizer/ai-form-recognizer/src/generated/models/index.ts @@ -9,6 +9,9 @@ import * as coreClient from "@azure/core-client"; import * as coreRestPipeline from "@azure/core-rest-pipeline"; +/** + * Details about any of several different types of Form Recognizer management operations. + */ export type OperationDetailsUnion = | OperationDetails | DocumentModelBuildOperationDetails @@ -698,8 +701,7 @@ export interface DocumentModelCopyToOperationDetails extends OperationDetails { } /** Get Operation response object. */ -export interface DocumentClassifierBuildOperationDetails - extends OperationDetails { +export interface DocumentClassifierBuildOperationDetails extends OperationDetails { /** Polymorphic discriminator, which specifies the different types this object can be */ kind: "documentClassifierBuild"; /** Operation result upon success. */ @@ -749,7 +751,7 @@ export enum KnownStringIndexType { /** Character unit represented by a single unicode code point. Used by Python 3. */ UnicodeCodePoint = "unicodeCodePoint", /** Character unit represented by a 16-bit Unicode code unit. Used by JavaScript, Java, and .NET. */ - Utf16CodeUnit = "utf16CodeUnit" + Utf16CodeUnit = "utf16CodeUnit", } /** @@ -776,7 +778,7 @@ export enum KnownDocumentAnalysisFeature { /** Enable the detection of general key value pairs (form fields) in the document. */ KeyValuePairs = "keyValuePairs", /** Enable the recognition of various font styles. */ - StyleFont = "styleFont" + StyleFont = "styleFont", } /** @@ -798,7 +800,7 @@ export enum KnownLengthUnit { /** Length unit for image files. */ Pixel = "pixel", /** Length unit for PDF files. */ - Inch = "inch" + Inch = "inch", } /** @@ -816,7 +818,7 @@ export enum KnownSelectionMarkState { /** The selection mark is selected, often indicated by a check ✓ or cross X inside the selection mark. */ Selected = "selected", /** The selection mark is not selected. */ - Unselected = "unselected" + Unselected = "unselected", } /** @@ -864,7 +866,7 @@ export enum KnownDocumentBarcodeKind { /** Data matrix code, as defined in ISO/IEC 16022:2006. */ DataMatrix = "DataMatrix", /** MaxiCode, as defined in ISO/IEC 16023:2000. */ - MaxiCode = "MaxiCode" + MaxiCode = "MaxiCode", } /** @@ -897,7 +899,7 @@ export enum KnownDocumentFormulaKind { /** A formula embedded within the content of a paragraph. */ Inline = "inline", /** A formula in display mode that takes up an entire line. */ - Display = "display" + Display = "display", } /** @@ -925,7 +927,7 @@ export enum KnownParagraphRole { /** A note usually placed after the main content on a page. */ Footnote = "footnote", /** A block of formulas, often with shared alignment. */ - FormulaBlock = "formulaBlock" + FormulaBlock = "formulaBlock", } /** @@ -954,7 +956,7 @@ export enum KnownDocumentTableCellKind { /** Describes the row headers, usually located at the top left corner of a table. */ StubHead = "stubHead", /** Describes the content in (parts of) the table. */ - Description = "description" + Description = "description", } /** @@ -975,7 +977,7 @@ export enum KnownFontStyle { /** Characters are represented normally. */ Normal = "normal", /** Characters are visually slanted to the right. */ - Italic = "italic" + Italic = "italic", } /** @@ -993,7 +995,7 @@ export enum KnownFontWeight { /** Characters are represented normally. */ Normal = "normal", /** Characters are represented with thicker strokes. */ - Bold = "bold" + Bold = "bold", } /** @@ -1035,7 +1037,7 @@ export enum KnownDocumentFieldType { /** Parsed address. */ Address = "address", /** Boolean value, normalized to true or false. */ - Boolean = "boolean" + Boolean = "boolean", } /** @@ -1065,7 +1067,7 @@ export enum KnownDocumentSignatureType { /** A signature is detected. */ Signed = "signed", /** No signatures are detected. */ - Unsigned = "unsigned" + Unsigned = "unsigned", } /** @@ -1083,7 +1085,7 @@ export enum KnownDocumentBuildMode { /** Target documents with similar visual templates. */ Template = "template", /** Support documents with diverse visual templates. */ - Neural = "neural" + Neural = "neural", } /** @@ -1105,7 +1107,7 @@ export enum KnownOperationKind { /** Copy an existing document model to potentially a different resource, region, or subscription. */ DocumentModelCopyTo = "documentModelCopyTo", /** Build a new custom classifier model. */ - DocumentClassifierBuild = "documentClassifierBuild" + DocumentClassifierBuild = "documentClassifierBuild", } /** @@ -1132,18 +1134,9 @@ export type ContentType = | "image/png" | "image/tiff"; /** Defines values for AnalyzeResultOperationStatus. */ -export type AnalyzeResultOperationStatus = - | "notStarted" - | "running" - | "failed" - | "succeeded"; +export type AnalyzeResultOperationStatus = "notStarted" | "running" | "failed" | "succeeded"; /** Defines values for OperationStatus. */ -export type OperationStatus = - | "notStarted" - | "running" - | "failed" - | "succeeded" - | "canceled"; +export type OperationStatus = "notStarted" | "running" | "failed" | "succeeded" | "canceled"; /** Optional parameters. */ export interface DocumentModelsAnalyzeDocument$binaryOptionalParams @@ -1188,22 +1181,19 @@ export interface DocumentModelsAnalyzeDocument$jsonOptionalParams export type DocumentModelsAnalyzeDocumentResponse = DocumentModelsAnalyzeDocumentHeaders; /** Optional parameters. */ -export interface DocumentModelsGetAnalyzeResultOptionalParams - extends coreClient.OperationOptions {} +export interface DocumentModelsGetAnalyzeResultOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getAnalyzeResult operation. */ export type DocumentModelsGetAnalyzeResultResponse = AnalyzeResultOperation; /** Optional parameters. */ -export interface DocumentModelsBuildModelOptionalParams - extends coreClient.OperationOptions {} +export interface DocumentModelsBuildModelOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the buildModel operation. */ export type DocumentModelsBuildModelResponse = DocumentModelsBuildModelHeaders; /** Optional parameters. */ -export interface DocumentModelsComposeModelOptionalParams - extends coreClient.OperationOptions {} +export interface DocumentModelsComposeModelOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the composeModel operation. */ export type DocumentModelsComposeModelResponse = DocumentModelsComposeModelHeaders; @@ -1216,54 +1206,46 @@ export interface DocumentModelsAuthorizeModelCopyOptionalParams export type DocumentModelsAuthorizeModelCopyResponse = CopyAuthorization; /** Optional parameters. */ -export interface DocumentModelsCopyModelToOptionalParams - extends coreClient.OperationOptions {} +export interface DocumentModelsCopyModelToOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the copyModelTo operation. */ export type DocumentModelsCopyModelToResponse = DocumentModelsCopyModelToHeaders; /** Optional parameters. */ -export interface DocumentModelsListModelsOptionalParams - extends coreClient.OperationOptions {} +export interface DocumentModelsListModelsOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listModels operation. */ export type DocumentModelsListModelsResponse = GetDocumentModelsResponse; /** Optional parameters. */ -export interface DocumentModelsGetModelOptionalParams - extends coreClient.OperationOptions {} +export interface DocumentModelsGetModelOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getModel operation. */ export type DocumentModelsGetModelResponse = DocumentModelDetails; /** Optional parameters. */ -export interface DocumentModelsDeleteModelOptionalParams - extends coreClient.OperationOptions {} +export interface DocumentModelsDeleteModelOptionalParams extends coreClient.OperationOptions {} /** Optional parameters. */ -export interface DocumentModelsListModelsNextOptionalParams - extends coreClient.OperationOptions {} +export interface DocumentModelsListModelsNextOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listModelsNext operation. */ export type DocumentModelsListModelsNextResponse = GetDocumentModelsResponse; /** Optional parameters. */ -export interface MiscellaneousListOperationsOptionalParams - extends coreClient.OperationOptions {} +export interface MiscellaneousListOperationsOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the listOperations operation. */ export type MiscellaneousListOperationsResponse = GetOperationsResponse; /** Optional parameters. */ -export interface MiscellaneousGetOperationOptionalParams - extends coreClient.OperationOptions {} +export interface MiscellaneousGetOperationOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getOperation operation. */ export type MiscellaneousGetOperationResponse = OperationDetailsUnion; /** Optional parameters. */ -export interface MiscellaneousGetResourceInfoOptionalParams - extends coreClient.OperationOptions {} +export interface MiscellaneousGetResourceInfoOptionalParams extends coreClient.OperationOptions {} /** Contains response data for the getResourceInfo operation. */ export type MiscellaneousGetResourceInfoResponse = ResourceDetails; @@ -1322,7 +1304,8 @@ export interface DocumentClassifiersClassifyDocument$jsonOptionalParams } /** Contains response data for the classifyDocument operation. */ -export type DocumentClassifiersClassifyDocumentResponse = DocumentClassifiersClassifyDocumentHeaders; +export type DocumentClassifiersClassifyDocumentResponse = + DocumentClassifiersClassifyDocumentHeaders; /** Optional parameters. */ export interface DocumentClassifiersGetClassifyResultOptionalParams @@ -1339,8 +1322,7 @@ export interface DocumentClassifiersListClassifiersNextOptionalParams export type DocumentClassifiersListClassifiersNextResponse = GetDocumentClassifiersResponse; /** Optional parameters. */ -export interface GeneratedClientOptionalParams - extends coreClient.ServiceClientOptions { +export interface GeneratedClientOptionalParams extends coreClient.ServiceClientOptions { /** Method used to compute string offset and length. */ stringIndexType?: StringIndexType; /** Api Version */ diff --git a/sdk/formrecognizer/ai-form-recognizer/src/lro/analysis.ts b/sdk/formrecognizer/ai-form-recognizer/src/lro/analysis.ts index 5e74acede271..9f5b1cbfa030 100644 --- a/sdk/formrecognizer/ai-form-recognizer/src/lro/analysis.ts +++ b/sdk/formrecognizer/ai-form-recognizer/src/lro/analysis.ts @@ -12,7 +12,7 @@ import { DocumentStyle, } from "../generated"; import { DocumentField, toAnalyzedDocumentFieldsFromGenerated } from "../models/fields"; -import { FormRecognizerApiVersion, PollerOptions } from "../options"; +import { PollerOptions } from "../options"; import { AnalyzeDocumentOptions } from "../options/AnalyzeDocumentOptions"; import { toBoundingPolygon, @@ -102,7 +102,7 @@ export interface AnalyzeResultCommon { /** * The service API version used to produce this result. */ - apiVersion: FormRecognizerApiVersion; + apiVersion: string; /** * The unique ID of the model that was used to produce this result. @@ -372,7 +372,7 @@ export type AnalysisPoller> = PollerLik */ export function toAnalyzeResultFromGenerated(result: GeneratedAnalyzeResult): AnalyzeResult { return { - apiVersion: result.apiVersion as FormRecognizerApiVersion, + apiVersion: result.apiVersion, modelId: result.modelId, content: result.content, pages: result.pages.map((page) => toDocumentPageFromGenerated(page)), diff --git a/sdk/formrecognizer/ai-form-recognizer/src/models/contentSource.ts b/sdk/formrecognizer/ai-form-recognizer/src/models/contentSource.ts index c0688e79ca22..e201a3acaf6c 100644 --- a/sdk/formrecognizer/ai-form-recognizer/src/models/contentSource.ts +++ b/sdk/formrecognizer/ai-form-recognizer/src/models/contentSource.ts @@ -2,112 +2,68 @@ // Licensed under the MIT license. import { - BuildDocumentClassifierRequest, - BuildDocumentModelRequest, - ClassifierDocumentTypeDetails, - AzureBlobContentSource, - AzureBlobFileListContentSource, + AzureBlobContentSource as AzureBlobSourceDetails, + AzureBlobFileListContentSource as AzureBlobFileListSourceDetails, } from "../generated"; -export { AzureBlobContentSource, AzureBlobFileListContentSource }; +export { AzureBlobSourceDetails, AzureBlobFileListSourceDetails }; /** - * A content source that may be used to build a document model. - * - * One of: - * - AzureBlobContentSource - * - AzureBlobFileListContentSource + * A training data source defined by an Azure Blob Container. */ -export type DocumentModelContentSource = AzureBlobContentSource | AzureBlobFileListContentSource; +export interface AzureBlobSource { + /** + * The underlying details of the Azure Blob Source. + */ + azureBlobSource: AzureBlobSourceDetails; -/** - * A content source that may be used to build a document classifier. - * - * One of: - * - AzureBlobContentSource - * - AzureBlobFileListContentSource - */ -export type DocumentClassifierContentSource = - | AzureBlobContentSource - | AzureBlobFileListContentSource; + /** + * Must be undefined for a Blob Source. + */ + azureBlobFileListSource?: undefined; +} /** - * @param source - the content source to check - * @returns - true if the source is a valid AzureBlobContentSource - * @internal + * A training data source defined by an Azure Blob Container and a JSONL file list within the container. */ -export function isAzureBlobContentSource( - source: DocumentModelContentSource | DocumentClassifierContentSource -): source is AzureBlobContentSource { - return ( - (source as AzureBlobContentSource).containerUrl !== undefined && - (source as any).fileList === undefined && - // also check that if 'prefix' is provided it is a string - ((source as AzureBlobContentSource).prefix === undefined || - typeof (source as AzureBlobContentSource).prefix === "string") - ); +export interface AzureBlobFileListSource { + /** + * The underlying details of the Azure Blob File List Source. + */ + azureBlobFileListSource: AzureBlobFileListSourceDetails; + + /** + * Must be undefined for a Blob File List Source. + */ + azureBlobSource?: undefined; } /** - * @param source - the content source to check - * @returns - true if the source is a valid AzureBlobFileListContentSource - * @internal + * A content source that may be used to build a document model. + * + * One of: + * - BlobSource + * - BlobFileListSource */ -export function isAzureBlobFileListContentSource( - source: DocumentModelContentSource | DocumentClassifierContentSource -): source is AzureBlobFileListContentSource { - return ( - (source as AzureBlobFileListContentSource).containerUrl !== undefined && - (source as AzureBlobFileListContentSource).fileList !== undefined && - (source as AzureBlobContentSource).prefix === undefined - ); -} +export type DocumentModelSource = AzureBlobSource | AzureBlobFileListSource; /** - * @param source - a valid document model source - * @returns an object that can be used to provide the source when calling the document model build method - * @internal + * A content source that may be used to build a document classifier. + * + * One of: + * - BlobSource + * - BlobFileListSource */ -export function toBuildOptions( - source: DocumentModelContentSource -): Pick< - BuildDocumentModelRequest & BuildDocumentClassifierRequest, - "azureBlobFileListSource" | "azureBlobSource" -> { - if (isAzureBlobFileListContentSource(source)) { - return { - azureBlobFileListSource: source, - }; - } else if (isAzureBlobContentSource(source)) { - return { - azureBlobSource: source, - }; - } else { - throw new Error( - "Invalid document model content source: expected one of AzureBlobContentSource or AzureBlobFileListContentSource" - ); - } -} +export type DocumentClassifierSource = AzureBlobSource | AzureBlobFileListSource; /** - * @param source - a valid classifier source - * @returns a valid ClassifierDocumentTypeDetails object for use when calling the build classifier method - * @internal + * A set of sources used to create a document classifier. This is a map of + * document type names to sources that will be used to train the model to + * classify documents of the corresponding source type. */ -export function toClassifierDetails( - source: DocumentClassifierContentSource -): ClassifierDocumentTypeDetails { - if (isAzureBlobFileListContentSource(source)) { - return { - azureBlobFileListSource: source, - }; - } else if (isAzureBlobContentSource(source)) { - return { - azureBlobSource: source, - }; - } else { - throw new Error( - "Invalid classifier content source: expected one of AzureBlobContentSource or AzureBlobFileListContentSource" - ); - } +export interface DocumentClassifierDocumentTypeSources { + /** + * The training data source of a given document type name. + */ + [docType: string]: DocumentClassifierSource; } diff --git a/sdk/formrecognizer/ai-form-recognizer/src/models/index.ts b/sdk/formrecognizer/ai-form-recognizer/src/models/index.ts index e340d9ffa98b..e563c7833b35 100644 --- a/sdk/formrecognizer/ai-form-recognizer/src/models/index.ts +++ b/sdk/formrecognizer/ai-form-recognizer/src/models/index.ts @@ -40,8 +40,11 @@ export { } from "./documentElements"; export { - DocumentModelContentSource, - DocumentClassifierContentSource, - AzureBlobFileListContentSource, - AzureBlobContentSource, + DocumentModelSource, + DocumentClassifierSource, + DocumentClassifierDocumentTypeSources, + AzureBlobSource, + AzureBlobSourceDetails, + AzureBlobFileListSource, + AzureBlobFileListSourceDetails, } from "./contentSource"; diff --git a/sdk/formrecognizer/ai-form-recognizer/src/options/AnalyzeDocumentOptions.ts b/sdk/formrecognizer/ai-form-recognizer/src/options/AnalyzeDocumentOptions.ts index b9abd61034d4..644f3a03c8e2 100644 --- a/sdk/formrecognizer/ai-form-recognizer/src/options/AnalyzeDocumentOptions.ts +++ b/sdk/formrecognizer/ai-form-recognizer/src/options/AnalyzeDocumentOptions.ts @@ -21,6 +21,9 @@ export type FormRecognizerFeature = // eslint-disable-next-line @typescript-eslint/ban-types | (string & {}); +/** + * Known feature flags supported by the Form Recognizer clients. + */ // eslint-disable-next-line @typescript-eslint/no-redeclare export const FormRecognizerFeature = { /** @@ -83,5 +86,5 @@ export interface AnalyzeDocumentOptions * * For more information about the features available in Form Recognizer, see the service documentation: https://aka.ms/azsdk/formrecognizer/features */ - features?: string[]; + features?: FormRecognizerFeature[]; } diff --git a/sdk/formrecognizer/ai-form-recognizer/src/options/FormRecognizerClientOptions.ts b/sdk/formrecognizer/ai-form-recognizer/src/options/FormRecognizerClientOptions.ts index 386698984e56..a50cdf3e7255 100644 --- a/sdk/formrecognizer/ai-form-recognizer/src/options/FormRecognizerClientOptions.ts +++ b/sdk/formrecognizer/ai-form-recognizer/src/options/FormRecognizerClientOptions.ts @@ -3,37 +3,6 @@ import { CommonClientOptions } from "@azure/core-client"; -/** - * Valid values of the Form Recognizer service REST API version. - */ -export type FormRecognizerApiVersion = - (typeof FormRecognizerApiVersion)[keyof typeof FormRecognizerApiVersion]; - -/** - * Supported and common values of FormRecognizerApiVersion. - */ -// eslint-disable-next-line @typescript-eslint/no-redeclare -export const FormRecognizerApiVersion = { - /** - * The newest version of the service known to be supported by the client (default). - * - * If using a beta package version, this will be identical to the latest preview version. Otherwise, it will be - * identical to the latest stable version. - */ - Latest: "2023-07-31", - - /** - * The newest stable version of the service known to be supported by the package. This will be a Generally Available - * (GA) version, even if the package version is a beta. - */ - Stable: "2023-07-31", - - /** - * Form Recognizer API version 2022-08-31 (GA). - */ - "2022-08-31": "2022-08-31", -} as const; - /** * Valid string index types supported by the Form Recognizer service and SDK clients. */ @@ -61,28 +30,12 @@ export const StringIndexType = { */ export const DEFAULT_GENERATED_CLIENT_OPTIONS = { stringIndexType: StringIndexType.Utf16CodeUnit, - apiVersion: FormRecognizerApiVersion.Latest, } as const; -/** - * Configurable options for the Form Recognizer service clients (DocumentAnalysisClient and - * DocumentModelAdministrationClient). - */ -export interface FormRecognizerCommonClientOptions extends CommonClientOptions { - /** - * The version of the Form Recognizer REST API to call. Service versions 2.1 and lower (non-date-based versions) are - * not supported by this client. To use API version 2.1, please use version 3 of the Azure Form Recognizer SDK for - * JavaScript (\@azure/ai-form-recognizer\@^3.2.0). - * - * Default: FormRecognizerApiVersion.Stable ("2022-08-31") - */ - apiVersion?: FormRecognizerApiVersion; -} - /** * Configurable options for DocumentAnalysisClient. */ -export interface DocumentAnalysisClientOptions extends FormRecognizerCommonClientOptions { +export interface DocumentAnalysisClientOptions extends CommonClientOptions { /** * The unit of string offset/length values that the service returns. * @@ -97,5 +50,4 @@ export interface DocumentAnalysisClientOptions extends FormRecognizerCommonClien /** * Configurable options for DocumentModelAdministrationClient. */ -export interface DocumentModelAdministrationClientOptions - extends FormRecognizerCommonClientOptions {} +export interface DocumentModelAdministrationClientOptions extends CommonClientOptions {} diff --git a/sdk/formrecognizer/ai-form-recognizer/src/options/index.ts b/sdk/formrecognizer/ai-form-recognizer/src/options/index.ts index ff29edd84497..39baf6300fc6 100644 --- a/sdk/formrecognizer/ai-form-recognizer/src/options/index.ts +++ b/sdk/formrecognizer/ai-form-recognizer/src/options/index.ts @@ -14,8 +14,6 @@ import { DeleteDocumentModelOptions } from "./DeleteModelOptions"; import { DocumentAnalysisClientOptions, DocumentModelAdministrationClientOptions, - FormRecognizerApiVersion, - FormRecognizerCommonClientOptions, StringIndexType, } from "./FormRecognizerClientOptions"; import { GetCopyAuthorizationOptions } from "./GetCopyAuthorizationOptions"; @@ -38,7 +36,6 @@ export { CommonModelCreationOptions, BeginCopyModelOptions, DocumentModelBuildMode, - FormRecognizerCommonClientOptions, DocumentAnalysisClientOptions, DocumentModelAdministrationClientOptions, GetCopyAuthorizationOptions, @@ -50,7 +47,6 @@ export { ListOperationsOptions, PollerOptions, StringIndexType, - FormRecognizerApiVersion, BeginBuildDocumentClassifierOptions, ClassifyDocumentOptions, FormRecognizerFeature, diff --git a/sdk/formrecognizer/ai-form-recognizer/src/util.ts b/sdk/formrecognizer/ai-form-recognizer/src/util.ts index 4fc82462123d..7839af9a510f 100644 --- a/sdk/formrecognizer/ai-form-recognizer/src/util.ts +++ b/sdk/formrecognizer/ai-form-recognizer/src/util.ts @@ -4,7 +4,7 @@ import { KeyCredential, TokenCredential, isTokenCredential } from "@azure/core-auth"; import { bearerTokenAuthenticationPolicy } from "@azure/core-rest-pipeline"; import { createFormRecognizerAzureKeyCredentialPolicy } from "./azureKeyCredentialPolicy"; -import { DEFAULT_COGNITIVE_SCOPE } from "./constants"; +import { DEFAULT_COGNITIVE_SCOPE, FORM_RECOGNIZER_API_VERSION } from "./constants"; import { GeneratedClient, GeneratedClientOptionalParams } from "./generated"; import { DEFAULT_GENERATED_CLIENT_OPTIONS } from "./options/FormRecognizerClientOptions"; @@ -15,9 +15,6 @@ export { Mappers }; // This is used for URL request processing. export const SERIALIZER = createSerializer(Mappers, false); -/** @internal */ -export const identity = (x: T): T => x; - /** * Type-strong uncapitalization. * @internal @@ -59,6 +56,7 @@ export function makeServiceClient( const client = new GeneratedClient(endpoint?.replace(/\/$/, ""), { ...DEFAULT_GENERATED_CLIENT_OPTIONS, ...options, + apiVersion: FORM_RECOGNIZER_API_VERSION, }); const authPolicy = isTokenCredential(credential) diff --git a/sdk/formrecognizer/ai-form-recognizer/swagger/README.md b/sdk/formrecognizer/ai-form-recognizer/swagger/README.md index ac5fb5f79743..d09cd6f009ef 100644 --- a/sdk/formrecognizer/ai-form-recognizer/swagger/README.md +++ b/sdk/formrecognizer/ai-form-recognizer/swagger/README.md @@ -16,7 +16,7 @@ input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/sp override-client-name: GeneratedClient add-credentials: false typescript: true -package-version: "4.1.0" +package-version: "5.0.0" use-extension: "@autorest/typescript": "6.0.0-alpha.20.20220622.1" ``` @@ -90,13 +90,3 @@ directive: transform: > delete $["format"]; ``` - -### Mark `kind` optional - -```yaml -directive: - - from: swagger-document - where: $.definitions.DocumentPage - transform: > - $.required = $.required.filter((r) => r !== "kind"); -``` diff --git a/sdk/formrecognizer/ai-form-recognizer/test/public/node/classifiers.spec.ts b/sdk/formrecognizer/ai-form-recognizer/test/public/node/classifiers.spec.ts index 0f09b69f6a7a..920493d7552e 100644 --- a/sdk/formrecognizer/ai-form-recognizer/test/public/node/classifiers.spec.ts +++ b/sdk/formrecognizer/ai-form-recognizer/test/public/node/classifiers.spec.ts @@ -76,16 +76,14 @@ matrix([[true, false]] as const, async (useAad) => { { // TODO: use a different container for each test foo: { - // containerUrl: assertEnvironmentVariable( - // "FORM_RECOGNIZER_SELECTION_MARK_STORAGE_CONTAINER_SAS_URL" - // ), - containerUrl: containerSasUrl(), + azureBlobSource: { + containerUrl: containerSasUrl(), + }, }, bar: { - // containerUrl: assertEnvironmentVariable( - // "FORM_RECOGNIZER_SELECTION_MARK_STORAGE_CONTAINER_SAS_URL" - // ), - containerUrl: containerSasUrl(), + azureBlobSource: { + containerUrl: containerSasUrl(), + }, }, }, { ...testPollingOptions, description: customClassifierDescription } diff --git a/sdk/formrecognizer/perf-tests/ai-form-recognizer/package.json b/sdk/formrecognizer/perf-tests/ai-form-recognizer/package.json index 04dd1d0b02e6..e2769be1f043 100644 --- a/sdk/formrecognizer/perf-tests/ai-form-recognizer/package.json +++ b/sdk/formrecognizer/perf-tests/ai-form-recognizer/package.json @@ -9,7 +9,7 @@ "author": "", "license": "ISC", "dependencies": { - "@azure/ai-form-recognizer": "^4.0.0", + "@azure/ai-form-recognizer": "^5.0.0", "@azure/identity": "^2.0.1", "@azure/test-utils-perf": "^1.0.0", "@azure/core-util": "^1.3.1",