@dizmo/dcs-client-library 4.0.1 → 4.1.1
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/modules/needs.d.ts
CHANGED
|
@@ -2,11 +2,13 @@ import { CreateNeed, Need, UpdateNeed, UpdateResult } from "../types/types";
|
|
|
2
2
|
declare function createNeed(need: CreateNeed): Promise<UpdateResult>;
|
|
3
3
|
declare function deleteNeed(needId: string): Promise<void>;
|
|
4
4
|
declare function updateNeed(needId: string, needUpdate: UpdateNeed): Promise<void>;
|
|
5
|
-
declare function
|
|
5
|
+
declare function getNeed(needId: string): Promise<Need>;
|
|
6
|
+
declare function getNeeds(type?: string): Promise<Need[]>;
|
|
6
7
|
export declare const needs: {
|
|
7
8
|
createNeed: typeof createNeed;
|
|
8
9
|
deleteNeed: typeof deleteNeed;
|
|
9
10
|
updateNeed: typeof updateNeed;
|
|
11
|
+
getNeed: typeof getNeed;
|
|
10
12
|
getNeeds: typeof getNeeds;
|
|
11
13
|
};
|
|
12
14
|
export {};
|
package/dist/modules/needs.js
CHANGED
|
@@ -20,10 +20,15 @@ async function updateNeed(needId, needUpdate) {
|
|
|
20
20
|
const requestOptions = getRequestOptions("PUT", token, needUpdate);
|
|
21
21
|
await getData(`/needs/need/${needId}`, requestOptions);
|
|
22
22
|
}
|
|
23
|
+
async function getNeed(needId) {
|
|
24
|
+
validateString(needId, "Function: getNeed, Value: needId");
|
|
25
|
+
const token = await getToken();
|
|
26
|
+
const requestOptions = getRequestOptions("GET", token);
|
|
27
|
+
return (await getData(`/needs/need/${needId}`, requestOptions));
|
|
28
|
+
}
|
|
23
29
|
async function getNeeds(type) {
|
|
24
|
-
validateString(type, "Function: getNeeds, Value: type");
|
|
25
30
|
const token = await getToken();
|
|
26
|
-
const body = { type };
|
|
31
|
+
const body = { ...(type ? { type } : {}) };
|
|
27
32
|
const requestOptions = getRequestOptions("POST", token, body);
|
|
28
33
|
return (await getData(`/needs/getneeds`, requestOptions));
|
|
29
34
|
}
|
|
@@ -31,5 +36,6 @@ export const needs = {
|
|
|
31
36
|
createNeed,
|
|
32
37
|
deleteNeed,
|
|
33
38
|
updateNeed,
|
|
39
|
+
getNeed,
|
|
34
40
|
getNeeds
|
|
35
41
|
};
|
package/dist/types/types.d.ts
CHANGED