@startinblox/core 2.0.1 → 2.0.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
@@ -2,7 +2,7 @@ var __defProp = Object.defineProperty;
2
2
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
3
  var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
4
  var _a2;
5
- import { g as getDefaultExportFromCjs, s as store, b as base_context, f as formatAttributesToServerPaginationOptions, m as mergeServerSearchOptions, a as formatAttributesToServerSearchOptions, c as commonjsGlobal } from "./store-1t_BHzwg.js";
5
+ import { g as getDefaultExportFromCjs, s as store, b as base_context, f as formatAttributesToServerPaginationOptions, m as mergeServerSearchOptions, a as formatAttributesToServerSearchOptions, c as commonjsGlobal } from "./store-CJ6fs7JU.js";
6
6
  import { d as defineComponent, n as normalizeContext, u as uniqID, e as evalTemplateString, a as doesResourceContainList, c as compare, p as parseFieldsString, f as findClosingBracketMatchIndex, g as generalComparator, b as fuzzyCompare, h as asyncQuerySelector, i as importInlineCSS, j as importCSS, t as transformArrayToContainer, s as setDeepProperty } from "./helpers-4GFJ8HI8.js";
7
7
  import { k } from "./helpers-4GFJ8HI8.js";
8
8
  if (!("flat" in Array.prototype)) {
@@ -9598,7 +9598,7 @@ class Store {
9598
9598
  * @param id - id of the resource to update
9599
9599
  * @returns void
9600
9600
  */
9601
- async _updateResource(method, resource, id) {
9601
+ async _updateResource(method, resource, id, skipFetch = false) {
9602
9602
  if (!["POST", "PUT", "PATCH", "_LOCAL"].includes(method))
9603
9603
  throw new Error("Error: method not allowed");
9604
9604
  const context2 = await this.contextParser.parse([
@@ -9609,14 +9609,15 @@ class Store {
9609
9609
  return this._fetch(method, resource, id).then(async (response) => {
9610
9610
  var _a;
9611
9611
  if (response.ok) {
9612
- if (method !== "_LOCAL") {
9613
- this.clearCache(expandedId);
9614
- }
9615
- this.getData(expandedId, resource["@context"]).then(async () => {
9612
+ if (!skipFetch) {
9613
+ if (method !== "_LOCAL") {
9614
+ this.clearCache(expandedId);
9615
+ }
9616
+ await this.getData(expandedId, resource["@context"]);
9616
9617
  const nestedResources = await this.getNestedResources(resource, id);
9617
9618
  const resourcesToRefresh = this.subscriptionVirtualContainersIndex.get(expandedId) || [];
9618
9619
  const resourcesToNotify = this.subscriptionIndex.get(expandedId) || [];
9619
- return this.refreshResources([
9620
+ await this.refreshResources([
9620
9621
  ...nestedResources,
9621
9622
  ...resourcesToRefresh
9622
9623
  ]).then(
@@ -9626,7 +9627,7 @@ class Store {
9626
9627
  ...resourcesToNotify
9627
9628
  ])
9628
9629
  );
9629
- });
9630
+ }
9630
9631
  return ((_a = response.headers) == null ? void 0 : _a.get("Location")) || null;
9631
9632
  }
9632
9633
  throw response;
@@ -9721,8 +9722,8 @@ class Store {
9721
9722
  *
9722
9723
  * @returns id of the posted resource
9723
9724
  */
9724
- setLocalData(resource, id) {
9725
- return this._updateResource("_LOCAL", resource, id);
9725
+ setLocalData(resource, id, skipFetch = false) {
9726
+ return this._updateResource("_LOCAL", resource, id, skipFetch);
9726
9727
  }
9727
9728
  /**
9728
9729
  * Send a POST request to create a resource in a container
@@ -9731,8 +9732,8 @@ class Store {
9731
9732
  *
9732
9733
  * @returns id of the posted resource
9733
9734
  */
9734
- post(resource, id) {
9735
- return this._updateResource("POST", resource, id);
9735
+ post(resource, id, skipFetch = false) {
9736
+ return this._updateResource("POST", resource, id, skipFetch);
9736
9737
  }
9737
9738
  /**
9738
9739
  * Send a PUT request to edit a resource
@@ -9741,8 +9742,8 @@ class Store {
9741
9742
  *
9742
9743
  * @returns id of the edited resource
9743
9744
  */
9744
- put(resource, id) {
9745
- return this._updateResource("PUT", resource, id);
9745
+ put(resource, id, skipFetch = false) {
9746
+ return this._updateResource("PUT", resource, id, skipFetch);
9746
9747
  }
9747
9748
  /**
9748
9749
  * Send a PATCH request to edit a resource
@@ -9751,8 +9752,8 @@ class Store {
9751
9752
  *
9752
9753
  * @returns id of the edited resource
9753
9754
  */
9754
- patch(resource, id) {
9755
- return this._updateResource("PATCH", resource, id);
9755
+ patch(resource, id, skipFetch = false) {
9756
+ return this._updateResource("PATCH", resource, id, skipFetch);
9756
9757
  }
9757
9758
  /**
9758
9759
  * Send a DELETE request to delete a resource
package/dist/store.js CHANGED
@@ -1,4 +1,4 @@
1
- import { b, s } from "./store-1t_BHzwg.js";
1
+ import { b, s } from "./store-CJ6fs7JU.js";
2
2
  export {
3
3
  b as baseContext,
4
4
  s as store
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@startinblox/core",
3
- "version": "2.0.1",
3
+ "version": "2.0.2",
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",