@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
@@ -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
  export interface IDomain extends Document {
5
5
  name: string;
@@ -10,6 +10,7 @@ export interface IDomain extends Document {
10
10
  preview: IPreview;
11
11
  provider: string;
12
12
  subscription: ISubscription;
13
+ cashier_subscription_id: string | null;
13
14
  auto_renewal: boolean;
14
15
  renewal_duration: number;
15
16
  is_discounted: boolean;
@@ -22,6 +23,7 @@ export interface IDomain extends Document {
22
23
  trigger_created_at: string;
23
24
  nameservers: string[];
24
25
  dns: IDns[];
26
+ project_environment?: IProjectEnvironment;
25
27
  is_pending_verification: boolean;
26
28
  redirect?: {
27
29
  url: string;
@@ -0,0 +1,27 @@
1
+ import { Document } from "mongoose";
2
+ import { IDomain, IProject, ITeam, IUser } from "../";
3
+ import { DomainTransferDirection, DomainTransferProvider, DomainTransferStatus } from "../../enum";
4
+ export interface IDomainTransfer extends Document {
5
+ domain_id: IDomain;
6
+ domain_name: string;
7
+ user_id: IUser;
8
+ team_id?: ITeam;
9
+ provider: DomainTransferProvider;
10
+ direction: DomainTransferDirection;
11
+ status: DomainTransferStatus;
12
+ provider_transfer_id?: string;
13
+ payment_reference?: string;
14
+ payment_token?: string;
15
+ payment_amount?: number;
16
+ renewal_price?: number;
17
+ auto_renewal?: boolean;
18
+ privacy_enabled?: boolean;
19
+ renewal_duration?: number;
20
+ project_id?: IProject;
21
+ last_polled_at?: Date;
22
+ poll_count: number;
23
+ last_provider_status?: string;
24
+ failure_reason?: string;
25
+ createdAt: Date;
26
+ updatedAt: Date;
27
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -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
  export interface IEnv extends Document {
6
5
  name: string;
@@ -8,8 +7,6 @@ export interface IEnv extends Document {
8
7
  project: IProject;
9
8
  user: IUser;
10
9
  environment: ENVIRONMENT | string;
11
- branch?: IBranch;
12
- inheritable?: boolean;
13
10
  is_system?: boolean;
14
11
  createdAt: Date;
15
12
  updatedAt: Date;
@@ -0,0 +1,12 @@
1
+ import { Document } from "mongoose";
2
+ import { IProjectEnvironment } from "./project-environment";
3
+ import { IUser } from "./user";
4
+ export interface IEnvironmentVariable extends Document {
5
+ name: string;
6
+ value: string;
7
+ project_environment: IProjectEnvironment;
8
+ user: IUser;
9
+ inheritable: boolean;
10
+ createdAt: Date;
11
+ updatedAt: Date;
12
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -9,6 +9,7 @@ export interface IFramework extends Document {
9
9
  supported: boolean;
10
10
  description?: string;
11
11
  website: string;
12
+ port: number;
12
13
  envPrefix?: string;
13
14
  detector: string;
14
15
  file_detectors: string[];
@@ -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,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,