@blueid/access-cli 1.96.0 → 2.0.0-beta.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.
|
@@ -44,20 +44,23 @@ export default async ({ vendorIdentity, hardwareType, hardwareVersion, hardwareS
|
|
|
44
44
|
|
|
45
45
|
const payload = {
|
|
46
46
|
vendorIdentity,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
hardware: {
|
|
48
|
+
type: hardwareType,
|
|
49
|
+
version: hardwareVersionNumber,
|
|
50
|
+
serialNumber: hardwareSerialNumber,
|
|
51
|
+
name: hardwareName,
|
|
52
|
+
meta
|
|
53
|
+
}
|
|
52
54
|
}
|
|
53
55
|
|
|
56
|
+
let signature = ''
|
|
54
57
|
try {
|
|
55
|
-
|
|
58
|
+
signature = createSignature(JSON.stringify(payload), vendorPrivateKey, 'base64')
|
|
56
59
|
} catch (e) {
|
|
57
60
|
throw new Error(`Failed to create signature with: ${e.message}`)
|
|
58
61
|
}
|
|
59
62
|
|
|
60
|
-
const response = await apiPost('/access/
|
|
63
|
+
const response = await apiPost('/access/devices/register', { payload, signature }, { dev })
|
|
61
64
|
|
|
62
65
|
const {
|
|
63
66
|
deviceId,
|
package/lib/proto/BlueCore_pb.js
CHANGED
|
@@ -149,6 +149,9 @@ export const BlueWeekday = proto2.makeEnum(
|
|
|
149
149
|
);
|
|
150
150
|
|
|
151
151
|
/**
|
|
152
|
+
* @TODO: Keep it until we have updated all places in both iOS and Android SDK.
|
|
153
|
+
* This should be renamed to BlueIdentityRole later on.
|
|
154
|
+
*
|
|
152
155
|
* @generated from enum BlueCredentialType
|
|
153
156
|
*/
|
|
154
157
|
export const BlueCredentialType = proto2.makeEnum(
|
package/lib/proto/BlueSDK_pb.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
import { proto2 } from "@bufbuild/protobuf";
|
|
7
7
|
import { BlueBleManufacturerInfo, BlueCredentialId, BlueCredentialType, BlueHardwareType, BlueLocalTimestamp, BlueOssSoConfiguration, BlueReturnCode } from "./BlueCore_pb.js";
|
|
8
|
-
import { BlueSystemStatus } from "./BlueSystem_pb.js";
|
|
8
|
+
import { BlueSystemProvisioning, BlueSystemStatus } from "./BlueSystem_pb.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @generated from enum BlueDeviceType
|
|
@@ -139,34 +139,33 @@ export const BlueDeviceInfo = proto2.makeMessageType(
|
|
|
139
139
|
);
|
|
140
140
|
|
|
141
141
|
/**
|
|
142
|
-
* @generated from message
|
|
142
|
+
* @generated from message BlueIdentity
|
|
143
143
|
*/
|
|
144
|
-
export const
|
|
145
|
-
"
|
|
144
|
+
export const BlueIdentity = proto2.makeMessageType(
|
|
145
|
+
"BlueIdentity",
|
|
146
146
|
() => [
|
|
147
|
-
{ no: 1, name: "
|
|
148
|
-
{ no: 2, name: "
|
|
147
|
+
{ no: 1, name: "identityId", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
148
|
+
{ no: 2, name: "role", kind: "enum", T: proto2.getEnumType(BlueCredentialType) },
|
|
149
149
|
{ no: 3, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
150
150
|
{ no: 4, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
151
|
-
{ no: 5, name: "
|
|
152
|
-
{ no: 6, name: "
|
|
153
|
-
{ no: 7, name: "
|
|
154
|
-
{ no: 8, name: "
|
|
155
|
-
{ no: 9, name: "
|
|
156
|
-
{ no: 10, name: "
|
|
157
|
-
{ no: 11, name: "
|
|
158
|
-
{ no: 12, name: "
|
|
159
|
-
{ no: 13, name: "organisationName", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
151
|
+
{ no: 5, name: "receiverName", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
152
|
+
{ no: 6, name: "validFrom", kind: "message", T: BlueLocalTimestamp, opt: true },
|
|
153
|
+
{ no: 7, name: "validTo", kind: "message", T: BlueLocalTimestamp, opt: true },
|
|
154
|
+
{ no: 8, name: "organization", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
155
|
+
{ no: 9, name: "organizationName", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
156
|
+
{ no: 10, name: "siteId", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
|
|
157
|
+
{ no: 11, name: "siteName", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
158
|
+
{ no: 12, name: "privateKey", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true },
|
|
160
159
|
],
|
|
161
160
|
);
|
|
162
161
|
|
|
163
162
|
/**
|
|
164
|
-
* @generated from message
|
|
163
|
+
* @generated from message BlueIdentitiesList
|
|
165
164
|
*/
|
|
166
|
-
export const
|
|
167
|
-
"
|
|
165
|
+
export const BlueIdentitiesList = proto2.makeMessageType(
|
|
166
|
+
"BlueIdentitiesList",
|
|
168
167
|
() => [
|
|
169
|
-
{ no: 1, name: "
|
|
168
|
+
{ no: 1, name: "identities", kind: "message", T: BlueIdentity, repeated: true },
|
|
170
169
|
],
|
|
171
170
|
);
|
|
172
171
|
|
|
@@ -216,6 +215,139 @@ export const BlueAccessObjectList = proto2.makeMessageType(
|
|
|
216
215
|
],
|
|
217
216
|
);
|
|
218
217
|
|
|
218
|
+
/**
|
|
219
|
+
* @generated from message BlueHardwareInfo
|
|
220
|
+
*/
|
|
221
|
+
export const BlueHardwareInfo = proto2.makeMessageType(
|
|
222
|
+
"BlueHardwareInfo",
|
|
223
|
+
() => [
|
|
224
|
+
{ no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
225
|
+
{ no: 2, name: "vendor", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
226
|
+
{ no: 3, name: "vendorName", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
227
|
+
{ no: 4, name: "version", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
|
|
228
|
+
{ no: 5, name: "type", kind: "enum", T: proto2.getEnumType(BlueHardwareType) },
|
|
229
|
+
],
|
|
230
|
+
);
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* @generated from message BlueSystemStatusExt
|
|
234
|
+
*/
|
|
235
|
+
export const BlueSystemStatusExt = proto2.makeMessageType(
|
|
236
|
+
"BlueSystemStatusExt",
|
|
237
|
+
() => [
|
|
238
|
+
{ no: 1, name: "status", kind: "message", T: BlueSystemStatus },
|
|
239
|
+
{ no: 2, name: "newFirmwareVersionAvailable", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
|
|
240
|
+
{ no: 3, name: "newTestFirmwareVersionAvailable", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
|
|
241
|
+
{ no: 4, name: "newConfigurationAvailable", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
|
|
242
|
+
{ no: 5, name: "hardwareInfo", kind: "message", T: BlueHardwareInfo, opt: true },
|
|
243
|
+
],
|
|
244
|
+
);
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* @generated from message BlueRefreshOssSoIdentity
|
|
248
|
+
*/
|
|
249
|
+
export const BlueRefreshOssSoIdentity = proto2.makeMessageType(
|
|
250
|
+
"BlueRefreshOssSoIdentity",
|
|
251
|
+
() => [
|
|
252
|
+
{ no: 1, name: "identityId", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
253
|
+
{ no: 2, name: "status", kind: "enum", T: proto2.getEnumType(BlueRefreshOssSoCredentialStatus) },
|
|
254
|
+
{ no: 3, name: "configuration", kind: "message", T: BlueOssSoConfiguration, opt: true },
|
|
255
|
+
],
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* @generated from message BlueRefreshOssSoIdentities
|
|
260
|
+
*/
|
|
261
|
+
export const BlueRefreshOssSoIdentities = proto2.makeMessageType(
|
|
262
|
+
"BlueRefreshOssSoIdentities",
|
|
263
|
+
() => [
|
|
264
|
+
{ no: 1, name: "identities", kind: "message", T: BlueRefreshOssSoIdentity, repeated: true },
|
|
265
|
+
],
|
|
266
|
+
);
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* @generated from message BlueSynchronizeIdentity
|
|
270
|
+
*/
|
|
271
|
+
export const BlueSynchronizeIdentity = proto2.makeMessageType(
|
|
272
|
+
"BlueSynchronizeIdentity",
|
|
273
|
+
() => [
|
|
274
|
+
{ no: 1, name: "identityId", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
275
|
+
{ no: 2, name: "returnCode", kind: "enum", T: proto2.getEnumType(BlueReturnCode) },
|
|
276
|
+
{ no: 3, name: "errorDescription", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
277
|
+
],
|
|
278
|
+
);
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* @generated from message BlueSynchronizeIdentities
|
|
282
|
+
*/
|
|
283
|
+
export const BlueSynchronizeIdentities = proto2.makeMessageType(
|
|
284
|
+
"BlueSynchronizeIdentities",
|
|
285
|
+
() => [
|
|
286
|
+
{ no: 1, name: "identities", kind: "message", T: BlueSynchronizeIdentity, repeated: true },
|
|
287
|
+
],
|
|
288
|
+
);
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* @generated from message BlueLegacyProvisioningRequest
|
|
292
|
+
*/
|
|
293
|
+
export const BlueLegacyProvisioningRequest = proto2.makeMessageType(
|
|
294
|
+
"BlueLegacyProvisioningRequest",
|
|
295
|
+
() => [
|
|
296
|
+
{ no: 1, name: "deviceId", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
297
|
+
{ no: 2, name: "soid", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
298
|
+
{ no: 3, name: "vendor", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
299
|
+
{ no: 4, name: "hardwareType", kind: "enum", T: proto2.getEnumType(BlueHardwareType) },
|
|
300
|
+
{ no: 5, name: "hardwareVersion", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
|
|
301
|
+
{ no: 6, name: "hardwareSerialNumber", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
302
|
+
],
|
|
303
|
+
);
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* @generated from message BlueLegacyProvisioningResponse
|
|
307
|
+
*/
|
|
308
|
+
export const BlueLegacyProvisioningResponse = proto2.makeMessageType(
|
|
309
|
+
"BlueLegacyProvisioningResponse",
|
|
310
|
+
() => [
|
|
311
|
+
{ no: 1, name: "deviceId", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
312
|
+
{ no: 2, name: "objectId", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
313
|
+
{ no: 3, name: "provisioning", kind: "message", T: BlueSystemProvisioning },
|
|
314
|
+
],
|
|
315
|
+
);
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* @TODO: Keep it until we have updated all places in both iOS and Android SDK.
|
|
319
|
+
*
|
|
320
|
+
* @generated from message BlueAccessCredential
|
|
321
|
+
*/
|
|
322
|
+
export const BlueAccessCredential = proto2.makeMessageType(
|
|
323
|
+
"BlueAccessCredential",
|
|
324
|
+
() => [
|
|
325
|
+
{ no: 1, name: "credentialId", kind: "message", T: BlueCredentialId },
|
|
326
|
+
{ no: 2, name: "credentialType", kind: "enum", T: proto2.getEnumType(BlueCredentialType) },
|
|
327
|
+
{ no: 3, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
328
|
+
{ no: 4, name: "description", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
329
|
+
{ no: 5, name: "siteId", kind: "scalar", T: 5 /* ScalarType.INT32 */ },
|
|
330
|
+
{ no: 6, name: "siteName", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
331
|
+
{ no: 7, name: "validFrom", kind: "message", T: BlueLocalTimestamp, opt: true },
|
|
332
|
+
{ no: 8, name: "validTo", kind: "message", T: BlueLocalTimestamp, opt: true },
|
|
333
|
+
{ no: 9, name: "validity", kind: "message", T: BlueLocalTimestamp, opt: true },
|
|
334
|
+
{ no: 10, name: "privateKey", kind: "scalar", T: 12 /* ScalarType.BYTES */, opt: true },
|
|
335
|
+
{ no: 11, name: "receiverName", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
336
|
+
{ no: 12, name: "organisation", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
337
|
+
{ no: 13, name: "organisationName", kind: "scalar", T: 9 /* ScalarType.STRING */, opt: true },
|
|
338
|
+
],
|
|
339
|
+
);
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* @generated from message BlueAccessCredentialList
|
|
343
|
+
*/
|
|
344
|
+
export const BlueAccessCredentialList = proto2.makeMessageType(
|
|
345
|
+
"BlueAccessCredentialList",
|
|
346
|
+
() => [
|
|
347
|
+
{ no: 1, name: "credentials", kind: "message", T: BlueAccessCredential, repeated: true },
|
|
348
|
+
],
|
|
349
|
+
);
|
|
350
|
+
|
|
219
351
|
/**
|
|
220
352
|
* @generated from message BlueRefreshOssSoCredential
|
|
221
353
|
*/
|
|
@@ -260,31 +392,3 @@ export const BlueSynchronizeAccessCredentials = proto2.makeMessageType(
|
|
|
260
392
|
],
|
|
261
393
|
);
|
|
262
394
|
|
|
263
|
-
/**
|
|
264
|
-
* @generated from message BlueHardwareInfo
|
|
265
|
-
*/
|
|
266
|
-
export const BlueHardwareInfo = proto2.makeMessageType(
|
|
267
|
-
"BlueHardwareInfo",
|
|
268
|
-
() => [
|
|
269
|
-
{ no: 1, name: "name", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
270
|
-
{ no: 2, name: "vendor", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
271
|
-
{ no: 3, name: "vendorName", kind: "scalar", T: 9 /* ScalarType.STRING */ },
|
|
272
|
-
{ no: 4, name: "version", kind: "scalar", T: 13 /* ScalarType.UINT32 */ },
|
|
273
|
-
{ no: 5, name: "type", kind: "enum", T: proto2.getEnumType(BlueHardwareType) },
|
|
274
|
-
],
|
|
275
|
-
);
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* @generated from message BlueSystemStatusExt
|
|
279
|
-
*/
|
|
280
|
-
export const BlueSystemStatusExt = proto2.makeMessageType(
|
|
281
|
-
"BlueSystemStatusExt",
|
|
282
|
-
() => [
|
|
283
|
-
{ no: 1, name: "status", kind: "message", T: BlueSystemStatus },
|
|
284
|
-
{ no: 2, name: "newFirmwareVersionAvailable", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
|
|
285
|
-
{ no: 3, name: "newTestFirmwareVersionAvailable", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
|
|
286
|
-
{ no: 4, name: "newConfigurationAvailable", kind: "scalar", T: 8 /* ScalarType.BOOL */, opt: true },
|
|
287
|
-
{ no: 5, name: "hardwareInfo", kind: "message", T: BlueHardwareInfo, opt: true },
|
|
288
|
-
],
|
|
289
|
-
);
|
|
290
|
-
|
package/lib/shared/api.js
CHANGED