@prosopo/server 2.9.48 → 2.10.12
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/.turbo/turbo-build$colon$cjs.log +5 -3
- package/.turbo/turbo-build$colon$tsc.log +41 -0
- package/.turbo/turbo-build.log +10 -4
- package/CHANGELOG.md +410 -0
- package/README.md +14 -28
- package/dist/cjs/config.cjs +1 -1
- package/dist/cjs/server.cjs +15 -9
- package/dist/config.d.ts +43 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js.map +1 -0
- package/dist/server.d.ts +18 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +16 -10
- package/dist/server.js.map +1 -0
- package/package.json +13 -10
- package/vite.cjs.config.ts +1 -1
- package/vite.esm.config.ts +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/server@2.
|
|
2
|
+
> @prosopo/server@2.10.12 build:cjs
|
|
3
3
|
> NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
|
|
4
4
|
|
|
5
5
|
ViteCommonJSConfig: .
|
|
@@ -11,6 +11,7 @@ ViteCommonJSConfig: .
|
|
|
11
11
|
'/home/runner/work/captcha/captcha/packages/util/tsconfig.json',
|
|
12
12
|
'/home/runner/work/captcha/captcha/packages/util-crypto/tsconfig.json',
|
|
13
13
|
'/home/runner/work/captcha/captcha/packages/common/tsconfig.json',
|
|
14
|
+
'/home/runner/work/captcha/captcha/packages/logger/tsconfig.json',
|
|
14
15
|
'/home/runner/work/captcha/captcha/packages/keyring/tsconfig.json',
|
|
15
16
|
'/home/runner/work/captcha/captcha/packages/load-balancer/tsconfig.json'
|
|
16
17
|
]
|
|
@@ -23,6 +24,7 @@ ViteCommonJSConfig: .
|
|
|
23
24
|
'@prosopo/util',
|
|
24
25
|
'@prosopo/util-crypto',
|
|
25
26
|
'@prosopo/common',
|
|
27
|
+
'@prosopo/logger',
|
|
26
28
|
'@prosopo/keyring',
|
|
27
29
|
'@prosopo/load-balancer'
|
|
28
30
|
]
|
|
@@ -35,5 +37,5 @@ Build end
|
|
|
35
37
|
rendering chunks...
|
|
36
38
|
[2mdist/cjs/[22m[36mindex.cjs [39m[1m[2m0.57 kB[22m[1m[22m
|
|
37
39
|
[2mdist/cjs/[22m[36mconfig.cjs [39m[1m[2m0.92 kB[22m[1m[22m
|
|
38
|
-
[2mdist/cjs/[22m[36mserver.cjs [39m[1m[2m4.
|
|
39
|
-
[32m✓ built in
|
|
40
|
+
[2mdist/cjs/[22m[36mserver.cjs [39m[1m[2m4.47 kB[22m[1m[22m
|
|
41
|
+
[32m✓ built in 133ms[39m
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
> @prosopo/server@2.10.12 build:tsc
|
|
3
|
+
> tsc --build --verbose
|
|
4
|
+
|
|
5
|
+
8:14:44 AM - Projects in this build:
|
|
6
|
+
* ../../dev/config/tsconfig.json
|
|
7
|
+
* ../locale/tsconfig.json
|
|
8
|
+
* ../util/tsconfig.json
|
|
9
|
+
* ../util-crypto/tsconfig.json
|
|
10
|
+
* ../types/tsconfig.json
|
|
11
|
+
* ../api/tsconfig.json
|
|
12
|
+
* ../logger/tsconfig.json
|
|
13
|
+
* ../common/tsconfig.json
|
|
14
|
+
* ../keyring/tsconfig.json
|
|
15
|
+
* ../load-balancer/tsconfig.json
|
|
16
|
+
* tsconfig.json
|
|
17
|
+
|
|
18
|
+
8:14:45 AM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/webpack.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
|
|
19
|
+
|
|
20
|
+
8:14:45 AM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
|
|
21
|
+
|
|
22
|
+
8:14:45 AM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
|
|
23
|
+
|
|
24
|
+
8:14:45 AM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/tsconfig.tsbuildinfo'
|
|
25
|
+
|
|
26
|
+
8:14:45 AM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/procaptcha/api.ts' is older than output '../types/tsconfig.tsbuildinfo'
|
|
27
|
+
|
|
28
|
+
8:14:45 AM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
|
|
29
|
+
|
|
30
|
+
8:14:45 AM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/tsconfig.tsbuildinfo'
|
|
31
|
+
|
|
32
|
+
8:14:45 AM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/error.ts' is older than output '../common/tsconfig.tsbuildinfo'
|
|
33
|
+
|
|
34
|
+
8:14:45 AM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/index.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
|
|
35
|
+
|
|
36
|
+
8:14:45 AM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/balancer.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
|
|
37
|
+
|
|
38
|
+
8:14:45 AM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
|
|
39
|
+
|
|
40
|
+
8:14:45 AM - Building project '/home/runner/work/captcha/captcha/packages/server/tsconfig.json'...
|
|
41
|
+
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/server@2.
|
|
3
|
-
>
|
|
2
|
+
> @prosopo/server@2.10.12 build
|
|
3
|
+
> npm run build:cross-env -- --mode ${NODE_ENV:-development}
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
> @prosopo/server@2.10.12 build:cross-env
|
|
7
|
+
> vite build --config vite.esm.config.ts --mode production
|
|
4
8
|
|
|
5
9
|
ViteEsmConfig: .
|
|
6
10
|
{
|
|
@@ -11,6 +15,7 @@ ViteEsmConfig: .
|
|
|
11
15
|
'/home/runner/work/captcha/captcha/packages/util/tsconfig.json',
|
|
12
16
|
'/home/runner/work/captcha/captcha/packages/util-crypto/tsconfig.json',
|
|
13
17
|
'/home/runner/work/captcha/captcha/packages/common/tsconfig.json',
|
|
18
|
+
'/home/runner/work/captcha/captcha/packages/logger/tsconfig.json',
|
|
14
19
|
'/home/runner/work/captcha/captcha/packages/keyring/tsconfig.json',
|
|
15
20
|
'/home/runner/work/captcha/captcha/packages/load-balancer/tsconfig.json'
|
|
16
21
|
]
|
|
@@ -23,6 +28,7 @@ ViteEsmConfig: .
|
|
|
23
28
|
'@prosopo/util',
|
|
24
29
|
'@prosopo/util-crypto',
|
|
25
30
|
'@prosopo/common',
|
|
31
|
+
'@prosopo/logger',
|
|
26
32
|
'@prosopo/keyring',
|
|
27
33
|
'@prosopo/load-balancer'
|
|
28
34
|
]
|
|
@@ -35,5 +41,5 @@ Build end
|
|
|
35
41
|
rendering chunks...
|
|
36
42
|
[2mdist/[22m[36mindex.js [39m[1m[2m0.39 kB[22m[1m[22m
|
|
37
43
|
[2mdist/[22m[36mconfig.js [39m[1m[2m0.81 kB[22m[1m[22m
|
|
38
|
-
[2mdist/[22m[36mserver.js [39m[1m[2m4.
|
|
39
|
-
[32m✓ built in
|
|
44
|
+
[2mdist/[22m[36mserver.js [39m[1m[2m4.39 kB[22m[1m[22m
|
|
45
|
+
[32m✓ built in 151ms[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,415 @@
|
|
|
1
1
|
# @prosopo/server
|
|
2
2
|
|
|
3
|
+
## 2.10.12
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- Updated dependencies [a1d60db]
|
|
7
|
+
- Updated dependencies [2392aaf]
|
|
8
|
+
- Updated dependencies [97cf7bd]
|
|
9
|
+
- Updated dependencies [6ca1125]
|
|
10
|
+
- Updated dependencies [32a591b]
|
|
11
|
+
- @prosopo/types@4.3.0
|
|
12
|
+
- @prosopo/logger@1.0.2
|
|
13
|
+
- @prosopo/util@3.2.15
|
|
14
|
+
- @prosopo/api@3.4.8
|
|
15
|
+
- @prosopo/common@3.1.38
|
|
16
|
+
- @prosopo/keyring@2.9.34
|
|
17
|
+
- @prosopo/load-balancer@2.9.10
|
|
18
|
+
|
|
19
|
+
## 2.10.11
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [6c26669]
|
|
23
|
+
- Updated dependencies [f7f9ec5]
|
|
24
|
+
- @prosopo/types@4.2.1
|
|
25
|
+
- @prosopo/api@3.4.7
|
|
26
|
+
- @prosopo/keyring@2.9.33
|
|
27
|
+
- @prosopo/load-balancer@2.9.9
|
|
28
|
+
|
|
29
|
+
## 2.10.10
|
|
30
|
+
### Patch Changes
|
|
31
|
+
|
|
32
|
+
- 0fd81af: Extract the logger into its own `@prosopo/logger` package, out of `@prosopo/common`. Consumers now import logger symbols from `@prosopo/logger`; `@prosopo/common` no longer re-exports them. Unused `@prosopo/common` dependencies pruned where the only usage was the logger.
|
|
33
|
+
- Updated dependencies [0fd81af]
|
|
34
|
+
- @prosopo/common@3.1.37
|
|
35
|
+
- @prosopo/logger@1.0.1
|
|
36
|
+
- @prosopo/keyring@2.9.32
|
|
37
|
+
- @prosopo/load-balancer@2.9.8
|
|
38
|
+
|
|
39
|
+
## 2.10.9
|
|
40
|
+
### Patch Changes
|
|
41
|
+
|
|
42
|
+
- Updated dependencies [20cae63]
|
|
43
|
+
- Updated dependencies [4d9923e]
|
|
44
|
+
- @prosopo/types@4.2.0
|
|
45
|
+
- @prosopo/api@3.4.6
|
|
46
|
+
- @prosopo/keyring@2.9.31
|
|
47
|
+
- @prosopo/load-balancer@2.9.7
|
|
48
|
+
|
|
49
|
+
## 2.10.8
|
|
50
|
+
### Patch Changes
|
|
51
|
+
|
|
52
|
+
- Updated dependencies [d351362]
|
|
53
|
+
- @prosopo/types@4.1.4
|
|
54
|
+
- @prosopo/api@3.4.5
|
|
55
|
+
- @prosopo/keyring@2.9.30
|
|
56
|
+
- @prosopo/load-balancer@2.9.6
|
|
57
|
+
|
|
58
|
+
## 2.10.7
|
|
59
|
+
### Patch Changes
|
|
60
|
+
|
|
61
|
+
- Updated dependencies [6567ce0]
|
|
62
|
+
- Updated dependencies [e2711ae]
|
|
63
|
+
- Updated dependencies [5786629]
|
|
64
|
+
- @prosopo/util@3.2.14
|
|
65
|
+
- @prosopo/types@4.1.3
|
|
66
|
+
- @prosopo/keyring@2.9.29
|
|
67
|
+
- @prosopo/api@3.4.4
|
|
68
|
+
- @prosopo/common@3.1.36
|
|
69
|
+
- @prosopo/load-balancer@2.9.5
|
|
70
|
+
|
|
71
|
+
## 2.10.6
|
|
72
|
+
### Patch Changes
|
|
73
|
+
|
|
74
|
+
- Updated dependencies [72a1218]
|
|
75
|
+
- @prosopo/util@3.2.13
|
|
76
|
+
- @prosopo/keyring@2.9.28
|
|
77
|
+
- @prosopo/types@4.1.2
|
|
78
|
+
- @prosopo/api@3.4.3
|
|
79
|
+
- @prosopo/load-balancer@2.9.4
|
|
80
|
+
|
|
81
|
+
## 2.10.5
|
|
82
|
+
### Patch Changes
|
|
83
|
+
|
|
84
|
+
- Updated dependencies [91958da]
|
|
85
|
+
- @prosopo/api@3.4.2
|
|
86
|
+
- @prosopo/types@4.1.1
|
|
87
|
+
- @prosopo/common@3.1.35
|
|
88
|
+
- @prosopo/keyring@2.9.27
|
|
89
|
+
- @prosopo/load-balancer@2.9.3
|
|
90
|
+
|
|
91
|
+
## 2.10.4
|
|
92
|
+
### Patch Changes
|
|
93
|
+
|
|
94
|
+
- Updated dependencies [6a741ce]
|
|
95
|
+
- @prosopo/types@4.1.0
|
|
96
|
+
- @prosopo/api@3.4.1
|
|
97
|
+
- @prosopo/keyring@2.9.26
|
|
98
|
+
- @prosopo/load-balancer@2.9.2
|
|
99
|
+
|
|
100
|
+
## 2.10.3
|
|
101
|
+
### Patch Changes
|
|
102
|
+
|
|
103
|
+
- Updated dependencies [3c0be68]
|
|
104
|
+
- Updated dependencies [f9ea09d]
|
|
105
|
+
- Updated dependencies [4aae4e6]
|
|
106
|
+
- Updated dependencies [4aae4e6]
|
|
107
|
+
- Updated dependencies [d865319]
|
|
108
|
+
- Updated dependencies [753304b]
|
|
109
|
+
- Updated dependencies [8bb7286]
|
|
110
|
+
- Updated dependencies [f9ea09d]
|
|
111
|
+
- Updated dependencies [4aae4e6]
|
|
112
|
+
- Updated dependencies [4993813]
|
|
113
|
+
- @prosopo/types@4.0.0
|
|
114
|
+
- @prosopo/api@3.4.0
|
|
115
|
+
- @prosopo/load-balancer@2.9.1
|
|
116
|
+
- @prosopo/util@3.2.12
|
|
117
|
+
- @prosopo/keyring@2.9.25
|
|
118
|
+
- @prosopo/common@3.1.34
|
|
119
|
+
|
|
120
|
+
## 2.10.2
|
|
121
|
+
### Patch Changes
|
|
122
|
+
|
|
123
|
+
- Updated dependencies [819ed95]
|
|
124
|
+
- Updated dependencies [33a6c57]
|
|
125
|
+
- @prosopo/types@3.16.1
|
|
126
|
+
- @prosopo/api@3.3.2
|
|
127
|
+
- @prosopo/load-balancer@2.9.0
|
|
128
|
+
- @prosopo/keyring@2.9.24
|
|
129
|
+
|
|
130
|
+
## 2.10.1
|
|
131
|
+
### Patch Changes
|
|
132
|
+
|
|
133
|
+
- Updated dependencies [f6a4402]
|
|
134
|
+
- Updated dependencies [99dfb44]
|
|
135
|
+
- @prosopo/types@3.16.0
|
|
136
|
+
- @prosopo/api@3.3.1
|
|
137
|
+
- @prosopo/keyring@2.9.23
|
|
138
|
+
- @prosopo/load-balancer@2.8.40
|
|
139
|
+
|
|
140
|
+
## 2.10.0
|
|
141
|
+
### Minor Changes
|
|
142
|
+
|
|
143
|
+
- 3e54c0a: Rate limits by client
|
|
144
|
+
|
|
145
|
+
### Patch Changes
|
|
146
|
+
|
|
147
|
+
- Updated dependencies [3e54c0a]
|
|
148
|
+
- @prosopo/types@3.15.0
|
|
149
|
+
- @prosopo/api@3.3.0
|
|
150
|
+
- @prosopo/keyring@2.9.22
|
|
151
|
+
- @prosopo/load-balancer@2.8.39
|
|
152
|
+
|
|
153
|
+
## 2.9.73
|
|
154
|
+
### Patch Changes
|
|
155
|
+
|
|
156
|
+
- Updated dependencies [946a8ba]
|
|
157
|
+
- Updated dependencies [5614814]
|
|
158
|
+
- @prosopo/types@3.14.1
|
|
159
|
+
- @prosopo/api@3.2.11
|
|
160
|
+
- @prosopo/common@3.1.33
|
|
161
|
+
- @prosopo/keyring@2.9.21
|
|
162
|
+
- @prosopo/load-balancer@2.8.38
|
|
163
|
+
|
|
164
|
+
## 2.9.72
|
|
165
|
+
### Patch Changes
|
|
166
|
+
|
|
167
|
+
- Updated dependencies [fc514dd]
|
|
168
|
+
- Updated dependencies [7be39c4]
|
|
169
|
+
- Updated dependencies [42650db]
|
|
170
|
+
- @prosopo/types@3.14.0
|
|
171
|
+
- @prosopo/api@3.2.10
|
|
172
|
+
- @prosopo/common@3.1.32
|
|
173
|
+
- @prosopo/keyring@2.9.20
|
|
174
|
+
- @prosopo/load-balancer@2.8.37
|
|
175
|
+
|
|
176
|
+
## 2.9.71
|
|
177
|
+
### Patch Changes
|
|
178
|
+
|
|
179
|
+
- Updated dependencies [4a9c518]
|
|
180
|
+
- @prosopo/common@3.1.31
|
|
181
|
+
- @prosopo/keyring@2.9.19
|
|
182
|
+
- @prosopo/load-balancer@2.8.36
|
|
183
|
+
|
|
184
|
+
## 2.9.70
|
|
185
|
+
### Patch Changes
|
|
186
|
+
|
|
187
|
+
- Updated dependencies [a25dffa]
|
|
188
|
+
- @prosopo/util@3.2.11
|
|
189
|
+
- @prosopo/keyring@2.9.18
|
|
190
|
+
- @prosopo/types@3.13.3
|
|
191
|
+
- @prosopo/api@3.2.9
|
|
192
|
+
- @prosopo/load-balancer@2.8.35
|
|
193
|
+
|
|
194
|
+
## 2.9.69
|
|
195
|
+
### Patch Changes
|
|
196
|
+
|
|
197
|
+
- Updated dependencies [346edd7]
|
|
198
|
+
- @prosopo/util@3.2.10
|
|
199
|
+
- @prosopo/keyring@2.9.17
|
|
200
|
+
- @prosopo/types@3.13.2
|
|
201
|
+
- @prosopo/api@3.2.8
|
|
202
|
+
- @prosopo/load-balancer@2.8.34
|
|
203
|
+
|
|
204
|
+
## 2.9.68
|
|
205
|
+
### Patch Changes
|
|
206
|
+
|
|
207
|
+
- Updated dependencies [22bfee7]
|
|
208
|
+
- @prosopo/util@3.2.9
|
|
209
|
+
- @prosopo/keyring@2.9.16
|
|
210
|
+
- @prosopo/types@3.13.1
|
|
211
|
+
- @prosopo/api@3.2.7
|
|
212
|
+
- @prosopo/load-balancer@2.8.33
|
|
213
|
+
|
|
214
|
+
## 2.9.67
|
|
215
|
+
### Patch Changes
|
|
216
|
+
|
|
217
|
+
- Updated dependencies [e0fb3d6]
|
|
218
|
+
- Updated dependencies [e6d9553]
|
|
219
|
+
- Updated dependencies [f3f23e3]
|
|
220
|
+
- @prosopo/util@3.2.8
|
|
221
|
+
- @prosopo/types@3.13.0
|
|
222
|
+
- @prosopo/keyring@2.9.15
|
|
223
|
+
- @prosopo/api@3.2.6
|
|
224
|
+
- @prosopo/load-balancer@2.8.32
|
|
225
|
+
|
|
226
|
+
## 2.9.66
|
|
227
|
+
### Patch Changes
|
|
228
|
+
|
|
229
|
+
- Updated dependencies [730c61e]
|
|
230
|
+
- Updated dependencies [d5082a9]
|
|
231
|
+
- Updated dependencies [e1ea65f]
|
|
232
|
+
- Updated dependencies [c316257]
|
|
233
|
+
- @prosopo/load-balancer@2.8.31
|
|
234
|
+
- @prosopo/types@3.12.3
|
|
235
|
+
- @prosopo/util@3.2.7
|
|
236
|
+
- @prosopo/api@3.2.5
|
|
237
|
+
- @prosopo/keyring@2.9.14
|
|
238
|
+
|
|
239
|
+
## 2.9.65
|
|
240
|
+
### Patch Changes
|
|
241
|
+
|
|
242
|
+
- adb89a6: Disposable email checking
|
|
243
|
+
- Updated dependencies [adb89a6]
|
|
244
|
+
- @prosopo/types@3.12.2
|
|
245
|
+
- @prosopo/util@3.2.6
|
|
246
|
+
- @prosopo/api@3.2.4
|
|
247
|
+
- @prosopo/common@3.1.30
|
|
248
|
+
- @prosopo/keyring@2.9.13
|
|
249
|
+
- @prosopo/load-balancer@2.8.30
|
|
250
|
+
|
|
251
|
+
## 2.9.64
|
|
252
|
+
### Patch Changes
|
|
253
|
+
|
|
254
|
+
- Updated dependencies [c5ee492]
|
|
255
|
+
- Updated dependencies [a90eb54]
|
|
256
|
+
- @prosopo/common@3.1.29
|
|
257
|
+
- @prosopo/types@3.12.1
|
|
258
|
+
- @prosopo/keyring@2.9.12
|
|
259
|
+
- @prosopo/load-balancer@2.8.29
|
|
260
|
+
- @prosopo/api@3.2.3
|
|
261
|
+
|
|
262
|
+
## 2.9.63
|
|
263
|
+
### Patch Changes
|
|
264
|
+
|
|
265
|
+
- 676c5f2: Use HTTPS in developmentwq
|
|
266
|
+
- Updated dependencies [676c5f2]
|
|
267
|
+
- Updated dependencies [feaca02]
|
|
268
|
+
- @prosopo/load-balancer@2.8.28
|
|
269
|
+
- @prosopo/keyring@2.9.11
|
|
270
|
+
- @prosopo/types@3.12.0
|
|
271
|
+
- @prosopo/api@3.2.2
|
|
272
|
+
|
|
273
|
+
## 2.9.62
|
|
274
|
+
### Patch Changes
|
|
275
|
+
|
|
276
|
+
- Updated dependencies [8148587]
|
|
277
|
+
- @prosopo/types@3.11.1
|
|
278
|
+
- @prosopo/api@3.2.1
|
|
279
|
+
- @prosopo/keyring@2.9.10
|
|
280
|
+
- @prosopo/load-balancer@2.8.27
|
|
281
|
+
|
|
282
|
+
## 2.9.61
|
|
283
|
+
### Patch Changes
|
|
284
|
+
|
|
285
|
+
- Updated dependencies [7f6ffc5]
|
|
286
|
+
- @prosopo/types@3.11.0
|
|
287
|
+
- @prosopo/api@3.2.0
|
|
288
|
+
- @prosopo/keyring@2.9.9
|
|
289
|
+
- @prosopo/load-balancer@2.8.26
|
|
290
|
+
|
|
291
|
+
## 2.9.60
|
|
292
|
+
### Patch Changes
|
|
293
|
+
|
|
294
|
+
- Updated dependencies [93fa086]
|
|
295
|
+
- @prosopo/types@3.10.2
|
|
296
|
+
- @prosopo/api@3.1.49
|
|
297
|
+
- @prosopo/keyring@2.9.8
|
|
298
|
+
- @prosopo/load-balancer@2.8.25
|
|
299
|
+
|
|
300
|
+
## 2.9.59
|
|
301
|
+
### Patch Changes
|
|
302
|
+
|
|
303
|
+
- Updated dependencies [cde7550]
|
|
304
|
+
- @prosopo/types@3.10.1
|
|
305
|
+
- @prosopo/api@3.1.48
|
|
306
|
+
- @prosopo/keyring@2.9.7
|
|
307
|
+
- @prosopo/load-balancer@2.8.24
|
|
308
|
+
|
|
309
|
+
## 2.9.58
|
|
310
|
+
### Patch Changes
|
|
311
|
+
|
|
312
|
+
- Updated dependencies [ad6d622]
|
|
313
|
+
- @prosopo/types@3.10.0
|
|
314
|
+
- @prosopo/api@3.1.47
|
|
315
|
+
- @prosopo/keyring@2.9.6
|
|
316
|
+
- @prosopo/load-balancer@2.8.23
|
|
317
|
+
|
|
318
|
+
## 2.9.57
|
|
319
|
+
### Patch Changes
|
|
320
|
+
|
|
321
|
+
- Updated dependencies [ff58a70]
|
|
322
|
+
- @prosopo/types@3.9.0
|
|
323
|
+
- @prosopo/api@3.1.46
|
|
324
|
+
- @prosopo/keyring@2.9.5
|
|
325
|
+
- @prosopo/load-balancer@2.8.22
|
|
326
|
+
|
|
327
|
+
## 2.9.56
|
|
328
|
+
### Patch Changes
|
|
329
|
+
|
|
330
|
+
- Updated dependencies [d2431cd]
|
|
331
|
+
- @prosopo/types@3.8.4
|
|
332
|
+
- @prosopo/api@3.1.45
|
|
333
|
+
- @prosopo/keyring@2.9.4
|
|
334
|
+
- @prosopo/load-balancer@2.8.21
|
|
335
|
+
|
|
336
|
+
## 2.9.55
|
|
337
|
+
### Patch Changes
|
|
338
|
+
|
|
339
|
+
- Updated dependencies [bd6995b]
|
|
340
|
+
- @prosopo/types@3.8.3
|
|
341
|
+
- @prosopo/api@3.1.44
|
|
342
|
+
- @prosopo/keyring@2.9.3
|
|
343
|
+
- @prosopo/load-balancer@2.8.20
|
|
344
|
+
|
|
345
|
+
## 2.9.54
|
|
346
|
+
### Patch Changes
|
|
347
|
+
|
|
348
|
+
- Updated dependencies [9633e58]
|
|
349
|
+
- @prosopo/types@3.8.2
|
|
350
|
+
- @prosopo/api@3.1.43
|
|
351
|
+
- @prosopo/keyring@2.9.2
|
|
352
|
+
- @prosopo/load-balancer@2.8.19
|
|
353
|
+
|
|
354
|
+
## 2.9.53
|
|
355
|
+
### Patch Changes
|
|
356
|
+
|
|
357
|
+
- Updated dependencies [f52a5c1]
|
|
358
|
+
- @prosopo/types@3.8.1
|
|
359
|
+
- @prosopo/api@3.1.42
|
|
360
|
+
- @prosopo/keyring@2.9.1
|
|
361
|
+
- @prosopo/load-balancer@2.8.18
|
|
362
|
+
|
|
363
|
+
## 2.9.52
|
|
364
|
+
### Patch Changes
|
|
365
|
+
|
|
366
|
+
- 0a38892: feat/cross-os-testing
|
|
367
|
+
- a8faa9a: bump license year
|
|
368
|
+
- 3acc333: Release 3.3.0
|
|
369
|
+
- Updated dependencies [a53526b]
|
|
370
|
+
- Updated dependencies [3acc333]
|
|
371
|
+
- Updated dependencies [0a38892]
|
|
372
|
+
- Updated dependencies [1ee3d80]
|
|
373
|
+
- Updated dependencies [a8faa9a]
|
|
374
|
+
- Updated dependencies [7543d17]
|
|
375
|
+
- Updated dependencies [3acc333]
|
|
376
|
+
- @prosopo/util@3.2.5
|
|
377
|
+
- @prosopo/keyring@2.9.0
|
|
378
|
+
- @prosopo/types@3.8.0
|
|
379
|
+
- @prosopo/load-balancer@2.8.17
|
|
380
|
+
- @prosopo/common@3.1.28
|
|
381
|
+
- @prosopo/api@3.1.41
|
|
382
|
+
|
|
383
|
+
## 2.9.51
|
|
384
|
+
### Patch Changes
|
|
385
|
+
|
|
386
|
+
- Updated dependencies [141e462]
|
|
387
|
+
- @prosopo/types@3.7.2
|
|
388
|
+
- @prosopo/api@3.1.40
|
|
389
|
+
- @prosopo/keyring@2.8.43
|
|
390
|
+
- @prosopo/load-balancer@2.8.16
|
|
391
|
+
|
|
392
|
+
## 2.9.50
|
|
393
|
+
### Patch Changes
|
|
394
|
+
|
|
395
|
+
- Updated dependencies [345b25b]
|
|
396
|
+
- @prosopo/types@3.7.1
|
|
397
|
+
- @prosopo/api@3.1.39
|
|
398
|
+
- @prosopo/keyring@2.8.42
|
|
399
|
+
- @prosopo/load-balancer@2.8.15
|
|
400
|
+
|
|
401
|
+
## 2.9.49
|
|
402
|
+
### Patch Changes
|
|
403
|
+
|
|
404
|
+
- Updated dependencies [ce70a2b]
|
|
405
|
+
- Updated dependencies [c2b940f]
|
|
406
|
+
- Updated dependencies [f6b5094]
|
|
407
|
+
- @prosopo/types@3.7.0
|
|
408
|
+
- @prosopo/api@3.1.38
|
|
409
|
+
- @prosopo/common@3.1.27
|
|
410
|
+
- @prosopo/keyring@2.8.41
|
|
411
|
+
- @prosopo/load-balancer@2.8.14
|
|
412
|
+
|
|
3
413
|
## 2.9.48
|
|
4
414
|
### Patch Changes
|
|
5
415
|
|
package/README.md
CHANGED
|
@@ -1,43 +1,29 @@
|
|
|
1
1
|
# @prosopo/server
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Server-side package for verifying [Prosopo Procaptcha](https://prosopo.io) tokens.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
You can install this library with:
|
|
8
|
-
|
|
9
7
|
```bash
|
|
10
8
|
npm install @prosopo/server --save
|
|
11
9
|
```
|
|
12
10
|
|
|
13
11
|
## Basic Usage
|
|
14
12
|
|
|
15
|
-
Simply import the `ProsopoServer` class and instantiate it with your Procaptcha API key.
|
|
16
|
-
|
|
17
13
|
```typescript
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
14
|
+
import { ProsopoServer } from "@prosopo/server"
|
|
15
|
+
import { getServerConfig } from "@prosopo/server"
|
|
16
|
+
import { getPair } from "@prosopo/keyring"
|
|
17
|
+
|
|
18
|
+
const config = getServerConfig()
|
|
19
|
+
const pair = getPair(process.env.PROSOPO_SITE_PRIVATE_KEY, config.account.address)
|
|
20
|
+
const server = new ProsopoServer(config, pair)
|
|
21
|
+
|
|
22
|
+
// Verify a Procaptcha token from the client
|
|
23
|
+
const result = await server.isVerified(token)
|
|
24
|
+
if (result.verified) {
|
|
25
|
+
// user passed the captcha
|
|
27
26
|
}
|
|
28
|
-
|
|
29
|
-
async function protectedFunction(server: ProsopoServer, payload: ProcaptchaResponse) {
|
|
30
|
-
if (await server.isVerified(payload[ApiParams.procaptchaResponse])) {
|
|
31
|
-
// perform CAPTCHA protected action
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
const payload = getPayloadFromRequest() // your request payload
|
|
36
|
-
getProsopoServer().then((server) => {
|
|
37
|
-
protectedFunction(server, payload).then(() => {
|
|
38
|
-
// ...
|
|
39
|
-
})
|
|
40
|
-
})
|
|
41
27
|
```
|
|
42
28
|
|
|
43
|
-
|
|
29
|
+
See the [client-example-server](https://github.com/prosopo/captcha/tree/main/demos/client-example-server) for a full working example, and the [docs](https://docs.prosopo.io) for integration instructions.
|
package/dist/cjs/config.cjs
CHANGED
|
@@ -19,7 +19,7 @@ const getServerUrl = () => {
|
|
|
19
19
|
}
|
|
20
20
|
return `${process.env.PROSOPO_SERVER_URL}:${process.env.PROSOPO_SERVER_PORT || 9228}`;
|
|
21
21
|
}
|
|
22
|
-
return "
|
|
22
|
+
return "https://localhost:9228";
|
|
23
23
|
};
|
|
24
24
|
exports.getServerConfig = getServerConfig;
|
|
25
25
|
exports.getServerUrl = getServerUrl;
|
package/dist/cjs/server.cjs
CHANGED
|
@@ -4,6 +4,7 @@ const api = require("@prosopo/api");
|
|
|
4
4
|
const common = require("@prosopo/common");
|
|
5
5
|
const keyring = require("@prosopo/keyring");
|
|
6
6
|
const loadBalancer = require("@prosopo/load-balancer");
|
|
7
|
+
const logger = require("@prosopo/logger");
|
|
7
8
|
const types = require("@prosopo/types");
|
|
8
9
|
const util = require("@prosopo/util");
|
|
9
10
|
const i18n = require("i18next");
|
|
@@ -13,7 +14,7 @@ class ProsopoServer {
|
|
|
13
14
|
this.pair = pair;
|
|
14
15
|
this.defaultEnvironment = this.config.defaultEnvironment;
|
|
15
16
|
this.dappAccount = this.config.account.address;
|
|
16
|
-
this.logger =
|
|
17
|
+
this.logger = logger.getLogger(
|
|
17
18
|
this.config.logLevel,
|
|
18
19
|
"@prosopo/server"
|
|
19
20
|
);
|
|
@@ -34,8 +35,9 @@ class ProsopoServer {
|
|
|
34
35
|
* @param user
|
|
35
36
|
* @param challenge
|
|
36
37
|
* @param ip
|
|
38
|
+
* @param email
|
|
37
39
|
*/
|
|
38
|
-
async verifyProvider(token, timeouts, providerUrl, timestamp, user, challenge, ip) {
|
|
40
|
+
async verifyProvider(token, timeouts, providerUrl, timestamp, user, challenge, ip, email) {
|
|
39
41
|
this.logger.info(() => ({
|
|
40
42
|
data: { providerUrl },
|
|
41
43
|
msg: "Verifying with provider"
|
|
@@ -66,7 +68,8 @@ class ProsopoServer {
|
|
|
66
68
|
signatureHex,
|
|
67
69
|
timeouts.pow.cachedTimeout,
|
|
68
70
|
user,
|
|
69
|
-
ip
|
|
71
|
+
ip,
|
|
72
|
+
email
|
|
70
73
|
);
|
|
71
74
|
}
|
|
72
75
|
const imageTimeout = this.config.timeouts.image.cachedTimeout;
|
|
@@ -86,15 +89,16 @@ class ProsopoServer {
|
|
|
86
89
|
signatureHex,
|
|
87
90
|
user,
|
|
88
91
|
timeouts.image.cachedTimeout,
|
|
89
|
-
ip
|
|
92
|
+
ip,
|
|
93
|
+
email
|
|
90
94
|
);
|
|
91
95
|
}
|
|
92
96
|
/**
|
|
93
|
-
*
|
|
94
|
-
* @returns
|
|
95
97
|
* @param token
|
|
98
|
+
* @param ip
|
|
99
|
+
* @param email
|
|
96
100
|
*/
|
|
97
|
-
async isVerified(token, ip) {
|
|
101
|
+
async isVerified(token, ip, email) {
|
|
98
102
|
try {
|
|
99
103
|
const payload = types.decodeProcaptchaOutput(token);
|
|
100
104
|
const { providerUrl, challenge, timestamp, user } = types.ProcaptchaOutputSchema.parse(payload);
|
|
@@ -117,7 +121,8 @@ class ProsopoServer {
|
|
|
117
121
|
Number(timestamp),
|
|
118
122
|
user,
|
|
119
123
|
challenge,
|
|
120
|
-
ip
|
|
124
|
+
ip,
|
|
125
|
+
email
|
|
121
126
|
);
|
|
122
127
|
this.logger.info(() => ({
|
|
123
128
|
data: {
|
|
@@ -131,8 +136,9 @@ class ProsopoServer {
|
|
|
131
136
|
return verificationResponse;
|
|
132
137
|
} catch (err) {
|
|
133
138
|
this.logger.error(() => ({ err, data: { token } }));
|
|
139
|
+
const code = err instanceof api.HttpError ? err.status : 500;
|
|
134
140
|
throw new common.ProsopoApiError("API.BAD_REQUEST", {
|
|
135
|
-
context: { code
|
|
141
|
+
context: { code, token }
|
|
136
142
|
});
|
|
137
143
|
}
|
|
138
144
|
}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export declare const getServerConfig: () => {
|
|
2
|
+
timeouts: {
|
|
3
|
+
image: {
|
|
4
|
+
verifiedTimeout: number;
|
|
5
|
+
challengeTimeout: number;
|
|
6
|
+
solutionTimeout: number;
|
|
7
|
+
cachedTimeout: number;
|
|
8
|
+
};
|
|
9
|
+
pow: {
|
|
10
|
+
verifiedTimeout: number;
|
|
11
|
+
solutionTimeout: number;
|
|
12
|
+
cachedTimeout: number;
|
|
13
|
+
};
|
|
14
|
+
puzzle: {
|
|
15
|
+
verifiedTimeout: number;
|
|
16
|
+
solutionTimeout: number;
|
|
17
|
+
cachedTimeout: number;
|
|
18
|
+
};
|
|
19
|
+
contract: {
|
|
20
|
+
maxVerifiedTime: number;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
logLevel: "error" | "trace" | "debug" | "info" | "warn" | "fatal" | "log";
|
|
24
|
+
defaultEnvironment: "development" | "staging" | "production";
|
|
25
|
+
account: {
|
|
26
|
+
secret?: string | undefined;
|
|
27
|
+
address?: string | undefined;
|
|
28
|
+
password?: string | undefined;
|
|
29
|
+
};
|
|
30
|
+
web2: boolean;
|
|
31
|
+
solutionThreshold: number;
|
|
32
|
+
dappName: string;
|
|
33
|
+
database?: Partial<Record<"development" | "staging" | "production", {
|
|
34
|
+
type: string;
|
|
35
|
+
endpoint: string;
|
|
36
|
+
dbname: string;
|
|
37
|
+
authSource: string;
|
|
38
|
+
}>> | undefined;
|
|
39
|
+
userAccountAddress?: string | undefined;
|
|
40
|
+
serverUrl?: string | undefined;
|
|
41
|
+
};
|
|
42
|
+
export declare const getServerUrl: () => string;
|
|
43
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;cAqBi2iB,CAAC;eAAqC,CAAC;gBAAsC,CAAC;;;;;;;;;;;;;CAXx8iB,CAAC;AAEJ,eAAO,MAAM,YAAY,QAAO,MAQ/B,CAAC"}
|
package/dist/config.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAE3D,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE,CACnC,yBAAyB,CAAC,KAAK,CAAC;IAC/B,kBAAkB,EAAE,OAAO,CAAC,GAAG,CAAC,2BAA2B;IAC3D,SAAS,EAAE,YAAY,EAAE;IACzB,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,uBAAuB;IAClE,OAAO,EAAE;QACR,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,EAAE;QAC3C,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,wBAAwB,IAAI,EAAE;KAClD;CACD,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,YAAY,GAAG,GAAW,EAAE;IACxC,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,CAAC;QACpC,IAAI,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;YAClD,OAAO,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC;QACvC,CAAC;QACD,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,IAAI,IAAI,EAAE,CAAC;IACvF,CAAC;IACD,OAAO,wBAAwB,CAAC;AACjC,CAAC,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ProsopoServer } from "./server.js";
|
|
2
|
+
export { ProsopoServer } from "./server.js";
|
|
3
|
+
export { getServerConfig, getServerUrl } from "./config.js";
|
|
4
|
+
import type { ProsopoServerConfigOutput } from "@prosopo/types";
|
|
5
|
+
export declare const PublicProsopoServer: (config: ProsopoServerConfigOutput) => Promise<ProsopoServer>;
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE5D,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAChE,eAAO,MAAM,mBAAmB,WACvB,yBAAyB,2BAKjC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,EACvC,MAAiC,EAChC,EAAE;IAEH,MAAM,IAAI,GAAG,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACxD,OAAO,IAAI,aAAa,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;AACxC,CAAC,CAAC"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ProviderApi } from "@prosopo/api";
|
|
2
|
+
import { Keyring } from "@prosopo/keyring";
|
|
3
|
+
import { type Logger } from "@prosopo/logger";
|
|
4
|
+
import type { KeyringPair } from "@prosopo/types";
|
|
5
|
+
import { type CaptchaTimeoutOutput, type ProcaptchaToken, type ProsopoServerConfigOutput, type VerificationResponse } from "@prosopo/types";
|
|
6
|
+
export declare class ProsopoServer {
|
|
7
|
+
config: ProsopoServerConfigOutput;
|
|
8
|
+
dappAccount: string | undefined;
|
|
9
|
+
defaultEnvironment: string;
|
|
10
|
+
logger: Logger;
|
|
11
|
+
keyring: Keyring;
|
|
12
|
+
pair: KeyringPair | undefined;
|
|
13
|
+
constructor(config: ProsopoServerConfigOutput, pair?: KeyringPair);
|
|
14
|
+
getProviderApi(providerUrl: string): ProviderApi;
|
|
15
|
+
verifyProvider(token: string, timeouts: CaptchaTimeoutOutput, providerUrl: string, timestamp: number, user: string, challenge?: string, ip?: string, email?: string): Promise<VerificationResponse>;
|
|
16
|
+
isVerified(token: ProcaptchaToken, ip?: string, email?: string): Promise<VerificationResponse>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=server.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAcA,OAAO,EAAa,WAAW,EAAE,MAAM,cAAc,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAE3C,OAAO,EAAiB,KAAK,MAAM,EAAa,MAAM,iBAAiB,CAAC;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EACN,KAAK,oBAAoB,EAEzB,KAAK,eAAe,EACpB,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EAEzB,MAAM,gBAAgB,CAAC;AAIxB,qBAAa,aAAa;IACzB,MAAM,EAAE,yBAAyB,CAAC;IAClC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,WAAW,GAAG,SAAS,CAAC;gBAElB,MAAM,EAAE,yBAAyB,EAAE,IAAI,CAAC,EAAE,WAAW;IAcjE,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW;IAgBnC,cAAc,CAC1B,KAAK,EAAE,MAAM,EACb,QAAQ,EAAE,oBAAoB,EAC9B,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,EACZ,SAAS,CAAC,EAAE,MAAM,EAClB,EAAE,CAAC,EAAE,MAAM,EACX,KAAK,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,oBAAoB,CAAC;IA+DnB,UAAU,CACtB,KAAK,EAAE,eAAe,EACtB,EAAE,CAAC,EAAE,MAAM,EACX,KAAK,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,oBAAoB,CAAC;CAsDhC"}
|
package/dist/server.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ProviderApi } from "@prosopo/api";
|
|
2
|
-
import {
|
|
1
|
+
import { ProviderApi, HttpError } from "@prosopo/api";
|
|
2
|
+
import { ProsopoContractError, ProsopoApiError } from "@prosopo/common";
|
|
3
3
|
import { Keyring } from "@prosopo/keyring";
|
|
4
4
|
import { loadBalancer } from "@prosopo/load-balancer";
|
|
5
|
+
import { getLogger } from "@prosopo/logger";
|
|
5
6
|
import { decodeProcaptchaOutput, ProcaptchaOutputSchema } from "@prosopo/types";
|
|
6
7
|
import { u8aToHex } from "@prosopo/util";
|
|
7
8
|
import i18n from "i18next";
|
|
@@ -32,8 +33,9 @@ class ProsopoServer {
|
|
|
32
33
|
* @param user
|
|
33
34
|
* @param challenge
|
|
34
35
|
* @param ip
|
|
36
|
+
* @param email
|
|
35
37
|
*/
|
|
36
|
-
async verifyProvider(token, timeouts, providerUrl, timestamp, user, challenge, ip) {
|
|
38
|
+
async verifyProvider(token, timeouts, providerUrl, timestamp, user, challenge, ip, email) {
|
|
37
39
|
this.logger.info(() => ({
|
|
38
40
|
data: { providerUrl },
|
|
39
41
|
msg: "Verifying with provider"
|
|
@@ -64,7 +66,8 @@ class ProsopoServer {
|
|
|
64
66
|
signatureHex,
|
|
65
67
|
timeouts.pow.cachedTimeout,
|
|
66
68
|
user,
|
|
67
|
-
ip
|
|
69
|
+
ip,
|
|
70
|
+
email
|
|
68
71
|
);
|
|
69
72
|
}
|
|
70
73
|
const imageTimeout = this.config.timeouts.image.cachedTimeout;
|
|
@@ -84,15 +87,16 @@ class ProsopoServer {
|
|
|
84
87
|
signatureHex,
|
|
85
88
|
user,
|
|
86
89
|
timeouts.image.cachedTimeout,
|
|
87
|
-
ip
|
|
90
|
+
ip,
|
|
91
|
+
email
|
|
88
92
|
);
|
|
89
93
|
}
|
|
90
94
|
/**
|
|
91
|
-
*
|
|
92
|
-
* @returns
|
|
93
95
|
* @param token
|
|
96
|
+
* @param ip
|
|
97
|
+
* @param email
|
|
94
98
|
*/
|
|
95
|
-
async isVerified(token, ip) {
|
|
99
|
+
async isVerified(token, ip, email) {
|
|
96
100
|
try {
|
|
97
101
|
const payload = decodeProcaptchaOutput(token);
|
|
98
102
|
const { providerUrl, challenge, timestamp, user } = ProcaptchaOutputSchema.parse(payload);
|
|
@@ -115,7 +119,8 @@ class ProsopoServer {
|
|
|
115
119
|
Number(timestamp),
|
|
116
120
|
user,
|
|
117
121
|
challenge,
|
|
118
|
-
ip
|
|
122
|
+
ip,
|
|
123
|
+
email
|
|
119
124
|
);
|
|
120
125
|
this.logger.info(() => ({
|
|
121
126
|
data: {
|
|
@@ -129,8 +134,9 @@ class ProsopoServer {
|
|
|
129
134
|
return verificationResponse;
|
|
130
135
|
} catch (err) {
|
|
131
136
|
this.logger.error(() => ({ err, data: { token } }));
|
|
137
|
+
const code = err instanceof HttpError ? err.status : 500;
|
|
132
138
|
throw new ProsopoApiError("API.BAD_REQUEST", {
|
|
133
|
-
context: { code
|
|
139
|
+
context: { code, token }
|
|
134
140
|
});
|
|
135
141
|
}
|
|
136
142
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAC3C,OAAO,EAAE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oBAAoB,GAAG,MAAM,IAAI,CAAC,cAAc,CACrD,KAAK,EACL,IAAI,CAAC,MAAM,CAAC,QAAQ,EACpB,QAAQ,CAAC,GAAG,EACZ,MAAM,CAAC,SAAS,CAAC,EACjB,IAAI,EACJ,SAAS,EACT,EAAE,EACF,KAAK,CACL,CAAC;YAEF,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;gBACvB,IAAI,EAAE;oBACL,oBAAoB;oBACpB,WAAW;oBACX,IAAI;oBACJ,SAAS;oBACT,OAAO,EAAE,IAAI,CAAC,IAAI,EAAE,OAAO;iBAC3B;aACD,CAAC,CAAC,CAAC;YAEJ,OAAO,oBAAoB,CAAC;QAC7B,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,CAAC;YACpD,MAAM,IAAI,GAAG,GAAG,YAAY,SAAS,CAAC,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC;YACzD,MAAM,IAAI,eAAe,CAAC,iBAAiB,EAAE;gBAC5C,OAAO,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE;aACxB,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;CACD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosopo/server",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.10.12",
|
|
4
4
|
"description": "NodeJS package for server side communication with the prosopo captcha client",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,14 +18,16 @@
|
|
|
18
18
|
},
|
|
19
19
|
"scripts": {
|
|
20
20
|
"clean": "del-cli --verbose dist tsconfig.tsbuildinfo",
|
|
21
|
-
"build": "
|
|
21
|
+
"build": "npm run build:cross-env -- --mode ${NODE_ENV:-development}",
|
|
22
|
+
"build:cross-env": "vite build --config vite.esm.config.ts",
|
|
22
23
|
"build:tsc": "tsc --build --verbose",
|
|
23
24
|
"build:cjs": "NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV",
|
|
24
25
|
"typecheck": "tsc --project tsconfig.types.json"
|
|
25
26
|
},
|
|
26
27
|
"repository": {
|
|
27
28
|
"type": "git",
|
|
28
|
-
"url": "git+https://github.com/prosopo/captcha.git"
|
|
29
|
+
"url": "git+https://github.com/prosopo/captcha.git",
|
|
30
|
+
"directory": "packages/server"
|
|
29
31
|
},
|
|
30
32
|
"author": "PROSOPO LIMITED",
|
|
31
33
|
"license": "Apache-2.0",
|
|
@@ -35,16 +37,17 @@
|
|
|
35
37
|
"homepage": "https://github.com/prosopo/captcha#readme",
|
|
36
38
|
"sideEffects": false,
|
|
37
39
|
"dependencies": {
|
|
38
|
-
"@prosopo/api": "3.
|
|
39
|
-
"@prosopo/common": "3.1.
|
|
40
|
-
"@prosopo/
|
|
41
|
-
"@prosopo/
|
|
42
|
-
"@prosopo/
|
|
43
|
-
"@prosopo/
|
|
40
|
+
"@prosopo/api": "3.4.8",
|
|
41
|
+
"@prosopo/common": "3.1.38",
|
|
42
|
+
"@prosopo/logger": "1.0.2",
|
|
43
|
+
"@prosopo/keyring": "2.9.34",
|
|
44
|
+
"@prosopo/load-balancer": "2.9.10",
|
|
45
|
+
"@prosopo/types": "4.3.0",
|
|
46
|
+
"@prosopo/util": "3.2.15",
|
|
44
47
|
"i18next": "24.1.0"
|
|
45
48
|
},
|
|
46
49
|
"devDependencies": {
|
|
47
|
-
"@prosopo/config": "3.1
|
|
50
|
+
"@prosopo/config": "3.3.1",
|
|
48
51
|
"@types/node": "22.10.2",
|
|
49
52
|
"@vitest/coverage-v8": "3.2.4",
|
|
50
53
|
"concurrently": "9.0.1",
|
package/vite.cjs.config.ts
CHANGED
package/vite.esm.config.ts
CHANGED