ris-bka

0.4.0 • Public • Published

RIS-BKA

Build Status Code Climate Test Coverage Dependency Status devDependency Status

Usage

$ npm install
// In your project import the 'ris-bka' module
var RisBka = require('ris-bka');
// Use this object to execute methods (listed below)

Methods

  • getVersion: RisBka.getVersion(cbOk, [cbFail])
  • searchDocuments: RisBka.searchDocuments(query, cbOk, [cbFail])
  • getDocument: RisBka.getDocument(docId, cbOk, [cbFail])

Callbacks

  • cbOk: function (soapBody, [raw]) { ... } - Executed if all works fine
  • cbFail: function (err, soapBody, [raw]) { ... } - Executed if any error appears

Parameter

  • query:
    • Type: Object
    • More: Look Query-Structure
  • docId:
    • Type: String
    • Example: 'NOR40091435'
  • err:
    • Type: Object
    • Structure: { errorType: 'String', error: { ... } }
  • soapBody:
    • Type: Object
    • More: Look soapBody-Structure
  • raw:
    • Type: Object
    • Structure: { error: { ... }, response: { ... }, body: { ... } }
    • Info: Response parameters from request module

Object-Structure

Query

{
  searchTerms: {}, // SearchExpression
  title: {}, // SearchExpression
  index: {}, // SearchExpression
  section: {
    number: {
      start: 1, // Start-Number (Integer)
      end: 2 // End-Number (Integer)
    },
    character: {
      start: 'a', // Start-Character
      end: 'z' // End-Character
    },
    typ: '' // "Alle", "Artikel", "Paragraph", "Anlage"
  },
  versionDate: '', // Date
  announcementInstitution: '', // PhraseSearchExpression
  announcementInstitutionNumber: '', // PhraseSearchExpression
  includedDate: '', // "Undefined", "EinerWoche", "ZweiWochen", "EinemMonat", "DreiMonaten", "SechsMonaten", "EinemJahr"
  paging: {
    docsPerPage: '', // "Ten", "Twenty", "Fifty", "OneHundred"
    page: 1 // Integer [required]
  },
  sort: {
    direction: '', // "Ascending", "Descending" [required]
    column: '' // "ArtikelParagraphAnlage", "Kurzinformation" [required]
  }
}
SearchExpression

{} represents a search expression

// AND
{
  and: [{}, ...]
}
// OR
{
  or: [{}, ...]
}
// NOT
// NOT IMPLEMENTED YET!!!
//{
//  not: {}
//}
// MASK
{
  mask: 'SearchString' // automatically gets '*' attached -> 'SearchString*'
}
// VALUE
{
  value: 'SearchString'
}
// SHORTCUT
'SearchString' // Same as VALUE

soapBody

getVersion
'OGD_1.3.0'
searchDocuments
{
  paging: {
    page: 'Integer',
    size: 'Integer',
    count: 'Integer'
  },
  results: [
    {
      application: 'String',
      documentNumber: 'String',
      articleParagraphAttachment: 'String',
      shortInformation: 'String',
      documentUrl: 'String'
    },
    { ... }
  ]
}
getDocument
{
  application: 'String',
  documentNumber: 'String',
  shortTitle: 'String',
  announcementInstitution: 'String',
  typ: 'String',
  articleParagraphAttachment: 'String',
  comeIntoForceDate: 'Date',
  exceptIntoForceDate: 'Date',
  abbreviation: 'String',
  signingDate: 'Date',
  indices: ['String', ... ],
  transitionLaw: 'String',
  considerForWholeLaw: 'String',
  consider: 'String',
  change: 'String',
  longTitle: 'String',
  languages: 'String',
  states: 'String',
  noteForWholeLaw: 'String',
  note: 'String',
  keywords: 'String',
  releaseDate: 'Date',
  changeDate: 'Date',
  lawNumber: 'String',
  oldDocumentNumber: 'String',
  documentContent: [
    {
      contentType: 'String',
      name: 'String',
      dataType: 'String',
      risDoc: {
        metaData: { ... },
        userData: { ... },
        layoutData: { ... }
      }
    },
    { ... }
  ]
}

Useful URLs

Dependents (0)

Package Sidebar

Install

npm i ris-bka

Weekly Downloads

5

Version

0.4.0

License

MIT

Last publish

Collaborators

  • ximex