@idscan/idvc2 2.15.0 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/README.md +12 -0
  2. package/dist/idvc.js +1 -1
  3. package/dist/idvc.js.LICENSE.txt +6 -0
  4. package/dist/idvc.js.gzip +0 -0
  5. package/dist/index.html +8 -36
  6. package/dist/js/defaultConfig.ts +12 -2
  7. package/dist/js/environment/cssVariables.json +21 -0
  8. package/dist/js/environment/documentTypes.ts +1 -1
  9. package/dist/js/environment/langs.js +1 -1
  10. package/dist/langs.js.gzip +0 -0
  11. package/dist/networks/Blur-chunk.js +1 -1
  12. package/dist/networks/Face-chunk.js +1 -1
  13. package/dist/networks/GeneralTypeDetectionYolo-chunk.js +1 -1
  14. package/dist/networks/ZXing-chunk.js +1 -1
  15. package/dist/networks/blurWorker.js.gzip +0 -0
  16. package/dist/networks/mrzWorker.js.gzip +0 -0
  17. package/dist/networks/pdfWorker.js.gzip +0 -0
  18. package/dist/types/defaultConfig.d.ts +5 -4
  19. package/dist/types/environment/documentTypes.d.ts +1 -1
  20. package/dist/types/environment/langs.d.ts +3 -1
  21. package/dist/types/eventListeners/selectDocumentType/selectHandler.d.ts +1 -1
  22. package/dist/types/helpers/validators.d.ts +10 -1
  23. package/dist/types/modules/App/UI.d.ts +1 -1
  24. package/dist/types/modules/Config.d.ts +8 -2
  25. package/dist/types/modules/Loader/Loader.d.ts +1 -1
  26. package/dist/types/modules/ui/CardStep/Card.d.ts +3 -5
  27. package/dist/types/modules/ui/CardStep/card-template.d.ts +5 -0
  28. package/dist/types/modules/ui/{Component.d.ts → ComponentLit.d.ts} +9 -11
  29. package/dist/types/modules/ui/ControlButton/ControlButton.d.ts +7 -9
  30. package/dist/types/modules/ui/ControlButton/control-button-template.d.ts +4 -0
  31. package/dist/types/modules/ui/ControlButton/controlButtonTemplate.d.ts +1 -0
  32. package/dist/types/modules/ui/DesktopNotification/DesktopNotification.d.ts +4 -6
  33. package/dist/types/modules/ui/DesktopNotification/desktop-notification-template.d.ts +2 -0
  34. package/dist/types/modules/ui/IDVCVersionPlank/IDVCVersionPlank.d.ts +4 -6
  35. package/dist/types/modules/ui/IDVCVersionPlank/idvc-version-plank-template.d.ts +2 -0
  36. package/dist/types/modules/ui/InitScreeen/InitScreen.d.ts +20 -0
  37. package/dist/types/modules/ui/InitScreeen/init-screen-template.d.ts +4 -0
  38. package/dist/types/modules/ui/Loader/LoaderUI.d.ts +10 -0
  39. package/dist/types/modules/ui/Loader/loader-template.d.ts +2 -0
  40. package/dist/types/modules/ui/MainScreen/MainScreen.d.ts +3 -3
  41. package/dist/types/modules/ui/MessageBox/MessageBox.d.ts +5 -12
  42. package/dist/types/modules/ui/MessageBox/message-box-template.d.ts +2 -0
  43. package/dist/types/modules/ui/ModeSwitch/ModeSwitch.d.ts +7 -8
  44. package/dist/types/modules/ui/ModeSwitch/mode-switch-template.d.ts +4 -0
  45. package/dist/types/modules/ui/Notification/Notification.d.ts +5 -6
  46. package/dist/types/modules/ui/Notification/notification-template.d.ts +2 -0
  47. package/dist/types/modules/ui/StatusPlank/StatusPlank.d.ts +5 -6
  48. package/dist/types/modules/ui/StatusPlank/status-plank-template.d.ts +2 -0
  49. package/dist/types/modules/ui/StepsList/StepsScreen.d.ts +2 -2
  50. package/dist/types/modules/ui/Uploader/UploaderUI.d.ts +10 -16
  51. package/dist/types/modules/ui/Uploader/uploader-template.d.ts +9 -0
  52. package/dist/types/modules/ui/VideoWrapper/StepPreview/StepPreview.d.ts +3 -3
  53. package/dist/types/modules/ui/VideoWrapper/StepPreview/step-preview-template.d.ts +2 -0
  54. package/dist/types/modules/ui/{selectDocumentType/documentSelectedEvent.d.ts → documentSelectedEvent.d.ts} +1 -1
  55. package/dist/types/modules/validation/ValidateDictionaryLangMatch.d.ts +6 -0
  56. package/dist/types/modules/validation/ValidateDocumentTypes.d.ts +8 -6
  57. package/dist/types/modules/validation/showValidationError.d.ts +6 -1
  58. package/dist/types/modules/validation/validatorFactory.d.ts +2 -1
  59. package/dist/types/neural models/generalTypeDetectionYoloModel.d.ts +1 -0
  60. package/dist/types/types/context.d.ts +3 -0
  61. package/dist/types/types/helpers/DeepPartial.d.ts +6 -0
  62. package/package.json +2 -4
  63. package/dist/types/modules/ui/DocumentsList/InitScreen.d.ts +0 -21
  64. package/dist/types/modules/ui/Spinner/LoaderUI.d.ts +0 -11
  65. /package/dist/types/modules/{blurModule.d.ts → BlurModule.d.ts} +0 -0
@@ -2,17 +2,19 @@ import { DefaultConfigName, DocumentType } from '../../defaultConfig';
2
2
  import { DocumentTypeName } from '../../environment/documentTypes';
3
3
  import { StepType } from '../../environment/stepsDescription';
4
4
  import { IDocumentTypeConfig, IValidator } from '../validator';
5
+ export interface IValidateDocumentTypes {
6
+ types: any[];
7
+ steps: any[];
8
+ commonStepTypes: Set<StepType>;
9
+ documentTypes: IDocumentTypeConfig;
10
+ }
5
11
  declare class ValidateDocumentTypes implements IValidator<DocumentType[]> {
6
12
  types: any[];
7
13
  steps: any[];
8
14
  commonStepTypes: Set<StepType>;
9
15
  documentTypes: IDocumentTypeConfig;
10
- validate(val: DocumentType[], fallback: DocumentType[], configName: DefaultConfigName): {
11
- types: any[];
12
- steps: any[];
13
- commonStepTypes: Set<StepType>;
14
- documentTypes: IDocumentTypeConfig;
15
- };
16
+ static checkIsDocumentTypes(obj: unknown): obj is IValidateDocumentTypes;
17
+ validate(val: DocumentType[], fallback: DocumentType[], configName: DefaultConfigName): IValidateDocumentTypes;
16
18
  validateTypes(types: string[]): DocumentTypeName[];
17
19
  transformDocType({ type, steps }: DocumentType): void;
18
20
  setCommonStepTypes(): void;
@@ -1,2 +1,7 @@
1
- declare const showError: (configName: string, fallback: any) => void;
1
+ interface IShowErrorProps {
2
+ configName: string;
3
+ fallback: any;
4
+ invalidPathsWithReason?: Record<string, string>;
5
+ }
6
+ declare const showError: ({ configName, fallback, invalidPathsWithReason }: IShowErrorProps) => void;
2
7
  export default showError;
@@ -1,10 +1,11 @@
1
1
  import { ValidationFn } from '../../defaultConfig';
2
2
  import ValidateElement from './ValidateElement';
3
3
  import ValidateBool from './ValidateBool';
4
+ import ValidateDictionaryLangMatch from './ValidateDictionaryLangMatch';
4
5
  import ValidateDistinctStringInArray from './ValidateStringInArray';
5
6
  import ValidateDocumentTypes from './ValidateDocumentTypes';
6
7
  import ValidateFunction from './ValidateFunction';
7
8
  import ValidateNumber from './ValidateNumber';
8
9
  import ValidateString from './ValidateString';
9
- declare const validatorFactory: (name: ValidationFn) => false | ValidateElement | ValidateBool | ValidateDistinctStringInArray | ValidateDocumentTypes | ValidateFunction | ValidateNumber | ValidateString;
10
+ declare const validatorFactory: (name: ValidationFn) => false | ValidateElement | ValidateBool | ValidateDistinctStringInArray | ValidateDocumentTypes | ValidateFunction | ValidateNumber | ValidateString | ValidateDictionaryLangMatch<Record<string, unknown>>;
10
11
  export default validatorFactory;
@@ -16,6 +16,7 @@ declare const modelConfig: {
16
16
  outputTensorName: string;
17
17
  predictLength: number;
18
18
  padding: number;
19
+ documentFramePadding: number;
19
20
  };
20
21
  export type InterpretYoloDetectionResult = {
21
22
  side: GeneralTypeExitYolo;
@@ -5,10 +5,12 @@ import MetaData from '../modules/MetaData';
5
5
  import { WebLibManualUploader } from '../modules/App/WebLibManualUploader';
6
6
  import LoggerController from '../controllers/LoggerController';
7
7
  import Step from '../modules/Step';
8
+ import { AllLabels } from '../environment/langs';
8
9
  import { StepType } from '../environment/stepsDescription';
9
10
  import { Base64Image, Offset, Size } from '../helpers/image';
10
11
  import { RealFaceTurnSide } from './enums/realFace';
11
12
  import { StepConfig, StepMode } from '../defaultConfig';
13
+ import { DeepPartial } from './helpers/DeepPartial';
12
14
  import { IMRZResults } from './mrz';
13
15
  type LoopFunction = () => Promise<false>;
14
16
  export type Context = {
@@ -29,6 +31,7 @@ export type Context = {
29
31
  config: Record<string, any>;
30
32
  networkUrl: string;
31
33
  imageFormat: 'webp' | 'jpeg';
34
+ customTranslations?: DeepPartial<AllLabels>;
32
35
  supabase: ReturnType<typeof InitClient> | null;
33
36
  cameraInfo: Record<string, any>;
34
37
  idvcLinkParam: string;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Makes all properties of T optional, recursively.
3
+ */
4
+ export type DeepPartial<T> = {
5
+ [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
6
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@idscan/idvc2",
3
- "version": "2.15.0",
3
+ "version": "3.1.0",
4
4
  "description": "component for the capturing documents",
5
5
  "main": "dist/idvc.js",
6
6
  "types": "dist/types/idvc.d.ts",
@@ -29,7 +29,6 @@
29
29
  "devDependencies": {
30
30
  "@swc/core": "1.3.59",
31
31
  "@types/animejs": "^3.1.12",
32
- "@types/dot": "^1.1.5",
33
32
  "@types/pako": "^2.0.3",
34
33
  "@typescript-eslint/eslint-plugin": "5.59.6",
35
34
  "@typescript-eslint/parser": "5.59.6",
@@ -45,7 +44,6 @@
45
44
  "eslint-plugin-jest": "27.2.1",
46
45
  "eslint-plugin-node": "11.1.0",
47
46
  "eslint-webpack-plugin": "4.0.0",
48
- "handlebars": "4.7.7",
49
47
  "html-loader": "4.1.0",
50
48
  "html-webpack-plugin": "5.5.1",
51
49
  "jest": "29.5.0",
@@ -72,7 +70,7 @@
72
70
  "core-js": "3.30.2",
73
71
  "crypto-browserify": "3.12.0",
74
72
  "detect-browser": "5.3.0",
75
- "dot": "^1.1.3",
73
+ "lit-html": "^3.2.1",
76
74
  "mobile-detect": "1.4.5",
77
75
  "onnxruntime-web": "1.17.0",
78
76
  "pako": "^2.1.0",
@@ -1,21 +0,0 @@
1
- import { Component } from '../Component';
2
- import { DocumentTypeIndex, DocumentTypeName, HumanName } from '../../../environment/documentTypes';
3
- import { DocumentSelectEvent } from '../selectDocumentType/documentSelectedEvent';
4
- type DocumentState = {
5
- name: DocumentTypeName;
6
- humanName: HumanName;
7
- id: 0 | DocumentTypeIndex;
8
- };
9
- export type InitScreenState = {
10
- documents: DocumentState[];
11
- isHidden: boolean;
12
- };
13
- export type InitScreenEvents = {
14
- onDocumentClick?: (res: DocumentSelectEvent) => void;
15
- };
16
- export declare class InitScreen extends Component<InitScreenState> {
17
- constructor(mountElement: any, state: InitScreenState, events?: InitScreenEvents);
18
- protected addEventListeners(): void;
19
- private addDocumentClickListener;
20
- }
21
- export {};
@@ -1,11 +0,0 @@
1
- import { Component } from '../Component';
2
- export type LoaderState = {
3
- loading: boolean;
4
- spinnerVisibility: boolean;
5
- bottomText?: string;
6
- topText?: string;
7
- };
8
- export declare class LoaderUI extends Component<LoaderState> {
9
- constructor(mountElement: any, state: LoaderState, events?: any);
10
- protected addEventListeners(): void;
11
- }