Socket
Socket
Sign inDemoInstall

@prismicio/client

Package Overview
Dependencies
4
Maintainers
26
Versions
76
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 6.8.0 to 6.9.0

14

dist/client.js

@@ -27,2 +27,3 @@ var __defProp = Object.defineProperty;

const GET_ALL_QUERY_DELAY = 500;
const DEFUALT_RETRY_AFTER_MS = 1e3;
var RefStateMode;

@@ -420,2 +421,15 @@ (function(RefStateMode2) {

}
case 429: {
const parsedRetryAfter = Number(res.headers.get("retry-after"));
const delay = Number.isNaN(parsedRetryAfter) ? DEFUALT_RETRY_AFTER_MS : parsedRetryAfter;
return await new Promise((resolve, reject) => {
setTimeout(async () => {
try {
resolve(await this.fetch(url, params));
} catch (error) {
reject(error);
}
}, delay);
});
}
}

@@ -422,0 +436,0 @@ throw new PrismicError(void 0, url, json);

@@ -74,5 +74,12 @@ import * as prismicT from "@prismicio/types";

status: number;
headers: HeadersLike;
json(): Promise<any>;
}
/**
* The minimum required properties from Headers.
*/
export interface HeadersLike {
get(name: string): string | null;
}
/**
* The minimum required properties to treat as an HTTP Request for automatic

@@ -79,0 +86,0 @@ * Prismic preview support.

8

package.json
{
"name": "@prismicio/client",
"version": "6.8.0",
"version": "6.9.0",
"description": "The official JavaScript + TypeScript client library for Prismic",

@@ -42,5 +42,5 @@ "keywords": [

"prepare": "npm run build",
"release": "npm run build && npm run test && standard-version && git push --follow-tags && npm run build && npm publish",
"release:beta": "npm run build && npm run test && standard-version --release-as major --prerelease beta && git push --follow-tags && npm run build && npm publish --tag beta",
"release:beta:dry": "standard-version --release-as major --prerelease beta --dry-run",
"release": "npm run build && npm run test && standard-version && git push --follow-tags && npm run build && npm publish --tag latest-v6",
"release:beta": "npm run build && npm run test && standard-version --release-as major --prerelease beta-v6 && git push --follow-tags && npm run build && npm publish --tag beta-v6",
"release:beta:dry": "standard-version --release-as major --prerelease beta-v6 --dry-run",
"release:dry": "standard-version --dry-run",

@@ -47,0 +47,0 @@ "size": "size-limit",

@@ -53,2 +53,11 @@ import * as prismicT from "@prismicio/types";

/**
* The default number of milliseconds to wait before retrying a rate-limited
* `fetch()` request (429 response code). The default value is only used if the
* response does not include a `retry-after` header.
*
* The API allows up to 200 requests per second.
*/
const DEFUALT_RETRY_AFTER_MS = 1000;
/**
* Modes for client ref management.

@@ -1774,2 +1783,21 @@ */

}
// Too Many Requests
// - Exceeded the maximum number of requests per second
case 429: {
const parsedRetryAfter = Number(res.headers.get("retry-after"));
const delay = Number.isNaN(parsedRetryAfter)
? DEFUALT_RETRY_AFTER_MS
: parsedRetryAfter;
return await new Promise((resolve, reject) => {
setTimeout(async () => {
try {
resolve(await this.fetch(url, params));
} catch (error) {
reject(error);
}
}, delay);
});
}
}

@@ -1776,0 +1804,0 @@

@@ -104,2 +104,3 @@ import * as prismicT from "@prismicio/types";

status: number;
headers: HeadersLike;
// eslint-disable-next-line @typescript-eslint/no-explicit-any

@@ -110,2 +111,9 @@ json(): Promise<any>;

/**
* The minimum required properties from Headers.
*/
export interface HeadersLike {
get(name: string): string | null;
}
/**
* The minimum required properties to treat as an HTTP Request for automatic

@@ -112,0 +120,0 @@ * Prismic preview support.

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc