diff --git a/.eslintrc.js b/.eslintrc.js index dc33748..817b049 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,12 +1,27 @@ +// eslint-disable-next-line @typescript-eslint/no-var-requires const { config } = require('@dhis2/cli-style') module.exports = { - extends: [config.eslintReact], + extends: [ + config.eslintReact, + 'plugin:@typescript-eslint/recommended', + 'plugin:import/typescript', + ], + settings: { + 'import/resolver': { + node: { + extensions: ['.js', '.jsx', '.ts', '.tsx'], + }, + }, + }, globals: { cy: 'readonly', Cypress: 'readonly', }, rules: { + 'react/prop-types': 'off', 'react/display-name': 'off', + 'import/extensions': 'off', + '@typescript-eslint/no-explicit-any': 'off', }, } diff --git a/README.md b/README.md index 17833f7..5f18604 100644 --- a/README.md +++ b/README.md @@ -47,3 +47,53 @@ You can learn more about the platform in the [DHIS2 Application Platform Documen You can learn more about the runtime in the [DHIS2 Application Runtime Documentation](https://runtime.dhis2.nu/). To learn React, check out the [React documentation](https://reactjs.org/). + + +## Migrating to TS + +- the simplest `tsconfig.json` + +```json +{ + "compilerOptions": { + "allowJs": true, + "target": "es5" + }, + "include": ["./src/**/*"] +} +``` +from: https://www.typescriptlang.org/docs/handbook/migrating-from-javascript.html#writing-a-configuration-file + +- install `typescript` + +```bash +yarn add --dev typescript +``` + +(optionally) add an alias to make testing easier in `package.json`, to run `yarn tsc --noEmit` for example. + +:::note[TypeScript is a typed "superset" of JavaScript] + +TypeScript is a language that is a superset of JavaScript: JS syntax is therefore legal TS. +::: + +- Rename all files from `.js` to `.ts` (or `.jsx` to `.tsx`). You could use a script: + +```bash +find ./src -depth -name "*.js" -exec sh -c 'mv "$1" "${1%.js}.tsx"' _ {} \; +``` + +- Remove all references to modules `.js` - get rid of extensions (if you want to keep extensions, you'd need to set `allowImportingTsExtensions` - not worth the hassle) + +(this will cause eslint errors) + +- Fix eslint config + +install `yarn add @typescript-eslint/eslint-plugin @typescript-eslint/parser` + +extend eslint config + +- inferred types +- settings cast +- generics (DRY) +- \ No newline at end of file diff --git a/d2.config.js b/d2.config.js index 40860ee..9bc5a4f 100644 --- a/d2.config.js +++ b/d2.config.js @@ -6,7 +6,7 @@ const config = { minDHIS2Version: '2.39', coreApp: false, entryPoints: { - app: './src/index.js', + app: './src/index.tsx', }, } diff --git a/package.json b/package.json index 494c249..92e7e2c 100644 --- a/package.json +++ b/package.json @@ -18,18 +18,22 @@ "cypress:open:live": "start-server-and-test 'yarn cypress:start' http://localhost:3000 'yarn cypress open --env networkMode=live'", "cypress:run:live": "start-server-and-test 'yarn cypress:start' http://localhost:3000 'yarn cypress run --env networkMode=live'", "cypress:run:capture": "start-server-and-test 'yarn cypress:start' http://localhost:3000 'yarn cypress run --env networkMode=capture'", - "cypress:run:stub": "start-server-and-test 'yarn cypress:start' http://localhost:3000 'yarn cypress run --env networkMode=stub'" + "cypress:run:stub": "start-server-and-test 'yarn cypress:start' http://localhost:3000 'yarn cypress run --env networkMode=stub'", + "tsc": "tsc" }, "devDependencies": { "@dhis2/cli-app-scripts": "^10.4.1", "@dhis2/cli-style": "^10.4.1", "@dhis2/cypress-commands": "^9.0.2", "@dhis2/cypress-plugins": "^9.0.2", + "@typescript-eslint/eslint-plugin": "^7.11.0", + "@typescript-eslint/parser": "^7.11.0", "cypress": "^9.7.0", "cypress-cucumber-preprocessor": "^4.3.1", "enzyme": "^3.11.0", "enzyme-adapter-react-16": "^1.15.6", - "start-server-and-test": "^1.14.0" + "start-server-and-test": "^1.14.0", + "typescript": "^5.4.5" }, "dependencies": { "@dhis2/analytics": "999.9.9-outlier-table.alpha.1", diff --git a/src/app.js b/src/app.tsx similarity index 95% rename from src/app.js rename to src/app.tsx index 6a45dcc..5a3ba3e 100644 --- a/src/app.js +++ b/src/app.tsx @@ -4,8 +4,8 @@ import React from 'react' import { HashRouter, Route, Routes } from 'react-router-dom' import { QueryParamProvider } from 'use-query-params' import { ReactRouter6Adapter } from 'use-query-params/adapters/react-router-6' -import { AppProvider, UserProvider } from './context/index.js' -import { DataPage, EditPage, EditItem, AddItem } from './pages/index.js' +import { AppProvider, UserProvider } from './context/index' +import { DataPage, EditPage, EditItem, AddItem } from './pages/index' const App = ({ router: Router }) => ( <> diff --git a/src/components/common/button-with-tooltip/button-with-tooltip.js b/src/components/common/button-with-tooltip/button-with-tooltip.tsx similarity index 100% rename from src/components/common/button-with-tooltip/button-with-tooltip.js rename to src/components/common/button-with-tooltip/button-with-tooltip.tsx diff --git a/src/components/common/button-with-tooltip/index.js b/src/components/common/button-with-tooltip/index.js deleted file mode 100644 index 0eab838..0000000 --- a/src/components/common/button-with-tooltip/index.js +++ /dev/null @@ -1 +0,0 @@ -export { ButtonWithTooltip } from './button-with-tooltip.js' diff --git a/src/components/common/button-with-tooltip/index.tsx b/src/components/common/button-with-tooltip/index.tsx new file mode 100644 index 0000000..fce121c --- /dev/null +++ b/src/components/common/button-with-tooltip/index.tsx @@ -0,0 +1 @@ +export { ButtonWithTooltip } from './button-with-tooltip' diff --git a/src/components/common/index.js b/src/components/common/index.js deleted file mode 100644 index 40bc2f5..0000000 --- a/src/components/common/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export * from './loader/index.js' -export * from './warning/index.js' diff --git a/src/components/common/index.tsx b/src/components/common/index.tsx new file mode 100644 index 0000000..77a571f --- /dev/null +++ b/src/components/common/index.tsx @@ -0,0 +1,2 @@ +export * from './loader/index' +export * from './warning/index' diff --git a/src/components/common/loader/index.js b/src/components/common/loader/index.js deleted file mode 100644 index f56b222..0000000 --- a/src/components/common/loader/index.js +++ /dev/null @@ -1 +0,0 @@ -export { Loader } from './loader.js' diff --git a/src/components/common/loader/index.tsx b/src/components/common/loader/index.tsx new file mode 100644 index 0000000..1213eb7 --- /dev/null +++ b/src/components/common/loader/index.tsx @@ -0,0 +1 @@ +export { Loader } from './loader' diff --git a/src/components/common/loader/loader.js b/src/components/common/loader/loader.js deleted file mode 100644 index b460392..0000000 --- a/src/components/common/loader/loader.js +++ /dev/null @@ -1,10 +0,0 @@ -import { CenteredContent, CircularLoader } from '@dhis2/ui' -import React from 'react' - -const Loader = () => ( - - - -) - -export { Loader } diff --git a/src/components/common/loader/loader.tsx b/src/components/common/loader/loader.tsx new file mode 100644 index 0000000..c22dff8 --- /dev/null +++ b/src/components/common/loader/loader.tsx @@ -0,0 +1,10 @@ +import { Center, CircularLoader } from '@dhis2/ui' +import React from 'react' + +const Loader = () => ( +
+ +
+) + +export { Loader } diff --git a/src/components/common/warning/index.js b/src/components/common/warning/index.js deleted file mode 100644 index 5f218e0..0000000 --- a/src/components/common/warning/index.js +++ /dev/null @@ -1 +0,0 @@ -export { Warning } from './warning.js' diff --git a/src/components/common/warning/index.tsx b/src/components/common/warning/index.tsx new file mode 100644 index 0000000..f9be7a5 --- /dev/null +++ b/src/components/common/warning/index.tsx @@ -0,0 +1 @@ +export { Warning } from './warning' diff --git a/src/components/common/warning/warning.js b/src/components/common/warning/warning.tsx similarity index 100% rename from src/components/common/warning/warning.js rename to src/components/common/warning/warning.tsx diff --git a/src/components/edit/exchange-update/codeDetailsHelpers.js b/src/components/edit/exchange-update/codeDetailsHelpers.tsx similarity index 97% rename from src/components/edit/exchange-update/codeDetailsHelpers.js rename to src/components/edit/exchange-update/codeDetailsHelpers.tsx index adb3644..4779288 100644 --- a/src/components/edit/exchange-update/codeDetailsHelpers.js +++ b/src/components/edit/exchange-update/codeDetailsHelpers.tsx @@ -1,4 +1,4 @@ -import { OU_LEVEL_PREFIX } from '../shared/index.js' +import { OU_LEVEL_PREFIX } from '../shared/index' const dimensionTypes = [ 'CATEGORY', diff --git a/src/components/edit/exchange-update/exchange-form-contents.js b/src/components/edit/exchange-update/exchange-form-contents.tsx similarity index 96% rename from src/components/edit/exchange-update/exchange-form-contents.js rename to src/components/edit/exchange-update/exchange-form-contents.tsx index e5552a2..4588ea0 100644 --- a/src/components/edit/exchange-update/exchange-form-contents.js +++ b/src/components/edit/exchange-update/exchange-form-contents.tsx @@ -11,16 +11,16 @@ import { import classnames from 'classnames' import PropTypes from 'prop-types' import React, { useMemo, useState } from 'react' -import { Warning } from '../../common/index.js' +import { Warning } from '../../common/index' import { SchemeSelector, Subsection, AdvancedSubsection, AUTHENTICATION_TYPES, EXCHANGE_TYPES, -} from '../shared/index.js' +} from '../shared/index' import styles from './exchange-form-contents.module.css' -import { RequestsOverview } from './requests-overview.js' +import { RequestsOverview } from './requests-overview' const { Field, useField } = ReactFinalForm @@ -79,7 +79,13 @@ RadioDecorator.propTypes = { label: PropTypes.string, } -export const ExchangeFormContents = React.memo( +type ExchangeFormContentsType = { + requestsState: Array + setRequestEditMode: (request: any, addModeRequest?: any) => void + deleteRequest: (request: any, addModeRequest?: any) => void +} + +export const ExchangeFormContents = React.memo( ({ requestsState, setRequestEditMode, deleteRequest }) => { const { input: typeInput } = useField('type', { subscription: { value: true }, @@ -321,8 +327,8 @@ export const ExchangeFormContents = React.memo( } ) -ExchangeFormContents.propTypes = { - deleteRequest: PropTypes.func, - requestsState: PropTypes.array, - setRequestEditMode: PropTypes.func, -} +// ExchangeFormContents.propTypes = { +// deleteRequest: PropTypes.func, +// requestsState: PropTypes.array, +// setRequestEditMode: PropTypes.func, +// } diff --git a/src/components/edit/exchange-update/exchange-form.js b/src/components/edit/exchange-update/exchange-form.tsx similarity index 94% rename from src/components/edit/exchange-update/exchange-form.js rename to src/components/edit/exchange-update/exchange-form.tsx index da1671d..6423f73 100644 --- a/src/components/edit/exchange-update/exchange-form.js +++ b/src/components/edit/exchange-update/exchange-form.tsx @@ -4,15 +4,15 @@ import classNames from 'classnames' import PropTypes from 'prop-types' import React, { useCallback } from 'react' import { useNavigate } from 'react-router-dom' -import { AttributeProvider, useAppContext } from '../../../context/index.js' -import { Loader } from '../../common/index.js' -import { RequestForm } from '../request-update/index.js' -import { EditItemFooter, EditTitle } from '../shared/index.js' -import { ExchangeFormContents } from './exchange-form-contents.js' +import { AttributeProvider, useAppContext } from '../../../context/index' +import { Loader } from '../../common/index' +import { RequestForm } from '../request-update/index' +import { EditItemFooter, EditTitle } from '../shared/index' +import { ExchangeFormContents } from './exchange-form-contents' import styles from './exchange-form.module.css' -import { getInitialValuesFromExchange } from './getExchangeValues.js' -import { useRequests } from './useRequests.js' -import { useUpdateExchange } from './useUpdateExchange.js' +import { getInitialValuesFromExchange } from './getExchangeValues' +import { useRequests } from './useRequests' +import { useUpdateExchange } from './useUpdateExchange' const { Form } = ReactFinalForm diff --git a/src/components/edit/exchange-update/getExchangeValues.js b/src/components/edit/exchange-update/getExchangeValues.tsx similarity index 88% rename from src/components/edit/exchange-update/getExchangeValues.js rename to src/components/edit/exchange-update/getExchangeValues.tsx index 58db4ea..bac6413 100644 --- a/src/components/edit/exchange-update/getExchangeValues.js +++ b/src/components/edit/exchange-update/getExchangeValues.tsx @@ -2,7 +2,7 @@ import { SCHEME_TYPES, EXCHANGE_TYPES, AUTHENTICATION_TYPES, -} from '../shared/index.js' +} from '../shared/index' export const getExchangeValuesFromForm = ({ values, requests }) => ({ name: values.name, @@ -29,8 +29,23 @@ const getFormIdSchemeValues = ({ values }) => { }, {}) } +type SchemesType = + | 'idScheme' + | 'dataElementIdScheme' + | 'orgUnitIdScheme' + | 'categoryOptionComboIdScheme' +type TargetDetailType = { + type: string + request: Partial<{ + [key in SchemesType]: any + }> + api?: { + url: string + } +} + const getTargetDetails = ({ values }) => { - const target = { + const target: TargetDetailType = { type: values.type, request: { ...getFormIdSchemeValues({ values }), diff --git a/src/components/edit/exchange-update/index.js b/src/components/edit/exchange-update/index.js deleted file mode 100644 index 1f2a3b3..0000000 --- a/src/components/edit/exchange-update/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { ExchangeForm } from './exchange-form.js' -export { useFetchExchange } from './useFetchExchange.js' diff --git a/src/components/edit/exchange-update/index.tsx b/src/components/edit/exchange-update/index.tsx new file mode 100644 index 0000000..f40a95e --- /dev/null +++ b/src/components/edit/exchange-update/index.tsx @@ -0,0 +1,2 @@ +export { ExchangeForm } from './exchange-form' +export { useFetchExchange } from './useFetchExchange' diff --git a/src/components/edit/exchange-update/requests-overview.js b/src/components/edit/exchange-update/requests-overview.tsx similarity index 99% rename from src/components/edit/exchange-update/requests-overview.js rename to src/components/edit/exchange-update/requests-overview.tsx index 6ebea01..ebc3468 100644 --- a/src/components/edit/exchange-update/requests-overview.js +++ b/src/components/edit/exchange-update/requests-overview.tsx @@ -13,7 +13,7 @@ import { } from '@dhis2/ui' import PropTypes from 'prop-types' import React from 'react' -import { OU_LEVEL_PREFIX, OU_GROUP_PREFIX } from '../shared/index.js' +import { OU_LEVEL_PREFIX, OU_GROUP_PREFIX } from '../shared/index' import styles from './requests-overview.module.css' const getOuText = ({ ouInfo }) => { @@ -53,7 +53,7 @@ const getOuText = ({ ouInfo }) => { } const EmptyTableInfo = () => ( - +

{i18n.t('No requests')}

diff --git a/src/components/edit/exchange-update/useFetchExchange.js b/src/components/edit/exchange-update/useFetchExchange.tsx similarity index 91% rename from src/components/edit/exchange-update/useFetchExchange.js rename to src/components/edit/exchange-update/useFetchExchange.tsx index 80a4238..a76c22c 100644 --- a/src/components/edit/exchange-update/useFetchExchange.js +++ b/src/components/edit/exchange-update/useFetchExchange.tsx @@ -1,15 +1,17 @@ import { useDataEngine } from '@dhis2/app-runtime' import { useCallback, useState } from 'react' import { - SCHEME_TYPES, - OU_GROUP_PREFIX, - OU_LEVEL_PREFIX, -} from '../shared/index.js' + AggregateDataExchange, + ModelCollectionResponse, + OrganisationUnit, + Visualization, +} from '../../../types/generated' +import { SCHEME_TYPES, OU_GROUP_PREFIX, OU_LEVEL_PREFIX } from '../shared/index' import { getMetadataWithCode, getFilterCodeMap, getOuLevelMap, -} from './codeDetailsHelpers.js' +} from './codeDetailsHelpers' const EXCHANGE_QUERY = { exchange: { @@ -76,9 +78,9 @@ export const useFetchExchange = () => { // set to loading setLoading(true) try { - const { exchange } = await engine.query(EXCHANGE_QUERY, { + const { exchange } = (await engine.query(EXCHANGE_QUERY, { variables: { id }, - }) + })) as { exchange: AggregateDataExchange } // get metadata information for dx, pe const metadataRequests = exchange.source.requests.map( @@ -136,9 +138,14 @@ export const useFetchExchange = () => { ) const { organisationUnits: orgUnitDetails } = - await engine.query(ORG_UNITS_QUERY, { + (await engine.query(ORG_UNITS_QUERY, { variables: { ids: [...ousToLookUp] }, - }) + })) as { + organisationUnits: ModelCollectionResponse< + OrganisationUnit, + 'organisationUnits' + > + } const ouMap = orgUnitDetails.organisationUnits.reduce( (orgUnitsMap, orgUnit) => { @@ -155,9 +162,14 @@ export const useFetchExchange = () => { ) ) const { visualizations: visualizationsDetails } = - await engine.query(VISUALIZATIONS_QUERY, { + (await engine.query(VISUALIZATIONS_QUERY, { variables: { ids: [...visualizationsToLookUp] }, - }) + })) as { + visualizations: ModelCollectionResponse< + Visualization, + 'visualizations' + > + } const visualizationsMap = visualizationsDetails.visualizations.reduce( (visMap, visualization) => { diff --git a/src/components/edit/exchange-update/useRequests.js b/src/components/edit/exchange-update/useRequests.tsx similarity index 95% rename from src/components/edit/exchange-update/useRequests.js rename to src/components/edit/exchange-update/useRequests.tsx index 4e3a14d..ccb5ec3 100644 --- a/src/components/edit/exchange-update/useRequests.js +++ b/src/components/edit/exchange-update/useRequests.tsx @@ -1,5 +1,5 @@ import { useCallback, useReducer, useState } from 'react' -import { requestsReducer } from '../request-update/index.js' +import { requestsReducer } from '../request-update/index' export const useRequests = ({ exchangeInfo }) => { const [requestEditInfo, setRequestEditInfo] = useState({ diff --git a/src/components/edit/exchange-update/useUpdateExchange.js b/src/components/edit/exchange-update/useUpdateExchange.tsx similarity index 82% rename from src/components/edit/exchange-update/useUpdateExchange.js rename to src/components/edit/exchange-update/useUpdateExchange.tsx index 7bdb39d..af2f733 100644 --- a/src/components/edit/exchange-update/useUpdateExchange.js +++ b/src/components/edit/exchange-update/useUpdateExchange.tsx @@ -1,6 +1,7 @@ import { useDataEngine } from '@dhis2/app-runtime' import { useCallback, useState } from 'react' -import { getExchangeValuesFromForm } from './getExchangeValues.js' +import { Error } from '../../../types/generated' +import { getExchangeValuesFromForm } from './getExchangeValues' const getChange = ({ field, value }) => ({ op: 'add', @@ -48,13 +49,33 @@ const getJsonPatch = ({ formattedValues, form, requestsTouched }) => { return changes } -export const useUpdateExchange = ({ onComplete }) => { +type RefetchExchangeFunc = ({ + id, + form, + values, + requests, + requestsTouched, + newExchange, +}: any) => Promise + +type UseUpdateExchangeReturnType = { + loading: boolean + error: Error +} + +type UseUpdateExchangeType = ({ + onComplete, +}: { + onComplete: VoidFunction +}) => [RefetchExchangeFunc, UseUpdateExchangeReturnType] + +export const useUpdateExchange: UseUpdateExchangeType = ({ onComplete }) => { const [loading, setLoading] = useState(false) const [error, setError] = useState(null) const engine = useDataEngine() - const refetch = useCallback( + const refetch: RefetchExchangeFunc = useCallback( async ({ id, form, @@ -84,6 +105,7 @@ export const useUpdateExchange = ({ onComplete }) => { }) if (changes?.length > 0) { await engine.mutate({ + id, // @todo: is the type wrong? resource: `aggregateDataExchanges/${id}`, type: 'json-patch', data: changes, diff --git a/src/components/edit/index.js b/src/components/edit/index.js deleted file mode 100644 index 11bd575..0000000 --- a/src/components/edit/index.js +++ /dev/null @@ -1,4 +0,0 @@ -export * from './exchange-update/index.js' -export * from './overview/index.js' -export * from './request-update/index.js' -export * from './shared/index.js' diff --git a/src/components/edit/index.tsx b/src/components/edit/index.tsx new file mode 100644 index 0000000..2da02bb --- /dev/null +++ b/src/components/edit/index.tsx @@ -0,0 +1,4 @@ +export * from './exchange-update/index' +export * from './overview/index' +export * from './request-update/index' +export * from './shared/index' diff --git a/src/components/edit/overview/delete-confirmation.js b/src/components/edit/overview/delete-confirmation.tsx similarity index 100% rename from src/components/edit/overview/delete-confirmation.js rename to src/components/edit/overview/delete-confirmation.tsx diff --git a/src/components/edit/overview/edit-home-top-bar.js b/src/components/edit/overview/edit-home-top-bar.tsx similarity index 94% rename from src/components/edit/overview/edit-home-top-bar.js rename to src/components/edit/overview/edit-home-top-bar.tsx index 995c82e..e3406fe 100644 --- a/src/components/edit/overview/edit-home-top-bar.js +++ b/src/components/edit/overview/edit-home-top-bar.tsx @@ -2,7 +2,7 @@ import i18n from '@dhis2/d2-i18n' import { Button, SelectorBar } from '@dhis2/ui' import React from 'react' import { Link } from 'react-router-dom' -import { EditTitle } from '../shared/index.js' +import { EditTitle } from '../shared/index' import styles from './edit-home-top-bar.module.css' export const EditHomeTopBar = () => ( diff --git a/src/components/edit/overview/index.js b/src/components/edit/overview/index.js deleted file mode 100644 index bda4a6d..0000000 --- a/src/components/edit/overview/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { EditHomeTopBar } from './edit-home-top-bar.js' -export { EditItemsList } from './items-list.js' diff --git a/src/components/edit/overview/index.tsx b/src/components/edit/overview/index.tsx new file mode 100644 index 0000000..4d785f2 --- /dev/null +++ b/src/components/edit/overview/index.tsx @@ -0,0 +1,2 @@ +export { EditHomeTopBar } from './edit-home-top-bar' +export { EditItemsList } from './items-list' diff --git a/src/components/edit/overview/items-list.js b/src/components/edit/overview/items-list.js deleted file mode 100644 index da240ae..0000000 --- a/src/components/edit/overview/items-list.js +++ /dev/null @@ -1,163 +0,0 @@ -import { useDataMutation, useTimeZoneConversion } from '@dhis2/app-runtime' -import i18n from '@dhis2/d2-i18n' -import { - Button, - ButtonStrip, - Card, - IconArrowRight16, - IconApps16, - IconClock16, - InputField, -} from '@dhis2/ui' -import PropTypes from 'prop-types' -import React, { useCallback, useState } from 'react' -import { Link, useNavigate } from 'react-router-dom' -import { useAppContext, useUserContext } from '../../../context/index.js' -import { getNaturalCapitalization } from '../../../utils/helpers.js' -import { DeleteConfirmation } from './delete-confirmation.js' -import styles from './items-list.module.css' - -const IconTextItem = ({ icon, text }) => ( -

-
{icon}
-
{text}
-
-) - -IconTextItem.propTypes = { - icon: PropTypes.node, - text: PropTypes.string, -} - -const deleteExchangeQuery = { - resource: 'aggregateDataExchanges', - type: 'delete', - id: ({ id }) => id, -} - -const AggregateDataExchangeCard = React.memo(({ ade }) => { - const navigate = useNavigate() - const { refetchExchanges } = useAppContext() - const [deleteExchange, { loading: deleting }] = useDataMutation( - deleteExchangeQuery, - { - variables: { id: ade.id }, - onComplete: async () => { - await refetchExchanges() - navigate('/edit') - }, - } - ) - const { canAddExchange, canDeleteExchange, keyUiLocale } = useUserContext() - - const { fromServerDate } = useTimeZoneConversion() - const createdClient = fromServerDate(ade?.created) - const createdClientDate = new Date(createdClient.getClientZonedISOString()) - - // keyUiLocale can be invalid, hence wrap in try/catch - let createdClientDateString - try { - createdClientDateString = - createdClientDate.toLocaleDateString(keyUiLocale) - } catch (e) { - createdClientDateString = createdClientDate.toLocaleDateString('en-GB') - } - - const [deleteConfirmationOpen, setDeleteConfirmationOpen] = useState(false) - const closeDeleteConfirmation = useCallback( - () => setDeleteConfirmationOpen(false), - [setDeleteConfirmationOpen] - ) - - return ( -
- -
{ade.displayName}
-
- } - text={getNaturalCapitalization(ade.target?.type)} - /> - } - text={i18n.t('{{numberOfRequests}} requests', { - numberOfRequests: ade.source.requests, - interpolation: { escapeValue: false }, - })} - /> - } - text={i18n.t('Created {{- createdDate}}', { - createdDate: createdClientDateString, - })} - /> -
-
- - {canAddExchange && ( - - - - )} - {canDeleteExchange && ( - - )} - -
-
- -
- ) -}) - -AggregateDataExchangeCard.propTypes = { - ade: PropTypes.object, -} - -export const EditItemsList = () => { - const { aggregateDataExchanges } = useAppContext() - const [searchTerm, setSearchTerm] = useState('') - - return ( - <> -
- { - setSearchTerm(value) - }} - /> -
-
- {aggregateDataExchanges - .filter(({ displayName }) => - searchTerm.length < 1 - ? true - : displayName - .toLowerCase() - .includes(searchTerm.toLowerCase()) - ) - .map((ade) => ( - - ))} -
- - ) -} diff --git a/src/components/edit/overview/items-list.tsx b/src/components/edit/overview/items-list.tsx new file mode 100644 index 0000000..37346f8 --- /dev/null +++ b/src/components/edit/overview/items-list.tsx @@ -0,0 +1,177 @@ +import { useDataMutation, useTimeZoneConversion } from '@dhis2/app-runtime' +import i18n from '@dhis2/d2-i18n' +import { + Button, + ButtonStrip, + Card, + IconArrowRight16, + IconApps16, + IconClock16, + InputField, +} from '@dhis2/ui' +import PropTypes from 'prop-types' +import React, { useCallback, useState } from 'react' +import { Link, useNavigate } from 'react-router-dom' +import { useAppContext, useUserContext } from '../../../context/index' +import { AggregateDataExchange } from '../../../types/generated' +import { getNaturalCapitalization } from '../../../utils/helpers' +import { DeleteConfirmation } from './delete-confirmation' +import styles from './items-list.module.css' + +const IconTextItem = ({ icon, text }) => ( +
+
{icon}
+
{text}
+
+) + +IconTextItem.propTypes = { + icon: PropTypes.node, + text: PropTypes.string, +} + +const deleteExchangeQuery = { + resource: 'aggregateDataExchanges', + type: 'delete' as const, + id: ({ id }) => id, +} + +type AggregateDataExchangeCardType = { + ade: AggregateDataExchange +} + +const AggregateDataExchangeCard = React.memo( + ({ ade }) => { + const navigate = useNavigate() + const { refetchExchanges } = useAppContext() + const [deleteExchange, { loading: deleting }] = useDataMutation( + deleteExchangeQuery as any, //todo: the type for ID should be updated in the library + { + variables: { id: ade.id }, + onComplete: async () => { + await refetchExchanges() + navigate('/edit') + }, + } + ) + const { canAddExchange, canDeleteExchange, keyUiLocale } = + useUserContext() + + const { fromServerDate } = useTimeZoneConversion() + const createdClient = fromServerDate(ade?.created) + const createdClientDate = new Date( + createdClient.getClientZonedISOString() + ) + + // keyUiLocale can be invalid, hence wrap in try/catch + let createdClientDateString + try { + createdClientDateString = + createdClientDate.toLocaleDateString(keyUiLocale) + } catch (e) { + createdClientDateString = + createdClientDate.toLocaleDateString('en-GB') + } + + const [deleteConfirmationOpen, setDeleteConfirmationOpen] = + useState(false) + const closeDeleteConfirmation = useCallback( + () => setDeleteConfirmationOpen(false), + [setDeleteConfirmationOpen] + ) + + return ( +
+ +
+ {ade.displayName} +
+
+ } + text={getNaturalCapitalization(ade.target?.type)} + /> + } + text={i18n.t('{{numberOfRequests}} requests', { + numberOfRequests: ade.source.requests, + interpolation: { escapeValue: false }, + })} + /> + } + text={i18n.t('Created {{- createdDate}}', { + createdDate: createdClientDateString, + })} + /> +
+
+ + {canAddExchange && ( + + + + )} + {canDeleteExchange && ( + + )} + +
+
+ +
+ ) + } +) + +// AggregateDataExchangeCard.propTypes = { +// ade: PropTypes.object, +// } + +export const EditItemsList = () => { + const { aggregateDataExchanges } = useAppContext() + const [searchTerm, setSearchTerm] = useState('') + + return ( + <> +
+ { + setSearchTerm(value) + }} + /> +
+
+ {aggregateDataExchanges + .filter(({ displayName }) => + searchTerm.length < 1 + ? true + : displayName + .toLowerCase() + .includes(searchTerm.toLowerCase()) + ) + .map((ade) => ( + + ))} +
+ + ) +} diff --git a/src/components/edit/request-update/data-item-select.js b/src/components/edit/request-update/data-item-select.tsx similarity index 93% rename from src/components/edit/request-update/data-item-select.js rename to src/components/edit/request-update/data-item-select.tsx index 5619703..f0669ef 100644 --- a/src/components/edit/request-update/data-item-select.js +++ b/src/components/edit/request-update/data-item-select.tsx @@ -5,7 +5,7 @@ import { } from '@dhis2/analytics' import PropTypes from 'prop-types' import React from 'react' -import { SelectorValidationError } from '../shared/index.js' +import { SelectorValidationError } from '../shared/index' export const DataItemSelect = ({ input, meta }) => { const { value: selectedDimensions, onChange } = input diff --git a/src/components/edit/request-update/filterSelect/dimension-filter-row.js b/src/components/edit/request-update/filterSelect/dimension-filter-row.tsx similarity index 66% rename from src/components/edit/request-update/filterSelect/dimension-filter-row.js rename to src/components/edit/request-update/filterSelect/dimension-filter-row.tsx index 324c19a..f08ea58 100644 --- a/src/components/edit/request-update/filterSelect/dimension-filter-row.js +++ b/src/components/edit/request-update/filterSelect/dimension-filter-row.tsx @@ -1,11 +1,23 @@ import PropTypes from 'prop-types' import React from 'react' import styles from './dimension-filter-row.module.css' -import DimensionItemsSelect from './dimension-items-select.js' -import DimensionSelect from './dimension-select.js' -import RemoveFilter from './remove-filter.js' +import DimensionItemsSelect from './dimension-items-select' +import DimensionSelect from './dimension-select' +import RemoveFilter from './remove-filter' -const DimensionFilterRow = ({ +type DimensionFilterRowProps = { + dimension: string + items: Array + index: number + onChange: ( + id: number, + { dimension, items }: { dimension: string; items: Array } + ) => void + onRemove: (index: number) => void +} +type DimensionFilterRowType = React.FC + +const DimensionFilterRow: DimensionFilterRowType = ({ dimension, items, index, diff --git a/src/components/edit/request-update/filterSelect/dimension-items-select.js b/src/components/edit/request-update/filterSelect/dimension-items-select.tsx similarity index 89% rename from src/components/edit/request-update/filterSelect/dimension-items-select.js rename to src/components/edit/request-update/filterSelect/dimension-items-select.tsx index 914891d..12c6d5f 100644 --- a/src/components/edit/request-update/filterSelect/dimension-items-select.js +++ b/src/components/edit/request-update/filterSelect/dimension-items-select.tsx @@ -3,7 +3,7 @@ import i18n from '@dhis2/d2-i18n' import PropTypes from 'prop-types' import React, { useEffect } from 'react' import styles from './dimension-items-select.module.css' -import SelectField from './select-field.js' +import SelectField from './select-field' // Load dimension items const DIMENSION_ITEMS_QUERY = { @@ -18,14 +18,14 @@ const DIMENSION_ITEMS_QUERY = { }, } +type DimensionItemsSelectType = any + const DimensionItemsSelect = ({ dimension, value, onChange }) => { const nameProperty = 'displayName' - const { loading, error, data, refetch } = useDataQuery( - DIMENSION_ITEMS_QUERY, - { + const { loading, error, data, refetch } = + useDataQuery(DIMENSION_ITEMS_QUERY, { lazy: true, - } - ) + }) useEffect(() => { if (dimension) { diff --git a/src/components/edit/request-update/filterSelect/dimension-select.js b/src/components/edit/request-update/filterSelect/dimension-select.tsx similarity index 91% rename from src/components/edit/request-update/filterSelect/dimension-select.js rename to src/components/edit/request-update/filterSelect/dimension-select.tsx index cb1ad53..ebc9bad 100644 --- a/src/components/edit/request-update/filterSelect/dimension-select.js +++ b/src/components/edit/request-update/filterSelect/dimension-select.tsx @@ -4,6 +4,10 @@ import i18n from '@dhis2/d2-i18n' import { Popover, IconChevronDown24, Help } from '@dhis2/ui' import PropTypes from 'prop-types' import React, { useRef, useState } from 'react' +import { + DimensionalItemObject, + ModelCollectionResponse, +} from '../../../../types/generated' import styles from './dimension-select.module.css' // Include the following dimension types @@ -29,7 +33,9 @@ const DIMENSIONS_QUERY = { const DimensionSelect = ({ dimension, onChange }) => { const [isOpen, setIsOpen] = useState(false) const nameProperty = 'displayName' - const { error, data } = useDataQuery(DIMENSIONS_QUERY, { + const { error, data } = useDataQuery<{ + dimensions: ModelCollectionResponse + }>(DIMENSIONS_QUERY, { variables: { nameProperty }, }) const dropdownRef = useRef() diff --git a/src/components/edit/request-update/filterSelect/filter-select.js b/src/components/edit/request-update/filterSelect/filter-select.tsx similarity index 97% rename from src/components/edit/request-update/filterSelect/filter-select.js rename to src/components/edit/request-update/filterSelect/filter-select.tsx index cb61a7e..0a96bd8 100644 --- a/src/components/edit/request-update/filterSelect/filter-select.js +++ b/src/components/edit/request-update/filterSelect/filter-select.tsx @@ -2,7 +2,7 @@ import i18n from '@dhis2/d2-i18n' import { Button } from '@dhis2/ui' import PropTypes from 'prop-types' import React, { useCallback, useEffect, useState } from 'react' -import DimensionFilterRow from './dimension-filter-row.js' +import DimensionFilterRow from './dimension-filter-row' import styles from './filter-select.module.css' export const FilterSelect = ({ input }) => { diff --git a/src/components/edit/request-update/filterSelect/remove-filter.js b/src/components/edit/request-update/filterSelect/remove-filter.tsx similarity index 100% rename from src/components/edit/request-update/filterSelect/remove-filter.js rename to src/components/edit/request-update/filterSelect/remove-filter.tsx diff --git a/src/components/edit/request-update/filterSelect/select-field.js b/src/components/edit/request-update/filterSelect/select-field.tsx similarity index 100% rename from src/components/edit/request-update/filterSelect/select-field.js rename to src/components/edit/request-update/filterSelect/select-field.tsx diff --git a/src/components/edit/request-update/getRequestValues.js b/src/components/edit/request-update/getRequestValues.tsx similarity index 98% rename from src/components/edit/request-update/getRequestValues.js rename to src/components/edit/request-update/getRequestValues.tsx index 5c32dfd..e6bd9c9 100644 --- a/src/components/edit/request-update/getRequestValues.js +++ b/src/components/edit/request-update/getRequestValues.tsx @@ -1,4 +1,4 @@ -import { SCHEME_TYPES } from '../shared/index.js' +import { SCHEME_TYPES } from '../shared/index' const getFormIdSchemeValues = ({ requestValues }) => { const idSchemeProps = [ diff --git a/src/components/edit/request-update/index.js b/src/components/edit/request-update/index.js deleted file mode 100644 index c9834d8..0000000 --- a/src/components/edit/request-update/index.js +++ /dev/null @@ -1,2 +0,0 @@ -export { RequestForm } from './request-form.js' -export { requestsReducer } from './requests-reducer.js' diff --git a/src/components/edit/request-update/index.tsx b/src/components/edit/request-update/index.tsx new file mode 100644 index 0000000..a21fc0d --- /dev/null +++ b/src/components/edit/request-update/index.tsx @@ -0,0 +1,2 @@ +export { RequestForm } from './request-form' +export { requestsReducer } from './requests-reducer' diff --git a/src/components/edit/request-update/org-unit-select.js b/src/components/edit/request-update/org-unit-select.tsx similarity index 89% rename from src/components/edit/request-update/org-unit-select.js rename to src/components/edit/request-update/org-unit-select.tsx index 8463be6..2857910 100644 --- a/src/components/edit/request-update/org-unit-select.js +++ b/src/components/edit/request-update/org-unit-select.tsx @@ -1,8 +1,8 @@ import { OrgUnitDimension } from '@dhis2/analytics' import PropTypes from 'prop-types' import React, { useMemo } from 'react' -import { useUserContext } from '../../../context/index.js' -import { SelectorValidationError } from '../shared/index.js' +import { useUserContext } from '../../../context/index' +import { SelectorValidationError } from '../shared/index' export const OrgUnitSelector = ({ input, meta }) => { const { value: selectedOrgUnits, onChange } = input diff --git a/src/components/edit/request-update/period-select.js b/src/components/edit/request-update/period-select.tsx similarity index 90% rename from src/components/edit/request-update/period-select.js rename to src/components/edit/request-update/period-select.tsx index bca9003..5ab2c28 100644 --- a/src/components/edit/request-update/period-select.js +++ b/src/components/edit/request-update/period-select.tsx @@ -1,7 +1,7 @@ import { PeriodDimension } from '@dhis2/analytics' import PropTypes from 'prop-types' import React from 'react' -import { SelectorValidationError } from '../shared/index.js' +import { SelectorValidationError } from '../shared/index' export const PeriodSelector = ({ input, meta }) => { const { value: selectedPeriods } = input diff --git a/src/components/edit/request-update/request-form-contents.js b/src/components/edit/request-update/request-form-contents.tsx similarity index 92% rename from src/components/edit/request-update/request-form-contents.js rename to src/components/edit/request-update/request-form-contents.tsx index f8baf50..bb53fcc 100644 --- a/src/components/edit/request-update/request-form-contents.js +++ b/src/components/edit/request-update/request-form-contents.tsx @@ -6,18 +6,14 @@ import { hasValue, } from '@dhis2/ui' import React, { useState } from 'react' -import { - Subsection, - AdvancedSubsection, - SchemeSelector, -} from '../shared/index.js' -import { DataItemSelect } from './data-item-select.js' -import { FilterSelect } from './filterSelect/filter-select.js' -import { OrgUnitSelector } from './org-unit-select.js' -import { PeriodSelector } from './period-select.js' +import { Subsection, AdvancedSubsection, SchemeSelector } from '../shared/index' +import { DataItemSelect } from './data-item-select' +import { FilterSelect } from './filterSelect/filter-select' +import { OrgUnitSelector } from './org-unit-select' +import { PeriodSelector } from './period-select' import styles from './request-form-contents.module.css' -import { useValidators } from './useValidators.js' -import { VisualizationSelect } from './visualization-select.js' +import { useValidators } from './useValidators' +import { VisualizationSelect } from './visualization-select' const { Field, useField } = ReactFinalForm diff --git a/src/components/edit/request-update/request-form.js b/src/components/edit/request-update/request-form.tsx similarity index 94% rename from src/components/edit/request-update/request-form.js rename to src/components/edit/request-update/request-form.tsx index 252d2b5..fc0bc33 100644 --- a/src/components/edit/request-update/request-form.js +++ b/src/components/edit/request-update/request-form.tsx @@ -2,13 +2,13 @@ import i18n from '@dhis2/d2-i18n' import { Box, ReactFinalForm } from '@dhis2/ui' import PropTypes from 'prop-types' import React from 'react' -import { Warning } from '../../common/index.js' -import { EditRequestFooter, EditTitle } from '../shared/index.js' +import { Warning } from '../../common/index' +import { EditRequestFooter, EditTitle } from '../shared/index' import { getInitialValuesFromRequest, getRequestValuesFromForm, -} from './getRequestValues.js' -import { RequestFormContents } from './request-form-contents.js' +} from './getRequestValues' +import { RequestFormContents } from './request-form-contents' import styles from './request-form.module.css' const { Form } = ReactFinalForm diff --git a/src/components/edit/request-update/requests-reducer.js b/src/components/edit/request-update/requests-reducer.tsx similarity index 100% rename from src/components/edit/request-update/requests-reducer.js rename to src/components/edit/request-update/requests-reducer.tsx diff --git a/src/components/edit/request-update/useValidators.js b/src/components/edit/request-update/useValidators.tsx similarity index 100% rename from src/components/edit/request-update/useValidators.js rename to src/components/edit/request-update/useValidators.tsx diff --git a/src/components/edit/request-update/visualization-select.js b/src/components/edit/request-update/visualization-select.tsx similarity index 95% rename from src/components/edit/request-update/visualization-select.js rename to src/components/edit/request-update/visualization-select.tsx index 8f6feab..e63b854 100644 --- a/src/components/edit/request-update/visualization-select.js +++ b/src/components/edit/request-update/visualization-select.tsx @@ -3,8 +3,8 @@ import i18n from '@dhis2/d2-i18n' import { Button } from '@dhis2/ui' import PropTypes from 'prop-types' import React, { useState } from 'react' -import { useUserContext } from '../../../context/index.js' -import { OpenFileDialog } from '../shared/index.js' +import { useUserContext } from '../../../context/index' +import { OpenFileDialog } from '../shared/index' import styles from './visualization-select.module.css' export const VisualizationSelect = ({ input }) => { diff --git a/src/components/edit/shared/access-warning.js b/src/components/edit/shared/access-warning.tsx similarity index 95% rename from src/components/edit/shared/access-warning.js rename to src/components/edit/shared/access-warning.tsx index 1e2507f..3246e84 100644 --- a/src/components/edit/shared/access-warning.js +++ b/src/components/edit/shared/access-warning.tsx @@ -3,7 +3,7 @@ import { Button } from '@dhis2/ui' import PropTypes from 'prop-types' import React from 'react' import { Link } from 'react-router-dom' -import { Warning } from '../../common/index.js' +import { Warning } from '../../common/index' import styles from './access-warning.module.css' export const AccessWarning = ({ editMode }) => ( diff --git a/src/components/edit/shared/constants.js b/src/components/edit/shared/constants.tsx similarity index 100% rename from src/components/edit/shared/constants.js rename to src/components/edit/shared/constants.tsx diff --git a/src/components/edit/shared/edit-title.js b/src/components/edit/shared/edit-title.tsx similarity index 100% rename from src/components/edit/shared/edit-title.js rename to src/components/edit/shared/edit-title.tsx diff --git a/src/components/edit/shared/form-subsection.js b/src/components/edit/shared/form-subsection.tsx similarity index 100% rename from src/components/edit/shared/form-subsection.js rename to src/components/edit/shared/form-subsection.tsx diff --git a/src/components/edit/shared/index.js b/src/components/edit/shared/index.tsx similarity index 54% rename from src/components/edit/shared/index.js rename to src/components/edit/shared/index.tsx index 47126d7..658c02a 100644 --- a/src/components/edit/shared/index.js +++ b/src/components/edit/shared/index.tsx @@ -1,8 +1,8 @@ -export * from './constants.js' -export { AccessWarning } from './access-warning.js' -export { SelectorValidationError } from './selector-validation-error.js' -export { EditItemFooter, EditRequestFooter } from './update-footer.js' -export { Subsection, AdvancedSubsection } from './form-subsection.js' -export { SchemeSelector } from './scheme-selector.js' -export { OpenFileDialog } from './openVisualization/OpenFileDialog.js' -export { EditTitle } from './edit-title.js' +export * from './constants' +export { AccessWarning } from './access-warning' +export { SelectorValidationError } from './selector-validation-error' +export { EditItemFooter, EditRequestFooter } from './update-footer' +export { Subsection, AdvancedSubsection } from './form-subsection' +export { SchemeSelector } from './scheme-selector' +export { OpenFileDialog } from './openVisualization/OpenFileDialog' +export { EditTitle } from './edit-title' diff --git a/src/components/edit/shared/openVisualization/CreatedByFilter.js b/src/components/edit/shared/openVisualization/CreatedByFilter.tsx similarity index 100% rename from src/components/edit/shared/openVisualization/CreatedByFilter.js rename to src/components/edit/shared/openVisualization/CreatedByFilter.tsx diff --git a/src/components/edit/shared/openVisualization/CustomSelectOption.js b/src/components/edit/shared/openVisualization/CustomSelectOption.tsx similarity index 95% rename from src/components/edit/shared/openVisualization/CustomSelectOption.js rename to src/components/edit/shared/openVisualization/CustomSelectOption.tsx index 6a43273..84cb6ec 100644 --- a/src/components/edit/shared/openVisualization/CustomSelectOption.js +++ b/src/components/edit/shared/openVisualization/CustomSelectOption.tsx @@ -3,7 +3,7 @@ import { MenuDivider, Tooltip } from '@dhis2/ui' import cx from 'classnames' import PropTypes from 'prop-types' import React from 'react' -import styles from './styles/CustomSelectOption.style.js' +import styles from './styles/CustomSelectOption.style' const CustomSelectOptionItem = ({ value, diff --git a/src/components/edit/shared/openVisualization/DateField.js b/src/components/edit/shared/openVisualization/DateField.tsx similarity index 100% rename from src/components/edit/shared/openVisualization/DateField.js rename to src/components/edit/shared/openVisualization/DateField.tsx diff --git a/src/components/edit/shared/openVisualization/FileList.js b/src/components/edit/shared/openVisualization/FileList.tsx similarity index 95% rename from src/components/edit/shared/openVisualization/FileList.js rename to src/components/edit/shared/openVisualization/FileList.tsx index b07e567..9a9fbf1 100644 --- a/src/components/edit/shared/openVisualization/FileList.js +++ b/src/components/edit/shared/openVisualization/FileList.tsx @@ -1,8 +1,8 @@ import { DataTableRow, DataTableCell, colors } from '@dhis2/ui' import PropTypes from 'prop-types' import React from 'react' -import { DateField } from './DateField.js' -import { VisTypeIcon } from './VTI.js' +import { DateField } from './DateField' +import { VisTypeIcon } from './VTI' export const FileList = ({ data, onSelect, showVisTypeColumn }) => ( <> diff --git a/src/components/edit/shared/openVisualization/NameFilter.js b/src/components/edit/shared/openVisualization/NameFilter.tsx similarity index 100% rename from src/components/edit/shared/openVisualization/NameFilter.js rename to src/components/edit/shared/openVisualization/NameFilter.tsx diff --git a/src/components/edit/shared/openVisualization/OpenFileDialog.styles.js b/src/components/edit/shared/openVisualization/OpenFileDialog.styles.tsx similarity index 100% rename from src/components/edit/shared/openVisualization/OpenFileDialog.styles.js rename to src/components/edit/shared/openVisualization/OpenFileDialog.styles.tsx diff --git a/src/components/edit/shared/openVisualization/OpenFileDialog.js b/src/components/edit/shared/openVisualization/OpenFileDialog.tsx similarity index 96% rename from src/components/edit/shared/openVisualization/OpenFileDialog.js rename to src/components/edit/shared/openVisualization/OpenFileDialog.tsx index f80876b..6474036 100644 --- a/src/components/edit/shared/openVisualization/OpenFileDialog.js +++ b/src/components/edit/shared/openVisualization/OpenFileDialog.tsx @@ -24,20 +24,21 @@ import React, { useReducer, useState, } from 'react' +import { PagedResponse } from '../../../../types/generated' /* eslint-disable-next-line import/order */ -import { VIS_TYPE_GROUP_ALL, VIS_TYPE_GROUP_CHARTS } from './visTypes.js' +import { VIS_TYPE_GROUP_ALL, VIS_TYPE_GROUP_CHARTS } from './visTypes' import { CreatedByFilter, CREATED_BY_ALL, CREATED_BY_ALL_BUT_CURRENT_USER, CREATED_BY_CURRENT_USER, -} from './CreatedByFilter.js' -import { FileList } from './FileList.js' -import { NameFilter } from './NameFilter.js' -import { styles } from './OpenFileDialog.styles.js' -import { PaginationControls } from './PaginationControls.js' -import { getTranslatedString, AOTypeMap } from './utils.js' -import { VisTypeFilter } from './VisTypeFilter.js' +} from './CreatedByFilter' +import { FileList } from './FileList' +import { NameFilter } from './NameFilter' +import { styles } from './OpenFileDialog.styles' +import { PaginationControls } from './PaginationControls' +import { getTranslatedString, AOTypeMap } from './utils' +import { VisTypeFilter } from './VisTypeFilter' const getQuery = (type) => ({ files: { @@ -48,7 +49,7 @@ const getQuery = (type) => ({ page = 1, filters, }) => { - const queryParams = { + const queryParams: Record = { filter: filters, fields: `id,type,displayName,title,displayDescription,created,lastUpdated,user,access,href`, paging: true, @@ -140,7 +141,9 @@ export const OpenFileDialog = ({ return sortDirection }, [sortField, sortDirection]) - const { loading, error, data, refetch } = useDataQuery(filesQuery, { + const { loading, error, data, refetch } = useDataQuery<{ + files: PagedResponse<{ [key in string]: Array }, 'files'> + }>(filesQuery, { lazy: true, onComplete: (response) => { if (page !== response.files.pager.page) { @@ -352,6 +355,7 @@ export const OpenFileDialog = ({ )} + {!loading && !data?.files[ AOTypeMap[type].apiEndpoint diff --git a/src/components/edit/shared/openVisualization/PaginationControls.js b/src/components/edit/shared/openVisualization/PaginationControls.tsx similarity index 100% rename from src/components/edit/shared/openVisualization/PaginationControls.js rename to src/components/edit/shared/openVisualization/PaginationControls.tsx diff --git a/src/components/edit/shared/openVisualization/VTI.js b/src/components/edit/shared/openVisualization/VTI.tsx similarity index 99% rename from src/components/edit/shared/openVisualization/VTI.js rename to src/components/edit/shared/openVisualization/VTI.tsx index a324082..29b63ce 100644 --- a/src/components/edit/shared/openVisualization/VTI.js +++ b/src/components/edit/shared/openVisualization/VTI.tsx @@ -51,7 +51,7 @@ import { VIS_TYPE_YEAR_OVER_YEAR_COLUMN, VIS_TYPE_SINGLE_VALUE, VIS_TYPE_SCATTER, -} from './visTypes.js' +} from './visTypes' export const VisTypeIcon = ({ type, useSmall = false, ...props }) => { let VisIcon diff --git a/src/components/edit/shared/openVisualization/VisTypeFilter.js b/src/components/edit/shared/openVisualization/VisTypeFilter.tsx similarity index 93% rename from src/components/edit/shared/openVisualization/VisTypeFilter.js rename to src/components/edit/shared/openVisualization/VisTypeFilter.tsx index e12758f..3a969c4 100644 --- a/src/components/edit/shared/openVisualization/VisTypeFilter.js +++ b/src/components/edit/shared/openVisualization/VisTypeFilter.tsx @@ -2,10 +2,10 @@ import i18n from '@dhis2/d2-i18n' import { SingleSelect, colors } from '@dhis2/ui' import PropTypes from 'prop-types' import React from 'react' -import { getDisplayNameByVisType, visTypeIcons } from './visTypes.js' +import { getDisplayNameByVisType, visTypeIcons } from './visTypes' /* eslint-disable-next-line import/order */ -import { CustomSelectOption } from './CustomSelectOption.js' -import { VisTypeIcon } from './VTI.js' +import { CustomSelectOption } from './CustomSelectOption' +import { VisTypeIcon } from './VTI' export const VisTypeFilter = ({ visTypes, selected, onChange }) => ( { + const displayName = visTypeDisplayNames[visType] + + if (!displayName) { + throw new Error(`${visType} is not a valid visualization type`) + } + + return displayName +} + +const stackedTypes = [ + VIS_TYPE_STACKED_COLUMN, + VIS_TYPE_STACKED_BAR, + VIS_TYPE_STACKED_AREA, +] + +const yearOverYearTypes = [ + VIS_TYPE_YEAR_OVER_YEAR_LINE, + VIS_TYPE_YEAR_OVER_YEAR_COLUMN, +] + +const dualAxisTypes = [ + VIS_TYPE_COLUMN, + VIS_TYPE_BAR, + VIS_TYPE_LINE, + VIS_TYPE_AREA, +] + +const multiTypeTypes = [VIS_TYPE_COLUMN, VIS_TYPE_LINE] + +const twoCategoryChartTypes = [ + VIS_TYPE_COLUMN, + VIS_TYPE_STACKED_COLUMN, + VIS_TYPE_BAR, + VIS_TYPE_STACKED_BAR, + VIS_TYPE_LINE, + VIS_TYPE_AREA, + VIS_TYPE_STACKED_AREA, +] + +const columnBasedTypes = [ + VIS_TYPE_COLUMN, + VIS_TYPE_BAR, + VIS_TYPE_YEAR_OVER_YEAR_COLUMN, + VIS_TYPE_STACKED_COLUMN, + VIS_TYPE_STACKED_BAR, +] + +const verticalTypes = [VIS_TYPE_BAR, VIS_TYPE_STACKED_BAR, VIS_TYPE_GAUGE] + +const legendSetTypes = [ + VIS_TYPE_COLUMN, + VIS_TYPE_BAR, + VIS_TYPE_GAUGE, + VIS_TYPE_SINGLE_VALUE, + VIS_TYPE_PIVOT_TABLE, + VIS_TYPE_STACKED_COLUMN, + VIS_TYPE_STACKED_BAR, +] + +export const defaultVisType = VIS_TYPE_COLUMN +export const isStacked = (type) => stackedTypes.includes(type) +export const isYearOverYear = (type) => yearOverYearTypes.includes(type) +export const isDualAxisType = (type) => dualAxisTypes.includes(type) +export const isMultiType = (type) => multiTypeTypes.includes(type) +export const isSingleValue = (type) => type === VIS_TYPE_SINGLE_VALUE +export const isOutlierTable = (type) => type === VIS_TYPE_OUTLIER_TABLE +export const isTwoCategoryChartType = (type) => + twoCategoryChartTypes.includes(type) +export const isVerticalType = (type) => verticalTypes.includes(type) +export const isLegendSetType = (type) => legendSetTypes.includes(type) +export const isColumnBasedType = (type) => columnBasedTypes.includes(type) diff --git a/src/components/edit/shared/scheme-selector.js b/src/components/edit/shared/scheme-selector.tsx similarity index 96% rename from src/components/edit/shared/scheme-selector.js rename to src/components/edit/shared/scheme-selector.tsx index d73e1a0..109a024 100644 --- a/src/components/edit/shared/scheme-selector.js +++ b/src/components/edit/shared/scheme-selector.tsx @@ -8,8 +8,8 @@ import { } from '@dhis2/ui' import PropTypes from 'prop-types' import React from 'react' -import { useAttributeContext } from '../../../context/index.js' -import { SCHEME_TYPES } from './constants.js' +import { useAttributeContext } from '../../../context/index' +import { SCHEME_TYPES } from './constants' import styles from './scheme-selector.module.css' export const SchemeSelector = ({ name, label, disabled }) => { diff --git a/src/components/edit/shared/selector-validation-error.js b/src/components/edit/shared/selector-validation-error.tsx similarity index 100% rename from src/components/edit/shared/selector-validation-error.js rename to src/components/edit/shared/selector-validation-error.tsx diff --git a/src/components/edit/shared/update-footer.js b/src/components/edit/shared/update-footer.tsx similarity index 100% rename from src/components/edit/shared/update-footer.js rename to src/components/edit/shared/update-footer.tsx diff --git a/src/components/index.js b/src/components/index.js deleted file mode 100644 index b7ff225..0000000 --- a/src/components/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export * from './common/index.js' -export * from './edit/index.js' -export * from './view/index.js' diff --git a/src/components/index.tsx b/src/components/index.tsx new file mode 100644 index 0000000..b7e2bd1 --- /dev/null +++ b/src/components/index.tsx @@ -0,0 +1,3 @@ +export * from './common/index' +export * from './edit/index' +export * from './view/index' diff --git a/src/components/view/bottom-bar/bottom-bar.js b/src/components/view/bottom-bar/bottom-bar.tsx similarity index 95% rename from src/components/view/bottom-bar/bottom-bar.js rename to src/components/view/bottom-bar/bottom-bar.tsx index 35166bd..ec6edc2 100644 --- a/src/components/view/bottom-bar/bottom-bar.js +++ b/src/components/view/bottom-bar/bottom-bar.tsx @@ -2,14 +2,15 @@ import i18n from '@dhis2/d2-i18n' import { Button } from '@dhis2/ui' import PropTypes from 'prop-types' import React from 'react' -import { useAppContext, useExchangeContext } from '../../../context/index.js' -import { useExchangeId } from '../../../use-context-selection/index.js' -import { ButtonWithTooltip } from '../../common/button-with-tooltip/index.js' +import { useAppContext, useExchangeContext } from '../../../context/index' +import { useExchangeId } from '../../../use-context-selection/index' +import { ButtonWithTooltip } from '../../common/button-with-tooltip/index' const BottomBar = ({ openSubmitModal, dataSubmitted }) => { const [exchangeId] = useExchangeId() const { aggregateDataExchanges } = useAppContext() const { exchangeData } = useExchangeContext() + console.log('>>>>>>>>', exchangeData) const disableSubmit = aggregateDataExchanges.find((ade) => ade?.id === exchangeId)?.access ?.data?.write === false diff --git a/src/components/view/bottom-bar/index.js b/src/components/view/bottom-bar/index.js deleted file mode 100644 index 358dd53..0000000 --- a/src/components/view/bottom-bar/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from './bottom-bar.js' diff --git a/src/components/view/bottom-bar/index.tsx b/src/components/view/bottom-bar/index.tsx new file mode 100644 index 0000000..cc2a4df --- /dev/null +++ b/src/components/view/bottom-bar/index.tsx @@ -0,0 +1 @@ +export * from './bottom-bar' diff --git a/src/components/view/data-layout/index.js b/src/components/view/data-layout/index.js deleted file mode 100644 index aa2a2db..0000000 --- a/src/components/view/data-layout/index.js +++ /dev/null @@ -1 +0,0 @@ -export { Layout } from './layout.js' diff --git a/src/components/view/data-layout/index.tsx b/src/components/view/data-layout/index.tsx new file mode 100644 index 0000000..87cdf43 --- /dev/null +++ b/src/components/view/data-layout/index.tsx @@ -0,0 +1 @@ +export { Layout } from './layout' diff --git a/src/components/view/data-layout/layout.js b/src/components/view/data-layout/layout.tsx similarity index 100% rename from src/components/view/data-layout/layout.js rename to src/components/view/data-layout/layout.tsx diff --git a/src/components/view/data-workspace/data-workspace.js b/src/components/view/data-workspace/data-workspace.tsx similarity index 83% rename from src/components/view/data-workspace/data-workspace.js rename to src/components/view/data-workspace/data-workspace.tsx index 4fdb941..c28fdd2 100644 --- a/src/components/view/data-workspace/data-workspace.js +++ b/src/components/view/data-workspace/data-workspace.tsx @@ -1,16 +1,16 @@ import i18n from '@dhis2/d2-i18n' -import { CenteredContent } from '@dhis2/ui' +import { Center } from '@dhis2/ui' import React, { useEffect } from 'react' -import { useAppContext, useExchangeContext } from '../../../context/index.js' +import { useAppContext, useExchangeContext } from '../../../context/index' import { useExchangeId, useRequestIndex, -} from '../../../use-context-selection/index.js' -import { Warning } from '../../common/index.js' -import { EntryScreen } from './entry-screen.js' -import { RequestsDisplay } from './requests-display/index.js' -import { RequestsNavigation } from './requests-navigation/index.js' -import { TitleBar } from './title-bar/title-bar.js' +} from '../../../use-context-selection/index' +import { Warning } from '../../common/index' +import { EntryScreen } from './entry-screen' +import { RequestsDisplay } from './requests-display/index' +import { RequestsNavigation } from './requests-navigation/index' +import { TitleBar } from './title-bar/title-bar' const DataWorkspace = () => { const { aggregateDataExchanges } = useAppContext() @@ -35,9 +35,9 @@ const DataWorkspace = () => { if (aggregateDataExchanges.length === 0) { return ( - +
{i18n.t('There are no exchanges available to you')} - +
) } diff --git a/src/components/view/data-workspace/entry-screen.js b/src/components/view/data-workspace/entry-screen.tsx similarity index 100% rename from src/components/view/data-workspace/entry-screen.js rename to src/components/view/data-workspace/entry-screen.tsx diff --git a/src/components/view/data-workspace/index.js b/src/components/view/data-workspace/index.js deleted file mode 100644 index 3fd99aa..0000000 --- a/src/components/view/data-workspace/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from './data-workspace.js' diff --git a/src/components/view/data-workspace/index.tsx b/src/components/view/data-workspace/index.tsx new file mode 100644 index 0000000..953e2a4 --- /dev/null +++ b/src/components/view/data-workspace/index.tsx @@ -0,0 +1 @@ +export * from './data-workspace' diff --git a/src/components/view/data-workspace/requests-display/index.js b/src/components/view/data-workspace/requests-display/index.js deleted file mode 100644 index 92fe0ae..0000000 --- a/src/components/view/data-workspace/requests-display/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from './requests-display.js' diff --git a/src/components/view/data-workspace/requests-display/index.tsx b/src/components/view/data-workspace/requests-display/index.tsx new file mode 100644 index 0000000..abbc21c --- /dev/null +++ b/src/components/view/data-workspace/requests-display/index.tsx @@ -0,0 +1 @@ +export * from './requests-display' diff --git a/src/components/view/data-workspace/requests-display/requests-display.test.js b/src/components/view/data-workspace/requests-display/requests-display.test.js index 5a2e4c3..cef9685 100644 --- a/src/components/view/data-workspace/requests-display/requests-display.test.js +++ b/src/components/view/data-workspace/requests-display/requests-display.test.js @@ -2,7 +2,7 @@ import { convertToObjectFormat, ensureNestedObjectExists, formatData, -} from './requests-display.js' +} from './requests-display' describe('convertToObjectFormat', () => { it('returns data in expected format', () => { diff --git a/src/components/view/data-workspace/requests-display/requests-display.js b/src/components/view/data-workspace/requests-display/requests-display.tsx similarity index 94% rename from src/components/view/data-workspace/requests-display/requests-display.js rename to src/components/view/data-workspace/requests-display/requests-display.tsx index 2023669..ce8c56f 100644 --- a/src/components/view/data-workspace/requests-display/requests-display.js +++ b/src/components/view/data-workspace/requests-display/requests-display.tsx @@ -3,9 +3,9 @@ import i18n from '@dhis2/d2-i18n' import { Button, IconLaunch16 } from '@dhis2/ui' import PropTypes from 'prop-types' import React from 'react' -import { useExchangeContext } from '../../../../context/index.js' -import { Warning } from '../../../common/index.js' -import { Table } from '../table/index.js' +import { useExchangeContext } from '../../../../context/index' +import { Warning } from '../../../common/index' +import { Table } from '../table/index' import styles from './requests-display.module.css' export const ensureNestedObjectExists = (obj, propertyNames) => { @@ -82,8 +82,13 @@ export const formatData = (data) => { ) const tableFormat = [] + type TableType = Partial<{ + title: string + headers: Array<{ name: string }> + rows: Array + }> for (const orgUnit of orgUnits) { - const table = {} + const table: TableType = {} table.title = filters?.length > 0 diff --git a/src/components/view/data-workspace/requests-navigation/index.js b/src/components/view/data-workspace/requests-navigation/index.js deleted file mode 100644 index 175112a..0000000 --- a/src/components/view/data-workspace/requests-navigation/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from './requests-navigation.js' diff --git a/src/components/view/data-workspace/requests-navigation/index.tsx b/src/components/view/data-workspace/requests-navigation/index.tsx new file mode 100644 index 0000000..be34e2a --- /dev/null +++ b/src/components/view/data-workspace/requests-navigation/index.tsx @@ -0,0 +1 @@ +export * from './requests-navigation' diff --git a/src/components/view/data-workspace/requests-navigation/requests-navigation.js b/src/components/view/data-workspace/requests-navigation/requests-navigation.tsx similarity index 100% rename from src/components/view/data-workspace/requests-navigation/requests-navigation.js rename to src/components/view/data-workspace/requests-navigation/requests-navigation.tsx diff --git a/src/components/view/data-workspace/table/index.js b/src/components/view/data-workspace/table/index.js deleted file mode 100644 index 48ffb94..0000000 --- a/src/components/view/data-workspace/table/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from './table.js' diff --git a/src/components/view/data-workspace/table/index.tsx b/src/components/view/data-workspace/table/index.tsx new file mode 100644 index 0000000..302847a --- /dev/null +++ b/src/components/view/data-workspace/table/index.tsx @@ -0,0 +1 @@ +export * from './table' diff --git a/src/components/view/data-workspace/table/table.js b/src/components/view/data-workspace/table/table.tsx similarity index 96% rename from src/components/view/data-workspace/table/table.js rename to src/components/view/data-workspace/table/table.tsx index 7409c6f..1cd69c7 100644 --- a/src/components/view/data-workspace/table/table.js +++ b/src/components/view/data-workspace/table/table.tsx @@ -35,8 +35,8 @@ const Table = ({ title, columns, rows }) => ( @@ -64,7 +64,7 @@ const Table = ({ title, columns, rows }) => ( diff --git a/src/components/view/data-workspace/title-bar/index.js b/src/components/view/data-workspace/title-bar/index.js deleted file mode 100644 index 9264884..0000000 --- a/src/components/view/data-workspace/title-bar/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from './title-bar.js' diff --git a/src/components/view/data-workspace/title-bar/index.tsx b/src/components/view/data-workspace/title-bar/index.tsx new file mode 100644 index 0000000..6a8c7a2 --- /dev/null +++ b/src/components/view/data-workspace/title-bar/index.tsx @@ -0,0 +1 @@ +export * from './title-bar' diff --git a/src/components/view/data-workspace/title-bar/title-bar.js b/src/components/view/data-workspace/title-bar/title-bar.tsx similarity index 97% rename from src/components/view/data-workspace/title-bar/title-bar.js rename to src/components/view/data-workspace/title-bar/title-bar.tsx index db0bd0a..b71ec12 100644 --- a/src/components/view/data-workspace/title-bar/title-bar.js +++ b/src/components/view/data-workspace/title-bar/title-bar.tsx @@ -3,7 +3,7 @@ import i18n from '@dhis2/d2-i18n' import { IconInfo16, IconDimensionDataSet16, Tooltip } from '@dhis2/ui' import moment from 'moment' import React from 'react' -import { useExchangeContext } from '../../../../context/index.js' +import { useExchangeContext } from '../../../../context/index' import styles from './title-bar.module.css' const getRelativeTimeDifference = ({ startTimestamp, endTimestamp }) => { diff --git a/src/components/view/index.js b/src/components/view/index.js deleted file mode 100644 index bb43db4..0000000 --- a/src/components/view/index.js +++ /dev/null @@ -1,5 +0,0 @@ -export * from './bottom-bar/index.js' -export * from './data-layout/index.js' -export * from './data-workspace/index.js' -export * from './submit-modal/index.js' -export * from './top-bar/index.js' diff --git a/src/components/view/index.tsx b/src/components/view/index.tsx new file mode 100644 index 0000000..7d00a65 --- /dev/null +++ b/src/components/view/index.tsx @@ -0,0 +1,5 @@ +export * from './bottom-bar/index' +export * from './data-layout/index' +export * from './data-workspace/index' +export * from './submit-modal/index' +export * from './top-bar/index' diff --git a/src/components/view/submit-modal/conflicts-details-table.js b/src/components/view/submit-modal/conflicts-details-table.tsx similarity index 100% rename from src/components/view/submit-modal/conflicts-details-table.js rename to src/components/view/submit-modal/conflicts-details-table.tsx diff --git a/src/components/view/submit-modal/index.js b/src/components/view/submit-modal/index.js deleted file mode 100644 index 518fde8..0000000 --- a/src/components/view/submit-modal/index.js +++ /dev/null @@ -1 +0,0 @@ -export { SubmitModal } from './submit-modal.js' diff --git a/src/components/view/submit-modal/index.tsx b/src/components/view/submit-modal/index.tsx new file mode 100644 index 0000000..7c3eeb7 --- /dev/null +++ b/src/components/view/submit-modal/index.tsx @@ -0,0 +1 @@ +export { SubmitModal } from './submit-modal' diff --git a/src/components/view/submit-modal/submit-modal.js b/src/components/view/submit-modal/submit-modal.tsx similarity index 97% rename from src/components/view/submit-modal/submit-modal.js rename to src/components/view/submit-modal/submit-modal.tsx index 016f572..244ecb4 100644 --- a/src/components/view/submit-modal/submit-modal.js +++ b/src/components/view/submit-modal/submit-modal.tsx @@ -3,7 +3,7 @@ import i18n from '@dhis2/d2-i18n' import { Button, ButtonStrip, - CenteredContent, + Center, CircularLoader, Modal, ModalActions, @@ -12,22 +12,22 @@ import { } from '@dhis2/ui' import PropTypes from 'prop-types' import React, { useEffect, useState } from 'react' -import { useExchangeContext } from '../../../context/index.js' -import { Warning } from '../../common/index.js' +import { useExchangeContext } from '../../../context/index' +import { Warning } from '../../common/index' import styles from './submit-modal.module.css' -import { SuccessContent } from './success-content.js' -import { useAggregateDataExchangeMutation } from './use-aggregate-data-exchange-mutation.js' +import { SuccessContent } from './success-content' +import { useAggregateDataExchangeMutation } from './use-aggregate-data-exchange-mutation' const LoadingStateModalContent = () => ( <> - +
{i18n.t('Submitting...')}
- +
diff --git a/src/components/view/submit-modal/success-content.js b/src/components/view/submit-modal/success-content.tsx similarity index 98% rename from src/components/view/submit-modal/success-content.js rename to src/components/view/submit-modal/success-content.tsx index 4a843e8..4a55577 100644 --- a/src/components/view/submit-modal/success-content.js +++ b/src/components/view/submit-modal/success-content.tsx @@ -14,8 +14,8 @@ import { } from '@dhis2/ui' import PropTypes from 'prop-types' import React, { useState } from 'react' -import { useExchangeContext } from '../../../context/index.js' -import { ConflictsDetailsTable } from './conflicts-details-table.js' +import { useExchangeContext } from '../../../context/index' +import { ConflictsDetailsTable } from './conflicts-details-table' import styles from './success-content.module.css' const importTypeConfig = { @@ -322,7 +322,7 @@ const SuccessContent = ({ data, dataSubmitted }) => { SuccessContent.propTypes = { data: PropTypes.object, - dataSubmitted: PropTypes.submitted, + dataSubmitted: PropTypes.bool, } export { SuccessContent } diff --git a/src/components/view/submit-modal/use-aggregate-data-exchange-mutation.js b/src/components/view/submit-modal/use-aggregate-data-exchange-mutation.js deleted file mode 100644 index 50fbd5f..0000000 --- a/src/components/view/submit-modal/use-aggregate-data-exchange-mutation.js +++ /dev/null @@ -1,89 +0,0 @@ -import { useDataEngine } from '@dhis2/app-runtime' -import i18n from '@dhis2/d2-i18n' -import moment from 'moment' -import { useEffect, useReducer, useState } from 'react' - -const getMutation = ({ id }) => ({ - resource: `aggregateDataExchanges/${id}/exchange`, - type: 'create', -}) - -const uncalledState = { - data: null, - error: null, - loading: false, - called: false, - dataSubmitted: null, -} - -const submitReducer = (state, action) => { - switch (action.type) { - case 'loading': - return { ...uncalledState, loading: true } - case 'success': - return { - data: action.payload, - error: null, - loading: false, - called: true, - dataSubmitted: moment().format(), - } - case 'error': - return { - data: null, - error: action.payload, - loading: false, - called: false, - dataSubmitted: null, - } - case 'reset': - return { ...uncalledState } - default: - return { ...uncalledState, called: true } - } -} - -export const useAggregateDataExchangeMutation = ({ id }) => { - const engine = useDataEngine() - - const [submissionState, dispatch] = useReducer(submitReducer, uncalledState) - const [fetch, setFetch] = useState(false) - - useEffect(() => { - const fetchData = async ({ id }) => { - if (fetch) { - dispatch({ type: 'loading' }) - try { - const response = await engine.mutate(getMutation({ id })) - const internalResponse = response?.response ?? response - if (internalResponse?.status === 'ERROR') { - const errorMessage = - internalResponse?.importSummaries.find( - ({ status }) => status === 'ERROR' - )?.description || i18n.t('Unknown error') - throw new Error(errorMessage) - } - setFetch(false) - dispatch({ type: 'success', payload: response }) - } catch (error) { - setFetch(false) - dispatch({ type: 'error', payload: error }) - } - } - } - fetchData({ id }) - }, [id, fetch, engine]) - - // clean up if id changes - useEffect(() => { - return () => { - dispatch({ type: 'reset' }) - } - }, [id]) - - const refetch = () => { - setFetch(true) - } - - return [refetch, submissionState] -} diff --git a/src/components/view/submit-modal/use-aggregate-data-exchange-mutation.tsx b/src/components/view/submit-modal/use-aggregate-data-exchange-mutation.tsx new file mode 100644 index 0000000..10b9dc9 --- /dev/null +++ b/src/components/view/submit-modal/use-aggregate-data-exchange-mutation.tsx @@ -0,0 +1,109 @@ +import { useDataEngine } from '@dhis2/app-runtime' +import i18n from '@dhis2/d2-i18n' +import moment from 'moment' +import { useEffect, useReducer, useState } from 'react' +import type { AggregateDataExchange, Error } from '../../../types/generated' + +const getMutation = ({ id }) => ({ + resource: `aggregateDataExchanges/${id}/exchange`, + type: 'create', +}) + +const uncalledState = { + data: null, + error: null, + loading: false, + called: false, + dataSubmitted: null, +} + +const submitReducer = (state, action) => { + switch (action.type) { + case 'loading': + return { ...uncalledState, loading: true } + case 'success': + return { + data: action.payload, + error: null, + loading: false, + called: true, + dataSubmitted: moment().format(), + } + case 'error': + return { + data: null, + error: action.payload, + loading: false, + called: false, + dataSubmitted: null, + } + case 'reset': + return { ...uncalledState } + default: + return { ...uncalledState, called: true } + } +} + +type SubmissionStateType = { + loading: boolean + data: AggregateDataExchange + error: Error + called: boolean + dataSubmitted: string +} +type UseAggregateDataExchangeMutationType = ({ + id, +}: { + id: string +}) => [() => void, SubmissionStateType] + +export const useAggregateDataExchangeMutation: UseAggregateDataExchangeMutationType = + ({ id }) => { + const engine = useDataEngine() + + const [submissionState, dispatch] = useReducer( + submitReducer, + uncalledState + ) + const [fetch, setFetch] = useState(false) + + useEffect(() => { + const fetchData = async ({ id }) => { + if (fetch) { + dispatch({ type: 'loading' }) + try { + const response = await engine.mutate( + getMutation({ id }) as any + ) + const internalResponse = response?.response ?? response + if (internalResponse?.status === 'ERROR') { + const errorMessage = + internalResponse?.importSummaries.find( + ({ status }) => status === 'ERROR' + )?.description || i18n.t('Unknown error') + throw new Error(errorMessage) + } + setFetch(false) + dispatch({ type: 'success', payload: response }) + } catch (error) { + setFetch(false) + dispatch({ type: 'error', payload: error }) + } + } + } + fetchData({ id }) + }, [id, fetch, engine]) + + // clean up if id changes + useEffect(() => { + return () => { + dispatch({ type: 'reset' }) + } + }, [id]) + + const refetch = () => { + setFetch(true) + } + + return [refetch, submissionState] + } diff --git a/src/components/view/top-bar/exchange-select/exchange-select.js b/src/components/view/top-bar/exchange-select/exchange-select.tsx similarity index 94% rename from src/components/view/top-bar/exchange-select/exchange-select.js rename to src/components/view/top-bar/exchange-select/exchange-select.tsx index 8b21afa..0b9194b 100644 --- a/src/components/view/top-bar/exchange-select/exchange-select.js +++ b/src/components/view/top-bar/exchange-select/exchange-select.tsx @@ -1,9 +1,9 @@ import i18n from '@dhis2/d2-i18n' import { SelectorBarItem } from '@dhis2/ui' import React, { useState } from 'react' -import { useAppContext } from '../../../../context/app-context/index.js' -import { useExchangeId } from '../../../../use-context-selection/use-context-selections.js' -import { MenuSelect } from '../menu-select/index.js' +import { useAppContext } from '../../../../context/app-context/index' +import { useExchangeId } from '../../../../use-context-selection/use-context-selections' +import { MenuSelect } from '../menu-select/index' const ExchangeSelect = () => { const { aggregateDataExchanges } = useAppContext() diff --git a/src/components/view/top-bar/exchange-select/index.js b/src/components/view/top-bar/exchange-select/index.js deleted file mode 100644 index 6214a3b..0000000 --- a/src/components/view/top-bar/exchange-select/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from './exchange-select.js' diff --git a/src/components/view/top-bar/exchange-select/index.tsx b/src/components/view/top-bar/exchange-select/index.tsx new file mode 100644 index 0000000..adf226b --- /dev/null +++ b/src/components/view/top-bar/exchange-select/index.tsx @@ -0,0 +1 @@ +export * from './exchange-select' diff --git a/src/components/view/top-bar/index.js b/src/components/view/top-bar/index.js deleted file mode 100644 index e93177f..0000000 --- a/src/components/view/top-bar/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from './top-bar.js' diff --git a/src/components/view/top-bar/index.tsx b/src/components/view/top-bar/index.tsx new file mode 100644 index 0000000..b940436 --- /dev/null +++ b/src/components/view/top-bar/index.tsx @@ -0,0 +1 @@ +export * from './top-bar' diff --git a/src/components/view/top-bar/menu-select/index.js b/src/components/view/top-bar/menu-select/index.js deleted file mode 100644 index 7b31532..0000000 --- a/src/components/view/top-bar/menu-select/index.js +++ /dev/null @@ -1 +0,0 @@ -export * from './menu-select.js' diff --git a/src/components/view/top-bar/menu-select/index.tsx b/src/components/view/top-bar/menu-select/index.tsx new file mode 100644 index 0000000..a9567d3 --- /dev/null +++ b/src/components/view/top-bar/menu-select/index.tsx @@ -0,0 +1 @@ +export * from './menu-select' diff --git a/src/components/view/top-bar/menu-select/menu-select.js b/src/components/view/top-bar/menu-select/menu-select.tsx similarity index 96% rename from src/components/view/top-bar/menu-select/menu-select.js rename to src/components/view/top-bar/menu-select/menu-select.tsx index 5c81b68..d0d9671 100644 --- a/src/components/view/top-bar/menu-select/menu-select.js +++ b/src/components/view/top-bar/menu-select/menu-select.tsx @@ -10,7 +10,7 @@ const MenuSelect = ({ values, selected, dataTest, onChange }) => { {values.map(({ value, label }) => ( {label}
} active={selected === value} onClick={() => onChange({ selected: value })} diff --git a/src/components/view/top-bar/top-bar.js b/src/components/view/top-bar/top-bar.tsx similarity index 87% rename from src/components/view/top-bar/top-bar.js rename to src/components/view/top-bar/top-bar.tsx index 87ce965..8a51172 100644 --- a/src/components/view/top-bar/top-bar.js +++ b/src/components/view/top-bar/top-bar.tsx @@ -2,9 +2,9 @@ import i18n from '@dhis2/d2-i18n' import { Button, SelectorBar } from '@dhis2/ui' import React from 'react' import { Link } from 'react-router-dom' -import { useUserContext } from '../../../context/index.js' -import { useClearEntireSelection } from '../../../use-context-selection/index.js' -import { ExchangeSelect } from './exchange-select/index.js' +import { useUserContext } from '../../../context/index' +import { useClearEntireSelection } from '../../../use-context-selection/index' +import { ExchangeSelect } from './exchange-select/index' import styles from './top-bar.module.css' const LinKToEditMode = () => { diff --git a/src/context/app-context/app-context.js b/src/context/app-context/app-context.tsx similarity index 100% rename from src/context/app-context/app-context.js rename to src/context/app-context/app-context.tsx diff --git a/src/context/app-context/app-provider.js b/src/context/app-context/app-provider.tsx similarity index 80% rename from src/context/app-context/app-provider.js rename to src/context/app-context/app-provider.tsx index 31e62ea..d5f9ea1 100644 --- a/src/context/app-context/app-provider.js +++ b/src/context/app-context/app-provider.tsx @@ -2,8 +2,12 @@ import { useDataQuery } from '@dhis2/app-runtime' import i18n from '@dhis2/d2-i18n' import PropTypes from 'prop-types' import React from 'react' -import { Loader, Warning } from '../../components/common/index.js' -import { AppContext } from './app-context.js' +import { Loader, Warning } from '../../components/common/index' +import { + AggregateDataExchange, + ModelCollectionResponse, +} from '../../types/generated' +import { AppContext } from './app-context' const query = { aggregateDataExchanges: { @@ -25,13 +29,20 @@ const query = { }, } +type AggregateDataExchangeResponse = { + aggregateDataExchanges: ModelCollectionResponse< + AggregateDataExchange, + 'aggregateDataExchanges' + > +} + const AppProvider = ({ children }) => { const { data, loading, error, refetch: refetchExchanges, - } = useDataQuery(query) + } = useDataQuery(query) if (loading) { return diff --git a/src/context/app-context/index.js b/src/context/app-context/index.js deleted file mode 100644 index 6b03f55..0000000 --- a/src/context/app-context/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export { AppContext } from './app-context.js' -export { AppProvider } from './app-provider.js' -export { useAppContext } from './use-app-context.js' diff --git a/src/context/app-context/index.tsx b/src/context/app-context/index.tsx new file mode 100644 index 0000000..6d64fef --- /dev/null +++ b/src/context/app-context/index.tsx @@ -0,0 +1,3 @@ +export { AppContext } from './app-context' +export { AppProvider } from './app-provider' +export { useAppContext } from './use-app-context' diff --git a/src/context/app-context/use-app-context.js b/src/context/app-context/use-app-context.tsx similarity index 67% rename from src/context/app-context/use-app-context.js rename to src/context/app-context/use-app-context.tsx index 4154ba1..979c667 100644 --- a/src/context/app-context/use-app-context.js +++ b/src/context/app-context/use-app-context.tsx @@ -1,4 +1,4 @@ import { useContext } from 'react' -import { AppContext } from './app-context.js' +import { AppContext } from './app-context' export const useAppContext = () => useContext(AppContext) diff --git a/src/context/attribute-context/attribute-context.js b/src/context/attribute-context/attribute-context.tsx similarity index 100% rename from src/context/attribute-context/attribute-context.js rename to src/context/attribute-context/attribute-context.tsx diff --git a/src/context/attribute-context/attribute-provider.js b/src/context/attribute-context/attribute-provider.tsx similarity index 76% rename from src/context/attribute-context/attribute-provider.js rename to src/context/attribute-context/attribute-provider.tsx index 3febe9a..e320e0e 100644 --- a/src/context/attribute-context/attribute-provider.js +++ b/src/context/attribute-context/attribute-provider.tsx @@ -2,8 +2,10 @@ import { useDataQuery } from '@dhis2/app-runtime' import i18n from '@dhis2/d2-i18n' import PropTypes from 'prop-types' import React from 'react' -import { Loader, Warning } from '../../components/common/index.js' -import { AttributeContext } from './attribute-context.js' +import { Loader, Warning } from '../../components/common/index' +import { Attribute, ModelCollectionResponse } from '../../types/generated' +import { WrapQueryResponse } from '../../types/query' +import { AttributeContext } from './attribute-context' const query = { attributes: { @@ -18,8 +20,12 @@ const query = { }, } +type AttributeResponse = { + attributes: ModelCollectionResponse +} + const AttributeProvider = ({ children }) => { - const { data, loading, error } = useDataQuery(query) + const { data, loading, error } = useDataQuery(query) if (loading) { return diff --git a/src/context/attribute-context/index.js b/src/context/attribute-context/index.js deleted file mode 100644 index 0a86479..0000000 --- a/src/context/attribute-context/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export { AttributeContext } from './attribute-context.js' -export { AttributeProvider } from './attribute-provider.js' -export { useAttributeContext } from './use-attribute-context.js' diff --git a/src/context/attribute-context/index.tsx b/src/context/attribute-context/index.tsx new file mode 100644 index 0000000..fd9f414 --- /dev/null +++ b/src/context/attribute-context/index.tsx @@ -0,0 +1,3 @@ +export { AttributeContext } from './attribute-context' +export { AttributeProvider } from './attribute-provider' +export { useAttributeContext } from './use-attribute-context' diff --git a/src/context/attribute-context/use-attribute-context.js b/src/context/attribute-context/use-attribute-context.tsx similarity index 64% rename from src/context/attribute-context/use-attribute-context.js rename to src/context/attribute-context/use-attribute-context.tsx index 75a010d..d0acbc9 100644 --- a/src/context/attribute-context/use-attribute-context.js +++ b/src/context/attribute-context/use-attribute-context.tsx @@ -1,4 +1,4 @@ import { useContext } from 'react' -import { AttributeContext } from './attribute-context.js' +import { AttributeContext } from './attribute-context' export const useAttributeContext = () => useContext(AttributeContext) diff --git a/src/context/exchange-context/exchange-context.js b/src/context/exchange-context/exchange-context.js deleted file mode 100644 index 525ab99..0000000 --- a/src/context/exchange-context/exchange-context.js +++ /dev/null @@ -1,11 +0,0 @@ -import { createContext } from 'react' - -const ExchangeContext = createContext({ - exchange: {}, - exchangeData: {}, - refetch: () => { - console.log('exchange context not initialized') - }, -}) - -export { ExchangeContext } diff --git a/src/context/exchange-context/exchange-context.tsx b/src/context/exchange-context/exchange-context.tsx new file mode 100644 index 0000000..d568f3f --- /dev/null +++ b/src/context/exchange-context/exchange-context.tsx @@ -0,0 +1,18 @@ +import { createContext } from 'react' +import { ExchangeData } from '../../types' +import { AggregateDataExchange } from '../../types/generated' + +type ExchangeContextType = { + exchange: AggregateDataExchange | null + exchangeData: ExchangeData + refetch?: VoidFunction +} +const ExchangeContext = createContext({ + exchange: null, + exchangeData: null, + refetch: () => { + console.log('exchange context not initialized') + }, +}) + +export { ExchangeContext } diff --git a/src/context/exchange-context/exchange-provider.js b/src/context/exchange-context/exchange-provider.tsx similarity index 83% rename from src/context/exchange-context/exchange-provider.js rename to src/context/exchange-context/exchange-provider.tsx index 14eaa9f..ba0f0fe 100644 --- a/src/context/exchange-context/exchange-provider.js +++ b/src/context/exchange-context/exchange-provider.tsx @@ -3,12 +3,14 @@ import i18n from '@dhis2/d2-i18n' import { Button } from '@dhis2/ui' import PropTypes from 'prop-types' import React, { useCallback, useEffect } from 'react' -import { Loader, Warning } from '../../components/common/index.js' +import { Loader, Warning } from '../../components/common/index' +import { ExchangeData } from '../../types' +import { AggregateDataExchange } from '../../types/generated' import { useExchangeId, useRequestIndex, -} from '../../use-context-selection/index.js' -import { ExchangeContext } from './exchange-context.js' +} from '../../use-context-selection/index' +import { ExchangeContext } from './exchange-context' import styles from './exchange-provider.module.css' const query = { @@ -30,10 +32,16 @@ const query = { }, } +type ExchangeResponse = { + exchangeData: ExchangeData + exchange: AggregateDataExchange +} + const ExchangeProvider = ({ children }) => { - const { loading, error, data, called, refetch } = useDataQuery(query, { - lazy: true, - }) + const { loading, error, data, called, refetch } = + useDataQuery(query, { + lazy: true, + }) const [exchangeId] = useExchangeId() const [, setRequestIndex] = useRequestIndex() const fetchExchange = useCallback( diff --git a/src/context/exchange-context/index.js b/src/context/exchange-context/index.js deleted file mode 100644 index ba07971..0000000 --- a/src/context/exchange-context/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export { ExchangeContext } from './exchange-context.js' -export { ExchangeProvider } from './exchange-provider.js' -export { useExchangeContext } from './use-exchange-context.js' diff --git a/src/context/exchange-context/index.tsx b/src/context/exchange-context/index.tsx new file mode 100644 index 0000000..9145640 --- /dev/null +++ b/src/context/exchange-context/index.tsx @@ -0,0 +1,3 @@ +export { ExchangeContext } from './exchange-context' +export { ExchangeProvider } from './exchange-provider' +export { useExchangeContext } from './use-exchange-context' diff --git a/src/context/exchange-context/use-exchange-context.js b/src/context/exchange-context/use-exchange-context.tsx similarity index 65% rename from src/context/exchange-context/use-exchange-context.js rename to src/context/exchange-context/use-exchange-context.tsx index 4b6c3f4..80559cc 100644 --- a/src/context/exchange-context/use-exchange-context.js +++ b/src/context/exchange-context/use-exchange-context.tsx @@ -1,4 +1,4 @@ import { useContext } from 'react' -import { ExchangeContext } from './exchange-context.js' +import { ExchangeContext } from './exchange-context' export const useExchangeContext = () => useContext(ExchangeContext) diff --git a/src/context/index.js b/src/context/index.js deleted file mode 100644 index ade08bf..0000000 --- a/src/context/index.js +++ /dev/null @@ -1,4 +0,0 @@ -export * from './app-context/index.js' -export * from './exchange-context/index.js' -export * from './user-context/index.js' -export * from './attribute-context/index.js' diff --git a/src/context/index.tsx b/src/context/index.tsx new file mode 100644 index 0000000..c740320 --- /dev/null +++ b/src/context/index.tsx @@ -0,0 +1,4 @@ +export * from './app-context/index' +export * from './exchange-context/index' +export * from './user-context/index' +export * from './attribute-context/index' diff --git a/src/context/user-context/index.js b/src/context/user-context/index.js deleted file mode 100644 index 1ae3706..0000000 --- a/src/context/user-context/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export { UserContext } from './user-context.js' -export { UserProvider } from './user-provider.js' -export { useUserContext } from './use-user-context.js' diff --git a/src/context/user-context/index.tsx b/src/context/user-context/index.tsx new file mode 100644 index 0000000..e4d9703 --- /dev/null +++ b/src/context/user-context/index.tsx @@ -0,0 +1,3 @@ +export { UserContext } from './user-context' +export { UserProvider } from './user-provider' +export { useUserContext } from './use-user-context' diff --git a/src/context/user-context/use-user-context.js b/src/context/user-context/use-user-context.tsx similarity index 66% rename from src/context/user-context/use-user-context.js rename to src/context/user-context/use-user-context.tsx index 4a63d9b..290edd8 100644 --- a/src/context/user-context/use-user-context.js +++ b/src/context/user-context/use-user-context.tsx @@ -1,4 +1,4 @@ import { useContext } from 'react' -import { UserContext } from './user-context.js' +import { UserContext } from './user-context' export const useUserContext = () => useContext(UserContext) diff --git a/src/context/user-context/user-context.js b/src/context/user-context/user-context.js deleted file mode 100644 index 02605a3..0000000 --- a/src/context/user-context/user-context.js +++ /dev/null @@ -1,11 +0,0 @@ -import { createContext } from 'react' - -const UserContext = createContext({ - id: '', - canAddExchange: false, - canDeleteExchange: false, - organisationUnits: [], - keyUiLocale: 'en', -}) - -export { UserContext } diff --git a/src/context/user-context/user-context.tsx b/src/context/user-context/user-context.tsx new file mode 100644 index 0000000..d3286d8 --- /dev/null +++ b/src/context/user-context/user-context.tsx @@ -0,0 +1,17 @@ +import { createContext } from 'react' +import { CurrentUser } from '../../types/generated' + +type UserContextType = Partial & { + canAddExchange: boolean + canDeleteExchange: boolean + keyUiLocale: string +} +const UserContext = createContext({ + id: '', + canAddExchange: false, + canDeleteExchange: false, + organisationUnits: [], + keyUiLocale: 'en', +}) + +export { UserContext } diff --git a/src/context/user-context/user-provider.js b/src/context/user-context/user-provider.tsx similarity index 85% rename from src/context/user-context/user-provider.js rename to src/context/user-context/user-provider.tsx index ccd54df..9b69e1c 100644 --- a/src/context/user-context/user-provider.js +++ b/src/context/user-context/user-provider.tsx @@ -2,8 +2,9 @@ import { useDataQuery } from '@dhis2/app-runtime' import i18n from '@dhis2/d2-i18n' import PropTypes from 'prop-types' import React from 'react' -import { Loader, Warning } from '../../components/common/index.js' -import { UserContext } from './user-context.js' +import { Loader, Warning } from '../../components/common/index' +import { CurrentUser } from '../../types/generated' +import { UserContext } from './user-context' const EXCHANGE_AUTHORITIES_ADD = [ 'F_AGGREGATE_DATA_EXCHANGE_PRIVATE_ADD', @@ -24,8 +25,10 @@ const query = { }, } +type UserResponse = { user: CurrentUser } + const UserProvider = ({ children }) => { - const { data, loading, error } = useDataQuery(query) + const { data, loading, error } = useDataQuery(query) if (loading) { return @@ -64,7 +67,7 @@ const UserProvider = ({ children }) => { canAddExchange, canDeleteExchange, organisationUnits, - keyUiLocale: settings.keyUiLocale, + keyUiLocale: settings.keyUiLocale as string, } return ( diff --git a/src/custom.d.ts b/src/custom.d.ts new file mode 100644 index 0000000..5fedfc6 --- /dev/null +++ b/src/custom.d.ts @@ -0,0 +1,8 @@ +import 'react' + +declare module 'react' { + interface StyleHTMLAttributes extends React.HTMLAttributes { + jsx?: boolean + global?: boolean + } +} diff --git a/src/global.d.ts b/src/global.d.ts new file mode 100644 index 0000000..6c344ed --- /dev/null +++ b/src/global.d.ts @@ -0,0 +1 @@ +declare module '*.module.css' diff --git a/src/index.js b/src/index.js deleted file mode 100644 index 16b0ced..0000000 --- a/src/index.js +++ /dev/null @@ -1,4 +0,0 @@ -import { AppWrapper } from './app.js' -import './locales/index.js' - -export default AppWrapper diff --git a/src/index.tsx b/src/index.tsx new file mode 100644 index 0000000..de41106 --- /dev/null +++ b/src/index.tsx @@ -0,0 +1,4 @@ +import { AppWrapper } from './app' +import './locales/index' + +export default AppWrapper diff --git a/src/pages/addItem.js b/src/pages/addItem.tsx similarity index 82% rename from src/pages/addItem.js rename to src/pages/addItem.tsx index 1995d4a..11cd017 100644 --- a/src/pages/addItem.js +++ b/src/pages/addItem.tsx @@ -3,8 +3,8 @@ import { AccessWarning, ExchangeForm, EXCHANGE_TYPES, -} from '../components/index.js' -import { useUserContext } from '../context/index.js' +} from '../components/index' +import { useUserContext } from '../context/index' const defaultExchange = { source: { requests: [] }, diff --git a/src/pages/data.js b/src/pages/data.tsx similarity index 93% rename from src/pages/data.js rename to src/pages/data.tsx index 4b3fc93..eed6f23 100644 --- a/src/pages/data.js +++ b/src/pages/data.tsx @@ -5,8 +5,8 @@ import { Layout, SubmitModal, TopBar, -} from '../components/index.js' -import { ExchangeProvider } from '../context/index.js' +} from '../components/index' +import { ExchangeProvider } from '../context/index' export const DataPage = () => { const [submitModalOpen, setSubmitModalOpen] = useState(false) diff --git a/src/pages/editItem.js b/src/pages/editItem.tsx similarity index 88% rename from src/pages/editItem.js rename to src/pages/editItem.tsx index 74d3d1d..f385dc4 100644 --- a/src/pages/editItem.js +++ b/src/pages/editItem.tsx @@ -5,8 +5,8 @@ import { ExchangeForm, Loader, useFetchExchange, -} from '../components/index.js' -import { useUserContext } from '../context/index.js' +} from '../components/index' +import { useUserContext } from '../context/index' export const EditItem = () => { const { exchangeID } = useParams() diff --git a/src/pages/editOverview.js b/src/pages/editOverview.tsx similarity index 96% rename from src/pages/editOverview.js rename to src/pages/editOverview.tsx index 38c57bb..030145b 100644 --- a/src/pages/editOverview.js +++ b/src/pages/editOverview.tsx @@ -1,5 +1,5 @@ import React from 'react' -import { EditHomeTopBar, EditItemsList } from '../components/index.js' +import { EditHomeTopBar, EditItemsList } from '../components/index' export const EditPage = () => (
diff --git a/src/pages/index.js b/src/pages/index.js deleted file mode 100644 index 00e8060..0000000 --- a/src/pages/index.js +++ /dev/null @@ -1,4 +0,0 @@ -export { DataPage } from './data.js' -export { EditPage } from './editOverview.js' -export { EditItem } from './editItem.js' -export { AddItem } from './addItem.js' diff --git a/src/pages/index.tsx b/src/pages/index.tsx new file mode 100644 index 0000000..bb5fa9f --- /dev/null +++ b/src/pages/index.tsx @@ -0,0 +1,4 @@ +export { DataPage } from './data' +export { EditPage } from './editOverview' +export { EditItem } from './editItem' +export { AddItem } from './addItem' diff --git a/src/test-utils/setup-tests.js b/src/test-utils/setup-tests.tsx similarity index 100% rename from src/test-utils/setup-tests.js rename to src/test-utils/setup-tests.tsx diff --git a/src/types/generated/index.ts b/src/types/generated/index.ts new file mode 100644 index 0000000..2084e0d --- /dev/null +++ b/src/types/generated/index.ts @@ -0,0 +1,4 @@ +/* GENERATED BY https://github.com/Birkbjo/dhis2-open-api-ts */ + +export * from './models' +export type * from './utility' diff --git a/src/types/generated/models.ts b/src/types/generated/models.ts new file mode 100644 index 0000000..5e6264c --- /dev/null +++ b/src/types/generated/models.ts @@ -0,0 +1,10957 @@ +/* eslint-disable @typescript-eslint/no-namespace */ +/* GENERATED BY https://github.com/Birkbjo/dhis2-open-api-ts */ + +export type Access = { + data?: AccessData + delete: boolean + externalize: boolean + manage: boolean + read: boolean + update: boolean + write: boolean +} + +export type AccessData = { + read: boolean + write: boolean +} + +export type AddOperation = { + op: string + path: string + value: Record +} + +export type AggregateDataExchange = { + access: Access + attributeValues: Array + code: string + created: string + createdBy: User + displayName: string + favorite: boolean + favorites: Array + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + name: string + sharing: Sharing + source: Source + target: Target + translations: Array + user: User +} + +export type AggregateDataExchangeJobParameters = { + dataExchangeIds: Array> +} + +export type AnalyticsJobParameters = { + lastYears: number + skipPrograms: Array> + skipResourceTables: boolean + skipTableTypes: Array< + | 'DATA_VALUE' + | 'COMPLETENESS' + | 'COMPLETENESS_TARGET' + | 'ORG_UNIT_TARGET' + | 'EVENT' + | 'ENROLLMENT' + | 'OWNERSHIP' + | 'VALIDATION_RESULT' + | 'TRACKED_ENTITY_INSTANCE_EVENTS' + | 'TRACKED_ENTITY_INSTANCE_ENROLLMENTS' + | 'TRACKED_ENTITY_INSTANCE' + > +} + +export type AnalyticsPeriodBoundary = { + access: Access + analyticsPeriodBoundaryType: AnalyticsPeriodBoundary.analyticsPeriodBoundaryType + attributeValues: Array + boundaryTarget: string + code: string + created: string + createdBy: User + displayName: string + favorite: boolean + favorites: Array + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + name: string + offsetPeriodType: AnalyticsPeriodBoundary.offsetPeriodType + offsetPeriods: number + sharing: Sharing + translations: Array + user: User +} + +export namespace AnalyticsPeriodBoundary { + export enum analyticsPeriodBoundaryType { + BEFORE_START_OF_REPORTING_PERIOD = 'BEFORE_START_OF_REPORTING_PERIOD', + BEFORE_END_OF_REPORTING_PERIOD = 'BEFORE_END_OF_REPORTING_PERIOD', + AFTER_START_OF_REPORTING_PERIOD = 'AFTER_START_OF_REPORTING_PERIOD', + AFTER_END_OF_REPORTING_PERIOD = 'AFTER_END_OF_REPORTING_PERIOD', + } + + export enum offsetPeriodType { + BI_MONTHLY = 'BiMonthly', + BI_WEEKLY = 'BiWeekly', + DAILY = 'Daily', + FINANCIAL_APRIL = 'FinancialApril', + FINANCIAL_JULY = 'FinancialJuly', + FINANCIAL_NOV = 'FinancialNov', + FINANCIAL_OCT = 'FinancialOct', + MONTHLY = 'Monthly', + QUARTERLY = 'Quarterly', + QUARTERLY_NOV = 'QuarterlyNov', + SIX_MONTHLY_APRIL = 'SixMonthlyApril', + SIX_MONTHLY_NOV = 'SixMonthlyNov', + SIX_MONTHLY = 'SixMonthly', + TWO_YEARLY = 'TwoYearly', + WEEKLY = 'Weekly', + WEEKLY_SATURDAY = 'WeeklySaturday', + WEEKLY_SUNDAY = 'WeeklySunday', + WEEKLY_THURSDAY = 'WeeklyThursday', + WEEKLY_WEDNESDAY = 'WeeklyWednesday', + YEARLY = 'Yearly', + } +} + +export type AnalyticsTableHook = { + access: Access + analyticsTableType: AnalyticsTableHook.analyticsTableType + attributeValues: Array + code: string + created: string + createdBy: User + displayName: string + favorite: boolean + favorites: Array + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + name: string + phase: AnalyticsTableHook.phase + resourceTableType: AnalyticsTableHook.resourceTableType + sharing: Sharing + sql: string + translations: Array + user: User +} + +export namespace AnalyticsTableHook { + export enum analyticsTableType { + DATA_VALUE = 'DATA_VALUE', + COMPLETENESS = 'COMPLETENESS', + COMPLETENESS_TARGET = 'COMPLETENESS_TARGET', + ORG_UNIT_TARGET = 'ORG_UNIT_TARGET', + EVENT = 'EVENT', + ENROLLMENT = 'ENROLLMENT', + OWNERSHIP = 'OWNERSHIP', + VALIDATION_RESULT = 'VALIDATION_RESULT', + TRACKED_ENTITY_INSTANCE_EVENTS = 'TRACKED_ENTITY_INSTANCE_EVENTS', + TRACKED_ENTITY_INSTANCE_ENROLLMENTS = 'TRACKED_ENTITY_INSTANCE_ENROLLMENTS', + TRACKED_ENTITY_INSTANCE = 'TRACKED_ENTITY_INSTANCE', + } + + export enum phase { + RESOURCE_TABLE_POPULATED = 'RESOURCE_TABLE_POPULATED', + ANALYTICS_TABLE_POPULATED = 'ANALYTICS_TABLE_POPULATED', + } + + export enum resourceTableType { + ORG_UNIT_STRUCTURE = 'ORG_UNIT_STRUCTURE', + DATA_SET_ORG_UNIT_CATEGORY = 'DATA_SET_ORG_UNIT_CATEGORY', + CATEGORY_OPTION_COMBO_NAME = 'CATEGORY_OPTION_COMBO_NAME', + DATA_ELEMENT_GROUP_SET_STRUCTURE = 'DATA_ELEMENT_GROUP_SET_STRUCTURE', + INDICATOR_GROUP_SET_STRUCTURE = 'INDICATOR_GROUP_SET_STRUCTURE', + ORG_UNIT_GROUP_SET_STRUCTURE = 'ORG_UNIT_GROUP_SET_STRUCTURE', + CATEGORY_STRUCTURE = 'CATEGORY_STRUCTURE', + DATA_ELEMENT_STRUCTURE = 'DATA_ELEMENT_STRUCTURE', + PERIOD_STRUCTURE = 'PERIOD_STRUCTURE', + DATE_PERIOD_STRUCTURE = 'DATE_PERIOD_STRUCTURE', + DATA_ELEMENT_CATEGORY_OPTION_COMBO = 'DATA_ELEMENT_CATEGORY_OPTION_COMBO', + DATA_APPROVAL_REMAP_LEVEL = 'DATA_APPROVAL_REMAP_LEVEL', + DATA_APPROVAL_MIN_LEVEL = 'DATA_APPROVAL_MIN_LEVEL', + } +} + +export type Api = { + accessToken: string + password: string + url: string + username: string +} + +export type ApiToken = { + access: Access + attributeValues: Array + attributes: Array + code: string + created: string + createdBy: User + displayName: string + expire: number + favorite: boolean + favorites: Array + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + name: string + sharing: Sharing + translations: Array + type: ApiToken.type + user: User + version: number +} + +export namespace ApiToken { + export enum type { + PERSONAL_ACCESS_TOKEN_V1 = 'PERSONAL_ACCESS_TOKEN_V1', + } +} + +export type ApiTokenAuth = { + token: string + type: string +} + +export type App = { + activities: AppActivities + appState: App.appState + appStorageSource: App.appStorageSource + appType: App.appType + app_hub_id: string + authorities: Array + baseUrl: string + bundled: boolean + core_app: boolean + default_locale: string + description: string + developer: AppDeveloper + folderName: string + icons: AppIcons + installs_allowed_from: Array + key: string + launchUrl: string + launch_path: string + name: string + pluginLaunchUrl: string + plugin_launch_path: string + plugin_type: string + settings: AppSettings + short_name: string + version: string +} + +export namespace App { + export enum appState { + OK = 'OK', + INVALID_BUNDLED_APP_OVERRIDE = 'INVALID_BUNDLED_APP_OVERRIDE', + INVALID_CORE_APP = 'INVALID_CORE_APP', + NAMESPACE_TAKEN = 'NAMESPACE_TAKEN', + INVALID_ZIP_FORMAT = 'INVALID_ZIP_FORMAT', + MISSING_MANIFEST = 'MISSING_MANIFEST', + INVALID_MANIFEST_JSON = 'INVALID_MANIFEST_JSON', + INSTALLATION_FAILED = 'INSTALLATION_FAILED', + NOT_FOUND = 'NOT_FOUND', + MISSING_SYSTEM_BASE_URL = 'MISSING_SYSTEM_BASE_URL', + APPROVED = 'APPROVED', + PENDING = 'PENDING', + NOT_APPROVED = 'NOT_APPROVED', + DELETION_IN_PROGRESS = 'DELETION_IN_PROGRESS', + } + + export enum appStorageSource { + LOCAL = 'LOCAL', + JCLOUDS = 'JCLOUDS', + } + + export enum appType { + APP = 'APP', + RESOURCE = 'RESOURCE', + DASHBOARD_WIDGET = 'DASHBOARD_WIDGET', + TRACKER_DASHBOARD_WIDGET = 'TRACKER_DASHBOARD_WIDGET', + } +} + +export type AppActivities = { + dhis: AppDhis +} + +export type AppDeveloper = { + company: string + email: string + name: string + url: string +} + +export type AppDhis = { + href: string + namespace: string +} + +export type AppIcons = { + '16': string + '48': string + '128': string +} + +export type ApprovalDto = { + aoc: UID_CategoryOptionCombo + ou: UID_OrganisationUnit +} + +export type ApprovalsDto = { + approvals: Array + ds: Array> + pe: Array + wf: Array> +} + +export type ApprovalStatusDto = { + aoc: UID_CategoryOptionCombo + level: string + ou: UID_OrganisationUnit + ouName: string + pe: string + permissions: DataApprovalPermissions + state: ApprovalStatusDto.state + wf: UID_DataApprovalWorkflow +} + +export namespace ApprovalStatusDto { + export enum state { + UNAPPROVABLE = 'UNAPPROVABLE', + UNAPPROVED_ABOVE = 'UNAPPROVED_ABOVE', + UNAPPROVED_WAITING = 'UNAPPROVED_WAITING', + UNAPPROVED_READY = 'UNAPPROVED_READY', + APPROVED_ABOVE = 'APPROVED_ABOVE', + APPROVED_HERE = 'APPROVED_HERE', + ACCEPTED_HERE = 'ACCEPTED_HERE', + } +} + +export type AppSettings = { + dashboardWidget: DashboardWidgetAppSettings +} + +export type AppVersion = { + created: string + demoUrl: string + downloadUrl: string + id: string + lastUpdated: string + maxDhisVersion: string + minDhisVersion: string + version: string +} + +export type Attribute = { + access: Access + attributeValues: Array + categoryAttribute: boolean + categoryOptionAttribute: boolean + categoryOptionComboAttribute: boolean + categoryOptionGroupAttribute: boolean + categoryOptionGroupSetAttribute: boolean + code: string + constantAttribute: boolean + created: string + createdBy: User + dataElementAttribute: boolean + dataElementGroupAttribute: boolean + dataElementGroupSetAttribute: boolean + dataSetAttribute: boolean + description: string + displayDescription: string + displayFormName: string + displayName: string + displayShortName: string + documentAttribute: boolean + eventChartAttribute: boolean + eventReportAttribute: boolean + favorite: boolean + favorites: Array + formName: string + href: string + id: string + indicatorAttribute: boolean + indicatorGroupAttribute: boolean + lastUpdated: string + lastUpdatedBy: User + legendSetAttribute: boolean + mandatory: boolean + mapAttribute: boolean + name: string + objectTypes: Array + optionAttribute: boolean + optionSet: OptionSet + optionSetAttribute: boolean + organisationUnitAttribute: boolean + organisationUnitGroupAttribute: boolean + organisationUnitGroupSetAttribute: boolean + programAttribute: boolean + programIndicatorAttribute: boolean + programStageAttribute: boolean + relationshipTypeAttribute: boolean + sectionAttribute: boolean + sharing: Sharing + shortName: string + sortOrder: number + sqlViewAttribute: boolean + trackedEntityAttributeAttribute: boolean + trackedEntityTypeAttribute: boolean + translations: Array + unique: boolean + user: User + userAttribute: boolean + userGroupAttribute: boolean + validationRuleAttribute: boolean + validationRuleGroupAttribute: boolean + valueType: Attribute.valueType + visualizationAttribute: boolean +} + +export namespace Attribute { + export enum valueType { + TEXT = 'TEXT', + LONG_TEXT = 'LONG_TEXT', + MULTI_TEXT = 'MULTI_TEXT', + LETTER = 'LETTER', + PHONE_NUMBER = 'PHONE_NUMBER', + EMAIL = 'EMAIL', + BOOLEAN = 'BOOLEAN', + TRUE_ONLY = 'TRUE_ONLY', + DATE = 'DATE', + DATETIME = 'DATETIME', + TIME = 'TIME', + NUMBER = 'NUMBER', + UNIT_INTERVAL = 'UNIT_INTERVAL', + PERCENTAGE = 'PERCENTAGE', + INTEGER = 'INTEGER', + INTEGER_POSITIVE = 'INTEGER_POSITIVE', + INTEGER_NEGATIVE = 'INTEGER_NEGATIVE', + INTEGER_ZERO_OR_POSITIVE = 'INTEGER_ZERO_OR_POSITIVE', + TRACKER_ASSOCIATE = 'TRACKER_ASSOCIATE', + USERNAME = 'USERNAME', + COORDINATE = 'COORDINATE', + ORGANISATION_UNIT = 'ORGANISATION_UNIT', + REFERENCE = 'REFERENCE', + AGE = 'AGE', + URL = 'URL', + FILE_RESOURCE = 'FILE_RESOURCE', + IMAGE = 'IMAGE', + GEOJSON = 'GEOJSON', + } +} + +export type AttributeValue = { + attribute: Attribute + value: string +} + +export type AttributeValueFilter = { + attribute: string + dateFilter: DateFilterPeriod + eq: string + ew: string + ge: string + gt: string + in: Array + le: string + like: string + lt: string + sw: string +} + +export type AvailabilityStatus = { + available: boolean + message: string + statusCode: number + statusPhrase: string +} + +export type Axis = { + axis: number + dimensionalItem: string +} + +export type AxisV2 = { + baseLine: Line + decimals: number + index: number + label: StyledObject + maxValue: number + minValue: number + steps: number + targetLine: Line + title: StyledObject + type: AxisV2.type +} + +export namespace AxisV2 { + export enum type { + DOMAIN = 'DOMAIN', + RANGE = 'RANGE', + } +} + +export type BaseIdentifiableObject = { + access: Access + attributeValues: Array + code: string + created: string + createdBy: User + displayName: string + favorite: boolean + favorites: Array + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + name: string + sharing: Sharing + translations: Array + user: User +} + +export type BatchResponseStatus = { + summaries: Array +} + +export type Body = { + enrollments: Array + events: Array + relationships: Array + trackedEntities: Array +} + +export type BulkJsonPatch = { + patch: JsonPatch + targetIds: Record> +} + +export type BulkSmsGatewayConfig = { + id: string + isDefault: boolean + maxSmsLength: string + name: string + password: string + sendUrlParameters: boolean + uid: string + urlTemplate: string + username: string +} + +export type CascadeSharingReport = { + countUpdatedDashboardItems: number + errorReports: Array + updateObjects: Record> +} + +export type Category = { + access: Access + aggregationType: Category.aggregationType + allItems: boolean + attributeValues: Array + categoryCombos: Array + categoryOptions: Array + code: string + created: string + createdBy: User + dataDimension: boolean + dataDimensionType: Category.dataDimensionType + description: string + dimension: string + dimensionItemKeywords: DimensionItemKeywords + displayDescription: string + displayFormName: string + displayName: string + displayShortName: string + favorite: boolean + favorites: Array + filter: string + formName: string + href: string + id: string + items: Array + lastUpdated: string + lastUpdatedBy: User + legendSet: LegendSet + name: string + optionSet: OptionSet + programStage: ProgramStage + repetition: EventRepetition + sharing: Sharing + shortName: string + translations: Array + user: User + valueType: Category.valueType +} + +export namespace Category { + export enum aggregationType { + SUM = 'SUM', + AVERAGE = 'AVERAGE', + AVERAGE_SUM_ORG_UNIT = 'AVERAGE_SUM_ORG_UNIT', + LAST = 'LAST', + LAST_AVERAGE_ORG_UNIT = 'LAST_AVERAGE_ORG_UNIT', + LAST_LAST_ORG_UNIT = 'LAST_LAST_ORG_UNIT', + LAST_IN_PERIOD = 'LAST_IN_PERIOD', + LAST_IN_PERIOD_AVERAGE_ORG_UNIT = 'LAST_IN_PERIOD_AVERAGE_ORG_UNIT', + FIRST = 'FIRST', + FIRST_AVERAGE_ORG_UNIT = 'FIRST_AVERAGE_ORG_UNIT', + FIRST_FIRST_ORG_UNIT = 'FIRST_FIRST_ORG_UNIT', + COUNT = 'COUNT', + STDDEV = 'STDDEV', + VARIANCE = 'VARIANCE', + MIN = 'MIN', + MAX = 'MAX', + MIN_SUM_ORG_UNIT = 'MIN_SUM_ORG_UNIT', + MAX_SUM_ORG_UNIT = 'MAX_SUM_ORG_UNIT', + NONE = 'NONE', + CUSTOM = 'CUSTOM', + DEFAULT = 'DEFAULT', + } + + export enum dataDimensionType { + DISAGGREGATION = 'DISAGGREGATION', + ATTRIBUTE = 'ATTRIBUTE', + } + + export enum valueType { + TEXT = 'TEXT', + LONG_TEXT = 'LONG_TEXT', + MULTI_TEXT = 'MULTI_TEXT', + LETTER = 'LETTER', + PHONE_NUMBER = 'PHONE_NUMBER', + EMAIL = 'EMAIL', + BOOLEAN = 'BOOLEAN', + TRUE_ONLY = 'TRUE_ONLY', + DATE = 'DATE', + DATETIME = 'DATETIME', + TIME = 'TIME', + NUMBER = 'NUMBER', + UNIT_INTERVAL = 'UNIT_INTERVAL', + PERCENTAGE = 'PERCENTAGE', + INTEGER = 'INTEGER', + INTEGER_POSITIVE = 'INTEGER_POSITIVE', + INTEGER_NEGATIVE = 'INTEGER_NEGATIVE', + INTEGER_ZERO_OR_POSITIVE = 'INTEGER_ZERO_OR_POSITIVE', + TRACKER_ASSOCIATE = 'TRACKER_ASSOCIATE', + USERNAME = 'USERNAME', + COORDINATE = 'COORDINATE', + ORGANISATION_UNIT = 'ORGANISATION_UNIT', + REFERENCE = 'REFERENCE', + AGE = 'AGE', + URL = 'URL', + FILE_RESOURCE = 'FILE_RESOURCE', + IMAGE = 'IMAGE', + GEOJSON = 'GEOJSON', + } +} + +export type CategoryCombo = { + access: Access + attributeValues: Array + categories: Array + categoryOptionCombos: Array + code: string + created: string + createdBy: User + dataDimensionType: CategoryCombo.dataDimensionType + displayName: string + favorite: boolean + favorites: Array + href: string + id: string + isDefault: boolean + lastUpdated: string + lastUpdatedBy: User + name: string + sharing: Sharing + skipTotal: boolean + translations: Array + user: User +} + +export namespace CategoryCombo { + export enum dataDimensionType { + DISAGGREGATION = 'DISAGGREGATION', + ATTRIBUTE = 'ATTRIBUTE', + } +} + +export type CategoryDimension = { + category: Category + categoryOptions: Array +} + +export type CategoryOption = { + access: Access + aggregationType: CategoryOption.aggregationType + attributeValues: Array + categories: Array + categoryOptionCombos: Array + categoryOptionGroups: Array + code: string + created: string + createdBy: User + description: string + dimensionItem: string + displayDescription: string + displayFormName: string + displayName: string + displayShortName: string + endDate: string + favorite: boolean + favorites: Array + formName: string + href: string + id: string + isDefault: boolean + lastUpdated: string + lastUpdatedBy: User + legendSet: LegendSet + legendSets: Array + name: string + organisationUnits: Array + queryMods: QueryModifiers + sharing: Sharing + shortName: string + startDate: string + style: ObjectStyle + translations: Array + user: User +} + +export namespace CategoryOption { + export enum aggregationType { + SUM = 'SUM', + AVERAGE = 'AVERAGE', + AVERAGE_SUM_ORG_UNIT = 'AVERAGE_SUM_ORG_UNIT', + LAST = 'LAST', + LAST_AVERAGE_ORG_UNIT = 'LAST_AVERAGE_ORG_UNIT', + LAST_LAST_ORG_UNIT = 'LAST_LAST_ORG_UNIT', + LAST_IN_PERIOD = 'LAST_IN_PERIOD', + LAST_IN_PERIOD_AVERAGE_ORG_UNIT = 'LAST_IN_PERIOD_AVERAGE_ORG_UNIT', + FIRST = 'FIRST', + FIRST_AVERAGE_ORG_UNIT = 'FIRST_AVERAGE_ORG_UNIT', + FIRST_FIRST_ORG_UNIT = 'FIRST_FIRST_ORG_UNIT', + COUNT = 'COUNT', + STDDEV = 'STDDEV', + VARIANCE = 'VARIANCE', + MIN = 'MIN', + MAX = 'MAX', + MIN_SUM_ORG_UNIT = 'MIN_SUM_ORG_UNIT', + MAX_SUM_ORG_UNIT = 'MAX_SUM_ORG_UNIT', + NONE = 'NONE', + CUSTOM = 'CUSTOM', + DEFAULT = 'DEFAULT', + } +} + +export type CategoryOptionCombo = { + access: Access + aggregationType: CategoryOptionCombo.aggregationType + attributeValues: Array + categoryCombo: CategoryCombo + categoryOptions: Array + code: string + created: string + createdBy: User + description: string + dimensionItem: string + dimensionItemType: CategoryOptionCombo.dimensionItemType + displayDescription: string + displayFormName: string + displayName: string + displayShortName: string + favorite: boolean + favorites: Array + formName: string + href: string + id: string + ignoreApproval: boolean + lastUpdated: string + lastUpdatedBy: User + legendSet: LegendSet + legendSets: Array + queryMods: QueryModifiers + sharing: Sharing + translations: Array + user: User +} + +export namespace CategoryOptionCombo { + export enum aggregationType { + SUM = 'SUM', + AVERAGE = 'AVERAGE', + AVERAGE_SUM_ORG_UNIT = 'AVERAGE_SUM_ORG_UNIT', + LAST = 'LAST', + LAST_AVERAGE_ORG_UNIT = 'LAST_AVERAGE_ORG_UNIT', + LAST_LAST_ORG_UNIT = 'LAST_LAST_ORG_UNIT', + LAST_IN_PERIOD = 'LAST_IN_PERIOD', + LAST_IN_PERIOD_AVERAGE_ORG_UNIT = 'LAST_IN_PERIOD_AVERAGE_ORG_UNIT', + FIRST = 'FIRST', + FIRST_AVERAGE_ORG_UNIT = 'FIRST_AVERAGE_ORG_UNIT', + FIRST_FIRST_ORG_UNIT = 'FIRST_FIRST_ORG_UNIT', + COUNT = 'COUNT', + STDDEV = 'STDDEV', + VARIANCE = 'VARIANCE', + MIN = 'MIN', + MAX = 'MAX', + MIN_SUM_ORG_UNIT = 'MIN_SUM_ORG_UNIT', + MAX_SUM_ORG_UNIT = 'MAX_SUM_ORG_UNIT', + NONE = 'NONE', + CUSTOM = 'CUSTOM', + DEFAULT = 'DEFAULT', + } + + export enum dimensionItemType { + DATA_ELEMENT = 'DATA_ELEMENT', + DATA_ELEMENT_OPERAND = 'DATA_ELEMENT_OPERAND', + INDICATOR = 'INDICATOR', + REPORTING_RATE = 'REPORTING_RATE', + PROGRAM_DATA_ELEMENT = 'PROGRAM_DATA_ELEMENT', + PROGRAM_ATTRIBUTE = 'PROGRAM_ATTRIBUTE', + PROGRAM_INDICATOR = 'PROGRAM_INDICATOR', + PERIOD = 'PERIOD', + ORGANISATION_UNIT = 'ORGANISATION_UNIT', + CATEGORY_OPTION = 'CATEGORY_OPTION', + OPTION_GROUP = 'OPTION_GROUP', + DATA_ELEMENT_GROUP = 'DATA_ELEMENT_GROUP', + ORGANISATION_UNIT_GROUP = 'ORGANISATION_UNIT_GROUP', + CATEGORY_OPTION_GROUP = 'CATEGORY_OPTION_GROUP', + EXPRESSION_DIMENSION_ITEM = 'EXPRESSION_DIMENSION_ITEM', + SUBEXPRESSION_DIMENSION_ITEM = 'SUBEXPRESSION_DIMENSION_ITEM', + } +} + +export type CategoryOptionGroup = { + access: Access + aggregationType: CategoryOptionGroup.aggregationType + attributeValues: Array + categoryOptions: Array + code: string + created: string + createdBy: User + dataDimensionType: CategoryOptionGroup.dataDimensionType + description: string + dimensionItem: string + displayDescription: string + displayFormName: string + displayName: string + displayShortName: string + favorite: boolean + favorites: Array + formName: string + groupSets: Array + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + legendSet: LegendSet + legendSets: Array + name: string + queryMods: QueryModifiers + sharing: Sharing + shortName: string + translations: Array + user: User +} + +export namespace CategoryOptionGroup { + export enum aggregationType { + SUM = 'SUM', + AVERAGE = 'AVERAGE', + AVERAGE_SUM_ORG_UNIT = 'AVERAGE_SUM_ORG_UNIT', + LAST = 'LAST', + LAST_AVERAGE_ORG_UNIT = 'LAST_AVERAGE_ORG_UNIT', + LAST_LAST_ORG_UNIT = 'LAST_LAST_ORG_UNIT', + LAST_IN_PERIOD = 'LAST_IN_PERIOD', + LAST_IN_PERIOD_AVERAGE_ORG_UNIT = 'LAST_IN_PERIOD_AVERAGE_ORG_UNIT', + FIRST = 'FIRST', + FIRST_AVERAGE_ORG_UNIT = 'FIRST_AVERAGE_ORG_UNIT', + FIRST_FIRST_ORG_UNIT = 'FIRST_FIRST_ORG_UNIT', + COUNT = 'COUNT', + STDDEV = 'STDDEV', + VARIANCE = 'VARIANCE', + MIN = 'MIN', + MAX = 'MAX', + MIN_SUM_ORG_UNIT = 'MIN_SUM_ORG_UNIT', + MAX_SUM_ORG_UNIT = 'MAX_SUM_ORG_UNIT', + NONE = 'NONE', + CUSTOM = 'CUSTOM', + DEFAULT = 'DEFAULT', + } + + export enum dataDimensionType { + DISAGGREGATION = 'DISAGGREGATION', + ATTRIBUTE = 'ATTRIBUTE', + } +} + +export type CategoryOptionGroupSet = { + access: Access + aggregationType: CategoryOptionGroupSet.aggregationType + allItems: boolean + attributeValues: Array + categoryOptionGroups: Array + code: string + created: string + createdBy: User + dataDimension: boolean + dataDimensionType: CategoryOptionGroupSet.dataDimensionType + description: string + dimension: string + dimensionItemKeywords: DimensionItemKeywords + displayDescription: string + displayFormName: string + displayName: string + displayShortName: string + favorite: boolean + favorites: Array + filter: string + formName: string + href: string + id: string + items: Array + lastUpdated: string + lastUpdatedBy: User + legendSet: LegendSet + name: string + optionSet: OptionSet + programStage: ProgramStage + repetition: EventRepetition + sharing: Sharing + shortName: string + translations: Array + user: User + valueType: CategoryOptionGroupSet.valueType +} + +export namespace CategoryOptionGroupSet { + export enum aggregationType { + SUM = 'SUM', + AVERAGE = 'AVERAGE', + AVERAGE_SUM_ORG_UNIT = 'AVERAGE_SUM_ORG_UNIT', + LAST = 'LAST', + LAST_AVERAGE_ORG_UNIT = 'LAST_AVERAGE_ORG_UNIT', + LAST_LAST_ORG_UNIT = 'LAST_LAST_ORG_UNIT', + LAST_IN_PERIOD = 'LAST_IN_PERIOD', + LAST_IN_PERIOD_AVERAGE_ORG_UNIT = 'LAST_IN_PERIOD_AVERAGE_ORG_UNIT', + FIRST = 'FIRST', + FIRST_AVERAGE_ORG_UNIT = 'FIRST_AVERAGE_ORG_UNIT', + FIRST_FIRST_ORG_UNIT = 'FIRST_FIRST_ORG_UNIT', + COUNT = 'COUNT', + STDDEV = 'STDDEV', + VARIANCE = 'VARIANCE', + MIN = 'MIN', + MAX = 'MAX', + MIN_SUM_ORG_UNIT = 'MIN_SUM_ORG_UNIT', + MAX_SUM_ORG_UNIT = 'MAX_SUM_ORG_UNIT', + NONE = 'NONE', + CUSTOM = 'CUSTOM', + DEFAULT = 'DEFAULT', + } + + export enum dataDimensionType { + DISAGGREGATION = 'DISAGGREGATION', + ATTRIBUTE = 'ATTRIBUTE', + } + + export enum valueType { + TEXT = 'TEXT', + LONG_TEXT = 'LONG_TEXT', + MULTI_TEXT = 'MULTI_TEXT', + LETTER = 'LETTER', + PHONE_NUMBER = 'PHONE_NUMBER', + EMAIL = 'EMAIL', + BOOLEAN = 'BOOLEAN', + TRUE_ONLY = 'TRUE_ONLY', + DATE = 'DATE', + DATETIME = 'DATETIME', + TIME = 'TIME', + NUMBER = 'NUMBER', + UNIT_INTERVAL = 'UNIT_INTERVAL', + PERCENTAGE = 'PERCENTAGE', + INTEGER = 'INTEGER', + INTEGER_POSITIVE = 'INTEGER_POSITIVE', + INTEGER_NEGATIVE = 'INTEGER_NEGATIVE', + INTEGER_ZERO_OR_POSITIVE = 'INTEGER_ZERO_OR_POSITIVE', + TRACKER_ASSOCIATE = 'TRACKER_ASSOCIATE', + USERNAME = 'USERNAME', + COORDINATE = 'COORDINATE', + ORGANISATION_UNIT = 'ORGANISATION_UNIT', + REFERENCE = 'REFERENCE', + AGE = 'AGE', + URL = 'URL', + FILE_RESOURCE = 'FILE_RESOURCE', + IMAGE = 'IMAGE', + GEOJSON = 'GEOJSON', + } +} + +export type CategoryOptionGroupSetDimension = { + categoryOptionGroupSet: CategoryOptionGroupSet + categoryOptionGroups: Array +} + +export type ClickatellGatewayConfig = { + authToken: string + id: string + isDefault: boolean + maxSmsLength: string + name: string + password: string + sendUrlParameters: boolean + uid: string + urlTemplate: string + username: string +} + +export type CodeList = { + codes: Array +} + +export type Column = { + index: number + span: number +} + +export type CompleteStatusDto = { + complete: boolean + created: string + createdBy: string + lastUpdated: string + lastUpdatedBy: string +} + +export type Config = { + inclusionStrategy: Config.inclusionStrategy + properties: Record> +} + +export namespace Config { + export enum inclusionStrategy { + ALWAYS = 'ALWAYS', + NON_NULL = 'NON_NULL', + NON_EMPTY = 'NON_EMPTY', + } +} + +export type Configuration = { + corsWhitelist: Array + facilityOrgUnitGroupSet: OrganisationUnitGroupSet + facilityOrgUnitLevel: OrganisationUnitLevel + feedbackRecipients: UserGroup + infrastructuralDataElements: DataElementGroup + infrastructuralIndicators: IndicatorGroup + infrastructuralPeriodType: Configuration.infrastructuralPeriodType + offlineOrganisationUnitLevel: OrganisationUnitLevel + selfRegistrationOrgUnit: OrganisationUnit + selfRegistrationRole: UserRole + systemId: string + systemUpdateNotificationRecipients: UserGroup +} + +export namespace Configuration { + export enum infrastructuralPeriodType { + BI_MONTHLY = 'BiMonthly', + BI_WEEKLY = 'BiWeekly', + DAILY = 'Daily', + FINANCIAL_APRIL = 'FinancialApril', + FINANCIAL_JULY = 'FinancialJuly', + FINANCIAL_NOV = 'FinancialNov', + FINANCIAL_OCT = 'FinancialOct', + MONTHLY = 'Monthly', + QUARTERLY = 'Quarterly', + QUARTERLY_NOV = 'QuarterlyNov', + SIX_MONTHLY_APRIL = 'SixMonthlyApril', + SIX_MONTHLY_NOV = 'SixMonthlyNov', + SIX_MONTHLY = 'SixMonthly', + TWO_YEARLY = 'TwoYearly', + WEEKLY = 'Weekly', + WEEKLY_SATURDAY = 'WeeklySaturday', + WEEKLY_SUNDAY = 'WeeklySunday', + WEEKLY_THURSDAY = 'WeeklyThursday', + WEEKLY_WEDNESDAY = 'WeeklyWednesday', + YEARLY = 'Yearly', + } +} + +export type ConsoleTarget = { + clientId: string + type: string +} + +export type Constant = { + access: Access + attributeValues: Array + code: string + created: string + createdBy: User + description: string + displayDescription: string + displayFormName: string + displayName: string + displayShortName: string + favorite: boolean + favorites: Array + formName: string + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + name: string + sharing: Sharing + shortName: string + translations: Array + user: User + value: number +} + +export type ContinuousAnalyticsJobParameters = { + fullUpdateHourOfDay: number + lastYears: number + skipTableTypes: Array< + | 'DATA_VALUE' + | 'COMPLETENESS' + | 'COMPLETENESS_TARGET' + | 'ORG_UNIT_TARGET' + | 'EVENT' + | 'ENROLLMENT' + | 'OWNERSHIP' + | 'VALIDATION_RESULT' + | 'TRACKED_ENTITY_INSTANCE_EVENTS' + | 'TRACKED_ENTITY_INSTANCE_ENROLLMENTS' + | 'TRACKED_ENTITY_INSTANCE' + > +} + +export type CustomDataEntryFormDto = { + dataSetId: string + displayDensity: CustomDataEntryFormDto.displayDensity + form: string + id: string + version: number +} + +export namespace CustomDataEntryFormDto { + export enum displayDensity { + COMFORTABLE = 'COMFORTABLE', + NORMAL = 'NORMAL', + COMPACT = 'COMPACT', + NONE = 'NONE', + } +} + +export type Dashboard = { + access: Access + allowedFilters: Array + attributeValues: Array + code: string + created: string + createdBy: User + dashboardItems: Array + description: string + displayDescription: string + displayFormName: string + displayName: string + displayShortName: string + favorite: boolean + favorites: Array + formName: string + href: string + id: string + itemConfig: ItemConfig + itemCount: number + lastUpdated: string + lastUpdatedBy: User + layout: Layout + name: string + restrictFilters: boolean + sharing: Sharing + shortName: string + translations: Array + user: User +} + +export type DashboardItem = { + access: Access + appKey: string + attributeValues: Array + code: string + contentCount: number + created: string + createdBy: User + displayName: string + eventChart: Ref_EventChart + eventReport: Ref_EventReport + eventVisualization: EventVisualization + favorite: boolean + favorites: Array + height: number + href: string + id: string + interpretationCount: number + interpretationLikeCount: number + lastUpdated: string + lastUpdatedBy: User + map: Map + messages: boolean + name: string + reports: Array + resources: Array + shape: DashboardItem.shape + sharing: Sharing + text: string + translations: Array + type: DashboardItem.type + user: User + users: Array + visualization: Visualization + width: number + x: number + y: number +} + +export namespace DashboardItem { + export enum shape { + NORMAL = 'NORMAL', + DOUBLE_WIDTH = 'DOUBLE_WIDTH', + FULL_WIDTH = 'FULL_WIDTH', + } + + export enum type { + VISUALIZATION = 'VISUALIZATION', + EVENT_VISUALIZATION = 'EVENT_VISUALIZATION', + EVENT_CHART = 'EVENT_CHART', + MAP = 'MAP', + EVENT_REPORT = 'EVENT_REPORT', + USERS = 'USERS', + REPORTS = 'REPORTS', + RESOURCES = 'RESOURCES', + TEXT = 'TEXT', + MESSAGES = 'MESSAGES', + APP = 'APP', + } +} + +export type DashboardSearchResult = { + appCount: number + apps: Array + eventChartCount: number + eventCharts: Array + eventReportCount: number + eventReports: Array + eventVisualizationCount: number + eventVisualizations: Array + mapCount: number + maps: Array + reportCount: number + reports: Array + resourceCount: number + resources: Array + searchCount: number + userCount: number + users: Array + visualizationCount: number + visualizations: Array +} + +export type DashboardWidgetAppSettings = { + hideTitle: boolean +} + +export type DataAnalysisParams = { + ds: Array + endDate: string + ou: string + standardDeviation: number + startDate: string +} + +export type DataApprovalLevel = { + access: Access + attributeValues: Array + categoryOptionGroupSet: CategoryOptionGroupSet + code: string + created: string + createdBy: User + displayName: string + favorite: boolean + favorites: Array + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + level: number + name: string + orgUnitLevel: number + orgUnitLevelName: string + sharing: Sharing + translations: Array + user: User +} + +export type DataApprovalPermissions = { + acceptedAt: string + acceptedBy: string + approvedAt: string + approvedBy: string + mayAccept: boolean + mayApprove: boolean + mayReadData: boolean + mayUnaccept: boolean + mayUnapprove: boolean + state: string +} + +export type DataApprovalWorkflow = { + access: Access + attributeValues: Array + categoryCombo: CategoryCombo + code: string + created: string + createdBy: User + dataApprovalLevels: Array + dataSets: Array + displayName: string + favorite: boolean + favorites: Array + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + name: string + periodType: DataApprovalWorkflow.periodType + sharing: Sharing + translations: Array + user: User +} + +export namespace DataApprovalWorkflow { + export enum periodType { + BI_MONTHLY = 'BiMonthly', + BI_WEEKLY = 'BiWeekly', + DAILY = 'Daily', + FINANCIAL_APRIL = 'FinancialApril', + FINANCIAL_JULY = 'FinancialJuly', + FINANCIAL_NOV = 'FinancialNov', + FINANCIAL_OCT = 'FinancialOct', + MONTHLY = 'Monthly', + QUARTERLY = 'Quarterly', + QUARTERLY_NOV = 'QuarterlyNov', + SIX_MONTHLY_APRIL = 'SixMonthlyApril', + SIX_MONTHLY_NOV = 'SixMonthlyNov', + SIX_MONTHLY = 'SixMonthly', + TWO_YEARLY = 'TwoYearly', + WEEKLY = 'Weekly', + WEEKLY_SATURDAY = 'WeeklySaturday', + WEEKLY_SUNDAY = 'WeeklySunday', + WEEKLY_THURSDAY = 'WeeklyThursday', + WEEKLY_WEDNESDAY = 'WeeklyWednesday', + YEARLY = 'Yearly', + } +} + +export type DatabaseInfo = { + databaseVersion: string + name: string + spatialSupport: boolean + url: string + user: string +} + +export type DataDimensionItem = { + dataDimensionItemType: DataDimensionItem.dataDimensionItemType + dataElement: DataElement + dataElementOperand: DataElementOperand + expressionDimensionItem: ExpressionDimensionItem + indicator: Indicator + programAttribute: ProgramTrackedEntityAttributeDimensionItem + programDataElement: ProgramDataElementDimensionItem + programIndicator: ProgramIndicator + reportingRate: ReportingRate + subexpressionDimensionItem: Ref_SubexpressionDimensionItem +} + +export namespace DataDimensionItem { + export enum dataDimensionItemType { + INDICATOR = 'INDICATOR', + DATA_ELEMENT = 'DATA_ELEMENT', + DATA_ELEMENT_OPERAND = 'DATA_ELEMENT_OPERAND', + REPORTING_RATE = 'REPORTING_RATE', + PROGRAM_INDICATOR = 'PROGRAM_INDICATOR', + PROGRAM_DATA_ELEMENT = 'PROGRAM_DATA_ELEMENT', + PROGRAM_ATTRIBUTE = 'PROGRAM_ATTRIBUTE', + EXPRESSION_DIMENSION_ITEM = 'EXPRESSION_DIMENSION_ITEM', + SUBEXPRESSION_DIMENSION_ITEM = 'SUBEXPRESSION_DIMENSION_ITEM', + VALIDATION_RULE = 'VALIDATION_RULE', + } +} + +export type DataElement = { + access: Access + aggregationLevels: Array + aggregationType: DataElement.aggregationType + attributeValues: Array + categoryCombo: CategoryCombo + code: string + commentOptionSet: OptionSet + created: string + createdBy: User + dataElementGroups: Array + dataSetElements: Array + description: string + dimensionItem: string + displayDescription: string + displayFormName: string + displayName: string + displayShortName: string + domainType: DataElement.domainType + favorite: boolean + favorites: Array + fieldMask: string + formName: string + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + legendSet: LegendSet + legendSets: Array + name: string + optionSet: OptionSet + optionSetValue: boolean + queryMods: QueryModifiers + sharing: Sharing + shortName: string + style: ObjectStyle + translations: Array + url: string + user: User + valueType: DataElement.valueType + valueTypeOptions: FileTypeValueOptions + zeroIsSignificant: boolean +} + +export namespace DataElement { + export enum aggregationType { + SUM = 'SUM', + AVERAGE = 'AVERAGE', + AVERAGE_SUM_ORG_UNIT = 'AVERAGE_SUM_ORG_UNIT', + LAST = 'LAST', + LAST_AVERAGE_ORG_UNIT = 'LAST_AVERAGE_ORG_UNIT', + LAST_LAST_ORG_UNIT = 'LAST_LAST_ORG_UNIT', + LAST_IN_PERIOD = 'LAST_IN_PERIOD', + LAST_IN_PERIOD_AVERAGE_ORG_UNIT = 'LAST_IN_PERIOD_AVERAGE_ORG_UNIT', + FIRST = 'FIRST', + FIRST_AVERAGE_ORG_UNIT = 'FIRST_AVERAGE_ORG_UNIT', + FIRST_FIRST_ORG_UNIT = 'FIRST_FIRST_ORG_UNIT', + COUNT = 'COUNT', + STDDEV = 'STDDEV', + VARIANCE = 'VARIANCE', + MIN = 'MIN', + MAX = 'MAX', + MIN_SUM_ORG_UNIT = 'MIN_SUM_ORG_UNIT', + MAX_SUM_ORG_UNIT = 'MAX_SUM_ORG_UNIT', + NONE = 'NONE', + CUSTOM = 'CUSTOM', + DEFAULT = 'DEFAULT', + } + + export enum domainType { + AGGREGATE = 'AGGREGATE', + TRACKER = 'TRACKER', + } + + export enum valueType { + TEXT = 'TEXT', + LONG_TEXT = 'LONG_TEXT', + MULTI_TEXT = 'MULTI_TEXT', + LETTER = 'LETTER', + PHONE_NUMBER = 'PHONE_NUMBER', + EMAIL = 'EMAIL', + BOOLEAN = 'BOOLEAN', + TRUE_ONLY = 'TRUE_ONLY', + DATE = 'DATE', + DATETIME = 'DATETIME', + TIME = 'TIME', + NUMBER = 'NUMBER', + UNIT_INTERVAL = 'UNIT_INTERVAL', + PERCENTAGE = 'PERCENTAGE', + INTEGER = 'INTEGER', + INTEGER_POSITIVE = 'INTEGER_POSITIVE', + INTEGER_NEGATIVE = 'INTEGER_NEGATIVE', + INTEGER_ZERO_OR_POSITIVE = 'INTEGER_ZERO_OR_POSITIVE', + TRACKER_ASSOCIATE = 'TRACKER_ASSOCIATE', + USERNAME = 'USERNAME', + COORDINATE = 'COORDINATE', + ORGANISATION_UNIT = 'ORGANISATION_UNIT', + REFERENCE = 'REFERENCE', + AGE = 'AGE', + URL = 'URL', + FILE_RESOURCE = 'FILE_RESOURCE', + IMAGE = 'IMAGE', + GEOJSON = 'GEOJSON', + } +} + +export type DataElementGroup = { + access: Access + attributeValues: Array + code: string + created: string + createdBy: User + dataElements: Array + description: string + dimensionItem: string + displayDescription: string + displayFormName: string + displayName: string + displayShortName: string + favorite: boolean + favorites: Array + formName: string + groupSets: Array + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + legendSet: LegendSet + legendSets: Array + name: string + queryMods: QueryModifiers + sharing: Sharing + shortName: string + translations: Array + user: User +} + +export type DataElementGroupSet = { + access: Access + aggregationType: DataElementGroupSet.aggregationType + allItems: boolean + attributeValues: Array + code: string + compulsory: boolean + created: string + createdBy: User + dataDimension: boolean + dataDimensionType: DataElementGroupSet.dataDimensionType + dataElementGroups: Array + description: string + dimension: string + dimensionItemKeywords: DimensionItemKeywords + displayDescription: string + displayFormName: string + displayName: string + displayShortName: string + favorite: boolean + favorites: Array + filter: string + formName: string + href: string + id: string + items: Array + lastUpdated: string + lastUpdatedBy: User + legendSet: LegendSet + name: string + optionSet: OptionSet + programStage: ProgramStage + repetition: EventRepetition + sharing: Sharing + shortName: string + translations: Array + user: User + valueType: DataElementGroupSet.valueType +} + +export namespace DataElementGroupSet { + export enum aggregationType { + SUM = 'SUM', + AVERAGE = 'AVERAGE', + AVERAGE_SUM_ORG_UNIT = 'AVERAGE_SUM_ORG_UNIT', + LAST = 'LAST', + LAST_AVERAGE_ORG_UNIT = 'LAST_AVERAGE_ORG_UNIT', + LAST_LAST_ORG_UNIT = 'LAST_LAST_ORG_UNIT', + LAST_IN_PERIOD = 'LAST_IN_PERIOD', + LAST_IN_PERIOD_AVERAGE_ORG_UNIT = 'LAST_IN_PERIOD_AVERAGE_ORG_UNIT', + FIRST = 'FIRST', + FIRST_AVERAGE_ORG_UNIT = 'FIRST_AVERAGE_ORG_UNIT', + FIRST_FIRST_ORG_UNIT = 'FIRST_FIRST_ORG_UNIT', + COUNT = 'COUNT', + STDDEV = 'STDDEV', + VARIANCE = 'VARIANCE', + MIN = 'MIN', + MAX = 'MAX', + MIN_SUM_ORG_UNIT = 'MIN_SUM_ORG_UNIT', + MAX_SUM_ORG_UNIT = 'MAX_SUM_ORG_UNIT', + NONE = 'NONE', + CUSTOM = 'CUSTOM', + DEFAULT = 'DEFAULT', + } + + export enum dataDimensionType { + DISAGGREGATION = 'DISAGGREGATION', + ATTRIBUTE = 'ATTRIBUTE', + } + + export enum valueType { + TEXT = 'TEXT', + LONG_TEXT = 'LONG_TEXT', + MULTI_TEXT = 'MULTI_TEXT', + LETTER = 'LETTER', + PHONE_NUMBER = 'PHONE_NUMBER', + EMAIL = 'EMAIL', + BOOLEAN = 'BOOLEAN', + TRUE_ONLY = 'TRUE_ONLY', + DATE = 'DATE', + DATETIME = 'DATETIME', + TIME = 'TIME', + NUMBER = 'NUMBER', + UNIT_INTERVAL = 'UNIT_INTERVAL', + PERCENTAGE = 'PERCENTAGE', + INTEGER = 'INTEGER', + INTEGER_POSITIVE = 'INTEGER_POSITIVE', + INTEGER_NEGATIVE = 'INTEGER_NEGATIVE', + INTEGER_ZERO_OR_POSITIVE = 'INTEGER_ZERO_OR_POSITIVE', + TRACKER_ASSOCIATE = 'TRACKER_ASSOCIATE', + USERNAME = 'USERNAME', + COORDINATE = 'COORDINATE', + ORGANISATION_UNIT = 'ORGANISATION_UNIT', + REFERENCE = 'REFERENCE', + AGE = 'AGE', + URL = 'URL', + FILE_RESOURCE = 'FILE_RESOURCE', + IMAGE = 'IMAGE', + GEOJSON = 'GEOJSON', + } +} + +export type DataElementGroupSetDimension = { + dataElementGroupSet: DataElementGroupSet + dataElementGroups: Array +} + +export type DataElementOperand = { + access: Access + attributeOptionCombo: CategoryOptionCombo + attributeValues: Array + categoryOptionCombo: CategoryOptionCombo + code: string + created: string + createdBy: User + dataElement: DataElement + description: string + displayDescription: string + displayFormName: string + favorite: boolean + favorites: Array + formName: string + href: string + lastUpdated: string + lastUpdatedBy: User + legendSet: LegendSet + legendSets: Array + queryMods: QueryModifiers + sharing: Sharing + translations: Array + user: User +} + +export type DataEntryForm = { + access: Access + attributeValues: Array + code: string + created: string + createdBy: User + displayName: string + favorite: boolean + favorites: Array + format: number + href: string + htmlCode: string + id: string + lastUpdated: string + lastUpdatedBy: User + name: string + sharing: Sharing + style: DataEntryForm.style + translations: Array + user: User +} + +export namespace DataEntryForm { + export enum style { + COMFORTABLE = 'COMFORTABLE', + NORMAL = 'NORMAL', + COMPACT = 'COMPACT', + NONE = 'NONE', + } +} + +export type DataInputPeriod = { + closingDate: string + openingDate: string + period: string +} + +export type DataIntegrityCheck = { + code: string + description: string + displayName: string + introduction: string + isSlow: boolean + issuesIdType: string + name: string + recommendation: string + section: string + severity: DataIntegrityCheck.severity +} + +export namespace DataIntegrityCheck { + export enum severity { + INFO = 'INFO', + WARNING = 'WARNING', + SEVERE = 'SEVERE', + CRITICAL = 'CRITICAL', + } +} + +export type DataIntegrityDetails = { + error: string + finishedTime: string + issues: Array + startTime: string +} + +export type DataIntegrityIssue = { + comment: string + id: string + name: string + refs: Array +} + +export type DataIntegrityJobParameters = { + checks: Array + type: DataIntegrityJobParameters.type +} + +export namespace DataIntegrityJobParameters { + export enum type { + REPORT = 'REPORT', + SUMMARY = 'SUMMARY', + DETAILS = 'DETAILS', + } +} + +export type DataIntegritySummary = { + count: number + error: string + finishedTime: string + percentage: number + startTime: string +} + +export type DataSet = { + access: Access + aggregationType: DataSet.aggregationType + attributeValues: Array + categoryCombo: CategoryCombo + code: string + compulsoryDataElementOperands: Array + compulsoryFieldsCompleteOnly: boolean + created: string + createdBy: User + dataElementDecoration: boolean + dataEntryForm: DataEntryForm + dataInputPeriods: Array + dataSetElements: Array + description: string + dimensionItem: string + displayDescription: string + displayFormName: string + displayName: string + displayShortName: string + expiryDays: number + favorite: boolean + favorites: Array + fieldCombinationRequired: boolean + formName: string + formType: DataSet.formType + href: string + id: string + indicators: Array + interpretations: Array + lastUpdated: string + lastUpdatedBy: User + legendSet: LegendSet + legendSets: Array + mobile: boolean + name: string + noValueRequiresComment: boolean + notificationRecipients: UserGroup + notifyCompletingUser: boolean + openFuturePeriods: number + openPeriodsAfterCoEndDate: number + organisationUnits: Array + periodType: DataSet.periodType + queryMods: QueryModifiers + renderAsTabs: boolean + renderHorizontally: boolean + sections: Array
+ sharing: Sharing + shortName: string + skipOffline: boolean + style: ObjectStyle + timelyDays: number + translations: Array + user: User + validCompleteOnly: boolean + version: number + workflow: DataApprovalWorkflow +} + +export namespace DataSet { + export enum aggregationType { + SUM = 'SUM', + AVERAGE = 'AVERAGE', + AVERAGE_SUM_ORG_UNIT = 'AVERAGE_SUM_ORG_UNIT', + LAST = 'LAST', + LAST_AVERAGE_ORG_UNIT = 'LAST_AVERAGE_ORG_UNIT', + LAST_LAST_ORG_UNIT = 'LAST_LAST_ORG_UNIT', + LAST_IN_PERIOD = 'LAST_IN_PERIOD', + LAST_IN_PERIOD_AVERAGE_ORG_UNIT = 'LAST_IN_PERIOD_AVERAGE_ORG_UNIT', + FIRST = 'FIRST', + FIRST_AVERAGE_ORG_UNIT = 'FIRST_AVERAGE_ORG_UNIT', + FIRST_FIRST_ORG_UNIT = 'FIRST_FIRST_ORG_UNIT', + COUNT = 'COUNT', + STDDEV = 'STDDEV', + VARIANCE = 'VARIANCE', + MIN = 'MIN', + MAX = 'MAX', + MIN_SUM_ORG_UNIT = 'MIN_SUM_ORG_UNIT', + MAX_SUM_ORG_UNIT = 'MAX_SUM_ORG_UNIT', + NONE = 'NONE', + CUSTOM = 'CUSTOM', + DEFAULT = 'DEFAULT', + } + + export enum formType { + DEFAULT = 'DEFAULT', + CUSTOM = 'CUSTOM', + SECTION = 'SECTION', + SECTION_MULTIORG = 'SECTION_MULTIORG', + } + + export enum periodType { + BI_MONTHLY = 'BiMonthly', + BI_WEEKLY = 'BiWeekly', + DAILY = 'Daily', + FINANCIAL_APRIL = 'FinancialApril', + FINANCIAL_JULY = 'FinancialJuly', + FINANCIAL_NOV = 'FinancialNov', + FINANCIAL_OCT = 'FinancialOct', + MONTHLY = 'Monthly', + QUARTERLY = 'Quarterly', + QUARTERLY_NOV = 'QuarterlyNov', + SIX_MONTHLY_APRIL = 'SixMonthlyApril', + SIX_MONTHLY_NOV = 'SixMonthlyNov', + SIX_MONTHLY = 'SixMonthly', + TWO_YEARLY = 'TwoYearly', + WEEKLY = 'Weekly', + WEEKLY_SATURDAY = 'WeeklySaturday', + WEEKLY_SUNDAY = 'WeeklySunday', + WEEKLY_THURSDAY = 'WeeklyThursday', + WEEKLY_WEDNESDAY = 'WeeklyWednesday', + YEARLY = 'Yearly', + } +} + +export type DataSetCompletionDto = { + attribute: DataValueCategoryDto + completed: boolean + dataSet: string + orgUnit: string + period: string +} + +export type DataSetElement = { + categoryCombo: CategoryCombo + dataElement: DataElement + dataSet: DataSet +} + +export type DataSetNotificationTemplate = { + access: Access + attributeValues: Array + code: string + created: string + createdBy: User + dataSetNotificationTrigger: DataSetNotificationTemplate.dataSetNotificationTrigger + dataSets: Array + deliveryChannels: Array<'SMS' | 'EMAIL' | 'HTTP'> + displayMessageTemplate: string + displayName: string + displaySubjectTemplate: string + favorite: boolean + favorites: Array + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + messageTemplate: string + name: string + notificationRecipient: DataSetNotificationTemplate.notificationRecipient + notifyParentOrganisationUnitOnly: boolean + notifyUsersInHierarchyOnly: boolean + recipientUserGroup: UserGroup + relativeScheduledDays: number + sendStrategy: DataSetNotificationTemplate.sendStrategy + sharing: Sharing + subjectTemplate: string + translations: Array + user: User +} + +export namespace DataSetNotificationTemplate { + export enum dataSetNotificationTrigger { + DATA_SET_COMPLETION = 'DATA_SET_COMPLETION', + SCHEDULED_DAYS = 'SCHEDULED_DAYS', + } + + export enum notificationRecipient { + ORGANISATION_UNIT_CONTACT = 'ORGANISATION_UNIT_CONTACT', + USER_GROUP = 'USER_GROUP', + } + + export enum sendStrategy { + COLLECTIVE_SUMMARY = 'COLLECTIVE_SUMMARY', + SINGLE_NOTIFICATION = 'SINGLE_NOTIFICATION', + } +} + +export type DatastoreEntry = { + access: Access + attributeValues: Array + code: string + created: string + createdBy: User + displayName: string + favorite: boolean + favorites: Array + href: string + id: string + key: string + lastUpdated: string + lastUpdatedBy: User + name: string + namespace: string + sharing: Sharing + translations: Array + user: User + value: string +} + +export type DataSummary = { + /** + * keys are class java.lang.Integer + */ + activeUsers: Record + /** + * keys are class java.lang.Integer + */ + dataValueCount: Record + /** + * keys are class java.lang.Integer + */ + eventCount: Record + objectCounts: Record + system: Dhis2Info + userInvitations: Record +} + +export type DataSynchronizationJobParameters = { + pageSize: number +} + +export type DataValue = { + attributeOptionCombo: string + categoryOptionCombo: string + comment: string + created: string + dataElement: string + deleted: boolean + followup: boolean + lastUpdated: string + orgUnit: string + period: string + storedBy: string + value: string +} + +export type DataValueAuditDto = { + attributeOptionCombo: UID_CategoryOptionCombo + auditType: DataValueAuditDto.auditType + categoryOptionCombo: UID_CategoryOptionCombo + created: string + dataElement: UID_DataElement + modifiedBy: string + orgUnit: UID_OrganisationUnit + period: string + value: string +} + +export namespace DataValueAuditDto { + export enum auditType { + CREATE = 'CREATE', + UPDATE = 'UPDATE', + DELETE = 'DELETE', + READ = 'READ', + SEARCH = 'SEARCH', + } +} + +export type DataValueCategoryDto = { + combo: UID_CategoryCombo + options: Array> +} + +export type DataValueContextDto = { + audits: Array + history: Array +} + +export type DataValueDto = { + attribute: DataValueCategoryDto + categoryOptionCombo: UID_CategoryOptionCombo + comment: string + created: string + dataElement: UID_DataElement + dataSet: UID_DataSet + followUp: boolean + force: boolean + lastUpdated: string + orgUnit: UID_OrganisationUnit + period: string + storedBy: string + value: string +} + +export type DataValueFollowUpRequest = { + attribute: DataValueCategoryDto + attributeOptionCombo: UID_CategoryOptionCombo + categoryOptionCombo: UID_CategoryOptionCombo + dataElement: UID_DataSet + followup: boolean + orgUnit: UID_OrganisationUnit + period: string +} + +export type DataValuesDto = { + completeStatus: CompleteStatusDto + dataValues: Array + lockStatus: DataValuesDto.lockStatus + minMaxValues: Array +} + +export namespace DataValuesDto { + export enum lockStatus { + LOCKED = 'LOCKED', + APPROVED = 'APPROVED', + OPEN = 'OPEN', + } +} + +export type DataValueSet = { + attributeCategoryOptions: Array + attributeOptionCombo: string + categoryOptionComboIdScheme: string + completeDate: string + dataElementIdScheme: string + dataSet: string + dataSetIdScheme: string + dataValues: Array + dryRun: boolean + idScheme: string + orgUnit: string + orgUnitIdScheme: string + period: string + strategy: string +} + +export type DataValuesFollowUpRequest = { + values: Array +} + +export type DateFilterPeriod = { + endBuffer: number + endDate: string + period: DateFilterPeriod.period + startBuffer: number + startDate: string + type: DateFilterPeriod.type +} + +export namespace DateFilterPeriod { + export enum period { + TODAY = 'TODAY', + YESTERDAY = 'YESTERDAY', + LAST_3_DAYS = 'LAST_3_DAYS', + LAST_7_DAYS = 'LAST_7_DAYS', + LAST_14_DAYS = 'LAST_14_DAYS', + LAST_30_DAYS = 'LAST_30_DAYS', + LAST_60_DAYS = 'LAST_60_DAYS', + LAST_90_DAYS = 'LAST_90_DAYS', + LAST_180_DAYS = 'LAST_180_DAYS', + THIS_MONTH = 'THIS_MONTH', + LAST_MONTH = 'LAST_MONTH', + THIS_BIMONTH = 'THIS_BIMONTH', + LAST_BIMONTH = 'LAST_BIMONTH', + THIS_QUARTER = 'THIS_QUARTER', + LAST_QUARTER = 'LAST_QUARTER', + THIS_SIX_MONTH = 'THIS_SIX_MONTH', + LAST_SIX_MONTH = 'LAST_SIX_MONTH', + WEEKS_THIS_YEAR = 'WEEKS_THIS_YEAR', + MONTHS_THIS_YEAR = 'MONTHS_THIS_YEAR', + BIMONTHS_THIS_YEAR = 'BIMONTHS_THIS_YEAR', + QUARTERS_THIS_YEAR = 'QUARTERS_THIS_YEAR', + THIS_YEAR = 'THIS_YEAR', + MONTHS_LAST_YEAR = 'MONTHS_LAST_YEAR', + QUARTERS_LAST_YEAR = 'QUARTERS_LAST_YEAR', + LAST_YEAR = 'LAST_YEAR', + LAST_5_YEARS = 'LAST_5_YEARS', + LAST_10_YEARS = 'LAST_10_YEARS', + LAST_12_MONTHS = 'LAST_12_MONTHS', + LAST_6_MONTHS = 'LAST_6_MONTHS', + LAST_3_MONTHS = 'LAST_3_MONTHS', + LAST_6_BIMONTHS = 'LAST_6_BIMONTHS', + LAST_4_QUARTERS = 'LAST_4_QUARTERS', + LAST_2_SIXMONTHS = 'LAST_2_SIXMONTHS', + THIS_FINANCIAL_YEAR = 'THIS_FINANCIAL_YEAR', + LAST_FINANCIAL_YEAR = 'LAST_FINANCIAL_YEAR', + LAST_5_FINANCIAL_YEARS = 'LAST_5_FINANCIAL_YEARS', + LAST_10_FINANCIAL_YEARS = 'LAST_10_FINANCIAL_YEARS', + THIS_WEEK = 'THIS_WEEK', + LAST_WEEK = 'LAST_WEEK', + THIS_BIWEEK = 'THIS_BIWEEK', + LAST_BIWEEK = 'LAST_BIWEEK', + LAST_4_WEEKS = 'LAST_4_WEEKS', + LAST_4_BIWEEKS = 'LAST_4_BIWEEKS', + LAST_12_WEEKS = 'LAST_12_WEEKS', + LAST_52_WEEKS = 'LAST_52_WEEKS', + } + + export enum type { + RELATIVE = 'RELATIVE', + ABSOLUTE = 'ABSOLUTE', + } +} + +export type DeflatedDataValue = { + attributeOptionComboId: number + categoryOptionComboId: number + categoryOptionComboName: string + comment: string + dataElementId: number + dataElementName: string + deleted: boolean + followup: boolean + max: number + min: number + period: string + periodId: number + sourceId: number + sourceName: string + sourcePath: string + value: string +} + +export type DeletedObject = { + code: string + deletedAt: string + deletedBy: string + klass: string + uid: string +} + +export type Developer = { + address: string + email: string + name: string + organisation: string +} + +export type Dhis2Info = { + buildTime: string + revision: string + serverDate: string + systemId: string + version: string +} + +export type DimensionalItemObject = { + id: string +} + +export type DimensionalObject = { + id: string +} + +export type DimensionItemKeywords = { + empty: boolean + keywords: Array +} + +export type DisableInactiveUsersJobParameters = { + inactiveMonths: number + reminderDaysBefore: number +} + +export type Document = { + access: Access + attachment: boolean + attributeValues: Array + code: string + contentType: string + created: string + createdBy: User + displayName: string + external: boolean + favorite: boolean + favorites: Array + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + name: string + sharing: Sharing + translations: Array + url: string + user: User +} + +export type Dxf2DeprecatedTrackerEvent_DataValue = { + created: string + createdByUserInfo: UserInfoSnapshot + dataElement: string + lastUpdated: string + lastUpdatedByUserInfo: UserInfoSnapshot + providedElsewhere: boolean + storedBy: string + value: string +} + +export type Dxf2DeprecatedTrackerEvent_Event = { + assignedUser: string + assignedUserDisplayName: string + assignedUserFirstName: string + assignedUserSurname: string + assignedUserUsername: string + attributeCategoryOptions: string + attributeOptionCombo: string + completedBy: string + completedDate: string + created: string + createdAtClient: string + createdByUserInfo: UserInfoSnapshot + dataValues: Array + deleted: boolean + dueDate: string + enrollment: string + enrollmentStatus: Dxf2DeprecatedTrackerEvent_Event.enrollmentStatus + event: string + eventDate: string + followup: boolean + geometry: Record + href: string + lastUpdated: string + lastUpdatedAtClient: string + lastUpdatedByUserInfo: UserInfoSnapshot + notes: Array + orgUnit: string + orgUnitName: string + program: string + programStage: string + programType: Dxf2DeprecatedTrackerEvent_Event.programType + relationships: Array + status: Dxf2DeprecatedTrackerEvent_Event.status + storedBy: string + trackedEntityInstance: string +} + +export namespace Dxf2DeprecatedTrackerEvent_Event { + export enum enrollmentStatus { + ACTIVE = 'ACTIVE', + COMPLETED = 'COMPLETED', + CANCELLED = 'CANCELLED', + } + + export enum programType { + WITH_REGISTRATION = 'WITH_REGISTRATION', + WITHOUT_REGISTRATION = 'WITHOUT_REGISTRATION', + } + + export enum status { + ACTIVE = 'ACTIVE', + COMPLETED = 'COMPLETED', + VISITED = 'VISITED', + SCHEDULE = 'SCHEDULE', + OVERDUE = 'OVERDUE', + SKIPPED = 'SKIPPED', + } +} + +export type Dxf2DeprecatedTrackerTrackedentity_Attribute = { + attribute: string + code: string + created: string + displayName: string + lastUpdated: string + storedBy: string + value: string + valueType: Dxf2DeprecatedTrackerTrackedentity_Attribute.valueType +} + +export namespace Dxf2DeprecatedTrackerTrackedentity_Attribute { + export enum valueType { + TEXT = 'TEXT', + LONG_TEXT = 'LONG_TEXT', + MULTI_TEXT = 'MULTI_TEXT', + LETTER = 'LETTER', + PHONE_NUMBER = 'PHONE_NUMBER', + EMAIL = 'EMAIL', + BOOLEAN = 'BOOLEAN', + TRUE_ONLY = 'TRUE_ONLY', + DATE = 'DATE', + DATETIME = 'DATETIME', + TIME = 'TIME', + NUMBER = 'NUMBER', + UNIT_INTERVAL = 'UNIT_INTERVAL', + PERCENTAGE = 'PERCENTAGE', + INTEGER = 'INTEGER', + INTEGER_POSITIVE = 'INTEGER_POSITIVE', + INTEGER_NEGATIVE = 'INTEGER_NEGATIVE', + INTEGER_ZERO_OR_POSITIVE = 'INTEGER_ZERO_OR_POSITIVE', + TRACKER_ASSOCIATE = 'TRACKER_ASSOCIATE', + USERNAME = 'USERNAME', + COORDINATE = 'COORDINATE', + ORGANISATION_UNIT = 'ORGANISATION_UNIT', + REFERENCE = 'REFERENCE', + AGE = 'AGE', + URL = 'URL', + FILE_RESOURCE = 'FILE_RESOURCE', + IMAGE = 'IMAGE', + GEOJSON = 'GEOJSON', + } +} + +export type Email = { + recipients: Array + sender: User + subject: string + text: string +} + +export type Enrollment = { + attributes: Array + completedBy: string + completedDate: string + created: string + createdAtClient: string + createdByUserInfo: UserInfoSnapshot + deleted: boolean + enrollment: string + enrollmentDate: string + events: Array + followup: boolean + geometry: Record + incidentDate: string + lastUpdated: string + lastUpdatedAtClient: string + lastUpdatedByUserInfo: UserInfoSnapshot + notes: Array + orgUnit: string + orgUnitName: string + program: string + relationships: Array + status: Enrollment.status + storedBy: string + trackedEntityInstance: string + trackedEntityType: string +} + +export namespace Enrollment { + export enum status { + ACTIVE = 'ACTIVE', + COMPLETED = 'COMPLETED', + CANCELLED = 'CANCELLED', + } +} + +export type Entity = { + errorReports: Array + index: number + trackerType: Entity.trackerType + uid: string +} + +export namespace Entity { + export enum trackerType { + TRACKED_ENTITY = 'TRACKED_ENTITY', + ENROLLMENT = 'ENROLLMENT', + EVENT = 'EVENT', + RELATIONSHIP = 'RELATIONSHIP', + } +} + +export type EntityQueryCriteria = { + assignedUserMode: EntityQueryCriteria.assignedUserMode + assignedUsers: Array + attributeValueFilters: Array + displayColumnOrder: Array + enrollmentCreatedDate: DateFilterPeriod + enrollmentIncidentDate: DateFilterPeriod + enrollmentStatus: EntityQueryCriteria.enrollmentStatus + eventDate: DateFilterPeriod + eventStatus: EntityQueryCriteria.eventStatus + followUp: boolean + lastUpdatedDate: DateFilterPeriod + order: string + organisationUnit: string + ouMode: EntityQueryCriteria.ouMode + programStage: string + trackedEntityInstances: Array + trackedEntityType: string +} + +export namespace EntityQueryCriteria { + export enum assignedUserMode { + CURRENT = 'CURRENT', + PROVIDED = 'PROVIDED', + NONE = 'NONE', + ANY = 'ANY', + ALL = 'ALL', + } + + export enum enrollmentStatus { + ACTIVE = 'ACTIVE', + COMPLETED = 'COMPLETED', + CANCELLED = 'CANCELLED', + } + + export enum eventStatus { + ACTIVE = 'ACTIVE', + COMPLETED = 'COMPLETED', + VISITED = 'VISITED', + SCHEDULE = 'SCHEDULE', + OVERDUE = 'OVERDUE', + SKIPPED = 'SKIPPED', + } + + export enum ouMode { + SELECTED = 'SELECTED', + CHILDREN = 'CHILDREN', + DESCENDANTS = 'DESCENDANTS', + ACCESSIBLE = 'ACCESSIBLE', + CAPTURE = 'CAPTURE', + ALL = 'ALL', + } +} + +export type EntriesResponse = { + entries: Array>> + pager: WebapiControllerDatastoreController_Pager +} + +export type Error = { + errorCode: string + message: string + trackerType: string + uid: string +} + +export type ErrorReportLegacy = { + errorCode: ErrorReport.errorCode + errorKlass: string + errorProperties: Array> + errorProperty: string + mainId: string + mainKlass: string + message: string + /** + * The actual type is unknown. + * (Java type was: `class java.lang.Object`) + */ + value: Record +} + +export namespace ErrorReport { + export enum errorCode { + E1000 = 'E1000', + E1001 = 'E1001', + E1002 = 'E1002', + E1003 = 'E1003', + E1004 = 'E1004', + E1005 = 'E1005', + E1006 = 'E1006', + E1100 = 'E1100', + E1101 = 'E1101', + E1102 = 'E1102', + E1103 = 'E1103', + E1104 = 'E1104', + E1105 = 'E1105', + E1106 = 'E1106', + E1107 = 'E1107', + E1108 = 'E1108', + E1109 = 'E1109', + E1110 = 'E1110', + E1111 = 'E1111', + E1112 = 'E1112', + E1113 = 'E1113', + E1114 = 'E1114', + E1115 = 'E1115', + E1116 = 'E1116', + E1117 = 'E1117', + E1118 = 'E1118', + E1119 = 'E1119', + E1120 = 'E1120', + E1500 = 'E1500', + E1501 = 'E1501', + E1502 = 'E1502', + E1503 = 'E1503', + E1504 = 'E1504', + E1510 = 'E1510', + E1511 = 'E1511', + E1512 = 'E1512', + E1513 = 'E1513', + E1514 = 'E1514', + E1515 = 'E1515', + E1516 = 'E1516', + E1520 = 'E1520', + E1521 = 'E1521', + E1522 = 'E1522', + E1523 = 'E1523', + E2000 = 'E2000', + E2001 = 'E2001', + E2002 = 'E2002', + E2003 = 'E2003', + E2004 = 'E2004', + E2005 = 'E2005', + E2006 = 'E2006', + E2007 = 'E2007', + E2008 = 'E2008', + E2009 = 'E2009', + E2010 = 'E2010', + E2011 = 'E2011', + E2012 = 'E2012', + E2013 = 'E2013', + E2014 = 'E2014', + E2015 = 'E2015', + E2016 = 'E2016', + E2017 = 'E2017', + E2018 = 'E2018', + E2019 = 'E2019', + E2020 = 'E2020', + E2021 = 'E2021', + E2022 = 'E2022', + E2023 = 'E2023', + E2024 = 'E2024', + E2025 = 'E2025', + E2026 = 'E2026', + E2027 = 'E2027', + E2028 = 'E2028', + E2029 = 'E2029', + E2030 = 'E2030', + E2031 = 'E2031', + E2032 = 'E2032', + E2033 = 'E2033', + E2034 = 'E2034', + E2035 = 'E2035', + E2036 = 'E2036', + E2037 = 'E2037', + E2038 = 'E2038', + E2039 = 'E2039', + E2040 = 'E2040', + E2041 = 'E2041', + E2042 = 'E2042', + E2043 = 'E2043', + E2044 = 'E2044', + E2200 = 'E2200', + E2201 = 'E2201', + E2202 = 'E2202', + E2203 = 'E2203', + E2204 = 'E2204', + E2205 = 'E2205', + E2206 = 'E2206', + E2207 = 'E2207', + E2208 = 'E2208', + E2300 = 'E2300', + E2301 = 'E2301', + E3000 = 'E3000', + E3001 = 'E3001', + E3002 = 'E3002', + E3003 = 'E3003', + E3004 = 'E3004', + E3005 = 'E3005', + E3006 = 'E3006', + E3008 = 'E3008', + E3009 = 'E3009', + E3010 = 'E3010', + E3011 = 'E3011', + E3012 = 'E3012', + E3013 = 'E3013', + E3014 = 'E3014', + E3015 = 'E3015', + E3016 = 'E3016', + E3017 = 'E3017', + E3018 = 'E3018', + E3019 = 'E3019', + E3020 = 'E3020', + E3021 = 'E3021', + E3022 = 'E3022', + E3023 = 'E3023', + E3024 = 'E3024', + E3025 = 'E3025', + E3026 = 'E3026', + E3027 = 'E3027', + E3028 = 'E3028', + E3029 = 'E3029', + E3030 = 'E3030', + E3031 = 'E3031', + E3032 = 'E3032', + E3040 = 'E3040', + E4000 = 'E4000', + E4001 = 'E4001', + E4002 = 'E4002', + E4003 = 'E4003', + E4004 = 'E4004', + E4005 = 'E4005', + E4006 = 'E4006', + E4007 = 'E4007', + E4008 = 'E4008', + E4009 = 'E4009', + E4010 = 'E4010', + E4011 = 'E4011', + E4012 = 'E4012', + E4013 = 'E4013', + E4014 = 'E4014', + E4015 = 'E4015', + E4016 = 'E4016', + E4017 = 'E4017', + E4018 = 'E4018', + E4019 = 'E4019', + E4020 = 'E4020', + E4021 = 'E4021', + E4022 = 'E4022', + E4023 = 'E4023', + E4024 = 'E4024', + E4025 = 'E4025', + E4026 = 'E4026', + E4027 = 'E4027', + E4028 = 'E4028', + E4029 = 'E4029', + E4030 = 'E4030', + E4031 = 'E4031', + E4032 = 'E4032', + E4033 = 'E4033', + E4034 = 'E4034', + E4035 = 'E4035', + E4036 = 'E4036', + E4037 = 'E4037', + E4038 = 'E4038', + E4039 = 'E4039', + E4040 = 'E4040', + E4041 = 'E4041', + E4042 = 'E4042', + E4043 = 'E4043', + E4044 = 'E4044', + E4045 = 'E4045', + E4046 = 'E4046', + E4047 = 'E4047', + E4048 = 'E4048', + E4049 = 'E4049', + E4054 = 'E4054', + E4056 = 'E4056', + E4055 = 'E4055', + E4050 = 'E4050', + E4051 = 'E4051', + E4052 = 'E4052', + E4053 = 'E4053', + E4057 = 'E4057', + E4058 = 'E4058', + E4060 = 'E4060', + E4061 = 'E4061', + E4062 = 'E4062', + E4063 = 'E4063', + E4064 = 'E4064', + E4065 = 'E4065', + E4066 = 'E4066', + E4067 = 'E4067', + E4068 = 'E4068', + E4300 = 'E4300', + E4301 = 'E4301', + E4302 = 'E4302', + E4303 = 'E4303', + E4304 = 'E4304', + E4305 = 'E4305', + E4306 = 'E4306', + E4307 = 'E4307', + E4308 = 'E4308', + E4309 = 'E4309', + E4310 = 'E4310', + E4311 = 'E4311', + E4312 = 'E4312', + E4313 = 'E4313', + E4314 = 'E4314', + E4315 = 'E4315', + E5000 = 'E5000', + E5001 = 'E5001', + E5002 = 'E5002', + E5003 = 'E5003', + E5004 = 'E5004', + E5005 = 'E5005', + E5006 = 'E5006', + E5007 = 'E5007', + E6000 = 'E6000', + E6001 = 'E6001', + E6002 = 'E6002', + E6003 = 'E6003', + E6004 = 'E6004', + E6005 = 'E6005', + E6006 = 'E6006', + E6007 = 'E6007', + E6008 = 'E6008', + E6009 = 'E6009', + E6010 = 'E6010', + E6011 = 'E6011', + E6012 = 'E6012', + E6013 = 'E6013', + E6014 = 'E6014', + E6015 = 'E6015', + E6016 = 'E6016', + E6017 = 'E6017', + E6018 = 'E6018', + E6019 = 'E6019', + E6020 = 'E6020', + E6021 = 'E6021', + E6100 = 'E6100', + E6101 = 'E6101', + E6200 = 'E6200', + E6201 = 'E6201', + E6202 = 'E6202', + E6203 = 'E6203', + E6204 = 'E6204', + E6205 = 'E6205', + E6206 = 'E6206', + E6207 = 'E6207', + E6208 = 'E6208', + E6209 = 'E6209', + E6210 = 'E6210', + E6211 = 'E6211', + E6300 = 'E6300', + E6301 = 'E6301', + E6302 = 'E6302', + E6303 = 'E6303', + E6304 = 'E6304', + E6305 = 'E6305', + E7000 = 'E7000', + E7003 = 'E7003', + E7004 = 'E7004', + E7005 = 'E7005', + E7006 = 'E7006', + E7007 = 'E7007', + E7010 = 'E7010', + E7020 = 'E7020', + E7021 = 'E7021', + E7022 = 'E7022', + E7023 = 'E7023', + E7024 = 'E7024', + E7100 = 'E7100', + E7101 = 'E7101', + E7102 = 'E7102', + E7103 = 'E7103', + E7104 = 'E7104', + E7105 = 'E7105', + E7106 = 'E7106', + E7107 = 'E7107', + E7108 = 'E7108', + E7109 = 'E7109', + E7110 = 'E7110', + E7111 = 'E7111', + E7112 = 'E7112', + E7113 = 'E7113', + E7114 = 'E7114', + E7115 = 'E7115', + E7116 = 'E7116', + E7117 = 'E7117', + E7118 = 'E7118', + E7119 = 'E7119', + E7120 = 'E7120', + E7121 = 'E7121', + E7122 = 'E7122', + E7123 = 'E7123', + E7124 = 'E7124', + E7125 = 'E7125', + E7126 = 'E7126', + E7127 = 'E7127', + E7128 = 'E7128', + E7129 = 'E7129', + E7130 = 'E7130', + E7131 = 'E7131', + E7132 = 'E7132', + E7133 = 'E7133', + E7134 = 'E7134', + E7135 = 'E7135', + E7136 = 'E7136', + E7137 = 'E7137', + E7138 = 'E7138', + E7139 = 'E7139', + E7140 = 'E7140', + E7141 = 'E7141', + E7142 = 'E7142', + E7200 = 'E7200', + E7201 = 'E7201', + E7202 = 'E7202', + E7203 = 'E7203', + E7204 = 'E7204', + E7205 = 'E7205', + E7206 = 'E7206', + E7207 = 'E7207', + E7208 = 'E7208', + E7209 = 'E7209', + E7210 = 'E7210', + E7211 = 'E7211', + E7212 = 'E7212', + E7213 = 'E7213', + E7214 = 'E7214', + E7215 = 'E7215', + E7216 = 'E7216', + E7217 = 'E7217', + E7218 = 'E7218', + E7219 = 'E7219', + E7220 = 'E7220', + E7221 = 'E7221', + E7222 = 'E7222', + E7223 = 'E7223', + E7224 = 'E7224', + E7225 = 'E7225', + E7226 = 'E7226', + E7227 = 'E7227', + E7228 = 'E7228', + E7229 = 'E7229', + E7230 = 'E7230', + E7231 = 'E7231', + E7232 = 'E7232', + E7234 = 'E7234', + E7250 = 'E7250', + E7300 = 'E7300', + E7301 = 'E7301', + E7400 = 'E7400', + E7500 = 'E7500', + E7501 = 'E7501', + E7502 = 'E7502', + E7503 = 'E7503', + E7600 = 'E7600', + E7601 = 'E7601', + E7602 = 'E7602', + E7603 = 'E7603', + E7604 = 'E7604', + E7610 = 'E7610', + E7611 = 'E7611', + E7612 = 'E7612', + E7613 = 'E7613', + E7614 = 'E7614', + E7615 = 'E7615', + E7616 = 'E7616', + E7617 = 'E7617', + E7618 = 'E7618', + E7619 = 'E7619', + E7620 = 'E7620', + E7621 = 'E7621', + E7630 = 'E7630', + E7631 = 'E7631', + E7632 = 'E7632', + E7633 = 'E7633', + E7634 = 'E7634', + E7635 = 'E7635', + E7636 = 'E7636', + E7637 = 'E7637', + E7638 = 'E7638', + E7639 = 'E7639', + E7640 = 'E7640', + E7641 = 'E7641', + E7642 = 'E7642', + E7643 = 'E7643', + E7644 = 'E7644', + E7645 = 'E7645', + E7650 = 'E7650', + E7651 = 'E7651', + E7652 = 'E7652', + E7653 = 'E7653', + E7700 = 'E7700', + E7701 = 'E7701', + E7702 = 'E7702', + E7703 = 'E7703', + E7704 = 'E7704', + E7705 = 'E7705', + E7706 = 'E7706', + E7707 = 'E7707', + E7708 = 'E7708', + E7709 = 'E7709', + E7710 = 'E7710', + E7711 = 'E7711', + E7712 = 'E7712', + } +} + +export type Event = { + access: Access + assignedUser: User + attributeOptionCombo: CategoryOptionCombo + attributeValues: Array + code: string + comments: Array + completed: boolean + completedBy: string + completedDate: string + creatableInSearchScope: boolean + created: string + createdAtClient: string + createdBy: User + createdByUserInfo: UserInfoSnapshot + deleted: boolean + displayName: string + dueDate: string + enrollment: Ref_Program_Enrollment + eventDataValues: Array + eventDate: string + favorite: boolean + favorites: Array + geometry: Record + href: string + id: string + lastUpdated: string + lastUpdatedAtClient: string + lastUpdatedBy: User + lastUpdatedByUserInfo: UserInfoSnapshot + messageConversations: Array + name: string + organisationUnit: OrganisationUnit + programStage: ProgramStage + relationshipItems: Array + sharing: Sharing + status: Event.status + storedBy: string + translations: Array + user: User +} + +export namespace Event { + export enum status { + ACTIVE = 'ACTIVE', + COMPLETED = 'COMPLETED', + VISITED = 'VISITED', + SCHEDULE = 'SCHEDULE', + OVERDUE = 'OVERDUE', + SKIPPED = 'SKIPPED', + } +} + +export type EventDataFilter = { + dataItem: string + dateFilter: DateFilterPeriod + eq: string + ge: string + gt: string + in: Array + le: string + like: string + lt: string +} + +export type EventDataValue = { + created: string + createdByUserInfo: UserInfoSnapshot + lastUpdated: string + lastUpdatedByUserInfo: UserInfoSnapshot + providedElsewhere: boolean + storedBy: string + value: string +} + +export type EventFilter = { + access: Access + attributeValues: Array + code: string + created: string + createdBy: User + description: string + displayDescription: string + displayName: string + eventQueryCriteria: EventQueryCriteria + favorite: boolean + favorites: Array + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + name: string + program: string + programStage: string + sharing: Sharing + translations: Array + user: User +} + +export type Eventhook_Source = { + fields: string + path: string +} + +export type EventHook = { + access: Access + attributeValues: Array + code: string + created: string + createdBy: User + description: string + disabled: boolean + displayName: string + favorite: boolean + favorites: Array + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + name: string + sharing: Sharing + source: Eventhook_Source + targets: Array + translations: Array + user: User +} + +export type EventProgramsDataSynchronizationJobParameters = { + pageSize: number +} + +export type EventQueryCriteria = { + assignedUserMode: EventQueryCriteria.assignedUserMode + assignedUsers: Array + completedDate: DateFilterPeriod + dataFilters: Array + displayColumnOrder: Array + dueDate: DateFilterPeriod + eventDate: DateFilterPeriod + events: Array + followUp: boolean + lastUpdatedDate: DateFilterPeriod + order: string + organisationUnit: string + ouMode: EventQueryCriteria.ouMode + status: EventQueryCriteria.status +} + +export namespace EventQueryCriteria { + export enum assignedUserMode { + CURRENT = 'CURRENT', + PROVIDED = 'PROVIDED', + NONE = 'NONE', + ANY = 'ANY', + ALL = 'ALL', + } + + export enum ouMode { + SELECTED = 'SELECTED', + CHILDREN = 'CHILDREN', + DESCENDANTS = 'DESCENDANTS', + ACCESSIBLE = 'ACCESSIBLE', + CAPTURE = 'CAPTURE', + ALL = 'ALL', + } + + export enum status { + ACTIVE = 'ACTIVE', + COMPLETED = 'COMPLETED', + VISITED = 'VISITED', + SCHEDULE = 'SCHEDULE', + OVERDUE = 'OVERDUE', + SKIPPED = 'SKIPPED', + } +} + +export type EventRepetition = { + dimension: string + indexes: Array + parent: EventRepetition.parent +} + +export namespace EventRepetition { + export enum parent { + COLUMN = 'COLUMN', + ROW = 'ROW', + FILTER = 'FILTER', + } +} + +export type EventRow = { + attributeCategoryOptions: string + attributes: Array + dataValues: Array + deleted: boolean + dueDate: string + enrollment: string + event: string + eventDate: string + followup: boolean + href: string + notes: Array + orgUnit: string + orgUnitName: string + program: string + programStage: string + trackedEntityInstance: string + trackedEntityInstanceCreated: string + trackedEntityInstanceInactive: boolean + trackedEntityInstanceOrgUnit: string + trackedEntityInstanceOrgUnitName: string +} + +export type EventRows = { + eventRows: Array + pager: Pager +} + +export type EventVisualization = { + access: Access + aggregationType: EventVisualization.aggregationType + attributeDimensions: Array + attributeValueDimension: TrackedEntityAttribute + attributeValues: Array + baseLineLabel: string + baseLineValue: number + categoryDimensions: Array + categoryOptionGroupSetDimensions: Array + code: string + colSubTotals: boolean + colTotals: boolean + collapseDataDimensions: boolean + columnDimensions: Array + columns: Array + completedOnly: boolean + created: string + createdBy: User + cumulativeValues: boolean + dataDimensionItems: Array + dataElementDimensions: Array + dataElementGroupSetDimensions: Array + dataElementValueDimension: DataElement + dataType: EventVisualization.dataType + description: string + digitGroupSeparator: EventVisualization.digitGroupSeparator + displayBaseLineLabel: string + displayDensity: EventVisualization.displayDensity + displayDescription: string + displayDomainAxisLabel: string + displayFormName: string + displayName: string + displayRangeAxisLabel: string + displayShortName: string + displaySubtitle: string + displayTargetLineLabel: string + displayTitle: string + domainAxisLabel: string + endDate: string + eventStatus: EventVisualization.eventStatus + favorite: boolean + favorites: Array + filterDimensions: Array + filters: Array + fontSize: EventVisualization.fontSize + formName: string + hideEmptyRowItems: EventVisualization.hideEmptyRowItems + hideEmptyRows: boolean + hideLegend: boolean + hideNaData: boolean + hideSubtitle: boolean + hideTitle: boolean + href: string + id: string + interpretations: Array + itemOrganisationUnitGroups: Array + lastUpdated: string + lastUpdatedBy: User + legacy: boolean + legend: LegendDefinitions + name: string + noSpaceBetweenColumns: boolean + orgUnitField: string + organisationUnitGroupSetDimensions: Array + organisationUnitLevels: Array + organisationUnits: Array + outputType: EventVisualization.outputType + parentGraphMap: Record + percentStackedValues: boolean + periods: Array + program: Program + programIndicatorDimensions: Array + programStage: ProgramStage + programStatus: EventVisualization.programStatus + rangeAxisDecimals: number + rangeAxisLabel: string + rangeAxisMaxValue: number + rangeAxisMinValue: number + rangeAxisSteps: number + regressionType: EventVisualization.regressionType + relativePeriods: RelativePeriods + repetitions: Array + rowDimensions: Array + rowSubTotals: boolean + rowTotals: boolean + rows: Array + sharing: Sharing + shortName: string + showData: boolean + showDimensionLabels: boolean + showHierarchy: boolean + simpleDimensions: Array + sortOrder: number + startDate: string + subscribed: boolean + subscribers: Array + subtitle: string + targetLineLabel: string + targetLineValue: number + timeField: string + title: string + topLimit: number + translations: Array + type: EventVisualization.type + user: User + userOrgUnitType: EventVisualization.userOrgUnitType + userOrganisationUnit: boolean + userOrganisationUnitChildren: boolean + userOrganisationUnitGrandChildren: boolean + value: DimensionalItemObject +} + +export namespace EventVisualization { + export enum aggregationType { + SUM = 'SUM', + AVERAGE = 'AVERAGE', + AVERAGE_SUM_ORG_UNIT = 'AVERAGE_SUM_ORG_UNIT', + LAST = 'LAST', + LAST_AVERAGE_ORG_UNIT = 'LAST_AVERAGE_ORG_UNIT', + LAST_LAST_ORG_UNIT = 'LAST_LAST_ORG_UNIT', + LAST_IN_PERIOD = 'LAST_IN_PERIOD', + LAST_IN_PERIOD_AVERAGE_ORG_UNIT = 'LAST_IN_PERIOD_AVERAGE_ORG_UNIT', + FIRST = 'FIRST', + FIRST_AVERAGE_ORG_UNIT = 'FIRST_AVERAGE_ORG_UNIT', + FIRST_FIRST_ORG_UNIT = 'FIRST_FIRST_ORG_UNIT', + COUNT = 'COUNT', + STDDEV = 'STDDEV', + VARIANCE = 'VARIANCE', + MIN = 'MIN', + MAX = 'MAX', + MIN_SUM_ORG_UNIT = 'MIN_SUM_ORG_UNIT', + MAX_SUM_ORG_UNIT = 'MAX_SUM_ORG_UNIT', + NONE = 'NONE', + CUSTOM = 'CUSTOM', + DEFAULT = 'DEFAULT', + } + + export enum dataType { + AGGREGATED_VALUES = 'AGGREGATED_VALUES', + EVENTS = 'EVENTS', + } + + export enum digitGroupSeparator { + COMMA = 'COMMA', + SPACE = 'SPACE', + NONE = 'NONE', + } + + export enum displayDensity { + COMFORTABLE = 'COMFORTABLE', + NORMAL = 'NORMAL', + COMPACT = 'COMPACT', + NONE = 'NONE', + } + + export enum eventStatus { + ACTIVE = 'ACTIVE', + COMPLETED = 'COMPLETED', + VISITED = 'VISITED', + SCHEDULE = 'SCHEDULE', + OVERDUE = 'OVERDUE', + SKIPPED = 'SKIPPED', + } + + export enum fontSize { + LARGE = 'LARGE', + NORMAL = 'NORMAL', + SMALL = 'SMALL', + } + + export enum hideEmptyRowItems { + NONE = 'NONE', + BEFORE_FIRST = 'BEFORE_FIRST', + AFTER_LAST = 'AFTER_LAST', + BEFORE_FIRST_AFTER_LAST = 'BEFORE_FIRST_AFTER_LAST', + ALL = 'ALL', + } + + export enum outputType { + EVENT = 'EVENT', + ENROLLMENT = 'ENROLLMENT', + TRACKED_ENTITY_INSTANCE = 'TRACKED_ENTITY_INSTANCE', + } + + export enum programStatus { + ACTIVE = 'ACTIVE', + COMPLETED = 'COMPLETED', + CANCELLED = 'CANCELLED', + } + + export enum regressionType { + NONE = 'NONE', + LINEAR = 'LINEAR', + POLYNOMIAL = 'POLYNOMIAL', + LOESS = 'LOESS', + } + + export enum type { + COLUMN = 'COLUMN', + STACKED_COLUMN = 'STACKED_COLUMN', + BAR = 'BAR', + STACKED_BAR = 'STACKED_BAR', + LINE = 'LINE', + LINE_LIST = 'LINE_LIST', + AREA = 'AREA', + STACKED_AREA = 'STACKED_AREA', + PIE = 'PIE', + RADAR = 'RADAR', + GAUGE = 'GAUGE', + YEAR_OVER_YEAR_LINE = 'YEAR_OVER_YEAR_LINE', + YEAR_OVER_YEAR_COLUMN = 'YEAR_OVER_YEAR_COLUMN', + SINGLE_VALUE = 'SINGLE_VALUE', + PIVOT_TABLE = 'PIVOT_TABLE', + SCATTER = 'SCATTER', + BUBBLE = 'BUBBLE', + } + + export enum userOrgUnitType { + DATA_CAPTURE = 'DATA_CAPTURE', + DATA_OUTPUT = 'DATA_OUTPUT', + TEI_SEARCH = 'TEI_SEARCH', + } +} + +export type ExecutionPlan = { + executionTime: number + plan: Record + planningTime: number + query: string + timeInMillis: number +} + +export type Expression = { + description: string + displayDescription: string + expression: string + missingValueStrategy: Expression.missingValueStrategy + slidingWindow: boolean + translations: Array +} + +export namespace Expression { + export enum missingValueStrategy { + SKIP_IF_ANY_VALUE_MISSING = 'SKIP_IF_ANY_VALUE_MISSING', + SKIP_IF_ALL_VALUES_MISSING = 'SKIP_IF_ALL_VALUES_MISSING', + NEVER_SKIP = 'NEVER_SKIP', + } +} + +export type ExpressionDimensionItem = { + access: Access + aggregateExportAttributeOptionCombo: string + aggregateExportCategoryOptionCombo: string + aggregationType: ExpressionDimensionItem.aggregationType + attributeValues: Array + code: string + created: string + createdBy: User + description: string + dimensionItem: string + displayDescription: string + displayFormName: string + displayName: string + displayShortName: string + expression: string + favorite: boolean + favorites: Array + formName: string + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + legendSet: LegendSet + legendSets: Array + missingValueStrategy: ExpressionDimensionItem.missingValueStrategy + name: string + queryMods: QueryModifiers + sharing: Sharing + shortName: string + slidingWindow: boolean + translations: Array + user: User +} + +export namespace ExpressionDimensionItem { + export enum aggregationType { + SUM = 'SUM', + AVERAGE = 'AVERAGE', + AVERAGE_SUM_ORG_UNIT = 'AVERAGE_SUM_ORG_UNIT', + LAST = 'LAST', + LAST_AVERAGE_ORG_UNIT = 'LAST_AVERAGE_ORG_UNIT', + LAST_LAST_ORG_UNIT = 'LAST_LAST_ORG_UNIT', + LAST_IN_PERIOD = 'LAST_IN_PERIOD', + LAST_IN_PERIOD_AVERAGE_ORG_UNIT = 'LAST_IN_PERIOD_AVERAGE_ORG_UNIT', + FIRST = 'FIRST', + FIRST_AVERAGE_ORG_UNIT = 'FIRST_AVERAGE_ORG_UNIT', + FIRST_FIRST_ORG_UNIT = 'FIRST_FIRST_ORG_UNIT', + COUNT = 'COUNT', + STDDEV = 'STDDEV', + VARIANCE = 'VARIANCE', + MIN = 'MIN', + MAX = 'MAX', + MIN_SUM_ORG_UNIT = 'MIN_SUM_ORG_UNIT', + MAX_SUM_ORG_UNIT = 'MAX_SUM_ORG_UNIT', + NONE = 'NONE', + CUSTOM = 'CUSTOM', + DEFAULT = 'DEFAULT', + } + + export enum missingValueStrategy { + SKIP_IF_ANY_VALUE_MISSING = 'SKIP_IF_ANY_VALUE_MISSING', + SKIP_IF_ALL_VALUES_MISSING = 'SKIP_IF_ALL_VALUES_MISSING', + NEVER_SKIP = 'NEVER_SKIP', + } +} + +export type ExternalMapLayer = { + access: Access + attributeValues: Array + attribution: string + code: string + created: string + createdBy: User + displayName: string + favorite: boolean + favorites: Array + href: string + id: string + imageFormat: ExternalMapLayer.imageFormat + lastUpdated: string + lastUpdatedBy: User + layers: string + legendSet: LegendSet + legendSetUrl: string + mapLayerPosition: ExternalMapLayer.mapLayerPosition + mapService: ExternalMapLayer.mapService + name: string + sharing: Sharing + translations: Array + url: string + user: User +} + +export namespace ExternalMapLayer { + export enum imageFormat { + PNG = 'PNG', + JPG = 'JPG', + } + + export enum mapLayerPosition { + BASEMAP = 'BASEMAP', + OVERLAY = 'OVERLAY', + } + + export enum mapService { + WMS = 'WMS', + TMS = 'TMS', + XYZ = 'XYZ', + VECTOR_STYLE = 'VECTOR_STYLE', + } +} + +export type FavoriteStatistics = { + created: string + id: string + name: string + position: number + views: number +} + +export type Field = { + categoryOptionCombo: string + comment: string + dataElement: string + label: string + optionSet: string + type: Field.type + value: string +} + +export namespace Field { + export enum type { + TEXT = 'TEXT', + LONG_TEXT = 'LONG_TEXT', + MULTI_TEXT = 'MULTI_TEXT', + LETTER = 'LETTER', + PHONE_NUMBER = 'PHONE_NUMBER', + EMAIL = 'EMAIL', + BOOLEAN = 'BOOLEAN', + TRUE_ONLY = 'TRUE_ONLY', + DATE = 'DATE', + DATETIME = 'DATETIME', + TIME = 'TIME', + NUMBER = 'NUMBER', + UNIT_INTERVAL = 'UNIT_INTERVAL', + PERCENTAGE = 'PERCENTAGE', + INTEGER = 'INTEGER', + INTEGER_POSITIVE = 'INTEGER_POSITIVE', + INTEGER_NEGATIVE = 'INTEGER_NEGATIVE', + INTEGER_ZERO_OR_POSITIVE = 'INTEGER_ZERO_OR_POSITIVE', + TRACKER_ASSOCIATE = 'TRACKER_ASSOCIATE', + USERNAME = 'USERNAME', + COORDINATE = 'COORDINATE', + ORGANISATION_UNIT = 'ORGANISATION_UNIT', + REFERENCE = 'REFERENCE', + AGE = 'AGE', + URL = 'URL', + FILE_RESOURCE = 'FILE_RESOURCE', + IMAGE = 'IMAGE', + GEOJSON = 'GEOJSON', + } +} + +export type FieldPath = { + exclude: boolean + fullPath: string + name: string + path: Array + preset: boolean + property: Property + root: boolean + transformer: boolean + transformers: Array +} + +export type FieldPathTransformer = { + name: string + parameters: Array +} + +export type FileResource = { + access: Access + attributeValues: Array + code: string + contentLength: number + contentMd5: string + contentType: string + created: string + createdBy: User + displayName: string + domain: FileResource.domain + favorite: boolean + favorites: Array + hasMultipleStorageFiles: boolean + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + name: string + sharing: Sharing + storageStatus: FileResource.storageStatus + translations: Array + user: User +} + +export namespace FileResource { + export enum domain { + DATA_VALUE = 'DATA_VALUE', + PUSH_ANALYSIS = 'PUSH_ANALYSIS', + DOCUMENT = 'DOCUMENT', + MESSAGE_ATTACHMENT = 'MESSAGE_ATTACHMENT', + USER_AVATAR = 'USER_AVATAR', + ORG_UNIT = 'ORG_UNIT', + CUSTOM_ICON = 'CUSTOM_ICON', + } + + export enum storageStatus { + NONE = 'NONE', + PENDING = 'PENDING', + FAILED = 'FAILED', + STORED = 'STORED', + } +} + +export type FileResourceOwner = { + co: string + de: string + domain: FileResourceOwner.domain + id: string + ou: string + pe: string +} + +export namespace FileResourceOwner { + export enum domain { + DATA_VALUE = 'DATA_VALUE', + PUSH_ANALYSIS = 'PUSH_ANALYSIS', + DOCUMENT = 'DOCUMENT', + MESSAGE_ATTACHMENT = 'MESSAGE_ATTACHMENT', + USER_AVATAR = 'USER_AVATAR', + ORG_UNIT = 'ORG_UNIT', + CUSTOM_ICON = 'CUSTOM_ICON', + } +} + +export type FileTypeValueOptions = { + allowedContentTypes: Array + maxFileSize: number + version: number +} + +export type Filter = { + dimension: string + items: Array +} + +export type FilterPeriod = { + periodFrom: number + periodTo: number +} + +export type FollowupAnalysisMetadata = { + coc: Array + de: Array + endDate: string + maxResults: number + ou: Array + startDate: string +} + +export type FollowupAnalysisResponse = { + followupValues: Array + metadata: FollowupAnalysisMetadata +} + +export type FollowupParams = { + attributeOptionComboId: number + categoryOptionComboId: number + dataElementId: number + followup: boolean + organisationUnitId: number + periodId: number +} + +export type FollowupValue = { + aoc: string + aocName: string + coc: string + cocName: string + comment: string + created: string + de: string + deName: string + lastUpdated: string + max: number + min: number + ou: string + ouName: string + ouPath: string + pe: string + peEndDate: string + peName: string + peStartDate: string + peType: string + storedBy: string + value: string +} + +export type FontStyle = { + bold: boolean + font: FontStyle.font + fontSize: number + italic: boolean + textAlign: FontStyle.textAlign + textColor: string + underline: boolean +} + +export namespace FontStyle { + export enum font { + ARIAL = 'ARIAL', + SANS_SERIF = 'SANS_SERIF', + VERDANA = 'VERDANA', + ROBOTO = 'ROBOTO', + } + + export enum textAlign { + LEFT = 'LEFT', + CENTER = 'CENTER', + RIGHT = 'RIGHT', + } +} + +export type Form = { + categoryCombo: WebapiWebdomainForm_CategoryCombo + groups: Array + label: string + options: Record> + subtitle: string +} + +export type GenericGatewayParameter = { + confidential: boolean + encode: boolean + header: boolean + key: string + value: string +} + +export type GenericHttpGatewayConfig = { + configurationTemplate: string + contentType: GenericHttpGatewayConfig.contentType + id: string + isDefault: boolean + maxSmsLength: string + name: string + parameters: Array + password: string + sendUrlParameters: boolean + uid: string + urlTemplate: string + useGet: boolean + username: string +} + +export namespace GenericHttpGatewayConfig { + export enum contentType { + APPLICATION_JSON = 'APPLICATION_JSON', + APPLICATION_XML = 'APPLICATION_XML', + TEXT_PLAIN = 'TEXT_PLAIN', + FORM_URL_ENCODED = 'FORM_URL_ENCODED', + } +} + +export type GeoFeature = { + co: string + code: string + dimensions: Record + hcd: boolean + hcu: boolean + id: string + le: number + na: string + pg: string + pi: string + pn: string + ty: number +} + +export type GistPager = { + nextPage?: string + page: number + pageCount?: number + pageSize: number + prevPage?: string + total?: number +} + +export type GistPreferences = { + included: GistPreferences.included + transformation: GistPreferences.transformation +} + +export namespace GistPreferences { + export enum included { + FALSE = 'FALSE', + TRUE = 'TRUE', + AUTO = 'AUTO', + } + + export enum transformation { + AUTO = 'AUTO', + NONE = 'NONE', + IS_EMPTY = 'IS_EMPTY', + IS_NOT_EMPTY = 'IS_NOT_EMPTY', + SIZE = 'SIZE', + MEMBER = 'MEMBER', + NOT_MEMBER = 'NOT_MEMBER', + IDS = 'IDS', + ID_OBJECTS = 'ID_OBJECTS', + PLUCK = 'PLUCK', + FROM = 'FROM', + } +} + +export type GoogleAccessToken = { + access_token: string + client_id: string + expires_in: number +} + +export type Grid = { + headerWidth: number + headers: Array + height: number + internalMetaData: Record> + lastDataRow: boolean + metaColumnIndexes: Array + metaData: Record> + metadataHeaders: Array + performanceMetrics: PerformanceMetrics + refs: Array + /** + * keys are class java.lang.Integer + */ + rowContext: Record>> + rows: Array>> + subtitle: string + table: string + title: string + visibleHeaders: Array + visibleRows: Array>> + visibleWidth: number + width: number +} + +export type GridHeader = { + column: string + hidden: boolean + legendSet: string + meta: boolean + name: string + optionSet: string + programStage: string + repeatableStageParams: string + stageOffset: number + type: string + valueType: GridHeader.valueType +} + +export namespace GridHeader { + export enum valueType { + TEXT = 'TEXT', + LONG_TEXT = 'LONG_TEXT', + MULTI_TEXT = 'MULTI_TEXT', + LETTER = 'LETTER', + PHONE_NUMBER = 'PHONE_NUMBER', + EMAIL = 'EMAIL', + BOOLEAN = 'BOOLEAN', + TRUE_ONLY = 'TRUE_ONLY', + DATE = 'DATE', + DATETIME = 'DATETIME', + TIME = 'TIME', + NUMBER = 'NUMBER', + UNIT_INTERVAL = 'UNIT_INTERVAL', + PERCENTAGE = 'PERCENTAGE', + INTEGER = 'INTEGER', + INTEGER_POSITIVE = 'INTEGER_POSITIVE', + INTEGER_NEGATIVE = 'INTEGER_NEGATIVE', + INTEGER_ZERO_OR_POSITIVE = 'INTEGER_ZERO_OR_POSITIVE', + TRACKER_ASSOCIATE = 'TRACKER_ASSOCIATE', + USERNAME = 'USERNAME', + COORDINATE = 'COORDINATE', + ORGANISATION_UNIT = 'ORGANISATION_UNIT', + REFERENCE = 'REFERENCE', + AGE = 'AGE', + URL = 'URL', + FILE_RESOURCE = 'FILE_RESOURCE', + IMAGE = 'IMAGE', + GEOJSON = 'GEOJSON', + } +} + +export type GridResponse = { + listGrid: Grid + pager: Pager +} + +export type Group = { + dataElementCount: number + description: string + fields: Array + label: string + /** + * keys are class java.lang.Object + */ + metaData: Record> +} + +export type HttpBasicAuth = { + password: string + type: string + username: string +} + +export type I18nLocale = { + access: Access + attributeValues: Array + code: string + created: string + createdBy: User + displayName: string + favorite: boolean + favorites: Array + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + locale: string + name: string + sharing: Sharing + translations: Array + user: User +} + +export type I18nOutput = { + translations: Record +} + +export type Icon = { + type: Icon.type +} + +export namespace Icon { + export enum type { + DATA_ITEM = 'DATA_ITEM', + } +} + +export type IconDto = { + description: string + fileResourceUid: string + key: string + keywords: Array +} + +export type IconResponse = { + description: string + fileResourceUid: string + href: string + key: string + keywords: Array + userUid: string +} + +export type IdentifiableObject = { + id: string +} + +export type IdentifiableObjects = { + additions: Array + deletions: Array + identifiableObjects: Array +} + +export type IdObject = { + id: string + name: string +} + +export type IdScheme = { + attribute: string + identifiableProperty: IdScheme.identifiableProperty + identifiableString: string + notNull: boolean + null: boolean +} + +export namespace IdScheme { + export enum identifiableProperty { + ID = 'ID', + UID = 'UID', + UUID = 'UUID', + NAME = 'NAME', + CODE = 'CODE', + ATTRIBUTE = 'ATTRIBUTE', + } +} + +export type IdSchemes = { + attributeOptionComboIdScheme: IdScheme + categoryIdScheme: IdScheme + categoryOptionComboIdScheme: IdScheme + categoryOptionIdScheme: IdScheme + dataElementGroupIdScheme: IdScheme + dataElementIdScheme: IdScheme + dataSetIdScheme: IdScheme + idScheme: IdScheme + orgUnitGroupIdScheme: IdScheme + orgUnitIdScheme: IdScheme + programIdScheme: IdScheme + programStageIdScheme: IdScheme + programStageInstanceIdScheme: IdScheme + trackedEntityAttributeIdScheme: IdScheme + trackedEntityIdScheme: IdScheme +} + +export type ImageResource = { + caption: string + created: string + description: string + id: string + imageUrl: string + lastUpdated: string + logo: boolean +} + +export type ImportConflict = { + errorCode: ImportConflict.errorCode + indexes: Array + object: string + objects: Record + property: string + value: string +} + +export namespace ImportConflict { + export enum errorCode { + E1000 = 'E1000', + E1001 = 'E1001', + E1002 = 'E1002', + E1003 = 'E1003', + E1004 = 'E1004', + E1005 = 'E1005', + E1006 = 'E1006', + E1100 = 'E1100', + E1101 = 'E1101', + E1102 = 'E1102', + E1103 = 'E1103', + E1104 = 'E1104', + E1105 = 'E1105', + E1106 = 'E1106', + E1107 = 'E1107', + E1108 = 'E1108', + E1109 = 'E1109', + E1110 = 'E1110', + E1111 = 'E1111', + E1112 = 'E1112', + E1113 = 'E1113', + E1114 = 'E1114', + E1115 = 'E1115', + E1116 = 'E1116', + E1117 = 'E1117', + E1118 = 'E1118', + E1119 = 'E1119', + E1120 = 'E1120', + E1500 = 'E1500', + E1501 = 'E1501', + E1502 = 'E1502', + E1503 = 'E1503', + E1504 = 'E1504', + E1510 = 'E1510', + E1511 = 'E1511', + E1512 = 'E1512', + E1513 = 'E1513', + E1514 = 'E1514', + E1515 = 'E1515', + E1516 = 'E1516', + E1520 = 'E1520', + E1521 = 'E1521', + E1522 = 'E1522', + E1523 = 'E1523', + E2000 = 'E2000', + E2001 = 'E2001', + E2002 = 'E2002', + E2003 = 'E2003', + E2004 = 'E2004', + E2005 = 'E2005', + E2006 = 'E2006', + E2007 = 'E2007', + E2008 = 'E2008', + E2009 = 'E2009', + E2010 = 'E2010', + E2011 = 'E2011', + E2012 = 'E2012', + E2013 = 'E2013', + E2014 = 'E2014', + E2015 = 'E2015', + E2016 = 'E2016', + E2017 = 'E2017', + E2018 = 'E2018', + E2019 = 'E2019', + E2020 = 'E2020', + E2021 = 'E2021', + E2022 = 'E2022', + E2023 = 'E2023', + E2024 = 'E2024', + E2025 = 'E2025', + E2026 = 'E2026', + E2027 = 'E2027', + E2028 = 'E2028', + E2029 = 'E2029', + E2030 = 'E2030', + E2031 = 'E2031', + E2032 = 'E2032', + E2033 = 'E2033', + E2034 = 'E2034', + E2035 = 'E2035', + E2036 = 'E2036', + E2037 = 'E2037', + E2038 = 'E2038', + E2039 = 'E2039', + E2040 = 'E2040', + E2041 = 'E2041', + E2042 = 'E2042', + E2043 = 'E2043', + E2044 = 'E2044', + E2200 = 'E2200', + E2201 = 'E2201', + E2202 = 'E2202', + E2203 = 'E2203', + E2204 = 'E2204', + E2205 = 'E2205', + E2206 = 'E2206', + E2207 = 'E2207', + E2208 = 'E2208', + E2300 = 'E2300', + E2301 = 'E2301', + E3000 = 'E3000', + E3001 = 'E3001', + E3002 = 'E3002', + E3003 = 'E3003', + E3004 = 'E3004', + E3005 = 'E3005', + E3006 = 'E3006', + E3008 = 'E3008', + E3009 = 'E3009', + E3010 = 'E3010', + E3011 = 'E3011', + E3012 = 'E3012', + E3013 = 'E3013', + E3014 = 'E3014', + E3015 = 'E3015', + E3016 = 'E3016', + E3017 = 'E3017', + E3018 = 'E3018', + E3019 = 'E3019', + E3020 = 'E3020', + E3021 = 'E3021', + E3022 = 'E3022', + E3023 = 'E3023', + E3024 = 'E3024', + E3025 = 'E3025', + E3026 = 'E3026', + E3027 = 'E3027', + E3028 = 'E3028', + E3029 = 'E3029', + E3030 = 'E3030', + E3031 = 'E3031', + E3032 = 'E3032', + E3040 = 'E3040', + E4000 = 'E4000', + E4001 = 'E4001', + E4002 = 'E4002', + E4003 = 'E4003', + E4004 = 'E4004', + E4005 = 'E4005', + E4006 = 'E4006', + E4007 = 'E4007', + E4008 = 'E4008', + E4009 = 'E4009', + E4010 = 'E4010', + E4011 = 'E4011', + E4012 = 'E4012', + E4013 = 'E4013', + E4014 = 'E4014', + E4015 = 'E4015', + E4016 = 'E4016', + E4017 = 'E4017', + E4018 = 'E4018', + E4019 = 'E4019', + E4020 = 'E4020', + E4021 = 'E4021', + E4022 = 'E4022', + E4023 = 'E4023', + E4024 = 'E4024', + E4025 = 'E4025', + E4026 = 'E4026', + E4027 = 'E4027', + E4028 = 'E4028', + E4029 = 'E4029', + E4030 = 'E4030', + E4031 = 'E4031', + E4032 = 'E4032', + E4033 = 'E4033', + E4034 = 'E4034', + E4035 = 'E4035', + E4036 = 'E4036', + E4037 = 'E4037', + E4038 = 'E4038', + E4039 = 'E4039', + E4040 = 'E4040', + E4041 = 'E4041', + E4042 = 'E4042', + E4043 = 'E4043', + E4044 = 'E4044', + E4045 = 'E4045', + E4046 = 'E4046', + E4047 = 'E4047', + E4048 = 'E4048', + E4049 = 'E4049', + E4054 = 'E4054', + E4056 = 'E4056', + E4055 = 'E4055', + E4050 = 'E4050', + E4051 = 'E4051', + E4052 = 'E4052', + E4053 = 'E4053', + E4057 = 'E4057', + E4058 = 'E4058', + E4060 = 'E4060', + E4061 = 'E4061', + E4062 = 'E4062', + E4063 = 'E4063', + E4064 = 'E4064', + E4065 = 'E4065', + E4066 = 'E4066', + E4067 = 'E4067', + E4068 = 'E4068', + E4300 = 'E4300', + E4301 = 'E4301', + E4302 = 'E4302', + E4303 = 'E4303', + E4304 = 'E4304', + E4305 = 'E4305', + E4306 = 'E4306', + E4307 = 'E4307', + E4308 = 'E4308', + E4309 = 'E4309', + E4310 = 'E4310', + E4311 = 'E4311', + E4312 = 'E4312', + E4313 = 'E4313', + E4314 = 'E4314', + E4315 = 'E4315', + E5000 = 'E5000', + E5001 = 'E5001', + E5002 = 'E5002', + E5003 = 'E5003', + E5004 = 'E5004', + E5005 = 'E5005', + E5006 = 'E5006', + E5007 = 'E5007', + E6000 = 'E6000', + E6001 = 'E6001', + E6002 = 'E6002', + E6003 = 'E6003', + E6004 = 'E6004', + E6005 = 'E6005', + E6006 = 'E6006', + E6007 = 'E6007', + E6008 = 'E6008', + E6009 = 'E6009', + E6010 = 'E6010', + E6011 = 'E6011', + E6012 = 'E6012', + E6013 = 'E6013', + E6014 = 'E6014', + E6015 = 'E6015', + E6016 = 'E6016', + E6017 = 'E6017', + E6018 = 'E6018', + E6019 = 'E6019', + E6020 = 'E6020', + E6021 = 'E6021', + E6100 = 'E6100', + E6101 = 'E6101', + E6200 = 'E6200', + E6201 = 'E6201', + E6202 = 'E6202', + E6203 = 'E6203', + E6204 = 'E6204', + E6205 = 'E6205', + E6206 = 'E6206', + E6207 = 'E6207', + E6208 = 'E6208', + E6209 = 'E6209', + E6210 = 'E6210', + E6211 = 'E6211', + E6300 = 'E6300', + E6301 = 'E6301', + E6302 = 'E6302', + E6303 = 'E6303', + E6304 = 'E6304', + E6305 = 'E6305', + E7000 = 'E7000', + E7003 = 'E7003', + E7004 = 'E7004', + E7005 = 'E7005', + E7006 = 'E7006', + E7007 = 'E7007', + E7010 = 'E7010', + E7020 = 'E7020', + E7021 = 'E7021', + E7022 = 'E7022', + E7023 = 'E7023', + E7024 = 'E7024', + E7100 = 'E7100', + E7101 = 'E7101', + E7102 = 'E7102', + E7103 = 'E7103', + E7104 = 'E7104', + E7105 = 'E7105', + E7106 = 'E7106', + E7107 = 'E7107', + E7108 = 'E7108', + E7109 = 'E7109', + E7110 = 'E7110', + E7111 = 'E7111', + E7112 = 'E7112', + E7113 = 'E7113', + E7114 = 'E7114', + E7115 = 'E7115', + E7116 = 'E7116', + E7117 = 'E7117', + E7118 = 'E7118', + E7119 = 'E7119', + E7120 = 'E7120', + E7121 = 'E7121', + E7122 = 'E7122', + E7123 = 'E7123', + E7124 = 'E7124', + E7125 = 'E7125', + E7126 = 'E7126', + E7127 = 'E7127', + E7128 = 'E7128', + E7129 = 'E7129', + E7130 = 'E7130', + E7131 = 'E7131', + E7132 = 'E7132', + E7133 = 'E7133', + E7134 = 'E7134', + E7135 = 'E7135', + E7136 = 'E7136', + E7137 = 'E7137', + E7138 = 'E7138', + E7139 = 'E7139', + E7140 = 'E7140', + E7141 = 'E7141', + E7142 = 'E7142', + E7200 = 'E7200', + E7201 = 'E7201', + E7202 = 'E7202', + E7203 = 'E7203', + E7204 = 'E7204', + E7205 = 'E7205', + E7206 = 'E7206', + E7207 = 'E7207', + E7208 = 'E7208', + E7209 = 'E7209', + E7210 = 'E7210', + E7211 = 'E7211', + E7212 = 'E7212', + E7213 = 'E7213', + E7214 = 'E7214', + E7215 = 'E7215', + E7216 = 'E7216', + E7217 = 'E7217', + E7218 = 'E7218', + E7219 = 'E7219', + E7220 = 'E7220', + E7221 = 'E7221', + E7222 = 'E7222', + E7223 = 'E7223', + E7224 = 'E7224', + E7225 = 'E7225', + E7226 = 'E7226', + E7227 = 'E7227', + E7228 = 'E7228', + E7229 = 'E7229', + E7230 = 'E7230', + E7231 = 'E7231', + E7232 = 'E7232', + E7234 = 'E7234', + E7250 = 'E7250', + E7300 = 'E7300', + E7301 = 'E7301', + E7400 = 'E7400', + E7500 = 'E7500', + E7501 = 'E7501', + E7502 = 'E7502', + E7503 = 'E7503', + E7600 = 'E7600', + E7601 = 'E7601', + E7602 = 'E7602', + E7603 = 'E7603', + E7604 = 'E7604', + E7610 = 'E7610', + E7611 = 'E7611', + E7612 = 'E7612', + E7613 = 'E7613', + E7614 = 'E7614', + E7615 = 'E7615', + E7616 = 'E7616', + E7617 = 'E7617', + E7618 = 'E7618', + E7619 = 'E7619', + E7620 = 'E7620', + E7621 = 'E7621', + E7630 = 'E7630', + E7631 = 'E7631', + E7632 = 'E7632', + E7633 = 'E7633', + E7634 = 'E7634', + E7635 = 'E7635', + E7636 = 'E7636', + E7637 = 'E7637', + E7638 = 'E7638', + E7639 = 'E7639', + E7640 = 'E7640', + E7641 = 'E7641', + E7642 = 'E7642', + E7643 = 'E7643', + E7644 = 'E7644', + E7645 = 'E7645', + E7650 = 'E7650', + E7651 = 'E7651', + E7652 = 'E7652', + E7653 = 'E7653', + E7700 = 'E7700', + E7701 = 'E7701', + E7702 = 'E7702', + E7703 = 'E7703', + E7704 = 'E7704', + E7705 = 'E7705', + E7706 = 'E7706', + E7707 = 'E7707', + E7708 = 'E7708', + E7709 = 'E7709', + E7710 = 'E7710', + E7711 = 'E7711', + E7712 = 'E7712', + } +} + +export type ImportConflicts = { + conflictCount: number + conflicts: Array + conflictsDescription: string + totalConflictOccurrenceCount: number +} + +export type ImportCount = { + deleted: number + ignored: number + imported: number + updated: number +} + +export type ImportOptions = { + async: boolean + dataSet: string + datasetAllowsPeriods: boolean + dryRun: boolean + filename: string + firstRowIsHeader: boolean + force: boolean + idSchemes: IdSchemes + ignoreEmptyCollection: boolean + importStrategy: ImportOptions.importStrategy + mergeDataValues: boolean + mergeMode: ImportOptions.mergeMode + notificationLevel: ImportOptions.notificationLevel + preheatCache: boolean + reportMode: ImportOptions.reportMode + requireAttributeOptionCombo: boolean + requireCategoryOptionCombo: boolean + sharing: boolean + skipAudit: boolean + skipCache: boolean + skipExistingCheck: boolean + skipLastUpdated: boolean + skipNotifications: boolean + skipPatternValidation: boolean + strictAttributeOptionCombos: boolean + strictCategoryOptionCombos: boolean + strictDataElements: boolean + strictDataSetApproval: boolean + strictDataSetInputPeriods: boolean + strictDataSetLocking: boolean + strictOrganisationUnits: boolean + strictPeriods: boolean +} + +export namespace ImportOptions { + export enum importStrategy { + CREATE = 'CREATE', + UPDATE = 'UPDATE', + CREATE_AND_UPDATE = 'CREATE_AND_UPDATE', + DELETE = 'DELETE', + SYNC = 'SYNC', + NEW_AND_UPDATES = 'NEW_AND_UPDATES', + NEW = 'NEW', + UPDATES = 'UPDATES', + DELETES = 'DELETES', + } + + export enum mergeMode { + MERGE_ALWAYS = 'MERGE_ALWAYS', + MERGE_IF_NOT_NULL = 'MERGE_IF_NOT_NULL', + MERGE = 'MERGE', + REPLACE = 'REPLACE', + NONE = 'NONE', + } + + export enum notificationLevel { + OFF = 'OFF', + DEBUG = 'DEBUG', + LOOP = 'LOOP', + INFO = 'INFO', + WARN = 'WARN', + ERROR = 'ERROR', + } + + export enum reportMode { + FULL = 'FULL', + ERRORS = 'ERRORS', + ERRORS_NOT_OWNER = 'ERRORS_NOT_OWNER', + DEBUG = 'DEBUG', + } +} + +export type ImportReport = { + importParams: MetadataImportParams + stats: Stats + status: ImportReport.status + typeReports: Array +} + +export namespace ImportReport { + export enum status { + OK = 'OK', + WARNING = 'WARNING', + ERROR = 'ERROR', + } +} + +export type ImportSummaries = { + deleted: number + ignored: number + importOptions: ImportOptions + importSummaries: Array + imported: number + responseType: string + status: ImportSummaries.status + total: number + updated: number +} + +export namespace ImportSummaries { + export enum status { + SUCCESS = 'SUCCESS', + WARNING = 'WARNING', + ERROR = 'ERROR', + } +} + +export type ImportSummaryLegacy = { + conflicts: Array + dataSetComplete: string + description: string + enrollments: ImportSummaries + events: ImportSummaries + href: string + importCount: ImportCount + importOptions: ImportOptions + reference: string + rejectedIndexes: Array + relationships: ImportSummaries + responseType: string + status: ImportSummary.status +} + +export namespace ImportSummary { + export enum status { + SUCCESS = 'SUCCESS', + WARNING = 'WARNING', + ERROR = 'ERROR', + } +} + +export type IncomingSms = { + access: Access + attributeValues: Array + code: string + created: string + createdBy: User + displayName: string + favorite: boolean + favorites: Array + gatewayid: string + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + name: string + originator: string + receiveddate: string + sentdate: string + sharing: Sharing + smsencoding: IncomingSms.smsencoding + smsstatus: IncomingSms.smsstatus + text: string + translations: Array + user: User +} + +export namespace IncomingSms { + export enum smsencoding { + ENC7BIT = 'ENC7BIT', + ENC8BIT = 'ENC8BIT', + ENCUCS2 = 'ENCUCS2', + ENCCUSTOM = 'ENCCUSTOM', + } + + export enum smsstatus { + INCOMING = 'INCOMING', + PROCESSING = 'PROCESSING', + UNHANDLED = 'UNHANDLED', + FAILED = 'FAILED', + PROCESSED = 'PROCESSED', + SENT = 'SENT', + } +} + +export type IndexResource = { + displayName: string + href: string + plural: string + singular: string +} + +export type IndexResources = { + resources: Array +} + +export type Indicator = { + access: Access + aggregateExportAttributeOptionCombo: string + aggregateExportCategoryOptionCombo: string + aggregationType: Indicator.aggregationType + annualized: boolean + attributeValues: Array + code: string + created: string + createdBy: User + dataSets: Array + decimals: number + denominator: string + denominatorDescription: string + description: string + dimensionItem: string + displayDenominatorDescription: string + displayDescription: string + displayFormName: string + displayName: string + displayNumeratorDescription: string + displayShortName: string + explodedDenominator: string + explodedNumerator: string + favorite: boolean + favorites: Array + formName: string + href: string + id: string + indicatorGroups: Array + indicatorType: IndicatorType + lastUpdated: string + lastUpdatedBy: User + legendSet: LegendSet + legendSets: Array + name: string + numerator: string + numeratorDescription: string + queryMods: QueryModifiers + sharing: Sharing + shortName: string + style: ObjectStyle + translations: Array + url: string + user: User +} + +export namespace Indicator { + export enum aggregationType { + SUM = 'SUM', + AVERAGE = 'AVERAGE', + AVERAGE_SUM_ORG_UNIT = 'AVERAGE_SUM_ORG_UNIT', + LAST = 'LAST', + LAST_AVERAGE_ORG_UNIT = 'LAST_AVERAGE_ORG_UNIT', + LAST_LAST_ORG_UNIT = 'LAST_LAST_ORG_UNIT', + LAST_IN_PERIOD = 'LAST_IN_PERIOD', + LAST_IN_PERIOD_AVERAGE_ORG_UNIT = 'LAST_IN_PERIOD_AVERAGE_ORG_UNIT', + FIRST = 'FIRST', + FIRST_AVERAGE_ORG_UNIT = 'FIRST_AVERAGE_ORG_UNIT', + FIRST_FIRST_ORG_UNIT = 'FIRST_FIRST_ORG_UNIT', + COUNT = 'COUNT', + STDDEV = 'STDDEV', + VARIANCE = 'VARIANCE', + MIN = 'MIN', + MAX = 'MAX', + MIN_SUM_ORG_UNIT = 'MIN_SUM_ORG_UNIT', + MAX_SUM_ORG_UNIT = 'MAX_SUM_ORG_UNIT', + NONE = 'NONE', + CUSTOM = 'CUSTOM', + DEFAULT = 'DEFAULT', + } +} + +export type IndicatorGroup = { + access: Access + attributeValues: Array + code: string + created: string + createdBy: User + description: string + displayName: string + favorite: boolean + favorites: Array + groupSets: Array + href: string + id: string + indicatorGroupSet: IndicatorGroupSet + indicators: Array + lastUpdated: string + lastUpdatedBy: User + name: string + sharing: Sharing + translations: Array + user: User +} + +export type IndicatorGroupSet = { + access: Access + attributeValues: Array + code: string + compulsory: boolean + created: string + createdBy: User + description: string + displayName: string + favorite: boolean + favorites: Array + href: string + id: string + indicatorGroups: Array + lastUpdated: string + lastUpdatedBy: User + name: string + sharing: Sharing + shortName: string + translations: Array + user: User +} + +export type IndicatorType = { + access: Access + attributeValues: Array + code: string + created: string + createdBy: User + displayName: string + factor: number + favorite: boolean + favorites: Array + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + name: string + number: boolean + sharing: Sharing + translations: Array + user: User +} + +export type Interpretation = { + access: Access + attributeValues: Array + code: string + comments: Array + created: string + createdBy: User + dataSet: DataSet + displayName: string + eventChart: Ref_EventChart + eventReport: Ref_EventReport + eventVisualization: EventVisualization + favorite: boolean + favorites: Array + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + likedBy: Array + likes: number + map: Map + mentions: Array + organisationUnit: OrganisationUnit + period: string + sharing: Sharing + text: string + translations: Array + type: Interpretation.type + user: User + visualization: Visualization +} + +export namespace Interpretation { + export enum type { + VISUALIZATION = 'VISUALIZATION', + EVENT_VISUALIZATION = 'EVENT_VISUALIZATION', + MAP = 'MAP', + EVENT_REPORT = 'EVENT_REPORT', + EVENT_CHART = 'EVENT_CHART', + DATASET_REPORT = 'DATASET_REPORT', + } +} + +export type IpAllowedList = { + allowedIps: Array + type: string +} + +export type Item = { + complete: boolean + completedTime: string + description: string + duration: number + error: string + onFailure: Item.onFailure + status: Item.status + summary: string +} + +export namespace Item { + export enum onFailure { + PARENT = 'PARENT', + FAIL = 'FAIL', + SKIP_STAGE = 'SKIP_STAGE', + SKIP_ITEM = 'SKIP_ITEM', + SKIP_ITEM_OUTLIER = 'SKIP_ITEM_OUTLIER', + } + + export enum status { + RUNNING = 'RUNNING', + SUCCESS = 'SUCCESS', + ERROR = 'ERROR', + CANCELLED = 'CANCELLED', + } +} + +export type ItemConfig = { + insertHeight: number + insertPosition: ItemConfig.insertPosition +} + +export namespace ItemConfig { + export enum insertPosition { + START = 'START', + END = 'END', + } +} + +export type JmsTarget = { + address: string + brokerUrl: string + clientId: string + groupId: string + password: string + type: string + useQueue: boolean + username: string +} + +export type JobConfiguration = { + access: Access + attributeValues: Array + code: string + configurable: boolean + created: string + createdBy: User + cronExpression: string + delay: number + displayName: string + enabled: boolean + executedBy: string + favorite: boolean + favorites: Array + href: string + id: string + jobParameters: + | AnalyticsJobParameters + | ContinuousAnalyticsJobParameters + | MonitoringJobParameters + | PredictorJobParameters + | PushAnalysisJobParameters + | SmsJobParameters + | MetadataSyncJobParameters + | EventProgramsDataSynchronizationJobParameters + | TrackerProgramsDataSynchronizationJobParameters + | DataSynchronizationJobParameters + | DisableInactiveUsersJobParameters + | TrackerTrigramIndexJobParameters + | DataIntegrityJobParameters + | AggregateDataExchangeJobParameters + | SqlViewUpdateParameters + | TestJobParameters + jobStatus: JobConfiguration.jobStatus + jobType: JobConfiguration.jobType + lastExecuted: string + lastExecutedStatus: JobConfiguration.lastExecutedStatus + lastRuntimeExecution: string + lastUpdated: string + lastUpdatedBy: User + leaderOnlyJob: boolean + name: string + nextExecutionTime: string + schedulingType: JobConfiguration.schedulingType + sharing: Sharing + translations: Array + user: User + userUid: string +} + +export namespace JobConfiguration { + export enum jobStatus { + RUNNING = 'RUNNING', + COMPLETED = 'COMPLETED', + STOPPED = 'STOPPED', + SCHEDULED = 'SCHEDULED', + DISABLED = 'DISABLED', + FAILED = 'FAILED', + NOT_STARTED = 'NOT_STARTED', + } + + export enum jobType { + DATA_STATISTICS = 'DATA_STATISTICS', + DATA_INTEGRITY = 'DATA_INTEGRITY', + RESOURCE_TABLE = 'RESOURCE_TABLE', + ANALYTICS_TABLE = 'ANALYTICS_TABLE', + CONTINUOUS_ANALYTICS_TABLE = 'CONTINUOUS_ANALYTICS_TABLE', + DATA_SYNC = 'DATA_SYNC', + TRACKER_PROGRAMS_DATA_SYNC = 'TRACKER_PROGRAMS_DATA_SYNC', + EVENT_PROGRAMS_DATA_SYNC = 'EVENT_PROGRAMS_DATA_SYNC', + FILE_RESOURCE_CLEANUP = 'FILE_RESOURCE_CLEANUP', + IMAGE_PROCESSING = 'IMAGE_PROCESSING', + META_DATA_SYNC = 'META_DATA_SYNC', + AGGREGATE_DATA_EXCHANGE = 'AGGREGATE_DATA_EXCHANGE', + SMS_SEND = 'SMS_SEND', + SEND_SCHEDULED_MESSAGE = 'SEND_SCHEDULED_MESSAGE', + PROGRAM_NOTIFICATIONS = 'PROGRAM_NOTIFICATIONS', + VALIDATION_RESULTS_NOTIFICATION = 'VALIDATION_RESULTS_NOTIFICATION', + CREDENTIALS_EXPIRY_ALERT = 'CREDENTIALS_EXPIRY_ALERT', + MONITORING = 'MONITORING', + PUSH_ANALYSIS = 'PUSH_ANALYSIS', + TRACKER_SEARCH_OPTIMIZATION = 'TRACKER_SEARCH_OPTIMIZATION', + PREDICTOR = 'PREDICTOR', + DATA_SET_NOTIFICATION = 'DATA_SET_NOTIFICATION', + REMOVE_USED_OR_EXPIRED_RESERVED_VALUES = 'REMOVE_USED_OR_EXPIRED_RESERVED_VALUES', + TRACKER_IMPORT_JOB = 'TRACKER_IMPORT_JOB', + TRACKER_IMPORT_NOTIFICATION_JOB = 'TRACKER_IMPORT_NOTIFICATION_JOB', + TRACKER_IMPORT_RULE_ENGINE_JOB = 'TRACKER_IMPORT_RULE_ENGINE_JOB', + MATERIALIZED_SQL_VIEW_UPDATE = 'MATERIALIZED_SQL_VIEW_UPDATE', + LOCK_EXCEPTION_CLEANUP = 'LOCK_EXCEPTION_CLEANUP', + LEADER_ELECTION = 'LEADER_ELECTION', + LEADER_RENEWAL = 'LEADER_RENEWAL', + COMPLETE_DATA_SET_REGISTRATION_IMPORT = 'COMPLETE_DATA_SET_REGISTRATION_IMPORT', + DATAVALUE_IMPORT_INTERNAL = 'DATAVALUE_IMPORT_INTERNAL', + METADATA_IMPORT = 'METADATA_IMPORT', + DATAVALUE_IMPORT = 'DATAVALUE_IMPORT', + GEOJSON_IMPORT = 'GEOJSON_IMPORT', + EVENT_IMPORT = 'EVENT_IMPORT', + ENROLLMENT_IMPORT = 'ENROLLMENT_IMPORT', + TEI_IMPORT = 'TEI_IMPORT', + DISABLE_INACTIVE_USERS = 'DISABLE_INACTIVE_USERS', + ACCOUNT_EXPIRY_ALERT = 'ACCOUNT_EXPIRY_ALERT', + SYSTEM_VERSION_UPDATE_CHECK = 'SYSTEM_VERSION_UPDATE_CHECK', + TEST = 'TEST', + MOCK = 'MOCK', + GML_IMPORT = 'GML_IMPORT', + ANALYTICSTABLE_UPDATE = 'ANALYTICSTABLE_UPDATE', + PROGRAM_DATA_SYNC = 'PROGRAM_DATA_SYNC', + } + + export enum lastExecutedStatus { + RUNNING = 'RUNNING', + COMPLETED = 'COMPLETED', + STOPPED = 'STOPPED', + SCHEDULED = 'SCHEDULED', + DISABLED = 'DISABLED', + FAILED = 'FAILED', + NOT_STARTED = 'NOT_STARTED', + } + + export enum schedulingType { + CRON = 'CRON', + FIXED_DELAY = 'FIXED_DELAY', + } +} + +export type JobTypeInfo = { + jobParameters: Array + jobType: JobTypeInfo.jobType + name: string + schedulingType: JobTypeInfo.schedulingType +} + +export namespace JobTypeInfo { + export enum jobType { + DATA_STATISTICS = 'DATA_STATISTICS', + DATA_INTEGRITY = 'DATA_INTEGRITY', + RESOURCE_TABLE = 'RESOURCE_TABLE', + ANALYTICS_TABLE = 'ANALYTICS_TABLE', + CONTINUOUS_ANALYTICS_TABLE = 'CONTINUOUS_ANALYTICS_TABLE', + DATA_SYNC = 'DATA_SYNC', + TRACKER_PROGRAMS_DATA_SYNC = 'TRACKER_PROGRAMS_DATA_SYNC', + EVENT_PROGRAMS_DATA_SYNC = 'EVENT_PROGRAMS_DATA_SYNC', + FILE_RESOURCE_CLEANUP = 'FILE_RESOURCE_CLEANUP', + IMAGE_PROCESSING = 'IMAGE_PROCESSING', + META_DATA_SYNC = 'META_DATA_SYNC', + AGGREGATE_DATA_EXCHANGE = 'AGGREGATE_DATA_EXCHANGE', + SMS_SEND = 'SMS_SEND', + SEND_SCHEDULED_MESSAGE = 'SEND_SCHEDULED_MESSAGE', + PROGRAM_NOTIFICATIONS = 'PROGRAM_NOTIFICATIONS', + VALIDATION_RESULTS_NOTIFICATION = 'VALIDATION_RESULTS_NOTIFICATION', + CREDENTIALS_EXPIRY_ALERT = 'CREDENTIALS_EXPIRY_ALERT', + MONITORING = 'MONITORING', + PUSH_ANALYSIS = 'PUSH_ANALYSIS', + TRACKER_SEARCH_OPTIMIZATION = 'TRACKER_SEARCH_OPTIMIZATION', + PREDICTOR = 'PREDICTOR', + DATA_SET_NOTIFICATION = 'DATA_SET_NOTIFICATION', + REMOVE_USED_OR_EXPIRED_RESERVED_VALUES = 'REMOVE_USED_OR_EXPIRED_RESERVED_VALUES', + TRACKER_IMPORT_JOB = 'TRACKER_IMPORT_JOB', + TRACKER_IMPORT_NOTIFICATION_JOB = 'TRACKER_IMPORT_NOTIFICATION_JOB', + TRACKER_IMPORT_RULE_ENGINE_JOB = 'TRACKER_IMPORT_RULE_ENGINE_JOB', + MATERIALIZED_SQL_VIEW_UPDATE = 'MATERIALIZED_SQL_VIEW_UPDATE', + LOCK_EXCEPTION_CLEANUP = 'LOCK_EXCEPTION_CLEANUP', + LEADER_ELECTION = 'LEADER_ELECTION', + LEADER_RENEWAL = 'LEADER_RENEWAL', + COMPLETE_DATA_SET_REGISTRATION_IMPORT = 'COMPLETE_DATA_SET_REGISTRATION_IMPORT', + DATAVALUE_IMPORT_INTERNAL = 'DATAVALUE_IMPORT_INTERNAL', + METADATA_IMPORT = 'METADATA_IMPORT', + DATAVALUE_IMPORT = 'DATAVALUE_IMPORT', + GEOJSON_IMPORT = 'GEOJSON_IMPORT', + EVENT_IMPORT = 'EVENT_IMPORT', + ENROLLMENT_IMPORT = 'ENROLLMENT_IMPORT', + TEI_IMPORT = 'TEI_IMPORT', + DISABLE_INACTIVE_USERS = 'DISABLE_INACTIVE_USERS', + ACCOUNT_EXPIRY_ALERT = 'ACCOUNT_EXPIRY_ALERT', + SYSTEM_VERSION_UPDATE_CHECK = 'SYSTEM_VERSION_UPDATE_CHECK', + TEST = 'TEST', + MOCK = 'MOCK', + GML_IMPORT = 'GML_IMPORT', + ANALYTICSTABLE_UPDATE = 'ANALYTICSTABLE_UPDATE', + PROGRAM_DATA_SYNC = 'PROGRAM_DATA_SYNC', + } + + export enum schedulingType { + CRON = 'CRON', + FIXED_DELAY = 'FIXED_DELAY', + } +} + +export type JobTypes = { + jobTypes: Array +} + +export type JsonPatch = { + operations: Array< + AddOperation | RemoveOperation | RemoveByIdOperation | ReplaceOperation + > +} + +export type JsonRoot = { + properties: Record> +} + +export type KafkaTarget = { + bootstrapServers: string + clientId: string + password: string + topic: string + type: string + username: string +} + +export type Keyword = { + key: string + metadataItem: MetadataItem +} + +export type Layout = { + columns: Array + spacing: Spacing +} + +export type LeaderNodeInfo = { + currentNodeId: string + currentNodeUuid: string + leader: boolean + leaderNodeId: string + leaderNodeUuid: string +} + +export type Legend = { + access: Access + attributeValues: Array + code: string + color: string + created: string + createdBy: User + displayName: string + endValue: number + favorite: boolean + favorites: Array + href: string + id: string + image: string + lastUpdated: string + lastUpdatedBy: User + name: string + sharing: Sharing + startValue: number + translations: Array + user: User +} + +export type LegendDefinitions = { + set: LegendSet + showKey: boolean + strategy: LegendDefinitions.strategy + style: LegendDefinitions.style +} + +export namespace LegendDefinitions { + export enum strategy { + FIXED = 'FIXED', + BY_DATA_ITEM = 'BY_DATA_ITEM', + } + + export enum style { + FILL = 'FILL', + TEXT = 'TEXT', + } +} + +export type LegendSet = { + access: Access + attributeValues: Array + code: string + created: string + createdBy: User + displayName: string + favorite: boolean + favorites: Array + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + legends: Array + name: string + sharing: Sharing + symbolizer: string + translations: Array + user: User +} + +export type Line = { + title: StyledObject + value: number +} + +export type LockExceptionDto = { + dataSet: string + orgUnit: string + period: string +} + +export type LockExceptionsDto = { + lockExceptions: Array +} + +export type Map = { + access: Access + attributeValues: Array + basemap: string + code: string + created: string + createdBy: User + description: string + displayDescription: string + displayFormName: string + displayName: string + displayShortName: string + favorite: boolean + favorites: Array + formName: string + href: string + id: string + interpretations: Array + lastUpdated: string + lastUpdatedBy: User + latitude: number + longitude: number + mapViews: Array + name: string + sharing: Sharing + shortName: string + subscribed: boolean + subscribers: Array + title: string + translations: Array + user: User + zoom: number +} + +export type MapView = { + access: Access + aggregationType: MapView.aggregationType + areaRadius: number + attributeDimensions: Array + attributeValues: Array + categoryDimensions: Array + categoryOptionGroupSetDimensions: Array + classes: number + code: string + colorHigh: string + colorLow: string + colorScale: string + columnDimensions: Array + columns: Array + completedOnly: boolean + config: string + created: string + createdBy: User + dataDimensionItems: Array + dataElementDimensions: Array + dataElementGroupSetDimensions: Array + description: string + digitGroupSeparator: MapView.digitGroupSeparator + displayDescription: string + displayFormName: string + displayName: string + displayShortName: string + displaySubtitle: string + displayTitle: string + endDate: string + eventClustering: boolean + eventCoordinateField: string + eventPointColor: string + eventPointRadius: number + eventStatus: MapView.eventStatus + favorite: boolean + favorites: Array + filterDimensions: Array + filters: Array + followUp: boolean + formName: string + hidden: boolean + hideSubtitle: boolean + hideTitle: boolean + href: string + id: string + interpretations: Array + itemOrganisationUnitGroups: Array + labelFontColor: string + labelFontSize: string + labelFontStyle: string + labelFontWeight: string + labelTemplate: string + labels: boolean + lastUpdated: string + lastUpdatedBy: User + layer: string + legendSet: LegendSet + method: number + noDataColor: string + opacity: number + orgUnitField: string + orgUnitFieldDisplayName: string + organisationUnitColor: string + organisationUnitGroupSet: OrganisationUnitGroupSet + organisationUnitGroupSetDimensions: Array + organisationUnitLevels: Array + organisationUnitSelectionMode: MapView.organisationUnitSelectionMode + organisationUnits: Array + parentGraph: string + parentGraphMap: Record + parentLevel: number + periods: Array + program: Program + programIndicatorDimensions: Array + programStage: ProgramStage + programStatus: MapView.programStatus + radiusHigh: number + radiusLow: number + relativePeriods: RelativePeriods + renderingStrategy: MapView.renderingStrategy + rows: Array + sharing: Sharing + shortName: string + sortOrder: number + startDate: string + /** + * The actual type is unknown. + * (Java type was: `class java.lang.Object`) + */ + styleDataItem: Record + subscribed: boolean + subscribers: Array + subtitle: string + thematicMapType: MapView.thematicMapType + timeField: string + title: string + topLimit: number + trackedEntityType: TrackedEntityType + translations: Array + user: User + userOrgUnitType: MapView.userOrgUnitType + userOrganisationUnit: boolean + userOrganisationUnitChildren: boolean + userOrganisationUnitGrandChildren: boolean +} + +export namespace MapView { + export enum aggregationType { + SUM = 'SUM', + AVERAGE = 'AVERAGE', + AVERAGE_SUM_ORG_UNIT = 'AVERAGE_SUM_ORG_UNIT', + LAST = 'LAST', + LAST_AVERAGE_ORG_UNIT = 'LAST_AVERAGE_ORG_UNIT', + LAST_LAST_ORG_UNIT = 'LAST_LAST_ORG_UNIT', + LAST_IN_PERIOD = 'LAST_IN_PERIOD', + LAST_IN_PERIOD_AVERAGE_ORG_UNIT = 'LAST_IN_PERIOD_AVERAGE_ORG_UNIT', + FIRST = 'FIRST', + FIRST_AVERAGE_ORG_UNIT = 'FIRST_AVERAGE_ORG_UNIT', + FIRST_FIRST_ORG_UNIT = 'FIRST_FIRST_ORG_UNIT', + COUNT = 'COUNT', + STDDEV = 'STDDEV', + VARIANCE = 'VARIANCE', + MIN = 'MIN', + MAX = 'MAX', + MIN_SUM_ORG_UNIT = 'MIN_SUM_ORG_UNIT', + MAX_SUM_ORG_UNIT = 'MAX_SUM_ORG_UNIT', + NONE = 'NONE', + CUSTOM = 'CUSTOM', + DEFAULT = 'DEFAULT', + } + + export enum digitGroupSeparator { + COMMA = 'COMMA', + SPACE = 'SPACE', + NONE = 'NONE', + } + + export enum eventStatus { + ACTIVE = 'ACTIVE', + COMPLETED = 'COMPLETED', + SCHEDULE = 'SCHEDULE', + OVERDUE = 'OVERDUE', + SKIPPED = 'SKIPPED', + } + + export enum organisationUnitSelectionMode { + SELECTED = 'SELECTED', + CHILDREN = 'CHILDREN', + DESCENDANTS = 'DESCENDANTS', + ACCESSIBLE = 'ACCESSIBLE', + CAPTURE = 'CAPTURE', + ALL = 'ALL', + } + + export enum programStatus { + ACTIVE = 'ACTIVE', + COMPLETED = 'COMPLETED', + CANCELLED = 'CANCELLED', + } + + export enum renderingStrategy { + SINGLE = 'SINGLE', + SPLIT_BY_PERIOD = 'SPLIT_BY_PERIOD', + TIMELINE = 'TIMELINE', + } + + export enum thematicMapType { + CHOROPLETH = 'CHOROPLETH', + BUBBLE = 'BUBBLE', + } + + export enum userOrgUnitType { + DATA_CAPTURE = 'DATA_CAPTURE', + DATA_OUTPUT = 'DATA_OUTPUT', + TEI_SEARCH = 'TEI_SEARCH', + } +} + +export type CurrentUser = { + access: Access + authorities: Array + avatar: FileResource + birthday: string + created: string + dataSets: Array + dataViewOrganisationUnits: Array + displayName: string + education: string + email: string + employer: string + externalAccess: boolean + facebookMessenger: string + favorites: Array + firstName: string + gender: string + id: string + impersonation: string + interests: string + introduction: string + jobTitle: string + languages: string + lastUpdated: string + name: string + nationality: string + organisationUnits: Array + phoneNumber: string + programs: Array + settings: Record + sharing: Sharing + skype: string + surname: string + teiSearchOrganisationUnits: Array + telegram: string + translations: Array + twitter: string + userAccesses: Array + userCredentials: UserCredentialsDto + userGroupAccesses: Array + userGroups: Array + userRoles: Array + username: string + whatsApp: string +} + +export type Mention = { + created: string + username: string +} + +export type MergeObject = { + enrollments: Array + relationships: Array + trackedEntityAttributes: Array +} + +export type MessageConversation = { + access: Access + assignee: User + attributeValues: Array + code: string + created: string + createdBy: User + displayName: string + extMessageId: string + favorite: boolean + favorites: Array + followUp: boolean + href: string + id: string + lastMessage: string + lastSender: User + lastSenderFirstname: string + lastSenderSurname: string + lastUpdated: string + lastUpdatedBy: User + messageCount: number + messageType: MessageConversation.messageType + messages: Array + priority: MessageConversation.priority + read: boolean + sharing: Sharing + status: MessageConversation.status + subject: string + translations: Array + user: User + userFirstname: string + userMessages: Array + userSurname: string +} + +export namespace MessageConversation { + export enum messageType { + PRIVATE = 'PRIVATE', + SYSTEM = 'SYSTEM', + VALIDATION_RESULT = 'VALIDATION_RESULT', + TICKET = 'TICKET', + SYSTEM_VERSION_UPDATE = 'SYSTEM_VERSION_UPDATE', + } + + export enum priority { + NONE = 'NONE', + LOW = 'LOW', + MEDIUM = 'MEDIUM', + HIGH = 'HIGH', + } + + export enum status { + NONE = 'NONE', + OPEN = 'OPEN', + PENDING = 'PENDING', + INVALID = 'INVALID', + SOLVED = 'SOLVED', + } +} + +export type Meta = { + allowExternalAccess: boolean + allowPublicAccess: boolean +} + +export type MetadataAdjustParams = { + change: Record + targetId: string +} + +export type MetadataExportParams = { + classes: Array + defaultFields: Array + defaultFilter: Array + defaultOrder: Array + defaults: MetadataExportParams.defaults + download: boolean + exportWithDependencies: boolean + inclusionStrategy: MetadataExportParams.inclusionStrategy + objectExportWithDependencies: IdentifiableObject + skipSharing: boolean + user: User + username: string +} + +export namespace MetadataExportParams { + export enum defaults { + INCLUDE = 'INCLUDE', + EXCLUDE = 'EXCLUDE', + } + + export enum inclusionStrategy { + ALWAYS = 'ALWAYS', + NON_NULL = 'NON_NULL', + NON_EMPTY = 'NON_EMPTY', + } +} + +export type MetadataImportParams = { + atomicMode: MetadataImportParams.atomicMode + flushMode: MetadataImportParams.flushMode + identifier: MetadataImportParams.identifier + importMode: MetadataImportParams.importMode + importReportMode: MetadataImportParams.importReportMode + importStrategy: MetadataImportParams.importStrategy + mergeMode: MetadataImportParams.mergeMode + metadataSyncImport: boolean + preheatMode: MetadataImportParams.preheatMode + skipSharing: boolean + skipTranslation: boolean + skipValidation: boolean + userOverrideMode: MetadataImportParams.userOverrideMode +} + +export namespace MetadataImportParams { + export enum atomicMode { + ALL = 'ALL', + NONE = 'NONE', + } + + export enum flushMode { + OBJECT = 'OBJECT', + AUTO = 'AUTO', + } + + export enum identifier { + UID = 'UID', + CODE = 'CODE', + } + + export enum importMode { + COMMIT = 'COMMIT', + VALIDATE = 'VALIDATE', + } + + export enum importReportMode { + FULL = 'FULL', + ERRORS = 'ERRORS', + ERRORS_NOT_OWNER = 'ERRORS_NOT_OWNER', + DEBUG = 'DEBUG', + } + + export enum importStrategy { + CREATE = 'CREATE', + UPDATE = 'UPDATE', + CREATE_AND_UPDATE = 'CREATE_AND_UPDATE', + DELETE = 'DELETE', + SYNC = 'SYNC', + NEW_AND_UPDATES = 'NEW_AND_UPDATES', + NEW = 'NEW', + UPDATES = 'UPDATES', + DELETES = 'DELETES', + } + + export enum mergeMode { + MERGE_ALWAYS = 'MERGE_ALWAYS', + MERGE_IF_NOT_NULL = 'MERGE_IF_NOT_NULL', + MERGE = 'MERGE', + REPLACE = 'REPLACE', + NONE = 'NONE', + } + + export enum preheatMode { + REFERENCE = 'REFERENCE', + ALL = 'ALL', + NONE = 'NONE', + } + + export enum userOverrideMode { + NONE = 'NONE', + CURRENT = 'CURRENT', + SELECTED = 'SELECTED', + } +} + +export type MetadataItem = { + aggregationType: MetadataItem.aggregationType + code: string + description: string + dimensionItemType: MetadataItem.dimensionItemType + dimensionType: MetadataItem.dimensionType + endDate: string + expression: string + indicatorType: IndicatorType + legendSet: string + name: string + startDate: string + style: ObjectStyle + totalAggregationType: MetadataItem.totalAggregationType + uid: string + valueType: MetadataItem.valueType +} + +export namespace MetadataItem { + export enum aggregationType { + SUM = 'SUM', + AVERAGE = 'AVERAGE', + AVERAGE_SUM_ORG_UNIT = 'AVERAGE_SUM_ORG_UNIT', + LAST = 'LAST', + LAST_AVERAGE_ORG_UNIT = 'LAST_AVERAGE_ORG_UNIT', + LAST_LAST_ORG_UNIT = 'LAST_LAST_ORG_UNIT', + LAST_IN_PERIOD = 'LAST_IN_PERIOD', + LAST_IN_PERIOD_AVERAGE_ORG_UNIT = 'LAST_IN_PERIOD_AVERAGE_ORG_UNIT', + FIRST = 'FIRST', + FIRST_AVERAGE_ORG_UNIT = 'FIRST_AVERAGE_ORG_UNIT', + FIRST_FIRST_ORG_UNIT = 'FIRST_FIRST_ORG_UNIT', + COUNT = 'COUNT', + STDDEV = 'STDDEV', + VARIANCE = 'VARIANCE', + MIN = 'MIN', + MAX = 'MAX', + MIN_SUM_ORG_UNIT = 'MIN_SUM_ORG_UNIT', + MAX_SUM_ORG_UNIT = 'MAX_SUM_ORG_UNIT', + NONE = 'NONE', + CUSTOM = 'CUSTOM', + DEFAULT = 'DEFAULT', + } + + export enum dimensionItemType { + DATA_ELEMENT = 'DATA_ELEMENT', + DATA_ELEMENT_OPERAND = 'DATA_ELEMENT_OPERAND', + INDICATOR = 'INDICATOR', + REPORTING_RATE = 'REPORTING_RATE', + PROGRAM_DATA_ELEMENT = 'PROGRAM_DATA_ELEMENT', + PROGRAM_ATTRIBUTE = 'PROGRAM_ATTRIBUTE', + PROGRAM_INDICATOR = 'PROGRAM_INDICATOR', + PERIOD = 'PERIOD', + ORGANISATION_UNIT = 'ORGANISATION_UNIT', + CATEGORY_OPTION = 'CATEGORY_OPTION', + OPTION_GROUP = 'OPTION_GROUP', + DATA_ELEMENT_GROUP = 'DATA_ELEMENT_GROUP', + ORGANISATION_UNIT_GROUP = 'ORGANISATION_UNIT_GROUP', + CATEGORY_OPTION_GROUP = 'CATEGORY_OPTION_GROUP', + EXPRESSION_DIMENSION_ITEM = 'EXPRESSION_DIMENSION_ITEM', + SUBEXPRESSION_DIMENSION_ITEM = 'SUBEXPRESSION_DIMENSION_ITEM', + } + + export enum dimensionType { + DATA_X = 'DATA_X', + PROGRAM_DATA_ELEMENT = 'PROGRAM_DATA_ELEMENT', + PROGRAM_ATTRIBUTE = 'PROGRAM_ATTRIBUTE', + PROGRAM_INDICATOR = 'PROGRAM_INDICATOR', + DATA_COLLAPSED = 'DATA_COLLAPSED', + CATEGORY_OPTION_COMBO = 'CATEGORY_OPTION_COMBO', + ATTRIBUTE_OPTION_COMBO = 'ATTRIBUTE_OPTION_COMBO', + PERIOD = 'PERIOD', + ORGANISATION_UNIT = 'ORGANISATION_UNIT', + CATEGORY_OPTION_GROUP_SET = 'CATEGORY_OPTION_GROUP_SET', + DATA_ELEMENT_GROUP_SET = 'DATA_ELEMENT_GROUP_SET', + ORGANISATION_UNIT_GROUP_SET = 'ORGANISATION_UNIT_GROUP_SET', + ORGANISATION_UNIT_GROUP = 'ORGANISATION_UNIT_GROUP', + CATEGORY = 'CATEGORY', + OPTION_GROUP_SET = 'OPTION_GROUP_SET', + VALIDATION_RULE = 'VALIDATION_RULE', + STATIC = 'STATIC', + ORGANISATION_UNIT_LEVEL = 'ORGANISATION_UNIT_LEVEL', + } + + export enum totalAggregationType { + SUM = 'SUM', + AVERAGE = 'AVERAGE', + } + + export enum valueType { + TEXT = 'TEXT', + LONG_TEXT = 'LONG_TEXT', + MULTI_TEXT = 'MULTI_TEXT', + LETTER = 'LETTER', + PHONE_NUMBER = 'PHONE_NUMBER', + EMAIL = 'EMAIL', + BOOLEAN = 'BOOLEAN', + TRUE_ONLY = 'TRUE_ONLY', + DATE = 'DATE', + DATETIME = 'DATETIME', + TIME = 'TIME', + NUMBER = 'NUMBER', + UNIT_INTERVAL = 'UNIT_INTERVAL', + PERCENTAGE = 'PERCENTAGE', + INTEGER = 'INTEGER', + INTEGER_POSITIVE = 'INTEGER_POSITIVE', + INTEGER_NEGATIVE = 'INTEGER_NEGATIVE', + INTEGER_ZERO_OR_POSITIVE = 'INTEGER_ZERO_OR_POSITIVE', + TRACKER_ASSOCIATE = 'TRACKER_ASSOCIATE', + USERNAME = 'USERNAME', + COORDINATE = 'COORDINATE', + ORGANISATION_UNIT = 'ORGANISATION_UNIT', + REFERENCE = 'REFERENCE', + AGE = 'AGE', + URL = 'URL', + FILE_RESOURCE = 'FILE_RESOURCE', + IMAGE = 'IMAGE', + GEOJSON = 'GEOJSON', + } +} + +export type MetadataProposeParams = { + change: Record + comment: string + targetId: string +} + +export type MetadataSyncJobParameters = { + dataValuesPageSize: number + eventProgramPageSize: number + trackerProgramPageSize: number +} + +export type MetadataVersion = { + access: Access + attributeValues: Array + code: string + created: string + createdBy: User + displayName: string + favorite: boolean + favorites: Array + hashCode: string + href: string + id: string + importDate: string + lastUpdated: string + lastUpdatedBy: User + name: string + sharing: Sharing + translations: Array + type: MetadataVersion.type + user: User +} + +export namespace MetadataVersion { + export enum type { + BEST_EFFORT = 'BEST_EFFORT', + ATOMIC = 'ATOMIC', + } +} + +export type MethodAllowedList = { + allowedMethods: Array + type: string +} + +export type MinMaxValueDto = { + categoryOptionCombo: UID_CategoryOptionCombo + dataElement: UID_DataElement + maxValue: number + minValue: number + orgUnit: UID_OrganisationUnit +} + +export type MinMaxValueParams = { + dataSets: Array + organisationUnit: string +} + +export type MonitoringJobParameters = { + persistResults: boolean + relativeEnd: number + relativeStart: number + sendNotifications: boolean + validationRuleGroups: Array> +} + +export type Node = { + children: Array + collection: boolean + comment: string + complex: boolean + metadata: boolean + name: string + namespace: string + order: number + parent: Node + property: Property + simple: boolean + type: Node.type + unorderedChildren: Array +} + +export namespace Node { + export enum type { + SIMPLE = 'SIMPLE', + COMPLEX = 'COMPLEX', + COLLECTION = 'COLLECTION', + } +} + +export type Note = { + lastUpdated: string + lastUpdatedBy: UserInfoSnapshot + note: string + storedBy: string + storedDate: string + value: string +} + +export type Notification = { + category: Notification.category + completed: boolean + data: Record + dataType: Notification.dataType + id: string + level: Notification.level + message: string + time: string + uid: string +} + +export namespace Notification { + export enum category { + DATA_STATISTICS = 'DATA_STATISTICS', + DATA_INTEGRITY = 'DATA_INTEGRITY', + RESOURCE_TABLE = 'RESOURCE_TABLE', + ANALYTICS_TABLE = 'ANALYTICS_TABLE', + CONTINUOUS_ANALYTICS_TABLE = 'CONTINUOUS_ANALYTICS_TABLE', + DATA_SYNC = 'DATA_SYNC', + TRACKER_PROGRAMS_DATA_SYNC = 'TRACKER_PROGRAMS_DATA_SYNC', + EVENT_PROGRAMS_DATA_SYNC = 'EVENT_PROGRAMS_DATA_SYNC', + FILE_RESOURCE_CLEANUP = 'FILE_RESOURCE_CLEANUP', + IMAGE_PROCESSING = 'IMAGE_PROCESSING', + META_DATA_SYNC = 'META_DATA_SYNC', + AGGREGATE_DATA_EXCHANGE = 'AGGREGATE_DATA_EXCHANGE', + SMS_SEND = 'SMS_SEND', + SEND_SCHEDULED_MESSAGE = 'SEND_SCHEDULED_MESSAGE', + PROGRAM_NOTIFICATIONS = 'PROGRAM_NOTIFICATIONS', + VALIDATION_RESULTS_NOTIFICATION = 'VALIDATION_RESULTS_NOTIFICATION', + CREDENTIALS_EXPIRY_ALERT = 'CREDENTIALS_EXPIRY_ALERT', + MONITORING = 'MONITORING', + PUSH_ANALYSIS = 'PUSH_ANALYSIS', + TRACKER_SEARCH_OPTIMIZATION = 'TRACKER_SEARCH_OPTIMIZATION', + PREDICTOR = 'PREDICTOR', + DATA_SET_NOTIFICATION = 'DATA_SET_NOTIFICATION', + REMOVE_USED_OR_EXPIRED_RESERVED_VALUES = 'REMOVE_USED_OR_EXPIRED_RESERVED_VALUES', + TRACKER_IMPORT_JOB = 'TRACKER_IMPORT_JOB', + TRACKER_IMPORT_NOTIFICATION_JOB = 'TRACKER_IMPORT_NOTIFICATION_JOB', + TRACKER_IMPORT_RULE_ENGINE_JOB = 'TRACKER_IMPORT_RULE_ENGINE_JOB', + MATERIALIZED_SQL_VIEW_UPDATE = 'MATERIALIZED_SQL_VIEW_UPDATE', + LOCK_EXCEPTION_CLEANUP = 'LOCK_EXCEPTION_CLEANUP', + LEADER_ELECTION = 'LEADER_ELECTION', + LEADER_RENEWAL = 'LEADER_RENEWAL', + COMPLETE_DATA_SET_REGISTRATION_IMPORT = 'COMPLETE_DATA_SET_REGISTRATION_IMPORT', + DATAVALUE_IMPORT_INTERNAL = 'DATAVALUE_IMPORT_INTERNAL', + METADATA_IMPORT = 'METADATA_IMPORT', + DATAVALUE_IMPORT = 'DATAVALUE_IMPORT', + GEOJSON_IMPORT = 'GEOJSON_IMPORT', + EVENT_IMPORT = 'EVENT_IMPORT', + ENROLLMENT_IMPORT = 'ENROLLMENT_IMPORT', + TEI_IMPORT = 'TEI_IMPORT', + DISABLE_INACTIVE_USERS = 'DISABLE_INACTIVE_USERS', + ACCOUNT_EXPIRY_ALERT = 'ACCOUNT_EXPIRY_ALERT', + SYSTEM_VERSION_UPDATE_CHECK = 'SYSTEM_VERSION_UPDATE_CHECK', + TEST = 'TEST', + MOCK = 'MOCK', + GML_IMPORT = 'GML_IMPORT', + ANALYTICSTABLE_UPDATE = 'ANALYTICSTABLE_UPDATE', + PROGRAM_DATA_SYNC = 'PROGRAM_DATA_SYNC', + } + + export enum dataType { + PARAMETERS = 'PARAMETERS', + } + + export enum level { + OFF = 'OFF', + DEBUG = 'DEBUG', + LOOP = 'LOOP', + INFO = 'INFO', + WARN = 'WARN', + ERROR = 'ERROR', + } +} + +export type ObjectCount = { + objectCounts: Record +} + +export type ObjectReport = { + displayName: string + errorReports: Array + index: number + klass: string + uid: string +} + +export type ObjectStyle = { + color: string + icon: string +} + +export type ObjectValueTypeRenderingOption = { + clazz: string + hasOptionSet: boolean + renderingTypes: Array< + | 'DEFAULT' + | 'DROPDOWN' + | 'VERTICAL_RADIOBUTTONS' + | 'HORIZONTAL_RADIOBUTTONS' + | 'VERTICAL_CHECKBOXES' + | 'HORIZONTAL_CHECKBOXES' + | 'SHARED_HEADER_RADIOBUTTONS' + | 'ICONS_AS_BUTTONS' + | 'SPINNER' + | 'ICON' + | 'TOGGLE' + | 'VALUE' + | 'SLIDER' + | 'LINEAR_SCALE' + | 'AUTOCOMPLETE' + | 'QR_CODE' + | 'BAR_CODE' + | 'GS1_DATAMATRIX' + | 'CANVAS' + > + valueType: ObjectValueTypeRenderingOption.valueType +} + +export namespace ObjectValueTypeRenderingOption { + export enum valueType { + TEXT = 'TEXT', + LONG_TEXT = 'LONG_TEXT', + MULTI_TEXT = 'MULTI_TEXT', + LETTER = 'LETTER', + PHONE_NUMBER = 'PHONE_NUMBER', + EMAIL = 'EMAIL', + BOOLEAN = 'BOOLEAN', + TRUE_ONLY = 'TRUE_ONLY', + DATE = 'DATE', + DATETIME = 'DATETIME', + TIME = 'TIME', + NUMBER = 'NUMBER', + UNIT_INTERVAL = 'UNIT_INTERVAL', + PERCENTAGE = 'PERCENTAGE', + INTEGER = 'INTEGER', + INTEGER_POSITIVE = 'INTEGER_POSITIVE', + INTEGER_NEGATIVE = 'INTEGER_NEGATIVE', + INTEGER_ZERO_OR_POSITIVE = 'INTEGER_ZERO_OR_POSITIVE', + TRACKER_ASSOCIATE = 'TRACKER_ASSOCIATE', + USERNAME = 'USERNAME', + COORDINATE = 'COORDINATE', + ORGANISATION_UNIT = 'ORGANISATION_UNIT', + REFERENCE = 'REFERENCE', + AGE = 'AGE', + URL = 'URL', + FILE_RESOURCE = 'FILE_RESOURCE', + IMAGE = 'IMAGE', + GEOJSON = 'GEOJSON', + } +} + +export type Option = { + access: Access + attributeValues: Array + code: string + created: string + createdBy: User + description: string + displayDescription: string + displayFormName: string + displayName: string + displayShortName: string + favorite: boolean + favorites: Array + formName: string + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + name: string + optionSet: OptionSet + sharing: Sharing + shortName: string + sortOrder: number + style: ObjectStyle + translations: Array + user: User +} + +export type OptionGroup = { + access: Access + aggregationType: OptionGroup.aggregationType + attributeValues: Array + code: string + created: string + createdBy: User + description: string + dimensionItem: string + displayDescription: string + displayFormName: string + displayName: string + displayShortName: string + favorite: boolean + favorites: Array + formName: string + href: string + id: string + lastUpdated: string + lastUpdatedBy: User + legendSet: LegendSet + legendSets: Array + name: string + optionSet: OptionSet + options: Array