@riocrypto/common-server 1.0.1477 → 1.0.1480
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/bid.d.ts +19 -0
- package/build/models/bid.js +41 -0
- package/package.json +2 -2
package/build/index.d.ts
CHANGED
|
@@ -45,6 +45,7 @@ export * from "./models/market-data";
|
|
|
45
45
|
export * from "./models/telegram-session";
|
|
46
46
|
export * from "./models/ubo";
|
|
47
47
|
export * from "./models/temporary-verification";
|
|
48
|
+
export * from "./models/bid";
|
|
48
49
|
export * from "./clients/bitstamp-client";
|
|
49
50
|
export * from "./clients/ccxt-client";
|
|
50
51
|
export * from "./clients/slack-client";
|
package/build/index.js
CHANGED
|
@@ -61,6 +61,7 @@ __exportStar(require("./models/market-data"), exports);
|
|
|
61
61
|
__exportStar(require("./models/telegram-session"), exports);
|
|
62
62
|
__exportStar(require("./models/ubo"), exports);
|
|
63
63
|
__exportStar(require("./models/temporary-verification"), exports);
|
|
64
|
+
__exportStar(require("./models/bid"), exports);
|
|
64
65
|
__exportStar(require("./clients/bitstamp-client"), exports);
|
|
65
66
|
__exportStar(require("./clients/ccxt-client"), exports);
|
|
66
67
|
__exportStar(require("./clients/slack-client"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { BidStatus } from "@riocrypto/common";
|
|
2
|
+
import { Mongoose, Model, Document } from "mongoose";
|
|
3
|
+
interface BidAttrs {
|
|
4
|
+
createdAt: Date;
|
|
5
|
+
userId: string;
|
|
6
|
+
quoteId: string;
|
|
7
|
+
status: BidStatus;
|
|
8
|
+
}
|
|
9
|
+
interface BidDoc extends Document {
|
|
10
|
+
createdAt: Date;
|
|
11
|
+
userId: string;
|
|
12
|
+
quoteId: string;
|
|
13
|
+
status: BidStatus;
|
|
14
|
+
}
|
|
15
|
+
interface BidModel extends Model<BidDoc> {
|
|
16
|
+
build(attrs: BidAttrs): BidDoc;
|
|
17
|
+
}
|
|
18
|
+
declare const buildBid: (mongoose: Mongoose) => BidModel;
|
|
19
|
+
export { buildBid, BidDoc };
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildBid = void 0;
|
|
4
|
+
const buildBid = (mongoose) => {
|
|
5
|
+
// if model is already defined, return it
|
|
6
|
+
if (mongoose.models.Bid) {
|
|
7
|
+
return mongoose.model("Bid");
|
|
8
|
+
}
|
|
9
|
+
const BidSchema = 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
|
+
quoteId: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
status: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true,
|
|
25
|
+
},
|
|
26
|
+
}, {
|
|
27
|
+
toJSON: {
|
|
28
|
+
transform(doc, ret) {
|
|
29
|
+
ret.id = ret._id.valueOf();
|
|
30
|
+
delete ret._id;
|
|
31
|
+
delete ret.__v;
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
BidSchema.statics.build = (attrs) => {
|
|
36
|
+
return new Bid(attrs);
|
|
37
|
+
};
|
|
38
|
+
const Bid = mongoose.model("Bid", BidSchema);
|
|
39
|
+
return Bid;
|
|
40
|
+
};
|
|
41
|
+
exports.buildBid = buildBid;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1480",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"@google-cloud/storage": "^6.9.5",
|
|
29
29
|
"@google-cloud/vision": "^4.0.2",
|
|
30
30
|
"@hyperdx/node-opentelemetry": "^0.4.2",
|
|
31
|
-
"@riocrypto/common": "^1.0.
|
|
31
|
+
"@riocrypto/common": "^1.0.1315",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^0.27.2",
|
|
34
34
|
"ccxt": "^3.0.30",
|