@dtect/security-sdk-js 0.0.13 → 0.0.15
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 +79 -8
- package/dist/index.d.ts +79 -8
- package/dist/index.js +1 -4
- package/dist/index.mjs +1 -4
- package/package.json +2 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,73 @@
|
|
|
1
1
|
interface ISecurityCheckInput {
|
|
2
|
-
projectId: string;
|
|
3
|
-
visitorId?: string;
|
|
2
|
+
projectId: string | number;
|
|
3
|
+
visitorId?: string | number;
|
|
4
4
|
securitySettings?: {
|
|
5
5
|
countriesAllowed?: string[];
|
|
6
6
|
};
|
|
7
7
|
metaData?: any;
|
|
8
8
|
}
|
|
9
|
+
interface IIsAiUsageDetectedInput {
|
|
10
|
+
projectId: string | number;
|
|
11
|
+
visitorId?: string | number;
|
|
12
|
+
timeTakenSeconds?: number;
|
|
13
|
+
qbc?: boolean;
|
|
14
|
+
mas?: boolean;
|
|
15
|
+
scb?: number;
|
|
16
|
+
apd?: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface ICheckQualityQuestionsInput {
|
|
19
|
+
projectId: string | number;
|
|
20
|
+
visitorId?: string | number;
|
|
21
|
+
questions: {
|
|
22
|
+
questionId: string;
|
|
23
|
+
answers: string[];
|
|
24
|
+
}[];
|
|
25
|
+
}
|
|
26
|
+
interface IGetQualityQuestionsInput {
|
|
27
|
+
respondentType: string;
|
|
28
|
+
language: string;
|
|
29
|
+
}
|
|
30
|
+
declare enum LanguageCodes {
|
|
31
|
+
AR = "ar",
|
|
32
|
+
BN = "bn",
|
|
33
|
+
DE = "de",
|
|
34
|
+
EN = "en",
|
|
35
|
+
ES = "es",
|
|
36
|
+
FR = "fr",
|
|
37
|
+
HI = "hi",
|
|
38
|
+
ID = "id",
|
|
39
|
+
IT = "it",
|
|
40
|
+
JA = "ja",
|
|
41
|
+
KO = "ko",
|
|
42
|
+
MS = "ms",
|
|
43
|
+
NL = "nl",
|
|
44
|
+
PT = "pt",
|
|
45
|
+
RU = "ru",
|
|
46
|
+
YU = "yu",
|
|
47
|
+
ZH = "zh"
|
|
48
|
+
}
|
|
49
|
+
declare enum QualityQuestionsRespondentTypes {
|
|
50
|
+
GeneralConsumer = "general-consumer",
|
|
51
|
+
HRManagerDirector = "hr-manager-director",
|
|
52
|
+
WebDeveloper = "web-developer",
|
|
53
|
+
SoftwareEngineer = "software-engineer",
|
|
54
|
+
ITDirector = "it-director",
|
|
55
|
+
BusinessAdministrator = "business-administrator",
|
|
56
|
+
AccountsPayableManager = "accounts-payable-manager",
|
|
57
|
+
Accountant = "accountant",
|
|
58
|
+
FinanceDirector = "finance-director",
|
|
59
|
+
SmallBusinessOwner = "small-business-owner",
|
|
60
|
+
GeneralContractor = "general-contractor",
|
|
61
|
+
MarketingManagerDirector = "marketing-manager-director",
|
|
62
|
+
ConsumerShopper = "consumer-shopper",
|
|
63
|
+
Travel = "travel",
|
|
64
|
+
Entertainment = "entertainment",
|
|
65
|
+
FinanceAndBanking = "finance-and-banking",
|
|
66
|
+
General = "general",
|
|
67
|
+
B2BWhiteCollar = "b2b-white-collar",
|
|
68
|
+
B2BBlueCollar = "b2b-blue-collar",
|
|
69
|
+
Lawyer = "lawyer"
|
|
70
|
+
}
|
|
9
71
|
|
|
10
72
|
interface ISecurityResultResponse {
|
|
11
73
|
results: {
|
|
@@ -36,16 +98,22 @@ interface ISecurityAPIInitProps {
|
|
|
36
98
|
clientId: string;
|
|
37
99
|
apiKey: string;
|
|
38
100
|
endpoint?: string;
|
|
101
|
+
includeResults?: boolean;
|
|
39
102
|
}
|
|
40
103
|
|
|
41
104
|
interface Idtect {
|
|
42
105
|
init: (props: ISecurityAPIInitProps) => Promise<IdtectModule | undefined>;
|
|
43
|
-
getSecurityResult: (props: ISecurityCheckInput) => Promise<ISecurityResultResponse>;
|
|
44
|
-
getSecurityToken: (props: ISecurityCheckInput) => Promise<ISecurityTokenResponse>;
|
|
106
|
+
getSecurityResult: (props: ISecurityCheckInput) => Promise<ISecurityResultResponse | ISecurityTokenResponse>;
|
|
107
|
+
getSecurityToken: (props: ISecurityCheckInput) => Promise<ISecurityResultResponse | ISecurityTokenResponse>;
|
|
108
|
+
isAIUsageDetected: (props: IIsAiUsageDetectedInput) => Promise<ISecurityResultResponse | ISecurityTokenResponse | undefined>;
|
|
109
|
+
checkQualityQuestions: (props: ICheckQualityQuestionsInput) => Promise<ISecurityResultResponse | ISecurityTokenResponse | undefined>;
|
|
110
|
+
getQualityQuestions: (props: IGetQualityQuestionsInput) => Promise<ISecurityResultResponse | ISecurityTokenResponse | undefined>;
|
|
111
|
+
QualityQuestionsRespondentTypes: typeof QualityQuestionsRespondentTypes;
|
|
112
|
+
LanguageCodes: typeof LanguageCodes;
|
|
45
113
|
}
|
|
46
114
|
type IdtectModule = Omit<Idtect, "init">;
|
|
47
115
|
|
|
48
|
-
declare
|
|
116
|
+
declare let dtect: Idtect;
|
|
49
117
|
declare const SecurityAPIError: {
|
|
50
118
|
FAILED_TO_GET_SECURITY_TOKEN: string;
|
|
51
119
|
FAILED_TO_GET_SECURITY_RESULT: string;
|
|
@@ -58,8 +126,11 @@ declare const SecurityAPIError: {
|
|
|
58
126
|
MAINTENANCE_MODE: "API Under Maintenance";
|
|
59
127
|
RATE_LIMIT_REACHED: "Too many requests. Rate limit exceeded";
|
|
60
128
|
};
|
|
129
|
+
declare function getSecurityResult(props: ISecurityCheckInput): Promise<ISecurityResultResponse | ISecurityTokenResponse>;
|
|
130
|
+
declare function getSecurityToken(props: ISecurityCheckInput): Promise<ISecurityResultResponse | ISecurityTokenResponse>;
|
|
131
|
+
declare function getQualityQuestions(props: IGetQualityQuestionsInput): Promise<ISecurityResultResponse | ISecurityTokenResponse | undefined>;
|
|
132
|
+
declare function checkQualityQuestions(props: ICheckQualityQuestionsInput): Promise<ISecurityResultResponse | ISecurityTokenResponse | undefined>;
|
|
133
|
+
declare function isAIUsageDetected(props: IIsAiUsageDetectedInput): Promise<ISecurityResultResponse | ISecurityTokenResponse | undefined>;
|
|
61
134
|
declare function init(props: ISecurityAPIInitProps): Promise<IdtectModule>;
|
|
62
|
-
declare function getSecurityResult(props: ISecurityCheckInput): Promise<ISecurityResultResponse>;
|
|
63
|
-
declare function getSecurityToken(props: ISecurityCheckInput): Promise<ISecurityTokenResponse>;
|
|
64
135
|
|
|
65
|
-
export { SecurityAPIError, dtect as default, getSecurityResult, getSecurityToken, init };
|
|
136
|
+
export { LanguageCodes, QualityQuestionsRespondentTypes, SecurityAPIError, checkQualityQuestions, dtect as default, getQualityQuestions, getSecurityResult, getSecurityToken, init, isAIUsageDetected };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,73 @@
|
|
|
1
1
|
interface ISecurityCheckInput {
|
|
2
|
-
projectId: string;
|
|
3
|
-
visitorId?: string;
|
|
2
|
+
projectId: string | number;
|
|
3
|
+
visitorId?: string | number;
|
|
4
4
|
securitySettings?: {
|
|
5
5
|
countriesAllowed?: string[];
|
|
6
6
|
};
|
|
7
7
|
metaData?: any;
|
|
8
8
|
}
|
|
9
|
+
interface IIsAiUsageDetectedInput {
|
|
10
|
+
projectId: string | number;
|
|
11
|
+
visitorId?: string | number;
|
|
12
|
+
timeTakenSeconds?: number;
|
|
13
|
+
qbc?: boolean;
|
|
14
|
+
mas?: boolean;
|
|
15
|
+
scb?: number;
|
|
16
|
+
apd?: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface ICheckQualityQuestionsInput {
|
|
19
|
+
projectId: string | number;
|
|
20
|
+
visitorId?: string | number;
|
|
21
|
+
questions: {
|
|
22
|
+
questionId: string;
|
|
23
|
+
answers: string[];
|
|
24
|
+
}[];
|
|
25
|
+
}
|
|
26
|
+
interface IGetQualityQuestionsInput {
|
|
27
|
+
respondentType: string;
|
|
28
|
+
language: string;
|
|
29
|
+
}
|
|
30
|
+
declare enum LanguageCodes {
|
|
31
|
+
AR = "ar",
|
|
32
|
+
BN = "bn",
|
|
33
|
+
DE = "de",
|
|
34
|
+
EN = "en",
|
|
35
|
+
ES = "es",
|
|
36
|
+
FR = "fr",
|
|
37
|
+
HI = "hi",
|
|
38
|
+
ID = "id",
|
|
39
|
+
IT = "it",
|
|
40
|
+
JA = "ja",
|
|
41
|
+
KO = "ko",
|
|
42
|
+
MS = "ms",
|
|
43
|
+
NL = "nl",
|
|
44
|
+
PT = "pt",
|
|
45
|
+
RU = "ru",
|
|
46
|
+
YU = "yu",
|
|
47
|
+
ZH = "zh"
|
|
48
|
+
}
|
|
49
|
+
declare enum QualityQuestionsRespondentTypes {
|
|
50
|
+
GeneralConsumer = "general-consumer",
|
|
51
|
+
HRManagerDirector = "hr-manager-director",
|
|
52
|
+
WebDeveloper = "web-developer",
|
|
53
|
+
SoftwareEngineer = "software-engineer",
|
|
54
|
+
ITDirector = "it-director",
|
|
55
|
+
BusinessAdministrator = "business-administrator",
|
|
56
|
+
AccountsPayableManager = "accounts-payable-manager",
|
|
57
|
+
Accountant = "accountant",
|
|
58
|
+
FinanceDirector = "finance-director",
|
|
59
|
+
SmallBusinessOwner = "small-business-owner",
|
|
60
|
+
GeneralContractor = "general-contractor",
|
|
61
|
+
MarketingManagerDirector = "marketing-manager-director",
|
|
62
|
+
ConsumerShopper = "consumer-shopper",
|
|
63
|
+
Travel = "travel",
|
|
64
|
+
Entertainment = "entertainment",
|
|
65
|
+
FinanceAndBanking = "finance-and-banking",
|
|
66
|
+
General = "general",
|
|
67
|
+
B2BWhiteCollar = "b2b-white-collar",
|
|
68
|
+
B2BBlueCollar = "b2b-blue-collar",
|
|
69
|
+
Lawyer = "lawyer"
|
|
70
|
+
}
|
|
9
71
|
|
|
10
72
|
interface ISecurityResultResponse {
|
|
11
73
|
results: {
|
|
@@ -36,16 +98,22 @@ interface ISecurityAPIInitProps {
|
|
|
36
98
|
clientId: string;
|
|
37
99
|
apiKey: string;
|
|
38
100
|
endpoint?: string;
|
|
101
|
+
includeResults?: boolean;
|
|
39
102
|
}
|
|
40
103
|
|
|
41
104
|
interface Idtect {
|
|
42
105
|
init: (props: ISecurityAPIInitProps) => Promise<IdtectModule | undefined>;
|
|
43
|
-
getSecurityResult: (props: ISecurityCheckInput) => Promise<ISecurityResultResponse>;
|
|
44
|
-
getSecurityToken: (props: ISecurityCheckInput) => Promise<ISecurityTokenResponse>;
|
|
106
|
+
getSecurityResult: (props: ISecurityCheckInput) => Promise<ISecurityResultResponse | ISecurityTokenResponse>;
|
|
107
|
+
getSecurityToken: (props: ISecurityCheckInput) => Promise<ISecurityResultResponse | ISecurityTokenResponse>;
|
|
108
|
+
isAIUsageDetected: (props: IIsAiUsageDetectedInput) => Promise<ISecurityResultResponse | ISecurityTokenResponse | undefined>;
|
|
109
|
+
checkQualityQuestions: (props: ICheckQualityQuestionsInput) => Promise<ISecurityResultResponse | ISecurityTokenResponse | undefined>;
|
|
110
|
+
getQualityQuestions: (props: IGetQualityQuestionsInput) => Promise<ISecurityResultResponse | ISecurityTokenResponse | undefined>;
|
|
111
|
+
QualityQuestionsRespondentTypes: typeof QualityQuestionsRespondentTypes;
|
|
112
|
+
LanguageCodes: typeof LanguageCodes;
|
|
45
113
|
}
|
|
46
114
|
type IdtectModule = Omit<Idtect, "init">;
|
|
47
115
|
|
|
48
|
-
declare
|
|
116
|
+
declare let dtect: Idtect;
|
|
49
117
|
declare const SecurityAPIError: {
|
|
50
118
|
FAILED_TO_GET_SECURITY_TOKEN: string;
|
|
51
119
|
FAILED_TO_GET_SECURITY_RESULT: string;
|
|
@@ -58,8 +126,11 @@ declare const SecurityAPIError: {
|
|
|
58
126
|
MAINTENANCE_MODE: "API Under Maintenance";
|
|
59
127
|
RATE_LIMIT_REACHED: "Too many requests. Rate limit exceeded";
|
|
60
128
|
};
|
|
129
|
+
declare function getSecurityResult(props: ISecurityCheckInput): Promise<ISecurityResultResponse | ISecurityTokenResponse>;
|
|
130
|
+
declare function getSecurityToken(props: ISecurityCheckInput): Promise<ISecurityResultResponse | ISecurityTokenResponse>;
|
|
131
|
+
declare function getQualityQuestions(props: IGetQualityQuestionsInput): Promise<ISecurityResultResponse | ISecurityTokenResponse | undefined>;
|
|
132
|
+
declare function checkQualityQuestions(props: ICheckQualityQuestionsInput): Promise<ISecurityResultResponse | ISecurityTokenResponse | undefined>;
|
|
133
|
+
declare function isAIUsageDetected(props: IIsAiUsageDetectedInput): Promise<ISecurityResultResponse | ISecurityTokenResponse | undefined>;
|
|
61
134
|
declare function init(props: ISecurityAPIInitProps): Promise<IdtectModule>;
|
|
62
|
-
declare function getSecurityResult(props: ISecurityCheckInput): Promise<ISecurityResultResponse>;
|
|
63
|
-
declare function getSecurityToken(props: ISecurityCheckInput): Promise<ISecurityTokenResponse>;
|
|
64
135
|
|
|
65
|
-
export { SecurityAPIError, dtect as default, getSecurityResult, getSecurityToken, init };
|
|
136
|
+
export { LanguageCodes, QualityQuestionsRespondentTypes, SecurityAPIError, checkQualityQuestions, dtect as default, getQualityQuestions, getSecurityResult, getSecurityToken, init, isAIUsageDetected };
|