@adminiumjs/manifest 0.3.48 → 0.3.50

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 (81) hide show
  1. package/dist/app-requires.d.ts +66 -0
  2. package/dist/app-requires.d.ts.map +1 -0
  3. package/dist/app-requires.js +98 -0
  4. package/dist/app-requires.js.map +1 -0
  5. package/dist/automations.d.ts +346 -2
  6. package/dist/automations.d.ts.map +1 -1
  7. package/dist/automations.js +64 -7
  8. package/dist/automations.js.map +1 -1
  9. package/dist/compose.d.ts.map +1 -1
  10. package/dist/compose.js +5 -0
  11. package/dist/compose.js.map +1 -1
  12. package/dist/documents.d.ts +49 -0
  13. package/dist/documents.d.ts.map +1 -1
  14. package/dist/documents.js +41 -1
  15. package/dist/documents.js.map +1 -1
  16. package/dist/formula.js +1 -1
  17. package/dist/formula.js.map +1 -1
  18. package/dist/index.d.ts +12 -5
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +12 -5
  21. package/dist/index.js.map +1 -1
  22. package/dist/instance.d.ts +133 -0
  23. package/dist/instance.d.ts.map +1 -0
  24. package/dist/instance.js +157 -0
  25. package/dist/instance.js.map +1 -0
  26. package/dist/outbox.d.ts +79 -0
  27. package/dist/outbox.d.ts.map +1 -1
  28. package/dist/outbox.js +37 -2
  29. package/dist/outbox.js.map +1 -1
  30. package/dist/plan-context.d.ts +9 -0
  31. package/dist/plan-context.d.ts.map +1 -1
  32. package/dist/plan-context.js +74 -9
  33. package/dist/plan-context.js.map +1 -1
  34. package/dist/plan-model.d.ts +9 -2
  35. package/dist/plan-model.d.ts.map +1 -1
  36. package/dist/plan-types.d.ts.map +1 -1
  37. package/dist/plan-types.js +2 -0
  38. package/dist/plan-types.js.map +1 -1
  39. package/dist/public-access.d.ts +23 -0
  40. package/dist/public-access.d.ts.map +1 -1
  41. package/dist/public-access.js +51 -5
  42. package/dist/public-access.js.map +1 -1
  43. package/dist/refs.d.ts +12 -1
  44. package/dist/refs.d.ts.map +1 -1
  45. package/dist/refs.js +23 -2
  46. package/dist/refs.js.map +1 -1
  47. package/dist/roles.d.ts +1 -0
  48. package/dist/roles.d.ts.map +1 -1
  49. package/dist/roles.js +3 -0
  50. package/dist/roles.js.map +1 -1
  51. package/dist/saved-apps.d.ts +132 -0
  52. package/dist/saved-apps.d.ts.map +1 -0
  53. package/dist/saved-apps.js +215 -0
  54. package/dist/saved-apps.js.map +1 -0
  55. package/dist/saved-parts.d.ts +368 -0
  56. package/dist/saved-parts.d.ts.map +1 -0
  57. package/dist/saved-parts.js +232 -0
  58. package/dist/saved-parts.js.map +1 -0
  59. package/dist/schema.d.ts +1433 -50
  60. package/dist/schema.d.ts.map +1 -1
  61. package/dist/schema.js +131 -5
  62. package/dist/schema.js.map +1 -1
  63. package/dist/shapes.js +2 -1
  64. package/dist/shapes.js.map +1 -1
  65. package/dist/states.d.ts +49 -0
  66. package/dist/states.d.ts.map +1 -1
  67. package/dist/states.js +101 -0
  68. package/dist/states.js.map +1 -1
  69. package/dist/table-names.d.ts +82 -0
  70. package/dist/table-names.d.ts.map +1 -0
  71. package/dist/table-names.js +145 -0
  72. package/dist/table-names.js.map +1 -0
  73. package/dist/words.d.ts +1 -1
  74. package/dist/words.d.ts.map +1 -1
  75. package/dist/words.js +212 -0
  76. package/dist/words.js.map +1 -1
  77. package/dist/workspace-file.d.ts +115 -0
  78. package/dist/workspace-file.d.ts.map +1 -0
  79. package/dist/workspace-file.js +130 -0
  80. package/dist/workspace-file.js.map +1 -0
  81. package/package.json +2 -2
@@ -0,0 +1,215 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ /**
3
+ * WHAT A FILE MADE FROM A DASHBOARD CARRIES BESIDE AN ORDINARY APP.
4
+ *
5
+ * Three words only a self-made app (`publisher: local`) may use: a page's
6
+ * whole `envelope` (what a person arranged on a page the generator would not
7
+ * make again), its shared `views`, and the file's `provenance` (where and when
8
+ * it was saved). The published catalogue never carries them. Nor a table's
9
+ * real `name` and `schema` (`table-names.ts`), which only such an app gives.
10
+ *
11
+ * The envelope is typed loosely here — its version, kind, template and body —
12
+ * because the engine's own page schema judges it on the server, at plan, where
13
+ * the template registry is. What a target must make its own (the page's id,
14
+ * its source, its access and its address) is not in it: the install makes them.
15
+ *
16
+ * And the checks that read more than one block: a table's switch names its
17
+ * own postings, a left-out table has no page, an existing-customers mark sits
18
+ * on a people table, a campaign is never what an outbox or a rule sends.
19
+ */
20
+ import { z } from 'zod';
21
+ import { SNAKE_REF } from './refs.js';
22
+ /** The publisher of an app made on an install (`LOCAL_PUBLISHER_ID` in `schema.ts`, which reads this file). */
23
+ const LOCAL_PUBLISHER_ID = 'local';
24
+ /** A page's envelope as the dashboard keeps it, without what the target makes its own. */
25
+ export const pageEnvelopeFieldSchema = z
26
+ .object({
27
+ v: z.number().int().min(1).max(99),
28
+ kind: z.string().regex(/^[a-z][a-z0-9-]*$/, 'a page kind').max(40),
29
+ template: z.string().min(1).max(80),
30
+ config: z.record(z.string(), z.unknown()),
31
+ /** Page chrome: the gutter and the content column, as the engine spells them. */
32
+ padding: z.unknown().optional(),
33
+ width: z.string().min(1).max(20).optional(),
34
+ })
35
+ .strict();
36
+ /** The most shared views one page carries. */
37
+ export const PAGE_VIEWS_MAX = 24;
38
+ /** A shared view of a page, its stored config as is. */
39
+ export const pageViewSchema = z
40
+ .object({
41
+ v: z.number().int().min(1).max(99),
42
+ /** `filters` (a list's saved state) or `layout` (a dashboard's arrangement). */
43
+ kind: z.enum(['filters', 'layout']),
44
+ name: z.string().min(1).max(120),
45
+ isDefault: z.boolean().optional(),
46
+ config: z.record(z.string(), z.unknown()),
47
+ })
48
+ .strict();
49
+ export const pageViewsSchema = z
50
+ .array(pageViewSchema)
51
+ .min(1)
52
+ .max(PAGE_VIEWS_MAX)
53
+ .refine((views) => new Set(views.map((view) => `${view.kind}:${view.name}`)).size === views.length, { message: 'a page names each view once' })
54
+ .refine((views) => ['filters', 'layout'].every((kind) => views.filter((view) => view.kind === kind && view.isDefault === true).length <= 1), {
55
+ message: 'a page has one default view of each kind at most',
56
+ });
57
+ /**
58
+ * Where a self-made app came from: the dashboard's lineage (a random id drawn
59
+ * at its first save, never an id of the instance), when and on which Adminium
60
+ * it was saved, the save's label, and the names of the workspaces its database
61
+ * was in — offered on the target as names, nothing more.
62
+ */
63
+ export const provenanceSchema = z
64
+ .object({
65
+ lineage: z.string().regex(/^[A-Za-z0-9_-]{8,64}$/, 'a lineage is 8 to 64 letters, digits, - or _'),
66
+ savedAt: z.iso.datetime({ offset: true }),
67
+ adminiumVersion: z.string().regex(/^\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?$/, 'an Adminium version'),
68
+ label: z.string().min(1).max(120).optional(),
69
+ workspaces: z.array(z.string().min(1).max(80)).max(32).optional(),
70
+ })
71
+ .strict();
72
+ /**
73
+ * A self-made app's icon: a lucide icon's name, as the product's icon set
74
+ * names it (`coffee`, `shopping-bag`). Where it is installed, the app is shown
75
+ * with it; a name the target's set does not hold falls back to its default.
76
+ */
77
+ export const APP_ICON_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/;
78
+ export const appIconSchema = z.string().max(60).regex(APP_ICON_PATTERN, 'an icon is a lucide icon name in kebab case, such as "coffee"');
79
+ /** The template keys a rule's steps send, at any depth. */
80
+ function ruleTemplateKeys(node, out) {
81
+ if (Array.isArray(node)) {
82
+ for (const item of node)
83
+ ruleTemplateKeys(item, out);
84
+ return;
85
+ }
86
+ if (typeof node !== 'object' || node === null)
87
+ return;
88
+ for (const [key, value] of Object.entries(node)) {
89
+ if (key === 'templateKey' && typeof value === 'string')
90
+ out.add(value);
91
+ else
92
+ ruleTemplateKeys(value, out);
93
+ }
94
+ }
95
+ /**
96
+ * A table's real `name` and `schema`: a self-made app's only, never beside a
97
+ * prefix (which names every table itself), and no two tables under one name
98
+ * once letters are folded — MySQL (`lower_case_table_names`) and SQLite take
99
+ * `Orders` and `orders` for one table.
100
+ */
101
+ function tableNameIssues(m, local, onlyLocal) {
102
+ const out = [];
103
+ const tables = m.requiredSchema?.tables ?? [];
104
+ const seen = new Map();
105
+ tables.forEach((table, t) => {
106
+ for (const word of ['name', 'schema']) {
107
+ if (table[word] === undefined)
108
+ continue;
109
+ if (!local || m.kind !== 'app')
110
+ onlyLocal(['requiredSchema', 'tables', t, word], word);
111
+ if (m.requiredSchema?.prefixed === true) {
112
+ out.push({ path: ['requiredSchema', 'tables', t, word], message: `a prefixed app names its tables itself: "${table.ref}" gives no ${word}` });
113
+ }
114
+ }
115
+ const real = `${(table.schema ?? '').toLowerCase()}\u0000${(table.name ?? table.ref).toLowerCase()}`;
116
+ const held = seen.get(real);
117
+ if (held !== undefined) {
118
+ out.push({ path: ['requiredSchema', 'tables', t, table.name === undefined ? 'ref' : 'name'], message: `"${table.ref}" and "${held}" are one table to a database that ignores case: name them apart` });
119
+ }
120
+ else
121
+ seen.set(real, table.ref);
122
+ });
123
+ return out;
124
+ }
125
+ /**
126
+ * A column's ref is snake_case, except in a self-made app, where a column
127
+ * keeps the name it has in its own database (`orderDate`, `Order Date`): the
128
+ * file names it the same way everywhere. Two columns of a table may not differ
129
+ * by case alone, since MySQL and SQLite read them as one.
130
+ */
131
+ function columnRefIssues(m, local) {
132
+ const out = [];
133
+ (m.requiredSchema?.tables ?? []).forEach((table, t) => {
134
+ const seen = new Map();
135
+ (table.columns ?? []).forEach((column, c) => {
136
+ const at = ['requiredSchema', 'tables', t, 'columns', c, 'ref'];
137
+ if (!SNAKE_REF.test(column.ref) && (!local || m.kind !== 'app')) {
138
+ out.push({ path: at, message: `column ref must be a snake_case identifier ("${column.ref}" is a name only a self-made app may keep)` });
139
+ }
140
+ const folded = column.ref.toLowerCase();
141
+ const held = seen.get(folded);
142
+ if (held !== undefined && held !== column.ref)
143
+ out.push({ path: at, message: `"${column.ref}" and "${held}" are one column to a database that ignores case: name them apart` });
144
+ else
145
+ seen.set(folded, column.ref);
146
+ });
147
+ });
148
+ return out;
149
+ }
150
+ /** Everything wrong with the saved-app words that one block alone cannot see. */
151
+ export function savedAppIssues(m) {
152
+ const out = [];
153
+ const local = m.publisher.id === LOCAL_PUBLISHER_ID;
154
+ const onlyLocal = (path, word) => out.push({ path, message: `"${word}" is carried only by a self-made app (publisher "${LOCAL_PUBLISHER_ID}")` });
155
+ if (m.provenance !== undefined && !local)
156
+ onlyLocal(['provenance'], 'provenance');
157
+ if (m.icon !== undefined && !local)
158
+ onlyLocal(['icon'], 'icon');
159
+ (m.pages ?? []).forEach((page, p) => {
160
+ if (page.envelope !== undefined) {
161
+ if (!local)
162
+ onlyLocal(['pages', p, 'envelope'], 'envelope');
163
+ if (page.envelope.template !== page.template) {
164
+ out.push({ path: ['pages', p, 'envelope', 'template'], message: `the envelope's template is the page's own ("${page.template}")` });
165
+ }
166
+ if (page.config !== undefined) {
167
+ out.push({ path: ['pages', p, 'config'], message: 'a page with an envelope carries its config there, not beside it' });
168
+ }
169
+ }
170
+ if (page.views !== undefined && !local)
171
+ onlyLocal(['pages', p, 'views'], 'views');
172
+ });
173
+ const tables = m.requiredSchema?.tables ?? [];
174
+ out.push(...tableNameIssues(m, local, onlyLocal));
175
+ out.push(...columnRefIssues(m, local));
176
+ const excluded = new Set(tables.filter((table) => table.exclude === true).map((table) => table.ref));
177
+ (m.pages ?? []).forEach((page, p) => {
178
+ for (const [slot, ref] of Object.entries(page.bindings ?? {})) {
179
+ if (excluded.has(ref))
180
+ out.push({ path: ['pages', p, 'bindings', slot], message: `"${ref}" is left out of Adminium (exclude): no page is bound to it` });
181
+ }
182
+ });
183
+ const people = new Set((m.people ?? []).map((entry) => entry.table));
184
+ tables.forEach((table, t) => {
185
+ if (table.existingCustomers === true && !people.has(table.ref)) {
186
+ out.push({ path: ['requiredSchema', 'tables', t, 'existingCustomers'], message: `existing customers are a people table's: list "${table.ref}" in people` });
187
+ }
188
+ const off = table.switchedOff;
189
+ if (off === undefined)
190
+ return;
191
+ const own = new Set((table.postings ?? []).map((posting) => posting.id));
192
+ for (const id of off.postings ?? []) {
193
+ if (!own.has(id))
194
+ out.push({ path: ['requiredSchema', 'tables', t, 'switchedOff', 'postings'], message: `"${id}" is not a posting of "${table.ref}"` });
195
+ }
196
+ if (off.adjust === true && table.adjust === undefined) {
197
+ out.push({ path: ['requiredSchema', 'tables', t, 'switchedOff', 'adjust'], message: `"${table.ref}" has no price rule (adjust) to switch off` });
198
+ }
199
+ });
200
+ const campaigns = new Set((m.emailTemplates ?? []).filter((template) => template.kind === 'campaign').map((template) => template.key));
201
+ if (campaigns.size > 0) {
202
+ const sent = new Set();
203
+ for (const key of Object.values(m.outbox?.kinds ?? {}))
204
+ if (typeof key === 'string')
205
+ sent.add(key);
206
+ ruleTemplateKeys(m.automations, sent);
207
+ (m.emailTemplates ?? []).forEach((template, t) => {
208
+ if (campaigns.has(template.key) && sent.has(template.key)) {
209
+ out.push({ path: ['emailTemplates', t, 'kind'], message: `"${template.key}" is sent by the outbox or a rule, so it is a template, not a campaign` });
210
+ }
211
+ });
212
+ }
213
+ return out;
214
+ }
215
+ //# sourceMappingURL=saved-apps.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"saved-apps.js","sourceRoot":"","sources":["../src/saved-apps.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,+GAA+G;AAC/G,MAAM,kBAAkB,GAAG,OAAO,CAAC;AAEnC,0FAA0F;AAC1F,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,MAAM,CAAC;IACN,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;IAClC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,mBAAmB,EAAE,aAAa,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C;YACvJ,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,368 @@
1
+ /**
2
+ * WHAT ONLY A FILE MADE ON AN ADMINIUM CARRIES.
3
+ *
4
+ * A dashboard someone built by hand holds things no catalog app ships: report
5
+ * documents and invoice layouts written in the builders, reports sent on a
6
+ * schedule, and which tables are payable and how. Saved as an app (publisher
7
+ * `local`), they travel in four blocks of their own:
8
+ *
9
+ * - `reports`: Report Builder documents, by a key of the file's own;
10
+ * - `invoiceLayouts`: invoice templates (a design, never an issued invoice);
11
+ * - `scheduledReports`: a page's report on a schedule. Who it goes to never
12
+ * travels: it arrives switched off with nobody on it, for the owner to choose;
13
+ * - `payments`: payable tables, the ways to pay and the pay page's plain
14
+ * settings. Never a key, a bank account or a contact: those are the owner's
15
+ * to give after the install. Adminium is never a party to a payment.
16
+ *
17
+ * Each block is read only from a file whose publisher is `local`.
18
+ *
19
+ * Pure, and nothing imported from the manifest's own schema file.
20
+ */
21
+ import { z } from 'zod';
22
+ import { type ReferenceIssue, type TableIndex } from './refs.js';
23
+ export declare const SAVED_PART_BLOCKS: readonly ["reports", "invoiceLayouts", "scheduledReports", "payments"];
24
+ /** The most of each a file carries. */
25
+ export declare const SAVED_REPORTS_MAX = 32;
26
+ export declare const SAVED_INVOICE_LAYOUTS_MAX = 32;
27
+ export declare const SAVED_SCHEDULED_REPORTS_MAX = 32;
28
+ /** The largest document body a file carries: the builders' own cap. */
29
+ export declare const SAVED_BODY_MAX_BYTES: number;
30
+ export declare const savedReportSchema: z.ZodObject<{
31
+ key: z.ZodString;
32
+ kind: z.ZodOptional<z.ZodEnum<{
33
+ template: "template";
34
+ report: "report";
35
+ }>>;
36
+ name: z.ZodString;
37
+ status: z.ZodOptional<z.ZodEnum<{
38
+ draft: "draft";
39
+ live: "live";
40
+ sent: "sent";
41
+ }>>;
42
+ body: z.ZodRecord<z.ZodString, z.ZodUnknown>;
43
+ }, z.core.$strict>;
44
+ export type SavedReport = z.infer<typeof savedReportSchema>;
45
+ export declare const INVOICE_LAYOUT_TOPICS: readonly ["recurring", "services", "receipts", "sales", "logistics", "other"];
46
+ export declare const INVOICE_LAYOUT_LANGS: readonly ["en", "de", "fr", "es", "pt", "ja"];
47
+ export declare const savedInvoiceLayoutSchema: z.ZodObject<{
48
+ key: z.ZodString;
49
+ name: z.ZodString;
50
+ topic: z.ZodOptional<z.ZodEnum<{
51
+ receipts: "receipts";
52
+ other: "other";
53
+ recurring: "recurring";
54
+ services: "services";
55
+ sales: "sales";
56
+ logistics: "logistics";
57
+ }>>;
58
+ lang: z.ZodOptional<z.ZodEnum<{
59
+ en: "en";
60
+ de: "de";
61
+ fr: "fr";
62
+ es: "es";
63
+ pt: "pt";
64
+ ja: "ja";
65
+ }>>;
66
+ body: z.ZodRecord<z.ZodString, z.ZodUnknown>;
67
+ }, z.core.$strict>;
68
+ export type SavedInvoiceLayout = z.infer<typeof savedInvoiceLayoutSchema>;
69
+ export declare const savedScheduledReportSchema: z.ZodObject<{
70
+ key: z.ZodString;
71
+ name: z.ZodString;
72
+ page: z.ZodString;
73
+ schedule: z.ZodObject<{
74
+ frequency: z.ZodEnum<{
75
+ daily: "daily";
76
+ weekly: "weekly";
77
+ monthly: "monthly";
78
+ }>;
79
+ dayOfWeek: z.ZodOptional<z.ZodNumber>;
80
+ dayOfMonth: z.ZodOptional<z.ZodNumber>;
81
+ time: z.ZodString;
82
+ }, z.core.$strict>;
83
+ format: z.ZodOptional<z.ZodEnum<{
84
+ pdf: "pdf";
85
+ png: "png";
86
+ }>>;
87
+ }, z.core.$strict>;
88
+ export type SavedScheduledReport = z.infer<typeof savedScheduledReportSchema>;
89
+ /** Which columns of a payable table say what is owed and how it is paid: the payments screen's mapping, by column refs. */
90
+ export declare const savedPayableSchema: z.ZodObject<{
91
+ table: z.ZodString;
92
+ label: z.ZodOptional<z.ZodString>;
93
+ amount: z.ZodObject<{
94
+ column: z.ZodString;
95
+ unit: z.ZodOptional<z.ZodEnum<{
96
+ minor: "minor";
97
+ units: "units";
98
+ }>>;
99
+ }, z.core.$strict>;
100
+ currency: z.ZodUnion<readonly [z.ZodObject<{
101
+ column: z.ZodString;
102
+ }, z.core.$strict>, z.ZodObject<{
103
+ fixed: z.ZodString;
104
+ }, z.core.$strict>, z.ZodObject<{
105
+ connection: z.ZodLiteral<true>;
106
+ }, z.core.$strict>]>;
107
+ due: z.ZodOptional<z.ZodObject<{
108
+ column: z.ZodString;
109
+ }, z.core.$strict>>;
110
+ payments: z.ZodUnion<readonly [z.ZodObject<{
111
+ kind: z.ZodLiteral<"kept">;
112
+ }, z.core.$strict>, z.ZodObject<{
113
+ kind: z.ZodLiteral<"table">;
114
+ table: z.ZodString;
115
+ link: z.ZodString;
116
+ amount: z.ZodString;
117
+ date: z.ZodString;
118
+ method: z.ZodObject<{
119
+ column: z.ZodString;
120
+ values: z.ZodRecord<z.ZodString, z.ZodString>;
121
+ }, z.core.$strict>;
122
+ note: z.ZodOptional<z.ZodString>;
123
+ voided: z.ZodOptional<z.ZodString>;
124
+ reference: z.ZodString;
125
+ refunded: z.ZodOptional<z.ZodString>;
126
+ amountUnit: z.ZodOptional<z.ZodEnum<{
127
+ minor: "minor";
128
+ units: "units";
129
+ }>>;
130
+ }, z.core.$strict>]>;
131
+ status: z.ZodOptional<z.ZodObject<{
132
+ column: z.ZodString;
133
+ paid: z.ZodString;
134
+ refunded: z.ZodOptional<z.ZodString>;
135
+ }, z.core.$strict>>;
136
+ customerEmail: z.ZodOptional<z.ZodString>;
137
+ customerCountry: z.ZodOptional<z.ZodString>;
138
+ pageFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
139
+ }, z.core.$strict>;
140
+ export type SavedPayable = z.infer<typeof savedPayableSchema>;
141
+ /** One way to pay: by hand (`manual`), or a payment service's. Its details (a bank account) never travel. */
142
+ export declare const savedPaymentWaySchema: z.ZodObject<{
143
+ source: z.ZodString;
144
+ method: z.ZodString;
145
+ enabled: z.ZodOptional<z.ZodBoolean>;
146
+ label: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
147
+ rules: z.ZodOptional<z.ZodObject<{
148
+ countries: z.ZodOptional<z.ZodArray<z.ZodString>>;
149
+ currencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
150
+ min: z.ZodOptional<z.ZodString>;
151
+ max: z.ZodOptional<z.ZodString>;
152
+ }, z.core.$strict>>;
153
+ position: z.ZodOptional<z.ZodNumber>;
154
+ }, z.core.$strict>;
155
+ export type SavedPaymentWay = z.infer<typeof savedPaymentWaySchema>;
156
+ export declare const savedPaymentsSchema: z.ZodObject<{
157
+ payables: z.ZodOptional<z.ZodArray<z.ZodObject<{
158
+ table: z.ZodString;
159
+ label: z.ZodOptional<z.ZodString>;
160
+ amount: z.ZodObject<{
161
+ column: z.ZodString;
162
+ unit: z.ZodOptional<z.ZodEnum<{
163
+ minor: "minor";
164
+ units: "units";
165
+ }>>;
166
+ }, z.core.$strict>;
167
+ currency: z.ZodUnion<readonly [z.ZodObject<{
168
+ column: z.ZodString;
169
+ }, z.core.$strict>, z.ZodObject<{
170
+ fixed: z.ZodString;
171
+ }, z.core.$strict>, z.ZodObject<{
172
+ connection: z.ZodLiteral<true>;
173
+ }, z.core.$strict>]>;
174
+ due: z.ZodOptional<z.ZodObject<{
175
+ column: z.ZodString;
176
+ }, z.core.$strict>>;
177
+ payments: z.ZodUnion<readonly [z.ZodObject<{
178
+ kind: z.ZodLiteral<"kept">;
179
+ }, z.core.$strict>, z.ZodObject<{
180
+ kind: z.ZodLiteral<"table">;
181
+ table: z.ZodString;
182
+ link: z.ZodString;
183
+ amount: z.ZodString;
184
+ date: z.ZodString;
185
+ method: z.ZodObject<{
186
+ column: z.ZodString;
187
+ values: z.ZodRecord<z.ZodString, z.ZodString>;
188
+ }, z.core.$strict>;
189
+ note: z.ZodOptional<z.ZodString>;
190
+ voided: z.ZodOptional<z.ZodString>;
191
+ reference: z.ZodString;
192
+ refunded: z.ZodOptional<z.ZodString>;
193
+ amountUnit: z.ZodOptional<z.ZodEnum<{
194
+ minor: "minor";
195
+ units: "units";
196
+ }>>;
197
+ }, z.core.$strict>]>;
198
+ status: z.ZodOptional<z.ZodObject<{
199
+ column: z.ZodString;
200
+ paid: z.ZodString;
201
+ refunded: z.ZodOptional<z.ZodString>;
202
+ }, z.core.$strict>>;
203
+ customerEmail: z.ZodOptional<z.ZodString>;
204
+ customerCountry: z.ZodOptional<z.ZodString>;
205
+ pageFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
206
+ }, z.core.$strict>>>;
207
+ ways: z.ZodOptional<z.ZodArray<z.ZodObject<{
208
+ source: z.ZodString;
209
+ method: z.ZodString;
210
+ enabled: z.ZodOptional<z.ZodBoolean>;
211
+ label: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
212
+ rules: z.ZodOptional<z.ZodObject<{
213
+ countries: z.ZodOptional<z.ZodArray<z.ZodString>>;
214
+ currencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
215
+ min: z.ZodOptional<z.ZodString>;
216
+ max: z.ZodOptional<z.ZodString>;
217
+ }, z.core.$strict>>;
218
+ position: z.ZodOptional<z.ZodNumber>;
219
+ }, z.core.$strict>>>;
220
+ payPage: z.ZodOptional<z.ZodObject<{
221
+ shopName: z.ZodOptional<z.ZodString>;
222
+ shopCountry: z.ZodOptional<z.ZodString>;
223
+ showLines: z.ZodOptional<z.ZodBoolean>;
224
+ }, z.core.$strict>>;
225
+ }, z.core.$strict>;
226
+ export type SavedPayments = z.infer<typeof savedPaymentsSchema>;
227
+ /** The blocks, spread into the app manifest's own object. */
228
+ export declare const savedPartsShape: {
229
+ reports: z.ZodOptional<z.ZodArray<z.ZodObject<{
230
+ key: z.ZodString;
231
+ kind: z.ZodOptional<z.ZodEnum<{
232
+ template: "template";
233
+ report: "report";
234
+ }>>;
235
+ name: z.ZodString;
236
+ status: z.ZodOptional<z.ZodEnum<{
237
+ draft: "draft";
238
+ live: "live";
239
+ sent: "sent";
240
+ }>>;
241
+ body: z.ZodRecord<z.ZodString, z.ZodUnknown>;
242
+ }, z.core.$strict>>>;
243
+ invoiceLayouts: z.ZodOptional<z.ZodArray<z.ZodObject<{
244
+ key: z.ZodString;
245
+ name: z.ZodString;
246
+ topic: z.ZodOptional<z.ZodEnum<{
247
+ receipts: "receipts";
248
+ other: "other";
249
+ recurring: "recurring";
250
+ services: "services";
251
+ sales: "sales";
252
+ logistics: "logistics";
253
+ }>>;
254
+ lang: z.ZodOptional<z.ZodEnum<{
255
+ en: "en";
256
+ de: "de";
257
+ fr: "fr";
258
+ es: "es";
259
+ pt: "pt";
260
+ ja: "ja";
261
+ }>>;
262
+ body: z.ZodRecord<z.ZodString, z.ZodUnknown>;
263
+ }, z.core.$strict>>>;
264
+ scheduledReports: z.ZodOptional<z.ZodArray<z.ZodObject<{
265
+ key: z.ZodString;
266
+ name: z.ZodString;
267
+ page: z.ZodString;
268
+ schedule: z.ZodObject<{
269
+ frequency: z.ZodEnum<{
270
+ daily: "daily";
271
+ weekly: "weekly";
272
+ monthly: "monthly";
273
+ }>;
274
+ dayOfWeek: z.ZodOptional<z.ZodNumber>;
275
+ dayOfMonth: z.ZodOptional<z.ZodNumber>;
276
+ time: z.ZodString;
277
+ }, z.core.$strict>;
278
+ format: z.ZodOptional<z.ZodEnum<{
279
+ pdf: "pdf";
280
+ png: "png";
281
+ }>>;
282
+ }, z.core.$strict>>>;
283
+ payments: z.ZodOptional<z.ZodObject<{
284
+ payables: z.ZodOptional<z.ZodArray<z.ZodObject<{
285
+ table: z.ZodString;
286
+ label: z.ZodOptional<z.ZodString>;
287
+ amount: z.ZodObject<{
288
+ column: z.ZodString;
289
+ unit: z.ZodOptional<z.ZodEnum<{
290
+ minor: "minor";
291
+ units: "units";
292
+ }>>;
293
+ }, z.core.$strict>;
294
+ currency: z.ZodUnion<readonly [z.ZodObject<{
295
+ column: z.ZodString;
296
+ }, z.core.$strict>, z.ZodObject<{
297
+ fixed: z.ZodString;
298
+ }, z.core.$strict>, z.ZodObject<{
299
+ connection: z.ZodLiteral<true>;
300
+ }, z.core.$strict>]>;
301
+ due: z.ZodOptional<z.ZodObject<{
302
+ column: z.ZodString;
303
+ }, z.core.$strict>>;
304
+ payments: z.ZodUnion<readonly [z.ZodObject<{
305
+ kind: z.ZodLiteral<"kept">;
306
+ }, z.core.$strict>, z.ZodObject<{
307
+ kind: z.ZodLiteral<"table">;
308
+ table: z.ZodString;
309
+ link: z.ZodString;
310
+ amount: z.ZodString;
311
+ date: z.ZodString;
312
+ method: z.ZodObject<{
313
+ column: z.ZodString;
314
+ values: z.ZodRecord<z.ZodString, z.ZodString>;
315
+ }, z.core.$strict>;
316
+ note: z.ZodOptional<z.ZodString>;
317
+ voided: z.ZodOptional<z.ZodString>;
318
+ reference: z.ZodString;
319
+ refunded: z.ZodOptional<z.ZodString>;
320
+ amountUnit: z.ZodOptional<z.ZodEnum<{
321
+ minor: "minor";
322
+ units: "units";
323
+ }>>;
324
+ }, z.core.$strict>]>;
325
+ status: z.ZodOptional<z.ZodObject<{
326
+ column: z.ZodString;
327
+ paid: z.ZodString;
328
+ refunded: z.ZodOptional<z.ZodString>;
329
+ }, z.core.$strict>>;
330
+ customerEmail: z.ZodOptional<z.ZodString>;
331
+ customerCountry: z.ZodOptional<z.ZodString>;
332
+ pageFields: z.ZodOptional<z.ZodArray<z.ZodString>>;
333
+ }, z.core.$strict>>>;
334
+ ways: z.ZodOptional<z.ZodArray<z.ZodObject<{
335
+ source: z.ZodString;
336
+ method: z.ZodString;
337
+ enabled: z.ZodOptional<z.ZodBoolean>;
338
+ label: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
339
+ rules: z.ZodOptional<z.ZodObject<{
340
+ countries: z.ZodOptional<z.ZodArray<z.ZodString>>;
341
+ currencies: z.ZodOptional<z.ZodArray<z.ZodString>>;
342
+ min: z.ZodOptional<z.ZodString>;
343
+ max: z.ZodOptional<z.ZodString>;
344
+ }, z.core.$strict>>;
345
+ position: z.ZodOptional<z.ZodNumber>;
346
+ }, z.core.$strict>>>;
347
+ payPage: z.ZodOptional<z.ZodObject<{
348
+ shopName: z.ZodOptional<z.ZodString>;
349
+ shopCountry: z.ZodOptional<z.ZodString>;
350
+ showLines: z.ZodOptional<z.ZodBoolean>;
351
+ }, z.core.$strict>>;
352
+ }, z.core.$strict>>;
353
+ };
354
+ export interface SavedPartsManifest {
355
+ publisher: {
356
+ id: string;
357
+ };
358
+ pages: readonly {
359
+ ref: string;
360
+ }[];
361
+ reports?: readonly SavedReport[] | undefined;
362
+ invoiceLayouts?: readonly SavedInvoiceLayout[] | undefined;
363
+ scheduledReports?: readonly SavedScheduledReport[] | undefined;
364
+ payments?: SavedPayments | undefined;
365
+ }
366
+ /** What the blocks name, against the app's own pages and tables; and that only a file made on an Adminium carries them. */
367
+ export declare function savedPartsIssues(m: SavedPartsManifest, index: TableIndex): ReferenceIssue[];
368
+ //# sourceMappingURL=saved-parts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"saved-parts.d.ts","sourceRoot":"","sources":["../src/saved-parts.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAa,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAK5E,eAAO,MAAM,iBAAiB,wEAAyE,CAAC;AAExG,uCAAuC;AACvC,eAAO,MAAM,iBAAiB,KAAK,CAAC;AACpC,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAC5C,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAE9C,uEAAuE;AACvE,eAAO,MAAM,oBAAoB,QAAkB,CAAC;AAUpD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;kBASnB,CAAC;AACZ,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAE5D,eAAO,MAA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