rrule-ts 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +50 -0
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +52 -0
- package/dist/index.js.map +1 -0
- package/dist/locales/de.d.ts +10 -0
- package/dist/locales/de.d.ts.map +1 -0
- package/dist/locales/de.js +38 -0
- package/dist/locales/de.js.map +1 -0
- package/dist/locales/en.d.ts +32 -0
- package/dist/locales/en.d.ts.map +1 -0
- package/dist/locales/en.js +38 -0
- package/dist/locales/en.js.map +1 -0
- package/dist/parse.d.ts +18 -0
- package/dist/parse.d.ts.map +1 -0
- package/dist/parse.js +316 -0
- package/dist/parse.js.map +1 -0
- package/dist/result.d.ts +14 -0
- package/dist/result.d.ts.map +1 -0
- package/dist/result.js +11 -0
- package/dist/result.js.map +1 -0
- package/dist/stringify.d.ts +14 -0
- package/dist/stringify.d.ts.map +1 -0
- package/dist/stringify.js +150 -0
- package/dist/stringify.js.map +1 -0
- package/dist/temporal.d.ts +22 -0
- package/dist/temporal.d.ts.map +1 -0
- package/dist/temporal.js +45 -0
- package/dist/temporal.js.map +1 -0
- package/dist/text/index.d.ts +24 -0
- package/dist/text/index.d.ts.map +1 -0
- package/dist/text/index.js +28 -0
- package/dist/text/index.js.map +1 -0
- package/dist/types.d.ts +83 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +8 -0
- package/dist/types.js.map +1 -0
- package/dist/validate.d.ts +22 -0
- package/dist/validate.d.ts.map +1 -0
- package/dist/validate.js +259 -0
- package/dist/validate.js.map +1 -0
- package/package.json +80 -0
package/dist/validate.js
ADDED
|
@@ -0,0 +1,259 @@
|
|
|
1
|
+
// RFC 5545 RRULE cross-field validator.
|
|
2
|
+
//
|
|
3
|
+
// Returns all validation errors in a single pass. Never throws on user input:
|
|
4
|
+
// every validation rule is defensive against null/undefined inputs.
|
|
5
|
+
import { err, ok } from './result.js';
|
|
6
|
+
// ---------------------------------------------------------------------------
|
|
7
|
+
// Internal helpers
|
|
8
|
+
// ---------------------------------------------------------------------------
|
|
9
|
+
/** Categorise a DTSTART/UNTIL value for mutual-type checking (duck-typed). */
|
|
10
|
+
function valueKind(v) {
|
|
11
|
+
if (typeof v !== 'object' || v === null)
|
|
12
|
+
return 'unknown';
|
|
13
|
+
if ('timeZoneId' in v)
|
|
14
|
+
return 'zonedDateTime';
|
|
15
|
+
if ('epochMilliseconds' in v && !('year' in v))
|
|
16
|
+
return 'instant';
|
|
17
|
+
if ('year' in v && 'hour' in v)
|
|
18
|
+
return 'plainDateTime';
|
|
19
|
+
if ('year' in v)
|
|
20
|
+
return 'plainDate';
|
|
21
|
+
// v8 ignore next
|
|
22
|
+
return 'unknown';
|
|
23
|
+
}
|
|
24
|
+
// ---------------------------------------------------------------------------
|
|
25
|
+
// Individual validation rules
|
|
26
|
+
// ---------------------------------------------------------------------------
|
|
27
|
+
function checkCountXnorUntil(o, errors) {
|
|
28
|
+
if (o.count !== undefined && o.until !== undefined) {
|
|
29
|
+
errors.push({
|
|
30
|
+
field: 'COUNT',
|
|
31
|
+
ruleId: 'COUNT_XNOR_UNTIL',
|
|
32
|
+
message: 'COUNT and UNTIL are mutually exclusive; provide at most one.',
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function checkInterval(o, errors) {
|
|
37
|
+
if (o.interval !== undefined && o.interval < 1) {
|
|
38
|
+
errors.push({
|
|
39
|
+
field: 'INTERVAL',
|
|
40
|
+
ruleId: 'INTERVAL_MIN_1',
|
|
41
|
+
message: `INTERVAL must be >= 1, got ${o.interval}.`,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
function checkCount(o, errors) {
|
|
46
|
+
if (o.count !== undefined && o.count < 1) {
|
|
47
|
+
errors.push({
|
|
48
|
+
field: 'COUNT',
|
|
49
|
+
ruleId: 'COUNT_MIN_1',
|
|
50
|
+
message: `COUNT must be >= 1, got ${o.count}.`,
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* RFC 5545 §3.3.10: UNTIL value type must match DTSTART.
|
|
56
|
+
* - If DTSTART is a DATE, UNTIL must also be a DATE.
|
|
57
|
+
* - If DTSTART is a DATE-TIME specified in UTC, UNTIL must be UTC (Instant).
|
|
58
|
+
* - If DTSTART is a floating DATE-TIME, UNTIL must also be floating.
|
|
59
|
+
* - If DTSTART uses TZID, UNTIL must be specified in UTC.
|
|
60
|
+
*/
|
|
61
|
+
function checkUntilDtstartCompatibility(o, errors) {
|
|
62
|
+
if (o.until === undefined || o.dtstart === undefined)
|
|
63
|
+
return;
|
|
64
|
+
const dKind = valueKind(o.dtstart);
|
|
65
|
+
const uKind = valueKind(o.until);
|
|
66
|
+
if (dKind === 'plainDate' && uKind !== 'plainDate') {
|
|
67
|
+
errors.push({
|
|
68
|
+
field: 'UNTIL',
|
|
69
|
+
ruleId: 'UNTIL_TYPE_MATCH_DTSTART',
|
|
70
|
+
message: 'When DTSTART is a DATE value, UNTIL must also be a DATE (not a DATE-TIME).',
|
|
71
|
+
});
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
if (dKind === 'instant' && uKind !== 'instant') {
|
|
75
|
+
errors.push({
|
|
76
|
+
field: 'UNTIL',
|
|
77
|
+
ruleId: 'UNTIL_TYPE_MATCH_DTSTART',
|
|
78
|
+
message: 'When DTSTART is a UTC DATE-TIME (ends in Z), UNTIL must also be UTC.',
|
|
79
|
+
});
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
if (dKind === 'zonedDateTime' && uKind !== 'instant') {
|
|
83
|
+
errors.push({
|
|
84
|
+
field: 'UNTIL',
|
|
85
|
+
ruleId: 'UNTIL_TYPE_MATCH_DTSTART',
|
|
86
|
+
message: 'When DTSTART uses TZID, UNTIL must be specified as a UTC DATE-TIME (ends in Z).',
|
|
87
|
+
});
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
if (dKind === 'plainDateTime' && uKind !== 'plainDateTime') {
|
|
91
|
+
errors.push({
|
|
92
|
+
field: 'UNTIL',
|
|
93
|
+
ruleId: 'UNTIL_TYPE_MATCH_DTSTART',
|
|
94
|
+
message: 'When DTSTART is a floating DATE-TIME, UNTIL must also be a floating DATE-TIME.',
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* RFC 5545 §3.3.10: BYDAY ordinals (e.g. "2MO", "-1FR") are only permitted
|
|
100
|
+
* with MONTHLY or YEARLY frequency. They must not appear together with BYWEEKNO.
|
|
101
|
+
*/
|
|
102
|
+
function checkBydayOrdinals(o, errors) {
|
|
103
|
+
if (o.byDay === undefined)
|
|
104
|
+
return;
|
|
105
|
+
const hasOrdinals = o.byDay.some((d) => d.ordinal !== undefined);
|
|
106
|
+
if (!hasOrdinals)
|
|
107
|
+
return;
|
|
108
|
+
if (o.freq !== 'MONTHLY' && o.freq !== 'YEARLY') {
|
|
109
|
+
errors.push({
|
|
110
|
+
field: 'BYDAY',
|
|
111
|
+
ruleId: 'BYDAY_ORDINAL_FREQ',
|
|
112
|
+
message: `BYDAY ordinals (e.g. 2MO, -1FR) are only allowed with MONTHLY or YEARLY frequency, ` +
|
|
113
|
+
`got FREQ=${o.freq}.`,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
if (o.byWeekNo !== undefined) {
|
|
117
|
+
errors.push({
|
|
118
|
+
field: 'BYDAY',
|
|
119
|
+
ruleId: 'BYDAY_ORDINAL_NO_BYWEEKNO',
|
|
120
|
+
message: 'BYDAY ordinals must not be combined with BYWEEKNO.',
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* RFC 5545 §3.3.10: BYWEEKNO MUST only be used with FREQ=YEARLY.
|
|
126
|
+
* "The BYWEEKNO rule part MUST NOT be specified when the FREQ rule part is
|
|
127
|
+
* set to anything other than YEARLY."
|
|
128
|
+
*/
|
|
129
|
+
function checkByWeekNoFreq(o, errors) {
|
|
130
|
+
if (o.byWeekNo !== undefined && o.freq !== 'YEARLY') {
|
|
131
|
+
errors.push({
|
|
132
|
+
field: 'BYWEEKNO',
|
|
133
|
+
ruleId: 'BYWEEKNO_YEARLY_ONLY',
|
|
134
|
+
message: `BYWEEKNO is only valid with FREQ=YEARLY; got FREQ=${o.freq}.`,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* RFC 5545 §3.3.10: BYYEARDAY MUST NOT be used with DAILY, WEEKLY, or MONTHLY.
|
|
140
|
+
* "The BYYEARDAY rule part MUST NOT be used with a DAILY, WEEKLY, or MONTHLY
|
|
141
|
+
* rule."
|
|
142
|
+
*/
|
|
143
|
+
function checkByYearDayFreq(o, errors) {
|
|
144
|
+
if (o.byYearDay !== undefined &&
|
|
145
|
+
(o.freq === 'DAILY' || o.freq === 'WEEKLY' || o.freq === 'MONTHLY')) {
|
|
146
|
+
errors.push({
|
|
147
|
+
field: 'BYYEARDAY',
|
|
148
|
+
ruleId: 'BYYEARDAY_FREQ_RESTRICTION',
|
|
149
|
+
message: `BYYEARDAY must not be used with FREQ=${o.freq} (only SECONDLY, MINUTELY, HOURLY, YEARLY are allowed).`,
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* RFC 5545 §3.3.10: BYMONTHDAY MUST NOT be used with FREQ=WEEKLY.
|
|
155
|
+
* "The BYMONTHDAY rule part MUST NOT be specified when the FREQ rule part is
|
|
156
|
+
* set to WEEKLY."
|
|
157
|
+
*/
|
|
158
|
+
function checkByMonthDayFreq(o, errors) {
|
|
159
|
+
if (o.byMonthDay !== undefined && o.freq === 'WEEKLY') {
|
|
160
|
+
errors.push({
|
|
161
|
+
field: 'BYMONTHDAY',
|
|
162
|
+
ruleId: 'BYMONTHDAY_NO_WEEKLY',
|
|
163
|
+
message: 'BYMONTHDAY must not be used with FREQ=WEEKLY.',
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* RFC 5545 §3.3.10: BYSETPOS MUST only be used in conjunction with another
|
|
169
|
+
* BYxxx rule part.
|
|
170
|
+
* "The BYSETPOS rule part MUST only be used in conjunction with another BYxxx
|
|
171
|
+
* rule part."
|
|
172
|
+
*/
|
|
173
|
+
function checkBySetPosRequiresByRule(o, errors) {
|
|
174
|
+
if (o.bySetPos === undefined)
|
|
175
|
+
return;
|
|
176
|
+
const hasOtherByRule = o.bySecond !== undefined ||
|
|
177
|
+
o.byMinute !== undefined ||
|
|
178
|
+
o.byHour !== undefined ||
|
|
179
|
+
o.byDay !== undefined ||
|
|
180
|
+
o.byMonthDay !== undefined ||
|
|
181
|
+
o.byYearDay !== undefined ||
|
|
182
|
+
o.byWeekNo !== undefined ||
|
|
183
|
+
o.byMonth !== undefined;
|
|
184
|
+
if (!hasOtherByRule) {
|
|
185
|
+
errors.push({
|
|
186
|
+
field: 'BYSETPOS',
|
|
187
|
+
ruleId: 'BYSETPOS_REQUIRES_BYRULE',
|
|
188
|
+
message: 'BYSETPOS must only be used in conjunction with another BYxxx rule part.',
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
/** Validate BY* integer list ranges. */
|
|
193
|
+
function checkByListRanges(o, errors) {
|
|
194
|
+
const rangeCheck = (list, field, ruleId, min, max, allowNeg) => {
|
|
195
|
+
if (list === undefined)
|
|
196
|
+
return;
|
|
197
|
+
for (const v of list) {
|
|
198
|
+
const lo = allowNeg ? -max : min;
|
|
199
|
+
const hi = max;
|
|
200
|
+
if (v === 0 && min !== 0) {
|
|
201
|
+
errors.push({ field, ruleId, message: `${field} value must not be 0.` });
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
if (v < lo || v > hi) {
|
|
205
|
+
errors.push({
|
|
206
|
+
field,
|
|
207
|
+
ruleId,
|
|
208
|
+
message: `${field} value ${v} is out of range [${lo}, ${hi}].`,
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
};
|
|
213
|
+
rangeCheck(o.byMonth, 'BYMONTH', 'BYMONTH_RANGE', 1, 12, false);
|
|
214
|
+
rangeCheck(o.byMonthDay, 'BYMONTHDAY', 'BYMONTHDAY_RANGE', 1, 31, true);
|
|
215
|
+
rangeCheck(o.byYearDay, 'BYYEARDAY', 'BYYEARDAY_RANGE', 1, 366, true);
|
|
216
|
+
rangeCheck(o.byWeekNo, 'BYWEEKNO', 'BYWEEKNO_RANGE', 1, 53, true);
|
|
217
|
+
rangeCheck(o.byHour, 'BYHOUR', 'BYHOUR_RANGE', 0, 23, false);
|
|
218
|
+
rangeCheck(o.byMinute, 'BYMINUTE', 'BYMINUTE_RANGE', 0, 59, false);
|
|
219
|
+
rangeCheck(o.bySecond, 'BYSECOND', 'BYSECOND_RANGE', 0, 60, false);
|
|
220
|
+
rangeCheck(o.bySetPos, 'BYSETPOS', 'BYSETPOS_RANGE', 1, 366, true);
|
|
221
|
+
}
|
|
222
|
+
// ---------------------------------------------------------------------------
|
|
223
|
+
// Exported validator
|
|
224
|
+
// ---------------------------------------------------------------------------
|
|
225
|
+
/**
|
|
226
|
+
* Validate cross-field RFC 5545 constraints on parsed `RRuleOptions`.
|
|
227
|
+
*
|
|
228
|
+
* Returns all errors found in a single pass; the caller sees the complete
|
|
229
|
+
* picture, not just the first problem. Never throws on user input.
|
|
230
|
+
*
|
|
231
|
+
* Rules checked:
|
|
232
|
+
* - COUNT and UNTIL are mutually exclusive
|
|
233
|
+
* - INTERVAL >= 1
|
|
234
|
+
* - COUNT >= 1
|
|
235
|
+
* - UNTIL value type matches DTSTART value type (RFC 5545 §3.3.10)
|
|
236
|
+
* - BYDAY ordinals only allowed for MONTHLY/YEARLY, not with BYWEEKNO
|
|
237
|
+
* - BYWEEKNO only valid with FREQ=YEARLY (RFC 5545 §3.3.10 Table 1)
|
|
238
|
+
* - BYYEARDAY not valid with DAILY, WEEKLY, MONTHLY (RFC 5545 §3.3.10 Table 1)
|
|
239
|
+
* - BYMONTHDAY not valid with FREQ=WEEKLY (RFC 5545 §3.3.10 Table 1)
|
|
240
|
+
* - BYSETPOS requires at least one other BYxxx rule (RFC 5545 §3.3.10)
|
|
241
|
+
* - BY* value ranges (BYMONTH 1-12, BYMONTHDAY ±1-31, BYHOUR 0-23, etc.)
|
|
242
|
+
*/
|
|
243
|
+
export function validate(options) {
|
|
244
|
+
const errors = [];
|
|
245
|
+
checkCountXnorUntil(options, errors);
|
|
246
|
+
checkInterval(options, errors);
|
|
247
|
+
checkCount(options, errors);
|
|
248
|
+
checkUntilDtstartCompatibility(options, errors);
|
|
249
|
+
checkBydayOrdinals(options, errors);
|
|
250
|
+
checkByWeekNoFreq(options, errors);
|
|
251
|
+
checkByYearDayFreq(options, errors);
|
|
252
|
+
checkByMonthDayFreq(options, errors);
|
|
253
|
+
checkBySetPosRequiresByRule(options, errors);
|
|
254
|
+
checkByListRanges(options, errors);
|
|
255
|
+
if (errors.length > 0)
|
|
256
|
+
return err(errors);
|
|
257
|
+
return ok(options);
|
|
258
|
+
}
|
|
259
|
+
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AAAA,wCAAwC;AACxC,EAAE;AACF,8EAA8E;AAC9E,oEAAoE;AAGpE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,aAAa,CAAA;AAGrC,8EAA8E;AAC9E,mBAAmB;AACnB,8EAA8E;AAE9E,8EAA8E;AAC9E,SAAS,SAAS,CAChB,CAAU;IAEV,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,IAAI;QAAE,OAAO,SAAS,CAAA;IACzD,IAAI,YAAY,IAAI,CAAC;QAAE,OA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
"version": "0.1.0",
|
|
4
|
+
"description": "RFC 5545 RRULE parser, validator, stringifier, and expander. Temporal-native, zero runtime dependencies.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./text": {
|
|
14
|
+
"types": "./dist/text/index.d.ts",
|
|
15
|
+
"import": "./dist/text/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./locales/en": {
|
|
18
|
+
"types": "./dist/locales/en.d.ts",
|
|
19
|
+
"import": "./dist/locales/en.js"
|
|
20
|
+
},
|
|
21
|
+
"./locales/de": {
|
|
22
|
+
"types": "./dist/locales/de.d.ts",
|
|
23
|
+
"import": "./dist/locales/de.js"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
"sideEffects": false,
|
|
27
|
+
"files": [
|
|
28
|
+
"dist",
|
|
29
|
+
"LICENSE",
|
|
30
|
+
"README.md"
|
|
31
|
+
],
|
|
32
|
+
"keywords": [
|
|
33
|
+
"rrule",
|
|
34
|
+
"recurrence",
|
|
35
|
+
"rfc5545",
|
|
36
|
+
"rfc-5545",
|
|
37
|
+
"ical",
|
|
38
|
+
"icalendar",
|
|
39
|
+
"calendar",
|
|
40
|
+
"temporal",
|
|
41
|
+
"recurring",
|
|
42
|
+
"schedule",
|
|
43
|
+
"dtstart",
|
|
44
|
+
"byday"
|
|
45
|
+
],
|
|
46
|
+
"funding": "https://github.com/sponsors/codewithagents",
|
|
47
|
+
"license": "MIT",
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "https://github.com/codewithagents/rrule"
|
|
51
|
+
},
|
|
52
|
+
"homepage": "https://github.com/codewithagents/rrule#readme",
|
|
53
|
+
"bugs": {
|
|
54
|
+
"url": "https://github.com/codewithagents/rrule/issues"
|
|
55
|
+
},
|
|
56
|
+
"author": "CodeWithAgents (https://codewithagents.de)",
|
|
57
|
+
"publishConfig": {
|
|
58
|
+
"access": "public"
|
|
59
|
+
},
|
|
60
|
+
"engines": {
|
|
61
|
+
"node": ">=22"
|
|
62
|
+
},
|
|
63
|
+
"devDependencies": {
|
|
64
|
+
"@stryker-mutator/core": "^9.6.1",
|
|
65
|
+
"@stryker-mutator/vitest-runner": "^9.6.1",
|
|
66
|
+
"@types/node": "^26.0.0",
|
|
67
|
+
"@vitest/coverage-v8": "^4.1.9",
|
|
68
|
+
"fast-check": "^4.8.0",
|
|
69
|
+
"temporal-polyfill": "^1.0.1",
|
|
70
|
+
"typescript": "^6.0.3",
|
|
71
|
+
"vitest": "^4.1.9"
|
|
72
|
+
},
|
|
73
|
+
"scripts": {
|
|
74
|
+
"build": "tsc -p tsconfig.build.json",
|
|
75
|
+
"test": "vitest run",
|
|
76
|
+
"test:coverage": "vitest run --coverage",
|
|
77
|
+
"test:mutation": "stryker run",
|
|
78
|
+
"lint": "tsc --noEmit"
|
|
79
|
+
}
|
|
80
|
+
}
|