import { ApiClient, ClientOptions } from '@uniformdev/context/api'; import { RouteGetResponse } from '@uniformdev/canvas'; interface paths$1 { "/api/v1/project-map": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** @description Called to retrieve a list of project maps related to a project or a specific project map by id */ get: { parameters: { query: { /** @description The project to fetch project map for */ projectId: string; /** @description The id of the project map to fetch */ projectMapId?: string; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { projectMaps: components$2["schemas"]["ProjectMapDefinition"][]; }; }; }; 400: components$2["responses"]["BadRequestError"]; 401: components$2["responses"]["UnauthorizedError"]; 403: components$2["responses"]["ForbiddenError"]; 429: components$2["responses"]["RateLimitError"]; 500: components$2["responses"]["InternalServerError"]; }; }; put: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** @description Project map object to insert */ projectMap: components$2["schemas"]["ProjectMapDefinition"]; /** * Format: uuid * @description Project id to insert the projectMap into */ projectId: string; }; }; }; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { /** * Format: uuid * @description Id of the projectMap */ projectMapId: string; }; }; }; /** @description OK */ 204: { headers: { [name: string]: unknown; }; content?: never; }; 400: components$2["responses"]["BadRequestError"]; 401: components$2["responses"]["UnauthorizedError"]; 403: components$2["responses"]["ForbiddenError"]; 429: components$2["responses"]["RateLimitError"]; 500: components$2["responses"]["InternalServerError"]; }; }; post?: never; /** @description Called to delete a projectMap */ delete: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * Format: uuid * @description Id of the project that this projectMap belongs to */ projectId: string; /** * Format: uuid * @description Id of the projectMap to delete */ projectMapId: string; }; }; }; responses: { /** @description OK */ 204: { headers: { [name: string]: unknown; }; content?: never; }; 400: components$2["responses"]["BadRequestError"]; 401: components$2["responses"]["UnauthorizedError"]; 403: components$2["responses"]["ForbiddenError"]; 429: components$2["responses"]["RateLimitError"]; 500: components$2["responses"]["InternalServerError"]; }; }; /** @description Handles preflight requests. This endpoint allows CORS */ options: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 204: { headers: { [name: string]: unknown; }; content?: never; }; }; }; head?: never; patch?: never; trace?: never; }; } interface components$2 { schemas: { ProjectMapDefinition: { /** @description The id of the projectMap node */ id?: string; /** @description The name of the projectMap node */ name: string; /** @description Description of the projectMap node */ description?: string; /** @description The prefix of the url generated by this projectMap */ baseUrl?: string; default?: boolean; /** @description Global query strings that are allowed on all nodes in this project map */ globalQueryStrings?: components$2["schemas"]["ProjectMapNodeAllowedQueryString"][]; }; ProjectMapNodeAllowedQueryString: { /** @description The name of the query string parameter */ name: string; /** @description The default value of the query string if it is not provided by an incoming route path */ value?: string; /** @description Help text for authors who might be setting up a preview value for this query string */ helpText?: string; /** @description Configuration for providing a list of allowed values for this query string */ optionsSource?: { /** * @description The source type for the options * @enum {string} */ source: "static"; options: { /** @description Display name for the option */ name: string; /** @description The actual value to be used */ value: string; }[]; }; }; Error: { /** @description Error message(s) that occurred while processing the request */ errorMessage?: string[] | string; }; }; responses: { /** @description Request input validation failed */ BadRequestError: { headers: { [name: string]: unknown; }; content: { "application/json": components$2["schemas"]["Error"]; }; }; /** @description API key or token was not valid */ UnauthorizedError: { headers: { [name: string]: unknown; }; content: { "application/json": components$2["schemas"]["Error"]; }; }; /** @description Permission was denied */ ForbiddenError: { headers: { [name: string]: unknown; }; content: { "application/json": components$2["schemas"]["Error"]; }; }; /** @description Too many requests in allowed time period */ RateLimitError: { headers: { [name: string]: unknown; }; content?: never; }; /** @description Execution error occurred */ InternalServerError: { headers: { [name: string]: unknown; }; content?: never; }; }; parameters: never; requestBodies: never; headers: never; pathItems: never; } interface components$1 { schemas: { ProjectMapNodeDefinition: { /** * Format: uuid * @description The id of the projectMap entry */ id: string; /** @description Path representing the path to the current node */ path: string; /** @description Ordering of the node, higher numbers go after lower numbers */ order?: number; data?: components$1["schemas"]["ProjectMapNodeData"]; /** @description The name of the projectMap entry */ name: string; /** * @description The type of the projectMap entry * @enum {string} */ type: "composition" | "placeholder"; /** * Format: uuid * @description The composition id related to the projectMap entry */ compositionId?: string; /** @description Description of the projectMap node */ description?: string; /** @description Parent path of the current node, only included if requested with the expanded flag */ parentPath?: string; /** @description Last segment of the url */ pathSegment?: string; /** @description returns true if the node is a leaf node, meaning having no children, only included if requested with the expanded flag */ isLeaf?: boolean; compositionData?: components$1["schemas"]["ProjectMapNodeCompositionData"]; sourceRedirects?: components$1["schemas"]["ProjectMapSourceRedirectData"]; targetRedirects?: components$1["schemas"]["ProjectMapTargetRedirectData"]; locales?: { [key: string]: components$1["schemas"]["ProjectMapNodeLocale"]; }; }; ProjectMapNodeLocale: { /** @description Name of node in the locale */ name?: string; /** @description Full path to the current node in this locale, only included if requested with the expanded flag */ path?: string; /** @description Last segment of the url in this locale */ pathSegment: string; /** * @description When false, the node explicitly defines a locale-specific path segment. * * When true, an ancestor defines a locale-specific path segment, * which makes its descendants resolvable using that segment. * This node does not define a locale-specific path segment. * * Only included if requested with the expanded flag. Without the expanded flag, inherited locales are not included in the response */ inherited?: boolean; }; ProjectMapSourceRedirectData: { /** * Format: uuid * @description The public UUID of the source redirect */ id?: string; }[]; ProjectMapTargetRedirectData: { /** * Format: uuid * @description The public UUID of the target redirect */ id?: string; }[]; /** * @description Basic information about the linked composition from the context of a project map node. * If the linked composition has editions, the editions are included in the `editions` property. */ ProjectMapNodeCompositionData: { /** @description Type of the linked composition (id of its definition) */ type: string; /** * Format: uuid * @description The UUID of the linked composition */ id: string; /** * Format: uuid * @description The edition UUID underneath the linked composition * This is only present if the composition has not been published, but an edition has */ editionId?: string; /** @description Slug pattern of the linked composition or edition */ slug?: string | null; /** @description Friendly name of this composition or edition */ name: string; /** * @deprecated * @description UI status value. Subject to change without notice; do not rely on this value. Only present when `withCompositionUIStatus` option is true * @enum {string} */ uiStatus?: "Draft" | "Modified" | "Published" | "Orphan"; /** * @description Icon name or URL for the composition definition (e.g. 'screen' or 'https://s3/my-component.jpg') * @default screen */ icon?: string; /** @description Friendly name of this Composition's Definition */ typeName?: string; /** * @description List of locales that the composition _or any of its editions_ is available in. * If empty, available in all locales. */ locales: string[]; /** @description Priority of the composition relative to any editions */ editionPriority?: number; /** @description Friendly name of the edition */ editionName?: string; /** * @description List of editions available for this composition. The composition is included in the list, it is the edition * where the editionID equals the node's compositionID. NOTE: this is not sent if only one edition is available */ editions?: components$1["schemas"]["ProjectMapNodeCompositionEditionData"][]; /** * Format: date-time * @description Date and time the composition was last modified (or created if never modified). * Uses ISO-8859-1 formatting and UTC timezone. * IMPORTANT: if the composition has more than one edition, this is the modified date of the default edition. Each edition has its own modified date in the `editions` array. */ modified?: string; }; /** @description Basic information about a composition edition from the context of a project map node */ ProjectMapNodeCompositionEditionData: { /** * Format: uuid * @description The UUID of the linked composition */ id: string; /** @description Type of the edition instance (public_id of its definition) */ type: string; /** * Format: uuid * @description The edition UUID underneath the linked composition */ editionId?: string; /** @description Slug pattern of this edition */ slug?: string | null; /** @description Friendly name of the linked composition */ name: string; /** @description Friendly name of the edition */ editionName?: string; /** @description Priority of the edition */ editionPriority?: number; /** * @deprecated * @description UI status value. Subject to change without notice; do not rely on this value. Only present when `withCompositionUIStatus` option is true * @enum {string} */ uiStatus?: "Draft" | "Modified" | "Published" | "Orphan"; /** * @description Icon name or URL for the composition edition (e.g. 'screen' or 'https://s3/my-component.jpg') * @default screen */ icon?: string; /** @description Friendly name of this edition's definition */ typeName?: string; /** @description List of locales that the edition is available in. If empty, available in all locales */ locales: string[]; /** * Format: date-time * @description Date and time the edition was last modified (or created if never modified). Uses ISO-8859-1 formatting and UTC timezone. */ modified?: string; }; ProjectMapNodeUpdate: { /** * Format: uuid * @description The id of the projectMap entry */ id?: string; /** @description Path representing the path to the current node */ path: string; /** @description Ordering of the node, higher numbers go after lower numbers */ order?: number; data?: components$1["schemas"]["ProjectMapNodeData"]; /** @description The name of the projectMap entry */ name: string; /** * @description The type of the projectMap entry * @enum {string} */ type: "composition" | "placeholder"; /** * Format: uuid * @description The composition id related to the projectMap entry */ compositionId?: string; /** @description Description of the projectMap node */ description?: string; locales?: { [key: string]: components$1["schemas"]["ProjectMapNodeLocaleUpdate"]; }; }; ProjectMapNodeLocaleUpdate: { /** @description Name of node in the locale */ name?: string; /** @description Locale specific path segment for this node (not a full path) */ pathSegment: string; }; ProjectMapNodeData: { /** @description While performing a search if a node is a hit, this property will return true. If it's supporting structure, like a parent of a search hit, it will return false */ isSearchHit?: boolean; /** @description Query strings that are allowed to be passed to the node */ queryStrings?: components$1["schemas"]["ProjectMapNodeAllowedQueryString"][]; /** * @description For dynamic nodes, this is the preview value for the dynamic value. * The preview value is used when editing a connected composition, and is the default * dynamic node value unless the author has explicitly chosen a different value */ previewValue?: string; }; ProjectMapNodeAllowedQueryString: { /** @description The name of the query string parameter */ name: string; /** @description The default value of the query string if it is not provided by an incoming route path */ value?: string; /** @description Help text for authors who might be setting up a preview value for this query string */ helpText?: string; /** @description Configuration for providing a list of allowed values for this query string */ optionsSource?: { /** * @description The source type for the options * @enum {string} */ source: "static"; options: { /** @description Display name for the option */ name: string; /** @description The actual value to be used */ value: string; }[]; }; }; }; responses: never; parameters: never; requestBodies: never; headers: never; pathItems: never; } interface paths { "/api/v1/project-map-nodes": { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; /** * @description Called to get a list of nodes belonging to a specific path or Id. * * Note on branch-scoped permissions: if the caller's role has a * branch-scoped PrmNodeRead policy (i.e. read access is configured for * specific project map branches only), the response is filtered * server-side to nodes within those branches. Consumers should not * assume the response contains the entire project map. Users with * unscoped PrmNodeRead, PrmSchema, or composition-level read permissions * receive the full set (backward-compatible behavior). */ get: { parameters: { query: { /** @description The project map id that the desired nodes belong */ projectMapId?: string; /** @description The project id that contains the project map tree that this node belongs to */ projectId: string; /** * @description The ID of a release to fetch the composition data for. * * - When unspecified, composition data is fetched from base. * - 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. * * 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 */ releaseId?: string; /** @description The id of the node to retrieve, cannot have both this parameter and `path` */ id?: string; /** @description The path of the root node to retrieve, cannot have both this parameter and `id` */ path?: string; /** @description Composition id to find associated project map node for */ compositionId?: string; /** @description Limit the number or records returned by a number */ limit?: number; /** @description Number of records to skip before returning nodes */ offset?: number; /** @description Depth of the tree to fetch. This only applies when fetching by path */ depth?: number; /** @description State of compositions to fetch. 0 = draft, 64 = published */ state?: number; /** @description should the data be returned as a json tree object (or a flat array) */ tree?: boolean; /** @description text search filter */ search?: string; /** * @description Modifies the results to include all ancestors of matched nodes, in addition to the nodes themselves. * Results are sorted by path. If multiple nodes are selected, ancestors are not duplicated */ includeAncestors?: boolean; /** @description include expanded helper computed properties, including `isLeaf`, `parentPath`, `pathSegment` etc */ expanded?: boolean; /** @description include basic composition information. ID, type, state, name, and definition id */ withCompositionData?: boolean; /** * @deprecated * @description Returns the UI status string of the composition. * This internal status is subject to change without notice and is thus marked deprecated to discourage the use of internal data */ withCompositionUIStatus?: boolean; /** @description Include basic redirect information */ withRedirectData?: boolean; }; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 200: { headers: { [name: string]: unknown; }; content: { "application/json": { nodes?: components["schemas"]["ProjectMapNodeDefinition"][]; tree?: components["schemas"]["ProjectMapTreeNodeDefinition"]; }; }; }; 400: components["responses"]["BadRequestError"]; 401: components["responses"]["UnauthorizedError"]; 403: components["responses"]["ForbiddenError"]; 429: components["responses"]["RateLimitError"]; 500: components["responses"]["InternalServerError"]; }; }; /** @description Called to insert or update a node or nodes */ put: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** @description An array of projectMap node objects to be updated or inserted */ nodes: { node: components["schemas"]["ProjectMapNodeUpdate"]; /** @description The path of the node directly prior to the location where the current node is desired to go or undefined if there isn't one */ previousSibling?: string; /** @description The path of the node directly after the location where the current node is desired to go or undefined if there isn't one */ nextSibling?: string; }[]; /** * Format: uuid * @description The project id of the project that the projectMap belongs to */ projectId: string; /** * Format: uuid * @description The projectMap id that the changing or inserting nodes belong to */ projectMapId?: string; }; }; }; responses: { /** @description OK */ 204: { headers: { [name: string]: unknown; }; content?: never; }; 400: components["responses"]["BadRequestError"]; 401: components["responses"]["UnauthorizedError"]; 403: components["responses"]["ForbiddenError"]; 429: components["responses"]["RateLimitError"]; 500: components["responses"]["InternalServerError"]; }; }; post?: never; /** @description Called to delete a particular projectMap node by id or path */ delete: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody: { content: { "application/json": { /** * Format: uuid * @description Id of the projectMap node to delete */ nodeId?: string; /** @description Path to the projectMap node to delete */ path: string; /** * Format: uuid * @description Project map id that the node to delete belongs to */ projectMapId?: string; /** * Format: uuid * @description Project id that the project map belongs to */ projectId: string; } | { /** * Format: uuid * @description Id of the projectMap node to delete */ nodeId: string; /** @description Path to the projectMap node to delete */ path?: string; /** * Format: uuid * @description Project map id that the node to delete belongs to */ projectMapId?: string; /** * Format: uuid * @description Project id that the project map belongs to */ projectId: string; }; }; }; responses: { /** @description OK */ 204: { headers: { [name: string]: unknown; }; content?: never; }; 400: components["responses"]["BadRequestError"]; 401: components["responses"]["UnauthorizedError"]; 403: components["responses"]["ForbiddenError"]; 429: components["responses"]["RateLimitError"]; 500: components["responses"]["InternalServerError"]; }; }; /** @description Handles preflight requests. This endpoint allows CORS */ options: { parameters: { query?: never; header?: never; path?: never; cookie?: never; }; requestBody?: never; responses: { /** @description OK */ 204: { headers: { [name: string]: unknown; }; content?: never; }; }; }; head?: never; patch?: never; trace?: never; }; } interface components { schemas: { ProjectMapNodeAllowedQueryString: { /** @description The name of the query string parameter */ name: string; /** @description The default value of the query string if it is not provided by an incoming route path */ value?: string; /** @description Help text for authors who might be setting up a preview value for this query string */ helpText?: string; /** @description Configuration for providing a list of allowed values for this query string */ optionsSource?: { /** * @description The source type for the options * @enum {string} */ source: "static"; options: { /** @description Display name for the option */ name: string; /** @description The actual value to be used */ value: string; }[]; }; }; ProjectMapNodeData: { /** @description While performing a search if a node is a hit, this property will return true. If it's supporting structure, like a parent of a search hit, it will return false */ isSearchHit?: boolean; /** @description Query strings that are allowed to be passed to the node */ queryStrings?: components["schemas"]["ProjectMapNodeAllowedQueryString"][]; /** * @description For dynamic nodes, this is the preview value for the dynamic value. * The preview value is used when editing a connected composition, and is the default * dynamic node value unless the author has explicitly chosen a different value */ previewValue?: string; }; /** @description Basic information about a composition edition from the context of a project map node */ ProjectMapNodeCompositionEditionData: { /** * Format: uuid * @description The UUID of the linked composition */ id: string; /** @description Type of the edition instance (public_id of its definition) */ type: string; /** * Format: uuid * @description The edition UUID underneath the linked composition */ editionId?: string; /** @description Slug pattern of this edition */ slug?: string | null; /** @description Friendly name of the linked composition */ name: string; /** @description Friendly name of the edition */ editionName?: string; /** @description Priority of the edition */ editionPriority?: number; /** * @deprecated * @description UI status value. Subject to change without notice; do not rely on this value. Only present when `withCompositionUIStatus` option is true * @enum {string} */ uiStatus?: "Draft" | "Modified" | "Published" | "Orphan"; /** * @description Icon name or URL for the composition edition (e.g. 'screen' or 'https://s3/my-component.jpg') * @default screen */ icon?: string; /** @description Friendly name of this edition's definition */ typeName?: string; /** @description List of locales that the edition is available in. If empty, available in all locales */ locales: string[]; /** * Format: date-time * @description Date and time the edition was last modified (or created if never modified). Uses ISO-8859-1 formatting and UTC timezone. */ modified?: string; }; /** * @description Basic information about the linked composition from the context of a project map node. * If the linked composition has editions, the editions are included in the `editions` property. */ ProjectMapNodeCompositionData: { /** @description Type of the linked composition (id of its definition) */ type: string; /** * Format: uuid * @description The UUID of the linked composition */ id: string; /** * Format: uuid * @description The edition UUID underneath the linked composition * This is only present if the composition has not been published, but an edition has */ editionId?: string; /** @description Slug pattern of the linked composition or edition */ slug?: string | null; /** @description Friendly name of this composition or edition */ name: string; /** * @deprecated * @description UI status value. Subject to change without notice; do not rely on this value. Only present when `withCompositionUIStatus` option is true * @enum {string} */ uiStatus?: "Draft" | "Modified" | "Published" | "Orphan"; /** * @description Icon name or URL for the composition definition (e.g. 'screen' or 'https://s3/my-component.jpg') * @default screen */ icon?: string; /** @description Friendly name of this Composition's Definition */ typeName?: string; /** * @description List of locales that the composition _or any of its editions_ is available in. * If empty, available in all locales. */ locales: string[]; /** @description Priority of the composition relative to any editions */ editionPriority?: number; /** @description Friendly name of the edition */ editionName?: string; /** * @description List of editions available for this composition. The composition is included in the list, it is the edition * where the editionID equals the node's compositionID. NOTE: this is not sent if only one edition is available */ editions?: components["schemas"]["ProjectMapNodeCompositionEditionData"][]; /** * Format: date-time * @description Date and time the composition was last modified (or created if never modified). * Uses ISO-8859-1 formatting and UTC timezone. * IMPORTANT: if the composition has more than one edition, this is the modified date of the default edition. Each edition has its own modified date in the `editions` array. */ modified?: string; }; ProjectMapSourceRedirectData: { /** * Format: uuid * @description The public UUID of the source redirect */ id?: string; }[]; ProjectMapTargetRedirectData: { /** * Format: uuid * @description The public UUID of the target redirect */ id?: string; }[]; ProjectMapNodeLocale: { /** @description Name of node in the locale */ name?: string; /** @description Full path to the current node in this locale, only included if requested with the expanded flag */ path?: string; /** @description Last segment of the url in this locale */ pathSegment: string; /** * @description When false, the node explicitly defines a locale-specific path segment. * * When true, an ancestor defines a locale-specific path segment, * which makes its descendants resolvable using that segment. * This node does not define a locale-specific path segment. * * Only included if requested with the expanded flag. Without the expanded flag, inherited locales are not included in the response */ inherited?: boolean; }; ProjectMapNodeDefinition: { /** * Format: uuid * @description The id of the projectMap entry */ id: string; /** @description Path representing the path to the current node */ path: string; /** @description Ordering of the node, higher numbers go after lower numbers */ order?: number; data?: components["schemas"]["ProjectMapNodeData"]; /** @description The name of the projectMap entry */ name: string; /** * @description The type of the projectMap entry * @enum {string} */ type: "composition" | "placeholder"; /** * Format: uuid * @description The composition id related to the projectMap entry */ compositionId?: string; /** @description Description of the projectMap node */ description?: string; /** @description Parent path of the current node, only included if requested with the expanded flag */ parentPath?: string; /** @description Last segment of the url */ pathSegment?: string; /** @description returns true if the node is a leaf node, meaning having no children, only included if requested with the expanded flag */ isLeaf?: boolean; compositionData?: components["schemas"]["ProjectMapNodeCompositionData"]; sourceRedirects?: components["schemas"]["ProjectMapSourceRedirectData"]; targetRedirects?: components["schemas"]["ProjectMapTargetRedirectData"]; locales?: { [key: string]: components["schemas"]["ProjectMapNodeLocale"]; }; }; ProjectMapTreeNodeDefinition: { /** @description Children of the node */ children?: components["schemas"]["ProjectMapTreeNodeDefinition"][]; } & WithRequired; Error: { /** @description Error message(s) that occurred while processing the request */ errorMessage?: string[] | string; }; ProjectMapNodeLocaleUpdate: { /** @description Name of node in the locale */ name?: string; /** @description Locale specific path segment for this node (not a full path) */ pathSegment: string; }; ProjectMapNodeUpdate: { /** * Format: uuid * @description The id of the projectMap entry */ id?: string; /** @description Path representing the path to the current node */ path: string; /** @description Ordering of the node, higher numbers go after lower numbers */ order?: number; data?: components["schemas"]["ProjectMapNodeData"]; /** @description The name of the projectMap entry */ name: string; /** * @description The type of the projectMap entry * @enum {string} */ type: "composition" | "placeholder"; /** * Format: uuid * @description The composition id related to the projectMap entry */ compositionId?: string; /** @description Description of the projectMap node */ description?: string; locales?: { [key: string]: components["schemas"]["ProjectMapNodeLocaleUpdate"]; }; }; }; responses: { /** @description Request input validation failed */ BadRequestError: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description API key or token was not valid */ UnauthorizedError: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description Permission was denied */ ForbiddenError: { headers: { [name: string]: unknown; }; content: { "application/json": components["schemas"]["Error"]; }; }; /** @description Too many requests in allowed time period */ RateLimitError: { headers: { [name: string]: unknown; }; content?: never; }; /** @description Execution error occurred */ InternalServerError: { headers: { [name: string]: unknown; }; content?: never; }; }; parameters: never; requestBodies: never; headers: never; pathItems: never; } type WithRequired = T & { [P in K]-?: T[P]; }; type ProjectMapNodeUpsertRequest = paths['/api/v1/project-map-nodes']['put']['requestBody']['content']['application/json']; type ProjectMapNodeUpsertRequestNode = ProjectMapNodeUpsertRequest['nodes'][0]['node']; type ProjectMapNodeUpsertRequestNodeLocale = NonNullable[string]; type ProjectMapNodeDeleteRequest = paths['/api/v1/project-map-nodes']['delete']['requestBody']['content']['application/json']; type ProjectMapNodeGetRequest = paths['/api/v1/project-map-nodes']['get']['parameters']['query']; type ProjectMapNodeGetResponse = paths['/api/v1/project-map-nodes']['get']['responses']['200']['content']['application/json']; type ProjectMapNode = NonNullable[0]; type ProjectMapNodeLocale = NonNullable[string]; type ProjectMapNodeWithId = ProjectMapNode & Required>; type ProjectMapNodeCompositionData = NonNullable; type ProjectMapNodeCompositionEditionData = NonNullable['editions']>[0]; type ProjectMapGetRequest = paths$1['/api/v1/project-map']['get']['parameters']['query']; type ProjectMapGetResponse = paths$1['/api/v1/project-map']['get']['responses']['200']['content']['application/json']; type ProjectMapUpsertRequest = paths$1['/api/v1/project-map']['put']['requestBody']['content']['application/json']; type ProjectMapDeleteRequest = paths$1['/api/v1/project-map']['delete']['requestBody']['content']['application/json']; type ProjectMapDefinition = ProjectMapGetResponse['projectMaps'][0]; type ProjectMapDefinitionWithId = ProjectMapDefinition & Required>; type ProjectMapUpsertResponse = paths$1['/api/v1/project-map']['put']['responses']['200']['content']['application/json']; type NodeType = ProjectMapNode['type']; type ProjectMapNodeWithProjectMapReference = ProjectMapNodeWithId & { projectMapId: string; }; type ProjectMapDefinitions = { projectMaps: ProjectMapDefinitionWithId[]; projectMapNodes: ProjectMapNodeWithProjectMapReference[]; }; type ProjectMapNodeData = components$1['schemas']['ProjectMapNodeData']; type ProjectMapNodeAllowedQueryString = components$1['schemas']['ProjectMapNodeAllowedQueryString']; declare const ROOT_NODE_PATH = "/"; type ProjectMapSubtree = ProjectMapNode & { children?: Array | undefined; parent?: ProjectMapSubtree | undefined; previousSibling?: ProjectMapSubtree | undefined; nextSibling?: ProjectMapSubtree | undefined; }; type WithoutProjectId = Omit; declare class ProjectMapClient extends ApiClient { constructor(options: ClientOptions); /** * Get available project map defintions */ getProjectMapDefinitions: () => Promise<{ projectMaps: components$2["schemas"]["ProjectMapDefinition"][]; }>; /** * Get specific project map definition */ getProjectMapDefinition: (options: WithoutProjectId) => Promise<{ projectMaps: components$2["schemas"]["ProjectMapDefinition"][]; }>; /** * Update or insert a project map definition */ upsertProjectMap: (options: WithoutProjectId) => Promise; /** * Delete a project map definition */ deleteProjectMap: (options: WithoutProjectId) => Promise; /** * Update or insert a list of project map nodes */ upsertProjectMapNodes: (options: WithoutProjectId) => Promise; /** * Delete a project map node */ deleteProjectMapNode: (options: WithoutProjectId) => Promise; /** * Get a subtree of the project map tree returned in a tree format */ getSubtree: (options: WithoutProjectId) => Promise; /** * Get a subtree of the project map tree returned in a list format */ getNodes: (options: WithoutProjectId) => Promise; private setFetchOptions; private cleanProjectMapNode; } /** @deprecated Pass `bypassCache: true` to {@link ProjectMapClient} instead. */ declare class UncachedProjectMapClient extends ProjectMapClient { constructor(options: Omit); } /** * Internal use only. * * @deprecated */ declare const __INTERNAL_MISSING_PARENT_NODE_ERROR = "Upsert failed, parent node not found."; interface ObjectWithEditionMetadata { editionId?: string; editionPriority?: number; editionName?: string; } interface GetActiveEditionOptions { /** Node to pick the active edition for */ editions: Array; /** Selects the composition/entry ID from the edition */ selectId: (edition: T) => string; /** Selects locales that are enabled on an edition */ selectEnabledLocales: (edition: T) => string[]; selectEdition: (edition: T) => ObjectWithEditionMetadata; /** * The current locale to resolve an edition for. * When undefined, the default edition/composition is always matched if it exists. */ targetLocale: string | undefined; } /** * Finds the active edition for a given locale in an array of all editions. * The active edition is the highest priority edition that enables the target locale. * If there is no target locale, then the default edition is returned if there is one. * Otherwise, undefined is returned (no edition matches). */ declare function getActiveEdition({ editions, selectEdition, selectId, selectEnabledLocales, targetLocale, }: GetActiveEditionOptions): T | undefined; /** * Finds the active edition for a given locale in a node's compositionData. * Note: All editions, including the composition, are stored in the editions array when it is present. */ declare function getNodeActiveCompositionEdition({ node, targetLocale, fallbackWhenLocaleNotMatched, }: { /** Node to pick the active edition for */ node: Pick; /** The current locale to resolve an edition for. When undefined, the compositionData is always matched. */ targetLocale: string | undefined; /** * Whether to fallback to the composition if nothing enables the target locale * false (default): return undefined if nothing enables the target locale * true: return the composition if nothing enables the target locale */ fallbackWhenLocaleNotMatched?: boolean; }): ProjectMapNode['compositionData'] | undefined; type LocalePathNode = Pick & { locales?: Record; }; /** * Given a project map node and a locale, resolves the correct path for the locale * This is computed as follows: * - If the locale is unspecified, then use the fallback path * - If the locale is specified, then use the locale-specific path if it exists, otherwise use the fallback path */ declare function getNodeLocalePath(node: LocalePathNode, locale: string | undefined): string; declare function getNodeLocalePath(node: LocalePathNode | undefined, locale: string | undefined): string | null; type AlternateLocaleUrls = { [locale: string]: string; }; /** * Gets all possible locale specific URLs for a composition route response * * This is appropriate for generating links to other locale versions of the current composition, * such as for alternate language tags, language switchers, etc. * * The URLs will be: * * Computed based on the attached project map node path * * Not include a base URL from the project map, if one is set * * If a dynamic locale path segment exists, it will be rewritten automatically to the target locale */ declare function getRouteAlternateLocalesUrls(routeResponse: RouteGetResponse): AlternateLocaleUrls | undefined; type MatchedRoute = { match: true; dynamicSegmentCount: number; pathParams: { [key: string]: string; }; queryParams: { [key: string]: string; }; }; type UnmatchedRoute = { match: false; }; type ExpandOptions = { dynamicInputValues?: Record; allowedQueryParams?: Array; /** Prevents URL-escaping of variable expressions of the form ${...} in the expand result */ doNotEscapeVariables?: boolean; }; declare class Route { #private; readonly route: string; constructor(route: string); get dynamicSegmentCount(): number; /** Tests if an incoming path matches this route */ matches(path: string): MatchedRoute | UnmatchedRoute; /** * Creates an expanded path value for this route given dynamic input values and allowed query string values */ expand(options?: ExpandOptions): string; static getDynamicRouteSegmentName(segment: string): string | undefined; /** * Splits a path into the path portion and an optional `#fragment` * (everything after the first `#`). * * Variable expressions (`${...}`) may legitimately contain `#` characters * (e.g. JSON-pointer tokens like `${#jptr:/foo/_slug}`), so the fragment * delimiter is the first `#` that falls outside of a variable expression. */ static splitFragment(path: string): { path: string; fragment: string | undefined; }; static dynamicSegmentPrefix: string; } export { type AlternateLocaleUrls, type ExpandOptions, type GetActiveEditionOptions, type LocalePathNode, type MatchedRoute, type NodeType, type ObjectWithEditionMetadata, ProjectMapClient, type ProjectMapDefinition, type ProjectMapDefinitionWithId, type ProjectMapDefinitions, type ProjectMapDeleteRequest, type ProjectMapGetRequest, type ProjectMapGetResponse, type ProjectMapNode, type ProjectMapNodeAllowedQueryString, type ProjectMapNodeCompositionData, type ProjectMapNodeCompositionEditionData, 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, getActiveEdition, getNodeActiveCompositionEdition, getNodeLocalePath, getRouteAlternateLocalesUrls };