shred-api-client 2.0.7 → 2.0.8
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.
|
@@ -9,6 +9,7 @@ declare class ProjectAPI implements Project.IAPI {
|
|
|
9
9
|
permissions: {
|
|
10
10
|
isEligibleForFreeProject: (ctx: Context) => Promise<boolean>;
|
|
11
11
|
};
|
|
12
|
+
getNext(ctx: Context, userId: string): Promise<Project.Entity | null>;
|
|
12
13
|
getUserHistory(context: Context, userId: string): Promise<Core.APIResponse<Project.Entity>>;
|
|
13
14
|
find(context: Context, projectId: string): Promise<Project.Entity>;
|
|
14
15
|
create(context: Context, createData: Project.ProjectCreation): Promise<Project.Entity>;
|
package/dist/api/Project.api.js
CHANGED
|
@@ -41,6 +41,12 @@ class ProjectAPI {
|
|
|
41
41
|
this.env = env;
|
|
42
42
|
this.clientHTTP = new HTTPClient_1.default();
|
|
43
43
|
}
|
|
44
|
+
async getNext(ctx, userId) {
|
|
45
|
+
const endpointData = Project.Endpoints.GetNext;
|
|
46
|
+
const endpoint = endpointData.uri.replace(":userId", userId);
|
|
47
|
+
const data = await this.clientHTTP.makeRequest(this.env, endpoint, endpointData.method, null, ctx);
|
|
48
|
+
return data;
|
|
49
|
+
}
|
|
44
50
|
async getUserHistory(context, userId) {
|
|
45
51
|
const endpointData = Project.Endpoints.GetUserHistory;
|
|
46
52
|
const endpoint = endpointData.uri.replace(":userId", userId);
|
|
@@ -13,6 +13,7 @@ export interface IAPI {
|
|
|
13
13
|
deny: (context: Context, projectId: string, denyFeedback: string, categories?: string[]) => Promise<boolean>;
|
|
14
14
|
unschedule: (context: Context, projectId: string) => Promise<boolean>;
|
|
15
15
|
rollback: (context: Context, projectId: string) => Promise<boolean>;
|
|
16
|
+
getNext: (context: Context, userId: string) => Promise<Project | null>;
|
|
16
17
|
getUserHistory: (context: Context, userId: string) => Promise<Core.APIResponse<Project>>;
|
|
17
18
|
permissions: {
|
|
18
19
|
isEligibleForFreeProject(context: Context): Promise<boolean>;
|
|
@@ -23,6 +24,10 @@ export declare const Endpoints: {
|
|
|
23
24
|
uri: string;
|
|
24
25
|
method: string;
|
|
25
26
|
};
|
|
27
|
+
GetNext: {
|
|
28
|
+
uri: string;
|
|
29
|
+
method: string;
|
|
30
|
+
};
|
|
26
31
|
CreateProject: {
|
|
27
32
|
uri: string;
|
|
28
33
|
method: string;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Endpoints = void 0;
|
|
4
4
|
exports.Endpoints = {
|
|
5
5
|
List: { uri: "/projects/list", method: "GET" },
|
|
6
|
+
GetNext: { uri: "/projects/:userId/next", method: "GET" },
|
|
6
7
|
CreateProject: { uri: "/projects/create", method: "POST" },
|
|
7
8
|
FindOne: { uri: `/projects/:projectId/`, method: "GET" },
|
|
8
9
|
GetGoals: { uri: `/projects/goals/list/`, method: "GET" },
|