@riocrypto/common-server 1.0.2695 → 1.0.2696
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 +4 -0
- package/build/index.js +4 -0
- package/build/models/compliance-bot-chat.d.ts +23 -0
- package/build/models/compliance-bot-chat.js +50 -0
- package/build/models/compliance-bot-rule-result.d.ts +28 -0
- package/build/models/compliance-bot-rule-result.js +57 -0
- package/build/models/compliance-bot-rule.d.ts +19 -0
- package/build/models/compliance-bot-rule.js +41 -0
- package/build/models/compliance-session.d.ts +27 -0
- package/build/models/compliance-session.js +58 -0
- package/package.json +2 -2
package/build/index.d.ts
CHANGED
|
@@ -111,6 +111,10 @@ export * from "./models/approved-alternative-bank-account-holder-name";
|
|
|
111
111
|
export * from "./models/liquidity-sourcing-plan";
|
|
112
112
|
export * from "./models/liquidity-sourcing-exclusion";
|
|
113
113
|
export * from "./models/liquidity-sourcing-settings";
|
|
114
|
+
export * from "./models/compliance-session";
|
|
115
|
+
export * from "./models/compliance-bot-chat";
|
|
116
|
+
export * from "./models/compliance-bot-rule";
|
|
117
|
+
export * from "./models/compliance-bot-rule-result";
|
|
114
118
|
export * from "./clients/axios-with-logging";
|
|
115
119
|
export * from "./clients/slack-client";
|
|
116
120
|
export * from "./clients/fireblocks-client";
|
package/build/index.js
CHANGED
|
@@ -127,6 +127,10 @@ __exportStar(require("./models/approved-alternative-bank-account-holder-name"),
|
|
|
127
127
|
__exportStar(require("./models/liquidity-sourcing-plan"), exports);
|
|
128
128
|
__exportStar(require("./models/liquidity-sourcing-exclusion"), exports);
|
|
129
129
|
__exportStar(require("./models/liquidity-sourcing-settings"), exports);
|
|
130
|
+
__exportStar(require("./models/compliance-session"), exports);
|
|
131
|
+
__exportStar(require("./models/compliance-bot-chat"), exports);
|
|
132
|
+
__exportStar(require("./models/compliance-bot-rule"), exports);
|
|
133
|
+
__exportStar(require("./models/compliance-bot-rule-result"), exports);
|
|
130
134
|
__exportStar(require("./clients/axios-with-logging"), exports);
|
|
131
135
|
__exportStar(require("./clients/slack-client"), exports);
|
|
132
136
|
__exportStar(require("./clients/fireblocks-client"), exports);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
interface ComplianceChatHistoryAttrs {
|
|
3
|
+
sessionId: string;
|
|
4
|
+
sequenceNumber: number;
|
|
5
|
+
createdAt: Date;
|
|
6
|
+
text: string;
|
|
7
|
+
isBot: boolean;
|
|
8
|
+
blobId: number;
|
|
9
|
+
}
|
|
10
|
+
interface ComplianceChatHistoryDoc extends mongoose.Document {
|
|
11
|
+
id: string;
|
|
12
|
+
sessionId: string;
|
|
13
|
+
sequenceNumber: number;
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
text: string;
|
|
16
|
+
isBot: boolean;
|
|
17
|
+
blobId: number;
|
|
18
|
+
}
|
|
19
|
+
interface ComplianceChatHistoryModel extends mongoose.Model<ComplianceChatHistoryDoc> {
|
|
20
|
+
build(attrs: ComplianceChatHistoryAttrs): ComplianceChatHistoryDoc;
|
|
21
|
+
}
|
|
22
|
+
declare const buildComplianceChatHistory: (mongoose: typeof mongoose) => ComplianceChatHistoryModel;
|
|
23
|
+
export { buildComplianceChatHistory, ComplianceChatHistoryDoc, ComplianceChatHistoryAttrs };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildComplianceChatHistory = void 0;
|
|
4
|
+
const buildComplianceChatHistory = (mongoose) => {
|
|
5
|
+
if (mongoose.models.ComplianceChatHistory) {
|
|
6
|
+
return mongoose.model("ComplianceChatHistory");
|
|
7
|
+
}
|
|
8
|
+
const ComplianceChatHistorySchema = new mongoose.Schema({
|
|
9
|
+
sessionId: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true,
|
|
12
|
+
},
|
|
13
|
+
sequenceNumber: {
|
|
14
|
+
type: Number,
|
|
15
|
+
required: true,
|
|
16
|
+
},
|
|
17
|
+
createdAt: {
|
|
18
|
+
type: Date,
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
text: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
isBot: {
|
|
26
|
+
type: Boolean,
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
blobId: {
|
|
30
|
+
type: Number,
|
|
31
|
+
required: true,
|
|
32
|
+
},
|
|
33
|
+
}, {
|
|
34
|
+
collection: 'compliancechathistory',
|
|
35
|
+
toJSON: {
|
|
36
|
+
transform(doc, ret) {
|
|
37
|
+
ret.id = ret._id;
|
|
38
|
+
delete ret._id;
|
|
39
|
+
delete ret.__v;
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
ComplianceChatHistorySchema.index({ sessionId: 1, sequenceNumber: 1 });
|
|
44
|
+
ComplianceChatHistorySchema.statics.build = (attrs) => {
|
|
45
|
+
return new ComplianceChatHistory(attrs);
|
|
46
|
+
};
|
|
47
|
+
const ComplianceChatHistory = mongoose.model("ComplianceChatHistory", ComplianceChatHistorySchema);
|
|
48
|
+
return ComplianceChatHistory;
|
|
49
|
+
};
|
|
50
|
+
exports.buildComplianceChatHistory = buildComplianceChatHistory;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import { ComplianceRuleResultStatus, ComplianceRuleOutcome } from "@riocrypto/common";
|
|
3
|
+
interface ComplianceRuleResultAttrs {
|
|
4
|
+
sessionId: string;
|
|
5
|
+
ruleId: string;
|
|
6
|
+
name: string;
|
|
7
|
+
status: ComplianceRuleResultStatus;
|
|
8
|
+
prompt: string;
|
|
9
|
+
data: string;
|
|
10
|
+
details: string;
|
|
11
|
+
outcome?: ComplianceRuleOutcome;
|
|
12
|
+
}
|
|
13
|
+
interface ComplianceRuleResultDoc extends mongoose.Document {
|
|
14
|
+
id: string;
|
|
15
|
+
sessionId: string;
|
|
16
|
+
ruleId: string;
|
|
17
|
+
name: string;
|
|
18
|
+
status: ComplianceRuleResultStatus;
|
|
19
|
+
prompt: string;
|
|
20
|
+
data: string;
|
|
21
|
+
details: string;
|
|
22
|
+
outcome?: ComplianceRuleOutcome;
|
|
23
|
+
}
|
|
24
|
+
interface ComplianceRuleResultModel extends mongoose.Model<ComplianceRuleResultDoc> {
|
|
25
|
+
build(attrs: ComplianceRuleResultAttrs): ComplianceRuleResultDoc;
|
|
26
|
+
}
|
|
27
|
+
declare const buildComplianceRuleResult: (mongoose: typeof mongoose) => ComplianceRuleResultModel;
|
|
28
|
+
export { buildComplianceRuleResult, ComplianceRuleResultDoc, ComplianceRuleResultAttrs };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildComplianceRuleResult = void 0;
|
|
4
|
+
const buildComplianceRuleResult = (mongoose) => {
|
|
5
|
+
if (mongoose.models.ComplianceRuleResult) {
|
|
6
|
+
return mongoose.model("ComplianceRuleResult");
|
|
7
|
+
}
|
|
8
|
+
const ComplianceRuleResultSchema = new mongoose.Schema({
|
|
9
|
+
sessionId: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true,
|
|
12
|
+
},
|
|
13
|
+
ruleId: {
|
|
14
|
+
type: String,
|
|
15
|
+
required: true,
|
|
16
|
+
},
|
|
17
|
+
name: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
status: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
prompt: {
|
|
26
|
+
type: String,
|
|
27
|
+
required: true,
|
|
28
|
+
},
|
|
29
|
+
data: {
|
|
30
|
+
type: String,
|
|
31
|
+
required: false,
|
|
32
|
+
},
|
|
33
|
+
details: {
|
|
34
|
+
type: String,
|
|
35
|
+
required: false,
|
|
36
|
+
},
|
|
37
|
+
outcome: {
|
|
38
|
+
type: String,
|
|
39
|
+
required: false,
|
|
40
|
+
},
|
|
41
|
+
}, {
|
|
42
|
+
toJSON: {
|
|
43
|
+
transform(doc, ret) {
|
|
44
|
+
ret.id = ret._id;
|
|
45
|
+
delete ret._id;
|
|
46
|
+
delete ret.__v;
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
ComplianceRuleResultSchema.index({ sessionId: 1 });
|
|
51
|
+
ComplianceRuleResultSchema.statics.build = (attrs) => {
|
|
52
|
+
return new ComplianceRuleResult(attrs);
|
|
53
|
+
};
|
|
54
|
+
const ComplianceRuleResult = mongoose.model("ComplianceRuleResult", ComplianceRuleResultSchema);
|
|
55
|
+
return ComplianceRuleResult;
|
|
56
|
+
};
|
|
57
|
+
exports.buildComplianceRuleResult = buildComplianceRuleResult;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
interface ComplianceRuleAttrs {
|
|
3
|
+
country: string;
|
|
4
|
+
name: string;
|
|
5
|
+
prompt: string;
|
|
6
|
+
ruleType: string;
|
|
7
|
+
}
|
|
8
|
+
interface ComplianceRuleDoc extends mongoose.Document {
|
|
9
|
+
id: string;
|
|
10
|
+
country: string;
|
|
11
|
+
name: string;
|
|
12
|
+
prompt: string;
|
|
13
|
+
ruleType: string;
|
|
14
|
+
}
|
|
15
|
+
interface ComplianceRuleModel extends mongoose.Model<ComplianceRuleDoc> {
|
|
16
|
+
build(attrs: ComplianceRuleAttrs): ComplianceRuleDoc;
|
|
17
|
+
}
|
|
18
|
+
declare const buildComplianceRule: (mongoose: typeof mongoose) => ComplianceRuleModel;
|
|
19
|
+
export { buildComplianceRule, ComplianceRuleDoc, ComplianceRuleAttrs };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildComplianceRule = void 0;
|
|
4
|
+
const buildComplianceRule = (mongoose) => {
|
|
5
|
+
if (mongoose.models.ComplianceRule) {
|
|
6
|
+
return mongoose.model("ComplianceRule");
|
|
7
|
+
}
|
|
8
|
+
const ComplianceRuleSchema = new mongoose.Schema({
|
|
9
|
+
country: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true,
|
|
12
|
+
},
|
|
13
|
+
name: {
|
|
14
|
+
type: String,
|
|
15
|
+
required: true,
|
|
16
|
+
},
|
|
17
|
+
prompt: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
ruleType: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: true,
|
|
24
|
+
},
|
|
25
|
+
}, {
|
|
26
|
+
toJSON: {
|
|
27
|
+
transform(doc, ret) {
|
|
28
|
+
ret.id = ret._id;
|
|
29
|
+
delete ret._id;
|
|
30
|
+
delete ret.__v;
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
ComplianceRuleSchema.index({ country: 1 });
|
|
35
|
+
ComplianceRuleSchema.statics.build = (attrs) => {
|
|
36
|
+
return new ComplianceRule(attrs);
|
|
37
|
+
};
|
|
38
|
+
const ComplianceRule = mongoose.model("ComplianceRule", ComplianceRuleSchema);
|
|
39
|
+
return ComplianceRule;
|
|
40
|
+
};
|
|
41
|
+
exports.buildComplianceRule = buildComplianceRule;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
import { ComplianceSessionStatus } from "@riocrypto/common";
|
|
3
|
+
interface ComplianceSessionAttrs {
|
|
4
|
+
id: string;
|
|
5
|
+
userId: string;
|
|
6
|
+
createdAt: Date;
|
|
7
|
+
country: string;
|
|
8
|
+
message: string;
|
|
9
|
+
status: ComplianceSessionStatus;
|
|
10
|
+
transcript: string;
|
|
11
|
+
modelName: string;
|
|
12
|
+
}
|
|
13
|
+
interface ComplianceSessionDoc extends mongoose.Document {
|
|
14
|
+
id: string;
|
|
15
|
+
userId: string;
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
country: string;
|
|
18
|
+
message: string;
|
|
19
|
+
status: ComplianceSessionStatus;
|
|
20
|
+
transcript: string;
|
|
21
|
+
modelName: string;
|
|
22
|
+
}
|
|
23
|
+
interface ComplianceSessionModel extends mongoose.Model<ComplianceSessionDoc> {
|
|
24
|
+
build(attrs: ComplianceSessionAttrs): ComplianceSessionDoc;
|
|
25
|
+
}
|
|
26
|
+
declare const buildComplianceSession: (mongoose: typeof mongoose) => ComplianceSessionModel;
|
|
27
|
+
export { buildComplianceSession, ComplianceSessionDoc, ComplianceSessionAttrs };
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildComplianceSession = void 0;
|
|
4
|
+
const buildComplianceSession = (mongoose) => {
|
|
5
|
+
if (mongoose.models.ComplianceSession) {
|
|
6
|
+
return mongoose.model("ComplianceSession");
|
|
7
|
+
}
|
|
8
|
+
const ComplianceSessionSchema = new mongoose.Schema({
|
|
9
|
+
userId: {
|
|
10
|
+
type: String,
|
|
11
|
+
required: true,
|
|
12
|
+
},
|
|
13
|
+
createdAt: {
|
|
14
|
+
type: Date,
|
|
15
|
+
required: true,
|
|
16
|
+
},
|
|
17
|
+
country: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: false,
|
|
20
|
+
},
|
|
21
|
+
message: {
|
|
22
|
+
type: String,
|
|
23
|
+
required: false,
|
|
24
|
+
default: "",
|
|
25
|
+
},
|
|
26
|
+
status: {
|
|
27
|
+
type: String,
|
|
28
|
+
required: false,
|
|
29
|
+
default: "",
|
|
30
|
+
},
|
|
31
|
+
transcript: {
|
|
32
|
+
type: String,
|
|
33
|
+
required: false,
|
|
34
|
+
default: "",
|
|
35
|
+
},
|
|
36
|
+
modelName: {
|
|
37
|
+
type: String,
|
|
38
|
+
required: false,
|
|
39
|
+
},
|
|
40
|
+
}, {
|
|
41
|
+
toJSON: {
|
|
42
|
+
transform(doc, ret) {
|
|
43
|
+
ret.id = ret._id;
|
|
44
|
+
delete ret._id;
|
|
45
|
+
delete ret.__v;
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
ComplianceSessionSchema.index({ id: 1 });
|
|
50
|
+
ComplianceSessionSchema.index({ userId: 1 });
|
|
51
|
+
ComplianceSessionSchema.index({ createdAt: 1 });
|
|
52
|
+
ComplianceSessionSchema.statics.build = (attrs) => {
|
|
53
|
+
return new ComplianceSession(attrs);
|
|
54
|
+
};
|
|
55
|
+
const ComplianceSession = mongoose.model("ComplianceSession", ComplianceSessionSchema);
|
|
56
|
+
return ComplianceSession;
|
|
57
|
+
};
|
|
58
|
+
exports.buildComplianceSession = buildComplianceSession;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2696",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@google-cloud/secret-manager": "^5.3.0",
|
|
29
29
|
"@google-cloud/storage": "^6.9.5",
|
|
30
30
|
"@hyperdx/node-opentelemetry": "^0.7.0",
|
|
31
|
-
"@riocrypto/common": "^1.0.
|
|
31
|
+
"@riocrypto/common": "^1.0.2496",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.7.4",
|
|
34
34
|
"crypto-js": "^4.2.0",
|