Class Offer

An Offer represents the Terms and Conditions for a particular offer. Acceptance of an offer by a user always results in creation a new LicenseRecord.

Hierarchy

  • Offer

Constructors

Properties

Accessors

Methods

Constructors

  • Create a new Offer object

    Parameters

    • Optional config: Config

      The optional Config object to attach this Offer to. Required for add.

    Returns Offer

Properties

_config: Config
_id: string

Accessors

  • get id(): string
  • An identifier for this Offer.

    Auto-created on construction using the current time in milliseconds since the epoch.

    Returns string

Methods

  • Add a Bullet to the array of bullets objects describing how the data will or will not be used.

    Each bullet provides a text description and a isUsed flag declaring if this is how the data will or will NOT be used.

    *UI ONLY: not persisted within a Title or License Record

    Parameters

    • val: Bullet

      The Bullet to add

    Returns Offer

  • A brief description of the Offer.

    This property is used to inform the user about the Offer, and is also used as the description for the LicenseRecord associated with this Offer.

    Parameters

    • val: string

      the Offer description

    Returns Offer

  • Determines when the resulting license (LicenseRecord) expires (assuming the user accepts the Offer).

    This method calculates the expiry date by adding the specified number of seconds to the current date.

    Parameters

    • seconds: number

      The number of seconds to add to the current date.

    Returns Offer

  • The pointer record for the TitleRecord to which this Offer applies.

    This property is used to create or find the TitleRecord for which the Offer applies.

    Parameters

    • val: string

    Returns Offer

  • The Image that represents the Offer.

    This property is used to display a graphical representation of the Offer. For best results, it is recommended to provide an image with at least 300 x 86 resolution (150:43).

    Parameters

    • src: string

      A link (e.g. './reward.png' ) to the image.

    Returns Offer

  • Adds a TitleTag to the list of tags for this Offer.

    Tags describe the type of data for the Offer and are persisted in the TitleRecord. Tags improve performance and simplify API searchability and license enforcement.

    Parameters

    Returns Offer

  • The legal Terms & Conditions of the Offer

    Parameters

    • src: string

      A link (e.g. './terms.md' ) to a markdown file containing the Terms or the HTML source text.

    • isHtml: boolean = false

      Whether the 'src` parameter is a URL (false) or an HTML source text (true). Defaults to false.

      The specified Terms & Conditions are permanently recorded in the LicenseRecord. Supports basic markdown syntax for speed and package size minimization.

      Heading:
      # foo
      ## foo
      ### foo

      Images:
      ![image alt text](/images/picture.jpg)
      ![image alt text](/images/picture.jpg "image title text")

      Links:
      [link text](http://github.com)
      [open link in new window](+http://github.com)
      [link with title](http://github.com "title text")

      Bold/Italic/Strikeout:
      __bold__, **bold**
      _italic_, *italic*
      ~~strikeout text~~

      Horizontal Rules:
      ---
      - - - -
      -- -- -- -- --
      ------------------------

      Lists:
      * unordered list
      1. ordered list

      Code:
      // Four spaces indented text
      var count = 1000;
      while (--count) {
      console.log('Wow %d!', count);
      }

    Returns Offer

  • Add a LicenseUse to the list of uses for the Offer.

    Each use includes a list of usecases explicitly declaring how the data will be used. This differs from bullet, in that uses are stored permanently within LicenseRecords and searchable via TIKI's API.

    Uses may optionally include a list of destinations explicitly declaring where the data may be used/reside. Supports ECMAScript Regex (make sure you escape your tokens!) (e.g. '\\.mytiki\\.com')

    Parameters

    Returns Offer