Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ng2-contentful

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ng2-contentful - npm Package Compare versions

Comparing version 0.0.8 to 0.1.0

3

ng-contentful-types.js

@@ -1,5 +0,2 @@

/**
*
*/
"use strict";
//# sourceMappingURL=ng-contentful-types.js.map

31

ng2-contentful-config.js
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc