@resconet/qp-bridge 0.0.1-alpha.24 → 0.0.1-alpha.25
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 +15 -15
- package/lib/qp-bridge.d.ts +7 -7
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ A JavaScript bridge library for communication between iframes in Questionnaire a
|
|
|
7
7
|
|
|
8
8
|
## Description
|
|
9
9
|
|
|
10
|
-
qp-bridge provides a simple and reliable way to communicate between
|
|
10
|
+
qp-bridge provides a simple and reliable way to communicate between questionnaire and users logic.
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
@@ -246,7 +246,7 @@ MediaItem object with blobUrl generated from the content.
|
|
|
246
246
|
|
|
247
247
|
### updateMediaItem
|
|
248
248
|
|
|
249
|
-
Updates a MediaItem with the provided changes.
|
|
249
|
+
Updates a MediaItem with the provided changes.
|
|
250
250
|
|
|
251
251
|
| Function | Type |
|
|
252
252
|
| ---------- | ---------- |
|
|
@@ -270,7 +270,7 @@ Updated MediaItem object.
|
|
|
270
270
|
|
|
271
271
|
### updateMediaItem
|
|
272
272
|
|
|
273
|
-
Updates a MediaItem with the provided changes.
|
|
273
|
+
Updates a MediaItem with the provided changes.
|
|
274
274
|
|
|
275
275
|
| Function | Type |
|
|
276
276
|
| ---------- | ---------- |
|
|
@@ -294,7 +294,7 @@ Updated MediaItem object.
|
|
|
294
294
|
|
|
295
295
|
### updateMediaItem
|
|
296
296
|
|
|
297
|
-
Updates a MediaItem with the provided changes.
|
|
297
|
+
Updates a MediaItem with the provided changes.
|
|
298
298
|
|
|
299
299
|
| Function | Type |
|
|
300
300
|
| ---------- | ---------- |
|
|
@@ -318,7 +318,7 @@ Updated MediaItem object.
|
|
|
318
318
|
|
|
319
319
|
### updateMediaItem
|
|
320
320
|
|
|
321
|
-
Updates a MediaItem with the provided changes.
|
|
321
|
+
Updates a MediaItem with the provided changes.
|
|
322
322
|
|
|
323
323
|
| Function | Type |
|
|
324
324
|
| ---------- | ---------- |
|
|
@@ -342,7 +342,7 @@ Updated MediaItem object.
|
|
|
342
342
|
|
|
343
343
|
### updateMediaItem
|
|
344
344
|
|
|
345
|
-
Updates a MediaItem with the provided changes.
|
|
345
|
+
Updates a MediaItem with the provided changes.
|
|
346
346
|
|
|
347
347
|
| Function | Type |
|
|
348
348
|
| ---------- | ---------- |
|
|
@@ -366,7 +366,7 @@ Updated MediaItem object.
|
|
|
366
366
|
|
|
367
367
|
### updateMediaItem
|
|
368
368
|
|
|
369
|
-
Updates a MediaItem with the provided changes.
|
|
369
|
+
Updates a MediaItem with the provided changes.
|
|
370
370
|
|
|
371
371
|
| Function | Type |
|
|
372
372
|
| ---------- | ---------- |
|
|
@@ -419,7 +419,7 @@ Retrieves a question by its name from the questionnaire.
|
|
|
419
419
|
|
|
420
420
|
| Function | Type |
|
|
421
421
|
| ---------- | ---------- |
|
|
422
|
-
| `getQuestion` | `(name: string) => Promise<{ label: string; description: string; disabled: boolean; required: boolean; hidden: boolean; semanticColor?: string or undefined; errorMessage?: string or undefined; }>` |
|
|
422
|
+
| `getQuestion` | `(name: string) => Promise<{ label: string; description: string; disabled: boolean; required: boolean; hidden: boolean; semanticColor?: string or undefined; errorMessage?: string or undefined; answer?: unknown; }>` |
|
|
423
423
|
|
|
424
424
|
Parameters:
|
|
425
425
|
|
|
@@ -444,7 +444,7 @@ Updates a question in the questionnaire.
|
|
|
444
444
|
|
|
445
445
|
| Function | Type |
|
|
446
446
|
| ---------- | ---------- |
|
|
447
|
-
| `setQuestion` | `(name: string, questionData: { semanticColor?: string or undefined; label?: string or undefined; description?: string or undefined; disabled?: boolean or undefined; required?: boolean or undefined; hidden?: boolean or undefined; errorMessage?: string or undefined; }) => Promise<...>` |
|
|
447
|
+
| `setQuestion` | `(name: string, questionData: { semanticColor?: string or undefined; label?: string or undefined; description?: string or undefined; disabled?: boolean or undefined; required?: boolean or undefined; hidden?: boolean or undefined; errorMessage?: string or undefined; answer?: unknown; }) => Promise<...>` |
|
|
448
448
|
|
|
449
449
|
Parameters:
|
|
450
450
|
|
|
@@ -736,11 +736,11 @@ The parent group must be a repeatable group and the index must refer to an exist
|
|
|
736
736
|
|
|
737
737
|
| Function | Type |
|
|
738
738
|
| ---------- | ---------- |
|
|
739
|
-
| `repeatGroup` | `(
|
|
739
|
+
| `repeatGroup` | `(repeatableGroupName: string, groupIndex: number) => Promise<void>` |
|
|
740
740
|
|
|
741
741
|
Parameters:
|
|
742
742
|
|
|
743
|
-
* `
|
|
743
|
+
* `repeatableGroupName`: - The name of the parent repeatable group.
|
|
744
744
|
* `groupIndex`: - The index (0-based) of the group instance to repeat.
|
|
745
745
|
|
|
746
746
|
|
|
@@ -763,11 +763,11 @@ The specified name must refer to a repeatable group.
|
|
|
763
763
|
|
|
764
764
|
| Function | Type |
|
|
765
765
|
| ---------- | ---------- |
|
|
766
|
-
| `addNewGroup` | `(
|
|
766
|
+
| `addNewGroup` | `(repeatableGroupName: string) => Promise<void>` |
|
|
767
767
|
|
|
768
768
|
Parameters:
|
|
769
769
|
|
|
770
|
-
* `
|
|
770
|
+
* `repeatableGroupName`: - The name of the repeatable group to add a new instance to.
|
|
771
771
|
|
|
772
772
|
|
|
773
773
|
Returns:
|
|
@@ -789,11 +789,11 @@ The parent group must be a repeatable group and the index must refer to an exist
|
|
|
789
789
|
|
|
790
790
|
| Function | Type |
|
|
791
791
|
| ---------- | ---------- |
|
|
792
|
-
| `deleteGroup` | `(
|
|
792
|
+
| `deleteGroup` | `(repeatableGroupName: string, groupIndex: number) => Promise<void>` |
|
|
793
793
|
|
|
794
794
|
Parameters:
|
|
795
795
|
|
|
796
|
-
* `
|
|
796
|
+
* `repeatableGroupName`: - The name of the parent repeatable group.
|
|
797
797
|
* `groupIndex`: - The index (0-based) of the group instance to delete.
|
|
798
798
|
|
|
799
799
|
|
package/lib/qp-bridge.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export declare function createMediaItem(name: string, mimeType: string, content:
|
|
|
29
29
|
export declare function createMediaItem(name: string, mimeType: string, content: ArrayBuffer): MediaItem;
|
|
30
30
|
export declare function createMediaItem(name: string, mimeType: string, content: File | Blob | string | ArrayBuffer, id?: string): MediaItem;
|
|
31
31
|
/**
|
|
32
|
-
* Updates a MediaItem with the provided changes.
|
|
32
|
+
* Updates a MediaItem with the provided changes.
|
|
33
33
|
*
|
|
34
34
|
* @param mediaItem - The original MediaItem to update.
|
|
35
35
|
* @param updates - Object containing properties to update (name, mimeType, content).
|
|
@@ -269,7 +269,7 @@ export declare function getEntityById(entityName: string, id: string): Promise<E
|
|
|
269
269
|
* Repeats a specific group within a repeatable group by creating a copy of the group at the specified index.
|
|
270
270
|
* The parent group must be a repeatable group and the index must refer to an existing group instance.
|
|
271
271
|
*
|
|
272
|
-
* @param {string}
|
|
272
|
+
* @param {string} repeatableGroupName - The name of the parent repeatable group.
|
|
273
273
|
* @param {number} groupIndex - The index (0-based) of the group instance to repeat.
|
|
274
274
|
* @returns {Promise<void>} A promise that resolves when the group has been successfully repeated.
|
|
275
275
|
* @throws {Error} Throws if the parent group is not found, is not a repeatable group, the index is invalid, or the operation fails.
|
|
@@ -279,12 +279,12 @@ export declare function getEntityById(entityName: string, id: string): Promise<E
|
|
|
279
279
|
* console.log('Group repeated successfully');
|
|
280
280
|
* ```
|
|
281
281
|
*/
|
|
282
|
-
export declare function repeatGroup(
|
|
282
|
+
export declare function repeatGroup(repeatableGroupName: string, groupIndex: number): Promise<void>;
|
|
283
283
|
/**
|
|
284
284
|
* Adds a new group instance to a repeatable group.
|
|
285
285
|
* The specified name must refer to a repeatable group.
|
|
286
286
|
*
|
|
287
|
-
* @param {string}
|
|
287
|
+
* @param {string} repeatableGroupName - The name of the repeatable group to add a new instance to.
|
|
288
288
|
* @returns {Promise<void>} A promise that resolves when the new group has been successfully added.
|
|
289
289
|
* @throws {Error} Throws if the repeatable group is not found or the operation fails.
|
|
290
290
|
* @example
|
|
@@ -293,12 +293,12 @@ export declare function repeatGroup(parentGroupName: string, groupIndex: number)
|
|
|
293
293
|
* console.log('New group added successfully');
|
|
294
294
|
* ```
|
|
295
295
|
*/
|
|
296
|
-
export declare function addNewGroup(
|
|
296
|
+
export declare function addNewGroup(repeatableGroupName: string): Promise<void>;
|
|
297
297
|
/**
|
|
298
298
|
* Deletes a specific group instance from a repeatable group by index.
|
|
299
299
|
* The parent group must be a repeatable group and the index must refer to an existing group instance.
|
|
300
300
|
*
|
|
301
|
-
* @param {string}
|
|
301
|
+
* @param {string} repeatableGroupName - The name of the parent repeatable group.
|
|
302
302
|
* @param {number} groupIndex - The index (0-based) of the group instance to delete.
|
|
303
303
|
* @returns {Promise<void>} A promise that resolves when the group has been successfully deleted.
|
|
304
304
|
* @throws {Error} Throws if the parent group is not found, is not a repeatable group, the index is invalid, or the operation fails.
|
|
@@ -308,5 +308,5 @@ export declare function addNewGroup(name: string): Promise<void>;
|
|
|
308
308
|
* console.log('Group deleted successfully');
|
|
309
309
|
* ```
|
|
310
310
|
*/
|
|
311
|
-
export declare function deleteGroup(
|
|
311
|
+
export declare function deleteGroup(repeatableGroupName: string, groupIndex: number): Promise<void>;
|
|
312
312
|
export {};
|