@sippulse/niva-sdk 0.3.0 → 0.3.1

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.
@@ -594,7 +594,7 @@ function buildNivaClient(call) {
594
594
  }
595
595
 
596
596
  // src/generated/meta.ts
597
- var SDK_VERSION = "0.3.0";
597
+ var SDK_VERSION = "0.3.1";
598
598
  var SUPPORTED_NIVA = { min: "2.0.0", max: null };
599
599
  var PROTOCOL_VERSION = 1;
600
600
 
@@ -1403,6 +1403,8 @@ var OPERATIONS2 = {
1403
1403
  "has_structured_analysis_error",
1404
1404
  "channel_type",
1405
1405
  "origin",
1406
+ "amd_results",
1407
+ "amd_dropped",
1406
1408
  "signal_id",
1407
1409
  "signal_triggered",
1408
1410
  "signal_value",
@@ -1427,6 +1429,8 @@ var OPERATIONS2 = {
1427
1429
  "max_duration",
1428
1430
  "channel_type",
1429
1431
  "origin",
1432
+ "amd_results",
1433
+ "amd_dropped",
1430
1434
  "signal_id",
1431
1435
  "signal_triggered",
1432
1436
  "signal_value",
@@ -1560,6 +1564,8 @@ var OPERATIONS2 = {
1560
1564
  "has_structured_analysis_error",
1561
1565
  "channel_type",
1562
1566
  "origin",
1567
+ "amd_results",
1568
+ "amd_dropped",
1563
1569
  "signal_id",
1564
1570
  "signal_triggered",
1565
1571
  "signal_value",
@@ -3,7 +3,7 @@
3
3
  * (NIVA-258). Source: GET /api/v1/spec.json via generateOpenApiSpec().
4
4
  */
5
5
  /** SDK package version (from packages/sdk/package.json). */
6
- export declare const SDK_VERSION = "0.3.0";
6
+ export declare const SDK_VERSION = "0.3.1";
7
7
  /** Lowest NIVA product version this SDK operates against. */
8
8
  export declare const SUPPORTED_NIVA: {
9
9
  min: string;
@@ -3376,6 +3376,11 @@ export interface CallRecordsCountInput {
3376
3376
  * Filter by call origin: 'dialer' (placed by a dialer campaign) or 'direct' (inbound/URA, no dialer linkage).
3377
3377
  */
3378
3378
  origin?: "dialer" | "direct";
3379
+ amd_results?: ("machine" | "human" | "silence" | "unknown")[];
3380
+ /**
3381
+ * When set, keep only the answered calls the AMD hung up (true), or leave those out (false). The call stays 'answered': this is how a report tells them from a conversation.
3382
+ */
3383
+ amd_dropped?: boolean;
3379
3384
  /**
3380
3385
  * Keep calls with a result for this signal (sig_...).
3381
3386
  */
@@ -3445,6 +3450,11 @@ export interface CallRecordsExportCsvInput {
3445
3450
  max_duration?: number;
3446
3451
  channel_type?: "voice" | "chat" | "both";
3447
3452
  origin?: "dialer" | "direct";
3453
+ amd_results?: ("machine" | "human" | "silence" | "unknown")[];
3454
+ /**
3455
+ * When set, keep only the answered calls the AMD hung up (true), or leave those out (false). The call stays 'answered': this is how a report tells them from a conversation.
3456
+ */
3457
+ amd_dropped?: boolean;
3448
3458
  signal_id?: SignalId;
3449
3459
  signal_triggered?: boolean;
3450
3460
  /**
@@ -3540,6 +3550,11 @@ export interface CallRecordsExportJobCancelOutput {
3540
3550
  */
3541
3551
  processed_records: number;
3542
3552
  request: {
3553
+ /**
3554
+ * When set, keep only the answered calls the AMD hung up (true), or leave those out (false). The call stays 'answered': this is how a report tells them from a conversation.
3555
+ */
3556
+ amd_dropped?: boolean;
3557
+ amd_results?: ("machine" | "human" | "silence" | "unknown")[];
3543
3558
  analysis_states?: ("not_applicable" | "disabled" | "waiting" | "pending" | "processing" | "completed" | "failed" | "skipped" | "purged" | "expired")[];
3544
3559
  /**
3545
3560
  * @default true
@@ -3642,6 +3657,11 @@ export type CallRecordsExportJobCancelErrorCode = "EXPORT_JOB_NOT_CANCELLABLE" |
3642
3657
  * Queues an export of the matching calls and returns the job immediately; poll it, stream its progress or wait for the notification. Exports run in the background and produce a .zip with one CSV per million rows, so they are not capped at 100000 calls like the synchronous export. Only one export runs at a time on the installation and a running export pauses while the organization's voice channels are above 80% of their limit. A finished file stays available for 7 days. Requires the call_record:export permission (call_record:read API-key scope); an export that includes the transcription column also needs call_content:read, and is invisible to users without it. Takes the same filters and columns as the synchronous export plus an optional header_labels map. An organization may hold at most 3 exports that are queued, running or paused (409 EXPORT_JOB_LIMIT_REACHED).
3643
3658
  */
3644
3659
  export interface CallRecordsExportJobCreateInput {
3660
+ /**
3661
+ * When set, keep only the answered calls the AMD hung up (true), or leave those out (false). The call stays 'answered': this is how a report tells them from a conversation.
3662
+ */
3663
+ amd_dropped?: boolean;
3664
+ amd_results?: ("machine" | "human" | "silence" | "unknown")[];
3645
3665
  analysis_states?: ("not_applicable" | "disabled" | "waiting" | "pending" | "processing" | "completed" | "failed" | "skipped" | "purged" | "expired")[];
3646
3666
  /**
3647
3667
  * @default true
@@ -3744,6 +3764,11 @@ export interface CallRecordsExportJobCreateOutput {
3744
3764
  */
3745
3765
  processed_records: number;
3746
3766
  request: {
3767
+ /**
3768
+ * When set, keep only the answered calls the AMD hung up (true), or leave those out (false). The call stays 'answered': this is how a report tells them from a conversation.
3769
+ */
3770
+ amd_dropped?: boolean;
3771
+ amd_results?: ("machine" | "human" | "silence" | "unknown")[];
3747
3772
  analysis_states?: ("not_applicable" | "disabled" | "waiting" | "pending" | "processing" | "completed" | "failed" | "skipped" | "purged" | "expired")[];
3748
3773
  /**
3749
3774
  * @default true
@@ -3899,6 +3924,11 @@ export interface CallRecordsExportJobGetOutput {
3899
3924
  */
3900
3925
  processed_records: number;
3901
3926
  request: {
3927
+ /**
3928
+ * When set, keep only the answered calls the AMD hung up (true), or leave those out (false). The call stays 'answered': this is how a report tells them from a conversation.
3929
+ */
3930
+ amd_dropped?: boolean;
3931
+ amd_results?: ("machine" | "human" | "silence" | "unknown")[];
3902
3932
  analysis_states?: ("not_applicable" | "disabled" | "waiting" | "pending" | "processing" | "completed" | "failed" | "skipped" | "purged" | "expired")[];
3903
3933
  /**
3904
3934
  * @default true
@@ -4033,6 +4063,11 @@ export interface CallRecordsExportJobListOutput {
4033
4063
  */
4034
4064
  processed_records: number;
4035
4065
  request: {
4066
+ /**
4067
+ * When set, keep only the answered calls the AMD hung up (true), or leave those out (false). The call stays 'answered': this is how a report tells them from a conversation.
4068
+ */
4069
+ amd_dropped?: boolean;
4070
+ amd_results?: ("machine" | "human" | "silence" | "unknown")[];
4036
4071
  analysis_states?: ("not_applicable" | "disabled" | "waiting" | "pending" | "processing" | "completed" | "failed" | "skipped" | "purged" | "expired")[];
4037
4072
  /**
4038
4073
  * @default true
@@ -4200,7 +4235,18 @@ export type CallRecordsGetByIdOutput = {
4200
4235
  analysis: NivaJsonValue;
4201
4236
  analysis_status: "not_applicable" | "disabled" | "waiting" | "pending" | "processing" | "completed" | "failed" | "skipped" | "purged" | "expired";
4202
4237
  answer_recognition_results: {
4203
- machine_type: "voicemail" | "announcement" | "ivr" | "screening" | "unknown";
4238
+ /**
4239
+ * The AMD verdict: human, machine, silence or unknown.
4240
+ */
4241
+ amd?: "machine" | "human" | "silence" | "unknown";
4242
+ /**
4243
+ * What the AMD did to the call: 'hangup' when it ended the call, 'continue' when the call went on.
4244
+ */
4245
+ amd_action?: "hangup" | "continue";
4246
+ /**
4247
+ * Which kind of recording answered.
4248
+ */
4249
+ machine_type?: "voicemail" | "announcement" | "ivr" | "screening" | "unknown";
4204
4250
  } | null;
4205
4251
  answered_at: string | null;
4206
4252
  /**
@@ -4327,6 +4373,7 @@ export type CallRecordsGetByIdOutput = {
4327
4373
  start_ms: number;
4328
4374
  }[];
4329
4375
  recording_status: "not_applicable" | "disabled" | "waiting" | "pending" | "processing" | "completed" | "failed" | "skipped" | "purged" | "expired";
4376
+ ring_duration_ms: number | null;
4330
4377
  sentiment_label?: string | null;
4331
4378
  sentiment_score?: number | null;
4332
4379
  signal_alert: {
@@ -4383,6 +4430,7 @@ export type CallRecordsGetByIdOutput = {
4383
4430
  * maximum: 9007199254740991
4384
4431
  */
4385
4432
  structured_analysis_processing_count: number;
4433
+ talk_duration_ms: number | null;
4386
4434
  test_reported: boolean;
4387
4435
  transcription: string | null;
4388
4436
  transcription_skip_reason: "below_min_duration" | "not_sampled" | "no_recording" | "no_window" | "ai_disabled" | "no_caller_speech" | "no_ivr_speech" | null;
@@ -4630,6 +4678,11 @@ export interface CallRecordsListInput {
4630
4678
  * Filter by call origin: 'dialer' (placed by a dialer campaign) or 'direct' (inbound/URA, no dialer linkage).
4631
4679
  */
4632
4680
  origin?: "dialer" | "direct";
4681
+ amd_results?: ("machine" | "human" | "silence" | "unknown")[];
4682
+ /**
4683
+ * When set, keep only the answered calls the AMD hung up (true), or leave those out (false). The call stays 'answered': this is how a report tells them from a conversation.
4684
+ */
4685
+ amd_dropped?: boolean;
4633
4686
  /**
4634
4687
  * Keep calls with a result for this signal (sig_...).
4635
4688
  */
@@ -4670,6 +4723,20 @@ export interface CallRecordsListOutput {
4670
4723
  items: {
4671
4724
  analysis: NivaJsonValue;
4672
4725
  analysis_status: "not_applicable" | "disabled" | "waiting" | "pending" | "processing" | "completed" | "failed" | "skipped" | "purged" | "expired";
4726
+ answer_recognition_results: {
4727
+ /**
4728
+ * The AMD verdict: human, machine, silence or unknown.
4729
+ */
4730
+ amd?: "machine" | "human" | "silence" | "unknown";
4731
+ /**
4732
+ * What the AMD did to the call: 'hangup' when it ended the call, 'continue' when the call went on.
4733
+ */
4734
+ amd_action?: "hangup" | "continue";
4735
+ /**
4736
+ * Which kind of recording answered.
4737
+ */
4738
+ machine_type?: "voicemail" | "announcement" | "ivr" | "screening" | "unknown";
4739
+ } | null;
4673
4740
  answered_at: string | null;
4674
4741
  /**
4675
4742
  * minimum: -2147483648
@@ -4742,6 +4809,7 @@ export interface CallRecordsListOutput {
4742
4809
  } | null;
4743
4810
  recording_expired_at: string | null;
4744
4811
  recording_status: "not_applicable" | "disabled" | "waiting" | "pending" | "processing" | "completed" | "failed" | "skipped" | "purged" | "expired";
4812
+ ring_duration_ms: number | null;
4745
4813
  sentiment_label?: string | null;
4746
4814
  sentiment_score?: number | null;
4747
4815
  signal_alert: {
@@ -4798,6 +4866,7 @@ export interface CallRecordsListOutput {
4798
4866
  * maximum: 9007199254740991
4799
4867
  */
4800
4868
  structured_analysis_processing_count: number;
4869
+ talk_duration_ms: number | null;
4801
4870
  test_reported: boolean;
4802
4871
  transcription: string | null;
4803
4872
  transcription_skip_reason: "below_min_duration" | "not_sampled" | "no_recording" | "no_window" | "ai_disabled" | "no_caller_speech" | "no_ivr_speech" | null;
@@ -4965,6 +5034,19 @@ export interface CallsOriginateInput {
4965
5034
  * Beta: optional recognitions after answer. machine_type enables AMD implicitly. Both require the classifier module (403 MODULE_DISABLED without it).
4966
5035
  */
4967
5036
  answer_recognition?: {
5037
+ /**
5038
+ * Pre mode only: what to do with a silent line and with a window that expires with no verdict. A machine always hangs up and a human always runs the plan. The plan reads the verdict as {{args.amd_result}} (human, machine, silence or unknown).
5039
+ */
5040
+ actions?: {
5041
+ /**
5042
+ * What a silent line does in pre mode: "hangup" ends the call, "continue" runs the plan (default hangup).
5043
+ */
5044
+ silence?: "hangup" | "continue";
5045
+ /**
5046
+ * What a window that expires with no verdict does in pre mode: "hangup" ends the call, "continue" runs the plan (default continue).
5047
+ */
5048
+ unknown?: "hangup" | "continue";
5049
+ };
4968
5050
  /**
4969
5051
  * Run Beta acoustic answering-machine detection before or while the visual plan executes.
4970
5052
  */
@@ -19568,7 +19650,7 @@ export declare const OPERATIONS: {
19568
19650
  readonly method: "GET";
19569
19651
  readonly path: "/call-records/count";
19570
19652
  readonly pathParams: readonly [];
19571
- readonly queryParams: readonly ["search", "call_record_id", "uuid", "sip_call_id", "date_from", "date_to", "visual_plan_id", "channel_id", "status", "caller_search", "min_duration", "max_duration", "has_recording", "has_transcription", "recording_states", "transcription_states", "analysis_states", "has_error", "has_structured_analysis", "has_structured_analysis_error", "channel_type", "origin", "signal_id", "signal_triggered", "signal_value", "metadata"];
19653
+ readonly queryParams: readonly ["search", "call_record_id", "uuid", "sip_call_id", "date_from", "date_to", "visual_plan_id", "channel_id", "status", "caller_search", "min_duration", "max_duration", "has_recording", "has_transcription", "recording_states", "transcription_states", "analysis_states", "has_error", "has_structured_analysis", "has_structured_analysis_error", "channel_type", "origin", "amd_results", "amd_dropped", "signal_id", "signal_triggered", "signal_value", "metadata"];
19572
19654
  readonly bodyKind: "none";
19573
19655
  readonly responseKind: "json";
19574
19656
  readonly codes: 5;
@@ -19577,7 +19659,7 @@ export declare const OPERATIONS: {
19577
19659
  readonly method: "GET";
19578
19660
  readonly path: "/call-records/export";
19579
19661
  readonly pathParams: readonly [];
19580
- readonly queryParams: readonly ["date_from", "date_to", "visual_plan_id", "channel_id", "status", "search", "min_duration", "max_duration", "channel_type", "origin", "signal_id", "signal_triggered", "signal_value", "has_recording", "has_transcription", "recording_states", "transcription_states", "analysis_states", "has_error", "has_structured_analysis", "has_structured_analysis_error", "metadata", "apply_table_filters", "separator", "columns", "include_events"];
19662
+ readonly queryParams: readonly ["date_from", "date_to", "visual_plan_id", "channel_id", "status", "search", "min_duration", "max_duration", "channel_type", "origin", "amd_results", "amd_dropped", "signal_id", "signal_triggered", "signal_value", "has_recording", "has_transcription", "recording_states", "transcription_states", "analysis_states", "has_error", "has_structured_analysis", "has_structured_analysis_error", "metadata", "apply_table_filters", "separator", "columns", "include_events"];
19581
19663
  readonly bodyKind: "none";
19582
19664
  readonly responseKind: "sse";
19583
19665
  readonly codes: 18;
@@ -19667,7 +19749,7 @@ export declare const OPERATIONS: {
19667
19749
  readonly method: "GET";
19668
19750
  readonly path: "/call-records";
19669
19751
  readonly pathParams: readonly [];
19670
- readonly queryParams: readonly ["search", "page", "limit", "sort_by", "sort_order", "call_record_id", "uuid", "sip_call_id", "date_from", "date_to", "visual_plan_id", "channel_id", "status", "caller_search", "min_duration", "max_duration", "has_recording", "has_transcription", "recording_states", "transcription_states", "analysis_states", "has_error", "has_structured_analysis", "has_structured_analysis_error", "channel_type", "origin", "signal_id", "signal_triggered", "signal_value", "include_signals", "metadata", "cursor"];
19752
+ readonly queryParams: readonly ["search", "page", "limit", "sort_by", "sort_order", "call_record_id", "uuid", "sip_call_id", "date_from", "date_to", "visual_plan_id", "channel_id", "status", "caller_search", "min_duration", "max_duration", "has_recording", "has_transcription", "recording_states", "transcription_states", "analysis_states", "has_error", "has_structured_analysis", "has_structured_analysis_error", "channel_type", "origin", "amd_results", "amd_dropped", "signal_id", "signal_triggered", "signal_value", "include_signals", "metadata", "cursor"];
19671
19753
  readonly bodyKind: "none";
19672
19754
  readonly responseKind: "json";
19673
19755
  readonly codes: 7;
@@ -189,6 +189,14 @@ export interface NivaWebhookEventMap {
189
189
  * minimum: 0
190
190
  */
191
191
  duration_ms: number;
192
+ /**
193
+ * minimum: 0
194
+ */
195
+ ring_duration_ms?: number;
196
+ /**
197
+ * minimum: 0
198
+ */
199
+ talk_duration_ms?: number | null;
192
200
  hangup_cause: string;
193
201
  hangup_disposition: string;
194
202
  was_recorded: boolean;
@@ -399,6 +407,10 @@ export interface NivaWebhookEventMap {
399
407
  * maximum: 10
400
408
  */
401
409
  max_wait_seconds?: number;
410
+ actions?: {
411
+ silence?: "hangup" | "continue";
412
+ unknown?: "hangup" | "continue";
413
+ };
402
414
  };
403
415
  metadata: Record<string, string>;
404
416
  };
package/index.bun.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  createShutdownTracker,
16
16
  withShutdownSignal,
17
17
  defineNivaWebhookServer
18
- } from "./chunk-92drxxs4.js";
18
+ } from "./chunk-63rnjnmz.js";
19
19
  import {
20
20
  NivaError2,
21
21
  NivaApiError2,
package/index.default.js CHANGED
@@ -11,7 +11,7 @@ import {
11
11
  DEFAULT_MAX_BODY_BYTES2,
12
12
  createNivaWebhookHandler2,
13
13
  defineNivaWebhookServer
14
- } from "./chunk-92drxxs4.js";
14
+ } from "./chunk-63rnjnmz.js";
15
15
  import {
16
16
  NivaError2,
17
17
  NivaApiError2,
package/index.deno.js CHANGED
@@ -15,7 +15,7 @@ import {
15
15
  createShutdownTracker,
16
16
  withShutdownSignal,
17
17
  defineNivaWebhookServer
18
- } from "./chunk-92drxxs4.js";
18
+ } from "./chunk-63rnjnmz.js";
19
19
  import {
20
20
  NivaError2,
21
21
  NivaApiError2,
package/index.node.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  delayMs,
15
15
  createShutdownTracker,
16
16
  defineNivaWebhookServer
17
- } from "./chunk-92drxxs4.js";
17
+ } from "./chunk-63rnjnmz.js";
18
18
  import {
19
19
  NivaError2,
20
20
  NivaApiError2,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sippulse/niva-sdk",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "NIVA SDK - typed client and webhook receiver for the NIVA IVR platform",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://niva.sippulse.com",
@@ -31,7 +31,7 @@
31
31
  "files": [
32
32
  "chat.js",
33
33
  "chat.d.ts",
34
- "chunk-92drxxs4.js",
34
+ "chunk-63rnjnmz.js",
35
35
  "chunk-xnm3475q.js",
36
36
  "index.bun.js",
37
37
  "index.default.js",