@firestartr/cli 3.1.1-snapshot-firestartrignore → 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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
139653
|
-
const
|
|
139654
|
-
if (!VALID_SCHEME.test(
|
|
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
|
|
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
|
-
|
|
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 =
|
|
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 =
|
|
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
|
-
|
|
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 =
|
|
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
|
-
|
|
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 (
|
|
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
|
-
|
|
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
|
-
|
|
140103
|
-
|
|
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 ||
|
|
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
|
-
|
|
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,
|
|
@@ -354159,87 +354781,94 @@ function getDiagnosticErrorCount() {
|
|
|
354159
354781
|
|
|
354160
354782
|
|
|
354161
354783
|
|
|
354162
|
-
|
|
354163
354784
|
const DIAGNOSTIC_FILE = '/tmp/diagnostic';
|
|
354164
|
-
const
|
|
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);
|
|
354165
354789
|
let _diagnosticTimer;
|
|
354166
|
-
|
|
354167
|
-
|
|
354168
|
-
|
|
354169
|
-
|
|
354170
|
-
|
|
354171
|
-
|
|
354172
|
-
if (
|
|
354173
|
-
|
|
354174
|
-
|
|
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;
|
|
354175
354803
|
}
|
|
354804
|
+
return Math.round(parsed);
|
|
354176
354805
|
}
|
|
354177
|
-
|
|
354178
|
-
|
|
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) {
|
|
354179
354821
|
operator_src_logger.info('Diagnostic file disabled by DISABLE_DIAGNOSTIC_FILE');
|
|
354180
|
-
return;
|
|
354822
|
+
return false;
|
|
354181
354823
|
}
|
|
354824
|
+
const intervalSeconds = getDiagnosticIntervalSeconds(env);
|
|
354182
354825
|
let running = false;
|
|
354183
|
-
|
|
354826
|
+
const writeSnapshot = () => {
|
|
354184
354827
|
if (running)
|
|
354185
354828
|
return;
|
|
354186
354829
|
running = true;
|
|
354187
|
-
|
|
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)
|
|
354188
354833
|
.then(() => {
|
|
354189
354834
|
running = false;
|
|
354190
354835
|
})
|
|
354191
354836
|
.catch((err) => {
|
|
354837
|
+
// Best-effort: a failed snapshot never crashes the operator; the next
|
|
354838
|
+
// tick retries with a fresh snapshot.
|
|
354192
354839
|
running = false;
|
|
354193
354840
|
operator_src_logger.error(`Error writing diagnostic file: ${err}`);
|
|
354194
354841
|
});
|
|
354195
|
-
}
|
|
354196
|
-
|
|
354197
|
-
|
|
354198
|
-
process
|
|
354199
|
-
process
|
|
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
|
+
}
|
|
354200
354858
|
}
|
|
354201
354859
|
/** @internal for testing */
|
|
354202
354860
|
function getDiagnosticTimer() {
|
|
354203
354861
|
return _diagnosticTimer;
|
|
354204
354862
|
}
|
|
354205
|
-
async function writeDiagnosticSnapshot(
|
|
354863
|
+
async function writeDiagnosticSnapshot(source, maxSlots) {
|
|
354864
|
+
const snapshot = source();
|
|
354206
354865
|
const now = new Date().toISOString();
|
|
354207
|
-
|
|
354208
|
-
let pending = 0;
|
|
354209
|
-
let processing = 0;
|
|
354210
|
-
let finished = 0;
|
|
354211
|
-
let blocked = 0;
|
|
354212
|
-
let deadLetter = 0;
|
|
354866
|
+
const { pending, processing, finished, blocked, deadLetter } = snapshot;
|
|
354213
354867
|
// Per-slot items
|
|
354214
354868
|
const slotsMap = {};
|
|
354215
|
-
for (const wi of queue) {
|
|
354216
|
-
switch (wi.workStatus) {
|
|
354217
|
-
case WorkStatus.PENDING:
|
|
354218
|
-
pending++;
|
|
354219
|
-
break;
|
|
354220
|
-
case WorkStatus.PROCESSING:
|
|
354221
|
-
processing++;
|
|
354222
|
-
break;
|
|
354223
|
-
case WorkStatus.FINISHED:
|
|
354224
|
-
finished++;
|
|
354225
|
-
break;
|
|
354226
|
-
}
|
|
354227
|
-
if (wi.isBlocked) {
|
|
354228
|
-
blocked++;
|
|
354229
|
-
}
|
|
354230
|
-
if (wi.isDeadLetter) {
|
|
354231
|
-
deadLetter++;
|
|
354232
|
-
}
|
|
354233
|
-
if (wi.workStatus === WorkStatus.PROCESSING && wi.slotId !== undefined) {
|
|
354234
|
-
slotsMap[`slot-${wi.slotId}`] =
|
|
354235
|
-
`${wi.item.kind}/${wi.item.metadata.name}`;
|
|
354236
|
-
}
|
|
354237
|
-
}
|
|
354238
|
-
// Fill empty slots with null
|
|
354239
354869
|
for (let i = 0; i < maxSlots; i++) {
|
|
354240
|
-
|
|
354241
|
-
|
|
354242
|
-
}
|
|
354870
|
+
const key = `slot-${i}`;
|
|
354871
|
+
slotsMap[key] = snapshot.slots[key] ?? 'null';
|
|
354243
354872
|
}
|
|
354244
354873
|
// Semaphore stats
|
|
354245
354874
|
const semaphoreCurrent = getCurrentConcurrentApiCalls();
|
|
@@ -354258,23 +354887,32 @@ async function writeDiagnosticSnapshot(queue, maxSlots) {
|
|
|
354258
354887
|
const envBackendProvider = process.env.BACKEND_PROVIDER_NAME || 'kubernetes-provider';
|
|
354259
354888
|
const envGithubAppId = process.env.GITHUB_APP_ID || '';
|
|
354260
354889
|
const envTfmSkipGitConfig = process.env.TFM_SKIP_GIT_CONFIG || 'false';
|
|
354261
|
-
// CRD diagnostics: observed kinds (from OPERATOR_KIND_LIST) and missing CRDs
|
|
354262
|
-
//
|
|
354263
|
-
//
|
|
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.
|
|
354264
354898
|
const observedKindsRaw = envKindList
|
|
354265
354899
|
.split(',')
|
|
354266
354900
|
.map((s) => s.trim())
|
|
354267
354901
|
.filter((s) => s.length > 0);
|
|
354268
354902
|
const missingCrds = [];
|
|
354903
|
+
const registeredPlurals = new Set();
|
|
354269
354904
|
try {
|
|
354270
354905
|
const monitors = global.__crdMonitors;
|
|
354271
354906
|
if (monitors && typeof monitors === 'object') {
|
|
354272
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);
|
|
354273
354912
|
try {
|
|
354274
354913
|
if (monitor &&
|
|
354275
354914
|
typeof monitor.isStarted === 'function' &&
|
|
354276
354915
|
monitor.isStarted()) {
|
|
354277
|
-
// key shape is namespace/plural (reflector uses `${namespace}/${plural}`)
|
|
354278
354916
|
missingCrds.push(String(key));
|
|
354279
354917
|
}
|
|
354280
354918
|
}
|
|
@@ -354287,13 +354925,7 @@ async function writeDiagnosticSnapshot(queue, maxSlots) {
|
|
|
354287
354925
|
catch (e) {
|
|
354288
354926
|
// defensive: do not fail diagnostic writing if globals are not present
|
|
354289
354927
|
}
|
|
354290
|
-
|
|
354291
|
-
// We only capture this once so that CRDs installed while the operator
|
|
354292
|
-
// is running do not cause previously-missing kinds to become observed.
|
|
354293
|
-
if (!_initialMissingPlurals) {
|
|
354294
|
-
_initialMissingPlurals = new Set(missingCrds.map((k) => String(k).split('/').pop()?.toLowerCase() || ''));
|
|
354295
|
-
}
|
|
354296
|
-
const observedKinds = observedKindsRaw.filter((k) => !_initialMissingPlurals.has(k.toLowerCase()));
|
|
354928
|
+
const observedKinds = observedKindsRaw.filter((k) => !registeredPlurals.has(k.toLowerCase()));
|
|
354297
354929
|
// Build YAML output
|
|
354298
354930
|
let output = '';
|
|
354299
354931
|
output += `timestamp: "${now}"\n`;
|
|
@@ -354308,7 +354940,7 @@ async function writeDiagnosticSnapshot(queue, maxSlots) {
|
|
|
354308
354940
|
output += ` GITHUB_APP_ID: ${envGithubAppId}\n`;
|
|
354309
354941
|
output += ` TFM_SKIP_GIT_CONFIG: ${envTfmSkipGitConfig}\n`;
|
|
354310
354942
|
output += 'queue:\n';
|
|
354311
|
-
output += ` total: ${
|
|
354943
|
+
output += ` total: ${snapshot.total}\n`;
|
|
354312
354944
|
output += ` pending: ${pending}\n`;
|
|
354313
354945
|
output += ` processing: ${processing}\n`;
|
|
354314
354946
|
output += ` finished: ${finished}\n`;
|
|
@@ -355192,6 +355824,13 @@ function getMaxSlotsFromEnvironment() {
|
|
|
355192
355824
|
return parsedMaxSlots;
|
|
355193
355825
|
}
|
|
355194
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
|
+
}
|
|
355195
355834
|
function getQueueMetrics() {
|
|
355196
355835
|
let renamed = 0;
|
|
355197
355836
|
let updated = 0;
|
|
@@ -355252,6 +355891,37 @@ function getQueueMetrics() {
|
|
|
355252
355891
|
},
|
|
355253
355892
|
};
|
|
355254
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
|
+
}
|
|
355255
355925
|
let INIT = false;
|
|
355256
355926
|
let podIsTerminating = false;
|
|
355257
355927
|
const handleTerminationSignal = (signal) => {
|
|
@@ -355287,7 +355957,7 @@ async function processItem(workItem) {
|
|
|
355287
355957
|
*/
|
|
355288
355958
|
async function processItem_loop() {
|
|
355289
355959
|
loopWorkItemDebug(queue);
|
|
355290
|
-
|
|
355960
|
+
startDiagnosticFile(getOperatorQueueSnapshot, MAX_SLOTS);
|
|
355291
355961
|
const deferredBookkeeper = new DeferredSchedulingBookkeeper();
|
|
355292
355962
|
_deferredBookkeeper = deferredBookkeeper;
|
|
355293
355963
|
const processItemSlotsManager = initProcessItemsSlots(MAX_SLOTS, true, (w) => deferredBookkeeper.incrementBlockedAttempt(w));
|
|
@@ -363216,6 +363886,7 @@ async function tfLocal(cr, namespace, cmd = 'plan') {
|
|
|
363216
363886
|
|
|
363217
363887
|
|
|
363218
363888
|
|
|
363889
|
+
|
|
363219
363890
|
let importModeActive = false;
|
|
363220
363891
|
let withMetricsMode = false;
|
|
363221
363892
|
|
|
@@ -363249,6 +363920,9 @@ function runOperator(opts) {
|
|
|
363249
363920
|
if (importModeSkipPlan)
|
|
363250
363921
|
importModeSkipPlanActive = importModeSkipPlan;
|
|
363251
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());
|
|
363252
363926
|
operator_src_logger.info(`started the operator with options ${JSON.stringify(opts)}`);
|
|
363253
363927
|
// Create the immutable operator profile from startup env snapshot
|
|
363254
363928
|
// Must happen before any work processing or feedback machinery
|
|
@@ -364263,7 +364937,7 @@ const crsStatusSubcommand = {
|
|
|
364263
364937
|
};
|
|
364264
364938
|
|
|
364265
364939
|
;// CONCATENATED MODULE: ./package.json
|
|
364266
|
-
const package_namespaceObject = /*#__PURE__*/JSON.parse('{"rE":"3.1.1-snapshot-
|
|
364940
|
+
const package_namespaceObject = /*#__PURE__*/JSON.parse('{"rE":"3.1.1-snapshot-pagination-fix"}');
|
|
364267
364941
|
;// CONCATENATED MODULE: ../../package.json
|
|
364268
364942
|
const package_namespaceObject_1 = {"rE":"3.1.1"};
|
|
364269
364943
|
// EXTERNAL MODULE: ../../node_modules/semver/index.js
|