test.aspose.barcode.cloud
Version:
Aspose.BarCode Cloud SDK for Node.js
1,165 lines (1,161 loc) • 58 kB
JavaScript
"use strict";
/*
* MIT License
* Copyright (c) 2018 Aspose Pty Ltd
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const localVarRequest = require("request");
const configuration_1 = require("./configuration");
// ===============================================
// This file is autogenerated - Please do not edit
// ===============================================
/* tslint:disable:no-unused-variable */
let primitives = [
"string",
"boolean",
"double",
"integer",
"long",
"float",
"number",
"any"
];
class ObjectSerializer {
static findCorrectType(data, expectedType) {
if (data == undefined) {
return expectedType;
}
else if (primitives.indexOf(expectedType.toLowerCase()) !== -1) {
return expectedType;
}
else if (expectedType === "Date") {
return expectedType;
}
else {
if (enumsMap[expectedType]) {
return expectedType;
}
if (!typeMap[expectedType]) {
return expectedType; // w/e we don't know the type
}
// Check the discriminator
let discriminatorProperty = typeMap[expectedType].discriminator;
if (discriminatorProperty == null) {
return expectedType; // the type does not have a discriminator. use it.
}
else {
if (data[discriminatorProperty]) {
return data[discriminatorProperty]; // use the type given in the discriminator
}
else {
return expectedType; // discriminator was not present (or an empty string)
}
}
}
}
static serialize(data, type) {
if (data == undefined) {
return data;
}
else if (primitives.indexOf(type.toLowerCase()) !== -1) {
return data;
}
else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
let subType = type.replace("Array<", ""); // Array<Type> => Type>
subType = subType.substring(0, subType.length - 1); // Type> => Type
let transformedData = [];
for (let index in data) {
let date = data[index];
transformedData.push(ObjectSerializer.serialize(date, subType));
}
return transformedData;
}
else if (type === "Date") {
return data.toString();
}
else {
if (enumsMap[type]) {
return enumsMap[type][data];
}
if (!typeMap[type]) { // in case we dont know the type
return data;
}
// get the map for the correct type.
let attributeTypes = typeMap[type].getAttributeTypeMap();
let instance = {};
for (let index in attributeTypes) {
let attributeType = attributeTypes[index];
instance[attributeType.baseName] = ObjectSerializer.serialize(data[attributeType.name], attributeType.type);
}
return instance;
}
}
static deserialize(data, type) {
// polymorphism may change the actual type.
type = ObjectSerializer.findCorrectType(data, type);
if (data == undefined) {
return data;
}
else if (primitives.indexOf(type.toLowerCase()) !== -1) {
return data;
}
else if (type.lastIndexOf("Array<", 0) === 0) { // string.startsWith pre es6
let subType = type.replace("Array<", ""); // Array<Type> => Type>
subType = subType.substring(0, subType.length - 1); // Type> => Type
let transformedData = [];
for (let index in data) {
let date = data[index];
transformedData.push(ObjectSerializer.deserialize(date, subType));
}
return transformedData;
}
else if (type === "Date") {
return new Date(data);
}
else {
if (enumsMap[type]) { // is Enum
return data;
}
if (!typeMap[type]) { // dont know the type
return data;
}
let instance = new typeMap[type]();
let attributeTypes = typeMap[type].getAttributeTypeMap();
for (let index in attributeTypes) {
let attributeType = attributeTypes[index];
instance[attributeType.name] = ObjectSerializer.deserialize(data[attributeType.baseName], attributeType.type);
}
return instance;
}
}
}
/**
* Represents the basic response class from Aspose for Cloud.
*/
class AsposeResponse {
static getAttributeTypeMap() {
return AsposeResponse.attributeTypeMap;
}
}
AsposeResponse.attributeTypeMap = [
{
"name": "code",
"baseName": "Code",
"type": "HttpStatusCode"
},
{
"name": "status",
"baseName": "Status",
"type": "string"
}
];
exports.AsposeResponse = AsposeResponse;
/**
* Represents BarCodeBuilder.
*/
class BarCodeBuilder {
static getAttributeTypeMap() {
return BarCodeBuilder.attributeTypeMap;
}
}
BarCodeBuilder.attributeTypeMap = [
{
"name": "typeOfBarCode",
"baseName": "TypeOfBarCode",
"type": "BarCodeType"
},
{
"name": "text",
"baseName": "Text",
"type": "string"
},
{
"name": "resolution",
"baseName": "Resolution",
"type": "Resolution"
},
{
"name": "dimensionX",
"baseName": "DimensionX",
"type": "number"
},
{
"name": "dimensionY",
"baseName": "DimensionY",
"type": "number"
},
{
"name": "codeLocation",
"baseName": "CodeLocation",
"type": "CodeLocation"
},
{
"name": "graphicsUnit",
"baseName": "GraphicsUnit",
"type": "GraphicsUnit"
},
{
"name": "autoSize",
"baseName": "AutoSize",
"type": "boolean"
},
{
"name": "barHeight",
"baseName": "BarHeight",
"type": "number"
},
{
"name": "imageHeight",
"baseName": "ImageHeight",
"type": "number"
},
{
"name": "imageWidth",
"baseName": "ImageWidth",
"type": "number"
},
{
"name": "imageQuality",
"baseName": "ImageQuality",
"type": "ImageQualityMode"
},
{
"name": "rotationAngle",
"baseName": "RotationAngle",
"type": "number"
},
{
"name": "margins",
"baseName": "Margins",
"type": "Margins"
},
{
"name": "backColor",
"baseName": "BackColor",
"type": "string"
},
{
"name": "foreColor",
"baseName": "ForeColor",
"type": "string"
},
{
"name": "codeTextColor",
"baseName": "CodeTextColor",
"type": "string"
},
{
"name": "borderColor",
"baseName": "BorderColor",
"type": "string"
},
{
"name": "borderVisible",
"baseName": "BorderVisible",
"type": "boolean"
},
{
"name": "enableChecksum",
"baseName": "EnableChecksum",
"type": "EnableChecksum"
}
];
exports.BarCodeBuilder = BarCodeBuilder;
/**
* Represents list of barcode builders
*/
class BarCodeBuildersList {
static getAttributeTypeMap() {
return BarCodeBuildersList.attributeTypeMap;
}
}
BarCodeBuildersList.attributeTypeMap = [
{
"name": "barCodeBuilders",
"baseName": "BarCodeBuilders",
"type": "Array<BarCodeBuilder>"
},
{
"name": "xStep",
"baseName": "XStep",
"type": "number"
},
{
"name": "yStep",
"baseName": "YStep",
"type": "number"
}
];
exports.BarCodeBuildersList = BarCodeBuildersList;
/**
* Represents BarCodeReader object.
*/
class BarCodeReader {
static getAttributeTypeMap() {
return BarCodeReader.attributeTypeMap;
}
}
BarCodeReader.attributeTypeMap = [
{
"name": "checksumValidation",
"baseName": "ChecksumValidation",
"type": "ChecksumValidation"
},
{
"name": "stripFNC",
"baseName": "StripFNC",
"type": "boolean"
},
{
"name": "barCodesCount",
"baseName": "BarCodesCount",
"type": "number"
},
{
"name": "rotationAngle",
"baseName": "RotationAngle",
"type": "number"
},
{
"name": "recognitionMode",
"baseName": "RecognitionMode",
"type": "RecognitionMode"
},
{
"name": "manualHints",
"baseName": "ManualHints",
"type": "ManualHints"
}
];
exports.BarCodeReader = BarCodeReader;
/**
* Represents information about barcode.
*/
class BarCodeResponse {
static getAttributeTypeMap() {
return BarCodeResponse.attributeTypeMap;
}
}
BarCodeResponse.attributeTypeMap = [
{
"name": "barCodeValue",
"baseName": "BarCodeValue",
"type": "string"
},
{
"name": "barCodeType",
"baseName": "BarCodeType",
"type": "string"
},
{
"name": "region",
"baseName": "Region",
"type": "Array<Point>"
},
{
"name": "checksum",
"baseName": "Checksum",
"type": "string"
}
];
exports.BarCodeResponse = BarCodeResponse;
/**
* Supported types of barcode for generation.
*/
var BarCodeType;
(function (BarCodeType) {
BarCodeType[BarCodeType["AustraliaPost"] = 0] = "AustraliaPost";
BarCodeType[BarCodeType["AustralianPosteParcel"] = 1] = "AustralianPosteParcel";
BarCodeType[BarCodeType["Aztec"] = 2] = "Aztec";
BarCodeType[BarCodeType["BooklandEAN"] = 3] = "BooklandEAN";
BarCodeType[BarCodeType["Codabar"] = 4] = "Codabar";
BarCodeType[BarCodeType["Code11"] = 5] = "Code11";
BarCodeType[BarCodeType["Code16K"] = 6] = "Code16K";
BarCodeType[BarCodeType["Code128"] = 7] = "Code128";
BarCodeType[BarCodeType["CodablockF"] = 8] = "CodablockF";
BarCodeType[BarCodeType["Code39Extended"] = 9] = "Code39Extended";
BarCodeType[BarCodeType["Code39Standard"] = 10] = "Code39Standard";
BarCodeType[BarCodeType["Code93Extended"] = 11] = "Code93Extended";
BarCodeType[BarCodeType["Code93Standard"] = 12] = "Code93Standard";
BarCodeType[BarCodeType["CompactPdf417"] = 13] = "CompactPdf417";
BarCodeType[BarCodeType["DatabarOmniDirectional"] = 14] = "DatabarOmniDirectional";
BarCodeType[BarCodeType["DatabarTruncated"] = 15] = "DatabarTruncated";
BarCodeType[BarCodeType["DatabarLimited"] = 16] = "DatabarLimited";
BarCodeType[BarCodeType["DatabarExpanded"] = 17] = "DatabarExpanded";
BarCodeType[BarCodeType["DatabarExpandedStacked"] = 18] = "DatabarExpandedStacked";
BarCodeType[BarCodeType["DatabarStacked"] = 19] = "DatabarStacked";
BarCodeType[BarCodeType["DatabarStackedOmniDirectional"] = 20] = "DatabarStackedOmniDirectional";
BarCodeType[BarCodeType["DataMatrix"] = 21] = "DataMatrix";
BarCodeType[BarCodeType["DeutschePostIdentcode"] = 22] = "DeutschePostIdentcode";
BarCodeType[BarCodeType["DeutschePostLeitcode"] = 23] = "DeutschePostLeitcode";
BarCodeType[BarCodeType["EAN128"] = 24] = "EAN128";
BarCodeType[BarCodeType["EAN13"] = 25] = "EAN13";
BarCodeType[BarCodeType["EAN14"] = 26] = "EAN14";
BarCodeType[BarCodeType["EAN8"] = 27] = "EAN8";
BarCodeType[BarCodeType["GS1Code128"] = 28] = "GS1Code128";
BarCodeType[BarCodeType["GS1CodablockF"] = 29] = "GS1CodablockF";
BarCodeType[BarCodeType["GS1DataMatrix"] = 30] = "GS1DataMatrix";
BarCodeType[BarCodeType["GS1QR"] = 31] = "GS1QR";
BarCodeType[BarCodeType["IATA2of5"] = 32] = "IATA2of5";
BarCodeType[BarCodeType["ISBN"] = 33] = "ISBN";
BarCodeType[BarCodeType["ISMN"] = 34] = "ISMN";
BarCodeType[BarCodeType["ISSN"] = 35] = "ISSN";
BarCodeType[BarCodeType["ITF14"] = 36] = "ITF14";
BarCodeType[BarCodeType["ITF6"] = 37] = "ITF6";
BarCodeType[BarCodeType["Interleaved2of5"] = 38] = "Interleaved2of5";
BarCodeType[BarCodeType["ItalianPost25"] = 39] = "ItalianPost25";
BarCodeType[BarCodeType["MaxiCode"] = 40] = "MaxiCode";
BarCodeType[BarCodeType["MSI"] = 41] = "MSI";
BarCodeType[BarCodeType["MicroPdf417"] = 42] = "MicroPdf417";
BarCodeType[BarCodeType["MacroPdf417"] = 43] = "MacroPdf417";
BarCodeType[BarCodeType["Matrix2of5"] = 44] = "Matrix2of5";
BarCodeType[BarCodeType["MicroQR"] = 45] = "MicroQR";
BarCodeType[BarCodeType["OPC"] = 46] = "OPC";
BarCodeType[BarCodeType["OneCode"] = 47] = "OneCode";
BarCodeType[BarCodeType["PZN"] = 48] = "PZN";
BarCodeType[BarCodeType["PatchCode"] = 49] = "PatchCode";
BarCodeType[BarCodeType["Pharmacode"] = 50] = "Pharmacode";
BarCodeType[BarCodeType["Pdf417"] = 51] = "Pdf417";
BarCodeType[BarCodeType["Planet"] = 52] = "Planet";
BarCodeType[BarCodeType["Postnet"] = 53] = "Postnet";
BarCodeType[BarCodeType["QR"] = 54] = "QR";
BarCodeType[BarCodeType["RM4SCC"] = 55] = "RM4SCC";
BarCodeType[BarCodeType["SingaporePost"] = 56] = "SingaporePost";
BarCodeType[BarCodeType["SCC14"] = 57] = "SCC14";
BarCodeType[BarCodeType["SSCC18"] = 58] = "SSCC18";
BarCodeType[BarCodeType["Standard2of5"] = 59] = "Standard2of5";
BarCodeType[BarCodeType["SwissPostParcel"] = 60] = "SwissPostParcel";
BarCodeType[BarCodeType["UPCA"] = 61] = "UPCA";
BarCodeType[BarCodeType["UPCE"] = 62] = "UPCE";
BarCodeType[BarCodeType["VIN"] = 63] = "VIN";
BarCodeType[BarCodeType["Code32"] = 64] = "Code32";
BarCodeType[BarCodeType["Datalogic2of5"] = 65] = "Datalogic2of5";
BarCodeType[BarCodeType["DotCode"] = 66] = "DotCode";
BarCodeType[BarCodeType["DutchKIX"] = 67] = "DutchKIX";
})(BarCodeType = exports.BarCodeType || (exports.BarCodeType = {}));
/**
* Represents checksum validation property.
*/
var ChecksumValidation;
(function (ChecksumValidation) {
ChecksumValidation[ChecksumValidation["Default"] = 0] = "Default";
ChecksumValidation[ChecksumValidation["On"] = 1] = "On";
ChecksumValidation[ChecksumValidation["Off"] = 2] = "Off";
})(ChecksumValidation = exports.ChecksumValidation || (exports.ChecksumValidation = {}));
/**
* Represents states of code location.
*/
var CodeLocation;
(function (CodeLocation) {
CodeLocation[CodeLocation["Above"] = 0] = "Above";
CodeLocation[CodeLocation["Below"] = 1] = "Below";
CodeLocation[CodeLocation["None"] = 2] = "None";
})(CodeLocation = exports.CodeLocation || (exports.CodeLocation = {}));
/**
* Represents checksum property.
*/
var EnableChecksum;
(function (EnableChecksum) {
EnableChecksum[EnableChecksum["Default"] = 0] = "Default";
EnableChecksum[EnableChecksum["Yes"] = 1] = "Yes";
EnableChecksum[EnableChecksum["No"] = 2] = "No";
})(EnableChecksum = exports.EnableChecksum || (exports.EnableChecksum = {}));
/**
*
*/
var GraphicsUnit;
(function (GraphicsUnit) {
GraphicsUnit[GraphicsUnit["World"] = 0] = "World";
GraphicsUnit[GraphicsUnit["Display"] = 1] = "Display";
GraphicsUnit[GraphicsUnit["Pixel"] = 2] = "Pixel";
GraphicsUnit[GraphicsUnit["Point"] = 3] = "Point";
GraphicsUnit[GraphicsUnit["Inch"] = 4] = "Inch";
GraphicsUnit[GraphicsUnit["Document"] = 5] = "Document";
GraphicsUnit[GraphicsUnit["Millimeter"] = 6] = "Millimeter";
})(GraphicsUnit = exports.GraphicsUnit || (exports.GraphicsUnit = {}));
/**
*
*/
var HttpStatusCode;
(function (HttpStatusCode) {
HttpStatusCode[HttpStatusCode["Continue"] = 0] = "Continue";
HttpStatusCode[HttpStatusCode["SwitchingProtocols"] = 1] = "SwitchingProtocols";
HttpStatusCode[HttpStatusCode["OK"] = 2] = "OK";
HttpStatusCode[HttpStatusCode["Created"] = 3] = "Created";
HttpStatusCode[HttpStatusCode["Accepted"] = 4] = "Accepted";
HttpStatusCode[HttpStatusCode["NonAuthoritativeInformation"] = 5] = "NonAuthoritativeInformation";
HttpStatusCode[HttpStatusCode["NoContent"] = 6] = "NoContent";
HttpStatusCode[HttpStatusCode["ResetContent"] = 7] = "ResetContent";
HttpStatusCode[HttpStatusCode["PartialContent"] = 8] = "PartialContent";
HttpStatusCode[HttpStatusCode["MultipleChoices"] = 9] = "MultipleChoices";
HttpStatusCode[HttpStatusCode["Ambiguous"] = 10] = "Ambiguous";
HttpStatusCode[HttpStatusCode["MovedPermanently"] = 11] = "MovedPermanently";
HttpStatusCode[HttpStatusCode["Moved"] = 12] = "Moved";
HttpStatusCode[HttpStatusCode["Found"] = 13] = "Found";
HttpStatusCode[HttpStatusCode["Redirect"] = 14] = "Redirect";
HttpStatusCode[HttpStatusCode["SeeOther"] = 15] = "SeeOther";
HttpStatusCode[HttpStatusCode["RedirectMethod"] = 16] = "RedirectMethod";
HttpStatusCode[HttpStatusCode["NotModified"] = 17] = "NotModified";
HttpStatusCode[HttpStatusCode["UseProxy"] = 18] = "UseProxy";
HttpStatusCode[HttpStatusCode["Unused"] = 19] = "Unused";
HttpStatusCode[HttpStatusCode["TemporaryRedirect"] = 20] = "TemporaryRedirect";
HttpStatusCode[HttpStatusCode["RedirectKeepVerb"] = 21] = "RedirectKeepVerb";
HttpStatusCode[HttpStatusCode["BadRequest"] = 22] = "BadRequest";
HttpStatusCode[HttpStatusCode["Unauthorized"] = 23] = "Unauthorized";
HttpStatusCode[HttpStatusCode["PaymentRequired"] = 24] = "PaymentRequired";
HttpStatusCode[HttpStatusCode["Forbidden"] = 25] = "Forbidden";
HttpStatusCode[HttpStatusCode["NotFound"] = 26] = "NotFound";
HttpStatusCode[HttpStatusCode["MethodNotAllowed"] = 27] = "MethodNotAllowed";
HttpStatusCode[HttpStatusCode["NotAcceptable"] = 28] = "NotAcceptable";
HttpStatusCode[HttpStatusCode["ProxyAuthenticationRequired"] = 29] = "ProxyAuthenticationRequired";
HttpStatusCode[HttpStatusCode["RequestTimeout"] = 30] = "RequestTimeout";
HttpStatusCode[HttpStatusCode["Conflict"] = 31] = "Conflict";
HttpStatusCode[HttpStatusCode["Gone"] = 32] = "Gone";
HttpStatusCode[HttpStatusCode["LengthRequired"] = 33] = "LengthRequired";
HttpStatusCode[HttpStatusCode["PreconditionFailed"] = 34] = "PreconditionFailed";
HttpStatusCode[HttpStatusCode["RequestEntityTooLarge"] = 35] = "RequestEntityTooLarge";
HttpStatusCode[HttpStatusCode["RequestUriTooLong"] = 36] = "RequestUriTooLong";
HttpStatusCode[HttpStatusCode["UnsupportedMediaType"] = 37] = "UnsupportedMediaType";
HttpStatusCode[HttpStatusCode["RequestedRangeNotSatisfiable"] = 38] = "RequestedRangeNotSatisfiable";
HttpStatusCode[HttpStatusCode["ExpectationFailed"] = 39] = "ExpectationFailed";
HttpStatusCode[HttpStatusCode["UpgradeRequired"] = 40] = "UpgradeRequired";
HttpStatusCode[HttpStatusCode["InternalServerError"] = 41] = "InternalServerError";
HttpStatusCode[HttpStatusCode["NotImplemented"] = 42] = "NotImplemented";
HttpStatusCode[HttpStatusCode["BadGateway"] = 43] = "BadGateway";
HttpStatusCode[HttpStatusCode["ServiceUnavailable"] = 44] = "ServiceUnavailable";
HttpStatusCode[HttpStatusCode["GatewayTimeout"] = 45] = "GatewayTimeout";
HttpStatusCode[HttpStatusCode["HttpVersionNotSupported"] = 46] = "HttpVersionNotSupported";
})(HttpStatusCode = exports.HttpStatusCode || (exports.HttpStatusCode = {}));
/**
* Represents type of image quality.
*/
var ImageQualityMode;
(function (ImageQualityMode) {
ImageQualityMode[ImageQualityMode["Default"] = 0] = "Default";
ImageQualityMode[ImageQualityMode["AntiAlias"] = 1] = "AntiAlias";
})(ImageQualityMode = exports.ImageQualityMode || (exports.ImageQualityMode = {}));
/**
* Represents the usage of manual hints.
*/
var ManualHints;
(function (ManualHints) {
ManualHints[ManualHints["None"] = 0] = "None";
ManualHints[ManualHints["InvertImage"] = 1] = "InvertImage";
ManualHints[ManualHints["IncorrectBarCodes"] = 2] = "IncorrectBarCodes";
ManualHints[ManualHints["ComplexBackground"] = 3] = "ComplexBackground";
ManualHints[ManualHints["MedianSmoothing"] = 4] = "MedianSmoothing";
ManualHints[ManualHints["SpecialFormOfCells"] = 5] = "SpecialFormOfCells";
ManualHints[ManualHints["UseRegular"] = 6] = "UseRegular";
ManualHints[ManualHints["UseRestoration"] = 7] = "UseRestoration";
ManualHints[ManualHints["SkipRotatedBarCodes"] = 8] = "SkipRotatedBarCodes";
})(ManualHints = exports.ManualHints || (exports.ManualHints = {}));
/**
* Represents margins around barcode.
*/
class Margins {
static getAttributeTypeMap() {
return Margins.attributeTypeMap;
}
}
Margins.attributeTypeMap = [
{
"name": "left",
"baseName": "Left",
"type": "number"
},
{
"name": "right",
"baseName": "Right",
"type": "number"
},
{
"name": "top",
"baseName": "Top",
"type": "number"
},
{
"name": "bottom",
"baseName": "Bottom",
"type": "number"
}
];
exports.Margins = Margins;
/**
* Represents the usage of recognition modes
*/
var RecognitionMode;
(function (RecognitionMode) {
RecognitionMode[RecognitionMode["MaxPerformance"] = 0] = "MaxPerformance";
RecognitionMode[RecognitionMode["MaxBarCodes"] = 1] = "MaxBarCodes";
RecognitionMode[RecognitionMode["MaxQuality"] = 2] = "MaxQuality";
RecognitionMode[RecognitionMode["ManualHints"] = 3] = "ManualHints";
})(RecognitionMode = exports.RecognitionMode || (exports.RecognitionMode = {}));
/**
* Represents resolutions of barcode.
*/
class Resolution {
static getAttributeTypeMap() {
return Resolution.attributeTypeMap;
}
}
Resolution.attributeTypeMap = [
{
"name": "resolutionX",
"baseName": "ResolutionX",
"type": "number"
},
{
"name": "resolutionY",
"baseName": "ResolutionY",
"type": "number"
}
];
exports.Resolution = Resolution;
class ValueType {
static getAttributeTypeMap() {
return ValueType.attributeTypeMap;
}
}
ValueType.attributeTypeMap = [];
exports.ValueType = ValueType;
/**
* Represents information about barcode list.
*/
class BarCodeResponseList extends AsposeResponse {
static getAttributeTypeMap() {
return super.getAttributeTypeMap().concat(BarCodeResponseList.attributeTypeMap);
}
}
BarCodeResponseList.attributeTypeMap = [
{
"name": "barCodes",
"baseName": "BarCodes",
"type": "Array<BarCodeResponse>"
}
];
exports.BarCodeResponseList = BarCodeResponseList;
class Point extends ValueType {
static getAttributeTypeMap() {
return super.getAttributeTypeMap().concat(Point.attributeTypeMap);
}
}
Point.attributeTypeMap = [
{
"name": "isEmpty",
"baseName": "IsEmpty",
"type": "boolean"
},
{
"name": "X",
"baseName": "X",
"type": "number"
},
{
"name": "Y",
"baseName": "Y",
"type": "number"
}
];
exports.Point = Point;
let enumsMap = {
"BarCodeType": BarCodeType,
"ChecksumValidation": ChecksumValidation,
"CodeLocation": CodeLocation,
"EnableChecksum": EnableChecksum,
"GraphicsUnit": GraphicsUnit,
"HttpStatusCode": HttpStatusCode,
"ImageQualityMode": ImageQualityMode,
"ManualHints": ManualHints,
"RecognitionMode": RecognitionMode,
};
let typeMap = {
"AsposeResponse": AsposeResponse,
"BarCodeBuilder": BarCodeBuilder,
"BarCodeBuildersList": BarCodeBuildersList,
"BarCodeReader": BarCodeReader,
"BarCodeResponse": BarCodeResponse,
"Margins": Margins,
"Resolution": Resolution,
"ValueType": ValueType,
"BarCodeResponseList": BarCodeResponseList,
"Point": Point,
};
var BarCodeApiApiKeys;
(function (BarCodeApiApiKeys) {
BarCodeApiApiKeys[BarCodeApiApiKeys["appsid"] = 0] = "appsid";
BarCodeApiApiKeys[BarCodeApiApiKeys["signature"] = 1] = "signature";
})(BarCodeApiApiKeys = exports.BarCodeApiApiKeys || (exports.BarCodeApiApiKeys = {}));
class BarCodeApi {
constructor(appSID, appKey, version) {
this.defaultHeaders = {};
this._configuration = new configuration_1.Configuration(appSID, appKey, version);
}
/**
*
* @summary Generate barcode.
* @param text The code text.
* @param type BarCode type.
* @param format Result format.
* @param resolutionX Horizontal resolution.
* @param resolutionY Vertical resolution.
* @param dimensionX Smallest width of barcode unit (bar or space).
* @param dimensionY Smallest height of barcode unit (for 2D barcodes).
* @param enableChecksum Sets if checksum will be generated.
*/
barCodeGetBarCodeGenerate(text, type, format, resolutionX, resolutionY, dimensionX, dimensionY, enableChecksum) {
return __awaiter(this, void 0, void 0, function* () {
const localVarPath = this._configuration.getApiBaseUrl() + '/barcode/generate';
let localVarQueryParameters = {};
let localVarHeaderParams = Object.assign({}, this.defaultHeaders);
let localVarFormParams = {};
if (text !== undefined) {
localVarQueryParameters['text'] = ObjectSerializer.serialize(text, "string");
}
if (type !== undefined) {
localVarQueryParameters['type'] = ObjectSerializer.serialize(type, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "string");
}
if (resolutionX !== undefined) {
localVarQueryParameters['resolutionX'] = ObjectSerializer.serialize(resolutionX, "number");
}
if (resolutionY !== undefined) {
localVarQueryParameters['resolutionY'] = ObjectSerializer.serialize(resolutionY, "number");
}
if (dimensionX !== undefined) {
localVarQueryParameters['dimensionX'] = ObjectSerializer.serialize(dimensionX, "number");
}
if (dimensionY !== undefined) {
localVarQueryParameters['dimensionY'] = ObjectSerializer.serialize(dimensionY, "number");
}
if (enableChecksum !== undefined) {
localVarQueryParameters['enableChecksum'] = ObjectSerializer.serialize(enableChecksum, "string");
}
let localVarUseFormData = false;
let localVarRequestOptions = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
json: true,
encoding: null,
};
yield this._configuration.authentication.applyToRequest(localVarRequestOptions);
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
localVarRequestOptions.formData = localVarFormParams;
}
else {
localVarRequestOptions.form = localVarFormParams;
}
}
return yield new Promise((resolve, reject) => {
var handler = (error, response, body, allowRepeat) => __awaiter(this, void 0, void 0, function* () {
if (error) {
reject(error);
}
else {
body = ObjectSerializer.deserialize(body, "Buffer");
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
}
else if (allowRepeat && response.statusCode && response.statusCode === 401) {
yield this._configuration.authentication.applyUnauthorized();
yield handler(error, response, body, false);
}
else {
reject({ response: response, body: body });
}
}
});
localVarRequest(localVarRequestOptions, (error, response, body) => handler(error, response, body, true));
});
});
}
/**
*
* @summary Recognize barcode from a file on server.
* @param name The image name.
* @param type The barcode type.
* @param checksumValidation Checksum validation parameter.
* @param stripFnc Allows to strip FNC symbol in recognition results.
* @param rotationAngle Allows to correct angle of barcode.
* @param barcodesCount Count of barcodes to recognize.
* @param rectX Top left point X coordinate of to recognize barcode inside.
* @param rectY Top left point Y coordinate of to recognize barcode inside.
* @param rectWidth Width of to recognize barcode inside.
* @param rectHeight Height of to recognize barcode inside.
* @param storage The image storage.
* @param folder The image folder.
*/
barCodeGetBarCodeRecognize(name, type, checksumValidation, stripFnc, rotationAngle, barcodesCount, rectX, rectY, rectWidth, rectHeight, storage, folder) {
return __awaiter(this, void 0, void 0, function* () {
const localVarPath = this._configuration.getApiBaseUrl() + '/barcode/{name}/recognize'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
let localVarQueryParameters = {};
let localVarHeaderParams = Object.assign({}, this.defaultHeaders);
let localVarFormParams = {};
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new Error('Required parameter name was null or undefined when calling barCodeGetBarCodeRecognize.');
}
if (type !== undefined) {
localVarQueryParameters['type'] = ObjectSerializer.serialize(type, "string");
}
if (checksumValidation !== undefined) {
localVarQueryParameters['checksumValidation'] = ObjectSerializer.serialize(checksumValidation, "string");
}
if (stripFnc !== undefined) {
localVarQueryParameters['stripFnc'] = ObjectSerializer.serialize(stripFnc, "boolean");
}
if (rotationAngle !== undefined) {
localVarQueryParameters['rotationAngle'] = ObjectSerializer.serialize(rotationAngle, "number");
}
if (barcodesCount !== undefined) {
localVarQueryParameters['barcodesCount'] = ObjectSerializer.serialize(barcodesCount, "number");
}
if (rectX !== undefined) {
localVarQueryParameters['rectX'] = ObjectSerializer.serialize(rectX, "number");
}
if (rectY !== undefined) {
localVarQueryParameters['rectY'] = ObjectSerializer.serialize(rectY, "number");
}
if (rectWidth !== undefined) {
localVarQueryParameters['rectWidth'] = ObjectSerializer.serialize(rectWidth, "number");
}
if (rectHeight !== undefined) {
localVarQueryParameters['rectHeight'] = ObjectSerializer.serialize(rectHeight, "number");
}
if (storage !== undefined) {
localVarQueryParameters['storage'] = ObjectSerializer.serialize(storage, "string");
}
if (folder !== undefined) {
localVarQueryParameters['folder'] = ObjectSerializer.serialize(folder, "string");
}
let localVarUseFormData = false;
let localVarRequestOptions = {
method: 'GET',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
json: true,
};
yield this._configuration.authentication.applyToRequest(localVarRequestOptions);
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
localVarRequestOptions.formData = localVarFormParams;
}
else {
localVarRequestOptions.form = localVarFormParams;
}
}
return yield new Promise((resolve, reject) => {
var handler = (error, response, body, allowRepeat) => __awaiter(this, void 0, void 0, function* () {
if (error) {
reject(error);
}
else {
body = ObjectSerializer.deserialize(body, "BarCodeResponseList");
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
}
else if (allowRepeat && response.statusCode && response.statusCode === 401) {
yield this._configuration.authentication.applyUnauthorized();
yield handler(error, response, body, false);
}
else {
reject({ response: response, body: body });
}
}
});
localVarRequest(localVarRequestOptions, (error, response, body) => handler(error, response, body, true));
});
});
}
/**
*
* @summary Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image or encoded with base64.
* @param type BarCode type.
* @param checksumValidation Checksum validation parameter.
* @param stripFnc Allows to strip FNC symbol in recognition results.
* @param rotationAngle Recognition of rotated barcode. Possible angles are 90, 180, 270, default is 0
* @param url The image file url.
* @param imageData Image data with image
*/
barCodePostBarCodeRecognizeFromUrlorContent(type, checksumValidation, stripFnc, rotationAngle, url, imageData) {
return __awaiter(this, void 0, void 0, function* () {
const localVarPath = this._configuration.getApiBaseUrl() + '/barcode/recognize';
let localVarQueryParameters = {};
let localVarHeaderParams = Object.assign({}, this.defaultHeaders);
let localVarFormParams = {};
if (type !== undefined) {
localVarQueryParameters['type'] = ObjectSerializer.serialize(type, "string");
}
if (checksumValidation !== undefined) {
localVarQueryParameters['checksumValidation'] = ObjectSerializer.serialize(checksumValidation, "string");
}
if (stripFnc !== undefined) {
localVarQueryParameters['stripFnc'] = ObjectSerializer.serialize(stripFnc, "boolean");
}
if (rotationAngle !== undefined) {
localVarQueryParameters['rotationAngle'] = ObjectSerializer.serialize(rotationAngle, "number");
}
if (url !== undefined) {
localVarQueryParameters['url'] = ObjectSerializer.serialize(url, "string");
}
let localVarUseFormData = false;
if (imageData !== undefined) {
localVarFormParams['imageData'] = imageData;
}
localVarUseFormData = true;
let localVarRequestOptions = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
json: true,
};
yield this._configuration.authentication.applyToRequest(localVarRequestOptions);
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
localVarRequestOptions.formData = localVarFormParams;
}
else {
localVarRequestOptions.form = localVarFormParams;
}
}
return yield new Promise((resolve, reject) => {
var handler = (error, response, body, allowRepeat) => __awaiter(this, void 0, void 0, function* () {
if (error) {
reject(error);
}
else {
body = ObjectSerializer.deserialize(body, "BarCodeResponseList");
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
}
else if (allowRepeat && response.statusCode && response.statusCode === 401) {
yield this._configuration.authentication.applyUnauthorized();
yield handler(error, response, body, false);
}
else {
reject({ response: response, body: body });
}
}
});
localVarRequest(localVarRequestOptions, (error, response, body) => handler(error, response, body, true));
});
});
}
/**
*
* @summary Generate multiple barcodes and return in response stream
* @param dto List of barcodes
* @param format Format to return stream in
*/
barCodePostGenerateMultiple(dto, format) {
return __awaiter(this, void 0, void 0, function* () {
const localVarPath = this._configuration.getApiBaseUrl() + '/barcode/generateMultiple';
let localVarQueryParameters = {};
let localVarHeaderParams = Object.assign({}, this.defaultHeaders);
let localVarFormParams = {};
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "string");
}
let localVarUseFormData = false;
let localVarRequestOptions = {
method: 'POST',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
json: true,
encoding: null,
body: ObjectSerializer.serialize(dto, "BarCodeBuildersList")
};
yield this._configuration.authentication.applyToRequest(localVarRequestOptions);
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
localVarRequestOptions.formData = localVarFormParams;
}
else {
localVarRequestOptions.form = localVarFormParams;
}
}
return yield new Promise((resolve, reject) => {
var handler = (error, response, body, allowRepeat) => __awaiter(this, void 0, void 0, function* () {
if (error) {
reject(error);
}
else {
body = ObjectSerializer.deserialize(body, "Buffer");
if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
resolve({ response: response, body: body });
}
else if (allowRepeat && response.statusCode && response.statusCode === 401) {
yield this._configuration.authentication.applyUnauthorized();
yield handler(error, response, body, false);
}
else {
reject({ response: response, body: body });
}
}
});
localVarRequest(localVarRequestOptions, (error, response, body) => handler(error, response, body, true));
});
});
}
/**
*
* @summary Generate barcode and save on server.
* @param name The image name.
* @param file File to upload
* @param text BarCode's text.
* @param type The barcode type.
* @param format The image format.
* @param resolutionX Horizontal resolution.
* @param resolutionY Vertical resolution.
* @param dimensionX Smallest width of barcode unit (bar or space).
* @param dimensionY Smallest height of barcode unit (for 2D barcodes).
* @param codeLocation property of the barcode.
* @param grUnit Measurement of barcode properties.
* @param autoSize Sets if barcode size will be updated automatically.
* @param barHeight Height of the bar.
* @param imageHeight Height of the image.
* @param imageWidth Width of the image.
* @param imageQuality Detepmines of the barcode image.
* @param rotAngle Angle of barcode orientation.
* @param topMargin Top margin.
* @param bottomMargin Bottom margin.
* @param leftMargin Left margin.
* @param rightMargin Right margin.
* @param enableChecksum Sets if checksum will be generated.
* @param storage Image's storage.
* @param folder Image's folder.
*/
barCodePutBarCodeGenerateFile(name, file, text, type, format, resolutionX, resolutionY, dimensionX, dimensionY, codeLocation, grUnit, autoSize, barHeight, imageHeight, imageWidth, imageQuality, rotAngle, topMargin, bottomMargin, leftMargin, rightMargin, enableChecksum, storage, folder) {
return __awaiter(this, void 0, void 0, function* () {
const localVarPath = this._configuration.getApiBaseUrl() + '/barcode/{name}/generate'
.replace('{' + 'name' + '}', encodeURIComponent(String(name)));
let localVarQueryParameters = {};
let localVarHeaderParams = Object.assign({}, this.defaultHeaders);
let localVarFormParams = {};
// verify required parameter 'name' is not null or undefined
if (name === null || name === undefined) {
throw new Error('Required parameter name was null or undefined when calling barCodePutBarCodeGenerateFile.');
}
// verify required parameter 'file' is not null or undefined
if (file === null || file === undefined) {
throw new Error('Required parameter file was null or undefined when calling barCodePutBarCodeGenerateFile.');
}
if (text !== undefined) {
localVarQueryParameters['text'] = ObjectSerializer.serialize(text, "string");
}
if (type !== undefined) {
localVarQueryParameters['type'] = ObjectSerializer.serialize(type, "string");
}
if (format !== undefined) {
localVarQueryParameters['format'] = ObjectSerializer.serialize(format, "string");
}
if (resolutionX !== undefined) {
localVarQueryParameters['resolutionX'] = ObjectSerializer.serialize(resolutionX, "number");
}
if (resolutionY !== undefined) {
localVarQueryParameters['resolutionY'] = ObjectSerializer.serialize(resolutionY, "number");
}
if (dimensionX !== undefined) {
localVarQueryParameters['dimensionX'] = ObjectSerializer.serialize(dimensionX, "number");
}
if (dimensionY !== undefined) {
localVarQueryParameters['dimensionY'] = ObjectSerializer.serialize(dimensionY, "number");
}
if (codeLocation !== undefined) {
localVarQueryParameters['codeLocation'] = ObjectSerializer.serialize(codeLocation, "string");
}
if (grUnit !== undefined) {
localVarQueryParameters['grUnit'] = ObjectSerializer.serialize(grUnit, "string");
}
if (autoSize !== undefined) {
localVarQueryParameters['autoSize'] = ObjectSerializer.serialize(autoSize, "string");
}
if (barHeight !== undefined) {
localVarQueryParameters['barHeight'] = ObjectSerializer.serialize(barHeight, "number");
}
if (imageHeight !== undefined) {
localVarQueryParameters['imageHeight'] = ObjectSerializer.serialize(imageHeight, "number");
}
if (imageWidth !== undefined) {
localVarQueryParameters['imageWidth'] = ObjectSerializer.serialize(imageWidth, "number");
}
if (imageQuality !== undefined) {
localVarQueryParameters['imageQuality'] = ObjectSerializer.serialize(imageQuality, "string");
}
if (rotAngle !== undefined) {
localVarQueryParameters['rotAngle'] = ObjectSerializer.serialize(rotAngle, "number");
}
if (topMargin !== undefined) {
localVarQueryParameters['topMargin'] = ObjectSerializer.serialize(topMargin, "number");
}
if (bottomMargin !== undefined) {
localVarQueryParameters['bottomMargin'] = ObjectSerializer.serialize(bottomMargin, "number");
}
if (leftMargin !== undefined) {
localVarQueryParameters['leftMargin'] = ObjectSerializer.serialize(leftMargin, "number");
}
if (rightMargin !== undefined) {
localVarQueryParameters['rightMargin'] = ObjectSerializer.serialize(rightMargin, "number");
}
if (enableChecksum !== undefined) {
localVarQueryParameters['enableChecksum'] = ObjectSerializer.serialize(enableChecksum, "string");
}
if (storage !== undefined) {
localVarQueryParameters['storage'] = ObjectSerializer.serialize(storage, "string");
}
if (folder !== undefined) {
localVarQueryParameters['folder'] = ObjectSerializer.serialize(folder, "string");
}
let localVarUseFormData = false;
if (file !== undefined) {
localVarFormParams['File'] = file;
}
localVarUseFormData = true;
let localVarRequestOptions = {
method: 'PUT',
qs: localVarQueryParameters,
headers: localVarHeaderParams,
uri: localVarPath,
json: true,
};
yield this._configuration.authentication.applyToRequest(localVarRequestOptions);
if (Object.keys(localVarFormParams).length) {
if (localVarUseFormData) {
localVarRequestOptions.formData = localVarFormParams;
}
else {
localVarRequestOptions.form = localVarFormParams;
}
}
return yield new Promis