-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(shadow): remove asset_tracker_v2 specific properties
- Loading branch information
1 parent
bb11d97
commit 2c409a4
Showing
3 changed files
with
28 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,28 @@ | ||
import { Type, type Static } from '@sinclair/typebox' | ||
|
||
const PropertyMetadata = Type.Union([ | ||
Type.Object({ timestamp: Type.Integer({ minimum: 1, maximum: 9999999999 }) }), | ||
Type.Record(Type.String({ minLength: 1 }), Type.Unknown()), | ||
]) | ||
|
||
/** | ||
* @link https://api.nrfcloud.com/v1/#tag/All-Devices/operation/ListDevices | ||
*/ | ||
export const DeviceShadow = Type.Object({ | ||
id: Type.String(), | ||
$meta: Type.Object({ | ||
createdAt: Type.String({ | ||
minLength: 1, | ||
examples: ['2019-08-24T14:15:22Z'], | ||
}), | ||
updatedAt: Type.String({ | ||
minLength: 1, | ||
examples: ['2019-08-24T14:15:22Z'], | ||
}), | ||
}), | ||
state: Type.Object({ | ||
reported: Type.Object({}), | ||
reported: Type.Record(Type.String({ minLength: 1 }), Type.Any()), | ||
desired: Type.Optional( | ||
Type.Record(Type.String({ minLength: 1 }), Type.Any()), | ||
), | ||
version: Type.Number(), | ||
metadata: Type.Object({ | ||
reported: Type.Record(Type.String({ minLength: 1 }), PropertyMetadata), | ||
}), | ||
}), | ||
}) | ||
|
||
export type DeviceShadowType = Static<typeof DeviceShadow> | ||
;`` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters