@ctchealth/plato-sdk 0.0.19 → 0.0.20

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.
@@ -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>;
@@ -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,433 +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
- Arabic = 'ar',
48
- Russian = 'ru',
49
- }
50
-
51
- export class PersonalityAndBehaviourDto {
52
- riskTolerance!: number;
53
- researchOrientation!: number;
54
- recognitionNeed!: number;
55
- brandLoyalty!: number;
56
- patientEmpathy!: number;
57
- }
58
-
59
- export class ProfessionalProfileDto {
60
- practiceSettings!: string;
61
- yearOfExperience!: number;
62
- specialityAndDepartment!: string;
63
- location!: string;
64
- }
65
-
66
- export class ContextDto {
67
- subSpecialityOrTherapyFocus!: string;
68
- typicalPatientMix!: string;
69
- keyClinicalDrivers!: string;
70
- }
71
-
72
- export class CharacterCreateDto {
73
- name!: string;
74
- professionalProfile!: ProfessionalProfileDto;
75
- segment!: SegmentType;
76
- personalityAndBehaviour!: PersonalityAndBehaviourDto;
77
- context!: ContextDto;
78
- assistantGender?: AssistantVoiceGender;
79
- }
80
-
81
- export class ProductConfig {
82
- name!: string;
83
- description!: string;
84
- }
85
-
86
- export class CreateSimulationDto {
87
- persona!: CharacterCreateDto;
88
- product!: ProductConfig;
89
- scenario!: string;
90
- objectives?: string;
91
- anticipatedObjections?: string;
92
- imageId!: string;
93
- avatarLanguage!: AvatarLanguage;
94
- pdfSlideId?: string;
95
- }
96
-
97
- export type RecordingsLimit = 5 | 10 | 25;
98
-
99
- export class SimulationRecordingsQueryDto {
100
- limit?: RecordingsLimit;
101
- page?: number;
102
- sort?: SortOrder;
103
- }
104
-
105
- export enum SortOrder {
106
- ASC = 'asc',
107
- DESC = 'desc',
108
- }
109
-
110
- export enum RecordingStatus {
111
- STARTED = 'STARTED',
112
- PROCESSING = 'PROCESSING',
113
- FINISHED = 'FINISHED',
114
- FAILED = 'FAILED',
115
- }
116
-
117
- export class SimulationRecordingsDto {
118
- _id!: string;
119
- createdAt!: Date;
120
- recordingStatus?: RecordingStatus;
121
- }
122
-
123
- //
124
- export interface CallCreateDto {
125
- /**
126
- * Call ID obtained
127
- */
128
- callId: string;
129
- /**
130
- * Call Assistant ID
131
- */
132
- assistantId: string;
133
- }
134
-
135
- export interface CallDTO {
136
- /**
137
- * call ID
138
- */
139
- _id: string;
140
- /**
141
- * call ID obtained
142
- */
143
- callId: string;
144
- /**
145
- * call User ID
146
- */
147
- platoUserId: string;
148
- /**
149
- * call Assistant ID
150
- */
151
- assistantId: string;
152
- /**
153
- * call summary of the conversation
154
- */
155
- summary: string;
156
- /**
157
- * call transcript of the conversation
158
- */
159
- transcript: string;
160
- /**
161
- * call feedback provided by the user
162
- */
163
- feedback: string;
164
- /**
165
- * Success Evaluation returned by model
166
- */
167
- successEvaluation: boolean;
168
- /**
169
- * call Recording URL
170
- */
171
- recordingUrl: string;
172
- /**
173
- * Status of recording processing (e.g., 'STARTED', 'PROCESSING', 'FINISHED', 'FAILED')
174
- */
175
- recordingStatus?: RecordingStatus;
176
- /**
177
- * Date and Time of the creation of the message
178
- */
179
- createdAt: Date;
180
- /**
181
- * Date and Time of the creation of the message
182
- */
183
- endedAt: Date;
184
- /**
185
- * Rating of the call given by the user
186
- */
187
- rating: number;
188
- /**
189
- * Main strenghts of the user conversation based on the analysis of the AI
190
- */
191
- strengths: Array<string>;
192
- /**
193
- * Main weak points of the user conversation based on the analysis of the AI
194
- */
195
- weaknesses: Array<string>;
196
- /**
197
- * Name of Metric for the AI feedback report
198
- */
199
- metric1: string;
200
- /**
201
- * Name of Metric for the AI feedback report
202
- */
203
- metric2: string;
204
- /**
205
- * Name of Metric for the AI feedback report
206
- */
207
- metric3: string;
208
- /**
209
- * AI feedback value for Metric 1
210
- */
211
- metric1Value: number;
212
- /**
213
- * AI feedback value for Metric 2
214
- */
215
- metric2Value: number;
216
- /**
217
- * AI feedback value for Metric 3
218
- */
219
- metric3Value: number;
220
- /**
221
- * AI feedback value for the call score
222
- */
223
- score?: number;
224
- /**
225
- * Defines if the calls will be consider for the memory feature
226
- */
227
- inMemory: boolean;
228
- /**
229
- * Duration of the call in milliseconds
230
- */
231
- callDurationMs?: number;
232
- }
233
-
234
- export enum CreationPhase {
235
- QUEUED = 'QUEUED',
236
- STARTING = 'STARTING',
237
- BUILD_HEADER = 'BUILD_HEADER',
238
- SEGMENT_SELECTED = 'SEGMENT_SELECTED',
239
- BUILD_CONTEXT = 'BUILD_CONTEXT',
240
- BUILD_PSYCHOGRAPHICS = 'BUILD_PSYCHOGRAPHICS',
241
- BUILD_OBJECTIVES = 'BUILD_OBJECTIVES',
242
- PERSONA_ASSEMBLED = 'PERSONA_ASSEMBLED',
243
- CORE = 'CORE',
244
- BOUNDARIES = 'BOUNDARIES',
245
- SPEECH_AND_THOUGHT = 'SPEECH_AND_THOUGHT',
246
- CONVERSATION_EVOLUTION = 'CONVERSATION_EVOLUTION',
247
- MEMORY = 'MEMORY',
248
- OBJECTION_HANDLING = 'OBJECTION_HANDLING',
249
- PERFORMANCE_EVALUATION = 'PERFORMANCE_EVALUATION',
250
- BEHAVIORAL_FRAMEWORKS = 'BEHAVIORAL_FRAMEWORKS',
251
- FINISHED = 'FINISHED',
252
- ERROR = 'ERROR',
253
- }
254
-
255
- /**
256
- * Presigned POST data for S3 upload.
257
- */
258
- export interface PresignedPost {
259
- url: string;
260
- fields: Record<string, string>;
261
- }
262
-
263
- /**
264
- * Response for requesting a PDF upload.
265
- */
266
- export interface RequestPdfUploadResponse {
267
- presignedPost: PresignedPost;
268
- objectKey: string;
269
- pdfId: string;
270
- }
271
-
272
- /**
273
- * Persona description within simulation briefing
274
- */
275
- export interface PersonaDescriptionDto {
276
- summary: string;
277
- details: string[];
278
- }
279
-
280
- /**
281
- * Scenario context within simulation briefing
282
- */
283
- export interface ScenarioContextDto {
284
- summary: string;
285
- steps: string[];
286
- }
287
-
288
- /**
289
- * Training objectives within simulation briefing
290
- */
291
- export interface TrainingObjectiveDto {
292
- summary: string;
293
- keyObjectives: string[];
294
- }
295
-
296
- /**
297
- * Complete simulation briefing structure generated by multi-agent system
298
- */
299
- export interface SimulationBriefingDto {
300
- objectiveTag: string;
301
- personaDescription: PersonaDescriptionDto;
302
- scenarioContext: ScenarioContextDto;
303
- trainingObjective: TrainingObjectiveDto;
304
- }
305
-
306
- export interface SimulationDetailsDto {
307
- simulationId: string;
308
- phase: CreationPhase;
309
- assistantId: string;
310
- configuration?: CreateSimulationDto;
311
- simulationBriefing?: SimulationBriefingDto;
312
- createdAt: Date;
313
- updatedAt: Date;
314
- }
315
-
316
- export enum RecommendationPriority {
317
- HIGH = 'high',
318
- MEDIUM = 'medium',
319
- LOW = 'low',
320
- }
321
-
322
- export interface RecommendationItemDto {
323
- title: string;
324
- description: string;
325
- priority: RecommendationPriority;
326
- }
327
-
328
- export interface PerformancePatternDto {
329
- strength: string;
330
- frequency: number;
331
- }
332
-
333
- export interface ImprovementAreaDto {
334
- area: string;
335
- frequency: number;
336
- }
337
-
338
- export interface RecommendationsResponseDto {
339
- recommendations: RecommendationItemDto[];
340
- strengths: PerformancePatternDto[];
341
- improvementAreas: ImprovementAreaDto[];
342
- summary: string;
343
- callsAnalyzed: number;
344
- generatedAt: Date;
345
- }
346
-
347
- export enum PdfSlidesStatus {
348
- PENDING = 'pending',
349
- STARTED = 'started',
350
- PROCESSING = 'processing',
351
- OVERVIEW = 'overview',
352
- COMPLETED = 'completed',
353
- FAILED = 'failed',
354
- }
355
-
356
- export interface CheckPdfStatusResponse {
357
- status: PdfSlidesStatus;
358
- processedBatches: number[];
359
- totalBatches?: number;
360
- }
361
-
362
- export enum PdfSlidesSortField {
363
- CREATED_AT = 'createdAt',
364
- FILENAME = 'originalFilename',
365
- TOTAL_SLIDES = 'totalSlides',
366
- }
367
-
368
- export class PdfSlidesAnalysisQueryDto {
369
- limit?: RecordingsLimit;
370
- page?: number;
371
- sort?: SortOrder;
372
- sortBy?: PdfSlidesSortField;
373
- }
374
-
375
- export interface SlideAnalysis {
376
- slideNumber: number;
377
- title?: string;
378
- textExtraction?: string;
379
- visualDescription?: string;
380
- }
381
-
382
- export interface PdfSlidesDto {
383
- _id: string;
384
- status: PdfSlidesStatus;
385
- originalFilename: string;
386
- totalSlides?: number;
387
- lessonOverview?: string;
388
- createdAt: Date;
389
- updatedAt: Date;
390
- }
391
-
392
- export interface PdfSlideDto {
393
- _id: string;
394
- status: PdfSlidesStatus;
395
- originalFilename: string;
396
- totalSlides?: number;
397
- lessonOverview?: string;
398
- slideAnalysis?: SlideAnalysis[];
399
- createdAt: Date;
400
- updatedAt: Date;
401
- }
402
-
403
- export interface AssistantImageDto {
404
- _id: string;
405
- imageUrl: string;
406
- }
407
-
408
- /**
409
- * Represents the state of an active call stored in localStorage for recovery purposes.
410
- * Used to detect and recover abandoned calls after page refresh.
411
- */
412
- export interface ActiveCallState {
413
- /**
414
- * MongoDB ID of the call record
415
- */
416
- callId: string;
417
- /**
418
- * External call provider ID
419
- */
420
- externalCallId: string;
421
- /**
422
- * ID of the simulation this call belongs to
423
- */
424
- simulationId: string;
425
- /**
426
- * ISO 8601 timestamp when the call was started
427
- */
428
- startedAt: string;
429
- /**
430
- * Schema version for future compatibility
431
- */
432
- version: number;
433
- }