@canopy-io/node 0.24.0 → 0.25.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 +17 -0
- package/dist/index.cjs +9 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +307 -30
- package/dist/index.d.ts +307 -30
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @canopy-io/node
|
|
2
2
|
|
|
3
|
+
## 0.25.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- a7d473f: Follows Canopy's hosted page languages and safe retries release.
|
|
8
|
+
|
|
9
|
+
- `@canopy-io/node`: the generated types add `locale` to identities and invitations, `default_language` and `available_languages` to the sign-in settings, the branding `languages`, `default_language`, `page_template` and `page_template_sources`, and the `409` and `503` `Idempotency-Key` answers. A call declared `idempotent` is now also retried on `409 idempotency.request_in_progress`, the answer Canopy gives while an earlier attempt with the same `Idempotency-Key` is still running; `idempotency.outcome_unknown` is never retried.
|
|
10
|
+
- `@canopy-io/browser`: `signIn({ uiLocales })` names the language the hosted pages are shown in, sent as `ui_locales`.
|
|
11
|
+
|
|
12
|
+
The agent skill says how an application names the hosted pages' language, and how to make a create safe to retry with an `Idempotency-Key`.
|
|
13
|
+
|
|
14
|
+
## 0.24.1
|
|
15
|
+
|
|
16
|
+
### Patch Changes
|
|
17
|
+
|
|
18
|
+
- e895215: Follows Canopy's custom CSS release for hosted pages. The generated types add `custom_css` to the branding change and response, and to a web OAuth client's `branding`. The agent skill says what the CSS may name (the published `--hp-*` tokens and `hp-*` classes, `data-page` and `data-provider`), how to write the dark look, and what a save refuses. No caller changes are needed.
|
|
19
|
+
|
|
3
20
|
## 0.24.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
package/dist/index.cjs
CHANGED
|
@@ -111,6 +111,7 @@ var DEFAULT_TIMEOUT_MS = 3e4;
|
|
|
111
111
|
var DEFAULT_MAX_RETRIES = 2;
|
|
112
112
|
var DEFAULT_MAX_BACKOFF_MS = 3e4;
|
|
113
113
|
var IDEMPOTENT_METHODS = /* @__PURE__ */ new Set(["GET", "HEAD", "PUT", "DELETE"]);
|
|
114
|
+
var IDEMPOTENCY_IN_PROGRESS = "idempotency.request_in_progress";
|
|
114
115
|
var NOT_MODIFIED = 304;
|
|
115
116
|
var CanopyClient = class {
|
|
116
117
|
baseUrl;
|
|
@@ -216,6 +217,14 @@ var CanopyClient = class {
|
|
|
216
217
|
lastError = await this.toError(response, upper, path);
|
|
217
218
|
continue;
|
|
218
219
|
}
|
|
220
|
+
if (response.status === 409 && retryable && attempt < maxRetries) {
|
|
221
|
+
const conflict = await this.toError(response, upper, path);
|
|
222
|
+
if (conflict.code !== IDEMPOTENCY_IN_PROGRESS) {
|
|
223
|
+
throw conflict;
|
|
224
|
+
}
|
|
225
|
+
lastError = conflict;
|
|
226
|
+
continue;
|
|
227
|
+
}
|
|
219
228
|
if (!accept(response.status)) {
|
|
220
229
|
throw await this.toError(response, upper, path);
|
|
221
230
|
}
|