@uniformdev/project-map 19.37.1 → 19.38.3-alpha.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +21 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.esm.js +26 -3
- package/dist/index.js +26 -3
- package/dist/index.mjs +26 -3
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -211,6 +211,8 @@ interface paths {
|
|
|
211
211
|
* This internal status is subject to change without notice, and is thus marked deprecated to discourage use of internal data.
|
|
212
212
|
*/
|
|
213
213
|
withCompositionUIStatus?: boolean;
|
|
214
|
+
/** Include basic redirect information. */
|
|
215
|
+
withRedirectData?: boolean;
|
|
214
216
|
};
|
|
215
217
|
};
|
|
216
218
|
responses: {
|
|
@@ -362,7 +364,23 @@ interface components {
|
|
|
362
364
|
/** @description returns true if the node is a leaf node, meaning having no children, only included if requested with the expanded flag */
|
|
363
365
|
isLeaf?: boolean;
|
|
364
366
|
compositionData?: components["schemas"]["ProjectMapNodeCompositionData"];
|
|
367
|
+
sourceRedirects?: components["schemas"]["ProjectMapSourceRedirectData"];
|
|
368
|
+
targetRedirects?: components["schemas"]["ProjectMapTargetRedirectData"];
|
|
365
369
|
};
|
|
370
|
+
ProjectMapSourceRedirectData: {
|
|
371
|
+
/**
|
|
372
|
+
* Format: uuid
|
|
373
|
+
* @description The public UUID of the source redirect
|
|
374
|
+
*/
|
|
375
|
+
id?: string;
|
|
376
|
+
}[];
|
|
377
|
+
ProjectMapTargetRedirectData: {
|
|
378
|
+
/**
|
|
379
|
+
* Format: uuid
|
|
380
|
+
* @description The public UUID of the target redirect
|
|
381
|
+
*/
|
|
382
|
+
id?: string;
|
|
383
|
+
}[];
|
|
366
384
|
/** @description Basic information about a composition from the context of a project map node. */
|
|
367
385
|
ProjectMapNodeCompositionData: {
|
|
368
386
|
/** @description Type of the composition instance (public_id of its definition) */
|
|
@@ -617,8 +635,10 @@ type UnmatchedRoute = {
|
|
|
617
635
|
match: false;
|
|
618
636
|
};
|
|
619
637
|
type ExpandOptions = {
|
|
620
|
-
dynamicInputValues?: Record<string, string>;
|
|
638
|
+
dynamicInputValues?: Record<string, string | number | boolean>;
|
|
621
639
|
allowedQueryParams?: Array<string>;
|
|
640
|
+
/** Prevents URL-escaping of variable expressions of the form ${...} in the expand result */
|
|
641
|
+
doNotEscapeVariables?: boolean;
|
|
622
642
|
};
|
|
623
643
|
declare class Route {
|
|
624
644
|
#private;
|
package/dist/index.d.ts
CHANGED
|
@@ -211,6 +211,8 @@ interface paths {
|
|
|
211
211
|
* This internal status is subject to change without notice, and is thus marked deprecated to discourage use of internal data.
|
|
212
212
|
*/
|
|
213
213
|
withCompositionUIStatus?: boolean;
|
|
214
|
+
/** Include basic redirect information. */
|
|
215
|
+
withRedirectData?: boolean;
|
|
214
216
|
};
|
|
215
217
|
};
|
|
216
218
|
responses: {
|
|
@@ -362,7 +364,23 @@ interface components {
|
|
|
362
364
|
/** @description returns true if the node is a leaf node, meaning having no children, only included if requested with the expanded flag */
|
|
363
365
|
isLeaf?: boolean;
|
|
364
366
|
compositionData?: components["schemas"]["ProjectMapNodeCompositionData"];
|
|
367
|
+
sourceRedirects?: components["schemas"]["ProjectMapSourceRedirectData"];
|
|
368
|
+
targetRedirects?: components["schemas"]["ProjectMapTargetRedirectData"];
|
|
365
369
|
};
|
|
370
|
+
ProjectMapSourceRedirectData: {
|
|
371
|
+
/**
|
|
372
|
+
* Format: uuid
|
|
373
|
+
* @description The public UUID of the source redirect
|
|
374
|
+
*/
|
|
375
|
+
id?: string;
|
|
376
|
+
}[];
|
|
377
|
+
ProjectMapTargetRedirectData: {
|
|
378
|
+
/**
|
|
379
|
+
* Format: uuid
|
|
380
|
+
* @description The public UUID of the target redirect
|
|
381
|
+
*/
|
|
382
|
+
id?: string;
|
|
383
|
+
}[];
|
|
366
384
|
/** @description Basic information about a composition from the context of a project map node. */
|
|
367
385
|
ProjectMapNodeCompositionData: {
|
|
368
386
|
/** @description Type of the composition instance (public_id of its definition) */
|
|
@@ -617,8 +635,10 @@ type UnmatchedRoute = {
|
|
|
617
635
|
match: false;
|
|
618
636
|
};
|
|
619
637
|
type ExpandOptions = {
|
|
620
|
-
dynamicInputValues?: Record<string, string>;
|
|
638
|
+
dynamicInputValues?: Record<string, string | number | boolean>;
|
|
621
639
|
allowedQueryParams?: Array<string>;
|
|
640
|
+
/** Prevents URL-escaping of variable expressions of the form ${...} in the expand result */
|
|
641
|
+
doNotEscapeVariables?: boolean;
|
|
622
642
|
};
|
|
623
643
|
declare class Route {
|
|
624
644
|
#private;
|
package/dist/index.esm.js
CHANGED
|
@@ -193,6 +193,7 @@ var cutReferences = (node) => node ? {
|
|
|
193
193
|
} : void 0;
|
|
194
194
|
|
|
195
195
|
// src/util/Route.ts
|
|
196
|
+
import { createVariableReference, parseVariableExpression } from "@uniformdev/canvas";
|
|
196
197
|
var _routeInfo, _parseRouteOrPath, parseRouteOrPath_fn, _isDynamicRouteSegment, isDynamicRouteSegment_fn;
|
|
197
198
|
var _Route = class _Route {
|
|
198
199
|
constructor(route) {
|
|
@@ -244,7 +245,7 @@ var _Route = class _Route {
|
|
|
244
245
|
* Creates an expanded path value for this route given dynamic input values and allowed query string values
|
|
245
246
|
*/
|
|
246
247
|
expand(options) {
|
|
247
|
-
const { dynamicInputValues = {}, allowedQueryParams = [] } = options != null ? options : {};
|
|
248
|
+
const { dynamicInputValues = {}, allowedQueryParams = [], doNotEscapeVariables = false } = options != null ? options : {};
|
|
248
249
|
const path = __privateGet(this, _routeInfo).segments.map((segment) => {
|
|
249
250
|
const dynamicSegmentName = _Route.getDynamicRouteSegmentName(segment);
|
|
250
251
|
if (!dynamicSegmentName) {
|
|
@@ -261,9 +262,17 @@ var _Route = class _Route {
|
|
|
261
262
|
);
|
|
262
263
|
return segment;
|
|
263
264
|
}
|
|
264
|
-
return
|
|
265
|
+
return encodeRouteComponent(dynamicSegmentValue, doNotEscapeVariables);
|
|
265
266
|
}).join("/");
|
|
266
|
-
const queries = allowedQueryParams.filter((qs) =>
|
|
267
|
+
const queries = allowedQueryParams.filter((qs) => {
|
|
268
|
+
const type = typeof dynamicInputValues[qs];
|
|
269
|
+
return type === "string" || type === "number" || type === "boolean";
|
|
270
|
+
}).map(
|
|
271
|
+
(qs) => `${encodeRouteComponent(qs, doNotEscapeVariables)}=${encodeRouteComponent(
|
|
272
|
+
dynamicInputValues[qs],
|
|
273
|
+
doNotEscapeVariables
|
|
274
|
+
)}`
|
|
275
|
+
);
|
|
267
276
|
const query = queries.length ? `?${queries.join("&")}` : "";
|
|
268
277
|
return `/${path}${query}`;
|
|
269
278
|
}
|
|
@@ -295,6 +304,20 @@ __privateAdd(_Route, _parseRouteOrPath);
|
|
|
295
304
|
__privateAdd(_Route, _isDynamicRouteSegment);
|
|
296
305
|
_Route.dynamicSegmentPrefix = ":";
|
|
297
306
|
var Route = _Route;
|
|
307
|
+
function encodeRouteComponent(value, doNotEscapeVariables) {
|
|
308
|
+
if (!doNotEscapeVariables) {
|
|
309
|
+
return encodeURIComponent(value);
|
|
310
|
+
}
|
|
311
|
+
const result = [];
|
|
312
|
+
parseVariableExpression(value.toString(10), (token, type) => {
|
|
313
|
+
if (type === "variable") {
|
|
314
|
+
result.push(createVariableReference(token));
|
|
315
|
+
} else {
|
|
316
|
+
result.push(encodeURIComponent(token));
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
return result.join("");
|
|
320
|
+
}
|
|
298
321
|
export {
|
|
299
322
|
ProjectMapClient,
|
|
300
323
|
ROOT_NODE_PATH,
|
package/dist/index.js
CHANGED
|
@@ -221,6 +221,7 @@ var cutReferences = (node) => node ? {
|
|
|
221
221
|
} : void 0;
|
|
222
222
|
|
|
223
223
|
// src/util/Route.ts
|
|
224
|
+
var import_canvas = require("@uniformdev/canvas");
|
|
224
225
|
var _routeInfo, _parseRouteOrPath, parseRouteOrPath_fn, _isDynamicRouteSegment, isDynamicRouteSegment_fn;
|
|
225
226
|
var _Route = class _Route {
|
|
226
227
|
constructor(route) {
|
|
@@ -272,7 +273,7 @@ var _Route = class _Route {
|
|
|
272
273
|
* Creates an expanded path value for this route given dynamic input values and allowed query string values
|
|
273
274
|
*/
|
|
274
275
|
expand(options) {
|
|
275
|
-
const { dynamicInputValues = {}, allowedQueryParams = [] } = options != null ? options : {};
|
|
276
|
+
const { dynamicInputValues = {}, allowedQueryParams = [], doNotEscapeVariables = false } = options != null ? options : {};
|
|
276
277
|
const path = __privateGet(this, _routeInfo).segments.map((segment) => {
|
|
277
278
|
const dynamicSegmentName = _Route.getDynamicRouteSegmentName(segment);
|
|
278
279
|
if (!dynamicSegmentName) {
|
|
@@ -289,9 +290,17 @@ var _Route = class _Route {
|
|
|
289
290
|
);
|
|
290
291
|
return segment;
|
|
291
292
|
}
|
|
292
|
-
return
|
|
293
|
+
return encodeRouteComponent(dynamicSegmentValue, doNotEscapeVariables);
|
|
293
294
|
}).join("/");
|
|
294
|
-
const queries = allowedQueryParams.filter((qs) =>
|
|
295
|
+
const queries = allowedQueryParams.filter((qs) => {
|
|
296
|
+
const type = typeof dynamicInputValues[qs];
|
|
297
|
+
return type === "string" || type === "number" || type === "boolean";
|
|
298
|
+
}).map(
|
|
299
|
+
(qs) => `${encodeRouteComponent(qs, doNotEscapeVariables)}=${encodeRouteComponent(
|
|
300
|
+
dynamicInputValues[qs],
|
|
301
|
+
doNotEscapeVariables
|
|
302
|
+
)}`
|
|
303
|
+
);
|
|
295
304
|
const query = queries.length ? `?${queries.join("&")}` : "";
|
|
296
305
|
return `/${path}${query}`;
|
|
297
306
|
}
|
|
@@ -323,6 +332,20 @@ __privateAdd(_Route, _parseRouteOrPath);
|
|
|
323
332
|
__privateAdd(_Route, _isDynamicRouteSegment);
|
|
324
333
|
_Route.dynamicSegmentPrefix = ":";
|
|
325
334
|
var Route = _Route;
|
|
335
|
+
function encodeRouteComponent(value, doNotEscapeVariables) {
|
|
336
|
+
if (!doNotEscapeVariables) {
|
|
337
|
+
return encodeURIComponent(value);
|
|
338
|
+
}
|
|
339
|
+
const result = [];
|
|
340
|
+
(0, import_canvas.parseVariableExpression)(value.toString(10), (token, type) => {
|
|
341
|
+
if (type === "variable") {
|
|
342
|
+
result.push((0, import_canvas.createVariableReference)(token));
|
|
343
|
+
} else {
|
|
344
|
+
result.push(encodeURIComponent(token));
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
return result.join("");
|
|
348
|
+
}
|
|
326
349
|
// Annotate the CommonJS export names for ESM import in node:
|
|
327
350
|
0 && (module.exports = {
|
|
328
351
|
ProjectMapClient,
|
package/dist/index.mjs
CHANGED
|
@@ -193,6 +193,7 @@ var cutReferences = (node) => node ? {
|
|
|
193
193
|
} : void 0;
|
|
194
194
|
|
|
195
195
|
// src/util/Route.ts
|
|
196
|
+
import { createVariableReference, parseVariableExpression } from "@uniformdev/canvas";
|
|
196
197
|
var _routeInfo, _parseRouteOrPath, parseRouteOrPath_fn, _isDynamicRouteSegment, isDynamicRouteSegment_fn;
|
|
197
198
|
var _Route = class _Route {
|
|
198
199
|
constructor(route) {
|
|
@@ -244,7 +245,7 @@ var _Route = class _Route {
|
|
|
244
245
|
* Creates an expanded path value for this route given dynamic input values and allowed query string values
|
|
245
246
|
*/
|
|
246
247
|
expand(options) {
|
|
247
|
-
const { dynamicInputValues = {}, allowedQueryParams = [] } = options != null ? options : {};
|
|
248
|
+
const { dynamicInputValues = {}, allowedQueryParams = [], doNotEscapeVariables = false } = options != null ? options : {};
|
|
248
249
|
const path = __privateGet(this, _routeInfo).segments.map((segment) => {
|
|
249
250
|
const dynamicSegmentName = _Route.getDynamicRouteSegmentName(segment);
|
|
250
251
|
if (!dynamicSegmentName) {
|
|
@@ -261,9 +262,17 @@ var _Route = class _Route {
|
|
|
261
262
|
);
|
|
262
263
|
return segment;
|
|
263
264
|
}
|
|
264
|
-
return
|
|
265
|
+
return encodeRouteComponent(dynamicSegmentValue, doNotEscapeVariables);
|
|
265
266
|
}).join("/");
|
|
266
|
-
const queries = allowedQueryParams.filter((qs) =>
|
|
267
|
+
const queries = allowedQueryParams.filter((qs) => {
|
|
268
|
+
const type = typeof dynamicInputValues[qs];
|
|
269
|
+
return type === "string" || type === "number" || type === "boolean";
|
|
270
|
+
}).map(
|
|
271
|
+
(qs) => `${encodeRouteComponent(qs, doNotEscapeVariables)}=${encodeRouteComponent(
|
|
272
|
+
dynamicInputValues[qs],
|
|
273
|
+
doNotEscapeVariables
|
|
274
|
+
)}`
|
|
275
|
+
);
|
|
267
276
|
const query = queries.length ? `?${queries.join("&")}` : "";
|
|
268
277
|
return `/${path}${query}`;
|
|
269
278
|
}
|
|
@@ -295,6 +304,20 @@ __privateAdd(_Route, _parseRouteOrPath);
|
|
|
295
304
|
__privateAdd(_Route, _isDynamicRouteSegment);
|
|
296
305
|
_Route.dynamicSegmentPrefix = ":";
|
|
297
306
|
var Route = _Route;
|
|
307
|
+
function encodeRouteComponent(value, doNotEscapeVariables) {
|
|
308
|
+
if (!doNotEscapeVariables) {
|
|
309
|
+
return encodeURIComponent(value);
|
|
310
|
+
}
|
|
311
|
+
const result = [];
|
|
312
|
+
parseVariableExpression(value.toString(10), (token, type) => {
|
|
313
|
+
if (type === "variable") {
|
|
314
|
+
result.push(createVariableReference(token));
|
|
315
|
+
} else {
|
|
316
|
+
result.push(encodeURIComponent(token));
|
|
317
|
+
}
|
|
318
|
+
});
|
|
319
|
+
return result.join("");
|
|
320
|
+
}
|
|
298
321
|
export {
|
|
299
322
|
ProjectMapClient,
|
|
300
323
|
ROOT_NODE_PATH,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/project-map",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.38.3-alpha.70+55e5a8fe1",
|
|
4
4
|
"description": "Uniform Project Map",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -32,11 +32,11 @@
|
|
|
32
32
|
"/dist"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@uniformdev/canvas": "19.
|
|
36
|
-
"@uniformdev/context": "19.
|
|
35
|
+
"@uniformdev/canvas": "19.38.3-alpha.70+55e5a8fe1",
|
|
36
|
+
"@uniformdev/context": "19.38.3-alpha.70+55e5a8fe1"
|
|
37
37
|
},
|
|
38
38
|
"publishConfig": {
|
|
39
39
|
"access": "public"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "55e5a8fe1d80971a93ea31d3a50cec72e71be70a"
|
|
42
42
|
}
|