@brimble/models 3.8.126 → 3.8.128

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.
@@ -345,6 +345,10 @@ export declare enum WorkerRunStatus {
345
345
  Failed = "failed",
346
346
  Lost = "lost"
347
347
  }
348
+ export declare enum WorkerRunTrigger {
349
+ Scheduled = "scheduled",
350
+ Manual = "manual"
351
+ }
348
352
  export declare enum RESTORE_STATUS {
349
353
  PENDING = "pending",
350
354
  RUNNING = "running",
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.INVOICE_PAYMENT_STATUS = exports.INVOICE_STATUS = exports.COLLAB_TOOLBAR_POSITION = exports.COLLAB_THEME = exports.COLLAB_INTEGRATION_TYPE = exports.COLLAB_ANNOTATION_STATUS = exports.NomadDeploymentStatus = exports.DomainTransferStatus = exports.DomainTransferDirection = exports.DomainTransferProvider = exports.DomainRenewalStatus = exports.FrameworkApplicationType = exports.SCALING_SOURCE = exports.SCALING_METRIC = exports.SCALING_STRATEGY = exports.LicenseStatus = exports.JobStatus = exports.DatabaseEngine = exports.ServiceType = exports.VOLUME_BACKEND = exports.REGION_CONTINENT = exports.PERMISSION_TYPE = exports.ROLES = exports.DNS_CHANGE_SOURCE = exports.DNS_CHANGE_TYPE = exports.DNS_TYPE = exports.SERVER_STATUS = exports.OAUTH_PERMISSIONS = exports.SUBSCRIPTION_PLAN_TYPE = exports.SUBSCRIPTION_STATUS = exports.DrainEventType = exports.LogSource = exports.DrainStatus = exports.DrainType = exports.AlertEventStatus = exports.AlertChannelMode = exports.AlertRuleState = exports.AlertCondition = exports.AlertMetric = exports.PROJECT_STATUS = exports.CARD_TYPES = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = exports.CONFIG_FILE_VISIBILITY = exports.ENVIRONMENT = exports.REQUEST_TYPE = exports.PROJECT_DISABLED_BY = exports.BUILD_DISABLED_BY = exports.SERVER_PROTOCOL = exports.GIT_TYPE = void 0;
4
- exports.CouponRedemptionStatus = exports.CouponScope = exports.CouponDiscountType = exports.QUEST_TARGETLESS_REQUIREMENTS = exports.QUEST_CLAIM_REQUIREMENTS = exports.WorkbenchMode = exports.QuestRequirementType = exports.QuestEntity = exports.QuestCriterionType = exports.QuestRewardStatus = exports.RewardType = exports.EligibilityType = exports.ACTION_TO_MILESTONE = exports.QUEST_COUNTABLE_MILESTONES = exports.MilestoneType = exports.QualifyingActionType = exports.XRobotsTag = exports.XContentTypeOptions = exports.XFrameOptions = exports.StorageMigrationStatus = exports.StorageCredentialStatus = exports.StorageCredentialRole = exports.PlatformApiKeyStatus = exports.StorageTokenStatus = exports.StorageUploadStatus = exports.StorageBucketStatus = exports.RESTORE_STATUS = exports.WorkerRunStatus = exports.BACKUP_STATUS = exports.SANDBOX_SNAPSHOT_STATUS = exports.SANDBOX_EGRESS_MODE = exports.SANDBOX_DESTROY_REASON = exports.SANDBOX_STATUS = exports.SANDBOX_TEMPLATE = exports.INVOICE_TYPE = void 0;
4
+ exports.CouponRedemptionStatus = exports.CouponScope = exports.CouponDiscountType = exports.QUEST_TARGETLESS_REQUIREMENTS = exports.QUEST_CLAIM_REQUIREMENTS = exports.WorkbenchMode = exports.QuestRequirementType = exports.QuestEntity = exports.QuestCriterionType = exports.QuestRewardStatus = exports.RewardType = exports.EligibilityType = exports.ACTION_TO_MILESTONE = exports.QUEST_COUNTABLE_MILESTONES = exports.MilestoneType = exports.QualifyingActionType = exports.XRobotsTag = exports.XContentTypeOptions = exports.XFrameOptions = exports.StorageMigrationStatus = exports.StorageCredentialStatus = exports.StorageCredentialRole = exports.PlatformApiKeyStatus = exports.StorageTokenStatus = exports.StorageUploadStatus = exports.StorageBucketStatus = exports.RESTORE_STATUS = exports.WorkerRunTrigger = exports.WorkerRunStatus = exports.BACKUP_STATUS = exports.SANDBOX_SNAPSHOT_STATUS = exports.SANDBOX_EGRESS_MODE = exports.SANDBOX_DESTROY_REASON = exports.SANDBOX_STATUS = exports.SANDBOX_TEMPLATE = exports.INVOICE_TYPE = void 0;
5
5
  var GIT_TYPE;
6
6
  (function (GIT_TYPE) {
7
7
  GIT_TYPE["GITHUB"] = "GITHUB";
@@ -407,6 +407,11 @@ var WorkerRunStatus;
407
407
  WorkerRunStatus["Failed"] = "failed";
408
408
  WorkerRunStatus["Lost"] = "lost";
409
409
  })(WorkerRunStatus || (exports.WorkerRunStatus = WorkerRunStatus = {}));
410
+ var WorkerRunTrigger;
411
+ (function (WorkerRunTrigger) {
412
+ WorkerRunTrigger["Scheduled"] = "scheduled";
413
+ WorkerRunTrigger["Manual"] = "manual";
414
+ })(WorkerRunTrigger || (exports.WorkerRunTrigger = WorkerRunTrigger = {}));
410
415
  var RESTORE_STATUS;
411
416
  (function (RESTORE_STATUS) {
412
417
  RESTORE_STATUS["PENDING"] = "pending";
package/dist/index.d.ts CHANGED
@@ -92,7 +92,7 @@ export { default as Coupon } from "./coupon";
92
92
  export { default as CouponRedemption } from "./coupon-redemption";
93
93
  export { default as Ticket } from "./ticket";
94
94
  export { IUser, IGit, IProject, IProjectAnalytics, IPreview, IProjectConnection, IProjectNetworkSettings, IRatelimit, RatelimitConfig, RateLimitZone, RateLimitMatcher, DistributedRateLimitConfig, IFollowing, IIntegration, IEnv, IServer, IDomain, IToken, IPlatformApiKey, IMember, ITeam, IInstalledIntegration, ILog, ISubscription, ICard, IPaymentMethod, IDns, IDnsChangeLog, IRole, IPermission, IMemberPermission, IWallet, IDbImage, IJob, ILicense, IPlanConfiguration, IAutoScalingGroup, IComputeChange, IRegion, IVolume, IFramework, BrimbleFrameworkType, ISettings, ILoadBalancerPort, IDomainRenewal, IDomainTransfer, IWebhookCategory, IWebhookEvent, IWebhookSetting, IIntention, IProvider, ICollabAnnotation, ICollabComment, ICollabAttachment, ICollabIntegration, ICollabSettings, ICollabShareToken, ICollabPushSubscription, IAppMessage, IInvoice, ITag, IProjectTagAssignment, ICashierSubscription, ICashierSubscriptionItem, IProjectEnvironment, IEnvironmentVariable, IProjectConfigFile, IActivityLog, IAlertRule, IAlertRuleState, IAlertEvent, IAlertNotificationResult, IDrain, IProjectDrainSubscription, IOwnershipTransfer, ISandbox, ISandboxSpecs, ISandboxActivity, ISandboxImage, ISandboxSize, ISandboxSnapshot, IBackupHistory, IRestoreHistory, IWorkerRun, ISandboxSnapshotUsageSegment, ISandboxSnapshotUsageSegmentCosts, ISandboxUsageSegment, ISandboxUsageSegmentCurrent, ISandboxUsageSegmentCosts, IVolumeUsageSegment, IVolumeUsageSegmentCosts, IPgBouncerUsageSegment, IPgBouncerUsageSegmentCosts, IObjectStorageUsageSegment, IObjectStorageUsageSegmentCosts, IObjectStorageUsageUnitsSummary, IIdempotencyRecord, IStorageBucket, IStorageObject, IStorageUpload, IStorageToken, IStorageCredential, IStorageMigration, StorageTokenPermission, StorageLifecycleRule, StorageCorsRule, StorageLifecycleRuleTransition, IStreak, IStreakMilestoneRef, IStreakEvent, IStreakDay, IStreakMilestone, IQuestCampaign, IQuestCriterion, IQuestRequirement, IQuestReward, IQuestParticipation, IQuestCriterionProgress, IQuestRewardIssuance, IQuestIssuedReward, ICoupon, ICouponRedemption, ITicket, } from "./types";
95
- export { GIT_TYPE, INTEGRATION_TYPES, INTEGRATION_PROVIDERS, OAUTH_PERMISSIONS, ENVIRONMENT, SERVER_STATUS, ROLES, SUBSCRIPTION_PLAN_TYPE, PROJECT_STATUS, AlertMetric, AlertCondition, AlertRuleState, AlertChannelMode, AlertEventStatus, DrainType, DrainStatus, LogSource, DrainEventType, SUBSCRIPTION_STATUS, CARD_TYPES, DNS_TYPE, DNS_CHANGE_TYPE, DNS_CHANGE_SOURCE, PERMISSION_TYPE, REQUEST_TYPE, ServiceType, SCALING_SOURCE, DatabaseEngine, JobStatus, LicenseStatus, REGION_CONTINENT, VOLUME_BACKEND, BUILD_DISABLED_BY, PROJECT_DISABLED_BY, SERVER_PROTOCOL, FrameworkApplicationType, DomainRenewalStatus, DomainTransferProvider, DomainTransferDirection, DomainTransferStatus, NomadDeploymentStatus, COLLAB_ANNOTATION_STATUS, COLLAB_INTEGRATION_TYPE, COLLAB_THEME, COLLAB_TOOLBAR_POSITION, INVOICE_STATUS, INVOICE_PAYMENT_STATUS, INVOICE_TYPE, SANDBOX_TEMPLATE, SANDBOX_STATUS, SANDBOX_DESTROY_REASON, SANDBOX_EGRESS_MODE, SANDBOX_SNAPSHOT_STATUS, BACKUP_STATUS, WorkerRunStatus, RESTORE_STATUS, StorageBucketStatus, StorageUploadStatus, StorageTokenStatus, PlatformApiKeyStatus, StorageCredentialRole, StorageCredentialStatus, StorageMigrationStatus, XFrameOptions, XContentTypeOptions, XRobotsTag, QualifyingActionType, MilestoneType, QUEST_COUNTABLE_MILESTONES, ACTION_TO_MILESTONE, EligibilityType, RewardType, QuestRewardStatus, QuestCriterionType, QuestEntity, QuestRequirementType, QUEST_CLAIM_REQUIREMENTS, QUEST_TARGETLESS_REQUIREMENTS, WorkbenchMode, CouponDiscountType, CouponScope, CouponRedemptionStatus, CONFIG_FILE_VISIBILITY, } from "./enum";
95
+ export { GIT_TYPE, INTEGRATION_TYPES, INTEGRATION_PROVIDERS, OAUTH_PERMISSIONS, ENVIRONMENT, SERVER_STATUS, ROLES, SUBSCRIPTION_PLAN_TYPE, PROJECT_STATUS, AlertMetric, AlertCondition, AlertRuleState, AlertChannelMode, AlertEventStatus, DrainType, DrainStatus, LogSource, DrainEventType, SUBSCRIPTION_STATUS, CARD_TYPES, DNS_TYPE, DNS_CHANGE_TYPE, DNS_CHANGE_SOURCE, PERMISSION_TYPE, REQUEST_TYPE, ServiceType, SCALING_SOURCE, DatabaseEngine, JobStatus, LicenseStatus, REGION_CONTINENT, VOLUME_BACKEND, BUILD_DISABLED_BY, PROJECT_DISABLED_BY, SERVER_PROTOCOL, FrameworkApplicationType, DomainRenewalStatus, DomainTransferProvider, DomainTransferDirection, DomainTransferStatus, NomadDeploymentStatus, COLLAB_ANNOTATION_STATUS, COLLAB_INTEGRATION_TYPE, COLLAB_THEME, COLLAB_TOOLBAR_POSITION, INVOICE_STATUS, INVOICE_PAYMENT_STATUS, INVOICE_TYPE, SANDBOX_TEMPLATE, SANDBOX_STATUS, SANDBOX_DESTROY_REASON, SANDBOX_EGRESS_MODE, SANDBOX_SNAPSHOT_STATUS, BACKUP_STATUS, WorkerRunStatus, WorkerRunTrigger, RESTORE_STATUS, StorageBucketStatus, StorageUploadStatus, StorageTokenStatus, PlatformApiKeyStatus, StorageCredentialRole, StorageCredentialStatus, StorageMigrationStatus, XFrameOptions, XContentTypeOptions, XRobotsTag, QualifyingActionType, MilestoneType, QUEST_COUNTABLE_MILESTONES, ACTION_TO_MILESTONE, EligibilityType, RewardType, QuestRewardStatus, QuestCriterionType, QuestEntity, QuestRequirementType, QUEST_CLAIM_REQUIREMENTS, QUEST_TARGETLESS_REQUIREMENTS, WorkbenchMode, CouponDiscountType, CouponScope, CouponRedemptionStatus, CONFIG_FILE_VISIBILITY, } from "./enum";
96
96
  import mongoose from "mongoose";
97
97
  export declare const connectToMongo: (mongoUrl: string, config?: mongoose.ConnectOptions) => Promise<void>;
98
98
  export declare const db: mongoose.Connection;
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
15
15
  exports.CollabShareToken = exports.CollabSettings = exports.CollabIntegration = exports.CollabComment = exports.CollabAnnotation = exports.Provider = exports.Intention = exports.WebhookSetting = exports.WebhookEvent = exports.WebhookCategory = exports.DomainTransfer = exports.DomainRenewal = exports.LoadBalancerPort = exports.Settings = exports.Framework = exports.Volume = exports.Region = exports.ComputeChange = exports.AutoScalingGroup = exports.PlanConfiguration = exports.Liscense = exports.Job = exports.DbImage = exports.Wallet = exports.Server = exports.Card = exports.Subscription = exports.Log = exports.Role = exports.MemberPermission = exports.PaymentMethod = exports.Permission = exports.Member = exports.Team = exports.PlatformApiKey = exports.Token = exports.Env = exports.DnsChangeLog = exports.Dns = exports.Domain = exports.Integration = exports.Following = exports.Ratelimit = exports.ProjectNetworkSettings = exports.ProjectConnection = exports.Preview = exports.ProjectAnalytics = exports.DeletedProject = exports.Project = exports.User = void 0;
16
16
  exports.GIT_TYPE = exports.Ticket = exports.CouponRedemption = exports.Coupon = exports.QuestRewardIssuance = exports.QuestParticipation = exports.QuestCampaign = exports.StreakMilestone = exports.StreakDay = exports.StreakEvent = exports.Streak = exports.StorageMigration = exports.StorageCredential = exports.StorageToken = exports.StorageUpload = exports.StorageObject = exports.StorageBucket = exports.IdempotencyRecord = exports.ObjectStorageUsageSegment = exports.PgBouncerUsageSegment = exports.VolumeUsageSegment = exports.SandboxUsageSegment = exports.SandboxSnapshotUsageSegment = exports.WorkerRun = exports.RestoreHistory = exports.BackupHistory = exports.SandboxSnapshot = exports.SandboxWarmPoolMember = exports.SandboxWarmPool = exports.SandboxSize = exports.SandboxImage = exports.SandboxActivity = exports.Sandbox = exports.OwnershipTransfer = exports.ProjectDrainSubscription = exports.Drain = exports.AlertEvent = exports.AlertRuleStateModel = exports.AlertRule = exports.ActivityLog = exports.ProjectConfigFile = exports.EnvironmentVariable = exports.ProjectEnvironment = exports.CashierSubscriptionItem = exports.CashierSubscription = exports.ProjectTagAssignment = exports.Tag = exports.Invoice = exports.AppMessage = exports.CollabPushSubscription = void 0;
17
17
  exports.SANDBOX_DESTROY_REASON = exports.SANDBOX_STATUS = exports.SANDBOX_TEMPLATE = exports.INVOICE_TYPE = exports.INVOICE_PAYMENT_STATUS = exports.INVOICE_STATUS = exports.COLLAB_TOOLBAR_POSITION = exports.COLLAB_THEME = exports.COLLAB_INTEGRATION_TYPE = exports.COLLAB_ANNOTATION_STATUS = exports.NomadDeploymentStatus = exports.DomainTransferStatus = exports.DomainTransferDirection = exports.DomainTransferProvider = exports.DomainRenewalStatus = exports.FrameworkApplicationType = exports.SERVER_PROTOCOL = exports.PROJECT_DISABLED_BY = exports.BUILD_DISABLED_BY = exports.VOLUME_BACKEND = exports.REGION_CONTINENT = exports.LicenseStatus = exports.JobStatus = exports.DatabaseEngine = exports.SCALING_SOURCE = exports.ServiceType = exports.REQUEST_TYPE = exports.PERMISSION_TYPE = exports.DNS_CHANGE_SOURCE = exports.DNS_CHANGE_TYPE = exports.DNS_TYPE = exports.CARD_TYPES = exports.SUBSCRIPTION_STATUS = exports.DrainEventType = exports.LogSource = exports.DrainStatus = exports.DrainType = exports.AlertEventStatus = exports.AlertChannelMode = exports.AlertRuleState = exports.AlertCondition = exports.AlertMetric = exports.PROJECT_STATUS = exports.SUBSCRIPTION_PLAN_TYPE = exports.ROLES = exports.SERVER_STATUS = exports.ENVIRONMENT = exports.OAUTH_PERMISSIONS = exports.INTEGRATION_PROVIDERS = exports.INTEGRATION_TYPES = void 0;
18
- exports.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = exports.CONFIG_FILE_VISIBILITY = exports.CouponRedemptionStatus = exports.CouponScope = exports.CouponDiscountType = exports.WorkbenchMode = exports.QUEST_TARGETLESS_REQUIREMENTS = exports.QUEST_CLAIM_REQUIREMENTS = exports.QuestRequirementType = exports.QuestEntity = exports.QuestCriterionType = exports.QuestRewardStatus = exports.RewardType = exports.EligibilityType = exports.ACTION_TO_MILESTONE = exports.QUEST_COUNTABLE_MILESTONES = exports.MilestoneType = exports.QualifyingActionType = exports.XRobotsTag = exports.XContentTypeOptions = exports.XFrameOptions = exports.StorageMigrationStatus = exports.StorageCredentialStatus = exports.StorageCredentialRole = exports.PlatformApiKeyStatus = exports.StorageTokenStatus = exports.StorageUploadStatus = exports.StorageBucketStatus = exports.RESTORE_STATUS = exports.WorkerRunStatus = exports.BACKUP_STATUS = exports.SANDBOX_SNAPSHOT_STATUS = exports.SANDBOX_EGRESS_MODE = void 0;
18
+ exports.healthCheckMongo = exports.closeMongo = exports.db = exports.connectToMongo = exports.CONFIG_FILE_VISIBILITY = exports.CouponRedemptionStatus = exports.CouponScope = exports.CouponDiscountType = exports.WorkbenchMode = exports.QUEST_TARGETLESS_REQUIREMENTS = exports.QUEST_CLAIM_REQUIREMENTS = exports.QuestRequirementType = exports.QuestEntity = exports.QuestCriterionType = exports.QuestRewardStatus = exports.RewardType = exports.EligibilityType = exports.ACTION_TO_MILESTONE = exports.QUEST_COUNTABLE_MILESTONES = exports.MilestoneType = exports.QualifyingActionType = exports.XRobotsTag = exports.XContentTypeOptions = exports.XFrameOptions = exports.StorageMigrationStatus = exports.StorageCredentialStatus = exports.StorageCredentialRole = exports.PlatformApiKeyStatus = exports.StorageTokenStatus = exports.StorageUploadStatus = exports.StorageBucketStatus = exports.RESTORE_STATUS = exports.WorkerRunTrigger = exports.WorkerRunStatus = exports.BACKUP_STATUS = exports.SANDBOX_SNAPSHOT_STATUS = exports.SANDBOX_EGRESS_MODE = void 0;
19
19
  var user_1 = require("./user");
20
20
  Object.defineProperty(exports, "User", { enumerable: true, get: function () { return __importDefault(user_1).default; } });
21
21
  var project_1 = require("./project");
@@ -264,6 +264,7 @@ Object.defineProperty(exports, "SANDBOX_EGRESS_MODE", { enumerable: true, get: f
264
264
  Object.defineProperty(exports, "SANDBOX_SNAPSHOT_STATUS", { enumerable: true, get: function () { return enum_1.SANDBOX_SNAPSHOT_STATUS; } });
265
265
  Object.defineProperty(exports, "BACKUP_STATUS", { enumerable: true, get: function () { return enum_1.BACKUP_STATUS; } });
266
266
  Object.defineProperty(exports, "WorkerRunStatus", { enumerable: true, get: function () { return enum_1.WorkerRunStatus; } });
267
+ Object.defineProperty(exports, "WorkerRunTrigger", { enumerable: true, get: function () { return enum_1.WorkerRunTrigger; } });
267
268
  Object.defineProperty(exports, "RESTORE_STATUS", { enumerable: true, get: function () { return enum_1.RESTORE_STATUS; } });
268
269
  Object.defineProperty(exports, "StorageBucketStatus", { enumerable: true, get: function () { return enum_1.StorageBucketStatus; } });
269
270
  Object.defineProperty(exports, "StorageUploadStatus", { enumerable: true, get: function () { return enum_1.StorageUploadStatus; } });
@@ -315,6 +315,14 @@ const projectSchema = new mongoose_1.Schema({
315
315
  type: String,
316
316
  default: null,
317
317
  },
318
+ cronCommandPath: {
319
+ type: String,
320
+ default: null,
321
+ },
322
+ cronCommand: {
323
+ type: String,
324
+ default: null,
325
+ },
318
326
  billable: {
319
327
  type: Boolean,
320
328
  default: false,
@@ -121,6 +121,8 @@ export interface IProject extends Document {
121
121
  cronEnabled?: boolean;
122
122
  cronExpression?: string | null;
123
123
  cronTimezone?: string | null;
124
+ cronCommandPath?: string | null;
125
+ cronCommand?: string | null;
124
126
  last_backup_url?: string;
125
127
  last_backup_at?: Date;
126
128
  replica_ready: boolean;
@@ -1,17 +1,22 @@
1
1
  import { Document, Types } from "mongoose";
2
- import { WorkerRunStatus } from "../enum";
2
+ import { WorkerRunStatus, WorkerRunTrigger } from "../enum";
3
3
  export interface IWorkerRun extends Document {
4
4
  project: Types.ObjectId;
5
5
  user_id: Types.ObjectId;
6
6
  team: Types.ObjectId | null;
7
- parentJobId: string;
8
- childJobId: string;
9
- namespace: string;
7
+ parentJobId: string | null;
8
+ childJobId: string | null;
9
+ namespace: string | null;
10
10
  status: WorkerRunStatus;
11
+ trigger: WorkerRunTrigger | null;
12
+ commandPath: string | null;
13
+ command: string | null;
14
+ exitCode: number | null;
15
+ output: string | null;
11
16
  allocationId: string | null;
12
17
  startedAt: Date | null;
13
18
  finishedAt: Date | null;
14
- syncedAt: Date;
19
+ syncedAt: Date | null;
15
20
  createdAt: Date;
16
21
  updatedAt: Date;
17
22
  }
@@ -19,23 +19,45 @@ const workerRunSchema = new mongoose_1.Schema({
19
19
  ref: "Team",
20
20
  default: null,
21
21
  },
22
+ // Nomad periodic child-job identity (worker cron). Optional for web-service sidecar reports.
22
23
  parentJobId: {
23
24
  type: String,
24
- required: true,
25
+ default: null,
25
26
  },
26
27
  childJobId: {
27
28
  type: String,
28
- required: true,
29
+ default: null,
29
30
  },
30
31
  namespace: {
31
32
  type: String,
32
- required: true,
33
+ default: null,
33
34
  },
34
35
  status: {
35
36
  type: String,
36
37
  enum: Object.values(enum_1.WorkerRunStatus),
37
38
  required: true,
38
39
  },
40
+ trigger: {
41
+ type: String,
42
+ enum: Object.values(enum_1.WorkerRunTrigger),
43
+ default: null,
44
+ },
45
+ commandPath: {
46
+ type: String,
47
+ default: null,
48
+ },
49
+ command: {
50
+ type: String,
51
+ default: null,
52
+ },
53
+ exitCode: {
54
+ type: Number,
55
+ default: null,
56
+ },
57
+ output: {
58
+ type: String,
59
+ default: null,
60
+ },
39
61
  allocationId: {
40
62
  type: String,
41
63
  default: null,
@@ -50,12 +72,12 @@ const workerRunSchema = new mongoose_1.Schema({
50
72
  },
51
73
  syncedAt: {
52
74
  type: Date,
53
- required: true,
75
+ default: null,
54
76
  },
55
77
  }, {
56
78
  timestamps: true,
57
79
  collection: "worker_runs",
58
80
  });
59
- workerRunSchema.index({ project: 1, childJobId: 1 }, { unique: true });
81
+ workerRunSchema.index({ project: 1, childJobId: 1 }, { unique: true, sparse: true });
60
82
  workerRunSchema.index({ project: 1, startedAt: -1 });
61
83
  exports.default = (0, mongoose_1.model)("WorkerRun", workerRunSchema);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brimble/models",
3
- "version": "3.8.126",
3
+ "version": "3.8.128",
4
4
  "description": "Brimble models",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",