@riocrypto/common-server 1.0.2854 → 1.0.2857
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/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/models/compliance-report-slack-thread.d.ts +18 -0
- package/build/models/compliance-report-slack-thread.js +45 -0
- package/build/models/compliance-session.d.ts +3 -1
- package/build/models/compliance-session.js +15 -0
- package/package.json +3 -3
package/build/index.d.ts
CHANGED
|
@@ -101,6 +101,7 @@ export * from "./models/axe-slack-thread";
|
|
|
101
101
|
export * from "./models/axe-telegram-thread";
|
|
102
102
|
export * from "./models/auth-activity-slack-thread";
|
|
103
103
|
export * from "./models/onboarding-review-slack-thread";
|
|
104
|
+
export * from "./models/compliance-report-slack-thread";
|
|
104
105
|
export * from "./models/twap-slack-thread";
|
|
105
106
|
export * from "./models/twap-session";
|
|
106
107
|
export * from "./models/bulk-bank-payout";
|
package/build/index.js
CHANGED
|
@@ -117,6 +117,7 @@ __exportStar(require("./models/axe-slack-thread"), exports);
|
|
|
117
117
|
__exportStar(require("./models/axe-telegram-thread"), exports);
|
|
118
118
|
__exportStar(require("./models/auth-activity-slack-thread"), exports);
|
|
119
119
|
__exportStar(require("./models/onboarding-review-slack-thread"), exports);
|
|
120
|
+
__exportStar(require("./models/compliance-report-slack-thread"), exports);
|
|
120
121
|
__exportStar(require("./models/twap-slack-thread"), exports);
|
|
121
122
|
__exportStar(require("./models/twap-session"), exports);
|
|
122
123
|
__exportStar(require("./models/bulk-bank-payout"), exports);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import mongoose, { HydratedDocument } from "mongoose";
|
|
2
|
+
interface ComplianceReportSlackThreadAttrs {
|
|
3
|
+
createdAt: Date;
|
|
4
|
+
userId: string;
|
|
5
|
+
messageTs: string;
|
|
6
|
+
channel: string;
|
|
7
|
+
}
|
|
8
|
+
interface ComplianceReportSlackThreadDoc extends mongoose.Document {
|
|
9
|
+
createdAt: Date;
|
|
10
|
+
userId: string;
|
|
11
|
+
messageTs: string;
|
|
12
|
+
channel: string;
|
|
13
|
+
}
|
|
14
|
+
interface ComplianceReportSlackThreadModel extends mongoose.Model<ComplianceReportSlackThreadDoc> {
|
|
15
|
+
build(attrs: ComplianceReportSlackThreadAttrs): HydratedDocument<ComplianceReportSlackThreadDoc>;
|
|
16
|
+
}
|
|
17
|
+
declare const buildComplianceReportSlackThread: (mongoose: typeof mongoose) => ComplianceReportSlackThreadModel;
|
|
18
|
+
export { buildComplianceReportSlackThread, ComplianceReportSlackThreadDoc, ComplianceReportSlackThreadAttrs, };
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildComplianceReportSlackThread = void 0;
|
|
4
|
+
const buildComplianceReportSlackThread = (mongoose) => {
|
|
5
|
+
// if model is already defined, return it
|
|
6
|
+
if (mongoose.models.ComplianceReportSlackThread) {
|
|
7
|
+
return mongoose.model("ComplianceReportSlackThread");
|
|
8
|
+
}
|
|
9
|
+
const ComplianceReportSlackThreadSchema = new mongoose.Schema({
|
|
10
|
+
createdAt: {
|
|
11
|
+
type: mongoose.Schema.Types.Date,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
userId: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
// Root message of the per-user report thread. Every compliance report
|
|
19
|
+
// for this user is appended as a reply here, so this is created once
|
|
20
|
+
// and reused for the lifetime of the user (never reset).
|
|
21
|
+
messageTs: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
channel: {
|
|
26
|
+
type: String,
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
}, {
|
|
30
|
+
toJSON: {
|
|
31
|
+
transform(doc, ret) {
|
|
32
|
+
ret.id = ret._id;
|
|
33
|
+
delete ret._id;
|
|
34
|
+
delete ret.__v;
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
ComplianceReportSlackThreadSchema.index({ userId: 1 }, { unique: true });
|
|
39
|
+
ComplianceReportSlackThreadSchema.statics.build = (attrs) => {
|
|
40
|
+
return new ComplianceReportSlackThread(attrs);
|
|
41
|
+
};
|
|
42
|
+
const ComplianceReportSlackThread = mongoose.model("ComplianceReportSlackThread", ComplianceReportSlackThreadSchema);
|
|
43
|
+
return ComplianceReportSlackThread;
|
|
44
|
+
};
|
|
45
|
+
exports.buildComplianceReportSlackThread = buildComplianceReportSlackThread;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import mongoose, { HydratedDocument } from "mongoose";
|
|
2
|
-
import { ComplianceSessionStatus } from "@riocrypto/common";
|
|
2
|
+
import { ComplianceFailedDocument, ComplianceSessionStatus } from "@riocrypto/common";
|
|
3
3
|
interface ComplianceSessionAttrs {
|
|
4
4
|
id: string;
|
|
5
5
|
userId: string;
|
|
@@ -13,6 +13,7 @@ interface ComplianceSessionAttrs {
|
|
|
13
13
|
startedByName?: string;
|
|
14
14
|
ruleSetId?: string;
|
|
15
15
|
ruleSetName?: string;
|
|
16
|
+
failedDocuments?: ComplianceFailedDocument[];
|
|
16
17
|
}
|
|
17
18
|
interface ComplianceSessionDoc extends mongoose.Document {
|
|
18
19
|
id: string;
|
|
@@ -27,6 +28,7 @@ interface ComplianceSessionDoc extends mongoose.Document {
|
|
|
27
28
|
startedByName?: string;
|
|
28
29
|
ruleSetId?: string;
|
|
29
30
|
ruleSetName?: string;
|
|
31
|
+
failedDocuments?: ComplianceFailedDocument[];
|
|
30
32
|
}
|
|
31
33
|
interface ComplianceSessionModel extends mongoose.Model<ComplianceSessionDoc> {
|
|
32
34
|
build(attrs: ComplianceSessionAttrs): HydratedDocument<ComplianceSessionDoc>;
|
|
@@ -59,6 +59,21 @@ const buildComplianceSession = (mongoose) => {
|
|
|
59
59
|
type: String,
|
|
60
60
|
required: false,
|
|
61
61
|
},
|
|
62
|
+
// Documents that could not be OCR'd / parsed during
|
|
63
|
+
// pre-processing (e.g. password-protected PDFs). Optional so
|
|
64
|
+
// older session documents still load. Defaults to an empty
|
|
65
|
+
// array so consumers can treat it as always-present.
|
|
66
|
+
failedDocuments: {
|
|
67
|
+
type: [
|
|
68
|
+
{
|
|
69
|
+
_id: false,
|
|
70
|
+
fileName: { type: String, required: true },
|
|
71
|
+
reason: { type: String, required: true },
|
|
72
|
+
},
|
|
73
|
+
],
|
|
74
|
+
required: false,
|
|
75
|
+
default: [],
|
|
76
|
+
},
|
|
62
77
|
}, {
|
|
63
78
|
toJSON: {
|
|
64
79
|
transform(doc, ret) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2857",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@google-cloud/secret-manager": "^5.6.0",
|
|
29
29
|
"@google-cloud/storage": "^7.19.0",
|
|
30
|
-
"@hyperdx/node-opentelemetry": "^0.
|
|
31
|
-
"@riocrypto/common": "1.0.
|
|
30
|
+
"@hyperdx/node-opentelemetry": "^0.11.0",
|
|
31
|
+
"@riocrypto/common": "1.0.2656",
|
|
32
32
|
"@slack/web-api": "^7.15.0",
|
|
33
33
|
"@types/express": "^4.17.25",
|
|
34
34
|
"axios": "1.16.0",
|