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 

/ fesm2015 / 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
 */
class WAGlobals {
}
WAGlobals.API_ENDPOINT_PRFIX = '/rest/v2';

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes} checked by tsc
 */
const /** @type {?} */ USERS_LIST_ENDPOINT = WAGlobals.API_ENDPOINT_PRFIX + "/platform/domains/{0}/users";
class User {
    constructor() {
    }
}
class UsersService {
    /**
     * @param {?} motifConnector
     */
    constructor(motifConnector) {
        this.motifConnector = motifConnector;
        console.log("MotifConnectorService=", motifConnector);
    }
    /**
     * @param {?} domain
     * @return {?}
     */
    getUsersList(domain) {
        return new Promise((resolve, reject) => {
            let /** @type {?} */ endpoint = String.Format(USERS_LIST_ENDPOINT, domain);
            this.motifConnector.get(endpoint).subscribe((data) => {
                console.log("Get Users List done: ", data);
                resolve(data);
            }, reject);
        });
    }
}
UsersService.decorators = [
    { type: Injectable, args: [{
                providedIn: 'root'
            },] },
];
/** @nocollapse */
UsersService.ctorParameters = () => [
    { type: MotifConnectorService }
];
/** @nocollapse */ UsersService.ngInjectableDef = defineInjectable({ factory: function UsersService_Factory() { return new UsersService(inject(MotifConnectorService)); }, token: UsersService, providedIn: "root" });

/**
 * @fileoverview added by tsickle
 * @suppress {checkTypes} checked by tsc
 */
const /** @type {?} */ DOMAINS_LIST_ENDPOINT = WAGlobals.API_ENDPOINT_PRFIX + "/platform/domains";
const /** @type {?} */ DOMAIN_DELETE_ENDPOINT = WAGlobals.API_ENDPOINT_PRFIX + "/platform/domains/{0}";
class Domain {
}
class DomainsService {
    /**
     * @param {?} motifConnector
     */
    constructor(motifConnector) {
        this.motifConnector = motifConnector;
        console.log("MotifConnectorService=", motifConnector);
    }
    /**
     * @return {?}
     */
    getDomainList() {
        return new Promise((resolve, reject) => {
            this.motifConnector.get(DOMAINS_LIST_ENDPOINT).subscribe((data) => {
                console.log("Get Domain List done: ", data);
                resolve(data);
            }, reject);
        });
    }
    /**
     * @param {?} domain
     * @return {?}
     */
    createDomain(domain) {
        return new Promise((resolve, reject) => {
            this.motifConnector.post(DOMAINS_LIST_ENDPOINT, {
                "description": domain.description,
                "name": domain.name
            }).subscribe((data) => {
                console.log("Add new Domain done: ", data);
                resolve(data);
            }, reject);
        });
    }
    /**
     * @param {?} domainName
     * @return {?}
     */
    deleteDomain(domainName) {
        return new Promise((resolve, reject) => {
            this.motifConnector.delete(String.Format(DOMAIN_DELETE_ENDPOINT, domainName)).subscribe((data) => {
                console.log("Domain deleted: ", data);
                resolve(data);
            }, reject);
        });
    }
}
DomainsService.decorators = [
    { type: Injectable, args: [{
                providedIn: 'root'
            },] },
];
/** @nocollapse */
DomainsService.ctorParameters = () => [
    { type: MotifConnectorService }
];
/** @nocollapse */ DomainsService.ngInjectableDef = defineInjectable({ factory: function DomainsService_Factory() { return new DomainsService(inject(MotifConnectorService)); }, token: DomainsService, providedIn: "root" });

/**
 * @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
 */
class WAMotifOpenApiModule {
}
WAMotifOpenApiModule.decorators = [
    { type: NgModule, args: [{
                imports: [
                    WebConsoleCoreModule
                ],
                entryComponents: [],
                declarations: []
            },] },
];

/**
 * @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=ut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