blueprintDocs service

Allows tracking of documents created via blueprints, so they don't get reverted when Tymly restarts. This service is provided via the tymly plugin and isn't offered by any of the other core plugins.

Boot config

  • This service doesn’t require any configuration to boot.

Service methods/properties

isKnownDocument

During boot-up a blueprint might like to throw some documents into storage (e.g. some relevant roles or similar). A user is free to change the contents of that initial document, and even delete it if it’s not of use. Use isKnownDocument to derive if the document has been previously added by the blueprint - i.e. it shouldn’t be re-introduced.

Parameters

  • domain string For grouping documents that have been created
  • docId string An id for the document that’s being registered (should be unique within its domain)
  • callback Function Called true or false

Examples

blueprintDocs.isKnownDocument(
  'templateRole',
  'fbotTest_fbotTestAdmin',
  function (err, isKnown) {
    // 'isKnown' is boolean and indicates if this document
    // has been previously added at boot-time.
  }
)

Returns undefined

registerDocument

Record that a blueprint has just creating a document in a model.

Parameters

  • domain string For grouping documents that have been created, often relate to a model name
  • docId string An id for the document that’s being registered (should be unique within its domain)
  • callback Function Called with the registered document (e.g. a doc stored via the fbot.blueprintDocs model, pretty useless)

Examples

blueprintDocs.registerDocument(
  'templateRole',
  'fbotTest_fbotTestAdmin',
  function (err, blueprintsDocInfo) {
    // The returned value here is the doc as now stored
    // in the fbot.blueprintDocs model... not that
    // much use, just deal with errors?
  }
)

Returns undefined


Boots before

statebox

Boots after

storage