Options
All
  • Public
  • Public/Protected
  • All
Menu

A class representing a Resource on the broker but with some extended information about the users with which the Resource is shared. Depending on who called the SharedResource constructor the additional fields may be populated or not. It all depends on whether the broker was instructed to populate those fields or not.

todo

Pay more atthention to where I'm using Resource vs. SharedResource. I may have to "downgrade" some SharedResources to Resources when I'm sure that SharedResource.user and SharedResource.sharedWith were not populated.

Hierarchy

Index

Constructors

constructor

Properties

brokerName

brokerName: string

The unique name of the broker that the entity came from.

clientId

clientId: string

The Id of the Client application that the Resource belongs to.

createdAt

createdAt: Date

The date when the entity was created at the broker.

data

data: any

The unstructured data that

default

default: boolean

Whether this is the default Resource of a given User and Client combination. True if it is, false if it isn't.

id

id: string

The entity Id

name

name: string

The name of the Resource.

owner

owner: string

The e-mail of the User that owns this Resource.

remarks

This value may not be fully initialized if the object passed to create this SharedResource was not fully populated.

sharedWith

sharedWith: User[]

The Users with whom this Resource is shared.

remarks

This value may not be fully initialized if the object passed to create this SharedResource was not fully populated.

sharedWithIds

sharedWithIds: string[]

The Id of the Users with whom this Resource is shared.

timestamp

timestamp: Date

The date when the entity was created or last updated locally.

updatedAt

updatedAt: Date

The date when the entity was updated at the broker.

user

user: User

The User that owns this Resource.

remarks

This value may not be fully initialized if the object passed to create this SharedResource was not fully populated.

userId

userId: string

The Id of the User that owns this Resource.

Accessors

_id

  • get _id(): string
  • set _id(id: string): void
  • _id "getter" and "setter" for backwards compatibility with the default broker API.

    Returns string

  • _id "getter" and "setter" for backwards compatibility with the default broker API.

    Parameters

    • id: string

    Returns void

Protected raw

  • get raw(): any
  • set raw(raw: any): void
  • Protected "getter" and "setter" for the raw data received from the broker.

    todo

    This is currently disabled/unused. It should be removed in the future.

    Returns any

  • Protected "getter" and "setter" for the raw data received from the broker.

    Parameters

    • raw: any

    Returns void

Methods

equals

  • equals(resource: any): boolean
  • A method that compares the current object with another object to determine if their values are equivalent.

    Parameters

    • resource: any

      The object to compare to.

    Returns boolean

update

  • update(resource: any): void
  • It updates the current object with information from a plain object received from the broker.

    Parameters

    • resource: any

      A plain object received from the broker with information about a SharedResource.

    Returns void

Generated using TypeDoc