@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
@@ -0,0 +1,13 @@
1
+ import { Document } from "mongoose";
2
+ import { IProjectEnvironment } from "./project-environment";
3
+ import { IUser } from "./user";
4
+
5
+ export interface IEnvironmentVariable extends Document {
6
+ name: string;
7
+ value: string;
8
+ project_environment: IProjectEnvironment;
9
+ user: IUser;
10
+ inheritable: boolean;
11
+ createdAt: Date;
12
+ updatedAt: Date;
13
+ }
@@ -7,9 +7,10 @@ export interface IFramework extends Document {
7
7
  demo?: string;
8
8
  logo: string;
9
9
  tagline?: string;
10
- supported: boolean;
10
+ supported: boolean;
11
11
  description?: string;
12
12
  website: string;
13
+ port: number;
13
14
  envPrefix?: string;
14
15
  detector: string;
15
16
  file_detectors: string[];
@@ -37,4 +38,4 @@ export type BrimbleFrameworkType = {
37
38
  envPrefix: string;
38
39
  supported: boolean;
39
40
  type: string;
40
- };
41
+ };
package/types/index.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  export type { IAutoScalingGroup } from "./auto-scaling-group";
2
- export type { IBranch } from "./branch";
3
2
  export type { ICard } from "./card";
4
3
  export type { IComputeChange } from "./compute";
5
4
  export type { IDbImage } from "./db-image";
6
5
  export type { IDomain } from "./domain";
7
6
  export type { IDns } from "./domain/dns";
8
7
  export type { IDomainRenewal } from "./domain/renewal";
8
+ export type { IDomainTransfer } from "./domain/transfer";
9
9
  export type { IEnv } from "./env";
10
10
  export type { IFollowing } from "./following";
11
11
  export type { BrimbleFrameworkType, IFramework } from "./framework";
@@ -23,6 +23,7 @@ export type { IPermission } from "./permission";
23
23
  export type { IPlanConfiguration } from "./plan_configuration";
24
24
  export type { IProvider } from "./provider";
25
25
  export type { IProject } from "./project";
26
+ export type { IProjectAnalytics } from "./project_analytics";
26
27
  export type { IProjectConnection } from "./project/connection";
27
28
  export type { IPreview } from "./project/preview";
28
29
  export type { IRegion } from "./region";
@@ -42,3 +43,14 @@ export type { ICollabAnnotation } from "./collab-annotation";
42
43
  export type { ICollabComment, ICollabAttachment } from "./collab-comment";
43
44
  export type { ICollabIntegration } from "./collab-integration";
44
45
  export type { ICollabSettings } from "./collab-settings";
46
+ export type { ICollabShareToken } from "./collab-share-token";
47
+ export type { ICollabPushSubscription } from "./collab-push-subscription";
48
+ export type { IAppMessage } from "./app-message";
49
+ export type { IInvoice } from "./invoice";
50
+ export type { IProjectTagAssignment } from "./project-tag-assignment";
51
+ export type { ITag } from "./tag";
52
+ export type { ICashierSubscription, ICashierSubscriptionItem } from "./cashier_subscription";
53
+ export type { IProjectEnvironment } from "./project-environment";
54
+ export type { IEnvironmentVariable } from "./environment-variable";
55
+ export type { IActivityLog } from "./activity-log";
56
+ export type { IOwnershipTransfer } from "./ownership-transfer";
@@ -0,0 +1,16 @@
1
+ import { Document } from "mongoose";
2
+ import { INVOICE_STATUS, INVOICE_PAYMENT_STATUS, INVOICE_TYPE } from "../enum";
3
+
4
+ export interface IInvoice extends Document {
5
+ ref: string;
6
+ user_id: string;
7
+ subscription_id: string;
8
+ total_amount: number;
9
+ due: boolean;
10
+ type: INVOICE_TYPE;
11
+ status: INVOICE_STATUS;
12
+ payment_status: INVOICE_PAYMENT_STATUS;
13
+ billing_period: string;
14
+ created_at: Date;
15
+ updated_at: Date;
16
+ }
package/types/member.ts CHANGED
@@ -2,6 +2,7 @@ import { Document } from "mongoose";
2
2
  import { ROLES } from "../enum";
3
3
  import { ITeam, IUser } from "./";
4
4
  import { IMemberPermission } from "./member-permission";
5
+ import { IProjectEnvironment } from "./project-environment";
5
6
 
6
7
  export interface IMember extends Document {
7
8
  user: IUser;
@@ -12,6 +13,7 @@ export interface IMember extends Document {
12
13
  email: string;
13
14
  featureOnboarded: boolean;
14
15
  permissions: IMemberPermission[];
16
+ project_environments: IProjectEnvironment[];
15
17
  createdAt: Date;
16
18
  updatedAt: Date;
17
19
  }
@@ -0,0 +1,13 @@
1
+ import { Document } from "mongoose";
2
+ import { ITeam } from "./team";
3
+ import { IUser } from "./user";
4
+
5
+ export interface IOwnershipTransfer extends Document {
6
+ team: ITeam;
7
+ from_user: IUser;
8
+ to_user: IUser;
9
+ status: "pending" | "accepted" | "denied" | "expired";
10
+ expires_at: Date;
11
+ created_at: Date;
12
+ updated_at: Date;
13
+ }
@@ -16,6 +16,8 @@ export interface IPlanConfiguration extends Document {
16
16
  build_minutes: number;
17
17
  log_retention: number;
18
18
  multi_region: boolean;
19
+ ai_debug_enabled: boolean;
20
+ ai_debug_limit: number;
19
21
  bandwidth: number;
20
22
  pull_request_preview: boolean;
21
23
  plan_type: SUBSCRIPTION_PLAN_TYPE;
@@ -31,4 +33,5 @@ export interface IPlanConfiguration extends Document {
31
33
  unlimited_projects: boolean;
32
34
  webhook_enabled: boolean;
33
35
  can_deploy_all_applications: boolean;
36
+ stripe_prices?: Record<string, string>;
34
37
  }
@@ -6,10 +6,10 @@ import { ILog } from "../logs";
6
6
  import { ITeam } from "../team";
7
7
  import { IUser } from "../user";
8
8
  import { IServer } from "../server";
9
- import { IBranch } from "../branch";
10
9
  import { IPreview } from "./preview";
11
10
  import { IDbImage } from "../db-image";
12
11
  import { IAutoScalingGroup } from "../auto-scaling-group";
12
+ import { IProjectEnvironment } from "../project-environment";
13
13
  import { IRegion } from "../region";
14
14
 
15
15
  export interface IProject extends Document {
@@ -34,6 +34,7 @@ export interface IProject extends Document {
34
34
  user_id: IUser;
35
35
  monitor_id: string;
36
36
  nomadJobId: string;
37
+ watchPaths: string[];
37
38
  repo: {
38
39
  name: string;
39
40
  full_name: string;
@@ -68,7 +69,8 @@ export interface IProject extends Document {
68
69
  tracking_token: string;
69
70
  from: string;
70
71
  previews: IPreview[];
71
- branches: IBranch[];
72
+ project_environment?: IProjectEnvironment;
73
+ inherit_environment_vars: boolean;
72
74
  replicas: number;
73
75
  vaultPath: string | null;
74
76
  vaultToken: string | null;
@@ -0,0 +1,14 @@
1
+ import { Document } from "mongoose";
2
+ import { ITeam } from "./team";
3
+ import { IUser } from "./user";
4
+
5
+ export interface IProjectEnvironment extends Document {
6
+ name: string;
7
+ slug: string;
8
+ owner: IUser;
9
+ team?: ITeam;
10
+ inherit_from?: IProjectEnvironment;
11
+ isDefault: boolean;
12
+ createdAt: Date;
13
+ updatedAt: Date;
14
+ }
@@ -0,0 +1,14 @@
1
+ import { Document } from "mongoose";
2
+ import { ITag } from "./tag";
3
+ import { IProject } from "./project";
4
+ import { ITeam } from "./team";
5
+ import { IUser } from "./user";
6
+
7
+ export interface IProjectTagAssignment extends Document {
8
+ tagId: ITag;
9
+ projectId: IProject;
10
+ teamId: ITeam;
11
+ assignedBy: IUser;
12
+ createdAt: Date;
13
+ updatedAt: Date;
14
+ }
@@ -0,0 +1,12 @@
1
+ import { Document, Types } from "mongoose";
2
+
3
+ export interface IProjectAnalytics extends Document {
4
+ project: Types.ObjectId;
5
+ provider: "umami";
6
+ websiteId: string;
7
+ shareId?: string | null;
8
+ domain: string;
9
+ enabled: boolean;
10
+ createdAt: Date;
11
+ updatedAt: Date;
12
+ }
@@ -7,7 +7,9 @@ import { IProject } from "./project";
7
7
  export interface ISubscription extends Document {
8
8
  initial_start_date: string;
9
9
  team_id: ITeam;
10
+ due_amount: number;
10
11
  admin_id: IUser;
12
+ downgraded: boolean;
11
13
  billable_id: IUser;
12
14
  project_id?: IProject;
13
15
  plan_type: SUBSCRIPTION_PLAN_TYPE;
package/types/tag.ts ADDED
@@ -0,0 +1,12 @@
1
+ import { Document } from "mongoose";
2
+ import { ITeam } from "./team";
3
+ import { IUser } from "./user";
4
+
5
+ export interface ITag extends Document {
6
+ name: string;
7
+ color: string;
8
+ teamId: ITeam;
9
+ createdBy: IUser;
10
+ createdAt: Date;
11
+ updatedAt: Date;
12
+ }
package/types/team.ts CHANGED
@@ -5,10 +5,14 @@ import { BUILD_DISABLED_BY } from "../enum";
5
5
  export interface ITeam extends Document {
6
6
  name: string;
7
7
  description: string;
8
+ size: number;
8
9
  members: IMember[];
9
10
  projects: IProject[];
10
11
  image: string;
11
12
  isCreator: boolean;
13
+ build_minutes: number;
14
+ build_minutes_last_reset_at: Date | null;
15
+ build_minutes_cycle_anchor: Date | null;
12
16
  build_disabled: boolean;
13
17
  build_disabled_by: BUILD_DISABLED_BY;
14
18
  subscription: ISubscription;
package/types/user.ts CHANGED
@@ -28,8 +28,10 @@ export interface IUser extends Document {
28
28
  build_disabled: boolean;
29
29
  build_disabled_by: BUILD_DISABLED_BY;
30
30
  spending_limit: number;
31
+ build_minutes: number;
31
32
  disabled: boolean;
32
33
  disabled_at: Date;
34
+ has_payment_method: boolean;
33
35
  notifications: {
34
36
  email: boolean;
35
37
  mute: boolean;
package/types/wallet.ts CHANGED
@@ -2,4 +2,7 @@ import { Document } from "mongoose";
2
2
 
3
3
  export interface IWallet extends Document {
4
4
  balance: number;
5
+ slug: string;
6
+ enabled: boolean;
7
+ provider: string;
5
8
  }
package/user.ts CHANGED
@@ -44,9 +44,11 @@ const userSchema: Schema = new Schema(
44
44
  tenant: { type: Schema.Types.ObjectId, ref: "Tenancy", required: false },
45
45
  is_waitlist: { type: Boolean, default: true },
46
46
  spending_limit: { type: Number },
47
+ build_minutes: { type: Number, default: 0 },
47
48
  notifications: Object,
48
49
  disabled: Boolean,
49
50
  disabled_at: Date,
51
+ has_payment_method: Boolean,
50
52
  },
51
53
  {
52
54
  timestamps: {
package/wallet.ts CHANGED
@@ -6,6 +6,18 @@ const walletSchema: Schema = new Schema({
6
6
  type: Number,
7
7
  required: true,
8
8
  },
9
+ enabled: {
10
+ type: Boolean,
11
+ default: true,
12
+ },
13
+ slug: {
14
+ type: String,
15
+ required: true,
16
+ },
17
+ provider: {
18
+ type: String,
19
+ required: true,
20
+ },
9
21
  });
10
22
 
11
23
  export default model<IWallet>("Wallet", walletSchema);
package/branch.ts DELETED
@@ -1,22 +0,0 @@
1
- import { Schema, model } from "mongoose";
2
- import { IBranch } from "./types";
3
- import { BRANCH_TYPE } from "./enum";
4
-
5
- const branchSchema = new Schema(
6
- {
7
- name: { type: String, required: true },
8
- type: { type: String, enum: Object.values(BRANCH_TYPE), required: true },
9
- gitRef: { type: String, required: true },
10
- project: { ref: "Project", type: Schema.Types.ObjectId, required: true },
11
- inherit_from: { ref: "Branch", type: Schema.Types.ObjectId },
12
- ancestors: [{ ref: "Branch", type: Schema.Types.ObjectId }],
13
- created_by: { ref: "User", type: Schema.Types.ObjectId, required: true },
14
- issue_comment_id: Number,
15
- pr_number: Number,
16
- },
17
- { timestamps: true },
18
- );
19
-
20
- branchSchema.index({ project: 1, name: 1 }, { unique: true });
21
-
22
- export default model<IBranch>("Branch", branchSchema);
package/dist/branch.js DELETED
@@ -1,17 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const mongoose_1 = require("mongoose");
4
- const enum_1 = require("./enum");
5
- const branchSchema = new mongoose_1.Schema({
6
- name: { type: String, required: true },
7
- type: { type: String, enum: Object.values(enum_1.BRANCH_TYPE), required: true },
8
- gitRef: { type: String, required: true },
9
- project: { ref: "Project", type: mongoose_1.Schema.Types.ObjectId, required: true },
10
- inherit_from: { ref: "Branch", type: mongoose_1.Schema.Types.ObjectId },
11
- ancestors: [{ ref: "Branch", type: mongoose_1.Schema.Types.ObjectId }],
12
- created_by: { ref: "User", type: mongoose_1.Schema.Types.ObjectId, required: true },
13
- issue_comment_id: Number,
14
- pr_number: Number,
15
- }, { timestamps: true });
16
- branchSchema.index({ project: 1, name: 1 }, { unique: true });
17
- exports.default = (0, mongoose_1.model)("Branch", branchSchema);
@@ -1,17 +0,0 @@
1
- import { Document } from "mongoose";
2
- import { BRANCH_TYPE } from "../enum";
3
- import { IProject } from "./project";
4
- import { IUser } from "./user";
5
- export interface IBranch extends Document {
6
- name: string;
7
- type: BRANCH_TYPE;
8
- gitRef: string;
9
- project: IProject;
10
- inherit_from?: IBranch;
11
- ancestors: IBranch[];
12
- created_by: IUser;
13
- pr_number?: number;
14
- issue_comment_id?: number;
15
- createdAt: Date;
16
- updatedAt: Date;
17
- }
package/types/branch.ts DELETED
@@ -1,18 +0,0 @@
1
- import { Document } from "mongoose";
2
- import { BRANCH_TYPE } from "../enum";
3
- import { IProject } from "./project";
4
- import { IUser } from "./user";
5
-
6
- export interface IBranch extends Document {
7
- name: string;
8
- type: BRANCH_TYPE;
9
- gitRef: string;
10
- project: IProject;
11
- inherit_from?: IBranch;
12
- ancestors: IBranch[];
13
- created_by: IUser;
14
- pr_number?: number;
15
- issue_comment_id?: number;
16
- createdAt: Date;
17
- updatedAt: Date;
18
- }
File without changes