@expressms/smartapp-sdk 1.12.0-alpha.14 → 1.12.0-alpha.15
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/build/main/lib/devices/nfc.d.ts +3 -7
- package/build/main/lib/devices/nfc.js +4 -6
- package/build/main/types/devices.d.ts +7 -3
- package/build/module/lib/devices/nfc.d.ts +3 -7
- package/build/module/lib/devices/nfc.js +5 -7
- package/build/module/types/devices.d.ts +7 -3
- package/build/umd/index.js +3 -5
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NfcReadTagResponse, StatusResponse } from '../../types';
|
|
1
|
+
import { NfcReadTagResponse, NfcWriteMessage, StatusResponse } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* Read NFC tag
|
|
4
4
|
* @returns Promise that'll be fullfilled with `payload.nfcTag` on success, otherwise rejected with reason
|
|
@@ -6,11 +6,7 @@ import { NfcReadTagResponse, StatusResponse } from '../../types';
|
|
|
6
6
|
export declare const readTag: () => Promise<NfcReadTagResponse>;
|
|
7
7
|
/**
|
|
8
8
|
* Write NFC tag
|
|
9
|
-
* @param
|
|
10
|
-
* @param bytes Bytes to be wtitten
|
|
9
|
+
* @param messages List of messages to be wtitten
|
|
11
10
|
* @returns Promise that'll be fullfilled on success, otherwise rejected with reason
|
|
12
11
|
*/
|
|
13
|
-
export declare const writeTag: (
|
|
14
|
-
mimeType: string;
|
|
15
|
-
bytes: number[];
|
|
16
|
-
}) => Promise<StatusResponse>;
|
|
12
|
+
export declare const writeTag: (messages: Array<NfcWriteMessage>) => Promise<StatusResponse>;
|
|
@@ -23,22 +23,20 @@ const readTag = () => {
|
|
|
23
23
|
exports.readTag = readTag;
|
|
24
24
|
/**
|
|
25
25
|
* Write NFC tag
|
|
26
|
-
* @param
|
|
27
|
-
* @param bytes Bytes to be wtitten
|
|
26
|
+
* @param messages List of messages to be wtitten
|
|
28
27
|
* @returns Promise that'll be fullfilled on success, otherwise rejected with reason
|
|
29
28
|
*/
|
|
30
|
-
const writeTag = (
|
|
29
|
+
const writeTag = (messages) => {
|
|
31
30
|
if (!smartapp_bridge_1.default)
|
|
32
31
|
return Promise.reject(types_1.ERROR_CODES.NO_BRIDGE);
|
|
33
32
|
return smartapp_bridge_1.default
|
|
34
33
|
.sendClientEvent({
|
|
35
34
|
method: types_1.METHODS.WRITE_NFC_TAG,
|
|
36
35
|
params: {
|
|
37
|
-
|
|
38
|
-
bytes,
|
|
36
|
+
messages,
|
|
39
37
|
},
|
|
40
38
|
})
|
|
41
39
|
.then(event => event);
|
|
42
40
|
};
|
|
43
41
|
exports.writeTag = writeTag;
|
|
44
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
42
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmZjLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2xpYi9kZXZpY2VzL25mYy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQSxpRkFBK0M7QUFDL0MsdUNBQXVHO0FBRXZHOzs7R0FHRztBQUNJLE1BQU0sT0FBTyxHQUFHLEdBQWdDLEVBQUU7SUFDdkQsSUFBSSxDQUFDLHlCQUFNO1FBQUUsT0FBTyxPQUFPLENBQUMsTUFBTSxDQUFDLG1CQUFXLENBQUMsU0FBUyxDQUFDLENBQUE7SUFFekQsT0FBTyx5QkFBTTtTQUNWLGVBQWUsQ0FBQztRQUNmLE1BQU0sRUFBRSxlQUFPLENBQUMsWUFBWTtRQUM1QixNQUFNLEVBQUUsRUFBRTtLQUNYLENBQUM7U0FDRCxJQUFJLENBQUMsS0FBSyxDQUFDLEVBQUUsQ0FBQyxLQUEyQixDQUFDLENBQUE7QUFDL0MsQ0FBQyxDQUFBO0FBVFksUUFBQSxPQUFPLFdBU25CO0FBRUQ7Ozs7R0FJRztBQUNJLE1BQU0sUUFBUSxHQUFHLENBQUMsUUFBZ0MsRUFBMkIsRUFBRTtJQUNwRixJQUFJLENBQUMseUJBQU07UUFBRSxPQUFPLE9BQU8sQ0FBQyxNQUFNLENBQUMsbUJBQVcsQ0FBQyxTQUFTLENBQUMsQ0FBQTtJQUV6RCxPQUFPLHlCQUFNO1NBQ1YsZUFBZSxDQUFDO1FBQ2YsTUFBTSxFQUFFLGVBQU8sQ0FBQyxhQUFhO1FBQzdCLE1BQU0sRUFBRTtZQUNOLFFBQVE7U0FDVDtLQUNGLENBQUM7U0FDRCxJQUFJLENBQUMsS0FBSyxDQUFDLEVBQUUsQ0FBQyxLQUF1QixDQUFDLENBQUE7QUFDM0MsQ0FBQyxDQUFBO0FBWFksUUFBQSxRQUFRLFlBV3BCIn0=
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EmitterEventPayload } from '@expressms/smartapp-bridge/build/main/types/eventEmitter';
|
|
2
2
|
import { STATUS, StatusResponse } from './bridge';
|
|
3
|
-
export type BluetoothErrorCode = 'permission_denied' | 'bluetooth_not_found' | 'ble_device_not_found' | 'ble_device_not_connected' | 'ble_gatt_service_not_found' | 'ble_gatt_characteristic_not_found' | 'io_error' | 'error';
|
|
3
|
+
export type BluetoothErrorCode = 'permission_denied' | 'bluetooth_not_found' | 'ble_device_not_found' | 'ble_device_not_connected' | 'ble_gatt_service_not_found' | 'ble_gatt_characteristic_not_found' | 'not_enough_memory' | 'io_error' | 'error';
|
|
4
4
|
export type BleDevice = {
|
|
5
5
|
address: string;
|
|
6
6
|
name: string;
|
|
@@ -47,7 +47,7 @@ export interface BluetoothReadBleGattCharacteristicResponse extends EmitterEvent
|
|
|
47
47
|
}
|
|
48
48
|
export type BleDeviceCallback = (device: BleDevice) => {};
|
|
49
49
|
export type NfcErrorCode = 'permission_denied' | 'nfc_not_found' | 'nfc_write_error' | 'cancelled_by_user' | 'error';
|
|
50
|
-
export type
|
|
50
|
+
export type NfcReadMessage = {
|
|
51
51
|
bytes: Array<number>;
|
|
52
52
|
};
|
|
53
53
|
export interface NfcReadTagResponse extends EmitterEventPayload {
|
|
@@ -56,7 +56,11 @@ export interface NfcReadTagResponse extends EmitterEventPayload {
|
|
|
56
56
|
errorCode?: NfcErrorCode;
|
|
57
57
|
nfcTag: {
|
|
58
58
|
id: string;
|
|
59
|
-
messages: Array<
|
|
59
|
+
messages: Array<NfcReadMessage>;
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
|
+
export interface NfcWriteMessage {
|
|
64
|
+
mimeType: string;
|
|
65
|
+
bytes: number[];
|
|
66
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NfcReadTagResponse, StatusResponse } from '../../types';
|
|
1
|
+
import { NfcReadTagResponse, NfcWriteMessage, StatusResponse } from '../../types';
|
|
2
2
|
/**
|
|
3
3
|
* Read NFC tag
|
|
4
4
|
* @returns Promise that'll be fullfilled with `payload.nfcTag` on success, otherwise rejected with reason
|
|
@@ -6,11 +6,7 @@ import { NfcReadTagResponse, StatusResponse } from '../../types';
|
|
|
6
6
|
export declare const readTag: () => Promise<NfcReadTagResponse>;
|
|
7
7
|
/**
|
|
8
8
|
* Write NFC tag
|
|
9
|
-
* @param
|
|
10
|
-
* @param bytes Bytes to be wtitten
|
|
9
|
+
* @param messages List of messages to be wtitten
|
|
11
10
|
* @returns Promise that'll be fullfilled on success, otherwise rejected with reason
|
|
12
11
|
*/
|
|
13
|
-
export declare const writeTag: (
|
|
14
|
-
mimeType: string;
|
|
15
|
-
bytes: number[];
|
|
16
|
-
}) => Promise<StatusResponse>;
|
|
12
|
+
export declare const writeTag: (messages: Array<NfcWriteMessage>) => Promise<StatusResponse>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import bridge from '@expressms/smartapp-bridge';
|
|
2
|
-
import { ERROR_CODES, METHODS
|
|
2
|
+
import { ERROR_CODES, METHODS } from '../../types';
|
|
3
3
|
/**
|
|
4
4
|
* Read NFC tag
|
|
5
5
|
* @returns Promise that'll be fullfilled with `payload.nfcTag` on success, otherwise rejected with reason
|
|
@@ -16,21 +16,19 @@ export const readTag = () => {
|
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
18
|
* Write NFC tag
|
|
19
|
-
* @param
|
|
20
|
-
* @param bytes Bytes to be wtitten
|
|
19
|
+
* @param messages List of messages to be wtitten
|
|
21
20
|
* @returns Promise that'll be fullfilled on success, otherwise rejected with reason
|
|
22
21
|
*/
|
|
23
|
-
export const writeTag = (
|
|
22
|
+
export const writeTag = (messages) => {
|
|
24
23
|
if (!bridge)
|
|
25
24
|
return Promise.reject(ERROR_CODES.NO_BRIDGE);
|
|
26
25
|
return bridge
|
|
27
26
|
.sendClientEvent({
|
|
28
27
|
method: METHODS.WRITE_NFC_TAG,
|
|
29
28
|
params: {
|
|
30
|
-
|
|
31
|
-
bytes,
|
|
29
|
+
messages,
|
|
32
30
|
},
|
|
33
31
|
})
|
|
34
32
|
.then(event => event);
|
|
35
33
|
};
|
|
36
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
34
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibmZjLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vc3JjL2xpYi9kZXZpY2VzL25mYy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLE1BQU0sTUFBTSw0QkFBNEIsQ0FBQTtBQUMvQyxPQUFPLEVBQUUsV0FBVyxFQUFFLE9BQU8sRUFBdUQsTUFBTSxhQUFhLENBQUE7QUFFdkc7OztHQUdHO0FBQ0gsTUFBTSxDQUFDLE1BQU0sT0FBTyxHQUFHLEdBQWdDLEVBQUU7SUFDdkQsSUFBSSxDQUFDLE1BQU07UUFBRSxPQUFPLE9BQU8sQ0FBQyxNQUFNLENBQUMsV0FBVyxDQUFDLFNBQVMsQ0FBQyxDQUFBO0lBRXpELE9BQU8sTUFBTTtTQUNWLGVBQWUsQ0FBQztRQUNmLE1BQU0sRUFBRSxPQUFPLENBQUMsWUFBWTtRQUM1QixNQUFNLEVBQUUsRUFBRTtLQUNYLENBQUM7U0FDRCxJQUFJLENBQUMsS0FBSyxDQUFDLEVBQUUsQ0FBQyxLQUEyQixDQUFDLENBQUE7QUFDL0MsQ0FBQyxDQUFBO0FBRUQ7Ozs7R0FJRztBQUNILE1BQU0sQ0FBQyxNQUFNLFFBQVEsR0FBRyxDQUFDLFFBQWdDLEVBQTJCLEVBQUU7SUFDcEYsSUFBSSxDQUFDLE1BQU07UUFBRSxPQUFPLE9BQU8sQ0FBQyxNQUFNLENBQUMsV0FBVyxDQUFDLFNBQVMsQ0FBQyxDQUFBO0lBRXpELE9BQU8sTUFBTTtTQUNWLGVBQWUsQ0FBQztRQUNmLE1BQU0sRUFBRSxPQUFPLENBQUMsYUFBYTtRQUM3QixNQUFNLEVBQUU7WUFDTixRQUFRO1NBQ1Q7S0FDRixDQUFDO1NBQ0QsSUFBSSxDQUFDLEtBQUssQ0FBQyxFQUFFLENBQUMsS0FBdUIsQ0FBQyxDQUFBO0FBQzNDLENBQUMsQ0FBQSJ9
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { EmitterEventPayload } from '@expressms/smartapp-bridge/build/main/types/eventEmitter';
|
|
2
2
|
import { STATUS, StatusResponse } from './bridge';
|
|
3
|
-
export type BluetoothErrorCode = 'permission_denied' | 'bluetooth_not_found' | 'ble_device_not_found' | 'ble_device_not_connected' | 'ble_gatt_service_not_found' | 'ble_gatt_characteristic_not_found' | 'io_error' | 'error';
|
|
3
|
+
export type BluetoothErrorCode = 'permission_denied' | 'bluetooth_not_found' | 'ble_device_not_found' | 'ble_device_not_connected' | 'ble_gatt_service_not_found' | 'ble_gatt_characteristic_not_found' | 'not_enough_memory' | 'io_error' | 'error';
|
|
4
4
|
export type BleDevice = {
|
|
5
5
|
address: string;
|
|
6
6
|
name: string;
|
|
@@ -47,7 +47,7 @@ export interface BluetoothReadBleGattCharacteristicResponse extends EmitterEvent
|
|
|
47
47
|
}
|
|
48
48
|
export type BleDeviceCallback = (device: BleDevice) => {};
|
|
49
49
|
export type NfcErrorCode = 'permission_denied' | 'nfc_not_found' | 'nfc_write_error' | 'cancelled_by_user' | 'error';
|
|
50
|
-
export type
|
|
50
|
+
export type NfcReadMessage = {
|
|
51
51
|
bytes: Array<number>;
|
|
52
52
|
};
|
|
53
53
|
export interface NfcReadTagResponse extends EmitterEventPayload {
|
|
@@ -56,7 +56,11 @@ export interface NfcReadTagResponse extends EmitterEventPayload {
|
|
|
56
56
|
errorCode?: NfcErrorCode;
|
|
57
57
|
nfcTag: {
|
|
58
58
|
id: string;
|
|
59
|
-
messages: Array<
|
|
59
|
+
messages: Array<NfcReadMessage>;
|
|
60
60
|
};
|
|
61
61
|
};
|
|
62
62
|
}
|
|
63
|
+
export interface NfcWriteMessage {
|
|
64
|
+
mimeType: string;
|
|
65
|
+
bytes: number[];
|
|
66
|
+
}
|
package/build/umd/index.js
CHANGED
|
@@ -2884,19 +2884,17 @@
|
|
|
2884
2884
|
};
|
|
2885
2885
|
/**
|
|
2886
2886
|
* Write NFC tag
|
|
2887
|
-
* @param
|
|
2888
|
-
* @param bytes Bytes to be wtitten
|
|
2887
|
+
* @param messages List of messages to be wtitten
|
|
2889
2888
|
* @returns Promise that'll be fullfilled on success, otherwise rejected with reason
|
|
2890
2889
|
*/
|
|
2891
|
-
const writeTag = (
|
|
2890
|
+
const writeTag = (messages) => {
|
|
2892
2891
|
if (!bridge)
|
|
2893
2892
|
return Promise.reject(ERROR_CODES.NO_BRIDGE);
|
|
2894
2893
|
return bridge
|
|
2895
2894
|
.sendClientEvent({
|
|
2896
2895
|
method: METHODS.WRITE_NFC_TAG,
|
|
2897
2896
|
params: {
|
|
2898
|
-
|
|
2899
|
-
bytes,
|
|
2897
|
+
messages,
|
|
2900
2898
|
},
|
|
2901
2899
|
})
|
|
2902
2900
|
.then(event => event);
|