@capturebridge/sdk 0.26.0 → 0.26.2
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/Device.js +1 -1
- package/ICAO.js +1 -1
- package/IFace.js +2 -2
- package/README.md +2 -5
- package/README.md.in +1 -4
- package/SignatureTabletWidgets.js +8 -6
- package/VerifoneControls.js +4 -2
- package/Version.js +1 -1
- package/package.json +1 -1
package/Device.js
CHANGED
|
@@ -374,7 +374,7 @@ class Device {
|
|
|
374
374
|
const url = `${this.baseUrl}/plugin/${this.plugin.id}/device/${this.id}/display`
|
|
375
375
|
|
|
376
376
|
const asyncOperations = objects.map(async obj => {
|
|
377
|
-
if (obj.
|
|
377
|
+
if (typeof obj.data === 'function') {
|
|
378
378
|
await obj.data()
|
|
379
379
|
}
|
|
380
380
|
})
|
package/ICAO.js
CHANGED
|
@@ -55,7 +55,7 @@ class ICAO extends Plugin {
|
|
|
55
55
|
let imageData
|
|
56
56
|
|
|
57
57
|
// If this is an ImageSource object fetch it's image data
|
|
58
|
-
if (typeof image === 'object' && image.
|
|
58
|
+
if (typeof image === 'object' && typeof image.data === 'function') {
|
|
59
59
|
imageData = await image.data()
|
|
60
60
|
} else if (typeof image === 'string') {
|
|
61
61
|
imageData = image
|
package/IFace.js
CHANGED
|
@@ -196,14 +196,14 @@ export class IFace extends ICAO {
|
|
|
196
196
|
}
|
|
197
197
|
|
|
198
198
|
// If this is a Probe object fetch it's image data
|
|
199
|
-
if (typeof probe === 'object' && probe.
|
|
199
|
+
if (typeof probe === 'object' && typeof probe.data === 'function') {
|
|
200
200
|
await probe.data()
|
|
201
201
|
}
|
|
202
202
|
|
|
203
203
|
// And fetch data for candidates
|
|
204
204
|
const asyncOperations = candidates.map(async candidate => {
|
|
205
205
|
if (typeof candidate === 'object' &&
|
|
206
|
-
candidate.
|
|
206
|
+
typeof candidate.data === 'function') {
|
|
207
207
|
await candidate.data()
|
|
208
208
|
}
|
|
209
209
|
})
|
package/README.md
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
# Capture Bridge JavaScript Client SDK
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[SDK Documentation for v0.26.0](https://docs.capturebridge.net/client/sdk/javascript/0.26.0/index.html)
|
|
6
|
-
[SDK CHANGELOG](https://docs.capturebridge.net/client/sdk/javascript/0.26.0/CHANGELOG.html)
|
|
7
|
-
-->
|
|
3
|
+
[SDK Documentation for v0.26.2](https://docs.capturebridge.net/client/sdk/javascript/0.26.2/index.html)
|
|
4
|
+
[SDK CHANGELOG](https://docs.capturebridge.net/client/sdk/javascript/0.26.2/CHANGELOG.html)
|
package/README.md.in
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
# Capture Bridge JavaScript Client SDK
|
|
2
2
|
|
|
3
|
-
<!--
|
|
4
|
-
Not until: CPTR-38 is complete:
|
|
5
3
|
[SDK Documentation for v0.0.0](https://docs.capturebridge.net/client/sdk/javascript/0.0.0/index.html)
|
|
6
|
-
[SDK CHANGELOG](https://docs.capturebridge.net/client/sdk/javascript/0.0.0/CHANGELOG.html)
|
|
7
|
-
-->
|
|
4
|
+
[SDK CHANGELOG](https://docs.capturebridge.net/client/sdk/javascript/0.0.0/CHANGELOG.html)
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module SignatureTabletWidgets
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { blobToBase64 } from './Common.js'
|
|
5
|
+
import { blobToBase64, checkResponse } from './Common.js'
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* DisplayWidget
|
|
@@ -143,13 +143,15 @@ export class Image extends DisplayWidget {
|
|
|
143
143
|
/**
|
|
144
144
|
* Fetch the image data and base64 encode it
|
|
145
145
|
* @async
|
|
146
|
-
* @example
|
|
147
|
-
* const new Image("/img/logo.tif", 20, 200)
|
|
148
146
|
*/
|
|
149
147
|
async data () {
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
148
|
+
if (!this.imageData && this.url) {
|
|
149
|
+
const response = await fetch(this.url)
|
|
150
|
+
await checkResponse(response)
|
|
151
|
+
const blob = await response.blob()
|
|
152
|
+
this.imageData = await blobToBase64(blob)
|
|
153
|
+
}
|
|
154
|
+
return this.imageData
|
|
153
155
|
}
|
|
154
156
|
|
|
155
157
|
toJSON () {
|
package/VerifoneControls.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @module VerifoneControls
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
import { blobToBase64 } from './Common.js'
|
|
5
|
+
import { blobToBase64, checkResponse } from './Common.js'
|
|
6
6
|
import { DisplayWidget } from './SignatureTabletWidgets.js'
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -205,11 +205,13 @@ export class Image extends DisplayWidget {
|
|
|
205
205
|
* @async
|
|
206
206
|
*/
|
|
207
207
|
async data () {
|
|
208
|
-
if (!this.imageData) {
|
|
208
|
+
if (!this.imageData && this.url) {
|
|
209
209
|
const response = await fetch(this.url)
|
|
210
|
+
await checkResponse(response)
|
|
210
211
|
const blob = await response.blob()
|
|
211
212
|
this.imageData = await blobToBase64(blob)
|
|
212
213
|
}
|
|
214
|
+
return this.imageData
|
|
213
215
|
}
|
|
214
216
|
|
|
215
217
|
toJSON () {
|
package/Version.js
CHANGED