@uniformdev/project-map 19.135.1-alpha.10 → 19.135.1-alpha.12
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 +39 -40
- package/dist/index.d.ts +39 -40
- package/dist/index.esm.js +19 -34
- package/dist/index.js +21 -35
- package/dist/index.mjs +19 -34
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -97,7 +97,7 @@ interface paths$1 {
|
|
|
97
97
|
};
|
|
98
98
|
};
|
|
99
99
|
};
|
|
100
|
-
/** Handles preflight requests. This endpoint allows CORS
|
|
100
|
+
/** Handles preflight requests. This endpoint allows CORS */
|
|
101
101
|
options: {
|
|
102
102
|
responses: {
|
|
103
103
|
/** OK */
|
|
@@ -186,12 +186,12 @@ interface paths {
|
|
|
186
186
|
* - When unspecified, composition data is fetched from base.
|
|
187
187
|
* - When specified, all content is returned as it would appear in the release if it was released now. This includes both content copied to the release and changed, as well as content that is not part of the release.
|
|
188
188
|
*
|
|
189
|
-
* Content copied to a release can be differentiated from base content by the `releaseId` property on the content. If the content is not copied to the release, this property will not be defined
|
|
189
|
+
* Content copied to a release can be differentiated from base content by the `releaseId` property on the content. If the content is not copied to the release, this property will not be defined
|
|
190
190
|
*/
|
|
191
191
|
releaseId?: string;
|
|
192
|
-
/** The id of the node to retrieve, cannot have both this parameter and
|
|
192
|
+
/** The id of the node to retrieve, cannot have both this parameter and `path` */
|
|
193
193
|
id?: string;
|
|
194
|
-
/** The path of the root node to retrieve, cannot have both this parameter and
|
|
194
|
+
/** The path of the root node to retrieve, cannot have both this parameter and `id` */
|
|
195
195
|
path?: string;
|
|
196
196
|
/** Composition id to find associated sitemap nodes for */
|
|
197
197
|
compositionId?: string;
|
|
@@ -199,9 +199,9 @@ interface paths {
|
|
|
199
199
|
limit?: number;
|
|
200
200
|
/** Number of records to skip before returning nodes */
|
|
201
201
|
offset?: number;
|
|
202
|
-
/** Depth of the tree to fetch.
|
|
202
|
+
/** Depth of the tree to fetch. This only applies when fetching by path */
|
|
203
203
|
depth?: number;
|
|
204
|
-
/** State of compositions to fetch. 0 = draft, 64 = published
|
|
204
|
+
/** State of compositions to fetch. 0 = draft, 64 = published */
|
|
205
205
|
state?: number;
|
|
206
206
|
/** should the data be returned as a json tree object (or a flat array) */
|
|
207
207
|
tree?: boolean;
|
|
@@ -209,19 +209,19 @@ interface paths {
|
|
|
209
209
|
search?: string;
|
|
210
210
|
/**
|
|
211
211
|
* Modifies the results to include all ancestors of matched nodes, in addition to the nodes themselves.
|
|
212
|
-
* Results are sorted by path. If multiple nodes are selected, ancestors are not duplicated
|
|
212
|
+
* Results are sorted by path. If multiple nodes are selected, ancestors are not duplicated
|
|
213
213
|
*/
|
|
214
214
|
includeAncestors?: boolean;
|
|
215
|
-
/** include expanded helper computed properties,
|
|
215
|
+
/** include expanded helper computed properties, including `isLeaf`, `parentPath`, `pathSegment` etc */
|
|
216
216
|
expanded?: boolean;
|
|
217
|
-
/** include basic composition information. ID, type, state, name, and definition id
|
|
217
|
+
/** include basic composition information. ID, type, state, name, and definition id */
|
|
218
218
|
withCompositionData?: boolean;
|
|
219
219
|
/**
|
|
220
220
|
* @deprecated Returns the UI status string of the composition.
|
|
221
|
-
* This internal status is subject to change without notice
|
|
221
|
+
* This internal status is subject to change without notice and is thus marked deprecated to discourage the use of internal data
|
|
222
222
|
*/
|
|
223
223
|
withCompositionUIStatus?: boolean;
|
|
224
|
-
/** Include basic redirect information
|
|
224
|
+
/** Include basic redirect information */
|
|
225
225
|
withRedirectData?: boolean;
|
|
226
226
|
};
|
|
227
227
|
};
|
|
@@ -331,7 +331,7 @@ interface paths {
|
|
|
331
331
|
};
|
|
332
332
|
};
|
|
333
333
|
};
|
|
334
|
-
/** Handles preflight requests. This endpoint allows CORS
|
|
334
|
+
/** Handles preflight requests. This endpoint allows CORS */
|
|
335
335
|
options: {
|
|
336
336
|
responses: {
|
|
337
337
|
/** OK */
|
|
@@ -350,7 +350,7 @@ interface components {
|
|
|
350
350
|
id: string;
|
|
351
351
|
/** @description Path representing the path to the current node */
|
|
352
352
|
path: string;
|
|
353
|
-
/** @description Ordering of the node, higher numbers go after lower numbers
|
|
353
|
+
/** @description Ordering of the node, higher numbers go after lower numbers */
|
|
354
354
|
order?: number;
|
|
355
355
|
data?: components["schemas"]["ProjectMapNodeData"];
|
|
356
356
|
/** @description The name of the projectMap entry */
|
|
@@ -388,13 +388,13 @@ interface components {
|
|
|
388
388
|
/** @description Last segment of the url in this locale */
|
|
389
389
|
pathSegment: string;
|
|
390
390
|
/**
|
|
391
|
-
* @description When false, the node explicitly defines a locale
|
|
391
|
+
* @description When false, the node explicitly defines a locale-specific path segment.
|
|
392
392
|
*
|
|
393
|
-
* When true, an ancestor defines a locale
|
|
393
|
+
* When true, an ancestor defines a locale-specific path segment,
|
|
394
394
|
* which makes its descendants resolvable using that segment.
|
|
395
|
-
* This node does not define a locale
|
|
395
|
+
* This node does not define a locale-specific path segment.
|
|
396
396
|
*
|
|
397
|
-
* Only included if requested with the expanded flag. Without the expanded flag, inherited locales are not included in the response
|
|
397
|
+
* Only included if requested with the expanded flag. Without the expanded flag, inherited locales are not included in the response
|
|
398
398
|
*/
|
|
399
399
|
inherited?: boolean;
|
|
400
400
|
};
|
|
@@ -412,22 +412,22 @@ interface components {
|
|
|
412
412
|
*/
|
|
413
413
|
id?: string;
|
|
414
414
|
}[];
|
|
415
|
-
/** @description Basic information about a composition from the context of a project map node
|
|
415
|
+
/** @description Basic information about a composition from the context of a project map node */
|
|
416
416
|
ProjectMapNodeCompositionData: {
|
|
417
417
|
/** @description Type of the composition instance (public_id of its definition) */
|
|
418
418
|
type: string;
|
|
419
419
|
/**
|
|
420
420
|
* Format: uuid
|
|
421
|
-
* @description The public UUID of the composition
|
|
421
|
+
* @description The public UUID of the composition
|
|
422
422
|
*/
|
|
423
423
|
id: string;
|
|
424
|
-
/** @description Slug pattern of this composition
|
|
424
|
+
/** @description Slug pattern of this composition */
|
|
425
425
|
slug?: string | null;
|
|
426
|
-
/** @description Friendly name of this composition
|
|
426
|
+
/** @description Friendly name of this composition */
|
|
427
427
|
name: string;
|
|
428
428
|
/**
|
|
429
429
|
* @deprecated
|
|
430
|
-
* @description UI status value. Subject to change without notice; do not rely on this value. Only present when `withCompositionUIStatus` option is true
|
|
430
|
+
* @description UI status value. Subject to change without notice; do not rely on this value. Only present when `withCompositionUIStatus` option is true
|
|
431
431
|
* @enum {string}
|
|
432
432
|
*/
|
|
433
433
|
uiStatus?: "Draft" | "Modified" | "Published" | "Orphan";
|
|
@@ -438,8 +438,13 @@ interface components {
|
|
|
438
438
|
icon?: string;
|
|
439
439
|
/** @description Friendly name of this Composition's Definition */
|
|
440
440
|
typeName?: string;
|
|
441
|
-
/** @description List of locales that the composition is available in. If empty, available in all locales
|
|
441
|
+
/** @description List of locales that the composition is available in. If empty, available in all locales */
|
|
442
442
|
locales: string[];
|
|
443
|
+
/**
|
|
444
|
+
* Format: date-time
|
|
445
|
+
* @description Date and time the composition was last modified (or created if never modified). Uses ISO-8859-1 formatting and UTC timezone.
|
|
446
|
+
*/
|
|
447
|
+
modified?: string;
|
|
443
448
|
};
|
|
444
449
|
ProjectMapNodeUpdate: {
|
|
445
450
|
/**
|
|
@@ -449,7 +454,7 @@ interface components {
|
|
|
449
454
|
id?: string;
|
|
450
455
|
/** @description Path representing the path to the current node */
|
|
451
456
|
path: string;
|
|
452
|
-
/** @description Ordering of the node, higher numbers go after lower numbers
|
|
457
|
+
/** @description Ordering of the node, higher numbers go after lower numbers */
|
|
453
458
|
order?: number;
|
|
454
459
|
data?: components["schemas"]["ProjectMapNodeData"];
|
|
455
460
|
/** @description The name of the projectMap entry */
|
|
@@ -484,7 +489,7 @@ interface components {
|
|
|
484
489
|
/**
|
|
485
490
|
* @description For dynamic nodes, this is the preview value for the dynamic value.
|
|
486
491
|
* The preview value is used when editing a connected composition, and is the default
|
|
487
|
-
* dynamic node value unless the author has explicitly chosen a different value
|
|
492
|
+
* dynamic node value unless the author has explicitly chosen a different value
|
|
488
493
|
*/
|
|
489
494
|
previewValue?: string;
|
|
490
495
|
};
|
|
@@ -614,25 +619,13 @@ declare class ProjectMapClient extends ApiClient<ProjectMapClientOptions> {
|
|
|
614
619
|
* Get available project map defintions
|
|
615
620
|
*/
|
|
616
621
|
getProjectMapDefinitions: () => Promise<{
|
|
617
|
-
projectMaps:
|
|
618
|
-
id?: string | undefined;
|
|
619
|
-
name: string;
|
|
620
|
-
description?: string | undefined;
|
|
621
|
-
baseUrl?: string | undefined;
|
|
622
|
-
default?: boolean | undefined;
|
|
623
|
-
}[];
|
|
622
|
+
projectMaps: components$1["schemas"]["ProjectMapDefinition"][];
|
|
624
623
|
}>;
|
|
625
624
|
/**
|
|
626
625
|
* Get specific project map definition
|
|
627
626
|
*/
|
|
628
627
|
getProjectMapDefinition: (options: WithoutProjectId<ProjectMapGetRequest>) => Promise<{
|
|
629
|
-
projectMaps:
|
|
630
|
-
id?: string | undefined;
|
|
631
|
-
name: string;
|
|
632
|
-
description?: string | undefined;
|
|
633
|
-
baseUrl?: string | undefined;
|
|
634
|
-
default?: boolean | undefined;
|
|
635
|
-
}[];
|
|
628
|
+
projectMaps: components$1["schemas"]["ProjectMapDefinition"][];
|
|
636
629
|
}>;
|
|
637
630
|
/**
|
|
638
631
|
* Update or insert a project map definition
|
|
@@ -664,6 +657,12 @@ declare class ProjectMapClient extends ApiClient<ProjectMapClientOptions> {
|
|
|
664
657
|
declare class UncachedProjectMapClient extends ProjectMapClient {
|
|
665
658
|
constructor(options: Omit<ProjectMapClientOptions, 'bypassCache'>);
|
|
666
659
|
}
|
|
660
|
+
/**
|
|
661
|
+
* Internal use only.
|
|
662
|
+
*
|
|
663
|
+
* @deprecated
|
|
664
|
+
*/
|
|
665
|
+
declare const __INTERNAL_MISSING_PARENT_NODE_ERROR = "Upsert failed, parent node not found.";
|
|
667
666
|
|
|
668
667
|
type LocalePathNode = Pick<ProjectMapNode, 'path'> & {
|
|
669
668
|
locales?: Record<string, {
|
|
@@ -729,4 +728,4 @@ declare class Route {
|
|
|
729
728
|
static dynamicSegmentPrefix: string;
|
|
730
729
|
}
|
|
731
730
|
|
|
732
|
-
export { type AlternateLocaleUrls, type ExpandOptions, type LocalePathNode, type MatchedRoute, type NodeType, ProjectMapClient, type ProjectMapClientOptions, type ProjectMapDefinition, type ProjectMapDefinitionWithId, type ProjectMapDefinitions, type ProjectMapDeleteRequest, type ProjectMapGetRequest, type ProjectMapGetResponse, type ProjectMapNode, type ProjectMapNodeAllowedQueryString, type ProjectMapNodeData, type ProjectMapNodeDeleteRequest, type ProjectMapNodeGetRequest, type ProjectMapNodeGetResponse, type ProjectMapNodeLocale, type ProjectMapNodeUpsertRequest, type ProjectMapNodeUpsertRequestNode, type ProjectMapNodeUpsertRequestNodeLocale, type ProjectMapNodeWithId, type ProjectMapNodeWithProjectMapReference, type ProjectMapSubtree, type ProjectMapUpsertRequest, type ProjectMapUpsertResponse, ROOT_NODE_PATH, Route, UncachedProjectMapClient, type UnmatchedRoute, getNodeLocalePath, getRouteAlternateLocalesUrls };
|
|
731
|
+
export { type AlternateLocaleUrls, type ExpandOptions, type LocalePathNode, type MatchedRoute, type NodeType, ProjectMapClient, type ProjectMapClientOptions, type ProjectMapDefinition, type ProjectMapDefinitionWithId, type ProjectMapDefinitions, type ProjectMapDeleteRequest, type ProjectMapGetRequest, type ProjectMapGetResponse, type ProjectMapNode, type ProjectMapNodeAllowedQueryString, type ProjectMapNodeData, type ProjectMapNodeDeleteRequest, type ProjectMapNodeGetRequest, type ProjectMapNodeGetResponse, type ProjectMapNodeLocale, type ProjectMapNodeUpsertRequest, type ProjectMapNodeUpsertRequestNode, type ProjectMapNodeUpsertRequestNodeLocale, type ProjectMapNodeWithId, type ProjectMapNodeWithProjectMapReference, type ProjectMapSubtree, type ProjectMapUpsertRequest, type ProjectMapUpsertResponse, ROOT_NODE_PATH, Route, UncachedProjectMapClient, type UnmatchedRoute, __INTERNAL_MISSING_PARENT_NODE_ERROR, getNodeLocalePath, getRouteAlternateLocalesUrls };
|
package/dist/index.d.ts
CHANGED
|
@@ -97,7 +97,7 @@ interface paths$1 {
|
|
|
97
97
|
};
|
|
98
98
|
};
|
|
99
99
|
};
|
|
100
|
-
/** Handles preflight requests. This endpoint allows CORS
|
|
100
|
+
/** Handles preflight requests. This endpoint allows CORS */
|
|
101
101
|
options: {
|
|
102
102
|
responses: {
|
|
103
103
|
/** OK */
|
|
@@ -186,12 +186,12 @@ interface paths {
|
|
|
186
186
|
* - When unspecified, composition data is fetched from base.
|
|
187
187
|
* - When specified, all content is returned as it would appear in the release if it was released now. This includes both content copied to the release and changed, as well as content that is not part of the release.
|
|
188
188
|
*
|
|
189
|
-
* Content copied to a release can be differentiated from base content by the `releaseId` property on the content. If the content is not copied to the release, this property will not be defined
|
|
189
|
+
* Content copied to a release can be differentiated from base content by the `releaseId` property on the content. If the content is not copied to the release, this property will not be defined
|
|
190
190
|
*/
|
|
191
191
|
releaseId?: string;
|
|
192
|
-
/** The id of the node to retrieve, cannot have both this parameter and
|
|
192
|
+
/** The id of the node to retrieve, cannot have both this parameter and `path` */
|
|
193
193
|
id?: string;
|
|
194
|
-
/** The path of the root node to retrieve, cannot have both this parameter and
|
|
194
|
+
/** The path of the root node to retrieve, cannot have both this parameter and `id` */
|
|
195
195
|
path?: string;
|
|
196
196
|
/** Composition id to find associated sitemap nodes for */
|
|
197
197
|
compositionId?: string;
|
|
@@ -199,9 +199,9 @@ interface paths {
|
|
|
199
199
|
limit?: number;
|
|
200
200
|
/** Number of records to skip before returning nodes */
|
|
201
201
|
offset?: number;
|
|
202
|
-
/** Depth of the tree to fetch.
|
|
202
|
+
/** Depth of the tree to fetch. This only applies when fetching by path */
|
|
203
203
|
depth?: number;
|
|
204
|
-
/** State of compositions to fetch. 0 = draft, 64 = published
|
|
204
|
+
/** State of compositions to fetch. 0 = draft, 64 = published */
|
|
205
205
|
state?: number;
|
|
206
206
|
/** should the data be returned as a json tree object (or a flat array) */
|
|
207
207
|
tree?: boolean;
|
|
@@ -209,19 +209,19 @@ interface paths {
|
|
|
209
209
|
search?: string;
|
|
210
210
|
/**
|
|
211
211
|
* Modifies the results to include all ancestors of matched nodes, in addition to the nodes themselves.
|
|
212
|
-
* Results are sorted by path. If multiple nodes are selected, ancestors are not duplicated
|
|
212
|
+
* Results are sorted by path. If multiple nodes are selected, ancestors are not duplicated
|
|
213
213
|
*/
|
|
214
214
|
includeAncestors?: boolean;
|
|
215
|
-
/** include expanded helper computed properties,
|
|
215
|
+
/** include expanded helper computed properties, including `isLeaf`, `parentPath`, `pathSegment` etc */
|
|
216
216
|
expanded?: boolean;
|
|
217
|
-
/** include basic composition information. ID, type, state, name, and definition id
|
|
217
|
+
/** include basic composition information. ID, type, state, name, and definition id */
|
|
218
218
|
withCompositionData?: boolean;
|
|
219
219
|
/**
|
|
220
220
|
* @deprecated Returns the UI status string of the composition.
|
|
221
|
-
* This internal status is subject to change without notice
|
|
221
|
+
* This internal status is subject to change without notice and is thus marked deprecated to discourage the use of internal data
|
|
222
222
|
*/
|
|
223
223
|
withCompositionUIStatus?: boolean;
|
|
224
|
-
/** Include basic redirect information
|
|
224
|
+
/** Include basic redirect information */
|
|
225
225
|
withRedirectData?: boolean;
|
|
226
226
|
};
|
|
227
227
|
};
|
|
@@ -331,7 +331,7 @@ interface paths {
|
|
|
331
331
|
};
|
|
332
332
|
};
|
|
333
333
|
};
|
|
334
|
-
/** Handles preflight requests. This endpoint allows CORS
|
|
334
|
+
/** Handles preflight requests. This endpoint allows CORS */
|
|
335
335
|
options: {
|
|
336
336
|
responses: {
|
|
337
337
|
/** OK */
|
|
@@ -350,7 +350,7 @@ interface components {
|
|
|
350
350
|
id: string;
|
|
351
351
|
/** @description Path representing the path to the current node */
|
|
352
352
|
path: string;
|
|
353
|
-
/** @description Ordering of the node, higher numbers go after lower numbers
|
|
353
|
+
/** @description Ordering of the node, higher numbers go after lower numbers */
|
|
354
354
|
order?: number;
|
|
355
355
|
data?: components["schemas"]["ProjectMapNodeData"];
|
|
356
356
|
/** @description The name of the projectMap entry */
|
|
@@ -388,13 +388,13 @@ interface components {
|
|
|
388
388
|
/** @description Last segment of the url in this locale */
|
|
389
389
|
pathSegment: string;
|
|
390
390
|
/**
|
|
391
|
-
* @description When false, the node explicitly defines a locale
|
|
391
|
+
* @description When false, the node explicitly defines a locale-specific path segment.
|
|
392
392
|
*
|
|
393
|
-
* When true, an ancestor defines a locale
|
|
393
|
+
* When true, an ancestor defines a locale-specific path segment,
|
|
394
394
|
* which makes its descendants resolvable using that segment.
|
|
395
|
-
* This node does not define a locale
|
|
395
|
+
* This node does not define a locale-specific path segment.
|
|
396
396
|
*
|
|
397
|
-
* Only included if requested with the expanded flag. Without the expanded flag, inherited locales are not included in the response
|
|
397
|
+
* Only included if requested with the expanded flag. Without the expanded flag, inherited locales are not included in the response
|
|
398
398
|
*/
|
|
399
399
|
inherited?: boolean;
|
|
400
400
|
};
|
|
@@ -412,22 +412,22 @@ interface components {
|
|
|
412
412
|
*/
|
|
413
413
|
id?: string;
|
|
414
414
|
}[];
|
|
415
|
-
/** @description Basic information about a composition from the context of a project map node
|
|
415
|
+
/** @description Basic information about a composition from the context of a project map node */
|
|
416
416
|
ProjectMapNodeCompositionData: {
|
|
417
417
|
/** @description Type of the composition instance (public_id of its definition) */
|
|
418
418
|
type: string;
|
|
419
419
|
/**
|
|
420
420
|
* Format: uuid
|
|
421
|
-
* @description The public UUID of the composition
|
|
421
|
+
* @description The public UUID of the composition
|
|
422
422
|
*/
|
|
423
423
|
id: string;
|
|
424
|
-
/** @description Slug pattern of this composition
|
|
424
|
+
/** @description Slug pattern of this composition */
|
|
425
425
|
slug?: string | null;
|
|
426
|
-
/** @description Friendly name of this composition
|
|
426
|
+
/** @description Friendly name of this composition */
|
|
427
427
|
name: string;
|
|
428
428
|
/**
|
|
429
429
|
* @deprecated
|
|
430
|
-
* @description UI status value. Subject to change without notice; do not rely on this value. Only present when `withCompositionUIStatus` option is true
|
|
430
|
+
* @description UI status value. Subject to change without notice; do not rely on this value. Only present when `withCompositionUIStatus` option is true
|
|
431
431
|
* @enum {string}
|
|
432
432
|
*/
|
|
433
433
|
uiStatus?: "Draft" | "Modified" | "Published" | "Orphan";
|
|
@@ -438,8 +438,13 @@ interface components {
|
|
|
438
438
|
icon?: string;
|
|
439
439
|
/** @description Friendly name of this Composition's Definition */
|
|
440
440
|
typeName?: string;
|
|
441
|
-
/** @description List of locales that the composition is available in. If empty, available in all locales
|
|
441
|
+
/** @description List of locales that the composition is available in. If empty, available in all locales */
|
|
442
442
|
locales: string[];
|
|
443
|
+
/**
|
|
444
|
+
* Format: date-time
|
|
445
|
+
* @description Date and time the composition was last modified (or created if never modified). Uses ISO-8859-1 formatting and UTC timezone.
|
|
446
|
+
*/
|
|
447
|
+
modified?: string;
|
|
443
448
|
};
|
|
444
449
|
ProjectMapNodeUpdate: {
|
|
445
450
|
/**
|
|
@@ -449,7 +454,7 @@ interface components {
|
|
|
449
454
|
id?: string;
|
|
450
455
|
/** @description Path representing the path to the current node */
|
|
451
456
|
path: string;
|
|
452
|
-
/** @description Ordering of the node, higher numbers go after lower numbers
|
|
457
|
+
/** @description Ordering of the node, higher numbers go after lower numbers */
|
|
453
458
|
order?: number;
|
|
454
459
|
data?: components["schemas"]["ProjectMapNodeData"];
|
|
455
460
|
/** @description The name of the projectMap entry */
|
|
@@ -484,7 +489,7 @@ interface components {
|
|
|
484
489
|
/**
|
|
485
490
|
* @description For dynamic nodes, this is the preview value for the dynamic value.
|
|
486
491
|
* The preview value is used when editing a connected composition, and is the default
|
|
487
|
-
* dynamic node value unless the author has explicitly chosen a different value
|
|
492
|
+
* dynamic node value unless the author has explicitly chosen a different value
|
|
488
493
|
*/
|
|
489
494
|
previewValue?: string;
|
|
490
495
|
};
|
|
@@ -614,25 +619,13 @@ declare class ProjectMapClient extends ApiClient<ProjectMapClientOptions> {
|
|
|
614
619
|
* Get available project map defintions
|
|
615
620
|
*/
|
|
616
621
|
getProjectMapDefinitions: () => Promise<{
|
|
617
|
-
projectMaps:
|
|
618
|
-
id?: string | undefined;
|
|
619
|
-
name: string;
|
|
620
|
-
description?: string | undefined;
|
|
621
|
-
baseUrl?: string | undefined;
|
|
622
|
-
default?: boolean | undefined;
|
|
623
|
-
}[];
|
|
622
|
+
projectMaps: components$1["schemas"]["ProjectMapDefinition"][];
|
|
624
623
|
}>;
|
|
625
624
|
/**
|
|
626
625
|
* Get specific project map definition
|
|
627
626
|
*/
|
|
628
627
|
getProjectMapDefinition: (options: WithoutProjectId<ProjectMapGetRequest>) => Promise<{
|
|
629
|
-
projectMaps:
|
|
630
|
-
id?: string | undefined;
|
|
631
|
-
name: string;
|
|
632
|
-
description?: string | undefined;
|
|
633
|
-
baseUrl?: string | undefined;
|
|
634
|
-
default?: boolean | undefined;
|
|
635
|
-
}[];
|
|
628
|
+
projectMaps: components$1["schemas"]["ProjectMapDefinition"][];
|
|
636
629
|
}>;
|
|
637
630
|
/**
|
|
638
631
|
* Update or insert a project map definition
|
|
@@ -664,6 +657,12 @@ declare class ProjectMapClient extends ApiClient<ProjectMapClientOptions> {
|
|
|
664
657
|
declare class UncachedProjectMapClient extends ProjectMapClient {
|
|
665
658
|
constructor(options: Omit<ProjectMapClientOptions, 'bypassCache'>);
|
|
666
659
|
}
|
|
660
|
+
/**
|
|
661
|
+
* Internal use only.
|
|
662
|
+
*
|
|
663
|
+
* @deprecated
|
|
664
|
+
*/
|
|
665
|
+
declare const __INTERNAL_MISSING_PARENT_NODE_ERROR = "Upsert failed, parent node not found.";
|
|
667
666
|
|
|
668
667
|
type LocalePathNode = Pick<ProjectMapNode, 'path'> & {
|
|
669
668
|
locales?: Record<string, {
|
|
@@ -729,4 +728,4 @@ declare class Route {
|
|
|
729
728
|
static dynamicSegmentPrefix: string;
|
|
730
729
|
}
|
|
731
730
|
|
|
732
|
-
export { type AlternateLocaleUrls, type ExpandOptions, type LocalePathNode, type MatchedRoute, type NodeType, ProjectMapClient, type ProjectMapClientOptions, type ProjectMapDefinition, type ProjectMapDefinitionWithId, type ProjectMapDefinitions, type ProjectMapDeleteRequest, type ProjectMapGetRequest, type ProjectMapGetResponse, type ProjectMapNode, type ProjectMapNodeAllowedQueryString, type ProjectMapNodeData, type ProjectMapNodeDeleteRequest, type ProjectMapNodeGetRequest, type ProjectMapNodeGetResponse, type ProjectMapNodeLocale, type ProjectMapNodeUpsertRequest, type ProjectMapNodeUpsertRequestNode, type ProjectMapNodeUpsertRequestNodeLocale, type ProjectMapNodeWithId, type ProjectMapNodeWithProjectMapReference, type ProjectMapSubtree, type ProjectMapUpsertRequest, type ProjectMapUpsertResponse, ROOT_NODE_PATH, Route, UncachedProjectMapClient, type UnmatchedRoute, getNodeLocalePath, getRouteAlternateLocalesUrls };
|
|
731
|
+
export { type AlternateLocaleUrls, type ExpandOptions, type LocalePathNode, type MatchedRoute, type NodeType, ProjectMapClient, type ProjectMapClientOptions, type ProjectMapDefinition, type ProjectMapDefinitionWithId, type ProjectMapDefinitions, type ProjectMapDeleteRequest, type ProjectMapGetRequest, type ProjectMapGetResponse, type ProjectMapNode, type ProjectMapNodeAllowedQueryString, type ProjectMapNodeData, type ProjectMapNodeDeleteRequest, type ProjectMapNodeGetRequest, type ProjectMapNodeGetResponse, type ProjectMapNodeLocale, type ProjectMapNodeUpsertRequest, type ProjectMapNodeUpsertRequestNode, type ProjectMapNodeUpsertRequestNodeLocale, type ProjectMapNodeWithId, type ProjectMapNodeWithProjectMapReference, type ProjectMapSubtree, type ProjectMapUpsertRequest, type ProjectMapUpsertResponse, ROOT_NODE_PATH, Route, UncachedProjectMapClient, type UnmatchedRoute, __INTERNAL_MISSING_PARENT_NODE_ERROR, getNodeLocalePath, getRouteAlternateLocalesUrls };
|
package/dist/index.esm.js
CHANGED
|
@@ -1,25 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
throw TypeError("Cannot " + msg);
|
|
4
|
-
};
|
|
5
|
-
var __privateGet = (obj, member, getter) => {
|
|
6
|
-
__accessCheck(obj, member, "read from private field");
|
|
7
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
8
|
-
};
|
|
9
|
-
var __privateAdd = (obj, member, value) => {
|
|
10
|
-
if (member.has(obj))
|
|
11
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
12
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
13
|
-
};
|
|
14
|
-
var __privateSet = (obj, member, value, setter) => {
|
|
15
|
-
__accessCheck(obj, member, "write to private field");
|
|
16
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
17
|
-
return value;
|
|
18
|
-
};
|
|
19
|
-
var __privateMethod = (obj, member, method) => {
|
|
20
|
-
__accessCheck(obj, member, "access private method");
|
|
21
|
-
return method;
|
|
1
|
+
var __typeError = (msg) => {
|
|
2
|
+
throw TypeError(msg);
|
|
22
3
|
};
|
|
4
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
5
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
6
|
+
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);
|
|
7
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
8
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
23
9
|
|
|
24
10
|
// src/projectMapClient.ts
|
|
25
11
|
import { ApiClient } from "@uniformdev/context/api";
|
|
@@ -192,30 +178,30 @@ var cutReferences = (node) => node ? {
|
|
|
192
178
|
parent: void 0,
|
|
193
179
|
children: void 0
|
|
194
180
|
} : void 0;
|
|
181
|
+
var __INTERNAL_MISSING_PARENT_NODE_ERROR = "Upsert failed, parent node not found.";
|
|
195
182
|
|
|
196
183
|
// src/util/getNodeLocalePath.ts
|
|
197
184
|
function getNodeLocalePath(node, locale) {
|
|
198
185
|
var _a, _b;
|
|
199
|
-
if (!node)
|
|
200
|
-
return null;
|
|
186
|
+
if (!node) return null;
|
|
201
187
|
return locale ? ((_b = (_a = node.locales) == null ? void 0 : _a[locale]) == null ? void 0 : _b.path) || node.path : node.path;
|
|
202
188
|
}
|
|
203
189
|
|
|
204
190
|
// src/util/Route.ts
|
|
205
191
|
import { createVariableReference, parseVariableExpression } from "@uniformdev/canvas";
|
|
206
|
-
var _routeInfo,
|
|
192
|
+
var _routeInfo, _Route_static, parseRouteOrPath_fn, isDynamicRouteSegment_fn;
|
|
207
193
|
var _Route = class _Route {
|
|
208
194
|
constructor(route) {
|
|
209
195
|
this.route = route;
|
|
210
|
-
__privateAdd(this, _routeInfo
|
|
196
|
+
__privateAdd(this, _routeInfo);
|
|
211
197
|
var _a;
|
|
212
|
-
__privateSet(this, _routeInfo, __privateMethod(_a = _Route,
|
|
198
|
+
__privateSet(this, _routeInfo, __privateMethod(_a = _Route, _Route_static, parseRouteOrPath_fn).call(_a, this.route));
|
|
213
199
|
}
|
|
214
200
|
get dynamicSegmentCount() {
|
|
215
201
|
return __privateGet(this, _routeInfo).segments.reduce(
|
|
216
202
|
(count, segment) => {
|
|
217
203
|
var _a;
|
|
218
|
-
return __privateMethod(_a = _Route,
|
|
204
|
+
return __privateMethod(_a = _Route, _Route_static, isDynamicRouteSegment_fn).call(_a, segment) ? count + 1 : count;
|
|
219
205
|
},
|
|
220
206
|
0
|
|
221
207
|
);
|
|
@@ -223,7 +209,7 @@ var _Route = class _Route {
|
|
|
223
209
|
/** Tests if an incoming path matches this route */
|
|
224
210
|
matches(path) {
|
|
225
211
|
var _a, _b;
|
|
226
|
-
const { segments: pathSegments, queryParams: pathQuery } = __privateMethod(_a = _Route,
|
|
212
|
+
const { segments: pathSegments, queryParams: pathQuery } = __privateMethod(_a = _Route, _Route_static, parseRouteOrPath_fn).call(_a, path);
|
|
227
213
|
const { segments: routeSegments } = __privateGet(this, _routeInfo);
|
|
228
214
|
if (pathSegments.length !== routeSegments.length) {
|
|
229
215
|
return { match: false };
|
|
@@ -237,7 +223,7 @@ var _Route = class _Route {
|
|
|
237
223
|
for (let i = 0; i < routeSegments.length; i++) {
|
|
238
224
|
const routeSegment = routeSegments[i];
|
|
239
225
|
const pathSegment = pathSegments[i];
|
|
240
|
-
if (__privateMethod(_b = _Route,
|
|
226
|
+
if (__privateMethod(_b = _Route, _Route_static, isDynamicRouteSegment_fn).call(_b, routeSegment)) {
|
|
241
227
|
const key = routeSegment.slice(1);
|
|
242
228
|
possibleMatch.pathParams[key] = pathSegment;
|
|
243
229
|
possibleMatch.dynamicSegmentCount++;
|
|
@@ -280,14 +266,14 @@ var _Route = class _Route {
|
|
|
280
266
|
}
|
|
281
267
|
static getDynamicRouteSegmentName(segment) {
|
|
282
268
|
var _a;
|
|
283
|
-
if (!__privateMethod(_a = _Route,
|
|
269
|
+
if (!__privateMethod(_a = _Route, _Route_static, isDynamicRouteSegment_fn).call(_a, segment)) {
|
|
284
270
|
return void 0;
|
|
285
271
|
}
|
|
286
272
|
return segment.slice(_Route.dynamicSegmentPrefix.length);
|
|
287
273
|
}
|
|
288
274
|
};
|
|
289
275
|
_routeInfo = new WeakMap();
|
|
290
|
-
|
|
276
|
+
_Route_static = new WeakSet();
|
|
291
277
|
parseRouteOrPath_fn = function(path) {
|
|
292
278
|
if (!path.startsWith("/") || path === "") {
|
|
293
279
|
throw new Error(`Path must start with a slash: ${path}`);
|
|
@@ -300,15 +286,13 @@ parseRouteOrPath_fn = function(path) {
|
|
|
300
286
|
const queryParams = new URLSearchParams(queryString);
|
|
301
287
|
return { segments: pathSegments, queryParams };
|
|
302
288
|
};
|
|
303
|
-
_isDynamicRouteSegment = new WeakSet();
|
|
304
289
|
isDynamicRouteSegment_fn = function(segment) {
|
|
305
290
|
if (!segment) {
|
|
306
291
|
return false;
|
|
307
292
|
}
|
|
308
293
|
return segment.startsWith(_Route.dynamicSegmentPrefix);
|
|
309
294
|
};
|
|
310
|
-
__privateAdd(_Route,
|
|
311
|
-
__privateAdd(_Route, _isDynamicRouteSegment);
|
|
295
|
+
__privateAdd(_Route, _Route_static);
|
|
312
296
|
_Route.dynamicSegmentPrefix = ":";
|
|
313
297
|
var Route = _Route;
|
|
314
298
|
function encodeRouteComponent(value, doNotEscapeVariables) {
|
|
@@ -358,6 +342,7 @@ export {
|
|
|
358
342
|
ROOT_NODE_PATH,
|
|
359
343
|
Route,
|
|
360
344
|
UncachedProjectMapClient,
|
|
345
|
+
__INTERNAL_MISSING_PARENT_NODE_ERROR,
|
|
361
346
|
getNodeLocalePath,
|
|
362
347
|
getRouteAlternateLocalesUrls
|
|
363
348
|
};
|
package/dist/index.js
CHANGED
|
@@ -3,6 +3,9 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __typeError = (msg) => {
|
|
7
|
+
throw TypeError(msg);
|
|
8
|
+
};
|
|
6
9
|
var __export = (target, all) => {
|
|
7
10
|
for (var name in all)
|
|
8
11
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -16,28 +19,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
19
|
return to;
|
|
17
20
|
};
|
|
18
21
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var __accessCheck = (obj, member, msg) =>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
var
|
|
24
|
-
__accessCheck(obj, member, "read from private field");
|
|
25
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
26
|
-
};
|
|
27
|
-
var __privateAdd = (obj, member, value) => {
|
|
28
|
-
if (member.has(obj))
|
|
29
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
30
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
31
|
-
};
|
|
32
|
-
var __privateSet = (obj, member, value, setter) => {
|
|
33
|
-
__accessCheck(obj, member, "write to private field");
|
|
34
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
35
|
-
return value;
|
|
36
|
-
};
|
|
37
|
-
var __privateMethod = (obj, member, method) => {
|
|
38
|
-
__accessCheck(obj, member, "access private method");
|
|
39
|
-
return method;
|
|
40
|
-
};
|
|
22
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
23
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
24
|
+
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);
|
|
25
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
26
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
41
27
|
|
|
42
28
|
// src/index.ts
|
|
43
29
|
var src_exports = {};
|
|
@@ -46,6 +32,7 @@ __export(src_exports, {
|
|
|
46
32
|
ROOT_NODE_PATH: () => ROOT_NODE_PATH,
|
|
47
33
|
Route: () => Route,
|
|
48
34
|
UncachedProjectMapClient: () => UncachedProjectMapClient,
|
|
35
|
+
__INTERNAL_MISSING_PARENT_NODE_ERROR: () => __INTERNAL_MISSING_PARENT_NODE_ERROR,
|
|
49
36
|
getNodeLocalePath: () => getNodeLocalePath,
|
|
50
37
|
getRouteAlternateLocalesUrls: () => getRouteAlternateLocalesUrls
|
|
51
38
|
});
|
|
@@ -222,30 +209,30 @@ var cutReferences = (node) => node ? {
|
|
|
222
209
|
parent: void 0,
|
|
223
210
|
children: void 0
|
|
224
211
|
} : void 0;
|
|
212
|
+
var __INTERNAL_MISSING_PARENT_NODE_ERROR = "Upsert failed, parent node not found.";
|
|
225
213
|
|
|
226
214
|
// src/util/getNodeLocalePath.ts
|
|
227
215
|
function getNodeLocalePath(node, locale) {
|
|
228
216
|
var _a, _b;
|
|
229
|
-
if (!node)
|
|
230
|
-
return null;
|
|
217
|
+
if (!node) return null;
|
|
231
218
|
return locale ? ((_b = (_a = node.locales) == null ? void 0 : _a[locale]) == null ? void 0 : _b.path) || node.path : node.path;
|
|
232
219
|
}
|
|
233
220
|
|
|
234
221
|
// src/util/Route.ts
|
|
235
222
|
var import_canvas = require("@uniformdev/canvas");
|
|
236
|
-
var _routeInfo,
|
|
223
|
+
var _routeInfo, _Route_static, parseRouteOrPath_fn, isDynamicRouteSegment_fn;
|
|
237
224
|
var _Route = class _Route {
|
|
238
225
|
constructor(route) {
|
|
239
226
|
this.route = route;
|
|
240
|
-
__privateAdd(this, _routeInfo
|
|
227
|
+
__privateAdd(this, _routeInfo);
|
|
241
228
|
var _a;
|
|
242
|
-
__privateSet(this, _routeInfo, __privateMethod(_a = _Route,
|
|
229
|
+
__privateSet(this, _routeInfo, __privateMethod(_a = _Route, _Route_static, parseRouteOrPath_fn).call(_a, this.route));
|
|
243
230
|
}
|
|
244
231
|
get dynamicSegmentCount() {
|
|
245
232
|
return __privateGet(this, _routeInfo).segments.reduce(
|
|
246
233
|
(count, segment) => {
|
|
247
234
|
var _a;
|
|
248
|
-
return __privateMethod(_a = _Route,
|
|
235
|
+
return __privateMethod(_a = _Route, _Route_static, isDynamicRouteSegment_fn).call(_a, segment) ? count + 1 : count;
|
|
249
236
|
},
|
|
250
237
|
0
|
|
251
238
|
);
|
|
@@ -253,7 +240,7 @@ var _Route = class _Route {
|
|
|
253
240
|
/** Tests if an incoming path matches this route */
|
|
254
241
|
matches(path) {
|
|
255
242
|
var _a, _b;
|
|
256
|
-
const { segments: pathSegments, queryParams: pathQuery } = __privateMethod(_a = _Route,
|
|
243
|
+
const { segments: pathSegments, queryParams: pathQuery } = __privateMethod(_a = _Route, _Route_static, parseRouteOrPath_fn).call(_a, path);
|
|
257
244
|
const { segments: routeSegments } = __privateGet(this, _routeInfo);
|
|
258
245
|
if (pathSegments.length !== routeSegments.length) {
|
|
259
246
|
return { match: false };
|
|
@@ -267,7 +254,7 @@ var _Route = class _Route {
|
|
|
267
254
|
for (let i = 0; i < routeSegments.length; i++) {
|
|
268
255
|
const routeSegment = routeSegments[i];
|
|
269
256
|
const pathSegment = pathSegments[i];
|
|
270
|
-
if (__privateMethod(_b = _Route,
|
|
257
|
+
if (__privateMethod(_b = _Route, _Route_static, isDynamicRouteSegment_fn).call(_b, routeSegment)) {
|
|
271
258
|
const key = routeSegment.slice(1);
|
|
272
259
|
possibleMatch.pathParams[key] = pathSegment;
|
|
273
260
|
possibleMatch.dynamicSegmentCount++;
|
|
@@ -310,14 +297,14 @@ var _Route = class _Route {
|
|
|
310
297
|
}
|
|
311
298
|
static getDynamicRouteSegmentName(segment) {
|
|
312
299
|
var _a;
|
|
313
|
-
if (!__privateMethod(_a = _Route,
|
|
300
|
+
if (!__privateMethod(_a = _Route, _Route_static, isDynamicRouteSegment_fn).call(_a, segment)) {
|
|
314
301
|
return void 0;
|
|
315
302
|
}
|
|
316
303
|
return segment.slice(_Route.dynamicSegmentPrefix.length);
|
|
317
304
|
}
|
|
318
305
|
};
|
|
319
306
|
_routeInfo = new WeakMap();
|
|
320
|
-
|
|
307
|
+
_Route_static = new WeakSet();
|
|
321
308
|
parseRouteOrPath_fn = function(path) {
|
|
322
309
|
if (!path.startsWith("/") || path === "") {
|
|
323
310
|
throw new Error(`Path must start with a slash: ${path}`);
|
|
@@ -330,15 +317,13 @@ parseRouteOrPath_fn = function(path) {
|
|
|
330
317
|
const queryParams = new URLSearchParams(queryString);
|
|
331
318
|
return { segments: pathSegments, queryParams };
|
|
332
319
|
};
|
|
333
|
-
_isDynamicRouteSegment = new WeakSet();
|
|
334
320
|
isDynamicRouteSegment_fn = function(segment) {
|
|
335
321
|
if (!segment) {
|
|
336
322
|
return false;
|
|
337
323
|
}
|
|
338
324
|
return segment.startsWith(_Route.dynamicSegmentPrefix);
|
|
339
325
|
};
|
|
340
|
-
__privateAdd(_Route,
|
|
341
|
-
__privateAdd(_Route, _isDynamicRouteSegment);
|
|
326
|
+
__privateAdd(_Route, _Route_static);
|
|
342
327
|
_Route.dynamicSegmentPrefix = ":";
|
|
343
328
|
var Route = _Route;
|
|
344
329
|
function encodeRouteComponent(value, doNotEscapeVariables) {
|
|
@@ -389,6 +374,7 @@ function getRouteAlternateLocalesUrls(routeResponse) {
|
|
|
389
374
|
ROOT_NODE_PATH,
|
|
390
375
|
Route,
|
|
391
376
|
UncachedProjectMapClient,
|
|
377
|
+
__INTERNAL_MISSING_PARENT_NODE_ERROR,
|
|
392
378
|
getNodeLocalePath,
|
|
393
379
|
getRouteAlternateLocalesUrls
|
|
394
380
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -1,25 +1,11 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
throw TypeError("Cannot " + msg);
|
|
4
|
-
};
|
|
5
|
-
var __privateGet = (obj, member, getter) => {
|
|
6
|
-
__accessCheck(obj, member, "read from private field");
|
|
7
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
8
|
-
};
|
|
9
|
-
var __privateAdd = (obj, member, value) => {
|
|
10
|
-
if (member.has(obj))
|
|
11
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
12
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
13
|
-
};
|
|
14
|
-
var __privateSet = (obj, member, value, setter) => {
|
|
15
|
-
__accessCheck(obj, member, "write to private field");
|
|
16
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
17
|
-
return value;
|
|
18
|
-
};
|
|
19
|
-
var __privateMethod = (obj, member, method) => {
|
|
20
|
-
__accessCheck(obj, member, "access private method");
|
|
21
|
-
return method;
|
|
1
|
+
var __typeError = (msg) => {
|
|
2
|
+
throw TypeError(msg);
|
|
22
3
|
};
|
|
4
|
+
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
5
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
6
|
+
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);
|
|
7
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
8
|
+
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
23
9
|
|
|
24
10
|
// src/projectMapClient.ts
|
|
25
11
|
import { ApiClient } from "@uniformdev/context/api";
|
|
@@ -192,30 +178,30 @@ var cutReferences = (node) => node ? {
|
|
|
192
178
|
parent: void 0,
|
|
193
179
|
children: void 0
|
|
194
180
|
} : void 0;
|
|
181
|
+
var __INTERNAL_MISSING_PARENT_NODE_ERROR = "Upsert failed, parent node not found.";
|
|
195
182
|
|
|
196
183
|
// src/util/getNodeLocalePath.ts
|
|
197
184
|
function getNodeLocalePath(node, locale) {
|
|
198
185
|
var _a, _b;
|
|
199
|
-
if (!node)
|
|
200
|
-
return null;
|
|
186
|
+
if (!node) return null;
|
|
201
187
|
return locale ? ((_b = (_a = node.locales) == null ? void 0 : _a[locale]) == null ? void 0 : _b.path) || node.path : node.path;
|
|
202
188
|
}
|
|
203
189
|
|
|
204
190
|
// src/util/Route.ts
|
|
205
191
|
import { createVariableReference, parseVariableExpression } from "@uniformdev/canvas";
|
|
206
|
-
var _routeInfo,
|
|
192
|
+
var _routeInfo, _Route_static, parseRouteOrPath_fn, isDynamicRouteSegment_fn;
|
|
207
193
|
var _Route = class _Route {
|
|
208
194
|
constructor(route) {
|
|
209
195
|
this.route = route;
|
|
210
|
-
__privateAdd(this, _routeInfo
|
|
196
|
+
__privateAdd(this, _routeInfo);
|
|
211
197
|
var _a;
|
|
212
|
-
__privateSet(this, _routeInfo, __privateMethod(_a = _Route,
|
|
198
|
+
__privateSet(this, _routeInfo, __privateMethod(_a = _Route, _Route_static, parseRouteOrPath_fn).call(_a, this.route));
|
|
213
199
|
}
|
|
214
200
|
get dynamicSegmentCount() {
|
|
215
201
|
return __privateGet(this, _routeInfo).segments.reduce(
|
|
216
202
|
(count, segment) => {
|
|
217
203
|
var _a;
|
|
218
|
-
return __privateMethod(_a = _Route,
|
|
204
|
+
return __privateMethod(_a = _Route, _Route_static, isDynamicRouteSegment_fn).call(_a, segment) ? count + 1 : count;
|
|
219
205
|
},
|
|
220
206
|
0
|
|
221
207
|
);
|
|
@@ -223,7 +209,7 @@ var _Route = class _Route {
|
|
|
223
209
|
/** Tests if an incoming path matches this route */
|
|
224
210
|
matches(path) {
|
|
225
211
|
var _a, _b;
|
|
226
|
-
const { segments: pathSegments, queryParams: pathQuery } = __privateMethod(_a = _Route,
|
|
212
|
+
const { segments: pathSegments, queryParams: pathQuery } = __privateMethod(_a = _Route, _Route_static, parseRouteOrPath_fn).call(_a, path);
|
|
227
213
|
const { segments: routeSegments } = __privateGet(this, _routeInfo);
|
|
228
214
|
if (pathSegments.length !== routeSegments.length) {
|
|
229
215
|
return { match: false };
|
|
@@ -237,7 +223,7 @@ var _Route = class _Route {
|
|
|
237
223
|
for (let i = 0; i < routeSegments.length; i++) {
|
|
238
224
|
const routeSegment = routeSegments[i];
|
|
239
225
|
const pathSegment = pathSegments[i];
|
|
240
|
-
if (__privateMethod(_b = _Route,
|
|
226
|
+
if (__privateMethod(_b = _Route, _Route_static, isDynamicRouteSegment_fn).call(_b, routeSegment)) {
|
|
241
227
|
const key = routeSegment.slice(1);
|
|
242
228
|
possibleMatch.pathParams[key] = pathSegment;
|
|
243
229
|
possibleMatch.dynamicSegmentCount++;
|
|
@@ -280,14 +266,14 @@ var _Route = class _Route {
|
|
|
280
266
|
}
|
|
281
267
|
static getDynamicRouteSegmentName(segment) {
|
|
282
268
|
var _a;
|
|
283
|
-
if (!__privateMethod(_a = _Route,
|
|
269
|
+
if (!__privateMethod(_a = _Route, _Route_static, isDynamicRouteSegment_fn).call(_a, segment)) {
|
|
284
270
|
return void 0;
|
|
285
271
|
}
|
|
286
272
|
return segment.slice(_Route.dynamicSegmentPrefix.length);
|
|
287
273
|
}
|
|
288
274
|
};
|
|
289
275
|
_routeInfo = new WeakMap();
|
|
290
|
-
|
|
276
|
+
_Route_static = new WeakSet();
|
|
291
277
|
parseRouteOrPath_fn = function(path) {
|
|
292
278
|
if (!path.startsWith("/") || path === "") {
|
|
293
279
|
throw new Error(`Path must start with a slash: ${path}`);
|
|
@@ -300,15 +286,13 @@ parseRouteOrPath_fn = function(path) {
|
|
|
300
286
|
const queryParams = new URLSearchParams(queryString);
|
|
301
287
|
return { segments: pathSegments, queryParams };
|
|
302
288
|
};
|
|
303
|
-
_isDynamicRouteSegment = new WeakSet();
|
|
304
289
|
isDynamicRouteSegment_fn = function(segment) {
|
|
305
290
|
if (!segment) {
|
|
306
291
|
return false;
|
|
307
292
|
}
|
|
308
293
|
return segment.startsWith(_Route.dynamicSegmentPrefix);
|
|
309
294
|
};
|
|
310
|
-
__privateAdd(_Route,
|
|
311
|
-
__privateAdd(_Route, _isDynamicRouteSegment);
|
|
295
|
+
__privateAdd(_Route, _Route_static);
|
|
312
296
|
_Route.dynamicSegmentPrefix = ":";
|
|
313
297
|
var Route = _Route;
|
|
314
298
|
function encodeRouteComponent(value, doNotEscapeVariables) {
|
|
@@ -358,6 +342,7 @@ export {
|
|
|
358
342
|
ROOT_NODE_PATH,
|
|
359
343
|
Route,
|
|
360
344
|
UncachedProjectMapClient,
|
|
345
|
+
__INTERNAL_MISSING_PARENT_NODE_ERROR,
|
|
361
346
|
getNodeLocalePath,
|
|
362
347
|
getRouteAlternateLocalesUrls
|
|
363
348
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/project-map",
|
|
3
|
-
"version": "19.135.1-alpha.
|
|
3
|
+
"version": "19.135.1-alpha.12+5743153a1e",
|
|
4
4
|
"description": "Uniform Project Map",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"/dist"
|
|
34
34
|
],
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@uniformdev/canvas": "19.135.1-alpha.
|
|
37
|
-
"@uniformdev/context": "19.135.1-alpha.
|
|
36
|
+
"@uniformdev/canvas": "19.135.1-alpha.12+5743153a1e",
|
|
37
|
+
"@uniformdev/context": "19.135.1-alpha.12+5743153a1e"
|
|
38
38
|
},
|
|
39
39
|
"publishConfig": {
|
|
40
40
|
"access": "public"
|
|
41
41
|
},
|
|
42
|
-
"gitHead": "
|
|
42
|
+
"gitHead": "5743153a1e4308de3dfe7c0812eb493154421a71"
|
|
43
43
|
}
|