@adminiumjs/add-on-contracts 0.3.17 → 0.3.18

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.
Files changed (57) hide show
  1. package/dist/add-on-block.d.ts +82 -10
  2. package/dist/add-on-block.d.ts.map +1 -1
  3. package/dist/add-on-block.js +66 -10
  4. package/dist/add-on-block.js.map +1 -1
  5. package/dist/common.d.ts +17 -0
  6. package/dist/common.d.ts.map +1 -1
  7. package/dist/common.js +17 -0
  8. package/dist/common.js.map +1 -1
  9. package/dist/contracts.d.ts +13 -1
  10. package/dist/contracts.d.ts.map +1 -1
  11. package/dist/contracts.js +27 -1
  12. package/dist/contracts.js.map +1 -1
  13. package/dist/document-render.d.ts +8 -7
  14. package/dist/document-render.d.ts.map +1 -1
  15. package/dist/document-render.js +2 -2
  16. package/dist/document-render.js.map +1 -1
  17. package/dist/index.d.ts +4 -1
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +4 -1
  20. package/dist/index.js.map +1 -1
  21. package/dist/posting-rows.d.ts +234 -0
  22. package/dist/posting-rows.d.ts.map +1 -0
  23. package/dist/posting-rows.js +126 -0
  24. package/dist/posting-rows.js.map +1 -0
  25. package/dist/price-adjust.d.ts +274 -0
  26. package/dist/price-adjust.d.ts.map +1 -0
  27. package/dist/price-adjust.js +145 -0
  28. package/dist/price-adjust.js.map +1 -0
  29. package/dist/record-tabs.d.ts +141 -0
  30. package/dist/record-tabs.d.ts.map +1 -0
  31. package/dist/record-tabs.js +167 -0
  32. package/dist/record-tabs.js.map +1 -0
  33. package/dist/runtime/data-types.d.ts +242 -0
  34. package/dist/runtime/data-types.d.ts.map +1 -0
  35. package/dist/runtime/data-types.js +15 -0
  36. package/dist/runtime/data-types.js.map +1 -0
  37. package/dist/runtime/data.d.ts +61 -0
  38. package/dist/runtime/data.d.ts.map +1 -0
  39. package/dist/runtime/data.js +61 -0
  40. package/dist/runtime/data.js.map +1 -0
  41. package/dist/runtime/index.d.ts +51 -1
  42. package/dist/runtime/index.d.ts.map +1 -1
  43. package/dist/runtime/index.js +100 -1
  44. package/dist/runtime/index.js.map +1 -1
  45. package/dist/testing/index.d.ts +2 -0
  46. package/dist/testing/index.d.ts.map +1 -1
  47. package/dist/testing/index.js +2 -0
  48. package/dist/testing/index.js.map +1 -1
  49. package/dist/testing/posting-rows.d.ts +34 -0
  50. package/dist/testing/posting-rows.d.ts.map +1 -0
  51. package/dist/testing/posting-rows.js +225 -0
  52. package/dist/testing/posting-rows.js.map +1 -0
  53. package/dist/testing/price-adjust.d.ts +21 -0
  54. package/dist/testing/price-adjust.d.ts.map +1 -0
  55. package/dist/testing/price-adjust.js +71 -0
  56. package/dist/testing/price-adjust.js.map +1 -0
  57. package/package.json +5 -1
@@ -0,0 +1,167 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ /**
3
+ * A RECORD TAB — an add-on's rows shown on another table's record page.
4
+ *
5
+ * An add-on keeps rows that belong to rows of tables it does not own: the
6
+ * stock links of a menu item, the cards used on an order. It finds them by a
7
+ * pair it stores on each row — a table's stored name and a row's key — and a
8
+ * record tab is how those rows appear where their owner is looked at: a tab
9
+ * on that record's page, listing the add-on's rows for it.
10
+ *
11
+ * The tab is declared, not coded: which of the add-on's tables, which two
12
+ * columns hold the pair, which columns to show and which may be edited there.
13
+ * Adminium draws it with the page's own parts and the reader's own grants.
14
+ *
15
+ * This file is the shape, and the checks an add-on's manifest can make of it
16
+ * by itself.
17
+ */
18
+ import { z } from 'zod';
19
+ import { i18nMessageSchema, wordsByLanguageSchema } from './common.js';
20
+ const ref = z.string().regex(/^[a-z][a-z0-9_]*$/, 'must be a snake_case identifier');
21
+ const kebab = z.string().regex(/^[a-z][a-z0-9-]{0,39}$/, 'a kebab-case id');
22
+ /** The most tabs one add-on declares, and the most columns one tab shows. */
23
+ export const RECORD_TABS_MAX = 6;
24
+ export const RECORD_TAB_COLUMNS_MAX = 8;
25
+ /** A picker of the tab's "add": a row of another own table this one links to, shown by one of its columns. */
26
+ const pickSchema = z.object({ table: ref, label: ref }).strict();
27
+ /** A button in the tab's head that makes a row of another own table for the same record ("Use stock"). */
28
+ const tabActionSchema = z.object({ id: kebab, label: i18nMessageSchema, labels: wordsByLanguageSchema.optional(), child: z.object({ table: ref, form: z.array(ref).min(1).max(RECORD_TAB_COLUMNS_MAX) }).strict() }).strict();
29
+ export const recordTabSchema = z
30
+ .object({
31
+ id: kebab,
32
+ label: i18nMessageSchema,
33
+ /** The label in the other languages: a tab is drawn on a record before any code of the add-on runs. */
34
+ labels: wordsByLanguageSchema.optional(),
35
+ /** The add-on's own table whose rows the tab lists. */
36
+ table: ref,
37
+ /** Its two columns that say which record a row belongs to: a table's stored name, and a row's key. */
38
+ match: z.object({ table: ref, row: ref }).strict(),
39
+ /**
40
+ * Where the tab appears: `linked` — on every table that has a rule into
41
+ * this add-on — or on the tables named, by their stored names.
42
+ */
43
+ on: z.union([z.literal('linked'), z.array(z.string().min(1).max(128)).min(1).max(24)]),
44
+ columns: z.array(ref).min(1).max(RECORD_TAB_COLUMNS_MAX),
45
+ /** The columns a reader who may change the rows edits in place. */
46
+ edit: z.array(ref).min(1).max(RECORD_TAB_COLUMNS_MAX).optional(),
47
+ /** A row is added by picking a row of another own table (an item, or an item or a kit). */
48
+ add: z.object({ pick: z.union([pickSchema, z.array(pickSchema).min(1).max(2)]) }).strict().optional(),
49
+ remove: z.literal(true).optional(),
50
+ /** One row, edited as a form, in place of a list. */
51
+ form: z.array(ref).min(1).max(RECORD_TAB_COLUMNS_MAX).optional(),
52
+ empty: i18nMessageSchema.optional(),
53
+ /** `empty` in the other languages. */
54
+ empties: wordsByLanguageSchema.optional(),
55
+ /** A stock-words id of the add-on whose answer heads the tab. */
56
+ summary: z.object({ words: kebab }).strict().optional(),
57
+ actions: z.array(tabActionSchema).min(1).max(2).optional(),
58
+ })
59
+ .strict();
60
+ export const recordTabsSchema = z
61
+ .array(recordTabSchema)
62
+ .min(1)
63
+ .max(RECORD_TABS_MAX)
64
+ .refine((tabs) => new Set(tabs.map((tab) => tab.id)).size === tabs.length, { message: 'two record tabs share an id' });
65
+ /** The rules through which Adminium fills a column itself: nobody edits it. */
66
+ const DECIDING = ['copy', 'sequence', 'code', 'rollup', 'stamp', 'formula', 'format', 'lookup', 'perNight', 'customerKey', 'codeLast4'];
67
+ /**
68
+ * Everything wrong with an add-on's record tabs that its own manifest can
69
+ * see: a table or a column that is not its own, a pair that is not a stored
70
+ * table name and a row's key, a column edited that Adminium decides, a picker
71
+ * the table does not link to, a summary that names no words.
72
+ */
73
+ export function recordTabIssues(m) {
74
+ const out = [];
75
+ const tables = new Map(m.tables.map((table) => [table.ref, table]));
76
+ m.tabs.forEach((tab, t) => {
77
+ const at = (...rest) => ['addOn', 'recordTabs', t, ...rest];
78
+ const table = tables.get(tab.table);
79
+ if (table === undefined) {
80
+ out.push({ path: at('table'), message: `"${tab.table}" is not one of this add-on's own tables` });
81
+ return;
82
+ }
83
+ const column = (of, name) => of.columns.find((candidate) => candidate.ref === name);
84
+ const decided = (of, name) => {
85
+ const found = column(of, name);
86
+ return found === undefined || found.role === 'pk' || DECIDING.some((rule) => found.rules?.[rule] !== undefined) || of.columns.some((other) => other.rules?.['rollup']?.balance?.column === name);
87
+ };
88
+ /** The two columns that hold the pair, on any table that carries rows for a record. */
89
+ const pair = (of, path) => {
90
+ const name = column(of, tab.match.table);
91
+ const row = column(of, tab.match.row);
92
+ if (name === undefined || name.type !== 'text' || name.rules?.['tableRef'] !== true) {
93
+ out.push({ path: [...path, 'table'], message: `"${of.ref}.${tab.match.table}" says which table a row belongs to: a text column with rules.tableRef` });
94
+ }
95
+ if (row === undefined || row.type !== 'text')
96
+ out.push({ path: [...path, 'row'], message: `"${of.ref}.${tab.match.row}" holds the key of the row it belongs to: a text column` });
97
+ };
98
+ pair(table, at('match'));
99
+ const shown = new Set(tab.columns);
100
+ const matched = new Set([tab.match.table, tab.match.row]);
101
+ tab.columns.forEach((name, c) => {
102
+ if (column(table, name) === undefined)
103
+ out.push({ path: at('columns', c), message: `"${tab.table}" has no column "${name}"` });
104
+ });
105
+ (tab.edit ?? []).forEach((name, e) => {
106
+ if (!shown.has(name))
107
+ out.push({ path: at('edit', e), message: `"${name}" is edited where it is shown: list it in "columns" too` });
108
+ else if (matched.has(name))
109
+ out.push({ path: at('edit', e), message: `"${name}" says which record the row belongs to: nobody edits it` });
110
+ else if (decided(table, name))
111
+ out.push({ path: at('edit', e), message: `"${tab.table}.${name}" is decided by Adminium: nobody edits it` });
112
+ });
113
+ (tab.form ?? []).forEach((name, f) => {
114
+ if (column(table, name) === undefined)
115
+ out.push({ path: at('form', f), message: `"${tab.table}" has no column "${name}"` });
116
+ else if (!shown.has(name))
117
+ out.push({ path: at('form', f), message: `the form is the same row the tab shows: list "${name}" in "columns" too` });
118
+ else if (matched.has(name))
119
+ out.push({ path: at('form', f), message: `"${name}" says which record the row belongs to: no form asks for it` });
120
+ });
121
+ const picks = tab.add === undefined ? [] : Array.isArray(tab.add.pick) ? tab.add.pick : [tab.add.pick];
122
+ const picked = new Set();
123
+ picks.forEach((pick, p) => {
124
+ const path = at('add', 'pick', ...(Array.isArray(tab.add?.pick) ? [p] : []));
125
+ const other = tables.get(pick.table);
126
+ if (other === undefined) {
127
+ out.push({ path: [...path, 'table'], message: `"${pick.table}" is not one of this add-on's own tables` });
128
+ return;
129
+ }
130
+ if (picked.has(pick.table))
131
+ out.push({ path: [...path, 'table'], message: `"${pick.table}" is picked from twice` });
132
+ picked.add(pick.table);
133
+ const links = table.columns.filter((candidate) => candidate.type === 'fk' && candidate.references === pick.table);
134
+ if (links.length !== 1)
135
+ out.push({ path: [...path, 'table'], message: `a picked row is linked by one foreign key: "${tab.table}" has ${links.length === 0 ? 'none' : String(links.length)} to "${pick.table}"` });
136
+ if (column(other, pick.label) === undefined)
137
+ out.push({ path: [...path, 'label'], message: `"${pick.table}" has no column "${pick.label}"` });
138
+ });
139
+ if (tab.summary !== undefined && !m.words.includes(tab.summary.words)) {
140
+ out.push({ path: at('summary', 'words'), message: `"${tab.summary.words}" is not one of this add-on's stock words (addOn.words)` });
141
+ }
142
+ const ids = new Set();
143
+ (tab.actions ?? []).forEach((action, a) => {
144
+ const path = at('actions', a);
145
+ if (ids.has(action.id))
146
+ out.push({ path: [...path, 'id'], message: `two actions of the tab share the id "${action.id}"` });
147
+ ids.add(action.id);
148
+ const child = tables.get(action.child.table);
149
+ if (child === undefined) {
150
+ out.push({ path: [...path, 'child', 'table'], message: `"${action.child.table}" is not one of this add-on's own tables` });
151
+ return;
152
+ }
153
+ // The row it makes belongs to the same record, so it carries the same pair — which no form asks for.
154
+ pair(child, [...path, 'child']);
155
+ action.child.form.forEach((name, f) => {
156
+ if (column(child, name) === undefined)
157
+ out.push({ path: [...path, 'child', 'form', f], message: `"${child.ref}" has no column "${name}"` });
158
+ else if (matched.has(name))
159
+ out.push({ path: [...path, 'child', 'form', f], message: `"${name}" says which record the row belongs to: no form asks for it` });
160
+ else if (decided(child, name))
161
+ out.push({ path: [...path, 'child', 'form', f], message: `"${child.ref}.${name}" is decided by Adminium: no form asks for it` });
162
+ });
163
+ });
164
+ });
165
+ return out;
166
+ }
167
+ //# sourceMappingURL=record-tabs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record-tabs.js","sourceRoot":"","sources":["../src/record-tabs.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEvE,MAAM,GAAG,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,mBAAmB,EAAE,iCAAiC,CAAC,CAAC;AACrF,MAAM,KAAK,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,wBAAwB,EAAE,iBAAiB,CAAC,CAAC;AAE5E,6EAA6E;AAC7E,MAAM,C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AE,OAAO,EAAE,IAAI,IAAI,6DAA6D,EAAE,CAAC,CAAC;qBACzJ,IAAI,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC;oBAAE,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,KAAK,CAAC,GAAG,IAAI,IAAI,+CAA+C,EAAE,CAAC,CAAC;YAClK,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,242 @@
1
+ /**
2
+ * THE DATA KIT'S SIGNATURES — what `host.data` holds, as a page reads it.
3
+ *
4
+ * A page of an add-on that keeps tables reads and writes them through hooks
5
+ * the host publishes, with the signed-in reader's own grants: nothing a page
6
+ * can do here is something that reader could not do on a generated page.
7
+ * Tables are named by the add-on's OWN short names; the host finds the real
8
+ * table and the connection from the add-on's install.
9
+ *
10
+ * Types only. A host checks itself against them (`satisfies AddOnDataHooks`)
11
+ * without importing the shim, which reads the host at module load.
12
+ */
13
+ /** A value as a row holds it: decimals and money are text, so no figure is rounded on the way. */
14
+ export type DataValue = string | number | boolean | null;
15
+ export type DataRow = Readonly<Record<string, DataValue>>;
16
+ /** One filter of a list: a column, how it is compared, and with what. */
17
+ export interface DataFilter {
18
+ column: string;
19
+ op: 'eq' | 'neq' | 'in' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'empty' | 'notEmpty';
20
+ value?: DataValue | readonly DataValue[];
21
+ }
22
+ export interface DataSort {
23
+ column: string;
24
+ direction: 'asc' | 'desc';
25
+ }
26
+ /** A refusal as the page may show it: the server's code, its sentence, and what it says of the row. */
27
+ export interface DataError {
28
+ code: string;
29
+ message: string;
30
+ details?: Readonly<Record<string, unknown>>;
31
+ }
32
+ export interface UseRecordsOptions {
33
+ filter?: readonly DataFilter[];
34
+ sort?: readonly DataSort[];
35
+ page?: number;
36
+ pageSize?: number;
37
+ /** The columns to read; absent, every column the reader may see. */
38
+ columns?: readonly string[];
39
+ /** Read nothing while false (a list that waits for a choice). */
40
+ enabled?: boolean;
41
+ }
42
+ export interface UseRecordsResult {
43
+ rows: readonly DataRow[];
44
+ /** Whether a later page exists. The server filters and pages; the page never holds the whole table. */
45
+ hasMore: boolean;
46
+ loading: boolean;
47
+ error: DataError | null;
48
+ refetch: () => void;
49
+ }
50
+ export interface UseRecordResult {
51
+ row: DataRow | null;
52
+ loading: boolean;
53
+ error: DataError | null;
54
+ refetch: () => void;
55
+ }
56
+ /** What a ledger said of one save: whether its answer was written, and what it told staff of the line. */
57
+ export interface PostingSaid {
58
+ ledger: string;
59
+ state: string;
60
+ reason?: string;
61
+ left?: string;
62
+ notes?: readonly {
63
+ line: number;
64
+ note: string;
65
+ }[];
66
+ }
67
+ /** One row's outcome of a write made row by row. */
68
+ export type EachResult = {
69
+ key: string;
70
+ ok: true;
71
+ row: DataRow;
72
+ postings?: readonly PostingSaid[];
73
+ } | {
74
+ key: string;
75
+ ok: false;
76
+ error: DataError;
77
+ } | {
78
+ key: string;
79
+ ok: false;
80
+ notRun: true;
81
+ };
82
+ /**
83
+ * A code Adminium made that is shown once and stored nowhere it can be read
84
+ * again (a gift card's): handed to whoever made the row, with the ticket a
85
+ * print of it takes.
86
+ */
87
+ export interface OnceValue {
88
+ table: string;
89
+ key: string;
90
+ column: string;
91
+ value: string;
92
+ print: string;
93
+ }
94
+ export interface WriteResult {
95
+ /** The row as it was saved, with every column Adminium decided. */
96
+ row: DataRow;
97
+ once?: readonly OnceValue[];
98
+ /** What each ledger the save posted into said of it; absent where it posted into none. */
99
+ postings?: readonly PostingSaid[];
100
+ }
101
+ export interface UseWriteResult {
102
+ create: (values: Readonly<Record<string, DataValue>>) => Promise<WriteResult>;
103
+ update: (key: string | number, values: Readonly<Record<string, DataValue>>) => Promise<WriteResult>;
104
+ remove: (key: string | number) => Promise<void>;
105
+ /** The same change to up to 500 rows, one save each: what a bulk change is where a save may post. */
106
+ /** `from`: the state every row was seen in — a row that moved meanwhile is refused, never moved twice. */
107
+ updateEach: (keys: readonly (string | number)[], values: Readonly<Record<string, DataValue>>, options?: {
108
+ from?: string;
109
+ }) => Promise<readonly EachResult[]>;
110
+ /** Up to 500 rows made, one save each. */
111
+ createEach: (rows: readonly Readonly<Record<string, DataValue>>[]) => Promise<readonly EachResult[]>;
112
+ saving: boolean;
113
+ error: DataError | null;
114
+ }
115
+ /**
116
+ * Reads made when something happens — a scan, a run over a sheet's lines —
117
+ * and not while the page is drawn: the same routes and the same grants as
118
+ * the lists, answered as a promise.
119
+ */
120
+ export interface UseReadResult {
121
+ list: (table: string, options?: Omit<UseRecordsOptions, 'enabled'>) => Promise<{
122
+ rows: readonly DataRow[];
123
+ hasMore: boolean;
124
+ }>;
125
+ /** One row by its key; null where there is none the reader may see. */
126
+ get: (table: string, key: string | number) => Promise<DataRow | null>;
127
+ }
128
+ /** A row with the rows that belong to it, made in one save. */
129
+ export interface TreeNode {
130
+ values: Readonly<Record<string, DataValue>>;
131
+ children?: Readonly<Record<string, readonly TreeNode[]>>;
132
+ }
133
+ export interface UseTreeWriteResult {
134
+ create: (tree: TreeNode) => Promise<WriteResult>;
135
+ /** What the save would do, with nothing written. */
136
+ dryRun: (tree: TreeNode) => Promise<Readonly<Record<string, unknown>>>;
137
+ saving: boolean;
138
+ error: DataError | null;
139
+ }
140
+ /** Moves a row along its states by one of its table's declared actions: the action's id, and what its confirm asked for. */
141
+ export type UseStateMoveResult = (key: string | number, actionId: string, values?: Readonly<Record<string, DataValue>>) => Promise<WriteResult>;
142
+ export interface UseAccessResult {
143
+ /** False until the reader's grants are known. */
144
+ ready: boolean;
145
+ canRead: (table: string, columns?: readonly string[]) => boolean;
146
+ canCreate: (table: string) => boolean;
147
+ canUpdate: (table: string) => boolean;
148
+ /** Whether the reader may make this declared action of the table, from the state a row is in. */
149
+ canMove: (table: string, actionId: string, from?: string) => boolean;
150
+ /** Whether the add-on is connected to something that offers this (`has` of the kit's one read). */
151
+ has: (feature: string) => boolean;
152
+ /** The currency of the database the add-on's tables are in (ISO 4217); null when the owner set none. Absent on a host older than 0.3.18. */
153
+ currency?: string | null;
154
+ }
155
+ export interface LookUpAnswer {
156
+ kind: string;
157
+ table: string;
158
+ key: string;
159
+ /** The columns the add-on's `lookUp` shows of the row. Never the code itself. */
160
+ row: DataRow;
161
+ rows?: readonly DataRow[];
162
+ /** How the row was found: by the code typed, or by a customer's address. */
163
+ by?: 'code' | 'address';
164
+ /** The last four of the stored code, for "the card ending Q4XP"; null where there is no code to end. */
165
+ last4?: string | null;
166
+ /** An address only: how many further rows it matched. */
167
+ more?: number;
168
+ }
169
+ export interface UseLookUpResult {
170
+ /** One typed or scanned value, tried against each kind the add-on declares. Null: nothing found. */
171
+ find: (typed: string) => Promise<LookUpAnswer | null>;
172
+ finding: boolean;
173
+ error: DataError | null;
174
+ }
175
+ /** What a ledger says of one row with nothing written. The staff fields are present only for a reader of the stock tables. */
176
+ export interface WordsAnswer {
177
+ id: string;
178
+ state: 'in' | 'low' | 'out';
179
+ left?: string;
180
+ exact?: string;
181
+ after?: string;
182
+ batch?: string;
183
+ expires?: string;
184
+ cause?: 'stock' | 'portions';
185
+ first?: {
186
+ item: string;
187
+ unit: string;
188
+ };
189
+ soon?: boolean;
190
+ }
191
+ export interface UseWordsResult {
192
+ /** `table`: the host table's stored name; `ids`: up to 60 of its rows' keys. */
193
+ ask: (table: string, ids: readonly (string | number)[]) => Promise<readonly WordsAnswer[]>;
194
+ }
195
+ export interface OpenDocumentOptions {
196
+ /** Open the print dialog once it is drawn. */
197
+ print?: boolean;
198
+ paper?: string;
199
+ /** The ticket of a code shown once (`OnceValue.print`). */
200
+ once?: string;
201
+ values?: Readonly<Record<string, DataValue>>;
202
+ locale?: string;
203
+ }
204
+ export interface UseDocumentResult {
205
+ open: (kind: string, table: string, key: string | number, options?: OpenDocumentOptions) => Promise<void>;
206
+ opening: boolean;
207
+ error: DataError | null;
208
+ }
209
+ export interface UseExportResult {
210
+ /** Starts an export of a table's rows; answers its id. */
211
+ start: (table: string, options: {
212
+ filter?: readonly DataFilter[];
213
+ columns?: readonly string[];
214
+ format: 'csv' | 'xlsx';
215
+ }) => Promise<string>;
216
+ download: (id: string) => Promise<void>;
217
+ running: boolean;
218
+ error: DataError | null;
219
+ }
220
+ /** The data kit's hooks, by name. */
221
+ export interface AddOnDataHooks {
222
+ useRecords: (table: string, options?: UseRecordsOptions) => UseRecordsResult;
223
+ useRecord: (table: string, key: string | number | null) => UseRecordResult;
224
+ useRead: () => UseReadResult;
225
+ useWrite: (table: string) => UseWriteResult;
226
+ useTreeWrite: (table: string) => UseTreeWriteResult;
227
+ useStateMove: (table: string) => UseStateMoveResult;
228
+ useAccess: () => UseAccessResult;
229
+ useLookUp: (addOnKey?: string) => UseLookUpResult;
230
+ useWords: (wordsId: string) => UseWordsResult;
231
+ useDocument: () => UseDocumentResult;
232
+ useExport: () => UseExportResult;
233
+ }
234
+ /**
235
+ * What `host.data` is: its version, the hooks above, and the components of
236
+ * `ADD_ON_DATA_EXPORTS` — each the host's own, so a page looks and behaves
237
+ * like the rest of the dashboard.
238
+ */
239
+ export type AddOnDataKit = {
240
+ readonly version: number;
241
+ } & AddOnDataHooks & Readonly<Record<string, unknown>>;
242
+ //# sourceMappingURL=data-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-types.d.ts","sourceRoot":"","sources":["../../src/runtime/data-types.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;GAWG;AAEH,kGAAkG;AAClG,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;AACzD,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC;AAE1D,yEAAyE;AACzE,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAA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CAAC;IAC7E,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,KAAK,eAAe,CAAC;IAC3E,OAAO,EAAE,MAAM,aAAa,CAAC;IAC7B,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,cAAc,CAAC;IAC5C,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,kBAAkB,CAAC;IACpD,YAAY,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,kBAAkB,CAAC;IACpD,SAAS,EAAE,MAAM,eAAe,CAAC;IACjC,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,KAAK,eAAe,CAAC;IAClD,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,cAAc,CAAC;IAC9C,WAAW,EAAE,MAAM,iBAAiB,CAAC;IACrC,SAAS,EAAE,MAAM,eAAe,CAAC;CAClC;AAED;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ /**
3
+ * THE DATA KIT'S SIGNATURES — what `host.data` holds, as a page reads it.
4
+ *
5
+ * A page of an add-on that keeps tables reads and writes them through hooks
6
+ * the host publishes, with the signed-in reader's own grants: nothing a page
7
+ * can do here is something that reader could not do on a generated page.
8
+ * Tables are named by the add-on's OWN short names; the host finds the real
9
+ * table and the connection from the add-on's install.
10
+ *
11
+ * Types only. A host checks itself against them (`satisfies AddOnDataHooks`)
12
+ * without importing the shim, which reads the host at module load.
13
+ */
14
+ export {};
15
+ //# sourceMappingURL=data-types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data-types.js","sourceRoot":"","sources":["../../src/runtime/data-types.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;;;;;GAWG"}
@@ -0,0 +1,61 @@
1
+ /**
2
+ * The data kit's shim: what a page bundle's build aliases
3
+ * `@adminium/add-on-data` to (see `./index.ts`), so the page lays itself out
4
+ * with the HOST's parts and reads and writes its add-on's tables through the
5
+ * HOST's hooks — the signed-in reader's grants, the dashboard's own cache.
6
+ *
7
+ * The names are `ADD_ON_DATA_EXPORTS` and nothing else; `add-on-host.test.ts`
8
+ * holds the two equal. Importing this module on a host that publishes no kit,
9
+ * or an older one, throws `AddOnHostTooOld` — which the host shows as "This
10
+ * page needs a newer Adminium."
11
+ */
12
+ declare const data: Readonly<Record<string, unknown>> & {
13
+ readonly version: number;
14
+ };
15
+ export declare const Card: never;
16
+ export declare const Grid: never;
17
+ export declare const Stack: never;
18
+ export declare const Sheet: never;
19
+ export declare const SheetHeader: never;
20
+ export declare const SheetBody: never;
21
+ export declare const SheetFooter: never;
22
+ export declare const StickyBar: never;
23
+ export declare const Divider: never;
24
+ export declare const Skeleton: never;
25
+ export declare const DataTable: never;
26
+ export declare const Stat: never;
27
+ export declare const KeyValueList: never;
28
+ export declare const StatusPill: never;
29
+ export declare const ProgressBar: never;
30
+ export declare const Pagination: never;
31
+ export declare const MonoText: never;
32
+ export declare const Field: never;
33
+ export declare const Input: never;
34
+ export declare const NumberInput: never;
35
+ export declare const Textarea: never;
36
+ export declare const DateInput: never;
37
+ export declare const Select: never;
38
+ export declare const Combobox: never;
39
+ export declare const Switch: never;
40
+ export declare const Checkbox: never;
41
+ export declare const RadioGroup: never;
42
+ export declare const RadioCard: never;
43
+ export declare const ToggleChip: never;
44
+ export declare const InputGroup: never;
45
+ export declare const Menu: never;
46
+ export declare const MenuItem: never;
47
+ export declare const ConfirmModal: never;
48
+ export declare const Link: never;
49
+ export declare const useRecords: never;
50
+ export declare const useRecord: never;
51
+ export declare const useRead: never;
52
+ export declare const useWrite: never;
53
+ export declare const useTreeWrite: never;
54
+ export declare const useStateMove: never;
55
+ export declare const useAccess: never;
56
+ export declare const useLookUp: never;
57
+ export declare const useWords: never;
58
+ export declare const useDocument: never;
59
+ export declare const useExport: never;
60
+ export default data;
61
+ //# sourceMappingURL=data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../src/runtime/data.ts"],"names":[],"mappings":"AACA;;;;;;;;;;GAUG;AAIH,QAAA,MAAM,IAAI;;CAAqB,CAAC;AAEhC,eAAO,MAAM,IAAI,EAAmB,KAAK,CAAC;AAC1C,eAAO,MAAM,IAAI,EAAmB,KAAK,CAAC;AAC1C,eAAO,MAAM,KAAK,EAAoB,KAAK,CAAC;AAC5C,eAAO,MAAM,KAAK,EAAoB,KAAK,CAAC;AAC5C,eAAO,MAAM,WAAW,EAA0B,KAAK,CAAC;AACxD,eAAO,MAAM,SAAS,EAAwB,KAAK,CAAC;AACpD,eAAO,MAAM,WAAW,EAA0B,KAAK,CAAC;AACxD,eAAO,MAAM,SAAS,EAAwB,KAAK,CAAC;AACpD,eAAO,MAAM,OAAO,EAAsB,KAAK,CAAC;AAChD,eAAO,MAAM,QAAQ,EAAuB,KAAK,CAAC;AAClD,eAAO,MAAM,SAAS,EAAwB,KAAK,CAAC;AACpD,eAAO,MAAM,IAAI,EAAmB,KAAK,CAAC;AAC1C,eAAO,MAAM,YAAY,EAA2B,KAAK,CAAC;AAC1D,eAAO,MAAM,UAAU,EAAyB,KAAK,CAAC;AACtD,eAAO,MAAM,WAAW,EAA0B,KAAK,CAAC;AACxD,eAAO,MAAM,UAAU,EAAyB,KAAK,CAAC;AACtD,eAAO,MAAM,QAAQ,EAAuB,KAAK,CAAC;AAClD,eAAO,MAAM,KAAK,EAAoB,KAAK,CAAC;AAC5C,eAAO,MAAM,KAAK,EAAoB,KAAK,CAAC;AAC5C,eAAO,MAAM,WAAW,EAA0B,KAAK,CAAC;AACxD,eAAO,MAAM,QAAQ,EAAuB,KAAK,CAAC;AAClD,eAAO,MAAM,SAAS,EAAwB,KAAK,CAAC;AACpD,eAAO,MAAM,MAAM,EAAqB,KAAK,CAAC;AAC9C,eAAO,MAAM,QAAQ,EAAuB,KAAK,CAAC;AAClD,eAAO,MAAM,MAAM,EAAqB,KAAK,CAAC;AAC9C,eAAO,MAAM,QAAQ,EAAuB,KAAK,CAAC;AAClD,eAAO,MAAM,UAAU,EAAyB,KAAK,CAAC;AACtD,eAAO,MAAM,SAAS,EAAwB,KAAK,CAAC;AACpD,eAAO,MAAM,UAAU,EAAyB,KAAK,CAAC;AACtD,eAAO,MAAM,UAAU,EAAyB,KAAK,CAAC;AACtD,eAAO,MAAM,IAAI,EAAmB,KAAK,CAAC;AAC1C,eAAO,MAAM,QAAQ,EAAuB,KAAK,CAAC;AAClD,eAAO,MAAM,YAAY,EAA2B,KAAK,CAAC;AAC1D,eAAO,MAAM,IAAI,EAAmB,KAAK,CAAC;AAC1C,eAAO,MAAM,UAAU,EAAyB,KAAK,CAAC;AACtD,eAAO,MAAM,SAAS,EAAwB,KAAK,CAAC;AACpD,eAAO,MAAM,OAAO,EAAsB,KAAK,CAAC;AAChD,eAAO,MAAM,QAAQ,EAAuB,KAAK,CAAC;AAClD,eAAO,MAAM,YAAY,EAA2B,KAAK,CAAC;AAC1D,eAAO,MAAM,YAAY,EAA2B,KAAK,CAAC;AAC1D,eAAO,MAAM,SAAS,EAAwB,KAAK,CAAC;AACpD,eAAO,MAAM,SAAS,EAAwB,KAAK,CAAC;AACpD,eAAO,MAAM,QAAQ,EAAuB,KAAK,CAAC;AAClD,eAAO,MAAM,WAAW,EAA0B,KAAK,CAAC;AACxD,eAAO,MAAM,SAAS,EAAwB,KAAK,CAAC;AAEpD,eAAe,IAAI,CAAC"}
@@ -0,0 +1,61 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ /**
3
+ * The data kit's shim: what a page bundle's build aliases
4
+ * `@adminium/add-on-data` to (see `./index.ts`), so the page lays itself out
5
+ * with the HOST's parts and reads and writes its add-on's tables through the
6
+ * HOST's hooks — the signed-in reader's grants, the dashboard's own cache.
7
+ *
8
+ * The names are `ADD_ON_DATA_EXPORTS` and nothing else; `add-on-host.test.ts`
9
+ * holds the two equal. Importing this module on a host that publishes no kit,
10
+ * or an older one, throws `AddOnHostTooOld` — which the host shows as "This
11
+ * page needs a newer Adminium."
12
+ */
13
+ import { requireAddOnData } from './index.js';
14
+ const data = requireAddOnData();
15
+ export const Card = data['Card'];
16
+ export const Grid = data['Grid'];
17
+ export const Stack = data['Stack'];
18
+ export const Sheet = data['Sheet'];
19
+ export const SheetHeader = data['SheetHeader'];
20
+ export const SheetBody = data['SheetBody'];
21
+ export const SheetFooter = data['SheetFooter'];
22
+ export const StickyBar = data['StickyBar'];
23
+ export const Divider = data['Divider'];
24
+ export const Skeleton = data['Skeleton'];
25
+ export const DataTable = data['DataTable'];
26
+ export const Stat = data['Stat'];
27
+ export const KeyValueList = data['KeyValueList'];
28
+ export const StatusPill = data['StatusPill'];
29
+ export const ProgressBar = data['ProgressBar'];
30
+ export const Pagination = data['Pagination'];
31
+ export const MonoText = data['MonoText'];
32
+ export const Field = data['Field'];
33
+ export const Input = data['Input'];
34
+ export const NumberInput = data['NumberInput'];
35
+ export const Textarea = data['Textarea'];
36
+ export const DateInput = data['DateInput'];
37
+ export const Select = data['Select'];
38
+ export const Combobox = data['Combobox'];
39
+ export const Switch = data['Switch'];
40
+ export const Checkbox = data['Checkbox'];
41
+ export const RadioGroup = data['RadioGroup'];
42
+ export const RadioCard = data['RadioCard'];
43
+ export const ToggleChip = data['ToggleChip'];
44
+ export const InputGroup = data['InputGroup'];
45
+ export const Menu = data['Menu'];
46
+ export const MenuItem = data['MenuItem'];
47
+ export const ConfirmModal = data['ConfirmModal'];
48
+ export const Link = data['Link'];
49
+ export const useRecords = data['useRecords'];
50
+ export const useRecord = data['useRecord'];
51
+ export const useRead = data['useRead'];
52
+ export const useWrite = data['useWrite'];
53
+ export const useTreeWrite = data['useTreeWrite'];
54
+ export const useStateMove = data['useStateMove'];
55
+ export const useAccess = data['useAccess'];
56
+ export const useLookUp = data['useLookUp'];
57
+ export const useWords = data['useWords'];
58
+ export const useDocument = data['useDocument'];
59
+ export const useExport = data['useExport'];
60
+ export default data;
61
+ //# sourceMappingURL=data.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"data.js","sourceRoot":"","sources":["../../src/runtime/data.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;;;;GAUG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,IAAI,GAAG,gBAAgB,EAAE,CAAC;AAEhC,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAU,CAAC;AAC1C,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAU,CAAC;AAC1C,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAU,CAAC;AAC5C,MAAM,CAAC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAU,CAAC;AAC5C,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAU,CAAC;AACxD,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAU,CAAC;AACpD,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,aAAa,CAAU,CAAC;AACxD,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAU,CAAC;AACpD,MAAM,CAAC,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAU,CAAC;AAChD,MAAM,CAAC,MAAM,QAAQ,GAAG,IAAI,CAAC,UAAU,CAAU,CAAC;AAClD,MAAM,CAAC,MAAM,SAAS,GAAG,IAAI,CAAC,WAAW,CAAU,CAAC;AACpD,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAU,CAAC;AAC1C,MAAM,CAAC,MAAM,YAAY,GAAG,IAAI,CAAC,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