totalum-api-sdk 2.0.4 → 2.0.6

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/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "totalum-api-sdk",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "Totalum sdk wraper of totalum api",
5
- "main": "index.js",
5
+ "main": "./dist/index.js",
6
6
  "scripts": {
7
7
  "build": "tsc"
8
8
  },
package/tsconfig.json CHANGED
@@ -55,7 +55,7 @@
55
55
  // "sourceMap": true, /* Create source map files for emitted JavaScript files. */
56
56
  // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
57
57
  // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
58
- // "outDir": "./", /* Specify an output folder for all emitted files. */
58
+ "outDir": "./dist", /* Specify an output folder for all emitted files. */
59
59
  // "removeComments": true, /* Disable emitting comments. */
60
60
  // "noEmit": true, /* Disable emitting files from a compilation. */
61
61
  // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
package/index.js DELETED
@@ -1,47 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TotalumApiSdk = void 0;
4
- const OpenaiService_1 = require("./services/OpenaiService");
5
- const GoogleService_1 = require("./services/GoogleService");
6
- const FilterService_1 = require("./services/FilterService");
7
- const FilesService_1 = require("./services/FilesService");
8
- const CrudService_1 = require("./services/CrudService");
9
- class TotalumApiSdk {
10
- constructor(authOptions) {
11
- var _a, _b, _c;
12
- this._baseUrl = 'https://api.totalum.app/';
13
- this.authOptions = authOptions;
14
- if ((_a = this.authOptions.token) === null || _a === void 0 ? void 0 : _a.accessToken) {
15
- this._headers = {
16
- authorization: this.authOptions.token.accessToken
17
- };
18
- }
19
- else if (((_b = this.authOptions.apiKey) === null || _b === void 0 ? void 0 : _b.apiKey) && ((_c = this.authOptions.apiKey) === null || _c === void 0 ? void 0 : _c.organizationId)) {
20
- this._headers = {
21
- 'api-key': this.authOptions.apiKey.apiKey,
22
- 'organization-id': this.authOptions.apiKey.organizationId,
23
- 'api-key-name': this.authOptions.apiKey.apiKeyName
24
- };
25
- }
26
- else {
27
- throw new Error('Error: invalid auth options');
28
- }
29
- if (this.authOptions.baseUrl) {
30
- this._baseUrl = this.authOptions.baseUrl;
31
- }
32
- this.setRequestData();
33
- }
34
- changeBaseUrl(newBaseUrl) {
35
- this._baseUrl = newBaseUrl;
36
- //update services with new implementation
37
- this.setRequestData();
38
- }
39
- setRequestData() {
40
- this.crud = new CrudService_1.CrudService(this._baseUrl, this._headers);
41
- this.openai = new OpenaiService_1.OpenaiService(this._baseUrl, this._headers);
42
- this.files = new FilesService_1.FilesService(this._baseUrl, this._headers);
43
- this.google = new GoogleService_1.GoogleService(this._baseUrl, this._headers);
44
- this.filter = new FilterService_1.FilterService(this._baseUrl, this._headers);
45
- }
46
- }
47
- exports.TotalumApiSdk = TotalumApiSdk;