@resconet/qp-bridge 0.0.1-alpha.17 → 0.0.1-alpha.19
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 +330 -0
- package/index.js +1 -1
- package/index.mjs +590 -540
- package/lib/qp-bridge-types.d.ts +18 -0
- package/lib/qp-bridge.d.ts +66 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -41,6 +41,18 @@ await setAnswer("numericQuestion", 42);
|
|
|
41
41
|
|
|
42
42
|
## Functions
|
|
43
43
|
|
|
44
|
+
- [createMediaItem](#createmediaitem)
|
|
45
|
+
- [createMediaItem](#createmediaitem)
|
|
46
|
+
- [createMediaItem](#createmediaitem)
|
|
47
|
+
- [createMediaItem](#createmediaitem)
|
|
48
|
+
- [createMediaItem](#createmediaitem)
|
|
49
|
+
- [createMediaItem](#createmediaitem)
|
|
50
|
+
- [updateMediaItem](#updatemediaitem)
|
|
51
|
+
- [updateMediaItem](#updatemediaitem)
|
|
52
|
+
- [updateMediaItem](#updatemediaitem)
|
|
53
|
+
- [updateMediaItem](#updatemediaitem)
|
|
54
|
+
- [updateMediaItem](#updatemediaitem)
|
|
55
|
+
- [updateMediaItem](#updatemediaitem)
|
|
44
56
|
- [setAnswer](#setanswer)
|
|
45
57
|
- [getQuestion](#getquestion)
|
|
46
58
|
- [setQuestion](#setquestion)
|
|
@@ -53,6 +65,324 @@ await setAnswer("numericQuestion", 42);
|
|
|
53
65
|
- [executeCustomCommand](#executecustomcommand)
|
|
54
66
|
- [onSave](#onsave)
|
|
55
67
|
|
|
68
|
+
### createMediaItem
|
|
69
|
+
|
|
70
|
+
Creates a MediaItem from the provided parameters and content.
|
|
71
|
+
|
|
72
|
+
| Function | Type |
|
|
73
|
+
| ---------- | ---------- |
|
|
74
|
+
| `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:...` |
|
|
75
|
+
|
|
76
|
+
Parameters:
|
|
77
|
+
|
|
78
|
+
* `name`: - Name of the media item.
|
|
79
|
+
* `mimeType`: - MIME type of the media item.
|
|
80
|
+
* `content`: - Content as File, Blob, base64 string, or ArrayBuffer.
|
|
81
|
+
* `id`: - Optional id for the media item. If not provided, a UUID will be generated.
|
|
82
|
+
* `name`: - Name of the media item.
|
|
83
|
+
* `mimeType`: - MIME type of the media item.
|
|
84
|
+
* `content`: - Content as Blob.
|
|
85
|
+
* `name`: - Name of the media item.
|
|
86
|
+
* `mimeType`: - MIME type of the media item.
|
|
87
|
+
* `content`: - Content as base64 string or binary string.
|
|
88
|
+
* `name`: - Name of the media item.
|
|
89
|
+
* `mimeType`: - MIME type of the media item.
|
|
90
|
+
* `content`: - Content as ArrayBuffer.
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
Returns:
|
|
94
|
+
|
|
95
|
+
MediaItem object with blobUrl generated from the content.
|
|
96
|
+
|
|
97
|
+
### createMediaItem
|
|
98
|
+
|
|
99
|
+
Creates a MediaItem from the provided parameters and content.
|
|
100
|
+
|
|
101
|
+
| Function | Type |
|
|
102
|
+
| ---------- | ---------- |
|
|
103
|
+
| `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:...` |
|
|
104
|
+
|
|
105
|
+
Parameters:
|
|
106
|
+
|
|
107
|
+
* `name`: - Name of the media item.
|
|
108
|
+
* `mimeType`: - MIME type of the media item.
|
|
109
|
+
* `content`: - Content as File, Blob, base64 string, or ArrayBuffer.
|
|
110
|
+
* `id`: - Optional id for the media item. If not provided, a UUID will be generated.
|
|
111
|
+
* `name`: - Name of the media item.
|
|
112
|
+
* `mimeType`: - MIME type of the media item.
|
|
113
|
+
* `content`: - Content as Blob.
|
|
114
|
+
* `name`: - Name of the media item.
|
|
115
|
+
* `mimeType`: - MIME type of the media item.
|
|
116
|
+
* `content`: - Content as base64 string or binary string.
|
|
117
|
+
* `name`: - Name of the media item.
|
|
118
|
+
* `mimeType`: - MIME type of the media item.
|
|
119
|
+
* `content`: - Content as ArrayBuffer.
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
Returns:
|
|
123
|
+
|
|
124
|
+
MediaItem object with blobUrl generated from the content.
|
|
125
|
+
|
|
126
|
+
### createMediaItem
|
|
127
|
+
|
|
128
|
+
Creates a MediaItem from the provided parameters and content.
|
|
129
|
+
|
|
130
|
+
| Function | Type |
|
|
131
|
+
| ---------- | ---------- |
|
|
132
|
+
| `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:...` |
|
|
133
|
+
|
|
134
|
+
Parameters:
|
|
135
|
+
|
|
136
|
+
* `name`: - Name of the media item.
|
|
137
|
+
* `mimeType`: - MIME type of the media item.
|
|
138
|
+
* `content`: - Content as File, Blob, base64 string, or ArrayBuffer.
|
|
139
|
+
* `id`: - Optional id for the media item. If not provided, a UUID will be generated.
|
|
140
|
+
* `name`: - Name of the media item.
|
|
141
|
+
* `mimeType`: - MIME type of the media item.
|
|
142
|
+
* `content`: - Content as Blob.
|
|
143
|
+
* `name`: - Name of the media item.
|
|
144
|
+
* `mimeType`: - MIME type of the media item.
|
|
145
|
+
* `content`: - Content as base64 string or binary string.
|
|
146
|
+
* `name`: - Name of the media item.
|
|
147
|
+
* `mimeType`: - MIME type of the media item.
|
|
148
|
+
* `content`: - Content as ArrayBuffer.
|
|
149
|
+
|
|
150
|
+
|
|
151
|
+
Returns:
|
|
152
|
+
|
|
153
|
+
MediaItem object with blobUrl generated from the content.
|
|
154
|
+
|
|
155
|
+
### createMediaItem
|
|
156
|
+
|
|
157
|
+
Creates a MediaItem from the provided parameters and content.
|
|
158
|
+
|
|
159
|
+
| Function | Type |
|
|
160
|
+
| ---------- | ---------- |
|
|
161
|
+
| `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:...` |
|
|
162
|
+
|
|
163
|
+
Parameters:
|
|
164
|
+
|
|
165
|
+
* `name`: - Name of the media item.
|
|
166
|
+
* `mimeType`: - MIME type of the media item.
|
|
167
|
+
* `content`: - Content as File, Blob, base64 string, or ArrayBuffer.
|
|
168
|
+
* `id`: - Optional id for the media item. If not provided, a UUID will be generated.
|
|
169
|
+
* `name`: - Name of the media item.
|
|
170
|
+
* `mimeType`: - MIME type of the media item.
|
|
171
|
+
* `content`: - Content as Blob.
|
|
172
|
+
* `name`: - Name of the media item.
|
|
173
|
+
* `mimeType`: - MIME type of the media item.
|
|
174
|
+
* `content`: - Content as base64 string or binary string.
|
|
175
|
+
* `name`: - Name of the media item.
|
|
176
|
+
* `mimeType`: - MIME type of the media item.
|
|
177
|
+
* `content`: - Content as ArrayBuffer.
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
Returns:
|
|
181
|
+
|
|
182
|
+
MediaItem object with blobUrl generated from the content.
|
|
183
|
+
|
|
184
|
+
### createMediaItem
|
|
185
|
+
|
|
186
|
+
Creates a MediaItem from the provided parameters and content.
|
|
187
|
+
|
|
188
|
+
| Function | Type |
|
|
189
|
+
| ---------- | ---------- |
|
|
190
|
+
| `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:...` |
|
|
191
|
+
|
|
192
|
+
Parameters:
|
|
193
|
+
|
|
194
|
+
* `name`: - Name of the media item.
|
|
195
|
+
* `mimeType`: - MIME type of the media item.
|
|
196
|
+
* `content`: - Content as File, Blob, base64 string, or ArrayBuffer.
|
|
197
|
+
* `id`: - Optional id for the media item. If not provided, a UUID will be generated.
|
|
198
|
+
* `name`: - Name of the media item.
|
|
199
|
+
* `mimeType`: - MIME type of the media item.
|
|
200
|
+
* `content`: - Content as Blob.
|
|
201
|
+
* `name`: - Name of the media item.
|
|
202
|
+
* `mimeType`: - MIME type of the media item.
|
|
203
|
+
* `content`: - Content as base64 string or binary string.
|
|
204
|
+
* `name`: - Name of the media item.
|
|
205
|
+
* `mimeType`: - MIME type of the media item.
|
|
206
|
+
* `content`: - Content as ArrayBuffer.
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
Returns:
|
|
210
|
+
|
|
211
|
+
MediaItem object with blobUrl generated from the content.
|
|
212
|
+
|
|
213
|
+
### createMediaItem
|
|
214
|
+
|
|
215
|
+
Creates a MediaItem from the provided parameters and content.
|
|
216
|
+
|
|
217
|
+
| Function | Type |
|
|
218
|
+
| ---------- | ---------- |
|
|
219
|
+
| `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:...` |
|
|
220
|
+
|
|
221
|
+
Parameters:
|
|
222
|
+
|
|
223
|
+
* `name`: - Name of the media item.
|
|
224
|
+
* `mimeType`: - MIME type of the media item.
|
|
225
|
+
* `content`: - Content as File, Blob, base64 string, or ArrayBuffer.
|
|
226
|
+
* `id`: - Optional id for the media item. If not provided, a UUID will be generated.
|
|
227
|
+
* `name`: - Name of the media item.
|
|
228
|
+
* `mimeType`: - MIME type of the media item.
|
|
229
|
+
* `content`: - Content as Blob.
|
|
230
|
+
* `name`: - Name of the media item.
|
|
231
|
+
* `mimeType`: - MIME type of the media item.
|
|
232
|
+
* `content`: - Content as base64 string or binary string.
|
|
233
|
+
* `name`: - Name of the media item.
|
|
234
|
+
* `mimeType`: - MIME type of the media item.
|
|
235
|
+
* `content`: - Content as ArrayBuffer.
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
Returns:
|
|
239
|
+
|
|
240
|
+
MediaItem object with blobUrl generated from the content.
|
|
241
|
+
|
|
242
|
+
### updateMediaItem
|
|
243
|
+
|
|
244
|
+
Updates a MediaItem with the provided changes. If content is provided, blobUrl will be updated accordingly.
|
|
245
|
+
|
|
246
|
+
| Function | Type |
|
|
247
|
+
| ---------- | ---------- |
|
|
248
|
+
| `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: { ...` |
|
|
249
|
+
|
|
250
|
+
Parameters:
|
|
251
|
+
|
|
252
|
+
* `mediaItem`: - The original MediaItem to update.
|
|
253
|
+
* `updates`: - Object containing properties to update (name, mimeType, content).
|
|
254
|
+
* `mediaItem`: - The original MediaItem to update.
|
|
255
|
+
* `updates`: - Object containing content as Blob.
|
|
256
|
+
* `mediaItem`: - The original MediaItem to update.
|
|
257
|
+
* `updates`: - Object containing content as base64 string or binary string.
|
|
258
|
+
* `mediaItem`: - The original MediaItem to update.
|
|
259
|
+
* `updates`: - Object containing content as ArrayBuffer.
|
|
260
|
+
|
|
261
|
+
|
|
262
|
+
Returns:
|
|
263
|
+
|
|
264
|
+
Updated MediaItem object.
|
|
265
|
+
|
|
266
|
+
### updateMediaItem
|
|
267
|
+
|
|
268
|
+
Updates a MediaItem with the provided changes. If content is provided, blobUrl will be updated accordingly.
|
|
269
|
+
|
|
270
|
+
| Function | Type |
|
|
271
|
+
| ---------- | ---------- |
|
|
272
|
+
| `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: { ...` |
|
|
273
|
+
|
|
274
|
+
Parameters:
|
|
275
|
+
|
|
276
|
+
* `mediaItem`: - The original MediaItem to update.
|
|
277
|
+
* `updates`: - Object containing properties to update (name, mimeType, content).
|
|
278
|
+
* `mediaItem`: - The original MediaItem to update.
|
|
279
|
+
* `updates`: - Object containing content as Blob.
|
|
280
|
+
* `mediaItem`: - The original MediaItem to update.
|
|
281
|
+
* `updates`: - Object containing content as base64 string or binary string.
|
|
282
|
+
* `mediaItem`: - The original MediaItem to update.
|
|
283
|
+
* `updates`: - Object containing content as ArrayBuffer.
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
Returns:
|
|
287
|
+
|
|
288
|
+
Updated MediaItem object.
|
|
289
|
+
|
|
290
|
+
### updateMediaItem
|
|
291
|
+
|
|
292
|
+
Updates a MediaItem with the provided changes. If content is provided, blobUrl will be updated accordingly.
|
|
293
|
+
|
|
294
|
+
| Function | Type |
|
|
295
|
+
| ---------- | ---------- |
|
|
296
|
+
| `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: { ...` |
|
|
297
|
+
|
|
298
|
+
Parameters:
|
|
299
|
+
|
|
300
|
+
* `mediaItem`: - The original MediaItem to update.
|
|
301
|
+
* `updates`: - Object containing properties to update (name, mimeType, content).
|
|
302
|
+
* `mediaItem`: - The original MediaItem to update.
|
|
303
|
+
* `updates`: - Object containing content as Blob.
|
|
304
|
+
* `mediaItem`: - The original MediaItem to update.
|
|
305
|
+
* `updates`: - Object containing content as base64 string or binary string.
|
|
306
|
+
* `mediaItem`: - The original MediaItem to update.
|
|
307
|
+
* `updates`: - Object containing content as ArrayBuffer.
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
Returns:
|
|
311
|
+
|
|
312
|
+
Updated MediaItem object.
|
|
313
|
+
|
|
314
|
+
### updateMediaItem
|
|
315
|
+
|
|
316
|
+
Updates a MediaItem with the provided changes. If content is provided, blobUrl will be updated accordingly.
|
|
317
|
+
|
|
318
|
+
| Function | Type |
|
|
319
|
+
| ---------- | ---------- |
|
|
320
|
+
| `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: { ...` |
|
|
321
|
+
|
|
322
|
+
Parameters:
|
|
323
|
+
|
|
324
|
+
* `mediaItem`: - The original MediaItem to update.
|
|
325
|
+
* `updates`: - Object containing properties to update (name, mimeType, content).
|
|
326
|
+
* `mediaItem`: - The original MediaItem to update.
|
|
327
|
+
* `updates`: - Object containing content as Blob.
|
|
328
|
+
* `mediaItem`: - The original MediaItem to update.
|
|
329
|
+
* `updates`: - Object containing content as base64 string or binary string.
|
|
330
|
+
* `mediaItem`: - The original MediaItem to update.
|
|
331
|
+
* `updates`: - Object containing content as ArrayBuffer.
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
Returns:
|
|
335
|
+
|
|
336
|
+
Updated MediaItem object.
|
|
337
|
+
|
|
338
|
+
### updateMediaItem
|
|
339
|
+
|
|
340
|
+
Updates a MediaItem with the provided changes. If content is provided, blobUrl will be updated accordingly.
|
|
341
|
+
|
|
342
|
+
| Function | Type |
|
|
343
|
+
| ---------- | ---------- |
|
|
344
|
+
| `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: { ...` |
|
|
345
|
+
|
|
346
|
+
Parameters:
|
|
347
|
+
|
|
348
|
+
* `mediaItem`: - The original MediaItem to update.
|
|
349
|
+
* `updates`: - Object containing properties to update (name, mimeType, content).
|
|
350
|
+
* `mediaItem`: - The original MediaItem to update.
|
|
351
|
+
* `updates`: - Object containing content as Blob.
|
|
352
|
+
* `mediaItem`: - The original MediaItem to update.
|
|
353
|
+
* `updates`: - Object containing content as base64 string or binary string.
|
|
354
|
+
* `mediaItem`: - The original MediaItem to update.
|
|
355
|
+
* `updates`: - Object containing content as ArrayBuffer.
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
Returns:
|
|
359
|
+
|
|
360
|
+
Updated MediaItem object.
|
|
361
|
+
|
|
362
|
+
### updateMediaItem
|
|
363
|
+
|
|
364
|
+
Updates a MediaItem with the provided changes. If content is provided, blobUrl will be updated accordingly.
|
|
365
|
+
|
|
366
|
+
| Function | Type |
|
|
367
|
+
| ---------- | ---------- |
|
|
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: { ...` |
|
|
369
|
+
|
|
370
|
+
Parameters:
|
|
371
|
+
|
|
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.
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
Returns:
|
|
383
|
+
|
|
384
|
+
Updated MediaItem object.
|
|
385
|
+
|
|
56
386
|
### setAnswer
|
|
57
387
|
|
|
58
388
|
Sets the answer for a specific question in the questionnaire.
|