@webex/internal-plugin-voicea 2.59.2 → 2.59.3-next.1
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/.eslintrc.js +6 -6
- package/LICENSE +1 -1
- package/README.md +93 -93
- package/babel.config.js +3 -3
- package/dist/constants.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/utils.js.map +1 -1
- package/dist/voicea.js +43 -43
- package/dist/voicea.js.map +1 -1
- package/dist/voicea.types.js.map +1 -1
- package/jest.config.js +3 -3
- package/package.json +17 -16
- package/process +1 -1
- package/src/constants.ts +32 -32
- package/src/index.ts +7 -7
- package/src/utils.ts +7 -7
- package/src/voicea.ts +378 -378
- package/src/voicea.types.ts +92 -92
- package/test/unit/spec/utils.js +12 -12
- package/test/unit/spec/voicea.js +617 -617
package/src/voicea.types.ts
CHANGED
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
/* eslint-disable camelcase */
|
|
2
|
-
/* eslint-disable no-undef */
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Type for payload
|
|
6
|
-
*/
|
|
7
|
-
interface AnnouncementPayload {
|
|
8
|
-
translation: {
|
|
9
|
-
max_languages: number;
|
|
10
|
-
allowed_languages: string[];
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
ASR: {
|
|
14
|
-
spoken_languages: string[];
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
// eslint-disable-next-line no-undef
|
|
19
|
-
type TRANSCRIPTION_TYPES =
|
|
20
|
-
| 'unknown'
|
|
21
|
-
| 'eva_wake'
|
|
22
|
-
| 'eva_thanks'
|
|
23
|
-
| 'eva_cancel'
|
|
24
|
-
| 'highlight_created'
|
|
25
|
-
| 'transcript_interim_results'
|
|
26
|
-
| 'transcript_final_result';
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Class for an Transcription Object
|
|
30
|
-
*/
|
|
31
|
-
interface Transcription {
|
|
32
|
-
start_millis: number;
|
|
33
|
-
end_millis: number;
|
|
34
|
-
text: string;
|
|
35
|
-
transcript_language_code: string;
|
|
36
|
-
translations: {[x: string]: string};
|
|
37
|
-
csis: number[];
|
|
38
|
-
last_packet_timestamp_ms: number;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Highlights
|
|
43
|
-
*/
|
|
44
|
-
interface Highlight {
|
|
45
|
-
highlight_id: string;
|
|
46
|
-
transcript: string;
|
|
47
|
-
highlight_label: string;
|
|
48
|
-
highlight_source: string;
|
|
49
|
-
start_millis: number;
|
|
50
|
-
end_millis: number;
|
|
51
|
-
csis: number[];
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Type for Transcription message
|
|
55
|
-
*/
|
|
56
|
-
interface TranscriptionResponse {
|
|
57
|
-
type: TRANSCRIPTION_TYPES;
|
|
58
|
-
transcript_id: string;
|
|
59
|
-
translations?: {[x: string]: string};
|
|
60
|
-
transcripts?: Transcription[];
|
|
61
|
-
transcript?: Transcription;
|
|
62
|
-
highlight?: Highlight;
|
|
63
|
-
csis: number[];
|
|
64
|
-
data: string;
|
|
65
|
-
command_response: string;
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Type for CaptionLanguageResponse
|
|
69
|
-
*/
|
|
70
|
-
interface CaptionLanguageResponse {
|
|
71
|
-
requestId: string;
|
|
72
|
-
statusCode: number;
|
|
73
|
-
errorCode: number;
|
|
74
|
-
message: string;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
interface IVoiceaChannel {
|
|
78
|
-
setSpokenLanguage: (languageCode: string) => Promise<void>;
|
|
79
|
-
requestLanguage: (languageCode: string) => void;
|
|
80
|
-
turnOnCaptions: () => undefined | Promise<void>;
|
|
81
|
-
toggleTranscribing: (activate: boolean) => undefined | Promise<void>;
|
|
82
|
-
deregisterEvents: () => undefined | Promise<void>;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export type {
|
|
86
|
-
AnnouncementPayload,
|
|
87
|
-
CaptionLanguageResponse,
|
|
88
|
-
TranscriptionResponse,
|
|
89
|
-
Transcription,
|
|
90
|
-
Highlight,
|
|
91
|
-
IVoiceaChannel,
|
|
92
|
-
};
|
|
1
|
+
/* eslint-disable camelcase */
|
|
2
|
+
/* eslint-disable no-undef */
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Type for payload
|
|
6
|
+
*/
|
|
7
|
+
interface AnnouncementPayload {
|
|
8
|
+
translation: {
|
|
9
|
+
max_languages: number;
|
|
10
|
+
allowed_languages: string[];
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
ASR: {
|
|
14
|
+
spoken_languages: string[];
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// eslint-disable-next-line no-undef
|
|
19
|
+
type TRANSCRIPTION_TYPES =
|
|
20
|
+
| 'unknown'
|
|
21
|
+
| 'eva_wake'
|
|
22
|
+
| 'eva_thanks'
|
|
23
|
+
| 'eva_cancel'
|
|
24
|
+
| 'highlight_created'
|
|
25
|
+
| 'transcript_interim_results'
|
|
26
|
+
| 'transcript_final_result';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Class for an Transcription Object
|
|
30
|
+
*/
|
|
31
|
+
interface Transcription {
|
|
32
|
+
start_millis: number;
|
|
33
|
+
end_millis: number;
|
|
34
|
+
text: string;
|
|
35
|
+
transcript_language_code: string;
|
|
36
|
+
translations: {[x: string]: string};
|
|
37
|
+
csis: number[];
|
|
38
|
+
last_packet_timestamp_ms: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Highlights
|
|
43
|
+
*/
|
|
44
|
+
interface Highlight {
|
|
45
|
+
highlight_id: string;
|
|
46
|
+
transcript: string;
|
|
47
|
+
highlight_label: string;
|
|
48
|
+
highlight_source: string;
|
|
49
|
+
start_millis: number;
|
|
50
|
+
end_millis: number;
|
|
51
|
+
csis: number[];
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Type for Transcription message
|
|
55
|
+
*/
|
|
56
|
+
interface TranscriptionResponse {
|
|
57
|
+
type: TRANSCRIPTION_TYPES;
|
|
58
|
+
transcript_id: string;
|
|
59
|
+
translations?: {[x: string]: string};
|
|
60
|
+
transcripts?: Transcription[];
|
|
61
|
+
transcript?: Transcription;
|
|
62
|
+
highlight?: Highlight;
|
|
63
|
+
csis: number[];
|
|
64
|
+
data: string;
|
|
65
|
+
command_response: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Type for CaptionLanguageResponse
|
|
69
|
+
*/
|
|
70
|
+
interface CaptionLanguageResponse {
|
|
71
|
+
requestId: string;
|
|
72
|
+
statusCode: number;
|
|
73
|
+
errorCode: number;
|
|
74
|
+
message: string;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
interface IVoiceaChannel {
|
|
78
|
+
setSpokenLanguage: (languageCode: string) => Promise<void>;
|
|
79
|
+
requestLanguage: (languageCode: string) => void;
|
|
80
|
+
turnOnCaptions: () => undefined | Promise<void>;
|
|
81
|
+
toggleTranscribing: (activate: boolean) => undefined | Promise<void>;
|
|
82
|
+
deregisterEvents: () => undefined | Promise<void>;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type {
|
|
86
|
+
AnnouncementPayload,
|
|
87
|
+
CaptionLanguageResponse,
|
|
88
|
+
TranscriptionResponse,
|
|
89
|
+
Transcription,
|
|
90
|
+
Highlight,
|
|
91
|
+
IVoiceaChannel,
|
|
92
|
+
};
|
package/test/unit/spec/utils.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {assert} from '@webex/test-helper-chai';
|
|
2
|
-
import {millisToMinutesAndSeconds} from '@webex/internal-plugin-voicea/src/utils';
|
|
3
|
-
|
|
4
|
-
describe('Voicea utils', () => {
|
|
5
|
-
describe('#millisToMinutesAndSeconds()', () => {
|
|
6
|
-
it('returns the correct timestamp', () => {
|
|
7
|
-
const result = millisToMinutesAndSeconds(2000);
|
|
8
|
-
|
|
9
|
-
assert.equal(result, '0:02');
|
|
10
|
-
});
|
|
11
|
-
});
|
|
12
|
-
});
|
|
1
|
+
import {assert} from '@webex/test-helper-chai';
|
|
2
|
+
import {millisToMinutesAndSeconds} from '@webex/internal-plugin-voicea/src/utils';
|
|
3
|
+
|
|
4
|
+
describe('Voicea utils', () => {
|
|
5
|
+
describe('#millisToMinutesAndSeconds()', () => {
|
|
6
|
+
it('returns the correct timestamp', () => {
|
|
7
|
+
const result = millisToMinutesAndSeconds(2000);
|
|
8
|
+
|
|
9
|
+
assert.equal(result, '0:02');
|
|
10
|
+
});
|
|
11
|
+
});
|
|
12
|
+
});
|