@epam/ai-dial-scheduled-tasks 1.4.0-dev.8 → 1.4.0-dev.81
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/calendar-value-CXFwy6E8.js +84 -0
- package/components/ScheduledTaskCreateForm/ScheduledTaskCreateForm.d.ts.map +1 -1
- package/components/ScheduledTaskRunAtField/ScheduledTaskRunAtField.d.ts +2 -0
- package/components/ScheduledTaskRunAtField/ScheduledTaskRunAtField.d.ts.map +1 -1
- package/components/ScheduledTaskTimezoneField/ScheduledTaskTimezoneField.d.ts +13 -0
- package/components/ScheduledTaskTimezoneField/ScheduledTaskTimezoneField.d.ts.map +1 -0
- package/components/ScheduledTaskTimezoneField/ScheduledTaskTimezoneGapHint.d.ts +13 -0
- package/components/ScheduledTaskTimezoneField/ScheduledTaskTimezoneGapHint.d.ts.map +1 -0
- package/components/ScheduledTaskTimezoneField/ScheduledTaskTimezoneList.d.ts +21 -0
- package/components/ScheduledTaskTimezoneField/ScheduledTaskTimezoneList.d.ts.map +1 -0
- package/constants/scheduled-task-create-form.d.ts +1 -1
- package/constants/scheduled-task-create-form.d.ts.map +1 -1
- package/constants/scheduled-task-timezone.d.ts +6 -0
- package/constants/scheduled-task-timezone.d.ts.map +1 -0
- package/index.css +2 -2
- package/index.d.ts +7 -1
- package/index.d.ts.map +1 -1
- package/index.js +1108 -826
- package/models/scheduled-task-create-form-props.d.ts +20 -0
- package/models/scheduled-task-create-form-props.d.ts.map +1 -1
- package/models/scheduled-task-timezone-props.d.ts +94 -0
- package/models/scheduled-task-timezone-props.d.ts.map +1 -0
- package/package.json +7 -3
- package/utils/timezone-search.d.ts +9 -0
- package/utils/timezone-search.d.ts.map +1 -0
- package/utils/zoned-wall-clock.d.ts +41 -0
- package/utils/zoned-wall-clock.d.ts.map +1 -0
- package/validation/scheduled-task-validation.d.ts +2 -0
- package/validation/scheduled-task-validation.d.ts.map +1 -1
- package/validation.js +34 -26
- package/calendar-value-WOdrwh6p.js +0 -33
|
@@ -2,6 +2,7 @@ import { TextRefinementLabels } from '@epam/ai-dial-chat-shared';
|
|
|
2
2
|
import { EditorThemes } from '@epam/ai-dial-ui-kit';
|
|
3
3
|
import { ReactNode } from 'react';
|
|
4
4
|
import { ScheduledTaskRepeat } from '../types/scheduled-task-schedule';
|
|
5
|
+
import { ScheduledTaskTimezoneClassNames, ScheduledTaskTimezoneColors, ScheduledTaskTimezoneLabels, ScheduledTaskTimezoneOption } from './scheduled-task-timezone-props';
|
|
5
6
|
/** A single option rendered in the Repeat dropdown. */
|
|
6
7
|
export interface ScheduledTaskRepeatOption {
|
|
7
8
|
/** Stable identifier for this option, passed back via `onFieldChange('repeat', key)`. */
|
|
@@ -24,6 +25,8 @@ export interface ScheduledTaskCreateFormValues {
|
|
|
24
25
|
displayName: string;
|
|
25
26
|
/** How often the task repeats. */
|
|
26
27
|
repeat: ScheduledTaskRepeat;
|
|
28
|
+
/** IANA time zone the schedule is evaluated in, such as `Europe/Berlin`; `time`, `runAt` and the activity-window dates are wall time in it. */
|
|
29
|
+
timezone: string;
|
|
27
30
|
/** Local datetime-local input value used when `repeat` is `'oneTime'`. */
|
|
28
31
|
runAt?: string;
|
|
29
32
|
/** `HH:mm` time-of-day used when `repeat` is `'daily'`, `'weekly'`, `'monthly'`, or `'custom'`. */
|
|
@@ -53,6 +56,8 @@ export interface ScheduledTaskCreateFormValues {
|
|
|
53
56
|
export interface ScheduledTaskCreateFormErrors {
|
|
54
57
|
/** Error shown under the display name field. */
|
|
55
58
|
displayName?: string;
|
|
59
|
+
/** Error shown under the time zone field. */
|
|
60
|
+
timezone?: string;
|
|
56
61
|
/** Error shown under the run-at field. */
|
|
57
62
|
runAt?: string;
|
|
58
63
|
/** Error shown under the time field. */
|
|
@@ -200,6 +205,19 @@ export interface ScheduledTaskCreateFormStyles {
|
|
|
200
205
|
columnGap?: string;
|
|
201
206
|
};
|
|
202
207
|
}
|
|
208
|
+
/** What the host supplies so the form can offer a time zone picker. */
|
|
209
|
+
export interface ScheduledTaskCreateFormTimezone {
|
|
210
|
+
/** Selectable zones, already sorted. */
|
|
211
|
+
options: ScheduledTaskTimezoneOption[];
|
|
212
|
+
/** The viewer's own zone, listed first. */
|
|
213
|
+
browserTimezoneId?: string;
|
|
214
|
+
/** Localized picker and hint strings. */
|
|
215
|
+
labels?: ScheduledTaskTimezoneLabels;
|
|
216
|
+
/** Picker color overrides. */
|
|
217
|
+
colors?: ScheduledTaskTimezoneColors;
|
|
218
|
+
/** Picker typography overrides. */
|
|
219
|
+
classNames?: ScheduledTaskTimezoneClassNames;
|
|
220
|
+
}
|
|
203
221
|
/** Props for the {@link ScheduledTaskCreateForm} component. */
|
|
204
222
|
export interface ScheduledTaskCreateFormProps {
|
|
205
223
|
/** Optional Description rewrite callback; omission hides its action. */
|
|
@@ -208,6 +226,8 @@ export interface ScheduledTaskCreateFormProps {
|
|
|
208
226
|
onRefineInstructions?: (value: string, signal: AbortSignal) => Promise<string>;
|
|
209
227
|
/** Localized labels. */
|
|
210
228
|
labels: ScheduledTaskCreateFormLabels;
|
|
229
|
+
/** Time zone picker data; omit it to hide the picker and leave the zone to the host. */
|
|
230
|
+
timezone?: ScheduledTaskCreateFormTimezone;
|
|
211
231
|
/** Current field values. */
|
|
212
232
|
values: ScheduledTaskCreateFormValues;
|
|
213
233
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-task-create-form-props.d.ts","sourceRoot":"","sources":["../../src/models/scheduled-task-create-form-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;
|
|
1
|
+
{"version":3,"file":"scheduled-task-create-form-props.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B,wFAAwF;IACxF,aAAa,EAAE,CAAC,CAAC,SAAS,MAAM,6BAA6B,EAC3D,KAAK,EAAE,CAAC,EACR,KAAK,EAAE,6BAA6B,CAAC,CAAC,CAAC,KACpC,IAAI,CAAC;IACV,gEAAgE;IAChE,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,wDAAwD;IACxD,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,sDAAsD;IACtD,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,iGAAiG;IACjG,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,4HAA4H;IAC5H,mBAAmB,CAAC,EAAE,YAAY,CAAC;IACnC,sDAAsD;IACtD,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uBAAuB;IACvB,MAAM,CAAC,EAAE,6BAA6B,CAAC;CACxC"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/** One selectable row of the time zone picker, resolved and sorted by the host. */
|
|
2
|
+
export interface ScheduledTaskTimezoneOption {
|
|
3
|
+
/** IANA identifier sent to the API, such as `Europe/Berlin`. */
|
|
4
|
+
id: string;
|
|
5
|
+
/** Offset shown in the first column, such as `GMT+01:00`. */
|
|
6
|
+
offsetLabel: string;
|
|
7
|
+
/** Offset from UTC in minutes; the host sorts by it, the lib only reads it for display decisions. */
|
|
8
|
+
offsetMinutes: number;
|
|
9
|
+
/** Letter abbreviation shown after the identifier, such as `CET`. Omitted when the platform has none. */
|
|
10
|
+
abbreviation?: string;
|
|
11
|
+
/** Lower-cased strings a search query is matched against (offset variants, identifier with spaces, abbreviations). */
|
|
12
|
+
searchTerms: string[];
|
|
13
|
+
}
|
|
14
|
+
/** Localized strings of the time zone picker; every one has an English default. */
|
|
15
|
+
export interface ScheduledTaskTimezoneLabels {
|
|
16
|
+
/** Text of the link that opens the picker. Defaults to `'Change timezone'`. */
|
|
17
|
+
changeLabel?: string;
|
|
18
|
+
/** Accessible name of the picker dialog. Defaults to `'Time zone'`. */
|
|
19
|
+
dialogAriaLabel?: string;
|
|
20
|
+
/** Placeholder of the search field. Defaults to `'Search city, timezone or offset...'`. */
|
|
21
|
+
searchPlaceholder?: string;
|
|
22
|
+
/** Accessible name of the search field. Defaults to `'Search time zones'`. */
|
|
23
|
+
searchAriaLabel?: string;
|
|
24
|
+
/** Accessible name of the clear button of the search field. Defaults to `'Clear search'`. */
|
|
25
|
+
clearSearchAriaLabel?: string;
|
|
26
|
+
/** Heading of the group holding the browser's zone. Defaults to `'Your time zone'`. */
|
|
27
|
+
yourZoneHeading?: string;
|
|
28
|
+
/** Heading of the group holding every zone. Defaults to `'All time zones'`. */
|
|
29
|
+
allZonesHeading?: string;
|
|
30
|
+
/** Title of the empty state when nothing matches. Defaults to `'No time zones found'`. */
|
|
31
|
+
noResultsTitle?: string;
|
|
32
|
+
/** Description of the empty state when nothing matches. Defaults to `'Try a different city, time zone or offset.'`. */
|
|
33
|
+
noResultsDescription?: string;
|
|
34
|
+
/** Announcement of the number of matching rows. Defaults to `'{count} time zones found'`-style English text. */
|
|
35
|
+
resultsCountLabel?: (count: number) => string;
|
|
36
|
+
/** Accessible name of the list of zones. Defaults to `'Time zones'`. */
|
|
37
|
+
listAriaLabel?: string;
|
|
38
|
+
/** Hint shown when a one-time run time does not exist in the zone; receives the local time the task will run at. Defaults to an English sentence. */
|
|
39
|
+
gapHintLabel?: (shiftedTime: string) => string;
|
|
40
|
+
}
|
|
41
|
+
/** Color overrides of the time zone picker, applied as CSS custom properties. */
|
|
42
|
+
export interface ScheduledTaskTimezoneColors {
|
|
43
|
+
/** Color of the "Change timezone" link. Defaults to `--text-accent`. */
|
|
44
|
+
linkColor?: string;
|
|
45
|
+
/** Color of the group headings. Defaults to `--text-secondary`. */
|
|
46
|
+
headingColor?: string;
|
|
47
|
+
/** Color of the offset column. Defaults to `--text-secondary`. */
|
|
48
|
+
offsetColor?: string;
|
|
49
|
+
/** Color of the zone identifier. Defaults to `--text-primary`. */
|
|
50
|
+
nameColor?: string;
|
|
51
|
+
/** Color of the abbreviation. Defaults to `--text-secondary`. */
|
|
52
|
+
abbreviationColor?: string;
|
|
53
|
+
/** Color of the DST-gap hint. Defaults to `--text-secondary`. */
|
|
54
|
+
hintColor?: string;
|
|
55
|
+
/** Color of the popover's shadow. Defaults to `--shadow-lg`. */
|
|
56
|
+
shadowColor?: string;
|
|
57
|
+
}
|
|
58
|
+
/** Typography overrides of the time zone picker; each value is a kit `dial-*-text` class. */
|
|
59
|
+
export interface ScheduledTaskTimezoneClassNames {
|
|
60
|
+
/** Class of the "Change timezone" link. Defaults to `'dial-small-semi-text'`. */
|
|
61
|
+
linkClassName?: string;
|
|
62
|
+
/** Class of the group headings. Defaults to `'dial-tiny-lead-semi-text'`. */
|
|
63
|
+
headingClassName?: string;
|
|
64
|
+
/** Class of each row. Defaults to `'dial-small-text'`. */
|
|
65
|
+
rowClassName?: string;
|
|
66
|
+
/** Class of the DST-gap hint. Defaults to `'dial-tiny-text'`. */
|
|
67
|
+
hintClassName?: string;
|
|
68
|
+
}
|
|
69
|
+
/** Props of the time zone picker field. */
|
|
70
|
+
export interface ScheduledTaskTimezoneFieldProps {
|
|
71
|
+
/** Id of the "Change timezone" link. */
|
|
72
|
+
id: string;
|
|
73
|
+
/** Selectable zones, already sorted by the host; rendered in the order given. */
|
|
74
|
+
options: ScheduledTaskTimezoneOption[];
|
|
75
|
+
/** Id of the selected zone. */
|
|
76
|
+
value: string;
|
|
77
|
+
/** Called with the id of the zone the user picked. */
|
|
78
|
+
onChange: (timezoneId: string) => void;
|
|
79
|
+
/** Id of the viewer's own zone, listed first under its own heading; omitted when unknown. */
|
|
80
|
+
browserTimezoneId?: string;
|
|
81
|
+
/** Disables the link, e.g. while the form is submitting. */
|
|
82
|
+
disabled?: boolean;
|
|
83
|
+
/** Whether the selected zone, such as `(GMT+01:00) Europe/Berlin`, is written beside the link. Defaults to `true`; turn it off when the host shows the zone elsewhere, for example inside the time input. */
|
|
84
|
+
isSummaryShown?: boolean;
|
|
85
|
+
/** Id of the element describing the field, such as its error message; set as `aria-describedby` on the link. */
|
|
86
|
+
ariaDescribedBy?: string;
|
|
87
|
+
/** Localized strings, each with an English default. */
|
|
88
|
+
labels?: ScheduledTaskTimezoneLabels;
|
|
89
|
+
/** Color overrides. */
|
|
90
|
+
colors?: ScheduledTaskTimezoneColors;
|
|
91
|
+
/** Typography class overrides. */
|
|
92
|
+
classNames?: ScheduledTaskTimezoneClassNames;
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=scheduled-task-timezone-props.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduled-task-timezone-props.d.ts","sourceRoot":"","sources":["../../src/models/scheduled-task-timezone-props.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,MAAM,WAAW,2BAA2B;IAC1C,gEAAgE;IAChE,EAAE,EAAE,MAAM,CAAC;IACX,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAC;IACpB,qGAAqG;IACrG,aAAa,EAAE,MAAM,CAAC;IACtB,yGAAyG;IACzG,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,sHAAsH;IACtH,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,mFAAmF;AACnF,MAAM,WAAW,2BAA2B;IAC1C,+EAA+E;IAC/E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,uEAAuE;IACvE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2FAA2F;IAC3F,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,8EAA8E;IAC9E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,6FAA6F;IAC7F,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,uFAAuF;IACvF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,+EAA+E;IAC/E,eAAe,CAA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,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IACvC,6FAA6F;IAC7F,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,4DAA4D;IAC5D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6MAA6M;IAC7M,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,gHAAgH;IAChH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uDAAuD;IACvD,MAAM,CAAC,EAAE,2BAA2B,CAAC;IACrC,uBAAuB;IACvB,MAAM,CAAC,EAAE,2BAA2B,CAAC;IACrC,kCAAkC;IAClC,UAAU,CAAC,EAAE,+BAA+B,CAAC;CAC9C"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@epam/ai-dial-scheduled-tasks",
|
|
3
3
|
"description": "Presentational Scheduled Tasks page shell — header, toolbar, and empty state",
|
|
4
|
-
"version": "1.4.0-dev.
|
|
4
|
+
"version": "1.4.0-dev.81",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"**/*.css",
|
|
8
|
+
"**/*.scss"
|
|
9
|
+
],
|
|
6
10
|
"type": "module",
|
|
7
11
|
"main": "./index.js",
|
|
8
12
|
"module": "./index.js",
|
|
@@ -25,10 +29,10 @@
|
|
|
25
29
|
"@tabler/icons-react": "^3.50.0",
|
|
26
30
|
"@uiw/react-markdown-preview": "^5.2.1",
|
|
27
31
|
"@uiw/react-md-editor": "^4.2.2",
|
|
28
|
-
"@epam/ai-dial-builder-form": "1.4.0-dev.
|
|
32
|
+
"@epam/ai-dial-builder-form": "1.4.0-dev.81"
|
|
29
33
|
},
|
|
30
34
|
"peerDependencies": {
|
|
31
|
-
"@epam/ai-dial-chat-shared": "1.4.0-dev.
|
|
35
|
+
"@epam/ai-dial-chat-shared": "1.4.0-dev.81",
|
|
32
36
|
"@epam/ai-dial-ui-kit": "^0.16.0",
|
|
33
37
|
"react": "^19.2.8"
|
|
34
38
|
},
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ScheduledTaskTimezoneOption } from '../models/scheduled-task-timezone-props';
|
|
2
|
+
/** Lower-cases and trims what the user typed into the zone search. */
|
|
3
|
+
export declare const normalizeTimezoneQuery: (query: string) => string;
|
|
4
|
+
/**
|
|
5
|
+
* Keeps the options whose search terms contain the query, in their given order.
|
|
6
|
+
* An empty query keeps every option.
|
|
7
|
+
*/
|
|
8
|
+
export declare const filterTimezoneOptions: (options: readonly ScheduledTaskTimezoneOption[], query: string) => ScheduledTaskTimezoneOption[];
|
|
9
|
+
//# sourceMappingURL=timezone-search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timezone-search.d.ts","sourceRoot":"","sources":["../../src/utils/timezone-search.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AAE3F,sEAAsE;AACtE,eAAO,MAAM,sBAAsB,GAAI,OAAO,MAAM,KAAG,MAC3B,CAAC;AAE7B;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAChC,SAAS,SAAS,2BAA2B,EAAE,EAC/C,OAAO,MAAM,KACZ,2BAA2B,EAM7B,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/** A wall-clock moment in a zone, as the strings the create form edits. */
|
|
2
|
+
export interface ZonedNow {
|
|
3
|
+
/** Local calendar day, `YYYY-MM-DD`. */
|
|
4
|
+
date: string;
|
|
5
|
+
/** Local date and time to the minute, `YYYY-MM-DDTHH:mm`. */
|
|
6
|
+
dateTime: string;
|
|
7
|
+
/** Local date and time to the second, `YYYY-MM-DDTHH:mm:ss`. */
|
|
8
|
+
dateTimeWithSeconds: string;
|
|
9
|
+
}
|
|
10
|
+
/** True when an ISO datetime names an absolute instant (`Z` or a numeric offset) rather than zone-local wall time. */
|
|
11
|
+
export declare const isAbsoluteInstant: (value: string) => boolean;
|
|
12
|
+
/**
|
|
13
|
+
* The current local date and time in `timezone`.
|
|
14
|
+
* Throws a `RangeError` for an identifier `Intl` rejects; validate the zone first.
|
|
15
|
+
*/
|
|
16
|
+
export declare const getZonedNow: (now: Date, timezone: string) => ZonedNow;
|
|
17
|
+
/**
|
|
18
|
+
* Converts an absolute instant (an ISO string with `Z` or an offset) to the
|
|
19
|
+
* local `YYYY-MM-DDTHH:mm` it shows in `timezone`, or `undefined` when the
|
|
20
|
+
* input is not a date.
|
|
21
|
+
*/
|
|
22
|
+
export declare const instantToZonedDateTime: (iso: string, timezone: string) => string | undefined;
|
|
23
|
+
/**
|
|
24
|
+
* True when the local time does not exist in `timezone` — it falls inside a
|
|
25
|
+
* spring-forward gap. A repeated time (autumn) exists and returns `false`.
|
|
26
|
+
* An unparseable value or an unknown zone returns `false`.
|
|
27
|
+
*/
|
|
28
|
+
export declare const isNonexistentLocalTime: (dateTime: string, timezone: string) => boolean;
|
|
29
|
+
/**
|
|
30
|
+
* The local time a nonexistent `dateTime` runs at: shifted forward by the
|
|
31
|
+
* length of the gap (`02:30` becomes `03:30` in `Europe/Berlin`). A time that
|
|
32
|
+
* exists, an unparseable value or an unknown zone is returned unchanged.
|
|
33
|
+
*/
|
|
34
|
+
export declare const shiftForwardOverGap: (dateTime: string, timezone: string) => string;
|
|
35
|
+
/**
|
|
36
|
+
* Builds a `Date` in the process's own zone whose local fields equal the
|
|
37
|
+
* wall-clock `YYYY-MM-DDTHH:mm`. Kit pickers read local fields, so this is how
|
|
38
|
+
* a moment of another zone is handed to them as a minimum date.
|
|
39
|
+
*/
|
|
40
|
+
export declare const wallClockToLocalDate: (dateTime: string) => Date;
|
|
41
|
+
//# sourceMappingURL=zoned-wall-clock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zoned-wall-clock.d.ts","sourceRoot":"","sources":["../../src/utils/zoned-wall-clock.ts"],"names":[],"mappings":"AAWA,2EAA2E;AAC3E,MAAM,WAAW,QAAQ;IACvB,wCAAwC;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,QAAQ,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,mBAAmB,EAAE,MAAM,CAAC;CAC7B;AAID,sHAAsH;AACtH,eAAO,MAAM,iBAAiB,GAAI,OAAO,MAAM,KAAG,OACf,CAAC;AAqEpC;;;GAGG;AACH,eAAO,MAAM,WAAW,GAAI,KAAK,IAAI,EAAE,UAAU,MAAM,KAAG,QACX,CAAC;AAEhD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,KAAK,MAAM,EACX,UAAU,MAAM,KACf,MAAM,GAAG,SAIX,CAAC;AAcF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GACjC,UAAU,MAAM,EAChB,UAAU,MAAM,KACf,OAYF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,GAC9B,UAAU,MAAM,EAChB,UAAU,MAAM,KACf,MAKF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,GAAI,UAAU,MAAM,KAAG,IAWvD,CAAC"}
|
|
@@ -15,6 +15,8 @@ export declare enum ScheduledTaskValidationErrorCode {
|
|
|
15
15
|
/** A selected skill requires explicit capability support. */
|
|
16
16
|
SkillUnsupported = "skillUnsupported",
|
|
17
17
|
DescriptionTooLong = "descriptionTooLong",
|
|
18
|
+
/** The time zone is empty or not an identifier `Intl` knows. */
|
|
19
|
+
TimezoneInvalid = "timezoneInvalid",
|
|
18
20
|
RunAtInvalid = "runAtInvalid",
|
|
19
21
|
TimeInvalid = "timeInvalid",
|
|
20
22
|
MinuteInvalid = "minuteInvalid",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduled-task-validation.d.ts","sourceRoot":"","sources":["../../src/validation/scheduled-task-validation.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,4CAA4C,CAAC;
|
|
1
|
+
{"version":3,"file":"scheduled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B;IAC3B,MAAM,WAAW;CAClB;AAED;;;;GAIG;AACH,eAAO,MAAM,8BAA8B,GACzC,OAAO,sBAAsB,EAC7B,OAAO,MAAM,GAAG,SAAS,KACxB,gCAAgC,GAAG,SAoBrC,CAAC;AAEF,+FAA+F;AAC/F,eAAO,MAAM,8BAA8B,QAAS,CAAC;AA+CrD;;;;GAIG;AACH,eAAO,MAAM,+BAA+B,GAC1C,QAAQ,6BAA6B,EACrC,gFAMG,8BAA8B,KAChC,6BAoIF,CAAC"}
|
package/validation.js
CHANGED
|
@@ -1,36 +1,44 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ENTITY_INSTRUCTIONS_MAX_LENGTH as
|
|
1
|
+
import { d as e, t, u as n } from "./calendar-value-CXFwy6E8.js";
|
|
2
|
+
import { ENTITY_INSTRUCTIONS_MAX_LENGTH as r, ENTITY_NAME_MAX_LENGTH as i, exceedsMaxLength as a, hasControlCharacters as o, isSkillSelectionUnsupported as s } from "@epam/ai-dial-chat-shared";
|
|
3
3
|
//#region src/validation/scheduled-task-validation.ts
|
|
4
|
-
var
|
|
5
|
-
return e.DisplayNameRequired = "displayNameRequired", e.DisplayNameTooLong = "displayNameTooLong", e.DisplayNameControlCharacters = "displayNameControlCharacters", e.ModelRequired = "modelRequired", e.PromptRequired = "promptRequired", e.PromptTooLong = "promptTooLong", e.InstructionsOrSkillRequired = "instructionsOrSkillRequired", e.SkillUnsupported = "skillUnsupported", e.DescriptionTooLong = "descriptionTooLong", e.RunAtInvalid = "runAtInvalid", e.TimeInvalid = "timeInvalid", e.MinuteInvalid = "minuteInvalid", e.DayOfWeekInvalid = "dayOfWeekInvalid", e.DaysOfWeekInvalid = "daysOfWeekInvalid", e.DayOfMonthInvalid = "dayOfMonthInvalid", e.StartDateInvalid = "startDateInvalid", e.StartDateInPast = "startDateInPast", e.EndDateInvalid = "endDateInvalid", e.EndDateInPast = "endDateInPast", e;
|
|
6
|
-
}({}),
|
|
4
|
+
var c = /* @__PURE__ */ function(e) {
|
|
5
|
+
return e.DisplayNameRequired = "displayNameRequired", e.DisplayNameTooLong = "displayNameTooLong", e.DisplayNameControlCharacters = "displayNameControlCharacters", e.ModelRequired = "modelRequired", e.PromptRequired = "promptRequired", e.PromptTooLong = "promptTooLong", e.InstructionsOrSkillRequired = "instructionsOrSkillRequired", e.SkillUnsupported = "skillUnsupported", e.DescriptionTooLong = "descriptionTooLong", e.TimezoneInvalid = "timezoneInvalid", e.RunAtInvalid = "runAtInvalid", e.TimeInvalid = "timeInvalid", e.MinuteInvalid = "minuteInvalid", e.DayOfWeekInvalid = "dayOfWeekInvalid", e.DaysOfWeekInvalid = "daysOfWeekInvalid", e.DayOfMonthInvalid = "dayOfMonthInvalid", e.StartDateInvalid = "startDateInvalid", e.StartDateInPast = "startDateInPast", e.EndDateInvalid = "endDateInvalid", e.EndDateInPast = "endDateInPast", e;
|
|
6
|
+
}({}), l = /* @__PURE__ */ function(e) {
|
|
7
7
|
return e.DisplayName = "displayName", e.Description = "description", e.Prompt = "prompt", e;
|
|
8
|
-
}({}),
|
|
9
|
-
let
|
|
8
|
+
}({}), u = (e, t) => {
|
|
9
|
+
let n = t?.trim() ?? "";
|
|
10
10
|
switch (e) {
|
|
11
|
-
case "displayName": return
|
|
12
|
-
case "description": return
|
|
13
|
-
case "prompt": return
|
|
11
|
+
case "displayName": return a(n, i) ? "displayNameTooLong" : o(n) ? "displayNameControlCharacters" : void 0;
|
|
12
|
+
case "description": return a(n, 500) ? "descriptionTooLong" : void 0;
|
|
13
|
+
case "prompt": return a(n, r) ? "promptTooLong" : void 0;
|
|
14
14
|
}
|
|
15
|
-
},
|
|
16
|
-
if (!
|
|
15
|
+
}, d = 6e4, f = /^(?:[0-9]|[1-5][0-9])$/, p = /^[0-6]$/, m = /^(?:[1-9]|[12][0-9]|3[01])$/, h = /^\d{4}-\d{2}-\d{2}$/, g = (e) => !!e?.length && e.every((e) => p.test(e)) && new Set(e).size === e.length, _ = (e) => {
|
|
16
|
+
if (!h.test(e)) return !1;
|
|
17
17
|
let [t, n, r] = e.split("-").map(Number), i = new Date(t, n - 1, r);
|
|
18
18
|
return i.getFullYear() === t && i.getMonth() === n - 1 && i.getDate() === r;
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
}, v = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}(?::\d{2})?$/, y = (e) => v.test(e) && Number.isFinite(Date.parse(`${e}Z`)), b = /^[A-Za-z][A-Za-z0-9_+\-/]*$/, x = (e) => {
|
|
20
|
+
if (!e || !b.test(e)) return !1;
|
|
21
|
+
try {
|
|
22
|
+
return new Intl.DateTimeFormat("en-US", { timeZone: e }), !0;
|
|
23
|
+
} catch {
|
|
24
|
+
return !1;
|
|
25
|
+
}
|
|
26
|
+
}, S = (e, t) => e < t, C = (r, { now: i, minimumLeadMs: a = d, isSkillsSupported: o, originalStartDate: c, originalEndDate: l }) => {
|
|
27
|
+
let h = {}, v = (e, t) => {
|
|
28
|
+
let n = u(e, t);
|
|
29
|
+
n && (h[e] = n);
|
|
26
30
|
};
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
r.displayName.trim() ? v("displayName", r.displayName) : h.displayName = "displayNameRequired", r.modelId.trim() || (h.modelId = "modelRequired"), !r.prompt.trim() && !r.skillUrls?.length ? h.prompt = "instructionsOrSkillRequired" : v("prompt", r.prompt), r.skillUrls?.some((e) => s(e, o)) && (h.skillUrls = "skillUnsupported"), v("description", r.description);
|
|
32
|
+
let b = x(r.timezone);
|
|
33
|
+
b || (h.timezone = "timezoneInvalid");
|
|
34
|
+
let C = b ? r.timezone : "UTC";
|
|
35
|
+
if (r.repeat === n.OneTime) {
|
|
36
|
+
let t = e(new Date(i.getTime() + a), C).dateTimeWithSeconds, n = r.runAt ?? "";
|
|
37
|
+
return (!y(n) || `${n.slice(0, 16)}:${n.slice(17, 19) || "00"}` < t) && (h.runAt = "runAtInvalid"), h;
|
|
30
38
|
}
|
|
31
|
-
|
|
32
|
-
let
|
|
33
|
-
return
|
|
39
|
+
r.repeat === n.Hourly ? f.test(r.minute ?? "") || (h.minute = "minuteInvalid") : t.test(r.time) || (h.time = "timeInvalid"), r.repeat === n.Weekly && !p.test(r.dayOfWeek ?? "") && (h.dayOfWeek = "dayOfWeekInvalid"), r.repeat === n.Custom && !g(r.daysOfWeek) && (h.daysOfWeek = "daysOfWeekInvalid"), r.repeat === n.Monthly && !m.test(r.dayOfMonth ?? "") && (h.dayOfMonth = "dayOfMonthInvalid"), r.startDate && !_(r.startDate) && (h.startDate = "startDateInvalid"), r.endDate && !_(r.endDate) && (h.endDate = "endDateInvalid"), r.startDate && r.endDate && _(r.startDate) && _(r.endDate) && r.endDate < r.startDate && (h.endDate = "endDateInvalid");
|
|
40
|
+
let w = e(i, C).date;
|
|
41
|
+
return r.startDate && r.startDate !== c && _(r.startDate) && S(r.startDate, w) && (h.startDate = "startDateInPast"), r.endDate && r.endDate !== l && _(r.endDate) && S(r.endDate, w) && (h.endDate = "endDateInPast"), h;
|
|
34
42
|
};
|
|
35
43
|
//#endregion
|
|
36
|
-
export {
|
|
44
|
+
export { d as SCHEDULED_TASK_MINIMUM_LEAD_MS, l as ScheduledTaskTextField, c as ScheduledTaskValidationErrorCode, C as validateScheduledTaskFormValues, u as validateScheduledTaskTextField };
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
//#region src/types/scheduled-task-schedule.ts
|
|
2
|
-
var e = /* @__PURE__ */ function(e) {
|
|
3
|
-
return e.OneTime = "oneTime", e.Hourly = "hourly", e.Daily = "daily", e.Weekly = "weekly", e.Monthly = "monthly", e.Custom = "custom", e;
|
|
4
|
-
}({}), t = 500, n = {
|
|
5
|
-
displayName: "",
|
|
6
|
-
repeat: e.Daily,
|
|
7
|
-
time: "09:00",
|
|
8
|
-
minute: "0",
|
|
9
|
-
startDate: void 0,
|
|
10
|
-
endDate: void 0,
|
|
11
|
-
modelId: "",
|
|
12
|
-
prompt: ""
|
|
13
|
-
}, r = (e) => String(e).padStart(2, "0"), i = /^([01]\d|2[0-3]):([0-5]\d)$/, a = (e) => e ? new Date(e) : null, o = (e) => {
|
|
14
|
-
if (e == null) return "";
|
|
15
|
-
let t = e instanceof Date ? e : new Date(e);
|
|
16
|
-
return Number.isNaN(t.getTime()) ? "" : `${t.getFullYear()}-${r(t.getMonth() + 1)}-${r(t.getDate())}T${r(t.getHours())}:${r(t.getMinutes())}`;
|
|
17
|
-
}, s = (e) => {
|
|
18
|
-
if (!e) return null;
|
|
19
|
-
let [t, n, r] = e.split("-").map(Number);
|
|
20
|
-
return new Date(t, n - 1, r);
|
|
21
|
-
}, c = (e) => {
|
|
22
|
-
if (e == null) return "";
|
|
23
|
-
let t = e instanceof Date ? e : new Date(e);
|
|
24
|
-
return Number.isNaN(t.getTime()) ? "" : `${t.getFullYear()}-${r(t.getMonth() + 1)}-${r(t.getDate())}`;
|
|
25
|
-
}, l = (e) => {
|
|
26
|
-
let t = Number(e);
|
|
27
|
-
return e && Number.isFinite(t) ? String(t + 1) : null;
|
|
28
|
-
}, u = (e) => {
|
|
29
|
-
let t = typeof e == "string" ? Number(e) : NaN;
|
|
30
|
-
return Number.isFinite(t) ? String(t - 1) : "";
|
|
31
|
-
};
|
|
32
|
-
//#endregion
|
|
33
|
-
export { s as a, t as c, o as i, n as l, c as n, l as o, u as r, a as s, i as t, e as u };
|