@riocrypto/common 1.0.427 → 1.0.429

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
@@ -146,6 +146,7 @@ export * from "./classes/USStateAsset";
146
146
  export * from "./classes/WyrePaymentMethodAsset";
147
147
  export * from "./services/apiKey";
148
148
  export * from "./services/password";
149
+ export * from "./services/s3";
149
150
  export * from "./models/admin-auth";
150
151
  export * from "./models/auth";
151
152
  export * from "./models/business-user";
package/build/index.js CHANGED
@@ -163,6 +163,7 @@ __exportStar(require("./classes/USStateAsset"), exports);
163
163
  __exportStar(require("./classes/WyrePaymentMethodAsset"), exports);
164
164
  __exportStar(require("./services/apiKey"), exports);
165
165
  __exportStar(require("./services/password"), exports);
166
+ __exportStar(require("./services/s3"), exports);
166
167
  __exportStar(require("./models/admin-auth"), exports);
167
168
  __exportStar(require("./models/auth"), exports);
168
169
  __exportStar(require("./models/business-user"), exports);
@@ -7,6 +7,7 @@ import { UserAttribute } from "../types/user-attribute";
7
7
  import { UserType } from "../types/user-type";
8
8
  import { Mongoose, Model, Document } from "mongoose";
9
9
  interface BusinessUserAttrs {
10
+ authId?: string;
10
11
  type: UserType;
11
12
  companyName: string;
12
13
  legalRepresentative: string;
@@ -31,6 +32,7 @@ interface BusinessUserModel extends Model<BusinessUserDoc> {
31
32
  build(attrs: BusinessUserAttrs): BusinessUserDoc;
32
33
  }
33
34
  interface BusinessUserDoc extends Document {
35
+ authId?: string;
34
36
  type: UserType;
35
37
  companyName: string;
36
38
  legalRepresentative: string;
@@ -7,6 +7,9 @@ const buildBusinessUser = (mongoose) => {
7
7
  return mongoose.model("BusinessUser");
8
8
  }
9
9
  const BusinessUserSchema = new mongoose.Schema({
10
+ authId: {
11
+ type: String,
12
+ },
10
13
  type: {
11
14
  type: String,
12
15
  required: true,
@@ -0,0 +1,5 @@
1
+ export declare class s3 {
2
+ _client: any;
3
+ constructor();
4
+ get client(): any;
5
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.s3 = void 0;
4
+ const client_s3_1 = require("@aws-sdk/client-s3");
5
+ class s3 {
6
+ constructor() {
7
+ this._client = new client_s3_1.S3Client({
8
+ endpoint: process.env.S3_ENDPOINT,
9
+ forcePathStyle: false,
10
+ region: process.env.S3_REGION,
11
+ credentials: {
12
+ accessKeyId: process.env.S3_ACCESS_KEY,
13
+ secretAccessKey: process.env.S3_SECRET_KEY, // Secret access key defined through an environment variable.
14
+ },
15
+ });
16
+ }
17
+ get client() {
18
+ return this._client;
19
+ }
20
+ }
21
+ exports.s3 = s3;
@@ -1,6 +1,7 @@
1
1
  export declare enum AuthorizationType {
2
2
  UserNoKYC = "newUserNoKYC",
3
3
  User = "user",
4
+ Broker = "broker",
4
5
  Admin = "admin",
5
6
  Partner = "partner",
6
7
  Auth = "auth"
@@ -5,6 +5,7 @@ var AuthorizationType;
5
5
  (function (AuthorizationType) {
6
6
  AuthorizationType["UserNoKYC"] = "newUserNoKYC";
7
7
  AuthorizationType["User"] = "user";
8
+ AuthorizationType["Broker"] = "broker";
8
9
  AuthorizationType["Admin"] = "admin";
9
10
  AuthorizationType["Partner"] = "partner";
10
11
  AuthorizationType["Auth"] = "auth";
@@ -5,6 +5,7 @@ import { PlatformFeeRange } from "./platform-fee-range";
5
5
  import { USState } from "./us-state";
6
6
  import { UserAttribute } from "./user-attribute";
7
7
  export interface BusinessUserInput {
8
+ authId?: string;
8
9
  companyName: string;
9
10
  legalRepresentative: string;
10
11
  phoneNumber?: string;
@@ -4,6 +4,7 @@ import { Language } from "./language";
4
4
  import { PlatformFeeRange } from "./platform-fee-range";
5
5
  import { UserAttribute } from "./user-attribute";
6
6
  export interface BusinessUserUpdate {
7
+ authId?: string;
7
8
  companyName?: string;
8
9
  legalRepresentative?: string;
9
10
  phoneNumber?: string;
@@ -7,6 +7,7 @@ import { UserAttribute } from "./user-attribute";
7
7
  import { UserType } from "./user-type";
8
8
  export interface BusinessUser {
9
9
  id: string;
10
+ authId?: string;
10
11
  type: UserType;
11
12
  companyName: string;
12
13
  legalRepresentative: string;
@@ -6,6 +6,7 @@ import { USState } from "./us-state";
6
6
  import { UserAttribute } from "./user-attribute";
7
7
  import { UserType } from "./user-type";
8
8
  export interface User {
9
+ authId: string;
9
10
  id: string;
10
11
  type: UserType;
11
12
  firstName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.427",
3
+ "version": "1.0.429",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -20,6 +20,7 @@
20
20
  "typescript": "^4.7.4"
21
21
  },
22
22
  "dependencies": {
23
+ "@aws-sdk/client-s3": "^3.297.0",
23
24
  "@types/express": "^4.17.13",
24
25
  "axios": "^0.27.2",
25
26
  "express": "^4.18.1",