@openfn/language-dhis2 7.1.2 → 8.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/dist/index.cjs +4 -5
- package/dist/index.js +4 -6
- package/package.json +1 -1
- package/types/Adaptor.d.ts +1 -1
package/dist/index.cjs
CHANGED
|
@@ -191,7 +191,7 @@ async function request(configuration, requestData) {
|
|
|
191
191
|
|
|
192
192
|
// src/meta/helper.js
|
|
193
193
|
var createHelper = (configuration = {}) => {
|
|
194
|
-
const { username, password } = configuration;
|
|
194
|
+
const { username, password, hostUrl } = configuration;
|
|
195
195
|
const get3 = (url) => (0, import_axios.default)({
|
|
196
196
|
url,
|
|
197
197
|
headers: { "Content-Type": "application/json" },
|
|
@@ -218,14 +218,14 @@ var createHelper = (configuration = {}) => {
|
|
|
218
218
|
};
|
|
219
219
|
const getOrgUnits = async () => {
|
|
220
220
|
const url = prefixVersionToPath(configuration, {}, "organisationUnits");
|
|
221
|
-
const response = await get3(url);
|
|
221
|
+
const response = await get3(`${hostUrl}${url}`);
|
|
222
222
|
return response.data;
|
|
223
223
|
};
|
|
224
224
|
const getPrograms = () => {
|
|
225
225
|
};
|
|
226
226
|
const getTrackedEntityTypes = async () => {
|
|
227
227
|
const url = prefixVersionToPath(configuration, {}, "trackedEntityTypes");
|
|
228
|
-
const response = await get3(url);
|
|
228
|
+
const response = await get3(`${hostUrl}${url}`);
|
|
229
229
|
return response.data;
|
|
230
230
|
};
|
|
231
231
|
const getAttributes = async () => {
|
|
@@ -234,7 +234,7 @@ var createHelper = (configuration = {}) => {
|
|
|
234
234
|
{},
|
|
235
235
|
"trackedEntityAttributes"
|
|
236
236
|
);
|
|
237
|
-
const response = await get3(url);
|
|
237
|
+
const response = await get3(`${hostUrl}${url}`);
|
|
238
238
|
return response.data;
|
|
239
239
|
};
|
|
240
240
|
return {
|
|
@@ -302,7 +302,6 @@ __export(Adaptor_exports, {
|
|
|
302
302
|
fnIf: () => import_language_common3.fnIf,
|
|
303
303
|
get: () => get,
|
|
304
304
|
group: () => import_language_common3.group,
|
|
305
|
-
http: () => import_language_common3.http,
|
|
306
305
|
lastReferenceValue: () => import_language_common3.lastReferenceValue,
|
|
307
306
|
map: () => import_language_common3.map,
|
|
308
307
|
merge: () => import_language_common3.merge,
|
package/dist/index.js
CHANGED
|
@@ -144,7 +144,7 @@ async function request(configuration, requestData) {
|
|
|
144
144
|
|
|
145
145
|
// src/meta/helper.js
|
|
146
146
|
var createHelper = (configuration = {}) => {
|
|
147
|
-
const { username, password } = configuration;
|
|
147
|
+
const { username, password, hostUrl } = configuration;
|
|
148
148
|
const get3 = (url) => axios({
|
|
149
149
|
url,
|
|
150
150
|
headers: { "Content-Type": "application/json" },
|
|
@@ -171,14 +171,14 @@ var createHelper = (configuration = {}) => {
|
|
|
171
171
|
};
|
|
172
172
|
const getOrgUnits = async () => {
|
|
173
173
|
const url = prefixVersionToPath(configuration, {}, "organisationUnits");
|
|
174
|
-
const response = await get3(url);
|
|
174
|
+
const response = await get3(`${hostUrl}${url}`);
|
|
175
175
|
return response.data;
|
|
176
176
|
};
|
|
177
177
|
const getPrograms = () => {
|
|
178
178
|
};
|
|
179
179
|
const getTrackedEntityTypes = async () => {
|
|
180
180
|
const url = prefixVersionToPath(configuration, {}, "trackedEntityTypes");
|
|
181
|
-
const response = await get3(url);
|
|
181
|
+
const response = await get3(`${hostUrl}${url}`);
|
|
182
182
|
return response.data;
|
|
183
183
|
};
|
|
184
184
|
const getAttributes = async () => {
|
|
@@ -187,7 +187,7 @@ var createHelper = (configuration = {}) => {
|
|
|
187
187
|
{},
|
|
188
188
|
"trackedEntityAttributes"
|
|
189
189
|
);
|
|
190
|
-
const response = await get3(url);
|
|
190
|
+
const response = await get3(`${hostUrl}${url}`);
|
|
191
191
|
return response.data;
|
|
192
192
|
};
|
|
193
193
|
return {
|
|
@@ -255,7 +255,6 @@ __export(Adaptor_exports, {
|
|
|
255
255
|
fnIf: () => fnIf,
|
|
256
256
|
get: () => get,
|
|
257
257
|
group: () => group,
|
|
258
|
-
http: () => http,
|
|
259
258
|
lastReferenceValue: () => lastReferenceValue,
|
|
260
259
|
map: () => map,
|
|
261
260
|
merge: () => merge,
|
|
@@ -278,7 +277,6 @@ import {
|
|
|
278
277
|
fn,
|
|
279
278
|
fnIf,
|
|
280
279
|
group,
|
|
281
|
-
http,
|
|
282
280
|
lastReferenceValue,
|
|
283
281
|
map,
|
|
284
282
|
merge,
|
package/package.json
CHANGED
package/types/Adaptor.d.ts
CHANGED
|
@@ -365,4 +365,4 @@ export type RequestOptions = {
|
|
|
365
365
|
*/
|
|
366
366
|
apiVersion?: string;
|
|
367
367
|
};
|
|
368
|
-
export { alterState, as, cursor, dataPath, dataValue, dateFns, each, field, fields, fn, fnIf, group,
|
|
368
|
+
export { alterState, as, cursor, dataPath, dataValue, dateFns, each, field, fields, fn, fnIf, group, lastReferenceValue, map, merge, sourceValue } from "@openfn/language-common";
|