ng2-contentful
Advanced tools
Comparing version 0.0.8 to 0.1.0
@@ -1,5 +0,2 @@ | ||
/** | ||
* | ||
*/ | ||
"use strict"; | ||
//# sourceMappingURL=ng-contentful-types.js.map |
"use strict"; | ||
var Ng2ContentfulConfig = (function () { | ||
function Ng2ContentfulConfig() { | ||
class Ng2ContentfulConfig { | ||
static get isConfigured() { | ||
return this._config !== undefined; | ||
} | ||
Object.defineProperty(Ng2ContentfulConfig, "isConfigured", { | ||
get: function () { | ||
return this._config != null; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Ng2ContentfulConfig, "config", { | ||
get: function () { | ||
return this._config; | ||
}, | ||
set: function (config) { | ||
this._config = config; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
return Ng2ContentfulConfig; | ||
}()); | ||
static get config() { | ||
return this._config; | ||
} | ||
static set config(config) { | ||
this._config = config; | ||
} | ||
} | ||
exports.Ng2ContentfulConfig = Ng2ContentfulConfig; | ||
//# sourceMappingURL=ng2-contentful-config.js.map |
{ | ||
"name": "ng2-contentful", | ||
"version": "0.0.8", | ||
"version": "0.1.0", | ||
"description": "Contentful module for angular2", | ||
@@ -8,8 +8,18 @@ "scripts": {}, | ||
"peerDependencies": { | ||
"angular2": "^2.0.0-beta || 2.0.0" | ||
"@angular/common": "2.0.0", | ||
"@angular/compiler": "2.0.0", | ||
"@angular/core": "2.0.0", | ||
"@angular/forms": "2.0.0", | ||
"@angular/http": "2.0.0", | ||
"@angular/platform-browser": "2.0.0", | ||
"@angular/platform-browser-dynamic": "2.0.0" | ||
}, | ||
"devDependencies": {}, | ||
"dependencies": { | ||
"gitignore-to-glob": "0.2.1", | ||
"tslint-config-valorsoft": "1.1.1" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/dydek/ng2-contentful.git" | ||
"url": "git+https://github.com/valor-software/ng2-contentful.git" | ||
}, | ||
@@ -23,5 +33,5 @@ "keywords": [ | ||
"bugs": { | ||
"url": "https://github.com/dydek/ng2-contentful/issues" | ||
"url": "https://github.com/valor-software/ng2-contentful/issues" | ||
}, | ||
"homepage": "https://github.com/dydek/ng2-contentful#readme" | ||
"homepage": "https://github.com/valor-software/ng2-contentful#readme" | ||
} |
@@ -11,10 +11,10 @@ "use strict"; | ||
}; | ||
var core_1 = require('angular2/core'); | ||
var http_1 = require('angular2/http'); | ||
var ng2_contentful_config_1 = require('../ng2-contentful-config'); | ||
const core_1 = require('@angular/core'); | ||
const http_1 = require('@angular/http'); | ||
const ng2_contentful_config_1 = require('../ng2-contentful-config'); | ||
/** | ||
* | ||
*/ | ||
var ContentfulRequest = (function () { | ||
function ContentfulRequest(_http) { | ||
class ContentfulRequest { | ||
constructor(_http) { | ||
this._http = _http; | ||
@@ -24,10 +24,10 @@ this.queryParams = new http_1.URLSearchParams(); | ||
} | ||
ContentfulRequest.prototype.getContentTypes = function () { | ||
getContentTypes() { | ||
this.requestUrl = '/content_types/'; | ||
return this; | ||
}; | ||
ContentfulRequest.prototype.getContentType = function (contentTypeId) { | ||
this.requestUrl = "/content_types/" + contentTypeId; | ||
} | ||
getContentType(contentTypeId) { | ||
this.requestUrl = `/content_types/${contentTypeId}`; | ||
return this; | ||
}; | ||
} | ||
/** | ||
@@ -37,6 +37,6 @@ * | ||
*/ | ||
ContentfulRequest.prototype.getAssets = function () { | ||
getAssets() { | ||
this.requestUrl = '/assets/'; | ||
return this; | ||
}; | ||
} | ||
/** | ||
@@ -47,6 +47,6 @@ * | ||
*/ | ||
ContentfulRequest.prototype.getAsset = function (assetId) { | ||
this.requestUrl = "/assets/" + assetId; | ||
getAsset(assetId) { | ||
this.requestUrl = `/assets/${assetId}`; | ||
return this; | ||
}; | ||
} | ||
/** | ||
@@ -57,7 +57,7 @@ * Based on | ||
*/ | ||
ContentfulRequest.prototype.getEntriesByType = function (type) { | ||
getEntriesByType(type) { | ||
this.requestUrl = '/entries/'; | ||
this.queryParams.set('content_type', type); | ||
return this; | ||
}; | ||
} | ||
/** | ||
@@ -69,6 +69,6 @@ * Fetch entry by entryID | ||
*/ | ||
ContentfulRequest.prototype.getEntry = function (entryId) { | ||
this.requestUrl = "/entries/" + entryId; | ||
getEntry(entryId) { | ||
this.requestUrl = `/entries/${entryId}`; | ||
return this; | ||
}; | ||
} | ||
/** | ||
@@ -80,3 +80,3 @@ * | ||
*/ | ||
ContentfulRequest.prototype.getEntryBySlug = function (type, slug) { | ||
getEntryBySlug(type, slug) { | ||
this.queryParams.set('content_type', type); | ||
@@ -87,3 +87,3 @@ this.queryParams.set('fields.slug', slug); | ||
return this; | ||
}; | ||
} | ||
/** | ||
@@ -95,10 +95,5 @@ * | ||
*/ | ||
ContentfulRequest.prototype.searchEntries = function (type) { | ||
var searchItems = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
searchItems[_i - 1] = arguments[_i]; | ||
} | ||
searchEntries(type, ...searchItems) { | ||
this.queryParams.set('content_type', type); | ||
for (var _a = 0, searchItems_1 = searchItems; _a < searchItems_1.length; _a++) { | ||
var searchItem = searchItems_1[_a]; | ||
for (let searchItem of searchItems) { | ||
this.queryParams.set(searchItem.param, searchItem.value); | ||
@@ -108,15 +103,15 @@ } | ||
return this; | ||
}; | ||
ContentfulRequest.prototype.include = function (include) { | ||
} | ||
include(include) { | ||
this.queryParams.set('include', include.toString()); | ||
return this; | ||
}; | ||
ContentfulRequest.prototype.limit = function (limit) { | ||
} | ||
limit(limit) { | ||
this.queryParams.set('limit', limit.toString()); | ||
return this; | ||
}; | ||
ContentfulRequest.prototype.order = function (order) { | ||
} | ||
order(order) { | ||
this.queryParams.set('order', order); | ||
return this; | ||
}; | ||
} | ||
/** | ||
@@ -126,6 +121,6 @@ * Call request to the contentful's API | ||
*/ | ||
ContentfulRequest.prototype.commit = function () { | ||
var url = [ | ||
commit() { | ||
let url = [ | ||
'https://', | ||
ContentfulRequest.HOST, | ||
ng2_contentful_config_1.Ng2ContentfulConfig.config.host || ContentfulRequest.HOST, | ||
'/spaces/', | ||
@@ -135,3 +130,3 @@ ng2_contentful_config_1.Ng2ContentfulConfig.config.space, | ||
].join(''); | ||
var options = { | ||
let options = { | ||
headers: new http_1.Headers({ | ||
@@ -142,12 +137,9 @@ 'Content-Type': 'application/vnd.contentful.delivery.v1+json' | ||
}; | ||
return this._http | ||
.get(url, options) | ||
.map(function (response) { return response.json(); }); | ||
}; | ||
ContentfulRequest.HOST = 'cdn.contentful.com'; | ||
return ContentfulRequest; | ||
}()); | ||
return this._http.get(url, options); | ||
} | ||
} | ||
ContentfulRequest.HOST = 'cdn.contentful.com'; | ||
exports.ContentfulRequest = ContentfulRequest; | ||
var ContentfulService = (function () { | ||
function ContentfulService(_http) { | ||
let ContentfulService = class ContentfulService { | ||
constructor(_http) { | ||
this._http = _http; | ||
@@ -158,12 +150,11 @@ } | ||
*/ | ||
ContentfulService.prototype.create = function () { | ||
create() { | ||
return new ContentfulRequest(this._http); | ||
}; | ||
ContentfulService = __decorate([ | ||
core_1.Injectable(), | ||
__metadata('design:paramtypes', [http_1.Http]) | ||
], ContentfulService); | ||
return ContentfulService; | ||
}()); | ||
} | ||
}; | ||
ContentfulService = __decorate([ | ||
core_1.Injectable(), | ||
__metadata('design:paramtypes', [http_1.Http]) | ||
], ContentfulService); | ||
exports.ContentfulService = ContentfulService; | ||
//# sourceMappingURL=contentful.service.js.map |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
9634
9
9
165
2
0
1
+ Addedgitignore-to-glob@0.2.1
+ Added@angular/common@2.0.0(transitive)
+ Added@angular/compiler@2.0.0(transitive)
+ Added@angular/core@2.0.0(transitive)
+ Added@angular/forms@2.0.0(transitive)
+ Added@angular/http@2.0.0(transitive)
+ Added@angular/platform-browser@2.0.0(transitive)
+ Added@angular/platform-browser-dynamic@2.0.0(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedcodelyzer@0.0.25(transitive)
+ Addedcolors@1.4.0(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addeddiff@2.2.3(transitive)
+ Addedfindup-sync@0.3.0(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedgitignore-to-glob@0.2.1(transitive)
+ Addedglob@5.0.157.2.3(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedminimist@0.0.10(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedoptimist@0.6.1(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedrxjs@5.0.0-beta.12(transitive)
+ Addedsprintf-js@1.1.3(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedsymbol-observable@1.2.0(transitive)
+ Addedtslint@3.13.0(transitive)
+ Addedtslint-config-valorsoft@1.1.1(transitive)
+ Addedtypescript@5.7.2(transitive)
+ Addedunderscore.string@3.3.6(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addedwordwrap@0.0.3(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedzone.js@0.6.26(transitive)