@adminiumjs/manifest 0.3.0-rc.3 → 0.3.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/dist/booking.d.ts +100 -0
- package/dist/booking.d.ts.map +1 -0
- package/dist/booking.js +237 -0
- package/dist/booking.js.map +1 -0
- package/dist/index.d.ts +8 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/outbox.d.ts +198 -0
- package/dist/outbox.d.ts.map +1 -0
- package/dist/outbox.js +355 -0
- package/dist/outbox.js.map +1 -0
- package/dist/page-calendar.d.ts +42 -0
- package/dist/page-calendar.d.ts.map +1 -0
- package/dist/page-calendar.js +95 -0
- package/dist/page-calendar.js.map +1 -0
- package/dist/plan-context.d.ts +51 -0
- package/dist/plan-context.d.ts.map +1 -0
- package/dist/plan-context.js +356 -0
- package/dist/plan-context.js.map +1 -0
- package/dist/plan-model.d.ts +197 -0
- package/dist/plan-model.d.ts.map +1 -0
- package/dist/plan-model.js +11 -0
- package/dist/plan-model.js.map +1 -0
- package/dist/plan-types.d.ts +12 -0
- package/dist/plan-types.d.ts.map +1 -0
- package/dist/plan-types.js +71 -0
- package/dist/plan-types.js.map +1 -0
- package/dist/plan.d.ts +9 -90
- package/dist/plan.d.ts.map +1 -1
- package/dist/plan.js +48 -1
- package/dist/plan.js.map +1 -1
- package/dist/public-access.d.ts +167 -0
- package/dist/public-access.d.ts.map +1 -0
- package/dist/public-access.js +475 -0
- package/dist/public-access.js.map +1 -0
- package/dist/refs.d.ts +74 -0
- package/dist/refs.d.ts.map +1 -0
- package/dist/refs.js +70 -0
- package/dist/refs.js.map +1 -0
- package/dist/roles.d.ts +44 -0
- package/dist/roles.d.ts.map +1 -0
- package/dist/roles.js +75 -0
- package/dist/roles.js.map +1 -0
- package/dist/sample.d.ts +200 -0
- package/dist/sample.d.ts.map +1 -0
- package/dist/sample.js +208 -0
- package/dist/sample.js.map +1 -0
- package/dist/schema.d.ts +2031 -51
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +559 -18
- package/dist/schema.js.map +1 -1
- package/dist/semver.d.ts +28 -0
- package/dist/semver.d.ts.map +1 -0
- package/dist/semver.js +85 -0
- package/dist/semver.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `table.booking` — booking PEOPLE rather than tables: a row takes a resource
|
|
3
|
+
* (a clinician) for its own length, and two counted rows of one resource may
|
|
4
|
+
* never overlap.
|
|
5
|
+
*
|
|
6
|
+
* Beside `capacity`, not folded into it. Capacity adds up a party per start
|
|
7
|
+
* time; booking forbids overlap per resource, within that resource's hours,
|
|
8
|
+
* breaks and closures. They are different questions, and a table carries one
|
|
9
|
+
* or the other.
|
|
10
|
+
*
|
|
11
|
+
* Every table the rule names is the app's own, by ref. With `prefixed`
|
|
12
|
+
* install the server maps each of them — nested ones included — to the real
|
|
13
|
+
* table name.
|
|
14
|
+
*/
|
|
15
|
+
import { z } from 'zod';
|
|
16
|
+
import { type ReferenceIssue, type TableIndex, type TableShape } from './refs.js';
|
|
17
|
+
/** The weekday values an hours table's weekday enum must hold, in this order. */
|
|
18
|
+
export declare const BOOKING_WEEKDAYS: readonly ["mon", "tue", "wed", "thu", "fri", "sat", "sun"];
|
|
19
|
+
export declare const bookingSchema: z.ZodObject<{
|
|
20
|
+
start: z.ZodString;
|
|
21
|
+
minutes: z.ZodString;
|
|
22
|
+
resource: z.ZodString;
|
|
23
|
+
kind: z.ZodString;
|
|
24
|
+
countWhere: z.ZodObject<{
|
|
25
|
+
column: z.ZodString;
|
|
26
|
+
values: z.ZodArray<z.ZodString>;
|
|
27
|
+
}, z.core.$strict>;
|
|
28
|
+
eligible: z.ZodObject<{
|
|
29
|
+
table: z.ZodString;
|
|
30
|
+
resource: z.ZodString;
|
|
31
|
+
kind: z.ZodString;
|
|
32
|
+
order: z.ZodOptional<z.ZodObject<{
|
|
33
|
+
table: z.ZodString;
|
|
34
|
+
column: z.ZodString;
|
|
35
|
+
active: z.ZodOptional<z.ZodString>;
|
|
36
|
+
public: z.ZodOptional<z.ZodString>;
|
|
37
|
+
}, z.core.$strict>>;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
hours: z.ZodObject<{
|
|
40
|
+
practice: z.ZodObject<{
|
|
41
|
+
weekday: z.ZodString;
|
|
42
|
+
opens: z.ZodString;
|
|
43
|
+
closes: z.ZodString;
|
|
44
|
+
breakStart: z.ZodOptional<z.ZodString>;
|
|
45
|
+
breakEnd: z.ZodOptional<z.ZodString>;
|
|
46
|
+
table: z.ZodString;
|
|
47
|
+
open: z.ZodOptional<z.ZodString>;
|
|
48
|
+
}, z.core.$strict>;
|
|
49
|
+
own: z.ZodOptional<z.ZodObject<{
|
|
50
|
+
weekday: z.ZodString;
|
|
51
|
+
opens: z.ZodString;
|
|
52
|
+
closes: z.ZodString;
|
|
53
|
+
breakStart: z.ZodOptional<z.ZodString>;
|
|
54
|
+
breakEnd: z.ZodOptional<z.ZodString>;
|
|
55
|
+
table: z.ZodString;
|
|
56
|
+
resource: z.ZodString;
|
|
57
|
+
}, z.core.$strict>>;
|
|
58
|
+
}, z.core.$strict>;
|
|
59
|
+
closures: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
table: z.ZodString;
|
|
61
|
+
from: z.ZodString;
|
|
62
|
+
to: z.ZodString;
|
|
63
|
+
resource: z.ZodOptional<z.ZodString>;
|
|
64
|
+
active: z.ZodOptional<z.ZodString>;
|
|
65
|
+
}, z.core.$strict>>;
|
|
66
|
+
grid: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
67
|
+
table: z.ZodString;
|
|
68
|
+
column: z.ZodString;
|
|
69
|
+
}, z.core.$strict>]>;
|
|
70
|
+
windowDays: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
71
|
+
table: z.ZodString;
|
|
72
|
+
column: z.ZodString;
|
|
73
|
+
}, z.core.$strict>]>>;
|
|
74
|
+
noticeMinutes: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
75
|
+
table: z.ZodString;
|
|
76
|
+
column: z.ZodString;
|
|
77
|
+
}, z.core.$strict>]>>;
|
|
78
|
+
cancel: z.ZodOptional<z.ZodObject<{
|
|
79
|
+
hours: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
|
|
80
|
+
table: z.ZodString;
|
|
81
|
+
column: z.ZodString;
|
|
82
|
+
}, z.core.$strict>]>;
|
|
83
|
+
mode: z.ZodEnum<{
|
|
84
|
+
refuse: "refuse";
|
|
85
|
+
flag: "flag";
|
|
86
|
+
}>;
|
|
87
|
+
flag: z.ZodOptional<z.ZodString>;
|
|
88
|
+
when: z.ZodObject<{
|
|
89
|
+
column: z.ZodString;
|
|
90
|
+
to: z.ZodString;
|
|
91
|
+
}, z.core.$strict>;
|
|
92
|
+
}, z.core.$strict>>;
|
|
93
|
+
}, z.core.$strict>;
|
|
94
|
+
export type BookingRule = z.infer<typeof bookingSchema>;
|
|
95
|
+
/**
|
|
96
|
+
* Everything in a table's booking rule that names something the manifest does
|
|
97
|
+
* not declare, or a column of the wrong kind.
|
|
98
|
+
*/
|
|
99
|
+
export declare function bookingIssues(table: TableShape, rule: BookingRule, index: TableIndex, at: (...rest: (string | number)[]) => (string | number)[]): ReferenceIssue[];
|
|
100
|
+
//# sourceMappingURL=booking.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"booking.d.ts","sourceRoot":"","sources":["../src/booking.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAOL,KAAK,cAAc,EACnB,KAAK,UAAU,EACf,KAAK,UAAU,EAChB,MAAM,WAAW,CAAC;AAEnB,iFAAiF;AACjF,eAAO,MAAM,gBAAgB,4DAA6D,CAAC;AAU3F,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA4Ef,CAAC;AACZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAExD;;;GAGG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,UAAU,EACjB,IAAI,EAAE,WAAW,EACjB,KAAK,EAAE,UAAU,EACjB,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,GACxD,cAAc,EAAE,CAoIlB"}
|
package/dist/booking.js
ADDED
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-only
|
|
2
|
+
/**
|
|
3
|
+
* `table.booking` — booking PEOPLE rather than tables: a row takes a resource
|
|
4
|
+
* (a clinician) for its own length, and two counted rows of one resource may
|
|
5
|
+
* never overlap.
|
|
6
|
+
*
|
|
7
|
+
* Beside `capacity`, not folded into it. Capacity adds up a party per start
|
|
8
|
+
* time; booking forbids overlap per resource, within that resource's hours,
|
|
9
|
+
* breaks and closures. They are different questions, and a table carries one
|
|
10
|
+
* or the other.
|
|
11
|
+
*
|
|
12
|
+
* Every table the rule names is the app's own, by ref. With `prefixed`
|
|
13
|
+
* install the server maps each of them — nested ones included — to the real
|
|
14
|
+
* table name.
|
|
15
|
+
*/
|
|
16
|
+
import { z } from 'zod';
|
|
17
|
+
import { NUMERIC_TYPES, numberOrSetting, refSchema, settingRefSchema, valueFits, } from './refs.js';
|
|
18
|
+
/** The weekday values an hours table's weekday enum must hold, in this order. */
|
|
19
|
+
export const BOOKING_WEEKDAYS = ['mon', 'tue', 'wed', 'thu', 'fri', 'sat', 'sun'];
|
|
20
|
+
const hoursColumns = {
|
|
21
|
+
weekday: refSchema,
|
|
22
|
+
opens: refSchema,
|
|
23
|
+
closes: refSchema,
|
|
24
|
+
breakStart: refSchema.optional(),
|
|
25
|
+
breakEnd: refSchema.optional(),
|
|
26
|
+
};
|
|
27
|
+
export const bookingSchema = z
|
|
28
|
+
.object({
|
|
29
|
+
/** When the row starts: a `timestamptz`, read in the venue's zone. */
|
|
30
|
+
start: refSchema,
|
|
31
|
+
/** How long it lasts: an int column on the row (copied from the kind). */
|
|
32
|
+
minutes: refSchema,
|
|
33
|
+
/** Whose time it takes: a foreign key. Empty on a create means "anyone" — Adminium picks. */
|
|
34
|
+
resource: refSchema,
|
|
35
|
+
/** What it is: a foreign key, which decides who may be booked for it. */
|
|
36
|
+
kind: refSchema,
|
|
37
|
+
/** Only rows whose column holds one of these take time (a cancelled visit takes none). */
|
|
38
|
+
countWhere: z.object({ column: refSchema, values: z.array(z.string().min(1)).min(1) }).strict(),
|
|
39
|
+
/** Who does what: a link table of (resource, kind), and the resources' own order and switches. */
|
|
40
|
+
eligible: z
|
|
41
|
+
.object({
|
|
42
|
+
table: refSchema,
|
|
43
|
+
resource: refSchema,
|
|
44
|
+
kind: refSchema,
|
|
45
|
+
order: z
|
|
46
|
+
.object({
|
|
47
|
+
table: refSchema,
|
|
48
|
+
column: refSchema,
|
|
49
|
+
/** A resource whose column is false is never booked. */
|
|
50
|
+
active: refSchema.optional(),
|
|
51
|
+
/** A resource whose column is false is never booked through the public API. */
|
|
52
|
+
public: refSchema.optional(),
|
|
53
|
+
})
|
|
54
|
+
.strict()
|
|
55
|
+
.optional(),
|
|
56
|
+
})
|
|
57
|
+
.strict(),
|
|
58
|
+
/**
|
|
59
|
+
* Weekly hours as `HH:MM` text, one row per weekday. A resource with rows
|
|
60
|
+
* of its own follows them; one without follows the practice's.
|
|
61
|
+
*/
|
|
62
|
+
hours: z
|
|
63
|
+
.object({
|
|
64
|
+
practice: z.object({ table: refSchema, open: refSchema.optional(), ...hoursColumns }).strict(),
|
|
65
|
+
own: z.object({ table: refSchema, resource: refSchema, ...hoursColumns }).strict().optional(),
|
|
66
|
+
})
|
|
67
|
+
.strict(),
|
|
68
|
+
/** Dated closures, for everyone (resource empty) or one resource. */
|
|
69
|
+
closures: z
|
|
70
|
+
.object({
|
|
71
|
+
table: refSchema,
|
|
72
|
+
from: refSchema,
|
|
73
|
+
to: refSchema,
|
|
74
|
+
resource: refSchema.optional(),
|
|
75
|
+
active: refSchema.optional(),
|
|
76
|
+
})
|
|
77
|
+
.strict()
|
|
78
|
+
.optional(),
|
|
79
|
+
/** The minutes between bookable starts. */
|
|
80
|
+
grid: numberOrSetting,
|
|
81
|
+
/** How many working days ahead a booking may be made. */
|
|
82
|
+
windowDays: numberOrSetting.optional(),
|
|
83
|
+
/** How far ahead a public booking must be. Staff are never held to it. */
|
|
84
|
+
noticeMinutes: numberOrSetting.optional(),
|
|
85
|
+
/**
|
|
86
|
+
* A cancellation inside `hours` of the start. `refuse` turns a public
|
|
87
|
+
* one away; `flag` lets it through and sets `flag`. Staff are never refused.
|
|
88
|
+
*/
|
|
89
|
+
cancel: z
|
|
90
|
+
.object({
|
|
91
|
+
hours: numberOrSetting,
|
|
92
|
+
mode: z.enum(['refuse', 'flag']),
|
|
93
|
+
flag: refSchema.optional(),
|
|
94
|
+
when: z.object({ column: refSchema, to: z.string().min(1) }).strict(),
|
|
95
|
+
})
|
|
96
|
+
.strict()
|
|
97
|
+
.refine((c) => (c.mode === 'flag') === (c.flag !== undefined), {
|
|
98
|
+
message: 'a flag names its column, and only mode "flag" has one',
|
|
99
|
+
path: ['flag'],
|
|
100
|
+
})
|
|
101
|
+
.optional(),
|
|
102
|
+
})
|
|
103
|
+
.strict();
|
|
104
|
+
/**
|
|
105
|
+
* Everything in a table's booking rule that names something the manifest does
|
|
106
|
+
* not declare, or a column of the wrong kind.
|
|
107
|
+
*/
|
|
108
|
+
export function bookingIssues(table, rule, index, at) {
|
|
109
|
+
const out = [];
|
|
110
|
+
const here = (...rest) => at('booking', ...rest);
|
|
111
|
+
/** The column, when it exists and is one of `types`; an issue otherwise. */
|
|
112
|
+
const want = (tableRef, column, types, path, what) => {
|
|
113
|
+
if (index.table(tableRef) === undefined) {
|
|
114
|
+
out.push({ path, message: `"${tableRef}" is not a table of this app` });
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
const found = index.column(tableRef, column);
|
|
118
|
+
if (found === undefined) {
|
|
119
|
+
out.push({ path, message: `"${tableRef}" has no column "${column}"` });
|
|
120
|
+
return undefined;
|
|
121
|
+
}
|
|
122
|
+
if (!types.includes(found.type)) {
|
|
123
|
+
out.push({ path, message: `"${tableRef}.${column}" must be ${what}` });
|
|
124
|
+
return undefined;
|
|
125
|
+
}
|
|
126
|
+
return found;
|
|
127
|
+
};
|
|
128
|
+
/** A foreign key pointing at `target` (any target when omitted). */
|
|
129
|
+
const wantFk = (tableRef, column, target, path) => {
|
|
130
|
+
const found = want(tableRef, column, ['fk'], path, 'a foreign key');
|
|
131
|
+
if (found !== undefined && target !== undefined && found.references !== target) {
|
|
132
|
+
out.push({ path, message: `"${tableRef}.${column}" does not point at "${target}"` });
|
|
133
|
+
}
|
|
134
|
+
return found;
|
|
135
|
+
};
|
|
136
|
+
const setting = (value, path) => {
|
|
137
|
+
const parsed = settingRefSchema.safeParse(value);
|
|
138
|
+
if (parsed.success)
|
|
139
|
+
want(parsed.data.table, parsed.data.column, NUMERIC_TYPES, path, 'a number');
|
|
140
|
+
};
|
|
141
|
+
want(table.ref, rule.start, ['timestamptz'], here('start'), 'a timestamptz');
|
|
142
|
+
want(table.ref, rule.minutes, ['int', 'bigint'], here('minutes'), 'an int');
|
|
143
|
+
const resource = wantFk(table.ref, rule.resource, undefined, here('resource'));
|
|
144
|
+
const kind = wantFk(table.ref, rule.kind, undefined, here('kind'));
|
|
145
|
+
const resourceTable = resource?.references;
|
|
146
|
+
const kindTable = kind?.references;
|
|
147
|
+
const counted = index.column(table.ref, rule.countWhere.column);
|
|
148
|
+
if (counted === undefined) {
|
|
149
|
+
out.push({ path: here('countWhere', 'column'), message: `"${table.ref}" has no column "${rule.countWhere.column}"` });
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
for (const value of rule.countWhere.values) {
|
|
153
|
+
if (!valueFits(counted, value)) {
|
|
154
|
+
out.push({ path: here('countWhere', 'values'), message: `"${value}" is not a value of "${table.ref}.${counted.ref}"` });
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
const eligible = rule.eligible;
|
|
159
|
+
wantFk(eligible.table, eligible.resource, resourceTable, here('eligible', 'resource'));
|
|
160
|
+
wantFk(eligible.table, eligible.kind, kindTable, here('eligible', 'kind'));
|
|
161
|
+
if (eligible.order !== undefined) {
|
|
162
|
+
const order = eligible.order;
|
|
163
|
+
if (resourceTable !== undefined && order.table !== resourceTable) {
|
|
164
|
+
out.push({ path: here('eligible', 'order', 'table'), message: `the order is kept on "${resourceTable}", the table "${rule.resource}" points at` });
|
|
165
|
+
}
|
|
166
|
+
want(order.table, order.column, NUMERIC_TYPES, here('eligible', 'order', 'column'), 'a number');
|
|
167
|
+
for (const name of ['active', 'public']) {
|
|
168
|
+
const column = order[name];
|
|
169
|
+
if (column !== undefined)
|
|
170
|
+
want(order.table, column, ['bool'], here('eligible', 'order', name), 'a bool');
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
const weekday = (tableRef, column, path) => {
|
|
174
|
+
const found = want(tableRef, column, ['enum'], path, `an enum of ${BOOKING_WEEKDAYS.join(', ')}`);
|
|
175
|
+
if (found !== undefined && (found.enum ?? []).join(',') !== BOOKING_WEEKDAYS.join(',')) {
|
|
176
|
+
out.push({ path, message: `"${tableRef}.${column}" must be an enum of ${BOOKING_WEEKDAYS.join(', ')}` });
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
const times = (tableRef, hours, path) => {
|
|
180
|
+
for (const name of ['opens', 'closes', 'breakStart', 'breakEnd']) {
|
|
181
|
+
const column = hours[name];
|
|
182
|
+
if (column !== undefined)
|
|
183
|
+
want(tableRef, column, ['text'], [...path, name], 'a text column holding HH:MM');
|
|
184
|
+
}
|
|
185
|
+
if ((hours['breakStart'] === undefined) !== (hours['breakEnd'] === undefined)) {
|
|
186
|
+
out.push({ path, message: 'a break names both its start and its end' });
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
const practice = rule.hours.practice;
|
|
190
|
+
weekday(practice.table, practice.weekday, here('hours', 'practice', 'weekday'));
|
|
191
|
+
times(practice.table, practice, here('hours', 'practice'));
|
|
192
|
+
if (practice.open !== undefined)
|
|
193
|
+
want(practice.table, practice.open, ['bool'], here('hours', 'practice', 'open'), 'a bool');
|
|
194
|
+
const own = rule.hours.own;
|
|
195
|
+
if (own !== undefined) {
|
|
196
|
+
wantFk(own.table, own.resource, resourceTable, here('hours', 'own', 'resource'));
|
|
197
|
+
weekday(own.table, own.weekday, here('hours', 'own', 'weekday'));
|
|
198
|
+
times(own.table, own, here('hours', 'own'));
|
|
199
|
+
}
|
|
200
|
+
const closures = rule.closures;
|
|
201
|
+
if (closures !== undefined) {
|
|
202
|
+
want(closures.table, closures.from, ['date'], here('closures', 'from'), 'a date');
|
|
203
|
+
want(closures.table, closures.to, ['date'], here('closures', 'to'), 'a date');
|
|
204
|
+
if (closures.resource !== undefined) {
|
|
205
|
+
const column = wantFk(closures.table, closures.resource, resourceTable, here('closures', 'resource'));
|
|
206
|
+
if (column !== undefined && column.nullable !== true) {
|
|
207
|
+
out.push({ path: here('closures', 'resource'), message: `"${closures.table}.${closures.resource}" must be nullable: an empty one closes for everyone` });
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
if (closures.active !== undefined)
|
|
211
|
+
want(closures.table, closures.active, ['bool'], here('closures', 'active'), 'a bool');
|
|
212
|
+
}
|
|
213
|
+
setting(rule.grid, here('grid'));
|
|
214
|
+
if (typeof rule.grid === 'number' && rule.grid === 0)
|
|
215
|
+
out.push({ path: here('grid'), message: 'the grid is at least one minute' });
|
|
216
|
+
setting(rule.windowDays, here('windowDays'));
|
|
217
|
+
setting(rule.noticeMinutes, here('noticeMinutes'));
|
|
218
|
+
if (rule.cancel !== undefined) {
|
|
219
|
+
const cancel = rule.cancel;
|
|
220
|
+
setting(cancel.hours, here('cancel', 'hours'));
|
|
221
|
+
if (cancel.flag !== undefined)
|
|
222
|
+
want(table.ref, cancel.flag, ['bool'], here('cancel', 'flag'), 'a bool');
|
|
223
|
+
if (cancel.when.column !== rule.countWhere.column) {
|
|
224
|
+
out.push({ path: here('cancel', 'when', 'column'), message: `a cancellation is a change of "${rule.countWhere.column}", the column that decides what counts` });
|
|
225
|
+
}
|
|
226
|
+
else if (counted !== undefined) {
|
|
227
|
+
if (!valueFits(counted, cancel.when.to)) {
|
|
228
|
+
out.push({ path: here('cancel', 'when', 'to'), message: `"${cancel.when.to}" is not a value of "${table.ref}.${counted.ref}"` });
|
|
229
|
+
}
|
|
230
|
+
else if (rule.countWhere.values.includes(cancel.when.to)) {
|
|
231
|
+
out.push({ path: here('cancel', 'when', 'to'), message: `"${cancel.when.to}" still counts, so it frees no time` });
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
return out;
|
|
236
|
+
}
|
|
237
|
+
//# sourceMappingURL=booking.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"booking.js","sourceRoot":"","sources":["../src/booking.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;;;;;;;GAaG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EACL,aAAa,EACb,eAAe,EACf,SAAS,EACT,gBAAgB,EAChB,SAAS,GAKV,MAAM,WAAW,CAAC;AAEnB,iFAAiF;AACjF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAU,CAAC;AAE3F,MAAM,YAAY,GAAG;IACnB,OAAO,EAAE,SAAS;IAClB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ION, MANIFEST_KINDS, MANIFEST_CATEGORIES, MANIFEST_CAPABILITIES, RESERVED_KEYS, COLUMN_TYPES, COLUMN_SEMANTICS, COLUMN_ROLES, FRONTEND_KINDS, FIRST_PARTY_PUBLISHER_ID, manifestSchema, appManifestSchema, addOnManifestSchema, manifestKindSchema, addOnIssues, isAddOnManifest, identitySchema, compatibilitySchema, requiredSchemaSchema, requiredTableSchema, requiredColumnSchema, pageSchema, roleSchema, settingSchema, seedSchema, frontendSchema, capabilitySchema, categorySchema, publisherSchema, i18nMessageSchema, compareSemver, type Manifest, type AppManifest, type AddOnManifest, type ManifestKind, type AddOnBlock, type Capability, type Publisher, type I18nMessage, type RequiredTable, type RequiredColumn, } from './schema.js';
|
|
11
|
+
export { MANIFEST_VERSION, MANIFEST_KINDS, MANIFEST_CATEGORIES, MANIFEST_CAPABILITIES, RESERVED_KEYS, COLUMN_TYPES, COLUMN_SEMANTICS, COLUMN_ROLES, FRONTEND_KINDS, FIRST_PARTY_PUBLISHER_ID, manifestSchema, appManifestSchema, addOnManifestSchema, manifestKindSchema, addOnIssues, isAddOnManifest, identitySchema, compatibilitySchema, requiredSchemaSchema, requiredTableSchema, requiredColumnSchema, pageSchema, roleSchema, settingSchema, seedSchema, frontendSchema, capabilitySchema, categorySchema, publisherSchema, i18nMessageSchema, compareSemver, defaultIssue, MAX_TEXT_LENGTH, MAX_TABLE_NAME, prefixFor, appReferenceIssues, columnRulesSchema, capacitySchema, navGroupSchema, publicAccessSchema, publicKeysSchema, sampleDataSchema, labelsSchema, type ColumnRules, type PublicAccess, type Manifest, type AppManifest, type AddOnManifest, type ManifestKind, type AddOnBlock, type Capability, type Publisher, type I18nMessage, type RequiredTable, type RequiredColumn, } from './schema.js';
|
|
12
|
+
export { roleLimitSchema, roleLimitsSchema, type RoleLimit } from './roles.js';
|
|
12
13
|
export { validateManifest, parseManifest, type ValidateManifestResult, type ValidateManifestOptions, type ManifestIssue, } from './validate.js';
|
|
14
|
+
export { BOOKING_WEEKDAYS, bookingSchema, type BookingRule } from './booking.js';
|
|
15
|
+
export { OUTBOX_STATUSES, emailTemplateSchema, outboxSchema, type EmailTemplate, type Outbox, type OutboxProducer, } from './outbox.js';
|
|
16
|
+
export { CUSTOMER_KEY, publicKeySchema, type PublicKey } from './public-access.js';
|
|
17
|
+
export { parseSemverRange, satisfiesSemverRange } from './semver.js';
|
|
13
18
|
export { planInstall, type InstallPlan, type PlannedTable, type PlannedColumn, type PlannedReference, type PlanProblem, type SchemaModelView, type ExistingColumnView, type TableAction, } from './plan.js';
|
|
19
|
+
export { IDENTIFIER_LIMIT, ROLE_SLUG_LIMIT, type PlanContext, type TableChoice, type TableClass, type TableOffer, type PlanEdit, type InstallTablePlan, type TableAction as ContextTableAction, } from './plan-context.js';
|
|
20
|
+
export { SAMPLE_FORMAT, ROW_DIRECTIVES, byClockSchema, isoDurationMs, sampleBundleIssues, sampleBundleSchema, sampleDirective, sampleRowSchema, sampleValueSchema, type ByClock, type SampleBundle, type SampleIssue, type SampleValue, } from './sample.js';
|
|
14
21
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,uBAAuB,CAAC;AAEjD,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,wBAAwB,EACxB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,aAAa,EACb,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY,uBAAuB,CAAC;AAEjD,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,wBAAwB,EACxB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,aAAa,EACb,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,eAAe,EACf,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,EACZ,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,QAAQ,EACb,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAE/E,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,KAAK,sBAAsB,EAC3B,KAAK,uBAAuB,EAC5B,KAAK,aAAa,GACnB,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAEjF,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,cAAc,GACpB,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,KAAK,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEnF,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAErE,OAAO,EACL,WAAW,EACX,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,kBAAkB,EACvB,KAAK,WAAW,GACjB,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,gBAAgB,EAChB,eAAe,EACf,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,KAAK,UAAU,EACf,KAAK,QAAQ,EACb,KAAK,gBAAgB,EACrB,KAAK,WAAW,IAAI,kBAAkB,GACvC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,aAAa,EACb,cAAc,EACd,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,KAAK,OAAO,EACZ,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,WAAW,GACjB,MAAM,aAAa,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,14 @@
|
|
|
9
9
|
* this package does I/O.
|
|
10
10
|
*/
|
|
11
11
|
export const PACKAGE_NAME = '@adminium/manifest';
|
|
12
|
-
export { MANIFEST_VERSION, MANIFEST_KINDS, MANIFEST_CATEGORIES, MANIFEST_CAPABILITIES, RESERVED_KEYS, COLUMN_TYPES, COLUMN_SEMANTICS, COLUMN_ROLES, FRONTEND_KINDS, FIRST_PARTY_PUBLISHER_ID, manifestSchema, appManifestSchema, addOnManifestSchema, manifestKindSchema, addOnIssues, isAddOnManifest, identitySchema, compatibilitySchema, requiredSchemaSchema, requiredTableSchema, requiredColumnSchema, pageSchema, roleSchema, settingSchema, seedSchema, frontendSchema, capabilitySchema, categorySchema, publisherSchema, i18nMessageSchema, compareSemver, } from './schema.js';
|
|
12
|
+
export { MANIFEST_VERSION, MANIFEST_KINDS, MANIFEST_CATEGORIES, MANIFEST_CAPABILITIES, RESERVED_KEYS, COLUMN_TYPES, COLUMN_SEMANTICS, COLUMN_ROLES, FRONTEND_KINDS, FIRST_PARTY_PUBLISHER_ID, manifestSchema, appManifestSchema, addOnManifestSchema, manifestKindSchema, addOnIssues, isAddOnManifest, identitySchema, compatibilitySchema, requiredSchemaSchema, requiredTableSchema, requiredColumnSchema, pageSchema, roleSchema, settingSchema, seedSchema, frontendSchema, capabilitySchema, categorySchema, publisherSchema, i18nMessageSchema, compareSemver, defaultIssue, MAX_TEXT_LENGTH, MAX_TABLE_NAME, prefixFor, appReferenceIssues, columnRulesSchema, capacitySchema, navGroupSchema, publicAccessSchema, publicKeysSchema, sampleDataSchema, labelsSchema, } from './schema.js';
|
|
13
|
+
export { roleLimitSchema, roleLimitsSchema } from './roles.js';
|
|
13
14
|
export { validateManifest, parseManifest, } from './validate.js';
|
|
15
|
+
export { BOOKING_WEEKDAYS, bookingSchema } from './booking.js';
|
|
16
|
+
export { OUTBOX_STATUSES, emailTemplateSchema, outboxSchema, } from './outbox.js';
|
|
17
|
+
export { CUSTOMER_KEY, publicKeySchema } from './public-access.js';
|
|
18
|
+
export { parseSemverRange, satisfiesSemverRange } from './semver.js';
|
|
14
19
|
export { planInstall, } from './plan.js';
|
|
20
|
+
export { IDENTIFIER_LIMIT, ROLE_SLUG_LIMIT, } from './plan-context.js';
|
|
21
|
+
export { SAMPLE_FORMAT, ROW_DIRECTIVES, byClockSchema, isoDurationMs, sampleBundleIssues, sampleBundleSchema, sampleDirective, sampleRowSchema, sampleValueSchema, } from './sample.js';
|
|
15
22
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,oBAAoB,CAAC;AAEjD,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,wBAAwB,EACxB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,aAAa,EACb,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,aAAa,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,oBAAoB,CAAC;AAEjD,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACrB,aAAa,EACb,YAAY,EACZ,gBAAgB,EAChB,YAAY,EACZ,cAAc,EACd,wBAAwB,EACxB,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,WAAW,EACX,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,UAAU,EACV,UAAU,EACV,aAAa,EACb,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,eAAe,EACf,cAAc,EACd,SAAS,EACT,kBAAkB,EAClB,iBAAiB,EACjB,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,YAAY,GAab,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAkB,MAAM,YAAY,CAAC;AAE/E,OAAO,EACL,gBAAgB,EAChB,aAAa,GAId,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAoB,MAAM,cAAc,CAAC;AAEjF,OAAO,EACL,eAAe,EACf,mBAAmB,EACnB,YAAY,GAIb,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,YAAY,EAAE,eAAe,EAAkB,MAAM,oBAAoB,CAAC;AAEnF,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAErE,OAAO,EACL,WAAW,GASZ,MAAM,WAAW,CAAC;AAEnB,OAAO,EACL,gBAAgB,EAChB,eAAe,GAQhB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,aAAa,EACb,cAAc,EACd,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,iBAAiB,GAKlB,MAAM,aAAa,CAAC"}
|
package/dist/outbox.d.ts
ADDED
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `outbox` and `emailTemplates` — the emails an app sends, declared with the
|
|
3
|
+
* app and versioned with it.
|
|
4
|
+
*
|
|
5
|
+
* The app's own table IS the outbox: every email is a row in it, queued by
|
|
6
|
+
* whatever wants it sent (a producer below, the desk's "Send now", an
|
|
7
|
+
* operator), then sent by Adminium, which records `sent`, `failed` or
|
|
8
|
+
* `skipped` on the row. So the table is the log a person reads, and a row of
|
|
9
|
+
* a kind already there for the same source is what stops a second send.
|
|
10
|
+
*
|
|
11
|
+
* Producers queue rows by themselves: when a row is created, when a column
|
|
12
|
+
* changes to a value, or a lead time before a timestamp (a reminder at the
|
|
13
|
+
* time each patient chose).
|
|
14
|
+
*
|
|
15
|
+
* Templates are stored with the app as their owner. An operator who edits
|
|
16
|
+
* one keeps the edit across the app's updates.
|
|
17
|
+
*/
|
|
18
|
+
import { z } from 'zod';
|
|
19
|
+
import { type ReferenceIssue, type TableIndex } from './refs.js';
|
|
20
|
+
/** The statuses an outbox table's status column must offer. */
|
|
21
|
+
export declare const OUTBOX_STATUSES: readonly ["queued", "sent", "failed", "skipped"];
|
|
22
|
+
declare const producerSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
23
|
+
onCreate: z.ZodObject<{
|
|
24
|
+
table: z.ZodString;
|
|
25
|
+
where: z.ZodOptional<z.ZodObject<{
|
|
26
|
+
column: z.ZodString;
|
|
27
|
+
eq: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
28
|
+
in: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
29
|
+
isNull: z.ZodOptional<z.ZodBoolean>;
|
|
30
|
+
}, z.core.$strict>>;
|
|
31
|
+
}, z.core.$strict>;
|
|
32
|
+
kind: z.ZodString;
|
|
33
|
+
link: z.ZodString;
|
|
34
|
+
gate: z.ZodOptional<z.ZodLiteral<"enabled">>;
|
|
35
|
+
optIn: z.ZodOptional<z.ZodLiteral<true>>;
|
|
36
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
37
|
+
onChange: z.ZodObject<{
|
|
38
|
+
table: z.ZodString;
|
|
39
|
+
column: z.ZodString;
|
|
40
|
+
to: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>;
|
|
41
|
+
where: z.ZodOptional<z.ZodObject<{
|
|
42
|
+
column: z.ZodString;
|
|
43
|
+
eq: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
44
|
+
in: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
45
|
+
isNull: z.ZodOptional<z.ZodBoolean>;
|
|
46
|
+
}, z.core.$strict>>;
|
|
47
|
+
}, z.core.$strict>;
|
|
48
|
+
kind: z.ZodString;
|
|
49
|
+
link: z.ZodString;
|
|
50
|
+
gate: z.ZodOptional<z.ZodLiteral<"enabled">>;
|
|
51
|
+
optIn: z.ZodOptional<z.ZodLiteral<true>>;
|
|
52
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
53
|
+
before: z.ZodObject<{
|
|
54
|
+
table: z.ZodString;
|
|
55
|
+
at: z.ZodString;
|
|
56
|
+
lead: z.ZodObject<{
|
|
57
|
+
via: z.ZodString;
|
|
58
|
+
table: z.ZodString;
|
|
59
|
+
column: z.ZodString;
|
|
60
|
+
fallback: z.ZodOptional<z.ZodObject<{
|
|
61
|
+
table: z.ZodString;
|
|
62
|
+
column: z.ZodString;
|
|
63
|
+
}, z.core.$strict>>;
|
|
64
|
+
max: z.ZodNumber;
|
|
65
|
+
}, z.core.$strict>;
|
|
66
|
+
where: z.ZodOptional<z.ZodObject<{
|
|
67
|
+
column: z.ZodString;
|
|
68
|
+
eq: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
69
|
+
in: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
70
|
+
isNull: z.ZodOptional<z.ZodBoolean>;
|
|
71
|
+
}, z.core.$strict>>;
|
|
72
|
+
}, z.core.$strict>;
|
|
73
|
+
kind: z.ZodString;
|
|
74
|
+
link: z.ZodString;
|
|
75
|
+
gate: z.ZodOptional<z.ZodLiteral<"enabled">>;
|
|
76
|
+
optIn: z.ZodOptional<z.ZodLiteral<true>>;
|
|
77
|
+
}, z.core.$strict>]>;
|
|
78
|
+
export type OutboxProducer = z.infer<typeof producerSchema>;
|
|
79
|
+
export declare const outboxSchema: z.ZodObject<{
|
|
80
|
+
table: z.ZodString;
|
|
81
|
+
columns: z.ZodObject<{
|
|
82
|
+
kind: z.ZodString;
|
|
83
|
+
status: z.ZodString;
|
|
84
|
+
to: z.ZodString;
|
|
85
|
+
language: z.ZodOptional<z.ZodString>;
|
|
86
|
+
due: z.ZodOptional<z.ZodString>;
|
|
87
|
+
sentAt: z.ZodOptional<z.ZodString>;
|
|
88
|
+
error: z.ZodOptional<z.ZodString>;
|
|
89
|
+
}, z.core.$strict>;
|
|
90
|
+
links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
91
|
+
recipient: z.ZodObject<{
|
|
92
|
+
via: z.ZodString;
|
|
93
|
+
table: z.ZodString;
|
|
94
|
+
email: z.ZodString;
|
|
95
|
+
name: z.ZodOptional<z.ZodString>;
|
|
96
|
+
language: z.ZodOptional<z.ZodString>;
|
|
97
|
+
optIn: z.ZodOptional<z.ZodString>;
|
|
98
|
+
fallback: z.ZodOptional<z.ZodObject<{
|
|
99
|
+
via: z.ZodString;
|
|
100
|
+
email: z.ZodString;
|
|
101
|
+
name: z.ZodOptional<z.ZodString>;
|
|
102
|
+
language: z.ZodOptional<z.ZodString>;
|
|
103
|
+
}, z.core.$strict>>;
|
|
104
|
+
}, z.core.$strict>;
|
|
105
|
+
settings: z.ZodOptional<z.ZodObject<{
|
|
106
|
+
table: z.ZodString;
|
|
107
|
+
enabled: z.ZodOptional<z.ZodString>;
|
|
108
|
+
name: z.ZodOptional<z.ZodString>;
|
|
109
|
+
phone: z.ZodOptional<z.ZodString>;
|
|
110
|
+
}, z.core.$strict>>;
|
|
111
|
+
pages: z.ZodOptional<z.ZodObject<{
|
|
112
|
+
manage: z.ZodOptional<z.ZodString>;
|
|
113
|
+
booking: z.ZodOptional<z.ZodString>;
|
|
114
|
+
}, z.core.$strict>>;
|
|
115
|
+
kinds: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
116
|
+
producers: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
117
|
+
onCreate: z.ZodObject<{
|
|
118
|
+
table: z.ZodString;
|
|
119
|
+
where: z.ZodOptional<z.ZodObject<{
|
|
120
|
+
column: z.ZodString;
|
|
121
|
+
eq: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
122
|
+
in: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
123
|
+
isNull: z.ZodOptional<z.ZodBoolean>;
|
|
124
|
+
}, z.core.$strict>>;
|
|
125
|
+
}, z.core.$strict>;
|
|
126
|
+
kind: z.ZodString;
|
|
127
|
+
link: z.ZodString;
|
|
128
|
+
gate: z.ZodOptional<z.ZodLiteral<"enabled">>;
|
|
129
|
+
optIn: z.ZodOptional<z.ZodLiteral<true>>;
|
|
130
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
131
|
+
onChange: z.ZodObject<{
|
|
132
|
+
table: z.ZodString;
|
|
133
|
+
column: z.ZodString;
|
|
134
|
+
to: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>, z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>]>;
|
|
135
|
+
where: z.ZodOptional<z.ZodObject<{
|
|
136
|
+
column: z.ZodString;
|
|
137
|
+
eq: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
138
|
+
in: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
139
|
+
isNull: z.ZodOptional<z.ZodBoolean>;
|
|
140
|
+
}, z.core.$strict>>;
|
|
141
|
+
}, z.core.$strict>;
|
|
142
|
+
kind: z.ZodString;
|
|
143
|
+
link: z.ZodString;
|
|
144
|
+
gate: z.ZodOptional<z.ZodLiteral<"enabled">>;
|
|
145
|
+
optIn: z.ZodOptional<z.ZodLiteral<true>>;
|
|
146
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
147
|
+
before: z.ZodObject<{
|
|
148
|
+
table: z.ZodString;
|
|
149
|
+
at: z.ZodString;
|
|
150
|
+
lead: z.ZodObject<{
|
|
151
|
+
via: z.ZodString;
|
|
152
|
+
table: z.ZodString;
|
|
153
|
+
column: z.ZodString;
|
|
154
|
+
fallback: z.ZodOptional<z.ZodObject<{
|
|
155
|
+
table: z.ZodString;
|
|
156
|
+
column: z.ZodString;
|
|
157
|
+
}, z.core.$strict>>;
|
|
158
|
+
max: z.ZodNumber;
|
|
159
|
+
}, z.core.$strict>;
|
|
160
|
+
where: z.ZodOptional<z.ZodObject<{
|
|
161
|
+
column: z.ZodString;
|
|
162
|
+
eq: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
|
|
163
|
+
in: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
164
|
+
isNull: z.ZodOptional<z.ZodBoolean>;
|
|
165
|
+
}, z.core.$strict>>;
|
|
166
|
+
}, z.core.$strict>;
|
|
167
|
+
kind: z.ZodString;
|
|
168
|
+
link: z.ZodString;
|
|
169
|
+
gate: z.ZodOptional<z.ZodLiteral<"enabled">>;
|
|
170
|
+
optIn: z.ZodOptional<z.ZodLiteral<true>>;
|
|
171
|
+
}, z.core.$strict>]>>>;
|
|
172
|
+
}, z.core.$strict>;
|
|
173
|
+
export type Outbox = z.infer<typeof outboxSchema>;
|
|
174
|
+
export declare const emailTemplateSchema: z.ZodObject<{
|
|
175
|
+
key: z.ZodString;
|
|
176
|
+
name: z.ZodUnion<readonly [z.ZodString, z.ZodRecord<z.ZodString, z.ZodString>]>;
|
|
177
|
+
vars: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
178
|
+
locales: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
179
|
+
subject: z.ZodString;
|
|
180
|
+
preheader: z.ZodOptional<z.ZodString>;
|
|
181
|
+
blocks: z.ZodArray<z.ZodObject<{
|
|
182
|
+
block: z.ZodString;
|
|
183
|
+
id: z.ZodOptional<z.ZodString>;
|
|
184
|
+
label: z.ZodOptional<z.ZodString>;
|
|
185
|
+
data: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
186
|
+
}, z.core.$strict>>;
|
|
187
|
+
footer: z.ZodOptional<z.ZodString>;
|
|
188
|
+
}, z.core.$strict>>;
|
|
189
|
+
}, z.core.$strict>;
|
|
190
|
+
export type EmailTemplate = z.infer<typeof emailTemplateSchema>;
|
|
191
|
+
/** Everything in `outbox` and `emailTemplates` that names something undeclared, or does not fit. */
|
|
192
|
+
export declare function outboxIssues(m: {
|
|
193
|
+
key: string;
|
|
194
|
+
outbox?: Outbox | undefined;
|
|
195
|
+
emailTemplates?: readonly EmailTemplate[] | undefined;
|
|
196
|
+
}, index: TableIndex): ReferenceIssue[];
|
|
197
|
+
export {};
|
|
198
|
+
//# sourceMappingURL=outbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"outbox.d.ts","sourceRoot":"","sources":["../src/outbox.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAOL,KAAK,cAAc,EACnB,KAAK,UAAU,EAChB,MAAM,WAAW,CAAC;AAEnB,+DAA+D;AAC/D,eAAO,MAAM,eAAe,kDAAmD,CAAC;AA2BhF,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oBAyClB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAuB5D,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBA6Cd,CAAC;AACZ,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AA4BlD,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;kBAYrB,CAAC;AACZ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,oGAAoG;AACpG,wBAAgB,YAAY,CAC1B,CAAC,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAAC,cAAc,CAAC,EAAE,SAAS,aAAa,EAAE,GAAG,SAAS,CAAA;CAAE,EACtG,KAAK,EAAE,UAAU,GAChB,cAAc,EAAE,CA+IlB"}
|