diff --git a/src/core/mdm-catalogue-item.model.ts b/src/core/mdm-catalogue-item.model.ts index 9165995..aac0e28 100644 --- a/src/core/mdm-catalogue-item.model.ts +++ b/src/core/mdm-catalogue-item.model.ts @@ -23,6 +23,7 @@ import { MdmIndexResponse, MdmResponse, Payload, + QueryParameters, Uuid } from '../mdm-common.model'; @@ -153,6 +154,17 @@ export type PathableDomainType = | 'versionedFolders' | 'versionLinks'; +/** + * Query parameters for the Path endpoints. + */ +export interface PathQueryParameters extends QueryParameters { + /** + * If true, only locate the latest finalised version of models, unless a specific version identitifer is + * used in the path. + */ + finalised?: boolean; +} + export type RuleDomainType = | 'codeSets' | 'dataClasses' @@ -200,6 +212,5 @@ export interface RuleRepresentation export type RuleResponse = MdmResponse; export type RuleIndexResponse = MdmIndexResponse; export type RuleRepresentationResponse = MdmResponse; -export type RuleRepresentationIndexResponse = MdmIndexResponse< - RuleRepresentation ->; +export type RuleRepresentationIndexResponse = + MdmIndexResponse; diff --git a/src/core/mdm-catalogue-item.resource.ts b/src/core/mdm-catalogue-item.resource.ts index c17ce03..588d281 100644 --- a/src/core/mdm-catalogue-item.resource.ts +++ b/src/core/mdm-catalogue-item.resource.ts @@ -20,6 +20,7 @@ import { AnnotationChildCreatePayload, AnnotationCreatePayload, PathableDomainType, + PathQueryParameters, ReferenceFile, ReferenceFileCreatePayload, RuleDomainType, @@ -819,11 +820,17 @@ export class MdmCatalogueItemResource extends MdmResource { * getPath('codeSets', 'cs:My Code Set') * getPath('folders', 'fo:My Folder') * ``` + * + * You can also request only latest finalised models are located too by passing the parameter: + * + * ```ts + * getPath('dataModels', `dm:My Data Model', { finalised: true }) + * ``` */ getPath( domainType: PathableDomainType, path: string, - query?: QueryParameters, + query?: PathQueryParameters, options?: RequestSettings ) { const encodedPath = encodeURIComponent(path); @@ -855,7 +862,7 @@ export class MdmCatalogueItemResource extends MdmResource { domainType: PathableDomainType, id: Uuid, path: string, - query?: QueryParameters, + query?: PathQueryParameters, options?: RequestSettings ) { const encodedPath = encodeURIComponent(path); diff --git a/src/mdm-common.model.ts b/src/mdm-common.model.ts index 3bd23fe..c5133a2 100644 --- a/src/mdm-common.model.ts +++ b/src/mdm-common.model.ts @@ -469,6 +469,13 @@ export interface CatalogueItem { domainType: CatalogueItemDomainType; } +export interface Pathable { + /** + * A read-only path generated by Mauro representing the location of this item in the catalogue. + */ + path: string; +} + export interface CatalogueItemDetail extends Required { [key: string]: any; label: string; @@ -553,9 +560,8 @@ export interface CatalogueItemSearchResult extends CatalogueItem { breadcrumbs: Breadcrumb[]; } -export type CatalogueItemSearchResponse = MdmIndexResponse< - CatalogueItemSearchResult ->; +export type CatalogueItemSearchResponse = + MdmIndexResponse; /** * Set of parameters to define if an operation should be handled asynchronously. @@ -571,4 +577,4 @@ export interface AsyncParameters { * other requests. */ asynchronous?: boolean; -} \ No newline at end of file +}