RecipeInterface RecipeInterface: { clearUserMetadata: any ; getUserMetadata: any ; updateUserMetadata: any }
Type declaration clearUserMetadata: function clearUserMetadata( input: { userContext: UserContext ; userId: string } ) : Promise < { status: "OK" } > Parameters input: { userContext: UserContext ; userId: string } userContext: UserContext userId: string Returns Promise < { status: "OK" } > getUserMetadata: function getUserMetadata( input: { userContext: UserContext ; userId: string } ) : Promise < { metadata: any ; status: "OK" } > Parameters input: { userContext: UserContext ; userId: string } userContext: UserContext userId: string Returns Promise < { metadata: any ; status: "OK" } > updateUserMetadata: function updateUserMetadata( input: { metadataUpdate: JSONObject ; userContext: UserContext ; userId: string } ) : Promise < { metadata: JSONObject ; status: "OK" } > Parameters input: { metadataUpdate: JSONObject ; userContext: UserContext ; userId: string } userContext: UserContext userId: string Returns Promise < { metadata: JSONObject ; status: "OK" } >
Updates the metadata object of the user by doing a shallow merge of the stored and the update JSONs and removing properties set to null on the root level of the update object. e.g.:
{ "preferences": { "theme":"dark" }, "notifications": { "email": true }, "todos": ["example"] }
{ "notifications": { "sms": true }, "todos": null }
{ "preferences": { "theme":"dark" }, "notifications": { "sms": true } }