@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 CHANGED
@@ -4,6 +4,72 @@ 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.7.0] - 2026-08-19
8
+
9
+ ### Fixed
10
+
11
+ - `waitForRun()` could return before the run's verdict was written, giving
12
+ `outcome: undefined` and no step results on a run that had actually passed.
13
+ A re-fetch of the same id moments later returned the real verdict. The
14
+ container emits `run_status_changed{status:'completed'}` and
15
+ `run_completed{outcome}` as separate SQS messages with no ordering
16
+ guarantee, and the API skips undefined fields on write, so a status-only
17
+ message marks the run terminal with no outcome. Polling keyed on `status`
18
+ alone, so it returned that intermediate row. `completed` now also requires a
19
+ decided verdict; `failed` and `cancelled` still settle immediately, since
20
+ neither carries one.
21
+
22
+ ### Added
23
+
24
+ - `TestStepResult` and `TestRunDetails`. `testing.runs.get()` and
25
+ `waitForRun()` return `TestRunDetails` — the run row plus `stepResults`,
26
+ `fullTranscript` and an inline `config` snapshot, all of which the API has
27
+ always sent and neither SDK declared.
28
+ - Named `TestStepResult`, not `StepResult`: the latter is already exported
29
+ for mapping and is an unrelated shape.
30
+
31
+ ## [0.6.0] - 2026-08-19
32
+
33
+ ### Fixed
34
+
35
+ - `TestRun.outcome` replaces `TestRun.result`. The API has never sent a
36
+ `result` field, so `run.result` read as `undefined` on every run including
37
+ passing ones, and the declared values (`pass`/`fail`/`partial`) did not exist.
38
+ The real field is `outcome`, with uppercase values
39
+ `PASS | FAIL | ERROR | INCONCLUSIVE | pending` — the same `TestRunOutcome`
40
+ the list, aggregate and mission-run types already used. Only the full
41
+ `TestRun` entity had drifted. The removed `TestRunResult` type described a
42
+ field that never existed.
43
+ - `ProfileItem` is now the discriminated union the API actually returns, keyed
44
+ on `type`: `ProfileVoiceItem` (`audioId`) or `ProfileDataItem`
45
+ (`datasetId` + `itemId`). It was previously `{id, label, value}` with both
46
+ `label` and `value` required — `value` does not exist on either variant, and
47
+ `label` is deprecated server-side and usually absent. `openapi.yaml` had this
48
+ right as a `oneOf`; the SDK was the drifted surface.
49
+ - `profiles.addItem()`, `updateItem()` and `deleteItem()` return the updated
50
+ `Profile`, which is what all three routes send. They were typed as returning
51
+ a `ProfileItem` (and `deleteItem` discarded the body entirely).
52
+ - `AddProfileItemRequest` is a union requiring `type` plus the matching id
53
+ field, replacing the invented `{label, value}`. `UpdateProfileItemRequest`
54
+ takes `label` / `description` — the only two fields the handler reads.
55
+ - Removed `Profile.matchedLabels`, which appears nowhere in the API.
56
+
57
+ ## [0.5.0] - 2026-08-18
58
+
59
+ ### Added
60
+
61
+ - `MappingJobConfig` now carries the full configuration surface the API accepts.
62
+ Previously it exposed 9 of the 13 documented fields, and the four it omitted
63
+ included `vertical` — which the API **requires** whenever `mappingMode` is
64
+ `dtmf-audio` or `full-audio`. Audio mapping jobs were therefore impossible to
65
+ create from the SDK; only `dtmf` worked.
66
+ - `vertical` — `FSI | Healthcare | EnergyUtilities | Telecoms | General`.
67
+ - `probeMode` — security-probe flag. Rejected by the API in combination with
68
+ `mappingMode: 'dtmf'`.
69
+ - `repeatConfig` — `{ behavior, maxExplorations? }` for revisited-menu handling.
70
+ - `enrichmentConfig` — `{ enabled, types? }` for the post-run enrichment pipeline.
71
+ - New exported types: `Vertical`, `RepeatBehavior`, `RepeatConfig`, `EnrichmentConfig`.
72
+
7
73
  ## [0.4.0] - 2026-08-12
8
74
 
9
75
  ### Added
package/dist/index.cjs CHANGED
@@ -133,7 +133,7 @@ function resolveConfig(opts) {
133
133
  }
134
134
 
135
135
  // src/version.ts
136
- var VERSION = true ? "0.4.0" : "0.0.0-dev";
136
+ var VERSION = true ? "0.7.0" : "0.0.0-dev";
137
137
 
138
138
  // src/userAgent.ts
139
139
  function composeUserAgent() {
@@ -1260,8 +1260,9 @@ var ProfilesResource = class extends Resource {
1260
1260
  requestOptions
1261
1261
  });
1262
1262
  }
1263
+ /** Returns the updated profile, as all three item routes do. */
1263
1264
  async deleteItem(profileId, itemId, requestOptions) {
1264
- await this.transport.request(
1265
+ return await this.transport.request(
1265
1266
  "DELETE",
1266
1267
  `/profiles/${profileId}/items/${itemId}`,
1267
1268
  { requestOptions }
@@ -1387,6 +1388,11 @@ var SweepsResource = class extends Resource {
1387
1388
 
1388
1389
  // src/resources/testing.ts
1389
1390
  var RUN_TERMINAL_STATUSES3 = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
1391
+ function isRunSettled(run) {
1392
+ if (run.status === void 0 || !RUN_TERMINAL_STATUSES3.has(run.status)) return false;
1393
+ if (run.status !== "completed") return true;
1394
+ return run.outcome != null && run.outcome !== "pending";
1395
+ }
1390
1396
  var TestingConfigsResource = class extends Resource {
1391
1397
  async create(body, requestOptions) {
1392
1398
  return await this.transport.request("POST", "/testing/configs", { body, requestOptions });
@@ -1487,7 +1493,7 @@ var TestingRunsResource = class extends Resource {
1487
1493
  async waitForRun(runId, opts = {}) {
1488
1494
  return await waitFor({
1489
1495
  fetch: () => this.get(runId, opts.requestOptions),
1490
- isTerminal: (run) => run.status !== void 0 && RUN_TERMINAL_STATUSES3.has(run.status),
1496
+ isTerminal: isRunSettled,
1491
1497
  timeout: opts.timeout,
1492
1498
  initialInterval: opts.pollInterval,
1493
1499
  intervalCap: opts.intervalCap,