@dtect/security-sdk-js 0.0.2 → 0.0.3
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.mts +52 -0
- package/dist/index.d.ts +52 -0
- package/package.json +2 -2
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
interface ISecurityCheckInput {
|
|
2
|
+
projectId: string;
|
|
3
|
+
visitorId?: string;
|
|
4
|
+
securitySettings?: {
|
|
5
|
+
countriesAllowed?: string[];
|
|
6
|
+
};
|
|
7
|
+
metaData?: any;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface ISecurityResultResponse {
|
|
11
|
+
results: {
|
|
12
|
+
dtectScore: string;
|
|
13
|
+
isDuplicateDevice: boolean;
|
|
14
|
+
isDuplicateIp: boolean;
|
|
15
|
+
isDuplicateId: boolean;
|
|
16
|
+
isLocationBlocked: boolean;
|
|
17
|
+
isLocationInvalid: boolean;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
interface ISecurityTokenResponse {
|
|
21
|
+
token: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface ISecurityAPIInitProps {
|
|
25
|
+
clientId: string;
|
|
26
|
+
apiKey: string;
|
|
27
|
+
endpoint?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface Idtect {
|
|
31
|
+
init: (props: ISecurityAPIInitProps) => Promise<IdtectModule | undefined>;
|
|
32
|
+
getSecurityResult: (props: ISecurityCheckInput) => Promise<ISecurityResultResponse>;
|
|
33
|
+
getSecurityToken: (props: ISecurityCheckInput) => Promise<ISecurityTokenResponse>;
|
|
34
|
+
}
|
|
35
|
+
type IdtectModule = Omit<Idtect, "init">;
|
|
36
|
+
|
|
37
|
+
declare var dtect: Idtect;
|
|
38
|
+
declare const SecurityAPIError: {
|
|
39
|
+
FAILED_TO_GET_SECURITY_TOKEN: string;
|
|
40
|
+
FAILED_TO_GET_SECURITY_RESULT: string;
|
|
41
|
+
INVALID_CREDENTIALS: "Invalid Public Client ID or Public API Key";
|
|
42
|
+
SDK_INIT_ERROR: string;
|
|
43
|
+
DUPLICATE_INITIALIZATION: string;
|
|
44
|
+
NOT_INITIALIZED: string;
|
|
45
|
+
INTERNAL_SERVER_ERROR: "Internal Server Error during API Request";
|
|
46
|
+
MISSING_CREDENTIALS: "Missing Public Client ID or Public API Key";
|
|
47
|
+
};
|
|
48
|
+
declare function init(props: ISecurityAPIInitProps): Promise<IdtectModule>;
|
|
49
|
+
declare function getSecurityResult(props: ISecurityCheckInput): Promise<ISecurityResultResponse>;
|
|
50
|
+
declare function getSecurityToken(props: ISecurityCheckInput): Promise<ISecurityTokenResponse>;
|
|
51
|
+
|
|
52
|
+
export { SecurityAPIError, dtect as default, getSecurityResult, getSecurityToken, init };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
interface ISecurityCheckInput {
|
|
2
|
+
projectId: string;
|
|
3
|
+
visitorId?: string;
|
|
4
|
+
securitySettings?: {
|
|
5
|
+
countriesAllowed?: string[];
|
|
6
|
+
};
|
|
7
|
+
metaData?: any;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
interface ISecurityResultResponse {
|
|
11
|
+
results: {
|
|
12
|
+
dtectScore: string;
|
|
13
|
+
isDuplicateDevice: boolean;
|
|
14
|
+
isDuplicateIp: boolean;
|
|
15
|
+
isDuplicateId: boolean;
|
|
16
|
+
isLocationBlocked: boolean;
|
|
17
|
+
isLocationInvalid: boolean;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
interface ISecurityTokenResponse {
|
|
21
|
+
token: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
interface ISecurityAPIInitProps {
|
|
25
|
+
clientId: string;
|
|
26
|
+
apiKey: string;
|
|
27
|
+
endpoint?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
interface Idtect {
|
|
31
|
+
init: (props: ISecurityAPIInitProps) => Promise<IdtectModule | undefined>;
|
|
32
|
+
getSecurityResult: (props: ISecurityCheckInput) => Promise<ISecurityResultResponse>;
|
|
33
|
+
getSecurityToken: (props: ISecurityCheckInput) => Promise<ISecurityTokenResponse>;
|
|
34
|
+
}
|
|
35
|
+
type IdtectModule = Omit<Idtect, "init">;
|
|
36
|
+
|
|
37
|
+
declare var dtect: Idtect;
|
|
38
|
+
declare const SecurityAPIError: {
|
|
39
|
+
FAILED_TO_GET_SECURITY_TOKEN: string;
|
|
40
|
+
FAILED_TO_GET_SECURITY_RESULT: string;
|
|
41
|
+
INVALID_CREDENTIALS: "Invalid Public Client ID or Public API Key";
|
|
42
|
+
SDK_INIT_ERROR: string;
|
|
43
|
+
DUPLICATE_INITIALIZATION: string;
|
|
44
|
+
NOT_INITIALIZED: string;
|
|
45
|
+
INTERNAL_SERVER_ERROR: "Internal Server Error during API Request";
|
|
46
|
+
MISSING_CREDENTIALS: "Missing Public Client ID or Public API Key";
|
|
47
|
+
};
|
|
48
|
+
declare function init(props: ISecurityAPIInitProps): Promise<IdtectModule>;
|
|
49
|
+
declare function getSecurityResult(props: ISecurityCheckInput): Promise<ISecurityResultResponse>;
|
|
50
|
+
declare function getSecurityToken(props: ISecurityCheckInput): Promise<ISecurityTokenResponse>;
|
|
51
|
+
|
|
52
|
+
export { SecurityAPIError, dtect as default, getSecurityResult, getSecurityToken, init };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dtect/security-sdk-js",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"module": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -29,6 +29,6 @@
|
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"files": [
|
|
32
|
-
"dist
|
|
32
|
+
"dist"
|
|
33
33
|
]
|
|
34
34
|
}
|