@prosopo/procaptcha 0.1.9 → 0.1.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/assets/contracts-page.png +0 -0
- package/dist/api/Extension.d.ts +16 -0
- package/dist/api/Extension.d.ts.map +1 -0
- package/dist/api/Extension.js +9 -0
- package/dist/api/Extension.js.map +1 -0
- package/dist/api/ExtensionWeb2.d.ts +11 -25
- package/dist/api/ExtensionWeb2.d.ts.map +1 -1
- package/dist/api/ExtensionWeb2.js +89 -94
- package/dist/api/ExtensionWeb2.js.map +1 -1
- package/dist/api/ExtensionWeb3.d.ts +6 -52
- package/dist/api/ExtensionWeb3.d.ts.map +1 -1
- package/dist/api/ExtensionWeb3.js +24 -142
- package/dist/api/ExtensionWeb3.js.map +1 -1
- package/dist/api/HttpClientBase.d.ts +1 -1
- package/dist/api/HttpClientBase.d.ts.map +1 -1
- package/dist/api/HttpClientBase.js +2 -2
- package/dist/api/HttpClientBase.js.map +1 -1
- package/dist/api/errors.d.ts +16 -0
- package/dist/api/errors.d.ts.map +1 -0
- package/dist/api/errors.js +34 -0
- package/dist/api/errors.js.map +1 -0
- package/dist/api/handlers.d.ts +2 -2
- package/dist/api/handlers.d.ts.map +1 -1
- package/dist/api/handlers.js +2 -10
- package/dist/api/handlers.js.map +1 -1
- package/dist/api/index.d.ts +0 -4
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +0 -4
- package/dist/api/index.js.map +1 -1
- package/dist/api/sign.d.ts +5 -0
- package/dist/api/sign.d.ts.map +1 -0
- package/dist/api/sign.js +16 -0
- package/dist/api/sign.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/modules/Manager.d.ts +22 -0
- package/dist/modules/Manager.d.ts.map +1 -0
- package/dist/modules/Manager.js +419 -0
- package/dist/modules/Manager.js.map +1 -0
- package/dist/modules/ProsopoCaptchaApi.d.ts +15 -15
- package/dist/modules/ProsopoCaptchaApi.d.ts.map +1 -1
- package/dist/modules/ProsopoCaptchaApi.js +60 -60
- package/dist/modules/ProsopoCaptchaApi.js.map +1 -1
- package/dist/modules/canvas.d.ts.map +1 -1
- package/dist/modules/canvas.js +84 -21
- package/dist/modules/canvas.js.map +1 -1
- package/dist/modules/index.d.ts +1 -6
- package/dist/modules/index.d.ts.map +1 -1
- package/dist/modules/index.js +1 -6
- package/dist/modules/index.js.map +1 -1
- package/dist/modules/storage.d.ts +10 -0
- package/dist/modules/storage.d.ts.map +1 -1
- package/dist/modules/storage.js +18 -3
- package/dist/modules/storage.js.map +1 -1
- package/dist/types/api.d.ts +8 -26
- package/dist/types/api.d.ts.map +1 -1
- package/dist/types/client.d.ts +4 -60
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/contract.d.ts +1 -1
- package/dist/types/contract.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/manager.d.ts +60 -0
- package/dist/types/manager.d.ts.map +1 -0
- package/dist/types/manager.js +3 -0
- package/dist/types/manager.js.map +1 -0
- package/dist/types/utils.d.ts +2 -0
- package/dist/types/utils.d.ts.map +1 -0
- package/dist/types/utils.js +3 -0
- package/dist/types/utils.js.map +1 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +5 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/utils.d.ts +2 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/utils/utils.js +8 -0
- package/dist/utils/utils.js.map +1 -0
- package/package.json +21 -23
- package/.eslintignore +0 -3
- package/.eslintrc.js +0 -37
- package/LICENSE +0 -201
- package/dist/api/AccountCreator.d.ts +0 -19
- package/dist/api/AccountCreator.d.ts.map +0 -1
- package/dist/api/AccountCreator.js +0 -88
- package/dist/api/AccountCreator.js.map +0 -1
- package/dist/api/AsyncFactory.d.ts +0 -7
- package/dist/api/AsyncFactory.d.ts.map +0 -1
- package/dist/api/AsyncFactory.js +0 -30
- package/dist/api/AsyncFactory.js.map +0 -1
- package/dist/api/ProsopoContract.d.ts +0 -13
- package/dist/api/ProsopoContract.d.ts.map +0 -1
- package/dist/api/ProsopoContract.js +0 -38
- package/dist/api/ProsopoContract.js.map +0 -1
- package/dist/api/ProsopoContractBase.d.ts +0 -32
- package/dist/api/ProsopoContractBase.d.ts.map +0 -1
- package/dist/api/ProsopoContractBase.js +0 -132
- package/dist/api/ProsopoContractBase.js.map +0 -1
- package/dist/api/ProviderApi.d.ts +0 -14
- package/dist/api/ProviderApi.d.ts.map +0 -1
- package/dist/api/ProviderApi.js +0 -53
- package/dist/api/ProviderApi.js.map +0 -1
- package/dist/modules/ProsopoCaptchaClient.d.ts +0 -26
- package/dist/modules/ProsopoCaptchaClient.d.ts.map +0 -1
- package/dist/modules/ProsopoCaptchaClient.js +0 -112
- package/dist/modules/ProsopoCaptchaClient.js.map +0 -1
- package/dist/modules/ProsopoCaptchaStateClient.d.ts +0 -18
- package/dist/modules/ProsopoCaptchaStateClient.d.ts.map +0 -1
- package/dist/modules/ProsopoCaptchaStateClient.js +0 -111
- package/dist/modules/ProsopoCaptchaStateClient.js.map +0 -1
- package/dist/modules/client.d.ts +0 -9
- package/dist/modules/client.d.ts.map +0 -1
- package/dist/modules/client.js +0 -40
- package/dist/modules/client.js.map +0 -1
- package/dist/modules/contract.d.ts +0 -7
- package/dist/modules/contract.d.ts.map +0 -1
- package/dist/modules/contract.js +0 -42
- package/dist/modules/contract.js.map +0 -1
- package/dist/modules/extension.d.ts +0 -4
- package/dist/modules/extension.d.ts.map +0 -1
- package/dist/modules/extension.js +0 -31
- package/dist/modules/extension.js.map +0 -1
- package/tsconfig.json +0 -24
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ExpiredError = exports.ExtensionNotFoundError = exports.AccountNotFoundError = exports.AccountCreationUnsupportedError = exports.NoExtensionsFoundError = void 0;
|
|
4
|
+
class NoExtensionsFoundError extends Error {
|
|
5
|
+
constructor(msg) {
|
|
6
|
+
super(msg || 'No extensions found');
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.NoExtensionsFoundError = NoExtensionsFoundError;
|
|
10
|
+
class AccountCreationUnsupportedError extends Error {
|
|
11
|
+
constructor(msg) {
|
|
12
|
+
super(msg || 'Account creation is not supported');
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
exports.AccountCreationUnsupportedError = AccountCreationUnsupportedError;
|
|
16
|
+
class AccountNotFoundError extends Error {
|
|
17
|
+
constructor(msg) {
|
|
18
|
+
super(msg || 'No account found');
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.AccountNotFoundError = AccountNotFoundError;
|
|
22
|
+
class ExtensionNotFoundError extends Error {
|
|
23
|
+
constructor(msg) {
|
|
24
|
+
super(msg || 'No extensions found');
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.ExtensionNotFoundError = ExtensionNotFoundError;
|
|
28
|
+
class ExpiredError extends Error {
|
|
29
|
+
constructor(msg) {
|
|
30
|
+
super(msg || 'The challenge has expired');
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.ExpiredError = ExpiredError;
|
|
34
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/api/errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,sBAAuB,SAAQ,KAAK;IAC7C,YAAY,GAAY;QACpB,KAAK,CAAC,GAAG,IAAI,qBAAqB,CAAC,CAAA;IACvC,CAAC;CACJ;AAJD,wDAIC;AAED,MAAa,+BAAgC,SAAQ,KAAK;IACtD,YAAY,GAAY;QACpB,KAAK,CAAC,GAAG,IAAI,mCAAmC,CAAC,CAAA;IACrD,CAAC;CACJ;AAJD,0EAIC;AAED,MAAa,oBAAqB,SAAQ,KAAK;IAC3C,YAAY,GAAY;QACpB,KAAK,CAAC,GAAG,IAAI,kBAAkB,CAAC,CAAA;IACpC,CAAC;CACJ;AAJD,oDAIC;AAED,MAAa,sBAAuB,SAAQ,KAAK;IAC7C,YAAY,GAAY;QACpB,KAAK,CAAC,GAAG,IAAI,qBAAqB,CAAC,CAAA;IACvC,CAAC;CACJ;AAJD,wDAIC;AAED,MAAa,YAAa,SAAQ,KAAK;IACnC,YAAY,GAAY;QACpB,KAAK,CAAC,GAAG,IAAI,2BAA2B,CAAC,CAAA;IAC7C,CAAC;CACJ;AAJD,oCAIC"}
|
package/dist/api/handlers.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AxiosError } from 'axios';
|
|
2
2
|
export declare class ProsopoApiError extends Error {
|
|
3
|
-
constructor(error:
|
|
3
|
+
constructor(error: AxiosError, context?: string, ...params: any[]);
|
|
4
4
|
}
|
|
5
5
|
//# sourceMappingURL=handlers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/api/handlers.ts"],"names":[],"mappings":"AAeA,OAAO,
|
|
1
|
+
{"version":3,"file":"handlers.d.ts","sourceRoot":"","sources":["../../src/api/handlers.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAElC,qBAAa,eAAgB,SAAQ,KAAK;gBAC1B,KAAK,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE;CAQpE"}
|
package/dist/api/handlers.js
CHANGED
|
@@ -3,16 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ProsopoApiError = void 0;
|
|
4
4
|
class ProsopoApiError extends Error {
|
|
5
5
|
constructor(error, context, ...params) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
else if ("statusText" in error) {
|
|
10
|
-
super(error.statusText);
|
|
11
|
-
}
|
|
12
|
-
else {
|
|
13
|
-
super(error.toString());
|
|
14
|
-
}
|
|
15
|
-
this.name = context && `${ProsopoApiError.name}@${context}` || ProsopoApiError.name;
|
|
6
|
+
super(error ? error.message : 'Unknown API Error');
|
|
7
|
+
this.name = (context && `${ProsopoApiError.name}@${context}`) || ProsopoApiError.name;
|
|
16
8
|
console.error('\n********************* ERROR *********************\n');
|
|
17
9
|
console.error(this.cause, this.stack, ...params);
|
|
18
10
|
}
|
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":";;;AAiBA,MAAa,eAAgB,SAAQ,KAAK;IACtC,YAAY,KAAiB,EAAE,OAAgB,EAAE,GAAG,MAAa;QAC7D,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAA;QAElD,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;AATD,0CASC"}
|
package/dist/api/index.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
export * from './AsyncFactory';
|
|
2
1
|
export * from './ExtensionWeb3';
|
|
3
2
|
export * from './ExtensionWeb2';
|
|
4
3
|
export * from './HttpClientBase';
|
|
5
|
-
export * from './ProsopoContract';
|
|
6
|
-
export * from './ProsopoContractBase';
|
|
7
|
-
export * from './ProviderApi';
|
|
8
4
|
//# sourceMappingURL=index.d.ts.map
|
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":"AAeA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":"AAeA,cAAc,iBAAiB,CAAA;AAC/B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,kBAAkB,CAAA"}
|
package/dist/api/index.js
CHANGED
|
@@ -16,11 +16,7 @@ const tslib_1 = require("tslib");
|
|
|
16
16
|
//
|
|
17
17
|
// You should have received a copy of the GNU General Public License
|
|
18
18
|
// along with procaptcha. If not, see <http://www.gnu.org/licenses/>.
|
|
19
|
-
tslib_1.__exportStar(require("./AsyncFactory"), exports);
|
|
20
19
|
tslib_1.__exportStar(require("./ExtensionWeb3"), exports);
|
|
21
20
|
tslib_1.__exportStar(require("./ExtensionWeb2"), exports);
|
|
22
21
|
tslib_1.__exportStar(require("./HttpClientBase"), exports);
|
|
23
|
-
tslib_1.__exportStar(require("./ProsopoContract"), exports);
|
|
24
|
-
tslib_1.__exportStar(require("./ProsopoContractBase"), exports);
|
|
25
|
-
tslib_1.__exportStar(require("./ProviderApi"), exports);
|
|
26
22
|
//# sourceMappingURL=index.js.map
|
package/dist/api/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,2EAA2E;AAC3E,EAAE;AACF,qEAAqE;AACrE,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,gEAAgE;AAChE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,sEAAsE;AACtE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/api/index.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,2EAA2E;AAC3E,EAAE;AACF,qEAAqE;AACrE,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,gEAAgE;AAChE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,sEAAsE;AACtE,0DAA+B;AAC/B,0DAA+B;AAC/B,2DAAgC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sign.d.ts","sourceRoot":"","sources":["../../src/api/sign.ts"],"names":[],"mappings":"AAIA,wBAAgB,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,KAAA,GAAG;IAAE,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAOzF"}
|
package/dist/api/sign.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sign = void 0;
|
|
4
|
+
const keyring_1 = require("@polkadot/keyring");
|
|
5
|
+
const util_crypto_1 = require("@polkadot/util-crypto");
|
|
6
|
+
const util_1 = require("@polkadot/util");
|
|
7
|
+
function sign(message, account) {
|
|
8
|
+
const keyring = new keyring_1.Keyring({ type: 'ecdsa' });
|
|
9
|
+
const pair = keyring.addFromUri('//Alice');
|
|
10
|
+
const sig = pair.sign(message);
|
|
11
|
+
const signature = (0, util_1.u8aToHex)(sig);
|
|
12
|
+
const messageHash = (0, util_crypto_1.blake2AsHex)(message);
|
|
13
|
+
return { messageHash, signature };
|
|
14
|
+
}
|
|
15
|
+
exports.sign = sign;
|
|
16
|
+
//# sourceMappingURL=sign.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sign.js","sourceRoot":"","sources":["../../src/api/sign.ts"],"names":[],"mappings":";;;AAAA,+CAA2C;AAC3C,uDAAmD;AACnD,yCAAyC;AAEzC,SAAgB,IAAI,CAAC,OAAe,EAAE,OAAO;IACzC,MAAM,OAAO,GAAG,IAAI,iBAAO,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;IAC9C,MAAM,IAAI,GAAG,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,CAAA;IAC1C,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAAA;IAC9B,MAAM,SAAS,GAAG,IAAA,eAAQ,EAAC,GAAG,CAAC,CAAA;IAC/B,MAAM,WAAW,GAAG,IAAA,yBAAW,EAAC,OAAO,CAAC,CAAA;IACxC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,CAAA;AACrC,CAAC;AAPD,oBAOC"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,cAAc,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAeA,cAAc,OAAO,CAAA;AACrB,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -19,4 +19,5 @@ const tslib_1 = require("tslib");
|
|
|
19
19
|
tslib_1.__exportStar(require("./api"), exports);
|
|
20
20
|
tslib_1.__exportStar(require("./modules"), exports);
|
|
21
21
|
tslib_1.__exportStar(require("./types"), exports);
|
|
22
|
+
tslib_1.__exportStar(require("./utils"), exports);
|
|
22
23
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,2EAA2E;AAC3E,EAAE;AACF,qEAAqE;AACrE,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,gEAAgE;AAChE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,sEAAsE;AACtE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,4CAA4C;AAC5C,2EAA2E;AAC3E,EAAE;AACF,qEAAqE;AACrE,uEAAuE;AACvE,oEAAoE;AACpE,sCAAsC;AACtC,EAAE;AACF,gEAAgE;AAChE,iEAAiE;AACjE,gEAAgE;AAChE,+CAA+C;AAC/C,EAAE;AACF,oEAAoE;AACpE,sEAAsE;AACtE,gDAAqB;AACrB,oDAAyB;AACzB,kDAAuB;AACvB,kDAAuB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ProcaptchaCallbacks, ProcaptchaConfigOptional, ProcaptchaState, ProcaptchaStateUpdateFn } from '../types/manager';
|
|
2
|
+
import { ProsopoClientConfig } from '@prosopo/types';
|
|
3
|
+
export declare const defaultState: () => Partial<ProcaptchaState>;
|
|
4
|
+
export declare const getNetwork: (config: ProsopoClientConfig) => {
|
|
5
|
+
endpoint: string;
|
|
6
|
+
contract: {
|
|
7
|
+
address: string;
|
|
8
|
+
name: string;
|
|
9
|
+
};
|
|
10
|
+
accounts: string[];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* The state operator. This is used to mutate the state of Procaptcha during the captcha process. State updates are published via the onStateUpdate callback. This should be used by frontends, e.g. react, to maintain the state of Procaptcha across renders.
|
|
14
|
+
*/
|
|
15
|
+
export declare const Manager: (configOptional: ProcaptchaConfigOptional, state: ProcaptchaState, onStateUpdate: ProcaptchaStateUpdateFn, callbacks: ProcaptchaCallbacks) => {
|
|
16
|
+
start: () => Promise<void>;
|
|
17
|
+
cancel: () => Promise<void>;
|
|
18
|
+
submit: () => Promise<void>;
|
|
19
|
+
select: (hash: string) => void;
|
|
20
|
+
nextRound: () => void;
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=Manager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Manager.d.ts","sourceRoot":"","sources":["../../src/modules/Manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,mBAAmB,EACnB,wBAAwB,EAExB,eAAe,EACf,uBAAuB,EAC1B,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAIH,mBAAmB,EAEtB,MAAM,gBAAgB,CAAA;AAevB,eAAO,MAAM,YAAY,QAAO,QAAQ,eAAe,CAatD,CAAA;AAkBD,eAAO,MAAM,UAAU,WAAY,mBAAmB;;;;;;;CAMrD,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,OAAO,mBACA,wBAAwB,SACjC,eAAe,iBACP,uBAAuB,aAC3B,mBAAmB;;;;mBA2RR,MAAM;;CA0J/B,CAAA"}
|
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Manager = exports.getNetwork = exports.defaultState = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const api_1 = require("@polkadot/api");
|
|
6
|
+
const api_2 = require("@prosopo/api");
|
|
7
|
+
const contract_1 = require("@prosopo/contract");
|
|
8
|
+
const rpc_provider_1 = require("@polkadot/rpc-provider");
|
|
9
|
+
const util_crypto_1 = require("@polkadot/util-crypto");
|
|
10
|
+
const utils_1 = require("../utils/utils");
|
|
11
|
+
const util_1 = require("@polkadot/util");
|
|
12
|
+
const common_1 = require("@prosopo/common");
|
|
13
|
+
const ExtensionWeb2_1 = tslib_1.__importDefault(require("../api/ExtensionWeb2"));
|
|
14
|
+
const ExtensionWeb3_1 = tslib_1.__importDefault(require("../api/ExtensionWeb3"));
|
|
15
|
+
const ProsopoCaptchaApi_1 = tslib_1.__importDefault(require("./ProsopoCaptchaApi"));
|
|
16
|
+
const storage_1 = tslib_1.__importDefault(require("./storage"));
|
|
17
|
+
const defaultState = () => {
|
|
18
|
+
return {
|
|
19
|
+
// note order matters! see buildUpdateState. These fields are set in order, so disable modal first, then set loading to false, etc.
|
|
20
|
+
showModal: false,
|
|
21
|
+
loading: false,
|
|
22
|
+
challenge: undefined,
|
|
23
|
+
solutions: [],
|
|
24
|
+
index: -1,
|
|
25
|
+
isHuman: false,
|
|
26
|
+
captchaApi: undefined,
|
|
27
|
+
account: undefined,
|
|
28
|
+
// don't handle timeout here, this should be handled by the state management
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
exports.defaultState = defaultState;
|
|
32
|
+
const buildUpdateState = (state, onStateUpdate) => {
|
|
33
|
+
const updateCurrentState = (nextState) => {
|
|
34
|
+
// mutate the current state. Note that this is in order of properties in the nextState object.
|
|
35
|
+
// e.g. given {b: 2, c: 3, a: 1}, b will be set, then c, then a. This is because JS stores fields in insertion order by default, unless you override it with a class or such by changing the key enumeration order.
|
|
36
|
+
for (const key in nextState) {
|
|
37
|
+
state[key] = nextState[key];
|
|
38
|
+
}
|
|
39
|
+
// then call the update function for the frontend to do the same
|
|
40
|
+
onStateUpdate(nextState);
|
|
41
|
+
console.log('Procaptcha state update:', nextState, '\nResult:', state);
|
|
42
|
+
};
|
|
43
|
+
return updateCurrentState;
|
|
44
|
+
};
|
|
45
|
+
const getNetwork = (config) => {
|
|
46
|
+
const network = config.networks[config.defaultEnvironment];
|
|
47
|
+
if (!network) {
|
|
48
|
+
throw new Error(`No network found for environment ${config.defaultEnvironment}`);
|
|
49
|
+
}
|
|
50
|
+
return network;
|
|
51
|
+
};
|
|
52
|
+
exports.getNetwork = getNetwork;
|
|
53
|
+
/**
|
|
54
|
+
* The state operator. This is used to mutate the state of Procaptcha during the captcha process. State updates are published via the onStateUpdate callback. This should be used by frontends, e.g. react, to maintain the state of Procaptcha across renders.
|
|
55
|
+
*/
|
|
56
|
+
const Manager = (configOptional, state, onStateUpdate, callbacks) => {
|
|
57
|
+
// events are emitted at various points during the captcha process. These each have default behaviours below which can be overridden by the frontend using callbacks.
|
|
58
|
+
const events = Object.assign({
|
|
59
|
+
onAccountNotFound: (address) => {
|
|
60
|
+
alert(`Account ${address} not found`);
|
|
61
|
+
},
|
|
62
|
+
onError: (error) => {
|
|
63
|
+
alert(`${error?.message ?? 'An unexpected error occurred'}, please try again`);
|
|
64
|
+
},
|
|
65
|
+
onHuman: (output) => {
|
|
66
|
+
console.log('onHuman event triggered', output);
|
|
67
|
+
},
|
|
68
|
+
onExtensionNotFound: () => {
|
|
69
|
+
alert('No extension found');
|
|
70
|
+
},
|
|
71
|
+
onExpired: () => {
|
|
72
|
+
alert('Challenge has expired, please try again');
|
|
73
|
+
},
|
|
74
|
+
onFailed: () => {
|
|
75
|
+
alert('Captcha challenge failed. Please try again');
|
|
76
|
+
},
|
|
77
|
+
}, callbacks);
|
|
78
|
+
// mapping of type of error to relevant event callback
|
|
79
|
+
const errorToEventMap = {
|
|
80
|
+
AccountNotFoundError: events.onAccountNotFound,
|
|
81
|
+
ExtensionNotFoundError: events.onExtensionNotFound,
|
|
82
|
+
Error: events.onError,
|
|
83
|
+
ExpiredError: events.onExpired,
|
|
84
|
+
};
|
|
85
|
+
// get the state update mechanism
|
|
86
|
+
const updateState = buildUpdateState(state, onStateUpdate);
|
|
87
|
+
/**
|
|
88
|
+
* Build the config on demand, using the optional config passed in from the outside. State may override various config values depending on the state of the captcha process. E.g. if the process has been started using account "ABC" and then the user changes account to "DEF" via the optional config prop, the account in use will not change. This is because the captcha process has already been started using account "ABC".
|
|
89
|
+
* @returns the config for procaptcha
|
|
90
|
+
*/
|
|
91
|
+
const getConfig = () => {
|
|
92
|
+
const config = {
|
|
93
|
+
userAccountAddress: '',
|
|
94
|
+
...configOptional,
|
|
95
|
+
};
|
|
96
|
+
// overwrite the account in use with the one in state if it exists. Reduces likelihood of bugs where the user changes account in the middle of the captcha process.
|
|
97
|
+
if (state.account) {
|
|
98
|
+
config.userAccountAddress = state.account.account.address;
|
|
99
|
+
}
|
|
100
|
+
return config;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Called on start of user verification. This is when the user ticks the box to claim they are human.
|
|
104
|
+
*/
|
|
105
|
+
const start = async () => {
|
|
106
|
+
console.log('Starting procaptcha');
|
|
107
|
+
try {
|
|
108
|
+
if (state.loading) {
|
|
109
|
+
console.log('Procaptcha already loading');
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
if (state.isHuman) {
|
|
113
|
+
console.log('already human');
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
resetState();
|
|
117
|
+
// set the loading flag to true (allow UI to show some sort of loading / pending indicator while we get the captcha process going)
|
|
118
|
+
updateState({ loading: true });
|
|
119
|
+
// snapshot the config into the state
|
|
120
|
+
const config = getConfig();
|
|
121
|
+
updateState({ dappAccount: config.account.address });
|
|
122
|
+
// allow UI to catch up with the loading state
|
|
123
|
+
await (0, utils_1.sleep)(100);
|
|
124
|
+
// check accounts / setup accounts
|
|
125
|
+
const account = await loadAccount();
|
|
126
|
+
// account has been found, check if account is already marked as human
|
|
127
|
+
// first, ask the smart contract
|
|
128
|
+
const contract = await loadContract();
|
|
129
|
+
// We don't need to show CAPTCHA challenges if the user is determined as human by the contract
|
|
130
|
+
let contractIsHuman = false;
|
|
131
|
+
try {
|
|
132
|
+
contractIsHuman = (await contract.query.dappOperatorIsHumanUser(account.account.address, config.solutionThreshold)).value
|
|
133
|
+
.unwrap()
|
|
134
|
+
.unwrap();
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
console.warn(error);
|
|
138
|
+
}
|
|
139
|
+
if (contractIsHuman) {
|
|
140
|
+
updateState({ isHuman: true, loading: false });
|
|
141
|
+
events.onHuman({
|
|
142
|
+
user: account.account.address,
|
|
143
|
+
dapp: config.account.address,
|
|
144
|
+
});
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
// Check if there is a provider in local storage or get a random one from the contract
|
|
148
|
+
const providerUrlFromStorage = storage_1.default.getProviderUrl();
|
|
149
|
+
let providerApi;
|
|
150
|
+
if (providerUrlFromStorage) {
|
|
151
|
+
providerApi = await loadProviderApi(providerUrlFromStorage);
|
|
152
|
+
// if the provider was already in storage, the user may have already solved some captchas but they have not been put on chain yet
|
|
153
|
+
// so contact the provider to check if this is the case
|
|
154
|
+
try {
|
|
155
|
+
const verifyDappUserResponse = await providerApi.verifyDappUser(account.account.address);
|
|
156
|
+
if (verifyDappUserResponse.solutionApproved) {
|
|
157
|
+
updateState({ isHuman: true, loading: false });
|
|
158
|
+
events.onHuman({
|
|
159
|
+
providerUrl: providerUrlFromStorage,
|
|
160
|
+
user: account.account.address,
|
|
161
|
+
dapp: config.account.address,
|
|
162
|
+
commitmentId: verifyDappUserResponse.commitmentId,
|
|
163
|
+
});
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
catch (err) {
|
|
168
|
+
// if the provider is down, we should continue with the process of selecting a random provider
|
|
169
|
+
console.error('Error contacting provider from storage', providerUrlFromStorage);
|
|
170
|
+
// continue as if the provider was not in storage
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
const payload = {
|
|
174
|
+
address: account.account.address,
|
|
175
|
+
data: (0, util_1.stringToU8a)('message'),
|
|
176
|
+
type: 'bytes',
|
|
177
|
+
};
|
|
178
|
+
const signed = await account.extension.signer.signRaw(payload);
|
|
179
|
+
console.log('Signature:', signed);
|
|
180
|
+
// get a random provider
|
|
181
|
+
const getRandomProviderResponse = await (0, contract_1.wrapQuery)(contract.query.getRandomActiveProvider, contract.query)(account.account.address, config.account.address);
|
|
182
|
+
const blockNumber = getRandomProviderResponse.blockNumber;
|
|
183
|
+
console.log('provider', getRandomProviderResponse);
|
|
184
|
+
const providerUrl = (0, common_1.trimProviderUrl)(getRandomProviderResponse.provider.url.toString());
|
|
185
|
+
// get the provider api inst
|
|
186
|
+
providerApi = await loadProviderApi(providerUrl);
|
|
187
|
+
console.log('providerApi', providerApi);
|
|
188
|
+
// get the captcha challenge and begin the challenge
|
|
189
|
+
const captchaApi = await loadCaptchaApi(contract, getRandomProviderResponse, providerApi);
|
|
190
|
+
console.log('captchaApi', captchaApi);
|
|
191
|
+
const challenge = await captchaApi.getCaptchaChallenge();
|
|
192
|
+
console.log('challenge', challenge);
|
|
193
|
+
if (challenge.captchas.length <= 0) {
|
|
194
|
+
throw new Error('No captchas returned from provider');
|
|
195
|
+
}
|
|
196
|
+
// setup timeout
|
|
197
|
+
const timeMillis = challenge.captchas
|
|
198
|
+
.map((captcha) => captcha.captcha.timeLimitMs || 30 * 1000)
|
|
199
|
+
.reduce((a, b) => a + b);
|
|
200
|
+
const timeout = setTimeout(() => {
|
|
201
|
+
console.log('challenge expired after ' + timeMillis + 'ms');
|
|
202
|
+
events.onExpired();
|
|
203
|
+
// expired, disallow user's claim to be human
|
|
204
|
+
updateState({ isHuman: false, showModal: false, loading: false });
|
|
205
|
+
}, timeMillis);
|
|
206
|
+
// update state with new challenge
|
|
207
|
+
updateState({
|
|
208
|
+
index: 0,
|
|
209
|
+
solutions: challenge.captchas.map(() => []),
|
|
210
|
+
challenge,
|
|
211
|
+
showModal: true,
|
|
212
|
+
timeout,
|
|
213
|
+
blockNumber,
|
|
214
|
+
});
|
|
215
|
+
}
|
|
216
|
+
catch (err) {
|
|
217
|
+
console.error(err);
|
|
218
|
+
// dispatch relevant error event
|
|
219
|
+
const event = errorToEventMap[err.constructor] || events.onError;
|
|
220
|
+
event(err);
|
|
221
|
+
// hit an error, disallow user's claim to be human
|
|
222
|
+
updateState({ isHuman: false, showModal: false, loading: false });
|
|
223
|
+
}
|
|
224
|
+
};
|
|
225
|
+
const submit = async () => {
|
|
226
|
+
try {
|
|
227
|
+
console.log('submitting solutions');
|
|
228
|
+
// disable the time limit, user has submitted their solution in time
|
|
229
|
+
clearTimeout();
|
|
230
|
+
if (!state.challenge) {
|
|
231
|
+
throw new Error('cannot submit, no challenge found');
|
|
232
|
+
}
|
|
233
|
+
// hide the modal, no further input required from user
|
|
234
|
+
updateState({ showModal: false });
|
|
235
|
+
const challenge = state.challenge;
|
|
236
|
+
const salt = (0, util_crypto_1.randomAsHex)();
|
|
237
|
+
// append solution to each captcha in the challenge
|
|
238
|
+
const captchaSolution = state.challenge.captchas.map((captcha, index) => {
|
|
239
|
+
const solution = state.solutions[index];
|
|
240
|
+
return {
|
|
241
|
+
captchaId: captcha.captcha.captchaId,
|
|
242
|
+
captchaContentId: captcha.captcha.captchaContentId,
|
|
243
|
+
salt,
|
|
244
|
+
solution,
|
|
245
|
+
};
|
|
246
|
+
});
|
|
247
|
+
const account = getAccount();
|
|
248
|
+
const blockNumber = getBlockNumber();
|
|
249
|
+
const signer = account.extension.signer;
|
|
250
|
+
if (!challenge.captchas[0].captcha.datasetId) {
|
|
251
|
+
throw new Error('No datasetId set for challenge');
|
|
252
|
+
}
|
|
253
|
+
const captchaApi = getCaptchaApi();
|
|
254
|
+
// send the commitment to the provider
|
|
255
|
+
const submission = await captchaApi.submitCaptchaSolution(signer, challenge.requestHash, challenge.captchas[0].captcha.datasetId, captchaSolution, salt);
|
|
256
|
+
// mark as is human if solution has been approved
|
|
257
|
+
const isHuman = submission[0].solutionApproved;
|
|
258
|
+
if (!isHuman) {
|
|
259
|
+
// user failed the captcha for some reason according to the provider
|
|
260
|
+
events.onFailed();
|
|
261
|
+
}
|
|
262
|
+
// update the state with the result of the submission
|
|
263
|
+
updateState({
|
|
264
|
+
submission,
|
|
265
|
+
isHuman,
|
|
266
|
+
loading: false,
|
|
267
|
+
});
|
|
268
|
+
if (state.isHuman) {
|
|
269
|
+
events.onHuman({
|
|
270
|
+
providerUrl: (0, common_1.trimProviderUrl)(captchaApi.provider.provider.url.toString()),
|
|
271
|
+
user: account.account.address,
|
|
272
|
+
dapp: getDappAccount(),
|
|
273
|
+
commitmentId: submission[1],
|
|
274
|
+
blockNumber,
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
catch (err) {
|
|
279
|
+
// dispatch relevant error event
|
|
280
|
+
const event = errorToEventMap[err.constructor] || events.onError;
|
|
281
|
+
event(err);
|
|
282
|
+
// hit an error, disallow user's claim to be human
|
|
283
|
+
updateState({ isHuman: false, showModal: false, loading: false });
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
const cancel = async () => {
|
|
287
|
+
console.log('cancel');
|
|
288
|
+
// disable the time limit
|
|
289
|
+
clearTimeout();
|
|
290
|
+
// abandon the captcha process
|
|
291
|
+
resetState();
|
|
292
|
+
};
|
|
293
|
+
/**
|
|
294
|
+
* (De)Select an image from the solution for the current round. If the hash is already in the solutions list, it will be removed (deselected) and if not it will be added (selected).
|
|
295
|
+
* @param hash the hash of the image
|
|
296
|
+
*/
|
|
297
|
+
const select = (hash) => {
|
|
298
|
+
if (!state.challenge) {
|
|
299
|
+
throw new Error('cannot select, no challenge found');
|
|
300
|
+
}
|
|
301
|
+
if (state.index >= state.challenge.captchas.length || state.index < 0) {
|
|
302
|
+
throw new Error('cannot select, round index out of range');
|
|
303
|
+
}
|
|
304
|
+
const index = state.index;
|
|
305
|
+
const solutions = state.solutions;
|
|
306
|
+
const solution = solutions[index];
|
|
307
|
+
if (solution.includes(hash)) {
|
|
308
|
+
console.log('deselecting', hash);
|
|
309
|
+
// remove the hash from the solution
|
|
310
|
+
solution.splice(solution.indexOf(hash), 1);
|
|
311
|
+
}
|
|
312
|
+
else {
|
|
313
|
+
console.log('selecting', hash);
|
|
314
|
+
// add the hash to the solution
|
|
315
|
+
solution.push(hash);
|
|
316
|
+
}
|
|
317
|
+
updateState({ solutions });
|
|
318
|
+
};
|
|
319
|
+
/**
|
|
320
|
+
* Proceed to the next round of the challenge.
|
|
321
|
+
*/
|
|
322
|
+
const nextRound = () => {
|
|
323
|
+
if (!state.challenge) {
|
|
324
|
+
throw new Error('cannot proceed to next round, no challenge found');
|
|
325
|
+
}
|
|
326
|
+
if (state.index + 1 >= state.challenge.captchas.length) {
|
|
327
|
+
throw new Error('cannot proceed to next round, already at last round');
|
|
328
|
+
}
|
|
329
|
+
console.log('proceeding to next round');
|
|
330
|
+
updateState({ index: state.index + 1 });
|
|
331
|
+
};
|
|
332
|
+
const loadCaptchaApi = async (contract, provider, providerApi) => {
|
|
333
|
+
const config = getConfig();
|
|
334
|
+
// setup the captcha api to carry out a challenge
|
|
335
|
+
const captchaApi = new ProsopoCaptchaApi_1.default(getAccount().account.address, contract, provider, providerApi, config.web2, config.account.address);
|
|
336
|
+
updateState({ captchaApi });
|
|
337
|
+
return getCaptchaApi();
|
|
338
|
+
};
|
|
339
|
+
const loadProviderApi = async (providerUrl) => {
|
|
340
|
+
const config = getConfig();
|
|
341
|
+
const network = (0, exports.getNetwork)(config);
|
|
342
|
+
return new api_2.ProviderApi(network, providerUrl, config.account.address);
|
|
343
|
+
};
|
|
344
|
+
const clearTimeout = () => {
|
|
345
|
+
// clear the timeout
|
|
346
|
+
window.clearTimeout(state.timeout);
|
|
347
|
+
// then clear the timeout from the state
|
|
348
|
+
updateState({ timeout: undefined });
|
|
349
|
+
};
|
|
350
|
+
const resetState = () => {
|
|
351
|
+
// clear timeout just in case a timer is still active (shouldn't be)
|
|
352
|
+
clearTimeout();
|
|
353
|
+
updateState((0, exports.defaultState)());
|
|
354
|
+
};
|
|
355
|
+
const getCaptchaApi = () => {
|
|
356
|
+
if (!state.captchaApi) {
|
|
357
|
+
throw new Error('Captcha api not set');
|
|
358
|
+
}
|
|
359
|
+
return state.captchaApi;
|
|
360
|
+
};
|
|
361
|
+
/**
|
|
362
|
+
* Load the account using address specified in config, or generate new address if not found in local storage for web2 mode.
|
|
363
|
+
*/
|
|
364
|
+
const loadAccount = async () => {
|
|
365
|
+
const config = getConfig();
|
|
366
|
+
// check if account has been provided in config (doesn't matter in web2 mode)
|
|
367
|
+
if (!config.web2 && !config.userAccountAddress) {
|
|
368
|
+
throw new Error('Account address has not been set for web3 mode');
|
|
369
|
+
}
|
|
370
|
+
// check if account exists in extension
|
|
371
|
+
const ext = config.web2 ? new ExtensionWeb2_1.default() : new ExtensionWeb3_1.default();
|
|
372
|
+
const account = await ext.getAccount(config);
|
|
373
|
+
console.log('Using account:', account);
|
|
374
|
+
updateState({ account });
|
|
375
|
+
return getAccount();
|
|
376
|
+
};
|
|
377
|
+
const getAccount = () => {
|
|
378
|
+
if (!state.account) {
|
|
379
|
+
throw new Error('Account not loaded');
|
|
380
|
+
}
|
|
381
|
+
const account = state.account;
|
|
382
|
+
return account;
|
|
383
|
+
};
|
|
384
|
+
const getDappAccount = () => {
|
|
385
|
+
if (!state.dappAccount) {
|
|
386
|
+
throw new Error('Dapp account not loaded');
|
|
387
|
+
}
|
|
388
|
+
const dappAccount = state.dappAccount;
|
|
389
|
+
return dappAccount;
|
|
390
|
+
};
|
|
391
|
+
const getBlockNumber = () => {
|
|
392
|
+
if (!state.blockNumber) {
|
|
393
|
+
throw new Error('Account not loaded');
|
|
394
|
+
}
|
|
395
|
+
const blockNumber = state.blockNumber;
|
|
396
|
+
return blockNumber;
|
|
397
|
+
};
|
|
398
|
+
/**
|
|
399
|
+
* Load the contract instance using addresses from config.
|
|
400
|
+
*/
|
|
401
|
+
const loadContract = async () => {
|
|
402
|
+
const config = getConfig();
|
|
403
|
+
const network = (0, exports.getNetwork)(config);
|
|
404
|
+
const api = await api_1.ApiPromise.create({ provider: new rpc_provider_1.WsProvider(network.endpoint) });
|
|
405
|
+
// TODO create a shared keyring that's stored somewhere
|
|
406
|
+
const type = 'sr25519';
|
|
407
|
+
const keyring = new api_1.Keyring({ type, ss58Format: api.registry.chainSS58 });
|
|
408
|
+
return new contract_1.ProsopoCaptchaContract(api, contract_1.abiJson, network.contract.address, keyring.addFromAddress(getAccount().account.address), 'prosopo', 0);
|
|
409
|
+
};
|
|
410
|
+
return {
|
|
411
|
+
start,
|
|
412
|
+
cancel,
|
|
413
|
+
submit,
|
|
414
|
+
select,
|
|
415
|
+
nextRound,
|
|
416
|
+
};
|
|
417
|
+
};
|
|
418
|
+
exports.Manager = Manager;
|
|
419
|
+
//# sourceMappingURL=Manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Manager.js","sourceRoot":"","sources":["../../src/modules/Manager.ts"],"names":[],"mappings":";;;;AAQA,uCAAmD;AAQnD,sCAA8D;AAC9D,gDAA8E;AAG9E,yDAAmD;AACnD,uDAAmD;AACnD,0CAAsC;AACtC,yCAA4C;AAC5C,4CAAiD;AACjD,iFAAgD;AAChD,iFAAgD;AAChD,oFAAmD;AACnD,gEAA+B;AAExB,MAAM,YAAY,GAAG,GAA6B,EAAE;IACvD,OAAO;QACH,mIAAmI;QACnI,SAAS,EAAE,KAAK;QAChB,OAAO,EAAE,KAAK;QACd,SAAS,EAAE,SAAS;QACpB,SAAS,EAAE,EAAE;QACb,KAAK,EAAE,CAAC,CAAC;QACT,OAAO,EAAE,KAAK;QACd,UAAU,EAAE,SAAS;QACrB,OAAO,EAAE,SAAS;QAClB,4EAA4E;KAC/E,CAAA;AACL,CAAC,CAAA;AAbY,QAAA,YAAY,gBAaxB;AAED,MAAM,gBAAgB,GAAG,CAAC,KAAsB,EAAE,aAAsC,EAAE,EAAE;IACxF,MAAM,kBAAkB,GAAG,CAAC,SAAmC,EAAE,EAAE;QAC/D,8FAA8F;QAC9F,mNAAmN;QACnN,KAAK,MAAM,GAAG,IAAI,SAAS,EAAE;YACzB,KAAK,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC,GAAG,CAAC,CAAA;SAC9B;QACD,gEAAgE;QAChE,aAAa,CAAC,SAAS,CAAC,CAAA;QAExB,OAAO,CAAC,GAAG,CAAC,0BAA0B,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,CAAC,CAAA;IAC1E,CAAC,CAAA;IAED,OAAO,kB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