@prosopo/types-database 4.0.6 → 4.1.5

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @prosopo/types-database@4.0.6 build:cjs
2
+ > @prosopo/types-database@4.1.5 build:cjs
3
3
  > NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
4
4
 
5
5
  ViteCommonJSConfig: .
@@ -41,5 +41,5 @@ rendering chunks...
41
41
  dist/cjs/index.cjs  2.10 kB
42
42
  dist/cjs/types/index.cjs  2.10 kB
43
43
  dist/cjs/types/client.cjs  4.01 kB
44
- dist/cjs/types/provider.cjs 13.99 kB
45
- ✓ built in 131ms
44
+ dist/cjs/types/provider.cjs 14.70 kB
45
+ ✓ built in 255ms
@@ -0,0 +1,41 @@
1
+
2
+ > @prosopo/types-database@4.1.5 build:tsc
3
+ > tsc --build --verbose
4
+
5
+ 4:57:18 PM - 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
+ * ../common/tsconfig.json
12
+ * ../api-route/tsconfig.json
13
+ * ../redis-client/tsconfig.json
14
+ * ../api/tsconfig.json
15
+ * ../user-access-policy/tsconfig.json
16
+ * tsconfig.json
17
+
18
+ 4:57:18 PM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/dependencies.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
19
+
20
+ 4:57:18 PM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
21
+
22
+ 4:57:18 PM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/verifyRecency.ts' is older than output '../util/tsconfig.tsbuildinfo'
23
+
24
+ 4:57:18 PM - 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
+ 4:57:18 PM - 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
+ 4:57:18 PM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/logger.ts' is older than output '../common/tsconfig.tsbuildinfo'
29
+
30
+ 4:57:18 PM - Project '../api-route/tsconfig.json' is up to date because newest input '../api-route/src/index.ts' is older than output '../api-route/tsconfig.tsbuildinfo'
31
+
32
+ 4:57:18 PM - Project '../redis-client/tsconfig.json' is up to date because newest input '../redis-client/src/index.ts' is older than output '../redis-client/tsconfig.tsbuildinfo'
33
+
34
+ 4:57:18 PM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
35
+
36
+ 4:57:18 PM - Project '../user-access-policy/tsconfig.json' is up to date because newest input '../user-access-policy/src/transformRule.ts' is older than output '../user-access-policy/tsconfig.tsbuildinfo'
37
+
38
+ 4:57:18 PM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
39
+
40
+ 4:57:18 PM - Building project '/home/runner/work/captcha/captcha/packages/types-database/tsconfig.json'...
41
+
@@ -1,6 +1,10 @@
1
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
2
+ > @prosopo/types-database@4.1.5 build
3
+ > npm run build:cross-env -- --mode ${NODE_ENV:-development}
4
+
5
+
6
+ > @prosopo/types-database@4.1.5 build:cross-env
7
+ > vite build --config vite.esm.config.ts --mode production
4
8
 
5
9
  ViteEsmConfig: .
6
10
  {
@@ -41,5 +45,5 @@ rendering chunks...
41
45
  dist/index.js  1.55 kB
42
46
  dist/types/index.js  1.55 kB
43
47
  dist/types/client.js  3.87 kB
44
- dist/types/provider.js 13.05 kB
45
- ✓ built in 238ms
48
+ dist/types/provider.js 13.74 kB
49
+ ✓ built in 262ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,80 @@
1
1
  # @prosopo/types-database
2
2
 
3
+ ## 4.1.5
4
+ ### Patch Changes
5
+
6
+ - 3acc333: Update pow record at verify
7
+ - 3acc333: Fix type
8
+ - 0a38892: feat/cross-os-testing
9
+ - a8faa9a: bump license year
10
+ - 7543d17: mouse movements bot stopping
11
+ - fe9fe22: adding api returns
12
+ - 3acc333: Release 3.3.0
13
+ - Updated dependencies [3acc333]
14
+ - Updated dependencies [0a38892]
15
+ - Updated dependencies [1ee3d80]
16
+ - Updated dependencies [a8faa9a]
17
+ - Updated dependencies [17854a7]
18
+ - Updated dependencies [7543d17]
19
+ - Updated dependencies [fe9fe22]
20
+ - Updated dependencies [3acc333]
21
+ - @prosopo/types@3.8.0
22
+ - @prosopo/user-access-policy@3.6.0
23
+ - @prosopo/common@3.1.28
24
+ - @prosopo/locale@3.1.28
25
+
26
+ ## 4.1.4
27
+ ### Patch Changes
28
+
29
+ - Updated dependencies [378a896]
30
+ - Updated dependencies [90fddd8]
31
+ - @prosopo/user-access-policy@3.5.37
32
+
33
+ ## 4.1.3
34
+ ### Patch Changes
35
+
36
+ - Updated dependencies [7c475dc]
37
+ - @prosopo/user-access-policy@3.5.36
38
+
39
+ ## 4.1.2
40
+ ### Patch Changes
41
+
42
+ - Updated dependencies [141e462]
43
+ - @prosopo/types@3.7.2
44
+ - @prosopo/user-access-policy@3.5.35
45
+
46
+ ## 4.1.1
47
+ ### Patch Changes
48
+
49
+ - 345b25b: pow coord
50
+ - Updated dependencies [345b25b]
51
+ - @prosopo/types@3.7.1
52
+ - @prosopo/user-access-policy@3.5.34
53
+
54
+ ## 4.1.0
55
+ ### Minor Changes
56
+
57
+ - ce70a2b: Add context-aware entropy calculation for WebView and default contexts
58
+
59
+ - Added ContextType enum to distinguish between WebView and default browser contexts
60
+ - Implemented context-specific entropy calculation and storage
61
+ - Created clientContextEntropy collection with automatic timestamp management
62
+ - Removed legacy clientEntropy table in favor of context-specific approach
63
+ - Added helper functions for context determination and threshold retrieval
64
+ - Included comprehensive unit tests for context validation logic
65
+
66
+ ### Patch Changes
67
+
68
+ - c2b940f: Properly save context type settings
69
+ - Updated dependencies [ce70a2b]
70
+ - Updated dependencies [c2b940f]
71
+ - Updated dependencies [f6b5094]
72
+ - Updated dependencies [e01227b]
73
+ - @prosopo/types@3.7.0
74
+ - @prosopo/locale@3.1.27
75
+ - @prosopo/common@3.1.27
76
+ - @prosopo/user-access-policy@3.5.33
77
+
3
78
  ## 4.0.6
4
79
  ### Patch Changes
5
80
 
@@ -135,13 +135,29 @@ const PoWCaptchaRecordSchema = new mongoose.Schema({
135
135
  type: String,
136
136
  required: false
137
137
  },
138
- coords: { type: [[[Number]]], required: false }
138
+ coords: { type: [[[Number]]], required: false },
139
+ // Legacy fields - kept for backward compatibility with existing data
140
+ mouseEvents: { type: [Object], required: false },
141
+ touchEvents: { type: [Object], required: false },
142
+ clickEvents: { type: [Object], required: false },
143
+ // Current behavioral data storage format (packed)
144
+ deviceCapability: { type: String, required: false },
145
+ behavioralDataPacked: {
146
+ type: {
147
+ c1: { type: [mongoose.Schema.Types.Mixed], required: true },
148
+ c2: { type: [mongoose.Schema.Types.Mixed], required: true },
149
+ c3: { type: [mongoose.Schema.Types.Mixed], required: true },
150
+ d: { type: String, required: true }
151
+ },
152
+ required: false
153
+ }
139
154
  });
140
155
  PoWCaptchaRecordSchema.index({ challenge: 1 });
141
- PoWCaptchaRecordSchema.index({ storedAtTimestamp: 1, lastUpdatedTimestamp: 1 });
156
+ PoWCaptchaRecordSchema.index({ lastUpdatedTimestamp: 1 });
142
157
  PoWCaptchaRecordSchema.index({ dappAccount: 1, requestedAtTimestamp: 1 });
143
158
  PoWCaptchaRecordSchema.index({ "ipAddress.lower": 1 });
144
159
  PoWCaptchaRecordSchema.index({ "ipAddress.upper": 1 });
160
+ PoWCaptchaRecordSchema.index({ "result.reason": 1 });
145
161
  const UserCommitmentRecordSchema = new mongoose.Schema({
146
162
  userAccount: { type: String, required: true },
147
163
  dappAccount: { type: String, required: true },
@@ -181,12 +197,12 @@ const UserCommitmentRecordSchema = new mongoose.Schema({
181
197
  });
182
198
  UserCommitmentRecordSchema.index({ id: -1 });
183
199
  UserCommitmentRecordSchema.index({
184
- storedAtTimestamp: 1,
185
200
  lastUpdatedTimestamp: 1
186
201
  });
187
202
  UserCommitmentRecordSchema.index({ userAccount: 1, dappAccount: 1 });
188
203
  UserCommitmentRecordSchema.index({ "ipAddress.lower": 1 });
189
204
  UserCommitmentRecordSchema.index({ "ipAddress.upper": 1 });
205
+ UserCommitmentRecordSchema.index({ "result.reason": 1 });
190
206
  const DatasetRecordSchema = new mongoose.Schema({
191
207
  contentTree: { type: [[String]], required: true },
192
208
  datasetContentId: { type: String, required: true },
@@ -0,0 +1,3 @@
1
+ export * from "./types/index.js";
2
+ export type { PendingCaptchaRequest } from "./provider/pendingCaptchaRequest.js";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,kBAAkB,CAAC;AACjC,YAAY,EAAE,qBAAqB,EAAE,MAAM,qCAAqC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { ApiParams } from "@prosopo/types";
2
+ import type { CompositeIpAddress } from "../types/index.js";
3
+ export interface PendingCaptchaRequest {
4
+ accountId: string;
5
+ pending: boolean;
6
+ salt: string;
7
+ [ApiParams.requestHash]: string;
8
+ deadlineTimestamp: number;
9
+ requestedAtTimestamp: Date;
10
+ ipAddress: CompositeIpAddress;
11
+ sessionId?: string;
12
+ threshold: number;
13
+ }
14
+ //# sourceMappingURL=pendingCaptchaRequest.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pendingCaptchaRequest.d.ts","sourceRoot":"","sources":["../../src/provider/pendingCaptchaRequest.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,WAAW,qBAAqB;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,oBAAoB,EAAE,IAAI,CAAC;IAC3B,SAAS,EAAE,kBAAkB,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CAClB"}
@@ -0,0 +1,2 @@
1
+ import { ApiParams } from "@prosopo/types";
2
+ //# sourceMappingURL=pendingCaptchaRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pendingCaptchaRequest.js","sourceRoot":"","sources":["../../src/provider/pendingCaptchaRequest.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { PoWCaptcha } from "@prosopo/types";
2
+ import { type RootFilterQuery, Schema } from "mongoose";
3
+ import type { IDatabase } from "./mongo.js";
4
+ import { type PoWCaptchaRecord, type SessionRecord, type UserCommitment, type UserCommitmentRecord } from "./provider.js";
5
+ export type StoredSession = SessionRecord;
6
+ export declare const StoredSessionRecordSchema: Schema;
7
+ export declare const StoredUserCommitmentRecordSchema: Schema;
8
+ export declare const StoredPoWCaptchaRecordSchema: Schema;
9
+ export interface ICaptchaDatabase extends IDatabase {
10
+ saveCaptchas(sessionEvents: StoredSession[], imageCaptchaEvents: UserCommitmentRecord[], powCaptchaEvents: PoWCaptchaRecord[]): Promise<void>;
11
+ getCaptchas(filter: RootFilterQuery<CaptchaProperties>, limit: number): Promise<{
12
+ userCommitmentRecords: UserCommitmentRecord[];
13
+ powCaptchaRecords: PoWCaptchaRecord[];
14
+ }>;
15
+ }
16
+ export interface CaptchaProperties extends Partial<UserCommitment & PoWCaptcha> {
17
+ }
18
+ //# sourceMappingURL=captcha.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"captcha.d.ts","sourceRoot":"","sources":["../../src/types/captcha.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACxD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EACN,KAAK,gBAAgB,EAErB,KAAK,aAAa,EAElB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EAEzB,MAAM,eAAe,CAAC;AAGvB,MAAM,MAAM,aAAa,GAAG,aAAa,CAAC;AAE1C,eAAO,MAAM,yBAAyB,EAAE,MAA4B,CAAC;AAErE,eAAO,MAAM,gCAAgC,EAAE,MAE7C,CAAC;AAGH,eAAO,MAAM,4BAA4B,EAAE,MAEzC,CAAC;AAGH,MAAM,WAAW,gBAAiB,SAAQ,SAAS;IAClD,YAAY,CACX,aAAa,EAAE,aAAa,EAAE,EAC9B,kBAAkB,EAAE,oBAAoB,EAAE,EAC1C,gBAAgB,EAAE,gBAAgB,EAAE,GAClC,OAAO,CAAC,IAAI,CAAC,CAAC;IACjB,WAAW,CACV,MAAM,EAAE,eAAe,CAAC,iBAAiB,CAAC,EAC1C,KAAK,EAAE,MAAM,GACX,OAAO,CAAC;QACV,qBAAqB,EAAE,oBAAoB,EAAE,CAAC;QAC9C,iBAAiB,EAAE,gBAAgB,EAAE,CAAC;KACtC,CAAC,CAAC;CACH;AAED,MAAM,WAAW,iBAChB,SAAQ,OAAO,CAAC,cAAc,GAAG,UAAU,CAAC;CAAG"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"captcha.js","sourceRoot":"","sources":["../../src/types/captcha.ts"],"names":[],"mappings":"AAeA,OAAO,EAAwB,MAAM,EAAE,MAAM,UAAU,CAAC;AAExD,OAAO,EAEN,sBAAsB,EAEtB,mBAAmB,EAGnB,0BAA0B,GAC1B,MAAM,eAAe,CAAC;AAKvB,MAAM,CAAC,MAAM,yBAAyB,GAAW,mBAAmB,CAAC;AAErE,MAAM,CAAC,MAAM,gCAAgC,GAAW,IAAI,MAAM,CAAC;IAClE,GAAG,0BAA0B,CAAC,GAAG;CACjC,CAAC,CAAC;AACH,gCAAgC,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC;AAEzD,MAAM,CAAC,MAAM,4BAA4B,GAAW,IAAI,MAAM,CAAC;IAC9D,GAAG,sBAAsB,CAAC,GAAG;CAC7B,CAAC,CAAC;AACH,4BAA4B,CAAC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC,CAAC"}
@@ -0,0 +1,271 @@
1
+ import { type IUserData, type IUserSettings, type Timestamp } from "@prosopo/types";
2
+ import mongoose from "mongoose";
3
+ import type { IDatabase } from "./mongo.js";
4
+ import type { ClientRecord, Tables } from "./provider.js";
5
+ export type UserDataRecord = mongoose.Document & IUserData;
6
+ export declare const IPValidationRulesSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, {
7
+ distanceThresholdKm: number;
8
+ abuseScoreThreshold: number;
9
+ requireAllConditions: boolean;
10
+ forceConsistentIp: boolean;
11
+ actions?: {
12
+ countryChangeAction: any;
13
+ cityChangeAction: any;
14
+ ispChangeAction: any;
15
+ distanceExceedAction: any;
16
+ abuseScoreExceedAction: any;
17
+ } | null | undefined;
18
+ countryOverrides?: Map<string, {
19
+ [x: string]: unknown;
20
+ } | {
21
+ actions?: {
22
+ countryChangeAction?: any;
23
+ cityChangeAction?: any;
24
+ ispChangeAction?: any;
25
+ distanceExceedAction?: any;
26
+ abuseScoreExceedAction?: any;
27
+ } | null | undefined;
28
+ distanceThresholdKm?: number | null | undefined;
29
+ abuseScoreThreshold?: number | null | undefined;
30
+ requireAllConditions?: boolean | null | undefined;
31
+ }> | null | undefined;
32
+ }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
33
+ distanceThresholdKm: number;
34
+ abuseScoreThreshold: number;
35
+ requireAllConditions: boolean;
36
+ forceConsistentIp: boolean;
37
+ actions?: {
38
+ countryChangeAction: any;
39
+ cityChangeAction: any;
40
+ ispChangeAction: any;
41
+ distanceExceedAction: any;
42
+ abuseScoreExceedAction: any;
43
+ } | null | undefined;
44
+ countryOverrides?: Map<string, {
45
+ [x: string]: unknown;
46
+ } | {
47
+ actions?: {
48
+ countryChangeAction?: any;
49
+ cityChangeAction?: any;
50
+ ispChangeAction?: any;
51
+ distanceExceedAction?: any;
52
+ abuseScoreExceedAction?: any;
53
+ } | null | undefined;
54
+ distanceThresholdKm?: number | null | undefined;
55
+ abuseScoreThreshold?: number | null | undefined;
56
+ requireAllConditions?: boolean | null | undefined;
57
+ }> | null | undefined;
58
+ }>> & mongoose.FlatRecord<{
59
+ distanceThresholdKm: number;
60
+ abuseScoreThreshold: number;
61
+ requireAllConditions: boolean;
62
+ forceConsistentIp: boolean;
63
+ actions?: {
64
+ countryChangeAction: any;
65
+ cityChangeAction: any;
66
+ ispChangeAction: any;
67
+ distanceExceedAction: any;
68
+ abuseScoreExceedAction: any;
69
+ } | null | undefined;
70
+ countryOverrides?: Map<string, {
71
+ [x: string]: unknown;
72
+ } | {
73
+ actions?: {
74
+ countryChangeAction?: any;
75
+ cityChangeAction?: any;
76
+ ispChangeAction?: any;
77
+ distanceExceedAction?: any;
78
+ abuseScoreExceedAction?: any;
79
+ } | null | undefined;
80
+ distanceThresholdKm?: number | null | undefined;
81
+ abuseScoreThreshold?: number | null | undefined;
82
+ requireAllConditions?: boolean | null | undefined;
83
+ }> | null | undefined;
84
+ }> & {
85
+ _id: mongoose.Types.ObjectId;
86
+ } & {
87
+ __v: number;
88
+ }>;
89
+ export declare const UserSettingsSchema: mongoose.Schema<any, mongoose.Model<any, any, any, any, any, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, {
90
+ domains: string[];
91
+ disallowWebView: boolean;
92
+ captchaType?: string | null | undefined;
93
+ frictionlessThreshold?: number | null | undefined;
94
+ powDifficulty?: number | null | undefined;
95
+ imageThreshold?: number | null | undefined;
96
+ ipValidationRules?: {
97
+ distanceThresholdKm: number;
98
+ abuseScoreThreshold: number;
99
+ requireAllConditions: boolean;
100
+ forceConsistentIp: boolean;
101
+ actions?: {
102
+ countryChangeAction: any;
103
+ cityChangeAction: any;
104
+ ispChangeAction: any;
105
+ distanceExceedAction: any;
106
+ abuseScoreExceedAction: any;
107
+ } | null | undefined;
108
+ countryOverrides?: Map<string, {
109
+ [x: string]: unknown;
110
+ } | {
111
+ actions?: {
112
+ countryChangeAction?: any;
113
+ cityChangeAction?: any;
114
+ ispChangeAction?: any;
115
+ distanceExceedAction?: any;
116
+ abuseScoreExceedAction?: any;
117
+ } | null | undefined;
118
+ distanceThresholdKm?: number | null | undefined;
119
+ abuseScoreThreshold?: number | null | undefined;
120
+ requireAllConditions?: boolean | null | undefined;
121
+ }> | null | undefined;
122
+ } | null | undefined;
123
+ contextAware?: {
124
+ enabled: boolean;
125
+ contexts: any;
126
+ } | null | undefined;
127
+ }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
128
+ domains: string[];
129
+ disallowWebView: boolean;
130
+ captchaType?: string | null | undefined;
131
+ frictionlessThreshold?: number | null | undefined;
132
+ powDifficulty?: number | null | undefined;
133
+ imageThreshold?: number | null | undefined;
134
+ ipValidationRules?: {
135
+ distanceThresholdKm: number;
136
+ abuseScoreThreshold: number;
137
+ requireAllConditions: boolean;
138
+ forceConsistentIp: boolean;
139
+ actions?: {
140
+ countryChangeAction: any;
141
+ cityChangeAction: any;
142
+ ispChangeAction: any;
143
+ distanceExceedAction: any;
144
+ abuseScoreExceedAction: any;
145
+ } | null | undefined;
146
+ countryOverrides?: Map<string, {
147
+ [x: string]: unknown;
148
+ } | {
149
+ actions?: {
150
+ countryChangeAction?: any;
151
+ cityChangeAction?: any;
152
+ ispChangeAction?: any;
153
+ distanceExceedAction?: any;
154
+ abuseScoreExceedAction?: any;
155
+ } | null | undefined;
156
+ distanceThresholdKm?: number | null | undefined;
157
+ abuseScoreThreshold?: number | null | undefined;
158
+ requireAllConditions?: boolean | null | undefined;
159
+ }> | null | undefined;
160
+ } | null | undefined;
161
+ contextAware?: {
162
+ enabled: boolean;
163
+ contexts: any;
164
+ } | null | undefined;
165
+ }>> & mongoose.FlatRecord<{
166
+ domains: string[];
167
+ disallowWebView: boolean;
168
+ captchaType?: string | null | undefined;
169
+ frictionlessThreshold?: number | null | undefined;
170
+ powDifficulty?: number | null | undefined;
171
+ imageThreshold?: number | null | undefined;
172
+ ipValidationRules?: {
173
+ distanceThresholdKm: number;
174
+ abuseScoreThreshold: number;
175
+ requireAllConditions: boolean;
176
+ forceConsistentIp: boolean;
177
+ actions?: {
178
+ countryChangeAction: any;
179
+ cityChangeAction: any;
180
+ ispChangeAction: any;
181
+ distanceExceedAction: any;
182
+ abuseScoreExceedAction: any;
183
+ } | null | undefined;
184
+ countryOverrides?: Map<string, {
185
+ [x: string]: unknown;
186
+ } | {
187
+ actions?: {
188
+ countryChangeAction?: any;
189
+ cityChangeAction?: any;
190
+ ispChangeAction?: any;
191
+ distanceExceedAction?: any;
192
+ abuseScoreExceedAction?: any;
193
+ } | null | undefined;
194
+ distanceThresholdKm?: number | null | undefined;
195
+ abuseScoreThreshold?: number | null | undefined;
196
+ requireAllConditions?: boolean | null | undefined;
197
+ }> | null | undefined;
198
+ } | null | undefined;
199
+ contextAware?: {
200
+ enabled: boolean;
201
+ contexts: any;
202
+ } | null | undefined;
203
+ }> & {
204
+ _id: mongoose.Types.ObjectId;
205
+ } & {
206
+ __v: number;
207
+ }>;
208
+ export declare const UserDataSchema: mongoose.Schema<UserDataRecord>;
209
+ type User = {
210
+ email: string;
211
+ name: string;
212
+ role: string;
213
+ createdAt: number;
214
+ updatedAt: number;
215
+ status: string;
216
+ };
217
+ type AccountRecord = mongoose.Document & {
218
+ createdAt: number;
219
+ updatedAt: number;
220
+ signupEmail: string;
221
+ tier: string;
222
+ tierRequestQuota: number;
223
+ marketingPreferences: boolean;
224
+ users: User[];
225
+ sites: {
226
+ name: string;
227
+ siteKey: string;
228
+ secretKey: string;
229
+ settings: IUserSettings;
230
+ createdAt: number;
231
+ updatedAt: number;
232
+ active: boolean;
233
+ }[];
234
+ deletedUsers: User[];
235
+ };
236
+ export declare const AccountSchema: mongoose.Schema<AccountRecord, mongoose.Model<AccountRecord, any, any, any, mongoose.Document<unknown, any, AccountRecord> & mongoose.Document<unknown, any, any> & {
237
+ createdAt: number;
238
+ updatedAt: number;
239
+ signupEmail: string;
240
+ tier: string;
241
+ tierRequestQuota: number;
242
+ marketingPreferences: boolean;
243
+ users: User[];
244
+ sites: {
245
+ name: string;
246
+ siteKey: string;
247
+ secretKey: string;
248
+ settings: IUserSettings;
249
+ createdAt: number;
250
+ updatedAt: number;
251
+ active: boolean;
252
+ }[];
253
+ deletedUsers: User[];
254
+ } & Required<{
255
+ _id: unknown;
256
+ }> & {
257
+ __v: number;
258
+ }, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, AccountRecord, mongoose.Document<unknown, {}, mongoose.FlatRecord<AccountRecord>> & mongoose.FlatRecord<AccountRecord> & Required<{
259
+ _id: unknown;
260
+ }> & {
261
+ __v: number;
262
+ }>;
263
+ export declare enum TableNames {
264
+ accounts = "accounts"
265
+ }
266
+ export interface IClientDatabase extends IDatabase {
267
+ getTables(): Tables<TableNames>;
268
+ getUpdatedClients(updatedAtTimestamp: Timestamp): Promise<ClientRecord[]>;
269
+ }
270
+ export {};
271
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"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AY,UAAU;IACrB,mCAAqB,CAAA;AACtB,CAAC,EAFW,UAAU,KAAV,UAAU,QAErB"}
@@ -0,0 +1,6 @@
1
+ export * from "./mongo.js";
2
+ export * from "./provider.js";
3
+ export * from "./client.js";
4
+ export * from "./captcha.js";
5
+ export * from "./userAgent.js";
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAaA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAaA,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
@@ -0,0 +1,13 @@
1
+ import type { Logger } from "@prosopo/common";
2
+ import type { Connection } from "mongoose";
3
+ export interface IDatabase {
4
+ url: string;
5
+ dbname: string;
6
+ connection?: Connection;
7
+ logger: Logger;
8
+ connected: boolean;
9
+ getConnection(): Connection;
10
+ connect(): Promise<void>;
11
+ close(): Promise<void>;
12
+ }
13
+ //# sourceMappingURL=mongo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongo.d.ts","sourceRoot":"","sources":["../../src/types/mongo.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAE3C,MAAM,WAAW,SAAS;IACzB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,UAAU,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,OAAO,CAAC;IAEnB,aAAa,IAAI,UAAU,CAAC;IAE5B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;IAEzB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CACvB"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mongo.js","sourceRoot":"","sources":["../../src/types/mongo.ts"],"names":[],"mappings":""}