@brimble/models 3.8.77 → 3.8.79

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 (300) hide show
  1. package/dist/activity-log.d.ts +6 -27
  2. package/dist/alert-event.d.ts +9 -0
  3. package/dist/alert-event.js +78 -0
  4. package/dist/alert-rule-state.d.ts +9 -0
  5. package/dist/alert-rule-state.js +49 -0
  6. package/dist/alert-rule.d.ts +9 -0
  7. package/dist/alert-rule.js +77 -0
  8. package/dist/app-message.d.ts +6 -27
  9. package/dist/app-message.js +2 -2
  10. package/dist/auto-scaling.d.ts +6 -27
  11. package/dist/card.d.ts +6 -27
  12. package/dist/cashier_subscription.d.ts +6 -27
  13. package/dist/cashier_subscription_item.d.ts +6 -27
  14. package/dist/collab-annotation.d.ts +6 -27
  15. package/dist/collab-comment.d.ts +6 -27
  16. package/dist/collab-integration.d.ts +6 -27
  17. package/dist/collab-push-subscription.d.ts +6 -27
  18. package/dist/collab-settings.d.ts +6 -27
  19. package/dist/collab-share-token.d.ts +6 -27
  20. package/dist/compute.d.ts +6 -27
  21. package/dist/compute.js +6 -0
  22. package/dist/db-image.d.ts +6 -27
  23. package/dist/db-image.js +19 -0
  24. package/dist/domain/dns-changelog.d.ts +9 -0
  25. package/dist/domain/dns-changelog.js +82 -0
  26. package/dist/domain/dns.d.ts +6 -27
  27. package/dist/domain/index.d.ts +6 -27
  28. package/dist/domain/index.js +4 -0
  29. package/dist/domain/renewal.d.ts +6 -27
  30. package/dist/domain/transfer.d.ts +6 -27
  31. package/dist/enum/index.d.ts +184 -0
  32. package/dist/enum/index.js +273 -37
  33. package/dist/env.d.ts +6 -27
  34. package/dist/environment-variable.d.ts +6 -27
  35. package/dist/environment-variable.js +8 -0
  36. package/dist/follower.d.ts +6 -27
  37. package/dist/following.d.ts +6 -27
  38. package/dist/framework.d.ts +6 -27
  39. package/dist/idempotency.d.ts +9 -0
  40. package/dist/idempotency.js +17 -0
  41. package/dist/index.d.ts +25 -2
  42. package/dist/index.js +92 -3
  43. package/dist/integration.d.ts +6 -27
  44. package/dist/intention.d.ts +6 -27
  45. package/dist/invoice.d.ts +6 -27
  46. package/dist/job.d.ts +6 -2
  47. package/dist/job.js +17 -7
  48. package/dist/license.d.ts +6 -27
  49. package/dist/load-balancer-port.d.ts +6 -27
  50. package/dist/logs.d.ts +6 -27
  51. package/dist/logs.js +0 -2
  52. package/dist/member-permission.d.ts +6 -27
  53. package/dist/member.d.ts +6 -27
  54. package/dist/object-storage-usage-segment.d.ts +9 -0
  55. package/dist/object-storage-usage-segment.js +46 -0
  56. package/dist/ownership-transfer.d.ts +6 -27
  57. package/dist/permission.d.ts +6 -27
  58. package/dist/plan_configuration.d.ts +6 -2
  59. package/dist/plan_configuration.js +22 -0
  60. package/dist/project/connection.d.ts +6 -27
  61. package/dist/project/index.d.ts +12 -29
  62. package/dist/project/index.js +29 -0
  63. package/dist/project/preview.d.ts +6 -27
  64. package/dist/project-environment.d.ts +6 -27
  65. package/dist/project-network-settings.d.ts +9 -0
  66. package/dist/project-network-settings.js +34 -0
  67. package/dist/project-tag-assignment.d.ts +6 -27
  68. package/dist/project_analytics.d.ts +6 -27
  69. package/dist/provider.d.ts +6 -27
  70. package/dist/provider.js +1 -0
  71. package/dist/quest-campaign.d.ts +9 -0
  72. package/dist/quest-campaign.js +39 -0
  73. package/dist/quest-participation.d.ts +9 -0
  74. package/dist/quest-participation.js +21 -0
  75. package/dist/quest-reward-issuance.d.ts +9 -0
  76. package/dist/quest-reward-issuance.js +19 -0
  77. package/dist/ratelimit.d.ts +9 -0
  78. package/dist/ratelimit.js +36 -0
  79. package/dist/region.d.ts +7 -28
  80. package/dist/role.d.ts +6 -27
  81. package/dist/sandbox-activity.d.ts +9 -0
  82. package/dist/sandbox-activity.js +49 -0
  83. package/dist/sandbox-image.d.ts +9 -0
  84. package/dist/sandbox-image.js +31 -0
  85. package/dist/sandbox-snapshot-usage-segment.d.ts +9 -0
  86. package/dist/sandbox-snapshot-usage-segment.js +49 -0
  87. package/dist/sandbox-snapshot.d.ts +9 -0
  88. package/dist/sandbox-snapshot.js +51 -0
  89. package/dist/sandbox-usage-segment.d.ts +9 -0
  90. package/dist/sandbox-usage-segment.js +57 -0
  91. package/dist/sandbox.d.ts +9 -0
  92. package/dist/sandbox.js +142 -0
  93. package/dist/server.d.ts +6 -27
  94. package/dist/settings.d.ts +6 -27
  95. package/dist/storage.d.ts +43 -0
  96. package/dist/storage.js +118 -0
  97. package/dist/streak-day.d.ts +9 -0
  98. package/dist/streak-day.js +11 -0
  99. package/dist/streak-event.d.ts +9 -0
  100. package/dist/streak-event.js +18 -0
  101. package/dist/streak-milestone.d.ts +9 -0
  102. package/dist/streak-milestone.js +11 -0
  103. package/dist/streak.d.ts +9 -0
  104. package/dist/streak.js +17 -0
  105. package/dist/subscription.d.ts +6 -27
  106. package/dist/tag.d.ts +6 -27
  107. package/dist/team.d.ts +6 -27
  108. package/dist/team.js +26 -0
  109. package/dist/token.d.ts +6 -27
  110. package/dist/types/alert-event.d.ts +23 -0
  111. package/dist/types/alert-event.js +2 -0
  112. package/dist/types/alert-rule-state.d.ts +13 -0
  113. package/dist/types/alert-rule-state.js +2 -0
  114. package/dist/types/alert-rule.d.ts +21 -0
  115. package/dist/types/alert-rule.js +2 -0
  116. package/dist/types/app-message.d.ts +2 -2
  117. package/dist/types/auto-scaling-group.d.ts +1 -1
  118. package/dist/types/compute.d.ts +3 -1
  119. package/dist/types/db-image.d.ts +5 -1
  120. package/dist/types/domain/dns-changelog.d.ts +20 -0
  121. package/dist/types/domain/dns-changelog.js +2 -0
  122. package/dist/types/domain/index.d.ts +1 -0
  123. package/dist/types/environment-variable.d.ts +2 -0
  124. package/dist/types/idempotency.d.ts +10 -0
  125. package/dist/types/idempotency.js +2 -0
  126. package/dist/types/index.d.ts +23 -0
  127. package/dist/types/object-storage-usage-segment.d.ts +23 -0
  128. package/dist/types/object-storage-usage-segment.js +2 -0
  129. package/dist/types/plan_configuration.d.ts +22 -0
  130. package/dist/types/project/index.d.ts +7 -0
  131. package/dist/types/project-network-settings.d.ts +28 -0
  132. package/dist/types/project-network-settings.js +2 -0
  133. package/dist/types/provider.d.ts +1 -0
  134. package/dist/types/quest-campaign.d.ts +38 -0
  135. package/dist/types/quest-campaign.js +2 -0
  136. package/dist/types/quest-participation.d.ts +19 -0
  137. package/dist/types/quest-participation.js +2 -0
  138. package/dist/types/quest-reward-issuance.d.ts +17 -0
  139. package/dist/types/quest-reward-issuance.js +2 -0
  140. package/dist/types/ratelimit.d.ts +41 -0
  141. package/dist/types/ratelimit.js +2 -0
  142. package/dist/types/region.d.ts +2 -2
  143. package/dist/types/sandbox-activity.d.ts +14 -0
  144. package/dist/types/sandbox-activity.js +2 -0
  145. package/dist/types/sandbox-image.d.ts +9 -0
  146. package/dist/types/sandbox-image.js +2 -0
  147. package/dist/types/sandbox-snapshot-usage-segment.d.ts +16 -0
  148. package/dist/types/sandbox-snapshot-usage-segment.js +2 -0
  149. package/dist/types/sandbox-snapshot.d.ts +16 -0
  150. package/dist/types/sandbox-snapshot.js +2 -0
  151. package/dist/types/sandbox-usage-segment.d.ts +25 -0
  152. package/dist/types/sandbox-usage-segment.js +2 -0
  153. package/dist/types/sandbox.d.ts +46 -0
  154. package/dist/types/sandbox.js +2 -0
  155. package/dist/types/storage.d.ts +131 -0
  156. package/dist/types/storage.js +2 -0
  157. package/dist/types/streak-day.d.ts +9 -0
  158. package/dist/types/streak-day.js +2 -0
  159. package/dist/types/streak-event.d.ts +13 -0
  160. package/dist/types/streak-event.js +2 -0
  161. package/dist/types/streak-milestone.d.ts +10 -0
  162. package/dist/types/streak-milestone.js +2 -0
  163. package/dist/types/streak.d.ts +17 -0
  164. package/dist/types/streak.js +2 -0
  165. package/dist/types/team.d.ts +8 -2
  166. package/dist/types/user.d.ts +4 -0
  167. package/dist/types/volume-usage-segment.d.ts +16 -0
  168. package/dist/types/volume-usage-segment.js +2 -0
  169. package/dist/types/volume.d.ts +9 -3
  170. package/dist/types/wallet.d.ts +1 -0
  171. package/dist/user.d.ts +6 -27
  172. package/dist/user.js +14 -0
  173. package/dist/volume-usage-segment.d.ts +9 -0
  174. package/dist/volume-usage-segment.js +46 -0
  175. package/dist/volume.d.ts +6 -27
  176. package/dist/volume.js +21 -4
  177. package/dist/wallet.d.ts +6 -27
  178. package/dist/wallet.js +4 -0
  179. package/dist/webhook-category.d.ts +6 -27
  180. package/dist/webhook-event.d.ts +6 -27
  181. package/dist/webhook-setting.d.ts +6 -27
  182. package/package.json +9 -5
  183. package/.claude/settings.local.json +0 -7
  184. package/.eslintrc.js +0 -26
  185. package/.prettierrc +0 -4
  186. package/activity-log.ts +0 -66
  187. package/app-message.ts +0 -18
  188. package/auto-scaling.ts +0 -72
  189. package/card.ts +0 -45
  190. package/cashier_subscription.ts +0 -35
  191. package/cashier_subscription_item.ts +0 -25
  192. package/collab-annotation.ts +0 -36
  193. package/collab-comment.ts +0 -27
  194. package/collab-integration.ts +0 -21
  195. package/collab-push-subscription.ts +0 -19
  196. package/collab-settings.ts +0 -29
  197. package/collab-share-token.ts +0 -15
  198. package/compute.ts +0 -88
  199. package/db-image.ts +0 -66
  200. package/domain/dns.ts +0 -34
  201. package/domain/index.ts +0 -109
  202. package/domain/renewal.ts +0 -25
  203. package/domain/transfer.ts +0 -112
  204. package/enum/index.ts +0 -257
  205. package/env.ts +0 -38
  206. package/environment-variable.ts +0 -21
  207. package/follower.ts +0 -19
  208. package/following.ts +0 -19
  209. package/framework.ts +0 -88
  210. package/index.ts +0 -199
  211. package/integration.ts +0 -39
  212. package/intention.ts +0 -40
  213. package/invoice.ts +0 -36
  214. package/job.ts +0 -30
  215. package/load-balancer-port.ts +0 -31
  216. package/logs.ts +0 -47
  217. package/member-permission.ts +0 -13
  218. package/member.ts +0 -44
  219. package/ownership-transfer.ts +0 -42
  220. package/permission.ts +0 -13
  221. package/plan_configuration.ts +0 -48
  222. package/project/connection.ts +0 -21
  223. package/project/index.ts +0 -238
  224. package/project/preview.ts +0 -41
  225. package/project-environment.ts +0 -18
  226. package/project-tag-assignment.ts +0 -40
  227. package/project_analytics.ts +0 -26
  228. package/provider.ts +0 -11
  229. package/region.ts +0 -18
  230. package/role.ts +0 -12
  231. package/server.ts +0 -105
  232. package/settings.ts +0 -53
  233. package/subscription.ts +0 -86
  234. package/tag.ts +0 -34
  235. package/team.ts +0 -60
  236. package/token.ts +0 -40
  237. package/tsconfig.json +0 -14
  238. package/types/activity-log.ts +0 -19
  239. package/types/app-message.ts +0 -16
  240. package/types/auto-scaling-group.ts +0 -21
  241. package/types/card.ts +0 -20
  242. package/types/cashier_subscription.ts +0 -29
  243. package/types/collab-annotation.ts +0 -28
  244. package/types/collab-comment.ts +0 -22
  245. package/types/collab-integration.ts +0 -14
  246. package/types/collab-push-subscription.ts +0 -10
  247. package/types/collab-settings.ts +0 -17
  248. package/types/collab-share-token.ts +0 -13
  249. package/types/compute.ts +0 -51
  250. package/types/db-image.ts +0 -18
  251. package/types/domain/dns.ts +0 -13
  252. package/types/domain/index.ts +0 -35
  253. package/types/domain/renewal.ts +0 -11
  254. package/types/domain/transfer.ts +0 -32
  255. package/types/env.ts +0 -14
  256. package/types/environment-variable.ts +0 -13
  257. package/types/following.ts +0 -6
  258. package/types/framework.ts +0 -41
  259. package/types/git.ts +0 -15
  260. package/types/index.ts +0 -56
  261. package/types/installed_integration.ts +0 -9
  262. package/types/integration.ts +0 -24
  263. package/types/intention.ts +0 -14
  264. package/types/invoice.ts +0 -16
  265. package/types/job.ts +0 -20
  266. package/types/license.ts +0 -19
  267. package/types/load-balancer-port.ts +0 -13
  268. package/types/logs.ts +0 -36
  269. package/types/member-permission.ts +0 -11
  270. package/types/member.ts +0 -19
  271. package/types/ownership-transfer.ts +0 -13
  272. package/types/permission.ts +0 -19
  273. package/types/plan_configuration.ts +0 -35
  274. package/types/project/connection.ts +0 -7
  275. package/types/project/index.ts +0 -96
  276. package/types/project/preview.ts +0 -22
  277. package/types/project-environment.ts +0 -14
  278. package/types/project-tag-assignment.ts +0 -14
  279. package/types/project_analytics.ts +0 -12
  280. package/types/provider.ts +0 -8
  281. package/types/region.ts +0 -16
  282. package/types/role.ts +0 -13
  283. package/types/server.ts +0 -59
  284. package/types/settings.ts +0 -19
  285. package/types/subscription.ts +0 -34
  286. package/types/tag.ts +0 -12
  287. package/types/team.ts +0 -19
  288. package/types/token.ts +0 -12
  289. package/types/user.ts +0 -41
  290. package/types/volume.ts +0 -15
  291. package/types/wallet.ts +0 -8
  292. package/types/webhook-category.ts +0 -5
  293. package/types/webhook-event.ts +0 -8
  294. package/types/webhook-setting.ts +0 -17
  295. package/user.ts +0 -61
  296. package/volume.ts +0 -36
  297. package/wallet.ts +0 -23
  298. package/webhook-category.ts +0 -11
  299. package/webhook-event.ts +0 -20
  300. package/webhook-setting.ts +0 -48
package/env.ts DELETED
@@ -1,38 +0,0 @@
1
- import { model, Schema } from "mongoose";
2
- import { ENVIRONMENT } from "./enum";
3
- import { IEnv } from "./types";
4
-
5
- const envSchema = new Schema(
6
- {
7
- project: {
8
- ref: "Project",
9
- type: Schema.Types.ObjectId,
10
- },
11
- name: {
12
- type: String,
13
- required: true,
14
- },
15
- value: {
16
- type: String,
17
- required: false,
18
- },
19
- user: {
20
- type: Schema.Types.ObjectId,
21
- ref: "User",
22
- required: true,
23
- },
24
- environment: {
25
- type: String,
26
- default: ENVIRONMENT.PRODUCTION,
27
- required: true,
28
- },
29
- is_system: {
30
- type: Boolean,
31
- default: false,
32
- required: false,
33
- },
34
- },
35
- { timestamps: true },
36
- );
37
-
38
- export default model<IEnv>("Env", envSchema);
@@ -1,21 +0,0 @@
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/follower.ts DELETED
@@ -1,19 +0,0 @@
1
- import { model, Schema } from "mongoose";
2
- import { IFollowing } from "./types";
3
-
4
- const followingSchema: Schema = new Schema(
5
- {
6
- user_id: {
7
- type: Schema.Types.ObjectId,
8
- ref: "User",
9
- required: true,
10
- },
11
- followed_id: {
12
- type: Schema.Types.ObjectId,
13
- required: true,
14
- },
15
- },
16
- { timestamps: true },
17
- );
18
-
19
- export default model<IFollowing>("Following", followingSchema);
package/following.ts DELETED
@@ -1,19 +0,0 @@
1
- import { model, Schema } from "mongoose";
2
- import { IFollowing } from "./types";
3
-
4
- const followingSchema: Schema = new Schema(
5
- {
6
- user_id: {
7
- type: Schema.Types.ObjectId,
8
- ref: "User",
9
- required: true,
10
- },
11
- followed_id: {
12
- type: Schema.Types.ObjectId,
13
- required: true,
14
- },
15
- },
16
- { timestamps: true },
17
- );
18
-
19
- export default model<IFollowing>("Following", followingSchema);
package/framework.ts DELETED
@@ -1,88 +0,0 @@
1
- import { model, Schema } from "mongoose";
2
- import { IFramework } from "./types";
3
- import { FrameworkApplicationType } from "./enum";
4
-
5
- const frameworkSchema: Schema = new Schema(
6
- {
7
- name: {
8
- type: String,
9
- required: true,
10
- },
11
- slug: {
12
- type: String,
13
- required: true,
14
- },
15
- demo: {
16
- type: String,
17
- required: false,
18
- },
19
- logo: {
20
- type: String,
21
- required: true,
22
- },
23
- supported: {
24
- type: Boolean,
25
- required: false,
26
- default: true
27
- },
28
- port: {
29
- type: Number,
30
- required: false,
31
- default: 8000
32
- },
33
- tagline: {
34
- type: String,
35
- required: false,
36
- },
37
- description: {
38
- type: String,
39
- required: false,
40
- },
41
- website: {
42
- type: String,
43
- required: true,
44
- },
45
- envPrefix: {
46
- type: String,
47
- required: false,
48
- },
49
- detector: {
50
- type: String,
51
- required: true,
52
- },
53
- file_detectors: {
54
- type: Array,
55
- required: false
56
- },
57
- type: {
58
- type: String,
59
- enum: Object.values(FrameworkApplicationType),
60
- required: true,
61
- },
62
- settings: {
63
- installCommand: {
64
- type: String,
65
- required: false,
66
- },
67
- buildCommand: {
68
- type: String,
69
- required: true,
70
- },
71
- outputDirectory: {
72
- type: String,
73
- required: true,
74
- },
75
- manager: {
76
- type: String,
77
- required: false,
78
- },
79
- startCommand: {
80
- type: String,
81
- required: false,
82
- },
83
- },
84
- },
85
- { timestamps: true },
86
- );
87
-
88
- export default model<IFramework>("Framework", frameworkSchema, "frameworks");
package/index.ts DELETED
@@ -1,199 +0,0 @@
1
- export { default as User } from "./user";
2
- export { default as Project, DeletedProject } from "./project";
3
- export { default as ProjectAnalytics } from "./project_analytics";
4
- export { default as Preview } from "./project/preview";
5
- export { default as ProjectConnection } from "./project/connection";
6
- export { default as Following } from "./following";
7
- export { default as Integration } from "./integration";
8
- export { default as Domain } from "./domain";
9
- export { default as Dns } from "./domain/dns";
10
- export { default as Env } from "./env";
11
- export { default as Token } from "./token";
12
- export { default as Team } from "./team";
13
- export { default as Member } from "./member";
14
- export { default as Permission } from "./permission";
15
- export { default as MemberPermission } from "./member-permission";
16
- export { default as Role } from "./role";
17
- export { default as Log } from "./logs";
18
- export { default as Subscription } from "./subscription";
19
- export { default as Card } from "./card";
20
- export { default as Server } from "./server";
21
- export { default as Wallet } from "./wallet";
22
- export { default as DbImage } from "./db-image";
23
- export { default as Job } from "./job";
24
- export { default as Liscense } from "./license";
25
- export { default as PlanConfiguration } from "./plan_configuration";
26
- export { default as AutoScalingGroup } from "./auto-scaling";
27
- export { default as ComputeChange } from "./compute";
28
- export { default as Region } from "./region";
29
- export { default as Volume } from "./volume";
30
- export { default as Framework } from "./framework";
31
- export { default as Settings } from "./settings";
32
- export { default as LoadBalancerPort } from "./load-balancer-port";
33
- export { default as DomainRenewal } from "./domain/renewal";
34
- export { default as DomainTransfer } from "./domain/transfer";
35
- export { default as WebhookCategory } from "./webhook-category";
36
- export { default as WebhookEvent } from "./webhook-event";
37
- export { default as WebhookSetting } from "./webhook-setting";
38
- export { default as Intention } from "./intention";
39
- export { default as Provider } from "./provider";
40
- export { default as CollabAnnotation } from "./collab-annotation";
41
- export { default as CollabComment } from "./collab-comment";
42
- export { default as CollabIntegration } from "./collab-integration";
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";
56
-
57
- export {
58
- IUser,
59
- IGit,
60
- IProject,
61
- IProjectAnalytics,
62
- IPreview,
63
- IProjectConnection,
64
- IFollowing,
65
- IIntegration,
66
- IEnv,
67
- IServer,
68
- IDomain,
69
- IToken,
70
- IMember,
71
- ITeam,
72
- IInstalledIntegration,
73
- ILog,
74
- ISubscription,
75
- ICard,
76
- IDns,
77
- IRole,
78
- IPermission,
79
- IMemberPermission,
80
- IWallet,
81
- IDbImage,
82
- IJob,
83
- ILicense,
84
- IPlanConfiguration,
85
- IAutoScalingGroup,
86
- IComputeChange,
87
- IRegion,
88
- IVolume,
89
- IFramework,
90
- BrimbleFrameworkType,
91
- ISettings,
92
- ILoadBalancerPort,
93
- IDomainRenewal,
94
- IDomainTransfer,
95
- IWebhookCategory,
96
- IWebhookEvent,
97
- IWebhookSetting,
98
- IIntention,
99
- IProvider,
100
- ICollabAnnotation,
101
- ICollabComment,
102
- ICollabAttachment,
103
- ICollabIntegration,
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,
117
- } from "./types";
118
- export {
119
- GIT_TYPE,
120
- INTEGRATION_TYPES,
121
- INTEGRATION_PROVIDERS,
122
- OAUTH_PERMISSIONS,
123
- ENVIRONMENT,
124
- SERVER_STATUS,
125
- ROLES,
126
- SUBSCRIPTION_PLAN_TYPE,
127
- PROJECT_STATUS,
128
- SUBSCRIPTION_STATUS,
129
- CARD_TYPES,
130
- DNS_TYPE,
131
- PERMISSION_TYPE,
132
- REQUEST_TYPE,
133
- ServiceType,
134
- DatabaseEngine,
135
- JobStatus,
136
- LicenseStatus,
137
- REGION_CONTINENT,
138
- BUILD_DISABLED_BY,
139
- SERVER_PROTOCOL,
140
- FrameworkApplicationType,
141
- DomainRenewalStatus,
142
- DomainTransferProvider,
143
- DomainTransferDirection,
144
- DomainTransferStatus,
145
- NomadDeploymentStatus,
146
- COLLAB_ANNOTATION_STATUS,
147
- COLLAB_INTEGRATION_TYPE,
148
- COLLAB_THEME,
149
- COLLAB_TOOLBAR_POSITION,
150
- INVOICE_STATUS,
151
- INVOICE_PAYMENT_STATUS,
152
- INVOICE_TYPE
153
- } from "./enum";
154
-
155
- import mongoose from "mongoose";
156
- import { log } from "@brimble/utils";
157
-
158
- export const connectToMongo = async (
159
- mongoUrl: string,
160
- config?: mongoose.ConnectOptions,
161
- ): Promise<void> => {
162
- const options: mongoose.ConnectOptions = {
163
- socketTimeoutMS: 30000,
164
- maxPoolSize: 10,
165
- ...config,
166
- };
167
-
168
- mongoose.connect(mongoUrl, options).catch((err) => {
169
- log.error(`Unable to connect to mongo db, ${err}`);
170
- });
171
-
172
- // listen for connection
173
- mongoose.connection.on("connected", () => {
174
- console.log("Database connection successful 🚀");
175
- });
176
-
177
- // listen for error
178
- mongoose.connection.on("error", ({ message }) => {
179
- log.error(`Error connecting to DB`, message);
180
- return process.exit(1);
181
- });
182
- };
183
-
184
- export const db = mongoose.connection;
185
-
186
- export const closeMongo = () => mongoose.connection.close(true);
187
-
188
- export const healthCheckMongo = async (): Promise<boolean> => {
189
- try {
190
- if (mongoose.connection.readyState !== 1) {
191
- return false;
192
- }
193
- await mongoose.connection.db.admin().ping();
194
- return true;
195
- } catch (error) {
196
- log.error(`MongoDB health check failed`, error);
197
- return false;
198
- }
199
- };
package/integration.ts DELETED
@@ -1,39 +0,0 @@
1
- import { model, Schema } from "mongoose";
2
- import { INTEGRATION_PROVIDERS, INTEGRATION_TYPES } from "./enum";
3
- import { IIntegration } from "./types";
4
-
5
- const integrationSchema: Schema = new Schema(
6
- {
7
- user_id: {
8
- type: Schema.Types.ObjectId,
9
- ref: "User",
10
- default: null,
11
- required: true,
12
- },
13
- team_id: {
14
- type: Schema.Types.ObjectId,
15
- ref: "Team",
16
- default: null,
17
- required: false,
18
- },
19
- name: {
20
- type: String,
21
- enum: Object.values(INTEGRATION_PROVIDERS),
22
- required: true,
23
- },
24
- app_id: String,
25
- hook: String,
26
- scope_description: Array,
27
- reference: String,
28
- type: {
29
- type: String,
30
- enum: Object.values(INTEGRATION_TYPES),
31
- required: true,
32
- },
33
- token: String,
34
- extra: Object,
35
- },
36
- { timestamps: true },
37
- );
38
-
39
- export default model<IIntegration>("Integration", integrationSchema);
package/intention.ts DELETED
@@ -1,40 +0,0 @@
1
- import { model, Schema } from "mongoose";
2
- import { IIntention } from "./types";
3
-
4
- const intentionSchema = new Schema(
5
- {
6
- project: {
7
- ref: "Project",
8
- type: Schema.Types.ObjectId,
9
- required: true,
10
- },
11
- sourceName: {
12
- type: String,
13
- required: true,
14
- },
15
- destinationName: {
16
- type: String,
17
- required: true,
18
- },
19
- sourceNamespace: {
20
- type: String,
21
- default: "default",
22
- },
23
- destinationNamespace: {
24
- type: String,
25
- default: "default",
26
- },
27
- action: {
28
- type: String,
29
- enum: ["allow", "deny"],
30
- default: "allow",
31
- },
32
- description: {
33
- type: String,
34
- required: false,
35
- },
36
- },
37
- { timestamps: true },
38
- );
39
-
40
- export default model<IIntention>("Intention", intentionSchema);
package/invoice.ts DELETED
@@ -1,36 +0,0 @@
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/job.ts DELETED
@@ -1,30 +0,0 @@
1
- import mongoose, { model, Schema } from "mongoose";
2
- import { IJob } from "./types/job";
3
- import { JobStatus } from "./enum";
4
-
5
- const jobSchema: Schema = new Schema({
6
- title: { type: String, required: true },
7
- jobId: { type: String, required: true, unique: true },
8
- url: { type: String, required: true },
9
- method: { type: String, required: true },
10
- schedule: { type: String, required: true },
11
- headers: { type: Map, of: String },
12
- maxAttempts: { type: Number, default: 5 },
13
- attempts: { type: Number, default: 0 },
14
- isRecurring: { type: Boolean, required: true },
15
- lastRun: Date,
16
- nextRun: Date,
17
- body: {
18
- type: mongoose.Schema.Types.Mixed,
19
- required: false,
20
- },
21
- status: {
22
- type: String,
23
- enum: Object.values(JobStatus),
24
- default: JobStatus.SCHEDULED,
25
- },
26
- createdAt: { type: Date, default: Date.now },
27
- updatedAt: { type: Date, default: Date.now },
28
- });
29
-
30
- export default model<IJob>("Job", jobSchema, "scheduled_jobs");
@@ -1,31 +0,0 @@
1
- import { model, Schema } from "mongoose";
2
- import { ILoadBalancerPort } from "./types";
3
-
4
- const loadBalancerPortSchema = new Schema(
5
- {
6
- port: {
7
- type: Number,
8
- required: true,
9
- min: 1,
10
- max: 65535,
11
- },
12
- server_id: {
13
- type: Schema.Types.ObjectId,
14
- ref: "Server",
15
- required: true,
16
- },
17
- project_id: {
18
- type: Schema.Types.ObjectId,
19
- ref: "Project",
20
- required: true,
21
- },
22
- region_id: {
23
- type: Schema.Types.ObjectId,
24
- ref: "Region",
25
- required: true,
26
- },
27
- },
28
- { timestamps: true },
29
- );
30
-
31
- export default model<ILoadBalancerPort>("LoadBalancerPort", loadBalancerPortSchema, "load_balancer_ports");
package/logs.ts DELETED
@@ -1,47 +0,0 @@
1
- import { model, Schema } from "mongoose";
2
- import { ENVIRONMENT, PROJECT_STATUS } from "./enum";
3
- import { ILog } from "./types";
4
- import { softDeletePlugin } from "soft-delete-plugin-mongoose";
5
-
6
- const LogSchema = new Schema(
7
- {
8
- name: String,
9
- key: String,
10
- commit: Object,
11
- status: {
12
- type: String,
13
- enum: Object.values(PROJECT_STATUS),
14
- default: PROJECT_STATUS.PENDING,
15
- },
16
- project: {
17
- ref: "Project",
18
- type: Schema.Types.ObjectId,
19
- },
20
- user: {
21
- ref: "User",
22
- type: Schema.Types.ObjectId,
23
- },
24
- team: {
25
- ref: "Team",
26
- type: Schema.Types.ObjectId,
27
- },
28
- preview: {
29
- ref: "Preview",
30
- type: Schema.Types.ObjectId,
31
- },
32
- environment: {
33
- type: String,
34
- enum: Object.values(ENVIRONMENT),
35
- default: ENVIRONMENT.PRODUCTION,
36
- },
37
- jobs: Array,
38
- startTime: Schema.Types.Date,
39
- endTime: Schema.Types.Date,
40
- deleted: Schema.Types.Boolean,
41
- },
42
- { timestamps: true },
43
- );
44
-
45
- LogSchema.plugin(softDeletePlugin);
46
-
47
- export default model<ILog>("Log", LogSchema);
@@ -1,13 +0,0 @@
1
- import { Schema, model } from "mongoose";
2
- import { IMemberPermission } from "./types/member-permission";
3
-
4
- const memberPermissionSchema = new Schema({
5
- permission: { type: Schema.Types.ObjectId, ref: "Permission" },
6
- member: { type: Schema.Types.ObjectId, ref: "Member" },
7
- enabled: { type: Boolean, default: false },
8
- });
9
-
10
- export default model<IMemberPermission>(
11
- "MemberPermission",
12
- memberPermissionSchema,
13
- );
package/member.ts DELETED
@@ -1,44 +0,0 @@
1
- import { model, Schema } from "mongoose";
2
- import { ROLES } from "./enum";
3
- import { IMember } from "./types";
4
-
5
- const memberSchema: Schema = new Schema(
6
- {
7
- user: {
8
- type: Schema.Types.ObjectId,
9
- ref: "User",
10
- },
11
- email: String,
12
- team: {
13
- type: Schema.Types.ObjectId,
14
- ref: "Team",
15
- },
16
- role: {
17
- type: String,
18
- enum: Object.values(ROLES),
19
- default: ROLES.MEMBER,
20
- },
21
- accepted: {
22
- type: Boolean,
23
- default: false,
24
- },
25
- invitedBy: {
26
- type: Schema.Types.ObjectId,
27
- ref: "User",
28
- },
29
- featureOnboarded: {
30
- type: Boolean,
31
- default: false,
32
- },
33
- permissions: [{ type: Schema.Types.ObjectId, ref: "MemberPermission" }],
34
- project_environments: [{ type: Schema.Types.ObjectId, ref: "ProjectEnvironment" }],
35
- },
36
- {
37
- timestamps: {
38
- createdAt: "created_at",
39
- updatedAt: "updated_at",
40
- },
41
- },
42
- );
43
-
44
- export default model<IMember>("Member", memberSchema);