@brimble/models 3.8.186 → 3.8.189

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 (64) hide show
  1. package/changelog-campaign.ts +19 -5
  2. package/changelog-entry.ts +12 -2
  3. package/dist/agent-chat-file.js +5 -1
  4. package/dist/agent-chat-model.js +1 -1
  5. package/dist/agent-design-skill-revision.js +15 -3
  6. package/dist/agent-design-skill.js +5 -1
  7. package/dist/agent-website-file-overlay.js +5 -1
  8. package/dist/agent-website-snapshot.js +5 -1
  9. package/dist/app-message.js +12 -2
  10. package/dist/blog-post.js +7 -1
  11. package/dist/career-role.js +7 -1
  12. package/dist/cashier_subscription.js +1 -1
  13. package/dist/changelog-campaign.js +15 -4
  14. package/dist/changelog-entry.js +12 -2
  15. package/dist/collab-annotation.js +6 -1
  16. package/dist/collab-comment.js +6 -1
  17. package/dist/collab-integration.js +6 -1
  18. package/dist/collab-push-subscription.js +10 -2
  19. package/dist/collab-share-token.js +6 -1
  20. package/dist/coupon-redemption.js +16 -3
  21. package/dist/coupon.js +16 -3
  22. package/dist/db-image.js +6 -6
  23. package/dist/domain/index.js +1 -1
  24. package/dist/domain/renewal.js +1 -1
  25. package/dist/drain.js +28 -5
  26. package/dist/enum/index.d.ts +2 -1
  27. package/dist/enum/index.js +1 -0
  28. package/dist/environment-variable.js +5 -1
  29. package/dist/framework.js +3 -3
  30. package/dist/index.d.ts +1 -1
  31. package/dist/logs.js +2 -2
  32. package/dist/member.js +3 -1
  33. package/dist/object-storage-usage-segment.js +10 -2
  34. package/dist/pgbouncer-usage-segment.js +10 -2
  35. package/dist/plan_configuration.js +9 -5
  36. package/dist/platform-api-key.js +17 -3
  37. package/dist/project/index.js +11 -7
  38. package/dist/project-drain-subscription.js +12 -2
  39. package/dist/project-network-settings.js +15 -3
  40. package/dist/project_analytics.js +6 -1
  41. package/dist/quest-campaign.js +4 -1
  42. package/dist/quest-participation.js +16 -3
  43. package/dist/quest-reward-issuance.js +27 -5
  44. package/dist/sandbox-snapshot-usage-segment.js +10 -2
  45. package/dist/sandbox-warm-pool.js +4 -1
  46. package/dist/sandbox.js +1 -1
  47. package/dist/server.js +1 -1
  48. package/dist/settings.js +1 -1
  49. package/dist/storage.js +178 -30
  50. package/dist/streak-day.js +10 -2
  51. package/dist/streak-event.js +10 -2
  52. package/dist/streak-milestone.js +10 -2
  53. package/dist/streak.js +11 -2
  54. package/dist/subscription.js +2 -2
  55. package/dist/team.js +1 -1
  56. package/dist/ticket.js +6 -1
  57. package/dist/types/index.d.ts +3 -3
  58. package/dist/types/plan_configuration.d.ts +2 -2
  59. package/dist/user.js +8 -2
  60. package/dist/volume.js +2 -2
  61. package/dist/wallet.js +2 -2
  62. package/dist/webhook-category.js +1 -1
  63. package/dist/webhook-setting.js +1 -1
  64. package/package.json +1 -1
@@ -3,7 +3,11 @@ import { IChangelogCampaign } from "./types";
3
3
 
4
4
  const changelogEmailPayloadEntrySchema = new Schema(
5
5
  {
6
- category: { type: String, required: true, enum: ["new", "improved", "fixed"] },
6
+ category: {
7
+ type: String,
8
+ required: true,
9
+ enum: ["new", "improved", "fixed"],
10
+ },
7
11
  title: { type: String, required: true },
8
12
  description: { type: String, required: true },
9
13
  link: {
@@ -27,7 +31,9 @@ const changelogCampaignSchema = new Schema<IChangelogCampaign>(
27
31
  period_end: { type: Date, required: true },
28
32
  subject: { type: String, required: true },
29
33
  intro: { type: String },
30
- entry_ids: [{ type: Schema.Types.ObjectId, ref: "ChangelogEntry", required: true }],
34
+ entry_ids: [
35
+ { type: Schema.Types.ObjectId, ref: "ChangelogEntry", required: true },
36
+ ],
31
37
  email_payload: { type: [changelogEmailPayloadEntrySchema], default: [] },
32
38
  auto_send: { type: Boolean, required: true, default: true },
33
39
  status: { type: String, required: true, index: true },
@@ -36,12 +42,20 @@ const changelogCampaignSchema = new Schema<IChangelogCampaign>(
36
42
  preview_sent_at: { type: Date, default: null },
37
43
  sent_at: { type: Date, default: null },
38
44
  idempotency_key: { type: String, required: true, unique: true },
39
- skipped_entry_ids: [{ type: Schema.Types.ObjectId, ref: "ChangelogEntry", default: [] }],
45
+ skipped_entry_ids: [
46
+ { type: Schema.Types.ObjectId, ref: "ChangelogEntry", default: [] },
47
+ ],
48
+ },
49
+ {
50
+ timestamps: { createdAt: "created_at", updatedAt: "updated_at" },
51
+ collection: "changelog_campaigns",
40
52
  },
41
- { timestamps: { createdAt: "created_at", updatedAt: "updated_at" }, collection: "changelog_campaigns" },
42
53
  );
43
54
 
44
55
  changelogCampaignSchema.index({ status: 1, preview_at: 1 });
45
56
  changelogCampaignSchema.index({ status: 1, send_at: 1 });
46
57
 
47
- export default model<IChangelogCampaign>("ChangelogCampaign", changelogCampaignSchema);
58
+ export default model<IChangelogCampaign>(
59
+ "ChangelogCampaign",
60
+ changelogCampaignSchema,
61
+ );
@@ -5,7 +5,13 @@ const changelogEntrySchema = new Schema(
5
5
  {
6
6
  airtable_id: { type: String, unique: true, sparse: true, index: true },
7
7
  airtable_created_time: { type: Date },
8
- slug: { type: String, required: true, unique: true, sparse: true, index: true },
8
+ slug: {
9
+ type: String,
10
+ required: true,
11
+ unique: true,
12
+ sparse: true,
13
+ index: true,
14
+ },
9
15
  status: { type: String, required: true, index: true },
10
16
  title: { type: String, required: true },
11
17
  date: { type: Date },
@@ -13,7 +19,11 @@ const changelogEntrySchema = new Schema(
13
19
  summary: { type: String },
14
20
  content: { type: String },
15
21
  emailed_at: { type: Date, default: null, index: true },
16
- email_campaign_id: { type: Schema.Types.ObjectId, default: null, index: true },
22
+ email_campaign_id: {
23
+ type: Schema.Types.ObjectId,
24
+ default: null,
25
+ index: true,
26
+ },
17
27
  },
18
28
  { timestamps: true, collection: "entries" },
19
29
  );
@@ -3,7 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const mongoose_1 = require("mongoose");
4
4
  const agentChatFileSchema = new mongoose_1.Schema({
5
5
  chat_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "AgentChat", required: true },
6
- message_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "AgentChatMessage", default: null },
6
+ message_id: {
7
+ type: mongoose_1.Schema.Types.ObjectId,
8
+ ref: "AgentChatMessage",
9
+ default: null,
10
+ },
7
11
  user_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true },
8
12
  filename: { type: String, required: true },
9
13
  content_type: { type: String, required: true },
@@ -4,7 +4,7 @@ const mongoose_1 = require("mongoose");
4
4
  const agentChatModelSchema = new mongoose_1.Schema({
5
5
  slug: { type: String, required: true, unique: true },
6
6
  label: { type: String, required: true },
7
- description: { type: String, required: true, default: '' },
7
+ description: { type: String, required: true, default: "" },
8
8
  provider: { type: String, required: true },
9
9
  gateway_model: { type: String, required: true },
10
10
  audio: { type: Boolean, required: false, default: false },
@@ -8,7 +8,11 @@ const fileSchema = new mongoose_1.Schema({
8
8
  bytes: { type: Number, required: true },
9
9
  }, { _id: false });
10
10
  const inspectionSchema = new mongoose_1.Schema({
11
- verdict: { type: String, enum: Object.values(enum_1.AGENT_DESIGN_SKILL_VERDICT), required: true },
11
+ verdict: {
12
+ type: String,
13
+ enum: Object.values(enum_1.AGENT_DESIGN_SKILL_VERDICT),
14
+ required: true,
15
+ },
12
16
  capabilities: { type: [String], default: [] },
13
17
  warnings: { type: [String], default: [] },
14
18
  rejected_reasons: { type: [String], default: [] },
@@ -24,7 +28,11 @@ const licenseSchema = new mongoose_1.Schema({
24
28
  text_hash: { type: String, default: null },
25
29
  }, { _id: false });
26
30
  const agentDesignSkillRevisionSchema = new mongoose_1.Schema({
27
- skill_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "AgentDesignSkill", required: true },
31
+ skill_id: {
32
+ type: mongoose_1.Schema.Types.ObjectId,
33
+ ref: "AgentDesignSkill",
34
+ required: true,
35
+ },
28
36
  commit: { type: String, required: true },
29
37
  content_hash: { type: String, required: true },
30
38
  trust_level: {
@@ -53,5 +61,9 @@ const agentDesignSkillRevisionSchema = new mongoose_1.Schema({
53
61
  });
54
62
  agentDesignSkillRevisionSchema.index({ skill_id: 1, commit: 1 }, { unique: true });
55
63
  agentDesignSkillRevisionSchema.index({ content_hash: 1 });
56
- agentDesignSkillRevisionSchema.index({ skill_id: 1, status: 1, created_at: -1 });
64
+ agentDesignSkillRevisionSchema.index({
65
+ skill_id: 1,
66
+ status: 1,
67
+ created_at: -1,
68
+ });
57
69
  exports.default = (0, mongoose_1.model)("AgentDesignSkillRevision", agentDesignSkillRevisionSchema);
@@ -13,7 +13,11 @@ const agentDesignSkillSchema = new mongoose_1.Schema({
13
13
  required: true,
14
14
  default: enum_1.AGENT_DESIGN_SKILL_STATUS.Active,
15
15
  },
16
- latest_revision_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "AgentDesignSkillRevision", default: null },
16
+ latest_revision_id: {
17
+ type: mongoose_1.Schema.Types.ObjectId,
18
+ ref: "AgentDesignSkillRevision",
19
+ default: null,
20
+ },
17
21
  }, {
18
22
  timestamps: { createdAt: "created_at", updatedAt: "updated_at" },
19
23
  collection: "agent_design_skills",
@@ -2,7 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const mongoose_1 = require("mongoose");
4
4
  const agentWebsiteFileOverlaySchema = new mongoose_1.Schema({
5
- website_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "AgentWebsite", required: true },
5
+ website_id: {
6
+ type: mongoose_1.Schema.Types.ObjectId,
7
+ ref: "AgentWebsite",
8
+ required: true,
9
+ },
6
10
  path: { type: String, required: true },
7
11
  content: { type: String, default: "" },
8
12
  size: { type: Number, required: true },
@@ -3,7 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const mongoose_1 = require("mongoose");
4
4
  const enum_1 = require("./enum");
5
5
  const agentWebsiteSnapshotSchema = new mongoose_1.Schema({
6
- website_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "AgentWebsite", required: true },
6
+ website_id: {
7
+ type: mongoose_1.Schema.Types.ObjectId,
8
+ ref: "AgentWebsite",
9
+ required: true,
10
+ },
7
11
  user_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true },
8
12
  s3_key: { type: String, required: true },
9
13
  size: { type: Number, required: true },
@@ -2,8 +2,18 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const mongoose_1 = require("mongoose");
4
4
  const appMessageSchema = new mongoose_1.Schema({
5
- userId: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: false, index: true },
6
- teamId: { type: mongoose_1.Schema.Types.ObjectId, ref: "Team", required: false, index: true },
5
+ userId: {
6
+ type: mongoose_1.Schema.Types.ObjectId,
7
+ ref: "User",
8
+ required: false,
9
+ index: true,
10
+ },
11
+ teamId: {
12
+ type: mongoose_1.Schema.Types.ObjectId,
13
+ ref: "Team",
14
+ required: false,
15
+ index: true,
16
+ },
7
17
  level: { type: String, required: true },
8
18
  message: { type: String, required: true },
9
19
  seen: { type: Boolean, default: false, index: true },
package/dist/blog-post.js CHANGED
@@ -4,7 +4,13 @@ const mongoose_1 = require("mongoose");
4
4
  const blogPostSchema = new mongoose_1.Schema({
5
5
  airtable_id: { type: String, unique: true, sparse: true, index: true },
6
6
  airtable_created_time: { type: Date },
7
- slug: { type: String, required: true, unique: true, sparse: true, index: true },
7
+ slug: {
8
+ type: String,
9
+ required: true,
10
+ unique: true,
11
+ sparse: true,
12
+ index: true,
13
+ },
8
14
  title: { type: String, required: true },
9
15
  status: { type: String, required: true, index: true },
10
16
  category: { type: String },
@@ -4,7 +4,13 @@ const mongoose_1 = require("mongoose");
4
4
  const careerRoleSchema = new mongoose_1.Schema({
5
5
  airtable_id: { type: String, unique: true, sparse: true, index: true },
6
6
  airtable_created_time: { type: Date },
7
- slug: { type: String, required: true, unique: true, sparse: true, index: true },
7
+ slug: {
8
+ type: String,
9
+ required: true,
10
+ unique: true,
11
+ sparse: true,
12
+ index: true,
13
+ },
8
14
  status: { type: String, required: true, index: true },
9
15
  title: { type: String, required: true },
10
16
  level: { type: String },
@@ -5,7 +5,7 @@ const cashierSubscriptionSchema = new mongoose_1.Schema({
5
5
  user_id: {
6
6
  ref: "User",
7
7
  type: mongoose_1.Schema.Types.ObjectId,
8
- required: true
8
+ required: true,
9
9
  },
10
10
  type: { type: String, default: "default" },
11
11
  stripe_id: { type: String, required: true },
@@ -2,7 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const mongoose_1 = require("mongoose");
4
4
  const changelogEmailPayloadEntrySchema = new mongoose_1.Schema({
5
- category: { type: String, required: true, enum: ["new", "improved", "fixed"] },
5
+ category: {
6
+ type: String,
7
+ required: true,
8
+ enum: ["new", "improved", "fixed"],
9
+ },
6
10
  title: { type: String, required: true },
7
11
  description: { type: String, required: true },
8
12
  link: {
@@ -19,7 +23,9 @@ const changelogCampaignSchema = new mongoose_1.Schema({
19
23
  period_end: { type: Date, required: true },
20
24
  subject: { type: String, required: true },
21
25
  intro: { type: String },
22
- entry_ids: [{ type: mongoose_1.Schema.Types.ObjectId, ref: "ChangelogEntry", required: true }],
26
+ entry_ids: [
27
+ { type: mongoose_1.Schema.Types.ObjectId, ref: "ChangelogEntry", required: true },
28
+ ],
23
29
  email_payload: { type: [changelogEmailPayloadEntrySchema], default: [] },
24
30
  auto_send: { type: Boolean, required: true, default: true },
25
31
  status: { type: String, required: true, index: true },
@@ -28,8 +34,13 @@ const changelogCampaignSchema = new mongoose_1.Schema({
28
34
  preview_sent_at: { type: Date, default: null },
29
35
  sent_at: { type: Date, default: null },
30
36
  idempotency_key: { type: String, required: true, unique: true },
31
- skipped_entry_ids: [{ type: mongoose_1.Schema.Types.ObjectId, ref: "ChangelogEntry", default: [] }],
32
- }, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" }, collection: "changelog_campaigns" });
37
+ skipped_entry_ids: [
38
+ { type: mongoose_1.Schema.Types.ObjectId, ref: "ChangelogEntry", default: [] },
39
+ ],
40
+ }, {
41
+ timestamps: { createdAt: "created_at", updatedAt: "updated_at" },
42
+ collection: "changelog_campaigns",
43
+ });
33
44
  changelogCampaignSchema.index({ status: 1, preview_at: 1 });
34
45
  changelogCampaignSchema.index({ status: 1, send_at: 1 });
35
46
  exports.default = (0, mongoose_1.model)("ChangelogCampaign", changelogCampaignSchema);
@@ -4,7 +4,13 @@ const mongoose_1 = require("mongoose");
4
4
  const changelogEntrySchema = new mongoose_1.Schema({
5
5
  airtable_id: { type: String, unique: true, sparse: true, index: true },
6
6
  airtable_created_time: { type: Date },
7
- slug: { type: String, required: true, unique: true, sparse: true, index: true },
7
+ slug: {
8
+ type: String,
9
+ required: true,
10
+ unique: true,
11
+ sparse: true,
12
+ index: true,
13
+ },
8
14
  status: { type: String, required: true, index: true },
9
15
  title: { type: String, required: true },
10
16
  date: { type: Date },
@@ -12,7 +18,11 @@ const changelogEntrySchema = new mongoose_1.Schema({
12
18
  summary: { type: String },
13
19
  content: { type: String },
14
20
  emailed_at: { type: Date, default: null, index: true },
15
- email_campaign_id: { type: mongoose_1.Schema.Types.ObjectId, default: null, index: true },
21
+ email_campaign_id: {
22
+ type: mongoose_1.Schema.Types.ObjectId,
23
+ default: null,
24
+ index: true,
25
+ },
16
26
  }, { timestamps: true, collection: "entries" });
17
27
  changelogEntrySchema.index({ status: 1, emailed_at: 1, date: -1 });
18
28
  exports.default = (0, mongoose_1.model)("ChangelogEntry", changelogEntrySchema);
@@ -3,7 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const mongoose_1 = require("mongoose");
4
4
  const enum_1 = require("./enum");
5
5
  const collabAnnotationSchema = new mongoose_1.Schema({
6
- projectId: { type: mongoose_1.Schema.Types.ObjectId, ref: "Project", required: true, index: true },
6
+ projectId: {
7
+ type: mongoose_1.Schema.Types.ObjectId,
8
+ ref: "Project",
9
+ required: true,
10
+ index: true,
11
+ },
7
12
  userId: { type: mongoose_1.Schema.Types.ObjectId, ref: "User" },
8
13
  pageUrl: { type: String, required: true },
9
14
  pagePath: { type: String, required: true, index: true },
@@ -8,7 +8,12 @@ const collabAttachmentSchema = new mongoose_1.Schema({
8
8
  fileSize: { type: Number, required: true },
9
9
  }, { _id: false });
10
10
  const collabCommentSchema = new mongoose_1.Schema({
11
- annotationId: { type: mongoose_1.Schema.Types.ObjectId, ref: "CollabAnnotation", required: true, index: true },
11
+ annotationId: {
12
+ type: mongoose_1.Schema.Types.ObjectId,
13
+ ref: "CollabAnnotation",
14
+ required: true,
15
+ index: true,
16
+ },
12
17
  userId: { type: mongoose_1.Schema.Types.ObjectId, ref: "User" },
13
18
  body: { type: String },
14
19
  screenshot: { type: String },
@@ -3,7 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const mongoose_1 = require("mongoose");
4
4
  const enum_1 = require("./enum");
5
5
  const collabIntegrationSchema = new mongoose_1.Schema({
6
- projectId: { type: mongoose_1.Schema.Types.ObjectId, ref: "Project", required: true, index: true },
6
+ projectId: {
7
+ type: mongoose_1.Schema.Types.ObjectId,
8
+ ref: "Project",
9
+ required: true,
10
+ index: true,
11
+ },
7
12
  userId: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", index: true },
8
13
  type: {
9
14
  type: String,
@@ -2,13 +2,21 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const mongoose_1 = require("mongoose");
4
4
  const collabPushSubscriptionSchema = new mongoose_1.Schema({
5
- userId: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true, index: true },
5
+ userId: {
6
+ type: mongoose_1.Schema.Types.ObjectId,
7
+ ref: "User",
8
+ required: true,
9
+ index: true,
10
+ },
6
11
  endpoint: { type: String, required: true, unique: true },
7
12
  keys: {
8
13
  p256dh: { type: String, required: true },
9
14
  auth: { type: String, required: true },
10
15
  },
11
16
  domain: { type: String, required: true, index: true },
12
- }, { timestamps: { createdAt: true, updatedAt: false }, collection: "push_subscriptions" });
17
+ }, {
18
+ timestamps: { createdAt: true, updatedAt: false },
19
+ collection: "push_subscriptions",
20
+ });
13
21
  collabPushSubscriptionSchema.index({ userId: 1, domain: 1 });
14
22
  exports.default = (0, mongoose_1.model)("CollabPushSubscription", collabPushSubscriptionSchema);
@@ -2,7 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const mongoose_1 = require("mongoose");
4
4
  const collabShareTokenSchema = new mongoose_1.Schema({
5
- projectId: { type: mongoose_1.Schema.Types.ObjectId, ref: "Project", required: true, index: true },
5
+ projectId: {
6
+ type: mongoose_1.Schema.Types.ObjectId,
7
+ ref: "Project",
8
+ required: true,
9
+ index: true,
10
+ },
6
11
  createdBy: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true },
7
12
  token: { type: String, required: true, unique: true },
8
13
  expiresAt: { type: Date },
@@ -3,9 +3,19 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const mongoose_1 = require("mongoose");
4
4
  const enum_1 = require("./enum");
5
5
  const couponRedemptionSchema = new mongoose_1.Schema({
6
- coupon_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "Coupon", required: true, index: true },
6
+ coupon_id: {
7
+ type: mongoose_1.Schema.Types.ObjectId,
8
+ ref: "Coupon",
9
+ required: true,
10
+ index: true,
11
+ },
7
12
  code: { type: String, required: true },
8
- user_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true, index: true },
13
+ user_id: {
14
+ type: mongoose_1.Schema.Types.ObjectId,
15
+ ref: "User",
16
+ required: true,
17
+ index: true,
18
+ },
9
19
  team_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "Team", default: null },
10
20
  scope: {
11
21
  type: String,
@@ -28,7 +38,10 @@ const couponRedemptionSchema = new mongoose_1.Schema({
28
38
  reserved_at: { type: Date, required: true },
29
39
  applied_at: { type: Date, default: null },
30
40
  reversed_at: { type: Date, default: null },
31
- }, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" }, collection: "coupon_redemptions" });
41
+ }, {
42
+ timestamps: { createdAt: "created_at", updatedAt: "updated_at" },
43
+ collection: "coupon_redemptions",
44
+ });
32
45
  couponRedemptionSchema.index({ coupon_id: 1, user_id: 1, status: 1 });
33
46
  couponRedemptionSchema.index({ coupon_id: 1, transaction_reference: 1 }, {
34
47
  unique: true,
package/dist/coupon.js CHANGED
@@ -3,7 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const mongoose_1 = require("mongoose");
4
4
  const enum_1 = require("./enum");
5
5
  const couponSchema = new mongoose_1.Schema({
6
- code: { type: String, required: true, unique: true, uppercase: true, trim: true },
6
+ code: {
7
+ type: String,
8
+ required: true,
9
+ unique: true,
10
+ uppercase: true,
11
+ trim: true,
12
+ },
7
13
  description: { type: String, default: null },
8
14
  scope: {
9
15
  type: String,
@@ -25,7 +31,11 @@ const couponSchema = new mongoose_1.Schema({
25
31
  max_purchase_amount: { type: Number, default: null },
26
32
  allowed_tlds: { type: [String], default: [] },
27
33
  allowed_emails: { type: [String], default: [] },
28
- allowed_user_ids: { type: [mongoose_1.Schema.Types.ObjectId], ref: "User", default: [] },
34
+ allowed_user_ids: {
35
+ type: [mongoose_1.Schema.Types.ObjectId],
36
+ ref: "User",
37
+ default: [],
38
+ },
29
39
  max_duration_years: { type: Number, default: null },
30
40
  allow_below_cost: { type: Boolean, default: false },
31
41
  starts_at: { type: Date, default: null },
@@ -33,6 +43,9 @@ const couponSchema = new mongoose_1.Schema({
33
43
  enabled: { type: Boolean, default: true },
34
44
  created_by: { type: String, default: null },
35
45
  disabled_at: { type: Date, default: null },
36
- }, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" }, collection: "coupons" });
46
+ }, {
47
+ timestamps: { createdAt: "created_at", updatedAt: "updated_at" },
48
+ collection: "coupons",
49
+ });
37
50
  couponSchema.index({ enabled: 1, expires_at: 1 });
38
51
  exports.default = (0, mongoose_1.model)("Coupon", couponSchema);
package/dist/db-image.js CHANGED
@@ -67,16 +67,16 @@ const dbImageSchema = new mongoose_1.Schema({
67
67
  ha: {
68
68
  type: Boolean,
69
69
  required: false,
70
- default: false
70
+ default: false,
71
71
  },
72
72
  analytics: {
73
73
  type: Boolean,
74
74
  required: false,
75
- default: true
75
+ default: true,
76
76
  },
77
77
  workbench: {
78
78
  type: Boolean,
79
- default: false
79
+ default: false,
80
80
  },
81
81
  workbench_mode: {
82
82
  type: String,
@@ -105,12 +105,12 @@ const dbImageSchema = new mongoose_1.Schema({
105
105
  free: {
106
106
  type: Boolean,
107
107
  required: false,
108
- default: false
108
+ default: false,
109
109
  },
110
110
  erd: {
111
111
  type: Boolean,
112
112
  required: false,
113
- default: false
113
+ default: false,
114
114
  },
115
115
  recommendations: {
116
116
  required: false,
@@ -150,6 +150,6 @@ const dbImageSchema = new mongoose_1.Schema({
150
150
  params: {
151
151
  required: false,
152
152
  type: Object,
153
- }
153
+ },
154
154
  }, { timestamps: true });
155
155
  exports.default = (0, mongoose_1.model)("DbImage", dbImageSchema);
@@ -90,7 +90,7 @@ const domainSchema = new mongoose_1.Schema({
90
90
  },
91
91
  last_expiry_notification_at: {
92
92
  type: Date,
93
- required: false
93
+ required: false,
94
94
  },
95
95
  dns: [
96
96
  {
@@ -11,7 +11,7 @@ const domainRenewalSchema = new mongoose_1.Schema({
11
11
  status: {
12
12
  type: String,
13
13
  required: true,
14
- enum: Object.values(enum_1.DomainRenewalStatus)
14
+ enum: Object.values(enum_1.DomainRenewalStatus),
15
15
  },
16
16
  attempts: {
17
17
  type: Number,
package/dist/drain.js CHANGED
@@ -3,10 +3,25 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const mongoose_1 = require("mongoose");
4
4
  const enum_1 = require("./enum");
5
5
  const DrainSchema = new mongoose_1.Schema({
6
- user_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: false, index: true },
7
- team: { type: mongoose_1.Schema.Types.ObjectId, ref: "Team", required: false, index: true },
6
+ user_id: {
7
+ type: mongoose_1.Schema.Types.ObjectId,
8
+ ref: "User",
9
+ required: false,
10
+ index: true,
11
+ },
12
+ team: {
13
+ type: mongoose_1.Schema.Types.ObjectId,
14
+ ref: "Team",
15
+ required: false,
16
+ index: true,
17
+ },
8
18
  name: { type: String, required: true, minlength: 1, maxlength: 64 },
9
- type: { type: String, enum: Object.values(enum_1.DrainType), default: enum_1.DrainType.Https, required: true },
19
+ type: {
20
+ type: String,
21
+ enum: Object.values(enum_1.DrainType),
22
+ default: enum_1.DrainType.Https,
23
+ required: true,
24
+ },
10
25
  url: { type: String },
11
26
  headerKeys: [{ type: String }],
12
27
  s3: {
@@ -14,8 +29,16 @@ const DrainSchema = new mongoose_1.Schema({
14
29
  region: { type: String },
15
30
  endpoint: { type: String },
16
31
  keyPrefix: { type: String, default: "" },
17
- storageBucketId: { type: mongoose_1.Schema.Types.ObjectId, ref: "StorageBucket", default: null },
18
- storageCredentialId: { type: mongoose_1.Schema.Types.ObjectId, ref: "StorageCredential", default: null },
32
+ storageBucketId: {
33
+ type: mongoose_1.Schema.Types.ObjectId,
34
+ ref: "StorageBucket",
35
+ default: null,
36
+ },
37
+ storageCredentialId: {
38
+ type: mongoose_1.Schema.Types.ObjectId,
39
+ ref: "StorageCredential",
40
+ default: null,
41
+ },
19
42
  },
20
43
  secretsRef: { type: String, required: true },
21
44
  sources: [{ type: String, enum: Object.values(enum_1.LogSource) }],
@@ -169,7 +169,8 @@ export declare enum SUBSCRIPTION_PLAN_TYPE {
169
169
  TeamPlan = "TEAM_PLAN",
170
170
  DomainPlan = "DOMAIN_PLAN",
171
171
  HackerPlan = "HACKER_PLAN",
172
- LiscensePlan = "LISCENSE_PLAN"
172
+ LiscensePlan = "LISCENSE_PLAN",
173
+ EmailForwardingPlan = "EMAIL_FORWARDING_PLAN"
173
174
  }
174
175
  export declare enum OAUTH_PERMISSIONS {
175
176
  READ_USER = "read_user",
@@ -201,6 +201,7 @@ var SUBSCRIPTION_PLAN_TYPE;
201
201
  SUBSCRIPTION_PLAN_TYPE["DomainPlan"] = "DOMAIN_PLAN";
202
202
  SUBSCRIPTION_PLAN_TYPE["HackerPlan"] = "HACKER_PLAN";
203
203
  SUBSCRIPTION_PLAN_TYPE["LiscensePlan"] = "LISCENSE_PLAN";
204
+ SUBSCRIPTION_PLAN_TYPE["EmailForwardingPlan"] = "EMAIL_FORWARDING_PLAN";
204
205
  })(SUBSCRIPTION_PLAN_TYPE || (exports.SUBSCRIPTION_PLAN_TYPE = SUBSCRIPTION_PLAN_TYPE = {}));
205
206
  var OAUTH_PERMISSIONS;
206
207
  (function (OAUTH_PERMISSIONS) {
@@ -20,5 +20,9 @@ const environmentVariableSchema = new mongoose_1.Schema({
20
20
  inheritable: { type: Boolean, default: true },
21
21
  }, { timestamps: true });
22
22
  environmentVariableSchema.index({ name: 1, project_environment: 1 }, { unique: true });
23
- environmentVariableSchema.index({ project_environment: 1, source_project: 1, name: 1 });
23
+ environmentVariableSchema.index({
24
+ project_environment: 1,
25
+ source_project: 1,
26
+ name: 1,
27
+ });
24
28
  exports.default = (0, mongoose_1.model)("EnvironmentVariable", environmentVariableSchema);
package/dist/framework.js CHANGED
@@ -22,12 +22,12 @@ const frameworkSchema = new mongoose_1.Schema({
22
22
  supported: {
23
23
  type: Boolean,
24
24
  required: false,
25
- default: true
25
+ default: true,
26
26
  },
27
27
  port: {
28
28
  type: Number,
29
29
  required: false,
30
- default: 8000
30
+ default: 8000,
31
31
  },
32
32
  tagline: {
33
33
  type: String,
@@ -51,7 +51,7 @@ const frameworkSchema = new mongoose_1.Schema({
51
51
  },
52
52
  file_detectors: {
53
53
  type: Array,
54
- required: false
54
+ required: false,
55
55
  },
56
56
  type: {
57
57
  type: String,
package/dist/index.d.ts CHANGED
@@ -83,7 +83,7 @@ export { default as VolumeUsageSegment } from "./volume-usage-segment";
83
83
  export { default as PgBouncerUsageSegment } from "./pgbouncer-usage-segment";
84
84
  export { default as ObjectStorageUsageSegment } from "./object-storage-usage-segment";
85
85
  export { default as IdempotencyRecord } from "./idempotency";
86
- export { StorageBucket, StorageObject, StorageUpload, StorageToken, StorageCredential, StorageMigration } from "./storage";
86
+ export { StorageBucket, StorageObject, StorageUpload, StorageToken, StorageCredential, StorageMigration, } from "./storage";
87
87
  export { default as Streak } from "./streak";
88
88
  export { default as StreakEvent } from "./streak-event";
89
89
  export { default as StreakDay } from "./streak-day";