@onereach/step-voice 5.0.1 → 5.0.2-fixtransfer.0

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/dst/Transfer.d.ts CHANGED
@@ -17,6 +17,7 @@ interface INPUT {
17
17
  interface EVENT {
18
18
  type: EventType;
19
19
  error?: string | Error;
20
+ originateDisposition?: string;
20
21
  }
21
22
  export default class Transfer extends VoiceStep<INPUT, {}, EVENT> {
22
23
  runStep(): Promise<void>;
package/dst/Transfer.js CHANGED
@@ -21,7 +21,10 @@ class Transfer extends voice_1.default {
21
21
  return this.exitFlow();
22
22
  }
23
23
  case 'bridge/ended': {
24
- if (event.params.error === 'NORMAL_CLEARING') {
24
+ const { error, originateDisposition } = event.params;
25
+ const isSuccess = error === 'NORMAL_CLEARING'
26
+ && (!originateDisposition || originateDisposition === 'SUCCESS');
27
+ if (isSuccess) {
25
28
  await this.transcript(call, {
26
29
  action: 'Transfer Ended - Answered',
27
30
  actionFromBot: true,
package/dst/step.d.ts CHANGED
@@ -56,7 +56,7 @@ export default class ConvStep<TData = unknown, TIn = unknown, TOut = unknown, TP
56
56
  protected pushConvStep(): Promise<boolean>;
57
57
  /** @returns true if current conv was active */
58
58
  protected popConvStep(popStep?: IConversationStep): Promise<boolean>;
59
- startConversation(data: TData, { thread }?: {
59
+ startConversation(data: TData, { thread: _thread }?: {
60
60
  thread?: IThreadId;
61
61
  }): Promise<void>;
62
62
  protected _fetchCache(): Promise<(TData & IConversationData) | undefined>;
package/dst/voice.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ICallback, IVoiceReporterTranscriptEventArgs, IPromtpSection } from '@onereach/flow-sdk/dst/types';
2
2
  import ConvStep from './step';
3
3
  import BasicError from '@onereach/flow-sdk/dst/errors/base';
4
- export type TODO = any;
4
+ export declare type TODO = any;
5
5
  export interface SensitiveData {
6
6
  muteStep: boolean;
7
7
  muteUser: boolean;
@@ -25,7 +25,7 @@ export interface IVoiceCall {
25
25
  from?: string;
26
26
  headers?: Record<string, string>;
27
27
  }
28
- export type EventType = 'hangup' | 'error' | 'cancel' | 'avm-detected' | 'recognition' | 'digit' | 'digits' | 'conference-start' | 'conference-end' | 'playback' | 'timeout' | 'record' | 'bridge' | 'bridge/ended' | 'is_flow_ready' | 'call';
28
+ export declare type EventType = 'hangup' | 'error' | 'cancel' | 'avm-detected' | 'recognition' | 'digit' | 'digits' | 'conference-start' | 'conference-end' | 'playback' | 'timeout' | 'record' | 'bridge' | 'bridge/ended' | 'is_flow_ready' | 'call';
29
29
  export declare class VoiceStepError extends BasicError {
30
30
  }
31
31
  export interface VoiceEvent {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/step-voice",
3
- "version": "5.0.1",
3
+ "version": "5.0.2-fixtransfer.0",
4
4
  "author": "Roman Zolotarov <roman.zolotarov@onereach.com>",
5
5
  "contributors": [
6
6
  "Roman Zolotarov",
@@ -44,13 +44,9 @@
44
44
  "build": "npm run clean && tsc -p ./tsconfig.build.json",
45
45
  "build-fast": "npm run clean && swc ./src -d ./dst",
46
46
  "deploy": "./scripts/deploy.sh",
47
- "download-prod": "./scripts/download.sh prod",
48
- "download-dev": "s./scripts/download.sh dev",
49
- "upload-prod": "./scripts/upload.sh prod",
50
- "upload-dev": "./scripts/upload.sh dev",
47
+ "download": "./scripts/download.sh",
48
+ "upload": "./scripts/upload.sh",
51
49
  "pub": "./scripts/publish.sh",
52
- "publish-patch": "echo use: npm run pub; exit 1",
53
- "publish-beta": "echo use: npm run pub; exit 1",
54
50
  "test": "jest"
55
51
  },
56
52
  "repository": {