@eka-care/ekascribe-ts-sdk 2.0.30 → 2.0.32

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 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>;
@@ -94,13 +95,7 @@ declare class EkaScribe {
94
95
  uploadAudioWithPresignedUrl(request: TPostV1UploadAudioFilesRequest): Promise<TFullAudioUploadResponse>;
95
96
  updateResultSummary(request: TPatchVoiceApiV3StatusRequest): Promise<TPatchVoiceApiV3StatusResponse>;
96
97
  getConfigMyTemplates(): Promise<TGetConfigV2Response>;
97
- /**
98
- * Run system compatibility test
99
- * @param callback - Callback function to receive test results as they complete
100
- * @param clientEndpoint - Optional client endpoint/base URL where SDK is hosted. Worker URL will be constructed as ../shared-worker/s3-file-upload.js relative to this endpoint
101
- * @returns Promise with test summary
102
- */
103
- runSystemCompatibilityTest(callback: TCompatibilityCallback, clientEndpoint?: string): Promise<TCompatibilityTestSummary>;
98
+ runSystemCompatibilityTest(callback: TCompatibilityCallback, clientEndpoint?: string, sharedWorker?: SharedWorker): Promise<TCompatibilityTestSummary>;
104
99
  }
105
100
 
106
101
  declare enum ERROR_CODE {
@@ -125,10 +120,11 @@ declare enum ERROR_CODE {
125
120
 
126
121
  declare type Gender = 'M' | 'F' | 'O';
127
122
 
128
- export declare const getEkaScribeInstance: ({ access_token, env, clientId, }: {
123
+ export declare const getEkaScribeInstance: ({ access_token, env, clientId, clientEndpoint, }: {
129
124
  access_token?: string;
130
125
  env?: "PROD" | "DEV";
131
126
  clientId?: string;
127
+ clientEndpoint?: string;
132
128
  }) => EkaScribe;
133
129
 
134
130
  declare type TAudioChunksInfo = {
@@ -372,6 +368,7 @@ declare type TPatchVoiceApiV2ConfigRequest = {
372
368
  consult_language?: string[];
373
369
  contact_number?: string;
374
370
  onboarding_step?: string;
371
+ system_compatibility_info?: any;
375
372
  };
376
373
  query_params?: string;
377
374
  };
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
+ this.testSharedWorker = a;
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
- const s = new SharedWorker("../shared-worker/s3-file-upload.ts", this.clientEndpoint);
54519
- return console.log(s, "worker"), await this.testWorkerCommunication(s);
54521
+ return 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() {
@@ -55047,17 +55055,11 @@ const Ur = class Ur {
55047
55055
  async getConfigMyTemplates() {
55048
55056
  return await getConfigV2MyTemplates();
55049
55057
  }
55050
- /**
55051
- * Run system compatibility test
55052
- * @param callback - Callback function to receive test results as they complete
55053
- * @param clientEndpoint - Optional client endpoint/base URL where SDK is hosted. Worker URL will be constructed as ../shared-worker/s3-file-upload.js relative to this endpoint
55054
- * @returns Promise with test summary
55055
- */
55056
- async runSystemCompatibilityTest(a, s) {
55058
+ async runSystemCompatibilityTest(a, s, n) {
55057
55059
  try {
55058
- return this.compatibilityManager = new SystemCompatibilityManager(s), await this.compatibilityManager.runCompatibilityTest(a);
55059
- } catch (n) {
55060
- throw console.error("Error running compatibility test:", n), n;
55060
+ return this.compatibilityManager = new SystemCompatibilityManager(s), n && this.compatibilityManager.setCompatiblityTestSharedWorker(n), await this.compatibilityManager.runCompatibilityTest(a);
55061
+ } catch (r) {
55062
+ throw console.error("Error running compatibility test:", r), r;
55061
55063
  }
55062
55064
  }
55063
55065
  };
@@ -55066,8 +55068,9 @@ let EkaScribe = Ur;
55066
55068
  const getEkaScribeInstance = ({
55067
55069
  access_token: i,
55068
55070
  env: a,
55069
- clientId: s
55070
- }) => EkaScribe.getInstance({ access_token: i, env: a, clientId: s });
55071
+ clientId: s,
55072
+ clientEndpoint: n
55073
+ }) => EkaScribe.getInstance({ access_token: i, env: a, clientId: s, clientEndpoint: n });
55071
55074
  export {
55072
55075
  getEkaScribeInstance
55073
55076
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eka-care/ekascribe-ts-sdk",
3
- "version": "2.0.30",
3
+ "version": "2.0.32",
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
  }