@facesignai/api 1.0.27 → 1.0.28
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/build/package.json
CHANGED
package/build/src/client.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,eAAe,EACf,qBAAqB,EACrB,MAAM,EAEN,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,4BAA4B,EAE5B,YAAY,EAEZ,gBAAgB,EAGhB,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EAEpB,MAAM,iBAAiB,CAAA;AAIxB,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,eAAe,CAAA;AAE/E,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,cAAM,MAAM;;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,eAAe,EACf,qBAAqB,EACrB,MAAM,EAEN,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,4BAA4B,EAE5B,YAAY,EAEZ,gBAAgB,EAGhB,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EAEpB,MAAM,iBAAiB,CAAA;AAIxB,KAAK,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,eAAe,CAAA;AAE/E,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,WAAW,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,cAAM,MAAM;;gBAOS,OAAO,CAAC,EAAE,aAAa;IAiB1C,OAAO,CAAC,sBAAsB;IAY9B,OAAO,CAAC,WAAW;YA6BL,OAAO;IA2ErB,SAAgB,OAAO;QACrB;;WAEG;uBACY,eAAe,KAAG,QAAQ,qBAAqB,CAAC;QAQ/D;;WAEG;yBACc,oBAAoB,KAAG,QAAQ,kBAAkB,CAAC;QAQnE;;WAEG;mCACwB,4BAA4B;QAQvD;;WAEG;sBACW,qBAAqB,KAAG,QAAQ,mBAAmB,CAAC;;MAqBnE;IAED,SAAgB,KAAK;QACnB;;WAEG;wBACW,QAAQ,gBAAgB,CAAC;MAQxC;IAED,SAAgB,OAAO;QACrB;;WAEG;wBACW,QAAQ,kBAAkB,CAAC;MAQ1C;CACF;AAED,eAAe,MAAM,CAAA"}
|
package/build/src/client.js
CHANGED
|
@@ -119,6 +119,9 @@ class Client {
|
|
|
119
119
|
if (options === null || options === void 0 ? void 0 : options.serverUrl) {
|
|
120
120
|
__classPrivateFieldSet(this, _Client_serverUrl, options.serverUrl, "f");
|
|
121
121
|
}
|
|
122
|
+
else if (options === null || options === void 0 ? void 0 : options.auth) {
|
|
123
|
+
__classPrivateFieldSet(this, _Client_serverUrl, this.getServerUrlFromApiKey(options.auth), "f");
|
|
124
|
+
}
|
|
122
125
|
if (options && options.logLevel) {
|
|
123
126
|
this.setLogLevel(options.logLevel);
|
|
124
127
|
}
|
|
@@ -126,6 +129,17 @@ class Client {
|
|
|
126
129
|
loglevel_1.default.disableAll();
|
|
127
130
|
}
|
|
128
131
|
}
|
|
132
|
+
getServerUrlFromApiKey(apiKey) {
|
|
133
|
+
if (apiKey.startsWith('sk_live_')) {
|
|
134
|
+
return 'https://api.facesign.ai';
|
|
135
|
+
}
|
|
136
|
+
else if (apiKey.startsWith('sk_test_')) {
|
|
137
|
+
return 'https://api.dev.facesign.ai';
|
|
138
|
+
}
|
|
139
|
+
// Default fallback for keys without prefix (backward compatibility)
|
|
140
|
+
loglevel_1.default.warn('API key does not have a recognized prefix (sk_live_ or sk_test_). Using default production URL.');
|
|
141
|
+
return 'https://api.facesign.ai';
|
|
142
|
+
}
|
|
129
143
|
setLogLevel(logLevel) {
|
|
130
144
|
switch (logLevel) {
|
|
131
145
|
case api_endpoints_1.ILogLevel.DEBUG: {
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
export interface Device {
|
|
1
|
+
export interface Device extends Record<string, unknown> {
|
|
2
|
+
isYaBrowser: boolean;
|
|
3
|
+
isAuthoritative: boolean;
|
|
2
4
|
isMobile: boolean;
|
|
3
5
|
isMobileNative: boolean;
|
|
4
6
|
isTablet: boolean;
|
|
5
7
|
isiPad: boolean;
|
|
6
8
|
isiPod: boolean;
|
|
7
9
|
isiPhone: boolean;
|
|
10
|
+
isiPhoneNative: boolean;
|
|
8
11
|
isAndroid: boolean;
|
|
12
|
+
isAndroidNative: boolean;
|
|
9
13
|
isBlackberry: boolean;
|
|
10
14
|
isOpera: boolean;
|
|
11
15
|
isIE: boolean;
|
|
@@ -20,10 +24,10 @@ export interface Device {
|
|
|
20
24
|
isSeaMonkey: boolean;
|
|
21
25
|
isFlock: boolean;
|
|
22
26
|
isAmaya: boolean;
|
|
27
|
+
isPhantomJS: boolean;
|
|
23
28
|
isEpiphany: boolean;
|
|
24
29
|
isDesktop: boolean;
|
|
25
30
|
isWindows: boolean;
|
|
26
|
-
isWindowsPhone: boolean;
|
|
27
31
|
isLinux: boolean;
|
|
28
32
|
isLinux64: boolean;
|
|
29
33
|
isMac: boolean;
|
|
@@ -31,7 +35,7 @@ export interface Device {
|
|
|
31
35
|
isBada: boolean;
|
|
32
36
|
isSamsung: boolean;
|
|
33
37
|
isRaspberry: boolean;
|
|
34
|
-
isBot: boolean;
|
|
38
|
+
isBot: boolean | string;
|
|
35
39
|
isCurl: boolean;
|
|
36
40
|
isAndroidTablet: boolean;
|
|
37
41
|
isWinJs: boolean;
|
|
@@ -39,14 +43,20 @@ export interface Device {
|
|
|
39
43
|
isSilk: boolean;
|
|
40
44
|
isCaptive: boolean;
|
|
41
45
|
isSmartTV: boolean;
|
|
46
|
+
isUC: boolean;
|
|
47
|
+
isFacebook: boolean;
|
|
48
|
+
isAlamoFire: boolean;
|
|
49
|
+
isElectron: boolean;
|
|
42
50
|
silkAccelerated: boolean;
|
|
43
51
|
browser: string;
|
|
44
|
-
version: string;
|
|
52
|
+
version: string | number;
|
|
45
53
|
os: string;
|
|
46
54
|
platform: string;
|
|
47
|
-
geoIp:
|
|
48
|
-
[key: string]: unknown;
|
|
49
|
-
};
|
|
55
|
+
geoIp: Record<string, string | string[]>;
|
|
50
56
|
source: string;
|
|
57
|
+
isWechat: boolean;
|
|
58
|
+
isWindowsPhone: boolean;
|
|
59
|
+
electronVersion: string;
|
|
60
|
+
SilkAccelerated?: boolean;
|
|
51
61
|
}
|
|
52
62
|
//# sourceMappingURL=deviceDetails.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deviceDetails.d.ts","sourceRoot":"","sources":["../../../src/types/deviceDetails.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;
|
|
1
|
+
{"version":3,"file":"deviceDetails.d.ts","sourceRoot":"","sources":["../../../src/types/deviceDetails.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAO,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IACrD,WAAW,EAAE,OAAO,CAAA;IACpB,eAAe,EAAE,OAAO,CAAA;IACxB,QAAQ,EAAE,OAAO,CAAA;IACjB,cAAc,EAAE,OAAO,CAAA;IACvB,QAAQ,EAAE,OAAO,CAAA;IACjB,MAAM,EAAE,OAAO,CAAA;IACf,M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