@proofline/sdk 5.5.0 → 5.5.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.
- package/dist/index.js +6 -2
- package/dist/transport.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -45,7 +45,7 @@ export class ProoflineClient extends Operations {
|
|
|
45
45
|
throw protocol("the review page has no typed collection metadata");
|
|
46
46
|
for (const item of page.items) {
|
|
47
47
|
if (count >= maxItems)
|
|
48
|
-
throw
|
|
48
|
+
throw paginationLimit("the review collection exceeds maxItems");
|
|
49
49
|
count += 1;
|
|
50
50
|
yield item;
|
|
51
51
|
}
|
|
@@ -61,7 +61,7 @@ export class ProoflineClient extends Operations {
|
|
|
61
61
|
seen.add(page.next_cursor);
|
|
62
62
|
cursor = page.next_cursor;
|
|
63
63
|
}
|
|
64
|
-
throw
|
|
64
|
+
throw paginationLimit("the review collection exceeds maxPages");
|
|
65
65
|
}
|
|
66
66
|
async waitForReview(orgId, reviewId, options = {}) {
|
|
67
67
|
const timeout = options.timeoutMs ?? 20 * 60_000;
|
|
@@ -106,6 +106,10 @@ import { ProoflineError } from "./transport.js";
|
|
|
106
106
|
function protocol(detail) {
|
|
107
107
|
return new ProoflineError(0, "urn:proofline:sdk:invalid-response", detail);
|
|
108
108
|
}
|
|
109
|
+
// A caller's bound, not a server fault: the collection continues past it.
|
|
110
|
+
function paginationLimit(detail) {
|
|
111
|
+
return new ProoflineError(0, "urn:proofline:sdk:pagination-limit", detail);
|
|
112
|
+
}
|
|
109
113
|
function integerLimit(value, name) {
|
|
110
114
|
if (!Number.isSafeInteger(value) || value <= 0)
|
|
111
115
|
throw new TypeError(`${name} must be a positive integer`);
|
package/dist/transport.js
CHANGED