@numerum-tech/yeriasdk 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +864 -0
- package/dist/core/action-grid-view.d.ts +57 -0
- package/dist/core/action-grid-view.d.ts.map +1 -0
- package/dist/core/action-grid-view.js +112 -0
- package/dist/core/action-grid-view.js.map +1 -0
- package/dist/core/action-list-view.d.ts +39 -0
- package/dist/core/action-list-view.d.ts.map +1 -0
- package/dist/core/action-list-view.js +77 -0
- package/dist/core/action-list-view.js.map +1 -0
- package/dist/core/base/base-action-view.d.ts +82 -0
- package/dist/core/base/base-action-view.d.ts.map +1 -0
- package/dist/core/base/base-action-view.js +143 -0
- package/dist/core/base/base-action-view.js.map +1 -0
- package/dist/core/base-view.d.ts +105 -0
- package/dist/core/base-view.d.ts.map +1 -0
- package/dist/core/base-view.js +426 -0
- package/dist/core/base-view.js.map +1 -0
- package/dist/core/card-view.d.ts +24 -0
- package/dist/core/card-view.d.ts.map +1 -0
- package/dist/core/card-view.js +127 -0
- package/dist/core/card-view.js.map +1 -0
- package/dist/core/carousel-view.d.ts +22 -0
- package/dist/core/carousel-view.d.ts.map +1 -0
- package/dist/core/carousel-view.js +99 -0
- package/dist/core/carousel-view.js.map +1 -0
- package/dist/core/form-view.d.ts +165 -0
- package/dist/core/form-view.d.ts.map +1 -0
- package/dist/core/form-view.js +365 -0
- package/dist/core/form-view.js.map +1 -0
- package/dist/core/jsonapp.d.ts +263 -0
- package/dist/core/jsonapp.d.ts.map +1 -0
- package/dist/core/jsonapp.js +528 -0
- package/dist/core/jsonapp.js.map +1 -0
- package/dist/core/key-store.d.ts +51 -0
- package/dist/core/key-store.d.ts.map +1 -0
- package/dist/core/key-store.js +138 -0
- package/dist/core/key-store.js.map +1 -0
- package/dist/core/map-view.d.ts +45 -0
- package/dist/core/map-view.d.ts.map +1 -0
- package/dist/core/map-view.js +318 -0
- package/dist/core/map-view.js.map +1 -0
- package/dist/core/media-view.d.ts +20 -0
- package/dist/core/media-view.d.ts.map +1 -0
- package/dist/core/media-view.js +75 -0
- package/dist/core/media-view.js.map +1 -0
- package/dist/core/message-view.d.ts +53 -0
- package/dist/core/message-view.d.ts.map +1 -0
- package/dist/core/message-view.js +109 -0
- package/dist/core/message-view.js.map +1 -0
- package/dist/core/notification.d.ts +17 -0
- package/dist/core/notification.d.ts.map +1 -0
- package/dist/core/notification.js +33 -0
- package/dist/core/notification.js.map +1 -0
- package/dist/core/qr-display-view.d.ts +32 -0
- package/dist/core/qr-display-view.d.ts.map +1 -0
- package/dist/core/qr-display-view.js +66 -0
- package/dist/core/qr-display-view.js.map +1 -0
- package/dist/core/qr-scan-view.d.ts +148 -0
- package/dist/core/qr-scan-view.d.ts.map +1 -0
- package/dist/core/qr-scan-view.js +259 -0
- package/dist/core/qr-scan-view.js.map +1 -0
- package/dist/core/reader-view.d.ts +73 -0
- package/dist/core/reader-view.d.ts.map +1 -0
- package/dist/core/reader-view.js +285 -0
- package/dist/core/reader-view.js.map +1 -0
- package/dist/core/timeline-view.d.ts +16 -0
- package/dist/core/timeline-view.d.ts.map +1 -0
- package/dist/core/timeline-view.js +68 -0
- package/dist/core/timeline-view.js.map +1 -0
- package/dist/errors/index.d.ts +276 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +431 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +103 -0
- package/dist/index.js.map +1 -0
- package/dist/types/index.d.ts +576 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +48 -0
- package/dist/types/index.js.map +1 -0
- package/dist/utils/fileFormats.d.ts +52 -0
- package/dist/utils/fileFormats.d.ts.map +1 -0
- package/dist/utils/fileFormats.js +198 -0
- package/dist/utils/fileFormats.js.map +1 -0
- package/dist/utils/logger.d.ts +38 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +109 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/validators.d.ts +48 -0
- package/dist/utils/validators.d.ts.map +1 -0
- package/dist/utils/validators.js +445 -0
- package/dist/utils/validators.js.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,426 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseView = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
const errors_1 = require("../errors");
|
|
6
|
+
const validators_1 = require("../utils/validators");
|
|
7
|
+
class BaseView {
|
|
8
|
+
constructor(config) {
|
|
9
|
+
this.state = {};
|
|
10
|
+
this.id = config.id;
|
|
11
|
+
this.type = config.type;
|
|
12
|
+
this.metadata = config.metadata;
|
|
13
|
+
// Initialize process context if processId provided
|
|
14
|
+
if (config.processId) {
|
|
15
|
+
this.processContext = {
|
|
16
|
+
processId: config.processId
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Valide la vue avant de la servir
|
|
22
|
+
*/
|
|
23
|
+
validate() {
|
|
24
|
+
const errors = [];
|
|
25
|
+
const warnings = [];
|
|
26
|
+
if (!this.id || this.id.trim() === '') {
|
|
27
|
+
errors.push((0, types_1.createValidationError)('View ID is required'));
|
|
28
|
+
}
|
|
29
|
+
if (!this.type) {
|
|
30
|
+
errors.push((0, types_1.createValidationError)('View type is required'));
|
|
31
|
+
}
|
|
32
|
+
if (!this.content) {
|
|
33
|
+
errors.push((0, types_1.createValidationError)('View content is required'));
|
|
34
|
+
}
|
|
35
|
+
// Validation spécifique par type de vue
|
|
36
|
+
switch (this.type) {
|
|
37
|
+
case 'Form':
|
|
38
|
+
if (!this.content ||
|
|
39
|
+
!Array.isArray(this.content['fields']) ||
|
|
40
|
+
this.content['fields'].length === 0) {
|
|
41
|
+
errors.push((0, types_1.createValidationError)('Form must have at least one field'));
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
// Exclude separator fields from "at least one field" validation
|
|
45
|
+
const fields = this.content['fields'];
|
|
46
|
+
const nonSeparatorFields = fields.filter((f) => f.fieldType !== 'separator');
|
|
47
|
+
if (nonSeparatorFields.length === 0) {
|
|
48
|
+
errors.push((0, types_1.createValidationError)('Form must have at least one non-separator field'));
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
break;
|
|
52
|
+
case 'ActionList':
|
|
53
|
+
case 'ActionGrid':
|
|
54
|
+
if (!this.content ||
|
|
55
|
+
!Array.isArray(this.content['actions']) ||
|
|
56
|
+
this.content['actions'].length === 0) {
|
|
57
|
+
errors.push((0, types_1.createValidationError)('Action views must have at least one action'));
|
|
58
|
+
}
|
|
59
|
+
break;
|
|
60
|
+
case 'Reader':
|
|
61
|
+
if (typeof this.content === 'object' && this.content !== null) {
|
|
62
|
+
const readerContent = this.content;
|
|
63
|
+
if (!readerContent.title || !readerContent.title.trim()) {
|
|
64
|
+
errors.push((0, types_1.createValidationError)('Reader view must have a title'));
|
|
65
|
+
}
|
|
66
|
+
if (!readerContent.elements || readerContent.elements.length === 0) {
|
|
67
|
+
errors.push((0, types_1.createValidationError)('Reader view must contain at least one element'));
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
break;
|
|
71
|
+
case 'Message':
|
|
72
|
+
if (typeof this.content === 'object' && this.content !== null) {
|
|
73
|
+
const messageContent = this.content;
|
|
74
|
+
const hasBody = typeof messageContent.body === 'string' && messageContent.body.trim().length > 0;
|
|
75
|
+
const hasIntro = typeof messageContent.intro === 'string' && messageContent.intro.trim().length > 0;
|
|
76
|
+
if (!hasBody && !hasIntro) {
|
|
77
|
+
errors.push((0, types_1.createValidationError)('Message view must define a body or an intro'));
|
|
78
|
+
}
|
|
79
|
+
if (!messageContent.confirm) {
|
|
80
|
+
errors.push((0, types_1.createValidationError)('Message view must define a primary action'));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
errors.push((0, types_1.createValidationError)('Message view content is invalid'));
|
|
85
|
+
}
|
|
86
|
+
break;
|
|
87
|
+
case 'Card':
|
|
88
|
+
if (typeof this.content === 'object' && this.content !== null) {
|
|
89
|
+
const card = this.content;
|
|
90
|
+
const hasDetail = (typeof card.description === 'string' && card.description.trim().length > 0) ||
|
|
91
|
+
(Array.isArray(card.stats) && card.stats.length > 0) ||
|
|
92
|
+
(Array.isArray(card.sections) && card.sections.length > 0);
|
|
93
|
+
if (!hasDetail) {
|
|
94
|
+
errors.push((0, types_1.createValidationError)('Card view requires at least a description, stat, or section'));
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
errors.push((0, types_1.createValidationError)('Card view content is invalid'));
|
|
99
|
+
}
|
|
100
|
+
break;
|
|
101
|
+
case 'Carousel':
|
|
102
|
+
if (!this.content ||
|
|
103
|
+
!Array.isArray(this.content['slides']) ||
|
|
104
|
+
this.content['slides'].length === 0) {
|
|
105
|
+
errors.push((0, types_1.createValidationError)('Carousel view must contain at least one slide'));
|
|
106
|
+
}
|
|
107
|
+
break;
|
|
108
|
+
case 'Timeline':
|
|
109
|
+
if (!this.content ||
|
|
110
|
+
!Array.isArray(this.content['items']) ||
|
|
111
|
+
this.content['items'].length === 0) {
|
|
112
|
+
errors.push((0, types_1.createValidationError)('Timeline view must contain at least one entry'));
|
|
113
|
+
}
|
|
114
|
+
break;
|
|
115
|
+
case 'Media':
|
|
116
|
+
if (!this.content ||
|
|
117
|
+
!Array.isArray(this.content['items']) ||
|
|
118
|
+
this.content['items'].length === 0) {
|
|
119
|
+
errors.push((0, types_1.createValidationError)('Media view must contain at least one resource'));
|
|
120
|
+
}
|
|
121
|
+
break;
|
|
122
|
+
case 'Map': {
|
|
123
|
+
if (!this.content || typeof this.content !== 'object') {
|
|
124
|
+
errors.push((0, types_1.createValidationError)('Map view content is required'));
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
const mc = this.content;
|
|
128
|
+
const layers = Array.isArray(mc['layers']) ? mc['layers'] : [];
|
|
129
|
+
// unique layer ids
|
|
130
|
+
const seenLayerIds = new Set();
|
|
131
|
+
for (const l of layers) {
|
|
132
|
+
const id = l?.['id'];
|
|
133
|
+
if (typeof id !== 'string' || !id.trim()) {
|
|
134
|
+
errors.push((0, types_1.createValidationError)('Map layer must have a non-empty id'));
|
|
135
|
+
}
|
|
136
|
+
else if (seenLayerIds.has(id)) {
|
|
137
|
+
errors.push((0, types_1.createValidationError)(`Duplicate map layer id: "${id}"`));
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
seenLayerIds.add(id);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
const mode = mc['mode'] === 'pick' ? 'pick' : 'view';
|
|
144
|
+
if (mode === 'pick') {
|
|
145
|
+
const pick = mc['pick'];
|
|
146
|
+
if (!pick || typeof pick['submitUrl'] !== 'string' || !pick['submitUrl'].trim()) {
|
|
147
|
+
errors.push((0, types_1.createValidationError)('Map pick mode requires pick.submitUrl'));
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
else {
|
|
151
|
+
// view mode: needs at least one drawable layer OR an emptyMessage
|
|
152
|
+
const hasDrawable = layers.some((l) => {
|
|
153
|
+
if (l?.['visible'] === false)
|
|
154
|
+
return false;
|
|
155
|
+
const t = l?.['type'];
|
|
156
|
+
if (t === 'markers')
|
|
157
|
+
return Array.isArray(l['markers']) && l['markers'].length > 0;
|
|
158
|
+
if (t === 'shapes')
|
|
159
|
+
return Array.isArray(l['shapes']) && l['shapes'].length > 0;
|
|
160
|
+
if (t === 'heatmap')
|
|
161
|
+
return Array.isArray(l['points']) && l['points'].length > 0;
|
|
162
|
+
if (t === 'tiles')
|
|
163
|
+
return typeof l['url'] === 'string';
|
|
164
|
+
if (t === 'geojson')
|
|
165
|
+
return !!l['data'];
|
|
166
|
+
return false;
|
|
167
|
+
});
|
|
168
|
+
const emptyMsg = mc['emptyMessage'];
|
|
169
|
+
const hasEmptyMessage = typeof emptyMsg === 'string' && emptyMsg.trim().length > 0;
|
|
170
|
+
if (!hasDrawable && !hasEmptyMessage) {
|
|
171
|
+
errors.push((0, types_1.createValidationError)('Map view must contain at least one drawable layer or an emptyMessage'));
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
case 'QRDisplay':
|
|
177
|
+
if (!this.content ||
|
|
178
|
+
!this.content['qrImage'] ||
|
|
179
|
+
!this.content['qrTitle'] ||
|
|
180
|
+
!this.content['qrDescription']) {
|
|
181
|
+
errors.push((0, types_1.createValidationError)('QRDisplay view must have a QR code with image, title, and description'));
|
|
182
|
+
}
|
|
183
|
+
break;
|
|
184
|
+
}
|
|
185
|
+
return {
|
|
186
|
+
isValid: errors.length === 0,
|
|
187
|
+
errors,
|
|
188
|
+
warnings: warnings.length > 0 ? warnings : undefined
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Sert la vue avec validation
|
|
193
|
+
*/
|
|
194
|
+
serve() {
|
|
195
|
+
const validation = this.validate();
|
|
196
|
+
if (!validation.isValid) {
|
|
197
|
+
const errorMessages = validation.errors.map(e => e.message);
|
|
198
|
+
throw new errors_1.ViewValidationError(this.id, this.type, errorMessages);
|
|
199
|
+
}
|
|
200
|
+
// Warnings are available in validation result for users to handle
|
|
201
|
+
const result = {
|
|
202
|
+
id: this.id,
|
|
203
|
+
type: this.type,
|
|
204
|
+
content: this.content,
|
|
205
|
+
};
|
|
206
|
+
// Ajouter le contexte de processus si présent (mobile app needs this for URL construction)
|
|
207
|
+
if (this.processContext) {
|
|
208
|
+
result['process'] = this.processContext;
|
|
209
|
+
}
|
|
210
|
+
// Ajouter les métadonnées si présentes
|
|
211
|
+
if (this.metadata) {
|
|
212
|
+
result['metadata'] = this.metadata;
|
|
213
|
+
}
|
|
214
|
+
// Ajouter l'état si présent
|
|
215
|
+
if (Object.keys(this.state).length > 0) {
|
|
216
|
+
result['state'] = this.state;
|
|
217
|
+
}
|
|
218
|
+
// Ajouter la navigation si présente
|
|
219
|
+
if (this.navigation) {
|
|
220
|
+
result['nav'] = this.navigation;
|
|
221
|
+
}
|
|
222
|
+
return result;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Retourne la représentation JSON de la vue
|
|
226
|
+
*/
|
|
227
|
+
toJSON() {
|
|
228
|
+
return this.serve();
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Met à jour l'état de la vue
|
|
232
|
+
*/
|
|
233
|
+
setState(key, value) {
|
|
234
|
+
this.state[key] = value;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Obtient une valeur de l'état
|
|
238
|
+
*/
|
|
239
|
+
getState(key) {
|
|
240
|
+
return this.state[key];
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Clone la vue
|
|
244
|
+
* Uses structuredClone for efficient deep cloning when available, falls back to JSON serialization
|
|
245
|
+
*/
|
|
246
|
+
clone() {
|
|
247
|
+
const cloned = Object.create(Object.getPrototypeOf(this));
|
|
248
|
+
const clonedMetadata = this.metadata
|
|
249
|
+
? {
|
|
250
|
+
...this.metadata,
|
|
251
|
+
createdAt: this.metadata.createdAt instanceof Date
|
|
252
|
+
? new Date(this.metadata.createdAt.getTime())
|
|
253
|
+
: this.metadata.createdAt
|
|
254
|
+
}
|
|
255
|
+
: undefined;
|
|
256
|
+
// Use structuredClone if available (Node 17+, modern browsers) for better performance
|
|
257
|
+
// Falls back to JSON serialization for compatibility
|
|
258
|
+
const cloneContent = typeof structuredClone !== 'undefined'
|
|
259
|
+
? structuredClone(this.content)
|
|
260
|
+
: JSON.parse(JSON.stringify(this.content));
|
|
261
|
+
const cloneState = typeof structuredClone !== 'undefined'
|
|
262
|
+
? structuredClone(this.state)
|
|
263
|
+
: JSON.parse(JSON.stringify(this.state));
|
|
264
|
+
Object.assign(cloned, {
|
|
265
|
+
id: this.id,
|
|
266
|
+
type: this.type,
|
|
267
|
+
content: cloneContent,
|
|
268
|
+
state: cloneState,
|
|
269
|
+
metadata: clonedMetadata
|
|
270
|
+
});
|
|
271
|
+
cloned.navigation = this.navigation ? { ...this.navigation } : undefined;
|
|
272
|
+
cloned.processContext = this.processContext ? { ...this.processContext } : undefined;
|
|
273
|
+
return cloned;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* Vérifie si la vue est valide
|
|
277
|
+
*/
|
|
278
|
+
isValid() {
|
|
279
|
+
return this.validate().isValid;
|
|
280
|
+
}
|
|
281
|
+
/**
|
|
282
|
+
* Valide la vue et retourne le résultat
|
|
283
|
+
*/
|
|
284
|
+
validateView() {
|
|
285
|
+
return this.validate();
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Obtient les erreurs de validation
|
|
289
|
+
*/
|
|
290
|
+
getValidationErrors() {
|
|
291
|
+
return this.validate().errors.map(e => e.message);
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Obtient les avertissements de validation
|
|
295
|
+
*/
|
|
296
|
+
getValidationWarnings() {
|
|
297
|
+
return (this.validate().warnings || []).map(e => e.message);
|
|
298
|
+
}
|
|
299
|
+
/**
|
|
300
|
+
* Met à jour les métadonnées
|
|
301
|
+
*/
|
|
302
|
+
updateMetadata(metadata) {
|
|
303
|
+
if (this.metadata) {
|
|
304
|
+
this.metadata = { ...this.metadata, ...metadata };
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
this.metadata = metadata;
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
/**
|
|
311
|
+
* Obtient les métadonnées
|
|
312
|
+
*/
|
|
313
|
+
getMetadata() {
|
|
314
|
+
return this.metadata;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Protected helper to set intro/note text with strict validation
|
|
318
|
+
* Child views can expose this as setIntro(), setNote(), etc.
|
|
319
|
+
* @param fieldName - Name of the content field to set (e.g., 'intro', 'note')
|
|
320
|
+
* @param value - Text value to set
|
|
321
|
+
* @throws InvalidParameterError if value is empty or null
|
|
322
|
+
*/
|
|
323
|
+
setIntroText(fieldName, value) {
|
|
324
|
+
if (!value || value.trim().length === 0) {
|
|
325
|
+
throw new errors_1.InvalidParameterError(fieldName, value, `${fieldName} text cannot be empty`);
|
|
326
|
+
}
|
|
327
|
+
const trimmedValue = value.trim();
|
|
328
|
+
if (typeof this.content === 'object' && this.content !== null) {
|
|
329
|
+
this.content[fieldName] = trimmedValue;
|
|
330
|
+
}
|
|
331
|
+
return this;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Définit la vue suivante (navigation)
|
|
335
|
+
* Validates URL to prevent open redirects and malicious links
|
|
336
|
+
*/
|
|
337
|
+
setNext(url) {
|
|
338
|
+
// Validate URL for security
|
|
339
|
+
const validation = (0, validators_1.validateSubmissionURL)(url, {
|
|
340
|
+
...validators_1.DEFAULT_URL_CONFIG,
|
|
341
|
+
blockLocalhost: false, // Allow localhost for development
|
|
342
|
+
blockPrivateIPs: false // Allow private IPs for development
|
|
343
|
+
});
|
|
344
|
+
if (!validation.isValid) {
|
|
345
|
+
const errorMessages = validation.errors.map(e => e.message).join('; ');
|
|
346
|
+
throw new errors_1.InvalidParameterError('url', url, `Invalid navigation URL: ${errorMessages}`);
|
|
347
|
+
}
|
|
348
|
+
if (!this.navigation) {
|
|
349
|
+
this.navigation = {};
|
|
350
|
+
}
|
|
351
|
+
this.navigation.next = url;
|
|
352
|
+
return this;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Définit la vue précédente (navigation)
|
|
356
|
+
* Validates URL to prevent open redirects and malicious links
|
|
357
|
+
*/
|
|
358
|
+
setPrev(url) {
|
|
359
|
+
// Validate URL for security
|
|
360
|
+
const validation = (0, validators_1.validateSubmissionURL)(url, {
|
|
361
|
+
...validators_1.DEFAULT_URL_CONFIG,
|
|
362
|
+
blockLocalhost: false, // Allow localhost for development
|
|
363
|
+
blockPrivateIPs: false // Allow private IPs for development
|
|
364
|
+
});
|
|
365
|
+
if (!validation.isValid) {
|
|
366
|
+
const errorMessages = validation.errors.map(e => e.message).join('; ');
|
|
367
|
+
throw new errors_1.InvalidParameterError('url', url, `Invalid navigation URL: ${errorMessages}`);
|
|
368
|
+
}
|
|
369
|
+
if (!this.navigation) {
|
|
370
|
+
this.navigation = {};
|
|
371
|
+
}
|
|
372
|
+
this.navigation.prev = url;
|
|
373
|
+
return this;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Définit le contexte de processus pour cette vue
|
|
377
|
+
* @param processId - Identifiant unique du processus
|
|
378
|
+
* @param context - Contexte additionnel (étapes, nom, etc.)
|
|
379
|
+
*/
|
|
380
|
+
setProcess(processId, context) {
|
|
381
|
+
this.processContext = {
|
|
382
|
+
processId,
|
|
383
|
+
...(context || {})
|
|
384
|
+
};
|
|
385
|
+
return this;
|
|
386
|
+
}
|
|
387
|
+
/**
|
|
388
|
+
* Obtient le contexte de processus
|
|
389
|
+
*/
|
|
390
|
+
getProcessContext() {
|
|
391
|
+
return this.processContext;
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Obtient l'identifiant du processus (raccourci)
|
|
395
|
+
*/
|
|
396
|
+
getProcessId() {
|
|
397
|
+
return this.processContext?.processId;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Vérifie si cette vue fait partie d'un processus
|
|
401
|
+
*/
|
|
402
|
+
hasProcess() {
|
|
403
|
+
return this.processContext !== undefined;
|
|
404
|
+
}
|
|
405
|
+
/**
|
|
406
|
+
* Met à jour le contexte de processus
|
|
407
|
+
*/
|
|
408
|
+
updateProcessContext(updates) {
|
|
409
|
+
if (!this.processContext) {
|
|
410
|
+
throw new errors_1.NoProcessContextError(this.id, 'update');
|
|
411
|
+
}
|
|
412
|
+
this.processContext = {
|
|
413
|
+
...this.processContext,
|
|
414
|
+
...updates
|
|
415
|
+
};
|
|
416
|
+
return this;
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Nettoie les ressources de la vue
|
|
420
|
+
*/
|
|
421
|
+
destroy() {
|
|
422
|
+
this.state = {};
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
exports.BaseView = BaseView;
|
|
426
|
+
//# sourceMappingURL=base-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"base-view.js","sourceRoot":"","sources":["../../src/core/base-view.ts"],"names":[],"mappings":";;;AAAA,oCAQkB;AAClB,sCAA8F;AAC9F,oDAAgF;AAEhF,MAAsB,QAAQ;IAS1B,YAAY,MAAsB;QALxB,UAAK,GAAc,EAAE,CAAC;QAM5B,IAAI,CAAC,EAAE,GAAG,MAAM,CAAC,EAAE,CAAC;QACpB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACxB,IAAI,CAAC,QAAQ,GAAG,MAAM,CAAC,QAAQ,CAAC;QAChC,mDAAmD;QACnD,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACnB,IAAI,CAAC,cAAc,GAAG;gBAClB,SAAS,EAAE,MAAM,CAAC,SAAS;aAC9B,CAAC;QACN,CAAC;IACL,CAAC;IAED;;OAEG;IACO,QAAQ;QACd,MAAM,MAAM,GAA+C,EAAE,CAAC;QAC9D,MAAM,QAAQ,GAA+C,EAAE,CAAC;QAEhE,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACpC,MAAM,CAAC,IAAI,CAAC,IAAA,6BAAqB,EAAC,qBAAqB,CAAC,CAAC,CAAC;QAC9D,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;YACb,MAAM,CAAC,IAAI,CAAC,IAAA,6BAAqB,EAAC,uBAAuB,CAAC,CAAC,CAAC;QAChE,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;YAChB,MAAM,CAAC,IAAI,CAAC,IAAA,6BAAqB,EAAC,0BAA0B,CAAC,CAAC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EAAE,SAAS,CAAC;IAC1C,CAAC;IAED;;OAEG;IACH,UAAU;QACN,OAAO,IAAI,CAAC,cAAc,KAAK,SAAS,CAAC;IAC7C,CAAC;IAED;;OAEG;IACH,oBAAoB,CAAC,OAAgC;QACjD,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,CAAC;YACvB,MAAM,IAAI,8BAAqB,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,CAAC;QACvD,CAAC;QAED,IAAI,CAAC,cAAc,GAAG;YAClB,GAAG,IAAI,CAAC,cAAc;YACtB,GAAG,OAAO;SACb,CAAC;QAEF,OAAO,IAAI,CAAC;IAChB,CAAC;IAED;;OAEG;IACH,OAAO;QACH,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IACpB,CAAC;CACJ;AA9eD,4BA8eC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BaseView } from './base-view';
|
|
2
|
+
import { CardContent, CardActionVariant, HttpMethod } from '../types';
|
|
3
|
+
export declare class CardView extends BaseView {
|
|
4
|
+
constructor(viewId: string, title: string, processId?: string);
|
|
5
|
+
setSubtitle(subtitle: string): this;
|
|
6
|
+
setDescription(description: string): this;
|
|
7
|
+
setBadge(badge: string | undefined): this;
|
|
8
|
+
setImage(url: string, alt?: string): this;
|
|
9
|
+
clearImage(): this;
|
|
10
|
+
addStat(label: string, value: string): this;
|
|
11
|
+
clearStats(): this;
|
|
12
|
+
addSection(heading: string, body: string): this;
|
|
13
|
+
clearSections(): this;
|
|
14
|
+
addAction(text: string, method?: HttpMethod, options?: {
|
|
15
|
+
confirmMessage?: string;
|
|
16
|
+
href?: string;
|
|
17
|
+
icon?: string;
|
|
18
|
+
variant?: CardActionVariant;
|
|
19
|
+
}): this;
|
|
20
|
+
clearActions(): this;
|
|
21
|
+
setMetadata(meta: Record<string, unknown>): this;
|
|
22
|
+
getContent(): CardContent;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=card-view.d.ts.map
|
|
@@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
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CardView = void 0;
|
|
4
|
+
const base_view_1 = require("./base-view");
|
|
5
|
+
const errors_1 = require("../errors");
|
|
6
|
+
// CardView is a compact "product sheet" view that highlights a single item with stats, sections and actions.
|
|
7
|
+
class CardView extends base_view_1.BaseView {
|
|
8
|
+
constructor(viewId, title, processId) {
|
|
9
|
+
super({
|
|
10
|
+
id: viewId,
|
|
11
|
+
type: 'Card',
|
|
12
|
+
processId,
|
|
13
|
+
metadata: {
|
|
14
|
+
version: '1.0.0',
|
|
15
|
+
createdAt: new Date()
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
this.content = {
|
|
19
|
+
title,
|
|
20
|
+
subtitle: '',
|
|
21
|
+
description: '',
|
|
22
|
+
badge: undefined,
|
|
23
|
+
image: undefined,
|
|
24
|
+
stats: [],
|
|
25
|
+
sections: [],
|
|
26
|
+
actions: [],
|
|
27
|
+
meta: undefined
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
// Sets the small subtitle displayed under the main title.
|
|
31
|
+
setSubtitle(subtitle) {
|
|
32
|
+
this.content.subtitle = subtitle.trim();
|
|
33
|
+
return this;
|
|
34
|
+
}
|
|
35
|
+
// Provides the long-form description for the card body.
|
|
36
|
+
setDescription(description) {
|
|
37
|
+
this.content.description = description.trim();
|
|
38
|
+
return this;
|
|
39
|
+
}
|
|
40
|
+
// Displays a compact badge (e.g., "Nouveau") above the title.
|
|
41
|
+
setBadge(badge) {
|
|
42
|
+
this.content.badge = badge?.trim() || undefined;
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
// Attaches a hero image to the card header.
|
|
46
|
+
setImage(url, alt) {
|
|
47
|
+
const trimmedUrl = url.trim();
|
|
48
|
+
if (!trimmedUrl) {
|
|
49
|
+
throw new errors_1.InvalidParameterError('url', url, 'Image URL cannot be empty');
|
|
50
|
+
}
|
|
51
|
+
const image = {
|
|
52
|
+
url: trimmedUrl,
|
|
53
|
+
alt: alt?.trim()
|
|
54
|
+
};
|
|
55
|
+
this.content.image = image;
|
|
56
|
+
return this;
|
|
57
|
+
}
|
|
58
|
+
clearImage() {
|
|
59
|
+
this.content.image = undefined;
|
|
60
|
+
return this;
|
|
61
|
+
}
|
|
62
|
+
// Adds a key metric row (label/value) in the highlight area.
|
|
63
|
+
addStat(label, value) {
|
|
64
|
+
const trimmedLabel = label.trim();
|
|
65
|
+
const trimmedValue = value.trim();
|
|
66
|
+
if (!trimmedLabel || !trimmedValue) {
|
|
67
|
+
throw new errors_1.MissingRequiredParameterError('label and value');
|
|
68
|
+
}
|
|
69
|
+
this.content.stats.push({
|
|
70
|
+
label: trimmedLabel,
|
|
71
|
+
value: trimmedValue
|
|
72
|
+
});
|
|
73
|
+
return this;
|
|
74
|
+
}
|
|
75
|
+
clearStats() {
|
|
76
|
+
this.content.stats = [];
|
|
77
|
+
return this;
|
|
78
|
+
}
|
|
79
|
+
// Inserts a descriptive section below the highlights.
|
|
80
|
+
addSection(heading, body) {
|
|
81
|
+
const trimmedHeading = heading.trim();
|
|
82
|
+
const trimmedBody = body.trim();
|
|
83
|
+
if (!trimmedHeading || !trimmedBody) {
|
|
84
|
+
throw new errors_1.MissingRequiredParameterError('heading and body');
|
|
85
|
+
}
|
|
86
|
+
this.content.sections.push({
|
|
87
|
+
heading: trimmedHeading,
|
|
88
|
+
body: trimmedBody
|
|
89
|
+
});
|
|
90
|
+
return this;
|
|
91
|
+
}
|
|
92
|
+
clearSections() {
|
|
93
|
+
this.content.sections = [];
|
|
94
|
+
return this;
|
|
95
|
+
}
|
|
96
|
+
// Registers an action button displayed in the footer.
|
|
97
|
+
addAction(text, method = 'POST', options = {}) {
|
|
98
|
+
const trimmedText = text.trim();
|
|
99
|
+
if (!trimmedText) {
|
|
100
|
+
throw new errors_1.InvalidParameterError('text', text, 'Action text cannot be empty');
|
|
101
|
+
}
|
|
102
|
+
const action = {
|
|
103
|
+
text: trimmedText,
|
|
104
|
+
method,
|
|
105
|
+
confirmMessage: options.confirmMessage,
|
|
106
|
+
href: options.href?.trim(),
|
|
107
|
+
icon: options.icon?.trim(),
|
|
108
|
+
variant: options.variant
|
|
109
|
+
};
|
|
110
|
+
this.content.actions.push(action);
|
|
111
|
+
return this;
|
|
112
|
+
}
|
|
113
|
+
clearActions() {
|
|
114
|
+
this.content.actions = [];
|
|
115
|
+
return this;
|
|
116
|
+
}
|
|
117
|
+
// Stores arbitrary metadata the client may need.
|
|
118
|
+
setMetadata(meta) {
|
|
119
|
+
this.content.meta = { ...meta };
|
|
120
|
+
return this;
|
|
121
|
+
}
|
|
122
|
+
getContent() {
|
|
123
|
+
return this.content;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
exports.CardView = CardView;
|
|
127
|
+
//# sourceMappingURL=card-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-view.js","sourceRoot":"","sources":["../../src/core/card-view.ts"],"names":[],"mappings":";;;AAAA,2CAAuC;AAUvC,sCAAiF;AAEjF,6GAA6G;AAE7G,MAAa,QAAS,SAAQ,oBAAQ;IAClC,YAAY,MAAc,EAAE,KAAa,EAAE,SAAkB;QACzD,KAAK,CAAC;YACF,EAAE,EAAE,MAAM;YACV,IAAI,EAAE,MAAM;YACZ,SAAS;YACT,QAAQ,EAAE;gBACN,OAAO,EAAE,OAAO;gBAChB,SAAS,EAAE,IAAI,IAAI,EAAE;aACxB;SACJ,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,GAAG;YACX,KAAK;YACL,QAAQ,EAAE,EAAE;YACZ,WAAW,EAAE,EAAE;YACf,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,SAAS;YAChB,KAAK,EAAE,EAAE;YACT,QAAQ,EAAE,EAAE;YACZ,OAAO,EAAE,EAAE;YACX,IAAI,EAAE,SAAS;SACH,CAAC;IACrB,CAAC;IAED,0DAA0D;IAC1D,WAAW,CAAC,QAAgB;QACvB,IAAI,CAAC,OAA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YAC1B,OAAO,EAAE,OAAO,CAAC,OAAO;SAC3B,CAAC;QAED,IAAI,CAAC,OAAuB,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,YAAY;QACP,IAAI,CAAC,OAAuB,CAAC,OAAO,GAAG,EAAE,CAAC;QAC3C,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,iDAAiD;IACjD,WAAW,CAAC,IAA6B;QACpC,IAAI,CAAC,OAAuB,CAAC,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC;IAChB,CAAC;IAED,UAAU;QACN,OAAO,IAAI,CAAC,OAAsB,CAAC;IACvC,CAAC;CACJ;AAjJD,4BAiJC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { BaseView } from './base-view';
|
|
2
|
+
import { CarouselContent, CarouselSettings, CarouselSlide, CardAction, HttpMethod } from '../types';
|
|
3
|
+
export declare class CarouselView extends BaseView {
|
|
4
|
+
constructor(viewId: string, title: string, processId?: string);
|
|
5
|
+
setSubtitle(subtitle: string): this;
|
|
6
|
+
setSettings(settings: CarouselSettings): this;
|
|
7
|
+
addSlide(slide: CarouselSlide): this;
|
|
8
|
+
createSlide(id: string, title: string, description?: string, options?: {
|
|
9
|
+
imageUrl?: string;
|
|
10
|
+
imageAlt?: string;
|
|
11
|
+
badge?: string;
|
|
12
|
+
}): CarouselSlide;
|
|
13
|
+
addSlideAction(slideId: string, text: string, method?: HttpMethod, options?: {
|
|
14
|
+
confirmMessage?: string;
|
|
15
|
+
href?: string;
|
|
16
|
+
icon?: string;
|
|
17
|
+
variant?: CardAction['variant'];
|
|
18
|
+
}): this;
|
|
19
|
+
clearSlides(): this;
|
|
20
|
+
getContent(): CarouselContent;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=carousel-view.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"carousel-view.d.ts","sourceRoot":"","sources":["../../src/core/carousel-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAKpG,qBAAa,YAAa,SAAQ,QAAQ;gBAC1B,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;IAyB7D,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAKnC,WAAW,CAAC,QAAQ,EAAE,gBAAgB,GAAG,IAAI;IAM7C,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,IAAI;IAiBpC,WAAW,CACP,EAAE,EAAE,MAAM,EACV,KAAK,EAAE,MAAM,EACb,WAAW,CAAC,EAAE,MAAM,EACpB,OAAO,GAAE;QAAE,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GACvE,aAAa;IAkBhB,cAAc,CACV,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,UAAmB,EAC3B,OAAO,GAAE;QAAE,cAAc,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,OAAO,CAAC,EAAE,UAAU,CAAC,SAAS,CAAC,CAAA;KAAO,GACzG,IAAI;IAuBP,WAAW,IAAI,IAAI;IAMnB,UAAU,IAAI,eAAe;CAGhC"}
|