biometry-sdk 2.0.1 → 2.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.
- package/dist/index.d.ts +3 -4
- package/dist/react.js +1328 -0
- package/dist/react.js.map +1 -0
- package/dist/sdk.js +18 -17
- package/dist/sdk.js.map +1 -0
- package/dist/ui/biometry-enrollment.d.ts +1 -1
- package/dist/ui/index.d.ts +2 -4
- package/dist/ui/process-video.d.ts +1 -1
- package/dist/ui/react/BiometryEnrollment.d.ts +16 -0
- package/dist/ui/react/ProcessVideo.d.ts +25 -0
- package/dist/ui/react/index.d.ts +4 -0
- package/dist/ui.js +11 -14
- package/dist/ui.js.map +1 -0
- package/package.json +17 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"react.js","sources":["../src/ui/types.ts","../src/ui/biometry-enrollment.ts","../src/ui/react/BiometryEnrollment.tsx","../node_modules/fix-webm-duration/fix-webm-duration.js","../src/ui/process-video.ts","../src/ui/react/ProcessVideo.tsx"],"sourcesContent":["export enum BiometryAttributes {\n ApiKey = 'api-key',\n UserFullname = 'user-fullname',\n}\n\nexport enum BiometryEnrollmentState {\n Loading = 'loading',\n Success = 'success',\n ErrorNoFace = 'error-no-face',\n ErrorMultipleFaces = 'error-multiple-faces',\n ErrorNotCentered = 'error-not-centered',\n ErrorOther = 'error-other',\n}\n","import { BiometryAttributes, BiometryEnrollmentState } from \"./types.js\";\n\nexport class BiometryEnrollment extends HTMLElement {\n private readonly shadow: ShadowRoot;\n private videoElement: HTMLVideoElement | null = null;\n private canvasElement: HTMLCanvasElement | null = null;\n private captureButton: HTMLButtonElement | null = null;\n\n private resultCode?: number;\n private description?: string;\n\n constructor() {\n super();\n this.shadow = this.attachShadow({ mode: \"open\" });\n\n this.toggleState = this.toggleState.bind(this);\n this.capturePhoto = this.capturePhoto.bind(this);\n }\n\n static get observedAttributes(): string[] {\n return Object.values(BiometryAttributes);\n }\n\n get endpoint(): string | null {\n return this.getAttribute(\"endpoint\");\n }\n\n set endpoint(value: string | null) {\n const current = this.getAttribute(\"endpoint\");\n if (value !== null && value !== current) {\n this.setAttribute(\"endpoint\", value);\n } else if (value === null && current !== null) {\n this.removeAttribute(\"endpoint\");\n }\n }\n\n get userFullname(): string | null {\n return this.getAttribute(\"user-fullname\");\n }\n\n set userFullname(value: string | null) {\n if (value) {\n this.setAttribute(\"user-fullname\", value);\n } else {\n this.removeAttribute(\"user-fullname\");\n }\n }\n\n attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void {\n if (name === \"endpoint\" || name === \"user-fullname\") {\n if (name === \"endpoint\") {\n this.endpoint = newValue;\n } else if (name === \"user-fullname\") {\n this.userFullname = newValue;\n }\n this.validateAttributes();\n }\n }\n\n connectedCallback(): void {\n this.validateAttributes();\n this.init();\n }\n\n disconnectedCallback(): void {\n this.cleanup();\n if (this.captureButton) {\n this.captureButton.removeEventListener(\"click\", this.capturePhoto);\n }\n }\n\n validateAttributes(): void {\n if (!this.endpoint) {\n console.error(\"Endpoint is required.\");\n this.toggleState(BiometryEnrollmentState.ErrorOther);\n return;\n }\n\n if (!this.userFullname) {\n console.error(\"User fullname is required.\");\n this.toggleState(BiometryEnrollmentState.ErrorOther);\n return;\n }\n }\n\n init(): void {\n this.shadow.innerHTML = `\n <style>\n .wrapper {\n position: relative;\n }\n video {\n transform: scaleX(-1); /* Flip video for preview */\n max-width: 100%;\n border-radius: var(--border-radius, 8px);\n }\n canvas {\n display: none;\n }\n </style>\n <div class=\"wrapper\">\n <slot name=\"video\">\n <video id=\"video\" autoplay playsinline></video>\n </slot>\n <slot name=\"canvas\">\n <canvas id=\"canvas\" style=\"display: none;\"></canvas>\n </slot>\n <slot name=\"button\">\n <button id=\"button\">Capture Photo</button>\n </slot>\n <div class=\"status\">\n <slot name=\"loading\" class=\"loading\"></slot>\n <slot name=\"success\" class=\"success\"></slot>\n <slot name=\"error-no-face\" class=\"error-no-face\"></slot>\n <slot name=\"error-multiple-faces\" class=\"error-multiple-faces\"></slot>\n <slot name=\"error-not-centered\" class=\"error-not-centered\"></slot>\n <slot name=\"error-other\" class=\"error-other\"></slot>\n </div>\n </div>\n `;\n\n this.attachSlotListeners();\n this.setupCamera();\n this.toggleState(\"\");\n }\n\n public cleanup(): void {\n if (this.videoElement?.srcObject) {\n const tracks = (this.videoElement.srcObject as MediaStream).getTracks();\n tracks.forEach((track) => track.stop());\n }\n if (this.videoElement) {\n this.videoElement.srcObject = null;\n }\n }\n\n private attachSlotListeners(): void {\n const videoSlot = this.shadow.querySelector('slot[name=\"video\"]') as HTMLSlotElement;\n const canvasSlot = this.shadow.querySelector('slot[name=\"canvas\"]') as HTMLSlotElement;\n const buttonSlot = this.shadow.querySelector('slot[name=\"button\"]') as HTMLSlotElement;\n\n const assignedVideoElements = videoSlot.assignedElements();\n this.videoElement = (assignedVideoElements.length > 0 ? assignedVideoElements[0] : null) as HTMLVideoElement || this.shadow.querySelector(\"#video\") as HTMLVideoElement;\n\n const assignedCanvasElements = canvasSlot.assignedElements();\n this.canvasElement = (assignedCanvasElements.length > 0 ? assignedCanvasElements[0] : null) as HTMLCanvasElement || this.shadow.querySelector(\"#canvas\") as HTMLCanvasElement;\n\n const assignedButtonElements = buttonSlot.assignedElements();\n this.captureButton = (assignedButtonElements.length > 0 ? assignedButtonElements[0] : null) as HTMLButtonElement || this.shadow.querySelector(\"#button\") as HTMLButtonElement;\n\n if (!this.videoElement) {\n console.error(\"Video element is missing.\");\n return;\n }\n\n if (!this.captureButton) {\n console.error(\"Capture button is missing.\");\n return;\n } else {\n this.captureButton.addEventListener(\"click\", this.capturePhoto);\n }\n }\n\n private setupCamera(): void {\n if (!this.videoElement) {\n console.error(\"Video element is missing.\");\n return;\n }\n\n navigator.mediaDevices\n .getUserMedia({ video: true })\n .then((stream) => {\n this.videoElement!.srcObject = stream;\n })\n .catch((error) => {\n console.error(\"Error accessing camera:\", error);\n });\n }\n\n private async capturePhoto(): Promise<void> {\n try {\n if (!this.videoElement || !this.canvasElement) {\n console.error(\"Essential elements are not initialized.\");\n return;\n }\n\n const context = this.canvasElement.getContext(\"2d\");\n this.canvasElement.width = this.videoElement.videoWidth;\n this.canvasElement.height = this.videoElement.videoHeight;\n\n context!.drawImage(\n this.videoElement,\n 0,\n 0,\n this.canvasElement.width,\n this.canvasElement.height\n );\n\n this.toggleState(\"loading\");\n\n this.canvasElement.toBlob(async (blob) => {\n try {\n if (!blob) {\n console.error(\"Failed to capture photo.\");\n this.toggleState(BiometryEnrollmentState.ErrorOther);\n return;\n }\n\n const file = new File([blob], \"onboard-face.jpg\", { type: \"image/jpeg\" });\n const formData = new FormData();\n formData.append('photo', file);\n formData.append('userFullname', this.userFullname || '');\n\n const response = await fetch(this.endpoint!, {\n method: 'POST',\n body: formData\n });\n\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`);\n }\n\n const result = await response.json();\n this.resultCode = result?.code;\n this.description = result?.description || \"Unknown error occurred.\";\n\n switch (this.resultCode) {\n case 0:\n this.toggleState(BiometryEnrollmentState.Success);\n break;\n case 1:\n this.toggleState(BiometryEnrollmentState.ErrorNoFace);\n break;\n case 2:\n this.toggleState(BiometryEnrollmentState.ErrorMultipleFaces);\n break;\n case 3:\n this.toggleState(BiometryEnrollmentState.ErrorNotCentered);\n break;\n default:\n this.toggleState(BiometryEnrollmentState.ErrorOther);\n }\n\n console.log(\"Enrollment result:\", result);\n } catch (error) {\n console.error(\"Error in toBlob callback:\", error);\n this.toggleState(BiometryEnrollmentState.ErrorOther);\n }\n }, \"image/jpeg\");\n } catch (error) {\n console.error(\"Error capturing photo:\", error);\n this.toggleState(BiometryEnrollmentState.ErrorOther);\n }\n }\n\n private toggleState(state: BiometryEnrollmentState | string): void {\n const slots = [\n BiometryEnrollmentState.Loading,\n BiometryEnrollmentState.Success,\n BiometryEnrollmentState.ErrorNoFace,\n BiometryEnrollmentState.ErrorMultipleFaces,\n BiometryEnrollmentState.ErrorNotCentered,\n BiometryEnrollmentState.ErrorOther,\n ];\n\n slots.forEach((slotName) => {\n const slot = this.shadow.querySelector(`slot[name=\"${slotName}\"]`) as HTMLElement;\n if (slot) {\n slot.style.display = slotName === state ? \"block\" : \"none\";\n }\n });\n }\n}\n\ncustomElements.define(\"biometry-enrollment\", BiometryEnrollment);","import React, {\n useEffect,\n useRef,\n useImperativeHandle,\n forwardRef,\n} from \"react\";\n\nimport \"../biometry-enrollment\";\nimport { type BiometryEnrollment } from \"../biometry-enrollment\";\n\nexport interface BiometryEnrollmentProps extends React.HTMLAttributes<HTMLElement> {\n endpoint?: string;\n userFullname?: string;\n className?: string;\n style?: React.CSSProperties;\n children?: React.ReactNode;\n}\n\nexport interface BiometryEnrollmentRef {\n validateAttributes: () => void;\n init: () => void;\n cleanup: () => void;\n}\n\nconst BiometryEnrollmentWrapper = forwardRef<BiometryEnrollmentRef, BiometryEnrollmentProps>(\n ({ endpoint, userFullname, className, style, children, ...rest }, ref) => {\n const elementRef = useRef<HTMLElement & BiometryEnrollment>(null);\n\n useImperativeHandle(ref, () => ({\n validateAttributes: () => {\n elementRef.current?.validateAttributes();\n },\n init: () => {\n elementRef.current?.init();\n },\n cleanup: () => {\n elementRef.current?.cleanup();\n },\n }));\n\n useEffect(() => {\n if (elementRef.current) {\n if (endpoint !== undefined)\n elementRef.current.setAttribute(\"endpoint\", endpoint);\n if (userFullname !== undefined)\n elementRef.current.setAttribute(\"user-fullname\", userFullname);\n }\n }, [endpoint, userFullname]);\n\n return React.createElement(\n \"biometry-enrollment\",\n {\n ref: elementRef,\n className,\n style,\n ...rest,\n },\n children\n );\n }\n);\n\nBiometryEnrollmentWrapper.displayName = \"BiometryEnrollment\";\n\nexport default BiometryEnrollmentWrapper;\n","(function (name, definition) {\n if (typeof define === 'function' && define.amd) { // RequireJS / AMD\n define(definition);\n } else if (typeof module !== 'undefined' && module.exports) { // CommonJS / Node.js\n module.exports = definition();\n } else { // Direct include\n window.ysFixWebmDuration = definition();\n }\n})('fix-webm-duration', function () {\n /*\n * This is the list of possible WEBM file sections by their IDs.\n * Possible types: Container, Binary, Uint, Int, String, Float, Date\n */\n var sections = {\n 0xa45dfa3: { name: 'EBML', type: 'Container' },\n 0x286: { name: 'EBMLVersion', type: 'Uint' },\n 0x2f7: { name: 'EBMLReadVersion', type: 'Uint' },\n 0x2f2: { name: 'EBMLMaxIDLength', type: 'Uint' },\n 0x2f3: { name: 'EBMLMaxSizeLength', type: 'Uint' },\n 0x282: { name: 'DocType', type: 'String' },\n 0x287: { name: 'DocTypeVersion', type: 'Uint' },\n 0x285: { name: 'DocTypeReadVersion', type: 'Uint' },\n 0x6c: { name: 'Void', type: 'Binary' },\n 0x3f: { name: 'CRC-32', type: 'Binary' },\n 0xb538667: { name: 'SignatureSlot', type: 'Container' },\n 0x3e8a: { name: 'SignatureAlgo', type: 'Uint' },\n 0x3e9a: { name: 'SignatureHash', type: 'Uint' },\n 0x3ea5: { name: 'SignaturePublicKey', type: 'Binary' },\n 0x3eb5: { name: 'Signature', type: 'Binary' },\n 0x3e5b: { name: 'SignatureElements', type: 'Container' },\n 0x3e7b: { name: 'SignatureElementList', type: 'Container' },\n 0x2532: { name: 'SignedElement', type: 'Binary' },\n 0x8538067: { name: 'Segment', type: 'Container' },\n 0x14d9b74: { name: 'SeekHead', type: 'Container' },\n 0xdbb: { name: 'Seek', type: 'Container' },\n 0x13ab: { name: 'SeekID', type: 'Binary' },\n 0x13ac: { name: 'SeekPosition', type: 'Uint' },\n 0x549a966: { name: 'Info', type: 'Container' },\n 0x33a4: { name: 'SegmentUID', type: 'Binary' },\n 0x3384: { name: 'SegmentFilename', type: 'String' },\n 0x1cb923: { name: 'PrevUID', type: 'Binary' },\n 0x1c83ab: { name: 'PrevFilename', type: 'String' },\n 0x1eb923: { name: 'NextUID', type: 'Binary' },\n 0x1e83bb: { name: 'NextFilename', type: 'String' },\n 0x444: { name: 'SegmentFamily', type: 'Binary' },\n 0x2924: { name: 'ChapterTranslate', type: 'Container' },\n 0x29fc: { name: 'ChapterTranslateEditionUID', type: 'Uint' },\n 0x29bf: { name: 'ChapterTranslateCodec', type: 'Uint' },\n 0x29a5: { name: 'ChapterTranslateID', type: 'Binary' },\n 0xad7b1: { name: 'TimecodeScale', type: 'Uint' },\n 0x489: { name: 'Duration', type: 'Float' },\n 0x461: { name: 'DateUTC', type: 'Date' },\n 0x3ba9: { name: 'Title', type: 'String' },\n 0xd80: { name: 'MuxingApp', type: 'String' },\n 0x1741: { name: 'WritingApp', type: 'String' },\n // 0xf43b675: { name: 'Cluster', type: 'Container' },\n 0x67: { name: 'Timecode', type: 'Uint' },\n 0x1854: { name: 'SilentTracks', type: 'Container' },\n 0x18d7: { name: 'SilentTrackNumber', type: 'Uint' },\n 0x27: { name: 'Position', type: 'Uint' },\n 0x2b: { name: 'PrevSize', type: 'Uint' },\n 0x23: { name: 'SimpleBlock', type: 'Binary' },\n 0x20: { name: 'BlockGroup', type: 'Container' },\n 0x21: { name: 'Block', type: 'Binary' },\n 0x22: { name: 'BlockVirtual', type: 'Binary' },\n 0x35a1: { name: 'BlockAdditions', type: 'Container' },\n 0x26: { name: 'BlockMore', type: 'Container' },\n 0x6e: { name: 'BlockAddID', type: 'Uint' },\n 0x25: { name: 'BlockAdditional', type: 'Binary' },\n 0x1b: { name: 'BlockDuration', type: 'Uint' },\n 0x7a: { name: 'ReferencePriority', type: 'Uint' },\n 0x7b: { name: 'ReferenceBlock', type: 'Int' },\n 0x7d: { name: 'ReferenceVirtual', type: 'Int' },\n 0x24: { name: 'CodecState', type: 'Binary' },\n 0x35a2: { name: 'DiscardPadding', type: 'Int' },\n 0xe: { name: 'Slices', type: 'Container' },\n 0x68: { name: 'TimeSlice', type: 'Container' },\n 0x4c: { name: 'LaceNumber', type: 'Uint' },\n 0x4d: { name: 'FrameNumber', type: 'Uint' },\n 0x4b: { name: 'BlockAdditionID', type: 'Uint' },\n 0x4e: { name: 'Delay', type: 'Uint' },\n 0x4f: { name: 'SliceDuration', type: 'Uint' },\n 0x48: { name: 'ReferenceFrame', type: 'Container' },\n 0x49: { name: 'ReferenceOffset', type: 'Uint' },\n 0x4a: { name: 'ReferenceTimeCode', type: 'Uint' },\n 0x2f: { name: 'EncryptedBlock', type: 'Binary' },\n 0x654ae6b: { name: 'Tracks', type: 'Container' },\n 0x2e: { name: 'TrackEntry', type: 'Container' },\n 0x57: { name: 'TrackNumber', type: 'Uint' },\n 0x33c5: { name: 'TrackUID', type: 'Uint' },\n 0x3: { name: 'TrackType', type: 'Uint' },\n 0x39: { name: 'FlagEnabled', type: 'Uint' },\n 0x8: { name: 'FlagDefault', type: 'Uint' },\n 0x15aa: { name: 'FlagForced', type: 'Uint' },\n 0x1c: { name: 'FlagLacing', type: 'Uint' },\n 0x2de7: { name: 'MinCache', type: 'Uint' },\n 0x2df8: { name: 'MaxCache', type: 'Uint' },\n 0x3e383: { name: 'DefaultDuration', type: 'Uint' },\n 0x34e7a: { name: 'DefaultDecodedFieldDuration', type: 'Uint' },\n 0x3314f: { name: 'TrackTimecodeScale', type: 'Float' },\n 0x137f: { name: 'TrackOffset', type: 'Int' },\n 0x15ee: { name: 'MaxBlockAdditionID', type: 'Uint' },\n 0x136e: { name: 'Name', type: 'String' },\n 0x2b59c: { name: 'Language', type: 'String' },\n 0x6: { name: 'CodecID', type: 'String' },\n 0x23a2: { name: 'CodecPrivate', type: 'Binary' },\n 0x58688: { name: 'CodecName', type: 'String' },\n 0x3446: { name: 'AttachmentLink', type: 'Uint' },\n 0x1a9697: { name: 'CodecSettings', type: 'String' },\n 0x1b4040: { name: 'CodecInfoURL', type: 'String' },\n 0x6b240: { name: 'CodecDownloadURL', type: 'String' },\n 0x2a: { name: 'CodecDecodeAll', type: 'Uint' },\n 0x2fab: { name: 'TrackOverlay', type: 'Uint' },\n 0x16aa: { name: 'CodecDelay', type: 'Uint' },\n 0x16bb: { name: 'SeekPreRoll', type: 'Uint' },\n 0x2624: { name: 'TrackTranslate', type: 'Container' },\n 0x26fc: { name: 'TrackTranslateEditionUID', type: 'Uint' },\n 0x26bf: { name: 'TrackTranslateCodec', type: 'Uint' },\n 0x26a5: { name: 'TrackTranslateTrackID', type: 'Binary' },\n 0x60: { name: 'Video', type: 'Container' },\n 0x1a: { name: 'FlagInterlaced', type: 'Uint' },\n 0x13b8: { name: 'StereoMode', type: 'Uint' },\n 0x13c0: { name: 'AlphaMode', type: 'Uint' },\n 0x13b9: { name: 'OldStereoMode', type: 'Uint' },\n 0x30: { name: 'PixelWidth', type: 'Uint' },\n 0x3a: { name: 'PixelHeight', type: 'Uint' },\n 0x14aa: { name: 'PixelCropBottom', type: 'Uint' },\n 0x14bb: { name: 'PixelCropTop', type: 'Uint' },\n 0x14cc: { name: 'PixelCropLeft', type: 'Uint' },\n 0x14dd: { name: 'PixelCropRight', type: 'Uint' },\n 0x14b0: { name: 'DisplayWidth', type: 'Uint' },\n 0x14ba: { name: 'DisplayHeight', type: 'Uint' },\n 0x14b2: { name: 'DisplayUnit', type: 'Uint' },\n 0x14b3: { name: 'AspectRatioType', type: 'Uint' },\n 0xeb524: { name: 'ColourSpace', type: 'Binary' },\n 0xfb523: { name: 'GammaValue', type: 'Float' },\n 0x383e3: { name: 'FrameRate', type: 'Float' },\n 0x61: { name: 'Audio', type: 'Container' },\n 0x35: { name: 'SamplingFrequency', type: 'Float' },\n 0x38b5: { name: 'OutputSamplingFrequency', type: 'Float' },\n 0x1f: { name: 'Channels', type: 'Uint' },\n 0x3d7b: { name: 'ChannelPositions', type: 'Binary' },\n 0x2264: { name: 'BitDepth', type: 'Uint' },\n 0x62: { name: 'TrackOperation', type: 'Container' },\n 0x63: { name: 'TrackCombinePlanes', type: 'Container' },\n 0x64: { name: 'TrackPlane', type: 'Container' },\n 0x65: { name: 'TrackPlaneUID', type: 'Uint' },\n 0x66: { name: 'TrackPlaneType', type: 'Uint' },\n 0x69: { name: 'TrackJoinBlocks', type: 'Container' },\n 0x6d: { name: 'TrackJoinUID', type: 'Uint' },\n 0x40: { name: 'TrickTrackUID', type: 'Uint' },\n 0x41: { name: 'TrickTrackSegmentUID', type: 'Binary' },\n 0x46: { name: 'TrickTrackFlag', type: 'Uint' },\n 0x47: { name: 'TrickMasterTrackUID', type: 'Uint' },\n 0x44: { name: 'TrickMasterTrackSegmentUID', type: 'Binary' },\n 0x2d80: { name: 'ContentEncodings', type: 'Container' },\n 0x2240: { name: 'ContentEncoding', type: 'Container' },\n 0x1031: { name: 'ContentEncodingOrder', type: 'Uint' },\n 0x1032: { name: 'ContentEncodingScope', type: 'Uint' },\n 0x1033: { name: 'ContentEncodingType', type: 'Uint' },\n 0x1034: { name: 'ContentCompression', type: 'Container' },\n 0x254: { name: 'ContentCompAlgo', type: 'Uint' },\n 0x255: { name: 'ContentCompSettings', type: 'Binary' },\n 0x1035: { name: 'ContentEncryption', type: 'Container' },\n 0x7e1: { name: 'ContentEncAlgo', type: 'Uint' },\n 0x7e2: { name: 'ContentEncKeyID', type: 'Binary' },\n 0x7e3: { name: 'ContentSignature', type: 'Binary' },\n 0x7e4: { name: 'ContentSigKeyID', type: 'Binary' },\n 0x7e5: { name: 'ContentSigAlgo', type: 'Uint' },\n 0x7e6: { name: 'ContentSigHashAlgo', type: 'Uint' },\n 0xc53bb6b: { name: 'Cues', type: 'Container' },\n 0x3b: { name: 'CuePoint', type: 'Container' },\n 0x33: { name: 'CueTime', type: 'Uint' },\n 0x37: { name: 'CueTrackPositions', type: 'Container' },\n 0x77: { name: 'CueTrack', type: 'Uint' },\n 0x71: { name: 'CueClusterPosition', type: 'Uint' },\n 0x70: { name: 'CueRelativePosition', type: 'Uint' },\n 0x32: { name: 'CueDuration', type: 'Uint' },\n 0x1378: { name: 'CueBlockNumber', type: 'Uint' },\n 0x6a: { name: 'CueCodecState', type: 'Uint' },\n 0x5b: { name: 'CueReference', type: 'Container' },\n 0x16: { name: 'CueRefTime', type: 'Uint' },\n 0x17: { name: 'CueRefCluster', type: 'Uint' },\n 0x135f: { name: 'CueRefNumber', type: 'Uint' },\n 0x6b: { name: 'CueRefCodecState', type: 'Uint' },\n 0x941a469: { name: 'Attachments', type: 'Container' },\n 0x21a7: { name: 'AttachedFile', type: 'Container' },\n 0x67e: { name: 'FileDescription', type: 'String' },\n 0x66e: { name: 'FileName', type: 'String' },\n 0x660: { name: 'FileMimeType', type: 'String' },\n 0x65c: { name: 'FileData', type: 'Binary' },\n 0x6ae: { name: 'FileUID', type: 'Uint' },\n 0x675: { name: 'FileReferral', type: 'Binary' },\n 0x661: { name: 'FileUsedStartTime', type: 'Uint' },\n 0x662: { name: 'FileUsedEndTime', type: 'Uint' },\n 0x43a770: { name: 'Chapters', type: 'Container' },\n 0x5b9: { name: 'EditionEntry', type: 'Container' },\n 0x5bc: { name: 'EditionUID', type: 'Uint' },\n 0x5bd: { name: 'EditionFlagHidden', type: 'Uint' },\n 0x5db: { name: 'EditionFlagDefault', type: 'Uint' },\n 0x5dd: { name: 'EditionFlagOrdered', type: 'Uint' },\n 0x36: { name: 'ChapterAtom', type: 'Container' },\n 0x33c4: { name: 'ChapterUID', type: 'Uint' },\n 0x1654: { name: 'ChapterStringUID', type: 'String' },\n 0x11: { name: 'ChapterTimeStart', type: 'Uint' },\n 0x12: { name: 'ChapterTimeEnd', type: 'Uint' },\n 0x18: { name: 'ChapterFlagHidden', type: 'Uint' },\n 0x598: { name: 'ChapterFlagEnabled', type: 'Uint' },\n 0x2e67: { name: 'ChapterSegmentUID', type: 'Binary' },\n 0x2ebc: { name: 'ChapterSegmentEditionUID', type: 'Uint' },\n 0x23c3: { name: 'ChapterPhysicalEquiv', type: 'Uint' },\n 0xf: { name: 'ChapterTrack', type: 'Container' },\n 0x9: { name: 'ChapterTrackNumber', type: 'Uint' },\n 0x0: { name: 'ChapterDisplay', type: 'Container' },\n 0x5: { name: 'ChapString', type: 'String' },\n 0x37c: { name: 'ChapLanguage', type: 'String' },\n 0x37e: { name: 'ChapCountry', type: 'String' },\n 0x2944: { name: 'ChapProcess', type: 'Container' },\n 0x2955: { name: 'ChapProcessCodecID', type: 'Uint' },\n 0x50d: { name: 'ChapProcessPrivate', type: 'Binary' },\n 0x2911: { name: 'ChapProcessCommand', type: 'Container' },\n 0x2922: { name: 'ChapProcessTime', type: 'Uint' },\n 0x2933: { name: 'ChapProcessData', type: 'Binary' },\n 0x254c367: { name: 'Tags', type: 'Container' },\n 0x3373: { name: 'Tag', type: 'Container' },\n 0x23c0: { name: 'Targets', type: 'Container' },\n 0x28ca: { name: 'TargetTypeValue', type: 'Uint' },\n 0x23ca: { name: 'TargetType', type: 'String' },\n 0x23c5: { name: 'TagTrackUID', type: 'Uint' },\n 0x23c9: { name: 'TagEditionUID', type: 'Uint' },\n 0x23c4: { name: 'TagChapterUID', type: 'Uint' },\n 0x23c6: { name: 'TagAttachmentUID', type: 'Uint' },\n 0x27c8: { name: 'SimpleTag', type: 'Container' },\n 0x5a3: { name: 'TagName', type: 'String' },\n 0x47a: { name: 'TagLanguage', type: 'String' },\n 0x484: { name: 'TagDefault', type: 'Uint' },\n 0x487: { name: 'TagString', type: 'String' },\n 0x485: { name: 'TagBinary', type: 'Binary' }\n };\n\n function doInherit(newClass, baseClass) {\n newClass.prototype = Object.create(baseClass.prototype);\n newClass.prototype.constructor = newClass;\n }\n\n function WebmBase(name, type) {\n this.name = name || 'Unknown';\n this.type = type || 'Unknown';\n }\n WebmBase.prototype.updateBySource = function() { };\n WebmBase.prototype.setSource = function(source) {\n this.source = source;\n this.updateBySource();\n };\n WebmBase.prototype.updateByData = function() { };\n WebmBase.prototype.setData = function(data) {\n this.data = data;\n this.updateByData();\n };\n\n function WebmUint(name, type) {\n WebmBase.call(this, name, type || 'Uint');\n }\n doInherit(WebmUint, WebmBase);\n function padHex(hex) {\n return hex.length % 2 === 1 ? '0' + hex : hex;\n }\n WebmUint.prototype.updateBySource = function() {\n // use hex representation of a number instead of number value\n this.data = '';\n for (var i = 0; i < this.source.length; i++) {\n var hex = this.source[i].toString(16);\n this.data += padHex(hex);\n }\n };\n WebmUint.prototype.updateByData = function() {\n var length = this.data.length / 2;\n this.source = new Uint8Array(length);\n for (var i = 0; i < length; i++) {\n var hex = this.data.substr(i * 2, 2);\n this.source[i] = parseInt(hex, 16);\n }\n };\n WebmUint.prototype.getValue = function() {\n return parseInt(this.data, 16);\n };\n WebmUint.prototype.setValue = function(value) {\n this.setData(padHex(value.toString(16)));\n };\n\n function WebmFloat(name, type) {\n WebmBase.call(this, name, type || 'Float');\n }\n doInherit(WebmFloat, WebmBase);\n WebmFloat.prototype.getFloatArrayType = function() {\n return this.source && this.source.length === 4 ? Float32Array : Float64Array;\n };\n WebmFloat.prototype.updateBySource = function() {\n var byteArray = this.source.reverse();\n var floatArrayType = this.getFloatArrayType();\n var floatArray = new floatArrayType(byteArray.buffer);\n this.data = floatArray[0];\n };\n WebmFloat.prototype.updateByData = function() {\n var floatArrayType = this.getFloatArrayType();\n var floatArray = new floatArrayType([ this.data ]);\n var byteArray = new Uint8Array(floatArray.buffer);\n this.source = byteArray.reverse();\n };\n WebmFloat.prototype.getValue = function() {\n return this.data;\n };\n WebmFloat.prototype.setValue = function(value) {\n this.setData(value);\n };\n\n function WebmContainer(name, type) {\n WebmBase.call(this, name, type || 'Container');\n }\n doInherit(WebmContainer, WebmBase);\n WebmContainer.prototype.readByte = function() {\n return this.source[this.offset++];\n };\n WebmContainer.prototype.readUint = function() {\n var firstByte = this.readByte();\n var bytes = 8 - firstByte.toString(2).length;\n var value = firstByte - (1 << (7 - bytes));\n for (var i = 0; i < bytes; i++) {\n // don't use bit operators to support x86\n value *= 256;\n value += this.readByte();\n }\n return value;\n };\n WebmContainer.prototype.updateBySource = function() {\n this.data = [];\n for (this.offset = 0; this.offset < this.source.length; this.offset = end) {\n var id = this.readUint();\n var len = this.readUint();\n var end = Math.min(this.offset + len, this.source.length);\n var data = this.source.slice(this.offset, end);\n\n var info = sections[id] || { name: 'Unknown', type: 'Unknown' };\n var ctr = WebmBase;\n switch (info.type) {\n case 'Container':\n ctr = WebmContainer;\n break;\n case 'Uint':\n ctr = WebmUint;\n break;\n case 'Float':\n ctr = WebmFloat;\n break;\n }\n var section = new ctr(info.name, info.type);\n section.setSource(data);\n this.data.push({\n id: id,\n idHex: id.toString(16),\n data: section\n });\n }\n };\n WebmContainer.prototype.writeUint = function(x, draft) {\n for (var bytes = 1, flag = 0x80; x >= flag && bytes < 8; bytes++, flag *= 0x80) { }\n\n if (!draft) {\n var value = flag + x;\n for (var i = bytes - 1; i >= 0; i--) {\n // don't use bit operators to support x86\n var c = value % 256;\n this.source[this.offset + i] = c;\n value = (value - c) / 256;\n }\n }\n\n this.offset += bytes;\n };\n WebmContainer.prototype.writeSections = function(draft) {\n this.offset = 0;\n for (var i = 0; i < this.data.length; i++) {\n var section = this.data[i],\n content = section.data.source,\n contentLength = content.length;\n this.writeUint(section.id, draft);\n this.writeUint(contentLength, draft);\n if (!draft) {\n this.source.set(content, this.offset);\n }\n this.offset += contentLength;\n }\n return this.offset;\n };\n WebmContainer.prototype.updateByData = function() {\n // run without accessing this.source to determine total length - need to know it to create Uint8Array\n var length = this.writeSections('draft');\n this.source = new Uint8Array(length);\n // now really write data\n this.writeSections();\n };\n WebmContainer.prototype.getSectionById = function(id) {\n for (var i = 0; i < this.data.length; i++) {\n var section = this.data[i];\n if (section.id === id) {\n return section.data;\n }\n }\n return null;\n };\n\n function WebmFile(source) {\n WebmContainer.call(this, 'File', 'File');\n this.setSource(source);\n }\n doInherit(WebmFile, WebmContainer);\n WebmFile.prototype.fixDuration = function(duration, options) {\n var logger = options && options.logger;\n if (logger === undefined) {\n logger = function(message) {\n console.log(message);\n };\n } else if (!logger) {\n logger = function() { };\n }\n\n var segmentSection = this.getSectionById(0x8538067);\n if (!segmentSection) {\n logger('[fix-webm-duration] Segment section is missing');\n return false;\n }\n\n var infoSection = segmentSection.getSectionById(0x549a966);\n if (!infoSection) {\n logger('[fix-webm-duration] Info section is missing');\n return false;\n }\n\n var timeScaleSection = infoSection.getSectionById(0xad7b1);\n if (!timeScaleSection) {\n logger('[fix-webm-duration] TimecodeScale section is missing');\n return false;\n }\n\n var durationSection = infoSection.getSectionById(0x489);\n if (durationSection) {\n if (durationSection.getValue() <= 0) {\n logger(`[fix-webm-duration] Duration section is present, but the value is ${durationSection.getValue()}`);\n durationSection.setValue(duration);\n } else {\n logger(`[fix-webm-duration] Duration section is present, and the value is ${durationSection.getValue()}`);\n return false;\n }\n } else {\n logger('[fix-webm-duration] Duration section is missing');\n // append Duration section\n durationSection = new WebmFloat('Duration', 'Float');\n durationSection.setValue(duration);\n infoSection.data.push({\n id: 0x489,\n data: durationSection\n });\n }\n\n // set default time scale to 1 millisecond (1000000 nanoseconds)\n timeScaleSection.setValue(1000000);\n infoSection.updateByData();\n segmentSection.updateByData();\n this.updateByData();\n\n return true;\n };\n WebmFile.prototype.toBlob = function(mimeType) {\n return new Blob([ this.source.buffer ], { type: mimeType || 'video/webm' });\n };\n\n function fixWebmDuration(blob, duration, callback, options) {\n // The callback may be omitted - then the third argument is options\n if (typeof callback === \"object\") {\n options = callback;\n callback = undefined;\n }\n\n if (!callback) {\n return new Promise(function(resolve) {\n fixWebmDuration(blob, duration, resolve, options);\n });\n }\n\n try {\n var reader = new FileReader();\n reader.onloadend = function() {\n try {\n var file = new WebmFile(new Uint8Array(reader.result));\n if (file.fixDuration(duration, options)) {\n blob = file.toBlob(blob.type);\n }\n } catch (ex) {\n // ignore\n }\n callback(blob);\n };\n reader.readAsArrayBuffer(blob);\n } catch (ex) {\n callback(blob);\n }\n }\n\n // Support AMD import default\n fixWebmDuration.default = fixWebmDuration;\n\n return fixWebmDuration;\n});\n","import ysFixWebmDuration from \"fix-webm-duration\";\n\nexport class ProcessVideo extends HTMLElement {\n private phrase: string;\n private previewStream: MediaStream | null = null;\n private recordedChunks: Blob[] = [];\n private mediaRecorder: MediaRecorder | null = null;\n private videoFile: File | null = null;\n private startTime: number = 0;\n private timerInterval: ReturnType<typeof setInterval> | null = null;\n private recordingTimeout: ReturnType<typeof setTimeout> | null = null;\n\n private videoElement!: HTMLVideoElement;\n private fileInput!: HTMLInputElement;\n private recordButton!: HTMLButtonElement;\n private stopButton!: HTMLButtonElement;\n private submitButton!: HTMLButtonElement;\n\n private errorState: string | null = null;\n private timeLimit: number = 30;\n\n constructor() {\n super();\n\n this.phrase = this.generateDefaultPhrase();\n\n // Attach shadow DOM and initialize UI\n this.attachShadow({ mode: 'open' });\n this.initializeUI();\n }\n\n get endpoint(): string | null {\n return this.getAttribute(\"endpoint\");\n }\n\n set endpoint(value: string | null) {\n const current = this.getAttribute(\"endpoint\");\n if (value !== null && value !== current) {\n this.setAttribute(\"endpoint\", value);\n } else if (value === null && current !== null) {\n this.removeAttribute(\"endpoint\");\n }\n }\n\n disconnectedCallback() {\n this.stopRecording();\n if (this.previewStream) {\n this.previewStream.getTracks().forEach(track => track.stop());\n }\n }\n\n attributeChangedCallback(name: string, _oldValue: string | null, newValue: string | null) {\n if (name === 'endpoint' && newValue !== this.endpoint) {\n this.endpoint = newValue;\n }\n }\n\n private generateDefaultPhrase(): string {\n return Math.random().toString().slice(2, 10); // 8-digit random phrase\n }\n\n initializeUI() {\n const phraseDisplay = this.phrase\n .split(\"\")\n .map((digit) => `<span class=\"digit\">${digit}</span>`)\n .join(\" \");\n\n this.shadowRoot!.innerHTML = `\n <style>\n :host {\n display: block;\n font-family: Arial, sans-serif;\n --primary-color: #007bff;\n --secondary-color: #6c757d;\n --button-bg: var(--primary-color);\n --button-text-color: #fff;\n --input-border-color: var(--secondary-color);\n --input-focus-border-color: var(--primary-color);\n --spacing: 16px;\n --button-padding: 10px 20px;\n --border-radius: 4px;\n }\n \n .container {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: var(--spacing);\n padding: var(--spacing);\n max-width: 500px;\n margin: 0 auto;\n text-align: center;\n }\n\n .video-wrapper {\n position: relative;\n display: inline-block;\n }\n\n #timer-overlay {\n position: absolute;\n top: 10px;\n left: 10px;\n background-color: rgba(0, 0, 0, 0.7);\n color: white;\n padding: 5px 10px;\n border-radius: 4px;\n font-family: Arial, sans-serif;\n font-size: 14px;\n }\n\n video {\n max-width: 100%;\n border-radius: var(--border-radius);\n }\n\n input[type=\"text\"], input[type=\"file\"] {\n padding: var(--button-padding);\n border: 1px solid var(--input-border-color);\n border-radius: var(--border-radius);\n width: 100%;\n max-width: 100%;\n }\n\n input[type=\"text\"]:focus, input[type=\"file\"]:focus {\n outline: none;\n border-color: var(--input-focus-border-color);\n }\n\n .hidden {\n display: none;\n }\n\n .phrase-display {\n font-size: 24px;\n font-weight: bold;\n display: flex;\n gap: 8px;\n justify-content: center;\n }\n .digit {\n padding: 4px;\n border: 1px solid #ccc;\n border-radius: 4px;\n text-align: center;\n width: 24px;\n }\n\n </style>\n <div class=\"container\">\n <slot name=\"video\">\n <div class=\"video-wrapper\">\n <video id=\"video-preview\" muted autoplay></video>\n <div id=\"timer-overlay\" class=\"hidden\">00:00</div>\n </div>\n </slot>\n <slot name=\"phrase-display\">\n <div class=\"phrase-display\">\n ${phraseDisplay}\n </div>\n </slot>\n <slot name=\"record-button\">\n <button id=\"record-button\">Start Recording</button>\n </slot>\n <slot name=\"stop-button\">\n <button id=\"stop-button\" disabled>Stop Recording</button>\n </slot>\n <slot name=\"file-input\">\n <input type=\"file\" accept=\"video/*\" id=\"file-input\" />\n </slot>\n <slot name=\"submit-button\">\n <button id=\"submit-button\">Submit Video</button>\n </slot>\n <slot name=\"loading\">\n <div class=\"message\">Loading...</div>\n </slot>\n <slot name=\"error\">\n <div class=\"message error\">An error occurred</div>\n </slot>\n <slot name=\"success\">\n <div class=\"message success\">Video submitted successfully!</div>\n </slot>\n </div>\n `;\n this.attachSlotListeners();\n this.setupPreview();\n this.toggleState(null);\n }\n\n private attachSlotListeners(): void {\n const videoSlot = this.shadowRoot!.querySelector('slot[name=\"video\"]') as HTMLSlotElement;\n const recordButtonSlot = this.shadowRoot!.querySelector('slot[name=\"record-button\"]') as HTMLSlotElement;\n const stopButtonSlot = this.shadowRoot!.querySelector('slot[name=\"stop-button\"]') as HTMLSlotElement;\n const fileInputSlot = this.shadowRoot!.querySelector('slot[name=\"file-input\"]') as HTMLSlotElement;\n const submitButtonSlot = this.shadowRoot!.querySelector('slot[name=\"submit-button\"]') as HTMLSlotElement;\n\n this.videoElement = this.getSlotElement(videoSlot, '#video-preview', HTMLVideoElement);\n this.recordButton = this.getSlotElement(recordButtonSlot, '#record-button', HTMLButtonElement);\n this.stopButton = this.getSlotElement(stopButtonSlot, '#stop-button', HTMLButtonElement);\n this.fileInput = this.getSlotElement(fileInputSlot, '#file-input', HTMLInputElement);\n this.submitButton = this.getSlotElement(submitButtonSlot, '#submit-button', HTMLButtonElement);\n\n if (this.fileInput) {\n this.fileInput.addEventListener('change', (e) => this.handleFileUpload(e));\n }\n if (this.recordButton) {\n this.recordButton.addEventListener(\"click\", () => this.startRecording());\n }\n if (this.stopButton) {\n this.stopButton.addEventListener(\"click\", () => this.stopRecording());\n }\n if (this.submitButton) {\n this.submitButton.addEventListener(\"click\", () => this.handleSubmit())\n }\n }\n\n private getSlotElement<T extends HTMLElement>(\n slot: HTMLSlotElement,\n fallbackSelector: string,\n elementType: { new(): T }\n ): T {\n const assignedElements = slot.assignedElements();\n return (assignedElements.length > 0 ? assignedElements[0] : null) as T || this.shadowRoot!.querySelector(fallbackSelector) as T;\n }\n\n replaceSlotContent(slotName: string, content: string | HTMLElement) {\n const slot = this.shadowRoot!.querySelector(`slot[name=\"${slotName}\"]`) as HTMLElement;\n if (slot) {\n if (typeof content === 'string') {\n slot.innerHTML = content;\n } else if (content instanceof HTMLElement) {\n slot.innerHTML = '';\n slot.appendChild(content);\n }\n }\n }\n\n removeSlotListener(slotName: string, event: string, callback: EventListener) {\n const slot = this.shadowRoot!.querySelector(`slot[name=\"${slotName}\"]`) as HTMLSlotElement;\n if (slot) {\n const assignedNodes = slot.assignedElements();\n assignedNodes.forEach((node) => {\n node.removeEventListener(event, callback);\n });\n }\n }\n\n private toggleState(state: 'loading' | 'success' | 'error' | null) {\n const states = ['loading', 'success', 'error'];\n\n states.forEach((slotName) => {\n const slot = this.shadowRoot!.querySelector(`slot[name=\"${slotName}\"]`) as HTMLElement;\n if (slot) {\n slot.style.display = slotName === state ? 'block' : 'none';\n }\n });\n }\n\n private convertPhraseToWords(phrase: string): string {\n const digitWords = [\n \"zero\", \"one\", \"two\", \"three\", \"four\",\n \"five\", \"six\", \"seven\", \"eight\", \"nine\"\n ];\n\n return phrase\n .split(\"\")\n .map((digit) => digitWords[parseInt(digit, 10)])\n .join(\" \");\n }\n\n private async setupPreview() {\n try {\n const stream = await navigator.mediaDevices.getUserMedia({ video: true, audio: true });\n this.previewStream = stream;\n\n this.videoElement.srcObject = stream;\n this.videoElement.controls = false;\n this.videoElement.play();\n } catch (error) {\n this.toggleState('error');\n console.error('Error setting up video preview:', error);\n }\n }\n\n private async startTimer() {\n const timerOverlay = this.shadowRoot!.querySelector('#timer-overlay') as HTMLElement;\n timerOverlay.textContent = '00:00';\n timerOverlay.classList.remove('hidden');\n\n let seconds = 0;\n this.timerInterval = setInterval(() => {\n seconds++;\n const minutes = Math.floor(seconds / 60);\n const remainingSeconds = seconds % 60;\n timerOverlay.textContent = `${String(minutes).padStart(2, '0')}:${String(remainingSeconds).padStart(2, '0')}`;\n }, 1000);\n\n this.recordingTimeout = setTimeout(() => {\n this.stopRecording();\n }, this.timeLimit * 1000);\n }\n\n private async stopTimer() {\n if (this.recordingTimeout) {\n clearTimeout(this.recordingTimeout);\n }\n if (this.timerInterval) {\n clearInterval(this.timerInterval);\n this.timerInterval = null;\n }\n const timerOverlay = this.shadowRoot!.querySelector('#timer-overlay') as HTMLElement;\n timerOverlay.classList.add('hidden');\n }\n\n public async startRecording() {\n if (!window.MediaRecorder) {\n console.error('MediaRecorder API is not supported in this browser');\n return;\n }\n try {\n if (this.mediaRecorder && this.mediaRecorder.state !== 'inactive') {\n console.log('Recording already in progress.');\n return;\n }\n\n if (!this.previewStream) {\n console.log('Initializing preview stream...');\n this.previewStream = await navigator.mediaDevices.getUserMedia({\n video: true,\n audio: true,\n });\n }\n\n this.videoElement.muted = true;\n this.videoElement.srcObject = this.previewStream;\n this.videoElement.currentTime = 0;\n\n await this.videoElement.play();\n\n this.mediaRecorder = new MediaRecorder(this.previewStream);\n this.recordedChunks = [];\n\n this.mediaRecorder.ondataavailable = (event) => {\n if (event.data.size > 0) {\n this.recordedChunks.push(event.data);\n }\n };\n\n this.mediaRecorder.onstop = () => {\n const duration = Date.now() - this.startTime;\n const buggyBlob = new Blob(this.recordedChunks, { type: 'video/webm' });\n\n ysFixWebmDuration(buggyBlob, duration, { logger: false })\n .then((fixedBlob: Blob) => {\n this.onStopMediaRecorder(fixedBlob);\n });\n };\n\n this.mediaRecorder.start();\n this.startTimer();\n this.startTime = Date.now();\n\n this.recordButton.disabled = true;\n this.stopButton.disabled = false;\n this.videoElement.controls = false;\n } catch (error) {\n console.error('Error starting video recording:', error);\n }\n }\n\n public stopRecording() {\n try {\n if (!this.mediaRecorder || this.mediaRecorder.state === 'inactive') {\n console.log('No recording in progress.');\n return;\n }\n\n this.mediaRecorder.stop();\n\n if (this.previewStream) {\n this.previewStream.getTracks().forEach(track => track.stop());\n }\n this.videoElement.srcObject = null;\n this.videoElement.src = '';\n this.videoElement.controls = false;\n\n this.recordButton.disabled = false;\n this.stopButton.disabled = true;\n\n this.mediaRecorder = null;\n this.previewStream = null;\n\n } catch (error) {\n console.error('Error stopping video recording:', error);\n }\n }\n\n private onStopMediaRecorder(blob: Blob) {\n const videoURL = URL.createObjectURL(blob);\n this.videoFile = new File([blob], 'recorded_video.webm', { type: 'video/webm' });\n this.recordedChunks = [];\n\n this.videoElement.src = videoURL;\n this.videoElement.controls = true;\n this.videoElement.play();\n this.videoElement.muted = false;\n this.stopTimer();\n\n // Clean up the object URL when the video loads\n this.videoElement.onloadeddata = () => {\n URL.revokeObjectURL(videoURL);\n };\n }\n\n private handleFileUpload(event: Event) {\n const file = (event.target as HTMLInputElement).files?.[0];\n if (file?.type?.startsWith('video/')) {\n if (file.size > 100 * 1024 * 1024) { // 100MB limit\n this.toggleState('error');\n console.error('File size exceeds limit of 100MB');\n return;\n }\n this.videoFile = file;\n this.videoElement.src = URL.createObjectURL(file);\n this.videoElement.play();\n } else {\n this.toggleState('error');\n console.error('Please select a valid video file.');\n }\n }\n\n public async handleSubmit() {\n if (!this.videoFile) {\n this.toggleState('error');\n console.error('No video file to submit.');\n return;\n }\n\n if (!this.endpoint) {\n this.toggleState('error');\n console.error('Endpoint must be provided.');\n return;\n }\n\n if (!this.userFullname) {\n this.toggleState('error');\n console.error('User full name must be provided.');\n return;\n }\n\n this.toggleState('loading');\n\n try {\n const formData = new FormData();\n formData.append('video', this.videoFile);\n formData.append('phrase', this.convertPhraseToWords(this.phrase));\n formData.append('userFullname', this.userFullname);\n\n const response = await fetch(this.endpoint, {\n method: 'POST',\n body: formData\n });\n\n if (!response.ok) {\n throw new Error(`HTTP error! status: ${response.status}`);\n }\n\n const result = await response.json();\n console.log('Response from endpoint:', result);\n this.toggleState('success');\n } catch (error) {\n this.toggleState('error');\n console.error('Error submitting video:', error);\n }\n }\n\n static get observedAttributes() {\n return ['endpoint', 'user-fullname'];\n }\n\n get userFullname(): string | null {\n return this.getAttribute('user-fullname');\n }\n\n set userFullname(value: string | null) {\n if (value) {\n this.setAttribute('user-fullname', value);\n } else {\n this.removeAttribute('user-fullname');\n }\n }\n\n get isRecording(): boolean {\n return this.mediaRecorder?.state === 'recording';\n }\n\n get currentPhrase(): string {\n return this.phrase;\n }\n\n get videoDuration(): number | null {\n return this.videoElement?.duration || null;\n }\n\n get currentFile(): File | null {\n return this.videoFile;\n }\n\n get currentStream(): MediaStream | null {\n return this.previewStream;\n }\n\n get videoElementRef(): HTMLVideoElement {\n return this.videoElement;\n }\n\n get fileInputRef(): HTMLInputElement {\n return this.fileInput;\n }\n\n get recordingTimeLimit(): number {\n return this.timeLimit;\n }\n\n set recordingTimeLimit(value: number) {\n this.timeLimit = value;\n if (this.mediaRecorder && this.mediaRecorder.state === 'recording') {\n if (this.recordingTimeout) {\n clearTimeout(this.recordingTimeout);\n }\n this.recordingTimeout = setTimeout(() => this.stopRecording(), this.timeLimit * 1000);\n }\n }\n}\n\ncustomElements.define('process-video', ProcessVideo);\n","import React, {\n useEffect,\n useRef,\n useImperativeHandle,\n forwardRef,\n} from \"react\";\n\nimport '../process-video';\nimport type { ProcessVideo } from \"../process-video\";\n\nexport interface ProcessVideoProps extends React.HTMLAttributes<HTMLElement> {\n endpoint?: string;\n userFullname?: string;\n className?: string;\n style?: React.CSSProperties;\n children?: React.ReactNode;\n}\n\nexport interface ProcessVideoRef {\n startRecording: () => Promise<void>;\n stopRecording: () => void;\n handleSubmit: () => Promise<void>;\n\n currentPhrase: string;\n isRecording: boolean;\n videoDuration: number | null;\n currentFile: File | null;\n currentStream: MediaStream | null;\n\n videoElementRef: HTMLVideoElement;\n fileInputRef: HTMLInputElement;\n\n recordingTimeLimit: number;\n setRecordingTimeLimit: (value: number) => void;\n}\n\nconst ProcessVideoWrapper = forwardRef<ProcessVideoRef, ProcessVideoProps>(\n ({ endpoint, userFullname, className, style, children, ...rest }, ref) => {\n const elementRef = useRef<HTMLElement & ProcessVideo>(null);\n\n useImperativeHandle(ref, () => ({\n startRecording: () => elementRef.current!.startRecording(),\n stopRecording: () => elementRef.current!.stopRecording(),\n handleSubmit: () => elementRef.current!.handleSubmit(),\n\n get currentPhrase() {\n return elementRef.current!.currentPhrase;\n },\n get isRecording() {\n return elementRef.current!.isRecording;\n },\n get videoDuration() {\n return elementRef.current!.videoDuration;\n },\n get currentFile() {\n return elementRef.current!.currentFile;\n },\n get currentStream() {\n return elementRef.current!.currentStream;\n },\n get videoElementRef() {\n return elementRef.current!.videoElementRef;\n },\n get fileInputRef() {\n return elementRef.current!.fileInputRef;\n },\n get recordingTimeLimit() {\n return elementRef.current!.recordingTimeLimit;\n },\n setRecordingTimeLimit(value: number) {\n elementRef.current!.recordingTimeLimit = value;\n },\n }));\n\n useEffect(() => {\n if (elementRef.current) {\n if (endpoint !== undefined)\n elementRef.current.setAttribute(\"endpoint\", endpoint);\n if (userFullname !== undefined)\n elementRef.current.setAttribute(\"user-fullname\", userFullname);\n }\n }, [endpoint, userFullname]);\n\n return React.createElement(\n \"process-video\",\n {\n ref: elementRef,\n className,\n style,\n ...rest,\n },\n children\n );\n }\n);\n\nProcessVideoWrapper.displayName = \"ProcessVideo\";\n\nexport default ProcessVideoWrapper;\n"],"names":[],"mappings":";;AAAA,IAAY,kBAGX;AAHD,CAAA,UAAY,kBAAkB,EAAA;AAC5B,IAAA,kBAAA,CAAA,QAAA,CAAA,GAAA,SAAkB;AAClB,IAAA,kBAAA,CAAA,cAAA,CAAA,GAAA,eAA8B;AAChC,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,GAAA,EAAA,CAAA,CAAA;AAK9B,IAAY,uBAOX;AAPD,CAAA,UAAY,uBAAuB,EAAA;AACjC,IAAA,uBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,uBAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;AACnB,IAAA,uBAAA,CAAA,aAAA,CAAA,GAAA,eAA6B;AAC7B,IAAA,uBAAA,CAAA,oBAAA,CAAA,GAAA,sBAA2C;AAC3C,IAAA,uBAAA,CAAA,kBAAA,CAAA,GAAA,oBAAuC;AACvC,IAAA,uBAAA,CAAA,YAAA,CAAA,GAAA,aAA0B;AAC5B,CAAC,EAPW,uBAAuB,KAAvB,uBAAuB,GAAA,EAAA,CAAA,CAAA;;ACH7B,MAAO,kBAAmB,SAAQ,WAAW,CAAA;AASjD,IAAA,WAAA,GAAA;AACE,QAAA,KAAK,EAAE;QARD,IAAA,CAAA,YAAY,GAA4B,IAAI;QAC5C,IAAA,CAAA,aAAa,GAA6B,IAAI;QAC9C,IAAA,CAAA,aAAa,GAA6B,IAAI;AAOpD,QAAA,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;QAEjD,IAAI,CAAC,WAAW,GAAG,IAAI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AA,IAAI,aAAa,GAAA;AACf,YAAA,OAAO,UAAU,CAAC,OAAQ,CAAC,aAAa;QAC1C,CAAC;AACD,QAAA,IAAI,eAAe,GAAA;AACjB,YAAA,OAAO,UAAU,CAAC,OAAQ,CAAC,eAAe;QAC5C,CAAC;AACD,QAAA,IAAI,YAAY,GAAA;AACd,YAAA,OAAO,UAAU,CAAC,OAAQ,CAAC,YAAY;QACzC,CAAC;AACD,QAAA,IAAI,kBAAkB,GAAA;AACpB,YAAA,OAAO,UAAU,CAAC,OAAQ,CAAC,kBAAkB;QAC/C,CAAC;AACD,QAAA,qBAAqB,CAAC,KAAa,EAAA;AACjC,YAAA,UAAU,CAAC,OAAQ,CAAC,kBAAkB,GAAG,KAAK;QAChD,CAAC;AACF,KAAA,CAAC,CAAC;IAEH,SAAS,CAAC,MAAK;AACb,QAAA,IAAI,UAAU,CAAC,OAAO,EAAE;YACtB,IAAI,QAAQ,KAAK,SAAS;gBACxB,UAAU,CAAC,OAAO,CAAC,YAAY,CAAC,UAAU,EAAE,QAAQ,CAAC;YACvD,IAAI,YAAY,KAAK,SAAS;gBAC5B,UAAU,CAAC,OAAO,CAAC,YAAY,CAAC,eAAe,EAAE,YAAY,CAAC;QAClE;AACF,IAAA,CAAC,EAAE,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AAE5B,IAAA,OAAO,KAAK,CAAC,aAAa,CACxB,eAAe,EACf;AACE,QAAA,GAAG,EAAE,UAAU;QACf,SAAS;QACT,KAAK;AACL,QAAA,GAAG,IAAI;KACR,EACD,QAAQ,CACT;AACH,CAAC;AAGH,mBAAmB,CAAC,WAAW,GAAG,cAAc;;;;","x_google_ignoreList":[3]}
|
package/dist/sdk.js
CHANGED
|
@@ -9,7 +9,7 @@ class BiometrySDK {
|
|
|
9
9
|
const defaultHeaders = {
|
|
10
10
|
Authorization: `Bearer ${this.apiKey}`,
|
|
11
11
|
};
|
|
12
|
-
const requestHeaders =
|
|
12
|
+
const requestHeaders = { ...defaultHeaders, ...headers };
|
|
13
13
|
if (body && !(body instanceof FormData)) {
|
|
14
14
|
requestHeaders['Content-Type'] = 'application/json';
|
|
15
15
|
body = JSON.stringify(body);
|
|
@@ -21,7 +21,7 @@ class BiometrySDK {
|
|
|
21
21
|
});
|
|
22
22
|
if (!response.ok) {
|
|
23
23
|
const errorData = await response.json().catch(() => ({}));
|
|
24
|
-
const errorMessage =
|
|
24
|
+
const errorMessage = errorData?.error || errorData?.message || 'Unknown error occurred';
|
|
25
25
|
throw new Error(`Error ${response.status}: ${errorMessage}`);
|
|
26
26
|
}
|
|
27
27
|
// Extract response headers
|
|
@@ -67,10 +67,10 @@ class BiometrySDK {
|
|
|
67
67
|
user_fullname: userFullName,
|
|
68
68
|
};
|
|
69
69
|
const headers = {};
|
|
70
|
-
if (props
|
|
70
|
+
if (props?.sessionId) {
|
|
71
71
|
headers['X-Session-ID'] = props.sessionId;
|
|
72
72
|
}
|
|
73
|
-
if (props
|
|
73
|
+
if (props?.deviceInfo) {
|
|
74
74
|
headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);
|
|
75
75
|
}
|
|
76
76
|
return await this.request('/api-consent/consent', 'POST', body, headers);
|
|
@@ -97,10 +97,10 @@ class BiometrySDK {
|
|
|
97
97
|
user_fullname: userFullName,
|
|
98
98
|
};
|
|
99
99
|
const headers = {};
|
|
100
|
-
if (props
|
|
100
|
+
if (props?.sessionId) {
|
|
101
101
|
headers['X-Session-ID'] = props.sessionId;
|
|
102
102
|
}
|
|
103
|
-
if (props
|
|
103
|
+
if (props?.deviceInfo) {
|
|
104
104
|
headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);
|
|
105
105
|
}
|
|
106
106
|
return await this.request('/api-consent/strg-consent', 'POST', body, headers);
|
|
@@ -135,10 +135,10 @@ class BiometrySDK {
|
|
|
135
135
|
const headers = {
|
|
136
136
|
'X-User-Fullname': userFullName,
|
|
137
137
|
};
|
|
138
|
-
if (props
|
|
138
|
+
if (props?.sessionId) {
|
|
139
139
|
headers['X-Session-ID'] = props.sessionId;
|
|
140
140
|
}
|
|
141
|
-
if (props
|
|
141
|
+
if (props?.deviceInfo) {
|
|
142
142
|
headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);
|
|
143
143
|
}
|
|
144
144
|
return await this.request('/api-gateway/enroll/voice', 'POST', formData, headers);
|
|
@@ -169,10 +169,10 @@ class BiometrySDK {
|
|
|
169
169
|
const headers = {
|
|
170
170
|
'X-User-Fullname': userFullName,
|
|
171
171
|
};
|
|
172
|
-
if (props
|
|
172
|
+
if (props?.sessionId) {
|
|
173
173
|
headers['X-Session-ID'] = props.sessionId;
|
|
174
174
|
}
|
|
175
|
-
if (props
|
|
175
|
+
if (props?.deviceInfo) {
|
|
176
176
|
headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);
|
|
177
177
|
}
|
|
178
178
|
return await this.request('/api-gateway/enroll/face', 'POST', formData, headers);
|
|
@@ -198,10 +198,10 @@ class BiometrySDK {
|
|
|
198
198
|
const headers = {
|
|
199
199
|
'X-User-Fullname': userFullName,
|
|
200
200
|
};
|
|
201
|
-
if (props
|
|
201
|
+
if (props?.sessionId) {
|
|
202
202
|
headers['X-Session-ID'] = props.sessionId;
|
|
203
203
|
}
|
|
204
|
-
if (props
|
|
204
|
+
if (props?.deviceInfo) {
|
|
205
205
|
headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);
|
|
206
206
|
}
|
|
207
207
|
return await this.request('/api-gateway/check-doc-auth', 'POST', formData, headers);
|
|
@@ -226,7 +226,7 @@ class BiometrySDK {
|
|
|
226
226
|
throw new Error('Face image is required.');
|
|
227
227
|
if ((!usePrefilledVideo) && !video)
|
|
228
228
|
throw new Error('Video is required.');
|
|
229
|
-
if (usePrefilledVideo && !
|
|
229
|
+
if (usePrefilledVideo && !props?.sessionId)
|
|
230
230
|
throw new Error('Session ID is required to use a video from the process-video endpoint.');
|
|
231
231
|
const formData = new FormData();
|
|
232
232
|
if (video) {
|
|
@@ -240,10 +240,10 @@ class BiometrySDK {
|
|
|
240
240
|
if (usePrefilledVideo) {
|
|
241
241
|
headers['X-Use-Prefilled-Video'] = 'true';
|
|
242
242
|
}
|
|
243
|
-
if (props
|
|
243
|
+
if (props?.sessionId) {
|
|
244
244
|
headers['X-Session-ID'] = props.sessionId;
|
|
245
245
|
}
|
|
246
|
-
if (props
|
|
246
|
+
if (props?.deviceInfo) {
|
|
247
247
|
headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);
|
|
248
248
|
}
|
|
249
249
|
return await this.request('/api-gateway/match-faces', 'POST', formData, headers);
|
|
@@ -272,10 +272,10 @@ class BiometrySDK {
|
|
|
272
272
|
if (userFullName) {
|
|
273
273
|
headers['X-User-Fullname'] = userFullName;
|
|
274
274
|
}
|
|
275
|
-
if (props
|
|
275
|
+
if (props?.sessionId) {
|
|
276
276
|
headers['X-Session-ID'] = props.sessionId;
|
|
277
277
|
}
|
|
278
|
-
if (props
|
|
278
|
+
if (props?.deviceInfo) {
|
|
279
279
|
headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);
|
|
280
280
|
}
|
|
281
281
|
return await this.request('/api-gateway/process-video', 'POST', formData, headers);
|
|
@@ -284,3 +284,4 @@ class BiometrySDK {
|
|
|
284
284
|
BiometrySDK.BASE_URL = 'https://api.biometrysolutions.com'; //'https://dev-console.biometrysolutions.com';
|
|
285
285
|
|
|
286
286
|
export { BiometrySDK };
|
|
287
|
+
//# sourceMappingURL=sdk.js.map
|
package/dist/sdk.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.js","sources":["../src/sdk/index.ts"],"sourcesContent":["import { ApiResponse } from \"../types/internal\";\nimport { DocAuthInfo } from \"../types/biometry/doc-auth\";\nimport { ConsentResponse } from \"../types/biometry/consent\";\nimport { FaceEnrollmentResponse, VoiceEnrollmentResponse } from \"../types/biometry/enrollment\";\nimport { FaceMatchResponse } from \"../types/biometry/face-match\";\nimport { ProcessVideoResponse } from \"../types/biometry/process-video\";\nimport { SessionResponse } from \"../types/biometry/session\";\n\nexport class BiometrySDK {\n private apiKey: string;\n private static readonly BASE_URL: string = 'https://api.biometrysolutions.com'; //'https://dev-console.biometrysolutions.com';\n\n constructor(apiKey: string) {\n if (!apiKey) {\n throw new Error('API Key is required to initialize the SDK.');\n }\n\n this.apiKey = apiKey;\n }\n\n private async request<T>(path: string, method: string, body?: any, headers?: Record<string, string>):\n Promise<ApiResponse<T>> {\n const defaultHeaders: HeadersInit = {\n Authorization: `Bearer ${this.apiKey}`,\n };\n\n const requestHeaders = { ...defaultHeaders, ...headers };\n\n if (body && !(body instanceof FormData)) {\n requestHeaders['Content-Type'] = 'application/json';\n body = JSON.stringify(body);\n }\n const response = await fetch(`${BiometrySDK.BASE_URL}${path}`, {\n method,\n headers: requestHeaders,\n body,\n });\n\n if (!response.ok) {\n const errorData = await response.json().catch(() => ({}));\n const errorMessage = errorData?.error || errorData?.message || 'Unknown error occurred';\n\n throw new Error(`Error ${response.status}: ${errorMessage}`);\n }\n\n // Extract response headers\n const responseHeaders: Record<string, string> = {};\n const requestId = response.headers.get(\"X-Request-Id\");\n if (requestId) {\n responseHeaders[\"X-Request-Id\"] = requestId;\n }\n\n const responseBody = await response.json();\n\n return {\n body: responseBody as T,\n headers: responseHeaders\n };\n }\n\n /**\n * Starts a new Session for a user.\n * \n * @returns {Promise<ApiResponse<SessionResponse>>} A promise resolving to the session ID.\n * @throws {Error} - If the request fails.\n */\n async startSession(): Promise<ApiResponse<SessionResponse>> {\n return await this.request<SessionResponse>(\n '/api-gateway/sessions/start',\n 'POST'\n );\n }\n\n /**\n * Submits Authorization consent for a user.\n * Authorization Consent is required to use the services like Face and Voice recognition.\n * \n * @param {boolean} isConsentGiven - Indicates whether the user has given consent.\n * @param {string} userFullName - The full name of the user giving consent.\n * @param {Object} [props] - Optional properties for the consent request.\n * @param {string} [props.sessionId] - Session ID to link this consent with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<ConsentResponse>>} A promise resolving to the consent response.\n * @throws {Error} - If the user's full name is not provided or if the request fails.\n */\n async giveAuthorizationConsent(\n isConsentGiven: boolean,\n userFullName: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<ConsentResponse>> {\n if (!userFullName) {\n throw new Error('User Full Name is required to give consent.');\n }\n\n const body = {\n is_consent_given: isConsentGiven,\n user_fullname: userFullName,\n };\n\n const headers: Record<string, string> = {};\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<ConsentResponse>(\n '/api-consent/consent',\n 'POST',\n body,\n headers\n );\n }\n\n /**\n * Submits Storage consent for a user.\n * Storage consent is granted by users, allowing us to store their biometric data for future verification.\n * \n * @param {boolean} isStorageConsentGiven - Indicates whether the user has given storage consent.\n * @param {string} userFullName - The full name of the user giving storage consent.\n * @param {Object} [props] - Optional properties for the consent request.\n * @param {string} [props.sessionId] - Session ID to link this consent with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<ConsentResponse>>} A promise resolving to the consent response.\n * @throws {Error} - If the user's full name is not provided or if the request fails.\n */\n async giveStorageConsent(\n isStorageConsentGiven: boolean,\n userFullName: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<ConsentResponse>> {\n if (!userFullName) {\n throw new Error('User Full Name is required to give storage consent.');\n }\n\n const body = {\n is_consent_given: isStorageConsentGiven,\n user_fullname: userFullName,\n };\n\n const headers: Record<string, string> = {};\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<ConsentResponse>(\n '/api-consent/strg-consent',\n 'POST',\n body,\n headers\n );\n }\n\n /**\n * Enrolls a user's voice for biometric authentication.\n * \n * @param {File} audio - The audio file containing the user's voice.\n * @param {string} userFullName - The full name of the user being enrolled.\n * @param {string} uniqueId - A unique identifier for the enrolling process.\n * @param {string} phrase - The phrase spoken in the audio file.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<VoiceEnrollmentResponse>>} - A promise resolving to the voice enrolling response.\n * @throws {Error} - If required parameters are missing or the request fails.\n */\n async enrollVoice(\n audio: File,\n userFullName: string,\n uniqueId: string,\n phrase: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<VoiceEnrollmentResponse>> {\n if (!userFullName) throw new Error('User fullname is required.');\n if (!uniqueId) throw new Error('Unique ID is required.');\n if (!phrase) throw new Error('Phrase is required.');\n if (!audio) throw new Error('Audio file is required.');\n\n const formData = new FormData();\n formData.append('unique_id', uniqueId);\n formData.append('phrase', phrase);\n formData.append('voice', audio);\n\n const headers: Record<string, string> = {\n 'X-User-Fullname': userFullName,\n };\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<VoiceEnrollmentResponse>(\n '/api-gateway/enroll/voice',\n 'POST',\n formData,\n headers\n );\n }\n\n /**\n * Enrolls a user's face for biometric authentication.\n * \n * @param {File} face - Image file that contains user's face.\n * @param {string} userFullName - The full name of the user being enrolled.\n * @param {string} isDocument - Indicates whether the image is a document.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<FaceEnrollmentResponse>>} - A promise resolving to the voice enrolling response.\n * @throws {Error} - If required parameters are missing or the request fails.\n */\n async enrollFace(face: File, userFullName: string, isDocument?: boolean, props?: {\n sessionId?: string,\n deviceInfo?: object,\n }):\n Promise<ApiResponse<FaceEnrollmentResponse>> {\n if (!userFullName) throw new Error('User fullname is required.');\n if (!face) throw new Error('Face image is required.');\n\n const formData = new FormData();\n formData.append('face', face);\n if (isDocument) {\n formData.append('is_document', 'true');\n }\n\n const headers: Record<string, string> = {\n 'X-User-Fullname': userFullName,\n };\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<FaceEnrollmentResponse>(\n '/api-gateway/enroll/face',\n 'POST',\n formData,\n headers\n );\n }\n\n /**\n * Check the validity of a documents.\n * \n * @param {File} document - Document image file.\n * @param {string} userFullName - The full name of the user being checked.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<DocAuthInfo>>} - A promise resolving to the document authentication information.\n */\n async checkDocAuth(\n document: File,\n userFullName: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<DocAuthInfo>> {\n if (!document) throw new Error('Document image is required.');\n if (!userFullName) throw new Error('User fullname is required.');\n\n const formData = new FormData();\n formData.append('document', document);\n\n const headers: Record<string, string> = {\n 'X-User-Fullname': userFullName,\n };\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<DocAuthInfo>(\n '/api-gateway/check-doc-auth',\n 'POST',\n formData,\n headers\n );\n }\n\n /**\n * Matches a user's face from video against a reference image.\n * \n * @param {File} image - Reference image file that contains user's face.\n * @param {string} video - Video file that contains user's face.\n * @param {string} userFullName - Pass the full name of end-user to process Voice and Face recognition services.\n * @param {string} processVideoRequestId - ID from the response header of /process-video endpoint.\n * @param {boolean} usePrefilledVideo - Pass true to use the video from the process-video endpoint.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<FaceMatchResponse>} - A promise resolving to the voice enrolling response.\n * @throws {Error} - If required parameters are missing or the request fails.\n */\n async matchFaces(\n image: File,\n video?: File,\n userFullName?: string,\n usePrefilledVideo?: boolean,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<FaceMatchResponse>> {\n if (!image) throw new Error('Face image is required.');\n if ((!usePrefilledVideo) && !video) throw new Error('Video is required.');\n if (usePrefilledVideo && !props?.sessionId) throw new Error('Session ID is required to use a video from the process-video endpoint.');\n\n const formData = new FormData();\n if (video) {\n formData.append('video', video);\n }\n formData.append('image', image);\n\n const headers: Record<string, string> = {};\n\n if (userFullName) {\n headers['X-User-Fullname'] = userFullName;\n }\n\n if (usePrefilledVideo) {\n headers['X-Use-Prefilled-Video'] = 'true';\n }\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<FaceMatchResponse>(\n '/api-gateway/match-faces',\n 'POST',\n formData,\n headers\n );\n }\n\n /**\n * Process the video through Biometry services to check liveness and authorize user\n * \n * @param {File} video - Video file that you want to process.\n * @param {string} phrase - Set of numbers that user needs to say out loud in the video.\n * @param {string} userFullName - Pass the full name of end-user to process Voice and Face recognition services.\n * @param {Object} [props] - Optional properties for the enrollment request.\n * @param {string} [props.sessionId] - Session ID to link this enrollment with a specific session group.\n * @param {object} [props.deviceInfo] - Device information object containing details about the user's device.\n * This can include properties like operating system, browser, etc.\n * @returns {Promise<ApiResponse<ProcessVideoResponse>>} - A promise resolving to the process video response.\n */\n async processVideo(\n video: File,\n phrase: string,\n userFullName?: string,\n props?: {\n sessionId?: string,\n deviceInfo?: object,\n }\n ): Promise<ApiResponse<ProcessVideoResponse>> {\n if (!video) throw new Error('Video is required.');\n if (!phrase) throw new Error('Phrase is required.');\n\n const formData = new FormData();\n formData.append('phrase', phrase);\n formData.append('video', video);\n\n const headers: Record<string, string> = {};\n\n if (userFullName) {\n headers['X-User-Fullname'] = userFullName;\n }\n\n if (props?.sessionId) {\n headers['X-Session-ID'] = props.sessionId;\n }\n\n if (props?.deviceInfo) {\n headers['X-Device-Info'] = JSON.stringify(props.deviceInfo);\n }\n\n return await this.request<ProcessVideoResponse>(\n '/api-gateway/process-video',\n 'POST',\n formData,\n headers\n );\n }\n}"],"names":[],"mappings":"MAQa,WAAW,CAAA;AAItB,IAAA,WAAA,CAAY,MAAc,EAAA;QACxB,IAAI,CAAC,MAAM,EAAE;AACX,YAAA,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC;QAC/D;AAEA,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;IACtB;IAEQ,MAAM,OAAO,CAAI,IAAY,EAAE,MAAc,EAAE,IAAU,EAAE,OAAgC,EAAA;AAEjG,QAAA,MAAM,cAAc,GAAgB;AAClC,YAAA,aAAa,EAAE,CAAA,OAAA,EAAU,IAAI,CAAC,MAAM,CAAA,CAAE;SACvC;QAED,MAAM,cAAc,GAAG,EAAE,GAAG,cAAc,EAAE,GAAG,OAAO,EAAE;QAExD,IAAI,IAAI,IAAI,EAAE,IAAI,YAAY,QAAQ,CAAC,EAAE;AACvC,YAAA,cAAc,CAAC,cAAc,CAAC,GAAG,kBAAkB;AACnD,YAAA,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;QAC7B;AACA,QAAA,MAAM,QAAQ,GAAG,MAAM,KAAK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,QAAQ,EACR,OAAO,CACR;IACH;AAEA;;;;;;;;;;;AAWG;IACH,MAAM,YAAY,CAChB,KAAW,EACX,MAAc,EACd,YAAqB,EACrB,KAGC,EAAA;AAED,QAAA,IAAI,CAAC,KAAK;AAAE,YAAA,MAAM,IAAI,KAAK,CAAC,oBAAoB,CAAC;AACjD,QAAA,IAAI,CAAC,MAAM;AAAE,YAAA,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC;AAEnD,QAAA,MAAM,QAAQ,GAAG,IAAI,QAAQ,EAAE;AAC/B,QAAA,QAAQ,CAAC,MAAM,CAAC,QAAQ,EAAE,MAAM,CAAC;AACjC,QAAA,QAAQ,CAAC,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC;QAE/B,MAAM,OAAO,GAA2B,EAAE;QAE1C,IAAI,YAAY,EAAE;AAChB,YAAA,OAAO,CAAC,iBAAiB,CAAC,GAAG,YAAY;QAC3C;AAEA,QAAA,IAAI,KAAK,EAAE,SAAS,EAAE;AACpB,YAAA,OAAO,CAAC,cAAc,CAAC,GAAG,KAAK,CAAC,SAAS;QAC3C;AAEA,QAAA,IAAI,KAAK,EAAE,UAAU,EAAE;AACrB,YAAA,OAAO,CAAC,eAAe,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,UAAU,CAAC;QAC7D;AAEA,QAAA,OAAO,MAAM,IAAI,CAAC,OAAO,CACvB,4BAA4B,EAC5B,MAAM,EACN,QAAQ,EACR,OAAO,CACR;IACH;;AA9ZwB,WAAA,CAAA,QAAQ,GAAW,mCAAmC,CAAC;;;;"}
|
|
@@ -16,7 +16,7 @@ export declare class BiometryEnrollment extends HTMLElement {
|
|
|
16
16
|
disconnectedCallback(): void;
|
|
17
17
|
validateAttributes(): void;
|
|
18
18
|
init(): void;
|
|
19
|
-
|
|
19
|
+
cleanup(): void;
|
|
20
20
|
private attachSlotListeners;
|
|
21
21
|
private setupCamera;
|
|
22
22
|
private capturePhoto;
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "../biometry-enrollment";
|
|
3
|
+
export interface BiometryEnrollmentProps extends React.HTMLAttributes<HTMLElement> {
|
|
4
|
+
endpoint?: string;
|
|
5
|
+
userFullname?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface BiometryEnrollmentRef {
|
|
11
|
+
validateAttributes: () => void;
|
|
12
|
+
init: () => void;
|
|
13
|
+
cleanup: () => void;
|
|
14
|
+
}
|
|
15
|
+
declare const BiometryEnrollmentWrapper: React.ForwardRefExoticComponent<BiometryEnrollmentProps & React.RefAttributes<BiometryEnrollmentRef>>;
|
|
16
|
+
export default BiometryEnrollmentWrapper;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import '../process-video';
|
|
3
|
+
export interface ProcessVideoProps extends React.HTMLAttributes<HTMLElement> {
|
|
4
|
+
endpoint?: string;
|
|
5
|
+
userFullname?: string;
|
|
6
|
+
className?: string;
|
|
7
|
+
style?: React.CSSProperties;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface ProcessVideoRef {
|
|
11
|
+
startRecording: () => Promise<void>;
|
|
12
|
+
stopRecording: () => void;
|
|
13
|
+
handleSubmit: () => Promise<void>;
|
|
14
|
+
currentPhrase: string;
|
|
15
|
+
isRecording: boolean;
|
|
16
|
+
videoDuration: number | null;
|
|
17
|
+
currentFile: File | null;
|
|
18
|
+
currentStream: MediaStream | null;
|
|
19
|
+
videoElementRef: HTMLVideoElement;
|
|
20
|
+
fileInputRef: HTMLInputElement;
|
|
21
|
+
recordingTimeLimit: number;
|
|
22
|
+
setRecordingTimeLimit: (value: number) => void;
|
|
23
|
+
}
|
|
24
|
+
declare const ProcessVideoWrapper: React.ForwardRefExoticComponent<ProcessVideoProps & React.RefAttributes<ProcessVideoRef>>;
|
|
25
|
+
export default ProcessVideoWrapper;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as BiometryEnrollment } from './BiometryEnrollment';
|
|
2
|
+
export type { BiometryEnrollmentRef, BiometryEnrollmentProps } from './BiometryEnrollment';
|
|
3
|
+
export { default as ProcessVideo } from './ProcessVideo';
|
|
4
|
+
export type { ProcessVideoRef, ProcessVideoProps } from './ProcessVideo';
|
package/dist/ui.js
CHANGED
|
@@ -122,8 +122,7 @@ class BiometryEnrollment extends HTMLElement {
|
|
|
122
122
|
this.toggleState("");
|
|
123
123
|
}
|
|
124
124
|
cleanup() {
|
|
125
|
-
|
|
126
|
-
if ((_a = this.videoElement) === null || _a === undefined ? undefined : _a.srcObject) {
|
|
125
|
+
if (this.videoElement?.srcObject) {
|
|
127
126
|
const tracks = this.videoElement.srcObject.getTracks();
|
|
128
127
|
tracks.forEach((track) => track.stop());
|
|
129
128
|
}
|
|
@@ -197,8 +196,8 @@ class BiometryEnrollment extends HTMLElement {
|
|
|
197
196
|
throw new Error(`HTTP error! status: ${response.status}`);
|
|
198
197
|
}
|
|
199
198
|
const result = await response.json();
|
|
200
|
-
this.resultCode = result
|
|
201
|
-
this.description =
|
|
199
|
+
this.resultCode = result?.code;
|
|
200
|
+
this.description = result?.description || "Unknown error occurred.";
|
|
202
201
|
switch (this.resultCode) {
|
|
203
202
|
case 0:
|
|
204
203
|
this.toggleState(BiometryEnrollmentState.Success);
|
|
@@ -777,7 +776,7 @@ function requireFixWebmDuration () {
|
|
|
777
776
|
var fixWebmDurationExports = requireFixWebmDuration();
|
|
778
777
|
var ysFixWebmDuration = /*@__PURE__*/getDefaultExportFromCjs(fixWebmDurationExports);
|
|
779
778
|
|
|
780
|
-
class
|
|
779
|
+
class ProcessVideo extends HTMLElement {
|
|
781
780
|
constructor() {
|
|
782
781
|
super();
|
|
783
782
|
this.previewStream = null;
|
|
@@ -1138,9 +1137,8 @@ class ProcessVideoComponent extends HTMLElement {
|
|
|
1138
1137
|
};
|
|
1139
1138
|
}
|
|
1140
1139
|
handleFileUpload(event) {
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
if ((_b = file === null || file === undefined ? undefined : file.type) === null || _b === undefined ? undefined : _b.startsWith('video/')) {
|
|
1140
|
+
const file = event.target.files?.[0];
|
|
1141
|
+
if (file?.type?.startsWith('video/')) {
|
|
1144
1142
|
if (file.size > 100 * 1024 * 1024) { // 100MB limit
|
|
1145
1143
|
this.toggleState('error');
|
|
1146
1144
|
console.error('File size exceeds limit of 100MB');
|
|
@@ -1208,15 +1206,13 @@ class ProcessVideoComponent extends HTMLElement {
|
|
|
1208
1206
|
}
|
|
1209
1207
|
}
|
|
1210
1208
|
get isRecording() {
|
|
1211
|
-
|
|
1212
|
-
return ((_a = this.mediaRecorder) === null || _a === undefined ? undefined : _a.state) === 'recording';
|
|
1209
|
+
return this.mediaRecorder?.state === 'recording';
|
|
1213
1210
|
}
|
|
1214
1211
|
get currentPhrase() {
|
|
1215
1212
|
return this.phrase;
|
|
1216
1213
|
}
|
|
1217
1214
|
get videoDuration() {
|
|
1218
|
-
|
|
1219
|
-
return ((_a = this.videoElement) === null || _a === undefined ? undefined : _a.duration) || null;
|
|
1215
|
+
return this.videoElement?.duration || null;
|
|
1220
1216
|
}
|
|
1221
1217
|
get currentFile() {
|
|
1222
1218
|
return this.videoFile;
|
|
@@ -1243,6 +1239,7 @@ class ProcessVideoComponent extends HTMLElement {
|
|
|
1243
1239
|
}
|
|
1244
1240
|
}
|
|
1245
1241
|
}
|
|
1246
|
-
customElements.define('process-video',
|
|
1242
|
+
customElements.define('process-video', ProcessVideo);
|
|
1247
1243
|
|
|
1248
|
-
export { BiometryEnrollment,
|
|
1244
|
+
export { BiometryEnrollment, ProcessVideo };
|
|
1245
|
+
//# sourceMappingURL=ui.js.map
|