Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regenerated CS Computer Vision & Bumped Major Version #8976

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2019 Microsoft
Copyright (c) 2020 Microsoft

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@azure/cognitiveservices-computervision",
"author": "Microsoft Corporation",
"description": "ComputerVisionClient Library with typescript type definitions for node.js and browser.",
"version": "6.0.0",
"version": "7.0.0",
"dependencies": {
"@azure/ms-rest-js": "^2.0.4",
"tslib": "^1.10.0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -353,131 +353,65 @@ class ComputerVisionClient extends ComputerVisionClientContext {
callback) as Promise<Models.GetAreaOfInterestResponse>;
}

/**
* Recognize Text operation. When you use the Recognize Text interface, the response contains a
* field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must
* use for your Get Recognize Text Operation Result operation.
* @param mode Type of text to recognize. Possible values include: 'Handwritten', 'Printed'
* @param url Publicly reachable URL of an image.
* @param [options] The optional parameters
* @returns Promise<Models.RecognizeTextResponse>
*/
recognizeText(mode: Models.TextRecognitionMode, url: string, options?: msRest.RequestOptionsBase): Promise<Models.RecognizeTextResponse>;
/**
* @param mode Type of text to recognize. Possible values include: 'Handwritten', 'Printed'
* @param url Publicly reachable URL of an image.
* @param callback The callback
*/
recognizeText(mode: Models.TextRecognitionMode, url: string, callback: msRest.ServiceCallback<void>): void;
/**
* @param mode Type of text to recognize. Possible values include: 'Handwritten', 'Printed'
* @param url Publicly reachable URL of an image.
* @param options The optional parameters
* @param callback The callback
*/
recognizeText(mode: Models.TextRecognitionMode, url: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<void>): void;
recognizeText(mode: Models.TextRecognitionMode, url: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<Models.RecognizeTextResponse> {
return this.sendOperationRequest(
{
mode,
url,
options
},
recognizeTextOperationSpec,
callback) as Promise<Models.RecognizeTextResponse>;
}

/**
* This interface is used for getting text operation result. The URL to this interface should be
* retrieved from 'Operation-Location' field returned from Recognize Text interface.
* @param operationId Id of the text operation returned in the response of the 'Recognize Text'
* @param [options] The optional parameters
* @returns Promise<Models.GetTextOperationResultResponse>
*/
getTextOperationResult(operationId: string, options?: msRest.RequestOptionsBase): Promise<Models.GetTextOperationResultResponse>;
/**
* @param operationId Id of the text operation returned in the response of the 'Recognize Text'
* @param callback The callback
*/
getTextOperationResult(operationId: string, callback: msRest.ServiceCallback<Models.TextOperationResult>): void;
/**
* @param operationId Id of the text operation returned in the response of the 'Recognize Text'
* @param options The optional parameters
* @param callback The callback
*/
getTextOperationResult(operationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.TextOperationResult>): void;
getTextOperationResult(operationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.TextOperationResult>, callback?: msRest.ServiceCallback<Models.TextOperationResult>): Promise<Models.GetTextOperationResultResponse> {
return this.sendOperationRequest(
{
operationId,
options
},
getTextOperationResultOperationSpec,
callback) as Promise<Models.GetTextOperationResultResponse>;
}

/**
* Use this interface to get the result of a Read operation, employing the state-of-the-art Optical
* Character Recognition (OCR) algorithms optimized for text-heavy documents. When you use the Read
* File interface, the response contains a field called 'Operation-Location'. The
* 'Operation-Location' field contains the URL that you must use for your 'GetReadOperationResult'
* operation to access OCR results.​
* interface, the response contains a field called 'Operation-Location'. The 'Operation-Location'
* field contains the URL that you must use for your 'GetReadResult' operation to access OCR
* results.​
* @param url Publicly reachable URL of an image.
* @param [options] The optional parameters
* @returns Promise<Models.BatchReadFileResponse>
* @returns Promise<Models.ReadResponse>
*/
batchReadFile(url: string, options?: msRest.RequestOptionsBase): Promise<Models.BatchReadFileResponse>;
read(url: string, options?: Models.ComputerVisionClientReadOptionalParams): Promise<Models.ReadResponse>;
/**
* @param url Publicly reachable URL of an image.
* @param callback The callback
*/
batchReadFile(url: string, callback: msRest.ServiceCallback<void>): void;
read(url: string, callback: msRest.ServiceCallback<void>): void;
/**
* @param url Publicly reachable URL of an image.
* @param options The optional parameters
* @param callback The callback
*/
batchReadFile(url: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<void>): void;
batchReadFile(url: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<Models.BatchReadFileResponse> {
read(url: string, options: Models.ComputerVisionClientReadOptionalParams, callback: msRest.ServiceCallback<void>): void;
read(url: string, options?: Models.ComputerVisionClientReadOptionalParams | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<Models.ReadResponse> {
return this.sendOperationRequest(
{
url,
options
},
batchReadFileOperationSpec,
callback) as Promise<Models.BatchReadFileResponse>;
readOperationSpec,
callback) as Promise<Models.ReadResponse>;
}

/**
* This interface is used for getting OCR results of Read operation. The URL to this interface
* should be retrieved from 'Operation-Location' field returned from Batch Read File interface.
* @param operationId Id of read operation returned in the response of the 'Batch Read File'
* interface.
* should be retrieved from 'Operation-Location' field returned from Read interface.
* @param operationId Id of read operation returned in the response of the 'Read' interface.
* @param [options] The optional parameters
* @returns Promise<Models.GetReadOperationResultResponse>
* @returns Promise<Models.GetReadResultResponse>
*/
getReadOperationResult(operationId: string, options?: msRest.RequestOptionsBase): Promise<Models.GetReadOperationResultResponse>;
getReadResult(operationId: string, options?: msRest.RequestOptionsBase): Promise<Models.GetReadResultResponse>;
/**
* @param operationId Id of read operation returned in the response of the 'Batch Read File'
* interface.
* @param operationId Id of read operation returned in the response of the 'Read' interface.
* @param callback The callback
*/
getReadOperationResult(operationId: string, callback: msRest.ServiceCallback<Models.ReadOperationResult>): void;
getReadResult(operationId: string, callback: msRest.ServiceCallback<Models.ReadOperationResult>): void;
/**
* @param operationId Id of read operation returned in the response of the 'Batch Read File'
* interface.
* @param operationId Id of read operation returned in the response of the 'Read' interface.
* @param options The optional parameters
* @param callback The callback
*/
getReadOperationResult(operationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ReadOperationResult>): void;
getReadOperationResult(operationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ReadOperationResult>, callback?: msRest.ServiceCallback<Models.ReadOperationResult>): Promise<Models.GetReadOperationResultResponse> {
getReadResult(operationId: string, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<Models.ReadOperationResult>): void;
getReadResult(operationId: string, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<Models.ReadOperationResult>, callback?: msRest.ServiceCallback<Models.ReadOperationResult>): Promise<Models.GetReadResultResponse> {
return this.sendOperationRequest(
{
operationId,
options
},
getReadOperationResultOperationSpec,
callback) as Promise<Models.GetReadOperationResultResponse>;
getReadResultOperationSpec,
callback) as Promise<Models.GetReadResultResponse>;
}

/**
Expand Down Expand Up @@ -781,69 +715,35 @@ class ComputerVisionClient extends ComputerVisionClientContext {
}

/**
* Recognize Text operation. When you use the Recognize Text interface, the response contains a
* field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must
* use for your Get Recognize Text Operation Result operation.
* @param image An image stream.
* @param mode Type of text to recognize. Possible values include: 'Handwritten', 'Printed'
* @param [options] The optional parameters
* @returns Promise<Models.RecognizeTextInStreamResponse>
*/
recognizeTextInStream(image: msRest.HttpRequestBody, mode: Models.TextRecognitionMode, options?: msRest.RequestOptionsBase): Promise<Models.RecognizeTextInStreamResponse>;
/**
* @param image An image stream.
* @param mode Type of text to recognize. Possible values include: 'Handwritten', 'Printed'
* @param callback The callback
*/
recognizeTextInStream(image: msRest.HttpRequestBody, mode: Models.TextRecognitionMode, callback: msRest.ServiceCallback<void>): void;
/**
* @param image An image stream.
* @param mode Type of text to recognize. Possible values include: 'Handwritten', 'Printed'
* @param options The optional parameters
* @param callback The callback
*/
recognizeTextInStream(image: msRest.HttpRequestBody, mode: Models.TextRecognitionMode, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<void>): void;
recognizeTextInStream(image: msRest.HttpRequestBody, mode: Models.TextRecognitionMode, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<Models.RecognizeTextInStreamResponse> {
return this.sendOperationRequest(
{
image,
mode,
options
},
recognizeTextInStreamOperationSpec,
callback) as Promise<Models.RecognizeTextInStreamResponse>;
}

/**
* Use this interface to get the result of a Read Document operation, employing the
* state-of-the-art Optical Character Recognition (OCR) algorithms optimized for text-heavy
* documents. When you use the Read Document interface, the response contains a field called
* 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your
* 'Get Read Result operation' to access OCR results.​
* Use this interface to get the result of a Read operation, employing the state-of-the-art Optical
* Character Recognition (OCR) algorithms optimized for text-heavy documents. When you use the Read
* interface, the response contains a field called 'Operation-Location'. The 'Operation-Location'
* field contains the URL that you must use for your 'GetReadResult' operation to access OCR
* results.​
* @param image An image stream.
* @param [options] The optional parameters
* @returns Promise<Models.BatchReadFileInStreamResponse>
* @returns Promise<Models.ReadInStreamResponse>
*/
batchReadFileInStream(image: msRest.HttpRequestBody, options?: msRest.RequestOptionsBase): Promise<Models.BatchReadFileInStreamResponse>;
readInStream(image: msRest.HttpRequestBody, options?: Models.ComputerVisionClientReadInStreamOptionalParams): Promise<Models.ReadInStreamResponse>;
/**
* @param image An image stream.
* @param callback The callback
*/
batchReadFileInStream(image: msRest.HttpRequestBody, callback: msRest.ServiceCallback<void>): void;
readInStream(image: msRest.HttpRequestBody, callback: msRest.ServiceCallback<void>): void;
/**
* @param image An image stream.
* @param options The optional parameters
* @param callback The callback
*/
batchReadFileInStream(image: msRest.HttpRequestBody, options: msRest.RequestOptionsBase, callback: msRest.ServiceCallback<void>): void;
batchReadFileInStream(image: msRest.HttpRequestBody, options?: msRest.RequestOptionsBase | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<Models.BatchReadFileInStreamResponse> {
readInStream(image: msRest.HttpRequestBody, options: Models.ComputerVisionClientReadInStreamOptionalParams, callback: msRest.ServiceCallback<void>): void;
readInStream(image: msRest.HttpRequestBody, options?: Models.ComputerVisionClientReadInStreamOptionalParams | msRest.ServiceCallback<void>, callback?: msRest.ServiceCallback<void>): Promise<Models.ReadInStreamResponse> {
return this.sendOperationRequest(
{
image,
options
},
batchReadFileInStreamOperationSpec,
callback) as Promise<Models.BatchReadFileInStreamResponse>;
readInStreamOperationSpec,
callback) as Promise<Models.ReadInStreamResponse>;
}
}

Expand Down Expand Up @@ -1104,58 +1004,14 @@ const getAreaOfInterestOperationSpec: msRest.OperationSpec = {
serializer
};

const recognizeTextOperationSpec: msRest.OperationSpec = {
const readOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "recognizeText",
path: "read/analyze",
urlParameters: [
Parameters.endpoint
],
queryParameters: [
Parameters.mode
],
requestBody: {
parameterPath: {
url: "url"
},
mapper: {
...Mappers.ImageUrl,
required: true
}
},
responses: {
202: {
headersMapper: Mappers.RecognizeTextHeaders
},
default: {
bodyMapper: Mappers.ComputerVisionError
}
},
serializer
};

const getTextOperationResultOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "textOperations/{operationId}",
urlParameters: [
Parameters.endpoint,
Parameters.operationId
],
responses: {
200: {
bodyMapper: Mappers.TextOperationResult
},
default: {
bodyMapper: Mappers.ComputerVisionError
}
},
serializer
};

const batchReadFileOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "read/core/asyncBatchAnalyze",
urlParameters: [
Parameters.endpoint
Parameters.language0
],
requestBody: {
parameterPath: {
Expand All @@ -1168,18 +1024,19 @@ const batchReadFileOperationSpec: msRest.OperationSpec = {
},
responses: {
202: {
headersMapper: Mappers.BatchReadFileHeaders
headersMapper: Mappers.ReadHeaders
},
default: {
bodyMapper: Mappers.ComputerVisionError
bodyMapper: Mappers.ComputerVisionError,
headersMapper: Mappers.ReadHeaders
}
},
serializer
};

const getReadOperationResultOperationSpec: msRest.OperationSpec = {
const getReadResultOperationSpec: msRest.OperationSpec = {
httpMethod: "GET",
path: "read/operations/{operationId}",
path: "read/analyzeResults/{operationId}",
urlParameters: [
Parameters.endpoint,
Parameters.operationId
Expand Down Expand Up @@ -1449,42 +1306,14 @@ const tagImageInStreamOperationSpec: msRest.OperationSpec = {
serializer
};

const recognizeTextInStreamOperationSpec: msRest.OperationSpec = {
const readInStreamOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "recognizeText",
path: "read/analyze",
urlParameters: [
Parameters.endpoint
],
queryParameters: [
Parameters.mode
],
requestBody: {
parameterPath: "image",
mapper: {
required: true,
serializedName: "Image",
type: {
name: "Stream"
}
}
},
contentType: "application/octet-stream",
responses: {
202: {
headersMapper: Mappers.RecognizeTextInStreamHeaders
},
default: {
bodyMapper: Mappers.ComputerVisionError
}
},
serializer
};

const batchReadFileInStreamOperationSpec: msRest.OperationSpec = {
httpMethod: "POST",
path: "read/core/asyncBatchAnalyze",
urlParameters: [
Parameters.endpoint
Parameters.language0
],
requestBody: {
parameterPath: "image",
Expand All @@ -1499,10 +1328,11 @@ const batchReadFileInStreamOperationSpec: msRest.OperationSpec = {
contentType: "application/octet-stream",
responses: {
202: {
headersMapper: Mappers.BatchReadFileInStreamHeaders
headersMapper: Mappers.ReadInStreamHeaders
},
default: {
bodyMapper: Mappers.ComputerVisionError
bodyMapper: Mappers.ComputerVisionError,
headersMapper: Mappers.ReadInStreamHeaders
}
},
serializer
Expand Down
Loading