@eka-care/ekascribe-ts-sdk 2.0.30 → 2.0.31
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/index.d.ts +5 -2
- package/dist/index.mjs +24 -9
- package/package.json +7 -2
package/dist/index.d.ts
CHANGED
|
@@ -21,10 +21,11 @@ declare class EkaScribe {
|
|
|
21
21
|
private audioBufferInstance;
|
|
22
22
|
private compatibilityManager;
|
|
23
23
|
private constructor();
|
|
24
|
-
static getInstance({ access_token, env, clientId, }: {
|
|
24
|
+
static getInstance({ access_token, env, clientId, clientEndpoint, }: {
|
|
25
25
|
access_token?: string;
|
|
26
26
|
env?: 'PROD' | 'DEV';
|
|
27
27
|
clientId?: string;
|
|
28
|
+
clientEndpoint?: string;
|
|
28
29
|
}): EkaScribe;
|
|
29
30
|
resetInstance(): void;
|
|
30
31
|
getEkascribeConfig(): Promise<TGetConfigV2Response>;
|
|
@@ -125,10 +126,11 @@ declare enum ERROR_CODE {
|
|
|
125
126
|
|
|
126
127
|
declare type Gender = 'M' | 'F' | 'O';
|
|
127
128
|
|
|
128
|
-
export declare const getEkaScribeInstance: ({ access_token, env, clientId, }: {
|
|
129
|
+
export declare const getEkaScribeInstance: ({ access_token, env, clientId, clientEndpoint, }: {
|
|
129
130
|
access_token?: string;
|
|
130
131
|
env?: "PROD" | "DEV";
|
|
131
132
|
clientId?: string;
|
|
133
|
+
clientEndpoint?: string;
|
|
132
134
|
}) => EkaScribe;
|
|
133
135
|
|
|
134
136
|
declare type TAudioChunksInfo = {
|
|
@@ -372,6 +374,7 @@ declare type TPatchVoiceApiV2ConfigRequest = {
|
|
|
372
374
|
consult_language?: string[];
|
|
373
375
|
contact_number?: string;
|
|
374
376
|
onboarding_step?: string;
|
|
377
|
+
system_compatibility_info?: any;
|
|
375
378
|
};
|
|
376
379
|
query_params?: string;
|
|
377
380
|
};
|
package/dist/index.mjs
CHANGED
|
@@ -54277,7 +54277,7 @@ function getSharedWorkerUrl() {
|
|
|
54277
54277
|
const INTERNET_TIMEOUT = 5e3, WORKER_TIMEOUT = 2e3, UPLOAD_TIMEOUT = 1e4, COMPATIBILITY_TEST_FOLDER = "system-compatibility-test";
|
|
54278
54278
|
class SystemCompatibilityManager {
|
|
54279
54279
|
constructor(a) {
|
|
54280
|
-
this.testSharedWorker = null, this.microphoneStream = null, this.awsConfigured = !1, this.clientEndpoint = a || getSharedWorkerUrl();
|
|
54280
|
+
this.testSharedWorker = null, this.microphoneStream = null, this.awsConfigured = !1, this.clientEndpoint = a || getSharedWorkerUrl(), console.log(this.clientEndpoint, "client endpoint");
|
|
54281
54281
|
}
|
|
54282
54282
|
/**
|
|
54283
54283
|
* Main orchestrator - runs all 5 compatibility tests sequentially
|
|
@@ -54504,6 +54504,9 @@ class SystemCompatibilityManager {
|
|
|
54504
54504
|
/**
|
|
54505
54505
|
* Test 4: Check Shared Worker Support
|
|
54506
54506
|
*/
|
|
54507
|
+
setCompatiblityTestSharedWorker(a) {
|
|
54508
|
+
console.log(a, "setCompatiblityTestSharedWorker"), this.testSharedWorker = a, console.log(this.testSharedWorker, "test shared worker - setCompatiblityTestSharedWorker");
|
|
54509
|
+
}
|
|
54507
54510
|
async checkSharedWorkerSupport() {
|
|
54508
54511
|
const a = COMPATIBILITY_TEST_TYPE.SHARED_WORKER;
|
|
54509
54512
|
try {
|
|
@@ -54515,10 +54518,14 @@ class SystemCompatibilityManager {
|
|
|
54515
54518
|
{ supported: !1, workerCreated: !1 }
|
|
54516
54519
|
);
|
|
54517
54520
|
try {
|
|
54518
|
-
|
|
54519
|
-
|
|
54521
|
+
return console.log(this.testSharedWorker, "test shared worker"), this.testSharedWorker ? await this.testWorkerCommunication(this.testSharedWorker) : this.createTestResult(
|
|
54522
|
+
a,
|
|
54523
|
+
COMPATIBILITY_TEST_STATUS.WARNING,
|
|
54524
|
+
"SharedWorker not created",
|
|
54525
|
+
{ supported: !1, workerCreated: !1 }
|
|
54526
|
+
);
|
|
54520
54527
|
} catch (s) {
|
|
54521
|
-
return this.createTestResult(
|
|
54528
|
+
return console.log(s, "worker error"), this.createTestResult(
|
|
54522
54529
|
a,
|
|
54523
54530
|
COMPATIBILITY_TEST_STATUS.WARNING,
|
|
54524
54531
|
"SharedWorker supported but failed to create",
|
|
@@ -54768,13 +54775,14 @@ const Ur = class Ur {
|
|
|
54768
54775
|
static getInstance({
|
|
54769
54776
|
access_token: a,
|
|
54770
54777
|
env: s,
|
|
54771
|
-
clientId: n
|
|
54778
|
+
clientId: n,
|
|
54779
|
+
clientEndpoint: r
|
|
54772
54780
|
}) {
|
|
54773
54781
|
return setEnv({
|
|
54774
54782
|
...a ? { auth_token: a } : {},
|
|
54775
54783
|
...s ? { env: s } : {},
|
|
54776
54784
|
...n ? { clientId: n } : {}
|
|
54777
|
-
}), Ur.instance || (Ur.instance = new Ur()), Ur.instance;
|
|
54785
|
+
}), console.log(r, "clientEndpoint"), Ur.instance || (Ur.instance = new Ur()), Ur.instance;
|
|
54778
54786
|
}
|
|
54779
54787
|
// Method to reset the singleton instance (useful for testing)
|
|
54780
54788
|
resetInstance() {
|
|
@@ -55055,7 +55063,13 @@ const Ur = class Ur {
|
|
|
55055
55063
|
*/
|
|
55056
55064
|
async runSystemCompatibilityTest(a, s) {
|
|
55057
55065
|
try {
|
|
55058
|
-
|
|
55066
|
+
this.compatibilityManager = new SystemCompatibilityManager(s);
|
|
55067
|
+
const n = new URL(
|
|
55068
|
+
"./worker.bundle.js",
|
|
55069
|
+
// Path relative to where this index.mjs file sits in dist
|
|
55070
|
+
s
|
|
55071
|
+
), r = new SharedWorker(n.href, { name: "EkaS3Worker" });
|
|
55072
|
+
return console.log(r, "EkaS3Worker"), r.port.start(), this.compatibilityManager.setCompatiblityTestSharedWorker(r), await this.compatibilityManager.runCompatibilityTest(a);
|
|
55059
55073
|
} catch (n) {
|
|
55060
55074
|
throw console.error("Error running compatibility test:", n), n;
|
|
55061
55075
|
}
|
|
@@ -55066,8 +55080,9 @@ let EkaScribe = Ur;
|
|
|
55066
55080
|
const getEkaScribeInstance = ({
|
|
55067
55081
|
access_token: i,
|
|
55068
55082
|
env: a,
|
|
55069
|
-
clientId: s
|
|
55070
|
-
|
|
55083
|
+
clientId: s,
|
|
55084
|
+
clientEndpoint: n
|
|
55085
|
+
}) => EkaScribe.getInstance({ access_token: i, env: a, clientId: s, clientEndpoint: n });
|
|
55071
55086
|
export {
|
|
55072
55087
|
getEkaScribeInstance
|
|
55073
55088
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eka-care/ekascribe-ts-sdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.31",
|
|
4
4
|
"description": "EkaScribe TypeScript SDK - Modern ES2020 build",
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -37,5 +37,10 @@
|
|
|
37
37
|
"files": [
|
|
38
38
|
"dist",
|
|
39
39
|
"README.md"
|
|
40
|
-
]
|
|
40
|
+
],
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"webpack": "^5.104.1",
|
|
43
|
+
"webpack-cli": "^6.0.1",
|
|
44
|
+
"worker-plugin": "^5.0.1"
|
|
45
|
+
}
|
|
41
46
|
}
|