@prosopo/types-database 4.0.5 → 4.0.6
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 +45 -0
- package/.turbo/turbo-build.log +45 -0
- package/CHANGELOG.md +10 -0
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/types/client.cjs +13 -1
- package/dist/cjs/types/index.cjs +1 -1
- package/dist/cjs/types/provider.cjs +17 -8
- package/dist/index.js +2 -2
- package/dist/types/client.js +15 -3
- package/dist/types/index.js +2 -2
- package/dist/types/provider.js +18 -9
- package/package.json +6 -6
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
|
|
2
|
+
> @prosopo/types-database@4.0.6 build:cjs
|
|
3
|
+
> NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
|
|
4
|
+
|
|
5
|
+
ViteCommonJSConfig: .
|
|
6
|
+
{
|
|
7
|
+
tsConfigPaths: [
|
|
8
|
+
'/home/runner/work/captcha/captcha/packages/common/tsconfig.json',
|
|
9
|
+
'/home/runner/work/captcha/captcha/packages/locale/tsconfig.json',
|
|
10
|
+
'/home/runner/work/captcha/captcha/packages/types/tsconfig.json',
|
|
11
|
+
'/home/runner/work/captcha/captcha/packages/util/tsconfig.json',
|
|
12
|
+
'/home/runner/work/captcha/captcha/packages/util-crypto/tsconfig.json',
|
|
13
|
+
'/home/runner/work/captcha/captcha/packages/user-access-policy/tsconfig.json',
|
|
14
|
+
'/home/runner/work/captcha/captcha/packages/api-route/tsconfig.json',
|
|
15
|
+
'/home/runner/work/captcha/captcha/packages/redis-client/tsconfig.json',
|
|
16
|
+
'/home/runner/work/captcha/captcha/packages/api/tsconfig.json'
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
{
|
|
20
|
+
externals: [
|
|
21
|
+
'@prosopo/common',
|
|
22
|
+
'@prosopo/locale',
|
|
23
|
+
'@prosopo/types',
|
|
24
|
+
'@prosopo/util',
|
|
25
|
+
'@prosopo/util-crypto',
|
|
26
|
+
'@prosopo/user-access-policy',
|
|
27
|
+
'@prosopo/api-route',
|
|
28
|
+
'@prosopo/redis-client',
|
|
29
|
+
'@prosopo/api'
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
[36mvite v6.4.1 [32mbuilding SSR bundle for production...[36m[39m
|
|
33
|
+
Bundle build started
|
|
34
|
+
transforming...
|
|
35
|
+
Build end
|
|
36
|
+
[32m✓[39m 7 modules transformed.
|
|
37
|
+
rendering chunks...
|
|
38
|
+
[2mdist/cjs/[22m[36mtypes/mongo.cjs [39m[1m[2m 0.01 kB[22m[1m[22m
|
|
39
|
+
[2mdist/cjs/[22m[36mtypes/userAgent.cjs [39m[1m[2m 0.01 kB[22m[1m[22m
|
|
40
|
+
[2mdist/cjs/[22m[36mtypes/captcha.cjs [39m[1m[2m 0.77 kB[22m[1m[22m
|
|
41
|
+
[2mdist/cjs/[22m[36mindex.cjs [39m[1m[2m 2.10 kB[22m[1m[22m
|
|
42
|
+
[2mdist/cjs/[22m[36mtypes/index.cjs [39m[1m[2m 2.10 kB[22m[1m[22m
|
|
43
|
+
[2mdist/cjs/[22m[36mtypes/client.cjs [39m[1m[2m 4.01 kB[22m[1m[22m
|
|
44
|
+
[2mdist/cjs/[22m[36mtypes/provider.cjs [39m[1m[2m13.99 kB[22m[1m[22m
|
|
45
|
+
[32m✓ built in 131ms[39m
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
|
|
2
|
+
> @prosopo/types-database@4.0.6 build
|
|
3
|
+
> NODE_ENV=${NODE_ENV:-development}; vite build --config vite.esm.config.ts --mode $NODE_ENV
|
|
4
|
+
|
|
5
|
+
ViteEsmConfig: .
|
|
6
|
+
{
|
|
7
|
+
tsConfigPaths: [
|
|
8
|
+
'/home/runner/work/captcha/captcha/packages/common/tsconfig.json',
|
|
9
|
+
'/home/runner/work/captcha/captcha/packages/locale/tsconfig.json',
|
|
10
|
+
'/home/runner/work/captcha/captcha/packages/types/tsconfig.json',
|
|
11
|
+
'/home/runner/work/captcha/captcha/packages/util/tsconfig.json',
|
|
12
|
+
'/home/runner/work/captcha/captcha/packages/util-crypto/tsconfig.json',
|
|
13
|
+
'/home/runner/work/captcha/captcha/packages/user-access-policy/tsconfig.json',
|
|
14
|
+
'/home/runner/work/captcha/captcha/packages/api-route/tsconfig.json',
|
|
15
|
+
'/home/runner/work/captcha/captcha/packages/redis-client/tsconfig.json',
|
|
16
|
+
'/home/runner/work/captcha/captcha/packages/api/tsconfig.json'
|
|
17
|
+
]
|
|
18
|
+
}
|
|
19
|
+
{
|
|
20
|
+
externals: [
|
|
21
|
+
'@prosopo/common',
|
|
22
|
+
'@prosopo/locale',
|
|
23
|
+
'@prosopo/types',
|
|
24
|
+
'@prosopo/util',
|
|
25
|
+
'@prosopo/util-crypto',
|
|
26
|
+
'@prosopo/user-access-policy',
|
|
27
|
+
'@prosopo/api-route',
|
|
28
|
+
'@prosopo/redis-client',
|
|
29
|
+
'@prosopo/api'
|
|
30
|
+
]
|
|
31
|
+
}
|
|
32
|
+
[36mvite v6.4.1 [32mbuilding SSR bundle for production...[36m[39m
|
|
33
|
+
Bundle build started
|
|
34
|
+
transforming...
|
|
35
|
+
Build end
|
|
36
|
+
[32m✓[39m 7 modules transformed.
|
|
37
|
+
rendering chunks...
|
|
38
|
+
[2mdist/[22m[36mtypes/mongo.js [39m[1m[2m 0.00 kB[22m[1m[22m
|
|
39
|
+
[2mdist/[22m[36mtypes/userAgent.js [39m[1m[2m 0.00 kB[22m[1m[22m
|
|
40
|
+
[2mdist/[22m[36mtypes/captcha.js [39m[1m[2m 0.60 kB[22m[1m[22m
|
|
41
|
+
[2mdist/[22m[36mindex.js [39m[1m[2m 1.55 kB[22m[1m[22m
|
|
42
|
+
[2mdist/[22m[36mtypes/index.js [39m[1m[2m 1.55 kB[22m[1m[22m
|
|
43
|
+
[2mdist/[22m[36mtypes/client.js [39m[1m[2m 3.87 kB[22m[1m[22m
|
|
44
|
+
[2mdist/[22m[36mtypes/provider.js [39m[1m[2m13.05 kB[22m[1m[22m
|
|
45
|
+
[32m✓ built in 238ms[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
# @prosopo/types-database
|
|
2
2
|
|
|
3
|
+
## 4.0.6
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- 7d5eb3f: bump
|
|
7
|
+
- Updated dependencies [7d5eb3f]
|
|
8
|
+
- @prosopo/common@3.1.26
|
|
9
|
+
- @prosopo/locale@3.1.26
|
|
10
|
+
- @prosopo/types@3.6.4
|
|
11
|
+
- @prosopo/user-access-policy@3.5.32
|
|
12
|
+
|
|
3
13
|
## 4.0.5
|
|
4
14
|
### Patch Changes
|
|
5
15
|
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -5,7 +5,7 @@ const provider = require("./types/provider.cjs");
|
|
|
5
5
|
const client = require("./types/client.cjs");
|
|
6
6
|
const captcha = require("./types/captcha.cjs");
|
|
7
7
|
exports.CaptchaRecordSchema = provider.CaptchaRecordSchema;
|
|
8
|
-
exports.
|
|
8
|
+
exports.ClientContextEntropyRecordSchema = provider.ClientContextEntropyRecordSchema;
|
|
9
9
|
exports.ClientRecordSchema = provider.ClientRecordSchema;
|
|
10
10
|
exports.CompositeIpAddressRecordSchemaObj = provider.CompositeIpAddressRecordSchemaObj;
|
|
11
11
|
exports.CompositeIpAddressSchema = provider.CompositeIpAddressSchema;
|
|
@@ -73,7 +73,19 @@ const UserSettingsSchema = new mongoose.Schema({
|
|
|
73
73
|
},
|
|
74
74
|
contextAware: {
|
|
75
75
|
enabled: { type: Boolean, default: false },
|
|
76
|
-
|
|
76
|
+
contexts: {
|
|
77
|
+
type: mongoose.Schema.Types.Mixed,
|
|
78
|
+
default: {
|
|
79
|
+
[types.ContextType.Default]: {
|
|
80
|
+
type: types.ContextType.Default,
|
|
81
|
+
threshold: types.contextAwareThresholdDefault
|
|
82
|
+
},
|
|
83
|
+
[types.ContextType.Webview]: {
|
|
84
|
+
type: types.ContextType.Webview,
|
|
85
|
+
threshold: types.contextAwareThresholdDefault
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
77
89
|
}
|
|
78
90
|
});
|
|
79
91
|
const UserDataSchema = new mongoose.Schema({
|
package/dist/cjs/types/index.cjs
CHANGED
|
@@ -6,7 +6,7 @@ const client = require("./client.cjs");
|
|
|
6
6
|
const captcha = require("./captcha.cjs");
|
|
7
7
|
require("./userAgent.cjs");
|
|
8
8
|
exports.CaptchaRecordSchema = provider.CaptchaRecordSchema;
|
|
9
|
-
exports.
|
|
9
|
+
exports.ClientContextEntropyRecordSchema = provider.ClientContextEntropyRecordSchema;
|
|
10
10
|
exports.ClientRecordSchema = provider.ClientRecordSchema;
|
|
11
11
|
exports.CompositeIpAddressRecordSchemaObj = provider.CompositeIpAddressRecordSchemaObj;
|
|
12
12
|
exports.CompositeIpAddressSchema = provider.CompositeIpAddressSchema;
|
|
@@ -314,15 +314,24 @@ const DetectorRecordSchema = new mongoose.Schema({
|
|
|
314
314
|
});
|
|
315
315
|
DetectorRecordSchema.index({ createdAt: 1 }, { unique: true });
|
|
316
316
|
DetectorRecordSchema.index({ expiresAt: 1 }, { expireAfterSeconds: 0 });
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
317
|
+
const ClientContextEntropyRecordSchema = new mongoose.Schema(
|
|
318
|
+
{
|
|
319
|
+
account: { type: String, required: true },
|
|
320
|
+
contextType: {
|
|
321
|
+
type: String,
|
|
322
|
+
enum: Object.values(types.ContextType),
|
|
323
|
+
required: true
|
|
324
|
+
},
|
|
325
|
+
entropy: { type: String, required: true }
|
|
326
|
+
},
|
|
327
|
+
{ timestamps: { createdAt: true, updatedAt: true } }
|
|
328
|
+
);
|
|
329
|
+
ClientContextEntropyRecordSchema.index(
|
|
330
|
+
{ account: 1, contextType: 1 },
|
|
331
|
+
{ unique: true }
|
|
332
|
+
);
|
|
324
333
|
exports.CaptchaRecordSchema = CaptchaRecordSchema;
|
|
325
|
-
exports.
|
|
334
|
+
exports.ClientContextEntropyRecordSchema = ClientContextEntropyRecordSchema;
|
|
326
335
|
exports.ClientRecordSchema = ClientRecordSchema;
|
|
327
336
|
exports.CompositeIpAddressRecordSchemaObj = CompositeIpAddressRecordSchemaObj;
|
|
328
337
|
exports.CompositeIpAddressSchema = CompositeIpAddressSchema;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./types/index.js";
|
|
2
|
-
import { CaptchaRecordSchema,
|
|
2
|
+
import { CaptchaRecordSchema, ClientContextEntropyRecordSchema, ClientRecordSchema, CompositeIpAddressRecordSchemaObj, CompositeIpAddressSchema, DatasetRecordSchema, DetectorRecordSchema, IpAddressType, PendingRecordSchema, PoWCaptchaRecordSchema, ScheduledTaskRecordSchema, ScheduledTaskSchema, SessionRecordSchema, SolutionRecordSchema, UserCommitmentRecordSchema, UserCommitmentSchema, UserCommitmentWithSolutionsSchema, UserSolutionRecordSchema, UserSolutionSchema, parseMongooseCompositeIpAddress } from "./types/provider.js";
|
|
3
3
|
import { AccountSchema, IPValidationRulesSchema, TableNames, UserDataSchema, UserSettingsSchema } from "./types/client.js";
|
|
4
4
|
import { StoredPoWCaptchaRecordSchema, StoredSessionRecordSchema, StoredUserCommitmentRecordSchema } from "./types/captcha.js";
|
|
5
5
|
export {
|
|
6
6
|
AccountSchema,
|
|
7
7
|
CaptchaRecordSchema,
|
|
8
|
-
|
|
8
|
+
ClientContextEntropyRecordSchema,
|
|
9
9
|
ClientRecordSchema,
|
|
10
10
|
CompositeIpAddressRecordSchemaObj,
|
|
11
11
|
CompositeIpAddressSchema,
|
package/dist/types/client.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { requireAllConditionsDefault, abuseScoreThresholdDefault, distanceThresholdKmDefault, abuseScoreThresholdExceedActionDefault, distanceExceedActionDefault, ispChangeActionDefault, cityChangeActionDefault, countryChangeActionDefault, contextAwareThresholdDefault } from "@prosopo/types";
|
|
2
|
-
import { Schema } from "mongoose";
|
|
1
|
+
import { requireAllConditionsDefault, abuseScoreThresholdDefault, distanceThresholdKmDefault, abuseScoreThresholdExceedActionDefault, distanceExceedActionDefault, ispChangeActionDefault, cityChangeActionDefault, countryChangeActionDefault, ContextType, contextAwareThresholdDefault } from "@prosopo/types";
|
|
2
|
+
import mongoose, { Schema } from "mongoose";
|
|
3
3
|
const IPValidationRulesSchema = new Schema({
|
|
4
4
|
actions: {
|
|
5
5
|
countryChangeAction: {
|
|
@@ -71,7 +71,19 @@ const UserSettingsSchema = new Schema({
|
|
|
71
71
|
},
|
|
72
72
|
contextAware: {
|
|
73
73
|
enabled: { type: Boolean, default: false },
|
|
74
|
-
|
|
74
|
+
contexts: {
|
|
75
|
+
type: mongoose.Schema.Types.Mixed,
|
|
76
|
+
default: {
|
|
77
|
+
[ContextType.Default]: {
|
|
78
|
+
type: ContextType.Default,
|
|
79
|
+
threshold: contextAwareThresholdDefault
|
|
80
|
+
},
|
|
81
|
+
[ContextType.Webview]: {
|
|
82
|
+
type: ContextType.Webview,
|
|
83
|
+
threshold: contextAwareThresholdDefault
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
75
87
|
}
|
|
76
88
|
});
|
|
77
89
|
const UserDataSchema = new Schema({
|
package/dist/types/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "./mongo.js";
|
|
2
|
-
import { CaptchaRecordSchema,
|
|
2
|
+
import { CaptchaRecordSchema, ClientContextEntropyRecordSchema, ClientRecordSchema, CompositeIpAddressRecordSchemaObj, CompositeIpAddressSchema, DatasetRecordSchema, DetectorRecordSchema, IpAddressType, PendingRecordSchema, PoWCaptchaRecordSchema, ScheduledTaskRecordSchema, ScheduledTaskSchema, SessionRecordSchema, SolutionRecordSchema, UserCommitmentRecordSchema, UserCommitmentSchema, UserCommitmentWithSolutionsSchema, UserSolutionRecordSchema, UserSolutionSchema, parseMongooseCompositeIpAddress } from "./provider.js";
|
|
3
3
|
import { AccountSchema, IPValidationRulesSchema, TableNames, UserDataSchema, UserSettingsSchema } from "./client.js";
|
|
4
4
|
import { StoredPoWCaptchaRecordSchema, StoredSessionRecordSchema, StoredUserCommitmentRecordSchema } from "./captcha.js";
|
|
5
5
|
import "./userAgent.js";
|
|
6
6
|
export {
|
|
7
7
|
AccountSchema,
|
|
8
8
|
CaptchaRecordSchema,
|
|
9
|
-
|
|
9
|
+
ClientContextEntropyRecordSchema,
|
|
10
10
|
ClientRecordSchema,
|
|
11
11
|
CompositeIpAddressRecordSchemaObj,
|
|
12
12
|
CompositeIpAddressSchema,
|
package/dist/types/provider.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TranslationKeysSchema } from "@prosopo/locale";
|
|
2
|
-
import { Tier, CaptchaStatus, CaptchaSolutionSchema, ScheduledTaskStatus, ScheduledTaskNames, CaptchaType } from "@prosopo/types";
|
|
2
|
+
import { Tier, CaptchaStatus, CaptchaSolutionSchema, ScheduledTaskStatus, ScheduledTaskNames, CaptchaType, ContextType } from "@prosopo/types";
|
|
3
3
|
import { Schema } from "mongoose";
|
|
4
4
|
import { object, nativeEnum, bigint, string, array, number, date, boolean, any } from "zod";
|
|
5
5
|
import { UserSettingsSchema } from "./client.js";
|
|
@@ -312,16 +312,25 @@ const DetectorRecordSchema = new Schema({
|
|
|
312
312
|
});
|
|
313
313
|
DetectorRecordSchema.index({ createdAt: 1 }, { unique: true });
|
|
314
314
|
DetectorRecordSchema.index({ expiresAt: 1 }, { expireAfterSeconds: 0 });
|
|
315
|
-
const
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
315
|
+
const ClientContextEntropyRecordSchema = new Schema(
|
|
316
|
+
{
|
|
317
|
+
account: { type: String, required: true },
|
|
318
|
+
contextType: {
|
|
319
|
+
type: String,
|
|
320
|
+
enum: Object.values(ContextType),
|
|
321
|
+
required: true
|
|
322
|
+
},
|
|
323
|
+
entropy: { type: String, required: true }
|
|
324
|
+
},
|
|
325
|
+
{ timestamps: { createdAt: true, updatedAt: true } }
|
|
326
|
+
);
|
|
327
|
+
ClientContextEntropyRecordSchema.index(
|
|
328
|
+
{ account: 1, contextType: 1 },
|
|
329
|
+
{ unique: true }
|
|
330
|
+
);
|
|
322
331
|
export {
|
|
323
332
|
CaptchaRecordSchema,
|
|
324
|
-
|
|
333
|
+
ClientContextEntropyRecordSchema,
|
|
325
334
|
ClientRecordSchema,
|
|
326
335
|
CompositeIpAddressRecordSchemaObj,
|
|
327
336
|
CompositeIpAddressSchema,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosopo/types-database",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.6",
|
|
4
4
|
"description": "Types for prosopo database",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
},
|
|
35
35
|
"homepage": "https://github.com/prosopo/captcha#readme",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@prosopo/common": "3.1.
|
|
38
|
-
"@prosopo/locale": "3.1.
|
|
39
|
-
"@prosopo/types": "3.6.
|
|
40
|
-
"@prosopo/user-access-policy": "3.5.
|
|
37
|
+
"@prosopo/common": "3.1.26",
|
|
38
|
+
"@prosopo/locale": "3.1.26",
|
|
39
|
+
"@prosopo/types": "3.6.4",
|
|
40
|
+
"@prosopo/user-access-policy": "3.5.32",
|
|
41
41
|
"mongoose": "8.13.0",
|
|
42
42
|
"zod": "3.23.8"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@prosopo/config": "3.1.
|
|
45
|
+
"@prosopo/config": "3.1.26",
|
|
46
46
|
"@types/node": "22.10.2",
|
|
47
47
|
"@vitest/coverage-v8": "3.2.4",
|
|
48
48
|
"concurrently": "9.0.1",
|