-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
598 additions
and
837 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
# changelog | ||
|
||
## 2.0.0 - Bigger than Love | ||
Refactors all methods to separate modules under journals | ||
Switches form mocha to tap | ||
Implements JavaScript standard codestyle | ||
|
||
## 1.0.0 | ||
Initial release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,5 @@ | ||
'use strict'; | ||
'use strict' | ||
|
||
var postlister = require('./lib/postlister') | ||
; | ||
var journals = require('./lib/journals') | ||
|
||
module.exports.getPostlisteSok = postlister.getPostlisteSok; | ||
|
||
module.exports.getPostlisteArkivdeler = postlister.getPostlisteArkivdeler; | ||
|
||
module.exports.getPostlisteDokumenttyper = postlister.getPostlisteDokumenttyper; | ||
|
||
module.exports.getPostlisteObjekt = postlister.getPostlisteObjekt; | ||
|
||
module.exports.getDokumenter = postlister.getDokumenter; | ||
module.exports.journals = journals |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
'use strict' | ||
|
||
var request = require('request') | ||
var config = require('../../config') | ||
|
||
function getDokumenter (options, callback) { | ||
if (!options) { | ||
return callback(new Error('Missing required input: options object'), null) | ||
} | ||
|
||
if (!options.host) { | ||
return callback(new Error('Missing required input: options.host'), null) | ||
} | ||
|
||
if (!options.journalpostid) { | ||
return callback(new Error('Missing required input: options.journalpostid'), null) | ||
} | ||
|
||
var requestOptions = { | ||
uri: options.host + config.TEMPLATES_ENDPOINT + 'GetDokumenter', | ||
method: 'POST', | ||
json: options | ||
} | ||
|
||
request(requestOptions, function (error, response, body) { | ||
if (error) { | ||
return callback(error, null) | ||
} else { | ||
return callback(null, body.d) | ||
} | ||
}) | ||
} | ||
|
||
module.exports = getDokumenter |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
'use strict' | ||
|
||
var request = require('request') | ||
var config = require('../../config') | ||
|
||
function getPostlisteArkivdeler (options, callback) { | ||
if (!options) { | ||
return callback(new Error('Missing required input: options object'), null) | ||
} | ||
|
||
if (!options.host) { | ||
return callback(new Error('Missing required input: options.host'), null) | ||
} | ||
|
||
if (!options.fraDato) { | ||
return callback(new Error('Missing required input: options.fraDato'), null) | ||
} | ||
|
||
if (!options.tilDato) { | ||
return callback(new Error('Missing required input: options.tilDato'), null) | ||
} | ||
|
||
// Fixes inconsistent original API | ||
options.dato = options.fraDato | ||
|
||
var requestOptions = { | ||
uri: options.host + config.TEMPLATES_ENDPOINT + 'GetPostlisteArkivdeler', | ||
method: 'POST', | ||
json: options | ||
} | ||
|
||
request(requestOptions, function (error, response, body) { | ||
if (error) { | ||
return callback(error, null) | ||
} else { | ||
return callback(null, body.d) | ||
} | ||
}) | ||
} | ||
|
||
module.exports = getPostlisteArkivdeler |
Oops, something went wrong.