@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/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.6.0" : "0.0.0-dev";
|
|
95
95
|
|
|
96
96
|
// src/userAgent.ts
|
|
97
97
|
function composeUserAgent() {
|
|
@@ -449,7 +449,13 @@ var AudioResource = class extends Resource {
|
|
|
449
449
|
const resolvedName = input.name ?? inferredName ?? "upload.bin";
|
|
450
450
|
const resolvedType = input.contentType ?? sniffContentType(resolvedName);
|
|
451
451
|
const presign = await this.createUploadUrl(
|
|
452
|
-
{
|
|
452
|
+
{
|
|
453
|
+
filename: resolvedName,
|
|
454
|
+
contentType: resolvedType,
|
|
455
|
+
category: input.category,
|
|
456
|
+
...input.associatedId && { associatedId: input.associatedId },
|
|
457
|
+
sizeBytes: bytes.byteLength
|
|
458
|
+
},
|
|
453
459
|
requestOptions
|
|
454
460
|
);
|
|
455
461
|
await s3Put(presign.uploadUrl, bytes, {
|
|
@@ -574,6 +580,62 @@ var BatchesResource = class extends Resource {
|
|
|
574
580
|
}
|
|
575
581
|
};
|
|
576
582
|
|
|
583
|
+
// src/resources/compliance.ts
|
|
584
|
+
function encodePhone(phoneNumber) {
|
|
585
|
+
return encodeURIComponent(phoneNumber);
|
|
586
|
+
}
|
|
587
|
+
var ComplianceResource = class extends Resource {
|
|
588
|
+
async getCatalogue(params = {}, requestOptions) {
|
|
589
|
+
return await this.transport.request("GET", "/testing/compliance-catalogue", { params, requestOptions });
|
|
590
|
+
}
|
|
591
|
+
// Atomic batch dispatch. Server enforces compliancePickerLimits[tier] on
|
|
592
|
+
// testIds.length and returns 402 with code='BATCH_SIZE_EXCEEDS_TIER' on
|
|
593
|
+
// overflow. Surfaces as a typed NopaqueAPIError with code preserved.
|
|
594
|
+
async run(body, requestOptions) {
|
|
595
|
+
return await this.transport.request("POST", "/testing/compliance-runs", { body, requestOptions });
|
|
596
|
+
}
|
|
597
|
+
listReports(params = {}, requestOptions) {
|
|
598
|
+
return new Paginator({
|
|
599
|
+
fetchPage: async (p) => await this.transport.request("GET", "/testing/compliance-reports", { params: p, requestOptions }),
|
|
600
|
+
params: { ...params }
|
|
601
|
+
});
|
|
602
|
+
}
|
|
603
|
+
async listReportsPage(params = {}, requestOptions) {
|
|
604
|
+
const raw = await this.transport.request("GET", "/testing/compliance-reports", { params, requestOptions });
|
|
605
|
+
return new Page(raw.items, raw.nextToken);
|
|
606
|
+
}
|
|
607
|
+
async getReport(phoneNumber, requestOptions) {
|
|
608
|
+
return await this.transport.request(
|
|
609
|
+
"GET",
|
|
610
|
+
`/testing/compliance-reports/${encodePhone(phoneNumber)}`,
|
|
611
|
+
{ requestOptions }
|
|
612
|
+
);
|
|
613
|
+
}
|
|
614
|
+
// Returns the presigned S3 URL the platform uploaded the PDF to. The 1 hour
|
|
615
|
+
// expiry is baked into the URL itself; the response body is `{ url }` only.
|
|
616
|
+
async generatePdfUrl(phoneNumber, body = {}, requestOptions) {
|
|
617
|
+
return await this.transport.request(
|
|
618
|
+
"POST",
|
|
619
|
+
`/testing/compliance-reports/${encodePhone(phoneNumber)}/pdf`,
|
|
620
|
+
{ body, requestOptions }
|
|
621
|
+
);
|
|
622
|
+
}
|
|
623
|
+
// Convenience: get the URL, then fetch the bytes. For applications that
|
|
624
|
+
// already have an HTTP client, prefer generatePdfUrl() and fetch the URL
|
|
625
|
+
// with that client instead.
|
|
626
|
+
async downloadReportPdf(phoneNumber, body = {}, requestOptions) {
|
|
627
|
+
const { url } = await this.generatePdfUrl(phoneNumber, body, requestOptions);
|
|
628
|
+
const response = await this.transport.config.fetch(url);
|
|
629
|
+
if (!response.ok) {
|
|
630
|
+
throw new Error(`Failed to download PDF: ${response.status} ${response.statusText}`);
|
|
631
|
+
}
|
|
632
|
+
return new Uint8Array(await response.arrayBuffer());
|
|
633
|
+
}
|
|
634
|
+
async rerun(runId, requestOptions) {
|
|
635
|
+
return await this.transport.request("POST", `/testing/compliance-runs/${runId}/rerun`, { requestOptions });
|
|
636
|
+
}
|
|
637
|
+
};
|
|
638
|
+
|
|
577
639
|
// src/resources/datasets.ts
|
|
578
640
|
var DatasetsResource = class extends Resource {
|
|
579
641
|
async create(body, requestOptions) {
|
|
@@ -606,6 +668,207 @@ var DatasetsResource = class extends Resource {
|
|
|
606
668
|
}
|
|
607
669
|
};
|
|
608
670
|
|
|
671
|
+
// src/resources/digitalCompliance.ts
|
|
672
|
+
var DigitalComplianceResource = class extends Resource {
|
|
673
|
+
/**
|
|
674
|
+
* List digital compliance audits, one entry per target.
|
|
675
|
+
*
|
|
676
|
+
* @beta Access is limited to beta workspaces during the beta period.
|
|
677
|
+
*/
|
|
678
|
+
async listAudits(requestOptions) {
|
|
679
|
+
const raw = await this.transport.request(
|
|
680
|
+
"GET",
|
|
681
|
+
"/digital-testing/compliance-audits",
|
|
682
|
+
{ requestOptions }
|
|
683
|
+
);
|
|
684
|
+
return raw.audits ?? [];
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* Compliance report for one digital target.
|
|
688
|
+
*
|
|
689
|
+
* `targetRef` goes in the QUERY STRING, not the path: a targetRef contains
|
|
690
|
+
* slashes (`acme/billing-bot`) and a single path segment cannot hold one. The
|
|
691
|
+
* API made the same choice for the same reason.
|
|
692
|
+
*
|
|
693
|
+
* Pass `{ sector }` to restrict the catalogue to tests applicable to that sector.
|
|
694
|
+
*
|
|
695
|
+
* @beta Access is limited to beta workspaces during the beta period.
|
|
696
|
+
*/
|
|
697
|
+
async getReport(targetRef, params = {}, requestOptions) {
|
|
698
|
+
return await this.transport.request("GET", "/digital-testing/compliance-audits/report", {
|
|
699
|
+
params: { targetRef, ...params },
|
|
700
|
+
requestOptions
|
|
701
|
+
});
|
|
702
|
+
}
|
|
703
|
+
};
|
|
704
|
+
|
|
705
|
+
// src/resources/digitalTestConfigs.ts
|
|
706
|
+
var DigitalTestConfigsResource = class extends Resource {
|
|
707
|
+
/** @beta Access is limited to beta workspaces during the beta period. */
|
|
708
|
+
list(params = {}, requestOptions) {
|
|
709
|
+
return new Paginator({
|
|
710
|
+
fetchPage: async (p) => {
|
|
711
|
+
const { nextToken, cursor, ...rest } = p;
|
|
712
|
+
const raw = await this.transport.request(
|
|
713
|
+
"GET",
|
|
714
|
+
"/digital-testing/configs",
|
|
715
|
+
{
|
|
716
|
+
// `nextToken` first: the Paginator advances by writing it, and a
|
|
717
|
+
// caller-supplied `cursor` would otherwise pin every page to page one.
|
|
718
|
+
params: { ...rest, cursor: nextToken ?? cursor },
|
|
719
|
+
requestOptions
|
|
720
|
+
}
|
|
721
|
+
);
|
|
722
|
+
return {
|
|
723
|
+
items: raw.configs ?? raw.items ?? [],
|
|
724
|
+
nextToken: raw.nextCursor ?? raw.nextToken ?? null
|
|
725
|
+
};
|
|
726
|
+
},
|
|
727
|
+
params: { ...params }
|
|
728
|
+
});
|
|
729
|
+
}
|
|
730
|
+
/** @beta Access is limited to beta workspaces during the beta period. */
|
|
731
|
+
async listPage(params = {}, requestOptions) {
|
|
732
|
+
const { nextToken, cursor, ...rest } = params;
|
|
733
|
+
const raw = await this.transport.request("GET", "/digital-testing/configs", {
|
|
734
|
+
params: { ...rest, cursor: nextToken ?? cursor },
|
|
735
|
+
requestOptions
|
|
736
|
+
});
|
|
737
|
+
return new Page(raw.configs ?? raw.items ?? [], raw.nextCursor ?? raw.nextToken ?? null);
|
|
738
|
+
}
|
|
739
|
+
/**
|
|
740
|
+
* Save a digital test config. Per-kind rules are enforced at SAVE time, so a
|
|
741
|
+
* config that could never run is rejected with 400 rather than stored.
|
|
742
|
+
*
|
|
743
|
+
* @beta Access is limited to beta workspaces during the beta period.
|
|
744
|
+
*/
|
|
745
|
+
async create(body, requestOptions) {
|
|
746
|
+
return await this.transport.request("POST", "/digital-testing/configs", {
|
|
747
|
+
body,
|
|
748
|
+
requestOptions
|
|
749
|
+
});
|
|
750
|
+
}
|
|
751
|
+
/** @beta Access is limited to beta workspaces during the beta period. */
|
|
752
|
+
async get(configId, requestOptions) {
|
|
753
|
+
return await this.transport.request("GET", `/digital-testing/configs/${configId}`, {
|
|
754
|
+
requestOptions
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
/** @beta Access is limited to beta workspaces during the beta period. */
|
|
758
|
+
async update(configId, body, requestOptions) {
|
|
759
|
+
return await this.transport.request("PATCH", `/digital-testing/configs/${configId}`, {
|
|
760
|
+
body,
|
|
761
|
+
requestOptions
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
/** @beta Access is limited to beta workspaces during the beta period. */
|
|
765
|
+
async delete(configId, requestOptions) {
|
|
766
|
+
await this.transport.request("DELETE", `/digital-testing/configs/${configId}`, {
|
|
767
|
+
requestOptions
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
/**
|
|
771
|
+
* Launch a run from a saved config. `target` and `targetRef` must be
|
|
772
|
+
* overridden together — a half-override is a 400.
|
|
773
|
+
*
|
|
774
|
+
* @beta Access is limited to beta workspaces during the beta period.
|
|
775
|
+
*/
|
|
776
|
+
async launch(configId, body = {}, requestOptions) {
|
|
777
|
+
const raw = await this.transport.request("POST", `/digital-testing/configs/${configId}/runs`, { body, requestOptions });
|
|
778
|
+
return raw.run ?? raw;
|
|
779
|
+
}
|
|
780
|
+
};
|
|
781
|
+
|
|
782
|
+
// src/resources/digitalTesting.ts
|
|
783
|
+
var TERMINAL = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
|
|
784
|
+
var DigitalTestingResource = class extends Resource {
|
|
785
|
+
/**
|
|
786
|
+
* Queue a digital test run.
|
|
787
|
+
*
|
|
788
|
+
* @beta Access is limited to beta workspaces during the beta period.
|
|
789
|
+
*/
|
|
790
|
+
async create(body, requestOptions) {
|
|
791
|
+
const raw = await this.transport.request("POST", "/digital-testing/runs", { body, requestOptions });
|
|
792
|
+
return raw.run ?? raw;
|
|
793
|
+
}
|
|
794
|
+
/**
|
|
795
|
+
* Paginated list of digital test runs, newest first.
|
|
796
|
+
*
|
|
797
|
+
* @beta Access is limited to beta workspaces during the beta period.
|
|
798
|
+
*/
|
|
799
|
+
list(params = {}, requestOptions) {
|
|
800
|
+
return new Paginator({
|
|
801
|
+
fetchPage: async (p) => {
|
|
802
|
+
const { nextToken, cursor, ...rest } = p;
|
|
803
|
+
const raw = await this.transport.request("GET", "/digital-testing/runs", {
|
|
804
|
+
// `nextToken` first: the Paginator advances by writing it, and a
|
|
805
|
+
// caller-supplied `cursor` would otherwise pin every page to page one.
|
|
806
|
+
params: { ...rest, cursor: nextToken ?? cursor },
|
|
807
|
+
requestOptions
|
|
808
|
+
});
|
|
809
|
+
return {
|
|
810
|
+
items: raw.runs ?? raw.items ?? [],
|
|
811
|
+
nextToken: raw.nextCursor ?? raw.nextToken ?? null
|
|
812
|
+
};
|
|
813
|
+
},
|
|
814
|
+
params: { ...params }
|
|
815
|
+
});
|
|
816
|
+
}
|
|
817
|
+
/**
|
|
818
|
+
* One page of digital test runs.
|
|
819
|
+
*
|
|
820
|
+
* @beta Access is limited to beta workspaces during the beta period.
|
|
821
|
+
*/
|
|
822
|
+
async listPage(params = {}, requestOptions) {
|
|
823
|
+
const { nextToken, cursor, ...rest } = params;
|
|
824
|
+
const raw = await this.transport.request("GET", "/digital-testing/runs", {
|
|
825
|
+
params: { ...rest, cursor: nextToken ?? cursor },
|
|
826
|
+
requestOptions
|
|
827
|
+
});
|
|
828
|
+
return new Page(raw.runs ?? raw.items ?? [], raw.nextCursor ?? raw.nextToken ?? null);
|
|
829
|
+
}
|
|
830
|
+
/**
|
|
831
|
+
* Get one digital test run.
|
|
832
|
+
*
|
|
833
|
+
* @beta Access is limited to beta workspaces during the beta period.
|
|
834
|
+
*/
|
|
835
|
+
async get(runId, requestOptions) {
|
|
836
|
+
return await this.transport.request("GET", `/digital-testing/runs/${runId}`, {
|
|
837
|
+
requestOptions
|
|
838
|
+
});
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* Cancel a digital test run.
|
|
842
|
+
*
|
|
843
|
+
* @beta Access is limited to beta workspaces during the beta period.
|
|
844
|
+
*/
|
|
845
|
+
async cancel(runId, requestOptions) {
|
|
846
|
+
return await this.transport.request("POST", `/digital-testing/runs/${runId}/cancel`, {
|
|
847
|
+
requestOptions
|
|
848
|
+
});
|
|
849
|
+
}
|
|
850
|
+
/**
|
|
851
|
+
* Poll until the run reaches a terminal state.
|
|
852
|
+
*
|
|
853
|
+
* Resolves on `completed`, `failed` and `cancelled` alike and returns the run.
|
|
854
|
+
* A bot that behaved badly is `completed` with `outcome: 'fail'`, which is a
|
|
855
|
+
* RESULT, not an error — this never throws on it. `failed` means the test could
|
|
856
|
+
* not be delivered.
|
|
857
|
+
*
|
|
858
|
+
* @beta Access is limited to beta workspaces during the beta period.
|
|
859
|
+
*/
|
|
860
|
+
async waitForRun(runId, opts = {}) {
|
|
861
|
+
return await waitFor({
|
|
862
|
+
fetch: () => this.get(runId, opts.requestOptions),
|
|
863
|
+
isTerminal: (r) => TERMINAL.has(r.status),
|
|
864
|
+
timeout: opts.timeout,
|
|
865
|
+
initialInterval: opts.pollInterval,
|
|
866
|
+
intervalCap: opts.intervalCap,
|
|
867
|
+
onUpdate: opts.onUpdate
|
|
868
|
+
});
|
|
869
|
+
}
|
|
870
|
+
};
|
|
871
|
+
|
|
609
872
|
// src/resources/enrichment.ts
|
|
610
873
|
var EnrichmentResource = class extends Resource {
|
|
611
874
|
async get(jobId, runId, type, requestOptions) {
|
|
@@ -720,17 +983,24 @@ var TERMINAL_STATUSES2 = /* @__PURE__ */ new Set(["completed", "failed", "limite
|
|
|
720
983
|
var MappingResource = class extends Resource {
|
|
721
984
|
list(params = {}, requestOptions) {
|
|
722
985
|
return new Paginator({
|
|
723
|
-
fetchPage: async (p) =>
|
|
986
|
+
fetchPage: async (p) => {
|
|
987
|
+
const { nextToken, cursor, ...rest } = p;
|
|
988
|
+
const raw = await this.transport.request("GET", "/mapping", {
|
|
989
|
+
params: { ...rest, cursor: cursor ?? nextToken },
|
|
990
|
+
requestOptions
|
|
991
|
+
});
|
|
992
|
+
return { items: raw.items ?? [], nextToken: raw.nextCursor ?? raw.nextToken ?? null };
|
|
993
|
+
},
|
|
724
994
|
params: { ...params }
|
|
725
995
|
});
|
|
726
996
|
}
|
|
727
997
|
async listPage(params = {}, requestOptions) {
|
|
728
|
-
const
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
);
|
|
733
|
-
return new Page(raw.items, raw.nextToken);
|
|
998
|
+
const { nextToken, cursor, ...rest } = params;
|
|
999
|
+
const raw = await this.transport.request("GET", "/mapping", {
|
|
1000
|
+
params: { ...rest, cursor: cursor ?? nextToken },
|
|
1001
|
+
requestOptions
|
|
1002
|
+
});
|
|
1003
|
+
return new Page(raw.items ?? [], raw.nextCursor ?? raw.nextToken ?? null);
|
|
734
1004
|
}
|
|
735
1005
|
async get(jobId, requestOptions) {
|
|
736
1006
|
return await this.transport.request("GET", `/mapping/${jobId}`, { requestOptions });
|
|
@@ -756,6 +1026,16 @@ var MappingResource = class extends Resource {
|
|
|
756
1026
|
requestOptions
|
|
757
1027
|
});
|
|
758
1028
|
}
|
|
1029
|
+
// Trigger on-demand security-probe analysis on a completed mapping run.
|
|
1030
|
+
// Returns the queue summary { message, probeCount }; poll the run / steps
|
|
1031
|
+
// afterwards to see classified results land.
|
|
1032
|
+
async probe(jobId, runId, requestOptions) {
|
|
1033
|
+
return await this.transport.request(
|
|
1034
|
+
"POST",
|
|
1035
|
+
`/mapping/${jobId}/runs/${runId}/probe`,
|
|
1036
|
+
{ requestOptions }
|
|
1037
|
+
);
|
|
1038
|
+
}
|
|
759
1039
|
steps(jobId, params = {}, requestOptions) {
|
|
760
1040
|
return new Paginator({
|
|
761
1041
|
fetchPage: async (p) => await this.transport.request("GET", `/mapping/${jobId}/steps`, {
|
|
@@ -812,13 +1092,6 @@ var MappingResource = class extends Resource {
|
|
|
812
1092
|
{ requestOptions }
|
|
813
1093
|
);
|
|
814
1094
|
}
|
|
815
|
-
async probe(jobId, runId, body = {}, requestOptions) {
|
|
816
|
-
return await this.transport.request(
|
|
817
|
-
"POST",
|
|
818
|
-
`/mapping/${jobId}/runs/${runId}/probe`,
|
|
819
|
-
{ body, requestOptions }
|
|
820
|
-
);
|
|
821
|
-
}
|
|
822
1095
|
async waitForComplete(jobId, opts = {}) {
|
|
823
1096
|
return await waitFor({
|
|
824
1097
|
fetch: () => this.get(jobId, opts.requestOptions),
|
|
@@ -831,6 +1104,83 @@ var MappingResource = class extends Resource {
|
|
|
831
1104
|
}
|
|
832
1105
|
};
|
|
833
1106
|
|
|
1107
|
+
// src/resources/missionTestConfigs.ts
|
|
1108
|
+
var MissionTestConfigsResource = class extends Resource {
|
|
1109
|
+
list(params = {}, requestOptions) {
|
|
1110
|
+
return new Paginator({
|
|
1111
|
+
fetchPage: async (p) => {
|
|
1112
|
+
const { nextToken, cursor, ...rest } = p;
|
|
1113
|
+
const raw = await this.transport.request("GET", "/testing/mission-test-configs", {
|
|
1114
|
+
params: { ...rest, cursor: cursor ?? nextToken },
|
|
1115
|
+
requestOptions
|
|
1116
|
+
});
|
|
1117
|
+
return { items: raw.items ?? [], nextToken: raw.nextCursor ?? raw.nextToken ?? null };
|
|
1118
|
+
},
|
|
1119
|
+
params: { ...params }
|
|
1120
|
+
});
|
|
1121
|
+
}
|
|
1122
|
+
async listPage(params = {}, requestOptions) {
|
|
1123
|
+
const { nextToken, cursor, ...rest } = params;
|
|
1124
|
+
const raw = await this.transport.request("GET", "/testing/mission-test-configs", {
|
|
1125
|
+
params: { ...rest, cursor: cursor ?? nextToken },
|
|
1126
|
+
requestOptions
|
|
1127
|
+
});
|
|
1128
|
+
return new Page(raw.items ?? [], raw.nextCursor ?? raw.nextToken ?? null);
|
|
1129
|
+
}
|
|
1130
|
+
async create(body, requestOptions) {
|
|
1131
|
+
return await this.transport.request("POST", "/testing/mission-test-configs", { body, requestOptions });
|
|
1132
|
+
}
|
|
1133
|
+
async get(id, requestOptions) {
|
|
1134
|
+
return await this.transport.request("GET", `/testing/mission-test-configs/${id}`, { requestOptions });
|
|
1135
|
+
}
|
|
1136
|
+
async update(id, body, requestOptions) {
|
|
1137
|
+
return await this.transport.request("PATCH", `/testing/mission-test-configs/${id}`, {
|
|
1138
|
+
body,
|
|
1139
|
+
requestOptions
|
|
1140
|
+
});
|
|
1141
|
+
}
|
|
1142
|
+
async delete(id, requestOptions) {
|
|
1143
|
+
await this.transport.request("DELETE", `/testing/mission-test-configs/${id}`, { requestOptions });
|
|
1144
|
+
}
|
|
1145
|
+
// Launch a mission test run from a saved config. The returned run is freeform-shaped.
|
|
1146
|
+
async run(id, requestOptions) {
|
|
1147
|
+
return await this.transport.request("POST", `/testing/mission-test-configs/${id}/runs`, { requestOptions });
|
|
1148
|
+
}
|
|
1149
|
+
};
|
|
1150
|
+
|
|
1151
|
+
// src/resources/missionTests.ts
|
|
1152
|
+
var MissionTestsResource = class extends Resource {
|
|
1153
|
+
list(params = {}, requestOptions) {
|
|
1154
|
+
return new Paginator({
|
|
1155
|
+
fetchPage: async (p) => await this.transport.request("GET", "/testing/mission-tests", { params: p, requestOptions }),
|
|
1156
|
+
params: { ...params }
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
1159
|
+
async listPage(params = {}, requestOptions) {
|
|
1160
|
+
const raw = await this.transport.request(
|
|
1161
|
+
"GET",
|
|
1162
|
+
"/testing/mission-tests",
|
|
1163
|
+
{ params, requestOptions }
|
|
1164
|
+
);
|
|
1165
|
+
return new Page(raw.items, raw.nextToken);
|
|
1166
|
+
}
|
|
1167
|
+
async create(body, requestOptions) {
|
|
1168
|
+
return await this.transport.request("POST", "/testing/mission-tests", { body, requestOptions });
|
|
1169
|
+
}
|
|
1170
|
+
// Returns 503 with code='CATALOG_NOT_READY' until the mission-tester service
|
|
1171
|
+
// publishes its SSM payload. Callers can catch and retry, or fall back to a
|
|
1172
|
+
// known-good default sector/mission/acceptance.
|
|
1173
|
+
async getDefaults(requestOptions) {
|
|
1174
|
+
return await this.transport.request("GET", "/testing/mission-tests/defaults", { requestOptions });
|
|
1175
|
+
}
|
|
1176
|
+
async get(id, requestOptions) {
|
|
1177
|
+
return await this.transport.request("GET", `/testing/mission-tests/${id}`, { requestOptions });
|
|
1178
|
+
}
|
|
1179
|
+
async cancel(id, requestOptions) {
|
|
1180
|
+
return await this.transport.request("POST", `/testing/mission-tests/${id}/cancel`, { requestOptions });
|
|
1181
|
+
}
|
|
1182
|
+
};
|
|
1183
|
+
|
|
834
1184
|
// src/resources/profiles.ts
|
|
835
1185
|
var ProfilesResource = class extends Resource {
|
|
836
1186
|
async create(body, requestOptions) {
|
|
@@ -868,8 +1218,9 @@ var ProfilesResource = class extends Resource {
|
|
|
868
1218
|
requestOptions
|
|
869
1219
|
});
|
|
870
1220
|
}
|
|
1221
|
+
/** Returns the updated profile, as all three item routes do. */
|
|
871
1222
|
async deleteItem(profileId, itemId, requestOptions) {
|
|
872
|
-
await this.transport.request(
|
|
1223
|
+
return await this.transport.request(
|
|
873
1224
|
"DELETE",
|
|
874
1225
|
`/profiles/${profileId}/items/${itemId}`,
|
|
875
1226
|
{ requestOptions }
|
|
@@ -1061,15 +1412,33 @@ var TestingRunsResource = class extends Resource {
|
|
|
1061
1412
|
list(params = {}, requestOptions) {
|
|
1062
1413
|
return new Paginator({
|
|
1063
1414
|
fetchPage: async (p) => {
|
|
1064
|
-
const
|
|
1065
|
-
|
|
1415
|
+
const { nextToken, cursor, ...rest } = p;
|
|
1416
|
+
const raw = await this.transport.request("GET", "/testing/runs", {
|
|
1417
|
+
params: { ...rest, cursor: cursor ?? nextToken },
|
|
1418
|
+
requestOptions
|
|
1419
|
+
});
|
|
1420
|
+
return {
|
|
1421
|
+
items: raw.runs ?? raw.items ?? [],
|
|
1422
|
+
nextToken: raw.nextCursor ?? raw.nextToken ?? null
|
|
1423
|
+
};
|
|
1066
1424
|
},
|
|
1067
1425
|
params: { ...params }
|
|
1068
1426
|
});
|
|
1069
1427
|
}
|
|
1070
1428
|
async listPage(params = {}, requestOptions) {
|
|
1071
|
-
const
|
|
1072
|
-
|
|
1429
|
+
const { nextToken, cursor, ...rest } = params;
|
|
1430
|
+
const raw = await this.transport.request("GET", "/testing/runs", {
|
|
1431
|
+
params: { ...rest, cursor: cursor ?? nextToken },
|
|
1432
|
+
requestOptions
|
|
1433
|
+
});
|
|
1434
|
+
return new Page(raw.runs ?? raw.items ?? [], raw.nextCursor ?? raw.nextToken ?? null);
|
|
1435
|
+
}
|
|
1436
|
+
/** GET /testing/runs/aggregate — grouped counts over test runs. */
|
|
1437
|
+
async aggregate(params, requestOptions) {
|
|
1438
|
+
return await this.transport.request("GET", "/testing/runs/aggregate", {
|
|
1439
|
+
params,
|
|
1440
|
+
requestOptions
|
|
1441
|
+
});
|
|
1073
1442
|
}
|
|
1074
1443
|
async get(runId, requestOptions) {
|
|
1075
1444
|
return await this.transport.request("GET", `/testing/runs/${runId}`, { requestOptions });
|
|
@@ -1095,6 +1464,24 @@ var TestingResource = class extends Resource {
|
|
|
1095
1464
|
this.jobs = new TestingJobsResource(transport);
|
|
1096
1465
|
this.runs = new TestingRunsResource(transport);
|
|
1097
1466
|
}
|
|
1467
|
+
/** Paginated, filtered list of test runs (alias for `testing.runs.list()`). */
|
|
1468
|
+
listRuns(params = {}, requestOptions) {
|
|
1469
|
+
return this.runs.list(params, requestOptions);
|
|
1470
|
+
}
|
|
1471
|
+
/** GET /testing/voices — operator-enabled voices a mission test may use. */
|
|
1472
|
+
async listVoices(requestOptions) {
|
|
1473
|
+
return await this.transport.request("GET", "/testing/voices", { requestOptions });
|
|
1474
|
+
}
|
|
1475
|
+
/** GET /testing/runs/aggregate — grouped counts over test runs. */
|
|
1476
|
+
async aggregateRuns(params, requestOptions) {
|
|
1477
|
+
return await this.runs.aggregate(params, requestOptions);
|
|
1478
|
+
}
|
|
1479
|
+
/** GET /testing/mission-test-runs/{id} — mission-strict run detail (no steps). */
|
|
1480
|
+
async getMissionTestRun(id, requestOptions) {
|
|
1481
|
+
return await this.transport.request("GET", `/testing/mission-test-runs/${id}`, {
|
|
1482
|
+
requestOptions
|
|
1483
|
+
});
|
|
1484
|
+
}
|
|
1098
1485
|
};
|
|
1099
1486
|
|
|
1100
1487
|
// src/client.ts
|
|
@@ -1109,6 +1496,12 @@ var Nopaque = class {
|
|
|
1109
1496
|
loadTesting;
|
|
1110
1497
|
scheduler;
|
|
1111
1498
|
enrichment;
|
|
1499
|
+
missionTests;
|
|
1500
|
+
missionTestConfigs;
|
|
1501
|
+
compliance;
|
|
1502
|
+
digitalTesting;
|
|
1503
|
+
digitalTestConfigs;
|
|
1504
|
+
digitalCompliance;
|
|
1112
1505
|
transport;
|
|
1113
1506
|
constructor(options = {}) {
|
|
1114
1507
|
const config = resolveConfig(options);
|
|
@@ -1123,6 +1516,12 @@ var Nopaque = class {
|
|
|
1123
1516
|
this.loadTesting = new LoadTestingResource(this.transport);
|
|
1124
1517
|
this.scheduler = new SchedulerResource(this.transport);
|
|
1125
1518
|
this.enrichment = new EnrichmentResource(this.transport);
|
|
1519
|
+
this.missionTests = new MissionTestsResource(this.transport);
|
|
1520
|
+
this.missionTestConfigs = new MissionTestConfigsResource(this.transport);
|
|
1521
|
+
this.compliance = new ComplianceResource(this.transport);
|
|
1522
|
+
this.digitalTesting = new DigitalTestingResource(this.transport);
|
|
1523
|
+
this.digitalTestConfigs = new DigitalTestConfigsResource(this.transport);
|
|
1524
|
+
this.digitalCompliance = new DigitalComplianceResource(this.transport);
|
|
1126
1525
|
}
|
|
1127
1526
|
close() {
|
|
1128
1527
|
}
|