@prosopo/load-balancer 2.5.3 → 2.6.1

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,21 @@
1
+ # @prosopo/load-balancer
2
+
3
+ ## 2.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [52feffc]
8
+ - @prosopo/types@2.6.1
9
+
10
+ ## 2.6.0
11
+
12
+ ### Minor Changes
13
+
14
+ - a0bfc8a: bump all pkg versions since independent versioning applied
15
+
16
+ ### Patch Changes
17
+
18
+ - Updated dependencies [a0bfc8a]
19
+ - @prosopo/config@2.6.0
20
+ - @prosopo/common@2.6.0
21
+ - @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.3",
3
+ "version": "2.6.1",
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,21 +32,21 @@
31
32
  },
32
33
  "homepage": "https://github.com/prosopo/captcha#readme",
33
34
  "dependencies": {
34
- "@prosopo/common": "2.5.3",
35
- "@prosopo/config": "2.5.3",
36
- "@prosopo/types": "2.5.3",
35
+ "@prosopo/common": "2.6.0",
36
+ "@prosopo/config": "2.6.0",
37
+ "@prosopo/types": "2.6.1",
37
38
  "express": "4.21.2"
38
39
  },
39
40
  "devDependencies": {
40
- "@vitest/coverage-v8": "2.1.1",
41
+ "@vitest/coverage-v8": "3.0.9",
41
42
  "concurrently": "9.0.1",
42
43
  "del-cli": "6.0.0",
43
44
  "npm-run-all": "2.1.0",
44
45
  "tslib": "2.7.0",
45
46
  "tsx": "4.19.1",
46
47
  "typescript": "5.6.2",
47
- "vite": "5.4.6",
48
- "vitest": "2.1.1"
48
+ "vite": "6.2.3",
49
+ "vitest": "3.0.9"
49
50
  },
50
51
  "sideEffects": false
51
52
  }