@prosopo/types-database 3.3.13 → 4.0.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,75 @@
1
1
  # @prosopo/types-database
2
2
 
3
+ ## 4.0.5
4
+ ### Patch Changes
5
+
6
+ - 93d92a7: little bump for publish all
7
+ - Updated dependencies [93d92a7]
8
+ - @prosopo/common@3.1.25
9
+ - @prosopo/locale@3.1.25
10
+ - @prosopo/types@3.6.3
11
+ - @prosopo/user-access-policy@3.5.31
12
+
13
+ ## 4.0.4
14
+ ### Patch Changes
15
+
16
+ - 8ee8434: bump node engines to 24 and npm version to 11
17
+ - cfee479: make @prosopo/config a dev dep
18
+ - Updated dependencies [8ee8434]
19
+ - Updated dependencies [cfee479]
20
+ - @prosopo/user-access-policy@3.5.30
21
+ - @prosopo/common@3.1.24
22
+ - @prosopo/locale@3.1.24
23
+ - @prosopo/types@3.6.2
24
+
25
+ ## 4.0.3
26
+ ### Patch Changes
27
+
28
+ - e926831: mega mini bump for all to trigger publish all
29
+ - Updated dependencies [e926831]
30
+ - @prosopo/config@3.1.23
31
+ - @prosopo/common@3.1.23
32
+ - @prosopo/locale@3.1.23
33
+ - @prosopo/types@3.6.1
34
+ - @prosopo/user-access-policy@3.5.29
35
+
36
+ ## 4.0.2
37
+ ### Patch Changes
38
+
39
+ - 0a9887c: Remove unique from token index
40
+
41
+ ## 4.0.1
42
+ ### Patch Changes
43
+
44
+ - 3e5d80a: add reason field
45
+
46
+ ## 4.0.0
47
+ ### Major Changes
48
+
49
+ - 8f22479: Update settings schema
50
+
51
+ ### Minor Changes
52
+
53
+ - bb5f41c: Context awareness
54
+
55
+ ### Patch Changes
56
+
57
+ - 55a64c6: stop refresh image to pow
58
+ - 8ce9205: Change engine requirements
59
+ - b6e98b2: Run npm audit
60
+ - 55a64c6: Persist sessions for user ip combinations
61
+ - Updated dependencies [8ce9205]
62
+ - Updated dependencies [15ae7cf]
63
+ - Updated dependencies [bb5f41c]
64
+ - Updated dependencies [8ce9205]
65
+ - Updated dependencies [df79c03]
66
+ - Updated dependencies [b6e98b2]
67
+ - @prosopo/user-access-policy@3.5.28
68
+ - @prosopo/types@3.6.0
69
+ - @prosopo/common@3.1.22
70
+ - @prosopo/locale@3.1.22
71
+ - @prosopo/config@3.1.22
72
+
3
73
  ## 3.3.13
4
74
  ### Patch Changes
5
75
 
@@ -5,6 +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.ClientEntropyRecordSchema = provider.ClientEntropyRecordSchema;
8
9
  exports.ClientRecordSchema = provider.ClientRecordSchema;
9
10
  exports.CompositeIpAddressRecordSchemaObj = provider.CompositeIpAddressRecordSchemaObj;
10
11
  exports.CompositeIpAddressSchema = provider.CompositeIpAddressSchema;
@@ -70,6 +70,10 @@ const UserSettingsSchema = new mongoose.Schema({
70
70
  disallowWebView: {
71
71
  type: Boolean,
72
72
  default: false
73
+ },
74
+ contextAware: {
75
+ enabled: { type: Boolean, default: false },
76
+ threshold: { type: Number, default: types.contextAwareThresholdDefault }
73
77
  }
74
78
  });
75
79
  const UserDataSchema = new mongoose.Schema({
@@ -6,6 +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.ClientEntropyRecordSchema = provider.ClientEntropyRecordSchema;
9
10
  exports.ClientRecordSchema = provider.ClientRecordSchema;
10
11
  exports.CompositeIpAddressRecordSchemaObj = provider.CompositeIpAddressRecordSchemaObj;
11
12
  exports.CompositeIpAddressSchema = provider.CompositeIpAddressSchema;
@@ -276,7 +276,7 @@ ScheduledTaskRecordSchema.index({ _id: 1, status: 1 });
276
276
  const SessionRecordSchema = new mongoose.Schema({
277
277
  sessionId: { type: String, required: true },
278
278
  createdAt: { type: Date, required: true },
279
- token: { type: String, required: true, unique: true },
279
+ token: { type: String, required: true },
280
280
  score: { type: Number, required: true },
281
281
  threshold: { type: Number, required: true },
282
282
  scoreComponents: {
@@ -295,13 +295,16 @@ const SessionRecordSchema = new mongoose.Schema({
295
295
  storedAtTimestamp: { type: Date, required: false, expires: ONE_DAY },
296
296
  lastUpdatedTimestamp: { type: Date, required: false },
297
297
  deleted: { type: Boolean, required: false },
298
+ userSitekeyIpHash: { type: String, required: false },
298
299
  webView: { type: Boolean, required: true, default: false },
299
300
  iFrame: { type: Boolean, required: true, default: false },
300
- decryptedHeadHash: { type: String, required: false, default: "" }
301
+ decryptedHeadHash: { type: String, required: false, default: "" },
302
+ reason: { type: String, required: false }
301
303
  });
302
304
  SessionRecordSchema.index({ createdAt: 1 });
303
305
  SessionRecordSchema.index({ deleted: 1 });
304
306
  SessionRecordSchema.index({ sessionId: 1 }, { unique: true });
307
+ SessionRecordSchema.index({ userSitekeyIpHash: 1 });
305
308
  SessionRecordSchema.index({ providerSelectEntropy: 1 });
306
309
  SessionRecordSchema.index({ token: 1 });
307
310
  const DetectorRecordSchema = new mongoose.Schema({
@@ -311,7 +314,15 @@ const DetectorRecordSchema = new mongoose.Schema({
311
314
  });
312
315
  DetectorRecordSchema.index({ createdAt: 1 }, { unique: true });
313
316
  DetectorRecordSchema.index({ expiresAt: 1 }, { expireAfterSeconds: 0 });
317
+ const ClientEntropyRecordSchema = new mongoose.Schema({
318
+ account: { type: String, required: true, unique: true },
319
+ entropy: { type: String, required: true },
320
+ createdAt: { type: Date, required: true },
321
+ updatedAt: { type: Date, required: true }
322
+ });
323
+ ClientEntropyRecordSchema.index({ account: 1 }, { unique: true });
314
324
  exports.CaptchaRecordSchema = CaptchaRecordSchema;
325
+ exports.ClientEntropyRecordSchema = ClientEntropyRecordSchema;
315
326
  exports.ClientRecordSchema = ClientRecordSchema;
316
327
  exports.CompositeIpAddressRecordSchemaObj = CompositeIpAddressRecordSchemaObj;
317
328
  exports.CompositeIpAddressSchema = CompositeIpAddressSchema;
package/dist/index.js CHANGED
@@ -1,10 +1,11 @@
1
1
  import "./types/index.js";
2
- import { CaptchaRecordSchema, ClientRecordSchema, CompositeIpAddressRecordSchemaObj, CompositeIpAddressSchema, DatasetRecordSchema, DetectorRecordSchema, IpAddressType, PendingRecordSchema, PoWCaptchaRecordSchema, ScheduledTaskRecordSchema, ScheduledTaskSchema, SessionRecordSchema, SolutionRecordSchema, UserCommitmentRecordSchema, UserCommitmentSchema, UserCommitmentWithSolutionsSchema, UserSolutionRecordSchema, UserSolutionSchema, parseMongooseCompositeIpAddress } from "./types/provider.js";
2
+ import { CaptchaRecordSchema, ClientEntropyRecordSchema, 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
+ ClientEntropyRecordSchema,
8
9
  ClientRecordSchema,
9
10
  CompositeIpAddressRecordSchemaObj,
10
11
  CompositeIpAddressSchema,
@@ -1,4 +1,4 @@
1
- import { requireAllConditionsDefault, abuseScoreThresholdDefault, distanceThresholdKmDefault, abuseScoreThresholdExceedActionDefault, distanceExceedActionDefault, ispChangeActionDefault, cityChangeActionDefault, countryChangeActionDefault } from "@prosopo/types";
1
+ import { requireAllConditionsDefault, abuseScoreThresholdDefault, distanceThresholdKmDefault, abuseScoreThresholdExceedActionDefault, distanceExceedActionDefault, ispChangeActionDefault, cityChangeActionDefault, countryChangeActionDefault, contextAwareThresholdDefault } from "@prosopo/types";
2
2
  import { Schema } from "mongoose";
3
3
  const IPValidationRulesSchema = new Schema({
4
4
  actions: {
@@ -68,6 +68,10 @@ const UserSettingsSchema = new Schema({
68
68
  disallowWebView: {
69
69
  type: Boolean,
70
70
  default: false
71
+ },
72
+ contextAware: {
73
+ enabled: { type: Boolean, default: false },
74
+ threshold: { type: Number, default: contextAwareThresholdDefault }
71
75
  }
72
76
  });
73
77
  const UserDataSchema = new Schema({
@@ -1,11 +1,12 @@
1
1
  import "./mongo.js";
2
- import { CaptchaRecordSchema, ClientRecordSchema, CompositeIpAddressRecordSchemaObj, CompositeIpAddressSchema, DatasetRecordSchema, DetectorRecordSchema, IpAddressType, PendingRecordSchema, PoWCaptchaRecordSchema, ScheduledTaskRecordSchema, ScheduledTaskSchema, SessionRecordSchema, SolutionRecordSchema, UserCommitmentRecordSchema, UserCommitmentSchema, UserCommitmentWithSolutionsSchema, UserSolutionRecordSchema, UserSolutionSchema, parseMongooseCompositeIpAddress } from "./provider.js";
2
+ import { CaptchaRecordSchema, ClientEntropyRecordSchema, 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
+ ClientEntropyRecordSchema,
9
10
  ClientRecordSchema,
10
11
  CompositeIpAddressRecordSchemaObj,
11
12
  CompositeIpAddressSchema,
@@ -274,7 +274,7 @@ ScheduledTaskRecordSchema.index({ _id: 1, status: 1 });
274
274
  const SessionRecordSchema = new Schema({
275
275
  sessionId: { type: String, required: true },
276
276
  createdAt: { type: Date, required: true },
277
- token: { type: String, required: true, unique: true },
277
+ token: { type: String, required: true },
278
278
  score: { type: Number, required: true },
279
279
  threshold: { type: Number, required: true },
280
280
  scoreComponents: {
@@ -293,13 +293,16 @@ const SessionRecordSchema = new Schema({
293
293
  storedAtTimestamp: { type: Date, required: false, expires: ONE_DAY },
294
294
  lastUpdatedTimestamp: { type: Date, required: false },
295
295
  deleted: { type: Boolean, required: false },
296
+ userSitekeyIpHash: { type: String, required: false },
296
297
  webView: { type: Boolean, required: true, default: false },
297
298
  iFrame: { type: Boolean, required: true, default: false },
298
- decryptedHeadHash: { type: String, required: false, default: "" }
299
+ decryptedHeadHash: { type: String, required: false, default: "" },
300
+ reason: { type: String, required: false }
299
301
  });
300
302
  SessionRecordSchema.index({ createdAt: 1 });
301
303
  SessionRecordSchema.index({ deleted: 1 });
302
304
  SessionRecordSchema.index({ sessionId: 1 }, { unique: true });
305
+ SessionRecordSchema.index({ userSitekeyIpHash: 1 });
303
306
  SessionRecordSchema.index({ providerSelectEntropy: 1 });
304
307
  SessionRecordSchema.index({ token: 1 });
305
308
  const DetectorRecordSchema = new Schema({
@@ -309,8 +312,16 @@ const DetectorRecordSchema = new Schema({
309
312
  });
310
313
  DetectorRecordSchema.index({ createdAt: 1 }, { unique: true });
311
314
  DetectorRecordSchema.index({ expiresAt: 1 }, { expireAfterSeconds: 0 });
315
+ const ClientEntropyRecordSchema = new Schema({
316
+ account: { type: String, required: true, unique: true },
317
+ entropy: { type: String, required: true },
318
+ createdAt: { type: Date, required: true },
319
+ updatedAt: { type: Date, required: true }
320
+ });
321
+ ClientEntropyRecordSchema.index({ account: 1 }, { unique: true });
312
322
  export {
313
323
  CaptchaRecordSchema,
324
+ ClientEntropyRecordSchema,
314
325
  ClientRecordSchema,
315
326
  CompositeIpAddressRecordSchemaObj,
316
327
  CompositeIpAddressSchema,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prosopo/types-database",
3
- "version": "3.3.13",
3
+ "version": "4.0.5",
4
4
  "description": "Types for prosopo database",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -13,8 +13,8 @@
13
13
  }
14
14
  },
15
15
  "engines": {
16
- "node": ">=v20.0.0",
17
- "npm": ">=10.6.0"
16
+ "node": "^24",
17
+ "npm": "^11"
18
18
  },
19
19
  "scripts": {
20
20
  "clean": "del-cli --verbose dist tsconfig.tsbuildinfo",
@@ -34,15 +34,15 @@
34
34
  },
35
35
  "homepage": "https://github.com/prosopo/captcha#readme",
36
36
  "dependencies": {
37
- "@prosopo/common": "3.1.21",
38
- "@prosopo/locale": "3.1.21",
39
- "@prosopo/types": "3.5.11",
40
- "@prosopo/user-access-policy": "3.5.27",
41
- "@prosopo/config": "3.1.21",
37
+ "@prosopo/common": "3.1.25",
38
+ "@prosopo/locale": "3.1.25",
39
+ "@prosopo/types": "3.6.3",
40
+ "@prosopo/user-access-policy": "3.5.31",
42
41
  "mongoose": "8.13.0",
43
42
  "zod": "3.23.8"
44
43
  },
45
44
  "devDependencies": {
45
+ "@prosopo/config": "3.1.25",
46
46
  "@types/node": "22.10.2",
47
47
  "@vitest/coverage-v8": "3.2.4",
48
48
  "concurrently": "9.0.1",
package/dist/index.d.ts DELETED
@@ -1,3 +0,0 @@
1
- export * from "./types/index.js";
2
- export type { PendingCaptchaRequest } from "./provider/pendingCaptchaRequest.js";
3
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
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"}
package/dist/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,kBAAkB,CAAC"}
@@ -1,14 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1,2 +0,0 @@
1
- import { ApiParams } from "@prosopo/types";
2
- //# sourceMappingURL=pendingCaptchaRequest.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pendingCaptchaRequest.js","sourceRoot":"","sources":["../../src/provider/pendingCaptchaRequest.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC"}
@@ -1,18 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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"}
@@ -1,259 +0,0 @@
1
- import { type IUserData, type IUserSettings, type Timestamp } from "@prosopo/types";
2
- import type 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
- }, mongoose.Document<unknown, {}, mongoose.FlatRecord<{
124
- domains: string[];
125
- disallowWebView: boolean;
126
- captchaType?: string | null | undefined;
127
- frictionlessThreshold?: number | null | undefined;
128
- powDifficulty?: number | null | undefined;
129
- imageThreshold?: number | null | undefined;
130
- ipValidationRules?: {
131
- distanceThresholdKm: number;
132
- abuseScoreThreshold: number;
133
- requireAllConditions: boolean;
134
- forceConsistentIp: boolean;
135
- actions?: {
136
- countryChangeAction: any;
137
- cityChangeAction: any;
138
- ispChangeAction: any;
139
- distanceExceedAction: any;
140
- abuseScoreExceedAction: any;
141
- } | null | undefined;
142
- countryOverrides?: Map<string, {
143
- [x: string]: unknown;
144
- } | {
145
- actions?: {
146
- countryChangeAction?: any;
147
- cityChangeAction?: any;
148
- ispChangeAction?: any;
149
- distanceExceedAction?: any;
150
- abuseScoreExceedAction?: any;
151
- } | null | undefined;
152
- distanceThresholdKm?: number | null | undefined;
153
- abuseScoreThreshold?: number | null | undefined;
154
- requireAllConditions?: boolean | null | undefined;
155
- }> | null | undefined;
156
- } | null | undefined;
157
- }>> & mongoose.FlatRecord<{
158
- domains: string[];
159
- disallowWebView: boolean;
160
- captchaType?: string | null | undefined;
161
- frictionlessThreshold?: number | null | undefined;
162
- powDifficulty?: number | null | undefined;
163
- imageThreshold?: number | null | undefined;
164
- ipValidationRules?: {
165
- distanceThresholdKm: number;
166
- abuseScoreThreshold: number;
167
- requireAllConditions: boolean;
168
- forceConsistentIp: boolean;
169
- actions?: {
170
- countryChangeAction: any;
171
- cityChangeAction: any;
172
- ispChangeAction: any;
173
- distanceExceedAction: any;
174
- abuseScoreExceedAction: any;
175
- } | null | undefined;
176
- countryOverrides?: Map<string, {
177
- [x: string]: unknown;
178
- } | {
179
- actions?: {
180
- countryChangeAction?: any;
181
- cityChangeAction?: any;
182
- ispChangeAction?: any;
183
- distanceExceedAction?: any;
184
- abuseScoreExceedAction?: any;
185
- } | null | undefined;
186
- distanceThresholdKm?: number | null | undefined;
187
- abuseScoreThreshold?: number | null | undefined;
188
- requireAllConditions?: boolean | null | undefined;
189
- }> | null | undefined;
190
- } | null | undefined;
191
- }> & {
192
- _id: mongoose.Types.ObjectId;
193
- } & {
194
- __v: number;
195
- }>;
196
- export declare const UserDataSchema: mongoose.Schema<UserDataRecord>;
197
- type User = {
198
- email: string;
199
- name: string;
200
- role: string;
201
- createdAt: number;
202
- updatedAt: number;
203
- status: string;
204
- };
205
- type AccountRecord = mongoose.Document & {
206
- createdAt: number;
207
- updatedAt: number;
208
- signupEmail: string;
209
- tier: string;
210
- tierRequestQuota: number;
211
- marketingPreferences: boolean;
212
- users: User[];
213
- sites: {
214
- name: string;
215
- siteKey: string;
216
- secretKey: string;
217
- settings: IUserSettings;
218
- createdAt: number;
219
- updatedAt: number;
220
- active: boolean;
221
- }[];
222
- deletedUsers: User[];
223
- };
224
- export declare const AccountSchema: mongoose.Schema<AccountRecord, mongoose.Model<AccountRecord, any, any, any, mongoose.Document<unknown, any, AccountRecord> & mongoose.Document<unknown, any, any> & {
225
- createdAt: number;
226
- updatedAt: number;
227
- signupEmail: string;
228
- tier: string;
229
- tierRequestQuota: number;
230
- marketingPreferences: boolean;
231
- users: User[];
232
- sites: {
233
- name: string;
234
- siteKey: string;
235
- secretKey: string;
236
- settings: IUserSettings;
237
- createdAt: number;
238
- updatedAt: number;
239
- active: boolean;
240
- }[];
241
- deletedUsers: User[];
242
- } & Required<{
243
- _id: unknown;
244
- }> & {
245
- __v: number;
246
- }, any>, {}, {}, {}, {}, mongoose.DefaultSchemaOptions, AccountRecord, mongoose.Document<unknown, {}, mongoose.FlatRecord<AccountRecord>> & mongoose.FlatRecord<AccountRecord> & Required<{
247
- _id: unknown;
248
- }> & {
249
- __v: number;
250
- }>;
251
- export declare enum TableNames {
252
- accounts = "accounts"
253
- }
254
- export interface IClientDatabase extends IDatabase {
255
- getTables(): Tables<TableNames>;
256
- getUpdatedClients(updatedAtTimestamp: Timestamp): Promise<ClientRecord[]>;
257
- }
258
- export {};
259
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {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,MAAM;IACjB,SAAS,EAAE,MAAM;IACjB,WAAW,EAAE,MAAM;IACnB,IAAI,EAAE,MAAM;IACZ,gBAAgB,EAAE,MAAM;IACxB,oBAAoB,EAAE,OAAO;IAC7B,KAAK,EAAE;QACN;YACC,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,MAAM;YACZ,SAAS,EAAE,MAAM;YACjB,SAAS,EAAE,MAAM;YACjB,MAAM,EAAE,MAAM;SACd;KACD;IACD,KAAK,EAAE;QACN;YACC,IAAI,EAAE,MAAM;YACZ,OAAO,EAAE,MAAM;YACf,SAAS,EAAE,MAAM;YACjB,QAAQ,EAAE;gBACT,OAAO,EAAE,CAAC,MAAM,CAAC;gBACjB,aAAa,EAAE,MAAM;gBACrB,WAAW,EAAE,MAAM;gBACnB,qBAAqB,EAAE,MAAM;gBAC7B,iBAAiB,EAAE,uBAAuB;aAC1C;YACD,SAAS,EAAE,MAAM;YACjB,SAAS,EAAE,MAAM;YACjB,MAAM,EAAE,OAAO;SACf;KACD;IACD,YAAY,EAAE,EAAE;CAChB,CAAC,CAAC;AAEH,MAAM,CAAN,IAAY,UAEX;AAFD,WAAY,UAAU;IACrB,mCAAqB,CAAA;AACtB,CAAC,EAFW,UAAU,KAAV,UAAU,QAErB"}
@@ -1,6 +0,0 @@
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
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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"}
@@ -1,13 +0,0 @@
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
@@ -1 +0,0 @@
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"}