@oneuptime/cli 14.0.74 → 14.0.76

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 (2) hide show
  1. package/build/dist/Index.js +1301 -34
  2. package/package.json +1 -1
@@ -15844,7 +15844,7 @@ var require_main = __commonJS({
15844
15844
  var packageJson = require_package();
15845
15845
  var version = packageJson.version;
15846
15846
  var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg;
15847
- function parse(src) {
15847
+ function parse2(src) {
15848
15848
  const obj = {};
15849
15849
  let lines = src.toString();
15850
15850
  lines = lines.replace(/\r\n?/mg, "\n");
@@ -15863,7 +15863,7 @@ var require_main = __commonJS({
15863
15863
  }
15864
15864
  return obj;
15865
15865
  }
15866
- __name(parse, "parse");
15866
+ __name(parse2, "parse");
15867
15867
  function _parseVault(options) {
15868
15868
  options = options || {};
15869
15869
  const vaultPath = _vaultPath(options);
@@ -16124,7 +16124,7 @@ var require_main = __commonJS({
16124
16124
  _parseVault,
16125
16125
  config,
16126
16126
  decrypt,
16127
- parse,
16127
+ parse: parse2,
16128
16128
  populate
16129
16129
  };
16130
16130
  module2.exports.configDotenv = DotenvModule.configDotenv;
@@ -26318,15 +26318,15 @@ var require_parse = __commonJS({
26318
26318
  "use strict";
26319
26319
  Object.defineProperty(exports2, "__esModule", { value: true });
26320
26320
  var validate_js_1 = require_validate();
26321
- function parse(uuid) {
26321
+ function parse2(uuid) {
26322
26322
  if (!(0, validate_js_1.default)(uuid)) {
26323
26323
  throw TypeError("Invalid UUID");
26324
26324
  }
26325
26325
  let v;
26326
26326
  return Uint8Array.of((v = parseInt(uuid.slice(0, 8), 16)) >>> 24, v >>> 16 & 255, v >>> 8 & 255, v & 255, (v = parseInt(uuid.slice(9, 13), 16)) >>> 8, v & 255, (v = parseInt(uuid.slice(14, 18), 16)) >>> 8, v & 255, (v = parseInt(uuid.slice(19, 23), 16)) >>> 8, v & 255, (v = parseInt(uuid.slice(24, 36), 16)) / 1099511627776 & 255, v / 4294967296 & 255, v >>> 24 & 255, v >>> 16 & 255, v >>> 8 & 255, v & 255);
26327
26327
  }
26328
- __name(parse, "parse");
26329
- exports2.default = parse;
26328
+ __name(parse2, "parse");
26329
+ exports2.default = parse2;
26330
26330
  }
26331
26331
  });
26332
26332
 
@@ -76908,7 +76908,7 @@ var require_ms = __commonJS({
76908
76908
  options = options || {};
76909
76909
  var type = typeof val;
76910
76910
  if (type === "string" && val.length > 0) {
76911
- return parse(val);
76911
+ return parse2(val);
76912
76912
  } else if (type === "number" && isFinite(val)) {
76913
76913
  return options.long ? fmtLong(val) : fmtShort(val);
76914
76914
  }
@@ -76916,7 +76916,7 @@ var require_ms = __commonJS({
76916
76916
  "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
76917
76917
  );
76918
76918
  };
76919
- function parse(str) {
76919
+ function parse2(str) {
76920
76920
  str = String(str);
76921
76921
  if (str.length > 100) {
76922
76922
  return;
@@ -76972,7 +76972,7 @@ var require_ms = __commonJS({
76972
76972
  return void 0;
76973
76973
  }
76974
76974
  }
76975
- __name(parse, "parse");
76975
+ __name(parse2, "parse");
76976
76976
  function fmtShort(ms) {
76977
76977
  var msAbs = Math.abs(ms);
76978
76978
  if (msAbs >= d) {
@@ -88421,7 +88421,7 @@ var require_parse2 = __commonJS({
88421
88421
  var token;
88422
88422
  var key;
88423
88423
  var root;
88424
- module2.exports = /* @__PURE__ */ __name(function parse(text, reviver) {
88424
+ module2.exports = /* @__PURE__ */ __name(function parse2(text, reviver) {
88425
88425
  source = String(text);
88426
88426
  parseState = "start";
88427
88427
  stack = [];
@@ -89501,10 +89501,10 @@ var require_stringify2 = __commonJS({
89501
89501
  var require_lib2 = __commonJS({
89502
89502
  "../Common/node_modules/json5/lib/index.js"(exports2, module2) {
89503
89503
  "use strict";
89504
- var parse = require_parse2();
89504
+ var parse2 = require_parse2();
89505
89505
  var stringify = require_stringify2();
89506
89506
  var JSON53 = {
89507
- parse,
89507
+ parse: parse2,
89508
89508
  stringify
89509
89509
  };
89510
89510
  module2.exports = JSON53;
@@ -122606,6 +122606,28 @@ var import_zod_to_openapi = __toESM(require_dist());
122606
122606
  var Zod = external_exports;
122607
122607
  var Zod_default = Zod;
122608
122608
 
122609
+ // ../Common/Utils/RefusedValue.ts
122610
+ var MAX_REFUSED_VALUE_LENGTH = 80;
122611
+ var REFUSED_VALUE_CUT_MARK = "\u2026";
122612
+ var isSurrogatePairAt = /* @__PURE__ */ __name((text, index) => {
122613
+ const high = text.charCodeAt(index);
122614
+ const low = text.charCodeAt(index + 1);
122615
+ return high >= 55296 && high <= 56319 && low >= 56320 && low <= 57343;
122616
+ }, "isSurrogatePairAt");
122617
+ var refusedValue = /* @__PURE__ */ __name((value) => {
122618
+ let text;
122619
+ try {
122620
+ text = String(value);
122621
+ } catch {
122622
+ return "";
122623
+ }
122624
+ if (text.length <= MAX_REFUSED_VALUE_LENGTH) {
122625
+ return text;
122626
+ }
122627
+ const end = isSurrogatePairAt(text, MAX_REFUSED_VALUE_LENGTH - 1) ? MAX_REFUSED_VALUE_LENGTH - 1 : MAX_REFUSED_VALUE_LENGTH;
122628
+ return text.slice(0, end) + REFUSED_VALUE_CUT_MARK;
122629
+ }, "refusedValue");
122630
+
122609
122631
  // ../Common/Types/Date.ts
122610
122632
  var Moment = import_moment_timezone.default;
122611
122633
  var UNIX_NANO_INTEGER_PATTERN = /^[+-]?\d+$/;
@@ -124123,7 +124145,9 @@ var OneUptimeDate = class _OneUptimeDate {
124123
124145
  if (date && date["value"] && typeof date["value"] === "string" && date["_type"] && (date["_type"] === "Date" || date["_type"] === "DateTime")) {
124124
124146
  return (0, import_moment_timezone.default)(date["value"]).toDate();
124125
124147
  }
124126
- throw new BadDataException("Invalid date: " + date?.toString());
124148
+ throw new BadDataException(
124149
+ "Invalid date: " + refusedValue(date?.toString())
124150
+ );
124127
124151
  }
124128
124152
  static asDateForDatabaseQuery(date) {
124129
124153
  const formatstring = "YYYY-MM-DD";
@@ -125060,7 +125084,7 @@ var Hostname = class _Hostname extends DatabaseProperty {
125060
125084
  this._route = value;
125061
125085
  } else {
125062
125086
  throw new BadDataException(
125063
- "Hostname " + value + " is not in valid format."
125087
+ "Hostname " + refusedValue(value) + " is not in valid format."
125064
125088
  );
125065
125089
  }
125066
125090
  }
@@ -125270,11 +125294,11 @@ var Route = class _Route extends DatabaseProperty {
125270
125294
  }
125271
125295
  static validateRoute(route) {
125272
125296
  if (_Route.hasSchemePrefix(route)) {
125273
- throw new BadDataException(`Invalid route: ${route}`);
125297
+ throw new BadDataException(`Invalid route: ${refusedValue(route)}`);
125274
125298
  }
125275
125299
  const matchRouteCharacters = /^[a-zA-Z_\d\-!#$%&'()*+,./:;=?@[\]~]*$/;
125276
125300
  if (route && !matchRouteCharacters.test(route)) {
125277
- throw new BadDataException(`Invalid route: ${route}`);
125301
+ throw new BadDataException(`Invalid route: ${refusedValue(route)}`);
125278
125302
  }
125279
125303
  }
125280
125304
  get route() {
@@ -125371,10 +125395,24 @@ var nonBusinessEmailDomains = [
125371
125395
  "zoho",
125372
125396
  "yandex"
125373
125397
  ];
125398
+ var MAX_EMAIL_ADDRESS_LENGTH = 254;
125399
+ var ONE_EMAIL_ADDRESS = (
125400
+ // eslint-disable-next-line no-control-regex
125401
+ /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[[a-z0-9:._-]{1,64}\])$/i
125402
+ );
125374
125403
  var Email = class _Email extends DatabaseProperty {
125375
125404
  constructor(email) {
125376
125405
  super();
125377
125406
  this._email = "";
125407
+ /*
125408
+ * Set only by the lenient read paths (fromDatabase / fromJSON) when a stored
125409
+ * value is not one valid mailbox. Such an Email keeps its raw string so it
125410
+ * still round-trips and still renders, but toDatabase refuses it, so a value
125411
+ * that is not a single address can never be written back or newly created -
125412
+ * only a value already stored before this check existed can carry the flag.
125413
+ * This mirrors how URL keeps a legacy value it can no longer parse.
125414
+ */
125415
+ this._isMalformed = false;
125378
125416
  this.email = email;
125379
125417
  }
125380
125418
  static {
@@ -125384,26 +125422,52 @@ var Email = class _Email extends DatabaseProperty {
125384
125422
  return this._email;
125385
125423
  }
125386
125424
  set email(value) {
125425
+ if (value instanceof _Email) {
125426
+ value = value.toString();
125427
+ }
125387
125428
  if (value && typeof value === "string") {
125388
125429
  value = value.trim();
125389
125430
  value = value.toLowerCase();
125390
125431
  }
125391
125432
  if (_Email.isValid(value)) {
125392
125433
  this._email = value;
125434
+ this._isMalformed = false;
125393
125435
  } else {
125394
- throw new BadDataException(`Email ${value} is not in valid format.`);
125436
+ throw new BadDataException(
125437
+ `Email ${refusedValue(value)} is not in valid format.`
125438
+ );
125395
125439
  }
125396
125440
  }
125441
+ isMalformed() {
125442
+ return this._isMalformed;
125443
+ }
125397
125444
  static isValid(value) {
125398
- const re = (
125399
- // eslint-disable-next-line no-control-regex
125400
- /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/i
125401
- );
125402
- const isValid2 = re.test(value);
125403
- if (!isValid2) {
125445
+ if (typeof value !== "string" || !value || value.length > MAX_EMAIL_ADDRESS_LENGTH) {
125404
125446
  return false;
125405
125447
  }
125406
- return true;
125448
+ return ONE_EMAIL_ADDRESS.test(value);
125449
+ }
125450
+ /*
125451
+ * A read-only path: builds an Email from a value already stored, holding it
125452
+ * as-is when it is not one valid mailbox, so a single legacy row cannot fail
125453
+ * the whole query that reads it. Writes stay strict - see toDatabase. A
125454
+ * stored address is always text, so anything else is refused here as it
125455
+ * always was.
125456
+ */
125457
+ static fromStoredValueLenient(value) {
125458
+ if (typeof value !== "string") {
125459
+ throw new BadDataException(
125460
+ `Email ${refusedValue(value)} is not in valid format.`
125461
+ );
125462
+ }
125463
+ const trimmed = value.trim().toLowerCase();
125464
+ if (_Email.isValid(trimmed)) {
125465
+ return new _Email(trimmed);
125466
+ }
125467
+ const email = new _Email("placeholder@oneuptime.invalid");
125468
+ email._email = trimmed;
125469
+ email._isMalformed = true;
125470
+ return email;
125407
125471
  }
125408
125472
  toJSON() {
125409
125473
  return {
@@ -125455,7 +125519,13 @@ var Email = class _Email extends DatabaseProperty {
125455
125519
  }
125456
125520
  static fromJSON(json) {
125457
125521
  if (json["_type"] === "Email" /* Email */) {
125458
- return new _Email(json["value"] || "");
125522
+ const value = json["value"];
125523
+ if (typeof value !== "string" || !value.trim()) {
125524
+ throw new BadDataException(
125525
+ `Email ${refusedValue(value ?? "")} is not in valid format.`
125526
+ );
125527
+ }
125528
+ return _Email.fromStoredValueLenient(value);
125459
125529
  }
125460
125530
  throw new BadDataException("Invalid JSON: " + JSON.stringify(json));
125461
125531
  }
@@ -125481,13 +125551,21 @@ var Email = class _Email extends DatabaseProperty {
125481
125551
  if (typeof value === "string") {
125482
125552
  value = new _Email(value);
125483
125553
  }
125554
+ if (value instanceof _Email && value.isMalformed()) {
125555
+ throw new BadDataException(
125556
+ `Email ${refusedValue(value.toString())} is not in valid format.`
125557
+ );
125558
+ }
125484
125559
  return value.toString();
125485
125560
  }
125486
125561
  return null;
125487
125562
  }
125488
125563
  static fromDatabase(_value) {
125489
- if (_value) {
125490
- return new _Email(_value);
125564
+ if (_value instanceof _Email) {
125565
+ _value = _value.toString();
125566
+ }
125567
+ if (_value && (typeof _value !== "string" || _value.trim())) {
125568
+ return _Email.fromStoredValueLenient(_value);
125491
125569
  }
125492
125570
  return null;
125493
125571
  }
@@ -125605,7 +125683,7 @@ var URL2 = class _URL extends DatabaseProperty {
125605
125683
  const value = v.trim();
125606
125684
  if (!_URL.isValidOpaqueValue(value)) {
125607
125685
  throw new BadDataException(
125608
- "Phone number " + v + " is not in valid format."
125686
+ "Phone number " + refusedValue(v) + " is not in valid format."
125609
125687
  );
125610
125688
  }
125611
125689
  this._opaqueValue = value;
@@ -125743,7 +125821,7 @@ var URL2 = class _URL extends DatabaseProperty {
125743
125821
  ].includes(scheme);
125744
125822
  if (hasAuthorityMarker || isDangerousInAnHref) {
125745
125823
  throw new BadDataException(
125746
- "URL scheme " + scheme + ": is not supported."
125824
+ "URL scheme " + refusedValue(scheme) + ": is not supported."
125747
125825
  );
125748
125826
  }
125749
125827
  }
@@ -125902,7 +125980,7 @@ var URL2 = class _URL extends DatabaseProperty {
125902
125980
  }
125903
125981
  if (value instanceof _URL && value.isMalformed()) {
125904
125982
  throw new BadDataException(
125905
- "URL " + value.toString() + " is not in valid format."
125983
+ "URL " + refusedValue(value.toString()) + " is not in valid format."
125906
125984
  );
125907
125985
  }
125908
125986
  return value.toString();
@@ -126865,7 +126943,9 @@ var Color = class _Color extends DatabaseProperty {
126865
126943
  const re = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;
126866
126944
  const result = re.exec(color.toString());
126867
126945
  if (!result) {
126868
- throw new BadDataException("Invalid color: " + color.toString());
126946
+ throw new BadDataException(
126947
+ "Invalid color: " + refusedValue(color.toString())
126948
+ );
126869
126949
  }
126870
126950
  return {
126871
126951
  red: parseInt(result[1] ? result[1] : "0", 16),
@@ -126946,7 +127026,9 @@ var Domain = class _Domain extends DatabaseProperty {
126946
127026
  set domain(v) {
126947
127027
  const isValid2 = _Domain.isValidDomain(v);
126948
127028
  if (!isValid2) {
126949
- throw new BadDataException("Domain " + v + " is not in valid format.");
127029
+ throw new BadDataException(
127030
+ "Domain " + refusedValue(v) + " is not in valid format."
127031
+ );
126950
127032
  }
126951
127033
  this._domain = v;
126952
127034
  }
@@ -127697,7 +127779,7 @@ var ObjectID = class _ObjectID extends DatabaseProperty {
127697
127779
  static validateUUID(id) {
127698
127780
  if (!_ObjectID.isValidUUID(id.toString())) {
127699
127781
  throw new BadDataException(
127700
- `Invalid ID format: "${id}". Expected a valid UUID (e.g., "550e8400-e29b-41d4-a716-446655440000").`
127782
+ `Invalid ID format: "${refusedValue(id)}". Expected a valid UUID (e.g., "550e8400-e29b-41d4-a716-446655440000").`
127701
127783
  );
127702
127784
  }
127703
127785
  }
@@ -135749,7 +135831,9 @@ var Phone = class _Phone extends DatabaseProperty {
135749
135831
  const re = /^[+]?[(]?[0-9]{3}[)]?[-\s.]?[0-9]{3}[-\s.]?[0-9]{4,7}$/;
135750
135832
  const isValid2 = re.test(v);
135751
135833
  if (!isValid2) {
135752
- throw new BadDataException(`Phone is not in valid format: ${v}`);
135834
+ throw new BadDataException(
135835
+ `Phone is not in valid format: ${refusedValue(v)}`
135836
+ );
135753
135837
  }
135754
135838
  this._phone = v;
135755
135839
  }
@@ -344951,6 +345035,10 @@ var StatusPageSCIM = class extends DatabaseBaseModel {
344951
345035
  this.name = void 0;
344952
345036
  this.description = void 0;
344953
345037
  this.bearerToken = void 0;
345038
+ this.oauthClientSecretHash = void 0;
345039
+ this.oauthClientSecretExpiresAt = void 0;
345040
+ this.oauthPreviousClientSecretHash = void 0;
345041
+ this.oauthPreviousClientSecretExpiresAt = void 0;
344954
345042
  this.autoProvisionUsers = void 0;
344955
345043
  this.autoDeprovisionUsers = void 0;
344956
345044
  this.createdByUser = void 0;
@@ -345187,6 +345275,118 @@ __decorateClass([
345187
345275
  length: ColumnLength_default.LongText
345188
345276
  })
345189
345277
  ], StatusPageSCIM.prototype, "bearerToken", 2);
345278
+ __decorateClass([
345279
+ ColumnAccessControl_default({
345280
+ create: [
345281
+ Permission_default.ProjectOwner,
345282
+ Permission_default.ProjectAdmin,
345283
+ Permission_default.CreateStatusPageSSO
345284
+ ],
345285
+ read: [],
345286
+ update: [
345287
+ Permission_default.ProjectOwner,
345288
+ Permission_default.ProjectAdmin,
345289
+ Permission_default.EditStatusPageSSO
345290
+ ]
345291
+ }),
345292
+ TableColumn_default({
345293
+ required: false,
345294
+ hideColumnInDocumentation: true,
345295
+ type: TableColumnType_default.LongText,
345296
+ title: "OAuth Client Secret Hash",
345297
+ description: "SHA-256 hash of the connection's OAuth 2.0 client secret. The secret itself is shown once, when it is made, and never kept."
345298
+ }),
345299
+ Column({
345300
+ nullable: true,
345301
+ type: ColumnType_default.LongText,
345302
+ length: ColumnLength_default.LongText
345303
+ })
345304
+ ], StatusPageSCIM.prototype, "oauthClientSecretHash", 2);
345305
+ __decorateClass([
345306
+ ColumnAccessControl_default({
345307
+ create: [
345308
+ Permission_default.ProjectOwner,
345309
+ Permission_default.ProjectAdmin,
345310
+ Permission_default.CreateStatusPageSSO
345311
+ ],
345312
+ read: [
345313
+ Permission_default.ProjectOwner,
345314
+ Permission_default.ProjectAdmin,
345315
+ Permission_default.ReadStatusPageSSO
345316
+ ],
345317
+ update: [
345318
+ Permission_default.ProjectOwner,
345319
+ Permission_default.ProjectAdmin,
345320
+ Permission_default.EditStatusPageSSO
345321
+ ]
345322
+ }),
345323
+ TableColumn_default({
345324
+ required: false,
345325
+ type: TableColumnType_default.Date,
345326
+ title: "OAuth Client Secret Expires At",
345327
+ description: "When the connection's OAuth 2.0 client secret stops working. No access token is issued with an expired secret."
345328
+ }),
345329
+ Column({
345330
+ nullable: true,
345331
+ type: ColumnType_default.Date
345332
+ })
345333
+ ], StatusPageSCIM.prototype, "oauthClientSecretExpiresAt", 2);
345334
+ __decorateClass([
345335
+ ColumnAccessControl_default({
345336
+ create: [
345337
+ Permission_default.ProjectOwner,
345338
+ Permission_default.ProjectAdmin,
345339
+ Permission_default.CreateStatusPageSSO
345340
+ ],
345341
+ read: [],
345342
+ update: [
345343
+ Permission_default.ProjectOwner,
345344
+ Permission_default.ProjectAdmin,
345345
+ Permission_default.EditStatusPageSSO
345346
+ ]
345347
+ }),
345348
+ TableColumn_default({
345349
+ required: false,
345350
+ hideColumnInDocumentation: true,
345351
+ type: TableColumnType_default.LongText,
345352
+ title: "Previous OAuth Client Secret Hash",
345353
+ description: "SHA-256 hash of the client secret the current one replaced, which keeps working until it expires or is deleted."
345354
+ }),
345355
+ Column({
345356
+ nullable: true,
345357
+ type: ColumnType_default.LongText,
345358
+ length: ColumnLength_default.LongText
345359
+ })
345360
+ ], StatusPageSCIM.prototype, "oauthPreviousClientSecretHash", 2);
345361
+ __decorateClass([
345362
+ ColumnAccessControl_default({
345363
+ create: [
345364
+ Permission_default.ProjectOwner,
345365
+ Permission_default.ProjectAdmin,
345366
+ Permission_default.CreateStatusPageSSO
345367
+ ],
345368
+ read: [
345369
+ Permission_default.ProjectOwner,
345370
+ Permission_default.ProjectAdmin,
345371
+ Permission_default.ReadStatusPageSSO
345372
+ ],
345373
+ update: [
345374
+ Permission_default.ProjectOwner,
345375
+ Permission_default.ProjectAdmin,
345376
+ Permission_default.EditStatusPageSSO
345377
+ ]
345378
+ }),
345379
+ TableColumn_default({
345380
+ required: false,
345381
+ type: TableColumnType_default.Date,
345382
+ title: "Previous OAuth Client Secret Expires At",
345383
+ description: "When the previous OAuth 2.0 client secret stops working, unless it is deleted before."
345384
+ }),
345385
+ Column({
345386
+ nullable: true,
345387
+ type: ColumnType_default.Date
345388
+ })
345389
+ ], StatusPageSCIM.prototype, "oauthPreviousClientSecretExpiresAt", 2);
345190
345390
  __decorateClass([
345191
345391
  ColumnAccessControl_default({
345192
345392
  create: [
@@ -353825,6 +354025,200 @@ UserProjectSsoConsent = __decorateClass([
353825
354025
  })
353826
354026
  ], UserProjectSsoConsent);
353827
354027
 
354028
+ // ../Common/Models/DatabaseModels/UserProjectSsoIdentity.ts
354029
+ var UserProjectSsoIdentity = class extends DatabaseBaseModel {
354030
+ constructor() {
354031
+ super(...arguments);
354032
+ this.user = void 0;
354033
+ this.userId = void 0;
354034
+ this.project = void 0;
354035
+ this.projectId = void 0;
354036
+ this.projectSso = void 0;
354037
+ this.projectSsoId = void 0;
354038
+ this.objectId = void 0;
354039
+ }
354040
+ };
354041
+ __name(UserProjectSsoIdentity, "UserProjectSsoIdentity");
354042
+ __decorateClass([
354043
+ ColumnAccessControl_default({
354044
+ create: [],
354045
+ read: [],
354046
+ update: []
354047
+ }),
354048
+ TableColumn_default({
354049
+ manyToOneRelationColumn: "userId",
354050
+ type: TableColumnType_default.Entity,
354051
+ modelType: User_default,
354052
+ title: "User",
354053
+ description: "The account that is bound."
354054
+ }),
354055
+ ManyToOne(
354056
+ () => {
354057
+ return User_default;
354058
+ },
354059
+ {
354060
+ eager: false,
354061
+ nullable: false,
354062
+ onDelete: "CASCADE",
354063
+ orphanedRowAction: "nullify"
354064
+ }
354065
+ ),
354066
+ JoinColumn({ name: "userId" })
354067
+ ], UserProjectSsoIdentity.prototype, "user", 2);
354068
+ __decorateClass([
354069
+ ColumnAccessControl_default({
354070
+ create: [],
354071
+ read: [],
354072
+ update: []
354073
+ }),
354074
+ Index(),
354075
+ TableColumn_default({
354076
+ type: TableColumnType_default.ObjectID,
354077
+ required: true,
354078
+ title: "User ID",
354079
+ description: "ID of the account that is bound."
354080
+ }),
354081
+ Column({
354082
+ type: ColumnType_default.ObjectID,
354083
+ nullable: false,
354084
+ transformer: ObjectID.getDatabaseTransformer()
354085
+ })
354086
+ ], UserProjectSsoIdentity.prototype, "userId", 2);
354087
+ __decorateClass([
354088
+ ColumnAccessControl_default({
354089
+ create: [],
354090
+ read: [],
354091
+ update: []
354092
+ }),
354093
+ TableColumn_default({
354094
+ manyToOneRelationColumn: "projectId",
354095
+ type: TableColumnType_default.Entity,
354096
+ modelType: Project,
354097
+ title: "Project",
354098
+ description: "The project whose SAML provider the account signs in through."
354099
+ }),
354100
+ ManyToOne(
354101
+ () => {
354102
+ return Project;
354103
+ },
354104
+ {
354105
+ eager: false,
354106
+ nullable: false,
354107
+ onDelete: "CASCADE",
354108
+ orphanedRowAction: "nullify"
354109
+ }
354110
+ ),
354111
+ JoinColumn({ name: "projectId" })
354112
+ ], UserProjectSsoIdentity.prototype, "project", 2);
354113
+ __decorateClass([
354114
+ ColumnAccessControl_default({
354115
+ create: [],
354116
+ read: [],
354117
+ update: []
354118
+ }),
354119
+ Index(),
354120
+ TableColumn_default({
354121
+ type: TableColumnType_default.ObjectID,
354122
+ required: true,
354123
+ title: "Project ID",
354124
+ description: "ID of the project whose SAML provider the account signs in through."
354125
+ }),
354126
+ Column({
354127
+ type: ColumnType_default.ObjectID,
354128
+ nullable: false,
354129
+ transformer: ObjectID.getDatabaseTransformer()
354130
+ })
354131
+ ], UserProjectSsoIdentity.prototype, "projectId", 2);
354132
+ __decorateClass([
354133
+ ColumnAccessControl_default({
354134
+ create: [],
354135
+ read: [],
354136
+ update: []
354137
+ }),
354138
+ TableColumn_default({
354139
+ manyToOneRelationColumn: "projectSsoId",
354140
+ type: TableColumnType_default.Entity,
354141
+ modelType: ProjectSSO,
354142
+ title: "Project SSO",
354143
+ description: "The SAML provider the binding holds for."
354144
+ }),
354145
+ ManyToOne(
354146
+ () => {
354147
+ return ProjectSSO;
354148
+ },
354149
+ {
354150
+ eager: false,
354151
+ nullable: false,
354152
+ onDelete: "CASCADE",
354153
+ orphanedRowAction: "nullify"
354154
+ }
354155
+ ),
354156
+ JoinColumn({ name: "projectSsoId" })
354157
+ ], UserProjectSsoIdentity.prototype, "projectSso", 2);
354158
+ __decorateClass([
354159
+ ColumnAccessControl_default({
354160
+ create: [],
354161
+ read: [],
354162
+ update: []
354163
+ }),
354164
+ Index(),
354165
+ TableColumn_default({
354166
+ type: TableColumnType_default.ObjectID,
354167
+ required: true,
354168
+ title: "Project SSO ID",
354169
+ description: "ID of the SAML provider the binding holds for."
354170
+ }),
354171
+ Column({
354172
+ type: ColumnType_default.ObjectID,
354173
+ nullable: false,
354174
+ transformer: ObjectID.getDatabaseTransformer()
354175
+ })
354176
+ ], UserProjectSsoIdentity.prototype, "projectSsoId", 2);
354177
+ __decorateClass([
354178
+ ColumnAccessControl_default({
354179
+ create: [],
354180
+ read: [],
354181
+ update: []
354182
+ }),
354183
+ TableColumn_default({
354184
+ type: TableColumnType_default.ShortText,
354185
+ required: true,
354186
+ title: "Object ID",
354187
+ description: "The identity provider's immutable ID for the person: Microsoft Entra ID's object ID, a GUID kept in lower case."
354188
+ }),
354189
+ Column({
354190
+ type: ColumnType_default.ShortText,
354191
+ length: ColumnLength_default.ShortText,
354192
+ nullable: false
354193
+ })
354194
+ ], UserProjectSsoIdentity.prototype, "objectId", 2);
354195
+ UserProjectSsoIdentity = __decorateClass([
354196
+ TableAccessControl_default({
354197
+ create: [],
354198
+ read: [],
354199
+ delete: [],
354200
+ update: []
354201
+ }),
354202
+ Index(
354203
+ "IDX_UserProjectSsoIdentity_projectSsoId_userId",
354204
+ ["projectSsoId", "userId"],
354205
+ {
354206
+ unique: true,
354207
+ where: '"deletedAt" IS NULL'
354208
+ }
354209
+ ),
354210
+ TableMetadata_default({
354211
+ tableName: "UserProjectSsoIdentity",
354212
+ singularName: "Project SSO Identity",
354213
+ pluralName: "Project SSO Identities",
354214
+ icon: IconProp_default.Lock,
354215
+ tableDescription: "Binds an account to the identity provider's immutable ID for the person it signed in as through a project's SAML provider."
354216
+ }),
354217
+ Entity({
354218
+ name: "UserProjectSsoIdentity"
354219
+ })
354220
+ ], UserProjectSsoIdentity);
354221
+
353828
354222
  // ../Common/Models/DatabaseModels/UserNotificationSetting.ts
353829
354223
  var UserNotificationSetting = class extends DatabaseBaseModel {
353830
354224
  constructor() {
@@ -447487,6 +447881,10 @@ var ProjectSCIM = class extends DatabaseBaseModel {
447487
447881
  this.name = void 0;
447488
447882
  this.description = void 0;
447489
447883
  this.bearerToken = void 0;
447884
+ this.oauthClientSecretHash = void 0;
447885
+ this.oauthClientSecretExpiresAt = void 0;
447886
+ this.oauthPreviousClientSecretHash = void 0;
447887
+ this.oauthPreviousClientSecretExpiresAt = void 0;
447490
447888
  this.teams = void 0;
447491
447889
  this.autoProvisionUsers = void 0;
447492
447890
  this.autoDeprovisionUsers = void 0;
@@ -447636,6 +448034,78 @@ __decorateClass([
447636
448034
  length: ColumnLength_default.LongText
447637
448035
  })
447638
448036
  ], ProjectSCIM.prototype, "bearerToken", 2);
448037
+ __decorateClass([
448038
+ ColumnAccessControl_default({
448039
+ create: [Permission_default.ProjectOwner],
448040
+ read: [],
448041
+ update: [Permission_default.ProjectOwner]
448042
+ }),
448043
+ TableColumn_default({
448044
+ required: false,
448045
+ hideColumnInDocumentation: true,
448046
+ type: TableColumnType_default.LongText,
448047
+ title: "OAuth Client Secret Hash",
448048
+ description: "SHA-256 hash of the connection's OAuth 2.0 client secret. The secret itself is shown once, when it is made, and never kept."
448049
+ }),
448050
+ Column({
448051
+ nullable: true,
448052
+ type: ColumnType_default.LongText,
448053
+ length: ColumnLength_default.LongText
448054
+ })
448055
+ ], ProjectSCIM.prototype, "oauthClientSecretHash", 2);
448056
+ __decorateClass([
448057
+ ColumnAccessControl_default({
448058
+ create: [Permission_default.ProjectOwner],
448059
+ read: [Permission_default.ProjectOwner],
448060
+ update: [Permission_default.ProjectOwner]
448061
+ }),
448062
+ TableColumn_default({
448063
+ required: false,
448064
+ type: TableColumnType_default.Date,
448065
+ title: "OAuth Client Secret Expires At",
448066
+ description: "When the connection's OAuth 2.0 client secret stops working. No access token is issued with an expired secret."
448067
+ }),
448068
+ Column({
448069
+ nullable: true,
448070
+ type: ColumnType_default.Date
448071
+ })
448072
+ ], ProjectSCIM.prototype, "oauthClientSecretExpiresAt", 2);
448073
+ __decorateClass([
448074
+ ColumnAccessControl_default({
448075
+ create: [Permission_default.ProjectOwner],
448076
+ read: [],
448077
+ update: [Permission_default.ProjectOwner]
448078
+ }),
448079
+ TableColumn_default({
448080
+ required: false,
448081
+ hideColumnInDocumentation: true,
448082
+ type: TableColumnType_default.LongText,
448083
+ title: "Previous OAuth Client Secret Hash",
448084
+ description: "SHA-256 hash of the client secret the current one replaced, which keeps working until it expires or is deleted."
448085
+ }),
448086
+ Column({
448087
+ nullable: true,
448088
+ type: ColumnType_default.LongText,
448089
+ length: ColumnLength_default.LongText
448090
+ })
448091
+ ], ProjectSCIM.prototype, "oauthPreviousClientSecretHash", 2);
448092
+ __decorateClass([
448093
+ ColumnAccessControl_default({
448094
+ create: [Permission_default.ProjectOwner],
448095
+ read: [Permission_default.ProjectOwner],
448096
+ update: [Permission_default.ProjectOwner]
448097
+ }),
448098
+ TableColumn_default({
448099
+ required: false,
448100
+ type: TableColumnType_default.Date,
448101
+ title: "Previous OAuth Client Secret Expires At",
448102
+ description: "When the previous OAuth 2.0 client secret stops working, unless it is deleted before."
448103
+ }),
448104
+ Column({
448105
+ nullable: true,
448106
+ type: ColumnType_default.Date
448107
+ })
448108
+ ], ProjectSCIM.prototype, "oauthPreviousClientSecretExpiresAt", 2);
447639
448109
  __decorateClass([
447640
448110
  ColumnAccessControl_default({
447641
448111
  create: [Permission_default.ProjectOwner],
@@ -448364,6 +448834,256 @@ ProjectSCIMLog = __decorateClass([
448364
448834
  })
448365
448835
  ], ProjectSCIMLog);
448366
448836
 
448837
+ // ../Common/Models/DatabaseModels/ProjectSCIMUser.ts
448838
+ var ProjectSCIMUser = class extends DatabaseBaseModel {
448839
+ constructor() {
448840
+ super(...arguments);
448841
+ this.project = void 0;
448842
+ this.projectId = void 0;
448843
+ this.projectScim = void 0;
448844
+ this.projectScimId = void 0;
448845
+ this.user = void 0;
448846
+ this.userId = void 0;
448847
+ this.isActive = void 0;
448848
+ this.userName = void 0;
448849
+ this.externalId = void 0;
448850
+ this.scimAttributes = void 0;
448851
+ }
448852
+ };
448853
+ __name(ProjectSCIMUser, "ProjectSCIMUser");
448854
+ __decorateClass([
448855
+ ColumnAccessControl_default({
448856
+ create: [],
448857
+ read: [],
448858
+ update: []
448859
+ }),
448860
+ TableColumn_default({
448861
+ manyToOneRelationColumn: "projectId",
448862
+ type: TableColumnType_default.Entity,
448863
+ modelType: Project,
448864
+ title: "Project",
448865
+ description: "The project the connection belongs to."
448866
+ }),
448867
+ ManyToOne(
448868
+ () => {
448869
+ return Project;
448870
+ },
448871
+ {
448872
+ eager: false,
448873
+ nullable: false,
448874
+ onDelete: "CASCADE",
448875
+ orphanedRowAction: "nullify"
448876
+ }
448877
+ ),
448878
+ JoinColumn({ name: "projectId" })
448879
+ ], ProjectSCIMUser.prototype, "project", 2);
448880
+ __decorateClass([
448881
+ ColumnAccessControl_default({
448882
+ create: [],
448883
+ read: [],
448884
+ update: []
448885
+ }),
448886
+ Index(),
448887
+ TableColumn_default({
448888
+ type: TableColumnType_default.ObjectID,
448889
+ required: true,
448890
+ title: "Project ID",
448891
+ description: "ID of the project the connection belongs to."
448892
+ }),
448893
+ Column({
448894
+ type: ColumnType_default.ObjectID,
448895
+ nullable: false,
448896
+ transformer: ObjectID.getDatabaseTransformer()
448897
+ })
448898
+ ], ProjectSCIMUser.prototype, "projectId", 2);
448899
+ __decorateClass([
448900
+ ColumnAccessControl_default({
448901
+ create: [],
448902
+ read: [],
448903
+ update: []
448904
+ }),
448905
+ TableColumn_default({
448906
+ manyToOneRelationColumn: "projectScimId",
448907
+ type: TableColumnType_default.Entity,
448908
+ modelType: ProjectSCIM,
448909
+ title: "SCIM Connection",
448910
+ description: "The connection that provisioned the user."
448911
+ }),
448912
+ ManyToOne(
448913
+ () => {
448914
+ return ProjectSCIM;
448915
+ },
448916
+ {
448917
+ eager: false,
448918
+ nullable: false,
448919
+ onDelete: "CASCADE",
448920
+ orphanedRowAction: "nullify"
448921
+ }
448922
+ ),
448923
+ JoinColumn({ name: "projectScimId" })
448924
+ ], ProjectSCIMUser.prototype, "projectScim", 2);
448925
+ __decorateClass([
448926
+ ColumnAccessControl_default({
448927
+ create: [],
448928
+ read: [],
448929
+ update: []
448930
+ }),
448931
+ Index(),
448932
+ TableColumn_default({
448933
+ type: TableColumnType_default.ObjectID,
448934
+ required: true,
448935
+ title: "SCIM Connection ID",
448936
+ description: "ID of the connection that provisioned the user."
448937
+ }),
448938
+ Column({
448939
+ type: ColumnType_default.ObjectID,
448940
+ nullable: false,
448941
+ transformer: ObjectID.getDatabaseTransformer()
448942
+ })
448943
+ ], ProjectSCIMUser.prototype, "projectScimId", 2);
448944
+ __decorateClass([
448945
+ ColumnAccessControl_default({
448946
+ create: [],
448947
+ read: [],
448948
+ update: []
448949
+ }),
448950
+ TableColumn_default({
448951
+ manyToOneRelationColumn: "userId",
448952
+ type: TableColumnType_default.Entity,
448953
+ modelType: User_default,
448954
+ title: "User",
448955
+ description: "The OneUptime account the SCIM user is."
448956
+ }),
448957
+ ManyToOne(
448958
+ () => {
448959
+ return User_default;
448960
+ },
448961
+ {
448962
+ eager: false,
448963
+ nullable: false,
448964
+ onDelete: "CASCADE",
448965
+ orphanedRowAction: "nullify"
448966
+ }
448967
+ ),
448968
+ JoinColumn({ name: "userId" })
448969
+ ], ProjectSCIMUser.prototype, "user", 2);
448970
+ __decorateClass([
448971
+ ColumnAccessControl_default({
448972
+ create: [],
448973
+ read: [],
448974
+ update: []
448975
+ }),
448976
+ Index(),
448977
+ TableColumn_default({
448978
+ type: TableColumnType_default.ObjectID,
448979
+ required: true,
448980
+ title: "User ID",
448981
+ description: "ID of the OneUptime account the SCIM user is."
448982
+ }),
448983
+ Column({
448984
+ type: ColumnType_default.ObjectID,
448985
+ nullable: false,
448986
+ transformer: ObjectID.getDatabaseTransformer()
448987
+ })
448988
+ ], ProjectSCIMUser.prototype, "userId", 2);
448989
+ __decorateClass([
448990
+ ColumnAccessControl_default({
448991
+ create: [],
448992
+ read: [],
448993
+ update: []
448994
+ }),
448995
+ TableColumn_default({
448996
+ type: TableColumnType_default.Boolean,
448997
+ required: true,
448998
+ title: "Active",
448999
+ description: "Whether the identity provider has the user active (SCIM's active attribute)."
449000
+ }),
449001
+ Column({
449002
+ type: ColumnType_default.Boolean,
449003
+ nullable: false,
449004
+ default: true
449005
+ })
449006
+ ], ProjectSCIMUser.prototype, "isActive", 2);
449007
+ __decorateClass([
449008
+ ColumnAccessControl_default({
449009
+ create: [],
449010
+ read: [],
449011
+ update: []
449012
+ }),
449013
+ TableColumn_default({
449014
+ type: TableColumnType_default.LongText,
449015
+ required: false,
449016
+ title: "User Name",
449017
+ description: "The userName the identity provider sent, as it sent it. Usually the account's email address."
449018
+ }),
449019
+ Column({
449020
+ type: ColumnType_default.LongText,
449021
+ length: ColumnLength_default.LongText,
449022
+ nullable: true
449023
+ })
449024
+ ], ProjectSCIMUser.prototype, "userName", 2);
449025
+ __decorateClass([
449026
+ ColumnAccessControl_default({
449027
+ create: [],
449028
+ read: [],
449029
+ update: []
449030
+ }),
449031
+ TableColumn_default({
449032
+ type: TableColumnType_default.LongText,
449033
+ required: false,
449034
+ title: "External ID",
449035
+ description: "The identity provider's own id for the user (SCIM's externalId), as it sent it."
449036
+ }),
449037
+ Column({
449038
+ type: ColumnType_default.LongText,
449039
+ length: ColumnLength_default.LongText,
449040
+ nullable: true
449041
+ })
449042
+ ], ProjectSCIMUser.prototype, "externalId", 2);
449043
+ __decorateClass([
449044
+ ColumnAccessControl_default({
449045
+ create: [],
449046
+ read: [],
449047
+ update: []
449048
+ }),
449049
+ TableColumn_default({
449050
+ type: TableColumnType_default.JSON,
449051
+ required: false,
449052
+ title: "SCIM Attributes",
449053
+ description: "The rest of what the identity provider last sent for the user: displayName, name and emails."
449054
+ }),
449055
+ Column({
449056
+ type: ColumnType_default.JSON,
449057
+ nullable: true
449058
+ })
449059
+ ], ProjectSCIMUser.prototype, "scimAttributes", 2);
449060
+ ProjectSCIMUser = __decorateClass([
449061
+ TableAccessControl_default({
449062
+ create: [],
449063
+ read: [],
449064
+ delete: [],
449065
+ update: []
449066
+ }),
449067
+ Index(
449068
+ "IDX_ProjectSCIMUser_projectScimId_userId",
449069
+ ["projectScimId", "userId"],
449070
+ {
449071
+ unique: true,
449072
+ where: '"deletedAt" IS NULL'
449073
+ }
449074
+ ),
449075
+ TableMetadata_default({
449076
+ tableName: "ProjectSCIMUser",
449077
+ singularName: "SCIM User",
449078
+ pluralName: "SCIM Users",
449079
+ icon: IconProp_default.User,
449080
+ tableDescription: "A user a project's SCIM connection provisioned: whether the identity provider has them active, and what it sent for them."
449081
+ }),
449082
+ Entity({
449083
+ name: "ProjectSCIMUser"
449084
+ })
449085
+ ], ProjectSCIMUser);
449086
+
448367
449087
  // ../Common/Models/DatabaseModels/StatusPageSCIMLog.ts
448368
449088
  var StatusPageSCIMLog = class extends DatabaseBaseModel {
448369
449089
  constructor() {
@@ -450322,6 +451042,479 @@ MarketplaceCharge = __decorateClass([
450322
451042
  })
450323
451043
  ], MarketplaceCharge);
450324
451044
 
451045
+ // ../Common/Models/DatabaseModels/VercelMarketplaceInstallation.ts
451046
+ var VercelMarketplaceInstallation = class extends DatabaseBaseModel {
451047
+ constructor() {
451048
+ super(...arguments);
451049
+ this.installationId = void 0;
451050
+ this.vercelAccountId = void 0;
451051
+ this.accessToken = void 0;
451052
+ this.tokenType = void 0;
451053
+ this.scopes = void 0;
451054
+ this.acceptedPolicies = void 0;
451055
+ this.accountName = void 0;
451056
+ this.accountUrl = void 0;
451057
+ this.contactEmail = void 0;
451058
+ this.contactName = void 0;
451059
+ this.status = void 0;
451060
+ this.deleteRequestedAt = void 0;
451061
+ this.invoicedUntil = void 0;
451062
+ this.billingDataSentAt = void 0;
451063
+ this.lastBillingError = void 0;
451064
+ }
451065
+ };
451066
+ __name(VercelMarketplaceInstallation, "VercelMarketplaceInstallation");
451067
+ __decorateClass([
451068
+ ColumnAccessControl_default({
451069
+ create: [],
451070
+ read: [],
451071
+ update: []
451072
+ }),
451073
+ Index({ unique: true }),
451074
+ TableColumn_default({
451075
+ required: true,
451076
+ type: TableColumnType_default.ShortText,
451077
+ title: "Installation ID",
451078
+ description: "Vercel's ID of the installation (icfg_...). A reinstall gets a new one.",
451079
+ example: "icfg_7BsYazjxsiKpsDTXiAUcOJmP"
451080
+ }),
451081
+ Column({
451082
+ nullable: false,
451083
+ type: ColumnType_default.ShortText,
451084
+ length: ColumnLength_default.ShortText
451085
+ })
451086
+ ], VercelMarketplaceInstallation.prototype, "installationId", 2);
451087
+ __decorateClass([
451088
+ ColumnAccessControl_default({
451089
+ create: [],
451090
+ read: [],
451091
+ update: []
451092
+ }),
451093
+ Index(),
451094
+ TableColumn_default({
451095
+ required: false,
451096
+ type: TableColumnType_default.ShortText,
451097
+ title: "Vercel Account ID",
451098
+ description: "The Vercel team (account) that installed OneUptime.",
451099
+ example: "team_LLHUOMOoDlqOp8wPE4kFo9pE"
451100
+ }),
451101
+ Column({
451102
+ nullable: true,
451103
+ type: ColumnType_default.ShortText,
451104
+ length: ColumnLength_default.ShortText
451105
+ })
451106
+ ], VercelMarketplaceInstallation.prototype, "vercelAccountId", 2);
451107
+ __decorateClass([
451108
+ ColumnAccessControl_default({
451109
+ create: [],
451110
+ read: [],
451111
+ update: []
451112
+ }),
451113
+ TableColumn_default({
451114
+ required: false,
451115
+ type: TableColumnType_default.VeryLongText,
451116
+ encrypted: true,
451117
+ title: "Access Token",
451118
+ description: "The token Vercel gave OneUptime for this installation, which calls Vercel's marketplace API. Encrypted at rest and never returned by the API.",
451119
+ hideColumnInDocumentation: true
451120
+ }),
451121
+ Column({
451122
+ nullable: true,
451123
+ type: ColumnType_default.VeryLongText
451124
+ })
451125
+ ], VercelMarketplaceInstallation.prototype, "accessToken", 2);
451126
+ __decorateClass([
451127
+ ColumnAccessControl_default({
451128
+ create: [],
451129
+ read: [],
451130
+ update: []
451131
+ }),
451132
+ TableColumn_default({
451133
+ required: false,
451134
+ type: TableColumnType_default.ShortText,
451135
+ title: "Token Type",
451136
+ description: "The access token's type, as Vercel gave it (Bearer).",
451137
+ example: "Bearer"
451138
+ }),
451139
+ Column({
451140
+ nullable: true,
451141
+ type: ColumnType_default.ShortText,
451142
+ length: ColumnLength_default.ShortText
451143
+ })
451144
+ ], VercelMarketplaceInstallation.prototype, "tokenType", 2);
451145
+ __decorateClass([
451146
+ ColumnAccessControl_default({
451147
+ create: [],
451148
+ read: [],
451149
+ update: []
451150
+ }),
451151
+ TableColumn_default({
451152
+ required: false,
451153
+ type: TableColumnType_default.JSON,
451154
+ title: "Scopes",
451155
+ description: "The Vercel API scopes the team granted the integration, such as read:project."
451156
+ }),
451157
+ Column({
451158
+ nullable: true,
451159
+ type: ColumnType_default.JSON
451160
+ })
451161
+ ], VercelMarketplaceInstallation.prototype, "scopes", 2);
451162
+ __decorateClass([
451163
+ ColumnAccessControl_default({
451164
+ create: [],
451165
+ read: [],
451166
+ update: []
451167
+ }),
451168
+ TableColumn_default({
451169
+ required: false,
451170
+ type: TableColumnType_default.JSON,
451171
+ title: "Accepted Policies",
451172
+ description: "The policies the team accepted while installing (terms of service, privacy policy...), with when.",
451173
+ example: { toc: "2026-10-18T10:00:00Z" }
451174
+ }),
451175
+ Column({
451176
+ nullable: true,
451177
+ type: ColumnType_default.JSON
451178
+ })
451179
+ ], VercelMarketplaceInstallation.prototype, "acceptedPolicies", 2);
451180
+ __decorateClass([
451181
+ ColumnAccessControl_default({
451182
+ create: [],
451183
+ read: [],
451184
+ update: []
451185
+ }),
451186
+ TableColumn_default({
451187
+ required: false,
451188
+ type: TableColumnType_default.LongText,
451189
+ title: "Account Name",
451190
+ description: "The Vercel team's name.",
451191
+ example: "Acme"
451192
+ }),
451193
+ Column({
451194
+ nullable: true,
451195
+ type: ColumnType_default.LongText,
451196
+ length: ColumnLength_default.LongText
451197
+ })
451198
+ ], VercelMarketplaceInstallation.prototype, "accountName", 2);
451199
+ __decorateClass([
451200
+ ColumnAccessControl_default({
451201
+ create: [],
451202
+ read: [],
451203
+ update: []
451204
+ }),
451205
+ TableColumn_default({
451206
+ required: false,
451207
+ type: TableColumnType_default.LongText,
451208
+ title: "Account URL",
451209
+ description: "The installation in the Vercel dashboard.",
451210
+ example: "https://vercel.com/acme/~/integrations/oneuptime"
451211
+ }),
451212
+ Column({
451213
+ nullable: true,
451214
+ type: ColumnType_default.LongText,
451215
+ length: ColumnLength_default.LongText
451216
+ })
451217
+ ], VercelMarketplaceInstallation.prototype, "accountUrl", 2);
451218
+ __decorateClass([
451219
+ ColumnAccessControl_default({
451220
+ create: [],
451221
+ read: [],
451222
+ update: []
451223
+ }),
451224
+ TableColumn_default({
451225
+ required: false,
451226
+ type: TableColumnType_default.Email,
451227
+ title: "Contact Email",
451228
+ description: "Who Vercel names as the team's contact for the installation.",
451229
+ example: "owner@acme.com"
451230
+ }),
451231
+ Column({
451232
+ nullable: true,
451233
+ type: ColumnType_default.Email,
451234
+ length: ColumnLength_default.Email
451235
+ })
451236
+ ], VercelMarketplaceInstallation.prototype, "contactEmail", 2);
451237
+ __decorateClass([
451238
+ ColumnAccessControl_default({
451239
+ create: [],
451240
+ read: [],
451241
+ update: []
451242
+ }),
451243
+ TableColumn_default({
451244
+ required: false,
451245
+ type: TableColumnType_default.LongText,
451246
+ title: "Contact Name",
451247
+ description: "The contact's name, where Vercel gives one.",
451248
+ example: "Ada Lovelace"
451249
+ }),
451250
+ Column({
451251
+ nullable: true,
451252
+ type: ColumnType_default.LongText,
451253
+ length: ColumnLength_default.LongText
451254
+ })
451255
+ ], VercelMarketplaceInstallation.prototype, "contactName", 2);
451256
+ __decorateClass([
451257
+ ColumnAccessControl_default({
451258
+ create: [],
451259
+ read: [],
451260
+ update: []
451261
+ }),
451262
+ Index(),
451263
+ TableColumn_default({
451264
+ required: true,
451265
+ type: TableColumnType_default.ShortText,
451266
+ title: "Status",
451267
+ description: "Active, DeletePending (uninstalled; the final invoice is still to be sent) or Deleted.",
451268
+ example: "Active"
451269
+ }),
451270
+ Column({
451271
+ nullable: false,
451272
+ type: ColumnType_default.ShortText,
451273
+ length: ColumnLength_default.ShortText
451274
+ })
451275
+ ], VercelMarketplaceInstallation.prototype, "status", 2);
451276
+ __decorateClass([
451277
+ ColumnAccessControl_default({
451278
+ create: [],
451279
+ read: [],
451280
+ update: []
451281
+ }),
451282
+ TableColumn_default({
451283
+ required: false,
451284
+ type: TableColumnType_default.Date,
451285
+ title: "Delete Requested At",
451286
+ description: "When Vercel asked OneUptime to delete the installation.",
451287
+ example: "2026-10-18T10:00:00.000Z"
451288
+ }),
451289
+ Column({
451290
+ nullable: true,
451291
+ type: ColumnType_default.Date
451292
+ })
451293
+ ], VercelMarketplaceInstallation.prototype, "deleteRequestedAt", 2);
451294
+ __decorateClass([
451295
+ ColumnAccessControl_default({
451296
+ create: [],
451297
+ read: [],
451298
+ update: []
451299
+ }),
451300
+ TableColumn_default({
451301
+ required: false,
451302
+ type: TableColumnType_default.Date,
451303
+ title: "Invoiced Until",
451304
+ description: "The end of the last period OneUptime sent Vercel an invoice for. The next invoice starts here.",
451305
+ example: "2026-10-01T00:00:00.000Z"
451306
+ }),
451307
+ Column({
451308
+ nullable: true,
451309
+ type: ColumnType_default.Date
451310
+ })
451311
+ ], VercelMarketplaceInstallation.prototype, "invoicedUntil", 2);
451312
+ __decorateClass([
451313
+ ColumnAccessControl_default({
451314
+ create: [],
451315
+ read: [],
451316
+ update: []
451317
+ }),
451318
+ TableColumn_default({
451319
+ required: false,
451320
+ type: TableColumnType_default.Date,
451321
+ title: "Billing Data Sent At",
451322
+ description: "When OneUptime last sent Vercel the running totals of the current period.",
451323
+ example: "2026-10-18T10:10:00.000Z"
451324
+ }),
451325
+ Column({
451326
+ nullable: true,
451327
+ type: ColumnType_default.Date
451328
+ })
451329
+ ], VercelMarketplaceInstallation.prototype, "billingDataSentAt", 2);
451330
+ __decorateClass([
451331
+ ColumnAccessControl_default({
451332
+ create: [],
451333
+ read: [],
451334
+ update: []
451335
+ }),
451336
+ TableColumn_default({
451337
+ required: false,
451338
+ type: TableColumnType_default.LongText,
451339
+ title: "Last Billing Error",
451340
+ description: "Why Vercel last refused, or could not be sent, this installation's usage or invoice. Empty once one goes through."
451341
+ }),
451342
+ Column({
451343
+ nullable: true,
451344
+ type: ColumnType_default.LongText,
451345
+ length: ColumnLength_default.LongText
451346
+ })
451347
+ ], VercelMarketplaceInstallation.prototype, "lastBillingError", 2);
451348
+ VercelMarketplaceInstallation = __decorateClass([
451349
+ TableAccessControl_default({
451350
+ create: [],
451351
+ read: [],
451352
+ update: [],
451353
+ delete: []
451354
+ }),
451355
+ CrudApiEndpoint_default(new Route("/vercel-marketplace-installation")),
451356
+ TableMetadata_default({
451357
+ tableName: "VercelMarketplaceInstallation",
451358
+ singularName: "Vercel Marketplace Installation",
451359
+ pluralName: "Vercel Marketplace Installations",
451360
+ icon: IconProp_default.Billing,
451361
+ tableDescription: "Vercel teams that installed OneUptime from Vercel Marketplace, and the access token OneUptime calls Vercel with for them."
451362
+ }),
451363
+ Entity({
451364
+ name: "VercelMarketplaceInstallation"
451365
+ })
451366
+ ], VercelMarketplaceInstallation);
451367
+
451368
+ // ../Common/Models/DatabaseModels/VercelMarketplaceConnection.ts
451369
+ var VercelMarketplaceConnection = class extends DatabaseBaseModel {
451370
+ constructor() {
451371
+ super(...arguments);
451372
+ this.marketplaceSubscriptionId = void 0;
451373
+ this.projectId = void 0;
451374
+ this.vercelProjectId = void 0;
451375
+ this.vercelProjectName = void 0;
451376
+ this.productionDomain = void 0;
451377
+ this.monitorId = void 0;
451378
+ }
451379
+ };
451380
+ __name(VercelMarketplaceConnection, "VercelMarketplaceConnection");
451381
+ __decorateClass([
451382
+ ColumnAccessControl_default({
451383
+ create: [],
451384
+ read: [],
451385
+ update: []
451386
+ }),
451387
+ Index(),
451388
+ TableColumn_default({
451389
+ required: true,
451390
+ type: TableColumnType_default.ObjectID,
451391
+ title: "Marketplace Subscription ID",
451392
+ description: "The resource the Vercel project is connected to: its marketplace purchase.",
451393
+ example: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
451394
+ }),
451395
+ Column({
451396
+ nullable: false,
451397
+ type: ColumnType_default.ObjectID,
451398
+ transformer: ObjectID.getDatabaseTransformer()
451399
+ })
451400
+ ], VercelMarketplaceConnection.prototype, "marketplaceSubscriptionId", 2);
451401
+ __decorateClass([
451402
+ ColumnAccessControl_default({
451403
+ create: [],
451404
+ read: [],
451405
+ update: []
451406
+ }),
451407
+ Index(),
451408
+ TableColumn_default({
451409
+ required: true,
451410
+ type: TableColumnType_default.ObjectID,
451411
+ title: "Project ID",
451412
+ description: "The OneUptime project of the resource.",
451413
+ example: "5f8b9c0d-e1f2-3a4b-5c6d-7e8f9a0b1c2d"
451414
+ }),
451415
+ Column({
451416
+ nullable: false,
451417
+ type: ColumnType_default.ObjectID,
451418
+ transformer: ObjectID.getDatabaseTransformer()
451419
+ })
451420
+ ], VercelMarketplaceConnection.prototype, "projectId", 2);
451421
+ __decorateClass([
451422
+ ColumnAccessControl_default({
451423
+ create: [],
451424
+ read: [],
451425
+ update: []
451426
+ }),
451427
+ TableColumn_default({
451428
+ required: true,
451429
+ type: TableColumnType_default.ShortText,
451430
+ title: "Vercel Project ID",
451431
+ description: "The connected Vercel project.",
451432
+ example: "prj_ndlgr43fadlPyCtREAqxxdyFK"
451433
+ }),
451434
+ Column({
451435
+ nullable: false,
451436
+ type: ColumnType_default.ShortText,
451437
+ length: ColumnLength_default.ShortText
451438
+ })
451439
+ ], VercelMarketplaceConnection.prototype, "vercelProjectId", 2);
451440
+ __decorateClass([
451441
+ ColumnAccessControl_default({
451442
+ create: [],
451443
+ read: [],
451444
+ update: []
451445
+ }),
451446
+ TableColumn_default({
451447
+ required: false,
451448
+ type: TableColumnType_default.LongText,
451449
+ title: "Vercel Project Name",
451450
+ description: "The Vercel project's name, as Vercel last gave it.",
451451
+ example: "storefront"
451452
+ }),
451453
+ Column({
451454
+ nullable: true,
451455
+ type: ColumnType_default.LongText,
451456
+ length: ColumnLength_default.LongText
451457
+ })
451458
+ ], VercelMarketplaceConnection.prototype, "vercelProjectName", 2);
451459
+ __decorateClass([
451460
+ ColumnAccessControl_default({
451461
+ create: [],
451462
+ read: [],
451463
+ update: []
451464
+ }),
451465
+ TableColumn_default({
451466
+ required: false,
451467
+ type: TableColumnType_default.LongText,
451468
+ title: "Production Domain",
451469
+ description: "The Vercel project's production domain, which the monitor checks. Empty until the project has one.",
451470
+ example: "storefront.vercel.app"
451471
+ }),
451472
+ Column({
451473
+ nullable: true,
451474
+ type: ColumnType_default.LongText,
451475
+ length: ColumnLength_default.LongText
451476
+ })
451477
+ ], VercelMarketplaceConnection.prototype, "productionDomain", 2);
451478
+ __decorateClass([
451479
+ ColumnAccessControl_default({
451480
+ create: [],
451481
+ read: [],
451482
+ update: []
451483
+ }),
451484
+ TableColumn_default({
451485
+ required: false,
451486
+ type: TableColumnType_default.ObjectID,
451487
+ title: "Monitor ID",
451488
+ description: "The website monitor OneUptime made for the production domain, if it made one.",
451489
+ example: "b1c2d3e4-f5a6-7890-abcd-ef1234567890"
451490
+ }),
451491
+ Column({
451492
+ nullable: true,
451493
+ type: ColumnType_default.ObjectID,
451494
+ transformer: ObjectID.getDatabaseTransformer()
451495
+ })
451496
+ ], VercelMarketplaceConnection.prototype, "monitorId", 2);
451497
+ VercelMarketplaceConnection = __decorateClass([
451498
+ TableAccessControl_default({
451499
+ create: [],
451500
+ read: [],
451501
+ update: [],
451502
+ delete: []
451503
+ }),
451504
+ CrudApiEndpoint_default(new Route("/vercel-marketplace-connection")),
451505
+ TableMetadata_default({
451506
+ tableName: "VercelMarketplaceConnection",
451507
+ singularName: "Vercel Marketplace Connection",
451508
+ pluralName: "Vercel Marketplace Connections",
451509
+ icon: IconProp_default.Link,
451510
+ tableDescription: "Vercel projects connected to a OneUptime resource from Vercel Marketplace, and the monitor that watches each one's production domain."
451511
+ }),
451512
+ Entity({
451513
+ name: "VercelMarketplaceConnection"
451514
+ }),
451515
+ Index(["marketplaceSubscriptionId", "vercelProjectId"], { unique: true })
451516
+ ], VercelMarketplaceConnection);
451517
+
450325
451518
  // ../Common/Models/DatabaseModels/UserNotificationEmailRollupItem.ts
450326
451519
  var UserNotificationEmailRollupItem = class extends DatabaseBaseModel {
450327
451520
  constructor() {
@@ -452224,6 +453417,7 @@ var AllModelTypes = [
452224
453417
  DataSource2,
452225
453418
  UserSession_default,
452226
453419
  UserProjectSsoConsent,
453420
+ UserProjectSsoIdentity,
452227
453421
  UserTotpAuth_default,
452228
453422
  UserTwoFactorBackupCode_default,
452229
453423
  UserWebAuthn_default,
@@ -452263,6 +453457,7 @@ var AllModelTypes = [
452263
453457
  OnCallDutyPolicyTimeLog,
452264
453458
  ProjectSCIM,
452265
453459
  ProjectSCIMLog,
453460
+ ProjectSCIMUser,
452266
453461
  StatusPageSCIMLog,
452267
453462
  KubernetesCluster,
452268
453463
  KubernetesAiAgent,
@@ -452369,6 +453564,8 @@ var AllModelTypes = [
452369
453564
  MarketplaceSubscription,
452370
453565
  MarketplaceUsageReport,
452371
453566
  MarketplaceCharge,
453567
+ VercelMarketplaceInstallation,
453568
+ VercelMarketplaceConnection,
452372
453569
  UserNotificationEmailRollupItem,
452373
453570
  UserNotificationEmailRollupBatch,
452374
453571
  UserNotificationEmailRollupSetting_default,
@@ -471841,6 +473038,71 @@ var HTTPResponseBodyReader = class {
471841
473038
  }
471842
473039
  };
471843
473040
 
473041
+ // ../Common/Utils/SameServerRedirect.ts
473042
+ function parse(address) {
473043
+ try {
473044
+ return new globalThis.URL(address);
473045
+ } catch {
473046
+ return null;
473047
+ }
473048
+ }
473049
+ __name(parse, "parse");
473050
+ function isServerAddress(address) {
473051
+ return (address.protocol === "http:" || address.protocol === "https:") && address.hostname !== "";
473052
+ }
473053
+ __name(isServerAddress, "isServerAddress");
473054
+ function namesAUser(address) {
473055
+ return address.username !== "" || address.password !== "";
473056
+ }
473057
+ __name(namesAUser, "namesAUser");
473058
+ var isRedirectOnSameServer = /* @__PURE__ */ __name((requestUrl, redirectUrl) => {
473059
+ const from = parse(requestUrl);
473060
+ const to = parse(redirectUrl);
473061
+ if (!from || !to || !isServerAddress(from) || !isServerAddress(to) || namesAUser(to)) {
473062
+ return false;
473063
+ }
473064
+ if (to.hostname !== from.hostname) {
473065
+ return false;
473066
+ }
473067
+ if (to.protocol === from.protocol) {
473068
+ return to.port === from.port;
473069
+ }
473070
+ return from.protocol === "http:" && to.protocol === "https:" && from.port === "" && to.port === "";
473071
+ }, "isRedirectOnSameServer");
473072
+ function originOf(address) {
473073
+ const parsed = parse(address);
473074
+ if (!parsed || parsed.origin === "null") {
473075
+ return null;
473076
+ }
473077
+ return parsed.origin;
473078
+ }
473079
+ __name(originOf, "originOf");
473080
+ var RedirectOffServerError = class extends Error {
473081
+ static {
473082
+ __name(this, "RedirectOffServerError");
473083
+ }
473084
+ constructor(data) {
473085
+ const from = originOf(data.requestUrl) || "its server";
473086
+ const to = originOf(data.redirectUrl);
473087
+ super(
473088
+ to ? `The request to ${from} was redirected to ${to}, another server, so it was not sent on: a request that carries a key follows redirects only on the server it was sent to. If the server is at ${to}, set its address to that.` : `The request to ${from} was redirected to an address that could not be read, so it was not sent on: a request that carries a key follows redirects only on the server it was sent to.`
473089
+ );
473090
+ this.name = "RedirectOffServerError";
473091
+ }
473092
+ };
473093
+ var getSameServerRedirectCheck = /* @__PURE__ */ __name((requestUrl) => {
473094
+ return (redirectOptions) => {
473095
+ const href = redirectOptions["href"];
473096
+ const redirectUrl = typeof href === "string" ? href : "";
473097
+ if (!isRedirectOnSameServer(requestUrl, redirectUrl)) {
473098
+ throw new RedirectOffServerError({
473099
+ requestUrl,
473100
+ redirectUrl
473101
+ });
473102
+ }
473103
+ };
473104
+ }, "getSameServerRedirectCheck");
473105
+
471844
473106
  // ../Common/Utils/ProbeNetworkFailureUtil.ts
471845
473107
  var PROBE_SIDE_CAUSE_PREFIX = "This probe ";
471846
473108
  var OUTPUT_MARKERS = [
@@ -472481,6 +473743,11 @@ var API = class _API {
472481
473743
  if (options?.doNotFollowRedirects) {
472482
473744
  axiosOptions.maxRedirects = 0;
472483
473745
  }
473746
+ if (options?.sameServerRedirectsOnly) {
473747
+ axiosOptions.beforeRedirect = getSameServerRedirectCheck(
473748
+ options?.dispatchUrl ?? url2.toString()
473749
+ );
473750
+ }
472484
473751
  if (options?.maxContentLength !== void 0) {
472485
473752
  axiosOptions.maxContentLength = options.maxContentLength;
472486
473753
  }