@abcagency/hire-control-sdk 1.1.25 → 1.1.27

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,6 +1,9 @@
1
1
  import FetchHandler from "../handlers/fetchHandler";
2
2
  import { API_URL } from "../constants/config";
3
- import FormSubmission, { FormSubmissionStatus } from "../types/formSubmission";
3
+ import FormSubmission, {
4
+ FormSubmissionStatus,
5
+ SubmissionApprovalReviewRequest,
6
+ } from "../types/formSubmission";
4
7
  import ResultsWrapper from "../types/resultsWrapper";
5
8
 
6
9
  const fetchHandler = new FetchHandler(API_URL);
@@ -148,6 +151,20 @@ class FormSubmissionsController {
148
151
  ): Promise<void> {
149
152
  return fetchHandler.delete<void>(`/formsubmission/${id}`, true, authToken);
150
153
  }
154
+
155
+ /** Approve or deny a submission currently held for review. */
156
+ async reviewSubmissionApproval(
157
+ id: string,
158
+ request: SubmissionApprovalReviewRequest,
159
+ authToken: string | null = null,
160
+ ): Promise<FormSubmission> {
161
+ return fetchHandler.post<SubmissionApprovalReviewRequest, FormSubmission>(
162
+ `/formsubmission/${id}/approval`,
163
+ request,
164
+ true,
165
+ authToken,
166
+ );
167
+ }
151
168
  }
152
169
 
153
170
  export default new FormSubmissionsController();
@@ -3,6 +3,9 @@ import Form from "../types/form";
3
3
  import type {
4
4
  FormFieldMigrationRequest,
5
5
  FormUpdateOptions,
6
+ GuidedActionExecutionRequest,
7
+ GuidedActionExecutionResult,
8
+ JobTargetedFormSelection,
6
9
  } from "../types/form";
7
10
  import { API_URL } from "../constants/config";
8
11
 
@@ -48,7 +51,7 @@ class FormsController {
48
51
  async updateForm(
49
52
  id: string,
50
53
  form: Form,
51
- authToken: string | null = null
54
+ authToken: string | null = null,
52
55
  ): Promise<void> {
53
56
  return fetchHandler.put<Form, void>(`/forms/${id}`, form, true, authToken);
54
57
  }
@@ -65,13 +68,13 @@ class FormsController {
65
68
  id: string,
66
69
  form: Form,
67
70
  options: FormUpdateOptions,
68
- authToken: string | null = null
71
+ authToken: string | null = null,
69
72
  ): Promise<void> {
70
73
  return fetchHandler.put<Form & FormUpdateOptions, void>(
71
74
  `/forms/${id}`,
72
75
  { ...form, ...options },
73
76
  true,
74
- authToken
77
+ authToken,
75
78
  );
76
79
  }
77
80
 
@@ -83,12 +86,12 @@ class FormsController {
83
86
  */
84
87
  async getFormSubmissionCount(
85
88
  id: string,
86
- authToken: string | null = null
89
+ authToken: string | null = null,
87
90
  ): Promise<number> {
88
91
  return fetchHandler.get<number>(
89
92
  `/forms/${id}/submission-count`,
90
93
  true,
91
- authToken
94
+ authToken,
92
95
  );
93
96
  }
94
97
 
@@ -100,12 +103,12 @@ class FormsController {
100
103
  */
101
104
  async getFormSubmissionFieldUsage(
102
105
  id: string,
103
- authToken: string | null = null
106
+ authToken: string | null = null,
104
107
  ): Promise<Record<string, number>> {
105
108
  return fetchHandler.get<Record<string, number>>(
106
109
  `/forms/${id}/submission-fields`,
107
110
  true,
108
- authToken
111
+ authToken,
109
112
  );
110
113
  }
111
114
 
@@ -119,13 +122,13 @@ class FormsController {
119
122
  async migrateSubmissionFields(
120
123
  id: string,
121
124
  migrationRequest: FormFieldMigrationRequest,
122
- authToken: string | null = null
125
+ authToken: string | null = null,
123
126
  ): Promise<number> {
124
127
  return fetchHandler.post<FormFieldMigrationRequest, number>(
125
128
  `/forms/${id}/migrate-submission-fields`,
126
129
  migrationRequest,
127
130
  true,
128
- authToken
131
+ authToken,
129
132
  );
130
133
  }
131
134
 
@@ -147,15 +150,43 @@ class FormsController {
147
150
  */
148
151
  async processFormRequest(
149
152
  formRequest: string,
150
- authToken: string | null = null
153
+ authToken: string | null = null,
151
154
  ): Promise<string> {
152
155
  return fetchHandler.post<string, string>(
153
156
  "/forms/jsonSchema",
154
157
  formRequest,
155
158
  true,
156
- authToken
159
+ authToken,
157
160
  );
158
161
  }
162
+
163
+ async getEasyApplySelection(
164
+ jobId: string,
165
+ fallbackFormId?: string,
166
+ authToken: string | null = null,
167
+ ): Promise<JobTargetedFormSelection> {
168
+ const params = new URLSearchParams({ jobId });
169
+ if (fallbackFormId) {
170
+ params.set("fallbackFormId", fallbackFormId);
171
+ }
172
+
173
+ return fetchHandler.get<JobTargetedFormSelection>(
174
+ `/forms/easy-apply/selection?${params.toString()}`,
175
+ true,
176
+ authToken,
177
+ );
178
+ }
179
+
180
+ async executeGuidedAction(
181
+ formId: string,
182
+ request: GuidedActionExecutionRequest,
183
+ authToken: string | null = null,
184
+ ): Promise<GuidedActionExecutionResult> {
185
+ return fetchHandler.post<
186
+ GuidedActionExecutionRequest,
187
+ GuidedActionExecutionResult
188
+ >(`/forms/${formId}/guided-actions/execute`, request, true, authToken);
189
+ }
159
190
  }
160
191
 
161
192
  export default new FormsController();
@@ -1,10 +1,57 @@
1
1
  import FetchHandler from '../handlers/fetchHandler';
2
+ import IntegrationConfig from '../types/integrationConfig';
2
3
  import SearchReadConfig from '../types/searchReadConfig';
3
4
  import { API_URL } from '../constants/config';
4
5
 
5
6
  const fetchHandler = new FetchHandler(API_URL);
6
7
 
7
8
  class IntegrationConfigController {
9
+ async getAll(
10
+ authToken: string | null = null
11
+ ): Promise<IntegrationConfig[]> {
12
+ return fetchHandler.get<IntegrationConfig[]>(
13
+ '/integrationconfig',
14
+ true,
15
+ authToken
16
+ );
17
+ }
18
+
19
+ async create(
20
+ config: IntegrationConfig,
21
+ authToken: string | null = null
22
+ ): Promise<IntegrationConfig> {
23
+ return fetchHandler.post<IntegrationConfig, IntegrationConfig>(
24
+ '/integrationconfig',
25
+ config,
26
+ true,
27
+ authToken
28
+ );
29
+ }
30
+
31
+ async update(
32
+ id: string,
33
+ config: IntegrationConfig,
34
+ authToken: string | null = null
35
+ ): Promise<IntegrationConfig> {
36
+ return fetchHandler.put<IntegrationConfig, IntegrationConfig>(
37
+ `/integrationconfig/${id}`,
38
+ config,
39
+ true,
40
+ authToken
41
+ );
42
+ }
43
+
44
+ async delete(
45
+ id: string,
46
+ authToken: string | null = null
47
+ ): Promise<void> {
48
+ return fetchHandler.delete<void>(
49
+ `/integrationconfig/${id}`,
50
+ true,
51
+ authToken
52
+ );
53
+ }
54
+
8
55
  /**
9
56
  * [GET /integrationconfig/search-read]
10
57
  * Get Algolia SearchRead credentials for the authenticated user's company.
@@ -26,9 +26,12 @@ class RecruitersController {
26
26
  return fetchHandler.get<RecruiterDto>("/recruiters/all", true, authToken);
27
27
  }
28
28
 
29
- async sync(authToken: string | null = null): Promise<void> {
29
+ async sync(
30
+ authToken: string | null = null,
31
+ updateExisting = false
32
+ ): Promise<void> {
30
33
  return fetchHandler.post<void, void>(
31
- "/recruiters/sync",
34
+ `/recruiters/sync?updateExisting=${updateExisting}`,
32
35
  {} as any,
33
36
  true,
34
37
  authToken
@@ -1,4 +1,4 @@
1
- import FormSubmission, { FormSubmissionStatus } from "../types/formSubmission";
1
+ import FormSubmission, { FormSubmissionStatus, SubmissionApprovalReviewRequest } from "../types/formSubmission";
2
2
  import ResultsWrapper from "../types/resultsWrapper";
3
3
  declare class FormSubmissionsController {
4
4
  /**
@@ -49,6 +49,8 @@ declare class FormSubmissionsController {
49
49
  * @returns {Promise<void>} - Resolves when deletion succeeds.
50
50
  */
51
51
  deleteFormSubmission(id: string, authToken?: string | null): Promise<void>;
52
+ /** Approve or deny a submission currently held for review. */
53
+ reviewSubmissionApproval(id: string, request: SubmissionApprovalReviewRequest, authToken?: string | null): Promise<FormSubmission>;
52
54
  }
53
55
  declare const _default: FormSubmissionsController;
54
56
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import Form from "../types/form";
2
- import type { FormFieldMigrationRequest, FormUpdateOptions } from "../types/form";
2
+ import type { FormFieldMigrationRequest, FormUpdateOptions, GuidedActionExecutionRequest, GuidedActionExecutionResult, JobTargetedFormSelection } from "../types/form";
3
3
  declare class FormsController {
4
4
  /**
5
5
  * Get all forms for the authenticated user’s company.
@@ -74,6 +74,8 @@ declare class FormsController {
74
74
  * @returns {Promise<string>} - The processed response.
75
75
  */
76
76
  processFormRequest(formRequest: string, authToken?: string | null): Promise<string>;
77
+ getEasyApplySelection(jobId: string, fallbackFormId?: string, authToken?: string | null): Promise<JobTargetedFormSelection>;
78
+ executeGuidedAction(formId: string, request: GuidedActionExecutionRequest, authToken?: string | null): Promise<GuidedActionExecutionResult>;
77
79
  }
78
80
  declare const _default: FormsController;
79
81
  export default _default;
@@ -1,5 +1,10 @@
1
+ import IntegrationConfig from '../types/integrationConfig';
1
2
  import SearchReadConfig from '../types/searchReadConfig';
2
3
  declare class IntegrationConfigController {
4
+ getAll(authToken?: string | null): Promise<IntegrationConfig[]>;
5
+ create(config: IntegrationConfig, authToken?: string | null): Promise<IntegrationConfig>;
6
+ update(id: string, config: IntegrationConfig, authToken?: string | null): Promise<IntegrationConfig>;
7
+ delete(id: string, authToken?: string | null): Promise<void>;
3
8
  /**
4
9
  * [GET /integrationconfig/search-read]
5
10
  * Get Algolia SearchRead credentials for the authenticated user's company.
@@ -2,7 +2,7 @@ import RecruiterDto from "../types/recruiter";
2
2
  declare class RecruitersController {
3
3
  get(recruiterIds?: number[] | null, authToken?: string | null): Promise<Record<string, RecruiterDto>>;
4
4
  getAll(authToken?: string | null): Promise<RecruiterDto>;
5
- sync(authToken?: string | null): Promise<void>;
5
+ sync(authToken?: string | null, updateExisting?: boolean): Promise<void>;
6
6
  }
7
7
  declare const _default: RecruitersController;
8
8
  export default _default;
package/dist/index.cjs.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib");class e{constructor(t){this.apiUrl=t,this.isLocalhost=!1}getAuthToken(){return this.isLocalhost?sessionStorage.getItem("token"):null}get(e){return t.__awaiter(this,arguments,void 0,function*(t,e=!1,n=null){this.isLocalhost&&e&&!n&&(n=this.getAuthToken());const r={method:"GET",credentials:n?"omit":"include"};return e?this.fetchWithAuth(t,r,n):this.fetchWithoutAuth(t,r)})}post(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=!1,r=null,i=!1){this.isLocalhost&&n&&!r&&(r=this.getAuthToken());const o=i,s={method:"POST",credentials:r?"omit":"include",headers:Object.assign(Object.assign({},r?{Authorization:`Bearer ${r}`}:{}),o?{}:{"Content-Type":"application/json"}),body:o?this.convertToFormData(e):JSON.stringify(e)};return n?this.fetchWithAuth(t,s,r):this.fetchWithoutAuth(t,s)})}put(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=!1,r=null,i=!1){this.isLocalhost&&n&&!r&&(r=this.getAuthToken());const o=i,s={method:"PUT",credentials:r?"omit":"include",headers:Object.assign(Object.assign({},r?{Authorization:`Bearer ${r}`}:{}),o?{}:{"Content-Type":"application/json"}),body:o?this.convertToFormData(e):JSON.stringify(e)};return n?this.fetchWithAuth(t,s,r):this.fetchWithoutAuth(t,s)})}patch(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=!1,r=null,i=!1){this.isLocalhost&&n&&!r&&(r=this.getAuthToken());const o=i,s={method:"PATCH",credentials:r?"omit":"include",headers:Object.assign(Object.assign({},r?{Authorization:`Bearer ${r}`}:{}),o?{}:{"Content-Type":"application/json"}),body:o?this.convertToFormData(e):JSON.stringify(e)};return n?this.fetchWithAuth(t,s,r):this.fetchWithoutAuth(t,s)})}delete(e){return t.__awaiter(this,arguments,void 0,function*(t,e=!1,n=null){this.isLocalhost&&e&&!n&&(n=this.getAuthToken());const r={method:"DELETE",credentials:n?"omit":"include"};return e?this.fetchWithAuth(t,r,n):this.fetchWithoutAuth(t,r)})}getFile(e){return t.__awaiter(this,arguments,void 0,function*(t,e=!1,n=null){this.isLocalhost&&e&&!n&&(n=this.getAuthToken());const r={method:"GET",credentials:n?"omit":"include",headers:e&&n?{Authorization:`Bearer ${n}`}:{}},i=yield fetch(`${this.apiUrl}${t}`,r);if(!i.ok)throw new Error(`Failed to fetch file: ${i.statusText}`);return i.blob()})}convertToFormData(t,e=new FormData,n=""){return t instanceof File?e.append(n||"file",t):"string"==typeof t||"number"==typeof t||"boolean"==typeof t?e.append(n,t.toString()):Array.isArray(t)?t.forEach((t,r)=>{this.convertToFormData(t,e,`${n}[${r}]`)}):"object"==typeof t&&null!==t&&Object.keys(t).forEach(r=>{const i=t[r],o=n?`${n}.${r}`:r;this.convertToFormData(i,e,o)}),e}fetchWithoutAuth(e,n){return t.__awaiter(this,void 0,void 0,function*(){const t=yield fetch(`${this.apiUrl}${e}`,n);return this.handleResponse(t)})}fetchWithAuth(e,n,r){return t.__awaiter(this,void 0,void 0,function*(){r?(n.headers=Object.assign(Object.assign({},n.headers),{Authorization:`Bearer ${r}`}),n.credentials="omit"):n.credentials="include";let t=yield fetch(`${this.apiUrl}${e}`,n);if(401===t.status){if(!(yield this.refreshToken()))throw{statusCode:t.status};this.isLocalhost&&(r=this.getAuthToken())&&(n.headers=Object.assign(Object.assign({},n.headers),{Authorization:`Bearer ${r}`})),t=yield fetch(`${this.apiUrl}${e}`,n)}return this.handleResponse(t)})}handleResponse(e){return t.__awaiter(this,void 0,void 0,function*(){if(!e.ok||!e.status.toString().startsWith("2")){let t=`Error: ${e.status} ${e.statusText}`;try{const n=yield e.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{get(){return t.__awaiter(this,arguments,void 0,function*(t=null){return O.get("/formSettings",!0,t)})}save(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return O.post("/formSettings",t,!0,e)})}};const j=new e(n);var M=new class{getCompanies(){return t.__awaiter(this,arguments,void 0,function*(t=null){return j.get("/companies",!0,t)})}getCompany(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return j.get(`/companies/${t}`,!0,e)})}createCompany(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return j.post("/companies",t,!0,e)})}updateCompany(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return j.put(`/companies/${t}`,e,!0,n)})}deleteCompany(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return j.delete(`/companies/${t}`,!0,e)})}syncAllCompanies(){return t.__awaiter(this,arguments,void 0,function*(t=null){return j.get("/companies/syncall",!0,t)})}cloneCompany(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return j.post(`/companies/${t}/clone`,e,!0,n)})}};const U=new e(n);var N=new class{updateFieldVersionApproval(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return U.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 U.patch(`/joblistings/${t}/description-version-approval`,e,!0,n)})}getJobListingsByCompany(){return t.__awaiter(this,arguments,void 0,function*(t=null){return U.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 U.get("/joblistings/MapListings"+(i?`?${i}`:""),!0,t)})}getJobListingById(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return U.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 U.get(`/joblistings/MapListings/${t}${i?`?${i}`:""}`,!0,e)})}createJobListing(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return U.post("/joblistings",t,!0,e)})}updateJobListing(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return U.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 U.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 U.delete(`/joblistings/${t}`,!0,e)})}};const P=new e(n);var D=new class{getBlogs(){return t.__awaiter(this,arguments,void 0,function*(t=null){return P.get("/blog",!0,t)})}getBlog(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return P.get(`/blog/${t}`,!0,e)})}createBlog(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return P.post("/blog",t,!0,e)})}updateBlog(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return P.put(`/blog/${t}`,e,!0,n)})}deleteBlog(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return P.delete(`/blog/${t}`,!0,e)})}};const V=new e(n);var W=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 V.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 V.get(`/categories/${t}${i}`,!0,n)})}};const J=new e(n);var H=new class{getAllCategoryLists(){return t.__awaiter(this,arguments,void 0,function*(t=null){return J.get("/categorylist",!0,t)})}getCategoryListById(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return J.get(`/categorylist/${t}`,!0,e)})}getCategoryListsByType(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return J.get(`/categorylist/type/${t}`,!0,e)})}getActiveCategoryLists(){return t.__awaiter(this,arguments,void 0,function*(t=null){return J.get("/categorylist/active",!0,t)})}getCategoryListByTypeAndName(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return J.get(`/categorylist/type/${t}/name/${e}`,!0,n)})}createCategoryList(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return J.post("/categorylist",t,!0,e)})}updateCategoryList(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return J.put(`/categorylist/${t}`,e,!0,n)})}deleteCategoryList(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return J.delete(`/categorylist/${t}`,!0,e)})}addValue(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return J.post(`/categorylist/${t}/values`,e,!0,n)})}removeValue(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return J.delete(`/categorylist/${t}/values/${e}`,!0,n)})}updateValues(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return J.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 J.put(`/categorylist/${t}/values/${encodeURIComponent(e)}`,n,!0,r)})}};const G=new e(n);var z=new class{getByFeed(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return G.get(`/jobFeedFieldMappings/feed/${t}`,!0,e)})}get(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return G.get(`/jobFeedFieldMappings/${t}`,!0,e)})}create(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return G.post("/jobFeedFieldMappings",t,!0,e)})}update(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return G.put(`/jobFeedFieldMappings/${t}`,e,!0,n)})}delete(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return G.delete(`/jobFeedFieldMappings/${t}`,!0,e)})}toggleActive(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return G.post("/jobFeedFieldMappings/toggle-active",t,!0,e)})}discoverFields(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return G.get(`/jobFeedFieldMappings/discover-fields/${t}`,!0,e)})}validate(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return G.get(`/jobFeedFieldMappings/validate/${t}`,!0,e)})}};const K=new e(n);var X=new class{getAll(){return t.__awaiter(this,arguments,void 0,function*(t=null){return K.get("/jobfeeds",!0,t)})}get(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return K.get(`/jobfeeds/${t}`,!0,e)})}create(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return K.post("/jobfeeds",t,!0,e)})}update(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return K.put(`/jobfeeds/${t}`,e,!0,n)})}delete(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return K.delete(`/jobfeeds/${t}`,!0,e)})}sync(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return K.post(`/jobfeeds/${t}/sync`,{},!0,e)})}toggleActive(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return K.patch(`/jobfeeds/${t}/toggle-active`,e,!0,n)})}};const q=new e(n),Y=(t,e)=>"object"==typeof t&&null!==t&&"statusCode"in t&&t.statusCode===e;var Z=new class{get(){return t.__awaiter(this,arguments,void 0,function*(t=null){try{return yield q.get("/jobListingSettings",!0,t)}catch(t){if(Y(t,404)||Y(t,204))return null;throw t}})}create(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return q.post("/jobListingSettings",t,!0,e)})}delete(){return t.__awaiter(this,arguments,void 0,function*(t=null){return q.delete("/jobListingSettings",!0,t)})}};const Q=new e(n);var tt=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 et=new e(n);var nt=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 et.get(`/recruiters${r}`,!0,e)})}getAll(){return t.__awaiter(this,arguments,void 0,function*(t=null){return et.get("/recruiters/all",!0,t)})}sync(){return t.__awaiter(this,arguments,void 0,function*(t=null){return et.post("/recruiters/sync",{},!0,t)})}};const rt=new e(n);var it=new class{getFieldTypes(){return t.__awaiter(this,arguments,void 0,function*(t=null){return rt.get("/field/types",!0,t)})}};const ot=new e(n);var st=new class{getValidatorTypes(){return t.__awaiter(this,arguments,void 0,function*(t=null){return ot.get("/validator/types",!0,t)})}};const at=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,ut=t=>{if(Array.isArray(t))return t.map(t=>ut(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[at(n)]=ut(r);return e},lt=new e(n);var ct=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 lt.get(r,!0,n);return ut(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 lt.get(r,!0,n);return ut(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 lt.get(i,!0,r);return ut(o)})}createContentEntry(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){const n=yield lt.post("/contententry",t,!0,e);return ut(n)})}updateContentEntry(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return lt.put(`/contententry/${t}`,e,!0,n)})}deleteContentEntry(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return lt.delete(`/contententry/${t}`,!0,e)})}getVersions(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){const n=yield lt.get(`/contententry/${t}/versions`,!0,e);return ut(n)})}unpublishAll(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return lt.post(`/contententry/${t}/unpublish`,void 0,!0,e)})}};const dt=new e(n);var gt=new class{getBlocks(){return t.__awaiter(this,arguments,void 0,function*(t=null){const e=yield dt.get("/block",!0,t);return ut(e)})}getBlock(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){const n=yield dt.get(`/block/${t}`,!0,e);return ut(n)})}createBlock(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){const n=yield dt.post("/block",t,!0,e);return ut(n)})}updateBlock(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return dt.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 dt.put(`/block/${t}`,i,!0,r)})}previewBlockUpdate(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){const r=yield dt.post(`/block/${t}/preview-update`,e,!0,n);return ut(r)})}deleteBlock(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return dt.delete(`/block/${t}`,!0,e)})}getTemplateBlocks(){return t.__awaiter(this,arguments,void 0,function*(t=null){const e=yield dt.get("/block/template-blocks",!0,t);return ut(e)})}};const pt=new e(n);var ht=new class{getModels(){return t.__awaiter(this,arguments,void 0,function*(t=null){return pt.get("/model",!0,t)})}getModel(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return pt.get(`/model/${t}`,!0,e)})}createModel(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return pt.post("/model",t,!0,e)})}updateModel(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return pt.put(`/model/${t}`,e,!0,n)})}deleteModel(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return pt.delete(`/model/${t}`,!0,e)})}previewSync(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return pt.get(`/model/${t}/sync/preview`,!0,e)})}executeSync(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return pt.post(`/model/${t}/sync`,e,!0,n)})}};const _t=new e(n);var ft,vt,wt,mt,yt,Ct=new class{getCompletion(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return _t.post("/openai/completion",t,!0,e)})}};exports.EventType=void 0,(ft=exports.EventType||(exports.EventType={}))[ft.Virtual=0]="Virtual",ft[ft.InPerson=1]="InPerson",ft[ft.Hybrid=2]="Hybrid",exports.CallToActionType=void 0,(vt=exports.CallToActionType||(exports.CallToActionType={}))[vt.Button=0]="Button",vt[vt.Link=1]="Link",vt[vt.Download=2]="Download",vt[vt.HireControlRegistration=3]="HireControlRegistration",exports.FormSubmissionStatus=void 0,(wt=exports.FormSubmissionStatus||(exports.FormSubmissionStatus={}))[wt.Submitted=1]="Submitted",wt[wt.Hold=2]="Hold",wt[wt.Rejected=3]="Rejected",wt[wt.Sent=4]="Sent",wt[wt.Failed=5]="Failed",wt[wt.Blacklisted=6]="Blacklisted",exports.JobStatus=void 0,(mt=exports.JobStatus||(exports.JobStatus={}))[mt.Hold=0]="Hold",mt[mt.Published=1]="Published",mt[mt.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 St={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"},bt={"testimonial-block":St.TESTIMONIAL,"button-block":St.BUTTON,"recruiter-block":St.RECRUITER},At={login:o.login,nextLogin:o.nextLogin,refreshToken:o.refreshToken,changeCompany:o.changeCompany,register:o.register,isAuthenticated:o.isAuthenticated,getCompany:o.getCompany,getCompanies:o.getCompanies,getRoles:o.getRoles,getPermissions:o.getPermissions,logout:o.logout,getUser:o.getUser},Lt={getAll:a.getEvents,get:a.getEvent,getBySlug:a.getEventBySlug,create:a.createEvent,update:a.updateEvent,delete:a.deleteEvent},Tt={get:l.getAllRolesWithClaims,create:l.addRole,update:l.updateRole,delete:l.deleteRole},$t=d,Et=b,Ft={resetPassword:p.resetPassword,resetPasswordWithToken:p.resetPasswordWithToken,forgotPassword:p.forgotPassword},It={get:_.getMapConfig,getThemeSystem:_.getThemeSystem,update:_.updateMapConfig,create:_.createMapConfig},Rt={get:m.getClientAuthConfigById,getAll:m.getAllClientAuthConfigs,update:m.updateClientAuthConfig,create:m.createClientAuthConfig,delete:m.deleteClientAuthConfig},kt={getSearchRead:C.getSearchReadConfig},Bt={upload:L.uploadMedia,uploadProfileImage:L.uploadProfileImage,get:L.listMedia,delete:L.deleteMedia},Ot={getList:$.getFilters,get:$.getFilter,update:$.updateFilter,create:$.createFilter,delete:$.deleteFilter},xt={get:F.getAppendListings,getAppendListing:F.getAppendListing,create:F.createAppendListing,update:F.updateAppendListing,delete:F.deleteAppendListing},jt={getAll:D.getBlogs,getById:D.getBlog,create:D.createBlog,update:D.updateBlog,delete:D.deleteBlog},Mt={get:W.getCategories,getByCompany:W.getCategoriesByCompany},Ut={getAll:H.getAllCategoryLists,getById:H.getCategoryListById,getByType:H.getCategoryListsByType,getActive:H.getActiveCategoryLists,getByTypeAndName:H.getCategoryListByTypeAndName,create:H.createCategoryList,update:H.updateCategoryList,delete:H.deleteCategoryList,addValue:H.addValue,removeValue:H.removeValue,updateValue:H.updateValue,updateValues:H.updateValues},Nt={getByFeed:z.getByFeed,get:z.get,create:z.create,update:z.update,delete:z.delete,toggleActive:z.toggleActive,discoverFields:z.discoverFields,validate:z.validate},Pt={getAll:X.getAll,getById:X.get,create:X.create,update:X.update,delete:X.delete,sync:X.sync,toggleActive:X.toggleActive},Dt={get:Z.get,create:Z.create,delete:Z.delete},Vt={create:tt.create,get:tt.getAll,update:tt.update,delete:tt.delete,getAllSql:tt.getAllSql},Wt={get:nt.get,getAll:nt.getAll,sync:nt.sync},Jt={get:v.getAllPermissions},Ht={getAll:M.getCompanies,getById:M.getCompany,create:M.createCompany,update:M.updateCompany,delete:M.deleteCompany,sync:M.syncAllCompanies,clone:M.cloneCompany},Gt={getAll:N.getJobListingsByCompany,getMapListings:N.getMapJobListingsByCompany,getMapListing:N.getMapListingById,getById:N.getJobListingById,updateFieldVersionApproval:N.updateFieldVersionApproval,updateDescriptionVersionApproval:N.updateDescriptionVersionApproval,create:N.createJobListing,update:N.updateJobListing,delete:N.deleteJobListing},zt={getTypes:it.getFieldTypes},Kt={getTypes:st.getValidatorTypes},Xt={getAll:ct.getContentEntries,getById:ct.getContentEntry,getBySlug:ct.getContentEntryBySlug,create:ct.createContentEntry,update:ct.updateContentEntry,delete:ct.deleteContentEntry,unpublish:ct.unpublishAll},qt={getAll:gt.getBlocks,getById:gt.getBlock,create:gt.createBlock,update:gt.updateBlock,updateWithMigrations:gt.updateBlockWithMigrations,previewUpdate:gt.previewBlockUpdate,delete:gt.deleteBlock,getTemplateBlocks:gt.getTemplateBlocks},Yt={getAll:ht.getModels,getById:ht.getModel,create:ht.createModel,update:ht.updateModel,delete:ht.deleteModel,previewSync:ht.previewSync,executeSync:ht.executeSync},Zt={getCompletion:Ct.getCompletion},Qt=R,te={get:x.get,save:x.save},ee={submitContactForm:B.submitContactForm,submitFormSubmission:B.submitFormSubmission,getFormSubmissions:B.getFormSubmissions,exportFormSubmissionsCsv:B.exportFormSubmissionsCsv,getFormSubmissionTypes:B.getFormSubmissionTypes,deleteFormSubmission:B.deleteFormSubmission},ne={auth:At,events:Lt,roles:Tt,users:$t,account:Ft,mapConfig:It,permissions:Jt,clientAuthConfig:Rt,integrationConfig:kt,filters:Ot,listings:Et,media:Bt,appendListings:xt,blogs:jt,categories:Mt,categoryLists:Ut,jobFeedFieldMappings:Nt,jobFeeds:Pt,jobListingSettings:Dt,listingEntities:Vt,recruiters:Wt,forms:Qt,formSettings:te,formSubmissions:ee,openAI:Zt,companies:Ht,jobListings:Gt};exports.BLOCK_KEYS=St,exports.BLOCK_KEY_ALIASES=bt,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=Ft,exports.appendListings=xt,exports.auth=At,exports.blogs=jt,exports.categories=Mt,exports.categoryLists=Ut,exports.clientAuthConfig=Rt,exports.companies=Ht,exports.contentBlocks=qt,exports.contentEntries=Xt,exports.contentField=zt,exports.contentValidator=Kt,exports.default=ne,exports.events=Lt,exports.filters=Ot,exports.formSettings=te,exports.formSubmissions=ee,exports.forms=Qt,exports.integrationConfig=kt,exports.jobFeedFieldMappings=Nt,exports.jobFeeds=Pt,exports.jobListingSettings=Dt,exports.jobListings=Gt,exports.listingEntities=Vt,exports.listings=Et,exports.mapConfig=It,exports.media=Bt,exports.model=Yt,exports.openAI=Zt,exports.permissions=Jt,exports.recruiters=Wt,exports.roles=Tt,exports.users=$t;
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{getAll(){return t.__awaiter(this,arguments,void 0,function*(t=null){return y.get("/integrationconfig",!0,t)})}create(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return y.post("/integrationconfig",t,!0,e)})}update(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return y.put(`/integrationconfig/${t}`,e,!0,n)})}delete(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return y.delete(`/integrationconfig/${t}`,!0,e)})}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 A=new class{getListings(){return t.__awaiter(this,arguments,void 0,function*(t=null,e=null){try{const n=e?`?filterId=${encodeURIComponent(e)}`:"";return yield 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 b=new e(n);var L=new class{uploadMedia(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return b.post("/media/upload",t,!0,e,!0)})}uploadProfileImage(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return b.post("/media/upload-profile-image",t,!0,e,!0)})}listMedia(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){const n=new URLSearchParams({folderKey:t});return b.get(`/media/list?${n.toString()}`,!0,e)})}deleteMedia(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){const n=new URLSearchParams({key:t});return b.delete(`/media/delete?${n.toString()}`,!0,e)})}};const 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)})}getEasyApplySelection(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){const r=new URLSearchParams({jobId:t});return e&&r.set("fallbackFormId",e),I.get(`/forms/easy-apply/selection?${r.toString()}`,!0,n)})}executeGuidedAction(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return I.post(`/forms/${t}/guided-actions/execute`,e,!0,n)})}};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)})}reviewSubmissionApproval(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return k.post(`/formsubmission/${t}/approval`,e,!0,n)})}};const x=new e(n);var O=new class{get(){return t.__awaiter(this,arguments,void 0,function*(t=null){return x.get("/formSettings",!0,t)})}save(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return x.post("/formSettings",t,!0,e)})}};const j=new e(n);var M=new class{getCompanies(){return t.__awaiter(this,arguments,void 0,function*(t=null){return j.get("/companies",!0,t)})}getCompany(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return j.get(`/companies/${t}`,!0,e)})}createCompany(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return j.post("/companies",t,!0,e)})}updateCompany(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return j.put(`/companies/${t}`,e,!0,n)})}deleteCompany(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return j.delete(`/companies/${t}`,!0,e)})}syncAllCompanies(){return t.__awaiter(this,arguments,void 0,function*(t=null){return j.get("/companies/syncall",!0,t)})}cloneCompany(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return j.post(`/companies/${t}/clone`,e,!0,n)})}};const U=new e(n);var P=new class{updateFieldVersionApproval(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return U.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 U.patch(`/joblistings/${t}/description-version-approval`,e,!0,n)})}getJobListingsByCompany(){return t.__awaiter(this,arguments,void 0,function*(t=null){return U.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 U.get("/joblistings/MapListings"+(i?`?${i}`:""),!0,t)})}getJobListingById(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return U.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 U.get(`/joblistings/MapListings/${t}${i?`?${i}`:""}`,!0,e)})}createJobListing(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return U.post("/joblistings",t,!0,e)})}updateJobListing(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return U.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 U.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 U.delete(`/joblistings/${t}`,!0,e)})}};const N=new e(n);var D=new class{getBlogs(){return t.__awaiter(this,arguments,void 0,function*(t=null){return N.get("/blog",!0,t)})}getBlog(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return N.get(`/blog/${t}`,!0,e)})}createBlog(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return N.post("/blog",t,!0,e)})}updateBlog(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return N.put(`/blog/${t}`,e,!0,n)})}deleteBlog(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return N.delete(`/blog/${t}`,!0,e)})}};const V=new e(n);var W=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 V.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 V.get(`/categories/${t}${i}`,!0,n)})}};const J=new e(n);var H=new class{getAllCategoryLists(){return t.__awaiter(this,arguments,void 0,function*(t=null){return J.get("/categorylist",!0,t)})}getCategoryListById(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return J.get(`/categorylist/${t}`,!0,e)})}getCategoryListsByType(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return J.get(`/categorylist/type/${t}`,!0,e)})}getActiveCategoryLists(){return t.__awaiter(this,arguments,void 0,function*(t=null){return J.get("/categorylist/active",!0,t)})}getCategoryListByTypeAndName(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return J.get(`/categorylist/type/${t}/name/${e}`,!0,n)})}createCategoryList(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return J.post("/categorylist",t,!0,e)})}updateCategoryList(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return J.put(`/categorylist/${t}`,e,!0,n)})}deleteCategoryList(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return J.delete(`/categorylist/${t}`,!0,e)})}addValue(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return J.post(`/categorylist/${t}/values`,e,!0,n)})}removeValue(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return J.delete(`/categorylist/${t}/values/${e}`,!0,n)})}updateValues(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return J.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 J.put(`/categorylist/${t}/values/${encodeURIComponent(e)}`,n,!0,r)})}};const G=new e(n);var z=new class{getByFeed(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return G.get(`/jobFeedFieldMappings/feed/${t}`,!0,e)})}get(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return G.get(`/jobFeedFieldMappings/${t}`,!0,e)})}create(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return G.post("/jobFeedFieldMappings",t,!0,e)})}update(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return G.put(`/jobFeedFieldMappings/${t}`,e,!0,n)})}delete(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return G.delete(`/jobFeedFieldMappings/${t}`,!0,e)})}toggleActive(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return G.post("/jobFeedFieldMappings/toggle-active",t,!0,e)})}discoverFields(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return G.get(`/jobFeedFieldMappings/discover-fields/${t}`,!0,e)})}validate(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return G.get(`/jobFeedFieldMappings/validate/${t}`,!0,e)})}};const K=new e(n);var X=new class{getAll(){return t.__awaiter(this,arguments,void 0,function*(t=null){return K.get("/jobfeeds",!0,t)})}get(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return K.get(`/jobfeeds/${t}`,!0,e)})}create(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return K.post("/jobfeeds",t,!0,e)})}update(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return K.put(`/jobfeeds/${t}`,e,!0,n)})}delete(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return K.delete(`/jobfeeds/${t}`,!0,e)})}sync(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return K.post(`/jobfeeds/${t}/sync`,{},!0,e)})}toggleActive(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return K.patch(`/jobfeeds/${t}/toggle-active`,e,!0,n)})}};const q=new e(n),Y=(t,e)=>"object"==typeof t&&null!==t&&"statusCode"in t&&t.statusCode===e;var Z=new class{get(){return t.__awaiter(this,arguments,void 0,function*(t=null){try{return yield q.get("/jobListingSettings",!0,t)}catch(t){if(Y(t,404)||Y(t,204))return null;throw t}})}create(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return q.post("/jobListingSettings",t,!0,e)})}delete(){return t.__awaiter(this,arguments,void 0,function*(t=null){return q.delete("/jobListingSettings",!0,t)})}};const Q=new e(n);var tt=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 et=new e(n);var nt=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 et.get(`/recruiters${r}`,!0,e)})}getAll(){return t.__awaiter(this,arguments,void 0,function*(t=null){return et.get("/recruiters/all",!0,t)})}sync(){return t.__awaiter(this,arguments,void 0,function*(t=null,e=!1){return et.post(`/recruiters/sync?updateExisting=${e}`,{},!0,t)})}};const rt=new e(n);var it=new class{getFieldTypes(){return t.__awaiter(this,arguments,void 0,function*(t=null){return rt.get("/field/types",!0,t)})}};const ot=new e(n);var st=new class{getValidatorTypes(){return t.__awaiter(this,arguments,void 0,function*(t=null){return ot.get("/validator/types",!0,t)})}};const at=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,ut=t=>{if(Array.isArray(t))return t.map(t=>ut(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[at(n)]=ut(r);return e},lt=new e(n);var ct=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 lt.get(r,!0,n);return ut(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 lt.get(r,!0,n);return ut(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 lt.get(i,!0,r);return ut(o)})}createContentEntry(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){const n=yield lt.post("/contententry",t,!0,e);return ut(n)})}updateContentEntry(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return lt.put(`/contententry/${t}`,e,!0,n)})}deleteContentEntry(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return lt.delete(`/contententry/${t}`,!0,e)})}getVersions(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){const n=yield lt.get(`/contententry/${t}/versions`,!0,e);return ut(n)})}unpublishAll(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return lt.post(`/contententry/${t}/unpublish`,void 0,!0,e)})}};const dt=new e(n);var gt=new class{getBlocks(){return t.__awaiter(this,arguments,void 0,function*(t=null){const e=yield dt.get("/block",!0,t);return ut(e)})}getBlock(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){const n=yield dt.get(`/block/${t}`,!0,e);return ut(n)})}createBlock(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){const n=yield dt.post("/block",t,!0,e);return ut(n)})}updateBlock(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return dt.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 dt.put(`/block/${t}`,i,!0,r)})}previewBlockUpdate(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){const r=yield dt.post(`/block/${t}/preview-update`,e,!0,n);return ut(r)})}deleteBlock(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return dt.delete(`/block/${t}`,!0,e)})}getTemplateBlocks(){return t.__awaiter(this,arguments,void 0,function*(t=null){const e=yield dt.get("/block/template-blocks",!0,t);return ut(e)})}};const pt=new e(n);var ht=new class{getModels(){return t.__awaiter(this,arguments,void 0,function*(t=null){return pt.get("/model",!0,t)})}getModel(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return pt.get(`/model/${t}`,!0,e)})}createModel(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return pt.post("/model",t,!0,e)})}updateModel(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return pt.put(`/model/${t}`,e,!0,n)})}deleteModel(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return pt.delete(`/model/${t}`,!0,e)})}previewSync(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return pt.get(`/model/${t}/sync/preview`,!0,e)})}executeSync(e,n){return t.__awaiter(this,arguments,void 0,function*(t,e,n=null){return pt.post(`/model/${t}/sync`,e,!0,n)})}};const _t=new e(n);var ft,vt,wt,mt,yt,Ct,St=new class{getCompletion(e){return t.__awaiter(this,arguments,void 0,function*(t,e=null){return _t.post("/openai/completion",t,!0,e)})}};exports.EventType=void 0,(ft=exports.EventType||(exports.EventType={}))[ft.Virtual=0]="Virtual",ft[ft.InPerson=1]="InPerson",ft[ft.Hybrid=2]="Hybrid",exports.CallToActionType=void 0,(vt=exports.CallToActionType||(exports.CallToActionType={}))[vt.Button=0]="Button",vt[vt.Link=1]="Link",vt[vt.Download=2]="Download",vt[vt.HireControlRegistration=3]="HireControlRegistration",exports.FormSubmissionStatus=void 0,(wt=exports.FormSubmissionStatus||(exports.FormSubmissionStatus={}))[wt.Submitted=1]="Submitted",wt[wt.Hold=2]="Hold",wt[wt.Rejected=3]="Rejected",wt[wt.Sent=4]="Sent",wt[wt.Failed=5]="Failed",wt[wt.Blacklisted=6]="Blacklisted",wt[wt.PendingApproval=7]="PendingApproval",exports.JobStatus=void 0,(mt=exports.JobStatus||(exports.JobStatus={}))[mt.Hold=0]="Hold",mt[mt.Published=1]="Published",mt[mt.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",exports.IntegrationType=void 0,(Ct=exports.IntegrationType||(exports.IntegrationType={}))[Ct.Custom=0]="Custom",Ct[Ct.SearchWrite=1]="SearchWrite",Ct[Ct.SearchRead=2]="SearchRead",Ct[Ct.ExternalSync=3]="ExternalSync";const At={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"},bt={"testimonial-block":At.TESTIMONIAL,"button-block":At.BUTTON,"recruiter-block":At.RECRUITER},Lt={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},Tt={getAll:a.getEvents,get:a.getEvent,getBySlug:a.getEventBySlug,create:a.createEvent,update:a.updateEvent,delete:a.deleteEvent},$t={get:l.getAllRolesWithClaims,create:l.addRole,update:l.updateRole,delete:l.deleteRole},Et=d,Ft=A,It={resetPassword:p.resetPassword,resetPasswordWithToken:p.resetPasswordWithToken,forgotPassword:p.forgotPassword},Rt={get:_.getMapConfig,getThemeSystem:_.getThemeSystem,update:_.updateMapConfig,create:_.createMapConfig},kt={get:m.getClientAuthConfigById,getAll:m.getAllClientAuthConfigs,update:m.updateClientAuthConfig,create:m.createClientAuthConfig,delete:m.deleteClientAuthConfig},Bt={getAll:C.getAll,create:C.create,update:C.update,delete:C.delete,getSearchRead:C.getSearchReadConfig},xt={upload:L.uploadMedia,uploadProfileImage:L.uploadProfileImage,get:L.listMedia,delete:L.deleteMedia},Ot={getList:$.getFilters,get:$.getFilter,update:$.updateFilter,create:$.createFilter,delete:$.deleteFilter},jt={get:F.getAppendListings,getAppendListing:F.getAppendListing,create:F.createAppendListing,update:F.updateAppendListing,delete:F.deleteAppendListing},Mt={getAll:D.getBlogs,getById:D.getBlog,create:D.createBlog,update:D.updateBlog,delete:D.deleteBlog},Ut={get:W.getCategories,getByCompany:W.getCategoriesByCompany},Pt={getAll:H.getAllCategoryLists,getById:H.getCategoryListById,getByType:H.getCategoryListsByType,getActive:H.getActiveCategoryLists,getByTypeAndName:H.getCategoryListByTypeAndName,create:H.createCategoryList,update:H.updateCategoryList,delete:H.deleteCategoryList,addValue:H.addValue,removeValue:H.removeValue,updateValue:H.updateValue,updateValues:H.updateValues},Nt={getByFeed:z.getByFeed,get:z.get,create:z.create,update:z.update,delete:z.delete,toggleActive:z.toggleActive,discoverFields:z.discoverFields,validate:z.validate},Dt={getAll:X.getAll,getById:X.get,create:X.create,update:X.update,delete:X.delete,sync:X.sync,toggleActive:X.toggleActive},Vt={get:Z.get,create:Z.create,delete:Z.delete},Wt={create:tt.create,get:tt.getAll,update:tt.update,delete:tt.delete,getAllSql:tt.getAllSql},Jt={get:nt.get,getAll:nt.getAll,sync:nt.sync},Ht={get:v.getAllPermissions},Gt={getAll:M.getCompanies,getById:M.getCompany,create:M.createCompany,update:M.updateCompany,delete:M.deleteCompany,sync:M.syncAllCompanies,clone:M.cloneCompany},zt={getAll:P.getJobListingsByCompany,getMapListings:P.getMapJobListingsByCompany,getMapListing:P.getMapListingById,getById:P.getJobListingById,updateFieldVersionApproval:P.updateFieldVersionApproval,updateDescriptionVersionApproval:P.updateDescriptionVersionApproval,create:P.createJobListing,update:P.updateJobListing,delete:P.deleteJobListing},Kt={getTypes:it.getFieldTypes},Xt={getTypes:st.getValidatorTypes},qt={getAll:ct.getContentEntries,getById:ct.getContentEntry,getBySlug:ct.getContentEntryBySlug,create:ct.createContentEntry,update:ct.updateContentEntry,delete:ct.deleteContentEntry,unpublish:ct.unpublishAll},Yt={getAll:gt.getBlocks,getById:gt.getBlock,create:gt.createBlock,update:gt.updateBlock,updateWithMigrations:gt.updateBlockWithMigrations,previewUpdate:gt.previewBlockUpdate,delete:gt.deleteBlock,getTemplateBlocks:gt.getTemplateBlocks},Zt={getAll:ht.getModels,getById:ht.getModel,create:ht.createModel,update:ht.updateModel,delete:ht.deleteModel,previewSync:ht.previewSync,executeSync:ht.executeSync},Qt={getCompletion:St.getCompletion},te=R,ee={get:O.get,save:O.save},ne={submitContactForm:B.submitContactForm,submitFormSubmission:B.submitFormSubmission,getFormSubmissions:B.getFormSubmissions,exportFormSubmissionsCsv:B.exportFormSubmissionsCsv,getFormSubmissionTypes:B.getFormSubmissionTypes,deleteFormSubmission:B.deleteFormSubmission,reviewSubmissionApproval:B.reviewSubmissionApproval},re={auth:Lt,events:Tt,roles:$t,users:Et,account:It,mapConfig:Rt,permissions:Ht,clientAuthConfig:kt,integrationConfig:Bt,filters:Ot,listings:Ft,media:xt,appendListings:jt,blogs:Mt,categories:Ut,categoryLists:Pt,jobFeedFieldMappings:Nt,jobFeeds:Dt,jobListingSettings:Vt,listingEntities:Wt,recruiters:Jt,forms:te,formSettings:ee,formSubmissions:ne,openAI:Qt,companies:Gt,jobListings:zt};exports.BLOCK_KEYS=At,exports.BLOCK_KEY_ALIASES=bt,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=It,exports.appendListings=jt,exports.auth=Lt,exports.blogs=Mt,exports.categories=Ut,exports.categoryLists=Pt,exports.clientAuthConfig=kt,exports.companies=Gt,exports.contentBlocks=Yt,exports.contentEntries=qt,exports.contentField=Kt,exports.contentValidator=Xt,exports.default=re,exports.events=Tt,exports.filters=Ot,exports.formSettings=ee,exports.formSubmissions=ne,exports.forms=te,exports.integrationConfig=Bt,exports.jobFeedFieldMappings=Nt,exports.jobFeeds=Dt,exports.jobListingSettings=Vt,exports.jobListings=zt,exports.listingEntities=Wt,exports.listings=Ft,exports.mapConfig=Rt,exports.media=xt,exports.model=Zt,exports.openAI=Qt,exports.permissions=Ht,exports.recruiters=Jt,exports.roles=$t,exports.users=Et;
2
2
  //# sourceMappingURL=index.cjs.js.map
package/dist/index.d.ts CHANGED
@@ -12,8 +12,8 @@ import Event, { EventDates, EventDateType, EventInstance, EventType, CallToActio
12
12
  import { Listing } from "./types/listing";
13
13
  import Filters from "./types/filters/filters";
14
14
  import AppendListing from "./types/appendListing";
15
- import Form, { FormFieldMigrationRequest, FormUpdateOptions } from "./types/form";
16
- import FormSubmission, { FormSubmissionStatus } from "./types/formSubmission";
15
+ import Form, { FormExperienceType, EasyApplyForm, FormFieldMigrationRequest, FormUpdateOptions, GuidedActionExecutionRequest, GuidedActionExecutionResult, GuidedBranchAction, GuidedBranchDestination, GuidedBranchTrigger, GuidedFormSettings, JobTargetedFormSelection, JobTargetingSettings, SubmissionAutomationRule, SubmissionAutomationSettings, SubmissionConditionOperator } from "./types/form";
16
+ import FormSubmission, { FormSubmissionStatus, SubmissionApproval, SubmissionApprovalReviewRequest } from "./types/formSubmission";
17
17
  import FormSettings, { FormSettingsSaveRequest } from "./types/formSettings";
18
18
  import ResultsWrapper from "./types/resultsWrapper";
19
19
  import { JobListing, JobListingSaveResult, JobStatus } from "./types/JobListing";
@@ -33,7 +33,9 @@ import RecruiterDto from "./types/recruiter";
33
33
  import FocalPoint from "./types/focalPoint";
34
34
  import ListingEntityMedia from "./types/listingEntityMedia";
35
35
  import CompletionRequest, { CompletionResponse } from "./types/completionRequest";
36
- import SearchReadConfig from "./types/searchReadConfig";
36
+ import type SearchReadConfig from "./types/searchReadConfig";
37
+ import type IntegrationConfig from "./types/integrationConfig";
38
+ import { IntegrationType } from "./types/integrationConfig";
37
39
  import { BLOCK_KEYS, BLOCK_KEY_ALIASES, FIELD_TYPES, type BlockKey, type FieldType } from "./constants/cms";
38
40
  export declare const auth: {
39
41
  login: (clientLogInRequest: import("./types/clientLoginRequest").default) => Promise<any>;
@@ -84,6 +86,10 @@ export declare const clientAuthConfig: {
84
86
  delete: (id: string, authToken?: string | null) => Promise<void>;
85
87
  };
86
88
  export declare const integrationConfig: {
89
+ getAll: (authToken?: string | null) => Promise<IntegrationConfig[]>;
90
+ create: (config: IntegrationConfig, authToken?: string | null) => Promise<IntegrationConfig>;
91
+ update: (id: string, config: IntegrationConfig, authToken?: string | null) => Promise<IntegrationConfig>;
92
+ delete: (id: string, authToken?: string | null) => Promise<void>;
87
93
  getSearchRead: (authToken?: string | null) => Promise<SearchReadConfig | null>;
88
94
  };
89
95
  export declare const media: {
@@ -165,7 +171,7 @@ export declare const listingEntities: {
165
171
  export declare const recruiters: {
166
172
  get: (recruiterIds?: number[] | null, authToken?: string | null) => Promise<Record<string, RecruiterDto>>;
167
173
  getAll: (authToken?: string | null) => Promise<RecruiterDto>;
168
- sync: (authToken?: string | null) => Promise<void>;
174
+ sync: (authToken?: string | null, updateExisting?: boolean) => Promise<void>;
169
175
  };
170
176
  export declare const permissions: {
171
177
  get: (authToken?: string | null) => Promise<string[]>;
@@ -248,6 +254,8 @@ export declare const forms: {
248
254
  migrateSubmissionFields(id: string, migrationRequest: FormFieldMigrationRequest, authToken?: string | null): Promise<number>;
249
255
  deleteForm(id: string, authToken?: string | null): Promise<void>;
250
256
  processFormRequest(formRequest: string, authToken?: string | null): Promise<string>;
257
+ getEasyApplySelection(jobId: string, fallbackFormId?: string, authToken?: string | null): Promise<JobTargetedFormSelection>;
258
+ executeGuidedAction(formId: string, request: GuidedActionExecutionRequest, authToken?: string | null): Promise<GuidedActionExecutionResult>;
251
259
  };
252
260
  export declare const formSettings: {
253
261
  get: (authToken?: string | null) => Promise<FormSettings>;
@@ -260,11 +268,12 @@ export declare const formSubmissions: {
260
268
  exportFormSubmissionsCsv: (pageSize?: number, pageNumber?: number, type?: string | null, status?: FormSubmissionStatus | null, from?: Date | null, to?: Date | null, columns?: string[] | null, authToken?: string | null) => Promise<void>;
261
269
  getFormSubmissionTypes: (authToken?: string | null) => Promise<string[]>;
262
270
  deleteFormSubmission: (id: string, authToken?: string | null) => Promise<void>;
271
+ reviewSubmissionApproval: (id: string, request: SubmissionApprovalReviewRequest, authToken?: string | null) => Promise<FormSubmission>;
263
272
  };
264
273
  export { BLOCK_KEYS, BLOCK_KEY_ALIASES, FIELD_TYPES };
265
- export type { Register, User, Role, HireControlConfig, JobListingEditorConfig, ThemeSystemConfig, ThemeSemanticToken, ThemeScaleToken, ClientAuthConfig, Event, Listing, EventDates, EventDateType, EventInstance, MediaType, Filters, AppendListing, Form, FormFieldMigrationRequest, FormUpdateOptions, FormSubmission, FormSettings, FormSettingsSaveRequest, 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, JobListingSettingsSaveRequest, ListingEntityDto, RecruiterDto, FocalPoint, ListingEntityMedia, CompletionRequest, CompletionResponse, SearchReadConfig, };
266
- export type { BlockKey, FieldType };
267
- export { EventType, CallToActionType, FormSubmissionStatus, FeedHandlingOption, JobStatus, };
274
+ export type { Register, User, Role, HireControlConfig, JobListingEditorConfig, ThemeSystemConfig, ThemeSemanticToken, ThemeScaleToken, ClientAuthConfig, Event, Listing, EventDates, EventDateType, EventInstance, MediaType, Filters, AppendListing, Form, EasyApplyForm, FormExperienceType, FormFieldMigrationRequest, FormUpdateOptions, GuidedActionExecutionRequest, GuidedActionExecutionResult, GuidedBranchAction, GuidedBranchDestination, GuidedBranchTrigger, GuidedFormSettings, JobTargetedFormSelection, JobTargetingSettings, SubmissionAutomationRule, SubmissionAutomationSettings, SubmissionConditionOperator, FormSubmission, SubmissionApproval, SubmissionApprovalReviewRequest, FormSettings, FormSettingsSaveRequest, 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, JobListingSettingsSaveRequest, ListingEntityDto, RecruiterDto, FocalPoint, ListingEntityMedia, CompletionRequest, CompletionResponse, };
275
+ export type { BlockKey, FieldType, SearchReadConfig, IntegrationConfig };
276
+ export { EventType, CallToActionType, FormSubmissionStatus, FeedHandlingOption, JobStatus, IntegrationType, };
268
277
  declare const hcApi: {
269
278
  auth: {
270
279
  login: (clientLogInRequest: import("./types/clientLoginRequest").default) => Promise<any>;
@@ -317,6 +326,10 @@ declare const hcApi: {
317
326
  delete: (id: string, authToken?: string | null) => Promise<void>;
318
327
  };
319
328
  integrationConfig: {
329
+ getAll: (authToken?: string | null) => Promise<IntegrationConfig[]>;
330
+ create: (config: IntegrationConfig, authToken?: string | null) => Promise<IntegrationConfig>;
331
+ update: (id: string, config: IntegrationConfig, authToken?: string | null) => Promise<IntegrationConfig>;
332
+ delete: (id: string, authToken?: string | null) => Promise<void>;
320
333
  getSearchRead: (authToken?: string | null) => Promise<SearchReadConfig | null>;
321
334
  };
322
335
  filters: {
@@ -399,7 +412,7 @@ declare const hcApi: {
399
412
  recruiters: {
400
413
  get: (recruiterIds?: number[] | null, authToken?: string | null) => Promise<Record<string, RecruiterDto>>;
401
414
  getAll: (authToken?: string | null) => Promise<RecruiterDto>;
402
- sync: (authToken?: string | null) => Promise<void>;
415
+ sync: (authToken?: string | null, updateExisting?: boolean) => Promise<void>;
403
416
  };
404
417
  forms: {
405
418
  getForms(authToken?: string | null): Promise<Form[]>;
@@ -412,6 +425,8 @@ declare const hcApi: {
412
425
  migrateSubmissionFields(id: string, migrationRequest: FormFieldMigrationRequest, authToken?: string | null): Promise<number>;
413
426
  deleteForm(id: string, authToken?: string | null): Promise<void>;
414
427
  processFormRequest(formRequest: string, authToken?: string | null): Promise<string>;
428
+ getEasyApplySelection(jobId: string, fallbackFormId?: string, authToken?: string | null): Promise<JobTargetedFormSelection>;
429
+ executeGuidedAction(formId: string, request: GuidedActionExecutionRequest, authToken?: string | null): Promise<GuidedActionExecutionResult>;
415
430
  };
416
431
  formSettings: {
417
432
  get: (authToken?: string | null) => Promise<FormSettings>;
@@ -424,6 +439,7 @@ declare const hcApi: {
424
439
  exportFormSubmissionsCsv: (pageSize?: number, pageNumber?: number, type?: string | null, status?: FormSubmissionStatus | null, from?: Date | null, to?: Date | null, columns?: string[] | null, authToken?: string | null) => Promise<void>;
425
440
  getFormSubmissionTypes: (authToken?: string | null) => Promise<string[]>;
426
441
  deleteFormSubmission: (id: string, authToken?: string | null) => Promise<void>;
442
+ reviewSubmissionApproval: (id: string, request: SubmissionApprovalReviewRequest, authToken?: string | null) => Promise<FormSubmission>;
427
443
  };
428
444
  openAI: {
429
445
  getCompletion: (request: CompletionRequest, authToken?: string | null) => Promise<CompletionResponse>;
@@ -4,7 +4,65 @@ interface IntegrationSettings {
4
4
  webhooks?: FormWebhook[];
5
5
  }
6
6
  interface FormWebhook {
7
+ id?: string;
8
+ name?: string;
7
9
  url: string;
10
+ isApproved?: boolean;
11
+ }
12
+ export type FormExperienceType = "guided-v1";
13
+ export interface GuidedBranchTrigger {
14
+ type: "page-transition" | "answer-condition";
15
+ fromPageName?: string;
16
+ toPageName?: string;
17
+ fieldName?: string;
18
+ operator?: "equals" | "not-equals";
19
+ value?: string;
20
+ }
21
+ export interface GuidedBranchDestination {
22
+ type: "notification" | "webhook";
23
+ recipientIds?: string[];
24
+ webhookId?: string;
25
+ }
26
+ export interface GuidedBranchAction {
27
+ id: string;
28
+ name: string;
29
+ enabled: boolean;
30
+ trigger: GuidedBranchTrigger;
31
+ destination: GuidedBranchDestination;
32
+ subject?: string;
33
+ message?: string;
34
+ }
35
+ export interface GuidedFormSettings {
36
+ version: 1;
37
+ branchActions: GuidedBranchAction[];
38
+ }
39
+ export interface JobTargetingSettings {
40
+ enabled: boolean;
41
+ priority: number;
42
+ jobFilterIds: string[];
43
+ }
44
+ export type SubmissionConditionOperator = "equals" | "not-equals" | "in" | "not-in";
45
+ export interface SubmissionAutomationRule {
46
+ id: string;
47
+ name: string;
48
+ enabled: boolean;
49
+ trigger: {
50
+ type: "submit-condition";
51
+ fieldName: string;
52
+ operator: SubmissionConditionOperator;
53
+ value?: string;
54
+ values: string[];
55
+ };
56
+ action: {
57
+ type: "require-approval";
58
+ approverUserIds: string[];
59
+ notificationSubject?: string;
60
+ notificationMessage?: string;
61
+ };
62
+ }
63
+ export interface SubmissionAutomationSettings {
64
+ version: 1;
65
+ rules: SubmissionAutomationRule[];
8
66
  }
9
67
  interface FormSettings {
10
68
  useRecruiterFromJob: boolean;
@@ -18,6 +76,9 @@ interface FormSettings {
18
76
  confirmationEmailSubject?: string;
19
77
  confirmationEmailPreviewText?: string;
20
78
  confirmationEmailBody?: string;
79
+ guided?: GuidedFormSettings;
80
+ jobTargeting?: JobTargetingSettings;
81
+ submissionAutomations?: SubmissionAutomationSettings;
21
82
  }
22
83
  interface Form {
23
84
  id: string;
@@ -38,9 +99,41 @@ interface Form {
38
99
  };
39
100
  jsonSchema?: string;
40
101
  type: string;
102
+ experienceType?: FormExperienceType;
41
103
  formUsage: FormUsage[];
42
104
  settings?: FormSettings;
43
105
  }
106
+ export interface GuidedActionExecutionRequest {
107
+ sessionId: string;
108
+ actionId: string;
109
+ fromPageName?: string;
110
+ toPageName?: string;
111
+ answers: Record<string, unknown>;
112
+ }
113
+ export interface GuidedActionExecutionResult {
114
+ executed: boolean;
115
+ duplicate: boolean;
116
+ status: string;
117
+ }
118
+ export interface JobTargetedFormSelection {
119
+ form?: EasyApplyForm;
120
+ source: "targeted" | "default" | "existing-default";
121
+ priority?: number;
122
+ matchedFilterId?: string;
123
+ }
124
+ export interface EasyApplyForm {
125
+ id: string;
126
+ name?: string;
127
+ jsonSchema?: string;
128
+ type?: string;
129
+ experienceType?: FormExperienceType;
130
+ successTitle?: string;
131
+ successMessage?: string;
132
+ guided?: {
133
+ version: 1;
134
+ branchActions: Array<Pick<GuidedBranchAction, "id" | "name" | "enabled" | "trigger">>;
135
+ };
136
+ }
44
137
  interface FormUpdateOptions {
45
138
  fieldRenames?: Record<string, string>;
46
139
  applyFieldRenamesToSubmissions?: boolean;
@@ -11,6 +11,28 @@ type FormSubmission = {
11
11
  deletedAt?: string;
12
12
  formFields?: Record<string, string>;
13
13
  snapshotJobData?: Record<string, any>;
14
+ approval?: SubmissionApproval;
15
+ };
16
+ export type SubmissionApproval = {
17
+ ruleId: string;
18
+ ruleName: string;
19
+ approverUserIds: string[];
20
+ notificationSubject?: string;
21
+ notificationMessage?: string;
22
+ requestedAt: string;
23
+ notificationStatus: "pending" | "processing" | "sent" | "failed";
24
+ notificationAttempts: number;
25
+ notificationSentAt?: string;
26
+ notificationLastError?: string;
27
+ decision?: "approve" | "deny";
28
+ reviewedByUserId?: string;
29
+ reviewedByName?: string;
30
+ reviewedAt?: string;
31
+ reviewNote?: string;
32
+ };
33
+ export type SubmissionApprovalReviewRequest = {
34
+ decision: "approve" | "deny";
35
+ note?: string;
14
36
  };
15
37
  export declare enum FormSubmissionStatus {
16
38
  Submitted = 1,
@@ -18,6 +40,7 @@ export declare enum FormSubmissionStatus {
18
40
  Rejected = 3,
19
41
  Sent = 4,
20
42
  Failed = 5,
21
- Blacklisted = 6
43
+ Blacklisted = 6,
44
+ PendingApproval = 7
22
45
  }
23
46
  export default FormSubmission;
@@ -0,0 +1,19 @@
1
+ export declare enum IntegrationType {
2
+ Custom = 0,
3
+ SearchWrite = 1,
4
+ SearchRead = 2,
5
+ ExternalSync = 3
6
+ }
7
+ type IntegrationConfig = {
8
+ id?: string;
9
+ companyId?: string;
10
+ type: IntegrationType | keyof typeof IntegrationType | string;
11
+ provider: string;
12
+ title: string;
13
+ enabled: boolean;
14
+ createdAt?: string;
15
+ updatedAt?: string;
16
+ settings: Record<string, string>;
17
+ secrets: Record<string, string>;
18
+ };
19
+ export default IntegrationConfig;
@@ -13,6 +13,7 @@ export type JobFeed = {
13
13
  format?: string;
14
14
  lambdaFunctionName?: string;
15
15
  active: boolean;
16
+ entityKeyIsAuthoritative?: boolean;
16
17
  lastSyncAt?: string;
17
18
  lastSyncStatus?: string;
18
19
  jobCount: number;
@@ -1,4 +1,5 @@
1
1
  type User = {
2
+ userId?: string;
2
3
  firstName: string;
3
4
  lastName: string;
4
5
  email: string;
package/index.ts CHANGED
@@ -58,13 +58,34 @@ import { Listing } from "./types/listing";
58
58
  import Filters from "./types/filters/filters";
59
59
  import AppendListing from "./types/appendListing";
60
60
  import Form, {
61
+ FormExperienceType,
62
+ EasyApplyForm,
61
63
  FormFieldMigrationRequest,
62
64
  FormUpdateOptions,
65
+ GuidedActionExecutionRequest,
66
+ GuidedActionExecutionResult,
67
+ GuidedBranchAction,
68
+ GuidedBranchDestination,
69
+ GuidedBranchTrigger,
70
+ GuidedFormSettings,
71
+ JobTargetedFormSelection,
72
+ JobTargetingSettings,
73
+ SubmissionAutomationRule,
74
+ SubmissionAutomationSettings,
75
+ SubmissionConditionOperator,
63
76
  } from "./types/form";
64
- import FormSubmission, { FormSubmissionStatus } from "./types/formSubmission";
77
+ import FormSubmission, {
78
+ FormSubmissionStatus,
79
+ SubmissionApproval,
80
+ SubmissionApprovalReviewRequest,
81
+ } from "./types/formSubmission";
65
82
  import FormSettings, { FormSettingsSaveRequest } from "./types/formSettings";
66
83
  import ResultsWrapper from "./types/resultsWrapper";
67
- import { JobListing, JobListingSaveResult, JobStatus } from "./types/JobListing";
84
+ import {
85
+ JobListing,
86
+ JobListingSaveResult,
87
+ JobStatus,
88
+ } from "./types/JobListing";
68
89
  import FieldTypeDefinition from "./types/content/fieldDefinition";
69
90
  import ValidatorDefinition from "./types/content/validatorDefinition";
70
91
  import ContentModel, {
@@ -107,7 +128,9 @@ import ListingEntityMedia from "./types/listingEntityMedia";
107
128
  import CompletionRequest, {
108
129
  CompletionResponse,
109
130
  } from "./types/completionRequest";
110
- import SearchReadConfig from "./types/searchReadConfig";
131
+ import type SearchReadConfig from "./types/searchReadConfig";
132
+ import type IntegrationConfig from "./types/integrationConfig";
133
+ import { IntegrationType } from "./types/integrationConfig";
111
134
  import {
112
135
  BLOCK_KEYS,
113
136
  BLOCK_KEY_ALIASES,
@@ -172,6 +195,10 @@ export const clientAuthConfig = {
172
195
  };
173
196
 
174
197
  export const integrationConfig = {
198
+ getAll: integrationConfigController.getAll,
199
+ create: integrationConfigController.create,
200
+ update: integrationConfigController.update,
201
+ delete: integrationConfigController.delete,
175
202
  getSearchRead: integrationConfigController.getSearchReadConfig,
176
203
  };
177
204
 
@@ -349,6 +376,7 @@ export const formSubmissions = {
349
376
  exportFormSubmissionsCsv: formSubmissionController.exportFormSubmissionsCsv,
350
377
  getFormSubmissionTypes: formSubmissionController.getFormSubmissionTypes,
351
378
  deleteFormSubmission: formSubmissionController.deleteFormSubmission,
379
+ reviewSubmissionApproval: formSubmissionController.reviewSubmissionApproval,
352
380
  };
353
381
  export { BLOCK_KEYS, BLOCK_KEY_ALIASES, FIELD_TYPES };
354
382
  //types
@@ -371,9 +399,24 @@ export type {
371
399
  Filters,
372
400
  AppendListing,
373
401
  Form,
402
+ EasyApplyForm,
403
+ FormExperienceType,
374
404
  FormFieldMigrationRequest,
375
405
  FormUpdateOptions,
406
+ GuidedActionExecutionRequest,
407
+ GuidedActionExecutionResult,
408
+ GuidedBranchAction,
409
+ GuidedBranchDestination,
410
+ GuidedBranchTrigger,
411
+ GuidedFormSettings,
412
+ JobTargetedFormSelection,
413
+ JobTargetingSettings,
414
+ SubmissionAutomationRule,
415
+ SubmissionAutomationSettings,
416
+ SubmissionConditionOperator,
376
417
  FormSubmission,
418
+ SubmissionApproval,
419
+ SubmissionApprovalReviewRequest,
377
420
  FormSettings,
378
421
  FormSettingsSaveRequest,
379
422
  ResultsWrapper,
@@ -414,9 +457,8 @@ export type {
414
457
  ListingEntityMedia,
415
458
  CompletionRequest,
416
459
  CompletionResponse,
417
- SearchReadConfig,
418
460
  };
419
- export type { BlockKey, FieldType };
461
+ export type { BlockKey, FieldType, SearchReadConfig, IntegrationConfig };
420
462
 
421
463
  export {
422
464
  EventType,
@@ -424,6 +466,7 @@ export {
424
466
  FormSubmissionStatus,
425
467
  FeedHandlingOption,
426
468
  JobStatus,
469
+ IntegrationType,
427
470
  };
428
471
 
429
472
  const hcApi = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abcagency/hire-control-sdk",
3
- "version": "1.1.25",
3
+ "version": "1.1.27",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",
package/types/form.ts CHANGED
@@ -9,7 +9,78 @@ interface IntegrationSettings {
9
9
  }
10
10
 
11
11
  interface FormWebhook {
12
+ id?: string;
13
+ name?: string;
12
14
  url: string;
15
+ isApproved?: boolean;
16
+ }
17
+
18
+ export type FormExperienceType = "guided-v1";
19
+
20
+ export interface GuidedBranchTrigger {
21
+ type: "page-transition" | "answer-condition";
22
+ fromPageName?: string;
23
+ toPageName?: string;
24
+ fieldName?: string;
25
+ operator?: "equals" | "not-equals";
26
+ value?: string;
27
+ }
28
+
29
+ export interface GuidedBranchDestination {
30
+ type: "notification" | "webhook";
31
+ recipientIds?: string[];
32
+ webhookId?: string;
33
+ }
34
+
35
+ export interface GuidedBranchAction {
36
+ id: string;
37
+ name: string;
38
+ enabled: boolean;
39
+ trigger: GuidedBranchTrigger;
40
+ destination: GuidedBranchDestination;
41
+ subject?: string;
42
+ message?: string;
43
+ }
44
+
45
+ export interface GuidedFormSettings {
46
+ version: 1;
47
+ branchActions: GuidedBranchAction[];
48
+ }
49
+
50
+ export interface JobTargetingSettings {
51
+ enabled: boolean;
52
+ priority: number;
53
+ jobFilterIds: string[];
54
+ }
55
+
56
+ export type SubmissionConditionOperator =
57
+ | "equals"
58
+ | "not-equals"
59
+ | "in"
60
+ | "not-in";
61
+
62
+ export interface SubmissionAutomationRule {
63
+ id: string;
64
+ name: string;
65
+ enabled: boolean;
66
+ trigger: {
67
+ type: "submit-condition";
68
+ fieldName: string;
69
+ operator: SubmissionConditionOperator;
70
+ value?: string;
71
+ values: string[];
72
+ };
73
+ action: {
74
+ type: "require-approval";
75
+ approverUserIds: string[];
76
+ notificationSubject?: string;
77
+ notificationMessage?: string;
78
+ };
79
+ }
80
+
81
+ export interface SubmissionAutomationSettings {
82
+ version: 1;
83
+ rules: SubmissionAutomationRule[];
13
84
  }
14
85
 
15
86
  interface FormSettings {
@@ -24,6 +95,9 @@ interface FormSettings {
24
95
  confirmationEmailSubject?: string;
25
96
  confirmationEmailPreviewText?: string;
26
97
  confirmationEmailBody?: string;
98
+ guided?: GuidedFormSettings;
99
+ jobTargeting?: JobTargetingSettings;
100
+ submissionAutomations?: SubmissionAutomationSettings;
27
101
  }
28
102
 
29
103
  interface Form {
@@ -45,10 +119,48 @@ interface Form {
45
119
  };
46
120
  jsonSchema?: string;
47
121
  type: string;
122
+ experienceType?: FormExperienceType;
48
123
  formUsage: FormUsage[];
49
124
  settings?: FormSettings;
50
125
  }
51
126
 
127
+ export interface GuidedActionExecutionRequest {
128
+ sessionId: string;
129
+ actionId: string;
130
+ fromPageName?: string;
131
+ toPageName?: string;
132
+ answers: Record<string, unknown>;
133
+ }
134
+
135
+ export interface GuidedActionExecutionResult {
136
+ executed: boolean;
137
+ duplicate: boolean;
138
+ status: string;
139
+ }
140
+
141
+ export interface JobTargetedFormSelection {
142
+ form?: EasyApplyForm;
143
+ source: "targeted" | "default" | "existing-default";
144
+ priority?: number;
145
+ matchedFilterId?: string;
146
+ }
147
+
148
+ export interface EasyApplyForm {
149
+ id: string;
150
+ name?: string;
151
+ jsonSchema?: string;
152
+ type?: string;
153
+ experienceType?: FormExperienceType;
154
+ successTitle?: string;
155
+ successMessage?: string;
156
+ guided?: {
157
+ version: 1;
158
+ branchActions: Array<
159
+ Pick<GuidedBranchAction, "id" | "name" | "enabled" | "trigger">
160
+ >;
161
+ };
162
+ }
163
+
52
164
  interface FormUpdateOptions {
53
165
  fieldRenames?: Record<string, string>;
54
166
  applyFieldRenamesToSubmissions?: boolean;
@@ -11,6 +11,30 @@ type FormSubmission = {
11
11
  deletedAt?: string;
12
12
  formFields?: Record<string, string>;
13
13
  snapshotJobData?: Record<string, any>;
14
+ approval?: SubmissionApproval;
15
+ };
16
+
17
+ export type SubmissionApproval = {
18
+ ruleId: string;
19
+ ruleName: string;
20
+ approverUserIds: string[];
21
+ notificationSubject?: string;
22
+ notificationMessage?: string;
23
+ requestedAt: string;
24
+ notificationStatus: "pending" | "processing" | "sent" | "failed";
25
+ notificationAttempts: number;
26
+ notificationSentAt?: string;
27
+ notificationLastError?: string;
28
+ decision?: "approve" | "deny";
29
+ reviewedByUserId?: string;
30
+ reviewedByName?: string;
31
+ reviewedAt?: string;
32
+ reviewNote?: string;
33
+ };
34
+
35
+ export type SubmissionApprovalReviewRequest = {
36
+ decision: "approve" | "deny";
37
+ note?: string;
14
38
  };
15
39
 
16
40
  export enum FormSubmissionStatus {
@@ -20,6 +44,7 @@ export enum FormSubmissionStatus {
20
44
  Sent = 4,
21
45
  Failed = 5,
22
46
  Blacklisted = 6,
47
+ PendingApproval = 7,
23
48
  }
24
49
 
25
50
  export default FormSubmission;
@@ -0,0 +1,21 @@
1
+ export enum IntegrationType {
2
+ Custom = 0,
3
+ SearchWrite = 1,
4
+ SearchRead = 2,
5
+ ExternalSync = 3,
6
+ }
7
+
8
+ type IntegrationConfig = {
9
+ id?: string;
10
+ companyId?: string;
11
+ type: IntegrationType | keyof typeof IntegrationType | string;
12
+ provider: string;
13
+ title: string;
14
+ enabled: boolean;
15
+ createdAt?: string;
16
+ updatedAt?: string;
17
+ settings: Record<string, string>;
18
+ secrets: Record<string, string>;
19
+ };
20
+
21
+ export default IntegrationConfig;
package/types/jobFeed.ts CHANGED
@@ -14,6 +14,7 @@ export type JobFeed = {
14
14
  format?: string;
15
15
  lambdaFunctionName?: string;
16
16
  active: boolean;
17
+ entityKeyIsAuthoritative?: boolean;
17
18
  lastSyncAt?: string;
18
19
  lastSyncStatus?: string;
19
20
  jobCount: number;
package/types/user.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  type User = {
2
+ userId?: string;
2
3
  firstName: string;
3
4
  lastName: string;
4
5
  email: string;