@deflectbot/deflect-sdk 1.0.2

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/.gitattributes ADDED
@@ -0,0 +1,2 @@
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
package/README.md ADDED
@@ -0,0 +1,9 @@
1
+ # Deflect - Antibot System
2
+
3
+ Deflect is an antibot solution that works with Vue, React, NextJS, and other JavaScript frameworks.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install deflect
9
+ ```
package/package.json ADDED
@@ -0,0 +1,16 @@
1
+ {
2
+ "name": "@deflectbot/deflect-sdk",
3
+ "version": "1.0.2",
4
+ "description": "",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "author": "Fredrik Rafn",
10
+ "license": "MIT",
11
+ "dependencies": {},
12
+ "devDependencies": {},
13
+ "publishConfig": {
14
+ "access": "public"
15
+ }
16
+ }
package/src/index.js ADDED
@@ -0,0 +1,26 @@
1
+ class Deflect {
2
+ constructor() {
3
+ this.config = {};
4
+ }
5
+
6
+
7
+ configure(params) {
8
+ this.config = { ...params };
9
+ console.log("Deflect configured with", this.config);
10
+ }
11
+
12
+ solveChallenge() {
13
+ return new Promise((resolve, reject) => {
14
+ if (!this.config.apiKey) {
15
+ return reject("API key is missing in configuration");
16
+ }
17
+
18
+ setTimeout(() => {
19
+ const token = "sample-token";
20
+ resolve(token);
21
+ }, 1000);
22
+ });
23
+ }
24
+ }
25
+
26
+ module.exports = new Deflect();