@prosopo/types-database 3.3.13 → 4.0.0

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,32 @@
1
1
  # @prosopo/types-database
2
2
 
3
+ ## 4.0.0
4
+ ### Major Changes
5
+
6
+ - 8f22479: Update settings schema
7
+
8
+ ### Minor Changes
9
+
10
+ - bb5f41c: Context awareness
11
+
12
+ ### Patch Changes
13
+
14
+ - 55a64c6: stop refresh image to pow
15
+ - 8ce9205: Change engine requirements
16
+ - b6e98b2: Run npm audit
17
+ - 55a64c6: Persist sessions for user ip combinations
18
+ - Updated dependencies [8ce9205]
19
+ - Updated dependencies [15ae7cf]
20
+ - Updated dependencies [bb5f41c]
21
+ - Updated dependencies [8ce9205]
22
+ - Updated dependencies [df79c03]
23
+ - Updated dependencies [b6e98b2]
24
+ - @prosopo/user-access-policy@3.5.28
25
+ - @prosopo/types@3.6.0
26
+ - @prosopo/common@3.1.22
27
+ - @prosopo/locale@3.1.22
28
+ - @prosopo/config@3.1.22
29
+
3
30
  ## 3.3.13
4
31
  ### Patch Changes
5
32
 
@@ -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;
@@ -295,6 +295,7 @@ 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
301
  decryptedHeadHash: { type: String, required: false, default: "" }
@@ -302,6 +303,7 @@ const SessionRecordSchema = new mongoose.Schema({
302
303
  SessionRecordSchema.index({ createdAt: 1 });
303
304
  SessionRecordSchema.index({ deleted: 1 });
304
305
  SessionRecordSchema.index({ sessionId: 1 }, { unique: true });
306
+ SessionRecordSchema.index({ userSitekeyIpHash: 1 });
305
307
  SessionRecordSchema.index({ providerSelectEntropy: 1 });
306
308
  SessionRecordSchema.index({ token: 1 });
307
309
  const DetectorRecordSchema = new mongoose.Schema({
@@ -311,7 +313,15 @@ const DetectorRecordSchema = new mongoose.Schema({
311
313
  });
312
314
  DetectorRecordSchema.index({ createdAt: 1 }, { unique: true });
313
315
  DetectorRecordSchema.index({ expiresAt: 1 }, { expireAfterSeconds: 0 });
316
+ const ClientEntropyRecordSchema = new mongoose.Schema({
317
+ account: { type: String, required: true, unique: true },
318
+ entropy: { type: String, required: true },
319
+ createdAt: { type: Date, required: true },
320
+ updatedAt: { type: Date, required: true }
321
+ });
322
+ ClientEntropyRecordSchema.index({ account: 1 }, { unique: true });
314
323
  exports.CaptchaRecordSchema = CaptchaRecordSchema;
324
+ exports.ClientEntropyRecordSchema = ClientEntropyRecordSchema;
315
325
  exports.ClientRecordSchema = ClientRecordSchema;
316
326
  exports.CompositeIpAddressRecordSchemaObj = CompositeIpAddressRecordSchemaObj;
317
327
  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,
@@ -293,6 +293,7 @@ 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
299
  decryptedHeadHash: { type: String, required: false, default: "" }
@@ -300,6 +301,7 @@ const SessionRecordSchema = new Schema({
300
301
  SessionRecordSchema.index({ createdAt: 1 });
301
302
  SessionRecordSchema.index({ deleted: 1 });
302
303
  SessionRecordSchema.index({ sessionId: 1 }, { unique: true });
304
+ SessionRecordSchema.index({ userSitekeyIpHash: 1 });
303
305
  SessionRecordSchema.index({ providerSelectEntropy: 1 });
304
306
  SessionRecordSchema.index({ token: 1 });
305
307
  const DetectorRecordSchema = new Schema({
@@ -309,8 +311,16 @@ const DetectorRecordSchema = new Schema({
309
311
  });
310
312
  DetectorRecordSchema.index({ createdAt: 1 }, { unique: true });
311
313
  DetectorRecordSchema.index({ expiresAt: 1 }, { expireAfterSeconds: 0 });
314
+ const ClientEntropyRecordSchema = new Schema({
315
+ account: { type: String, required: true, unique: true },
316
+ entropy: { type: String, required: true },
317
+ createdAt: { type: Date, required: true },
318
+ updatedAt: { type: Date, required: true }
319
+ });
320
+ ClientEntropyRecordSchema.index({ account: 1 }, { unique: true });
312
321
  export {
313
322
  CaptchaRecordSchema,
323
+ ClientEntropyRecordSchema,
314
324
  ClientRecordSchema,
315
325
  CompositeIpAddressRecordSchemaObj,
316
326
  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.0",
4
4
  "description": "Types for prosopo database",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -34,11 +34,11 @@
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.22",
38
+ "@prosopo/locale": "3.1.22",
39
+ "@prosopo/types": "3.6.0",
40
+ "@prosopo/user-access-policy": "3.5.28",
41
+ "@prosopo/config": "3.1.22",
42
42
  "mongoose": "8.13.0",
43
43
  "zod": "3.23.8"
44
44
  },
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
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/types/client.ts"],"names":[],"mappings":"AAcA,OAAO,EACN,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,SAAS,EASd,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AAErC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE1D,MAAM,MAAM,cAAc,GAAG,Q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AM;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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mongo.js","sourceRoot":"","sources":["../../src/types/mongo.ts"],"names":[],"mappings":""}