@riocrypto/common-server 1.0.2712 → 1.0.2714
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.
|
@@ -21,9 +21,7 @@ function buildAxiosWithLogging() {
|
|
|
21
21
|
"csrf",
|
|
22
22
|
];
|
|
23
23
|
function maskHeaderValue(value) {
|
|
24
|
-
return value.length > 2
|
|
25
|
-
? "*".repeat(12) + value.slice(-2)
|
|
26
|
-
: "************";
|
|
24
|
+
return value.length > 2 ? "*".repeat(12) + value.slice(-2) : "************";
|
|
27
25
|
}
|
|
28
26
|
// Masking function - masks any header containing a sensitive substring
|
|
29
27
|
function maskHeaders(headers) {
|
package/build/index.d.ts
CHANGED
|
@@ -117,6 +117,7 @@ export * from "./models/compliance-bot-chat";
|
|
|
117
117
|
export * from "./models/compliance-bot-rule";
|
|
118
118
|
export * from "./models/compliance-bot-rule-result";
|
|
119
119
|
export * from "./models/static-bank-payment-reference";
|
|
120
|
+
export * from "./models/indicative-quote-page";
|
|
120
121
|
export * from "./clients/axios-with-logging";
|
|
121
122
|
export * from "./clients/slack-client";
|
|
122
123
|
export * from "./clients/fireblocks-client";
|
package/build/index.js
CHANGED
|
@@ -133,6 +133,7 @@ __exportStar(require("./models/compliance-bot-chat"), exports);
|
|
|
133
133
|
__exportStar(require("./models/compliance-bot-rule"), exports);
|
|
134
134
|
__exportStar(require("./models/compliance-bot-rule-result"), exports);
|
|
135
135
|
__exportStar(require("./models/static-bank-payment-reference"), exports);
|
|
136
|
+
__exportStar(require("./models/indicative-quote-page"), exports);
|
|
136
137
|
__exportStar(require("./clients/axios-with-logging"), exports);
|
|
137
138
|
__exportStar(require("./clients/slack-client"), exports);
|
|
138
139
|
__exportStar(require("./clients/fireblocks-client"), exports);
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { IndicativeQuotePageQuoteConfig } from "@riocrypto/common";
|
|
2
|
+
import { Mongoose, Model, Document } from "mongoose";
|
|
3
|
+
interface IndicativeQuotePageAttrs {
|
|
4
|
+
userId: string;
|
|
5
|
+
quotes: IndicativeQuotePageQuoteConfig[];
|
|
6
|
+
allowedIPs: string[];
|
|
7
|
+
createdBy: string;
|
|
8
|
+
createdAt: Date;
|
|
9
|
+
updatedAt: Date;
|
|
10
|
+
}
|
|
11
|
+
interface IndicativeQuotePageModel extends Model<IndicativeQuotePageDoc> {
|
|
12
|
+
build(attrs: IndicativeQuotePageAttrs): IndicativeQuotePageDoc;
|
|
13
|
+
}
|
|
14
|
+
interface IndicativeQuotePageDoc extends Document {
|
|
15
|
+
_id: string;
|
|
16
|
+
userId: string;
|
|
17
|
+
quotes: IndicativeQuotePageQuoteConfig[];
|
|
18
|
+
allowedIPs: string[];
|
|
19
|
+
createdBy: string;
|
|
20
|
+
createdAt: Date;
|
|
21
|
+
updatedAt: Date;
|
|
22
|
+
}
|
|
23
|
+
declare const buildIndicativeQuotePage: (mongoose: Mongoose) => IndicativeQuotePageModel;
|
|
24
|
+
export { buildIndicativeQuotePage, IndicativeQuotePageDoc, IndicativeQuotePageAttrs };
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildIndicativeQuotePage = void 0;
|
|
4
|
+
const common_1 = require("@riocrypto/common");
|
|
5
|
+
const buildIndicativeQuotePage = (mongoose) => {
|
|
6
|
+
if (mongoose.models.PublicQuotePage) {
|
|
7
|
+
return mongoose.model("PublicQuotePage");
|
|
8
|
+
}
|
|
9
|
+
const QuoteConfigSchema = new mongoose.Schema({
|
|
10
|
+
side: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
enum: Object.values(common_1.Side),
|
|
14
|
+
},
|
|
15
|
+
crypto: {
|
|
16
|
+
type: String,
|
|
17
|
+
required: true,
|
|
18
|
+
enum: Object.values(common_1.Crypto),
|
|
19
|
+
},
|
|
20
|
+
fiat: {
|
|
21
|
+
type: String,
|
|
22
|
+
required: true,
|
|
23
|
+
enum: Object.values(common_1.Fiat),
|
|
24
|
+
},
|
|
25
|
+
country: {
|
|
26
|
+
type: String,
|
|
27
|
+
required: true,
|
|
28
|
+
enum: Object.values(common_1.Country),
|
|
29
|
+
},
|
|
30
|
+
amountFiat: {
|
|
31
|
+
type: Number,
|
|
32
|
+
},
|
|
33
|
+
amountCrypto: {
|
|
34
|
+
type: Number,
|
|
35
|
+
},
|
|
36
|
+
deferredPaymentType: {
|
|
37
|
+
type: String,
|
|
38
|
+
enum: Object.values(common_1.DeferredPaymentType),
|
|
39
|
+
},
|
|
40
|
+
twoWaySettlementType: {
|
|
41
|
+
type: String,
|
|
42
|
+
enum: Object.values(common_1.TwoWaySettlementType),
|
|
43
|
+
},
|
|
44
|
+
twoWaySettlementDateOffset: {
|
|
45
|
+
type: Number,
|
|
46
|
+
},
|
|
47
|
+
}, { _id: false });
|
|
48
|
+
const IndicativeQuotePageSchema = new mongoose.Schema({
|
|
49
|
+
userId: {
|
|
50
|
+
type: String,
|
|
51
|
+
required: true,
|
|
52
|
+
},
|
|
53
|
+
quotes: {
|
|
54
|
+
type: [QuoteConfigSchema],
|
|
55
|
+
required: true,
|
|
56
|
+
},
|
|
57
|
+
allowedIPs: {
|
|
58
|
+
type: [String],
|
|
59
|
+
required: true,
|
|
60
|
+
},
|
|
61
|
+
createdBy: {
|
|
62
|
+
type: String,
|
|
63
|
+
required: true,
|
|
64
|
+
},
|
|
65
|
+
createdAt: {
|
|
66
|
+
type: Date,
|
|
67
|
+
required: true,
|
|
68
|
+
},
|
|
69
|
+
updatedAt: {
|
|
70
|
+
type: Date,
|
|
71
|
+
required: true,
|
|
72
|
+
},
|
|
73
|
+
}, {
|
|
74
|
+
toJSON: {
|
|
75
|
+
transform(doc, ret) {
|
|
76
|
+
ret.id = ret._id.valueOf();
|
|
77
|
+
delete ret._id;
|
|
78
|
+
delete ret.__v;
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
IndicativeQuotePageSchema.statics.build = (attrs) => {
|
|
83
|
+
return new IndicativeQuotePage(attrs);
|
|
84
|
+
};
|
|
85
|
+
const IndicativeQuotePage = mongoose.model("PublicQuotePage", IndicativeQuotePageSchema);
|
|
86
|
+
return IndicativeQuotePage;
|
|
87
|
+
};
|
|
88
|
+
exports.buildIndicativeQuotePage = buildIndicativeQuotePage;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2714",
|
|
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.2512",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.7.4",
|
|
34
34
|
"crypto-js": "^4.2.0",
|