@riocrypto/common-server 1.0.2115 → 1.0.2118
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/CEP.d.ts +31 -0
- package/build/models/CEP.js +64 -0
- package/package.json +2 -2
package/build/index.d.ts
CHANGED
|
@@ -79,6 +79,7 @@ export * from "./models/liquidity-automation";
|
|
|
79
79
|
export * from "./models/arbitrage-session";
|
|
80
80
|
export * from "./models/arbitrage-trade";
|
|
81
81
|
export * from "./models/pre-settlement-transaction";
|
|
82
|
+
export * from "./models/CEP";
|
|
82
83
|
export * from "./clients/axios-with-logging";
|
|
83
84
|
export * from "./clients/slack-client";
|
|
84
85
|
export * from "./clients/fireblocks-client";
|
package/build/index.js
CHANGED
|
@@ -95,6 +95,7 @@ __exportStar(require("./models/liquidity-automation"), exports);
|
|
|
95
95
|
__exportStar(require("./models/arbitrage-session"), exports);
|
|
96
96
|
__exportStar(require("./models/arbitrage-trade"), exports);
|
|
97
97
|
__exportStar(require("./models/pre-settlement-transaction"), exports);
|
|
98
|
+
__exportStar(require("./models/CEP"), exports);
|
|
98
99
|
__exportStar(require("./clients/axios-with-logging"), exports);
|
|
99
100
|
__exportStar(require("./clients/slack-client"), exports);
|
|
100
101
|
__exportStar(require("./clients/fireblocks-client"), exports);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CEPStatus } from "@riocrypto/common";
|
|
2
|
+
import { Mongoose, Model, Document } from "mongoose";
|
|
3
|
+
interface CEPAttrs {
|
|
4
|
+
createdAt: Date;
|
|
5
|
+
orderId: string;
|
|
6
|
+
SPEITrackingNumber: string;
|
|
7
|
+
senderCLABE: string;
|
|
8
|
+
receiverCLABE: string;
|
|
9
|
+
amount: number;
|
|
10
|
+
sentAt: Date;
|
|
11
|
+
status: CEPStatus;
|
|
12
|
+
link?: string;
|
|
13
|
+
failedAttempts: number;
|
|
14
|
+
}
|
|
15
|
+
interface CEPDoc extends Document {
|
|
16
|
+
createdAt: Date;
|
|
17
|
+
orderId: string;
|
|
18
|
+
SPEITrackingNumber: string;
|
|
19
|
+
senderCLABE: string;
|
|
20
|
+
receiverCLABE: string;
|
|
21
|
+
amount: number;
|
|
22
|
+
sentAt: Date;
|
|
23
|
+
status: CEPStatus;
|
|
24
|
+
link?: string;
|
|
25
|
+
failedAttempts: number;
|
|
26
|
+
}
|
|
27
|
+
interface CEPModel extends Model<CEPDoc> {
|
|
28
|
+
build(attrs: CEPAttrs): CEPDoc;
|
|
29
|
+
}
|
|
30
|
+
declare const buildCEP: (mongoose: Mongoose) => CEPModel;
|
|
31
|
+
export { buildCEP, CEPDoc, CEPAttrs };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildCEP = void 0;
|
|
4
|
+
const buildCEP = (mongoose) => {
|
|
5
|
+
// if model is already defined, return it
|
|
6
|
+
if (mongoose.models.CEP) {
|
|
7
|
+
return mongoose.model("CEP");
|
|
8
|
+
}
|
|
9
|
+
const CEPSchema = new mongoose.Schema({
|
|
10
|
+
orderId: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
SPEITrackingNumber: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
senderCLABE: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
receiverCLABE: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
amount: {
|
|
27
|
+
type: Number,
|
|
28
|
+
required: true,
|
|
29
|
+
},
|
|
30
|
+
sentAt: {
|
|
31
|
+
type: mongoose.Schema.Types.Date,
|
|
32
|
+
required: true,
|
|
33
|
+
},
|
|
34
|
+
status: {
|
|
35
|
+
type: String,
|
|
36
|
+
required: true,
|
|
37
|
+
},
|
|
38
|
+
link: {
|
|
39
|
+
type: String,
|
|
40
|
+
},
|
|
41
|
+
failedAttempts: {
|
|
42
|
+
type: Number,
|
|
43
|
+
required: true,
|
|
44
|
+
},
|
|
45
|
+
createdAt: {
|
|
46
|
+
type: mongoose.Schema.Types.Date,
|
|
47
|
+
required: true,
|
|
48
|
+
},
|
|
49
|
+
}, {
|
|
50
|
+
toJSON: {
|
|
51
|
+
transform(doc, ret) {
|
|
52
|
+
ret.id = ret._id.valueOf();
|
|
53
|
+
delete ret._id;
|
|
54
|
+
delete ret.__v;
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
CEPSchema.statics.build = (attrs) => {
|
|
59
|
+
return new CEP(attrs);
|
|
60
|
+
};
|
|
61
|
+
const CEP = mongoose.model("CEP", CEPSchema);
|
|
62
|
+
return CEP;
|
|
63
|
+
};
|
|
64
|
+
exports.buildCEP = buildCEP;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2118",
|
|
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.1893",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.7.4",
|
|
34
34
|
"crypto-js": "^4.2.0",
|