Learn more  » Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

vipera-npm-registry / wa-motif-open-api-module   js

Repository URL to install this package:

Version: 0.0.1 

/ fesm5 / wa-motif-open-api-module.js

import { Injectable, NgModule, defineInjectable, inject } from '@angular/core';
import { MotifConnectorService, WebConsoleCoreModule } from 'web-console-core';
import { String } from 'typescript-string-operations';

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes} checked by tsc
 */
var WAGlobals = /** @class */ (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 = /** @class */ (function () {
    function User() {
    }
    return User;
}());
var UsersService = /** @class */ (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 = 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: Injectable, args: [{
                    providedIn: 'root'
                },] },
    ];
    /** @nocollapse */
    UsersService.ctorParameters = function () { return [
        { type: MotifConnectorService }
    ]; };
    /** @nocollapse */ UsersService.ngInjectableDef = defineInjectable({ factory: function UsersService_Factory() { return new UsersService(inject(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 = /** @class */ (function () {
    function Domain() {
    }
    return Domain;
}());
var DomainsService = /** @class */ (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(String.Format(DOMAIN_DELETE_ENDPOINT, domainName)).subscribe(function (data) {
                console.log("Domain deleted: ", data);
                resolve(data);
            }, reject);
        });
    };
    DomainsService.decorators = [
        { type: Injectable, args: [{
                    providedIn: 'root'
                },] },
    ];
    /** @nocollapse */
    DomainsService.ctorParameters = function () { return [
        { type: MotifConnectorService }
    ]; };
    /** @nocollapse */ DomainsService.ngInjectableDef = defineInjectable({ factory: function DomainsService_Factory() { return new DomainsService(inject(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 = /** @class */ (function () {
    function WAMotifOpenApiModule() {
    }
    WAMotifOpenApiModule.decorators = [
        { type: NgModule, args: [{
                    imports: [
                        WebConsoleCoreModule
                    ],
                    entryComponents: [],
                    declarations: []
                },] },
    ];
    return WAMotifOpenApiModule;
}());

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes} checked by tsc
 */

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes} checked by tsc
 */

export { User, UsersService, Domain, DomainsService, WAMotifOpenApiModule };

//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2EtbW90aWYtb3Blbi1hcGktbW9kdWxlLmpzLm1hcCIsInNvdXJjZXMiOlsibmc6Ly93YS1tb3RpZi1vcGVuLWFwaS1tb2R1bGUvbGliL1dBR2xvYmFscy50cyIsIm5nOi8vd2EtbW90aWYtb3Blbi1hcGktbW9kdWxlL2xpYi9zZXJ2aWNlcy9QbGF0Zm9ybVNlcnZpY2UvVXNlcnNTZXJ2aWNlLnRzIiwibmc6Ly93YS1tb3RpZi1vcGVuLWFwaS1tb2R1bGUvbGliL3NlcnZpY2VzL1BsYXRmb3JtU2VydmljZS9Eb21haW5zU2VydmljZS50cyIsIm5nOi8vd2EtbW90aWYtb3Blbi1hcGktbW9kdWxlL2xpYi93YS1tb3RpZi1vcGVuLWFwaS1tb2R1bGUudHMiXSwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNsYXNzIFdBR2xvYmFscyB7XG4gICAgcHVibGljIHN0YXRpYyBBUElfRU5EUE9JTlRfUFJGSVggPSAnL3Jlc3QvdjInO1xuIH0iLCJpbXBvcnQgeyBJbmplY3RhYmxlIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5pbXBvcnQgeyBNb3RpZkNvbm5lY3RvclNlcnZpY2UgfSBmcm9tICd3ZWItY29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