@canopy-io/node 0.23.0 → 0.23.2

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 CHANGED
@@ -580,11 +580,16 @@ var Identities = class {
580
580
  create(input) {
581
581
  return this.client.request("POST", "/api/v1/identities", { body: input });
582
582
  }
583
- update(id, input) {
583
+ /**
584
+ * Pass `ifMatch` with the identity's current `version` to make a
585
+ * read-modify-write safe: a concurrent edit answers 409 instead of being
586
+ * silently overwritten.
587
+ */
588
+ update(id, input, options = {}) {
584
589
  return this.client.request(
585
590
  "PATCH",
586
591
  `/api/v1/identities/${encodeURIComponent(id)}`,
587
- { body: input }
592
+ { body: input, ...withConcurrency(options) }
588
593
  );
589
594
  }
590
595
  /**
@@ -2221,7 +2226,7 @@ function authorizationErrorStatus(error) {
2221
2226
  message: "Authorization is misconfigured. Check the Canopy API key and its scopes."
2222
2227
  };
2223
2228
  }
2224
- if (error.statusCode === 404 && error.code === null) {
2229
+ if (error.statusCode === 404 && (error.code === null || error.code === "request.not_found")) {
2225
2230
  return {
2226
2231
  status: 500,
2227
2232
  message: `Authorization is misconfigured: ${error.request.method} ${error.request.path} is not served by this Canopy. The SDK requires an API that exposes the identity grants endpoint.`