@jaak.ai/stamps 1.0.0-beta.1
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 +385 -0
- package/dist/cjs/document-detector_19.cjs.entry.js +8540 -0
- package/dist/cjs/index-5e4e5e7d.js +1685 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/loader.cjs.js +22 -0
- package/dist/cjs/mb-tooltip.cjs.entry.js +26 -0
- package/dist/cjs/stamps.cjs.js +23 -0
- package/dist/collection/collection-manifest.json +31 -0
- package/dist/collection/components/document-detector/document-detector.css +154 -0
- package/dist/collection/components/document-detector/document-detector.js +416 -0
- package/dist/collection/components/shared/mb-api-process-status/mb-api-process-status.css +360 -0
- package/dist/collection/components/shared/mb-api-process-status/mb-api-process-status.js +124 -0
- package/dist/collection/components/shared/mb-button/mb-button.css +95 -0
- package/dist/collection/components/shared/mb-button/mb-button.js +201 -0
- package/dist/collection/components/shared/mb-button-classic/mb-button-classic.css +100 -0
- package/dist/collection/components/shared/mb-button-classic/mb-button-classic.js +130 -0
- package/dist/collection/components/shared/mb-camera-experience/mb-camera-experience.css +740 -0
- package/dist/collection/components/shared/mb-camera-experience/mb-camera-experience.js +827 -0
- package/dist/collection/components/shared/mb-camera-experience/mb-camera-experience.utils.js +55 -0
- package/dist/collection/components/shared/mb-camera-selection/mb-camera-selection.css +124 -0
- package/dist/collection/components/shared/mb-camera-selection/mb-camera-selection.js +194 -0
- package/dist/collection/components/shared/mb-camera-toolbar/mb-camera-toolbar.css +80 -0
- package/dist/collection/components/shared/mb-camera-toolbar/mb-camera-toolbar.js +275 -0
- package/dist/collection/components/shared/mb-completed/mb-completed.css +17 -0
- package/dist/collection/components/shared/mb-completed/mb-completed.js +48 -0
- package/dist/collection/components/shared/mb-component/mb-component.css +321 -0
- package/dist/collection/components/shared/mb-component/mb-component.js +2269 -0
- package/dist/collection/components/shared/mb-component/mb-component.utils.js +14 -0
- package/dist/collection/components/shared/mb-container/mb-container.css +7 -0
- package/dist/collection/components/shared/mb-container/mb-container.js +23 -0
- package/dist/collection/components/shared/mb-feedback/mb-feedback.css +36 -0
- package/dist/collection/components/shared/mb-feedback/mb-feedback.js +91 -0
- package/dist/collection/components/shared/mb-feedback/mb-feedback.utils.js +11 -0
- package/dist/collection/components/shared/mb-help/mb-help.css +191 -0
- package/dist/collection/components/shared/mb-help/mb-help.js +409 -0
- package/dist/collection/components/shared/mb-help/mb-help.model.js +5 -0
- package/dist/collection/components/shared/mb-image-box/mb-image-box.css +78 -0
- package/dist/collection/components/shared/mb-image-box/mb-image-box.js +150 -0
- package/dist/collection/components/shared/mb-modal/mb-modal.css +106 -0
- package/dist/collection/components/shared/mb-modal/mb-modal.js +239 -0
- package/dist/collection/components/shared/mb-overlay/mb-overlay.css +46 -0
- package/dist/collection/components/shared/mb-overlay/mb-overlay.js +76 -0
- package/dist/collection/components/shared/mb-progress-tracker/mb-progress-tracker.css +24 -0
- package/dist/collection/components/shared/mb-progress-tracker/mb-progress-tracker.js +80 -0
- package/dist/collection/components/shared/mb-screen/mb-screen.css +19 -0
- package/dist/collection/components/shared/mb-screen/mb-screen.js +48 -0
- package/dist/collection/components/shared/mb-spinner/mb-spinner.css +30 -0
- package/dist/collection/components/shared/mb-spinner/mb-spinner.js +67 -0
- package/dist/collection/components/shared/mb-tooltip/mb-tooltip.css +62 -0
- package/dist/collection/components/shared/mb-tooltip/mb-tooltip.js +150 -0
- package/dist/collection/components/shared/mb-tooltip-advanced/mb-tooltip-advanced.css +91 -0
- package/dist/collection/components/shared/mb-tooltip-advanced/mb-tooltip-advanced.js +96 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/utils/data-structures.js +189 -0
- package/dist/collection/utils/device.helpers.js +37 -0
- package/dist/collection/utils/error-structures.js +47 -0
- package/dist/collection/utils/generic.helpers.js +82 -0
- package/dist/collection/utils/sdk.service.js +943 -0
- package/dist/collection/utils/state-lifter.js +3 -0
- package/dist/collection/utils/status.document-detector.js +15 -0
- package/dist/collection/utils/translation.service.js +97 -0
- package/dist/esm/document-detector_19.entry.js +8518 -0
- package/dist/esm/index-dc740acb.js +1656 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/loader.js +18 -0
- package/dist/esm/mb-tooltip.entry.js +22 -0
- package/dist/esm/polyfills/core-js.js +11 -0
- package/dist/esm/polyfills/css-shim.js +1 -0
- package/dist/esm/polyfills/dom.js +79 -0
- package/dist/esm/polyfills/es5-html-element.js +1 -0
- package/dist/esm/polyfills/index.js +34 -0
- package/dist/esm/polyfills/system.js +6 -0
- package/dist/esm/stamps.js +18 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/stamps/index.esm.js +0 -0
- package/dist/stamps/p-66d9fb33.entry.js +9 -0
- package/dist/stamps/p-7f07a434.js +2 -0
- package/dist/stamps/p-ec3f5972.entry.js +1 -0
- package/dist/stamps/stamps.esm.js +1 -0
- package/dist/types/components/document-detector/document-detector.d.ts +86 -0
- package/dist/types/components/shared/mb-api-process-status/mb-api-process-status.d.ts +30 -0
- package/dist/types/components/shared/mb-button/mb-button.d.ts +41 -0
- package/dist/types/components/shared/mb-button-classic/mb-button-classic.d.ts +27 -0
- package/dist/types/components/shared/mb-camera-experience/mb-camera-experience.d.ts +141 -0
- package/dist/types/components/shared/mb-camera-experience/mb-camera-experience.utils.d.ts +3 -0
- package/dist/types/components/shared/mb-camera-selection/mb-camera-selection.d.ts +33 -0
- package/dist/types/components/shared/mb-camera-toolbar/mb-camera-toolbar.d.ts +54 -0
- package/dist/types/components/shared/mb-completed/mb-completed.d.ts +12 -0
- package/dist/types/components/shared/mb-component/mb-component.d.ts +308 -0
- package/dist/types/components/shared/mb-component/mb-component.utils.d.ts +3 -0
- package/dist/types/components/shared/mb-container/mb-container.d.ts +8 -0
- package/dist/types/components/shared/mb-feedback/mb-feedback.d.ts +19 -0
- package/dist/types/components/shared/mb-feedback/mb-feedback.utils.d.ts +2 -0
- package/dist/types/components/shared/mb-help/mb-help.d.ts +66 -0
- package/dist/types/components/shared/mb-help/mb-help.model.d.ts +9 -0
- package/dist/types/components/shared/mb-image-box/mb-image-box.d.ts +35 -0
- package/dist/types/components/shared/mb-modal/mb-modal.d.ts +53 -0
- package/dist/types/components/shared/mb-overlay/mb-overlay.d.ts +17 -0
- package/dist/types/components/shared/mb-progress-tracker/mb-progress-tracker.d.ts +19 -0
- package/dist/types/components/shared/mb-screen/mb-screen.d.ts +12 -0
- package/dist/types/components/shared/mb-spinner/mb-spinner.d.ts +16 -0
- package/dist/types/components/shared/mb-tooltip/mb-tooltip.d.ts +10 -0
- package/dist/types/components/shared/mb-tooltip-advanced/mb-tooltip-advanced.d.ts +7 -0
- package/dist/types/components.d.ts +1382 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/stencil-public-runtime.d.ts +1637 -0
- package/dist/types/utils/data-structures.d.ts +264 -0
- package/dist/types/utils/device.helpers.d.ts +7 -0
- package/dist/types/utils/error-structures.d.ts +44 -0
- package/dist/types/utils/generic.helpers.d.ts +21 -0
- package/dist/types/utils/sdk.service.d.ts +52 -0
- package/dist/types/utils/state-lifter.d.ts +3 -0
- package/dist/types/utils/status.document-detector.d.ts +14 -0
- package/dist/types/utils/translation.service.d.ts +77 -0
- package/loader/cdn.js +3 -0
- package/loader/index.cjs.js +3 -0
- package/loader/index.d.ts +21 -0
- package/loader/index.es2017.js +3 -0
- package/loader/index.js +4 -0
- package/loader/package.json +11 -0
- package/package.json +63 -0
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { EventEmitter } from "../stencil-public-runtime";
|
|
2
|
+
import * as BlinkIDSDK from "@microblink/blinkid-in-browser-sdk";
|
|
3
|
+
export { ProductIntegrationInfo, SDKError, } from "@microblink/blinkid-in-browser-sdk";
|
|
4
|
+
export interface MicroblinkUI {
|
|
5
|
+
allowHelloMessage: boolean;
|
|
6
|
+
engineLocation: string;
|
|
7
|
+
workerLocation: string;
|
|
8
|
+
licenseKey: string;
|
|
9
|
+
wasmType: string;
|
|
10
|
+
rawRecognizers: string;
|
|
11
|
+
recognizers: Array<string>;
|
|
12
|
+
recognizerOptions: {
|
|
13
|
+
[key: string]: any;
|
|
14
|
+
};
|
|
15
|
+
recognitionTimeout?: number;
|
|
16
|
+
recognitionPauseTimeout?: number;
|
|
17
|
+
blinkIdVariant?: BlinkIDSDK.BlinkIDVariant;
|
|
18
|
+
thoroughScanFromImage: boolean;
|
|
19
|
+
enableDrag: boolean;
|
|
20
|
+
hideFeedback: boolean;
|
|
21
|
+
hideLoadingAndErrorUi: boolean;
|
|
22
|
+
scanFromCamera: boolean;
|
|
23
|
+
scanFromImage: boolean;
|
|
24
|
+
translations: {
|
|
25
|
+
[key: string]: string;
|
|
26
|
+
};
|
|
27
|
+
rawTranslations: string;
|
|
28
|
+
galleryOverlayType: "FULLSCREEN" | "INLINE";
|
|
29
|
+
galleryDropType: "FULLSCREEN" | "INLINE";
|
|
30
|
+
showActionLabels: boolean;
|
|
31
|
+
showModalWindows: boolean;
|
|
32
|
+
showScanningLine?: boolean;
|
|
33
|
+
showCameraFeedbackBarcodeMessage?: boolean;
|
|
34
|
+
iconCameraDefault: string;
|
|
35
|
+
iconCameraActive: string;
|
|
36
|
+
iconGalleryDefault: string;
|
|
37
|
+
iconGalleryActive: string;
|
|
38
|
+
iconInvalidFormat: string;
|
|
39
|
+
iconSpinnerScreenLoading: string;
|
|
40
|
+
iconSpinnerFromGalleryExperience: string;
|
|
41
|
+
iconGalleryScanningCompleted: string;
|
|
42
|
+
fatalError: EventEmitter<BlinkIDSDK.SDKError>;
|
|
43
|
+
ready: EventEmitter<EventReady>;
|
|
44
|
+
scanError: EventEmitter<EventScanError>;
|
|
45
|
+
scanSuccess: EventEmitter<EventScanSuccess>;
|
|
46
|
+
cameraScanStarted: EventEmitter<null>;
|
|
47
|
+
imageScanStarted: EventEmitter<null>;
|
|
48
|
+
setUiState: (state: "ERROR" | "LOADING" | "NONE" | "SUCCESS") => Promise<any>;
|
|
49
|
+
setUiMessage: (state: "FEEDBACK_ERROR" | "FEEDBACK_INFO" | "FEEDBACK_OK", message: string) => Promise<any>;
|
|
50
|
+
getProductIntegrationInfo: () => Promise<BlinkIDSDK.ProductIntegrationInfo>;
|
|
51
|
+
}
|
|
52
|
+
export interface SdkSettings {
|
|
53
|
+
allowHelloMessage: boolean;
|
|
54
|
+
engineLocation: string;
|
|
55
|
+
workerLocation: string;
|
|
56
|
+
wasmType?: BlinkIDSDK.WasmType;
|
|
57
|
+
blinkIdVariant?: BlinkIDSDK.BlinkIDVariant;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Events
|
|
61
|
+
*/
|
|
62
|
+
export declare class EventReady {
|
|
63
|
+
sdk: BlinkIDSDK.WasmSDK;
|
|
64
|
+
constructor(sdk: BlinkIDSDK.WasmSDK);
|
|
65
|
+
}
|
|
66
|
+
export declare class EventScanError {
|
|
67
|
+
code: Code;
|
|
68
|
+
fatal: boolean;
|
|
69
|
+
message: string;
|
|
70
|
+
recognizerName: string;
|
|
71
|
+
details?: any;
|
|
72
|
+
constructor(code: Code, fatal: boolean, message: string, recognizerName: string, details?: any);
|
|
73
|
+
}
|
|
74
|
+
export declare class EventScanSuccess {
|
|
75
|
+
recognizer: BlinkIDSDK.RecognizerResult;
|
|
76
|
+
recognizerName: string;
|
|
77
|
+
constructor(recognizer: BlinkIDSDK.RecognizerResult, recognizerName: string);
|
|
78
|
+
}
|
|
79
|
+
export interface RecognitionResults {
|
|
80
|
+
recognizer: BlinkIDSDK.RecognizerResult;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Error codes
|
|
84
|
+
*/
|
|
85
|
+
export declare enum Code {
|
|
86
|
+
EmptyResult = "EMPTY_RESULT",
|
|
87
|
+
InvalidRecognizerOptions = "INVALID_RECOGNIZER_OPTIONS",
|
|
88
|
+
NoImageFileFound = "NO_IMAGE_FILE_FOUND",
|
|
89
|
+
NoFirstImageFileFound = "NO_FIRST_IMAGE_FILE_FOUND",
|
|
90
|
+
NoSecondImageFileFound = "NO_SECOND_IMAGE_FILE_FOUND",
|
|
91
|
+
GenericScanError = "GENERIC_SCAN_ERROR",
|
|
92
|
+
CameraNotAllowed = "CAMERA_NOT_ALLOWED",
|
|
93
|
+
CameraInUse = "CAMERA_IN_USE",
|
|
94
|
+
CameraGenericError = "CAMERA_GENERIC_ERROR"
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Scan structures
|
|
98
|
+
*/
|
|
99
|
+
export declare const AvailableRecognizers: {
|
|
100
|
+
[key: string]: string;
|
|
101
|
+
};
|
|
102
|
+
interface BaseRecognitionConfiguration {
|
|
103
|
+
recognizers: Array<string>;
|
|
104
|
+
recognizerOptions?: any;
|
|
105
|
+
pingProxyUrl: string | null;
|
|
106
|
+
}
|
|
107
|
+
export interface VideoRecognitionConfiguration extends BaseRecognitionConfiguration {
|
|
108
|
+
recognitionTimeout?: number;
|
|
109
|
+
successFrame: boolean;
|
|
110
|
+
cameraFeed: HTMLVideoElement;
|
|
111
|
+
cameraId: string | null;
|
|
112
|
+
}
|
|
113
|
+
export interface ImageRecognitionConfiguration extends BaseRecognitionConfiguration {
|
|
114
|
+
thoroughScan?: boolean;
|
|
115
|
+
file: File;
|
|
116
|
+
}
|
|
117
|
+
export interface MultiSideImageRecognitionConfiguration extends BaseRecognitionConfiguration {
|
|
118
|
+
thoroughScan?: boolean;
|
|
119
|
+
firstFile: File;
|
|
120
|
+
secondFile: File;
|
|
121
|
+
}
|
|
122
|
+
export declare enum ImageRecognitionType {
|
|
123
|
+
SingleSide = "SingleSide",
|
|
124
|
+
MultiSide = "MultiSide"
|
|
125
|
+
}
|
|
126
|
+
export declare enum MultiSideImageType {
|
|
127
|
+
First = "First",
|
|
128
|
+
Second = "Second"
|
|
129
|
+
}
|
|
130
|
+
export interface RecognizerInstance {
|
|
131
|
+
name: string;
|
|
132
|
+
recognizer: BlinkIDSDK.Recognizer & {
|
|
133
|
+
objectHandle: number;
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
export declare enum RecognitionStatus {
|
|
137
|
+
NoImageFileFound = "NoImageFileFound",
|
|
138
|
+
NoFirstImageFileFound = "NoFirstImageFileFound",
|
|
139
|
+
NoSecondImageFileFound = "NoSecondImageFileFound",
|
|
140
|
+
Preparing = "Preparing",
|
|
141
|
+
Ready = "Ready",
|
|
142
|
+
Processing = "Processing",
|
|
143
|
+
DetectionFailed = "DetectionFailed",
|
|
144
|
+
WrongSide = "WrongSide",
|
|
145
|
+
FacePhotoCovered = "FacePhotoCovered",
|
|
146
|
+
EmptyResultState = "EmptyResultState",
|
|
147
|
+
OnFirstSideResult = "OnFirstSideResult",
|
|
148
|
+
ScanSuccessful = "ScanSuccessful",
|
|
149
|
+
DocumentClassified = "DocumentClassified",
|
|
150
|
+
DetectionStatusChange = "DetectionStatusChange",
|
|
151
|
+
NoSupportForMediaDevices = "NoSupportForMediaDevices",
|
|
152
|
+
CameraNotFound = "CameraNotFound",
|
|
153
|
+
CameraNotAllowed = "CameraNotAllowed",
|
|
154
|
+
UnableToAccessCamera = "UnableToAccessCamera",
|
|
155
|
+
CameraInUse = "CameraInUse",
|
|
156
|
+
CameraGenericError = "CameraGenericError",
|
|
157
|
+
BlurDetected = "BlurDetected",
|
|
158
|
+
GlareDetected = "GlareDetected",
|
|
159
|
+
MovePassportLeft = "MovePassportLeft",
|
|
160
|
+
MovePassportRight = "MovePassportRight",
|
|
161
|
+
MovePassportUp = "MovePassportUp",
|
|
162
|
+
MovePassportDown = "MovePassportDown",
|
|
163
|
+
MovePassportDownError = "MovePassportDownError",
|
|
164
|
+
MovePassportUpError = "MovePassportUpError",
|
|
165
|
+
MovePassportRightError = "MovePassportRightError",
|
|
166
|
+
MovePassportLeftError = "MovePassportLeftError",
|
|
167
|
+
ScanPassportLeft = "ScanPassportLeft",
|
|
168
|
+
ScanPassportRight = "ScanPassportRight",
|
|
169
|
+
ScanPassportUp = "ScanPassportUp",
|
|
170
|
+
ScanPassportDown = "ScanPassportDown",
|
|
171
|
+
UnknownError = "UnknownError",
|
|
172
|
+
BarcodeScanningStarted = "BarcodeScanningStarted",
|
|
173
|
+
DetectionStatusFail = "Fail",
|
|
174
|
+
DetectionStatusSuccess = "Success",
|
|
175
|
+
DetectionStatusCameraTooHigh = "CameraTooHigh",
|
|
176
|
+
DetectionStatusFallbackSuccess = "FallbackSuccess",
|
|
177
|
+
DetectionStatusPartial = "Partial",
|
|
178
|
+
DetectionStatusCameraAtAngle = "CameraAtAngle",
|
|
179
|
+
DetectionStatusCameraTooNear = "CameraTooNear",
|
|
180
|
+
DetectionStatusDocumentTooCloseToEdge = "DocumentTooCloseToEdge"
|
|
181
|
+
}
|
|
182
|
+
export interface RecognitionEvent {
|
|
183
|
+
status: RecognitionStatus;
|
|
184
|
+
data?: any;
|
|
185
|
+
}
|
|
186
|
+
export interface RecognitionResults {
|
|
187
|
+
recognizer: BlinkIDSDK.RecognizerResult;
|
|
188
|
+
recognizerName: string;
|
|
189
|
+
resultSignedJSON?: BlinkIDSDK.SignedPayload;
|
|
190
|
+
}
|
|
191
|
+
export declare enum CameraExperience {
|
|
192
|
+
Barcode = "BARCODE",
|
|
193
|
+
CardMultiSide = "CARD_MULTI_SIDE",
|
|
194
|
+
CardSingleSide = "CARD_SINGLE_SIDE",
|
|
195
|
+
PaymentCard = "PAYMENT_CARD",
|
|
196
|
+
Passport = "PASSPORT"
|
|
197
|
+
}
|
|
198
|
+
export declare enum CameraExperienceState {
|
|
199
|
+
BarcodeScanning = "BarcodeScanning",
|
|
200
|
+
AdjustAngle = "AdjustAngle",
|
|
201
|
+
Classification = "Classification",
|
|
202
|
+
Default = "Default",
|
|
203
|
+
Detection = "Detection",
|
|
204
|
+
Done = "Done",
|
|
205
|
+
DoneAll = "DoneAll",
|
|
206
|
+
Flip = "Flip",
|
|
207
|
+
WrongSide = "WrongSide",
|
|
208
|
+
MoveCloser = "MoveCloser",
|
|
209
|
+
MoveFarther = "MoveFarther",
|
|
210
|
+
BlurDetected = "BlurDetected",
|
|
211
|
+
GlareDetected = "GlareDetected",
|
|
212
|
+
FacePhotoCovered = "FacePhotoCovered",
|
|
213
|
+
MovePassportLeft = "MovePassportLeft",
|
|
214
|
+
MovePassportRight = "MovePassportRight",
|
|
215
|
+
MovePassportUp = "MovePassportUp",
|
|
216
|
+
MovePassportDown = "MovePassportDown",
|
|
217
|
+
ScanPassportLeft = "ScanPassportLeft",
|
|
218
|
+
ScanPassportRight = "ScanPassportRight",
|
|
219
|
+
ScanPassportUp = "ScanPassportUp",
|
|
220
|
+
ScanPassportDown = "ScanPassportDown",
|
|
221
|
+
MovePassportDownError = "MovePassportDownError",
|
|
222
|
+
MovePassportUpError = "MovePassportUpError",
|
|
223
|
+
MovePassportRightError = "MovePassportRightError",
|
|
224
|
+
MovePassportLeftError = "MovePassportLeftError"
|
|
225
|
+
}
|
|
226
|
+
export type CameraExperienceStateKey = keyof typeof CameraExperienceState;
|
|
227
|
+
export type CameraExperienceStateKeyLowercase = Uncapitalize<CameraExperienceStateKey>;
|
|
228
|
+
export interface CameraExperienceStateDurations {
|
|
229
|
+
barcodeScanning: number;
|
|
230
|
+
adjustAngle: number;
|
|
231
|
+
default: number;
|
|
232
|
+
done: number;
|
|
233
|
+
doneAll: number;
|
|
234
|
+
flip: number;
|
|
235
|
+
wrongSide: number;
|
|
236
|
+
moveCloser: number;
|
|
237
|
+
moveFarther: number;
|
|
238
|
+
}
|
|
239
|
+
export declare const CameraExperienceStateDuration: Map<CameraExperienceState, number>;
|
|
240
|
+
/**
|
|
241
|
+
* User feedback structures
|
|
242
|
+
*/
|
|
243
|
+
export declare enum FeedbackCode {
|
|
244
|
+
CameraDisabled = "CAMERA_DISABLED",
|
|
245
|
+
CameraGenericError = "CAMERA_GENERIC_ERROR",
|
|
246
|
+
CameraInUse = "CAMERA_IN_USE",
|
|
247
|
+
CameraNotAllowed = "CAMERA_NOT_ALLOWED",
|
|
248
|
+
GenericScanError = "GENERIC_SCAN_ERROR",
|
|
249
|
+
ScanStarted = "SCAN_STARTED",
|
|
250
|
+
ScanUnsuccessful = "SCAN_UNSUCCESSFUL",
|
|
251
|
+
ScanSuccessful = "SCAN_SUCCESSFUL"
|
|
252
|
+
}
|
|
253
|
+
export interface FeedbackMessage {
|
|
254
|
+
code?: FeedbackCode;
|
|
255
|
+
state: "FEEDBACK_ERROR" | "FEEDBACK_INFO" | "FEEDBACK_OK";
|
|
256
|
+
message: string;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Camera selection
|
|
260
|
+
*/
|
|
261
|
+
export interface CameraEntry {
|
|
262
|
+
prettyName: string;
|
|
263
|
+
details: BlinkIDSDK.SelectedCamera | null;
|
|
264
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export declare function hasVideoDevices(): Promise<boolean>;
|
|
2
|
+
export declare function isWasmSupported(): Promise<boolean>;
|
|
3
|
+
export declare function checkMandatoryCapabilites(): Promise<boolean>;
|
|
4
|
+
/**
|
|
5
|
+
* Determine whether this is a desktop device based on the screen resolution.
|
|
6
|
+
*/
|
|
7
|
+
export declare function isDesktop(): boolean;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structures of Error Codes, Error Messages, and CustomError compatible objects for the Error Generator utility.
|
|
3
|
+
* Error Code convention: SECTION_OBJECT_(ACTION)_PROBLEM
|
|
4
|
+
*/
|
|
5
|
+
export declare enum ErrorCodes {
|
|
6
|
+
BrowserNotSupported = "BROWSER_NOT_SUPPORTED",
|
|
7
|
+
LicenseError = "LICENSE_ERROR",
|
|
8
|
+
SdkLoadFailed = "SDK_LOAD_FAILED",
|
|
9
|
+
InternetNotAvailable = "INTERNET_NOT_AVAILABLE",
|
|
10
|
+
InvalidRecognizers = "INVALID_RECOGNIZERS",
|
|
11
|
+
InvalidPingProxyUrl = "INVALID_PING_PROXY_URL",
|
|
12
|
+
PingProxyPermissionNotGranted = "PING_PROXY_PERMISSION_NOT_GRANTED"
|
|
13
|
+
}
|
|
14
|
+
export declare enum ErrorMessages {
|
|
15
|
+
BrowserNotSupported = "Browser is not supported!",
|
|
16
|
+
LicenseError = "Something is wrong with the license.",
|
|
17
|
+
SdkLoadFailed = "Failed to load SDK!",
|
|
18
|
+
InvalidPingProxyUrl = "Provided ping proxy URL is not a valid secure URL in format 'https://{host}:{port?}'.",
|
|
19
|
+
PingProxyPermissionNotGranted = "Allow ping proxy permission not found in license."
|
|
20
|
+
}
|
|
21
|
+
export declare const componentErrors: {
|
|
22
|
+
browserNotSupported: {
|
|
23
|
+
code: ErrorCodes;
|
|
24
|
+
message: ErrorMessages;
|
|
25
|
+
};
|
|
26
|
+
licenseError: {
|
|
27
|
+
code: ErrorCodes;
|
|
28
|
+
message: ErrorMessages;
|
|
29
|
+
};
|
|
30
|
+
sdkLoadFailed: {
|
|
31
|
+
code: ErrorCodes;
|
|
32
|
+
message: ErrorMessages;
|
|
33
|
+
};
|
|
34
|
+
pingProxyErrors: {
|
|
35
|
+
invalidProxyUrl: {
|
|
36
|
+
message: ErrorMessages;
|
|
37
|
+
code: ErrorCodes;
|
|
38
|
+
};
|
|
39
|
+
permissionNotGranted: {
|
|
40
|
+
message: ErrorMessages;
|
|
41
|
+
code: ErrorCodes;
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare function stringToArray(inputString: string): Array<string>;
|
|
2
|
+
export declare function stringToObject(inputString: string): {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
};
|
|
5
|
+
export declare function hasSupportedImageFiles(files: FileList): boolean;
|
|
6
|
+
export declare function extractFilenameFromPath(path: string): string;
|
|
7
|
+
export declare function getImageFile(fileList: FileList): File | null;
|
|
8
|
+
/**
|
|
9
|
+
* Inspired by https://github.com/JedWatson/classnames.
|
|
10
|
+
* @param classes Class names and their conditions.
|
|
11
|
+
* @returns Joined string of class names.
|
|
12
|
+
*/
|
|
13
|
+
export declare function classNames(classes: Record<string, boolean>): string;
|
|
14
|
+
/**
|
|
15
|
+
* @param root shadowroot to apply the query from
|
|
16
|
+
* @returns array of part selectors
|
|
17
|
+
*/
|
|
18
|
+
export declare function getWebComponentParts(root: ShadowRoot): string[];
|
|
19
|
+
export declare function getWebComponentExportedParts(root: ShadowRoot): string[];
|
|
20
|
+
export declare function setWebComponentParts(hostEl: Element): void;
|
|
21
|
+
export declare function uuidv4(): string;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as BlinkIDSDK from "@microblink/blinkid-in-browser-sdk";
|
|
2
|
+
import { CameraEntry, CameraExperience, EventReady, VideoRecognitionConfiguration, ImageRecognitionConfiguration, MultiSideImageRecognitionConfiguration, ImageRecognitionType, RecognitionEvent, SdkSettings, SDKError } from "./data-structures";
|
|
3
|
+
export interface CheckConclusion {
|
|
4
|
+
status: boolean;
|
|
5
|
+
message?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Get the additional processing information from the BlinkIdResult.
|
|
9
|
+
* @param result
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
export declare function getAdditionalProcessingInfo(result: BlinkIDSDK.BlinkIDResult): BlinkIDSDK.AdditionalProcessingInfo;
|
|
13
|
+
export declare function getImageAnalysisResult(result: BlinkIDSDK.BlinkIDResult): BlinkIDSDK.ImageAnalysisResult;
|
|
14
|
+
export declare const isFirstSideDone: (result: BlinkIDSDK.BlinkIDResult) => boolean;
|
|
15
|
+
export declare function getCameraDevices(): Promise<Array<CameraEntry>>;
|
|
16
|
+
export declare class SdkService {
|
|
17
|
+
private sdk;
|
|
18
|
+
private eventEmitter$;
|
|
19
|
+
private cancelInitiatedFromOutside;
|
|
20
|
+
private recognizerName;
|
|
21
|
+
videoRecognizer: BlinkIDSDK.VideoRecognizer;
|
|
22
|
+
showOverlay: boolean;
|
|
23
|
+
private lastKnownCardRotation;
|
|
24
|
+
private lastDetectionStatus;
|
|
25
|
+
constructor();
|
|
26
|
+
delete(): void;
|
|
27
|
+
initialize(licenseKey: string, sdkSettings: SdkSettings): Promise<EventReady | SDKError>;
|
|
28
|
+
checkRecognizers(recognizers: Array<string>): CheckConclusion;
|
|
29
|
+
getDesiredCameraExperience(_recognizers?: Array<string>, _recognizerOptions?: any): CameraExperience;
|
|
30
|
+
scanFromCamera(configuration: VideoRecognitionConfiguration, eventCallback: (ev: RecognitionEvent) => void): Promise<void>;
|
|
31
|
+
cropDocumentFromImage(imageBase64: string, factors: {
|
|
32
|
+
upFactor: number;
|
|
33
|
+
downFactor: number;
|
|
34
|
+
leftFactor: number;
|
|
35
|
+
rightFactor: number;
|
|
36
|
+
}): Promise<string>;
|
|
37
|
+
base64ArrayBuffer(arrayBuffer: any): string;
|
|
38
|
+
flipCamera(): Promise<void>;
|
|
39
|
+
isCameraFlipped(): boolean;
|
|
40
|
+
isScanFromImageAvailable(_recognizers?: Array<string>, _recognizerOptions?: any): boolean;
|
|
41
|
+
getScanFromImageType(_recognizers?: Array<string>, _recognizerOptions?: any): ImageRecognitionType;
|
|
42
|
+
scanFromImage(configuration: ImageRecognitionConfiguration, eventCallback: (ev: RecognitionEvent) => void): Promise<void>;
|
|
43
|
+
scanFromImageMultiSide(configuration: MultiSideImageRecognitionConfiguration, eventCallback: (ev: RecognitionEvent) => void): Promise<void>;
|
|
44
|
+
stopRecognition(): Promise<void>;
|
|
45
|
+
resumeRecognition(): Promise<void>;
|
|
46
|
+
changeCameraDevice(camera: BlinkIDSDK.SelectedCamera): Promise<boolean>;
|
|
47
|
+
getProductIntegrationInfo(): Promise<BlinkIDSDK.ProductIntegrationInfo>;
|
|
48
|
+
private isRecognizerAvailable;
|
|
49
|
+
private createRecognizers;
|
|
50
|
+
private createRecognizerRunner;
|
|
51
|
+
private cancelRecognition;
|
|
52
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare enum StatusDocumentDetector {
|
|
2
|
+
RECORDING = "RECORDING",
|
|
3
|
+
ERROR = "ERROR",
|
|
4
|
+
RUNNING = "RUNNING",
|
|
5
|
+
INITIALIZING = "INITIALIZING",
|
|
6
|
+
FRONT_SIDE_DETECTION = "FRONT_SIDE_DETECTION",
|
|
7
|
+
BACK_SIDE_DETECTION = "BACK_SIDE_DETECTION",
|
|
8
|
+
DOCUMENT_NOT_FOUND = "DOCUMENT_NOT_FOUND",
|
|
9
|
+
DOCUMENT_DETECTED = "DOCUMENT_DETECTED",
|
|
10
|
+
CHANGE_SIDE = "CHANGE_SIDE",
|
|
11
|
+
RESULTS_SUCCESS = "RESULTS_SUCCESS",
|
|
12
|
+
RESULTS_EMPTY = "RESULTS_EMPTY",
|
|
13
|
+
DETECTION_FAILED = "DETECTION_FAILED"
|
|
14
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
export declare const defaultTranslations: {
|
|
2
|
+
readonly "help-button-lobby-tooltip": "¿Necesitas ayuda?";
|
|
3
|
+
readonly "help-button-back": "Atrás";
|
|
4
|
+
readonly "help-button-next": "Siguiente";
|
|
5
|
+
readonly "help-button-done": "Listo";
|
|
6
|
+
readonly "help-button-start-scanning": "Comenzar escaneo";
|
|
7
|
+
readonly "help-doc-valid-title": "Mantén todos los detalles visibles";
|
|
8
|
+
readonly "help-doc-valid-description": "Asegúrate de mantener el documento bien iluminado. Todos los campos del documento deben ser visibles en la pantalla de la cámara.";
|
|
9
|
+
readonly "help-doc-invalid-invisible-fields-title": "Mantén todos los detalles visibles";
|
|
10
|
+
readonly "help-doc-invalid-invisible-fields-description": "Asegúrate de no cubrir partes del documento con el dedo, incluyendo las líneas inferiores. También, ten cuidado con los reflejos del holograma que pueden cubrir los campos del documento.";
|
|
11
|
+
readonly "help-doc-invalid-harsh-light-title": "Cuidado con la luz intensa";
|
|
12
|
+
readonly "help-doc-invalid-harsh-light-description": "Evita la luz directa intensa porque se refleja en el documento y puede hacer que partes sean ilegibles. Si no puedes leer los datos en el documento, tampoco serán visibles para la cámara.";
|
|
13
|
+
readonly "help-doc-invalid-to-much-motion-title": "Mantén quieto mientras escaneas";
|
|
14
|
+
readonly "help-doc-invalid-to-much-motion-description": "Intenta mantener el teléfono y el documento quietos mientras escaneas. Mover cualquiera de los dos puede desenfocar la imagen y hacer que los datos del documento sean ilegibles.";
|
|
15
|
+
readonly "action-alt-camera": "Cámara del dispositivo";
|
|
16
|
+
readonly "action-alt-gallery": "Desde galería";
|
|
17
|
+
readonly "action-message": "Escanear o elegir de la galería";
|
|
18
|
+
readonly "action-message-camera": "Cámara del dispositivo";
|
|
19
|
+
readonly "action-message-camera-disabled": "Cámara deshabilitada";
|
|
20
|
+
readonly "action-message-camera-not-allowed": "Cámara no permitida";
|
|
21
|
+
readonly "action-message-camera-in-use": "Cámara en uso";
|
|
22
|
+
readonly "action-message-image": "Desde galería";
|
|
23
|
+
readonly "action-message-image-not-supported": "No soportado";
|
|
24
|
+
readonly "camera-disabled": "Cámara deshabilitada";
|
|
25
|
+
readonly "camera-not-allowed": "No se puede acceder a la cámara.";
|
|
26
|
+
readonly "camera-in-use": "La cámara ya está siendo utilizada por otra aplicación.";
|
|
27
|
+
readonly "camera-generic-error": "No se puede acceder a la cámara.";
|
|
28
|
+
readonly "camera-feedback-scan-front": readonly ["Escanea el frente", "del documento"];
|
|
29
|
+
readonly "camera-feedback-scan-back": readonly ["Escanea el reverso", "del documento"];
|
|
30
|
+
readonly "camera-feedback-flip": "Voltea al reverso";
|
|
31
|
+
readonly "camera-feedback-barcode-message": "Escanea el código de barras";
|
|
32
|
+
readonly "camera-feedback-move-farther": "Aléjate";
|
|
33
|
+
readonly "camera-feedback-move-closer": "Acércate";
|
|
34
|
+
readonly "camera-feedback-adjust-angle": "Ajusta el ángulo";
|
|
35
|
+
readonly "camera-feedback-blur": "Mantén quieto";
|
|
36
|
+
readonly "camera-feedback-glare": "Inclina o mueve el documento para eliminar reflejos";
|
|
37
|
+
readonly "camera-feedback-wrong-side": "Voltea el documento";
|
|
38
|
+
readonly "camera-feedback-face-photo-covered": "Mantén la foto del rostro completamente visible";
|
|
39
|
+
readonly "camera-feedback-barcode": readonly ["Escanea el código de barras"];
|
|
40
|
+
readonly "camera-feedback-move-top-page": "Mueve a la página superior";
|
|
41
|
+
readonly "camera-feedback-move-bottom-page": "Mueve a la página inferior";
|
|
42
|
+
readonly "camera-feedback-move-left-page": "Mueve a la página izquierda";
|
|
43
|
+
readonly "camera-feedback-move-right-page": "Mueve a la página derecha";
|
|
44
|
+
readonly "camera-feedback-scan-top-page": "Escanea la página superior";
|
|
45
|
+
readonly "camera-feedback-scan-bottom-page": "Escanea la página inferior";
|
|
46
|
+
readonly "camera-feedback-scan-left-page": "Escanea la página izquierda";
|
|
47
|
+
readonly "camera-feedback-scan-right-page": "Escanea la página derecha";
|
|
48
|
+
readonly "drop-info": "Suelta la imagen aquí";
|
|
49
|
+
readonly "drop-error": "Ups, no soportamos ese formato de imagen. Por favor sube un archivo JPEG o PNG.";
|
|
50
|
+
readonly "initialization-error": "Error al cargar el componente. Intenta usar otro dispositivo o actualiza tu navegador.";
|
|
51
|
+
readonly "process-image-box-first": "Imagen del frente";
|
|
52
|
+
readonly "process-image-box-second": "Imagen del reverso";
|
|
53
|
+
readonly "process-image-box-add": "Agregar imagen";
|
|
54
|
+
readonly "process-image-upload-cta": "Subir";
|
|
55
|
+
readonly "process-image-message": "Un momento.";
|
|
56
|
+
readonly "process-image-message-inline": "Procesando";
|
|
57
|
+
readonly "process-image-message-inline-done": "Procesamiento completado";
|
|
58
|
+
readonly "process-api-message": "Un momento";
|
|
59
|
+
readonly "process-api-retry": "Reintentar";
|
|
60
|
+
readonly "feedback-scan-unsuccessful-title": "Escaneo fallido";
|
|
61
|
+
readonly "feedback-scan-unsuccessful": "No pudimos reconocer tu documento. Por favor intenta de nuevo.";
|
|
62
|
+
readonly "feedback-error-generic": "Ups, eso no funcionó. Por favor inténtalo de nuevo.";
|
|
63
|
+
readonly "check-internet-connection": "Verífica la conexión a internet.";
|
|
64
|
+
readonly "network-error": "Error de red.";
|
|
65
|
+
readonly "scanning-not-available": "Escaneo no disponible.";
|
|
66
|
+
readonly "modal-window-close": "Cerrar";
|
|
67
|
+
};
|
|
68
|
+
export type Translations = typeof defaultTranslations;
|
|
69
|
+
export type TranslationKey = keyof Translations;
|
|
70
|
+
export type TranslationValue = string | string[];
|
|
71
|
+
export type GenericTranslations = Record<TranslationKey, TranslationValue>;
|
|
72
|
+
export declare class TranslationService {
|
|
73
|
+
translations: GenericTranslations;
|
|
74
|
+
constructor(alternativeTranslations?: Partial<GenericTranslations>);
|
|
75
|
+
i(key: TranslationKey): TranslationValue;
|
|
76
|
+
private isExpectedValue;
|
|
77
|
+
}
|
package/loader/cdn.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from '../dist/types/components';
|
|
2
|
+
export interface CustomElementsDefineOptions {
|
|
3
|
+
exclude?: string[];
|
|
4
|
+
resourcesUrl?: string;
|
|
5
|
+
syncQueue?: boolean;
|
|
6
|
+
jmp?: (c: Function) => any;
|
|
7
|
+
raf?: (c: FrameRequestCallback) => number;
|
|
8
|
+
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
9
|
+
rel?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
10
|
+
}
|
|
11
|
+
export declare function defineCustomElements(win?: Window, opts?: CustomElementsDefineOptions): Promise<void>;
|
|
12
|
+
export declare function applyPolyfills(): Promise<void>;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Used to specify a nonce value that corresponds with an application's CSP.
|
|
16
|
+
* When set, the nonce will be added to all dynamically created script and style tags at runtime.
|
|
17
|
+
* Alternatively, the nonce value can be set on a meta tag in the DOM head
|
|
18
|
+
* (<meta name="csp-nonce" content="{ nonce value here }" />) which
|
|
19
|
+
* will result in the same behavior.
|
|
20
|
+
*/
|
|
21
|
+
export declare function setNonce(nonce: string): void;
|
package/loader/index.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
|
|
2
|
+
(function(){if("undefined"!==typeof window&&void 0!==window.Reflect&&void 0!==window.customElements){var a=HTMLElement;window.HTMLElement=function(){return Reflect.construct(a,[],this.constructor)};HTMLElement.prototype=a.prototype;HTMLElement.prototype.constructor=HTMLElement;Object.setPrototypeOf(HTMLElement,a)}})();
|
|
3
|
+
export * from '../dist/esm/polyfills/index.js';
|
|
4
|
+
export * from '../dist/esm/loader.js';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "stamps-loader",
|
|
3
|
+
"private": true,
|
|
4
|
+
"typings": "./index.d.ts",
|
|
5
|
+
"module": "./index.js",
|
|
6
|
+
"main": "./index.cjs.js",
|
|
7
|
+
"jsnext:main": "./index.es2017.js",
|
|
8
|
+
"es2015": "./index.es2017.js",
|
|
9
|
+
"es2017": "./index.es2017.js",
|
|
10
|
+
"unpkg": "./cdn.js"
|
|
11
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@jaak.ai/stamps",
|
|
3
|
+
"version": "1.0.0-beta.1",
|
|
4
|
+
"description": "Jaak Document Identifier",
|
|
5
|
+
"main": "dist/index.cjs.js",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"collection": "dist/collection/collection-manifest.json",
|
|
8
|
+
"types": "dist/types/index.d.ts",
|
|
9
|
+
"collection:main": "dist/collection/index.js",
|
|
10
|
+
"unpkg": "dist/stamps/stamps.esm.js",
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"private": false,
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"import": "./dist/document-detector/document-detector.esm.js",
|
|
19
|
+
"require": "./dist/document-detector/document-detector.cjs.js"
|
|
20
|
+
},
|
|
21
|
+
"./loader": {
|
|
22
|
+
"import": "./loader/index.js",
|
|
23
|
+
"require": "./loader/index.cjs",
|
|
24
|
+
"types": "./loader/index.d.ts"
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/jaak-ai/jaak-stamps-webcomponent.git"
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"loader"
|
|
34
|
+
],
|
|
35
|
+
"scripts": {
|
|
36
|
+
"build": "stencil build --docs --config=stencil.config.ts",
|
|
37
|
+
"check-types": "tsc --p ./tsconfig.json --noEmit",
|
|
38
|
+
"clean": "rimraf demo dist docs loader resources",
|
|
39
|
+
"prepare-assets": "cp -r ../resources/ resources",
|
|
40
|
+
"generate": "stencil generate",
|
|
41
|
+
"start": "stencil build --dev --watch --serve --config=stencil.config.ts",
|
|
42
|
+
"test": "stencil test --spec --e2e",
|
|
43
|
+
"test.watch": "stencil test --spec --e2e --watchAll"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@stencil/core": "2.22.3",
|
|
47
|
+
"@stencil/postcss": "2.1.0",
|
|
48
|
+
"@stencil/sass": "1.5.2",
|
|
49
|
+
"autoprefixer": "^10.2.5",
|
|
50
|
+
"rimraf": "^3.0.2",
|
|
51
|
+
"typescript": "5.4.4"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@microblink/blinkid-in-browser-sdk": "^6.10.0",
|
|
55
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
56
|
+
"@semantic-release/commit-analyzer": "^13.0.1",
|
|
57
|
+
"@semantic-release/git": "^10.0.1",
|
|
58
|
+
"@semantic-release/github": "^11.0.3",
|
|
59
|
+
"@semantic-release/npm": "^12.0.1",
|
|
60
|
+
"@semantic-release/release-notes-generator": "^14.0.3",
|
|
61
|
+
"semantic-release": "^24.2.5"
|
|
62
|
+
}
|
|
63
|
+
}
|