@brimble/models 3.8.186 → 3.8.188

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 (62) 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/environment-variable.js +5 -1
  27. package/dist/framework.js +3 -3
  28. package/dist/index.d.ts +1 -1
  29. package/dist/logs.js +2 -2
  30. package/dist/member.js +3 -1
  31. package/dist/object-storage-usage-segment.js +10 -2
  32. package/dist/pgbouncer-usage-segment.js +10 -2
  33. package/dist/plan_configuration.js +9 -5
  34. package/dist/platform-api-key.js +17 -3
  35. package/dist/project/index.js +11 -7
  36. package/dist/project-drain-subscription.js +12 -2
  37. package/dist/project-network-settings.js +15 -3
  38. package/dist/project_analytics.js +6 -1
  39. package/dist/quest-campaign.js +4 -1
  40. package/dist/quest-participation.js +16 -3
  41. package/dist/quest-reward-issuance.js +27 -5
  42. package/dist/sandbox-snapshot-usage-segment.js +10 -2
  43. package/dist/sandbox-warm-pool.js +4 -1
  44. package/dist/sandbox.js +1 -1
  45. package/dist/server.js +1 -1
  46. package/dist/settings.js +1 -1
  47. package/dist/storage.js +178 -30
  48. package/dist/streak-day.js +10 -2
  49. package/dist/streak-event.js +10 -2
  50. package/dist/streak-milestone.js +10 -2
  51. package/dist/streak.js +11 -2
  52. package/dist/subscription.js +2 -2
  53. package/dist/team.js +1 -1
  54. package/dist/ticket.js +6 -1
  55. package/dist/types/index.d.ts +3 -3
  56. package/dist/types/plan_configuration.d.ts +2 -2
  57. package/dist/user.js +8 -2
  58. package/dist/volume.js +2 -2
  59. package/dist/wallet.js +2 -2
  60. package/dist/webhook-category.js +1 -1
  61. package/dist/webhook-setting.js +1 -1
  62. package/package.json +1 -1
@@ -2,7 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const mongoose_1 = require("mongoose");
4
4
  const streakEventSchema = new mongoose_1.Schema({
5
- user_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true, index: true },
5
+ user_id: {
6
+ type: mongoose_1.Schema.Types.ObjectId,
7
+ ref: "User",
8
+ required: true,
9
+ index: true,
10
+ },
6
11
  action_type: {
7
12
  type: String,
8
13
  required: true,
@@ -12,7 +17,10 @@ const streakEventSchema = new mongoose_1.Schema({
12
17
  service_type: { type: String, default: null },
13
18
  system_day: { type: Date, required: true, index: true },
14
19
  dedupe_key: { type: String, required: true, unique: true },
15
- }, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" }, collection: "streak_events" });
20
+ }, {
21
+ timestamps: { createdAt: "created_at", updatedAt: "updated_at" },
22
+ collection: "streak_events",
23
+ });
16
24
  streakEventSchema.index({ user_id: 1, system_day: 1 });
17
25
  streakEventSchema.index({ user_id: 1, action_type: 1, created_at: 1 });
18
26
  exports.default = (0, mongoose_1.model)("StreakEvent", streakEventSchema);
@@ -2,10 +2,18 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const mongoose_1 = require("mongoose");
4
4
  const streakMilestoneSchema = new mongoose_1.Schema({
5
- user_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true, index: true },
5
+ user_id: {
6
+ type: mongoose_1.Schema.Types.ObjectId,
7
+ ref: "User",
8
+ required: true,
9
+ index: true,
10
+ },
6
11
  type: { type: String, required: true },
7
12
  action: { type: String, required: true },
8
13
  date: { type: Date, required: true },
9
- }, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" }, collection: "streak_milestones" });
14
+ }, {
15
+ timestamps: { createdAt: "created_at", updatedAt: "updated_at" },
16
+ collection: "streak_milestones",
17
+ });
10
18
  streakMilestoneSchema.index({ user_id: 1, type: 1, date: 1 }, { unique: true });
11
19
  exports.default = (0, mongoose_1.model)("StreakMilestone", streakMilestoneSchema);
package/dist/streak.js CHANGED
@@ -6,12 +6,21 @@ const streakMilestoneRefSchema = new mongoose_1.Schema({
6
6
  date: { type: Date, required: true },
7
7
  }, { _id: false });
8
8
  const streakSchema = new mongoose_1.Schema({
9
- user_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true, unique: true, index: true },
9
+ user_id: {
10
+ type: mongoose_1.Schema.Types.ObjectId,
11
+ ref: "User",
12
+ required: true,
13
+ unique: true,
14
+ index: true,
15
+ },
10
16
  current_count: { type: Number, default: 0 },
11
17
  longest_count: { type: Number, default: 0 },
12
18
  last_active_day: { type: Date, default: null },
13
19
  last_processed_day: { type: Date, default: null },
14
20
  last_milestone: { type: streakMilestoneRefSchema, default: null },
15
21
  last_streak_email_day: { type: Date, default: null },
16
- }, { timestamps: { createdAt: "created_at", updatedAt: "updated_at" }, collection: "streaks" });
22
+ }, {
23
+ timestamps: { createdAt: "created_at", updatedAt: "updated_at" },
24
+ collection: "streaks",
25
+ });
17
26
  exports.default = (0, mongoose_1.model)("Streak", streakSchema);
@@ -9,7 +9,7 @@ const subscriptionSchema = new mongoose_1.Schema({
9
9
  },
10
10
  due_amount: {
11
11
  type: Number,
12
- default: 0
12
+ default: 0,
13
13
  },
14
14
  team_id: {
15
15
  type: mongoose_1.Schema.Types.ObjectId,
@@ -55,7 +55,7 @@ const subscriptionSchema = new mongoose_1.Schema({
55
55
  transaction_retries: Number,
56
56
  downgraded: {
57
57
  default: false,
58
- type: Boolean
58
+ type: Boolean,
59
59
  },
60
60
  is_pending_downgrade: {
61
61
  type: Boolean,
package/dist/team.js CHANGED
@@ -33,7 +33,7 @@ const teamSchema = new mongoose_1.Schema({
33
33
  ai_usage_count: {
34
34
  type: Number,
35
35
  default: 0,
36
- required: false
36
+ required: false,
37
37
  },
38
38
  build_minutes: {
39
39
  type: Number,
package/dist/ticket.js CHANGED
@@ -3,7 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const mongoose_1 = require("mongoose");
4
4
  const ticketSchema = new mongoose_1.Schema({
5
5
  airtable_id: { type: String, required: true, unique: true, index: true },
6
- user_id: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", required: true, index: true },
6
+ user_id: {
7
+ type: mongoose_1.Schema.Types.ObjectId,
8
+ ref: "User",
9
+ required: true,
10
+ index: true,
11
+ },
7
12
  email: { type: String, required: true },
8
13
  subject: { type: String, required: true },
9
14
  message: { type: String, required: true },
@@ -56,7 +56,7 @@ export type { IAppMessage } from "./app-message";
56
56
  export type { IInvoice } from "./invoice";
57
57
  export type { IProjectTagAssignment } from "./project-tag-assignment";
58
58
  export type { ITag } from "./tag";
59
- export type { ICashierSubscription, ICashierSubscriptionItem } from "./cashier_subscription";
59
+ export type { ICashierSubscription, ICashierSubscriptionItem, } from "./cashier_subscription";
60
60
  export type { IProjectEnvironment } from "./project-environment";
61
61
  export type { IEnvironmentVariable } from "./environment-variable";
62
62
  export type { IProjectConfigFile } from "./project-config-file";
@@ -89,14 +89,14 @@ export type { IStreakMilestone } from "./streak-milestone";
89
89
  export type { IQuestCampaign, IQuestCriterion, IQuestRequirement, IQuestReward, } from "./quest-campaign";
90
90
  export type { IQuestParticipation, IQuestCriterionProgress, } from "./quest-participation";
91
91
  export type { IQuestRewardIssuance, IQuestIssuedReward, } from "./quest-reward-issuance";
92
- export type { IStorageBucket, IStorageObject, IStorageUpload, IStorageToken, IStorageCredential, IStorageMigration, StorageTokenPermission, StorageLifecycleRule, StorageCorsRule, StorageLifecycleRuleTransition } from "./storage";
92
+ export type { IStorageBucket, IStorageObject, IStorageUpload, IStorageToken, IStorageCredential, IStorageMigration, StorageTokenPermission, StorageLifecycleRule, StorageCorsRule, StorageLifecycleRuleTransition, } from "./storage";
93
93
  export type { ICoupon } from "./coupon";
94
94
  export type { ICouponRedemption } from "./coupon-redemption";
95
95
  export type { ITicket } from "./ticket";
96
96
  export type { ICareerRole } from "./career-role";
97
97
  export type { IBlogPost } from "./blog-post";
98
98
  export type { IChangelogEntry } from "./changelog-entry";
99
- export type { ChangelogEmailPayloadEntry, IChangelogCampaign } from "./changelog-campaign";
99
+ export type { ChangelogEmailPayloadEntry, IChangelogCampaign, } from "./changelog-campaign";
100
100
  export type { IAgentChat } from "./agent-chat";
101
101
  export type { IAgentChatMessage } from "./agent-chat-message";
102
102
  export type { IAgentChatFile } from "./agent-chat-file";
@@ -36,6 +36,7 @@ export interface IPlanConfiguration extends Document {
36
36
  token_request: number;
37
37
  custom_domain: boolean;
38
38
  wildcard_domain: boolean;
39
+ email_forwarding_enabled: boolean;
39
40
  unlimited_projects: boolean;
40
41
  webhook_enabled: boolean;
41
42
  can_deploy_all_applications: boolean;
@@ -43,7 +44,7 @@ export interface IPlanConfiguration extends Document {
43
44
  storage_bucket_enabled: boolean;
44
45
  storage_bucket_quota_gb: number;
45
46
  sandbox_max_count: number;
46
- sanxbox_hours_max: number;
47
+ sandbox_hours_max: number;
47
48
  sandbox_enabled: boolean;
48
49
  sandbox_cpu_hours_included: number;
49
50
  sandbox_memory_gb_hours_included: number;
@@ -65,5 +66,4 @@ export interface IPlanConfiguration extends Document {
65
66
  agent_chat_enabled: boolean;
66
67
  agent_chat_tokens_per_session: number;
67
68
  agent_chats_per_day: number;
68
- email_forward_limit: number;
69
69
  }
package/dist/user.js CHANGED
@@ -51,7 +51,7 @@ const userSchema = new mongoose_1.Schema({
51
51
  ai_usage_count: {
52
52
  type: Number,
53
53
  default: 0,
54
- required: false
54
+ required: false,
55
55
  },
56
56
  tenant: { type: mongoose_1.Schema.Types.ObjectId, ref: "Tenancy", required: false },
57
57
  is_waitlist: { type: Boolean, default: true },
@@ -68,7 +68,13 @@ const userSchema = new mongoose_1.Schema({
68
68
  has_payment_method: Boolean,
69
69
  totp_enabled: { type: Boolean, default: false },
70
70
  agent_byok_enabled: { type: Boolean, default: false },
71
- referral_code: { type: String, sparse: true, unique: true, uppercase: true, trim: true },
71
+ referral_code: {
72
+ type: String,
73
+ sparse: true,
74
+ unique: true,
75
+ uppercase: true,
76
+ trim: true,
77
+ },
72
78
  referred_by: { type: mongoose_1.Schema.Types.ObjectId, ref: "User", default: null },
73
79
  referred_at: Date,
74
80
  referral_converted_at: Date,
package/dist/volume.js CHANGED
@@ -17,12 +17,12 @@ const volumeSchema = new mongoose_1.Schema({
17
17
  },
18
18
  namespace: {
19
19
  type: String,
20
- required: false
20
+ required: false,
21
21
  },
22
22
  type: {
23
23
  type: String,
24
24
  required: false,
25
- default: "project"
25
+ default: "project",
26
26
  },
27
27
  size: { type: Number, required: true },
28
28
  mount_path: { type: String },
package/dist/wallet.js CHANGED
@@ -20,7 +20,7 @@ const walletSchema = new mongoose_1.Schema({
20
20
  },
21
21
  discounted: {
22
22
  type: Boolean,
23
- default: false
24
- }
23
+ default: false,
24
+ },
25
25
  });
26
26
  exports.default = (0, mongoose_1.model)("Wallet", walletSchema);
@@ -5,6 +5,6 @@ const webhookCategorySchema = new mongoose_1.Schema({
5
5
  category: {
6
6
  type: String,
7
7
  required: true,
8
- }
8
+ },
9
9
  });
10
10
  exports.default = (0, mongoose_1.model)("WebhookCategory", webhookCategorySchema, "webhook_category");
@@ -45,6 +45,6 @@ const webhookSettingSchema = new mongoose_1.Schema({
45
45
  type: [mongoose_1.Schema.Types.ObjectId],
46
46
  ref: webhook_event_1.default,
47
47
  default: [],
48
- }
48
+ },
49
49
  });
50
50
  exports.default = (0, mongoose_1.model)("WebhookSetting", webhookSettingSchema, "webhook_settings");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimble/models",
3
- "version": "3.8.186",
3
+ "version": "3.8.188",
4
4
  "description": "Brimble models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",