@firestartr/cli 3.1.0 → 3.1.1-snapshot-pagination-fix

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.
package/build/index.js CHANGED
@@ -34415,7 +34415,7 @@ const resolve_1 = __nccwpck_require__(50921);
34415
34415
  const API_OBJECT_SYMBOL = Symbol.for('cdk8s.ApiObject');
34416
34416
  class ApiObject extends constructs_1.Construct {
34417
34417
  props;
34418
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.ApiObject", version: "2.70.111" };
34418
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.ApiObject", version: "2.70.115" };
34419
34419
  /**
34420
34420
  * Return whether the given object is an `ApiObject`.
34421
34421
  *
@@ -34662,7 +34662,7 @@ class SynthRequestCache {
34662
34662
  * Represents a cdk8s application.
34663
34663
  */
34664
34664
  class App extends constructs_1.Construct {
34665
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.App", version: "2.70.111" };
34665
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.App", version: "2.70.115" };
34666
34666
  /**
34667
34667
  * Synthesize a single chart.
34668
34668
  *
@@ -34947,7 +34947,7 @@ const names_1 = __nccwpck_require__(21021);
34947
34947
  const CHART_SYMBOL = Symbol.for('cdk8s.Chart');
34948
34948
  const CRONJOB = 'CronJob';
34949
34949
  class Chart extends constructs_1.Construct {
34950
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Chart", version: "2.70.111" };
34950
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Chart", version: "2.70.115" };
34951
34951
  /**
34952
34952
  * Return whether the given object is a Chart.
34953
34953
  *
@@ -35071,7 +35071,7 @@ const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
35071
35071
  * Represents a cron schedule
35072
35072
  */
35073
35073
  class Cron {
35074
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Cron", version: "2.70.111" };
35074
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Cron", version: "2.70.115" };
35075
35075
  /**
35076
35076
  * Create a cron schedule which runs every minute
35077
35077
  */
@@ -35157,7 +35157,7 @@ const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
35157
35157
  *
35158
35158
  */
35159
35159
  class DependencyGraph {
35160
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.DependencyGraph", version: "2.70.111" };
35160
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.DependencyGraph", version: "2.70.115" };
35161
35161
  _fosterParent;
35162
35162
  constructor(node) {
35163
35163
  this._fosterParent = new DependencyVertex();
@@ -35222,7 +35222,7 @@ exports.DependencyGraph = DependencyGraph;
35222
35222
  * The value of each vertex is an `IConstruct` that is accessible via the `.value` getter.
35223
35223
  */
35224
35224
  class DependencyVertex {
35225
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.DependencyVertex", version: "2.70.111" };
35225
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.DependencyVertex", version: "2.70.115" };
35226
35226
  _value;
35227
35227
  _children = new Set();
35228
35228
  _parents = new Set();
@@ -35328,7 +35328,7 @@ const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
35328
35328
  *
35329
35329
  */
35330
35330
  class Duration {
35331
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Duration", version: "2.70.111" };
35331
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Duration", version: "2.70.115" };
35332
35332
  /**
35333
35333
  * Create a Duration representing an amount of milliseconds
35334
35334
  *
@@ -35608,7 +35608,7 @@ const MAX_HELM_BUFFER = 10 * 1024 * 1024;
35608
35608
  * Use this construct to import an existing Helm chart and incorporate it into your constructs.
35609
35609
  */
35610
35610
  class Helm extends include_1.Include {
35611
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Helm", version: "2.70.111" };
35611
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Helm", version: "2.70.115" };
35612
35612
  /**
35613
35613
  * The helm release name.
35614
35614
  */
@@ -35690,7 +35690,7 @@ const yaml_1 = __nccwpck_require__(84286);
35690
35690
  * from the manifest.
35691
35691
  */
35692
35692
  class Include extends constructs_1.Construct {
35693
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Include", version: "2.70.111" };
35693
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Include", version: "2.70.115" };
35694
35694
  constructor(scope, id, props) {
35695
35695
  super(scope, id);
35696
35696
  const objects = yaml_1.Yaml.load(props.url);
@@ -35780,7 +35780,7 @@ const fast_json_patch_1 = __nccwpck_require__(34151);
35780
35780
  */
35781
35781
  class JsonPatch {
35782
35782
  operation;
35783
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.JsonPatch", version: "2.70.111" };
35783
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.JsonPatch", version: "2.70.115" };
35784
35784
  /**
35785
35785
  * Applies a set of JSON-Patch (RFC-6902) operations to `document` and returns the result.
35786
35786
  * @param document The document to patch
@@ -35858,7 +35858,7 @@ exports.Lazy = void 0;
35858
35858
  const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
35859
35859
  class Lazy {
35860
35860
  producer;
35861
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Lazy", version: "2.70.111" };
35861
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Lazy", version: "2.70.115" };
35862
35862
  static any(producer) {
35863
35863
  return new Lazy(producer);
35864
35864
  }
@@ -35887,7 +35887,7 @@ const resolve_1 = __nccwpck_require__(50921);
35887
35887
  * Object metadata.
35888
35888
  */
35889
35889
  class ApiObjectMetadataDefinition {
35890
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.ApiObjectMetadataDefinition", version: "2.70.111" };
35890
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.ApiObjectMetadataDefinition", version: "2.70.115" };
35891
35891
  /**
35892
35892
  * The name of the API object.
35893
35893
  *
@@ -36056,7 +36056,7 @@ const HASH_LEN = 8;
36056
36056
  * Utilities for generating unique and stable names.
36057
36057
  */
36058
36058
  class Names {
36059
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Names", version: "2.70.111" };
36059
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Names", version: "2.70.115" };
36060
36060
  /**
36061
36061
  * Generates a unique and stable name compatible DNS_LABEL from RFC-1123 from
36062
36062
  * a path.
@@ -36224,7 +36224,7 @@ class ResolutionContext {
36224
36224
  obj;
36225
36225
  key;
36226
36226
  value;
36227
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.ResolutionContext", version: "2.70.111" };
36227
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.ResolutionContext", version: "2.70.115" };
36228
36228
  /**
36229
36229
  * The replaced value that was set via the `replaceValue` method.
36230
36230
  */
@@ -36264,7 +36264,7 @@ exports.ResolutionContext = ResolutionContext;
36264
36264
  * Resolvers instanecs of `Lazy`.
36265
36265
  */
36266
36266
  class LazyResolver {
36267
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.LazyResolver", version: "2.70.111" };
36267
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.LazyResolver", version: "2.70.115" };
36268
36268
  resolve(context) {
36269
36269
  if (context.value instanceof lazy_1.Lazy) {
36270
36270
  const resolved = context.value.produce();
@@ -36277,7 +36277,7 @@ exports.LazyResolver = LazyResolver;
36277
36277
  * Resolves implicit tokens.
36278
36278
  */
36279
36279
  class ImplicitTokenResolver {
36280
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.ImplicitTokenResolver", version: "2.70.111" };
36280
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.ImplicitTokenResolver", version: "2.70.115" };
36281
36281
  resolve(context) {
36282
36282
  if (typeof (context.value.resolve) === 'function') {
36283
36283
  const resolved = context.value.resolve();
@@ -36292,7 +36292,7 @@ exports.ImplicitTokenResolver = ImplicitTokenResolver;
36292
36292
  * E.g IntOrString, Quantity, ...
36293
36293
  */
36294
36294
  class NumberStringUnionResolver {
36295
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.NumberStringUnionResolver", version: "2.70.111" };
36295
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.NumberStringUnionResolver", version: "2.70.115" };
36296
36296
  static TYPES = ['number', 'string'];
36297
36297
  resolve(context) {
36298
36298
  if (context.value.constructor === Object) {
@@ -36358,7 +36358,7 @@ const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
36358
36358
  * When the amount is passed as a token, unit conversion is not possible.
36359
36359
  */
36360
36360
  class Size {
36361
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Size", version: "2.70.111" };
36361
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Size", version: "2.70.115" };
36362
36362
  /**
36363
36363
  * Create a Storage representing an amount kibibytes.
36364
36364
  * 1 KiB = 1024 bytes
@@ -36546,7 +36546,7 @@ const chart_1 = __nccwpck_require__(75525);
36546
36546
  * Testing utilities for cdk8s applications.
36547
36547
  */
36548
36548
  class Testing {
36549
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Testing", version: "2.70.111" };
36549
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Testing", version: "2.70.115" };
36550
36550
  /**
36551
36551
  * Returns an app for testing with the following properties:
36552
36552
  * - Output directory is a temp dir.
@@ -36637,7 +36637,7 @@ const yamlSchemaVersion = '1.1';
36637
36637
  * YAML utilities.
36638
36638
  */
36639
36639
  class Yaml {
36640
- static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Yaml", version: "2.70.111" };
36640
+ static [JSII_RTTI_SYMBOL_1] = { fqn: "cdk8s.Yaml", version: "2.70.115" };
36641
36641
  /**
36642
36642
  * @deprecated use `stringify(doc[, doc, ...])`
36643
36643
  */
@@ -94020,7 +94020,7 @@ class Range {
94020
94020
  debug('hyphen replace', range)
94021
94021
 
94022
94022
  // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
94023
- range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
94023
+ range = trimComparatorWhitespace(range)
94024
94024
  debug('comparator trim', range)
94025
94025
 
94026
94026
  // `~ 1.2.3` => `~1.2.3`
@@ -94125,11 +94125,11 @@ const parseOptions = __nccwpck_require__(74464)
94125
94125
  const Comparator = __nccwpck_require__(15895)
94126
94126
  const debug = __nccwpck_require__(28195)
94127
94127
  const SemVer = __nccwpck_require__(69855)
94128
+ const trimComparatorWhitespace = __nccwpck_require__(99853)
94128
94129
  const {
94129
94130
  safeRe: re,
94130
94131
  src,
94131
94132
  t,
94132
- comparatorTrimReplace,
94133
94133
  tildeTrimReplace,
94134
94134
  caretTrimReplace,
94135
94135
  } = __nccwpck_require__(23227)
@@ -95512,6 +95512,35 @@ const MAX_SAFE_COMPONENT_LENGTH = 16
95512
95512
  // the shortest version with a build 0.0.0+BUILD.
95513
95513
  const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6
95514
95514
 
95515
+ // ECMAScript whitespace and line terminators matched by \s.
95516
+ const WHITESPACE_CHARACTERS = [
95517
+ '\t',
95518
+ '\n',
95519
+ '\v',
95520
+ '\f',
95521
+ '\r',
95522
+ ' ',
95523
+ '\u00a0',
95524
+ '\u1680',
95525
+ '\u2000',
95526
+ '\u2001',
95527
+ '\u2002',
95528
+ '\u2003',
95529
+ '\u2004',
95530
+ '\u2005',
95531
+ '\u2006',
95532
+ '\u2007',
95533
+ '\u2008',
95534
+ '\u2009',
95535
+ '\u200a',
95536
+ '\u2028',
95537
+ '\u2029',
95538
+ '\u202f',
95539
+ '\u205f',
95540
+ '\u3000',
95541
+ '\ufeff',
95542
+ ]
95543
+
95515
95544
  const RELEASE_TYPES = [
95516
95545
  'major',
95517
95546
  'premajor',
@@ -95527,6 +95556,7 @@ module.exports = {
95527
95556
  MAX_SAFE_COMPONENT_LENGTH,
95528
95557
  MAX_SAFE_BUILD_LENGTH,
95529
95558
  MAX_SAFE_INTEGER,
95559
+ WHITESPACE_CHARACTERS,
95530
95560
  RELEASE_TYPES,
95531
95561
  SEMVER_SPEC_VERSION,
95532
95562
  FLAG_INCLUDE_PRERELEASE: 0b001,
@@ -95891,6 +95921,451 @@ createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$')
95891
95921
  createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$')
95892
95922
 
95893
95923
 
95924
+ /***/ }),
95925
+
95926
+ /***/ 99853:
95927
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
95928
+
95929
+ // @ts-check
95930
+
95931
+
95932
+ // Reproduce safeRe[COMPARATORTRIM] replacement boundaries, not version
95933
+ // validation. Each end-index finder returns an exclusive end, or its start
95934
+ // on no match.
95935
+ // Positions count from zero. An end of 3 means characters 0, 1, and 2 were read;
95936
+ // range.slice(start, end) gives the matched text, not a converted number.
95937
+ const {
95938
+ MAX_LENGTH,
95939
+ MAX_SAFE_BUILD_LENGTH,
95940
+ WHITESPACE_CHARACTERS,
95941
+ } = __nccwpck_require__(1825)
95942
+
95943
+ /**
95944
+ * Remembers the last two rows of digits so their characters need not be reread.
95945
+ * Positions start at -1 until a row has been found.
95946
+ *
95947
+ * @typedef {object} DigitRunCache
95948
+ * @property {number} start The first character of the most recently found row.
95949
+ * @property {number} end The position after that row's last character.
95950
+ * @property {number} previousStart The first character of the previous row.
95951
+ * @property {number} previousEnd The position after the previous row.
95952
+ */
95953
+
95954
+ // One entry per UTF-16 code unit keeps membership checks constant-time.
95955
+ const whitespace = new Uint8Array(0x10000)
95956
+ for (const char of WHITESPACE_CHARACTERS) {
95957
+ whitespace[char.charCodeAt(0)] = 1
95958
+ }
95959
+
95960
+ /**
95961
+ * Checks whether a character is whitespace, like a space, tab, or newline.
95962
+ * Looking past the end of the string returns false.
95963
+ *
95964
+ * @param {string|undefined} char One character, or undefined past the string's end.
95965
+ * @returns {boolean} Whether the character is whitespace.
95966
+ * @example isWhitespace(' ') // true
95967
+ * @example isWhitespace('1') // false
95968
+ */
95969
+ const isWhitespace = char =>
95970
+ char !== undefined && whitespace[char.charCodeAt(0)] === 1
95971
+
95972
+ /**
95973
+ * Checks for v, =, or whitespace before the version number.
95974
+ * These are historical version prefixes, not range operators:
95975
+ * < and > are handled separately, as are tilde and caret ranges.
95976
+ *
95977
+ * @param {string|undefined} char One character to check.
95978
+ * @returns {boolean} Whether the character can belong to a version prefix.
95979
+ * @example isVersionPrefix('=') // true
95980
+ * @example isVersionPrefix('>') // false
95981
+ */
95982
+ const isVersionPrefix = char =>
95983
+ char === 'v' ||
95984
+ char === '=' ||
95985
+ isWhitespace(char)
95986
+
95987
+ /**
95988
+ * Checks whether a character is one of the digits 0 through 9.
95989
+ *
95990
+ * @param {string|undefined} char One character to check.
95991
+ * @returns {boolean} Whether the character is an ASCII digit.
95992
+ * @example isDigit('7') // true
95993
+ * @example isDigit('.') // false
95994
+ */
95995
+ const isDigit = char => char !== undefined && char >= '0' && char <= '9'
95996
+
95997
+ /**
95998
+ * Checks whether a character is an English letter, uppercase or lowercase.
95999
+ *
96000
+ * @param {string|undefined} char One character to check.
96001
+ * @returns {boolean} Whether the character is an ASCII letter.
96002
+ * @example isLetter('b') // true
96003
+ * @example isLetter('7') // false
96004
+ */
96005
+ const isLetter = char =>
96006
+ char !== undefined && (
96007
+ (char >= 'a' && char <= 'z') ||
96008
+ (char >= 'A' && char <= 'Z')
96009
+ )
96010
+
96011
+ /**
96012
+ * Checks for a letter, digit, or hyphen: the characters allowed inside
96013
+ * prerelease and build names such as beta-1.
96014
+ *
96015
+ * @param {string|undefined} char One character to check.
96016
+ * @returns {boolean} Whether the character can be part of an identifier.
96017
+ * @example isIdentifierCharacter('-') // true
96018
+ * @example isIdentifierCharacter('.') // false; dots separate identifiers
96019
+ */
96020
+ const isIdentifierCharacter = char => isDigit(char) || isLetter(char) || char === '-'
96021
+
96022
+ /**
96023
+ * Checks whether a version component can begin here: with a digit or
96024
+ * a wildcard such as x, X, or *.
96025
+ *
96026
+ * @param {string|undefined} char One character to check.
96027
+ * @returns {boolean} Whether a number or wildcard can start with this character.
96028
+ * @example isVersionStart('x') // true
96029
+ * @example isVersionStart('v') // false; v belongs to the prefix
96030
+ */
96031
+ const isVersionStart = char =>
96032
+ isDigit(char) ||
96033
+ char === 'x' ||
96034
+ char === 'X' ||
96035
+ char === '*'
96036
+
96037
+ /**
96038
+ * Finds the end of a row of digits, but returns no more than limit digits.
96039
+ * Remembers the last two rows so looking at them again does not reread them.
96040
+ *
96041
+ * @param {string} range The text to read; it is not changed.
96042
+ * @param {number} start The position of the first character to check.
96043
+ * @param {number} limit The most digit characters the returned match can include.
96044
+ * @param {DigitRunCache} digitRuns Shared cache of digit-run positions, updated in place.
96045
+ * @returns {number} The position after the matched digits, or start if none match.
96046
+ * @example findDigitsEndIndex('123abc', 0, 10, digitRuns) // 3, pointing at a
96047
+ * @example findDigitsEndIndex('123abc', 0, 2, digitRuns) // 2, pointing at the unread 3
96048
+ */
96049
+ const findDigitsEndIndex = (range, start, limit, digitRuns) => {
96050
+ if (!isDigit(range[start])) {
96051
+ return start
96052
+ }
96053
+ if (start >= digitRuns.start && start < digitRuns.end) {
96054
+ return Math.min(start + limit, digitRuns.end)
96055
+ }
96056
+ if (start >= digitRuns.previousStart && start < digitRuns.previousEnd) {
96057
+ return Math.min(start + limit, digitRuns.previousEnd)
96058
+ }
96059
+ let end = start + 1
96060
+ while (isDigit(range[end])) {
96061
+ end++
96062
+ }
96063
+ // A failed full version can rewind from its second run to its first.
96064
+ digitRuns.previousStart = digitRuns.start
96065
+ digitRuns.previousEnd = digitRuns.end
96066
+ digitRuns.start = start
96067
+ digitRuns.end = end
96068
+ return Math.min(start + limit, end)
96069
+ }
96070
+
96071
+ /**
96072
+ * Reads a number using the old regex's length and leading-zero rules.
96073
+ * Strict mode reads just the first zero in 012; loose mode can read all three.
96074
+ *
96075
+ * @param {string} range The text to read; it is not changed.
96076
+ * @param {number} start The position where the number should begin.
96077
+ * @param {boolean} loose Whether to allow leading zeros.
96078
+ * @param {DigitRunCache} digitRuns Shared digit-run cache, updated as needed.
96079
+ * @returns {number} The position after the matched digits, not their numeric value.
96080
+ * @example findVersionNumberEndIndex('012', 0, false, digitRuns) // 1
96081
+ * @example findVersionNumberEndIndex('012', 0, true, digitRuns) // 3
96082
+ */
96083
+ const findVersionNumberEndIndex = (range, start, loose, digitRuns) => {
96084
+ if (!loose && range[start] === '0') {
96085
+ return start + 1
96086
+ }
96087
+ // Strict syntax allows an initial nonzero digit plus MAX_LENGTH digits.
96088
+ return findDigitsEndIndex(range, start, loose ? MAX_LENGTH : MAX_LENGTH + 1, digitRuns)
96089
+ }
96090
+
96091
+ /**
96092
+ * Reads one piece of a prerelease name, such as beta or 1 in beta.1.
96093
+ * Tries the letter-or-hyphen form first, then the number-only form.
96094
+ *
96095
+ * @param {string} range The text to read; it is not changed.
96096
+ * @param {number} start The position where the identifier should begin.
96097
+ * @param {boolean} loose Whether numeric identifiers may have leading zeros.
96098
+ * @param {DigitRunCache} digitRuns Shared digit-run cache, updated as needed.
96099
+ * @returns {number} The position after the identifier, or start if none matches.
96100
+ * @example findPrereleaseIdentifierEndIndex('beta.1', 0, false, digitRuns) // 4, at the dot
96101
+ * @example findPrereleaseIdentifierEndIndex('001beta', 0, false, digitRuns) // 7
96102
+ */
96103
+ const findPrereleaseIdentifierEndIndex = (range, start, loose, digitRuns) => {
96104
+ const digitsEnd = findDigitsEndIndex(range, start, MAX_LENGTH, digitRuns)
96105
+ // The legacy regex tries a nonnumeric identifier before a numeric one.
96106
+ if (isLetter(range[digitsEnd]) || range[digitsEnd] === '-') {
96107
+ let end = digitsEnd + 1
96108
+ const limit = end + MAX_SAFE_BUILD_LENGTH
96109
+ while (end < limit && isIdentifierCharacter(range[end])) {
96110
+ end++
96111
+ }
96112
+ return end
96113
+ }
96114
+ return findVersionNumberEndIndex(range, start, loose, digitRuns)
96115
+ }
96116
+
96117
+ /**
96118
+ * Reads a prerelease suffix such as -beta.1, one dot-separated piece at a time.
96119
+ * Loose mode also allows the name without its opening hyphen.
96120
+ *
96121
+ * @param {string} range The text to read; it is not changed.
96122
+ * @param {number} start The position where the suffix should begin, including -.
96123
+ * @param {boolean} loose Whether the opening hyphen is optional and zeros allowed.
96124
+ * @param {DigitRunCache} digitRuns Shared digit-run cache, updated as needed.
96125
+ * @returns {number} The position after the matched suffix, or start if absent.
96126
+ * @example findPrereleaseEndIndex('-beta.1+sha', 0, false, digitRuns) // 7, at the plus
96127
+ * @example findPrereleaseEndIndex('beta', 0, false, digitRuns) // 0; no opening hyphen
96128
+ */
96129
+ const findPrereleaseEndIndex = (range, start, loose, digitRuns) => {
96130
+ const hyphen = range[start] === '-'
96131
+ if (!loose && !hyphen) {
96132
+ return start
96133
+ }
96134
+ const identifierStart = start + (hyphen ? 1 : 0)
96135
+ let end = findPrereleaseIdentifierEndIndex(range, identifierStart, loose, digitRuns)
96136
+ if (end === identifierStart) {
96137
+ if (!loose || !hyphen) {
96138
+ return start
96139
+ }
96140
+ // In loose syntax, a lone hyphen can itself be the identifier.
96141
+ end = findPrereleaseIdentifierEndIndex(range, start, loose, digitRuns)
96142
+ }
96143
+ while (range[end] === '.') {
96144
+ const next = findPrereleaseIdentifierEndIndex(range, end + 1, loose, digitRuns)
96145
+ if (next === end + 1) {
96146
+ break
96147
+ }
96148
+ end = next
96149
+ }
96150
+ return end
96151
+ }
96152
+
96153
+ /**
96154
+ * Reads one build-name piece, such as sha or 123 in +sha.123.
96155
+ * Stops at a disallowed character or the old regex's length limit.
96156
+ *
96157
+ * @param {string} range The text to read; it is not changed.
96158
+ * @param {number} start The position where the identifier should begin.
96159
+ * @returns {number} The position after the identifier, or start if none matches.
96160
+ * @example findBuildIdentifierEndIndex('sha.123', 0) // 3, at the dot
96161
+ * @example findBuildIdentifierEndIndex('001', 0) // 3; leading zeros are allowed
96162
+ */
96163
+ const findBuildIdentifierEndIndex = (range, start) => {
96164
+ let end = start
96165
+ while (end - start < MAX_SAFE_BUILD_LENGTH && isIdentifierCharacter(range[end])) {
96166
+ end++
96167
+ }
96168
+ return end
96169
+ }
96170
+
96171
+ /**
96172
+ * Reads optional build metadata such as +sha.123.
96173
+ * Leaves the position unchanged if there is no plus sign followed by a name.
96174
+ *
96175
+ * @param {string} range The text to read; it is not changed.
96176
+ * @param {number} start The position where the opening + should be.
96177
+ * @returns {number} The position after the matched metadata, or start if absent.
96178
+ * @example findBuildEndIndex('+sha.123 <2', 0) // 8, at the space
96179
+ * @example findBuildEndIndex('+', 0) // 0; a plus sign alone is not a match
96180
+ */
96181
+ const findBuildEndIndex = (range, start) => {
96182
+ if (range[start] !== '+') {
96183
+ return start
96184
+ }
96185
+ let end = findBuildIdentifierEndIndex(range, start + 1)
96186
+ if (end === start + 1) {
96187
+ return start
96188
+ }
96189
+ while (range[end] === '.') {
96190
+ const next = findBuildIdentifierEndIndex(range, end + 1)
96191
+ if (next === end + 1) {
96192
+ break
96193
+ }
96194
+ end = next
96195
+ }
96196
+ return end
96197
+ }
96198
+
96199
+ /**
96200
+ * Reads three numbers separated by dots, then any prerelease and build suffixes.
96201
+ * Uses loose rules, so forms such as 01.02.03beta can match here.
96202
+ *
96203
+ * @param {string} range The text to read; it is not changed.
96204
+ * @param {number} start The position of the first number, after any prefix.
96205
+ * @param {DigitRunCache} digitRuns Shared digit-run cache, updated as needed.
96206
+ * @returns {number} The position after the version match, or start if none matches.
96207
+ * @example findLooseFullVersionEndIndex('1.2.3-beta+sha <2', 0, digitRuns) // 14
96208
+ * @example findLooseFullVersionEndIndex('1.2', 0, digitRuns) // 0; needs three numbers
96209
+ */
96210
+ const findLooseFullVersionEndIndex = (range, start, digitRuns) => {
96211
+ let end = start
96212
+ for (let component = 0; component < 3; component++) {
96213
+ const next = findVersionNumberEndIndex(range, end, true, digitRuns)
96214
+ if (next === end) {
96215
+ return start
96216
+ }
96217
+ end = next
96218
+ if (component < 2) {
96219
+ if (range[end] !== '.') {
96220
+ return start
96221
+ }
96222
+ end++
96223
+ }
96224
+ }
96225
+ const prereleaseEnd = findPrereleaseEndIndex(range, end, true, digitRuns)
96226
+ return findBuildEndIndex(range, prereleaseEnd)
96227
+ }
96228
+
96229
+ /**
96230
+ * Reads one component of a partial or wildcard version, such as 2 or x in 2.x.
96231
+ * Numbers use strict leading-zero rules; wildcards take up one character.
96232
+ *
96233
+ * @param {string} range The text to read; it is not changed.
96234
+ * @param {number} start The position where the component should begin.
96235
+ * @param {DigitRunCache} digitRuns Shared digit-run cache, updated as needed.
96236
+ * @returns {number} The position after the component, or start if none matches.
96237
+ * @example findPartialVersionComponentEndIndex('2.x', 0, digitRuns) // 1, at the dot
96238
+ * @example findPartialVersionComponentEndIndex('2.x', 2, digitRuns) // 3, after x
96239
+ */
96240
+ const findPartialVersionComponentEndIndex = (range, start, digitRuns) => {
96241
+ if (isDigit(range[start])) {
96242
+ return findVersionNumberEndIndex(range, start, false, digitRuns)
96243
+ }
96244
+ return isVersionStart(range[start]) ? start + 1 : start
96245
+ }
96246
+
96247
+ /**
96248
+ * Reads up to three components, allowing forms such as 1, 1.2, or 1.x.
96249
+ * After the third component, also reads any strict prerelease and build suffixes.
96250
+ *
96251
+ * @param {string} range The text to read; it is not changed.
96252
+ * @param {number} start The position of a number or wildcard, after any prefix.
96253
+ * @param {DigitRunCache} digitRuns Shared digit-run cache, updated as needed.
96254
+ * @returns {number} The position after the matched version text.
96255
+ * @example findPartialVersionEndIndex('1.x <2', 0, digitRuns) // 3, at the space
96256
+ * @example findPartialVersionEndIndex('1.', 0, digitRuns) // 1; the trailing dot is unread
96257
+ */
96258
+ const findPartialVersionEndIndex = (range, start, digitRuns) => {
96259
+ let end = findPartialVersionComponentEndIndex(range, start, digitRuns)
96260
+ for (let component = 0; component < 2; component++) {
96261
+ if (range[end] !== '.') {
96262
+ return end
96263
+ }
96264
+ const next = findPartialVersionComponentEndIndex(range, end + 1, digitRuns)
96265
+ if (next === end + 1) {
96266
+ return end
96267
+ }
96268
+ end = next
96269
+ }
96270
+ const prereleaseEnd = findPrereleaseEndIndex(range, end, false, digitRuns)
96271
+ return findBuildEndIndex(range, prereleaseEnd)
96272
+ }
96273
+
96274
+ /**
96275
+ * Finds where a version match ends, without deciding whether the range is valid.
96276
+ * Tries a loose full version first, then a partial or wildcard version, just
96277
+ * like the old regex's LOOSEPLAIN and XRANGEPLAIN alternatives.
96278
+ *
96279
+ * @param {string} range The text to read; it is not changed.
96280
+ * @param {number} start The position of a number or wildcard, after any prefix.
96281
+ * @param {DigitRunCache} digitRuns Shared digit-run cache, updated as needed.
96282
+ * @returns {number} The position where scanning the next candidate can resume.
96283
+ * @example findVersionEndIndex('1.2.3 <2', 0, digitRuns) // 5, at the space
96284
+ * @example findVersionEndIndex('1.x <2', 0, digitRuns) // 3, at the space
96285
+ */
96286
+ const findVersionEndIndex = (range, start, digitRuns) => {
96287
+ const fullVersionEnd = findLooseFullVersionEndIndex(range, start, digitRuns)
96288
+ return fullVersionEnd !== start
96289
+ ? fullVersionEnd
96290
+ : findPartialVersionEndIndex(range, start, digitRuns)
96291
+ }
96292
+
96293
+ /**
96294
+ * Finds the one whitespace character the old replacement would remove.
96295
+ * Keeps leading whitespace, skips an optional operator, and checks immediately
96296
+ * after it. Returns -1 if there is nothing to remove.
96297
+ *
96298
+ * @param {string} range The text containing a candidate already found by the caller.
96299
+ * @param {number} matchStart The candidate's position, including leading whitespace.
96300
+ * @returns {number} The position of the removable whitespace, or -1 if absent.
96301
+ * @example findRemovableWhitespaceIndex(' > 1', 0) // 2; keep the space at position 0
96302
+ * @example findRemovableWhitespaceIndex('>1', 0) // -1
96303
+ */
96304
+ const findRemovableWhitespaceIndex = (range, matchStart) => {
96305
+ let position = matchStart
96306
+ if (isWhitespace(range[position])) {
96307
+ position++
96308
+ }
96309
+ if (range[position] === '<' || range[position] === '>') {
96310
+ position++
96311
+ }
96312
+ if (range[position] === '=') {
96313
+ position++
96314
+ }
96315
+ return isWhitespace(range[position]) ? position : -1
96316
+ }
96317
+
96318
+ /**
96319
+ * Joins an operator to its version, turning > 1.2.3 into >1.2.3.
96320
+ * Copies everything else according to the old regex's matching rules.
96321
+ * Moves forward through prefixes and whole versions to avoid repeatedly
96322
+ * searching the same characters on long inputs.
96323
+ *
96324
+ * @param {string} range The range text to process; the original string is unchanged.
96325
+ * @returns {string} The range with matched operator whitespace removed.
96326
+ * @example trimComparatorWhitespace('> 1.2.3 < 2') // '>1.2.3 <2'
96327
+ * @example trimComparatorWhitespace('> invalid') // '> invalid'
96328
+ */
96329
+ const trimComparatorWhitespace = range => {
96330
+ let result = ''
96331
+ let copyFrom = 0
96332
+ let cursor = 0
96333
+ const digitRuns = { start: -1, end: -1, previousStart: -1, previousEnd: -1 }
96334
+
96335
+ while (cursor < range.length) {
96336
+ const matchStart = cursor
96337
+ if (range[cursor] === '<' || range[cursor] === '>') {
96338
+ cursor++
96339
+ } else if (!isVersionPrefix(range[cursor]) && !isVersionStart(range[cursor])) {
96340
+ cursor++
96341
+ continue
96342
+ }
96343
+
96344
+ // Consume a v/=/whitespace run once, even when no version follows it.
96345
+ while (cursor < range.length && isVersionPrefix(range[cursor])) {
96346
+ cursor++
96347
+ }
96348
+ if (!isVersionStart(range[cursor])) {
96349
+ continue
96350
+ }
96351
+
96352
+ const whitespacePosition = findRemovableWhitespaceIndex(range, matchStart)
96353
+ if (whitespacePosition !== -1) {
96354
+ result += range.slice(copyFrom, whitespacePosition)
96355
+ copyFrom = whitespacePosition + 1
96356
+ }
96357
+
96358
+ // Skip the entire match, so a prerelease's trailing v cannot be
96359
+ // reconsidered as the prefix of another version.
96360
+ cursor = findVersionEndIndex(range, cursor, digitRuns)
96361
+ }
96362
+
96363
+ return result + range.slice(copyFrom)
96364
+ }
96365
+
96366
+ module.exports = trimComparatorWhitespace
96367
+
96368
+
95894
96369
  /***/ }),
95895
96370
 
95896
96371
  /***/ 98736:
@@ -124740,22 +125215,37 @@ async function getOrgTeamsDirectAccess(org, octokit) {
124740
125215
  id
124741
125216
  name
124742
125217
  slug
124743
- repositories {
125218
+ }
125219
+ pageInfo {
125220
+ hasNextPage
125221
+ endCursor
125222
+ }
125223
+ }
125224
+ }
125225
+ }`, { org });
125226
+ // The GraphQL paginator handles one connection per query, so each team's
125227
+ // repositories must be paginated separately from the organization's teams.
125228
+ for (const team of response?.organization?.teams?.nodes ?? []) {
125229
+ const repositoryResponse = await octokit.graphql.paginate(`query paginate($cursor: String, $org: String!, $slug: String!) {
125230
+ organization(login: $org) {
125231
+ team(slug: $slug) {
125232
+ repositories(first: 100, after: $cursor) {
124744
125233
  edges {
124745
125234
  permission
124746
125235
  node {
124747
125236
  name
124748
125237
  }
124749
125238
  }
125239
+ pageInfo {
125240
+ hasNextPage
125241
+ endCursor
125242
+ }
124750
125243
  }
124751
125244
  }
124752
- pageInfo {
124753
- hasNextPage
124754
- endCursor
124755
- }
124756
125245
  }
124757
- }
124758
- }`, { org });
125246
+ }`, { org, slug: team.slug });
125247
+ team.repositories = repositoryResponse.organization.team.repositories;
125248
+ }
124759
125249
  return transformGraphQLResponse(response);
124760
125250
  }
124761
125251
  function transformGraphQLResponse(response) {
@@ -139639,22 +140129,30 @@ function seededRandom(str) {
139639
140129
 
139640
140130
 
139641
140131
 
139642
- const { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = __nccwpck_require__(88753)
140132
+ const { normalizeIPv6, removeDotSegments, removeDotSegmentsRelative, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = __nccwpck_require__(88753)
139643
140133
  const { SCHEMES, getSchemeHandler } = __nccwpck_require__(52256)
139644
140134
 
139645
140135
  const VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u
139646
140136
  const MALFORMED_SCHEME_ERROR = 'URI scheme is malformed.'
140137
+ const MALFORMED_HOST_ERROR = 'URI host is malformed.'
140138
+ // ASCII characters outside the RFC 3986 reg-name set (unreserved, sub-delims
140139
+ // and "%" for pct-encoded): C0 controls, space, DEL, and "#/:<>?@[\]^`{|}.
140140
+ const FORBIDDEN_DOMAIN_HOST_CHARACTER = /[\0-\x20"#/:<>?@[\\\]^`{|}\x7F]/u
139647
140141
 
139648
140142
  /**
140143
+ * RFC 3986 section 3.1 does not allow percent-encoding in a scheme, so the
140144
+ * scheme is validated as-is and never decoded. Decoding would let inert input
140145
+ * such as `%6Aavascript:` become a live `javascript:` scheme.
140146
+ *
139649
140147
  * @param {string} scheme
139650
140148
  * @returns {string}
139651
140149
  */
139652
- function decodeValidScheme (scheme) {
139653
- const decodedScheme = unescape(String(scheme))
139654
- if (!VALID_SCHEME.test(decodedScheme)) {
140150
+ function validateScheme (scheme) {
140151
+ const stringScheme = String(scheme)
140152
+ if (!VALID_SCHEME.test(stringScheme)) {
139655
140153
  throw new TypeError(MALFORMED_SCHEME_ERROR)
139656
140154
  }
139657
- return decodedScheme
140155
+ return stringScheme
139658
140156
  }
139659
140157
 
139660
140158
  /**
@@ -139715,6 +140213,12 @@ function resolve (baseURI, relativeURI, options) {
139715
140213
  const resolvedHost = resolved.host
139716
140214
  const resolvedHostIsIP = resolvedHost !== undefined && resolvedHost !== '' &&
139717
140215
  (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6)
140216
+ // Inputs are parsed scheme-neutrally, so delimiters and controls in a domain
140217
+ // host are only detected here, once the final scheme is known. They always
140218
+ // fail closed, including in percent-encoded hosts.
140219
+ if (hasForbiddenDomainHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP)) {
140220
+ throw new Error(MALFORMED_HOST_ERROR)
140221
+ }
139718
140222
  canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP)
139719
140223
  // Percent escapes in an ASCII reg-name are encoded data. The WHATWG hostname
139720
140224
  // parser can reject them even though fast-uri preserves them safely as RFC
@@ -139772,14 +140276,17 @@ function resolveComponent (base, relative, options, skipNormalization) {
139772
140276
  if (relative.path[0] === '/') {
139773
140277
  target.path = removeDotSegments(relative.path)
139774
140278
  } else {
139775
- if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
140279
+ const baseHasAuthority = base.userinfo !== undefined || base.host !== undefined || base.port !== undefined
140280
+ if (baseHasAuthority && !base.path) {
139776
140281
  target.path = '/' + relative.path
139777
140282
  } else if (!base.path) {
139778
140283
  target.path = relative.path
139779
140284
  } else {
139780
140285
  target.path = base.path.slice(0, base.path.lastIndexOf('/') + 1) + relative.path
139781
140286
  }
139782
- target.path = removeDotSegments(target.path)
140287
+ target.path = base.scheme === undefined && !baseHasAuthority && target.path[0] !== '/'
140288
+ ? removeDotSegmentsRelative(target.path)
140289
+ : removeDotSegments(target.path)
139783
140290
  }
139784
140291
  target.query = relative.query
139785
140292
  }
@@ -139835,7 +140342,7 @@ function serialize (cmpts, opts) {
139835
140342
  const uriTokens = []
139836
140343
 
139837
140344
  if (component.scheme) {
139838
- component.scheme = decodeValidScheme(component.scheme)
140345
+ component.scheme = validateScheme(component.scheme)
139839
140346
  }
139840
140347
 
139841
140348
  // find scheme handler
@@ -139845,7 +140352,11 @@ function serialize (cmpts, opts) {
139845
140352
  if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options)
139846
140353
 
139847
140354
  const hasAuthority = component.userinfo !== undefined || component.host !== undefined || component.port !== undefined
139848
- const pathNoScheme = !options.skipEscape && component.scheme === undefined && !hasAuthority
140355
+ // A reference with no emitted scheme is path-noscheme: a bare ':' in its
140356
+ // first path segment would reparse as a scheme (RFC 3986 3.3/4.2). Enforced
140357
+ // under skipEscape too (resolve()), so the reapply below gates on this flag.
140358
+ const schemelessReference = (component.scheme === undefined || options.reference === 'suffix') && !hasAuthority
140359
+ const pathNoScheme = !options.skipEscape && schemelessReference
139849
140360
 
139850
140361
  if (component.path !== undefined) {
139851
140362
  if (!options.skipEscape) {
@@ -139857,7 +140368,7 @@ function serialize (cmpts, opts) {
139857
140368
 
139858
140369
  if (options.reference !== 'suffix' && component.scheme) {
139859
140370
  // Scheme handlers may replace the scheme during serialization.
139860
- component.scheme = decodeValidScheme(component.scheme)
140371
+ component.scheme = validateScheme(component.scheme)
139861
140372
  uriTokens.push(component.scheme, ':')
139862
140373
  }
139863
140374
 
@@ -139877,13 +140388,18 @@ function serialize (cmpts, opts) {
139877
140388
  let s = component.path
139878
140389
 
139879
140390
  if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
139880
- s = removeDotSegments(s)
140391
+ // A relative-path reference keeps its unresolvable leading ".." segments
140392
+ // and must never become root-relative (RFC 3986 section 5.2.4 applies to
140393
+ // merged target paths, not to the reference itself).
140394
+ s = schemelessReference && s[0] !== '/'
140395
+ ? removeDotSegmentsRelative(s)
140396
+ : removeDotSegments(s)
139881
140397
  }
139882
140398
 
139883
140399
  // Dot-segment removal can expose a colon that was not originally in the
139884
140400
  // first segment (for example, "./a:b"). Reapply path-noscheme encoding so
139885
140401
  // the serialized relative reference cannot be reparsed as a URI scheme.
139886
- if (pathNoScheme) {
140402
+ if (schemelessReference) {
139887
140403
  s = serializePathEncoding(s, true)
139888
140404
  }
139889
140405
 
@@ -139998,6 +140514,11 @@ function hasMalformedComponentPercentEncoding (matches) {
139998
140514
  * @returns {boolean} whether host conversion failed
139999
140515
  */
140000
140516
  function canonicalizeHost (parsed, options, schemeHandler, isIP) {
140517
+ if (hasForbiddenDomainHost(parsed, options, schemeHandler, isIP)) {
140518
+ parsed.error = parsed.error || MALFORMED_HOST_ERROR
140519
+ return true
140520
+ }
140521
+
140001
140522
  if (
140002
140523
  !options.unicodeSupport &&
140003
140524
  (!schemeHandler || !schemeHandler.unicodeSupport) &&
@@ -140007,16 +140528,62 @@ function canonicalizeHost (parsed, options, schemeHandler, isIP) {
140007
140528
  isIP === false &&
140008
140529
  nonSimpleDomain(parsed.host)
140009
140530
  ) {
140531
+ let url
140010
140532
  try {
140011
- parsed.host = new URL('http://' + parsed.host).hostname
140533
+ url = new URL('http://' + parsed.host)
140012
140534
  } catch (e) {
140013
140535
  parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e
140014
140536
  return true
140015
140537
  }
140538
+ // The WHATWG parser must have read the whole input as a host. Anything
140539
+ // else means it found a delimiter fast-uri did not, so its hostname would
140540
+ // describe a different authority.
140541
+ if (!isHostOnlyURL(url)) {
140542
+ parsed.error = parsed.error || MALFORMED_HOST_ERROR
140543
+ return true
140544
+ }
140545
+ parsed.host = url.hostname
140016
140546
  }
140017
140547
  return false
140018
140548
  }
140019
140549
 
140550
+ /**
140551
+ * Whether a domain host contains an ASCII character that RFC 3986 does not
140552
+ * allow in a reg-name (unreserved, sub-delims, or pct-encoded). Such a host is
140553
+ * rejected instead of being handed to the WHATWG URL parser, which would treat
140554
+ * "@" as a userinfo delimiter (silently dropping the data before it) and strip
140555
+ * TAB, LF, and CR. Non-ASCII characters remain allowed for IDNs.
140556
+ *
140557
+ * @param {import('./types/index').URIComponent} parsed
140558
+ * @param {import('./types/index').Options} options
140559
+ * @param {{ domainHost?: boolean }|undefined} schemeHandler
140560
+ * @param {boolean} isIP
140561
+ * @returns {boolean}
140562
+ */
140563
+ function hasForbiddenDomainHost (parsed, options, schemeHandler, isIP) {
140564
+ return Boolean(
140565
+ parsed.host &&
140566
+ isIP === false &&
140567
+ !isIPLiteral(parsed.host) &&
140568
+ (options.domainHost || (schemeHandler && schemeHandler.domainHost)) &&
140569
+ FORBIDDEN_DOMAIN_HOST_CHARACTER.test(parsed.host)
140570
+ )
140571
+ }
140572
+
140573
+ /**
140574
+ * @param {URL} url
140575
+ * @returns {boolean}
140576
+ */
140577
+ function isHostOnlyURL (url) {
140578
+ return url.username === '' &&
140579
+ url.password === '' &&
140580
+ url.port === '' &&
140581
+ url.pathname === '/' &&
140582
+ url.search === '' &&
140583
+ url.hash === '' &&
140584
+ url.hostname !== ''
140585
+ }
140586
+
140020
140587
  /**
140021
140588
  * @param {string} uri
140022
140589
  * @param {import('./types/index').Options} [opts]
@@ -140099,9 +140666,8 @@ function parseWithStatus (uri, opts) {
140099
140666
  parsed.fragment = matches[8]
140100
140667
 
140101
140668
  if (parsed.scheme !== undefined) {
140102
- const decodedScheme = unescape(parsed.scheme)
140103
- if (VALID_SCHEME.test(decodedScheme)) {
140104
- parsed.scheme = decodedScheme.toLowerCase()
140669
+ if (VALID_SCHEME.test(parsed.scheme)) {
140670
+ parsed.scheme = parsed.scheme.toLowerCase()
140105
140671
  } else {
140106
140672
  parsed.error = parsed.error || MALFORMED_SCHEME_ERROR
140107
140673
  malformedScheme = true
@@ -140135,7 +140701,7 @@ function parseWithStatus (uri, opts) {
140135
140701
  parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase()
140136
140702
 
140137
140703
  if (malformedIPLiteral) {
140138
- parsed.error = parsed.error || 'URI host is malformed.'
140704
+ parsed.error = parsed.error || MALFORMED_HOST_ERROR
140139
140705
  malformedAuthorityOrPort = true
140140
140706
  }
140141
140707
  } else {
@@ -140172,7 +140738,11 @@ function parseWithStatus (uri, opts) {
140172
140738
  // pass only restores uppercase hex in escapes that remain encoded.
140173
140739
  host = normalizePercentEncoding(host.toLowerCase())
140174
140740
  }
140175
- parsed.host = reescapeHostDelimiters(host, isIP)
140741
+ // Resolution parses both inputs with the internal `null` scheme before
140742
+ // the effective scheme is known. Keep raw host delimiters for that step
140743
+ // so resolve() can reject them for domain-host schemes; the resolved
140744
+ // authority is encoded when it is serialized.
140745
+ parsed.host = isIP || options.scheme !== 'null' ? reescapeHostDelimiters(host, isIP) : host
140176
140746
  }
140177
140747
 
140178
140748
  if (!schemeHandler || (schemeHandler && !schemeHandler.skipNormalize)) {
@@ -140901,6 +141471,57 @@ function removeDotSegments (path) {
140901
141471
  return output.join('')
140902
141472
  }
140903
141473
 
141474
+ /**
141475
+ * Removes dot segments from the path of a relative reference (a path that does
141476
+ * not start with "/") without changing what it resolves to against any base.
141477
+ * Unlike `removeDotSegments`, leading ".." segments that cannot be collapsed
141478
+ * are kept, the result never becomes root-relative, and a result that would be
141479
+ * empty or start with an empty segment is prefixed with "." (an empty path
141480
+ * means "same document" and a leading "//" would introduce an authority).
141481
+ *
141482
+ * @param {string} path
141483
+ * @returns {string}
141484
+ */
141485
+ function removeDotSegmentsRelative (path) {
141486
+ if (path === '' || path[0] === '/') {
141487
+ return removeDotSegments(path)
141488
+ }
141489
+
141490
+ const segments = path.split('/')
141491
+ const last = segments.length - 1
141492
+ /** @type {string[]} */
141493
+ const output = []
141494
+ let trailingDirectory = false
141495
+
141496
+ for (let i = 0; i <= last; i++) {
141497
+ const segment = segments[i]
141498
+ if (segment === '.' || segment === '..') {
141499
+ if (segment === '..') {
141500
+ if (output.length !== 0 && output[output.length - 1] !== '..') {
141501
+ output.pop()
141502
+ } else {
141503
+ output.push('..')
141504
+ }
141505
+ }
141506
+ trailingDirectory = i === last
141507
+ } else {
141508
+ output.push(segment)
141509
+ }
141510
+ }
141511
+
141512
+ if (trailingDirectory && output[output.length - 1] !== '..') {
141513
+ output.push('')
141514
+ }
141515
+ if (output.length === 0 || output[0] === '' || output[0].includes(':')) {
141516
+ // An empty path, a leading empty segment ("//"), or a first segment
141517
+ // containing ":" (which would be mistaken for a scheme, RFC 3986 section
141518
+ // 4.2) must stay behind a "." segment so the reference keeps its meaning.
141519
+ output.unshift('.')
141520
+ }
141521
+
141522
+ return output.join('/')
141523
+ }
141524
+
140904
141525
  /**
140905
141526
  * Re-escape RFC 3986 gen-delims that must not appear literally in the host.
140906
141527
  * After the URI regex parses, these characters cannot be literal in the host
@@ -141296,6 +141917,7 @@ module.exports = {
141296
141917
  encodeFragment,
141297
141918
  escapePreservingEscapes,
141298
141919
  removeDotSegments,
141920
+ removeDotSegmentsRelative,
141299
141921
  isIPv4,
141300
141922
  isUUID,
141301
141923
  normalizeIPv6,
@@ -154998,9 +155620,25 @@ function createExpanders(path) {
154998
155620
  ;// CONCATENATED MODULE: external "node:fs/promises"
154999
155621
  const promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs/promises");
155000
155622
  var promises_default = /*#__PURE__*/__nccwpck_require__.n(promises_namespaceObject);
155623
+ // EXTERNAL MODULE: external "node:fs"
155624
+ var external_node_fs_ = __nccwpck_require__(73024);
155625
+ // EXTERNAL MODULE: external "node:path"
155626
+ var external_node_path_ = __nccwpck_require__(76760);
155627
+ var external_node_path_default = /*#__PURE__*/__nccwpck_require__.n(external_node_path_);
155628
+ ;// CONCATENATED MODULE: ../cdk8s_renderer/src/utils/fileIgnore.ts
155629
+
155630
+
155631
+ const FIRESTARTR_IGNORE_FILE = '.firestartrignore';
155632
+ /** Only the file's own directory matters; markers are not inherited. */
155633
+ function fileIgnore_isIgnoredFile(file) {
155634
+ return (/\.(yaml|yml)$/.test(file) &&
155635
+ (0,external_node_fs_.existsSync)(external_node_path_default().join(external_node_path_default().dirname(file), FIRESTARTR_IGNORE_FILE)));
155636
+ }
155637
+
155001
155638
  ;// CONCATENATED MODULE: ../cdk8s_renderer/src/crawler.ts
155002
155639
 
155003
155640
 
155641
+
155004
155642
  // Number of files being currently slurped
155005
155643
  let activeSlurps = 0;
155006
155644
  // Max number of files that can be being slurped at a given time
@@ -155110,11 +155748,16 @@ async function crawlDirectory(dirEnt, exec) {
155110
155748
  const entries = (await promises_namespaceObject.readdir(dirEnt))
155111
155749
  .map((entry) => external_path_.join(dirEnt, entry))
155112
155750
  .sort();
155751
+ const ignoreFiles = entries.includes(external_path_.join(dirEnt, FIRESTARTR_IGNORE_FILE));
155113
155752
  for (const entry of entries) {
155114
155753
  const testDir = await isDir(entry);
155115
155754
  if (testDir) {
155116
155755
  await crawlDirectory(entry, exec);
155117
155756
  }
155757
+ else if (external_path_.basename(entry) === FIRESTARTR_IGNORE_FILE ||
155758
+ (ignoreFiles && /\.(yaml|yml)$/.test(entry))) {
155759
+ continue;
155760
+ }
155118
155761
  else {
155119
155762
  await slurpFile(entry, exec);
155120
155763
  }
@@ -159484,10 +160127,6 @@ function addTraceabilityStamp(context, content) {
159484
160127
  }
159485
160128
  }
159486
160129
 
159487
- // EXTERNAL MODULE: external "node:path"
159488
- var external_node_path_ = __nccwpck_require__(76760);
159489
- // EXTERNAL MODULE: external "node:fs"
159490
- var external_node_fs_ = __nccwpck_require__(73024);
159491
160130
  ;// CONCATENATED MODULE: external "node:os"
159492
160131
  const external_node_os_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:os");
159493
160132
  ;// CONCATENATED MODULE: ../features_renderer/src/auxiliar.ts
@@ -160861,6 +161500,7 @@ function extractClaimPatches(rendered) {
160861
161500
 
160862
161501
 
160863
161502
 
161503
+
160864
161504
  // We need to ensure the grep command is a gnu version
160865
161505
  let IS_GNU_GREP = false;
160866
161506
  let GREP_ON_CHECK = false;
@@ -161054,7 +161694,9 @@ async function getClaimsByName(name, cwd = '.') {
161054
161694
  if (Object.values(VisitedClaims).includes(fileName)) {
161055
161695
  continue;
161056
161696
  }
161057
- entradas.push(external_path_.join(cwd, fileName));
161697
+ const entry = external_path_.join(cwd, fileName);
161698
+ if (!fileIgnore_isIgnoredFile(entry))
161699
+ entradas.push(entry);
161058
161700
  }
161059
161701
  return Promise.all(entradas.map((entrada) => {
161060
161702
  return loadRawClaim(entrada);
@@ -161184,6 +161826,7 @@ function claimsDefaulter_hasDeepPath(data, deepPath) {
161184
161826
 
161185
161827
 
161186
161828
 
161829
+
161187
161830
  const isYamlFile = new RegExp(/\.(yaml|yml)$/);
161188
161831
  /**
161189
161832
  *
@@ -161307,6 +161950,9 @@ async function loadInitializers(claim, claimPath, initializersPath = getPath('in
161307
161950
  return result;
161308
161951
  }
161309
161952
  function loadClaimDefaults() {
161953
+ if (fileIgnore_isIgnoredFile(`${getPath('claimsDefaults')}/claims_defaults.yaml`)) {
161954
+ return {};
161955
+ }
161310
161956
  try {
161311
161957
  return catalog_common/* default */.A.io.fromYaml(external_fs_.readFileSync(`${getPath('claimsDefaults')}/claims_defaults.yaml`, 'utf-8'));
161312
161958
  }
@@ -161445,30 +162091,51 @@ function validateTfStateKeyUniqueness(crs) {
161445
162091
  const tfStateKeys = {};
161446
162092
  for (const crKey of Object.keys(crs)) {
161447
162093
  const cr = crs[crKey];
161448
- if (!isTerraformWorkspace(cr))
162094
+ if (!cr.spec?.firestartr?.tfStateKey)
161449
162095
  continue;
161450
162096
  const tfKey = cr.spec.firestartr.tfStateKey;
161451
- if (tfStateKeys[tfKey]) {
162097
+ const claimRef = cr.metadata?.annotations?.['firestartr.dev/claim-ref'];
162098
+ const existing = tfStateKeys[tfKey];
162099
+ if (existing) {
162100
+ const existingClaimRef = existing.metadata?.annotations?.['firestartr.dev/claim-ref'];
162101
+ const sameClaim = claimRef !== undefined && existingClaimRef === claimRef;
162102
+ const workspaceInvolved = isTerraformWorkspace(cr) || isTerraformWorkspace(existing);
162103
+ if (sameClaim && !workspaceInvolved) {
162104
+ continue;
162105
+ }
161452
162106
  throw new Error(`❗❗ ❌ RENDER ERROR ❌ ❗❗
161453
162107
 
161454
162108
  The tfStateKey ${tfKey} is not unique,
161455
162109
 
161456
162110
  It is being used by the following CRs:
161457
162111
 
161458
- - ${tfStateKeys[tfKey].kind} ${tfStateKeys[tfKey].metadata.name}
162112
+ - ${existing.kind} ${existing.metadata.name}
161459
162113
 
161460
162114
  - ${cr.kind} ${cr.metadata.name}
161461
162115
 
161462
162116
  Check the following Claims to ensure that the tfStateKey is unique:
161463
162117
 
161464
- - ${tfStateKeys[tfKey].metadata.annotations['firestartr.dev/claim-ref']}
162118
+ - ${existingClaimRef}
161465
162119
 
161466
- - ${cr.metadata.annotations['firestartr.dev/claim-ref']}
162120
+ - ${claimRef}
161467
162121
  `);
161468
162122
  }
161469
162123
  tfStateKeys[cr.spec.firestartr.tfStateKey] = cr;
161470
162124
  }
161471
162125
  }
162126
+ function validateClaimRefOwnership(previousCrs, renderedCrs) {
162127
+ for (const crKey of Object.keys(renderedCrs)) {
162128
+ const previous = previousCrs[crKey];
162129
+ if (!previous)
162130
+ continue;
162131
+ const previousClaimRef = previous.metadata?.annotations?.['firestartr.dev/claim-ref'];
162132
+ const renderedClaimRef = renderedCrs[crKey].metadata?.annotations?.['firestartr.dev/claim-ref'];
162133
+ if (previousClaimRef === renderedClaimRef)
162134
+ continue;
162135
+ const cr = renderedCrs[crKey];
162136
+ throw new Error(`The rendered ${cr.kind} ${cr.metadata?.name} would overwrite an existing resource owned by ${previousClaimRef ?? '<unknown claim>'} (rendered by ${renderedClaimRef ?? '<unknown claim>'})`);
162137
+ }
162138
+ }
161472
162139
  function references_isCatalogEntity(cr) {
161473
162140
  return [
161474
162141
  'Component',
@@ -161870,6 +162537,7 @@ const KINDS_CR_MAP = {
161870
162537
 
161871
162538
 
161872
162539
 
162540
+
161873
162541
  function resolveStringReference(reference) {
161874
162542
  const referenceElements = reference.split(':');
161875
162543
  const actualKind = KINDS_CR_MAP[referenceElements[0]];
@@ -161890,6 +162558,8 @@ function resolveClaimFilesList(claimRefsList) {
161890
162558
  const fileList = claimRefsList.replace(/\s/g, '').split(',');
161891
162559
  const refList = [];
161892
162560
  for (const file of fileList) {
162561
+ if (isIgnoredFile(file))
162562
+ continue;
161893
162563
  try {
161894
162564
  const data = fs.readFileSync(file, 'utf-8');
161895
162565
  const claim = common.io.fromYaml(data);
@@ -161920,6 +162590,8 @@ async function* resolveClaimEntries(claimRefsList) {
161920
162590
  yield* resolveDirEntries(claimEntry);
161921
162591
  }
161922
162592
  else if (claimEntryStats.isFile()) {
162593
+ if (fileIgnore_isIgnoredFile(claimEntry))
162594
+ continue;
161923
162595
  logger.debug(`Sending entry ${resolveClaimFileRef(claimEntry)} (${claimEntry})`);
161924
162596
  yield resolveClaimFileRef(claimEntry);
161925
162597
  }
@@ -161939,12 +162611,15 @@ async function* resolveDirEntries(dir) {
161939
162611
  catch (err) {
161940
162612
  throw new Error(`Reading dir: ${dir}: ${err}`);
161941
162613
  }
162614
+ const ignoreFiles = entries.some((entry) => entry.name === FIRESTARTR_IGNORE_FILE);
161942
162615
  for (const entry of entries) {
161943
162616
  const fullPath = external_path_default().join(dir, entry.name);
161944
162617
  if (entry.isDirectory()) {
161945
162618
  yield* resolveDirEntries(fullPath);
161946
162619
  }
161947
- else if (entry.isFile() && entry.name.match(/\.yaml$|\.yml$/)) {
162620
+ else if (!ignoreFiles &&
162621
+ entry.isFile() &&
162622
+ entry.name.match(/\.yaml$|\.yml$/)) {
161948
162623
  const claimRef = await resolveClaimFileRef(fullPath);
161949
162624
  logger.debug(`Sending entry ${claimRef} (${fullPath})`);
161950
162625
  yield claimRef;
@@ -162019,12 +162694,15 @@ async function crawlClaimsDir(dir, basePath, claims) {
162019
162694
  catch (err) {
162020
162695
  throw new Error(`Reading directory ${dir}: ${err}`);
162021
162696
  }
162697
+ const ignoreFiles = entries.some((entry) => entry.name === FIRESTARTR_IGNORE_FILE);
162022
162698
  for (const entry of entries) {
162023
162699
  const fullPath = external_path_default().join(dir, entry.name);
162024
162700
  if (entry.isDirectory()) {
162025
162701
  await crawlClaimsDir(fullPath, basePath, claims);
162026
162702
  }
162027
- else if (entry.isFile() && entry.name.match(/\.yaml$|\.yml$/)) {
162703
+ else if (!ignoreFiles &&
162704
+ entry.isFile() &&
162705
+ entry.name.match(/\.yaml$|\.yml$/)) {
162028
162706
  try {
162029
162707
  const data = await external_fs_default().promises.readFile(fullPath, 'utf-8');
162030
162708
  const claim = catalog_common/* default */.A.io.fromYaml(data);
@@ -167084,7 +167762,8 @@ async function renderer_render(catalogScope, firestartrScope, claimList) {
167084
167762
  try {
167085
167763
  validateSubReferences(data.renderClaims);
167086
167764
  validateComponentPagesPath(data.renderClaims);
167087
- validateTfStateKeyUniqueness(result);
167765
+ validateClaimRefOwnership(data.fullCrs, result);
167766
+ validateTfStateKeyUniqueness(fullCrSet);
167088
167767
  validateGithubOrgSettingsSingleton(fullCrSet);
167089
167768
  validateGithubOrgVariableSectionSingleton(fullCrSet);
167090
167769
  validateActionsVariablesUniqueness(result);
@@ -354102,87 +354781,94 @@ function getDiagnosticErrorCount() {
354102
354781
 
354103
354782
 
354104
354783
 
354105
-
354106
354784
  const DIAGNOSTIC_FILE = '/tmp/diagnostic';
354107
- const DIAGNOSTIC_INTERVAL_MS = 10 * 1000;
354785
+ const DEFAULT_DIAGNOSTIC_INTERVAL_SECONDS = 10;
354786
+ // setTimeout/setInterval clamp any delay above 2^31-1 ms to 1 ms, which would
354787
+ // turn a large configured interval into a tight write loop.
354788
+ const MAX_DIAGNOSTIC_INTERVAL_SECONDS = Math.floor((2 ** 31 - 1) / 1000);
354108
354789
  let _diagnosticTimer;
354109
- // Capture the set of CRD plurals that were missing when diagnostics began.
354110
- // Once recorded, observedKinds will permanently exclude kinds whose plural
354111
- // was missing at startup so that CRDs applied later while the operator is
354112
- // running do not retroactively appear in the observed list.
354113
- let _initialMissingPlurals;
354114
- function clearTimer() {
354115
- if (_diagnosticTimer !== undefined) {
354116
- clearInterval(_diagnosticTimer);
354117
- _diagnosticTimer = undefined;
354790
+ /**
354791
+ * Reads `OPERATOR_DIAGNOSTIC_INTERVAL_SECONDS`, falling back to the default for
354792
+ * absent or unusable values so a typo cannot disable diagnostics.
354793
+ */
354794
+ function getDiagnosticIntervalSeconds(env = process.env) {
354795
+ const raw = env.OPERATOR_DIAGNOSTIC_INTERVAL_SECONDS;
354796
+ if (raw === undefined)
354797
+ return DEFAULT_DIAGNOSTIC_INTERVAL_SECONDS;
354798
+ const parsed = Number(raw.trim());
354799
+ if (!Number.isFinite(parsed) ||
354800
+ parsed < 1 ||
354801
+ parsed > MAX_DIAGNOSTIC_INTERVAL_SECONDS) {
354802
+ return DEFAULT_DIAGNOSTIC_INTERVAL_SECONDS;
354118
354803
  }
354804
+ return Math.round(parsed);
354119
354805
  }
354120
- function loopDiagnosticFile(queue, maxSlots) {
354121
- if (process.env.DISABLE_DIAGNOSTIC_FILE) {
354806
+ /**
354807
+ * Starts the periodic diagnostic writer and writes the first snapshot right
354808
+ * away, so the file exists before any work item arrives.
354809
+ *
354810
+ * Idempotent: a second call while a writer is running is a no-op, so the
354811
+ * startup path and the in-loop call never race on the same file.
354812
+ *
354813
+ * @returns whether this call started the writer.
354814
+ */
354815
+ function startDiagnosticFile(source, maxSlots, env = process.env) {
354816
+ if (_diagnosticTimer !== undefined) {
354817
+ operator_src_logger.info('Diagnostic file writer already running, keeping the active one');
354818
+ return false;
354819
+ }
354820
+ if (env.DISABLE_DIAGNOSTIC_FILE) {
354122
354821
  operator_src_logger.info('Diagnostic file disabled by DISABLE_DIAGNOSTIC_FILE');
354123
- return;
354822
+ return false;
354124
354823
  }
354824
+ const intervalSeconds = getDiagnosticIntervalSeconds(env);
354125
354825
  let running = false;
354126
- _diagnosticTimer = setInterval(() => {
354826
+ const writeSnapshot = () => {
354127
354827
  if (running)
354128
354828
  return;
354129
354829
  running = true;
354130
- writeDiagnosticSnapshot(queue, maxSlots)
354830
+ // The source is read inside the snapshot builder, so a throwing seam becomes
354831
+ // a logged rejection instead of escaping into the caller.
354832
+ writeDiagnosticSnapshot(source, maxSlots)
354131
354833
  .then(() => {
354132
354834
  running = false;
354133
354835
  })
354134
354836
  .catch((err) => {
354837
+ // Best-effort: a failed snapshot never crashes the operator; the next
354838
+ // tick retries with a fresh snapshot.
354135
354839
  running = false;
354136
354840
  operator_src_logger.error(`Error writing diagnostic file: ${err}`);
354137
354841
  });
354138
- }, DIAGNOSTIC_INTERVAL_MS);
354139
- // Clear the interval on termination signals so the process can exit cleanly
354140
- const onSignal = () => clearTimer();
354141
- process.on('SIGTERM', onSignal);
354142
- process.on('SIGINT', onSignal);
354842
+ };
354843
+ writeSnapshot();
354844
+ _diagnosticTimer = setInterval(writeSnapshot, intervalSeconds * 1000);
354845
+ // Diagnostics must never keep the process alive nor change termination
354846
+ // behaviour: an unref'd timer cannot hold the process open, so shutting down
354847
+ // is left entirely to the operator's own signal handlers.
354848
+ if (typeof _diagnosticTimer.unref === 'function')
354849
+ _diagnosticTimer.unref();
354850
+ operator_src_logger.info(`Diagnostic file writer started (every ${intervalSeconds}s)`);
354851
+ return true;
354852
+ }
354853
+ function stopDiagnosticFile() {
354854
+ if (_diagnosticTimer !== undefined) {
354855
+ clearInterval(_diagnosticTimer);
354856
+ _diagnosticTimer = undefined;
354857
+ }
354143
354858
  }
354144
354859
  /** @internal for testing */
354145
354860
  function getDiagnosticTimer() {
354146
354861
  return _diagnosticTimer;
354147
354862
  }
354148
- async function writeDiagnosticSnapshot(queue, maxSlots) {
354863
+ async function writeDiagnosticSnapshot(source, maxSlots) {
354864
+ const snapshot = source();
354149
354865
  const now = new Date().toISOString();
354150
- // Queue counts
354151
- let pending = 0;
354152
- let processing = 0;
354153
- let finished = 0;
354154
- let blocked = 0;
354155
- let deadLetter = 0;
354866
+ const { pending, processing, finished, blocked, deadLetter } = snapshot;
354156
354867
  // Per-slot items
354157
354868
  const slotsMap = {};
354158
- for (const wi of queue) {
354159
- switch (wi.workStatus) {
354160
- case WorkStatus.PENDING:
354161
- pending++;
354162
- break;
354163
- case WorkStatus.PROCESSING:
354164
- processing++;
354165
- break;
354166
- case WorkStatus.FINISHED:
354167
- finished++;
354168
- break;
354169
- }
354170
- if (wi.isBlocked) {
354171
- blocked++;
354172
- }
354173
- if (wi.isDeadLetter) {
354174
- deadLetter++;
354175
- }
354176
- if (wi.workStatus === WorkStatus.PROCESSING && wi.slotId !== undefined) {
354177
- slotsMap[`slot-${wi.slotId}`] =
354178
- `${wi.item.kind}/${wi.item.metadata.name}`;
354179
- }
354180
- }
354181
- // Fill empty slots with null
354182
354869
  for (let i = 0; i < maxSlots; i++) {
354183
- if (!slotsMap[`slot-${i}`]) {
354184
- slotsMap[`slot-${i}`] = 'null';
354185
- }
354870
+ const key = `slot-${i}`;
354871
+ slotsMap[key] = snapshot.slots[key] ?? 'null';
354186
354872
  }
354187
354873
  // Semaphore stats
354188
354874
  const semaphoreCurrent = getCurrentConcurrentApiCalls();
@@ -354201,23 +354887,32 @@ async function writeDiagnosticSnapshot(queue, maxSlots) {
354201
354887
  const envBackendProvider = process.env.BACKEND_PROVIDER_NAME || 'kubernetes-provider';
354202
354888
  const envGithubAppId = process.env.GITHUB_APP_ID || '';
354203
354889
  const envTfmSkipGitConfig = process.env.TFM_SKIP_GIT_CONFIG || 'false';
354204
- // CRD diagnostics: observed kinds (from OPERATOR_KIND_LIST) and missing CRDs
354205
- // missing CRDs are derived from the runtime __crdMonitors map; any monitor
354206
- // that is started indicates an actively-missing CRD that is being watched.
354890
+ // CRD diagnostics: observed kinds (from OPERATOR_KIND_LIST) and missing CRDs.
354891
+ // `__crdMonitors` keeps one registration per kind whose CRD was absent when
354892
+ // observeKind ran, and a stopped monitor stays registered (crdMonitor only
354893
+ // flips isStarted). Such a kind has no informer attached until the operator is
354894
+ // restarted, so it must never be reported as observed. Deriving the
354895
+ // exclusions from the retained registrations - not from a sampled isStarted()
354896
+ // state - keeps a kind excluded when its monitor starts and stops between two
354897
+ // ticks, or registers after the first snapshot.
354207
354898
  const observedKindsRaw = envKindList
354208
354899
  .split(',')
354209
354900
  .map((s) => s.trim())
354210
354901
  .filter((s) => s.length > 0);
354211
354902
  const missingCrds = [];
354903
+ const registeredPlurals = new Set();
354212
354904
  try {
354213
354905
  const monitors = global.__crdMonitors;
354214
354906
  if (monitors && typeof monitors === 'object') {
354215
354907
  for (const [key, monitor] of monitors) {
354908
+ // key shape is namespace/plural (reflector uses `${namespace}/${plural}`)
354909
+ const plural = String(key).split('/').pop()?.toLowerCase();
354910
+ if (plural)
354911
+ registeredPlurals.add(plural);
354216
354912
  try {
354217
354913
  if (monitor &&
354218
354914
  typeof monitor.isStarted === 'function' &&
354219
354915
  monitor.isStarted()) {
354220
- // key shape is namespace/plural (reflector uses `${namespace}/${plural}`)
354221
354916
  missingCrds.push(String(key));
354222
354917
  }
354223
354918
  }
@@ -354230,13 +354925,7 @@ async function writeDiagnosticSnapshot(queue, maxSlots) {
354230
354925
  catch (e) {
354231
354926
  // defensive: do not fail diagnostic writing if globals are not present
354232
354927
  }
354233
- // Compute the set of plurals that were missing when diagnostics started.
354234
- // We only capture this once so that CRDs installed while the operator
354235
- // is running do not cause previously-missing kinds to become observed.
354236
- if (!_initialMissingPlurals) {
354237
- _initialMissingPlurals = new Set(missingCrds.map((k) => String(k).split('/').pop()?.toLowerCase() || ''));
354238
- }
354239
- const observedKinds = observedKindsRaw.filter((k) => !_initialMissingPlurals.has(k.toLowerCase()));
354928
+ const observedKinds = observedKindsRaw.filter((k) => !registeredPlurals.has(k.toLowerCase()));
354240
354929
  // Build YAML output
354241
354930
  let output = '';
354242
354931
  output += `timestamp: "${now}"\n`;
@@ -354251,7 +354940,7 @@ async function writeDiagnosticSnapshot(queue, maxSlots) {
354251
354940
  output += ` GITHUB_APP_ID: ${envGithubAppId}\n`;
354252
354941
  output += ` TFM_SKIP_GIT_CONFIG: ${envTfmSkipGitConfig}\n`;
354253
354942
  output += 'queue:\n';
354254
- output += ` total: ${queue.length}\n`;
354943
+ output += ` total: ${snapshot.total}\n`;
354255
354944
  output += ` pending: ${pending}\n`;
354256
354945
  output += ` processing: ${processing}\n`;
354257
354946
  output += ` finished: ${finished}\n`;
@@ -355135,6 +355824,13 @@ function getMaxSlotsFromEnvironment() {
355135
355824
  return parsedMaxSlots;
355136
355825
  }
355137
355826
  const MAX_SLOTS = getMaxSlotsFromEnvironment();
355827
+ /**
355828
+ * Number of concurrent processing slots, used by startup wiring that needs the
355829
+ * same capacity the processor loop uses.
355830
+ */
355831
+ function getMaxSlots() {
355832
+ return MAX_SLOTS;
355833
+ }
355138
355834
  function getQueueMetrics() {
355139
355835
  let renamed = 0;
355140
355836
  let updated = 0;
@@ -355195,6 +355891,37 @@ function getQueueMetrics() {
355195
355891
  },
355196
355892
  };
355197
355893
  }
355894
+ /**
355895
+ * Queue state for the diagnostic file. Counts come from the existing metrics
355896
+ * seam (`getQueueMetrics`) so scheduling state is never counted twice, and only
355897
+ * the fields the diagnostic file documents differently are derived here: `blocked`
355898
+ * keeps the historical `isBlocked` meaning instead of the parent-aware gauge,
355899
+ * and `slots` needs the per-slot assignment the gauge does not expose.
355900
+ */
355901
+ function getOperatorQueueSnapshot() {
355902
+ const metrics = getQueueMetrics();
355903
+ const slots = {};
355904
+ let blocked = 0;
355905
+ for (const workItem of queue) {
355906
+ if (workItem.isBlocked) {
355907
+ blocked++;
355908
+ }
355909
+ if (workItem.workStatus === WorkStatus.PROCESSING &&
355910
+ workItem.slotId !== undefined) {
355911
+ slots[`slot-${workItem.slotId}`] =
355912
+ `${workItem.item.kind}/${workItem.item.metadata.name}`;
355913
+ }
355914
+ }
355915
+ return {
355916
+ total: metrics.nItems,
355917
+ pending: metrics.nItemsPending,
355918
+ processing: metrics.nItemsProcessing,
355919
+ finished: metrics.nItemsFinished,
355920
+ blocked,
355921
+ deadLetter: metrics.nItemsInDeadLetterHandling,
355922
+ slots,
355923
+ };
355924
+ }
355198
355925
  let INIT = false;
355199
355926
  let podIsTerminating = false;
355200
355927
  const handleTerminationSignal = (signal) => {
@@ -355230,7 +355957,7 @@ async function processItem(workItem) {
355230
355957
  */
355231
355958
  async function processItem_loop() {
355232
355959
  loopWorkItemDebug(queue);
355233
- loopDiagnosticFile(queue, MAX_SLOTS);
355960
+ startDiagnosticFile(getOperatorQueueSnapshot, MAX_SLOTS);
355234
355961
  const deferredBookkeeper = new DeferredSchedulingBookkeeper();
355235
355962
  _deferredBookkeeper = deferredBookkeeper;
355236
355963
  const processItemSlotsManager = initProcessItemsSlots(MAX_SLOTS, true, (w) => deferredBookkeeper.incrementBlockedAttempt(w));
@@ -362066,6 +362793,11 @@ async function planTerraformWorkspace(cr, status, opts) {
362066
362793
  async function planGithubResource(cr, status, opts) {
362067
362794
  fDebug('Resolving references');
362068
362795
  const deps = await resolve(cr, getPrAwareItemByItemPath(opts, status), getSecret, opts.namespace);
362796
+ deps['self-outputs'] = {
362797
+ cr: cr?.metadata?.name
362798
+ ? await resolveSecretRef(cr.metadata.namespace || opts.namespace, cr, getSecret)
362799
+ : undefined,
362800
+ };
362069
362801
  fDebug('Running GitHub provisioner plan');
362070
362802
  return await gh_provisioner.runGhProvisioner({
362071
362803
  mainCr: cr,
@@ -363154,6 +363886,7 @@ async function tfLocal(cr, namespace, cmd = 'plan') {
363154
363886
 
363155
363887
 
363156
363888
 
363889
+
363157
363890
  let importModeActive = false;
363158
363891
  let withMetricsMode = false;
363159
363892
 
@@ -363187,6 +363920,9 @@ function runOperator(opts) {
363187
363920
  if (importModeSkipPlan)
363188
363921
  importModeSkipPlanActive = importModeSkipPlan;
363189
363922
  initActivityLog();
363923
+ // Start the /tmp/diagnostic flight recorder before any work arrives so the
363924
+ // file exists right after startup, independently of the processor loop.
363925
+ startDiagnosticFile(getOperatorQueueSnapshot, getMaxSlots());
363190
363926
  operator_src_logger.info(`started the operator with options ${JSON.stringify(opts)}`);
363191
363927
  // Create the immutable operator profile from startup env snapshot
363192
363928
  // Must happen before any work processing or feedback machinery
@@ -364201,9 +364937,9 @@ const crsStatusSubcommand = {
364201
364937
  };
364202
364938
 
364203
364939
  ;// CONCATENATED MODULE: ./package.json
364204
- const package_namespaceObject = {"rE":"3.1.0"};
364940
+ const package_namespaceObject = /*#__PURE__*/JSON.parse('{"rE":"3.1.1-snapshot-pagination-fix"}');
364205
364941
  ;// CONCATENATED MODULE: ../../package.json
364206
- const package_namespaceObject_1 = {"rE":"3.1.0"};
364942
+ const package_namespaceObject_1 = {"rE":"3.1.1"};
364207
364943
  // EXTERNAL MODULE: ../../node_modules/semver/index.js
364208
364944
  var semver = __nccwpck_require__(90084);
364209
364945
  var semver_default = /*#__PURE__*/__nccwpck_require__.n(semver);