@riocrypto/common-server 1.0.2712 → 1.0.2713

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,77 @@
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
+ }, { _id: false });
37
+ const IndicativeQuotePageSchema = new mongoose.Schema({
38
+ userId: {
39
+ type: String,
40
+ required: true,
41
+ },
42
+ quotes: {
43
+ type: [QuoteConfigSchema],
44
+ required: true,
45
+ },
46
+ allowedIPs: {
47
+ type: [String],
48
+ required: true,
49
+ },
50
+ createdBy: {
51
+ type: String,
52
+ required: true,
53
+ },
54
+ createdAt: {
55
+ type: Date,
56
+ required: true,
57
+ },
58
+ updatedAt: {
59
+ type: Date,
60
+ required: true,
61
+ },
62
+ }, {
63
+ toJSON: {
64
+ transform(doc, ret) {
65
+ ret.id = ret._id.valueOf();
66
+ delete ret._id;
67
+ delete ret.__v;
68
+ },
69
+ },
70
+ });
71
+ IndicativeQuotePageSchema.statics.build = (attrs) => {
72
+ return new IndicativeQuotePage(attrs);
73
+ };
74
+ const IndicativeQuotePage = mongoose.model("PublicQuotePage", IndicativeQuotePageSchema);
75
+ return IndicativeQuotePage;
76
+ };
77
+ exports.buildIndicativeQuotePage = buildIndicativeQuotePage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.2712",
3
+ "version": "1.0.2713",
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.2510",
31
+ "@riocrypto/common": "^1.0.2511",
32
32
  "@types/express": "^4.17.13",
33
33
  "axios": "^1.7.4",
34
34
  "crypto-js": "^4.2.0",