@niscorp/tide 0.1.7 → 0.1.9

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/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { F as FactInput, L as LoadReport, a as Fact, A as AdvanceReport, P as PreviewReport, R as Run, T as TaskState, b as Task, c as Retention, d as TideConfig, e as TideStore, f as ReflexState } from './types-lAPfp7JD.cjs';
2
2
  export { g as AttemptOutcome, C as COMPARISON_OPS, h as ClaimSpec, i as Comparison, E as EffectHandler, j as EffectRegistry, k as FactInputSchema, l as FactKind, m as FactKindSchema, M as Mutation, N as NewFact, O as Order, n as PRIMARY_KEY, o as PreviewCtx, p as PreviewUnit, Q as QuerySpec, q as RemoveSpec, r as Row, s as RunState, S as SelectCtx, t as SelectFn, u as TableName, v as TideCtx, w as TideEvent, x as TideTables, y as TransformFn, U as UNIQUE_BY, z as UniqueKey, W as Where } from './types-lAPfp7JD.cjs';
3
- import { R as Reflex, a as ReflexInput, b as ReflexDraft, T as Timer } from './reflex.schema-DeiyN5eN.cjs';
4
- export { D as DRAFT_TRIGGERS, c as DraftChoice, d as DraftField, e as DraftTrigger, E as EffectRef, f as EffectRefSchema, g as ReflexDraftSchema, h as ReflexSchema, S as Selection, i as SelectionSchema, j as TimerSchema, k as TimerTriggerSchema, l as draftSchemaOf } from './reflex.schema-DeiyN5eN.cjs';
3
+ import { R as Reflex, a as ReflexInput, b as ReflexDraft, T as Timer } from './reflex.schema-DW1znJfS.cjs';
4
+ export { D as DRAFT_TRIGGERS, c as DraftChoice, d as DraftField, e as DraftTrigger, E as EffectRef, f as EffectRefSchema, g as ReflexDraftSchema, h as ReflexSchema, S as Selection, i as SelectionSchema, j as TimerSchema, k as TimerTriggerSchema, l as draftSchemaOf } from './reflex.schema-DW1znJfS.cjs';
5
5
  import { z } from 'zod';
6
6
 
7
7
  declare const WEEKDAYS: readonly ["mon", "tue", "wed", "thu", "fri", "sat", "sun"];
@@ -26,7 +26,15 @@ declare const ClockRecurringSchema: z.ZodObject<{
26
26
  fri: "fri";
27
27
  sat: "sat";
28
28
  sun: "sun";
29
- }>, z.ZodString]>>;
29
+ }>, z.ZodArray<z.ZodEnum<{
30
+ mon: "mon";
31
+ tue: "tue";
32
+ wed: "wed";
33
+ thu: "thu";
34
+ fri: "fri";
35
+ sat: "sat";
36
+ sun: "sun";
37
+ }>>, z.ZodString]>>;
30
38
  at: z.ZodString;
31
39
  tz: z.ZodString;
32
40
  }, z.core.$strict>;
@@ -50,7 +58,15 @@ declare const ClockTriggerSchema: z.ZodObject<{
50
58
  fri: "fri";
51
59
  sat: "sat";
52
60
  sun: "sun";
53
- }>, z.ZodString]>>;
61
+ }>, z.ZodArray<z.ZodEnum<{
62
+ mon: "mon";
63
+ tue: "tue";
64
+ wed: "wed";
65
+ thu: "thu";
66
+ fri: "fri";
67
+ sat: "sat";
68
+ sun: "sun";
69
+ }>>, z.ZodString]>>;
54
70
  at: z.ZodString;
55
71
  tz: z.ZodString;
56
72
  }, z.core.$strict>, z.ZodObject<{
@@ -102,7 +118,15 @@ declare const TriggerSchema: z.ZodUnion<readonly [z.ZodObject<{
102
118
  fri: "fri";
103
119
  sat: "sat";
104
120
  sun: "sun";
105
- }>, z.ZodString]>>;
121
+ }>, z.ZodArray<z.ZodEnum<{
122
+ mon: "mon";
123
+ tue: "tue";
124
+ wed: "wed";
125
+ thu: "thu";
126
+ fri: "fri";
127
+ sat: "sat";
128
+ sun: "sun";
129
+ }>>, z.ZodString]>>;
106
130
  at: z.ZodString;
107
131
  tz: z.ZodString;
108
132
  }, z.core.$strict>, z.ZodObject<{
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { F as FactInput, L as LoadReport, a as Fact, A as AdvanceReport, P as PreviewReport, R as Run, T as TaskState, b as Task, c as Retention, d as TideConfig, e as TideStore, f as ReflexState } from './types-lAPfp7JD.js';
2
2
  export { g as AttemptOutcome, C as COMPARISON_OPS, h as ClaimSpec, i as Comparison, E as EffectHandler, j as EffectRegistry, k as FactInputSchema, l as FactKind, m as FactKindSchema, M as Mutation, N as NewFact, O as Order, n as PRIMARY_KEY, o as PreviewCtx, p as PreviewUnit, Q as QuerySpec, q as RemoveSpec, r as Row, s as RunState, S as SelectCtx, t as SelectFn, u as TableName, v as TideCtx, w as TideEvent, x as TideTables, y as TransformFn, U as UNIQUE_BY, z as UniqueKey, W as Where } from './types-lAPfp7JD.js';
3
- import { R as Reflex, a as ReflexInput, b as ReflexDraft, T as Timer } from './reflex.schema-DeiyN5eN.js';
4
- export { D as DRAFT_TRIGGERS, c as DraftChoice, d as DraftField, e as DraftTrigger, E as EffectRef, f as EffectRefSchema, g as ReflexDraftSchema, h as ReflexSchema, S as Selection, i as SelectionSchema, j as TimerSchema, k as TimerTriggerSchema, l as draftSchemaOf } from './reflex.schema-DeiyN5eN.js';
3
+ import { R as Reflex, a as ReflexInput, b as ReflexDraft, T as Timer } from './reflex.schema-DW1znJfS.js';
4
+ export { D as DRAFT_TRIGGERS, c as DraftChoice, d as DraftField, e as DraftTrigger, E as EffectRef, f as EffectRefSchema, g as ReflexDraftSchema, h as ReflexSchema, S as Selection, i as SelectionSchema, j as TimerSchema, k as TimerTriggerSchema, l as draftSchemaOf } from './reflex.schema-DW1znJfS.js';
5
5
  import { z } from 'zod';
6
6
 
7
7
  declare const WEEKDAYS: readonly ["mon", "tue", "wed", "thu", "fri", "sat", "sun"];
@@ -26,7 +26,15 @@ declare const ClockRecurringSchema: z.ZodObject<{
26
26
  fri: "fri";
27
27
  sat: "sat";
28
28
  sun: "sun";
29
- }>, z.ZodString]>>;
29
+ }>, z.ZodArray<z.ZodEnum<{
30
+ mon: "mon";
31
+ tue: "tue";
32
+ wed: "wed";
33
+ thu: "thu";
34
+ fri: "fri";
35
+ sat: "sat";
36
+ sun: "sun";
37
+ }>>, z.ZodString]>>;
30
38
  at: z.ZodString;
31
39
  tz: z.ZodString;
32
40
  }, z.core.$strict>;
@@ -50,7 +58,15 @@ declare const ClockTriggerSchema: z.ZodObject<{
50
58
  fri: "fri";
51
59
  sat: "sat";
52
60
  sun: "sun";
53
- }>, z.ZodString]>>;
61
+ }>, z.ZodArray<z.ZodEnum<{
62
+ mon: "mon";
63
+ tue: "tue";
64
+ wed: "wed";
65
+ thu: "thu";
66
+ fri: "fri";
67
+ sat: "sat";
68
+ sun: "sun";
69
+ }>>, z.ZodString]>>;
54
70
  at: z.ZodString;
55
71
  tz: z.ZodString;
56
72
  }, z.core.$strict>, z.ZodObject<{
@@ -102,7 +118,15 @@ declare const TriggerSchema: z.ZodUnion<readonly [z.ZodObject<{
102
118
  fri: "fri";
103
119
  sat: "sat";
104
120
  sun: "sun";
105
- }>, z.ZodString]>>;
121
+ }>, z.ZodArray<z.ZodEnum<{
122
+ mon: "mon";
123
+ tue: "tue";
124
+ wed: "wed";
125
+ thu: "thu";
126
+ fri: "fri";
127
+ sat: "sat";
128
+ sun: "sun";
129
+ }>>, z.ZodString]>>;
106
130
  at: z.ZodString;
107
131
  tz: z.ZodString;
108
132
  }, z.core.$strict>, z.ZodObject<{
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { UNIQUE_BY, PRIMARY_KEY, COMPARISON_OPS } from './chunk-7KHOAJNL.js';
2
2
  export { COMPARISON_OPS, PRIMARY_KEY, UNIQUE_BY } from './chunk-7KHOAJNL.js';
3
- import { isRecurring, ReflexSchema, FactInputSchema, clockOf, factOf, WEEKDAYS, isManual } from './chunk-4TXWZFRE.js';
4
- export { ClockOnceSchema, ClockRecurringSchema, ClockTriggerSchema, ClockUnitSchema, DRAFT_TRIGGERS, EffectRefSchema, FactInputSchema, FactKindSchema, ManualTriggerSchema, OpSchema, PolicySchema, ReflexDraftSchema, ReflexSchema, RetrySchema, RunTriggerSchema, SelectionSchema, SignalTriggerSchema, TimerSchema, TimerTriggerSchema, TriggerSchema, WEEKDAYS, WriteTriggerSchema, draftSchemaOf } from './chunk-4TXWZFRE.js';
3
+ import { isRecurring, ReflexSchema, FactInputSchema, clockOf, factOf, WEEKDAYS, isManual } from './chunk-ZEEJLISU.js';
4
+ export { ClockOnceSchema, ClockRecurringSchema, ClockTriggerSchema, ClockUnitSchema, DRAFT_TRIGGERS, EffectRefSchema, FactInputSchema, FactKindSchema, ManualTriggerSchema, OpSchema, PolicySchema, ReflexDraftSchema, ReflexSchema, RetrySchema, RunTriggerSchema, SelectionSchema, SignalTriggerSchema, TimerSchema, TimerTriggerSchema, TriggerSchema, WEEKDAYS, WriteTriggerSchema, draftSchemaOf } from './chunk-ZEEJLISU.js';
5
5
 
6
6
  // src/errors.ts
7
7
  var TideError = class extends Error {
@@ -226,7 +226,7 @@ var ordinalOf = (day) => day.year * 1e4 + day.month * 100 + day.day;
226
226
  var pad2 = (value) => String(value).padStart(2, "0");
227
227
  var isDueOn = (clock, day) => {
228
228
  if (clock.every === "day") return true;
229
- if (clock.every === "week") return weekdayOf(day) === clock.on;
229
+ if (clock.every === "week") return Array.isArray(clock.on) ? clock.on.some((one) => one === weekdayOf(day)) : weekdayOf(day) === clock.on;
230
230
  if (clock.every === "month")
231
231
  return typeof clock.on === "number" && day.day === Math.min(clock.on, daysInMonth(day.year, day.month));
232
232
  if (typeof clock.on !== "string") return false;