@longvansoftware/service-js-client 2.5.0 → 2.5.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.
@@ -4,3 +4,4 @@ export declare const GET_TYPE_LAB_SESSION: DocumentNode;
4
4
  export declare const GET_LAB_SESSIONS_BY_USER_ID: DocumentNode;
5
5
  export declare const GET_LAB_SESSIONS_BY_USER_ID_AND_ARTICLE_ID: DocumentNode;
6
6
  export declare const GET_LAB_SESSIONS_CHILL_BY_PARENT: DocumentNode;
7
+ export declare const GET_LAB_DOING_AND_DONE_BY_USERID: (fields?: string[]) => DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_LAB_SESSIONS_CHILL_BY_PARENT = exports.GET_LAB_SESSIONS_BY_USER_ID_AND_ARTICLE_ID = exports.GET_LAB_SESSIONS_BY_USER_ID = exports.GET_TYPE_LAB_SESSION = exports.GET_TEMPLATE_BY_ARTICLE_ID = void 0;
3
+ exports.GET_LAB_DOING_AND_DONE_BY_USERID = exports.GET_LAB_SESSIONS_CHILL_BY_PARENT = exports.GET_LAB_SESSIONS_BY_USER_ID_AND_ARTICLE_ID = exports.GET_LAB_SESSIONS_BY_USER_ID = exports.GET_TYPE_LAB_SESSION = exports.GET_TEMPLATE_BY_ARTICLE_ID = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  // Danh sách template của bài lab
6
6
  exports.GET_TEMPLATE_BY_ARTICLE_ID = (0, graphql_tag_1.gql) `
@@ -119,3 +119,13 @@ exports.GET_LAB_SESSIONS_CHILL_BY_PARENT = (0, graphql_tag_1.gql) `
119
119
  }
120
120
  }
121
121
  `;
122
+ const GET_LAB_DOING_AND_DONE_BY_USERID = (fields = []) => {
123
+ const fieldStr = fields.join("\n ");
124
+ const hasFields = fields.length > 0;
125
+ return (0, graphql_tag_1.gql) `
126
+ query getLabDoingAndDoneByUserId($partnerId: String!, $userId: String!) {
127
+ getLabDoingAndDoneByUserId(partnerId: $partnerId userId: $userId) ${hasFields ? `{ ${fieldStr} }` : ""}
128
+ }
129
+ `;
130
+ };
131
+ exports.GET_LAB_DOING_AND_DONE_BY_USERID = GET_LAB_DOING_AND_DONE_BY_USERID;
@@ -15,4 +15,5 @@ export declare class QuicklabService extends Service {
15
15
  updateTypeLabSession(labSessionId: string, typeLabSessionCode: string, userId: string): Promise<any>;
16
16
  getLabSessionsChillByParent(labSessionId: string, userId: string): Promise<any>;
17
17
  stopLabSessionForCustomer(labSessionId: string, userId: string, note: string): Promise<any>;
18
+ getLabDoingAndDoneByUserId(userId: string, fields: string[]): Promise<any>;
18
19
  }
@@ -193,5 +193,19 @@ class QuicklabService extends serviceSDK_1.Service {
193
193
  }
194
194
  });
195
195
  }
196
+ getLabDoingAndDoneByUserId(userId, fields) {
197
+ return __awaiter(this, void 0, void 0, function* () {
198
+ const query = (0, queries_1.GET_LAB_DOING_AND_DONE_BY_USERID)(fields);
199
+ const variables = { partnerId: this.orgId, userId };
200
+ try {
201
+ const response = yield this.graphqlQuery(query, variables);
202
+ return response.getLabDoingAndDoneByUserId;
203
+ }
204
+ catch (error) {
205
+ console.log(`Error in getLabDoingAndDoneByUserId : ${error}`);
206
+ throw error;
207
+ }
208
+ });
209
+ }
196
210
  }
197
211
  exports.QuicklabService = QuicklabService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "2.5.0",
3
+ "version": "2.5.1",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [