Sha256: 023744d7b53fc6f961caa9e4bd5342bcdc257cb9650573fc6f9e869d0176ca04

Contents?: true

Size: 799 Bytes

Versions: 1

Compression:

Stored size: 799 Bytes

Contents

import 'event-source-polyfill';

export const c = {
    AUDIT_ALL: 'AUDIT_ALL',
    AUDIT_FLOW: 'AUDIT_FLOW',
    AUDIT_ROLE: 'AUDIT_ROLE',
    AUDIT_RESOURCE: 'AUDIT_RESOURCE'
};

export function fetch(rmanager, type, fullId) {
    switch (type) {
    case c.AUDIT_ALL:
        return rmanager
            .callServer('GET', '/api/audit/all')
            .end();

        /*eslint-disable no-undef */
    case c.AUDIT_FLOW:
        return new EventSource('/api/audit/all');
        /*eslint-enable no-undef */

    case c.AUDIT_ROLE:
        return rmanager
            .callServer('GET', `/api/audit/roles/${fullId}`)
            .end();

    case c.AUDIT_RESOURCE:
        return rmanager
            .callServer('GET', `/api/audit/resources/${fullId}`)
            .end();

    default:
    }
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
conjur-asset-ui-1.6.0 app/src/clients/audit.js