Options
All
  • Public
  • Public/Protected
  • All
Menu

Module recipe/usermetadata

Index

Type Aliases

RecipeInterface: { clearUserMetadata: any; getUserMetadata: any; updateUserMetadata: any }

Type declaration

  • clearUserMetadata:function
    • clearUserMetadata(input: { userContext: UserContext; userId: string }): 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" }>
    • 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.:

      • stored: { "preferences": { "theme":"dark" }, "notifications": { "email": true }, "todos": ["example"] }
      • update: { "notifications": { "sms": true }, "todos": null }
      • result: { "preferences": { "theme":"dark" }, "notifications": { "sms": true } }

      Parameters

      • input: { metadataUpdate: JSONObject; userContext: UserContext; userId: string }
        • metadataUpdate: JSONObject
        • userContext: UserContext
        • userId: string

      Returns Promise<{ metadata: JSONObject; status: "OK" }>

Functions

  • clearUserMetadata(userId: string, userContext?: Record<string, any>): Promise<{ status: "OK" }>
  • getUserMetadata(userId: string, userContext?: Record<string, any>): Promise<{ metadata: any; status: "OK" }>
  • init(config?: TypeInput): RecipeListFunction
  • updateUserMetadata(userId: string, metadataUpdate: JSONObject, userContext?: Record<string, any>): Promise<{ metadata: JSONObject; status: "OK" }>

Generated using TypeDoc