@brimble/models 1.4.79 → 1.4.81

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.
@@ -1,3 +1,3 @@
1
1
  yarn run v1.22.19
2
2
  $ tsc -p .
3
- Done in 1.92s.
3
+ Done in 2.79s.
package/dist/index.d.ts CHANGED
@@ -15,8 +15,6 @@ export { default as Tenancy } from "./tenancy";
15
15
  export { IUser, IGit, IProject, IFollowing, IIntegration, IEnv, IServer, ITenancy, IDomain, IToken, IMember, ITeam, IInstalledIntegration, ILog, ISubscriptionPlan, ICard } from "./types";
16
16
  export { GIT_TYPE, INTEGRATION_TYPES, INTEGRATION_PROVIDERS, OAUTH_PERMISSIONS, ENVIRONMENT, SERVER_STATUS, ROLES, PROJECT_STATUS, SUBSCRIPTION_STATUS, CARD_TYPES } from "./enum";
17
17
  import mongoose from "mongoose";
18
- export declare const connectToMongo: (config: mongoose.ConnectOptions & {
19
- host: string;
20
- }) => Promise<void>;
18
+ export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
21
19
  export declare const db: mongoose.Connection;
22
20
  export declare const closeMongo: () => Promise<void>;
package/dist/index.js CHANGED
@@ -54,13 +54,12 @@ Object.defineProperty(exports, "SUBSCRIPTION_STATUS", { enumerable: true, get: f
54
54
  Object.defineProperty(exports, "CARD_TYPES", { enumerable: true, get: function () { return enum_1.CARD_TYPES; } });
55
55
  const mongoose_1 = __importDefault(require("mongoose"));
56
56
  const utils_1 = require("@brimble/utils");
57
- // Connection to Mongo
58
- const connectToMongo = (config) => __awaiter(void 0, void 0, void 0, function* () {
57
+ const connectToMongo = (mongoUrl, config) => __awaiter(void 0, void 0, void 0, function* () {
59
58
  const options = Object.assign({ useNewUrlParser: true, useUnifiedTopology: true, poolSize: 10, socketTimeoutMS: 30000, reconnectTries: 10, reconnectInterval: 3000, checkServerIdentity: false, authMechanism: 'MONGODB-X509', authSource: '$external' }, config);
60
59
  mongoose_1.default.set("useFindAndModify", false);
61
60
  mongoose_1.default.set("useCreateIndex", true);
62
61
  // connect to mongo
63
- mongoose_1.default.connect(`mongodb+srv://${config.host}/?authMechanism=MONGODB-X509&authSource=%24external&tls=true&tlsCertificateKeyFile=${config.sslCert}`, options).catch((err) => {
62
+ mongoose_1.default.connect(mongoUrl, options).catch((err) => {
64
63
  utils_1.log.error(`Unable to connect to mongo db, ${err}`);
65
64
  });
66
65
  // listen for connection
package/dist/server.js CHANGED
@@ -8,7 +8,6 @@ const serverSchema = new mongoose_1.Schema({
8
8
  ref: "User",
9
9
  required: true,
10
10
  },
11
- region: String,
12
11
  ip_address: {
13
12
  ref: "Team",
14
13
  type: mongoose_1.Schema.Types.ObjectId,
@@ -19,7 +18,6 @@ const serverSchema = new mongoose_1.Schema({
19
18
  enum: Object.values(enum_1.SERVER_STATUS),
20
19
  default: enum_1.SERVER_STATUS.Active,
21
20
  },
22
- size: Number,
23
21
  default: Boolean,
24
22
  private_key: {
25
23
  required: true,
@@ -2,11 +2,9 @@ import { Document } from "mongoose";
2
2
  import { SERVER_STATUS } from "../enum";
3
3
  export interface IServer extends Document {
4
4
  name: string;
5
- region: string;
6
5
  ip_address: string;
7
6
  provider_id: string;
8
7
  status: SERVER_STATUS;
9
- size: number;
10
8
  private_key: string;
11
9
  default: boolean;
12
10
  }
package/index.ts CHANGED
@@ -47,11 +47,7 @@ export {
47
47
  import mongoose from "mongoose";
48
48
  import { log } from "@brimble/utils";
49
49
 
50
- // Connection to Mongo
51
- export const connectToMongo = async (
52
- mongoUrl: string,
53
- config?: mongoose.ConnectOptions
54
- ): Promise<void> => {
50
+ export const connectToMongo = async (mongoUrl: string, config?: mongoose.ConnectOptions): Promise<void> => {
55
51
  const options: mongoose.ConnectOptions = {
56
52
  useNewUrlParser: true,
57
53
  useUnifiedTopology: true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimble/models",
3
- "version": "1.4.79",
3
+ "version": "1.4.81",
4
4
  "description": "Brimble models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -21,5 +21,5 @@
21
21
  "ts-node": "^8.10.2",
22
22
  "typescript": "^4.9.4"
23
23
  },
24
- "gitHead": "abee06cf597165cc50cceb23054914eff48607ec"
24
+ "gitHead": "802987b5caf0643b9aa3c8c15d49deab93673990"
25
25
  }
package/server.ts CHANGED
@@ -9,7 +9,6 @@ const serverSchema = new Schema(
9
9
  ref: "User",
10
10
  required: true,
11
11
  },
12
- region: String,
13
12
  ip_address: {
14
13
  ref: "Team",
15
14
  type: Schema.Types.ObjectId,
@@ -20,7 +19,6 @@ const serverSchema = new Schema(
20
19
  enum: Object.values(SERVER_STATUS),
21
20
  default: SERVER_STATUS.Active,
22
21
  },
23
- size: Number,
24
22
  default: Boolean,
25
23
  private_key: {
26
24
  required: true,
package/types/server.ts CHANGED
@@ -4,16 +4,12 @@ import {SERVER_STATUS} from "../enum";
4
4
  export interface IServer extends Document {
5
5
  name: string;
6
6
 
7
- region: string;
8
-
9
7
  ip_address: string;
10
8
 
11
9
  provider_id: string;
12
10
 
13
11
  status: SERVER_STATUS;
14
12
 
15
- size: number;
16
-
17
13
  private_key: string;
18
14
 
19
15
  default: boolean;