@riocrypto/common-server 1.0.1475 → 1.0.1478

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 CHANGED
@@ -44,7 +44,8 @@ export * from "./models/circle-payout";
44
44
  export * from "./models/market-data";
45
45
  export * from "./models/telegram-session";
46
46
  export * from "./models/ubo";
47
- export * from "./models/temporary-verification-code";
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
@@ -60,7 +60,8 @@ __exportStar(require("./models/circle-payout"), exports);
60
60
  __exportStar(require("./models/market-data"), exports);
61
61
  __exportStar(require("./models/telegram-session"), exports);
62
62
  __exportStar(require("./models/ubo"), exports);
63
- __exportStar(require("./models/temporary-verification-code"), exports);
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,16 @@
1
+ import { Mongoose, Model, Document } from "mongoose";
2
+ interface BidAttrs {
3
+ createdAt: Date;
4
+ userId: string;
5
+ quoteId: string;
6
+ }
7
+ interface BidDoc extends Document {
8
+ createdAt: Date;
9
+ userId: string;
10
+ quoteId: string;
11
+ }
12
+ interface BidModel extends Model<BidDoc> {
13
+ build(attrs: BidAttrs): BidDoc;
14
+ }
15
+ declare const buildBid: (mongoose: Mongoose) => BidModel;
16
+ export { buildBid, BidDoc };
@@ -0,0 +1,37 @@
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
+ }, {
23
+ toJSON: {
24
+ transform(doc, ret) {
25
+ ret.id = ret._id.valueOf();
26
+ delete ret._id;
27
+ delete ret.__v;
28
+ },
29
+ },
30
+ });
31
+ BidSchema.statics.build = (attrs) => {
32
+ return new Bid(attrs);
33
+ };
34
+ const Bid = mongoose.model("Bid", BidSchema);
35
+ return Bid;
36
+ };
37
+ exports.buildBid = buildBid;
@@ -0,0 +1,14 @@
1
+ import { Mongoose, Model, Document } from "mongoose";
2
+ interface TemporaryVerificationAttrs {
3
+ phoneNumber: string;
4
+ code: string;
5
+ }
6
+ interface TemporaryVerificationDoc extends Document {
7
+ phoneNumber: string;
8
+ code: string;
9
+ }
10
+ interface TemporaryVerificationModel extends Model<TemporaryVerificationDoc> {
11
+ build(attrs: TemporaryVerificationAttrs): TemporaryVerificationDoc;
12
+ }
13
+ declare const buildTemporaryVerification: (mongoose: Mongoose) => TemporaryVerificationModel;
14
+ export { buildTemporaryVerification, TemporaryVerificationDoc };
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildTemporaryVerification = void 0;
4
+ const buildTemporaryVerification = (mongoose) => {
5
+ // if model is already defined, return it
6
+ if (mongoose.models.TemporaryVerification) {
7
+ return mongoose.model("TemporaryVerification");
8
+ }
9
+ const TemporaryVerificationSchema = new mongoose.Schema({
10
+ phoneNumber: {
11
+ type: String,
12
+ required: true,
13
+ },
14
+ code: {
15
+ type: String,
16
+ required: true,
17
+ },
18
+ }, {
19
+ toJSON: {
20
+ transform(doc, ret) {
21
+ ret.id = ret._id.valueOf();
22
+ delete ret._id;
23
+ delete ret.__v;
24
+ delete ret.code;
25
+ },
26
+ },
27
+ });
28
+ TemporaryVerificationSchema.statics.build = (attrs) => {
29
+ return new TemporaryVerification(attrs);
30
+ };
31
+ const TemporaryVerification = mongoose.model("TemporaryVerification", TemporaryVerificationSchema);
32
+ return TemporaryVerification;
33
+ };
34
+ exports.buildTemporaryVerification = buildTemporaryVerification;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1475",
3
+ "version": "1.0.1478",
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.1309",
31
+ "@riocrypto/common": "^1.0.1313",
32
32
  "@types/express": "^4.17.13",
33
33
  "axios": "^0.27.2",
34
34
  "ccxt": "^3.0.30",
@@ -1,14 +0,0 @@
1
- import { Mongoose, Model, Document } from "mongoose";
2
- interface TemporaryVerificationCodeAttrs {
3
- phoneNumber: string;
4
- code: string;
5
- }
6
- interface TemporaryVerificationCodeDoc extends Document {
7
- phoneNumber: string;
8
- code: string;
9
- }
10
- interface TemporaryVerificationCodeModel extends Model<TemporaryVerificationCodeDoc> {
11
- build(attrs: TemporaryVerificationCodeAttrs): TemporaryVerificationCodeDoc;
12
- }
13
- declare const buildTemporaryVerificationCode: (mongoose: Mongoose) => TemporaryVerificationCodeModel;
14
- export { buildTemporaryVerificationCode, TemporaryVerificationCodeDoc };
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildTemporaryVerificationCode = void 0;
4
- const buildTemporaryVerificationCode = (mongoose) => {
5
- // if model is already defined, return it
6
- if (mongoose.models.TemporaryVerificationCode) {
7
- return mongoose.model("TemporaryVerificationCode");
8
- }
9
- const TemporaryVerificationCodeSchema = new mongoose.Schema({
10
- phoneNumber: {
11
- type: String,
12
- required: true,
13
- },
14
- code: {
15
- type: String,
16
- required: true,
17
- },
18
- }, {
19
- toJSON: {
20
- transform(doc, ret) {
21
- ret.id = ret._id.valueOf();
22
- delete ret._id;
23
- delete ret.__v;
24
- delete ret.code;
25
- },
26
- },
27
- });
28
- TemporaryVerificationCodeSchema.statics.build = (attrs) => {
29
- return new TemporaryVerificationCode(attrs);
30
- };
31
- const TemporaryVerificationCode = mongoose.model("TemporaryVerificationCode", TemporaryVerificationCodeSchema);
32
- return TemporaryVerificationCode;
33
- };
34
- exports.buildTemporaryVerificationCode = buildTemporaryVerificationCode;