From 048007b66cb15e3cbf66baa5906e14230c8515ec Mon Sep 17 00:00:00 2001 From: Cole Hafner Date: Tue, 30 Jul 2024 14:36:03 -0700 Subject: [PATCH] feat: added docs for 'cont' flag for Contributions API --- __tests__/schemas.spec.ts | 15 ++++++++++++--- .../cell_position/cell-position-example.json | 5 +++-- .../cell_position/cell-position.json | 9 +++++++-- .../ground_fix/ground-fix-example.json | 5 +++-- schemas/deviceToCloud/ground_fix/ground-fix.json | 7 ++++++- .../deviceToCloud/wifi/wifi-position-example.json | 5 +++-- schemas/deviceToCloud/wifi/wifi-position.json | 7 ++++++- 7 files changed, 40 insertions(+), 13 deletions(-) diff --git a/__tests__/schemas.spec.ts b/__tests__/schemas.spec.ts index 7cc5e13..4f58cd3 100644 --- a/__tests__/schemas.spec.ts +++ b/__tests__/schemas.spec.ts @@ -53,8 +53,17 @@ describe(header('device shadow'), () => { describe('Validate example for dependencies', () => { it('can correctly load device shadow', () => { - const exampleData = JSON.parse(readFileSync('./schemas/deviceShadow/ipShadow/ipShadow-example.json', 'utf-8')); - const valid = getValidationWithDependencies(DeviceShadow.IP, [DeviceShadow.Config], exampleData); + const exampleData = JSON.parse( + readFileSync( + './schemas/deviceShadow/ipShadow/ipShadow-example.json', + 'utf-8', + ), + ); + const valid = getValidationWithDependencies( + DeviceShadow.IP, + [DeviceShadow.Config], + exampleData, + ); expect(valid).toBeTruthy(); - }); + }); }); diff --git a/schemas/deviceToCloud/cell_position/cell-position-example.json b/schemas/deviceToCloud/cell_position/cell-position-example.json index 5e19981..d129ed6 100644 --- a/schemas/deviceToCloud/cell_position/cell-position-example.json +++ b/schemas/deviceToCloud/cell_position/cell-position-example.json @@ -4,7 +4,8 @@ "config": { "doReply": true, "hiConf": false, - "fallback": true + "fallback": true, + "cont": false }, "data": { "lte": [ @@ -19,4 +20,4 @@ } ] } -} \ No newline at end of file +} diff --git a/schemas/deviceToCloud/cell_position/cell-position.json b/schemas/deviceToCloud/cell_position/cell-position.json index 8484f69..bc1d0fb 100644 --- a/schemas/deviceToCloud/cell_position/cell-position.json +++ b/schemas/deviceToCloud/cell_position/cell-position.json @@ -28,6 +28,11 @@ "type": "boolean", "description": "nRF Cloud will always return the most accurate response based on cell tower location or AP location for wifi, if available. When not available, nRF Cloud falls back to area-level location estimate based on cell tower tracking area code. To disable this behavior, set fallback=false. This will ignore cell tracking area and return a 404 in event a higher accuracy response cannot be provided.", "default": true + }, + "cont": { + "type": "boolean", + "description": "nRF Cloud automatically uses your contributions to override our usual location response. To disable this behavior, set cont=false. This will ignore the contributions and proceed with the usual process for resolving your location.", + "default": true } }, "additionalProperties": false @@ -63,7 +68,7 @@ }, "rsrq": { "$ref": "#/definitions/Rsrq" - }, + }, "earfcn": { "$ref": "#/definitions/Earfcn" }, @@ -157,4 +162,4 @@ "data" ], "additionalProperties": false -} \ No newline at end of file +} diff --git a/schemas/deviceToCloud/ground_fix/ground-fix-example.json b/schemas/deviceToCloud/ground_fix/ground-fix-example.json index 9fa9c46..1e5dd7a 100644 --- a/schemas/deviceToCloud/ground_fix/ground-fix-example.json +++ b/schemas/deviceToCloud/ground_fix/ground-fix-example.json @@ -4,7 +4,8 @@ "config": { "doReply": true, "hiConf": false, - "fallback": true + "fallback": true, + "cont": false }, "data": { "wifi": { @@ -37,4 +38,4 @@ } ] } -} \ No newline at end of file +} diff --git a/schemas/deviceToCloud/ground_fix/ground-fix.json b/schemas/deviceToCloud/ground_fix/ground-fix.json index b485189..0dc7cd2 100644 --- a/schemas/deviceToCloud/ground_fix/ground-fix.json +++ b/schemas/deviceToCloud/ground_fix/ground-fix.json @@ -28,6 +28,11 @@ "type": "boolean", "description": "nRF Cloud will always return the most accurate response based on cell tower location or AP location for wifi, if available. When not available, nRF Cloud falls back to area-level location estimate based on cell tower tracking area code. To disable this behavior, set fallback=false. This will ignore cell tracking area and return a 404 in event a higher accuracy response cannot be provided.", "default": true + }, + "cont": { + "type": "boolean", + "description": "nRF Cloud automatically uses your contributions to override our usual location response. To disable this behavior, set cont=false. This will ignore the contributions and proceed with the usual process for resolving your location.", + "default": true } }, "additionalProperties": false @@ -214,4 +219,4 @@ "data" ], "additionalProperties": false -} \ No newline at end of file +} diff --git a/schemas/deviceToCloud/wifi/wifi-position-example.json b/schemas/deviceToCloud/wifi/wifi-position-example.json index 7ba7937..2225adf 100644 --- a/schemas/deviceToCloud/wifi/wifi-position-example.json +++ b/schemas/deviceToCloud/wifi/wifi-position-example.json @@ -3,7 +3,8 @@ "messageType": "DATA", "config": { "doReply": true, - "hiConf": true + "hiConf": true, + "cont": false }, "data": { "accessPoints": [ @@ -15,4 +16,4 @@ } ] } -} \ No newline at end of file +} diff --git a/schemas/deviceToCloud/wifi/wifi-position.json b/schemas/deviceToCloud/wifi/wifi-position.json index ad0e571..cd5adf1 100644 --- a/schemas/deviceToCloud/wifi/wifi-position.json +++ b/schemas/deviceToCloud/wifi/wifi-position.json @@ -23,6 +23,11 @@ "type": "boolean", "description": "nRF Cloud automatically uses a 68% confidence interval when estimating the Horizontal Positioning Error (HPE) for a location. This means that there is a 68% probability that the device's actual location is within the HPE radius of the returned coordinates. Enabling this flag will use a 95% confidence interval instead, resulting in a larger HPE radius, and a higher probability that the device's actual location is within the circle.", "default": false + }, + "cont": { + "type": "boolean", + "description": "nRF Cloud automatically uses your contributions to override our usual location response. To disable this behavior, set cont=false. This will ignore the contributions and proceed with the usual process for resolving your location.", + "default": true } }, "additionalProperties": false @@ -101,4 +106,4 @@ "description": "Channel number (only one of Channel or Frequency should be used)" } } -} \ No newline at end of file +}