@abcagency/hc-ui-components 1.3.18 → 1.3.19

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.
Files changed (191) hide show
  1. package/dist/_virtual/_rollupPluginBabelHelpers.js +1 -1
  2. package/dist/apis/hcApi.js +85 -183
  3. package/dist/apis/hcApi.js.map +1 -1
  4. package/dist/components/HireControlMap.js +10 -5
  5. package/dist/components/HireControlMap.js.map +1 -1
  6. package/dist/components/modules/accordions/MapAccordionItem.js +10 -67
  7. package/dist/components/modules/accordions/MapAccordionItem.js.map +1 -1
  8. package/dist/components/modules/filter/index.js.map +1 -1
  9. package/dist/components/modules/filter/radio-item.js +1 -2
  10. package/dist/components/modules/filter/radio-item.js.map +1 -1
  11. package/dist/components/modules/jobListing/listing-details-container.js +45 -0
  12. package/dist/components/modules/jobListing/listing-details-container.js.map +1 -0
  13. package/dist/components/modules/jobListing/listing-details.js +24 -24
  14. package/dist/components/modules/jobListing/listing-details.js.map +1 -1
  15. package/dist/components/modules/{maps/list → list}/field-mapper.js +8 -7
  16. package/dist/components/modules/list/field-mapper.js.map +1 -0
  17. package/dist/components/modules/{maps/list → list}/header-item.js +2 -2
  18. package/dist/components/modules/list/header-item.js.map +1 -0
  19. package/dist/components/modules/{maps/list → list}/header.js +6 -4
  20. package/dist/components/modules/list/header.js.map +1 -0
  21. package/dist/components/modules/list/index.js +36 -0
  22. package/dist/components/modules/list/index.js.map +1 -0
  23. package/dist/components/modules/{maps/list → list}/item-expand-card/index.js +3 -1
  24. package/dist/components/modules/list/item-expand-card/index.js.map +1 -0
  25. package/dist/components/modules/{maps/list → list}/item-expand-card/recruiter-contact-nav.js +2 -2
  26. package/dist/components/modules/list/item-expand-card/recruiter-contact-nav.js.map +1 -0
  27. package/dist/components/modules/{maps/list → list}/item-expand-card/recruiter-details.js +1 -1
  28. package/dist/components/modules/list/item-expand-card/recruiter-details.js.map +1 -0
  29. package/dist/components/modules/list/item-expand-card/recruiter-headshot.js.map +1 -0
  30. package/dist/components/modules/list/item-list.js +28 -0
  31. package/dist/components/modules/list/item-list.js.map +1 -0
  32. package/dist/components/modules/list/list-item/index.js +75 -0
  33. package/dist/components/modules/list/list-item/index.js.map +1 -0
  34. package/dist/components/modules/list/list-item/list-item-container.js +47 -0
  35. package/dist/components/modules/list/list-item/list-item-container.js.map +1 -0
  36. package/dist/components/modules/{maps/list/list-item/index.js → list/list-item/list-item.js} +29 -33
  37. package/dist/components/modules/list/list-item/list-item.js.map +1 -0
  38. package/dist/components/modules/maps/map-list.js +3 -3
  39. package/dist/components/modules/maps/map-list.js.map +1 -1
  40. package/dist/contexts/mapContext.js +84 -113
  41. package/dist/contexts/mapContext.js.map +1 -1
  42. package/dist/contexts/mapListContext.js +181 -293
  43. package/dist/contexts/mapListContext.js.map +1 -1
  44. package/dist/contexts/trackEventContext.js +1 -1
  45. package/dist/services/configService.js +10 -28
  46. package/dist/services/configService.js.map +1 -1
  47. package/dist/services/googlePlacesNearbyService.js +33 -58
  48. package/dist/services/googlePlacesNearbyService.js.map +1 -1
  49. package/dist/services/listingAggregatorService.js +35 -75
  50. package/dist/services/listingAggregatorService.js.map +1 -1
  51. package/dist/services/listingEntityService.js +10 -31
  52. package/dist/services/listingEntityService.js.map +1 -1
  53. package/dist/services/listingService.js +26 -60
  54. package/dist/services/listingService.js.map +1 -1
  55. package/dist/services/recruiterService.js +11 -31
  56. package/dist/services/recruiterService.js.map +1 -1
  57. package/dist/types/apis/hcApi.d.ts +5 -0
  58. package/dist/types/clientToken.d.ts +2 -0
  59. package/dist/types/components/modules/accordions/MapAccordionItem.d.ts +9 -0
  60. package/dist/types/components/modules/accordions/default.d.ts +19 -0
  61. package/dist/types/components/modules/buttons/button-group-apply.d.ts +24 -0
  62. package/dist/types/components/modules/buttons/commute-pill.d.ts +5 -0
  63. package/dist/types/components/modules/buttons/default.d.ts +48 -0
  64. package/dist/types/components/modules/buttons/pill-wrapper.d.ts +3 -0
  65. package/dist/types/components/modules/dialogs/apply-dialog.d.ts +8 -0
  66. package/dist/types/components/modules/filter/sort.d.ts +8 -0
  67. package/dist/types/components/modules/grid.d.ts +8 -0
  68. package/dist/types/components/modules/icon.d.ts +10 -0
  69. package/dist/types/components/modules/jobListing/listing-details-container.d.ts +6 -0
  70. package/dist/types/components/modules/jobListing/listing-details.d.ts +18 -0
  71. package/dist/types/components/modules/list/field-mapper.d.ts +10 -0
  72. package/dist/types/components/modules/list/header-item.d.ts +11 -0
  73. package/dist/types/components/modules/list/header.d.ts +11 -0
  74. package/dist/types/components/modules/list/index.d.ts +9 -0
  75. package/dist/types/components/modules/list/item-expand-card/index.d.ts +7 -0
  76. package/dist/types/components/modules/list/item-expand-card/recruiter-contact-nav.d.ts +17 -0
  77. package/dist/types/components/modules/list/item-expand-card/recruiter-details.d.ts +21 -0
  78. package/dist/types/components/modules/list/item-expand-card/recruiter-headshot.d.ts +8 -0
  79. package/dist/types/components/modules/list/item-list.d.ts +21 -0
  80. package/dist/types/components/modules/list/list-item/index.d.ts +12 -0
  81. package/dist/types/components/modules/list/list-item/list-item-container.d.ts +14 -0
  82. package/dist/types/components/modules/list/list-item/list-item.d.ts +3 -0
  83. package/dist/types/constants/eventTypes.d.ts +13 -0
  84. package/dist/types/contexts/mapContext.d.ts +29 -0
  85. package/dist/types/contexts/mapListContext.d.ts +58 -0
  86. package/dist/types/contexts/trackEventContext.d.ts +6 -0
  87. package/dist/types/enums/SectionType.d.ts +9 -0
  88. package/dist/types/hooks/useList.d.ts +13 -0
  89. package/dist/types/services/configService.d.ts +6 -0
  90. package/dist/types/services/googlePlacesNearbyService.d.ts +5 -0
  91. package/dist/types/services/listingAggregatorService.d.ts +12 -0
  92. package/dist/types/services/listingEntityService.d.ts +6 -0
  93. package/dist/types/services/listingService.d.ts +9 -0
  94. package/dist/types/services/recruiterService.d.ts +6 -0
  95. package/dist/types/types/Address.d.ts +7 -0
  96. package/dist/types/types/ContentSection.d.ts +8 -0
  97. package/dist/types/types/GetListingParams.d.ts +8 -0
  98. package/dist/types/types/LatLng.d.ts +4 -0
  99. package/dist/types/types/ListingEntity.d.ts +10 -0
  100. package/dist/types/types/ListingFields.d.ts +20 -0
  101. package/dist/types/types/Listings.d.ts +31 -0
  102. package/dist/types/types/Recruiter.d.ts +9 -0
  103. package/dist/types/types/SimilarListing.d.ts +24 -0
  104. package/dist/types/types/config/Colors.d.ts +8 -0
  105. package/dist/types/types/config/MapConfig.d.ts +29 -0
  106. package/dist/types/types/config/PointsOfInterestConfig.d.ts +13 -0
  107. package/dist/types/types/config/SearchConfig.d.ts +4 -0
  108. package/dist/types/util/filterUtil.d.ts +28 -0
  109. package/dist/types/util/loading.d.ts +3 -0
  110. package/dist/types/util/localStorageUtil.d.ts +3 -0
  111. package/dist/types/util/mapUtil.d.ts +15 -0
  112. package/dist/types/util/sortUtil.d.ts +1 -0
  113. package/dist/types/util/stringUtils.d.ts +1 -0
  114. package/dist/util/filterUtil.js +1 -3
  115. package/dist/util/filterUtil.js.map +1 -1
  116. package/dist/util/localStorageUtil.js +37 -28
  117. package/dist/util/localStorageUtil.js.map +1 -1
  118. package/dist/util/mapUtil.js.map +1 -1
  119. package/package.json +23 -17
  120. package/rollup.config.mjs +23 -19
  121. package/src/apis/{hcApi.js → hcApi.ts} +27 -11
  122. package/src/components/HireControlMap.js +132 -129
  123. package/src/components/modules/accordions/MapAccordionItem.js +32 -74
  124. package/src/components/modules/filter/index.js +89 -89
  125. package/src/components/modules/filter/radio-item.js +0 -1
  126. package/src/components/modules/jobListing/listing-details-container.js +40 -0
  127. package/src/components/modules/jobListing/listing-details.js +209 -99
  128. package/src/components/modules/{maps/list → list}/field-mapper.js +114 -112
  129. package/src/components/modules/{maps/list → list}/header.js +49 -47
  130. package/src/components/modules/list/index.tsx +83 -0
  131. package/src/components/modules/{maps/list → list}/item-expand-card/index.js +24 -22
  132. package/src/components/modules/list/item-list.tsx +198 -0
  133. package/src/components/modules/list/list-item/index.js +70 -0
  134. package/src/components/modules/list/list-item/list-item-container.js +43 -0
  135. package/src/components/modules/{maps/list/list-item/index.js → list/list-item/list-item.js} +32 -38
  136. package/src/components/modules/maps/map-list.js +74 -74
  137. package/src/contexts/mapContext.tsx +129 -0
  138. package/src/contexts/mapListContext.tsx +297 -0
  139. package/src/enums/SectionType.ts +9 -0
  140. package/src/services/{configService.js → configService.ts} +16 -16
  141. package/src/services/{googlePlacesNearbyService.js → googlePlacesNearbyService.ts} +11 -2
  142. package/src/services/listingAggregatorService.ts +76 -0
  143. package/src/services/listingEntityService.ts +16 -0
  144. package/src/services/listingService.ts +40 -0
  145. package/src/services/{recruiterService.js → recruiterService.ts} +18 -17
  146. package/src/types/Address.ts +7 -0
  147. package/src/types/ContentSection.ts +9 -0
  148. package/src/types/GetListingParams.ts +8 -0
  149. package/src/types/LatLng.ts +4 -0
  150. package/src/types/ListingEntity.ts +11 -0
  151. package/src/types/ListingFields.ts +20 -0
  152. package/src/types/Listings.ts +32 -0
  153. package/src/types/Recruiter.ts +9 -0
  154. package/src/types/SimilarListing.ts +24 -0
  155. package/src/types/config/Colors.ts +8 -0
  156. package/src/types/config/MapConfig.ts +30 -0
  157. package/src/types/config/PointsOfInterestConfig.ts +13 -0
  158. package/src/types/config/SearchConfig.ts +4 -0
  159. package/src/util/filterUtil.js +239 -239
  160. package/src/util/localStorageUtil.ts +34 -0
  161. package/src/util/mapUtil.js +91 -91
  162. package/tsconfig.json +23 -0
  163. package/dist/components/modules/maps/list/field-mapper.js.map +0 -1
  164. package/dist/components/modules/maps/list/header-item.js.map +0 -1
  165. package/dist/components/modules/maps/list/header.js.map +0 -1
  166. package/dist/components/modules/maps/list/index.js +0 -102
  167. package/dist/components/modules/maps/list/index.js.map +0 -1
  168. package/dist/components/modules/maps/list/item-expand-card/index.js.map +0 -1
  169. package/dist/components/modules/maps/list/item-expand-card/recruiter-contact-nav.js.map +0 -1
  170. package/dist/components/modules/maps/list/item-expand-card/recruiter-details.js.map +0 -1
  171. package/dist/components/modules/maps/list/item-expand-card/recruiter-headshot.js.map +0 -1
  172. package/dist/components/modules/maps/list/list-item/index.js.map +0 -1
  173. package/dist/services/_virtual/_rollupPluginBabelHelpers.js +0 -372
  174. package/dist/services/_virtual/_rollupPluginBabelHelpers.js.map +0 -1
  175. package/dist/services/apis/hcApi.js +0 -189
  176. package/dist/services/apis/hcApi.js.map +0 -1
  177. package/dist/services/clientToken.js +0 -7
  178. package/dist/services/clientToken.js.map +0 -1
  179. package/dist/services/styles/index.css +0 -3
  180. package/src/components/modules/maps/list/index.js +0 -112
  181. package/src/contexts/mapContext.js +0 -101
  182. package/src/contexts/mapListContext.js +0 -242
  183. package/src/services/listingAggregatorService.js +0 -50
  184. package/src/services/listingEntityService.js +0 -15
  185. package/src/services/listingService.js +0 -26
  186. package/src/util/localStorageUtil.js +0 -27
  187. /package/dist/components/modules/{maps/list → list}/item-expand-card/recruiter-headshot.js +0 -0
  188. /package/src/components/modules/{maps/list → list}/header-item.js +0 -0
  189. /package/src/components/modules/{maps/list → list}/item-expand-card/recruiter-contact-nav.js +0 -0
  190. /package/src/components/modules/{maps/list → list}/item-expand-card/recruiter-details.js +0 -0
  191. /package/src/components/modules/{maps/list → list}/item-expand-card/recruiter-headshot.js +0 -0
@@ -1,33 +1,15 @@
1
- import { asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import api from '../apis/hcApi.js';
3
2
 
4
- var getMapConfig = /*#__PURE__*/function () {
5
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
6
- var response;
7
- return _regeneratorRuntime().wrap(function _callee$(_context) {
8
- while (1) switch (_context.prev = _context.next) {
9
- case 0:
10
- _context.prev = 0;
11
- _context.next = 3;
12
- return api.get("/MapConfig");
13
- case 3:
14
- response = _context.sent;
15
- return _context.abrupt("return", response);
16
- case 7:
17
- _context.prev = 7;
18
- _context.t0 = _context["catch"](0);
19
- console.error("Error retrieving map configuration:", _context.t0);
20
- throw _context.t0;
21
- case 11:
22
- case "end":
23
- return _context.stop();
24
- }
25
- }, _callee, null, [[0, 7]]);
26
- }));
27
- return function getMapConfig() {
28
- return _ref.apply(this, arguments);
29
- };
30
- }();
3
+ const getMapConfig = async () => {
4
+ try {
5
+ const response = await api.get(`/MapConfig`);
6
+ return response;
7
+ }
8
+ catch (error) {
9
+ console.error("Error retrieving map configuration:", error);
10
+ throw error;
11
+ }
12
+ };
31
13
 
32
14
  export { getMapConfig };
33
15
  //# sourceMappingURL=configService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"configService.js","sources":["../../src/services/configService.js"],"sourcesContent":["import api from '~/apis/hcApi';\r\n\r\nexport const getMapConfig = async () => {\r\n\r\n\ttry {\r\n\t\tconst response = await api.get(`/MapConfig`);\r\n\t\treturn response;\r\n\t} catch (error) {\r\n\t\tconsole.error(\"Error retrieving map configuration:\", error);\r\n\t\tthrow error;\r\n\t}\r\n};\r\n\r\nexport default {\r\n\tgetMapConfig\r\n};\r\n"],"names":["getMapConfig","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","response","wrap","_callee$","_context","prev","next","api","get","sent","abrupt","t0","console","error","stop","apply","arguments"],"mappings":";;;IAEaA,YAAY,gBAAA,YAAA;EAAA,IAAAC,IAAA,GAAAC,iBAAA,eAAAC,mBAAA,EAAAC,CAAAA,IAAA,CAAG,SAAAC,OAAA,GAAA;AAAA,IAAA,IAAAC,QAAA,CAAA;AAAA,IAAA,OAAAH,mBAAA,EAAA,CAAAI,IAAA,CAAA,SAAAC,SAAAC,QAAA,EAAA;AAAA,MAAA,OAAA,CAAA,EAAA,QAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;AAAA,QAAA,KAAA,CAAA;AAAAF,UAAAA,QAAA,CAAAC,IAAA,GAAA,CAAA,CAAA;AAAAD,UAAAA,QAAA,CAAAE,IAAA,GAAA,CAAA,CAAA;AAAA,UAAA,OAGHC,GAAG,CAACC,GAAG,CAAA,YAAa,CAAC,CAAA;AAAA,QAAA,KAAA,CAAA;UAAtCP,QAAQ,GAAAG,QAAA,CAAAK,IAAA,CAAA;AAAA,UAAA,OAAAL,QAAA,CAAAM,MAAA,CAAA,QAAA,EACPT,QAAQ,CAAA,CAAA;AAAA,QAAA,KAAA,CAAA;AAAAG,UAAAA,QAAA,CAAAC,IAAA,GAAA,CAAA,CAAA;UAAAD,QAAA,CAAAO,EAAA,GAAAP,QAAA,CAAA,OAAA,CAAA,CAAA,CAAA,CAAA,CAAA;UAEfQ,OAAO,CAACC,KAAK,CAAC,qCAAqC,EAAAT,QAAA,CAAAO,EAAO,CAAC,CAAA;UAAC,MAAAP,QAAA,CAAAO,EAAA,CAAA;AAAA,QAAA,KAAA,EAAA,CAAA;AAAA,QAAA,KAAA,KAAA;UAAA,OAAAP,QAAA,CAAAU,IAAA,EAAA,CAAA;AAAA,OAAA;AAAA,KAAA,EAAAd,OAAA,EAAA,IAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA;GAG7D,CAAA,CAAA,CAAA;AAAA,EAAA,OAAA,SATYL,YAAYA,GAAA;AAAA,IAAA,OAAAC,IAAA,CAAAmB,KAAA,CAAA,IAAA,EAAAC,SAAA,CAAA,CAAA;AAAA,GAAA,CAAA;AAAA,CASxB;;;;"}
1
+ {"version":3,"file":"configService.js","sources":["../../src/services/configService.ts"],"sourcesContent":["import api from '~/apis/hcApi';\nimport { MapConfig } from '~/types/config/MapConfig';\n\nexport const getMapConfig = async (): Promise<MapConfig> => {\n\ttry {\n\t\tconst response = await api.get<MapConfig>(`/MapConfig`);\n\t\treturn response;\n\t} catch (error) {\n\t\tconsole.error(\"Error retrieving map configuration:\", error);\n\t\tthrow error;\n\t}\n};\n\nexport default {\n\tgetMapConfig\n};\n"],"names":[],"mappings":";;AAGa,MAAA,YAAY,GAAG,YAA+B;IAC1D,IAAI;QACH,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,GAAG,CAAY,CAAY,UAAA,CAAA,CAAC,CAAC;AACxD,QAAA,OAAO,QAAQ,CAAC;AAChB,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;AACf,QAAA,OAAO,CAAC,KAAK,CAAC,qCAAqC,EAAE,KAAK,CAAC,CAAC;AAC5D,QAAA,MAAM,KAAK,CAAC;AACZ,KAAA;AACF;;;;"}
@@ -1,61 +1,36 @@
1
- import { asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../_virtual/_rollupPluginBabelHelpers.js';
2
-
3
- var searchNearbyPlaces = /*#__PURE__*/function () {
4
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(typesArray, location, radius) {
5
- var url, headers, data, response;
6
- return _regeneratorRuntime().wrap(function _callee$(_context) {
7
- while (1) switch (_context.prev = _context.next) {
8
- case 0:
9
- url = 'https://places.googleapis.com/v1/places:searchNearby';
10
- headers = {
11
- 'Content-Type': 'application/json',
12
- 'X-Goog-Api-Key': "AIzaSyAXPlfaoMCrmjNV1u-vFYdLBi7GkGeh4S4",
13
- 'X-Goog-FieldMask': 'places.location,places.displayName,places.types'
14
- };
15
- data = {
16
- includedTypes: typesArray,
17
- maxResultCount: 20,
18
- locationRestriction: {
19
- circle: {
20
- center: location,
21
- radius: radius
22
- }
23
- }
24
- };
25
- _context.prev = 3;
26
- _context.next = 6;
27
- return fetch(url, {
28
- method: 'POST',
29
- headers: headers,
30
- body: JSON.stringify(data)
31
- });
32
- case 6:
33
- response = _context.sent;
34
- if (response.ok) {
35
- _context.next = 9;
36
- break;
37
- }
38
- throw new Error("HTTP error! status: ".concat(response.status));
39
- case 9:
40
- _context.next = 11;
41
- return response.json();
42
- case 11:
43
- return _context.abrupt("return", _context.sent);
44
- case 14:
45
- _context.prev = 14;
46
- _context.t0 = _context["catch"](3);
47
- console.error('Error making the Nearby Search request:', _context.t0);
48
- throw _context.t0;
49
- case 18:
50
- case "end":
51
- return _context.stop();
52
- }
53
- }, _callee, null, [[3, 14]]);
54
- }));
55
- return function searchNearbyPlaces(_x, _x2, _x3) {
56
- return _ref.apply(this, arguments);
57
- };
58
- }();
1
+ const searchNearbyPlaces = async (typesArray, location, radius) => {
2
+ const url = 'https://places.googleapis.com/v1/places:searchNearby';
3
+ const headers = {
4
+ 'Content-Type': 'application/json',
5
+ 'X-Goog-Api-Key': "AIzaSyAXPlfaoMCrmjNV1u-vFYdLBi7GkGeh4S4",
6
+ 'X-Goog-FieldMask': 'places.location,places.displayName,places.types'
7
+ };
8
+ const data = {
9
+ includedTypes: typesArray,
10
+ maxResultCount: 20,
11
+ locationRestriction: {
12
+ circle: {
13
+ center: location,
14
+ radius: radius
15
+ }
16
+ }
17
+ };
18
+ try {
19
+ const response = await fetch(url, {
20
+ method: 'POST',
21
+ headers: headers,
22
+ body: JSON.stringify(data)
23
+ });
24
+ if (!response.ok) {
25
+ throw new Error(`HTTP error! status: ${response.status}`);
26
+ }
27
+ return await response.json();
28
+ }
29
+ catch (error) {
30
+ console.error('Error making the Nearby Search request:', error);
31
+ throw error;
32
+ }
33
+ };
59
34
 
60
35
  export { searchNearbyPlaces };
61
36
  //# sourceMappingURL=googlePlacesNearbyService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"googlePlacesNearbyService.js","sources":["../../src/services/googlePlacesNearbyService.js"],"sourcesContent":["export const searchNearbyPlaces = async (typesArray, location, radius) => {\r\n\tconst url = 'https://places.googleapis.com/v1/places:searchNearby';\r\n\tconst headers = {\r\n\t\t'Content-Type': 'application/json',\r\n\t\t'X-Goog-Api-Key': process.env.GOOGLE_MAPS_API_KEY,\r\n\t\t'X-Goog-FieldMask': 'places.location,places.displayName,places.types'\r\n\t};\r\n\tconst data = {\r\n\t\tincludedTypes: typesArray,\r\n\t\tmaxResultCount: 20,\r\n\t\tlocationRestriction: {\r\n\t\t\tcircle: {\r\n\t\t\t\tcenter: location,\r\n\t\t\t\tradius: radius\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\ttry {\r\n\t\tconst response = await fetch(url, {\r\n\t\t\tmethod: 'POST',\r\n\t\t\theaders: headers,\r\n\t\t\tbody: JSON.stringify(data)\r\n\t\t});\r\n\t\tif (!response.ok) {\r\n\t\t\tthrow new Error(`HTTP error! status: ${response.status}`);\r\n\t\t}\r\n\t\treturn await response.json();\r\n\t} catch (error) {\r\n\t\tconsole.error('Error making the Nearby Search request:', error);\r\n\t\tthrow error;\r\n\t}\r\n};\r\n"],"names":["searchNearbyPlaces","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","typesArray","location","radius","url","headers","data","response","wrap","_callee$","_context","prev","next","includedTypes","maxResultCount","locationRestriction","circle","center","fetch","method","body","JSON","stringify","sent","ok","Error","concat","status","json","abrupt","t0","console","error","stop","_x","_x2","_x3","apply","arguments"],"mappings":";;IAAaA,kBAAkB,gBAAA,YAAA;AAAA,EAAA,IAAAC,IAAA,GAAAC,iBAAA,eAAAC,mBAAA,EAAAC,CAAAA,IAAA,CAAG,SAAAC,OAAOC,CAAAA,UAAU,EAAEC,QAAQ,EAAEC,MAAM,EAAA;AAAA,IAAA,IAAAC,GAAA,EAAAC,OAAA,EAAAC,IAAA,EAAAC,QAAA,CAAA;AAAA,IAAA,OAAAT,mBAAA,EAAA,CAAAU,IAAA,CAAA,SAAAC,SAAAC,QAAA,EAAA;AAAA,MAAA,OAAA,CAAA,EAAA,QAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;AAAA,QAAA,KAAA,CAAA;AAC9DR,UAAAA,GAAG,GAAG,sDAAsD,CAAA;AAC5DC,UAAAA,OAAO,GAAG;AACf,YAAA,cAAc,EAAE,kBAAkB;AAClC,YAAA,gBAAgB,EAAE,yCAA+B;AACjD,YAAA,kBAAkB,EAAE,iDAAA;WACpB,CAAA;AACKC,UAAAA,IAAI,GAAG;AACZO,YAAAA,aAAa,EAAEZ,UAAU;AACzBa,YAAAA,cAAc,EAAE,EAAE;AAClBC,YAAAA,mBAAmB,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AAA,CAAAoB,EAAA,CAAA;AAAA,QAAA,KAAA,EAAA,CAAA;AAAA,QAAA,KAAA,KAAA;UAAA,OAAApB,QAAA,CAAAuB,IAAA,EAAA,CAAA;AAAA,OAAA;AAAA,KAAA,EAAAjC,OAAA,EAAA,IAAA,EAAA,CAAA,CAAA,CAAA,EAAA,EAAA,CAAA,CAAA,CAAA,CAAA;GAGjE,CAAA,CAAA,CAAA;AAAA,EAAA,OAAA,SAhCYL,kBAAkBA,CAAAuC,EAAA,EAAAC,GAAA,EAAAC,GAAA,EAAA;AAAA,IAAA,OAAAxC,IAAA,CAAAyC,KAAA,CAAA,IAAA,EAAAC,SAAA,CAAA,CAAA;AAAA,GAAA,CAAA;AAAA,CAgC9B;;;;"}
1
+ {"version":3,"file":"googlePlacesNearbyService.js","sources":["../../src/services/googlePlacesNearbyService.ts"],"sourcesContent":["export interface Location {\r\n\tlatitude: number;\r\n\tlongitude: number;\r\n}\r\n\r\nexport const searchNearbyPlaces = async (\r\n\ttypesArray: string[],\r\n\tlocation: Location,\r\n\tradius: number\r\n): Promise<any> => {\r\n\tconst url = 'https://places.googleapis.com/v1/places:searchNearby';\r\n\tconst headers = {\r\n\t\t'Content-Type': 'application/json',\r\n\t\t'X-Goog-Api-Key': process.env.GOOGLE_MAPS_API_KEY as string,\r\n\t\t'X-Goog-FieldMask': 'places.location,places.displayName,places.types'\r\n\t};\r\n\tconst data = {\r\n\t\tincludedTypes: typesArray,\r\n\t\tmaxResultCount: 20,\r\n\t\tlocationRestriction: {\r\n\t\t\tcircle: {\r\n\t\t\t\tcenter: location,\r\n\t\t\t\tradius: radius\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\r\n\ttry {\r\n\t\tconst response = await fetch(url, {\r\n\t\t\tmethod: 'POST',\r\n\t\t\theaders: headers,\r\n\t\t\tbody: JSON.stringify(data)\r\n\t\t});\r\n\t\tif (!response.ok) {\r\n\t\t\tthrow new Error(`HTTP error! status: ${response.status}`);\r\n\t\t}\r\n\t\treturn await response.json();\r\n\t} catch (error) {\r\n\t\tconsole.error('Error making the Nearby Search request:', error);\r\n\t\tthrow error;\r\n\t}\r\n};\r\n"],"names":[],"mappings":"AAKO,MAAM,kBAAkB,GAAG,OACjC,UAAoB,EACpB,QAAkB,EAClB,MAAc,KACG;IACjB,MAAM,GAAG,GAAG,sDAAsD,CAAC;AACnE,IAAA,MAAM,OAAO,GAAG;AACf,QAAA,cAAc,EAAE,kBAAkB;AAClC,QAAA,gBAAgB,EAAE,yCAAyC;AAC3D,QAAA,kBAAkB,EAAE,iDAAiD;KACrE,CAAC;AACF,IAAA,MAAM,IAAI,GAAG;AACZ,QAAA,aAAa,EAAE,UAAU;AACzB,QAAA,cAAc,EAAE,EAAE;AAClB,QAAA,mBAAmB,EAAE;AACpB,YAAA,MAAM,EAAE;AACP,gBAAA,MAAM,EAAE,QAAQ;AAChB,gBAAA,MAAM,EAAE,MAAM;AACd,aAAA;AACD,SAAA;KACD,CAAC;IAEF,IAAI;AACH,QAAA,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,EAAE;AACjC,YAAA,MAAM,EAAE,MAAM;AACd,YAAA,OAAO,EAAE,OAAO;AAChB,YAAA,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;AAC1B,SAAA,CAAC,CAAC;AACH,QAAA,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE;YACjB,MAAM,IAAI,KAAK,CAAC,CAAA,oBAAA,EAAuB,QAAQ,CAAC,MAAM,CAAE,CAAA,CAAC,CAAC;AAC1D,SAAA;AACD,QAAA,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;AAC7B,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;AACf,QAAA,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE,KAAK,CAAC,CAAC;AAChE,QAAA,MAAM,KAAK,CAAC;AACZ,KAAA;AACF;;;;"}
@@ -1,83 +1,43 @@
1
- import { asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime, toConsumableArray as _toConsumableArray } from '../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import { getListings } from './listingService.js';
3
2
  import { getRecruiters } from './recruiterService.js';
4
3
  import { getListingEntities } from './listingEntityService.js';
5
4
  import { getDistinctItemsByProximity } from '../util/mapUtil.js';
6
5
 
7
- var fetchListings = /*#__PURE__*/function () {
8
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(query, siteConfig) {
9
- var commuteLocation,
10
- listingsResult,
11
- recruiterIds,
12
- fetchedRecruiters,
13
- distinctEntityIds,
14
- fetchedEntities,
15
- i,
16
- distinctItems,
17
- _args = arguments;
18
- return _regeneratorRuntime().wrap(function _callee$(_context) {
19
- while (1) switch (_context.prev = _context.next) {
20
- case 0:
21
- commuteLocation = _args.length > 2 && _args[2] !== undefined ? _args[2] : null;
22
- _context.prev = 1;
23
- _context.next = 4;
24
- return getListings(siteConfig.companyId, 5000, 1, query);
25
- case 4:
26
- listingsResult = _context.sent;
27
- recruiterIds = _toConsumableArray(new Set(listingsResult.map(function (listing) {
28
- return listing.recruiterId;
29
- })));
30
- _context.next = 8;
31
- return getRecruiters(recruiterIds);
32
- case 8:
33
- fetchedRecruiters = _context.sent;
34
- distinctEntityIds = _toConsumableArray(new Set(listingsResult.map(function (listing) {
35
- return listing.entityId;
36
- })));
37
- if (commuteLocation) {
38
- _context.next = 16;
39
- break;
40
- }
41
- _context.next = 13;
42
- return getListingEntities(distinctEntityIds);
43
- case 13:
44
- _context.t0 = _context.sent;
45
- _context.next = 19;
46
- break;
47
- case 16:
48
- _context.next = 18;
49
- return getListingEntities(distinctEntityIds, "".concat(commuteLocation.lat, ", ").concat(commuteLocation.lng));
50
- case 18:
51
- _context.t0 = _context.sent;
52
- case 19:
53
- fetchedEntities = _context.t0;
54
- for (i = 0; i < listingsResult.length; i++) {
55
- if (listingsResult[i].entityId != -1) {
56
- listingsResult[i].fields.travelTime = fetchedEntities[listingsResult[i].entityId].travelTime;
57
- }
58
- }
59
- distinctItems = getDistinctItemsByProximity(listingsResult, fetchedEntities);
60
- return _context.abrupt("return", {
61
- listingsResult: listingsResult,
62
- fetchedRecruiters: fetchedRecruiters,
63
- fetchedEntities: fetchedEntities,
64
- distinctItems: distinctItems
65
- });
66
- case 25:
67
- _context.prev = 25;
68
- _context.t1 = _context["catch"](1);
69
- console.error("Error fetching listings:", _context.t1);
70
- throw _context.t1;
71
- case 29:
72
- case "end":
73
- return _context.stop();
74
- }
75
- }, _callee, null, [[1, 25]]);
76
- }));
77
- return function fetchListings(_x, _x2) {
78
- return _ref.apply(this, arguments);
79
- };
80
- }();
6
+ const fetchListings = async (query, siteConfig, commuteLocation = null) => {
7
+ try {
8
+ const listingsResult = await getListings();
9
+ const recruiterIds = [
10
+ ...new Set(listingsResult.map(listing => listing.recruiterId))
11
+ ];
12
+ const fetchedRecruiters = await getRecruiters(recruiterIds);
13
+ const distinctEntityIds = [
14
+ ...new Set(listingsResult.map(listing => listing.entityId))
15
+ ];
16
+ const fetchedEntities = !commuteLocation
17
+ ? await getListingEntities(distinctEntityIds)
18
+ : await getListingEntities(distinctEntityIds, `${commuteLocation.lat}, ${commuteLocation.lng}`);
19
+ for (let i = 0; i < listingsResult.length; i++) {
20
+ const listing = listingsResult[i];
21
+ if (listing.entityId && listing.entityId !== -1 && listing.fields) {
22
+ const entity = fetchedEntities[listing.entityId];
23
+ if (entity) {
24
+ listing.fields.travelTime = entity.travelTime;
25
+ }
26
+ }
27
+ }
28
+ const distinctItems = getDistinctItemsByProximity(listingsResult, fetchedEntities);
29
+ return {
30
+ listingsResult,
31
+ fetchedRecruiters,
32
+ fetchedEntities,
33
+ distinctItems
34
+ };
35
+ }
36
+ catch (error) {
37
+ console.error("Error fetching listings:", error);
38
+ throw error;
39
+ }
40
+ };
81
41
 
82
42
  export { fetchListings as default };
83
43
  //# sourceMappingURL=listingAggregatorService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"listingAggregatorService.js","sources":["../../src/services/listingAggregatorService.js"],"sourcesContent":["import { getListings } from '~/services/listingService';\r\nimport { getRecruiters } from '~/services/recruiterService';\r\nimport { getListingEntities } from '~/services/listingEntityService';\r\n\r\nimport { getDistinctItemsByProximity } from '~/util/mapUtil';\r\n\r\nconst fetchListings = async (query, siteConfig, commuteLocation = null) => {\r\n\ttry {\r\n\t\tconst listingsResult = await getListings(\r\n\t\t\tsiteConfig.companyId,\r\n\t\t\t5000,\r\n\t\t\t1,\r\n\t\t\tquery\r\n\t\t);\r\n\t\tconst recruiterIds = [\r\n\t\t\t// eslint-disable-next-line no-undef\r\n\t\t\t...new Set(listingsResult.map(listing => listing.recruiterId))\r\n\t\t];\r\n\t\tconst fetchedRecruiters = await getRecruiters(recruiterIds);\r\n\r\n\t\tconst distinctEntityIds = [\r\n\t\t\t// eslint-disable-next-line no-undef\r\n\t\t\t...new Set(listingsResult.map(listing => listing.entityId))\r\n\t\t];\r\n\r\n\t\tconst fetchedEntities = !commuteLocation ? await getListingEntities(\r\n\t\t\tdistinctEntityIds) : await getListingEntities(\r\n\t\t\tdistinctEntityIds,`${commuteLocation.lat}, ${commuteLocation.lng}`);\r\n\t\tfor (var i = 0; i < listingsResult.length; i++) {\r\n\t\t\tif (listingsResult[i].entityId != -1) {\r\n\t\t\t\tlistingsResult[i].fields.travelTime = fetchedEntities[listingsResult[i].entityId].travelTime;\r\n\t\t\t}\r\n\t\t}\r\n\t\tconst distinctItems = getDistinctItemsByProximity(\r\n\t\t\tlistingsResult,\r\n\t\t\tfetchedEntities\r\n\t\t);\r\n\t\treturn {\r\n\t\t\tlistingsResult,\r\n\t\t\tfetchedRecruiters,\r\n\t\t\tfetchedEntities,\r\n\t\t\tdistinctItems\r\n\t\t};\r\n\t} catch (error) {\r\n\t\tconsole.error(\"Error fetching listings:\", error);\r\n\t\tthrow error;\r\n\t}\r\n};\r\n\r\nexport default fetchListings;\r\n"],"names":["fetchListings","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","query","siteConfig","commuteLocation","listingsResult","recruiterIds","fetchedRecruiters","distinctEntityIds","fetchedEntities","i","distinctItems","_args","arguments","wrap","_callee$","_context","prev","next","length","undefined","getListings","companyId","sent","_toConsumableArray","Set","map","listing","recruiterId","getRecruiters","entityId","getListingEntities","t0","concat","lat","lng","fields","travelTime","getDistinctItemsByProximity","abrupt","t1","console","error","stop","_x","_x2","apply"],"mappings":";;;;;;AAMA,IAAMA,aAAa,gBAAA,YAAA;AAAA,EAAA,IAAAC,IAAA,GAAAC,iBAAA,eAAAC,mBAAA,EAAA,CAAAC,IAAA,CAAG,SAAAC,OAAAA,CAAOC,KAAK,EAAEC,UAAU,EAAA;AAAA,IAAA,IAAAC,eAAA;MAAAC,cAAA;MAAAC,YAAA;MAAAC,iBAAA;MAAAC,iBAAA;MAAAC,eAAA;MAAAC,CAAA;MAAAC,aAAA;AAAAC,MAAAA,KAAA,GAAAC,SAAA,CAAA;AAAA,IAAA,OAAAd,mBAAA,EAAA,CAAAe,IAAA,CAAA,SAAAC,SAAAC,QAAA,EAAA;AAAA,MAAA,OAAA,CAAA,EAAA,QAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;AAAA,QAAA,KAAA,CAAA;UAAEd,eAAe,GAAAQ,KAAA,CAAAO,MAAA,GAAA,CAAA,IAAAP,KAAA,CAAA,CAAA,CAAA,KAAAQ,SAAA,GAAAR,KAAA,CAAA,CAAA,CAAA,GAAG,IAAI,CAAA;AAAAI,UAAAA,QAAA,CAAAC,IAAA,GAAA,CAAA,CAAA;AAAAD,UAAAA,QAAA,CAAAE,IAAA,GAAA,CAAA,CAAA;UAAA,OAEvCG,WAAW,CACvClB,UAAU,CAACmB,SAAS,EACpB,IAAI,EACJ,CAAC,EACDpB,KACD,CAAC,CAAA;AAAA,QAAA,KAAA,CAAA;UALKG,cAAc,GAAAW,QAAA,CAAAO,IAAA,CAAA;UAMdjB,YAAY,GAAAkB,kBAAA,CAEd,IAAIC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KL,aAAaA,CAAAgD,EAAA,EAAAC,GAAA,EAAA;AAAA,IAAA,OAAAhD,IAAA,CAAAiD,KAAA,CAAA,IAAA,EAAAjC,SAAA,CAAA,CAAA;AAAA,GAAA,CAAA;AAAA,CAyClB;;;;"}
1
+ {"version":3,"file":"listingAggregatorService.js","sources":["../../src/services/listingAggregatorService.ts"],"sourcesContent":["import { getListings } from '~/services/listingService';\nimport { getRecruiters } from '~/services/recruiterService';\nimport { getListingEntities } from '~/services/listingEntityService';\n\nimport { getDistinctItemsByProximity } from '~/util/mapUtil';\nimport { Listing } from '~/types/Listings';\nimport { Recruiter } from '~/types/Recruiter';\nimport { ListingEntity } from '~/types/ListingEntity';\nimport { MapConfig } from '~/types/config/MapConfig';\n//import { ICommuteLocation } from '~/interfaces/ICommute';\n\ninterface SiteConfig {\n companyId: number;\n}\n\ninterface FetchListingsResult {\n listingsResult: Listing[];\n fetchedRecruiters: Recruiter[];\n fetchedEntities: Record<number, ListingEntity>;\n distinctItems: any; // Update this type based on the return type of getDistinctItemsByProximity\n}\n\nconst fetchListings = async (\n\tquery: string,\n\tsiteConfig: MapConfig,\n\tcommuteLocation: any | null = null\n): Promise<FetchListingsResult> => {\n\ttry {\n\t\tconst listingsResult = await getListings(\n\n\t\t);\n\n\t\tconst recruiterIds: number[] = [\n\t\t\t...new Set(listingsResult.map(listing => listing.recruiterId))\n\t\t] as number[];\n\n\t\tconst fetchedRecruiters = await getRecruiters(recruiterIds);\n\n\t\tconst distinctEntityIds: number[] = [\n\t\t\t...new Set(listingsResult.map(listing => listing.entityId))\n\t\t] as number[];\n\n\t\tconst fetchedEntities = !commuteLocation\n\t\t\t? await getListingEntities(distinctEntityIds)\n\t\t\t: await getListingEntities(\n\t\t\t\tdistinctEntityIds,\n\t\t\t\t`${commuteLocation.lat}, ${commuteLocation.lng}`\n\t\t\t);\n\t\tfor (let i = 0; i < listingsResult.length; i++) {\n\t\t\tconst listing = listingsResult[i];\n\t\t\tif (listing.entityId && listing.entityId !== -1 && listing.fields) {\n\t\t\t\tconst entity = fetchedEntities[listing.entityId];\n\t\t\t\tif (entity) {\n\t\t\t\t\tlisting.fields.travelTime = entity.travelTime;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst distinctItems = getDistinctItemsByProximity(\n\t\t\tlistingsResult,\n\t\t\tfetchedEntities\n\t\t);\n\n\t\treturn {\n\t\t\tlistingsResult,\n\t\t\tfetchedRecruiters,\n\t\t\tfetchedEntities,\n\t\t\tdistinctItems\n\t\t};\n\t} catch (error) {\n\t\tconsole.error(\"Error fetching listings:\", error);\n\t\tthrow error;\n\t}\n};\n\nexport default fetchListings;\n"],"names":[],"mappings":";;;;;AAsBM,MAAA,aAAa,GAAG,OACrB,KAAa,EACb,UAAqB,EACrB,eAAA,GAA8B,IAAI,KACD;IACjC,IAAI;AACH,QAAA,MAAM,cAAc,GAAG,MAAM,WAAW,EAEvC,CAAC;AAEF,QAAA,MAAM,YAAY,GAAa;AAC9B,YAAA,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC,WAAW,CAAC,CAAC;SAClD,CAAC;AAEd,QAAA,MAAM,iBAAiB,GAAG,MAAM,aAAa,CAAC,YAAY,CAAC,CAAC;AAE5D,QAAA,MAAM,iBAAiB,GAAa;AACnC,YAAA,GAAG,IAAI,GAAG,CAAC,cAAc,CAAC,GAAG,CAAC,OAAO,IAAI,OAAO,CAAC,QAAQ,CAAC,CAAC;SAC/C,CAAC;QAEd,MAAM,eAAe,GAAG,CAAC,eAAe;AACvC,cAAE,MAAM,kBAAkB,CAAC,iBAAiB,CAAC;AAC7C,cAAE,MAAM,kBAAkB,CACzB,iBAAiB,EACjB,CAAG,EAAA,eAAe,CAAC,GAAG,KAAK,eAAe,CAAC,GAAG,CAAA,CAAE,CAChD,CAAC;AACH,QAAA,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,cAAc,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;AAC/C,YAAA,MAAM,OAAO,GAAG,cAAc,CAAC,CAAC,CAAC,CAAC;AAClC,YAAA,IAAI,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAC,QAAQ,KAAK,CAAC,CAAC,IAAI,OAAO,CAAC,MAAM,EAAE;gBAClE,MAAM,MAAM,GAAG,eAAe,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AACjD,gBAAA,IAAI,MAAM,EAAE;oBACX,OAAO,CAAC,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;AAC9C,iBAAA;AACD,aAAA;AACD,SAAA;QAED,MAAM,aAAa,GAAG,2BAA2B,CAChD,cAAc,EACd,eAAe,CACf,CAAC;QAEF,OAAO;YACN,cAAc;YACd,iBAAiB;YACjB,eAAe;YACf,aAAa;SACb,CAAC;AACF,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;AACf,QAAA,OAAO,CAAC,KAAK,CAAC,0BAA0B,EAAE,KAAK,CAAC,CAAC;AACjD,QAAA,MAAM,KAAK,CAAC;AACZ,KAAA;AACF;;;;"}
@@ -1,36 +1,15 @@
1
- import { asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import api from '../apis/hcApi.js';
3
2
 
4
- var getListingEntities = /*#__PURE__*/function () {
5
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(entityIds) {
6
- var origin,
7
- response,
8
- _args = arguments;
9
- return _regeneratorRuntime().wrap(function _callee$(_context) {
10
- while (1) switch (_context.prev = _context.next) {
11
- case 0:
12
- origin = _args.length > 1 && _args[1] !== undefined ? _args[1] : '';
13
- _context.prev = 1;
14
- _context.next = 4;
15
- return api.post("/ListingEntities?origin=".concat(origin), entityIds);
16
- case 4:
17
- response = _context.sent;
18
- return _context.abrupt("return", response);
19
- case 8:
20
- _context.prev = 8;
21
- _context.t0 = _context["catch"](1);
22
- console.error("Error fetching listing entities:", _context.t0);
23
- throw _context.t0;
24
- case 12:
25
- case "end":
26
- return _context.stop();
27
- }
28
- }, _callee, null, [[1, 8]]);
29
- }));
30
- return function getListingEntities(_x) {
31
- return _ref.apply(this, arguments);
32
- };
33
- }();
3
+ const getListingEntities = async (entityIds, origin = '') => {
4
+ try {
5
+ const response = await api.post(`/ListingEntities?origin=${origin}`, entityIds);
6
+ return response;
7
+ }
8
+ catch (error) {
9
+ console.error("Error fetching listing entities:", error);
10
+ throw error;
11
+ }
12
+ };
34
13
 
35
14
  export { getListingEntities };
36
15
  //# sourceMappingURL=listingEntityService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"listingEntityService.js","sources":["../../src/services/listingEntityService.js"],"sourcesContent":["import api from '~/apis/hcApi';\r\n\r\nexport const getListingEntities = async (entityIds, origin = '') => {\r\n\ttry {\r\n\t\tconst response = await api.post(`/ListingEntities?origin=${origin}`, entityIds);\r\n\t\treturn response;\r\n\t} catch (error) {\r\n\t\tconsole.error(\"Error fetching listing entities:\", error);\r\n\t\tthrow error;\r\n\t}\r\n};\r\n\r\nexport default {\r\n\tgetListingEntities\r\n};\r\n"],"names":["getListingEntities","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","entityIds","origin","response","_args","arguments","wrap","_callee$","_context","prev","next","length","undefined","api","post","concat","sent","abrupt","t0","console","error","stop","_x","apply"],"mappings":";;;IAEaA,kBAAkB,gBAAA,YAAA;EAAA,IAAAC,IAAA,GAAAC,iBAAA,eAAAC,mBAAA,GAAAC,IAAA,CAAG,SAAAC,OAAAA,CAAOC,SAAS,EAAA;AAAA,IAAA,IAAAC,MAAA;MAAAC,QAAA;AAAAC,MAAAA,KAAA,GAAAC,SAAA,CAAA;AAAA,IAAA,OAAAP,mBAAA,EAAA,CAAAQ,IAAA,CAAA,SAAAC,SAAAC,QAAA,EAAA;AAAA,MAAA,OAAA,CAAA,EAAA,QAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,I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ityService.js","sources":["../../src/services/listingEntityService.ts"],"sourcesContent":["import api from '~/apis/hcApi';\nimport { ListingEntity } from '~/types/ListingEntity';\n\nexport const getListingEntities = async (entityIds: number[], origin = ''): Promise<ListingEntity[]> => {\n\ttry {\n\t\tconst response = await api.post<ListingEntity[]>(`/ListingEntities?origin=${origin}`, entityIds);\n\t\treturn response;\n\t} catch (error) {\n\t\tconsole.error(\"Error fetching listing entities:\", error);\n\t\tthrow error;\n\t}\n};\n\nexport default {\n\tgetListingEntities\n};\n"],"names":[],"mappings":";;AAGO,MAAM,kBAAkB,GAAG,OAAO,SAAmB,EAAE,MAAM,GAAG,EAAE,KAA8B;IACtG,IAAI;AACH,QAAA,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,IAAI,CAAkB,CAAA,wBAAA,EAA2B,MAAM,CAAA,CAAE,EAAE,SAAS,CAAC,CAAC;AACjG,QAAA,OAAO,QAAQ,CAAC;AAChB,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;AACf,QAAA,OAAO,CAAC,KAAK,CAAC,kCAAkC,EAAE,KAAK,CAAC,CAAC;AACzD,QAAA,MAAM,KAAK,CAAC;AACZ,KAAA;AACF;;;;"}
@@ -1,64 +1,30 @@
1
- import { asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from './_virtual/_rollupPluginBabelHelpers.js';
2
- import api from './apis/hcApi.js';
1
+ import api from '../apis/hcApi.js';
3
2
 
4
- var getListings = /*#__PURE__*/function () {
5
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
6
- var response;
7
- return _regeneratorRuntime().wrap(function _callee$(_context) {
8
- while (1) switch (_context.prev = _context.next) {
9
- case 0:
10
- _context.prev = 0;
11
- _context.next = 3;
12
- return api.get("/Listings");
13
- case 3:
14
- response = _context.sent;
15
- return _context.abrupt("return", response);
16
- case 7:
17
- _context.prev = 7;
18
- _context.t0 = _context["catch"](0);
19
- console.error(_context.t0);
20
- throw _context.t0;
21
- case 11:
22
- case "end":
23
- return _context.stop();
24
- }
25
- }, _callee, null, [[0, 7]]);
26
- }));
27
- return function getListings() {
28
- return _ref.apply(this, arguments);
29
- };
30
- }();
31
- var getListingDetails = /*#__PURE__*/function () {
32
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(listingId) {
33
- var response;
34
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
35
- while (1) switch (_context2.prev = _context2.next) {
36
- case 0:
37
- _context2.prev = 0;
38
- _context2.next = 3;
39
- return api.get("/ListingDetails/".concat(listingId));
40
- case 3:
41
- response = _context2.sent;
42
- return _context2.abrupt("return", response);
43
- case 7:
44
- _context2.prev = 7;
45
- _context2.t0 = _context2["catch"](0);
46
- console.error(_context2.t0);
47
- throw _context2.t0;
48
- case 11:
49
- case "end":
50
- return _context2.stop();
51
- }
52
- }, _callee2, null, [[0, 7]]);
53
- }));
54
- return function getListingDetails(_x) {
55
- return _ref2.apply(this, arguments);
56
- };
57
- }();
58
- var listingService = {
59
- getListings: getListings,
60
- getListingDetails: getListingDetails
3
+ const getListings = async (params) => {
4
+ try {
5
+ const query = new URLSearchParams();
6
+ if (params) {
7
+ if (params.location)
8
+ params.location.forEach(loc => query.append('location', loc));
9
+ if (params.category)
10
+ params.category.forEach(cat => query.append('category', cat));
11
+ if (params.categoryClass)
12
+ params.categoryClass.forEach(catClass => query.append('categoryClass', catClass));
13
+ if (params.education)
14
+ params.education.forEach(edu => query.append('education', edu));
15
+ if (params.city)
16
+ params.city.forEach(cty => query.append('city', cty));
17
+ if (params.state)
18
+ params.state.forEach(st => query.append('state', st));
19
+ }
20
+ const response = await api.get(`/Listings?${query.toString()}`);
21
+ return response;
22
+ }
23
+ catch (error) {
24
+ console.error(error);
25
+ throw error;
26
+ }
61
27
  };
62
28
 
63
- export { listingService as default, getListingDetails, getListings };
29
+ export { getListings };
64
30
  //# sourceMappingURL=listingService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"listingService.js","sources":["../../src/services/listingService.js"],"sourcesContent":["import api from '~/apis/hcApi';\r\n\r\nexport const getListings = async () => {\r\n\ttry {\r\n\t\tconst response = await api.get(`/Listings`);\r\n\t\treturn response;\r\n\t} catch (error) {\r\n\t\tconsole.error(error);\r\n\t\tthrow error;\r\n\t}\r\n};\r\n\r\nexport const getListingDetails = async listingId => {\r\n\ttry {\r\n\t\tconst response = await api.get(`/ListingDetails/${listingId}`);\r\n\t\treturn response;\r\n\t} catch (error) {\r\n\t\tconsole.error(error);\r\n\t\tthrow error;\r\n\t}\r\n};\r\n\r\nexport default {\r\n\tgetListings,\r\n\tgetListingDetails\r\n};\r\n"],"names":["getListings","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","response","wrap","_callee$","_context","prev","next","api","get","sent","abrupt","t0","console","error","stop","apply","arguments","getListingDetails","_ref2","_callee2","listingId","_callee2$","_context2","concat","_x"],"mappings":";;;IAEaA,WAAW,gBAAA,YAAA;EAAA,IAAAC,IAAA,GAAAC,iBAAA,eAAAC,mBAAA,EAAAC,CAAAA,IAAA,CAAG,SAAAC,OAAA,GAAA;AAAA,IAAA,IAAAC,QAAA,CAAA;AAAA,IAAA,OAAAH,mBAAA,EAAA,CAAAI,IAAA,CAAA,SAAAC,SAAAC,QAAA,EAAA;AAAA,MAAA,OAAA,CAAA,EAAA,QAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;AAAA,QAAA,KAAA,CAAA;AAAAF,UAAAA,QAAA,CAAAC,IAAA,GAAA,CAAA,CAAA;AAAAD,UAAAA,QAAA,CAAAE,IAAA,GAAA,CAAA,CAAA;AAAA,UAAA,OAEFC,GAAG,CAACC,GAAG,CAAA,WAAY,CAAC,CAAA;AAAA,QAAA,KAAA,CAAA;UAArCP,QAAQ,GAAAG,QAAA,CAAAK,IAAA,CAAA;AAAA,UAAA,OAAAL,QAAA,CAAAM,MAAA,CAAA,QAAA,EACPT,QAAQ,CAAA,CAAA;AAAA,QAAA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AQ,GAAAqB,SAAA,CAAAb,IAAA,CAAA;AAAA,UAAA,OAAAa,SAAA,CAAAZ,MAAA,CAAA,QAAA,EACPT,QAAQ,CAAA,CAAA;AAAA,QAAA,KAAA,CAAA;AAAAqB,UAAAA,SAAA,CAAAjB,IAAA,GAAA,CAAA,CAAA;UAAAiB,SAAA,CAAAX,EAAA,GAAAW,SAAA,CAAA,OAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAEfV,UAAAA,OAAO,CAACC,KAAK,CAAAS,SAAA,CAAAX,EAAM,CAAC,CAAA;UAAC,MAAAW,SAAA,CAAAX,EAAA,CAAA;AAAA,QAAA,KAAA,EAAA,CAAA;AAAA,QAAA,KAAA,KAAA;UAAA,OAAAW,SAAA,CAAAR,IAAA,EAAA,CAAA;AAAA,OAAA;AAAA,KAAA,EAAAK,QAAA,EAAA,IAAA,EAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA;GAGtB,CAAA,CAAA,CAAA;EAAA,OARYF,SAAAA,iBAAiBA,CAAAO,EAAA,EAAA;AAAA,IAAA,OAAAN,KAAA,CAAAH,KAAA,CAAA,IAAA,EAAAC,SAAA,CAAA,CAAA;AAAA,GAAA,CAAA;AAAA,CAQ7B,GAAA;AAED,qBAAe;AACdrB,EAAAA,WAAW,EAAXA,WAAW;AACXsB,EAAAA,iBAAiB,EAAjBA,iBAAAA;AACD,CAAC;;;;"}
1
+ {"version":3,"file":"listingService.js","sources":["../../src/services/listingService.ts"],"sourcesContent":["// listingService.ts\nimport { GetListingsParams } from '~/types/GetListingParams';\nimport api from '../apis/hcApi';\nimport { Listing } from '../types/Listings';\n\nexport const getListings = async (params?: GetListingsParams): Promise<Listing[]> => {\n\ttry {\n\t\tconst query = new URLSearchParams();\n\n\t\tif (params) {\n\t\t\tif (params.location) params.location.forEach(loc => query.append('location', loc));\n\t\t\tif (params.category) params.category.forEach(cat => query.append('category', cat));\n\t\t\tif (params.categoryClass) params.categoryClass.forEach(catClass => query.append('categoryClass', catClass));\n\t\t\tif (params.education) params.education.forEach(edu => query.append('education', edu));\n\t\t\tif (params.city) params.city.forEach(cty => query.append('city', cty));\n\t\t\tif (params.state) params.state.forEach(st => query.append('state', st));\n\t\t}\n\n\t\tconst response = await api.get(`/Listings?${query.toString()}`);\n\t\treturn response as Listing[];\n\t} catch (error) {\n\t\tconsole.error(error);\n\t\tthrow error;\n\t}\n};\n\nexport const getListingDetails = async (listingId: string) => {\n\ttry {\n\t\tconst response = await api.get(`/ListingDetails/${listingId}`);\n\t\treturn response;\n\t} catch (error) {\n\t\tconsole.error(error);\n\t\tthrow error;\n\t}\n};\n\nexport default {\n\tgetListings,\n\tgetListingDetails\n};\n"],"names":[],"mappings":";;MAKa,WAAW,GAAG,OAAO,MAA0B,KAAwB;IACnF,IAAI;AACH,QAAA,MAAM,KAAK,GAAG,IAAI,eAAe,EAAE,CAAC;AAEpC,QAAA,IAAI,MAAM,EAAE;YACX,IAAI,MAAM,CAAC,QAAQ;AAAE,gBAAA,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;YACnF,IAAI,MAAM,CAAC,QAAQ;AAAE,gBAAA,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC,CAAC;YACnF,IAAI,MAAM,CAAC,aAAa;AAAE,gBAAA,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,IAAI,KAAK,CAAC,MAAM,CAAC,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC;YAC5G,IAAI,MAAM,CAAC,SAAS;AAAE,gBAAA,MAAM,CAAC,SAAS,CAAC,OAAO,CAAC,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC;YACtF,IAAI,MAAM,CAAC,IAAI;AAAE,gBAAA,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;YACvE,IAAI,MAAM,CAAC,KAAK;AAAE,gBAAA,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,KAAK,CAAC,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;AACxE,SAAA;AAED,QAAA,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,GAAG,CAAC,CAAa,UAAA,EAAA,KAAK,CAAC,QAAQ,EAAE,CAAA,CAAE,CAAC,CAAC;AAChE,QAAA,OAAO,QAAqB,CAAC;AAC7B,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;AACf,QAAA,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;AACrB,QAAA,MAAM,KAAK,CAAC;AACZ,KAAA;AACF;;;;"}
@@ -1,36 +1,16 @@
1
- import { asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../_virtual/_rollupPluginBabelHelpers.js';
2
1
  import api from '../apis/hcApi.js';
3
2
 
4
- var getRecruiters = /*#__PURE__*/function () {
5
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(recruiterIds) {
6
- var params, response;
7
- return _regeneratorRuntime().wrap(function _callee$(_context) {
8
- while (1) switch (_context.prev = _context.next) {
9
- case 0:
10
- _context.prev = 0;
11
- params = recruiterIds.map(function (id) {
12
- return "recruiterIds=".concat(id);
13
- }).join("&");
14
- _context.next = 4;
15
- return api.get("/Recruiters?".concat(params));
16
- case 4:
17
- response = _context.sent;
18
- return _context.abrupt("return", response.data);
19
- case 8:
20
- _context.prev = 8;
21
- _context.t0 = _context["catch"](0);
22
- console.error("Error fetching recruiters:", _context.t0);
23
- throw _context.t0;
24
- case 12:
25
- case "end":
26
- return _context.stop();
27
- }
28
- }, _callee, null, [[0, 8]]);
29
- }));
30
- return function getRecruiters(_x) {
31
- return _ref.apply(this, arguments);
32
- };
33
- }();
3
+ const getRecruiters = async (recruiterIds) => {
4
+ try {
5
+ const params = recruiterIds.map(id => `recruiterIds=${id}`).join("&");
6
+ const response = await api.get(`/Recruiters?${params}`);
7
+ return response;
8
+ }
9
+ catch (error) {
10
+ console.error("Error fetching recruiters:", error);
11
+ throw error;
12
+ }
13
+ };
34
14
 
35
15
  export { getRecruiters };
36
16
  //# sourceMappingURL=recruiterService.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"recruiterService.js","sources":["../../src/services/recruiterService.js"],"sourcesContent":["import api from '~/apis/hcApi';\r\n\r\nexport const getRecruiters = async recruiterIds => {\r\n\ttry {\r\n\t\tconst params = recruiterIds.map(id => `recruiterIds=${id}`).join(\"&\");\r\n\r\n\t\tconst response = await api.get(`/Recruiters?${params}`);\r\n\t\treturn response.data;\r\n\t} catch (error) {\r\n\t\tconsole.error(\"Error fetching recruiters:\", error);\r\n\t\tthrow error;\r\n\t}\r\n};\r\n\r\nexport default {\r\n\tgetRecruiters\r\n};\r\n"],"names":["getRecruiters","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","recruiterIds","params","response","wrap","_callee$","_context","prev","next","map","id","concat","join","api","get","sent","abrupt","data","t0","console","error","stop","_x","apply","arguments"],"mappings":";;;IAEaA,aAAa,gBAAA,YAAA;EAAA,IAAAC,IAAA,GAAAC,iBAAA,eAAAC,mBAAA,GAAAC,IAAA,CAAG,SAAAC,OAAAA,CAAMC,YAAY,EAAA;IAAA,IAAAC,MAAA,EAAAC,QAAA,CAAA;AAAA,IAAA,OAAAL,mBAAA,EAAA,CAAAM,IAAA,CAAA,SAAAC,SAAAC,QAAA,EAAA;AAAA,MAAA,OAAA,CAAA,EAAA,QAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;AAAA,QAAA,KAAA,CAAA;AAAAF,UAAAA,QAAA,CAAAC,IAAA,GAAA,CAAA,CAA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["import api from '~/apis/hcApi';\nimport { Recruiter } from '~/types/Recruiter';\n\nexport const getRecruiters = async (recruiterIds: number[]): Promise<Recruiter[]> => {\n\ttry {\n\t\tconst params = recruiterIds.map(id => `recruiterIds=${id}`).join(\"&\");\n\n\t\tconst response = await api.get<Recruiter[]>(`/Recruiters?${params}`);\n\t\treturn response;\n\t} catch (error) {\n\t\tconsole.error(\"Error fetching recruiters:\", error);\n\t\tthrow error;\n\t}\n};\n\nexport default {\n\tgetRecruiters\n};\n"],"names":[],"mappings":";;MAGa,aAAa,GAAG,OAAO,YAAsB,KAA0B;IACnF,IAAI;AACH,QAAA,MAAM,MAAM,GAAG,YAAY,CAAC,GAAG,CAAC,EAAE,IAAI,CAAgB,aAAA,EAAA,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAEtE,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,GAAG,CAAc,CAAe,YAAA,EAAA,MAAM,CAAE,CAAA,CAAC,CAAC;AACrE,QAAA,OAAO,QAAQ,CAAC;AAChB,KAAA;AAAC,IAAA,OAAO,KAAK,EAAE;AACf,QAAA,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;AACnD,QAAA,MAAM,KAAK,CAAC;AACZ,KAAA;AACF;;;;"}
@@ -0,0 +1,5 @@
1
+ declare const _default: {
2
+ get: <T>(url: string) => Promise<T>;
3
+ post: <T_1>(url: string, data: any) => Promise<T_1>;
4
+ };
5
+ export default _default;
@@ -0,0 +1,2 @@
1
+ export function setClientAuthKey(key: any): void;
2
+ export function getClientAuthKey(): any;
@@ -0,0 +1,9 @@
1
+ export default MapAccordionItem;
2
+ declare function MapAccordionItem({ item, itemRefs, itemExpandedContent, isActive, children }: {
3
+ item: any;
4
+ itemRefs: any;
5
+ itemExpandedContent: any;
6
+ isActive: any;
7
+ children: any;
8
+ }): React.JSX.Element;
9
+ import React from "react";
@@ -0,0 +1,19 @@
1
+ export const AccordionItem: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
2
+ export const AccordionTrigger: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
3
+ export const AccordionTriggerHasHeader: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
4
+ export const AccordionTriggerBlank: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
5
+ export const AccordionContent: React.ForwardRefExoticComponent<React.RefAttributes<any>>;
6
+ export default Accordion;
7
+ import React from "react";
8
+ declare function Accordion({ className, type, defaultValue, collapsible, children }: {
9
+ className: any;
10
+ type?: string | undefined;
11
+ defaultValue: any;
12
+ collapsible?: boolean | undefined;
13
+ children: any;
14
+ }): React.JSX.Element;
15
+ declare namespace Accordion {
16
+ export { AccordionItem as Item };
17
+ export { AccordionTrigger as Trigger };
18
+ export { AccordionContent as Content };
19
+ }