@azure/cognitiveservices-computervision
Advanced tools
Comparing version 5.0.0 to 6.0.0
@@ -1,1 +0,1 @@ | ||
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?a(exports,require("@azure/ms-rest-js")):"function"==typeof define&&define.amd?define(["exports","@azure/ms-rest-js"],a):a((e.Azure=e.Azure||{},e.Azure.CognitiveservicesComputervision={}),e.msRest)}(this,function(e,n){"use strict";var r=function(e,a){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,a){e.__proto__=a}||function(e,a){for(var t in a)a.hasOwnProperty(t)&&(e[t]=a[t])})(e,a)};function a(e,a){function t(){this.constructor=e}r(e,a),e.prototype=null===a?Object.create(a):(t.prototype=a.prototype,new t)}var s,t=function(){return(t=Object.assign||function(e){for(var a,t=1,r=arguments.length;t<r;t++)for(var i in a=arguments[t])Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i]);return e}).apply(this,arguments)},i=Object.freeze({}),m={serializedName:"ImageAnalysis",type:{name:"Composite",className:"ImageAnalysis",modelProperties:{categories:{nullable:!0,serializedName:"categories",type:{name:"Sequence",element:{type:{name:"Composite",className:"Category"}}}},adult:{serializedName:"adult",type:{name:"Composite",className:"AdultInfo"}},color:{serializedName:"color",type:{name:"Composite",className:"ColorInfo"}},imageType:{serializedName:"imageType",type:{name:"Composite",className:"ImageType"}},tags:{nullable:!0,serializedName:"tags",type:{name:"Sequence",element:{type:{name:"Composite",className:"ImageTag"}}}},description:{serializedName:"description",type:{name:"Composite",className:"ImageDescriptionDetails"}},faces:{nullable:!0,serializedName:"faces",type:{name:"Sequence",element:{type:{name:"Composite",className:"FaceDescription"}}}},objects:{nullable:!0,serializedName:"objects",type:{name:"Sequence",element:{type:{name:"Composite",className:"DetectedObject"}}}},brands:{nullable:!0,serializedName:"brands",type:{name:"Sequence",element:{type:{name:"Composite",className:"DetectedBrand"}}}},requestId:{nullable:!0,serializedName:"requestId",type:{name:"String"}},metadata:{serializedName:"metadata",type:{name:"Composite",className:"ImageMetadata"}}}}},l={serializedName:"ImageDescription",type:{name:"Composite",className:"ImageDescription",modelProperties:{tags:{nullable:!0,serializedName:"description.tags",type:{name:"Sequence",element:{type:{name:"String"}}}},captions:{nullable:!0,serializedName:"description.captions",type:{name:"Sequence",element:{type:{name:"Composite",className:"ImageCaption"}}}},requestId:{nullable:!0,serializedName:"requestId",type:{name:"String"}},metadata:{serializedName:"metadata",type:{name:"Composite",className:"ImageMetadata"}}}}},o={serializedName:"DetectResult",type:{name:"Composite",className:"DetectResult",modelProperties:{objects:{nullable:!0,readOnly:!0,serializedName:"objects",type:{name:"Sequence",element:{type:{name:"Composite",className:"DetectedObject"}}}},requestId:{nullable:!0,serializedName:"requestId",type:{name:"String"}},metadata:{serializedName:"metadata",type:{name:"Composite",className:"ImageMetadata"}}}}},p={serializedName:"ListModelsResult",type:{name:"Composite",className:"ListModelsResult",modelProperties:{modelsProperty:{nullable:!0,readOnly:!0,serializedName:"models",type:{name:"Sequence",element:{type:{name:"Composite",className:"ModelDescription"}}}}}}},d={serializedName:"DomainModelResults",type:{name:"Composite",className:"DomainModelResults",modelProperties:{result:{serializedName:"result",type:{name:"Object"}},requestId:{nullable:!0,serializedName:"requestId",type:{name:"String"}},metadata:{serializedName:"metadata",type:{name:"Composite",className:"ImageMetadata"}}}}},u={serializedName:"OcrResult",type:{name:"Composite",className:"OcrResult",modelProperties:{language:{nullable:!0,serializedName:"language",type:{name:"String"}},textAngle:{nullable:!1,serializedName:"textAngle",type:{name:"Number"}},orientation:{nullable:!0,serializedName:"orientation",type:{name:"String"}},regions:{nullable:!0,serializedName:"regions",type:{name:"Sequence",element:{type:{name:"Composite",className:"OcrRegion"}}}}}}},c={serializedName:"TagResult",type:{name:"Composite",className:"TagResult",modelProperties:{tags:{nullable:!0,serializedName:"tags",type:{name:"Sequence",element:{type:{name:"Composite",className:"ImageTag"}}}},requestId:{nullable:!0,serializedName:"requestId",type:{name:"String"}},metadata:{serializedName:"metadata",type:{name:"Composite",className:"ImageMetadata"}}}}},y={serializedName:"AreaOfInterestResult",type:{name:"Composite",className:"AreaOfInterestResult",modelProperties:{areaOfInterest:{readOnly:!0,serializedName:"areaOfInterest",type:{name:"Composite",className:"BoundingRect"}},requestId:{nullable:!0,serializedName:"requestId",type:{name:"String"}},metadata:{serializedName:"metadata",type:{name:"Composite",className:"ImageMetadata"}}}}},N={serializedName:"ImageUrl",type:{name:"Composite",className:"ImageUrl",modelProperties:{url:{required:!0,serializedName:"url",type:{name:"String"}}}}},g={serializedName:"ComputerVisionError",type:{name:"Composite",className:"ComputerVisionError",modelProperties:{code:{required:!0,serializedName:"code",type:{name:"Object"}},message:{required:!0,serializedName:"message",type:{name:"String"}},requestId:{serializedName:"requestId",type:{name:"String"}}}}},z={serializedName:"TextOperationResult",type:{name:"Composite",className:"TextOperationResult",modelProperties:{status:{nullable:!1,serializedName:"status",type:{name:"Enum",allowedValues:["NotStarted","Running","Failed","Succeeded"]}},recognitionResult:{serializedName:"recognitionResult",type:{name:"Composite",className:"TextRecognitionResult"}}}}},b={serializedName:"ReadOperationResult",type:{name:"Composite",className:"ReadOperationResult",modelProperties:{status:{nullable:!1,serializedName:"status",type:{name:"Enum",allowedValues:["NotStarted","Running","Failed","Succeeded"]}},recognitionResults:{serializedName:"recognitionResults",type:{name:"Sequence",element:{type:{name:"Composite",className:"TextRecognitionResult"}}}}}}},h={serializedName:"recognizetext-headers",type:{name:"Composite",className:"RecognizeTextHeaders",modelProperties:{operationLocation:{serializedName:"operation-location",type:{name:"String"}}}}},C={serializedName:"batchreadfile-headers",type:{name:"Composite",className:"BatchReadFileHeaders",modelProperties:{operationLocation:{serializedName:"operation-location",type:{name:"String"}}}}},P={serializedName:"recognizetextinstream-headers",type:{name:"Composite",className:"RecognizeTextInStreamHeaders",modelProperties:{operationLocation:{serializedName:"operation-location",type:{name:"String"}}}}},q={serializedName:"batchreadfileinstream-headers",type:{name:"Composite",className:"BatchReadFileInStreamHeaders",modelProperties:{operationLocation:{serializedName:"operation-location",type:{name:"String"}}}}},f=Object.freeze({FaceRectangle:{serializedName:"FaceRectangle",type:{name:"Composite",className:"FaceRectangle",modelProperties:{left:{nullable:!1,serializedName:"left",type:{name:"Number"}},top:{nullable:!1,serializedName:"top",type:{name:"Number"}},width:{nullable:!1,serializedName:"width",type:{name:"Number"}},height:{nullable:!1,serializedName:"height",type:{name:"Number"}}}}},CelebritiesModel:{serializedName:"CelebritiesModel",type:{name:"Composite",className:"CelebritiesModel",modelProperties:{name:{nullable:!0,serializedName:"name",type:{name:"String"}},confidence:{nullable:!1,serializedName:"confidence",type:{name:"Number"}},faceRectangle:{serializedName:"faceRectangle",type:{name:"Composite",className:"FaceRectangle"}}}}},LandmarksModel:{serializedName:"LandmarksModel",type:{name:"Composite",className:"LandmarksModel",modelProperties:{name:{nullable:!0,serializedName:"name",type:{name:"String"}},confidence:{nullable:!1,serializedName:"confidence",type:{name:"Number"}}}}},CategoryDetail:{serializedName:"CategoryDetail",type:{name:"Composite",className:"CategoryDetail",modelProperties:{celebrities:{nullable:!0,serializedName:"celebrities",type:{name:"Sequence",element:{type:{name:"Composite",className:"CelebritiesModel"}}}},landmarks:{nullable:!0,serializedName:"landmarks",type:{name:"Sequence",element:{type:{name:"Composite",className:"LandmarksModel"}}}}}}},Category:{serializedName:"Category",type:{name:"Composite",className:"Category",modelProperties:{name:{nullable:!0,serializedName:"name",type:{name:"String"}},score:{nullable:!1,serializedName:"score",type:{name:"Number"}},detail:{serializedName:"detail",type:{name:"Composite",className:"CategoryDetail"}}}}},AdultInfo:{serializedName:"AdultInfo",type:{name:"Composite",className:"AdultInfo",modelProperties:{isAdultContent:{nullable:!1,serializedName:"isAdultContent",type:{name:"Boolean"}},isRacyContent:{nullable:!1,serializedName:"isRacyContent",type:{name:"Boolean"}},adultScore:{nullable:!1,serializedName:"adultScore",type:{name:"Number"}},racyScore:{nullable:!1,serializedName:"racyScore",type:{name:"Number"}}}}},ColorInfo:{serializedName:"ColorInfo",type:{name:"Composite",className:"ColorInfo",modelProperties:{dominantColorForeground:{nullable:!0,serializedName:"dominantColorForeground",type:{name:"String"}},dominantColorBackground:{nullable:!0,serializedName:"dominantColorBackground",type:{name:"String"}},dominantColors:{nullable:!0,serializedName:"dominantColors",type:{name:"Sequence",element:{type:{name:"String"}}}},accentColor:{nullable:!0,serializedName:"accentColor",type:{name:"String"}},isBWImg:{nullable:!1,serializedName:"isBWImg",type:{name:"Boolean"}}}}},ImageType:{serializedName:"ImageType",type:{name:"Composite",className:"ImageType",modelProperties:{clipArtType:{nullable:!1,serializedName:"clipArtType",type:{name:"Number"}},lineDrawingType:{nullable:!1,serializedName:"lineDrawingType",type:{name:"Number"}}}}},ImageTag:{serializedName:"ImageTag",type:{name:"Composite",className:"ImageTag",modelProperties:{name:{nullable:!0,serializedName:"name",type:{name:"String"}},confidence:{nullable:!1,serializedName:"confidence",type:{name:"Number"}},hint:{nullable:!0,serializedName:"hint",type:{name:"String"}}}}},ImageCaption:{serializedName:"ImageCaption",type:{name:"Composite",className:"ImageCaption",modelProperties:{text:{nullable:!0,serializedName:"text",type:{name:"String"}},confidence:{nullable:!1,serializedName:"confidence",type:{name:"Number"}}}}},ImageDescriptionDetails:{serializedName:"ImageDescriptionDetails",type:{name:"Composite",className:"ImageDescriptionDetails",modelProperties:{tags:{nullable:!0,serializedName:"tags",type:{name:"Sequence",element:{type:{name:"String"}}}},captions:{nullable:!0,serializedName:"captions",type:{name:"Sequence",element:{type:{name:"Composite",className:"ImageCaption"}}}}}}},FaceDescription:{serializedName:"FaceDescription",type:{name:"Composite",className:"FaceDescription",modelProperties:{age:{nullable:!1,serializedName:"age",type:{name:"Number"}},gender:{nullable:!0,serializedName:"gender",type:{name:"Enum",allowedValues:["Male","Female"]}},faceRectangle:{serializedName:"faceRectangle",type:{name:"Composite",className:"FaceRectangle"}}}}},BoundingRect:{serializedName:"BoundingRect",type:{name:"Composite",className:"BoundingRect",modelProperties:{x:{nullable:!1,serializedName:"x",type:{name:"Number"}},y:{nullable:!1,serializedName:"y",type:{name:"Number"}},w:{nullable:!1,serializedName:"w",type:{name:"Number"}},h:{nullable:!1,serializedName:"h",type:{name:"Number"}}}}},ObjectHierarchy:{serializedName:"ObjectHierarchy",type:{name:"Composite",className:"ObjectHierarchy",modelProperties:{object:{nullable:!0,serializedName:"object",type:{name:"String"}},confidence:{nullable:!1,serializedName:"confidence",type:{name:"Number"}},parent:{serializedName:"parent",type:{name:"Composite",className:"ObjectHierarchy"}}}}},DetectedObject:{serializedName:"DetectedObject",type:{name:"Composite",className:"DetectedObject",modelProperties:{rectangle:{readOnly:!0,serializedName:"rectangle",type:{name:"Composite",className:"BoundingRect"}},object:{nullable:!0,serializedName:"object",type:{name:"String"}},confidence:{nullable:!1,serializedName:"confidence",type:{name:"Number"}},parent:{serializedName:"parent",type:{name:"Composite",className:"ObjectHierarchy"}}}}},DetectedBrand:{serializedName:"DetectedBrand",type:{name:"Composite",className:"DetectedBrand",modelProperties:{name:{nullable:!0,readOnly:!0,serializedName:"name",type:{name:"String"}},confidence:{nullable:!1,readOnly:!0,serializedName:"confidence",type:{name:"Number"}},rectangle:{readOnly:!0,serializedName:"rectangle",type:{name:"Composite",className:"BoundingRect"}}}}},ImageMetadata:{serializedName:"ImageMetadata",type:{name:"Composite",className:"ImageMetadata",modelProperties:{width:{nullable:!1,serializedName:"width",type:{name:"Number"}},height:{nullable:!1,serializedName:"height",type:{name:"Number"}},format:{nullable:!0,serializedName:"format",type:{name:"String"}}}}},ImageAnalysis:m,ImageDescription:l,DetectResult:o,ModelDescription:{serializedName:"ModelDescription",type:{name:"Composite",className:"ModelDescription",modelProperties:{name:{nullable:!0,serializedName:"name",type:{name:"String"}},categories:{nullable:!0,serializedName:"categories",type:{name:"Sequence",element:{type:{name:"String"}}}}}}},ListModelsResult:p,DomainModelResults:d,OcrWord:{serializedName:"OcrWord",type:{name:"Composite",className:"OcrWord",modelProperties:{boundingBox:{nullable:!0,serializedName:"boundingBox",type:{name:"String"}},text:{nullable:!0,serializedName:"text",type:{name:"String"}}}}},OcrLine:{serializedName:"OcrLine",type:{name:"Composite",className:"OcrLine",modelProperties:{boundingBox:{nullable:!0,serializedName:"boundingBox",type:{name:"String"}},words:{nullable:!0,serializedName:"words",type:{name:"Sequence",element:{type:{name:"Composite",className:"OcrWord"}}}}}}},OcrRegion:{serializedName:"OcrRegion",type:{name:"Composite",className:"OcrRegion",modelProperties:{boundingBox:{nullable:!0,serializedName:"boundingBox",type:{name:"String"}},lines:{nullable:!0,serializedName:"lines",type:{name:"Sequence",element:{type:{name:"Composite",className:"OcrLine"}}}}}}},OcrResult:u,TagResult:c,AreaOfInterestResult:y,ImageUrl:N,ComputerVisionError:g,LandmarkResults:{serializedName:"LandmarkResults",type:{name:"Composite",className:"LandmarkResults",modelProperties:{landmarks:{nullable:!0,serializedName:"landmarks",type:{name:"Sequence",element:{type:{name:"Composite",className:"LandmarksModel"}}}},requestId:{nullable:!0,serializedName:"requestId",type:{name:"String"}},metadata:{serializedName:"metadata",type:{name:"Composite",className:"ImageMetadata"}}}}},CelebrityResults:{serializedName:"CelebrityResults",type:{name:"Composite",className:"CelebrityResults",modelProperties:{celebrities:{nullable:!0,serializedName:"celebrities",type:{name:"Sequence",element:{type:{name:"Composite",className:"CelebritiesModel"}}}},requestId:{nullable:!0,serializedName:"requestId",type:{name:"String"}},metadata:{serializedName:"metadata",type:{name:"Composite",className:"ImageMetadata"}}}}},Word:{serializedName:"Word",type:{name:"Composite",className:"Word",modelProperties:{boundingBox:{required:!0,serializedName:"boundingBox",type:{name:"Sequence",element:{type:{name:"Number"}}}},text:{required:!0,serializedName:"text",type:{name:"String"}},confidence:{nullable:!0,serializedName:"confidence",type:{name:"Enum",allowedValues:["High","Low"]}}}}},Line:{serializedName:"Line",type:{name:"Composite",className:"Line",modelProperties:{boundingBox:{serializedName:"boundingBox",type:{name:"Sequence",element:{type:{name:"Number"}}}},text:{serializedName:"text",type:{name:"String"}},words:{serializedName:"words",type:{name:"Sequence",element:{type:{name:"Composite",className:"Word"}}}}}}},TextRecognitionResult:{serializedName:"TextRecognitionResult",type:{name:"Composite",className:"TextRecognitionResult",modelProperties:{page:{serializedName:"page",type:{name:"Number"}},clockwiseOrientation:{serializedName:"clockwiseOrientation",type:{name:"Number"}},width:{serializedName:"width",type:{name:"Number"}},height:{serializedName:"height",type:{name:"Number"}},unit:{nullable:!0,serializedName:"unit",type:{name:"Enum",allowedValues:["pixel","inch"]}},lines:{required:!0,serializedName:"lines",type:{name:"Sequence",element:{type:{name:"Composite",className:"Line"}}}}}}},TextOperationResult:z,ReadOperationResult:b,RecognizeTextHeaders:h,BatchReadFileHeaders:C,RecognizeTextInStreamHeaders:P,BatchReadFileInStreamHeaders:q}),S={parameterPath:["options","details"],mapper:{serializedName:"details",type:{name:"Sequence",element:{type:{name:"Enum",allowedValues:["Celebrities","Landmarks"]}}}},collectionFormat:n.QueryCollectionFormat.Csv},I={parameterPath:"detectOrientation",mapper:{required:!0,serializedName:"detectOrientation",defaultValue:!0,type:{name:"Boolean"}}},O={parameterPath:"endpoint",mapper:{required:!0,serializedName:"Endpoint",defaultValue:"",type:{name:"String"}},skipEncoding:!0},R={parameterPath:"height",mapper:{required:!0,serializedName:"height",constraints:{InclusiveMaximum:1024,InclusiveMinimum:1},type:{name:"Number"}}},M={parameterPath:["options","language"],mapper:{serializedName:"language",defaultValue:"en",type:{name:"String"}}},T={parameterPath:["options","language"],mapper:{serializedName:"language",defaultValue:"unk",type:{name:"Enum",allowedValues:["unk","zh-Hans","zh-Hant","cs","da","nl","en","fi","fr","de","el","hu","it","ja","ko","nb","pl","pt","ru","es","sv","tr","ar","ro","sr-Cyrl","sr-Latn","sk"]}}},B={parameterPath:["options","maxCandidates"],mapper:{serializedName:"maxCandidates",defaultValue:1,type:{name:"Number"}}},x={parameterPath:"mode",mapper:{required:!0,serializedName:"mode",type:{name:"Enum",allowedValues:["Handwritten","Printed"]}}},D={parameterPath:"model",mapper:{required:!0,serializedName:"model",type:{name:"String"}}},w={parameterPath:"operationId",mapper:{required:!0,serializedName:"operationId",type:{name:"String"}}},j={parameterPath:["options","smartCropping"],mapper:{serializedName:"smartCropping",defaultValue:!1,type:{name:"Boolean"}}},v={parameterPath:["options","visualFeatures"],mapper:{serializedName:"visualFeatures",type:{name:"Sequence",element:{type:{name:"Enum",allowedValues:["ImageType","Faces","Adult","Categories","Color","Tags","Description","Objects","Brands"]}}}},collectionFormat:n.QueryCollectionFormat.Csv},A={parameterPath:"width",mapper:{required:!0,serializedName:"width",constraints:{InclusiveMaximum:1024,InclusiveMinimum:1},type:{name:"Number"}}},F=(a(L,s=n.ServiceClient),L);function L(e,a,t){var r=this;if(null==a)throw new Error("'endpoint' cannot be null.");if(null==e)throw new Error("'credentials' cannot be null.");if(!(t=t||{}).userAgent){var i=n.getDefaultUserAgentValue();t.userAgent="@azure/cognitiveservices-computervision/5.0.0 "+i}return(r=s.call(this,e,t)||this).baseUri="{Endpoint}/vision/v2.0",r.requestContentType="application/json; charset=utf-8",r.endpoint=a,r.credentials=e,r}var V,k=(a(E,V=F),E.prototype.analyzeImage=function(e,a,t){return this.sendOperationRequest({url:e,options:a},W,t)},E.prototype.describeImage=function(e,a,t){return this.sendOperationRequest({url:e,options:a},_,t)},E.prototype.detectObjects=function(e,a,t){return this.sendOperationRequest({url:e,options:a},U,t)},E.prototype.listModels=function(e,a){return this.sendOperationRequest({options:e},G,a)},E.prototype.analyzeImageByDomain=function(e,a,t,r){return this.sendOperationRequest({model:e,url:a,options:t},Q,r)},E.prototype.recognizePrintedText=function(e,a,t,r){return this.sendOperationRequest({detectOrientation:e,url:a,options:t},J,r)},E.prototype.tagImage=function(e,a,t){return this.sendOperationRequest({url:e,options:a},K,t)},E.prototype.generateThumbnail=function(e,a,t,r,i){return this.sendOperationRequest({width:e,height:a,url:t,options:r},X,i)},E.prototype.getAreaOfInterest=function(e,a,t){return this.sendOperationRequest({url:e,options:a},Y,t)},E.prototype.recognizeText=function(e,a,t,r){return this.sendOperationRequest({mode:e,url:a,options:t},Z,r)},E.prototype.getTextOperationResult=function(e,a,t){return this.sendOperationRequest({operationId:e,options:a},$,t)},E.prototype.batchReadFile=function(e,a,t){return this.sendOperationRequest({url:e,options:a},ee,t)},E.prototype.getReadOperationResult=function(e,a,t){return this.sendOperationRequest({operationId:e,options:a},ae,t)},E.prototype.analyzeImageInStream=function(e,a,t){return this.sendOperationRequest({image:e,options:a},te,t)},E.prototype.getAreaOfInterestInStream=function(e,a,t){return this.sendOperationRequest({image:e,options:a},re,t)},E.prototype.describeImageInStream=function(e,a,t){return this.sendOperationRequest({image:e,options:a},ie,t)},E.prototype.detectObjectsInStream=function(e,a,t){return this.sendOperationRequest({image:e,options:a},ne,t)},E.prototype.generateThumbnailInStream=function(e,a,t,r,i){return this.sendOperationRequest({width:e,height:a,image:t,options:r},se,i)},E.prototype.analyzeImageByDomainInStream=function(e,a,t,r){return this.sendOperationRequest({model:e,image:a,options:t},me,r)},E.prototype.recognizePrintedTextInStream=function(e,a,t,r){return this.sendOperationRequest({detectOrientation:e,image:a,options:t},le,r)},E.prototype.tagImageInStream=function(e,a,t){return this.sendOperationRequest({image:e,options:a},oe,t)},E.prototype.recognizeTextInStream=function(e,a,t,r){return this.sendOperationRequest({image:e,mode:a,options:t},pe,r)},E.prototype.batchReadFileInStream=function(e,a,t){return this.sendOperationRequest({image:e,options:a},de,t)},E);function E(e,a,t){return V.call(this,e,a,t)||this}var H=new n.Serializer(f),W={httpMethod:"POST",path:"analyze",urlParameters:[O],queryParameters:[v,S,M],requestBody:{parameterPath:{url:"url"},mapper:t({},N,{required:!0})},responses:{200:{bodyMapper:m},default:{bodyMapper:g}},serializer:H},_={httpMethod:"POST",path:"describe",urlParameters:[O],queryParameters:[B,M],requestBody:{parameterPath:{url:"url"},mapper:t({},N,{required:!0})},responses:{200:{bodyMapper:l},default:{bodyMapper:g}},serializer:H},U={httpMethod:"POST",path:"detect",urlParameters:[O],requestBody:{parameterPath:{url:"url"},mapper:t({},N,{required:!0})},responses:{200:{bodyMapper:o},default:{bodyMapper:g}},serializer:H},G={httpMethod:"GET",path:"models",urlParameters:[O],responses:{200:{bodyMapper:p},default:{bodyMapper:g}},serializer:H},Q={httpMethod:"POST",path:"models/{model}/analyze",urlParameters:[O,D],queryParameters:[M],requestBody:{parameterPath:{url:"url"},mapper:t({},N,{required:!0})},responses:{200:{bodyMapper:d},default:{bodyMapper:g}},serializer:H},J={httpMethod:"POST",path:"ocr",urlParameters:[O],queryParameters:[I,T],requestBody:{parameterPath:{url:"url"},mapper:t({},N,{required:!0})},responses:{200:{bodyMapper:u},default:{bodyMapper:g}},serializer:H},K={httpMethod:"POST",path:"tag",urlParameters:[O],queryParameters:[M],requestBody:{parameterPath:{url:"url"},mapper:t({},N,{required:!0})},responses:{200:{bodyMapper:c},default:{bodyMapper:g}},serializer:H},X={httpMethod:"POST",path:"generateThumbnail",urlParameters:[O],queryParameters:[A,R,j],requestBody:{parameterPath:{url:"url"},mapper:t({},N,{required:!0})},responses:{200:{bodyMapper:{serializedName:"parsedResponse",type:{name:"Stream"}}},default:{}},serializer:H},Y={httpMethod:"POST",path:"areaOfInterest",urlParameters:[O],requestBody:{parameterPath:{url:"url"},mapper:t({},N,{required:!0})},responses:{200:{bodyMapper:y},default:{bodyMapper:g}},serializer:H},Z={httpMethod:"POST",path:"recognizeText",urlParameters:[O],queryParameters:[x],requestBody:{parameterPath:{url:"url"},mapper:t({},N,{required:!0})},responses:{202:{headersMapper:h},default:{bodyMapper:g}},serializer:H},$={httpMethod:"GET",path:"textOperations/{operationId}",urlParameters:[O,w],responses:{200:{bodyMapper:z},default:{bodyMapper:g}},serializer:H},ee={httpMethod:"POST",path:"read/core/asyncBatchAnalyze",urlParameters:[O],requestBody:{parameterPath:{url:"url"},mapper:t({},N,{required:!0})},responses:{202:{headersMapper:C},default:{bodyMapper:g}},serializer:H},ae={httpMethod:"GET",path:"read/operations/{operationId}",urlParameters:[O,w],responses:{200:{bodyMapper:b},default:{bodyMapper:g}},serializer:H},te={httpMethod:"POST",path:"analyze",urlParameters:[O],queryParameters:[v,S,M],requestBody:{parameterPath:"image",mapper:{required:!0,serializedName:"Image",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{200:{bodyMapper:m},default:{bodyMapper:g}},serializer:H},re={httpMethod:"POST",path:"areaOfInterest",urlParameters:[O],requestBody:{parameterPath:"image",mapper:{required:!0,serializedName:"Image",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{200:{bodyMapper:y},default:{bodyMapper:g}},serializer:H},ie={httpMethod:"POST",path:"describe",urlParameters:[O],queryParameters:[B,M],requestBody:{parameterPath:"image",mapper:{required:!0,serializedName:"Image",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{200:{bodyMapper:l},default:{bodyMapper:g}},serializer:H},ne={httpMethod:"POST",path:"detect",urlParameters:[O],requestBody:{parameterPath:"image",mapper:{required:!0,serializedName:"Image",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{200:{bodyMapper:o},default:{bodyMapper:g}},serializer:H},se={httpMethod:"POST",path:"generateThumbnail",urlParameters:[O],queryParameters:[A,R,j],requestBody:{parameterPath:"image",mapper:{required:!0,serializedName:"Image",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{200:{bodyMapper:{serializedName:"parsedResponse",type:{name:"Stream"}}},default:{}},serializer:H},me={httpMethod:"POST",path:"models/{model}/analyze",urlParameters:[O,D],queryParameters:[M],requestBody:{parameterPath:"image",mapper:{required:!0,serializedName:"Image",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{200:{bodyMapper:d},default:{bodyMapper:g}},serializer:H},le={httpMethod:"POST",path:"ocr",urlParameters:[O],queryParameters:[I,T],requestBody:{parameterPath:"image",mapper:{required:!0,serializedName:"Image",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{200:{bodyMapper:u},default:{bodyMapper:g}},serializer:H},oe={httpMethod:"POST",path:"tag",urlParameters:[O],queryParameters:[M],requestBody:{parameterPath:"image",mapper:{required:!0,serializedName:"Image",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{200:{bodyMapper:c},default:{bodyMapper:g}},serializer:H},pe={httpMethod:"POST",path:"recognizeText",urlParameters:[O],queryParameters:[x],requestBody:{parameterPath:"image",mapper:{required:!0,serializedName:"Image",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{202:{headersMapper:P},default:{bodyMapper:g}},serializer:H},de={httpMethod:"POST",path:"read/core/asyncBatchAnalyze",urlParameters:[O],requestBody:{parameterPath:"image",mapper:{required:!0,serializedName:"Image",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{202:{headersMapper:q},default:{bodyMapper:g}},serializer:H};e.ComputerVisionClient=k,e.ComputerVisionClientContext=F,e.ComputerVisionModels=i,e.ComputerVisionMappers=f,Object.defineProperty(e,"__esModule",{value:!0})}); | ||
!function(e,a){"object"==typeof exports&&"undefined"!=typeof module?a(exports,require("@azure/ms-rest-js")):"function"==typeof define&&define.amd?define(["exports","@azure/ms-rest-js"],a):a(((e=e||self).Azure=e.Azure||{},e.Azure.CognitiveservicesComputervision={}),e.msRest)}(this,function(e,n){"use strict";var r=function(e,a){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,a){e.__proto__=a}||function(e,a){for(var t in a)a.hasOwnProperty(t)&&(e[t]=a[t])})(e,a)};function a(e,a){function t(){this.constructor=e}r(e,a),e.prototype=null===a?Object.create(a):(t.prototype=a.prototype,new t)}var s,t=function(){return(t=Object.assign||function(e){for(var a,t=1,r=arguments.length;t<r;t++)for(var i in a=arguments[t])Object.prototype.hasOwnProperty.call(a,i)&&(e[i]=a[i]);return e}).apply(this,arguments)},i=Object.freeze({}),m={serializedName:"ImageAnalysis",type:{name:"Composite",className:"ImageAnalysis",modelProperties:{categories:{nullable:!0,serializedName:"categories",type:{name:"Sequence",element:{type:{name:"Composite",className:"Category"}}}},adult:{serializedName:"adult",type:{name:"Composite",className:"AdultInfo"}},color:{serializedName:"color",type:{name:"Composite",className:"ColorInfo"}},imageType:{serializedName:"imageType",type:{name:"Composite",className:"ImageType"}},tags:{nullable:!0,serializedName:"tags",type:{name:"Sequence",element:{type:{name:"Composite",className:"ImageTag"}}}},description:{serializedName:"description",type:{name:"Composite",className:"ImageDescriptionDetails"}},faces:{nullable:!0,serializedName:"faces",type:{name:"Sequence",element:{type:{name:"Composite",className:"FaceDescription"}}}},objects:{nullable:!0,serializedName:"objects",type:{name:"Sequence",element:{type:{name:"Composite",className:"DetectedObject"}}}},brands:{nullable:!0,serializedName:"brands",type:{name:"Sequence",element:{type:{name:"Composite",className:"DetectedBrand"}}}},requestId:{nullable:!0,serializedName:"requestId",type:{name:"String"}},metadata:{serializedName:"metadata",type:{name:"Composite",className:"ImageMetadata"}}}}},l={serializedName:"ImageDescription",type:{name:"Composite",className:"ImageDescription",modelProperties:{tags:{nullable:!0,serializedName:"description.tags",type:{name:"Sequence",element:{type:{name:"String"}}}},captions:{nullable:!0,serializedName:"description.captions",type:{name:"Sequence",element:{type:{name:"Composite",className:"ImageCaption"}}}},requestId:{nullable:!0,serializedName:"requestId",type:{name:"String"}},metadata:{serializedName:"metadata",type:{name:"Composite",className:"ImageMetadata"}}}}},o={serializedName:"DetectResult",type:{name:"Composite",className:"DetectResult",modelProperties:{objects:{nullable:!0,readOnly:!0,serializedName:"objects",type:{name:"Sequence",element:{type:{name:"Composite",className:"DetectedObject"}}}},requestId:{nullable:!0,serializedName:"requestId",type:{name:"String"}},metadata:{serializedName:"metadata",type:{name:"Composite",className:"ImageMetadata"}}}}},p={serializedName:"ListModelsResult",type:{name:"Composite",className:"ListModelsResult",modelProperties:{modelsProperty:{nullable:!0,readOnly:!0,serializedName:"models",type:{name:"Sequence",element:{type:{name:"Composite",className:"ModelDescription"}}}}}}},d={serializedName:"DomainModelResults",type:{name:"Composite",className:"DomainModelResults",modelProperties:{result:{serializedName:"result",type:{name:"Object"}},requestId:{nullable:!0,serializedName:"requestId",type:{name:"String"}},metadata:{serializedName:"metadata",type:{name:"Composite",className:"ImageMetadata"}}}}},u={serializedName:"OcrResult",type:{name:"Composite",className:"OcrResult",modelProperties:{language:{nullable:!0,serializedName:"language",type:{name:"String"}},textAngle:{nullable:!1,serializedName:"textAngle",type:{name:"Number"}},orientation:{nullable:!0,serializedName:"orientation",type:{name:"String"}},regions:{nullable:!0,serializedName:"regions",type:{name:"Sequence",element:{type:{name:"Composite",className:"OcrRegion"}}}}}}},c={serializedName:"TagResult",type:{name:"Composite",className:"TagResult",modelProperties:{tags:{nullable:!0,serializedName:"tags",type:{name:"Sequence",element:{type:{name:"Composite",className:"ImageTag"}}}},requestId:{nullable:!0,serializedName:"requestId",type:{name:"String"}},metadata:{serializedName:"metadata",type:{name:"Composite",className:"ImageMetadata"}}}}},y={serializedName:"AreaOfInterestResult",type:{name:"Composite",className:"AreaOfInterestResult",modelProperties:{areaOfInterest:{readOnly:!0,serializedName:"areaOfInterest",type:{name:"Composite",className:"BoundingRect"}},requestId:{nullable:!0,serializedName:"requestId",type:{name:"String"}},metadata:{serializedName:"metadata",type:{name:"Composite",className:"ImageMetadata"}}}}},N={serializedName:"ImageUrl",type:{name:"Composite",className:"ImageUrl",modelProperties:{url:{required:!0,serializedName:"url",type:{name:"String"}}}}},g={serializedName:"ComputerVisionError",type:{name:"Composite",className:"ComputerVisionError",modelProperties:{code:{required:!0,serializedName:"code",type:{name:"Object"}},message:{required:!0,serializedName:"message",type:{name:"String"}},requestId:{serializedName:"requestId",type:{name:"String"}}}}},z={serializedName:"TextOperationResult",type:{name:"Composite",className:"TextOperationResult",modelProperties:{status:{nullable:!1,serializedName:"status",type:{name:"Enum",allowedValues:["NotStarted","Running","Failed","Succeeded"]}},recognitionResult:{serializedName:"recognitionResult",type:{name:"Composite",className:"TextRecognitionResult"}}}}},b={serializedName:"ReadOperationResult",type:{name:"Composite",className:"ReadOperationResult",modelProperties:{status:{nullable:!1,serializedName:"status",type:{name:"Enum",allowedValues:["NotStarted","Running","Failed","Succeeded"]}},recognitionResults:{serializedName:"recognitionResults",type:{name:"Sequence",element:{type:{name:"Composite",className:"TextRecognitionResult"}}}}}}},h={serializedName:"recognizetext-headers",type:{name:"Composite",className:"RecognizeTextHeaders",modelProperties:{operationLocation:{serializedName:"operation-location",type:{name:"String"}}}}},C={serializedName:"batchreadfile-headers",type:{name:"Composite",className:"BatchReadFileHeaders",modelProperties:{operationLocation:{serializedName:"operation-location",type:{name:"String"}}}}},P={serializedName:"recognizetextinstream-headers",type:{name:"Composite",className:"RecognizeTextInStreamHeaders",modelProperties:{operationLocation:{serializedName:"operation-location",type:{name:"String"}}}}},q={serializedName:"batchreadfileinstream-headers",type:{name:"Composite",className:"BatchReadFileInStreamHeaders",modelProperties:{operationLocation:{serializedName:"operation-location",type:{name:"String"}}}}},f=Object.freeze({FaceRectangle:{serializedName:"FaceRectangle",type:{name:"Composite",className:"FaceRectangle",modelProperties:{left:{nullable:!1,serializedName:"left",type:{name:"Number"}},top:{nullable:!1,serializedName:"top",type:{name:"Number"}},width:{nullable:!1,serializedName:"width",type:{name:"Number"}},height:{nullable:!1,serializedName:"height",type:{name:"Number"}}}}},CelebritiesModel:{serializedName:"CelebritiesModel",type:{name:"Composite",className:"CelebritiesModel",modelProperties:{name:{nullable:!0,serializedName:"name",type:{name:"String"}},confidence:{nullable:!1,serializedName:"confidence",type:{name:"Number"}},faceRectangle:{serializedName:"faceRectangle",type:{name:"Composite",className:"FaceRectangle"}}}}},LandmarksModel:{serializedName:"LandmarksModel",type:{name:"Composite",className:"LandmarksModel",modelProperties:{name:{nullable:!0,serializedName:"name",type:{name:"String"}},confidence:{nullable:!1,serializedName:"confidence",type:{name:"Number"}}}}},CategoryDetail:{serializedName:"CategoryDetail",type:{name:"Composite",className:"CategoryDetail",modelProperties:{celebrities:{nullable:!0,serializedName:"celebrities",type:{name:"Sequence",element:{type:{name:"Composite",className:"CelebritiesModel"}}}},landmarks:{nullable:!0,serializedName:"landmarks",type:{name:"Sequence",element:{type:{name:"Composite",className:"LandmarksModel"}}}}}}},Category:{serializedName:"Category",type:{name:"Composite",className:"Category",modelProperties:{name:{nullable:!0,serializedName:"name",type:{name:"String"}},score:{nullable:!1,serializedName:"score",type:{name:"Number"}},detail:{serializedName:"detail",type:{name:"Composite",className:"CategoryDetail"}}}}},AdultInfo:{serializedName:"AdultInfo",type:{name:"Composite",className:"AdultInfo",modelProperties:{isAdultContent:{nullable:!1,serializedName:"isAdultContent",type:{name:"Boolean"}},isRacyContent:{nullable:!1,serializedName:"isRacyContent",type:{name:"Boolean"}},isGoryContent:{nullable:!1,serializedName:"isGoryContent",type:{name:"Boolean"}},adultScore:{nullable:!1,serializedName:"adultScore",type:{name:"Number"}},racyScore:{nullable:!1,serializedName:"racyScore",type:{name:"Number"}},goreScore:{nullable:!1,serializedName:"goreScore",type:{name:"Number"}}}}},ColorInfo:{serializedName:"ColorInfo",type:{name:"Composite",className:"ColorInfo",modelProperties:{dominantColorForeground:{nullable:!0,serializedName:"dominantColorForeground",type:{name:"String"}},dominantColorBackground:{nullable:!0,serializedName:"dominantColorBackground",type:{name:"String"}},dominantColors:{nullable:!0,serializedName:"dominantColors",type:{name:"Sequence",element:{type:{name:"String"}}}},accentColor:{nullable:!0,serializedName:"accentColor",type:{name:"String"}},isBWImg:{nullable:!1,serializedName:"isBWImg",type:{name:"Boolean"}}}}},ImageType:{serializedName:"ImageType",type:{name:"Composite",className:"ImageType",modelProperties:{clipArtType:{nullable:!1,serializedName:"clipArtType",type:{name:"Number"}},lineDrawingType:{nullable:!1,serializedName:"lineDrawingType",type:{name:"Number"}}}}},ImageTag:{serializedName:"ImageTag",type:{name:"Composite",className:"ImageTag",modelProperties:{name:{nullable:!0,serializedName:"name",type:{name:"String"}},confidence:{nullable:!1,serializedName:"confidence",type:{name:"Number"}},hint:{nullable:!0,serializedName:"hint",type:{name:"String"}}}}},ImageCaption:{serializedName:"ImageCaption",type:{name:"Composite",className:"ImageCaption",modelProperties:{text:{nullable:!0,serializedName:"text",type:{name:"String"}},confidence:{nullable:!1,serializedName:"confidence",type:{name:"Number"}}}}},ImageDescriptionDetails:{serializedName:"ImageDescriptionDetails",type:{name:"Composite",className:"ImageDescriptionDetails",modelProperties:{tags:{nullable:!0,serializedName:"tags",type:{name:"Sequence",element:{type:{name:"String"}}}},captions:{nullable:!0,serializedName:"captions",type:{name:"Sequence",element:{type:{name:"Composite",className:"ImageCaption"}}}}}}},FaceDescription:{serializedName:"FaceDescription",type:{name:"Composite",className:"FaceDescription",modelProperties:{age:{nullable:!1,serializedName:"age",type:{name:"Number"}},gender:{nullable:!0,serializedName:"gender",type:{name:"Enum",allowedValues:["Male","Female"]}},faceRectangle:{serializedName:"faceRectangle",type:{name:"Composite",className:"FaceRectangle"}}}}},BoundingRect:{serializedName:"BoundingRect",type:{name:"Composite",className:"BoundingRect",modelProperties:{x:{nullable:!1,serializedName:"x",type:{name:"Number"}},y:{nullable:!1,serializedName:"y",type:{name:"Number"}},w:{nullable:!1,serializedName:"w",type:{name:"Number"}},h:{nullable:!1,serializedName:"h",type:{name:"Number"}}}}},ObjectHierarchy:{serializedName:"ObjectHierarchy",type:{name:"Composite",className:"ObjectHierarchy",modelProperties:{object:{nullable:!0,serializedName:"object",type:{name:"String"}},confidence:{nullable:!1,serializedName:"confidence",type:{name:"Number"}},parent:{serializedName:"parent",type:{name:"Composite",className:"ObjectHierarchy"}}}}},DetectedObject:{serializedName:"DetectedObject",type:{name:"Composite",className:"DetectedObject",modelProperties:{rectangle:{readOnly:!0,serializedName:"rectangle",type:{name:"Composite",className:"BoundingRect"}},object:{nullable:!0,serializedName:"object",type:{name:"String"}},confidence:{nullable:!1,serializedName:"confidence",type:{name:"Number"}},parent:{serializedName:"parent",type:{name:"Composite",className:"ObjectHierarchy"}}}}},DetectedBrand:{serializedName:"DetectedBrand",type:{name:"Composite",className:"DetectedBrand",modelProperties:{name:{nullable:!0,readOnly:!0,serializedName:"name",type:{name:"String"}},confidence:{nullable:!1,readOnly:!0,serializedName:"confidence",type:{name:"Number"}},rectangle:{readOnly:!0,serializedName:"rectangle",type:{name:"Composite",className:"BoundingRect"}}}}},ImageMetadata:{serializedName:"ImageMetadata",type:{name:"Composite",className:"ImageMetadata",modelProperties:{width:{nullable:!1,serializedName:"width",type:{name:"Number"}},height:{nullable:!1,serializedName:"height",type:{name:"Number"}},format:{nullable:!0,serializedName:"format",type:{name:"String"}}}}},ImageAnalysis:m,ImageDescription:l,DetectResult:o,ModelDescription:{serializedName:"ModelDescription",type:{name:"Composite",className:"ModelDescription",modelProperties:{name:{nullable:!0,serializedName:"name",type:{name:"String"}},categories:{nullable:!0,serializedName:"categories",type:{name:"Sequence",element:{type:{name:"String"}}}}}}},ListModelsResult:p,DomainModelResults:d,OcrWord:{serializedName:"OcrWord",type:{name:"Composite",className:"OcrWord",modelProperties:{boundingBox:{nullable:!0,serializedName:"boundingBox",type:{name:"String"}},text:{nullable:!0,serializedName:"text",type:{name:"String"}}}}},OcrLine:{serializedName:"OcrLine",type:{name:"Composite",className:"OcrLine",modelProperties:{boundingBox:{nullable:!0,serializedName:"boundingBox",type:{name:"String"}},words:{nullable:!0,serializedName:"words",type:{name:"Sequence",element:{type:{name:"Composite",className:"OcrWord"}}}}}}},OcrRegion:{serializedName:"OcrRegion",type:{name:"Composite",className:"OcrRegion",modelProperties:{boundingBox:{nullable:!0,serializedName:"boundingBox",type:{name:"String"}},lines:{nullable:!0,serializedName:"lines",type:{name:"Sequence",element:{type:{name:"Composite",className:"OcrLine"}}}}}}},OcrResult:u,TagResult:c,AreaOfInterestResult:y,ImageUrl:N,ComputerVisionError:g,LandmarkResults:{serializedName:"LandmarkResults",type:{name:"Composite",className:"LandmarkResults",modelProperties:{landmarks:{nullable:!0,serializedName:"landmarks",type:{name:"Sequence",element:{type:{name:"Composite",className:"LandmarksModel"}}}},requestId:{nullable:!0,serializedName:"requestId",type:{name:"String"}},metadata:{serializedName:"metadata",type:{name:"Composite",className:"ImageMetadata"}}}}},CelebrityResults:{serializedName:"CelebrityResults",type:{name:"Composite",className:"CelebrityResults",modelProperties:{celebrities:{nullable:!0,serializedName:"celebrities",type:{name:"Sequence",element:{type:{name:"Composite",className:"CelebritiesModel"}}}},requestId:{nullable:!0,serializedName:"requestId",type:{name:"String"}},metadata:{serializedName:"metadata",type:{name:"Composite",className:"ImageMetadata"}}}}},Word:{serializedName:"Word",type:{name:"Composite",className:"Word",modelProperties:{boundingBox:{required:!0,serializedName:"boundingBox",type:{name:"Sequence",element:{type:{name:"Number"}}}},text:{required:!0,serializedName:"text",type:{name:"String"}},confidence:{nullable:!0,serializedName:"confidence",type:{name:"Enum",allowedValues:["High","Low"]}}}}},Line:{serializedName:"Line",type:{name:"Composite",className:"Line",modelProperties:{boundingBox:{serializedName:"boundingBox",type:{name:"Sequence",element:{type:{name:"Number"}}}},text:{serializedName:"text",type:{name:"String"}},words:{serializedName:"words",type:{name:"Sequence",element:{type:{name:"Composite",className:"Word"}}}}}}},TextRecognitionResult:{serializedName:"TextRecognitionResult",type:{name:"Composite",className:"TextRecognitionResult",modelProperties:{page:{serializedName:"page",type:{name:"Number"}},clockwiseOrientation:{serializedName:"clockwiseOrientation",type:{name:"Number"}},width:{serializedName:"width",type:{name:"Number"}},height:{serializedName:"height",type:{name:"Number"}},unit:{nullable:!0,serializedName:"unit",type:{name:"Enum",allowedValues:["pixel","inch"]}},lines:{required:!0,serializedName:"lines",type:{name:"Sequence",element:{type:{name:"Composite",className:"Line"}}}}}}},TextOperationResult:z,ReadOperationResult:b,RecognizeTextHeaders:h,BatchReadFileHeaders:C,RecognizeTextInStreamHeaders:P,BatchReadFileInStreamHeaders:q}),S={parameterPath:["options","descriptionExclude"],mapper:{serializedName:"descriptionExclude",type:{name:"Sequence",element:{type:{name:"Enum",allowedValues:["Celebrities","Landmarks"]}}}},collectionFormat:n.QueryCollectionFormat.Csv},I={parameterPath:["options","details"],mapper:{serializedName:"details",type:{name:"Sequence",element:{type:{name:"Enum",allowedValues:["Celebrities","Landmarks"]}}}},collectionFormat:n.QueryCollectionFormat.Csv},O={parameterPath:"detectOrientation",mapper:{required:!0,serializedName:"detectOrientation",defaultValue:!0,type:{name:"Boolean"}}},R={parameterPath:"endpoint",mapper:{required:!0,serializedName:"Endpoint",defaultValue:"",type:{name:"String"}},skipEncoding:!0},M={parameterPath:"height",mapper:{required:!0,serializedName:"height",constraints:{InclusiveMaximum:1024,InclusiveMinimum:1},type:{name:"Number"}}},T={parameterPath:["options","language"],mapper:{serializedName:"language",defaultValue:"en",type:{name:"String"}}},B={parameterPath:["options","language"],mapper:{serializedName:"language",defaultValue:"unk",type:{name:"Enum",allowedValues:["unk","zh-Hans","zh-Hant","cs","da","nl","en","fi","fr","de","el","hu","it","ja","ko","nb","pl","pt","ru","es","sv","tr","ar","ro","sr-Cyrl","sr-Latn","sk"]}}},x={parameterPath:["options","maxCandidates"],mapper:{serializedName:"maxCandidates",defaultValue:1,type:{name:"Number"}}},D={parameterPath:"mode",mapper:{required:!0,serializedName:"mode",type:{name:"Enum",allowedValues:["Handwritten","Printed"]}}},w={parameterPath:"model",mapper:{required:!0,serializedName:"model",type:{name:"String"}}},j={parameterPath:"operationId",mapper:{required:!0,serializedName:"operationId",type:{name:"String"}}},v={parameterPath:["options","smartCropping"],mapper:{serializedName:"smartCropping",defaultValue:!1,type:{name:"Boolean"}}},F={parameterPath:["options","visualFeatures"],mapper:{serializedName:"visualFeatures",type:{name:"Sequence",element:{type:{name:"Enum",allowedValues:["ImageType","Faces","Adult","Categories","Color","Tags","Description","Objects","Brands"]}}}},collectionFormat:n.QueryCollectionFormat.Csv},A={parameterPath:"width",mapper:{required:!0,serializedName:"width",constraints:{InclusiveMaximum:1024,InclusiveMinimum:1},type:{name:"Number"}}},L=(a(V,s=n.ServiceClient),V);function V(e,a,t){var r=this;if(null==a)throw new Error("'endpoint' cannot be null.");if(null==e)throw new Error("'credentials' cannot be null.");if(!(t=t||{}).userAgent){var i=n.getDefaultUserAgentValue();t.userAgent="@azure/cognitiveservices-computervision/6.0.0 "+i}return(r=s.call(this,e,t)||this).baseUri="{Endpoint}/vision/v2.1",r.requestContentType="application/json; charset=utf-8",r.endpoint=a,r.credentials=e,r}var k,E=(a(H,k=L),H.prototype.analyzeImage=function(e,a,t){return this.sendOperationRequest({url:e,options:a},_,t)},H.prototype.describeImage=function(e,a,t){return this.sendOperationRequest({url:e,options:a},G,t)},H.prototype.detectObjects=function(e,a,t){return this.sendOperationRequest({url:e,options:a},U,t)},H.prototype.listModels=function(e,a){return this.sendOperationRequest({options:e},Q,a)},H.prototype.analyzeImageByDomain=function(e,a,t,r){return this.sendOperationRequest({model:e,url:a,options:t},J,r)},H.prototype.recognizePrintedText=function(e,a,t,r){return this.sendOperationRequest({detectOrientation:e,url:a,options:t},K,r)},H.prototype.tagImage=function(e,a,t){return this.sendOperationRequest({url:e,options:a},X,t)},H.prototype.generateThumbnail=function(e,a,t,r,i){return this.sendOperationRequest({width:e,height:a,url:t,options:r},Y,i)},H.prototype.getAreaOfInterest=function(e,a,t){return this.sendOperationRequest({url:e,options:a},Z,t)},H.prototype.recognizeText=function(e,a,t,r){return this.sendOperationRequest({mode:e,url:a,options:t},$,r)},H.prototype.getTextOperationResult=function(e,a,t){return this.sendOperationRequest({operationId:e,options:a},ee,t)},H.prototype.batchReadFile=function(e,a,t){return this.sendOperationRequest({url:e,options:a},ae,t)},H.prototype.getReadOperationResult=function(e,a,t){return this.sendOperationRequest({operationId:e,options:a},te,t)},H.prototype.analyzeImageInStream=function(e,a,t){return this.sendOperationRequest({image:e,options:a},re,t)},H.prototype.getAreaOfInterestInStream=function(e,a,t){return this.sendOperationRequest({image:e,options:a},ie,t)},H.prototype.describeImageInStream=function(e,a,t){return this.sendOperationRequest({image:e,options:a},ne,t)},H.prototype.detectObjectsInStream=function(e,a,t){return this.sendOperationRequest({image:e,options:a},se,t)},H.prototype.generateThumbnailInStream=function(e,a,t,r,i){return this.sendOperationRequest({width:e,height:a,image:t,options:r},me,i)},H.prototype.analyzeImageByDomainInStream=function(e,a,t,r){return this.sendOperationRequest({model:e,image:a,options:t},le,r)},H.prototype.recognizePrintedTextInStream=function(e,a,t,r){return this.sendOperationRequest({detectOrientation:e,image:a,options:t},oe,r)},H.prototype.tagImageInStream=function(e,a,t){return this.sendOperationRequest({image:e,options:a},pe,t)},H.prototype.recognizeTextInStream=function(e,a,t,r){return this.sendOperationRequest({image:e,mode:a,options:t},de,r)},H.prototype.batchReadFileInStream=function(e,a,t){return this.sendOperationRequest({image:e,options:a},ue,t)},H);function H(e,a,t){return k.call(this,e,a,t)||this}var W=new n.Serializer(f),_={httpMethod:"POST",path:"analyze",urlParameters:[R],queryParameters:[F,I,T,S],requestBody:{parameterPath:{url:"url"},mapper:t(t({},N),{required:!0})},responses:{200:{bodyMapper:m},default:{bodyMapper:g}},serializer:W},G={httpMethod:"POST",path:"describe",urlParameters:[R],queryParameters:[x,T,S],requestBody:{parameterPath:{url:"url"},mapper:t(t({},N),{required:!0})},responses:{200:{bodyMapper:l},default:{bodyMapper:g}},serializer:W},U={httpMethod:"POST",path:"detect",urlParameters:[R],requestBody:{parameterPath:{url:"url"},mapper:t(t({},N),{required:!0})},responses:{200:{bodyMapper:o},default:{bodyMapper:g}},serializer:W},Q={httpMethod:"GET",path:"models",urlParameters:[R],responses:{200:{bodyMapper:p},default:{bodyMapper:g}},serializer:W},J={httpMethod:"POST",path:"models/{model}/analyze",urlParameters:[R,w],queryParameters:[T],requestBody:{parameterPath:{url:"url"},mapper:t(t({},N),{required:!0})},responses:{200:{bodyMapper:d},default:{bodyMapper:g}},serializer:W},K={httpMethod:"POST",path:"ocr",urlParameters:[R],queryParameters:[O,B],requestBody:{parameterPath:{url:"url"},mapper:t(t({},N),{required:!0})},responses:{200:{bodyMapper:u},default:{bodyMapper:g}},serializer:W},X={httpMethod:"POST",path:"tag",urlParameters:[R],queryParameters:[T],requestBody:{parameterPath:{url:"url"},mapper:t(t({},N),{required:!0})},responses:{200:{bodyMapper:c},default:{bodyMapper:g}},serializer:W},Y={httpMethod:"POST",path:"generateThumbnail",urlParameters:[R],queryParameters:[A,M,v],requestBody:{parameterPath:{url:"url"},mapper:t(t({},N),{required:!0})},responses:{200:{bodyMapper:{serializedName:"parsedResponse",type:{name:"Stream"}}},default:{}},serializer:W},Z={httpMethod:"POST",path:"areaOfInterest",urlParameters:[R],requestBody:{parameterPath:{url:"url"},mapper:t(t({},N),{required:!0})},responses:{200:{bodyMapper:y},default:{bodyMapper:g}},serializer:W},$={httpMethod:"POST",path:"recognizeText",urlParameters:[R],queryParameters:[D],requestBody:{parameterPath:{url:"url"},mapper:t(t({},N),{required:!0})},responses:{202:{headersMapper:h},default:{bodyMapper:g}},serializer:W},ee={httpMethod:"GET",path:"textOperations/{operationId}",urlParameters:[R,j],responses:{200:{bodyMapper:z},default:{bodyMapper:g}},serializer:W},ae={httpMethod:"POST",path:"read/core/asyncBatchAnalyze",urlParameters:[R],requestBody:{parameterPath:{url:"url"},mapper:t(t({},N),{required:!0})},responses:{202:{headersMapper:C},default:{bodyMapper:g}},serializer:W},te={httpMethod:"GET",path:"read/operations/{operationId}",urlParameters:[R,j],responses:{200:{bodyMapper:b},default:{bodyMapper:g}},serializer:W},re={httpMethod:"POST",path:"analyze",urlParameters:[R],queryParameters:[F,I,T,S],requestBody:{parameterPath:"image",mapper:{required:!0,serializedName:"Image",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{200:{bodyMapper:m},default:{bodyMapper:g}},serializer:W},ie={httpMethod:"POST",path:"areaOfInterest",urlParameters:[R],requestBody:{parameterPath:"image",mapper:{required:!0,serializedName:"Image",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{200:{bodyMapper:y},default:{bodyMapper:g}},serializer:W},ne={httpMethod:"POST",path:"describe",urlParameters:[R],queryParameters:[x,T,S],requestBody:{parameterPath:"image",mapper:{required:!0,serializedName:"Image",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{200:{bodyMapper:l},default:{bodyMapper:g}},serializer:W},se={httpMethod:"POST",path:"detect",urlParameters:[R],requestBody:{parameterPath:"image",mapper:{required:!0,serializedName:"Image",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{200:{bodyMapper:o},default:{bodyMapper:g}},serializer:W},me={httpMethod:"POST",path:"generateThumbnail",urlParameters:[R],queryParameters:[A,M,v],requestBody:{parameterPath:"image",mapper:{required:!0,serializedName:"Image",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{200:{bodyMapper:{serializedName:"parsedResponse",type:{name:"Stream"}}},default:{}},serializer:W},le={httpMethod:"POST",path:"models/{model}/analyze",urlParameters:[R,w],queryParameters:[T],requestBody:{parameterPath:"image",mapper:{required:!0,serializedName:"Image",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{200:{bodyMapper:d},default:{bodyMapper:g}},serializer:W},oe={httpMethod:"POST",path:"ocr",urlParameters:[R],queryParameters:[O,B],requestBody:{parameterPath:"image",mapper:{required:!0,serializedName:"Image",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{200:{bodyMapper:u},default:{bodyMapper:g}},serializer:W},pe={httpMethod:"POST",path:"tag",urlParameters:[R],queryParameters:[T],requestBody:{parameterPath:"image",mapper:{required:!0,serializedName:"Image",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{200:{bodyMapper:c},default:{bodyMapper:g}},serializer:W},de={httpMethod:"POST",path:"recognizeText",urlParameters:[R],queryParameters:[D],requestBody:{parameterPath:"image",mapper:{required:!0,serializedName:"Image",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{202:{headersMapper:P},default:{bodyMapper:g}},serializer:W},ue={httpMethod:"POST",path:"read/core/asyncBatchAnalyze",urlParameters:[R],requestBody:{parameterPath:"image",mapper:{required:!0,serializedName:"Image",type:{name:"Stream"}}},contentType:"application/octet-stream",responses:{202:{headersMapper:q},default:{bodyMapper:g}},serializer:W};e.ComputerVisionClient=E,e.ComputerVisionClientContext=L,e.ComputerVisionMappers=f,e.ComputerVisionModels=i,Object.defineProperty(e,"__esModule",{value:!0})}); |
@@ -40,3 +40,4 @@ import * as msRest from "@azure/ms-rest-js"; | ||
* the operation. More than one description can be generated for each image. Descriptions are | ||
* ordered by their confidence score. All descriptions are in English. | ||
* ordered by their confidence score. Descriptions may include results from celebrity and landmark | ||
* domain models, if applicable. | ||
* Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. | ||
@@ -166,4 +167,4 @@ * A successful response will be returned in JSON. If the request failed, the response will contain | ||
* hierarchical classification system, but correspond to image content. Tags may contain hints to | ||
* avoid ambiguity or provide context, for example the tag "cello" may be accompanied by the hint | ||
* "musical instrument". All tags are in English. | ||
* avoid ambiguity or provide context, for example the tag "ascomycete" may be accompanied by the | ||
* hint "fungus". | ||
* Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. | ||
@@ -385,3 +386,4 @@ * A successful response will be returned in JSON. If the request failed, the response will contain | ||
* the operation. More than one description can be generated for each image. Descriptions are | ||
* ordered by their confidence score. All descriptions are in English. | ||
* ordered by their confidence score. Descriptions may include results from celebrity and landmark | ||
* domain models, if applicable. | ||
* Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. | ||
@@ -530,4 +532,4 @@ * A successful response will be returned in JSON. If the request failed, the response will contain | ||
* hierarchical classification system, but correspond to image content. Tags may contain hints to | ||
* avoid ambiguity or provide context, for example the tag "cello" may be accompanied by the hint | ||
* "musical instrument". All tags are in English. | ||
* avoid ambiguity or provide context, for example the tag "ascomycete" may be accompanied by the | ||
* hint "fungus". | ||
* Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. | ||
@@ -534,0 +536,0 @@ * A successful response will be returned in JSON. If the request failed, the response will contain |
@@ -10,3 +10,3 @@ /* | ||
*/ | ||
import * as tslib_1 from "tslib"; | ||
import { __assign, __extends } from "tslib"; | ||
import * as msRest from "@azure/ms-rest-js"; | ||
@@ -18,3 +18,3 @@ import * as Models from "./models"; | ||
var ComputerVisionClient = /** @class */ (function (_super) { | ||
tslib_1.__extends(ComputerVisionClient, _super); | ||
__extends(ComputerVisionClient, _super); | ||
/** | ||
@@ -189,3 +189,4 @@ * Initializes a new instance of the ComputerVisionClient class. | ||
Parameters.details, | ||
Parameters.language0 | ||
Parameters.language0, | ||
Parameters.descriptionExclude | ||
], | ||
@@ -196,3 +197,3 @@ requestBody: { | ||
}, | ||
mapper: tslib_1.__assign({}, Mappers.ImageUrl, { required: true }) | ||
mapper: __assign(__assign({}, Mappers.ImageUrl), { required: true }) | ||
}, | ||
@@ -217,3 +218,4 @@ responses: { | ||
Parameters.maxCandidates, | ||
Parameters.language0 | ||
Parameters.language0, | ||
Parameters.descriptionExclude | ||
], | ||
@@ -224,3 +226,3 @@ requestBody: { | ||
}, | ||
mapper: tslib_1.__assign({}, Mappers.ImageUrl, { required: true }) | ||
mapper: __assign(__assign({}, Mappers.ImageUrl), { required: true }) | ||
}, | ||
@@ -247,3 +249,3 @@ responses: { | ||
}, | ||
mapper: tslib_1.__assign({}, Mappers.ImageUrl, { required: true }) | ||
mapper: __assign(__assign({}, Mappers.ImageUrl), { required: true }) | ||
}, | ||
@@ -290,3 +292,3 @@ responses: { | ||
}, | ||
mapper: tslib_1.__assign({}, Mappers.ImageUrl, { required: true }) | ||
mapper: __assign(__assign({}, Mappers.ImageUrl), { required: true }) | ||
}, | ||
@@ -317,3 +319,3 @@ responses: { | ||
}, | ||
mapper: tslib_1.__assign({}, Mappers.ImageUrl, { required: true }) | ||
mapper: __assign(__assign({}, Mappers.ImageUrl), { required: true }) | ||
}, | ||
@@ -343,3 +345,3 @@ responses: { | ||
}, | ||
mapper: tslib_1.__assign({}, Mappers.ImageUrl, { required: true }) | ||
mapper: __assign(__assign({}, Mappers.ImageUrl), { required: true }) | ||
}, | ||
@@ -371,3 +373,3 @@ responses: { | ||
}, | ||
mapper: tslib_1.__assign({}, Mappers.ImageUrl, { required: true }) | ||
mapper: __assign(__assign({}, Mappers.ImageUrl), { required: true }) | ||
}, | ||
@@ -397,3 +399,3 @@ responses: { | ||
}, | ||
mapper: tslib_1.__assign({}, Mappers.ImageUrl, { required: true }) | ||
mapper: __assign(__assign({}, Mappers.ImageUrl), { required: true }) | ||
}, | ||
@@ -423,3 +425,3 @@ responses: { | ||
}, | ||
mapper: tslib_1.__assign({}, Mappers.ImageUrl, { required: true }) | ||
mapper: __assign(__assign({}, Mappers.ImageUrl), { required: true }) | ||
}, | ||
@@ -463,3 +465,3 @@ responses: { | ||
}, | ||
mapper: tslib_1.__assign({}, Mappers.ImageUrl, { required: true }) | ||
mapper: __assign(__assign({}, Mappers.ImageUrl), { required: true }) | ||
}, | ||
@@ -502,3 +504,4 @@ responses: { | ||
Parameters.details, | ||
Parameters.language0 | ||
Parameters.language0, | ||
Parameters.descriptionExclude | ||
], | ||
@@ -561,3 +564,4 @@ requestBody: { | ||
Parameters.maxCandidates, | ||
Parameters.language0 | ||
Parameters.language0, | ||
Parameters.descriptionExclude | ||
], | ||
@@ -564,0 +568,0 @@ requestBody: { |
@@ -10,8 +10,8 @@ /* | ||
*/ | ||
import * as tslib_1 from "tslib"; | ||
import { __extends } from "tslib"; | ||
import * as msRest from "@azure/ms-rest-js"; | ||
var packageName = "@azure/cognitiveservices-computervision"; | ||
var packageVersion = "5.0.0"; | ||
var packageVersion = "6.0.0"; | ||
var ComputerVisionClientContext = /** @class */ (function (_super) { | ||
tslib_1.__extends(ComputerVisionClientContext, _super); | ||
__extends(ComputerVisionClientContext, _super); | ||
/** | ||
@@ -39,3 +39,3 @@ * Initializes a new instance of the ComputerVisionClientContext class. | ||
_this = _super.call(this, credentials, options) || this; | ||
_this.baseUri = "{Endpoint}/vision/v2.0"; | ||
_this.baseUri = "{Endpoint}/vision/v2.1"; | ||
_this.requestContentType = "application/json; charset=utf-8"; | ||
@@ -42,0 +42,0 @@ _this.endpoint = endpoint; |
@@ -97,2 +97,6 @@ /// <reference types="node" /> | ||
/** | ||
* A value indicating if the image is gory. | ||
*/ | ||
isGoryContent?: boolean; | ||
/** | ||
* Score from 0 to 1 that indicates how much the content is considered adult-oriented within the | ||
@@ -106,2 +110,6 @@ * image. | ||
racyScore?: number; | ||
/** | ||
* Score from 0 to 1 that indicates how gory is the image. | ||
*/ | ||
goreScore?: number; | ||
} | ||
@@ -486,3 +494,3 @@ /** | ||
/** | ||
* The angle, in degrees, of the detected text with respect to the closest horizontal or vertical | ||
* The angle, in radians, of the detected text with respect to the closest horizontal or vertical | ||
* direction. After rotating the input image clockwise by this angle, the recognized text lines | ||
@@ -497,5 +505,8 @@ * become horizontal or vertical. In combination with the orientation property it can be used to | ||
/** | ||
* Orientation of the text recognized in the image. The value (up, down, left, or right) refers | ||
* to the direction that the top of the recognized text is facing, after the image has been | ||
* rotated around its center according to the detected text angle (see textAngle property). | ||
* Orientation of the text recognized in the image, if requested. The value (up, down, left, or | ||
* right) refers to the direction that the top of the recognized text is facing, after the image | ||
* has been rotated around its center according to the detected text angle (see textAngle | ||
* property). | ||
* If detection of the orientation was not requested, or no text is detected, the value is | ||
* 'NotDetected'. | ||
*/ | ||
@@ -695,7 +706,8 @@ orientation?: string; | ||
* - determines the accent color, dominant color, and whether an image is black&white. Adult - | ||
* detects if the image is pornographic in nature (depicts nudity or a sex act). Sexually | ||
* suggestive content is also detected. Objects - detects various objects within an image, | ||
* including the approximate location. The Objects argument is only available in English. Brands | ||
* - detects various brands within an image, including the approximate location. The Brands | ||
* argument is only available in English. | ||
* detects if the image is pornographic in nature (depicts nudity or a sex act), or is gory | ||
* (depicts extreme violence or blood). Sexually suggestive content (aka racy content) is also | ||
* detected. Objects - detects various objects within an image, including the approximate | ||
* location. The Objects argument is only available in English. Brands - detects various brands | ||
* within an image, including the approximate location. The Brands argument is only available in | ||
* English. | ||
*/ | ||
@@ -716,2 +728,6 @@ visualFeatures?: VisualFeatureTypes[]; | ||
language?: Language; | ||
/** | ||
* Turn off specified domain models when generating the description. | ||
*/ | ||
descriptionExclude?: DescriptionExclude[]; | ||
} | ||
@@ -733,2 +749,6 @@ /** | ||
language?: Language1; | ||
/** | ||
* Turn off specified domain models when generating the description. | ||
*/ | ||
descriptionExclude?: DescriptionExclude[]; | ||
} | ||
@@ -792,7 +812,8 @@ /** | ||
* - determines the accent color, dominant color, and whether an image is black&white. Adult - | ||
* detects if the image is pornographic in nature (depicts nudity or a sex act). Sexually | ||
* suggestive content is also detected. Objects - detects various objects within an image, | ||
* including the approximate location. The Objects argument is only available in English. Brands | ||
* - detects various brands within an image, including the approximate location. The Brands | ||
* argument is only available in English. | ||
* detects if the image is pornographic in nature (depicts nudity or a sex act), or is gory | ||
* (depicts extreme violence or blood). Sexually suggestive content (aka racy content) is also | ||
* detected. Objects - detects various objects within an image, including the approximate | ||
* location. The Objects argument is only available in English. Brands - detects various brands | ||
* within an image, including the approximate location. The Brands argument is only available in | ||
* English. | ||
*/ | ||
@@ -813,2 +834,6 @@ visualFeatures?: VisualFeatureTypes[]; | ||
language?: Language4; | ||
/** | ||
* Turn off specified domain models when generating the description. | ||
*/ | ||
descriptionExclude?: DescriptionExclude[]; | ||
} | ||
@@ -830,2 +855,6 @@ /** | ||
language?: Language5; | ||
/** | ||
* Turn off specified domain models when generating the description. | ||
*/ | ||
descriptionExclude?: DescriptionExclude[]; | ||
} | ||
@@ -942,2 +971,9 @@ /** | ||
/** | ||
* Defines values for DescriptionExclude. | ||
* Possible values include: 'Celebrities', 'Landmarks' | ||
* @readonly | ||
* @enum {string} | ||
*/ | ||
export declare type DescriptionExclude = 'Celebrities' | 'Landmarks'; | ||
/** | ||
* Defines values for OcrLanguages. | ||
@@ -944,0 +980,0 @@ * Possible values include: 'unk', 'zh-Hans', 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', 'de', |
@@ -183,2 +183,9 @@ /* | ||
}, | ||
isGoryContent: { | ||
nullable: false, | ||
serializedName: "isGoryContent", | ||
type: { | ||
name: "Boolean" | ||
} | ||
}, | ||
adultScore: { | ||
@@ -197,2 +204,9 @@ nullable: false, | ||
} | ||
}, | ||
goreScore: { | ||
nullable: false, | ||
serializedName: "goreScore", | ||
type: { | ||
name: "Number" | ||
} | ||
} | ||
@@ -199,0 +213,0 @@ } |
import * as msRest from "@azure/ms-rest-js"; | ||
export declare const descriptionExclude: msRest.OperationQueryParameter; | ||
export declare const details: msRest.OperationQueryParameter; | ||
@@ -3,0 +4,0 @@ export declare const detectOrientation: msRest.OperationQueryParameter; |
@@ -11,2 +11,24 @@ /* | ||
import * as msRest from "@azure/ms-rest-js"; | ||
export var descriptionExclude = { | ||
parameterPath: [ | ||
"options", | ||
"descriptionExclude" | ||
], | ||
mapper: { | ||
serializedName: "descriptionExclude", | ||
type: { | ||
name: "Sequence", | ||
element: { | ||
type: { | ||
name: "Enum", | ||
allowedValues: [ | ||
"Celebrities", | ||
"Landmarks" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
collectionFormat: msRest.QueryCollectionFormat.Csv | ||
}; | ||
export var details = { | ||
@@ -13,0 +35,0 @@ parameterPath: [ |
@@ -5,6 +5,6 @@ { | ||
"description": "ComputerVisionClient Library with typescript type definitions for node.js and browser.", | ||
"version": "5.0.0", | ||
"version": "6.0.0", | ||
"dependencies": { | ||
"@azure/ms-rest-js": "^1.8.1", | ||
"tslib": "^1.9.3" | ||
"@azure/ms-rest-js": "^2.0.4", | ||
"tslib": "^1.10.0" | ||
}, | ||
@@ -23,7 +23,7 @@ "keywords": [ | ||
"devDependencies": { | ||
"typescript": "^3.1.1", | ||
"rollup": "^0.66.2", | ||
"rollup-plugin-node-resolve": "^3.4.0", | ||
"typescript": "^3.5.3", | ||
"rollup": "^1.18.0", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"rollup-plugin-sourcemaps": "^0.4.2", | ||
"uglify-js": "^3.4.9" | ||
"uglify-js": "^3.6.0" | ||
}, | ||
@@ -30,0 +30,0 @@ "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/cognitiveservices/cognitiveservices-computervision", |
@@ -18,42 +18,54 @@ ## An isomorphic javascript sdk for - ComputerVisionClient | ||
#### nodejs - Authentication, client creation and listModels as an example written in TypeScript. | ||
#### nodejs - Authentication, client creation and listModels as an example written in TypeScript. | ||
##### Install @azure/ms-rest-nodeauth | ||
##### Install @azure/ms-rest-azure-js | ||
```bash | ||
npm install @azure/ms-rest-nodeauth | ||
npm install @azure/ms-rest-azure-js | ||
``` | ||
##### Sample code | ||
The following sample describes a given image using Computer Vision. To know more, refer to the [Azure Documentation on Computer Vision](https://docs.microsoft.com/en-us/azure/cognitive-services/computer-vision/home) | ||
```typescript | ||
import * as msRest from "@azure/ms-rest-js"; | ||
import * as msRestNodeAuth from "@azure/ms-rest-nodeauth"; | ||
import { ComputerVisionClient, ComputerVisionModels, ComputerVisionMappers } from "@azure/cognitiveservices-computervision"; | ||
const subscriptionId = process.env["AZURE_SUBSCRIPTION_ID"]; | ||
import { | ||
ComputerVisionClient, | ||
ComputerVisionModels | ||
} from "@azure/cognitiveservices-computervision"; | ||
import { CognitiveServicesCredentials } from "@azure/ms-rest-azure-js"; | ||
msRestNodeAuth.interactiveLogin().then((creds) => { | ||
const client = new ComputerVisionClient(creds, subscriptionId); | ||
client.listModels().then((result) => { | ||
console.log("The result is:"); | ||
console.log(result); | ||
}); | ||
}).catch((err) => { | ||
console.error(err); | ||
}); | ||
``` | ||
async function main(): Promise<void> { | ||
const computerVisionKey = process.env["computerVisionKey"] || "<computerVisionKey>"; | ||
const computerVisionEndPoint = | ||
process.env["computerVisionEndPoint"] || "<computerVisionEndPoint>"; | ||
const cognitiveServiceCredentials = new CognitiveServicesCredentials(computerVisionKey); | ||
const client = new ComputerVisionClient(cognitiveServiceCredentials, computerVisionEndPoint); | ||
#### browser - Authentication, client creation and listModels as an example written in JavaScript. | ||
const url = | ||
"https://docs.microsoft.com/en-us/azure/includes/media/shared-image-galleries/shared-image-gallery.png"; | ||
const options: ComputerVisionModels.ComputerVisionClientDescribeImageOptionalParams = { | ||
maxCandidates: 5, | ||
language: "en" | ||
}; | ||
client | ||
.describeImage(url, options) | ||
.then((result) => { | ||
console.log("The result is:"); | ||
console.log(result); | ||
}) | ||
.catch((err) => { | ||
console.log("An error occurred:"); | ||
console.error(err); | ||
}); | ||
} | ||
##### Install @azure/ms-rest-browserauth | ||
```bash | ||
npm install @azure/ms-rest-browserauth | ||
main(); | ||
``` | ||
#### browser - Authentication, client creation and listModels as an example written in JavaScript. | ||
##### Sample code | ||
See https://github.com/Azure/ms-rest-browserauth to learn how to authenticate to Azure in the browser. | ||
- index.html | ||
- index.html | ||
```html | ||
@@ -65,24 +77,33 @@ <!DOCTYPE html> | ||
<script src="node_modules/@azure/ms-rest-js/dist/msRest.browser.js"></script> | ||
<script src="node_modules/@azure/ms-rest-browserauth/dist/msAuth.js"></script> | ||
<script src="node_modules/@azure/cognitiveservices-computervision/dist/cognitiveservices-computervision.js"></script> | ||
<script type="text/javascript"> | ||
const subscriptionId = "<Subscription_Id>"; | ||
const authManager = new msAuth.AuthManager({ | ||
clientId: "<client id for your Azure AD app>", | ||
tenant: "<optional tenant for your organization>" | ||
const computerVisionKey = "<YOUR_COMPUTER_VISION_KEY>"; | ||
const computerVisionEndPoint = "<YOUR_COMPUTER_VISION_ENDPOINT>"; | ||
const cognitiveServiceCredentials = new msRest.ApiKeyCredentials({ | ||
inHeader: { | ||
"Ocp-Apim-Subscription-Key": computerVisionKey | ||
} | ||
}); | ||
authManager.finalizeLogin().then((res) => { | ||
if (!res.isLoggedIn) { | ||
// may cause redirects | ||
authManager.login(); | ||
} | ||
const client = new Azure.CognitiveservicesComputervision.ComputerVisionClient(res.creds, subscriptionId); | ||
client.listModels().then((result) => { | ||
const client = new Azure.CognitiveservicesComputervision.ComputerVisionClient( | ||
cognitiveServiceCredentials, | ||
computerVisionEndPoint | ||
); | ||
const url = | ||
"https://docs.microsoft.com/en-us/azure/includes/media/shared-image-galleries/shared-image-gallery.png"; | ||
const options = { | ||
maxCandidates: 5, | ||
language: "en" | ||
}; | ||
client | ||
.describeImage(url, options) | ||
.then((result) => { | ||
console.log("The result is:"); | ||
console.log(result); | ||
}).catch((err) => { | ||
}) | ||
.catch((err) => { | ||
console.log("An error occurred:"); | ||
console.error(err); | ||
}); | ||
}); | ||
</script> | ||
@@ -89,0 +110,0 @@ </head> |
@@ -32,3 +32,3 @@ import rollup from "rollup"; | ||
plugins: [ | ||
nodeResolve({ module: true }), | ||
nodeResolve({ mainFields: ['module', 'main'] }), | ||
sourcemaps() | ||
@@ -35,0 +35,0 @@ ] |
@@ -65,3 +65,4 @@ /* | ||
* the operation. More than one description can be generated for each image. Descriptions are | ||
* ordered by their confidence score. All descriptions are in English. | ||
* ordered by their confidence score. Descriptions may include results from celebrity and landmark | ||
* domain models, if applicable. | ||
* Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. | ||
@@ -242,4 +243,4 @@ * A successful response will be returned in JSON. If the request failed, the response will contain | ||
* hierarchical classification system, but correspond to image content. Tags may contain hints to | ||
* avoid ambiguity or provide context, for example the tag "cello" may be accompanied by the hint | ||
* "musical instrument". All tags are in English. | ||
* avoid ambiguity or provide context, for example the tag "ascomycete" may be accompanied by the | ||
* hint "fungus". | ||
* Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. | ||
@@ -554,3 +555,4 @@ * A successful response will be returned in JSON. If the request failed, the response will contain | ||
* the operation. More than one description can be generated for each image. Descriptions are | ||
* ordered by their confidence score. All descriptions are in English. | ||
* ordered by their confidence score. Descriptions may include results from celebrity and landmark | ||
* domain models, if applicable. | ||
* Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. | ||
@@ -753,4 +755,4 @@ * A successful response will be returned in JSON. If the request failed, the response will contain | ||
* hierarchical classification system, but correspond to image content. Tags may contain hints to | ||
* avoid ambiguity or provide context, for example the tag "cello" may be accompanied by the hint | ||
* "musical instrument". All tags are in English. | ||
* avoid ambiguity or provide context, for example the tag "ascomycete" may be accompanied by the | ||
* hint "fungus". | ||
* Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. | ||
@@ -863,3 +865,4 @@ * A successful response will be returned in JSON. If the request failed, the response will contain | ||
Parameters.details, | ||
Parameters.language0 | ||
Parameters.language0, | ||
Parameters.descriptionExclude | ||
], | ||
@@ -894,3 +897,4 @@ requestBody: { | ||
Parameters.maxCandidates, | ||
Parameters.language0 | ||
Parameters.language0, | ||
Parameters.descriptionExclude | ||
], | ||
@@ -1209,3 +1213,4 @@ requestBody: { | ||
Parameters.details, | ||
Parameters.language0 | ||
Parameters.language0, | ||
Parameters.descriptionExclude | ||
], | ||
@@ -1270,3 +1275,4 @@ requestBody: { | ||
Parameters.maxCandidates, | ||
Parameters.language0 | ||
Parameters.language0, | ||
Parameters.descriptionExclude | ||
], | ||
@@ -1273,0 +1279,0 @@ requestBody: { |
@@ -14,3 +14,3 @@ /* | ||
const packageName = "@azure/cognitiveservices-computervision"; | ||
const packageVersion = "5.0.0"; | ||
const packageVersion = "6.0.0"; | ||
@@ -46,3 +46,3 @@ export class ComputerVisionClientContext extends msRest.ServiceClient { | ||
this.baseUri = "{Endpoint}/vision/v2.0"; | ||
this.baseUri = "{Endpoint}/vision/v2.1"; | ||
this.requestContentType = "application/json; charset=utf-8"; | ||
@@ -49,0 +49,0 @@ this.endpoint = endpoint; |
@@ -111,2 +111,6 @@ /* | ||
/** | ||
* A value indicating if the image is gory. | ||
*/ | ||
isGoryContent?: boolean; | ||
/** | ||
* Score from 0 to 1 that indicates how much the content is considered adult-oriented within the | ||
@@ -120,2 +124,6 @@ * image. | ||
racyScore?: number; | ||
/** | ||
* Score from 0 to 1 that indicates how gory is the image. | ||
*/ | ||
goreScore?: number; | ||
} | ||
@@ -521,3 +529,3 @@ | ||
/** | ||
* The angle, in degrees, of the detected text with respect to the closest horizontal or vertical | ||
* The angle, in radians, of the detected text with respect to the closest horizontal or vertical | ||
* direction. After rotating the input image clockwise by this angle, the recognized text lines | ||
@@ -532,5 +540,8 @@ * become horizontal or vertical. In combination with the orientation property it can be used to | ||
/** | ||
* Orientation of the text recognized in the image. The value (up, down, left, or right) refers | ||
* to the direction that the top of the recognized text is facing, after the image has been | ||
* rotated around its center according to the detected text angle (see textAngle property). | ||
* Orientation of the text recognized in the image, if requested. The value (up, down, left, or | ||
* right) refers to the direction that the top of the recognized text is facing, after the image | ||
* has been rotated around its center according to the detected text angle (see textAngle | ||
* property). | ||
* If detection of the orientation was not requested, or no text is detected, the value is | ||
* 'NotDetected'. | ||
*/ | ||
@@ -742,7 +753,8 @@ orientation?: string; | ||
* - determines the accent color, dominant color, and whether an image is black&white. Adult - | ||
* detects if the image is pornographic in nature (depicts nudity or a sex act). Sexually | ||
* suggestive content is also detected. Objects - detects various objects within an image, | ||
* including the approximate location. The Objects argument is only available in English. Brands | ||
* - detects various brands within an image, including the approximate location. The Brands | ||
* argument is only available in English. | ||
* detects if the image is pornographic in nature (depicts nudity or a sex act), or is gory | ||
* (depicts extreme violence or blood). Sexually suggestive content (aka racy content) is also | ||
* detected. Objects - detects various objects within an image, including the approximate | ||
* location. The Objects argument is only available in English. Brands - detects various brands | ||
* within an image, including the approximate location. The Brands argument is only available in | ||
* English. | ||
*/ | ||
@@ -763,2 +775,6 @@ visualFeatures?: VisualFeatureTypes[]; | ||
language?: Language; | ||
/** | ||
* Turn off specified domain models when generating the description. | ||
*/ | ||
descriptionExclude?: DescriptionExclude[]; | ||
} | ||
@@ -781,2 +797,6 @@ | ||
language?: Language1; | ||
/** | ||
* Turn off specified domain models when generating the description. | ||
*/ | ||
descriptionExclude?: DescriptionExclude[]; | ||
} | ||
@@ -845,7 +865,8 @@ | ||
* - determines the accent color, dominant color, and whether an image is black&white. Adult - | ||
* detects if the image is pornographic in nature (depicts nudity or a sex act). Sexually | ||
* suggestive content is also detected. Objects - detects various objects within an image, | ||
* including the approximate location. The Objects argument is only available in English. Brands | ||
* - detects various brands within an image, including the approximate location. The Brands | ||
* argument is only available in English. | ||
* detects if the image is pornographic in nature (depicts nudity or a sex act), or is gory | ||
* (depicts extreme violence or blood). Sexually suggestive content (aka racy content) is also | ||
* detected. Objects - detects various objects within an image, including the approximate | ||
* location. The Objects argument is only available in English. Brands - detects various brands | ||
* within an image, including the approximate location. The Brands argument is only available in | ||
* English. | ||
*/ | ||
@@ -866,2 +887,6 @@ visualFeatures?: VisualFeatureTypes[]; | ||
language?: Language4; | ||
/** | ||
* Turn off specified domain models when generating the description. | ||
*/ | ||
descriptionExclude?: DescriptionExclude[]; | ||
} | ||
@@ -884,2 +909,6 @@ | ||
language?: Language5; | ||
/** | ||
* Turn off specified domain models when generating the description. | ||
*/ | ||
descriptionExclude?: DescriptionExclude[]; | ||
} | ||
@@ -1009,2 +1038,10 @@ | ||
/** | ||
* Defines values for DescriptionExclude. | ||
* Possible values include: 'Celebrities', 'Landmarks' | ||
* @readonly | ||
* @enum {string} | ||
*/ | ||
export type DescriptionExclude = 'Celebrities' | 'Landmarks'; | ||
/** | ||
* Defines values for OcrLanguages. | ||
@@ -1011,0 +1048,0 @@ * Possible values include: 'unk', 'zh-Hans', 'zh-Hant', 'cs', 'da', 'nl', 'en', 'fi', 'fr', 'de', |
@@ -192,2 +192,9 @@ /* | ||
}, | ||
isGoryContent: { | ||
nullable: false, | ||
serializedName: "isGoryContent", | ||
type: { | ||
name: "Boolean" | ||
} | ||
}, | ||
adultScore: { | ||
@@ -206,2 +213,9 @@ nullable: false, | ||
} | ||
}, | ||
goreScore: { | ||
nullable: false, | ||
serializedName: "goreScore", | ||
type: { | ||
name: "Number" | ||
} | ||
} | ||
@@ -208,0 +222,0 @@ } |
@@ -13,2 +13,24 @@ /* | ||
export const descriptionExclude: msRest.OperationQueryParameter = { | ||
parameterPath: [ | ||
"options", | ||
"descriptionExclude" | ||
], | ||
mapper: { | ||
serializedName: "descriptionExclude", | ||
type: { | ||
name: "Sequence", | ||
element: { | ||
type: { | ||
name: "Enum", | ||
allowedValues: [ | ||
"Celebrities", | ||
"Landmarks" | ||
] | ||
} | ||
} | ||
} | ||
}, | ||
collectionFormat: msRest.QueryCollectionFormat.Csv | ||
}; | ||
export const details: msRest.OperationQueryParameter = { | ||
@@ -15,0 +37,0 @@ parameterPath: [ |
@@ -12,3 +12,3 @@ { | ||
"forceConsistentCasingInFileNames": true, | ||
"lib": ["es6"], | ||
"lib": ["es6", "dom"], | ||
"declaration": true, | ||
@@ -15,0 +15,0 @@ "outDir": "./esm", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
693424
11934
118
+ Added@azure/ms-rest-js@2.7.0(transitive)
+ Addedabort-controller@3.0.0(transitive)
+ Addedevent-target-shim@5.0.1(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addeduuid@8.3.2(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
+ Addedxml2js@0.5.0(transitive)
- Removed@azure/ms-rest-js@1.11.2(transitive)
- Removedaxios@0.21.4(transitive)
- Removedfollow-redirects@1.15.9(transitive)
- Removedpsl@1.9.0(transitive)
- Removedpunycode@2.3.1(transitive)
- Removedtough-cookie@2.5.0(transitive)
- Removeduuid@3.4.0(transitive)
- Removedxml2js@0.4.23(transitive)
Updated@azure/ms-rest-js@^2.0.4
Updatedtslib@^1.10.0