'use strict';

const core = require('@sankhyalabs/core');
const formConfigFetcher = require('./form-config-fetcher-fef79845.js');

class AuthFetcher extends formConfigFetcher.ResourceFetcher {
  getData(resourceID) {
    const completePath = `cfg://auth/${resourceID}`;
    return new Promise((resolve, reject) => {
      this.loadResource(completePath)
        .then((loadedResource) => {
        let auth = core.ObjectUtils.stringToObject(loadedResource);
        if (auth && typeof (auth) === 'object') {
          resolve(auth);
        }
      }).catch((error) => {
        reject(error);
      });
    });
  }
}
exports.AutorizationType = void 0;
(function (AutorizationType) {
  AutorizationType["INSERT"] = "I";
  AutorizationType["UPDATE"] = "A";
  AutorizationType["REMOVE"] = "E";
  AutorizationType["SHOW"] = "C";
  AutorizationType["CONFIG"] = "F";
  AutorizationType["CONFIG_NUMBER"] = "N";
  AutorizationType["CLONE"] = "D";
  AutorizationType["CONFIG_GRID"] = "G";
})(exports.AutorizationType || (exports.AutorizationType = {}));

exports.AuthFetcher = AuthFetcher;
