Skip to content

Commit 83d86e6

Browse files
authored
Merge pull request #1091 from OpenFn/epic/release-dhis2
Release: dhis2 7.0
2 parents 01aa657 + e7a1633 commit 83d86e6

19 files changed

Lines changed: 1704 additions & 1731 deletions

packages/common/test/util/http.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ describe('logResponse', () => {
143143
response.duration = 2;
144144
let originalLog;
145145
let consoleOutput = [];
146-
146+
147147
// Setup: Override console.log
148148
originalLog = console.log;
149149
console.log = (...args) => consoleOutput.push(args);

packages/dhis2/CHANGELOG.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,89 @@
11
# @openfn/language-dhis2
22

3+
## 7.0.0
4+
5+
This release of DHSI2 contains major breaking changes.
6+
7+
This release includes a major re-think of the main adaptor API, introducing new
8+
namespaces (tracker, http, util) to help organize functionality. Note that the
9+
main namespace contains `get()` and `create()`, which do not surface HTTP
10+
semantics, and `http.get()` and `http.post()`.
11+
12+
The intention is that most users can use the `get()`, `create()` and `tracker.*`
13+
APIs, with a HTTP abstraction as a fallback.
14+
15+
It also removes a dependency on the axios library (preferring undici, as used by
16+
other adaptors).
17+
18+
### Major Changes
19+
20+
- Remove axios.
21+
- Re-worked signatures for `get()`, `create()`, `update()` and `upsert()`.
22+
- The `discover()` function has been removed.
23+
- Many non-operation functions have moved to the `util.` namespace, including.
24+
`attr`, `dv`, `findAttributeValue`, and `findAttributeValueById`.
25+
- HTTP helper functions (like `post()`, `patch()`) have been moved into a clean
26+
new http namespace.
27+
28+
### Minor Changes
29+
30+
- dfe53ef: - Implement a new `tracker` namespace for `tracker.import()` and
31+
`tracker.export()` functions.
32+
33+
- Throw an error when `create('tracker')` is called.
34+
35+
- 5b73844: - Add importStrategy to query params for `create` and `update`
36+
37+
### Migration Guide
38+
39+
#### get ()
40+
41+
The `get` function has a new signature of `get(path, params)`. Note that the old
42+
options object and callback have been removed. If you need to set headers on
43+
your request, use `http.get()` instead.
44+
45+
For `path`, you can pass a resource type, like `"enrollments"`, or a path to a
46+
specific resource, like `tracker/trackedEntities/F8yKM85NbxW`.
47+
48+
If using the new tracker API, we recommend using the new tracker namespace.
49+
50+
#### create
51+
52+
The `create` function has a new signature of `create(path, data, params)`. Note
53+
that the old options object and callback have been removed. If you need to set
54+
headers on your request, use `http.post()` instead.
55+
56+
#### update
57+
58+
Callbacks have been removed from the update signature.
59+
60+
#### upsert
61+
62+
Callbacks have been removed from the upsert signature.
63+
64+
#### Utils
65+
66+
Some helper functions, which are not operations and cannot be called at the top
67+
level, have been moved to a `util` namespace.
68+
69+
Instead of this:
70+
71+
```
72+
fn((state) => {
73+
const value = findAttributeValue(state.data, 'first name')
74+
return state;
75+
})
76+
```
77+
78+
Do this:
79+
80+
```
81+
fn((state) => {
82+
const value = util.findAttributeValue(state.data, 'first name')
83+
return state;
84+
})
85+
```
86+
387
## 6.3.4 - 22 April 2025
488

589
### Patch Changes

0 commit comments

Comments
 (0)