@startinblox/core 0.19.14 → 0.19.15-beta.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 +0 -33
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11397,10 +11397,6 @@ class Store {
|
|
|
11397
11397
|
if (options.headers)
|
|
11398
11398
|
options.headers = this._convertHeaders(options.headers);
|
|
11399
11399
|
return fetch(iri, options).then(function(response) {
|
|
11400
|
-
if (options.method === "PURGE" && !response.ok && response.status === 404) {
|
|
11401
|
-
const err = new Error("PURGE call is returning 404");
|
|
11402
|
-
throw err;
|
|
11403
|
-
}
|
|
11404
11400
|
return response;
|
|
11405
11401
|
});
|
|
11406
11402
|
}
|
|
@@ -11659,35 +11655,6 @@ class Store {
|
|
|
11659
11655
|
async patch(resource, id2) {
|
|
11660
11656
|
return this._updateResource("PATCH", resource, id2);
|
|
11661
11657
|
}
|
|
11662
|
-
/**
|
|
11663
|
-
* Send a PURGE request to remove a resource from REDIS AD cache
|
|
11664
|
-
* @param id - uri of the resource to patch
|
|
11665
|
-
*
|
|
11666
|
-
* @returns id of the edited resource
|
|
11667
|
-
*/
|
|
11668
|
-
async purge(id2) {
|
|
11669
|
-
await this.fetchAuthn(id2, {
|
|
11670
|
-
method: "PURGE",
|
|
11671
|
-
headers: this.headers
|
|
11672
|
-
}).catch(function(error2) {
|
|
11673
|
-
console.warn("No purge method allowed: " + error2);
|
|
11674
|
-
});
|
|
11675
|
-
try {
|
|
11676
|
-
const fullURL = new URL(id2);
|
|
11677
|
-
var pathArray = fullURL.pathname.split("/");
|
|
11678
|
-
var containerUrl = fullURL.origin + "/" + pathArray[1] + "/";
|
|
11679
|
-
const headers = { ...this.headers, "X-Cache-Purge-Match": "startswith" };
|
|
11680
|
-
await this.fetchAuthn(containerUrl, {
|
|
11681
|
-
method: "PURGE",
|
|
11682
|
-
headers
|
|
11683
|
-
}).catch(function(error2) {
|
|
11684
|
-
console.warn("No purge method allowed: " + error2);
|
|
11685
|
-
});
|
|
11686
|
-
} catch (error2) {
|
|
11687
|
-
console.warn("The resource ID is not a complete URL: " + error2);
|
|
11688
|
-
return;
|
|
11689
|
-
}
|
|
11690
|
-
}
|
|
11691
11658
|
/**
|
|
11692
11659
|
* Send a DELETE request to delete a resource
|
|
11693
11660
|
* @param id - uri of the resource to delete
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@startinblox/core",
|
|
3
|
-
"version": "0.19.
|
|
3
|
+
"version": "0.19.15-beta.1",
|
|
4
4
|
"description": "This is a series of web component respecting both the web components standards and the Linked Data Platform convention.",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|