@praxisui/cron-builder 8.0.0-beta.0 → 8.0.0-beta.100

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/package.json CHANGED
@@ -1,14 +1,16 @@
1
1
  {
2
2
  "name": "@praxisui/cron-builder",
3
- "version": "8.0.0-beta.0",
3
+ "version": "8.0.0-beta.100",
4
4
  "description": "Cron expression builder utilities and components for Praxis UI.",
5
5
  "peerDependencies": {
6
- "@angular/common": "^20.1.0",
7
- "@angular/core": "^20.1.0",
8
- "@angular/forms": "^20.1.0",
9
- "@angular/cdk": "^20.1.0",
10
- "@angular/material": "^20.1.0",
11
- "@praxisui/core": "^8.0.0-beta.0"
6
+ "@angular/common": "^21.0.0",
7
+ "@angular/core": "^21.0.0",
8
+ "@angular/forms": "^21.0.0",
9
+ "@angular/cdk": "^21.0.0",
10
+ "@angular/material": "^21.0.0",
11
+ "@praxisui/core": "^8.0.0-beta.100",
12
+ "@praxisui/ai": "^8.0.0-beta.100",
13
+ "rxjs": "~7.8.0"
12
14
  },
13
15
  "dependencies": {
14
16
  "tslib": "^2.3.0",
@@ -39,14 +41,15 @@
39
41
  ],
40
42
  "sideEffects": false,
41
43
  "module": "fesm2022/praxisui-cron-builder.mjs",
42
- "typings": "index.d.ts",
44
+ "typings": "types/praxisui-cron-builder.d.ts",
43
45
  "exports": {
44
46
  "./package.json": {
45
47
  "default": "./package.json"
46
48
  },
47
49
  ".": {
48
- "types": "./index.d.ts",
50
+ "types": "./types/praxisui-cron-builder.d.ts",
49
51
  "default": "./fesm2022/praxisui-cron-builder.mjs"
50
52
  }
51
- }
53
+ },
54
+ "type": "module"
52
55
  }
@@ -0,0 +1,288 @@
1
+ import * as i0 from '@angular/core';
2
+ import { OnInit, OnDestroy } from '@angular/core';
3
+ import { ControlValueAccessor, FormGroup, FormControl } from '@angular/forms';
4
+ import { MatTabChangeEvent } from '@angular/material/tabs';
5
+ import { AiCapabilityCatalog, AiCapability, AiCapabilityCategory, AiValueKind, ComponentAuthoringManifest } from '@praxisui/core';
6
+
7
+ declare const SCHEDULE_AUTHORING_CONFIG_VERSION: "v1";
8
+ type ScheduleAuthoringConfigVersion = typeof SCHEDULE_AUTHORING_CONFIG_VERSION;
9
+ type CronDialect = 'unix' | 'quartz' | 'aws-eventbridge' | 'kubernetes' | 'github-actions' | 'gcp-scheduler';
10
+ type ScheduleKind = 'once' | 'interval' | 'daily' | 'weekly' | 'monthly' | 'customCron';
11
+ type ScheduleTimeUnit = 'minutes' | 'hours' | 'days' | 'weeks';
12
+ type ScheduleWeekday = 0 | 1 | 2 | 3 | 4 | 5 | 6;
13
+ type ScheduleSeverity = 'error' | 'warning' | 'info';
14
+ interface CronDialectDefinition {
15
+ dialect: CronDialect;
16
+ label: string;
17
+ fieldCount: {
18
+ min: number;
19
+ max: number;
20
+ };
21
+ supportsSeconds: boolean;
22
+ supportsYear: boolean;
23
+ supportsNamedMonths: boolean;
24
+ supportsNamedWeekdays: boolean;
25
+ supportsQuestionMark: boolean;
26
+ supportsLast: boolean;
27
+ supportsNearestWeekday: boolean;
28
+ supportsNthWeekday: boolean;
29
+ timezoneMode: 'external-field' | 'host-local' | 'fixed-utc' | 'expression-prefix-unsupported';
30
+ dayOfMonthDayOfWeekRule: 'either-or-question-mark' | 'unix-or' | 'host-specific';
31
+ examples: readonly string[];
32
+ }
33
+ interface ScheduleDiagnostic {
34
+ severity: ScheduleSeverity;
35
+ code: string;
36
+ field?: string;
37
+ message: string;
38
+ suggestion?: string;
39
+ }
40
+ interface ScheduleCronExpression {
41
+ cron: string;
42
+ dialect: CronDialect;
43
+ seconds?: boolean;
44
+ }
45
+ interface OnceSchedule {
46
+ runAt: string;
47
+ }
48
+ interface IntervalSchedule {
49
+ every: number;
50
+ unit: ScheduleTimeUnit;
51
+ }
52
+ interface DailySchedule {
53
+ times: string[];
54
+ onlyWeekdays?: boolean;
55
+ }
56
+ interface WeeklySchedule {
57
+ daysOfWeek: ScheduleWeekday[];
58
+ times: string[];
59
+ }
60
+ interface MonthlySchedule {
61
+ mode: 'dayOfMonth' | 'nthWeekday' | 'lastDay' | 'lastWeekday';
62
+ dayOfMonth?: number;
63
+ nth?: 1 | 2 | 3 | 4 | 5;
64
+ weekday?: ScheduleWeekday;
65
+ times: string[];
66
+ }
67
+ interface ScheduleRecurrence {
68
+ once?: OnceSchedule;
69
+ interval?: IntervalSchedule;
70
+ daily?: DailySchedule;
71
+ weekly?: WeeklySchedule;
72
+ monthly?: MonthlySchedule;
73
+ }
74
+ interface ScheduleWindow {
75
+ startAt?: string;
76
+ endAt?: string;
77
+ }
78
+ interface ScheduleExecutionPolicy {
79
+ enabled?: boolean;
80
+ misfirePolicy?: 'skip' | 'run-late' | 'run-once';
81
+ concurrencyPolicy?: 'allow' | 'forbid' | 'replace';
82
+ flexibleWindowMinutes?: number;
83
+ jitterMinutes?: number;
84
+ }
85
+ interface SchedulePreviewConfig {
86
+ occurrences?: number;
87
+ from?: string;
88
+ }
89
+ interface ScheduleGovernance {
90
+ name?: string;
91
+ description?: string;
92
+ owner?: string;
93
+ tags?: string[];
94
+ }
95
+ interface ScheduleAuthoringConfig {
96
+ version: ScheduleAuthoringConfigVersion;
97
+ kind: ScheduleKind;
98
+ timezone: string;
99
+ locale?: string;
100
+ expression?: ScheduleCronExpression;
101
+ recurrence?: ScheduleRecurrence;
102
+ window?: ScheduleWindow;
103
+ executionPolicy?: ScheduleExecutionPolicy;
104
+ preview?: SchedulePreviewConfig;
105
+ governance?: ScheduleGovernance;
106
+ }
107
+ declare const CRON_DIALECTS: Record<CronDialect, CronDialectDefinition>;
108
+ declare function getCronDialectDefinition(dialect: CronDialect): CronDialectDefinition;
109
+
110
+ interface ScheduleNormalizeOptions {
111
+ timezone?: string;
112
+ locale?: string;
113
+ dialect?: CronDialect;
114
+ previewOccurrences?: number;
115
+ }
116
+ interface ScheduleNormalizeResult {
117
+ config: ScheduleAuthoringConfig | null;
118
+ diagnostics: ScheduleDiagnostic[];
119
+ }
120
+ type ScheduleInput = string | ScheduleAuthoringConfig | null | undefined;
121
+ declare function normalizeScheduleValue(value: ScheduleInput, options?: ScheduleNormalizeOptions): ScheduleNormalizeResult;
122
+ declare function inferCronDialect(expression: string): CronDialect;
123
+
124
+ interface CompiledScheduleExpression {
125
+ cron: string;
126
+ dialect: CronDialect;
127
+ seconds: boolean;
128
+ }
129
+ interface SchedulePreviewOccurrence {
130
+ instant: string;
131
+ localDateTime: string;
132
+ timezone: string;
133
+ }
134
+ interface SchedulePreviewResult {
135
+ config: ScheduleAuthoringConfig | null;
136
+ expression: CompiledScheduleExpression | null;
137
+ humanized: string;
138
+ occurrences: SchedulePreviewOccurrence[];
139
+ diagnostics: ScheduleDiagnostic[];
140
+ }
141
+ interface CreateSchedulePreviewOptions extends SchedulePreviewConfig, Pick<ScheduleNormalizeOptions, 'timezone' | 'locale' | 'dialect'> {
142
+ }
143
+ declare function compileScheduleExpression(config: ScheduleAuthoringConfig): {
144
+ expression: CompiledScheduleExpression | null;
145
+ diagnostics: ScheduleDiagnostic[];
146
+ };
147
+ declare function validateScheduleAuthoringConfig(config: ScheduleAuthoringConfig): ScheduleDiagnostic[];
148
+ declare function createSchedulePreview(value: string | ScheduleAuthoringConfig | null | undefined, preview?: CreateSchedulePreviewOptions): SchedulePreviewResult;
149
+
150
+ interface Recurrence {
151
+ }
152
+ interface CronBuilderMetadata {
153
+ mode?: 'simple' | 'advanced' | 'both';
154
+ fields?: {
155
+ seconds?: boolean;
156
+ minutes?: boolean;
157
+ hours?: boolean;
158
+ dom?: boolean;
159
+ month?: boolean;
160
+ dow?: boolean;
161
+ };
162
+ timezone?: string;
163
+ locale?: string;
164
+ presets?: Array<{
165
+ label: string;
166
+ cron: string;
167
+ }>;
168
+ previewOccurrences?: number;
169
+ previewFrom?: Date;
170
+ validators?: {
171
+ requiredMessage?: string;
172
+ invalidCronMessage?: string;
173
+ };
174
+ validationTrigger?: 'change' | 'blur';
175
+ validationDebounce?: number;
176
+ errorPosition?: 'tooltip' | 'inline';
177
+ showInlineErrors?: boolean;
178
+ hint?: string;
179
+ }
180
+ type CronPresetType = 'everyNMinutes' | 'dailyAt' | 'weekly' | 'monthlyDay' | 'monthlyNthWeekday';
181
+ interface SimpleCronFormValue {
182
+ type: CronPresetType;
183
+ everyN: number;
184
+ dailyTime: string;
185
+ weeklyDays: number[];
186
+ weeklyTime: string;
187
+ monthlyDay: number;
188
+ monthlyTime: string;
189
+ nth: number;
190
+ nthDay: number;
191
+ nthTime: string;
192
+ }
193
+ interface AdvancedCronFormValue {
194
+ seconds?: string;
195
+ minutes: string;
196
+ hours: string;
197
+ dayOfMonth: string;
198
+ month: string;
199
+ dayOfWeek: string;
200
+ }
201
+ declare class PdxCronBuilderComponent implements ControlValueAccessor, OnInit, OnDestroy {
202
+ private readonly fb;
203
+ private readonly clipboard;
204
+ private readonly snackBar;
205
+ metadata: CronBuilderMetadata;
206
+ value: string | Recurrence | null;
207
+ isDisabled: boolean;
208
+ activeTab: 'simple' | 'advanced';
209
+ selectedTabIndex: number;
210
+ readonly form: FormGroup;
211
+ readonly simpleForm: FormGroup;
212
+ readonly timezoneControl: FormControl<string>;
213
+ private readonly destroy$;
214
+ humanized: string;
215
+ preview: Date[];
216
+ structuredPreview: SchedulePreviewOccurrence[];
217
+ scheduleConfig: ScheduleAuthoringConfig | null;
218
+ scheduleDiagnostics: ScheduleDiagnostic[];
219
+ error: string | null;
220
+ readonly weekdayLabels: readonly ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"];
221
+ readonly weeklyDayOptions: readonly [0, 1, 2, 3, 4, 5, 6];
222
+ readonly nthOrderOptions: readonly [1, 2, 3, 4, 5];
223
+ readonly nthDayOptions: readonly [1, 2, 3, 4, 5, 6, 0];
224
+ readonly timezoneOptions: readonly ["UTC", "America/Sao_Paulo", "Europe/London", "America/New_York"];
225
+ constructor();
226
+ get simpleControls(): Record<string, FormControl>;
227
+ ngOnInit(): void;
228
+ onChange: (value: any) => void;
229
+ onTouched: () => void;
230
+ writeValue(value: string | Recurrence | null): void;
231
+ registerOnChange(fn: any): void;
232
+ registerOnTouched(fn: any): void;
233
+ setDisabledState?(isDisabled: boolean): void;
234
+ onTabChange(event: MatTabChangeEvent): void;
235
+ setPreset(cron: string): void;
236
+ updateValue(cron: string, emitEvent?: boolean): void;
237
+ copyCron(): void;
238
+ copyHumanized(): void;
239
+ importCron(): void;
240
+ private refreshScheduleState;
241
+ private parseCronString;
242
+ private syncSimpleForm;
243
+ private buildCronFromSimple;
244
+ private parseTime;
245
+ private toTime;
246
+ private pad;
247
+ private constructCronString;
248
+ ngOnDestroy(): void;
249
+ static ɵfac: i0.ɵɵFactoryDeclaration<PdxCronBuilderComponent, never>;
250
+ static ɵcmp: i0.ɵɵComponentDeclaration<PdxCronBuilderComponent, "pdx-cron-builder", never, { "metadata": { "alias": "metadata"; "required": false; }; }, {}, never, never, true, never>;
251
+ }
252
+
253
+ declare const PDX_CRON_BUILDER_DOC_META_LEGACY: any;
254
+
255
+ /**
256
+ * Capabilities catalog for Cron Builder (pdx-cron-builder inputs + metadata).
257
+ * Paths follow component inputs (patch merged at config root).
258
+ */
259
+
260
+ declare module '@praxisui/core' {
261
+ interface AiCapabilityCategoryMap {
262
+ meta: true;
263
+ schedule: true;
264
+ recurrence: true;
265
+ dialects: true;
266
+ fields: true;
267
+ presets: true;
268
+ policy: true;
269
+ preview: true;
270
+ governance: true;
271
+ i18n: true;
272
+ ui: true;
273
+ }
274
+ }
275
+ type CapabilityCategory = AiCapabilityCategory;
276
+ type ValueKind = AiValueKind;
277
+ interface Capability extends AiCapability {
278
+ category: CapabilityCategory;
279
+ }
280
+ interface CapabilityCatalog extends AiCapabilityCatalog {
281
+ capabilities: Capability[];
282
+ }
283
+ declare const CRON_BUILDER_AI_CAPABILITIES: CapabilityCatalog;
284
+
285
+ declare const PRAXIS_CRON_BUILDER_AUTHORING_MANIFEST: ComponentAuthoringManifest;
286
+
287
+ export { CRON_BUILDER_AI_CAPABILITIES, CRON_DIALECTS, PDX_CRON_BUILDER_DOC_META_LEGACY, PRAXIS_CRON_BUILDER_AUTHORING_MANIFEST, PdxCronBuilderComponent, SCHEDULE_AUTHORING_CONFIG_VERSION, compileScheduleExpression, createSchedulePreview, getCronDialectDefinition, inferCronDialect, normalizeScheduleValue, validateScheduleAuthoringConfig };
288
+ export type { AdvancedCronFormValue, Capability, CapabilityCatalog, CapabilityCategory, CompiledScheduleExpression, CreateSchedulePreviewOptions, CronBuilderMetadata, CronDialect, CronDialectDefinition, CronPresetType, DailySchedule, IntervalSchedule, MonthlySchedule, OnceSchedule, Recurrence, ScheduleAuthoringConfig, ScheduleAuthoringConfigVersion, ScheduleCronExpression, ScheduleDiagnostic, ScheduleExecutionPolicy, ScheduleGovernance, ScheduleInput, ScheduleKind, ScheduleNormalizeOptions, ScheduleNormalizeResult, SchedulePreviewConfig, SchedulePreviewOccurrence, SchedulePreviewResult, ScheduleRecurrence, ScheduleSeverity, ScheduleTimeUnit, ScheduleWeekday, ScheduleWindow, SimpleCronFormValue, ValueKind, WeeklySchedule };
package/index.d.ts DELETED
@@ -1,137 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { OnInit, OnDestroy } from '@angular/core';
3
- import { ControlValueAccessor, FormGroup, FormControl } from '@angular/forms';
4
- import { MatTabChangeEvent } from '@angular/material/tabs';
5
- import { AiCapabilityCategory, AiValueKind, AiCapability, AiCapabilityCatalog } from '@praxisui/core';
6
-
7
- interface Recurrence {
8
- }
9
- interface CronBuilderMetadata {
10
- mode?: 'simple' | 'advanced' | 'both';
11
- fields?: {
12
- seconds?: boolean;
13
- minutes?: boolean;
14
- hours?: boolean;
15
- dom?: boolean;
16
- month?: boolean;
17
- dow?: boolean;
18
- };
19
- timezone?: string;
20
- locale?: string;
21
- presets?: Array<{
22
- label: string;
23
- cron: string;
24
- }>;
25
- previewOccurrences?: number;
26
- previewFrom?: Date;
27
- validators?: {
28
- requiredMessage?: string;
29
- invalidCronMessage?: string;
30
- };
31
- validationTrigger?: 'change' | 'blur';
32
- validationDebounce?: number;
33
- errorPosition?: 'tooltip' | 'inline';
34
- showInlineErrors?: boolean;
35
- hint?: string;
36
- }
37
- type CronPresetType = 'everyNMinutes' | 'dailyAt' | 'weekly' | 'monthlyDay' | 'monthlyNthWeekday';
38
- interface SimpleCronFormValue {
39
- type: CronPresetType;
40
- everyN: number;
41
- dailyTime: string;
42
- weeklyDays: number[];
43
- weeklyTime: string;
44
- monthlyDay: number;
45
- monthlyTime: string;
46
- nth: number;
47
- nthDay: number;
48
- nthTime: string;
49
- }
50
- interface AdvancedCronFormValue {
51
- seconds?: string;
52
- minutes: string;
53
- hours: string;
54
- dayOfMonth: string;
55
- month: string;
56
- dayOfWeek: string;
57
- }
58
- declare class PdxCronBuilderComponent implements ControlValueAccessor, OnInit, OnDestroy {
59
- private readonly fb;
60
- private readonly clipboard;
61
- private readonly snackBar;
62
- metadata: CronBuilderMetadata;
63
- value: string | Recurrence | null;
64
- isDisabled: boolean;
65
- activeTab: 'simple' | 'advanced';
66
- selectedTabIndex: number;
67
- readonly form: FormGroup;
68
- readonly simpleForm: FormGroup;
69
- readonly timezoneControl: FormControl<string>;
70
- private readonly destroy$;
71
- humanized: string;
72
- preview: Date[];
73
- error: string | null;
74
- readonly weekdayLabels: readonly ["Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb"];
75
- readonly weeklyDayOptions: readonly [0, 1, 2, 3, 4, 5, 6];
76
- readonly nthOrderOptions: readonly [1, 2, 3, 4, 5];
77
- readonly nthDayOptions: readonly [1, 2, 3, 4, 5, 6, 0];
78
- readonly timezoneOptions: readonly ["UTC", "America/Sao_Paulo", "Europe/London", "America/New_York"];
79
- constructor();
80
- get simpleControls(): Record<string, FormControl>;
81
- ngOnInit(): void;
82
- onChange: (value: any) => void;
83
- onTouched: () => void;
84
- writeValue(value: string | Recurrence | null): void;
85
- registerOnChange(fn: any): void;
86
- registerOnTouched(fn: any): void;
87
- setDisabledState?(isDisabled: boolean): void;
88
- onTabChange(event: MatTabChangeEvent): void;
89
- setPreset(cron: string): void;
90
- updateValue(cron: string, emitEvent?: boolean): void;
91
- copyCron(): void;
92
- copyHumanized(): void;
93
- importCron(): void;
94
- private validate;
95
- private humanize;
96
- private generatePreview;
97
- private parseCronString;
98
- private syncSimpleForm;
99
- private buildCronFromSimple;
100
- private parseTime;
101
- private toTime;
102
- private pad;
103
- private constructCronString;
104
- ngOnDestroy(): void;
105
- static ɵfac: i0.ɵɵFactoryDeclaration<PdxCronBuilderComponent, never>;
106
- static ɵcmp: i0.ɵɵComponentDeclaration<PdxCronBuilderComponent, "pdx-cron-builder", never, { "metadata": { "alias": "metadata"; "required": false; }; }, {}, never, never, true, never>;
107
- }
108
-
109
- declare const PDX_CRON_BUILDER_DOC_META_LEGACY: any;
110
-
111
- /**
112
- * Capabilities catalog for Cron Builder (pdx-cron-builder inputs + metadata).
113
- * Paths follow component inputs (patch merged at config root).
114
- */
115
-
116
- declare module '@praxisui/core' {
117
- interface AiCapabilityCategoryMap {
118
- meta: true;
119
- fields: true;
120
- presets: true;
121
- preview: true;
122
- i18n: true;
123
- ui: true;
124
- }
125
- }
126
- type CapabilityCategory = AiCapabilityCategory;
127
- type ValueKind = AiValueKind;
128
- interface Capability extends AiCapability {
129
- category: CapabilityCategory;
130
- }
131
- interface CapabilityCatalog extends AiCapabilityCatalog {
132
- capabilities: Capability[];
133
- }
134
- declare const CRON_BUILDER_AI_CAPABILITIES: CapabilityCatalog;
135
-
136
- export { CRON_BUILDER_AI_CAPABILITIES, PDX_CRON_BUILDER_DOC_META_LEGACY, PdxCronBuilderComponent };
137
- export type { AdvancedCronFormValue, Capability, CapabilityCatalog, CapabilityCategory, CronBuilderMetadata, CronPresetType, Recurrence, SimpleCronFormValue, ValueKind };