Skip to content

Commit 9083353

Browse files
Merge pull request #107 from regulaforensics/a04614be
update-clients
2 parents 97be0ff + 6cba206 commit 9083353

File tree

106 files changed

+326
-183
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

106 files changed

+326
-183
lines changed

.github/workflows/run-smoke-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
- run: node --unhandled-rejections=strict index.js
2222
working-directory: ./examples/basic/esm
2323
env:
24-
API_BASE_PATH: "https://test-faceapi.regulaforensics.com"
24+
API_BASE_PATH: "https://nightly-faceapi.regulaforensics.com"
2525
- run: npm install
2626
working-directory: ./examples/basic/cjs
2727
- run: node --unhandled-rejections=strict index.js
2828
working-directory: ./examples/basic/cjs
2929
env:
30-
API_BASE_PATH: "https://test-faceapi.regulaforensics.com"
30+
API_BASE_PATH: "https://nightly-faceapi.regulaforensics.com"

examples/auth/client/index.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { FaceSdk, ImageSource } from '@regulaforensics/facesdk-webclient';
22
import fs from 'fs';
3-
import qs from "qs";
4-
import axios from "axios";
3+
import qs from 'qs';
4+
import axios from 'axios';
55

66
const GATEWAY_BASE_URL = 'http://localhost:8080';
77

@@ -39,13 +39,7 @@ async function get_authorization_token() {
3939
const face1 = fs.readFileSync('face1.jpg').buffer;
4040
const face2 = fs.readFileSync('face2.jpg').buffer;
4141
const token = await get_authorization_token();
42-
const sdk = new FaceSdk({ basePath: apiBasePath, baseOptions: { headers: { Authorization: `Bearer ${token}` }},});
43-
44-
const diagnostic = await sdk.diagnosticsApi.readiness();
45-
console.log('-----------------------------------------------------------------');
46-
console.log(' Diagnostic ');
47-
console.log('-----------------------------------------------------------------');
48-
console.log(diagnostic);
42+
const sdk = new FaceSdk({ basePath: apiBasePath, baseOptions: { headers: { Authorization: `Bearer ${token}` } } });
4943

5044
const matchingResponse = await sdk.matchingApi.match({
5145
tag: '1',

examples/basic/README.md

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,6 @@ API_BASE_PATH="http://192.168.0.101:41101" node .
4747

4848
This sample generates next text output:
4949
```text
50-
-----------------------------------------------------------------
51-
Diagnostic
52-
-----------------------------------------------------------------
53-
{
54-
metadata: {
55-
serverTime: '2023-10-20T11:57:46.509152',
56-
ctx: { userIp: 'xxx.xx.xx.xx' }
57-
}
58-
}
5950
-----------------------------------------------------------------
6051
Compare Results
6152
-----------------------------------------------------------------

examples/basic/angular/package-lock.json

Lines changed: 54 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/basic/angular/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"@angular/platform-browser-dynamic": "^15.1.0",
2020
"@angular/router": "^15.1.0",
2121
"@regulaforensics/facesdk-webclient": "file:../../..",
22+
"ngx-json-viewer": "^3.2.1",
2223
"rxjs": "~7.8.0",
2324
"tslib": "^2.3.0",
2425
"zone.js": "~0.12.0"

examples/basic/angular/src/app/app.component.css

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@
22
display: flex;
33
flex-direction: column;
44
gap: 15px;
5-
position: absolute;
65
height: 100%;
76
width: 100%;
8-
top: 0;
9-
left: 0;
107
justify-content: center;
118
align-items: center;
129
}
1310

11+
.result {
12+
width: 500px;
13+
border: 1px solid #e9e9e9;
14+
padding: 10px;
15+
}
16+
1417
button {
1518
padding: 10px 30px;
1619
color: white;
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
<div class="container">
22
Face Sdk
33
<button (click)="diagnostic()">
4-
Diagnostic
4+
Diagnostic Detection
55
</button>
6-
7-
<pre>{{ resultObject | json }}</pre>
6+
<div class="result">
7+
<ngx-json-viewer [json]="resultObject"></ngx-json-viewer>
8+
</div>
89
</div>

examples/basic/angular/src/app/app.component.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Component } from '@angular/core';
22
import { FaceSdk } from '@regulaforensics/facesdk-webclient';
3+
import { imageBase64 } from './resources';
34

45
@Component({
56
selector: 'app-root',
@@ -15,7 +16,16 @@ export class AppComponent {
1516
title = 'Face Sdk Web Client Example';
1617

1718
async diagnostic() {
18-
const result = await this.faceSdk.diagnosticsApi.readiness();
19-
this.resultObject = result;
19+
const detectResponse = await this.faceSdk.matchingApi.detect({
20+
tag: '1',
21+
image: imageBase64,
22+
thumbnails: true,
23+
});
24+
const detectResults = detectResponse.results;
25+
if (detectResults) {
26+
detectResults.detections[0].crop = 'base64Image';
27+
detectResults.detections[0].thumbnail = 'base64Thumbnail';
28+
this.resultObject = detectResults;
29+
}
2030
}
2131
}

examples/basic/angular/src/app/app.module.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
import { CUSTOM_ELEMENTS_SCHEMA, NgModule } from '@angular/core';
22
import { BrowserModule } from '@angular/platform-browser';
33
import { AppComponent } from './app.component';
4+
import { NgxJsonViewerModule } from 'ngx-json-viewer';
45

56
@NgModule({
67
declarations: [
78
AppComponent
89
],
910
imports: [
10-
BrowserModule
11+
BrowserModule,
12+
NgxJsonViewerModule
1113
],
1214
providers: [],
1315
bootstrap: [AppComponent],

examples/basic/angular/src/app/resources.ts

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)