@openfn/language-dhis2 2.0.11 → 3.0.0-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -4
- package/ast.json +270 -2458
- package/lib/Adaptor.js +469 -1533
- package/lib/Client.js +32 -0
- package/lib/Utils.js +124 -175
- package/lib/index.js +4 -6
- package/node_modules/@openfn/language-common/node_modules/axios/package.json +20 -0
- package/node_modules/@openfn/language-common/node_modules/follow-redirects/package.json +20 -0
- package/node_modules/@openfn/language-common/node_modules/jsonpath-plus/package.json +20 -0
- package/node_modules/@openfn/language-common/node_modules/lodash/package.json +20 -0
- package/node_modules/@openfn/language-common/package.json +8 -4
- package/node_modules/axios/CHANGELOG.md +159 -8
- package/node_modules/axios/README.md +98 -6
- package/node_modules/axios/SECURITY.md +5 -0
- package/node_modules/axios/dist/axios.js +2101 -1582
- package/node_modules/axios/dist/axios.map +1 -1
- package/node_modules/axios/dist/axios.min.js +1 -2
- package/node_modules/axios/dist/axios.min.map +1 -1
- package/node_modules/axios/index.d.ts +76 -31
- package/node_modules/axios/lib/adapters/http.js +74 -14
- package/node_modules/axios/lib/adapters/xhr.js +66 -33
- package/node_modules/axios/lib/axios.js +6 -5
- package/node_modules/axios/lib/cancel/CancelToken.js +62 -0
- package/node_modules/axios/lib/core/Axios.js +60 -7
- package/node_modules/axios/lib/core/InterceptorManager.js +4 -2
- package/node_modules/axios/lib/core/README.md +1 -0
- package/node_modules/axios/lib/core/dispatchRequest.js +11 -3
- package/node_modules/axios/lib/core/enhanceError.js +2 -1
- package/node_modules/axios/lib/core/mergeConfig.js +50 -38
- package/node_modules/axios/lib/core/transformData.js +3 -1
- package/node_modules/axios/lib/defaults.js +48 -12
- package/node_modules/axios/lib/env/README.md +3 -0
- package/node_modules/axios/lib/env/data.js +3 -0
- package/node_modules/axios/lib/helpers/validator.js +82 -0
- package/node_modules/axios/lib/utils.js +1 -3
- package/node_modules/axios/package.json +37 -40
- package/node_modules/axios/tsconfig.json +14 -0
- package/node_modules/axios/tslint.json +6 -0
- package/node_modules/follow-redirects/README.md +1 -1
- package/node_modules/follow-redirects/debug.js +14 -8
- package/node_modules/follow-redirects/index.js +106 -41
- package/node_modules/follow-redirects/package.json +14 -17
- package/node_modules/lodash/package.json +2 -2
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Language DHIS2 [](https://travis-ci.org/OpenFn/language-dhis2)
|
|
2
2
|
|
|
3
|
-
Language Pack for building expressions and operations for working with
|
|
4
|
-
|
|
3
|
+
Language Pack for building expressions and operations for working with the
|
|
4
|
+
[DHIS2 API](http://dhis2.github.io/dhis2-docs/master/en/developer/html/dhis2_developer_manual.html).
|
|
5
5
|
|
|
6
6
|
## Documentation
|
|
7
7
|
|
|
@@ -38,7 +38,7 @@ fetchAnalytics({
|
|
|
38
38
|
outputIdScheme: 'UID',
|
|
39
39
|
},
|
|
40
40
|
});
|
|
41
|
-
|
|
41
|
+
```
|
|
42
42
|
|
|
43
43
|
## Tracked Entity API
|
|
44
44
|
|
|
@@ -174,4 +174,39 @@ Clone the repo, run `npm install`.
|
|
|
174
174
|
|
|
175
175
|
Run tests using `npm run test` or `npm run test:watch`
|
|
176
176
|
|
|
177
|
-
|
|
177
|
+
NB: There are two types of tests: unit tests and integration tests.
|
|
178
|
+
|
|
179
|
+
### Unit Tests
|
|
180
|
+
|
|
181
|
+
Unit tests allows to test the functionalities of the adaptor helper functions
|
|
182
|
+
such as:
|
|
183
|
+
|
|
184
|
+
> Does `create('events', payload)` perform a post request to the correct DHIS2
|
|
185
|
+
> API?
|
|
186
|
+
|
|
187
|
+
To run unit tests execute `npm run test` (they're the default tests).
|
|
188
|
+
|
|
189
|
+
Anytime a new functionality is added to the helper functions, more unit tests
|
|
190
|
+
needs to be added.
|
|
191
|
+
|
|
192
|
+
### End-to-end integration tests
|
|
193
|
+
|
|
194
|
+
Integration tests allow us to test the end-to-end behavior of the helper functions
|
|
195
|
+
and also to test the examples we provide via inline documentation.
|
|
196
|
+
|
|
197
|
+
For example with integration tests we answer the following question:
|
|
198
|
+
|
|
199
|
+
> Does `create('events', eventPayload)` actually create a new event in a live
|
|
200
|
+
> DHIS2 system?
|
|
201
|
+
|
|
202
|
+
To run integration tests, execute `npm run integration-test`. These
|
|
203
|
+
tests use network I/O and a public connection to a DHIS2 "play" server so their
|
|
204
|
+
timing and performance is unpredictable. Consider adding an increased timeout,
|
|
205
|
+
and modifying the orgUnit, program, etc., IDs set in `globalState`.
|
|
206
|
+
|
|
207
|
+
Anytime a new example is added in the documentation of a helper function, a new
|
|
208
|
+
integration test should be done.
|
|
209
|
+
|
|
210
|
+
### Build
|
|
211
|
+
|
|
212
|
+
Build the project using `npm run build`.
|