-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ModelService upsert -> createOrReplace #286
Conversation
You have successfully added a new CodeQL configuration |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should add a test where you are removing a default value for a model.
Also, can you assign the PR to yourself and add appropriate headers please?
Done ! |
response = await sdk.query({ | ||
controller: "device-manager/models", | ||
action: "writeDevice", | ||
body: { | ||
model: "Zigbee", | ||
measures: [ | ||
{ type: "temperature", name: "temperature" }, | ||
], | ||
metadataMappings: { | ||
network2: { type: "keyword" }, | ||
}, | ||
}, | ||
}); |
Check warning
Code scanning / CodeQL
Useless assignment to local variable
response = await sdk.query({ | ||
controller: "device-manager/models", | ||
action: "writeAsset", | ||
body: { | ||
engineGroup: "commons", | ||
model: "Plane", | ||
metadataMappings: { | ||
company2: { type: "keyword" }, | ||
}, | ||
measures: [ | ||
{ name: "position", type: "position" }, | ||
], | ||
}, | ||
}); |
Check warning
Code scanning / CodeQL
Useless assignment to local variable
e4ae6ec
to
b90db79
Compare
b90db79
to
76980e9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
# [2.2.0](https://github.com/kuzzleio/kuzzle-device-manager/releases/tag/2.2.0) (2023-04-17) #### Bug fixes - [ [#290](#290) ] Historize asset for each same measurements ([tdislay](https://github.com/tdislay)) - [ [#288](#288) ] Full path nested metadata when create/update assets ([OlivierCavadenti](https://github.com/OlivierCavadenti)) - [ [#286](#286) ] ModelService upsert -> createOrReplace ([fmauNeko](https://github.com/fmauNeko)) - [ [#282](#282) ] Fix engine creation ([Aschen](https://github.com/Aschen)) #### New features - [ [#296](#296) ] Export measures to CSV ([Aschen](https://github.com/Aschen)) - [ [#291](#291) ] Add type of measure linked in each links of asset measures. ([OlivierCavadenti](https://github.com/OlivierCavadenti)) #### Enhancements - [ [#295](#295) ] Export default mappings ([Aschen](https://github.com/Aschen)) - [ [#293](#293) ] Allow JSONObject in metadata ([Aschen](https://github.com/Aschen)) - [ [#287](#287) ] Update metadata in existing assets when the model is modified ([fmauNeko](https://github.com/fmauNeko)) - [ [#283](#283) ] Store reason of discarded payloads ([OlivierCavadenti](https://github.com/OlivierCavadenti)) #### Others - [ [#289](#289) ] Split tsconfig for tests ([fmauNeko](https://github.com/fmauNeko)) ---
What does this PR do ?
This PR changes the
document.upsert
calls inModelService
intodocument.createOrReplace
calls, in order to match the behavior described in the documentation.It also updates the related tests.