@prodigio-io/sdk 2.1.1 → 2.1.3
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/dist/index.d.mts +123 -0
- package/dist/index.d.ts +123 -0
- package/dist/index.js +16 -13
- package/dist/index.mjs +16 -13
- package/package.json +12 -3
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
interface ProdigioConfig {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
baseUrl?: string;
|
|
4
|
+
}
|
|
5
|
+
interface ProdigioInitConfig {
|
|
6
|
+
key: string;
|
|
7
|
+
badgeToken?: string;
|
|
8
|
+
baseUrl?: string;
|
|
9
|
+
badge?: {
|
|
10
|
+
position?: 'bottom-right' | 'bottom-left';
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
interface SalaryRange {
|
|
14
|
+
min: number;
|
|
15
|
+
max: number;
|
|
16
|
+
currency: string;
|
|
17
|
+
period: 'monthly' | 'yearly';
|
|
18
|
+
}
|
|
19
|
+
interface PoweredBy {
|
|
20
|
+
text: string;
|
|
21
|
+
url: string;
|
|
22
|
+
}
|
|
23
|
+
interface Job {
|
|
24
|
+
id: string;
|
|
25
|
+
title: string;
|
|
26
|
+
companyName: string;
|
|
27
|
+
department: string;
|
|
28
|
+
location: string;
|
|
29
|
+
type: 'full-time' | 'part-time' | 'contract';
|
|
30
|
+
status: 'active' | 'closed' | 'archived' | 'draft';
|
|
31
|
+
description: string;
|
|
32
|
+
requirements: string;
|
|
33
|
+
eligibilityCriteria?: string;
|
|
34
|
+
salaryRange: SalaryRange | null;
|
|
35
|
+
applicationDeadline: string | null;
|
|
36
|
+
/** ISO 8601 date string e.g. "2026-04-01T09:00:00.000Z" — use new Date(createdAt) to convert */
|
|
37
|
+
createdAt: string;
|
|
38
|
+
/** ISO 8601 date string e.g. "2026-04-01T09:00:00.000Z" — use new Date(updatedAt) to convert */
|
|
39
|
+
updatedAt: string;
|
|
40
|
+
poweredBy: PoweredBy;
|
|
41
|
+
}
|
|
42
|
+
interface Applicant {
|
|
43
|
+
fullName: string;
|
|
44
|
+
email: string;
|
|
45
|
+
phone: string;
|
|
46
|
+
location?: string;
|
|
47
|
+
linkedin?: string;
|
|
48
|
+
}
|
|
49
|
+
interface CVInfo {
|
|
50
|
+
url: string;
|
|
51
|
+
fileName: string;
|
|
52
|
+
fileSize: number;
|
|
53
|
+
mimeType: string;
|
|
54
|
+
path?: string;
|
|
55
|
+
}
|
|
56
|
+
interface Achievement {
|
|
57
|
+
description: string;
|
|
58
|
+
attachment?: UploadResult | null;
|
|
59
|
+
}
|
|
60
|
+
interface SubmitApplicationParams {
|
|
61
|
+
jobId: string;
|
|
62
|
+
applicant: Applicant;
|
|
63
|
+
cv: CVInfo;
|
|
64
|
+
coverLetter?: string;
|
|
65
|
+
achievements?: Achievement[];
|
|
66
|
+
}
|
|
67
|
+
interface ApplicationResult {
|
|
68
|
+
id: string;
|
|
69
|
+
message: string;
|
|
70
|
+
scoringError: string | null;
|
|
71
|
+
}
|
|
72
|
+
interface UploadResult {
|
|
73
|
+
url: string;
|
|
74
|
+
fileName: string;
|
|
75
|
+
fileSize: number;
|
|
76
|
+
mimeType: string;
|
|
77
|
+
path: string;
|
|
78
|
+
}
|
|
79
|
+
interface ListJobsParams {
|
|
80
|
+
status?: 'active' | 'all';
|
|
81
|
+
department?: string;
|
|
82
|
+
}
|
|
83
|
+
interface BadgeProps {
|
|
84
|
+
href: string;
|
|
85
|
+
'data-prodigio-badge': string;
|
|
86
|
+
target: string;
|
|
87
|
+
rel: string;
|
|
88
|
+
text: string;
|
|
89
|
+
}
|
|
90
|
+
declare class ProdigioError extends Error {
|
|
91
|
+
readonly status: number;
|
|
92
|
+
readonly code?: string | undefined;
|
|
93
|
+
constructor(message: string, status: number, code?: string | undefined);
|
|
94
|
+
}
|
|
95
|
+
declare class Prodigio {
|
|
96
|
+
private readonly apiKey;
|
|
97
|
+
private readonly baseUrl;
|
|
98
|
+
constructor(config: ProdigioConfig | string);
|
|
99
|
+
private get;
|
|
100
|
+
private post;
|
|
101
|
+
private postForm;
|
|
102
|
+
readonly jobs: {
|
|
103
|
+
list: (params?: ListJobsParams) => Promise<Job[]>;
|
|
104
|
+
get: (jobId: string) => Promise<Job>;
|
|
105
|
+
};
|
|
106
|
+
readonly upload: {
|
|
107
|
+
cv: (file: File | Blob, fileName?: string) => Promise<UploadResult>;
|
|
108
|
+
achievement: (file: File | Blob, fileName?: string) => Promise<UploadResult>;
|
|
109
|
+
};
|
|
110
|
+
readonly applications: {
|
|
111
|
+
submit: (params: SubmitApplicationParams) => Promise<ApplicationResult>;
|
|
112
|
+
};
|
|
113
|
+
static readonly POWERED_BY: PoweredBy;
|
|
114
|
+
static badge(poweredBy?: PoweredBy): BadgeProps;
|
|
115
|
+
static meta(): {
|
|
116
|
+
name: string;
|
|
117
|
+
content: string;
|
|
118
|
+
};
|
|
119
|
+
static destroy(): void;
|
|
120
|
+
static init(config: ProdigioInitConfig): Promise<void>;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export { type Achievement, type Applicant, type ApplicationResult, type BadgeProps, type CVInfo, type Job, type ListJobsParams, type PoweredBy, Prodigio, type ProdigioConfig, ProdigioError, type ProdigioInitConfig, type SalaryRange, type SubmitApplicationParams, type UploadResult, Prodigio as default };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
interface ProdigioConfig {
|
|
2
|
+
apiKey: string;
|
|
3
|
+
baseUrl?: string;
|
|
4
|
+
}
|
|
5
|
+
interface ProdigioInitConfig {
|
|
6
|
+
key: string;
|
|
7
|
+
badgeToken?: string;
|
|
8
|
+
baseUrl?: string;
|
|
9
|
+
badge?: {
|
|
10
|
+
position?: 'bottom-right' | 'bottom-left';
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
interface SalaryRange {
|
|
14
|
+
min: number;
|
|
15
|
+
max: number;
|
|
16
|
+
currency: string;
|
|
17
|
+
period: 'monthly' | 'yearly';
|
|
18
|
+
}
|
|
19
|
+
interface PoweredBy {
|
|
20
|
+
text: string;
|
|
21
|
+
url: string;
|
|
22
|
+
}
|
|
23
|
+
interface Job {
|
|
24
|
+
id: string;
|
|
25
|
+
title: string;
|
|
26
|
+
companyName: string;
|
|
27
|
+
department: string;
|
|
28
|
+
location: string;
|
|
29
|
+
type: 'full-time' | 'part-time' | 'contract';
|
|
30
|
+
status: 'active' | 'closed' | 'archived' | 'draft';
|
|
31
|
+
description: string;
|
|
32
|
+
requirements: string;
|
|
33
|
+
eligibilityCriteria?: string;
|
|
34
|
+
salaryRange: SalaryRange | null;
|
|
35
|
+
applicationDeadline: string | null;
|
|
36
|
+
/** ISO 8601 date string e.g. "2026-04-01T09:00:00.000Z" — use new Date(createdAt) to convert */
|
|
37
|
+
createdAt: string;
|
|
38
|
+
/** ISO 8601 date string e.g. "2026-04-01T09:00:00.000Z" — use new Date(updatedAt) to convert */
|
|
39
|
+
updatedAt: string;
|
|
40
|
+
poweredBy: PoweredBy;
|
|
41
|
+
}
|
|
42
|
+
interface Applicant {
|
|
43
|
+
fullName: string;
|
|
44
|
+
email: string;
|
|
45
|
+
phone: string;
|
|
46
|
+
location?: string;
|
|
47
|
+
linkedin?: string;
|
|
48
|
+
}
|
|
49
|
+
interface CVInfo {
|
|
50
|
+
url: string;
|
|
51
|
+
fileName: string;
|
|
52
|
+
fileSize: number;
|
|
53
|
+
mimeType: string;
|
|
54
|
+
path?: string;
|
|
55
|
+
}
|
|
56
|
+
interface Achievement {
|
|
57
|
+
description: string;
|
|
58
|
+
attachment?: UploadResult | null;
|
|
59
|
+
}
|
|
60
|
+
interface SubmitApplicationParams {
|
|
61
|
+
jobId: string;
|
|
62
|
+
applicant: Applicant;
|
|
63
|
+
cv: CVInfo;
|
|
64
|
+
coverLetter?: string;
|
|
65
|
+
achievements?: Achievement[];
|
|
66
|
+
}
|
|
67
|
+
interface ApplicationResult {
|
|
68
|
+
id: string;
|
|
69
|
+
message: string;
|
|
70
|
+
scoringError: string | null;
|
|
71
|
+
}
|
|
72
|
+
interface UploadResult {
|
|
73
|
+
url: string;
|
|
74
|
+
fileName: string;
|
|
75
|
+
fileSize: number;
|
|
76
|
+
mimeType: string;
|
|
77
|
+
path: string;
|
|
78
|
+
}
|
|
79
|
+
interface ListJobsParams {
|
|
80
|
+
status?: 'active' | 'all';
|
|
81
|
+
department?: string;
|
|
82
|
+
}
|
|
83
|
+
interface BadgeProps {
|
|
84
|
+
href: string;
|
|
85
|
+
'data-prodigio-badge': string;
|
|
86
|
+
target: string;
|
|
87
|
+
rel: string;
|
|
88
|
+
text: string;
|
|
89
|
+
}
|
|
90
|
+
declare class ProdigioError extends Error {
|
|
91
|
+
readonly status: number;
|
|
92
|
+
readonly code?: string | undefined;
|
|
93
|
+
constructor(message: string, status: number, code?: string | undefined);
|
|
94
|
+
}
|
|
95
|
+
declare class Prodigio {
|
|
96
|
+
private readonly apiKey;
|
|
97
|
+
private readonly baseUrl;
|
|
98
|
+
constructor(config: ProdigioConfig | string);
|
|
99
|
+
private get;
|
|
100
|
+
private post;
|
|
101
|
+
private postForm;
|
|
102
|
+
readonly jobs: {
|
|
103
|
+
list: (params?: ListJobsParams) => Promise<Job[]>;
|
|
104
|
+
get: (jobId: string) => Promise<Job>;
|
|
105
|
+
};
|
|
106
|
+
readonly upload: {
|
|
107
|
+
cv: (file: File | Blob, fileName?: string) => Promise<UploadResult>;
|
|
108
|
+
achievement: (file: File | Blob, fileName?: string) => Promise<UploadResult>;
|
|
109
|
+
};
|
|
110
|
+
readonly applications: {
|
|
111
|
+
submit: (params: SubmitApplicationParams) => Promise<ApplicationResult>;
|
|
112
|
+
};
|
|
113
|
+
static readonly POWERED_BY: PoweredBy;
|
|
114
|
+
static badge(poweredBy?: PoweredBy): BadgeProps;
|
|
115
|
+
static meta(): {
|
|
116
|
+
name: string;
|
|
117
|
+
content: string;
|
|
118
|
+
};
|
|
119
|
+
static destroy(): void;
|
|
120
|
+
static init(config: ProdigioInitConfig): Promise<void>;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export { type Achievement, type Applicant, type ApplicationResult, type BadgeProps, type CVInfo, type Job, type ListJobsParams, type PoweredBy, Prodigio, type ProdigioConfig, ProdigioError, type ProdigioInitConfig, type SalaryRange, type SubmitApplicationParams, type UploadResult, Prodigio as default };
|
package/dist/index.js
CHANGED
|
@@ -92,10 +92,9 @@ async function verifyBadgeToken(token) {
|
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
var BADGE_ELEMENT_ID = "prodigio-badge-widget";
|
|
95
|
-
function injectBadge(
|
|
95
|
+
function injectBadge(_position) {
|
|
96
96
|
if (typeof document === "undefined") return;
|
|
97
97
|
if (document.getElementById(BADGE_ELEMENT_ID)) return;
|
|
98
|
-
const side = position === "bottom-left" ? "left: 20px;" : "right: 20px;";
|
|
99
98
|
const el = document.createElement("a");
|
|
100
99
|
el.id = BADGE_ELEMENT_ID;
|
|
101
100
|
el.href = "https://prodigio.io";
|
|
@@ -104,21 +103,25 @@ function injectBadge(position = "bottom-right") {
|
|
|
104
103
|
el.setAttribute("data-prodigio-badge", "true");
|
|
105
104
|
el.setAttribute("aria-label", "Hiring powered by Prodigio");
|
|
106
105
|
el.style.cssText = `
|
|
107
|
-
position: fixed; bottom:
|
|
108
|
-
z-index: 2147483647; display: inline-flex; align-items: center; gap:
|
|
109
|
-
padding:
|
|
110
|
-
border-radius:
|
|
106
|
+
position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
|
|
107
|
+
z-index: 2147483647; display: inline-flex; align-items: center; gap: 7px;
|
|
108
|
+
padding: 7px 14px; background: #ffffff; border: 1px solid #e5e5e5;
|
|
109
|
+
border-radius: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
|
|
111
110
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
112
|
-
font-size:
|
|
111
|
+
font-size: 12px; font-weight: 400; color: #555555;
|
|
113
112
|
text-decoration: none; cursor: pointer; transition: box-shadow 0.15s ease;
|
|
113
|
+
white-space: nowrap;
|
|
114
114
|
`;
|
|
115
115
|
el.innerHTML = `
|
|
116
|
-
<
|
|
117
|
-
|
|
118
|
-
<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
116
|
+
<span style="color:#555555;font-weight:400;">Hiring powered by</span>
|
|
117
|
+
<span style="display:inline-flex;align-items:center;gap:5px;">
|
|
118
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
119
|
+
<rect width="24" height="24" rx="6" fill="#3730A3"/>
|
|
120
|
+
<path d="M7 7h5.5a3.5 3.5 0 0 1 0 7H7V7z" fill="#fff"/>
|
|
121
|
+
<path d="M7 14h6a3 3 0 0 1 0 6H7v-6z" fill="#fff" opacity="0.6"/>
|
|
122
|
+
</svg>
|
|
123
|
+
<span style="color:#111111;font-weight:600;font-size:12px;">Prodigio</span>
|
|
124
|
+
</span>
|
|
122
125
|
`;
|
|
123
126
|
el.addEventListener("mouseenter", () => {
|
|
124
127
|
el.style.boxShadow = "0 4px 12px rgba(0,0,0,0.12)";
|
package/dist/index.mjs
CHANGED
|
@@ -66,10 +66,9 @@ async function verifyBadgeToken(token) {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
var BADGE_ELEMENT_ID = "prodigio-badge-widget";
|
|
69
|
-
function injectBadge(
|
|
69
|
+
function injectBadge(_position) {
|
|
70
70
|
if (typeof document === "undefined") return;
|
|
71
71
|
if (document.getElementById(BADGE_ELEMENT_ID)) return;
|
|
72
|
-
const side = position === "bottom-left" ? "left: 20px;" : "right: 20px;";
|
|
73
72
|
const el = document.createElement("a");
|
|
74
73
|
el.id = BADGE_ELEMENT_ID;
|
|
75
74
|
el.href = "https://prodigio.io";
|
|
@@ -78,21 +77,25 @@ function injectBadge(position = "bottom-right") {
|
|
|
78
77
|
el.setAttribute("data-prodigio-badge", "true");
|
|
79
78
|
el.setAttribute("aria-label", "Hiring powered by Prodigio");
|
|
80
79
|
el.style.cssText = `
|
|
81
|
-
position: fixed; bottom:
|
|
82
|
-
z-index: 2147483647; display: inline-flex; align-items: center; gap:
|
|
83
|
-
padding:
|
|
84
|
-
border-radius:
|
|
80
|
+
position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
|
|
81
|
+
z-index: 2147483647; display: inline-flex; align-items: center; gap: 7px;
|
|
82
|
+
padding: 7px 14px; background: #ffffff; border: 1px solid #e5e5e5;
|
|
83
|
+
border-radius: 24px; box-shadow: 0 2px 8px rgba(0,0,0,0.08);
|
|
85
84
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
|
|
86
|
-
font-size:
|
|
85
|
+
font-size: 12px; font-weight: 400; color: #555555;
|
|
87
86
|
text-decoration: none; cursor: pointer; transition: box-shadow 0.15s ease;
|
|
87
|
+
white-space: nowrap;
|
|
88
88
|
`;
|
|
89
89
|
el.innerHTML = `
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
<
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
90
|
+
<span style="color:#555555;font-weight:400;">Hiring powered by</span>
|
|
91
|
+
<span style="display:inline-flex;align-items:center;gap:5px;">
|
|
92
|
+
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
93
|
+
<rect width="24" height="24" rx="6" fill="#3730A3"/>
|
|
94
|
+
<path d="M7 7h5.5a3.5 3.5 0 0 1 0 7H7V7z" fill="#fff"/>
|
|
95
|
+
<path d="M7 14h6a3 3 0 0 1 0 6H7v-6z" fill="#fff" opacity="0.6"/>
|
|
96
|
+
</svg>
|
|
97
|
+
<span style="color:#111111;font-weight:600;font-size:12px;">Prodigio</span>
|
|
98
|
+
</span>
|
|
96
99
|
`;
|
|
97
100
|
el.addEventListener("mouseenter", () => {
|
|
98
101
|
el.style.boxShadow = "0 4px 12px rgba(0,0,0,0.12)";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prodigio-io/sdk",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.3",
|
|
4
4
|
"description": "Official JavaScript SDK for the Prodigio hiring API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -12,14 +12,23 @@
|
|
|
12
12
|
"require": "./dist/index.js"
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
|
-
"files": [
|
|
15
|
+
"files": [
|
|
16
|
+
"dist"
|
|
17
|
+
],
|
|
16
18
|
"scripts": {
|
|
17
19
|
"build": "tsup src/index.ts --format esm,cjs --dts --clean",
|
|
18
20
|
"dev": "tsup src/index.ts --format esm,cjs --dts --watch"
|
|
19
21
|
},
|
|
20
|
-
"keywords": [
|
|
22
|
+
"keywords": [
|
|
23
|
+
"prodigio",
|
|
24
|
+
"hiring",
|
|
25
|
+
"jobs",
|
|
26
|
+
"recruitment",
|
|
27
|
+
"api"
|
|
28
|
+
],
|
|
21
29
|
"license": "MIT",
|
|
22
30
|
"devDependencies": {
|
|
31
|
+
"@types/node": "^25.6.0",
|
|
23
32
|
"tsup": "^8.0.0",
|
|
24
33
|
"typescript": "^5.0.0"
|
|
25
34
|
}
|