@abcagency/hire-control-sdk 1.1.16 → 1.1.18

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.
@@ -1,5 +1,9 @@
1
1
  import FetchHandler from "../handlers/fetchHandler";
2
2
  import Company from "../types/company";
3
+ import {
4
+ CompanyCloneAccepted,
5
+ CompanyCloneRequest,
6
+ } from "../types/companyClone";
3
7
  import { API_URL } from "../constants/config";
4
8
 
5
9
  const fetchHandler = new FetchHandler(API_URL);
@@ -86,6 +90,26 @@ class CompaniesController {
86
90
  async syncAllCompanies(authToken: string | null = null): Promise<void> {
87
91
  return fetchHandler.get<void>("/companies/syncall", true, authToken);
88
92
  }
93
+
94
+ /**
95
+ * Queue a company clone job.
96
+ * @param {string} id - The source company ID.
97
+ * @param {CompanyCloneRequest} request - Clone options and target company overrides.
98
+ * @param {string | null} authToken - Optional auth token.
99
+ * @returns {Promise<CompanyCloneAccepted>} - Accepted clone job details.
100
+ */
101
+ async cloneCompany(
102
+ id: string,
103
+ request: CompanyCloneRequest,
104
+ authToken: string | null = null
105
+ ): Promise<CompanyCloneAccepted> {
106
+ return fetchHandler.post<CompanyCloneRequest, CompanyCloneAccepted>(
107
+ `/companies/${id}/clone`,
108
+ request,
109
+ true,
110
+ authToken
111
+ );
112
+ }
89
113
  }
90
114
 
91
115
  export default new CompaniesController();
@@ -1,5 +1,9 @@
1
1
  import FetchHandler from "../handlers/fetchHandler";
2
- import { type JobListing, type JobListingSaveResult } from "../types/JobListing";
2
+ import {
3
+ type JobListing,
4
+ type JobListingSaveResult,
5
+ type JobStatus,
6
+ } from "../types/JobListing";
3
7
  import { API_URL } from "../constants/config";
4
8
 
5
9
  const fetchHandler = new FetchHandler(API_URL);
@@ -64,16 +68,21 @@ class JobListingsController {
64
68
  */
65
69
  async getMapJobListingsByCompany(
66
70
  authToken: string | null = null,
67
- filterId: string | null = null
71
+ filterId: string | null = null,
72
+ status: JobStatus | null = null
68
73
  ): Promise<any[]> {
69
- if (filterId) {
70
- return fetchHandler.get<any[]>(
71
- `/joblistings/MapListings?filterId=${filterId}`,
72
- true,
73
- authToken
74
- );
74
+ const params = new URLSearchParams();
75
+ if (filterId) params.set("filterId", filterId);
76
+ if (status !== null && status !== undefined) {
77
+ params.set("status", status.toString());
75
78
  }
76
- return fetchHandler.get<any[]>("/joblistings/MapListings", true, authToken);
79
+
80
+ const query = params.toString();
81
+ return fetchHandler.get<any[]>(
82
+ `/joblistings/MapListings${query ? `?${query}` : ""}`,
83
+ true,
84
+ authToken
85
+ );
77
86
  }
78
87
 
79
88
  /**
@@ -99,10 +108,17 @@ class JobListingsController {
99
108
  */
100
109
  async getMapListingById(
101
110
  id: string,
102
- authToken: string | null = null
111
+ authToken: string | null = null,
112
+ status: JobStatus | null = null
103
113
  ): Promise<any> {
114
+ const params = new URLSearchParams();
115
+ if (status !== null && status !== undefined) {
116
+ params.set("status", status.toString());
117
+ }
118
+ const query = params.toString();
119
+
104
120
  return fetchHandler.get<any>(
105
- `/joblistings/MapListings/${id}`,
121
+ `/joblistings/MapListings/${id}${query ? `?${query}` : ""}`,
106
122
  true,
107
123
  authToken
108
124
  );
@@ -161,7 +177,7 @@ class JobListingsController {
161
177
  async exportJobListingsCsv(
162
178
  pageSize: number = 10,
163
179
  pageNumber: number = 1,
164
- status: number | null = null,
180
+ status: JobStatus | null = null,
165
181
  from: Date | null = null,
166
182
  to: Date | null = null,
167
183
  authToken: string | null = null
@@ -170,7 +186,9 @@ class JobListingsController {
170
186
  pageSize: pageSize.toString(),
171
187
  pageNumber: pageNumber.toString(),
172
188
  });
173
- if (status) params.append("status", status.toString());
189
+ if (status !== null && status !== undefined) {
190
+ params.append("status", status.toString());
191
+ }
174
192
  if (from) params.append("from", from.toISOString());
175
193
  if (to) params.append("to", to.toISOString());
176
194
 
@@ -1,4 +1,5 @@
1
1
  import Company from "../types/company";
2
+ import { CompanyCloneAccepted, CompanyCloneRequest } from "../types/companyClone";
2
3
  declare class CompaniesController {
3
4
  /**
4
5
  * Get all companies.
@@ -41,6 +42,14 @@ declare class CompaniesController {
41
42
  * @returns {Promise<void>} - No return value.
42
43
  */
43
44
  syncAllCompanies(authToken?: string | null): Promise<void>;
45
+ /**
46
+ * Queue a company clone job.
47
+ * @param {string} id - The source company ID.
48
+ * @param {CompanyCloneRequest} request - Clone options and target company overrides.
49
+ * @param {string | null} authToken - Optional auth token.
50
+ * @returns {Promise<CompanyCloneAccepted>} - Accepted clone job details.
51
+ */
52
+ cloneCompany(id: string, request: CompanyCloneRequest, authToken?: string | null): Promise<CompanyCloneAccepted>;
44
53
  }
45
54
  declare const _default: CompaniesController;
46
55
  export default _default;
@@ -1,4 +1,4 @@
1
- import { type JobListing, type JobListingSaveResult } from "../types/JobListing";
1
+ import { type JobListing, type JobListingSaveResult, type JobStatus } from "../types/JobListing";
2
2
  /**
3
3
  * Controller for handling job listing API requests.
4
4
  */
@@ -28,7 +28,7 @@ declare class JobListingsController {
28
28
  * @param authToken - The authentication token.
29
29
  * @returns A promise that resolves to a list of map job listings.
30
30
  */
31
- getMapJobListingsByCompany(authToken?: string | null, filterId?: string | null): Promise<any[]>;
31
+ getMapJobListingsByCompany(authToken?: string | null, filterId?: string | null, status?: JobStatus | null): Promise<any[]>;
32
32
  /**
33
33
  * [GET /joblistings/{id}]
34
34
  * Get a specific job listing by its ID.
@@ -44,7 +44,7 @@ declare class JobListingsController {
44
44
  * @param authToken - The authentication token.
45
45
  * @returns A promise that resolves to the map job listing data.
46
46
  */
47
- getMapListingById(id: string, authToken?: string | null): Promise<any>;
47
+ getMapListingById(id: string, authToken?: string | null, status?: JobStatus | null): Promise<any>;
48
48
  /**
49
49
  * [POST /joblistings]
50
50
  * Create a new job listing.
@@ -72,7 +72,7 @@ declare class JobListingsController {
72
72
  * @param {string | null} authToken - Optional authentication token.
73
73
  * @returns {Promise<void>} - Triggers a CSV file download.
74
74
  */
75
- exportJobListingsCsv(pageSize?: number, pageNumber?: number, status?: number | null, from?: Date | null, to?: Date | null, authToken?: string | null): Promise<void>;
75
+ exportJobListingsCsv(pageSize?: number, pageNumber?: number, status?: JobStatus | null, from?: Date | null, to?: Date | null, authToken?: string | null): Promise<void>;
76
76
  /**
77
77
  * [DELETE /joblistings/{id}]
78
78
  * Delete an existing job listing.
package/dist/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
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}})}getThemeSystem(){return t(this,arguments,void 0,function*(t=null){try{return yield h.get("/mapconfig/theme-system",!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 S=new e(n);var b=new class{getSearchReadConfig(){return t(this,arguments,void 0,function*(t=null){try{return yield S.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 L=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 T=new e(n);var w=new class{uploadMedia(e){return t(this,arguments,void 0,function*(t,e=null){return T.post("/media/upload",t,!0,e,!0)})}uploadProfileImage(e){return t(this,arguments,void 0,function*(t,e=null){return T.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 T.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 T.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 F=new e(n);var I=new class{getAppendListings(){return t(this,arguments,void 0,function*(t=null){return F.get("/appendListings",!0,t)})}getAppendListing(e){return t(this,arguments,void 0,function*(t,e=null){return F.get(`/appendListings/${t}`,!0,e)})}createAppendListing(e){return t(this,arguments,void 0,function*(t,e=null){return F.post("/appendListings",t,!0,e)})}updateAppendListing(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return F.put(`/appendListings/${t}`,e,!0,n)})}deleteAppendListing(e){return t(this,arguments,void 0,function*(t,e=null){return F.delete(`/appendListings/${t}`,!0,e)})}};const R=new e(n);var k=new class{getForms(){return t(this,arguments,void 0,function*(t=null){return R.get("/forms",!0,t)})}getForm(e){return t(this,arguments,void 0,function*(t,e=null){return R.get(`/forms/${t}`,!0,e)})}createForm(e){return t(this,arguments,void 0,function*(t,e=null){return R.post("/forms",t,!0,e)})}updateForm(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return R.put(`/forms/${t}`,e,!0,n)})}updateFormWithFieldRenames(e,n,r){return t(this,arguments,void 0,function*(t,e,n,r=null){return R.put(`/forms/${t}`,Object.assign(Object.assign({},e),n),!0,r)})}getFormSubmissionCount(e){return t(this,arguments,void 0,function*(t,e=null){return R.get(`/forms/${t}/submission-count`,!0,e)})}getFormSubmissionFieldUsage(e){return t(this,arguments,void 0,function*(t,e=null){return R.get(`/forms/${t}/submission-fields`,!0,e)})}migrateSubmissionFields(e,n){return t(this,arguments,void 0,function*(t,e,n=null){return R.post(`/forms/${t}/migrate-submission-fields`,e,!0,n)})}deleteForm(e){return t(this,arguments,void 0,function*(t,e=null){return R.delete(`/forms/${t}`,!0,e)})}processFormRequest(e){return t(this,arguments,void 0,function*(t,e=null){return R.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)})}deleteFormSubmission(e){return t(this,arguments,void 0,function*(t,e=null){return B.delete(`/formsubmission/${t}`,!0,e)})}};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,mt=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.JobStatus=void 0,(vt=exports.JobStatus||(exports.JobStatus={}))[vt.Hold=0]="Hold",vt[vt.Published=1]="Published",vt[vt.Archived=2]="Archived",exports.FeedHandlingOption=void 0,(yt=exports.FeedHandlingOption||(exports.FeedHandlingOption={}))[yt.Replace=0]="Replace",yt[yt.Append=1]="Append",yt[yt.Custom=2]="Custom";const Ct={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"},St={"testimonial-block":Ct.TESTIMONIAL,"button-block":Ct.BUTTON,"recruiter-block":Ct.RECRUITER},bt={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},At={getAll:u.getEvents,get:u.getEvent,getBySlug:u.getEventBySlug,create:u.createEvent,update:u.updateEvent,delete:u.deleteEvent},Lt={get:a.getAllRolesWithClaims,create:a.addRole,update:a.updateRole,delete:a.deleteRole},Tt=d,wt=L,Et={resetPassword:p.resetPassword,resetPasswordWithToken:p.resetPasswordWithToken,forgotPassword:p.forgotPassword},$t={get:f.getMapConfig,getThemeSystem:f.getThemeSystem,update:f.updateMapConfig,create:f.createMapConfig},Ft={get:C.getClientAuthConfigById,getAll:C.getAllClientAuthConfigs,update:C.updateClientAuthConfig,create:C.createClientAuthConfig,delete:C.deleteClientAuthConfig},It={getSearchRead:b.getSearchReadConfig},Rt={upload:w.uploadMedia,uploadProfileImage:w.uploadProfileImage,get:w.listMedia,delete:w.deleteMedia},kt={getList:$.getFilters,get:$.getFilter,update:$.updateFilter,create:$.createFilter,delete:$.deleteFilter},Bt={get:I.getAppendListings,getAppendListing:I.getAppendListing,create:I.createAppendListing,update:I.updateAppendListing,delete:I.deleteAppendListing},Ot={getAll:_.getBlogs,getById:_.getBlog,create:_.createBlog,update:_.updateBlog,delete:_.deleteBlog},xt={get:D.getCategories,getByCompany:D.getCategoriesByCompany},Mt={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},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},Ut={getAll:z.getAll,getById:z.get,create:z.create,update:z.update,delete:z.delete,sync:z.sync,toggleActive:z.toggleActive},Nt={get:X.get,create:X.create,delete:X.delete},_t={create:q.create,get:q.getAll,update:q.update,delete:q.delete,getAllSql:q.getAllSql},Pt={get:Q.get,getAll:Q.getAll,sync:Q.sync},Dt={get:y.getAllPermissions},Vt={getAll:M.getCompanies,getById:M.getCompany,create:M.createCompany,update:M.updateCompany,delete:M.deleteCompany,sync:M.syncAllCompanies},Wt={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},Jt={getTypes:et.getFieldTypes},Ht={getTypes:rt.getValidatorTypes},Gt={getAll:ut.getContentEntries,getById:ut.getContentEntry,getBySlug:ut.getContentEntryBySlug,create:ut.createContentEntry,update:ut.updateContentEntry,delete:ut.deleteContentEntry,unpublish:ut.unpublishAll},zt={getAll:at.getBlocks,getById:at.getBlock,create:at.createBlock,update:at.updateBlock,updateWithMigrations:at.updateBlockWithMigrations,previewUpdate:at.previewBlockUpdate,delete:at.deleteBlock,getTemplateBlocks:at.getTemplateBlocks},Kt={getAll:dt.getModels,getById:dt.getModel,create:dt.createModel,update:dt.updateModel,delete:dt.deleteModel,previewSync:dt.previewSync,executeSync:dt.executeSync},Xt={getCompletion:mt.getCompletion},Yt=k,qt={submitContactForm:O.submitContactForm,submitFormSubmission:O.submitFormSubmission,getFormSubmissions:O.getFormSubmissions,exportFormSubmissionsCsv:O.exportFormSubmissionsCsv,getFormSubmissionTypes:O.getFormSubmissionTypes,deleteFormSubmission:O.deleteFormSubmission},Zt={auth:bt,events:At,roles:Lt,users:Tt,account:Et,mapConfig:$t,permissions:Dt,clientAuthConfig:Ft,integrationConfig:It,filters:kt,listings:wt,media:Rt,appendListings:Bt,blogs:Ot,categories:xt,categoryLists:Mt,jobFeedFieldMappings:jt,jobFeeds:Ut,jobListingSettings:Nt,listingEntities:_t,recruiters:Pt,forms:Yt,formSubmissions:qt,openAI:Xt,companies:Vt,jobListings:Wt};exports.BLOCK_KEYS=Ct,exports.BLOCK_KEY_ALIASES=St,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=Et,exports.appendListings=Bt,exports.auth=bt,exports.blogs=Ot,exports.categories=xt,exports.categoryLists=Mt,exports.clientAuthConfig=Ft,exports.companies=Vt,exports.contentBlocks=zt,exports.contentEntries=Gt,exports.contentField=Jt,exports.contentValidator=Ht,exports.default=Zt,exports.events=At,exports.filters=kt,exports.formSubmissions=qt,exports.forms=Yt,exports.integrationConfig=It,exports.jobFeedFieldMappings=jt,exports.jobFeeds=Ut,exports.jobListingSettings=Nt,exports.jobListings=Wt,exports.listingEntities=_t,exports.listings=wt,exports.mapConfig=$t,exports.media=Rt,exports.model=Kt,exports.openAI=Xt,exports.permissions=Dt,exports.recruiters=Pt,exports.roles=Lt,exports.users=Tt;
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.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.__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 c=new e(n);var d=new class{getAllUsers(){return t.__awaiter(this,arguments,void 0,(function*(t=null){try{return yield c.get("/users",!0,t)}catch(t){throw t}}))}getUser(e){return t.__awaiter(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.__awaiter(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.__awaiter(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.__awaiter(this,arguments,void 0,(function*(t,e=null){try{yield c.put("/users",t,!0,e)}catch(t){throw t}}))}deleteUser(e){return t.__awaiter(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.__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 h=new e(n);var _=new class{getMapConfig(){return t.__awaiter(this,arguments,void 0,(function*(t=null){try{return yield h.get("/mapconfig",!0,t)}catch(t){throw t}}))}getThemeSystem(){return t.__awaiter(this,arguments,void 0,(function*(t=null){try{return yield h.get("/mapconfig/theme-system",!0,t)}catch(t){throw t}}))}updateMapConfig(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return h.put("/mapconfig",t,!0,e)}))}createMapConfig(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return h.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 m=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 y=new e(n);var C=new class{getSearchReadConfig(){return t.__awaiter(this,arguments,void 0,(function*(t=null){try{return yield y.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 b=new class{getListings(){return t.__awaiter(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.__awaiter(this,arguments,void 0,(function*(t,e=null){try{return yield S.get(`/listings/${t}`,!0,e)}catch(t){throw t}}))}};const A=new e(n);var L=new class{uploadMedia(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return A.post("/media/upload",t,!0,e,!0)}))}uploadProfileImage(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return A.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 A.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 A.delete(`/media/delete?${n.toString()}`,!0,e)}))}};const T=new e(n);var $=new class{getFilters(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return T.get("/filters",!0,t)}))}getFilter(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return T.get(`/filters/${t}`,!0,e)}))}createFilter(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return T.post("/filters",t,!0,e)}))}updateFilter(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return T.put(`/filters/${t}`,e,!0,n)}))}deleteFilter(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return T.delete(`/filters/${t}`,!0,e)}))}};const E=new e(n);var F=new class{getAppendListings(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return E.get("/appendListings",!0,t)}))}getAppendListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return E.get(`/appendListings/${t}`,!0,e)}))}createAppendListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return E.post("/appendListings",t,!0,e)}))}updateAppendListing(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return E.put(`/appendListings/${t}`,e,!0,n)}))}deleteAppendListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return E.delete(`/appendListings/${t}`,!0,e)}))}};const I=new e(n);var R=new class{getForms(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return I.get("/forms",!0,t)}))}getForm(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return I.get(`/forms/${t}`,!0,e)}))}createForm(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return I.post("/forms",t,!0,e)}))}updateForm(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return I.put(`/forms/${t}`,e,!0,n)}))}updateFormWithFieldRenames(e,n,r){return t.__awaiter(this,arguments,void 0,(function*(t,e,n,r=null){return I.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 I.get(`/forms/${t}/submission-count`,!0,e)}))}getFormSubmissionFieldUsage(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return I.get(`/forms/${t}/submission-fields`,!0,e)}))}migrateSubmissionFields(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return I.post(`/forms/${t}/migrate-submission-fields`,e,!0,n)}))}deleteForm(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return I.delete(`/forms/${t}`,!0,e)}))}processFormRequest(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return I.post("/forms/jsonSchema",t,!0,e)}))}};const k=new e(n);var B=new class{submitContactForm(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return k.post("/contactForm",t,!0,e,!0)}))}submitFormSubmission(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return k.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()),k.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 k.getFile(`/formsubmission/export-csv?${u.toString()}`,!0,a),c=window.URL.createObjectURL(l),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.__awaiter(this,arguments,void 0,(function*(t=null){return k.get("/formsubmission/types",!0,t)}))}deleteFormSubmission(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return k.delete(`/formsubmission/${t}`,!0,e)}))}};const O=new e(n);var x=new class{getCompanies(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return O.get("/companies",!0,t)}))}getCompany(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return O.get(`/companies/${t}`,!0,e)}))}createCompany(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return O.post("/companies",t,!0,e)}))}updateCompany(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return O.put(`/companies/${t}`,e,!0,n)}))}deleteCompany(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return O.delete(`/companies/${t}`,!0,e)}))}syncAllCompanies(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return O.get("/companies/syncall",!0,t)}))}cloneCompany(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return O.post(`/companies/${t}/clone`,e,!0,n)}))}};const M=new e(n);var j=new class{updateFieldVersionApproval(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return M.patch(`/joblistings/${t}/field-version-approval`,e,!0,n)}))}updateDescriptionVersionApproval(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return M.patch(`/joblistings/${t}/description-version-approval`,e,!0,n)}))}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,n=null){const r=new URLSearchParams;e&&r.set("filterId",e),null!=n&&r.set("status",n.toString());const i=r.toString();return M.get("/joblistings/MapListings"+(i?`?${i}`:""),!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,n=null){const r=new URLSearchParams;null!=n&&r.set("status",n.toString());const i=r.toString();return M.get(`/joblistings/MapListings/${t}${i?`?${i}`:""}`,!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()});null!=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 N=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 P=new e(n);var D=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 P.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 P.get(`/categories/${t}${i}`,!0,n)}))}};const V=new e(n);var W=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)}))}updateValue(e,n,r){return t.__awaiter(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.__awaiter(this,arguments,void 0,(function*(t,e=null){return J.get(`/jobFeedFieldMappings/feed/${t}`,!0,e)}))}get(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return J.get(`/jobFeedFieldMappings/${t}`,!0,e)}))}create(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return J.post("/jobFeedFieldMappings",t,!0,e)}))}update(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return J.put(`/jobFeedFieldMappings/${t}`,e,!0,n)}))}delete(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return J.delete(`/jobFeedFieldMappings/${t}`,!0,e)}))}toggleActive(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return J.post("/jobFeedFieldMappings/toggle-active",t,!0,e)}))}discoverFields(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return J.get(`/jobFeedFieldMappings/discover-fields/${t}`,!0,e)}))}validate(e){return t.__awaiter(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.__awaiter(this,arguments,void 0,(function*(t=null){return G.get("/jobfeeds",!0,t)}))}get(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return G.get(`/jobfeeds/${t}`,!0,e)}))}create(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return G.post("/jobfeeds",t,!0,e)}))}update(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return G.put(`/jobfeeds/${t}`,e,!0,n)}))}delete(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return G.delete(`/jobfeeds/${t}`,!0,e)}))}sync(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return G.post(`/jobfeeds/${t}/sync`,{},!0,e)}))}toggleActive(e,n){return t.__awaiter(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.__awaiter(this,arguments,void 0,(function*(t=null){return K.get("/jobListingSettings",!0,t)}))}create(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return K.post("/jobListingSettings",t,!0,e)}))}delete(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return K.delete("/jobListingSettings",!0,t)}))}};const q=new e(n);var Y=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),q.post("/listingEntities"+(r.toString()?"?"+r.toString():""),t,!0,n)}))}getAll(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return q.get("/listingEntities",!0,t)}))}create(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return q.post("/listingEntities/create",t,!0,e)}))}update(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){yield q.put(`/listingEntities/update/${t}`,e,!0,n)}))}delete(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){yield q.delete(`/listingEntities/delete/${t}`,!0,e)}))}};const Z=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 Z.get(`/recruiters${r}`,!0,e)}))}getAll(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return Z.get("/recruiters/all",!0,t)}))}sync(){return t.__awaiter(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.__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=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 at=new class{getContentEntries(e){return t.__awaiter(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.__awaiter(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.__awaiter(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.__awaiter(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.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return st.put(`/contententry/${t}`,e,!0,n)}))}deleteContentEntry(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return st.delete(`/contententry/${t}`,!0,e)}))}getVersions(e){return t.__awaiter(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.__awaiter(this,arguments,void 0,(function*(t,e=null){return st.post(`/contententry/${t}/unpublish`,void 0,!0,e)}))}};const ut=new e(n);var lt=new class{getBlocks(){return t.__awaiter(this,arguments,void 0,(function*(t=null){const e=yield ut.get("/block",!0,t);return ot(e)}))}getBlock(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){const n=yield ut.get(`/block/${t}`,!0,e);return ot(n)}))}createBlock(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){const n=yield ut.post("/block",t,!0,e);return ot(n)}))}updateBlock(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return ut.put(`/block/${t}`,e,!0,n)}))}updateBlockWithMigrations(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=[],r=null){const i=n.length>0?{block:e,fieldMigrations:n}:e;return ut.put(`/block/${t}`,i,!0,r)}))}previewBlockUpdate(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){const r=yield ut.post(`/block/${t}/preview-update`,e,!0,n);return ot(r)}))}deleteBlock(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return ut.delete(`/block/${t}`,!0,e)}))}getTemplateBlocks(){return t.__awaiter(this,arguments,void 0,(function*(t=null){const e=yield ut.get("/block/template-blocks",!0,t);return ot(e)}))}};const ct=new e(n);var dt=new class{getModels(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return ct.get("/model",!0,t)}))}getModel(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return ct.get(`/model/${t}`,!0,e)}))}createModel(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return ct.post("/model",t,!0,e)}))}updateModel(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return ct.put(`/model/${t}`,e,!0,n)}))}deleteModel(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return ct.delete(`/model/${t}`,!0,e)}))}previewSync(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return ct.get(`/model/${t}/sync/preview`,!0,e)}))}executeSync(e,n){return t.__awaiter(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,_t,ft,vt,wt=new class{getCompletion(e){return t.__awaiter(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,(_t=exports.FormSubmissionStatus||(exports.FormSubmissionStatus={}))[_t.Submitted=1]="Submitted",_t[_t.Hold=2]="Hold",_t[_t.Rejected=3]="Rejected",_t[_t.Sent=4]="Sent",exports.JobStatus=void 0,(ft=exports.JobStatus||(exports.JobStatus={}))[ft.Hold=0]="Hold",ft[ft.Published=1]="Published",ft[ft.Archived=2]="Archived",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"},yt={"testimonial-block":mt.TESTIMONIAL,"button-block":mt.BUTTON,"recruiter-block":mt.RECRUITER},Ct={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},St={getAll:a.getEvents,get:a.getEvent,getBySlug:a.getEventBySlug,create:a.createEvent,update:a.updateEvent,delete:a.deleteEvent},bt={get:l.getAllRolesWithClaims,create:l.addRole,update:l.updateRole,delete:l.deleteRole},At=d,Lt=b,Tt={resetPassword:p.resetPassword,resetPasswordWithToken:p.resetPasswordWithToken,forgotPassword:p.forgotPassword},$t={get:_.getMapConfig,getThemeSystem:_.getThemeSystem,update:_.updateMapConfig,create:_.createMapConfig},Et={get:m.getClientAuthConfigById,getAll:m.getAllClientAuthConfigs,update:m.updateClientAuthConfig,create:m.createClientAuthConfig,delete:m.deleteClientAuthConfig},Ft={getSearchRead:C.getSearchReadConfig},It={upload:L.uploadMedia,uploadProfileImage:L.uploadProfileImage,get:L.listMedia,delete:L.deleteMedia},Rt={getList:$.getFilters,get:$.getFilter,update:$.updateFilter,create:$.createFilter,delete:$.deleteFilter},kt={get:F.getAppendListings,getAppendListing:F.getAppendListing,create:F.createAppendListing,update:F.updateAppendListing,delete:F.deleteAppendListing},Bt={getAll:N.getBlogs,getById:N.getBlog,create:N.createBlog,update:N.updateBlog,delete:N.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:Y.create,get:Y.getAll,update:Y.update,delete:Y.delete,getAllSql:Y.getAllSql},Pt={get:Q.get,getAll:Q.getAll,sync:Q.sync},Dt={get:v.getAllPermissions},Vt={getAll:x.getCompanies,getById:x.getCompany,create:x.createCompany,update:x.updateCompany,delete:x.deleteCompany,sync:x.syncAllCompanies,clone:x.cloneCompany},Wt={getAll:j.getJobListingsByCompany,getMapListings:j.getMapJobListingsByCompany,getMapListing:j.getMapListingById,getById:j.getJobListingById,updateFieldVersionApproval:j.updateFieldVersionApproval,updateDescriptionVersionApproval:j.updateDescriptionVersionApproval,create:j.createJobListing,update:j.updateJobListing,delete:j.deleteJobListing},Jt={getTypes:et.getFieldTypes},Ht={getTypes:rt.getValidatorTypes},Gt={getAll:at.getContentEntries,getById:at.getContentEntry,getBySlug:at.getContentEntryBySlug,create:at.createContentEntry,update:at.updateContentEntry,delete:at.deleteContentEntry,unpublish:at.unpublishAll},zt={getAll:lt.getBlocks,getById:lt.getBlock,create:lt.createBlock,update:lt.updateBlock,updateWithMigrations:lt.updateBlockWithMigrations,previewUpdate:lt.previewBlockUpdate,delete:lt.deleteBlock,getTemplateBlocks:lt.getTemplateBlocks},Kt={getAll:dt.getModels,getById:dt.getModel,create:dt.createModel,update:dt.updateModel,delete:dt.deleteModel,previewSync:dt.previewSync,executeSync:dt.executeSync},Xt={getCompletion:wt.getCompletion},qt=R,Yt={submitContactForm:B.submitContactForm,submitFormSubmission:B.submitFormSubmission,getFormSubmissions:B.getFormSubmissions,exportFormSubmissionsCsv:B.exportFormSubmissionsCsv,getFormSubmissionTypes:B.getFormSubmissionTypes,deleteFormSubmission:B.deleteFormSubmission},Zt={auth:Ct,events:St,roles:bt,users:At,account:Tt,mapConfig:$t,permissions:Dt,clientAuthConfig:Et,integrationConfig:Ft,filters:Rt,listings:Lt,media:It,appendListings:kt,blogs:Bt,categories:Ot,categoryLists:xt,jobFeedFieldMappings:Mt,jobFeeds:jt,jobListingSettings:Ut,listingEntities:Nt,recruiters:Pt,forms:qt,formSubmissions:Yt,openAI:Xt,companies:Vt,jobListings:Wt};exports.BLOCK_KEYS=mt,exports.BLOCK_KEY_ALIASES=yt,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=Tt,exports.appendListings=kt,exports.auth=Ct,exports.blogs=Bt,exports.categories=Ot,exports.categoryLists=xt,exports.clientAuthConfig=Et,exports.companies=Vt,exports.contentBlocks=zt,exports.contentEntries=Gt,exports.contentField=Jt,exports.contentValidator=Ht,exports.default=Zt,exports.events=St,exports.filters=Rt,exports.formSubmissions=Yt,exports.forms=qt,exports.integrationConfig=Ft,exports.jobFeedFieldMappings=Mt,exports.jobFeeds=jt,exports.jobListingSettings=Ut,exports.jobListings=Wt,exports.listingEntities=Nt,exports.listings=Lt,exports.mapConfig=$t,exports.media=It,exports.model=Kt,exports.openAI=Xt,exports.permissions=Dt,exports.recruiters=Pt,exports.roles=bt,exports.users=At;
2
2
  //# sourceMappingURL=index.cjs.js.map
package/dist/index.d.ts CHANGED
@@ -1,11 +1,12 @@
1
1
  import UsersControllerType from "./types/controllers/usersControllerType";
2
2
  import ListingsControllerType from "./types/controllers/listingsControllerType";
3
3
  import Company from "./types/company";
4
+ import { CompanyCloneAccepted, CompanyCloneRequest } from "./types/companyClone";
4
5
  import Register from "./types/register";
5
6
  import User from "./types/user";
6
7
  import Role from "./types/role";
7
8
  import HireControlConfig from "./types/hireControlConfig";
8
- import type { JobListingEditorConfig, ThemeSystemConfig, ThemeSemanticToken, ThemeScaleToken } from "./types/hireControlConfig";
9
+ import type { JobListingEditorConfig, JobListingEditorDefaultValueConfig, ThemeSystemConfig, ThemeSemanticToken, ThemeScaleToken } from "./types/hireControlConfig";
9
10
  import ClientAuthConfig from "./types/clientAuthConfig";
10
11
  import MediaType from "./types/media/media";
11
12
  import Event, { EventDates, EventDateType, EventInstance, EventType, CallToActionType } from "./types/event";
@@ -176,11 +177,12 @@ export declare const companies: {
176
177
  update: (id: string, company: Company, authToken?: string | null) => Promise<void>;
177
178
  delete: (id: string, authToken?: string | null) => Promise<void>;
178
179
  sync: (authToken?: string | null) => Promise<void>;
180
+ clone: (id: string, request: CompanyCloneRequest, authToken?: string | null) => Promise<CompanyCloneAccepted>;
179
181
  };
180
182
  export declare const jobListings: {
181
183
  getAll: (authToken?: string | null) => Promise<JobListing[]>;
182
- getMapListings: (authToken?: string | null, filterId?: string | null) => Promise<any[]>;
183
- getMapListing: (id: string, authToken?: string | null) => Promise<any>;
184
+ getMapListings: (authToken?: string | null, filterId?: string | null, status?: JobStatus | null) => Promise<any[]>;
185
+ getMapListing: (id: string, authToken?: string | null, status?: JobStatus | null) => Promise<any>;
184
186
  getById: (id: string, authToken?: string | null) => Promise<JobListing>;
185
187
  updateFieldVersionApproval: (id: string, payload: {
186
188
  fieldPath: string;
@@ -256,7 +258,7 @@ export declare const formSubmissions: {
256
258
  deleteFormSubmission: (id: string, authToken?: string | null) => Promise<void>;
257
259
  };
258
260
  export { BLOCK_KEYS, BLOCK_KEY_ALIASES, FIELD_TYPES };
259
- export type { Register, User, Role, HireControlConfig, JobListingEditorConfig, ThemeSystemConfig, ThemeSemanticToken, ThemeScaleToken, ClientAuthConfig, Event, Listing, EventDates, EventDateType, EventInstance, MediaType, Filters, AppendListing, Form, FormFieldMigrationRequest, FormUpdateOptions, FormSubmission, ResultsWrapper, Company, JobListing, JobListingSaveResult, 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 { Register, User, Role, HireControlConfig, JobListingEditorConfig, JobListingEditorDefaultValueConfig, ThemeSystemConfig, ThemeSemanticToken, ThemeScaleToken, ClientAuthConfig, Event, Listing, EventDates, EventDateType, EventInstance, MediaType, Filters, AppendListing, Form, FormFieldMigrationRequest, FormUpdateOptions, FormSubmission, ResultsWrapper, Company, CompanyCloneAccepted, CompanyCloneRequest, JobListing, JobListingSaveResult, 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, };
260
262
  export type { BlockKey, FieldType };
261
263
  export { EventType, CallToActionType, FormSubmissionStatus, FeedHandlingOption, JobStatus, };
262
264
  declare const hcApi: {
@@ -425,11 +427,12 @@ declare const hcApi: {
425
427
  update: (id: string, company: Company, authToken?: string | null) => Promise<void>;
426
428
  delete: (id: string, authToken?: string | null) => Promise<void>;
427
429
  sync: (authToken?: string | null) => Promise<void>;
430
+ clone: (id: string, request: CompanyCloneRequest, authToken?: string | null) => Promise<CompanyCloneAccepted>;
428
431
  };
429
432
  jobListings: {
430
433
  getAll: (authToken?: string | null) => Promise<JobListing[]>;
431
- getMapListings: (authToken?: string | null, filterId?: string | null) => Promise<any[]>;
432
- getMapListing: (id: string, authToken?: string | null) => Promise<any>;
434
+ getMapListings: (authToken?: string | null, filterId?: string | null, status?: JobStatus | null) => Promise<any[]>;
435
+ getMapListing: (id: string, authToken?: string | null, status?: JobStatus | null) => Promise<any>;
433
436
  getById: (id: string, authToken?: string | null) => Promise<JobListing>;
434
437
  updateFieldVersionApproval: (id: string, payload: {
435
438
  fieldPath: string;
@@ -0,0 +1,19 @@
1
+ export type CompanyCloneRequest = {
2
+ targetCompanyName?: string;
3
+ targetCompanyNameShort?: string;
4
+ targetCompanyUrl?: string;
5
+ cloneAll?: boolean;
6
+ options?: string[];
7
+ };
8
+ export type CompanyCloneAccepted = {
9
+ status: string;
10
+ sourceCompanyId: string;
11
+ targetCompanyId: string;
12
+ targetCompanyName: string;
13
+ targetCompanyNameShort: string;
14
+ cloneAll: boolean;
15
+ selectedOptions: string[];
16
+ queuedAtUtc: string;
17
+ invocationStatusCode: number;
18
+ invocationRequestId?: string;
19
+ };
@@ -1,6 +1,10 @@
1
1
  import { NotificationSettings, NotificationRecipient } from "./notificationSettings";
2
2
  interface IntegrationSettings {
3
3
  connectToAts: boolean;
4
+ webhooks?: FormWebhook[];
5
+ }
6
+ interface FormWebhook {
7
+ url: string;
4
8
  }
5
9
  interface FormSettings {
6
10
  useRecruiterFromJob: boolean;
@@ -48,5 +52,5 @@ interface FormUsage {
48
52
  usedIn?: string;
49
53
  title?: string;
50
54
  }
51
- export type { NotificationRecipient, NotificationSettings, IntegrationSettings, FormSettings, FormUpdateOptions, FormFieldMigrationRequest, FormUsage, };
55
+ export type { NotificationRecipient, NotificationSettings, FormWebhook, IntegrationSettings, FormSettings, FormUpdateOptions, FormFieldMigrationRequest, FormUsage, };
52
56
  export default Form;
@@ -22,8 +22,22 @@ export interface PointsOfInterestConfig {
22
22
  }
23
23
  export interface JobListingEditorConfig {
24
24
  visibleFields?: string[];
25
- descriptionMode?: 'single' | 'multiple';
25
+ descriptionMode?: "single" | "multiple";
26
26
  allowCustomFields?: boolean;
27
+ customFields?: JobListingEditorCustomFieldConfig[];
28
+ defaultValues?: JobListingEditorDefaultValueConfig[];
29
+ }
30
+ export interface JobListingEditorCustomFieldConfig {
31
+ id?: string;
32
+ label?: string;
33
+ group?: "overview" | "workplace" | "jobSetup" | "application" | "other";
34
+ type?: "text" | "email" | "number" | "tel" | "url" | "date" | "checkbox" | "string" | "boolean";
35
+ }
36
+ export interface JobListingEditorDefaultValueConfig {
37
+ targetType?: "standard" | "custom";
38
+ fieldKey?: string;
39
+ fieldId?: string;
40
+ value?: string | null;
27
41
  }
28
42
  export interface HireControlConfig {
29
43
  id?: string;
package/index.ts CHANGED
@@ -34,12 +34,17 @@ import modelController from "./controllers/content/modelController";
34
34
  import openAIController from "./controllers/openAIController";
35
35
 
36
36
  import Company from "./types/company";
37
+ import {
38
+ CompanyCloneAccepted,
39
+ CompanyCloneRequest,
40
+ } from "./types/companyClone";
37
41
  import Register from "./types/register";
38
42
  import User from "./types/user";
39
43
  import Role from "./types/role";
40
44
  import HireControlConfig from "./types/hireControlConfig";
41
45
  import type {
42
46
  JobListingEditorConfig,
47
+ JobListingEditorDefaultValueConfig,
43
48
  ThemeSystemConfig,
44
49
  ThemeSemanticToken,
45
50
  ThemeScaleToken,
@@ -275,6 +280,7 @@ export const companies = {
275
280
  update: CompaniesController.updateCompany,
276
281
  delete: CompaniesController.deleteCompany,
277
282
  sync: CompaniesController.syncAllCompanies,
283
+ clone: CompaniesController.cloneCompany,
278
284
  };
279
285
 
280
286
  export const jobListings = {
@@ -350,6 +356,7 @@ export type {
350
356
  Role,
351
357
  HireControlConfig,
352
358
  JobListingEditorConfig,
359
+ JobListingEditorDefaultValueConfig,
353
360
  ThemeSystemConfig,
354
361
  ThemeSemanticToken,
355
362
  ThemeScaleToken,
@@ -368,6 +375,8 @@ export type {
368
375
  FormSubmission,
369
376
  ResultsWrapper,
370
377
  Company,
378
+ CompanyCloneAccepted,
379
+ CompanyCloneRequest,
371
380
  JobListing,
372
381
  JobListingSaveResult,
373
382
  FieldTypeDefinition,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abcagency/hire-control-sdk",
3
- "version": "1.1.16",
3
+ "version": "1.1.18",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",
@@ -0,0 +1,20 @@
1
+ export type CompanyCloneRequest = {
2
+ targetCompanyName?: string;
3
+ targetCompanyNameShort?: string;
4
+ targetCompanyUrl?: string;
5
+ cloneAll?: boolean;
6
+ options?: string[];
7
+ };
8
+
9
+ export type CompanyCloneAccepted = {
10
+ status: string;
11
+ sourceCompanyId: string;
12
+ targetCompanyId: string;
13
+ targetCompanyName: string;
14
+ targetCompanyNameShort: string;
15
+ cloneAll: boolean;
16
+ selectedOptions: string[];
17
+ queuedAtUtc: string;
18
+ invocationStatusCode: number;
19
+ invocationRequestId?: string;
20
+ };
package/types/form.ts CHANGED
@@ -5,6 +5,11 @@ import {
5
5
 
6
6
  interface IntegrationSettings {
7
7
  connectToAts: boolean;
8
+ webhooks?: FormWebhook[];
9
+ }
10
+
11
+ interface FormWebhook {
12
+ url: string;
8
13
  }
9
14
 
10
15
  interface FormSettings {
@@ -60,6 +65,7 @@ interface FormUsage {
60
65
  export type {
61
66
  NotificationRecipient,
62
67
  NotificationSettings,
68
+ FormWebhook,
63
69
  IntegrationSettings,
64
70
  FormSettings,
65
71
  FormUpdateOptions,
@@ -28,8 +28,33 @@ export interface PointsOfInterestConfig {
28
28
 
29
29
  export interface JobListingEditorConfig {
30
30
  visibleFields?: string[];
31
- descriptionMode?: 'single' | 'multiple';
31
+ descriptionMode?: "single" | "multiple";
32
32
  allowCustomFields?: boolean;
33
+ customFields?: JobListingEditorCustomFieldConfig[];
34
+ defaultValues?: JobListingEditorDefaultValueConfig[];
35
+ }
36
+
37
+ export interface JobListingEditorCustomFieldConfig {
38
+ id?: string;
39
+ label?: string;
40
+ group?: "overview" | "workplace" | "jobSetup" | "application" | "other";
41
+ type?:
42
+ | "text"
43
+ | "email"
44
+ | "number"
45
+ | "tel"
46
+ | "url"
47
+ | "date"
48
+ | "checkbox"
49
+ | "string"
50
+ | "boolean";
51
+ }
52
+
53
+ export interface JobListingEditorDefaultValueConfig {
54
+ targetType?: "standard" | "custom";
55
+ fieldKey?: string;
56
+ fieldId?: string;
57
+ value?: string | null;
33
58
  }
34
59
 
35
60
  // HireControlConfig.ts
package/.gitattributes DELETED
@@ -1 +0,0 @@
1
- * text=auto eol=lf