extractia-sdk 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -86,6 +86,7 @@ var ExtractiaSDK = (() => {
86
86
  var index_exports = {};
87
87
  __export(index_exports, {
88
88
  createTemplate: () => createTemplate,
89
+ default: () => index_default,
89
90
  deleteAllTemplateDocuments: () => deleteAllTemplateDocuments,
90
91
  deleteDocument: () => deleteDocument,
91
92
  deleteTemplate: () => deleteTemplate,
@@ -1591,13 +1592,13 @@ var ExtractiaSDK = (() => {
1591
1592
  // node_modules/axios/lib/helpers/resolveConfig.js
1592
1593
  var resolveConfig_default = (config) => {
1593
1594
  const newConfig = mergeConfig({}, config);
1594
- let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
1595
+ let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth: auth2 } = newConfig;
1595
1596
  newConfig.headers = headers = AxiosHeaders_default.from(headers);
1596
1597
  newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
1597
- if (auth) {
1598
+ if (auth2) {
1598
1599
  headers.set(
1599
1600
  "Authorization",
1600
- "Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
1601
+ "Basic " + btoa((auth2.username || "") + ":" + (auth2.password ? unescape(encodeURIComponent(auth2.password)) : ""))
1601
1602
  );
1602
1603
  }
1603
1604
  let contentType;
@@ -2563,13 +2564,13 @@ var ExtractiaSDK = (() => {
2563
2564
  // node_modules/axios/lib/axios.js
2564
2565
  function createInstance(defaultConfig) {
2565
2566
  const context = new Axios_default(defaultConfig);
2566
- const instance2 = bind(Axios_default.prototype.request, context);
2567
- utils_default.extend(instance2, Axios_default.prototype, context, { allOwnKeys: true });
2568
- utils_default.extend(instance2, context, null, { allOwnKeys: true });
2569
- instance2.create = function create(instanceConfig) {
2567
+ const instance = bind(Axios_default.prototype.request, context);
2568
+ utils_default.extend(instance, Axios_default.prototype, context, { allOwnKeys: true });
2569
+ utils_default.extend(instance, context, null, { allOwnKeys: true });
2570
+ instance.create = function create(instanceConfig) {
2570
2571
  return createInstance(mergeConfig(defaultConfig, instanceConfig));
2571
2572
  };
2572
- return instance2;
2573
+ return instance;
2573
2574
  }
2574
2575
  var axios = createInstance(defaults_default);
2575
2576
  axios.Axios = Axios_default;
@@ -2615,20 +2616,20 @@ var ExtractiaSDK = (() => {
2615
2616
 
2616
2617
  // src/apiClient.js
2617
2618
  var token = null;
2618
- var setToken = (newToken) => {
2619
- token = newToken;
2620
- };
2621
- var instance = axios_default.create({
2619
+ var api = axios_default.create({
2622
2620
  baseURL: "https://www.extractia-api.cat/api/public",
2623
2621
  timeout: 1e4
2624
2622
  });
2625
- instance.interceptors.request.use((config) => {
2623
+ api.interceptors.request.use((config) => {
2626
2624
  if (token) {
2627
2625
  config.headers.Authorization = `Bearer ${token}`;
2628
2626
  }
2629
2627
  return config;
2630
2628
  });
2631
- var apiClient_default = instance;
2629
+ function setToken(newToken) {
2630
+ token = newToken;
2631
+ }
2632
+ var apiClient_default = api;
2632
2633
 
2633
2634
  // src/auth.js
2634
2635
  async function getMyProfile() {
@@ -2702,6 +2703,10 @@ var ExtractiaSDK = (() => {
2702
2703
  });
2703
2704
  return res.data;
2704
2705
  }
2706
+
2707
+ // src/index.js
2708
+ var extractia = __spreadValues(__spreadValues(__spreadValues({}, auth), templates), documents);
2709
+ var index_default = extractia;
2705
2710
  return __toCommonJS(index_exports);
2706
2711
  })();
2707
2712
  //# sourceMappingURL=extractia-sdk.browser.js.map