@sanity/client 6.14.1 → 6.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/browserMiddleware-BHXO2Lcy.cjs +1491 -0
- package/dist/_chunks/{browserMiddleware-FpdqDQ1o.cjs.map → browserMiddleware-BHXO2Lcy.cjs.map} +1 -1
- package/dist/_chunks/browserMiddleware-jPnXCUlp.js +1474 -0
- package/dist/_chunks/{browserMiddleware-DhUBf_19.js.map → browserMiddleware-jPnXCUlp.js.map} +1 -1
- package/dist/_chunks/nodeMiddleware-CrO2pNEp.js +1491 -0
- package/dist/_chunks/{nodeMiddleware-BSZoKrW0.js.map → nodeMiddleware-CrO2pNEp.js.map} +1 -1
- package/dist/_chunks/nodeMiddleware-JJNfI4Rf.cjs +1508 -0
- package/dist/_chunks/{nodeMiddleware-DmcqX3kz.cjs.map → nodeMiddleware-JJNfI4Rf.cjs.map} +1 -1
- package/dist/_chunks/resolveEditInfo-BNCwZySb.cjs +284 -0
- package/dist/_chunks/{resolveEditInfo-BB1WiUDY.cjs.map → resolveEditInfo-BNCwZySb.cjs.map} +1 -1
- package/dist/_chunks/resolveEditInfo-qA5twkfC.js +285 -0
- package/dist/_chunks/{resolveEditInfo-Cf8D1Agp.js.map → resolveEditInfo-qA5twkfC.js.map} +1 -1
- package/dist/_chunks/stegaEncodeSourceMap-B9_uz7Zb.cjs +166 -0
- package/dist/_chunks/{stegaEncodeSourceMap-8TjLXjYU.cjs.map → stegaEncodeSourceMap-B9_uz7Zb.cjs.map} +1 -1
- package/dist/_chunks/stegaEncodeSourceMap-BvBJpbrr.cjs +329 -0
- package/dist/_chunks/{stegaEncodeSourceMap-DIcuvN0P.cjs.map → stegaEncodeSourceMap-BvBJpbrr.cjs.map} +1 -1
- package/dist/_chunks/stegaEncodeSourceMap-De3F_oJN.js +330 -0
- package/dist/_chunks/{stegaEncodeSourceMap-DLon0Yls.js.map → stegaEncodeSourceMap-De3F_oJN.js.map} +1 -1
- package/dist/_chunks/stegaEncodeSourceMap-bRxIGJ-b.js +168 -0
- package/dist/_chunks/{stegaEncodeSourceMap-DU95idpa.js.map → stegaEncodeSourceMap-bRxIGJ-b.js.map} +1 -1
- package/dist/csm.cjs +22 -56
- package/dist/csm.cjs.map +1 -1
- package/dist/csm.js +36 -54
- package/dist/csm.js.map +1 -1
- package/dist/index.browser.cjs +15 -21
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +24 -15
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +15 -21
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +24 -15
- package/dist/index.js.map +1 -1
- package/dist/stega.browser.cjs +12 -17
- package/dist/stega.browser.cjs.map +1 -1
- package/dist/stega.browser.js +26 -11
- package/dist/stega.browser.js.map +1 -1
- package/dist/stega.cjs +12 -17
- package/dist/stega.cjs.map +1 -1
- package/dist/stega.js +26 -11
- package/dist/stega.js.map +1 -1
- package/package.json +3 -3
- package/umd/sanityClient.js +2670 -3360
- package/umd/sanityClient.min.js +3 -3
- package/dist/_chunks/browserMiddleware-DhUBf_19.js +0 -1761
- package/dist/_chunks/browserMiddleware-FpdqDQ1o.cjs +0 -1777
- package/dist/_chunks/nodeMiddleware-BSZoKrW0.js +0 -1780
- package/dist/_chunks/nodeMiddleware-DmcqX3kz.cjs +0 -1796
- package/dist/_chunks/resolveEditInfo-BB1WiUDY.cjs +0 -422
- package/dist/_chunks/resolveEditInfo-Cf8D1Agp.js +0 -406
- package/dist/_chunks/stegaEncodeSourceMap-8TjLXjYU.cjs +0 -229
- package/dist/_chunks/stegaEncodeSourceMap-DIcuvN0P.cjs +0 -486
- package/dist/_chunks/stegaEncodeSourceMap-DLon0Yls.js +0 -482
- package/dist/_chunks/stegaEncodeSourceMap-DU95idpa.js +0 -225
|
@@ -1,422 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
|
|
4
|
-
const reKeySegment = /_key\s*==\s*['"](.*)['"]/;
|
|
5
|
-
const reIndexTuple = /^\d*:\d*$/;
|
|
6
|
-
function isIndexSegment(segment) {
|
|
7
|
-
return typeof segment === "number" || typeof segment === "string" && /^\[\d+\]$/.test(segment);
|
|
8
|
-
}
|
|
9
|
-
function isKeySegment(segment) {
|
|
10
|
-
if (typeof segment === "string") {
|
|
11
|
-
return reKeySegment.test(segment.trim());
|
|
12
|
-
}
|
|
13
|
-
return typeof segment === "object" && "_key" in segment;
|
|
14
|
-
}
|
|
15
|
-
function isIndexTuple(segment) {
|
|
16
|
-
if (typeof segment === "string" && reIndexTuple.test(segment)) {
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
if (!Array.isArray(segment) || segment.length !== 2) {
|
|
20
|
-
return false;
|
|
21
|
-
}
|
|
22
|
-
const [from, to] = segment;
|
|
23
|
-
return (typeof from === "number" || from === "") && (typeof to === "number" || to === "");
|
|
24
|
-
}
|
|
25
|
-
function get(obj, path, defaultVal) {
|
|
26
|
-
const select = typeof path === "string" ? fromString(path) : path;
|
|
27
|
-
if (!Array.isArray(select)) {
|
|
28
|
-
throw new Error("Path must be an array or a string");
|
|
29
|
-
}
|
|
30
|
-
let acc = obj;
|
|
31
|
-
for (let i = 0; i < select.length; i++) {
|
|
32
|
-
const segment = select[i];
|
|
33
|
-
if (isIndexSegment(segment)) {
|
|
34
|
-
if (!Array.isArray(acc)) {
|
|
35
|
-
return defaultVal;
|
|
36
|
-
}
|
|
37
|
-
acc = acc[segment];
|
|
38
|
-
}
|
|
39
|
-
if (isKeySegment(segment)) {
|
|
40
|
-
if (!Array.isArray(acc)) {
|
|
41
|
-
return defaultVal;
|
|
42
|
-
}
|
|
43
|
-
acc = acc.find((item) => item._key === segment._key);
|
|
44
|
-
}
|
|
45
|
-
if (typeof segment === "string") {
|
|
46
|
-
acc = typeof acc === "object" && acc !== null ? acc[segment] : void 0;
|
|
47
|
-
}
|
|
48
|
-
if (typeof acc === "undefined") {
|
|
49
|
-
return defaultVal;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
return acc;
|
|
53
|
-
}
|
|
54
|
-
function toString(path) {
|
|
55
|
-
if (!Array.isArray(path)) {
|
|
56
|
-
throw new Error("Path is not an array");
|
|
57
|
-
}
|
|
58
|
-
return path.reduce((target, segment, i) => {
|
|
59
|
-
const segmentType = typeof segment;
|
|
60
|
-
if (segmentType === "number") {
|
|
61
|
-
return `${target}[${segment}]`;
|
|
62
|
-
}
|
|
63
|
-
if (segmentType === "string") {
|
|
64
|
-
const separator = i === 0 ? "" : ".";
|
|
65
|
-
return `${target}${separator}${segment}`;
|
|
66
|
-
}
|
|
67
|
-
if (isKeySegment(segment) && segment._key) {
|
|
68
|
-
return `${target}[_key=="${segment._key}"]`;
|
|
69
|
-
}
|
|
70
|
-
if (Array.isArray(segment)) {
|
|
71
|
-
const [from, to] = segment;
|
|
72
|
-
return `${target}[${from}:${to}]`;
|
|
73
|
-
}
|
|
74
|
-
throw new Error(`Unsupported path segment \`${JSON.stringify(segment)}\``);
|
|
75
|
-
}, "");
|
|
76
|
-
}
|
|
77
|
-
function fromString(path) {
|
|
78
|
-
if (typeof path !== "string") {
|
|
79
|
-
throw new Error("Path is not a string");
|
|
80
|
-
}
|
|
81
|
-
const segments = path.match(rePropName);
|
|
82
|
-
if (!segments) {
|
|
83
|
-
throw new Error("Invalid path string");
|
|
84
|
-
}
|
|
85
|
-
return segments.map(parsePathSegment);
|
|
86
|
-
}
|
|
87
|
-
function parsePathSegment(segment) {
|
|
88
|
-
if (isIndexSegment(segment)) {
|
|
89
|
-
return parseIndexSegment(segment);
|
|
90
|
-
}
|
|
91
|
-
if (isKeySegment(segment)) {
|
|
92
|
-
return parseKeySegment(segment);
|
|
93
|
-
}
|
|
94
|
-
if (isIndexTuple(segment)) {
|
|
95
|
-
return parseIndexTupleSegment(segment);
|
|
96
|
-
}
|
|
97
|
-
return segment;
|
|
98
|
-
}
|
|
99
|
-
function parseIndexSegment(segment) {
|
|
100
|
-
return Number(segment.replace(/[^\d]/g, ""));
|
|
101
|
-
}
|
|
102
|
-
function parseKeySegment(segment) {
|
|
103
|
-
const segments = segment.match(reKeySegment);
|
|
104
|
-
return { _key: segments[1] };
|
|
105
|
-
}
|
|
106
|
-
function parseIndexTupleSegment(segment) {
|
|
107
|
-
const [from, to] = segment.split(":").map((seg) => seg === "" ? seg : Number(seg));
|
|
108
|
-
return [from, to];
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
var studioPath = /*#__PURE__*/Object.freeze({
|
|
112
|
-
__proto__: null,
|
|
113
|
-
fromString: fromString,
|
|
114
|
-
get: get,
|
|
115
|
-
isIndexSegment: isIndexSegment,
|
|
116
|
-
isIndexTuple: isIndexTuple,
|
|
117
|
-
isKeySegment: isKeySegment,
|
|
118
|
-
reKeySegment: reKeySegment,
|
|
119
|
-
toString: toString
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
const DRAFTS_PREFIX = "drafts.";
|
|
123
|
-
function getPublishedId(id) {
|
|
124
|
-
if (id.startsWith(DRAFTS_PREFIX)) {
|
|
125
|
-
return id.slice(DRAFTS_PREFIX.length);
|
|
126
|
-
}
|
|
127
|
-
return id;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
const ESCAPE = {
|
|
131
|
-
"\f": "\\f",
|
|
132
|
-
"\n": "\\n",
|
|
133
|
-
"\r": "\\r",
|
|
134
|
-
" ": "\\t",
|
|
135
|
-
"'": "\\'",
|
|
136
|
-
"\\": "\\\\"
|
|
137
|
-
};
|
|
138
|
-
const UNESCAPE = {
|
|
139
|
-
"\\f": "\f",
|
|
140
|
-
"\\n": "\n",
|
|
141
|
-
"\\r": "\r",
|
|
142
|
-
"\\t": " ",
|
|
143
|
-
"\\'": "'",
|
|
144
|
-
"\\\\": "\\"
|
|
145
|
-
};
|
|
146
|
-
function jsonPath(path) {
|
|
147
|
-
return `$${path.map((segment) => {
|
|
148
|
-
if (typeof segment === "string") {
|
|
149
|
-
const escapedKey = segment.replace(/[\f\n\r\t'\\]/g, (match) => {
|
|
150
|
-
return ESCAPE[match];
|
|
151
|
-
});
|
|
152
|
-
return `['${escapedKey}']`;
|
|
153
|
-
}
|
|
154
|
-
if (typeof segment === "number") {
|
|
155
|
-
return `[${segment}]`;
|
|
156
|
-
}
|
|
157
|
-
if (segment._key !== "") {
|
|
158
|
-
const escapedKey = segment._key.replace(/['\\]/g, (match) => {
|
|
159
|
-
return ESCAPE[match];
|
|
160
|
-
});
|
|
161
|
-
return `[?(@._key=='${escapedKey}')]`;
|
|
162
|
-
}
|
|
163
|
-
return `[${segment._index}]`;
|
|
164
|
-
}).join("")}`;
|
|
165
|
-
}
|
|
166
|
-
function parseJsonPath(path) {
|
|
167
|
-
const parsed = [];
|
|
168
|
-
const parseRe = /\['(.*?)'\]|\[(\d+)\]|\[\?\(@\._key=='(.*?)'\)\]/g;
|
|
169
|
-
let match;
|
|
170
|
-
while ((match = parseRe.exec(path)) !== null) {
|
|
171
|
-
if (match[1] !== void 0) {
|
|
172
|
-
const key = match[1].replace(/\\(\\|f|n|r|t|')/g, (m) => {
|
|
173
|
-
return UNESCAPE[m];
|
|
174
|
-
});
|
|
175
|
-
parsed.push(key);
|
|
176
|
-
continue;
|
|
177
|
-
}
|
|
178
|
-
if (match[2] !== void 0) {
|
|
179
|
-
parsed.push(parseInt(match[2], 10));
|
|
180
|
-
continue;
|
|
181
|
-
}
|
|
182
|
-
if (match[3] !== void 0) {
|
|
183
|
-
const _key = match[3].replace(/\\(\\')/g, (m) => {
|
|
184
|
-
return UNESCAPE[m];
|
|
185
|
-
});
|
|
186
|
-
parsed.push({
|
|
187
|
-
_key,
|
|
188
|
-
_index: -1
|
|
189
|
-
});
|
|
190
|
-
continue;
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
return parsed;
|
|
194
|
-
}
|
|
195
|
-
function jsonPathToStudioPath(path) {
|
|
196
|
-
return path.map((segment) => {
|
|
197
|
-
if (typeof segment === "string") {
|
|
198
|
-
return segment;
|
|
199
|
-
}
|
|
200
|
-
if (typeof segment === "number") {
|
|
201
|
-
return segment;
|
|
202
|
-
}
|
|
203
|
-
if (segment._key !== "") {
|
|
204
|
-
return { _key: segment._key };
|
|
205
|
-
}
|
|
206
|
-
if (segment._index !== -1) {
|
|
207
|
-
return segment._index;
|
|
208
|
-
}
|
|
209
|
-
throw new Error(`invalid segment:${JSON.stringify(segment)}`);
|
|
210
|
-
});
|
|
211
|
-
}
|
|
212
|
-
function studioPathToJsonPath(path) {
|
|
213
|
-
const parsedPath = typeof path === "string" ? fromString(path) : path;
|
|
214
|
-
return parsedPath.map((segment) => {
|
|
215
|
-
if (typeof segment === "string") {
|
|
216
|
-
return segment;
|
|
217
|
-
}
|
|
218
|
-
if (typeof segment === "number") {
|
|
219
|
-
return segment;
|
|
220
|
-
}
|
|
221
|
-
if (Array.isArray(segment)) {
|
|
222
|
-
throw new Error(`IndexTuple segments aren't supported:${JSON.stringify(segment)}`);
|
|
223
|
-
}
|
|
224
|
-
if (isContentSourceMapParsedPathKeyedSegment(segment)) {
|
|
225
|
-
return segment;
|
|
226
|
-
}
|
|
227
|
-
if (segment._key) {
|
|
228
|
-
return { _key: segment._key, _index: -1 };
|
|
229
|
-
}
|
|
230
|
-
throw new Error(`invalid segment:${JSON.stringify(segment)}`);
|
|
231
|
-
});
|
|
232
|
-
}
|
|
233
|
-
function isContentSourceMapParsedPathKeyedSegment(segment) {
|
|
234
|
-
return typeof segment === "object" && "_key" in segment && "_index" in segment;
|
|
235
|
-
}
|
|
236
|
-
function jsonPathToMappingPath(path) {
|
|
237
|
-
return path.map((segment) => {
|
|
238
|
-
if (typeof segment === "string") {
|
|
239
|
-
return segment;
|
|
240
|
-
}
|
|
241
|
-
if (typeof segment === "number") {
|
|
242
|
-
return segment;
|
|
243
|
-
}
|
|
244
|
-
if (segment._index !== -1) {
|
|
245
|
-
return segment._index;
|
|
246
|
-
}
|
|
247
|
-
throw new Error(`invalid segment:${JSON.stringify(segment)}`);
|
|
248
|
-
});
|
|
249
|
-
}
|
|
250
|
-
|
|
251
|
-
function resolveMapping(resultPath, csm) {
|
|
252
|
-
if (!(csm == null ? void 0 : csm.mappings)) {
|
|
253
|
-
return void 0;
|
|
254
|
-
}
|
|
255
|
-
const resultMappingPath = jsonPath(jsonPathToMappingPath(resultPath));
|
|
256
|
-
if (csm.mappings[resultMappingPath] !== void 0) {
|
|
257
|
-
return {
|
|
258
|
-
mapping: csm.mappings[resultMappingPath],
|
|
259
|
-
matchedPath: resultMappingPath,
|
|
260
|
-
pathSuffix: ""
|
|
261
|
-
};
|
|
262
|
-
}
|
|
263
|
-
const mappings = Object.entries(csm.mappings).filter(([key]) => resultMappingPath.startsWith(key)).sort(([key1], [key2]) => key2.length - key1.length);
|
|
264
|
-
if (mappings.length == 0) {
|
|
265
|
-
return void 0;
|
|
266
|
-
}
|
|
267
|
-
const [matchedPath, mapping] = mappings[0];
|
|
268
|
-
const pathSuffix = resultMappingPath.substring(matchedPath.length);
|
|
269
|
-
return { mapping, matchedPath, pathSuffix };
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
function isArray(value) {
|
|
273
|
-
return value !== null && Array.isArray(value);
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
function isRecord(value) {
|
|
277
|
-
return typeof value === "object" && value !== null;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
function walkMap(value, mappingFn, path = []) {
|
|
281
|
-
if (isArray(value)) {
|
|
282
|
-
return value.map((v, idx) => {
|
|
283
|
-
if (isRecord(v)) {
|
|
284
|
-
const _key = v["_key"];
|
|
285
|
-
if (typeof _key === "string") {
|
|
286
|
-
return walkMap(v, mappingFn, path.concat({ _key, _index: idx }));
|
|
287
|
-
}
|
|
288
|
-
}
|
|
289
|
-
return walkMap(v, mappingFn, path.concat(idx));
|
|
290
|
-
});
|
|
291
|
-
}
|
|
292
|
-
if (isRecord(value)) {
|
|
293
|
-
return Object.fromEntries(
|
|
294
|
-
Object.entries(value).map(([k, v]) => [k, walkMap(v, mappingFn, path.concat(k))])
|
|
295
|
-
);
|
|
296
|
-
}
|
|
297
|
-
return mappingFn(value, path);
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
function createEditUrl(options) {
|
|
301
|
-
const {
|
|
302
|
-
baseUrl,
|
|
303
|
-
workspace: _workspace = "default",
|
|
304
|
-
tool: _tool = "default",
|
|
305
|
-
id: _id,
|
|
306
|
-
type,
|
|
307
|
-
path,
|
|
308
|
-
projectId,
|
|
309
|
-
dataset
|
|
310
|
-
} = options;
|
|
311
|
-
if (!baseUrl) {
|
|
312
|
-
throw new Error("baseUrl is required");
|
|
313
|
-
}
|
|
314
|
-
if (!path) {
|
|
315
|
-
throw new Error("path is required");
|
|
316
|
-
}
|
|
317
|
-
if (!_id) {
|
|
318
|
-
throw new Error("id is required");
|
|
319
|
-
}
|
|
320
|
-
if (baseUrl !== "/" && baseUrl.endsWith("/")) {
|
|
321
|
-
throw new Error("baseUrl must not end with a slash");
|
|
322
|
-
}
|
|
323
|
-
const workspace = _workspace === "default" ? void 0 : _workspace;
|
|
324
|
-
const tool = _tool === "default" ? void 0 : _tool;
|
|
325
|
-
const id = getPublishedId(_id);
|
|
326
|
-
const stringifiedPath = Array.isArray(path) ? toString(jsonPathToStudioPath(path)) : path;
|
|
327
|
-
const searchParams = new URLSearchParams({
|
|
328
|
-
baseUrl,
|
|
329
|
-
id,
|
|
330
|
-
type,
|
|
331
|
-
path: stringifiedPath
|
|
332
|
-
});
|
|
333
|
-
if (workspace) {
|
|
334
|
-
searchParams.set("workspace", workspace);
|
|
335
|
-
}
|
|
336
|
-
if (tool) {
|
|
337
|
-
searchParams.set("tool", tool);
|
|
338
|
-
}
|
|
339
|
-
if (projectId) {
|
|
340
|
-
searchParams.set("projectId", projectId);
|
|
341
|
-
}
|
|
342
|
-
if (dataset) {
|
|
343
|
-
searchParams.set("dataset", dataset);
|
|
344
|
-
}
|
|
345
|
-
const segments = [baseUrl === "/" ? "" : baseUrl];
|
|
346
|
-
if (workspace) {
|
|
347
|
-
segments.push(workspace);
|
|
348
|
-
}
|
|
349
|
-
const routerParams = [
|
|
350
|
-
"mode=presentation",
|
|
351
|
-
`id=${id}`,
|
|
352
|
-
`type=${type}`,
|
|
353
|
-
`path=${encodeURIComponent(stringifiedPath)}`
|
|
354
|
-
];
|
|
355
|
-
if (tool) {
|
|
356
|
-
routerParams.push(`tool=${tool}`);
|
|
357
|
-
}
|
|
358
|
-
segments.push("intent", "edit", `${routerParams.join(";")}?${searchParams}`);
|
|
359
|
-
return segments.join("/");
|
|
360
|
-
}
|
|
361
|
-
|
|
362
|
-
function resolveEditInfo(options) {
|
|
363
|
-
const { resultSourceMap: csm, resultPath } = options;
|
|
364
|
-
const { mapping, pathSuffix } = resolveMapping(resultPath, csm) || {};
|
|
365
|
-
if (!mapping) {
|
|
366
|
-
return void 0;
|
|
367
|
-
}
|
|
368
|
-
if (mapping.source.type === "literal") {
|
|
369
|
-
return void 0;
|
|
370
|
-
}
|
|
371
|
-
if (mapping.source.type === "unknown") {
|
|
372
|
-
return void 0;
|
|
373
|
-
}
|
|
374
|
-
const sourceDoc = csm.documents[mapping.source.document];
|
|
375
|
-
const sourcePath = csm.paths[mapping.source.path];
|
|
376
|
-
if (sourceDoc && sourcePath) {
|
|
377
|
-
const { baseUrl, workspace, tool } = resolveStudioBaseRoute(
|
|
378
|
-
typeof options.studioUrl === "function" ? options.studioUrl(sourceDoc) : options.studioUrl
|
|
379
|
-
);
|
|
380
|
-
if (!baseUrl)
|
|
381
|
-
return void 0;
|
|
382
|
-
const { _id, _type, _projectId, _dataset } = sourceDoc;
|
|
383
|
-
return {
|
|
384
|
-
baseUrl,
|
|
385
|
-
workspace,
|
|
386
|
-
tool,
|
|
387
|
-
id: _id,
|
|
388
|
-
type: _type,
|
|
389
|
-
path: parseJsonPath(sourcePath + pathSuffix),
|
|
390
|
-
projectId: _projectId,
|
|
391
|
-
dataset: _dataset
|
|
392
|
-
};
|
|
393
|
-
}
|
|
394
|
-
return void 0;
|
|
395
|
-
}
|
|
396
|
-
function resolveStudioBaseRoute(studioUrl) {
|
|
397
|
-
let baseUrl = typeof studioUrl === "string" ? studioUrl : studioUrl.baseUrl;
|
|
398
|
-
if (baseUrl !== "/") {
|
|
399
|
-
baseUrl = baseUrl.replace(/\/$/, "");
|
|
400
|
-
}
|
|
401
|
-
if (typeof studioUrl === "string") {
|
|
402
|
-
return { baseUrl };
|
|
403
|
-
}
|
|
404
|
-
return { ...studioUrl, baseUrl };
|
|
405
|
-
}
|
|
406
|
-
|
|
407
|
-
exports.DRAFTS_PREFIX = DRAFTS_PREFIX;
|
|
408
|
-
exports.createEditUrl = createEditUrl;
|
|
409
|
-
exports.get = get;
|
|
410
|
-
exports.getPublishedId = getPublishedId;
|
|
411
|
-
exports.jsonPath = jsonPath;
|
|
412
|
-
exports.jsonPathToStudioPath = jsonPathToStudioPath;
|
|
413
|
-
exports.parseJsonPath = parseJsonPath;
|
|
414
|
-
exports.reKeySegment = reKeySegment;
|
|
415
|
-
exports.resolveEditInfo = resolveEditInfo;
|
|
416
|
-
exports.resolveMapping = resolveMapping;
|
|
417
|
-
exports.resolveStudioBaseRoute = resolveStudioBaseRoute;
|
|
418
|
-
exports.studioPath = studioPath;
|
|
419
|
-
exports.studioPathToJsonPath = studioPathToJsonPath;
|
|
420
|
-
exports.toString = toString;
|
|
421
|
-
exports.walkMap = walkMap;
|
|
422
|
-
//# sourceMappingURL=resolveEditInfo-BB1WiUDY.cjs.map
|