diff --git a/proto/deviceInfo/v1.proto b/proto/deviceInfo/v1.proto index 900110b..48a902a 100644 --- a/proto/deviceInfo/v1.proto +++ b/proto/deviceInfo/v1.proto @@ -21,6 +21,11 @@ message DeviceInfo_1 { selfHostedServer = 4; } + message SelfHostedServerDetails { + string baseUrl = 1 [(required) = true]; + } + string name = 5; DeviceType deviceType = 6; + optional SelfHostedServerDetails selfHostedServerDetails = 7; } diff --git a/schema/deviceInfo/v1.json b/schema/deviceInfo/v1.json index c591ba6..3ce1d0d 100644 --- a/schema/deviceInfo/v1.json +++ b/schema/deviceInfo/v1.json @@ -23,6 +23,17 @@ "UNRECOGNIZED" ], "description": "Type of device" + }, + "selfHostedServerDetails": { + "type": "object", + "properties": { + "baseUrl": { + "description": "base URL for the server", + "type": "string", + "minLength": 1 + } + }, + "required": ["baseUrl"] } }, "required": ["schemaName", "name", "deviceType"], diff --git a/test/fixtures/good-docs-completed.js b/test/fixtures/good-docs-completed.js index f9d8c99..7f0c4d7 100644 --- a/test/fixtures/good-docs-completed.js +++ b/test/fixtures/good-docs-completed.js @@ -212,6 +212,24 @@ export const goodDocsCompleted = [ deviceType: 'UNRECOGNIZED', }, }, + { + doc: { + docId: cachedValues.docId, + versionId: cachedValues.versionId, + originalVersionId: cachedValues.originalVersionId, + schemaName: 'deviceInfo', + createdAt: cachedValues.createdAt, + updatedAt: cachedValues.updatedAt, + links: [], + name: 'my server', + deviceType: 'selfHostedServer', + deleted: false, + selfHostedServerDetails: { + baseUrl: 'https://mapeo.example/foo', + }, + }, + expected: {}, + }, { doc: { docId: cachedValues.docId,