import { ObjectUtils } from '@sankhyalabs/core';
import { R as ResourceFetcher } from './form-config-fetcher.js';

class AuthFetcher extends ResourceFetcher {
  getData(resourceID) {
    const completePath = `cfg://auth/${resourceID}`;
    return new Promise((resolve, reject) => {
      this.loadResource(completePath)
        .then((loadedResource) => {
        let auth = ObjectUtils.stringToObject(loadedResource);
        if (auth && typeof (auth) === 'object') {
          resolve(auth);
        }
      }).catch((error) => {
        reject(error);
      });
    });
  }
}
var AutorizationType;
(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";
})(AutorizationType || (AutorizationType = {}));

export { AutorizationType as A, AuthFetcher as a };
