@niscorp/tide 0.1.7 → 0.1.8
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/CHANGELOG.md +15 -0
- package/DESIGN.md +3 -2
- package/DOCS.md +16 -6
- package/README.md +5 -1
- package/dist/agent.cjs +9 -5
- package/dist/agent.cjs.map +1 -1
- package/dist/agent.d.cts +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +2 -2
- package/dist/agent.js.map +1 -1
- package/dist/{chunk-4TXWZFRE.js → chunk-ZEEJLISU.js} +10 -6
- package/dist/chunk-ZEEJLISU.js.map +1 -0
- package/dist/index.cjs +9 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -5
- package/dist/index.d.ts +29 -5
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/migrations/index.cjs +156 -0
- package/dist/migrations/index.cjs.map +1 -0
- package/dist/migrations/index.d.cts +198 -0
- package/dist/migrations/index.d.ts +198 -0
- package/dist/migrations/index.js +21 -0
- package/dist/migrations/index.js.map +1 -0
- package/dist/postgres.cjs +11 -3
- package/dist/postgres.cjs.map +1 -1
- package/dist/postgres.js +5 -1
- package/dist/postgres.js.map +1 -1
- package/dist/{reflex.schema-DeiyN5eN.d.cts → reflex.schema-DW1znJfS.d.cts} +29 -5
- package/dist/{reflex.schema-DeiyN5eN.d.ts → reflex.schema-DW1znJfS.d.ts} +29 -5
- package/package.json +13 -3
- package/dist/chunk-4TXWZFRE.js.map +0 -1
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-
|
|
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-
|
|
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.
|
|
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.
|
|
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.
|
|
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-
|
|
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-
|
|
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.
|
|
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.
|
|
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.
|
|
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-
|
|
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-
|
|
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;
|