potion-client
Advanced tools
Comparing version 1.5.7 to 1.5.8-0
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var core_1 = require("@angular/core"); | ||
var http_1 = require("@angular/http"); | ||
var potion_1 = require("./potion"); | ||
const core_1 = require("@angular/core"); | ||
const http_1 = require("@angular/http"); | ||
const potion_1 = require("./potion"); | ||
/** | ||
@@ -35,8 +35,7 @@ * Provide a way to register Potion resources when the app is bootstrapped. | ||
*/ | ||
var PotionModule = (function () { | ||
function PotionModule(resources, potion) { | ||
class PotionModule { | ||
constructor(resources, potion) { | ||
potion.registerFromProvider(resources || []); | ||
} | ||
return PotionModule; | ||
}()); | ||
} | ||
PotionModule.decorators = [ | ||
@@ -51,7 +50,7 @@ { type: core_1.NgModule, args: [{ | ||
/** @nocollapse */ | ||
PotionModule.ctorParameters = function () { return [ | ||
PotionModule.ctorParameters = () => [ | ||
{ type: Array, decorators: [{ type: core_1.Optional }, { type: core_1.Inject, args: [potion_1.POTION_RESOURCES,] },] }, | ||
{ type: potion_1.Potion, }, | ||
]; }; | ||
]; | ||
exports.PotionModule = PotionModule; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9AYW5ndWxhci9wb3Rpb25fbW9kdWxlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsc0NBQXlEO0FBQ3pELHNDQUF5QztBQUV6QyxtQ0FLa0I7QUFHbEI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7R0E0Qkc7QUFFSDtJQUNDLHNCQUFjLFNBQTRCLEVBQUUsTUFBYztRQUN6RCxNQUFNLENBQUMsb0JBQW9CLENBQUMsU0FBUyxJQUFJLEVBQUUsQ0FBQyxDQUFDO0lBQzlDLENBQUM7SUFjRixtQkFBQztBQUFELENBakJBLEFBaUJDO0FBYk0sdUJBQVUsR0FBMEI7SUFDM0MsRUFBRSxJQUFJ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jb2xsYXBzZSAqL1xuc3RhdGljIGN0b3JQYXJhbWV0ZXJzOiAoKSA9PiAoe3R5cGU6IGFueSwgZGVjb3JhdG9ycz86IERlY29yYXRvckludm9jYXRpb25bXX18bnVsbClbXSA9ICgpID0+IFtcbnt0eXBlOiBBcnJheSwgZGVjb3JhdG9yczogW3sgdHlwZTogT3B0aW9uYWwgfSwgeyB0eXBlOiBJbmplY3QsIGFyZ3M6IFtQT1RJT05fUkVTT1VSQ0VTLCBdIH0sIF19LFxue3R5cGU6IFBvdGlvbiwgfSxcbl07XG59XG5cbmludGVyZmFjZSBEZWNvcmF0b3JJbnZvY2F0aW9uIHtcbiAgdHlwZTogRnVuY3Rpb247XG4gIGFyZ3M/OiBhbnlbXTtcbn1cbiJdfQ== |
"use strict"; | ||
// tslint:disable: max-classes-per-file | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __assign = (this && this.__assign) || Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var core_1 = require("@angular/core"); | ||
var http_1 = require("@angular/http"); | ||
const core_1 = require("@angular/core"); | ||
const http_1 = require("@angular/http"); | ||
require("rxjs/add/operator/map"); | ||
require("rxjs/add/operator/toPromise"); | ||
var core_2 = require("../core"); | ||
var utils_1 = require("../core/utils"); | ||
const core_2 = require("../core"); | ||
const utils_1 = require("../core/utils"); | ||
/** | ||
@@ -44,15 +26,10 @@ * Angular 2 Potion resources interface. | ||
*/ | ||
var PotionQueryEncoder = (function (_super) { | ||
__extends(PotionQueryEncoder, _super); | ||
function PotionQueryEncoder() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
class PotionQueryEncoder extends http_1.QueryEncoder { | ||
encodeKey(key) { | ||
return encodeURIComponent(key); | ||
} | ||
PotionQueryEncoder.prototype.encodeKey = function (key) { | ||
return encodeURIComponent(key); | ||
}; | ||
PotionQueryEncoder.prototype.encodeValue = function (value) { | ||
encodeValue(value) { | ||
return encodeURIComponent(JSON.stringify(value)); | ||
}; | ||
return PotionQueryEncoder; | ||
}(http_1.QueryEncoder)); | ||
} | ||
} | ||
exports.PotionQueryEncoder = PotionQueryEncoder; | ||
@@ -62,19 +39,16 @@ /** | ||
*/ | ||
var Potion = (function (_super) { | ||
__extends(Potion, _super); | ||
function Potion(http, | ||
class Potion extends core_2.PotionBase { | ||
constructor(http, | ||
// TODO: fix when https://github.com/angular/angular/issues/12631 is fixed | ||
config, customHttp) { | ||
var _this = _super.call(this, config || {}) || this; | ||
super(config || {}); | ||
// Use custom Http class if provided, | ||
// fallback to Angular Http otherwise. | ||
_this.http = customHttp || http; | ||
return _this; | ||
this.http = customHttp || http; | ||
} | ||
Potion.prototype.registerFromProvider = function (resources) { | ||
registerFromProvider(resources) { | ||
// Remove any values that contain no resources. | ||
resources = utils_1.merge.apply(void 0, resources.filter(function (item) { return !utils_1.isObjectEmpty(item); })); | ||
resources = utils_1.merge(...resources.filter(item => !utils_1.isObjectEmpty(item))); | ||
if (!utils_1.isObjectEmpty(resources)) { | ||
for (var _i = 0, _a = Object.entries(resources); _i < _a.length; _i++) { | ||
var _b = _a[_i], uri = _b[0], type = _b[1]; | ||
for (const [uri, type] of Object.entries(resources)) { | ||
// NOTE: Skip registration of existing resources. | ||
@@ -84,3 +58,3 @@ if (!this.resources.hasOwnProperty(uri)) { | ||
if (Array.isArray(type)) { | ||
var resource = type[0], config = type[1]; | ||
const [resource, config] = type; | ||
this.register(uri, resource, config); | ||
@@ -94,6 +68,6 @@ } | ||
} | ||
}; | ||
Potion.prototype.request = function (uri, options) { | ||
var _a = __assign({}, options), search = _a.search, data = _a.data, _b = _a.method, method = _b === void 0 ? 'GET' : _b; | ||
var requestOptions = new http_1.RequestOptions({ | ||
} | ||
request(uri, options) { | ||
const { search, data, method = 'GET' } = Object.assign({}, options); | ||
let requestOptions = new http_1.RequestOptions({ | ||
method: method, | ||
@@ -104,3 +78,3 @@ url: uri | ||
if (data) { | ||
var headers = new http_1.Headers(); | ||
const headers = new http_1.Headers(); | ||
// Potion also expects all requests to have content type set to 'application/json'. | ||
@@ -110,3 +84,3 @@ headers.set('Content-Type', 'application/json; charset=utf-8'); | ||
body: JSON.stringify(data), | ||
headers: headers | ||
headers | ||
}); | ||
@@ -116,5 +90,4 @@ } | ||
if (search) { | ||
var params = new http_1.URLSearchParams('', new PotionQueryEncoder()); | ||
for (var _i = 0, _c = Object.entries(search); _i < _c.length; _i++) { | ||
var _d = _c[_i], key = _d[0], value = _d[1]; | ||
const params = new http_1.URLSearchParams('', new PotionQueryEncoder()); | ||
for (const [key, value] of Object.entries(search)) { | ||
// We need to `encodeURIComponent()` when we have complex search queries. | ||
@@ -130,5 +103,5 @@ // E.g. `search: {where: {foo: 1, bar: 2}}`, when URLSearchParams will be sent with the request, | ||
return this.http.request(uri, requestOptions) | ||
.map(function (response) { | ||
var headers = {}; | ||
var data; | ||
.map((response) => { | ||
let headers = {}; | ||
let data; | ||
// If `response` is a Response object, | ||
@@ -139,4 +112,3 @@ // we might also have a Headers instance which we need to convert into an object. | ||
if (response.headers instanceof http_1.Headers) { | ||
for (var _i = 0, _a = response.headers.keys(); _i < _a.length; _i++) { | ||
var key = _a[_i]; | ||
for (const key of response.headers.keys()) { | ||
// Angular 2 does not yet lowercase headers. | ||
@@ -160,10 +132,9 @@ // Make sure we get the first string value of the header instead of the array of values. | ||
return { | ||
headers: headers, | ||
data: data | ||
headers, | ||
data | ||
}; | ||
}) | ||
.toPromise(); | ||
}; | ||
return Potion; | ||
}(core_2.PotionBase)); | ||
} | ||
} | ||
Potion.decorators = [ | ||
@@ -173,7 +144,7 @@ { type: core_1.Injectable }, | ||
/** @nocollapse */ | ||
Potion.ctorParameters = function () { return [ | ||
Potion.ctorParameters = () => [ | ||
{ type: http_1.Http, }, | ||
{ type: undefined, decorators: [{ type: core_1.Optional }, { type: core_1.Inject, args: [exports.POTION_CONFIG,] },] }, | ||
{ type: undefined, decorators: [{ type: core_1.Optional }, { type: core_1.Inject, args: [exports.POTION_HTTP,] },] }, | ||
]; }; | ||
]; | ||
exports.Potion = Potion; | ||
@@ -196,2 +167,2 @@ function POTION_PROVIDER_FACTORY(parentFactory, http, config, customHttp) { | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9AYW5ndWxhci9wb3Rpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLHVDQUFDOzs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUVELHNDQU91QjtBQUN2QixzQ0FTdUI7QUFHdkIsaUNBQStCO0FBQy9CLHVDQUFxQztBQUVyQyxnQ0FNaUI7QUFFakIsdUNBQW1EO0FBR25EOztHQUVHO0FBQ1UsUUFBQSxnQkFBQSxHQUFtQixJQUFJLHFCQUFBLENBQStCLGtCQUFFLENBQWtCLENBQUM7QUFNeEY7O0dBRUc7QUFDVSxRQUFBLGFBQUEsR0FBZ0IsSUFBSSxxQkFBQSxDQUE0QixlQUFFLENBQWUsQ0FBQztBQUkvRTs7O0dBR0c7QUFDVSxRQUFBLFdBQUEsR0FBYyxJQUFJLHFCQUFBLENBQTBCLGFBQUUsQ0FBYSxDQUFDO0FBTXpFOztHQUVHO0FBQ0g7SUFBd0Msc0NBQVk7SUFBcEQ7O0lBVUEsQ0FBQztJQVRBLHNDQUFTLEdBQVQsVUFBVSxHQUFXO1FBQ3B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udEZhY3RvcnkgfHwgbmV3IFBvdGlvbihodHRwLCBjb25maWcsIGN1c3RvbUh0dHApO1xufVxuXG5leHBvcnQgY29uc3QgUE9USU9OX1BST1ZJREVSOiBQcm92aWRlciA9IHtcblx0Ly8gSWYgdGhlcmUgaXMgYWxyZWFkeSBhIFBvdGlvbiBhdmFpbGFibGUsIHVzZSB0aGF0LlxuXHQvLyBPdGhlcndpc2UsIHByb3ZpZGUgYSBuZXcgb25lLlxuXHRwcm92aWRlOiBQb3Rpb24sXG5cdHVzZUZhY3Rvcnk6IFBPVElPTl9QUk9WSURFUl9GQUNUT1JZLFxuXHRkZXBzOiBbXG5cdFx0W25ldyBPcHRpb25hbCgpLCBuZXcgU2tpcFNlbGYoKSwgUG90aW9uXSxcblx0XHRIdHRwLFxuXHRcdFtuZXcgT3B0aW9uYWwoKSwgbmV3IEluamVjdChQT1RJT05fQ09ORklHKV0sXG5cdFx0W25ldyBPcHRpb25hbCgpLCBuZXcgSW5qZWN0KFBPVElPTl9IVFRQKV1cblx0XVxufTtcblxuaW50ZXJmYWNlIERlY29yYXRvckludm9jYXRpb24ge1xuICB0eXBlOiBGdW5jdGlvbjtcbiAgYXJncz86IGFueVtdO1xufVxuIl19 |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var core_1 = require("@angular/core"); | ||
var http_1 = require("@angular/http"); | ||
var testing_1 = require("@angular/http/testing"); | ||
var potion_module_1 = require("../potion_module"); | ||
var potion_1 = require("../potion"); | ||
const core_1 = require("@angular/core"); | ||
const http_1 = require("@angular/http"); | ||
const testing_1 = require("@angular/http/testing"); | ||
const potion_module_1 = require("../potion_module"); | ||
const potion_1 = require("../potion"); | ||
function provideHttpFactory(connectionBackend, defaultOptions) { | ||
@@ -15,7 +15,4 @@ return new http_1.Http(connectionBackend, defaultOptions); | ||
*/ | ||
var PotionTestingModule = (function () { | ||
function PotionTestingModule() { | ||
} | ||
return PotionTestingModule; | ||
}()); | ||
class PotionTestingModule { | ||
} | ||
PotionTestingModule.decorators = [ | ||
@@ -42,4 +39,4 @@ { type: core_1.NgModule, args: [{ | ||
/** @nocollapse */ | ||
PotionTestingModule.ctorParameters = function () { return []; }; | ||
PotionTestingModule.ctorParameters = () => []; | ||
exports.PotionTestingModule = PotionTestingModule; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9AYW5ndWxhci90ZXN0aW5nL3BvdGlvbl90ZXN0aW5nX21vZHVsZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLHNDQUF1QztBQUN2QyxzQ0FLdUI7QUFDdkIsaURBQWtEO0FBRWxELGtEQUE4QztBQUM5QyxvQ0FBMEM7QUFHMUMsNEJBQW1DLGlCQUFtQixFQUFtQixjQUFnQjtJQUN4RixNQUFNLENBQUMsSUFBSSxXQUFBLENBQUssaUJBQUMsRUFBa0IsY0FBQSxDQUFlLENBQUM7QUFDcEQsQ0FBQztBQUZELGdEQUVDO0FBR0Q7O0dBRUc7QUFFSDtJQUFBO0lBeUJBLENBQUM7SUFBRCwwQkFBQztBQUFELENBekJBLEFBeUJDO0FBdkJNLDhCQUFVLEdBQTBCO0lBQzNDLEVBQUUsSUFBSSxFQUFFLGVBQVEsRUFBRSxJQUFJLEVBQUUsQ0FBQztnQkFDeEIsT0FBTyxFQUFFLENBQUMsaUJBQVUsQ0FBQztnQkFDckIsT0FBTyxFQUFFLENBQUMsNEJBQVksQ0FBQztnQkFDdkIsU0FBUyxFQUFFO29CQUNWLHdCQUFlO29CQUNmLGlCQUFpQjtvQkFDakI7d0JBQ0MsT0FBTyxFQUFFLFdBQUk7d0JBQ2IsVUFBVSxFQUFFLGtCQUFrQjt3QkFDOUIsSUFBSSxFQUFFOzRCQUNMLHFCQUFXOzRCQUNYLHlCQUFrQjt5QkFDbEI7cUJBQ0Q7b0JBQ0QseUJBQWtCO29CQUNsQixxQkFBVztpQkFDWDthQUNELEV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cnM/OiBEZWNvcmF0b3JJbnZvY2F0aW9uW119fG51bGwpW10gPSAoKSA9PiBbXG5dO1xufVxuXG5pbnRlcmZhY2UgRGVjb3JhdG9ySW52b2NhdGlvbiB7XG4gIHR5cGU6IEZ1bmN0aW9uO1xuICBhcmdzPzogYW55W107XG59XG4iXX0= |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __assign = (this && this.__assign) || Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// tslint:disable: max-classes-per-file | ||
var angular = require("angular"); | ||
var core_1 = require("./core"); | ||
var metadata_1 = require("./core/metadata"); | ||
const angular = require("angular"); | ||
const core_1 = require("./core"); | ||
const metadata_1 = require("./core/metadata"); | ||
var core_2 = require("./core"); | ||
@@ -29,9 +11,9 @@ exports.Item = core_2.Item; | ||
exports.readonly = core_2.readonly; | ||
var potion = angular.module('potion', []) | ||
const potion = angular.module('potion', []) | ||
.provider('potion', potionProvider); | ||
exports.potion = potion; | ||
function potionProvider() { | ||
var options = {}; | ||
const options = {}; | ||
// tslint:disable-next-line: no-invalid-this | ||
this.config = function (config) { | ||
this.config = (config) => { | ||
if (config) { | ||
@@ -45,16 +27,11 @@ return Object.assign(options, config); | ||
// tslint:disable-next-line: no-invalid-this | ||
this.$get = ['$cacheFactory', '$q', '$http', function ($cacheFactory, $q, $http) { | ||
var cache = $cacheFactory.get('potion') || $cacheFactory('potion'); | ||
var Potion = (function (_super) { | ||
__extends(Potion, _super); | ||
function Potion() { | ||
return _super !== null && _super.apply(this, arguments) || this; | ||
} | ||
this.$get = ['$cacheFactory', '$q', '$http', ($cacheFactory, $q, $http) => { | ||
const cache = $cacheFactory.get('potion') || $cacheFactory('potion'); | ||
class Potion extends core_1.PotionBase { | ||
// tslint:disable-next-line: prefer-function-over-method | ||
Potion.prototype.request = function (url, options) { | ||
var _a = __assign({}, options), _b = _a.method, method = _b === void 0 ? 'GET' : _b, search = _a.search, data = _a.data, _c = _a.cache, cache = _c === void 0 ? true : _c; | ||
return $http({ url: url, method: method, data: data, cache: cache, params: search }) | ||
.then(function (_a) { | ||
var headers = _a.headers, data = _a.data; | ||
var response = { data: data }; | ||
request(url, options) { | ||
const { method = 'GET', search, data, cache = true } = Object.assign({}, options); | ||
return $http({ url, method, data, cache, params: search }) | ||
.then(({ headers, data }) => { | ||
const response = { data }; | ||
if (headers) { | ||
@@ -65,23 +42,19 @@ response.headers = headers(); | ||
}); | ||
}; | ||
return Potion; | ||
}(core_1.PotionBase)); | ||
var AngularJsCache = (function () { | ||
function AngularJsCache() { | ||
} | ||
AngularJsCache.prototype.has = function (key) { | ||
} | ||
class AngularJsCache { | ||
has(key) { | ||
return cache.get(key) !== undefined; | ||
}; | ||
AngularJsCache.prototype.get = function (key) { | ||
} | ||
get(key) { | ||
return cache.get(key); | ||
}; | ||
AngularJsCache.prototype.put = function (key, item) { | ||
} | ||
put(key, item) { | ||
cache.put(key, item); | ||
return cache.get(key); | ||
}; | ||
AngularJsCache.prototype.remove = function (key) { | ||
} | ||
remove(key) { | ||
cache.remove(key); | ||
}; | ||
return AngularJsCache; | ||
}()); | ||
} | ||
} | ||
// Make sure Potion uses $q as the Promise implementation. | ||
@@ -92,3 +65,3 @@ // NOTE: This is necessary due to the nature of AngularJS change detection system. | ||
/* tslint:disable: align */ | ||
return new Potion(__assign({ cache: new AngularJsCache() }, options)); | ||
return new Potion(Object.assign({ cache: new AngularJsCache() }, options)); | ||
}]; | ||
@@ -98,2 +71,2 @@ // tslint:disable-next-line: no-invalid-this | ||
} | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9hbmd1bGFyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQUEsdUNBQXVDO0FBQ3ZDLGlDQUFtQztBQUNuQywrQkFLZ0I7QUFDaEIsNENBQWlEO0FBS2pELCtCQUE2QztBQUFyQyxzQkFBQSxJQUFJLENBQUE7QUFBRSx1QkFBQSxLQUFLLENBQUE7QUFBRSwwQkFBQSxRQUFRLENBQUE7QUFHN0IsSUFBTSxNQUFNLEdBQUcsT0FBTyxDQUFDLE1BQU0sQ0FBQyxRQUFRLEVBQUUsRUFBRSxDQUFDO0tBQ3pDLFFBQVEsQ0FBQyxRQUFRLEVBQUUsY0FBYyxDQUFDLENBQUM7QUFvRTdCLHdCQUFNO0FBakVkO0lBQ0MsSUFBTSxPQUFPLEdBQUcsRUFBRSxDQUFDO0lBRW5CLDRDQUE0QztJQUM1QyxJQUFJLENBQUMsTUFBTSxHQUFHLFVBQUMsTUFBcUI7UUFDbkMsRUFBRSxDQUFDLENBQUMsTUFBTSxDQUFDLENBQUMsQ0FBQztZQUNaLE1BQU0sQ0FBQyxNQUFNLENBQUMsTUFBTSxDQUFDLE9BQU8sRUFBRSxNQUFNLENBQUMsQ0FBQztRQUN2QyxDQUFDO1FBQUMsSUFBSSxDQUFDLENBQUM7WUFDUCxNQUFNLENBQUMsT0FBTyxDQUFDO1FBQ2hCLENBQUM7SUFDRixDQUFDLENBQUM7SUFFRiw0Q0FBNEM7SUFDNUMsSUFBSSxDQUFDLElBQUksR0FBRyxDQUFDLGVBQWUsRUFBRSxJQUFJLEVBQUUsT0FBTyxFQUFFLFVBQUMsYUFBMkMsRUFBRSxFQUFx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ZXksIGl0ZW0pO1xuXHRcdFx0XHRyZXR1cm4gY2FjaGUuZ2V0PFByb21pc2U8VD4+KGtleSk7XG5cdFx0XHR9XG5cblx0XHRcdHJlbW92ZShrZXk6IHN0cmluZyk6IHZvaWQge1xuXHRcdFx0XHRjYWNoZS5yZW1vdmUoa2V5KTtcblx0XHRcdH1cblx0XHR9XG5cblx0XHQvLyBNYWtlIHN1cmUgUG90aW9uIHVzZXMgJHEgYXMgdGhlIFByb21pc2UgaW1wbGVtZW50YXRpb24uXG5cdFx0Ly8gTk9URTogVGhpcyBpcyBuZWNlc3NhcnkgZHVlIHRvIHRoZSBuYXR1cmUgb2YgQW5ndWxhckpTIGNoYW5nZSBkZXRlY3Rpb24gc3lzdGVtLlxuXHRcdHNldFBvdGlvblByb21pc2UoUG90aW9uLCAkcSk7XG5cblx0XHQvLyBVc2UgdGhlICRjYWNoZUZhY3RvcnkgYW5kIGFsbG93IHVzZXIgdG8gb3ZlcnJpZGUgY2FjaGUuXG5cdFx0LyogdHNsaW50OmRpc2FibGU6IGFsaWduICovXG5cdFx0cmV0dXJuIG5ldyBQb3Rpb24oe1xuXHRcdFx0Y2FjaGU6IG5ldyBBbmd1bGFySnNDYWNoZSgpLFxuXHRcdFx0Li4ub3B0aW9uc1xuXHRcdH0pO1xuXHR9XTtcblxuXHQvLyB0c2xpbnQ6ZGlzYWJsZS1uZXh0LWxpbmU6IG5vLWludmFsaWQtdGhpc1xuXHRyZXR1cm4gdGhpcztcbn1cblxuXG5leHBvcnQge3BvdGlvbn07XG4iXX0= |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var metadata_1 = require("./metadata"); | ||
const metadata_1 = require("./metadata"); | ||
/** | ||
@@ -29,3 +29,3 @@ * Base resource class for API resources. | ||
*/ | ||
var Item = (function () { | ||
class Item { | ||
/** | ||
@@ -35,4 +35,3 @@ * Create an instance of the class that extended the Item. | ||
*/ | ||
function Item(properties) { | ||
if (properties === void 0) { properties = {}; } | ||
constructor(properties = {}) { | ||
this.$id = null; | ||
@@ -46,10 +45,9 @@ Object.assign(this, properties); | ||
*/ | ||
Item.fetch = function (id, _a) { | ||
var _b = (_a === void 0 ? {} : _a).cache, cache = _b === void 0 ? true : _b; | ||
var uri = metadata_1.potionURI(this); | ||
return metadata_1.potionInstance(this).fetch(uri + "/" + id, { | ||
static fetch(id, { cache = true } = {}) { | ||
const uri = metadata_1.potionURI(this); | ||
return metadata_1.potionInstance(this).fetch(`${uri}/${id}`, { | ||
method: 'GET', | ||
cache: cache | ||
cache | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -62,16 +60,15 @@ * Query resources. | ||
*/ | ||
Item.query = function (queryOptions, _a) { | ||
var _b = _a === void 0 ? {} : _a, _c = _b.paginate, paginate = _c === void 0 ? false : _c, _d = _b.cache, cache = _d === void 0 ? true : _d; | ||
var uri = metadata_1.potionURI(this); | ||
static query(queryOptions, { paginate = false, cache = true } = {}) { | ||
const uri = metadata_1.potionURI(this); | ||
return metadata_1.potionInstance(this).fetch(uri, { | ||
method: 'GET', | ||
search: queryOptions, | ||
paginate: paginate, | ||
cache: cache | ||
paginate, | ||
cache | ||
}); | ||
}; | ||
} | ||
/** | ||
* Get the first item. | ||
*/ | ||
Item.first = function (queryOptions) { | ||
static first(queryOptions) { | ||
return this.query(queryOptions) | ||
@@ -82,17 +79,9 @@ .then(first); | ||
} | ||
}; | ||
Object.defineProperty(Item.prototype, "uri", { | ||
get: function () { | ||
return this.$uri; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Item.prototype, "id", { | ||
get: function () { | ||
return this.$id; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
} | ||
get uri() { | ||
return this.$uri; | ||
} | ||
get id() { | ||
return this.$id; | ||
} | ||
/** | ||
@@ -102,3 +91,3 @@ * Compare current resource with another object. | ||
*/ | ||
Item.prototype.equals = function (resource) { | ||
equals(resource) { | ||
if (resource instanceof Item) { | ||
@@ -108,24 +97,23 @@ return this.id === resource.id && this.constructor.name === resource.constructor.name; | ||
return false; | ||
}; | ||
} | ||
/** | ||
* Get the JSON repr. of this item. | ||
*/ | ||
Item.prototype.toJSON = function () { | ||
var _this = this; | ||
var properties = {}; | ||
toJSON() { | ||
const properties = {}; | ||
Object.keys(this) | ||
.filter(function (key) { return !key.startsWith('$') && !metadata_1.isReadonly(_this.constructor, key); }) | ||
.forEach(function (key) { | ||
properties[key] = _this[key]; | ||
.filter(key => !key.startsWith('$') && !metadata_1.isReadonly(this.constructor, key)) | ||
.forEach((key) => { | ||
properties[key] = this[key]; | ||
}); | ||
return properties; | ||
}; | ||
} | ||
/** | ||
* Save the current item. | ||
*/ | ||
Item.prototype.save = function () { | ||
save() { | ||
if (this.uri || this.id) { | ||
return this.update(this.toJSON()); | ||
} | ||
var ctor = this.constructor; | ||
const ctor = this.constructor; | ||
return metadata_1.potionInstance(ctor) | ||
@@ -137,3 +125,3 @@ .fetch(metadata_1.potionURI(ctor), { | ||
}); | ||
}; | ||
} | ||
/** | ||
@@ -143,4 +131,3 @@ * Update the resource. | ||
*/ | ||
Item.prototype.update = function (data) { | ||
if (data === void 0) { data = {}; } | ||
update(data = {}) { | ||
return metadata_1.potionInstance(this.constructor) | ||
@@ -150,12 +137,12 @@ .fetch(this.uri, { | ||
method: 'PATCH', | ||
data: data | ||
data | ||
}); | ||
}; | ||
} | ||
/** | ||
* Destroy the current item. | ||
*/ | ||
Item.prototype.destroy = function () { | ||
var uri = this.uri; | ||
var potion = metadata_1.potionInstance(this.constructor); | ||
var cache = potion.cache; | ||
destroy() { | ||
const { uri } = this; | ||
const potion = metadata_1.potionInstance(this.constructor); | ||
const cache = potion.cache; | ||
return potion.fetch(uri, { method: 'DELETE' }) | ||
@@ -169,6 +156,5 @@ .then(clearCache); | ||
} | ||
}; | ||
return Item; | ||
}()); | ||
} | ||
} | ||
exports.Item = Item; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2V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B1cGRhdGUuXG5cdCAqL1xuXHR1cGRhdGUoZGF0YTogYW55ID0ge30pOiBQcm9taXNlPHRoaXM+IHtcblx0XHRyZXR1cm4gcG90aW9uSW5zdGFuY2UodGhpcy5jb25zdHJ1Y3RvciBhcyB0eXBlb2YgSXRlbSlcblx0XHRcdC5mZXRjaCh0aGlzLnVyaSwge1xuXHRcdFx0Y2FjaGU6IHRydWUsXG5cdFx0XHRtZXRob2Q6ICdQQVRDSCcsXG5cdFx0XHRkYXRhXG5cdFx0fSk7XG5cdH1cblxuXHQvKipcblx0ICogRGVzdHJveSB0aGUgY3VycmVudCBpdGVtLlxuXHQgKi9cblx0ZGVzdHJveSgpOiBQcm9taXNlPHZvaWQ+IHtcblx0XHRjb25zdCB7dXJpfSA9IHRoaXM7XG5cdFx0Y29uc3QgcG90aW9uID0gcG90aW9uSW5zdGFuY2UodGhpcy5jb25zdHJ1Y3RvciBhcyB0eXBlb2YgSXRlbSk7XG5cdFx0Y29uc3QgY2FjaGUgPSBwb3Rpb24uY2FjaGU7XG5cdFx0cmV0dXJuIHBvdGlvbi5mZXRjaCh1cmksIHttZXRob2Q6ICdERUxFVEUnfSlcblx0XHRcdC50aGVuKGNsZWFyQ2FjaGUpO1xuXHRcdGZ1bmN0aW9uIGNsZWFyQ2FjaGUoKTogdm9pZCB7XG5cdFx0XHQvLyBDbGVhciB0aGUgaXRlbSBmcm9tIGNhY2hlIGlmIGV4aXN0c1xuXHRcdFx0aWYgKGNhY2hlLmdldCh1cmkpKSB7XG5cdFx0XHRcdGNhY2hlLnJlbW92ZSh1cmkpO1xuXHRcdFx0fVxuXHRcdH1cblx0fVxufVxuIl19 |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var utils_1 = require("./utils"); | ||
var Reflect = window.Reflect; // tslint:disable-line:variable-name | ||
const utils_1 = require("./utils"); | ||
const Reflect = window.Reflect; // tslint:disable-line:variable-name | ||
// Make sure Reflect API is available, | ||
@@ -14,3 +14,3 @@ // otherwise throw an error. | ||
})(); | ||
var POTION_METADATA_KEY = Symbol('potion'); | ||
const POTION_METADATA_KEY = Symbol('potion'); | ||
function potionInstance(ctor) { | ||
@@ -24,3 +24,3 @@ return Reflect.getOwnMetadata(POTION_METADATA_KEY, ctor); | ||
exports.decorateCtorWithPotionInstance = decorateCtorWithPotionInstance; | ||
var POTION_URI_METADATA_KEY = Symbol('potion:uri'); | ||
const POTION_URI_METADATA_KEY = Symbol('potion:uri'); | ||
function potionURI(ctor) { | ||
@@ -43,3 +43,3 @@ return Reflect.getOwnMetadata(POTION_URI_METADATA_KEY, ctor); | ||
*/ | ||
var POTION_PROMISE_METADATA_KEY = Symbol('potion:promise'); | ||
const POTION_PROMISE_METADATA_KEY = Symbol('potion:promise'); | ||
function potionPromise(potion) { | ||
@@ -53,5 +53,5 @@ return Reflect.getOwnMetadata(POTION_PROMISE_METADATA_KEY, potion.constructor) || Promise; | ||
exports.setPotionPromise = setPotionPromise; | ||
var READONLY_METADATA_KEY = Symbol('potion:readonly'); | ||
const READONLY_METADATA_KEY = Symbol('potion:readonly'); | ||
function isReadonly(ctor, key) { | ||
var metadata = Reflect.getOwnMetadata(READONLY_METADATA_KEY, ctor); | ||
const metadata = Reflect.getOwnMetadata(READONLY_METADATA_KEY, ctor); | ||
return metadata && metadata[key]; | ||
@@ -70,3 +70,3 @@ } | ||
function readonly(target, property) { | ||
var constructor = utils_1.isFunction(target) | ||
const constructor = utils_1.isFunction(target) | ||
? target | ||
@@ -80,8 +80,7 @@ : utils_1.isFunction(target.constructor) | ||
} | ||
Reflect.defineMetadata(READONLY_METADATA_KEY, Object.assign(Reflect.getOwnMetadata(READONLY_METADATA_KEY, constructor) || {}, (_a = {}, | ||
_a[property] = true, | ||
_a)), constructor); | ||
var _a; | ||
Reflect.defineMetadata(READONLY_METADATA_KEY, Object.assign(Reflect.getOwnMetadata(READONLY_METADATA_KEY, constructor) || {}, { | ||
[property]: true | ||
}), constructor); | ||
} | ||
exports.readonly = readonly; | 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VZLFxuXHRcdE9iamVjdC5hc3NpZ24oXG5cdFx0XHRSZWZsZWN0LmdldE93bk1ldGFkYXRhKFJFQURPTkxZX01FVEFEQVRBX0tFWSwgY29uc3RydWN0b3IpIHx8IHt9LFxuXHRcdFx0e1xuXHRcdFx0XHRbcHJvcGVydHldOiB0cnVlXG5cdFx0XHR9XG5cdFx0KSxcblx0XHRjb25zdHJ1Y3RvclxuXHQpO1xufVxuIl19 |
@@ -16,5 +16,11 @@ import { FetchOptions, PotionBase } from './potion'; | ||
*/ | ||
export declare class Pagination<T extends Item> extends Array<T> { | ||
export declare class Pagination<T extends Item> implements Iterable<T> { | ||
private items; | ||
private options; | ||
static readonly [Symbol.species]: typeof Pagination; | ||
page: number; | ||
readonly perPage: number; | ||
readonly pages: number; | ||
readonly total: number; | ||
readonly length: number; | ||
private potion; | ||
@@ -29,13 +35,7 @@ private uri; | ||
}, items: T[], count: string, options: FetchOptions); | ||
page: number; | ||
readonly perPage: number; | ||
readonly pages: number; | ||
readonly total: number; | ||
[Symbol.iterator](): IterableIterator<T>; | ||
toArray(): T[]; | ||
at(index: number): T; | ||
changePageTo(page: number): Promise<T | T[] | Pagination<T> | any>; | ||
update(items: T[], count: number): this; | ||
/** | ||
* This will be removed as this class is iterable. | ||
* @deprecated | ||
*/ | ||
toArray(): T[]; | ||
} |
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __assign = (this && this.__assign) || Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -34,89 +16,61 @@ /** | ||
*/ | ||
var Pagination = (function (_super) { | ||
__extends(Pagination, _super); | ||
function Pagination(_a, items, count, options) { | ||
var potion = _a.potion, uri = _a.uri; | ||
var _this = _super.apply(this, items) || this; | ||
_this.options = options; | ||
// Set the prototype explicitly. | ||
// NOTE: This is necessary and recommended: https://github.com/Microsoft/TypeScript/wiki/FAQ#why-doesnt-extending-built-ins-like-error-array-and-map-work. | ||
// Docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/setPrototypeOf | ||
Object.setPrototypeOf(_this, Pagination.prototype); | ||
_this.potion = potion; | ||
_this.uri = uri; | ||
class Pagination { | ||
constructor({ potion, uri }, items, count, options) { | ||
this.items = items; | ||
this.options = options; | ||
this.potion = potion; | ||
this.uri = uri; | ||
// tslint:disable-next-line: no-magic-numbers | ||
var _b = __assign({}, _this.options.search), _c = _b.page, page = _c === void 0 ? 1 : _c, _d = _b.perPage, perPage = _d === void 0 ? 25 : _d; | ||
_this.$page = page; | ||
_this.$perPage = perPage; | ||
_this.$total = parseInt(count, 10); | ||
return _this; | ||
const { page = 1, perPage = 25 } = Object.assign({}, this.options.search); | ||
this.$page = page; | ||
this.$perPage = perPage; | ||
this.$total = parseInt(count, 10); | ||
} | ||
Object.defineProperty(Pagination, Symbol.species, { | ||
get: function () { | ||
return Pagination; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Pagination.prototype, "page", { | ||
get: function () { | ||
return this.$page; | ||
}, | ||
// Setting the page will trigger a new query and update the items. | ||
set: function (page) { | ||
this.changePageTo(page); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Pagination.prototype, "perPage", { | ||
get: function () { | ||
return this.$perPage; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Pagination.prototype, "pages", { | ||
get: function () { | ||
return Math.ceil(this.$total / this.$perPage); | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(Pagination.prototype, "total", { | ||
get: function () { | ||
return this.$total; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Pagination.prototype.changePageTo = function (page) { | ||
var pagination = this.options.pagination; | ||
static get [Symbol.species]() { | ||
return Pagination; | ||
} | ||
get page() { | ||
return this.$page; | ||
} | ||
// Setting the page will trigger a new query and update the items. | ||
set page(page) { | ||
this.changePageTo(page); | ||
} | ||
get perPage() { | ||
return this.$perPage; | ||
} | ||
get pages() { | ||
return Math.ceil(this.$total / this.$perPage); | ||
} | ||
get total() { | ||
return this.$total; | ||
} | ||
get length() { | ||
return this.items.length; | ||
} | ||
// https://basarat.gitbooks.io/typescript/docs/iterators.html | ||
[Symbol.iterator]() { | ||
return this.items.values(); | ||
} | ||
toArray() { | ||
return this.items.slice(0); | ||
} | ||
at(index) { | ||
return this.items[index]; | ||
} | ||
changePageTo(page) { | ||
const { pagination } = this.options; | ||
this.options.search.page = page; | ||
this.$page = page; | ||
return this.potion.fetch(this.uri, this.options, { | ||
pagination: pagination | ||
pagination | ||
}); | ||
}; | ||
Pagination.prototype.update = function (items, count) { | ||
// NOTE: Using `.splice()` would create a new instance of this, | ||
// thus we iterate and replace at index instead. | ||
for (var _i = 0, _a = Array.from(items.entries()); _i < _a.length; _i++) { | ||
var _b = _a[_i], index = _b[0], item = _b[1]; | ||
this[index] = item; | ||
} | ||
} | ||
update(items, count) { | ||
this.items.splice(0, this.items.length, ...items); | ||
this.$total = count; | ||
return this; | ||
}; | ||
/** | ||
* This will be removed as this class is iterable. | ||
* @deprecated | ||
*/ | ||
// TODO: Remove this | ||
Pagination.prototype.toArray = function () { | ||
return this; | ||
}; | ||
return Pagination; | ||
}(Array)); | ||
} | ||
} | ||
exports.Pagination = Pagination; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJz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@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"Pagination":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"Array"},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Expression form not supported","line":29,"character":28},{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":29,"character":70,"context":{"typeName":"T"}}]},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"./potion","name":"FetchOptions"}]}],"changePageTo":[{"__symbolic":"method"}],"update":[{"__symbolic":"method"}],"toArray":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"Pagination":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"Array"},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Expression form not supported","line":29,"character":28},{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":29,"character":70,"context":{"typeName":"T"}}]},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"./potion","name":"FetchOptions"}]}],"changePageTo":[{"__symbolic":"method"}],"update":[{"__symbolic":"method"}],"toArray":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":3,"metadata":{"Pagination":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Expression form not supported","line":53,"character":28},{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":53,"character":78,"context":{"typeName":"T"}}]},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"./potion","name":"FetchOptions"}]}],"toArray":[{"__symbolic":"method"}],"at":[{"__symbolic":"method"}],"changePageTo":[{"__symbolic":"method"}],"update":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"Pagination":{"__symbolic":"class","arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Expression form not supported","line":53,"character":28},{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":53,"character":78,"context":{"typeName":"T"}}]},{"__symbolic":"reference","name":"string"},{"__symbolic":"reference","module":"./potion","name":"FetchOptions"}]}],"toArray":[{"__symbolic":"method"}],"at":[{"__symbolic":"method"}],"changePageTo":[{"__symbolic":"method"}],"update":[{"__symbolic":"method"}]}}}}] |
"use strict"; | ||
var __assign = (this && this.__assign) || Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/* tslint:disable:max-file-line-count */ | ||
var metadata_1 = require("./metadata"); | ||
var pagination_1 = require("./pagination"); | ||
var utils_1 = require("./utils"); | ||
const metadata_1 = require("./metadata"); | ||
const pagination_1 = require("./pagination"); | ||
const utils_1 = require("./utils"); | ||
/** | ||
@@ -28,5 +20,4 @@ * This class contains the main logic for interacting with the Flask Potion backend. | ||
*/ | ||
var PotionBase = (function () { | ||
function PotionBase(_a) { | ||
var _b = _a === void 0 ? {} : _a, _c = _b.host, host = _c === void 0 ? '' : _c, _d = _b.prefix, prefix = _d === void 0 ? '' : _d, cache = _b.cache; | ||
class PotionBase { | ||
constructor({ host = '', prefix = '', cache } = {}) { | ||
this.resources = {}; | ||
@@ -45,11 +36,11 @@ this.Promise = metadata_1.potionPromise(this); // NOTE: This is needed only to provide support for AngularJS. | ||
*/ | ||
PotionBase.prototype.register = function (uri, resource, options) { | ||
register(uri, resource, options) { | ||
metadata_1.decorateCtorWithPotionInstance(resource, this); | ||
metadata_1.decorateCtorWithPotionURI(resource, uri); | ||
if (options && Array.isArray(options.readonly)) { | ||
options.readonly.forEach(function (property) { return metadata_1.readonly(resource, property); }); | ||
options.readonly.forEach(property => metadata_1.readonly(resource, property)); | ||
} | ||
this.resources[uri] = resource; | ||
return resource; | ||
}; | ||
} | ||
/** | ||
@@ -64,13 +55,12 @@ * Register a resource. | ||
*/ | ||
PotionBase.prototype.registerAs = function (uri, options) { | ||
var _this = this; | ||
return function (target) { | ||
_this.register(uri, target, options); | ||
registerAs(uri, options) { | ||
return (target) => { | ||
this.register(uri, target, options); | ||
return target; | ||
}; | ||
}; | ||
} | ||
// tslint:disable-next-line: member-ordering | ||
PotionBase.prototype.fetch = function (uri, requestOptions, extras) { | ||
var origin = utils_1.removePrefixFromURI(uri, this.prefix); | ||
var options = __assign({}, requestOptions, extras, { origin: [] }); | ||
fetch(uri, requestOptions, extras) { | ||
const origin = utils_1.removePrefixFromURI(uri, this.prefix); | ||
const options = Object.assign({}, requestOptions, extras, { origin: [] }); | ||
if (utils_1.isPotionURI(uri, this.resources)) { | ||
@@ -82,16 +72,15 @@ Object.assign(options, { | ||
return this.resolve(uri, options) | ||
.then(function (json) { | ||
.then(json => { | ||
utils_1.replaceSelfReferences(json, utils_1.findRoots(json)); | ||
return json; | ||
}); | ||
}; | ||
PotionBase.prototype.resolve = function (uri, options) { | ||
var _this = this; | ||
var _a = this, Promise = _a.Promise, prefix = _a.prefix; | ||
var cacheKey = utils_1.removePrefixFromURI(uri, prefix); | ||
} | ||
resolve(uri, options) { | ||
const { Promise, prefix } = this; | ||
const cacheKey = utils_1.removePrefixFromURI(uri, prefix); | ||
// Add the API prefix if not present | ||
uri = utils_1.addPrefixToURI(uri, prefix); | ||
// Serialize request to Potion JSON. | ||
var fetch = function () { return _this.request("" + _this.host + uri, _this.serialize(options)) | ||
.then(function (response) { return _this.deserialize(response, uri, options); }); }; | ||
const fetch = () => this.request(`${this.host}${uri}`, this.serialize(options)) | ||
.then(response => this.deserialize(response, uri, options)); | ||
if (options.method === 'GET' && !options.paginate && !options.search) { | ||
@@ -105,11 +94,11 @@ // If a GET request was made and {cache: true} return the item from cache (if it exists). | ||
if (!this.requests.has(cacheKey)) { | ||
this.requests.set(cacheKey, fetch().then(function (data) { | ||
_this.requests.delete(cacheKey); | ||
this.requests.set(cacheKey, fetch().then(data => { | ||
this.requests.delete(cacheKey); | ||
return data; | ||
}, function (err) { | ||
}, err => { | ||
// If request fails, | ||
// make sure to remove the pending request so further requests can be made, | ||
// but fail the pipeline. | ||
_this.requests.delete(cacheKey); | ||
var message = utils_1.getErrorMessage(err, uri); | ||
this.requests.delete(cacheKey); | ||
const message = utils_1.getErrorMessage(err, uri); | ||
return Promise.reject(message); | ||
@@ -123,19 +112,17 @@ })); | ||
} | ||
}; | ||
PotionBase.prototype.serialize = function (options) { | ||
var prefix = this.prefix; | ||
var search = options.search; | ||
return __assign({}, options, { | ||
search: utils_1.toPotionJSON(options.paginate ? __assign({ page: 1, perPage: 25 }, search) : search, prefix), | ||
} | ||
serialize(options) { | ||
const { prefix } = this; | ||
const { search } = options; | ||
return Object.assign({}, options, { | ||
search: utils_1.toPotionJSON(options.paginate ? Object.assign({ page: 1, perPage: 25 }, search) : search, prefix), | ||
data: utils_1.toPotionJSON(options.data, prefix) | ||
}); | ||
}; | ||
PotionBase.prototype.deserialize = function (_a, uri, options) { | ||
var _this = this; | ||
var data = _a.data, headers = _a.headers; | ||
} | ||
deserialize({ data, headers }, uri, options) { | ||
return this.fromPotionJSON(data, options.origin) | ||
.then(function (json) { | ||
.then(json => { | ||
// If {paginate} is enabled, return or update Pagination. | ||
if (options.paginate) { | ||
var count = headers['x-total-count'] || json.length; | ||
const count = headers['x-total-count'] || json.length; | ||
if (options.pagination instanceof pagination_1.Pagination) { | ||
@@ -145,4 +132,4 @@ return options.pagination.update(json, count); | ||
else { | ||
var pagination = new pagination_1.Pagination({ uri: uri, potion: _this }, json, count, options); | ||
Object.assign(options, { pagination: pagination }); | ||
const pagination = new pagination_1.Pagination({ uri, potion: this }, json, count, options); | ||
Object.assign(options, { pagination }); | ||
return pagination; | ||
@@ -153,9 +140,8 @@ } | ||
}); | ||
}; | ||
PotionBase.prototype.fromPotionJSON = function (json, origin) { | ||
var _this = this; | ||
var Promise = this.Promise; | ||
} | ||
fromPotionJSON(json, origin) { | ||
const { Promise } = this; | ||
if (typeof json === 'object' && json !== null) { | ||
if (Array.isArray(json)) { | ||
return Promise.all(json.map(function (item) { return _this.fromPotionJSON(item, origin); })); | ||
return Promise.all(json.map(item => this.fromPotionJSON(item, origin))); | ||
} | ||
@@ -166,5 +152,4 @@ else if (typeof json.$uri === 'string' || utils_1.hasTypeAndId(json)) { | ||
return this.parseURI(json) | ||
.then(function (_a) { | ||
var resource = _a.resource, id = _a.id, uri = _a.uri; | ||
var attrs = { $id: id, $uri: uri }; | ||
.then(({ resource, id, uri }) => { | ||
const attrs = { $id: id, $uri: uri }; | ||
// Since we have a resource, we append to origin list (because later it will get replaced with itself). | ||
@@ -174,6 +159,6 @@ if (!origin.includes(uri)) { | ||
} | ||
var properties = _this.parsePotionJSONProperties(json, origin); | ||
const properties = this.parsePotionJSONProperties(json, origin); | ||
// Create and cache the resource if it does not exist. | ||
if (!_this.cache.has(uri)) { | ||
return _this.cache.put(uri, properties.then(function (properties) { return Reflect.construct(resource, [__assign({}, properties, attrs)]); })); | ||
if (!this.cache.has(uri)) { | ||
return this.cache.put(uri, properties.then((properties) => Reflect.construct(resource, [Object.assign({}, properties, attrs)]))); | ||
} | ||
@@ -183,5 +168,4 @@ else { | ||
// update it with new properties. | ||
return Promise.all([properties, _this.cache.get(uri)]) | ||
.then(function (_a) { | ||
var properties = _a[0], item = _a[1]; | ||
return Promise.all([properties, this.cache.get(uri)]) | ||
.then(([properties, item]) => { | ||
Object.assign(item, properties, attrs); | ||
@@ -207,11 +191,10 @@ return item; | ||
return this.parseURI(json) | ||
.then(function (_a) { | ||
var uri = _a.uri; | ||
.then(({ uri }) => { | ||
if (origin.includes(uri)) { | ||
return Promise.resolve(utils_1.toSelfReference(uri)); | ||
} | ||
return _this.resolve(uri, { | ||
return this.resolve(uri, { | ||
cache: true, | ||
method: 'GET', | ||
origin: origin | ||
origin | ||
}); | ||
@@ -230,41 +213,29 @@ }); | ||
} | ||
}; | ||
PotionBase.prototype.parsePotionJSONProperties = function (json, origin) { | ||
var _this = this; | ||
var Promise = this.Promise; | ||
var entries = Object.entries(json); | ||
var values = entries.map(function (_a) { | ||
var value = _a[1]; | ||
return _this.fromPotionJSON(value, origin); | ||
}); | ||
var keys = entries.map(function (_a) { | ||
var key = _a[0]; | ||
return utils_1.toCamelCase(key); | ||
}); | ||
} | ||
parsePotionJSONProperties(json, origin) { | ||
const { Promise } = this; | ||
const entries = Object.entries(json); | ||
const values = entries.map(([, value]) => this.fromPotionJSON(value, origin)); | ||
const keys = entries.map(([key]) => utils_1.toCamelCase(key)); | ||
return Promise.all(values) | ||
.then(function (values) { return values.map(function (value, index) { return [keys[index], value]; }) | ||
.reduce(function (a, _a) { | ||
var key = _a[0], value = _a[1]; | ||
return Object.assign(a, (_b = {}, | ||
_b[key] = value, | ||
_b)); | ||
var _b; | ||
}, {}); }); | ||
}; | ||
.then(values => values.map((value, index) => [keys[index], value]) | ||
.reduce((a, [key, value]) => Object.assign(a, { | ||
[key]: value | ||
}), {})); | ||
} | ||
// Try to parse a Potion URI and find the associated resource for it, | ||
// otherwise return a rejected promise. | ||
PotionBase.prototype.parseURI = function (_a) { | ||
var $ref = _a.$ref, $uri = _a.$uri, $type = _a.$type, $id = _a.$id; | ||
var Promise = this.Promise; | ||
var uri = utils_1.removePrefixFromURI(utils_1.getPotionURI({ $ref: $ref, $uri: $uri, $type: $type, $id: $id }), this.prefix); | ||
var entry = utils_1.findPotionResource(uri, this.resources); | ||
parseURI({ $ref, $uri, $type, $id }) { | ||
const { Promise } = this; | ||
const uri = utils_1.removePrefixFromURI(utils_1.getPotionURI({ $ref, $uri, $type, $id }), this.prefix); | ||
const entry = utils_1.findPotionResource(uri, this.resources); | ||
if (!entry) { | ||
return Promise.reject(new Error("URI '" + uri + "' is an uninterpretable or unknown Potion resource.")); | ||
return Promise.reject(new Error(`URI '${uri}' is an uninterpretable or unknown Potion resource.`)); | ||
} | ||
else { | ||
var resourceURI = entry.resourceURI, resource = entry.resource; | ||
var params = { resource: resource, uri: uri }; | ||
var id = utils_1.parsePotionID($id); | ||
const { resourceURI, resource } = entry; | ||
const params = { resource, uri }; | ||
const id = utils_1.parsePotionID($id); | ||
if (id !== null) { | ||
Object.assign(params, { id: id }); | ||
Object.assign(params, { id }); | ||
} | ||
@@ -278,6 +249,5 @@ else { | ||
} | ||
}; | ||
return PotionBase; | ||
}()); | ||
} | ||
} | ||
exports.PotionBase = PotionBase; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb3JlL3BvdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsd0NBQXdDO0FBQ3hDLHVDQUtvQjtBQUVwQiwyQ0FBd0M7QUFDeEMsaUNBaUJpQjtBQW9FakI7Ozs7Ozs7Ozs7OztHQVlHO0FBQ0g7SUFTQyxvQkFBWSxFQUFtRDtZQUFuRCw0QkFBbUQsRUFBbEQsWUFBUyxFQUFULDhCQUFTLEVBQUUsY0FBVyxFQUFYLGdDQUFXLEVBQUUsZ0JBQUs7UUFSakMsY0FBUyxHQUFvQixFQUFFLENBQUM7UUFLeEIsWUFBTyxHQUFtQix3QkFBYSxDQUFDLElBQUksQ0FBQyxDQUFDLENBQUMsOERBQThEO1FBQ3RILGFBQVEsR0FBcUIsSUFBSSxHQUFHLEVBQUUsQ0FBQztRQUc5QyxJQUFJLENBQUMsS0FBSyxHQUFHLEtBQUssSUFBSSxJQUFJLGdCQUFRLEVBQUUsQ0FBQztRQUNyQyxJQUFJLENBQUMsSUFBSSxHQUFHLElBQUksQ0FBQztRQUNqQixJQUFJLENBQUMsTUFBTSxHQUFHLE1BQU0sQ0FBQztJQUN0QixDQUFDO0lBRUQ7Ozs7O09BS0c7SUFDSCw2QkFBUSxHQUFSLFVBQVMsR0FBVyxFQU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x0XHRcdGNvbnN0IHtyZXNvdXJjZVVSSSwgcmVzb3VyY2V9ID0gZW50cnk7XG5cdFx0XHRjb25zdCBwYXJhbXMgPSB7cmVzb3VyY2UsIHVyaX07XG5cdFx0XHRjb25zdCBpZCA9IHBhcnNlUG90aW9uSUQoJGlkKTtcblxuXHRcdFx0aWYgKGlkICE9PSBudWxsKSB7XG5cdFx0XHRcdE9iamVjdC5hc3NpZ24ocGFyYW1zLCB7aWR9KTtcblx0XHRcdH0gZWxzZSB7XG5cdFx0XHRcdE9iamVjdC5hc3NpZ24ocGFyYW1zLCB7XG5cdFx0XHRcdFx0aWQ6IGdldFBvdGlvbklEKHVyaSwgcmVzb3VyY2VVUkkpXG5cdFx0XHRcdH0pO1xuXHRcdFx0fVxuXG5cdFx0XHRyZXR1cm4gUHJvbWlzZS5yZXNvbHZlKHBhcmFtcyk7XG5cdFx0fVxuXHR9XG59XG4iXX0= |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var metadata_1 = require("./metadata"); | ||
var utils_1 = require("./utils"); | ||
const metadata_1 = require("./metadata"); | ||
const utils_1 = require("./utils"); | ||
// tslint:disable:no-invalid-this | ||
function route(path, _a) { | ||
var method = (_a === void 0 ? {} : _a).method; | ||
function route(path, { method } = {}) { | ||
// tslint:disable-next-line:only-arrow-functions | ||
return function (params, _a) { | ||
var _b = _a === void 0 ? {} : _a, _c = _b.paginate, paginate = _c === void 0 ? false : _c, _d = _b.cache, cache = _d === void 0 ? true : _d; | ||
var isCtor = utils_1.isFunction(this); | ||
var uri = "" + (isCtor ? metadata_1.potionURI(this) : this.uri) + path; | ||
var options = { method: method, paginate: paginate, cache: cache }; | ||
return function (params, { paginate = false, cache = true } = {}) { | ||
const isCtor = utils_1.isFunction(this); | ||
const uri = `${isCtor ? metadata_1.potionURI(this) : this.uri}${path}`; | ||
const options = { method, paginate, cache }; | ||
if (method === 'GET') { | ||
@@ -37,3 +35,3 @@ options.search = params; | ||
exports.Route = { | ||
GET: function (uri) { | ||
GET(uri) { | ||
return route(uri, { | ||
@@ -43,3 +41,3 @@ method: 'GET' | ||
}, | ||
DELETE: function (uri) { | ||
DELETE(uri) { | ||
return route(uri, { | ||
@@ -49,3 +47,3 @@ method: 'DELETE' | ||
}, | ||
POST: function (uri) { | ||
POST(uri) { | ||
return route(uri, { | ||
@@ -55,3 +53,3 @@ method: 'POST' | ||
}, | ||
PATCH: function (uri) { | ||
PATCH(uri) { | ||
return route(uri, { | ||
@@ -61,3 +59,3 @@ method: 'PATCH' | ||
}, | ||
PUT: function (uri) { | ||
PUT(uri) { | ||
return route(uri, { | ||
@@ -68,2 +66,2 @@ method: 'PUT' | ||
}; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb3JlL3JvdXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsdUNBQXFEO0FBRXJELGlDQUFtQztBQU1uQyxpQ0FBaUM7QUFDakMsZUFBeUIsSUFBWSxFQUFFLEVBQTZCO1FBQTVCLHlDQUFNO0lBQzdDLGdEQUFnRDtJQUNoRCxNQUFNLENBQUMsVUFBb0IsTUFBWSxFQUFFLEVBQXFEO1lBQXJELDRCQUFxRCxFQUFwRCxnQkFBZ0IsRUFBaEIscUNBQWdCLEVBQUUsYUFBWSxFQUFaLGlDQUFZO1FBQ3ZFLElBQU0sTUFBTSxHQUFHLGtCQUFVLENBQUMsSUFBSSxDQUFDLENBQUM7UUFDaEMsSUFBTSxHQUFHLEdBQUcsTUFBRyxNQUFNLEdBQUcsb0JBQVMsQ0FBQyxJQUFJLENBQUMsR0FBRyxJQUFJLENBQUMsR0FBRyxJQUFHLElBQU0sQ0FBQztRQUU1RCxJQUFNLE9BQU8sR0FBbUIsRUFBQyxNQUFNLFFBQUEsRUFBRSxRQUFRLFVBQUEsRUFBRSxLQUFLLE9BQUEsRUFBQyxDQUFDO1FBQzFELEVBQUUsQ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zaWJsaW5ncycpO1xuICogICAgIGNyZWF0ZVNpYmxpbmcgPSBSb3V0ZS5QT1NUKCcvc2libGluZycpO1xuICogfVxuICovXG4vLyB0c2xpbnQ6ZGlzYWJsZS1uZXh0LWxpbmU6dmFyaWFibGUtbmFtZVxuZXhwb3J0IGNvbnN0IFJvdXRlID0ge1xuXHRHRVQ8VD4odXJpOiBzdHJpbmcpOiBSb3V0ZVR5cGU8VD4ge1xuXHRcdHJldHVybiByb3V0ZTxUPih1cmksIHtcblx0XHRcdG1ldGhvZDogJ0dFVCdcblx0XHR9KTtcblx0fSxcblx0REVMRVRFPFQ+KHVyaTogc3RyaW5nKTogUm91dGVUeXBlPFQ+IHtcblx0XHRyZXR1cm4gcm91dGU8VD4odXJpLCB7XG5cdFx0XHRtZXRob2Q6ICdERUxFVEUnXG5cdFx0fSk7XG5cdH0sXG5cdFBPU1Q8VD4odXJpOiBzdHJpbmcpOiBSb3V0ZVR5cGU8VD4ge1xuXHRcdHJldHVybiByb3V0ZTxUPih1cmksIHtcblx0XHRcdG1ldGhvZDogJ1BPU1QnXG5cdFx0fSk7XG5cdH0sXG5cdFBBVENIPFQ+KHVyaTogc3RyaW5nKTogUm91dGVUeXBlPFQ+IHtcblx0XHRyZXR1cm4gcm91dGU8VD4odXJpLCB7XG5cdFx0XHRtZXRob2Q6ICdQQVRDSCdcblx0XHR9KTtcblx0fSxcblx0UFVUPFQ+KHVyaTogc3RyaW5nKTogUm91dGVUeXBlPFQ+IHtcblx0XHRyZXR1cm4gcm91dGU8VD4odXJpLCB7XG5cdFx0XHRtZXRob2Q6ICdQVVQnXG5cdFx0fSk7XG5cdH1cbn07XG4iXX0= |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
// tslint:disable: max-classes-per-file | ||
var item_1 = require("./item"); | ||
var pagination_1 = require("./pagination"); | ||
const item_1 = require("./item"); | ||
const pagination_1 = require("./pagination"); | ||
/** | ||
* Camel case to snake case | ||
*/ | ||
function toSnakeCase(str, separator) { | ||
if (separator === void 0) { separator = '_'; } | ||
return str.replace(/\.?([A-Z0-9]+)/g, function (_, $2) { return "" + separator + $2.toLowerCase(); }) | ||
function toSnakeCase(str, separator = '_') { | ||
return str.replace(/\.?([A-Z0-9]+)/g, (_, $2) => `${separator}${$2.toLowerCase()}`) | ||
.replace(/^_/, ''); | ||
@@ -19,3 +18,3 @@ } | ||
function toCamelCase(str) { | ||
return str.replace(/_([a-z0-9])/g, function (g) { return g[1].toUpperCase(); }); | ||
return str.replace(/_([a-z0-9])/g, g => g[1].toUpperCase()); | ||
} | ||
@@ -57,11 +56,4 @@ exports.toCamelCase = toCamelCase; | ||
return Object.entries(obj) | ||
.map(function (_a) { | ||
var key = _a[0], value = _a[1]; | ||
return [isFunction(keyMapFunction) ? keyMapFunction(key) : key, isFunction(valueMapFunction) ? valueMapFunction(value) : value]; | ||
}) | ||
.reduce(function (a, _a) { | ||
var key = _a[0], value = _a[1]; | ||
return Object.assign(a, (_b = {}, _b[key] = value, _b)); | ||
var _b; | ||
}, {}); | ||
.map(([key, value]) => [isFunction(keyMapFunction) ? keyMapFunction(key) : key, isFunction(valueMapFunction) ? valueMapFunction(value) : value]) | ||
.reduce((a, [key, value]) => Object.assign(a, { [key]: value }), {}); | ||
} | ||
@@ -75,3 +67,3 @@ return obj; | ||
function getErrorMessage(error, uri) { | ||
var message = 'An error occurred while Potion tried to retrieve a resource'; | ||
const message = 'An error occurred while Potion tried to retrieve a resource'; | ||
if (error instanceof Error) { | ||
@@ -84,5 +76,5 @@ return error.message; | ||
else if (typeof uri === 'string') { | ||
return message + " from '" + uri + "'."; | ||
return `${message} from '${uri}'.`; | ||
} | ||
return message + "."; | ||
return `${message}.`; | ||
} | ||
@@ -95,15 +87,8 @@ exports.getErrorMessage = getErrorMessage; | ||
if (Array.isArray(json)) { | ||
return json.map(function (value) { return typeof value === 'object' ? fromSchemaJSON(value) : value; }); | ||
return json.map(value => typeof value === 'object' ? fromSchemaJSON(value) : value); | ||
} | ||
else if (isJsObject(json)) { | ||
return Object.entries(json) | ||
.map(function (_a) { | ||
var key = _a[0], value = _a[1]; | ||
return [toCamelCase(key), typeof value === 'object' ? fromSchemaJSON(value) : value]; | ||
}) | ||
.reduce(function (a, _a) { | ||
var key = _a[0], value = _a[1]; | ||
return Object.assign(a, (_b = {}, _b[key] = value, _b)); | ||
var _b; | ||
}, {}); | ||
.map(([key, value]) => [toCamelCase(key), typeof value === 'object' ? fromSchemaJSON(value) : value]) | ||
.reduce((a, [key, value]) => Object.assign(a, { [key]: value }), {}); | ||
} | ||
@@ -113,11 +98,10 @@ return json; | ||
exports.fromSchemaJSON = fromSchemaJSON; | ||
var SelfReference = (function () { | ||
function SelfReference($uri) { | ||
class SelfReference { | ||
constructor($uri) { | ||
this.$uri = $uri; | ||
} | ||
SelfReference.prototype.matches = function (uri) { | ||
matches(uri) { | ||
return this.$uri === uri; | ||
}; | ||
return SelfReference; | ||
}()); | ||
} | ||
} | ||
exports.SelfReference = SelfReference; | ||
@@ -131,3 +115,3 @@ /** | ||
// TODO: It's uncertain if this may need to be created every time we replace refs., we might need to do so. | ||
var set = new WeakSet(); | ||
const set = new WeakSet(); | ||
function replaceSelfReferences(json, roots) { | ||
@@ -142,10 +126,12 @@ if (typeof json !== 'object' || json === null) { | ||
else if (json instanceof pagination_1.Pagination) { | ||
return json.update(json.map(function (value) { return replaceSelfReferences(value, roots); }), json.total); | ||
const items = json.toArray() | ||
.map(value => replaceSelfReferences(value, roots)); | ||
return json.update(items, json.total); | ||
} | ||
else if (Array.isArray(json)) { | ||
return json.map(function (value) { return replaceSelfReferences(value, roots); }); | ||
return json.map(value => replaceSelfReferences(value, roots)); | ||
} | ||
else if (json instanceof SelfReference) { | ||
// Find the ref in the roots. | ||
return roots.find(function (item) { return json.matches(item.uri); }); | ||
return roots.find(item => json.matches(item.uri)); | ||
} | ||
@@ -159,19 +145,14 @@ else if (Object.keys(json).length > 0) { | ||
} | ||
var _loop_1 = function (key, value) { | ||
for (const [key, value] of Object.entries(json)) { | ||
if (value instanceof SelfReference) { | ||
var ref = roots.find(function (item) { return value.matches(item.uri); }); | ||
Object.assign(json, (_a = {}, | ||
_a[key] = ref, | ||
_a)); | ||
const ref = roots.find(item => value.matches(item.uri)); | ||
Object.assign(json, { | ||
[key]: ref | ||
}); | ||
} | ||
else if (isJsObject(value)) { | ||
Object.assign(json, (_b = {}, | ||
_b[key] = replaceSelfReferences(value, roots), | ||
_b)); | ||
Object.assign(json, { | ||
[key]: replaceSelfReferences(value, roots) | ||
}); | ||
} | ||
var _a, _b; | ||
}; | ||
for (var _i = 0, _a = Object.entries(json); _i < _a.length; _i++) { | ||
var _b = _a[_i], key = _b[0], value = _b[1]; | ||
_loop_1(key, value); | ||
} | ||
@@ -189,3 +170,3 @@ return json; | ||
function findRoots(json) { | ||
var roots = []; | ||
const roots = []; | ||
if (isJsObject(json) && Object.keys(json).length > 0) { | ||
@@ -200,18 +181,13 @@ if (set.has(json)) { | ||
} | ||
var values = Array.isArray(json) || json instanceof pagination_1.Pagination ? json : Object.values(json); | ||
for (var _i = 0, values_1 = values; _i < values_1.length; _i++) { | ||
var value = values_1[_i]; | ||
roots.push.apply(roots, findRoots(value)); | ||
const values = Array.isArray(json) || json instanceof pagination_1.Pagination ? json : Object.values(json); | ||
for (const value of values) { | ||
roots.push(...findRoots(value)); | ||
} | ||
} | ||
// Remove duplicate entries. | ||
var result = []; | ||
var _loop_2 = function (root) { | ||
if (result.findIndex(function (item) { return root.uri === item.uri; }) === -1) { | ||
const result = []; | ||
for (const root of roots) { | ||
if (result.findIndex(item => root.uri === item.uri) === -1) { | ||
result.push(root); | ||
} | ||
}; | ||
for (var _a = 0, roots_1 = roots; _a < roots_1.length; _a++) { | ||
var root = roots_1[_a]; | ||
_loop_2(root); | ||
} | ||
@@ -234,3 +210,3 @@ return result; | ||
if (json instanceof item_1.Item && typeof json.uri === 'string') { | ||
return { $ref: "" + addPrefixToURI(json.uri, prefix) }; | ||
return { $ref: `${addPrefixToURI(json.uri, prefix)}` }; | ||
} | ||
@@ -241,5 +217,5 @@ else if (json instanceof Date) { | ||
else if (Array.isArray(json)) { | ||
return json.map(function (item) { return toPotionJSON(item, prefix); }); | ||
return json.map(item => toPotionJSON(item, prefix)); | ||
} | ||
return omap(json, function (key) { return toSnakeCase(key); }, function (value) { return toPotionJSON(value, prefix); }); | ||
return omap(json, key => toSnakeCase(key), value => toPotionJSON(value, prefix)); | ||
} | ||
@@ -266,5 +242,5 @@ return json; | ||
function getPotionID(uri, resourceURI) { | ||
var index = uri.indexOf(resourceURI + "/"); | ||
const index = uri.indexOf(`${resourceURI}/`); | ||
if (index !== -1) { | ||
var id = uri.substring(index) | ||
const id = uri.substring(index) | ||
.split('/') | ||
@@ -281,12 +257,9 @@ .pop(); | ||
function findPotionResource(uri, resources) { | ||
var entry = Object.entries(resources) | ||
.find(function (_a) { | ||
var resourceURI = _a[0]; | ||
return uri.indexOf(resourceURI + "/") === 0; | ||
}); | ||
const entry = Object.entries(resources) | ||
.find(([resourceURI]) => uri.indexOf(`${resourceURI}/`) === 0); | ||
if (entry) { | ||
var resourceURI = entry[0], resource = entry[1]; | ||
const [resourceURI, resource] = entry; | ||
return { | ||
resourceURI: resourceURI, | ||
resource: resource | ||
resourceURI, | ||
resource | ||
}; | ||
@@ -300,3 +273,3 @@ } | ||
function isPotionURI(uri, resources) { | ||
var entry = findPotionResource(uri, resources); | ||
const entry = findPotionResource(uri, resources); | ||
if (entry) { | ||
@@ -311,9 +284,7 @@ return getPotionID(uri, entry.resourceURI) !== null; | ||
*/ | ||
function hasTypeAndId(_a) { | ||
var $type = _a.$type, $id = _a.$id; | ||
function hasTypeAndId({ $type, $id }) { | ||
return (typeof $id === 'string' || Number.isInteger($id)) && typeof $type === 'string'; | ||
} | ||
exports.hasTypeAndId = hasTypeAndId; | ||
function getPotionURI(_a) { | ||
var $uri = _a.$uri, $ref = _a.$ref, $type = _a.$type, $id = _a.$id; | ||
function getPotionURI({ $uri, $ref, $type, $id }) { | ||
if (typeof $uri === 'string') { | ||
@@ -325,4 +296,4 @@ return decodeURIComponent($uri); | ||
} | ||
else if (hasTypeAndId({ $type: $type, $id: $id })) { | ||
return "/" + $type + "/" + $id; | ||
else if (hasTypeAndId({ $type, $id })) { | ||
return `/${$type}/${$id}`; | ||
} | ||
@@ -347,3 +318,3 @@ return ''; | ||
if (typeof prefix === 'string' && !uri.includes(prefix)) { | ||
return "" + prefix + uri; | ||
return `${prefix}${uri}`; | ||
} | ||
@@ -356,10 +327,5 @@ return uri; | ||
*/ | ||
function merge() { | ||
var objects = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
objects[_i] = arguments[_i]; | ||
} | ||
var result = {}; | ||
for (var _a = 0, objects_1 = objects; _a < objects_1.length; _a++) { | ||
var obj = objects_1[_a]; | ||
function merge(...objects) { | ||
const result = {}; | ||
for (const obj of objects) { | ||
Object.assign(result, obj); | ||
@@ -374,22 +340,21 @@ } | ||
*/ | ||
var MemCache = (function () { | ||
function MemCache() { | ||
class MemCache { | ||
constructor() { | ||
this.items = new Map(); | ||
} | ||
MemCache.prototype.has = function (key) { | ||
has(key) { | ||
return this.items.has(key); | ||
}; | ||
MemCache.prototype.get = function (key) { | ||
} | ||
get(key) { | ||
return this.items.get(key); | ||
}; | ||
MemCache.prototype.put = function (key, item) { | ||
} | ||
put(key, item) { | ||
return this.items.set(key, item) | ||
.get(key); | ||
}; | ||
MemCache.prototype.remove = function (key) { | ||
} | ||
remove(key) { | ||
this.items.delete(key); | ||
}; | ||
return MemCache; | ||
}()); | ||
} | ||
} | ||
exports.MemCache = MemCache; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb3JlL3V0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsdUNBQXVDO0FBQ3ZDLCtCQUE0QjtBQUM1QiwyQ0FBd0M7QUFJeEM7O0dBRUc7QUFDSCx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dW5jdGlvbiBtZXJnZSguLi5vYmplY3RzOiBBcnJheTx7W2tleTogc3RyaW5nXTogYW55fT4pOiBhbnkge1xuXHRjb25zdCByZXN1bHQgPSB7fTtcblx0Zm9yIChjb25zdCBvYmogb2Ygb2JqZWN0cykge1xuXHRcdE9iamVjdC5hc3NpZ24ocmVzdWx0LCBvYmopO1xuXHR9XG5cdHJldHVybiByZXN1bHQ7XG59XG5cblxuLyoqXG4gKiBJbi1NZW1vcnkgY2FjaGVcbiAqIFdpbGwgYmUgdXNlZCBieSBkZWZhdWx0IGJ5IFBvdGlvbiBmb3IgY2FjaGluZyByZXNvdXJjZXMuXG4gKi9cbmV4cG9ydCBjbGFzcyBNZW1DYWNoZTxUIGV4dGVuZHMgSXRlbT4gaW1wbGVtZW50cyBJdGVtQ2FjaGU8VD4ge1xuXHRwcm90ZWN0ZWQgaXRlbXM6IE1hcDxzdHJpbmcsIGFueT4gPSBuZXcgTWFwPHN0cmluZywgUHJvbWlzZTxUPj4oKTtcblxuXHRoYXMoa2V5OiBzdHJpbmcpOiBib29sZWFuIHtcblx0XHRyZXR1cm4gdGhpcy5pdGVtcy5oYXMoa2V5KTtcblx0fVxuXHRnZXQoa2V5OiBzdHJpbmcpOiBQcm9taXNlPFQ+IHtcblx0XHRyZXR1cm4gdGhpcy5pdGVtcy5nZXQoa2V5KTtcblx0fVxuXHRwdXQoa2V5OiBzdHJpbmcsIGl0ZW06IFByb21pc2U8VD4pOiBQcm9taXNlPFQ+IHtcblx0XHRyZXR1cm4gdGhpcy5pdGVtcy5zZXQoa2V5LCBpdGVtKVxuXHRcdFx0LmdldChrZXkpO1xuXHR9XG5cblx0cmVtb3ZlKGtleTogc3RyaW5nKTogdm9pZCB7XG5cdFx0dGhpcy5pdGVtcy5kZWxldGUoa2V5KTtcblx0fVxufVxuIl19 |
@@ -1,1 +0,1 @@ | ||
[{"__symbolic":"module","version":3,"metadata":{"toSnakeCase":{"__symbolic":"function","parameters":["str","separator"],"value":{"__symbolic":"error","message":"Expression form not supported","line":11,"character":11},"defaults":[null,"_"]},"toCamelCase":{"__symbolic":"function","parameters":["str"],"value":{"__symbolic":"error","message":"Expression form not supported","line":19,"character":20}},"isJsObject":{"__symbolic":"function","parameters":["value"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":28,"character":8},"right":"object"},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"value"},"right":null}}},"isObjectEmpty":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"keys"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"member":"length"},"right":0}},"isFunction":{"__symbolic":"function","parameters":["value"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":42,"character":8},"right":"function"}},"omap":{"__symbolic":"function"},"getErrorMessage":{"__symbolic":"function"},"fromSchemaJSON":{"__symbolic":"function"},"SelfReference":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}],"matches":[{"__symbolic":"method"}]}},"replaceSelfReferences":{"__symbolic":"function"},"findRoots":{"__symbolic":"function"},"toSelfReference":{"__symbolic":"function","parameters":["uri"],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"SelfReference"},"arguments":[{"__symbolic":"reference","name":"uri"}]}},"toPotionJSON":{"__symbolic":"function"},"parsePotionID":{"__symbolic":"function"},"getPotionID":{"__symbolic":"function"},"findPotionResource":{"__symbolic":"function"},"isPotionURI":{"__symbolic":"function"},"hasTypeAndId":{"__symbolic":"function","parameters":["$type","$id"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":271,"character":9},"right":"string"},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Number"},"member":"isInteger"},"arguments":[{"__symbolic":"reference","name":"$id"}]}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":271,"character":62},"right":"string"}}},"getPotionURI":{"__symbolic":"function"},"removePrefixFromURI":{"__symbolic":"function"},"addPrefixToURI":{"__symbolic":"function"},"merge":{"__symbolic":"function"},"MemCache":{"__symbolic":"class","arity":1,"members":{"has":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"put":[{"__symbolic":"method"}],"remove":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"toSnakeCase":{"__symbolic":"function","parameters":["str","separator"],"value":{"__symbolic":"error","message":"Expression form not supported","line":11,"character":11},"defaults":[null,"_"]},"toCamelCase":{"__symbolic":"function","parameters":["str"],"value":{"__symbolic":"error","message":"Expression form not supported","line":19,"character":20}},"isJsObject":{"__symbolic":"function","parameters":["value"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":28,"character":8},"right":"object"},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"value"},"right":null}}},"isObjectEmpty":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"keys"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"member":"length"},"right":0}},"isFunction":{"__symbolic":"function","parameters":["value"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":42,"character":8},"right":"function"}},"omap":{"__symbolic":"function"},"getErrorMessage":{"__symbolic":"function"},"fromSchemaJSON":{"__symbolic":"function"},"SelfReference":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}],"matches":[{"__symbolic":"method"}]}},"replaceSelfReferences":{"__symbolic":"function"},"findRoots":{"__symbolic":"function"},"toSelfReference":{"__symbolic":"function","parameters":["uri"],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"SelfReference"},"arguments":[{"__symbolic":"reference","name":"uri"}]}},"toPotionJSON":{"__symbolic":"function"},"parsePotionID":{"__symbolic":"function"},"getPotionID":{"__symbolic":"function"},"findPotionResource":{"__symbolic":"function"},"isPotionURI":{"__symbolic":"function"},"hasTypeAndId":{"__symbolic":"function","parameters":["$type","$id"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":271,"character":9},"right":"string"},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Number"},"member":"isInteger"},"arguments":[{"__symbolic":"reference","name":"$id"}]}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":271,"character":62},"right":"string"}}},"getPotionURI":{"__symbolic":"function"},"removePrefixFromURI":{"__symbolic":"function"},"addPrefixToURI":{"__symbolic":"function"},"merge":{"__symbolic":"function"},"MemCache":{"__symbolic":"class","arity":1,"members":{"has":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"put":[{"__symbolic":"method"}],"remove":[{"__symbolic":"method"}]}}}}] | ||
[{"__symbolic":"module","version":3,"metadata":{"toSnakeCase":{"__symbolic":"function","parameters":["str","separator"],"value":{"__symbolic":"error","message":"Expression form not supported","line":11,"character":11},"defaults":[null,"_"]},"toCamelCase":{"__symbolic":"function","parameters":["str"],"value":{"__symbolic":"error","message":"Expression form not supported","line":19,"character":20}},"isJsObject":{"__symbolic":"function","parameters":["value"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":28,"character":8},"right":"object"},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"value"},"right":null}}},"isObjectEmpty":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"keys"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"member":"length"},"right":0}},"isFunction":{"__symbolic":"function","parameters":["value"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":42,"character":8},"right":"function"}},"omap":{"__symbolic":"function"},"getErrorMessage":{"__symbolic":"function"},"fromSchemaJSON":{"__symbolic":"function"},"SelfReference":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}],"matches":[{"__symbolic":"method"}]}},"replaceSelfReferences":{"__symbolic":"function"},"findRoots":{"__symbolic":"function"},"toSelfReference":{"__symbolic":"function","parameters":["uri"],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"SelfReference"},"arguments":[{"__symbolic":"reference","name":"uri"}]}},"toPotionJSON":{"__symbolic":"function"},"parsePotionID":{"__symbolic":"function"},"getPotionID":{"__symbolic":"function"},"findPotionResource":{"__symbolic":"function"},"isPotionURI":{"__symbolic":"function"},"hasTypeAndId":{"__symbolic":"function","parameters":["$type","$id"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":273,"character":9},"right":"string"},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Number"},"member":"isInteger"},"arguments":[{"__symbolic":"reference","name":"$id"}]}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":273,"character":62},"right":"string"}}},"getPotionURI":{"__symbolic":"function"},"removePrefixFromURI":{"__symbolic":"function"},"addPrefixToURI":{"__symbolic":"function"},"merge":{"__symbolic":"function"},"MemCache":{"__symbolic":"class","arity":1,"members":{"has":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"put":[{"__symbolic":"method"}],"remove":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"toSnakeCase":{"__symbolic":"function","parameters":["str","separator"],"value":{"__symbolic":"error","message":"Expression form not supported","line":11,"character":11},"defaults":[null,"_"]},"toCamelCase":{"__symbolic":"function","parameters":["str"],"value":{"__symbolic":"error","message":"Expression form not supported","line":19,"character":20}},"isJsObject":{"__symbolic":"function","parameters":["value"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":28,"character":8},"right":"object"},"right":{"__symbolic":"binop","operator":"!==","left":{"__symbolic":"reference","name":"value"},"right":null}}},"isObjectEmpty":{"__symbolic":"function","parameters":["obj"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Object"},"member":"keys"},"arguments":[{"__symbolic":"reference","name":"obj"}]},"member":"length"},"right":0}},"isFunction":{"__symbolic":"function","parameters":["value"],"value":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":42,"character":8},"right":"function"}},"omap":{"__symbolic":"function"},"getErrorMessage":{"__symbolic":"function"},"fromSchemaJSON":{"__symbolic":"function"},"SelfReference":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"string"}]}],"matches":[{"__symbolic":"method"}]}},"replaceSelfReferences":{"__symbolic":"function"},"findRoots":{"__symbolic":"function"},"toSelfReference":{"__symbolic":"function","parameters":["uri"],"value":{"__symbolic":"new","expression":{"__symbolic":"reference","name":"SelfReference"},"arguments":[{"__symbolic":"reference","name":"uri"}]}},"toPotionJSON":{"__symbolic":"function"},"parsePotionID":{"__symbolic":"function"},"getPotionID":{"__symbolic":"function"},"findPotionResource":{"__symbolic":"function"},"isPotionURI":{"__symbolic":"function"},"hasTypeAndId":{"__symbolic":"function","parameters":["$type","$id"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"||","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":273,"character":9},"right":"string"},"right":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Number"},"member":"isInteger"},"arguments":[{"__symbolic":"reference","name":"$id"}]}},"right":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":273,"character":62},"right":"string"}}},"getPotionURI":{"__symbolic":"function"},"removePrefixFromURI":{"__symbolic":"function"},"addPrefixToURI":{"__symbolic":"function"},"merge":{"__symbolic":"function"},"MemCache":{"__symbolic":"class","arity":1,"members":{"has":[{"__symbolic":"method"}],"get":[{"__symbolic":"method"}],"put":[{"__symbolic":"method"}],"remove":[{"__symbolic":"method"}]}}}}] |
71
fetch.js
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __assign = (this && this.__assign) || Object.assign || function(t) { | ||
for (var s, i = 1, n = arguments.length; i < n; i++) { | ||
s = arguments[i]; | ||
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) | ||
t[p] = s[p]; | ||
} | ||
return t; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
var core_1 = require("./core"); | ||
const core_1 = require("./core"); | ||
var core_2 = require("./core"); | ||
@@ -26,6 +8,5 @@ exports.readonly = core_2.readonly; | ||
exports.Route = core_2.Route; | ||
var Potion = (function (_super) { | ||
__extends(Potion, _super); | ||
function Potion(options) { | ||
return _super.call(this, __assign({}, options)) || this; | ||
class Potion extends core_1.PotionBase { | ||
constructor(options) { | ||
super(Object.assign({}, options)); | ||
} | ||
@@ -37,7 +18,7 @@ // Use window.fetch for making requests, | ||
// tslint:disable-next-line: prefer-function-over-method | ||
Potion.prototype.request = function (uri, options) { | ||
var _a = __assign({}, options), _b = _a.method, method = _b === void 0 ? 'GET' : _b, search = _a.search, data = _a.data, _c = _a.cache, cache = _c === void 0 ? true : _c; | ||
var headers = new Headers(); | ||
var init = { | ||
method: method, | ||
request(uri, options) { | ||
const { method = 'GET', search, data, cache = true } = Object.assign({}, options); | ||
const headers = new Headers(); | ||
const init = { | ||
method, | ||
cache: cache ? 'default' : 'no-cache', | ||
@@ -55,14 +36,13 @@ // Make sure cookies are sent | ||
} | ||
Object.assign(init, { headers: headers }); | ||
Object.assign(init, { headers }); | ||
// TODO: when URL will be supported we will switch to it | ||
if (search) { | ||
var count = 1; | ||
var entries = Object.entries(search); | ||
var size = entries.length; | ||
for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) { | ||
var _d = entries_1[_i], key = _d[0], value = _d[1]; | ||
let count = 1; | ||
const entries = Object.entries(search); | ||
const size = entries.length; | ||
for (const [key, value] of entries) { | ||
if (count === 1) { | ||
uri += '?'; | ||
} | ||
uri += key + "=" + value; | ||
uri += `${key}=${value}`; | ||
if (count < size) { | ||
@@ -74,23 +54,22 @@ uri += '&'; | ||
} | ||
return fetch(new Request(uri, init), init).then(function (response) { | ||
return fetch(new Request(uri, init), init).then(response => { | ||
if (response.ok) { | ||
var headers_1 = {}; | ||
const headers = {}; | ||
if (response.headers) { | ||
response.headers.forEach(function (value, key) { | ||
headers_1[key] = value; | ||
response.headers.forEach((value, key) => { | ||
headers[key] = value; | ||
}); | ||
} | ||
return response.json() | ||
.then(function (json) { return ({ headers: headers_1, data: json }); }, function (error) { return error; }); | ||
.then(json => ({ headers, data: json }), error => error); | ||
} | ||
else { | ||
var error = new Error(response.statusText); | ||
Object.assign(error, { response: response }); | ||
const error = new Error(response.statusText); | ||
Object.assign(error, { response }); | ||
throw error; | ||
} | ||
}); | ||
}; | ||
return Potion; | ||
}(core_1.PotionBase)); | ||
} | ||
} | ||
exports.Potion = Potion; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9mZXRjaC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLCtCQUtnQjtBQUdoQiwrQkFBNkM7QUFBckMsMEJBQUEsUUFBUSxDQUFBO0FBQUUsc0JBQUEsSUFBSSxDQUFBO0FBQUUsdUJBQUEsS0FBSyxDQUFBO0FBRzdCO0lBQTRCLDBCQUFVO0lBQ3JDLGdCQUFZLE9BQXVCO2VBQ2xDLCtCQUFVLE9BQU8sRUFBRTtJQUNwQixDQUFDO0lBRUQsd0NBQXdDO0lBQ3hDLGtGQUFrRjtJQUNsRiwrQ0FBK0M7SUFDL0Msb0ZBQW9GO0lBQ3BGLHdEQUF3RDtJQUM5Qyx3QkFBTyxHQUFqQixVQUFrQixHQUFXLEVBQUUsT0FBd0I7UUFDaEQsSUFBQSwwQkFBMkUsRUFBMUUsY0FBYyxFQUFkLG1DQUFjLEVBQUUsa0JBQU0sRUFBRSxjQUFJLEVBQUUsYUFBWSxFQUFaLGlDQUFZLENBQWlDO1FBQ2xGLElBQU0sT0FBTyxHQUFZLElBQUksT0FBTyxFQUFFLENBQUM7UUFDdkMsSUFBTSxJQUFJLEdBQVE7WUFDakIsTUFBTSxRQUFBO1lBQ04sS0FBSyxFQUFFLEtBQUssR0FBRyxTQUFTLEdBQUcsVUFBVTtZQUNyQyw2QkFBNkI7WUFDN0Isa0RBQWtEO1lBQ2xELFdBQVcsRUFBRSxTQUFTO1NBQ3RCLENBQUM7UUFFRixFQUFFLENBQUMsQ0FBQyxJQUFJLENBQUMsQ0F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||
"version": "1.5.8-0", | ||
"description": "A ES6 client for APIs written in Flask-Potion", | ||
@@ -28,3 +28,3 @@ "keywords": [ | ||
"pretest": "npm run lint", | ||
"test": "karma start karma.config.ts --browsers PhantomJS --single-run --log-level error", | ||
"test": "karma start karma.config.ts --browsers Chrome --single-run --log-level error", | ||
"test:continuous": "karma start karma.config.ts", | ||
@@ -69,7 +69,5 @@ "prebuild": "npm run test && npm run clean", | ||
"karma-jasmine": "^1.1.0", | ||
"karma-phantomjs-launcher": "^1.0.4", | ||
"karma-spec-reporter": "^0.0.31", | ||
"karma-typescript": "^3.0.2", | ||
"karma-typescript-es6-transform": "^1.0.1", | ||
"phantomjs-prebuilt": "^2.1.14", | ||
"rxjs": "^5.4.0", | ||
@@ -76,0 +74,0 @@ "tslint": "^5.3.2", |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
33
216017
1861
2