@brimble/models 3.7.8 → 3.7.78

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.
Files changed (151) hide show
  1. package/.claude/settings.local.json +7 -0
  2. package/activity-log.ts +66 -0
  3. package/app-message.ts +18 -0
  4. package/cashier_subscription.ts +35 -0
  5. package/cashier_subscription_item.ts +25 -0
  6. package/collab-annotation.ts +9 -2
  7. package/collab-comment.ts +5 -3
  8. package/collab-integration.ts +1 -0
  9. package/collab-push-subscription.ts +19 -0
  10. package/collab-share-token.ts +15 -0
  11. package/compute.ts +16 -6
  12. package/dist/activity-log.d.ts +30 -0
  13. package/dist/activity-log.js +61 -0
  14. package/dist/app-message.d.ts +30 -0
  15. package/dist/app-message.js +14 -0
  16. package/dist/cashier_subscription.d.ts +30 -0
  17. package/dist/cashier_subscription.js +27 -0
  18. package/dist/cashier_subscription_item.d.ts +30 -0
  19. package/dist/cashier_subscription_item.js +17 -0
  20. package/dist/collab-annotation.js +9 -2
  21. package/dist/collab-comment.js +5 -3
  22. package/dist/collab-integration.js +1 -0
  23. package/dist/collab-push-subscription.d.ts +30 -0
  24. package/dist/collab-push-subscription.js +14 -0
  25. package/dist/collab-share-token.d.ts +30 -0
  26. package/dist/collab-share-token.js +11 -0
  27. package/dist/compute.js +15 -6
  28. package/dist/domain/index.js +10 -0
  29. package/dist/domain/transfer.d.ts +30 -0
  30. package/dist/domain/transfer.js +99 -0
  31. package/dist/enum/index.d.ts +36 -6
  32. package/dist/enum/index.js +41 -6
  33. package/dist/env.js +0 -8
  34. package/dist/environment-variable.d.ts +30 -0
  35. package/dist/environment-variable.js +16 -0
  36. package/dist/framework.js +5 -0
  37. package/dist/index.d.ts +16 -3
  38. package/dist/index.js +36 -5
  39. package/dist/invoice.d.ts +30 -0
  40. package/dist/invoice.js +28 -0
  41. package/dist/member.js +1 -0
  42. package/dist/ownership-transfer.d.ts +30 -0
  43. package/dist/ownership-transfer.js +35 -0
  44. package/dist/plan_configuration.js +3 -0
  45. package/dist/project/index.js +14 -6
  46. package/dist/project-environment.d.ts +30 -0
  47. package/dist/project-environment.js +13 -0
  48. package/dist/project-tag-assignment.d.ts +30 -0
  49. package/dist/project-tag-assignment.js +32 -0
  50. package/dist/project_analytics.d.ts +30 -0
  51. package/dist/project_analytics.js +18 -0
  52. package/dist/subscription.js +8 -0
  53. package/dist/{branch.d.ts → tag.d.ts} +2 -2
  54. package/dist/tag.js +29 -0
  55. package/dist/team.js +16 -0
  56. package/dist/types/activity-log.d.ts +18 -0
  57. package/dist/types/app-message.d.ts +15 -0
  58. package/dist/types/app-message.js +2 -0
  59. package/dist/types/cashier_subscription.d.ts +27 -0
  60. package/dist/types/cashier_subscription.js +2 -0
  61. package/dist/types/collab-annotation.d.ts +8 -1
  62. package/dist/types/collab-comment.d.ts +4 -2
  63. package/dist/types/collab-integration.d.ts +2 -0
  64. package/dist/types/collab-push-subscription.d.ts +12 -0
  65. package/dist/types/collab-push-subscription.js +2 -0
  66. package/dist/types/collab-share-token.d.ts +12 -0
  67. package/dist/types/collab-share-token.js +2 -0
  68. package/dist/types/compute.d.ts +12 -2
  69. package/dist/types/domain/index.d.ts +3 -1
  70. package/dist/types/domain/transfer.d.ts +27 -0
  71. package/dist/types/domain/transfer.js +2 -0
  72. package/dist/types/env.d.ts +0 -3
  73. package/dist/types/environment-variable.d.ts +12 -0
  74. package/dist/types/environment-variable.js +2 -0
  75. package/dist/types/framework.d.ts +1 -0
  76. package/dist/types/index.d.ts +13 -1
  77. package/dist/types/invoice.d.ts +15 -0
  78. package/dist/types/invoice.js +2 -0
  79. package/dist/types/member.d.ts +2 -0
  80. package/dist/types/ownership-transfer.d.ts +12 -0
  81. package/dist/types/ownership-transfer.js +2 -0
  82. package/dist/types/plan_configuration.d.ts +3 -0
  83. package/dist/types/project/index.d.ts +4 -2
  84. package/dist/types/project-environment.d.ts +13 -0
  85. package/dist/types/project-environment.js +2 -0
  86. package/dist/types/project-tag-assignment.d.ts +13 -0
  87. package/dist/types/project-tag-assignment.js +2 -0
  88. package/dist/types/project_analytics.d.ts +11 -0
  89. package/dist/types/project_analytics.js +2 -0
  90. package/dist/types/subscription.d.ts +2 -0
  91. package/dist/types/tag.d.ts +11 -0
  92. package/dist/types/tag.js +2 -0
  93. package/dist/types/team.d.ts +4 -0
  94. package/dist/types/user.d.ts +2 -0
  95. package/dist/types/wallet.d.ts +3 -0
  96. package/dist/user.js +2 -0
  97. package/dist/wallet.js +12 -0
  98. package/domain/index.ts +10 -0
  99. package/domain/transfer.ts +112 -0
  100. package/enum/index.ts +40 -5
  101. package/env.ts +0 -8
  102. package/environment-variable.ts +21 -0
  103. package/framework.ts +5 -0
  104. package/index.ts +36 -5
  105. package/invoice.ts +36 -0
  106. package/member.ts +1 -0
  107. package/ownership-transfer.ts +42 -0
  108. package/package.json +1 -1
  109. package/plan_configuration.ts +3 -0
  110. package/project/index.ts +14 -6
  111. package/project-environment.ts +18 -0
  112. package/project-tag-assignment.ts +40 -0
  113. package/project_analytics.ts +26 -0
  114. package/subscription.ts +8 -0
  115. package/tag.ts +34 -0
  116. package/team.ts +16 -0
  117. package/types/activity-log.ts +19 -0
  118. package/types/app-message.ts +16 -0
  119. package/types/cashier_subscription.ts +29 -0
  120. package/types/collab-annotation.ts +8 -1
  121. package/types/collab-comment.ts +4 -2
  122. package/types/collab-integration.ts +2 -0
  123. package/types/collab-push-subscription.ts +10 -0
  124. package/types/collab-share-token.ts +13 -0
  125. package/types/compute.ts +14 -2
  126. package/types/domain/index.ts +3 -1
  127. package/types/domain/transfer.ts +32 -0
  128. package/types/env.ts +0 -3
  129. package/types/environment-variable.ts +13 -0
  130. package/types/framework.ts +3 -2
  131. package/types/index.ts +13 -1
  132. package/types/invoice.ts +16 -0
  133. package/types/member.ts +2 -0
  134. package/types/ownership-transfer.ts +13 -0
  135. package/types/plan_configuration.ts +3 -0
  136. package/types/project/index.ts +4 -2
  137. package/types/project-environment.ts +14 -0
  138. package/types/project-tag-assignment.ts +14 -0
  139. package/types/project_analytics.ts +12 -0
  140. package/types/subscription.ts +2 -0
  141. package/types/tag.ts +12 -0
  142. package/types/team.ts +4 -0
  143. package/types/user.ts +2 -0
  144. package/types/wallet.ts +3 -0
  145. package/user.ts +2 -0
  146. package/wallet.ts +12 -0
  147. package/branch.ts +0 -22
  148. package/dist/branch.js +0 -17
  149. package/dist/types/branch.d.ts +0 -17
  150. package/types/branch.ts +0 -18
  151. /package/dist/types/{branch.js → activity-log.js} +0 -0
package/index.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  export { default as User } from "./user";
2
2
  export { default as Project, DeletedProject } from "./project";
3
+ export { default as ProjectAnalytics } from "./project_analytics";
3
4
  export { default as Preview } from "./project/preview";
4
5
  export { default as ProjectConnection } from "./project/connection";
5
6
  export { default as Following } from "./following";
@@ -30,21 +31,34 @@ export { default as Framework } from "./framework";
30
31
  export { default as Settings } from "./settings";
31
32
  export { default as LoadBalancerPort } from "./load-balancer-port";
32
33
  export { default as DomainRenewal } from "./domain/renewal";
34
+ export { default as DomainTransfer } from "./domain/transfer";
33
35
  export { default as WebhookCategory } from "./webhook-category";
34
36
  export { default as WebhookEvent } from "./webhook-event";
35
37
  export { default as WebhookSetting } from "./webhook-setting";
36
38
  export { default as Intention } from "./intention";
37
39
  export { default as Provider } from "./provider";
38
- export { default as Branch } from "./branch";
39
40
  export { default as CollabAnnotation } from "./collab-annotation";
40
41
  export { default as CollabComment } from "./collab-comment";
41
42
  export { default as CollabIntegration } from "./collab-integration";
42
43
  export { default as CollabSettings } from "./collab-settings";
44
+ export { default as CollabShareToken } from "./collab-share-token";
45
+ export { default as CollabPushSubscription } from "./collab-push-subscription";
46
+ export { default as AppMessage } from "./app-message";
47
+ export { default as Invoice } from "./invoice";
48
+ export { default as Tag } from "./tag";
49
+ export { default as ProjectTagAssignment } from "./project-tag-assignment";
50
+ export { default as CashierSubscription } from "./cashier_subscription";
51
+ export { default as CashierSubscriptionItem } from "./cashier_subscription_item";
52
+ export { default as ProjectEnvironment } from "./project-environment";
53
+ export { default as EnvironmentVariable } from "./environment-variable";
54
+ export { default as ActivityLog } from "./activity-log";
55
+ export { default as OwnershipTransfer } from "./ownership-transfer";
43
56
 
44
57
  export {
45
58
  IUser,
46
59
  IGit,
47
60
  IProject,
61
+ IProjectAnalytics,
48
62
  IPreview,
49
63
  IProjectConnection,
50
64
  IFollowing,
@@ -77,17 +91,29 @@ export {
77
91
  ISettings,
78
92
  ILoadBalancerPort,
79
93
  IDomainRenewal,
94
+ IDomainTransfer,
80
95
  IWebhookCategory,
81
96
  IWebhookEvent,
82
97
  IWebhookSetting,
83
98
  IIntention,
84
99
  IProvider,
85
- IBranch,
86
100
  ICollabAnnotation,
87
101
  ICollabComment,
88
102
  ICollabAttachment,
89
103
  ICollabIntegration,
90
- ICollabSettings
104
+ ICollabSettings,
105
+ ICollabShareToken,
106
+ ICollabPushSubscription,
107
+ IAppMessage,
108
+ IInvoice,
109
+ ITag,
110
+ IProjectTagAssignment,
111
+ ICashierSubscription,
112
+ ICashierSubscriptionItem,
113
+ IProjectEnvironment,
114
+ IEnvironmentVariable,
115
+ IActivityLog,
116
+ IOwnershipTransfer,
91
117
  } from "./types";
92
118
  export {
93
119
  GIT_TYPE,
@@ -113,12 +139,17 @@ export {
113
139
  SERVER_PROTOCOL,
114
140
  FrameworkApplicationType,
115
141
  DomainRenewalStatus,
142
+ DomainTransferProvider,
143
+ DomainTransferDirection,
144
+ DomainTransferStatus,
116
145
  NomadDeploymentStatus,
117
- BRANCH_TYPE,
118
146
  COLLAB_ANNOTATION_STATUS,
119
147
  COLLAB_INTEGRATION_TYPE,
120
148
  COLLAB_THEME,
121
- COLLAB_TOOLBAR_POSITION
149
+ COLLAB_TOOLBAR_POSITION,
150
+ INVOICE_STATUS,
151
+ INVOICE_PAYMENT_STATUS,
152
+ INVOICE_TYPE
122
153
  } from "./enum";
123
154
 
124
155
  import mongoose from "mongoose";
package/invoice.ts ADDED
@@ -0,0 +1,36 @@
1
+ import { model, Schema } from "mongoose";
2
+ import {
3
+ INVOICE_STATUS,
4
+ INVOICE_PAYMENT_STATUS,
5
+ INVOICE_TYPE,
6
+ } from "./enum";
7
+ import { IInvoice } from "./types";
8
+
9
+ const invoiceSchema: Schema = new Schema(
10
+ {
11
+ ref: String,
12
+ user_id: String,
13
+ subscription_id: String,
14
+ total_amount: Number,
15
+ due: Boolean,
16
+ type: {
17
+ type: String,
18
+ enum: Object.values(INVOICE_TYPE),
19
+ },
20
+ status: {
21
+ type: String,
22
+ enum: Object.values(INVOICE_STATUS),
23
+ },
24
+ payment_status: {
25
+ type: String,
26
+ enum: Object.values(INVOICE_PAYMENT_STATUS),
27
+ },
28
+ billing_period: String,
29
+ },
30
+ {
31
+ timestamps: true,
32
+ collection: "invoices",
33
+ },
34
+ );
35
+
36
+ export default model<IInvoice>("Invoice", invoiceSchema);
package/member.ts CHANGED
@@ -31,6 +31,7 @@ const memberSchema: Schema = new Schema(
31
31
  default: false,
32
32
  },
33
33
  permissions: [{ type: Schema.Types.ObjectId, ref: "MemberPermission" }],
34
+ project_environments: [{ type: Schema.Types.ObjectId, ref: "ProjectEnvironment" }],
34
35
  },
35
36
  {
36
37
  timestamps: {
@@ -0,0 +1,42 @@
1
+ import { model, Schema } from "mongoose";
2
+ import { IOwnershipTransfer } from "./types";
3
+
4
+ const ownershipTransferSchema: Schema = new Schema(
5
+ {
6
+ team: {
7
+ type: Schema.Types.ObjectId,
8
+ ref: "Team",
9
+ required: true,
10
+ },
11
+ from_user: {
12
+ type: Schema.Types.ObjectId,
13
+ ref: "User",
14
+ required: true,
15
+ },
16
+ to_user: {
17
+ type: Schema.Types.ObjectId,
18
+ ref: "User",
19
+ required: true,
20
+ },
21
+ status: {
22
+ type: String,
23
+ enum: ["pending", "accepted", "denied", "expired"],
24
+ default: "pending",
25
+ },
26
+ expires_at: {
27
+ type: Date,
28
+ required: true,
29
+ },
30
+ },
31
+ {
32
+ timestamps: {
33
+ createdAt: "created_at",
34
+ updatedAt: "updated_at",
35
+ },
36
+ },
37
+ );
38
+
39
+ export default model<IOwnershipTransfer>(
40
+ "OwnershipTransfer",
41
+ ownershipTransferSchema,
42
+ );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimble/models",
3
- "version": "3.7.8",
3
+ "version": "3.7.78",
4
4
  "description": "Brimble models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -20,6 +20,8 @@ const PlanConfigurationSchema = new Schema<IPlanConfiguration>(
20
20
  region: { type: Schema.Types.ObjectId, ref: "Region", required: false },
21
21
  multi_region: { type: Boolean, default: false },
22
22
  unlimited_projects: { type: Boolean, default: false },
23
+ ai_debug_enabled: { type: Boolean, default: false, required: false },
24
+ ai_debug_limit: { type: Number, default: 0, required: false },
23
25
  plan_type: {
24
26
  type: String,
25
27
  enum: Object.values(SUBSCRIPTION_PLAN_TYPE),
@@ -36,6 +38,7 @@ const PlanConfigurationSchema = new Schema<IPlanConfiguration>(
36
38
  custom_domain: { type: Boolean, required: true, default: false },
37
39
  webhook_enabled: { type: Boolean, required: true, default: false },
38
40
  can_deploy_all_applications: { type: Boolean, required: true, default: false },
41
+ stripe_prices: { type: Schema.Types.Mixed, required: false, default: {} },
39
42
  },
40
43
  { timestamps: true },
41
44
  );
package/project/index.ts CHANGED
@@ -47,6 +47,11 @@ const projectSchema = new Schema(
47
47
  ref: "Team",
48
48
  type: Schema.Types.ObjectId,
49
49
  },
50
+ watchPaths: {
51
+ type: Array,
52
+ required: false,
53
+ default: [],
54
+ },
50
55
  server: {
51
56
  ref: "Server",
52
57
  type: Schema.Types.ObjectId,
@@ -131,12 +136,15 @@ const projectSchema = new Schema(
131
136
  type: Schema.Types.ObjectId,
132
137
  },
133
138
  ],
134
- branches: [
135
- {
136
- ref: "Branch",
137
- type: Schema.Types.ObjectId,
138
- },
139
- ],
139
+ project_environment: {
140
+ ref: "ProjectEnvironment",
141
+ type: Schema.Types.ObjectId,
142
+ index: true,
143
+ },
144
+ inherit_environment_vars: {
145
+ type: Boolean,
146
+ default: true,
147
+ },
140
148
  replicas: {
141
149
  type: Number,
142
150
  default: 3,
@@ -0,0 +1,18 @@
1
+ import { model, Schema } from "mongoose";
2
+ import { IProjectEnvironment } from "./types";
3
+
4
+ const projectEnvironmentSchema = new Schema(
5
+ {
6
+ name: { type: String, required: true },
7
+ slug: { type: String, required: true },
8
+ owner: { ref: "User", type: Schema.Types.ObjectId, required: true },
9
+ team: { ref: "Team", type: Schema.Types.ObjectId },
10
+ inherit_from: { ref: "ProjectEnvironment", type: Schema.Types.ObjectId },
11
+ isDefault: { type: Boolean, default: false },
12
+ },
13
+ { timestamps: true },
14
+ );
15
+
16
+ projectEnvironmentSchema.index({ slug: 1, owner: 1, team: 1 }, { unique: true });
17
+
18
+ export default model<IProjectEnvironment>("ProjectEnvironment", projectEnvironmentSchema);
@@ -0,0 +1,40 @@
1
+ import { model, Schema } from "mongoose";
2
+ import { IProjectTagAssignment } from "./types";
3
+
4
+ const projectTagAssignmentSchema: Schema = new Schema(
5
+ {
6
+ tagId: {
7
+ type: Schema.Types.ObjectId,
8
+ ref: "Tag",
9
+ required: true,
10
+ },
11
+ projectId: {
12
+ type: Schema.Types.ObjectId,
13
+ ref: "Project",
14
+ required: true,
15
+ },
16
+ teamId: {
17
+ type: Schema.Types.ObjectId,
18
+ ref: "Team",
19
+ default: null,
20
+ },
21
+ assignedBy: {
22
+ type: Schema.Types.ObjectId,
23
+ ref: "User",
24
+ required: true,
25
+ },
26
+ },
27
+ {
28
+ timestamps: true,
29
+ collection: "project_tag_assignments",
30
+ },
31
+ );
32
+
33
+ projectTagAssignmentSchema.index({ tagId: 1, projectId: 1 }, { unique: true });
34
+ projectTagAssignmentSchema.index({ projectId: 1 });
35
+ projectTagAssignmentSchema.index({ teamId: 1 });
36
+
37
+ export default model<IProjectTagAssignment>(
38
+ "ProjectTagAssignment",
39
+ projectTagAssignmentSchema,
40
+ );
@@ -0,0 +1,26 @@
1
+ import { Schema, model } from "mongoose";
2
+ import { IProjectAnalytics } from "./types/project_analytics";
3
+
4
+ const ProjectAnalyticsSchema = new Schema<IProjectAnalytics>(
5
+ {
6
+ project: {
7
+ type: Schema.Types.ObjectId,
8
+ ref: "Project",
9
+ required: true,
10
+ unique: true,
11
+ index: true,
12
+ },
13
+ provider: { type: String, enum: ["umami"], required: true, default: "umami" },
14
+ websiteId: { type: String, required: true, unique: true },
15
+ shareId: { type: String, default: null },
16
+ domain: { type: String, required: true },
17
+ enabled: { type: Boolean, default: true },
18
+ },
19
+ { timestamps: true },
20
+ );
21
+
22
+ export default model<IProjectAnalytics>(
23
+ "ProjectAnalytics",
24
+ ProjectAnalyticsSchema,
25
+ "project_analytics",
26
+ );
package/subscription.ts CHANGED
@@ -8,6 +8,10 @@ const subscriptionSchema: Schema = new Schema(
8
8
  type: String,
9
9
  required: true,
10
10
  },
11
+ due_amount: {
12
+ type: Number,
13
+ default: 0
14
+ },
11
15
  team_id: {
12
16
  type: Schema.Types.ObjectId,
13
17
  ref: "Team",
@@ -50,6 +54,10 @@ const subscriptionSchema: Schema = new Schema(
50
54
  expiry_date: String,
51
55
  reminder_date: String,
52
56
  transaction_retries: Number,
57
+ downgraded: {
58
+ default: false,
59
+ type: Boolean
60
+ },
53
61
  is_pending_downgrade: {
54
62
  type: Boolean,
55
63
  default: false,
package/tag.ts ADDED
@@ -0,0 +1,34 @@
1
+ import { model, Schema } from "mongoose";
2
+ import { ITag } from "./types";
3
+
4
+ const tagSchema: Schema = new Schema(
5
+ {
6
+ name: {
7
+ type: String,
8
+ required: true,
9
+ trim: true,
10
+ },
11
+ color: {
12
+ type: String,
13
+ required: true,
14
+ },
15
+ teamId: {
16
+ type: Schema.Types.ObjectId,
17
+ ref: "Team",
18
+ default: null,
19
+ },
20
+ createdBy: {
21
+ type: Schema.Types.ObjectId,
22
+ ref: "User",
23
+ required: true,
24
+ },
25
+ },
26
+ {
27
+ timestamps: true,
28
+ collection: "tags",
29
+ },
30
+ );
31
+
32
+ tagSchema.index({ teamId: 1, name: 1 }, { unique: true });
33
+
34
+ export default model<ITag>("Tag", tagSchema);
package/team.ts CHANGED
@@ -26,6 +26,18 @@ const teamSchema: Schema = new Schema(
26
26
  image: {
27
27
  type: String,
28
28
  },
29
+ build_minutes: {
30
+ type: Number,
31
+ default: 0,
32
+ },
33
+ build_minutes_last_reset_at: {
34
+ type: Date,
35
+ default: null,
36
+ },
37
+ build_minutes_cycle_anchor: {
38
+ type: Date,
39
+ default: null,
40
+ },
29
41
  build_disabled: {
30
42
  type: Boolean,
31
43
  default: false,
@@ -35,6 +47,10 @@ const teamSchema: Schema = new Schema(
35
47
  required: false,
36
48
  ref: "Subscription",
37
49
  },
50
+ size: {
51
+ type: Number,
52
+ required: false,
53
+ },
38
54
  },
39
55
  {
40
56
  timestamps: true,
@@ -0,0 +1,19 @@
1
+ import { Document, Types } from "mongoose";
2
+ import { ITeam } from "./team";
3
+ import { IUser } from "./user";
4
+
5
+ export interface IActivityLog extends Document {
6
+ user_id: IUser | Types.ObjectId;
7
+ team_id?: ITeam | Types.ObjectId;
8
+ action: string;
9
+ description?: string;
10
+ context?: string;
11
+ metadata?: Record<string, any>;
12
+ ip_address?: string;
13
+ user_agent?: string;
14
+ status: "success" | "failure";
15
+ resource_type?: string;
16
+ resource_id?: Types.ObjectId;
17
+ created_at: Date;
18
+ updated_at: Date;
19
+ }
@@ -0,0 +1,16 @@
1
+ import { Document } from "mongoose";
2
+ import { IUser } from "./user";
3
+ import { ITeam } from "./team";
4
+
5
+ export interface IAppMessage extends Document {
6
+ userId: IUser;
7
+ teamId: ITeam;
8
+ level: string;
9
+ message: string;
10
+ seen: boolean;
11
+ meta?: Record<string, any>;
12
+ route?: string;
13
+ type: string;
14
+ createdAt: Date;
15
+ updatedAt: Date;
16
+ }
@@ -0,0 +1,29 @@
1
+ import { Document } from "mongoose";
2
+ import { IUser } from "./user";
3
+ import { ITeam } from "./team";
4
+
5
+ export interface ICashierSubscription extends Document {
6
+ user_id: IUser;
7
+ team_id?: ITeam | null;
8
+ type: string;
9
+ stripe_id: string;
10
+ stripe_status: string;
11
+ stripe_price: string | null;
12
+ quantity: number | null;
13
+ trial_ends_at: Date | null;
14
+ ends_at: Date | null;
15
+ plan_type: string | null;
16
+ domain_id: string | null;
17
+ created_at: Date;
18
+ updated_at: Date;
19
+ }
20
+
21
+ export interface ICashierSubscriptionItem extends Document {
22
+ subscription_id: string;
23
+ stripe_id: string;
24
+ stripe_product: string | null;
25
+ stripe_price: string;
26
+ quantity: number | null;
27
+ created_at: Date;
28
+ updated_at: Date;
29
+ }
@@ -5,7 +5,7 @@ import { IProject } from "./project";
5
5
 
6
6
  export interface ICollabAnnotation extends Document {
7
7
  projectId: IProject;
8
- userId: IUser;
8
+ userId?: IUser;
9
9
  pageUrl: string;
10
10
  pagePath: string;
11
11
  xPercent: number;
@@ -16,6 +16,13 @@ export interface ICollabAnnotation extends Document {
16
16
  status: COLLAB_ANNOTATION_STATUS;
17
17
  resolvedAt?: Date;
18
18
  resolvedBy?: IUser;
19
+ guestName?: string;
20
+ guestEmail?: string;
21
+ githubPrCommentId?: number;
22
+ githubPrCommentUrl?: string;
23
+ githubIssueUrl?: string;
24
+ githubIssueNumber?: number;
25
+ subscribedUserIds?: IUser[];
19
26
  createdAt: Date;
20
27
  updatedAt: Date;
21
28
  }
@@ -11,10 +11,12 @@ export interface ICollabAttachment {
11
11
 
12
12
  export interface ICollabComment extends Document {
13
13
  annotationId: ICollabAnnotation;
14
- userId: IUser;
15
- body: string;
14
+ userId?: IUser;
15
+ body?: string;
16
16
  screenshot?: string;
17
17
  attachments?: ICollabAttachment[];
18
+ guestName?: string;
19
+ guestEmail?: string;
18
20
  createdAt: Date;
19
21
  updatedAt: Date;
20
22
  }
@@ -1,9 +1,11 @@
1
1
  import { Document } from "mongoose";
2
2
  import { COLLAB_INTEGRATION_TYPE } from "../enum";
3
3
  import { IProject } from "./project";
4
+ import { IUser } from "./user";
4
5
 
5
6
  export interface ICollabIntegration extends Document {
6
7
  projectId: IProject;
8
+ userId: IUser;
7
9
  type: COLLAB_INTEGRATION_TYPE;
8
10
  webhookUrl: string;
9
11
  channelName?: string;
@@ -0,0 +1,10 @@
1
+ import { Document } from "mongoose";
2
+ import { IUser } from "./user";
3
+
4
+ export interface ICollabPushSubscription extends Document {
5
+ userId: IUser;
6
+ endpoint: string;
7
+ keys: { p256dh: string; auth: string };
8
+ domain: string;
9
+ createdAt: Date;
10
+ }
@@ -0,0 +1,13 @@
1
+ import { Document } from "mongoose";
2
+ import { IUser } from "./user";
3
+ import { IProject } from "./project";
4
+
5
+ export interface ICollabShareToken extends Document {
6
+ projectId: IProject;
7
+ createdBy: IUser;
8
+ token: string;
9
+ expiresAt?: Date;
10
+ isActive: boolean;
11
+ createdAt: Date;
12
+ updatedAt: Date;
13
+ }
package/types/compute.ts CHANGED
@@ -1,28 +1,40 @@
1
+ import { ServiceType } from "../enum";
1
2
  import { IProject } from "./project";
2
- import { ISubscription } from "./subscription";
3
+ import { IRegion } from "./region";
4
+
3
5
  import { ITeam } from "./team";
4
6
  import { IUser } from "./user";
5
7
 
6
8
  export interface IComputeChange {
7
9
  _id?: string;
8
10
  project_name: string;
11
+ project_type?: ServiceType;
9
12
  deleted: boolean;
10
13
  project_id: IProject;
11
14
  user_id: IUser;
12
15
  team_id?: ITeam;
13
- subscription_id: ISubscription;
16
+
14
17
  timestamp: Date;
15
18
  previous: {
16
19
  cpu: number;
17
20
  memory: number;
18
21
  storage: number;
19
22
  persistentStorage: number;
23
+ region?: IRegion;
20
24
  };
21
25
  current: {
22
26
  cpu: number;
23
27
  memory: number;
24
28
  storage: number;
25
29
  persistentStorage: number;
30
+ region?: IRegion;
31
+ };
32
+ default_resources?: {
33
+ cpu: number;
34
+ memory: number;
35
+ storage: number;
36
+ persistentStorage: number;
37
+ region?: IRegion;
26
38
  };
27
39
  costs: {
28
40
  startDate: Date;
@@ -1,5 +1,5 @@
1
1
  import { Document } from "mongoose";
2
- import { IPreview, IProject, ISubscription, ITeam, IUser } from "../";
2
+ import { IPreview, IProject, IProjectEnvironment, ISubscription, ITeam, IUser } from "../";
3
3
  import { IDns } from "./dns";
4
4
 
5
5
  export interface IDomain extends Document {
@@ -11,6 +11,7 @@ export interface IDomain extends Document {
11
11
  preview: IPreview;
12
12
  provider: string;
13
13
  subscription: ISubscription;
14
+ cashier_subscription_id: string | null;
14
15
  auto_renewal: boolean;
15
16
  renewal_duration: number;
16
17
  is_discounted: boolean;
@@ -23,6 +24,7 @@ export interface IDomain extends Document {
23
24
  trigger_created_at: string;
24
25
  nameservers: string[];
25
26
  dns: IDns[];
27
+ project_environment?: IProjectEnvironment;
26
28
  is_pending_verification: boolean;
27
29
  redirect?: {
28
30
  url: string;
@@ -0,0 +1,32 @@
1
+ import { Document } from "mongoose";
2
+ import { IDomain, IProject, ITeam, IUser } from "../";
3
+ import {
4
+ DomainTransferDirection,
5
+ DomainTransferProvider,
6
+ DomainTransferStatus,
7
+ } from "../../enum";
8
+
9
+ export interface IDomainTransfer extends Document {
10
+ domain_id: IDomain;
11
+ domain_name: string;
12
+ user_id: IUser;
13
+ team_id?: ITeam;
14
+ provider: DomainTransferProvider;
15
+ direction: DomainTransferDirection;
16
+ status: DomainTransferStatus;
17
+ provider_transfer_id?: string;
18
+ payment_reference?: string;
19
+ payment_token?: string;
20
+ payment_amount?: number;
21
+ renewal_price?: number;
22
+ auto_renewal?: boolean;
23
+ privacy_enabled?: boolean;
24
+ renewal_duration?: number;
25
+ project_id?: IProject;
26
+ last_polled_at?: Date;
27
+ poll_count: number;
28
+ last_provider_status?: string;
29
+ failure_reason?: string;
30
+ createdAt: Date;
31
+ updatedAt: Date;
32
+ }
package/types/env.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import { Document } from "mongoose";
2
2
  import { ENVIRONMENT } from "../enum";
3
- import { IBranch } from "./branch";
4
3
  import { IProject, IUser } from "./";
5
4
 
6
5
  export interface IEnv extends Document {
@@ -9,8 +8,6 @@ export interface IEnv extends Document {
9
8
  project: IProject;
10
9
  user: IUser;
11
10
  environment: ENVIRONMENT | string;
12
- branch?: IBranch;
13
- inheritable?: boolean;
14
11
  is_system?: boolean;
15
12
  createdAt: Date;
16
13
  updatedAt: Date;