- getDatasource(
ctx: DataContext,
): {
v1: {
contact: {
getByUuid: (uuid: string) => Promise<Nullable<Contact.v1.Contact>>;
getByUuidWithLineage: (
uuid: string,
) => Promise<Nullable<ContactWithLineage>>;
getUuidsByFreetext: (freetext: string) => AsyncGenerator<string, null>;
getUuidsByType: (type: string) => AsyncGenerator<string, null>;
getUuidsByTypeFreetext: (
freetext: string,
type: string,
) => AsyncGenerator<string, null>;
getUuidsPageByFreetext: (
freetext: string,
cursor?: Nullable<string>,
limit?: number | `${number}`,
) => Promise<Page<string>>;
getUuidsPageByType: (
type: string,
cursor?: Nullable<string>,
limit?: number | `${number}`,
) => Promise<Page<string>>;
getUuidsPageByTypeFreetext: (
freetext: string,
type: string,
cursor?: Nullable<string>,
limit?: number | `${number}`,
) => Promise<Page<string>>;
};
hasAnyPermission: (
permissionsGroupList: string[][],
userRoles: string[],
chtPermissionsSettings: object,
) => boolean;
hasPermissions: (
permissions: string | string[],
userRoles: string[],
chtPermissionsSettings: object,
) => boolean;
person: {
getByType: (
personType: string,
) => AsyncGenerator<Person.v1.Person, null>;
getByUuid: (uuid: string) => Promise<Nullable<Person.v1.Person>>;
getByUuidWithLineage: (
uuid: string,
) => Promise<Nullable<PersonWithLineage>>;
getPageByType: (
personType: string,
cursor?: Nullable<string>,
limit?: number | `${number}`,
) => Promise<Page<Person.v1.Person>>;
};
place: {
getByType: (placeType: string) => AsyncGenerator<Place.v1.Place, null>;
getByUuid: (uuid: string) => Promise<Nullable<Place.v1.Place>>;
getByUuidWithLineage: (
uuid: string,
) => Promise<Nullable<PlaceWithLineage>>;
getPageByType: (
placeType: string,
cursor?: Nullable<string>,
limit?: number | `${number}`,
) => Promise<Page<Place.v1.Place>>;
};
report: {
getByUuid: (uuid: string) => Promise<Nullable<Report.v1.Report>>;
getUuidsByFreetext: (qualifier: string) => AsyncGenerator<string, null>;
getUuidsPageByFreetext: (
qualifier: string,
cursor?: Nullable<string>,
limit?: number | `${number}`,
) => Promise<Page<string>>;
};
};
} Returns {
v1: {
contact: {
getByUuid: (uuid: string) => Promise<Nullable<Contact.v1.Contact>>;
getByUuidWithLineage: (
uuid: string,
) => Promise<Nullable<ContactWithLineage>>;
getUuidsByFreetext: (freetext: string) => AsyncGenerator<string, null>;
getUuidsByType: (type: string) => AsyncGenerator<string, null>;
getUuidsByTypeFreetext: (
freetext: string,
type: string,
) => AsyncGenerator<string, null>;
getUuidsPageByFreetext: (
freetext: string,
cursor?: Nullable<string>,
limit?: number | `${number}`,
) => Promise<Page<string>>;
getUuidsPageByType: (
type: string,
cursor?: Nullable<string>,
limit?: number | `${number}`,
) => Promise<Page<string>>;
getUuidsPageByTypeFreetext: (
freetext: string,
type: string,
cursor?: Nullable<string>,
limit?: number | `${number}`,
) => Promise<Page<string>>;
};
hasAnyPermission: (
permissionsGroupList: string[][],
userRoles: string[],
chtPermissionsSettings: object,
) => boolean;
hasPermissions: (
permissions: string | string[],
userRoles: string[],
chtPermissionsSettings: object,
) => boolean;
person: {
getByType: (
personType: string,
) => AsyncGenerator<Person.v1.Person, null>;
getByUuid: (uuid: string) => Promise<Nullable<Person.v1.Person>>;
getByUuidWithLineage: (
uuid: string,
) => Promise<Nullable<PersonWithLineage>>;
getPageByType: (
personType: string,
cursor?: Nullable<string>,
limit?: number | `${number}`,
) => Promise<Page<Person.v1.Person>>;
};
place: {
getByType: (placeType: string) => AsyncGenerator<Place.v1.Place, null>;
getByUuid: (uuid: string) => Promise<Nullable<Place.v1.Place>>;
getByUuidWithLineage: (
uuid: string,
) => Promise<Nullable<PlaceWithLineage>>;
getPageByType: (
placeType: string,
cursor?: Nullable<string>,
limit?: number | `${number}`,
) => Promise<Page<Place.v1.Place>>;
};
report: {
getByUuid: (uuid: string) => Promise<Nullable<Report.v1.Report>>;
getUuidsByFreetext: (qualifier: string) => AsyncGenerator<string, null>;
getUuidsPageByFreetext: (
qualifier: string,
cursor?: Nullable<string>,
limit?: number | `${number}`,
) => Promise<Page<string>>;
};
};
}
the CHT datasource API
Returns the source for CHT data.
Throws
Error if the provided context is invalid