capacitor-plugin-scanbot-sdk
Advanced tools
Comparing version 2.2.0-beta.2 to 2.2.0-beta.3
@@ -1,295 +0,101 @@ | ||
import { PluginListenerHandle } from '@capacitor/core'; | ||
import type { DocumentScannerConfiguration, DocumentScannerResult, PageFileType, ScanbotSdkConfiguration, ImageFilter, TIFFCompression, PDFPageSize, BarcodeResult, BarcodeFormat, CroppingScreenConfiguration, LicenseInfo, Page, DocumentDetectionResult, CheckRecognizerResult, RecognizeCheckOnImageArgs, CroppingResult, OCROutputFormat, MrzScannerConfiguration, MrzResult, TextDataScannerConfiguration, TextDataScannerResult, LicenseStatus, SdkFeature, GenericDocumentRecognizerConfiguration, GenericDocumentRecognizerResult, BatchBarcodeScannerConfiguration, HealthInsuranceCardScannerConfiguration, HealthInsuranceCardScannerResult, LicensePlateScannerConfiguration, LicensePlateScannerResult, MedicalCertificateRecognizerConfiguration, MedicalCertificateScannerResult } from './types'; | ||
import type { DetectBarcodesOnImageArguments, DetectBarcodesOnImagesArguments, ExtractPagesFromPdfArguments, ExtractPagesFromPdfResult, ExtractImagesFromPdfArguments, ExtractImagesFromPdfResult } from './arguments'; | ||
import type { BarcodeScannerConfiguration, BatchBarcodeScannerConfiguration, CheckRecognizerConfiguration, CroppingConfiguration, DocumentScannerConfiguration, GenericDocumentRecognizerConfiguration, HealthInsuranceCardScannerConfiguration, LicensePlateScannerConfiguration, MedicalCertificateRecognizerConfiguration, MrzScannerConfiguration, TextDataScannerConfiguration } from './configurations'; | ||
import type { ApplyImageFilterResult, BarcodeResult, CheckRecognizerResult, CreatePDFResult, CroppingResult, DetectBarcodesOnImageResult, DetectBarcodesOnImagesResult, DetectDocumentResult, DocumentScannerResult, EstimateBlurResult, GenericDocumentRecognizerResult, GetFilteredDocumentPreviewUriResult, GetImageDataResult, GetLicenseInfoResult, GetOCRConfigsResult, HealthInsuranceCardScannerResult, InitializeSDKResult, LicensePlateScannerResult, MedicalCertificateScannerResult as MedicalCertificateRecognizerResult, MrzResult, PerformOCRResult, RecognizeMRZResult, RefreshImageUrisResult, RemovePageResult, RotateImageResult, TextDataScannerResult, WriteTIFFResult } from './results'; | ||
import type { ApplyImageFilterOnPageResult, CreatePageResult, DetectDocumentOnPageResult, ImageFilter, InitializationOptions, OCROutputFormat, PDFPageSize, Page, PageFileType, RecognizeCheckResult, RotatePageResult, SetDocumentImageResult, Status, TIFFCompression } from './types'; | ||
declare type BaseSdkResult = { | ||
status: Status; | ||
}; | ||
export interface ScanbotSDKCapacitorPlugin { | ||
/** | ||
* Initializes the Scanbot SDK with the given configuration object. | ||
* To be called once before any other SDK function. | ||
* @param config the configuration object of the Scanbot SDK | ||
* @returns a promise that resolves to an object containing the initialization status | ||
*/ | ||
initializeSdk(config: ScanbotSdkConfiguration): Promise<{ | ||
result: string; | ||
}>; | ||
/** | ||
* Checks if the Scanbot SDK was initialized. | ||
* @returns a promise that resolves to an object containing the initialization status | ||
*/ | ||
isSdkInitialized(): Promise<{ | ||
value: boolean; | ||
}>; | ||
/** | ||
* Returns info about the current license status. | ||
* @returns a promise that resolves to an object containing the license info | ||
*/ | ||
getLicenseInfo(): Promise<LicenseInfo>; | ||
addListener(eventName: 'onLicenseError', listenerFunc: (kind: { | ||
status: LicenseStatus; | ||
sdkFeature: SdkFeature; | ||
message: string; | ||
}) => void): Promise<PluginListenerHandle>; | ||
removeAllListeners(): Promise<void>; | ||
/** | ||
* Starts the document scanner RTU UI. | ||
* @param args optional configuration object for the document scanner RTU UI | ||
* @returns a promise that resolves to an object containing the info about the scanned document pages | ||
*/ | ||
startDocumentScanner(args?: { | ||
uiConfigs?: DocumentScannerConfiguration; | ||
}): Promise<DocumentScannerResult>; | ||
/** | ||
* Starts the Mrz scanner RTU UI. | ||
* @param configuration the configuration object for the Mrz scanner RTU UI | ||
* @returns a promise that resolves to an object containing the info about the scanned Mrz data | ||
*/ | ||
startDocumentScanner(configuration: DocumentScannerConfiguration): Promise<DocumentScannerResult>; | ||
closeDocumentScanner(): Promise<void>; | ||
startCroppingScreen(page: Page, configuration: CroppingConfiguration): Promise<CroppingResult>; | ||
closeCroppingScreen(): Promise<void>; | ||
startMrzScanner(configuration: MrzScannerConfiguration): Promise<MrzResult>; | ||
/** | ||
* Starts the barcode scanner RTU UI. | ||
* @param args configuration object, containing the optional barcode types that should be recognized | ||
* @returns a promise that resolves to an object containing the info about the scanned barcodes | ||
*/ | ||
startBarcodeScanner(args: { | ||
barcodeTypes?: BarcodeFormat[]; | ||
}): Promise<BarcodeResult>; | ||
/** | ||
* Starts the text data scanner RTU UI. | ||
* @param configuration the configuration object for the text data scanner RTU UI | ||
* @returns a promise that resolves to an object containing the info about the scanned text data | ||
*/ | ||
startTextDataScanner(configuration: TextDataScannerConfiguration): Promise<TextDataScannerResult>; | ||
/** | ||
* Starts the generic document recognizer RTU UI. | ||
* @param configuration the configuration object for the document detection RTU UI | ||
*/ | ||
startGenericDocumentRecognizer(configuration: GenericDocumentRecognizerConfiguration): Promise<GenericDocumentRecognizerResult>; | ||
/** | ||
* Starts the batch barcode scanner RTU UI. | ||
* @param configuration the configuration object for the batch barcode scanner RTU UI | ||
*/ | ||
startBatchBarcodeScanner(configuration: BatchBarcodeScannerConfiguration): Promise<BarcodeResult>; | ||
/** | ||
* Starts the European Health Insurance Card scanner RTU UI. | ||
* @param configuration the configuration object for the health insurance card scanner RTU UI | ||
*/ | ||
startEHICScanner(configuration: HealthInsuranceCardScannerConfiguration): Promise<HealthInsuranceCardScannerResult>; | ||
/** | ||
* Starts the license plate scanner RTU UI. | ||
* @param configuration the configuration object for the license plate scanner RTU UI | ||
*/ | ||
startLicensePlateScanner(configuration: LicensePlateScannerConfiguration): Promise<LicensePlateScannerResult>; | ||
/** | ||
* Starts the medical certificate scanner RTU UI. | ||
* @param configuration the configuration object for the medical certificate scanner RTU UI | ||
*/ | ||
startMedicalCertificateScanner(configuration: MedicalCertificateRecognizerConfiguration): Promise<MedicalCertificateScannerResult>; | ||
/** | ||
* Force closes the document scanner RTU UI. | ||
*/ | ||
closeDocumentScanner(): Promise<void>; | ||
/** | ||
* Force closes the Mrz scanner RTU UI. | ||
*/ | ||
closeMrzScanner(): Promise<void>; | ||
/** | ||
* Force closes the barcode scanner RTU UI. | ||
*/ | ||
startBarcodeScanner(configuration: BarcodeScannerConfiguration): Promise<BarcodeResult>; | ||
closeBarcodeScanner(): Promise<void>; | ||
/** | ||
* Force closes the text data scanner RTU UI. | ||
*/ | ||
closeTextDataScanner(): Promise<void>; | ||
/** | ||
* Force closes the generic document recognizer RTU UI. | ||
*/ | ||
closeGenericDocumentRecognizer(): Promise<void>; | ||
/** | ||
* Force closes the batch barcode scanner RTU UI. | ||
*/ | ||
startBatchBarcodeScanner(configuration: BatchBarcodeScannerConfiguration): Promise<BarcodeResult>; | ||
closeBatchBarcodeScanner(): Promise<void>; | ||
/** | ||
* Force closes the European Health Insurance Card scanner RTU UI. | ||
*/ | ||
startEHICScanner(configuration: HealthInsuranceCardScannerConfiguration): Promise<HealthInsuranceCardScannerResult>; | ||
closeEHICScanner(): Promise<void>; | ||
/** | ||
* Force closes the license plate scanner RTU UI. | ||
*/ | ||
startTextDataScanner(configuration: TextDataScannerConfiguration): Promise<TextDataScannerResult>; | ||
closeTextDataScanner(): Promise<void>; | ||
startLicensePlateScanner(configuration: LicensePlateScannerConfiguration): Promise<LicensePlateScannerResult>; | ||
closeLicensePlateScanner(): Promise<void>; | ||
/** | ||
* Force closes the license plate scanner RTU UI. | ||
*/ | ||
closeMedicalCertificateScanner(): Promise<void>; | ||
/** | ||
* Starts the cropping screen RTU UI. | ||
* @param args the page or pageId to be cropped and an optional configuration object | ||
* @returns a promise that resolves to an object containing the info about the cropped page | ||
*/ | ||
startCroppingScreen(args: { | ||
pageId: string; | ||
config?: CroppingScreenConfiguration; | ||
}): Promise<CroppingResult>; | ||
/** | ||
* Starts the cropping screen RTU UI. | ||
* @param args the page or pageId to be cropped and an optional configuration object | ||
* @returns a promise that resolves to an object containing the info about the cropped page | ||
*/ | ||
startCroppingScreen(args: { | ||
startMedicalCertificateRecognizer(configuration: MedicalCertificateRecognizerConfiguration): Promise<MedicalCertificateRecognizerResult>; | ||
closeMedicalCertificateRecognizer(): Promise<void>; | ||
startGenericDocumentRecognizer(configuration: GenericDocumentRecognizerConfiguration): Promise<GenericDocumentRecognizerResult>; | ||
closeGenericDocumentRecognizer(): Promise<void>; | ||
startCheckRecognizer(configuration: CheckRecognizerConfiguration): Promise<CheckRecognizerResult & BaseSdkResult>; | ||
closeCheckRecognizer(): Promise<void>; | ||
initializeSDK(options: InitializationOptions): Promise<InitializeSDKResult & BaseSdkResult>; | ||
getLicenseInfo(): Promise<GetLicenseInfoResult & BaseSdkResult>; | ||
detectBarcodesOnImage(args: DetectBarcodesOnImageArguments): Promise<DetectBarcodesOnImageResult & BaseSdkResult>; | ||
detectBarcodesOnImages(args: DetectBarcodesOnImagesArguments): Promise<DetectBarcodesOnImagesResult & BaseSdkResult>; | ||
applyImageFilter(args: { | ||
imageFileUri: string; | ||
filter: ImageFilter; | ||
}): Promise<ApplyImageFilterResult & BaseSdkResult>; | ||
applyImageFilterOnPage(args: { | ||
page: Page; | ||
config?: CroppingScreenConfiguration; | ||
}): Promise<CroppingResult>; | ||
/** | ||
* Force closes the cropping screen RTU UI. | ||
*/ | ||
closeCroppingScreen(): Promise<void>; | ||
/** | ||
* @returns a promise that resolves to an object containing all ids of the currently stored pages | ||
*/ | ||
getStoredPageIds(): Promise<{ | ||
pageIds: string[]; | ||
}>; | ||
/** | ||
* gets the uris of the requested pages | ||
* @param preview whether the uris should be for the preview or the final image | ||
* @param kind the PageFileType for which the uris should be returned | ||
* @param pageIds the pageIds of the requested pages | ||
* @returns a promise that resolves to the uris of the requested images | ||
*/ | ||
getPageImageUris(args: { | ||
preview: boolean; | ||
kind: PageFileType; | ||
pageIds: string[]; | ||
}): Promise<{ | ||
uris: (string | undefined)[]; | ||
}>; | ||
/** | ||
* Returns the base64 encoded image data of the requested page. | ||
* @param args the pageId for which the image data should be returned | ||
* @returns a promise that resolves to an object containing the base64 encoded image data | ||
*/ | ||
filter: ImageFilter; | ||
}): Promise<ApplyImageFilterOnPageResult & BaseSdkResult>; | ||
getImageData(args: { | ||
pageId: string; | ||
}): Promise<{ | ||
base64ImageData: string; | ||
}>; | ||
/** | ||
* Returns the base64 encoded image data of the requested page. | ||
* @param args the page for which the image data should be returned | ||
* @returns a promise that resolves to an object containing the base64 encoded image data | ||
*/ | ||
getImageData(args: { | ||
page: Page; | ||
}): Promise<{ | ||
base64ImageData: string; | ||
}>; | ||
/** | ||
* Returns the base64 encoded image data of the requested image file. | ||
* @param args the uri of the image file for which the image data should be returned | ||
* @returns a promise that resolves to an object containing the base64 encoded image data | ||
*/ | ||
getImageData(args: { | ||
imageFileUri: string; | ||
}): Promise<{ | ||
base64ImageData: string; | ||
}>; | ||
/** | ||
* Creates a new page from the image at the given image file uri. | ||
* @param args the uri of the image file from which the page should be created | ||
* @returns a promise that resolves to the created page | ||
*/ | ||
}): Promise<GetImageDataResult & BaseSdkResult>; | ||
rotateImage(args: { | ||
imageFileUri: string; | ||
degrees: number; | ||
}): Promise<RotateImageResult & BaseSdkResult>; | ||
createPage(args: { | ||
originalImageFileUri: string; | ||
}): Promise<Page>; | ||
/** | ||
* Removes the page with the given pageId from the storage. | ||
* @param args the pageId of the page that should be removed | ||
*/ | ||
imageUri: string; | ||
}): Promise<CreatePageResult & BaseSdkResult>; | ||
removePage(args: { | ||
pageId: string; | ||
}): Promise<void>; | ||
/** | ||
* Removes the given page from the storage. | ||
* @param args the page that should be removed | ||
*/ | ||
removePage(args: { | ||
page: Page; | ||
}): Promise<void>; | ||
/** | ||
* Returns the page with the given pageId. | ||
* @param args the pageId of the page that should be returned | ||
*/ | ||
getPageById(args: { | ||
pageId: string; | ||
}): Promise<Page>; | ||
/** | ||
* Refreshes the image uris of the given pages. | ||
* @param args the pages for which the image uris should be refreshed | ||
* @returns a promise that resolves to an object containing the refreshed pages | ||
*/ | ||
refreshImageUris(args: { | ||
pages: Page[]; | ||
}): Promise<{ | ||
pages: Page[]; | ||
}>; | ||
/** | ||
* Rotates the page with the given pageId by 90° the given amount of times. | ||
* @param args The pageId of the page to be rotated and the amount of times it should be rotated 90° | ||
* @returns A promise that resolves to an object containing the rotated page | ||
*/ | ||
}): Promise<RemovePageResult & BaseSdkResult>; | ||
rotatePage(args: { | ||
pageId: string; | ||
page: Page; | ||
times: number; | ||
}): Promise<{ | ||
}): Promise<RotatePageResult & BaseSdkResult>; | ||
setDocumentImage(args: { | ||
page: Page; | ||
}>; | ||
/** | ||
* Rotates the page by 90° the given amount of times. | ||
* @param args The page to be rotated and the amount of times it should be rotated 90° | ||
* @returns A promise that resolves to an object containing the rotated page | ||
*/ | ||
rotatePage(args: { | ||
imageUri: string; | ||
}): Promise<SetDocumentImageResult & BaseSdkResult>; | ||
detectDocument(args: { | ||
imageFileUri: string; | ||
}): Promise<DetectDocumentResult & BaseSdkResult>; | ||
detectDocumentOnPage(args: { | ||
page: Page; | ||
times: number; | ||
}): Promise<{ | ||
}): Promise<DetectDocumentOnPageResult & BaseSdkResult>; | ||
estimateBlur(args: { | ||
imageFileUri: string; | ||
}): Promise<EstimateBlurResult & BaseSdkResult>; | ||
extractImagesFromPdf(args: ExtractImagesFromPdfArguments): Promise<ExtractImagesFromPdfResult & BaseSdkResult>; | ||
extractPagesFromPdf(args: ExtractPagesFromPdfArguments): Promise<ExtractPagesFromPdfResult & BaseSdkResult>; | ||
recognizeCheck(args: { | ||
imageFileUri: string; | ||
}): Promise<RecognizeCheckResult & BaseSdkResult>; | ||
recognizeMrz(args: { | ||
imageFileUri: string; | ||
}): Promise<RecognizeMRZResult & BaseSdkResult>; | ||
refreshImageUris(args: { | ||
pages: Page[]; | ||
}): Promise<RefreshImageUrisResult & BaseSdkResult>; | ||
getOCRConfigs(): Promise<GetOCRConfigsResult & BaseSdkResult>; | ||
cleanup(): Promise<BaseSdkResult>; | ||
getFilteredDocumentPreviewUri(args: { | ||
page: Page; | ||
}>; | ||
/** | ||
* Applies the given image filter on the page with the given pageId. | ||
* @param args The pageId of the page on which the image filter should be applied and the image filter to be applied | ||
* @returns A promise that resolves to an object containing the page with the applied image filter | ||
*/ | ||
applyImageFilterOnPage(args: { | ||
pageId: string; | ||
filter: ImageFilter; | ||
}): Promise<Page>; | ||
/** | ||
* Applies the given image filter on the page. | ||
* @param args The page on which the image filter should be applied and the image filter to be applied | ||
* @returns A promise that resolves to an object containing the page with the applied image filter | ||
*/ | ||
applyImageFilterOnPage(args: { | ||
page: Page; | ||
filter: ImageFilter; | ||
}): Promise<Page>; | ||
/** | ||
* Sets the document image of the page to the image at the given image file uri. | ||
* @param args The page for which the image should be set and the image uri of the image that should be set | ||
*/ | ||
setDocumentImage(args: { | ||
page: Page; | ||
imageUri: string; | ||
}): Promise<Page>; | ||
/** | ||
* Creates a PDF from the given images. In the format of the given page size. | ||
* @param args The images from which the PDF should be created and the page size of the PDF | ||
* @returns a promise that resolves to an object containing the uri of the created PDF | ||
*/ | ||
}): Promise<GetFilteredDocumentPreviewUriResult & BaseSdkResult>; | ||
performOCR(args: { | ||
imageFileUris: string[]; | ||
languages: string[]; | ||
options: { | ||
outputFormat?: OCROutputFormat; | ||
}; | ||
}): Promise<PerformOCRResult & BaseSdkResult>; | ||
createPDF(args: { | ||
imageFileUris: string[]; | ||
pageSize: PDFPageSize; | ||
}): Promise<{ | ||
pdfFileUri: string; | ||
}>; | ||
/** | ||
* Writes the given images to a TIFF file. | ||
* @param args the images to be written to the TIFF file and the options for the TIFF file | ||
* @returns a promise that resolves to an object containing the uri of the created TIFF file | ||
*/ | ||
}): Promise<CreatePDFResult & BaseSdkResult>; | ||
writeTIFF(args: { | ||
@@ -302,67 +108,31 @@ imageFileUris: string[]; | ||
}; | ||
}): Promise<{ | ||
tiffFileUri: string; | ||
}>; | ||
}): Promise<WriteTIFFResult & BaseSdkResult>; | ||
/** | ||
* Returns info about the installed OCR languages and the path to the language data. | ||
* @returns a promise that resolves to an object containing the path to the language data and the installed languages | ||
* @returns a promise that resolves to an object containing all ids of the currently stored pages | ||
*/ | ||
getOcrConfigs(): Promise<{ | ||
languageDataPath: string; | ||
installedLanguages: string[]; | ||
getStoredPageIds(): Promise<{ | ||
pageIds: string[]; | ||
}>; | ||
/** | ||
* Performs OCR on the given images. | ||
* @param args The images on which OCR should be performed, the languages to be used and the output format | ||
* @returns a promise that resolves to an object containing the plain text or the pdf file uri or the json data depending on the output format | ||
* gets the uris of the requested pages | ||
* @param preview whether the uris should be for the preview or the final image | ||
* @param kind the PageFileType for which the uris should be returned | ||
* @param pageIds the pageIds of the requested pages | ||
* @returns a promise that resolves to the uris of the requested images | ||
*/ | ||
performOcr(args: { | ||
images: string[]; | ||
languages: string[]; | ||
outputFormat?: OCROutputFormat; | ||
getPageImageUris(args: { | ||
preview: boolean; | ||
kind: PageFileType; | ||
pageIds: string[]; | ||
}): Promise<{ | ||
plainText?: string; | ||
pdfFileUri?: string; | ||
jsonData?: any; | ||
uris: (string | undefined)[]; | ||
}>; | ||
/** | ||
* Detects the document on the given image file. | ||
* @param args The image file uri on which the document should be detected and the quality of the detection (0-100) | ||
* @returns A promise that resolves to an object containing the DocumentDetectionResult | ||
* Returns the page with the given pageId. | ||
* @param args the pageId of the page that should be returned | ||
*/ | ||
detectDocument(args: { | ||
imageFileUri: string; | ||
quality?: number; | ||
}): Promise<DocumentDetectionResult>; | ||
/** | ||
* Detects the document on the page with the given pageId. | ||
* @param args The page on which the document should be detected | ||
* @returns A promise that resolves to the detected page | ||
*/ | ||
detectDocumentOnPage(args: { | ||
getPageById(args: { | ||
pageId: string; | ||
}): Promise<Page>; | ||
/** | ||
* Detects the document on the given page. | ||
* @param args The page on which the document should be detected | ||
* @returns A promise that resolves to an object containing the detected page | ||
*/ | ||
detectDocumentOnPage(args: { | ||
page: Page; | ||
}): Promise<Page>; | ||
/** | ||
* Estimates the blur of the image file at the given uri. | ||
* @param args The uri of the image file for which the blur should be estimated | ||
* @returns A promise that resolves to an object containing the estimated blur (0-1) | ||
*/ | ||
estimateBlur(args: { | ||
imageFileUri: string; | ||
}): Promise<{ | ||
blur: number; | ||
}>; | ||
/** | ||
* Recognizes the check on the given image file. | ||
* @param args The uri of the image file on which the check should be recognized and the supported check standards | ||
*/ | ||
recognizeCheckOnImage(args: RecognizeCheckOnImageArgs): Promise<CheckRecognizerResult>; | ||
} | ||
export {}; |
@@ -1,13 +0,2 @@ | ||
//This is the definition file for the Scanbot SDK Capacitor Plugin. | ||
//It is designed to match the Scanbot SDK version 2.2.0 | ||
//See index.ts for more information | ||
//Functions are defined in the same order as in the Android and iOS implementations | ||
//There are some functions that were not thuroughly tested, but appear to be working. These functions are: | ||
// - getOcrConfigs | ||
// - performOcr | ||
// - setDocumentImage | ||
// - estimateBlur | ||
// - createPDF (with custom storage path) | ||
// - writeTiff (with custom storage path) | ||
export {}; | ||
//# sourceMappingURL=definitions.js.map |
@@ -5,2 +5,5 @@ import type { ScanbotSDKCapacitorPlugin } from './definitions'; | ||
export * from './types'; | ||
export * from './arguments'; | ||
export * from './configurations'; | ||
export * from './results'; | ||
export { ScanbotSDK }; |
@@ -28,3 +28,6 @@ //General project infos | ||
export * from './types'; | ||
export * from './arguments'; | ||
export * from './configurations'; | ||
export * from './results'; | ||
export { ScanbotSDK }; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,226 @@ | ||
export {}; | ||
export class MedicalCertificateStandardSize { | ||
} | ||
/** | ||
* A5 portrait document (e.g. white sheet, AUB Muster 1b/E (1/2018)) | ||
*/ | ||
MedicalCertificateStandardSize.A5_PORTRAIT = { width: 148.0, height: 210.0 }; | ||
/** | ||
* A6 landscape document (e.g. yellow sheet, AUB Muster 1b (1.2018)) | ||
*/ | ||
MedicalCertificateStandardSize.A6_LANDSCAPE = { width: 148.0, height: 105.0 }; | ||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
export class JSTextFunctionBuilder { | ||
constructor(callback) { | ||
this.callback = callback; | ||
} | ||
// Performs preprocessing on the function string representation. | ||
build() { | ||
let fnStr = this.callback.toString(); | ||
// Renames input arguments to standard sequential names (eg. __arg0__, __arg1__...) | ||
const params = this.getParamNames(); | ||
params.forEach((param, index) => { | ||
const regex = new RegExp(`([^\\w])(${param})([^\\w])`, 'g'); | ||
// eslint-disable-next-line no-useless-escape | ||
fnStr = fnStr.replace(regex, `\$1\_\_arg${index}\_\_\$3`); | ||
}); | ||
// Gives a name to the function, so that it can be referenced from the native JSContext | ||
fnStr = fnStr.replace('function', 'function __execute__'); | ||
return { | ||
body: fnStr, | ||
argsCount: params.length, | ||
}; | ||
} | ||
// Returns the list of all the callback function arguments | ||
getParamNames() { | ||
const STRIP_COMMENTS = | ||
// eslint-disable-next-line no-useless-escape | ||
/(\/\/.*$)|(\/\*[\s\S]*?\*\/)|(\s*=[^,\)]*(('(?:\\'|[^'\r\n])*')|("(?:\\"|[^"\r\n])*"))|(\s*=[^,\)]*))/gm; | ||
const ARGUMENT_NAMES = /([^\s,]+)/g; | ||
const fnStr = this.callback.toString().replace(STRIP_COMMENTS, ''); | ||
let result = fnStr | ||
.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')) | ||
.match(ARGUMENT_NAMES); | ||
if (result === null) { | ||
result = []; | ||
} | ||
return result; | ||
} | ||
} | ||
export class JSStringToBoolTextFunctionBuilder extends JSTextFunctionBuilder { | ||
} | ||
export class JSStringToStringTextFunctionBuilder extends JSTextFunctionBuilder { | ||
} | ||
export class GenericDocumentNormalizedMRZFields { | ||
constructor(rootField) { | ||
this.rootField = rootField; | ||
} | ||
/** Normalized field type name of the "BirthDate" document field. */ | ||
get BIRTH_DATE() { | ||
return `${this.rootField}.MRZ.BirthDate`; | ||
} | ||
/** Normalized field type name of the "CheckDigit" document field. */ | ||
get CHECK_DIGIT() { | ||
return `${this.rootField}.MRZ.CheckDigit`; | ||
} | ||
/** Normalized field type name of the "DocumentNumber" document field. */ | ||
get DOCUMENT_NUMBER() { | ||
return `${this.rootField}.MRZ.DocumentNumber`; | ||
} | ||
/** Normalized field type name of the "ExpiryDate" document field. */ | ||
get EXPIRY_DATE() { | ||
return `${this.rootField}.MRZ.ExpiryDate`; | ||
} | ||
/** Normalized field type name of the "Gender" document field. */ | ||
get GENDER() { | ||
return `${this.rootField}.MRZ.Gender`; | ||
} | ||
/** Normalized field type name of the "GivenNames" document field. */ | ||
get GIVEN_NAMES() { | ||
return `${this.rootField}.MRZ.GivenNames`; | ||
} | ||
/** Normalized field type name of the "IssuingAuthority" document field. */ | ||
get ISSUING_AUTHORITY() { | ||
return `${this.rootField}.MRZ.IssuingAuthority`; | ||
} | ||
/** Normalized field type name of the "Nationality" document field. */ | ||
get NATIONALITY() { | ||
return `${this.rootField}.MRZ.Nationality`; | ||
} | ||
/** Normalized field type name of the "Optional1" document field. */ | ||
get OPTIONAL_1() { | ||
return `${this.rootField}.MRZ.Optional1`; | ||
} | ||
/** Normalized field type name of the "Optional2" document field. */ | ||
get OPTIONAL_2() { | ||
return `${this.rootField}.MRZ.Optional2`; | ||
} | ||
/** Normalized field type name of the "Surname" document field. */ | ||
get SURNAME() { | ||
return `${this.rootField}.MRZ.Surname`; | ||
} | ||
/** Normalized field type name of the "TravelDocType" document field. */ | ||
get TRAVEL_DOC_TYPE() { | ||
return `${this.rootField}.MRZ.TravelDocType`; | ||
} | ||
/** Normalized field type name of the "TravelDocTypeVariant" document field. */ | ||
get TRAVEL_DOC_TYPE_VARIANT() { | ||
return `${this.rootField}.MRZ.TravelDocTypeVariant`; | ||
} | ||
} | ||
export const GenericDocumentNormalizedFields = { | ||
DeDriverLicenseBack: { | ||
/** Normalized field type name of the "Restrictions" document field. */ | ||
RESTRICTIONS: 'DeDriverLicenseBack.Restrictions', | ||
Category: { | ||
/** Normalized field type name of the "Restrictions" document field. */ | ||
RESTRICTIONS: 'DeDriverLicenseBack.Category.Restrictions', | ||
/** Normalized field type name of the "ValidFrom" document field. */ | ||
VALID_FROM: 'DeDriverLicenseBack.Category.ValidFrom', | ||
/** Normalized field type name of the "ValidUntil" document field. */ | ||
VALID_UNTIL: 'DeDriverLicenseBack.Category.ValidUntil' | ||
}, | ||
}, | ||
DeDriverLicenseFront: { | ||
/** Normalized field type name of the "BirthDate" document field. */ | ||
BIRTH_DATE: 'DeDriverLicenseFront.BirthDate', | ||
/** Normalized field type name of the "Birthplace" document field. */ | ||
BIRTHPLACE: 'DeDriverLicenseFront.Birthplace', | ||
/** Normalized field type name of the "ExpiryDate" document field. */ | ||
EXPIRY_DATE: 'DeDriverLicenseFront.ExpiryDate', | ||
/** Normalized field type name of the "GivenNames" document field. */ | ||
GIVEN_NAMES: 'DeDriverLicenseFront.GivenNames', | ||
/** Normalized field type name of the "ID" document field. */ | ||
ID: 'DeDriverLicenseFront.ID', | ||
/** Normalized field type name of the "IssueDate" document field. */ | ||
ISSUE_DATE: 'DeDriverLicenseFront.IssueDate', | ||
/** Normalized field type name of the "IssuingAuthority" document field. */ | ||
ISSUING_AUTHORITY: 'DeDriverLicenseFront.IssuingAuthority', | ||
/** Normalized field type name of the "LicenseCategories" document field. */ | ||
LICENSE_CATEGORIES: 'DeDriverLicenseFront.LicenseCategories', | ||
/** Normalized field type name of the "Photo" document field. */ | ||
PHOTO: 'DeDriverLicenseFront.Photo', | ||
/** Normalized field type name of the "Signature" document field. */ | ||
SIGNATURE: 'DeDriverLicenseFront.Signature', | ||
/** Normalized field type name of the "Surname" document field. */ | ||
SURNAME: 'DeDriverLicenseFront.Surname', | ||
}, | ||
DeIdCardBack: { | ||
/** Normalized field type name of the "Address" document field. */ | ||
ADDRESS: 'DeIdCardBack.Address', | ||
/** Normalized field type name of the "EyeColor" document field. */ | ||
EYE_COLOR: 'DeIdCardBack.EyeColor', | ||
/** Normalized field type name of the "Height" document field. */ | ||
HEIGHT: 'DeIdCardBack.Height', | ||
/** Normalized field type name of the "IssueDate" document field. */ | ||
ISSUE_DATE: 'DeIdCardBack.IssueDate', | ||
/** Normalized field type name of the "IssuingAuthority" document field. */ | ||
ISSUING_AUTHORITY: 'DeIdCardBack.IssuingAuthority', | ||
/** Normalized field type name of the "Pseudonym" document field. */ | ||
PSEUDONYM: 'DeIdCardBack.Pseudonym', | ||
/** Normalized field type name of the "RawMRZ" document field. */ | ||
RAW_MRZ: 'DeIdCardBack.RawMRZ', | ||
/** MRZ Fields */ | ||
MrzFields: new GenericDocumentNormalizedMRZFields('DeIdCardBack'), | ||
}, | ||
DeIdCardFront: { | ||
/** Normalized field type name of the "BirthDate" document field. */ | ||
BIRTH_DATE: 'DeIdCardFront.BirthDate', | ||
/** Normalized field type name of the "Birthplace" document field. */ | ||
BIRTHPLACE: 'DeIdCardFront.Birthplace', | ||
/** Normalized field type name of the "ExpiryDate" document field. */ | ||
EXPIRY_DATE: 'DeIdCardFront.ExpiryDate', | ||
/** Normalized field type name of the "GivenNames" document field. */ | ||
GIVEN_NAMES: 'DeIdCardFront.GivenNames', | ||
/** Normalized field type name of the "ID" document field. */ | ||
ID: 'DeIdCardFront.ID', | ||
/** Normalized field type name of the "MaidenName" document field. */ | ||
MAIDEN_NAME: 'DeIdCardFront.MaidenName', | ||
/** Normalized field type name of the "Nationality" document field. */ | ||
NATIONALITY: 'DeIdCardFront.Nationality', | ||
/** Normalized field type name of the "PIN" document field. */ | ||
PIN: 'DeIdCardFront.PIN', | ||
/** Normalized field type name of the "Photo" document field. */ | ||
PHOTO: 'DeIdCardFront.Photo', | ||
/** Normalized field type name of the "Signature" document field. */ | ||
SIGNATURE: 'DeIdCardFront.Signature', | ||
/** Normalized field type name of the "Surname" document field. */ | ||
SURNAME: 'DeIdCardFront.Surname', | ||
}, | ||
DePassport: { | ||
/** Normalized field type name of the "BirthDate" document field. */ | ||
BIRTH_DATE: 'DePassport.BirthDate', | ||
/** Normalized field type name of the "Birthplace" document field. */ | ||
BIRTHPLACE: 'DePassport.Birthplace', | ||
/** Normalized field type name of the "CountryCode" document field. */ | ||
COUNTRY_CODE: 'DePassport.CountryCode', | ||
/** Normalized field type name of the "ExpiryDate" document field. */ | ||
EXPIRY_DATE: 'DePassport.ExpiryDate', | ||
/** Normalized field type name of the "Gender" document field. */ | ||
GENDER: 'DePassport.Gender', | ||
/** Normalized field type name of the "GivenNames" document field. */ | ||
GIVEN_NAMES: 'DePassport.GivenNames', | ||
/** Normalized field type name of the "ID" document field. */ | ||
ID: 'DePassport.ID', | ||
/** Normalized field type name of the "IssueDate" document field. */ | ||
ISSUE_DATE: 'DePassport.IssueDate', | ||
/** Normalized field type name of the "IssuingAuthority" document field. */ | ||
ISSUING_AUTHORITY: 'DePassport.IssuingAuthority', | ||
/** Normalized field type name of the "MaidenName" document field. */ | ||
MAIDEN_NAME: 'DePassport.MaidenName', | ||
/** Normalized field type name of the "Nationality" document field. */ | ||
NATIONALITY: 'DePassport.Nationality', | ||
/** Normalized field type name of the "PassportType" document field. */ | ||
PASSPORT_TYPE: 'DePassport.PassportType', | ||
/** Normalized field type name of the "Photo" document field. */ | ||
PHOTO: 'DePassport.Photo', | ||
/** Normalized field type name of the "RawMRZ" document field. */ | ||
RAW_MRZ: 'DePassport.RawMRZ', | ||
/** Normalized field type name of the "Signature" document field. */ | ||
SIGNATURE: 'DePassport.Signature', | ||
/** Normalized field type name of the "Surname" document field. */ | ||
SURNAME: 'DePassport.Surname', | ||
/** MRZ Fields */ | ||
MrzFields: new GenericDocumentNormalizedMRZFields('DePassport'), | ||
}, | ||
}; | ||
//# sourceMappingURL=types.js.map |
@@ -7,2 +7,228 @@ 'use strict'; | ||
class MedicalCertificateStandardSize { | ||
} | ||
/** | ||
* A5 portrait document (e.g. white sheet, AUB Muster 1b/E (1/2018)) | ||
*/ | ||
MedicalCertificateStandardSize.A5_PORTRAIT = { width: 148.0, height: 210.0 }; | ||
/** | ||
* A6 landscape document (e.g. yellow sheet, AUB Muster 1b (1.2018)) | ||
*/ | ||
MedicalCertificateStandardSize.A6_LANDSCAPE = { width: 148.0, height: 105.0 }; | ||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
class JSTextFunctionBuilder { | ||
constructor(callback) { | ||
this.callback = callback; | ||
} | ||
// Performs preprocessing on the function string representation. | ||
build() { | ||
let fnStr = this.callback.toString(); | ||
// Renames input arguments to standard sequential names (eg. __arg0__, __arg1__...) | ||
const params = this.getParamNames(); | ||
params.forEach((param, index) => { | ||
const regex = new RegExp(`([^\\w])(${param})([^\\w])`, 'g'); | ||
// eslint-disable-next-line no-useless-escape | ||
fnStr = fnStr.replace(regex, `\$1\_\_arg${index}\_\_\$3`); | ||
}); | ||
// Gives a name to the function, so that it can be referenced from the native JSContext | ||
fnStr = fnStr.replace('function', 'function __execute__'); | ||
return { | ||
body: fnStr, | ||
argsCount: params.length, | ||
}; | ||
} | ||
// Returns the list of all the callback function arguments | ||
getParamNames() { | ||
const STRIP_COMMENTS = | ||
// eslint-disable-next-line no-useless-escape | ||
/(\/\/.*$)|(\/\*[\s\S]*?\*\/)|(\s*=[^,\)]*(('(?:\\'|[^'\r\n])*')|("(?:\\"|[^"\r\n])*"))|(\s*=[^,\)]*))/gm; | ||
const ARGUMENT_NAMES = /([^\s,]+)/g; | ||
const fnStr = this.callback.toString().replace(STRIP_COMMENTS, ''); | ||
let result = fnStr | ||
.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')) | ||
.match(ARGUMENT_NAMES); | ||
if (result === null) { | ||
result = []; | ||
} | ||
return result; | ||
} | ||
} | ||
class JSStringToBoolTextFunctionBuilder extends JSTextFunctionBuilder { | ||
} | ||
class JSStringToStringTextFunctionBuilder extends JSTextFunctionBuilder { | ||
} | ||
class GenericDocumentNormalizedMRZFields { | ||
constructor(rootField) { | ||
this.rootField = rootField; | ||
} | ||
/** Normalized field type name of the "BirthDate" document field. */ | ||
get BIRTH_DATE() { | ||
return `${this.rootField}.MRZ.BirthDate`; | ||
} | ||
/** Normalized field type name of the "CheckDigit" document field. */ | ||
get CHECK_DIGIT() { | ||
return `${this.rootField}.MRZ.CheckDigit`; | ||
} | ||
/** Normalized field type name of the "DocumentNumber" document field. */ | ||
get DOCUMENT_NUMBER() { | ||
return `${this.rootField}.MRZ.DocumentNumber`; | ||
} | ||
/** Normalized field type name of the "ExpiryDate" document field. */ | ||
get EXPIRY_DATE() { | ||
return `${this.rootField}.MRZ.ExpiryDate`; | ||
} | ||
/** Normalized field type name of the "Gender" document field. */ | ||
get GENDER() { | ||
return `${this.rootField}.MRZ.Gender`; | ||
} | ||
/** Normalized field type name of the "GivenNames" document field. */ | ||
get GIVEN_NAMES() { | ||
return `${this.rootField}.MRZ.GivenNames`; | ||
} | ||
/** Normalized field type name of the "IssuingAuthority" document field. */ | ||
get ISSUING_AUTHORITY() { | ||
return `${this.rootField}.MRZ.IssuingAuthority`; | ||
} | ||
/** Normalized field type name of the "Nationality" document field. */ | ||
get NATIONALITY() { | ||
return `${this.rootField}.MRZ.Nationality`; | ||
} | ||
/** Normalized field type name of the "Optional1" document field. */ | ||
get OPTIONAL_1() { | ||
return `${this.rootField}.MRZ.Optional1`; | ||
} | ||
/** Normalized field type name of the "Optional2" document field. */ | ||
get OPTIONAL_2() { | ||
return `${this.rootField}.MRZ.Optional2`; | ||
} | ||
/** Normalized field type name of the "Surname" document field. */ | ||
get SURNAME() { | ||
return `${this.rootField}.MRZ.Surname`; | ||
} | ||
/** Normalized field type name of the "TravelDocType" document field. */ | ||
get TRAVEL_DOC_TYPE() { | ||
return `${this.rootField}.MRZ.TravelDocType`; | ||
} | ||
/** Normalized field type name of the "TravelDocTypeVariant" document field. */ | ||
get TRAVEL_DOC_TYPE_VARIANT() { | ||
return `${this.rootField}.MRZ.TravelDocTypeVariant`; | ||
} | ||
} | ||
const GenericDocumentNormalizedFields = { | ||
DeDriverLicenseBack: { | ||
/** Normalized field type name of the "Restrictions" document field. */ | ||
RESTRICTIONS: 'DeDriverLicenseBack.Restrictions', | ||
Category: { | ||
/** Normalized field type name of the "Restrictions" document field. */ | ||
RESTRICTIONS: 'DeDriverLicenseBack.Category.Restrictions', | ||
/** Normalized field type name of the "ValidFrom" document field. */ | ||
VALID_FROM: 'DeDriverLicenseBack.Category.ValidFrom', | ||
/** Normalized field type name of the "ValidUntil" document field. */ | ||
VALID_UNTIL: 'DeDriverLicenseBack.Category.ValidUntil' | ||
}, | ||
}, | ||
DeDriverLicenseFront: { | ||
/** Normalized field type name of the "BirthDate" document field. */ | ||
BIRTH_DATE: 'DeDriverLicenseFront.BirthDate', | ||
/** Normalized field type name of the "Birthplace" document field. */ | ||
BIRTHPLACE: 'DeDriverLicenseFront.Birthplace', | ||
/** Normalized field type name of the "ExpiryDate" document field. */ | ||
EXPIRY_DATE: 'DeDriverLicenseFront.ExpiryDate', | ||
/** Normalized field type name of the "GivenNames" document field. */ | ||
GIVEN_NAMES: 'DeDriverLicenseFront.GivenNames', | ||
/** Normalized field type name of the "ID" document field. */ | ||
ID: 'DeDriverLicenseFront.ID', | ||
/** Normalized field type name of the "IssueDate" document field. */ | ||
ISSUE_DATE: 'DeDriverLicenseFront.IssueDate', | ||
/** Normalized field type name of the "IssuingAuthority" document field. */ | ||
ISSUING_AUTHORITY: 'DeDriverLicenseFront.IssuingAuthority', | ||
/** Normalized field type name of the "LicenseCategories" document field. */ | ||
LICENSE_CATEGORIES: 'DeDriverLicenseFront.LicenseCategories', | ||
/** Normalized field type name of the "Photo" document field. */ | ||
PHOTO: 'DeDriverLicenseFront.Photo', | ||
/** Normalized field type name of the "Signature" document field. */ | ||
SIGNATURE: 'DeDriverLicenseFront.Signature', | ||
/** Normalized field type name of the "Surname" document field. */ | ||
SURNAME: 'DeDriverLicenseFront.Surname', | ||
}, | ||
DeIdCardBack: { | ||
/** Normalized field type name of the "Address" document field. */ | ||
ADDRESS: 'DeIdCardBack.Address', | ||
/** Normalized field type name of the "EyeColor" document field. */ | ||
EYE_COLOR: 'DeIdCardBack.EyeColor', | ||
/** Normalized field type name of the "Height" document field. */ | ||
HEIGHT: 'DeIdCardBack.Height', | ||
/** Normalized field type name of the "IssueDate" document field. */ | ||
ISSUE_DATE: 'DeIdCardBack.IssueDate', | ||
/** Normalized field type name of the "IssuingAuthority" document field. */ | ||
ISSUING_AUTHORITY: 'DeIdCardBack.IssuingAuthority', | ||
/** Normalized field type name of the "Pseudonym" document field. */ | ||
PSEUDONYM: 'DeIdCardBack.Pseudonym', | ||
/** Normalized field type name of the "RawMRZ" document field. */ | ||
RAW_MRZ: 'DeIdCardBack.RawMRZ', | ||
/** MRZ Fields */ | ||
MrzFields: new GenericDocumentNormalizedMRZFields('DeIdCardBack'), | ||
}, | ||
DeIdCardFront: { | ||
/** Normalized field type name of the "BirthDate" document field. */ | ||
BIRTH_DATE: 'DeIdCardFront.BirthDate', | ||
/** Normalized field type name of the "Birthplace" document field. */ | ||
BIRTHPLACE: 'DeIdCardFront.Birthplace', | ||
/** Normalized field type name of the "ExpiryDate" document field. */ | ||
EXPIRY_DATE: 'DeIdCardFront.ExpiryDate', | ||
/** Normalized field type name of the "GivenNames" document field. */ | ||
GIVEN_NAMES: 'DeIdCardFront.GivenNames', | ||
/** Normalized field type name of the "ID" document field. */ | ||
ID: 'DeIdCardFront.ID', | ||
/** Normalized field type name of the "MaidenName" document field. */ | ||
MAIDEN_NAME: 'DeIdCardFront.MaidenName', | ||
/** Normalized field type name of the "Nationality" document field. */ | ||
NATIONALITY: 'DeIdCardFront.Nationality', | ||
/** Normalized field type name of the "PIN" document field. */ | ||
PIN: 'DeIdCardFront.PIN', | ||
/** Normalized field type name of the "Photo" document field. */ | ||
PHOTO: 'DeIdCardFront.Photo', | ||
/** Normalized field type name of the "Signature" document field. */ | ||
SIGNATURE: 'DeIdCardFront.Signature', | ||
/** Normalized field type name of the "Surname" document field. */ | ||
SURNAME: 'DeIdCardFront.Surname', | ||
}, | ||
DePassport: { | ||
/** Normalized field type name of the "BirthDate" document field. */ | ||
BIRTH_DATE: 'DePassport.BirthDate', | ||
/** Normalized field type name of the "Birthplace" document field. */ | ||
BIRTHPLACE: 'DePassport.Birthplace', | ||
/** Normalized field type name of the "CountryCode" document field. */ | ||
COUNTRY_CODE: 'DePassport.CountryCode', | ||
/** Normalized field type name of the "ExpiryDate" document field. */ | ||
EXPIRY_DATE: 'DePassport.ExpiryDate', | ||
/** Normalized field type name of the "Gender" document field. */ | ||
GENDER: 'DePassport.Gender', | ||
/** Normalized field type name of the "GivenNames" document field. */ | ||
GIVEN_NAMES: 'DePassport.GivenNames', | ||
/** Normalized field type name of the "ID" document field. */ | ||
ID: 'DePassport.ID', | ||
/** Normalized field type name of the "IssueDate" document field. */ | ||
ISSUE_DATE: 'DePassport.IssueDate', | ||
/** Normalized field type name of the "IssuingAuthority" document field. */ | ||
ISSUING_AUTHORITY: 'DePassport.IssuingAuthority', | ||
/** Normalized field type name of the "MaidenName" document field. */ | ||
MAIDEN_NAME: 'DePassport.MaidenName', | ||
/** Normalized field type name of the "Nationality" document field. */ | ||
NATIONALITY: 'DePassport.Nationality', | ||
/** Normalized field type name of the "PassportType" document field. */ | ||
PASSPORT_TYPE: 'DePassport.PassportType', | ||
/** Normalized field type name of the "Photo" document field. */ | ||
PHOTO: 'DePassport.Photo', | ||
/** Normalized field type name of the "RawMRZ" document field. */ | ||
RAW_MRZ: 'DePassport.RawMRZ', | ||
/** Normalized field type name of the "Signature" document field. */ | ||
SIGNATURE: 'DePassport.Signature', | ||
/** Normalized field type name of the "Surname" document field. */ | ||
SURNAME: 'DePassport.Surname', | ||
/** MRZ Fields */ | ||
MrzFields: new GenericDocumentNormalizedMRZFields('DePassport'), | ||
}, | ||
}; | ||
//General project infos | ||
@@ -14,3 +240,9 @@ const scanbot = core.registerPlugin('ScanbotSDKCapacitor', { | ||
exports.GenericDocumentNormalizedFields = GenericDocumentNormalizedFields; | ||
exports.GenericDocumentNormalizedMRZFields = GenericDocumentNormalizedMRZFields; | ||
exports.JSStringToBoolTextFunctionBuilder = JSStringToBoolTextFunctionBuilder; | ||
exports.JSStringToStringTextFunctionBuilder = JSStringToStringTextFunctionBuilder; | ||
exports.JSTextFunctionBuilder = JSTextFunctionBuilder; | ||
exports.MedicalCertificateStandardSize = MedicalCertificateStandardSize; | ||
exports.ScanbotSDK = ScanbotSDK; | ||
//# sourceMappingURL=plugin.cjs.js.map |
var capacitorScanbotSDKCapacitor = (function (exports, core) { | ||
'use strict'; | ||
'use strict'; | ||
//General project infos | ||
const scanbot = core.registerPlugin('ScanbotSDKCapacitor', { | ||
//web: () => import('./web').then(m => new m.ScanbotSDKCapacitorWeb()), | ||
}); | ||
const ScanbotSDK = scanbot; | ||
class MedicalCertificateStandardSize { | ||
} | ||
/** | ||
* A5 portrait document (e.g. white sheet, AUB Muster 1b/E (1/2018)) | ||
*/ | ||
MedicalCertificateStandardSize.A5_PORTRAIT = { width: 148.0, height: 210.0 }; | ||
/** | ||
* A6 landscape document (e.g. yellow sheet, AUB Muster 1b (1.2018)) | ||
*/ | ||
MedicalCertificateStandardSize.A6_LANDSCAPE = { width: 148.0, height: 105.0 }; | ||
// eslint-disable-next-line @typescript-eslint/ban-types | ||
class JSTextFunctionBuilder { | ||
constructor(callback) { | ||
this.callback = callback; | ||
} | ||
// Performs preprocessing on the function string representation. | ||
build() { | ||
let fnStr = this.callback.toString(); | ||
// Renames input arguments to standard sequential names (eg. __arg0__, __arg1__...) | ||
const params = this.getParamNames(); | ||
params.forEach((param, index) => { | ||
const regex = new RegExp(`([^\\w])(${param})([^\\w])`, 'g'); | ||
// eslint-disable-next-line no-useless-escape | ||
fnStr = fnStr.replace(regex, `\$1\_\_arg${index}\_\_\$3`); | ||
}); | ||
// Gives a name to the function, so that it can be referenced from the native JSContext | ||
fnStr = fnStr.replace('function', 'function __execute__'); | ||
return { | ||
body: fnStr, | ||
argsCount: params.length, | ||
}; | ||
} | ||
// Returns the list of all the callback function arguments | ||
getParamNames() { | ||
const STRIP_COMMENTS = | ||
// eslint-disable-next-line no-useless-escape | ||
/(\/\/.*$)|(\/\*[\s\S]*?\*\/)|(\s*=[^,\)]*(('(?:\\'|[^'\r\n])*')|("(?:\\"|[^"\r\n])*"))|(\s*=[^,\)]*))/gm; | ||
const ARGUMENT_NAMES = /([^\s,]+)/g; | ||
const fnStr = this.callback.toString().replace(STRIP_COMMENTS, ''); | ||
let result = fnStr | ||
.slice(fnStr.indexOf('(') + 1, fnStr.indexOf(')')) | ||
.match(ARGUMENT_NAMES); | ||
if (result === null) { | ||
result = []; | ||
} | ||
return result; | ||
} | ||
} | ||
class JSStringToBoolTextFunctionBuilder extends JSTextFunctionBuilder { | ||
} | ||
class JSStringToStringTextFunctionBuilder extends JSTextFunctionBuilder { | ||
} | ||
class GenericDocumentNormalizedMRZFields { | ||
constructor(rootField) { | ||
this.rootField = rootField; | ||
} | ||
/** Normalized field type name of the "BirthDate" document field. */ | ||
get BIRTH_DATE() { | ||
return `${this.rootField}.MRZ.BirthDate`; | ||
} | ||
/** Normalized field type name of the "CheckDigit" document field. */ | ||
get CHECK_DIGIT() { | ||
return `${this.rootField}.MRZ.CheckDigit`; | ||
} | ||
/** Normalized field type name of the "DocumentNumber" document field. */ | ||
get DOCUMENT_NUMBER() { | ||
return `${this.rootField}.MRZ.DocumentNumber`; | ||
} | ||
/** Normalized field type name of the "ExpiryDate" document field. */ | ||
get EXPIRY_DATE() { | ||
return `${this.rootField}.MRZ.ExpiryDate`; | ||
} | ||
/** Normalized field type name of the "Gender" document field. */ | ||
get GENDER() { | ||
return `${this.rootField}.MRZ.Gender`; | ||
} | ||
/** Normalized field type name of the "GivenNames" document field. */ | ||
get GIVEN_NAMES() { | ||
return `${this.rootField}.MRZ.GivenNames`; | ||
} | ||
/** Normalized field type name of the "IssuingAuthority" document field. */ | ||
get ISSUING_AUTHORITY() { | ||
return `${this.rootField}.MRZ.IssuingAuthority`; | ||
} | ||
/** Normalized field type name of the "Nationality" document field. */ | ||
get NATIONALITY() { | ||
return `${this.rootField}.MRZ.Nationality`; | ||
} | ||
/** Normalized field type name of the "Optional1" document field. */ | ||
get OPTIONAL_1() { | ||
return `${this.rootField}.MRZ.Optional1`; | ||
} | ||
/** Normalized field type name of the "Optional2" document field. */ | ||
get OPTIONAL_2() { | ||
return `${this.rootField}.MRZ.Optional2`; | ||
} | ||
/** Normalized field type name of the "Surname" document field. */ | ||
get SURNAME() { | ||
return `${this.rootField}.MRZ.Surname`; | ||
} | ||
/** Normalized field type name of the "TravelDocType" document field. */ | ||
get TRAVEL_DOC_TYPE() { | ||
return `${this.rootField}.MRZ.TravelDocType`; | ||
} | ||
/** Normalized field type name of the "TravelDocTypeVariant" document field. */ | ||
get TRAVEL_DOC_TYPE_VARIANT() { | ||
return `${this.rootField}.MRZ.TravelDocTypeVariant`; | ||
} | ||
} | ||
const GenericDocumentNormalizedFields = { | ||
DeDriverLicenseBack: { | ||
/** Normalized field type name of the "Restrictions" document field. */ | ||
RESTRICTIONS: 'DeDriverLicenseBack.Restrictions', | ||
Category: { | ||
/** Normalized field type name of the "Restrictions" document field. */ | ||
RESTRICTIONS: 'DeDriverLicenseBack.Category.Restrictions', | ||
/** Normalized field type name of the "ValidFrom" document field. */ | ||
VALID_FROM: 'DeDriverLicenseBack.Category.ValidFrom', | ||
/** Normalized field type name of the "ValidUntil" document field. */ | ||
VALID_UNTIL: 'DeDriverLicenseBack.Category.ValidUntil' | ||
}, | ||
}, | ||
DeDriverLicenseFront: { | ||
/** Normalized field type name of the "BirthDate" document field. */ | ||
BIRTH_DATE: 'DeDriverLicenseFront.BirthDate', | ||
/** Normalized field type name of the "Birthplace" document field. */ | ||
BIRTHPLACE: 'DeDriverLicenseFront.Birthplace', | ||
/** Normalized field type name of the "ExpiryDate" document field. */ | ||
EXPIRY_DATE: 'DeDriverLicenseFront.ExpiryDate', | ||
/** Normalized field type name of the "GivenNames" document field. */ | ||
GIVEN_NAMES: 'DeDriverLicenseFront.GivenNames', | ||
/** Normalized field type name of the "ID" document field. */ | ||
ID: 'DeDriverLicenseFront.ID', | ||
/** Normalized field type name of the "IssueDate" document field. */ | ||
ISSUE_DATE: 'DeDriverLicenseFront.IssueDate', | ||
/** Normalized field type name of the "IssuingAuthority" document field. */ | ||
ISSUING_AUTHORITY: 'DeDriverLicenseFront.IssuingAuthority', | ||
/** Normalized field type name of the "LicenseCategories" document field. */ | ||
LICENSE_CATEGORIES: 'DeDriverLicenseFront.LicenseCategories', | ||
/** Normalized field type name of the "Photo" document field. */ | ||
PHOTO: 'DeDriverLicenseFront.Photo', | ||
/** Normalized field type name of the "Signature" document field. */ | ||
SIGNATURE: 'DeDriverLicenseFront.Signature', | ||
/** Normalized field type name of the "Surname" document field. */ | ||
SURNAME: 'DeDriverLicenseFront.Surname', | ||
}, | ||
DeIdCardBack: { | ||
/** Normalized field type name of the "Address" document field. */ | ||
ADDRESS: 'DeIdCardBack.Address', | ||
/** Normalized field type name of the "EyeColor" document field. */ | ||
EYE_COLOR: 'DeIdCardBack.EyeColor', | ||
/** Normalized field type name of the "Height" document field. */ | ||
HEIGHT: 'DeIdCardBack.Height', | ||
/** Normalized field type name of the "IssueDate" document field. */ | ||
ISSUE_DATE: 'DeIdCardBack.IssueDate', | ||
/** Normalized field type name of the "IssuingAuthority" document field. */ | ||
ISSUING_AUTHORITY: 'DeIdCardBack.IssuingAuthority', | ||
/** Normalized field type name of the "Pseudonym" document field. */ | ||
PSEUDONYM: 'DeIdCardBack.Pseudonym', | ||
/** Normalized field type name of the "RawMRZ" document field. */ | ||
RAW_MRZ: 'DeIdCardBack.RawMRZ', | ||
/** MRZ Fields */ | ||
MrzFields: new GenericDocumentNormalizedMRZFields('DeIdCardBack'), | ||
}, | ||
DeIdCardFront: { | ||
/** Normalized field type name of the "BirthDate" document field. */ | ||
BIRTH_DATE: 'DeIdCardFront.BirthDate', | ||
/** Normalized field type name of the "Birthplace" document field. */ | ||
BIRTHPLACE: 'DeIdCardFront.Birthplace', | ||
/** Normalized field type name of the "ExpiryDate" document field. */ | ||
EXPIRY_DATE: 'DeIdCardFront.ExpiryDate', | ||
/** Normalized field type name of the "GivenNames" document field. */ | ||
GIVEN_NAMES: 'DeIdCardFront.GivenNames', | ||
/** Normalized field type name of the "ID" document field. */ | ||
ID: 'DeIdCardFront.ID', | ||
/** Normalized field type name of the "MaidenName" document field. */ | ||
MAIDEN_NAME: 'DeIdCardFront.MaidenName', | ||
/** Normalized field type name of the "Nationality" document field. */ | ||
NATIONALITY: 'DeIdCardFront.Nationality', | ||
/** Normalized field type name of the "PIN" document field. */ | ||
PIN: 'DeIdCardFront.PIN', | ||
/** Normalized field type name of the "Photo" document field. */ | ||
PHOTO: 'DeIdCardFront.Photo', | ||
/** Normalized field type name of the "Signature" document field. */ | ||
SIGNATURE: 'DeIdCardFront.Signature', | ||
/** Normalized field type name of the "Surname" document field. */ | ||
SURNAME: 'DeIdCardFront.Surname', | ||
}, | ||
DePassport: { | ||
/** Normalized field type name of the "BirthDate" document field. */ | ||
BIRTH_DATE: 'DePassport.BirthDate', | ||
/** Normalized field type name of the "Birthplace" document field. */ | ||
BIRTHPLACE: 'DePassport.Birthplace', | ||
/** Normalized field type name of the "CountryCode" document field. */ | ||
COUNTRY_CODE: 'DePassport.CountryCode', | ||
/** Normalized field type name of the "ExpiryDate" document field. */ | ||
EXPIRY_DATE: 'DePassport.ExpiryDate', | ||
/** Normalized field type name of the "Gender" document field. */ | ||
GENDER: 'DePassport.Gender', | ||
/** Normalized field type name of the "GivenNames" document field. */ | ||
GIVEN_NAMES: 'DePassport.GivenNames', | ||
/** Normalized field type name of the "ID" document field. */ | ||
ID: 'DePassport.ID', | ||
/** Normalized field type name of the "IssueDate" document field. */ | ||
ISSUE_DATE: 'DePassport.IssueDate', | ||
/** Normalized field type name of the "IssuingAuthority" document field. */ | ||
ISSUING_AUTHORITY: 'DePassport.IssuingAuthority', | ||
/** Normalized field type name of the "MaidenName" document field. */ | ||
MAIDEN_NAME: 'DePassport.MaidenName', | ||
/** Normalized field type name of the "Nationality" document field. */ | ||
NATIONALITY: 'DePassport.Nationality', | ||
/** Normalized field type name of the "PassportType" document field. */ | ||
PASSPORT_TYPE: 'DePassport.PassportType', | ||
/** Normalized field type name of the "Photo" document field. */ | ||
PHOTO: 'DePassport.Photo', | ||
/** Normalized field type name of the "RawMRZ" document field. */ | ||
RAW_MRZ: 'DePassport.RawMRZ', | ||
/** Normalized field type name of the "Signature" document field. */ | ||
SIGNATURE: 'DePassport.Signature', | ||
/** Normalized field type name of the "Surname" document field. */ | ||
SURNAME: 'DePassport.Surname', | ||
/** MRZ Fields */ | ||
MrzFields: new GenericDocumentNormalizedMRZFields('DePassport'), | ||
}, | ||
}; | ||
exports.ScanbotSDK = ScanbotSDK; | ||
//General project infos | ||
const scanbot = core.registerPlugin('ScanbotSDKCapacitor', { | ||
//web: () => import('./web').then(m => new m.ScanbotSDKCapacitorWeb()), | ||
}); | ||
const ScanbotSDK = scanbot; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
exports.GenericDocumentNormalizedFields = GenericDocumentNormalizedFields; | ||
exports.GenericDocumentNormalizedMRZFields = GenericDocumentNormalizedMRZFields; | ||
exports.JSStringToBoolTextFunctionBuilder = JSStringToBoolTextFunctionBuilder; | ||
exports.JSStringToStringTextFunctionBuilder = JSStringToStringTextFunctionBuilder; | ||
exports.JSTextFunctionBuilder = JSTextFunctionBuilder; | ||
exports.MedicalCertificateStandardSize = MedicalCertificateStandardSize; | ||
exports.ScanbotSDK = ScanbotSDK; | ||
return exports; | ||
Object.defineProperty(exports, '__esModule', { value: true }); | ||
return exports; | ||
})({}, capacitorExports); | ||
//# sourceMappingURL=plugin.js.map |
{ | ||
"name": "capacitor-plugin-scanbot-sdk", | ||
"version": "2.2.0-beta.2", | ||
"version": "2.2.0-beta.3", | ||
"description": "Scanbot Document and Barcode Scanner SDK for Capacitor", | ||
@@ -5,0 +5,0 @@ "main": "dist/plugin.cjs.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
1058058
52
14309
2700