@uniformdev/next-app-router 20.81.0 → 20.81.1-alpha.10.sha-def425616f
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/{UniformComposition-DBO-oo7J.d.ts → UniformComposition-ChDH4dMd.d.ts} +12 -31
- package/dist/{UniformComposition-le6UEB_r.d.mts → UniformComposition-Doa1kKRm.d.mts} +12 -31
- package/dist/cache.d.mts +24 -6
- package/dist/cache.d.ts +24 -6
- package/dist/cache.js +396 -832
- package/dist/cache.mjs +391 -830
- package/dist/compat.d.mts +2 -4
- package/dist/compat.d.ts +2 -4
- package/dist/component.d.mts +10 -1
- package/dist/component.d.ts +10 -1
- package/dist/component.js +113 -617
- package/dist/component.mjs +112 -640
- package/dist/composition-CGU7iH-k.d.mts +37 -0
- package/dist/composition-CGU7iH-k.d.ts +37 -0
- package/dist/config/default.js +0 -1
- package/dist/config/default.mjs +0 -1
- package/dist/createCachedManifestProvider-2-2u3PYd.d.mts +84 -0
- package/dist/createCachedManifestProvider-BoorKD15.d.ts +84 -0
- package/dist/edge.d.mts +80 -0
- package/dist/edge.d.ts +80 -0
- package/dist/edge.js +1225 -0
- package/dist/edge.mjs +1191 -0
- package/dist/handler.d.mts +15 -2
- package/dist/handler.d.ts +15 -2
- package/dist/handler.js +134 -628
- package/dist/handler.mjs +132 -626
- package/dist/index.d.mts +81 -41
- package/dist/index.d.ts +81 -41
- package/dist/index.esm.js +2051 -5614
- package/dist/index.js +2092 -5651
- package/dist/index.mjs +2051 -5614
- package/dist/middleware.d.mts +60 -13
- package/dist/middleware.d.ts +60 -13
- package/dist/middleware.js +415 -5746
- package/dist/middleware.mjs +422 -5776
- package/dist/models-C8OdCO44.d.mts +72 -0
- package/dist/models-C8OdCO44.d.ts +72 -0
- package/dist/resolveRouteFromPath-CnfnaxY2.d.ts +80 -0
- package/dist/resolveRouteFromPath-_rauUskz.d.mts +80 -0
- package/dist/vercel.d.mts +37 -0
- package/dist/vercel.d.ts +37 -0
- package/dist/vercel.js +788 -0
- package/dist/vercel.mjs +759 -0
- package/package.json +37 -9
- package/dist/client-BElN_CWD.d.mts +0 -786
- package/dist/client-BElN_CWD.d.ts +0 -786
- package/dist/resolveRouteFromCode-BOvjIvM2.d.ts +0 -18
- package/dist/resolveRouteFromCode-CuJ4JHeb.d.mts +0 -18
package/dist/component.mjs
CHANGED
|
@@ -1,147 +1,3 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
8
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
19
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
20
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
21
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
22
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
23
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
24
|
-
mod
|
|
25
|
-
));
|
|
26
|
-
|
|
27
|
-
// ../../node_modules/.pnpm/yocto-queue@0.1.0/node_modules/yocto-queue/index.js
|
|
28
|
-
var require_yocto_queue = __commonJS({
|
|
29
|
-
"../../node_modules/.pnpm/yocto-queue@0.1.0/node_modules/yocto-queue/index.js"(exports, module) {
|
|
30
|
-
"use strict";
|
|
31
|
-
var Node = class {
|
|
32
|
-
/// value;
|
|
33
|
-
/// next;
|
|
34
|
-
constructor(value) {
|
|
35
|
-
this.value = value;
|
|
36
|
-
this.next = void 0;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
var Queue = class {
|
|
40
|
-
// TODO: Use private class fields when targeting Node.js 12.
|
|
41
|
-
// #_head;
|
|
42
|
-
// #_tail;
|
|
43
|
-
// #_size;
|
|
44
|
-
constructor() {
|
|
45
|
-
this.clear();
|
|
46
|
-
}
|
|
47
|
-
enqueue(value) {
|
|
48
|
-
const node = new Node(value);
|
|
49
|
-
if (this._head) {
|
|
50
|
-
this._tail.next = node;
|
|
51
|
-
this._tail = node;
|
|
52
|
-
} else {
|
|
53
|
-
this._head = node;
|
|
54
|
-
this._tail = node;
|
|
55
|
-
}
|
|
56
|
-
this._size++;
|
|
57
|
-
}
|
|
58
|
-
dequeue() {
|
|
59
|
-
const current = this._head;
|
|
60
|
-
if (!current) {
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
this._head = this._head.next;
|
|
64
|
-
this._size--;
|
|
65
|
-
return current.value;
|
|
66
|
-
}
|
|
67
|
-
clear() {
|
|
68
|
-
this._head = void 0;
|
|
69
|
-
this._tail = void 0;
|
|
70
|
-
this._size = 0;
|
|
71
|
-
}
|
|
72
|
-
get size() {
|
|
73
|
-
return this._size;
|
|
74
|
-
}
|
|
75
|
-
*[Symbol.iterator]() {
|
|
76
|
-
let current = this._head;
|
|
77
|
-
while (current) {
|
|
78
|
-
yield current.value;
|
|
79
|
-
current = current.next;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
module.exports = Queue;
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
// ../../node_modules/.pnpm/p-limit@3.1.0/node_modules/p-limit/index.js
|
|
88
|
-
var require_p_limit = __commonJS({
|
|
89
|
-
"../../node_modules/.pnpm/p-limit@3.1.0/node_modules/p-limit/index.js"(exports, module) {
|
|
90
|
-
"use strict";
|
|
91
|
-
var Queue = require_yocto_queue();
|
|
92
|
-
var pLimit2 = (concurrency) => {
|
|
93
|
-
if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
|
|
94
|
-
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
95
|
-
}
|
|
96
|
-
const queue = new Queue();
|
|
97
|
-
let activeCount = 0;
|
|
98
|
-
const next = () => {
|
|
99
|
-
activeCount--;
|
|
100
|
-
if (queue.size > 0) {
|
|
101
|
-
queue.dequeue()();
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
const run = async (fn, resolve, ...args) => {
|
|
105
|
-
activeCount++;
|
|
106
|
-
const result = (async () => fn(...args))();
|
|
107
|
-
resolve(result);
|
|
108
|
-
try {
|
|
109
|
-
await result;
|
|
110
|
-
} catch (e) {
|
|
111
|
-
}
|
|
112
|
-
next();
|
|
113
|
-
};
|
|
114
|
-
const enqueue = (fn, resolve, ...args) => {
|
|
115
|
-
queue.enqueue(run.bind(null, fn, resolve, ...args));
|
|
116
|
-
(async () => {
|
|
117
|
-
await Promise.resolve();
|
|
118
|
-
if (activeCount < concurrency && queue.size > 0) {
|
|
119
|
-
queue.dequeue()();
|
|
120
|
-
}
|
|
121
|
-
})();
|
|
122
|
-
};
|
|
123
|
-
const generator = (fn, ...args) => new Promise((resolve) => {
|
|
124
|
-
enqueue(fn, resolve, ...args);
|
|
125
|
-
});
|
|
126
|
-
Object.defineProperties(generator, {
|
|
127
|
-
activeCount: {
|
|
128
|
-
get: () => activeCount
|
|
129
|
-
},
|
|
130
|
-
pendingCount: {
|
|
131
|
-
get: () => queue.size
|
|
132
|
-
},
|
|
133
|
-
clearQueue: {
|
|
134
|
-
value: () => {
|
|
135
|
-
queue.clear();
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
return generator;
|
|
140
|
-
};
|
|
141
|
-
module.exports = pLimit2;
|
|
142
|
-
}
|
|
143
|
-
});
|
|
144
|
-
|
|
145
1
|
// src/components/getUniformSlot.ts
|
|
146
2
|
var getUniformSlot = ({ slot, children }) => {
|
|
147
3
|
const resolved = [];
|
|
@@ -166,6 +22,21 @@ var getUniformSlot = ({ slot, children }) => {
|
|
|
166
22
|
return resolved.length > 0 ? resolved : void 0;
|
|
167
23
|
};
|
|
168
24
|
|
|
25
|
+
// src/components/UniformEdgeState.tsx
|
|
26
|
+
import { SERVER_STATE_ID } from "@uniformdev/context";
|
|
27
|
+
import React from "react";
|
|
28
|
+
function UniformEdgeState() {
|
|
29
|
+
return /* @__PURE__ */ React.createElement(
|
|
30
|
+
"script",
|
|
31
|
+
{
|
|
32
|
+
id: SERVER_STATE_ID,
|
|
33
|
+
type: "application/json",
|
|
34
|
+
dangerouslySetInnerHTML: { __html: "" },
|
|
35
|
+
suppressHydrationWarning: true
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
|
|
169
40
|
// src/components/UniformSlot.tsx
|
|
170
41
|
var UniformSlot = ({ slot, children }) => {
|
|
171
42
|
const resolved = [];
|
|
@@ -198,440 +69,40 @@ import {
|
|
|
198
69
|
useUniformContext
|
|
199
70
|
} from "@uniformdev/next-app-router-client";
|
|
200
71
|
|
|
201
|
-
// ../
|
|
202
|
-
|
|
203
|
-
|
|
72
|
+
// ../canvas/dist/index.mjs
|
|
73
|
+
import { ApiClient } from "@uniformdev/context/api";
|
|
74
|
+
import { ApiClientError } from "@uniformdev/context/api";
|
|
75
|
+
import { ApiClientError as ApiClientError2 } from "@uniformdev/context/api";
|
|
76
|
+
import { ApiClient as ApiClient2 } from "@uniformdev/context/api";
|
|
77
|
+
import { rewriteFiltersForApi } from "@uniformdev/context/api";
|
|
78
|
+
import { rewriteFiltersForApi as rewriteFiltersForApi2 } from "@uniformdev/context/api";
|
|
79
|
+
import { ApiClientError as ApiClientError3 } from "@uniformdev/context/api";
|
|
80
|
+
import { rewriteFiltersForApi as rewriteFiltersForApi3 } from "@uniformdev/context/api";
|
|
81
|
+
import { ApiClientError as ApiClientError4 } from "@uniformdev/context/api";
|
|
82
|
+
import { rewriteFiltersForApi as rewriteFiltersForApi4 } from "@uniformdev/context/api";
|
|
83
|
+
import { ApiClient as ApiClient3, rewriteFiltersForApi as rewriteFiltersForApi5 } from "@uniformdev/context/api";
|
|
84
|
+
import { ApiClient as ApiClient4, rewriteFiltersForApi as rewriteFiltersForApi6 } from "@uniformdev/context/api";
|
|
85
|
+
import { ApiClient as ApiClient5 } from "@uniformdev/context/api";
|
|
86
|
+
import { ApiClient as ApiClient6 } from "@uniformdev/context/api";
|
|
87
|
+
import { ApiClient as ApiClient7 } from "@uniformdev/context/api";
|
|
88
|
+
import { ApiClient as ApiClient8 } from "@uniformdev/context/api";
|
|
89
|
+
import { ApiClient as ApiClient9 } from "@uniformdev/context/api";
|
|
90
|
+
import { ApiClient as ApiClient10 } from "@uniformdev/context/api";
|
|
91
|
+
import { ApiClient as ApiClient11 } from "@uniformdev/context/api";
|
|
92
|
+
import { ApiClient as ApiClient12 } from "@uniformdev/context/api";
|
|
93
|
+
import { ApiClient as ApiClient13 } from "@uniformdev/context/api";
|
|
94
|
+
import { ApiClient as ApiClient14 } from "@uniformdev/context/api";
|
|
95
|
+
import { ApiClient as ApiClient15 } from "@uniformdev/context/api";
|
|
96
|
+
import { ApiClient as ApiClient16 } from "@uniformdev/context/api";
|
|
97
|
+
import { ApiClient as ApiClient17 } from "@uniformdev/context/api";
|
|
98
|
+
import { ApiClientError as ApiClientError5 } from "@uniformdev/context/api";
|
|
99
|
+
import { ApiClient as ApiClient18 } from "@uniformdev/context/api";
|
|
204
100
|
var __typeError = (msg) => {
|
|
205
101
|
throw TypeError(msg);
|
|
206
102
|
};
|
|
207
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
208
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
209
103
|
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
210
104
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
211
105
|
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
|
-
var defaultLimitPolicy = (0, import_p_limit.default)(6);
|
|
213
|
-
var UNIFORM_BEARER_TOKEN_NOT_VALID_OR_EXPIRED_MESSAGE = "Bearer token not valid or expired";
|
|
214
|
-
var ApiClientError = class _ApiClientError extends Error {
|
|
215
|
-
constructor(errorMessage, fetchMethod, fetchUri, statusCode, statusText, requestId) {
|
|
216
|
-
super(
|
|
217
|
-
`${errorMessage}
|
|
218
|
-
${statusCode}${statusText ? " " + statusText : ""} (${fetchMethod} ${fetchUri}${requestId ? ` Request ID: ${requestId}` : ""})`
|
|
219
|
-
);
|
|
220
|
-
__publicField(this, "errorMessage", errorMessage);
|
|
221
|
-
__publicField(this, "fetchMethod", fetchMethod);
|
|
222
|
-
__publicField(this, "fetchUri", fetchUri);
|
|
223
|
-
__publicField(this, "statusCode", statusCode);
|
|
224
|
-
__publicField(this, "statusText", statusText);
|
|
225
|
-
__publicField(this, "requestId", requestId);
|
|
226
|
-
Object.setPrototypeOf(this, _ApiClientError.prototype);
|
|
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
|
-
};
|
|
235
|
-
var ApiClient = class _ApiClient {
|
|
236
|
-
constructor(options) {
|
|
237
|
-
__publicField(this, "options");
|
|
238
|
-
var _a, _b, _c, _d, _e;
|
|
239
|
-
if (!options.apiKey && !options.bearerToken) {
|
|
240
|
-
throw new Error("You must provide an API key or a bearer token");
|
|
241
|
-
}
|
|
242
|
-
let leFetch = options.fetch;
|
|
243
|
-
if (!leFetch) {
|
|
244
|
-
if (typeof window !== "undefined") {
|
|
245
|
-
leFetch = window.fetch.bind(window);
|
|
246
|
-
} else if (typeof fetch !== "undefined") {
|
|
247
|
-
leFetch = fetch;
|
|
248
|
-
} else {
|
|
249
|
-
throw new Error("You must provide or polyfill a fetch implementation when not in a browser");
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
this.options = {
|
|
253
|
-
...options,
|
|
254
|
-
fetch: leFetch,
|
|
255
|
-
apiHost: this.ensureApiHost(options.apiHost),
|
|
256
|
-
apiKey: (_a = options.apiKey) != null ? _a : null,
|
|
257
|
-
projectId: (_b = options.projectId) != null ? _b : null,
|
|
258
|
-
bearerToken: (_c = options.bearerToken) != null ? _c : null,
|
|
259
|
-
limitPolicy: (_d = options.limitPolicy) != null ? _d : defaultLimitPolicy,
|
|
260
|
-
bypassCache: (_e = options.bypassCache) != null ? _e : false
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
async apiClient(fetchUri, options) {
|
|
264
|
-
return (await this.apiClientWithResponse(fetchUri, options)).body;
|
|
265
|
-
}
|
|
266
|
-
async apiClientWithResponse(fetchUri, options) {
|
|
267
|
-
return this.options.limitPolicy(async () => {
|
|
268
|
-
var _a, _b;
|
|
269
|
-
const coreHeaders = this.options.apiKey ? {
|
|
270
|
-
"x-api-key": this.options.apiKey
|
|
271
|
-
} : {
|
|
272
|
-
Authorization: `Bearer ${this.options.bearerToken}`
|
|
273
|
-
};
|
|
274
|
-
if (this.options.bypassCache) {
|
|
275
|
-
coreHeaders["x-bypass-cache"] = "true";
|
|
276
|
-
}
|
|
277
|
-
const { fetch: fetch2, signal } = this.options;
|
|
278
|
-
const callApi = () => fetch2(fetchUri.toString(), {
|
|
279
|
-
...options,
|
|
280
|
-
signal,
|
|
281
|
-
headers: {
|
|
282
|
-
...options == null ? void 0 : options.headers,
|
|
283
|
-
...coreHeaders
|
|
284
|
-
}
|
|
285
|
-
});
|
|
286
|
-
const apiResponse = await handleRateLimits(callApi);
|
|
287
|
-
if (!apiResponse.ok) {
|
|
288
|
-
let message = "";
|
|
289
|
-
try {
|
|
290
|
-
const responseText = await apiResponse.text();
|
|
291
|
-
try {
|
|
292
|
-
const parsed = JSON.parse(responseText);
|
|
293
|
-
if (parsed.errorMessage) {
|
|
294
|
-
message = Array.isArray(parsed.errorMessage) ? parsed.errorMessage.join(", ") : parsed.errorMessage;
|
|
295
|
-
} else {
|
|
296
|
-
message = responseText;
|
|
297
|
-
}
|
|
298
|
-
} catch (e) {
|
|
299
|
-
message = responseText;
|
|
300
|
-
}
|
|
301
|
-
} catch (e) {
|
|
302
|
-
message = `General error`;
|
|
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
|
-
}
|
|
314
|
-
throw new ApiClientError(
|
|
315
|
-
message,
|
|
316
|
-
(_b = options == null ? void 0 : options.method) != null ? _b : "GET",
|
|
317
|
-
fetchUri.toString(),
|
|
318
|
-
apiResponse.status,
|
|
319
|
-
apiResponse.statusText,
|
|
320
|
-
_ApiClient.getRequestId(apiResponse)
|
|
321
|
-
);
|
|
322
|
-
}
|
|
323
|
-
if (options == null ? void 0 : options.expectNoContent) {
|
|
324
|
-
return { response: apiResponse, body: null };
|
|
325
|
-
}
|
|
326
|
-
return {
|
|
327
|
-
response: apiResponse,
|
|
328
|
-
body: await apiResponse.json()
|
|
329
|
-
};
|
|
330
|
-
});
|
|
331
|
-
}
|
|
332
|
-
createUrl(path, queryParams, hostOverride) {
|
|
333
|
-
const url = new URL(`${hostOverride != null ? hostOverride : this.options.apiHost}${path}`);
|
|
334
|
-
Object.entries(queryParams != null ? queryParams : {}).forEach(([key, value]) => {
|
|
335
|
-
var _a;
|
|
336
|
-
if (typeof value !== "undefined" && value !== null) {
|
|
337
|
-
url.searchParams.append(key, Array.isArray(value) ? value.join(",") : (_a = value == null ? void 0 : value.toString()) != null ? _a : "");
|
|
338
|
-
}
|
|
339
|
-
});
|
|
340
|
-
return url;
|
|
341
|
-
}
|
|
342
|
-
ensureApiHost(apiHost) {
|
|
343
|
-
if (!apiHost) return "https://uniform.app";
|
|
344
|
-
if (!(apiHost == null ? void 0 : apiHost.startsWith("http"))) {
|
|
345
|
-
throw new Error('Your apiHost must start with "http"');
|
|
346
|
-
}
|
|
347
|
-
if (apiHost.indexOf("/", 8) > -1) {
|
|
348
|
-
throw new Error("Your apiHost must not contain a path element after the domain");
|
|
349
|
-
}
|
|
350
|
-
if (apiHost.indexOf("?") > -1) {
|
|
351
|
-
throw new Error("Your apiHost must not contain a query string");
|
|
352
|
-
}
|
|
353
|
-
if (apiHost == null ? void 0 : apiHost.endsWith("/")) {
|
|
354
|
-
apiHost = apiHost.substring(0, apiHost.length - 1);
|
|
355
|
-
}
|
|
356
|
-
return apiHost;
|
|
357
|
-
}
|
|
358
|
-
static getRequestId(response) {
|
|
359
|
-
const apigRequestId = response.headers.get("apigw-requestid");
|
|
360
|
-
if (apigRequestId) {
|
|
361
|
-
return apigRequestId;
|
|
362
|
-
}
|
|
363
|
-
return void 0;
|
|
364
|
-
}
|
|
365
|
-
};
|
|
366
|
-
async function handleRateLimits(callApi) {
|
|
367
|
-
var _a;
|
|
368
|
-
const backoffRetries = 5;
|
|
369
|
-
let backoffRetriesLeft = backoffRetries;
|
|
370
|
-
let response;
|
|
371
|
-
while (backoffRetriesLeft > 0) {
|
|
372
|
-
response = await callApi();
|
|
373
|
-
if (response.status !== 429) {
|
|
374
|
-
break;
|
|
375
|
-
}
|
|
376
|
-
let resetWait = 0;
|
|
377
|
-
try {
|
|
378
|
-
const responseClone = response.clone();
|
|
379
|
-
const dateHeader = responseClone.headers.get("date");
|
|
380
|
-
const serverTime = dateHeader ? new Date(dateHeader).getTime() : void 0;
|
|
381
|
-
const body = await responseClone.json();
|
|
382
|
-
const resetTime = (_a = body == null ? void 0 : body.info) == null ? void 0 : _a.reset;
|
|
383
|
-
if (typeof serverTime === "number" && typeof resetTime === "number") {
|
|
384
|
-
resetWait = Math.max(0, Math.min(Math.round(1.1 * (resetTime - serverTime)), 1e4));
|
|
385
|
-
}
|
|
386
|
-
} catch (e) {
|
|
387
|
-
}
|
|
388
|
-
const base = Math.pow(2, backoffRetries - backoffRetriesLeft) * 333;
|
|
389
|
-
const backoffWait = base + Math.round(Math.random() * (base / 2)) * (Math.random() > 0.5 ? 1 : -1);
|
|
390
|
-
await new Promise((resolve) => setTimeout(resolve, Math.max(0, resetWait + backoffWait)));
|
|
391
|
-
backoffRetriesLeft -= 1;
|
|
392
|
-
}
|
|
393
|
-
return response;
|
|
394
|
-
}
|
|
395
|
-
var isPlainObject = (obj) => typeof obj === "object" && obj !== null && !Array.isArray(obj);
|
|
396
|
-
function rewriteFiltersForApi(filters) {
|
|
397
|
-
return Object.entries(filters != null ? filters : {}).reduce(
|
|
398
|
-
(acc, [key, value]) => {
|
|
399
|
-
const lhs = `filters.${key}` + (isPlainObject(value) ? `[${Object.keys(value)[0]}]` : "");
|
|
400
|
-
const rhs = isPlainObject(value) ? Object.values(value)[0] : value;
|
|
401
|
-
return {
|
|
402
|
-
...acc,
|
|
403
|
-
[lhs]: Array.isArray(rhs) ? rhs.map((v) => `${v}`.trim()).join(",") : `${rhs}`.trim()
|
|
404
|
-
};
|
|
405
|
-
},
|
|
406
|
-
{}
|
|
407
|
-
);
|
|
408
|
-
}
|
|
409
|
-
var _url;
|
|
410
|
-
var _AggregateClient = class _AggregateClient2 extends ApiClient {
|
|
411
|
-
constructor(options) {
|
|
412
|
-
super(options);
|
|
413
|
-
}
|
|
414
|
-
/** Fetches all aggregates for a project */
|
|
415
|
-
async get(options) {
|
|
416
|
-
const { projectId } = this.options;
|
|
417
|
-
const fetchUri = this.createUrl(__privateGet(_AggregateClient2, _url), { ...options, projectId });
|
|
418
|
-
return await this.apiClient(fetchUri);
|
|
419
|
-
}
|
|
420
|
-
/** Updates or creates (based on id) an Aggregate */
|
|
421
|
-
async upsert(body) {
|
|
422
|
-
const fetchUri = this.createUrl(__privateGet(_AggregateClient2, _url));
|
|
423
|
-
await this.apiClient(fetchUri, {
|
|
424
|
-
method: "PUT",
|
|
425
|
-
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
426
|
-
expectNoContent: true
|
|
427
|
-
});
|
|
428
|
-
}
|
|
429
|
-
/** Deletes an Aggregate */
|
|
430
|
-
async remove(body) {
|
|
431
|
-
const fetchUri = this.createUrl(__privateGet(_AggregateClient2, _url));
|
|
432
|
-
await this.apiClient(fetchUri, {
|
|
433
|
-
method: "DELETE",
|
|
434
|
-
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
435
|
-
expectNoContent: true
|
|
436
|
-
});
|
|
437
|
-
}
|
|
438
|
-
};
|
|
439
|
-
_url = /* @__PURE__ */ new WeakMap();
|
|
440
|
-
__privateAdd(_AggregateClient, _url, "/api/v2/aggregate");
|
|
441
|
-
var _url2;
|
|
442
|
-
var _DimensionClient = class _DimensionClient2 extends ApiClient {
|
|
443
|
-
constructor(options) {
|
|
444
|
-
super(options);
|
|
445
|
-
}
|
|
446
|
-
/** Fetches the known score dimensions for a project */
|
|
447
|
-
async get(options) {
|
|
448
|
-
const { projectId } = this.options;
|
|
449
|
-
const fetchUri = this.createUrl(__privateGet(_DimensionClient2, _url2), { ...options, projectId });
|
|
450
|
-
return await this.apiClient(fetchUri);
|
|
451
|
-
}
|
|
452
|
-
};
|
|
453
|
-
_url2 = /* @__PURE__ */ new WeakMap();
|
|
454
|
-
__privateAdd(_DimensionClient, _url2, "/api/v2/dimension");
|
|
455
|
-
var _url3;
|
|
456
|
-
var _valueUrl;
|
|
457
|
-
var _EnrichmentClient = class _EnrichmentClient2 extends ApiClient {
|
|
458
|
-
constructor(options) {
|
|
459
|
-
super(options);
|
|
460
|
-
}
|
|
461
|
-
/** Fetches all enrichments and values for a project, grouped by category */
|
|
462
|
-
async get(options) {
|
|
463
|
-
const { projectId } = this.options;
|
|
464
|
-
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _url3), { ...options, projectId });
|
|
465
|
-
return await this.apiClient(fetchUri);
|
|
466
|
-
}
|
|
467
|
-
/** Updates or creates (based on id) an enrichment category */
|
|
468
|
-
async upsertCategory(body) {
|
|
469
|
-
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _url3));
|
|
470
|
-
await this.apiClient(fetchUri, {
|
|
471
|
-
method: "PUT",
|
|
472
|
-
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
473
|
-
expectNoContent: true
|
|
474
|
-
});
|
|
475
|
-
}
|
|
476
|
-
/** Deletes an enrichment category */
|
|
477
|
-
async removeCategory(body) {
|
|
478
|
-
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _url3));
|
|
479
|
-
await this.apiClient(fetchUri, {
|
|
480
|
-
method: "DELETE",
|
|
481
|
-
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
482
|
-
expectNoContent: true
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
/** Updates or creates (based on id) an enrichment value within an enrichment category */
|
|
486
|
-
async upsertValue(body) {
|
|
487
|
-
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _valueUrl));
|
|
488
|
-
await this.apiClient(fetchUri, {
|
|
489
|
-
method: "PUT",
|
|
490
|
-
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
491
|
-
expectNoContent: true
|
|
492
|
-
});
|
|
493
|
-
}
|
|
494
|
-
/** Deletes an enrichment value within an enrichment category. The category is left alone. */
|
|
495
|
-
async removeValue(body) {
|
|
496
|
-
const fetchUri = this.createUrl(__privateGet(_EnrichmentClient2, _valueUrl));
|
|
497
|
-
await this.apiClient(fetchUri, {
|
|
498
|
-
method: "DELETE",
|
|
499
|
-
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
500
|
-
expectNoContent: true
|
|
501
|
-
});
|
|
502
|
-
}
|
|
503
|
-
};
|
|
504
|
-
_url3 = /* @__PURE__ */ new WeakMap();
|
|
505
|
-
_valueUrl = /* @__PURE__ */ new WeakMap();
|
|
506
|
-
__privateAdd(_EnrichmentClient, _url3, "/api/v1/enrichments");
|
|
507
|
-
__privateAdd(_EnrichmentClient, _valueUrl, "/api/v1/enrichment-values");
|
|
508
|
-
var _url4;
|
|
509
|
-
var _ManifestClient = class _ManifestClient2 extends ApiClient {
|
|
510
|
-
constructor(options) {
|
|
511
|
-
super(options);
|
|
512
|
-
}
|
|
513
|
-
/** Fetches the Context manifest for a project */
|
|
514
|
-
async get(options) {
|
|
515
|
-
const { projectId } = this.options;
|
|
516
|
-
const fetchUri = this.createUrl(__privateGet(_ManifestClient2, _url4), { ...options, projectId });
|
|
517
|
-
return await this.apiClient(fetchUri);
|
|
518
|
-
}
|
|
519
|
-
/** Publishes the Context manifest for a project */
|
|
520
|
-
async publish() {
|
|
521
|
-
const { projectId } = this.options;
|
|
522
|
-
const fetchUri = this.createUrl("/api/v1/publish", { siteId: projectId });
|
|
523
|
-
await this.apiClient(fetchUri, {
|
|
524
|
-
method: "POST",
|
|
525
|
-
expectNoContent: true
|
|
526
|
-
});
|
|
527
|
-
}
|
|
528
|
-
};
|
|
529
|
-
_url4 = /* @__PURE__ */ new WeakMap();
|
|
530
|
-
__privateAdd(_ManifestClient, _url4, "/api/v2/manifest");
|
|
531
|
-
var _url5;
|
|
532
|
-
var _QuirkClient = class _QuirkClient2 extends ApiClient {
|
|
533
|
-
constructor(options) {
|
|
534
|
-
super(options);
|
|
535
|
-
}
|
|
536
|
-
/** Fetches all Quirks for a project */
|
|
537
|
-
async get(options) {
|
|
538
|
-
const { projectId } = this.options;
|
|
539
|
-
const fetchUri = this.createUrl(__privateGet(_QuirkClient2, _url5), { ...options, projectId });
|
|
540
|
-
return await this.apiClient(fetchUri);
|
|
541
|
-
}
|
|
542
|
-
/** Updates or creates (based on id) a Quirk */
|
|
543
|
-
async upsert(body) {
|
|
544
|
-
const fetchUri = this.createUrl(__privateGet(_QuirkClient2, _url5));
|
|
545
|
-
await this.apiClient(fetchUri, {
|
|
546
|
-
method: "PUT",
|
|
547
|
-
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
548
|
-
expectNoContent: true
|
|
549
|
-
});
|
|
550
|
-
}
|
|
551
|
-
/** Deletes a Quirk */
|
|
552
|
-
async remove(body) {
|
|
553
|
-
const fetchUri = this.createUrl(__privateGet(_QuirkClient2, _url5));
|
|
554
|
-
await this.apiClient(fetchUri, {
|
|
555
|
-
method: "DELETE",
|
|
556
|
-
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
557
|
-
expectNoContent: true
|
|
558
|
-
});
|
|
559
|
-
}
|
|
560
|
-
};
|
|
561
|
-
_url5 = /* @__PURE__ */ new WeakMap();
|
|
562
|
-
__privateAdd(_QuirkClient, _url5, "/api/v2/quirk");
|
|
563
|
-
var _url6;
|
|
564
|
-
var _SignalClient = class _SignalClient2 extends ApiClient {
|
|
565
|
-
constructor(options) {
|
|
566
|
-
super(options);
|
|
567
|
-
}
|
|
568
|
-
/** Fetches all Signals for a project */
|
|
569
|
-
async get(options) {
|
|
570
|
-
const { projectId } = this.options;
|
|
571
|
-
const fetchUri = this.createUrl(__privateGet(_SignalClient2, _url6), { ...options, projectId });
|
|
572
|
-
return await this.apiClient(fetchUri);
|
|
573
|
-
}
|
|
574
|
-
/** Updates or creates (based on id) a Signal */
|
|
575
|
-
async upsert(body) {
|
|
576
|
-
const fetchUri = this.createUrl(__privateGet(_SignalClient2, _url6));
|
|
577
|
-
await this.apiClient(fetchUri, {
|
|
578
|
-
method: "PUT",
|
|
579
|
-
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
580
|
-
expectNoContent: true
|
|
581
|
-
});
|
|
582
|
-
}
|
|
583
|
-
/** Deletes a Signal */
|
|
584
|
-
async remove(body) {
|
|
585
|
-
const fetchUri = this.createUrl(__privateGet(_SignalClient2, _url6));
|
|
586
|
-
await this.apiClient(fetchUri, {
|
|
587
|
-
method: "DELETE",
|
|
588
|
-
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
589
|
-
expectNoContent: true
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
|
-
};
|
|
593
|
-
_url6 = /* @__PURE__ */ new WeakMap();
|
|
594
|
-
__privateAdd(_SignalClient, _url6, "/api/v2/signal");
|
|
595
|
-
var _url7;
|
|
596
|
-
var _TestClient = class _TestClient2 extends ApiClient {
|
|
597
|
-
constructor(options) {
|
|
598
|
-
super(options);
|
|
599
|
-
}
|
|
600
|
-
/** Fetches all Tests for a project */
|
|
601
|
-
async get(options) {
|
|
602
|
-
const { projectId } = this.options;
|
|
603
|
-
const fetchUri = this.createUrl(__privateGet(_TestClient2, _url7), { ...options, projectId });
|
|
604
|
-
return await this.apiClient(fetchUri);
|
|
605
|
-
}
|
|
606
|
-
/** Updates or creates (based on id) a Test */
|
|
607
|
-
async upsert(body) {
|
|
608
|
-
const fetchUri = this.createUrl(__privateGet(_TestClient2, _url7));
|
|
609
|
-
await this.apiClient(fetchUri, {
|
|
610
|
-
method: "PUT",
|
|
611
|
-
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
612
|
-
expectNoContent: true
|
|
613
|
-
});
|
|
614
|
-
}
|
|
615
|
-
/** Deletes a Test */
|
|
616
|
-
async remove(body) {
|
|
617
|
-
const fetchUri = this.createUrl(__privateGet(_TestClient2, _url7));
|
|
618
|
-
await this.apiClient(fetchUri, {
|
|
619
|
-
method: "DELETE",
|
|
620
|
-
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
621
|
-
expectNoContent: true
|
|
622
|
-
});
|
|
623
|
-
}
|
|
624
|
-
};
|
|
625
|
-
_url7 = /* @__PURE__ */ new WeakMap();
|
|
626
|
-
__privateAdd(_TestClient, _url7, "/api/v2/test");
|
|
627
|
-
|
|
628
|
-
// ../canvas/dist/index.mjs
|
|
629
|
-
var __typeError2 = (msg) => {
|
|
630
|
-
throw TypeError(msg);
|
|
631
|
-
};
|
|
632
|
-
var __accessCheck2 = (obj, member, msg) => member.has(obj) || __typeError2("Cannot " + msg);
|
|
633
|
-
var __privateGet2 = (obj, member, getter) => (__accessCheck2(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
634
|
-
var __privateAdd2 = (obj, member, value) => member.has(obj) ? __typeError2("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
635
106
|
var SELECT_QUERY_PREFIX = "select.";
|
|
636
107
|
function appendCsv(out, key, values) {
|
|
637
108
|
if (values === void 0) {
|
|
@@ -682,7 +153,7 @@ var CANVAS_HYPOTHESIS_PARAM = `${CANVAS_INTERNAL_PARAM_PREFIX}hypothesis`;
|
|
|
682
153
|
var EDGE_MAX_CACHE_TTL = 24 * 60 * 60;
|
|
683
154
|
var _contentTypesUrl;
|
|
684
155
|
var _entriesUrl;
|
|
685
|
-
var _ContentClient = class _ContentClient2 extends
|
|
156
|
+
var _ContentClient = class _ContentClient2 extends ApiClient4 {
|
|
686
157
|
constructor(options) {
|
|
687
158
|
var _a;
|
|
688
159
|
super(options);
|
|
@@ -690,16 +161,16 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
690
161
|
}
|
|
691
162
|
getContentTypes(options) {
|
|
692
163
|
const { projectId } = this.options;
|
|
693
|
-
const fetchUri = this.createUrl(
|
|
164
|
+
const fetchUri = this.createUrl(__privateGet(_ContentClient2, _contentTypesUrl), { ...options, projectId });
|
|
694
165
|
return this.apiClient(fetchUri);
|
|
695
166
|
}
|
|
696
167
|
getEntries(options) {
|
|
697
168
|
const { projectId } = this.options;
|
|
698
169
|
const { skipDataResolution, filters, select, ...params } = options;
|
|
699
|
-
const rewrittenFilters =
|
|
170
|
+
const rewrittenFilters = rewriteFiltersForApi6(filters);
|
|
700
171
|
const rewrittenSelect = projectionToQuery(select);
|
|
701
172
|
if (skipDataResolution) {
|
|
702
|
-
const url = this.createUrl(
|
|
173
|
+
const url = this.createUrl(__privateGet(_ContentClient2, _entriesUrl), {
|
|
703
174
|
...params,
|
|
704
175
|
...rewrittenFilters,
|
|
705
176
|
...rewrittenSelect,
|
|
@@ -708,7 +179,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
708
179
|
return this.apiClient(url);
|
|
709
180
|
}
|
|
710
181
|
const edgeUrl = this.createUrl(
|
|
711
|
-
|
|
182
|
+
__privateGet(_ContentClient2, _entriesUrl),
|
|
712
183
|
{ ...this.getEdgeOptions(params), ...rewrittenFilters, ...rewrittenSelect },
|
|
713
184
|
this.edgeApiHost
|
|
714
185
|
);
|
|
@@ -726,7 +197,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
726
197
|
return this.apiClient(historyUrl);
|
|
727
198
|
}
|
|
728
199
|
async upsertContentType(body, opts = {}) {
|
|
729
|
-
const fetchUri = this.createUrl(
|
|
200
|
+
const fetchUri = this.createUrl(__privateGet(_ContentClient2, _contentTypesUrl));
|
|
730
201
|
if (typeof body.contentType.slugSettings === "object" && body.contentType.slugSettings !== null && Object.keys(body.contentType.slugSettings).length === 0) {
|
|
731
202
|
delete body.contentType.slugSettings;
|
|
732
203
|
}
|
|
@@ -738,7 +209,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
738
209
|
});
|
|
739
210
|
}
|
|
740
211
|
async upsertEntry(body, options) {
|
|
741
|
-
const fetchUri = this.createUrl(
|
|
212
|
+
const fetchUri = this.createUrl(__privateGet(_ContentClient2, _entriesUrl));
|
|
742
213
|
const headers = {};
|
|
743
214
|
if (options == null ? void 0 : options.ifUnmodifiedSince) {
|
|
744
215
|
headers["x-if-unmodified-since"] = options.ifUnmodifiedSince;
|
|
@@ -752,7 +223,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
752
223
|
return { modified: response.headers.get("x-modified-at") };
|
|
753
224
|
}
|
|
754
225
|
async deleteContentType(body) {
|
|
755
|
-
const fetchUri = this.createUrl(
|
|
226
|
+
const fetchUri = this.createUrl(__privateGet(_ContentClient2, _contentTypesUrl));
|
|
756
227
|
await this.apiClient(fetchUri, {
|
|
757
228
|
method: "DELETE",
|
|
758
229
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -760,7 +231,7 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
760
231
|
});
|
|
761
232
|
}
|
|
762
233
|
async deleteEntry(body) {
|
|
763
|
-
const fetchUri = this.createUrl(
|
|
234
|
+
const fetchUri = this.createUrl(__privateGet(_ContentClient2, _entriesUrl));
|
|
764
235
|
await this.apiClient(fetchUri, {
|
|
765
236
|
method: "DELETE",
|
|
766
237
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -779,17 +250,17 @@ var _ContentClient = class _ContentClient2 extends ApiClient {
|
|
|
779
250
|
};
|
|
780
251
|
_contentTypesUrl = /* @__PURE__ */ new WeakMap();
|
|
781
252
|
_entriesUrl = /* @__PURE__ */ new WeakMap();
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
var
|
|
785
|
-
var _DataTypeClient = class _DataTypeClient2 extends
|
|
253
|
+
__privateAdd(_ContentClient, _contentTypesUrl, "/api/v1/content-types");
|
|
254
|
+
__privateAdd(_ContentClient, _entriesUrl, "/api/v1/entries");
|
|
255
|
+
var _url;
|
|
256
|
+
var _DataTypeClient = class _DataTypeClient2 extends ApiClient6 {
|
|
786
257
|
constructor(options) {
|
|
787
258
|
super(options);
|
|
788
259
|
}
|
|
789
260
|
/** Fetches a list of DataTypes for a project */
|
|
790
261
|
async list(options) {
|
|
791
262
|
const { projectId } = this.options;
|
|
792
|
-
const fetchUri = this.createUrl(
|
|
263
|
+
const fetchUri = this.createUrl(__privateGet(_DataTypeClient2, _url), { ...options, projectId });
|
|
793
264
|
return await this.apiClient(fetchUri);
|
|
794
265
|
}
|
|
795
266
|
/** @deprecated Use {@link list} instead. */
|
|
@@ -798,7 +269,7 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
798
269
|
}
|
|
799
270
|
/** Updates or creates (based on id) a DataType */
|
|
800
271
|
async save(body) {
|
|
801
|
-
const fetchUri = this.createUrl(
|
|
272
|
+
const fetchUri = this.createUrl(__privateGet(_DataTypeClient2, _url));
|
|
802
273
|
await this.apiClient(fetchUri, {
|
|
803
274
|
method: "PUT",
|
|
804
275
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -811,7 +282,7 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
811
282
|
}
|
|
812
283
|
/** Deletes a DataType */
|
|
813
284
|
async remove(body) {
|
|
814
|
-
const fetchUri = this.createUrl(
|
|
285
|
+
const fetchUri = this.createUrl(__privateGet(_DataTypeClient2, _url));
|
|
815
286
|
await this.apiClient(fetchUri, {
|
|
816
287
|
method: "DELETE",
|
|
817
288
|
body: JSON.stringify({ ...body, projectId: this.options.projectId }),
|
|
@@ -819,10 +290,10 @@ var _DataTypeClient = class _DataTypeClient2 extends ApiClient {
|
|
|
819
290
|
});
|
|
820
291
|
}
|
|
821
292
|
};
|
|
822
|
-
|
|
823
|
-
|
|
293
|
+
_url = /* @__PURE__ */ new WeakMap();
|
|
294
|
+
__privateAdd(_DataTypeClient, _url, "/api/v1/data-types");
|
|
824
295
|
var _baseUrl;
|
|
825
|
-
var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2 extends
|
|
296
|
+
var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2 extends ApiClient8 {
|
|
826
297
|
constructor(options) {
|
|
827
298
|
super(options);
|
|
828
299
|
this.teamId = options.teamId;
|
|
@@ -831,7 +302,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
831
302
|
* Gets a list of property type and hook names for the current team, including public integrations' hooks.
|
|
832
303
|
*/
|
|
833
304
|
get(options) {
|
|
834
|
-
const fetchUri = this.createUrl(
|
|
305
|
+
const fetchUri = this.createUrl(__privateGet(_IntegrationPropertyEditorsClient2, _baseUrl), {
|
|
835
306
|
...options,
|
|
836
307
|
teamId: this.teamId
|
|
837
308
|
});
|
|
@@ -841,7 +312,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
841
312
|
* Creates or updates a custom AI property editor on a Mesh app.
|
|
842
313
|
*/
|
|
843
314
|
async deploy(body) {
|
|
844
|
-
const fetchUri = this.createUrl(
|
|
315
|
+
const fetchUri = this.createUrl(__privateGet(_IntegrationPropertyEditorsClient2, _baseUrl));
|
|
845
316
|
await this.apiClient(fetchUri, {
|
|
846
317
|
method: "PUT",
|
|
847
318
|
body: JSON.stringify({ ...body, teamId: this.teamId }),
|
|
@@ -852,7 +323,7 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
852
323
|
* Removes a custom AI property editor from a Mesh app.
|
|
853
324
|
*/
|
|
854
325
|
async delete(body) {
|
|
855
|
-
const fetchUri = this.createUrl(
|
|
326
|
+
const fetchUri = this.createUrl(__privateGet(_IntegrationPropertyEditorsClient2, _baseUrl));
|
|
856
327
|
await this.apiClient(fetchUri, {
|
|
857
328
|
method: "DELETE",
|
|
858
329
|
body: JSON.stringify({ ...body, teamId: this.teamId }),
|
|
@@ -861,16 +332,16 @@ var _IntegrationPropertyEditorsClient = class _IntegrationPropertyEditorsClient2
|
|
|
861
332
|
}
|
|
862
333
|
};
|
|
863
334
|
_baseUrl = /* @__PURE__ */ new WeakMap();
|
|
864
|
-
|
|
865
|
-
var
|
|
335
|
+
__privateAdd(_IntegrationPropertyEditorsClient, _baseUrl, "/api/v1/integration-property-editors");
|
|
336
|
+
var _url2;
|
|
866
337
|
var _projectsUrl;
|
|
867
|
-
var _ProjectClient = class _ProjectClient2 extends
|
|
338
|
+
var _ProjectClient = class _ProjectClient2 extends ApiClient12 {
|
|
868
339
|
constructor(options) {
|
|
869
340
|
super({ ...options, bypassCache: true });
|
|
870
341
|
}
|
|
871
342
|
/** Fetches single Project */
|
|
872
343
|
async get(options) {
|
|
873
|
-
const fetchUri = this.createUrl(
|
|
344
|
+
const fetchUri = this.createUrl(__privateGet(_ProjectClient2, _url2), { ...options });
|
|
874
345
|
return await this.apiClient(fetchUri);
|
|
875
346
|
}
|
|
876
347
|
/**
|
|
@@ -879,7 +350,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
879
350
|
* When omitted, returns all accessible teams and their projects.
|
|
880
351
|
*/
|
|
881
352
|
async list(options) {
|
|
882
|
-
const fetchUri = this.createUrl(
|
|
353
|
+
const fetchUri = this.createUrl(__privateGet(_ProjectClient2, _projectsUrl), options ? { ...options } : {});
|
|
883
354
|
return await this.apiClient(fetchUri);
|
|
884
355
|
}
|
|
885
356
|
/** @deprecated Use {@link list} instead. */
|
|
@@ -888,7 +359,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
888
359
|
}
|
|
889
360
|
/** Updates or creates (based on id) a Project */
|
|
890
361
|
async save(body) {
|
|
891
|
-
const fetchUri = this.createUrl(
|
|
362
|
+
const fetchUri = this.createUrl(__privateGet(_ProjectClient2, _url2));
|
|
892
363
|
return await this.apiClient(fetchUri, {
|
|
893
364
|
method: "PUT",
|
|
894
365
|
body: JSON.stringify({ ...body })
|
|
@@ -900,7 +371,7 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
900
371
|
}
|
|
901
372
|
/** Deletes a Project */
|
|
902
373
|
async remove(body) {
|
|
903
|
-
const fetchUri = this.createUrl(
|
|
374
|
+
const fetchUri = this.createUrl(__privateGet(_ProjectClient2, _url2));
|
|
904
375
|
await this.apiClient(fetchUri, {
|
|
905
376
|
method: "DELETE",
|
|
906
377
|
body: JSON.stringify({ ...body }),
|
|
@@ -912,10 +383,10 @@ var _ProjectClient = class _ProjectClient2 extends ApiClient {
|
|
|
912
383
|
return this.remove(body);
|
|
913
384
|
}
|
|
914
385
|
};
|
|
915
|
-
|
|
386
|
+
_url2 = /* @__PURE__ */ new WeakMap();
|
|
916
387
|
_projectsUrl = /* @__PURE__ */ new WeakMap();
|
|
917
|
-
|
|
918
|
-
|
|
388
|
+
__privateAdd(_ProjectClient, _url2, "/api/v1/project");
|
|
389
|
+
__privateAdd(_ProjectClient, _projectsUrl, "/api/v1/projects");
|
|
919
390
|
var ATTRIBUTE_COMPONENT_ID = "data-uniform-component-id";
|
|
920
391
|
var ATTRIBUTE_PARAMETER_ID = "data-uniform-parameter-id";
|
|
921
392
|
var ATTRIBUTE_PARAMETER_TYPE = "data-uniform-parameter-type";
|
|
@@ -925,14 +396,14 @@ import {
|
|
|
925
396
|
isRichTextValue,
|
|
926
397
|
isRichTextValueConsideredEmpty
|
|
927
398
|
} from "@uniformdev/richtext";
|
|
928
|
-
import
|
|
399
|
+
import React13 from "react";
|
|
929
400
|
|
|
930
401
|
// src/components/UniformRichTextNode.tsx
|
|
931
402
|
import { isRichTextNode } from "@uniformdev/richtext";
|
|
932
|
-
import
|
|
403
|
+
import React12 from "react";
|
|
933
404
|
|
|
934
405
|
// src/components/nodes/AssetRichTextNode.tsx
|
|
935
|
-
import
|
|
406
|
+
import React2 from "react";
|
|
936
407
|
var AssetRichTextNode = ({ node }) => {
|
|
937
408
|
var _a, _b;
|
|
938
409
|
const { __asset } = node;
|
|
@@ -940,46 +411,46 @@ var AssetRichTextNode = ({ node }) => {
|
|
|
940
411
|
return null;
|
|
941
412
|
}
|
|
942
413
|
if (__asset.type === "image") {
|
|
943
|
-
return /* @__PURE__ */
|
|
414
|
+
return /* @__PURE__ */ React2.createElement("figure", null, /* @__PURE__ */ React2.createElement("img", { src: __asset.fields.url.value, alt: (_a = __asset.fields.title) == null ? void 0 : _a.value }), ((_b = __asset.fields.description) == null ? void 0 : _b.value) ? /* @__PURE__ */ React2.createElement("figcaption", null, __asset.fields.description.value) : null);
|
|
944
415
|
}
|
|
945
416
|
if (__asset.type === "video") {
|
|
946
|
-
return /* @__PURE__ */
|
|
417
|
+
return /* @__PURE__ */ React2.createElement("video", { src: __asset.fields.url.value, controls: true });
|
|
947
418
|
}
|
|
948
419
|
if (__asset.type === "audio") {
|
|
949
|
-
return /* @__PURE__ */
|
|
420
|
+
return /* @__PURE__ */ React2.createElement("audio", { src: __asset.fields.url.value, controls: true });
|
|
950
421
|
}
|
|
951
422
|
return null;
|
|
952
423
|
};
|
|
953
424
|
|
|
954
425
|
// src/components/nodes/HeadingRichTextNode.tsx
|
|
955
|
-
import
|
|
426
|
+
import React3 from "react";
|
|
956
427
|
var HeadingRichTextNode = ({ children, node }) => {
|
|
957
428
|
const { tag } = node;
|
|
958
429
|
const HTag = tag != null ? tag : "h1";
|
|
959
|
-
return /* @__PURE__ */
|
|
430
|
+
return /* @__PURE__ */ React3.createElement(HTag, null, children);
|
|
960
431
|
};
|
|
961
432
|
|
|
962
433
|
// src/components/nodes/LinebreakRichTextNode.tsx
|
|
963
|
-
import
|
|
434
|
+
import React4 from "react";
|
|
964
435
|
var LinebreakRichTextNode = () => {
|
|
965
|
-
return /* @__PURE__ */
|
|
436
|
+
return /* @__PURE__ */ React4.createElement("br", null);
|
|
966
437
|
};
|
|
967
438
|
|
|
968
439
|
// src/components/nodes/LinkRichTextNode.tsx
|
|
969
440
|
import { linkParamValueToAnchorProps } from "@uniformdev/richtext";
|
|
970
|
-
import
|
|
441
|
+
import React5 from "react";
|
|
971
442
|
var LinkRichTextNode = ({ children, node }) => {
|
|
972
443
|
const { link } = node;
|
|
973
|
-
return /* @__PURE__ */
|
|
444
|
+
return /* @__PURE__ */ React5.createElement("a", { ...linkParamValueToAnchorProps(link) }, children);
|
|
974
445
|
};
|
|
975
446
|
|
|
976
447
|
// src/components/nodes/ListItemRichTextNode.tsx
|
|
977
448
|
import { getRichTextListItemValue } from "@uniformdev/richtext";
|
|
978
|
-
import
|
|
449
|
+
import React6 from "react";
|
|
979
450
|
var ListItemRichTextNode = ({ children, node }) => {
|
|
980
451
|
const { value } = node;
|
|
981
452
|
const normalizedValue = getRichTextListItemValue(value);
|
|
982
|
-
return /* @__PURE__ */
|
|
453
|
+
return /* @__PURE__ */ React6.createElement(
|
|
983
454
|
"li",
|
|
984
455
|
{
|
|
985
456
|
value: typeof normalizedValue === "number" && Number.isFinite(normalizedValue) && normalizedValue > 0 ? normalizedValue : void 0
|
|
@@ -990,12 +461,12 @@ var ListItemRichTextNode = ({ children, node }) => {
|
|
|
990
461
|
|
|
991
462
|
// src/components/nodes/ListRichTextNode.tsx
|
|
992
463
|
import { getRichTextListStart } from "@uniformdev/richtext";
|
|
993
|
-
import
|
|
464
|
+
import React7 from "react";
|
|
994
465
|
var ListRichTextNode = ({ children, node }) => {
|
|
995
466
|
const { tag, start } = node;
|
|
996
467
|
const ListTag = tag != null ? tag : "ul";
|
|
997
468
|
const normalizedStart = getRichTextListStart(start);
|
|
998
|
-
return /* @__PURE__ */
|
|
469
|
+
return /* @__PURE__ */ React7.createElement(
|
|
999
470
|
ListTag,
|
|
1000
471
|
{
|
|
1001
472
|
start: typeof normalizedStart === "number" && Number.isFinite(normalizedStart) && normalizedStart > 0 ? normalizedStart : void 0
|
|
@@ -1006,10 +477,10 @@ var ListRichTextNode = ({ children, node }) => {
|
|
|
1006
477
|
|
|
1007
478
|
// src/components/nodes/ParagraphRichTextNode.tsx
|
|
1008
479
|
import { isPureDirection, isPureTextAlign } from "@uniformdev/richtext";
|
|
1009
|
-
import
|
|
480
|
+
import React8 from "react";
|
|
1010
481
|
var ParagraphRichTextNode = ({ children, node }) => {
|
|
1011
482
|
const { format, direction } = node;
|
|
1012
|
-
return /* @__PURE__ */
|
|
483
|
+
return /* @__PURE__ */ React8.createElement(
|
|
1013
484
|
"p",
|
|
1014
485
|
{
|
|
1015
486
|
dir: isPureDirection(direction) ? direction : void 0,
|
|
@@ -1021,26 +492,26 @@ var ParagraphRichTextNode = ({ children, node }) => {
|
|
|
1021
492
|
|
|
1022
493
|
// src/components/nodes/TableCellRichTextNode.tsx
|
|
1023
494
|
import { getRichTextTagFromTableCellHeaderState } from "@uniformdev/richtext";
|
|
1024
|
-
import
|
|
495
|
+
import React9 from "react";
|
|
1025
496
|
var TableCellRichTextNode = ({ children, node }) => {
|
|
1026
497
|
const { headerState } = node;
|
|
1027
498
|
const TableCellTag = getRichTextTagFromTableCellHeaderState(headerState);
|
|
1028
|
-
return /* @__PURE__ */
|
|
499
|
+
return /* @__PURE__ */ React9.createElement(TableCellTag, null, children);
|
|
1029
500
|
};
|
|
1030
501
|
|
|
1031
502
|
// src/components/nodes/TabRichTextNode.tsx
|
|
1032
|
-
import
|
|
503
|
+
import React10 from "react";
|
|
1033
504
|
var TabRichTextNode = () => {
|
|
1034
|
-
return /* @__PURE__ */
|
|
505
|
+
return /* @__PURE__ */ React10.createElement(React10.Fragment, null, " ");
|
|
1035
506
|
};
|
|
1036
507
|
|
|
1037
508
|
// src/components/nodes/TextRichTextNode.tsx
|
|
1038
509
|
import { getRichTextTagsFromTextFormat } from "@uniformdev/richtext";
|
|
1039
|
-
import
|
|
510
|
+
import React11 from "react";
|
|
1040
511
|
var TextRichTextNode = ({ node }) => {
|
|
1041
512
|
const { text, format } = node;
|
|
1042
513
|
const tags = getRichTextTagsFromTextFormat(format);
|
|
1043
|
-
return /* @__PURE__ */
|
|
514
|
+
return /* @__PURE__ */ React11.createElement(React11.Fragment, null, tags.length > 0 ? tags.reduceRight((children, Tag) => /* @__PURE__ */ React11.createElement(Tag, null, children), text) : text);
|
|
1044
515
|
};
|
|
1045
516
|
|
|
1046
517
|
// src/components/UniformRichTextNode.tsx
|
|
@@ -1054,8 +525,8 @@ function UniformRichTextNode({ node, ...props }) {
|
|
|
1054
525
|
if (!NodeRenderer) {
|
|
1055
526
|
return null;
|
|
1056
527
|
}
|
|
1057
|
-
const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */
|
|
1058
|
-
return /* @__PURE__ */
|
|
528
|
+
const children = node.children ? node.children.map((childNode, i) => /* @__PURE__ */ React12.createElement(UniformRichTextNode, { ...props, key: i, node: childNode })) : null;
|
|
529
|
+
return /* @__PURE__ */ React12.createElement(NodeRenderer, { node }, children);
|
|
1059
530
|
}
|
|
1060
531
|
var rendererMap = /* @__PURE__ */ new Map([
|
|
1061
532
|
["heading", HeadingRichTextNode],
|
|
@@ -1064,19 +535,19 @@ var rendererMap = /* @__PURE__ */ new Map([
|
|
|
1064
535
|
["list", ListRichTextNode],
|
|
1065
536
|
["listitem", ListItemRichTextNode],
|
|
1066
537
|
["paragraph", ParagraphRichTextNode],
|
|
1067
|
-
["quote", ({ children }) => /* @__PURE__ */
|
|
538
|
+
["quote", ({ children }) => /* @__PURE__ */ React12.createElement("blockquote", null, children)],
|
|
1068
539
|
[
|
|
1069
540
|
"code",
|
|
1070
|
-
({ children }) => /* @__PURE__ */
|
|
541
|
+
({ children }) => /* @__PURE__ */ React12.createElement("pre", null, /* @__PURE__ */ React12.createElement("code", null, children))
|
|
1071
542
|
],
|
|
1072
|
-
["root", ({ children }) => /* @__PURE__ */
|
|
543
|
+
["root", ({ children }) => /* @__PURE__ */ React12.createElement(React12.Fragment, null, children)],
|
|
1073
544
|
["text", TextRichTextNode],
|
|
1074
545
|
["tab", TabRichTextNode],
|
|
1075
546
|
[
|
|
1076
547
|
"table",
|
|
1077
|
-
({ children }) => /* @__PURE__ */
|
|
548
|
+
({ children }) => /* @__PURE__ */ React12.createElement("table", null, /* @__PURE__ */ React12.createElement("tbody", null, children))
|
|
1078
549
|
],
|
|
1079
|
-
["tablerow", ({ children }) => /* @__PURE__ */
|
|
550
|
+
["tablerow", ({ children }) => /* @__PURE__ */ React12.createElement("tr", null, children)],
|
|
1080
551
|
["tablecell", TableCellRichTextNode],
|
|
1081
552
|
["asset", AssetRichTextNode]
|
|
1082
553
|
]);
|
|
@@ -1085,7 +556,7 @@ var resolveRichTextDefaultRenderer = (node) => {
|
|
|
1085
556
|
};
|
|
1086
557
|
|
|
1087
558
|
// src/components/UniformRichText.tsx
|
|
1088
|
-
var UniformRichText =
|
|
559
|
+
var UniformRichText = React13.forwardRef(function UniformRichText2({
|
|
1089
560
|
component,
|
|
1090
561
|
resolveRichTextRenderer,
|
|
1091
562
|
as: Tag = "div",
|
|
@@ -1102,7 +573,7 @@ var UniformRichText = React12.forwardRef(function UniformRichText2({
|
|
|
1102
573
|
const value = parameter.value;
|
|
1103
574
|
if (!value || !isRichTextValue(value)) return null;
|
|
1104
575
|
if (!isContextualEditing && isRichTextValueConsideredEmpty(value)) return null;
|
|
1105
|
-
return Tag === null ? /* @__PURE__ */
|
|
576
|
+
return Tag === null ? /* @__PURE__ */ React13.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer }) : /* @__PURE__ */ React13.createElement(
|
|
1106
577
|
Tag,
|
|
1107
578
|
{
|
|
1108
579
|
ref,
|
|
@@ -1113,17 +584,18 @@ var UniformRichText = React12.forwardRef(function UniformRichText2({
|
|
|
1113
584
|
[ATTRIBUTE_PARAMETER_TYPE]: "richText"
|
|
1114
585
|
} : {}
|
|
1115
586
|
},
|
|
1116
|
-
isRichTextValueConsideredEmpty(value) ? /* @__PURE__ */
|
|
587
|
+
isRichTextValueConsideredEmpty(value) ? /* @__PURE__ */ React13.createElement("p", null, /* @__PURE__ */ React13.createElement("i", null, computedPlaceholder)) : /* @__PURE__ */ React13.createElement(UniformRichTextNode, { node: value.root, resolveRichTextRenderer })
|
|
1117
588
|
);
|
|
1118
589
|
});
|
|
1119
590
|
|
|
1120
591
|
// src/components/UniformText.tsx
|
|
1121
592
|
import { ClientUniformText } from "@uniformdev/next-app-router-client";
|
|
1122
|
-
import
|
|
593
|
+
import React14 from "react";
|
|
1123
594
|
var UniformText = (props) => {
|
|
1124
|
-
return /* @__PURE__ */
|
|
595
|
+
return /* @__PURE__ */ React14.createElement(ClientUniformText, { ...props });
|
|
1125
596
|
};
|
|
1126
597
|
export {
|
|
598
|
+
UniformEdgeState,
|
|
1127
599
|
UniformRichText,
|
|
1128
600
|
UniformSlot,
|
|
1129
601
|
UniformText,
|