@adminiumjs/manifest 0.3.47 → 0.3.49

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 (71) 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 +11 -4
  19. package/dist/index.d.ts.map +1 -1
  20. package/dist/index.js +11 -4
  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/saved-apps.d.ts +132 -0
  48. package/dist/saved-apps.d.ts.map +1 -0
  49. package/dist/saved-apps.js +215 -0
  50. package/dist/saved-apps.js.map +1 -0
  51. package/dist/saved-parts.d.ts +368 -0
  52. package/dist/saved-parts.d.ts.map +1 -0
  53. package/dist/saved-parts.js +232 -0
  54. package/dist/saved-parts.js.map +1 -0
  55. package/dist/schema.d.ts +1395 -52
  56. package/dist/schema.d.ts.map +1 -1
  57. package/dist/schema.js +131 -5
  58. package/dist/schema.js.map +1 -1
  59. package/dist/table-names.d.ts +82 -0
  60. package/dist/table-names.d.ts.map +1 -0
  61. package/dist/table-names.js +145 -0
  62. package/dist/table-names.js.map +1 -0
  63. package/dist/words.d.ts +1 -1
  64. package/dist/words.d.ts.map +1 -1
  65. package/dist/words.js +206 -0
  66. package/dist/words.js.map +1 -1
  67. package/dist/workspace-file.d.ts +115 -0
  68. package/dist/workspace-file.d.ts.map +1 -0
  69. package/dist/workspace-file.js +130 -0
  70. package/dist/workspace-file.js.map +1 -0
  71. package/package.json +2 -2
@@ -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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B;;;;;;;;;;;;kBAiBvB,CAAC;AACZ,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;kBAUrB,CAAC;AACZ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE,6DAA6D;AAC7D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAK3B,CAAC;AAEF,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1B,KAAK,EAAE,SAAS;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAClC,OAAO,CAAC,EAAE,SAAS,WAAW,EAAE,GAAG,SAAS,CAAC;IAC7C,cAAc,CAAC,EAAE,SAAS,kBAAkB,EAAE,GAAG,SAAS,CAAC;IAC3D,gBAAgB,CAAC,EAAE,SAAS,oBAAoB,EAAE,GAAG,SAAS,CAAC;IAC/D,QAAQ,CAAC,EAAE,aAAa,GAAG,SAAS,CAAC;CACtC;AAaD,2HAA2H;AAC3H,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,kBAAkB,EAAE,KAAK,EAAE,UAAU,GAAG,cAAc,EAAE,CAyD3F"}
@@ -0,0 +1,232 @@
1
+ // SPDX-License-Identifier: AGPL-3.0-only
2
+ /**
3
+ * WHAT ONLY A FILE MADE ON AN ADMINIUM CARRIES.
4
+ *
5
+ * A dashboard someone built by hand holds things no catalog app ships: report
6
+ * documents and invoice layouts written in the builders, reports sent on a
7
+ * schedule, and which tables are payable and how. Saved as an app (publisher
8
+ * `local`), they travel in four blocks of their own:
9
+ *
10
+ * - `reports`: Report Builder documents, by a key of the file's own;
11
+ * - `invoiceLayouts`: invoice templates (a design, never an issued invoice);
12
+ * - `scheduledReports`: a page's report on a schedule. Who it goes to never
13
+ * travels: it arrives switched off with nobody on it, for the owner to choose;
14
+ * - `payments`: payable tables, the ways to pay and the pay page's plain
15
+ * settings. Never a key, a bank account or a contact: those are the owner's
16
+ * to give after the install. Adminium is never a party to a payment.
17
+ *
18
+ * Each block is read only from a file whose publisher is `local`.
19
+ *
20
+ * Pure, and nothing imported from the manifest's own schema file.
21
+ */
22
+ import { z } from 'zod';
23
+ import { refSchema } from './refs.js';
24
+ /** The publisher of a file made on an Adminium. */
25
+ const LOCAL = 'local';
26
+ export const SAVED_PART_BLOCKS = ['reports', 'invoiceLayouts', 'scheduledReports', 'payments'];
27
+ /** The most of each a file carries. */
28
+ export const SAVED_REPORTS_MAX = 32;
29
+ export const SAVED_INVOICE_LAYOUTS_MAX = 32;
30
+ export const SAVED_SCHEDULED_REPORTS_MAX = 32;
31
+ /** The largest document body a file carries: the builders' own cap. */
32
+ export const SAVED_BODY_MAX_BYTES = 4 * 1024 * 1024;
33
+ const partKey = z.string().regex(/^[a-z][a-z0-9-]{0,79}$/, 'a key is kebab-case, at most 80 characters');
34
+ const partName = z.string().trim().min(1).max(120);
35
+ /** A builder's document, as the builder stores it: checked whole by the server that installs it. */
36
+ const bodySchema = z
37
+ .record(z.string(), z.unknown())
38
+ .refine((body) => new TextEncoder().encode(JSON.stringify(body)).length <= SAVED_BODY_MAX_BYTES, { message: 'a document body is at most 4 MiB' });
39
+ export const savedReportSchema = z
40
+ .object({
41
+ key: partKey,
42
+ /** A reusable layout, or a report built from one. Default: a report. */
43
+ kind: z.enum(['report', 'template']).optional(),
44
+ name: partName,
45
+ status: z.enum(['draft', 'sent', 'live']).optional(),
46
+ body: bodySchema,
47
+ })
48
+ .strict();
49
+ export const INVOICE_LAYOUT_TOPICS = ['recurring', 'services', 'receipts', 'sales', 'logistics', 'other'];
50
+ export const INVOICE_LAYOUT_LANGS = ['en', 'de', 'fr', 'es', 'pt', 'ja'];
51
+ export const savedInvoiceLayoutSchema = z
52
+ .object({
53
+ key: partKey,
54
+ name: partName,
55
+ topic: z.enum(INVOICE_LAYOUT_TOPICS).optional(),
56
+ lang: z.enum(INVOICE_LAYOUT_LANGS).optional(),
57
+ body: bodySchema,
58
+ })
59
+ .strict();
60
+ const HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
61
+ export const savedScheduledReportSchema = z
62
+ .object({
63
+ key: partKey,
64
+ name: partName,
65
+ /** One of the app's pages, by its ref. */
66
+ page: z.string().regex(/^[a-z][a-z0-9-]*$/, 'a page ref'),
67
+ /** When it goes, in the database's own zone: a file names none. */
68
+ schedule: z
69
+ .object({
70
+ frequency: z.enum(['daily', 'weekly', 'monthly']),
71
+ /** 0 = Sunday; weekly only. */
72
+ dayOfWeek: z.number().int().min(0).max(6).optional(),
73
+ /** Monthly only. */
74
+ dayOfMonth: z.number().int().min(1).max(31).optional(),
75
+ time: z.string().regex(HHMM, 'a time such as 08:00'),
76
+ })
77
+ .strict(),
78
+ format: z.enum(['pdf', 'png']).optional(),
79
+ })
80
+ .strict();
81
+ // ── payments ─────────────────────────────────────────────────────────────────
82
+ const currencyCode = z.string().regex(/^[A-Z]{3}$/, 'a currency code such as EUR');
83
+ /** How a payment lands in the table's OWN payments table, column by column. */
84
+ const ownPaymentsSchema = z
85
+ .object({
86
+ kind: z.literal('table'),
87
+ table: refSchema,
88
+ link: refSchema,
89
+ amount: refSchema,
90
+ date: refSchema,
91
+ method: z.object({ column: refSchema, values: z.record(z.string().min(1).max(64), z.string().min(1).max(255)) }).strict(),
92
+ note: refSchema.optional(),
93
+ voided: refSchema.optional(),
94
+ reference: refSchema,
95
+ refunded: refSchema.optional(),
96
+ amountUnit: z.enum(['units', 'minor']).optional(),
97
+ })
98
+ .strict();
99
+ /** Which columns of a payable table say what is owed and how it is paid: the payments screen's mapping, by column refs. */
100
+ export const savedPayableSchema = z
101
+ .object({
102
+ table: refSchema,
103
+ label: refSchema.optional(),
104
+ amount: z.object({ column: refSchema, unit: z.enum(['units', 'minor']).optional() }).strict(),
105
+ currency: z.union([z.object({ column: refSchema }).strict(), z.object({ fixed: currencyCode }).strict(), z.object({ connection: z.literal(true) }).strict()]),
106
+ due: z.object({ column: refSchema }).strict().optional(),
107
+ payments: z.union([z.object({ kind: z.literal('kept') }).strict(), ownPaymentsSchema]),
108
+ status: z.object({ column: refSchema, paid: z.string().min(1).max(255), refunded: z.string().min(1).max(255).optional() }).strict().optional(),
109
+ customerEmail: refSchema.optional(),
110
+ customerCountry: refSchema.optional(),
111
+ pageFields: z.array(refSchema).max(50).optional(),
112
+ })
113
+ .strict()
114
+ .refine((payable) => payable.payments.kind === 'kept' || payable.due !== undefined, { message: 'a table that keeps its own payments names its balance column', path: ['due'] });
115
+ /** One way to pay: by hand (`manual`), or a payment service's. Its details (a bank account) never travel. */
116
+ export const savedPaymentWaySchema = z
117
+ .object({
118
+ source: z.string().regex(/^[a-z][a-z0-9-]{1,79}$/, 'a payment service, or "manual"'),
119
+ method: z.string().regex(/^[a-z][a-z0-9_-]{0,63}$/, 'a way to pay'),
120
+ enabled: z.boolean().optional(),
121
+ label: z.record(z.string().min(2).max(10), z.string().trim().min(1).max(60)).optional(),
122
+ rules: z
123
+ .object({
124
+ countries: z.array(z.string().regex(/^[A-Z]{2}$/)).max(250).optional(),
125
+ currencies: z.array(currencyCode).max(200).optional(),
126
+ min: z.string().regex(/^\d+(\.\d+)?$/).optional(),
127
+ max: z.string().regex(/^\d+(\.\d+)?$/).optional(),
128
+ })
129
+ .strict()
130
+ .optional(),
131
+ position: z.number().int().min(0).max(1000).optional(),
132
+ })
133
+ .strict();
134
+ export const savedPaymentsSchema = z
135
+ .object({
136
+ payables: z.array(savedPayableSchema).max(16).optional(),
137
+ ways: z.array(savedPaymentWaySchema).max(32).optional(),
138
+ /** The pay page's plain settings: its name, the shop's country, whether lines are listed. Never a logo or a contact. */
139
+ payPage: z
140
+ .object({ shopName: z.string().trim().min(1).max(120).optional(), shopCountry: z.string().regex(/^[A-Z]{2}$/).optional(), showLines: z.boolean().optional() })
141
+ .strict()
142
+ .optional(),
143
+ })
144
+ .strict();
145
+ /** The blocks, spread into the app manifest's own object. */
146
+ export const savedPartsShape = {
147
+ reports: z.array(savedReportSchema).max(SAVED_REPORTS_MAX).optional(),
148
+ invoiceLayouts: z.array(savedInvoiceLayoutSchema).max(SAVED_INVOICE_LAYOUTS_MAX).optional(),
149
+ scheduledReports: z.array(savedScheduledReportSchema).max(SAVED_SCHEDULED_REPORTS_MAX).optional(),
150
+ payments: savedPaymentsSchema.optional(),
151
+ };
152
+ /** Two entries of a block that share a key. */
153
+ function twiceIssues(block, entries) {
154
+ const seen = new Set();
155
+ const out = [];
156
+ entries.forEach((entry, n) => {
157
+ if (seen.has(entry.key))
158
+ out.push({ path: [block, n, 'key'], message: `"${entry.key}" is the key of another entry of ${block}` });
159
+ seen.add(entry.key);
160
+ });
161
+ return out;
162
+ }
163
+ /** What the blocks name, against the app's own pages and tables; and that only a file made on an Adminium carries them. */
164
+ export function savedPartsIssues(m, index) {
165
+ const out = [];
166
+ for (const block of SAVED_PART_BLOCKS) {
167
+ if (m[block] !== undefined && m.publisher.id !== LOCAL)
168
+ out.push({ path: [block], message: `"${block}" is read only from a file made on an Adminium (publisher "${LOCAL}")` });
169
+ }
170
+ out.push(...twiceIssues('reports', m.reports ?? []), ...twiceIssues('invoiceLayouts', m.invoiceLayouts ?? []), ...twiceIssues('scheduledReports', m.scheduledReports ?? []));
171
+ const pages = new Set(m.pages.map((page) => page.ref));
172
+ (m.scheduledReports ?? []).forEach((report, r) => {
173
+ if (!pages.has(report.page))
174
+ out.push({ path: ['scheduledReports', r, 'page'], message: `"${report.page}" is not one of this app's pages` });
175
+ const { frequency, dayOfWeek, dayOfMonth } = report.schedule;
176
+ if (frequency === 'weekly' && dayOfWeek === undefined)
177
+ out.push({ path: ['scheduledReports', r, 'schedule', 'dayOfWeek'], message: 'a weekly report names its day (0 = Sunday)' });
178
+ if (frequency === 'monthly' && dayOfMonth === undefined)
179
+ out.push({ path: ['scheduledReports', r, 'schedule', 'dayOfMonth'], message: 'a monthly report names its day' });
180
+ if (frequency !== 'weekly' && dayOfWeek !== undefined)
181
+ out.push({ path: ['scheduledReports', r, 'schedule', 'dayOfWeek'], message: 'a day of the week is said of a weekly report' });
182
+ if (frequency !== 'monthly' && dayOfMonth !== undefined)
183
+ out.push({ path: ['scheduledReports', r, 'schedule', 'dayOfMonth'], message: 'a day of the month is said of a monthly report' });
184
+ });
185
+ const payables = m.payments?.payables ?? [];
186
+ const tables = new Set();
187
+ payables.forEach((payable, p) => {
188
+ const at = (...rest) => ['payments', 'payables', p, ...rest];
189
+ if (tables.has(payable.table))
190
+ out.push({ path: at('table'), message: `"${payable.table}" is payable twice` });
191
+ tables.add(payable.table);
192
+ if (index.table(payable.table) === undefined) {
193
+ out.push({ path: at('table'), message: `"${payable.table}" is not a table of this app` });
194
+ return;
195
+ }
196
+ const own = (ref, ...path) => {
197
+ if (ref !== undefined && !index.has(payable.table, ref))
198
+ out.push({ path: at(...path), message: `"${payable.table}" has no column "${ref}"` });
199
+ };
200
+ own(payable.label, 'label');
201
+ own(payable.amount.column, 'amount', 'column');
202
+ if ('column' in payable.currency)
203
+ own(payable.currency.column, 'currency', 'column');
204
+ own(payable.due?.column, 'due', 'column');
205
+ own(payable.status?.column, 'status', 'column');
206
+ own(payable.customerEmail, 'customerEmail');
207
+ own(payable.customerCountry, 'customerCountry');
208
+ (payable.pageFields ?? []).forEach((ref, f) => own(ref, 'pageFields', f));
209
+ const kept = payable.payments;
210
+ if (kept.kind === 'table') {
211
+ if (index.table(kept.table) === undefined) {
212
+ out.push({ path: at('payments', 'table'), message: `"${kept.table}" is not a table of this app` });
213
+ return;
214
+ }
215
+ for (const [name, ref] of [['link', kept.link], ['amount', kept.amount], ['date', kept.date], ['reference', kept.reference], ['note', kept.note], ['voided', kept.voided], ['refunded', kept.refunded]]) {
216
+ if (ref !== undefined && !index.has(kept.table, ref))
217
+ out.push({ path: at('payments', name), message: `"${kept.table}" has no column "${ref}"` });
218
+ }
219
+ if (!index.has(kept.table, kept.method.column))
220
+ out.push({ path: at('payments', 'method', 'column'), message: `"${kept.table}" has no column "${kept.method.column}"` });
221
+ }
222
+ });
223
+ const ways = new Set();
224
+ (m.payments?.ways ?? []).forEach((way, w) => {
225
+ const key = `${way.source}/${way.method}`;
226
+ if (ways.has(key))
227
+ out.push({ path: ['payments', 'ways', w], message: `"${key}" is listed twice` });
228
+ ways.add(key);
229
+ });
230
+ return out;
231
+ }
232
+ //# sourceMappingURL=saved-parts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"saved-parts.js","sourceRoot":"","sources":["../src/saved-parts.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAwC,MAAM,WAAW,CAAC;AAE5E,mDAAmD;AACnD,MAAM,KAAK,GAAG,OAAO,CAAC;AAEtB,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,SAAS,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,UAAU,CAAU,CAAC;AAExG,uCAAuC;AACvC,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAC;AACpC,MAAM,CAAC,MAAM,yBAAyB,GAAG,EAAE,CAAC;AAC5C,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,CAAC;AAE9C,uEAAuE;AACvE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;AAEpD,MAAM,OAAO,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,wBAAwB,EAAE,4CAA4C,CAAC,CA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