Provides an accessor write data to the App's persistent storage. A App only has access to its own persistent storage and does not have access to any other App's.

Hierarchy

  • IPersistence

Methods

  • Creates a new record in the App's persistent storage, returning the resulting "id".

    Parameters

    • data: object

      the actual data to store, must be an object otherwise it will error out.

    Returns Promise<string>

    the resulting record's id

  • Creates a new record in the App's persistent storage with the associated information being provided.

    Parameters

    • data: object

      the actual data to store, must be an object otherwise it will error out

    • association: RocketChatAssociationRecord

      the association data which includes the model and record id

    Returns Promise<string>

    the resulting record's id

  • Creates a new record in the App's persistent storage with the data being associated with more than one Rocket.Chat record.

    Parameters

    • data: object

      the actual data to store, must be an object otherwise it will error out

    • associations: RocketChatAssociationRecord[]

      an array of association data which includes the model and record id

    Returns Promise<string>

    the resulting record's id

  • Removes a record by the provided id and returns the removed record.

    Parameters

    • id: string

      of the record to remove

    Returns Promise<object>

    the data record which was removed

  • Removes all of the records in persistent storage which are associated with the provided information.

    Parameters

    Returns Promise<object[]>

    the data of the removed records

  • Removes all of the records in persistent storage which are associated with the provided information. More than one association acts like an AND which means a record in persistent storage must have all of the associations to be considered a match.

    Parameters

    Returns Promise<object[]>

    the data of the removed records

  • Updates an existing record with the data provided in the App's persistent storage. This will throw an error if the record doesn't currently exist or if the data is not an object.

    Parameters

    • id: string

      the data record's id

    • data: object

      the actual data to store, must be an object otherwise it will error out

    • Optional upsert: boolean

      whether a record should be created if the id to be updated does not exist

    Returns Promise<string>

    the id of the updated/upserted record

  • Updates an existing record with the data provided in the App's persistent storage which are associated with provided information. This will throw an error if the record doesn't currently exist or if the data is not an object.

    Parameters

    • association: RocketChatAssociationRecord

      the association record

    • data: object

      the actual data to store, must be an object otherwise it will error out

    • Optional upsert: boolean

      whether a record should be created if the id to be updated does not exist

    Returns Promise<string>

    the id of the updated/upserted record

  • Updates an existing record with the data provided in the App's persistent storage which are associated with more than one Rocket.Chat record. This will throw an error if the record doesn't currently exist or if the data is not an object.

    Parameters

    • associations: RocketChatAssociationRecord[]

      an array of association data which includes the model and record id

    • data: object

      the actual data to store, must be an object otherwise it will error out

    • Optional upsert: boolean

      whether a record should be created if the id to be updated does not exist

    Returns Promise<string>

    the id of the updated/upserted record

Generated using TypeDoc