@longvansoftware/storefront-js-client 4.1.1 → 4.1.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.
@@ -10,3 +10,4 @@ export declare const GET_ACCESS_TOKEN_BY_OTP_QUERY: import("graphql").DocumentNo
10
10
  export declare const GET_ORGANIZATIONS_BY_PARTY_ID: import("graphql").DocumentNode;
11
11
  export declare const GET_MENUS: import("graphql").DocumentNode;
12
12
  export declare const GET_WORK_SPACES: import("graphql").DocumentNode;
13
+ export declare const GET_ORGANIZATION_BY_ID: import("graphql").DocumentNode;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.GET_WORK_SPACES = exports.GET_MENUS = exports.GET_ORGANIZATIONS_BY_PARTY_ID = exports.GET_ACCESS_TOKEN_BY_OTP_QUERY = exports.CHECK_USER_LOGIN = exports.LOGIN_ZALO = exports.LOGIN_FACEBOOK = exports.LOGIN_GOOGLE = exports.CHECK_USERNAME_EXISTED = exports.GET_USER_LOGIN_BY_USER_LOGIN_ID = exports.GET_USER_LOGIN_BY_TOKEN = exports.GET_USER_DETAIL = void 0;
3
+ exports.GET_ORGANIZATION_BY_ID = exports.GET_WORK_SPACES = exports.GET_MENUS = exports.GET_ORGANIZATIONS_BY_PARTY_ID = exports.GET_ACCESS_TOKEN_BY_OTP_QUERY = exports.CHECK_USER_LOGIN = exports.LOGIN_ZALO = exports.LOGIN_FACEBOOK = exports.LOGIN_GOOGLE = exports.CHECK_USERNAME_EXISTED = exports.GET_USER_LOGIN_BY_USER_LOGIN_ID = exports.GET_USER_LOGIN_BY_TOKEN = exports.GET_USER_DETAIL = void 0;
4
4
  const graphql_tag_1 = require("graphql-tag");
5
5
  exports.GET_USER_DETAIL = (0, graphql_tag_1.gql) `
6
6
  query GetUserDetail($orgId: String!, $accessToken: String!) {
@@ -191,3 +191,26 @@ exports.GET_WORK_SPACES = (0, graphql_tag_1.gql) `
191
191
  }
192
192
  }
193
193
  `;
194
+ exports.GET_ORGANIZATION_BY_ID = (0, graphql_tag_1.gql) `
195
+ query GetOrganizationById($orgId: String!) {
196
+ getOrganizationById(orgId: $orgId) {
197
+ id
198
+ partyId
199
+ codeId
200
+ groupName
201
+ groupType
202
+ shortName
203
+ groupNameLocal
204
+ officeSiteName
205
+ comments
206
+ logoImageUrl
207
+ isIncorporated
208
+ federalTaxId
209
+ description
210
+ deleted
211
+ status
212
+ positionIndexId
213
+ prefix
214
+ }
215
+ }
216
+ `;
@@ -144,4 +144,5 @@ export declare class AuthService extends Service {
144
144
  getMenus(partyId: string, workspaceId: string, scope: string): Promise<any>;
145
145
  getWorkspaces(partyId: string, scope: string): Promise<any>;
146
146
  logout(token: string): Promise<any>;
147
+ getOrganizationById(orgId: string): Promise<any>;
147
148
  }
@@ -698,5 +698,20 @@ class AuthService extends serviceSDK_1.Service {
698
698
  }
699
699
  });
700
700
  }
701
+ getOrganizationById(orgId) {
702
+ return __awaiter(this, void 0, void 0, function* () {
703
+ const query = queries_1.GET_ORGANIZATION_BY_ID;
704
+ const variables = {
705
+ orgId,
706
+ };
707
+ try {
708
+ const response = yield this.graphqlQueryV4(query, variables);
709
+ return response.getOrganizationById;
710
+ }
711
+ catch (error) {
712
+ throw error;
713
+ }
714
+ });
715
+ }
701
716
  }
702
717
  exports.AuthService = AuthService;
@@ -25,4 +25,5 @@ export declare class PortalService extends Service {
25
25
  getMenus(menuId: string): Promise<any>;
26
26
  getBooking(query?: Record<string, any>): Promise<any>;
27
27
  bookingSchedule(data: Record<string, any>): Promise<any>;
28
+ getWorkSchedule(orgId: string, query?: Record<string, any>): Promise<any>;
28
29
  }
@@ -343,5 +343,29 @@ class PortalService extends serviceSDK_1.Service {
343
343
  }
344
344
  });
345
345
  }
346
+ getWorkSchedule(orgId, query) {
347
+ return __awaiter(this, void 0, void 0, function* () {
348
+ const method = "GET";
349
+ const baseUrl = `/dynamic-collection/public/v2/schedule/work/visit/${orgId}`;
350
+ const params = new URLSearchParams();
351
+ if (query) {
352
+ Object.entries(query).forEach(([key, value]) => {
353
+ if (value !== undefined && value !== null) {
354
+ params.append(key, String(value));
355
+ }
356
+ });
357
+ }
358
+ const endpoint = params.toString()
359
+ ? `${baseUrl}?${params.toString()}`
360
+ : baseUrl;
361
+ try {
362
+ const response = yield this.restApiCallWithNoHeader(endpoint, method);
363
+ return response;
364
+ }
365
+ catch (error) {
366
+ throw error;
367
+ }
368
+ });
369
+ }
346
370
  }
347
371
  exports.PortalService = PortalService;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@longvansoftware/storefront-js-client",
3
- "version": "4.1.1",
3
+ "version": "4.1.4",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "files": [