@velixbiometrics/sdk-core 0.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/client.d.ts +31 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +107 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +13 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +28 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/modules/checkin.d.ts +13 -0
- package/dist/modules/checkin.d.ts.map +1 -0
- package/dist/modules/checkin.js +39 -0
- package/dist/modules/checkin.js.map +1 -0
- package/dist/modules/events.d.ts +12 -0
- package/dist/modules/events.d.ts.map +1 -0
- package/dist/modules/events.js +39 -0
- package/dist/modules/events.js.map +1 -0
- package/dist/modules/lgpd.d.ts +9 -0
- package/dist/modules/lgpd.d.ts.map +1 -0
- package/dist/modules/lgpd.js +18 -0
- package/dist/modules/lgpd.js.map +1 -0
- package/dist/modules/me.d.ts +9 -0
- package/dist/modules/me.d.ts.map +1 -0
- package/dist/modules/me.js +22 -0
- package/dist/modules/me.js.map +1 -0
- package/dist/modules/onboarding.d.ts +9 -0
- package/dist/modules/onboarding.d.ts.map +1 -0
- package/dist/modules/onboarding.js +41 -0
- package/dist/modules/onboarding.js.map +1 -0
- package/dist/modules/persons.d.ts +15 -0
- package/dist/modules/persons.d.ts.map +1 -0
- package/dist/modules/persons.js +23 -0
- package/dist/modules/persons.js.map +1 -0
- package/dist/modules/time.d.ts +19 -0
- package/dist/modules/time.d.ts.map +1 -0
- package/dist/modules/time.js +31 -0
- package/dist/modules/time.js.map +1 -0
- package/dist/types.d.ts +113 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +25 -0
package/dist/client.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { VelixConfig } from './types';
|
|
2
|
+
import { OnboardingModule } from './modules/onboarding';
|
|
3
|
+
import { CheckinModule } from './modules/checkin';
|
|
4
|
+
import { LgpdModule } from './modules/lgpd';
|
|
5
|
+
import { MeModule } from './modules/me';
|
|
6
|
+
import { EventsModule } from './modules/events';
|
|
7
|
+
import { TimeModule } from './modules/time';
|
|
8
|
+
export declare class VelixClient {
|
|
9
|
+
private readonly config;
|
|
10
|
+
private readonly baseUrl;
|
|
11
|
+
private readonly headers;
|
|
12
|
+
private readonly timeout;
|
|
13
|
+
/** POST /v1/api/onboarding (Velix.ID). */
|
|
14
|
+
readonly onboarding: OnboardingModule;
|
|
15
|
+
/** POST /v1/api/checkin/identify (Velix.ID). */
|
|
16
|
+
readonly checkin: CheckinModule;
|
|
17
|
+
/** POST /v1/api/deletion-request (Velix.ID, LGPD). */
|
|
18
|
+
readonly lgpd: LgpdModule;
|
|
19
|
+
/** GET /v1/api/me/{personId} (Velix.ID). */
|
|
20
|
+
readonly me: MeModule;
|
|
21
|
+
/** POST/GET /v1/api/events/{id}/guests (Velix Events). */
|
|
22
|
+
readonly events: EventsModule;
|
|
23
|
+
/** Não implementado — ver modules/time.ts. */
|
|
24
|
+
readonly time: TimeModule;
|
|
25
|
+
constructor(config: VelixConfig);
|
|
26
|
+
get<T>(path: string, params?: Record<string, unknown>): Promise<T>;
|
|
27
|
+
post<T>(path: string, body?: unknown): Promise<T>;
|
|
28
|
+
delete<T = void>(path: string): Promise<T>;
|
|
29
|
+
private _fetch;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAY,MAAM,SAAS,CAAA;AAEpD,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,E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
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VelixClient = void 0;
|
|
4
|
+
const errors_1 = require("./errors");
|
|
5
|
+
const onboarding_1 = require("./modules/onboarding");
|
|
6
|
+
const checkin_1 = require("./modules/checkin");
|
|
7
|
+
const lgpd_1 = require("./modules/lgpd");
|
|
8
|
+
const me_1 = require("./modules/me");
|
|
9
|
+
const events_1 = require("./modules/events");
|
|
10
|
+
const time_1 = require("./modules/time");
|
|
11
|
+
class VelixClient {
|
|
12
|
+
constructor(config) {
|
|
13
|
+
this.config = config;
|
|
14
|
+
this.baseUrl = config.apiUrl.replace(/\/$/, '');
|
|
15
|
+
this.timeout = config.timeout ?? 30000;
|
|
16
|
+
this.headers = {
|
|
17
|
+
'x-api-key': config.apiKey,
|
|
18
|
+
'Content-Type': 'application/json',
|
|
19
|
+
};
|
|
20
|
+
if (config.environment === 'sandbox' &&
|
|
21
|
+
config.apiUrl.includes('api.velixbiometrics.com') &&
|
|
22
|
+
!config.apiUrl.includes('sandbox')) {
|
|
23
|
+
console.warn('[Velix SDK] URL de produção usada com environment=sandbox. Verifique a configuração.');
|
|
24
|
+
}
|
|
25
|
+
// Facade — padronizado com os outros 15 SDKs (client.onboarding,
|
|
26
|
+
// client.checkin, etc). Antes exigia instanciar cada módulo manualmente
|
|
27
|
+
// (new OnboardingModule(client)), inconsistente com o resto do catálogo.
|
|
28
|
+
this.onboarding = new onboarding_1.OnboardingModule(this);
|
|
29
|
+
this.checkin = new checkin_1.CheckinModule(this);
|
|
30
|
+
this.lgpd = new lgpd_1.LgpdModule(this);
|
|
31
|
+
this.me = new me_1.MeModule(this);
|
|
32
|
+
this.events = new events_1.EventsModule(this);
|
|
33
|
+
this.time = new time_1.TimeModule();
|
|
34
|
+
}
|
|
35
|
+
async get(path, params) {
|
|
36
|
+
const url = new URL(`${this.baseUrl}${path}`);
|
|
37
|
+
if (params) {
|
|
38
|
+
for (const [k, v] of Object.entries(params)) {
|
|
39
|
+
if (v === undefined || v === null)
|
|
40
|
+
continue;
|
|
41
|
+
if (Array.isArray(v)) {
|
|
42
|
+
// arrays viram múltiplos pares `key=v1&key=v2` (padrão qs/express)
|
|
43
|
+
for (const item of v)
|
|
44
|
+
url.searchParams.append(k, String(item));
|
|
45
|
+
}
|
|
46
|
+
else if (typeof v === 'object') {
|
|
47
|
+
url.searchParams.set(k, JSON.stringify(v));
|
|
48
|
+
}
|
|
49
|
+
else {
|
|
50
|
+
url.searchParams.set(k, String(v));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return this._fetch(url.toString(), { method: 'GET' });
|
|
55
|
+
}
|
|
56
|
+
async post(path, body) {
|
|
57
|
+
return this._fetch(`${this.baseUrl}${path}`, {
|
|
58
|
+
method: 'POST',
|
|
59
|
+
body: body !== undefined ? JSON.stringify(body) : undefined,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
async delete(path) {
|
|
63
|
+
return this._fetch(`${this.baseUrl}${path}`, { method: 'DELETE' });
|
|
64
|
+
}
|
|
65
|
+
async _fetch(url, init) {
|
|
66
|
+
const controller = new AbortController();
|
|
67
|
+
const timer = setTimeout(() => controller.abort(), this.timeout);
|
|
68
|
+
try {
|
|
69
|
+
const res = await fetch(url, {
|
|
70
|
+
...init,
|
|
71
|
+
headers: { ...this.headers, ...(init.headers ?? {}) },
|
|
72
|
+
signal: controller.signal,
|
|
73
|
+
});
|
|
74
|
+
clearTimeout(timer);
|
|
75
|
+
if (!res.ok) {
|
|
76
|
+
// Envelope real de erro: {"success":false,"error":{"code":"...",
|
|
77
|
+
// "message":"..."}}. code/message ficam ANINHADOS sob "error" —
|
|
78
|
+
// nunca no nível raiz. Mesmo bug encontrado e corrigido em 4 outros
|
|
79
|
+
// SDKs desta plataforma (Ruby, Lua, Elixir, Go) — a mensagem real
|
|
80
|
+
// da API nunca chegava a aparecer aqui, só "HTTP 400: Bad Request".
|
|
81
|
+
let code;
|
|
82
|
+
let message = `HTTP ${res.status}: ${res.statusText}`;
|
|
83
|
+
try {
|
|
84
|
+
const body = (await res.json());
|
|
85
|
+
code = body?.error?.code;
|
|
86
|
+
message = body?.error?.message ?? body?.message ?? message;
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
// body não é JSON — ok, mantém a mensagem genérica
|
|
90
|
+
}
|
|
91
|
+
throw new errors_1.VelixApiError(message, res.status, code);
|
|
92
|
+
}
|
|
93
|
+
if (res.status === 204)
|
|
94
|
+
return undefined;
|
|
95
|
+
const json = (await res.json());
|
|
96
|
+
return json.data !== undefined ? json.data : json;
|
|
97
|
+
}
|
|
98
|
+
catch (err) {
|
|
99
|
+
clearTimeout(timer);
|
|
100
|
+
if (err instanceof errors_1.VelixApiError)
|
|
101
|
+
throw err;
|
|
102
|
+
throw new errors_1.VelixNetworkError(err.message, err);
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
exports.VelixClient = VelixClient;
|
|
107
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;AACA,qCAA2D;AAC3D,qDAAuD;AACvD,+CAAiD;AACjD,yCAA2C;AAC3C,qCAAuC;AACvC,6CAA+C;AAC/C,yCAA2C;AAE3C,MAAa,WAAW;IAuBtB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;QAC9C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;QAC/C,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,IAAI,KAAK,CAAA;QACtC,IAAI,CAAC,OAAO,GAAG;YACb,WAAW,EAAE,MAAM,CAAC,MAAM;YAC1B,cAAc,EAAE,kBAAkB;SACnC,CAAA;QAED,IACE,MAAM,CAAC,WAAW,KAAK,SAAS;Y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,EAAE,GAAG,CAAC,CAAA;QAC1D,CAAC;IACH,CAAC;CACF;AAvHD,kCAuHC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class VelixError extends Error {
|
|
2
|
+
constructor(message: string);
|
|
3
|
+
}
|
|
4
|
+
export declare class VelixApiError extends VelixError {
|
|
5
|
+
readonly status: number;
|
|
6
|
+
readonly code?: string | undefined;
|
|
7
|
+
constructor(message: string, status: number, code?: string | undefined);
|
|
8
|
+
}
|
|
9
|
+
export declare class VelixNetworkError extends VelixError {
|
|
10
|
+
readonly cause?: unknown | undefined;
|
|
11
|
+
constructor(message: string, cause?: unknown | undefined);
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,qBAAa,UAAW,SAAQ,KAAK;gBACvB,OAAO,EAAE,MAAM;CAI5B;AAED,qBAAa,aAAc,SAAQ,UAAU;aAGzB,MAAM,EAAE,MAAM;aACd,IAAI,CAAC,EAAE,MAAM;gBAF7B,OAAO,EAAE,MAAM,EACC,MAAM,EAAE,MAAM,EACd,IAAI,CAAC,EAAE,MAAM,YAAA;CAKhC;AAED,qBAAa,iBAAkB,SAAQ,UAAU;aACF,KAAK,CAAC,EAAE,OAAO;gBAAhD,OAAO,EAAE,MAAM,EAAkB,KAAK,CAAC,EAAE,OAAO,YAAA;CAI7D"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VelixNetworkError = exports.VelixApiError = exports.VelixError = void 0;
|
|
4
|
+
class VelixError extends Error {
|
|
5
|
+
constructor(message) {
|
|
6
|
+
super(message);
|
|
7
|
+
this.name = 'VelixError';
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.VelixError = VelixError;
|
|
11
|
+
class VelixApiError extends VelixError {
|
|
12
|
+
constructor(message, status, code) {
|
|
13
|
+
super(message);
|
|
14
|
+
this.status = status;
|
|
15
|
+
this.code = code;
|
|
16
|
+
this.name = 'VelixApiError';
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
exports.VelixApiError = VelixApiError;
|
|
20
|
+
class VelixNetworkError extends VelixError {
|
|
21
|
+
constructor(message, cause) {
|
|
22
|
+
super(message);
|
|
23
|
+
this.cause = cause;
|
|
24
|
+
this.name = 'VelixNetworkError';
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.VelixNetworkError = VelixNetworkError;
|
|
28
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,UAAW,SAAQ,KAAK;IACnC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAA;QACd,IAAI,CAAC,IAAI,GAAG,YAAY,CAAA;IAC1B,CAAC;CACF;AALD,gCAKC;AAED,MAAa,aAAc,SAAQ,UAAU;IAC3C,YACE,OAAe,EACC,MAAc,EACd,IAAa;QAE7B,KAAK,CAAC,OAAO,CAAC,CAAA;QAHE,WAAM,GAAN,MAAM,CAAQ;QACd,SAAI,GAAJ,IAAI,CAAS;QAG7B,IAAI,CAAC,IAAI,GAAG,eAAe,CAAA;IAC7B,CAAC;CACF;AATD,sCASC;AAED,MAAa,iBAAkB,SAAQ,UAAU;IAC/C,YAAY,OAAe,EAAkB,KAAe;QAC1D,KAAK,CAAC,OAAO,CAAC,CAAA;QAD6B,UAAK,GAAL,KAAK,CAAU;QAE1D,IAAI,CAAC,IAAI,GAAG,mBAAmB,CAAA;IACjC,CAAC;CACF;AALD,8CAKC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { VelixClient } from './client';
|
|
2
|
+
export { VelixError, VelixApiError, VelixNetworkError } from './errors';
|
|
3
|
+
export { OnboardingModule } from './modules/onboarding';
|
|
4
|
+
export { CheckinModule } from './modules/checkin';
|
|
5
|
+
export { LgpdModule } from './modules/lgpd';
|
|
6
|
+
export { MeModule } from './modules/me';
|
|
7
|
+
export { EventsModule } from './modules/events';
|
|
8
|
+
export { TimeModule } from './modules/time';
|
|
9
|
+
export type { VelixConfig, Envelope, ApiResponse, DocumentType, IdentityRole, OnboardingRequest, OnboardingFrameResult, OnboardingResponse, LivenessAction, LivenessSample, LivenessBlock, CheckinLocation, CheckinIdentifyRequest, CheckinIdentifyResponse, CheckinResult, DeletionRequest, DeletionRequestResponse, MeResponse, Person, CreateGuestRequest, GuestResponse, PaginatedResult, } from './types';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA;AACvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,YAAY,EACV,WAAW,EACX,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,aAAa,EACb,eAAe,EACf,sBAAsB,EACtB,uBAAuB,EACvB,aAAa,EACb,eAAe,EACf,uBAAuB,EACvB,UAAU,EACV,MAAM,EACN,kBAAkB,EAClB,aAAa,EACb,eAAe,GAChB,MAAM,SAAS,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TimeModule = exports.EventsModule = exports.MeModule = exports.LgpdModule = exports.CheckinModule = exports.OnboardingModule = exports.VelixNetworkError = exports.VelixApiError = exports.VelixError = exports.VelixClient = void 0;
|
|
4
|
+
var client_1 = require("./client");
|
|
5
|
+
Object.defineProperty(exports, "VelixClient", { enumerable: true, get: function () { return client_1.VelixClient; } });
|
|
6
|
+
var errors_1 = require("./errors");
|
|
7
|
+
Object.defineProperty(exports, "VelixError", { enumerable: true, get: function () { return errors_1.VelixError; } });
|
|
8
|
+
Object.defineProperty(exports, "VelixApiError", { enumerable: true, get: function () { return errors_1.VelixApiError; } });
|
|
9
|
+
Object.defineProperty(exports, "VelixNetworkError", { enumerable: true, get: function () { return errors_1.VelixNetworkError; } });
|
|
10
|
+
var onboarding_1 = require("./modules/onboarding");
|
|
11
|
+
Object.defineProperty(exports, "OnboardingModule", { enumerable: true, get: function () { return onboarding_1.OnboardingModule; } });
|
|
12
|
+
var checkin_1 = require("./modules/checkin");
|
|
13
|
+
Object.defineProperty(exports, "CheckinModule", { enumerable: true, get: function () { return checkin_1.CheckinModule; } });
|
|
14
|
+
var lgpd_1 = require("./modules/lgpd");
|
|
15
|
+
Object.defineProperty(exports, "LgpdModule", { enumerable: true, get: function () { return lgpd_1.LgpdModule; } });
|
|
16
|
+
var me_1 = require("./modules/me");
|
|
17
|
+
Object.defineProperty(exports, "MeModule", { enumerable: true, get: function () { return me_1.MeModule; } });
|
|
18
|
+
var events_1 = require("./modules/events");
|
|
19
|
+
Object.defineProperty(exports, "EventsModule", { enumerable: true, get: function () { return events_1.EventsModule; } });
|
|
20
|
+
var time_1 = require("./modules/time");
|
|
21
|
+
Object.defineProperty(exports, "TimeModule", { enumerable: true, get: function () { return time_1.TimeModule; } });
|
|
22
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,mCAAsC;AAA7B,qGAAA,WAAW,OAAA;AACpB,mCAAuE;AAA9D,oGAAA,UAAU,OAAA;AAAE,uGAAA,aAAa,OAAA;AAAE,2GAAA,iBAAiB,OAAA;AACrD,mDAAuD;AAA9C,8GAAA,gBAAgB,OAAA;AACzB,6CAAiD;AAAxC,wGAAA,aAAa,OAAA;AACtB,uCAA2C;AAAlC,kGAAA,UAAU,OAAA;AACnB,mCAAuC;AAA9B,8FAAA,QAAQ,OAAA;AACjB,2CAA+C;AAAtC,sGAAA,YAAY,OAAA;AACrB,uCAA2C;AAAlC,kGAAA,UAAU,OAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { VelixClient } from '../client';
|
|
2
|
+
import type { CheckinIdentifyRequest, CheckinIdentifyResponse } from '../types';
|
|
3
|
+
/** POST /v1/api/checkin/identify — scope checkin:write */
|
|
4
|
+
export declare class CheckinModule {
|
|
5
|
+
private readonly client;
|
|
6
|
+
constructor(client: VelixClient);
|
|
7
|
+
/**
|
|
8
|
+
* Identificação facial via biometria. Score de liveness NUNCA é exposto —
|
|
9
|
+
* a resposta traz apenas `matched` (boolean).
|
|
10
|
+
*/
|
|
11
|
+
identify(request: CheckinIdentifyRequest): Promise<CheckinIdentifyResponse>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=checkin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkin.d.ts","sourceRoot":"","sources":["../../src/modules/checkin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAE/E,0DAA0D;AAC1D,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEhD;;;OAGG;IACG,QAAQ,CAAC,OAAO,EAAE,sBAAsB,GAAG,OAAO,CAAC,uBAAuB,CAAC;CA+BlF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckinModule = void 0;
|
|
4
|
+
/** POST /v1/api/checkin/identify — scope checkin:write */
|
|
5
|
+
class CheckinModule {
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Identificação facial via biometria. Score de liveness NUNCA é exposto —
|
|
11
|
+
* a resposta traz apenas `matched` (boolean).
|
|
12
|
+
*/
|
|
13
|
+
async identify(request) {
|
|
14
|
+
const body = {
|
|
15
|
+
imageBase64: request.imageBase64,
|
|
16
|
+
images: request.images,
|
|
17
|
+
topK: request.topK,
|
|
18
|
+
liveness: request.liveness
|
|
19
|
+
? {
|
|
20
|
+
token: request.liveness.token,
|
|
21
|
+
samples: request.liveness.samples.map((s) => ({
|
|
22
|
+
action: s.action,
|
|
23
|
+
imageBase64: s.imageBase64,
|
|
24
|
+
})),
|
|
25
|
+
}
|
|
26
|
+
: undefined,
|
|
27
|
+
location: request.location,
|
|
28
|
+
};
|
|
29
|
+
const res = await this.client.post('/v1/api/checkin/identify', body);
|
|
30
|
+
return {
|
|
31
|
+
matched: res.matched,
|
|
32
|
+
personId: res.person_id,
|
|
33
|
+
qualityScore: res.quality_score,
|
|
34
|
+
message: res.message,
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.CheckinModule = CheckinModule;
|
|
39
|
+
//# sourceMappingURL=checkin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkin.js","sourceRoot":"","sources":["../../src/modules/checkin.ts"],"names":[],"mappings":";;;AAGA,0DAA0D;AAC1D,MAAa,aAAa;IACxB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD;;;OAGG;IACH,KAAK,CAAC,QAAQ,CAAC,OAA+B;QAC5C,MAAM,IAAI,GAAG;YACX,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,MAAM,EAAE,OAAO,CAAC,MAAM;YACtB,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,QAAQ,EAAE,OAAO,CAAC,QAAQ;gBACxB,CAAC,CAAC;oBACE,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,KAAK;oBAC7B,OAAO,EAAE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;wBAC5C,MAAM,EAAE,CAAC,CAAC,MAAM;wBAChB,WAAW,EAAE,CAAC,CAAC,WAAW;qBAC3B,CAAC,CAAC;iBACJ;gBACH,CAAC,CAAC,SAAS;YACb,QAAQ,EAAE,OAAO,CAAC,QAAQ;SAC3B,CAAA;QAED,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAK/B,0BAA0B,EAAE,IAAI,CAAC,CAAA;QAEpC,OAAO;YACL,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,QAAQ,EAAE,GAAG,CAAC,SAAS;YACvB,YAAY,EAAE,GAAG,CAAC,aAAa;YAC/B,OAAO,EAAE,GAAG,CAAC,OAAO;SACrB,CAAA;IACH,CAAC;CACF;AAtCD,sCAsCC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { VelixClient } from '../client';
|
|
2
|
+
import type { CreateGuestRequest, GuestResponse } from '../types';
|
|
3
|
+
/** Módulo de convidados de eventos (Velix Events). */
|
|
4
|
+
export declare class EventsModule {
|
|
5
|
+
private readonly client;
|
|
6
|
+
constructor(client: VelixClient);
|
|
7
|
+
/** POST /v1/api/events/:id/guests — scope events:write */
|
|
8
|
+
createGuest(eventId: string, request: CreateGuestRequest): Promise<GuestResponse>;
|
|
9
|
+
/** GET /v1/api/events/:id/guests/:guestId — scope events:read */
|
|
10
|
+
getGuest(eventId: string, guestId: string): Promise<GuestResponse>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=events.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/modules/events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAsBjE,sDAAsD;AACtD,qBAAa,YAAY;IACX,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEhD,0DAA0D;IACpD,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,CAAC;IAavF,iEAAiE;IAC3D,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;CAMzE"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EventsModule = void 0;
|
|
4
|
+
function mapGuest(res) {
|
|
5
|
+
return {
|
|
6
|
+
id: res.id,
|
|
7
|
+
eventId: res.eventId,
|
|
8
|
+
name: res.name,
|
|
9
|
+
email: res.email,
|
|
10
|
+
status: res.status,
|
|
11
|
+
categoryId: res.categoryId,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
/** Módulo de convidados de eventos (Velix Events). */
|
|
15
|
+
class EventsModule {
|
|
16
|
+
constructor(client) {
|
|
17
|
+
this.client = client;
|
|
18
|
+
}
|
|
19
|
+
/** POST /v1/api/events/:id/guests — scope events:write */
|
|
20
|
+
async createGuest(eventId, request) {
|
|
21
|
+
const res = await this.client.post(`/v1/api/events/${eventId}/guests`, {
|
|
22
|
+
name: request.name,
|
|
23
|
+
email: request.email,
|
|
24
|
+
cpf: request.cpf,
|
|
25
|
+
phone: request.phone,
|
|
26
|
+
birthDate: request.birthDate,
|
|
27
|
+
categoryId: request.categoryId,
|
|
28
|
+
companionOf: request.companionOf,
|
|
29
|
+
});
|
|
30
|
+
return mapGuest(res);
|
|
31
|
+
}
|
|
32
|
+
/** GET /v1/api/events/:id/guests/:guestId — scope events:read */
|
|
33
|
+
async getGuest(eventId, guestId) {
|
|
34
|
+
const res = await this.client.get(`/v1/api/events/${eventId}/guests/${guestId}`);
|
|
35
|
+
return mapGuest(res);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.EventsModule = EventsModule;
|
|
39
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/modules/events.ts"],"names":[],"mappings":";;;AAYA,SAAS,QAAQ,CAAC,GAAsB;IACtC,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAE;QACV,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,IAAI,EAAE,GAAG,CAAC,IAAI;QACd,KAAK,EAAE,GAAG,CAAC,KAAK;QAChB,MAAM,EAAE,GAAG,CAAC,MAAM;QAClB,UAAU,EAAE,GAAG,CAAC,UAAU;KAC3B,CAAA;AACH,CAAC;AAED,sDAAsD;AACtD,MAAa,YAAY;IACvB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD,0DAA0D;IAC1D,KAAK,CAAC,WAAW,CAAC,OAAe,EAAE,OAA2B;QAC5D,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAoB,kBAAkB,OAAO,SAAS,EAAE;YACxF,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,KAAK,EAAE,OAAO,CAAC,KAAK;YACpB,SAAS,EAAE,OAAO,CAAC,SAAS;YAC5B,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,WAAW,EAAE,OAAO,CAAC,WAAW;SACjC,CAAC,CAAA;QACF,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAA;IACtB,CAAC;IAED,iEAAiE;IACjE,KAAK,CAAC,QAAQ,CAAC,OAAe,EAAE,OAAe;QAC7C,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAC/B,kBAAkB,OAAO,WAAW,OAAO,EAAE,CAC9C,CAAA;QACD,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAA;IACtB,CAAC;CACF;AAxBD,oCAwBC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { VelixClient } from '../client';
|
|
2
|
+
import type { DeletionRequest, DeletionRequestResponse } from '../types';
|
|
3
|
+
/** POST /v1/api/deletion-request — scope lgpd:write */
|
|
4
|
+
export declare class LgpdModule {
|
|
5
|
+
private readonly client;
|
|
6
|
+
constructor(client: VelixClient);
|
|
7
|
+
requestDeletion(request: DeletionRequest): Promise<DeletionRequestResponse>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=lgpd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lgpd.d.ts","sourceRoot":"","sources":["../../src/modules/lgpd.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,UAAU,CAAA;AAExE,uDAAuD;AACvD,qBAAa,UAAU;IACT,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAE1C,eAAe,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAWlF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LgpdModule = void 0;
|
|
4
|
+
/** POST /v1/api/deletion-request — scope lgpd:write */
|
|
5
|
+
class LgpdModule {
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
async requestDeletion(request) {
|
|
10
|
+
const res = await this.client.post('/v1/api/deletion-request', { person_id: request.personId });
|
|
11
|
+
return {
|
|
12
|
+
protocolNumber: res.protocol_number,
|
|
13
|
+
message: res.message,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
exports.LgpdModule = LgpdModule;
|
|
18
|
+
//# sourceMappingURL=lgpd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lgpd.js","sourceRoot":"","sources":["../../src/modules/lgpd.ts"],"names":[],"mappings":";;;AAGA,uDAAuD;AACvD,MAAa,UAAU;IACrB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD,KAAK,CAAC,eAAe,CAAC,OAAwB;QAC5C,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAChC,0BAA0B,EAC1B,EAAE,SAAS,EAAE,OAAO,CAAC,QAAQ,EAAE,CAChC,CAAA;QAED,OAAO;YACL,cAAc,EAAE,GAAG,CAAC,eAAe;YACnC,OAAO,EAAE,GAAG,CAAC,OAAO;SACrB,CAAA;IACH,CAAC;CACF;AAdD,gCAcC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { VelixClient } from '../client';
|
|
2
|
+
import type { MeResponse } from '../types';
|
|
3
|
+
/** GET /v1/api/me/:personId — scope me:read */
|
|
4
|
+
export declare class MeModule {
|
|
5
|
+
private readonly client;
|
|
6
|
+
constructor(client: VelixClient);
|
|
7
|
+
get(personId: string): Promise<MeResponse>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=me.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"me.d.ts","sourceRoot":"","sources":["../../src/modules/me.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AAE1C,+CAA+C;AAC/C,qBAAa,QAAQ;IACP,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAE1C,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC;CAmBjD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MeModule = void 0;
|
|
4
|
+
/** GET /v1/api/me/:personId — scope me:read */
|
|
5
|
+
class MeModule {
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
async get(personId) {
|
|
10
|
+
const res = await this.client.get(`/v1/api/me/${personId}`);
|
|
11
|
+
return {
|
|
12
|
+
id: res.id,
|
|
13
|
+
name: res.name,
|
|
14
|
+
email: res.email,
|
|
15
|
+
phone: res.phone,
|
|
16
|
+
photoUrl: res.photo_url,
|
|
17
|
+
createdAt: res.created_at,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.MeModule = MeModule;
|
|
22
|
+
//# sourceMappingURL=me.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"me.js","sourceRoot":"","sources":["../../src/modules/me.ts"],"names":[],"mappings":";;;AAGA,+CAA+C;AAC/C,MAAa,QAAQ;IACnB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD,KAAK,CAAC,GAAG,CAAC,QAAgB;QACxB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAO9B,cAAc,QAAQ,EAAE,CAAC,CAAA;QAE5B,OAAO;YACL,EAAE,EAAE,GAAG,CAAC,EAAE;YACV,IAAI,EAAE,GAAG,CAAC,IAAI;YACd,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,QAAQ,EAAE,GAAG,CAAC,SAAS;YACvB,SAAS,EAAE,GAAG,CAAC,UAAU;SAC1B,CAAA;IACH,CAAC;CACF;AAtBD,4BAsBC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { VelixClient } from '../client';
|
|
2
|
+
import type { OnboardingRequest, OnboardingResponse } from '../types';
|
|
3
|
+
/** POST /v1/api/onboarding — scope onboarding:write */
|
|
4
|
+
export declare class OnboardingModule {
|
|
5
|
+
private readonly client;
|
|
6
|
+
constructor(client: VelixClient);
|
|
7
|
+
enroll(request: OnboardingRequest): Promise<OnboardingResponse>;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=onboarding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboarding.d.ts","sourceRoot":"","sources":["../../src/modules/onboarding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,kBAAkB,EAAyB,MAAM,UAAU,CAAA;AAE5F,uDAAuD;AACvD,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAE1C,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CA8CtE"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OnboardingModule = void 0;
|
|
4
|
+
/** POST /v1/api/onboarding — scope onboarding:write */
|
|
5
|
+
class OnboardingModule {
|
|
6
|
+
constructor(client) {
|
|
7
|
+
this.client = client;
|
|
8
|
+
}
|
|
9
|
+
async enroll(request) {
|
|
10
|
+
const body = {
|
|
11
|
+
name: request.name,
|
|
12
|
+
email: request.email,
|
|
13
|
+
phone: request.phone,
|
|
14
|
+
document: request.document,
|
|
15
|
+
document_type: request.documentType,
|
|
16
|
+
external_id: request.externalId,
|
|
17
|
+
metadata: request.metadata,
|
|
18
|
+
frames: request.frames,
|
|
19
|
+
role: request.role,
|
|
20
|
+
access_groups: request.accessGroups,
|
|
21
|
+
};
|
|
22
|
+
const res = await this.client.post('/v1/api/onboarding', body);
|
|
23
|
+
const framesResults = (res.frames_results ?? []).map((f) => ({
|
|
24
|
+
frameIndex: f.frame_index,
|
|
25
|
+
qualityPassed: f.quality_passed,
|
|
26
|
+
qualityScore: f.quality_score,
|
|
27
|
+
livenessPassed: f.liveness_passed,
|
|
28
|
+
}));
|
|
29
|
+
return {
|
|
30
|
+
personId: res.person_id,
|
|
31
|
+
identityId: res.identity_id,
|
|
32
|
+
enrolled: res.enrolled,
|
|
33
|
+
framesProcessed: res.frames_processed,
|
|
34
|
+
framesResults,
|
|
35
|
+
embeddingId: res.embedding_id,
|
|
36
|
+
message: res.message,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
exports.OnboardingModule = OnboardingModule;
|
|
41
|
+
//# sourceMappingURL=onboarding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"onboarding.js","sourceRoot":"","sources":["../../src/modules/onboarding.ts"],"names":[],"mappings":";;;AAGA,uDAAuD;AACvD,MAAa,gBAAgB;I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{ VelixClient } from '../client';
|
|
2
|
+
import type { Person, PaginatedResult } from '../types';
|
|
3
|
+
export declare class PersonsModule {
|
|
4
|
+
private readonly client;
|
|
5
|
+
constructor(client: VelixClient);
|
|
6
|
+
/** Rota JWT-guarded — o tenant é resolvido pelo token, não passado por query. */
|
|
7
|
+
list(page?: number, limit?: number): Promise<PaginatedResult<Person>>;
|
|
8
|
+
get(personId: string): Promise<Person>;
|
|
9
|
+
enroll(personId: string, frames: string[]): Promise<{
|
|
10
|
+
enrolled: boolean;
|
|
11
|
+
quality: number;
|
|
12
|
+
}>;
|
|
13
|
+
delete(personId: string): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=persons.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persons.d.ts","sourceRoot":"","sources":["../../src/modules/persons.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAC5C,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAEvD,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,WAAW;IAEhD,iFAAiF;IAC3E,IAAI,CAAC,IAAI,SAAI,EAAE,KAAK,SAAK,GAAG,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAI5D,GAAG,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAItC,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IAI3F,MAAM,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAG9C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PersonsModule = void 0;
|
|
4
|
+
class PersonsModule {
|
|
5
|
+
constructor(client) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
}
|
|
8
|
+
/** Rota JWT-guarded — o tenant é resolvido pelo token, não passado por query. */
|
|
9
|
+
async list(page = 1, limit = 50) {
|
|
10
|
+
return this.client.get('/v1/persons', { page, limit });
|
|
11
|
+
}
|
|
12
|
+
async get(personId) {
|
|
13
|
+
return this.client.get(`/v1/persons/${personId}`);
|
|
14
|
+
}
|
|
15
|
+
async enroll(personId, frames) {
|
|
16
|
+
return this.client.post(`/v1/persons/${personId}/enroll`, { frames });
|
|
17
|
+
}
|
|
18
|
+
async delete(personId) {
|
|
19
|
+
return this.client.delete(`/v1/persons/${personId}`);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.PersonsModule = PersonsModule;
|
|
23
|
+
//# sourceMappingURL=persons.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persons.js","sourceRoot":"","sources":["../../src/modules/persons.ts"],"names":[],"mappings":";;;AAGA,MAAa,aAAa;IACxB,YAA6B,MAAmB;QAAnB,WAAM,GAAN,MAAM,CAAa;IAAG,CAAC;IAEpD,iFAAiF;IACjF,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,EAAE,KAAK,GAAG,EAAE;QAC7B,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,aAAa,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAA;IACxD,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,QAAgB;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,eAAe,QAAQ,EAAE,CAAC,CAAA;IACnD,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,QAAgB,EAAE,MAAgB;QAC7C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,QAAQ,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,CAAA;IACvE,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,QAAgB;QAC3B,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,eAAe,QAAQ,EAAE,CAAC,CAAA;IACtD,CAAC;CACF;AAnBD,sCAmBC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Velix Time (api-velix-time) NÃO possui proxy no api-velix-identity-core.
|
|
3
|
+
* A API pública `/v1/api/*` documentada na spec (task #593/#656) cobre apenas
|
|
4
|
+
* Velix.ID (onboarding, checkin, LGPD, me) e Velix Events (guests) — não há
|
|
5
|
+
* nenhum endpoint de ponto/jornada exposto publicamente.
|
|
6
|
+
*
|
|
7
|
+
* Este módulo existe apenas para deixar explícito que a funcionalidade NÃO
|
|
8
|
+
* está implementada — nunca simula sucesso nem retorna dados falsos. Qualquer
|
|
9
|
+
* chamada lança VelixError imediatamente.
|
|
10
|
+
*
|
|
11
|
+
* Gap de servidor: identity-core precisa expor um BFF para api-velix-time
|
|
12
|
+
* antes que este módulo possa ser implementado de verdade (ver task #593).
|
|
13
|
+
*/
|
|
14
|
+
export declare class TimeModule {
|
|
15
|
+
private notImplemented;
|
|
16
|
+
punch(): Promise<never>;
|
|
17
|
+
getEspelho(): Promise<never>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=time.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/modules/time.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;GAYG;AACH,qBAAa,UAAU;IACrB,OAAO,CAAC,cAAc;IAOhB,KAAK,IAAI,OAAO,CAAC,KAAK,CAAC;IAIvB,UAAU,IAAI,OAAO,CAAC,KAAK,CAAC;CAGnC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TimeModule = void 0;
|
|
4
|
+
const errors_1 = require("../errors");
|
|
5
|
+
/**
|
|
6
|
+
* Velix Time (api-velix-time) NÃO possui proxy no api-velix-identity-core.
|
|
7
|
+
* A API pública `/v1/api/*` documentada na spec (task #593/#656) cobre apenas
|
|
8
|
+
* Velix.ID (onboarding, checkin, LGPD, me) e Velix Events (guests) — não há
|
|
9
|
+
* nenhum endpoint de ponto/jornada exposto publicamente.
|
|
10
|
+
*
|
|
11
|
+
* Este módulo existe apenas para deixar explícito que a funcionalidade NÃO
|
|
12
|
+
* está implementada — nunca simula sucesso nem retorna dados falsos. Qualquer
|
|
13
|
+
* chamada lança VelixError imediatamente.
|
|
14
|
+
*
|
|
15
|
+
* Gap de servidor: identity-core precisa expor um BFF para api-velix-time
|
|
16
|
+
* antes que este módulo possa ser implementado de verdade (ver task #593).
|
|
17
|
+
*/
|
|
18
|
+
class TimeModule {
|
|
19
|
+
notImplemented(method) {
|
|
20
|
+
throw new errors_1.VelixError(`TimeModule.${method}() não implementado — identity-core ainda não expõe proxy ` +
|
|
21
|
+
'público para api-velix-time (gap de servidor, task #593). Não use este módulo em produção.');
|
|
22
|
+
}
|
|
23
|
+
async punch() {
|
|
24
|
+
return this.notImplemented('punch');
|
|
25
|
+
}
|
|
26
|
+
async getEspelho() {
|
|
27
|
+
return this.notImplemented('getEspelho');
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.TimeModule = TimeModule;
|
|
31
|
+
//# sourceMappingURL=time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"time.js","sourceRoot":"","sources":["../../src/modules/time.ts"],"names":[],"mappings":";;;AAAA,sCAAsC;AAEtC;;;;;;;;;;;;GAYG;AACH,MAAa,UAAU;IACb,cAAc,CAAC,MAAc;QACnC,MAAM,IAAI,mBAAU,CAClB,cAAc,MAAM,4DAA4D;YAC9E,4FAA4F,CAC/F,CAAA;IACH,CAAC;IAED,KAAK,CAAC,KAAK;QACT,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAA;IACrC,CAAC;IAED,KAAK,CAAC,UAAU;QACd,OAAO,IAAI,CAAC,cAAc,CAAC,YAAY,CAAC,CAAA;IAC1C,CAAC;CACF;AAfD,gCAeC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
export interface VelixConfig {
|
|
2
|
+
apiUrl: string;
|
|
3
|
+
apiKey: string;
|
|
4
|
+
environment: 'production' | 'sandbox';
|
|
5
|
+
/** Timeout do cliente HTTP em ms. Default: 30000 (30s). Sempre sobrescrevível. */
|
|
6
|
+
timeout?: number;
|
|
7
|
+
}
|
|
8
|
+
export interface Envelope<T> {
|
|
9
|
+
data: T;
|
|
10
|
+
}
|
|
11
|
+
export type ApiResponse<T> = Promise<T>;
|
|
12
|
+
export type DocumentType = 'CPF' | 'CNPJ' | 'RG' | 'PASSPORT' | 'OTHER';
|
|
13
|
+
export type IdentityRole = 'member' | 'admin' | 'tenant_admin';
|
|
14
|
+
/** Superfície idiomática camelCase exposta ao consumidor do SDK. */
|
|
15
|
+
export interface OnboardingRequest {
|
|
16
|
+
name: string;
|
|
17
|
+
email?: string;
|
|
18
|
+
phone?: string;
|
|
19
|
+
document?: string;
|
|
20
|
+
documentType?: DocumentType;
|
|
21
|
+
externalId?: string;
|
|
22
|
+
metadata?: Record<string, unknown>;
|
|
23
|
+
/** Frames JPEG base64, sem prefixo data URI. Mínimo 1. */
|
|
24
|
+
frames: string[];
|
|
25
|
+
role?: IdentityRole;
|
|
26
|
+
accessGroups?: string[];
|
|
27
|
+
}
|
|
28
|
+
export interface OnboardingFrameResult {
|
|
29
|
+
frameIndex: number;
|
|
30
|
+
qualityPassed: boolean;
|
|
31
|
+
qualityScore: number;
|
|
32
|
+
livenessPassed: boolean;
|
|
33
|
+
}
|
|
34
|
+
export interface OnboardingResponse {
|
|
35
|
+
personId: string;
|
|
36
|
+
identityId: string;
|
|
37
|
+
enrolled: boolean;
|
|
38
|
+
framesProcessed: number;
|
|
39
|
+
framesResults: OnboardingFrameResult[];
|
|
40
|
+
embeddingId: string | null;
|
|
41
|
+
message: string;
|
|
42
|
+
}
|
|
43
|
+
export type LivenessAction = 'center' | 'move_closer' | 'move_away';
|
|
44
|
+
export interface LivenessSample {
|
|
45
|
+
action: LivenessAction;
|
|
46
|
+
imageBase64: string;
|
|
47
|
+
}
|
|
48
|
+
export interface LivenessBlock {
|
|
49
|
+
/** Nonce obtido em GET /v1/public/checkin/{tenantSlug}/liveness/challenge. */
|
|
50
|
+
token: string;
|
|
51
|
+
samples: LivenessSample[];
|
|
52
|
+
}
|
|
53
|
+
export interface CheckinLocation {
|
|
54
|
+
latitude: number;
|
|
55
|
+
longitude: number;
|
|
56
|
+
accuracy?: number;
|
|
57
|
+
}
|
|
58
|
+
export interface CheckinIdentifyRequest {
|
|
59
|
+
/** Frame base64 principal. */
|
|
60
|
+
imageBase64: string;
|
|
61
|
+
images?: string[];
|
|
62
|
+
topK?: number;
|
|
63
|
+
liveness?: LivenessBlock;
|
|
64
|
+
location?: CheckinLocation;
|
|
65
|
+
}
|
|
66
|
+
export interface CheckinIdentifyResponse {
|
|
67
|
+
matched: boolean;
|
|
68
|
+
personId: string | null;
|
|
69
|
+
/** Score de liveness NUNCA é exposto — apenas passed/matched booleans. */
|
|
70
|
+
qualityScore: number;
|
|
71
|
+
message: string;
|
|
72
|
+
}
|
|
73
|
+
/** @deprecated Use CheckinIdentifyResponse — mantido para compat de import. */
|
|
74
|
+
export type CheckinResult = CheckinIdentifyResponse;
|
|
75
|
+
export interface DeletionRequest {
|
|
76
|
+
personId: string;
|
|
77
|
+
}
|
|
78
|
+
export interface DeletionRequestResponse {
|
|
79
|
+
protocolNumber: string;
|
|
80
|
+
message: string;
|
|
81
|
+
}
|
|
82
|
+
export interface MeResponse {
|
|
83
|
+
id: string;
|
|
84
|
+
name: string;
|
|
85
|
+
email: string | null;
|
|
86
|
+
phone: string | null;
|
|
87
|
+
photoUrl: string | null;
|
|
88
|
+
createdAt: string;
|
|
89
|
+
}
|
|
90
|
+
/** @deprecated Use MeResponse — mantido para compat de import. */
|
|
91
|
+
export type Person = MeResponse;
|
|
92
|
+
export interface CreateGuestRequest {
|
|
93
|
+
name: string;
|
|
94
|
+
email: string;
|
|
95
|
+
cpf?: string;
|
|
96
|
+
phone?: string;
|
|
97
|
+
birthDate?: string;
|
|
98
|
+
categoryId?: string;
|
|
99
|
+
companionOf?: string;
|
|
100
|
+
}
|
|
101
|
+
export interface GuestResponse {
|
|
102
|
+
id: string;
|
|
103
|
+
eventId: string;
|
|
104
|
+
name: string;
|
|
105
|
+
email: string;
|
|
106
|
+
status: string;
|
|
107
|
+
categoryId: string | null;
|
|
108
|
+
}
|
|
109
|
+
export interface PaginatedResult<T> {
|
|
110
|
+
items: T[];
|
|
111
|
+
total: number;
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,YAAY,GAAG,SAAS,CAAA;IACrC,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,QAAQ,CAAC,CAAC;IACzB,IAAI,EAAE,CAAC,CAAA;CACR;AAED,MAAM,MAAM,WAAW,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAA;AAIvC,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,IAAI,GAAG,UAAU,GAAG,OAAO,CAAA;AACvE,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,OAAO,GAAG,cAAc,CAAA;AAE9D,oEAAoE;AACpE,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;I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E,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,MAAM,WAAW,eAAe,CAAC,CAAC;IAChC,KAAK,EAAE,CAAC,EAAE,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;CACd"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@velixbiometrics/sdk-core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Official TypeScript/JavaScript SDK for VELIX Biometrics — facial access control platform",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"files": ["dist"],
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"author": "VELIX Biometrics <sdk@velixbiometrics.com>",
|
|
10
|
+
"homepage": "https://velixbiometrics.com",
|
|
11
|
+
"repository": { "type": "git", "url": "https://github.com/VELIX-Biometrics/sdk-velix-typescript" },
|
|
12
|
+
"keywords": ["velix", "biometrics", "facial-recognition", "access-control"],
|
|
13
|
+
"publishConfig": { "access": "public" },
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc",
|
|
16
|
+
"test": "vitest run --passWithNoTests",
|
|
17
|
+
"postinstall": ""
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {},
|
|
20
|
+
"peerDependencies": {},
|
|
21
|
+
"devDependencies": {
|
|
22
|
+
"typescript": "^5.4.0",
|
|
23
|
+
"vitest": "^2.0.0"
|
|
24
|
+
}
|
|
25
|
+
}
|