prismic-javascript
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -13,3 +13,3 @@ { | ||
], | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"devDependencies": { | ||
@@ -21,3 +21,3 @@ "chai": "^4.1.1", | ||
"tslint": "^5.1.0", | ||
"tslint-config-airbnb": "^5.2.1", | ||
"tslint-config-airbnb": "^5.11.1", | ||
"typedoc": "^0.11.1", | ||
@@ -40,3 +40,3 @@ "typescript": "^2.3.2", | ||
"test": "mocha", | ||
"prepublish": "npm run build; npm run docs", | ||
"prepare": "npm run build; npm run docs", | ||
"docs": "typedoc --mode file --out ./docs/ ./src/index.ts", | ||
@@ -43,0 +43,0 @@ "lint": "tslint src/**/*.ts -e src/lru.ts -e src/Cookies.ts" |
@@ -88,50 +88,2 @@ var path = require('path'); | ||
it('should build query', function(done) { | ||
getApi().then(function(api) { | ||
var ref = 'AAAAA'; | ||
var pageSize = 8; | ||
var page = 2; | ||
var lang = 'en-US'; | ||
var after = 'XXXXX'; | ||
var accessToken = 'YYYYY'; | ||
var query = ['at(document.type, "product")']; | ||
var orderings = ['my.product.price']; | ||
var fetchLinks = 'people.name, people.age'; | ||
var fetch = 'product.title, product.desc'; | ||
function wrap(arr) { | ||
return '[' + arr.join(',') + ']'; | ||
} | ||
var url = api | ||
.everything() | ||
.query(query) | ||
.ref(ref) | ||
.pageSize(pageSize) | ||
.lang(lang) | ||
.page(page) | ||
.orderings(orderings) | ||
.fetchLinks(fetchLinks) | ||
.fetch(fetch) | ||
.after(after) | ||
.set('access_token', accessToken) | ||
.url(); | ||
var qs = querystring.parse(url.split('?')[1]); | ||
assert.strictEqual(qs.ref, ref); | ||
assert.equal(qs.pageSize, pageSize); | ||
assert.equal(qs.page, page); | ||
assert.strictEqual(qs.lang, lang); | ||
assert.strictEqual(qs.after, after); | ||
assert.strictEqual(qs['access_token'], accessToken); | ||
assert.strictEqual(qs.q, wrap(query)); | ||
assert.strictEqual(qs.orderings, wrap(orderings)); | ||
assert.strictEqual(qs.fetchLinks, fetchLinks); | ||
assert.strictEqual(qs.fetch, fetch); | ||
done(); | ||
}).catch(done); | ||
}); | ||
it('should retrieve content', function(done) { | ||
@@ -138,0 +90,0 @@ getApi().then(function(api) { |
@@ -76,47 +76,2 @@ var path = require('path'); | ||
it('should build query', function(done) { | ||
var ref = 'AAAAA'; | ||
var pageSize = 8; | ||
var page = 2; | ||
var lang = 'en-US'; | ||
var after = 'XXXXX'; | ||
var accessToken = 'YYYYY'; | ||
var query = ['at(document.type, "product")']; | ||
var orderings = ['my.product.price']; | ||
var fetchLinks = 'people.name, people.age'; | ||
var fetch = 'product.title, product.desc'; | ||
function wrap(arr) { | ||
return '[' + arr.join(',') + ']'; | ||
} | ||
client | ||
.everything() | ||
.query(query) | ||
.ref(ref) | ||
.pageSize(pageSize) | ||
.lang(lang) | ||
.page(page) | ||
.orderings(orderings) | ||
.fetchLinks(fetchLinks) | ||
.fetch(fetch) | ||
.after(after) | ||
.set('access_token', accessToken) | ||
.url().then(function(url) { | ||
var qs = querystring.parse(url.split('?')[1]); | ||
assert.strictEqual(qs.ref, ref); | ||
assert.equal(qs.pageSize, pageSize); | ||
assert.equal(qs.page, page); | ||
assert.strictEqual(qs.lang, lang); | ||
assert.strictEqual(qs.after, after); | ||
assert.strictEqual(qs['access_token'], accessToken); | ||
assert.strictEqual(qs.q, wrap(query)); | ||
assert.strictEqual(qs.orderings, wrap(orderings)); | ||
assert.strictEqual(qs.fetchLinks, fetchLinks); | ||
assert.strictEqual(qs.fetch, fetch); | ||
done(); | ||
}).catch(done); | ||
}); | ||
}); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7
1489594
9052