@uniformdev/canvas 19.45.1 → 19.45.2-alpha.7

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.esm.js CHANGED
@@ -679,11 +679,84 @@ var unstable_CompositionRelationshipClient = class extends ApiClient3 {
679
679
  }
680
680
  };
681
681
 
682
- // src/DataSourceClient.ts
682
+ // src/ContentClient.ts
683
683
  import { ApiClient as ApiClient4 } from "@uniformdev/context/api";
684
+ var _contentTypesUrl, _entriesUrl;
685
+ var _ContentClient = class _ContentClient extends ApiClient4 {
686
+ constructor(options) {
687
+ var _a;
688
+ super(options);
689
+ this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
690
+ }
691
+ getContentTypes(options) {
692
+ const { projectId } = this.options;
693
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl), { ...options, projectId });
694
+ return this.apiClient(fetchUri);
695
+ }
696
+ getEntries(options) {
697
+ const { projectId } = this.options;
698
+ const { skipDataResolution, ...params } = options;
699
+ const fetchUri = skipDataResolution ? this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, projectId }) : this.createUrl(__privateGet(_ContentClient, _entriesUrl), this.getEdgeOptions(params), this.edgeApiHost);
700
+ return this.apiClient(fetchUri);
701
+ }
702
+ async upsertContentType(body) {
703
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
704
+ await this.apiClient(fetchUri, {
705
+ method: "PUT",
706
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
707
+ expectNoContent: true
708
+ });
709
+ }
710
+ async upsertEntry(body) {
711
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _entriesUrl));
712
+ await this.apiClient(fetchUri, {
713
+ method: "PUT",
714
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
715
+ expectNoContent: true
716
+ });
717
+ }
718
+ async deleteContentType(body) {
719
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
720
+ await this.apiClient(fetchUri, {
721
+ method: "DELETE",
722
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
723
+ expectNoContent: true
724
+ });
725
+ }
726
+ async deleteEntry(body) {
727
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _entriesUrl));
728
+ await this.apiClient(fetchUri, {
729
+ method: "DELETE",
730
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
731
+ expectNoContent: true
732
+ });
733
+ }
734
+ getEdgeOptions(options) {
735
+ const { projectId } = this.options;
736
+ const { skipDataResolution, ...params } = options;
737
+ return {
738
+ projectId,
739
+ ...params,
740
+ diagnostics: (options == null ? void 0 : options.diagnostics) ? "true" : void 0
741
+ };
742
+ }
743
+ };
744
+ _contentTypesUrl = new WeakMap();
745
+ _entriesUrl = new WeakMap();
746
+ __privateAdd(_ContentClient, _contentTypesUrl, "/api/v1/content-types");
747
+ __privateAdd(_ContentClient, _entriesUrl, "/api/v1/entries");
748
+ var ContentClient = _ContentClient;
749
+ var UncachedContentClient = class extends ContentClient {
750
+ constructor(options) {
751
+ super({ ...options, bypassCache: true });
752
+ }
753
+ };
754
+
755
+ // src/DataSourceClient.ts
756
+ import { ApiClient as ApiClient5 } from "@uniformdev/context/api";
684
757
  var dataSourceUrl = "/api/v1/data-source";
685
758
  var dataSourcesUrl = "/api/v1/data-sources";
686
- var DataSourceClient = class extends ApiClient4 {
759
+ var DataSourceClient = class extends ApiClient5 {
687
760
  constructor(options) {
688
761
  super(options);
689
762
  }
@@ -720,9 +793,9 @@ var DataSourceClient = class extends ApiClient4 {
720
793
  };
721
794
 
722
795
  // src/DataTypeClient.ts
723
- import { ApiClient as ApiClient5 } from "@uniformdev/context/api";
796
+ import { ApiClient as ApiClient6 } from "@uniformdev/context/api";
724
797
  var _url;
725
- var _DataTypeClient = class _DataTypeClient extends ApiClient5 {
798
+ var _DataTypeClient = class _DataTypeClient extends ApiClient6 {
726
799
  constructor(options) {
727
800
  super(options);
728
801
  }
@@ -1647,9 +1720,9 @@ function subscribeToComposition({
1647
1720
  }
1648
1721
 
1649
1722
  // src/RouteClient.ts
1650
- import { ApiClient as ApiClient6 } from "@uniformdev/context/api";
1723
+ import { ApiClient as ApiClient7 } from "@uniformdev/context/api";
1651
1724
  var ROUTE_URL = "/api/v1/route";
1652
- var RouteClient = class extends ApiClient6 {
1725
+ var RouteClient = class extends ApiClient7 {
1653
1726
  constructor(options) {
1654
1727
  var _a;
1655
1728
  if (!options.limitPolicy) {
@@ -1959,6 +2032,7 @@ export {
1959
2032
  CanvasClientError,
1960
2033
  CategoryClient,
1961
2034
  ChildEnhancerBuilder,
2035
+ ContentClient,
1962
2036
  DataSourceClient,
1963
2037
  DataTypeClient,
1964
2038
  EDGE_CACHE_DISABLED,
@@ -1979,6 +2053,7 @@ export {
1979
2053
  RouteClient,
1980
2054
  UncachedCanvasClient,
1981
2055
  UncachedCategoryClient,
2056
+ UncachedContentClient,
1982
2057
  UniqueBatchEntries,
1983
2058
  bindVariables,
1984
2059
  bindVariablesToObject,
package/dist/index.js CHANGED
@@ -283,7 +283,7 @@ __export(src_exports, {
283
283
  ATTRIBUTE_PARAMETER_TYPE: () => ATTRIBUTE_PARAMETER_TYPE,
284
284
  ATTRIBUTE_PARAMETER_VALUE: () => ATTRIBUTE_PARAMETER_VALUE,
285
285
  ATTRIBUTE_PLACEHOLDER: () => ATTRIBUTE_PLACEHOLDER,
286
- ApiClientError: () => import_api8.ApiClientError,
286
+ ApiClientError: () => import_api9.ApiClientError,
287
287
  BatchEntry: () => BatchEntry,
288
288
  CANVAS_DRAFT_STATE: () => CANVAS_DRAFT_STATE,
289
289
  CANVAS_EDITOR_STATE: () => CANVAS_EDITOR_STATE,
@@ -303,6 +303,7 @@ __export(src_exports, {
303
303
  CanvasClientError: () => CanvasClientError,
304
304
  CategoryClient: () => CategoryClient,
305
305
  ChildEnhancerBuilder: () => ChildEnhancerBuilder,
306
+ ContentClient: () => ContentClient,
306
307
  DataSourceClient: () => DataSourceClient,
307
308
  DataTypeClient: () => DataTypeClient,
308
309
  EDGE_CACHE_DISABLED: () => EDGE_CACHE_DISABLED,
@@ -323,6 +324,7 @@ __export(src_exports, {
323
324
  RouteClient: () => RouteClient,
324
325
  UncachedCanvasClient: () => UncachedCanvasClient,
325
326
  UncachedCategoryClient: () => UncachedCategoryClient,
327
+ UncachedContentClient: () => UncachedContentClient,
326
328
  UniqueBatchEntries: () => UniqueBatchEntries,
327
329
  bindVariables: () => bindVariables,
328
330
  bindVariablesToObject: () => bindVariablesToObject,
@@ -776,11 +778,84 @@ var unstable_CompositionRelationshipClient = class extends import_api4.ApiClient
776
778
  }
777
779
  };
778
780
 
779
- // src/DataSourceClient.ts
781
+ // src/ContentClient.ts
780
782
  var import_api5 = require("@uniformdev/context/api");
783
+ var _contentTypesUrl, _entriesUrl;
784
+ var _ContentClient = class _ContentClient extends import_api5.ApiClient {
785
+ constructor(options) {
786
+ var _a;
787
+ super(options);
788
+ this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
789
+ }
790
+ getContentTypes(options) {
791
+ const { projectId } = this.options;
792
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl), { ...options, projectId });
793
+ return this.apiClient(fetchUri);
794
+ }
795
+ getEntries(options) {
796
+ const { projectId } = this.options;
797
+ const { skipDataResolution, ...params } = options;
798
+ const fetchUri = skipDataResolution ? this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, projectId }) : this.createUrl(__privateGet(_ContentClient, _entriesUrl), this.getEdgeOptions(params), this.edgeApiHost);
799
+ return this.apiClient(fetchUri);
800
+ }
801
+ async upsertContentType(body) {
802
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
803
+ await this.apiClient(fetchUri, {
804
+ method: "PUT",
805
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
806
+ expectNoContent: true
807
+ });
808
+ }
809
+ async upsertEntry(body) {
810
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _entriesUrl));
811
+ await this.apiClient(fetchUri, {
812
+ method: "PUT",
813
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
814
+ expectNoContent: true
815
+ });
816
+ }
817
+ async deleteContentType(body) {
818
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
819
+ await this.apiClient(fetchUri, {
820
+ method: "DELETE",
821
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
822
+ expectNoContent: true
823
+ });
824
+ }
825
+ async deleteEntry(body) {
826
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _entriesUrl));
827
+ await this.apiClient(fetchUri, {
828
+ method: "DELETE",
829
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
830
+ expectNoContent: true
831
+ });
832
+ }
833
+ getEdgeOptions(options) {
834
+ const { projectId } = this.options;
835
+ const { skipDataResolution, ...params } = options;
836
+ return {
837
+ projectId,
838
+ ...params,
839
+ diagnostics: (options == null ? void 0 : options.diagnostics) ? "true" : void 0
840
+ };
841
+ }
842
+ };
843
+ _contentTypesUrl = new WeakMap();
844
+ _entriesUrl = new WeakMap();
845
+ __privateAdd(_ContentClient, _contentTypesUrl, "/api/v1/content-types");
846
+ __privateAdd(_ContentClient, _entriesUrl, "/api/v1/entries");
847
+ var ContentClient = _ContentClient;
848
+ var UncachedContentClient = class extends ContentClient {
849
+ constructor(options) {
850
+ super({ ...options, bypassCache: true });
851
+ }
852
+ };
853
+
854
+ // src/DataSourceClient.ts
855
+ var import_api6 = require("@uniformdev/context/api");
781
856
  var dataSourceUrl = "/api/v1/data-source";
782
857
  var dataSourcesUrl = "/api/v1/data-sources";
783
- var DataSourceClient = class extends import_api5.ApiClient {
858
+ var DataSourceClient = class extends import_api6.ApiClient {
784
859
  constructor(options) {
785
860
  super(options);
786
861
  }
@@ -817,9 +892,9 @@ var DataSourceClient = class extends import_api5.ApiClient {
817
892
  };
818
893
 
819
894
  // src/DataTypeClient.ts
820
- var import_api6 = require("@uniformdev/context/api");
895
+ var import_api7 = require("@uniformdev/context/api");
821
896
  var _url;
822
- var _DataTypeClient = class _DataTypeClient extends import_api6.ApiClient {
897
+ var _DataTypeClient = class _DataTypeClient extends import_api7.ApiClient {
823
898
  constructor(options) {
824
899
  super(options);
825
900
  }
@@ -1744,9 +1819,9 @@ function subscribeToComposition({
1744
1819
  }
1745
1820
 
1746
1821
  // src/RouteClient.ts
1747
- var import_api7 = require("@uniformdev/context/api");
1822
+ var import_api8 = require("@uniformdev/context/api");
1748
1823
  var ROUTE_URL = "/api/v1/route";
1749
- var RouteClient = class extends import_api7.ApiClient {
1824
+ var RouteClient = class extends import_api8.ApiClient {
1750
1825
  constructor(options) {
1751
1826
  var _a;
1752
1827
  if (!options.limitPolicy) {
@@ -2027,8 +2102,8 @@ function handleRichTextNodeBinding(object, options) {
2027
2102
  }
2028
2103
 
2029
2104
  // src/index.ts
2030
- var import_api8 = require("@uniformdev/context/api");
2031
- var CanvasClientError = import_api8.ApiClientError;
2105
+ var import_api9 = require("@uniformdev/context/api");
2106
+ var CanvasClientError = import_api9.ApiClientError;
2032
2107
  // Annotate the CommonJS export names for ESM import in node:
2033
2108
  0 && (module.exports = {
2034
2109
  ATTRIBUTE_COMPONENT_ID,
@@ -2057,6 +2132,7 @@ var CanvasClientError = import_api8.ApiClientError;
2057
2132
  CanvasClientError,
2058
2133
  CategoryClient,
2059
2134
  ChildEnhancerBuilder,
2135
+ ContentClient,
2060
2136
  DataSourceClient,
2061
2137
  DataTypeClient,
2062
2138
  EDGE_CACHE_DISABLED,
@@ -2077,6 +2153,7 @@ var CanvasClientError = import_api8.ApiClientError;
2077
2153
  RouteClient,
2078
2154
  UncachedCanvasClient,
2079
2155
  UncachedCategoryClient,
2156
+ UncachedContentClient,
2080
2157
  UniqueBatchEntries,
2081
2158
  bindVariables,
2082
2159
  bindVariablesToObject,
package/dist/index.mjs CHANGED
@@ -679,11 +679,84 @@ var unstable_CompositionRelationshipClient = class extends ApiClient3 {
679
679
  }
680
680
  };
681
681
 
682
- // src/DataSourceClient.ts
682
+ // src/ContentClient.ts
683
683
  import { ApiClient as ApiClient4 } from "@uniformdev/context/api";
684
+ var _contentTypesUrl, _entriesUrl;
685
+ var _ContentClient = class _ContentClient extends ApiClient4 {
686
+ constructor(options) {
687
+ var _a;
688
+ super(options);
689
+ this.edgeApiHost = (_a = options.edgeApiHost) != null ? _a : "https://uniform.global";
690
+ }
691
+ getContentTypes(options) {
692
+ const { projectId } = this.options;
693
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl), { ...options, projectId });
694
+ return this.apiClient(fetchUri);
695
+ }
696
+ getEntries(options) {
697
+ const { projectId } = this.options;
698
+ const { skipDataResolution, ...params } = options;
699
+ const fetchUri = skipDataResolution ? this.createUrl(__privateGet(_ContentClient, _entriesUrl), { ...params, projectId }) : this.createUrl(__privateGet(_ContentClient, _entriesUrl), this.getEdgeOptions(params), this.edgeApiHost);
700
+ return this.apiClient(fetchUri);
701
+ }
702
+ async upsertContentType(body) {
703
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
704
+ await this.apiClient(fetchUri, {
705
+ method: "PUT",
706
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
707
+ expectNoContent: true
708
+ });
709
+ }
710
+ async upsertEntry(body) {
711
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _entriesUrl));
712
+ await this.apiClient(fetchUri, {
713
+ method: "PUT",
714
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
715
+ expectNoContent: true
716
+ });
717
+ }
718
+ async deleteContentType(body) {
719
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _contentTypesUrl));
720
+ await this.apiClient(fetchUri, {
721
+ method: "DELETE",
722
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
723
+ expectNoContent: true
724
+ });
725
+ }
726
+ async deleteEntry(body) {
727
+ const fetchUri = this.createUrl(__privateGet(_ContentClient, _entriesUrl));
728
+ await this.apiClient(fetchUri, {
729
+ method: "DELETE",
730
+ body: JSON.stringify({ ...body, projectId: this.options.projectId }),
731
+ expectNoContent: true
732
+ });
733
+ }
734
+ getEdgeOptions(options) {
735
+ const { projectId } = this.options;
736
+ const { skipDataResolution, ...params } = options;
737
+ return {
738
+ projectId,
739
+ ...params,
740
+ diagnostics: (options == null ? void 0 : options.diagnostics) ? "true" : void 0
741
+ };
742
+ }
743
+ };
744
+ _contentTypesUrl = new WeakMap();
745
+ _entriesUrl = new WeakMap();
746
+ __privateAdd(_ContentClient, _contentTypesUrl, "/api/v1/content-types");
747
+ __privateAdd(_ContentClient, _entriesUrl, "/api/v1/entries");
748
+ var ContentClient = _ContentClient;
749
+ var UncachedContentClient = class extends ContentClient {
750
+ constructor(options) {
751
+ super({ ...options, bypassCache: true });
752
+ }
753
+ };
754
+
755
+ // src/DataSourceClient.ts
756
+ import { ApiClient as ApiClient5 } from "@uniformdev/context/api";
684
757
  var dataSourceUrl = "/api/v1/data-source";
685
758
  var dataSourcesUrl = "/api/v1/data-sources";
686
- var DataSourceClient = class extends ApiClient4 {
759
+ var DataSourceClient = class extends ApiClient5 {
687
760
  constructor(options) {
688
761
  super(options);
689
762
  }
@@ -720,9 +793,9 @@ var DataSourceClient = class extends ApiClient4 {
720
793
  };
721
794
 
722
795
  // src/DataTypeClient.ts
723
- import { ApiClient as ApiClient5 } from "@uniformdev/context/api";
796
+ import { ApiClient as ApiClient6 } from "@uniformdev/context/api";
724
797
  var _url;
725
- var _DataTypeClient = class _DataTypeClient extends ApiClient5 {
798
+ var _DataTypeClient = class _DataTypeClient extends ApiClient6 {
726
799
  constructor(options) {
727
800
  super(options);
728
801
  }
@@ -1647,9 +1720,9 @@ function subscribeToComposition({
1647
1720
  }
1648
1721
 
1649
1722
  // src/RouteClient.ts
1650
- import { ApiClient as ApiClient6 } from "@uniformdev/context/api";
1723
+ import { ApiClient as ApiClient7 } from "@uniformdev/context/api";
1651
1724
  var ROUTE_URL = "/api/v1/route";
1652
- var RouteClient = class extends ApiClient6 {
1725
+ var RouteClient = class extends ApiClient7 {
1653
1726
  constructor(options) {
1654
1727
  var _a;
1655
1728
  if (!options.limitPolicy) {
@@ -1959,6 +2032,7 @@ export {
1959
2032
  CanvasClientError,
1960
2033
  CategoryClient,
1961
2034
  ChildEnhancerBuilder,
2035
+ ContentClient,
1962
2036
  DataSourceClient,
1963
2037
  DataTypeClient,
1964
2038
  EDGE_CACHE_DISABLED,
@@ -1979,6 +2053,7 @@ export {
1979
2053
  RouteClient,
1980
2054
  UncachedCanvasClient,
1981
2055
  UncachedCategoryClient,
2056
+ UncachedContentClient,
1982
2057
  UniqueBatchEntries,
1983
2058
  bindVariables,
1984
2059
  bindVariablesToObject,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas",
3
- "version": "19.45.1",
3
+ "version": "19.45.2-alpha.7+9afef6594",
4
4
  "description": "Common functionality and types for Uniform Canvas",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -38,7 +38,7 @@
38
38
  "pusher-js": "8.2.0"
39
39
  },
40
40
  "dependencies": {
41
- "@uniformdev/context": "19.45.1",
41
+ "@uniformdev/context": "19.45.2-alpha.7+9afef6594",
42
42
  "immer": "9.0.21"
43
43
  },
44
44
  "files": [
@@ -47,5 +47,5 @@
47
47
  "publishConfig": {
48
48
  "access": "public"
49
49
  },
50
- "gitHead": "27d329b913db64152e9d49bcfa7dddf8b3b31bb6"
50
+ "gitHead": "9afef6594b505ff451ade8bdd5a2d29e8e0e586c"
51
51
  }