@yomotech/view-toolkit 1.0.50 → 1.0.56
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/fesm2022/yomotech-view-toolkit-catalog.mjs +1408 -12
- package/fesm2022/yomotech-view-toolkit-catalog.mjs.map +1 -1
- package/fesm2022/yomotech-view-toolkit.mjs +1143 -333
- package/fesm2022/yomotech-view-toolkit.mjs.map +1 -1
- package/package.json +3 -2
- package/types/yomotech-view-toolkit-catalog.d.ts +525 -47
- package/types/yomotech-view-toolkit.d.ts +254 -11
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Pure policy shared by inspectors and layout validation. No DTO mutation. */
|
|
2
|
-
type Bag = Record<string, any>;
|
|
2
|
+
type Bag$1 = Record<string, any>;
|
|
3
3
|
interface Setting {
|
|
4
4
|
key: string;
|
|
5
5
|
label: string;
|
|
@@ -8,12 +8,12 @@ interface Setting {
|
|
|
8
8
|
hint?: string;
|
|
9
9
|
}
|
|
10
10
|
declare const clone: <T>(value: T) => T;
|
|
11
|
-
declare function resolveProperty(root: Bag | any, reference: string): Bag;
|
|
11
|
+
declare function resolveProperty(root: Bag$1 | any, reference: string): Bag$1;
|
|
12
12
|
declare function normalizeFormat(value: string): string;
|
|
13
|
-
declare function baseType(schema: Bag | any, fallback: string): string;
|
|
14
|
-
declare function effectiveFormat(schema: Bag | any, fallback: string, data: Bag | any): string;
|
|
15
|
-
declare function rulesFor(schema: Bag | any, data: Bag | any): Bag;
|
|
16
|
-
declare function controlsFor(schema: Bag, fallback: string, option: Bag | any): {
|
|
13
|
+
declare function baseType(schema: Bag$1 | any, fallback: string): string;
|
|
14
|
+
declare function effectiveFormat(schema: Bag$1 | any, fallback: string, data: Bag$1 | any): string;
|
|
15
|
+
declare function rulesFor(schema: Bag$1 | any, data: Bag$1 | any): Bag$1;
|
|
16
|
+
declare function controlsFor(schema: Bag$1, fallback: string, option: Bag$1 | any): {
|
|
17
17
|
value: string;
|
|
18
18
|
label: string;
|
|
19
19
|
}[];
|
|
@@ -24,7 +24,7 @@ declare function controlsFor(schema: Bag, fallback: string, option: Bag | any):
|
|
|
24
24
|
* values); a list of two texts as check box or switch. "Read-only output" is no choice here - read only is set
|
|
25
25
|
* with protected.
|
|
26
26
|
*/
|
|
27
|
-
declare function controlChoicesFor(schema: Bag, fallback: string, option: Bag | any): {
|
|
27
|
+
declare function controlChoicesFor(schema: Bag$1, fallback: string, option: Bag$1 | any): {
|
|
28
28
|
value: string;
|
|
29
29
|
label: string;
|
|
30
30
|
}[];
|
|
@@ -36,13 +36,13 @@ declare const canonicalControl: (c: string) => any;
|
|
|
36
36
|
*/
|
|
37
37
|
declare const DATA_OBJECT_KEYS: readonly ["type"];
|
|
38
38
|
/** Where what older data objects carried is set now: on the layout field that shows the property. */
|
|
39
|
-
declare const DATA_OBJECT_PLACES: Bag;
|
|
39
|
+
declare const DATA_OBJECT_PLACES: Bag$1;
|
|
40
40
|
/**
|
|
41
41
|
* Where a page names a data object (objects/<name>.json) - a rename has to change every one of them,
|
|
42
42
|
* the Designer's rename and the AI contract use this list. The app's test flows name fields by their
|
|
43
43
|
* property alone, without the data object.
|
|
44
44
|
*/
|
|
45
|
-
declare const DATA_OBJECT_NAME_PLACES: Bag;
|
|
45
|
+
declare const DATA_OBJECT_NAME_PLACES: Bag$1;
|
|
46
46
|
/**
|
|
47
47
|
* Renames the data object oldName to newName at every place of DATA_OBJECT_NAME_PLACES inside a page
|
|
48
48
|
* layout (changed in place). Returns how many values were changed.
|
|
@@ -50,20 +50,20 @@ declare const DATA_OBJECT_NAME_PLACES: Bag;
|
|
|
50
50
|
declare function renameDataObject(layout: any, oldName: string, newName: string): number;
|
|
51
51
|
declare const BASIC_TYPES: readonly ["string", "number", "integer", "bigdecimal", "boolean", "date", "time", "datetime", "dateRange", "media", "array"];
|
|
52
52
|
/** Older or other names of a data type and the type they mean. */
|
|
53
|
-
declare const TYPE_ALIASES: Bag;
|
|
53
|
+
declare const TYPE_ALIASES: Bag$1;
|
|
54
54
|
/** The data type of a property, aliases resolved ("image" -> "media"). */
|
|
55
|
-
declare function basicType(property: Bag | any): string;
|
|
55
|
+
declare function basicType(property: Bag$1 | any): string;
|
|
56
56
|
/** Every control the Designer offers (option.control), with the name it is shown under. */
|
|
57
|
-
declare const CONTROLS: Bag;
|
|
57
|
+
declare const CONTROLS: Bag$1;
|
|
58
58
|
/** DTO types that name their control themselves (older projects). */
|
|
59
|
-
declare const CONTROL_TYPES: Bag;
|
|
59
|
+
declare const CONTROL_TYPES: Bag$1;
|
|
60
60
|
/**
|
|
61
61
|
* The control a field is shown with: option.control; without one what the app uses - an old switch
|
|
62
62
|
* (password, email, timeOnly), a DTO type that is a control (dropdown, creditCard, quantity), else
|
|
63
63
|
* the first control that fits the data (date -> datepicker, boolean -> checkbox, text -> textInput).
|
|
64
64
|
* '' when nothing fits (media, objects).
|
|
65
65
|
*/
|
|
66
|
-
declare function effectiveControl(option: Bag | any, schema?: Bag | any, fallback?: string): string;
|
|
66
|
+
declare function effectiveControl(option: Bag$1 | any, schema?: Bag$1 | any, fallback?: string): string;
|
|
67
67
|
/** Controls a value is typed or chosen in - they take a placeholder. */
|
|
68
68
|
declare const PLACEHOLDER_CONTROLS: string[];
|
|
69
69
|
/**
|
|
@@ -74,7 +74,16 @@ declare const PLACEHOLDER_CONTROLS: string[];
|
|
|
74
74
|
declare const CARD_LAYOUTS: readonly ["oneRow", "twoRows", "threeRows"];
|
|
75
75
|
type CardLayout = typeof CARD_LAYOUTS[number];
|
|
76
76
|
/** The card field's layout, oneRow when the layout names none or an unknown one. */
|
|
77
|
-
declare function cardLayoutOf(option: Bag | any): CardLayout;
|
|
77
|
+
declare function cardLayoutOf(option: Bag$1 | any): CardLayout;
|
|
78
|
+
/**
|
|
79
|
+
* The key at the bottom right of the app keyboard (option.enterKey), set in the Designer per field:
|
|
80
|
+
* done closes the keyboard (default), search sends Enter so the field's action runs (a search starts),
|
|
81
|
+
* next moves on to the next field. The header's search field has search as its default.
|
|
82
|
+
*/
|
|
83
|
+
declare const ENTER_KEYS: readonly ["done", "search", "next"];
|
|
84
|
+
type EnterKey = (typeof ENTER_KEYS)[number];
|
|
85
|
+
/** A field's key at the bottom right: its option.enterKey when known, else the given default. */
|
|
86
|
+
declare function enterKeyFor(option: Bag$1 | any, fallback?: EnterKey): EnterKey;
|
|
78
87
|
/** The toolkit keyboards a field can ask for (option.keyboardType). */
|
|
79
88
|
declare const KEYBOARD_TYPES: readonly ["string", "alpha", "numeric", "email", "date", "time"];
|
|
80
89
|
/** keyboardType values that keep the device's system keyboard. */
|
|
@@ -82,18 +91,18 @@ declare const SYSTEM_KEYBOARDS: readonly ["native", "none"];
|
|
|
82
91
|
/** Controls a keyboard is chosen for. */
|
|
83
92
|
declare const KEYBOARD_CONTROLS: string[];
|
|
84
93
|
/** The keyboard a control brings when the field names none (as the Designer preselects it). */
|
|
85
|
-
declare function defaultKeyboard(control: string, schema?: Bag | any, fallback?: string, data?: Bag | any): string;
|
|
94
|
+
declare function defaultKeyboard(control: string, schema?: Bag$1 | any, fallback?: string, data?: Bag$1 | any): string;
|
|
86
95
|
/**
|
|
87
96
|
* The keyboard of a field: its keyboardType; native/none (and a password without one) keep the
|
|
88
97
|
* system keyboard (null); without keyboardType the control's default; without a control the data
|
|
89
98
|
* type's (date, time, number/integer, string, email format). The per-type keyboards are only the
|
|
90
99
|
* fallback.
|
|
91
100
|
*/
|
|
92
|
-
declare function keyboardFor(option: Bag | any, property?: Bag | any): string | null;
|
|
101
|
+
declare function keyboardFor(option: Bag$1 | any, property?: Bag$1 | any): string | null;
|
|
93
102
|
/** What a date/time property shows and takes: date and time stay separate fields. */
|
|
94
103
|
type TemporalPart = 'date' | 'time' | 'datetime';
|
|
95
104
|
/** The part of a date/time a property shows and takes (DTO type date / time / date&time), else null. */
|
|
96
|
-
declare function temporalPart(property: Bag | any): TemporalPart | null;
|
|
105
|
+
declare function temporalPart(property: Bag$1 | any): TemporalPart | null;
|
|
97
106
|
/**
|
|
98
107
|
* How date and time values travel - the same for every project:
|
|
99
108
|
* - every value is a string (JSON has no date type); the app turns it into a date for showing and
|
|
@@ -103,45 +112,61 @@ declare function temporalPart(property: Bag | any): TemporalPart | null;
|
|
|
103
112
|
* - send: ISO with the device's offset, 2026-10-18T08:00:00+02:00 (the daily split of the time
|
|
104
113
|
* recording, convertToDailyLogs, stays as it is)
|
|
105
114
|
* - shown and typed: the app language, year with four digits (de 18.10.2026, time 08:05);
|
|
106
|
-
* lists: displayFormat short / medium (default) / long / custom
|
|
115
|
+
* lists: displayFormat short / medium (default) / long / iso (2026-10-30 in every language) / custom
|
|
107
116
|
*/
|
|
108
117
|
declare const TEMPORAL_TRANSFER: {
|
|
109
118
|
readonly read: "iso, local wall time, offset dropped";
|
|
110
119
|
readonly send: "iso with local offset";
|
|
111
120
|
readonly show: "app language, four-digit year";
|
|
112
|
-
readonly listStyles: readonly ["short", "medium", "long", "custom"];
|
|
121
|
+
readonly listStyles: readonly ["short", "medium", "long", "iso", "custom"];
|
|
113
122
|
readonly listDefault: "medium";
|
|
114
123
|
};
|
|
115
124
|
/** The encodings a field can declare (option.fieldData.format). */
|
|
116
125
|
declare const DATA_FORMATS: readonly ["iso-date", "iso-time", "iso-datetime", "flag", "decimal"];
|
|
117
126
|
/** How a date or time is shown (option.displayFormat). */
|
|
118
|
-
declare const DISPLAY_FORMATS: readonly ["short", "medium", "long", "custom"];
|
|
127
|
+
declare const DISPLAY_FORMATS: readonly ["short", "medium", "long", "iso", "custom"];
|
|
119
128
|
/** How a number is shown (option.numberStyle). */
|
|
120
129
|
declare const NUMBER_STYLES: readonly ["decimal", "currency", "percent"];
|
|
121
|
-
declare function displaySettings(schema: Bag, fallback: string, option: Bag | any): Setting[];
|
|
122
|
-
declare function dataSettings(schema: Bag, fallback: string, option: Bag | any): Setting[];
|
|
123
|
-
declare function validationSettings(schema: Bag, fallback: string, option: Bag | any): Setting[];
|
|
124
|
-
declare function validateSettings(schema: Bag | any, fallback: string, option: Bag | any, context?: {
|
|
125
|
-
propertySchema: Bag;
|
|
130
|
+
declare function displaySettings(schema: Bag$1, fallback: string, option: Bag$1 | any): Setting[];
|
|
131
|
+
declare function dataSettings(schema: Bag$1, fallback: string, option: Bag$1 | any): Setting[];
|
|
132
|
+
declare function validationSettings(schema: Bag$1, fallback: string, option: Bag$1 | any): Setting[];
|
|
133
|
+
declare function validateSettings(schema: Bag$1 | any, fallback: string, option: Bag$1 | any, context?: {
|
|
134
|
+
propertySchema: Bag$1;
|
|
126
135
|
reference: string;
|
|
127
136
|
allowPendingValues?: boolean;
|
|
128
137
|
}): string[];
|
|
129
138
|
/** Call before activating a saved field layout; throws rather than warning. */
|
|
130
|
-
declare function assertFieldSettings(schema: Bag, fallback: string, option: Bag, context?: {
|
|
131
|
-
propertySchema: Bag;
|
|
139
|
+
declare function assertFieldSettings(schema: Bag$1, fallback: string, option: Bag$1, context?: {
|
|
140
|
+
propertySchema: Bag$1;
|
|
132
141
|
reference: string;
|
|
133
142
|
allowPendingValues?: boolean;
|
|
134
143
|
}): void;
|
|
144
|
+
/**
|
|
145
|
+
* A text shown in a list (card, grid) ends with … after this many lines (option.maxLines, set in the Designer: 1-20);
|
|
146
|
+
* 0 = no limit. The whole text stays on the detail page (user 2026-11-01).
|
|
147
|
+
*/
|
|
148
|
+
declare function maxLinesOf(option: any): number;
|
|
149
|
+
/**
|
|
150
|
+
* A card list's cards of a row are equally high and their buttons stand at the bottom, in line across the row
|
|
151
|
+
* (center.option.alignRows, set in the Designer; on for new card lists, user 2026-11-01).
|
|
152
|
+
*/
|
|
153
|
+
declare function alignRowsOf(center: any): boolean;
|
|
135
154
|
|
|
136
155
|
declare const TESTS_DIR = ".liveforge/tests";
|
|
137
156
|
declare const RESULTS_DIR = ".liveforge/results";
|
|
138
157
|
/** The app's test data, shared by its tests: { customer: { firstName: "Max" }, card: { number: "4242…" } } */
|
|
139
158
|
declare const TEST_DATA_FILE = ".liveforge/test-data.json";
|
|
140
|
-
declare const TEST_DEVICES: readonly ["
|
|
159
|
+
declare const TEST_DEVICES: readonly ["mobile", "tablet", "laptop", "desktop"];
|
|
160
|
+
/** Old spellings of a device, still taken: "phone" is "mobile" (2026-10-31, the preview's word). */
|
|
161
|
+
declare const OLD_DEVICE_NAMES: Record<string, string>;
|
|
141
162
|
declare const ORIENTATIONS: readonly ["portrait", "landscape"];
|
|
142
|
-
declare const STEP_KINDS: readonly ["open", "menu", "tap", "type", "pick", "press", "scroll", "openRecord", "close", "cart", "rotate", "device", "wait", "expect"];
|
|
163
|
+
declare const STEP_KINDS: readonly ["open", "menu", "tap", "type", "pick", "press", "scroll", "openRecord", "close", "cart", "rotate", "device", "wait", "language", "reload", "signIn", "signOut", "expect"];
|
|
143
164
|
/** What an expect step can check - one of them per step. */
|
|
144
|
-
declare const EXPECT_KINDS: readonly ["value", "shows", "keyboard", "list", "message", "visible", "hidden", "locked", "blocked", "inFrame", "page", "records", "recordsAtLeast", "samePlace", "cartCount", "toast", "checked", "unchecked", "cardRows"];
|
|
165
|
+
declare const EXPECT_KINDS: readonly ["value", "shows", "keyboard", "list", "message", "visible", "hidden", "locked", "blocked", "inFrame", "page", "records", "recordsAtLeast", "samePlace", "cartCount", "toast", "checked", "unchecked", "cardRows", "formatted", "translated", "fieldVisible", "restored", "layout"];
|
|
166
|
+
/** How a value is shown in the language's form (expect formatted). */
|
|
167
|
+
declare const FORMATS: readonly ["date", "time", "datetime", "number", "currency"];
|
|
168
|
+
/** Languages written right to left - not tested until right-to-left is supported (decision 2026-10-30). */
|
|
169
|
+
declare const RTL_LANGUAGES: string[];
|
|
145
170
|
/** What has to stay inside the page frame (safe areas, top gap). */
|
|
146
171
|
declare const FRAME_PARTS: readonly ["keyboard", "dialog", "calendar", "list", "menu"];
|
|
147
172
|
declare const LIST_STATES: readonly ["open", "closed"];
|
|
@@ -151,7 +176,7 @@ interface TestExpect {
|
|
|
151
176
|
field?: string;
|
|
152
177
|
/** stored value of the field */
|
|
153
178
|
value?: unknown;
|
|
154
|
-
/** text the field shows (formatted: "12,34 €", "01:00 PM") */
|
|
179
|
+
/** text the field shows (formatted: "12,34 €", "01:00 PM"); a language key (caption) is shown in the run's language */
|
|
155
180
|
shows?: string;
|
|
156
181
|
/** keyboard type that is open (string, alpha, numeric, email, date, time) or "none" */
|
|
157
182
|
keyboard?: string;
|
|
@@ -181,6 +206,18 @@ interface TestExpect {
|
|
|
181
206
|
checked?: string;
|
|
182
207
|
/** a check box / switch (its key) is off */
|
|
183
208
|
unchecked?: string;
|
|
209
|
+
/** with field and value: the field shows the language-neutral value (2026-10-30, 14:00, 12.50) in the language's form */
|
|
210
|
+
formatted?: typeof FORMATS[number];
|
|
211
|
+
/** ISO currency of formatted: currency (EUR, USD) */
|
|
212
|
+
currency?: string;
|
|
213
|
+
/** every text of the page is in the language of the run - none missing, no raw key */
|
|
214
|
+
translated?: true;
|
|
215
|
+
/** the field (its key) stays visible above the open keyboard - not covered */
|
|
216
|
+
fieldVisible?: string;
|
|
217
|
+
/** after the keyboard closed the page stands as before it opened - same place, no empty space */
|
|
218
|
+
restored?: true;
|
|
219
|
+
/** the page passes the layout rules (layoutProblems) */
|
|
220
|
+
layout?: true;
|
|
184
221
|
}
|
|
185
222
|
interface TestStep {
|
|
186
223
|
open?: string;
|
|
@@ -204,6 +241,15 @@ interface TestStep {
|
|
|
204
241
|
cart?: true;
|
|
205
242
|
rotate?: Orientation;
|
|
206
243
|
device?: string;
|
|
244
|
+
/** switch the app's language on the way (code: de, en, fr) */
|
|
245
|
+
language?: string;
|
|
246
|
+
/** load the app anew - the language and the sign-in stay */
|
|
247
|
+
reload?: true;
|
|
248
|
+
/** signed in from here on: already signed in - done; else a person signs in (preview, the runner waits) or the
|
|
249
|
+
* runner signs in with the test user (simulators, signin.mjs). A test never types a name or password. */
|
|
250
|
+
signIn?: true | string;
|
|
251
|
+
/** signed out from here on - the sign-out of the user in the side menu, like a person; signed out already: done */
|
|
252
|
+
signOut?: true;
|
|
207
253
|
/** milliseconds */
|
|
208
254
|
wait?: number;
|
|
209
255
|
expect?: TestExpect;
|
|
@@ -213,8 +259,10 @@ interface TestFlow {
|
|
|
213
259
|
description?: string;
|
|
214
260
|
/** writes real data - runs only after an explicit confirmation */
|
|
215
261
|
books?: boolean;
|
|
216
|
-
/** "
|
|
262
|
+
/** "mobile", "tablet:landscape" … - without orientation portrait; none means mobile and tablet ("phone" is still taken) */
|
|
217
263
|
devices?: string[];
|
|
264
|
+
/** the languages the flow runs in: codes, or "all" (the app's left-to-right languages); none: the main language */
|
|
265
|
+
languages?: string[] | 'all';
|
|
218
266
|
steps: TestStep[];
|
|
219
267
|
}
|
|
220
268
|
interface TestProblem {
|
|
@@ -228,11 +276,18 @@ interface StepResult {
|
|
|
228
276
|
ok: boolean;
|
|
229
277
|
reason?: string;
|
|
230
278
|
image?: string;
|
|
279
|
+
/** a failed step's measurements - what is needed to find the cause (samePlace: place, largest place, records when
|
|
280
|
+
* left and back; layout: the boxes; visible/translated: what the page holds instead). Read by people and the AI. */
|
|
281
|
+
details?: Record<string, unknown>;
|
|
282
|
+
/** a passing step's hints - nothing failed, worth a look (layout: a table scrolls sideways) */
|
|
283
|
+
notes?: string[];
|
|
231
284
|
}
|
|
232
285
|
interface FlowResult {
|
|
233
286
|
file: string;
|
|
234
287
|
name: string;
|
|
235
288
|
device: string;
|
|
289
|
+
/** the language the flow ran in */
|
|
290
|
+
language?: string;
|
|
236
291
|
ok: boolean;
|
|
237
292
|
skipped?: 'books';
|
|
238
293
|
/** stopped by the person ("Stop") after this flow's last step in steps */
|
|
@@ -250,6 +305,15 @@ interface TestRun {
|
|
|
250
305
|
flows: FlowResult[];
|
|
251
306
|
}
|
|
252
307
|
declare const DEFAULT_DEVICES: string[];
|
|
308
|
+
/** Every device a test can name: each device, portrait and (for mobile and tablet) landscape - the editor's choices. */
|
|
309
|
+
declare function deviceChoices(): string[];
|
|
310
|
+
/**
|
|
311
|
+
* A placeholder in a text: {{name}} or {{name | fallback}} (the same pattern as validate.py's, via the contract).
|
|
312
|
+
* As a source, so every runner and the Python validator build their own RegExp from it.
|
|
313
|
+
*/
|
|
314
|
+
declare const PLACEHOLDER_SOURCE = "\\{\\{\\s*([^}|]+?)\\s*(?:\\|[^}]*)?\\}\\}";
|
|
315
|
+
/** Whether a shown text is a text with placeholders filled in ("Order 4711 saved" for "Order {{id}} saved"). */
|
|
316
|
+
declare function matchesTemplate(text: string, template: string): boolean;
|
|
253
317
|
/**
|
|
254
318
|
* How many runs the backend keeps in .liveforge/results - defaults, the project configuration can
|
|
255
319
|
* change them: at most `max` runs; while they together are bigger than `maxBytes` (mostly images of
|
|
@@ -274,10 +338,98 @@ declare function parseDevice(text: string): {
|
|
|
274
338
|
device: TestDevice;
|
|
275
339
|
orientation: Orientation;
|
|
276
340
|
} | null;
|
|
341
|
+
/**
|
|
342
|
+
* Stripe's test cards and the test payment methods Stripe has for them (stripe.com/docs/testing). A test run cannot
|
|
343
|
+
* type into Stripe's card frame (another site's frame) - the card field pays with the test payment method instead.
|
|
344
|
+
*/
|
|
345
|
+
declare const STRIPE_TEST_CARDS: Readonly<Record<string, string>>;
|
|
346
|
+
/**
|
|
347
|
+
* The Stripe test payment method for a card number typed in a test ("4242 4242 4242 4242"), or null: only a test
|
|
348
|
+
* card of STRIPE_TEST_CARDS and only with a test key (pk_test_) - a live key never pays this way.
|
|
349
|
+
*/
|
|
350
|
+
declare function stripeTestPaymentMethod(cardNumber: string, publishableKey: string): string | null;
|
|
351
|
+
/** The devices that type on the app's own keyboard. A laptop or desktop types on its own keyboard - nothing opens. */
|
|
352
|
+
declare const APP_KEYBOARD_DEVICES: readonly TestDevice[];
|
|
353
|
+
/** Does the device ("tablet:landscape") type on the app's keyboard? The keyboard checks are only for those. */
|
|
354
|
+
declare function hasAppKeyboard(device: string): boolean;
|
|
355
|
+
/** A check about the app's keyboard - made only where the app keyboard opens (hasAppKeyboard). */
|
|
356
|
+
declare function isKeyboardCheck(e: TestExpect | undefined): boolean;
|
|
277
357
|
/** The devices a flow runs on. */
|
|
278
358
|
declare function flowDevices(flow: TestFlow): string[];
|
|
279
359
|
/** The kind of a step - the first step key it has. */
|
|
280
360
|
declare function stepKind(step: TestStep): string | null;
|
|
361
|
+
/** The languages a flow runs in: its own (right-to-left left out), "all" = the app's left-to-right ones, none = the main one. */
|
|
362
|
+
declare function flowLanguages(flow: TestFlow, appLanguages: string[], main: string): string[];
|
|
363
|
+
/** 12 hours with AM/PM in this language? */
|
|
364
|
+
declare function uses12Hours(lang: string): boolean;
|
|
365
|
+
/** The order of day, month, year in the language's numeric date ("dmy", "mdy", "ymd"). */
|
|
366
|
+
declare function dateOrder(lang: string): string;
|
|
367
|
+
/**
|
|
368
|
+
* The keys a person types for a language-neutral value in this language: a date's digits in the language's order
|
|
369
|
+
* (en 10302026, de 30102026), a time as digits with P/A in a 12-hour language (0200P) or 24 hours (1400), a number
|
|
370
|
+
* with the language's decimal sign (de 12,50). Any other text stays as it is - older flows typed the keys themselves.
|
|
371
|
+
*/
|
|
372
|
+
declare function localeKeys(value: string, lang: string, dateDisplay?: string): string;
|
|
373
|
+
/** Every way the language writes this value (expect formatted) - the field must show one of them; spaces are made plain. */
|
|
374
|
+
declare function localeRenderings(value: string, as: typeof FORMATS[number], lang: string, currency?: string, dateDisplay?: string): string[];
|
|
375
|
+
/** One element on the page as the runner measured it (layoutProblems). */
|
|
376
|
+
interface LayoutBox {
|
|
377
|
+
/** what it is: field, button, label, text */
|
|
378
|
+
kind: string;
|
|
379
|
+
/** its name for the report (field key, button action, the first words) */
|
|
380
|
+
name: string;
|
|
381
|
+
left: number;
|
|
382
|
+
top: number;
|
|
383
|
+
right: number;
|
|
384
|
+
bottom: number;
|
|
385
|
+
/** characters that fit in a line of its width at its font size (text only) */
|
|
386
|
+
charsPerLine?: number;
|
|
387
|
+
/** the row it belongs to (fields side by side in one layout row) */
|
|
388
|
+
row?: string;
|
|
389
|
+
/** the sideways scrolling area it stands in (a wide table) - reached by swiping there, so it may leave the frame */
|
|
390
|
+
scroller?: string;
|
|
391
|
+
/** it stands in the top bar (header, page X) - the page scrolls under a fixed one */
|
|
392
|
+
inBar?: boolean;
|
|
393
|
+
}
|
|
394
|
+
/** An area that scrolls sideways on its own (a table wider than the screen): its place and how wide its content is. */
|
|
395
|
+
interface LayoutScroller {
|
|
396
|
+
name: string;
|
|
397
|
+
left: number;
|
|
398
|
+
right: number;
|
|
399
|
+
/** the content's width and the width shown */
|
|
400
|
+
content: number;
|
|
401
|
+
shown: number;
|
|
402
|
+
}
|
|
403
|
+
/** What the page shows, measured by a runner: the frame, sideways scrolling, the elements. */
|
|
404
|
+
interface LayoutSnapshot {
|
|
405
|
+
width: number;
|
|
406
|
+
height: number;
|
|
407
|
+
/** the page scrolls sideways (document wider than the frame) */
|
|
408
|
+
scrollsSideways: boolean;
|
|
409
|
+
boxes: LayoutBox[];
|
|
410
|
+
/** the areas that scroll sideways on their own */
|
|
411
|
+
scrollers?: LayoutScroller[];
|
|
412
|
+
/** the top bar (header + page X): its place, its behaviour (header.option.scroll) and how far the page is scrolled */
|
|
413
|
+
header?: {
|
|
414
|
+
top: number;
|
|
415
|
+
bottom: number;
|
|
416
|
+
scroll: string;
|
|
417
|
+
pageTop: number;
|
|
418
|
+
};
|
|
419
|
+
/** card lists with aligned rows (card.alignRows): per row of cards, the tops of their button elements */
|
|
420
|
+
cardRows?: number[][];
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* The layout rules (OFFENE-PUNKTE 143), judged on what a runner measured: beyond (an element leaves the frame
|
|
424
|
+
* sideways), sideways (the page scrolls sideways), overlap (two fields / buttons cover each other), narrow (a text
|
|
425
|
+
* gets fewer than 3 characters a line), row (fields of one row do not stand on one line). Pixels tolerate 2.
|
|
426
|
+
*/
|
|
427
|
+
declare function layoutProblems(snap: LayoutSnapshot): {
|
|
428
|
+
rule: string;
|
|
429
|
+
detail: string;
|
|
430
|
+
}[];
|
|
431
|
+
/** Hints that fail nothing: the areas that scroll sideways (a wide table) - shown with a passing layout check. */
|
|
432
|
+
declare function layoutNotes(snap: LayoutSnapshot): string[];
|
|
281
433
|
/** The test data a flow uses, per step: [{ step, ref: "customer.firstName" }]; ref without "data.". */
|
|
282
434
|
declare function testDataRefs(flow: any): {
|
|
283
435
|
step: number;
|
|
@@ -297,6 +449,62 @@ declare function withTestData(flow: TestFlow, data: any): {
|
|
|
297
449
|
* in it is a problem too (dataUnknown); a placeholder that is no {{data.…}} is one always (dataRefInvalid).
|
|
298
450
|
*/
|
|
299
451
|
declare function checkTestFlow(flow: any, data?: any): TestProblem[];
|
|
452
|
+
/**
|
|
453
|
+
* How fast a run goes - chosen only where the run is started (preview: the choice beside "Run tests"; devices:
|
|
454
|
+
* --tempo=…), never in a test (user 2026-11-01): the seconds before each step (user 2026-11-04), or one of the names
|
|
455
|
+
* fast (no pause), normal (a short pause), slow (a long pause, to watch it). The checks' time limits start after the pause.
|
|
456
|
+
*/
|
|
457
|
+
declare const TEST_TEMPOS: readonly ["fast", "normal", "slow"];
|
|
458
|
+
type TestTempo = (typeof TEST_TEMPOS)[number];
|
|
459
|
+
/**
|
|
460
|
+
* The seconds before each step when nobody chose. A form takes a typed value only in a later task of the browser: a step
|
|
461
|
+
* right after the typing found the field still empty; a person's next click is always later (measured 2026-11-04: 0.1 is
|
|
462
|
+
* enough, 0.2 leaves a margin).
|
|
463
|
+
*/
|
|
464
|
+
declare const DEFAULT_TEMPO_SECONDS = 0.2;
|
|
465
|
+
/** The pause before a step in ms - from seconds or a name; unknown tempo: fast. */
|
|
466
|
+
declare function tempoPause(tempo: string | number | undefined): number;
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* The app's test users (.liveforge/test-data.json testUsers) - name -> where its sign-in data stand in Vault, e.g.
|
|
470
|
+
* { "default": { "vault": "liveforge/tenants/dev/e2e/tm-test/default", "description": "employee" } }. Nothing of it
|
|
471
|
+
* is built into the code (user 2026-11-01: nothing hard-coded); a step names the user: signIn true = "default".
|
|
472
|
+
*/
|
|
473
|
+
interface TestUserEntry {
|
|
474
|
+
/** the Vault entry: KV v2 mount, then the path (liveforge/tenants/dev/e2e/tm-test/default) */
|
|
475
|
+
vault: string;
|
|
476
|
+
description?: string;
|
|
477
|
+
}
|
|
478
|
+
/** The test user a step names (signIn true -> "default") from the app's test data; null when the app has none. */
|
|
479
|
+
declare function testUserEntry(data: any, name: string | true): TestUserEntry | null;
|
|
480
|
+
/** "liveforge/tenants/dev/e2e/tm-test/default" -> the KV v2 mount and the path inside it. */
|
|
481
|
+
declare function vaultPlace(vault: string): {
|
|
482
|
+
mount: string;
|
|
483
|
+
path: string;
|
|
484
|
+
};
|
|
485
|
+
/** The test user as Vault holds it. */
|
|
486
|
+
interface TestUser {
|
|
487
|
+
username: string;
|
|
488
|
+
password: string;
|
|
489
|
+
/** the authenticator key (base32) when the test user has a second factor */
|
|
490
|
+
otpSecret?: string;
|
|
491
|
+
/** the tenant key a freshly installed app asks for (device runners) */
|
|
492
|
+
tenantKey?: string;
|
|
493
|
+
}
|
|
494
|
+
type Fetch = (url: string, init?: any) => Promise<{
|
|
495
|
+
ok: boolean;
|
|
496
|
+
status: number;
|
|
497
|
+
json(): Promise<any>;
|
|
498
|
+
text(): Promise<string>;
|
|
499
|
+
}>;
|
|
500
|
+
/** base32 (RFC 4648, the authenticator apps' form) to bytes. */
|
|
501
|
+
declare function base32Bytes(secret: string): Uint8Array;
|
|
502
|
+
/** The authenticator code (TOTP, RFC 6238: HMAC-SHA1, 30 s, 6 digits) of a key at a time. */
|
|
503
|
+
declare function totp(secret: string, now?: number, subtle?: any): Promise<string>;
|
|
504
|
+
/** A Vault token from a JWT (auth/<mount>/login, role): the GitLab job's ID token or a person's Keycloak token. */
|
|
505
|
+
declare function vaultJwtLogin(fetchFn: Fetch, addr: string, mount: string, role: string, jwt: string): Promise<string>;
|
|
506
|
+
/** A test user from Vault (KV v2 mount and path, vaultPlace of the test data entry). The values never leave this function but in the result. */
|
|
507
|
+
declare function readTestUser(fetchFn: Fetch, addr: string, token: string, mount: string, path: string): Promise<TestUser>;
|
|
300
508
|
|
|
301
509
|
/** The building blocks of the app settings in Main, in the order they are shown. */
|
|
302
510
|
declare const APP_SETTING_BLOCKS: readonly ["startPage", "login", "pagination", "terms", "menu"];
|
|
@@ -370,8 +578,8 @@ interface AppSettings {
|
|
|
370
578
|
storage: LoginStorage;
|
|
371
579
|
roleKey: string;
|
|
372
580
|
/** role -> its own start page, in the Designer's order */
|
|
373
|
-
roles: Record<string, Bag>;
|
|
374
|
-
loginPage: Bag | null;
|
|
581
|
+
roles: Record<string, Bag$1>;
|
|
582
|
+
loginPage: Bag$1 | null;
|
|
375
583
|
};
|
|
376
584
|
pagination: Pagination;
|
|
377
585
|
terms: {
|
|
@@ -402,37 +610,37 @@ interface AppSettings {
|
|
|
402
610
|
};
|
|
403
611
|
}
|
|
404
612
|
/** The sign-in method of a Configuration (environment.json "environment") and its flag; null without one. */
|
|
405
|
-
declare function loginMethod(environment: Bag | any): {
|
|
613
|
+
declare function loginMethod(environment: Bag$1 | any): {
|
|
406
614
|
method: 'keycloak' | 'okta' | 'jwt';
|
|
407
615
|
flag: string;
|
|
408
616
|
} | null;
|
|
409
617
|
/** Only the page keys of an option object (center.option, a role's page, the page before the sign-in). */
|
|
410
|
-
declare function pageOf(option: Bag | any): Bag;
|
|
618
|
+
declare function pageOf(option: Bag$1 | any): Bag$1;
|
|
411
619
|
/** The general start page of a Main layout: the page keys of center.option. */
|
|
412
|
-
declare function startPage(layout: Bag | any): Bag;
|
|
620
|
+
declare function startPage(layout: Bag$1 | any): Bag$1;
|
|
413
621
|
/**
|
|
414
622
|
* The roles of a signed-in user: what stands at roleKey in the sign-in answer or the token's claims - a
|
|
415
623
|
* text or a list. Empty without roleKey or user.
|
|
416
624
|
*/
|
|
417
|
-
declare function rolesOf(user: Bag | any, roleKey: string): string[];
|
|
625
|
+
declare function rolesOf(user: Bag$1 | any, roleKey: string): string[];
|
|
418
626
|
/**
|
|
419
627
|
* The start page for a signed-in user: the page of the first role in login.roles (the Designer's order) the
|
|
420
628
|
* user has, compared without case; else the general start page.
|
|
421
629
|
*/
|
|
422
|
-
declare function startPageFor(layout: Bag | any, user?: Bag | any): Bag;
|
|
630
|
+
declare function startPageFor(layout: Bag$1 | any, user?: Bag$1 | any): Bag$1;
|
|
423
631
|
/**
|
|
424
632
|
* The pagination of one list: each value from the page (center.pagination of its layout) if it is there,
|
|
425
633
|
* else from Main, else the default. visible: a page with center.pagination pages unless it says
|
|
426
634
|
* visible false; a page without it does not page.
|
|
427
635
|
*/
|
|
428
|
-
declare function paginationFor(main: Bag | any, page: Bag | any): Pagination & {
|
|
636
|
+
declare function paginationFor(main: Bag$1 | any, page: Bag$1 | any): Pagination & {
|
|
429
637
|
visible: boolean;
|
|
430
638
|
};
|
|
431
639
|
/**
|
|
432
640
|
* The app settings of a Main layout (main/layout_schema.json), every missing or unknown value replaced by
|
|
433
641
|
* its default. A Main whose center.option carries a sign-in flag counts as "required at the start".
|
|
434
642
|
*/
|
|
435
|
-
declare function readAppSettings(layout: Bag | any): AppSettings;
|
|
643
|
+
declare function readAppSettings(layout: Bag$1 | any): AppSettings;
|
|
436
644
|
interface AppSettingsProblem {
|
|
437
645
|
code: string;
|
|
438
646
|
key: string;
|
|
@@ -441,9 +649,9 @@ interface AppSettingsProblem {
|
|
|
441
649
|
* What is wrong with the app settings of a Main layout - an empty list when nothing is. The environment
|
|
442
650
|
* (environment.json "environment") is needed for the sign-in checks; without it they are skipped.
|
|
443
651
|
*/
|
|
444
|
-
declare function checkAppSettings(layout: Bag | any, environment?: Bag | any): AppSettingsProblem[];
|
|
652
|
+
declare function checkAppSettings(layout: Bag$1 | any, environment?: Bag$1 | any): AppSettingsProblem[];
|
|
445
653
|
/** What is wrong with the page bar of one page (center.pagination of its layout): the same values as Main's. */
|
|
446
|
-
declare function checkPagePagination(page: Bag | any): AppSettingsProblem[];
|
|
654
|
+
declare function checkPagePagination(page: Bag$1 | any): AppSettingsProblem[];
|
|
447
655
|
/** The captions of the entries the library adds - keys of the app's language files (English text). */
|
|
448
656
|
declare const SETTING_MENU_TEXTS: {
|
|
449
657
|
readonly setting: "Setting";
|
|
@@ -467,10 +675,280 @@ declare function languageName(code: string): string;
|
|
|
467
675
|
* of the project's language files ("en", "de"); signedIn: whether a user is signed in. The given menu is
|
|
468
676
|
* not changed; without app settings it comes back as it is.
|
|
469
677
|
*/
|
|
470
|
-
declare function appSettingsMenu(menu: any[], center: Bag | any, context?: {
|
|
678
|
+
declare function appSettingsMenu(menu: any[], center: Bag$1 | any, context?: {
|
|
471
679
|
languages?: string[];
|
|
472
680
|
signedIn?: boolean;
|
|
473
681
|
}): any[];
|
|
682
|
+
/** An entry's caption as written in Main: label.caption, a plain label, or caption. */
|
|
683
|
+
declare function menuCaption(item: any): string;
|
|
684
|
+
/** The page an entry opens as tests name it ("pages/sidemenu/books/layout_schema.json" -> "sidemenu/books"); '' without. */
|
|
685
|
+
declare function menuPage(item: any): string;
|
|
686
|
+
/** Every entry of a menu, at any depth (submenu, elements, children), with its path of captions. */
|
|
687
|
+
declare function menuEntries(items: any[] | null | undefined, path?: string[]): {
|
|
688
|
+
item: any;
|
|
689
|
+
caption: string;
|
|
690
|
+
page: string;
|
|
691
|
+
path: string[];
|
|
692
|
+
}[];
|
|
693
|
+
/** The entry that opens a page (its folder under pages/), at any depth. */
|
|
694
|
+
declare function menuEntryForPage(items: any[] | null | undefined, page: string): any;
|
|
695
|
+
/**
|
|
696
|
+
* The entry with this caption that opens a page, at any depth: the caption as written in Main, or - the app shows
|
|
697
|
+
* it translated - the text the language file has for it (texts: written text -> shown text).
|
|
698
|
+
*/
|
|
699
|
+
declare function menuEntryByCaption(items: any[] | null | undefined, caption: string, texts?: Record<string, string>): any;
|
|
700
|
+
/**
|
|
701
|
+
* What the header does when the page scrolls (main/layout_schema.json header.option.scroll, user 2026-11-01):
|
|
702
|
+
* fixed - stays at the top (default, usual for shops and apps on every device); hideOnScroll - moves away while
|
|
703
|
+
* scrolling down and comes back at once when scrolling up ("quick return", room on a phone); scrollsAlong - scrolls
|
|
704
|
+
* away with the page: cart, search and the page X are out of reach after scrolling, and going back from them puts
|
|
705
|
+
* a list at its top (found 2026-11-01, luv2shop a06).
|
|
706
|
+
*/
|
|
707
|
+
declare const HEADER_SCROLLS: readonly ["fixed", "hideOnScroll", "scrollsAlong"];
|
|
708
|
+
type HeaderScroll = (typeof HEADER_SCROLLS)[number];
|
|
709
|
+
/** The header's behaviour when the page scrolls - its option.scroll when known, else fixed. */
|
|
710
|
+
declare function headerScrollOf(header: any): HeaderScroll;
|
|
711
|
+
|
|
712
|
+
/** Where records are kept. The first two stay in the browser, database is the backend. */
|
|
713
|
+
declare const STORAGES: readonly ["localstorage", "sessionstorage", "database"];
|
|
714
|
+
type Storage = (typeof STORAGES)[number];
|
|
715
|
+
declare const BROWSER_STORAGES: readonly string[];
|
|
716
|
+
/** Storage values of older data and what they mean now. */
|
|
717
|
+
declare const OLD_STORAGES: Readonly<Record<string, {
|
|
718
|
+
storageType: Storage;
|
|
719
|
+
loadOnFilter?: boolean;
|
|
720
|
+
}>>;
|
|
721
|
+
/** What an element does with its records - it decides which attributes are offered. */
|
|
722
|
+
type CallKind = 'load' | 'link' | 'select' | 'save' | 'saveAll' | 'submit' | 'delete' | 'login' | 'rowAction';
|
|
723
|
+
interface CallKindRule {
|
|
724
|
+
/** what it does (for the contract and the Designer's help) */
|
|
725
|
+
does: string;
|
|
726
|
+
/** the storages it may use; one only: no choice is offered */
|
|
727
|
+
storages: readonly Storage[];
|
|
728
|
+
/** the storage when none is written */
|
|
729
|
+
defaultStorage: Storage;
|
|
730
|
+
/** the key the address is written under */
|
|
731
|
+
addressKey: 'data_url' | 'url';
|
|
732
|
+
/** the methods, the default first (it is not written) */
|
|
733
|
+
methods: readonly string[];
|
|
734
|
+
/** the attributes with a browser storage (besides storageType) */
|
|
735
|
+
browser: readonly string[];
|
|
736
|
+
/** the attributes with the backend (besides storageType) */
|
|
737
|
+
backend: readonly string[];
|
|
738
|
+
}
|
|
739
|
+
declare const CALL_KINDS: Readonly<Record<CallKind, CallKindRule>>;
|
|
740
|
+
/** Every attribute of storage and call - an option key outside this list is no business of the catalog. */
|
|
741
|
+
declare const CALL_KEYS: readonly string[];
|
|
742
|
+
/** Keys of older data and what they are now - read as before, the Designer writes the new key. */
|
|
743
|
+
declare const OLD_CALL_KEYS: Readonly<Record<string, string>>;
|
|
744
|
+
/** The message after success: successMessage, else the older notification(s).success. */
|
|
745
|
+
declare function successMessageOf(option: any): string;
|
|
746
|
+
/** Actions that keep no records and call nothing - no storage, no attributes of this catalog. */
|
|
747
|
+
declare const NO_CALL_ACTIONS: Readonly<Record<string, string>>;
|
|
748
|
+
/** The kind of an element by its action / innerAction and where it stands (a menu entry or page loads). */
|
|
749
|
+
declare function callKindOf(option: any, place?: 'menu' | 'page' | 'button' | 'autocomplete'): CallKind | null;
|
|
750
|
+
/** The storage an option means: its storageType (any case, an old value translated), else the kind's default. */
|
|
751
|
+
declare function storageOf(option: any, kind: CallKind): Storage;
|
|
752
|
+
/** True when the option waits for its filter fields before loading (loadOnFilter, or the older storageType "filter"). */
|
|
753
|
+
declare function waitsForFilter(option: any): boolean;
|
|
754
|
+
/** The attributes that count for this kind with this storage. */
|
|
755
|
+
declare function callAttributes(kind: CallKind, storage: Storage): readonly string[];
|
|
756
|
+
/** The method an option uses: its own (upper case), else the kind's default; '' when the kind has none. */
|
|
757
|
+
declare function methodOf(option: any, kind: CallKind): string;
|
|
758
|
+
interface CallProblem {
|
|
759
|
+
code: 'storage-unknown' | 'storage-old' | 'storage-not-allowed' | 'attribute-not-for-storage' | 'method-unknown' | 'address-missing';
|
|
760
|
+
key?: string;
|
|
761
|
+
message: string;
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* Checks one option against its kind: a known storage the kind may use, only attributes of that storage, a method of
|
|
765
|
+
* the kind, an address for the backend. Keys outside CALL_KEYS (style, visible, …) are not looked at.
|
|
766
|
+
*/
|
|
767
|
+
declare function checkCall(option: any, kind: CallKind): CallProblem[];
|
|
768
|
+
/** Where an action stands. A field is a checkbox or input of a form, a column a column of a table. */
|
|
769
|
+
type ActionPlace = 'menu' | 'button' | 'field' | 'column';
|
|
770
|
+
interface ActionRule {
|
|
771
|
+
/** what it does, for the (i) */
|
|
772
|
+
does: string;
|
|
773
|
+
/** where it may stand */
|
|
774
|
+
places: readonly ActionPlace[];
|
|
775
|
+
/** the option keys that belong to it besides the action itself */
|
|
776
|
+
keys: readonly string[];
|
|
777
|
+
}
|
|
778
|
+
/** Actions that stay in the app. */
|
|
779
|
+
declare const INNER_ACTIONS: Readonly<Record<string, ActionRule>>;
|
|
780
|
+
/** Actions that call the backend - each with its kind of call (CALL_KINDS). */
|
|
781
|
+
declare const BACKEND_ACTIONS: Readonly<Record<string, ActionRule & {
|
|
782
|
+
kind: CallKind;
|
|
783
|
+
}>>;
|
|
784
|
+
/** The operators of calculate. */
|
|
785
|
+
declare const CALCULATE_OPERATORS: readonly ["multiply", "add", "subtract", "divide"];
|
|
786
|
+
/** What an element does, in the new form - read from the new form and from every older one. */
|
|
787
|
+
interface ElementAction {
|
|
788
|
+
/** the backend action (save, saveAll, submit, delete) */
|
|
789
|
+
action?: string;
|
|
790
|
+
/** the app action (openPage, addToCart, showModal, cancel, login, logout, cart, copy, calculate) */
|
|
791
|
+
innerAction?: string;
|
|
792
|
+
/** the keys that belong to it (from, to, operator, fields) */
|
|
793
|
+
params: Record<string, any>;
|
|
794
|
+
/** the value as it stood, when it is not the new form (for the check and the conversion) */
|
|
795
|
+
old?: string;
|
|
796
|
+
}
|
|
797
|
+
/**
|
|
798
|
+
* What an element does. Older forms are understood: a menu entry's action "get" (opens its page - no action),
|
|
799
|
+
* its cart / login / logout; a button's action "get" (openPage); innerAction saveAll / submit (backend actions);
|
|
800
|
+
* innerAction as an object { action: copy | multiply, from, to }.
|
|
801
|
+
*/
|
|
802
|
+
declare function elementAction(option: any, place: ActionPlace): ElementAction;
|
|
803
|
+
/** The option written in the new form - keys of the old form removed, everything else kept. */
|
|
804
|
+
declare function withElementAction(option: any, place: ActionPlace): any;
|
|
805
|
+
/** Problems of an element's action for the check: an unknown value or one in the wrong place. */
|
|
806
|
+
declare function checkElementAction(option: any, place: ActionPlace): string[];
|
|
807
|
+
/**
|
|
808
|
+
* The name of what an element does, in the new form ('' = nothing): save, saveAll, submit, delete, openPage,
|
|
809
|
+
* addToCart, showModal, cancel, login, logout, cart, copy, calculate. Code asks this instead of comparing action or
|
|
810
|
+
* innerAction with a value, so older forms (a button's "get", innerAction "saveAll") mean the same.
|
|
811
|
+
*/
|
|
812
|
+
declare function actionName(option: any, place?: ActionPlace): string;
|
|
813
|
+
/** The keys of what an element does (copy: from, to; calculate: operator, fields; openPage: layout_url). */
|
|
814
|
+
declare function actionParams(option: any, place?: ActionPlace): Record<string, any>;
|
|
815
|
+
/**
|
|
816
|
+
* The page's own data source (OFFENE-PUNKTE 145): a page loads its records itself - "dataSource" in its
|
|
817
|
+
* layout_schema.json holds the call (storageType, data_url, method, passToken, params, body, dateFormat, dataKey,
|
|
818
|
+
* loadOnFilter, proxy, messages) and its data object (property_url). Opened from a menu entry or a button, the
|
|
819
|
+
* page's source wins; without one the opener's keys count as before.
|
|
820
|
+
*/
|
|
821
|
+
declare function withPageSource(option: any, pageLayout: any): any;
|
|
822
|
+
/** One line of the conversion list: where, what it was, what it is now - or why it stays. */
|
|
823
|
+
interface ConversionChange {
|
|
824
|
+
/** the file, e.g. main/layout_schema.json or pages/books/layout_schema.json */
|
|
825
|
+
file: string;
|
|
826
|
+
/** the element in the file, e.g. left.elements[0] */
|
|
827
|
+
where: string;
|
|
828
|
+
caption?: string;
|
|
829
|
+
old: string;
|
|
830
|
+
new: string;
|
|
831
|
+
/** false: left as it is - reason says why */
|
|
832
|
+
done: boolean;
|
|
833
|
+
reason?: string;
|
|
834
|
+
/** why it stays, for the Designer's own texts: searchField, cart, noPage, hasSource, severalWays, openedByButtons, unknown */
|
|
835
|
+
reasonCode?: 'searchField' | 'cart' | 'noPage' | 'hasSource' | 'severalWays' | 'openedByButtons' | 'unknown';
|
|
836
|
+
}
|
|
837
|
+
/**
|
|
838
|
+
* An app written in the new form (OFFENE-PUNKTE 105/145 step 5). files: Main and the pages by their path
|
|
839
|
+
* (main/layout_schema.json, pages/<path>/layout_schema.json). Returns the changed files (copies - the given ones are
|
|
840
|
+
* not touched) and the list of every change and of what stays:
|
|
841
|
+
* - every element's action in the new form (withElementAction: button get -> innerAction openPage, innerAction
|
|
842
|
+
* submit / saveAll -> action, menu logout / login / cart -> innerAction, copy / multiply -> copy / calculate, a
|
|
843
|
+
* sign-in form with an address -> action loginForm; a menu entry's get is dropped);
|
|
844
|
+
* - a menu entry's call (data_url, storageType, method, dataKey, property_url …) moved into its page as dataSource -
|
|
845
|
+
* only when the menu entries opening that page all carry the same call and nothing else opens it (the page's source
|
|
846
|
+
* would win over any other opener). It stays at the header search field (its call depends on the typed text), at
|
|
847
|
+
* the cart (data_url is the cart's storage name) and at a page that has a dataSource already.
|
|
848
|
+
*/
|
|
849
|
+
declare function convertOlderForms(files: Record<string, any>): {
|
|
850
|
+
files: Record<string, any>;
|
|
851
|
+
changes: ConversionChange[];
|
|
852
|
+
};
|
|
853
|
+
|
|
854
|
+
/** The keys whose text is shown to a person: a caption (label.caption or an element's own), placeholder, tooltip, dialog title. */
|
|
855
|
+
declare const SHOWN_TEXT_KEYS: readonly ["caption", "placeholder", "tooltip", "modalTitle"];
|
|
856
|
+
/**
|
|
857
|
+
* The texts of a layout (or property schema) in the language of `texts` (the language file: written text -> its
|
|
858
|
+
* translation). With values: also a property's start value (a text without {{ }}), as the grid's footer needs.
|
|
859
|
+
* inPlace: changes the given schema (its first texts are remembered); else works on a copy. Missing translation:
|
|
860
|
+
* the written text.
|
|
861
|
+
*/
|
|
862
|
+
declare function translateCaptions<T>(schema: T, texts: Record<string, string> | null | undefined, { inPlace, values }?: {
|
|
863
|
+
inPlace?: boolean;
|
|
864
|
+
values?: boolean;
|
|
865
|
+
}): T;
|
|
866
|
+
|
|
867
|
+
/** Storage keys kept when a flow starts with empty app data: sign-in, tenant, project, accepted terms, the recorder, the runner's own. */
|
|
868
|
+
declare const APP_DATA_KEEP = "token|expires|nonce|pkce|session_state|keycloak|logined|granted_scopes|id_token|okta|tenant|project|terms|networkLogs|vl-test";
|
|
869
|
+
/** Texts on the page still in the main language although the language file has them, or raw keys ("termsShowAgain"). */
|
|
870
|
+
declare function probeUntranslated(texts: Record<string, string>, lang: string, main: string): string[];
|
|
871
|
+
/** What the page shows, measured for the layout rules (layoutProblems): fields, buttons, texts with their boxes. */
|
|
872
|
+
declare function probeLayoutSnapshot(): {
|
|
873
|
+
width: number;
|
|
874
|
+
height: number;
|
|
875
|
+
scrollsSideways: boolean;
|
|
876
|
+
boxes: any[];
|
|
877
|
+
scrollers: any[];
|
|
878
|
+
header?: any;
|
|
879
|
+
cardRows: number[][];
|
|
880
|
+
};
|
|
881
|
+
/** Whether a field (data-vl-path with a dot, else data-vl-field) stands visible above an open keyboard: '' or why not. */
|
|
882
|
+
declare function probeFieldVisible(key: string): string;
|
|
883
|
+
/** Where the page stands: the window's and the scrolling content's place, the page's height (expect restored). */
|
|
884
|
+
declare function probePagePlace(): {
|
|
885
|
+
scrollY: number;
|
|
886
|
+
scrollTop: number;
|
|
887
|
+
height: number;
|
|
888
|
+
};
|
|
889
|
+
/** The app's data in the browser (local and session), without what is kept (keep: APP_DATA_KEEP) - put back after a flow. */
|
|
890
|
+
declare function probeStorageSnapshot(keep: string): {
|
|
891
|
+
local: [string, string][];
|
|
892
|
+
session: [string, string][];
|
|
893
|
+
};
|
|
894
|
+
/** Empties the app's data in the browser (not what is kept); true when something was removed. */
|
|
895
|
+
declare function probeClearAppData(keep: string): boolean;
|
|
896
|
+
/** Puts the app's data back as it was before the flow (probeStorageSnapshot); true when something had changed. */
|
|
897
|
+
declare function probeRestoreStorage(snapshot: {
|
|
898
|
+
local: [string, string][];
|
|
899
|
+
session: [string, string][];
|
|
900
|
+
}, keep: string): boolean;
|
|
901
|
+
/** The parts that must stay inside the screen (expect inFrame), as selectors of the page. */
|
|
902
|
+
declare const FRAME_SELECTORS: Record<string, string>;
|
|
903
|
+
/** A frame part (its selector from FRAME_SELECTORS): null when not shown, else whether it stays inside the screen and its box. */
|
|
904
|
+
declare function probeInFrame(selector: string): {
|
|
905
|
+
in: boolean;
|
|
906
|
+
box: number[];
|
|
907
|
+
width: number;
|
|
908
|
+
height: number;
|
|
909
|
+
} | null;
|
|
910
|
+
/**
|
|
911
|
+
* A field as tests name it (data-vl-path with a dot, else data-vl-field; only shown ones; a key in two DTOs on the page
|
|
912
|
+
* is ambiguous): what it shows and whether it is locked. null when not there; { ambiguous } when the key is not enough.
|
|
913
|
+
*/
|
|
914
|
+
declare function probeField(key: string): {
|
|
915
|
+
text: string;
|
|
916
|
+
locked: boolean;
|
|
917
|
+
} | {
|
|
918
|
+
ambiguous: string[];
|
|
919
|
+
} | null;
|
|
920
|
+
|
|
921
|
+
type Bag = Record<string, any>;
|
|
922
|
+
/** "fontSize" -> "font-size", "WebkitLineClamp" -> "-webkit-line-clamp"; a CSS name (and --var) stays. */
|
|
923
|
+
declare function cssStyleKey(key: string): string;
|
|
924
|
+
/** "font-size" -> "fontSize" - for code that reads a property in both spellings. */
|
|
925
|
+
declare function camelStyleKey(key: string): string;
|
|
926
|
+
/** A property of a style object in either spelling: styleValue(style, 'align-items'). */
|
|
927
|
+
declare function styleValue(style: Bag | null | undefined, cssName: string): any;
|
|
928
|
+
/**
|
|
929
|
+
* The style object in CSS spelling. A property written twice keeps the later one - the browser applies the keys
|
|
930
|
+
* in their order, so that is the value the app shows today. classes and non-property values (objects) stay.
|
|
931
|
+
*/
|
|
932
|
+
declare function cssStyle<T extends Bag | null | undefined>(style: T): T;
|
|
933
|
+
/** A key that holds a style object in a page: style, stylePerCard and every …Style (wrapperStyle, labelStyle …). */
|
|
934
|
+
declare function isStyleHolder(key: string, value: unknown): boolean;
|
|
935
|
+
interface StyleSpellingFinding {
|
|
936
|
+
/** where in the page: center.formSections[0].formFields[2].style */
|
|
937
|
+
path: string;
|
|
938
|
+
/** the camelCase name as written */
|
|
939
|
+
key: string;
|
|
940
|
+
/** its CSS name */
|
|
941
|
+
css: string;
|
|
942
|
+
/** the block holds the property in both spellings - the later value is kept */
|
|
943
|
+
twice: boolean;
|
|
944
|
+
}
|
|
945
|
+
/** Style properties of a page written in camelCase. */
|
|
946
|
+
declare function styleSpellingFindings(doc: unknown): StyleSpellingFinding[];
|
|
947
|
+
/** The page with every style object in CSS spelling, and what was changed. The page is not changed in place. */
|
|
948
|
+
declare function normalizeStyleSpelling<T>(doc: T): {
|
|
949
|
+
doc: T;
|
|
950
|
+
findings: StyleSpellingFinding[];
|
|
951
|
+
};
|
|
474
952
|
|
|
475
|
-
export { APP_SETTINGS, APP_SETTINGS_PATH, APP_SETTING_BLOCKS, BASIC_TYPES, CARD_LAYOUTS, CONTROLS, CONTROL_TYPES, DATA_FORMATS, DATA_OBJECT_KEYS, DATA_OBJECT_NAME_PLACES, DATA_OBJECT_PLACES, DEFAULT_DEVICES, DISPLAY_FORMATS, DOCUMENT_KINDS, EXPECT_KINDS, FRAME_PARTS, KEYBOARD_CONTROLS, KEYBOARD_TYPES, LIST_STATES, LOGIN_FLAGS, LOGIN_METHODS, LOGIN_STORAGES, LOGIN_WHEN, MENU_DECIDED_BY, MENU_ENTRY_KINDS, MENU_SWITCHABLE, NUMBER_STYLES, ORIENTATIONS, PAGINATION_ALIGNS, PAGINATION_PLACEMENTS, PAGINATION_TYPES, PLACEHOLDER_CONTROLS, RESULTS_DIR, RESULTS_KEEP, SETTING_MENU_TEXTS, START_PAGE_KEYS, START_PAGE_PATH, STEP_KINDS, SYSTEM_KEYBOARDS, TEMPORAL_TRANSFER, TERMS_DOCUMENTS, TESTS_DIR, TEST_DATA_FILE, TEST_DEVICES, TYPE_ALIASES, appSettingsMenu, assertFieldSettings, baseType, basicType, canonicalControl, cardLayoutOf, checkAppSettings, checkPagePagination, checkTestFlow, clone, controlChoicesFor, controlsFor, dataSettings, defaultKeyboard, displaySettings, effectiveControl, effectiveFormat, flowDevices, keyboardFor, languageName, loginMethod, normalizeFormat, pageOf, paginationFor, parseDevice, readAppSettings, renameDataObject, resolveProperty, resultsToDelete, rolesOf, rulesFor, startPage, startPageFor, stepKind, temporalPart, testDataRefs, validateSettings, validationSettings, withTestData };
|
|
476
|
-
export type { AppSettingBlock, AppSettingDef, AppSettings, AppSettingsProblem, Bag, CardLayout, DocumentKind, FlowResult, LoginStorage, LoginWhen, MenuEntryKind, Orientation, Pagination, PaginationAlign, PaginationPlacement, PaginationType, Setting, StepResult, TemporalPart, TermsDocument, TestDevice, TestExpect, TestFlow, TestProblem, TestRun, TestStep };
|
|
953
|
+
export { APP_DATA_KEEP, APP_KEYBOARD_DEVICES, APP_SETTINGS, APP_SETTINGS_PATH, APP_SETTING_BLOCKS, BACKEND_ACTIONS, BASIC_TYPES, BROWSER_STORAGES, CALCULATE_OPERATORS, CALL_KEYS, CALL_KINDS, CARD_LAYOUTS, CONTROLS, CONTROL_TYPES, DATA_FORMATS, DATA_OBJECT_KEYS, DATA_OBJECT_NAME_PLACES, DATA_OBJECT_PLACES, DEFAULT_DEVICES, DEFAULT_TEMPO_SECONDS, DISPLAY_FORMATS, DOCUMENT_KINDS, ENTER_KEYS, EXPECT_KINDS, FORMATS, FRAME_PARTS, FRAME_SELECTORS, HEADER_SCROLLS, INNER_ACTIONS, KEYBOARD_CONTROLS, KEYBOARD_TYPES, LIST_STATES, LOGIN_FLAGS, LOGIN_METHODS, LOGIN_STORAGES, LOGIN_WHEN, MENU_DECIDED_BY, MENU_ENTRY_KINDS, MENU_SWITCHABLE, NO_CALL_ACTIONS, NUMBER_STYLES, OLD_CALL_KEYS, OLD_DEVICE_NAMES, OLD_STORAGES, ORIENTATIONS, PAGINATION_ALIGNS, PAGINATION_PLACEMENTS, PAGINATION_TYPES, PLACEHOLDER_CONTROLS, PLACEHOLDER_SOURCE, RESULTS_DIR, RESULTS_KEEP, RTL_LANGUAGES, SETTING_MENU_TEXTS, SHOWN_TEXT_KEYS, START_PAGE_KEYS, START_PAGE_PATH, STEP_KINDS, STORAGES, STRIPE_TEST_CARDS, SYSTEM_KEYBOARDS, TEMPORAL_TRANSFER, TERMS_DOCUMENTS, TESTS_DIR, TEST_DATA_FILE, TEST_DEVICES, TEST_TEMPOS, TYPE_ALIASES, actionName, actionParams, alignRowsOf, appSettingsMenu, assertFieldSettings, base32Bytes, baseType, basicType, callAttributes, callKindOf, camelStyleKey, canonicalControl, cardLayoutOf, checkAppSettings, checkCall, checkElementAction, checkPagePagination, checkTestFlow, clone, controlChoicesFor, controlsFor, convertOlderForms, cssStyle, cssStyleKey, dataSettings, dateOrder, defaultKeyboard, deviceChoices, displaySettings, effectiveControl, effectiveFormat, elementAction, enterKeyFor, flowDevices, flowLanguages, hasAppKeyboard, headerScrollOf, isKeyboardCheck, isStyleHolder, keyboardFor, languageName, layoutNotes, layoutProblems, localeKeys, localeRenderings, loginMethod, matchesTemplate, maxLinesOf, menuCaption, menuEntries, menuEntryByCaption, menuEntryForPage, menuPage, methodOf, normalizeFormat, normalizeStyleSpelling, pageOf, paginationFor, parseDevice, probeClearAppData, probeField, probeFieldVisible, probeInFrame, probeLayoutSnapshot, probePagePlace, probeRestoreStorage, probeStorageSnapshot, probeUntranslated, readAppSettings, readTestUser, renameDataObject, resolveProperty, resultsToDelete, rolesOf, rulesFor, startPage, startPageFor, stepKind, storageOf, stripeTestPaymentMethod, styleSpellingFindings, styleValue, successMessageOf, tempoPause, temporalPart, testDataRefs, testUserEntry, totp, translateCaptions, uses12Hours, validateSettings, validationSettings, vaultJwtLogin, vaultPlace, waitsForFilter, withElementAction, withPageSource, withTestData };
|
|
954
|
+
export type { ActionPlace, ActionRule, AppSettingBlock, AppSettingDef, AppSettings, AppSettingsProblem, Bag$1 as Bag, CallKind, CallKindRule, CallProblem, CardLayout, ConversionChange, DocumentKind, ElementAction, EnterKey, FlowResult, HeaderScroll, LayoutBox, LayoutScroller, LayoutSnapshot, LoginStorage, LoginWhen, MenuEntryKind, Orientation, Pagination, PaginationAlign, PaginationPlacement, PaginationType, Setting, StepResult, Storage, StyleSpellingFinding, TemporalPart, TermsDocument, TestDevice, TestExpect, TestFlow, TestProblem, TestRun, TestStep, TestTempo, TestUser, TestUserEntry };
|