UNPKG

@azure/cognitiveservices-computervision

Version:

ComputerVisionClient Library with typescript type definitions for node.js and browser.

1,601 lines (1,591 loc) 81.8 kB
/* * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@azure/ms-rest-js')) : typeof define === 'function' && define.amd ? define(['exports', '@azure/ms-rest-js'], factory) : (global = global || self, factory((global.Azure = global.Azure || {}, global.Azure.CognitiveservicesComputervision = {}), global.msRest)); }(this, (function (exports, msRest) { 'use strict'; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */ /* global Reflect, Promise */ var extendStatics = function(d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; function __extends(d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); } var __assign = function() { __assign = Object.assign || function __assign(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; /* * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ var index = /*#__PURE__*/Object.freeze({ __proto__: null }); /* * Copyright (c) Microsoft Corporation. * Licensed under the MIT License. * * Code generated by Microsoft (R) AutoRest Code Generator. * Changes may cause incorrect behavior and will be lost if the code is regenerated. */ var FaceRectangle = { serializedName: "FaceRectangle", type: { name: "Composite", className: "FaceRectangle", modelProperties: { left: { nullable: false, serializedName: "left", type: { name: "Number" } }, top: { nullable: false, serializedName: "top", type: { name: "Number" } }, width: { nullable: false, serializedName: "width", type: { name: "Number" } }, height: { nullable: false, serializedName: "height", type: { name: "Number" } } } } }; var CelebritiesModel = { serializedName: "CelebritiesModel", type: { name: "Composite", className: "CelebritiesModel", modelProperties: { name: { nullable: true, serializedName: "name", type: { name: "String" } }, confidence: { nullable: false, serializedName: "confidence", type: { name: "Number" } }, faceRectangle: { serializedName: "faceRectangle", type: { name: "Composite", className: "FaceRectangle" } } } } }; var LandmarksModel = { serializedName: "LandmarksModel", type: { name: "Composite", className: "LandmarksModel", modelProperties: { name: { nullable: true, serializedName: "name", type: { name: "String" } }, confidence: { nullable: false, serializedName: "confidence", type: { name: "Number" } } } } }; var CategoryDetail = { serializedName: "CategoryDetail", type: { name: "Composite", className: "CategoryDetail", modelProperties: { celebrities: { nullable: true, serializedName: "celebrities", type: { name: "Sequence", element: { type: { name: "Composite", className: "CelebritiesModel" } } } }, landmarks: { nullable: true, serializedName: "landmarks", type: { name: "Sequence", element: { type: { name: "Composite", className: "LandmarksModel" } } } } } } }; var Category = { serializedName: "Category", type: { name: "Composite", className: "Category", modelProperties: { name: { nullable: true, serializedName: "name", type: { name: "String" } }, score: { nullable: false, serializedName: "score", type: { name: "Number" } }, detail: { serializedName: "detail", type: { name: "Composite", className: "CategoryDetail" } } } } }; var AdultInfo = { serializedName: "AdultInfo", type: { name: "Composite", className: "AdultInfo", modelProperties: { isAdultContent: { nullable: false, serializedName: "isAdultContent", type: { name: "Boolean" } }, isRacyContent: { nullable: false, serializedName: "isRacyContent", type: { name: "Boolean" } }, isGoryContent: { nullable: false, serializedName: "isGoryContent", type: { name: "Boolean" } }, adultScore: { nullable: false, serializedName: "adultScore", type: { name: "Number" } }, racyScore: { nullable: false, serializedName: "racyScore", type: { name: "Number" } }, goreScore: { nullable: false, serializedName: "goreScore", type: { name: "Number" } } } } }; var ColorInfo = { serializedName: "ColorInfo", type: { name: "Composite", className: "ColorInfo", modelProperties: { dominantColorForeground: { nullable: true, serializedName: "dominantColorForeground", type: { name: "String" } }, dominantColorBackground: { nullable: true, serializedName: "dominantColorBackground", type: { name: "String" } }, dominantColors: { nullable: true, serializedName: "dominantColors", type: { name: "Sequence", element: { type: { name: "String" } } } }, accentColor: { nullable: true, serializedName: "accentColor", type: { name: "String" } }, isBWImg: { nullable: false, serializedName: "isBWImg", type: { name: "Boolean" } } } } }; var ImageType = { serializedName: "ImageType", type: { name: "Composite", className: "ImageType", modelProperties: { clipArtType: { nullable: false, serializedName: "clipArtType", type: { name: "Number" } }, lineDrawingType: { nullable: false, serializedName: "lineDrawingType", type: { name: "Number" } } } } }; var ImageTag = { serializedName: "ImageTag", type: { name: "Composite", className: "ImageTag", modelProperties: { name: { nullable: true, serializedName: "name", type: { name: "String" } }, confidence: { nullable: false, serializedName: "confidence", type: { name: "Number" } }, hint: { nullable: true, serializedName: "hint", type: { name: "String" } } } } }; var ImageCaption = { serializedName: "ImageCaption", type: { name: "Composite", className: "ImageCaption", modelProperties: { text: { nullable: true, serializedName: "text", type: { name: "String" } }, confidence: { nullable: false, serializedName: "confidence", type: { name: "Number" } } } } }; var ImageDescriptionDetails = { serializedName: "ImageDescriptionDetails", type: { name: "Composite", className: "ImageDescriptionDetails", modelProperties: { tags: { nullable: true, serializedName: "tags", type: { name: "Sequence", element: { type: { name: "String" } } } }, captions: { nullable: true, serializedName: "captions", type: { name: "Sequence", element: { type: { name: "Composite", className: "ImageCaption" } } } } } } }; var FaceDescription = { serializedName: "FaceDescription", type: { name: "Composite", className: "FaceDescription", modelProperties: { age: { nullable: false, serializedName: "age", type: { name: "Number" } }, gender: { nullable: true, serializedName: "gender", type: { name: "Enum", allowedValues: [ "Male", "Female" ] } }, faceRectangle: { serializedName: "faceRectangle", type: { name: "Composite", className: "FaceRectangle" } } } } }; var BoundingRect = { serializedName: "BoundingRect", type: { name: "Composite", className: "BoundingRect", modelProperties: { x: { nullable: false, serializedName: "x", type: { name: "Number" } }, y: { nullable: false, serializedName: "y", type: { name: "Number" } }, w: { nullable: false, serializedName: "w", type: { name: "Number" } }, h: { nullable: false, serializedName: "h", type: { name: "Number" } } } } }; var ObjectHierarchy = { serializedName: "ObjectHierarchy", type: { name: "Composite", className: "ObjectHierarchy", modelProperties: { object: { nullable: true, serializedName: "object", type: { name: "String" } }, confidence: { nullable: false, serializedName: "confidence", type: { name: "Number" } }, parent: { serializedName: "parent", type: { name: "Composite", className: "ObjectHierarchy" } } } } }; var DetectedObject = { serializedName: "DetectedObject", type: { name: "Composite", className: "DetectedObject", modelProperties: { rectangle: { readOnly: true, serializedName: "rectangle", type: { name: "Composite", className: "BoundingRect" } }, object: { nullable: true, serializedName: "object", type: { name: "String" } }, confidence: { nullable: false, serializedName: "confidence", type: { name: "Number" } }, parent: { serializedName: "parent", type: { name: "Composite", className: "ObjectHierarchy" } } } } }; var DetectedBrand = { serializedName: "DetectedBrand", type: { name: "Composite", className: "DetectedBrand", modelProperties: { name: { nullable: true, readOnly: true, serializedName: "name", type: { name: "String" } }, confidence: { nullable: false, readOnly: true, serializedName: "confidence", type: { name: "Number" } }, rectangle: { readOnly: true, serializedName: "rectangle", type: { name: "Composite", className: "BoundingRect" } } } } }; var ImageMetadata = { serializedName: "ImageMetadata", type: { name: "Composite", className: "ImageMetadata", modelProperties: { width: { nullable: false, serializedName: "width", type: { name: "Number" } }, height: { nullable: false, serializedName: "height", type: { name: "Number" } }, format: { nullable: true, serializedName: "format", type: { name: "String" } } } } }; var ImageAnalysis = { serializedName: "ImageAnalysis", type: { name: "Composite", className: "ImageAnalysis", modelProperties: { categories: { nullable: true, 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: true, serializedName: "tags", type: { name: "Sequence", element: { type: { name: "Composite", className: "ImageTag" } } } }, description: { serializedName: "description", type: { name: "Composite", className: "ImageDescriptionDetails" } }, faces: { nullable: true, serializedName: "faces", type: { name: "Sequence", element: { type: { name: "Composite", className: "FaceDescription" } } } }, objects: { nullable: true, serializedName: "objects", type: { name: "Sequence", element: { type: { name: "Composite", className: "DetectedObject" } } } }, brands: { nullable: true, serializedName: "brands", type: { name: "Sequence", element: { type: { name: "Composite", className: "DetectedBrand" } } } }, requestId: { nullable: true, serializedName: "requestId", type: { name: "String" } }, metadata: { serializedName: "metadata", type: { name: "Composite", className: "ImageMetadata" } }, modelVersion: { serializedName: "modelVersion", type: { name: "String" } } } } }; var ImageDescription = { serializedName: "ImageDescription", type: { name: "Composite", className: "ImageDescription", modelProperties: { tags: { nullable: true, serializedName: "description.tags", type: { name: "Sequence", element: { type: { name: "String" } } } }, captions: { nullable: true, serializedName: "description.captions", type: { name: "Sequence", element: { type: { name: "Composite", className: "ImageCaption" } } } }, requestId: { nullable: true, serializedName: "requestId", type: { name: "String" } }, metadata: { serializedName: "metadata", type: { name: "Composite", className: "ImageMetadata" } }, modelVersion: { serializedName: "modelVersion", type: { name: "String" } } } } }; var DetectResult = { serializedName: "DetectResult", type: { name: "Composite", className: "DetectResult", modelProperties: { objects: { nullable: true, readOnly: true, serializedName: "objects", type: { name: "Sequence", element: { type: { name: "Composite", className: "DetectedObject" } } } }, requestId: { nullable: true, serializedName: "requestId", type: { name: "String" } }, metadata: { serializedName: "metadata", type: { name: "Composite", className: "ImageMetadata" } }, modelVersion: { serializedName: "modelVersion", type: { name: "String" } } } } }; var ModelDescription = { serializedName: "ModelDescription", type: { name: "Composite", className: "ModelDescription", modelProperties: { name: { nullable: true, serializedName: "name", type: { name: "String" } }, categories: { nullable: true, serializedName: "categories", type: { name: "Sequence", element: { type: { name: "String" } } } } } } }; var ListModelsResult = { serializedName: "ListModelsResult", type: { name: "Composite", className: "ListModelsResult", modelProperties: { modelsProperty: { nullable: true, readOnly: true, serializedName: "models", type: { name: "Sequence", element: { type: { name: "Composite", className: "ModelDescription" } } } } } } }; var DomainModelResults = { serializedName: "DomainModelResults", type: { name: "Composite", className: "DomainModelResults", modelProperties: { result: { serializedName: "result", type: { name: "Object" } }, requestId: { nullable: true, serializedName: "requestId", type: { name: "String" } }, metadata: { serializedName: "metadata", type: { name: "Composite", className: "ImageMetadata" } }, modelVersion: { serializedName: "modelVersion", type: { name: "String" } } } } }; var OcrWord = { serializedName: "OcrWord", type: { name: "Composite", className: "OcrWord", modelProperties: { boundingBox: { nullable: true, serializedName: "boundingBox", type: { name: "String" } }, text: { nullable: true, serializedName: "text", type: { name: "String" } } } } }; var OcrLine = { serializedName: "OcrLine", type: { name: "Composite", className: "OcrLine", modelProperties: { boundingBox: { nullable: true, serializedName: "boundingBox", type: { name: "String" } }, words: { nullable: true, serializedName: "words", type: { name: "Sequence", element: { type: { name: "Composite", className: "OcrWord" } } } } } } }; var OcrRegion = { serializedName: "OcrRegion", type: { name: "Composite", className: "OcrRegion", modelProperties: { boundingBox: { nullable: true, serializedName: "boundingBox", type: { name: "String" } }, lines: { nullable: true, serializedName: "lines", type: { name: "Sequence", element: { type: { name: "Composite", className: "OcrLine" } } } } } } }; var OcrResult = { serializedName: "OcrResult", type: { name: "Composite", className: "OcrResult", modelProperties: { language: { nullable: true, serializedName: "language", type: { name: "String" } }, textAngle: { nullable: false, serializedName: "textAngle", type: { name: "Number" } }, orientation: { nullable: true, serializedName: "orientation", type: { name: "String" } }, regions: { nullable: true, serializedName: "regions", type: { name: "Sequence", element: { type: { name: "Composite", className: "OcrRegion" } } } }, modelVersion: { serializedName: "modelVersion", type: { name: "String" } } } } }; var TagResult = { serializedName: "TagResult", type: { name: "Composite", className: "TagResult", modelProperties: { tags: { nullable: true, serializedName: "tags", type: { name: "Sequence", element: { type: { name: "Composite", className: "ImageTag" } } } }, requestId: { nullable: true, serializedName: "requestId", type: { name: "String" } }, metadata: { serializedName: "metadata", type: { name: "Composite", className: "ImageMetadata" } }, modelVersion: { serializedName: "modelVersion", type: { name: "String" } } } } }; var AreaOfInterestResult = { serializedName: "AreaOfInterestResult", type: { name: "Composite", className: "AreaOfInterestResult", modelProperties: { areaOfInterest: { readOnly: true, serializedName: "areaOfInterest", type: { name: "Composite", className: "BoundingRect" } }, requestId: { nullable: true, serializedName: "requestId", type: { name: "String" } }, metadata: { serializedName: "metadata", type: { name: "Composite", className: "ImageMetadata" } }, modelVersion: { serializedName: "modelVersion", type: { name: "String" } } } } }; var ImageUrl = { serializedName: "ImageUrl", type: { name: "Composite", className: "ImageUrl", modelProperties: { url: { required: true, serializedName: "url", type: { name: "String" } } } } }; var ComputerVisionInnerError = { serializedName: "ComputerVisionInnerError", type: { name: "Composite", className: "ComputerVisionInnerError", modelProperties: { code: { required: true, serializedName: "code", type: { name: "String" } }, message: { required: true, serializedName: "message", type: { name: "String" } } } } }; var ComputerVisionError = { serializedName: "ComputerVisionError", type: { name: "Composite", className: "ComputerVisionError", modelProperties: { code: { required: true, serializedName: "code", type: { name: "String" } }, message: { required: true, serializedName: "message", type: { name: "String" } }, innererror: { serializedName: "innererror", type: { name: "Composite", className: "ComputerVisionInnerError" } } } } }; var ComputerVisionErrorResponse = { serializedName: "ComputerVisionErrorResponse", type: { name: "Composite", className: "ComputerVisionErrorResponse", modelProperties: { error: { required: true, serializedName: "error", type: { name: "Composite", className: "ComputerVisionError" } } } } }; var Style = { serializedName: "Style", type: { name: "Composite", className: "Style", modelProperties: { name: { required: true, serializedName: "name", type: { name: "String" } }, confidence: { required: true, serializedName: "confidence", type: { name: "Number" } } } } }; var Appearance = { serializedName: "Appearance", type: { name: "Composite", className: "Appearance", modelProperties: { style: { required: true, serializedName: "style", type: { name: "Composite", className: "Style" } } } } }; var Word = { serializedName: "Word", type: { name: "Composite", className: "Word", modelProperties: { boundingBox: { required: true, serializedName: "boundingBox", type: { name: "Sequence", element: { type: { name: "Number" } } } }, text: { required: true, serializedName: "text", type: { name: "String" } }, confidence: { required: true, serializedName: "confidence", type: { name: "Number" } } } } }; var Line = { serializedName: "Line", type: { name: "Composite", className: "Line", modelProperties: { language: { serializedName: "language", type: { name: "String" } }, boundingBox: { required: true, serializedName: "boundingBox", type: { name: "Sequence", element: { type: { name: "Number" } } } }, appearance: { serializedName: "appearance", type: { name: "Composite", className: "Appearance" } }, text: { required: true, serializedName: "text", type: { name: "String" } }, words: { required: true, serializedName: "words", type: { name: "Sequence", element: { type: { name: "Composite", className: "Word" } } } } } } }; var ReadResult = { serializedName: "ReadResult", type: { name: "Composite", className: "ReadResult", modelProperties: { page: { required: true, serializedName: "page", type: { name: "Number" } }, language: { serializedName: "language", type: { name: "String" } }, angle: { required: true, serializedName: "angle", type: { name: "Number" } }, width: { required: true, serializedName: "width", type: { name: "Number" } }, height: { required: true, serializedName: "height", type: { name: "Number" } }, unit: { required: true, nullable: false, serializedName: "unit", type: { name: "Enum", allowedValues: [ "pixel", "inch" ] } }, lines: { required: true, serializedName: "lines", type: { name: "Sequence", element: { type: { name: "Composite", className: "Line" } } } } } } }; var AnalyzeResults = { serializedName: "analyzeResults", type: { name: "Composite", className: "AnalyzeResults", modelProperties: { version: { required: true, serializedName: "version", type: { name: "String" } }, modelVersion: { required: true, serializedName: "modelVersion", constraints: { Pattern: /^(latest|\d{4}-\d{2}-\d{2})(-preview)?$/ }, type: { name: "String" } }, readResults: { required: true, serializedName: "readResults", type: { name: "Sequence", element: { type: { name: "Composite", className: "ReadResult" } } } } } } }; var ReadOperationResult = { serializedName: "ReadOperationResult", type: { name: "Composite", className: "ReadOperationResult", modelProperties: { status: { nullable: false, serializedName: "status", type: { name: "Enum", allowedValues: [ "notStarted", "running", "failed", "succeeded" ] } }, createdDateTime: { nullable: false, serializedName: "createdDateTime", type: { name: "String" } }, lastUpdatedDateTime: { nullable: false, serializedName: "lastUpdatedDateTime", type: { name: "String" } }, analyzeResult: { serializedName: "analyzeResult", type: { name: "Composite", className: "AnalyzeResults" } } } } }; var ComputerVisionOcrError = { serializedName: "ComputerVisionOcrError", type: { name: "Composite", className: "ComputerVisionOcrError", modelProperties: { code: { required: true, serializedName: "code", type: { name: "Object" } }, message: { required: true, serializedName: "message", type: { name: "String" } }, requestId: { serializedName: "requestId", type: { name: "String" } } } } }; var ReadHeaders = { serializedName: "read-headers", type: { name: "Composite", className: "ReadHeaders", modelProperties: { operationLocation: { serializedName: "operation-location", type: { name: "String" } } } } }; var ReadInStreamHeaders = { serializedName: "readinstream-headers", type: { name: "Composite", className: "ReadInStreamHeaders", modelProperties: { operationLocation: { serializedName: "operation-location", type: { name: "String" } } } } }; var Mappers = /*#__PURE__*/Object.freeze({ __proto__: null, FaceRectangle: FaceRectangle, CelebritiesModel: CelebritiesModel, LandmarksModel: LandmarksModel, CategoryDetail: CategoryDetail, Category: Category, AdultInfo: AdultInfo, ColorInfo: ColorInfo, ImageType: ImageType, ImageTag: ImageTag, ImageCaption: ImageCaption, ImageDescriptionDetails: ImageDescriptionDetails, FaceDescription: FaceDescription, BoundingRect: BoundingRect, ObjectHierarchy: ObjectHierarchy, DetectedObject: DetectedObject, DetectedBrand: DetectedBrand, ImageMetadata: ImageMetadata, ImageAnalysis: ImageAnalysis, ImageDescription: ImageDescription, DetectResult: DetectResult, ModelDescription: Mo