@inploi/plugin-job-search 0.0.3 → 0.0.5
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 +8 -8
- package/dist/job-search.api.d.ts +70 -59
- package/dist/job-search.d.ts +28 -4
- package/dist/job-search.schemas.d.ts +23 -2
- package/dist/plugin-job-search.cjs +541 -248
- package/dist/plugin-job-search.js +541 -248
- package/package.json +5 -3
package/dist/job-search.api.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { ApiClient, Logger } from '@inploi/sdk';
|
|
2
|
+
import { FilterValue } from './components/filter';
|
|
2
3
|
export declare const JobSearchResponseSchema: import("valibot").ObjectSchema<{
|
|
3
4
|
data: import("valibot").ObjectSchema<{
|
|
4
|
-
results: import("valibot").ArraySchema<import("valibot").ObjectSchema<{
|
|
5
|
+
results: import("valibot").ArraySchema<import("valibot").SchemaWithTransform<import("valibot").ObjectSchema<{
|
|
5
6
|
id: import("valibot").NumberSchema<number>;
|
|
6
7
|
company_name: import("valibot").StringSchema<string>;
|
|
7
8
|
company_logo: import("valibot").StringSchema<string>;
|
|
@@ -29,6 +30,7 @@ export declare const JobSearchResponseSchema: import("valibot").ObjectSchema<{
|
|
|
29
30
|
[x: string]: any;
|
|
30
31
|
}>;
|
|
31
32
|
}, undefined, {
|
|
33
|
+
title: string;
|
|
32
34
|
id: number;
|
|
33
35
|
company_name: string;
|
|
34
36
|
company_logo: string;
|
|
@@ -42,7 +44,6 @@ export declare const JobSearchResponseSchema: import("valibot").ObjectSchema<{
|
|
|
42
44
|
pay_min: string | null;
|
|
43
45
|
pay_max: string | null;
|
|
44
46
|
description: string;
|
|
45
|
-
title: string;
|
|
46
47
|
coordinates: {
|
|
47
48
|
lat: number;
|
|
48
49
|
lng: number;
|
|
@@ -54,26 +55,44 @@ export declare const JobSearchResponseSchema: import("valibot").ObjectSchema<{
|
|
|
54
55
|
};
|
|
55
56
|
}>, {
|
|
56
57
|
id: number;
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
pay: string;
|
|
66
|
-
pay_min: string | null;
|
|
67
|
-
pay_max: string | null;
|
|
58
|
+
isNew: boolean;
|
|
59
|
+
company: {
|
|
60
|
+
name: string;
|
|
61
|
+
logo: string;
|
|
62
|
+
};
|
|
63
|
+
employmentType: "FULL_TIME" | "PART_TIME" | "TEMPORARY" | "CONTRACTOR" | "INTERN" | "VOLUNTEER" | "OTHER";
|
|
64
|
+
locationType: "LOCATION" | "REMOTE" | "HYBRID";
|
|
65
|
+
pay: string | undefined;
|
|
68
66
|
description: string;
|
|
69
67
|
title: string;
|
|
70
68
|
coordinates: {
|
|
71
69
|
lat: number;
|
|
72
70
|
lng: number;
|
|
73
71
|
};
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
contractType: string | null;
|
|
73
|
+
relativePostedDate: string;
|
|
74
|
+
customData: {
|
|
75
|
+
[x: string]: any;
|
|
76
|
+
};
|
|
77
|
+
}>, {
|
|
78
|
+
id: number;
|
|
79
|
+
isNew: boolean;
|
|
80
|
+
company: {
|
|
81
|
+
name: string;
|
|
82
|
+
logo: string;
|
|
83
|
+
};
|
|
84
|
+
employmentType: "FULL_TIME" | "PART_TIME" | "TEMPORARY" | "CONTRACTOR" | "INTERN" | "VOLUNTEER" | "OTHER";
|
|
85
|
+
locationType: "LOCATION" | "REMOTE" | "HYBRID";
|
|
86
|
+
pay: string | undefined;
|
|
87
|
+
description: string;
|
|
88
|
+
title: string;
|
|
89
|
+
coordinates: {
|
|
90
|
+
lat: number;
|
|
91
|
+
lng: number;
|
|
92
|
+
};
|
|
93
|
+
contractType: string | null;
|
|
94
|
+
relativePostedDate: string;
|
|
95
|
+
customData: {
|
|
77
96
|
[x: string]: any;
|
|
78
97
|
};
|
|
79
98
|
}[]>;
|
|
@@ -83,26 +102,23 @@ export declare const JobSearchResponseSchema: import("valibot").ObjectSchema<{
|
|
|
83
102
|
}, undefined, {
|
|
84
103
|
results: {
|
|
85
104
|
id: number;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
pay: string;
|
|
95
|
-
pay_min: string | null;
|
|
96
|
-
pay_max: string | null;
|
|
105
|
+
isNew: boolean;
|
|
106
|
+
company: {
|
|
107
|
+
name: string;
|
|
108
|
+
logo: string;
|
|
109
|
+
};
|
|
110
|
+
employmentType: "FULL_TIME" | "PART_TIME" | "TEMPORARY" | "CONTRACTOR" | "INTERN" | "VOLUNTEER" | "OTHER";
|
|
111
|
+
locationType: "LOCATION" | "REMOTE" | "HYBRID";
|
|
112
|
+
pay: string | undefined;
|
|
97
113
|
description: string;
|
|
98
114
|
title: string;
|
|
99
115
|
coordinates: {
|
|
100
116
|
lat: number;
|
|
101
117
|
lng: number;
|
|
102
118
|
};
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
119
|
+
contractType: string | null;
|
|
120
|
+
relativePostedDate: string;
|
|
121
|
+
customData: {
|
|
106
122
|
[x: string]: any;
|
|
107
123
|
};
|
|
108
124
|
}[];
|
|
@@ -125,26 +141,23 @@ export declare const JobSearchResponseSchema: import("valibot").ObjectSchema<{
|
|
|
125
141
|
data: {
|
|
126
142
|
results: {
|
|
127
143
|
id: number;
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
pay: string;
|
|
137
|
-
pay_min: string | null;
|
|
138
|
-
pay_max: string | null;
|
|
144
|
+
isNew: boolean;
|
|
145
|
+
company: {
|
|
146
|
+
name: string;
|
|
147
|
+
logo: string;
|
|
148
|
+
};
|
|
149
|
+
employmentType: "FULL_TIME" | "PART_TIME" | "TEMPORARY" | "CONTRACTOR" | "INTERN" | "VOLUNTEER" | "OTHER";
|
|
150
|
+
locationType: "LOCATION" | "REMOTE" | "HYBRID";
|
|
151
|
+
pay: string | undefined;
|
|
139
152
|
description: string;
|
|
140
153
|
title: string;
|
|
141
154
|
coordinates: {
|
|
142
155
|
lat: number;
|
|
143
156
|
lng: number;
|
|
144
157
|
};
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
158
|
+
contractType: string | null;
|
|
159
|
+
relativePostedDate: string;
|
|
160
|
+
customData: {
|
|
148
161
|
[x: string]: any;
|
|
149
162
|
};
|
|
150
163
|
}[];
|
|
@@ -159,34 +172,32 @@ export declare const JobSearchResponseSchema: import("valibot").ObjectSchema<{
|
|
|
159
172
|
last_page: number;
|
|
160
173
|
};
|
|
161
174
|
}>;
|
|
162
|
-
export declare const getJobSearchResults: ({ apiClient, logger, signal, }: {
|
|
175
|
+
export declare const getJobSearchResults: ({ apiClient, logger, signal, filters, }: {
|
|
163
176
|
apiClient: ApiClient;
|
|
164
177
|
logger: Logger;
|
|
165
178
|
signal?: AbortSignal | undefined;
|
|
179
|
+
filters: Record<string, FilterValue | undefined>;
|
|
166
180
|
}) => Promise<{
|
|
167
181
|
data: {
|
|
168
182
|
results: {
|
|
169
183
|
id: number;
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
pay: string;
|
|
179
|
-
pay_min: string | null;
|
|
180
|
-
pay_max: string | null;
|
|
184
|
+
isNew: boolean;
|
|
185
|
+
company: {
|
|
186
|
+
name: string;
|
|
187
|
+
logo: string;
|
|
188
|
+
};
|
|
189
|
+
employmentType: "FULL_TIME" | "PART_TIME" | "TEMPORARY" | "CONTRACTOR" | "INTERN" | "VOLUNTEER" | "OTHER";
|
|
190
|
+
locationType: "LOCATION" | "REMOTE" | "HYBRID";
|
|
191
|
+
pay: string | undefined;
|
|
181
192
|
description: string;
|
|
182
193
|
title: string;
|
|
183
194
|
coordinates: {
|
|
184
195
|
lat: number;
|
|
185
196
|
lng: number;
|
|
186
197
|
};
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
198
|
+
contractType: string | null;
|
|
199
|
+
relativePostedDate: string;
|
|
200
|
+
customData: {
|
|
190
201
|
[x: string]: any;
|
|
191
202
|
};
|
|
192
203
|
}[];
|
package/dist/job-search.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { IconName } from './components/icon.tsx';
|
|
1
2
|
type FontSettings = {
|
|
2
3
|
font_family: string;
|
|
3
4
|
weight: 'normal' | 'bold' | 'lighter' | 'bolder' | number;
|
|
@@ -10,12 +11,31 @@ declare const textStyles: {
|
|
|
10
11
|
readonly job_heading: "job_heading";
|
|
11
12
|
};
|
|
12
13
|
type TextStyle = keyof typeof textStyles;
|
|
14
|
+
export declare const FILTER_KEYS: readonly ["company_id", "company_name", "industry", "employment_type", "location_type", "pay_type", "pay_currency", "pay_mask", "pay", "pay_min", "pay_max", "title", "category", "skills", "address_1", "address_2", "town", "city", "postcode", "country", "contract_type", "pay_display"];
|
|
15
|
+
export type FilterKey = (typeof FILTER_KEYS)[number] | (string & {});
|
|
13
16
|
export type FilterProperty = {
|
|
14
|
-
key:
|
|
17
|
+
key: FilterKey;
|
|
18
|
+
/** The label to display for the property.
|
|
19
|
+
* Represents a humanly readable name for the property.
|
|
20
|
+
*/
|
|
15
21
|
label: string;
|
|
22
|
+
/** Override the default icon.
|
|
23
|
+
* Icons are already suggested for each property, but you can override them.
|
|
24
|
+
*/
|
|
25
|
+
icon?: IconName;
|
|
26
|
+
/** Hides the property from the UI
|
|
27
|
+
* You can use this property to hard-code searches without allowing the user to modify or view them.
|
|
28
|
+
*/
|
|
16
29
|
hidden?: boolean;
|
|
30
|
+
/** The initial value for the filter. */
|
|
17
31
|
value?: string;
|
|
32
|
+
/** Whether users can search from the available results.
|
|
33
|
+
* @default false
|
|
34
|
+
*/
|
|
18
35
|
searchable?: boolean;
|
|
36
|
+
/** Whether users can select one or multiple values.
|
|
37
|
+
* @default `'one'`
|
|
38
|
+
*/
|
|
19
39
|
select: 'one' | 'many';
|
|
20
40
|
};
|
|
21
41
|
export type JobSearchPluginParams = {
|
|
@@ -36,15 +56,19 @@ export type JobSearchPluginParams = {
|
|
|
36
56
|
properties: FilterProperty[];
|
|
37
57
|
};
|
|
38
58
|
export declare const createJobSearchDomManager: () => {
|
|
39
|
-
addStyle: (css: string, id: string) => void;
|
|
40
59
|
getRenderTargetElement: () => Element;
|
|
41
60
|
};
|
|
42
61
|
export type ChatbotDomManager = ReturnType<typeof createJobSearchDomManager>;
|
|
43
|
-
export declare const jobSearchPlugin: () => ({ apiClient, logger, analytics }: {
|
|
62
|
+
export declare const jobSearchPlugin: (params: JobSearchPluginParams) => ({ apiClient, logger, analytics }: {
|
|
44
63
|
apiClient: import("@inploi/sdk").ApiClient;
|
|
45
64
|
logger: import("@inploi/sdk").Logger;
|
|
46
65
|
analytics: import("@inploi/sdk").AnalyticsService;
|
|
47
66
|
}) => {
|
|
48
|
-
|
|
67
|
+
/** Returns a string with the initial rendering state of the UI.
|
|
68
|
+
* Useful when server-side rendering to avoid CLS.
|
|
69
|
+
*/
|
|
70
|
+
renderToString: () => string;
|
|
71
|
+
/** Renders the Job Search Plugin inside the container element. */
|
|
72
|
+
render: () => Promise<void>;
|
|
49
73
|
};
|
|
50
74
|
export {};
|
|
@@ -15,7 +15,7 @@ export declare const PaginationSchema: import("valibot").ObjectSchema<{
|
|
|
15
15
|
last_page: number;
|
|
16
16
|
}>;
|
|
17
17
|
export type PaginationSchema = Output<typeof PaginationSchema>;
|
|
18
|
-
export declare const JobSchema: import("valibot").ObjectSchema<{
|
|
18
|
+
export declare const JobSchema: import("valibot").SchemaWithTransform<import("valibot").ObjectSchema<{
|
|
19
19
|
id: import("valibot").NumberSchema<number>;
|
|
20
20
|
company_name: import("valibot").StringSchema<string>;
|
|
21
21
|
company_logo: import("valibot").StringSchema<string>;
|
|
@@ -43,6 +43,7 @@ export declare const JobSchema: import("valibot").ObjectSchema<{
|
|
|
43
43
|
[x: string]: any;
|
|
44
44
|
}>;
|
|
45
45
|
}, undefined, {
|
|
46
|
+
title: string;
|
|
46
47
|
id: number;
|
|
47
48
|
company_name: string;
|
|
48
49
|
company_logo: string;
|
|
@@ -56,7 +57,6 @@ export declare const JobSchema: import("valibot").ObjectSchema<{
|
|
|
56
57
|
pay_min: string | null;
|
|
57
58
|
pay_max: string | null;
|
|
58
59
|
description: string;
|
|
59
|
-
title: string;
|
|
60
60
|
coordinates: {
|
|
61
61
|
lat: number;
|
|
62
62
|
lng: number;
|
|
@@ -66,5 +66,26 @@ export declare const JobSchema: import("valibot").ObjectSchema<{
|
|
|
66
66
|
custom_data: {
|
|
67
67
|
[x: string]: any;
|
|
68
68
|
};
|
|
69
|
+
}>, {
|
|
70
|
+
id: number;
|
|
71
|
+
isNew: boolean;
|
|
72
|
+
company: {
|
|
73
|
+
name: string;
|
|
74
|
+
logo: string;
|
|
75
|
+
};
|
|
76
|
+
employmentType: "FULL_TIME" | "PART_TIME" | "TEMPORARY" | "CONTRACTOR" | "INTERN" | "VOLUNTEER" | "OTHER";
|
|
77
|
+
locationType: "LOCATION" | "REMOTE" | "HYBRID";
|
|
78
|
+
pay: string | undefined;
|
|
79
|
+
description: string;
|
|
80
|
+
title: string;
|
|
81
|
+
coordinates: {
|
|
82
|
+
lat: number;
|
|
83
|
+
lng: number;
|
|
84
|
+
};
|
|
85
|
+
contractType: string | null;
|
|
86
|
+
relativePostedDate: string;
|
|
87
|
+
customData: {
|
|
88
|
+
[x: string]: any;
|
|
89
|
+
};
|
|
69
90
|
}>;
|
|
70
91
|
export type JobSchema = Output<typeof JobSchema>;
|