@abcagency/hire-control-sdk 1.0.99 → 1.0.102

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.
package/.gitattributes ADDED
@@ -0,0 +1 @@
1
+ * text=auto eol=lf
@@ -1,6 +1,9 @@
1
1
  import FetchHandler from "../handlers/fetchHandler";
2
2
  import { API_URL } from "../constants/config";
3
- import CategoryListDto, { AddValueRequest } from "../types/categoryList";
3
+ import CategoryListDto, {
4
+ AddValueRequest,
5
+ CategoryListValueDto,
6
+ } from "../types/categoryList";
4
7
 
5
8
  const fetchHandler = new FetchHandler(API_URL);
6
9
 
@@ -181,22 +184,44 @@ class CategoryListsController {
181
184
  /**
182
185
  * Update values in a category list.
183
186
  * @param {string} id - The category list ID.
184
- * @param {Record<string, string>} values - The values to update.
187
+ * @param {Record<string, CategoryListDto["values"][string]>} values - The values to update.
185
188
  * @param {string | null} authToken - Optional auth token.
186
189
  * @returns {Promise<CategoryListDto>} - The updated category list data.
187
190
  */
188
191
  async updateValues(
189
192
  id: string,
190
- values: Record<string, string>,
193
+ values: Record<string, CategoryListDto["values"][string]>,
191
194
  authToken: string | null = null
192
195
  ): Promise<CategoryListDto> {
193
- return fetchHandler.put<Record<string, string>, CategoryListDto>(
196
+ return fetchHandler.put<Record<string, CategoryListDto["values"][string]>, CategoryListDto>(
194
197
  `/categorylist/${id}/values`,
195
198
  values,
196
199
  true,
197
200
  authToken
198
201
  );
199
202
  }
203
+
204
+ /**
205
+ * Update a single value in a category list.
206
+ * @param {string} id - The category list ID.
207
+ * @param {string} key - The value key to update.
208
+ * @param {CategoryListValueDto} value - The value payload.
209
+ * @param {string | null} authToken - Optional auth token.
210
+ * @returns {Promise<CategoryListDto>} - The updated category list data.
211
+ */
212
+ async updateValue(
213
+ id: string,
214
+ key: string,
215
+ value: CategoryListValueDto,
216
+ authToken: string | null = null
217
+ ): Promise<CategoryListDto> {
218
+ return fetchHandler.put<CategoryListValueDto, CategoryListDto>(
219
+ `/categorylist/${id}/values/${encodeURIComponent(key)}`,
220
+ value,
221
+ true,
222
+ authToken
223
+ );
224
+ }
200
225
  }
201
226
 
202
227
  export default new CategoryListsController();
@@ -0,0 +1,31 @@
1
+ import FetchHandler from '../handlers/fetchHandler';
2
+ import SearchReadConfig from '../types/searchReadConfig';
3
+ import { API_URL } from '../constants/config';
4
+
5
+ const fetchHandler = new FetchHandler(API_URL);
6
+
7
+ class IntegrationConfigController {
8
+ /**
9
+ * [GET /integrationconfig/search-read]
10
+ * Get Algolia SearchRead credentials for the authenticated user's company.
11
+ */
12
+ async getSearchReadConfig(
13
+ authToken: string | null = null
14
+ ): Promise<SearchReadConfig | null> {
15
+ try {
16
+ const response = await fetchHandler.get<SearchReadConfig>(
17
+ '/integrationconfig/search-read',
18
+ true,
19
+ authToken
20
+ );
21
+ return response;
22
+ } catch (error: any) {
23
+ if (error?.statusCode === 404 || error?.statusCode === 204) {
24
+ return null;
25
+ }
26
+ throw error;
27
+ }
28
+ }
29
+ }
30
+
31
+ export default new IntegrationConfigController();
@@ -8,6 +8,24 @@ const fetchHandler = new FetchHandler(API_URL);
8
8
  * Controller for handling job listing API requests.
9
9
  */
10
10
  class JobListingsController {
11
+ async updateFieldVersionApproval(
12
+ id: string,
13
+ payload: {
14
+ fieldPath: string;
15
+ timestamp?: string;
16
+ listingVersionNumber?: number;
17
+ needsApproval: boolean;
18
+ },
19
+ authToken: string | null = null
20
+ ): Promise<void> {
21
+ return fetchHandler.patch<typeof payload, void>(
22
+ `/joblistings/${id}/field-version-approval`,
23
+ payload,
24
+ true,
25
+ authToken
26
+ );
27
+ }
28
+
11
29
  /**
12
30
  * [GET /joblistings]
13
31
  * Get all job listings for the authenticated user's company.
@@ -1,4 +1,4 @@
1
- import CategoryListDto, { AddValueRequest } from "../types/categoryList";
1
+ import CategoryListDto, { AddValueRequest, CategoryListValueDto } from "../types/categoryList";
2
2
  declare class CategoryListsController {
3
3
  /**
4
4
  * Get all category lists for the authenticated user's company.
@@ -75,11 +75,20 @@ declare class CategoryListsController {
75
75
  /**
76
76
  * Update values in a category list.
77
77
  * @param {string} id - The category list ID.
78
- * @param {Record<string, string>} values - The values to update.
78
+ * @param {Record<string, CategoryListDto["values"][string]>} values - The values to update.
79
79
  * @param {string | null} authToken - Optional auth token.
80
80
  * @returns {Promise<CategoryListDto>} - The updated category list data.
81
81
  */
82
- updateValues(id: string, values: Record<string, string>, authToken?: string | null): Promise<CategoryListDto>;
82
+ updateValues(id: string, values: Record<string, CategoryListDto["values"][string]>, authToken?: string | null): Promise<CategoryListDto>;
83
+ /**
84
+ * Update a single value in a category list.
85
+ * @param {string} id - The category list ID.
86
+ * @param {string} key - The value key to update.
87
+ * @param {CategoryListValueDto} value - The value payload.
88
+ * @param {string | null} authToken - Optional auth token.
89
+ * @returns {Promise<CategoryListDto>} - The updated category list data.
90
+ */
91
+ updateValue(id: string, key: string, value: CategoryListValueDto, authToken?: string | null): Promise<CategoryListDto>;
83
92
  }
84
93
  declare const _default: CategoryListsController;
85
94
  export default _default;
@@ -0,0 +1,10 @@
1
+ import SearchReadConfig from '../types/searchReadConfig';
2
+ declare class IntegrationConfigController {
3
+ /**
4
+ * [GET /integrationconfig/search-read]
5
+ * Get Algolia SearchRead credentials for the authenticated user's company.
6
+ */
7
+ getSearchReadConfig(authToken?: string | null): Promise<SearchReadConfig | null>;
8
+ }
9
+ declare const _default: IntegrationConfigController;
10
+ export default _default;
@@ -3,6 +3,12 @@ import { type JobListing } from "../types/JobListing";
3
3
  * Controller for handling job listing API requests.
4
4
  */
5
5
  declare class JobListingsController {
6
+ updateFieldVersionApproval(id: string, payload: {
7
+ fieldPath: string;
8
+ timestamp?: string;
9
+ listingVersionNumber?: number;
10
+ needsApproval: boolean;
11
+ }, authToken?: string | null): Promise<void>;
6
12
  /**
7
13
  * [GET /joblistings]
8
14
  * Get all job listings for the authenticated user's company.
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}}return 200===e.status?yield e.json():null}))}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{getListings(){return t.__awaiter(this,arguments,void 0,(function*(t=null,e=null){try{const n=e?`?filterId=${encodeURIComponent(e)}`:"";return yield m.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 m.get(`/listings/${t}`,!0,e)}catch(t){throw t}}))}};const b=new e(n);var A=new class{uploadMedia(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return b.post("/media/upload",t,!0,e,!0)}))}uploadProfileImage(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return b.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 b.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 b.delete(`/media/delete?${n.toString()}`,!0,e)}))}};const $=new e(n);var S=new class{getFilters(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return $.get("/filters",!0,t)}))}getFilter(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return $.get(`/filters/${t}`,!0,e)}))}createFilter(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return $.post("/filters",t,!0,e)}))}updateFilter(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return $.put(`/filters/${t}`,e,!0,n)}))}deleteFilter(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return $.delete(`/filters/${t}`,!0,e)}))}};const L=new e(n);var F=new class{getAppendListings(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return L.get("/appendListings",!0,t)}))}getAppendListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return L.get(`/appendListings/${t}`,!0,e)}))}createAppendListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return L.post("/appendListings",t,!0,e)}))}updateAppendListing(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return L.put(`/appendListings/${t}`,e,!0,n)}))}deleteAppendListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return L.delete(`/appendListings/${t}`,!0,e)}))}};const k=new e(n);var T=new class{getForms(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return k.get("/forms",!0,t)}))}getForm(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return k.get(`/forms/${t}`,!0,e)}))}createForm(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return k.post("/forms",t,!0,e)}))}updateForm(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return k.put(`/forms/${t}`,e,!0,n)}))}updateFormWithFieldRenames(e,n,r){return t.__awaiter(this,arguments,void 0,(function*(t,e,n,r=null){return k.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 k.get(`/forms/${t}/submission-count`,!0,e)}))}getFormSubmissionFieldUsage(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return k.get(`/forms/${t}/submission-fields`,!0,e)}))}migrateSubmissionFields(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return k.post(`/forms/${t}/migrate-submission-fields`,e,!0,n)}))}deleteForm(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return k.delete(`/forms/${t}`,!0,e)}))}processFormRequest(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return k.post("/forms/jsonSchema",t,!0,e)}))}};const B=new e(n);var j=new class{submitContactForm(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return B.post("/contactForm",t,!0,e,!0)}))}submitFormSubmission(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return B.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()),B.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 B.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 B.get("/formsubmission/types",!0,t)}))}};const x=new e(n);var I=new class{getCompanies(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return x.get("/companies",!0,t)}))}getCompany(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return x.get(`/companies/${t}`,!0,e)}))}createCompany(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return x.post("/companies",t,!0,e)}))}updateCompany(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return x.put(`/companies/${t}`,e,!0,n)}))}deleteCompany(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return x.delete(`/companies/${t}`,!0,e)}))}syncAllCompanies(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return x.get("/companies/syncall",!0,t)}))}};const E=new e(n);var R=new class{getJobListingsByCompany(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return E.get("/joblistings",!0,t)}))}getMapJobListingsByCompany(){return t.__awaiter(this,arguments,void 0,(function*(t=null,e=null){return e?E.get(`/joblistings/MapListings?filterId=${e}`,!0,t):E.get("/joblistings/MapListings",!0,t)}))}getJobListingById(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return E.get(`/joblistings/${t}`,!0,e)}))}getMapListingById(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return E.get(`/joblistings/MapListings/${t}`,!0,e)}))}createJobListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return E.post("/joblistings",t,!0,e)}))}updateJobListing(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return E.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 E.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 E.delete(`/joblistings/${t}`,!0,e)}))}};const M=new e(n);var P=new class{getBlogs(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return M.get("/blog",!0,t)}))}getBlog(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return M.get(`/blog/${t}`,!0,e)}))}createBlog(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return M.post("/blog",t,!0,e)}))}updateBlog(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return M.put(`/blog/${t}`,e,!0,n)}))}deleteBlog(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return M.delete(`/blog/${t}`,!0,e)}))}};const U=new e(n);var O=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 U.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 U.get(`/categories/${t}${i}`,!0,n)}))}};const W=new e(n);var J=new class{getAllCategoryLists(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return W.get("/categorylist",!0,t)}))}getCategoryListById(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return W.get(`/categorylist/${t}`,!0,e)}))}getCategoryListsByType(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return W.get(`/categorylist/type/${t}`,!0,e)}))}getActiveCategoryLists(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return W.get("/categorylist/active",!0,t)}))}getCategoryListByTypeAndName(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return W.get(`/categorylist/type/${t}/name/${e}`,!0,n)}))}createCategoryList(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return W.post("/categorylist",t,!0,e)}))}updateCategoryList(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return W.put(`/categorylist/${t}`,e,!0,n)}))}deleteCategoryList(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return W.delete(`/categorylist/${t}`,!0,e)}))}addValue(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return W.post(`/categorylist/${t}/values`,e,!0,n)}))}removeValue(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return W.delete(`/categorylist/${t}/values/${e}`,!0,n)}))}updateValues(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return W.put(`/categorylist/${t}/values`,e,!0,n)}))}};const V=new e(n);var D=new class{getByFeed(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return V.get(`/jobFeedFieldMappings/feed/${t}`,!0,e)}))}get(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return V.get(`/jobFeedFieldMappings/${t}`,!0,e)}))}create(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return V.post("/jobFeedFieldMappings",t,!0,e)}))}update(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return V.put(`/jobFeedFieldMappings/${t}`,e,!0,n)}))}delete(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return V.delete(`/jobFeedFieldMappings/${t}`,!0,e)}))}toggleActive(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return V.post("/jobFeedFieldMappings/toggle-active",t,!0,e)}))}discoverFields(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return V.get(`/jobFeedFieldMappings/discover-fields/${t}`,!0,e)}))}validate(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return V.get(`/jobFeedFieldMappings/validate/${t}`,!0,e)}))}};const H=new e(n);var N=new class{getAll(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return H.get("/jobfeeds",!0,t)}))}get(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return H.get(`/jobfeeds/${t}`,!0,e)}))}create(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return H.post("/jobfeeds",t,!0,e)}))}update(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return H.put(`/jobfeeds/${t}`,e,!0,n)}))}delete(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return H.delete(`/jobfeeds/${t}`,!0,e)}))}sync(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return H.post(`/jobfeeds/${t}/sync`,{},!0,e)}))}toggleActive(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return H.patch(`/jobfeeds/${t}/toggle-active`,e,!0,n)}))}};const z=new e(n);var q=new class{get(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return z.get("/jobListingSettings",!0,t)}))}create(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return z.post("/jobListingSettings",t,!0,e)}))}delete(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return z.delete("/jobListingSettings",!0,t)}))}};const G=new e(n);var K=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),G.post("/listingEntities"+(r.toString()?"?"+r.toString():""),t,!0,n)}))}getAll(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return G.get("/listingEntities",!0,t)}))}create(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return G.post("/listingEntities/create",t,!0,e)}))}update(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){yield G.put(`/listingEntities/update/${t}`,e,!0,n)}))}delete(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){yield G.delete(`/listingEntities/delete/${t}`,!0,e)}))}};const X=new e(n);var Q=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 X.get(`/recruiters${r}`,!0,e)}))}getAll(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return X.get("/recruiters/all",!0,t)}))}sync(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return X.post("/recruiters/sync",{},!0,t)}))}};const Y=new e(n);var Z=new class{getFieldTypes(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return Y.get("/field/types",!0,t)}))}};const tt=new e(n);var et=new class{getValidatorTypes(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return tt.get("/validator/types",!0,t)}))}};const nt=new e(n);var rt=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}`),nt.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}`),nt.get(r,!0,n)}))}createContentEntry(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return nt.post("/contententry",t,!0,e)}))}updateContentEntry(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return nt.put(`/contententry/${t}`,e,!0,n)}))}deleteContentEntry(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return nt.delete(`/contententry/${t}`,!0,e)}))}getVersions(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return nt.get(`/contententry/${t}/versions`,!0,e)}))}unpublishAll(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return nt.post(`/contententry/${t}/unpublish`,void 0,!0,e)}))}};const it=new e(n);var ot=new class{getBlocks(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return it.get("/block",!0,t)}))}getBlock(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return it.get(`/block/${t}`,!0,e)}))}createBlock(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return it.post("/block",t,!0,e)}))}updateBlock(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return it.put(`/block/${t}`,e,!0,n)}))}deleteBlock(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return it.delete(`/block/${t}`,!0,e)}))}getTemplateBlocks(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return it.get("/block/template-blocks",!0,t)}))}};const st=new e(n);var at=new class{getModels(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return st.get("/model",!0,t)}))}getModel(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return st.get(`/model/${t}`,!0,e)}))}createModel(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return st.post("/model",t,!0,e)}))}updateModel(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return st.put(`/model/${t}`,e,!0,n)}))}deleteModel(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return st.delete(`/model/${t}`,!0,e)}))}previewSync(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return st.get(`/model/${t}/sync/preview`,!0,e)}))}executeSync(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return st.post(`/model/${t}/sync`,e,!0,n)}))}};const ut=new e(n);var lt,dt,ct,gt,ht=new class{getCompletion(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return ut.post("/openai/completion",t,!0,e)}))}};exports.EventType=void 0,(lt=exports.EventType||(exports.EventType={}))[lt.Virtual=0]="Virtual",lt[lt.InPerson=1]="InPerson",lt[lt.Hybrid=2]="Hybrid",exports.CallToActionType=void 0,(dt=exports.CallToActionType||(exports.CallToActionType={}))[dt.Button=0]="Button",dt[dt.Link=1]="Link",dt[dt.Download=2]="Download",dt[dt.HireControlRegistration=3]="HireControlRegistration",exports.FormSubmissionStatus=void 0,(ct=exports.FormSubmissionStatus||(exports.FormSubmissionStatus={}))[ct.Submitted=1]="Submitted",ct[ct.Hold=2]="Hold",ct[ct.Rejected=3]="Rejected",ct[ct.Sent=4]="Sent",exports.FeedHandlingOption=void 0,(gt=exports.FeedHandlingOption||(exports.FeedHandlingOption={}))[gt.Replace=0]="Replace",gt[gt.Append=1]="Append",gt[gt.Custom=2]="Custom";const pt={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},_t={getAll:a.getEvents,get:a.getEvent,getBySlug:a.getEventBySlug,create:a.createEvent,update:a.updateEvent,delete:a.deleteEvent},ft={get:l.getAllRolesWithClaims,create:l.addRole,update:l.updateRole,delete:l.deleteRole},vt=c,wt=C,yt={resetPassword:h.resetPassword,resetPasswordWithToken:h.resetPasswordWithToken,forgotPassword:h.forgotPassword},mt={get:_.getMapConfig,update:_.updateMapConfig,create:_.createMapConfig},Ct={get:y.getClientAuthConfigById,getAll:y.getAllClientAuthConfigs,update:y.updateClientAuthConfig,create:y.createClientAuthConfig,delete:y.deleteClientAuthConfig},bt={upload:A.uploadMedia,uploadProfileImage:A.uploadProfileImage,get:A.listMedia,delete:A.deleteMedia},At={getList:S.getFilters,get:S.getFilter,update:S.updateFilter,create:S.createFilter,delete:S.deleteFilter},$t={get:F.getAppendListings,getAppendListing:F.getAppendListing,create:F.createAppendListing,update:F.updateAppendListing,delete:F.deleteAppendListing},St={getAll:P.getBlogs,getById:P.getBlog,create:P.createBlog,update:P.updateBlog,delete:P.deleteBlog},Lt={get:O.getCategories,getByCompany:O.getCategoriesByCompany},Ft={getAll:J.getAllCategoryLists,getById:J.getCategoryListById,getByType:J.getCategoryListsByType,getActive:J.getActiveCategoryLists,getByTypeAndName:J.getCategoryListByTypeAndName,create:J.createCategoryList,update:J.updateCategoryList,delete:J.deleteCategoryList,addValue:J.addValue,removeValue:J.removeValue,updateValues:J.updateValues},kt={getByFeed:D.getByFeed,get:D.get,create:D.create,update:D.update,delete:D.delete,toggleActive:D.toggleActive,discoverFields:D.discoverFields,validate:D.validate},Tt={getAll:N.getAll,getById:N.get,create:N.create,update:N.update,delete:N.delete,sync:N.sync,toggleActive:N.toggleActive},Bt={get:q.get,create:q.create,delete:q.delete},jt={create:K.create,get:K.getAll,update:K.update,delete:K.delete,getAllSql:K.getAllSql},xt={get:Q.get,getAll:Q.getAll,sync:Q.sync},It={get:v.getAllPermissions},Et={getAll:I.getCompanies,getById:I.getCompany,create:I.createCompany,update:I.updateCompany,delete:I.deleteCompany,sync:I.syncAllCompanies},Rt={getAll:R.getJobListingsByCompany,getMapListings:R.getMapJobListingsByCompany,getMapListing:R.getMapListingById,getById:R.getJobListingById,create:R.createJobListing,update:R.updateJobListing,delete:R.deleteJobListing},Mt={getTypes:Z.getFieldTypes},Pt={getTypes:et.getValidatorTypes},Ut={getAll:rt.getContentEntries,getById:rt.getContentEntry,create:rt.createContentEntry,update:rt.updateContentEntry,delete:rt.deleteContentEntry,unpublish:rt.unpublishAll},Ot={getAll:ot.getBlocks,getById:ot.getBlock,create:ot.createBlock,update:ot.updateBlock,delete:ot.deleteBlock,getTemplateBlocks:ot.getTemplateBlocks},Wt={getAll:at.getModels,getById:at.getModel,create:at.createModel,update:at.updateModel,delete:at.deleteModel,previewSync:at.previewSync,executeSync:at.executeSync},Jt={getCompletion:ht.getCompletion},Vt=T,Dt=j,Ht={auth:pt,events:_t,roles:ft,users:vt,account:yt,mapConfig:mt,permissions:It,clientAuthConfig:Ct,filters:At,listings:wt,media:bt,appendListings:$t,blogs:St,categories:Lt,categoryLists:Ft,jobFeedFieldMappings:kt,jobFeeds:Tt,jobListingSettings:Bt,listingEntities:jt,recruiters:xt,forms:Vt,formSubmissions:Dt,openAI:Jt,companies:Et,jobListings:Rt};exports.account=yt,exports.appendListings=$t,exports.auth=pt,exports.blogs=St,exports.categories=Lt,exports.categoryLists=Ft,exports.clientAuthConfig=Ct,exports.companies=Et,exports.contentBlocks=Ot,exports.contentEntries=Ut,exports.contentField=Mt,exports.contentValidator=Pt,exports.default=Ht,exports.events=_t,exports.filters=At,exports.formSubmissions=Dt,exports.forms=Vt,exports.jobFeedFieldMappings=kt,exports.jobFeeds=Tt,exports.jobListingSettings=Bt,exports.jobListings=Rt,exports.listingEntities=jt,exports.listings=wt,exports.mapConfig=mt,exports.media=bt,exports.model=Wt,exports.openAI=Jt,exports.permissions=It,exports.recruiters=xt,exports.roles=ft,exports.users=vt;
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.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(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 d=new e(n);var c=new class{getAllUsers(){return t(this,arguments,void 0,function*(t=null){try{return yield d.get("/users",!0,t)}catch(t){throw t}})}getUser(e){return t(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(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(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(this,arguments,void 0,function*(t,e=null){try{yield d.put("/users",t,!0,e)}catch(t){throw t}})}deleteUser(e){return t(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 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 w=new e(n);var b=new class{getSearchReadConfig(){return t(this,arguments,void 0,function*(t=null){try{return yield w.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 A=new e(n);var S=new class{getListings(){return t(this,arguments,void 0,function*(t=null,e=null){try{const n=e?`?filterId=${encodeURIComponent(e)}`:"";return yield A.get(`/listings${n}`,!0,t)}catch(t){throw t}})}getListingDetails(e){return t(this,arguments,void 0,function*(t,e=null){try{return yield A.get(`/listings/${t}`,!0,e)}catch(t){throw t}})}};const $=new e(n);var L=new class{uploadMedia(e){return t(this,arguments,void 0,function*(t,e=null){return $.post("/media/upload",t,!0,e,!0)})}uploadProfileImage(e){return t(this,arguments,void 0,function*(t,e=null){return $.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 $.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 $.delete(`/media/delete?${n.toString()}`,!0,e)})}};const F=new e(n);var k=new class{getFilters(){return t(this,arguments,void 0,function*(t=null){return F.get("/filters",!0,t)})}getFilter(e){return t(this,arguments,void 0,function*(t,e=null){return F.get(`/filters/${t}`,!0,e)})}createFilter(e){return t(this,arguments,void 0,function*(t,e=null){return F.post("/filters",t,!0,e)})}updateFilter(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return F.put(`/filters/${t}`,e,!0,n)})}deleteFilter(e){return t(this,arguments,void 0,function*(t,e=null){return F.delete(`/filters/${t}`,!0,e)})}};const T=new e(n);var x=new class{getAppendListings(){return t(this,arguments,void 0,function*(t=null){return T.get("/appendListings",!0,t)})}getAppendListing(e){return t(this,arguments,void 0,function*(t,e=null){return T.get(`/appendListings/${t}`,!0,e)})}createAppendListing(e){return t(this,arguments,void 0,function*(t,e=null){return T.post("/appendListings",t,!0,e)})}updateAppendListing(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return T.put(`/appendListings/${t}`,e,!0,n)})}deleteAppendListing(e){return t(this,arguments,void 0,function*(t,e=null){return T.delete(`/appendListings/${t}`,!0,e)})}};const B=new e(n);var j=new class{getForms(){return t(this,arguments,void 0,function*(t=null){return B.get("/forms",!0,t)})}getForm(e){return t(this,arguments,void 0,function*(t,e=null){return B.get(`/forms/${t}`,!0,e)})}createForm(e){return t(this,arguments,void 0,function*(t,e=null){return B.post("/forms",t,!0,e)})}updateForm(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return B.put(`/forms/${t}`,e,!0,n)})}updateFormWithFieldRenames(e,n,r){return t(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(this,arguments,void 0,function*(t,e=null){return B.get(`/forms/${t}/submission-count`,!0,e)})}getFormSubmissionFieldUsage(e){return t(this,arguments,void 0,function*(t,e=null){return B.get(`/forms/${t}/submission-fields`,!0,e)})}migrateSubmissionFields(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return B.post(`/forms/${t}/migrate-submission-fields`,e,!0,n)})}deleteForm(e){return t(this,arguments,void 0,function*(t,e=null){return B.delete(`/forms/${t}`,!0,e)})}processFormRequest(e){return t(this,arguments,void 0,function*(t,e=null){return B.post("/forms/jsonSchema",t,!0,e)})}};const I=new e(n);var E=new class{submitContactForm(e){return t(this,arguments,void 0,function*(t,e=null){return I.post("/contactForm",t,!0,e,!0)})}submitFormSubmission(e){return t(this,arguments,void 0,function*(t,e=null){return I.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()),I.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 I.getFile(`/formsubmission/export-csv?${l.toString()}`,!0,u),d=window.URL.createObjectURL(a),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(this,arguments,void 0,function*(t=null){return I.get("/formsubmission/types",!0,t)})}};const R=new e(n);var P=new class{getCompanies(){return t(this,arguments,void 0,function*(t=null){return R.get("/companies",!0,t)})}getCompany(e){return t(this,arguments,void 0,function*(t,e=null){return R.get(`/companies/${t}`,!0,e)})}createCompany(e){return t(this,arguments,void 0,function*(t,e=null){return R.post("/companies",t,!0,e)})}updateCompany(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return R.put(`/companies/${t}`,e,!0,n)})}deleteCompany(e){return t(this,arguments,void 0,function*(t,e=null){return R.delete(`/companies/${t}`,!0,e)})}syncAllCompanies(){return t(this,arguments,void 0,function*(t=null){return R.get("/companies/syncall",!0,t)})}};const M=new e(n);var U=new class{updateFieldVersionApproval(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return M.patch(`/joblistings/${t}/field-version-approval`,e,!0,n)})}getJobListingsByCompany(){return t(this,arguments,void 0,function*(t=null){return M.get("/joblistings",!0,t)})}getMapJobListingsByCompany(){return t(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(this,arguments,void 0,function*(t,e=null){return M.get(`/joblistings/${t}`,!0,e)})}getMapListingById(e){return t(this,arguments,void 0,function*(t,e=null){return M.get(`/joblistings/MapListings/${t}`,!0,e)})}createJobListing(e){return t(this,arguments,void 0,function*(t,e=null){return M.post("/joblistings",t,!0,e)})}updateJobListing(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return M.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 M.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 M.delete(`/joblistings/${t}`,!0,e)})}};const O=new e(n);var V=new class{getBlogs(){return t(this,arguments,void 0,function*(t=null){return O.get("/blog",!0,t)})}getBlog(e){return t(this,arguments,void 0,function*(t,e=null){return O.get(`/blog/${t}`,!0,e)})}createBlog(e){return t(this,arguments,void 0,function*(t,e=null){return O.post("/blog",t,!0,e)})}updateBlog(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return O.put(`/blog/${t}`,e,!0,n)})}deleteBlog(e){return t(this,arguments,void 0,function*(t,e=null){return O.delete(`/blog/${t}`,!0,e)})}};const W=new e(n);var J=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 W.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 W.get(`/categories/${t}${i}`,!0,n)})}};const _=new e(n);var N=new class{getAllCategoryLists(){return t(this,arguments,void 0,function*(t=null){return _.get("/categorylist",!0,t)})}getCategoryListById(e){return t(this,arguments,void 0,function*(t,e=null){return _.get(`/categorylist/${t}`,!0,e)})}getCategoryListsByType(e){return t(this,arguments,void 0,function*(t,e=null){return _.get(`/categorylist/type/${t}`,!0,e)})}getActiveCategoryLists(){return t(this,arguments,void 0,function*(t=null){return _.get("/categorylist/active",!0,t)})}getCategoryListByTypeAndName(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return _.get(`/categorylist/type/${t}/name/${e}`,!0,n)})}createCategoryList(e){return t(this,arguments,void 0,function*(t,e=null){return _.post("/categorylist",t,!0,e)})}updateCategoryList(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return _.put(`/categorylist/${t}`,e,!0,n)})}deleteCategoryList(e){return t(this,arguments,void 0,function*(t,e=null){return _.delete(`/categorylist/${t}`,!0,e)})}addValue(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return _.post(`/categorylist/${t}/values`,e,!0,n)})}removeValue(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return _.delete(`/categorylist/${t}/values/${e}`,!0,n)})}updateValues(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return _.put(`/categorylist/${t}/values`,e,!0,n)})}updateValue(e,n,r){return t(this,arguments,void 0,function*(t,e,n,r=null){return _.put(`/categorylist/${t}/values/${encodeURIComponent(e)}`,n,!0,r)})}};const D=new e(n);var H=new class{getByFeed(e){return t(this,arguments,void 0,function*(t,e=null){return D.get(`/jobFeedFieldMappings/feed/${t}`,!0,e)})}get(e){return t(this,arguments,void 0,function*(t,e=null){return D.get(`/jobFeedFieldMappings/${t}`,!0,e)})}create(e){return t(this,arguments,void 0,function*(t,e=null){return D.post("/jobFeedFieldMappings",t,!0,e)})}update(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return D.put(`/jobFeedFieldMappings/${t}`,e,!0,n)})}delete(e){return t(this,arguments,void 0,function*(t,e=null){return D.delete(`/jobFeedFieldMappings/${t}`,!0,e)})}toggleActive(e){return t(this,arguments,void 0,function*(t,e=null){return D.post("/jobFeedFieldMappings/toggle-active",t,!0,e)})}discoverFields(e){return t(this,arguments,void 0,function*(t,e=null){return D.get(`/jobFeedFieldMappings/discover-fields/${t}`,!0,e)})}validate(e){return t(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(this,arguments,void 0,function*(t=null){return z.get("/jobfeeds",!0,t)})}get(e){return t(this,arguments,void 0,function*(t,e=null){return z.get(`/jobfeeds/${t}`,!0,e)})}create(e){return t(this,arguments,void 0,function*(t,e=null){return z.post("/jobfeeds",t,!0,e)})}update(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return z.put(`/jobfeeds/${t}`,e,!0,n)})}delete(e){return t(this,arguments,void 0,function*(t,e=null){return z.delete(`/jobfeeds/${t}`,!0,e)})}sync(e){return t(this,arguments,void 0,function*(t,e=null){return z.post(`/jobfeeds/${t}/sync`,{},!0,e)})}toggleActive(e,n){return t(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(this,arguments,void 0,function*(t=null){return G.get("/jobListingSettings",!0,t)})}create(e){return t(this,arguments,void 0,function*(t,e=null){return G.post("/jobListingSettings",t,!0,e)})}delete(){return t(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(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(this,arguments,void 0,function*(t=null){return X.get("/listingEntities",!0,t)})}create(e){return t(this,arguments,void 0,function*(t,e=null){return X.post("/listingEntities/create",t,!0,e)})}update(e,n){return t(this,arguments,void 0,function*(t,e,n=null){yield X.put(`/listingEntities/update/${t}`,e,!0,n)})}delete(e){return t(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(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(this,arguments,void 0,function*(t=null){return Y.get("/recruiters/all",!0,t)})}sync(){return t(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(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=new e(n);var ot=new class{getContentEntries(e){return t(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(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(this,arguments,void 0,function*(t,e=null){return it.post("/contententry",t,!0,e)})}updateContentEntry(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return it.put(`/contententry/${t}`,e,!0,n)})}deleteContentEntry(e){return t(this,arguments,void 0,function*(t,e=null){return it.delete(`/contententry/${t}`,!0,e)})}getVersions(e){return t(this,arguments,void 0,function*(t,e=null){return it.get(`/contententry/${t}/versions`,!0,e)})}unpublishAll(e){return t(this,arguments,void 0,function*(t,e=null){return it.post(`/contententry/${t}/unpublish`,void 0,!0,e)})}};const st=new e(n);var ut=new class{getBlocks(){return t(this,arguments,void 0,function*(t=null){return st.get("/block",!0,t)})}getBlock(e){return t(this,arguments,void 0,function*(t,e=null){return st.get(`/block/${t}`,!0,e)})}createBlock(e){return t(this,arguments,void 0,function*(t,e=null){return st.post("/block",t,!0,e)})}updateBlock(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return st.put(`/block/${t}`,e,!0,n)})}deleteBlock(e){return t(this,arguments,void 0,function*(t,e=null){return st.delete(`/block/${t}`,!0,e)})}getTemplateBlocks(){return t(this,arguments,void 0,function*(t=null){return st.get("/block/template-blocks",!0,t)})}};const lt=new e(n);var at=new class{getModels(){return t(this,arguments,void 0,function*(t=null){return lt.get("/model",!0,t)})}getModel(e){return t(this,arguments,void 0,function*(t,e=null){return lt.get(`/model/${t}`,!0,e)})}createModel(e){return t(this,arguments,void 0,function*(t,e=null){return lt.post("/model",t,!0,e)})}updateModel(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return lt.put(`/model/${t}`,e,!0,n)})}deleteModel(e){return t(this,arguments,void 0,function*(t,e=null){return lt.delete(`/model/${t}`,!0,e)})}previewSync(e){return t(this,arguments,void 0,function*(t,e=null){return lt.get(`/model/${t}/sync/preview`,!0,e)})}executeSync(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return lt.post(`/model/${t}/sync`,e,!0,n)})}};const dt=new e(n);var ct,gt,pt,ht,ft=new class{getCompletion(e){return t(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,(pt=exports.FormSubmissionStatus||(exports.FormSubmissionStatus={}))[pt.Submitted=1]="Submitted",pt[pt.Hold=2]="Hold",pt[pt.Rejected=3]="Rejected",pt[pt.Sent=4]="Sent",exports.FeedHandlingOption=void 0,(ht=exports.FeedHandlingOption||(exports.FeedHandlingOption={}))[ht.Replace=0]="Replace",ht[ht.Append=1]="Append",ht[ht.Custom=2]="Custom";const vt={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},yt={getAll:u.getEvents,get:u.getEvent,getBySlug:u.getEventBySlug,create:u.createEvent,update:u.updateEvent,delete:u.deleteEvent},mt={get:a.getAllRolesWithClaims,create:a.addRole,update:a.updateRole,delete:a.deleteRole},Ct=c,wt=S,bt={resetPassword:p.resetPassword,resetPasswordWithToken:p.resetPasswordWithToken,forgotPassword:p.forgotPassword},At={get:f.getMapConfig,update:f.updateMapConfig,create:f.createMapConfig},St={get:C.getClientAuthConfigById,getAll:C.getAllClientAuthConfigs,update:C.updateClientAuthConfig,create:C.createClientAuthConfig,delete:C.deleteClientAuthConfig},$t={getSearchRead:b.getSearchReadConfig},Lt={upload:L.uploadMedia,uploadProfileImage:L.uploadProfileImage,get:L.listMedia,delete:L.deleteMedia},Ft={getList:k.getFilters,get:k.getFilter,update:k.updateFilter,create:k.createFilter,delete:k.deleteFilter},kt={get:x.getAppendListings,getAppendListing:x.getAppendListing,create:x.createAppendListing,update:x.updateAppendListing,delete:x.deleteAppendListing},Tt={getAll:V.getBlogs,getById:V.getBlog,create:V.createBlog,update:V.updateBlog,delete:V.deleteBlog},xt={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,updateValue:N.updateValue,updateValues:N.updateValues},jt={getByFeed:H.getByFeed,get:H.get,create:H.create,update:H.update,delete:H.delete,toggleActive:H.toggleActive,discoverFields:H.discoverFields,validate:H.validate},It={getAll:q.getAll,getById:q.get,create:q.create,update:q.update,delete:q.delete,sync:q.sync,toggleActive:q.toggleActive},Et={get:K.get,create:K.create,delete:K.delete},Rt={create:Q.create,get:Q.getAll,update:Q.update,delete:Q.delete,getAllSql:Q.getAllSql},Pt={get:Z.get,getAll:Z.getAll,sync:Z.sync},Mt={get:y.getAllPermissions},Ut={getAll:P.getCompanies,getById:P.getCompany,create:P.createCompany,update:P.updateCompany,delete:P.deleteCompany,sync:P.syncAllCompanies},Ot={getAll:U.getJobListingsByCompany,getMapListings:U.getMapJobListingsByCompany,getMapListing:U.getMapListingById,getById:U.getJobListingById,updateFieldVersionApproval:U.updateFieldVersionApproval,create:U.createJobListing,update:U.updateJobListing,delete:U.deleteJobListing},Vt={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},_t={getAll:ut.getBlocks,getById:ut.getBlock,create:ut.createBlock,update:ut.updateBlock,delete:ut.deleteBlock,getTemplateBlocks:ut.getTemplateBlocks},Nt={getAll:at.getModels,getById:at.getModel,create:at.createModel,update:at.updateModel,delete:at.deleteModel,previewSync:at.previewSync,executeSync:at.executeSync},Dt={getCompletion:ft.getCompletion},Ht=j,zt=E,qt={auth:vt,events:yt,roles:mt,users:Ct,account:bt,mapConfig:At,permissions:Mt,clientAuthConfig:St,integrationConfig:$t,filters:Ft,listings:wt,media:Lt,appendListings:kt,blogs:Tt,categories:xt,categoryLists:Bt,jobFeedFieldMappings:jt,jobFeeds:It,jobListingSettings:Et,listingEntities:Rt,recruiters:Pt,forms:Ht,formSubmissions:zt,openAI:Dt,companies:Ut,jobListings:Ot};exports.account=bt,exports.appendListings=kt,exports.auth=vt,exports.blogs=Tt,exports.categories=xt,exports.categoryLists=Bt,exports.clientAuthConfig=St,exports.companies=Ut,exports.contentBlocks=_t,exports.contentEntries=Jt,exports.contentField=Vt,exports.contentValidator=Wt,exports.default=qt,exports.events=yt,exports.filters=Ft,exports.formSubmissions=zt,exports.forms=Ht,exports.integrationConfig=$t,exports.jobFeedFieldMappings=jt,exports.jobFeeds=It,exports.jobListingSettings=Et,exports.jobListings=Ot,exports.listingEntities=Rt,exports.listings=wt,exports.mapConfig=At,exports.media=Lt,exports.model=Nt,exports.openAI=Dt,exports.permissions=Mt,exports.recruiters=Pt,exports.roles=mt,exports.users=Ct;
2
2
  //# sourceMappingURL=index.cjs.js.map
package/dist/index.d.ts CHANGED
@@ -21,7 +21,7 @@ import ContentModel, { ModuleConfig, ModuleFieldMapping, ModuleIdentityMapping,
21
21
  import ContentBlock from "./types/content/block";
22
22
  import ContentEntry from "./types/content/contentEntry";
23
23
  import Blog from "./types/blog";
24
- import CategoryListDto, { AddValueRequest } from "./types/categoryList";
24
+ import CategoryListDto, { AddValueRequest, CategoryListValueDto } from "./types/categoryList";
25
25
  import JobFeed from "./types/jobFeed";
26
26
  import JobFeedFieldMapping, { MultipleFieldConfig, ConditionalConfig, ConditionalRule } from "./types/jobFeedFieldMapping";
27
27
  import JobListingSettings, { FeedHandlingOption } from "./types/jobListingSettings";
@@ -29,6 +29,7 @@ import ListingEntityDto from "./types/listingEntity";
29
29
  import RecruiterDto from "./types/recruiter";
30
30
  import FocalPoint from "./types/focalPoint";
31
31
  import CompletionRequest, { CompletionResponse } from "./types/completionRequest";
32
+ import SearchReadConfig from "./types/searchReadConfig";
32
33
  export declare const auth: {
33
34
  login: (clientLogInRequest: import("./types/clientLoginRequest").default) => Promise<any>;
34
35
  nextLogin: (credentials: import("./types/credentials").default) => Promise<any>;
@@ -76,6 +77,9 @@ export declare const clientAuthConfig: {
76
77
  create: (clientAuthConfig: ClientAuthConfig, authToken?: string | null) => Promise<void>;
77
78
  delete: (id: string, authToken?: string | null) => Promise<void>;
78
79
  };
80
+ export declare const integrationConfig: {
81
+ getSearchRead: (authToken?: string | null) => Promise<SearchReadConfig | null>;
82
+ };
79
83
  export declare const media: {
80
84
  upload: (media: MediaType, authToken?: string | null) => Promise<{
81
85
  Url: string;
@@ -122,7 +126,8 @@ export declare const categoryLists: {
122
126
  delete: (id: string, authToken?: string | null) => Promise<void>;
123
127
  addValue: (id: string, request: AddValueRequest, authToken?: string | null) => Promise<CategoryListDto>;
124
128
  removeValue: (id: string, key: string, authToken?: string | null) => Promise<CategoryListDto>;
125
- updateValues: (id: string, values: Record<string, string>, authToken?: string | null) => Promise<CategoryListDto>;
129
+ updateValue: (id: string, key: string, value: CategoryListValueDto, authToken?: string | null) => Promise<CategoryListDto>;
130
+ updateValues: (id: string, values: Record<string, CategoryListDto["values"][string]>, authToken?: string | null) => Promise<CategoryListDto>;
126
131
  };
127
132
  export declare const jobFeedFieldMappings: {
128
133
  getByFeed: (feedId: string, authToken?: string | null) => Promise<JobFeedFieldMapping[]>;
@@ -176,6 +181,12 @@ export declare const jobListings: {
176
181
  getMapListings: (authToken?: string | null, filterId?: string | null) => Promise<any[]>;
177
182
  getMapListing: (id: string, authToken?: string | null) => Promise<any>;
178
183
  getById: (id: string, authToken?: string | null) => Promise<JobListing>;
184
+ updateFieldVersionApproval: (id: string, payload: {
185
+ fieldPath: string;
186
+ timestamp?: string;
187
+ listingVersionNumber?: number;
188
+ needsApproval: boolean;
189
+ }, authToken?: string | null) => Promise<void>;
179
190
  create: (jobListing: JobListing, authToken?: string | null) => Promise<JobListing>;
180
191
  update: (id: string, jobListing: JobListing, authToken?: string | null) => Promise<void>;
181
192
  delete: (id: string, authToken?: string | null) => Promise<void>;
@@ -233,7 +244,7 @@ export declare const formSubmissions: {
233
244
  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>;
234
245
  getFormSubmissionTypes(authToken?: string | null): Promise<string[]>;
235
246
  };
236
- 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, };
247
+ 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, CategoryListValueDto, JobFeed, JobFeedFieldMapping, MultipleFieldConfig, ConditionalConfig, ConditionalRule, JobListingSettings, ListingEntityDto, RecruiterDto, FocalPoint, CompletionRequest, CompletionResponse, SearchReadConfig, };
237
248
  export { EventType, CallToActionType, FormSubmissionStatus, FeedHandlingOption, };
238
249
  declare const hcApi: {
239
250
  auth: {
@@ -285,6 +296,9 @@ declare const hcApi: {
285
296
  create: (clientAuthConfig: ClientAuthConfig, authToken?: string | null) => Promise<void>;
286
297
  delete: (id: string, authToken?: string | null) => Promise<void>;
287
298
  };
299
+ integrationConfig: {
300
+ getSearchRead: (authToken?: string | null) => Promise<SearchReadConfig | null>;
301
+ };
288
302
  filters: {
289
303
  getList: (authToken?: string | null) => Promise<Filters[]>;
290
304
  get: (id: string, authToken?: string | null) => Promise<Filters>;
@@ -332,7 +346,8 @@ declare const hcApi: {
332
346
  delete: (id: string, authToken?: string | null) => Promise<void>;
333
347
  addValue: (id: string, request: AddValueRequest, authToken?: string | null) => Promise<CategoryListDto>;
334
348
  removeValue: (id: string, key: string, authToken?: string | null) => Promise<CategoryListDto>;
335
- updateValues: (id: string, values: Record<string, string>, authToken?: string | null) => Promise<CategoryListDto>;
349
+ updateValue: (id: string, key: string, value: CategoryListValueDto, authToken?: string | null) => Promise<CategoryListDto>;
350
+ updateValues: (id: string, values: Record<string, CategoryListDto["values"][string]>, authToken?: string | null) => Promise<CategoryListDto>;
336
351
  };
337
352
  jobFeedFieldMappings: {
338
353
  getByFeed: (feedId: string, authToken?: string | null) => Promise<JobFeedFieldMapping[]>;
@@ -405,6 +420,12 @@ declare const hcApi: {
405
420
  getMapListings: (authToken?: string | null, filterId?: string | null) => Promise<any[]>;
406
421
  getMapListing: (id: string, authToken?: string | null) => Promise<any>;
407
422
  getById: (id: string, authToken?: string | null) => Promise<JobListing>;
423
+ updateFieldVersionApproval: (id: string, payload: {
424
+ fieldPath: string;
425
+ timestamp?: string;
426
+ listingVersionNumber?: number;
427
+ needsApproval: boolean;
428
+ }, authToken?: string | null) => Promise<void>;
408
429
  create: (jobListing: JobListing, authToken?: string | null) => Promise<JobListing>;
409
430
  update: (id: string, jobListing: JobListing, authToken?: string | null) => Promise<void>;
410
431
  delete: (id: string, authToken?: string | null) => Promise<void>;
@@ -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;
@@ -51,10 +51,28 @@ export interface HireControlConfig {
51
51
  additionalUserFields?: InputField[];
52
52
  siteBuildHook?: string;
53
53
  analyticsEmbedUrl?: string;
54
+ cmsNavigation?: CmsNavigationConfig;
54
55
  }
55
56
  export interface InputField {
56
57
  name?: string;
57
58
  type?: string;
58
59
  icon?: string;
59
60
  }
61
+ export interface CmsNavigationNode {
62
+ id?: string;
63
+ entryId?: string;
64
+ modelId?: string;
65
+ navLabel?: string;
66
+ linkUrl?: string;
67
+ isExternal?: boolean;
68
+ isButton?: boolean;
69
+ showInNav?: boolean;
70
+ children?: CmsNavigationNode[];
71
+ }
72
+ export interface CmsNavigationConfig {
73
+ version?: number;
74
+ maxDepth?: number;
75
+ roots?: CmsNavigationNode[];
76
+ updatedAt?: string;
77
+ }
60
78
  export default HireControlConfig;
@@ -60,6 +60,7 @@ export type SectionType = "default" | "company" | "category" | "categoryClass" |
60
60
  export type ListingEntity = {
61
61
  id: number;
62
62
  listingId: number;
63
+ active?: boolean;
63
64
  latitude: number;
64
65
  longitude: number;
65
66
  entityDisplayName?: string;
@@ -2,6 +2,7 @@ import { Address } from './company';
2
2
  export type ListingEntityDto = {
3
3
  id: number;
4
4
  listingId: number;
5
+ active?: boolean;
5
6
  latitude: number;
6
7
  longitude: number;
7
8
  entityDisplayName?: string;
@@ -2,6 +2,7 @@ import { Address } from "./company";
2
2
  export type mongoListingEntity = {
3
3
  id: string;
4
4
  listingId: number;
5
+ active?: boolean;
5
6
  latitude: number;
6
7
  longitude: number;
7
8
  entityDisplayName?: string;
@@ -0,0 +1,8 @@
1
+ export interface SearchReadConfig {
2
+ provider: string;
3
+ integrationType: string;
4
+ appId: string;
5
+ apiKey: string;
6
+ indexName: string;
7
+ }
8
+ export default SearchReadConfig;
@@ -269,9 +269,20 @@ class FetchHandler {
269
269
  errorMessage,
270
270
  };
271
271
  }
272
- return response.status === 200
273
- ? await response.json()
274
- : (null as unknown as T);
272
+ if (response.status === 204 || response.status === 205) {
273
+ return null as unknown as T;
274
+ }
275
+
276
+ const rawBody = await response.text();
277
+ if (!rawBody) {
278
+ return null as unknown as T;
279
+ }
280
+
281
+ try {
282
+ return JSON.parse(rawBody) as T;
283
+ } catch {
284
+ return rawBody as unknown as T;
285
+ }
275
286
  }
276
287
 
277
288
  private async refreshToken(): Promise<boolean> {
package/index.ts CHANGED
@@ -9,6 +9,7 @@ import permissionsController from "./controllers/permissionsController";
9
9
  import UsersControllerType from "./types/controllers/usersControllerType";
10
10
  import ListingsControllerType from "./types/controllers/listingsControllerType";
11
11
  import clientAuthConfigController from "./controllers/clientAuthConfigController";
12
+ import integrationConfigController from "./controllers/integrationConfigController";
12
13
  import listingscontroller from "./controllers/listingsController";
13
14
  import mediaController from "./controllers/mediaController";
14
15
  import filtersController from "./controllers/filtersController";
@@ -69,7 +70,7 @@ import ContentModel, {
69
70
  import ContentBlock from "./types/content/block";
70
71
  import ContentEntry from "./types/content/contentEntry";
71
72
  import Blog from "./types/blog";
72
- import CategoryListDto, { AddValueRequest } from "./types/categoryList";
73
+ import CategoryListDto, { AddValueRequest, CategoryListValueDto } from "./types/categoryList";
73
74
  import JobFeed from "./types/jobFeed";
74
75
  import JobFeedFieldMapping, {
75
76
  MultipleFieldConfig,
@@ -85,6 +86,7 @@ import FocalPoint from "./types/focalPoint";
85
86
  import CompletionRequest, {
86
87
  CompletionResponse,
87
88
  } from "./types/completionRequest";
89
+ import SearchReadConfig from "./types/searchReadConfig";
88
90
 
89
91
  export const auth = {
90
92
  login: authController.login,
@@ -140,6 +142,10 @@ export const clientAuthConfig = {
140
142
  delete: clientAuthConfigController.deleteClientAuthConfig,
141
143
  };
142
144
 
145
+ export const integrationConfig = {
146
+ getSearchRead: integrationConfigController.getSearchReadConfig,
147
+ };
148
+
143
149
  export const media = {
144
150
  upload: mediaController.uploadMedia,
145
151
  uploadProfileImage: mediaController.uploadProfileImage,
@@ -187,6 +193,7 @@ export const categoryLists = {
187
193
  delete: categoryListsController.deleteCategoryList,
188
194
  addValue: categoryListsController.addValue,
189
195
  removeValue: categoryListsController.removeValue,
196
+ updateValue: categoryListsController.updateValue,
190
197
  updateValues: categoryListsController.updateValues,
191
198
  };
192
199
 
@@ -249,6 +256,7 @@ export const jobListings = {
249
256
  getMapListings: JobListingsController.getMapJobListingsByCompany,
250
257
  getMapListing: JobListingsController.getMapListingById,
251
258
  getById: JobListingsController.getJobListingById,
259
+ updateFieldVersionApproval: JobListingsController.updateFieldVersionApproval,
252
260
  create: JobListingsController.createJobListing,
253
261
  update: JobListingsController.updateJobListing,
254
262
  delete: JobListingsController.deleteJobListing,
@@ -335,6 +343,7 @@ export type {
335
343
  Blog,
336
344
  CategoryListDto,
337
345
  AddValueRequest,
346
+ CategoryListValueDto,
338
347
  JobFeed,
339
348
  JobFeedFieldMapping,
340
349
  MultipleFieldConfig,
@@ -346,6 +355,7 @@ export type {
346
355
  FocalPoint,
347
356
  CompletionRequest,
348
357
  CompletionResponse,
358
+ SearchReadConfig,
349
359
  };
350
360
 
351
361
  export {
@@ -364,6 +374,7 @@ const hcApi = {
364
374
  mapConfig,
365
375
  permissions,
366
376
  clientAuthConfig,
377
+ integrationConfig,
367
378
  filters,
368
379
  listings,
369
380
  media,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abcagency/hire-control-sdk",
3
- "version": "1.0.99",
3
+ "version": "1.0.102",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",
@@ -5,13 +5,18 @@ export type ModifiedByDto = {
5
5
  dateTime: string;
6
6
  };
7
7
 
8
+ export type CategoryListValueDto = {
9
+ displayValue: string;
10
+ displayInForms: boolean;
11
+ };
12
+
8
13
  export type CategoryListDto = {
9
14
  id: string;
10
15
  companyId: string;
11
16
  type: string;
12
17
  name: string;
13
18
  description?: string;
14
- values: Record<string, string>;
19
+ values: Record<string, CategoryListValueDto>;
15
20
  isActive: boolean;
16
21
  autoAddNewValues: boolean;
17
22
  notifyOnNewValues: boolean;
@@ -23,7 +28,8 @@ export type CategoryListDto = {
23
28
 
24
29
  export type AddValueRequest = {
25
30
  key: string;
26
- value: string;
31
+ displayValue: string;
32
+ displayInForms: boolean;
27
33
  };
28
34
 
29
35
  export default CategoryListDto;
@@ -58,6 +58,7 @@ export interface HireControlConfig {
58
58
  additionalUserFields?: InputField[];
59
59
  siteBuildHook?: string;
60
60
  analyticsEmbedUrl?: string;
61
+ cmsNavigation?: CmsNavigationConfig;
61
62
  }
62
63
 
63
64
  export interface InputField {
@@ -66,4 +67,23 @@ export interface InputField {
66
67
  icon?: string;
67
68
  }
68
69
 
70
+ export interface CmsNavigationNode {
71
+ id?: string;
72
+ entryId?: string;
73
+ modelId?: string;
74
+ navLabel?: string;
75
+ linkUrl?: string;
76
+ isExternal?: boolean;
77
+ isButton?: boolean;
78
+ showInNav?: boolean;
79
+ children?: CmsNavigationNode[];
80
+ }
81
+
82
+ export interface CmsNavigationConfig {
83
+ version?: number;
84
+ maxDepth?: number;
85
+ roots?: CmsNavigationNode[];
86
+ updatedAt?: string;
87
+ }
88
+
69
89
  export default HireControlConfig;
package/types/listing.ts CHANGED
@@ -71,6 +71,7 @@ export type SectionType =
71
71
  export type ListingEntity = {
72
72
  id: number;
73
73
  listingId: number;
74
+ active?: boolean;
74
75
  latitude: number;
75
76
  longitude: number;
76
77
  entityDisplayName?: string;
@@ -3,6 +3,7 @@ import { Address } from './company';
3
3
  export type ListingEntityDto = {
4
4
  id: number;
5
5
  listingId: number;
6
+ active?: boolean;
6
7
  latitude: number;
7
8
  longitude: number;
8
9
  entityDisplayName?: string;
@@ -3,6 +3,7 @@ import { Address } from "./company";
3
3
  export type mongoListingEntity = {
4
4
  id: string;
5
5
  listingId: number;
6
+ active?: boolean;
6
7
  latitude: number;
7
8
  longitude: number;
8
9
  entityDisplayName?: string;
@@ -0,0 +1,9 @@
1
+ export interface SearchReadConfig {
2
+ provider: string;
3
+ integrationType: string;
4
+ appId: string;
5
+ apiKey: string;
6
+ indexName: string;
7
+ }
8
+
9
+ export default SearchReadConfig;