@brownandroot/api 0.13.0 → 0.14.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/dist/index.d.ts +24 -0
- package/dist/index.js +28 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -18,10 +18,15 @@ export interface Employee {
|
|
|
18
18
|
payClass: string | null;
|
|
19
19
|
jobType: string | null;
|
|
20
20
|
jobStep: string | null;
|
|
21
|
+
jobDescription: string | null;
|
|
21
22
|
workSchedule: string | null;
|
|
22
23
|
shift: string | null;
|
|
24
|
+
hourlyRate: string | null;
|
|
25
|
+
annualSalary: string | null;
|
|
23
26
|
termDate: string | null;
|
|
24
27
|
hireDate: string | null;
|
|
28
|
+
topFlexPtoDate: string | null;
|
|
29
|
+
clientPtoDate: string | null;
|
|
25
30
|
securityLevel: string | null;
|
|
26
31
|
reportingLevel: string | null;
|
|
27
32
|
recordType: string | null;
|
|
@@ -30,6 +35,11 @@ export interface Employee {
|
|
|
30
35
|
supervisor: string | null;
|
|
31
36
|
adjustedServiceDate: string | null;
|
|
32
37
|
departmentCode: string | null;
|
|
38
|
+
division: string | null;
|
|
39
|
+
sector: string | null;
|
|
40
|
+
subsector: string | null;
|
|
41
|
+
phone: string | null;
|
|
42
|
+
identityHash: string | null;
|
|
33
43
|
nccerNumber: string | null;
|
|
34
44
|
mentor: string | null;
|
|
35
45
|
source: string | null;
|
|
@@ -218,6 +228,20 @@ export declare class ApiHubClient {
|
|
|
218
228
|
jde: string | null;
|
|
219
229
|
employee: Employee | null;
|
|
220
230
|
}>;
|
|
231
|
+
/** Search employees by home business unit (case-insensitive partial match) */
|
|
232
|
+
searchByHbu(hbu: string): Promise<Employee[]>;
|
|
233
|
+
/**
|
|
234
|
+
* Verify an employee's identity using the canonical identity hash.
|
|
235
|
+
* Inputs are hashed server-side and compared — no PII is stored or returned.
|
|
236
|
+
*/
|
|
237
|
+
verifyIdentity(employeeId: string, inputs: {
|
|
238
|
+
first3FirstName: string;
|
|
239
|
+
first3LastName: string;
|
|
240
|
+
dob: string;
|
|
241
|
+
ssn4: string;
|
|
242
|
+
}): Promise<{
|
|
243
|
+
verified: boolean;
|
|
244
|
+
}>;
|
|
221
245
|
/** List all LLM log entries (newest first) */
|
|
222
246
|
getLlmLogs(): Promise<LlmLog[]>;
|
|
223
247
|
/** Send a chat completion request to the LLM */
|
package/dist/index.js
CHANGED
|
@@ -81,6 +81,34 @@ export class ApiHubClient {
|
|
|
81
81
|
async getJdeFromEmail(email) {
|
|
82
82
|
return this.request(`/employees/jde-from-email/${encodeURIComponent(email)}`);
|
|
83
83
|
}
|
|
84
|
+
/** Search employees by home business unit (case-insensitive partial match) */
|
|
85
|
+
async searchByHbu(hbu) {
|
|
86
|
+
return this.request(`/employees/search?hbu=${encodeURIComponent(hbu)}`);
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Verify an employee's identity using the canonical identity hash.
|
|
90
|
+
* Inputs are hashed server-side and compared — no PII is stored or returned.
|
|
91
|
+
*/
|
|
92
|
+
async verifyIdentity(employeeId, inputs) {
|
|
93
|
+
let res;
|
|
94
|
+
try {
|
|
95
|
+
res = await fetch(`${this.baseUrl}/employees/${encodeURIComponent(employeeId)}/verify-identity`, {
|
|
96
|
+
method: 'POST',
|
|
97
|
+
headers: { 'x-api-key': this.apiKey, 'Content-Type': 'application/json' },
|
|
98
|
+
body: JSON.stringify(inputs),
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
throw new Error(`APIHub unavailable: ${this.baseUrl}/employees/${employeeId}/verify-identity`);
|
|
103
|
+
}
|
|
104
|
+
if (!res.ok) {
|
|
105
|
+
const body = await res.json().catch(() => null);
|
|
106
|
+
const message = (body && typeof body === 'object' && 'error' in body && typeof body.error === 'string' ? body.error : null) ??
|
|
107
|
+
`Request failed: ${res.status} ${res.statusText}`;
|
|
108
|
+
throw new Error(message);
|
|
109
|
+
}
|
|
110
|
+
return res.json();
|
|
111
|
+
}
|
|
84
112
|
// -----------------------------------------------------------------------
|
|
85
113
|
// LLM Logs
|
|
86
114
|
// -----------------------------------------------------------------------
|