@prosopo/load-balancer 2.5.5 → 2.6.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/CHANGELOG.md ADDED
@@ -0,0 +1,28 @@
1
+ # @prosopo/load-balancer
2
+
3
+ ## 2.6.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [6ff193a]
8
+ - @prosopo/types@2.6.2
9
+
10
+ ## 2.6.1
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies [52feffc]
15
+ - @prosopo/types@2.6.1
16
+
17
+ ## 2.6.0
18
+
19
+ ### Minor Changes
20
+
21
+ - a0bfc8a: bump all pkg versions since independent versioning applied
22
+
23
+ ### Patch Changes
24
+
25
+ - Updated dependencies [a0bfc8a]
26
+ - @prosopo/config@2.6.0
27
+ - @prosopo/common@2.6.0
28
+ - @prosopo/types@2.6.0
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const common = require("@prosopo/common");
4
+ const convertHostedProvider = (provider) => {
5
+ return Object.values(provider);
6
+ };
7
+ const loadBalancer = async (environment) => {
8
+ if (environment === "production") {
9
+ const providers = await fetch(
10
+ "https://provider-list.prosopo.io/",
11
+ {
12
+ method: "GET",
13
+ mode: "cors"
14
+ }
15
+ ).then((res) => res.json());
16
+ return convertHostedProvider(providers);
17
+ }
18
+ if (environment === "staging") {
19
+ const providers = await fetch(
20
+ "https://provider-list.prosopo.io/staging.json",
21
+ { method: "GET", mode: "cors" }
22
+ ).then((res) => res.json());
23
+ return convertHostedProvider(providers);
24
+ }
25
+ if (environment === "development") {
26
+ return [
27
+ {
28
+ address: "5EjTA28bKSbFPPyMbUjNtArxyqjwq38r1BapVmLZShaqEedV",
29
+ url: "http://localhost:9229",
30
+ datasetId: "0x9f460e81ac9c71b486f796a21bb36e2263694756a6621134d110da217fd3ef25"
31
+ }
32
+ ];
33
+ }
34
+ throw new common.ProsopoEnvError("CONFIG.UNKNOWN_ENVIRONMENT", {
35
+ context: { environment }
36
+ });
37
+ };
38
+ exports.loadBalancer = loadBalancer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/load-balancer",
3
- "version": "2.5.5",
3
+ "version": "2.6.2",
4
4
  "description": "Provider load balancer",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -22,7 +22,8 @@
22
22
  },
23
23
  "repository": {
24
24
  "type": "git",
25
- "url": "git+ssh://git@github.com/prosopo/captcha.git"
25
+ "url": "git+https://github.com/prosopo/captcha.git",
26
+ "directory": "packages/load-balancer"
26
27
  },
27
28
  "author": "Prosopo Limited",
28
29
  "license": "Apache-2.0",
@@ -31,9 +32,9 @@
31
32
  },
32
33
  "homepage": "https://github.com/prosopo/captcha#readme",
33
34
  "dependencies": {
34
- "@prosopo/common": "2.5.5",
35
- "@prosopo/config": "2.5.5",
36
- "@prosopo/types": "2.5.5",
35
+ "@prosopo/common": "2.6.0",
36
+ "@prosopo/config": "2.6.0",
37
+ "@prosopo/types": "2.6.2",
37
38
  "express": "4.21.2"
38
39
  },
39
40
  "devDependencies": {