@inploi/plugin-job-search 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/index.js +5 -5
- package/dist/job-search.d.ts +77 -3
- package/dist/plugin-job-search.cjs +2687 -2634
- package/dist/plugin-job-search.js +2687 -2634
- package/package.json +4 -4
package/dist/job-search.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { getJobSearchResults } from './job-search.api.ts';
|
|
2
|
+
import { FilterValue } from './components/filter.tsx';
|
|
1
3
|
import { IconName } from './components/icon.tsx';
|
|
2
4
|
import { HintedString } from './lib/type-utils.ts';
|
|
3
5
|
type FontSettings = {
|
|
@@ -72,11 +74,26 @@ export type JobSearchPluginParams = {
|
|
|
72
74
|
infoTags: DisplayableFilterProperty[];
|
|
73
75
|
};
|
|
74
76
|
};
|
|
77
|
+
export interface SSRJobSearchPluginParams extends JobSearchPluginParams {
|
|
78
|
+
/** If true, the data needed to display the first page of results
|
|
79
|
+
* will be fetched from the server. This is recommended if SEO is important
|
|
80
|
+
* or you want your page to be progressively enhanced. */
|
|
81
|
+
withData: boolean;
|
|
82
|
+
}
|
|
83
|
+
export interface CSRJobSearchPluginParams extends JobSearchPluginParams {
|
|
84
|
+
/** When provided with initial data, the client side bundle will hydrate
|
|
85
|
+
* the already present SSR content, avoiding any loading.
|
|
86
|
+
*/
|
|
87
|
+
initialData?: {
|
|
88
|
+
jobs: Awaited<ReturnType<typeof getJobSearchResults>>;
|
|
89
|
+
};
|
|
90
|
+
onFilterChange: (params: Record<string, FilterValue | undefined>) => void;
|
|
91
|
+
}
|
|
75
92
|
export declare const createJobSearchDomManager: () => {
|
|
76
93
|
getRenderTargetElement: () => Element;
|
|
77
94
|
};
|
|
78
95
|
export type ChatbotDomManager = ReturnType<typeof createJobSearchDomManager>;
|
|
79
|
-
export declare const jobSearchPlugin: (
|
|
96
|
+
export declare const jobSearchPlugin: () => ({ apiClient, logger, analytics }: {
|
|
80
97
|
apiClient: import("@inploi/sdk").ApiClient;
|
|
81
98
|
logger: import("@inploi/sdk").Logger;
|
|
82
99
|
analytics: import("@inploi/sdk").AnalyticsService;
|
|
@@ -84,8 +101,65 @@ export declare const jobSearchPlugin: (params: JobSearchPluginParams) => ({ apiC
|
|
|
84
101
|
/** Returns a string with the initial rendering state of the UI.
|
|
85
102
|
* Useful when server-side rendering to avoid CLS.
|
|
86
103
|
*/
|
|
87
|
-
|
|
104
|
+
prerender: (params: SSRJobSearchPluginParams) => Promise<{
|
|
105
|
+
html: string;
|
|
106
|
+
data: {
|
|
107
|
+
jobs: {
|
|
108
|
+
pagination: {
|
|
109
|
+
total: number;
|
|
110
|
+
current_page: number;
|
|
111
|
+
per_page: number;
|
|
112
|
+
last_page: number;
|
|
113
|
+
};
|
|
114
|
+
results: {
|
|
115
|
+
raw: {
|
|
116
|
+
id: number;
|
|
117
|
+
company_name: string;
|
|
118
|
+
employment_type: string;
|
|
119
|
+
location_type: "LOCATION" | "REMOTE" | "HYBRID";
|
|
120
|
+
pay_type: "ANNUALLY" | "HOURLY" | "MONTHLY" | "WEEKLY" | "DAILY";
|
|
121
|
+
pay_currency: string;
|
|
122
|
+
pay_mask: boolean;
|
|
123
|
+
pay_display: boolean;
|
|
124
|
+
pay: string | null;
|
|
125
|
+
pay_min: string | null;
|
|
126
|
+
pay_max: string | null;
|
|
127
|
+
description: string;
|
|
128
|
+
title: string;
|
|
129
|
+
contract_type: string | null;
|
|
130
|
+
created_at: string | null;
|
|
131
|
+
custom_data: {
|
|
132
|
+
[x: string]: any;
|
|
133
|
+
} | null;
|
|
134
|
+
href: string;
|
|
135
|
+
industry?: string | undefined;
|
|
136
|
+
category?: string | undefined;
|
|
137
|
+
skills?: string | undefined;
|
|
138
|
+
town?: string | undefined;
|
|
139
|
+
city?: string | undefined;
|
|
140
|
+
country?: string | undefined;
|
|
141
|
+
};
|
|
142
|
+
id: number;
|
|
143
|
+
isNew: boolean;
|
|
144
|
+
company: {
|
|
145
|
+
name: string;
|
|
146
|
+
};
|
|
147
|
+
employmentType: string;
|
|
148
|
+
locationType: "LOCATION" | "REMOTE" | "HYBRID";
|
|
149
|
+
pay: string | undefined;
|
|
150
|
+
description: string;
|
|
151
|
+
title: string;
|
|
152
|
+
contractType: string | null;
|
|
153
|
+
href: string;
|
|
154
|
+
relativePostedDate: string;
|
|
155
|
+
customData: {
|
|
156
|
+
[x: string]: any;
|
|
157
|
+
} | null;
|
|
158
|
+
}[];
|
|
159
|
+
};
|
|
160
|
+
} | undefined;
|
|
161
|
+
}>;
|
|
88
162
|
/** Renders the Job Search Plugin inside the container element. */
|
|
89
|
-
render: () => Promise<void>;
|
|
163
|
+
render: (params: CSRJobSearchPluginParams) => Promise<void>;
|
|
90
164
|
};
|
|
91
165
|
export {};
|