@abcagency/hire-control-sdk 1.1.1 → 1.1.3

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 (36) hide show
  1. package/.gitattributes +1 -0
  2. package/constants/cms.ts +60 -0
  3. package/controllers/categoryListsController.ts +29 -4
  4. package/controllers/content/blocksController.ts +62 -4
  5. package/controllers/content/contentEntriesController.ts +31 -4
  6. package/controllers/jobListingsController.ts +36 -0
  7. package/dist/constants/cms.d.ts +53 -0
  8. package/dist/controllers/categoryListsController.d.ts +12 -3
  9. package/dist/controllers/content/blocksController.d.ts +10 -0
  10. package/dist/controllers/content/contentEntriesController.d.ts +9 -0
  11. package/dist/controllers/jobListingsController.d.ts +12 -0
  12. package/dist/handlers/normalize-casing.d.ts +1 -0
  13. package/dist/index.cjs.js +1 -1
  14. package/dist/index.d.ts +38 -4
  15. package/dist/types/JobListing.d.ts +1 -0
  16. package/dist/types/categoryList.d.ts +7 -2
  17. package/dist/types/content/blockUpdateImpact.d.ts +22 -0
  18. package/dist/types/content/model.d.ts +32 -0
  19. package/dist/types/hireControlConfig.d.ts +14 -0
  20. package/dist/types/listing.d.ts +3 -0
  21. package/dist/types/listingEntity.d.ts +3 -0
  22. package/dist/types/listingEntityMedia.d.ts +12 -0
  23. package/dist/types/mongoListingEntity.d.ts +3 -0
  24. package/handlers/fetchHandler.ts +27 -4
  25. package/handlers/normalize-casing.ts +36 -0
  26. package/index.ts +35 -2
  27. package/package.json +2 -1
  28. package/types/JobListing.ts +1 -0
  29. package/types/categoryList.ts +8 -2
  30. package/types/content/blockUpdateImpact.ts +24 -0
  31. package/types/content/model.ts +35 -0
  32. package/types/hireControlConfig.ts +16 -0
  33. package/types/listing.ts +4 -0
  34. package/types/listingEntity.ts +3 -0
  35. package/types/listingEntityMedia.ts +14 -0
  36. package/types/mongoListingEntity.ts +3 -0
package/dist/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib");class e{constructor(t){this.apiUrl=t,this.isLocalhost=!1}getAuthToken(){return this.isLocalhost?sessionStorage.getItem("token"):null}get(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=!1,n=null){this.isLocalhost&&e&&!n&&(n=this.getAuthToken());const r={method:"GET",credentials:n?"omit":"include"};return e?this.fetchWithAuth(t,r,n):this.fetchWithoutAuth(t,r)}))}post(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=!1,r=null,i=!1){this.isLocalhost&&n&&!r&&(r=this.getAuthToken());const o=i,s={method:"POST",credentials:r?"omit":"include",headers:Object.assign(Object.assign({},r?{Authorization:`Bearer ${r}`}:{}),o?{}:{"Content-Type":"application/json"}),body:o?this.convertToFormData(e):JSON.stringify(e)};return n?this.fetchWithAuth(t,s,r):this.fetchWithoutAuth(t,s)}))}put(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=!1,r=null,i=!1){this.isLocalhost&&n&&!r&&(r=this.getAuthToken());const o=i,s={method:"PUT",credentials:r?"omit":"include",headers:Object.assign(Object.assign({},r?{Authorization:`Bearer ${r}`}:{}),o?{}:{"Content-Type":"application/json"}),body:o?this.convertToFormData(e):JSON.stringify(e)};return n?this.fetchWithAuth(t,s,r):this.fetchWithoutAuth(t,s)}))}patch(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=!1,r=null,i=!1){this.isLocalhost&&n&&!r&&(r=this.getAuthToken());const o=i,s={method:"PATCH",credentials:r?"omit":"include",headers:Object.assign(Object.assign({},r?{Authorization:`Bearer ${r}`}:{}),o?{}:{"Content-Type":"application/json"}),body:o?this.convertToFormData(e):JSON.stringify(e)};return n?this.fetchWithAuth(t,s,r):this.fetchWithoutAuth(t,s)}))}delete(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=!1,n=null){this.isLocalhost&&e&&!n&&(n=this.getAuthToken());const r={method:"DELETE",credentials:n?"omit":"include"};return e?this.fetchWithAuth(t,r,n):this.fetchWithoutAuth(t,r)}))}getFile(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=!1,n=null){this.isLocalhost&&e&&!n&&(n=this.getAuthToken());const r={method:"GET",credentials:n?"omit":"include",headers:e&&n?{Authorization:`Bearer ${n}`}:{}},i=yield fetch(`${this.apiUrl}${t}`,r);if(!i.ok)throw new Error(`Failed to fetch file: ${i.statusText}`);return i.blob()}))}convertToFormData(t,e=new FormData,n=""){return t instanceof File?e.append(n||"file",t):"string"==typeof t||"number"==typeof t||"boolean"==typeof t?e.append(n,t.toString()):Array.isArray(t)?t.forEach(((t,r)=>{this.convertToFormData(t,e,`${n}[${r}]`)})):"object"==typeof t&&null!==t&&Object.keys(t).forEach((r=>{const i=t[r],o=n?`${n}.${r}`:r;this.convertToFormData(i,e,o)})),e}fetchWithoutAuth(e,n){return t.__awaiter(this,void 0,void 0,(function*(){const t=yield fetch(`${this.apiUrl}${e}`,n);return this.handleResponse(t)}))}fetchWithAuth(e,n,r){return t.__awaiter(this,void 0,void 0,(function*(){r?(n.headers=Object.assign(Object.assign({},n.headers),{Authorization:`Bearer ${r}`}),n.credentials="omit"):n.credentials="include";let t=yield fetch(`${this.apiUrl}${e}`,n);if(401===t.status){if(!(yield this.refreshToken()))throw{statusCode:t.status};this.isLocalhost&&(r=this.getAuthToken())&&(n.headers=Object.assign(Object.assign({},n.headers),{Authorization:`Bearer ${r}`})),t=yield fetch(`${this.apiUrl}${e}`,n)}return this.handleResponse(t)}))}handleResponse(e){return t.__awaiter(this,void 0,void 0,(function*(){if(!e.ok||!e.status.toString().startsWith("2")){let t=`Error: ${e.status} ${e.statusText}`;try{const n=yield e.json();console.log(n),n&&n.message&&(t=n.message)}catch(t){console.error("Failed to parse error response:",t)}throw{statusCode:e.status,errorMessage:t}}if(204===e.status||205===e.status)return null;const t=yield e.text();if(!t)return null;try{return JSON.parse(t)}catch(e){return t}}))}refreshToken(){return t.__awaiter(this,void 0,void 0,(function*(){if(!this.isLocalhost){return!!(yield fetch(`${this.apiUrl}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"})).ok||(console.error("Failed to refresh token"),!1)}{const t=sessionStorage.getItem("refreshToken");if(!t)return!1;const e=yield fetch(`${this.apiUrl}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})});if(!e.ok)return console.error("Failed to refresh token"),!1;try{const t=yield e.json();return t.token&&sessionStorage.setItem("token",t.token),t.refreshToken&&sessionStorage.setItem("refreshToken",t.refreshToken),!0}catch(t){return console.error("Failed to parse refresh token response:",t),!1}}}))}}const n=process.env.NEXT_PUBLIC_API_URL||process.env.VITE_API_URL||process.env.REACT_APP_API_URL||"https://api.myhirecontrol.com",r=new e(n),i="undefined"!=typeof window&&"localhost"===window.location.hostname;var o=new class{login(e){return t.__awaiter(this,void 0,void 0,(function*(){return r.post("/auth/login",e,!1)}))}nextLogin(e){return t.__awaiter(this,void 0,void 0,(function*(){const t="/auth/nextLogin"+(i?"?localhost=true":""),n=yield r.post(t,e,!1);return n&&(sessionStorage.setItem("token",n.token),sessionStorage.setItem("refreshToken",n.refreshToken),sessionStorage.setItem("expiration",n.expiration)),n}))}refreshToken(){return t.__awaiter(this,void 0,void 0,(function*(){const t="/auth/refresh"+(i?"?localhost=true":""),e=yield r.post(t,{},!0);return e&&i&&(sessionStorage.setItem("token",e.token),sessionStorage.setItem("refreshToken",e.refreshToken),sessionStorage.setItem("expiration",e.expiration)),e}))}changeCompany(e){return t.__awaiter(this,void 0,void 0,(function*(){const t="/auth/changeCompany"+(i?"?localhost=true":"");var n=yield r.post(t,e,!0);return n&&(sessionStorage.setItem("token",n.token),sessionStorage.setItem("refreshToken",n.refreshToken),sessionStorage.setItem("expiration",n.expiration)),n}))}register(e){return t.__awaiter(this,void 0,void 0,(function*(){return r.post("/auth/register",e,!1)}))}getCompanies(){return t.__awaiter(this,void 0,void 0,(function*(){return r.get("/auth/companies",!0)}))}getCompany(){return t.__awaiter(this,void 0,void 0,(function*(){return r.get("/auth/company",!0)}))}getRoles(){return t.__awaiter(this,void 0,void 0,(function*(){return r.get("/auth/roles",!0)}))}isAuthenticated(){return t.__awaiter(this,void 0,void 0,(function*(){try{const t=yield r.get("/auth/authenticated",!0);return t||(yield this.tryRefreshAndCheckAuth())}catch(t){return yield this.tryRefreshAndCheckAuth()}}))}tryRefreshAndCheckAuth(){return t.__awaiter(this,void 0,void 0,(function*(){try{yield this.refreshToken();return yield r.get("/auth/authenticated",!0)}catch(t){return!1}}))}getUser(){return t.__awaiter(this,arguments,void 0,(function*(t=null){try{return yield r.get("/auth/user",!0,t)}catch(t){throw t}}))}logout(){return t.__awaiter(this,void 0,void 0,(function*(){try{const t=yield r.post("/auth/logout",{},!0);return sessionStorage.removeItem("token"),sessionStorage.removeItem("refreshToken"),sessionStorage.removeItem("expiration"),t}catch(t){throw t}}))}getPermissions(){return t.__awaiter(this,arguments,void 0,(function*(t=null){try{return yield r.get("/auth/permissions",!0,t)}catch(t){throw t}}))}};const s=new e(n);var a=new class{getEvents(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return s.get("/events",!0,t)}))}getEvent(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return s.get(`/events/${t}`,!0,e)}))}getEventBySlug(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return s.get(`/events/details/${t}`,!0,e)}))}getListingEvents(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return s.get(`/listingEvents/${t}`,!0,e)}))}createEvent(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return s.post("/events",t,!0,e)}))}updateEvent(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return s.put(`/events/${t}`,e,!0,n)}))}deleteEvent(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return s.delete(`/events/${t}`,!0,e)}))}};const u=new e(n);var l=new class{getAllRolesWithClaims(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return u.get("/roles",!0,t)}))}addRole(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return u.post("/roles",t,!0,e)}))}updateRole(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return u.put(`/roles/${t}`,e,!0,n)}))}deleteRole(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return u.delete(`/roles/${t}`,!0,e)}))}};const d=new e(n);var c=new class{getAllUsers(){return t.__awaiter(this,arguments,void 0,(function*(t=null){try{return yield d.get("/users",!0,t)}catch(t){throw t}}))}getUser(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){try{return yield d.get(`/users/${t}`,!0,e)}catch(t){throw t}}))}createUser(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){try{return yield d.post("/users",t,!0,e)}catch(t){throw t}}))}updateUser(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){try{yield d.put(`/users/${t}`,e,!0,n)}catch(t){throw t}}))}updateLoggedInUser(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){try{yield d.put("/users",t,!0,e)}catch(t){throw t}}))}deleteUser(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){try{yield d.delete(`/users/${t}`,!0,e)}catch(t){throw t}}))}};const g=new e(n);var h=new class{forgotPassword(e){return t.__awaiter(this,void 0,void 0,(function*(){try{return yield g.post("/account/forgotPassword",e,!1)}catch(t){throw t}}))}resetPasswordWithToken(e){return t.__awaiter(this,void 0,void 0,(function*(){try{return yield g.post("/account/resetPasswordWithToken",e,!1)}catch(t){throw t}}))}resetPassword(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){try{return yield g.post("/account/resetPassword",t,!0,e)}catch(t){throw t}}))}};const p=new e(n);var _=new class{getMapConfig(){return t.__awaiter(this,arguments,void 0,(function*(t=null){try{return yield p.get("/mapconfig",!0,t)}catch(t){throw t}}))}updateMapConfig(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return p.put("/mapconfig",t,!0,e)}))}createMapConfig(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return p.post("/mapconfig",t,!0,e)}))}};const f=new e(n);var v=new class{getAllPermissions(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return f.get("/permissions",!0,t)}))}};const w=new e(n);var y=new class{getClientAuthConfigById(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){try{return yield w.get(`/clientAuthConfig/${t}`,!0,e)}catch(t){throw t}}))}getAllClientAuthConfigs(){return t.__awaiter(this,arguments,void 0,(function*(t=null){try{return yield w.get("/clientAuthConfig",!0,t)}catch(t){throw t}}))}createClientAuthConfig(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return w.post("/clientAuthConfig",t,!0,e)}))}updateClientAuthConfig(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return w.put(`/clientAuthConfig/${t}`,e,!0,n)}))}deleteClientAuthConfig(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return w.delete(`/clientAuthConfig/${t}`,!0,e)}))}};const m=new e(n);var C=new class{getSearchReadConfig(){return t.__awaiter(this,arguments,void 0,(function*(t=null){try{return yield m.get("/integrationconfig/search-read",!0,t)}catch(t){if(404===(null==t?void 0:t.statusCode)||204===(null==t?void 0:t.statusCode))return null;throw t}}))}};const b=new e(n);var A=new class{getListings(){return t.__awaiter(this,arguments,void 0,(function*(t=null,e=null){try{const n=e?`?filterId=${encodeURIComponent(e)}`:"";return yield b.get(`/listings${n}`,!0,t)}catch(t){throw t}}))}getListingDetails(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){try{return yield b.get(`/listings/${t}`,!0,e)}catch(t){throw t}}))}};const S=new e(n);var $=new class{uploadMedia(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return S.post("/media/upload",t,!0,e,!0)}))}uploadProfileImage(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return S.post("/media/upload-profile-image",t,!0,e,!0)}))}listMedia(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){const n=new URLSearchParams({folderKey:t});return S.get(`/media/list?${n.toString()}`,!0,e)}))}deleteMedia(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){const n=new URLSearchParams({key:t});return S.delete(`/media/delete?${n.toString()}`,!0,e)}))}};const L=new e(n);var F=new class{getFilters(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return L.get("/filters",!0,t)}))}getFilter(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return L.get(`/filters/${t}`,!0,e)}))}createFilter(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return L.post("/filters",t,!0,e)}))}updateFilter(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return L.put(`/filters/${t}`,e,!0,n)}))}deleteFilter(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return L.delete(`/filters/${t}`,!0,e)}))}};const k=new e(n);var T=new class{getAppendListings(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return k.get("/appendListings",!0,t)}))}getAppendListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return k.get(`/appendListings/${t}`,!0,e)}))}createAppendListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return k.post("/appendListings",t,!0,e)}))}updateAppendListing(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return k.put(`/appendListings/${t}`,e,!0,n)}))}deleteAppendListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return k.delete(`/appendListings/${t}`,!0,e)}))}};const B=new e(n);var x=new class{getForms(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return B.get("/forms",!0,t)}))}getForm(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return B.get(`/forms/${t}`,!0,e)}))}createForm(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return B.post("/forms",t,!0,e)}))}updateForm(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return B.put(`/forms/${t}`,e,!0,n)}))}updateFormWithFieldRenames(e,n,r){return t.__awaiter(this,arguments,void 0,(function*(t,e,n,r=null){return B.put(`/forms/${t}`,Object.assign(Object.assign({},e),n),!0,r)}))}getFormSubmissionCount(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return B.get(`/forms/${t}/submission-count`,!0,e)}))}getFormSubmissionFieldUsage(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return B.get(`/forms/${t}/submission-fields`,!0,e)}))}migrateSubmissionFields(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return B.post(`/forms/${t}/migrate-submission-fields`,e,!0,n)}))}deleteForm(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return B.delete(`/forms/${t}`,!0,e)}))}processFormRequest(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return B.post("/forms/jsonSchema",t,!0,e)}))}};const j=new e(n);var I=new class{submitContactForm(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return j.post("/contactForm",t,!0,e,!0)}))}submitFormSubmission(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return j.post("/formsubmission",t,!0,e)}))}getFormSubmissions(){return t.__awaiter(this,arguments,void 0,(function*(t=20,e=1,n=null,r=null,i=null,o=null,s=null){const a=new URLSearchParams({pageSize:t.toString(),pageNumber:e.toString()});return r&&a.append("status",r.toString()),n&&a.append("type",n),i&&a.append("from",i.toISOString()),o&&a.append("to",o.toISOString()),j.get(`/formsubmission?${a.toString()}`,!0,s)}))}exportFormSubmissionsCsv(){return t.__awaiter(this,arguments,void 0,(function*(t=20,e=1,n=null,r=null,i=null,o=null,s=null,a=null){const u=new URLSearchParams({pageSize:t.toString(),pageNumber:e.toString()});r&&u.append("status",r.toString()),n&&u.append("type",n),i&&u.append("from",i.toISOString()),o&&u.append("to",o.toISOString()),s&&s.length>0&&s.forEach((t=>u.append("columns",t)));const l=yield j.getFile(`/formsubmission/export-csv?${u.toString()}`,!0,a),d=window.URL.createObjectURL(l),c=document.createElement("a");c.href=d,c.download="HireControl_Form_Submissions.csv",document.body.appendChild(c),c.click(),window.URL.revokeObjectURL(d),document.body.removeChild(c)}))}getFormSubmissionTypes(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return j.get("/formsubmission/types",!0,t)}))}};const E=new e(n);var R=new class{getCompanies(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return E.get("/companies",!0,t)}))}getCompany(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return E.get(`/companies/${t}`,!0,e)}))}createCompany(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return E.post("/companies",t,!0,e)}))}updateCompany(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return E.put(`/companies/${t}`,e,!0,n)}))}deleteCompany(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return E.delete(`/companies/${t}`,!0,e)}))}syncAllCompanies(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return E.get("/companies/syncall",!0,t)}))}};const M=new e(n);var P=new class{getJobListingsByCompany(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return M.get("/joblistings",!0,t)}))}getMapJobListingsByCompany(){return t.__awaiter(this,arguments,void 0,(function*(t=null,e=null){return e?M.get(`/joblistings/MapListings?filterId=${e}`,!0,t):M.get("/joblistings/MapListings",!0,t)}))}getJobListingById(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return M.get(`/joblistings/${t}`,!0,e)}))}getMapListingById(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return M.get(`/joblistings/MapListings/${t}`,!0,e)}))}createJobListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return M.post("/joblistings",t,!0,e)}))}updateJobListing(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return M.put(`/joblistings/${t}`,e,!0,n)}))}exportJobListingsCsv(){return t.__awaiter(this,arguments,void 0,(function*(t=10,e=1,n=null,r=null,i=null,o=null){const s=new URLSearchParams({pageSize:t.toString(),pageNumber:e.toString()});n&&s.append("status",n.toString()),r&&s.append("from",r.toISOString()),i&&s.append("to",i.toISOString());const a=yield M.getFile(`/joblistings/Export-csv?${s.toString()}`,!0,o),u=window.URL.createObjectURL(a),l=document.createElement("a");l.href=u,l.download="job_listings.csv",document.body.appendChild(l),l.click(),window.URL.revokeObjectURL(u),document.body.removeChild(l)}))}deleteJobListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return M.delete(`/joblistings/${t}`,!0,e)}))}};const U=new e(n);var O=new class{getBlogs(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return U.get("/blog",!0,t)}))}getBlog(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return U.get(`/blog/${t}`,!0,e)}))}createBlog(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return U.post("/blog",t,!0,e)}))}updateBlog(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return U.put(`/blog/${t}`,e,!0,n)}))}deleteBlog(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return U.delete(`/blog/${t}`,!0,e)}))}};const W=new e(n);var J=new class{getCategories(){return t.__awaiter(this,arguments,void 0,(function*(t=null,e=null){const n=new URLSearchParams;null!=t&&n.append("type",String(t));const r=n.toString()?`?${n.toString()}`:"";return W.get(`/categories${r}`,!0,e)}))}getCategoriesByCompany(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null,n=null){const r=new URLSearchParams;null!=e&&r.append("type",String(e));const i=r.toString()?`?${r.toString()}`:"";return W.get(`/categories/${t}${i}`,!0,n)}))}};const V=new e(n);var N=new class{getAllCategoryLists(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return V.get("/categorylist",!0,t)}))}getCategoryListById(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return V.get(`/categorylist/${t}`,!0,e)}))}getCategoryListsByType(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return V.get(`/categorylist/type/${t}`,!0,e)}))}getActiveCategoryLists(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return V.get("/categorylist/active",!0,t)}))}getCategoryListByTypeAndName(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return V.get(`/categorylist/type/${t}/name/${e}`,!0,n)}))}createCategoryList(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return V.post("/categorylist",t,!0,e)}))}updateCategoryList(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return V.put(`/categorylist/${t}`,e,!0,n)}))}deleteCategoryList(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return V.delete(`/categorylist/${t}`,!0,e)}))}addValue(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return V.post(`/categorylist/${t}/values`,e,!0,n)}))}removeValue(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return V.delete(`/categorylist/${t}/values/${e}`,!0,n)}))}updateValues(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return V.put(`/categorylist/${t}/values`,e,!0,n)}))}};const D=new e(n);var H=new class{getByFeed(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return D.get(`/jobFeedFieldMappings/feed/${t}`,!0,e)}))}get(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return D.get(`/jobFeedFieldMappings/${t}`,!0,e)}))}create(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return D.post("/jobFeedFieldMappings",t,!0,e)}))}update(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return D.put(`/jobFeedFieldMappings/${t}`,e,!0,n)}))}delete(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return D.delete(`/jobFeedFieldMappings/${t}`,!0,e)}))}toggleActive(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return D.post("/jobFeedFieldMappings/toggle-active",t,!0,e)}))}discoverFields(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return D.get(`/jobFeedFieldMappings/discover-fields/${t}`,!0,e)}))}validate(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return D.get(`/jobFeedFieldMappings/validate/${t}`,!0,e)}))}};const z=new e(n);var q=new class{getAll(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return z.get("/jobfeeds",!0,t)}))}get(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return z.get(`/jobfeeds/${t}`,!0,e)}))}create(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return z.post("/jobfeeds",t,!0,e)}))}update(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return z.put(`/jobfeeds/${t}`,e,!0,n)}))}delete(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return z.delete(`/jobfeeds/${t}`,!0,e)}))}sync(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return z.post(`/jobfeeds/${t}/sync`,{},!0,e)}))}toggleActive(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return z.patch(`/jobfeeds/${t}/toggle-active`,e,!0,n)}))}};const G=new e(n);var K=new class{get(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return G.get("/jobListingSettings",!0,t)}))}create(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return G.post("/jobListingSettings",t,!0,e)}))}delete(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return G.delete("/jobListingSettings",!0,t)}))}};const X=new e(n);var Q=new class{getAllSql(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null,n=null){const r=new URLSearchParams;return e&&r.append("origin",e),X.post("/listingEntities"+(r.toString()?"?"+r.toString():""),t,!0,n)}))}getAll(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return X.get("/listingEntities",!0,t)}))}create(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return X.post("/listingEntities/create",t,!0,e)}))}update(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){yield X.put(`/listingEntities/update/${t}`,e,!0,n)}))}delete(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){yield X.delete(`/listingEntities/delete/${t}`,!0,e)}))}};const Y=new e(n);var Z=new class{get(){return t.__awaiter(this,arguments,void 0,(function*(t=null,e=null){const n=new URLSearchParams;t&&t.forEach((t=>n.append("recruiterIds",t.toString())));const r=n.toString()?`?${n.toString()}`:"";return Y.get(`/recruiters${r}`,!0,e)}))}getAll(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return Y.get("/recruiters/all",!0,t)}))}sync(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return Y.post("/recruiters/sync",{},!0,t)}))}};const tt=new e(n);var et=new class{getFieldTypes(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return tt.get("/field/types",!0,t)}))}};const nt=new e(n);var rt=new class{getValidatorTypes(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return nt.get("/validator/types",!0,t)}))}};const it=new e(n);var ot=new class{getContentEntries(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null,n=null){let r=`/contententry?contentId=${t}`;return null!==e&&(r+=`&statusFilter=${e}`),it.get(r,!0,n)}))}getContentEntry(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null,n=null){let r=`/contententry/${t}`;return null!==e&&(r+=`?statusFilter=${e}`),it.get(r,!0,n)}))}createContentEntry(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return it.post("/contententry",t,!0,e)}))}updateContentEntry(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return it.put(`/contententry/${t}`,e,!0,n)}))}deleteContentEntry(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return it.delete(`/contententry/${t}`,!0,e)}))}getVersions(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return it.get(`/contententry/${t}/versions`,!0,e)}))}unpublishAll(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return it.post(`/contententry/${t}/unpublish`,void 0,!0,e)}))}};const st=new e(n);var at=new class{getBlocks(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return st.get("/block",!0,t)}))}getBlock(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return st.get(`/block/${t}`,!0,e)}))}createBlock(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return st.post("/block",t,!0,e)}))}updateBlock(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return st.put(`/block/${t}`,e,!0,n)}))}deleteBlock(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return st.delete(`/block/${t}`,!0,e)}))}getTemplateBlocks(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return st.get("/block/template-blocks",!0,t)}))}};const ut=new e(n);var lt=new class{getModels(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return ut.get("/model",!0,t)}))}getModel(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return ut.get(`/model/${t}`,!0,e)}))}createModel(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return ut.post("/model",t,!0,e)}))}updateModel(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return ut.put(`/model/${t}`,e,!0,n)}))}deleteModel(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return ut.delete(`/model/${t}`,!0,e)}))}previewSync(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return ut.get(`/model/${t}/sync/preview`,!0,e)}))}executeSync(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return ut.post(`/model/${t}/sync`,e,!0,n)}))}};const dt=new e(n);var ct,gt,ht,pt,_t=new class{getCompletion(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return dt.post("/openai/completion",t,!0,e)}))}};exports.EventType=void 0,(ct=exports.EventType||(exports.EventType={}))[ct.Virtual=0]="Virtual",ct[ct.InPerson=1]="InPerson",ct[ct.Hybrid=2]="Hybrid",exports.CallToActionType=void 0,(gt=exports.CallToActionType||(exports.CallToActionType={}))[gt.Button=0]="Button",gt[gt.Link=1]="Link",gt[gt.Download=2]="Download",gt[gt.HireControlRegistration=3]="HireControlRegistration",exports.FormSubmissionStatus=void 0,(ht=exports.FormSubmissionStatus||(exports.FormSubmissionStatus={}))[ht.Submitted=1]="Submitted",ht[ht.Hold=2]="Hold",ht[ht.Rejected=3]="Rejected",ht[ht.Sent=4]="Sent",exports.FeedHandlingOption=void 0,(pt=exports.FeedHandlingOption||(exports.FeedHandlingOption={}))[pt.Replace=0]="Replace",pt[pt.Append=1]="Append",pt[pt.Custom=2]="Custom";const ft={login:o.login,nextLogin:o.nextLogin,refreshToken:o.refreshToken,changeCompany:o.changeCompany,register:o.register,isAuthenticated:o.isAuthenticated,getCompany:o.getCompany,getCompanies:o.getCompanies,getRoles:o.getRoles,getPermissions:o.getPermissions,logout:o.logout,getUser:o.getUser},vt={getAll:a.getEvents,get:a.getEvent,getBySlug:a.getEventBySlug,create:a.createEvent,update:a.updateEvent,delete:a.deleteEvent},wt={get:l.getAllRolesWithClaims,create:l.addRole,update:l.updateRole,delete:l.deleteRole},yt=c,mt=A,Ct={resetPassword:h.resetPassword,resetPasswordWithToken:h.resetPasswordWithToken,forgotPassword:h.forgotPassword},bt={get:_.getMapConfig,update:_.updateMapConfig,create:_.createMapConfig},At={get:y.getClientAuthConfigById,getAll:y.getAllClientAuthConfigs,update:y.updateClientAuthConfig,create:y.createClientAuthConfig,delete:y.deleteClientAuthConfig},St={getSearchRead:C.getSearchReadConfig},$t={upload:$.uploadMedia,uploadProfileImage:$.uploadProfileImage,get:$.listMedia,delete:$.deleteMedia},Lt={getList:F.getFilters,get:F.getFilter,update:F.updateFilter,create:F.createFilter,delete:F.deleteFilter},Ft={get:T.getAppendListings,getAppendListing:T.getAppendListing,create:T.createAppendListing,update:T.updateAppendListing,delete:T.deleteAppendListing},kt={getAll:O.getBlogs,getById:O.getBlog,create:O.createBlog,update:O.updateBlog,delete:O.deleteBlog},Tt={get:J.getCategories,getByCompany:J.getCategoriesByCompany},Bt={getAll:N.getAllCategoryLists,getById:N.getCategoryListById,getByType:N.getCategoryListsByType,getActive:N.getActiveCategoryLists,getByTypeAndName:N.getCategoryListByTypeAndName,create:N.createCategoryList,update:N.updateCategoryList,delete:N.deleteCategoryList,addValue:N.addValue,removeValue:N.removeValue,updateValues:N.updateValues},xt={getByFeed:H.getByFeed,get:H.get,create:H.create,update:H.update,delete:H.delete,toggleActive:H.toggleActive,discoverFields:H.discoverFields,validate:H.validate},jt={getAll:q.getAll,getById:q.get,create:q.create,update:q.update,delete:q.delete,sync:q.sync,toggleActive:q.toggleActive},It={get:K.get,create:K.create,delete:K.delete},Et={create:Q.create,get:Q.getAll,update:Q.update,delete:Q.delete,getAllSql:Q.getAllSql},Rt={get:Z.get,getAll:Z.getAll,sync:Z.sync},Mt={get:v.getAllPermissions},Pt={getAll:R.getCompanies,getById:R.getCompany,create:R.createCompany,update:R.updateCompany,delete:R.deleteCompany,sync:R.syncAllCompanies},Ut={getAll:P.getJobListingsByCompany,getMapListings:P.getMapJobListingsByCompany,getMapListing:P.getMapListingById,getById:P.getJobListingById,create:P.createJobListing,update:P.updateJobListing,delete:P.deleteJobListing},Ot={getTypes:et.getFieldTypes},Wt={getTypes:rt.getValidatorTypes},Jt={getAll:ot.getContentEntries,getById:ot.getContentEntry,create:ot.createContentEntry,update:ot.updateContentEntry,delete:ot.deleteContentEntry,unpublish:ot.unpublishAll},Vt={getAll:at.getBlocks,getById:at.getBlock,create:at.createBlock,update:at.updateBlock,delete:at.deleteBlock,getTemplateBlocks:at.getTemplateBlocks},Nt={getAll:lt.getModels,getById:lt.getModel,create:lt.createModel,update:lt.updateModel,delete:lt.deleteModel,previewSync:lt.previewSync,executeSync:lt.executeSync},Dt={getCompletion:_t.getCompletion},Ht=x,zt=I,qt={auth:ft,events:vt,roles:wt,users:yt,account:Ct,mapConfig:bt,permissions:Mt,clientAuthConfig:At,integrationConfig:St,filters:Lt,listings:mt,media:$t,appendListings:Ft,blogs:kt,categories:Tt,categoryLists:Bt,jobFeedFieldMappings:xt,jobFeeds:jt,jobListingSettings:It,listingEntities:Et,recruiters:Rt,forms:Ht,formSubmissions:zt,openAI:Dt,companies:Pt,jobListings:Ut};exports.account=Ct,exports.appendListings=Ft,exports.auth=ft,exports.blogs=kt,exports.categories=Tt,exports.categoryLists=Bt,exports.clientAuthConfig=At,exports.companies=Pt,exports.contentBlocks=Vt,exports.contentEntries=Jt,exports.contentField=Ot,exports.contentValidator=Wt,exports.default=qt,exports.events=vt,exports.filters=Lt,exports.formSubmissions=zt,exports.forms=Ht,exports.integrationConfig=St,exports.jobFeedFieldMappings=xt,exports.jobFeeds=jt,exports.jobListingSettings=It,exports.jobListings=Ut,exports.listingEntities=Et,exports.listings=mt,exports.mapConfig=bt,exports.media=$t,exports.model=Nt,exports.openAI=Dt,exports.permissions=Mt,exports.recruiters=Rt,exports.roles=wt,exports.users=yt;
1
+ "use strict";function t(t,e,n,r){return new(n||(n=Promise))(function(i,o){function s(t){try{l(r.next(t))}catch(t){o(t)}}function u(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(s,u)}l((r=r.apply(t,e||[])).next())})}Object.defineProperty(exports,"__esModule",{value:!0}),"function"==typeof SuppressedError&&SuppressedError;class e{constructor(t){this.apiUrl=t,this.isLocalhost=!1}getAuthToken(){return this.isLocalhost?sessionStorage.getItem("token"):null}get(e){return t(this,arguments,void 0,function*(t,e=!1,n=null){this.isLocalhost&&e&&!n&&(n=this.getAuthToken());const r={method:"GET",credentials:n?"omit":"include"};return e?this.fetchWithAuth(t,r,n):this.fetchWithoutAuth(t,r)})}post(e,n){return t(this,arguments,void 0,function*(t,e,n=!1,r=null,i=!1){this.isLocalhost&&n&&!r&&(r=this.getAuthToken());const o=i,s={method:"POST",credentials:r?"omit":"include",headers:Object.assign(Object.assign({},r?{Authorization:`Bearer ${r}`}:{}),o?{}:{"Content-Type":"application/json"}),body:o?this.convertToFormData(e):JSON.stringify(e)};return n?this.fetchWithAuth(t,s,r):this.fetchWithoutAuth(t,s)})}put(e,n){return t(this,arguments,void 0,function*(t,e,n=!1,r=null,i=!1){this.isLocalhost&&n&&!r&&(r=this.getAuthToken());const o=i,s={method:"PUT",credentials:r?"omit":"include",headers:Object.assign(Object.assign({},r?{Authorization:`Bearer ${r}`}:{}),o?{}:{"Content-Type":"application/json"}),body:o?this.convertToFormData(e):JSON.stringify(e)};return n?this.fetchWithAuth(t,s,r):this.fetchWithoutAuth(t,s)})}patch(e,n){return t(this,arguments,void 0,function*(t,e,n=!1,r=null,i=!1){this.isLocalhost&&n&&!r&&(r=this.getAuthToken());const o=i,s={method:"PATCH",credentials:r?"omit":"include",headers:Object.assign(Object.assign({},r?{Authorization:`Bearer ${r}`}:{}),o?{}:{"Content-Type":"application/json"}),body:o?this.convertToFormData(e):JSON.stringify(e)};return n?this.fetchWithAuth(t,s,r):this.fetchWithoutAuth(t,s)})}delete(e){return t(this,arguments,void 0,function*(t,e=!1,n=null){this.isLocalhost&&e&&!n&&(n=this.getAuthToken());const r={method:"DELETE",credentials:n?"omit":"include"};return e?this.fetchWithAuth(t,r,n):this.fetchWithoutAuth(t,r)})}getFile(e){return t(this,arguments,void 0,function*(t,e=!1,n=null){this.isLocalhost&&e&&!n&&(n=this.getAuthToken());const r={method:"GET",credentials:n?"omit":"include",headers:e&&n?{Authorization:`Bearer ${n}`}:{}},i=yield fetch(`${this.apiUrl}${t}`,r);if(!i.ok)throw new Error(`Failed to fetch file: ${i.statusText}`);return i.blob()})}convertToFormData(t,e=new FormData,n=""){return t instanceof File?e.append(n||"file",t):"string"==typeof t||"number"==typeof t||"boolean"==typeof t?e.append(n,t.toString()):Array.isArray(t)?t.forEach((t,r)=>{this.convertToFormData(t,e,`${n}[${r}]`)}):"object"==typeof t&&null!==t&&Object.keys(t).forEach(r=>{const i=t[r],o=n?`${n}.${r}`:r;this.convertToFormData(i,e,o)}),e}fetchWithoutAuth(e,n){return t(this,void 0,void 0,function*(){const t=yield fetch(`${this.apiUrl}${e}`,n);return this.handleResponse(t)})}fetchWithAuth(e,n,r){return t(this,void 0,void 0,function*(){r?(n.headers=Object.assign(Object.assign({},n.headers),{Authorization:`Bearer ${r}`}),n.credentials="omit"):n.credentials="include";let t=yield fetch(`${this.apiUrl}${e}`,n);if(401===t.status){if(!(yield this.refreshToken()))throw{statusCode:t.status};this.isLocalhost&&(r=this.getAuthToken())&&(n.headers=Object.assign(Object.assign({},n.headers),{Authorization:`Bearer ${r}`})),t=yield fetch(`${this.apiUrl}${e}`,n)}return this.handleResponse(t)})}handleResponse(e){return t(this,void 0,void 0,function*(){if(!e.ok||!e.status.toString().startsWith("2")){let t=`Error: ${e.status} ${e.statusText}`;try{const n=yield e.text();if(n)try{const e=JSON.parse(n);console.log(e),e&&"string"==typeof e.message&&e.message.trim()?t=e.message:e&&"string"==typeof e.error&&e.error.trim()?t=e.error:e&&"string"==typeof e.title&&e.title.trim()&&(t=e.title)}catch(e){const r=n.trim();r&&!r.startsWith("<")&&(t=r)}}catch(t){console.error("Failed to parse error response:",t)}throw{statusCode:e.status,errorMessage:t}}if(204===e.status||205===e.status)return null;const t=yield e.text();if(!t)return null;try{return JSON.parse(t)}catch(e){return t}})}refreshToken(){return t(this,void 0,void 0,function*(){if(!this.isLocalhost){return!!(yield fetch(`${this.apiUrl}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"})).ok||(console.error("Failed to refresh token"),!1)}{const t=sessionStorage.getItem("refreshToken");if(!t)return!1;const e=yield fetch(`${this.apiUrl}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})});if(!e.ok)return console.error("Failed to refresh token"),!1;try{const t=yield e.json();return t.token&&sessionStorage.setItem("token",t.token),t.refreshToken&&sessionStorage.setItem("refreshToken",t.refreshToken),!0}catch(t){return console.error("Failed to parse refresh token response:",t),!1}}})}}const n=process.env.NEXT_PUBLIC_API_URL||process.env.VITE_API_URL||process.env.REACT_APP_API_URL||"https://api.myhirecontrol.com",r=new e(n),i="undefined"!=typeof window&&"localhost"===window.location.hostname;var o=new class{login(e){return t(this,void 0,void 0,function*(){return r.post("/auth/login",e,!1)})}nextLogin(e){return t(this,void 0,void 0,function*(){const t="/auth/nextLogin"+(i?"?localhost=true":""),n=yield r.post(t,e,!1);return n&&(sessionStorage.setItem("token",n.token),sessionStorage.setItem("refreshToken",n.refreshToken),sessionStorage.setItem("expiration",n.expiration)),n})}refreshToken(){return t(this,void 0,void 0,function*(){const t="/auth/refresh"+(i?"?localhost=true":""),e=yield r.post(t,{},!0);return e&&i&&(sessionStorage.setItem("token",e.token),sessionStorage.setItem("refreshToken",e.refreshToken),sessionStorage.setItem("expiration",e.expiration)),e})}changeCompany(e){return t(this,void 0,void 0,function*(){const t="/auth/changeCompany"+(i?"?localhost=true":"");var n=yield r.post(t,e,!0);return n&&(sessionStorage.setItem("token",n.token),sessionStorage.setItem("refreshToken",n.refreshToken),sessionStorage.setItem("expiration",n.expiration)),n})}register(e){return t(this,void 0,void 0,function*(){return r.post("/auth/register",e,!1)})}getCompanies(){return t(this,void 0,void 0,function*(){return r.get("/auth/companies",!0)})}getCompany(){return t(this,void 0,void 0,function*(){return r.get("/auth/company",!0)})}getRoles(){return t(this,void 0,void 0,function*(){return r.get("/auth/roles",!0)})}isAuthenticated(){return t(this,void 0,void 0,function*(){try{const t=yield r.get("/auth/authenticated",!0);return t||(yield this.tryRefreshAndCheckAuth())}catch(t){return yield this.tryRefreshAndCheckAuth()}})}tryRefreshAndCheckAuth(){return t(this,void 0,void 0,function*(){try{yield this.refreshToken();return yield r.get("/auth/authenticated",!0)}catch(t){return!1}})}getUser(){return t(this,arguments,void 0,function*(t=null){try{return yield r.get("/auth/user",!0,t)}catch(t){throw t}})}logout(){return t(this,void 0,void 0,function*(){try{const t=yield r.post("/auth/logout",{},!0);return sessionStorage.removeItem("token"),sessionStorage.removeItem("refreshToken"),sessionStorage.removeItem("expiration"),t}catch(t){throw t}})}getPermissions(){return t(this,arguments,void 0,function*(t=null){try{return yield r.get("/auth/permissions",!0,t)}catch(t){throw t}})}};const s=new e(n);var u=new class{getEvents(){return t(this,arguments,void 0,function*(t=null){return s.get("/events",!0,t)})}getEvent(e){return t(this,arguments,void 0,function*(t,e=null){return s.get(`/events/${t}`,!0,e)})}getEventBySlug(e){return t(this,arguments,void 0,function*(t,e=null){return s.get(`/events/details/${t}`,!0,e)})}getListingEvents(e){return t(this,arguments,void 0,function*(t,e=null){return s.get(`/listingEvents/${t}`,!0,e)})}createEvent(e){return t(this,arguments,void 0,function*(t,e=null){return s.post("/events",t,!0,e)})}updateEvent(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return s.put(`/events/${t}`,e,!0,n)})}deleteEvent(e){return t(this,arguments,void 0,function*(t,e=null){return s.delete(`/events/${t}`,!0,e)})}};const l=new e(n);var a=new class{getAllRolesWithClaims(){return t(this,arguments,void 0,function*(t=null){return l.get("/roles",!0,t)})}addRole(e){return t(this,arguments,void 0,function*(t,e=null){return l.post("/roles",t,!0,e)})}updateRole(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return l.put(`/roles/${t}`,e,!0,n)})}deleteRole(e){return t(this,arguments,void 0,function*(t,e=null){return l.delete(`/roles/${t}`,!0,e)})}};const c=new e(n);var d=new class{getAllUsers(){return t(this,arguments,void 0,function*(t=null){try{return yield c.get("/users",!0,t)}catch(t){throw t}})}getUser(e){return t(this,arguments,void 0,function*(t,e=null){try{return yield c.get(`/users/${t}`,!0,e)}catch(t){throw t}})}createUser(e){return t(this,arguments,void 0,function*(t,e=null){try{return yield c.post("/users",t,!0,e)}catch(t){throw t}})}updateUser(e,n){return t(this,arguments,void 0,function*(t,e,n=null){try{yield c.put(`/users/${t}`,e,!0,n)}catch(t){throw t}})}updateLoggedInUser(e){return t(this,arguments,void 0,function*(t,e=null){try{yield c.put("/users",t,!0,e)}catch(t){throw t}})}deleteUser(e){return t(this,arguments,void 0,function*(t,e=null){try{yield c.delete(`/users/${t}`,!0,e)}catch(t){throw t}})}};const g=new e(n);var p=new class{forgotPassword(e){return t(this,void 0,void 0,function*(){try{return yield g.post("/account/forgotPassword",e,!1)}catch(t){throw t}})}resetPasswordWithToken(e){return t(this,void 0,void 0,function*(){try{return yield g.post("/account/resetPasswordWithToken",e,!1)}catch(t){throw t}})}resetPassword(e){return t(this,arguments,void 0,function*(t,e=null){try{return yield g.post("/account/resetPassword",t,!0,e)}catch(t){throw t}})}};const h=new e(n);var f=new class{getMapConfig(){return t(this,arguments,void 0,function*(t=null){try{return yield h.get("/mapconfig",!0,t)}catch(t){throw t}})}updateMapConfig(e){return t(this,arguments,void 0,function*(t,e=null){return h.put("/mapconfig",t,!0,e)})}createMapConfig(e){return t(this,arguments,void 0,function*(t,e=null){return h.post("/mapconfig",t,!0,e)})}};const v=new e(n);var y=new class{getAllPermissions(){return t(this,arguments,void 0,function*(t=null){return v.get("/permissions",!0,t)})}};const m=new e(n);var C=new class{getClientAuthConfigById(e){return t(this,arguments,void 0,function*(t,e=null){try{return yield m.get(`/clientAuthConfig/${t}`,!0,e)}catch(t){throw t}})}getAllClientAuthConfigs(){return t(this,arguments,void 0,function*(t=null){try{return yield m.get("/clientAuthConfig",!0,t)}catch(t){throw t}})}createClientAuthConfig(e){return t(this,arguments,void 0,function*(t,e=null){return m.post("/clientAuthConfig",t,!0,e)})}updateClientAuthConfig(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return m.put(`/clientAuthConfig/${t}`,e,!0,n)})}deleteClientAuthConfig(e){return t(this,arguments,void 0,function*(t,e=null){return m.delete(`/clientAuthConfig/${t}`,!0,e)})}};const A=new e(n);var L=new class{getSearchReadConfig(){return t(this,arguments,void 0,function*(t=null){try{return yield A.get("/integrationconfig/search-read",!0,t)}catch(t){if(404===(null==t?void 0:t.statusCode)||204===(null==t?void 0:t.statusCode))return null;throw t}})}};const S=new e(n);var T=new class{getListings(){return t(this,arguments,void 0,function*(t=null,e=null){try{const n=e?`?filterId=${encodeURIComponent(e)}`:"";return yield S.get(`/listings${n}`,!0,t)}catch(t){throw t}})}getListingDetails(e){return t(this,arguments,void 0,function*(t,e=null){try{return yield S.get(`/listings/${t}`,!0,e)}catch(t){throw t}})}};const b=new e(n);var w=new class{uploadMedia(e){return t(this,arguments,void 0,function*(t,e=null){return b.post("/media/upload",t,!0,e,!0)})}uploadProfileImage(e){return t(this,arguments,void 0,function*(t,e=null){return b.post("/media/upload-profile-image",t,!0,e,!0)})}listMedia(e){return t(this,arguments,void 0,function*(t,e=null){const n=new URLSearchParams({folderKey:t});return b.get(`/media/list?${n.toString()}`,!0,e)})}deleteMedia(e){return t(this,arguments,void 0,function*(t,e=null){const n=new URLSearchParams({key:t});return b.delete(`/media/delete?${n.toString()}`,!0,e)})}};const E=new e(n);var $=new class{getFilters(){return t(this,arguments,void 0,function*(t=null){return E.get("/filters",!0,t)})}getFilter(e){return t(this,arguments,void 0,function*(t,e=null){return E.get(`/filters/${t}`,!0,e)})}createFilter(e){return t(this,arguments,void 0,function*(t,e=null){return E.post("/filters",t,!0,e)})}updateFilter(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return E.put(`/filters/${t}`,e,!0,n)})}deleteFilter(e){return t(this,arguments,void 0,function*(t,e=null){return E.delete(`/filters/${t}`,!0,e)})}};const I=new e(n);var R=new class{getAppendListings(){return t(this,arguments,void 0,function*(t=null){return I.get("/appendListings",!0,t)})}getAppendListing(e){return t(this,arguments,void 0,function*(t,e=null){return I.get(`/appendListings/${t}`,!0,e)})}createAppendListing(e){return t(this,arguments,void 0,function*(t,e=null){return I.post("/appendListings",t,!0,e)})}updateAppendListing(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return I.put(`/appendListings/${t}`,e,!0,n)})}deleteAppendListing(e){return t(this,arguments,void 0,function*(t,e=null){return I.delete(`/appendListings/${t}`,!0,e)})}};const F=new e(n);var k=new class{getForms(){return t(this,arguments,void 0,function*(t=null){return F.get("/forms",!0,t)})}getForm(e){return t(this,arguments,void 0,function*(t,e=null){return F.get(`/forms/${t}`,!0,e)})}createForm(e){return t(this,arguments,void 0,function*(t,e=null){return F.post("/forms",t,!0,e)})}updateForm(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return F.put(`/forms/${t}`,e,!0,n)})}updateFormWithFieldRenames(e,n,r){return t(this,arguments,void 0,function*(t,e,n,r=null){return F.put(`/forms/${t}`,Object.assign(Object.assign({},e),n),!0,r)})}getFormSubmissionCount(e){return t(this,arguments,void 0,function*(t,e=null){return F.get(`/forms/${t}/submission-count`,!0,e)})}getFormSubmissionFieldUsage(e){return t(this,arguments,void 0,function*(t,e=null){return F.get(`/forms/${t}/submission-fields`,!0,e)})}migrateSubmissionFields(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return F.post(`/forms/${t}/migrate-submission-fields`,e,!0,n)})}deleteForm(e){return t(this,arguments,void 0,function*(t,e=null){return F.delete(`/forms/${t}`,!0,e)})}processFormRequest(e){return t(this,arguments,void 0,function*(t,e=null){return F.post("/forms/jsonSchema",t,!0,e)})}};const B=new e(n);var O=new class{submitContactForm(e){return t(this,arguments,void 0,function*(t,e=null){return B.post("/contactForm",t,!0,e,!0)})}submitFormSubmission(e){return t(this,arguments,void 0,function*(t,e=null){return B.post("/formsubmission",t,!0,e)})}getFormSubmissions(){return t(this,arguments,void 0,function*(t=20,e=1,n=null,r=null,i=null,o=null,s=null){const u=new URLSearchParams({pageSize:t.toString(),pageNumber:e.toString()});return r&&u.append("status",r.toString()),n&&u.append("type",n),i&&u.append("from",i.toISOString()),o&&u.append("to",o.toISOString()),B.get(`/formsubmission?${u.toString()}`,!0,s)})}exportFormSubmissionsCsv(){return t(this,arguments,void 0,function*(t=20,e=1,n=null,r=null,i=null,o=null,s=null,u=null){const l=new URLSearchParams({pageSize:t.toString(),pageNumber:e.toString()});r&&l.append("status",r.toString()),n&&l.append("type",n),i&&l.append("from",i.toISOString()),o&&l.append("to",o.toISOString()),s&&s.length>0&&s.forEach(t=>l.append("columns",t));const a=yield B.getFile(`/formsubmission/export-csv?${l.toString()}`,!0,u),c=window.URL.createObjectURL(a),d=document.createElement("a");d.href=c,d.download="HireControl_Form_Submissions.csv",document.body.appendChild(d),d.click(),window.URL.revokeObjectURL(c),document.body.removeChild(d)})}getFormSubmissionTypes(){return t(this,arguments,void 0,function*(t=null){return B.get("/formsubmission/types",!0,t)})}};const x=new e(n);var M=new class{getCompanies(){return t(this,arguments,void 0,function*(t=null){return x.get("/companies",!0,t)})}getCompany(e){return t(this,arguments,void 0,function*(t,e=null){return x.get(`/companies/${t}`,!0,e)})}createCompany(e){return t(this,arguments,void 0,function*(t,e=null){return x.post("/companies",t,!0,e)})}updateCompany(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return x.put(`/companies/${t}`,e,!0,n)})}deleteCompany(e){return t(this,arguments,void 0,function*(t,e=null){return x.delete(`/companies/${t}`,!0,e)})}syncAllCompanies(){return t(this,arguments,void 0,function*(t=null){return x.get("/companies/syncall",!0,t)})}};const j=new e(n);var U=new class{updateFieldVersionApproval(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return j.patch(`/joblistings/${t}/field-version-approval`,e,!0,n)})}updateDescriptionVersionApproval(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return j.patch(`/joblistings/${t}/description-version-approval`,e,!0,n)})}getJobListingsByCompany(){return t(this,arguments,void 0,function*(t=null){return j.get("/joblistings",!0,t)})}getMapJobListingsByCompany(){return t(this,arguments,void 0,function*(t=null,e=null){return e?j.get(`/joblistings/MapListings?filterId=${e}`,!0,t):j.get("/joblistings/MapListings",!0,t)})}getJobListingById(e){return t(this,arguments,void 0,function*(t,e=null){return j.get(`/joblistings/${t}`,!0,e)})}getMapListingById(e){return t(this,arguments,void 0,function*(t,e=null){return j.get(`/joblistings/MapListings/${t}`,!0,e)})}createJobListing(e){return t(this,arguments,void 0,function*(t,e=null){return j.post("/joblistings",t,!0,e)})}updateJobListing(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return j.put(`/joblistings/${t}`,e,!0,n)})}exportJobListingsCsv(){return t(this,arguments,void 0,function*(t=10,e=1,n=null,r=null,i=null,o=null){const s=new URLSearchParams({pageSize:t.toString(),pageNumber:e.toString()});n&&s.append("status",n.toString()),r&&s.append("from",r.toISOString()),i&&s.append("to",i.toISOString());const u=yield j.getFile(`/joblistings/Export-csv?${s.toString()}`,!0,o),l=window.URL.createObjectURL(u),a=document.createElement("a");a.href=l,a.download="job_listings.csv",document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(l),document.body.removeChild(a)})}deleteJobListing(e){return t(this,arguments,void 0,function*(t,e=null){return j.delete(`/joblistings/${t}`,!0,e)})}};const N=new e(n);var _=new class{getBlogs(){return t(this,arguments,void 0,function*(t=null){return N.get("/blog",!0,t)})}getBlog(e){return t(this,arguments,void 0,function*(t,e=null){return N.get(`/blog/${t}`,!0,e)})}createBlog(e){return t(this,arguments,void 0,function*(t,e=null){return N.post("/blog",t,!0,e)})}updateBlog(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return N.put(`/blog/${t}`,e,!0,n)})}deleteBlog(e){return t(this,arguments,void 0,function*(t,e=null){return N.delete(`/blog/${t}`,!0,e)})}};const P=new e(n);var D=new class{getCategories(){return t(this,arguments,void 0,function*(t=null,e=null){const n=new URLSearchParams;null!=t&&n.append("type",String(t));const r=n.toString()?`?${n.toString()}`:"";return P.get(`/categories${r}`,!0,e)})}getCategoriesByCompany(e){return t(this,arguments,void 0,function*(t,e=null,n=null){const r=new URLSearchParams;null!=e&&r.append("type",String(e));const i=r.toString()?`?${r.toString()}`:"";return P.get(`/categories/${t}${i}`,!0,n)})}};const V=new e(n);var W=new class{getAllCategoryLists(){return t(this,arguments,void 0,function*(t=null){return V.get("/categorylist",!0,t)})}getCategoryListById(e){return t(this,arguments,void 0,function*(t,e=null){return V.get(`/categorylist/${t}`,!0,e)})}getCategoryListsByType(e){return t(this,arguments,void 0,function*(t,e=null){return V.get(`/categorylist/type/${t}`,!0,e)})}getActiveCategoryLists(){return t(this,arguments,void 0,function*(t=null){return V.get("/categorylist/active",!0,t)})}getCategoryListByTypeAndName(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return V.get(`/categorylist/type/${t}/name/${e}`,!0,n)})}createCategoryList(e){return t(this,arguments,void 0,function*(t,e=null){return V.post("/categorylist",t,!0,e)})}updateCategoryList(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return V.put(`/categorylist/${t}`,e,!0,n)})}deleteCategoryList(e){return t(this,arguments,void 0,function*(t,e=null){return V.delete(`/categorylist/${t}`,!0,e)})}addValue(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return V.post(`/categorylist/${t}/values`,e,!0,n)})}removeValue(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return V.delete(`/categorylist/${t}/values/${e}`,!0,n)})}updateValues(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return V.put(`/categorylist/${t}/values`,e,!0,n)})}updateValue(e,n,r){return t(this,arguments,void 0,function*(t,e,n,r=null){return V.put(`/categorylist/${t}/values/${encodeURIComponent(e)}`,n,!0,r)})}};const J=new e(n);var H=new class{getByFeed(e){return t(this,arguments,void 0,function*(t,e=null){return J.get(`/jobFeedFieldMappings/feed/${t}`,!0,e)})}get(e){return t(this,arguments,void 0,function*(t,e=null){return J.get(`/jobFeedFieldMappings/${t}`,!0,e)})}create(e){return t(this,arguments,void 0,function*(t,e=null){return J.post("/jobFeedFieldMappings",t,!0,e)})}update(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return J.put(`/jobFeedFieldMappings/${t}`,e,!0,n)})}delete(e){return t(this,arguments,void 0,function*(t,e=null){return J.delete(`/jobFeedFieldMappings/${t}`,!0,e)})}toggleActive(e){return t(this,arguments,void 0,function*(t,e=null){return J.post("/jobFeedFieldMappings/toggle-active",t,!0,e)})}discoverFields(e){return t(this,arguments,void 0,function*(t,e=null){return J.get(`/jobFeedFieldMappings/discover-fields/${t}`,!0,e)})}validate(e){return t(this,arguments,void 0,function*(t,e=null){return J.get(`/jobFeedFieldMappings/validate/${t}`,!0,e)})}};const G=new e(n);var z=new class{getAll(){return t(this,arguments,void 0,function*(t=null){return G.get("/jobfeeds",!0,t)})}get(e){return t(this,arguments,void 0,function*(t,e=null){return G.get(`/jobfeeds/${t}`,!0,e)})}create(e){return t(this,arguments,void 0,function*(t,e=null){return G.post("/jobfeeds",t,!0,e)})}update(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return G.put(`/jobfeeds/${t}`,e,!0,n)})}delete(e){return t(this,arguments,void 0,function*(t,e=null){return G.delete(`/jobfeeds/${t}`,!0,e)})}sync(e){return t(this,arguments,void 0,function*(t,e=null){return G.post(`/jobfeeds/${t}/sync`,{},!0,e)})}toggleActive(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return G.patch(`/jobfeeds/${t}/toggle-active`,e,!0,n)})}};const K=new e(n);var X=new class{get(){return t(this,arguments,void 0,function*(t=null){return K.get("/jobListingSettings",!0,t)})}create(e){return t(this,arguments,void 0,function*(t,e=null){return K.post("/jobListingSettings",t,!0,e)})}delete(){return t(this,arguments,void 0,function*(t=null){return K.delete("/jobListingSettings",!0,t)})}};const Y=new e(n);var q=new class{getAllSql(e){return t(this,arguments,void 0,function*(t,e=null,n=null){const r=new URLSearchParams;return e&&r.append("origin",e),Y.post("/listingEntities"+(r.toString()?"?"+r.toString():""),t,!0,n)})}getAll(){return t(this,arguments,void 0,function*(t=null){return Y.get("/listingEntities",!0,t)})}create(e){return t(this,arguments,void 0,function*(t,e=null){return Y.post("/listingEntities/create",t,!0,e)})}update(e,n){return t(this,arguments,void 0,function*(t,e,n=null){yield Y.put(`/listingEntities/update/${t}`,e,!0,n)})}delete(e){return t(this,arguments,void 0,function*(t,e=null){yield Y.delete(`/listingEntities/delete/${t}`,!0,e)})}};const Z=new e(n);var Q=new class{get(){return t(this,arguments,void 0,function*(t=null,e=null){const n=new URLSearchParams;t&&t.forEach(t=>n.append("recruiterIds",t.toString()));const r=n.toString()?`?${n.toString()}`:"";return Z.get(`/recruiters${r}`,!0,e)})}getAll(){return t(this,arguments,void 0,function*(t=null){return Z.get("/recruiters/all",!0,t)})}sync(){return t(this,arguments,void 0,function*(t=null){return Z.post("/recruiters/sync",{},!0,t)})}};const tt=new e(n);var et=new class{getFieldTypes(){return t(this,arguments,void 0,function*(t=null){return tt.get("/field/types",!0,t)})}};const nt=new e(n);var rt=new class{getValidatorTypes(){return t(this,arguments,void 0,function*(t=null){return nt.get("/validator/types",!0,t)})}};const it=t=>t?/^[a-z][a-zA-Z0-9]*$/.test(t)?t:t.replace(/[^a-zA-Z0-9]+/g," ").trim().toLowerCase().replace(/\s+(.)/g,(t,e)=>e.toUpperCase()).replace(/\s/g,"").replace(/^(.)/,(t,e)=>e.toLowerCase()):t,ot=t=>{if(Array.isArray(t))return t.map(t=>ot(t));if(!(t=>null!==t&&"object"==typeof t&&Object.getPrototypeOf(t)===Object.prototype)(t))return t;const e={};for(const[n,r]of Object.entries(t))e[it(n)]=ot(r);return e},st=new e(n);var ut=new class{getContentEntries(e){return t(this,arguments,void 0,function*(t,e=null,n=null){let r=`/contententry?contentId=${t}`;null!==e&&(r+=`&statusFilter=${e}`);const i=yield st.get(r,!0,n);return ot(i)})}getContentEntry(e){return t(this,arguments,void 0,function*(t,e=null,n=null){let r=`/contententry/${t}`;null!==e&&(r+=`?statusFilter=${e}`);const i=yield st.get(r,!0,n);return ot(i)})}getContentEntryBySlug(e,n){return t(this,arguments,void 0,function*(t,e,n=null,r=null){let i=`/contententry/by-slug?contentId=${encodeURIComponent(t)}&slug=${encodeURIComponent(e)}`;null!==n&&(i+=`&statusFilter=${n}`);const o=yield st.get(i,!0,r);return ot(o)})}createContentEntry(e){return t(this,arguments,void 0,function*(t,e=null){const n=yield st.post("/contententry",t,!0,e);return ot(n)})}updateContentEntry(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return st.put(`/contententry/${t}`,e,!0,n)})}deleteContentEntry(e){return t(this,arguments,void 0,function*(t,e=null){return st.delete(`/contententry/${t}`,!0,e)})}getVersions(e){return t(this,arguments,void 0,function*(t,e=null){const n=yield st.get(`/contententry/${t}/versions`,!0,e);return ot(n)})}unpublishAll(e){return t(this,arguments,void 0,function*(t,e=null){return st.post(`/contententry/${t}/unpublish`,void 0,!0,e)})}};const lt=new e(n);var at=new class{getBlocks(){return t(this,arguments,void 0,function*(t=null){const e=yield lt.get("/block",!0,t);return ot(e)})}getBlock(e){return t(this,arguments,void 0,function*(t,e=null){const n=yield lt.get(`/block/${t}`,!0,e);return ot(n)})}createBlock(e){return t(this,arguments,void 0,function*(t,e=null){const n=yield lt.post("/block",t,!0,e);return ot(n)})}updateBlock(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return lt.put(`/block/${t}`,e,!0,n)})}updateBlockWithMigrations(e,n){return t(this,arguments,void 0,function*(t,e,n=[],r=null){const i=n.length>0?{block:e,fieldMigrations:n}:e;return lt.put(`/block/${t}`,i,!0,r)})}previewBlockUpdate(e,n){return t(this,arguments,void 0,function*(t,e,n=null){const r=yield lt.post(`/block/${t}/preview-update`,e,!0,n);return ot(r)})}deleteBlock(e){return t(this,arguments,void 0,function*(t,e=null){return lt.delete(`/block/${t}`,!0,e)})}getTemplateBlocks(){return t(this,arguments,void 0,function*(t=null){const e=yield lt.get("/block/template-blocks",!0,t);return ot(e)})}};const ct=new e(n);var dt=new class{getModels(){return t(this,arguments,void 0,function*(t=null){return ct.get("/model",!0,t)})}getModel(e){return t(this,arguments,void 0,function*(t,e=null){return ct.get(`/model/${t}`,!0,e)})}createModel(e){return t(this,arguments,void 0,function*(t,e=null){return ct.post("/model",t,!0,e)})}updateModel(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return ct.put(`/model/${t}`,e,!0,n)})}deleteModel(e){return t(this,arguments,void 0,function*(t,e=null){return ct.delete(`/model/${t}`,!0,e)})}previewSync(e){return t(this,arguments,void 0,function*(t,e=null){return ct.get(`/model/${t}/sync/preview`,!0,e)})}executeSync(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return ct.post(`/model/${t}/sync`,e,!0,n)})}};const gt=new e(n);var pt,ht,ft,vt,yt=new class{getCompletion(e){return t(this,arguments,void 0,function*(t,e=null){return gt.post("/openai/completion",t,!0,e)})}};exports.EventType=void 0,(pt=exports.EventType||(exports.EventType={}))[pt.Virtual=0]="Virtual",pt[pt.InPerson=1]="InPerson",pt[pt.Hybrid=2]="Hybrid",exports.CallToActionType=void 0,(ht=exports.CallToActionType||(exports.CallToActionType={}))[ht.Button=0]="Button",ht[ht.Link=1]="Link",ht[ht.Download=2]="Download",ht[ht.HireControlRegistration=3]="HireControlRegistration",exports.FormSubmissionStatus=void 0,(ft=exports.FormSubmissionStatus||(exports.FormSubmissionStatus={}))[ft.Submitted=1]="Submitted",ft[ft.Hold=2]="Hold",ft[ft.Rejected=3]="Rejected",ft[ft.Sent=4]="Sent",exports.FeedHandlingOption=void 0,(vt=exports.FeedHandlingOption||(exports.FeedHandlingOption={}))[vt.Replace=0]="Replace",vt[vt.Append=1]="Append",vt[vt.Custom=2]="Custom";const mt={HERO:"hero",VIDEO_BLOCK:"videoBlock",CONTENT_CARD:"contentCard",ICON_CARD:"iconCard",LIST:"list",CONTAINER:"container",ACCORDION:"accordion",TESTIMONIAL:"testimonial",LARGE_TITLE_BLOCK:"largeTitleBlock",BUTTON:"button",RECRUITER:"recruiter",BLOBS:"blobs",TITLE_MODULAR_CONTENT_COPY:"titleModularContentCopy",INTRO_WITH_CONTENT_CARD:"introWithContentCard",CALLOUT_CARD:"calloutCard"},Ct={"testimonial-block":mt.TESTIMONIAL,"button-block":mt.BUTTON,"recruiter-block":mt.RECRUITER},At={login:o.login,nextLogin:o.nextLogin,refreshToken:o.refreshToken,changeCompany:o.changeCompany,register:o.register,isAuthenticated:o.isAuthenticated,getCompany:o.getCompany,getCompanies:o.getCompanies,getRoles:o.getRoles,getPermissions:o.getPermissions,logout:o.logout,getUser:o.getUser},Lt={getAll:u.getEvents,get:u.getEvent,getBySlug:u.getEventBySlug,create:u.createEvent,update:u.updateEvent,delete:u.deleteEvent},St={get:a.getAllRolesWithClaims,create:a.addRole,update:a.updateRole,delete:a.deleteRole},Tt=d,bt=T,wt={resetPassword:p.resetPassword,resetPasswordWithToken:p.resetPasswordWithToken,forgotPassword:p.forgotPassword},Et={get:f.getMapConfig,update:f.updateMapConfig,create:f.createMapConfig},$t={get:C.getClientAuthConfigById,getAll:C.getAllClientAuthConfigs,update:C.updateClientAuthConfig,create:C.createClientAuthConfig,delete:C.deleteClientAuthConfig},It={getSearchRead:L.getSearchReadConfig},Rt={upload:w.uploadMedia,uploadProfileImage:w.uploadProfileImage,get:w.listMedia,delete:w.deleteMedia},Ft={getList:$.getFilters,get:$.getFilter,update:$.updateFilter,create:$.createFilter,delete:$.deleteFilter},kt={get:R.getAppendListings,getAppendListing:R.getAppendListing,create:R.createAppendListing,update:R.updateAppendListing,delete:R.deleteAppendListing},Bt={getAll:_.getBlogs,getById:_.getBlog,create:_.createBlog,update:_.updateBlog,delete:_.deleteBlog},Ot={get:D.getCategories,getByCompany:D.getCategoriesByCompany},xt={getAll:W.getAllCategoryLists,getById:W.getCategoryListById,getByType:W.getCategoryListsByType,getActive:W.getActiveCategoryLists,getByTypeAndName:W.getCategoryListByTypeAndName,create:W.createCategoryList,update:W.updateCategoryList,delete:W.deleteCategoryList,addValue:W.addValue,removeValue:W.removeValue,updateValue:W.updateValue,updateValues:W.updateValues},Mt={getByFeed:H.getByFeed,get:H.get,create:H.create,update:H.update,delete:H.delete,toggleActive:H.toggleActive,discoverFields:H.discoverFields,validate:H.validate},jt={getAll:z.getAll,getById:z.get,create:z.create,update:z.update,delete:z.delete,sync:z.sync,toggleActive:z.toggleActive},Ut={get:X.get,create:X.create,delete:X.delete},Nt={create:q.create,get:q.getAll,update:q.update,delete:q.delete,getAllSql:q.getAllSql},_t={get:Q.get,getAll:Q.getAll,sync:Q.sync},Pt={get:y.getAllPermissions},Dt={getAll:M.getCompanies,getById:M.getCompany,create:M.createCompany,update:M.updateCompany,delete:M.deleteCompany,sync:M.syncAllCompanies},Vt={getAll:U.getJobListingsByCompany,getMapListings:U.getMapJobListingsByCompany,getMapListing:U.getMapListingById,getById:U.getJobListingById,updateFieldVersionApproval:U.updateFieldVersionApproval,updateDescriptionVersionApproval:U.updateDescriptionVersionApproval,create:U.createJobListing,update:U.updateJobListing,delete:U.deleteJobListing},Wt={getTypes:et.getFieldTypes},Jt={getTypes:rt.getValidatorTypes},Ht={getAll:ut.getContentEntries,getById:ut.getContentEntry,getBySlug:ut.getContentEntryBySlug,create:ut.createContentEntry,update:ut.updateContentEntry,delete:ut.deleteContentEntry,unpublish:ut.unpublishAll},Gt={getAll:at.getBlocks,getById:at.getBlock,create:at.createBlock,update:at.updateBlock,updateWithMigrations:at.updateBlockWithMigrations,previewUpdate:at.previewBlockUpdate,delete:at.deleteBlock,getTemplateBlocks:at.getTemplateBlocks},zt={getAll:dt.getModels,getById:dt.getModel,create:dt.createModel,update:dt.updateModel,delete:dt.deleteModel,previewSync:dt.previewSync,executeSync:dt.executeSync},Kt={getCompletion:yt.getCompletion},Xt=k,Yt=O,qt={auth:At,events:Lt,roles:St,users:Tt,account:wt,mapConfig:Et,permissions:Pt,clientAuthConfig:$t,integrationConfig:It,filters:Ft,listings:bt,media:Rt,appendListings:kt,blogs:Bt,categories:Ot,categoryLists:xt,jobFeedFieldMappings:Mt,jobFeeds:jt,jobListingSettings:Ut,listingEntities:Nt,recruiters:_t,forms:Xt,formSubmissions:Yt,openAI:Kt,companies:Dt,jobListings:Vt};exports.BLOCK_KEYS=mt,exports.BLOCK_KEY_ALIASES=Ct,exports.FIELD_TYPES={SINGLE_LINE_STRING:"SingleLineString",MULTI_LINE_TEXT:"MultiLineText",MULTIPLE_PARAGRAPH_TEXT:"MultipleParagraphText",SLUG:"Slug",STRUCTURED_TEXT:"StructuredText",RICH_TEXT:"RichText",INTEGER_NUMBER:"IntegerNumber",FLOATING_POINT_NUMBER:"FloatingPointNumber",BOOLEAN:"Boolean",DATE:"Date",DATE_TIME:"DateTime",SINGLE_MEDIA:"SingleMedia",MEDIA_GALLERY:"MediaGallery",EXTERNAL_VIDEO:"ExternalVideo",COLOR:"Color",TAILWIND_COLOR_SELECTOR:"TailwindColorSelector",SINGLE_LINK:"SingleLink",MULTIPLE_LINKS:"MultipleLinks",LOCATION:"Location",JSON:"Json",SEO:"Seo",MODULAR_CONTENT:"ModularContent",SINGLE_BLOCK:"SingleBlock",JOB_FILTER:"JobFilter",FORM:"Form",SINGLE_CONTENT_REFERENCE:"SingleContentReference",MULTIPLE_CONTENT_REFERENCE:"MultipleContentReference",HIRE_CONTROL_MAP:"HireControlMap",RECRUITER_SELECTOR:"RecruiterSelector",TAGS:"Tags",VARIANT_SELECTOR:"VariantSelector"},exports.account=wt,exports.appendListings=kt,exports.auth=At,exports.blogs=Bt,exports.categories=Ot,exports.categoryLists=xt,exports.clientAuthConfig=$t,exports.companies=Dt,exports.contentBlocks=Gt,exports.contentEntries=Ht,exports.contentField=Wt,exports.contentValidator=Jt,exports.default=qt,exports.events=Lt,exports.filters=Ft,exports.formSubmissions=Yt,exports.forms=Xt,exports.integrationConfig=It,exports.jobFeedFieldMappings=Mt,exports.jobFeeds=jt,exports.jobListingSettings=Ut,exports.jobListings=Vt,exports.listingEntities=Nt,exports.listings=bt,exports.mapConfig=Et,exports.media=Rt,exports.model=zt,exports.openAI=Kt,exports.permissions=Pt,exports.recruiters=_t,exports.roles=St,exports.users=Tt;
2
2
  //# sourceMappingURL=index.cjs.js.map
package/dist/index.d.ts CHANGED
@@ -20,16 +20,19 @@ import ValidatorDefinition from "./types/content/validatorDefinition";
20
20
  import ContentModel, { ModuleConfig, ModuleFieldMapping, ModuleIdentityMapping, WebPageTemplate, WebPageTemplateSection, WebPageTemplateBlock, ContentModuleSyncPreview, ContentModuleSyncExecuteRequest, ContentModuleSyncExecuteResult } from "./types/content/model";
21
21
  import ContentBlock from "./types/content/block";
22
22
  import ContentEntry from "./types/content/contentEntry";
23
+ import { BlockUpdateImpact, BlockFieldChange, BlockFieldMigration } from "./types/content/blockUpdateImpact";
23
24
  import Blog from "./types/blog";
24
- import CategoryListDto, { AddValueRequest } from "./types/categoryList";
25
+ import CategoryListDto, { AddValueRequest, CategoryListValueDto } from "./types/categoryList";
25
26
  import JobFeed from "./types/jobFeed";
26
27
  import JobFeedFieldMapping, { MultipleFieldConfig, ConditionalConfig, ConditionalRule } from "./types/jobFeedFieldMapping";
27
28
  import JobListingSettings, { FeedHandlingOption } from "./types/jobListingSettings";
28
29
  import ListingEntityDto from "./types/listingEntity";
29
30
  import RecruiterDto from "./types/recruiter";
30
31
  import FocalPoint from "./types/focalPoint";
32
+ import ListingEntityMedia from "./types/listingEntityMedia";
31
33
  import CompletionRequest, { CompletionResponse } from "./types/completionRequest";
32
34
  import SearchReadConfig from "./types/searchReadConfig";
35
+ import { BLOCK_KEYS, BLOCK_KEY_ALIASES, FIELD_TYPES, type BlockKey, type FieldType } from "./constants/cms";
33
36
  export declare const auth: {
34
37
  login: (clientLogInRequest: import("./types/clientLoginRequest").default) => Promise<any>;
35
38
  nextLogin: (credentials: import("./types/credentials").default) => Promise<any>;
@@ -126,7 +129,8 @@ export declare const categoryLists: {
126
129
  delete: (id: string, authToken?: string | null) => Promise<void>;
127
130
  addValue: (id: string, request: AddValueRequest, authToken?: string | null) => Promise<CategoryListDto>;
128
131
  removeValue: (id: string, key: string, authToken?: string | null) => Promise<CategoryListDto>;
129
- updateValues: (id: string, values: Record<string, string>, authToken?: string | null) => Promise<CategoryListDto>;
132
+ updateValue: (id: string, key: string, value: CategoryListValueDto, authToken?: string | null) => Promise<CategoryListDto>;
133
+ updateValues: (id: string, values: Record<string, CategoryListDto["values"][string]>, authToken?: string | null) => Promise<CategoryListDto>;
130
134
  };
131
135
  export declare const jobFeedFieldMappings: {
132
136
  getByFeed: (feedId: string, authToken?: string | null) => Promise<JobFeedFieldMapping[]>;
@@ -180,6 +184,18 @@ export declare const jobListings: {
180
184
  getMapListings: (authToken?: string | null, filterId?: string | null) => Promise<any[]>;
181
185
  getMapListing: (id: string, authToken?: string | null) => Promise<any>;
182
186
  getById: (id: string, authToken?: string | null) => Promise<JobListing>;
187
+ updateFieldVersionApproval: (id: string, payload: {
188
+ fieldPath: string;
189
+ timestamp?: string;
190
+ listingVersionNumber?: number;
191
+ needsApproval: boolean;
192
+ }, authToken?: string | null) => Promise<void>;
193
+ updateDescriptionVersionApproval: (id: string, payload: {
194
+ descriptionId: string;
195
+ versionId?: number;
196
+ listingVersionNumber?: number;
197
+ needsApproval: boolean;
198
+ }, authToken?: string | null) => Promise<void>;
183
199
  create: (jobListing: JobListing, authToken?: string | null) => Promise<JobListing>;
184
200
  update: (id: string, jobListing: JobListing, authToken?: string | null) => Promise<void>;
185
201
  delete: (id: string, authToken?: string | null) => Promise<void>;
@@ -193,6 +209,7 @@ export declare const contentValidator: {
193
209
  export declare const contentEntries: {
194
210
  getAll: (contentId: string, statusFilter?: import("./types/content/status").Status | null, authToken?: string | null) => Promise<ContentEntry[]>;
195
211
  getById: (id: string, statusFilter?: import("./types/content/status").Status | null, authToken?: string | null) => Promise<ContentEntry>;
212
+ getBySlug: (contentId: string, slug: string, statusFilter?: import("./types/content/status").Status | null, authToken?: string | null) => Promise<ContentEntry>;
196
213
  create: (entry: ContentEntry, authToken?: string | null) => Promise<ContentEntry>;
197
214
  update: (id: string, entry: ContentEntry, authToken?: string | null) => Promise<void>;
198
215
  delete: (id: string, authToken?: string | null) => Promise<void>;
@@ -203,6 +220,8 @@ export declare const contentBlocks: {
203
220
  getById: (id: string, authToken?: string | null) => Promise<ContentBlock>;
204
221
  create: (block: ContentBlock, authToken?: string | null) => Promise<ContentBlock>;
205
222
  update: (id: string, block: ContentBlock, authToken?: string | null) => Promise<void>;
223
+ updateWithMigrations: (id: string, block: ContentBlock, fieldMigrations?: BlockFieldMigration[], authToken?: string | null) => Promise<void>;
224
+ previewUpdate: (id: string, block: ContentBlock, authToken?: string | null) => Promise<BlockUpdateImpact>;
206
225
  delete: (id: string, authToken?: string | null) => Promise<void>;
207
226
  getTemplateBlocks: (authToken?: string | null) => Promise<ContentBlock[]>;
208
227
  };
@@ -237,7 +256,9 @@ export declare const formSubmissions: {
237
256
  exportFormSubmissionsCsv(pageSize?: number, pageNumber?: number, type?: string | null, status?: FormSubmissionStatus | null, from?: Date | null, to?: Date | null, columns?: string[] | null, authToken?: string | null): Promise<void>;
238
257
  getFormSubmissionTypes(authToken?: string | null): Promise<string[]>;
239
258
  };
240
- export type { Register, User, Role, HireControlConfig, ClientAuthConfig, Event, Listing, EventDates, EventDateType, EventInstance, MediaType, Filters, AppendListing, Form, FormFieldMigrationRequest, FormUpdateOptions, FormSubmission, ResultsWrapper, Company, JobListing, FieldTypeDefinition, ValidatorDefinition, ContentModel, ModuleConfig, ModuleFieldMapping, ModuleIdentityMapping, WebPageTemplate, WebPageTemplateSection, WebPageTemplateBlock, ContentModuleSyncPreview, ContentModuleSyncExecuteRequest, ContentModuleSyncExecuteResult, ContentBlock, ContentEntry, Blog, CategoryListDto, AddValueRequest, JobFeed, JobFeedFieldMapping, MultipleFieldConfig, ConditionalConfig, ConditionalRule, JobListingSettings, ListingEntityDto, RecruiterDto, FocalPoint, CompletionRequest, CompletionResponse, SearchReadConfig, };
259
+ export { BLOCK_KEYS, BLOCK_KEY_ALIASES, FIELD_TYPES };
260
+ export type { Register, User, Role, HireControlConfig, ClientAuthConfig, Event, Listing, EventDates, EventDateType, EventInstance, MediaType, Filters, AppendListing, Form, FormFieldMigrationRequest, FormUpdateOptions, FormSubmission, ResultsWrapper, Company, JobListing, FieldTypeDefinition, ValidatorDefinition, ContentModel, ModuleConfig, ModuleFieldMapping, ModuleIdentityMapping, WebPageTemplate, WebPageTemplateSection, WebPageTemplateBlock, ContentModuleSyncPreview, ContentModuleSyncExecuteRequest, ContentModuleSyncExecuteResult, ContentBlock, BlockUpdateImpact, BlockFieldChange, BlockFieldMigration, ContentEntry, Blog, CategoryListDto, AddValueRequest, CategoryListValueDto, JobFeed, JobFeedFieldMapping, MultipleFieldConfig, ConditionalConfig, ConditionalRule, JobListingSettings, ListingEntityDto, RecruiterDto, FocalPoint, ListingEntityMedia, CompletionRequest, CompletionResponse, SearchReadConfig, };
261
+ export type { BlockKey, FieldType };
241
262
  export { EventType, CallToActionType, FormSubmissionStatus, FeedHandlingOption, };
242
263
  declare const hcApi: {
243
264
  auth: {
@@ -339,7 +360,8 @@ declare const hcApi: {
339
360
  delete: (id: string, authToken?: string | null) => Promise<void>;
340
361
  addValue: (id: string, request: AddValueRequest, authToken?: string | null) => Promise<CategoryListDto>;
341
362
  removeValue: (id: string, key: string, authToken?: string | null) => Promise<CategoryListDto>;
342
- updateValues: (id: string, values: Record<string, string>, authToken?: string | null) => Promise<CategoryListDto>;
363
+ updateValue: (id: string, key: string, value: CategoryListValueDto, authToken?: string | null) => Promise<CategoryListDto>;
364
+ updateValues: (id: string, values: Record<string, CategoryListDto["values"][string]>, authToken?: string | null) => Promise<CategoryListDto>;
343
365
  };
344
366
  jobFeedFieldMappings: {
345
367
  getByFeed: (feedId: string, authToken?: string | null) => Promise<JobFeedFieldMapping[]>;
@@ -412,6 +434,18 @@ declare const hcApi: {
412
434
  getMapListings: (authToken?: string | null, filterId?: string | null) => Promise<any[]>;
413
435
  getMapListing: (id: string, authToken?: string | null) => Promise<any>;
414
436
  getById: (id: string, authToken?: string | null) => Promise<JobListing>;
437
+ updateFieldVersionApproval: (id: string, payload: {
438
+ fieldPath: string;
439
+ timestamp?: string;
440
+ listingVersionNumber?: number;
441
+ needsApproval: boolean;
442
+ }, authToken?: string | null) => Promise<void>;
443
+ updateDescriptionVersionApproval: (id: string, payload: {
444
+ descriptionId: string;
445
+ versionId?: number;
446
+ listingVersionNumber?: number;
447
+ needsApproval: boolean;
448
+ }, authToken?: string | null) => Promise<void>;
415
449
  create: (jobListing: JobListing, authToken?: string | null) => Promise<JobListing>;
416
450
  update: (id: string, jobListing: JobListing, authToken?: string | null) => Promise<void>;
417
451
  delete: (id: string, authToken?: string | null) => Promise<void>;
@@ -68,6 +68,7 @@ export type FieldVersion = {
68
68
  source: string | null;
69
69
  user: string | null;
70
70
  needsApproval: boolean;
71
+ listingVersionNumber?: number;
71
72
  };
72
73
  export type AuditTrailEntry = {
73
74
  timestamp: string;
@@ -4,13 +4,17 @@ export type ModifiedByDto = {
4
4
  lastName: string;
5
5
  dateTime: string;
6
6
  };
7
+ export type CategoryListValueDto = {
8
+ displayValue: string;
9
+ displayInForms: boolean;
10
+ };
7
11
  export type CategoryListDto = {
8
12
  id: string;
9
13
  companyId: string;
10
14
  type: string;
11
15
  name: string;
12
16
  description?: string;
13
- values: Record<string, string>;
17
+ values: Record<string, CategoryListValueDto>;
14
18
  isActive: boolean;
15
19
  autoAddNewValues: boolean;
16
20
  notifyOnNewValues: boolean;
@@ -21,6 +25,7 @@ export type CategoryListDto = {
21
25
  };
22
26
  export type AddValueRequest = {
23
27
  key: string;
24
- value: string;
28
+ displayValue: string;
29
+ displayInForms: boolean;
25
30
  };
26
31
  export default CategoryListDto;
@@ -0,0 +1,22 @@
1
+ export type BlockFieldChange = {
2
+ oldKey?: string;
3
+ newKey?: string;
4
+ key?: string;
5
+ affectedEntryCount?: number;
6
+ };
7
+ export type BlockUpdateImpact = {
8
+ renamedFields?: BlockFieldChange[];
9
+ removedFields?: BlockFieldChange[];
10
+ addedFields?: BlockFieldChange[];
11
+ affectedEntries?: Array<{
12
+ usedIn?: string;
13
+ title?: string;
14
+ }>;
15
+ };
16
+ export type BlockFieldMigration = {
17
+ type: "rename" | "remove";
18
+ oldKey?: string;
19
+ newKey?: string;
20
+ key?: string;
21
+ cleanup?: boolean;
22
+ };
@@ -12,6 +12,31 @@ export type ModuleFieldMapping = {
12
12
  sourcePath?: string;
13
13
  applyOnSync?: boolean;
14
14
  };
15
+ export type ModuleGrouping = {
16
+ enabled?: boolean;
17
+ groupBySourcePath?: string;
18
+ displayNameSourcePath?: string;
19
+ sourceKeyPrefix?: string;
20
+ includeUngrouped?: boolean;
21
+ };
22
+ export type ModuleSectionRepeaterFieldMapping = {
23
+ targetField?: string;
24
+ sourcePath?: string;
25
+ slugifyValue?: boolean;
26
+ buildUrlPath?: boolean;
27
+ urlPathBase?: string;
28
+ };
29
+ export type ModuleSectionRepeater = {
30
+ id?: string;
31
+ sectionId?: string;
32
+ sectionIndex?: number;
33
+ blockKey?: string;
34
+ sourceCollectionPath?: string;
35
+ itemIdentitySourcePath?: string;
36
+ applyOnSync?: boolean;
37
+ syncOnRead?: boolean;
38
+ fieldMappings?: ModuleSectionRepeaterFieldMapping[];
39
+ };
15
40
  export type ModuleSourceFilter = {
16
41
  combinator?: "and" | "or" | string;
17
42
  rules?: Array<any>;
@@ -27,6 +52,10 @@ export type WebPageTemplateSection = {
27
52
  title?: string;
28
53
  slug?: string;
29
54
  showInNav?: boolean;
55
+ layout?: Record<string, any>;
56
+ items?: Array<Record<string, any>>;
57
+ collapsed?: boolean;
58
+ order?: number;
30
59
  blocks?: WebPageTemplateBlock[];
31
60
  };
32
61
  export type WebPageTemplate = {
@@ -36,8 +65,11 @@ export type ModuleConfig = {
36
65
  sourceType?: "listingEntities" | "jobListings" | "categoryLists" | string;
37
66
  autoSetupEntries?: boolean;
38
67
  identityMapping?: ModuleIdentityMapping;
68
+ slugPrefixSourcePath?: string;
39
69
  fieldMappings?: ModuleFieldMapping[];
40
70
  sourceFilter?: ModuleSourceFilter;
71
+ grouping?: ModuleGrouping;
72
+ sectionRepeaters?: ModuleSectionRepeater[];
41
73
  webPageTemplate?: WebPageTemplate;
42
74
  };
43
75
  export type ContentModuleSyncPreview = {
@@ -67,8 +67,22 @@ export interface CmsNavigationNode {
67
67
  isExternal?: boolean;
68
68
  isButton?: boolean;
69
69
  showInNav?: boolean;
70
+ autoPopulate?: CmsNavigationAutoPopulate;
70
71
  children?: CmsNavigationNode[];
71
72
  }
73
+ export interface CmsNavigationAutoPopulate {
74
+ enabled?: boolean;
75
+ modelIds?: string[];
76
+ maxItems?: number;
77
+ matchParentSlugPrefix?: boolean;
78
+ childAutoPopulate?: CmsNavigationAutoPopulateRule;
79
+ }
80
+ export interface CmsNavigationAutoPopulateRule {
81
+ enabled?: boolean;
82
+ modelIds?: string[];
83
+ maxItems?: number;
84
+ matchParentSlugPrefix?: boolean;
85
+ }
72
86
  export interface CmsNavigationConfig {
73
87
  version?: number;
74
88
  maxDepth?: number;
@@ -1,3 +1,4 @@
1
+ import ListingEntityMedia from "./listingEntityMedia";
1
2
  export type Listing = {
2
3
  id: number;
3
4
  fields?: ListingFields;
@@ -68,6 +69,8 @@ export type ListingEntity = {
68
69
  travelTime?: string;
69
70
  logoUrl?: string;
70
71
  photoUrl?: string;
72
+ logo?: ListingEntityMedia;
73
+ photo?: ListingEntityMedia;
71
74
  descriptionJson?: string;
72
75
  descriptionHtml?: string;
73
76
  descriptionPlainText?: string;
@@ -1,4 +1,5 @@
1
1
  import { Address } from './company';
2
+ import ListingEntityMedia from './listingEntityMedia';
2
3
  export type ListingEntityDto = {
3
4
  id: number;
4
5
  listingId: number;
@@ -11,6 +12,8 @@ export type ListingEntityDto = {
11
12
  staticMapUrl?: string;
12
13
  logoUrl?: string;
13
14
  photoUrl?: string;
15
+ logo?: ListingEntityMedia;
16
+ photo?: ListingEntityMedia;
14
17
  descriptionJson?: string;
15
18
  descriptionHtml?: string;
16
19
  descriptionPlainText?: string;
@@ -0,0 +1,12 @@
1
+ import FocalPoint from "./focalPoint";
2
+ export type ListingEntityMedia = {
3
+ url?: string;
4
+ alt?: string;
5
+ focalPoint?: FocalPoint;
6
+ aspectRatio?: string;
7
+ width?: number;
8
+ height?: number;
9
+ fileSize?: number;
10
+ variant?: string;
11
+ };
12
+ export default ListingEntityMedia;
@@ -1,4 +1,5 @@
1
1
  import { Address } from "./company";
2
+ import ListingEntityMedia from "./listingEntityMedia";
2
3
  export type mongoListingEntity = {
3
4
  id: string;
4
5
  listingId: number;
@@ -12,6 +13,8 @@ export type mongoListingEntity = {
12
13
  entityKey?: string;
13
14
  logoUrl?: string;
14
15
  photoUrl?: string;
16
+ logo?: ListingEntityMedia;
17
+ photo?: ListingEntityMedia;
15
18
  descriptionJson?: string;
16
19
  descriptionHtml?: string;
17
20
  descriptionPlainText?: string;
@@ -256,10 +256,33 @@ class FetchHandler {
256
256
  if (!response.ok || !response.status.toString().startsWith("2")) {
257
257
  let errorMessage = `Error: ${response.status} ${response.statusText}`;
258
258
  try {
259
- const errorData = await response.json();
260
- console.log(errorData);
261
- if (errorData && errorData.message) {
262
- errorMessage = errorData.message;
259
+ const rawErrorBody = await response.text();
260
+ if (rawErrorBody) {
261
+ try {
262
+ const errorData = JSON.parse(rawErrorBody);
263
+ console.log(errorData);
264
+ if (errorData && typeof errorData.message === "string" && errorData.message.trim()) {
265
+ errorMessage = errorData.message;
266
+ } else if (
267
+ errorData &&
268
+ typeof errorData.error === "string" &&
269
+ errorData.error.trim()
270
+ ) {
271
+ errorMessage = errorData.error;
272
+ } else if (
273
+ errorData &&
274
+ typeof errorData.title === "string" &&
275
+ errorData.title.trim()
276
+ ) {
277
+ errorMessage = errorData.title;
278
+ }
279
+ } catch {
280
+ // Prefer plain text API responses when available (e.g. "Block not found")
281
+ const trimmed = rawErrorBody.trim();
282
+ if (trimmed && !trimmed.startsWith("<")) {
283
+ errorMessage = trimmed;
284
+ }
285
+ }
263
286
  }
264
287
  } catch (error) {
265
288
  console.error("Failed to parse error response:", error);
@@ -0,0 +1,36 @@
1
+ type UnknownRecord = Record<string, unknown>;
2
+
3
+ const isPlainObject = (value: unknown): value is UnknownRecord => {
4
+ if (value === null || typeof value !== "object") return false;
5
+ return Object.getPrototypeOf(value) === Object.prototype;
6
+ };
7
+
8
+ const toCamelCase = (value: string): string => {
9
+ if (!value) return value;
10
+ if (/^[a-z][a-zA-Z0-9]*$/.test(value)) return value;
11
+
12
+ return value
13
+ .replace(/[^a-zA-Z0-9]+/g, " ")
14
+ .trim()
15
+ .toLowerCase()
16
+ .replace(/\s+(.)/g, (_, char: string) => char.toUpperCase())
17
+ .replace(/\s/g, "")
18
+ .replace(/^(.)/, (_, char: string) => char.toLowerCase());
19
+ };
20
+
21
+ export const normalizeToCamelCase = <T>(value: T): T => {
22
+ if (Array.isArray(value)) {
23
+ return value.map(item => normalizeToCamelCase(item)) as T;
24
+ }
25
+
26
+ if (!isPlainObject(value)) {
27
+ return value;
28
+ }
29
+
30
+ const normalized: UnknownRecord = {};
31
+ for (const [key, nestedValue] of Object.entries(value)) {
32
+ normalized[toCamelCase(key)] = normalizeToCamelCase(nestedValue);
33
+ }
34
+
35
+ return normalized as T;
36
+ };