@openfn/language-dhis2 3.2.1 → 3.2.2
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/ast.json +48 -0
- package/dist/index.cjs +47 -3
- package/dist/index.js +24 -2
- package/package.json +14 -10
- package/types/Adaptor.d.ts +789 -0
- package/types/Client.d.ts +11 -0
- package/types/Utils.d.ts +23 -0
- package/types/index.d.ts +3 -828
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The request client takes configuration from state and an axios request object
|
|
3
|
+
* then (1) logs the method and URL, (2) applies standard headers and auth
|
|
4
|
+
* before spreading the rest of the axios configuration, and (3) executes an
|
|
5
|
+
* axios request.
|
|
6
|
+
* @function
|
|
7
|
+
* @param {object} configuration - configuration must have a username and password
|
|
8
|
+
* @param {object} axiosRequest - the axiosRequest contains valid axios params: https://axios-http.com/docs/req_config
|
|
9
|
+
* @returns {Promise} a promise that will resolve to either a response object or an error object.
|
|
10
|
+
*/
|
|
11
|
+
export function request({ username, password }: object, axiosRequest: object): Promise<any>;
|
package/types/Utils.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export function buildUrl(urlString: any, hostUrl: any, apiVersion: any): string;
|
|
2
|
+
/**
|
|
3
|
+
* Determines the attribute name for a DHIS2 system ID given a resource type.
|
|
4
|
+
* @param {string} resourceType
|
|
5
|
+
* @returns {string}
|
|
6
|
+
*/
|
|
7
|
+
export function selectId(resourceType: string): string;
|
|
8
|
+
export function handleResponse(result: any, state: any, callback: any): any;
|
|
9
|
+
export function prettyJson(data: any): string;
|
|
10
|
+
export function nestArray(data: any, key: any): any;
|
|
11
|
+
export function generateUrl(configuration: any, options: any, resourceType: any, path?: any): string;
|
|
12
|
+
export namespace CONTENT_TYPES {
|
|
13
|
+
const xml: string;
|
|
14
|
+
const json: string;
|
|
15
|
+
const pdf: string;
|
|
16
|
+
const csv: string;
|
|
17
|
+
const xls: string;
|
|
18
|
+
}
|
|
19
|
+
export class Log {
|
|
20
|
+
static success(message: any): void;
|
|
21
|
+
static warn(message: any): void;
|
|
22
|
+
static error(message: any): void;
|
|
23
|
+
}
|