arlas-permissions-api
Version:
Persists data
191 lines • 7.01 kB
JavaScript
/// <reference path="./custom.d.ts" />
// tslint:disable
/**
* ARLAS permissions API
* permissions REST services
*
* OpenAPI spec version: 24.0.8
* Contact: contact@gisaia.com
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
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 __());
};
})();
import * as url from "url";
import * as portableFetch from "portable-fetch";
var BASE_PATH = "http://localhost/arlas_permissions_server".replace(/\/+$/, "");
/**
*
* @export
*/
export var COLLECTION_FORMATS = {
csv: ",",
ssv: " ",
tsv: "\t",
pipes: "|",
};
/**
*
* @export
* @class BaseAPI
*/
var BaseAPI = (function () {
function BaseAPI(configuration, basePath, fetch) {
if (basePath === void 0) { basePath = BASE_PATH; }
if (fetch === void 0) { fetch = portableFetch; }
this.basePath = basePath;
this.fetch = fetch;
if (configuration) {
this.configuration = configuration;
this.basePath = configuration.basePath || this.basePath;
}
}
return BaseAPI;
}());
export { BaseAPI };
;
/**
*
* @export
* @class RequiredError
* @extends {Error}
*/
var RequiredError = (function (_super) {
__extends(RequiredError, _super);
function RequiredError(field, msg) {
var _this = _super.call(this, msg) || this;
_this.field = field;
return _this;
}
return RequiredError;
}(Error));
export { RequiredError };
/**
* AuthorizeApi - fetch parameter creator
* @export
*/
export var AuthorizeApiFetchParamCreator = function (configuration) {
return {
/**
* Returns a list of permissions for the current context/user
* @summary Returns a list of permissions for the current context/user
* @param {string} filter A regex to apply to permissions uris in order to filter the returned list.
* @param {boolean} [pretty] Pretty print
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
get: function (filter, pretty, options) {
if (options === void 0) { options = {}; }
// verify required parameter 'filter' is not null or undefined
if (filter === null || filter === undefined) {
throw new RequiredError('filter', 'Required parameter filter was null or undefined when calling get.');
}
var localVarPath = "/authorize/resources";
var localVarUrlObj = url.parse(localVarPath, true);
var localVarRequestOptions = Object.assign({ method: 'GET' }, options);
var localVarHeaderParameter = {};
var localVarQueryParameter = {};
if (filter !== undefined) {
localVarQueryParameter['filter'] = filter;
}
if (pretty !== undefined) {
localVarQueryParameter['pretty'] = pretty;
}
localVarUrlObj.query = Object.assign({}, localVarUrlObj.query, localVarQueryParameter, options.query);
// fix override query string Detail: https://stackoverflow.com/a/7517673/1077943
delete localVarUrlObj.search;
localVarRequestOptions.headers = Object.assign({}, localVarHeaderParameter, options.headers);
return {
url: url.format(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
/**
* AuthorizeApi - functional programming interface
* @export
*/
export var AuthorizeApiFp = function (configuration) {
return {
/**
* Returns a list of permissions for the current context/user
* @summary Returns a list of permissions for the current context/user
* @param {string} filter A regex to apply to permissions uris in order to filter the returned list.
* @param {boolean} [pretty] Pretty print
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
get: function (filter, pretty, options) {
var localVarFetchArgs = AuthorizeApiFetchParamCreator(configuration).get(filter, pretty, options);
return function (fetch, basePath) {
if (fetch === void 0) { fetch = portableFetch; }
if (basePath === void 0) { basePath = BASE_PATH; }
return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then(function (response) {
if (response.status >= 200 && response.status < 300) {
return response.json();
}
else {
throw response;
}
});
};
},
};
};
/**
* AuthorizeApi - factory interface
* @export
*/
export var AuthorizeApiFactory = function (configuration, fetch, basePath) {
return {
/**
* Returns a list of permissions for the current context/user
* @summary Returns a list of permissions for the current context/user
* @param {string} filter A regex to apply to permissions uris in order to filter the returned list.
* @param {boolean} [pretty] Pretty print
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
get: function (filter, pretty, options) {
return AuthorizeApiFp(configuration).get(filter, pretty, options)(fetch, basePath);
},
};
};
/**
* AuthorizeApi - object-oriented interface
* @export
* @class AuthorizeApi
* @extends {BaseAPI}
*/
var AuthorizeApi = (function (_super) {
__extends(AuthorizeApi, _super);
function AuthorizeApi() {
return _super !== null && _super.apply(this, arguments) || this;
}
/**
* Returns a list of permissions for the current context/user
* @summary Returns a list of permissions for the current context/user
* @param {} filter A regex to apply to permissions uris in order to filter the returned list.
* @param {} [pretty] Pretty print
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof AuthorizeApi
*/
AuthorizeApi.prototype.get = function (filter, pretty, options) {
return AuthorizeApiFp(this.configuration).get(filter, pretty, options)(this.fetch, this.basePath);
};
return AuthorizeApi;
}(BaseAPI));
export { AuthorizeApi };
//# sourceMappingURL=api.js.map