@prismicio/client
Advanced tools
Comparing version 6.5.0 to 6.5.1
@@ -104,3 +104,2 @@ import * as prismicT from '@prismicio/types'; | ||
url?: string; | ||
query?: never; | ||
} | ||
@@ -115,3 +114,2 @@ /** | ||
query?: Record<string, unknown>; | ||
url?: never; | ||
}; | ||
@@ -118,0 +116,0 @@ /** |
@@ -430,9 +430,9 @@ import * as prismicH from '@prismicio/helpers'; | ||
} else if (this.refState.httpRequest) { | ||
if (this.refState.httpRequest.url) { | ||
if ("query" in this.refState.httpRequest) { | ||
documentID = documentID || ((_a = this.refState.httpRequest.query) == null ? void 0 : _a.documentId); | ||
previewToken = previewToken || ((_b = this.refState.httpRequest.query) == null ? void 0 : _b.token); | ||
} else if ("url" in this.refState.httpRequest && this.refState.httpRequest.url) { | ||
const searchParams = new URL(this.refState.httpRequest.url).searchParams; | ||
documentID = documentID || searchParams.get("documentId"); | ||
previewToken = previewToken || searchParams.get("token"); | ||
} else { | ||
documentID = documentID || ((_a = this.refState.httpRequest.query) == null ? void 0 : _a.documentId); | ||
previewToken = previewToken || ((_b = this.refState.httpRequest.query) == null ? void 0 : _b.token); | ||
} | ||
@@ -439,0 +439,0 @@ } |
{ | ||
"name": "@prismicio/client", | ||
"version": "6.5.0", | ||
"version": "6.5.1", | ||
"description": "The official JavaScript + TypeScript client library for Prismic", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -1219,3 +1219,11 @@ import * as prismicT from "@prismicio/types"; | ||
} else if (this.refState.httpRequest) { | ||
if (this.refState.httpRequest.url) { | ||
if ("query" in this.refState.httpRequest) { | ||
documentID = | ||
documentID || (this.refState.httpRequest.query?.documentId as string); | ||
previewToken = | ||
previewToken || (this.refState.httpRequest.query?.token as string); | ||
} else if ( | ||
"url" in this.refState.httpRequest && | ||
this.refState.httpRequest.url | ||
) { | ||
const searchParams = new URL(this.refState.httpRequest.url) | ||
@@ -1226,7 +1234,2 @@ .searchParams; | ||
previewToken = previewToken || searchParams.get("token"); | ||
} else { | ||
documentID = | ||
documentID || (this.refState.httpRequest.query?.documentId as string); | ||
previewToken = | ||
previewToken || (this.refState.httpRequest.query?.token as string); | ||
} | ||
@@ -1233,0 +1236,0 @@ } |
@@ -86,3 +86,2 @@ /** | ||
url?: string; | ||
query?: never; | ||
} | ||
@@ -98,3 +97,2 @@ | ||
query?: Record<string, unknown>; | ||
url?: never; | ||
}; | ||
@@ -101,0 +99,0 @@ |
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
418143
5060