@brimble/models 3.8.14 → 3.8.15

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/dist/sandbox.js CHANGED
@@ -107,6 +107,15 @@ const sandboxSchema = new mongoose_1.Schema({
107
107
  ref: "SandboxSnapshot",
108
108
  default: null,
109
109
  },
110
+ snapshot_mode: {
111
+ type: String,
112
+ enum: ["automatic", "manual"],
113
+ default: "manual",
114
+ },
115
+ snapshot_frequency: {
116
+ type: String,
117
+ default: null,
118
+ },
110
119
  isDeleted: {
111
120
  type: Boolean,
112
121
  default: false,
@@ -33,5 +33,7 @@ export interface ISandbox extends Document {
33
33
  paused_at: Date | null;
34
34
  image_override: string | null;
35
35
  from_snapshot: Types.ObjectId | null;
36
+ snapshot_mode: "automatic" | "manual";
37
+ snapshot_frequency: string | null;
36
38
  isDeleted: boolean;
37
39
  }
@@ -1,14 +1,17 @@
1
- import { Document } from "mongoose";
1
+ import { Document, Types } from "mongoose";
2
2
  import { IUser } from "./user";
3
3
  import { ITeam } from "./team";
4
- import { ISubscription } from "./subscription";
5
4
  export interface IVolume extends Document {
6
5
  name: string;
7
6
  user?: IUser;
8
7
  team?: ITeam;
9
- subscription: ISubscription;
10
8
  size: number;
11
9
  mount_path?: string;
10
+ csi_volume_id: string | null;
11
+ region: string | null;
12
+ attached_sandbox_id: Types.ObjectId | null;
13
+ attached_project_id: Types.ObjectId | null;
14
+ last_attached_at: Date | null;
12
15
  created_at?: Date;
13
16
  updated_at?: Date;
14
17
  }
package/dist/volume.js CHANGED
@@ -15,13 +15,21 @@ const volumeSchema = new mongoose_1.Schema({
15
15
  ref: "Team",
16
16
  default: null,
17
17
  },
18
- subscription: {
19
- type: mongoose_1.Schema.Types.ObjectId,
20
- required: true,
21
- ref: "Subscription",
22
- },
23
18
  size: { type: Number, required: true },
24
19
  mount_path: { type: String },
20
+ csi_volume_id: { type: String, default: null },
21
+ region: { type: String, default: null },
22
+ attached_sandbox_id: {
23
+ type: mongoose_1.Schema.Types.ObjectId,
24
+ ref: "Sandbox",
25
+ default: null,
26
+ },
27
+ attached_project_id: {
28
+ type: mongoose_1.Schema.Types.ObjectId,
29
+ ref: "Project",
30
+ default: null,
31
+ },
32
+ last_attached_at: { type: Date, default: null },
25
33
  }, {
26
34
  timestamps: {
27
35
  createdAt: "created_at",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimble/models",
3
- "version": "3.8.14",
3
+ "version": "3.8.15",
4
4
  "description": "Brimble models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/sandbox.ts CHANGED
@@ -107,6 +107,15 @@ const sandboxSchema: Schema = new Schema({
107
107
  ref: "SandboxSnapshot",
108
108
  default: null,
109
109
  },
110
+ snapshot_mode: {
111
+ type: String,
112
+ enum: ["automatic", "manual"],
113
+ default: "manual",
114
+ },
115
+ snapshot_frequency: {
116
+ type: String,
117
+ default: null,
118
+ },
110
119
  isDeleted: {
111
120
  type: Boolean,
112
121
  default: false,
package/types/sandbox.ts CHANGED
@@ -35,5 +35,7 @@ export interface ISandbox extends Document {
35
35
  paused_at: Date | null;
36
36
  image_override: string | null;
37
37
  from_snapshot: Types.ObjectId | null;
38
+ snapshot_mode: "automatic" | "manual";
39
+ snapshot_frequency: string | null;
38
40
  isDeleted: boolean;
39
41
  }
package/types/volume.ts CHANGED
@@ -1,15 +1,18 @@
1
- import { Document } from "mongoose";
1
+ import { Document, Types } from "mongoose";
2
2
  import { IUser } from "./user";
3
3
  import { ITeam } from "./team";
4
- import { ISubscription } from "./subscription";
5
4
 
6
5
  export interface IVolume extends Document {
7
6
  name: string;
8
7
  user?: IUser;
9
8
  team?: ITeam;
10
- subscription: ISubscription;
11
9
  size: number;
12
10
  mount_path?: string;
11
+ csi_volume_id: string | null;
12
+ region: string | null;
13
+ attached_sandbox_id: Types.ObjectId | null;
14
+ attached_project_id: Types.ObjectId | null;
15
+ last_attached_at: Date | null;
13
16
  created_at?: Date;
14
17
  updated_at?: Date;
15
18
  }
package/volume.ts CHANGED
@@ -17,13 +17,21 @@ const volumeSchema: Schema = new Schema(
17
17
  ref: "Team",
18
18
  default: null,
19
19
  },
20
- subscription: {
21
- type: Schema.Types.ObjectId,
22
- required: true,
23
- ref: "Subscription",
24
- },
25
20
  size: { type: Number, required: true },
26
21
  mount_path: { type: String },
22
+ csi_volume_id: { type: String, default: null },
23
+ region: { type: String, default: null },
24
+ attached_sandbox_id: {
25
+ type: Schema.Types.ObjectId,
26
+ ref: "Sandbox",
27
+ default: null,
28
+ },
29
+ attached_project_id: {
30
+ type: Schema.Types.ObjectId,
31
+ ref: "Project",
32
+ default: null,
33
+ },
34
+ last_attached_at: { type: Date, default: null },
27
35
  },
28
36
  {
29
37
  timestamps: {