@corti/dictation-web 0.1.16 → 0.1.17
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/dist/DictationServiceSM.d.ts +14 -0
- package/dist/DictationServiceSM.js +80 -0
- package/dist/DictationServiceSM.js.map +1 -0
- package/dist/bundle.js +296 -86
- package/package.json +2 -2
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { DictationConfig, ServerConfig } from './types.js';
|
|
2
|
+
export declare class DictationServiceSpeechMatics extends EventTarget {
|
|
3
|
+
private mediaRecorder;
|
|
4
|
+
private webSocket;
|
|
5
|
+
private serverConfig;
|
|
6
|
+
private dictationConfig;
|
|
7
|
+
constructor(mediaStream: MediaStream, { dictationConfig, serverConfig, }: {
|
|
8
|
+
dictationConfig: DictationConfig;
|
|
9
|
+
serverConfig: ServerConfig;
|
|
10
|
+
});
|
|
11
|
+
private dispatchCustomEvent;
|
|
12
|
+
startRecording(): void;
|
|
13
|
+
stopRecording(): Promise<void>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
export class DictationServiceSpeechMatics extends EventTarget {
|
|
2
|
+
constructor(mediaStream, { dictationConfig, serverConfig, }) {
|
|
3
|
+
super();
|
|
4
|
+
this.mediaRecorder = new MediaRecorder(mediaStream);
|
|
5
|
+
this.serverConfig = serverConfig;
|
|
6
|
+
this.dictationConfig = dictationConfig;
|
|
7
|
+
this.mediaRecorder.ondataavailable = event => {
|
|
8
|
+
if (this.webSocket?.readyState === WebSocket.OPEN) {
|
|
9
|
+
this.webSocket.send(event.data);
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
dispatchCustomEvent(eventName, detail) {
|
|
14
|
+
this.dispatchEvent(new CustomEvent(eventName, {
|
|
15
|
+
detail,
|
|
16
|
+
bubbles: true,
|
|
17
|
+
composed: true,
|
|
18
|
+
}));
|
|
19
|
+
}
|
|
20
|
+
startRecording() {
|
|
21
|
+
if (!this.serverConfig) {
|
|
22
|
+
this.dispatchEvent(new CustomEvent('error', {
|
|
23
|
+
detail: 'Invalid token',
|
|
24
|
+
bubbles: true,
|
|
25
|
+
composed: true,
|
|
26
|
+
}));
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
const url = `wss://api.${this.serverConfig.environment}.corti.app/audio-bridge/v2/transcribe?tenant-name=${this.serverConfig.tenant}&token=Bearer%20${this.serverConfig.accessToken}`;
|
|
30
|
+
this.webSocket = new WebSocket(url);
|
|
31
|
+
this.webSocket.onopen = () => {
|
|
32
|
+
this.webSocket.send(JSON.stringify({
|
|
33
|
+
type: 'config',
|
|
34
|
+
configuration: this.dictationConfig,
|
|
35
|
+
}));
|
|
36
|
+
};
|
|
37
|
+
this.webSocket.onmessage = event => {
|
|
38
|
+
const message = JSON.parse(event.data);
|
|
39
|
+
switch (message.type) {
|
|
40
|
+
case 'CONFIG_ACCEPTED':
|
|
41
|
+
this.mediaRecorder.start(250);
|
|
42
|
+
break;
|
|
43
|
+
case 'CONFIG_DENIED':
|
|
44
|
+
this.dispatchCustomEvent('error', message);
|
|
45
|
+
return this.stopRecording();
|
|
46
|
+
case 'transcript':
|
|
47
|
+
this.dispatchCustomEvent('transcript', message);
|
|
48
|
+
break;
|
|
49
|
+
case 'command':
|
|
50
|
+
this.dispatchCustomEvent('command', message);
|
|
51
|
+
break;
|
|
52
|
+
default:
|
|
53
|
+
console.warn(`Unhandled message type: ${message.type}`);
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
this.webSocket.onerror = event => {
|
|
58
|
+
this.dispatchCustomEvent('error', event);
|
|
59
|
+
};
|
|
60
|
+
this.webSocket.onclose = event => {
|
|
61
|
+
this.dispatchCustomEvent('stream-closed', event);
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
async stopRecording() {
|
|
65
|
+
this.mediaRecorder?.stop();
|
|
66
|
+
if (this.webSocket?.readyState === WebSocket.OPEN) {
|
|
67
|
+
this.webSocket.send(JSON.stringify({ type: 'end' }));
|
|
68
|
+
}
|
|
69
|
+
const timeout = setTimeout(() => {
|
|
70
|
+
if (this.webSocket?.readyState === WebSocket.OPEN) {
|
|
71
|
+
this.webSocket.close();
|
|
72
|
+
}
|
|
73
|
+
}, 10000);
|
|
74
|
+
this.webSocket.onclose = () => {
|
|
75
|
+
this.webSocket?.close();
|
|
76
|
+
clearTimeout(timeout);
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
//# sourceMappingURL=DictationServiceSM.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DictationServiceSM.js","sourceRoot":"","sources":["../src/DictationServiceSM.ts"],"names":[],"mappings":"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","sourcesContent":["import type { DictationConfig, ServerConfig } from './types.js';\n\nexport class DictationServiceSpeechMatics extends EventTarget {\n private mediaRecorder: MediaRecorder;\n private webSocket!: WebSocket;\n private serverConfig: ServerConfig;\n private dictationConfig: DictationConfig;\n\n constructor(\n mediaStream: MediaStream,\n {\n dictationConfig,\n serverConfig,\n }: { dictationConfig: DictationConfig; serverConfig: ServerConfig },\n ) {\n super();\n this.mediaRecorder = new MediaRecorder(mediaStream);\n this.serverConfig = serverConfig;\n this.dictationConfig = dictationConfig;\n\n this.mediaRecorder.ondataavailable = event => {\n if (this.webSocket?.readyState === WebSocket.OPEN) {\n this.webSocket.send(event.data);\n }\n };\n }\n\n private dispatchCustomEvent(eventName: string, detail?: unknown): void {\n this.dispatchEvent(\n new CustomEvent(eventName, {\n detail,\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n public startRecording() {\n if (!this.serverConfig) {\n this.dispatchEvent(\n new CustomEvent('error', {\n detail: 'Invalid token',\n bubbles: true,\n composed: true,\n }),\n );\n return;\n }\n\n const url = `wss://api.${this.serverConfig.environment}.corti.app/audio-bridge/v2/transcribe?tenant-name=${this.serverConfig.tenant}&token=Bearer%20${this.serverConfig.accessToken}`;\n this.webSocket = new WebSocket(url);\n\n this.webSocket.onopen = () => {\n this.webSocket.send(\n JSON.stringify({\n type: 'config',\n configuration: this.dictationConfig,\n }),\n );\n };\n\n this.webSocket.onmessage = event => {\n const message = JSON.parse(event.data);\n switch (message.type) {\n case 'CONFIG_ACCEPTED':\n this.mediaRecorder.start(250);\n break;\n case 'CONFIG_DENIED':\n this.dispatchCustomEvent('error', message);\n return this.stopRecording();\n case 'transcript':\n this.dispatchCustomEvent('transcript', message);\n break;\n case 'command':\n this.dispatchCustomEvent('command', message);\n break;\n default:\n console.warn(`Unhandled message type: ${message.type}`);\n break;\n }\n };\n\n this.webSocket.onerror = event => {\n this.dispatchCustomEvent('error', event);\n };\n\n this.webSocket.onclose = event => {\n this.dispatchCustomEvent('stream-closed', event);\n };\n }\n\n public async stopRecording(): Promise<void> {\n this.mediaRecorder?.stop();\n\n if (this.webSocket?.readyState === WebSocket.OPEN) {\n this.webSocket.send(JSON.stringify({ type: 'end' }));\n }\n\n const timeout: NodeJS.Timeout = setTimeout(() => {\n if (this.webSocket?.readyState === WebSocket.OPEN) {\n this.webSocket.close();\n }\n }, 10000);\n\n this.webSocket.onclose = () => {\n this.webSocket?.close();\n clearTimeout(timeout);\n };\n }\n}\n"]}
|
package/dist/bundle.js
CHANGED
|
@@ -40,6 +40,12 @@ var require_browser = __commonJS({
|
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
42
|
|
|
43
|
+
// (disabled):fs
|
|
44
|
+
var require_fs = __commonJS({
|
|
45
|
+
"(disabled):fs"() {
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
43
49
|
// node_modules/@lit/reactive-element/css-tag.js
|
|
44
50
|
var t = globalThis;
|
|
45
51
|
var e = t.ShadowRoot && (void 0 === t.ShadyCSS || t.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype;
|
|
@@ -3699,6 +3705,191 @@ var Pageable = class extends Page {
|
|
|
3699
3705
|
}
|
|
3700
3706
|
};
|
|
3701
3707
|
|
|
3708
|
+
// node_modules/@corti/sdk/dist/esm/core/file/index.mjs
|
|
3709
|
+
var file_exports = {};
|
|
3710
|
+
__export(file_exports, {
|
|
3711
|
+
toBinaryUploadRequest: () => toBinaryUploadRequest
|
|
3712
|
+
});
|
|
3713
|
+
|
|
3714
|
+
// node_modules/@corti/sdk/dist/esm/core/file/file.mjs
|
|
3715
|
+
var __awaiter12 = function(thisArg, _arguments, P2, generator) {
|
|
3716
|
+
function adopt(value) {
|
|
3717
|
+
return value instanceof P2 ? value : new P2(function(resolve) {
|
|
3718
|
+
resolve(value);
|
|
3719
|
+
});
|
|
3720
|
+
}
|
|
3721
|
+
return new (P2 || (P2 = Promise))(function(resolve, reject) {
|
|
3722
|
+
function fulfilled(value) {
|
|
3723
|
+
try {
|
|
3724
|
+
step(generator.next(value));
|
|
3725
|
+
} catch (e5) {
|
|
3726
|
+
reject(e5);
|
|
3727
|
+
}
|
|
3728
|
+
}
|
|
3729
|
+
function rejected(value) {
|
|
3730
|
+
try {
|
|
3731
|
+
step(generator["throw"](value));
|
|
3732
|
+
} catch (e5) {
|
|
3733
|
+
reject(e5);
|
|
3734
|
+
}
|
|
3735
|
+
}
|
|
3736
|
+
function step(result) {
|
|
3737
|
+
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
3738
|
+
}
|
|
3739
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
3740
|
+
});
|
|
3741
|
+
};
|
|
3742
|
+
function toBinaryUploadRequest(file) {
|
|
3743
|
+
return __awaiter12(this, void 0, void 0, function* () {
|
|
3744
|
+
const { data, filename, contentLength, contentType } = yield getFileWithMetadata(file);
|
|
3745
|
+
const request = {
|
|
3746
|
+
body: data,
|
|
3747
|
+
headers: {}
|
|
3748
|
+
};
|
|
3749
|
+
if (filename) {
|
|
3750
|
+
request.headers["Content-Disposition"] = `attachment; filename="${filename}"`;
|
|
3751
|
+
}
|
|
3752
|
+
if (contentType) {
|
|
3753
|
+
request.headers["Content-Type"] = contentType;
|
|
3754
|
+
}
|
|
3755
|
+
if (contentLength != null) {
|
|
3756
|
+
request.headers["Content-Length"] = contentLength.toString();
|
|
3757
|
+
}
|
|
3758
|
+
return request;
|
|
3759
|
+
});
|
|
3760
|
+
}
|
|
3761
|
+
function getFileWithMetadata(file) {
|
|
3762
|
+
return __awaiter12(this, void 0, void 0, function* () {
|
|
3763
|
+
var _a, _b, _c, _d, _e;
|
|
3764
|
+
if (isFileLike(file)) {
|
|
3765
|
+
return getFileWithMetadata({
|
|
3766
|
+
data: file
|
|
3767
|
+
});
|
|
3768
|
+
}
|
|
3769
|
+
if ("path" in file) {
|
|
3770
|
+
const fs = yield Promise.resolve().then(() => __toESM(require_fs(), 1));
|
|
3771
|
+
if (!fs || !fs.createReadStream) {
|
|
3772
|
+
throw new Error("File path uploads are not supported in this environment.");
|
|
3773
|
+
}
|
|
3774
|
+
const data = fs.createReadStream(file.path);
|
|
3775
|
+
const contentLength = (_a = file.contentLength) !== null && _a !== void 0 ? _a : yield tryGetFileSizeFromPath(file.path);
|
|
3776
|
+
const filename = (_b = file.filename) !== null && _b !== void 0 ? _b : getNameFromPath(file.path);
|
|
3777
|
+
return {
|
|
3778
|
+
data,
|
|
3779
|
+
filename,
|
|
3780
|
+
contentType: file.contentType,
|
|
3781
|
+
contentLength
|
|
3782
|
+
};
|
|
3783
|
+
}
|
|
3784
|
+
if ("data" in file) {
|
|
3785
|
+
const data = file.data;
|
|
3786
|
+
const contentLength = (_c = file.contentLength) !== null && _c !== void 0 ? _c : yield tryGetContentLengthFromFileLike(data);
|
|
3787
|
+
const filename = (_d = file.filename) !== null && _d !== void 0 ? _d : tryGetNameFromFileLike(data);
|
|
3788
|
+
return {
|
|
3789
|
+
data,
|
|
3790
|
+
filename,
|
|
3791
|
+
contentType: (_e = file.contentType) !== null && _e !== void 0 ? _e : tryGetContentTypeFromFileLike(data),
|
|
3792
|
+
contentLength
|
|
3793
|
+
};
|
|
3794
|
+
}
|
|
3795
|
+
throw new Error(`Invalid FileUpload of type ${typeof file}: ${JSON.stringify(file)}`);
|
|
3796
|
+
});
|
|
3797
|
+
}
|
|
3798
|
+
function isFileLike(value) {
|
|
3799
|
+
return isBuffer(value) || isArrayBufferView(value) || isArrayBuffer(value) || isUint8Array(value) || isBlob(value) || isFile(value) || isStreamLike(value) || isReadableStream(value);
|
|
3800
|
+
}
|
|
3801
|
+
function tryGetFileSizeFromPath(path) {
|
|
3802
|
+
return __awaiter12(this, void 0, void 0, function* () {
|
|
3803
|
+
try {
|
|
3804
|
+
const fs = yield Promise.resolve().then(() => __toESM(require_fs(), 1));
|
|
3805
|
+
if (!fs || !fs.promises || !fs.promises.stat) {
|
|
3806
|
+
return void 0;
|
|
3807
|
+
}
|
|
3808
|
+
const fileStat = yield fs.promises.stat(path);
|
|
3809
|
+
return fileStat.size;
|
|
3810
|
+
} catch (fallbackError) {
|
|
3811
|
+
return void 0;
|
|
3812
|
+
}
|
|
3813
|
+
});
|
|
3814
|
+
}
|
|
3815
|
+
function tryGetNameFromFileLike(data) {
|
|
3816
|
+
if (isNamedValue(data)) {
|
|
3817
|
+
return data.name;
|
|
3818
|
+
}
|
|
3819
|
+
if (isPathedValue(data)) {
|
|
3820
|
+
return getNameFromPath(data.path.toString());
|
|
3821
|
+
}
|
|
3822
|
+
return void 0;
|
|
3823
|
+
}
|
|
3824
|
+
function tryGetContentLengthFromFileLike(data) {
|
|
3825
|
+
return __awaiter12(this, void 0, void 0, function* () {
|
|
3826
|
+
if (isBuffer(data)) {
|
|
3827
|
+
return data.length;
|
|
3828
|
+
}
|
|
3829
|
+
if (isArrayBufferView(data)) {
|
|
3830
|
+
return data.byteLength;
|
|
3831
|
+
}
|
|
3832
|
+
if (isArrayBuffer(data)) {
|
|
3833
|
+
return data.byteLength;
|
|
3834
|
+
}
|
|
3835
|
+
if (isBlob(data)) {
|
|
3836
|
+
return data.size;
|
|
3837
|
+
}
|
|
3838
|
+
if (isFile(data)) {
|
|
3839
|
+
return data.size;
|
|
3840
|
+
}
|
|
3841
|
+
if (isPathedValue(data)) {
|
|
3842
|
+
return yield tryGetFileSizeFromPath(data.path.toString());
|
|
3843
|
+
}
|
|
3844
|
+
return void 0;
|
|
3845
|
+
});
|
|
3846
|
+
}
|
|
3847
|
+
function tryGetContentTypeFromFileLike(data) {
|
|
3848
|
+
if (isBlob(data)) {
|
|
3849
|
+
return data.type;
|
|
3850
|
+
}
|
|
3851
|
+
if (isFile(data)) {
|
|
3852
|
+
return data.type;
|
|
3853
|
+
}
|
|
3854
|
+
return void 0;
|
|
3855
|
+
}
|
|
3856
|
+
function getNameFromPath(path) {
|
|
3857
|
+
const lastForwardSlash = path.lastIndexOf("/");
|
|
3858
|
+
const lastBackSlash = path.lastIndexOf("\\");
|
|
3859
|
+
const lastSlashIndex = Math.max(lastForwardSlash, lastBackSlash);
|
|
3860
|
+
return lastSlashIndex >= 0 ? path.substring(lastSlashIndex + 1) : path;
|
|
3861
|
+
}
|
|
3862
|
+
function isNamedValue(value) {
|
|
3863
|
+
return typeof value === "object" && value != null && "name" in value;
|
|
3864
|
+
}
|
|
3865
|
+
function isPathedValue(value) {
|
|
3866
|
+
return typeof value === "object" && value != null && "path" in value;
|
|
3867
|
+
}
|
|
3868
|
+
function isStreamLike(value) {
|
|
3869
|
+
return typeof value === "object" && value != null && ("read" in value || "pipe" in value);
|
|
3870
|
+
}
|
|
3871
|
+
function isReadableStream(value) {
|
|
3872
|
+
return typeof value === "object" && value != null && "getReader" in value;
|
|
3873
|
+
}
|
|
3874
|
+
function isBuffer(value) {
|
|
3875
|
+
return typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(value);
|
|
3876
|
+
}
|
|
3877
|
+
function isArrayBufferView(value) {
|
|
3878
|
+
return typeof ArrayBuffer !== "undefined" && ArrayBuffer.isView(value);
|
|
3879
|
+
}
|
|
3880
|
+
function isArrayBuffer(value) {
|
|
3881
|
+
return typeof ArrayBuffer !== "undefined" && value instanceof ArrayBuffer;
|
|
3882
|
+
}
|
|
3883
|
+
function isUint8Array(value) {
|
|
3884
|
+
return typeof Uint8Array !== "undefined" && value instanceof Uint8Array;
|
|
3885
|
+
}
|
|
3886
|
+
function isBlob(value) {
|
|
3887
|
+
return typeof Blob !== "undefined" && value instanceof Blob;
|
|
3888
|
+
}
|
|
3889
|
+
function isFile(value) {
|
|
3890
|
+
return typeof File !== "undefined" && value instanceof File;
|
|
3891
|
+
}
|
|
3892
|
+
|
|
3702
3893
|
// node_modules/@corti/sdk/dist/esm/serialization/types/StreamConfigStatusMessageType.mjs
|
|
3703
3894
|
var StreamConfigStatusMessageType = schemas_exports.enum_([
|
|
3704
3895
|
"CONFIG_ACCEPTED",
|
|
@@ -4147,8 +4338,8 @@ var TemplatesWritingStyle = schemas_exports.object({
|
|
|
4147
4338
|
name: schemas_exports.string()
|
|
4148
4339
|
});
|
|
4149
4340
|
|
|
4150
|
-
// node_modules/@corti/sdk/dist/esm/serialization/types/
|
|
4151
|
-
var
|
|
4341
|
+
// node_modules/@corti/sdk/dist/esm/serialization/types/TemplatesSectionTranslation.mjs
|
|
4342
|
+
var TemplatesSectionTranslation = schemas_exports.object({
|
|
4152
4343
|
languagesId: schemas_exports.property("languages_id", schemas_exports.string()),
|
|
4153
4344
|
name: schemas_exports.string().optionalNullable(),
|
|
4154
4345
|
description: schemas_exports.string().optionalNullable()
|
|
@@ -4163,7 +4354,7 @@ var TemplatesSection = schemas_exports.object({
|
|
|
4163
4354
|
description: schemas_exports.string(),
|
|
4164
4355
|
defaultWritingStyle: schemas_exports.property("default_writing_style", TemplatesWritingStyle),
|
|
4165
4356
|
sectionType: schemas_exports.property("section_type", schemas_exports.string()),
|
|
4166
|
-
translations: schemas_exports.list(
|
|
4357
|
+
translations: schemas_exports.list(TemplatesSectionTranslation)
|
|
4167
4358
|
});
|
|
4168
4359
|
|
|
4169
4360
|
// node_modules/@corti/sdk/dist/esm/serialization/types/TemplatesSectionListResponse.mjs
|
|
@@ -4177,6 +4368,13 @@ var TemplatesSectionSorted = schemas_exports.object({
|
|
|
4177
4368
|
sectionsId: schemas_exports.property("sections_id", TemplatesSection)
|
|
4178
4369
|
});
|
|
4179
4370
|
|
|
4371
|
+
// node_modules/@corti/sdk/dist/esm/serialization/types/TemplatesTranslation.mjs
|
|
4372
|
+
var TemplatesTranslation = schemas_exports.object({
|
|
4373
|
+
languagesId: schemas_exports.property("languages_id", schemas_exports.string()),
|
|
4374
|
+
name: schemas_exports.string().optional(),
|
|
4375
|
+
description: schemas_exports.string().optional()
|
|
4376
|
+
});
|
|
4377
|
+
|
|
4180
4378
|
// node_modules/@corti/sdk/dist/esm/serialization/types/TemplatesItem.mjs
|
|
4181
4379
|
var TemplatesItem = schemas_exports.object({
|
|
4182
4380
|
dateUpdated: schemas_exports.property("date_updated", schemas_exports.date().optionalNullable()),
|
|
@@ -4466,7 +4664,7 @@ function mergeOnlyDefinedHeaders(...headersArray) {
|
|
|
4466
4664
|
}
|
|
4467
4665
|
|
|
4468
4666
|
// node_modules/@corti/sdk/dist/esm/api/resources/auth/client/Client.mjs
|
|
4469
|
-
var
|
|
4667
|
+
var __awaiter13 = function(thisArg, _arguments, P2, generator) {
|
|
4470
4668
|
function adopt(value) {
|
|
4471
4669
|
return value instanceof P2 ? value : new P2(function(resolve) {
|
|
4472
4670
|
resolve(value);
|
|
@@ -4513,7 +4711,7 @@ var Auth = class {
|
|
|
4513
4711
|
return HttpResponsePromise.fromPromise(this.__getToken(request, requestOptions));
|
|
4514
4712
|
}
|
|
4515
4713
|
__getToken(request, requestOptions) {
|
|
4516
|
-
return
|
|
4714
|
+
return __awaiter13(this, void 0, void 0, function* () {
|
|
4517
4715
|
var _a, _b;
|
|
4518
4716
|
const _response = yield fetcher({
|
|
4519
4717
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).login, "protocol/openid-connect/token"),
|
|
@@ -4569,7 +4767,7 @@ var Auth = class {
|
|
|
4569
4767
|
});
|
|
4570
4768
|
}
|
|
4571
4769
|
_getAuthorizationHeader() {
|
|
4572
|
-
return
|
|
4770
|
+
return __awaiter13(this, void 0, void 0, function* () {
|
|
4573
4771
|
const bearer = yield Supplier.get(this._options.token);
|
|
4574
4772
|
if (bearer != null) {
|
|
4575
4773
|
return `Bearer ${bearer}`;
|
|
@@ -4579,8 +4777,17 @@ var Auth = class {
|
|
|
4579
4777
|
}
|
|
4580
4778
|
};
|
|
4581
4779
|
|
|
4780
|
+
// node_modules/@corti/sdk/dist/esm/custom/utils/getEnvironmentFromString.mjs
|
|
4781
|
+
function getEnvironment(environment) {
|
|
4782
|
+
return typeof environment === "string" ? {
|
|
4783
|
+
base: `https://api.${environment}.corti.app/v2`,
|
|
4784
|
+
wss: `wss://api.${environment}.corti.app`,
|
|
4785
|
+
login: `https://auth.${environment}.corti.app/realms`
|
|
4786
|
+
} : environment;
|
|
4787
|
+
}
|
|
4788
|
+
|
|
4582
4789
|
// node_modules/@corti/sdk/dist/esm/custom/CortiAuth.mjs
|
|
4583
|
-
var
|
|
4790
|
+
var __awaiter14 = function(thisArg, _arguments, P2, generator) {
|
|
4584
4791
|
function adopt(value) {
|
|
4585
4792
|
return value instanceof P2 ? value : new P2(function(resolve) {
|
|
4586
4793
|
resolve(value);
|
|
@@ -4608,6 +4815,12 @@ var __awaiter13 = function(thisArg, _arguments, P2, generator) {
|
|
|
4608
4815
|
});
|
|
4609
4816
|
};
|
|
4610
4817
|
var Auth2 = class extends Auth {
|
|
4818
|
+
/**
|
|
4819
|
+
* Patch: use custom AuthOptions type to support string-based environment
|
|
4820
|
+
*/
|
|
4821
|
+
constructor(_options) {
|
|
4822
|
+
super(Object.assign(Object.assign({}, _options), { environment: getEnvironment(_options.environment) }));
|
|
4823
|
+
}
|
|
4611
4824
|
/**
|
|
4612
4825
|
* Patch: called custom implementation this.__getToken_custom instead of this.__getToken
|
|
4613
4826
|
*/
|
|
@@ -4618,7 +4831,7 @@ var Auth2 = class extends Auth {
|
|
|
4618
4831
|
* Patch: added method to get Authorization URL for Authorization code flow
|
|
4619
4832
|
*/
|
|
4620
4833
|
authorizeURL(_a, options_1) {
|
|
4621
|
-
return
|
|
4834
|
+
return __awaiter14(this, arguments, void 0, function* ({ clientId, redirectUri }, options) {
|
|
4622
4835
|
var _b;
|
|
4623
4836
|
const authUrl = new URL(url_exports.join((_b = yield Supplier.get(this._options.baseUrl)) !== null && _b !== void 0 ? _b : (yield Supplier.get(this._options.environment)).login, yield Supplier.get(this._options.tenantName), "protocol/openid-connect/auth"));
|
|
4624
4837
|
authUrl.searchParams.set("response_type", "code");
|
|
@@ -4647,7 +4860,7 @@ var Auth2 = class extends Auth {
|
|
|
4647
4860
|
* Patch: copy of this.__getToken with patches
|
|
4648
4861
|
*/
|
|
4649
4862
|
__getToken_custom(request, requestOptions) {
|
|
4650
|
-
return
|
|
4863
|
+
return __awaiter14(this, void 0, void 0, function* () {
|
|
4651
4864
|
var _a, _b;
|
|
4652
4865
|
const _response = yield fetcher({
|
|
4653
4866
|
url: url_exports.join(
|
|
@@ -4734,7 +4947,7 @@ var Auth2 = class extends Auth {
|
|
|
4734
4947
|
};
|
|
4735
4948
|
|
|
4736
4949
|
// node_modules/@corti/sdk/dist/esm/api/resources/interactions/client/Client.mjs
|
|
4737
|
-
var
|
|
4950
|
+
var __awaiter15 = function(thisArg, _arguments, P2, generator) {
|
|
4738
4951
|
function adopt(value) {
|
|
4739
4952
|
return value instanceof P2 ? value : new P2(function(resolve) {
|
|
4740
4953
|
resolve(value);
|
|
@@ -4778,8 +4991,8 @@ var Interactions = class {
|
|
|
4778
4991
|
* await client.interactions.list()
|
|
4779
4992
|
*/
|
|
4780
4993
|
list() {
|
|
4781
|
-
return
|
|
4782
|
-
const list2 = HttpResponsePromise.interceptFunction((request2) =>
|
|
4994
|
+
return __awaiter15(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
4995
|
+
const list2 = HttpResponsePromise.interceptFunction((request2) => __awaiter15(this, void 0, void 0, function* () {
|
|
4783
4996
|
var _a, _b, _c, _d;
|
|
4784
4997
|
const { sort, direction, pageSize, index, encounterStatus, patient } = request2;
|
|
4785
4998
|
const _queryParams = {};
|
|
@@ -4924,7 +5137,7 @@ var Interactions = class {
|
|
|
4924
5137
|
return HttpResponsePromise.fromPromise(this.__create(request, requestOptions));
|
|
4925
5138
|
}
|
|
4926
5139
|
__create(request, requestOptions) {
|
|
4927
|
-
return
|
|
5140
|
+
return __awaiter15(this, void 0, void 0, function* () {
|
|
4928
5141
|
var _a, _b;
|
|
4929
5142
|
const _response = yield fetcher({
|
|
4930
5143
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, "interactions/"),
|
|
@@ -5018,7 +5231,7 @@ var Interactions = class {
|
|
|
5018
5231
|
return HttpResponsePromise.fromPromise(this.__get(id, requestOptions));
|
|
5019
5232
|
}
|
|
5020
5233
|
__get(id, requestOptions) {
|
|
5021
|
-
return
|
|
5234
|
+
return __awaiter15(this, void 0, void 0, function* () {
|
|
5022
5235
|
var _a, _b;
|
|
5023
5236
|
const _response = yield fetcher({
|
|
5024
5237
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, `interactions/${encodeURIComponent(Uuid.jsonOrThrow(id, { omitUndefined: true }))}`),
|
|
@@ -5102,7 +5315,7 @@ var Interactions = class {
|
|
|
5102
5315
|
return HttpResponsePromise.fromPromise(this.__delete(id, requestOptions));
|
|
5103
5316
|
}
|
|
5104
5317
|
__delete(id, requestOptions) {
|
|
5105
|
-
return
|
|
5318
|
+
return __awaiter15(this, void 0, void 0, function* () {
|
|
5106
5319
|
var _a, _b;
|
|
5107
5320
|
const _response = yield fetcher({
|
|
5108
5321
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, `interactions/${encodeURIComponent(Uuid.jsonOrThrow(id, { omitUndefined: true }))}`),
|
|
@@ -5178,7 +5391,7 @@ var Interactions = class {
|
|
|
5178
5391
|
return HttpResponsePromise.fromPromise(this.__update(id, request, requestOptions));
|
|
5179
5392
|
}
|
|
5180
5393
|
__update(id_1) {
|
|
5181
|
-
return
|
|
5394
|
+
return __awaiter15(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
5182
5395
|
var _a, _b;
|
|
5183
5396
|
const _response = yield fetcher({
|
|
5184
5397
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, `interactions/${encodeURIComponent(Uuid.jsonOrThrow(id, { omitUndefined: true }))}`),
|
|
@@ -5253,7 +5466,7 @@ var Interactions = class {
|
|
|
5253
5466
|
});
|
|
5254
5467
|
}
|
|
5255
5468
|
_getAuthorizationHeader() {
|
|
5256
|
-
return
|
|
5469
|
+
return __awaiter15(this, void 0, void 0, function* () {
|
|
5257
5470
|
const bearer = yield Supplier.get(this._options.token);
|
|
5258
5471
|
if (bearer != null) {
|
|
5259
5472
|
return `Bearer ${bearer}`;
|
|
@@ -5264,7 +5477,7 @@ var Interactions = class {
|
|
|
5264
5477
|
};
|
|
5265
5478
|
|
|
5266
5479
|
// node_modules/@corti/sdk/dist/esm/api/resources/recordings/client/Client.mjs
|
|
5267
|
-
var
|
|
5480
|
+
var __awaiter16 = function(thisArg, _arguments, P2, generator) {
|
|
5268
5481
|
function adopt(value) {
|
|
5269
5482
|
return value instanceof P2 ? value : new P2(function(resolve) {
|
|
5270
5483
|
resolve(value);
|
|
@@ -5313,7 +5526,7 @@ var Recordings = class {
|
|
|
5313
5526
|
return HttpResponsePromise.fromPromise(this.__list(id, requestOptions));
|
|
5314
5527
|
}
|
|
5315
5528
|
__list(id, requestOptions) {
|
|
5316
|
-
return
|
|
5529
|
+
return __awaiter16(this, void 0, void 0, function* () {
|
|
5317
5530
|
var _a, _b;
|
|
5318
5531
|
const _response = yield fetcher({
|
|
5319
5532
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, `interactions/${encodeURIComponent(Uuid.jsonOrThrow(id, { omitUndefined: true }))}/recordings/`),
|
|
@@ -5388,7 +5601,7 @@ var Recordings = class {
|
|
|
5388
5601
|
/**
|
|
5389
5602
|
* Upload a recording for a given interaction. There is a maximum limit of 60 minutes in length and 150MB in size for recordings.
|
|
5390
5603
|
*
|
|
5391
|
-
* @param {
|
|
5604
|
+
* @param {core.file.Uploadable} uploadable
|
|
5392
5605
|
* @param {Corti.Uuid} id
|
|
5393
5606
|
* @param {Recordings.RequestOptions} requestOptions - Request-specific configuration.
|
|
5394
5607
|
*
|
|
@@ -5397,23 +5610,24 @@ var Recordings = class {
|
|
|
5397
5610
|
* @throws {@link Corti.InternalServerError}
|
|
5398
5611
|
* @throws {@link Corti.GatewayTimeoutError}
|
|
5399
5612
|
*/
|
|
5400
|
-
upload(
|
|
5401
|
-
return HttpResponsePromise.fromPromise(this.__upload(
|
|
5613
|
+
upload(uploadable, id, requestOptions) {
|
|
5614
|
+
return HttpResponsePromise.fromPromise(this.__upload(uploadable, id, requestOptions));
|
|
5402
5615
|
}
|
|
5403
|
-
__upload(
|
|
5404
|
-
return
|
|
5616
|
+
__upload(uploadable, id, requestOptions) {
|
|
5617
|
+
return __awaiter16(this, void 0, void 0, function* () {
|
|
5405
5618
|
var _a, _b;
|
|
5619
|
+
const _binaryUploadRequest = yield file_exports.toBinaryUploadRequest(uploadable);
|
|
5406
5620
|
const _response = yield fetcher({
|
|
5407
5621
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, `interactions/${encodeURIComponent(Uuid.jsonOrThrow(id, { omitUndefined: true }))}/recordings/`),
|
|
5408
5622
|
method: "POST",
|
|
5409
5623
|
headers: mergeHeaders((_b = this._options) === null || _b === void 0 ? void 0 : _b.headers, mergeOnlyDefinedHeaders({
|
|
5410
5624
|
Authorization: yield this._getAuthorizationHeader(),
|
|
5411
5625
|
"Tenant-Name": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.tenantName
|
|
5412
|
-
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
5626
|
+
}), _binaryUploadRequest.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
5413
5627
|
contentType: "application/octet-stream",
|
|
5414
5628
|
requestType: "bytes",
|
|
5415
5629
|
duplex: "half",
|
|
5416
|
-
body:
|
|
5630
|
+
body: _binaryUploadRequest.body,
|
|
5417
5631
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 6e4,
|
|
5418
5632
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
5419
5633
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal
|
|
@@ -5489,7 +5703,7 @@ var Recordings = class {
|
|
|
5489
5703
|
return HttpResponsePromise.fromPromise(this.__get(id, recordingId, requestOptions));
|
|
5490
5704
|
}
|
|
5491
5705
|
__get(id, recordingId, requestOptions) {
|
|
5492
|
-
return
|
|
5706
|
+
return __awaiter16(this, void 0, void 0, function* () {
|
|
5493
5707
|
var _a, _b;
|
|
5494
5708
|
const _response = yield fetcher({
|
|
5495
5709
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, `interactions/${encodeURIComponent(Uuid.jsonOrThrow(id, { omitUndefined: true }))}/recordings/${encodeURIComponent(Uuid.jsonOrThrow(recordingId, { omitUndefined: true }))}`),
|
|
@@ -5580,7 +5794,7 @@ var Recordings = class {
|
|
|
5580
5794
|
return HttpResponsePromise.fromPromise(this.__delete(id, recordingId, requestOptions));
|
|
5581
5795
|
}
|
|
5582
5796
|
__delete(id, recordingId, requestOptions) {
|
|
5583
|
-
return
|
|
5797
|
+
return __awaiter16(this, void 0, void 0, function* () {
|
|
5584
5798
|
var _a, _b;
|
|
5585
5799
|
const _response = yield fetcher({
|
|
5586
5800
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, `interactions/${encodeURIComponent(Uuid.jsonOrThrow(id, { omitUndefined: true }))}/recordings/${encodeURIComponent(Uuid.jsonOrThrow(recordingId, { omitUndefined: true }))}`),
|
|
@@ -5650,7 +5864,7 @@ var Recordings = class {
|
|
|
5650
5864
|
});
|
|
5651
5865
|
}
|
|
5652
5866
|
_getAuthorizationHeader() {
|
|
5653
|
-
return
|
|
5867
|
+
return __awaiter16(this, void 0, void 0, function* () {
|
|
5654
5868
|
const bearer = yield Supplier.get(this._options.token);
|
|
5655
5869
|
if (bearer != null) {
|
|
5656
5870
|
return `Bearer ${bearer}`;
|
|
@@ -5661,7 +5875,7 @@ var Recordings = class {
|
|
|
5661
5875
|
};
|
|
5662
5876
|
|
|
5663
5877
|
// node_modules/@corti/sdk/dist/esm/api/resources/transcripts/client/Client.mjs
|
|
5664
|
-
var
|
|
5878
|
+
var __awaiter17 = function(thisArg, _arguments, P2, generator) {
|
|
5665
5879
|
function adopt(value) {
|
|
5666
5880
|
return value instanceof P2 ? value : new P2(function(resolve) {
|
|
5667
5881
|
resolve(value);
|
|
@@ -5712,7 +5926,7 @@ var Transcripts = class {
|
|
|
5712
5926
|
return HttpResponsePromise.fromPromise(this.__list(id, request, requestOptions));
|
|
5713
5927
|
}
|
|
5714
5928
|
__list(id_1) {
|
|
5715
|
-
return
|
|
5929
|
+
return __awaiter17(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
5716
5930
|
var _a, _b, _c;
|
|
5717
5931
|
const { full } = request;
|
|
5718
5932
|
const _queryParams = {};
|
|
@@ -5816,7 +6030,7 @@ var Transcripts = class {
|
|
|
5816
6030
|
return HttpResponsePromise.fromPromise(this.__create(id, request, requestOptions));
|
|
5817
6031
|
}
|
|
5818
6032
|
__create(id, request, requestOptions) {
|
|
5819
|
-
return
|
|
6033
|
+
return __awaiter17(this, void 0, void 0, function* () {
|
|
5820
6034
|
var _a, _b;
|
|
5821
6035
|
const _response = yield fetcher({
|
|
5822
6036
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, `interactions/${encodeURIComponent(Uuid.jsonOrThrow(id, { omitUndefined: true }))}/transcripts/`),
|
|
@@ -5916,7 +6130,7 @@ var Transcripts = class {
|
|
|
5916
6130
|
return HttpResponsePromise.fromPromise(this.__get(id, transcriptId, requestOptions));
|
|
5917
6131
|
}
|
|
5918
6132
|
__get(id, transcriptId, requestOptions) {
|
|
5919
|
-
return
|
|
6133
|
+
return __awaiter17(this, void 0, void 0, function* () {
|
|
5920
6134
|
var _a, _b;
|
|
5921
6135
|
const _response = yield fetcher({
|
|
5922
6136
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, `interactions/${encodeURIComponent(Uuid.jsonOrThrow(id, { omitUndefined: true }))}/transcripts/${encodeURIComponent(Uuid.jsonOrThrow(transcriptId, { omitUndefined: true }))}`),
|
|
@@ -6010,7 +6224,7 @@ var Transcripts = class {
|
|
|
6010
6224
|
return HttpResponsePromise.fromPromise(this.__delete(id, transcriptId, requestOptions));
|
|
6011
6225
|
}
|
|
6012
6226
|
__delete(id, transcriptId, requestOptions) {
|
|
6013
|
-
return
|
|
6227
|
+
return __awaiter17(this, void 0, void 0, function* () {
|
|
6014
6228
|
var _a, _b;
|
|
6015
6229
|
const _response = yield fetcher({
|
|
6016
6230
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, `interactions/${encodeURIComponent(Uuid.jsonOrThrow(id, { omitUndefined: true }))}/transcripts/${encodeURIComponent(Uuid.jsonOrThrow(transcriptId, { omitUndefined: true }))}`),
|
|
@@ -6076,7 +6290,7 @@ var Transcripts = class {
|
|
|
6076
6290
|
});
|
|
6077
6291
|
}
|
|
6078
6292
|
_getAuthorizationHeader() {
|
|
6079
|
-
return
|
|
6293
|
+
return __awaiter17(this, void 0, void 0, function* () {
|
|
6080
6294
|
const bearer = yield Supplier.get(this._options.token);
|
|
6081
6295
|
if (bearer != null) {
|
|
6082
6296
|
return `Bearer ${bearer}`;
|
|
@@ -6087,7 +6301,7 @@ var Transcripts = class {
|
|
|
6087
6301
|
};
|
|
6088
6302
|
|
|
6089
6303
|
// node_modules/@corti/sdk/dist/esm/api/resources/facts/client/Client.mjs
|
|
6090
|
-
var
|
|
6304
|
+
var __awaiter18 = function(thisArg, _arguments, P2, generator) {
|
|
6091
6305
|
function adopt(value) {
|
|
6092
6306
|
return value instanceof P2 ? value : new P2(function(resolve) {
|
|
6093
6307
|
resolve(value);
|
|
@@ -6130,7 +6344,7 @@ var Facts = class {
|
|
|
6130
6344
|
return HttpResponsePromise.fromPromise(this.__factGroupsList(requestOptions));
|
|
6131
6345
|
}
|
|
6132
6346
|
__factGroupsList(requestOptions) {
|
|
6133
|
-
return
|
|
6347
|
+
return __awaiter18(this, void 0, void 0, function* () {
|
|
6134
6348
|
var _a, _b;
|
|
6135
6349
|
const _response = yield fetcher({
|
|
6136
6350
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, "factgroups/"),
|
|
@@ -6199,7 +6413,7 @@ var Facts = class {
|
|
|
6199
6413
|
return HttpResponsePromise.fromPromise(this.__list(id, requestOptions));
|
|
6200
6414
|
}
|
|
6201
6415
|
__list(id, requestOptions) {
|
|
6202
|
-
return
|
|
6416
|
+
return __awaiter18(this, void 0, void 0, function* () {
|
|
6203
6417
|
var _a, _b;
|
|
6204
6418
|
const _response = yield fetcher({
|
|
6205
6419
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, `interactions/${encodeURIComponent(Uuid.jsonOrThrow(id, { omitUndefined: true }))}/facts/`),
|
|
@@ -6280,7 +6494,7 @@ var Facts = class {
|
|
|
6280
6494
|
return HttpResponsePromise.fromPromise(this.__create(id, request, requestOptions));
|
|
6281
6495
|
}
|
|
6282
6496
|
__create(id, request, requestOptions) {
|
|
6283
|
-
return
|
|
6497
|
+
return __awaiter18(this, void 0, void 0, function* () {
|
|
6284
6498
|
var _a, _b;
|
|
6285
6499
|
const _response = yield fetcher({
|
|
6286
6500
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, `interactions/${encodeURIComponent(Uuid.jsonOrThrow(id, { omitUndefined: true }))}/facts/`),
|
|
@@ -6366,7 +6580,7 @@ var Facts = class {
|
|
|
6366
6580
|
return HttpResponsePromise.fromPromise(this.__batchUpdate(id, request, requestOptions));
|
|
6367
6581
|
}
|
|
6368
6582
|
__batchUpdate(id, request, requestOptions) {
|
|
6369
|
-
return
|
|
6583
|
+
return __awaiter18(this, void 0, void 0, function* () {
|
|
6370
6584
|
var _a, _b;
|
|
6371
6585
|
const _response = yield fetcher({
|
|
6372
6586
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, `interactions/${encodeURIComponent(Uuid.jsonOrThrow(id, { omitUndefined: true }))}/facts/`),
|
|
@@ -6449,7 +6663,7 @@ var Facts = class {
|
|
|
6449
6663
|
return HttpResponsePromise.fromPromise(this.__update(id, factId, request, requestOptions));
|
|
6450
6664
|
}
|
|
6451
6665
|
__update(id_1, factId_1) {
|
|
6452
|
-
return
|
|
6666
|
+
return __awaiter18(this, arguments, void 0, function* (id, factId, request = {}, requestOptions) {
|
|
6453
6667
|
var _a, _b;
|
|
6454
6668
|
const _response = yield fetcher({
|
|
6455
6669
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, `interactions/${encodeURIComponent(Uuid.jsonOrThrow(id, { omitUndefined: true }))}/facts/${encodeURIComponent(Uuid.jsonOrThrow(factId, { omitUndefined: true }))}`),
|
|
@@ -6516,7 +6730,7 @@ var Facts = class {
|
|
|
6516
6730
|
});
|
|
6517
6731
|
}
|
|
6518
6732
|
_getAuthorizationHeader() {
|
|
6519
|
-
return
|
|
6733
|
+
return __awaiter18(this, void 0, void 0, function* () {
|
|
6520
6734
|
const bearer = yield Supplier.get(this._options.token);
|
|
6521
6735
|
if (bearer != null) {
|
|
6522
6736
|
return `Bearer ${bearer}`;
|
|
@@ -6527,7 +6741,7 @@ var Facts = class {
|
|
|
6527
6741
|
};
|
|
6528
6742
|
|
|
6529
6743
|
// node_modules/@corti/sdk/dist/esm/api/resources/documents/client/Client.mjs
|
|
6530
|
-
var
|
|
6744
|
+
var __awaiter19 = function(thisArg, _arguments, P2, generator) {
|
|
6531
6745
|
function adopt(value) {
|
|
6532
6746
|
return value instanceof P2 ? value : new P2(function(resolve) {
|
|
6533
6747
|
resolve(value);
|
|
@@ -6576,7 +6790,7 @@ var Documents = class {
|
|
|
6576
6790
|
return HttpResponsePromise.fromPromise(this.__list(id, requestOptions));
|
|
6577
6791
|
}
|
|
6578
6792
|
__list(id, requestOptions) {
|
|
6579
|
-
return
|
|
6793
|
+
return __awaiter19(this, void 0, void 0, function* () {
|
|
6580
6794
|
var _a, _b;
|
|
6581
6795
|
const _response = yield fetcher({
|
|
6582
6796
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, `interactions/${encodeURIComponent(Uuid.jsonOrThrow(id, { omitUndefined: true }))}/documents/`),
|
|
@@ -6677,7 +6891,7 @@ var Documents = class {
|
|
|
6677
6891
|
return HttpResponsePromise.fromPromise(this.__create(id, request, requestOptions));
|
|
6678
6892
|
}
|
|
6679
6893
|
__create(id, request, requestOptions) {
|
|
6680
|
-
return
|
|
6894
|
+
return __awaiter19(this, void 0, void 0, function* () {
|
|
6681
6895
|
var _a, _b;
|
|
6682
6896
|
const _response = yield fetcher({
|
|
6683
6897
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, `interactions/${encodeURIComponent(Uuid.jsonOrThrow(id, { omitUndefined: true }))}/documents/`),
|
|
@@ -6774,7 +6988,7 @@ var Documents = class {
|
|
|
6774
6988
|
return HttpResponsePromise.fromPromise(this.__get(id, documentId, requestOptions));
|
|
6775
6989
|
}
|
|
6776
6990
|
__get(id, documentId, requestOptions) {
|
|
6777
|
-
return
|
|
6991
|
+
return __awaiter19(this, void 0, void 0, function* () {
|
|
6778
6992
|
var _a, _b;
|
|
6779
6993
|
const _response = yield fetcher({
|
|
6780
6994
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, `interactions/${encodeURIComponent(Uuid.jsonOrThrow(id, { omitUndefined: true }))}/documents/${encodeURIComponent(Uuid.jsonOrThrow(documentId, { omitUndefined: true }))}`),
|
|
@@ -6863,7 +7077,7 @@ var Documents = class {
|
|
|
6863
7077
|
return HttpResponsePromise.fromPromise(this.__delete(id, documentId, requestOptions));
|
|
6864
7078
|
}
|
|
6865
7079
|
__delete(id, documentId, requestOptions) {
|
|
6866
|
-
return
|
|
7080
|
+
return __awaiter19(this, void 0, void 0, function* () {
|
|
6867
7081
|
var _a, _b;
|
|
6868
7082
|
const _response = yield fetcher({
|
|
6869
7083
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, `interactions/${encodeURIComponent(Uuid.jsonOrThrow(id, { omitUndefined: true }))}/documents/${encodeURIComponent(Uuid.jsonOrThrow(documentId, { omitUndefined: true }))}`),
|
|
@@ -6950,7 +7164,7 @@ var Documents = class {
|
|
|
6950
7164
|
return HttpResponsePromise.fromPromise(this.__update(id, documentId, request, requestOptions));
|
|
6951
7165
|
}
|
|
6952
7166
|
__update(id_1, documentId_1) {
|
|
6953
|
-
return
|
|
7167
|
+
return __awaiter19(this, arguments, void 0, function* (id, documentId, request = {}, requestOptions) {
|
|
6954
7168
|
var _a, _b;
|
|
6955
7169
|
const _response = yield fetcher({
|
|
6956
7170
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, `interactions/${encodeURIComponent(Uuid.jsonOrThrow(id, { omitUndefined: true }))}/documents/${encodeURIComponent(Uuid.jsonOrThrow(documentId, { omitUndefined: true }))}`),
|
|
@@ -7029,7 +7243,7 @@ var Documents = class {
|
|
|
7029
7243
|
});
|
|
7030
7244
|
}
|
|
7031
7245
|
_getAuthorizationHeader() {
|
|
7032
|
-
return
|
|
7246
|
+
return __awaiter19(this, void 0, void 0, function* () {
|
|
7033
7247
|
const bearer = yield Supplier.get(this._options.token);
|
|
7034
7248
|
if (bearer != null) {
|
|
7035
7249
|
return `Bearer ${bearer}`;
|
|
@@ -7040,7 +7254,7 @@ var Documents = class {
|
|
|
7040
7254
|
};
|
|
7041
7255
|
|
|
7042
7256
|
// node_modules/@corti/sdk/dist/esm/api/resources/templates/client/Client.mjs
|
|
7043
|
-
var
|
|
7257
|
+
var __awaiter20 = function(thisArg, _arguments, P2, generator) {
|
|
7044
7258
|
function adopt(value) {
|
|
7045
7259
|
return value instanceof P2 ? value : new P2(function(resolve) {
|
|
7046
7260
|
resolve(value);
|
|
@@ -7087,7 +7301,7 @@ var Templates = class {
|
|
|
7087
7301
|
return HttpResponsePromise.fromPromise(this.__sectionList(request, requestOptions));
|
|
7088
7302
|
}
|
|
7089
7303
|
__sectionList() {
|
|
7090
|
-
return
|
|
7304
|
+
return __awaiter20(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
7091
7305
|
var _a, _b;
|
|
7092
7306
|
const { org, lang } = request;
|
|
7093
7307
|
const _queryParams = {};
|
|
@@ -7176,7 +7390,7 @@ var Templates = class {
|
|
|
7176
7390
|
return HttpResponsePromise.fromPromise(this.__list(request, requestOptions));
|
|
7177
7391
|
}
|
|
7178
7392
|
__list() {
|
|
7179
|
-
return
|
|
7393
|
+
return __awaiter20(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
7180
7394
|
var _a, _b;
|
|
7181
7395
|
const { org, lang, status } = request;
|
|
7182
7396
|
const _queryParams = {};
|
|
@@ -7272,7 +7486,7 @@ var Templates = class {
|
|
|
7272
7486
|
return HttpResponsePromise.fromPromise(this.__get(key, requestOptions));
|
|
7273
7487
|
}
|
|
7274
7488
|
__get(key, requestOptions) {
|
|
7275
|
-
return
|
|
7489
|
+
return __awaiter20(this, void 0, void 0, function* () {
|
|
7276
7490
|
var _a, _b;
|
|
7277
7491
|
const _response = yield fetcher({
|
|
7278
7492
|
url: url_exports.join((_a = yield Supplier.get(this._options.baseUrl)) !== null && _a !== void 0 ? _a : (yield Supplier.get(this._options.environment)).base, `templates/${encodeURIComponent(key)}`),
|
|
@@ -7329,7 +7543,7 @@ var Templates = class {
|
|
|
7329
7543
|
});
|
|
7330
7544
|
}
|
|
7331
7545
|
_getAuthorizationHeader() {
|
|
7332
|
-
return
|
|
7546
|
+
return __awaiter20(this, void 0, void 0, function* () {
|
|
7333
7547
|
const bearer = yield Supplier.get(this._options.token);
|
|
7334
7548
|
if (bearer != null) {
|
|
7335
7549
|
return `Bearer ${bearer}`;
|
|
@@ -7340,7 +7554,7 @@ var Templates = class {
|
|
|
7340
7554
|
};
|
|
7341
7555
|
|
|
7342
7556
|
// node_modules/@corti/sdk/dist/esm/api/resources/stream/client/Socket.mjs
|
|
7343
|
-
var
|
|
7557
|
+
var __awaiter21 = function(thisArg, _arguments, P2, generator) {
|
|
7344
7558
|
function adopt(value) {
|
|
7345
7559
|
return value instanceof P2 ? value : new P2(function(resolve) {
|
|
7346
7560
|
resolve(value);
|
|
@@ -7475,7 +7689,7 @@ var StreamSocket = class {
|
|
|
7475
7689
|
}
|
|
7476
7690
|
/** Returns a promise that resolves when the websocket is open. */
|
|
7477
7691
|
waitForOpen() {
|
|
7478
|
-
return
|
|
7692
|
+
return __awaiter21(this, void 0, void 0, function* () {
|
|
7479
7693
|
if (this.socket.readyState === ReconnectingWebSocket.OPEN) {
|
|
7480
7694
|
return this.socket;
|
|
7481
7695
|
}
|
|
@@ -7505,7 +7719,7 @@ var StreamSocket = class {
|
|
|
7505
7719
|
};
|
|
7506
7720
|
|
|
7507
7721
|
// node_modules/@corti/sdk/dist/esm/api/resources/stream/client/Client.mjs
|
|
7508
|
-
var
|
|
7722
|
+
var __awaiter22 = function(thisArg, _arguments, P2, generator) {
|
|
7509
7723
|
function adopt(value) {
|
|
7510
7724
|
return value instanceof P2 ? value : new P2(function(resolve) {
|
|
7511
7725
|
resolve(value);
|
|
@@ -7537,7 +7751,7 @@ var Stream = class {
|
|
|
7537
7751
|
this._options = _options;
|
|
7538
7752
|
}
|
|
7539
7753
|
connect(args) {
|
|
7540
|
-
return
|
|
7754
|
+
return __awaiter22(this, void 0, void 0, function* () {
|
|
7541
7755
|
var _a;
|
|
7542
7756
|
const { id, tenantName, token, headers, debug, reconnectAttempts } = args;
|
|
7543
7757
|
const _queryParams = {};
|
|
@@ -7555,7 +7769,7 @@ var Stream = class {
|
|
|
7555
7769
|
});
|
|
7556
7770
|
}
|
|
7557
7771
|
_getAuthorizationHeader() {
|
|
7558
|
-
return
|
|
7772
|
+
return __awaiter22(this, void 0, void 0, function* () {
|
|
7559
7773
|
const bearer = yield Supplier.get(this._options.token);
|
|
7560
7774
|
if (bearer != null) {
|
|
7561
7775
|
return `Bearer ${bearer}`;
|
|
@@ -7596,7 +7810,7 @@ var StreamSocket2 = class extends StreamSocket {
|
|
|
7596
7810
|
};
|
|
7597
7811
|
|
|
7598
7812
|
// node_modules/@corti/sdk/dist/esm/custom/CustomStream.mjs
|
|
7599
|
-
var
|
|
7813
|
+
var __awaiter23 = function(thisArg, _arguments, P2, generator) {
|
|
7600
7814
|
function adopt(value) {
|
|
7601
7815
|
return value instanceof P2 ? value : new P2(function(resolve) {
|
|
7602
7816
|
resolve(value);
|
|
@@ -7642,7 +7856,7 @@ var Stream2 = class extends Stream {
|
|
|
7642
7856
|
const _super = Object.create(null, {
|
|
7643
7857
|
connect: { get: () => super.connect }
|
|
7644
7858
|
});
|
|
7645
|
-
return
|
|
7859
|
+
return __awaiter23(this, void 0, void 0, function* () {
|
|
7646
7860
|
var { configuration } = _a, args = __rest2(_a, ["configuration"]);
|
|
7647
7861
|
const fernWs = yield _super.connect.call(this, Object.assign(Object.assign({}, args), { token: (yield this._getAuthorizationHeader()) || "", tenantName: yield Supplier.get(this._options.tenantName) }));
|
|
7648
7862
|
const ws = new StreamSocket2({ socket: fernWs.socket });
|
|
@@ -7694,7 +7908,7 @@ var Stream2 = class extends Stream {
|
|
|
7694
7908
|
};
|
|
7695
7909
|
|
|
7696
7910
|
// node_modules/@corti/sdk/dist/esm/api/resources/transcribe/client/Socket.mjs
|
|
7697
|
-
var
|
|
7911
|
+
var __awaiter24 = function(thisArg, _arguments, P2, generator) {
|
|
7698
7912
|
function adopt(value) {
|
|
7699
7913
|
return value instanceof P2 ? value : new P2(function(resolve) {
|
|
7700
7914
|
resolve(value);
|
|
@@ -7829,7 +8043,7 @@ var TranscribeSocket = class {
|
|
|
7829
8043
|
}
|
|
7830
8044
|
/** Returns a promise that resolves when the websocket is open. */
|
|
7831
8045
|
waitForOpen() {
|
|
7832
|
-
return
|
|
8046
|
+
return __awaiter24(this, void 0, void 0, function* () {
|
|
7833
8047
|
if (this.socket.readyState === ReconnectingWebSocket.OPEN) {
|
|
7834
8048
|
return this.socket;
|
|
7835
8049
|
}
|
|
@@ -7859,7 +8073,7 @@ var TranscribeSocket = class {
|
|
|
7859
8073
|
};
|
|
7860
8074
|
|
|
7861
8075
|
// node_modules/@corti/sdk/dist/esm/api/resources/transcribe/client/Client.mjs
|
|
7862
|
-
var
|
|
8076
|
+
var __awaiter25 = function(thisArg, _arguments, P2, generator) {
|
|
7863
8077
|
function adopt(value) {
|
|
7864
8078
|
return value instanceof P2 ? value : new P2(function(resolve) {
|
|
7865
8079
|
resolve(value);
|
|
@@ -7891,7 +8105,7 @@ var Transcribe = class {
|
|
|
7891
8105
|
this._options = _options;
|
|
7892
8106
|
}
|
|
7893
8107
|
connect(args) {
|
|
7894
|
-
return
|
|
8108
|
+
return __awaiter25(this, void 0, void 0, function* () {
|
|
7895
8109
|
var _a;
|
|
7896
8110
|
const { tenantName, token, headers, debug, reconnectAttempts } = args;
|
|
7897
8111
|
const _queryParams = {};
|
|
@@ -7909,7 +8123,7 @@ var Transcribe = class {
|
|
|
7909
8123
|
});
|
|
7910
8124
|
}
|
|
7911
8125
|
_getAuthorizationHeader() {
|
|
7912
|
-
return
|
|
8126
|
+
return __awaiter25(this, void 0, void 0, function* () {
|
|
7913
8127
|
const bearer = yield Supplier.get(this._options.token);
|
|
7914
8128
|
if (bearer != null) {
|
|
7915
8129
|
return `Bearer ${bearer}`;
|
|
@@ -7950,7 +8164,7 @@ var TranscribeSocket2 = class extends TranscribeSocket {
|
|
|
7950
8164
|
};
|
|
7951
8165
|
|
|
7952
8166
|
// node_modules/@corti/sdk/dist/esm/custom/CustomTranscribe.mjs
|
|
7953
|
-
var
|
|
8167
|
+
var __awaiter26 = function(thisArg, _arguments, P2, generator) {
|
|
7954
8168
|
function adopt(value) {
|
|
7955
8169
|
return value instanceof P2 ? value : new P2(function(resolve) {
|
|
7956
8170
|
resolve(value);
|
|
@@ -7996,7 +8210,7 @@ var Transcribe2 = class extends Transcribe {
|
|
|
7996
8210
|
const _super = Object.create(null, {
|
|
7997
8211
|
connect: { get: () => super.connect }
|
|
7998
8212
|
});
|
|
7999
|
-
return
|
|
8213
|
+
return __awaiter26(this, arguments, void 0, function* (_a = {}) {
|
|
8000
8214
|
var { configuration } = _a, args = __rest3(_a, ["configuration"]);
|
|
8001
8215
|
const fernWs = yield _super.connect.call(this, Object.assign(Object.assign({}, args), { token: (yield this._getAuthorizationHeader()) || "", tenantName: yield Supplier.get(this._options.tenantName) }));
|
|
8002
8216
|
const ws = new TranscribeSocket2({ socket: fernWs.socket });
|
|
@@ -8048,7 +8262,7 @@ var Transcribe2 = class extends Transcribe {
|
|
|
8048
8262
|
};
|
|
8049
8263
|
|
|
8050
8264
|
// node_modules/@corti/sdk/dist/esm/custom/RefreshBearerProvider.mjs
|
|
8051
|
-
var
|
|
8265
|
+
var __awaiter27 = function(thisArg, _arguments, P2, generator) {
|
|
8052
8266
|
function adopt(value) {
|
|
8053
8267
|
return value instanceof P2 ? value : new P2(function(resolve) {
|
|
8054
8268
|
resolve(value);
|
|
@@ -8085,7 +8299,7 @@ var RefreshBearerProvider = class {
|
|
|
8085
8299
|
this._refreshAccessToken = refreshAccessToken;
|
|
8086
8300
|
}
|
|
8087
8301
|
getToken() {
|
|
8088
|
-
return
|
|
8302
|
+
return __awaiter27(this, void 0, void 0, function* () {
|
|
8089
8303
|
if (this._accessToken && this._expiresAt > /* @__PURE__ */ new Date()) {
|
|
8090
8304
|
return Supplier.get(this._accessToken);
|
|
8091
8305
|
}
|
|
@@ -8093,7 +8307,7 @@ var RefreshBearerProvider = class {
|
|
|
8093
8307
|
});
|
|
8094
8308
|
}
|
|
8095
8309
|
refresh() {
|
|
8096
|
-
return
|
|
8310
|
+
return __awaiter27(this, void 0, void 0, function* () {
|
|
8097
8311
|
if (!this._refreshAccessToken || this._refreshToken && this._refreshExpiresAt < /* @__PURE__ */ new Date()) {
|
|
8098
8312
|
return Supplier.get(this._accessToken);
|
|
8099
8313
|
}
|
|
@@ -8112,10 +8326,10 @@ var RefreshBearerProvider = class {
|
|
|
8112
8326
|
};
|
|
8113
8327
|
|
|
8114
8328
|
// node_modules/@corti/sdk/dist/esm/version.mjs
|
|
8115
|
-
var SDK_VERSION = "0.1.
|
|
8329
|
+
var SDK_VERSION = "0.1.5-alpha";
|
|
8116
8330
|
|
|
8117
8331
|
// node_modules/@corti/sdk/dist/esm/custom/CortiClient.mjs
|
|
8118
|
-
var
|
|
8332
|
+
var __awaiter28 = function(thisArg, _arguments, P2, generator) {
|
|
8119
8333
|
function adopt(value) {
|
|
8120
8334
|
return value instanceof P2 ? value : new P2(function(resolve) {
|
|
8121
8335
|
resolve(value);
|
|
@@ -8155,11 +8369,7 @@ var CortiClient = class {
|
|
|
8155
8369
|
"User-Agent": `@corti/sdk/${SDK_VERSION}`,
|
|
8156
8370
|
"X-Fern-Runtime": RUNTIME.type,
|
|
8157
8371
|
"X-Fern-Runtime-Version": RUNTIME.version
|
|
8158
|
-
}, _options === null || _options === void 0 ? void 0 : _options.headers), clientId: "clientId" in _options.auth ? _options.auth.clientId : void 0, clientSecret: "clientSecret" in _options.auth ? _options.auth.clientSecret : void 0, token: "accessToken" in _options.auth ? _options.auth.accessToken : void 0, environment:
|
|
8159
|
-
base: `https://api.${_options.environment}.corti.app/v2`,
|
|
8160
|
-
wss: `wss://api.${_options.environment}.corti.app`,
|
|
8161
|
-
login: `https://auth.${_options.environment}.corti.app/realms`
|
|
8162
|
-
} : _options.environment });
|
|
8372
|
+
}, _options === null || _options === void 0 ? void 0 : _options.headers), clientId: "clientId" in _options.auth ? _options.auth.clientId : void 0, clientSecret: "clientSecret" in _options.auth ? _options.auth.clientSecret : void 0, token: "accessToken" in _options.auth ? _options.auth.accessToken : void 0, environment: getEnvironment(_options.environment) });
|
|
8163
8373
|
this._oauthTokenProvider = "accessToken" in _options.auth ? new RefreshBearerProvider(_options.auth) : new OAuthTokenProvider({
|
|
8164
8374
|
clientId: _options.auth.clientId,
|
|
8165
8375
|
clientSecret: _options.auth.clientSecret,
|
|
@@ -8171,49 +8381,49 @@ var CortiClient = class {
|
|
|
8171
8381
|
}
|
|
8172
8382
|
get interactions() {
|
|
8173
8383
|
var _a;
|
|
8174
|
-
return (_a = this._interactions) !== null && _a !== void 0 ? _a : this._interactions = new Interactions(Object.assign(Object.assign({}, this._options), { token: () =>
|
|
8384
|
+
return (_a = this._interactions) !== null && _a !== void 0 ? _a : this._interactions = new Interactions(Object.assign(Object.assign({}, this._options), { token: () => __awaiter28(this, void 0, void 0, function* () {
|
|
8175
8385
|
return yield this._oauthTokenProvider.getToken();
|
|
8176
8386
|
}) }));
|
|
8177
8387
|
}
|
|
8178
8388
|
get recordings() {
|
|
8179
8389
|
var _a;
|
|
8180
|
-
return (_a = this._recordings) !== null && _a !== void 0 ? _a : this._recordings = new Recordings(Object.assign(Object.assign({}, this._options), { token: () =>
|
|
8390
|
+
return (_a = this._recordings) !== null && _a !== void 0 ? _a : this._recordings = new Recordings(Object.assign(Object.assign({}, this._options), { token: () => __awaiter28(this, void 0, void 0, function* () {
|
|
8181
8391
|
return yield this._oauthTokenProvider.getToken();
|
|
8182
8392
|
}) }));
|
|
8183
8393
|
}
|
|
8184
8394
|
get transcripts() {
|
|
8185
8395
|
var _a;
|
|
8186
|
-
return (_a = this._transcripts) !== null && _a !== void 0 ? _a : this._transcripts = new Transcripts(Object.assign(Object.assign({}, this._options), { token: () =>
|
|
8396
|
+
return (_a = this._transcripts) !== null && _a !== void 0 ? _a : this._transcripts = new Transcripts(Object.assign(Object.assign({}, this._options), { token: () => __awaiter28(this, void 0, void 0, function* () {
|
|
8187
8397
|
return yield this._oauthTokenProvider.getToken();
|
|
8188
8398
|
}) }));
|
|
8189
8399
|
}
|
|
8190
8400
|
get facts() {
|
|
8191
8401
|
var _a;
|
|
8192
|
-
return (_a = this._facts) !== null && _a !== void 0 ? _a : this._facts = new Facts(Object.assign(Object.assign({}, this._options), { token: () =>
|
|
8402
|
+
return (_a = this._facts) !== null && _a !== void 0 ? _a : this._facts = new Facts(Object.assign(Object.assign({}, this._options), { token: () => __awaiter28(this, void 0, void 0, function* () {
|
|
8193
8403
|
return yield this._oauthTokenProvider.getToken();
|
|
8194
8404
|
}) }));
|
|
8195
8405
|
}
|
|
8196
8406
|
get documents() {
|
|
8197
8407
|
var _a;
|
|
8198
|
-
return (_a = this._documents) !== null && _a !== void 0 ? _a : this._documents = new Documents(Object.assign(Object.assign({}, this._options), { token: () =>
|
|
8408
|
+
return (_a = this._documents) !== null && _a !== void 0 ? _a : this._documents = new Documents(Object.assign(Object.assign({}, this._options), { token: () => __awaiter28(this, void 0, void 0, function* () {
|
|
8199
8409
|
return yield this._oauthTokenProvider.getToken();
|
|
8200
8410
|
}) }));
|
|
8201
8411
|
}
|
|
8202
8412
|
get templates() {
|
|
8203
8413
|
var _a;
|
|
8204
|
-
return (_a = this._templates) !== null && _a !== void 0 ? _a : this._templates = new Templates(Object.assign(Object.assign({}, this._options), { token: () =>
|
|
8414
|
+
return (_a = this._templates) !== null && _a !== void 0 ? _a : this._templates = new Templates(Object.assign(Object.assign({}, this._options), { token: () => __awaiter28(this, void 0, void 0, function* () {
|
|
8205
8415
|
return yield this._oauthTokenProvider.getToken();
|
|
8206
8416
|
}) }));
|
|
8207
8417
|
}
|
|
8208
8418
|
get stream() {
|
|
8209
8419
|
var _a;
|
|
8210
|
-
return (_a = this._stream) !== null && _a !== void 0 ? _a : this._stream = new Stream2(Object.assign(Object.assign({}, this._options), { token: () =>
|
|
8420
|
+
return (_a = this._stream) !== null && _a !== void 0 ? _a : this._stream = new Stream2(Object.assign(Object.assign({}, this._options), { token: () => __awaiter28(this, void 0, void 0, function* () {
|
|
8211
8421
|
return yield this._oauthTokenProvider.getToken();
|
|
8212
8422
|
}) }));
|
|
8213
8423
|
}
|
|
8214
8424
|
get transcribe() {
|
|
8215
8425
|
var _a;
|
|
8216
|
-
return (_a = this._transcribe) !== null && _a !== void 0 ? _a : this._transcribe = new Transcribe2(Object.assign(Object.assign({}, this._options), { token: () =>
|
|
8426
|
+
return (_a = this._transcribe) !== null && _a !== void 0 ? _a : this._transcribe = new Transcribe2(Object.assign(Object.assign({}, this._options), { token: () => __awaiter28(this, void 0, void 0, function* () {
|
|
8217
8427
|
return yield this._oauthTokenProvider.getToken();
|
|
8218
8428
|
}) }));
|
|
8219
8429
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@corti/dictation-web",
|
|
3
3
|
"description": "Web component for Corti Dictation",
|
|
4
4
|
"author": "Corti ApS",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.17",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"storybook:build": "tsc && npm run analyze -- --exclude dist && storybook build"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@corti/sdk": "^0.1.
|
|
52
|
+
"@corti/sdk": "^0.1.5-alpha",
|
|
53
53
|
"lit": "^3.1.4"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|