@cloudsnorkel/cdk-github-runners 0.14.24 → 0.15.1
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/.jsii +5953 -602
- package/API.md +1349 -115
- package/README.md +53 -1
- package/assets/delete-failed-runner.lambda/index.js +122 -9
- package/assets/idle-runner-repear.lambda/index.js +153 -14
- package/assets/image-builders/aws-image-builder/delete-resources.lambda/index.js +1 -1
- package/assets/image-builders/build-image.lambda/index.js +1 -1
- package/assets/providers/ami-root-device.lambda/index.js +1 -1
- package/assets/setup.lambda/index.html +7 -7
- package/assets/setup.lambda/index.js +118 -8
- package/assets/status.lambda/index.js +121 -8
- package/assets/token-retriever.lambda/index.js +121 -8
- package/assets/warm-runner-manager.lambda/index.js +5909 -0
- package/assets/webhook-handler.lambda/index.js +126 -11
- package/assets/webhook-redelivery.lambda/index.js +139 -24
- package/lib/access.js +1 -1
- package/lib/delete-failed-runner.lambda.js +2 -2
- package/lib/idle-runner-repear.lambda.js +33 -7
- package/lib/image-builders/api.js +1 -1
- package/lib/image-builders/aws-image-builder/base-image.d.ts +13 -0
- package/lib/image-builders/aws-image-builder/base-image.js +36 -3
- package/lib/image-builders/aws-image-builder/builder.js +4 -4
- package/lib/image-builders/aws-image-builder/delete-resources.lambda.js +2 -2
- package/lib/image-builders/aws-image-builder/deprecated/ami.js +1 -1
- package/lib/image-builders/aws-image-builder/deprecated/container.js +1 -1
- package/lib/image-builders/aws-image-builder/deprecated/linux-components.js +1 -1
- package/lib/image-builders/aws-image-builder/deprecated/windows-components.js +1 -1
- package/lib/image-builders/build-image.lambda.js +2 -2
- package/lib/image-builders/codebuild-deprecated.js +1 -1
- package/lib/image-builders/components.js +3 -3
- package/lib/image-builders/static.js +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -1
- package/lib/lambda-github.d.ts +1 -1
- package/lib/lambda-github.js +3 -2
- package/lib/lambda-helpers.js +4 -4
- package/lib/providers/ami-root-device.lambda.js +2 -2
- package/lib/providers/codebuild.d.ts +18 -2
- package/lib/providers/codebuild.js +15 -4
- package/lib/providers/common.d.ts +47 -3
- package/lib/providers/common.js +29 -5
- package/lib/providers/composite.js +14 -19
- package/lib/providers/ec2.d.ts +9 -2
- package/lib/providers/ec2.js +84 -42
- package/lib/providers/ecs.d.ts +19 -2
- package/lib/providers/ecs.js +49 -44
- package/lib/providers/fargate.d.ts +2 -2
- package/lib/providers/fargate.js +19 -36
- package/lib/providers/lambda.d.ts +2 -2
- package/lib/providers/lambda.js +3 -3
- package/lib/runner.d.ts +31 -3
- package/lib/runner.js +171 -46
- package/lib/secrets.js +1 -1
- package/lib/setup.lambda.js +2 -2
- package/lib/utils.d.ts +10 -1
- package/lib/utils.js +15 -1
- package/lib/warm-runner-manager-function.d.ts +18 -0
- package/lib/warm-runner-manager-function.js +24 -0
- package/lib/warm-runner-manager.lambda.d.ts +41 -0
- package/lib/warm-runner-manager.lambda.js +487 -0
- package/lib/warm-runner.d.ts +155 -0
- package/lib/warm-runner.js +217 -0
- package/lib/webhook-handler.lambda.js +5 -3
- package/lib/webhook-redelivery.lambda.js +17 -16
- package/lib/webhook.d.ts +4 -0
- package/lib/webhook.js +2 -1
- package/node_modules/cron-parser/LICENSE +21 -0
- package/node_modules/cron-parser/README.md +408 -0
- package/node_modules/cron-parser/dist/CronDate.js +518 -0
- package/node_modules/cron-parser/dist/CronExpression.js +520 -0
- package/node_modules/cron-parser/dist/CronExpressionParser.js +382 -0
- package/node_modules/cron-parser/dist/CronFieldCollection.js +371 -0
- package/node_modules/cron-parser/dist/CronFileParser.js +109 -0
- package/node_modules/cron-parser/dist/fields/CronDayOfMonth.js +44 -0
- package/node_modules/cron-parser/dist/fields/CronDayOfWeek.js +51 -0
- package/node_modules/cron-parser/dist/fields/CronField.js +214 -0
- package/node_modules/cron-parser/dist/fields/CronHour.js +40 -0
- package/node_modules/cron-parser/dist/fields/CronMinute.js +40 -0
- package/node_modules/cron-parser/dist/fields/CronMonth.js +44 -0
- package/node_modules/cron-parser/dist/fields/CronSecond.js +40 -0
- package/node_modules/cron-parser/dist/fields/index.js +24 -0
- package/node_modules/cron-parser/dist/fields/types.js +2 -0
- package/node_modules/cron-parser/dist/index.js +31 -0
- package/node_modules/cron-parser/dist/types/CronDate.d.ts +288 -0
- package/node_modules/cron-parser/dist/types/CronExpression.d.ts +118 -0
- package/node_modules/cron-parser/dist/types/CronExpressionParser.d.ts +70 -0
- package/node_modules/cron-parser/dist/types/CronFieldCollection.d.ts +153 -0
- package/node_modules/cron-parser/dist/types/CronFileParser.d.ts +30 -0
- package/node_modules/cron-parser/dist/types/fields/CronDayOfMonth.d.ts +25 -0
- package/node_modules/cron-parser/dist/types/fields/CronDayOfWeek.d.ts +30 -0
- package/node_modules/cron-parser/dist/types/fields/CronField.d.ts +130 -0
- package/node_modules/cron-parser/dist/types/fields/CronHour.d.ts +23 -0
- package/node_modules/cron-parser/dist/types/fields/CronMinute.d.ts +23 -0
- package/node_modules/cron-parser/dist/types/fields/CronMonth.d.ts +24 -0
- package/node_modules/cron-parser/dist/types/fields/CronSecond.d.ts +23 -0
- package/node_modules/cron-parser/dist/types/fields/index.d.ts +8 -0
- package/node_modules/cron-parser/dist/types/fields/types.d.ts +18 -0
- package/node_modules/cron-parser/dist/types/index.d.ts +8 -0
- package/node_modules/cron-parser/dist/types/utils/random.d.ts +10 -0
- package/node_modules/cron-parser/dist/utils/random.js +38 -0
- package/node_modules/cron-parser/package.json +117 -0
- package/node_modules/luxon/LICENSE.md +7 -0
- package/node_modules/luxon/README.md +55 -0
- package/node_modules/luxon/build/amd/luxon.js +8741 -0
- package/node_modules/luxon/build/amd/luxon.js.map +1 -0
- package/node_modules/luxon/build/cjs-browser/luxon.js +8739 -0
- package/node_modules/luxon/build/cjs-browser/luxon.js.map +1 -0
- package/node_modules/luxon/build/es6/luxon.mjs +8133 -0
- package/node_modules/luxon/build/es6/luxon.mjs.map +1 -0
- package/node_modules/luxon/build/global/luxon.js +8744 -0
- package/node_modules/luxon/build/global/luxon.js.map +1 -0
- package/node_modules/luxon/build/global/luxon.min.js +1 -0
- package/node_modules/luxon/build/global/luxon.min.js.map +1 -0
- package/node_modules/luxon/build/node/luxon.js +7792 -0
- package/node_modules/luxon/build/node/luxon.js.map +1 -0
- package/node_modules/luxon/package.json +87 -0
- package/node_modules/luxon/src/datetime.js +2603 -0
- package/node_modules/luxon/src/duration.js +1009 -0
- package/node_modules/luxon/src/errors.js +61 -0
- package/node_modules/luxon/src/impl/conversions.js +206 -0
- package/node_modules/luxon/src/impl/diff.js +95 -0
- package/node_modules/luxon/src/impl/digits.js +94 -0
- package/node_modules/luxon/src/impl/english.js +233 -0
- package/node_modules/luxon/src/impl/formats.js +176 -0
- package/node_modules/luxon/src/impl/formatter.js +434 -0
- package/node_modules/luxon/src/impl/invalid.js +14 -0
- package/node_modules/luxon/src/impl/locale.js +569 -0
- package/node_modules/luxon/src/impl/regexParser.js +335 -0
- package/node_modules/luxon/src/impl/tokenParser.js +505 -0
- package/node_modules/luxon/src/impl/util.js +330 -0
- package/node_modules/luxon/src/impl/zoneUtil.js +34 -0
- package/node_modules/luxon/src/info.js +205 -0
- package/node_modules/luxon/src/interval.js +669 -0
- package/node_modules/luxon/src/luxon.js +26 -0
- package/node_modules/luxon/src/package.json +4 -0
- package/node_modules/luxon/src/settings.js +180 -0
- package/node_modules/luxon/src/zone.js +97 -0
- package/node_modules/luxon/src/zones/IANAZone.js +235 -0
- package/node_modules/luxon/src/zones/fixedOffsetZone.js +150 -0
- package/node_modules/luxon/src/zones/invalidZone.js +53 -0
- package/node_modules/luxon/src/zones/systemZone.js +61 -0
- package/package.json +33 -24
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CronField, CronFieldOptions } from './CronField';
|
|
2
|
+
import { CronChars, CronMax, CronMin, DayOfWeekRange } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the "day of the week" field within a cron expression.
|
|
5
|
+
* @class CronDayOfTheWeek
|
|
6
|
+
* @extends CronField
|
|
7
|
+
*/
|
|
8
|
+
export declare class CronDayOfWeek extends CronField {
|
|
9
|
+
static get min(): CronMin;
|
|
10
|
+
static get max(): CronMax;
|
|
11
|
+
static get chars(): readonly CronChars[];
|
|
12
|
+
static get validChars(): RegExp;
|
|
13
|
+
/**
|
|
14
|
+
* CronDayOfTheWeek constructor. Initializes the "day of the week" field with the provided values.
|
|
15
|
+
* @param {DayOfWeekRange[]} values - Values for the "day of the week" field
|
|
16
|
+
* @param {CronFieldOptions} [options] - Options provided by the parser
|
|
17
|
+
*/
|
|
18
|
+
constructor(values: DayOfWeekRange[], options?: CronFieldOptions);
|
|
19
|
+
/**
|
|
20
|
+
* Returns an array of allowed values for the "day of the week" field.
|
|
21
|
+
* @returns {DayOfWeekRange[]}
|
|
22
|
+
*/
|
|
23
|
+
get values(): DayOfWeekRange[];
|
|
24
|
+
/**
|
|
25
|
+
* Returns the nth day of the week if specified in the cron expression.
|
|
26
|
+
* This is used for the '#' character in the cron expression.
|
|
27
|
+
* @returns {number} The nth day of the week (1-5) or 0 if not specified.
|
|
28
|
+
*/
|
|
29
|
+
get nthDay(): number;
|
|
30
|
+
}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import { CronChars, CronConstraints, CronFieldType, CronMax, CronMin } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Represents the serialized form of a cron field.
|
|
4
|
+
* @typedef {Object} SerializedCronField
|
|
5
|
+
* @property {boolean} wildcard - Indicates if the field is a wildcard.
|
|
6
|
+
* @property {(number|string)[]} values - The values of the field.
|
|
7
|
+
*/
|
|
8
|
+
export type SerializedCronField = {
|
|
9
|
+
wildcard: boolean;
|
|
10
|
+
values: (number | string)[];
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Represents the options for a cron field.
|
|
14
|
+
* @typedef {Object} CronFieldOptions
|
|
15
|
+
* @property {string} rawValue - The raw value of the field.
|
|
16
|
+
* @property {boolean} [wildcard] - Indicates if the field is a wildcard.
|
|
17
|
+
* @property {number} [nthDayOfWeek] - The nth day of the week.
|
|
18
|
+
*/
|
|
19
|
+
export type CronFieldOptions = {
|
|
20
|
+
rawValue?: string;
|
|
21
|
+
wildcard?: boolean;
|
|
22
|
+
nthDayOfWeek?: number;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Represents a field within a cron expression.
|
|
26
|
+
* This is a base class and should not be instantiated directly.
|
|
27
|
+
* @class CronField
|
|
28
|
+
*/
|
|
29
|
+
export declare abstract class CronField {
|
|
30
|
+
#private;
|
|
31
|
+
protected readonly options: CronFieldOptions & {
|
|
32
|
+
rawValue: string;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Returns the minimum value allowed for this field.
|
|
36
|
+
*/
|
|
37
|
+
static get min(): CronMin;
|
|
38
|
+
/**
|
|
39
|
+
* Returns the maximum value allowed for this field.
|
|
40
|
+
*/
|
|
41
|
+
static get max(): CronMax;
|
|
42
|
+
/**
|
|
43
|
+
* Returns the allowed characters for this field.
|
|
44
|
+
*/
|
|
45
|
+
static get chars(): readonly CronChars[];
|
|
46
|
+
/**
|
|
47
|
+
* Returns the regular expression used to validate this field.
|
|
48
|
+
*/
|
|
49
|
+
static get validChars(): RegExp;
|
|
50
|
+
/**
|
|
51
|
+
* Returns the constraints for this field.
|
|
52
|
+
*/
|
|
53
|
+
static get constraints(): CronConstraints;
|
|
54
|
+
/**
|
|
55
|
+
* CronField constructor. Initializes the field with the provided values.
|
|
56
|
+
* @param {number[] | string[]} values - Values for this field
|
|
57
|
+
* @param {CronFieldOptions} [options] - Options provided by the parser
|
|
58
|
+
* @throws {TypeError} if the constructor is called directly
|
|
59
|
+
* @throws {Error} if validation fails
|
|
60
|
+
*/
|
|
61
|
+
protected constructor(values: (number | string)[], options?: CronFieldOptions);
|
|
62
|
+
/**
|
|
63
|
+
* Returns the minimum value allowed for this field.
|
|
64
|
+
* @returns {number}
|
|
65
|
+
*/
|
|
66
|
+
get min(): number;
|
|
67
|
+
/**
|
|
68
|
+
* Returns the maximum value allowed for this field.
|
|
69
|
+
* @returns {number}
|
|
70
|
+
*/
|
|
71
|
+
get max(): number;
|
|
72
|
+
/**
|
|
73
|
+
* Returns an array of allowed special characters for this field.
|
|
74
|
+
* @returns {string[]}
|
|
75
|
+
*/
|
|
76
|
+
get chars(): readonly string[];
|
|
77
|
+
/**
|
|
78
|
+
* Indicates whether this field has a "last" character.
|
|
79
|
+
* @returns {boolean}
|
|
80
|
+
*/
|
|
81
|
+
get hasLastChar(): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* Indicates whether this field has a "question mark" character.
|
|
84
|
+
* @returns {boolean}
|
|
85
|
+
*/
|
|
86
|
+
get hasQuestionMarkChar(): boolean;
|
|
87
|
+
/**
|
|
88
|
+
* Indicates whether this field is a wildcard.
|
|
89
|
+
* @returns {boolean}
|
|
90
|
+
*/
|
|
91
|
+
get isWildcard(): boolean;
|
|
92
|
+
/**
|
|
93
|
+
* Returns an array of allowed values for this field.
|
|
94
|
+
* @returns {CronFieldType}
|
|
95
|
+
*/
|
|
96
|
+
get values(): CronFieldType;
|
|
97
|
+
/**
|
|
98
|
+
* Helper function to sort values in ascending order.
|
|
99
|
+
* @param {number | string} a - First value to compare
|
|
100
|
+
* @param {number | string} b - Second value to compare
|
|
101
|
+
* @returns {number} - A negative, zero, or positive value, depending on the sort order
|
|
102
|
+
*/
|
|
103
|
+
static sorter(a: number | string, b: number | string): number;
|
|
104
|
+
/**
|
|
105
|
+
* Find the next (or previous when `reverse` is true) numeric value in a sorted list.
|
|
106
|
+
* Returns null if there's no value strictly after/before the current one.
|
|
107
|
+
*
|
|
108
|
+
* @param values - Sorted numeric values
|
|
109
|
+
* @param currentValue - Current value to compare against
|
|
110
|
+
* @param reverse - When true, search in reverse for previous smaller value
|
|
111
|
+
*/
|
|
112
|
+
static findNearestValueInList(values: number[], currentValue: number, reverse?: boolean): number | null;
|
|
113
|
+
/**
|
|
114
|
+
* Instance helper that operates on this field's numeric `values`.
|
|
115
|
+
*
|
|
116
|
+
* @param currentValue - Current value to compare against
|
|
117
|
+
* @param reverse - When true, search in reverse for previous smaller value
|
|
118
|
+
*/
|
|
119
|
+
findNearestValue(currentValue: number, reverse?: boolean): number | null;
|
|
120
|
+
/**
|
|
121
|
+
* Serializes the field to an object.
|
|
122
|
+
* @returns {SerializedCronField}
|
|
123
|
+
*/
|
|
124
|
+
serialize(): SerializedCronField;
|
|
125
|
+
/**
|
|
126
|
+
* Validates the field values against the allowed range and special characters.
|
|
127
|
+
* @throws {Error} if validation fails
|
|
128
|
+
*/
|
|
129
|
+
validate(): void;
|
|
130
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CronField, CronFieldOptions } from './CronField';
|
|
2
|
+
import { CronChars, CronMax, CronMin, HourRange } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the "hour" field within a cron expression.
|
|
5
|
+
* @class CronHour
|
|
6
|
+
* @extends CronField
|
|
7
|
+
*/
|
|
8
|
+
export declare class CronHour extends CronField {
|
|
9
|
+
static get min(): CronMin;
|
|
10
|
+
static get max(): CronMax;
|
|
11
|
+
static get chars(): readonly CronChars[];
|
|
12
|
+
/**
|
|
13
|
+
* CronHour constructor. Initializes the "hour" field with the provided values.
|
|
14
|
+
* @param {HourRange[]} values - Values for the "hour" field
|
|
15
|
+
* @param {CronFieldOptions} [options] - Options provided by the parser
|
|
16
|
+
*/
|
|
17
|
+
constructor(values: HourRange[], options?: CronFieldOptions);
|
|
18
|
+
/**
|
|
19
|
+
* Returns an array of allowed values for the "hour" field.
|
|
20
|
+
* @returns {HourRange[]}
|
|
21
|
+
*/
|
|
22
|
+
get values(): HourRange[];
|
|
23
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CronField, CronFieldOptions } from './CronField';
|
|
2
|
+
import { CronChars, CronMax, CronMin, SixtyRange } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the "second" field within a cron expression.
|
|
5
|
+
* @class CronSecond
|
|
6
|
+
* @extends CronField
|
|
7
|
+
*/
|
|
8
|
+
export declare class CronMinute extends CronField {
|
|
9
|
+
static get min(): CronMin;
|
|
10
|
+
static get max(): CronMax;
|
|
11
|
+
static get chars(): readonly CronChars[];
|
|
12
|
+
/**
|
|
13
|
+
* CronSecond constructor. Initializes the "second" field with the provided values.
|
|
14
|
+
* @param {SixtyRange[]} values - Values for the "second" field
|
|
15
|
+
* @param {CronFieldOptions} [options] - Options provided by the parser
|
|
16
|
+
*/
|
|
17
|
+
constructor(values: SixtyRange[], options?: CronFieldOptions);
|
|
18
|
+
/**
|
|
19
|
+
* Returns an array of allowed values for the "second" field.
|
|
20
|
+
* @returns {SixtyRange[]}
|
|
21
|
+
*/
|
|
22
|
+
get values(): SixtyRange[];
|
|
23
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { CronField, CronFieldOptions } from './CronField';
|
|
2
|
+
import { CronChars, CronMax, CronMin, MonthRange } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the "day of the month" field within a cron expression.
|
|
5
|
+
* @class CronDayOfMonth
|
|
6
|
+
* @extends CronField
|
|
7
|
+
*/
|
|
8
|
+
export declare class CronMonth extends CronField {
|
|
9
|
+
static get min(): CronMin;
|
|
10
|
+
static get max(): CronMax;
|
|
11
|
+
static get chars(): readonly CronChars[];
|
|
12
|
+
static get daysInMonth(): readonly number[];
|
|
13
|
+
/**
|
|
14
|
+
* CronDayOfMonth constructor. Initializes the "day of the month" field with the provided values.
|
|
15
|
+
* @param {MonthRange[]} values - Values for the "day of the month" field
|
|
16
|
+
* @param {CronFieldOptions} [options] - Options provided by the parser
|
|
17
|
+
*/
|
|
18
|
+
constructor(values: MonthRange[], options?: CronFieldOptions);
|
|
19
|
+
/**
|
|
20
|
+
* Returns an array of allowed values for the "day of the month" field.
|
|
21
|
+
* @returns {MonthRange[]}
|
|
22
|
+
*/
|
|
23
|
+
get values(): MonthRange[];
|
|
24
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { CronChars, CronMax, CronMin, SixtyRange } from './types';
|
|
2
|
+
import { CronField, CronFieldOptions } from './CronField';
|
|
3
|
+
/**
|
|
4
|
+
* Represents the "second" field within a cron expression.
|
|
5
|
+
* @class CronSecond
|
|
6
|
+
* @extends CronField
|
|
7
|
+
*/
|
|
8
|
+
export declare class CronSecond extends CronField {
|
|
9
|
+
static get min(): CronMin;
|
|
10
|
+
static get max(): CronMax;
|
|
11
|
+
static get chars(): readonly CronChars[];
|
|
12
|
+
/**
|
|
13
|
+
* CronSecond constructor. Initializes the "second" field with the provided values.
|
|
14
|
+
* @param {SixtyRange[]} values - Values for the "second" field
|
|
15
|
+
* @param {CronFieldOptions} [options] - Options provided by the parser
|
|
16
|
+
*/
|
|
17
|
+
constructor(values: SixtyRange[], options?: CronFieldOptions);
|
|
18
|
+
/**
|
|
19
|
+
* Returns an array of allowed values for the "second" field.
|
|
20
|
+
* @returns {SixtyRange[]}
|
|
21
|
+
*/
|
|
22
|
+
get values(): SixtyRange[];
|
|
23
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export type RangeFrom<LENGTH extends number, ACC extends unknown[] = []> = ACC['length'] extends LENGTH ? ACC : RangeFrom<LENGTH, [...ACC, 1]>;
|
|
2
|
+
export type IntRange<FROM extends number[], TO extends number, ACC extends number = never> = FROM['length'] extends TO ? ACC | TO : IntRange<[...FROM, 1], TO, ACC | FROM['length']>;
|
|
3
|
+
export type SixtyRange = IntRange<RangeFrom<0>, 59>;
|
|
4
|
+
export type HourRange = IntRange<RangeFrom<0>, 23>;
|
|
5
|
+
export type DayOfMonthRange = IntRange<RangeFrom<1>, 31> | 'L';
|
|
6
|
+
export type MonthRange = IntRange<RangeFrom<1>, 12>;
|
|
7
|
+
export type DayOfWeekRange = IntRange<RangeFrom<0>, 7> | 'L';
|
|
8
|
+
export type CronFieldType = SixtyRange[] | HourRange[] | DayOfMonthRange[] | MonthRange[] | DayOfWeekRange[];
|
|
9
|
+
export type CronChars = 'L' | 'W';
|
|
10
|
+
export type CronMin = 0 | 1;
|
|
11
|
+
export type CronMax = 7 | 12 | 23 | 31 | 59;
|
|
12
|
+
export type ParseRangeResponse = number[] | string[] | number | string;
|
|
13
|
+
export type CronConstraints = {
|
|
14
|
+
min: CronMin;
|
|
15
|
+
max: CronMax;
|
|
16
|
+
chars: readonly CronChars[];
|
|
17
|
+
validChars: RegExp;
|
|
18
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { CronExpressionParser } from './CronExpressionParser';
|
|
2
|
+
export { CronDate } from './CronDate';
|
|
3
|
+
export { CronFieldCollection } from './CronFieldCollection';
|
|
4
|
+
export { CronExpression, CronExpressionOptions } from './CronExpression';
|
|
5
|
+
export { CronExpressionParser } from './CronExpressionParser';
|
|
6
|
+
export { CronFileParser, CronFileParserResult } from './CronFileParser';
|
|
7
|
+
export * from './fields';
|
|
8
|
+
export default CronExpressionParser;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A type representing a Pseudorandom Number Generator, similar to Math.random()
|
|
3
|
+
*/
|
|
4
|
+
export type PRNG = () => number;
|
|
5
|
+
/**
|
|
6
|
+
* Generates a PRNG using a given seed. When not provided, the seed is randomly generated
|
|
7
|
+
* @param {string} str A string to derive the seed from
|
|
8
|
+
* @returns {PRNG} A random number generator correctly seeded
|
|
9
|
+
*/
|
|
10
|
+
export declare function seededRandom(str?: string): PRNG;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.seededRandom = seededRandom;
|
|
4
|
+
/**
|
|
5
|
+
* Computes a numeric hash from a given string
|
|
6
|
+
* @param {string} str A value to hash
|
|
7
|
+
* @returns {number} A numeric hash computed from the given value
|
|
8
|
+
*/
|
|
9
|
+
function xfnv1a(str) {
|
|
10
|
+
let h = 2166136261 >>> 0;
|
|
11
|
+
for (let i = 0; i < str.length; i++) {
|
|
12
|
+
h ^= str.charCodeAt(i);
|
|
13
|
+
h = Math.imul(h, 16777619);
|
|
14
|
+
}
|
|
15
|
+
return () => h >>> 0;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Initialize a new PRNG using a given seed
|
|
19
|
+
* @param {number} seed The seed used to initialize the PRNG
|
|
20
|
+
* @returns {PRNG} A random number generator
|
|
21
|
+
*/
|
|
22
|
+
function mulberry32(seed) {
|
|
23
|
+
return () => {
|
|
24
|
+
let t = (seed += 0x6d2b79f5);
|
|
25
|
+
t = Math.imul(t ^ (t >>> 15), t | 1);
|
|
26
|
+
t ^= t + Math.imul(t ^ (t >>> 7), t | 61);
|
|
27
|
+
return ((t ^ (t >>> 14)) >>> 0) / 4294967296;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Generates a PRNG using a given seed. When not provided, the seed is randomly generated
|
|
32
|
+
* @param {string} str A string to derive the seed from
|
|
33
|
+
* @returns {PRNG} A random number generator correctly seeded
|
|
34
|
+
*/
|
|
35
|
+
function seededRandom(str) {
|
|
36
|
+
const seed = str ? xfnv1a(str)() : Math.floor(Math.random() * 10_000_000_000);
|
|
37
|
+
return mulberry32(seed);
|
|
38
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "cron-parser",
|
|
3
|
+
"version": "5.5.0",
|
|
4
|
+
"description": "Node.js library for parsing crontab instructions",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/types/index.d.ts",
|
|
7
|
+
"type": "commonjs",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"clean": "rimraf dist",
|
|
10
|
+
"bench": "cross-env node -r ts-node/register benchmarks/index.ts",
|
|
11
|
+
"bench:pattern": "cross-env node -r ts-node/register benchmarks/pattern.ts",
|
|
12
|
+
"bench:clean": "rimraf benchmarks/versions && rimraf benchmarks/results",
|
|
13
|
+
"build": "npm run clean && tsc -p tsconfig.json",
|
|
14
|
+
"prepublishOnly": "npm run build",
|
|
15
|
+
"prepare": "husky && npm run build",
|
|
16
|
+
"precommit": "lint-staged",
|
|
17
|
+
"lint": "eslint .",
|
|
18
|
+
"lint:fix": "eslint --fix .",
|
|
19
|
+
"lint:debug": "cross-env DEBUG=eslint:cli-engine eslint .",
|
|
20
|
+
"format": "prettier --write \"**/*.{ts,js,json,md}\"",
|
|
21
|
+
"format:check": "prettier --check \"**/*.{ts,js,json,md}\"",
|
|
22
|
+
"test:unit": "cross-env TZ=UTC jest",
|
|
23
|
+
"test:coverage": "cross-env TZ=UTC jest --coverage",
|
|
24
|
+
"generate-badges": "jest-coverage-badges",
|
|
25
|
+
"test:types": "npm run build && tsd",
|
|
26
|
+
"test": "cross-env TZ=UTC npm run lint && npm run test:types && npm run test:coverage && npm run generate-badges",
|
|
27
|
+
"docs": "rimraf docs && typedoc --out docs --readme none --name 'CronParser' src"
|
|
28
|
+
},
|
|
29
|
+
"files": [
|
|
30
|
+
"dist",
|
|
31
|
+
"LICENSE",
|
|
32
|
+
"README.md"
|
|
33
|
+
],
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"luxon": "^3.7.1"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@tsd/typescript": "^5.8.2",
|
|
39
|
+
"@types/jest": "^29.5.14",
|
|
40
|
+
"@types/luxon": "^3.6.2",
|
|
41
|
+
"@types/node": "^22.14.0",
|
|
42
|
+
"@typescript-eslint/eslint-plugin": "^8.29.0",
|
|
43
|
+
"@typescript-eslint/parser": "^8.29.0",
|
|
44
|
+
"chalk": "^5.4.1",
|
|
45
|
+
"cli-table3": "^0.6.5",
|
|
46
|
+
"cross-env": "^7.0.3",
|
|
47
|
+
"eslint": "^9.23.0",
|
|
48
|
+
"eslint-config-prettier": "^10.1.1",
|
|
49
|
+
"eslint-plugin-prettier": "^5.2.6",
|
|
50
|
+
"husky": "^9.1.7",
|
|
51
|
+
"jest": "^29.7.0",
|
|
52
|
+
"jest-coverage-badges": "^1.0.0",
|
|
53
|
+
"lint-staged": "^15.5.0",
|
|
54
|
+
"prettier": "^3.5.3",
|
|
55
|
+
"rimraf": "^6.0.1",
|
|
56
|
+
"sinon": "^20.0.0",
|
|
57
|
+
"ts-jest": "^29.3.1",
|
|
58
|
+
"ts-node": "^10.9.2",
|
|
59
|
+
"tsd": "^0.31.2",
|
|
60
|
+
"typedoc": "^0.28.1",
|
|
61
|
+
"typescript": "^5.8.2"
|
|
62
|
+
},
|
|
63
|
+
"husky": {
|
|
64
|
+
"hooks": {
|
|
65
|
+
"pre-commit": "lint-staged"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"lint-staged": {
|
|
69
|
+
"*.{ts,js,json}": [
|
|
70
|
+
"prettier --write"
|
|
71
|
+
]
|
|
72
|
+
},
|
|
73
|
+
"engines": {
|
|
74
|
+
"node": ">=18"
|
|
75
|
+
},
|
|
76
|
+
"browser": {
|
|
77
|
+
"fs": false,
|
|
78
|
+
"fs/promises": false
|
|
79
|
+
},
|
|
80
|
+
"tsd": {
|
|
81
|
+
"directory": "tests"
|
|
82
|
+
},
|
|
83
|
+
"repository": {
|
|
84
|
+
"type": "git",
|
|
85
|
+
"url": "https://github.com/harrisiirak/cron-parser.git"
|
|
86
|
+
},
|
|
87
|
+
"keywords": [
|
|
88
|
+
"cron",
|
|
89
|
+
"crontab",
|
|
90
|
+
"parser"
|
|
91
|
+
],
|
|
92
|
+
"author": "Harri Siirak",
|
|
93
|
+
"contributors": [
|
|
94
|
+
"Nicholas Clawson",
|
|
95
|
+
"Daniel Prentis <daniel@salsitasoft.com>",
|
|
96
|
+
"Renault John Lecoultre",
|
|
97
|
+
"Richard Astbury <richard.astbury@gmail.com>",
|
|
98
|
+
"Meaglin Wasabi <Meaglin.wasabi@gmail.com>",
|
|
99
|
+
"Mike Kusold <hello@mikekusold.com>",
|
|
100
|
+
"Alex Kit <alex.kit@atmajs.com>",
|
|
101
|
+
"Santiago Gimeno <santiago.gimeno@gmail.com>",
|
|
102
|
+
"Daniel <darc.tec@gmail.com>",
|
|
103
|
+
"Christian Steininger <christian.steininger.cs@gmail.com>",
|
|
104
|
+
"Mykola Piskovyi <m.piskovyi@gmail.com>",
|
|
105
|
+
"Brian Vaughn <brian.david.vaughn@gmail.com>",
|
|
106
|
+
"Nicholas Clawson <nickclaw@gmail.com>",
|
|
107
|
+
"Yasuhiroki <yasuhiroki.duck@gmail.com>",
|
|
108
|
+
"Nicholas Clawson <nickclaw@gmail.com>",
|
|
109
|
+
"Brendan Warkentin <faazshift@gmail.com>",
|
|
110
|
+
"Charlie Fish <fishcharlie.code@gmail.com>",
|
|
111
|
+
"Ian Graves <ian+diskimage@iangrav.es>",
|
|
112
|
+
"Andy Thompson <me@andytson.com>",
|
|
113
|
+
"Regev Brody <regevbr@gmail.com>",
|
|
114
|
+
"Michael Hobbs <michael.lee.hobbs@gmail.com>"
|
|
115
|
+
],
|
|
116
|
+
"license": "MIT"
|
|
117
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2019 JS Foundation and other contributors
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Luxon
|
|
2
|
+
|
|
3
|
+
[![MIT License][license-image]][license] [![Build Status][github-action-image]][github-action-url] [![NPM version][npm-version-image]][npm-url] [![Coverage Status][test-coverage-image]][test-coverage-url] [![PRs welcome][contributing-image]][contributing-url]
|
|
4
|
+
|
|
5
|
+
Luxon is a library for working with dates and times in JavaScript.
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
DateTime.now().setZone("America/New_York").minus({ weeks: 1 }).endOf("day").toISO();
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Upgrading to 3.0
|
|
12
|
+
|
|
13
|
+
[Guide](https://moment.github.io/luxon/#upgrading)
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
* DateTime, Duration, and Interval types.
|
|
17
|
+
* Immutable, chainable, unambiguous API.
|
|
18
|
+
* Parsing and formatting for common and custom formats.
|
|
19
|
+
* Native time zone and Intl support (no locale or tz files).
|
|
20
|
+
|
|
21
|
+
## Download/install
|
|
22
|
+
|
|
23
|
+
[Download/install instructions](https://moment.github.io/luxon/#/install)
|
|
24
|
+
|
|
25
|
+
## Documentation
|
|
26
|
+
|
|
27
|
+
* [General documentation](https://moment.github.io/luxon/#/?id=luxon)
|
|
28
|
+
* [API docs](https://moment.github.io/luxon/api-docs/index.html)
|
|
29
|
+
* [Quick tour](https://moment.github.io/luxon/#/tour)
|
|
30
|
+
* [For Moment users](https://moment.github.io/luxon/#/moment)
|
|
31
|
+
* [Why does Luxon exist?](https://moment.github.io/luxon/#/why)
|
|
32
|
+
* [A quick demo](https://moment.github.io/luxon/demo/global.html)
|
|
33
|
+
|
|
34
|
+
## Development
|
|
35
|
+
|
|
36
|
+
See [contributing](CONTRIBUTING.md).
|
|
37
|
+
|
|
38
|
+
![Phasers to stun][phasers-image]
|
|
39
|
+
|
|
40
|
+
[license-image]: https://img.shields.io/badge/license-MIT-blue.svg
|
|
41
|
+
[license]: LICENSE.md
|
|
42
|
+
|
|
43
|
+
[github-action-image]: https://github.com/moment/luxon/actions/workflows/test.yml/badge.svg
|
|
44
|
+
[github-action-url]: https://github.com/moment/luxon/actions/workflows/test.yml
|
|
45
|
+
|
|
46
|
+
[npm-url]: https://npmjs.org/package/luxon
|
|
47
|
+
[npm-version-image]: https://badge.fury.io/js/luxon.svg
|
|
48
|
+
|
|
49
|
+
[test-coverage-url]: https://codecov.io/gh/moment/luxon
|
|
50
|
+
[test-coverage-image]: https://codecov.io/gh/moment/luxon/branch/master/graph/badge.svg
|
|
51
|
+
|
|
52
|
+
[contributing-url]: https://github.com/moment/luxon/blob/master/CONTRIBUTING.md
|
|
53
|
+
[contributing-image]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
|
|
54
|
+
|
|
55
|
+
[phasers-image]: https://img.shields.io/badge/phasers-stun-brightgreen.svg
|