totalum-api-sdk 2.0.21 → 2.0.22
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/README.MD +520 -520
- package/dist/common/endpoints.js +44 -44
- package/dist/common/interfaces.js +3 -3
- package/dist/index.js +58 -58
- package/dist/services/CrudService.js +93 -93
- package/dist/services/FilesService.js +61 -61
- package/dist/services/FilterService.js +49 -49
- package/dist/services/GoogleService.js +53 -53
- package/dist/services/OpenaiService.js +62 -62
- package/dist/totalum-styles.css +73 -1779
- package/dist/utils.js +13 -13
- package/package.json +28 -28
- package/dist/common/endpoints.d.ts +0 -40
- package/dist/common/interfaces.d.ts +0 -73
- package/dist/index.d.ts +0 -18
- package/dist/services/CrudService.d.ts +0 -35
- package/dist/services/FilesService.d.ts +0 -20
- package/dist/services/FilterService.d.ts +0 -8
- package/dist/services/GoogleService.d.ts +0 -15
- package/dist/services/OpenaiService.d.ts +0 -38
- package/dist/utils.d.ts +0 -3
|
@@ -1,53 +1,53 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.GoogleService = void 0;
|
|
16
|
-
const axios_1 = __importDefault(require("axios"));
|
|
17
|
-
const endpoints_1 = require("../common/endpoints");
|
|
18
|
-
const utils_1 = require("../utils");
|
|
19
|
-
class GoogleService {
|
|
20
|
-
constructor(baseUrl, headers) {
|
|
21
|
-
this.headers = headers;
|
|
22
|
-
this.baseUrl = baseUrl;
|
|
23
|
-
}
|
|
24
|
-
getGoogleAccountEmails(accountEmail) {
|
|
25
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
const url = utils_1.UtilsService.getUrl(this.baseUrl, endpoints_1.endpoints.googleIntegration.getEmails, {});
|
|
27
|
-
const params = { userEmail: accountEmail };
|
|
28
|
-
return axios_1.default.get(url, { params: params, headers: this.headers });
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
googleAccountSendEmail(accountEmail, body) {
|
|
32
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
-
const url = utils_1.UtilsService.getUrl(this.baseUrl, endpoints_1.endpoints.googleIntegration.sendEmail, {});
|
|
34
|
-
const params = { userEmail: accountEmail };
|
|
35
|
-
return axios_1.default.post(url, body, { params: params, headers: this.headers });
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
getGoogleCalendarEvents(accountEmail) {
|
|
39
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
-
const url = utils_1.UtilsService.getUrl(this.baseUrl, endpoints_1.endpoints.googleIntegration.getCalendarEvents, {});
|
|
41
|
-
const params = { userEmail: accountEmail };
|
|
42
|
-
return axios_1.default.get(url, { params: params, headers: this.headers });
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
createCalendarEvent(accountEmail, body) {
|
|
46
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
-
const url = utils_1.UtilsService.getUrl(this.baseUrl, endpoints_1.endpoints.googleIntegration.createCalendarEvent, {});
|
|
48
|
-
const params = { userEmail: accountEmail };
|
|
49
|
-
return axios_1.default.post(url, body, { params: params, headers: this.headers });
|
|
50
|
-
});
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
exports.GoogleService = GoogleService;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.GoogleService = void 0;
|
|
16
|
+
const axios_1 = __importDefault(require("axios"));
|
|
17
|
+
const endpoints_1 = require("../common/endpoints");
|
|
18
|
+
const utils_1 = require("../utils");
|
|
19
|
+
class GoogleService {
|
|
20
|
+
constructor(baseUrl, headers) {
|
|
21
|
+
this.headers = headers;
|
|
22
|
+
this.baseUrl = baseUrl;
|
|
23
|
+
}
|
|
24
|
+
getGoogleAccountEmails(accountEmail) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const url = utils_1.UtilsService.getUrl(this.baseUrl, endpoints_1.endpoints.googleIntegration.getEmails, {});
|
|
27
|
+
const params = { userEmail: accountEmail };
|
|
28
|
+
return axios_1.default.get(url, { params: params, headers: this.headers });
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
googleAccountSendEmail(accountEmail, body) {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
const url = utils_1.UtilsService.getUrl(this.baseUrl, endpoints_1.endpoints.googleIntegration.sendEmail, {});
|
|
34
|
+
const params = { userEmail: accountEmail };
|
|
35
|
+
return axios_1.default.post(url, body, { params: params, headers: this.headers });
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
getGoogleCalendarEvents(accountEmail) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
const url = utils_1.UtilsService.getUrl(this.baseUrl, endpoints_1.endpoints.googleIntegration.getCalendarEvents, {});
|
|
41
|
+
const params = { userEmail: accountEmail };
|
|
42
|
+
return axios_1.default.get(url, { params: params, headers: this.headers });
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
createCalendarEvent(accountEmail, body) {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
const url = utils_1.UtilsService.getUrl(this.baseUrl, endpoints_1.endpoints.googleIntegration.createCalendarEvent, {});
|
|
48
|
+
const params = { userEmail: accountEmail };
|
|
49
|
+
return axios_1.default.post(url, body, { params: params, headers: this.headers });
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.GoogleService = GoogleService;
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.OpenaiService = void 0;
|
|
16
|
-
const axios_1 = __importDefault(require("axios"));
|
|
17
|
-
const utils_1 = require("../utils");
|
|
18
|
-
const endpoints_1 = require("../common/endpoints");
|
|
19
|
-
class OpenaiService {
|
|
20
|
-
constructor(baseUrl, headers) {
|
|
21
|
-
this.headers = headers;
|
|
22
|
-
this.baseUrl = baseUrl;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
* @param body the openai completion body, more info here: https://platform.openai.com/docs/api-reference/completions/create
|
|
27
|
-
* @returns the completion provided by openai api
|
|
28
|
-
* @deprecated use createChatCompletion instead
|
|
29
|
-
*/
|
|
30
|
-
createCompletion(body) {
|
|
31
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
const url = utils_1.UtilsService.getUrl(this.baseUrl, endpoints_1.endpoints.openai.createCompletion);
|
|
33
|
-
const b = body;
|
|
34
|
-
return axios_1.default.post(url, b, { headers: this.headers });
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
*
|
|
39
|
-
* @param body the openai chat completion body, more info here: https://platform.openai.com/docs/api-reference/chat/create
|
|
40
|
-
* @returns the chat completion provided by openai api
|
|
41
|
-
*/
|
|
42
|
-
createChatCompletion(body) {
|
|
43
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
const url = utils_1.UtilsService.getUrl(this.baseUrl, endpoints_1.endpoints.openai.createChatCompletion);
|
|
45
|
-
const b = body;
|
|
46
|
-
return axios_1.default.post(url, b, { headers: this.headers });
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
*
|
|
51
|
-
* @param body the openai chat completion body, more info here: https://platform.openai.com/docs/api-reference/chat/create
|
|
52
|
-
* @returns the chat completion provided by openai api
|
|
53
|
-
*/
|
|
54
|
-
generateImage(body) {
|
|
55
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
const url = utils_1.UtilsService.getUrl(this.baseUrl, endpoints_1.endpoints.openai.generateImage);
|
|
57
|
-
const b = body;
|
|
58
|
-
return axios_1.default.post(url, b, { headers: this.headers });
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
exports.OpenaiService = OpenaiService;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.OpenaiService = void 0;
|
|
16
|
+
const axios_1 = __importDefault(require("axios"));
|
|
17
|
+
const utils_1 = require("../utils");
|
|
18
|
+
const endpoints_1 = require("../common/endpoints");
|
|
19
|
+
class OpenaiService {
|
|
20
|
+
constructor(baseUrl, headers) {
|
|
21
|
+
this.headers = headers;
|
|
22
|
+
this.baseUrl = baseUrl;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @param body the openai completion body, more info here: https://platform.openai.com/docs/api-reference/completions/create
|
|
27
|
+
* @returns the completion provided by openai api
|
|
28
|
+
* @deprecated use createChatCompletion instead
|
|
29
|
+
*/
|
|
30
|
+
createCompletion(body) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
const url = utils_1.UtilsService.getUrl(this.baseUrl, endpoints_1.endpoints.openai.createCompletion);
|
|
33
|
+
const b = body;
|
|
34
|
+
return axios_1.default.post(url, b, { headers: this.headers });
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @param body the openai chat completion body, more info here: https://platform.openai.com/docs/api-reference/chat/create
|
|
40
|
+
* @returns the chat completion provided by openai api
|
|
41
|
+
*/
|
|
42
|
+
createChatCompletion(body) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
const url = utils_1.UtilsService.getUrl(this.baseUrl, endpoints_1.endpoints.openai.createChatCompletion);
|
|
45
|
+
const b = body;
|
|
46
|
+
return axios_1.default.post(url, b, { headers: this.headers });
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
*
|
|
51
|
+
* @param body the openai chat completion body, more info here: https://platform.openai.com/docs/api-reference/chat/create
|
|
52
|
+
* @returns the chat completion provided by openai api
|
|
53
|
+
*/
|
|
54
|
+
generateImage(body) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
const url = utils_1.UtilsService.getUrl(this.baseUrl, endpoints_1.endpoints.openai.generateImage);
|
|
57
|
+
const b = body;
|
|
58
|
+
return axios_1.default.post(url, b, { headers: this.headers });
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
exports.OpenaiService = OpenaiService;
|