aspose-barcode-cloud-node 25.4.0 → 25.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/index.d.mts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -67,28 +67,28 @@ declare class BarcodeImageParams {
|
|
|
67
67
|
'imageFormat'?: BarcodeImageFormat;
|
|
68
68
|
'textLocation'?: CodeLocation;
|
|
69
69
|
/**
|
|
70
|
-
* Specify the displaying bars and content Color.
|
|
70
|
+
* Specify the displaying bars and content Color. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: Black.
|
|
71
71
|
*/
|
|
72
72
|
'foregroundColor'?: string;
|
|
73
73
|
/**
|
|
74
|
-
* Background color of the barcode image.
|
|
74
|
+
* Background color of the barcode image. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: White.
|
|
75
75
|
*/
|
|
76
76
|
'backgroundColor'?: string;
|
|
77
77
|
'units'?: GraphicsUnit;
|
|
78
78
|
/**
|
|
79
|
-
* Resolution of the BarCode image.
|
|
79
|
+
* Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. Decimal separator is dot.
|
|
80
80
|
*/
|
|
81
81
|
'resolution'?: number;
|
|
82
82
|
/**
|
|
83
|
-
* Height of the barcode image in given units. Default units: pixel.
|
|
83
|
+
* Height of the barcode image in given units. Default units: pixel. Decimal separator is dot.
|
|
84
84
|
*/
|
|
85
85
|
'imageHeight'?: number;
|
|
86
86
|
/**
|
|
87
|
-
* Width of the barcode image in given units. Default units: pixel.
|
|
87
|
+
* Width of the barcode image in given units. Default units: pixel. Decimal separator is dot.
|
|
88
88
|
*/
|
|
89
89
|
'imageWidth'?: number;
|
|
90
90
|
/**
|
|
91
|
-
* BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation.
|
|
91
|
+
* BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0.
|
|
92
92
|
*/
|
|
93
93
|
'rotationAngle'?: number;
|
|
94
94
|
static attributeTypeMap: Array<{
|
|
@@ -575,11 +575,11 @@ declare class GenerateMultipartRequestWrapper {
|
|
|
575
575
|
*/
|
|
576
576
|
'textLocation'?: CodeLocation;
|
|
577
577
|
/**
|
|
578
|
-
* Specify the displaying bars and content Color.
|
|
578
|
+
* Specify the displaying bars and content Color. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: Black.
|
|
579
579
|
*/
|
|
580
580
|
'foregroundColor'?: string;
|
|
581
581
|
/**
|
|
582
|
-
* Background color of the barcode image.
|
|
582
|
+
* Background color of the barcode image. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: White.
|
|
583
583
|
*/
|
|
584
584
|
'backgroundColor'?: string;
|
|
585
585
|
/**
|
|
@@ -587,19 +587,19 @@ declare class GenerateMultipartRequestWrapper {
|
|
|
587
587
|
*/
|
|
588
588
|
'units'?: GraphicsUnit;
|
|
589
589
|
/**
|
|
590
|
-
* Resolution of the BarCode image.
|
|
590
|
+
* Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. Decimal separator is dot.
|
|
591
591
|
*/
|
|
592
592
|
'resolution'?: number;
|
|
593
593
|
/**
|
|
594
|
-
* Height of the barcode image in given units. Default units: pixel.
|
|
594
|
+
* Height of the barcode image in given units. Default units: pixel. Decimal separator is dot.
|
|
595
595
|
*/
|
|
596
596
|
'imageHeight'?: number;
|
|
597
597
|
/**
|
|
598
|
-
* Width of the barcode image in given units. Default units: pixel.
|
|
598
|
+
* Width of the barcode image in given units. Default units: pixel. Decimal separator is dot.
|
|
599
599
|
*/
|
|
600
600
|
'imageWidth'?: number;
|
|
601
601
|
/**
|
|
602
|
-
* BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation.
|
|
602
|
+
* BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0.
|
|
603
603
|
*/
|
|
604
604
|
'rotationAngle'?: number;
|
|
605
605
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -67,28 +67,28 @@ declare class BarcodeImageParams {
|
|
|
67
67
|
'imageFormat'?: BarcodeImageFormat;
|
|
68
68
|
'textLocation'?: CodeLocation;
|
|
69
69
|
/**
|
|
70
|
-
* Specify the displaying bars and content Color.
|
|
70
|
+
* Specify the displaying bars and content Color. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: Black.
|
|
71
71
|
*/
|
|
72
72
|
'foregroundColor'?: string;
|
|
73
73
|
/**
|
|
74
|
-
* Background color of the barcode image.
|
|
74
|
+
* Background color of the barcode image. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: White.
|
|
75
75
|
*/
|
|
76
76
|
'backgroundColor'?: string;
|
|
77
77
|
'units'?: GraphicsUnit;
|
|
78
78
|
/**
|
|
79
|
-
* Resolution of the BarCode image.
|
|
79
|
+
* Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. Decimal separator is dot.
|
|
80
80
|
*/
|
|
81
81
|
'resolution'?: number;
|
|
82
82
|
/**
|
|
83
|
-
* Height of the barcode image in given units. Default units: pixel.
|
|
83
|
+
* Height of the barcode image in given units. Default units: pixel. Decimal separator is dot.
|
|
84
84
|
*/
|
|
85
85
|
'imageHeight'?: number;
|
|
86
86
|
/**
|
|
87
|
-
* Width of the barcode image in given units. Default units: pixel.
|
|
87
|
+
* Width of the barcode image in given units. Default units: pixel. Decimal separator is dot.
|
|
88
88
|
*/
|
|
89
89
|
'imageWidth'?: number;
|
|
90
90
|
/**
|
|
91
|
-
* BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation.
|
|
91
|
+
* BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0.
|
|
92
92
|
*/
|
|
93
93
|
'rotationAngle'?: number;
|
|
94
94
|
static attributeTypeMap: Array<{
|
|
@@ -575,11 +575,11 @@ declare class GenerateMultipartRequestWrapper {
|
|
|
575
575
|
*/
|
|
576
576
|
'textLocation'?: CodeLocation;
|
|
577
577
|
/**
|
|
578
|
-
* Specify the displaying bars and content Color.
|
|
578
|
+
* Specify the displaying bars and content Color. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: Black.
|
|
579
579
|
*/
|
|
580
580
|
'foregroundColor'?: string;
|
|
581
581
|
/**
|
|
582
|
-
* Background color of the barcode image.
|
|
582
|
+
* Background color of the barcode image. Value: Color name from https://reference.aspose.com/drawing/net/system.drawing/color/ or ARGB value started with #. For example: AliceBlue or #FF000000 Default value: White.
|
|
583
583
|
*/
|
|
584
584
|
'backgroundColor'?: string;
|
|
585
585
|
/**
|
|
@@ -587,19 +587,19 @@ declare class GenerateMultipartRequestWrapper {
|
|
|
587
587
|
*/
|
|
588
588
|
'units'?: GraphicsUnit;
|
|
589
589
|
/**
|
|
590
|
-
* Resolution of the BarCode image.
|
|
590
|
+
* Resolution of the BarCode image. One value for both dimensions. Default value: 96 dpi. Decimal separator is dot.
|
|
591
591
|
*/
|
|
592
592
|
'resolution'?: number;
|
|
593
593
|
/**
|
|
594
|
-
* Height of the barcode image in given units. Default units: pixel.
|
|
594
|
+
* Height of the barcode image in given units. Default units: pixel. Decimal separator is dot.
|
|
595
595
|
*/
|
|
596
596
|
'imageHeight'?: number;
|
|
597
597
|
/**
|
|
598
|
-
* Width of the barcode image in given units. Default units: pixel.
|
|
598
|
+
* Width of the barcode image in given units. Default units: pixel. Decimal separator is dot.
|
|
599
599
|
*/
|
|
600
600
|
'imageWidth'?: number;
|
|
601
601
|
/**
|
|
602
|
-
* BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation.
|
|
602
|
+
* BarCode image rotation angle, measured in degree, e.g. RotationAngle = 0 or RotationAngle = 360 means no rotation. If RotationAngle NOT equal to 90, 180, 270 or 0, it may increase the difficulty for the scanner to read the image. Default value: 0.
|
|
603
603
|
*/
|
|
604
604
|
'rotationAngle'?: number;
|
|
605
605
|
/**
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";var St=Object.create;var C=Object.defineProperty;var wt=Object.getOwnPropertyDescriptor;var Ht=Object.getOwnPropertyNames,dt=Object.getOwnPropertySymbols,It=Object.getPrototypeOf,yt=Object.prototype.hasOwnProperty,xt=Object.prototype.propertyIsEnumerable;var ht=(l,t,e)=>t in l?C(l,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):l[t]=e,b=(l,t)=>{for(var e in t||(t={}))yt.call(t,e)&&ht(l,e,t[e]);if(dt)for(var e of dt(t))xt.call(t,e)&&ht(l,e,t[e]);return l};var zt=(l,t)=>{for(var e in t)C(l,e,{get:t[e],enumerable:!0})},Ct=(l,t,e,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Ht(t))!yt.call(l,s)&&s!==e&&C(l,s,{get:()=>t[s],enumerable:!(i=wt(t,s))||i.enumerable});return l};var et=(l,t,e)=>(e=l!=null?St(It(l)):{},Ct(t||!l||!l.__esModule?C(e,"default",{value:l,enumerable:!0}):e,l)),Nt=l=>Ct(C({},"__esModule",{value:!0}),l);var m=(l,t,e)=>new Promise((i,s)=>{var r=c=>{try{p(e.next(c))}catch(g){s(g)}},o=c=>{try{p(e.throw(c))}catch(g){s(g)}},p=c=>c.done?i(c.value):Promise.resolve(c.value).then(r,o);p((e=e.apply(l,t)).next())});var Ot={};zt(Ot,{ApiError:()=>R,ApiErrorResponse:()=>A,ApiVersion:()=>Mt,BarcodeImageFormat:()=>D,BarcodeImageParams:()=>M,BarcodeResponse:()=>S,BarcodeResponseList:()=>w,CodeLocation:()=>j,Configuration:()=>bt,DecodeBarcodeType:()=>Q,EncodeBarcodeType:()=>V,EncodeData:()=>H,EncodeDataType:()=>$,GenerateApi:()=>pt,GenerateBodyRequestWrapper:()=>rt,GenerateMultipartRequestWrapper:()=>it,GenerateParams:()=>I,GenerateRequestWrapper:()=>at,GraphicsUnit:()=>X,RecognitionImageKind:()=>J,RecognitionMode:()=>E,RecognizeApi:()=>mt,RecognizeBase64Request:()=>x,RecognizeBase64RequestWrapper:()=>st,RecognizeMultipartRequestWrapper:()=>ot,RecognizeRequestWrapper:()=>nt,RegionPoint:()=>z,ScanApi:()=>ft,ScanBase64Request:()=>N,ScanBase64RequestWrapper:()=>ut,ScanMultipartRequestWrapper:()=>ct,ScanRequestWrapper:()=>lt});module.exports=Nt(Ot);var Pt=et(require("http")),Rt=et(require("https")),f=class{requestAsync(t){let e=t.qs?new URL(`?${new URLSearchParams(t.qs).toString()}`,t.uri):new URL(t.uri),i=this.buildRequestBody(t),s={method:t.method,headers:t.headers},r=t.encoding===null?null:t.encoding||"utf-8";return this.doHttpRequest(e,i,s,r)}buildRequestBody(t){let e=t.body;return t.form&&(e=new URLSearchParams(t.form).toString(),t.headers=Object.assign({"Content-Type":"application/x-www-form-urlencoded"},t.headers)),t.json&&(e=JSON.stringify(t.body),t.headers=Object.assign({"Content-Type":"application/json"},t.headers)),e}doHttpRequest(t,e,i,s){return new Promise((r,o)=>{function p(g){s&&g.setEncoding(s);let Y=[];g.on("data",h=>{Y.push(h)}),g.on("end",()=>{let h=s?Y.join(""):Buffer.concat(Y),O={statusCode:g.statusCode,statusMessage:g.statusMessage,headers:g.headers,body:h};if(O.statusCode>=200&&O.statusCode<=299)r({response:O,body:h});else{var B={response:O,error:new Error(`Error on '${t}': ${g.statusCode} ${g.statusMessage}`),errorResponse:null},tt=null;try{tt=JSON.parse(h.toString())}catch(qt){}tt?B.errorResponse=tt:B.error.message+=`. ${h}`,o(B)}})}let c=t.protocol==="http:"?Pt.default.request(t,i,p):Rt.default.request(t,i,p);c.on("error",g=>{o({response:null,error:g,errorResponse:null})}),e&&c.write(e),c.end()})}};var At=et(require("crypto")),P=class{constructor(t,e,i,s){this.name=t;this.filename=e;this.data=i;this.contentType=s}},y=class{constructor(t,e){let i=At.default.randomUUID();this.boundary="------------------------"+i.replace(/-/g,"");let s=[];for(let r of t)s.push(`--${this.boundary}`),s.push(`Content-Disposition: form-data; name="${r[0]}"`),s.push(""),s.push(r[1]);for(let r of e||[])s.push(`--${this.boundary}`),s.push(`Content-Disposition: form-data; name="${r.name}"; filename="${r.filename||"filename"}"`),s.push(`Content-Type: ${r.contentType||"application/octet-stream"}`),s.push(""),s.push(r.data.toString("binary"));s.push(`--${this.boundary}--`),this.body=Buffer.from(s.join(`\r
|
|
2
|
-
`),"binary"),this.headers={"Content-Type":`multipart/form-data; boundary=${this.boundary}`,"Content-Length":this.body.length.toString()}}};var q=class q{static getAttributeTypeMap(){return q.attributeTypeMap}};q.attributeTypeMap=[{name:"code",baseName:"code",type:"string"},{name:"message",baseName:"message",type:"string"},{name:"description",baseName:"description",type:"string"},{name:"dateTime",baseName:"dateTime",type:"Date"},{name:"innerError",baseName:"innerError",type:"ApiError"}];var R=q,L=class L{static getAttributeTypeMap(){return L.attributeTypeMap}};L.attributeTypeMap=[{name:"requestId",baseName:"requestId",type:"string"},{name:"error",baseName:"error",type:"ApiError"}];var A=L,D=(r=>(r.Png="Png",r.Jpeg="Jpeg",r.Svg="Svg",r.Tiff="Tiff",r.Gif="Gif",r))(D||{}),k=class k{static getAttributeTypeMap(){return k.attributeTypeMap}};k.attributeTypeMap=[{name:"imageFormat",baseName:"imageFormat",type:"BarcodeImageFormat"},{name:"textLocation",baseName:"textLocation",type:"CodeLocation"},{name:"foregroundColor",baseName:"foregroundColor",type:"string"},{name:"backgroundColor",baseName:"backgroundColor",type:"string"},{name:"units",baseName:"units",type:"GraphicsUnit"},{name:"resolution",baseName:"resolution",type:"number"},{name:"imageHeight",baseName:"imageHeight",type:"number"},{name:"imageWidth",baseName:"imageWidth",type:"number"},{name:"rotationAngle",baseName:"rotationAngle",type:"number"}];var M=k,U=class U{static getAttributeTypeMap(){return U.attributeTypeMap}};U.attributeTypeMap=[{name:"barcodeValue",baseName:"barcodeValue",type:"string"},{name:"type",baseName:"type",type:"string"},{name:"region",baseName:"region",type:"Array<RegionPoint>"},{name:"checksum",baseName:"checksum",type:"string"}];var S=U,G=class G{static getAttributeTypeMap(){return G.attributeTypeMap}};G.attributeTypeMap=[{name:"barcodes",baseName:"barcodes",type:"Array<BarcodeResponse>"}];var w=G,j=(i=>(i.Below="Below",i.Above="Above",i.None="None",i))(j||{}),Q=(a=>(a.MostCommonlyUsed="MostCommonlyUsed",a.Qr="QR",a.AustraliaPost="AustraliaPost",a.AustralianPosteParcel="AustralianPosteParcel",a.Aztec="Aztec",a.Codabar="Codabar",a.CodablockF="CodablockF",a.Code11="Code11",a.Code128="Code128",a.Code16K="Code16K",a.Code32="Code32",a.Code39="Code39",a.Code39FullAscii="Code39FullASCII",a.Code93="Code93",a.CompactPdf417="CompactPdf417",a.DataLogic2of5="DataLogic2of5",a.DataMatrix="DataMatrix",a.DatabarExpanded="DatabarExpanded",a.DatabarExpandedStacked="DatabarExpandedStacked",a.DatabarLimited="DatabarLimited",a.DatabarOmniDirectional="DatabarOmniDirectional",a.DatabarStacked="DatabarStacked",a.DatabarStackedOmniDirectional="DatabarStackedOmniDirectional",a.DatabarTruncated="DatabarTruncated",a.DeutschePostIdentcode="DeutschePostIdentcode",a.DeutschePostLeitcode="DeutschePostLeitcode",a.DotCode="DotCode",a.DutchKix="DutchKIX",a.Ean13="EAN13",a.Ean14="EAN14",a.Ean8="EAN8",a.Gs1Aztec="GS1Aztec",a.Gs1Code128="GS1Code128",a.Gs1CompositeBar="GS1CompositeBar",a.Gs1DataMatrix="GS1DataMatrix",a.Gs1DotCode="GS1DotCode",a.Gs1HanXin="GS1HanXin",a.Gs1MicroPdf417="GS1MicroPdf417",a.Gs1Qr="GS1QR",a.HanXin="HanXin",a.HibcAztecLic="HIBCAztecLIC",a.HibcAztecPas="HIBCAztecPAS",a.HibcCode128Lic="HIBCCode128LIC",a.HibcCode128Pas="HIBCCode128PAS",a.HibcCode39Lic="HIBCCode39LIC",a.HibcCode39Pas="HIBCCode39PAS",a.HibcDataMatrixLic="HIBCDataMatrixLIC",a.HibcDataMatrixPas="HIBCDataMatrixPAS",a.Hibcqrlic="HIBCQRLIC",a.Hibcqrpas="HIBCQRPAS",a.Iata2of5="IATA2of5",a.Isbn="ISBN",a.Ismn="ISMN",a.Issn="ISSN",a.Itf14="ITF14",a.Itf6="ITF6",a.Interleaved2of5="Interleaved2of5",a.ItalianPost25="ItalianPost25",a.MacroPdf417="MacroPdf417",a.Mailmark="Mailmark",a.Matrix2of5="Matrix2of5",a.MaxiCode="MaxiCode",a.MicrE13B="MicrE13B",a.MicroPdf417="MicroPdf417",a.MicroQr="MicroQR",a.Msi="MSI",a.OneCode="OneCode",a.Opc="OPC",a.PatchCode="PatchCode",a.Pdf417="Pdf417",a.Pharmacode="Pharmacode",a.Planet="Planet",a.Postnet="Postnet",a.Pzn="PZN",a.RectMicroQr="RectMicroQR",a.Rm4Scc="RM4SCC",a.Scc14="SCC14",a.Sscc18="SSCC18",a.Standard2of5="Standard2of5",a.Supplement="Supplement",a.SwissPostParcel="SwissPostParcel",a.Upca="UPCA",a.Upce="UPCE",a.Vin="VIN",a))(Q||{}),V=(n=>(n.Qr="QR",n.AustraliaPost="AustraliaPost",n.AustralianPosteParcel="AustralianPosteParcel",n.Aztec="Aztec",n.Codabar="Codabar",n.CodablockF="CodablockF",n.Code11="Code11",n.Code128="Code128",n.Code16K="Code16K",n.Code32="Code32",n.Code39="Code39",n.Code39FullAscii="Code39FullASCII",n.Code93="Code93",n.DataLogic2of5="DataLogic2of5",n.DataMatrix="DataMatrix",n.DatabarExpanded="DatabarExpanded",n.DatabarExpandedStacked="DatabarExpandedStacked",n.DatabarLimited="DatabarLimited",n.DatabarOmniDirectional="DatabarOmniDirectional",n.DatabarStacked="DatabarStacked",n.DatabarStackedOmniDirectional="DatabarStackedOmniDirectional",n.DatabarTruncated="DatabarTruncated",n.DeutschePostIdentcode="DeutschePostIdentcode",n.DeutschePostLeitcode="DeutschePostLeitcode",n.DotCode="DotCode",n.DutchKix="DutchKIX",n.Ean13="EAN13",n.Ean14="EAN14",n.Ean8="EAN8",n.Gs1Aztec="GS1Aztec",n.Gs1CodablockF="GS1CodablockF",n.Gs1Code128="GS1Code128",n.Gs1DataMatrix="GS1DataMatrix",n.Gs1DotCode="GS1DotCode",n.Gs1HanXin="GS1HanXin",n.Gs1MicroPdf417="GS1MicroPdf417",n.Gs1Qr="GS1QR",n.HanXin="HanXin",n.Iata2of5="IATA2of5",n.Isbn="ISBN",n.Ismn="ISMN",n.Issn="ISSN",n.Itf14="ITF14",n.Itf6="ITF6",n.Interleaved2of5="Interleaved2of5",n.ItalianPost25="ItalianPost25",n.Msi="MSI",n.MacroPdf417="MacroPdf417",n.Mailmark="Mailmark",n.Matrix2of5="Matrix2of5",n.MaxiCode="MaxiCode",n.MicroPdf417="MicroPdf417",n.MicroQr="MicroQR",n.Opc="OPC",n.OneCode="OneCode",n.Pzn="PZN",n.PatchCode="PatchCode",n.Pdf417="Pdf417",n.Pharmacode="Pharmacode",n.Planet="Planet",n.Postnet="Postnet",n.Rm4Scc="RM4SCC",n.RectMicroQr="RectMicroQR",n.Scc14="SCC14",n.Sscc18="SSCC18",n.SingaporePost="SingaporePost",n.Standard2of5="Standard2of5",n.SwissPostParcel="SwissPostParcel",n.Upca="UPCA",n.Upce="UPCE",n.UpcaGs1Code128Coupon="UpcaGs1Code128Coupon",n.UpcaGs1DatabarCoupon="UpcaGs1DatabarCoupon",n.Vin="VIN",n))(V||{}),F=class F{static getAttributeTypeMap(){return F.attributeTypeMap}};F.attributeTypeMap=[{name:"dataType",baseName:"dataType",type:"EncodeDataType"},{name:"data",baseName:"data",type:"string"}];var H=F,$=(i=>(i.StringData="StringData",i.Base64Bytes="Base64Bytes",i.HexBytes="HexBytes",i))($||{}),_=class _{static getAttributeTypeMap(){return _.attributeTypeMap}};_.attributeTypeMap=[{name:"barcodeType",baseName:"barcodeType",type:"EncodeBarcodeType"},{name:"encodeData",baseName:"encodeData",type:"EncodeData"},{name:"barcodeImageParams",baseName:"barcodeImageParams",type:"BarcodeImageParams"}];var I=_,X=(s=>(s.Pixel="Pixel",s.Point="Point",s.Inch="Inch",s.Millimeter="Millimeter",s))(X||{}),J=(i=>(i.Photo="Photo",i.ScannedDocument="ScannedDocument",i.ClearImage="ClearImage",i))(J||{}),E=(i=>(i.Fast="Fast",i.Normal="Normal",i.Excellent="Excellent",i))(E||{}),v=class v{static getAttributeTypeMap(){return v.attributeTypeMap}};v.attributeTypeMap=[{name:"barcodeTypes",baseName:"barcodeTypes",type:"Array<DecodeBarcodeType>"},{name:"fileBase64",baseName:"fileBase64",type:"string"},{name:"recognitionMode",baseName:"recognitionMode",type:"RecognitionMode"},{name:"recognitionImageKind",baseName:"recognitionImageKind",type:"RecognitionImageKind"}];var x=v,K=class K{static getAttributeTypeMap(){return K.attributeTypeMap}};K.attributeTypeMap=[{name:"x",baseName:"x",type:"number"},{name:"y",baseName:"y",type:"number"}];var z=K,W=class W{static getAttributeTypeMap(){return W.attributeTypeMap}};W.attributeTypeMap=[{name:"fileBase64",baseName:"fileBase64",type:"string"}];var N=W,at=class{constructor(t,e){this.foregroundColor="'Black'";this.backgroundColor="'White'";this.barcodeType=t,this.data=e}},rt=class{constructor(t){this.generateParams=t}},it=class{constructor(t,e){this.foregroundColor="'Black'";this.backgroundColor="'White'";this.barcodeType=t,this.data=e}},nt=class{constructor(t,e){this.barcodeType=t,this.fileUrl=e}},st=class{constructor(t){this.recognizeBase64Request=t}},ot=class{constructor(t,e){this.barcodeType=t,this.fileBytes=e}},lt=class{constructor(t){this.fileUrl=t}},ut=class{constructor(t){this.scanBase64Request=t}},ct=class{constructor(t){this.fileBytes=t}};var gt=["string","boolean","double","integer","long","float","number","any"],u=class l{static findCorrectType(t,e){if(t==null||gt.indexOf(e.toLowerCase())!==-1||e==="Date"||T[e]||!d[e])return e;let i=d[e].discriminator;return i==null?e:t[i]?t[i]:e}static serialize(t,e){if(t==null||gt.indexOf(e.toLowerCase())!==-1)return t;if(e.lastIndexOf("Array<",0)===0){let r=e.replace("Array<","");r=r.substring(0,r.length-1);let o=[];for(let p in t){let c=t[p];o.push(l.serialize(c,r))}return o}if(e==="Date")return t.toString();if(T[e]&&Object.values(T[e]).includes(t)||!d[e])return t;let i=d[e].getAttributeTypeMap(),s={};for(let r in i){let o=i[r];s[o.baseName]=l.serialize(t[o.name],o.type)}return s}static deserialize(t,e){if(e=l.findCorrectType(t,e),t==null||gt.indexOf(e.toLowerCase())!==-1)return t;if(e.lastIndexOf("Array<",0)===0){let r=e.replace("Array<","");r=r.substring(0,r.length-1);let o=[];for(let p in t){let c=t[p];o.push(l.deserialize(c,r))}return o}if(e==="Date")return new Date(t);if(T[e]||!d[e])return t;typeof t=="string"&&(t=JSON.parse(t));let i=new d[e],s=d[e].getAttributeTypeMap();for(let r of s){let o=r.baseName.replace(/^(.)/,p=>p.toLowerCase());i[r.name]=l.deserialize(t[o],r.type)}return i}},T={BarcodeImageFormat:D,CodeLocation:j,DecodeBarcodeType:Q,EncodeBarcodeType:V,EncodeDataType:$,GraphicsUnit:X,RecognitionImageKind:J,RecognitionMode:E},d={ApiError:R,ApiErrorResponse:A,BarcodeImageParams:M,BarcodeResponse:S,BarcodeResponseList:w,EncodeData:H,GenerateParams:I,RecognizeBase64Request:x,RegionPoint:z,ScanBase64Request:N},pt=class{constructor(t){this.defaultHeaders={"x-aspose-client":"nodejs sdk","x-aspose-client-version":"25.4.0"};this._configuration=t,this._client=new f}generate(t){return m(this,null,function*(){let e=this._configuration.getApiBaseUrl()+"/barcode/generate/{barcodeType}".replace("{barcodeType}",String(t.barcodeType)),i={},s=Object.assign({},this.defaultHeaders);if(t.barcodeType==null)throw new Error("Required parameter request.barcodeType was null or undefined when calling generate.");if(t.data==null)throw new Error("Required parameter request.data was null or undefined when calling generate.");t.dataType!=null&&(i.dataType=u.serialize(t.dataType,"EncodeDataType")),t.data!=null&&(i.data=u.serialize(t.data,"string")),t.imageFormat!=null&&(i.imageFormat=u.serialize(t.imageFormat,"BarcodeImageFormat")),t.textLocation!=null&&(i.textLocation=u.serialize(t.textLocation,"CodeLocation")),t.foregroundColor!=null&&(i.foregroundColor=u.serialize(t.foregroundColor,"string")),t.backgroundColor!=null&&(i.backgroundColor=u.serialize(t.backgroundColor,"string")),t.units!=null&&(i.units=u.serialize(t.units,"GraphicsUnit")),t.resolution!=null&&(i.resolution=u.serialize(t.resolution,"number")),t.imageHeight!=null&&(i.imageHeight=u.serialize(t.imageHeight,"number")),t.imageWidth!=null&&(i.imageWidth=u.serialize(t.imageWidth,"number")),t.rotationAngle!=null&&(i.rotationAngle=u.serialize(t.rotationAngle,"number"));let r={method:"GET",qs:i,headers:s,uri:e,encoding:null};yield this._configuration.authentication.applyToRequestAsync(r);let o=yield this._client.requestAsync(r);return{response:o.response,body:u.deserialize(o.body,"Buffer")}})}generateBody(t){return m(this,null,function*(){let e=this._configuration.getApiBaseUrl()+"/barcode/generate-body",i={},s=Object.assign({},this.defaultHeaders);if(t.generateParams==null)throw new Error("Required parameter request.generateParams was null or undefined when calling generateBody.");let r={method:"POST",qs:i,headers:s,uri:e,body:u.serialize(t.generateParams,"GenerateParams"),json:!0,encoding:null};yield this._configuration.authentication.applyToRequestAsync(r);let o=yield this._client.requestAsync(r);return{response:o.response,body:u.deserialize(o.body,"Buffer")}})}generateMultipart(t){return m(this,null,function*(){let e=this._configuration.getApiBaseUrl()+"/barcode/generate-multipart",i={},s=Object.assign({},this.defaultHeaders),r=[];if(t.barcodeType==null)throw new Error("Required parameter request.barcodeType was null or undefined when calling generateMultipart.");if(t.data==null)throw new Error("Required parameter request.data was null or undefined when calling generateMultipart.");t.barcodeType!=null&&r.push(["barcodeType",u.serialize(t.barcodeType,"EncodeBarcodeType")]),t.dataType!=null&&r.push(["dataType",u.serialize(t.dataType,"EncodeDataType")]),t.data!=null&&r.push(["data",u.serialize(t.data,"string")]),t.imageFormat!=null&&r.push(["imageFormat",u.serialize(t.imageFormat,"BarcodeImageFormat")]),t.textLocation!=null&&r.push(["textLocation",u.serialize(t.textLocation,"CodeLocation")]),t.foregroundColor!=null&&r.push(["foregroundColor",u.serialize(t.foregroundColor,"string")]),t.backgroundColor!=null&&r.push(["backgroundColor",u.serialize(t.backgroundColor,"string")]),t.units!=null&&r.push(["units",u.serialize(t.units,"GraphicsUnit")]),t.resolution!=null&&r.push(["resolution",u.serialize(t.resolution,"number")]),t.imageHeight!=null&&r.push(["imageHeight",u.serialize(t.imageHeight,"number")]),t.imageWidth!=null&&r.push(["imageWidth",u.serialize(t.imageWidth,"number")]),t.rotationAngle!=null&&r.push(["rotationAngle",u.serialize(t.rotationAngle,"number")]);let o={method:"POST",qs:i,headers:s,uri:e,encoding:null},p=new Array,c=new y(r,p);o.body=c.body,o.headers=b(b({},o.headers),c.headers),yield this._configuration.authentication.applyToRequestAsync(o);let g=yield this._client.requestAsync(o);return{response:g.response,body:u.deserialize(g.body,"Buffer")}})}},mt=class{constructor(t){this.defaultHeaders={"x-aspose-client":"nodejs sdk","x-aspose-client-version":"25.4.0"};this._configuration=t,this._client=new f}recognize(t){return m(this,null,function*(){let e=this._configuration.getApiBaseUrl()+"/barcode/recognize",i={},s=Object.assign({},this.defaultHeaders);if(t.barcodeType==null)throw new Error("Required parameter request.barcodeType was null or undefined when calling recognize.");if(t.fileUrl==null)throw new Error("Required parameter request.fileUrl was null or undefined when calling recognize.");t.barcodeType!=null&&(i.barcodeType=u.serialize(t.barcodeType,"DecodeBarcodeType")),t.fileUrl!=null&&(i.fileUrl=u.serialize(t.fileUrl,"string")),t.recognitionMode!=null&&(i.recognitionMode=u.serialize(t.recognitionMode,"RecognitionMode")),t.recognitionImageKind!=null&&(i.recognitionImageKind=u.serialize(t.recognitionImageKind,"RecognitionImageKind"));let r={method:"GET",qs:i,headers:s,uri:e};yield this._configuration.authentication.applyToRequestAsync(r);let o=yield this._client.requestAsync(r);return{response:o.response,body:u.deserialize(o.body,"BarcodeResponseList")}})}recognizeBase64(t){return m(this,null,function*(){let e=this._configuration.getApiBaseUrl()+"/barcode/recognize-body",i={},s=Object.assign({},this.defaultHeaders);if(t.recognizeBase64Request==null)throw new Error("Required parameter request.recognizeBase64Request was null or undefined when calling recognizeBase64.");let r={method:"POST",qs:i,headers:s,uri:e,body:u.serialize(t.recognizeBase64Request,"RecognizeBase64Request"),json:!0};yield this._configuration.authentication.applyToRequestAsync(r);let o=yield this._client.requestAsync(r);return{response:o.response,body:u.deserialize(o.body,"BarcodeResponseList")}})}recognizeMultipart(t){return m(this,null,function*(){let e=this._configuration.getApiBaseUrl()+"/barcode/recognize-multipart",i={},s=Object.assign({},this.defaultHeaders),r=[];if(t.barcodeType==null)throw new Error("Required parameter request.barcodeType was null or undefined when calling recognizeMultipart.");if(t.fileBytes==null)throw new Error("Required parameter request.fileBytes was null or undefined when calling recognizeMultipart.");t.barcodeType!=null&&r.push(["barcodeType",u.serialize(t.barcodeType,"DecodeBarcodeType")]),t.recognitionMode!=null&&r.push(["recognitionMode",u.serialize(t.recognitionMode,"RecognitionMode")]),t.recognitionImageKind!=null&&r.push(["recognitionImageKind",u.serialize(t.recognitionImageKind,"RecognitionImageKind")]);let o={method:"POST",qs:i,headers:s,uri:e},p=new Array;p=t.fileBytes==null?[]:[new P("file","",t.fileBytes)];let c=new y(r,p);o.body=c.body,o.headers=b(b({},o.headers),c.headers),yield this._configuration.authentication.applyToRequestAsync(o);let g=yield this._client.requestAsync(o);return{response:g.response,body:u.deserialize(g.body,"BarcodeResponseList")}})}},ft=class{constructor(t){this.defaultHeaders={"x-aspose-client":"nodejs sdk","x-aspose-client-version":"25.4.0"};this._configuration=t,this._client=new f}scan(t){return m(this,null,function*(){let e=this._configuration.getApiBaseUrl()+"/barcode/scan",i={},s=Object.assign({},this.defaultHeaders);if(t.fileUrl==null)throw new Error("Required parameter request.fileUrl was null or undefined when calling scan.");t.fileUrl!=null&&(i.fileUrl=u.serialize(t.fileUrl,"string"));let r={method:"GET",qs:i,headers:s,uri:e};yield this._configuration.authentication.applyToRequestAsync(r);let o=yield this._client.requestAsync(r);return{response:o.response,body:u.deserialize(o.body,"BarcodeResponseList")}})}scanBase64(t){return m(this,null,function*(){let e=this._configuration.getApiBaseUrl()+"/barcode/scan-body",i={},s=Object.assign({},this.defaultHeaders);if(t.scanBase64Request==null)throw new Error("Required parameter request.scanBase64Request was null or undefined when calling scanBase64.");let r={method:"POST",qs:i,headers:s,uri:e,body:u.serialize(t.scanBase64Request,"ScanBase64Request"),json:!0};yield this._configuration.authentication.applyToRequestAsync(r);let o=yield this._client.requestAsync(r);return{response:o.response,body:u.deserialize(o.body,"BarcodeResponseList")}})}scanMultipart(t){return m(this,null,function*(){let e=this._configuration.getApiBaseUrl()+"/barcode/scan-multipart",i={},s=Object.assign({},this.defaultHeaders),r=[];if(t.fileBytes==null)throw new Error("Required parameter request.fileBytes was null or undefined when calling scanMultipart.");let o={method:"POST",qs:i,headers:s,uri:e},p=new Array;p=t.fileBytes==null?[]:[new P("file","",t.fileBytes)];let c=new y(r,p);o.body=c.body,o.headers=b(b({},o.headers),c.headers),yield this._configuration.authentication.applyToRequestAsync(o);let g=yield this._client.requestAsync(o);return{response:g.response,body:u.deserialize(g.body,"BarcodeResponseList")}})}};var Z=class{constructor(t){this._configuration=t,t.accessToken&&(this._accessToken=t.accessToken),this._client=new f}applyToRequestAsync(t){return m(this,null,function*(){return this._accessToken==null&&(this._accessToken=yield this.requestToken()),t&&t.headers&&(t.headers.Authorization="Bearer "+this._accessToken),Promise.resolve()})}requestToken(){return m(this,null,function*(){if(!this._configuration.clientId||!this._configuration.clientSecret)throw new Error("Required 'clientId' or 'clientSecret' not specified in configuration.");let t={method:"POST",uri:this._configuration.tokenUrl,form:{grant_type:"client_credentials",client_id:this._configuration.clientId,client_secret:this._configuration.clientSecret}},e=yield this._client.requestAsync(t);return JSON.parse(e.body).access_token})}};var Mt=(t=>(t.v4="v4.0",t))(Mt||{}),bt=class{constructor(t,e,i,s,r){this.version="v4.0";this.clientId=t,this.clientSecret=e,i?this.baseUrl=i:this.baseUrl="https://api.aspose.cloud",this.tokenUrl=r!=null?r:"https://id.aspose.cloud/connect/token",s?this.accessToken=s:this.accessToken="",this.authentication=new Z(this)}getApiBaseUrl(){return this.baseUrl+"/"+this.version}};0&&(module.exports={ApiError,ApiErrorResponse,ApiVersion,BarcodeImageFormat,BarcodeImageParams,BarcodeResponse,BarcodeResponseList,CodeLocation,Configuration,DecodeBarcodeType,EncodeBarcodeType,EncodeData,EncodeDataType,GenerateApi,GenerateBodyRequestWrapper,GenerateMultipartRequestWrapper,GenerateParams,GenerateRequestWrapper,GraphicsUnit,RecognitionImageKind,RecognitionMode,RecognizeApi,RecognizeBase64Request,RecognizeBase64RequestWrapper,RecognizeMultipartRequestWrapper,RecognizeRequestWrapper,RegionPoint,ScanApi,ScanBase64Request,ScanBase64RequestWrapper,ScanMultipartRequestWrapper,ScanRequestWrapper});
|
|
2
|
+
`),"binary"),this.headers={"Content-Type":`multipart/form-data; boundary=${this.boundary}`,"Content-Length":this.body.length.toString()}}};var q=class q{static getAttributeTypeMap(){return q.attributeTypeMap}};q.attributeTypeMap=[{name:"code",baseName:"code",type:"string"},{name:"message",baseName:"message",type:"string"},{name:"description",baseName:"description",type:"string"},{name:"dateTime",baseName:"dateTime",type:"Date"},{name:"innerError",baseName:"innerError",type:"ApiError"}];var R=q,L=class L{static getAttributeTypeMap(){return L.attributeTypeMap}};L.attributeTypeMap=[{name:"requestId",baseName:"requestId",type:"string"},{name:"error",baseName:"error",type:"ApiError"}];var A=L,D=(r=>(r.Png="Png",r.Jpeg="Jpeg",r.Svg="Svg",r.Tiff="Tiff",r.Gif="Gif",r))(D||{}),k=class k{static getAttributeTypeMap(){return k.attributeTypeMap}};k.attributeTypeMap=[{name:"imageFormat",baseName:"imageFormat",type:"BarcodeImageFormat"},{name:"textLocation",baseName:"textLocation",type:"CodeLocation"},{name:"foregroundColor",baseName:"foregroundColor",type:"string"},{name:"backgroundColor",baseName:"backgroundColor",type:"string"},{name:"units",baseName:"units",type:"GraphicsUnit"},{name:"resolution",baseName:"resolution",type:"number"},{name:"imageHeight",baseName:"imageHeight",type:"number"},{name:"imageWidth",baseName:"imageWidth",type:"number"},{name:"rotationAngle",baseName:"rotationAngle",type:"number"}];var M=k,U=class U{static getAttributeTypeMap(){return U.attributeTypeMap}};U.attributeTypeMap=[{name:"barcodeValue",baseName:"barcodeValue",type:"string"},{name:"type",baseName:"type",type:"string"},{name:"region",baseName:"region",type:"Array<RegionPoint>"},{name:"checksum",baseName:"checksum",type:"string"}];var S=U,G=class G{static getAttributeTypeMap(){return G.attributeTypeMap}};G.attributeTypeMap=[{name:"barcodes",baseName:"barcodes",type:"Array<BarcodeResponse>"}];var w=G,j=(i=>(i.Below="Below",i.Above="Above",i.None="None",i))(j||{}),Q=(a=>(a.MostCommonlyUsed="MostCommonlyUsed",a.Qr="QR",a.AustraliaPost="AustraliaPost",a.AustralianPosteParcel="AustralianPosteParcel",a.Aztec="Aztec",a.Codabar="Codabar",a.CodablockF="CodablockF",a.Code11="Code11",a.Code128="Code128",a.Code16K="Code16K",a.Code32="Code32",a.Code39="Code39",a.Code39FullAscii="Code39FullASCII",a.Code93="Code93",a.CompactPdf417="CompactPdf417",a.DataLogic2of5="DataLogic2of5",a.DataMatrix="DataMatrix",a.DatabarExpanded="DatabarExpanded",a.DatabarExpandedStacked="DatabarExpandedStacked",a.DatabarLimited="DatabarLimited",a.DatabarOmniDirectional="DatabarOmniDirectional",a.DatabarStacked="DatabarStacked",a.DatabarStackedOmniDirectional="DatabarStackedOmniDirectional",a.DatabarTruncated="DatabarTruncated",a.DeutschePostIdentcode="DeutschePostIdentcode",a.DeutschePostLeitcode="DeutschePostLeitcode",a.DotCode="DotCode",a.DutchKix="DutchKIX",a.Ean13="EAN13",a.Ean14="EAN14",a.Ean8="EAN8",a.Gs1Aztec="GS1Aztec",a.Gs1Code128="GS1Code128",a.Gs1CompositeBar="GS1CompositeBar",a.Gs1DataMatrix="GS1DataMatrix",a.Gs1DotCode="GS1DotCode",a.Gs1HanXin="GS1HanXin",a.Gs1MicroPdf417="GS1MicroPdf417",a.Gs1Qr="GS1QR",a.HanXin="HanXin",a.HibcAztecLic="HIBCAztecLIC",a.HibcAztecPas="HIBCAztecPAS",a.HibcCode128Lic="HIBCCode128LIC",a.HibcCode128Pas="HIBCCode128PAS",a.HibcCode39Lic="HIBCCode39LIC",a.HibcCode39Pas="HIBCCode39PAS",a.HibcDataMatrixLic="HIBCDataMatrixLIC",a.HibcDataMatrixPas="HIBCDataMatrixPAS",a.Hibcqrlic="HIBCQRLIC",a.Hibcqrpas="HIBCQRPAS",a.Iata2of5="IATA2of5",a.Isbn="ISBN",a.Ismn="ISMN",a.Issn="ISSN",a.Itf14="ITF14",a.Itf6="ITF6",a.Interleaved2of5="Interleaved2of5",a.ItalianPost25="ItalianPost25",a.MacroPdf417="MacroPdf417",a.Mailmark="Mailmark",a.Matrix2of5="Matrix2of5",a.MaxiCode="MaxiCode",a.MicrE13B="MicrE13B",a.MicroPdf417="MicroPdf417",a.MicroQr="MicroQR",a.Msi="MSI",a.OneCode="OneCode",a.Opc="OPC",a.PatchCode="PatchCode",a.Pdf417="Pdf417",a.Pharmacode="Pharmacode",a.Planet="Planet",a.Postnet="Postnet",a.Pzn="PZN",a.RectMicroQr="RectMicroQR",a.Rm4Scc="RM4SCC",a.Scc14="SCC14",a.Sscc18="SSCC18",a.Standard2of5="Standard2of5",a.Supplement="Supplement",a.SwissPostParcel="SwissPostParcel",a.Upca="UPCA",a.Upce="UPCE",a.Vin="VIN",a))(Q||{}),V=(n=>(n.Qr="QR",n.AustraliaPost="AustraliaPost",n.AustralianPosteParcel="AustralianPosteParcel",n.Aztec="Aztec",n.Codabar="Codabar",n.CodablockF="CodablockF",n.Code11="Code11",n.Code128="Code128",n.Code16K="Code16K",n.Code32="Code32",n.Code39="Code39",n.Code39FullAscii="Code39FullASCII",n.Code93="Code93",n.DataLogic2of5="DataLogic2of5",n.DataMatrix="DataMatrix",n.DatabarExpanded="DatabarExpanded",n.DatabarExpandedStacked="DatabarExpandedStacked",n.DatabarLimited="DatabarLimited",n.DatabarOmniDirectional="DatabarOmniDirectional",n.DatabarStacked="DatabarStacked",n.DatabarStackedOmniDirectional="DatabarStackedOmniDirectional",n.DatabarTruncated="DatabarTruncated",n.DeutschePostIdentcode="DeutschePostIdentcode",n.DeutschePostLeitcode="DeutschePostLeitcode",n.DotCode="DotCode",n.DutchKix="DutchKIX",n.Ean13="EAN13",n.Ean14="EAN14",n.Ean8="EAN8",n.Gs1Aztec="GS1Aztec",n.Gs1CodablockF="GS1CodablockF",n.Gs1Code128="GS1Code128",n.Gs1DataMatrix="GS1DataMatrix",n.Gs1DotCode="GS1DotCode",n.Gs1HanXin="GS1HanXin",n.Gs1MicroPdf417="GS1MicroPdf417",n.Gs1Qr="GS1QR",n.HanXin="HanXin",n.Iata2of5="IATA2of5",n.Isbn="ISBN",n.Ismn="ISMN",n.Issn="ISSN",n.Itf14="ITF14",n.Itf6="ITF6",n.Interleaved2of5="Interleaved2of5",n.ItalianPost25="ItalianPost25",n.Msi="MSI",n.MacroPdf417="MacroPdf417",n.Mailmark="Mailmark",n.Matrix2of5="Matrix2of5",n.MaxiCode="MaxiCode",n.MicroPdf417="MicroPdf417",n.MicroQr="MicroQR",n.Opc="OPC",n.OneCode="OneCode",n.Pzn="PZN",n.PatchCode="PatchCode",n.Pdf417="Pdf417",n.Pharmacode="Pharmacode",n.Planet="Planet",n.Postnet="Postnet",n.Rm4Scc="RM4SCC",n.RectMicroQr="RectMicroQR",n.Scc14="SCC14",n.Sscc18="SSCC18",n.SingaporePost="SingaporePost",n.Standard2of5="Standard2of5",n.SwissPostParcel="SwissPostParcel",n.Upca="UPCA",n.Upce="UPCE",n.UpcaGs1Code128Coupon="UpcaGs1Code128Coupon",n.UpcaGs1DatabarCoupon="UpcaGs1DatabarCoupon",n.Vin="VIN",n))(V||{}),F=class F{static getAttributeTypeMap(){return F.attributeTypeMap}};F.attributeTypeMap=[{name:"dataType",baseName:"dataType",type:"EncodeDataType"},{name:"data",baseName:"data",type:"string"}];var H=F,$=(i=>(i.StringData="StringData",i.Base64Bytes="Base64Bytes",i.HexBytes="HexBytes",i))($||{}),_=class _{static getAttributeTypeMap(){return _.attributeTypeMap}};_.attributeTypeMap=[{name:"barcodeType",baseName:"barcodeType",type:"EncodeBarcodeType"},{name:"encodeData",baseName:"encodeData",type:"EncodeData"},{name:"barcodeImageParams",baseName:"barcodeImageParams",type:"BarcodeImageParams"}];var I=_,X=(s=>(s.Pixel="Pixel",s.Point="Point",s.Inch="Inch",s.Millimeter="Millimeter",s))(X||{}),J=(i=>(i.Photo="Photo",i.ScannedDocument="ScannedDocument",i.ClearImage="ClearImage",i))(J||{}),E=(i=>(i.Fast="Fast",i.Normal="Normal",i.Excellent="Excellent",i))(E||{}),v=class v{static getAttributeTypeMap(){return v.attributeTypeMap}};v.attributeTypeMap=[{name:"barcodeTypes",baseName:"barcodeTypes",type:"Array<DecodeBarcodeType>"},{name:"fileBase64",baseName:"fileBase64",type:"string"},{name:"recognitionMode",baseName:"recognitionMode",type:"RecognitionMode"},{name:"recognitionImageKind",baseName:"recognitionImageKind",type:"RecognitionImageKind"}];var x=v,K=class K{static getAttributeTypeMap(){return K.attributeTypeMap}};K.attributeTypeMap=[{name:"x",baseName:"x",type:"number"},{name:"y",baseName:"y",type:"number"}];var z=K,W=class W{static getAttributeTypeMap(){return W.attributeTypeMap}};W.attributeTypeMap=[{name:"fileBase64",baseName:"fileBase64",type:"string"}];var N=W,at=class{constructor(t,e){this.foregroundColor="'Black'";this.backgroundColor="'White'";this.barcodeType=t,this.data=e}},rt=class{constructor(t){this.generateParams=t}},it=class{constructor(t,e){this.foregroundColor="'Black'";this.backgroundColor="'White'";this.barcodeType=t,this.data=e}},nt=class{constructor(t,e){this.barcodeType=t,this.fileUrl=e}},st=class{constructor(t){this.recognizeBase64Request=t}},ot=class{constructor(t,e){this.barcodeType=t,this.fileBytes=e}},lt=class{constructor(t){this.fileUrl=t}},ut=class{constructor(t){this.scanBase64Request=t}},ct=class{constructor(t){this.fileBytes=t}};var gt=["string","boolean","double","integer","long","float","number","any"],u=class l{static findCorrectType(t,e){if(t==null||gt.indexOf(e.toLowerCase())!==-1||e==="Date"||T[e]||!d[e])return e;let i=d[e].discriminator;return i==null?e:t[i]?t[i]:e}static serialize(t,e){if(t==null||gt.indexOf(e.toLowerCase())!==-1)return t;if(e.lastIndexOf("Array<",0)===0){let r=e.replace("Array<","");r=r.substring(0,r.length-1);let o=[];for(let p in t){let c=t[p];o.push(l.serialize(c,r))}return o}if(e==="Date")return t.toString();if(T[e]&&Object.values(T[e]).includes(t)||!d[e])return t;let i=d[e].getAttributeTypeMap(),s={};for(let r in i){let o=i[r];s[o.baseName]=l.serialize(t[o.name],o.type)}return s}static deserialize(t,e){if(e=l.findCorrectType(t,e),t==null||gt.indexOf(e.toLowerCase())!==-1)return t;if(e.lastIndexOf("Array<",0)===0){let r=e.replace("Array<","");r=r.substring(0,r.length-1);let o=[];for(let p in t){let c=t[p];o.push(l.deserialize(c,r))}return o}if(e==="Date")return new Date(t);if(T[e]||!d[e])return t;typeof t=="string"&&(t=JSON.parse(t));let i=new d[e],s=d[e].getAttributeTypeMap();for(let r of s){let o=r.baseName.replace(/^(.)/,p=>p.toLowerCase());i[r.name]=l.deserialize(t[o],r.type)}return i}},T={BarcodeImageFormat:D,CodeLocation:j,DecodeBarcodeType:Q,EncodeBarcodeType:V,EncodeDataType:$,GraphicsUnit:X,RecognitionImageKind:J,RecognitionMode:E},d={ApiError:R,ApiErrorResponse:A,BarcodeImageParams:M,BarcodeResponse:S,BarcodeResponseList:w,EncodeData:H,GenerateParams:I,RecognizeBase64Request:x,RegionPoint:z,ScanBase64Request:N},pt=class{constructor(t){this.defaultHeaders={"x-aspose-client":"nodejs sdk","x-aspose-client-version":"25.5.0"};this._configuration=t,this._client=new f}generate(t){return m(this,null,function*(){let e=this._configuration.getApiBaseUrl()+"/barcode/generate/{barcodeType}".replace("{barcodeType}",String(t.barcodeType)),i={},s=Object.assign({},this.defaultHeaders);if(t.barcodeType==null)throw new Error("Required parameter request.barcodeType was null or undefined when calling generate.");if(t.data==null)throw new Error("Required parameter request.data was null or undefined when calling generate.");t.dataType!=null&&(i.dataType=u.serialize(t.dataType,"EncodeDataType")),t.data!=null&&(i.data=u.serialize(t.data,"string")),t.imageFormat!=null&&(i.imageFormat=u.serialize(t.imageFormat,"BarcodeImageFormat")),t.textLocation!=null&&(i.textLocation=u.serialize(t.textLocation,"CodeLocation")),t.foregroundColor!=null&&(i.foregroundColor=u.serialize(t.foregroundColor,"string")),t.backgroundColor!=null&&(i.backgroundColor=u.serialize(t.backgroundColor,"string")),t.units!=null&&(i.units=u.serialize(t.units,"GraphicsUnit")),t.resolution!=null&&(i.resolution=u.serialize(t.resolution,"number")),t.imageHeight!=null&&(i.imageHeight=u.serialize(t.imageHeight,"number")),t.imageWidth!=null&&(i.imageWidth=u.serialize(t.imageWidth,"number")),t.rotationAngle!=null&&(i.rotationAngle=u.serialize(t.rotationAngle,"number"));let r={method:"GET",qs:i,headers:s,uri:e,encoding:null};yield this._configuration.authentication.applyToRequestAsync(r);let o=yield this._client.requestAsync(r);return{response:o.response,body:u.deserialize(o.body,"Buffer")}})}generateBody(t){return m(this,null,function*(){let e=this._configuration.getApiBaseUrl()+"/barcode/generate-body",i={},s=Object.assign({},this.defaultHeaders);if(t.generateParams==null)throw new Error("Required parameter request.generateParams was null or undefined when calling generateBody.");let r={method:"POST",qs:i,headers:s,uri:e,body:u.serialize(t.generateParams,"GenerateParams"),json:!0,encoding:null};yield this._configuration.authentication.applyToRequestAsync(r);let o=yield this._client.requestAsync(r);return{response:o.response,body:u.deserialize(o.body,"Buffer")}})}generateMultipart(t){return m(this,null,function*(){let e=this._configuration.getApiBaseUrl()+"/barcode/generate-multipart",i={},s=Object.assign({},this.defaultHeaders),r=[];if(t.barcodeType==null)throw new Error("Required parameter request.barcodeType was null or undefined when calling generateMultipart.");if(t.data==null)throw new Error("Required parameter request.data was null or undefined when calling generateMultipart.");t.barcodeType!=null&&r.push(["barcodeType",u.serialize(t.barcodeType,"EncodeBarcodeType")]),t.dataType!=null&&r.push(["dataType",u.serialize(t.dataType,"EncodeDataType")]),t.data!=null&&r.push(["data",u.serialize(t.data,"string")]),t.imageFormat!=null&&r.push(["imageFormat",u.serialize(t.imageFormat,"BarcodeImageFormat")]),t.textLocation!=null&&r.push(["textLocation",u.serialize(t.textLocation,"CodeLocation")]),t.foregroundColor!=null&&r.push(["foregroundColor",u.serialize(t.foregroundColor,"string")]),t.backgroundColor!=null&&r.push(["backgroundColor",u.serialize(t.backgroundColor,"string")]),t.units!=null&&r.push(["units",u.serialize(t.units,"GraphicsUnit")]),t.resolution!=null&&r.push(["resolution",u.serialize(t.resolution,"number")]),t.imageHeight!=null&&r.push(["imageHeight",u.serialize(t.imageHeight,"number")]),t.imageWidth!=null&&r.push(["imageWidth",u.serialize(t.imageWidth,"number")]),t.rotationAngle!=null&&r.push(["rotationAngle",u.serialize(t.rotationAngle,"number")]);let o={method:"POST",qs:i,headers:s,uri:e,encoding:null},p=new Array,c=new y(r,p);o.body=c.body,o.headers=b(b({},o.headers),c.headers),yield this._configuration.authentication.applyToRequestAsync(o);let g=yield this._client.requestAsync(o);return{response:g.response,body:u.deserialize(g.body,"Buffer")}})}},mt=class{constructor(t){this.defaultHeaders={"x-aspose-client":"nodejs sdk","x-aspose-client-version":"25.5.0"};this._configuration=t,this._client=new f}recognize(t){return m(this,null,function*(){let e=this._configuration.getApiBaseUrl()+"/barcode/recognize",i={},s=Object.assign({},this.defaultHeaders);if(t.barcodeType==null)throw new Error("Required parameter request.barcodeType was null or undefined when calling recognize.");if(t.fileUrl==null)throw new Error("Required parameter request.fileUrl was null or undefined when calling recognize.");t.barcodeType!=null&&(i.barcodeType=u.serialize(t.barcodeType,"DecodeBarcodeType")),t.fileUrl!=null&&(i.fileUrl=u.serialize(t.fileUrl,"string")),t.recognitionMode!=null&&(i.recognitionMode=u.serialize(t.recognitionMode,"RecognitionMode")),t.recognitionImageKind!=null&&(i.recognitionImageKind=u.serialize(t.recognitionImageKind,"RecognitionImageKind"));let r={method:"GET",qs:i,headers:s,uri:e};yield this._configuration.authentication.applyToRequestAsync(r);let o=yield this._client.requestAsync(r);return{response:o.response,body:u.deserialize(o.body,"BarcodeResponseList")}})}recognizeBase64(t){return m(this,null,function*(){let e=this._configuration.getApiBaseUrl()+"/barcode/recognize-body",i={},s=Object.assign({},this.defaultHeaders);if(t.recognizeBase64Request==null)throw new Error("Required parameter request.recognizeBase64Request was null or undefined when calling recognizeBase64.");let r={method:"POST",qs:i,headers:s,uri:e,body:u.serialize(t.recognizeBase64Request,"RecognizeBase64Request"),json:!0};yield this._configuration.authentication.applyToRequestAsync(r);let o=yield this._client.requestAsync(r);return{response:o.response,body:u.deserialize(o.body,"BarcodeResponseList")}})}recognizeMultipart(t){return m(this,null,function*(){let e=this._configuration.getApiBaseUrl()+"/barcode/recognize-multipart",i={},s=Object.assign({},this.defaultHeaders),r=[];if(t.barcodeType==null)throw new Error("Required parameter request.barcodeType was null or undefined when calling recognizeMultipart.");if(t.fileBytes==null)throw new Error("Required parameter request.fileBytes was null or undefined when calling recognizeMultipart.");t.barcodeType!=null&&r.push(["barcodeType",u.serialize(t.barcodeType,"DecodeBarcodeType")]),t.recognitionMode!=null&&r.push(["recognitionMode",u.serialize(t.recognitionMode,"RecognitionMode")]),t.recognitionImageKind!=null&&r.push(["recognitionImageKind",u.serialize(t.recognitionImageKind,"RecognitionImageKind")]);let o={method:"POST",qs:i,headers:s,uri:e},p=new Array;p=t.fileBytes==null?[]:[new P("file","",t.fileBytes)];let c=new y(r,p);o.body=c.body,o.headers=b(b({},o.headers),c.headers),yield this._configuration.authentication.applyToRequestAsync(o);let g=yield this._client.requestAsync(o);return{response:g.response,body:u.deserialize(g.body,"BarcodeResponseList")}})}},ft=class{constructor(t){this.defaultHeaders={"x-aspose-client":"nodejs sdk","x-aspose-client-version":"25.5.0"};this._configuration=t,this._client=new f}scan(t){return m(this,null,function*(){let e=this._configuration.getApiBaseUrl()+"/barcode/scan",i={},s=Object.assign({},this.defaultHeaders);if(t.fileUrl==null)throw new Error("Required parameter request.fileUrl was null or undefined when calling scan.");t.fileUrl!=null&&(i.fileUrl=u.serialize(t.fileUrl,"string"));let r={method:"GET",qs:i,headers:s,uri:e};yield this._configuration.authentication.applyToRequestAsync(r);let o=yield this._client.requestAsync(r);return{response:o.response,body:u.deserialize(o.body,"BarcodeResponseList")}})}scanBase64(t){return m(this,null,function*(){let e=this._configuration.getApiBaseUrl()+"/barcode/scan-body",i={},s=Object.assign({},this.defaultHeaders);if(t.scanBase64Request==null)throw new Error("Required parameter request.scanBase64Request was null or undefined when calling scanBase64.");let r={method:"POST",qs:i,headers:s,uri:e,body:u.serialize(t.scanBase64Request,"ScanBase64Request"),json:!0};yield this._configuration.authentication.applyToRequestAsync(r);let o=yield this._client.requestAsync(r);return{response:o.response,body:u.deserialize(o.body,"BarcodeResponseList")}})}scanMultipart(t){return m(this,null,function*(){let e=this._configuration.getApiBaseUrl()+"/barcode/scan-multipart",i={},s=Object.assign({},this.defaultHeaders),r=[];if(t.fileBytes==null)throw new Error("Required parameter request.fileBytes was null or undefined when calling scanMultipart.");let o={method:"POST",qs:i,headers:s,uri:e},p=new Array;p=t.fileBytes==null?[]:[new P("file","",t.fileBytes)];let c=new y(r,p);o.body=c.body,o.headers=b(b({},o.headers),c.headers),yield this._configuration.authentication.applyToRequestAsync(o);let g=yield this._client.requestAsync(o);return{response:g.response,body:u.deserialize(g.body,"BarcodeResponseList")}})}};var Z=class{constructor(t){this._configuration=t,t.accessToken&&(this._accessToken=t.accessToken),this._client=new f}applyToRequestAsync(t){return m(this,null,function*(){return this._accessToken==null&&(this._accessToken=yield this.requestToken()),t&&t.headers&&(t.headers.Authorization="Bearer "+this._accessToken),Promise.resolve()})}requestToken(){return m(this,null,function*(){if(!this._configuration.clientId||!this._configuration.clientSecret)throw new Error("Required 'clientId' or 'clientSecret' not specified in configuration.");let t={method:"POST",uri:this._configuration.tokenUrl,form:{grant_type:"client_credentials",client_id:this._configuration.clientId,client_secret:this._configuration.clientSecret}},e=yield this._client.requestAsync(t);return JSON.parse(e.body).access_token})}};var Mt=(t=>(t.v4="v4.0",t))(Mt||{}),bt=class{constructor(t,e,i,s,r){this.version="v4.0";this.clientId=t,this.clientSecret=e,i?this.baseUrl=i:this.baseUrl="https://api.aspose.cloud",this.tokenUrl=r!=null?r:"https://id.aspose.cloud/connect/token",s?this.accessToken=s:this.accessToken="",this.authentication=new Z(this)}getApiBaseUrl(){return this.baseUrl+"/"+this.version}};0&&(module.exports={ApiError,ApiErrorResponse,ApiVersion,BarcodeImageFormat,BarcodeImageParams,BarcodeResponse,BarcodeResponseList,CodeLocation,Configuration,DecodeBarcodeType,EncodeBarcodeType,EncodeData,EncodeDataType,GenerateApi,GenerateBodyRequestWrapper,GenerateMultipartRequestWrapper,GenerateParams,GenerateRequestWrapper,GraphicsUnit,RecognitionImageKind,RecognitionMode,RecognizeApi,RecognizeBase64Request,RecognizeBase64RequestWrapper,RecognizeMultipartRequestWrapper,RecognizeRequestWrapper,RegionPoint,ScanApi,ScanBase64Request,ScanBase64RequestWrapper,ScanMultipartRequestWrapper,ScanRequestWrapper});
|
|
3
3
|
//# sourceMappingURL=index.js.map
|