Repository URL to install this package:
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('web-console-core'), require('typescript-string-operations')) :
typeof define === 'function' && define.amd ? define('wa-motif-open-api-module', ['exports', '@angular/core', 'web-console-core', 'typescript-string-operations'], factory) :
(factory((global['wa-motif-open-api-module'] = {}),global.ng.core,null,null));
}(this, (function (exports,i0,i1,typescriptStringOperations) { 'use strict';
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var WAGlobals = (function () {
function WAGlobals() {
}
WAGlobals.API_ENDPOINT_PRFIX = '/rest/v2';
return WAGlobals;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ USERS_LIST_ENDPOINT = WAGlobals.API_ENDPOINT_PRFIX + "/platform/domains/{0}/users";
var User = (function () {
function User() {
}
return User;
}());
var UsersService = (function () {
function UsersService(motifConnector) {
this.motifConnector = motifConnector;
console.log("MotifConnectorService=", motifConnector);
}
/**
* @param {?} domain
* @return {?}
*/
UsersService.prototype.getUsersList = /**
* @param {?} domain
* @return {?}
*/
function (domain) {
var _this = this;
return new Promise(function (resolve, reject) {
var /** @type {?} */ endpoint = typescriptStringOperations.String.Format(USERS_LIST_ENDPOINT, domain);
_this.motifConnector.get(endpoint).subscribe(function (data) {
console.log("Get Users List done: ", data);
resolve(data);
}, reject);
});
};
UsersService.decorators = [
{ type: i0.Injectable, args: [{
providedIn: 'root'
},] },
];
/** @nocollapse */
UsersService.ctorParameters = function () {
return [
{ type: i1.MotifConnectorService }
];
};
/** @nocollapse */ UsersService.ngInjectableDef = i0.defineInjectable({ factory: function UsersService_Factory() { return new UsersService(i0.inject(i1.MotifConnectorService)); }, token: UsersService, providedIn: "root" });
return UsersService;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var /** @type {?} */ DOMAINS_LIST_ENDPOINT = WAGlobals.API_ENDPOINT_PRFIX + "/platform/domains";
var /** @type {?} */ DOMAIN_DELETE_ENDPOINT = WAGlobals.API_ENDPOINT_PRFIX + "/platform/domains/{0}";
var Domain = (function () {
function Domain() {
}
return Domain;
}());
var DomainsService = (function () {
function DomainsService(motifConnector) {
this.motifConnector = motifConnector;
console.log("MotifConnectorService=", motifConnector);
}
/**
* @return {?}
*/
DomainsService.prototype.getDomainList = /**
* @return {?}
*/
function () {
var _this = this;
return new Promise(function (resolve, reject) {
_this.motifConnector.get(DOMAINS_LIST_ENDPOINT).subscribe(function (data) {
console.log("Get Domain List done: ", data);
resolve(data);
}, reject);
});
};
/**
* @param {?} domain
* @return {?}
*/
DomainsService.prototype.createDomain = /**
* @param {?} domain
* @return {?}
*/
function (domain) {
var _this = this;
return new Promise(function (resolve, reject) {
_this.motifConnector.post(DOMAINS_LIST_ENDPOINT, {
"description": domain.description,
"name": domain.name
}).subscribe(function (data) {
console.log("Add new Domain done: ", data);
resolve(data);
}, reject);
});
};
/**
* @param {?} domainName
* @return {?}
*/
DomainsService.prototype.deleteDomain = /**
* @param {?} domainName
* @return {?}
*/
function (domainName) {
var _this = this;
return new Promise(function (resolve, reject) {
_this.motifConnector.delete(typescriptStringOperations.String.Format(DOMAIN_DELETE_ENDPOINT, domainName)).subscribe(function (data) {
console.log("Domain deleted: ", data);
resolve(data);
}, reject);
});
};
DomainsService.decorators = [
{ type: i0.Injectable, args: [{
providedIn: 'root'
},] },
];
/** @nocollapse */
DomainsService.ctorParameters = function () {
return [
{ type: i1.MotifConnectorService }
];
};
/** @nocollapse */ DomainsService.ngInjectableDef = i0.defineInjectable({ factory: function DomainsService_Factory() { return new DomainsService(i0.inject(i1.MotifConnectorService)); }, token: DomainsService, providedIn: "root" });
return DomainsService;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
var WAMotifOpenApiModule = (function () {
function WAMotifOpenApiModule() {
}
WAMotifOpenApiModule.decorators = [
{ type: i0.NgModule, args: [{
imports: [
i1.WebConsoleCoreModule
],
entryComponents: [],
declarations: []
},] },
];
return WAMotifOpenApiModule;
}());
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
/**
* @fileoverview added by tsickle
* @suppress {checkTypes} checked by tsc
*/
exports.User = User;
exports.UsersService = UsersService;
exports.Domain = Domain;
exports.DomainsService = DomainsService;
exports.WAMotifOpenApiModule = WAMotifOpenApiModule;
Object.defineProperty(exports, '__esModule', { value: true });
})));
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2EtbW90aWYtb3Blbi1hcGktbW9kdWxlLnVtZC5qcy5tYXAiLCJzb3VyY2VzIjpbIm5nOi8vd2EtbW90aWYtb3Blbi1hcGktbW9kdWxlL2xpYi9XQUdsb2JhbHMudHMiLCJuZzovL3dhLW1vdGlmLW9wZW4tYXBpLW1vZHVsZS9saWIvc2VydmljZXMvUGxhdGZvcm1TZXJ2aWNlL1VzZXJzU2VydmljZS50cyIsIm5nOi8vd2EtbW90aWYtb3Blbi1hcGktbW9kdWxlL2xpYi9zZXJ2aWNlcy9QbGF0Zm9ybVNlcnZpY2UvRG9tYWluc1NlcnZpY2UudHMiLCJuZzovL3dhLW1vdGlmLW9wZW4tYXBpLW1vZHVsZS9saWIvd2EtbW90aWYtb3Blbi1hcGktbW9kdWxlLnRzIl0sInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBjbGFzcyBXQUdsb2JhbHMge1xuICAgIHB1YmxpYyBzdGF0aWMgQVBJX0VORFBPSU5UX1BSRklYID0gJy9yZXN0L3YyJztcbiB9IiwiaW1wb3J0IHsgSW5qZWN0YWJsZSB9IGZyb20gJ0Bhbmd1bGFyL2NvcmUnO1xuaW1wb3J0IHsgTW90aWZDb25uZWN0b3JTZXJ2aWNlIH0gZnJvbSAnd2ViLWNvbnNvbGUtY29yZSdcbmltcG9ydCB7w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