@adminiumjs/manifest 0.3.0-rc.4 → 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 +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -2
- 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-model.d.ts +1 -1
- package/dist/plan-model.d.ts.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 +101 -1
- package/dist/sample.d.ts.map +1 -1
- package/dist/sample.js +63 -2
- package/dist/sample.js.map +1 -1
- package/dist/schema.d.ts +1109 -121
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +189 -143
- 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
package/dist/schema.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AACA;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6BAM1B,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAC5D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,2DAA2D;AAC3D,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAChE,6CAA6C;AAC7C,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAClE,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG,aAAa,CAAC;AAEnD,YAAY,EAAE,UAAU,EAAE,CAAC;AAE3B,gFAAgF;AAChF,wBAAgB,eAAe,CAAC,CAAC,EAAE,QAAQ,GAAG,CAAC,IAAI,aAAa,CAE/D;AAED;;;GAGG;AACH,wBAAgB,WAAW,CACzB,CAAC,EAAE,QAAQ,EACX,GAAG,GAAE;IACH,sEAAsE;IACtE,YAAY,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACjC,gFAAgF;IAChF,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;CAC3B,GACL;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,CAsGnD"}
|
package/dist/schema.js
CHANGED
|
@@ -11,6 +11,14 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import { addOnBlockSchema, addOnCategorySchema, i18nMessageSchema, isSlotId, } from '@adminium/add-on-contracts';
|
|
13
13
|
import { z } from 'zod';
|
|
14
|
+
import { bookingIssues, bookingSchema } from './booking.js';
|
|
15
|
+
import { pageCalendarIssues } from './page-calendar.js';
|
|
16
|
+
import { emailTemplateSchema, outboxIssues, outboxSchema } from './outbox.js';
|
|
17
|
+
import { publicAccessIssues, publicAccessSchema, publicKeysSchema } from './public-access.js';
|
|
18
|
+
import { roleLimitIssues, roleLimitsSchema } from './roles.js';
|
|
19
|
+
import { NUMERIC_TYPES, labelsSchema, numberOrSetting, refSchema, scalarSchema, tableIndex, textOrLabels, valueFits, } from './refs.js';
|
|
20
|
+
import { compareSemver, parseSemverRange } from './semver.js';
|
|
21
|
+
export { compareSemver };
|
|
14
22
|
/** Integer spec version, frozen at 1 for Adminium 1.x. */
|
|
15
23
|
export const MANIFEST_VERSION = 1;
|
|
16
24
|
/**
|
|
@@ -134,6 +142,21 @@ export const compatibilitySchema = z
|
|
|
134
142
|
*/
|
|
135
143
|
engines: z.array(z.enum(MANIFEST_ENGINES)).min(1).optional(),
|
|
136
144
|
requires: z.array(capabilitySchema).optional(),
|
|
145
|
+
/**
|
|
146
|
+
* The installed versions this release can update in place, as a semver
|
|
147
|
+
* range (`>=0.2.0`). An install outside it is not offered the update and
|
|
148
|
+
* is refused one: a release whose tables changed shape says so here, and
|
|
149
|
+
* the operator is told to uninstall first rather than left with an update
|
|
150
|
+
* that fails half-way. Absent means any older version.
|
|
151
|
+
*/
|
|
152
|
+
updatesFrom: z
|
|
153
|
+
.string()
|
|
154
|
+
.min(1)
|
|
155
|
+
.max(120)
|
|
156
|
+
.refine((range) => parseSemverRange(range) !== null, {
|
|
157
|
+
message: 'a semver range such as ">=0.2.0", "^0.2.0" or ">=0.2.0 <1.0.0"',
|
|
158
|
+
})
|
|
159
|
+
.optional(),
|
|
137
160
|
})
|
|
138
161
|
.strict();
|
|
139
162
|
// ── requiredSchema (create-or-map) ───────────────────────────────────────────
|
|
@@ -167,25 +190,7 @@ export const COLUMN_SEMANTICS = [
|
|
|
167
190
|
];
|
|
168
191
|
/** Structural role markers. */
|
|
169
192
|
export const COLUMN_ROLES = ['pk', 'created_at', 'updated_at'];
|
|
170
|
-
|
|
171
|
-
const refSchema = z.string().regex(/^[a-z][a-z0-9_]*$/, 'must be a snake_case identifier');
|
|
172
|
-
/** A BCP 47 tag, the way every label map in a manifest is keyed (`de-DE`). */
|
|
173
|
-
const bcp47TagSchema = z.string().regex(/^[a-z]{2,3}(-[A-Za-z0-9]{2,8})*$/, 'keyed by BCP 47 tag');
|
|
174
|
-
/** A label in several languages. US English is the one every reader falls back to. */
|
|
175
|
-
export const labelsSchema = z
|
|
176
|
-
.record(bcp47TagSchema, z.string().min(1).max(120))
|
|
177
|
-
.refine((labels) => labels['en-US'] !== undefined, { message: 'labels must include en-US' });
|
|
178
|
-
/** A text that is either one string, or the same text in several languages. */
|
|
179
|
-
const textOrLabels = z.union([z.string().min(1).max(256), labelsSchema]);
|
|
180
|
-
/**
|
|
181
|
-
* A number the manifest states, or one the app's own settings row holds — so
|
|
182
|
-
* a venue can change its capacity without a new release. `{table, column}`
|
|
183
|
-
* reads the one row of that (one-row) table at write time.
|
|
184
|
-
*/
|
|
185
|
-
const numberOrSetting = z.union([
|
|
186
|
-
z.number().int().nonnegative(),
|
|
187
|
-
z.object({ table: refSchema, column: refSchema }).strict(),
|
|
188
|
-
]);
|
|
193
|
+
export { labelsSchema };
|
|
189
194
|
/**
|
|
190
195
|
* The rules an app asks Adminium to keep on a column (written as column-rule
|
|
191
196
|
* overrides at install). The first five are the rules an operator can set in
|
|
@@ -258,6 +263,38 @@ export const columnRulesSchema = z
|
|
|
258
263
|
times: refSchema.optional(),
|
|
259
264
|
/** A child row whose column holds a value is left out — a voided line (`voided_at`). */
|
|
260
265
|
unlessSet: refSchema.optional(),
|
|
266
|
+
/** Only child rows whose column equals the value are added up (`voided = false`). */
|
|
267
|
+
where: z.object({ column: refSchema, eq: scalarSchema }).strict().optional(),
|
|
268
|
+
/**
|
|
269
|
+
* A second column of this row kept in step: `of − Σminus − total`
|
|
270
|
+
* (`balance = fee − waived − paid`). Adminium writes it; nobody else may.
|
|
271
|
+
*/
|
|
272
|
+
balance: z
|
|
273
|
+
.object({ column: refSchema, of: refSchema, minus: z.array(refSchema).max(4).optional() })
|
|
274
|
+
.strict()
|
|
275
|
+
.optional(),
|
|
276
|
+
/** A child write that would take the balance below zero is refused. */
|
|
277
|
+
cap: z.literal(true).optional(),
|
|
278
|
+
})
|
|
279
|
+
.strict()
|
|
280
|
+
.optional(),
|
|
281
|
+
/**
|
|
282
|
+
* A value Adminium writes when something happens: the moment, or who did
|
|
283
|
+
* it, on a create or when another column changes to one of `values`
|
|
284
|
+
* (`checked_in_at` when `status` becomes `checked_in`). `byOrigin` writes
|
|
285
|
+
* one value for a public write and another for staff. A public write never
|
|
286
|
+
* stamps a person: a browser key is nobody.
|
|
287
|
+
*/
|
|
288
|
+
stamp: z
|
|
289
|
+
.object({
|
|
290
|
+
set: z.union([
|
|
291
|
+
z.enum(['now', 'user-name', 'user-id']),
|
|
292
|
+
z.object({ byOrigin: z.object({ public: z.string().min(1), staff: z.string().min(1) }).strict() }).strict(),
|
|
293
|
+
]),
|
|
294
|
+
on: z.union([
|
|
295
|
+
z.literal('create'),
|
|
296
|
+
z.object({ column: refSchema, values: z.array(scalarSchema).min(1).max(16) }).strict(),
|
|
297
|
+
]),
|
|
261
298
|
})
|
|
262
299
|
.strict()
|
|
263
300
|
.optional(),
|
|
@@ -374,6 +411,11 @@ export const requiredColumnSchema = z
|
|
|
374
411
|
* row, so a few long columns would refuse the table.
|
|
375
412
|
*/
|
|
376
413
|
maxLength: z.number().int().min(1).max(MAX_TEXT_LENGTH).optional(),
|
|
414
|
+
/**
|
|
415
|
+
* No two rows may hold the same value (empty values excepted). A text
|
|
416
|
+
* column needs `maxLength`: MySQL indexes no unbounded text.
|
|
417
|
+
*/
|
|
418
|
+
unique: z.literal(true).optional(),
|
|
377
419
|
/** Rules Adminium keeps on the column once installed (see `columnRulesSchema`). */
|
|
378
420
|
rules: columnRulesSchema.optional(),
|
|
379
421
|
/**
|
|
@@ -395,6 +437,10 @@ export const requiredColumnSchema = z
|
|
|
395
437
|
.refine((c) => c.maxLength === undefined || c.type === 'text', {
|
|
396
438
|
message: 'maxLength applies to a text column only',
|
|
397
439
|
path: ['maxLength'],
|
|
440
|
+
})
|
|
441
|
+
.refine((c) => c.unique === undefined || (c.role !== 'pk' && !['json', 'blob'].includes(c.type) && (c.type !== 'text' || c.maxLength !== undefined)), {
|
|
442
|
+
message: 'unique needs a column that can be indexed: not the key, not json or blob, text with maxLength',
|
|
443
|
+
path: ['unique'],
|
|
398
444
|
})
|
|
399
445
|
.superRefine((c, ctx) => {
|
|
400
446
|
const issue = defaultIssue(c);
|
|
@@ -411,6 +457,8 @@ export const requiredTableSchema = z
|
|
|
411
457
|
*/
|
|
412
458
|
shape: z.string().regex(/^[a-z][a-z0-9-]*@\d+$/, 'a shape is <name>@<version>').optional(),
|
|
413
459
|
capacity: capacitySchema.optional(),
|
|
460
|
+
/** Booking people: no two counted rows of one resource may overlap (see `booking.ts`). */
|
|
461
|
+
booking: bookingSchema.optional(),
|
|
414
462
|
/**
|
|
415
463
|
* What a person calls ONE row ("Category") and the table ("Categories"),
|
|
416
464
|
* in every language the app speaks: a form's title and button, a page's
|
|
@@ -431,6 +479,10 @@ export const requiredTableSchema = z
|
|
|
431
479
|
.refine((t) => t.labelPlural === undefined || t.label !== undefined, {
|
|
432
480
|
message: 'labelPlural needs a label',
|
|
433
481
|
path: ['labelPlural'],
|
|
482
|
+
})
|
|
483
|
+
.refine((t) => t.capacity === undefined || t.booking === undefined, {
|
|
484
|
+
message: 'a table has a capacity or a booking rule, not both',
|
|
485
|
+
path: ['booking'],
|
|
434
486
|
});
|
|
435
487
|
export const requiredSchemaSchema = z
|
|
436
488
|
.object({
|
|
@@ -484,6 +536,8 @@ export const roleSchema = z
|
|
|
484
536
|
permissions: z.array(z.string().min(1)).optional(),
|
|
485
537
|
/** Opens the app's own screens and never the dashboard (a till cashier). */
|
|
486
538
|
screensOnly: z.boolean().optional(),
|
|
539
|
+
/** Per table, what the role's update there may write (roles.ts). */
|
|
540
|
+
limits: roleLimitsSchema.optional(),
|
|
487
541
|
})
|
|
488
542
|
.strict();
|
|
489
543
|
// ── settings ─────────────────────────────────────────────────────────────────
|
|
@@ -622,55 +676,8 @@ export const navGroupSchema = z
|
|
|
622
676
|
order: z.number().int(),
|
|
623
677
|
})
|
|
624
678
|
.strict();
|
|
625
|
-
/**
|
|
626
|
-
|
|
627
|
-
* browser key the install creates. `GET` reads, `POST` creates; `PATCH` only
|
|
628
|
-
* behind a claim (a guest changing their own booking), on a narrow writable
|
|
629
|
-
* list. `availability` answers free or full per slot and never a row.
|
|
630
|
-
*/
|
|
631
|
-
export const publicAccessSchema = z
|
|
632
|
-
.object({
|
|
633
|
-
table: refSchema,
|
|
634
|
-
kind: z.enum(['records', 'availability']).optional(),
|
|
635
|
-
methods: z.array(z.enum(['GET', 'POST', 'PATCH'])).min(1),
|
|
636
|
-
select: z.array(refSchema).optional(),
|
|
637
|
-
writable: z.array(refSchema).optional(),
|
|
638
|
-
filters: z
|
|
639
|
-
.array(z
|
|
640
|
-
.object({
|
|
641
|
-
column: refSchema,
|
|
642
|
-
op: z.enum(['eq', 'neq', 'in', 'gte', 'lte']),
|
|
643
|
-
value: z.union([z.string(), z.number(), z.boolean(), z.array(z.union([z.string(), z.number()]))]),
|
|
644
|
-
})
|
|
645
|
-
.strict())
|
|
646
|
-
.optional(),
|
|
647
|
-
/** Values the server writes, whatever the browser sends (`status: confirmed`). */
|
|
648
|
-
defaults: z.record(refSchema, z.union([z.string(), z.number(), z.boolean()])).optional(),
|
|
649
|
-
/** Proving you know a row's details, e.g. `{match: [code, mobile]}`. */
|
|
650
|
-
claim: z.object({ match: z.array(refSchema).min(1).max(3) }).strict().optional(),
|
|
651
|
-
/**
|
|
652
|
-
* The confirmation Adminium emails when a guest creates a row here: the
|
|
653
|
-
* column holding their address, the columns the email shows, the app's
|
|
654
|
-
* one-row venue table, and the path under the guest side that manages it.
|
|
655
|
-
*/
|
|
656
|
-
confirm: z
|
|
657
|
-
.object({
|
|
658
|
-
template: z.enum(['booking-confirmation']),
|
|
659
|
-
to: refSchema,
|
|
660
|
-
code: refSchema.optional(),
|
|
661
|
-
when: refSchema.optional(),
|
|
662
|
-
party: refSchema.optional(),
|
|
663
|
-
name: refSchema.optional(),
|
|
664
|
-
venue: z
|
|
665
|
-
.object({ table: refSchema, name: refSchema.optional(), address: refSchema.optional(), phone: refSchema.optional() })
|
|
666
|
-
.strict()
|
|
667
|
-
.optional(),
|
|
668
|
-
link: z.string().max(200).optional(),
|
|
669
|
-
})
|
|
670
|
-
.strict()
|
|
671
|
-
.optional(),
|
|
672
|
-
})
|
|
673
|
-
.strict();
|
|
679
|
+
/** What the app's public screens may do (see `public-access.ts`). */
|
|
680
|
+
export { publicAccessSchema, publicKeysSchema };
|
|
674
681
|
/** The bundled sample data file, inside the package's `seeds/` folder. */
|
|
675
682
|
export const sampleDataSchema = z
|
|
676
683
|
.object({
|
|
@@ -720,24 +727,42 @@ export function prefixFor(appKey) {
|
|
|
720
727
|
export const MAX_TABLE_NAME = 63;
|
|
721
728
|
/**
|
|
722
729
|
* Every name a manifest's own blocks use must name something the manifest
|
|
723
|
-
* declares: a rule's columns, a capacity's
|
|
724
|
-
*
|
|
725
|
-
*
|
|
730
|
+
* declares: a rule's columns, a capacity's or a booking's columns and tables,
|
|
731
|
+
* a public table and the columns it reads and writes, the outbox and its
|
|
732
|
+
* templates. Checked here so an app's CI refuses a typo long before an
|
|
733
|
+
* operator's install would.
|
|
726
734
|
*/
|
|
727
735
|
export function appReferenceIssues(m) {
|
|
728
736
|
const out = [];
|
|
737
|
+
const index = tableIndex(m.requiredSchema.tables);
|
|
729
738
|
const tables = new Map(m.requiredSchema.tables.map((t) => [t.ref, t]));
|
|
730
|
-
const has =
|
|
739
|
+
const has = index.has;
|
|
740
|
+
/** Per table, the columns Adminium decides and no writer may set. */
|
|
741
|
+
const decided = new Map();
|
|
742
|
+
const decide = (table, column) => {
|
|
743
|
+
const set = decided.get(table) ?? new Set();
|
|
744
|
+
set.add(column);
|
|
745
|
+
decided.set(table, set);
|
|
746
|
+
};
|
|
731
747
|
m.requiredSchema.tables.forEach((table, t) => {
|
|
732
748
|
const at = (...rest) => ['requiredSchema', 'tables', t, ...rest];
|
|
733
749
|
if (m.requiredSchema.prefixed === true && prefixFor(m.key).length + table.ref.length > MAX_TABLE_NAME) {
|
|
734
750
|
out.push({ path: at('ref'), message: `"${prefixFor(m.key)}${table.ref}" is longer than ${String(MAX_TABLE_NAME)} characters` });
|
|
735
751
|
}
|
|
752
|
+
const balances = new Map();
|
|
753
|
+
table.columns.forEach((column) => {
|
|
754
|
+
const balance = column.rules?.rollup?.balance;
|
|
755
|
+
if (balance !== undefined)
|
|
756
|
+
balances.set(balance.column, column.ref);
|
|
757
|
+
});
|
|
736
758
|
table.columns.forEach((column, c) => {
|
|
737
759
|
const rules = column.rules;
|
|
738
760
|
if (rules === undefined)
|
|
739
761
|
return;
|
|
740
762
|
const here = (...rest) => at('columns', c, 'rules', ...rest);
|
|
763
|
+
if (rules.copy !== undefined || rules.sequence !== undefined || rules.code !== undefined || rules.rollup !== undefined || rules.stamp !== undefined) {
|
|
764
|
+
decide(table.ref, column.ref);
|
|
765
|
+
}
|
|
741
766
|
// A list the app ships, or one Adminium has built in; nothing else exists
|
|
742
767
|
// on every install.
|
|
743
768
|
if (rules.options !== undefined && 'list' in rules.options) {
|
|
@@ -770,7 +795,75 @@ export function appReferenceIssues(m) {
|
|
|
770
795
|
if (!has(r.from, name))
|
|
771
796
|
out.push({ path: here('rollup'), message: `"${r.from}" has no column "${name}"` });
|
|
772
797
|
}
|
|
798
|
+
if (r.where !== undefined) {
|
|
799
|
+
const filter = index.column(r.from, r.where.column);
|
|
800
|
+
if (filter === undefined)
|
|
801
|
+
out.push({ path: here('rollup', 'where'), message: `"${r.from}" has no column "${r.where.column}"` });
|
|
802
|
+
else if (!valueFits(filter, r.where.eq))
|
|
803
|
+
out.push({ path: here('rollup', 'where'), message: `${JSON.stringify(r.where.eq)} is not a value of "${r.from}.${r.where.column}"` });
|
|
804
|
+
// An empty value equals nothing: a row left empty would drop out of the total unseen.
|
|
805
|
+
else if (filter.nullable === true)
|
|
806
|
+
out.push({ path: here('rollup', 'where'), message: `"${r.from}.${r.where.column}" may be empty, so a row could drop out of the total; make it not nullable` });
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
if (r.balance !== undefined) {
|
|
810
|
+
const b = r.balance;
|
|
811
|
+
decide(table.ref, b.column);
|
|
812
|
+
for (const [name, ref] of [['column', b.column], ['of', b.of], ...(b.minus ?? []).map((x) => ['minus', x])]) {
|
|
813
|
+
const found = index.column(table.ref, ref);
|
|
814
|
+
if (found === undefined)
|
|
815
|
+
out.push({ path: here('rollup', 'balance', name), message: `"${table.ref}" has no column "${ref}"` });
|
|
816
|
+
else if (!NUMERIC_TYPES.includes(found.type))
|
|
817
|
+
out.push({ path: here('rollup', 'balance', name), message: `"${table.ref}.${ref}" is not a number` });
|
|
818
|
+
}
|
|
819
|
+
if ([b.of, ...(b.minus ?? [])].includes(b.column) || b.column === column.ref) {
|
|
820
|
+
out.push({ path: here('rollup', 'balance', 'column'), message: 'the balance is a column of its own' });
|
|
821
|
+
}
|
|
822
|
+
if (index.column(table.ref, b.column)?.rules !== undefined) {
|
|
823
|
+
out.push({ path: here('rollup', 'balance', 'column'), message: `"${b.column}" is the balance Adminium keeps; it takes no rules of its own` });
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
// A cap holds a balance at zero: this rollup's, or the one that takes
|
|
827
|
+
// this total away (a write-off is capped by the balance it lowers).
|
|
828
|
+
if (r.cap === true && r.balance === undefined) {
|
|
829
|
+
const capped = table.columns.some((x) => x.rules?.rollup?.balance?.minus?.includes(column.ref) === true);
|
|
830
|
+
if (!capped)
|
|
831
|
+
out.push({ path: here('rollup', 'cap'), message: 'a cap needs a balance: declare one here, or subtract this total in one' });
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
if (rules.stamp !== undefined) {
|
|
835
|
+
const stamp = rules.stamp;
|
|
836
|
+
const set = stamp.set;
|
|
837
|
+
if (set === 'now' && column.type !== 'timestamptz') {
|
|
838
|
+
out.push({ path: here('stamp', 'set'), message: 'a "now" stamp needs a timestamptz column' });
|
|
839
|
+
}
|
|
840
|
+
else if ((set === 'user-name' || set === 'user-id') && column.type !== 'text') {
|
|
841
|
+
out.push({ path: here('stamp', 'set'), message: `a "${set}" stamp needs a text column` });
|
|
842
|
+
}
|
|
843
|
+
else if (typeof set === 'object') {
|
|
844
|
+
for (const value of [set.byOrigin.public, set.byOrigin.staff]) {
|
|
845
|
+
if (!valueFits(column, value))
|
|
846
|
+
out.push({ path: here('stamp', 'set'), message: `"${value}" is not a value of "${table.ref}.${column.ref}"` });
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
if (stamp.on !== 'create') {
|
|
850
|
+
const watched = index.column(table.ref, stamp.on.column);
|
|
851
|
+
if (watched === undefined) {
|
|
852
|
+
out.push({ path: here('stamp', 'on', 'column'), message: `"${table.ref}" has no column "${stamp.on.column}"` });
|
|
853
|
+
}
|
|
854
|
+
else if (watched.ref === column.ref) {
|
|
855
|
+
out.push({ path: here('stamp', 'on', 'column'), message: 'a stamp watches another column' });
|
|
856
|
+
}
|
|
857
|
+
else {
|
|
858
|
+
for (const value of stamp.on.values) {
|
|
859
|
+
if (!valueFits(watched, value))
|
|
860
|
+
out.push({ path: here('stamp', 'on', 'values'), message: `${JSON.stringify(value)} is not a value of "${table.ref}.${watched.ref}"` });
|
|
861
|
+
}
|
|
862
|
+
}
|
|
773
863
|
}
|
|
864
|
+
const others = ['copy', 'sequence', 'code', 'rollup'].filter((name) => rules[name] !== undefined);
|
|
865
|
+
if (others.length > 0)
|
|
866
|
+
out.push({ path: here('stamp'), message: `a stamped column is not also decided by ${others.join(', ')}` });
|
|
774
867
|
}
|
|
775
868
|
if ((rules.sequence !== undefined || rules.code !== undefined) && column.role === 'pk') {
|
|
776
869
|
out.push({ path: here(), message: 'a primary key numbers itself; it takes no sequence or code rule' });
|
|
@@ -792,64 +885,22 @@ export function appReferenceIssues(m) {
|
|
|
792
885
|
}
|
|
793
886
|
}
|
|
794
887
|
}
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
out.push({ path: at('table'), message: `"${entry.table}" is not a table of this app` });
|
|
801
|
-
return;
|
|
802
|
-
}
|
|
803
|
-
for (const list of ['select', 'writable']) {
|
|
804
|
-
for (const column of entry[list] ?? []) {
|
|
805
|
-
if (!has(entry.table, column))
|
|
806
|
-
out.push({ path: at(list), message: `"${entry.table}" has no column "${column}"` });
|
|
807
|
-
}
|
|
808
|
-
}
|
|
809
|
-
for (const column of [...(entry.claim?.match ?? []), ...(entry.filters ?? []).map((f) => f.column), ...Object.keys(entry.defaults ?? {})]) {
|
|
810
|
-
if (!has(entry.table, column))
|
|
811
|
-
out.push({ path: at(), message: `"${entry.table}" has no column "${column}"` });
|
|
812
|
-
}
|
|
813
|
-
// A change to an existing row, from a browser, only behind a claim: the
|
|
814
|
-
// guest reaches their own row and nothing else.
|
|
815
|
-
if (entry.methods.includes('PATCH') && entry.claim === undefined) {
|
|
816
|
-
out.push({ path: at('methods'), message: 'PATCH is allowed only with a claim' });
|
|
817
|
-
}
|
|
818
|
-
// Nothing a server decides may be written by a browser.
|
|
819
|
-
for (const column of entry.writable ?? []) {
|
|
820
|
-
const rules = table.columns.find((c) => c.ref === column)?.rules;
|
|
821
|
-
if (rules?.copy !== undefined || rules?.sequence !== undefined || rules?.code !== undefined || rules?.rollup !== undefined) {
|
|
822
|
-
out.push({ path: at('writable'), message: `"${column}" is decided by Adminium and cannot be written publicly` });
|
|
823
|
-
}
|
|
824
|
-
}
|
|
825
|
-
if (entry.confirm !== undefined) {
|
|
826
|
-
const c = entry.confirm;
|
|
827
|
-
for (const [name, column] of [['to', c.to], ['code', c.code], ['when', c.when], ['party', c.party], ['name', c.name]]) {
|
|
828
|
-
if (column !== undefined && !has(entry.table, column))
|
|
829
|
-
out.push({ path: at('confirm', name), message: `"${entry.table}" has no column "${column}"` });
|
|
830
|
-
}
|
|
831
|
-
if (!entry.methods.includes('POST'))
|
|
832
|
-
out.push({ path: at('confirm'), message: 'a confirmation is sent on a create, and this entry creates nothing' });
|
|
833
|
-
if (c.venue !== undefined) {
|
|
834
|
-
if (!tables.has(c.venue.table)) {
|
|
835
|
-
out.push({ path: at('confirm', 'venue', 'table'), message: `"${c.venue.table}" is not a table of this app` });
|
|
836
|
-
}
|
|
837
|
-
else {
|
|
838
|
-
for (const [name, column] of [['name', c.venue.name], ['address', c.venue.address], ['phone', c.venue.phone]]) {
|
|
839
|
-
if (column !== undefined && !has(c.venue.table, column)) {
|
|
840
|
-
out.push({ path: at('confirm', 'venue', name), message: `"${c.venue.table}" has no column "${column}"` });
|
|
841
|
-
}
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
}
|
|
845
|
-
}
|
|
846
|
-
if (entry.kind === 'availability') {
|
|
847
|
-
if (table.capacity === undefined)
|
|
848
|
-
out.push({ path: at('kind'), message: `"${entry.table}" declares no capacity to answer from` });
|
|
849
|
-
if (entry.methods.some((method) => method !== 'GET'))
|
|
850
|
-
out.push({ path: at('methods'), message: 'availability is read-only' });
|
|
888
|
+
if (table.booking !== undefined) {
|
|
889
|
+
out.push(...bookingIssues(table, table.booking, index, at));
|
|
890
|
+
// The late flag is Adminium's to set.
|
|
891
|
+
if (table.booking.cancel?.flag !== undefined)
|
|
892
|
+
decide(table.ref, table.booking.cancel.flag);
|
|
851
893
|
}
|
|
852
894
|
});
|
|
895
|
+
out.push(...publicAccessIssues(m.publicAccess ?? [], {
|
|
896
|
+
index,
|
|
897
|
+
decided: (table) => decided.get(table) ?? new Set(),
|
|
898
|
+
answersAvailability: (table) => tables.get(table)?.capacity !== undefined || tables.get(table)?.booking !== undefined,
|
|
899
|
+
publicKeys: m.publicKeys,
|
|
900
|
+
roles: m.roles ?? [],
|
|
901
|
+
}));
|
|
902
|
+
out.push(...outboxIssues(m, index));
|
|
903
|
+
out.push(...roleLimitIssues(m.roles ?? [], index));
|
|
853
904
|
return out;
|
|
854
905
|
}
|
|
855
906
|
export const appManifestSchema = z
|
|
@@ -879,6 +930,12 @@ export const appManifestSchema = z
|
|
|
879
930
|
/** Keyed by a kebab-case name; a column names one with `options: {list: name}`. */
|
|
880
931
|
optionLists: z.record(z.string().regex(/^[a-z][a-z0-9-]*$/, 'a list name is kebab-case'), optionListSchema).optional(),
|
|
881
932
|
publicAccess: z.array(publicAccessSchema).max(32).optional(),
|
|
933
|
+
/** Browser keys besides the app's own `customer` key (see `public-access.ts`). */
|
|
934
|
+
publicKeys: publicKeysSchema.optional(),
|
|
935
|
+
/** The app's emails: its outbox table and what queues rows in it (see `outbox.ts`). */
|
|
936
|
+
outbox: outboxSchema.optional(),
|
|
937
|
+
/** The templates the outbox sends, in each language the app ships. */
|
|
938
|
+
emailTemplates: z.array(emailTemplateSchema).max(16).optional(),
|
|
882
939
|
sampleData: sampleDataSchema.optional(),
|
|
883
940
|
})
|
|
884
941
|
.strict()
|
|
@@ -889,6 +946,10 @@ export const appManifestSchema = z
|
|
|
889
946
|
for (const issue of appReferenceIssues(m)) {
|
|
890
947
|
ctx.addIssue({ code: 'custom', message: issue.message, path: issue.path });
|
|
891
948
|
}
|
|
949
|
+
// A calendar page's named columns, against the app's own tables.
|
|
950
|
+
for (const issue of pageCalendarIssues(m.pages, tableIndex(m.requiredSchema.tables))) {
|
|
951
|
+
ctx.addIssue({ code: 'custom', message: issue.message, path: issue.path });
|
|
952
|
+
}
|
|
892
953
|
});
|
|
893
954
|
/**
|
|
894
955
|
* `pages`, `roles` and `frontends` are absent from this branch on purpose, and
|
|
@@ -1039,19 +1100,4 @@ export function addOnIssues(m, ctx = {}) {
|
|
|
1039
1100
|
});
|
|
1040
1101
|
return out;
|
|
1041
1102
|
}
|
|
1042
|
-
/**
|
|
1043
|
-
* Numeric semver compare on the release triple (pre-release/build ignored —
|
|
1044
|
-
* enough for the compatibility-window and upgrade ordering checks). Returns
|
|
1045
|
-
* <0, 0, >0. Exported for the installer's upgrade rule.
|
|
1046
|
-
*/
|
|
1047
|
-
export function compareSemver(a, b) {
|
|
1048
|
-
const triple = (v) => v
|
|
1049
|
-
.split('+')[0]
|
|
1050
|
-
.split('-')[0]
|
|
1051
|
-
.split('.')
|
|
1052
|
-
.map((n) => Number.parseInt(n, 10));
|
|
1053
|
-
const [a1 = 0, a2 = 0, a3 = 0] = triple(a);
|
|
1054
|
-
const [b1 = 0, b2 = 0, b3 = 0] = triple(b);
|
|
1055
|
-
return a1 - b1 || a2 - b2 || a3 - b3;
|
|
1056
|
-
}
|
|
1057
1103
|
//# sourceMappingURL=schema.js.map
|