@longvansoftware/service-js-client 2.7.2 → 2.7.4

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.
@@ -78,11 +78,15 @@ exports.GET_ACCESS_TOKEN_BY_OTP = (0, graphql_tag_1.gql) `
78
78
  $otpCode: String!
79
79
  $phone: String!
80
80
  $channelType: String
81
+ $appId: String
82
+ $deviceId: String
81
83
  ) {
82
84
  getAccessTokenByOTP(
83
85
  otpCode: $otpCode
84
86
  phone: $phone
85
87
  channelType: $channelType
88
+ appId: $appId
89
+ deviceId: $deviceId
86
90
  )
87
91
  }
88
92
  `;
@@ -141,6 +145,8 @@ exports.LOGIN_GOOGLE = (0, graphql_tag_1.gql) `
141
145
  $redirectUrl: String!
142
146
  $redirectUrlError: String
143
147
  $serviceOperator: String
148
+ $appId: String
149
+ $deviceId: String
144
150
  ) {
145
151
  loginGoogle(
146
152
  orgId: $orgId
@@ -148,6 +154,8 @@ exports.LOGIN_GOOGLE = (0, graphql_tag_1.gql) `
148
154
  redirectUrl: $redirectUrl
149
155
  redirectUrlError: $redirectUrlError
150
156
  serviceOperator: $serviceOperator
157
+ appId: $appId
158
+ deviceId: $deviceId
151
159
  )
152
160
  }
153
161
  `;
@@ -158,6 +166,8 @@ exports.LOGIN_FACEBOOK = (0, graphql_tag_1.gql) `
158
166
  $redirectUrl: String!
159
167
  $redirectUrlError: String
160
168
  $serviceOperator: String
169
+ $appId: String
170
+ $deviceId: String
161
171
  ) {
162
172
  loginFacebook(
163
173
  orgId: $orgId
@@ -165,6 +175,8 @@ exports.LOGIN_FACEBOOK = (0, graphql_tag_1.gql) `
165
175
  redirectUrl: $redirectUrl
166
176
  redirectUrlError: $redirectUrlError
167
177
  serviceOperator: $serviceOperator
178
+ appId: $appId
179
+ deviceId: $deviceId
168
180
  )
169
181
  }
170
182
  `;
@@ -175,6 +187,8 @@ exports.LOGIN_ZALO = (0, graphql_tag_1.gql) `
175
187
  $redirectUrl: String!
176
188
  $redirectUrlError: String
177
189
  $serviceOperator: String
190
+ $appId: String
191
+ $deviceId: String
178
192
  ) {
179
193
  loginZalo(
180
194
  orgId: $orgId
@@ -182,6 +196,8 @@ exports.LOGIN_ZALO = (0, graphql_tag_1.gql) `
182
196
  redirectUrl: $redirectUrl
183
197
  redirectUrlError: $redirectUrlError
184
198
  serviceOperator: $serviceOperator
199
+ appId: $appId
200
+ deviceId: $deviceId
185
201
  )
186
202
  }
187
203
  `;
@@ -6,3 +6,7 @@ export declare const UPDATE_END_TIME_LAB_SESSION: DocumentNode;
6
6
  export declare const STOP_LAB_SESSION: DocumentNode;
7
7
  export declare const UPDATE_TYPE_LAB_SESSION: DocumentNode;
8
8
  export declare const STOP_LAB_SESSION_FOR_CUSTOMER: DocumentNode;
9
+ export declare const CREATE_COMPUTING_LAB_BY_TEMPLATE_ID: (fields?: string[]) => DocumentNode;
10
+ export declare const REMOVE_COMPUTING_LAB: DocumentNode;
11
+ export declare const OFF_COMPUTING_LAB: DocumentNode;
12
+ export declare const ON_COMPUTING_LAB: DocumentNode;
@@ -1,21 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.STOP_LAB_SESSION_FOR_CUSTOMER = exports.UPDATE_TYPE_LAB_SESSION = exports.STOP_LAB_SESSION = exports.UPDATE_END_TIME_LAB_SESSION = exports.CREATE_LAB_SESSION_BY_COMPUTING_ID = exports.CREATE_LAB_SESSION_BY_LAB_SESSION_ID = exports.CREATE_LAB_SESSION_BY_TEMPLATE_ID = void 0;
3
+ exports.ON_COMPUTING_LAB = exports.OFF_COMPUTING_LAB = exports.REMOVE_COMPUTING_LAB = exports.CREATE_COMPUTING_LAB_BY_TEMPLATE_ID = exports.STOP_LAB_SESSION_FOR_CUSTOMER = exports.UPDATE_TYPE_LAB_SESSION = exports.STOP_LAB_SESSION = exports.UPDATE_END_TIME_LAB_SESSION = exports.CREATE_LAB_SESSION_BY_COMPUTING_ID = exports.CREATE_LAB_SESSION_BY_LAB_SESSION_ID = exports.CREATE_LAB_SESSION_BY_TEMPLATE_ID = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  // Tạo phiên thực hành từ template
6
6
  exports.CREATE_LAB_SESSION_BY_TEMPLATE_ID = (0, graphql_tag_1.gql) `
7
- mutation CreateLabSessionByTemplateId(
8
- $templateId: String!
9
- $userId: String!
10
- $articleId: String!
11
- $typeLabSessionCode: String!
12
- ) {
13
- createLabSessionByTemplateId(
14
- templateId: $templateId
15
- userId: $userId
16
- articleId: $articleId
17
- typeLabSessionCode: $typeLabSessionCode
18
- ) {
7
+ mutation CreateLabSessionByTemplateId($templateId: String!, $userId: String!, $articleId: String!, $typeLabSessionCode: String!) {
8
+ createLabSessionByTemplateId(templateId: $templateId, userId: $userId, articleId: $articleId, typeLabSessionCode: $typeLabSessionCode) {
19
9
  labSessionId
20
10
  userId
21
11
  typeLabSession
@@ -44,16 +34,8 @@ exports.CREATE_LAB_SESSION_BY_TEMPLATE_ID = (0, graphql_tag_1.gql) `
44
34
  `;
45
35
  // Tạo phiên thực hành con từ phiên thực hành chính
46
36
  exports.CREATE_LAB_SESSION_BY_LAB_SESSION_ID = (0, graphql_tag_1.gql) `
47
- mutation CreateLabSessionByLabSessionId(
48
- $labSessionId: String!
49
- $userId: String!
50
- $articleId: String!
51
- ) {
52
- createLabSessionByLabSessionId(
53
- labSessionId: $labSessionId
54
- userId: $userId
55
- articleId: $articleId
56
- ) {
37
+ mutation CreateLabSessionByLabSessionId($labSessionId: String!, $userId: String!, $articleId: String!) {
38
+ createLabSessionByLabSessionId(labSessionId: $labSessionId, userId: $userId, articleId: $articleId) {
57
39
  labSessionId
58
40
  userId
59
41
  typeLabSession
@@ -82,16 +64,8 @@ exports.CREATE_LAB_SESSION_BY_LAB_SESSION_ID = (0, graphql_tag_1.gql) `
82
64
  `;
83
65
  // Tạo phiên thực hành từ computing của khách hàng
84
66
  exports.CREATE_LAB_SESSION_BY_COMPUTING_ID = (0, graphql_tag_1.gql) `
85
- mutation CreateLabSessionByComputingId(
86
- $computingId: String!
87
- $userId: String!
88
- $articleId: String!
89
- ) {
90
- createLabSessionByComputingId(
91
- computingId: $computingId
92
- userId: $userId
93
- articleId: $articleId
94
- ) {
67
+ mutation CreateLabSessionByComputingId($computingId: String!, $userId: String!, $articleId: String!) {
68
+ createLabSessionByComputingId(computingId: $computingId, userId: $userId, articleId: $articleId) {
95
69
  labSessionId
96
70
  userId
97
71
  typeLabSession
@@ -129,11 +103,7 @@ exports.UPDATE_END_TIME_LAB_SESSION = (0, graphql_tag_1.gql) `
129
103
  `;
130
104
  // Dừng thực hành
131
105
  exports.STOP_LAB_SESSION = (0, graphql_tag_1.gql) `
132
- mutation StopLabSession(
133
- $labSessionId: String!
134
- $userId: String!
135
- $note: String
136
- ) {
106
+ mutation StopLabSession($labSessionId: String!, $userId: String!, $note: String) {
137
107
  stopLabSession(labSessionId: $labSessionId, userId: $userId, note: $note) {
138
108
  status
139
109
  message
@@ -141,16 +111,8 @@ exports.STOP_LAB_SESSION = (0, graphql_tag_1.gql) `
141
111
  }
142
112
  `;
143
113
  exports.UPDATE_TYPE_LAB_SESSION = (0, graphql_tag_1.gql) `
144
- mutation StopLabSession(
145
- $labSessionId: String!
146
- $typeLabSessionCode: String!
147
- $userId: String!
148
- ) {
149
- updateTypeLabSession(
150
- labSessionId: $labSessionId
151
- typeLabSessionCode: $typeLabSessionCode
152
- userId: $userId
153
- ) {
114
+ mutation StopLabSession($labSessionId: String!, $typeLabSessionCode: String!, $userId: String!) {
115
+ updateTypeLabSession(labSessionId: $labSessionId, typeLabSessionCode: $typeLabSessionCode, userId: $userId) {
154
116
  status
155
117
  message
156
118
  }
@@ -158,14 +120,60 @@ exports.UPDATE_TYPE_LAB_SESSION = (0, graphql_tag_1.gql) `
158
120
  `;
159
121
  // Dừng thực hành
160
122
  exports.STOP_LAB_SESSION_FOR_CUSTOMER = (0, graphql_tag_1.gql) `
161
- mutation StopLabSessionForCustomer(
162
- $labSessionId: String!
163
- $userId: String!
164
- $note: String
165
- ) {
123
+ mutation StopLabSessionForCustomer($labSessionId: String!, $userId: String!, $note: String) {
166
124
  stopLabSessionForCustomer(labSessionId: $labSessionId, userId: $userId, note: $note) {
167
125
  status
168
126
  message
169
127
  }
170
128
  }
171
129
  `;
130
+ const CREATE_COMPUTING_LAB_BY_TEMPLATE_ID = (fields = []) => {
131
+ const fieldStr = fields.join("\n ");
132
+ const hasFields = fields.length > 0;
133
+ return (0, graphql_tag_1.gql) `
134
+ mutation createComputingLabByTemplateId(
135
+ $templateId: String!
136
+ $userId: String!
137
+ $productId: String!
138
+ $province: String!
139
+ $timeUse: BigDecimal!
140
+ $createBy: String!
141
+ $price: BigDecimal
142
+ ){
143
+ createComputingLabByTemplateId (
144
+ templateId: $templateId
145
+ userId: $userId
146
+ productId: $productId
147
+ province: $province
148
+ timeUse: $timeUse
149
+ createBy: $createBy
150
+ price: $price
151
+ )
152
+ ${hasFields ? `{ ${fieldStr} }` : ""}
153
+ } `;
154
+ };
155
+ exports.CREATE_COMPUTING_LAB_BY_TEMPLATE_ID = CREATE_COMPUTING_LAB_BY_TEMPLATE_ID;
156
+ exports.REMOVE_COMPUTING_LAB = (0, graphql_tag_1.gql) `
157
+ mutation RemoveComputingLab($partnerId: String!, $userId: String!, $computingId: String!, $updateBy: String!) {
158
+ removeComputingLab(partnerId: $partnerId, userId: $userId, computingId: $computingId, updateBy: $updateBy) {
159
+ status
160
+ message
161
+ }
162
+ }
163
+ `;
164
+ exports.OFF_COMPUTING_LAB = (0, graphql_tag_1.gql) `
165
+ mutation OffComputingLab($partnerId: String!, $userId: String!, $computingId: String!, $timeUse: BigDecimal!, $updateBy: String!) {
166
+ offComputingLab(partnerId: $partnerId, userId: $userId, computingId: $computingId, timeUse: $timeUse, updateBy: $updateBy) {
167
+ status
168
+ message
169
+ }
170
+ }
171
+ `;
172
+ exports.ON_COMPUTING_LAB = (0, graphql_tag_1.gql) `
173
+ mutation OnComputingLab($partnerId: String!, $userId: String!, $computingId: String!, $timeUse: BigDecimal!, $updateBy: String!, $price: BigDecimal) {
174
+ onComputingLab(partnerId: $partnerId, userId: $userId, computingId: $computingId, timeUse: $timeUse, updateBy: $updateBy, price: $price) {
175
+ status
176
+ message
177
+ }
178
+ }
179
+ `;
@@ -5,3 +5,6 @@ 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
7
  export declare const GET_LAB_DOING_AND_DONE_BY_USERID: (fields?: string[]) => DocumentNode;
8
+ export declare const CALCULATE_COMPUTING_LAB_ACTION_PRICING: (fields?: string[]) => DocumentNode;
9
+ export declare const GET_SESSION_LAB: (fields?: string[]) => DocumentNode;
10
+ export declare const FILTER_COMPUTING_LAB: (fields?: string[]) => DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
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;
3
+ exports.FILTER_COMPUTING_LAB = exports.GET_SESSION_LAB = exports.CALCULATE_COMPUTING_LAB_ACTION_PRICING = 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) `
@@ -56,10 +56,7 @@ exports.GET_LAB_SESSIONS_BY_USER_ID = (0, graphql_tag_1.gql) `
56
56
  `;
57
57
  // Danh sách phiên thực hành theo bài lab của người dùng
58
58
  exports.GET_LAB_SESSIONS_BY_USER_ID_AND_ARTICLE_ID = (0, graphql_tag_1.gql) `
59
- query GetLabSessionsByUserIdAndArticleId(
60
- $userId: String!
61
- $articleId: String!
62
- ) {
59
+ query GetLabSessionsByUserIdAndArticleId($userId: String!, $articleId: String!) {
63
60
  getLabSessionsByUserIdAndArticleId(userId: $userId, articleId: $articleId) {
64
61
  labSessionId
65
62
  userId
@@ -88,10 +85,7 @@ exports.GET_LAB_SESSIONS_BY_USER_ID_AND_ARTICLE_ID = (0, graphql_tag_1.gql) `
88
85
  }
89
86
  `;
90
87
  exports.GET_LAB_SESSIONS_CHILL_BY_PARENT = (0, graphql_tag_1.gql) `
91
- query GetLabSessionsByUserIdAndArticleId(
92
- $labSessionId: String!
93
- $userId: String!
94
- ) {
88
+ query GetLabSessionsByUserIdAndArticleId($labSessionId: String!, $userId: String!) {
95
89
  getLabSessionsChillByParent(labSessionId: $labSessionId, userId: $userId) {
96
90
  labSessionId
97
91
  userId
@@ -129,3 +123,58 @@ const GET_LAB_DOING_AND_DONE_BY_USERID = (fields = []) => {
129
123
  `;
130
124
  };
131
125
  exports.GET_LAB_DOING_AND_DONE_BY_USERID = GET_LAB_DOING_AND_DONE_BY_USERID;
126
+ const CALCULATE_COMPUTING_LAB_ACTION_PRICING = (fields = []) => {
127
+ const fieldStr = fields.join("\n ");
128
+ const hasFields = fields.length > 0;
129
+ return (0, graphql_tag_1.gql) `
130
+ query CalculateComputingLabActionPricing(
131
+ $partnerId: String!
132
+ $userId: String!
133
+ $action: String!
134
+ $timeUse: BigDecimal!
135
+ $productId: String
136
+ $computingId: String
137
+ $price: BigDecimal
138
+ ) {
139
+ calculateComputingLabActionPricing(
140
+ partnerId: $partnerId
141
+ userId: $userId
142
+ action: $action
143
+ timeUse: $timeUse
144
+ productId: $productId
145
+ computingId: $computingId
146
+ price: $price
147
+ ) ${hasFields ? `{ ${fieldStr} }` : ""}
148
+ }
149
+ `;
150
+ };
151
+ exports.CALCULATE_COMPUTING_LAB_ACTION_PRICING = CALCULATE_COMPUTING_LAB_ACTION_PRICING;
152
+ const GET_SESSION_LAB = (fields = []) => {
153
+ const fieldStr = fields.join("\n ");
154
+ const hasFields = fields.length > 0;
155
+ return (0, graphql_tag_1.gql) `
156
+ query GetSessionLab(
157
+ $parnerId: String!
158
+ $userId: String!
159
+ $computingId: String!
160
+ ) {
161
+ getSessionLab(
162
+ partnerId: $parnerId
163
+ userId: $userId
164
+ computingId: $computingId
165
+ )
166
+ ${hasFields ? `{ ${fieldStr} }` : ""}
167
+ } `;
168
+ };
169
+ exports.GET_SESSION_LAB = GET_SESSION_LAB;
170
+ const FILTER_COMPUTING_LAB = (fields = []) => {
171
+ const fieldStr = fields.join("\n ");
172
+ const hasFields = fields.length > 0;
173
+ return (0, graphql_tag_1.gql) `
174
+ query FilterComputingLab($filter: ComputingLabFilterInput!) {
175
+ filterComputingLab(filter: $filter)
176
+ ${hasFields ? `{ ${fieldStr} }` : ""}
177
+ }
178
+ `;
179
+ };
180
+ exports.FILTER_COMPUTING_LAB = FILTER_COMPUTING_LAB;
@@ -39,7 +39,7 @@ export declare class AuthService extends Service {
39
39
  getUserLoginsByPartyId(partyId: string): Promise<any>;
40
40
  sendOTP(phone: string, channelType: string | null): Promise<any>;
41
41
  validateOTP(otpCode: string, phone: string, channelType: string | null): Promise<any>;
42
- getAccessTokenByOTP(otpCode: string, phone: string, channelType: string | null): Promise<any>;
42
+ getAccessTokenByOTP(otpCode: string, phone: string, channelType: string | null, appId?: string, deviceId?: string): Promise<any>;
43
43
  createUserLogin(userLoginId: string): Promise<any>;
44
44
  createUserDetailWithoutUserLogin(name: string, phone: string, email: string): Promise<any>;
45
45
  getPhoneByPartyId(partyId: string): Promise<any>;
@@ -51,8 +51,8 @@ export declare class AuthService extends Service {
51
51
  checkEnabled2FA(partyId: string, fields: string[]): Promise<any>;
52
52
  logout(accessToken: string, partyId: string): Promise<any>;
53
53
  resetPassword(username: string, newPassword: string, accessToken: string): Promise<any>;
54
- loginGoogle(redirectUrl: string, redirectUrlError?: string, serviceOperator?: string): Promise<any>;
55
- loginFacebook(redirectUrl: string, redirectUrlError?: string, serviceOperator?: string): Promise<any>;
54
+ loginGoogle(redirectUrl: string, redirectUrlError?: string, serviceOperator?: string, appId?: string, deviceId?: string): Promise<any>;
55
+ loginFacebook(redirectUrl: string, redirectUrlError?: string, serviceOperator?: string, appId?: string, deviceId?: string): Promise<any>;
56
56
  /**
57
57
  * Logs in a user via Zalo by executing a GraphQL query.
58
58
  *
@@ -60,5 +60,5 @@ export declare class AuthService extends Service {
60
60
  * @returns A promise that resolves to the result of the `loginZalo` GraphQL query.
61
61
  * @throws Will throw an error if the GraphQL query fails.
62
62
  */
63
- loginZalo(redirectUrl: string, redirectUrlError?: string, serviceOperator?: string): Promise<any>;
63
+ loginZalo(redirectUrl: string, redirectUrlError?: string, serviceOperator?: string, appId?: string, deviceId?: string): Promise<any>;
64
64
  }
@@ -40,7 +40,7 @@ class AuthService extends serviceSDK_1.Service {
40
40
  login(loginRequest) {
41
41
  return __awaiter(this, void 0, void 0, function* () {
42
42
  const variables = {
43
- loginRequest: Object.assign({ orgId: this.orgId }, loginRequest),
43
+ loginRequest: Object.assign({ orgId: this.orgId, appId: "LONGVAN_USI" }, loginRequest),
44
44
  };
45
45
  const data = yield this.graphqlMutation(mutations_1.LOGIN_MUTATION, variables);
46
46
  return data.login;
@@ -306,13 +306,15 @@ class AuthService extends serviceSDK_1.Service {
306
306
  }
307
307
  });
308
308
  }
309
- getAccessTokenByOTP(otpCode, phone, channelType) {
310
- return __awaiter(this, void 0, void 0, function* () {
309
+ getAccessTokenByOTP(otpCode_1, phone_1, channelType_1) {
310
+ return __awaiter(this, arguments, void 0, function* (otpCode, phone, channelType, appId = "LONGVAN_USI", deviceId) {
311
311
  const mutation = queries_1.GET_ACCESS_TOKEN_BY_OTP;
312
312
  const variables = {
313
313
  otpCode,
314
314
  phone,
315
315
  channelType,
316
+ appId,
317
+ deviceId,
316
318
  };
317
319
  try {
318
320
  const response = yield this.graphqlMutation(mutation, variables);
@@ -515,8 +517,8 @@ class AuthService extends serviceSDK_1.Service {
515
517
  }
516
518
  });
517
519
  }
518
- loginGoogle(redirectUrl, redirectUrlError, serviceOperator) {
519
- return __awaiter(this, void 0, void 0, function* () {
520
+ loginGoogle(redirectUrl_1, redirectUrlError_1, serviceOperator_1) {
521
+ return __awaiter(this, arguments, void 0, function* (redirectUrl, redirectUrlError, serviceOperator, appId = "LONGVAN_USI", deviceId) {
520
522
  const query = queries_1.LOGIN_GOOGLE;
521
523
  const variables = {
522
524
  orgId: this.orgId,
@@ -524,6 +526,8 @@ class AuthService extends serviceSDK_1.Service {
524
526
  redirectUrl,
525
527
  serviceOperator,
526
528
  redirectUrlError,
529
+ appId,
530
+ deviceId,
527
531
  };
528
532
  try {
529
533
  const response = yield this.graphqlQuery(query, variables);
@@ -535,8 +539,8 @@ class AuthService extends serviceSDK_1.Service {
535
539
  }
536
540
  });
537
541
  }
538
- loginFacebook(redirectUrl, redirectUrlError, serviceOperator) {
539
- return __awaiter(this, void 0, void 0, function* () {
542
+ loginFacebook(redirectUrl_1, redirectUrlError_1, serviceOperator_1) {
543
+ return __awaiter(this, arguments, void 0, function* (redirectUrl, redirectUrlError, serviceOperator, appId = "LONGVAN_USI", deviceId) {
540
544
  const query = queries_1.LOGIN_FACEBOOK;
541
545
  const variables = {
542
546
  orgId: this.orgId,
@@ -544,6 +548,8 @@ class AuthService extends serviceSDK_1.Service {
544
548
  redirectUrl,
545
549
  serviceOperator,
546
550
  redirectUrlError,
551
+ appId,
552
+ deviceId,
547
553
  };
548
554
  try {
549
555
  const response = yield this.graphqlQuery(query, variables);
@@ -562,8 +568,8 @@ class AuthService extends serviceSDK_1.Service {
562
568
  * @returns A promise that resolves to the result of the `loginZalo` GraphQL query.
563
569
  * @throws Will throw an error if the GraphQL query fails.
564
570
  */
565
- loginZalo(redirectUrl, redirectUrlError, serviceOperator) {
566
- return __awaiter(this, void 0, void 0, function* () {
571
+ loginZalo(redirectUrl_1, redirectUrlError_1, serviceOperator_1) {
572
+ return __awaiter(this, arguments, void 0, function* (redirectUrl, redirectUrlError, serviceOperator, appId = "LONGVAN_USI", deviceId) {
567
573
  const query = queries_1.LOGIN_ZALO;
568
574
  const variables = {
569
575
  orgId: this.orgId,
@@ -571,6 +577,8 @@ class AuthService extends serviceSDK_1.Service {
571
577
  redirectUrl,
572
578
  serviceOperator,
573
579
  redirectUrlError,
580
+ appId,
581
+ deviceId,
574
582
  };
575
583
  try {
576
584
  const response = yield this.graphqlQuery(query, variables);
@@ -16,4 +16,11 @@ export declare class QuicklabService extends Service {
16
16
  getLabSessionsChillByParent(labSessionId: string, userId: string): Promise<any>;
17
17
  stopLabSessionForCustomer(labSessionId: string, userId: string, note: string): Promise<any>;
18
18
  getLabDoingAndDoneByUserId(userId: string, fields: string[]): Promise<any>;
19
+ calculateComputingLabActionPricing(userId: string, timeUse: number | string, action: string, productId: string, computingId: string, price: number | string, fields: string[]): Promise<any>;
20
+ createComputingLabByTemplateId(templateId: string, userId: string, productId: string, province: string, timeUse: number | string, createBy: string, price: number | string, fields?: string[]): Promise<any>;
21
+ getSessionLab(userId: string, computingId: string, fields: string[]): Promise<any>;
22
+ removeComputingLab(userId: string, computingId: string, updateBy: string): Promise<any>;
23
+ offComputingLab(userId: string, computingId: string, timeUse: string | number, updateBy: string): Promise<any>;
24
+ filterComputingLab(id: string, search: string, createdStampFrom: string, createdStampTo: string, offset: number, maxResult: number, userId: string, fields?: string[]): Promise<any>;
25
+ onComputingLab(userId: string, computingId: string, timeUse: string | number, updateBy: string, price: number | string): Promise<any>;
19
26
  }
@@ -27,7 +27,7 @@ class QuicklabService extends serviceSDK_1.Service {
27
27
  return __awaiter(this, void 0, void 0, function* () {
28
28
  const query = queries_1.GET_TEMPLATE_BY_ARTICLE_ID;
29
29
  const variables = {
30
- articleId,
30
+ articleId
31
31
  };
32
32
  try {
33
33
  const response = yield this.graphqlQuery(query, variables);
@@ -207,5 +207,144 @@ class QuicklabService extends serviceSDK_1.Service {
207
207
  }
208
208
  });
209
209
  }
210
+ calculateComputingLabActionPricing(userId, timeUse, action, productId, computingId, price, fields) {
211
+ return __awaiter(this, void 0, void 0, function* () {
212
+ const query = (0, queries_1.CALCULATE_COMPUTING_LAB_ACTION_PRICING)(fields);
213
+ const variables = { partnerId: this.orgId, userId, timeUse: Number(timeUse), action, productId, computingId, price: price != null ? Number(price) : null };
214
+ try {
215
+ const response = yield this.graphqlQuery(query, variables);
216
+ return response.calculateComputingLabActionPricing;
217
+ }
218
+ catch (error) {
219
+ console.log(`Error in calculateComputingLabActionPricing : ${error}`);
220
+ throw error;
221
+ }
222
+ });
223
+ }
224
+ createComputingLabByTemplateId(templateId_1, userId_1, productId_1, province_1, timeUse_1, createBy_1, price_1) {
225
+ return __awaiter(this, arguments, void 0, function* (templateId, userId, productId, province, timeUse, createBy, price, fields = []) {
226
+ const mutation = (0, mutations_1.CREATE_COMPUTING_LAB_BY_TEMPLATE_ID)(fields);
227
+ const variables = {
228
+ templateId,
229
+ userId,
230
+ productId,
231
+ province,
232
+ timeUse: Number(timeUse),
233
+ createBy,
234
+ price: price != null ? Number(price) : null
235
+ };
236
+ try {
237
+ const response = yield this.graphqlMutation(mutation, variables);
238
+ return response.createComputingLabByTemplateId;
239
+ }
240
+ catch (error) {
241
+ console.log(`Error in createComputingLabByTemplateId : ${error}`);
242
+ throw error;
243
+ }
244
+ });
245
+ }
246
+ getSessionLab(userId, computingId, fields) {
247
+ return __awaiter(this, void 0, void 0, function* () {
248
+ const query = (0, queries_1.GET_SESSION_LAB)(fields);
249
+ const variables = {
250
+ parnerId: this.orgId,
251
+ userId,
252
+ computingId
253
+ };
254
+ try {
255
+ const response = yield this.graphqlQuery(query, variables);
256
+ return response.getSessionLab;
257
+ }
258
+ catch (error) {
259
+ console.log(`Error in getSessionLab : ${error}`);
260
+ throw error;
261
+ }
262
+ });
263
+ }
264
+ removeComputingLab(userId, computingId, updateBy) {
265
+ return __awaiter(this, void 0, void 0, function* () {
266
+ const variables = {
267
+ partnerId: this.orgId,
268
+ userId,
269
+ computingId,
270
+ updateBy
271
+ };
272
+ try {
273
+ const response = yield this.graphqlMutation(mutations_1.REMOVE_COMPUTING_LAB, variables);
274
+ return response.removeComputingLab;
275
+ }
276
+ catch (error) {
277
+ console.log(`Error in removeComputingLab: ${error}`);
278
+ throw error;
279
+ }
280
+ });
281
+ }
282
+ offComputingLab(userId, computingId, timeUse, updateBy) {
283
+ return __awaiter(this, void 0, void 0, function* () {
284
+ const variables = {
285
+ partnerId: this.orgId,
286
+ userId,
287
+ computingId,
288
+ timeUse: Number(timeUse),
289
+ updateBy
290
+ };
291
+ try {
292
+ const response = yield this.graphqlMutation(mutations_1.OFF_COMPUTING_LAB, variables);
293
+ return response.offComputingLab;
294
+ }
295
+ catch (error) {
296
+ console.log(`Error in offComputingLab: ${error}`);
297
+ throw error;
298
+ }
299
+ });
300
+ }
301
+ filterComputingLab(id_1, search_1, createdStampFrom_1, createdStampTo_1, offset_1, maxResult_1, userId_1) {
302
+ return __awaiter(this, arguments, void 0, function* (id, search, createdStampFrom, createdStampTo, offset, maxResult, userId, fields = []) {
303
+ const query = (0, queries_1.FILTER_COMPUTING_LAB)(fields);
304
+ const filter = {
305
+ partnerId: this.orgId,
306
+ userId,
307
+ offset: Number(offset) || 0,
308
+ maxResult: Number(maxResult) || 10
309
+ };
310
+ if (id)
311
+ filter.id = id;
312
+ if (search)
313
+ filter.search = search;
314
+ if (createdStampFrom)
315
+ filter.createdStampFrom = createdStampFrom;
316
+ if (createdStampTo)
317
+ filter.createdStampTo = createdStampTo;
318
+ const variables = { filter };
319
+ try {
320
+ const response = yield this.graphqlQuery(query, variables);
321
+ return response.filterComputingLab;
322
+ }
323
+ catch (error) {
324
+ console.log(`Error in filterComputingLab: ${error}`);
325
+ throw error;
326
+ }
327
+ });
328
+ }
329
+ onComputingLab(userId, computingId, timeUse, updateBy, price) {
330
+ return __awaiter(this, void 0, void 0, function* () {
331
+ const variables = {
332
+ partnerId: this.orgId,
333
+ userId,
334
+ computingId,
335
+ timeUse: Number(timeUse),
336
+ updateBy,
337
+ price: price != null ? Number(price) : null
338
+ };
339
+ try {
340
+ const response = yield this.graphqlMutation(mutations_1.ON_COMPUTING_LAB, variables);
341
+ return response.onComputingLab;
342
+ }
343
+ catch (error) {
344
+ console.log(`Error in onComputingLab: ${error}`);
345
+ throw error;
346
+ }
347
+ });
348
+ }
210
349
  }
211
350
  exports.QuicklabService = QuicklabService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/service-js-client",
3
- "version": "2.7.2",
3
+ "version": "2.7.4",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [