@ctchealth/plato-sdk 0.0.17 → 0.0.18
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 +3 -3
- package/package.json +4 -3
- package/src/index.js +18 -0
- package/src/index.js.map +1 -0
- package/src/lib/{constants.ts → constants.d.ts} +3 -3
- package/src/lib/constants.js +20 -0
- package/src/lib/constants.js.map +1 -0
- package/src/lib/plato-intefaces.d.ts +393 -0
- package/src/lib/plato-intefaces.js +173 -0
- package/src/lib/plato-intefaces.js.map +1 -0
- package/src/lib/plato-sdk.d.ts +193 -0
- package/src/lib/plato-sdk.js +663 -0
- package/src/lib/plato-sdk.js.map +1 -0
- package/src/lib/utils.d.ts +24 -0
- package/src/lib/utils.js +70 -0
- package/src/lib/utils.js.map +1 -0
- package/eslint.config.cjs +0 -121
- package/jest.config.ts +0 -10
- package/project.json +0 -24
- package/src/lib/plato-intefaces.ts +0 -431
- package/src/lib/plato-sdk.ts +0 -789
- package/src/lib/utils.ts +0 -72
- package/tsconfig.json +0 -22
- package/tsconfig.lib.json +0 -11
- package/tsconfig.spec.json +0 -10
- /package/src/{index.ts → index.d.ts} +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validates a file against size and type constraints.
|
|
3
|
+
*
|
|
4
|
+
* @param file - The file to check.
|
|
5
|
+
* @param maxFileSize - The maximum allowed file size in bytes.
|
|
6
|
+
* @param allowedMimeTypes - An array of allowed MIME types.
|
|
7
|
+
* @returns true if valid, or a descriptive error message if invalid.
|
|
8
|
+
*/
|
|
9
|
+
export declare function checkFile(file: File | Blob, maxFileSize: number, allowedMimeTypes: string[]): true | string;
|
|
10
|
+
/**
|
|
11
|
+
* Calculates the SHA-256 hash of a file or blob.
|
|
12
|
+
*
|
|
13
|
+
* @param file - The file or blob to hash.
|
|
14
|
+
* @returns A promise that resolves to the hexadecimal SHA-256 hash.
|
|
15
|
+
*/
|
|
16
|
+
export declare function calculateHash(file: File | Blob): Promise<string>;
|
|
17
|
+
/**
|
|
18
|
+
* Gets the page count of a PDF file.
|
|
19
|
+
*
|
|
20
|
+
* @param file - The PDF file or blob to check.
|
|
21
|
+
* @returns A promise that resolves to the number of pages in the PDF.
|
|
22
|
+
* @throws Error if the PDF cannot be parsed.
|
|
23
|
+
*/
|
|
24
|
+
export declare function getPdfPageCount(file: File | Blob): Promise<number>;
|
package/src/lib/utils.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkFile = checkFile;
|
|
4
|
+
exports.calculateHash = calculateHash;
|
|
5
|
+
exports.getPdfPageCount = getPdfPageCount;
|
|
6
|
+
/**
|
|
7
|
+
* Copyright (c) 2025 ctcHealth. All rights reserved.
|
|
8
|
+
*
|
|
9
|
+
* This file is part of the ctcHealth Plato Platform, a proprietary software system developed by ctcHealth.
|
|
10
|
+
*
|
|
11
|
+
* This source code and all related materials are confidential and proprietary to ctcHealth.
|
|
12
|
+
* Unauthorized access, use, copying, modification, distribution, or disclosure is strictly prohibited
|
|
13
|
+
* and may result in disciplinary action and civil and/or criminal penalties.
|
|
14
|
+
*
|
|
15
|
+
* This software is intended solely for authorized use within ctcHealth and its designated partners.
|
|
16
|
+
*
|
|
17
|
+
* For internal use only.
|
|
18
|
+
*/
|
|
19
|
+
const pdf_lib_1 = require("pdf-lib");
|
|
20
|
+
/**
|
|
21
|
+
* Validates a file against size and type constraints.
|
|
22
|
+
*
|
|
23
|
+
* @param file - The file to check.
|
|
24
|
+
* @param maxFileSize - The maximum allowed file size in bytes.
|
|
25
|
+
* @param allowedMimeTypes - An array of allowed MIME types.
|
|
26
|
+
* @returns true if valid, or a descriptive error message if invalid.
|
|
27
|
+
*/
|
|
28
|
+
function checkFile(file, maxFileSize, allowedMimeTypes) {
|
|
29
|
+
if (file.size > maxFileSize) {
|
|
30
|
+
const uploadedSizeMB = (file.size / (1024 * 1024)).toFixed(2);
|
|
31
|
+
const maxSizeMB = (maxFileSize / (1024 * 1024)).toFixed(2);
|
|
32
|
+
return `File size (${uploadedSizeMB} MB) exceeds the maximum allowed size of ${maxSizeMB} MB.`;
|
|
33
|
+
}
|
|
34
|
+
if (!allowedMimeTypes.includes(file.type)) {
|
|
35
|
+
return `Invalid file type: ${file.type}. Allowed types are: ${allowedMimeTypes.join(', ')}.`;
|
|
36
|
+
}
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Calculates the SHA-256 hash of a file or blob.
|
|
41
|
+
*
|
|
42
|
+
* @param file - The file or blob to hash.
|
|
43
|
+
* @returns A promise that resolves to the hexadecimal SHA-256 hash.
|
|
44
|
+
*/
|
|
45
|
+
async function calculateHash(file) {
|
|
46
|
+
const arrayBuffer = await file.arrayBuffer();
|
|
47
|
+
const hashBuffer = await crypto.subtle.digest('SHA-256', arrayBuffer);
|
|
48
|
+
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
49
|
+
const hashHex = hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
|
|
50
|
+
return hashHex;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Gets the page count of a PDF file.
|
|
54
|
+
*
|
|
55
|
+
* @param file - The PDF file or blob to check.
|
|
56
|
+
* @returns A promise that resolves to the number of pages in the PDF.
|
|
57
|
+
* @throws Error if the PDF cannot be parsed.
|
|
58
|
+
*/
|
|
59
|
+
async function getPdfPageCount(file) {
|
|
60
|
+
try {
|
|
61
|
+
const arrayBuffer = await file.arrayBuffer();
|
|
62
|
+
const pdf = await pdf_lib_1.PDFDocument.load(arrayBuffer);
|
|
63
|
+
return pdf.getPageCount();
|
|
64
|
+
}
|
|
65
|
+
catch (err) {
|
|
66
|
+
const message = err instanceof Error ? err.message : 'Unknown error';
|
|
67
|
+
throw new Error(`Failed to read PDF page count: ${message}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../libs/plato-sdk/src/lib/utils.ts"],"names":[],"mappings":";;AAuBA,8BAgBC;AAQD,sCAMC;AASD,0CASC;AAvED;;;;;;;;;;;;GAYG;AACH,qCAAsC;AAEtC;;;;;;;GAOG;AACH,SAAgB,SAAS,CACvB,IAAiB,EACjB,WAAmB,EACnB,gBAA0B;IAE1B,IAAI,IAAI,CAAC,IAAI,GAAG,WAAW,EAAE,CAAC;QAC5B,MAAM,cAAc,GAAG,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC9D,MAAM,SAAS,GAAG,CAAC,WAAW,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QAC3D,OAAO,cAAc,cAAc,4CAA4C,SAAS,MAAM,CAAC;IACjG,CAAC;IAED,IAAI,CAAC,gBAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC1C,OAAO,sBAAsB,IAAI,CAAC,IAAI,wBAAwB,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;IAC/F,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACI,KAAK,UAAU,aAAa,CAAC,IAAiB;IACnD,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;IAC7C,MAAM,UAAU,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IACtE,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,CAAC,CAAC;IACzD,MAAM,OAAO,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC7E,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,eAAe,CAAC,IAAiB;IACrD,IAAI,CAAC;QACH,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,WAAW,EAAE,CAAC;QAC7C,MAAM,GAAG,GAAG,MAAM,qBAAW,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;QAChD,OAAO,GAAG,CAAC,YAAY,EAAE,CAAC;IAC5B,CAAC;IAAC,OAAO,GAAY,EAAE,CAAC;QACtB,MAAM,OAAO,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;QACrE,MAAM,IAAI,KAAK,CAAC,kCAAkC,OAAO,EAAE,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC"}
|
package/eslint.config.cjs
DELETED
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
const { defineConfig, globalIgnores } = require('eslint/config');
|
|
2
|
-
const path = require('path');
|
|
3
|
-
|
|
4
|
-
const typescriptEslintEslintPlugin = require('@typescript-eslint/eslint-plugin');
|
|
5
|
-
const globals = require('globals');
|
|
6
|
-
const tsParser = require('@typescript-eslint/parser');
|
|
7
|
-
const jest = require('eslint-plugin-jest');
|
|
8
|
-
const js = require('@eslint/js');
|
|
9
|
-
const headers = require('eslint-plugin-headers');
|
|
10
|
-
const { FlatCompat } = require('@eslint/eslintrc');
|
|
11
|
-
const baseRules = require('../../eslint-config-base.cjs');
|
|
12
|
-
|
|
13
|
-
const compat = new FlatCompat({
|
|
14
|
-
baseDirectory: __dirname,
|
|
15
|
-
recommendedConfig: js.configs.recommended,
|
|
16
|
-
allConfig: js.configs.all,
|
|
17
|
-
});
|
|
18
|
-
|
|
19
|
-
module.exports = defineConfig([
|
|
20
|
-
globalIgnores([
|
|
21
|
-
'**/.eslintrc.js',
|
|
22
|
-
'src/index.d.ts',
|
|
23
|
-
'scripts/db-migrations/archived/**/*',
|
|
24
|
-
'**/*.spec.ts',
|
|
25
|
-
'**/*.config.js',
|
|
26
|
-
'**/*.config.cjs',
|
|
27
|
-
'**/jest.config.ts',
|
|
28
|
-
]),
|
|
29
|
-
{
|
|
30
|
-
files: ['**/*.ts'],
|
|
31
|
-
plugins: {
|
|
32
|
-
headers,
|
|
33
|
-
},
|
|
34
|
-
rules: {
|
|
35
|
-
'headers/header-format': [
|
|
36
|
-
'error',
|
|
37
|
-
{
|
|
38
|
-
source: 'string',
|
|
39
|
-
content: `Copyright (c) 2025 ctcHealth. All rights reserved.
|
|
40
|
-
|
|
41
|
-
This file is part of the ctcHealth Plato Platform, a proprietary software system developed by ctcHealth.
|
|
42
|
-
|
|
43
|
-
This source code and all related materials are confidential and proprietary to ctcHealth.
|
|
44
|
-
Unauthorized access, use, copying, modification, distribution, or disclosure is strictly prohibited
|
|
45
|
-
and may result in disciplinary action and civil and/or criminal penalties.
|
|
46
|
-
|
|
47
|
-
This software is intended solely for authorized use within ctcHealth and its designated partners.
|
|
48
|
-
|
|
49
|
-
For internal use only.`,
|
|
50
|
-
style: 'jsdoc',
|
|
51
|
-
trailingNewlines: 1,
|
|
52
|
-
preservePragmas: false,
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
extends: compat.extends(
|
|
59
|
-
'plugin:@typescript-eslint/recommended',
|
|
60
|
-
'plugin:@typescript-eslint/recommended-requiring-type-checking',
|
|
61
|
-
'plugin:@typescript-eslint/strict'
|
|
62
|
-
),
|
|
63
|
-
|
|
64
|
-
files: ['**/*.ts'],
|
|
65
|
-
ignores: ['**/*.json', '**/*.spec.ts'],
|
|
66
|
-
|
|
67
|
-
plugins: {
|
|
68
|
-
'@typescript-eslint': typescriptEslintEslintPlugin,
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
languageOptions: {
|
|
72
|
-
globals: {
|
|
73
|
-
...globals.node,
|
|
74
|
-
...globals.jest,
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
parser: tsParser,
|
|
78
|
-
ecmaVersion: 10,
|
|
79
|
-
sourceType: 'module',
|
|
80
|
-
|
|
81
|
-
parserOptions: {
|
|
82
|
-
project: path.join(__dirname, 'tsconfig.lib.json'),
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
|
|
86
|
-
rules: {
|
|
87
|
-
...baseRules.rules, // shared rules
|
|
88
|
-
// project-specific rules
|
|
89
|
-
'@typescript-eslint/ban-ts-comment': 'warn',
|
|
90
|
-
'@typescript-eslint/interface-name-prefix': 'off',
|
|
91
|
-
'@typescript-eslint/explicit-function-return-type': 'warn',
|
|
92
|
-
'@typescript-eslint/promise-function-async': ['error'],
|
|
93
|
-
'@typescript-eslint/no-floating-promises': 'error',
|
|
94
|
-
'@typescript-eslint/await-thenable': 'error',
|
|
95
|
-
semi: ['error', 'always'],
|
|
96
|
-
'@typescript-eslint/unbound-method': 'error',
|
|
97
|
-
'keyword-spacing': ['error'],
|
|
98
|
-
'@typescript-eslint/restrict-template-expressions': 'error',
|
|
99
|
-
'@typescript-eslint/prefer-regexp-exec': 'warn',
|
|
100
|
-
'@typescript-eslint/require-await': 'warn',
|
|
101
|
-
'@typescript-eslint/no-non-null-assertion': 'error',
|
|
102
|
-
'@typescript-eslint/no-unnecessary-condition': 'warn',
|
|
103
|
-
'@typescript-eslint/prefer-ts-expect-error': 'warn',
|
|
104
|
-
'@typescript-eslint/prefer-nullish-coalescing': 'off',
|
|
105
|
-
'space-infix-ops': 'off',
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
files: ['**/*.spec.ts'],
|
|
110
|
-
extends: compat.extends('plugin:jest/recommended'),
|
|
111
|
-
|
|
112
|
-
plugins: {
|
|
113
|
-
jest,
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
rules: {
|
|
117
|
-
'@typescript-eslint/unbound-method': 'off',
|
|
118
|
-
'jest/unbound-method': 'error',
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
]);
|
package/jest.config.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export default {
|
|
2
|
-
displayName: 'plato-sdk',
|
|
3
|
-
preset: '../../jest.preset.js',
|
|
4
|
-
testEnvironment: 'node',
|
|
5
|
-
transform: {
|
|
6
|
-
'^.+\\.[tj]s$': ['ts-jest', { tsconfig: '<rootDir>/tsconfig.spec.json' }],
|
|
7
|
-
},
|
|
8
|
-
moduleFileExtensions: ['ts', 'js', 'html'],
|
|
9
|
-
coverageDirectory: '../../coverage/libs/plato-sdk',
|
|
10
|
-
};
|
package/project.json
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "plato-sdk",
|
|
3
|
-
"$schema": "../../node_modules/nx/schemas/project-schema.json",
|
|
4
|
-
"sourceRoot": "libs/plato-sdk/src",
|
|
5
|
-
"projectType": "library",
|
|
6
|
-
"tags": [],
|
|
7
|
-
"targets": {
|
|
8
|
-
"build": {
|
|
9
|
-
"executor": "@nx/js:tsc",
|
|
10
|
-
"outputs": ["{options.outputPath}"],
|
|
11
|
-
"options": {
|
|
12
|
-
"outputPath": "dist/libs/plato-sdk",
|
|
13
|
-
"main": "libs/plato-sdk/src/index.ts",
|
|
14
|
-
"tsConfig": "libs/plato-sdk/tsconfig.lib.json",
|
|
15
|
-
"assets": ["libs/plato-sdk/*.md"]
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
"nx-release-publish": {
|
|
19
|
-
"options": {
|
|
20
|
-
"packageRoot": "dist/{projectRoot}"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,431 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2025 ctcHealth. All rights reserved.
|
|
3
|
-
*
|
|
4
|
-
* This file is part of the ctcHealth Plato Platform, a proprietary software system developed by ctcHealth.
|
|
5
|
-
*
|
|
6
|
-
* This source code and all related materials are confidential and proprietary to ctcHealth.
|
|
7
|
-
* Unauthorized access, use, copying, modification, distribution, or disclosure is strictly prohibited
|
|
8
|
-
* and may result in disciplinary action and civil and/or criminal penalties.
|
|
9
|
-
*
|
|
10
|
-
* This software is intended solely for authorized use within ctcHealth and its designated partners.
|
|
11
|
-
*
|
|
12
|
-
* For internal use only.
|
|
13
|
-
*/
|
|
14
|
-
export enum YearOfExperience {
|
|
15
|
-
'1-5' = '1-5 years',
|
|
16
|
-
'6-10' = '6-10 years',
|
|
17
|
-
'11-20' = '16-20 years',
|
|
18
|
-
'20+' = '20+ years',
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export enum PracticeType {
|
|
22
|
-
Private = 'Private Practice',
|
|
23
|
-
Hospital = 'Hospital',
|
|
24
|
-
AcademicMedicalCenter = 'Academic Medical Center',
|
|
25
|
-
Clinic = 'Clinic',
|
|
26
|
-
}
|
|
27
|
-
export enum SegmentType {
|
|
28
|
-
Traditionalist = 'The Traditionalist',
|
|
29
|
-
Innovator = 'The Innovator',
|
|
30
|
-
PatientOrientedPhysician = 'The Patient-Oriented Physician',
|
|
31
|
-
FinanciallyDrivenPrescriber = 'The Financially-Driven Prescriber',
|
|
32
|
-
EvidencePurist = 'The Evidence-Purist',
|
|
33
|
-
CostConsciousPrescriber = 'The Cost-Conscious Prescriber',
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export enum AssistantVoiceGender {
|
|
37
|
-
Male = 'Male',
|
|
38
|
-
Female = 'Female',
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export enum AvatarLanguage {
|
|
42
|
-
English = 'en',
|
|
43
|
-
German = 'de',
|
|
44
|
-
Spanish = 'es',
|
|
45
|
-
Italian = 'it',
|
|
46
|
-
French = 'fr',
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
export class PersonalityAndBehaviourDto {
|
|
50
|
-
riskTolerance!: number;
|
|
51
|
-
researchOrientation!: number;
|
|
52
|
-
recognitionNeed!: number;
|
|
53
|
-
brandLoyalty!: number;
|
|
54
|
-
patientEmpathy!: number;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export class ProfessionalProfileDto {
|
|
58
|
-
practiceSettings!: string;
|
|
59
|
-
yearOfExperience!: number;
|
|
60
|
-
specialityAndDepartment!: string;
|
|
61
|
-
location!: string;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
export class ContextDto {
|
|
65
|
-
subSpecialityOrTherapyFocus!: string;
|
|
66
|
-
typicalPatientMix!: string;
|
|
67
|
-
keyClinicalDrivers!: string;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export class CharacterCreateDto {
|
|
71
|
-
name!: string;
|
|
72
|
-
professionalProfile!: ProfessionalProfileDto;
|
|
73
|
-
segment!: SegmentType;
|
|
74
|
-
personalityAndBehaviour!: PersonalityAndBehaviourDto;
|
|
75
|
-
context!: ContextDto;
|
|
76
|
-
assistantGender?: AssistantVoiceGender;
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
export class ProductConfig {
|
|
80
|
-
name!: string;
|
|
81
|
-
description!: string;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export class CreateSimulationDto {
|
|
85
|
-
persona!: CharacterCreateDto;
|
|
86
|
-
product!: ProductConfig;
|
|
87
|
-
presentation?: string;
|
|
88
|
-
scenario!: string;
|
|
89
|
-
objectives?: string;
|
|
90
|
-
anticipatedObjections?: string;
|
|
91
|
-
imageId!: string;
|
|
92
|
-
avatarLanguage!: AvatarLanguage;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export type RecordingsLimit = 5 | 10 | 25;
|
|
96
|
-
|
|
97
|
-
export class SimulationRecordingsQueryDto {
|
|
98
|
-
limit?: RecordingsLimit;
|
|
99
|
-
page?: number;
|
|
100
|
-
sort?: SortOrder;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export enum SortOrder {
|
|
104
|
-
ASC = 'asc',
|
|
105
|
-
DESC = 'desc',
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
export enum RecordingStatus {
|
|
109
|
-
STARTED = 'STARTED',
|
|
110
|
-
PROCESSING = 'PROCESSING',
|
|
111
|
-
FINISHED = 'FINISHED',
|
|
112
|
-
FAILED = 'FAILED',
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export class SimulationRecordingsDto {
|
|
116
|
-
_id!: string;
|
|
117
|
-
createdAt!: Date;
|
|
118
|
-
recordingStatus?: RecordingStatus;
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
//
|
|
122
|
-
export interface CallCreateDto {
|
|
123
|
-
/**
|
|
124
|
-
* Call ID obtained
|
|
125
|
-
*/
|
|
126
|
-
callId: string;
|
|
127
|
-
/**
|
|
128
|
-
* Call Assistant ID
|
|
129
|
-
*/
|
|
130
|
-
assistantId: string;
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
export interface CallDTO {
|
|
134
|
-
/**
|
|
135
|
-
* call ID
|
|
136
|
-
*/
|
|
137
|
-
_id: string;
|
|
138
|
-
/**
|
|
139
|
-
* call ID obtained
|
|
140
|
-
*/
|
|
141
|
-
callId: string;
|
|
142
|
-
/**
|
|
143
|
-
* call User ID
|
|
144
|
-
*/
|
|
145
|
-
platoUserId: string;
|
|
146
|
-
/**
|
|
147
|
-
* call Assistant ID
|
|
148
|
-
*/
|
|
149
|
-
assistantId: string;
|
|
150
|
-
/**
|
|
151
|
-
* call summary of the conversation
|
|
152
|
-
*/
|
|
153
|
-
summary: string;
|
|
154
|
-
/**
|
|
155
|
-
* call transcript of the conversation
|
|
156
|
-
*/
|
|
157
|
-
transcript: string;
|
|
158
|
-
/**
|
|
159
|
-
* call feedback provided by the user
|
|
160
|
-
*/
|
|
161
|
-
feedback: string;
|
|
162
|
-
/**
|
|
163
|
-
* Success Evaluation returned by model
|
|
164
|
-
*/
|
|
165
|
-
successEvaluation: boolean;
|
|
166
|
-
/**
|
|
167
|
-
* call Recording URL
|
|
168
|
-
*/
|
|
169
|
-
recordingUrl: string;
|
|
170
|
-
/**
|
|
171
|
-
* Status of recording processing (e.g., 'STARTED', 'PROCESSING', 'FINISHED', 'FAILED')
|
|
172
|
-
*/
|
|
173
|
-
recordingStatus?: RecordingStatus;
|
|
174
|
-
/**
|
|
175
|
-
* Date and Time of the creation of the message
|
|
176
|
-
*/
|
|
177
|
-
createdAt: Date;
|
|
178
|
-
/**
|
|
179
|
-
* Date and Time of the creation of the message
|
|
180
|
-
*/
|
|
181
|
-
endedAt: Date;
|
|
182
|
-
/**
|
|
183
|
-
* Rating of the call given by the user
|
|
184
|
-
*/
|
|
185
|
-
rating: number;
|
|
186
|
-
/**
|
|
187
|
-
* Main strenghts of the user conversation based on the analysis of the AI
|
|
188
|
-
*/
|
|
189
|
-
strengths: Array<string>;
|
|
190
|
-
/**
|
|
191
|
-
* Main weak points of the user conversation based on the analysis of the AI
|
|
192
|
-
*/
|
|
193
|
-
weaknesses: Array<string>;
|
|
194
|
-
/**
|
|
195
|
-
* Name of Metric for the AI feedback report
|
|
196
|
-
*/
|
|
197
|
-
metric1: string;
|
|
198
|
-
/**
|
|
199
|
-
* Name of Metric for the AI feedback report
|
|
200
|
-
*/
|
|
201
|
-
metric2: string;
|
|
202
|
-
/**
|
|
203
|
-
* Name of Metric for the AI feedback report
|
|
204
|
-
*/
|
|
205
|
-
metric3: string;
|
|
206
|
-
/**
|
|
207
|
-
* AI feedback value for Metric 1
|
|
208
|
-
*/
|
|
209
|
-
metric1Value: number;
|
|
210
|
-
/**
|
|
211
|
-
* AI feedback value for Metric 2
|
|
212
|
-
*/
|
|
213
|
-
metric2Value: number;
|
|
214
|
-
/**
|
|
215
|
-
* AI feedback value for Metric 3
|
|
216
|
-
*/
|
|
217
|
-
metric3Value: number;
|
|
218
|
-
/**
|
|
219
|
-
* AI feedback value for the call score
|
|
220
|
-
*/
|
|
221
|
-
score?: number;
|
|
222
|
-
/**
|
|
223
|
-
* Defines if the calls will be consider for the memory feature
|
|
224
|
-
*/
|
|
225
|
-
inMemory: boolean;
|
|
226
|
-
/**
|
|
227
|
-
* Duration of the call in milliseconds
|
|
228
|
-
*/
|
|
229
|
-
callDurationMs?: number;
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export enum CreationPhase {
|
|
233
|
-
QUEUED = 'QUEUED',
|
|
234
|
-
STARTING = 'STARTING',
|
|
235
|
-
BUILD_HEADER = 'BUILD_HEADER',
|
|
236
|
-
SEGMENT_SELECTED = 'SEGMENT_SELECTED',
|
|
237
|
-
BUILD_CONTEXT = 'BUILD_CONTEXT',
|
|
238
|
-
BUILD_PSYCHOGRAPHICS = 'BUILD_PSYCHOGRAPHICS',
|
|
239
|
-
BUILD_OBJECTIVES = 'BUILD_OBJECTIVES',
|
|
240
|
-
PERSONA_ASSEMBLED = 'PERSONA_ASSEMBLED',
|
|
241
|
-
CORE = 'CORE',
|
|
242
|
-
BOUNDARIES = 'BOUNDARIES',
|
|
243
|
-
SPEECH_AND_THOUGHT = 'SPEECH_AND_THOUGHT',
|
|
244
|
-
CONVERSATION_EVOLUTION = 'CONVERSATION_EVOLUTION',
|
|
245
|
-
MEMORY = 'MEMORY',
|
|
246
|
-
OBJECTION_HANDLING = 'OBJECTION_HANDLING',
|
|
247
|
-
PERFORMANCE_EVALUATION = 'PERFORMANCE_EVALUATION',
|
|
248
|
-
BEHAVIORAL_FRAMEWORKS = 'BEHAVIORAL_FRAMEWORKS',
|
|
249
|
-
FINISHED = 'FINISHED',
|
|
250
|
-
ERROR = 'ERROR',
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
/**
|
|
254
|
-
* Presigned POST data for S3 upload.
|
|
255
|
-
*/
|
|
256
|
-
export interface PresignedPost {
|
|
257
|
-
url: string;
|
|
258
|
-
fields: Record<string, string>;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Response for requesting a PDF upload.
|
|
263
|
-
*/
|
|
264
|
-
export interface RequestPdfUploadResponse {
|
|
265
|
-
presignedPost: PresignedPost;
|
|
266
|
-
objectKey: string;
|
|
267
|
-
pdfId: string;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
/**
|
|
271
|
-
* Persona description within simulation briefing
|
|
272
|
-
*/
|
|
273
|
-
export interface PersonaDescriptionDto {
|
|
274
|
-
summary: string;
|
|
275
|
-
details: string[];
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* Scenario context within simulation briefing
|
|
280
|
-
*/
|
|
281
|
-
export interface ScenarioContextDto {
|
|
282
|
-
summary: string;
|
|
283
|
-
steps: string[];
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* Training objectives within simulation briefing
|
|
288
|
-
*/
|
|
289
|
-
export interface TrainingObjectiveDto {
|
|
290
|
-
summary: string;
|
|
291
|
-
keyObjectives: string[];
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* Complete simulation briefing structure generated by multi-agent system
|
|
296
|
-
*/
|
|
297
|
-
export interface SimulationBriefingDto {
|
|
298
|
-
objectiveTag: string;
|
|
299
|
-
personaDescription: PersonaDescriptionDto;
|
|
300
|
-
scenarioContext: ScenarioContextDto;
|
|
301
|
-
trainingObjective: TrainingObjectiveDto;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
export interface SimulationDetailsDto {
|
|
305
|
-
simulationId: string;
|
|
306
|
-
phase: CreationPhase;
|
|
307
|
-
assistantId: string;
|
|
308
|
-
configuration?: CreateSimulationDto;
|
|
309
|
-
simulationBriefing?: SimulationBriefingDto;
|
|
310
|
-
createdAt: Date;
|
|
311
|
-
updatedAt: Date;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
export enum RecommendationPriority {
|
|
315
|
-
HIGH = 'high',
|
|
316
|
-
MEDIUM = 'medium',
|
|
317
|
-
LOW = 'low',
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
export interface RecommendationItemDto {
|
|
321
|
-
title: string;
|
|
322
|
-
description: string;
|
|
323
|
-
priority: RecommendationPriority;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
export interface PerformancePatternDto {
|
|
327
|
-
strength: string;
|
|
328
|
-
frequency: number;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
export interface ImprovementAreaDto {
|
|
332
|
-
area: string;
|
|
333
|
-
frequency: number;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
export interface RecommendationsResponseDto {
|
|
337
|
-
recommendations: RecommendationItemDto[];
|
|
338
|
-
strengths: PerformancePatternDto[];
|
|
339
|
-
improvementAreas: ImprovementAreaDto[];
|
|
340
|
-
summary: string;
|
|
341
|
-
callsAnalyzed: number;
|
|
342
|
-
generatedAt: Date;
|
|
343
|
-
}
|
|
344
|
-
|
|
345
|
-
export enum PdfSlidesStatus {
|
|
346
|
-
PENDING = 'pending',
|
|
347
|
-
STARTED = 'started',
|
|
348
|
-
PROCESSING = 'processing',
|
|
349
|
-
OVERVIEW = 'overview',
|
|
350
|
-
COMPLETED = 'completed',
|
|
351
|
-
FAILED = 'failed',
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
export interface CheckPdfStatusResponse {
|
|
355
|
-
status: PdfSlidesStatus;
|
|
356
|
-
processedBatches: number[];
|
|
357
|
-
totalBatches?: number;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
export enum PdfSlidesSortField {
|
|
361
|
-
CREATED_AT = 'createdAt',
|
|
362
|
-
FILENAME = 'originalFilename',
|
|
363
|
-
TOTAL_SLIDES = 'totalSlides',
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
export class PdfSlidesAnalysisQueryDto {
|
|
367
|
-
limit?: RecordingsLimit;
|
|
368
|
-
page?: number;
|
|
369
|
-
sort?: SortOrder;
|
|
370
|
-
sortBy?: PdfSlidesSortField;
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
export interface SlideAnalysis {
|
|
374
|
-
slideNumber: number;
|
|
375
|
-
title?: string;
|
|
376
|
-
textExtraction?: string;
|
|
377
|
-
visualDescription?: string;
|
|
378
|
-
}
|
|
379
|
-
|
|
380
|
-
export interface PdfSlidesDto {
|
|
381
|
-
_id: string;
|
|
382
|
-
status: PdfSlidesStatus;
|
|
383
|
-
originalFilename: string;
|
|
384
|
-
totalSlides?: number;
|
|
385
|
-
lessonOverview?: string;
|
|
386
|
-
createdAt: Date;
|
|
387
|
-
updatedAt: Date;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
export interface PdfSlideDto {
|
|
391
|
-
_id: string;
|
|
392
|
-
status: PdfSlidesStatus;
|
|
393
|
-
originalFilename: string;
|
|
394
|
-
totalSlides?: number;
|
|
395
|
-
lessonOverview?: string;
|
|
396
|
-
slideAnalysis?: SlideAnalysis[];
|
|
397
|
-
createdAt: Date;
|
|
398
|
-
updatedAt: Date;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
|
-
export interface AssistantImageDto {
|
|
402
|
-
_id: string;
|
|
403
|
-
imageUrl: string;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
/**
|
|
407
|
-
* Represents the state of an active call stored in localStorage for recovery purposes.
|
|
408
|
-
* Used to detect and recover abandoned calls after page refresh.
|
|
409
|
-
*/
|
|
410
|
-
export interface ActiveCallState {
|
|
411
|
-
/**
|
|
412
|
-
* MongoDB ID of the call record
|
|
413
|
-
*/
|
|
414
|
-
callId: string;
|
|
415
|
-
/**
|
|
416
|
-
* External call provider ID
|
|
417
|
-
*/
|
|
418
|
-
externalCallId: string;
|
|
419
|
-
/**
|
|
420
|
-
* ID of the simulation this call belongs to
|
|
421
|
-
*/
|
|
422
|
-
simulationId: string;
|
|
423
|
-
/**
|
|
424
|
-
* ISO 8601 timestamp when the call was started
|
|
425
|
-
*/
|
|
426
|
-
startedAt: string;
|
|
427
|
-
/**
|
|
428
|
-
* Schema version for future compatibility
|
|
429
|
-
*/
|
|
430
|
-
version: number;
|
|
431
|
-
}
|