feat: regenerated generated types#955
Open
Chisomchima wants to merge 1 commit into
Open
Conversation
✅ Deploy Preview for dhis2-maintenance-app-beta ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.




Regenerate generated types from DHIS2 2.43 API
Closes DHIS2-21293
Summary
Regenerates
src/types/generated/models.tsfrom the DHIS2 stable-2-43-0 API usingBirkbjo/dhis2-open-api-ts. The new file grows from ~10,981 to ~16,045 lines, reflecting the expanded API surface in 2.43.All source files that depended on the old type shapes have been updated.
yarn check-typespasses with 0 errors and all 103 test suites pass.Key API changes in DHIS2 2.43 that required code updates
Namespace enums → standalone enums
The generator no longer wraps per-model enums in TypeScript namespaces. All usages of the pattern
ModelType.enumName.VALUEhave been replaced with standalone enum imports:DataElement.aggregationTypeAggregationTypeDataElement.valueTypeValueTypeDataElement.domainTypeDataElementDomainCategory.dataDimensionTypeDataDimensionTypeProgramRuleVariable.programRuleVariableSourceTypeProgramRuleVariableSourceTypeProgramRuleVariable.valueTypeValueTypeProgramRuleAction.programRuleActionTypeProgramRuleActionTypeAnalyticsTableHook.phaseAnalyticsTablePhaseAnalyticsTableHook.analyticsTableTypeAnalyticsTableTypeAnalyticsTableHook.resourceTableTypeResourceTableTypeSqlView.typeSqlViewTypeSqlView.cacheStrategyCacheStrategyExpression.missingValueStrategyMissingValueStrategyProgramNotificationTemplate.notificationTriggerNotificationTriggerProgramNotificationTemplate.notificationRecipientProgramNotificationRecipientDataSetNotificationTemplate.*DataSetNotificationTrigger,DataSetNotificationRecipient,SendStrategyValidationRule.operatorOperatorValidationRule.importanceImportanceProgram.programTypeProgramTypeAnalyticsPeriodBoundary.analyticsPeriodBoundaryTypeAnalyticsPeriodBoundaryTypeRenamed or removed types
ProgramTrackedEntityAttributeremoved — a local type is now defined in files that need itSmsConfigurationremoved — redefined locally insystemSettings.tsusing the existing gateway typesIdentifiableObjectchanged from{ id: string }(minimal) to a full model;useOnSubmitgeneric constraints updated to avoid breakageErrorReportLegacyremoved —fixedModels.tsnow definesErrorReportinlineRelationshipConstraint.relationshipEntity→RelationshipEntityAttributeValueschanged fromArray<AttributeValue>to{ empty: boolean }Other notable changes
TRACKER_ASSOCIATEremoved fromValueType; affected comparison inTrackedEntityAttributeFormFieldsreplaced withfalseDataInputPeriod.periodis now optional with type{ id: string }(nonamefield); null-checks addedSharingno longer hasexternalfield;SharingSettings.externalmade optionalSystemSettingsnow exists in both generated and hand-written types; ambiguity resolved inmodels.tsvia explicit re-export with an ESLint suppression commentHow to re-run the generation
utility.tsandpickWithFieldFilters.tsinsrc/types/generated/are hand-written and should not be overwritten.Test plan
yarn check-types— 0 errorsyarn test— 103/103 suites passyarn format— no lint or formatting errors