@nopaque/sdk 0.1.1 → 0.6.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 +132 -0
- package/README.md +21 -1
- package/dist/index.cjs +420 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1205 -42
- package/dist/index.d.ts +1205 -42
- package/dist/index.mjs +420 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +13 -11
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,138 @@ All notable changes to this project will be documented in this file.
|
|
|
4
4
|
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
|
+
## [0.6.0] - 2026-08-19
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- `TestRun.outcome` replaces `TestRun.result`. The API has never sent a
|
|
12
|
+
`result` field, so `run.result` read as `undefined` on every run including
|
|
13
|
+
passing ones, and the declared values (`pass`/`fail`/`partial`) did not exist.
|
|
14
|
+
The real field is `outcome`, with uppercase values
|
|
15
|
+
`PASS | FAIL | ERROR | INCONCLUSIVE | pending` — the same `TestRunOutcome`
|
|
16
|
+
the list, aggregate and mission-run types already used. Only the full
|
|
17
|
+
`TestRun` entity had drifted. The removed `TestRunResult` type described a
|
|
18
|
+
field that never existed.
|
|
19
|
+
- `ProfileItem` is now the discriminated union the API actually returns, keyed
|
|
20
|
+
on `type`: `ProfileVoiceItem` (`audioId`) or `ProfileDataItem`
|
|
21
|
+
(`datasetId` + `itemId`). It was previously `{id, label, value}` with both
|
|
22
|
+
`label` and `value` required — `value` does not exist on either variant, and
|
|
23
|
+
`label` is deprecated server-side and usually absent. `openapi.yaml` had this
|
|
24
|
+
right as a `oneOf`; the SDK was the drifted surface.
|
|
25
|
+
- `profiles.addItem()`, `updateItem()` and `deleteItem()` return the updated
|
|
26
|
+
`Profile`, which is what all three routes send. They were typed as returning
|
|
27
|
+
a `ProfileItem` (and `deleteItem` discarded the body entirely).
|
|
28
|
+
- `AddProfileItemRequest` is a union requiring `type` plus the matching id
|
|
29
|
+
field, replacing the invented `{label, value}`. `UpdateProfileItemRequest`
|
|
30
|
+
takes `label` / `description` — the only two fields the handler reads.
|
|
31
|
+
- Removed `Profile.matchedLabels`, which appears nowhere in the API.
|
|
32
|
+
|
|
33
|
+
## [0.5.0] - 2026-08-18
|
|
34
|
+
|
|
35
|
+
### Added
|
|
36
|
+
|
|
37
|
+
- `MappingJobConfig` now carries the full configuration surface the API accepts.
|
|
38
|
+
Previously it exposed 9 of the 13 documented fields, and the four it omitted
|
|
39
|
+
included `vertical` — which the API **requires** whenever `mappingMode` is
|
|
40
|
+
`dtmf-audio` or `full-audio`. Audio mapping jobs were therefore impossible to
|
|
41
|
+
create from the SDK; only `dtmf` worked.
|
|
42
|
+
- `vertical` — `FSI | Healthcare | EnergyUtilities | Telecoms | General`.
|
|
43
|
+
- `probeMode` — security-probe flag. Rejected by the API in combination with
|
|
44
|
+
`mappingMode: 'dtmf'`.
|
|
45
|
+
- `repeatConfig` — `{ behavior, maxExplorations? }` for revisited-menu handling.
|
|
46
|
+
- `enrichmentConfig` — `{ enabled, types? }` for the post-run enrichment pipeline.
|
|
47
|
+
- New exported types: `Vertical`, `RepeatBehavior`, `RepeatConfig`, `EnrichmentConfig`.
|
|
48
|
+
|
|
49
|
+
## [0.4.0] - 2026-08-12
|
|
50
|
+
|
|
51
|
+
### Added
|
|
52
|
+
|
|
53
|
+
- Digital (chat channel) testing, in beta. Access is limited to beta workspaces
|
|
54
|
+
during the beta period.
|
|
55
|
+
- `client.digitalTesting` — create, list, get, cancel and wait for digital test runs.
|
|
56
|
+
- `client.digitalTestConfigs` — save, update, delete and launch reusable digital test configs.
|
|
57
|
+
- `client.digitalCompliance` — list digital compliance audits and fetch a per-target report.
|
|
58
|
+
- `DigitalSample` carries the shapes the API actually returns, which differ
|
|
59
|
+
from the OpenAPI document: `transcript` is a `DigitalTranscriptTurn[]`
|
|
60
|
+
(`role`/`text`/`at`), not a string, and evidence arrives as separate
|
|
61
|
+
`passEvidence` / `failEvidence` arrays of `DigitalEvidence`
|
|
62
|
+
(`condition`/`reason`) — there is no combined `evidence` field.
|
|
63
|
+
- `DigitalTestRun.configId` — set when the run was launched from a saved
|
|
64
|
+
config. Returned by the API but undeclared in the OpenAPI document.
|
|
65
|
+
- `client.testing.listVoices()` — the operator-enabled voices a mission test may
|
|
66
|
+
use, and which is the default.
|
|
67
|
+
|
|
68
|
+
## [0.3.0] - 2026-07-09
|
|
69
|
+
|
|
70
|
+
### Added
|
|
71
|
+
|
|
72
|
+
All changes are additive and backward-compatible with existing signatures.
|
|
73
|
+
|
|
74
|
+
- **Mapping**
|
|
75
|
+
- `tags?: string[]` on `CreateMappingJobRequest`, `UpdateMappingJobRequest`,
|
|
76
|
+
and the `MappingJob` response type.
|
|
77
|
+
- `mapping.list()` now accepts the full server filter + pagination surface:
|
|
78
|
+
`phoneNumber`, `name`, `profileId`, `tag`, `status`, `createdAfter`,
|
|
79
|
+
`createdBefore`, `sort`, `sortDir`, `limit`, `cursor`. It returns slim
|
|
80
|
+
`MappingJobListItem` values and reads `nextCursor` (falling back to the
|
|
81
|
+
`nextToken` back-compat alias) for pagination.
|
|
82
|
+
- Single-job response (`mapping.get()`) gains `runNumber?` and a nested
|
|
83
|
+
`currentRun?` summary (omitted, never null, when the job has no run).
|
|
84
|
+
- Tree nodes gain the enrichment fields (`stepType`, `voicePrompt`,
|
|
85
|
+
`menuLabel`, `spokenResponse`, `probeCategory`, `probeClassification`,
|
|
86
|
+
`probeRationale`, `audioUrl`, `duration`, `inputRequired`), tree/flat-tree
|
|
87
|
+
responses gain `runNumber?`, and the empty-state envelope
|
|
88
|
+
(`tree: null` + `reason`/`message`) is now typed — branch on `tree === null`.
|
|
89
|
+
- New permissive `CallTelemetry` / `TurnTelemetry` types (all fields optional,
|
|
90
|
+
unknown keys tolerated); `callTelemetry?` may appear on `MappingRun` and
|
|
91
|
+
`turnTelemetry?` on step results.
|
|
92
|
+
- **Testing**
|
|
93
|
+
- `testing.runs.list()` (and the `testing.listRuns()` alias) gain filter +
|
|
94
|
+
pagination params (`jobId`, `runType`, `outcome`, `phoneNumber`, `configId`,
|
|
95
|
+
`catalogueTestId`, `startedAfter`, `startedBefore`, `sortBy`, `sortDir`,
|
|
96
|
+
`limit`, `cursor`), returning slim `TestRunListItem` values with `nextCursor`.
|
|
97
|
+
- `testing.aggregateRuns(params)` for `GET /testing/runs/aggregate`.
|
|
98
|
+
- `testing.getMissionTestRun(id)` for `GET /testing/mission-test-runs/{id}`.
|
|
99
|
+
- **Mission test configs**
|
|
100
|
+
- `tags?: string[]` on `MissionTestConfig` and `CreateMissionTestConfigRequest`,
|
|
101
|
+
plus `description?` and `phoneNumber?`.
|
|
102
|
+
- `missionTestConfigs.update(id, body)` (PATCH partial update; `description`
|
|
103
|
+
and `tags` accept `null` to clear).
|
|
104
|
+
- `missionTestConfigs.list()` gains filter + pagination params
|
|
105
|
+
(`name`, `phoneNumber`, `sector`, `profileId`, `tag`, `createdAfter`,
|
|
106
|
+
`createdBefore`, `sort`, `sortDir`, `limit`, `cursor`) and returns slim
|
|
107
|
+
`MissionTestConfigListItem` values.
|
|
108
|
+
|
|
109
|
+
## [0.1.2] - 2026-05-03
|
|
110
|
+
|
|
111
|
+
### Fixed
|
|
112
|
+
- `mappingMode` placement in `CreateMappingJobRequest` and
|
|
113
|
+
`UpdateMappingJobRequest`. The field is moved into `MappingJobConfig`
|
|
114
|
+
to match what the live API actually accepts (the API reads
|
|
115
|
+
`body.config.mappingMode`, not `body.mappingMode`). Calls in 0.1.1
|
|
116
|
+
with `mappingMode` at the top level were silently being rejected by
|
|
117
|
+
the API as "mappingMode is required".
|
|
118
|
+
- `MappingJob` response type also drops top-level `mappingMode` for
|
|
119
|
+
consistency. Read the value from `job.config?.mappingMode` instead.
|
|
120
|
+
|
|
121
|
+
### Migration
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
// Before (0.1.1) — sent the value at the top level; API rejected it.
|
|
125
|
+
client.mapping.create({
|
|
126
|
+
name: 'Main',
|
|
127
|
+
phoneNumber: '+44...',
|
|
128
|
+
mappingMode: 'dtmf',
|
|
129
|
+
});
|
|
130
|
+
|
|
131
|
+
// After (0.1.2) — nested under config; API accepts.
|
|
132
|
+
client.mapping.create({
|
|
133
|
+
name: 'Main',
|
|
134
|
+
phoneNumber: '+44...',
|
|
135
|
+
config: { mappingMode: 'dtmf' },
|
|
136
|
+
});
|
|
137
|
+
```
|
|
138
|
+
|
|
7
139
|
## [0.1.1] - 2026-04-21
|
|
8
140
|
|
|
9
141
|
### Fixed
|
package/README.md
CHANGED
|
@@ -23,7 +23,7 @@ const client = new Nopaque({ apiKey: process.env.NOPAQUE_API_KEY });
|
|
|
23
23
|
const job = await client.mapping.create({
|
|
24
24
|
name: 'Main IVR',
|
|
25
25
|
phoneNumber: '+441234567890',
|
|
26
|
-
mappingMode: 'dtmf',
|
|
26
|
+
config: { mappingMode: 'dtmf' },
|
|
27
27
|
});
|
|
28
28
|
await client.mapping.start(job.id);
|
|
29
29
|
const final = await client.mapping.waitForComplete(job.id);
|
|
@@ -35,6 +35,26 @@ for await (const audio of client.audio.list()) {
|
|
|
35
35
|
}
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
+
### Digital testing (beta)
|
|
39
|
+
|
|
40
|
+
Access is limited to beta workspaces during the beta period.
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
const run = await client.digitalTesting.create({
|
|
44
|
+
targetRef: 'acme/billing-bot',
|
|
45
|
+
target: { transport: 'web-widget', url: 'https://example.com/support' },
|
|
46
|
+
// `sector` and `mission` are required on every digital run.
|
|
47
|
+
sector: 'utilities',
|
|
48
|
+
mission: 'Pay my bill',
|
|
49
|
+
kind: 'freeform',
|
|
50
|
+
acceptance: 'The bot states the outstanding balance.',
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
const finished = await client.digitalTesting.waitForRun(run.id);
|
|
54
|
+
// `completed` with outcome 'fail' is a RESULT, not an error.
|
|
55
|
+
console.log(finished.status, finished.outcome, finished.passRate);
|
|
56
|
+
```
|
|
57
|
+
|
|
38
58
|
## Features
|
|
39
59
|
|
|
40
60
|
- Full coverage of the Nopaque REST API via API-key auth
|