Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
sosna committed Jun 27, 2019
2 parents 7889038 + a92383a commit 39a927e
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 15 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ npm-debug.log
coverage
.idea
*.swp
package-lock.json
package-lock.json
sdmx-rest4js.code-workspace
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"node": ">=6"
},
"description": "SDMX REST API client for JavaScript",
"version": "2.13.1",
"version": "2.14.0",
"main": "./lib/index.js",
"scripts": {
"prebuild": "rm -rf lib && mkdir lib",
Expand Down Expand Up @@ -57,18 +57,18 @@
"devDependencies": {
"chai": "4.2.0",
"chai-as-promised": "7.1.1",
"codecov": "3.1.0",
"coffee-coverage": "3.0.0",
"codecov": "3.5.0",
"coffee-coverage": "3.0.1",
"coffeeify": "3.0.1",
"coffeelint": "2.1.0",
"coffeescript": "2.1.1",
"commitizen": "3.0.5",
"coffeescript": "2.4.1",
"commitizen": "3.1.1",
"cz-conventional-changelog": "2.1.0",
"husky": "1.2.0",
"husky": "2.4.1",
"istanbul": "0.4.5",
"mocha": "5.2.0",
"nock": "10.0.4",
"semantic-release": "15.12.4"
"nock": "10.0.6",
"semantic-release": "15.13.16"
},
"config": {
"commitizen": {
Expand All @@ -77,7 +77,7 @@
"pre-commit": "npm run test:single && npm run check-coverage && npm run lint"
},
"dependencies": {
"es6-promise": "4.2.5",
"es6-promise": "4.2.8",
"isomorphic-fetch": "2.2.1"
}
}
2 changes: 1 addition & 1 deletion src/index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ guessService = (u) ->
# - *url* - the entry point of the SDMX 2.1 RESTful web service
# - *api* (optional) - the version of the SDMX 2.1 RESTful API supported by
# the service. If not supplied, it will default to the most recent version of
# the SDMX RESTful API (1.1.0 at the moment)
# the SDMX RESTful API
# - *id* (optional) - an identifier for the web service
# - *name* (optional) - a label for the web service
#
Expand Down
6 changes: 6 additions & 0 deletions src/metadata/metadata-format.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,10 @@ formats =
# The SDMX-ML 2.1 Structure format.
SDMX_ML_2_1_STRUCTURE: 'application/vnd.sdmx.structure+xml;version=2.1'

# The SDMX-JSON 1.0.0 Structure format.
SDMX_JSON_1_0_0: 'application/vnd.sdmx.structure+json;version=1.0.0'

# Shortcut for the latest version of SDMX-JSON
SDMX_JSON: 'application/vnd.sdmx.structure+json;version=1.0.0'

exports.MetadataFormat = Object.freeze formats
10 changes: 9 additions & 1 deletion src/utils/api-version.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@ versions =
# operator, etc.
v1_3_0: 'v1.3.0'

# The version of the SDMX RESTFul API released in June 2019. The release is
# a minor one, merely adding a dedicated media type for SDMX-JSON structure
# messages.
v1_4_0: 'v1.4.0'

# A shortcut to the most recent version of the SDMX RESTful API
LATEST: 'v1.3.0'
LATEST: 'v1.4.0'

resourcesV1 = [
'datastructure'
Expand Down Expand Up @@ -76,6 +81,9 @@ resources =
# The set of valid resources for v1.3.0.
v1_3_0: resourcesV3

# The set of valid resources for v1.4.0.
v1_4_0: resourcesV3

# The set of valid resources for the latest API version.
LATEST: resourcesV3

Expand Down
3 changes: 2 additions & 1 deletion test/metadata/metadata-format.test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ describe 'Metadata formats', ->

expectedFormats = [
'application/vnd.sdmx.structure+xml;version=2.1'
'application/vnd.sdmx.structure+json;version=1.0.0'
]

it 'contains all the expected formats and only those', ->
count = 0
for key, value of MetadataFormat
expectedFormats.should.contain value
count++
count.should.equal expectedFormats.length
count.should.equal expectedFormats.length + 1 # Shortcut for latest JSON

it 'is immutable', ->
MetadataFormat.should.be.frozen
8 changes: 6 additions & 2 deletions test/utils/api-version.test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ describe 'API versions', ->
'v1.1.0'
'v1.2.0'
'v1.3.0'
'v1.4.0'
'latest'
]

Expand All @@ -25,8 +26,8 @@ describe 'API versions', ->
it 'is immutable', ->
ApiVersion.should.be.frozen

it 'considers v1.3.0 as the latest version', ->
ApiVersion.LATEST.should.equal 'v1.3.0'
it 'considers v1.4.0 as the latest version', ->
ApiVersion.LATEST.should.equal 'v1.4.0'

describe 'API resources', ->
expectedResourcesV1 = [
Expand Down Expand Up @@ -102,5 +103,8 @@ describe 'API resources', ->
it 'contains all the expected resources for version 1.3.0 and only those', ->
ApiResources.v1_3_0.should.eql expectedResourcesV3

it 'contains all the expected resources for version 1.4.0 and only those', ->
ApiResources.v1_4_0.should.eql expectedResourcesV3

it 'contains all the expected resources for the latest version and only those', ->
ApiResources.LATEST.should.eql expectedResourcesV3

0 comments on commit 39a927e

Please sign in to comment.