@prosopo/types-database 0.1.18 → 0.1.19
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/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +15 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/mongo.d.ts +410 -0
- package/dist/types/mongo.d.ts.map +1 -0
- package/dist/types/mongo.js +140 -0
- package/dist/types/mongo.js.map +1 -0
- package/package.json +3 -3
package/dist/index.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,cAAc,kBAAkB,CAAA"}
|
package/dist/index.js
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
// Copyright 2021-2023 Prosopo (UK) Ltd.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
export * from './types/index.js';
|
15
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,cAAc,kBAAkB,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAaA,cAAc,YAAY,CAAA"}
|
@@ -0,0 +1,15 @@
|
|
1
|
+
// Copyright 2021-2023 Prosopo (UK) Ltd.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
export * from './mongo.js';
|
15
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,cAAc,YAAY,CAAA"}
|
@@ -0,0 +1,410 @@
|
|
1
|
+
/// <reference types="mongoose/types/aggregate.js" />
|
2
|
+
/// <reference types="mongoose/types/callback.js" />
|
3
|
+
/// <reference types="mongoose/types/collection.js" />
|
4
|
+
/// <reference types="mongoose/types/connection.js" />
|
5
|
+
/// <reference types="mongoose/types/cursor.js" />
|
6
|
+
/// <reference types="mongoose/types/document.js" />
|
7
|
+
/// <reference types="mongoose/types/error.js" />
|
8
|
+
/// <reference types="mongoose/types/expressions.js" />
|
9
|
+
/// <reference types="mongoose/types/helpers.js" />
|
10
|
+
/// <reference types="mongoose/types/middlewares.js" />
|
11
|
+
/// <reference types="mongoose/types/indexes.js" />
|
12
|
+
/// <reference types="mongoose/types/models.js" />
|
13
|
+
/// <reference types="mongoose/types/mongooseoptions.js" />
|
14
|
+
/// <reference types="mongoose/types/pipelinestage.js" />
|
15
|
+
/// <reference types="mongoose/types/populate.js" />
|
16
|
+
/// <reference types="mongoose/types/query.js" />
|
17
|
+
/// <reference types="mongoose/types/schemaoptions.js" />
|
18
|
+
/// <reference types="mongoose/types/schematypes.js" />
|
19
|
+
/// <reference types="mongoose/types/session.js" />
|
20
|
+
/// <reference types="mongoose/types/types.js" />
|
21
|
+
/// <reference types="mongoose/types/utility.js" />
|
22
|
+
/// <reference types="mongoose/types/validation.js" />
|
23
|
+
/// <reference types="mongoose/types/virtuals.js" />
|
24
|
+
/// <reference types="mongoose/types/inferschematype.js" />
|
25
|
+
import { ArgumentTypes } from '@prosopo/types';
|
26
|
+
import { Captcha, CaptchaSolution, CaptchaStates, Dataset, DatasetBase, DatasetWithIds } from '@prosopo/types';
|
27
|
+
import { Connection, Model, Schema } from 'mongoose';
|
28
|
+
import { DeleteResult } from 'mongodb';
|
29
|
+
import { Logger } from '@prosopo/common';
|
30
|
+
import { PendingCaptchaRequest } from '@prosopo/types';
|
31
|
+
import { ScheduledTaskNames, ScheduledTaskResult, ScheduledTaskStatus } from '@prosopo/types';
|
32
|
+
import { z } from 'zod';
|
33
|
+
export interface UserCommitmentRecord extends Omit<ArgumentTypes.Commit, 'userSignaturePart1' | 'userSignaturePart2'> {
|
34
|
+
userSignature: number[];
|
35
|
+
processed: boolean;
|
36
|
+
batched: boolean;
|
37
|
+
}
|
38
|
+
export declare const UserCommitmentSchema: z.ZodObject<{
|
39
|
+
userAccount: z.ZodString;
|
40
|
+
dappContract: z.ZodString;
|
41
|
+
datasetId: z.ZodString;
|
42
|
+
providerAccount: z.ZodString;
|
43
|
+
id: z.ZodString;
|
44
|
+
status: z.ZodNativeEnum<typeof ArgumentTypes.CaptchaStatus>;
|
45
|
+
userSignature: z.ZodArray<z.ZodNumber, "many">;
|
46
|
+
completedAt: z.ZodNumber;
|
47
|
+
requestedAt: z.ZodNumber;
|
48
|
+
processed: z.ZodBoolean;
|
49
|
+
batched: z.ZodBoolean;
|
50
|
+
}, "strip", z.ZodTypeAny, {
|
51
|
+
id: string;
|
52
|
+
userAccount: string;
|
53
|
+
datasetId: string;
|
54
|
+
status: ArgumentTypes.CaptchaStatus;
|
55
|
+
dappContract: string;
|
56
|
+
providerAccount: string;
|
57
|
+
requestedAt: number;
|
58
|
+
completedAt: number;
|
59
|
+
userSignature: number[];
|
60
|
+
processed: boolean;
|
61
|
+
batched: boolean;
|
62
|
+
}, {
|
63
|
+
id: string;
|
64
|
+
userAccount: string;
|
65
|
+
datasetId: string;
|
66
|
+
status: ArgumentTypes.CaptchaStatus;
|
67
|
+
dappContract: string;
|
68
|
+
providerAccount: string;
|
69
|
+
requestedAt: number;
|
70
|
+
completedAt: number;
|
71
|
+
userSignature: number[];
|
72
|
+
processed: boolean;
|
73
|
+
batched: boolean;
|
74
|
+
}>;
|
75
|
+
export interface SolutionRecord extends CaptchaSolution {
|
76
|
+
datasetId: string;
|
77
|
+
datasetContentId: string;
|
78
|
+
}
|
79
|
+
export interface Tables {
|
80
|
+
captcha: typeof Model<Captcha>;
|
81
|
+
dataset: typeof Model<DatasetWithIds>;
|
82
|
+
solution: typeof Model<SolutionRecord>;
|
83
|
+
usersolution: typeof Model<UserSolutionRecord>;
|
84
|
+
commitment: typeof Model<UserCommitmentRecord>;
|
85
|
+
pending: typeof Model<PendingCaptchaRequest>;
|
86
|
+
scheduler: typeof Model<ScheduledTaskRecord>;
|
87
|
+
}
|
88
|
+
export declare const CaptchaRecordSchema: Schema<Captcha, Model<Captcha, any, any, any, import("mongoose").Document<unknown, any, Captcha> & Captcha & {
|
89
|
+
_id: import("mongoose").Types.ObjectId;
|
90
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, Captcha, import("mongoose").Document<unknown, {}, Captcha> & Captcha & {
|
91
|
+
_id: import("mongoose").Types.ObjectId;
|
92
|
+
}>;
|
93
|
+
export declare const UserCommitmentRecordSchema: Schema<UserCommitmentRecord, Model<UserCommitmentRecord, any, any, any, import("mongoose").Document<unknown, any, UserCommitmentRecord> & UserCommitmentRecord & {
|
94
|
+
_id: import("mongoose").Types.ObjectId;
|
95
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, UserCommitmentRecord, import("mongoose").Document<unknown, {}, UserCommitmentRecord> & UserCommitmentRecord & {
|
96
|
+
_id: import("mongoose").Types.ObjectId;
|
97
|
+
}>;
|
98
|
+
export declare const DatasetRecordSchema: Schema<DatasetWithIds, Model<DatasetWithIds, any, any, any, import("mongoose").Document<unknown, any, DatasetWithIds> & DatasetWithIds & {
|
99
|
+
_id: import("mongoose").Types.ObjectId;
|
100
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, DatasetWithIds, import("mongoose").Document<unknown, {}, DatasetWithIds> & DatasetWithIds & {
|
101
|
+
_id: import("mongoose").Types.ObjectId;
|
102
|
+
}>;
|
103
|
+
export declare const SolutionRecordSchema: Schema<SolutionRecord, Model<SolutionRecord, any, any, any, import("mongoose").Document<unknown, any, SolutionRecord> & SolutionRecord & {
|
104
|
+
_id: import("mongoose").Types.ObjectId;
|
105
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, SolutionRecord, import("mongoose").Document<unknown, {}, SolutionRecord> & SolutionRecord & {
|
106
|
+
_id: import("mongoose").Types.ObjectId;
|
107
|
+
}>;
|
108
|
+
export declare const UserSolutionSchema: z.ZodObject<{
|
109
|
+
captchaId: z.ZodString;
|
110
|
+
captchaContentId: z.ZodString;
|
111
|
+
solution: z.ZodArray<z.ZodString, "many">;
|
112
|
+
salt: z.ZodString;
|
113
|
+
processed: z.ZodBoolean;
|
114
|
+
commitmentId: z.ZodString;
|
115
|
+
}, "strip", z.ZodTypeAny, {
|
116
|
+
processed: boolean;
|
117
|
+
commitmentId: string;
|
118
|
+
captchaId: string;
|
119
|
+
captchaContentId: string;
|
120
|
+
solution: string[];
|
121
|
+
salt: string;
|
122
|
+
}, {
|
123
|
+
processed: boolean;
|
124
|
+
commitmentId: string;
|
125
|
+
captchaId: string;
|
126
|
+
captchaContentId: string;
|
127
|
+
solution: string[];
|
128
|
+
salt: string;
|
129
|
+
}>;
|
130
|
+
export type UserSolutionRecord = z.infer<typeof UserSolutionSchema>;
|
131
|
+
export declare const UserSolutionRecordSchema: Schema<{
|
132
|
+
processed: boolean;
|
133
|
+
commitmentId: string;
|
134
|
+
captchaId: string;
|
135
|
+
captchaContentId: string;
|
136
|
+
solution: string[];
|
137
|
+
salt: string;
|
138
|
+
}, Model<{
|
139
|
+
processed: boolean;
|
140
|
+
commitmentId: string;
|
141
|
+
captchaId: string;
|
142
|
+
captchaContentId: string;
|
143
|
+
solution: string[];
|
144
|
+
salt: string;
|
145
|
+
}, any, any, any, import("mongoose").Document<unknown, any, {
|
146
|
+
processed: boolean;
|
147
|
+
commitmentId: string;
|
148
|
+
captchaId: string;
|
149
|
+
captchaContentId: string;
|
150
|
+
solution: string[];
|
151
|
+
salt: string;
|
152
|
+
}> & {
|
153
|
+
processed: boolean;
|
154
|
+
commitmentId: string;
|
155
|
+
captchaId: string;
|
156
|
+
captchaContentId: string;
|
157
|
+
solution: string[];
|
158
|
+
salt: string;
|
159
|
+
} & {
|
160
|
+
_id: import("mongoose").Types.ObjectId;
|
161
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
162
|
+
processed: boolean;
|
163
|
+
commitmentId: string;
|
164
|
+
captchaId: string;
|
165
|
+
captchaContentId: string;
|
166
|
+
solution: string[];
|
167
|
+
salt: string;
|
168
|
+
}, import("mongoose").Document<unknown, {}, {
|
169
|
+
processed: boolean;
|
170
|
+
commitmentId: string;
|
171
|
+
captchaId: string;
|
172
|
+
captchaContentId: string;
|
173
|
+
solution: string[];
|
174
|
+
salt: string;
|
175
|
+
}> & {
|
176
|
+
processed: boolean;
|
177
|
+
commitmentId: string;
|
178
|
+
captchaId: string;
|
179
|
+
captchaContentId: string;
|
180
|
+
solution: string[];
|
181
|
+
salt: string;
|
182
|
+
} & {
|
183
|
+
_id: import("mongoose").Types.ObjectId;
|
184
|
+
}>;
|
185
|
+
export declare const UserCommitmentWithSolutionsSchema: z.ZodObject<{
|
186
|
+
id: z.ZodString;
|
187
|
+
userAccount: z.ZodString;
|
188
|
+
datasetId: z.ZodString;
|
189
|
+
status: z.ZodNativeEnum<typeof ArgumentTypes.CaptchaStatus>;
|
190
|
+
dappContract: z.ZodString;
|
191
|
+
providerAccount: z.ZodString;
|
192
|
+
requestedAt: z.ZodNumber;
|
193
|
+
completedAt: z.ZodNumber;
|
194
|
+
userSignature: z.ZodArray<z.ZodNumber, "many">;
|
195
|
+
processed: z.ZodBoolean;
|
196
|
+
batched: z.ZodBoolean;
|
197
|
+
captchas: z.ZodArray<z.ZodObject<{
|
198
|
+
captchaId: z.ZodString;
|
199
|
+
captchaContentId: z.ZodString;
|
200
|
+
solution: z.ZodArray<z.ZodString, "many">;
|
201
|
+
salt: z.ZodString;
|
202
|
+
processed: z.ZodBoolean;
|
203
|
+
commitmentId: z.ZodString;
|
204
|
+
}, "strip", z.ZodTypeAny, {
|
205
|
+
processed: boolean;
|
206
|
+
commitmentId: string;
|
207
|
+
captchaId: string;
|
208
|
+
captchaContentId: string;
|
209
|
+
solution: string[];
|
210
|
+
salt: string;
|
211
|
+
}, {
|
212
|
+
processed: boolean;
|
213
|
+
commitmentId: string;
|
214
|
+
captchaId: string;
|
215
|
+
captchaContentId: string;
|
216
|
+
solution: string[];
|
217
|
+
salt: string;
|
218
|
+
}>, "many">;
|
219
|
+
}, "strip", z.ZodTypeAny, {
|
220
|
+
id: string;
|
221
|
+
userAccount: string;
|
222
|
+
datasetId: string;
|
223
|
+
status: ArgumentTypes.CaptchaStatus;
|
224
|
+
dappContract: string;
|
225
|
+
providerAccount: string;
|
226
|
+
requestedAt: number;
|
227
|
+
completedAt: number;
|
228
|
+
userSignature: number[];
|
229
|
+
processed: boolean;
|
230
|
+
batched: boolean;
|
231
|
+
captchas: {
|
232
|
+
processed: boolean;
|
233
|
+
commitmentId: string;
|
234
|
+
captchaId: string;
|
235
|
+
captchaContentId: string;
|
236
|
+
solution: string[];
|
237
|
+
salt: string;
|
238
|
+
}[];
|
239
|
+
}, {
|
240
|
+
id: string;
|
241
|
+
userAccount: string;
|
242
|
+
datasetId: string;
|
243
|
+
status: ArgumentTypes.CaptchaStatus;
|
244
|
+
dappContract: string;
|
245
|
+
providerAccount: string;
|
246
|
+
requestedAt: number;
|
247
|
+
completedAt: number;
|
248
|
+
userSignature: number[];
|
249
|
+
processed: boolean;
|
250
|
+
batched: boolean;
|
251
|
+
captchas: {
|
252
|
+
processed: boolean;
|
253
|
+
commitmentId: string;
|
254
|
+
captchaId: string;
|
255
|
+
captchaContentId: string;
|
256
|
+
solution: string[];
|
257
|
+
salt: string;
|
258
|
+
}[];
|
259
|
+
}>;
|
260
|
+
export type UserCommitmentWithSolutions = z.infer<typeof UserCommitmentWithSolutionsSchema>;
|
261
|
+
export declare const PendingRecordSchema: Schema<PendingCaptchaRequest, Model<PendingCaptchaRequest, any, any, any, import("mongoose").Document<unknown, any, PendingCaptchaRequest> & PendingCaptchaRequest & {
|
262
|
+
_id: import("mongoose").Types.ObjectId;
|
263
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, PendingCaptchaRequest, import("mongoose").Document<unknown, {}, PendingCaptchaRequest> & PendingCaptchaRequest & {
|
264
|
+
_id: import("mongoose").Types.ObjectId;
|
265
|
+
}>;
|
266
|
+
export declare const ScheduledTaskSchema: z.ZodObject<{
|
267
|
+
taskId: z.ZodString;
|
268
|
+
processName: z.ZodNativeEnum<typeof ScheduledTaskNames>;
|
269
|
+
datetime: z.ZodDate;
|
270
|
+
status: z.ZodNativeEnum<typeof ScheduledTaskStatus>;
|
271
|
+
result: z.ZodOptional<z.ZodObject<{
|
272
|
+
data: z.ZodOptional<z.ZodAny>;
|
273
|
+
error: z.ZodOptional<z.ZodAny>;
|
274
|
+
}, "strip", z.ZodTypeAny, {
|
275
|
+
data?: any;
|
276
|
+
error?: any;
|
277
|
+
}, {
|
278
|
+
data?: any;
|
279
|
+
error?: any;
|
280
|
+
}>>;
|
281
|
+
}, "strip", z.ZodTypeAny, {
|
282
|
+
status: ScheduledTaskStatus;
|
283
|
+
taskId: string;
|
284
|
+
processName: ScheduledTaskNames;
|
285
|
+
datetime: Date;
|
286
|
+
result?: {
|
287
|
+
data?: any;
|
288
|
+
error?: any;
|
289
|
+
} | undefined;
|
290
|
+
}, {
|
291
|
+
status: ScheduledTaskStatus;
|
292
|
+
taskId: string;
|
293
|
+
processName: ScheduledTaskNames;
|
294
|
+
datetime: Date;
|
295
|
+
result?: {
|
296
|
+
data?: any;
|
297
|
+
error?: any;
|
298
|
+
} | undefined;
|
299
|
+
}>;
|
300
|
+
export type ScheduledTaskRecord = z.infer<typeof ScheduledTaskSchema>;
|
301
|
+
export declare const ScheduledTaskRecordSchema: Schema<{
|
302
|
+
status: ScheduledTaskStatus;
|
303
|
+
taskId: string;
|
304
|
+
processName: ScheduledTaskNames;
|
305
|
+
datetime: Date;
|
306
|
+
result?: {
|
307
|
+
data?: any;
|
308
|
+
error?: any;
|
309
|
+
} | undefined;
|
310
|
+
}, Model<{
|
311
|
+
status: ScheduledTaskStatus;
|
312
|
+
taskId: string;
|
313
|
+
processName: ScheduledTaskNames;
|
314
|
+
datetime: Date;
|
315
|
+
result?: {
|
316
|
+
data?: any;
|
317
|
+
error?: any;
|
318
|
+
} | undefined;
|
319
|
+
}, any, any, any, import("mongoose").Document<unknown, any, {
|
320
|
+
status: ScheduledTaskStatus;
|
321
|
+
taskId: string;
|
322
|
+
processName: ScheduledTaskNames;
|
323
|
+
datetime: Date;
|
324
|
+
result?: {
|
325
|
+
data?: any;
|
326
|
+
error?: any;
|
327
|
+
} | undefined;
|
328
|
+
}> & {
|
329
|
+
status: ScheduledTaskStatus;
|
330
|
+
taskId: string;
|
331
|
+
processName: ScheduledTaskNames;
|
332
|
+
datetime: Date;
|
333
|
+
result?: {
|
334
|
+
data?: any;
|
335
|
+
error?: any;
|
336
|
+
} | undefined;
|
337
|
+
} & {
|
338
|
+
_id: import("mongoose").Types.ObjectId;
|
339
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
340
|
+
status: ScheduledTaskStatus;
|
341
|
+
taskId: string;
|
342
|
+
processName: ScheduledTaskNames;
|
343
|
+
datetime: Date;
|
344
|
+
result?: {
|
345
|
+
data?: any;
|
346
|
+
error?: any;
|
347
|
+
} | undefined;
|
348
|
+
}, import("mongoose").Document<unknown, {}, {
|
349
|
+
status: ScheduledTaskStatus;
|
350
|
+
taskId: string;
|
351
|
+
processName: ScheduledTaskNames;
|
352
|
+
datetime: Date;
|
353
|
+
result?: {
|
354
|
+
data?: any;
|
355
|
+
error?: any;
|
356
|
+
} | undefined;
|
357
|
+
}> & {
|
358
|
+
status: ScheduledTaskStatus;
|
359
|
+
taskId: string;
|
360
|
+
processName: ScheduledTaskNames;
|
361
|
+
datetime: Date;
|
362
|
+
result?: {
|
363
|
+
data?: any;
|
364
|
+
error?: any;
|
365
|
+
} | undefined;
|
366
|
+
} & {
|
367
|
+
_id: import("mongoose").Types.ObjectId;
|
368
|
+
}>;
|
369
|
+
export interface Database {
|
370
|
+
url: string;
|
371
|
+
tables?: Tables;
|
372
|
+
dbname: string;
|
373
|
+
connection?: Connection;
|
374
|
+
logger: Logger;
|
375
|
+
connect(): Promise<void>;
|
376
|
+
close(): Promise<void>;
|
377
|
+
storeDataset(dataset: Dataset): Promise<void>;
|
378
|
+
getDataset(datasetId: string): Promise<DatasetWithIds>;
|
379
|
+
getRandomCaptcha(solved: boolean, datasetId: ArgumentTypes.Hash | string, size?: number): Promise<Captcha[] | undefined>;
|
380
|
+
getCaptchaById(captchaId: string[]): Promise<Captcha[] | undefined>;
|
381
|
+
updateCaptcha(captcha: Captcha, datasetId: string): Promise<void>;
|
382
|
+
removeCaptchas(captchaIds: string[]): Promise<void>;
|
383
|
+
getDatasetDetails(datasetId: ArgumentTypes.Hash | string | Uint8Array): Promise<DatasetBase>;
|
384
|
+
storeDappUserSolution(captchas: CaptchaSolution[], commit: UserCommitmentRecord): Promise<void>;
|
385
|
+
storeDappUserPending(userAccount: string, requestHash: string, salt: string, deadlineTimestamp: number, requestedAtBlock: number): Promise<void>;
|
386
|
+
getDappUserPending(requestHash: string): Promise<PendingCaptchaRequest>;
|
387
|
+
updateDappUserPendingStatus(userAccount: string, requestHash: string, approve: boolean): Promise<void>;
|
388
|
+
getAllCaptchasByDatasetId(datasetId: string, captchaState?: CaptchaStates): Promise<Captcha[] | undefined>;
|
389
|
+
getAllDappUserSolutions(captchaId: string[]): Promise<UserSolutionRecord[] | undefined>;
|
390
|
+
getDatasetIdWithSolvedCaptchasOfSizeN(solvedCaptchaCount: number): Promise<string>;
|
391
|
+
getRandomSolvedCaptchasFromSingleDataset(datasetId: string, size: number): Promise<CaptchaSolution[]>;
|
392
|
+
getDappUserSolutionById(commitmentId: string): Promise<UserSolutionRecord | undefined>;
|
393
|
+
getDappUserCommitmentById(commitmentId: string): Promise<UserCommitmentRecord | undefined>;
|
394
|
+
getDappUserCommitmentByAccount(accountId: string): Promise<UserCommitmentRecord[]>;
|
395
|
+
approveDappUserCommitment(commitmentId: string): Promise<void>;
|
396
|
+
removeProcessedDappUserSolutions(commitmentIds: ArgumentTypes.Hash[]): Promise<DeleteResult | undefined>;
|
397
|
+
removeProcessedDappUserCommitments(commitmentIds: ArgumentTypes.Hash[]): Promise<DeleteResult | undefined>;
|
398
|
+
getProcessedDappUserSolutions(): Promise<UserSolutionRecord[]>;
|
399
|
+
getProcessedDappUserCommitments(): Promise<UserCommitmentRecord[]>;
|
400
|
+
getUnbatchedDappUserCommitments(): Promise<UserCommitmentRecord[]>;
|
401
|
+
getBatchedDappUserCommitments(): Promise<UserCommitmentRecord[]>;
|
402
|
+
flagProcessedDappUserSolutions(captchaIds: ArgumentTypes.Hash[]): Promise<void>;
|
403
|
+
flagProcessedDappUserCommitments(commitmentIds: ArgumentTypes.Hash[]): Promise<void>;
|
404
|
+
flagBatchedDappUserCommitments(commitmentIds: ArgumentTypes.Hash[]): Promise<void>;
|
405
|
+
getLastBatchCommitTime(): Promise<Date>;
|
406
|
+
getLastScheduledTaskStatus(task: ScheduledTaskNames, status?: ScheduledTaskStatus): Promise<ScheduledTaskRecord | undefined>;
|
407
|
+
getScheduledTaskStatus(taskId: string, status: ScheduledTaskStatus): Promise<ScheduledTaskRecord | undefined>;
|
408
|
+
storeScheduledTaskStatus(taskId: `0x${string}`, task: ScheduledTaskNames, status: ScheduledTaskStatus, result?: ScheduledTaskResult): Promise<void>;
|
409
|
+
}
|
410
|
+
//# sourceMappingURL=mongo.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"mongo.d.ts","sourceRoot":"","sources":["../../src/types/mongo.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAaA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EACH,OAAO,EACP,eAAe,EAEf,aAAa,EACb,OAAO,EACP,WAAW,EACX,cAAc,EAEjB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAA;AACtD,OAAO,EAAE,kBAAkB,E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CAAC,EAAE,mBAAmB,GAC7B,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAAA;IAE3C,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,GAAG,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAAC,CAAA;IAE7G,wBAAwB,CACpB,MAAM,EAAE,KAAK,MAAM,EAAE,EACrB,IAAI,EAAE,kBAAkB,EACxB,MAAM,EAAE,mBAAmB,EAC3B,MAAM,CAAC,EAAE,mBAAmB,GAC7B,OAAO,CAAC,IAAI,CAAC,CAAA;CACnB"}
|
@@ -0,0 +1,140 @@
|
|
1
|
+
// Copyright 2021-2023 Prosopo (UK) Ltd.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
import { ArgumentTypes } from '@prosopo/types';
|
15
|
+
import { CaptchaSolutionSchema, } from '@prosopo/types';
|
16
|
+
import { Schema } from 'mongoose';
|
17
|
+
import { ScheduledTaskNames, ScheduledTaskStatus } from '@prosopo/types';
|
18
|
+
import { z } from 'zod';
|
19
|
+
export const UserCommitmentSchema = z.object({
|
20
|
+
userAccount: z.string(),
|
21
|
+
dappContract: z.string(),
|
22
|
+
datasetId: z.string(),
|
23
|
+
providerAccount: z.string(),
|
24
|
+
id: z.string(),
|
25
|
+
status: z.nativeEnum(ArgumentTypes.CaptchaStatus),
|
26
|
+
userSignature: z.array(z.number()),
|
27
|
+
completedAt: z.number(),
|
28
|
+
requestedAt: z.number(),
|
29
|
+
processed: z.boolean(),
|
30
|
+
batched: z.boolean(),
|
31
|
+
});
|
32
|
+
export const CaptchaRecordSchema = new Schema({
|
33
|
+
captchaId: { type: String, required: true },
|
34
|
+
captchaContentId: { type: String, required: true },
|
35
|
+
assetURI: { type: String, required: false },
|
36
|
+
datasetId: { type: String, required: true },
|
37
|
+
datasetContentId: { type: String, required: true },
|
38
|
+
solved: { type: Boolean, required: true },
|
39
|
+
target: { type: String, required: true },
|
40
|
+
salt: { type: String, required: true },
|
41
|
+
items: {
|
42
|
+
type: [
|
43
|
+
new Schema({
|
44
|
+
hash: { type: String, required: true },
|
45
|
+
data: { type: String, required: true },
|
46
|
+
type: { type: String, required: true },
|
47
|
+
}, { _id: false }),
|
48
|
+
],
|
49
|
+
required: true,
|
50
|
+
},
|
51
|
+
});
|
52
|
+
// Set an index on the captchaId field, ascending
|
53
|
+
CaptchaRecordSchema.index({ captchaId: 1 });
|
54
|
+
export const UserCommitmentRecordSchema = new Schema({
|
55
|
+
userAccount: { type: String, required: true },
|
56
|
+
dappContract: { type: String, required: true },
|
57
|
+
providerAccount: { type: String, required: true },
|
58
|
+
datasetId: { type: String, required: true },
|
59
|
+
id: { type: String, required: true },
|
60
|
+
status: { type: String, required: true },
|
61
|
+
requestedAt: { type: Number, required: true },
|
62
|
+
completedAt: { type: Number, required: true },
|
63
|
+
userSignature: { type: [Number], required: true },
|
64
|
+
processed: { type: Boolean, required: true },
|
65
|
+
batched: { type: Boolean, required: true },
|
66
|
+
});
|
67
|
+
// Set an index on the commitment id field, descending
|
68
|
+
UserCommitmentRecordSchema.index({ id: -1 });
|
69
|
+
export const DatasetRecordSchema = new Schema({
|
70
|
+
contentTree: { type: [[String]], required: true },
|
71
|
+
datasetContentId: { type: String, required: true },
|
72
|
+
datasetId: { type: String, required: true },
|
73
|
+
format: { type: String, required: true },
|
74
|
+
solutionTree: { type: [[String]], required: true },
|
75
|
+
});
|
76
|
+
// Set an index on the datasetId field, ascending
|
77
|
+
DatasetRecordSchema.index({ datasetId: 1 });
|
78
|
+
export const SolutionRecordSchema = new Schema({
|
79
|
+
captchaId: { type: String, required: true },
|
80
|
+
captchaContentId: { type: String, required: true },
|
81
|
+
datasetId: { type: String, required: true },
|
82
|
+
datasetContentId: { type: String, required: true },
|
83
|
+
salt: { type: String, required: true },
|
84
|
+
solution: { type: [String], required: true },
|
85
|
+
});
|
86
|
+
// Set an index on the captchaId field, ascending
|
87
|
+
SolutionRecordSchema.index({ captchaId: 1 });
|
88
|
+
export const UserSolutionSchema = CaptchaSolutionSchema.extend({
|
89
|
+
processed: z.boolean(),
|
90
|
+
commitmentId: z.string(),
|
91
|
+
});
|
92
|
+
export const UserSolutionRecordSchema = new Schema({
|
93
|
+
captchaId: { type: String, required: true },
|
94
|
+
captchaContentId: { type: String, required: true },
|
95
|
+
salt: { type: String, required: true },
|
96
|
+
solution: [{ type: String, required: true }],
|
97
|
+
processed: { type: Boolean, required: true },
|
98
|
+
commitmentId: { type: String, required: true },
|
99
|
+
}, { _id: false });
|
100
|
+
// Set an index on the captchaId field, ascending
|
101
|
+
UserSolutionRecordSchema.index({ captchaId: 1 });
|
102
|
+
export const UserCommitmentWithSolutionsSchema = UserCommitmentSchema.extend({
|
103
|
+
captchas: z.array(UserSolutionSchema),
|
104
|
+
});
|
105
|
+
export const PendingRecordSchema = new Schema({
|
106
|
+
accountId: { type: String, required: true },
|
107
|
+
pending: { type: Boolean, required: true },
|
108
|
+
salt: { type: String, required: true },
|
109
|
+
requestHash: { type: String, required: true },
|
110
|
+
deadlineTimestamp: { type: Number, required: true },
|
111
|
+
requestedAtBlock: { type: Number, required: true },
|
112
|
+
});
|
113
|
+
// Set an index on the requestHash field, descending
|
114
|
+
PendingRecordSchema.index({ requestHash: -1 });
|
115
|
+
export const ScheduledTaskSchema = z.object({
|
116
|
+
taskId: z.string(),
|
117
|
+
processName: z.nativeEnum(ScheduledTaskNames),
|
118
|
+
datetime: z.date(),
|
119
|
+
status: z.nativeEnum(ScheduledTaskStatus),
|
120
|
+
result: z
|
121
|
+
.object({
|
122
|
+
data: z.any().optional(),
|
123
|
+
error: z.any().optional(),
|
124
|
+
})
|
125
|
+
.optional(),
|
126
|
+
});
|
127
|
+
export const ScheduledTaskRecordSchema = new Schema({
|
128
|
+
taskId: { type: String, required: true },
|
129
|
+
processName: { type: String, enum: ScheduledTaskNames, required: true },
|
130
|
+
datetime: { type: Date, required: true },
|
131
|
+
status: { type: String, enum: ScheduledTaskStatus, require: true },
|
132
|
+
result: {
|
133
|
+
type: new Schema({
|
134
|
+
error: { type: String, required: false },
|
135
|
+
data: { type: Object, required: false },
|
136
|
+
}, { _id: false }),
|
137
|
+
required: false,
|
138
|
+
},
|
139
|
+
});
|
140
|
+
//# sourceMappingURL=mongo.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"mongo.js","sourceRoot":"","sources":["../../src/types/mongo.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,EAAE;AACF,kEAAkE;AAClE,mEAAmE;AACnE,0CAA0C;AAC1C,EAAE;AACF,iDAAiD;AACjD,EAAE;AACF,sEAAsE;AACtE,oEAAoE;AACpE,2EAA2E;AAC3E,sEAAsE;AACtE,iCAAiC;AACjC,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAGH,qBAAqB,GAMxB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAqB,MAAM,EAAE,MAAM,UAAU,CAAA;AAIpD,OAAO,EAAE,kBAAkB,EAAuB,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAC7F,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAQvB,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE;IACvB,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE;IACxB,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE;IACrB,eAAe,E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AE,mBAAmB,EAAE,OAAO,EAAE,IAAI,EAAE;IAClE,MAAM,EAAE;QACJ,IAAI,EAAE,IAAI,MAAM,CACZ;YACI,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE;YACxC,IAAI,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE;SAC1C,EACD,EAAE,GAAG,EAAE,KAAK,EAAE,CACjB;QAED,QAAQ,EAAE,KAAK;KAClB;CACJ,CAAC,CAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@prosopo/types-database",
|
3
|
-
"version": "0.1.
|
3
|
+
"version": "0.1.19",
|
4
4
|
"description": "Types for prosopo database",
|
5
5
|
"main": "dist/index.js",
|
6
6
|
"type": "module",
|
@@ -22,8 +22,8 @@
|
|
22
22
|
"homepage": "https://github.com/prosopo/captcha#readme",
|
23
23
|
"dependencies": {
|
24
24
|
"@polkadot/types": "10.9.1",
|
25
|
-
"@prosopo/common": "^0.1.
|
26
|
-
"@prosopo/types": "^0.1.
|
25
|
+
"@prosopo/common": "^0.1.19",
|
26
|
+
"@prosopo/types": "^0.1.19",
|
27
27
|
"mongodb": "5.8.0",
|
28
28
|
"mongoose": "^7.3.3",
|
29
29
|
"zod": "^3.17.9"
|