@brimble/models 3.7.9 → 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 (145) 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 +2 -2
  8. package/collab-integration.ts +1 -0
  9. package/collab-push-subscription.ts +19 -0
  10. package/compute.ts +16 -6
  11. package/dist/activity-log.d.ts +30 -0
  12. package/dist/activity-log.js +61 -0
  13. package/dist/app-message.d.ts +30 -0
  14. package/dist/app-message.js +14 -0
  15. package/dist/cashier_subscription.d.ts +30 -0
  16. package/dist/cashier_subscription.js +27 -0
  17. package/dist/cashier_subscription_item.d.ts +30 -0
  18. package/dist/cashier_subscription_item.js +17 -0
  19. package/dist/collab-annotation.js +9 -2
  20. package/dist/collab-comment.js +2 -2
  21. package/dist/collab-integration.js +1 -0
  22. package/dist/collab-push-subscription.d.ts +30 -0
  23. package/dist/collab-push-subscription.js +14 -0
  24. package/dist/compute.js +15 -6
  25. package/dist/domain/index.js +10 -0
  26. package/dist/domain/transfer.d.ts +30 -0
  27. package/dist/domain/transfer.js +99 -0
  28. package/dist/enum/index.d.ts +36 -6
  29. package/dist/enum/index.js +41 -6
  30. package/dist/env.js +0 -8
  31. package/dist/environment-variable.d.ts +30 -0
  32. package/dist/environment-variable.js +16 -0
  33. package/dist/framework.js +5 -0
  34. package/dist/index.d.ts +15 -3
  35. package/dist/index.js +34 -5
  36. package/dist/invoice.d.ts +30 -0
  37. package/dist/invoice.js +28 -0
  38. package/dist/member.js +1 -0
  39. package/dist/ownership-transfer.d.ts +30 -0
  40. package/dist/ownership-transfer.js +35 -0
  41. package/dist/plan_configuration.js +3 -0
  42. package/dist/project/index.js +14 -6
  43. package/dist/project-environment.d.ts +30 -0
  44. package/dist/project-environment.js +13 -0
  45. package/dist/project-tag-assignment.d.ts +30 -0
  46. package/dist/project-tag-assignment.js +32 -0
  47. package/dist/project_analytics.d.ts +30 -0
  48. package/dist/project_analytics.js +18 -0
  49. package/dist/subscription.js +8 -0
  50. package/dist/{branch.d.ts → tag.d.ts} +2 -2
  51. package/dist/tag.js +29 -0
  52. package/dist/team.js +16 -0
  53. package/dist/types/activity-log.d.ts +18 -0
  54. package/dist/types/app-message.d.ts +15 -0
  55. package/dist/types/app-message.js +2 -0
  56. package/dist/types/cashier_subscription.d.ts +27 -0
  57. package/dist/types/cashier_subscription.js +2 -0
  58. package/dist/types/collab-annotation.d.ts +8 -1
  59. package/dist/types/collab-comment.d.ts +1 -1
  60. package/dist/types/collab-integration.d.ts +2 -0
  61. package/dist/types/collab-push-subscription.d.ts +12 -0
  62. package/dist/types/collab-push-subscription.js +2 -0
  63. package/dist/types/compute.d.ts +12 -2
  64. package/dist/types/domain/index.d.ts +3 -1
  65. package/dist/types/domain/transfer.d.ts +27 -0
  66. package/dist/types/domain/transfer.js +2 -0
  67. package/dist/types/env.d.ts +0 -3
  68. package/dist/types/environment-variable.d.ts +12 -0
  69. package/dist/types/environment-variable.js +2 -0
  70. package/dist/types/framework.d.ts +1 -0
  71. package/dist/types/index.d.ts +12 -1
  72. package/dist/types/invoice.d.ts +15 -0
  73. package/dist/types/invoice.js +2 -0
  74. package/dist/types/member.d.ts +2 -0
  75. package/dist/types/ownership-transfer.d.ts +12 -0
  76. package/dist/types/ownership-transfer.js +2 -0
  77. package/dist/types/plan_configuration.d.ts +3 -0
  78. package/dist/types/project/index.d.ts +4 -2
  79. package/dist/types/project-environment.d.ts +13 -0
  80. package/dist/types/project-environment.js +2 -0
  81. package/dist/types/project-tag-assignment.d.ts +13 -0
  82. package/dist/types/project-tag-assignment.js +2 -0
  83. package/dist/types/project_analytics.d.ts +11 -0
  84. package/dist/types/project_analytics.js +2 -0
  85. package/dist/types/subscription.d.ts +2 -0
  86. package/dist/types/tag.d.ts +11 -0
  87. package/dist/types/tag.js +2 -0
  88. package/dist/types/team.d.ts +4 -0
  89. package/dist/types/user.d.ts +2 -0
  90. package/dist/types/wallet.d.ts +3 -0
  91. package/dist/user.js +2 -0
  92. package/dist/wallet.js +12 -0
  93. package/domain/index.ts +10 -0
  94. package/domain/transfer.ts +112 -0
  95. package/enum/index.ts +40 -5
  96. package/env.ts +0 -8
  97. package/environment-variable.ts +21 -0
  98. package/framework.ts +5 -0
  99. package/index.ts +34 -5
  100. package/invoice.ts +36 -0
  101. package/member.ts +1 -0
  102. package/ownership-transfer.ts +42 -0
  103. package/package.json +1 -1
  104. package/plan_configuration.ts +3 -0
  105. package/project/index.ts +14 -6
  106. package/project-environment.ts +18 -0
  107. package/project-tag-assignment.ts +40 -0
  108. package/project_analytics.ts +26 -0
  109. package/subscription.ts +8 -0
  110. package/tag.ts +34 -0
  111. package/team.ts +16 -0
  112. package/types/activity-log.ts +19 -0
  113. package/types/app-message.ts +16 -0
  114. package/types/cashier_subscription.ts +29 -0
  115. package/types/collab-annotation.ts +8 -1
  116. package/types/collab-comment.ts +1 -1
  117. package/types/collab-integration.ts +2 -0
  118. package/types/collab-push-subscription.ts +10 -0
  119. package/types/compute.ts +14 -2
  120. package/types/domain/index.ts +3 -1
  121. package/types/domain/transfer.ts +32 -0
  122. package/types/env.ts +0 -3
  123. package/types/environment-variable.ts +13 -0
  124. package/types/framework.ts +3 -2
  125. package/types/index.ts +12 -1
  126. package/types/invoice.ts +16 -0
  127. package/types/member.ts +2 -0
  128. package/types/ownership-transfer.ts +13 -0
  129. package/types/plan_configuration.ts +3 -0
  130. package/types/project/index.ts +4 -2
  131. package/types/project-environment.ts +14 -0
  132. package/types/project-tag-assignment.ts +14 -0
  133. package/types/project_analytics.ts +12 -0
  134. package/types/subscription.ts +2 -0
  135. package/types/tag.ts +12 -0
  136. package/types/team.ts +4 -0
  137. package/types/user.ts +2 -0
  138. package/types/wallet.ts +3 -0
  139. package/user.ts +2 -0
  140. package/wallet.ts +12 -0
  141. package/branch.ts +0 -22
  142. package/dist/branch.js +0 -17
  143. package/dist/types/branch.d.ts +0 -17
  144. package/types/branch.ts +0 -18
  145. /package/dist/types/{branch.js → activity-log.js} +0 -0
@@ -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";
@@ -43,3 +44,13 @@ export type { ICollabComment, ICollabAttachment } from "./collab-comment";
43
44
  export type { ICollabIntegration } from "./collab-integration";
44
45
  export type { ICollabSettings } from "./collab-settings";
45
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,15 @@
1
+ import { Document } from "mongoose";
2
+ import { INVOICE_STATUS, INVOICE_PAYMENT_STATUS, INVOICE_TYPE } from "../enum";
3
+ export interface IInvoice extends Document {
4
+ ref: string;
5
+ user_id: string;
6
+ subscription_id: string;
7
+ total_amount: number;
8
+ due: boolean;
9
+ type: INVOICE_TYPE;
10
+ status: INVOICE_STATUS;
11
+ payment_status: INVOICE_PAYMENT_STATUS;
12
+ billing_period: string;
13
+ created_at: Date;
14
+ updated_at: Date;
15
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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
  export interface IMember extends Document {
6
7
  user: IUser;
7
8
  team: ITeam;
@@ -11,6 +12,7 @@ export interface IMember extends Document {
11
12
  email: string;
12
13
  featureOnboarded: boolean;
13
14
  permissions: IMemberPermission[];
15
+ project_environments: IProjectEnvironment[];
14
16
  createdAt: Date;
15
17
  updatedAt: Date;
16
18
  }
@@ -0,0 +1,12 @@
1
+ import { Document } from "mongoose";
2
+ import { ITeam } from "./team";
3
+ import { IUser } from "./user";
4
+ export interface IOwnershipTransfer extends Document {
5
+ team: ITeam;
6
+ from_user: IUser;
7
+ to_user: IUser;
8
+ status: "pending" | "accepted" | "denied" | "expired";
9
+ expires_at: Date;
10
+ created_at: Date;
11
+ updated_at: Date;
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -15,6 +15,8 @@ export interface IPlanConfiguration extends Document {
15
15
  build_minutes: number;
16
16
  log_retention: number;
17
17
  multi_region: boolean;
18
+ ai_debug_enabled: boolean;
19
+ ai_debug_limit: number;
18
20
  bandwidth: number;
19
21
  pull_request_preview: boolean;
20
22
  plan_type: SUBSCRIPTION_PLAN_TYPE;
@@ -30,4 +32,5 @@ export interface IPlanConfiguration extends Document {
30
32
  unlimited_projects: boolean;
31
33
  webhook_enabled: boolean;
32
34
  can_deploy_all_applications: boolean;
35
+ stripe_prices?: Record<string, string>;
33
36
  }
@@ -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
  export interface IProject extends Document {
15
15
  name: string;
@@ -33,6 +33,7 @@ export interface IProject extends Document {
33
33
  user_id: IUser;
34
34
  monitor_id: string;
35
35
  nomadJobId: string;
36
+ watchPaths: string[];
36
37
  repo: {
37
38
  name: string;
38
39
  full_name: string;
@@ -67,7 +68,8 @@ export interface IProject extends Document {
67
68
  tracking_token: string;
68
69
  from: string;
69
70
  previews: IPreview[];
70
- branches: IBranch[];
71
+ project_environment?: IProjectEnvironment;
72
+ inherit_environment_vars: boolean;
71
73
  replicas: number;
72
74
  vaultPath: string | null;
73
75
  vaultToken: string | null;
@@ -0,0 +1,13 @@
1
+ import { Document } from "mongoose";
2
+ import { ITeam } from "./team";
3
+ import { IUser } from "./user";
4
+ export interface IProjectEnvironment extends Document {
5
+ name: string;
6
+ slug: string;
7
+ owner: IUser;
8
+ team?: ITeam;
9
+ inherit_from?: IProjectEnvironment;
10
+ isDefault: boolean;
11
+ createdAt: Date;
12
+ updatedAt: Date;
13
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,13 @@
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
+ export interface IProjectTagAssignment extends Document {
7
+ tagId: ITag;
8
+ projectId: IProject;
9
+ teamId: ITeam;
10
+ assignedBy: IUser;
11
+ createdAt: Date;
12
+ updatedAt: Date;
13
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { Document, Types } from "mongoose";
2
+ export interface IProjectAnalytics extends Document {
3
+ project: Types.ObjectId;
4
+ provider: "umami";
5
+ websiteId: string;
6
+ shareId?: string | null;
7
+ domain: string;
8
+ enabled: boolean;
9
+ createdAt: Date;
10
+ updatedAt: Date;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -6,7 +6,9 @@ import { IProject } from "./project";
6
6
  export interface ISubscription extends Document {
7
7
  initial_start_date: string;
8
8
  team_id: ITeam;
9
+ due_amount: number;
9
10
  admin_id: IUser;
11
+ downgraded: boolean;
10
12
  billable_id: IUser;
11
13
  project_id?: IProject;
12
14
  plan_type: SUBSCRIPTION_PLAN_TYPE;
@@ -0,0 +1,11 @@
1
+ import { Document } from "mongoose";
2
+ import { ITeam } from "./team";
3
+ import { IUser } from "./user";
4
+ export interface ITag extends Document {
5
+ name: string;
6
+ color: string;
7
+ teamId: ITeam;
8
+ createdBy: IUser;
9
+ createdAt: Date;
10
+ updatedAt: Date;
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -4,10 +4,14 @@ import { BUILD_DISABLED_BY } from "../enum";
4
4
  export interface ITeam extends Document {
5
5
  name: string;
6
6
  description: string;
7
+ size: number;
7
8
  members: IMember[];
8
9
  projects: IProject[];
9
10
  image: string;
10
11
  isCreator: boolean;
12
+ build_minutes: number;
13
+ build_minutes_last_reset_at: Date | null;
14
+ build_minutes_cycle_anchor: Date | null;
11
15
  build_disabled: boolean;
12
16
  build_disabled_by: BUILD_DISABLED_BY;
13
17
  subscription: ISubscription;
@@ -27,8 +27,10 @@ export interface IUser extends Document {
27
27
  build_disabled: boolean;
28
28
  build_disabled_by: BUILD_DISABLED_BY;
29
29
  spending_limit: number;
30
+ build_minutes: number;
30
31
  disabled: boolean;
31
32
  disabled_at: Date;
33
+ has_payment_method: boolean;
32
34
  notifications: {
33
35
  email: boolean;
34
36
  mute: boolean;
@@ -1,4 +1,7 @@
1
1
  import { Document } from "mongoose";
2
2
  export interface IWallet extends Document {
3
3
  balance: number;
4
+ slug: string;
5
+ enabled: boolean;
6
+ provider: string;
4
7
  }
package/dist/user.js CHANGED
@@ -42,9 +42,11 @@ const userSchema = new mongoose_1.Schema({
42
42
  tenant: { type: mongoose_1.Schema.Types.ObjectId, ref: "Tenancy", required: false },
43
43
  is_waitlist: { type: Boolean, default: true },
44
44
  spending_limit: { type: Number },
45
+ build_minutes: { type: Number, default: 0 },
45
46
  notifications: Object,
46
47
  disabled: Boolean,
47
48
  disabled_at: Date,
49
+ has_payment_method: Boolean,
48
50
  }, {
49
51
  timestamps: {
50
52
  createdAt: "created_at",
package/dist/wallet.js CHANGED
@@ -6,5 +6,17 @@ const walletSchema = new mongoose_1.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
  exports.default = (0, mongoose_1.model)("Wallet", walletSchema);
package/domain/index.ts CHANGED
@@ -63,6 +63,10 @@ const domainSchema = new Schema(
63
63
  ref: "Subscription",
64
64
  type: Schema.Types.ObjectId,
65
65
  },
66
+ cashier_subscription_id: {
67
+ type: String,
68
+ default: null,
69
+ },
66
70
  nameservers: {
67
71
  type: Array,
68
72
  required: false,
@@ -87,6 +91,12 @@ const domainSchema = new Schema(
87
91
  type: Schema.Types.ObjectId,
88
92
  },
89
93
  ],
94
+ project_environment: {
95
+ ref: "ProjectEnvironment",
96
+ type: Schema.Types.ObjectId,
97
+ required: false,
98
+ default: null,
99
+ },
90
100
  is_pending_verification: Boolean,
91
101
  redirect: {
92
102
  url: String,
@@ -0,0 +1,112 @@
1
+ import { model, Schema } from "mongoose";
2
+ import { IDomainTransfer } from "../types";
3
+ import {
4
+ DomainTransferDirection,
5
+ DomainTransferProvider,
6
+ DomainTransferStatus,
7
+ } from "../enum";
8
+
9
+ const domainTransferSchema = new Schema(
10
+ {
11
+ domain_id: {
12
+ ref: "Domain",
13
+ type: Schema.Types.ObjectId,
14
+ required: true,
15
+ },
16
+ domain_name: {
17
+ type: String,
18
+ required: true,
19
+ trim: true,
20
+ },
21
+ user_id: {
22
+ ref: "User",
23
+ type: Schema.Types.ObjectId,
24
+ required: true,
25
+ },
26
+ team_id: {
27
+ ref: "Team",
28
+ type: Schema.Types.ObjectId,
29
+ required: false,
30
+ },
31
+ provider: {
32
+ type: String,
33
+ required: true,
34
+ enum: Object.values(DomainTransferProvider),
35
+ },
36
+ direction: {
37
+ type: String,
38
+ required: true,
39
+ enum: Object.values(DomainTransferDirection),
40
+ },
41
+ status: {
42
+ type: String,
43
+ required: true,
44
+ enum: Object.values(DomainTransferStatus),
45
+ },
46
+ provider_transfer_id: {
47
+ type: String,
48
+ required: false,
49
+ },
50
+ payment_reference: {
51
+ type: String,
52
+ required: false,
53
+ },
54
+ payment_token: {
55
+ type: String,
56
+ required: false,
57
+ },
58
+ payment_amount: {
59
+ type: Number,
60
+ required: false,
61
+ },
62
+ renewal_price: {
63
+ type: Number,
64
+ required: false,
65
+ },
66
+ auto_renewal: {
67
+ type: Boolean,
68
+ required: false,
69
+ },
70
+ privacy_enabled: {
71
+ type: Boolean,
72
+ required: false,
73
+ },
74
+ renewal_duration: {
75
+ type: Number,
76
+ required: false,
77
+ },
78
+ project_id: {
79
+ ref: "Project",
80
+ type: Schema.Types.ObjectId,
81
+ required: false,
82
+ },
83
+ last_polled_at: {
84
+ type: Date,
85
+ required: false,
86
+ },
87
+ poll_count: {
88
+ type: Number,
89
+ required: true,
90
+ default: 0,
91
+ min: 0,
92
+ },
93
+ last_provider_status: {
94
+ type: String,
95
+ required: false,
96
+ },
97
+ failure_reason: {
98
+ type: String,
99
+ required: false,
100
+ },
101
+ },
102
+ { timestamps: true },
103
+ );
104
+
105
+ domainTransferSchema.index({ status: 1, direction: 1 });
106
+ domainTransferSchema.index({ domain_id: 1 });
107
+
108
+ export default model<IDomainTransfer>(
109
+ "DomainTransfer",
110
+ domainTransferSchema,
111
+ "domain_transfers",
112
+ );
package/enum/index.ts CHANGED
@@ -16,6 +16,7 @@ export enum SERVER_PROTOCOL {
16
16
  export enum BUILD_DISABLED_BY {
17
17
  System = "system",
18
18
  User = "user",
19
+ Payment = "payment_failure"
19
20
  }
20
21
 
21
22
  export enum REQUEST_TYPE {
@@ -111,6 +112,7 @@ export enum ROLES {
111
112
  CREATOR = "CREATOR",
112
113
  ADMINISTRATOR = "ADMINISTRATOR",
113
114
  MEMBER = "MEMBER",
115
+ VIEWER = "VIEWER"
114
116
  }
115
117
 
116
118
  export enum PERMISSION_TYPE {
@@ -188,17 +190,30 @@ export enum DomainRenewalStatus {
188
190
  Failed = "failed",
189
191
  }
190
192
 
193
+ export enum DomainTransferProvider {
194
+ Dynadot = "dynadot",
195
+ NameDotCom = "name-dot-com",
196
+ NameCheap = "name-cheap",
197
+ }
198
+
199
+ export enum DomainTransferDirection {
200
+ TransferIn = "transfer_in",
201
+ TransferOut = "transfer_out",
202
+ }
203
+
204
+ export enum DomainTransferStatus {
205
+ Pending = "pending",
206
+ Completed = "completed",
207
+ Failed = "failed",
208
+ Cancelled = "cancelled",
209
+ }
210
+
191
211
  export enum NomadDeploymentStatus {
192
212
  NOMAD_SETUP = 'nomad_setup',
193
213
  NOMAD_READY = 'nomad_ready',
194
214
  NOMAD_FAILED = 'nomad_failed',
195
215
  }
196
216
 
197
- export enum BRANCH_TYPE {
198
- USER_CREATED = "USER_CREATED",
199
- PREVIEW = "PREVIEW",
200
- }
201
-
202
217
  export enum COLLAB_ANNOTATION_STATUS {
203
218
  OPEN = "open",
204
219
  RESOLVED = "resolved",
@@ -220,3 +235,23 @@ export enum COLLAB_TOOLBAR_POSITION {
220
235
  BOTTOM = "bottom",
221
236
  RIGHT = "right",
222
237
  }
238
+
239
+ export enum INVOICE_STATUS {
240
+ ACTIVE = "ACTIVE",
241
+ PAID = "PAID",
242
+ EXPIRED = "EXPIRED",
243
+ }
244
+
245
+ export enum INVOICE_PAYMENT_STATUS {
246
+ PENDING = "PENDING",
247
+ PROCESSING = "PROCESSING",
248
+ SUCCESSFUL = "SUCCESSFUL",
249
+ FAILED = "FAILED",
250
+ REFUNDED = "REFUNDED",
251
+ REFUND_PROCESSING = "REFUND_PROCESSING",
252
+ }
253
+
254
+ export enum INVOICE_TYPE {
255
+ INVOICE = "invoice",
256
+ RECEIPT = "receipt",
257
+ }
package/env.ts CHANGED
@@ -26,14 +26,6 @@ const envSchema = new Schema(
26
26
  default: ENVIRONMENT.PRODUCTION,
27
27
  required: true,
28
28
  },
29
- branch: {
30
- ref: "Branch",
31
- type: Schema.Types.ObjectId,
32
- },
33
- inheritable: {
34
- type: Boolean,
35
- default: true,
36
- },
37
29
  is_system: {
38
30
  type: Boolean,
39
31
  default: false,
@@ -0,0 +1,21 @@
1
+ import { model, Schema } from "mongoose";
2
+ import { IEnvironmentVariable } from "./types";
3
+
4
+ const environmentVariableSchema = new Schema(
5
+ {
6
+ name: { type: String, required: true },
7
+ value: { type: String, required: true },
8
+ project_environment: {
9
+ ref: "ProjectEnvironment",
10
+ type: Schema.Types.ObjectId,
11
+ required: true,
12
+ },
13
+ user: { ref: "User", type: Schema.Types.ObjectId, required: true },
14
+ inheritable: { type: Boolean, default: true },
15
+ },
16
+ { timestamps: true },
17
+ );
18
+
19
+ environmentVariableSchema.index({ name: 1, project_environment: 1 }, { unique: true });
20
+
21
+ export default model<IEnvironmentVariable>("EnvironmentVariable", environmentVariableSchema);
package/framework.ts CHANGED
@@ -25,6 +25,11 @@ const frameworkSchema: Schema = new Schema(
25
25
  required: false,
26
26
  default: true
27
27
  },
28
+ port: {
29
+ type: Number,
30
+ required: false,
31
+ default: 8000
32
+ },
28
33
  tagline: {
29
34
  type: String,
30
35
  required: false,
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,22 +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";
43
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";
44
56
 
45
57
  export {
46
58
  IUser,
47
59
  IGit,
48
60
  IProject,
61
+ IProjectAnalytics,
49
62
  IPreview,
50
63
  IProjectConnection,
51
64
  IFollowing,
@@ -78,18 +91,29 @@ export {
78
91
  ISettings,
79
92
  ILoadBalancerPort,
80
93
  IDomainRenewal,
94
+ IDomainTransfer,
81
95
  IWebhookCategory,
82
96
  IWebhookEvent,
83
97
  IWebhookSetting,
84
98
  IIntention,
85
99
  IProvider,
86
- IBranch,
87
100
  ICollabAnnotation,
88
101
  ICollabComment,
89
102
  ICollabAttachment,
90
103
  ICollabIntegration,
91
104
  ICollabSettings,
92
- ICollabShareToken
105
+ ICollabShareToken,
106
+ ICollabPushSubscription,
107
+ IAppMessage,
108
+ IInvoice,
109
+ ITag,
110
+ IProjectTagAssignment,
111
+ ICashierSubscription,
112
+ ICashierSubscriptionItem,
113
+ IProjectEnvironment,
114
+ IEnvironmentVariable,
115
+ IActivityLog,
116
+ IOwnershipTransfer,
93
117
  } from "./types";
94
118
  export {
95
119
  GIT_TYPE,
@@ -115,12 +139,17 @@ export {
115
139
  SERVER_PROTOCOL,
116
140
  FrameworkApplicationType,
117
141
  DomainRenewalStatus,
142
+ DomainTransferProvider,
143
+ DomainTransferDirection,
144
+ DomainTransferStatus,
118
145
  NomadDeploymentStatus,
119
- BRANCH_TYPE,
120
146
  COLLAB_ANNOTATION_STATUS,
121
147
  COLLAB_INTEGRATION_TYPE,
122
148
  COLLAB_THEME,
123
- COLLAB_TOOLBAR_POSITION
149
+ COLLAB_TOOLBAR_POSITION,
150
+ INVOICE_STATUS,
151
+ INVOICE_PAYMENT_STATUS,
152
+ INVOICE_TYPE
124
153
  } from "./enum";
125
154
 
126
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);