@resconet/qp-bridge 1.2.1-alpha.42 → 1.2.1-alpha.44

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (4) hide show
  1. package/README.md +243 -292
  2. package/index.js +1 -1
  3. package/index.mjs +1063 -1103
  4. package/package.json +1 -1
package/README.md CHANGED
@@ -80,26 +80,25 @@ await setAnswer("numericQuestion", 42);
80
80
 
81
81
  Creates a MediaItem from the provided parameters and content.
82
82
 
83
- | Function | Type |
84
- | ---------- | ---------- |
83
+ | Function | Type |
84
+ | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
85
85
  | `createMediaItem` | `{ (name: string, mimeType: string, content: File): { id: string; name: string; mimeType: string; blobUrl: string; }; (name: string, mimeType: string, content: Blob): { id: string; name: string; mimeType: string; blobUrl: string; }; (name: string, mimeType: string, content: string): { ...; }; (name: string, mimeType:...` |
86
86
 
87
87
  Parameters:
88
88
 
89
- * `name`: - Name of the media item.
90
- * `mimeType`: - MIME type of the media item.
91
- * `content`: - Content as File, Blob, base64 string, or ArrayBuffer.
92
- * `id`: - Optional id for the media item. If not provided, a UUID will be generated.
93
- * `name`: - Name of the media item.
94
- * `mimeType`: - MIME type of the media item.
95
- * `content`: - Content as Blob.
96
- * `name`: - Name of the media item.
97
- * `mimeType`: - MIME type of the media item.
98
- * `content`: - Content as base64 string or binary string.
99
- * `name`: - Name of the media item.
100
- * `mimeType`: - MIME type of the media item.
101
- * `content`: - Content as ArrayBuffer.
102
-
89
+ - `name`: - Name of the media item.
90
+ - `mimeType`: - MIME type of the media item.
91
+ - `content`: - Content as File, Blob, base64 string, or ArrayBuffer.
92
+ - `id`: - Optional id for the media item. If not provided, a UUID will be generated.
93
+ - `name`: - Name of the media item.
94
+ - `mimeType`: - MIME type of the media item.
95
+ - `content`: - Content as Blob.
96
+ - `name`: - Name of the media item.
97
+ - `mimeType`: - MIME type of the media item.
98
+ - `content`: - Content as base64 string or binary string.
99
+ - `name`: - Name of the media item.
100
+ - `mimeType`: - MIME type of the media item.
101
+ - `content`: - Content as ArrayBuffer.
103
102
 
104
103
  Returns:
105
104
 
@@ -109,26 +108,25 @@ MediaItem object with blobUrl generated from the content.
109
108
 
110
109
  Creates a MediaItem from the provided parameters and content.
111
110
 
112
- | Function | Type |
113
- | ---------- | ---------- |
111
+ | Function | Type |
112
+ | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
114
113
  | `createMediaItem` | `{ (name: string, mimeType: string, content: File): { id: string; name: string; mimeType: string; blobUrl: string; }; (name: string, mimeType: string, content: Blob): { id: string; name: string; mimeType: string; blobUrl: string; }; (name: string, mimeType: string, content: string): { ...; }; (name: string, mimeType:...` |
115
114
 
116
115
  Parameters:
117
116
 
118
- * `name`: - Name of the media item.
119
- * `mimeType`: - MIME type of the media item.
120
- * `content`: - Content as File, Blob, base64 string, or ArrayBuffer.
121
- * `id`: - Optional id for the media item. If not provided, a UUID will be generated.
122
- * `name`: - Name of the media item.
123
- * `mimeType`: - MIME type of the media item.
124
- * `content`: - Content as Blob.
125
- * `name`: - Name of the media item.
126
- * `mimeType`: - MIME type of the media item.
127
- * `content`: - Content as base64 string or binary string.
128
- * `name`: - Name of the media item.
129
- * `mimeType`: - MIME type of the media item.
130
- * `content`: - Content as ArrayBuffer.
131
-
117
+ - `name`: - Name of the media item.
118
+ - `mimeType`: - MIME type of the media item.
119
+ - `content`: - Content as File, Blob, base64 string, or ArrayBuffer.
120
+ - `id`: - Optional id for the media item. If not provided, a UUID will be generated.
121
+ - `name`: - Name of the media item.
122
+ - `mimeType`: - MIME type of the media item.
123
+ - `content`: - Content as Blob.
124
+ - `name`: - Name of the media item.
125
+ - `mimeType`: - MIME type of the media item.
126
+ - `content`: - Content as base64 string or binary string.
127
+ - `name`: - Name of the media item.
128
+ - `mimeType`: - MIME type of the media item.
129
+ - `content`: - Content as ArrayBuffer.
132
130
 
133
131
  Returns:
134
132
 
@@ -138,26 +136,25 @@ MediaItem object with blobUrl generated from the content.
138
136
 
139
137
  Creates a MediaItem from the provided parameters and content.
140
138
 
141
- | Function | Type |
142
- | ---------- | ---------- |
139
+ | Function | Type |
140
+ | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
143
141
  | `createMediaItem` | `{ (name: string, mimeType: string, content: File): { id: string; name: string; mimeType: string; blobUrl: string; }; (name: string, mimeType: string, content: Blob): { id: string; name: string; mimeType: string; blobUrl: string; }; (name: string, mimeType: string, content: string): { ...; }; (name: string, mimeType:...` |
144
142
 
145
143
  Parameters:
146
144
 
147
- * `name`: - Name of the media item.
148
- * `mimeType`: - MIME type of the media item.
149
- * `content`: - Content as File, Blob, base64 string, or ArrayBuffer.
150
- * `id`: - Optional id for the media item. If not provided, a UUID will be generated.
151
- * `name`: - Name of the media item.
152
- * `mimeType`: - MIME type of the media item.
153
- * `content`: - Content as Blob.
154
- * `name`: - Name of the media item.
155
- * `mimeType`: - MIME type of the media item.
156
- * `content`: - Content as base64 string or binary string.
157
- * `name`: - Name of the media item.
158
- * `mimeType`: - MIME type of the media item.
159
- * `content`: - Content as ArrayBuffer.
160
-
145
+ - `name`: - Name of the media item.
146
+ - `mimeType`: - MIME type of the media item.
147
+ - `content`: - Content as File, Blob, base64 string, or ArrayBuffer.
148
+ - `id`: - Optional id for the media item. If not provided, a UUID will be generated.
149
+ - `name`: - Name of the media item.
150
+ - `mimeType`: - MIME type of the media item.
151
+ - `content`: - Content as Blob.
152
+ - `name`: - Name of the media item.
153
+ - `mimeType`: - MIME type of the media item.
154
+ - `content`: - Content as base64 string or binary string.
155
+ - `name`: - Name of the media item.
156
+ - `mimeType`: - MIME type of the media item.
157
+ - `content`: - Content as ArrayBuffer.
161
158
 
162
159
  Returns:
163
160
 
@@ -167,26 +164,25 @@ MediaItem object with blobUrl generated from the content.
167
164
 
168
165
  Creates a MediaItem from the provided parameters and content.
169
166
 
170
- | Function | Type |
171
- | ---------- | ---------- |
167
+ | Function | Type |
168
+ | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
172
169
  | `createMediaItem` | `{ (name: string, mimeType: string, content: File): { id: string; name: string; mimeType: string; blobUrl: string; }; (name: string, mimeType: string, content: Blob): { id: string; name: string; mimeType: string; blobUrl: string; }; (name: string, mimeType: string, content: string): { ...; }; (name: string, mimeType:...` |
173
170
 
174
171
  Parameters:
175
172
 
176
- * `name`: - Name of the media item.
177
- * `mimeType`: - MIME type of the media item.
178
- * `content`: - Content as File, Blob, base64 string, or ArrayBuffer.
179
- * `id`: - Optional id for the media item. If not provided, a UUID will be generated.
180
- * `name`: - Name of the media item.
181
- * `mimeType`: - MIME type of the media item.
182
- * `content`: - Content as Blob.
183
- * `name`: - Name of the media item.
184
- * `mimeType`: - MIME type of the media item.
185
- * `content`: - Content as base64 string or binary string.
186
- * `name`: - Name of the media item.
187
- * `mimeType`: - MIME type of the media item.
188
- * `content`: - Content as ArrayBuffer.
189
-
173
+ - `name`: - Name of the media item.
174
+ - `mimeType`: - MIME type of the media item.
175
+ - `content`: - Content as File, Blob, base64 string, or ArrayBuffer.
176
+ - `id`: - Optional id for the media item. If not provided, a UUID will be generated.
177
+ - `name`: - Name of the media item.
178
+ - `mimeType`: - MIME type of the media item.
179
+ - `content`: - Content as Blob.
180
+ - `name`: - Name of the media item.
181
+ - `mimeType`: - MIME type of the media item.
182
+ - `content`: - Content as base64 string or binary string.
183
+ - `name`: - Name of the media item.
184
+ - `mimeType`: - MIME type of the media item.
185
+ - `content`: - Content as ArrayBuffer.
190
186
 
191
187
  Returns:
192
188
 
@@ -196,26 +192,25 @@ MediaItem object with blobUrl generated from the content.
196
192
 
197
193
  Creates a MediaItem from the provided parameters and content.
198
194
 
199
- | Function | Type |
200
- | ---------- | ---------- |
195
+ | Function | Type |
196
+ | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
201
197
  | `createMediaItem` | `{ (name: string, mimeType: string, content: File): { id: string; name: string; mimeType: string; blobUrl: string; }; (name: string, mimeType: string, content: Blob): { id: string; name: string; mimeType: string; blobUrl: string; }; (name: string, mimeType: string, content: string): { ...; }; (name: string, mimeType:...` |
202
198
 
203
199
  Parameters:
204
200
 
205
- * `name`: - Name of the media item.
206
- * `mimeType`: - MIME type of the media item.
207
- * `content`: - Content as File, Blob, base64 string, or ArrayBuffer.
208
- * `id`: - Optional id for the media item. If not provided, a UUID will be generated.
209
- * `name`: - Name of the media item.
210
- * `mimeType`: - MIME type of the media item.
211
- * `content`: - Content as Blob.
212
- * `name`: - Name of the media item.
213
- * `mimeType`: - MIME type of the media item.
214
- * `content`: - Content as base64 string or binary string.
215
- * `name`: - Name of the media item.
216
- * `mimeType`: - MIME type of the media item.
217
- * `content`: - Content as ArrayBuffer.
218
-
201
+ - `name`: - Name of the media item.
202
+ - `mimeType`: - MIME type of the media item.
203
+ - `content`: - Content as File, Blob, base64 string, or ArrayBuffer.
204
+ - `id`: - Optional id for the media item. If not provided, a UUID will be generated.
205
+ - `name`: - Name of the media item.
206
+ - `mimeType`: - MIME type of the media item.
207
+ - `content`: - Content as Blob.
208
+ - `name`: - Name of the media item.
209
+ - `mimeType`: - MIME type of the media item.
210
+ - `content`: - Content as base64 string or binary string.
211
+ - `name`: - Name of the media item.
212
+ - `mimeType`: - MIME type of the media item.
213
+ - `content`: - Content as ArrayBuffer.
219
214
 
220
215
  Returns:
221
216
 
@@ -225,26 +220,25 @@ MediaItem object with blobUrl generated from the content.
225
220
 
226
221
  Creates a MediaItem from the provided parameters and content.
227
222
 
228
- | Function | Type |
229
- | ---------- | ---------- |
223
+ | Function | Type |
224
+ | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
230
225
  | `createMediaItem` | `{ (name: string, mimeType: string, content: File): { id: string; name: string; mimeType: string; blobUrl: string; }; (name: string, mimeType: string, content: Blob): { id: string; name: string; mimeType: string; blobUrl: string; }; (name: string, mimeType: string, content: string): { ...; }; (name: string, mimeType:...` |
231
226
 
232
227
  Parameters:
233
228
 
234
- * `name`: - Name of the media item.
235
- * `mimeType`: - MIME type of the media item.
236
- * `content`: - Content as File, Blob, base64 string, or ArrayBuffer.
237
- * `id`: - Optional id for the media item. If not provided, a UUID will be generated.
238
- * `name`: - Name of the media item.
239
- * `mimeType`: - MIME type of the media item.
240
- * `content`: - Content as Blob.
241
- * `name`: - Name of the media item.
242
- * `mimeType`: - MIME type of the media item.
243
- * `content`: - Content as base64 string or binary string.
244
- * `name`: - Name of the media item.
245
- * `mimeType`: - MIME type of the media item.
246
- * `content`: - Content as ArrayBuffer.
247
-
229
+ - `name`: - Name of the media item.
230
+ - `mimeType`: - MIME type of the media item.
231
+ - `content`: - Content as File, Blob, base64 string, or ArrayBuffer.
232
+ - `id`: - Optional id for the media item. If not provided, a UUID will be generated.
233
+ - `name`: - Name of the media item.
234
+ - `mimeType`: - MIME type of the media item.
235
+ - `content`: - Content as Blob.
236
+ - `name`: - Name of the media item.
237
+ - `mimeType`: - MIME type of the media item.
238
+ - `content`: - Content as base64 string or binary string.
239
+ - `name`: - Name of the media item.
240
+ - `mimeType`: - MIME type of the media item.
241
+ - `content`: - Content as ArrayBuffer.
248
242
 
249
243
  Returns:
250
244
 
@@ -254,21 +248,20 @@ MediaItem object with blobUrl generated from the content.
254
248
 
255
249
  Updates a MediaItem with the provided changes.
256
250
 
257
- | Function | Type |
258
- | ---------- | ---------- |
251
+ | Function | Type |
252
+ | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
259
253
  | `updateMediaItem` | `{ (mediaItem: { id: string; name: string; mimeType: string; blobUrl: string; }, updates: { content: File; }): { id: string; name: string; mimeType: string; blobUrl: string; }; (mediaItem: { id: string; name: string; mimeType: string; blobUrl: string; }, updates: { ...; }): { ...; }; (mediaItem: { ...; }, updates: { ...` |
260
254
 
261
255
  Parameters:
262
256
 
263
- * `mediaItem`: - The original MediaItem to update.
264
- * `updates`: - Object containing properties to update (name, mimeType, content).
265
- * `mediaItem`: - The original MediaItem to update.
266
- * `updates`: - Object containing content as Blob.
267
- * `mediaItem`: - The original MediaItem to update.
268
- * `updates`: - Object containing content as base64 string or binary string.
269
- * `mediaItem`: - The original MediaItem to update.
270
- * `updates`: - Object containing content as ArrayBuffer.
271
-
257
+ - `mediaItem`: - The original MediaItem to update.
258
+ - `updates`: - Object containing properties to update (name, mimeType, content).
259
+ - `mediaItem`: - The original MediaItem to update.
260
+ - `updates`: - Object containing content as Blob.
261
+ - `mediaItem`: - The original MediaItem to update.
262
+ - `updates`: - Object containing content as base64 string or binary string.
263
+ - `mediaItem`: - The original MediaItem to update.
264
+ - `updates`: - Object containing content as ArrayBuffer.
272
265
 
273
266
  Returns:
274
267
 
@@ -278,21 +271,20 @@ Updated MediaItem object.
278
271
 
279
272
  Updates a MediaItem with the provided changes.
280
273
 
281
- | Function | Type |
282
- | ---------- | ---------- |
274
+ | Function | Type |
275
+ | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
283
276
  | `updateMediaItem` | `{ (mediaItem: { id: string; name: string; mimeType: string; blobUrl: string; }, updates: { content: File; }): { id: string; name: string; mimeType: string; blobUrl: string; }; (mediaItem: { id: string; name: string; mimeType: string; blobUrl: string; }, updates: { ...; }): { ...; }; (mediaItem: { ...; }, updates: { ...` |
284
277
 
285
278
  Parameters:
286
279
 
287
- * `mediaItem`: - The original MediaItem to update.
288
- * `updates`: - Object containing properties to update (name, mimeType, content).
289
- * `mediaItem`: - The original MediaItem to update.
290
- * `updates`: - Object containing content as Blob.
291
- * `mediaItem`: - The original MediaItem to update.
292
- * `updates`: - Object containing content as base64 string or binary string.
293
- * `mediaItem`: - The original MediaItem to update.
294
- * `updates`: - Object containing content as ArrayBuffer.
295
-
280
+ - `mediaItem`: - The original MediaItem to update.
281
+ - `updates`: - Object containing properties to update (name, mimeType, content).
282
+ - `mediaItem`: - The original MediaItem to update.
283
+ - `updates`: - Object containing content as Blob.
284
+ - `mediaItem`: - The original MediaItem to update.
285
+ - `updates`: - Object containing content as base64 string or binary string.
286
+ - `mediaItem`: - The original MediaItem to update.
287
+ - `updates`: - Object containing content as ArrayBuffer.
296
288
 
297
289
  Returns:
298
290
 
@@ -302,21 +294,20 @@ Updated MediaItem object.
302
294
 
303
295
  Updates a MediaItem with the provided changes.
304
296
 
305
- | Function | Type |
306
- | ---------- | ---------- |
297
+ | Function | Type |
298
+ | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
307
299
  | `updateMediaItem` | `{ (mediaItem: { id: string; name: string; mimeType: string; blobUrl: string; }, updates: { content: File; }): { id: string; name: string; mimeType: string; blobUrl: string; }; (mediaItem: { id: string; name: string; mimeType: string; blobUrl: string; }, updates: { ...; }): { ...; }; (mediaItem: { ...; }, updates: { ...` |
308
300
 
309
301
  Parameters:
310
302
 
311
- * `mediaItem`: - The original MediaItem to update.
312
- * `updates`: - Object containing properties to update (name, mimeType, content).
313
- * `mediaItem`: - The original MediaItem to update.
314
- * `updates`: - Object containing content as Blob.
315
- * `mediaItem`: - The original MediaItem to update.
316
- * `updates`: - Object containing content as base64 string or binary string.
317
- * `mediaItem`: - The original MediaItem to update.
318
- * `updates`: - Object containing content as ArrayBuffer.
319
-
303
+ - `mediaItem`: - The original MediaItem to update.
304
+ - `updates`: - Object containing properties to update (name, mimeType, content).
305
+ - `mediaItem`: - The original MediaItem to update.
306
+ - `updates`: - Object containing content as Blob.
307
+ - `mediaItem`: - The original MediaItem to update.
308
+ - `updates`: - Object containing content as base64 string or binary string.
309
+ - `mediaItem`: - The original MediaItem to update.
310
+ - `updates`: - Object containing content as ArrayBuffer.
320
311
 
321
312
  Returns:
322
313
 
@@ -326,21 +317,20 @@ Updated MediaItem object.
326
317
 
327
318
  Updates a MediaItem with the provided changes.
328
319
 
329
- | Function | Type |
330
- | ---------- | ---------- |
320
+ | Function | Type |
321
+ | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
331
322
  | `updateMediaItem` | `{ (mediaItem: { id: string; name: string; mimeType: string; blobUrl: string; }, updates: { content: File; }): { id: string; name: string; mimeType: string; blobUrl: string; }; (mediaItem: { id: string; name: string; mimeType: string; blobUrl: string; }, updates: { ...; }): { ...; }; (mediaItem: { ...; }, updates: { ...` |
332
323
 
333
324
  Parameters:
334
325
 
335
- * `mediaItem`: - The original MediaItem to update.
336
- * `updates`: - Object containing properties to update (name, mimeType, content).
337
- * `mediaItem`: - The original MediaItem to update.
338
- * `updates`: - Object containing content as Blob.
339
- * `mediaItem`: - The original MediaItem to update.
340
- * `updates`: - Object containing content as base64 string or binary string.
341
- * `mediaItem`: - The original MediaItem to update.
342
- * `updates`: - Object containing content as ArrayBuffer.
343
-
326
+ - `mediaItem`: - The original MediaItem to update.
327
+ - `updates`: - Object containing properties to update (name, mimeType, content).
328
+ - `mediaItem`: - The original MediaItem to update.
329
+ - `updates`: - Object containing content as Blob.
330
+ - `mediaItem`: - The original MediaItem to update.
331
+ - `updates`: - Object containing content as base64 string or binary string.
332
+ - `mediaItem`: - The original MediaItem to update.
333
+ - `updates`: - Object containing content as ArrayBuffer.
344
334
 
345
335
  Returns:
346
336
 
@@ -350,21 +340,20 @@ Updated MediaItem object.
350
340
 
351
341
  Updates a MediaItem with the provided changes.
352
342
 
353
- | Function | Type |
354
- | ---------- | ---------- |
343
+ | Function | Type |
344
+ | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
355
345
  | `updateMediaItem` | `{ (mediaItem: { id: string; name: string; mimeType: string; blobUrl: string; }, updates: { content: File; }): { id: string; name: string; mimeType: string; blobUrl: string; }; (mediaItem: { id: string; name: string; mimeType: string; blobUrl: string; }, updates: { ...; }): { ...; }; (mediaItem: { ...; }, updates: { ...` |
356
346
 
357
347
  Parameters:
358
348
 
359
- * `mediaItem`: - The original MediaItem to update.
360
- * `updates`: - Object containing properties to update (name, mimeType, content).
361
- * `mediaItem`: - The original MediaItem to update.
362
- * `updates`: - Object containing content as Blob.
363
- * `mediaItem`: - The original MediaItem to update.
364
- * `updates`: - Object containing content as base64 string or binary string.
365
- * `mediaItem`: - The original MediaItem to update.
366
- * `updates`: - Object containing content as ArrayBuffer.
367
-
349
+ - `mediaItem`: - The original MediaItem to update.
350
+ - `updates`: - Object containing properties to update (name, mimeType, content).
351
+ - `mediaItem`: - The original MediaItem to update.
352
+ - `updates`: - Object containing content as Blob.
353
+ - `mediaItem`: - The original MediaItem to update.
354
+ - `updates`: - Object containing content as base64 string or binary string.
355
+ - `mediaItem`: - The original MediaItem to update.
356
+ - `updates`: - Object containing content as ArrayBuffer.
368
357
 
369
358
  Returns:
370
359
 
@@ -374,21 +363,20 @@ Updated MediaItem object.
374
363
 
375
364
  Updates a MediaItem with the provided changes.
376
365
 
377
- | Function | Type |
378
- | ---------- | ---------- |
366
+ | Function | Type |
367
+ | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
379
368
  | `updateMediaItem` | `{ (mediaItem: { id: string; name: string; mimeType: string; blobUrl: string; }, updates: { content: File; }): { id: string; name: string; mimeType: string; blobUrl: string; }; (mediaItem: { id: string; name: string; mimeType: string; blobUrl: string; }, updates: { ...; }): { ...; }; (mediaItem: { ...; }, updates: { ...` |
380
369
 
381
370
  Parameters:
382
371
 
383
- * `mediaItem`: - The original MediaItem to update.
384
- * `updates`: - Object containing properties to update (name, mimeType, content).
385
- * `mediaItem`: - The original MediaItem to update.
386
- * `updates`: - Object containing content as Blob.
387
- * `mediaItem`: - The original MediaItem to update.
388
- * `updates`: - Object containing content as base64 string or binary string.
389
- * `mediaItem`: - The original MediaItem to update.
390
- * `updates`: - Object containing content as ArrayBuffer.
391
-
372
+ - `mediaItem`: - The original MediaItem to update.
373
+ - `updates`: - Object containing properties to update (name, mimeType, content).
374
+ - `mediaItem`: - The original MediaItem to update.
375
+ - `updates`: - Object containing content as Blob.
376
+ - `mediaItem`: - The original MediaItem to update.
377
+ - `updates`: - Object containing content as base64 string or binary string.
378
+ - `mediaItem`: - The original MediaItem to update.
379
+ - `updates`: - Object containing content as ArrayBuffer.
392
380
 
393
381
  Returns:
394
382
 
@@ -396,29 +384,28 @@ Updated MediaItem object.
396
384
 
397
385
  ### initOnSaveMessageHandler
398
386
 
399
- | Function | Type |
400
- | ---------- | ---------- |
387
+ | Function | Type |
388
+ | -------------------------- | ------------ |
401
389
  | `initOnSaveMessageHandler` | `() => void` |
402
390
 
403
391
  ### removeOnSaveMessageHandler
404
392
 
405
- | Function | Type |
406
- | ---------- | ---------- |
393
+ | Function | Type |
394
+ | ---------------------------- | ------------ |
407
395
  | `removeOnSaveMessageHandler` | `() => void` |
408
396
 
409
397
  ### setAnswer
410
398
 
411
399
  Sets the answer for a specific question in the questionnaire.
412
400
 
413
- | Function | Type |
414
- | ---------- | ---------- |
401
+ | Function | Type |
402
+ | ----------- | ---------------------------------------------------------- |
415
403
  | `setAnswer` | `(questionName: string, answer: unknown) => Promise<void>` |
416
404
 
417
405
  Parameters:
418
406
 
419
- * `questionName`: - Name of the question for which the answer is being set.
420
- * `answer`: - The answer to set for the question. Can be any type.
421
-
407
+ - `questionName`: - Name of the question for which the answer is being set.
408
+ - `answer`: - The answer to set for the question. Can be any type.
422
409
 
423
410
  Returns:
424
411
 
@@ -427,22 +414,20 @@ A promise that resolves when the answer has been successfully set.
427
414
  Examples:
428
415
 
429
416
  ```typescript
430
- await setAnswer('favoriteColor', 'blue');
417
+ await setAnswer("favoriteColor", "blue");
431
418
  ```
432
419
 
433
-
434
420
  ### getQuestion
435
421
 
436
422
  Retrieves a question by its name from the questionnaire.
437
423
 
438
- | Function | Type |
439
- | ---------- | ---------- |
424
+ | Function | Type |
425
+ | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
440
426
  | `getQuestion` | `(name: string) => Promise<{ label: string; description: string; disabled: boolean; required: boolean; hidden: boolean; semanticColor?: string or undefined; errorMessage?: string or undefined; answer?: unknown; }>` |
441
427
 
442
428
  Parameters:
443
429
 
444
- * `name`: - The name of the question to retrieve.
445
-
430
+ - `name`: - The name of the question to retrieve.
446
431
 
447
432
  Returns:
448
433
 
@@ -451,24 +436,22 @@ A promise that resolves to the question object.
451
436
  Examples:
452
437
 
453
438
  ```typescript
454
- const question = await getQuestion('favoriteColor');
439
+ const question = await getQuestion("favoriteColor");
455
440
  console.log(question.label); // Outputs the label of the question
456
441
  ```
457
442
 
458
-
459
443
  ### setQuestion
460
444
 
461
445
  Updates a question in the questionnaire.
462
446
 
463
- | Function | Type |
464
- | ---------- | ---------- |
447
+ | Function | Type |
448
+ | ------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
465
449
  | `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<...>` |
466
450
 
467
451
  Parameters:
468
452
 
469
- * `name`: - The name of the question to update. This is a unique identifier and cannot be changed.
470
- * `questionData`: - The updated question data excluding the name property.
471
-
453
+ - `name`: - The name of the question to update. This is a unique identifier and cannot be changed.
454
+ - `questionData`: - The updated question data excluding the name property.
472
455
 
473
456
  Returns:
474
457
 
@@ -477,22 +460,20 @@ A promise that resolves when the question has been successfully updated.
477
460
  Examples:
478
461
 
479
462
  ```typescript
480
- await setQuestion('favoriteColor', { label: 'What is your favorite color?' });
463
+ await setQuestion("favoriteColor", { label: "What is your favorite color?" });
481
464
  ```
482
465
 
483
-
484
466
  ### getGroup
485
467
 
486
468
  Retrieves a group by its name from the questionnaire.
487
469
 
488
- | Function | Type |
489
- | ---------- | ---------- |
470
+ | Function | Type |
471
+ | ---------- | ------------------------------------------------------------------------------------ |
490
472
  | `getGroup` | `(name: string) => Promise<{ label: string; hidden: boolean; collapsed: boolean; }>` |
491
473
 
492
474
  Parameters:
493
475
 
494
- * `name`: - The name of the group to retrieve.
495
-
476
+ - `name`: - The name of the group to retrieve.
496
477
 
497
478
  Returns:
498
479
 
@@ -501,26 +482,24 @@ A promise that resolves to the group object.
501
482
  Examples:
502
483
 
503
484
  ```typescript
504
- const group = await getGroup('personalInfo');
485
+ const group = await getGroup("personalInfo");
505
486
  console.log(group.label); // Outputs the label of the group
506
487
  console.log(group.hidden); // Outputs whether the group is hidden
507
488
  console.log(group.collapsed); // Outputs whether the group is collapsed
508
489
  ```
509
490
 
510
-
511
491
  ### setGroup
512
492
 
513
493
  Updates a group in the questionnaire.
514
494
 
515
- | Function | Type |
516
- | ---------- | ---------- |
495
+ | Function | Type |
496
+ | ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
517
497
  | `setGroup` | `(name: string, groupData: { label?: string or undefined; hidden?: boolean or undefined; collapsed?: boolean or undefined; }) => Promise<void>` |
518
498
 
519
499
  Parameters:
520
500
 
521
- * `name`: - The name of the group to update. This is a unique identifier and cannot be changed.
522
- * `groupData`: - The updated group data excluding the name property.
523
-
501
+ - `name`: - The name of the group to update. This is a unique identifier and cannot be changed.
502
+ - `groupData`: - The updated group data excluding the name property.
524
503
 
525
504
  Returns:
526
505
 
@@ -529,51 +508,47 @@ A promise that resolves when the group has been successfully updated.
529
508
  Examples:
530
509
 
531
510
  ```typescript
532
- await setGroup('personalInfo', { label: 'Personal Information', hidden: false, collapsed: true });
511
+ await setGroup("personalInfo", { label: "Personal Information", hidden: false, collapsed: true });
533
512
  ```
534
513
 
535
-
536
514
  ### onAnswerChange
537
515
 
538
516
  Subscribes to changes in answers for questions.
539
517
  Calls the provided listener whenever an answer changes in the questionnaire.
540
518
 
541
- | Function | Type |
542
- | ---------- | ---------- |
519
+ | Function | Type |
520
+ | ---------------- | ------------------------------------------------------------------------------------------------ |
543
521
  | `onAnswerChange` | `(listener: (question: string, answer: unknown) => void) => { cancelSubscription: () => void; }` |
544
522
 
545
523
  Parameters:
546
524
 
547
- * `listener`: - A function that will be called with the question name and the new answer whenever an answer changes.
548
-
525
+ - `listener`: - A function that will be called with the question name and the new answer whenever an answer changes.
549
526
 
550
527
  Examples:
551
528
 
552
529
  ```typescript
553
- import { onAnswerChange } from 'qp-bridge';
530
+ import { onAnswerChange } from "qp-bridge";
554
531
  const { cancelSubscription } = onAnswerChange((question, answer) => {
555
- console.log(`Answer for ${question} changed to:`, answer);
556
- });
532
+ console.log(`Answer for ${question} changed to:`, answer);
533
+ });
557
534
 
558
535
  // To stop listening for changes:
559
536
  cancelSubscription();
560
537
  ```
561
538
 
562
-
563
539
  ### withBusyIndicator
564
540
 
565
541
  Wraps an asynchronous action with a busy indicator in the host application.
566
542
  Shows a loading indicator during the execution of the provided action,
567
543
  ensuring the UI reflects the busy state appropriately.
568
544
 
569
- | Function | Type |
570
- | ---------- | ---------- |
545
+ | Function | Type |
546
+ | ------------------- | --------------------------------------------- |
571
547
  | `withBusyIndicator` | `<T>(action: () => Promise<T>) => Promise<T>` |
572
548
 
573
549
  Parameters:
574
550
 
575
- * `action`: - A function returning a promise whose execution should be wrapped.
576
-
551
+ - `action`: - A function returning a promise whose execution should be wrapped.
577
552
 
578
553
  Returns:
579
554
 
@@ -583,20 +558,19 @@ Examples:
583
558
 
584
559
  ```typescript
585
560
  const result = await withBusyIndicator(async () => {
586
- await setAnswer('favoriteColor', 'blue');
587
- return 'done';
561
+ await setAnswer("favoriteColor", "blue");
562
+ return "done";
588
563
  });
589
564
  console.log(result); // 'done'
590
565
  ```
591
566
 
592
-
593
567
  ### saveQuestionnaire
594
568
 
595
569
  Saves the current questionnaire state.
596
570
  Triggers a save operation for the questionnaire data.
597
571
 
598
- | Function | Type |
599
- | ---------- | ---------- |
572
+ | Function | Type |
573
+ | ------------------- | --------------------- |
600
574
  | `saveQuestionnaire` | `() => Promise<void>` |
601
575
 
602
576
  Returns:
@@ -607,17 +581,16 @@ Examples:
607
581
 
608
582
  ```typescript
609
583
  await saveQuestionnaire();
610
- console.log('Questionnaire saved successfully');
584
+ console.log("Questionnaire saved successfully");
611
585
  ```
612
586
 
613
-
614
587
  ### completeAndCloseQuestionnaire
615
588
 
616
589
  Completes and closes the current questionnaire.
617
590
  Triggers the complete and close operation for the questionnaire.
618
591
 
619
- | Function | Type |
620
- | ---------- | ---------- |
592
+ | Function | Type |
593
+ | ------------------------------- | --------------------- |
621
594
  | `completeAndCloseQuestionnaire` | `() => Promise<void>` |
622
595
 
623
596
  Returns:
@@ -628,23 +601,21 @@ Examples:
628
601
 
629
602
  ```typescript
630
603
  await completeAndCloseQuestionnaire();
631
- console.log('Questionnaire completed and closed successfully');
604
+ console.log("Questionnaire completed and closed successfully");
632
605
  ```
633
606
 
634
-
635
607
  ### executeCustomCommand
636
608
 
637
609
  Executes a custom command by its name.
638
610
  Triggers the execution of any user-defined command in the questionnaire.
639
611
 
640
- | Function | Type |
641
- | ---------- | ---------- |
612
+ | Function | Type |
613
+ | ---------------------- | ---------------------------------------- |
642
614
  | `executeCustomCommand` | `(commandName: string) => Promise<void>` |
643
615
 
644
616
  Parameters:
645
617
 
646
- * `commandName`: - The name of the command to execute.
647
-
618
+ - `commandName`: - The name of the command to execute.
648
619
 
649
620
  Returns:
650
621
 
@@ -653,24 +624,22 @@ A promise that resolves when the command has been successfully executed.
653
624
  Examples:
654
625
 
655
626
  ```typescript
656
- await executeCustomCommand('MyCustomCommand');
657
- console.log('Custom command executed successfully');
627
+ await executeCustomCommand("MyCustomCommand");
628
+ console.log("Custom command executed successfully");
658
629
  ```
659
630
 
660
-
661
631
  ### onQuestionnaireLoaded
662
632
 
663
633
  Registers a handler function to be called when the questionnaire is fully loaded.
664
634
  Useful for performing actions that depend on the questionnaire being ready.
665
635
 
666
- | Function | Type |
667
- | ---------- | ---------- |
636
+ | Function | Type |
637
+ | ----------------------- | -------------------------------------------------------------- |
668
638
  | `onQuestionnaireLoaded` | `(handler: () => void) => { cancelSubscription: () => void; }` |
669
639
 
670
640
  Parameters:
671
641
 
672
- * `handler`: - A function to be called when the questionnaire is loaded.
673
-
642
+ - `handler`: - A function to be called when the questionnaire is loaded.
674
643
 
675
644
  Returns:
676
645
 
@@ -679,29 +648,27 @@ An object with a `cancelSubscription` method to unregister the handler.
679
648
  Examples:
680
649
 
681
650
  ```typescript
682
- import { onQuestionnaireLoaded } from 'qp-bridge';
651
+ import { onQuestionnaireLoaded } from "qp-bridge";
683
652
  const { cancelSubscription } = onQuestionnaireLoaded(() => {
684
- console.log('Questionnaire is fully loaded');
653
+ console.log("Questionnaire is fully loaded");
685
654
  });
686
655
 
687
656
  // To stop listening for questionnaire load events:
688
657
  cancelSubscription();
689
658
  ```
690
659
 
691
-
692
660
  ### onCommandExecuted
693
661
 
694
662
  Registers a handler function to be called when a command is executed.
695
663
  Useful for reacting to custom command executions within the questionnaire.
696
664
 
697
- | Function | Type |
698
- | ---------- | ---------- |
665
+ | Function | Type |
666
+ | ------------------- | --------------------------------------------------------------------------------- |
699
667
  | `onCommandExecuted` | `(handler: (commandName: string) => void) => { cancelSubscription: () => void; }` |
700
668
 
701
669
  Parameters:
702
670
 
703
- * `handler`: - A function that receives the name of the executed command.
704
-
671
+ - `handler`: - A function that receives the name of the executed command.
705
672
 
706
673
  Returns:
707
674
 
@@ -710,8 +677,8 @@ An object with a `cancelSubscription` method to unregister the handler.
710
677
  Examples:
711
678
 
712
679
  ```typescript
713
- import { onCommandExecuted } from 'qp-bridge';
714
- const { cancelSubscription } = onCommandExecuted((commandName) => {
680
+ import { onCommandExecuted } from "qp-bridge";
681
+ const { cancelSubscription } = onCommandExecuted(commandName => {
715
682
  console.log(`Command executed: ${commandName}`);
716
683
  });
717
684
 
@@ -719,20 +686,18 @@ const { cancelSubscription } = onCommandExecuted((commandName) => {
719
686
  cancelSubscription();
720
687
  ```
721
688
 
722
-
723
689
  ### onSave
724
690
 
725
691
  Registers a validator function to be called when a save event occurs.
726
692
  Useful for validating data before saving the questionnaire.
727
693
 
728
- | Function | Type |
729
- | ---------- | ---------- |
694
+ | Function | Type |
695
+ | -------- | --------------------------------------------------------------- |
730
696
  | `onSave` | `(validator: Validator) => { cancelSubscription: () => void; }` |
731
697
 
732
698
  Parameters:
733
699
 
734
- * `validator`: - A function returning a Promise resolving to a boolean indicating if the save is valid.
735
-
700
+ - `validator`: - A function returning a Promise resolving to a boolean indicating if the save is valid.
736
701
 
737
702
  Returns:
738
703
 
@@ -741,7 +706,7 @@ An object with a `cancelSubscription` method to unregister the validator.
741
706
  Examples:
742
707
 
743
708
  ```typescript
744
- import { onSave } from 'qp-bridge';
709
+ import { onSave } from "qp-bridge";
745
710
  const { cancelSubscription } = onSave(async () => {
746
711
  // perform validation logic
747
712
  return true;
@@ -751,19 +716,17 @@ const { cancelSubscription } = onSave(async () => {
751
716
  cancelSubscription();
752
717
  ```
753
718
 
754
-
755
719
  ### fetchEntities
756
720
 
757
721
  Fetches entities from the CRM system using the provided FetchXML query.
758
722
 
759
- | Function | Type |
760
- | ---------- | ---------- |
723
+ | Function | Type |
724
+ | --------------- | ---------------------------------------------------------- |
761
725
  | `fetchEntities` | `(fetchXml: string) => Promise<Record<string, unknown>[]>` |
762
726
 
763
727
  Parameters:
764
728
 
765
- * `fetchXml`: - The FetchXML query string to execute.
766
-
729
+ - `fetchXml`: - The FetchXML query string to execute.
767
730
 
768
731
  Returns:
769
732
 
@@ -782,20 +745,18 @@ const entities = await fetchEntities(fetchXml);
782
745
  console.log(entities); // Array of contact entities
783
746
  ```
784
747
 
785
-
786
748
  ### getEntityById
787
749
 
788
750
  Retrieves a single entity by its name and ID from the CRM system.
789
751
 
790
- | Function | Type |
791
- | ---------- | ---------- |
752
+ | Function | Type |
753
+ | --------------- | ---------------------------------------------------------------------- |
792
754
  | `getEntityById` | `(entityName: string, id: string) => Promise<Record<string, unknown>>` |
793
755
 
794
756
  Parameters:
795
757
 
796
- * `entityName`: - The name of the entity to retrieve (e.g., "contact", "account").
797
- * `id`: - The unique identifier of the entity.
798
-
758
+ - `entityName`: - The name of the entity to retrieve (e.g., "contact", "account").
759
+ - `id`: - The unique identifier of the entity.
799
760
 
800
761
  Returns:
801
762
 
@@ -804,47 +765,44 @@ A promise that resolves to the entity object.
804
765
  Examples:
805
766
 
806
767
  ```typescript
807
- const contact = await getEntityById('contact', '12345678-1234-1234-1234-123456789abc');
768
+ const contact = await getEntityById("contact", "12345678-1234-1234-1234-123456789abc");
808
769
  console.log(contact.attributes.firstname); // Entity firstname attribute
809
770
  ```
810
771
 
811
-
812
772
  ### createNewEntity
813
773
 
814
774
  Creates a new entity marker that can be enriched before saving.
815
775
  The returned entity is flagged with `isNew` so the host can distinguish new records.
816
776
 
817
- | Function | Type |
818
- | ---------- | ---------- |
777
+ | Function | Type |
778
+ | ----------------- | ------------------------------- |
819
779
  | `createNewEntity` | `() => Record<string, unknown>` |
820
780
 
821
781
  ### saveEntity
822
782
 
823
783
  Persists an entity through the bridge. Supports both new and existing entities.
824
784
 
825
- | Function | Type |
826
- | ---------- | ---------- |
785
+ | Function | Type |
786
+ | ------------ | ---------------------------------------------------- |
827
787
  | `saveEntity` | `(entity: Record<string, unknown>) => Promise<void>` |
828
788
 
829
789
  Parameters:
830
790
 
831
- * `entity`: - Entity payload; include `isNew` for newly created entities.
832
-
791
+ - `entity`: - Entity payload; include `isNew` for newly created entities.
833
792
 
834
793
  ### repeatGroup
835
794
 
836
795
  Repeats a specific group within a repeatable group by creating a copy of the group at the specified index.
837
796
  The parent group must be a repeatable group and the index must refer to an existing group instance.
838
797
 
839
- | Function | Type |
840
- | ---------- | ---------- |
798
+ | Function | Type |
799
+ | ------------- | -------------------------------------------------------------------- |
841
800
  | `repeatGroup` | `(repeatableGroupName: string, groupIndex: number) => Promise<void>` |
842
801
 
843
802
  Parameters:
844
803
 
845
- * `repeatableGroupName`: - The name of the parent repeatable group.
846
- * `groupIndex`: - The index (0-based) of the group instance to repeat.
847
-
804
+ - `repeatableGroupName`: - The name of the parent repeatable group.
805
+ - `groupIndex`: - The index (0-based) of the group instance to repeat.
848
806
 
849
807
  Returns:
850
808
 
@@ -853,24 +811,22 @@ A promise that resolves when the group has been successfully repeated.
853
811
  Examples:
854
812
 
855
813
  ```typescript
856
- await repeatGroup('personalInfoRepeatable', 1);
857
- console.log('Group repeated successfully');
814
+ await repeatGroup("personalInfoRepeatable", 1);
815
+ console.log("Group repeated successfully");
858
816
  ```
859
817
 
860
-
861
818
  ### addNewGroup
862
819
 
863
820
  Adds a new group instance to a repeatable group.
864
821
  The specified name must refer to a repeatable group.
865
822
 
866
- | Function | Type |
867
- | ---------- | ---------- |
823
+ | Function | Type |
824
+ | ------------- | ------------------------------------------------ |
868
825
  | `addNewGroup` | `(repeatableGroupName: string) => Promise<void>` |
869
826
 
870
827
  Parameters:
871
828
 
872
- * `repeatableGroupName`: - The name of the repeatable group to add a new instance to.
873
-
829
+ - `repeatableGroupName`: - The name of the repeatable group to add a new instance to.
874
830
 
875
831
  Returns:
876
832
 
@@ -879,25 +835,23 @@ A promise that resolves when the new group has been successfully added.
879
835
  Examples:
880
836
 
881
837
  ```typescript
882
- await addNewGroup('personalInfoRepeatable');
883
- console.log('New group added successfully');
838
+ await addNewGroup("personalInfoRepeatable");
839
+ console.log("New group added successfully");
884
840
  ```
885
841
 
886
-
887
842
  ### deleteGroup
888
843
 
889
844
  Deletes a specific group instance from a repeatable group by index.
890
845
  The parent group must be a repeatable group and the index must refer to an existing group instance.
891
846
 
892
- | Function | Type |
893
- | ---------- | ---------- |
847
+ | Function | Type |
848
+ | ------------- | -------------------------------------------------------------------- |
894
849
  | `deleteGroup` | `(repeatableGroupName: string, groupIndex: number) => Promise<void>` |
895
850
 
896
851
  Parameters:
897
852
 
898
- * `repeatableGroupName`: - The name of the parent repeatable group.
899
- * `groupIndex`: - The index (0-based) of the group instance to delete.
900
-
853
+ - `repeatableGroupName`: - The name of the parent repeatable group.
854
+ - `groupIndex`: - The index (0-based) of the group instance to delete.
901
855
 
902
856
  Returns:
903
857
 
@@ -906,11 +860,8 @@ A promise that resolves when the group has been successfully deleted.
906
860
  Examples:
907
861
 
908
862
  ```typescript
909
- await deleteGroup('personalInfoRepeatable', 1);
910
- console.log('Group deleted successfully');
863
+ await deleteGroup("personalInfoRepeatable", 1);
864
+ console.log("Group deleted successfully");
911
865
  ```
912
866
 
913
-
914
-
915
-
916
867
  <!-- TSDOC_END -->