anzar 1.1.9 → 1.1.11

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.
package/dist/index.cjs CHANGED
@@ -33,8 +33,6 @@ __export(index_exports, {
33
33
  Anzar: () => Anzar
34
34
  });
35
35
  module.exports = __toCommonJS(index_exports);
36
- var import_node_fs = __toESM(require("fs"), 1);
37
- var import_node_path = __toESM(require("path"), 1);
38
36
  var import_axios = __toESM(require("axios"), 1);
39
37
  var import_yaml = __toESM(require("yaml"), 1);
40
38
 
@@ -314,10 +312,7 @@ var SessionInterceptor = class {
314
312
 
315
313
  // src/index.ts
316
314
  function loadConfig(file) {
317
- const filePath = import_node_path.default.join(__dirname, file);
318
- const fileContents = import_node_fs.default.readFileSync(filePath, "utf8");
319
- const config = import_yaml.default.parse(fileContents);
320
- return config;
315
+ return import_yaml.default.parse(file);
321
316
  }
322
317
  function Anzar() {
323
318
  const config = loadConfig("anzar.yml");
@@ -330,14 +325,10 @@ function Anzar() {
330
325
  }
331
326
  });
332
327
  if (config.auth) {
333
- config.auth.strategy === "Session" /* Session */ ? SessionInterceptor.apply(axiosApiInstance) : JwtInterceptor.apply(axiosApiInstance);
328
+ config.auth.strategy === "Session" /* Session */ ? new SessionInterceptor().apply(axiosApiInstance) : new JwtInterceptor().apply(axiosApiInstance);
334
329
  } else {
335
- JwtInterceptor.apply(axiosApiInstance);
330
+ new JwtInterceptor().apply(axiosApiInstance);
336
331
  }
337
332
  const http_client = new HttpClientImpl(axiosApiInstance);
338
333
  return new AnzarAuth(http_client, config);
339
334
  }
340
- // Annotate the CommonJS export names for ESM import in node:
341
- 0 && (module.exports = {
342
- Anzar
343
- });
package/dist/index.js CHANGED
@@ -1,6 +1,4 @@
1
1
  // src/index.ts
2
- import fs from "fs";
3
- import path from "path";
4
2
  import axios from "axios";
5
3
  import YAML from "yaml";
6
4
 
@@ -280,10 +278,7 @@ var SessionInterceptor = class {
280
278
 
281
279
  // src/index.ts
282
280
  function loadConfig(file) {
283
- const filePath = path.join(__dirname, file);
284
- const fileContents = fs.readFileSync(filePath, "utf8");
285
- const config = YAML.parse(fileContents);
286
- return config;
281
+ return YAML.parse(file);
287
282
  }
288
283
  function Anzar() {
289
284
  const config = loadConfig("anzar.yml");
@@ -296,9 +291,9 @@ function Anzar() {
296
291
  }
297
292
  });
298
293
  if (config.auth) {
299
- config.auth.strategy === "Session" /* Session */ ? SessionInterceptor.apply(axiosApiInstance) : JwtInterceptor.apply(axiosApiInstance);
294
+ config.auth.strategy === "Session" /* Session */ ? new SessionInterceptor().apply(axiosApiInstance) : new JwtInterceptor().apply(axiosApiInstance);
300
295
  } else {
301
- JwtInterceptor.apply(axiosApiInstance);
296
+ new JwtInterceptor().apply(axiosApiInstance);
302
297
  }
303
298
  const http_client = new HttpClientImpl(axiosApiInstance);
304
299
  return new AnzarAuth(http_client, config);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "anzar",
3
- "version": "1.1.9",
3
+ "version": "1.1.11",
4
4
  "description": "Anzar SDK",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -13,7 +13,7 @@
13
13
  ],
14
14
  "scripts": {
15
15
  "test": "echo \"Error: no test specified\" && exit 1",
16
- "build": "tsup src/index.ts --format cjs,esm --dts --clean",
16
+ "build": "tsup src/index.ts --format cjs,esm --dts --clean --platform neutral",
17
17
  "prepublishOnly": "npm run build"
18
18
  },
19
19
  "keywords": [],