@uniformdev/next-app-router 20.72.3-alpha.2 → 20.72.3-alpha.25
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/cache.js +114 -25
- package/dist/cache.mjs +114 -25
- package/dist/component.js +111 -32
- package/dist/component.mjs +97 -18
- package/dist/handler.js +204 -158
- package/dist/handler.mjs +204 -158
- package/dist/index.d.mts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.esm.js +242 -59
- package/dist/index.js +243 -59
- package/dist/index.mjs +242 -59
- package/dist/middleware.js +219 -165
- package/dist/middleware.mjs +219 -165
- package/package.json +8 -8
package/dist/component.js
CHANGED
|
@@ -225,6 +225,7 @@ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot
|
|
|
225
225
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
226
226
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
227
227
|
var defaultLimitPolicy = (0, import_p_limit.default)(6);
|
|
228
|
+
var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
|
|
228
229
|
var ApiClientError = class _ApiClientError extends Error {
|
|
229
230
|
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
230
231
|
super(
|
|
@@ -240,6 +241,12 @@ var ApiClientError = class _ApiClientError extends Error {
|
|
|
240
241
|
Object.setPrototypeOf(this, _ApiClientError.prototype);
|
|
241
242
|
}
|
|
242
243
|
};
|
|
244
|
+
var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
|
|
245
|
+
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
246
|
+
super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
|
|
247
|
+
Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
|
|
248
|
+
}
|
|
249
|
+
};
|
|
243
250
|
var ApiClient = class _ApiClient {
|
|
244
251
|
constructor(options) {
|
|
245
252
|
__publicField(this, "options");
|
|
@@ -273,7 +280,7 @@ var ApiClient = class _ApiClient {
|
|
|
273
280
|
}
|
|
274
281
|
async apiClientWithResponse(fetchUri, options) {
|
|
275
282
|
return this.options.limitPolicy(async () => {
|
|
276
|
-
var _a;
|
|
283
|
+
var _a, _b;
|
|
277
284
|
const coreHeaders = this.options.apiKey ? {
|
|
278
285
|
"x-api-key": this.options.apiKey
|
|
279
286
|
} : {
|
|
@@ -309,9 +316,19 @@ var ApiClient = class _ApiClient {
|
|
|
309
316
|
} catch (e) {
|
|
310
317
|
message = `General error`;
|
|
311
318
|
}
|
|
319
|
+
if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
|
|
320
|
+
throw new BearerTokenNotValidOrExpiredError(
|
|
321
|
+
message,
|
|
322
|
+
(_a = options == null ? void 0 : options.method) != null ? _a : "GET",
|
|
323
|
+
fetchUri.toString(),
|
|
324
|
+
apiResponse.status,
|
|
325
|
+
apiResponse.statusText,
|
|
326
|
+
_ApiClient.getRequestId(apiResponse)
|
|
327
|
+
);
|
|
328
|
+
}
|
|
312
329
|
throw new ApiClientError(
|
|
313
330
|
message,
|
|
314
|
-
(
|
|
331
|
+
(_b = options == null ? void 0 : options.method) != null ? _b : "GET",
|
|
315
332
|
fetchUri.toString(),
|
|
316
333
|
apiResponse.status,
|
|
317
334
|
apiResponse.statusText,
|
|
@@ -674,6 +691,10 @@ function projectionToQuery(spec) {
|
|
|
674
691
|
}
|
|
675
692
|
return out;
|
|
676
693
|
}
|
|
694
|
+
var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
|
|
695
|
+
var CANVAS_COMPONENT_DISPLAY_NAME_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}displayName`;
|
|
696
|
+
var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
|
|
697
|
+
var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
|
|
677
698
|
var _contentTypesUrl;
|
|
678
699
|
var _entriesUrl;
|
|
679
700
|
var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
@@ -780,14 +801,18 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
780
801
|
constructor(options) {
|
|
781
802
|
super(options);
|
|
782
803
|
}
|
|
783
|
-
/** Fetches
|
|
784
|
-
async
|
|
804
|
+
/** Fetches a list of DataTypes for a project */
|
|
805
|
+
async list(options) {
|
|
785
806
|
const { projectId } = this.options;
|
|
786
807
|
const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8), { ...options, projectId });
|
|
787
808
|
return await this.apiClient(fetchUri);
|
|
788
809
|
}
|
|
810
|
+
/** @deprecated Use {@link list} instead. */
|
|
811
|
+
async get(options) {
|
|
812
|
+
return this.list(options);
|
|
813
|
+
}
|
|
789
814
|
/** Updates or creates (based on id) a DataType */
|
|
790
|
-
async
|
|
815
|
+
async save(body) {
|
|
791
816
|
const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8));
|
|
792
817
|
await this.apiClient(fetchUri, {
|
|
793
818
|
method: "PUT",
|
|
@@ -795,6 +820,10 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
795
820
|
expectNoContent: true
|
|
796
821
|
});
|
|
797
822
|
}
|
|
823
|
+
/** @deprecated Use {@link save} instead. */
|
|
824
|
+
async upsert(body) {
|
|
825
|
+
return this.save(body);
|
|
826
|
+
}
|
|
798
827
|
/** Deletes a DataType */
|
|
799
828
|
async remove(body) {
|
|
800
829
|
const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8));
|
|
@@ -807,10 +836,6 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
807
836
|
};
|
|
808
837
|
_url8 = /* @__PURE__ */ new WeakMap();
|
|
809
838
|
__privateAdd2(_DataTypeClient, _url8, "/api/v1/data-types");
|
|
810
|
-
var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
|
|
811
|
-
var CANVAS_COMPONENT_DISPLAY_NAME_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}displayName`;
|
|
812
|
-
var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
|
|
813
|
-
var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
|
|
814
839
|
var _baseUrl;
|
|
815
840
|
var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2 extends ApiClient {
|
|
816
841
|
constructor(options) {
|
|
@@ -853,6 +878,48 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
853
878
|
_baseUrl = /* @__PURE__ */ new WeakMap();
|
|
854
879
|
__privateAdd2(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
855
880
|
var _url22;
|
|
881
|
+
var _NotificationsClient = class _NotificationsClient2 extends ApiClient {
|
|
882
|
+
constructor(options) {
|
|
883
|
+
super(options);
|
|
884
|
+
}
|
|
885
|
+
/**
|
|
886
|
+
* Lists notifications for the current user.
|
|
887
|
+
*
|
|
888
|
+
* @deprecated This API is experimental and may change without notice.
|
|
889
|
+
*/
|
|
890
|
+
async list(options) {
|
|
891
|
+
const fetchUri = this.createUrl(__privateGet2(_NotificationsClient2, _url22), options);
|
|
892
|
+
return await this.apiClient(fetchUri);
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* Creates a notification for one or more recipients.
|
|
896
|
+
*
|
|
897
|
+
* @deprecated This API is experimental and may change without notice.
|
|
898
|
+
*/
|
|
899
|
+
async create(body) {
|
|
900
|
+
const fetchUri = this.createUrl(__privateGet2(_NotificationsClient2, _url22));
|
|
901
|
+
return await this.apiClient(fetchUri, {
|
|
902
|
+
method: "POST",
|
|
903
|
+
body: JSON.stringify(body)
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
/**
|
|
907
|
+
* Updates the read state of the current user's notifications.
|
|
908
|
+
*
|
|
909
|
+
* @deprecated This API is experimental and may change without notice.
|
|
910
|
+
*/
|
|
911
|
+
async setReadState(body) {
|
|
912
|
+
const fetchUri = this.createUrl(__privateGet2(_NotificationsClient2, _url22));
|
|
913
|
+
await this.apiClient(fetchUri, {
|
|
914
|
+
method: "PATCH",
|
|
915
|
+
body: JSON.stringify(body),
|
|
916
|
+
expectNoContent: true
|
|
917
|
+
});
|
|
918
|
+
}
|
|
919
|
+
};
|
|
920
|
+
_url22 = /* @__PURE__ */ new WeakMap();
|
|
921
|
+
__privateAdd2(_NotificationsClient, _url22, "/api/v1/notifications");
|
|
922
|
+
var _url32;
|
|
856
923
|
var _projectsUrl;
|
|
857
924
|
var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
858
925
|
constructor(options) {
|
|
@@ -860,7 +927,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
860
927
|
}
|
|
861
928
|
/** Fetches single Project */
|
|
862
929
|
async get(options) {
|
|
863
|
-
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2,
|
|
930
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url32), { ...options });
|
|
864
931
|
return await this.apiClient(fetchUri);
|
|
865
932
|
}
|
|
866
933
|
/**
|
|
@@ -868,42 +935,54 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
868
935
|
* When teamId is provided, returns a single team with its projects.
|
|
869
936
|
* When omitted, returns all accessible teams and their projects.
|
|
870
937
|
*/
|
|
871
|
-
async
|
|
938
|
+
async list(options) {
|
|
872
939
|
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
|
|
873
940
|
return await this.apiClient(fetchUri);
|
|
874
941
|
}
|
|
942
|
+
/** @deprecated Use {@link list} instead. */
|
|
943
|
+
async getProjects(options) {
|
|
944
|
+
return this.list(options);
|
|
945
|
+
}
|
|
875
946
|
/** Updates or creates (based on id) a Project */
|
|
876
|
-
async
|
|
877
|
-
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2,
|
|
947
|
+
async save(body) {
|
|
948
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url32));
|
|
878
949
|
return await this.apiClient(fetchUri, {
|
|
879
950
|
method: "PUT",
|
|
880
951
|
body: JSON.stringify({ ...body })
|
|
881
952
|
});
|
|
882
953
|
}
|
|
954
|
+
/** @deprecated Use {@link save} instead. */
|
|
955
|
+
async upsert(body) {
|
|
956
|
+
return this.save(body);
|
|
957
|
+
}
|
|
883
958
|
/** Deletes a Project */
|
|
884
|
-
async
|
|
885
|
-
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2,
|
|
959
|
+
async remove(body) {
|
|
960
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url32));
|
|
886
961
|
await this.apiClient(fetchUri, {
|
|
887
962
|
method: "DELETE",
|
|
888
963
|
body: JSON.stringify({ ...body }),
|
|
889
964
|
expectNoContent: true
|
|
890
965
|
});
|
|
891
966
|
}
|
|
967
|
+
/** @deprecated Use {@link remove} instead. */
|
|
968
|
+
async delete(body) {
|
|
969
|
+
return this.remove(body);
|
|
970
|
+
}
|
|
892
971
|
};
|
|
893
|
-
|
|
972
|
+
_url32 = /* @__PURE__ */ new WeakMap();
|
|
894
973
|
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
895
|
-
__privateAdd2(_ProjectClient,
|
|
974
|
+
__privateAdd2(_ProjectClient, _url32, "/api/v1/project");
|
|
896
975
|
__privateAdd2(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
897
976
|
var ATTRIBUTE_COMPONENT_ID = "data-uniform-component-id";
|
|
898
977
|
var ATTRIBUTE_PARAMETER_ID = "data-uniform-parameter-id";
|
|
899
978
|
var ATTRIBUTE_PARAMETER_TYPE = "data-uniform-parameter-type";
|
|
900
979
|
|
|
901
980
|
// src/components/UniformRichText.tsx
|
|
902
|
-
var
|
|
981
|
+
var import_richtext6 = require("@uniformdev/richtext");
|
|
903
982
|
var import_react12 = __toESM(require("react"));
|
|
904
983
|
|
|
905
984
|
// src/components/UniformRichTextNode.tsx
|
|
906
|
-
var
|
|
985
|
+
var import_richtext5 = require("@uniformdev/richtext");
|
|
907
986
|
var import_react11 = __toESM(require("react"));
|
|
908
987
|
|
|
909
988
|
// src/components/nodes/AssetRichTextNode.tsx
|
|
@@ -941,11 +1020,11 @@ var LinebreakRichTextNode = () => {
|
|
|
941
1020
|
};
|
|
942
1021
|
|
|
943
1022
|
// src/components/nodes/LinkRichTextNode.tsx
|
|
944
|
-
var
|
|
1023
|
+
var import_richtext = require("@uniformdev/richtext");
|
|
945
1024
|
var import_react4 = __toESM(require("react"));
|
|
946
1025
|
var LinkRichTextNode = ({ children, node }) => {
|
|
947
1026
|
const { link } = node;
|
|
948
|
-
return /* @__PURE__ */ import_react4.default.createElement("a", { ...(0,
|
|
1027
|
+
return /* @__PURE__ */ import_react4.default.createElement("a", { ...(0, import_richtext.linkParamValueToAnchorProps)(link) }, children);
|
|
949
1028
|
};
|
|
950
1029
|
|
|
951
1030
|
// src/components/nodes/ListItemRichTextNode.tsx
|
|
@@ -964,26 +1043,26 @@ var ListRichTextNode = ({ children, node }) => {
|
|
|
964
1043
|
};
|
|
965
1044
|
|
|
966
1045
|
// src/components/nodes/ParagraphRichTextNode.tsx
|
|
967
|
-
var
|
|
1046
|
+
var import_richtext2 = require("@uniformdev/richtext");
|
|
968
1047
|
var import_react7 = __toESM(require("react"));
|
|
969
1048
|
var ParagraphRichTextNode = ({ children, node }) => {
|
|
970
1049
|
const { format, direction } = node;
|
|
971
1050
|
return /* @__PURE__ */ import_react7.default.createElement(
|
|
972
1051
|
"p",
|
|
973
1052
|
{
|
|
974
|
-
dir: (0,
|
|
975
|
-
style: (0,
|
|
1053
|
+
dir: (0, import_richtext2.isPureDirection)(direction) ? direction : void 0,
|
|
1054
|
+
style: (0, import_richtext2.isPureTextAlign)(format) ? { textAlign: format } : void 0
|
|
976
1055
|
},
|
|
977
1056
|
children
|
|
978
1057
|
);
|
|
979
1058
|
};
|
|
980
1059
|
|
|
981
1060
|
// src/components/nodes/TableCellRichTextNode.tsx
|
|
982
|
-
var
|
|
1061
|
+
var import_richtext3 = require("@uniformdev/richtext");
|
|
983
1062
|
var import_react8 = __toESM(require("react"));
|
|
984
1063
|
var TableCellRichTextNode = ({ children, node }) => {
|
|
985
1064
|
const { headerState } = node;
|
|
986
|
-
const TableCellTag = (0,
|
|
1065
|
+
const TableCellTag = (0, import_richtext3.getRichTextTagFromTableCellHeaderState)(headerState);
|
|
987
1066
|
return /* @__PURE__ */ import_react8.default.createElement(TableCellTag, null, children);
|
|
988
1067
|
};
|
|
989
1068
|
|
|
@@ -994,18 +1073,18 @@ var TabRichTextNode = () => {
|
|
|
994
1073
|
};
|
|
995
1074
|
|
|
996
1075
|
// src/components/nodes/TextRichTextNode.tsx
|
|
997
|
-
var
|
|
1076
|
+
var import_richtext4 = require("@uniformdev/richtext");
|
|
998
1077
|
var import_react10 = __toESM(require("react"));
|
|
999
1078
|
var TextRichTextNode = ({ node }) => {
|
|
1000
1079
|
const { text, format } = node;
|
|
1001
|
-
const tags = (0,
|
|
1080
|
+
const tags = (0, import_richtext4.getRichTextTagsFromTextFormat)(format);
|
|
1002
1081
|
return /* @__PURE__ */ import_react10.default.createElement(import_react10.default.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ import_react10.default.createElement(Tag, null, children), text) : text);
|
|
1003
1082
|
};
|
|
1004
1083
|
|
|
1005
1084
|
// src/components/UniformRichTextNode.tsx
|
|
1006
1085
|
function UniformRichTextNode({ node, ...props }) {
|
|
1007
1086
|
var _a;
|
|
1008
|
-
if (!(0,
|
|
1087
|
+
if (!(0, import_richtext5.isRichTextNode)(node)) return null;
|
|
1009
1088
|
let NodeRenderer = (_a = props.resolveRichTextRenderer) == null ? void 0 : _a.call(props, node);
|
|
1010
1089
|
if (typeof NodeRenderer === "undefined") {
|
|
1011
1090
|
NodeRenderer = resolveRichTextDefaultRenderer(node);
|
|
@@ -1059,8 +1138,8 @@ var UniformRichText = import_react12.default.forwardRef(function UniformRichText
|
|
|
1059
1138
|
}
|
|
1060
1139
|
const computedPlaceholder = typeof placeholder === "function" ? placeholder({ id: parameter.parameterId }) : placeholder;
|
|
1061
1140
|
const value = parameter.value;
|
|
1062
|
-
if (!value || !(0,
|
|
1063
|
-
if (!isContextualEditing && (0,
|
|
1141
|
+
if (!value || !(0, import_richtext6.isRichTextValue)(value)) return null;
|
|
1142
|
+
if (!isContextualEditing && (0, import_richtext6.isRichTextValueConsideredEmpty)(value)) return null;
|
|
1064
1143
|
return Tag === null ? /* @__PURE__ */ import_react12.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ import_react12.default.createElement(
|
|
1065
1144
|
Tag,
|
|
1066
1145
|
{
|
|
@@ -1072,7 +1151,7 @@ var UniformRichText = import_react12.default.forwardRef(function UniformRichText
|
|
|
1072
1151
|
[ATTRIBUTE_PARAMETER_TYPE]: "richText"
|
|
1073
1152
|
} : {}
|
|
1074
1153
|
},
|
|
1075
|
-
(0,
|
|
1154
|
+
(0, import_richtext6.isRichTextValueConsideredEmpty)(value) ? /* @__PURE__ */ import_react12.default.createElement("p", null, /* @__PURE__ */ import_react12.default.createElement("i", null, computedPlaceholder)) : /* @__PURE__ */ import_react12.default.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
|
|
1076
1155
|
);
|
|
1077
1156
|
});
|
|
1078
1157
|
|
package/dist/component.mjs
CHANGED
|
@@ -210,6 +210,7 @@ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot
|
|
|
210
210
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
211
211
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
212
212
|
var defaultLimitPolicy = (0, import_p_limit.default)(6);
|
|
213
|
+
var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
|
|
213
214
|
var ApiClientError = class _ApiClientError extends Error {
|
|
214
215
|
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
215
216
|
super(
|
|
@@ -225,6 +226,12 @@ var ApiClientError = class _ApiClientError extends Error {
|
|
|
225
226
|
Object.setPrototypeOf(this, _ApiClientError.prototype);
|
|
226
227
|
}
|
|
227
228
|
};
|
|
229
|
+
var BearerTokenNotValidOrExpiredError = class _BearerTokenNotValidOrExpiredError extends ApiClientError {
|
|
230
|
+
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
231
|
+
super(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId);
|
|
232
|
+
Object.setPrototypeOf(this, _BearerTokenNotValidOrExpiredError.prototype);
|
|
233
|
+
}
|
|
234
|
+
};
|
|
228
235
|
var ApiClient = class _ApiClient {
|
|
229
236
|
constructor(options) {
|
|
230
237
|
__publicField(this, "options");
|
|
@@ -258,7 +265,7 @@ var ApiClient = class _ApiClient {
|
|
|
258
265
|
}
|
|
259
266
|
async apiClientWithResponse(fetchUri, options) {
|
|
260
267
|
return this.options.limitPolicy(async () => {
|
|
261
|
-
var _a;
|
|
268
|
+
var _a, _b;
|
|
262
269
|
const coreHeaders = this.options.apiKey ? {
|
|
263
270
|
"x-api-key": this.options.apiKey
|
|
264
271
|
} : {
|
|
@@ -294,9 +301,19 @@ var ApiClient = class _ApiClient {
|
|
|
294
301
|
} catch (e) {
|
|
295
302
|
message = `General error`;
|
|
296
303
|
}
|
|
304
|
+
if (apiResponse.status === 401 && message === UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE) {
|
|
305
|
+
throw new BearerTokenNotValidOrExpiredError(
|
|
306
|
+
message,
|
|
307
|
+
(_a = options == null ? void 0 : options.method) != null ? _a : "GET",
|
|
308
|
+
fetchUri.toString(),
|
|
309
|
+
apiResponse.status,
|
|
310
|
+
apiResponse.statusText,
|
|
311
|
+
_ApiClient.getRequestId(apiResponse)
|
|
312
|
+
);
|
|
313
|
+
}
|
|
297
314
|
throw new ApiClientError(
|
|
298
315
|
message,
|
|
299
|
-
(
|
|
316
|
+
(_b = options == null ? void 0 : options.method) != null ? _b : "GET",
|
|
300
317
|
fetchUri.toString(),
|
|
301
318
|
apiResponse.status,
|
|
302
319
|
apiResponse.statusText,
|
|
@@ -659,6 +676,10 @@ function projectionToQuery(spec) {
|
|
|
659
676
|
}
|
|
660
677
|
return out;
|
|
661
678
|
}
|
|
679
|
+
var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
|
|
680
|
+
var CANVAS_COMPONENT_DISPLAY_NAME_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}displayName`;
|
|
681
|
+
var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
|
|
682
|
+
var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
|
|
662
683
|
var _contentTypesUrl;
|
|
663
684
|
var _entriesUrl;
|
|
664
685
|
var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
@@ -765,14 +786,18 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
765
786
|
constructor(options) {
|
|
766
787
|
super(options);
|
|
767
788
|
}
|
|
768
|
-
/** Fetches
|
|
769
|
-
async
|
|
789
|
+
/** Fetches a list of DataTypes for a project */
|
|
790
|
+
async list(options) {
|
|
770
791
|
const { projectId } = this.options;
|
|
771
792
|
const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8), { ...options, projectId });
|
|
772
793
|
return await this.apiClient(fetchUri);
|
|
773
794
|
}
|
|
795
|
+
/** @deprecated Use {@link list} instead. */
|
|
796
|
+
async get(options) {
|
|
797
|
+
return this.list(options);
|
|
798
|
+
}
|
|
774
799
|
/** Updates or creates (based on id) a DataType */
|
|
775
|
-
async
|
|
800
|
+
async save(body) {
|
|
776
801
|
const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8));
|
|
777
802
|
await this.apiClient(fetchUri, {
|
|
778
803
|
method: "PUT",
|
|
@@ -780,6 +805,10 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
780
805
|
expectNoContent: true
|
|
781
806
|
});
|
|
782
807
|
}
|
|
808
|
+
/** @deprecated Use {@link save} instead. */
|
|
809
|
+
async upsert(body) {
|
|
810
|
+
return this.save(body);
|
|
811
|
+
}
|
|
783
812
|
/** Deletes a DataType */
|
|
784
813
|
async remove(body) {
|
|
785
814
|
const fetchUri = this.createUrl(__privateGet2(_DataTypeClient2, _url8));
|
|
@@ -792,10 +821,6 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
792
821
|
};
|
|
793
822
|
_url8 = /* @__PURE__ */ new WeakMap();
|
|
794
823
|
__privateAdd2(_DataTypeClient, _url8, "/api/v1/data-types");
|
|
795
|
-
var CANVAS_INTERNAL_PARAM_PREFIX = "$internal_";
|
|
796
|
-
var CANVAS_COMPONENT_DISPLAY_NAME_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}displayName`;
|
|
797
|
-
var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
|
|
798
|
-
var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
|
|
799
824
|
var _baseUrl;
|
|
800
825
|
var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2 extends ApiClient {
|
|
801
826
|
constructor(options) {
|
|
@@ -838,6 +863,48 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
838
863
|
_baseUrl = /* @__PURE__ */ new WeakMap();
|
|
839
864
|
__privateAdd2(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
840
865
|
var _url22;
|
|
866
|
+
var _NotificationsClient = class _NotificationsClient2 extends ApiClient {
|
|
867
|
+
constructor(options) {
|
|
868
|
+
super(options);
|
|
869
|
+
}
|
|
870
|
+
/**
|
|
871
|
+
* Lists notifications for the current user.
|
|
872
|
+
*
|
|
873
|
+
* @deprecated This API is experimental and may change without notice.
|
|
874
|
+
*/
|
|
875
|
+
async list(options) {
|
|
876
|
+
const fetchUri = this.createUrl(__privateGet2(_NotificationsClient2, _url22), options);
|
|
877
|
+
return await this.apiClient(fetchUri);
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* Creates a notification for one or more recipients.
|
|
881
|
+
*
|
|
882
|
+
* @deprecated This API is experimental and may change without notice.
|
|
883
|
+
*/
|
|
884
|
+
async create(body) {
|
|
885
|
+
const fetchUri = this.createUrl(__privateGet2(_NotificationsClient2, _url22));
|
|
886
|
+
return await this.apiClient(fetchUri, {
|
|
887
|
+
method: "POST",
|
|
888
|
+
body: JSON.stringify(body)
|
|
889
|
+
});
|
|
890
|
+
}
|
|
891
|
+
/**
|
|
892
|
+
* Updates the read state of the current user's notifications.
|
|
893
|
+
*
|
|
894
|
+
* @deprecated This API is experimental and may change without notice.
|
|
895
|
+
*/
|
|
896
|
+
async setReadState(body) {
|
|
897
|
+
const fetchUri = this.createUrl(__privateGet2(_NotificationsClient2, _url22));
|
|
898
|
+
await this.apiClient(fetchUri, {
|
|
899
|
+
method: "PATCH",
|
|
900
|
+
body: JSON.stringify(body),
|
|
901
|
+
expectNoContent: true
|
|
902
|
+
});
|
|
903
|
+
}
|
|
904
|
+
};
|
|
905
|
+
_url22 = /* @__PURE__ */ new WeakMap();
|
|
906
|
+
__privateAdd2(_NotificationsClient, _url22, "/api/v1/notifications");
|
|
907
|
+
var _url32;
|
|
841
908
|
var _projectsUrl;
|
|
842
909
|
var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
843
910
|
constructor(options) {
|
|
@@ -845,7 +912,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
845
912
|
}
|
|
846
913
|
/** Fetches single Project */
|
|
847
914
|
async get(options) {
|
|
848
|
-
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2,
|
|
915
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url32), { ...options });
|
|
849
916
|
return await this.apiClient(fetchUri);
|
|
850
917
|
}
|
|
851
918
|
/**
|
|
@@ -853,31 +920,43 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
853
920
|
* When teamId is provided, returns a single team with its projects.
|
|
854
921
|
* When omitted, returns all accessible teams and their projects.
|
|
855
922
|
*/
|
|
856
|
-
async
|
|
923
|
+
async list(options) {
|
|
857
924
|
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
|
|
858
925
|
return await this.apiClient(fetchUri);
|
|
859
926
|
}
|
|
927
|
+
/** @deprecated Use {@link list} instead. */
|
|
928
|
+
async getProjects(options) {
|
|
929
|
+
return this.list(options);
|
|
930
|
+
}
|
|
860
931
|
/** Updates or creates (based on id) a Project */
|
|
861
|
-
async
|
|
862
|
-
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2,
|
|
932
|
+
async save(body) {
|
|
933
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url32));
|
|
863
934
|
return await this.apiClient(fetchUri, {
|
|
864
935
|
method: "PUT",
|
|
865
936
|
body: JSON.stringify({ ...body })
|
|
866
937
|
});
|
|
867
938
|
}
|
|
939
|
+
/** @deprecated Use {@link save} instead. */
|
|
940
|
+
async upsert(body) {
|
|
941
|
+
return this.save(body);
|
|
942
|
+
}
|
|
868
943
|
/** Deletes a Project */
|
|
869
|
-
async
|
|
870
|
-
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2,
|
|
944
|
+
async remove(body) {
|
|
945
|
+
const fetchUri = this.createUrl(__privateGet2(_ProjectClient2, _url32));
|
|
871
946
|
await this.apiClient(fetchUri, {
|
|
872
947
|
method: "DELETE",
|
|
873
948
|
body: JSON.stringify({ ...body }),
|
|
874
949
|
expectNoContent: true
|
|
875
950
|
});
|
|
876
951
|
}
|
|
952
|
+
/** @deprecated Use {@link remove} instead. */
|
|
953
|
+
async delete(body) {
|
|
954
|
+
return this.remove(body);
|
|
955
|
+
}
|
|
877
956
|
};
|
|
878
|
-
|
|
957
|
+
_url32 = /* @__PURE__ */ new WeakMap();
|
|
879
958
|
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
880
|
-
__privateAdd2(_ProjectClient,
|
|
959
|
+
__privateAdd2(_ProjectClient, _url32, "/api/v1/project");
|
|
881
960
|
__privateAdd2(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
882
961
|
var ATTRIBUTE_COMPONENT_ID = "data-uniform-component-id";
|
|
883
962
|
var ATTRIBUTE_PARAMETER_ID = "data-uniform-parameter-id";
|
|
@@ -929,7 +1008,7 @@ var LinebreakRichTextNode = () => {
|
|
|
929
1008
|
};
|
|
930
1009
|
|
|
931
1010
|
// src/components/nodes/LinkRichTextNode.tsx
|
|
932
|
-
import { linkParamValueToAnchorProps } from "@uniformdev/
|
|
1011
|
+
import { linkParamValueToAnchorProps } from "@uniformdev/richtext";
|
|
933
1012
|
import React4 from "react";
|
|
934
1013
|
var LinkRichTextNode = ({ children, node }) => {
|
|
935
1014
|
const { link } = node;
|