@prosopo/procaptcha 0.2.10 → 0.2.13
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/api/handlers.d.ts +2 -3
- package/dist/api/handlers.d.ts.map +1 -1
- package/dist/api/handlers.js +23 -1
- package/dist/api/handlers.js.map +1 -1
- package/dist/api/index.d.ts +0 -1
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +0 -1
- package/dist/api/index.js.map +1 -1
- package/dist/cjs/api/handlers.cjs +10 -1
- package/dist/cjs/api/index.cjs +0 -3
- package/dist/cjs/contracts/captcha/dist/contract-info/captcha.cjs +2 -2
- package/dist/cjs/index.cjs +0 -2
- package/dist/cjs/modules/Manager.cjs +209 -210
- package/dist/cjs/packages/datasets/dist/captcha/util.cjs +6 -2
- package/dist/modules/Manager.d.ts.map +1 -1
- package/dist/modules/Manager.js +265 -249
- package/dist/modules/Manager.js.map +1 -1
- package/dist/modules/ProsopoCaptchaApi.d.ts.map +1 -1
- package/dist/modules/ProsopoCaptchaApi.js +13 -0
- package/dist/modules/ProsopoCaptchaApi.js.map +1 -1
- package/package.json +23 -15
- package/dist/api/HttpClientBase.d.ts +0 -9
- package/dist/api/HttpClientBase.d.ts.map +0 -1
- package/dist/api/HttpClientBase.js +0 -28
- package/dist/api/HttpClientBase.js.map +0 -1
- package/dist/cjs/api/HttpClientBase.cjs +0 -17
package/dist/api/handlers.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { AxiosError } from 'axios';
|
|
2
1
|
export declare class ProsopoApiError extends Error {
|
|
3
|
-
cause:
|
|
4
|
-
constructor(error:
|
|
2
|
+
cause: Response | Error;
|
|
3
|
+
constructor(error: Response | Error, context?: string, ...params: any[]);
|
|
5
4
|
}
|
|
6
5
|
//# sourceMappingURL=handlers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/api/handlers.ts"],"names":[],"mappings":"AAaA,
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/api/handlers.ts"],"names":[],"mappings":"AAaA,qBAAa,eAAgB,SAAQ,KAAK;IACtC,KAAK,EAAE,QAAQ,GAAG,KAAK,CAAA;gBACX,KAAK,EAAE,QAAQ,GAAG,KAAK,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE;CAgB1E"}
|
package/dist/api/handlers.js
CHANGED
|
@@ -1,6 +1,28 @@
|
|
|
1
|
+
// Copyright 2021-2023 Prosopo (UK) Ltd.
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
1
14
|
export class ProsopoApiError extends Error {
|
|
2
15
|
constructor(error, context, ...params) {
|
|
3
|
-
|
|
16
|
+
// If error is an instance of Response, it's an HTTP error
|
|
17
|
+
if (error instanceof Response) {
|
|
18
|
+
super(`HTTP Error: ${error.status} ${error.statusText}`);
|
|
19
|
+
this.cause = error;
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
// Otherwise, it's a network error, or something else
|
|
23
|
+
super(error.message || 'Unknown API Error');
|
|
24
|
+
this.cause = error;
|
|
25
|
+
}
|
|
4
26
|
this.name = (context && `${ProsopoApiError.name}@${context}`) || ProsopoApiError.name;
|
|
5
27
|
console.error('\n********************* ERROR *********************\n');
|
|
6
28
|
console.error(this.cause, this.stack, ...params);
|
package/dist/api/handlers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../src/api/handlers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"handlers.js","sourceRoot":"","sources":["../../src/api/handlers.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAEtC,YAAY,KAAuB,EAAE,OAAgB,EAAE,GAAG,MAAa;QACnE,0DAA0D;QAC1D,IAAI,KAAK,YAAY,QAAQ,EAAE;YAC3B,KAAK,CAAC,eAAe,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,UAAU,EAAE,CAAC,CAAA;YACxD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;SACrB;aAAM;YACH,qDAAqD;YACrD,KAAK,CAAC,KAAK,CAAC,OAAO,IAAI,mBAAmB,CAAC,CAAA;YAC3C,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;SACrB;QAED,IAAI,CAAC,IAAI,GAAG,CAAC,OAAO,IAAI,GAAG,eAAe,CAAC,IAAI,IAAI,OAAO,EAAE,CAAC,IAAI,eAAe,CAAC,IAAI,CAAA;QAErF,OAAO,CAAC,KAAK,CAAC,uDAAuD,CAAC,CAAA;QACtE,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,GAAG,MAAM,CAAC,CAAA;IACpD,CAAC;CACJ"}
|
package/dist/api/index.d.ts
CHANGED
package/dist/api/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAaA,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAaA,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA"}
|
package/dist/api/index.js
CHANGED
package/dist/api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,cAAc,oBAAoB,CAAA;AAClC,cAAc,oBAAoB,CAAA"}
|
|
@@ -2,7 +2,16 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
class ProsopoApiError extends Error {
|
|
4
4
|
constructor(error, context, ...params) {
|
|
5
|
-
|
|
5
|
+
var __super = (...args) => {
|
|
6
|
+
super(...args);
|
|
7
|
+
};
|
|
8
|
+
if (error instanceof Response) {
|
|
9
|
+
__super(`HTTP Error: ${error.status} ${error.statusText}`);
|
|
10
|
+
this.cause = error;
|
|
11
|
+
} else {
|
|
12
|
+
__super(error.message || "Unknown API Error");
|
|
13
|
+
this.cause = error;
|
|
14
|
+
}
|
|
6
15
|
this.name = context && `${ProsopoApiError.name}@${context}` || ProsopoApiError.name;
|
|
7
16
|
console.error("\n********************* ERROR *********************\n");
|
|
8
17
|
console.error(this.cause, this.stack, ...params);
|
package/dist/cjs/api/index.cjs
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
2
|
require("./ExtensionWeb3.cjs");
|
|
4
3
|
require("./ExtensionWeb2.cjs");
|
|
5
|
-
const HttpClientBase = require("./HttpClientBase.cjs");
|
|
6
|
-
exports.HttpClientBase = HttpClientBase.HttpClientBase;
|