@unissey-web/sdk-angular 3.8.0-rc → 3.8.2
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 +311 -0
- package/dist/unissey-sdk/README.md +311 -0
- package/dist/unissey-sdk/package.json +20 -0
- package/package.json +69 -13
- /package/{bundles → dist/unissey-sdk/bundles}/unissey-web-sdk-angular.umd.js +0 -0
- /package/{bundles → dist/unissey-sdk/bundles}/unissey-web-sdk-angular.umd.js.map +0 -0
- /package/{esm2015 → dist/unissey-sdk/esm2015}/lib/components/button/button.component.js +0 -0
- /package/{esm2015 → dist/unissey-sdk/esm2015}/lib/components/file-upload/file-upload.component.js +0 -0
- /package/{esm2015 → dist/unissey-sdk/esm2015}/lib/components/full-capture/full-capture.component.js +0 -0
- /package/{esm2015 → dist/unissey-sdk/esm2015}/lib/components/image-capture-directions/image-capture-directions.component.js +0 -0
- /package/{esm2015 → dist/unissey-sdk/esm2015}/lib/components/picture-editor/picture-editor.component.js +0 -0
- /package/{esm2015 → dist/unissey-sdk/esm2015}/lib/components/picture-recorder/picture-recorder.component.js +0 -0
- /package/{esm2015 → dist/unissey-sdk/esm2015}/lib/components/reference-capture/reference-capture.component.js +0 -0
- /package/{esm2015 → dist/unissey-sdk/esm2015}/lib/components/retry-result/retry-result.component.js +0 -0
- /package/{esm2015 → dist/unissey-sdk/esm2015}/lib/components/selfie-capture/selfie.component.js +0 -0
- /package/{esm2015 → dist/unissey-sdk/esm2015}/lib/components/unissey-sdk-widget.component.js +0 -0
- /package/{esm2015 → dist/unissey-sdk/esm2015}/lib/components/video-capture-directions/video-capture-directions.component.js +0 -0
- /package/{esm2015 → dist/unissey-sdk/esm2015}/lib/components/video-recorder/video-recorder.component.js +0 -0
- /package/{esm2015 → dist/unissey-sdk/esm2015}/lib/translations/en.js +0 -0
- /package/{esm2015 → dist/unissey-sdk/esm2015}/lib/unissey-sdk.module.js +0 -0
- /package/{esm2015 → dist/unissey-sdk/esm2015}/lib/unissey-sdk.service.js +0 -0
- /package/{esm2015 → dist/unissey-sdk/esm2015}/lib/utils/components.js +0 -0
- /package/{esm2015 → dist/unissey-sdk/esm2015}/lib/utils/types.js +0 -0
- /package/{esm2015 → dist/unissey-sdk/esm2015}/public-api.js +0 -0
- /package/{esm2015 → dist/unissey-sdk/esm2015}/unissey-web-sdk-angular.js +0 -0
- /package/{fesm2015 → dist/unissey-sdk/fesm2015}/unissey-web-sdk-angular.js +0 -0
- /package/{fesm2015 → dist/unissey-sdk/fesm2015}/unissey-web-sdk-angular.js.map +0 -0
- /package/{lib → dist/unissey-sdk/lib}/components/button/button.component.d.ts +0 -0
- /package/{lib → dist/unissey-sdk/lib}/components/file-upload/file-upload.component.d.ts +0 -0
- /package/{lib → dist/unissey-sdk/lib}/components/full-capture/full-capture.component.d.ts +0 -0
- /package/{lib → dist/unissey-sdk/lib}/components/image-capture-directions/image-capture-directions.component.d.ts +0 -0
- /package/{lib → dist/unissey-sdk/lib}/components/picture-editor/picture-editor.component.d.ts +0 -0
- /package/{lib → dist/unissey-sdk/lib}/components/picture-recorder/picture-recorder.component.d.ts +0 -0
- /package/{lib → dist/unissey-sdk/lib}/components/reference-capture/reference-capture.component.d.ts +0 -0
- /package/{lib → dist/unissey-sdk/lib}/components/retry-result/retry-result.component.d.ts +0 -0
- /package/{lib → dist/unissey-sdk/lib}/components/selfie-capture/selfie.component.d.ts +0 -0
- /package/{lib → dist/unissey-sdk/lib}/components/unissey-sdk-widget.component.d.ts +0 -0
- /package/{lib → dist/unissey-sdk/lib}/components/video-capture-directions/video-capture-directions.component.d.ts +0 -0
- /package/{lib → dist/unissey-sdk/lib}/components/video-recorder/video-recorder.component.d.ts +0 -0
- /package/{lib → dist/unissey-sdk/lib}/translations/en.d.ts +0 -0
- /package/{lib → dist/unissey-sdk/lib}/unissey-sdk.module.d.ts +0 -0
- /package/{lib → dist/unissey-sdk/lib}/unissey-sdk.service.d.ts +0 -0
- /package/{lib → dist/unissey-sdk/lib}/utils/components.d.ts +0 -0
- /package/{lib → dist/unissey-sdk/lib}/utils/types.d.ts +0 -0
- /package/{public-api.d.ts → dist/unissey-sdk/public-api.d.ts} +0 -0
- /package/{unissey-web-sdk-angular.d.ts → dist/unissey-sdk/unissey-web-sdk-angular.d.ts} +0 -0
package/README.md
ADDED
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
# `@unissey-web/sdk-angular__next`
|
|
2
|
+
|
|
3
|
+
> Unissey's Angular Library
|
|
4
|
+
|
|
5
|
+
1. [Installation](#1-installation)
|
|
6
|
+
2. [Getting Started](#2-getting-started)
|
|
7
|
+
3. [Reference](#3-reference)
|
|
8
|
+
4. [About](#4-about)
|
|
9
|
+
|
|
10
|
+
# 1. Installation
|
|
11
|
+
|
|
12
|
+
## Get a personnal access token
|
|
13
|
+
|
|
14
|
+
First generate an access token by following [this link](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). Make sure to include at least the `repo` && `read:packages` permission to the access token.
|
|
15
|
+
|
|
16
|
+
Then, to get access permissions, you will need to contact someone from the Unissey organisation with your github account name.
|
|
17
|
+
|
|
18
|
+
## Authenticate to the registry
|
|
19
|
+
|
|
20
|
+
```shell
|
|
21
|
+
# set your repository token environnement variable
|
|
22
|
+
export NPM_TOKEN=repositoryToken
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then reference the new registry in a `.npmrc` in your project directory
|
|
26
|
+
|
|
27
|
+
```shell
|
|
28
|
+
//npm.pkg.github.com/:_authToken=${NPM_TOKEN}
|
|
29
|
+
@unissey:registry=https://npm.pkg.github.com
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
.
|
|
33
|
+
|
|
34
|
+
## Download the package
|
|
35
|
+
|
|
36
|
+
```shell
|
|
37
|
+
npm install @unissey-web/sdk-angular__next
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
# 2. Getting Started
|
|
41
|
+
|
|
42
|
+
## Required configuration
|
|
43
|
+
|
|
44
|
+
This library requires polyfills to work correctly. At the moment this library only needs polyfills for async functions.
|
|
45
|
+
We recommend to add one of the following package in your application dependencies:
|
|
46
|
+
|
|
47
|
+
- `babel-polyfill`
|
|
48
|
+
- `regenerator-runtime`
|
|
49
|
+
|
|
50
|
+
```shell
|
|
51
|
+
npm install babel-polyfill
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
or
|
|
55
|
+
|
|
56
|
+
```shell
|
|
57
|
+
npm install regenerator-runtime
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
And then import one the dependency in your polyfill file:
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
import "babel-polyfill";
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
or
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
import "regenerator-runtime/runtime";
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
After that, all you need is to register the UnisseySdkModule in your application module.
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
import { NgModule } from "@angular/core";
|
|
76
|
+
import { BrowserModule } from "@angular/platform-browser";
|
|
77
|
+
import { AppRoutingModule } from "./app-routing.module";
|
|
78
|
+
import { AppComponent } from "./app.component";
|
|
79
|
+
|
|
80
|
+
import { UnisseySdkModule } from "@unissey-web/sdk-angular__next"; // Unissey's SDK module
|
|
81
|
+
|
|
82
|
+
@NgModule({
|
|
83
|
+
declarations: [AppComponent],
|
|
84
|
+
// We need to register the Unissey SDK module in the Angular module
|
|
85
|
+
imports: [BrowserModule, AppRoutingModule, UnisseySdkModule],
|
|
86
|
+
providers: [],
|
|
87
|
+
bootstrap: [AppComponent],
|
|
88
|
+
})
|
|
89
|
+
export class AppModule {}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
# 3. Reference
|
|
93
|
+
|
|
94
|
+
These is the list of all components present in the public API:
|
|
95
|
+
|
|
96
|
+
## Liveness
|
|
97
|
+
|
|
98
|
+
Component responsible to record a selfie
|
|
99
|
+
|
|
100
|
+
```html
|
|
101
|
+
<unissey-liveness></unissey-liveness>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Reference
|
|
105
|
+
|
|
106
|
+
| Property type | Name | Default value | Type | Description |
|
|
107
|
+
| ------------- | ------- | ------------------------------------------------ | ------------------------------------ | --------------------------------------------------------------------- |
|
|
108
|
+
| `Input` | strings | [see LivenessStrings defaults](#livenessstrings) | [LivenessStrings](#livenessstrings) | Text to be displayed for the instructions and actions |
|
|
109
|
+
| `Output` | record | `N/A` | (event: [Capture](#capture)) => void | Callback triggered when the liveness selfie was successfully recorded |
|
|
110
|
+
|
|
111
|
+
### Customizations
|
|
112
|
+
|
|
113
|
+
You can override the default instructions and add custom actions next to the record button.
|
|
114
|
+
To do so, you must add a child element, within the `unissey-liveness` tag, with the attribute `slot="custom-instructions"`, as the example below:
|
|
115
|
+
|
|
116
|
+
```html
|
|
117
|
+
<unissey-liveness (record)="onRecord($event)">
|
|
118
|
+
<div slot="custom-instructions">
|
|
119
|
+
<p>Time for a selfie!</p>
|
|
120
|
+
</div>
|
|
121
|
+
</unissey-liveness>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
You can also add custom actions near the record button, which could be usefull to exit the liveness process.
|
|
125
|
+
Just like for the custom instructions, you need to a child element with the attribute `slot="instructions-actions"`, as the example below:
|
|
126
|
+
|
|
127
|
+
```html
|
|
128
|
+
<unissey-liveness (record)="onRecord($event)">
|
|
129
|
+
<div slot="instructions-actions">
|
|
130
|
+
<button (click)="goBackToHome()">Back</button>
|
|
131
|
+
</div>
|
|
132
|
+
</unissey-liveness>
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
You can also combine both custom instructions & actions, as the example below:
|
|
136
|
+
|
|
137
|
+
```html
|
|
138
|
+
<unissey-liveness (record)="onRecord($event)">
|
|
139
|
+
<div slot="custom-instructions">
|
|
140
|
+
<p>Time for a selfie!</p>
|
|
141
|
+
</div>
|
|
142
|
+
<div slot="instructions-actions">
|
|
143
|
+
<button (click)="goBackToHome()">Back</button>
|
|
144
|
+
</div>
|
|
145
|
+
</unissey-liveness>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Reference Capture
|
|
149
|
+
|
|
150
|
+
Component responsible to take either a photo or a short video of a reference document (e.g. ID card, Driving license...)
|
|
151
|
+
|
|
152
|
+
```html
|
|
153
|
+
<unissey-reference-capture></unissey-reference-capture>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Reference
|
|
157
|
+
|
|
158
|
+
| Property type | Name | Default value | Type | Description |
|
|
159
|
+
| ------------- | --------- | ---------------------------------------------------------------- | ------------------------------------------------------------------ | --------------------------------------------------------------- |
|
|
160
|
+
| `Input` | strings | [see ReferenceCaptureStrings defaults](#referenceCaptureStrings) | [ReferenceCaptureStrings](#referencecapturestrings) | Text to be displayed for the instructions and actions |
|
|
161
|
+
| `Output` | reference | `N/A` | (event: [ReferenceCaptureResult](#referencecaptureresult)) => void | Callback triggered when the reference was successfully recorded |
|
|
162
|
+
|
|
163
|
+
### Customizations
|
|
164
|
+
|
|
165
|
+
You can override the default instructions and add custom actions next to the record button.
|
|
166
|
+
To do so, you must add a child element, within the `unissey-liveness` tag, with the attribute `slot="custom-instructions"`, as the example below:
|
|
167
|
+
|
|
168
|
+
```html
|
|
169
|
+
<unissey-reference-capture reference="onReference($event)">
|
|
170
|
+
<div slot="custom-instructions">
|
|
171
|
+
<p>Time for a selfie!</p>
|
|
172
|
+
</div>
|
|
173
|
+
</unissey-reference-capture>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
You can also add custom actions near the record button, which could be usefull to exit the liveness process.
|
|
177
|
+
Just like for the custom instructions, you need to a child element with the attribute `slot="instructions-actions"`, as the example below:
|
|
178
|
+
|
|
179
|
+
```html
|
|
180
|
+
<unissey-reference-capture reference="onReference($event)">
|
|
181
|
+
<div slot="instructions-actions">
|
|
182
|
+
<button (click)="goBackToHome()">Back</button>
|
|
183
|
+
</div>
|
|
184
|
+
</unissey-reference-capture>
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
You can also combine both custom instructions & actions, as the example below:
|
|
188
|
+
|
|
189
|
+
```html
|
|
190
|
+
<unissey-reference-capture reference="onReference($event)">
|
|
191
|
+
<div slot="custom-instructions">
|
|
192
|
+
<p>Time for a selfie!</p>
|
|
193
|
+
</div>
|
|
194
|
+
<div slot="instructions-actions">
|
|
195
|
+
<button (click)="goBackToHome()">Back</button>
|
|
196
|
+
</div>
|
|
197
|
+
</unissey-reference-capture>
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Full Capture
|
|
201
|
+
|
|
202
|
+
Component responsible to take both a liveness selfie & a reference media
|
|
203
|
+
|
|
204
|
+
```html
|
|
205
|
+
<unissey-full-capture></unissey-full-capture>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Reference
|
|
209
|
+
|
|
210
|
+
| Property type | Name | Default value | Type | Description |
|
|
211
|
+
| ------------- | --------- | ------------------------------------------------------ | ------------------------------------------------------------------ | --------------------------------------------------------------------- |
|
|
212
|
+
| `Input` | strings | [see FullCaptureStrings defaults](#fullcapturestrings) | [FullCaptureStrings](#fullcapturestrings) | Text to be displayed for the instructions and actions |
|
|
213
|
+
| `Output` | reference | `N/A` | (event: [ReferenceCaptureResult](#referencecaptureresult)) => void | Callback triggered when the reference was successfully recorded |
|
|
214
|
+
| `Output` | target | `N/A` | (event: [Capture](#capture)) => void | Callback triggered when the liveness selfie was successfully recorded |
|
|
215
|
+
|
|
216
|
+
### Example:
|
|
217
|
+
|
|
218
|
+
```html
|
|
219
|
+
<unissey-full-capture (reference)="onReference($event)" (target)="onLiveness($event)"></unissey-full-capture>
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Capture
|
|
223
|
+
|
|
224
|
+
```typescript
|
|
225
|
+
type Capture = {
|
|
226
|
+
video: Blob;
|
|
227
|
+
metadata: unknown;
|
|
228
|
+
};
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## LivenessStrings
|
|
232
|
+
|
|
233
|
+
```typescript
|
|
234
|
+
type LivenessStrings = {
|
|
235
|
+
back: string;
|
|
236
|
+
directionSubtitle: string;
|
|
237
|
+
recordBtnLabel: string;
|
|
238
|
+
title: string;
|
|
239
|
+
recordSubtitle: string;
|
|
240
|
+
};
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## ReferenceCaptureStrings
|
|
244
|
+
|
|
245
|
+
```typescript
|
|
246
|
+
type ReferenceCaptureStrings = {
|
|
247
|
+
back: string;
|
|
248
|
+
title: string;
|
|
249
|
+
captureTitle: string;
|
|
250
|
+
editorTitle: string;
|
|
251
|
+
directionSubtitle: string;
|
|
252
|
+
pictureRecordSubtitle: string;
|
|
253
|
+
videoRecordSubtitle: string;
|
|
254
|
+
uploadBtn: string;
|
|
255
|
+
pictureBtn: string;
|
|
256
|
+
recordVidBtn: string;
|
|
257
|
+
retryPictureCaptureBtn: string;
|
|
258
|
+
retryVideoCaptureBtn: string;
|
|
259
|
+
replayValidation: string;
|
|
260
|
+
editor: {
|
|
261
|
+
validate: string;
|
|
262
|
+
};
|
|
263
|
+
directions: {
|
|
264
|
+
document: string;
|
|
265
|
+
face: string;
|
|
266
|
+
light: string;
|
|
267
|
+
};
|
|
268
|
+
videoRecorder: {
|
|
269
|
+
capture: string;
|
|
270
|
+
retry: string;
|
|
271
|
+
errors: {
|
|
272
|
+
noFace: string;
|
|
273
|
+
};
|
|
274
|
+
hints: {
|
|
275
|
+
up: string;
|
|
276
|
+
down: string;
|
|
277
|
+
perfect: string;
|
|
278
|
+
right: string;
|
|
279
|
+
left: string;
|
|
280
|
+
closer: string;
|
|
281
|
+
record: string;
|
|
282
|
+
nil: string;
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
pictureRecorder: {
|
|
286
|
+
validate: string;
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
## FullCaptureStrings
|
|
292
|
+
|
|
293
|
+
```typescript
|
|
294
|
+
type FullCaptureStrings = {
|
|
295
|
+
liveness: LivenessStrings;
|
|
296
|
+
reference: ReferenceCaptureStrings;
|
|
297
|
+
};
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
## ReferenceCaptureResult
|
|
301
|
+
|
|
302
|
+
```typescript
|
|
303
|
+
type ReferenceCaptureResult = { kind: "video"; capture: Capture } | { kind: "picture"; picture: Blob };
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
# 4. About
|
|
307
|
+
|
|
308
|
+
## Versions
|
|
309
|
+
|
|
310
|
+
| Version | Date | Description |
|
|
311
|
+
| ------- | ---- | ----------- |
|
|
@@ -0,0 +1,311 @@
|
|
|
1
|
+
# `@unissey-web/sdk-angular__next`
|
|
2
|
+
|
|
3
|
+
> Unissey's Angular Library
|
|
4
|
+
|
|
5
|
+
1. [Installation](#1-installation)
|
|
6
|
+
2. [Getting Started](#2-getting-started)
|
|
7
|
+
3. [Reference](#3-reference)
|
|
8
|
+
4. [About](#4-about)
|
|
9
|
+
|
|
10
|
+
# 1. Installation
|
|
11
|
+
|
|
12
|
+
## Get a personnal access token
|
|
13
|
+
|
|
14
|
+
First generate an access token by following [this link](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line). Make sure to include at least the `repo` && `read:packages` permission to the access token.
|
|
15
|
+
|
|
16
|
+
Then, to get access permissions, you will need to contact someone from the Unissey organisation with your github account name.
|
|
17
|
+
|
|
18
|
+
## Authenticate to the registry
|
|
19
|
+
|
|
20
|
+
```shell
|
|
21
|
+
# set your repository token environnement variable
|
|
22
|
+
export NPM_TOKEN=repositoryToken
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Then reference the new registry in a `.npmrc` in your project directory
|
|
26
|
+
|
|
27
|
+
```shell
|
|
28
|
+
//npm.pkg.github.com/:_authToken=${NPM_TOKEN}
|
|
29
|
+
@unissey:registry=https://npm.pkg.github.com
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
.
|
|
33
|
+
|
|
34
|
+
## Download the package
|
|
35
|
+
|
|
36
|
+
```shell
|
|
37
|
+
npm install @unissey-web/sdk-angular__next
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
# 2. Getting Started
|
|
41
|
+
|
|
42
|
+
## Required configuration
|
|
43
|
+
|
|
44
|
+
This library requires polyfills to work correctly. At the moment this library only needs polyfills for async functions.
|
|
45
|
+
We recommend to add one of the following package in your application dependencies:
|
|
46
|
+
|
|
47
|
+
- `babel-polyfill`
|
|
48
|
+
- `regenerator-runtime`
|
|
49
|
+
|
|
50
|
+
```shell
|
|
51
|
+
npm install babel-polyfill
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
or
|
|
55
|
+
|
|
56
|
+
```shell
|
|
57
|
+
npm install regenerator-runtime
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
And then import one the dependency in your polyfill file:
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
import "babel-polyfill";
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
or
|
|
67
|
+
|
|
68
|
+
```typescript
|
|
69
|
+
import "regenerator-runtime/runtime";
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
After that, all you need is to register the UnisseySdkModule in your application module.
|
|
73
|
+
|
|
74
|
+
```typescript
|
|
75
|
+
import { NgModule } from "@angular/core";
|
|
76
|
+
import { BrowserModule } from "@angular/platform-browser";
|
|
77
|
+
import { AppRoutingModule } from "./app-routing.module";
|
|
78
|
+
import { AppComponent } from "./app.component";
|
|
79
|
+
|
|
80
|
+
import { UnisseySdkModule } from "@unissey-web/sdk-angular__next"; // Unissey's SDK module
|
|
81
|
+
|
|
82
|
+
@NgModule({
|
|
83
|
+
declarations: [AppComponent],
|
|
84
|
+
// We need to register the Unissey SDK module in the Angular module
|
|
85
|
+
imports: [BrowserModule, AppRoutingModule, UnisseySdkModule],
|
|
86
|
+
providers: [],
|
|
87
|
+
bootstrap: [AppComponent],
|
|
88
|
+
})
|
|
89
|
+
export class AppModule {}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
# 3. Reference
|
|
93
|
+
|
|
94
|
+
These is the list of all components present in the public API:
|
|
95
|
+
|
|
96
|
+
## Liveness
|
|
97
|
+
|
|
98
|
+
Component responsible to record a selfie
|
|
99
|
+
|
|
100
|
+
```html
|
|
101
|
+
<unissey-liveness></unissey-liveness>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### Reference
|
|
105
|
+
|
|
106
|
+
| Property type | Name | Default value | Type | Description |
|
|
107
|
+
| ------------- | ------- | ------------------------------------------------ | ------------------------------------ | --------------------------------------------------------------------- |
|
|
108
|
+
| `Input` | strings | [see LivenessStrings defaults](#livenessstrings) | [LivenessStrings](#livenessstrings) | Text to be displayed for the instructions and actions |
|
|
109
|
+
| `Output` | record | `N/A` | (event: [Capture](#capture)) => void | Callback triggered when the liveness selfie was successfully recorded |
|
|
110
|
+
|
|
111
|
+
### Customizations
|
|
112
|
+
|
|
113
|
+
You can override the default instructions and add custom actions next to the record button.
|
|
114
|
+
To do so, you must add a child element, within the `unissey-liveness` tag, with the attribute `slot="custom-instructions"`, as the example below:
|
|
115
|
+
|
|
116
|
+
```html
|
|
117
|
+
<unissey-liveness (record)="onRecord($event)">
|
|
118
|
+
<div slot="custom-instructions">
|
|
119
|
+
<p>Time for a selfie!</p>
|
|
120
|
+
</div>
|
|
121
|
+
</unissey-liveness>
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
You can also add custom actions near the record button, which could be usefull to exit the liveness process.
|
|
125
|
+
Just like for the custom instructions, you need to a child element with the attribute `slot="instructions-actions"`, as the example below:
|
|
126
|
+
|
|
127
|
+
```html
|
|
128
|
+
<unissey-liveness (record)="onRecord($event)">
|
|
129
|
+
<div slot="instructions-actions">
|
|
130
|
+
<button (click)="goBackToHome()">Back</button>
|
|
131
|
+
</div>
|
|
132
|
+
</unissey-liveness>
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
You can also combine both custom instructions & actions, as the example below:
|
|
136
|
+
|
|
137
|
+
```html
|
|
138
|
+
<unissey-liveness (record)="onRecord($event)">
|
|
139
|
+
<div slot="custom-instructions">
|
|
140
|
+
<p>Time for a selfie!</p>
|
|
141
|
+
</div>
|
|
142
|
+
<div slot="instructions-actions">
|
|
143
|
+
<button (click)="goBackToHome()">Back</button>
|
|
144
|
+
</div>
|
|
145
|
+
</unissey-liveness>
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
## Reference Capture
|
|
149
|
+
|
|
150
|
+
Component responsible to take either a photo or a short video of a reference document (e.g. ID card, Driving license...)
|
|
151
|
+
|
|
152
|
+
```html
|
|
153
|
+
<unissey-reference-capture></unissey-reference-capture>
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
### Reference
|
|
157
|
+
|
|
158
|
+
| Property type | Name | Default value | Type | Description |
|
|
159
|
+
| ------------- | --------- | ---------------------------------------------------------------- | ------------------------------------------------------------------ | --------------------------------------------------------------- |
|
|
160
|
+
| `Input` | strings | [see ReferenceCaptureStrings defaults](#referenceCaptureStrings) | [ReferenceCaptureStrings](#referencecapturestrings) | Text to be displayed for the instructions and actions |
|
|
161
|
+
| `Output` | reference | `N/A` | (event: [ReferenceCaptureResult](#referencecaptureresult)) => void | Callback triggered when the reference was successfully recorded |
|
|
162
|
+
|
|
163
|
+
### Customizations
|
|
164
|
+
|
|
165
|
+
You can override the default instructions and add custom actions next to the record button.
|
|
166
|
+
To do so, you must add a child element, within the `unissey-liveness` tag, with the attribute `slot="custom-instructions"`, as the example below:
|
|
167
|
+
|
|
168
|
+
```html
|
|
169
|
+
<unissey-reference-capture reference="onReference($event)">
|
|
170
|
+
<div slot="custom-instructions">
|
|
171
|
+
<p>Time for a selfie!</p>
|
|
172
|
+
</div>
|
|
173
|
+
</unissey-reference-capture>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
You can also add custom actions near the record button, which could be usefull to exit the liveness process.
|
|
177
|
+
Just like for the custom instructions, you need to a child element with the attribute `slot="instructions-actions"`, as the example below:
|
|
178
|
+
|
|
179
|
+
```html
|
|
180
|
+
<unissey-reference-capture reference="onReference($event)">
|
|
181
|
+
<div slot="instructions-actions">
|
|
182
|
+
<button (click)="goBackToHome()">Back</button>
|
|
183
|
+
</div>
|
|
184
|
+
</unissey-reference-capture>
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
You can also combine both custom instructions & actions, as the example below:
|
|
188
|
+
|
|
189
|
+
```html
|
|
190
|
+
<unissey-reference-capture reference="onReference($event)">
|
|
191
|
+
<div slot="custom-instructions">
|
|
192
|
+
<p>Time for a selfie!</p>
|
|
193
|
+
</div>
|
|
194
|
+
<div slot="instructions-actions">
|
|
195
|
+
<button (click)="goBackToHome()">Back</button>
|
|
196
|
+
</div>
|
|
197
|
+
</unissey-reference-capture>
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
## Full Capture
|
|
201
|
+
|
|
202
|
+
Component responsible to take both a liveness selfie & a reference media
|
|
203
|
+
|
|
204
|
+
```html
|
|
205
|
+
<unissey-full-capture></unissey-full-capture>
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
### Reference
|
|
209
|
+
|
|
210
|
+
| Property type | Name | Default value | Type | Description |
|
|
211
|
+
| ------------- | --------- | ------------------------------------------------------ | ------------------------------------------------------------------ | --------------------------------------------------------------------- |
|
|
212
|
+
| `Input` | strings | [see FullCaptureStrings defaults](#fullcapturestrings) | [FullCaptureStrings](#fullcapturestrings) | Text to be displayed for the instructions and actions |
|
|
213
|
+
| `Output` | reference | `N/A` | (event: [ReferenceCaptureResult](#referencecaptureresult)) => void | Callback triggered when the reference was successfully recorded |
|
|
214
|
+
| `Output` | target | `N/A` | (event: [Capture](#capture)) => void | Callback triggered when the liveness selfie was successfully recorded |
|
|
215
|
+
|
|
216
|
+
### Example:
|
|
217
|
+
|
|
218
|
+
```html
|
|
219
|
+
<unissey-full-capture (reference)="onReference($event)" (target)="onLiveness($event)"></unissey-full-capture>
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
## Capture
|
|
223
|
+
|
|
224
|
+
```typescript
|
|
225
|
+
type Capture = {
|
|
226
|
+
video: Blob;
|
|
227
|
+
metadata: unknown;
|
|
228
|
+
};
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## LivenessStrings
|
|
232
|
+
|
|
233
|
+
```typescript
|
|
234
|
+
type LivenessStrings = {
|
|
235
|
+
back: string;
|
|
236
|
+
directionSubtitle: string;
|
|
237
|
+
recordBtnLabel: string;
|
|
238
|
+
title: string;
|
|
239
|
+
recordSubtitle: string;
|
|
240
|
+
};
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
## ReferenceCaptureStrings
|
|
244
|
+
|
|
245
|
+
```typescript
|
|
246
|
+
type ReferenceCaptureStrings = {
|
|
247
|
+
back: string;
|
|
248
|
+
title: string;
|
|
249
|
+
captureTitle: string;
|
|
250
|
+
editorTitle: string;
|
|
251
|
+
directionSubtitle: string;
|
|
252
|
+
pictureRecordSubtitle: string;
|
|
253
|
+
videoRecordSubtitle: string;
|
|
254
|
+
uploadBtn: string;
|
|
255
|
+
pictureBtn: string;
|
|
256
|
+
recordVidBtn: string;
|
|
257
|
+
retryPictureCaptureBtn: string;
|
|
258
|
+
retryVideoCaptureBtn: string;
|
|
259
|
+
replayValidation: string;
|
|
260
|
+
editor: {
|
|
261
|
+
validate: string;
|
|
262
|
+
};
|
|
263
|
+
directions: {
|
|
264
|
+
document: string;
|
|
265
|
+
face: string;
|
|
266
|
+
light: string;
|
|
267
|
+
};
|
|
268
|
+
videoRecorder: {
|
|
269
|
+
capture: string;
|
|
270
|
+
retry: string;
|
|
271
|
+
errors: {
|
|
272
|
+
noFace: string;
|
|
273
|
+
};
|
|
274
|
+
hints: {
|
|
275
|
+
up: string;
|
|
276
|
+
down: string;
|
|
277
|
+
perfect: string;
|
|
278
|
+
right: string;
|
|
279
|
+
left: string;
|
|
280
|
+
closer: string;
|
|
281
|
+
record: string;
|
|
282
|
+
nil: string;
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
pictureRecorder: {
|
|
286
|
+
validate: string;
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
## FullCaptureStrings
|
|
292
|
+
|
|
293
|
+
```typescript
|
|
294
|
+
type FullCaptureStrings = {
|
|
295
|
+
liveness: LivenessStrings;
|
|
296
|
+
reference: ReferenceCaptureStrings;
|
|
297
|
+
};
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
## ReferenceCaptureResult
|
|
301
|
+
|
|
302
|
+
```typescript
|
|
303
|
+
type ReferenceCaptureResult = { kind: "video"; capture: Capture } | { kind: "picture"; picture: Blob };
|
|
304
|
+
```
|
|
305
|
+
|
|
306
|
+
# 4. About
|
|
307
|
+
|
|
308
|
+
## Versions
|
|
309
|
+
|
|
310
|
+
| Version | Date | Description |
|
|
311
|
+
| ------- | ---- | ----------- |
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@unissey-web/sdk-angular",
|
|
3
|
+
"description": "Unissey's Angular SDK",
|
|
4
|
+
"version": "3.8.2",
|
|
5
|
+
"peerDependencies": {
|
|
6
|
+
"@angular/common": "^12.1.1 || ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0",
|
|
7
|
+
"@angular/core": "^12.1.1 || ^13.0.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"tslib": "^2.0.0",
|
|
11
|
+
"@unissey-web/web-components": "3.8.2"
|
|
12
|
+
},
|
|
13
|
+
"main": "bundles/unissey-web-sdk-angular.umd.js",
|
|
14
|
+
"module": "fesm2015/unissey-web-sdk-angular.js",
|
|
15
|
+
"es2015": "fesm2015/unissey-web-sdk-angular.js",
|
|
16
|
+
"esm2015": "esm2015/unissey-web-sdk-angular.js",
|
|
17
|
+
"fesm2015": "fesm2015/unissey-web-sdk-angular.js",
|
|
18
|
+
"typings": "unissey-web-sdk-angular.d.ts",
|
|
19
|
+
"sideEffects": false
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,20 +1,76 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unissey-web/sdk-angular",
|
|
3
|
+
"version": "3.8.2",
|
|
3
4
|
"description": "Unissey's Angular SDK",
|
|
4
|
-
"
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
"files": [
|
|
6
|
+
"dist"
|
|
7
|
+
],
|
|
8
|
+
"scripts": {
|
|
9
|
+
"ng": "ng",
|
|
10
|
+
"start": "ng serve",
|
|
11
|
+
"dev": "rimraf storybook-static && npm run docs:json && start-storybook -p 6009 --ci",
|
|
12
|
+
"build": "ng build",
|
|
13
|
+
"build:pkgs": "rimraf dist && npm run build -- --configuration=production",
|
|
14
|
+
"postbuild:pkgs": "npm run update-wc-version",
|
|
15
|
+
"prepublishOnly": "node ./lifecycles/prepublishOnly.js",
|
|
16
|
+
"build:pkg": "rimraf dist && npm run build",
|
|
17
|
+
"test": "ng test --no-watch --no-progress --browsers ChromeHeadless",
|
|
18
|
+
"lint": "ng lint",
|
|
19
|
+
"docs:html": "compodoc -p ./tsconfig.json -d docs",
|
|
20
|
+
"docs:json": "compodoc -p ./tsconfig.json -e json -d .",
|
|
21
|
+
"storybook": "rimraf storybook-static && npm run docs:json && start-storybook -p 6009 --ci",
|
|
22
|
+
"build:storybook": "npm run docs:json && build-storybook",
|
|
23
|
+
"update-wc-version": "node update-web-component.mjs"
|
|
8
24
|
},
|
|
25
|
+
"publishConfig": {
|
|
26
|
+
"directory": "dist/unissey-sdk"
|
|
27
|
+
},
|
|
28
|
+
"license": "ISC",
|
|
29
|
+
"private": false,
|
|
9
30
|
"dependencies": {
|
|
31
|
+
"@angular/animations": "~12.2.17",
|
|
32
|
+
"@angular/common": "~12.2.17",
|
|
33
|
+
"@angular/compiler": "~12.2.17",
|
|
34
|
+
"@angular/core": "~12.2.17",
|
|
35
|
+
"@angular/forms": "~12.2.17",
|
|
36
|
+
"@angular/platform-browser": "~12.2.17",
|
|
37
|
+
"@angular/platform-browser-dynamic": "~12.2.17",
|
|
38
|
+
"@angular/router": "~12.2.17",
|
|
39
|
+
"@storybook/addon-docs": "^6.5.15",
|
|
40
|
+
"@storybook/builder-webpack5": "^6.5.15",
|
|
41
|
+
"@storybook/manager-webpack5": "^6.5.15",
|
|
42
|
+
"rxjs": "~6.6.0",
|
|
10
43
|
"tslib": "^2.0.0",
|
|
11
|
-
"
|
|
44
|
+
"zone.js": "~0.11.3",
|
|
45
|
+
"@unissey-web/web-components": "file:packages/web-components"
|
|
12
46
|
},
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@angular-devkit/build-angular": "~12.2.18",
|
|
49
|
+
"@angular/cli": "~12.2.18",
|
|
50
|
+
"@angular/compiler-cli": "~12.2.17",
|
|
51
|
+
"@babel/core": "^7.17.0",
|
|
52
|
+
"@compodoc/compodoc": "^1.1.18",
|
|
53
|
+
"@storybook/addon-actions": "^6.4.18",
|
|
54
|
+
"@storybook/addon-cssresources": "^6.2.9",
|
|
55
|
+
"@storybook/addon-essentials": "^6.4.18",
|
|
56
|
+
"@storybook/addon-links": "^6.4.18",
|
|
57
|
+
"@storybook/addon-postcss": "^2.0.0",
|
|
58
|
+
"@storybook/angular": "^6.4.18",
|
|
59
|
+
"@types/jasmine": "~3.6.0",
|
|
60
|
+
"@types/node": "^12.11.1",
|
|
61
|
+
"babel-loader": "^8.2.3",
|
|
62
|
+
"codelyzer": "^6.0.0",
|
|
63
|
+
"jasmine-core": "~3.8.0",
|
|
64
|
+
"jasmine-spec-reporter": "~5.0.0",
|
|
65
|
+
"karma": "~6.4.1",
|
|
66
|
+
"karma-chrome-launcher": "~3.1.0",
|
|
67
|
+
"karma-coverage": "~2.0.3",
|
|
68
|
+
"karma-jasmine": "~4.0.0",
|
|
69
|
+
"karma-jasmine-html-reporter": "^1.7.0",
|
|
70
|
+
"ng-packagr": "^12.2.7",
|
|
71
|
+
"protractor": "~7.0.0",
|
|
72
|
+
"ts-node": "~8.3.0",
|
|
73
|
+
"tslint": "~6.1.0",
|
|
74
|
+
"typescript": "~4.3.5"
|
|
75
|
+
}
|
|
76
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{esm2015 → dist/unissey-sdk/esm2015}/lib/components/file-upload/file-upload.component.js
RENAMED
|
File without changes
|
/package/{esm2015 → dist/unissey-sdk/esm2015}/lib/components/full-capture/full-capture.component.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{esm2015 → dist/unissey-sdk/esm2015}/lib/components/retry-result/retry-result.component.js
RENAMED
|
File without changes
|
/package/{esm2015 → dist/unissey-sdk/esm2015}/lib/components/selfie-capture/selfie.component.js
RENAMED
|
File without changes
|
/package/{esm2015 → dist/unissey-sdk/esm2015}/lib/components/unissey-sdk-widget.component.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{lib → dist/unissey-sdk/lib}/components/picture-editor/picture-editor.component.d.ts
RENAMED
|
File without changes
|
/package/{lib → dist/unissey-sdk/lib}/components/picture-recorder/picture-recorder.component.d.ts
RENAMED
|
File without changes
|
/package/{lib → dist/unissey-sdk/lib}/components/reference-capture/reference-capture.component.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/{lib → dist/unissey-sdk/lib}/components/video-recorder/video-recorder.component.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|