@nopaque/sdk 0.4.0 → 0.7.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/CHANGELOG.md +66 -0
- package/dist/index.cjs +9 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +117 -19
- package/dist/index.d.ts +117 -19
- package/dist/index.mjs +9 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1110,10 +1110,32 @@ type MappingMode = 'dtmf' | 'dtmf-audio' | 'full-audio';
|
|
|
1110
1110
|
* field (post-merged from the run, not the job-level idle/running cycle).
|
|
1111
1111
|
*/
|
|
1112
1112
|
type MappingRunStatus = 'idle' | 'running' | 'completed' | 'failed' | 'limited';
|
|
1113
|
+
/**
|
|
1114
|
+
* Industry vertical used for prompt-library lookup. Required by the API
|
|
1115
|
+
* whenever `mappingMode` is not `dtmf`.
|
|
1116
|
+
*/
|
|
1117
|
+
type Vertical = 'FSI' | 'Healthcare' | 'EnergyUtilities' | 'Telecoms' | 'General';
|
|
1118
|
+
/** Behaviour when the orchestrator revisits an already-discovered menu. */
|
|
1119
|
+
type RepeatBehavior = 'skip' | 'explore_once' | 'explore_n';
|
|
1113
1120
|
interface RetryConfig {
|
|
1114
1121
|
enabled: boolean;
|
|
1115
1122
|
maxRetries: number;
|
|
1116
1123
|
}
|
|
1124
|
+
interface RepeatConfig {
|
|
1125
|
+
behavior: RepeatBehavior;
|
|
1126
|
+
/** Only meaningful when `behavior` is `explore_n`. Defaults to 2 server-side. */
|
|
1127
|
+
maxExplorations?: number;
|
|
1128
|
+
}
|
|
1129
|
+
interface EnrichmentConfig {
|
|
1130
|
+
enabled: boolean;
|
|
1131
|
+
/** Defaults to `["quality_scoring"]` server-side. */
|
|
1132
|
+
types?: string[];
|
|
1133
|
+
}
|
|
1134
|
+
/**
|
|
1135
|
+
* Per-job configuration. Every mode-related knob lives here rather than at the
|
|
1136
|
+
* top of the request body — the API reads `body.config.mappingMode`, and a
|
|
1137
|
+
* top-level `mappingMode` is ignored.
|
|
1138
|
+
*/
|
|
1117
1139
|
interface MappingJobConfig {
|
|
1118
1140
|
maxDepth?: number;
|
|
1119
1141
|
maxCalls?: number;
|
|
@@ -1123,7 +1145,13 @@ interface MappingJobConfig {
|
|
|
1123
1145
|
voiceProfileId?: string;
|
|
1124
1146
|
dataProfileId?: string;
|
|
1125
1147
|
retryConfig?: RetryConfig;
|
|
1148
|
+
repeatConfig?: RepeatConfig;
|
|
1149
|
+
enrichmentConfig?: EnrichmentConfig;
|
|
1126
1150
|
mappingMode?: MappingMode;
|
|
1151
|
+
/** Required when `mappingMode` is `dtmf-audio` or `full-audio`. */
|
|
1152
|
+
vertical?: Vertical;
|
|
1153
|
+
/** Security-probe mode. The API rejects it combined with `mappingMode: 'dtmf'`. */
|
|
1154
|
+
probeMode?: boolean;
|
|
1127
1155
|
}
|
|
1128
1156
|
interface MappingJobStats {
|
|
1129
1157
|
totalCalls: number;
|
|
@@ -1502,22 +1530,40 @@ declare class MissionTestsResource extends Resource {
|
|
|
1502
1530
|
cancel(id: string, requestOptions?: RequestOptions): Promise<MissionTestRun>;
|
|
1503
1531
|
}
|
|
1504
1532
|
|
|
1505
|
-
|
|
1533
|
+
/**
|
|
1534
|
+
* Profile items are a discriminated union on `type`. A voice item points at an
|
|
1535
|
+
* uploaded audio row; a data item points at an item inside a dataset. Branch on
|
|
1536
|
+
* `type` before reaching for `audioId` or `datasetId`.
|
|
1537
|
+
*/
|
|
1538
|
+
interface ProfileVoiceItemBase {
|
|
1506
1539
|
id: string;
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1540
|
+
/**
|
|
1541
|
+
* Legacy display label. Deprecated server-side and no longer written — for
|
|
1542
|
+
* data items the label is derived from the dataset item's key at read time,
|
|
1543
|
+
* so it is frequently absent. Do not rely on it.
|
|
1544
|
+
*/
|
|
1545
|
+
label?: string;
|
|
1546
|
+
description?: string;
|
|
1547
|
+
}
|
|
1548
|
+
interface ProfileVoiceItem extends ProfileVoiceItemBase {
|
|
1549
|
+
type: 'voice';
|
|
1550
|
+
audioId: string;
|
|
1551
|
+
}
|
|
1552
|
+
interface ProfileDataItem extends ProfileVoiceItemBase {
|
|
1553
|
+
type: 'data';
|
|
1554
|
+
datasetId: string;
|
|
1555
|
+
itemId: string;
|
|
1512
1556
|
}
|
|
1557
|
+
type ProfileItem = ProfileVoiceItem | ProfileDataItem;
|
|
1513
1558
|
interface Profile {
|
|
1514
1559
|
id: string;
|
|
1560
|
+
workspaceId?: string;
|
|
1515
1561
|
name: string;
|
|
1516
1562
|
description?: string;
|
|
1517
1563
|
items?: ProfileItem[];
|
|
1518
1564
|
createdAt?: string;
|
|
1519
1565
|
updatedAt?: string;
|
|
1520
|
-
|
|
1566
|
+
createdBy?: string;
|
|
1521
1567
|
}
|
|
1522
1568
|
interface CreateProfileRequest {
|
|
1523
1569
|
name: string;
|
|
@@ -1527,13 +1573,27 @@ interface UpdateProfileRequest {
|
|
|
1527
1573
|
name?: string;
|
|
1528
1574
|
description?: string;
|
|
1529
1575
|
}
|
|
1530
|
-
|
|
1576
|
+
/**
|
|
1577
|
+
* Body for `POST /profiles/{id}/items`. `type` selects which id field the API
|
|
1578
|
+
* requires, and `label` is required by this legacy route even though the field
|
|
1579
|
+
* is deprecated on the stored item.
|
|
1580
|
+
*/
|
|
1581
|
+
type AddProfileItemRequest = {
|
|
1582
|
+
type: 'voice';
|
|
1583
|
+
audioId: string;
|
|
1531
1584
|
label: string;
|
|
1532
|
-
|
|
1533
|
-
}
|
|
1585
|
+
description?: string;
|
|
1586
|
+
} | {
|
|
1587
|
+
type: 'data';
|
|
1588
|
+
datasetId: string;
|
|
1589
|
+
itemId: string;
|
|
1590
|
+
label: string;
|
|
1591
|
+
description?: string;
|
|
1592
|
+
};
|
|
1593
|
+
/** Body for `PUT /profiles/{id}/items/{itemId}`. Only these two are read. */
|
|
1534
1594
|
interface UpdateProfileItemRequest {
|
|
1535
1595
|
label?: string;
|
|
1536
|
-
|
|
1596
|
+
description?: string;
|
|
1537
1597
|
}
|
|
1538
1598
|
interface ProfilesListParams {
|
|
1539
1599
|
limit?: number;
|
|
@@ -1558,9 +1618,10 @@ declare class ProfilesResource extends Resource {
|
|
|
1558
1618
|
get(profileId: string, requestOptions?: RequestOptions): Promise<Profile>;
|
|
1559
1619
|
update(profileId: string, body: UpdateProfileRequest, requestOptions?: RequestOptions): Promise<Profile>;
|
|
1560
1620
|
delete(profileId: string, requestOptions?: RequestOptions): Promise<void>;
|
|
1561
|
-
addItem(profileId: string, body: AddProfileItemRequest, requestOptions?: RequestOptions): Promise<
|
|
1562
|
-
updateItem(profileId: string, itemId: string, body: UpdateProfileItemRequest, requestOptions?: RequestOptions): Promise<
|
|
1563
|
-
|
|
1621
|
+
addItem(profileId: string, body: AddProfileItemRequest, requestOptions?: RequestOptions): Promise<Profile>;
|
|
1622
|
+
updateItem(profileId: string, itemId: string, body: UpdateProfileItemRequest, requestOptions?: RequestOptions): Promise<Profile>;
|
|
1623
|
+
/** Returns the updated profile, as all three item routes do. */
|
|
1624
|
+
deleteItem(profileId: string, itemId: string, requestOptions?: RequestOptions): Promise<Profile>;
|
|
1564
1625
|
listParameters(requestOptions?: RequestOptions): Promise<ProfileParametersResponse>;
|
|
1565
1626
|
findByParameters(params: ProfilesByParametersParams, requestOptions?: RequestOptions): Promise<ProfilesByParametersResponse>;
|
|
1566
1627
|
}
|
|
@@ -1755,7 +1816,6 @@ interface CreateTestJobRequest {
|
|
|
1755
1816
|
name?: string;
|
|
1756
1817
|
}
|
|
1757
1818
|
type TestRunStatus = 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
1758
|
-
type TestRunResult = 'pass' | 'fail' | 'partial';
|
|
1759
1819
|
/**
|
|
1760
1820
|
* A single execution of a test. The primary identifier is `id`, matching the
|
|
1761
1821
|
* server's entity shape. Pass it to `waitForRun()` and `get()`.
|
|
@@ -1769,7 +1829,11 @@ interface TestRun {
|
|
|
1769
1829
|
testConfigId?: string;
|
|
1770
1830
|
workspaceId?: string;
|
|
1771
1831
|
status?: TestRunStatus;
|
|
1772
|
-
|
|
1832
|
+
/**
|
|
1833
|
+
* Terminal verdict. The API never sends a `result` field — an SDK type
|
|
1834
|
+
* declaring one read as undefined on every run, including passing ones.
|
|
1835
|
+
*/
|
|
1836
|
+
outcome?: TestRunOutcome | null;
|
|
1773
1837
|
startedAt?: string;
|
|
1774
1838
|
completedAt?: string;
|
|
1775
1839
|
launchDeadline?: string;
|
|
@@ -1778,6 +1842,40 @@ interface TestRun {
|
|
|
1778
1842
|
failedSteps?: number;
|
|
1779
1843
|
[key: string]: unknown;
|
|
1780
1844
|
}
|
|
1845
|
+
/**
|
|
1846
|
+
* A single scripted step's result. Named `TestStepResult`, not `StepResult` —
|
|
1847
|
+
* the latter is already exported for mapping and is an unrelated shape.
|
|
1848
|
+
*/
|
|
1849
|
+
interface TestStepResult {
|
|
1850
|
+
id: string;
|
|
1851
|
+
runId: string;
|
|
1852
|
+
stepIndex: number;
|
|
1853
|
+
stepId: string;
|
|
1854
|
+
stepName: string;
|
|
1855
|
+
outcome: 'PASS' | 'FAIL' | 'TIMEOUT' | 'ERROR';
|
|
1856
|
+
expectedTranscript: string;
|
|
1857
|
+
actualTranscript?: string;
|
|
1858
|
+
similarity?: number;
|
|
1859
|
+
threshold: number;
|
|
1860
|
+
actionType?: string;
|
|
1861
|
+
actionValue?: string;
|
|
1862
|
+
duration?: number;
|
|
1863
|
+
errorMessage?: string;
|
|
1864
|
+
matcherScores?: Record<string, number>;
|
|
1865
|
+
turnTelemetry?: Record<string, unknown>;
|
|
1866
|
+
createdAt: string;
|
|
1867
|
+
}
|
|
1868
|
+
/**
|
|
1869
|
+
* What `testing.runs.get()` returns: the run row enriched with its step
|
|
1870
|
+
* results, the joined transcript, and a snapshot of the parent config.
|
|
1871
|
+
* Mission and compliance runs have no scripted steps, so `stepResults` is
|
|
1872
|
+
* empty and `config` is absent for those.
|
|
1873
|
+
*/
|
|
1874
|
+
interface TestRunDetails extends TestRun {
|
|
1875
|
+
stepResults?: TestStepResult[];
|
|
1876
|
+
fullTranscript?: string;
|
|
1877
|
+
config?: TestConfig;
|
|
1878
|
+
}
|
|
1781
1879
|
/**
|
|
1782
1880
|
* Body for POST /testing/runs. Exactly one of jobId or testConfigId
|
|
1783
1881
|
* must be provided:
|
|
@@ -1948,8 +2046,8 @@ declare class TestingRunsResource extends Resource {
|
|
|
1948
2046
|
listPage(params?: TestRunListParams, requestOptions?: RequestOptions): Promise<Page<TestRunListItem>>;
|
|
1949
2047
|
/** GET /testing/runs/aggregate — grouped counts over test runs. */
|
|
1950
2048
|
aggregate(params: TestRunAggregateParams, requestOptions?: RequestOptions): Promise<TestRunAggregateResponse>;
|
|
1951
|
-
get(runId: string, requestOptions?: RequestOptions): Promise<
|
|
1952
|
-
waitForRun(runId: string, opts?: TestingWaitForOptions): Promise<
|
|
2049
|
+
get(runId: string, requestOptions?: RequestOptions): Promise<TestRunDetails>;
|
|
2050
|
+
waitForRun(runId: string, opts?: TestingWaitForOptions): Promise<TestRunDetails>;
|
|
1953
2051
|
}
|
|
1954
2052
|
declare class TestingResource extends Resource {
|
|
1955
2053
|
readonly configs: TestingConfigsResource;
|
|
@@ -1990,4 +2088,4 @@ declare class Nopaque {
|
|
|
1990
2088
|
|
|
1991
2089
|
declare const VERSION: string;
|
|
1992
2090
|
|
|
1993
|
-
export { APIConnectionError, APITimeoutError, type AddProfileItemRequest, type AggregateGroup, type AggregateGroupBy, type AggregateTimeBucket, type AudioCategory, type AudioDownloadURL, type AudioFile, type AudioListParams, type AudioUploadURL, AuthenticationError, type Batch, type BatchRun, type BatchRunStatus, type BatchStatus, type BatchesListParams, type CallTelemetry, type ChatMatcher, type ChatStep, type ChatStepBase, type ComplianceCatalogue, type ComplianceCatalogueResponse, type ComplianceRegulation, type ComplianceRegulationSection, type ComplianceReport, type ComplianceReportListItem, type ComplianceReportListParams, type ComplianceReportSummary, type ComplianceTest, type ComplianceTestEvidence, type ComplianceTestVerdict, ConflictError, type ConnectChatTarget, type CreateBatchRequest, type CreateComplianceBatchRequest, type CreateComplianceBatchResponse, type CreateDatasetRequest, type CreateDigitalTestConfigRequest, type CreateDigitalTestRunRequest, type CreateDigitalTestRunResponse, type CreateLoadTestRequest, type CreateMappingJobRequest, type CreateMissionTestConfigRequest, type CreateMissionTestRequest, type CreateProfileRequest, type CreateScheduleRequest, type CreateSweepRequest, type CreateTestConfigRequest, type CreateTestJobRequest, type CreateTestRunRequest, type CreateUploadUrlRequest, type CurrentRun, type DTMFOption, type Dataset, type DatasetsListParams, type DigitalComplianceAuditSummary, type DigitalComplianceReportParams, type DigitalEvidence, type DigitalOutcome, type DigitalProfile, type DigitalProfileItem, type DigitalRunStatus, type DigitalSample, type DigitalStepResult, type DigitalTarget, type DigitalTestConfig, type DigitalTestConfigBase, type DigitalTestConfigListParams, type DigitalTestKind, type DigitalTestRun, type DigitalTestRunListParams, type DigitalTranscriptTurn, type DownloadOptions, type EndChatStep, type EnrichRequest, type EnrichResponse, type Enrichment, type EnrichmentDimensions, type EnrichmentStatus, type ExpectChatStep, type FlatTreeNode, type GeneratePdfRequest, type GeneratePdfResponse, type HttpJsonTarget, type JobStatus, type LaunchDigitalTestConfigRequest, type ListDigitalComplianceAuditsResponse, type ListDigitalTestConfigsResponse, type ListDigitalTestRunsResponse, type ListVoicesResponse, type LoadTest, type LoadTestEstimate, type LoadTestEstimateRequest, type LoadTestProgress, type LoadTestRun, type LoadTestStatus, type LoadTestStatusResponse, type LoadTestingListParams, type MappingJob, type MappingJobConfig, type MappingJobListItem, type MappingJobStats, type MappingListParams, type MappingMode, type MappingPath, type MappingRun, type MappingRunStatus, type MappingStep, type MappingTree, type MappingTreeEmptyState, type MissionTestConfig, type MissionTestConfigListItem, type MissionTestConfigListParams, type MissionTestDefaults, type MissionTestKind, type MissionTestListParams, type MissionTestProfile, type MissionTestRun, type MissionTestRunResponse, type MissionTestStatus, Nopaque, NopaqueAPIError, NopaqueConfigError, NopaqueError, type NopaqueOptions, NopaqueTimeoutError, NotFoundError, Page, Paginator, PermissionError, type ProbeResult, type Profile, type ProfileItem, type ProfileParametersResponse, type ProfilesByParametersParams, type ProfilesByParametersResponse, type ProfilesListParams, type QualityScoringResults, RateLimitError, type RequestOptions, type ResolvedDataset, type ResolvedDatasetEntry, type RetryConfig, type Schedule, type ScheduleListParams, type ScheduleTargetType, type ScheduleType, type SendChatStep, ServerError, type StepResult, type StepStatus, type Sweep, type SweepRun, type SweepRunStatus, type SweepStatus, type SweepVariationResult, type SweepsListParams, type TestConfig, type TestJob, type TestJobStatus, type TestRun, type TestRunAggregateParams, type TestRunAggregateResponse, type
|
|
2091
|
+
export { APIConnectionError, APITimeoutError, type AddProfileItemRequest, type AggregateGroup, type AggregateGroupBy, type AggregateTimeBucket, type AudioCategory, type AudioDownloadURL, type AudioFile, type AudioListParams, type AudioUploadURL, AuthenticationError, type Batch, type BatchRun, type BatchRunStatus, type BatchStatus, type BatchesListParams, type CallTelemetry, type ChatMatcher, type ChatStep, type ChatStepBase, type ComplianceCatalogue, type ComplianceCatalogueResponse, type ComplianceRegulation, type ComplianceRegulationSection, type ComplianceReport, type ComplianceReportListItem, type ComplianceReportListParams, type ComplianceReportSummary, type ComplianceTest, type ComplianceTestEvidence, type ComplianceTestVerdict, ConflictError, type ConnectChatTarget, type CreateBatchRequest, type CreateComplianceBatchRequest, type CreateComplianceBatchResponse, type CreateDatasetRequest, type CreateDigitalTestConfigRequest, type CreateDigitalTestRunRequest, type CreateDigitalTestRunResponse, type CreateLoadTestRequest, type CreateMappingJobRequest, type CreateMissionTestConfigRequest, type CreateMissionTestRequest, type CreateProfileRequest, type CreateScheduleRequest, type CreateSweepRequest, type CreateTestConfigRequest, type CreateTestJobRequest, type CreateTestRunRequest, type CreateUploadUrlRequest, type CurrentRun, type DTMFOption, type Dataset, type DatasetsListParams, type DigitalComplianceAuditSummary, type DigitalComplianceReportParams, type DigitalEvidence, type DigitalOutcome, type DigitalProfile, type DigitalProfileItem, type DigitalRunStatus, type DigitalSample, type DigitalStepResult, type DigitalTarget, type DigitalTestConfig, type DigitalTestConfigBase, type DigitalTestConfigListParams, type DigitalTestKind, type DigitalTestRun, type DigitalTestRunListParams, type DigitalTranscriptTurn, type DownloadOptions, type EndChatStep, type EnrichRequest, type EnrichResponse, type Enrichment, type EnrichmentConfig, type EnrichmentDimensions, type EnrichmentStatus, type ExpectChatStep, type FlatTreeNode, type GeneratePdfRequest, type GeneratePdfResponse, type HttpJsonTarget, type JobStatus, type LaunchDigitalTestConfigRequest, type ListDigitalComplianceAuditsResponse, type ListDigitalTestConfigsResponse, type ListDigitalTestRunsResponse, type ListVoicesResponse, type LoadTest, type LoadTestEstimate, type LoadTestEstimateRequest, type LoadTestProgress, type LoadTestRun, type LoadTestStatus, type LoadTestStatusResponse, type LoadTestingListParams, type MappingJob, type MappingJobConfig, type MappingJobListItem, type MappingJobStats, type MappingListParams, type MappingMode, type MappingPath, type MappingRun, type MappingRunStatus, type MappingStep, type MappingTree, type MappingTreeEmptyState, type MissionTestConfig, type MissionTestConfigListItem, type MissionTestConfigListParams, type MissionTestDefaults, type MissionTestKind, type MissionTestListParams, type MissionTestProfile, type MissionTestRun, type MissionTestRunResponse, type MissionTestStatus, Nopaque, NopaqueAPIError, NopaqueConfigError, NopaqueError, type NopaqueOptions, NopaqueTimeoutError, NotFoundError, Page, Paginator, PermissionError, type ProbeResult, type Profile, type ProfileDataItem, type ProfileItem, type ProfileParametersResponse, type ProfileVoiceItem, type ProfileVoiceItemBase, type ProfilesByParametersParams, type ProfilesByParametersResponse, type ProfilesListParams, type QualityScoringResults, RateLimitError, type RepeatBehavior, type RepeatConfig, type RequestOptions, type ResolvedDataset, type ResolvedDatasetEntry, type RetryConfig, type Schedule, type ScheduleListParams, type ScheduleTargetType, type ScheduleType, type SendChatStep, ServerError, type StepResult, type StepStatus, type Sweep, type SweepRun, type SweepRunStatus, type SweepStatus, type SweepVariationResult, type SweepsListParams, type TestConfig, type TestJob, type TestJobStatus, type TestRun, type TestRunAggregateParams, type TestRunAggregateResponse, type TestRunDetails, type TestRunListItem, type TestRunListParams, type TestRunOutcome, type TestRunStatus, type TestRunType, type TestStep, type TestStepResult, type TestingListParams, type TokenUsageDetails, type TokenUsageResponse, type TreeFormat, type TreeInputRequired, type TreeNode, type TreeNodeEnrichment, type TurnTelemetry, type UpdateBatchRequest, type UpdateDatasetRequest, type UpdateDigitalTestConfigRequest, type UpdateLoadTestRequest, type UpdateMappingJobRequest, type UpdateMissionTestConfigRequest, type UpdateProfileItemRequest, type UpdateProfileRequest, type UpdateScheduleRequest, type UpdateSweepRequest, type UpdateTestConfigRequest, type UploadInput, VERSION, ValidationError, type Vertical, type Voice, type WaitChatStep, type WebWidgetTarget };
|
package/dist/index.d.ts
CHANGED
|
@@ -1110,10 +1110,32 @@ type MappingMode = 'dtmf' | 'dtmf-audio' | 'full-audio';
|
|
|
1110
1110
|
* field (post-merged from the run, not the job-level idle/running cycle).
|
|
1111
1111
|
*/
|
|
1112
1112
|
type MappingRunStatus = 'idle' | 'running' | 'completed' | 'failed' | 'limited';
|
|
1113
|
+
/**
|
|
1114
|
+
* Industry vertical used for prompt-library lookup. Required by the API
|
|
1115
|
+
* whenever `mappingMode` is not `dtmf`.
|
|
1116
|
+
*/
|
|
1117
|
+
type Vertical = 'FSI' | 'Healthcare' | 'EnergyUtilities' | 'Telecoms' | 'General';
|
|
1118
|
+
/** Behaviour when the orchestrator revisits an already-discovered menu. */
|
|
1119
|
+
type RepeatBehavior = 'skip' | 'explore_once' | 'explore_n';
|
|
1113
1120
|
interface RetryConfig {
|
|
1114
1121
|
enabled: boolean;
|
|
1115
1122
|
maxRetries: number;
|
|
1116
1123
|
}
|
|
1124
|
+
interface RepeatConfig {
|
|
1125
|
+
behavior: RepeatBehavior;
|
|
1126
|
+
/** Only meaningful when `behavior` is `explore_n`. Defaults to 2 server-side. */
|
|
1127
|
+
maxExplorations?: number;
|
|
1128
|
+
}
|
|
1129
|
+
interface EnrichmentConfig {
|
|
1130
|
+
enabled: boolean;
|
|
1131
|
+
/** Defaults to `["quality_scoring"]` server-side. */
|
|
1132
|
+
types?: string[];
|
|
1133
|
+
}
|
|
1134
|
+
/**
|
|
1135
|
+
* Per-job configuration. Every mode-related knob lives here rather than at the
|
|
1136
|
+
* top of the request body — the API reads `body.config.mappingMode`, and a
|
|
1137
|
+
* top-level `mappingMode` is ignored.
|
|
1138
|
+
*/
|
|
1117
1139
|
interface MappingJobConfig {
|
|
1118
1140
|
maxDepth?: number;
|
|
1119
1141
|
maxCalls?: number;
|
|
@@ -1123,7 +1145,13 @@ interface MappingJobConfig {
|
|
|
1123
1145
|
voiceProfileId?: string;
|
|
1124
1146
|
dataProfileId?: string;
|
|
1125
1147
|
retryConfig?: RetryConfig;
|
|
1148
|
+
repeatConfig?: RepeatConfig;
|
|
1149
|
+
enrichmentConfig?: EnrichmentConfig;
|
|
1126
1150
|
mappingMode?: MappingMode;
|
|
1151
|
+
/** Required when `mappingMode` is `dtmf-audio` or `full-audio`. */
|
|
1152
|
+
vertical?: Vertical;
|
|
1153
|
+
/** Security-probe mode. The API rejects it combined with `mappingMode: 'dtmf'`. */
|
|
1154
|
+
probeMode?: boolean;
|
|
1127
1155
|
}
|
|
1128
1156
|
interface MappingJobStats {
|
|
1129
1157
|
totalCalls: number;
|
|
@@ -1502,22 +1530,40 @@ declare class MissionTestsResource extends Resource {
|
|
|
1502
1530
|
cancel(id: string, requestOptions?: RequestOptions): Promise<MissionTestRun>;
|
|
1503
1531
|
}
|
|
1504
1532
|
|
|
1505
|
-
|
|
1533
|
+
/**
|
|
1534
|
+
* Profile items are a discriminated union on `type`. A voice item points at an
|
|
1535
|
+
* uploaded audio row; a data item points at an item inside a dataset. Branch on
|
|
1536
|
+
* `type` before reaching for `audioId` or `datasetId`.
|
|
1537
|
+
*/
|
|
1538
|
+
interface ProfileVoiceItemBase {
|
|
1506
1539
|
id: string;
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1540
|
+
/**
|
|
1541
|
+
* Legacy display label. Deprecated server-side and no longer written — for
|
|
1542
|
+
* data items the label is derived from the dataset item's key at read time,
|
|
1543
|
+
* so it is frequently absent. Do not rely on it.
|
|
1544
|
+
*/
|
|
1545
|
+
label?: string;
|
|
1546
|
+
description?: string;
|
|
1547
|
+
}
|
|
1548
|
+
interface ProfileVoiceItem extends ProfileVoiceItemBase {
|
|
1549
|
+
type: 'voice';
|
|
1550
|
+
audioId: string;
|
|
1551
|
+
}
|
|
1552
|
+
interface ProfileDataItem extends ProfileVoiceItemBase {
|
|
1553
|
+
type: 'data';
|
|
1554
|
+
datasetId: string;
|
|
1555
|
+
itemId: string;
|
|
1512
1556
|
}
|
|
1557
|
+
type ProfileItem = ProfileVoiceItem | ProfileDataItem;
|
|
1513
1558
|
interface Profile {
|
|
1514
1559
|
id: string;
|
|
1560
|
+
workspaceId?: string;
|
|
1515
1561
|
name: string;
|
|
1516
1562
|
description?: string;
|
|
1517
1563
|
items?: ProfileItem[];
|
|
1518
1564
|
createdAt?: string;
|
|
1519
1565
|
updatedAt?: string;
|
|
1520
|
-
|
|
1566
|
+
createdBy?: string;
|
|
1521
1567
|
}
|
|
1522
1568
|
interface CreateProfileRequest {
|
|
1523
1569
|
name: string;
|
|
@@ -1527,13 +1573,27 @@ interface UpdateProfileRequest {
|
|
|
1527
1573
|
name?: string;
|
|
1528
1574
|
description?: string;
|
|
1529
1575
|
}
|
|
1530
|
-
|
|
1576
|
+
/**
|
|
1577
|
+
* Body for `POST /profiles/{id}/items`. `type` selects which id field the API
|
|
1578
|
+
* requires, and `label` is required by this legacy route even though the field
|
|
1579
|
+
* is deprecated on the stored item.
|
|
1580
|
+
*/
|
|
1581
|
+
type AddProfileItemRequest = {
|
|
1582
|
+
type: 'voice';
|
|
1583
|
+
audioId: string;
|
|
1531
1584
|
label: string;
|
|
1532
|
-
|
|
1533
|
-
}
|
|
1585
|
+
description?: string;
|
|
1586
|
+
} | {
|
|
1587
|
+
type: 'data';
|
|
1588
|
+
datasetId: string;
|
|
1589
|
+
itemId: string;
|
|
1590
|
+
label: string;
|
|
1591
|
+
description?: string;
|
|
1592
|
+
};
|
|
1593
|
+
/** Body for `PUT /profiles/{id}/items/{itemId}`. Only these two are read. */
|
|
1534
1594
|
interface UpdateProfileItemRequest {
|
|
1535
1595
|
label?: string;
|
|
1536
|
-
|
|
1596
|
+
description?: string;
|
|
1537
1597
|
}
|
|
1538
1598
|
interface ProfilesListParams {
|
|
1539
1599
|
limit?: number;
|
|
@@ -1558,9 +1618,10 @@ declare class ProfilesResource extends Resource {
|
|
|
1558
1618
|
get(profileId: string, requestOptions?: RequestOptions): Promise<Profile>;
|
|
1559
1619
|
update(profileId: string, body: UpdateProfileRequest, requestOptions?: RequestOptions): Promise<Profile>;
|
|
1560
1620
|
delete(profileId: string, requestOptions?: RequestOptions): Promise<void>;
|
|
1561
|
-
addItem(profileId: string, body: AddProfileItemRequest, requestOptions?: RequestOptions): Promise<
|
|
1562
|
-
updateItem(profileId: string, itemId: string, body: UpdateProfileItemRequest, requestOptions?: RequestOptions): Promise<
|
|
1563
|
-
|
|
1621
|
+
addItem(profileId: string, body: AddProfileItemRequest, requestOptions?: RequestOptions): Promise<Profile>;
|
|
1622
|
+
updateItem(profileId: string, itemId: string, body: UpdateProfileItemRequest, requestOptions?: RequestOptions): Promise<Profile>;
|
|
1623
|
+
/** Returns the updated profile, as all three item routes do. */
|
|
1624
|
+
deleteItem(profileId: string, itemId: string, requestOptions?: RequestOptions): Promise<Profile>;
|
|
1564
1625
|
listParameters(requestOptions?: RequestOptions): Promise<ProfileParametersResponse>;
|
|
1565
1626
|
findByParameters(params: ProfilesByParametersParams, requestOptions?: RequestOptions): Promise<ProfilesByParametersResponse>;
|
|
1566
1627
|
}
|
|
@@ -1755,7 +1816,6 @@ interface CreateTestJobRequest {
|
|
|
1755
1816
|
name?: string;
|
|
1756
1817
|
}
|
|
1757
1818
|
type TestRunStatus = 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
1758
|
-
type TestRunResult = 'pass' | 'fail' | 'partial';
|
|
1759
1819
|
/**
|
|
1760
1820
|
* A single execution of a test. The primary identifier is `id`, matching the
|
|
1761
1821
|
* server's entity shape. Pass it to `waitForRun()` and `get()`.
|
|
@@ -1769,7 +1829,11 @@ interface TestRun {
|
|
|
1769
1829
|
testConfigId?: string;
|
|
1770
1830
|
workspaceId?: string;
|
|
1771
1831
|
status?: TestRunStatus;
|
|
1772
|
-
|
|
1832
|
+
/**
|
|
1833
|
+
* Terminal verdict. The API never sends a `result` field — an SDK type
|
|
1834
|
+
* declaring one read as undefined on every run, including passing ones.
|
|
1835
|
+
*/
|
|
1836
|
+
outcome?: TestRunOutcome | null;
|
|
1773
1837
|
startedAt?: string;
|
|
1774
1838
|
completedAt?: string;
|
|
1775
1839
|
launchDeadline?: string;
|
|
@@ -1778,6 +1842,40 @@ interface TestRun {
|
|
|
1778
1842
|
failedSteps?: number;
|
|
1779
1843
|
[key: string]: unknown;
|
|
1780
1844
|
}
|
|
1845
|
+
/**
|
|
1846
|
+
* A single scripted step's result. Named `TestStepResult`, not `StepResult` —
|
|
1847
|
+
* the latter is already exported for mapping and is an unrelated shape.
|
|
1848
|
+
*/
|
|
1849
|
+
interface TestStepResult {
|
|
1850
|
+
id: string;
|
|
1851
|
+
runId: string;
|
|
1852
|
+
stepIndex: number;
|
|
1853
|
+
stepId: string;
|
|
1854
|
+
stepName: string;
|
|
1855
|
+
outcome: 'PASS' | 'FAIL' | 'TIMEOUT' | 'ERROR';
|
|
1856
|
+
expectedTranscript: string;
|
|
1857
|
+
actualTranscript?: string;
|
|
1858
|
+
similarity?: number;
|
|
1859
|
+
threshold: number;
|
|
1860
|
+
actionType?: string;
|
|
1861
|
+
actionValue?: string;
|
|
1862
|
+
duration?: number;
|
|
1863
|
+
errorMessage?: string;
|
|
1864
|
+
matcherScores?: Record<string, number>;
|
|
1865
|
+
turnTelemetry?: Record<string, unknown>;
|
|
1866
|
+
createdAt: string;
|
|
1867
|
+
}
|
|
1868
|
+
/**
|
|
1869
|
+
* What `testing.runs.get()` returns: the run row enriched with its step
|
|
1870
|
+
* results, the joined transcript, and a snapshot of the parent config.
|
|
1871
|
+
* Mission and compliance runs have no scripted steps, so `stepResults` is
|
|
1872
|
+
* empty and `config` is absent for those.
|
|
1873
|
+
*/
|
|
1874
|
+
interface TestRunDetails extends TestRun {
|
|
1875
|
+
stepResults?: TestStepResult[];
|
|
1876
|
+
fullTranscript?: string;
|
|
1877
|
+
config?: TestConfig;
|
|
1878
|
+
}
|
|
1781
1879
|
/**
|
|
1782
1880
|
* Body for POST /testing/runs. Exactly one of jobId or testConfigId
|
|
1783
1881
|
* must be provided:
|
|
@@ -1948,8 +2046,8 @@ declare class TestingRunsResource extends Resource {
|
|
|
1948
2046
|
listPage(params?: TestRunListParams, requestOptions?: RequestOptions): Promise<Page<TestRunListItem>>;
|
|
1949
2047
|
/** GET /testing/runs/aggregate — grouped counts over test runs. */
|
|
1950
2048
|
aggregate(params: TestRunAggregateParams, requestOptions?: RequestOptions): Promise<TestRunAggregateResponse>;
|
|
1951
|
-
get(runId: string, requestOptions?: RequestOptions): Promise<
|
|
1952
|
-
waitForRun(runId: string, opts?: TestingWaitForOptions): Promise<
|
|
2049
|
+
get(runId: string, requestOptions?: RequestOptions): Promise<TestRunDetails>;
|
|
2050
|
+
waitForRun(runId: string, opts?: TestingWaitForOptions): Promise<TestRunDetails>;
|
|
1953
2051
|
}
|
|
1954
2052
|
declare class TestingResource extends Resource {
|
|
1955
2053
|
readonly configs: TestingConfigsResource;
|
|
@@ -1990,4 +2088,4 @@ declare class Nopaque {
|
|
|
1990
2088
|
|
|
1991
2089
|
declare const VERSION: string;
|
|
1992
2090
|
|
|
1993
|
-
export { APIConnectionError, APITimeoutError, type AddProfileItemRequest, type AggregateGroup, type AggregateGroupBy, type AggregateTimeBucket, type AudioCategory, type AudioDownloadURL, type AudioFile, type AudioListParams, type AudioUploadURL, AuthenticationError, type Batch, type BatchRun, type BatchRunStatus, type BatchStatus, type BatchesListParams, type CallTelemetry, type ChatMatcher, type ChatStep, type ChatStepBase, type ComplianceCatalogue, type ComplianceCatalogueResponse, type ComplianceRegulation, type ComplianceRegulationSection, type ComplianceReport, type ComplianceReportListItem, type ComplianceReportListParams, type ComplianceReportSummary, type ComplianceTest, type ComplianceTestEvidence, type ComplianceTestVerdict, ConflictError, type ConnectChatTarget, type CreateBatchRequest, type CreateComplianceBatchRequest, type CreateComplianceBatchResponse, type CreateDatasetRequest, type CreateDigitalTestConfigRequest, type CreateDigitalTestRunRequest, type CreateDigitalTestRunResponse, type CreateLoadTestRequest, type CreateMappingJobRequest, type CreateMissionTestConfigRequest, type CreateMissionTestRequest, type CreateProfileRequest, type CreateScheduleRequest, type CreateSweepRequest, type CreateTestConfigRequest, type CreateTestJobRequest, type CreateTestRunRequest, type CreateUploadUrlRequest, type CurrentRun, type DTMFOption, type Dataset, type DatasetsListParams, type DigitalComplianceAuditSummary, type DigitalComplianceReportParams, type DigitalEvidence, type DigitalOutcome, type DigitalProfile, type DigitalProfileItem, type DigitalRunStatus, type DigitalSample, type DigitalStepResult, type DigitalTarget, type DigitalTestConfig, type DigitalTestConfigBase, type DigitalTestConfigListParams, type DigitalTestKind, type DigitalTestRun, type DigitalTestRunListParams, type DigitalTranscriptTurn, type DownloadOptions, type EndChatStep, type EnrichRequest, type EnrichResponse, type Enrichment, type EnrichmentDimensions, type EnrichmentStatus, type ExpectChatStep, type FlatTreeNode, type GeneratePdfRequest, type GeneratePdfResponse, type HttpJsonTarget, type JobStatus, type LaunchDigitalTestConfigRequest, type ListDigitalComplianceAuditsResponse, type ListDigitalTestConfigsResponse, type ListDigitalTestRunsResponse, type ListVoicesResponse, type LoadTest, type LoadTestEstimate, type LoadTestEstimateRequest, type LoadTestProgress, type LoadTestRun, type LoadTestStatus, type LoadTestStatusResponse, type LoadTestingListParams, type MappingJob, type MappingJobConfig, type MappingJobListItem, type MappingJobStats, type MappingListParams, type MappingMode, type MappingPath, type MappingRun, type MappingRunStatus, type MappingStep, type MappingTree, type MappingTreeEmptyState, type MissionTestConfig, type MissionTestConfigListItem, type MissionTestConfigListParams, type MissionTestDefaults, type MissionTestKind, type MissionTestListParams, type MissionTestProfile, type MissionTestRun, type MissionTestRunResponse, type MissionTestStatus, Nopaque, NopaqueAPIError, NopaqueConfigError, NopaqueError, type NopaqueOptions, NopaqueTimeoutError, NotFoundError, Page, Paginator, PermissionError, type ProbeResult, type Profile, type ProfileItem, type ProfileParametersResponse, type ProfilesByParametersParams, type ProfilesByParametersResponse, type ProfilesListParams, type QualityScoringResults, RateLimitError, type RequestOptions, type ResolvedDataset, type ResolvedDatasetEntry, type RetryConfig, type Schedule, type ScheduleListParams, type ScheduleTargetType, type ScheduleType, type SendChatStep, ServerError, type StepResult, type StepStatus, type Sweep, type SweepRun, type SweepRunStatus, type SweepStatus, type SweepVariationResult, type SweepsListParams, type TestConfig, type TestJob, type TestJobStatus, type TestRun, type TestRunAggregateParams, type TestRunAggregateResponse, type
|
|
2091
|
+
export { APIConnectionError, APITimeoutError, type AddProfileItemRequest, type AggregateGroup, type AggregateGroupBy, type AggregateTimeBucket, type AudioCategory, type AudioDownloadURL, type AudioFile, type AudioListParams, type AudioUploadURL, AuthenticationError, type Batch, type BatchRun, type BatchRunStatus, type BatchStatus, type BatchesListParams, type CallTelemetry, type ChatMatcher, type ChatStep, type ChatStepBase, type ComplianceCatalogue, type ComplianceCatalogueResponse, type ComplianceRegulation, type ComplianceRegulationSection, type ComplianceReport, type ComplianceReportListItem, type ComplianceReportListParams, type ComplianceReportSummary, type ComplianceTest, type ComplianceTestEvidence, type ComplianceTestVerdict, ConflictError, type ConnectChatTarget, type CreateBatchRequest, type CreateComplianceBatchRequest, type CreateComplianceBatchResponse, type CreateDatasetRequest, type CreateDigitalTestConfigRequest, type CreateDigitalTestRunRequest, type CreateDigitalTestRunResponse, type CreateLoadTestRequest, type CreateMappingJobRequest, type CreateMissionTestConfigRequest, type CreateMissionTestRequest, type CreateProfileRequest, type CreateScheduleRequest, type CreateSweepRequest, type CreateTestConfigRequest, type CreateTestJobRequest, type CreateTestRunRequest, type CreateUploadUrlRequest, type CurrentRun, type DTMFOption, type Dataset, type DatasetsListParams, type DigitalComplianceAuditSummary, type DigitalComplianceReportParams, type DigitalEvidence, type DigitalOutcome, type DigitalProfile, type DigitalProfileItem, type DigitalRunStatus, type DigitalSample, type DigitalStepResult, type DigitalTarget, type DigitalTestConfig, type DigitalTestConfigBase, type DigitalTestConfigListParams, type DigitalTestKind, type DigitalTestRun, type DigitalTestRunListParams, type DigitalTranscriptTurn, type DownloadOptions, type EndChatStep, type EnrichRequest, type EnrichResponse, type Enrichment, type EnrichmentConfig, type EnrichmentDimensions, type EnrichmentStatus, type ExpectChatStep, type FlatTreeNode, type GeneratePdfRequest, type GeneratePdfResponse, type HttpJsonTarget, type JobStatus, type LaunchDigitalTestConfigRequest, type ListDigitalComplianceAuditsResponse, type ListDigitalTestConfigsResponse, type ListDigitalTestRunsResponse, type ListVoicesResponse, type LoadTest, type LoadTestEstimate, type LoadTestEstimateRequest, type LoadTestProgress, type LoadTestRun, type LoadTestStatus, type LoadTestStatusResponse, type LoadTestingListParams, type MappingJob, type MappingJobConfig, type MappingJobListItem, type MappingJobStats, type MappingListParams, type MappingMode, type MappingPath, type MappingRun, type MappingRunStatus, type MappingStep, type MappingTree, type MappingTreeEmptyState, type MissionTestConfig, type MissionTestConfigListItem, type MissionTestConfigListParams, type MissionTestDefaults, type MissionTestKind, type MissionTestListParams, type MissionTestProfile, type MissionTestRun, type MissionTestRunResponse, type MissionTestStatus, Nopaque, NopaqueAPIError, NopaqueConfigError, NopaqueError, type NopaqueOptions, NopaqueTimeoutError, NotFoundError, Page, Paginator, PermissionError, type ProbeResult, type Profile, type ProfileDataItem, type ProfileItem, type ProfileParametersResponse, type ProfileVoiceItem, type ProfileVoiceItemBase, type ProfilesByParametersParams, type ProfilesByParametersResponse, type ProfilesListParams, type QualityScoringResults, RateLimitError, type RepeatBehavior, type RepeatConfig, type RequestOptions, type ResolvedDataset, type ResolvedDatasetEntry, type RetryConfig, type Schedule, type ScheduleListParams, type ScheduleTargetType, type ScheduleType, type SendChatStep, ServerError, type StepResult, type StepStatus, type Sweep, type SweepRun, type SweepRunStatus, type SweepStatus, type SweepVariationResult, type SweepsListParams, type TestConfig, type TestJob, type TestJobStatus, type TestRun, type TestRunAggregateParams, type TestRunAggregateResponse, type TestRunDetails, type TestRunListItem, type TestRunListParams, type TestRunOutcome, type TestRunStatus, type TestRunType, type TestStep, type TestStepResult, type TestingListParams, type TokenUsageDetails, type TokenUsageResponse, type TreeFormat, type TreeInputRequired, type TreeNode, type TreeNodeEnrichment, type TurnTelemetry, type UpdateBatchRequest, type UpdateDatasetRequest, type UpdateDigitalTestConfigRequest, type UpdateLoadTestRequest, type UpdateMappingJobRequest, type UpdateMissionTestConfigRequest, type UpdateProfileItemRequest, type UpdateProfileRequest, type UpdateScheduleRequest, type UpdateSweepRequest, type UpdateTestConfigRequest, type UploadInput, VERSION, ValidationError, type Vertical, type Voice, type WaitChatStep, type WebWidgetTarget };
|
package/dist/index.mjs
CHANGED
|
@@ -91,7 +91,7 @@ function resolveConfig(opts) {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
// src/version.ts
|
|
94
|
-
var VERSION = true ? "0.
|
|
94
|
+
var VERSION = true ? "0.7.0" : "0.0.0-dev";
|
|
95
95
|
|
|
96
96
|
// src/userAgent.ts
|
|
97
97
|
function composeUserAgent() {
|
|
@@ -1218,8 +1218,9 @@ var ProfilesResource = class extends Resource {
|
|
|
1218
1218
|
requestOptions
|
|
1219
1219
|
});
|
|
1220
1220
|
}
|
|
1221
|
+
/** Returns the updated profile, as all three item routes do. */
|
|
1221
1222
|
async deleteItem(profileId, itemId, requestOptions) {
|
|
1222
|
-
await this.transport.request(
|
|
1223
|
+
return await this.transport.request(
|
|
1223
1224
|
"DELETE",
|
|
1224
1225
|
`/profiles/${profileId}/items/${itemId}`,
|
|
1225
1226
|
{ requestOptions }
|
|
@@ -1345,6 +1346,11 @@ var SweepsResource = class extends Resource {
|
|
|
1345
1346
|
|
|
1346
1347
|
// src/resources/testing.ts
|
|
1347
1348
|
var RUN_TERMINAL_STATUSES3 = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
|
|
1349
|
+
function isRunSettled(run) {
|
|
1350
|
+
if (run.status === void 0 || !RUN_TERMINAL_STATUSES3.has(run.status)) return false;
|
|
1351
|
+
if (run.status !== "completed") return true;
|
|
1352
|
+
return run.outcome != null && run.outcome !== "pending";
|
|
1353
|
+
}
|
|
1348
1354
|
var TestingConfigsResource = class extends Resource {
|
|
1349
1355
|
async create(body, requestOptions) {
|
|
1350
1356
|
return await this.transport.request("POST", "/testing/configs", { body, requestOptions });
|
|
@@ -1445,7 +1451,7 @@ var TestingRunsResource = class extends Resource {
|
|
|
1445
1451
|
async waitForRun(runId, opts = {}) {
|
|
1446
1452
|
return await waitFor({
|
|
1447
1453
|
fetch: () => this.get(runId, opts.requestOptions),
|
|
1448
|
-
isTerminal:
|
|
1454
|
+
isTerminal: isRunSettled,
|
|
1449
1455
|
timeout: opts.timeout,
|
|
1450
1456
|
initialInterval: opts.pollInterval,
|
|
1451
1457
|
intervalCap: opts.intervalCap,
|