@abcagency/hire-control-sdk 1.0.60 → 1.0.62

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,14 +1,18 @@
1
1
  import FetchHandler from "../handlers/fetchHandler";
2
- import { JobListing } from "../types/JobListing";
2
+ import { type JobListing } from "../types/JobListing";
3
3
  import { API_URL } from "../constants/config";
4
4
 
5
5
  const fetchHandler = new FetchHandler(API_URL);
6
6
 
7
+ /**
8
+ * Controller for handling job listing API requests.
9
+ */
7
10
  class JobListingsController {
8
11
  /**
12
+ * [GET /joblistings]
9
13
  * Get all job listings for the authenticated user's company.
10
- * @param {string | null} authToken - Optional auth token.
11
- * @returns {Promise<JobListing[]>} - A list of job listings.
14
+ * @param authToken - The authentication token.
15
+ * @returns A promise that resolves to a list of job listings.
12
16
  */
13
17
  async getJobListingsByCompany(
14
18
  authToken: string | null = null
@@ -17,10 +21,23 @@ class JobListingsController {
17
21
  }
18
22
 
19
23
  /**
20
- * Get a specific job listing by ID.
21
- * @param {string} id - The job listing ID.
22
- * @param {string | null} authToken - Optional auth token.
23
- * @returns {Promise<JobListing>} - The job listing data.
24
+ * [GET /joblistings/MapListings]
25
+ * Get all map-optimized job listings for the authenticated user's company.
26
+ * @param authToken - The authentication token.
27
+ * @returns A promise that resolves to a list of map job listings.
28
+ */
29
+ async getMapJobListingsByCompany(
30
+ authToken: string | null = null
31
+ ): Promise<any[]> {
32
+ return fetchHandler.get<any[]>("/joblistings/MapListings", true, authToken);
33
+ }
34
+
35
+ /**
36
+ * [GET /joblistings/{id}]
37
+ * Get a specific job listing by its ID.
38
+ * @param id - The job listing ID.
39
+ * @param authToken - The authentication token.
40
+ * @returns A promise that resolves to the job listing data.
24
41
  */
25
42
  async getJobListingById(
26
43
  id: string,
@@ -30,10 +47,29 @@ class JobListingsController {
30
47
  }
31
48
 
32
49
  /**
50
+ * [GET /joblistings/MapListings/{id}]
51
+ * Get a specific map-optimized job listing by its unique ID.
52
+ * @param id - The unique job listing ID.
53
+ * @param authToken - The authentication token.
54
+ * @returns A promise that resolves to the map job listing data.
55
+ */
56
+ async getMapListingById(
57
+ id: string,
58
+ authToken: string | null = null
59
+ ): Promise<any> {
60
+ return fetchHandler.get<any>(
61
+ `/joblistings/MapListings/${id}`,
62
+ true,
63
+ authToken
64
+ );
65
+ }
66
+
67
+ /**
68
+ * [POST /joblistings]
33
69
  * Create a new job listing.
34
- * @param {JobListing} jobListing - The job listing data to create.
35
- * @param {string | null} authToken - Optional auth token.
36
- * @returns {Promise<JobListing>} - The newly created job listing data.
70
+ * @param jobListing - The job listing data to create.
71
+ * @param authToken - The authentication token.
72
+ * @returns A promise that resolves to the newly created job listing data.
37
73
  */
38
74
  async createJobListing(
39
75
  jobListing: JobListing,
@@ -48,11 +84,12 @@ class JobListingsController {
48
84
  }
49
85
 
50
86
  /**
87
+ * [PUT /joblistings/{id}]
51
88
  * Update an existing job listing.
52
- * @param {string} id - The job listing ID to update.
53
- * @param {JobListing} jobListing - The updated job listing data.
54
- * @param {string | null} authToken - Optional auth token.
55
- * @returns {Promise<void>} - No return value.
89
+ * @param id - The ID of the job listing to update.
90
+ * @param jobListing - The updated job listing data.
91
+ * @param authToken - The authentication token.
92
+ * @returns A promise that resolves when the operation is complete.
56
93
  */
57
94
  async updateJobListing(
58
95
  id: string,
@@ -68,10 +105,11 @@ class JobListingsController {
68
105
  }
69
106
 
70
107
  /**
108
+ * [DELETE /joblistings/{id}]
71
109
  * Delete an existing job listing.
72
- * @param {string} id - The job listing ID to delete.
73
- * @param {string | null} authToken - Optional auth token.
74
- * @returns {Promise<void>} - No return value.
110
+ * @param id - The ID of the job listing to delete.
111
+ * @param authToken - The authentication token.
112
+ * @returns A promise that resolves when the operation is complete.
75
113
  */
76
114
  async deleteJobListing(
77
115
  id: string,
@@ -1,29 +1,52 @@
1
1
  import FetchHandler from "../handlers/fetchHandler";
2
2
  import { API_URL } from "../constants/config";
3
- import ListingEntityDto from "../types/listingEntity";
4
- import mongoListingEntity from "../types/mongoListingEntity";
3
+ import { type ListingEntityDto } from "../types/listingEntity";
4
+ import { type mongoListingEntity } from "../types/mongoListingEntity";
5
5
 
6
6
  const fetchHandler = new FetchHandler(API_URL);
7
7
 
8
+ /**
9
+ * Controller for handling listing entity API requests.
10
+ */
8
11
  class ListingEntitiesController {
9
- // Get Listing Entities (SQL based)
10
- async getAllSql(
12
+ /**
13
+ * [POST /listingEntities]
14
+ * Get SQL-based listing entities by their IDs.
15
+ * @param ids - An array of entity IDs.
16
+ * @param origin - Optional origin string for tracking.
17
+ * @param authToken - The authentication token.
18
+ * @returns A promise that resolves to a dictionary mapping entity IDs to their data.
19
+ */
20
+
21
+ async getSqlListingEntitiesByIds(
11
22
  ids: number[],
12
23
  origin: string | null = null,
13
24
  authToken: string | null = null
14
25
  ): Promise<Record<string, ListingEntityDto>> {
15
26
  const params = new URLSearchParams();
16
- if (origin) params.append("origin", origin);
27
+ if (origin) {
28
+ params.append("origin", origin);
29
+ }
30
+ const endpoint = `/listingEntities${
31
+ params.toString() ? "?" + params.toString() : ""
32
+ }`;
17
33
  return fetchHandler.post<number[], Record<string, ListingEntityDto>>(
18
- `/listingEntities${params.toString() ? "?" + params.toString() : ""}`,
34
+ endpoint,
19
35
  ids,
20
36
  true,
21
37
  authToken
22
38
  );
23
39
  }
24
40
 
25
- // Get all Mongo Listing Entities
26
- async getAll(authToken: string | null = null): Promise<mongoListingEntity[]> {
41
+ /**
42
+ * [GET /listingEntities]
43
+ * Get all Mongo-based listing entities for the user's company.
44
+ * @param authToken - The authentication token.
45
+ * @returns A promise that resolves to a list of Mongo listing entities.
46
+ */
47
+ async getAllMongoListingEntities(
48
+ authToken: string | null = null
49
+ ): Promise<mongoListingEntity[]> {
27
50
  return fetchHandler.get<mongoListingEntity[]>(
28
51
  `/listingEntities`,
29
52
  true,
@@ -31,7 +54,38 @@ class ListingEntitiesController {
31
54
  );
32
55
  }
33
56
 
34
- // Create Mongo Listing Entity
57
+ /**
58
+ * [GET /listingEntities/MapEntities]
59
+ * Get all Mongo-based listing entities, formatted as a dictionary for map use.
60
+ * @param origin - Optional origin string for tracking.
61
+ * @param authToken - The authentication token.
62
+ * @returns A promise that resolves to a dictionary mapping entity keys to their data.
63
+ */
64
+ async getMapListingEntities(
65
+ origin: string | null = null,
66
+ authToken: string | null = null
67
+ ): Promise<Record<string, mongoListingEntity>> {
68
+ const params = new URLSearchParams();
69
+ if (origin) {
70
+ params.append("origin", origin);
71
+ }
72
+ const endpoint = `/listingEntities/MapEntities${
73
+ params.toString() ? "?" + params.toString() : ""
74
+ }`;
75
+ return fetchHandler.get<Record<string, mongoListingEntity>>(
76
+ endpoint,
77
+ true,
78
+ authToken
79
+ );
80
+ }
81
+
82
+ /**
83
+ * [POST /listingEntities/create]
84
+ * Create a new Mongo listing entity.
85
+ * @param entity - The entity data to create.
86
+ * @param authToken - The authentication token.
87
+ * @returns A promise that resolves to the newly created entity.
88
+ */
35
89
  async create(
36
90
  entity: mongoListingEntity,
37
91
  authToken: string | null = null
@@ -44,19 +98,37 @@ class ListingEntitiesController {
44
98
  );
45
99
  }
46
100
 
47
- // Update Mongo Listing Entity
101
+ /**
102
+ * [PUT /listingEntities/update/{id}]
103
+ * Update an existing Mongo listing entity.
104
+ * @param id - The ID of the entity to update.
105
+ * @param entity - The updated entity data.
106
+ * @param authToken - The authentication token.
107
+ * @returns A promise that resolves to the updated entity.
108
+ */
48
109
  async update(
49
110
  id: string,
50
111
  entity: mongoListingEntity,
51
112
  authToken: string | null = null
52
- ): Promise<void> {
53
- await fetchHandler.put<mongoListingEntity, void>(
113
+ ): Promise<mongoListingEntity> {
114
+ return fetchHandler.put<mongoListingEntity, mongoListingEntity>(
54
115
  `/listingEntities/update/${id}`,
55
116
  entity,
56
117
  true,
57
118
  authToken
58
119
  );
59
120
  }
121
+
122
+ /**
123
+ * [DELETE /listingEntities/{id}]
124
+ * Delete a Mongo listing entity.
125
+ * @param id - The ID of the entity to delete.
126
+ * @param authToken - The authentication token.
127
+ * @returns A promise that resolves when the deletion is complete.
128
+ */
129
+ async delete(id: string, authToken: string | null = null): Promise<void> {
130
+ await fetchHandler.delete<void>(`/listingEntities/${id}`, true, authToken);
131
+ }
60
132
  }
61
133
 
62
134
  export default new ListingEntitiesController();
@@ -1,38 +1,61 @@
1
- import { JobListing } from "../types/JobListing";
1
+ import { type JobListing } from "../types/JobListing";
2
+ /**
3
+ * Controller for handling job listing API requests.
4
+ */
2
5
  declare class JobListingsController {
3
6
  /**
7
+ * [GET /joblistings]
4
8
  * Get all job listings for the authenticated user's company.
5
- * @param {string | null} authToken - Optional auth token.
6
- * @returns {Promise<JobListing[]>} - A list of job listings.
9
+ * @param authToken - The authentication token.
10
+ * @returns A promise that resolves to a list of job listings.
7
11
  */
8
12
  getJobListingsByCompany(authToken?: string | null): Promise<JobListing[]>;
9
13
  /**
10
- * Get a specific job listing by ID.
11
- * @param {string} id - The job listing ID.
12
- * @param {string | null} authToken - Optional auth token.
13
- * @returns {Promise<JobListing>} - The job listing data.
14
+ * [GET /joblistings/MapListings]
15
+ * Get all map-optimized job listings for the authenticated user's company.
16
+ * @param authToken - The authentication token.
17
+ * @returns A promise that resolves to a list of map job listings.
18
+ */
19
+ getMapJobListingsByCompany(authToken?: string | null): Promise<any[]>;
20
+ /**
21
+ * [GET /joblistings/{id}]
22
+ * Get a specific job listing by its ID.
23
+ * @param id - The job listing ID.
24
+ * @param authToken - The authentication token.
25
+ * @returns A promise that resolves to the job listing data.
14
26
  */
15
27
  getJobListingById(id: string, authToken?: string | null): Promise<JobListing>;
16
28
  /**
29
+ * [GET /joblistings/MapListings/{id}]
30
+ * Get a specific map-optimized job listing by its unique ID.
31
+ * @param id - The unique job listing ID.
32
+ * @param authToken - The authentication token.
33
+ * @returns A promise that resolves to the map job listing data.
34
+ */
35
+ getMapListingById(id: string, authToken?: string | null): Promise<any>;
36
+ /**
37
+ * [POST /joblistings]
17
38
  * Create a new job listing.
18
- * @param {JobListing} jobListing - The job listing data to create.
19
- * @param {string | null} authToken - Optional auth token.
20
- * @returns {Promise<JobListing>} - The newly created job listing data.
39
+ * @param jobListing - The job listing data to create.
40
+ * @param authToken - The authentication token.
41
+ * @returns A promise that resolves to the newly created job listing data.
21
42
  */
22
43
  createJobListing(jobListing: JobListing, authToken?: string | null): Promise<JobListing>;
23
44
  /**
45
+ * [PUT /joblistings/{id}]
24
46
  * Update an existing job listing.
25
- * @param {string} id - The job listing ID to update.
26
- * @param {JobListing} jobListing - The updated job listing data.
27
- * @param {string | null} authToken - Optional auth token.
28
- * @returns {Promise<void>} - No return value.
47
+ * @param id - The ID of the job listing to update.
48
+ * @param jobListing - The updated job listing data.
49
+ * @param authToken - The authentication token.
50
+ * @returns A promise that resolves when the operation is complete.
29
51
  */
30
52
  updateJobListing(id: string, jobListing: JobListing, authToken?: string | null): Promise<void>;
31
53
  /**
54
+ * [DELETE /joblistings/{id}]
32
55
  * Delete an existing job listing.
33
- * @param {string} id - The job listing ID to delete.
34
- * @param {string | null} authToken - Optional auth token.
35
- * @returns {Promise<void>} - No return value.
56
+ * @param id - The ID of the job listing to delete.
57
+ * @param authToken - The authentication token.
58
+ * @returns A promise that resolves when the operation is complete.
36
59
  */
37
60
  deleteJobListing(id: string, authToken?: string | null): Promise<void>;
38
61
  }
@@ -1,10 +1,58 @@
1
- import ListingEntityDto from "../types/listingEntity";
2
- import mongoListingEntity from "../types/mongoListingEntity";
1
+ import { type ListingEntityDto } from "../types/listingEntity";
2
+ import { type mongoListingEntity } from "../types/mongoListingEntity";
3
+ /**
4
+ * Controller for handling listing entity API requests.
5
+ */
3
6
  declare class ListingEntitiesController {
4
- getAllSql(ids: number[], origin?: string | null, authToken?: string | null): Promise<Record<string, ListingEntityDto>>;
5
- getAll(authToken?: string | null): Promise<mongoListingEntity[]>;
7
+ /**
8
+ * [POST /listingEntities]
9
+ * Get SQL-based listing entities by their IDs.
10
+ * @param ids - An array of entity IDs.
11
+ * @param origin - Optional origin string for tracking.
12
+ * @param authToken - The authentication token.
13
+ * @returns A promise that resolves to a dictionary mapping entity IDs to their data.
14
+ */
15
+ getSqlListingEntitiesByIds(ids: number[], origin?: string | null, authToken?: string | null): Promise<Record<string, ListingEntityDto>>;
16
+ /**
17
+ * [GET /listingEntities]
18
+ * Get all Mongo-based listing entities for the user's company.
19
+ * @param authToken - The authentication token.
20
+ * @returns A promise that resolves to a list of Mongo listing entities.
21
+ */
22
+ getAllMongoListingEntities(authToken?: string | null): Promise<mongoListingEntity[]>;
23
+ /**
24
+ * [GET /listingEntities/MapEntities]
25
+ * Get all Mongo-based listing entities, formatted as a dictionary for map use.
26
+ * @param origin - Optional origin string for tracking.
27
+ * @param authToken - The authentication token.
28
+ * @returns A promise that resolves to a dictionary mapping entity keys to their data.
29
+ */
30
+ getMapListingEntities(origin?: string | null, authToken?: string | null): Promise<Record<string, mongoListingEntity>>;
31
+ /**
32
+ * [POST /listingEntities/create]
33
+ * Create a new Mongo listing entity.
34
+ * @param entity - The entity data to create.
35
+ * @param authToken - The authentication token.
36
+ * @returns A promise that resolves to the newly created entity.
37
+ */
6
38
  create(entity: mongoListingEntity, authToken?: string | null): Promise<mongoListingEntity>;
7
- update(id: string, entity: mongoListingEntity, authToken?: string | null): Promise<void>;
39
+ /**
40
+ * [PUT /listingEntities/update/{id}]
41
+ * Update an existing Mongo listing entity.
42
+ * @param id - The ID of the entity to update.
43
+ * @param entity - The updated entity data.
44
+ * @param authToken - The authentication token.
45
+ * @returns A promise that resolves to the updated entity.
46
+ */
47
+ update(id: string, entity: mongoListingEntity, authToken?: string | null): Promise<mongoListingEntity>;
48
+ /**
49
+ * [DELETE /listingEntities/{id}]
50
+ * Delete a Mongo listing entity.
51
+ * @param id - The ID of the entity to delete.
52
+ * @param authToken - The authentication token.
53
+ * @returns A promise that resolves when the deletion is complete.
54
+ */
55
+ delete(id: string, authToken?: string | null): Promise<void>;
8
56
  }
9
57
  declare const _default: ListingEntitiesController;
10
58
  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.json();console.log(n),n&&n.message&&(t=n.message)}catch(t){console.error("Failed to parse error response:",t)}throw{statusCode:e.status,errorMessage:t}}return 200===e.status?e.json():null}))}refreshToken(){return t.__awaiter(this,void 0,void 0,(function*(){if(!this.isLocalhost){return!!(yield fetch(`${this.apiUrl}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"})).ok||(console.error("Failed to refresh token"),!1)}{const t=sessionStorage.getItem("refreshToken");if(!t)return!1;const e=yield fetch(`${this.apiUrl}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})});if(!e.ok)return console.error("Failed to refresh token"),!1;try{const t=yield e.json();return t.token&&sessionStorage.setItem("token",t.token),t.refreshToken&&sessionStorage.setItem("refreshToken",t.refreshToken),!0}catch(t){return console.error("Failed to parse refresh token response:",t),!1}}}))}}const n=process.env.NEXT_PUBLIC_API_URL||process.env.VITE_API_URL||process.env.REACT_APP_API_URL||"https://api.myhirecontrol.com",r=new e(n),i="undefined"!=typeof window&&"localhost"===window.location.hostname;var o=new class{login(e){return t.__awaiter(this,void 0,void 0,(function*(){return r.post("/auth/login",e,!1)}))}nextLogin(e){return t.__awaiter(this,void 0,void 0,(function*(){const t="/auth/nextLogin"+(i?"?localhost=true":""),n=yield r.post(t,e,!1);return n&&(sessionStorage.setItem("token",n.token),sessionStorage.setItem("refreshToken",n.refreshToken),sessionStorage.setItem("expiration",n.expiration)),n}))}refreshToken(e){return t.__awaiter(this,void 0,void 0,(function*(){const t="/auth/refresh"+(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}))}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{return yield r.get("/auth/authenticated",!0)}catch(t){return!1}}))}getUser(){return t.__awaiter(this,arguments,void 0,(function*(t=null){try{return yield r.get("/auth/user",!0,t)}catch(t){throw t}}))}logout(){return t.__awaiter(this,void 0,void 0,(function*(){try{const t=yield r.post("/auth/logout",{},!0);return sessionStorage.removeItem("token"),sessionStorage.removeItem("refreshToken"),sessionStorage.removeItem("expiration"),t}catch(t){throw t}}))}getPermissions(){return t.__awaiter(this,arguments,void 0,(function*(t=null){try{return yield r.get("/auth/permissions",!0,t)}catch(t){throw t}}))}};const s=new e(n);var a=new class{getEvents(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return s.get("/events",!0,t)}))}getEvent(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return s.get(`/events/${t}`,!0,e)}))}getEventBySlug(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return s.get(`/events/details/${t}`,!0,e)}))}getListingEvents(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return s.get(`/listingEvents/${t}`,!0,e)}))}createEvent(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return s.post("/events",t,!0,e)}))}updateEvent(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return s.put(`/events/${t}`,e,!0,n)}))}deleteEvent(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return s.delete(`/events/${t}`,!0,e)}))}};const u=new e(n);var l=new class{getAllRolesWithClaims(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return u.get("/roles",!0,t)}))}addRole(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return u.post("/roles",t,!0,e)}))}updateRole(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return u.put(`/roles/${t}`,e,!0,n)}))}deleteRole(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return u.delete(`/roles/${t}`,!0,e)}))}};const d=new e(n);var c=new class{getAllUsers(){return t.__awaiter(this,arguments,void 0,(function*(t=null){try{return yield d.get("/users",!0,t)}catch(t){throw t}}))}getUser(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){try{return yield d.get(`/users/${t}`,!0,e)}catch(t){throw t}}))}createUser(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){try{return yield d.post("/users",t,!0,e)}catch(t){throw t}}))}updateUser(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){try{yield d.put(`/users/${t}`,e,!0,n)}catch(t){throw t}}))}updateLoggedInUser(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){try{yield d.put("/users",t,!0,e)}catch(t){throw t}}))}deleteUser(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){try{yield d.delete(`/users/${t}`,!0,e)}catch(t){throw t}}))}};const g=new e(n);var h=new class{forgotPassword(e){return t.__awaiter(this,void 0,void 0,(function*(){try{return yield g.post("/account/forgotPassword",e,!1)}catch(t){throw t}}))}resetPasswordWithToken(e){return t.__awaiter(this,void 0,void 0,(function*(){try{return yield g.post("/account/resetPasswordWithToken",e,!1)}catch(t){throw t}}))}resetPassword(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){try{return yield g.post("/account/resetPassword",t,!0,e)}catch(t){throw t}}))}};const p=new e(n);var _=new class{getMapConfig(){return t.__awaiter(this,arguments,void 0,(function*(t=null){try{return yield p.get("/mapconfig",!0,t)}catch(t){throw t}}))}updateMapConfig(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return p.put("/mapconfig",t,!0,e)}))}createMapConfig(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return p.post("/mapconfig",t,!0,e)}))}};const f=new e(n);var v=new class{getAllPermissions(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return f.get("/permissions",!0,t)}))}};const w=new e(n);var 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 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 y.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 y.get(`/listings/${t}`,!0,e)}catch(t){throw t}}))}};const b=new e(n);var C=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 S=new e(n);var $=new class{getFilters(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return S.get("/filters",!0,t)}))}getFilter(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return S.get(`/filters/${t}`,!0,e)}))}createFilter(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return S.post("/filters",t,!0,e)}))}updateFilter(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return S.put(`/filters/${t}`,e,!0,n)}))}deleteFilter(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return S.delete(`/filters/${t}`,!0,e)}))}};const F=new e(n);var L=new class{getAppendListings(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return F.get("/appendListings",!0,t)}))}getAppendListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return F.get(`/appendListings/${t}`,!0,e)}))}createAppendListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return F.post("/appendListings",t,!0,e)}))}updateAppendListing(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return F.put(`/appendListings/${t}`,e,!0,n)}))}deleteAppendListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return F.delete(`/appendListings/${t}`,!0,e)}))}};const k=new e(n);var T=new class{getForms(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return k.get("/forms",!0,t)}))}getForm(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return k.get(`/forms/${t}`,!0,e)}))}createForm(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return k.post("/forms",t,!0,e)}))}updateForm(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return k.put(`/forms/${t}`,e,!0,n)}))}deleteForm(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return k.delete(`/forms/${t}`,!0,e)}))}processFormRequest(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return k.post("/forms/jsonSchema",t,!0,e)}))}};const j=new e(n);var x=new class{submitContactForm(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return j.post("/contactForm",t,!0,e,!0)}))}submitFormSubmission(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return j.post("/formsubmission",t,!0,e)}))}getFormSubmissions(){return t.__awaiter(this,arguments,void 0,(function*(t=20,e=1,n=null,r=null,i=null,o=null,s=null){const a=new URLSearchParams({pageSize:t.toString(),pageNumber:e.toString()});return r&&a.append("status",r.toString()),n&&a.append("type",n),i&&a.append("from",i.toISOString()),o&&a.append("to",o.toISOString()),j.get(`/formsubmission?${a.toString()}`,!0,s)}))}exportFormSubmissionsCsv(){return t.__awaiter(this,arguments,void 0,(function*(t=20,e=1,n=null,r=null,i=null,o=null,s=null){const a=new URLSearchParams({pageSize:t.toString(),pageNumber:e.toString()});r&&a.append("status",r.toString()),n&&a.append("type",n),i&&a.append("from",i.toISOString()),o&&a.append("to",o.toISOString());const u=yield j.getFile(`/formsubmission/export-csv?${a.toString()}`,!0,s),l=window.URL.createObjectURL(u),d=document.createElement("a");d.href=l,d.download="form_submissions.csv",document.body.appendChild(d),d.click(),window.URL.revokeObjectURL(l),document.body.removeChild(d)}))}getFormSubmissionTypes(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return j.get("/formsubmission/types",!0,t)}))}};const B=new e(n);var E=new class{getCompanies(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return B.get("/companies",!0,t)}))}getCompany(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return B.get(`/companies/${t}`,!0,e)}))}createCompany(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return B.post("/companies",t,!0,e)}))}updateCompany(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return B.put(`/companies/${t}`,e,!0,n)}))}deleteCompany(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return B.delete(`/companies/${t}`,!0,e)}))}syncAllCompanies(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return B.get("/companies/syncall",!0,t)}))}};const I=new e(n);var P=new class{getJobListingsByCompany(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return I.get("/joblistings",!0,t)}))}getJobListingById(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return I.get(`/joblistings/${t}`,!0,e)}))}createJobListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return I.post("/joblistings",t,!0,e)}))}updateJobListing(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return I.put(`/joblistings/${t}`,e,!0,n)}))}deleteJobListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return I.delete(`/joblistings/${t}`,!0,e)}))}};const R=new e(n);var M=new class{getBlogs(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return R.get("/blog",!0,t)}))}getBlog(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return R.get(`/blog/${t}`,!0,e)}))}createBlog(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return R.post("/blog",t,!0,e)}))}updateBlog(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return R.put(`/blog/${t}`,e,!0,n)}))}deleteBlog(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return R.delete(`/blog/${t}`,!0,e)}))}};const U=new e(n);var O=new class{getCategories(){return t.__awaiter(this,arguments,void 0,(function*(t=null,e=null){const n=new URLSearchParams;null!=t&&n.append("type",String(t));const r=n.toString()?`?${n.toString()}`:"";return U.get(`/categories${r}`,!0,e)}))}getCategoriesByCompany(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null,n=null){const r=new URLSearchParams;null!=e&&r.append("type",String(e));const i=r.toString()?`?${r.toString()}`:"";return U.get(`/categories/${t}${i}`,!0,n)}))}};const W=new e(n);var J=new class{getByFeed(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return W.get(`/jobFeedFieldMappings/feed/${t}`,!0,e)}))}get(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return W.get(`/jobFeedFieldMappings/${t}`,!0,e)}))}create(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return W.post("/jobFeedFieldMappings",t,!0,e)}))}update(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return W.put(`/jobFeedFieldMappings/${t}`,e,!0,n)}))}delete(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return W.delete(`/jobFeedFieldMappings/${t}`,!0,e)}))}toggleActive(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return W.post("/jobFeedFieldMappings/toggle-active",t,!0,e)}))}discoverFields(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return W.get(`/jobFeedFieldMappings/discover-fields/${t}`,!0,e)}))}validate(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return W.get(`/jobFeedFieldMappings/validate/${t}`,!0,e)}))}};const D=new e(n);var H=new class{getAll(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return D.get("/jobfeeds",!0,t)}))}get(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return D.get(`/jobfeeds/${t}`,!0,e)}))}create(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return D.post("/jobfeeds",t,!0,e)}))}update(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return D.put(`/jobfeeds/${t}`,e,!0,n)}))}delete(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return D.delete(`/jobfeeds/${t}`,!0,e)}))}sync(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return D.post(`/jobfeeds/${t}/sync`,{},!0,e)}))}toggleActive(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return D.patch(`/jobfeeds/${t}/toggle-active`,e,!0,n)}))}};const z=new e(n);var N=new class{get(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return z.get("/jobListingSettings",!0,t)}))}create(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return z.post("/jobListingSettings",t,!0,e)}))}delete(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return z.delete("/jobListingSettings",!0,t)}))}};const V=new e(n);var q=new class{getAllSql(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null,n=null){const r=new URLSearchParams;return e&&r.append("origin",e),V.post("/listingEntities"+(r.toString()?"?"+r.toString():""),t,!0,n)}))}getAll(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return V.get("/listingEntities",!0,t)}))}create(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return V.post("/listingEntities/create",t,!0,e)}))}update(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){yield V.put(`/listingEntities/update/${t}`,e,!0,n)}))}};const G=new e(n);var K=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 G.get(`/recruiters${r}`,!0,e)}))}getAll(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return G.get("/recruiters/all",!0,t)}))}sync(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return G.post("/recruiters/sync",{},!0,t)}))}};const X=new e(n);var Q=new class{getFieldTypes(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return X.get("/field/types",!0,t)}))}};const Y=new e(n);var Z=new class{getValidatorTypes(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return Y.get("/validator/types",!0,t)}))}};const tt=new e(n);var et=new class{getContentEntries(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return tt.get(`/contententry?contentId=${t}`,!0,e)}))}getContentEntry(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return tt.get(`/contententry/${t}`,!0,e)}))}createContentEntry(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return tt.post("/contententry",t,!0,e)}))}updateContentEntry(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return tt.put(`/contententry/${t}`,e,!0,n)}))}deleteContentEntry(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return tt.delete(`/contententry/${t}`,!0,e)}))}};const nt=new e(n);var rt=new class{getBlocks(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return nt.get("/block",!0,t)}))}getBlock(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return nt.get(`/block/${t}`,!0,e)}))}createBlock(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return nt.post("/block",t,!0,e)}))}updateBlock(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return nt.put(`/block/${t}`,e,!0,n)}))}deleteBlock(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return nt.delete(`/block/${t}`,!0,e)}))}};const it=new e(n);var ot,st,at,ut,lt=new class{getModels(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return it.get("/model",!0,t)}))}getModel(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return it.get(`/model/${t}`,!0,e)}))}createModel(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return it.post("/model",t,!0,e)}))}updateModel(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return it.put(`/model/${t}`,e,!0,n)}))}deleteModel(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return it.delete(`/model/${t}`,!0,e)}))}};exports.EventType=void 0,(ot=exports.EventType||(exports.EventType={}))[ot.Virtual=0]="Virtual",ot[ot.InPerson=1]="InPerson",ot[ot.Hybrid=2]="Hybrid",exports.CallToActionType=void 0,(st=exports.CallToActionType||(exports.CallToActionType={}))[st.Button=0]="Button",st[st.Link=1]="Link",st[st.Download=2]="Download",st[st.HireControlRegistration=3]="HireControlRegistration",exports.FormSubmissionStatus=void 0,(at=exports.FormSubmissionStatus||(exports.FormSubmissionStatus={}))[at.Submitted=1]="Submitted",at[at.Hold=2]="Hold",at[at.Rejected=3]="Rejected",at[at.Sent=4]="Sent",exports.FeedHandlingOption=void 0,(ut=exports.FeedHandlingOption||(exports.FeedHandlingOption={}))[ut.Replace=0]="Replace",ut[ut.Append=1]="Append",ut[ut.Custom=2]="Custom";const dt={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},ct={getAll:a.getEvents,get:a.getEvent,getBySlug:a.getEventBySlug,create:a.createEvent,update:a.updateEvent,delete:a.deleteEvent},gt={get:l.getAllRolesWithClaims,create:l.addRole,update:l.updateRole,delete:l.deleteRole},ht=c,pt=A,_t={resetPassword:h.resetPassword,resetPasswordWithToken:h.resetPasswordWithToken,forgotPassword:h.forgotPassword},ft={get:_.getMapConfig,update:_.updateMapConfig,create:_.createMapConfig},vt={get:m.getClientAuthConfigById,getAll:m.getAllClientAuthConfigs,update:m.updateClientAuthConfig,create:m.createClientAuthConfig,delete:m.deleteClientAuthConfig},wt={upload:C.uploadMedia,uploadProfileImage:C.uploadProfileImage,get:C.listMedia,delete:C.deleteMedia},mt={getList:$.getFilters,get:$.getFilter,update:$.updateFilter,create:$.createFilter,delete:$.deleteFilter},yt={get:L.getAppendListings,getAppendListing:L.getAppendListing,create:L.createAppendListing,update:L.updateAppendListing,delete:L.deleteAppendListing},At={getAll:M.getBlogs,getById:M.getBlog,create:M.createBlog,update:M.updateBlog,delete:M.deleteBlog},bt={get:O.getCategories,getByCompany:O.getCategoriesByCompany},Ct={getByFeed:J.getByFeed,get:J.get,create:J.create,update:J.update,delete:J.delete,toggleActive:J.toggleActive,discoverFields:J.discoverFields,validate:J.validate},St={getAll:H.getAll,getById:H.get,create:H.create,update:H.update,delete:H.delete,sync:H.sync,toggleActive:H.toggleActive},$t={get:N.get,create:N.create,delete:N.delete},Ft={create:q.create,get:q.getAll,update:q.update,getAllSql:q.getAllSql},Lt={get:K.get,getAll:K.getAll,sync:K.sync},kt={get:v.getAllPermissions},Tt={getAll:E.getCompanies,getById:E.getCompany,create:E.createCompany,update:E.updateCompany,delete:E.deleteCompany,sync:E.syncAllCompanies},jt={getAll:P.getJobListingsByCompany,getById:P.getJobListingById,create:P.createJobListing,update:P.updateJobListing,delete:P.deleteJobListing},xt={getTypes:Q.getFieldTypes},Bt={getTypes:Z.getValidatorTypes},Et={getAll:et.getContentEntries,getById:et.getContentEntry,create:et.createContentEntry,update:et.updateContentEntry,delete:et.deleteContentEntry},It={getAll:rt.getBlocks,getById:rt.getBlock,create:rt.createBlock,update:rt.updateBlock,delete:rt.deleteBlock},Pt={getAll:lt.getModels,getById:lt.getModel,create:lt.createModel,update:lt.updateModel,delete:lt.deleteModel},Rt=T,Mt=x,Ut={auth:dt,events:ct,roles:gt,users:ht,account:_t,mapConfig:ft,permissions:kt,clientAuthConfig:vt,filters:mt,listings:pt,media:wt,appendListings:yt,blogs:At,categories:bt,jobFeedFieldMappings:Ct,jobFeeds:St,jobListingSettings:$t,listingEntities:Ft,recruiters:Lt,forms:Rt,formSubmissions:Mt,companies:Tt,jobListings:jt};exports.account=_t,exports.appendListings=yt,exports.auth=dt,exports.blogs=At,exports.categories=bt,exports.clientAuthConfig=vt,exports.companies=Tt,exports.contentBlocks=It,exports.contentEntries=Et,exports.contentField=xt,exports.contentValidator=Bt,exports.default=Ut,exports.events=ct,exports.filters=mt,exports.formSubmissions=Mt,exports.forms=Rt,exports.jobFeedFieldMappings=Ct,exports.jobFeeds=St,exports.jobListingSettings=$t,exports.jobListings=jt,exports.listingEntities=Ft,exports.listings=pt,exports.mapConfig=ft,exports.media=wt,exports.model=Pt,exports.permissions=kt,exports.recruiters=Lt,exports.roles=gt,exports.users=ht;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t=require("tslib");class e{constructor(t){this.apiUrl=t,this.isLocalhost=!1}getAuthToken(){return this.isLocalhost?sessionStorage.getItem("token"):null}get(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=!1,n=null){this.isLocalhost&&e&&!n&&(n=this.getAuthToken());const r={method:"GET",credentials:n?"omit":"include"};return e?this.fetchWithAuth(t,r,n):this.fetchWithoutAuth(t,r)}))}post(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=!1,r=null,i=!1){this.isLocalhost&&n&&!r&&(r=this.getAuthToken());const o=i,s={method:"POST",credentials:r?"omit":"include",headers:Object.assign(Object.assign({},r?{Authorization:`Bearer ${r}`}:{}),o?{}:{"Content-Type":"application/json"}),body:o?this.convertToFormData(e):JSON.stringify(e)};return n?this.fetchWithAuth(t,s,r):this.fetchWithoutAuth(t,s)}))}put(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=!1,r=null,i=!1){this.isLocalhost&&n&&!r&&(r=this.getAuthToken());const o=i,s={method:"PUT",credentials:r?"omit":"include",headers:Object.assign(Object.assign({},r?{Authorization:`Bearer ${r}`}:{}),o?{}:{"Content-Type":"application/json"}),body:o?this.convertToFormData(e):JSON.stringify(e)};return n?this.fetchWithAuth(t,s,r):this.fetchWithoutAuth(t,s)}))}patch(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=!1,r=null,i=!1){this.isLocalhost&&n&&!r&&(r=this.getAuthToken());const o=i,s={method:"PATCH",credentials:r?"omit":"include",headers:Object.assign(Object.assign({},r?{Authorization:`Bearer ${r}`}:{}),o?{}:{"Content-Type":"application/json"}),body:o?this.convertToFormData(e):JSON.stringify(e)};return n?this.fetchWithAuth(t,s,r):this.fetchWithoutAuth(t,s)}))}delete(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=!1,n=null){this.isLocalhost&&e&&!n&&(n=this.getAuthToken());const r={method:"DELETE",credentials:n?"omit":"include"};return e?this.fetchWithAuth(t,r,n):this.fetchWithoutAuth(t,r)}))}getFile(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=!1,n=null){this.isLocalhost&&e&&!n&&(n=this.getAuthToken());const r={method:"GET",credentials:n?"omit":"include",headers:e&&n?{Authorization:`Bearer ${n}`}:{}},i=yield fetch(`${this.apiUrl}${t}`,r);if(!i.ok)throw new Error(`Failed to fetch file: ${i.statusText}`);return i.blob()}))}convertToFormData(t,e=new FormData,n=""){return t instanceof File?e.append(n||"file",t):"string"==typeof t||"number"==typeof t||"boolean"==typeof t?e.append(n,t.toString()):Array.isArray(t)?t.forEach(((t,r)=>{this.convertToFormData(t,e,`${n}[${r}]`)})):"object"==typeof t&&null!==t&&Object.keys(t).forEach((r=>{const i=t[r],o=n?`${n}.${r}`:r;this.convertToFormData(i,e,o)})),e}fetchWithoutAuth(e,n){return t.__awaiter(this,void 0,void 0,(function*(){const t=yield fetch(`${this.apiUrl}${e}`,n);return this.handleResponse(t)}))}fetchWithAuth(e,n,r){return t.__awaiter(this,void 0,void 0,(function*(){r?(n.headers=Object.assign(Object.assign({},n.headers),{Authorization:`Bearer ${r}`}),n.credentials="omit"):n.credentials="include";let t=yield fetch(`${this.apiUrl}${e}`,n);if(401===t.status){if(!(yield this.refreshToken()))throw{statusCode:t.status};this.isLocalhost&&(r=this.getAuthToken())&&(n.headers=Object.assign(Object.assign({},n.headers),{Authorization:`Bearer ${r}`})),t=yield fetch(`${this.apiUrl}${e}`,n)}return this.handleResponse(t)}))}handleResponse(e){return t.__awaiter(this,void 0,void 0,(function*(){if(!e.ok||!e.status.toString().startsWith("2")){let t=`Error: ${e.status} ${e.statusText}`;try{const n=yield e.json();console.log(n),n&&n.message&&(t=n.message)}catch(t){console.error("Failed to parse error response:",t)}throw{statusCode:e.status,errorMessage:t}}return 200===e.status?e.json():null}))}refreshToken(){return t.__awaiter(this,void 0,void 0,(function*(){if(!this.isLocalhost){return!!(yield fetch(`${this.apiUrl}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"})).ok||(console.error("Failed to refresh token"),!1)}{const t=sessionStorage.getItem("refreshToken");if(!t)return!1;const e=yield fetch(`${this.apiUrl}/auth/refresh`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:t})});if(!e.ok)return console.error("Failed to refresh token"),!1;try{const t=yield e.json();return t.token&&sessionStorage.setItem("token",t.token),t.refreshToken&&sessionStorage.setItem("refreshToken",t.refreshToken),!0}catch(t){return console.error("Failed to parse refresh token response:",t),!1}}}))}}const n=process.env.NEXT_PUBLIC_API_URL||process.env.VITE_API_URL||process.env.REACT_APP_API_URL||"https://api.myhirecontrol.com",r=new e(n),i="undefined"!=typeof window&&"localhost"===window.location.hostname;var o=new class{login(e){return t.__awaiter(this,void 0,void 0,(function*(){return r.post("/auth/login",e,!1)}))}nextLogin(e){return t.__awaiter(this,void 0,void 0,(function*(){const t="/auth/nextLogin"+(i?"?localhost=true":""),n=yield r.post(t,e,!1);return n&&(sessionStorage.setItem("token",n.token),sessionStorage.setItem("refreshToken",n.refreshToken),sessionStorage.setItem("expiration",n.expiration)),n}))}refreshToken(e){return t.__awaiter(this,void 0,void 0,(function*(){const t="/auth/refresh"+(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}))}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{return yield r.get("/auth/authenticated",!0)}catch(t){return!1}}))}getUser(){return t.__awaiter(this,arguments,void 0,(function*(t=null){try{return yield r.get("/auth/user",!0,t)}catch(t){throw t}}))}logout(){return t.__awaiter(this,void 0,void 0,(function*(){try{const t=yield r.post("/auth/logout",{},!0);return sessionStorage.removeItem("token"),sessionStorage.removeItem("refreshToken"),sessionStorage.removeItem("expiration"),t}catch(t){throw t}}))}getPermissions(){return t.__awaiter(this,arguments,void 0,(function*(t=null){try{return yield r.get("/auth/permissions",!0,t)}catch(t){throw t}}))}};const s=new e(n);var a=new class{getEvents(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return s.get("/events",!0,t)}))}getEvent(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return s.get(`/events/${t}`,!0,e)}))}getEventBySlug(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return s.get(`/events/details/${t}`,!0,e)}))}getListingEvents(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return s.get(`/listingEvents/${t}`,!0,e)}))}createEvent(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return s.post("/events",t,!0,e)}))}updateEvent(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return s.put(`/events/${t}`,e,!0,n)}))}deleteEvent(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return s.delete(`/events/${t}`,!0,e)}))}};const u=new e(n);var l=new class{getAllRolesWithClaims(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return u.get("/roles",!0,t)}))}addRole(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return u.post("/roles",t,!0,e)}))}updateRole(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return u.put(`/roles/${t}`,e,!0,n)}))}deleteRole(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return u.delete(`/roles/${t}`,!0,e)}))}};const d=new e(n);var c=new class{getAllUsers(){return t.__awaiter(this,arguments,void 0,(function*(t=null){try{return yield d.get("/users",!0,t)}catch(t){throw t}}))}getUser(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){try{return yield d.get(`/users/${t}`,!0,e)}catch(t){throw t}}))}createUser(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){try{return yield d.post("/users",t,!0,e)}catch(t){throw t}}))}updateUser(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){try{yield d.put(`/users/${t}`,e,!0,n)}catch(t){throw t}}))}updateLoggedInUser(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){try{yield d.put("/users",t,!0,e)}catch(t){throw t}}))}deleteUser(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){try{yield d.delete(`/users/${t}`,!0,e)}catch(t){throw t}}))}};const g=new e(n);var h=new class{forgotPassword(e){return t.__awaiter(this,void 0,void 0,(function*(){try{return yield g.post("/account/forgotPassword",e,!1)}catch(t){throw t}}))}resetPasswordWithToken(e){return t.__awaiter(this,void 0,void 0,(function*(){try{return yield g.post("/account/resetPasswordWithToken",e,!1)}catch(t){throw t}}))}resetPassword(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){try{return yield g.post("/account/resetPassword",t,!0,e)}catch(t){throw t}}))}};const p=new e(n);var _=new class{getMapConfig(){return t.__awaiter(this,arguments,void 0,(function*(t=null){try{return yield p.get("/mapconfig",!0,t)}catch(t){throw t}}))}updateMapConfig(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return p.put("/mapconfig",t,!0,e)}))}createMapConfig(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return p.post("/mapconfig",t,!0,e)}))}};const f=new e(n);var v=new class{getAllPermissions(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return f.get("/permissions",!0,t)}))}};const w=new e(n);var 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 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 y.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 y.get(`/listings/${t}`,!0,e)}catch(t){throw t}}))}};const A=new e(n);var C=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 S=new e(n);var $=new class{getFilters(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return S.get("/filters",!0,t)}))}getFilter(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return S.get(`/filters/${t}`,!0,e)}))}createFilter(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return S.post("/filters",t,!0,e)}))}updateFilter(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return S.put(`/filters/${t}`,e,!0,n)}))}deleteFilter(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return S.delete(`/filters/${t}`,!0,e)}))}};const L=new e(n);var F=new class{getAppendListings(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return L.get("/appendListings",!0,t)}))}getAppendListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return L.get(`/appendListings/${t}`,!0,e)}))}createAppendListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return L.post("/appendListings",t,!0,e)}))}updateAppendListing(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return L.put(`/appendListings/${t}`,e,!0,n)}))}deleteAppendListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return L.delete(`/appendListings/${t}`,!0,e)}))}};const k=new e(n);var T=new class{getForms(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return k.get("/forms",!0,t)}))}getForm(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return k.get(`/forms/${t}`,!0,e)}))}createForm(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return k.post("/forms",t,!0,e)}))}updateForm(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return k.put(`/forms/${t}`,e,!0,n)}))}deleteForm(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return k.delete(`/forms/${t}`,!0,e)}))}processFormRequest(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return k.post("/forms/jsonSchema",t,!0,e)}))}};const j=new e(n);var x=new class{submitContactForm(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return j.post("/contactForm",t,!0,e,!0)}))}submitFormSubmission(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return j.post("/formsubmission",t,!0,e)}))}getFormSubmissions(){return t.__awaiter(this,arguments,void 0,(function*(t=20,e=1,n=null,r=null,i=null,o=null,s=null){const a=new URLSearchParams({pageSize:t.toString(),pageNumber:e.toString()});return r&&a.append("status",r.toString()),n&&a.append("type",n),i&&a.append("from",i.toISOString()),o&&a.append("to",o.toISOString()),j.get(`/formsubmission?${a.toString()}`,!0,s)}))}exportFormSubmissionsCsv(){return t.__awaiter(this,arguments,void 0,(function*(t=20,e=1,n=null,r=null,i=null,o=null,s=null){const a=new URLSearchParams({pageSize:t.toString(),pageNumber:e.toString()});r&&a.append("status",r.toString()),n&&a.append("type",n),i&&a.append("from",i.toISOString()),o&&a.append("to",o.toISOString());const u=yield j.getFile(`/formsubmission/export-csv?${a.toString()}`,!0,s),l=window.URL.createObjectURL(u),d=document.createElement("a");d.href=l,d.download="form_submissions.csv",document.body.appendChild(d),d.click(),window.URL.revokeObjectURL(l),document.body.removeChild(d)}))}getFormSubmissionTypes(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return j.get("/formsubmission/types",!0,t)}))}};const B=new e(n);var E=new class{getCompanies(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return B.get("/companies",!0,t)}))}getCompany(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return B.get(`/companies/${t}`,!0,e)}))}createCompany(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return B.post("/companies",t,!0,e)}))}updateCompany(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return B.put(`/companies/${t}`,e,!0,n)}))}deleteCompany(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return B.delete(`/companies/${t}`,!0,e)}))}syncAllCompanies(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return B.get("/companies/syncall",!0,t)}))}};const I=new e(n);var P=new class{getJobListingsByCompany(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return I.get("/joblistings",!0,t)}))}getMapJobListingsByCompany(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return I.get("/joblistings/MapListings",!0,t)}))}getJobListingById(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return I.get(`/joblistings/${t}`,!0,e)}))}getMapListingById(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return I.get(`/joblistings/MapListings/${t}`,!0,e)}))}createJobListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return I.post("/joblistings",t,!0,e)}))}updateJobListing(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return I.put(`/joblistings/${t}`,e,!0,n)}))}deleteJobListing(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return I.delete(`/joblistings/${t}`,!0,e)}))}};const M=new e(n);var R=new class{getBlogs(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return M.get("/blog",!0,t)}))}getBlog(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return M.get(`/blog/${t}`,!0,e)}))}createBlog(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return M.post("/blog",t,!0,e)}))}updateBlog(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return M.put(`/blog/${t}`,e,!0,n)}))}deleteBlog(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return M.delete(`/blog/${t}`,!0,e)}))}};const U=new e(n);var O=new class{getCategories(){return t.__awaiter(this,arguments,void 0,(function*(t=null,e=null){const n=new URLSearchParams;null!=t&&n.append("type",String(t));const r=n.toString()?`?${n.toString()}`:"";return U.get(`/categories${r}`,!0,e)}))}getCategoriesByCompany(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null,n=null){const r=new URLSearchParams;null!=e&&r.append("type",String(e));const i=r.toString()?`?${r.toString()}`:"";return U.get(`/categories/${t}${i}`,!0,n)}))}};const W=new e(n);var J=new class{getByFeed(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return W.get(`/jobFeedFieldMappings/feed/${t}`,!0,e)}))}get(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return W.get(`/jobFeedFieldMappings/${t}`,!0,e)}))}create(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return W.post("/jobFeedFieldMappings",t,!0,e)}))}update(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return W.put(`/jobFeedFieldMappings/${t}`,e,!0,n)}))}delete(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return W.delete(`/jobFeedFieldMappings/${t}`,!0,e)}))}toggleActive(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return W.post("/jobFeedFieldMappings/toggle-active",t,!0,e)}))}discoverFields(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return W.get(`/jobFeedFieldMappings/discover-fields/${t}`,!0,e)}))}validate(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return W.get(`/jobFeedFieldMappings/validate/${t}`,!0,e)}))}};const D=new e(n);var H=new class{getAll(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return D.get("/jobfeeds",!0,t)}))}get(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return D.get(`/jobfeeds/${t}`,!0,e)}))}create(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return D.post("/jobfeeds",t,!0,e)}))}update(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return D.put(`/jobfeeds/${t}`,e,!0,n)}))}delete(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return D.delete(`/jobfeeds/${t}`,!0,e)}))}sync(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return D.post(`/jobfeeds/${t}/sync`,{},!0,e)}))}toggleActive(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return D.patch(`/jobfeeds/${t}/toggle-active`,e,!0,n)}))}};const z=new e(n);var N=new class{get(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return z.get("/jobListingSettings",!0,t)}))}create(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return z.post("/jobListingSettings",t,!0,e)}))}delete(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return z.delete("/jobListingSettings",!0,t)}))}};const V=new e(n);var q=new class{getSqlListingEntitiesByIds(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null,n=null){const r=new URLSearchParams;e&&r.append("origin",e);const i="/listingEntities"+(r.toString()?"?"+r.toString():"");return V.post(i,t,!0,n)}))}getAllMongoListingEntities(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return V.get("/listingEntities",!0,t)}))}getMapListingEntities(){return t.__awaiter(this,arguments,void 0,(function*(t=null,e=null){const n=new URLSearchParams;t&&n.append("origin",t);const r="/listingEntities/MapEntities"+(n.toString()?"?"+n.toString():"");return V.get(r,!0,e)}))}create(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return V.post("/listingEntities/create",t,!0,e)}))}update(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return V.put(`/listingEntities/update/${t}`,e,!0,n)}))}delete(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){yield V.delete(`/listingEntities/${t}`,!0,e)}))}};const G=new e(n);var K=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 G.get(`/recruiters${r}`,!0,e)}))}getAll(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return G.get("/recruiters/all",!0,t)}))}sync(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return G.post("/recruiters/sync",{},!0,t)}))}};const X=new e(n);var Q=new class{getFieldTypes(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return X.get("/field/types",!0,t)}))}};const Y=new e(n);var Z=new class{getValidatorTypes(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return Y.get("/validator/types",!0,t)}))}};const tt=new e(n);var et=new class{getContentEntries(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return tt.get(`/contententry?contentId=${t}`,!0,e)}))}getContentEntry(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return tt.get(`/contententry/${t}`,!0,e)}))}createContentEntry(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return tt.post("/contententry",t,!0,e)}))}updateContentEntry(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return tt.put(`/contententry/${t}`,e,!0,n)}))}deleteContentEntry(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return tt.delete(`/contententry/${t}`,!0,e)}))}};const nt=new e(n);var rt=new class{getBlocks(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return nt.get("/block",!0,t)}))}getBlock(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return nt.get(`/block/${t}`,!0,e)}))}createBlock(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return nt.post("/block",t,!0,e)}))}updateBlock(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return nt.put(`/block/${t}`,e,!0,n)}))}deleteBlock(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return nt.delete(`/block/${t}`,!0,e)}))}};const it=new e(n);var ot,st,at,ut,lt=new class{getModels(){return t.__awaiter(this,arguments,void 0,(function*(t=null){return it.get("/model",!0,t)}))}getModel(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return it.get(`/model/${t}`,!0,e)}))}createModel(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return it.post("/model",t,!0,e)}))}updateModel(e,n){return t.__awaiter(this,arguments,void 0,(function*(t,e,n=null){return it.put(`/model/${t}`,e,!0,n)}))}deleteModel(e){return t.__awaiter(this,arguments,void 0,(function*(t,e=null){return it.delete(`/model/${t}`,!0,e)}))}};exports.EventType=void 0,(ot=exports.EventType||(exports.EventType={}))[ot.Virtual=0]="Virtual",ot[ot.InPerson=1]="InPerson",ot[ot.Hybrid=2]="Hybrid",exports.CallToActionType=void 0,(st=exports.CallToActionType||(exports.CallToActionType={}))[st.Button=0]="Button",st[st.Link=1]="Link",st[st.Download=2]="Download",st[st.HireControlRegistration=3]="HireControlRegistration",exports.FormSubmissionStatus=void 0,(at=exports.FormSubmissionStatus||(exports.FormSubmissionStatus={}))[at.Submitted=1]="Submitted",at[at.Hold=2]="Hold",at[at.Rejected=3]="Rejected",at[at.Sent=4]="Sent",exports.FeedHandlingOption=void 0,(ut=exports.FeedHandlingOption||(exports.FeedHandlingOption={}))[ut.Replace=0]="Replace",ut[ut.Append=1]="Append",ut[ut.Custom=2]="Custom";const dt={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},ct={getAll:a.getEvents,get:a.getEvent,getBySlug:a.getEventBySlug,create:a.createEvent,update:a.updateEvent,delete:a.deleteEvent},gt={get:l.getAllRolesWithClaims,create:l.addRole,update:l.updateRole,delete:l.deleteRole},ht=c,pt=b,_t={resetPassword:h.resetPassword,resetPasswordWithToken:h.resetPasswordWithToken,forgotPassword:h.forgotPassword},ft={get:_.getMapConfig,update:_.updateMapConfig,create:_.createMapConfig},vt={get:m.getClientAuthConfigById,getAll:m.getAllClientAuthConfigs,update:m.updateClientAuthConfig,create:m.createClientAuthConfig,delete:m.deleteClientAuthConfig},wt={upload:C.uploadMedia,uploadProfileImage:C.uploadProfileImage,get:C.listMedia,delete:C.deleteMedia},mt={getList:$.getFilters,get:$.getFilter,update:$.updateFilter,create:$.createFilter,delete:$.deleteFilter},yt={get:F.getAppendListings,getAppendListing:F.getAppendListing,create:F.createAppendListing,update:F.updateAppendListing,delete:F.deleteAppendListing},bt={getAll:R.getBlogs,getById:R.getBlog,create:R.createBlog,update:R.updateBlog,delete:R.deleteBlog},At={get:O.getCategories,getByCompany:O.getCategoriesByCompany},Ct={getByFeed:J.getByFeed,get:J.get,create:J.create,update:J.update,delete:J.delete,toggleActive:J.toggleActive,discoverFields:J.discoverFields,validate:J.validate},St={getAll:H.getAll,getById:H.get,create:H.create,update:H.update,delete:H.delete,sync:H.sync,toggleActive:H.toggleActive},$t={get:N.get,create:N.create,delete:N.delete},Lt={create:q.create,get:q.getAll,update:q.update,delete:q.delete,getAllSql:q.getAllSql},Ft={get:K.get,getAll:K.getAll,sync:K.sync},kt={get:v.getAllPermissions},Tt={getAll:E.getCompanies,getById:E.getCompany,create:E.createCompany,update:E.updateCompany,delete:E.deleteCompany,sync:E.syncAllCompanies},jt={getAll:P.getJobListingsByCompany,getById:P.getJobListingById,create:P.createJobListing,update:P.updateJobListing,delete:P.deleteJobListing},xt={getTypes:Q.getFieldTypes},Bt={getTypes:Z.getValidatorTypes},Et={getAll:et.getContentEntries,getById:et.getContentEntry,create:et.createContentEntry,update:et.updateContentEntry,delete:et.deleteContentEntry},It={getAll:rt.getBlocks,getById:rt.getBlock,create:rt.createBlock,update:rt.updateBlock,delete:rt.deleteBlock},Pt={getAll:lt.getModels,getById:lt.getModel,create:lt.createModel,update:lt.updateModel,delete:lt.deleteModel},Mt=T,Rt=x,Ut={auth:dt,events:ct,roles:gt,users:ht,account:_t,mapConfig:ft,permissions:kt,clientAuthConfig:vt,filters:mt,listings:pt,media:wt,appendListings:yt,blogs:bt,categories:At,jobFeedFieldMappings:Ct,jobFeeds:St,jobListingSettings:$t,listingEntities:Lt,recruiters:Ft,forms:Mt,formSubmissions:Rt,companies:Tt,jobListings:jt};exports.account=_t,exports.appendListings=yt,exports.auth=dt,exports.blogs=bt,exports.categories=At,exports.clientAuthConfig=vt,exports.companies=Tt,exports.contentBlocks=It,exports.contentEntries=Et,exports.contentField=xt,exports.contentValidator=Bt,exports.default=Ut,exports.events=ct,exports.filters=mt,exports.formSubmissions=Rt,exports.forms=Mt,exports.jobFeedFieldMappings=Ct,exports.jobFeeds=St,exports.jobListingSettings=$t,exports.jobListings=jt,exports.listingEntities=Lt,exports.listings=pt,exports.mapConfig=ft,exports.media=wt,exports.model=Pt,exports.permissions=kt,exports.recruiters=Ft,exports.roles=gt,exports.users=ht;
2
2
  //# sourceMappingURL=index.cjs.js.map
package/dist/index.d.ts CHANGED
@@ -137,6 +137,7 @@ export declare const listingEntities: {
137
137
  create: (entity: import("./types/mongoListingEntity").mongoListingEntity, authToken?: string | null) => Promise<import("./types/mongoListingEntity").mongoListingEntity>;
138
138
  get: (authToken?: string | null) => Promise<import("./types/mongoListingEntity").mongoListingEntity[]>;
139
139
  update: (id: string, entity: import("./types/mongoListingEntity").mongoListingEntity, authToken?: string | null) => Promise<void>;
140
+ delete: (id: string, authToken?: string | null) => Promise<void>;
140
141
  getAllSql: (ids: number[], origin?: string | null, authToken?: string | null) => Promise<Record<string, ListingEntityDto>>;
141
142
  };
142
143
  export declare const recruiters: {
@@ -320,6 +321,7 @@ declare const hcApi: {
320
321
  create: (entity: import("./types/mongoListingEntity").mongoListingEntity, authToken?: string | null) => Promise<import("./types/mongoListingEntity").mongoListingEntity>;
321
322
  get: (authToken?: string | null) => Promise<import("./types/mongoListingEntity").mongoListingEntity[]>;
322
323
  update: (id: string, entity: import("./types/mongoListingEntity").mongoListingEntity, authToken?: string | null) => Promise<void>;
324
+ delete: (id: string, authToken?: string | null) => Promise<void>;
323
325
  getAllSql: (ids: number[], origin?: string | null, authToken?: string | null) => Promise<Record<string, ListingEntityDto>>;
324
326
  };
325
327
  recruiters: {
package/index.ts CHANGED
@@ -187,6 +187,7 @@ export const listingEntities = {
187
187
  create: listingEntitiesController.create,
188
188
  get: listingEntitiesController.getAll,
189
189
  update: listingEntitiesController.update,
190
+ delete: listingEntitiesController.delete,
190
191
  getAllSql: listingEntitiesController.getAllSql,
191
192
  };
192
193
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@abcagency/hire-control-sdk",
3
- "version": "1.0.60",
3
+ "version": "1.0.62",
4
4
  "main": "dist/index.cjs.js",
5
5
  "module": "dist/index.esm.js",
6
6
  "types": "dist/index.d.ts",