@eka-care/ekascribe-ts-sdk 2.0.44 → 2.0.45

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
@@ -55,6 +55,7 @@ declare class EkaScribe {
55
55
  pollSessionOutput(request: {
56
56
  txn_id: string;
57
57
  max_polling_time?: number;
58
+ is_ongoing_session?: boolean;
58
59
  }): Promise<TPollingResponse>;
59
60
  getSessionHistory({ txn_count }: {
60
61
  txn_count: number;
package/dist/index.mjs CHANGED
@@ -54203,76 +54203,77 @@ const decodeApiResponse = (i) => {
54203
54203
  }
54204
54204
  }, pollOutputSummary = async ({
54205
54205
  txn_id: i,
54206
- max_polling_time: a = 120 * 1e3
54206
+ max_polling_time: a = 120 * 1e3,
54207
+ is_ongoing_session: s
54207
54208
  }) => {
54208
- const s = EkaScribeStore$1.partialResultCallback, n = (r, c, u, m) => {
54209
- const y = {
54210
- response: c ?? null,
54211
- status_code: r,
54212
- errorMessage: m === "success" || m === "in-progress" ? void 0 : u
54209
+ const n = EkaScribeStore$1.partialResultCallback, r = (c, u, m, y) => {
54210
+ const l = {
54211
+ response: u ?? null,
54212
+ status_code: c,
54213
+ errorMessage: y === "success" || y === "in-progress" ? void 0 : m
54213
54214
  };
54214
- return s?.({
54215
+ return n?.({
54215
54216
  txn_id: i,
54216
- response: c ?? null,
54217
- status_code: r,
54218
- message: u,
54219
- poll_status: m
54220
- }), y;
54217
+ response: u ?? null,
54218
+ status_code: c,
54219
+ message: m,
54220
+ poll_status: y
54221
+ }), l;
54221
54222
  };
54222
54223
  try {
54223
- const c = (/* @__PURE__ */ new Date()).getTime() + a;
54224
- let u = 0;
54225
- s?.({
54224
+ const u = (/* @__PURE__ */ new Date()).getTime() + a;
54225
+ let m = 0;
54226
+ n?.({
54226
54227
  txn_id: i,
54227
54228
  response: null,
54228
54229
  status_code: 202,
54229
54230
  message: "Polling for session output summary started",
54230
54231
  poll_status: "in-progress"
54231
54232
  });
54232
- const m = async (y) => {
54233
+ const y = async (l) => {
54233
54234
  try {
54234
- const l = await getVoiceApiV3Status({ txnId: i, queryParams: y }), { status_code: p, response: t } = l;
54235
- if ((/* @__PURE__ */ new Date()).getTime() >= c)
54236
- return n(500, null, "We encountered an error while fetching analysis results due to timeout. Please try again.", "timeout");
54237
- if (p === 401 || p === 403)
54238
- return n(p, t, "Unauthorized or Forbidden", "failed");
54239
- if (p === 202 || p === 400 || p >= 500) {
54240
- if (p === 202 && t && s?.({
54235
+ const p = await getVoiceApiV3Status({ txnId: i, queryParams: l }), { status_code: t, response: e } = p;
54236
+ if ((/* @__PURE__ */ new Date()).getTime() >= u)
54237
+ return r(500, null, "We encountered an error while fetching analysis results due to timeout. Please try again.", "timeout");
54238
+ if (t === 401 || t === 403)
54239
+ return r(t, e, "Unauthorized or Forbidden", "failed");
54240
+ if (t === 202 || t === 400 || t >= 500) {
54241
+ if (t === 202 && e && n?.({
54241
54242
  txn_id: i,
54242
- response: t,
54243
- status_code: p,
54243
+ response: e,
54244
+ status_code: t,
54244
54245
  message: "Partial result received",
54245
54246
  poll_status: "in-progress"
54246
- }), p >= 400) {
54247
- if (u++, u >= 3) {
54248
- const o = t?.error?.msg || "We encountered a backend error while fetching results. Please try again.";
54249
- return n(p, null, o, "failed");
54247
+ }), t >= 400) {
54248
+ if (m++, m >= 3) {
54249
+ const d = e?.error?.msg || "We encountered a backend error while fetching results. Please try again.";
54250
+ return r(t, null, d, "failed");
54250
54251
  }
54251
54252
  } else
54252
- u = 0;
54253
- return m();
54253
+ m = 0;
54254
+ return y();
54254
54255
  }
54255
- return n(
54256
- p,
54256
+ return r(
54257
54257
  t,
54258
+ e,
54258
54259
  "Template results generated successfully. Polling for this session is complete.",
54259
54260
  "success"
54260
54261
  );
54261
- } catch (l) {
54262
- return n(
54262
+ } catch (p) {
54263
+ return r(
54263
54264
  -1,
54264
54265
  null,
54265
- `Something went wrong from inside catch block. ${l}`,
54266
+ `Something went wrong from inside catch block. ${p}`,
54266
54267
  "failed"
54267
54268
  );
54268
54269
  }
54269
54270
  };
54270
- return m("template_id=transcript");
54271
- } catch (r) {
54272
- return r instanceof Error && r.name === "AbortError" ? n(-1, null, "Request was aborted due to timeout.", "timeout") : n(
54271
+ return y(s ? "template_id=transcript" : "");
54272
+ } catch (c) {
54273
+ return c instanceof Error && c.name === "AbortError" ? r(-1, null, "Request was aborted due to timeout.", "timeout") : r(
54273
54274
  -1,
54274
54275
  null,
54275
- `Something went wrong from outer catch block, ${r}`,
54276
+ `Something went wrong from outer catch block, ${c}`,
54276
54277
  "failed"
54277
54278
  );
54278
54279
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eka-care/ekascribe-ts-sdk",
3
- "version": "2.0.44",
3
+ "version": "2.0.45",
4
4
  "description": "EkaScribe TypeScript SDK - Modern ES2020 build",
5
5
  "main": "dist/index.mjs",
6
6
  "module": "dist/index.mjs",