@badger_badger/badger_hq 1.6.0 → 1.8.0

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.
@@ -247,6 +247,8 @@ var INDEXES = {
247
247
  options: { unique: true, partialFilterExpression: NOT_SOFT_DELETED_FILTER }
248
248
  },
249
249
  { key: { orgId: 1, route: 1, status: 1 } },
250
+ // Multikey: the sources attached to a Monitor task (cap counts, agents' version polls).
251
+ { key: { orgId: 1, taskIds: 1 } },
250
252
  // Partition key of the shared database; drives the future split into physical databases.
251
253
  { key: { orgId: 1, databaseId: 1 } }
252
254
  ],
@@ -881,6 +883,20 @@ var discoveredBySchema = new mongoose.Schema(
881
883
  },
882
884
  EMBEDDED
883
885
  );
886
+ var sourceDiscoverySchema = new mongoose.Schema(
887
+ {
888
+ taskId: { type: ObjectId, required: true },
889
+ captureId: { type: ObjectId },
890
+ capturedUrl: { type: String },
891
+ name: { type: String, required: true, maxlength: 200 },
892
+ description: { type: String, maxlength: 1e3 },
893
+ // Not `required`: Mongoose rejects '' for required strings, and the judge may return an empty reason.
894
+ reason: { type: String, maxlength: 300, default: "" },
895
+ relevanceScore: { type: Number, required: true, min: 0, max: 1 },
896
+ discoveredAt: { type: Date, required: true }
897
+ },
898
+ EMBEDDED
899
+ );
884
900
  var sourceImportSummarySchema = new mongoose.Schema(
885
901
  {
886
902
  toCreate: { type: Number, required: true, default: 0, min: 0 },
@@ -1131,8 +1147,10 @@ var sourceSchema = new mongoose.Schema(
1131
1147
  tags: { type: [String], required: true, default: [] },
1132
1148
  status: { type: String, enum: SOURCE_STATUS_VALUES, required: true, default: "active" },
1133
1149
  discoveredBy: { type: discoveredBySchema, required: true },
1150
+ discovery: { type: sourceDiscoverySchema },
1134
1151
  lastCollectedAt: { type: Date },
1135
1152
  nextVisitAt: { type: Date },
1153
+ visitIntervalMs: { type: Number, min: 1 },
1136
1154
  deletedAt: { type: Date }
1137
1155
  },
1138
1156
  collectionOptions(COLLECTIONS.sources)
@@ -1505,6 +1523,7 @@ exports.scoutProfileSchema = scoutProfileSchema;
1505
1523
  exports.scoutRatingSchema = scoutRatingSchema;
1506
1524
  exports.scraperMetricSchema = scraperMetricSchema;
1507
1525
  exports.scraperSchema = scraperSchema;
1526
+ exports.sourceDiscoverySchema = sourceDiscoverySchema;
1508
1527
  exports.sourceImportRowErrorSchema = sourceImportRowErrorSchema;
1509
1528
  exports.sourceImportSchema = sourceImportSchema;
1510
1529
  exports.sourceImportSummarySchema = sourceImportSummarySchema;