@riocrypto/common-server 1.0.1734 → 1.0.1736

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
@@ -61,6 +61,7 @@ export * from "./models/coinbase-order";
61
61
  export * from "./models/multipart-liquidity-order";
62
62
  export * from "./models/onboarding";
63
63
  export * from "./models/alert";
64
+ export * from "./models/admin-action";
64
65
  export * from "./clients/axios-with-logging";
65
66
  export * from "./clients/slack-client";
66
67
  export * from "./clients/fireblocks-client";
package/build/index.js CHANGED
@@ -77,6 +77,7 @@ __exportStar(require("./models/coinbase-order"), exports);
77
77
  __exportStar(require("./models/multipart-liquidity-order"), exports);
78
78
  __exportStar(require("./models/onboarding"), exports);
79
79
  __exportStar(require("./models/alert"), exports);
80
+ __exportStar(require("./models/admin-action"), exports);
80
81
  __exportStar(require("./clients/axios-with-logging"), exports);
81
82
  __exportStar(require("./clients/slack-client"), exports);
82
83
  __exportStar(require("./clients/fireblocks-client"), exports);
@@ -0,0 +1,19 @@
1
+ import { AdminActionStatus, AdminActionType } from "@riocrypto/common";
2
+ import { Mongoose, Model, Document } from "mongoose";
3
+ interface AdminActionAttrs {
4
+ type: AdminActionType;
5
+ createdAt: Date;
6
+ status: AdminActionStatus;
7
+ adminAuthId: string;
8
+ }
9
+ interface AdminActionDoc extends Document {
10
+ type: AdminActionType;
11
+ createdAt: Date;
12
+ status: AdminActionStatus;
13
+ adminAuthId: string;
14
+ }
15
+ interface AdminActionModel extends Model<AdminActionDoc> {
16
+ build(attrs: AdminActionAttrs): AdminActionDoc;
17
+ }
18
+ declare const buildAdminAction: (mongoose: Mongoose) => AdminActionModel;
19
+ export { buildAdminAction, AdminActionDoc, AdminActionAttrs };
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildAdminAction = void 0;
4
+ const buildAdminAction = (mongoose) => {
5
+ // if model is already defined, return it
6
+ if (mongoose.models.AdminAction) {
7
+ return mongoose.model("AdminAction");
8
+ }
9
+ const AdminActionSchema = new mongoose.Schema({
10
+ type: {
11
+ type: String,
12
+ required: true,
13
+ },
14
+ createdAt: {
15
+ type: mongoose.Schema.Types.Date,
16
+ required: true,
17
+ },
18
+ status: {
19
+ type: String,
20
+ required: true,
21
+ },
22
+ adminAuthId: {
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
+ AdminActionSchema.statics.build = (attrs) => {
36
+ return new AdminAction(attrs);
37
+ };
38
+ const AdminAction = mongoose.model("AdminAction", AdminActionSchema);
39
+ return AdminAction;
40
+ };
41
+ exports.buildAdminAction = buildAdminAction;
@@ -1,12 +1,14 @@
1
1
  import { Mongoose, Model, Document } from "mongoose";
2
2
  interface WebhookRegistrationAttrs {
3
3
  userId: string;
4
+ brokerId?: string;
4
5
  type: "users" | "orders" | "bank-accounts";
5
6
  url: string;
6
7
  encryptedSharedSecret: string;
7
8
  }
8
9
  interface WebhookRegistrationDoc extends Document {
9
10
  userId: string;
11
+ brokerId?: string;
10
12
  type: "users" | "orders" | "bank-accounts";
11
13
  url: string;
12
14
  encryptedSharedSecret: string;
@@ -11,6 +11,9 @@ const buildWebhookRegistration = (mongoose) => {
11
11
  type: String,
12
12
  required: true,
13
13
  },
14
+ brokerId: {
15
+ type: String,
16
+ },
14
17
  type: {
15
18
  type: String,
16
19
  required: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1734",
3
+ "version": "1.0.1736",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -26,7 +26,7 @@
26
26
  "@google-cloud/secret-manager": "^5.3.0",
27
27
  "@google-cloud/storage": "^6.9.5",
28
28
  "@hyperdx/node-opentelemetry": "^0.4.2",
29
- "@riocrypto/common": "^1.0.1517",
29
+ "@riocrypto/common": "^1.0.1523",
30
30
  "@types/express": "^4.17.13",
31
31
  "axios": "^1.6.0",
32
32
  "crypto-js": "^4.2.0",