New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

potion-client

Package Overview
Dependencies
Maintainers
2
Versions
183
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

potion-client - npm Package Compare versions

Comparing version 1.5.2 to 1.5.3-0

2

@angular/potion.js

@@ -177,2 +177,2 @@ "use strict";

};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9AYW5ndWxhci9wb3Rpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLHVDQUFDOzs7Ozs7Ozs7Ozs7QUFFRCxzQ0FPdUI7QUFDdkIsc0NBU3VCO0FBR3ZCLGlDQUErQjtBQUMvQix1Q0FBcUM7QUFFckMsZ0NBTWlCO0FBRWpCLHVDQUFtRDtBQUduRDs7R0FFRztBQUNVLFFBQUEsZ0JBQUEsR0FBbUIsSUFBSSxxQkFBQSxDQUErQixrQkFBRSxDQUFrQixDQUFDO0FBTXhGOztHQUVHO0FBQ1UsUUFBQSxhQUFBLEdBQWdCLElBQUkscUJBQUEsQ0FBNEIsZUFBRSxDQUFlLENBQUM7QUFJL0U7OztHQUdHO0FBQ1UsUUFBQSxXQUFBLEdBQWMsSUFBSSxxQkFBQSxDQUEwQixhQUFFLENBQWEsQ0FBQztBQU16RTs7R0FFRztBQUNIO0lBQXdDLHNDQUFZO0lBQXBEOztJQVVBLENBQUM7SUFUQSxzQ0FBUyxHQUFULFVBQVUsR0FBVztRQUNwQixNQUFNLENBQUMsa0JBQWtCLENBQUMsR0FBRyxDQUFDLENBQUM7SUFDaEMsQ0FBQztJQUVELHdDQUFXLEdBQVgsVUFBWSxLQUFhO1FBQ3hCLE1BQU0sQ0FBQyxrQkFBa0IsQ0FDeEIsSUFBSSxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsQ0FDckIsQ0FBQztJQUNILENBQUM7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YWJsZSwgdXNlIHRoYXQuXG5cdC8vIE90aGVyd2lzZSwgcHJvdmlkZSBhIG5ldyBvbmUuXG5cdHByb3ZpZGU6IFBvdGlvbixcblx0dXNlRmFjdG9yeTogUE9USU9OX1BST1ZJREVSX0ZBQ1RPUlksXG5cdGRlcHM6IFtcblx0XHRbbmV3IE9wdGlvbmFsKCksIG5ldyBTa2lwU2VsZigpLCBQb3Rpb25dLFxuXHRcdEh0dHAsXG5cdFx0W25ldyBPcHRpb25hbCgpLCBuZXcgSW5qZWN0KFBPVElPTl9DT05GSUcpXSxcblx0XHRbbmV3IE9wdGlvbmFsKCksIG5ldyBJbmplY3QoUE9USU9OX0hUVFApXVxuXHRdXG59O1xuXG5pbnRlcmZhY2UgRGVjb3JhdG9ySW52b2NhdGlvbiB7XG4gIHR5cGU6IEZ1bmN0aW9uO1xuICBhcmdzPzogYW55W107XG59XG4iXX0=
export { ItemOptions, Item } from './core/item';
export { readonly } from './core/metadata';
export { PaginationOptions, Pagination } from './core/pagination';
export { ItemCache, URLSearchParams, RequestOptions, FetchOptions, QueryOptions, PotionOptions, PotionResponse, PotionBase } from './core/potion';
export { Pagination } from './core/pagination';
export { ItemCache, URLSearchParams, RequestOptions, FetchExtras, FetchOptions, QueryOptions, PotionOptions, PotionResponse, PotionBase } from './core/potion';
export { Route, route } from './core/route';
export { fromSchemaJSON, getPotionURI, hasTypeAndId, isFunction, isJsObject, isObjectEmpty, KeyMapFunction, omap, mapToObject, merge, parsePotionID, toCamelCase, toPotionJSON, toSnakeCase, ValueMapFunction } from './core/utils';
export { findPotionResource, fromSchemaJSON, getPotionID, getPotionURI, hasTypeAndId, isFunction, isJsObject, isObjectEmpty, isPotionURI, KeyMapFunction, omap, merge, parsePotionID, toCamelCase, toPotionJSON, toSnakeCase, ValueMapFunction } from './core/utils';

@@ -15,3 +15,5 @@ "use strict";

var utils_1 = require("./core/utils");
exports.findPotionResource = utils_1.findPotionResource;
exports.fromSchemaJSON = utils_1.fromSchemaJSON;
exports.getPotionID = utils_1.getPotionID;
exports.getPotionURI = utils_1.getPotionURI;

@@ -22,4 +24,4 @@ exports.hasTypeAndId = utils_1.hasTypeAndId;

exports.isObjectEmpty = utils_1.isObjectEmpty;
exports.isPotionURI = utils_1.isPotionURI;
exports.omap = utils_1.omap;
exports.mapToObject = utils_1.mapToObject;
exports.merge = utils_1.merge;

@@ -30,2 +32,2 @@ exports.parsePotionID = utils_1.parsePotionID;

exports.toSnakeCase = utils_1.toSnakeCase;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9jb3JlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsb0NBQThDO0FBQXpCLHNCQUFBLElBQUksQ0FBQTtBQUN6Qiw0Q0FBeUM7QUFBakMsOEJBQUEsUUFBUSxDQUFBO0FBQ2hCLGdEQUFnRTtBQUFyQyxrQ0FBQSxVQUFVLENBQUE7QUFDckMsd0NBU3VCO0FBRHRCLDhCQUFBLFVBQVUsQ0FBQTtBQUVYLHNDQUEwQztBQUFsQyx3QkFBQSxLQUFLLENBQUE7QUFBRSx3QkFBQSxLQUFLLENBQUE7QUFDcEIsc0NBZ0JzQjtBQWZyQixpQ0FBQSxjQUFjLENBQUE7QUFDZCwrQkFBQSxZQUFZLENBQUE7QUFDWiwrQkFBQSxZQUFZLENBQUE7QUFDWiw2QkFBQSxVQUFVLENBQUE7QUFDViw2QkFBQSxVQUFVLENBQUE7QUFDVixnQ0FBQSxhQUFhLENBQUE7QUFFYix1QkFBQSxJQUFJLENBQUE7QUFDSiw4QkFBQSxXQUFXLENBQUE7QUFDWCx3QkFBQSxLQUFLLENBQUE7QUFDTCxnQ0FBQSxhQUFhLENBQUE7QUFDYiw4QkFBQSxXQUFXLENBQUE7QUFDWCwrQkFBQSxZQUFZLENBQUE7QUFDWiw4QkFBQSxXQUFXLENBQUEiLCJmaWxlIjoiY29yZS5qcyIsInNvdXJjZVJv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PcHRpb25zLFxuXHRRdWVyeU9wdGlvbnMsXG5cdFBvdGlvbk9wdGlvbnMsXG5cdFBvdGlvblJlc3BvbnNlLFxuXHRQb3Rpb25CYXNlXG59IGZyb20gJy4vY29yZS9wb3Rpb24nO1xuZXhwb3J0IHtSb3V0ZSwgcm91dGV9IGZyb20gJy4vY29yZS9yb3V0ZSc7XG5leHBvcnQge1xuXHRmaW5kUG90aW9uUmVzb3VyY2UsXG5cdGZyb21TY2hlbWFKU09OLFxuXHRnZXRQb3Rpb25JRCxcblx0Z2V0UG90aW9uVVJJLFxuXHRoYXNUeXBlQW5kSWQsXG5cdGlzRnVuY3Rpb24sXG5cdGlzSnNPYmplY3QsXG5cdGlzT2JqZWN0RW1wdHksXG5cdGlzUG90aW9uVVJJLFxuXHRLZXlNYXBGdW5jdGlvbixcblx0b21hcCxcblx0bWVyZ2UsXG5cdHBhcnNlUG90aW9uSUQsXG5cdHRvQ2FtZWxDYXNlLFxuXHR0b1BvdGlvbkpTT04sXG5cdHRvU25ha2VDYXNlLFxuXHRWYWx1ZU1hcEZ1bmN0aW9uXG59IGZyb20gJy4vY29yZS91dGlscyc7XG4iXX0=

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":3,"metadata":{},"exports":[{"from":"./core/item","export":["ItemOptions","Item"]},{"from":"./core/metadata","export":["readonly"]},{"from":"./core/pagination","export":["PaginationOptions","Pagination"]},{"from":"./core/potion","export":["ItemCache","URLSearchParams","RequestOptions","FetchOptions","QueryOptions","PotionOptions","PotionResponse","PotionBase"]},{"from":"./core/route","export":["Route","route"]},{"from":"./core/utils","export":["fromSchemaJSON","getPotionURI","hasTypeAndId","isFunction","isJsObject","isObjectEmpty","KeyMapFunction","omap","mapToObject","merge","parsePotionID","toCamelCase","toPotionJSON","toSnakeCase","ValueMapFunction"]}]},{"__symbolic":"module","version":1,"metadata":{},"exports":[{"from":"./core/item","export":["ItemOptions","Item"]},{"from":"./core/metadata","export":["readonly"]},{"from":"./core/pagination","export":["PaginationOptions","Pagination"]},{"from":"./core/potion","export":["ItemCache","URLSearchParams","RequestOptions","FetchOptions","QueryOptions","PotionOptions","PotionResponse","PotionBase"]},{"from":"./core/route","export":["Route","route"]},{"from":"./core/utils","export":["fromSchemaJSON","getPotionURI","hasTypeAndId","isFunction","isJsObject","isObjectEmpty","KeyMapFunction","omap","mapToObject","merge","parsePotionID","toCamelCase","toPotionJSON","toSnakeCase","ValueMapFunction"]}]}]
[{"__symbolic":"module","version":3,"metadata":{},"exports":[{"from":"./core/item","export":["ItemOptions","Item"]},{"from":"./core/metadata","export":["readonly"]},{"from":"./core/pagination","export":["Pagination"]},{"from":"./core/potion","export":["ItemCache","URLSearchParams","RequestOptions","FetchExtras","FetchOptions","QueryOptions","PotionOptions","PotionResponse","PotionBase"]},{"from":"./core/route","export":["Route","route"]},{"from":"./core/utils","export":["findPotionResource","fromSchemaJSON","getPotionID","getPotionURI","hasTypeAndId","isFunction","isJsObject","isObjectEmpty","isPotionURI","KeyMapFunction","omap","merge","parsePotionID","toCamelCase","toPotionJSON","toSnakeCase","ValueMapFunction"]}]},{"__symbolic":"module","version":1,"metadata":{},"exports":[{"from":"./core/item","export":["ItemOptions","Item"]},{"from":"./core/metadata","export":["readonly"]},{"from":"./core/pagination","export":["Pagination"]},{"from":"./core/potion","export":["ItemCache","URLSearchParams","RequestOptions","FetchExtras","FetchOptions","QueryOptions","PotionOptions","PotionResponse","PotionBase"]},{"from":"./core/route","export":["Route","route"]},{"from":"./core/utils","export":["findPotionResource","fromSchemaJSON","getPotionID","getPotionURI","hasTypeAndId","isFunction","isJsObject","isObjectEmpty","isPotionURI","KeyMapFunction","omap","merge","parsePotionID","toCamelCase","toPotionJSON","toSnakeCase","ValueMapFunction"]}]}]

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

import { FetchOptions, QueryOptions } from './potion';
import { QueryOptions, RequestOptions } from './potion';
import { Pagination } from './pagination';

@@ -37,3 +37,3 @@ export interface ItemOptions {

*/
static fetch<T extends Item>(id: number | string, {cache}?: FetchOptions): Promise<T>;
static fetch<T extends Item>(id: number | string, {cache}?: RequestOptions): Promise<T>;
/**

@@ -46,3 +46,3 @@ * Query resources.

*/
static query<T extends Item>(queryOptions?: QueryOptions | null, {paginate, cache}?: FetchOptions): Promise<T[] | Pagination<T>>;
static query<T extends Item>(queryOptions?: QueryOptions | null, {paginate, cache}?: RequestOptions): Promise<T[] | Pagination<T>>;
/**

@@ -49,0 +49,0 @@ * Get the first item.

@@ -163,2 +163,2 @@ "use strict";

exports.Item = Item;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb3JlL2l0ZW0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSx1Q0FBaUU7QUFVakU7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztHQXdCRztBQUNIO0lBNkNDOzs7T0FHRztJQUNILGNBQVksVUFBb0I7UUFBcEIsMkJBQUEsRUFBQSxlQUFvQjtRQU54QixRQUFHLEdBQTJCLElBQUksQ0FBQztRQU8xQyxNQUFNLENBQUMsTUFBTSxDQUFDLElBQUksRUFBRSxVQUFVLENBQUMsQ0FBQztJQUNqQyxDQUFDO0lBbEREOzs7O09BSUc7SUFDSSxVQUFLLEdBQVosVUFBNkIsRUFBbUIsRUFBRSxFQUFpQztZQUFoQyxvQ0FBWSxFQUFaLGlDQUFZO1FBQzlELElBQU0sR0FBRyxHQUFXLG9CQUFTLENBQUMsSUFBSSxDQUFDLENBQUM7UUFDcEMsTUFBTSxDQUFDLHlCQUFjLENBQUMsSUFBSSxDQUFDLENBQUMsS0FBSyxDQUFJLEdBQUcsU0FBSSxFQUFJLEVBQUU7WUFDakQsTUFBTSxFQUFFLEtBQUs7WUFDYixLQUFLLE9BQUE7U0FDTCxDQUFDLENBQUM7SUFDSixDQUFDO0lBRUQ7Ozs7OztPQU1HO0lBQ0ksVUFBSyxHQUFaLFVBQTZCLFlBQWtDLEVBQU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ZWFyQ2FjaGUoKTogdm9pZCB7XG5cdFx0XHQvLyBDbGVhciB0aGUgaXRlbSBmcm9tIGNhY2hlIGlmIGV4aXN0c1xuXHRcdFx0aWYgKGNhY2hlLmdldCh1cmkpKSB7XG5cdFx0XHRcdGNhY2hlLnJlbW92ZSh1cmkpO1xuXHRcdFx0fVxuXHRcdH1cblx0fVxufVxuIl19
import { FetchOptions, PotionBase } from './potion';
import { Item } from './item';
export interface PaginationOptions {
page?: number;
perPage?: number;
}
/**

@@ -21,6 +17,6 @@ * Array like class with resources.

export declare class Pagination<T extends Item> extends Array<T> {
private options;
static readonly [Symbol.species]: typeof Pagination;
private potion;
private uri;
private options;
private $page;

@@ -32,3 +28,3 @@ private $perPage;

uri: string;
}, items: T[], count: string, options?: FetchOptions);
}, items: T[], count: string, options: FetchOptions);
page: number;

@@ -35,0 +31,0 @@ readonly perPage: number;

@@ -12,2 +12,10 @@ "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 });

@@ -32,2 +40,3 @@ /**

var _this = _super.apply(this, items) || this;
_this.options = options;
// Set the prototype explicitly.

@@ -39,5 +48,4 @@ // NOTE: This is necessary and recommended: https://github.com/Microsoft/TypeScript/wiki/FAQ#why-doesnt-extending-built-ins-like-error-array-and-map-work.

_this.uri = uri;
_this.options = options || {};
// tslint:disable-next-line:no-magic-numbers
var _b = _this.options.search || {}, _c = _b.page, page = _c === void 0 ? 1 : _c, _d = _b.perPage, perPage = _d === void 0 ? 25 : _d;
// 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;

@@ -88,8 +96,16 @@ _this.$perPage = perPage;

Pagination.prototype.changePageTo = function (page) {
var pagination = this.options.pagination;
this.options.search.page = page;
this.$page = page;
return this.potion.fetch(this.uri, this.options, this);
return this.potion.fetch(this.uri, this.options, {
pagination: pagination
});
};
Pagination.prototype.update = function (items, count) {
this.splice.apply(this, [0, this.length].concat(items));
// 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;
}
this.$total = count;

@@ -109,2 +125,2 @@ return this;

exports.Pagination = Pagination;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb3JlL3BhZ2luYXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7O0FBVUE7Ozs7Ozs7Ozs7OztHQVlHO0FBQ0g7SUFBZ0QsOEJBQVE7SUFhdkQsb0JBQVksRUFBZ0QsRUFBRSxLQUFVLEVBQUUsS0FBYSxFQUFFLE9BQXNCO1lBQWxHLGtCQUFNLEVBQUUsWUFBRztRQUF4QiwrQkFDVSxLQUFLLFVBZWQ7UUFkQSxnQ0FBZ0M7UUFDaEMsMEpBQTBKO1FBQzFKLCtHQUErRztRQUMvRyxNQUFNLENBQUMsY0FBYyxDQUFDLEtBQUksRUFBRSxVQUFVLENBQUMsU0FBUyxDQUFDLENBQUM7UUFFbEQsS0FBSSxDQUFDLE1BQU0sR0FBRyxNQUFNLENBQUM7UUFDckIsS0FBSSxDQUFDLEdBQUcsR0FBRyxHQUFHLENBQUM7UUFDZixLQUFJLENBQUMsT0FBTyxHQUFHLE9BQU8sSUFBSSxFQUFFLENBQUM7UUFFN0IsNENBQTRDO1FBQ3RDLElBQUEsK0JBQXlELEVBQXhELFlBQVEsRUFBUiw2QkFBUSxFQUFFLGVBQVksRUFBWixpQ0FBWSxDQUFtQztRQUNoRSxLQUFJLENBQUMsS0FBSyxHQUFHLEl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0YW5jZSBvZiB0aGlzLFxuXHRcdC8vIHRodXMgd2UgaXRlcmF0ZSBhbmQgcmVwbGFjZSBhdCBpbmRleCBpbnN0ZWFkLlxuXHRcdGZvciAoY29uc3QgW2luZGV4LCBpdGVtXSBvZiBBcnJheS5mcm9tKGl0ZW1zLmVudHJpZXMoKSkpIHtcblx0XHRcdHRoaXNbaW5kZXhdID0gaXRlbTtcblx0XHR9XG5cblx0XHR0aGlzLiR0b3RhbCA9IGNvdW50O1xuXHRcdHJldHVybiB0aGlzO1xuXHR9XG5cblx0LyoqXG5cdCAqIFRoaXMgd2lsbCBiZSByZW1vdmVkIGFzIHRoaXMgY2xhc3MgaXMgaXRlcmFibGUuXG5cdCAqIEBkZXByZWNhdGVkXG5cdCAqL1xuXHQvLyBUT0RPOiBSZW1vdmUgdGhpc1xuXHR0b0FycmF5KCk6IFRbXSB7XG5cdFx0cmV0dXJuIHRoaXM7XG5cdH1cbn1cbiJdfQ==

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":3,"metadata":{"PaginationOptions":{"__symbolic":"interface"},"Pagination":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"Array"},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Expression form not supported","line":36,"character":28},{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":36,"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":{"PaginationOptions":{"__symbolic":"interface"},"Pagination":{"__symbolic":"class","extends":{"__symbolic":"reference","name":"Array"},"arity":1,"members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"error","message":"Expression form not supported","line":36,"character":28},{"__symbolic":"reference","name":"Array","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":36,"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","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"}]}}}}]
import { Item, ItemOptions } from './item';
import { Pagination, PaginationOptions } from './pagination';
import { Pagination } from './pagination';
/**

@@ -26,13 +26,18 @@ * Item cache.

method?: string;
search?: URLSearchParams | null;
search?: URLSearchParams | QueryOptions | null;
data?: any;
cache?: boolean;
}
export interface FetchOptions extends RequestOptions {
paginate?: boolean;
}
export interface QueryOptions extends PaginationOptions {
export interface QueryOptions {
page?: number;
perPage?: number;
where?: any;
sort?: any;
}
export interface FetchExtras {
pagination?: Pagination<any>;
origin?: string[];
}
export declare type FetchOptions = FetchExtras & RequestOptions;
export interface PotionResponse {

@@ -47,2 +52,5 @@ data: any;

}
export interface PotionResources {
[key: string]: typeof Item;
}
/**

@@ -62,5 +70,3 @@ * This class contains the main logic for interacting with the Flask Potion backend.

export declare abstract class PotionBase {
readonly resources: {
[key: string]: Item;
};
readonly resources: PotionResources;
readonly cache: ItemCache<Item>;

@@ -70,5 +76,4 @@ host: string;

private readonly Promise;
private pendingGETRequests;
private requests;
constructor({host, prefix, cache}?: PotionOptions);
fetch(uri: string, fetchOptions?: FetchOptions, pagination?: Pagination<any>): Promise<Item | Item[] | Pagination<Item> | any>;
/**

@@ -80,3 +85,3 @@ * Register a resource.

*/
register(uri: string, resource: any, options?: ItemOptions): Item;
register(uri: string, resource: typeof Item, options?: ItemOptions): typeof Item;
/**

@@ -99,7 +104,9 @@ * Register a resource.

protected abstract request(uri: string, options?: RequestOptions): Promise<PotionResponse>;
fetch(uri: string, requestOptions?: RequestOptions, extras?: FetchExtras): Promise<Item | Item[] | Pagination<Item> | any>;
private resolve(uri, options);
private serialize(options);
private deserialize({data, headers}, uri, options, pagination?);
private fromPotionJSON(json);
private deserialize({data, headers}, uri, options);
private fromPotionJSON(json, origin);
private parsePotionJSONProperties(json, origin);
private parseURI({$ref, $uri, $type, $id});
private parsePotionJSONProperties(json, properties?);
}

@@ -33,3 +33,3 @@ "use strict";

this.Promise = metadata_1.potionPromise(this); // NOTE: This is needed only to provide support for AngularJS.
this.pendingGETRequests = new Map();
this.requests = new Map();
this.cache = cache || new utils_1.MemCache();

@@ -39,41 +39,2 @@ this.host = host;

}
PotionBase.prototype.fetch = function (uri, fetchOptions, pagination) {
var _this = this;
var options = __assign({}, fetchOptions);
var method = options.method, cache = options.cache, paginate = options.paginate, search = options.search;
var key = uri;
var Promise = this.Promise;
// Add the API prefix if not present
uri = utils_1.addPrefixToURI(uri, this.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, pagination); }); };
// TODO: Cache requests for queries with params as well,
// we just need to create a hash key for the request (uri + search params).
if (method === 'GET' && !paginate && !search) {
// If a GET request was made and {cache: true} return the item from cache (if it exists).
// NOTE: Queries are not cached.
if (cache && this.cache.has(key)) {
return this.cache.get(key);
}
// Cache the request so that further requests for the same resource will not make an aditional XHR.
if (!this.pendingGETRequests.has(uri)) {
this.pendingGETRequests.set(uri, fetch().then(function (data) {
_this.pendingGETRequests.delete(uri);
return data;
}, function (err) {
// If request fails,
// make sure to remove the pending request so further requests can be made,
// but fail the pipeline.
_this.pendingGETRequests.delete(uri);
var message = utils_1.getErrorMessage(err, uri);
return Promise.reject(message);
}));
}
return this.pendingGETRequests.get(uri);
}
else {
return fetch();
}
};
/**

@@ -110,2 +71,52 @@ * Register a resource.

};
// 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: [] });
if (utils_1.isPotionURI(uri, this.resources)) {
Object.assign(options, {
origin: [origin]
});
}
return this.resolve(uri, options)
.then(function (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);
// 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); }); };
if (options.method === 'GET' && !options.paginate && !options.search) {
// If a GET request was made and {cache: true} return the item from cache (if it exists).
// NOTE: Queries are not cached.
if (options.cache && this.cache.has(cacheKey)) {
return this.cache.get(cacheKey);
}
// Cache the request so that further requests for the same resource will not make an aditional XHR.
if (!this.requests.has(cacheKey)) {
this.requests.set(cacheKey, fetch().then(function (data) {
_this.requests.delete(cacheKey);
return data;
}, function (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);
return Promise.reject(message);
}));
}
return this.requests.get(cacheKey);
}
else {
return fetch();
}
};
PotionBase.prototype.serialize = function (options) {

@@ -119,16 +130,17 @@ var prefix = this.prefix;

};
PotionBase.prototype.deserialize = function (_a, uri, options, pagination) {
PotionBase.prototype.deserialize = function (_a, uri, options) {
var _this = this;
var data = _a.data, headers = _a.headers;
return this.fromPotionJSON(data)
return this.fromPotionJSON(data, options.origin)
.then(function (json) {
// Return or update Pagination
// TODO: Refactor this, looks messy (pagination logic should be handled in the Pagination class)
// If {paginate} is enabled, return or update Pagination.
if (options.paginate) {
var count = headers['x-total-count'] || json.length;
if (!pagination) {
return new pagination_1.Pagination({ uri: uri, potion: _this }, json, count, options);
if (options.pagination instanceof pagination_1.Pagination) {
return options.pagination.update(json, count);
}
else {
return pagination.update(json, count);
var pagination = new pagination_1.Pagination({ uri: uri, potion: _this }, json, count, options);
Object.assign(options, { pagination: pagination });
return pagination;
}

@@ -139,3 +151,3 @@ }

};
PotionBase.prototype.fromPotionJSON = function (json) {
PotionBase.prototype.fromPotionJSON = function (json, origin) {
var _this = this;

@@ -145,3 +157,3 @@ var Promise = this.Promise;

if (Array.isArray(json)) {
return Promise.all(json.map(function (item) { return _this.fromPotionJSON(item); }));
return Promise.all(json.map(function (item) { return _this.fromPotionJSON(item, origin); }));
}

@@ -154,10 +166,11 @@ else if (typeof json.$uri === 'string' || utils_1.hasTypeAndId(json)) {

var resource = _a.resource, id = _a.id, uri = _a.uri;
var properties = new Map();
// NOTE: {id}
properties.set('$id', id);
properties.set('$uri', uri);
var unpack = _this.parsePotionJSONProperties(json, properties);
var attrs = { $id: id, $uri: uri };
// Since we have a resource, we append to origin list (because later it will get replaced with itself).
if (!origin.includes(uri)) {
origin.push(uri);
}
var 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, unpack.then(function (properties) { return Reflect.construct(resource, [properties]); }));
return _this.cache.put(uri, properties.then(function (properties) { return Reflect.construct(resource, [__assign({}, properties, attrs)]); }));
}

@@ -167,6 +180,6 @@ else {

// update it with new properties.
return Promise.all([unpack, _this.cache.get(uri)])
return Promise.all([properties, _this.cache.get(uri)])
.then(function (_a) {
var properties = _a[0], item = _a[1];
Object.assign(item, properties);
Object.assign(item, properties, attrs);
return item;

@@ -193,5 +206,9 @@ });

var uri = _a.uri;
return _this.fetch(uri, {
if (origin.includes(uri)) {
return Promise.resolve(utils_1.toSelfReference(uri));
}
return _this.resolve(uri, {
cache: true,
method: 'GET'
method: 'GET',
origin: origin
});

@@ -205,3 +222,3 @@ });

}
return this.parsePotionJSONProperties(json);
return this.parsePotionJSONProperties(json, origin);
}

@@ -212,2 +229,24 @@ else {

};
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);
});
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;
}, {}); });
};
// Try to parse a Potion URI and find the associated resource for it,

@@ -219,7 +258,3 @@ // otherwise return a rejected promise.

var uri = utils_1.removePrefixFromURI(utils_1.getPotionURI({ $ref: $ref, $uri: $uri, $type: $type, $id: $id }), this.prefix);
var entry = utils_1.entries(this.resources)
.find(function (_a) {
var resourceURI = _a[0];
return uri.indexOf(resourceURI + "/") === 0;
});
var entry = utils_1.findPotionResource(uri, this.resources);
if (!entry) {

@@ -229,3 +264,3 @@ return Promise.reject(new Error("URI '" + uri + "' is an uninterpretable or unknown Potion resource."));

else {
var resourceURI = entry[0], resource = entry[1];
var resourceURI = entry.resourceURI, resource = entry.resource;
var params = { resource: resource, uri: uri };

@@ -237,6 +272,4 @@ var id = utils_1.parsePotionID($id);

else {
var part = uri.substring(resourceURI.length + 1)
.split('/')[0];
Object.assign(params, {
id: utils_1.parsePotionID(part)
id: utils_1.getPotionID(uri, resourceURI)
});

@@ -247,23 +280,5 @@ }

};
PotionBase.prototype.parsePotionJSONProperties = function (json, properties) {
if (properties === void 0) { properties = new Map(); }
var Promise = this.Promise;
var promises = [];
var _loop_1 = function (key, value) {
promises.push(this_1.fromPotionJSON(value).then(function (value) {
properties.set(utils_1.toCamelCase(key), value);
return value;
}));
};
var this_1 = this;
for (var _i = 0, _a = utils_1.entries(json); _i < _a.length; _i++) {
var _b = _a[_i], key = _b[0], value = _b[1];
_loop_1(key, value);
}
return Promise.all(promises)
.then(function () { return utils_1.mapToObject(properties); });
};
return PotionBase;
}());
exports.PotionBase = PotionBase;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb3JlL3BvdGlvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsd0NBQXdDO0FBQ3hDLHVDQUtvQjtBQUVwQiwyQ0FBMkQ7QUFDM0QsaUNBYWlCO0FBMkRqQjs7Ozs7Ozs7Ozs7O0dBWUc7QUFDSDtJQVNDLG9CQUFZLEVBQW1EO1lBQW5ELDRCQUFtRCxFQUFsRCxZQUFTLEVBQVQsOEJBQVMsRUFBRSxjQUFXLEVBQVgsZ0NBQVcsRUFBRSxnQkFBSztRQVJqQyxjQUFTLEdBQTBCLEVBQUUsQ0FBQztRQUs5QixZQUFPLEdBQW1CLHdCQUFhLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyw4REFBOEQ7UUFDdEgsdUJBQWtCLEdBQXFCLElBQUksR0FBRyxFQUFFLENBQUM7UUFHeEQsSUFB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XJzZWRVUkk+IHtcblx0XHRjb25zdCB7UHJvbWlzZX0gPSB0aGlzO1xuXHRcdGNvbnN0IHVyaSA9IHJlbW92ZVByZWZpeEZyb21VUkkoZ2V0UG90aW9uVVJJKHskcmVmLCAkdXJpLCAkdHlwZSwgJGlkfSksIHRoaXMucHJlZml4KTtcblx0XHRjb25zdCBlbnRyeSA9IGZpbmRQb3Rpb25SZXNvdXJjZSh1cmksIHRoaXMucmVzb3VyY2VzKTtcblxuXHRcdGlmICghZW50cnkpIHtcblx0XHRcdHJldHVybiBQcm9taXNlLnJlamVjdChuZXcgRXJyb3IoYFVSSSAnJHt1cml9JyBpcyBhbiB1bmludGVycHJldGFibGUgb3IgdW5rbm93biBQb3Rpb24gcmVzb3VyY2UuYCkpO1xuXHRcdH0gZWxzZSB7XG5cdFx0XHRjb25zdCB7cmVzb3VyY2VVUkksIHJlc291cmNlfSA9IGVudHJ5O1xuXHRcdFx0Y29uc3QgcGFyYW1zID0ge3Jlc291cmNlLCB1cml9O1xuXHRcdFx0Y29uc3QgaWQgPSBwYXJzZVBvdGlvbklEKCRpZCk7XG5cblx0XHRcdGlmIChpZCAhPT0gbnVsbCkge1xuXHRcdFx0XHRPYmplY3QuYXNzaWduKHBhcmFtcywge2lkfSk7XG5cdFx0XHR9IGVsc2Uge1xuXHRcdFx0XHRPYmplY3QuYXNzaWduKHBhcmFtcywge1xuXHRcdFx0XHRcdGlkOiBnZXRQb3Rpb25JRCh1cmksIHJlc291cmNlVVJJKVxuXHRcdFx0XHR9KTtcblx0XHRcdH1cblxuXHRcdFx0cmV0dXJuIFByb21pc2UucmVzb2x2ZShwYXJhbXMpO1xuXHRcdH1cblx0fVxufVxuIl19

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":3,"metadata":{"ItemCache":{"__symbolic":"interface"},"ParsedURI":{"__symbolic":"interface"},"URLSearchParams":{"__symbolic":"interface"},"RequestOptions":{"__symbolic":"interface"},"FetchOptions":{"__symbolic":"interface"},"QueryOptions":{"__symbolic":"interface"},"PotionResponse":{"__symbolic":"interface"},"PotionOptions":{"__symbolic":"interface"},"PotionBase":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}],"fetch":[{"__symbolic":"method"}],"register":[{"__symbolic":"method"}],"registerAs":[{"__symbolic":"method"}],"request":[{"__symbolic":"method"}],"serialize":[{"__symbolic":"method"}],"deserialize":[{"__symbolic":"method"}],"fromPotionJSON":[{"__symbolic":"method"}],"parseURI":[{"__symbolic":"method"}],"parsePotionJSONProperties":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"ItemCache":{"__symbolic":"interface"},"ParsedURI":{"__symbolic":"interface"},"URLSearchParams":{"__symbolic":"interface"},"RequestOptions":{"__symbolic":"interface"},"FetchOptions":{"__symbolic":"interface"},"QueryOptions":{"__symbolic":"interface"},"PotionResponse":{"__symbolic":"interface"},"PotionOptions":{"__symbolic":"interface"},"PotionBase":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}],"fetch":[{"__symbolic":"method"}],"register":[{"__symbolic":"method"}],"registerAs":[{"__symbolic":"method"}],"request":[{"__symbolic":"method"}],"serialize":[{"__symbolic":"method"}],"deserialize":[{"__symbolic":"method"}],"fromPotionJSON":[{"__symbolic":"method"}],"parseURI":[{"__symbolic":"method"}],"parsePotionJSONProperties":[{"__symbolic":"method"}]}}}}]
[{"__symbolic":"module","version":3,"metadata":{"ItemCache":{"__symbolic":"interface"},"ParsedURI":{"__symbolic":"interface"},"URLSearchParams":{"__symbolic":"interface"},"RequestOptions":{"__symbolic":"interface"},"QueryOptions":{"__symbolic":"interface"},"FetchExtras":{"__symbolic":"interface"},"PotionResponse":{"__symbolic":"interface"},"PotionOptions":{"__symbolic":"interface"},"PotionResources":{"__symbolic":"interface"},"PotionBase":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}],"register":[{"__symbolic":"method"}],"registerAs":[{"__symbolic":"method"}],"request":[{"__symbolic":"method"}],"fetch":[{"__symbolic":"method"}],"resolve":[{"__symbolic":"method"}],"serialize":[{"__symbolic":"method"}],"deserialize":[{"__symbolic":"method"}],"fromPotionJSON":[{"__symbolic":"method"}],"parsePotionJSONProperties":[{"__symbolic":"method"}],"parseURI":[{"__symbolic":"method"}]}}}},{"__symbolic":"module","version":1,"metadata":{"ItemCache":{"__symbolic":"interface"},"ParsedURI":{"__symbolic":"interface"},"URLSearchParams":{"__symbolic":"interface"},"RequestOptions":{"__symbolic":"interface"},"QueryOptions":{"__symbolic":"interface"},"FetchExtras":{"__symbolic":"interface"},"PotionResponse":{"__symbolic":"interface"},"PotionOptions":{"__symbolic":"interface"},"PotionResources":{"__symbolic":"interface"},"PotionBase":{"__symbolic":"class","members":{"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","name":"any"}]}],"register":[{"__symbolic":"method"}],"registerAs":[{"__symbolic":"method"}],"request":[{"__symbolic":"method"}],"fetch":[{"__symbolic":"method"}],"resolve":[{"__symbolic":"method"}],"serialize":[{"__symbolic":"method"}],"deserialize":[{"__symbolic":"method"}],"fromPotionJSON":[{"__symbolic":"method"}],"parsePotionJSONProperties":[{"__symbolic":"method"}],"parseURI":[{"__symbolic":"method"}]}}}}]

@@ -1,3 +0,3 @@

import { FetchOptions, RequestOptions } from './potion';
export declare type RouteType<T> = (params?: any, options?: FetchOptions) => Promise<T>;
import { RequestOptions } from './potion';
export declare type RouteType<T> = (params?: any, options?: RequestOptions) => Promise<T>;
export declare function route<T>(path: string, {method}?: RequestOptions): RouteType<T>;

@@ -4,0 +4,0 @@ /**

@@ -63,2 +63,2 @@ "use strict";

};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb3JlL3JvdXRlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7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KTtcblx0fSxcblx0UE9TVDxUPih1cmk6IHN0cmluZyk6IFJvdXRlVHlwZTxUPiB7XG5cdFx0cmV0dXJuIHJvdXRlPFQ+KHVyaSwge1xuXHRcdFx0bWV0aG9kOiAnUE9TVCdcblx0XHR9KTtcblx0fSxcblx0UEFUQ0g8VD4odXJpOiBzdHJpbmcpOiBSb3V0ZVR5cGU8VD4ge1xuXHRcdHJldHVybiByb3V0ZTxUPih1cmksIHtcblx0XHRcdG1ldGhvZDogJ1BBVENIJ1xuXHRcdH0pO1xuXHR9LFxuXHRQVVQ8VD4odXJpOiBzdHJpbmcpOiBSb3V0ZVR5cGU8VD4ge1xuXHRcdHJldHVybiByb3V0ZTxUPih1cmksIHtcblx0XHRcdG1ldGhvZDogJ1BVVCdcblx0XHR9KTtcblx0fVxufTtcbiJdfQ==
import { Item } from './item';
import { ItemCache } from './potion';
import { ItemCache, PotionResources } from './potion';
/**

@@ -12,12 +12,9 @@ * Camel case to snake case

/**
* Transform a Map to Object
*/
export declare function mapToObject(map: Map<any, any>): {
[key: string]: any;
};
/**
* Object type guard
* Docs: https://www.typescriptlang.org/docs/handbook/advanced-types.html
*/
export declare function isJsObject(value: any): value is {};
export declare function isJsObject(value: any): value is {
[key: string];
any;
};
/**

@@ -56,3 +53,25 @@ * Check if an object is empty

};
export declare class SelfReference {
readonly $uri: string;
constructor($uri: string);
matches(uri: any): boolean;
}
/**
* Walk through Potion JSON and replace SelfReference objects from the roots (roots are just a lost of Potion item references).
* NOTE: This method mutates values and adds an extra key to objects ({$skip} - for preventing a stackoverflow exception).
* @param json - Any value to walk through.
* @param {Array<Item>} roots - A list of Potion items found in the passed JSON.
*/
export declare function replaceSelfReferences(json: any, roots: Item[]): any;
/**
* Recursively find every object with {uri} (a Potion item usually) and return a list with all.
* @param json - A Potion JSON.
* @return {Array<Item>}
*/
export declare function findRoots(json: any): Item[];
/**
* Generate a self reference
*/
export declare function toSelfReference(uri: string): SelfReference;
/**
* Convert an Object to Potion JSON

@@ -63,7 +82,23 @@ */

};
export declare type PotionID = string | number | null;
/**
* Parse a Potion ID
*/
export declare function parsePotionID(id: any): string | number | null;
export declare function parsePotionID(id: any): PotionID;
/**
* Get a Potion ID from a URI
*/
export declare function getPotionID(uri: string, resourceURI: string): PotionID;
/**
* Find a Potion resource based on URI
*/
export declare function findPotionResource(uri: string, resources: PotionResources): {
resourceURI: string;
resource: typeof Item;
} | undefined;
/**
* Check if some string is a Potion URI
*/
export declare function isPotionURI(uri: string, resources: PotionResources): boolean;
/**
* Get the Potion URI from a Potion JSON object

@@ -92,6 +127,2 @@ */

/**
* Transform an Object or Map to pairs of [key, value].
*/
export declare function entries<K, V>(object: any): Array<[K, V]>;
/**
* In-Memory cache

@@ -98,0 +129,0 @@ * Will be used by default by Potion for caching resources.

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
// tslint:disable: max-classes-per-file
var item_1 = require("./item");
var pagination_1 = require("./pagination");
/**

@@ -21,14 +23,2 @@ * Camel case to snake case

/**
* Transform a Map to Object
*/
function mapToObject(map) {
var obj = {};
for (var _i = 0, _a = entries(map); _i < _a.length; _i++) {
var _b = _a[_i], key = _b[0], value = _b[1];
obj[key] = value;
}
return obj;
}
exports.mapToObject = mapToObject;
/**
* Object type guard

@@ -38,3 +28,3 @@ * Docs: https://www.typescriptlang.org/docs/handbook/advanced-types.html

function isJsObject(value) {
return typeof value === 'object' && !Array.isArray(value) && value !== null;
return typeof value === 'object' && value !== null;
}

@@ -66,3 +56,3 @@ exports.isJsObject = isJsObject;

function omap(obj, keyMapFunction, valueMapFunction) {
if (isJsObject(obj)) {
if (isJsObject(obj) && !Array.isArray(obj)) {
return Object.entries(obj)

@@ -107,3 +97,3 @@ .map(function (_a) {

else if (isJsObject(json)) {
return entries(json)
return Object.entries(json)
.map(function (_a) {

@@ -122,7 +112,114 @@ var key = _a[0], value = _a[1];

exports.fromSchemaJSON = fromSchemaJSON;
var SelfReference = (function () {
function SelfReference($uri) {
this.$uri = $uri;
}
SelfReference.prototype.matches = function (uri) {
return this.$uri === uri;
};
return SelfReference;
}());
exports.SelfReference = SelfReference;
/**
* Walk through Potion JSON and replace SelfReference objects from the roots (roots are just a lost of Potion item references).
* NOTE: This method mutates values and adds an extra key to objects ({$skip} - for preventing a stackoverflow exception).
* @param json - Any value to walk through.
* @param {Array<Item>} roots - A list of Potion items found in the passed JSON.
*/
// TODO: Improve performance of this
function replaceSelfReferences(json, roots) {
if (typeof json !== 'object' || json === null) {
return json;
}
else if (json.$skip) {
// If the object we want to walk through is a ref we already replaced, just skip it.
return json;
}
else if (json instanceof pagination_1.Pagination) {
var pagination = json.update(json.map(function (value) { return replaceSelfReferences(value, roots); }), json.total);
return Object.assign(pagination, { $skip: true });
}
else if (Array.isArray(json)) {
var list = json.map(function (value) { return replaceSelfReferences(value, roots); });
return Object.assign(list, { $skip: true });
}
else if (json instanceof SelfReference) {
// Find the ref in the roots.
return roots.find(function (item) { return json.matches(item.uri); });
}
else if (Object.keys(json).length > 0) {
var _loop_1 = function (key, value) {
if (value instanceof SelfReference) {
var ref = roots.find(function (item) { return value.matches(item.uri); });
Object.assign(ref, { $skip: true });
Object.assign(json, (_a = {},
_a[key] = ref,
_a));
}
else if (isJsObject(value)) {
Object.assign(json, (_b = {},
_b[key] = replaceSelfReferences(value, roots),
_b));
}
var _a, _b;
};
// NOTE: Object.keys() will only work for custom classes or objects builtins will be empty, which is what we want.
// NOTE: Arrays will also work with Object.keys() and return the indexes.
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);
}
return json;
}
return json;
}
exports.replaceSelfReferences = replaceSelfReferences;
/**
* Recursively find every object with {uri} (a Potion item usually) and return a list with all.
* @param json - A Potion JSON.
* @return {Array<Item>}
*/
function findRoots(json) {
var roots = [];
if (Array.isArray(json) || json instanceof pagination_1.Pagination) {
for (var _i = 0, json_1 = json; _i < json_1.length; _i++) {
var value = json_1[_i];
roots.push.apply(roots, findRoots(value));
}
}
else if (isJsObject(json) && Object.keys(json).length > 0) {
if (json.uri) {
roots.push(json);
}
for (var _a = 0, _b = Object.values(json); _a < _b.length; _a++) {
var value = _b[_a];
roots.push.apply(roots, findRoots(value));
}
}
// Remove duplicate entries.
var result = [];
var _loop_2 = function (root) {
if (result.findIndex(function (item) { return root.uri === item.uri; }) === -1) {
result.push(root);
}
};
for (var _c = 0, roots_1 = roots; _c < roots_1.length; _c++) {
var root = roots_1[_c];
_loop_2(root);
}
return result;
}
exports.findRoots = findRoots;
/**
* Generate a self reference
*/
function toSelfReference(uri) {
return new SelfReference(uri);
}
exports.toSelfReference = toSelfReference;
/**
* Convert an Object to Potion JSON
*/
function toPotionJSON(json, prefix) {
if (typeof json === 'object' && json !== null) {
if (isJsObject(json)) {
if (json instanceof item_1.Item && typeof json.uri === 'string') {

@@ -146,3 +243,3 @@ return { $ref: "" + addPrefixToURI(json.uri, prefix) };

function parsePotionID(id) {
if (typeof id === 'string') {
if (typeof id === 'string' && id.length > 0) {
return /^\d+$/.test(id) ? parseInt(id, 10) : id;

@@ -157,2 +254,45 @@ }

/**
* Get a Potion ID from a URI
*/
function getPotionID(uri, resourceURI) {
var index = uri.indexOf(resourceURI + "/");
if (index !== -1) {
var id = uri.substring(index)
.split('/')
.pop();
return parsePotionID(id);
}
return null;
}
exports.getPotionID = getPotionID;
/**
* Find a Potion resource based on URI
*/
function findPotionResource(uri, resources) {
var entry = Object.entries(resources)
.find(function (_a) {
var resourceURI = _a[0];
return uri.indexOf(resourceURI + "/") === 0;
});
if (entry) {
var resourceURI = entry[0], resource = entry[1];
return {
resourceURI: resourceURI,
resource: resource
};
}
}
exports.findPotionResource = findPotionResource;
/**
* Check if some string is a Potion URI
*/
function isPotionURI(uri, resources) {
var entry = findPotionResource(uri, resources);
if (entry) {
return getPotionID(uri, entry.resourceURI) !== null;
}
return false;
}
exports.isPotionURI = isPotionURI;
/**
* Get the Potion URI from a Potion JSON object

@@ -216,16 +356,2 @@ */

/**
* Transform an Object or Map to pairs of [key, value].
*/
function entries(object) {
var entries;
if (object instanceof Map) {
entries = object.entries();
}
else if (isJsObject(object)) {
entries = Object.entries(object);
}
return Array.from(entries);
}
exports.entries = entries;
/**
* In-Memory cache

@@ -254,2 +380,2 @@ * Will be used by default by Potion for caching resources.

exports.MemCache = MemCache;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb3JlL3V0aWxzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsK0JBQTRCO0FBSTVCOztHQUVHO0FBQ0gscUJBQTRCLEdBQVcsRUFBRSxTQUF1QjtJQUF2QiwwQkFBQSxFQUFBLGVBQXVCO0lBQy9ELE1BQU0sQ0FBQyxHQUFHLENBQUMsT0FBTyxDQUFDLGlCQUFpQixFQUFFLFVBQUMsQ0FBQyxFQUFFLEVBQUUsSUFBSyxPQUFBLEtBQUcsU0FBUyxHQUFHLEVBQUUsQ0FBQyxXQUFXLEVBQUksRUFBakMsQ0FBaUMsQ0FBQztTQUNqRixPQUFPLENBQUMsSUFBSSxFQUFFLEVBQUUsQ0FBQyxDQUFDO0FBQ3JCLENBQUM7QUFIRCxrQ0FHQztBQUdEOztHQUVHO0FBQ0gscUJBQTRCLEdBQVc7SUFDdEMsTUFBTSxDQUFDLEdBQUcsQ0FBQyxPQUFPLENBQUMsY0FBYyxFQUFFLFVBQUEsQ0FBQyxJQUFJLE9BQUEsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLFdBQVcsRUFBRSxFQUFsQixDQUFrQixDQUFDLENBQUM7QUFDN0QsQ0FBQztBQUZELGtDQUVDO0FBR0Q7O0dBRUc7QUFDSCxxQkFBNEIsR0FBa0I7SUFDN0MsSUFBTSxHQUFHLEdBQUcsRUFBRSxDQUFDO0lBQ2YsR0FBRyxDQUFDLENBQXVCLFVBQXlCLEVBQXpCLEtBQUEsT0FBTyxDQUFjLEdBQUcsQ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XHQuZ2V0KGtleSk7XG5cdH1cblxuXHRyZW1vdmUoa2V5OiBzdHJpbmcpOiB2b2lkIHtcblx0XHR0aGlzLml0ZW1zLmRlbGV0ZShrZXkpO1xuXHR9XG59XG4iXX0=

@@ -1,1 +0,1 @@

[{"__symbolic":"module","version":3,"metadata":{"toSnakeCase":{"__symbolic":"function","parameters":["str","separator"],"value":{"__symbolic":"error","message":"Expression form not supported","line":9,"character":11},"defaults":[null,"_"]},"toCamelCase":{"__symbolic":"function","parameters":["str"],"value":{"__symbolic":"error","message":"Expression form not supported","line":17,"character":20}},"mapToObject":{"__symbolic":"function"},"isJsObject":{"__symbolic":"function","parameters":["value"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":38,"character":8},"right":"object"},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Array"},"member":"isArray"},"arguments":[{"__symbolic":"reference","name":"value"}]}}},"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":52,"character":8},"right":"function"}},"omap":{"__symbolic":"function"},"getErrorMessage":{"__symbolic":"function"},"fromSchemaJSON":{"__symbolic":"function"},"toPotionJSON":{"__symbolic":"function"},"parsePotionID":{"__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":140,"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":140,"character":62},"right":"string"}}},"getPotionURI":{"__symbolic":"function"},"removePrefixFromURI":{"__symbolic":"function"},"addPrefixToURI":{"__symbolic":"function"},"merge":{"__symbolic":"function"},"entries":{"__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":9,"character":11},"defaults":[null,"_"]},"toCamelCase":{"__symbolic":"function","parameters":["str"],"value":{"__symbolic":"error","message":"Expression form not supported","line":17,"character":20}},"mapToObject":{"__symbolic":"function"},"isJsObject":{"__symbolic":"function","parameters":["value"],"value":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"&&","left":{"__symbolic":"binop","operator":"===","left":{"__symbolic":"error","message":"Expression form not supported","line":38,"character":8},"right":"object"},"right":{"__symbolic":"pre","operator":"!","operand":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"reference","name":"Array"},"member":"isArray"},"arguments":[{"__symbolic":"reference","name":"value"}]}}},"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":52,"character":8},"right":"function"}},"omap":{"__symbolic":"function"},"getErrorMessage":{"__symbolic":"function"},"fromSchemaJSON":{"__symbolic":"function"},"toPotionJSON":{"__symbolic":"function"},"parsePotionID":{"__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":140,"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":140,"character":62},"right":"string"}}},"getPotionURI":{"__symbolic":"function"},"removePrefixFromURI":{"__symbolic":"function"},"addPrefixToURI":{"__symbolic":"function"},"merge":{"__symbolic":"function"},"entries":{"__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":265,"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":265,"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":265,"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":265,"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"}]}}}}]

@@ -92,2 +92,2 @@ "use strict";

exports.Potion = Potion;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uL3NyYy9mZXRjaC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7Ozs7Ozs7OztBQUFBLCtCQUtnQjtBQUdoQiwrQkFBNkM7QUFBckMsMEJBQUEsUUFBUSxDQUFBO0FBQUUsc0JBQUEsSUFBSSxDQUFBO0FBQUUsdUJBQUEsS0FBSyxDQUFBO0FBRzdCO0lBQTRCLDBCQUFVO0lBQ3JDLGdCQUFZLE9BQXVCO2VBQ2xDLCtCQUFVLE9BQU8sRUFBRTtJQUNwQixDQUFDO0lBRUQsd0NBQXdDO0lBQ3hDLGtGQUFrRjtJQUNsRiwrQ0FBK0M7SUFDL0Msb0ZBQW9GO0lBQ3BGLHdEQUF3RDtJQUM5Qyx3QkFBTyxHQUFqQixVQUFrQixHQUFXLEVBQUUsRUFBaUU7WUFBakUsNEJBQWlFLEVBQWhFLGNBQWMsRUFBZCxtQ0FBYy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ufSksIGVycm9yID0+IGVycm9yKSBhcyBQcm9taXNlPFBvdGlvblJlc3BvbnNlPjtcblx0XHRcdH0gZWxzZSB7XG5cdFx0XHRcdGNvbnN0IGVycm9yOiBhbnkgPSBuZXcgRXJyb3IocmVzcG9uc2Uuc3RhdHVzVGV4dCk7XG5cdFx0XHRcdE9iamVjdC5hc3NpZ24oZXJyb3IsIHtyZXNwb25zZX0pO1xuXHRcdFx0XHR0aHJvdyBlcnJvcjtcblx0XHRcdH1cblx0XHR9KTtcblx0fVxufVxuIl19
{
"name": "potion-client",
"version": "1.5.2",
"version": "1.5.3-0",
"description": "A ES6 client for APIs written in Flask-Potion",

@@ -27,5 +27,14 @@ "keywords": [

"lint:fix": "npm run lint -- --fix",
"pretest": "npm run lint",
"test": "karma start karma.config.ts --browsers PhantomJS --single-run --log-level error",
"test:continuous": "karma start karma.config.ts",
"build": "npm run clean && ngc"
"prebuild": "npm run clean",
"build": "ngc",
"release:prerelease": "scripts/release.sh prerelease",
"release": "scripts/release.sh patch",
"release:preminor": "scripts/release.sh preminor",
"release:minor": "scripts/release.sh minor",
"release:premajor": "scripts/release.sh premajor",
"release:major": "scripts/release.sh major",
"preversion": "npm run test"
},

@@ -74,3 +83,6 @@ "dependencies": {

"node": ">=7.4"
},
"publishConfig": {
"tag": "next"
}
}

@@ -23,3 +23,3 @@ # Potion

Install this package with [NPM](https://www.npmjs.com):
```shell
```bash
$(node bin)/npm install potion-client

@@ -29,3 +29,3 @@ ```

Or [Yarn](https://yarnpkg.com/en):
```shell
```bash
yarn install potion-client

@@ -35,3 +35,3 @@ ```

It can also be used with [JSPM](http://jspm.io):
```shell
```bash
$(npm bin)/jspm install potion=npm:potion-client

@@ -64,3 +64,3 @@ ```

### Contribute
----------------
--------------
If you'd like to contribute:

@@ -72,11 +72,36 @@ 1. Clone the repository `git clone https://github.com/biosustain/potion-node`;

Before you make a pull request, make sure that the builds and tests will run successfully:
Before you make a pull request, you can check if builds and tests will run successfully:
1. Run the tests using `npm run test` (*if you wish to run tests on file change, use `npm run test:continuous`*);
2. Lint the code with `npm run lint`;
3. Use `npm run build` to build the `.ts` files and see if any errors have occurred.
2. Use `npm run build` to build the `.ts` files and see if any errors have occurred.
If you're a contributor and you wish to publish the package,
make sure you update the package version in `package.json` according to the [semver](http://semver.org/) spec and:
```shell
make publish
If you're a contributor and you wish to publish the package, use the release scripts from `package.json`.
For example, if you wish to publish a patch, use:
```bash
npm run release
```
Note that the `master` branch will publish to the `latest` tag, whereas the `next` branch will publish to the `next` tag on NPM.
This can be useful for making pre releases or major changes and allowing users to test the lib,
but not break apps depending on the latest version.
As a rule of thumb, in the `next` branch, you should **always** make a pre release,
allowing for publish the stable version in the `master` branch:
```bash
# Make a patch pre release so that:
# 1.0.0 -> 1.0.1-0
# using:
npm run release:prerelease
# NOTE: Subsequent runs of the command above,
# will result in: 1.0.1-1, 1.0.1-2, etc.
# Make a major pre release so that:
# 1.0.0 -> 2.0.0-0
# using:
npm run release:premajor
# From there on,
# to increment the pre release version so that:
# 2.0.0-0 -> 2.0.0-1
# use:
npm run release:prerelease
```
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