@healthier-business/hub-sdk 0.4.1 → 0.4.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/cjs/generated/operations.js +1 -1
- package/dist/cjs/generated/resources.d.ts +4 -0
- package/dist/cjs/generated/types.d.ts +21 -15
- package/dist/esm/generated/operations.js +1 -1
- package/dist/esm/generated/resources.d.ts +4 -0
- package/dist/esm/generated/types.d.ts +21 -15
- package/package.json +1 -1
|
@@ -60,7 +60,7 @@ exports.OPERATIONS = {
|
|
|
60
60
|
"dbs-rtw.workers.verify": { method: 'POST', path: "/api/v2/dbs-rtw/workers/{worker}/verify", pathParams: ["worker"], query: [], body: 'json', idempotent: true, paginated: false, response: 'json', scope: "dbs-rtw:verification:write" },
|
|
61
61
|
"hub.candidates.create": { method: 'POST', path: "/api/v2/hub/candidates", pathParams: [], query: [], body: 'json', idempotent: true, paginated: false, response: 'json', scope: "hub:candidates:write" },
|
|
62
62
|
"hub.candidates.show": { method: 'GET', path: "/api/v2/hub/candidates/{candidate_ref}", pathParams: ["candidate_ref"], query: [], body: null, idempotent: false, paginated: false, response: 'json', scope: "hub:candidates:read" },
|
|
63
|
-
"hub.candidates.list": { method: 'GET', path: "/api/v2/hub/candidates", pathParams: [], query: ["page", "per_page", "sort", "search", "updated_from", "updated_to", "added_from", "added_to", "status", "compliance_status", "role", "is_active"], body: null, idempotent: false, paginated: true, response: 'json', scope: "hub:candidates:read" },
|
|
63
|
+
"hub.candidates.list": { method: 'GET', path: "/api/v2/hub/candidates", pathParams: [], query: ["page", "per_page", "sort", "search", "updated_from", "updated_to", "added_from", "added_to", "last_login_from", "last_login_to", "status", "compliance_status", "role", "is_active"], body: null, idempotent: false, paginated: true, response: 'json', scope: "hub:candidates:read" },
|
|
64
64
|
"hub.candidates.update": { method: 'PATCH', path: "/api/v2/hub/candidates/{candidate_ref}", pathParams: ["candidate_ref"], query: [], body: 'json', idempotent: false, paginated: false, response: 'json', scope: "hub:candidates:write" },
|
|
65
65
|
"occupational-health.alerts.clear": { method: 'POST', path: "/api/v2/occupational-health/alerts/clear", pathParams: [], query: [], body: null, idempotent: false, paginated: false, response: 'json', scope: "occupational-health:alerts:write" },
|
|
66
66
|
"occupational-health.alerts.dismiss": { method: 'POST', path: "/api/v2/occupational-health/alerts/dismiss", pathParams: [], query: [], body: 'json', idempotent: false, paginated: false, response: 'json', scope: "occupational-health:alerts:write" },
|
|
@@ -652,6 +652,10 @@ export interface HubCandidatesListParams {
|
|
|
652
652
|
added_from?: string;
|
|
653
653
|
/** Only rows whose `added` date is on or before this date: the end of that day in UTC. Any date (`2026-10-31`) or ISO 8601 time. Must not be before the matching `added_from`. */
|
|
654
654
|
added_to?: string;
|
|
655
|
+
/** Only rows whose `last_login` date is on or after this date: the start of that day in UTC. Any date (`2026-10-01`) or ISO 8601 time. Must not be after the matching `last_login_to`. */
|
|
656
|
+
last_login_from?: string;
|
|
657
|
+
/** Only rows whose `last_login` date is on or before this date: the end of that day in UTC. Any date (`2026-10-31`) or ISO 8601 time. Must not be before the matching `last_login_from`. */
|
|
658
|
+
last_login_to?: string;
|
|
655
659
|
/** Only candidates with this compliance status (same as `compliance_status`). One of: `compliant`, `expiring_soon`, `expired`, `pending`, `na`. */
|
|
656
660
|
status?: "compliant" | "expiring_soon" | "expired" | "pending" | "na";
|
|
657
661
|
/** Only candidates with this compliance status. One of: `compliant`, `expiring_soon`, `expired`, `pending`, `na`. */
|
|
@@ -668,6 +668,8 @@ export type Error = {
|
|
|
668
668
|
export type HubCandidate = {
|
|
669
669
|
/** The uuid that identifies this person in every portal API. Use it in paths and filters of the other APIs. */
|
|
670
670
|
candidate_ref: string;
|
|
671
|
+
/** The candidate's id in the HB Portal: the number the old API called `candidate_id`, and the `portal_id` of the Online Training service. It is not the Hub's own id (which is never exposed), and it is for matching… */
|
|
672
|
+
hb_candidate_id: number | null;
|
|
671
673
|
/** The candidate's first name. */
|
|
672
674
|
first_name: string;
|
|
673
675
|
/** The candidate's last name. */
|
|
@@ -694,12 +696,18 @@ export type HubCandidate = {
|
|
|
694
696
|
next_expiry_date: string | null;
|
|
695
697
|
/** When the candidate was added to Hub. */
|
|
696
698
|
added_at: string | null;
|
|
699
|
+
/** The username the candidate signs in with; null when it is not known. */
|
|
700
|
+
username: string | null;
|
|
701
|
+
/** When the candidate last signed in; null when they never have. */
|
|
702
|
+
last_login_at: string | null;
|
|
697
703
|
/** When the candidate was last changed. */
|
|
698
704
|
updated_at: string | null;
|
|
699
705
|
};
|
|
700
706
|
export type HubCandidateDetail = {
|
|
701
707
|
/** The uuid that identifies this person in every portal API. Use it in paths and filters of the other APIs. */
|
|
702
708
|
candidate_ref: string;
|
|
709
|
+
/** The candidate's id in the HB Portal: the number the old API called `candidate_id`, and the `portal_id` of the Online Training service. It is not the Hub's own id (which is never exposed), and it is for matching… */
|
|
710
|
+
hb_candidate_id: number | null;
|
|
703
711
|
/** The candidate's first name. */
|
|
704
712
|
first_name: string;
|
|
705
713
|
/** The candidate's last name. */
|
|
@@ -726,6 +734,10 @@ export type HubCandidateDetail = {
|
|
|
726
734
|
next_expiry_date: string | null;
|
|
727
735
|
/** When the candidate was added to Hub. */
|
|
728
736
|
added_at: string | null;
|
|
737
|
+
/** The username the candidate signs in with; null when it is not known. */
|
|
738
|
+
username: string | null;
|
|
739
|
+
/** When the candidate last signed in; null when they never have. */
|
|
740
|
+
last_login_at: string | null;
|
|
729
741
|
/** When the candidate was last changed. */
|
|
730
742
|
updated_at: string | null;
|
|
731
743
|
/** How many of the candidate's items are in each state. */
|
|
@@ -1396,8 +1408,10 @@ export type OtAssignment = {
|
|
|
1396
1408
|
credits_charged: number;
|
|
1397
1409
|
/** The candidate as they are after the call: every field of a row of `GET /candidates`. */
|
|
1398
1410
|
candidate: {
|
|
1399
|
-
/** The candidate's Hub uuid (`candidate_ref`)
|
|
1411
|
+
/** The candidate's Hub uuid (`candidate_ref`), the id every call takes. Candidates are created and edited in the Hub core API. */
|
|
1400
1412
|
candidate_ref: string | null;
|
|
1413
|
+
/** The candidate's id in the HB Portal: the number the old API called `candidate_id`. It is for matching records you already hold; `candidate_ref` is what every API call takes. */
|
|
1414
|
+
hb_candidate_id: number;
|
|
1401
1415
|
/** The candidate's first name. */
|
|
1402
1416
|
first_name: string;
|
|
1403
1417
|
/** The candidate's last name. */
|
|
@@ -1431,8 +1445,10 @@ export type OtAssignment = {
|
|
|
1431
1445
|
};
|
|
1432
1446
|
};
|
|
1433
1447
|
export type OtCandidate = {
|
|
1434
|
-
/** The candidate's Hub uuid (`candidate_ref`)
|
|
1448
|
+
/** The candidate's Hub uuid (`candidate_ref`), the id every call takes. Candidates are created and edited in the Hub core API. */
|
|
1435
1449
|
candidate_ref: string | null;
|
|
1450
|
+
/** The candidate's id in the HB Portal: the number the old API called `candidate_id`. It is for matching records you already hold; `candidate_ref` is what every API call takes. */
|
|
1451
|
+
hb_candidate_id: number;
|
|
1436
1452
|
/** The candidate's first name. */
|
|
1437
1453
|
first_name: string;
|
|
1438
1454
|
/** The candidate's last name. */
|
|
@@ -1465,8 +1481,10 @@ export type OtCandidate = {
|
|
|
1465
1481
|
expires_at: string | null;
|
|
1466
1482
|
};
|
|
1467
1483
|
export type OtCandidateDetail = {
|
|
1468
|
-
/** The candidate's Hub uuid (`candidate_ref`)
|
|
1484
|
+
/** The candidate's Hub uuid (`candidate_ref`), the id every call takes. Candidates are created and edited in the Hub core API. */
|
|
1469
1485
|
candidate_ref: string | null;
|
|
1486
|
+
/** The candidate's id in the HB Portal: the number the old API called `candidate_id`. It is for matching records you already hold; `candidate_ref` is what every API call takes. */
|
|
1487
|
+
hb_candidate_id: number;
|
|
1470
1488
|
/** The candidate's first name. */
|
|
1471
1489
|
first_name: string;
|
|
1472
1490
|
/** The candidate's last name. */
|
|
@@ -2479,16 +2497,6 @@ export type RefReferee = {
|
|
|
2479
2497
|
status_label: string;
|
|
2480
2498
|
/** The simpler status the Hub screens show a client: `received`, `rejected`, `expired`, `overdue`, `legacy` or `requested`. */
|
|
2481
2499
|
display_status: string;
|
|
2482
|
-
/** The score of the reference: the weighted average of the scored questions, rounded to two decimals. Null when the client does not use scoring, when the form has no scoring criteria, or when the answers did not match… */
|
|
2483
|
-
score: number | null;
|
|
2484
|
-
/** How the score was reached: one item per scored question with its `label`, the `value` answered, the `raw_score`, the `weight` and the `weighted_score`. Empty when the client does not use scoring or the reference is… */
|
|
2485
|
-
score_breakdown: {
|
|
2486
|
-
label: string;
|
|
2487
|
-
value: unknown;
|
|
2488
|
-
raw_score: number;
|
|
2489
|
-
weight: number;
|
|
2490
|
-
weighted_score: number;
|
|
2491
|
-
}[];
|
|
2492
2500
|
/** The reason the referee gave for declining, in their own words. It is set only when `status` is `declined` and the referee wrote one; null otherwise. It is free text from a third party: show it as plain text. It is… */
|
|
2493
2501
|
decline_reason: string | null;
|
|
2494
2502
|
/** The answers the referee gave, in the order recorded. Each has the question's `field_code` (the question id on the form), its `label` (the question text; the `field_code` again when the form no longer has that… */
|
|
@@ -4348,8 +4356,6 @@ export type WebhookReferencesReferenceSubmittedData = {
|
|
|
4348
4356
|
reference_request_uuid: string;
|
|
4349
4357
|
/** The candidate's `candidate_ref` (the Hub uuid the APIs use). The candidate's name and email are never in the webhook; read them with `GET /api/v2/references/requests/{uuid}` or the Hub core API. Always present: a… */
|
|
4350
4358
|
candidate_ref: string;
|
|
4351
|
-
/** The score of the reference as a decimal string with two decimals (for example `"4.25"`: a string, not a JSON number), as stored by the references engine. Null when the client does not use scoring or the answers could… */
|
|
4352
|
-
score: string | null;
|
|
4353
4359
|
/** When the referee submitted the reference, ISO 8601 UTC with a `Z`. */
|
|
4354
4360
|
submitted_at: string;
|
|
4355
4361
|
};
|
|
@@ -57,7 +57,7 @@ export const OPERATIONS = {
|
|
|
57
57
|
"dbs-rtw.workers.verify": { method: 'POST', path: "/api/v2/dbs-rtw/workers/{worker}/verify", pathParams: ["worker"], query: [], body: 'json', idempotent: true, paginated: false, response: 'json', scope: "dbs-rtw:verification:write" },
|
|
58
58
|
"hub.candidates.create": { method: 'POST', path: "/api/v2/hub/candidates", pathParams: [], query: [], body: 'json', idempotent: true, paginated: false, response: 'json', scope: "hub:candidates:write" },
|
|
59
59
|
"hub.candidates.show": { method: 'GET', path: "/api/v2/hub/candidates/{candidate_ref}", pathParams: ["candidate_ref"], query: [], body: null, idempotent: false, paginated: false, response: 'json', scope: "hub:candidates:read" },
|
|
60
|
-
"hub.candidates.list": { method: 'GET', path: "/api/v2/hub/candidates", pathParams: [], query: ["page", "per_page", "sort", "search", "updated_from", "updated_to", "added_from", "added_to", "status", "compliance_status", "role", "is_active"], body: null, idempotent: false, paginated: true, response: 'json', scope: "hub:candidates:read" },
|
|
60
|
+
"hub.candidates.list": { method: 'GET', path: "/api/v2/hub/candidates", pathParams: [], query: ["page", "per_page", "sort", "search", "updated_from", "updated_to", "added_from", "added_to", "last_login_from", "last_login_to", "status", "compliance_status", "role", "is_active"], body: null, idempotent: false, paginated: true, response: 'json', scope: "hub:candidates:read" },
|
|
61
61
|
"hub.candidates.update": { method: 'PATCH', path: "/api/v2/hub/candidates/{candidate_ref}", pathParams: ["candidate_ref"], query: [], body: 'json', idempotent: false, paginated: false, response: 'json', scope: "hub:candidates:write" },
|
|
62
62
|
"occupational-health.alerts.clear": { method: 'POST', path: "/api/v2/occupational-health/alerts/clear", pathParams: [], query: [], body: null, idempotent: false, paginated: false, response: 'json', scope: "occupational-health:alerts:write" },
|
|
63
63
|
"occupational-health.alerts.dismiss": { method: 'POST', path: "/api/v2/occupational-health/alerts/dismiss", pathParams: [], query: [], body: 'json', idempotent: false, paginated: false, response: 'json', scope: "occupational-health:alerts:write" },
|
|
@@ -652,6 +652,10 @@ export interface HubCandidatesListParams {
|
|
|
652
652
|
added_from?: string;
|
|
653
653
|
/** Only rows whose `added` date is on or before this date: the end of that day in UTC. Any date (`2026-10-31`) or ISO 8601 time. Must not be before the matching `added_from`. */
|
|
654
654
|
added_to?: string;
|
|
655
|
+
/** Only rows whose `last_login` date is on or after this date: the start of that day in UTC. Any date (`2026-10-01`) or ISO 8601 time. Must not be after the matching `last_login_to`. */
|
|
656
|
+
last_login_from?: string;
|
|
657
|
+
/** Only rows whose `last_login` date is on or before this date: the end of that day in UTC. Any date (`2026-10-31`) or ISO 8601 time. Must not be before the matching `last_login_from`. */
|
|
658
|
+
last_login_to?: string;
|
|
655
659
|
/** Only candidates with this compliance status (same as `compliance_status`). One of: `compliant`, `expiring_soon`, `expired`, `pending`, `na`. */
|
|
656
660
|
status?: "compliant" | "expiring_soon" | "expired" | "pending" | "na";
|
|
657
661
|
/** Only candidates with this compliance status. One of: `compliant`, `expiring_soon`, `expired`, `pending`, `na`. */
|
|
@@ -668,6 +668,8 @@ export type Error = {
|
|
|
668
668
|
export type HubCandidate = {
|
|
669
669
|
/** The uuid that identifies this person in every portal API. Use it in paths and filters of the other APIs. */
|
|
670
670
|
candidate_ref: string;
|
|
671
|
+
/** The candidate's id in the HB Portal: the number the old API called `candidate_id`, and the `portal_id` of the Online Training service. It is not the Hub's own id (which is never exposed), and it is for matching… */
|
|
672
|
+
hb_candidate_id: number | null;
|
|
671
673
|
/** The candidate's first name. */
|
|
672
674
|
first_name: string;
|
|
673
675
|
/** The candidate's last name. */
|
|
@@ -694,12 +696,18 @@ export type HubCandidate = {
|
|
|
694
696
|
next_expiry_date: string | null;
|
|
695
697
|
/** When the candidate was added to Hub. */
|
|
696
698
|
added_at: string | null;
|
|
699
|
+
/** The username the candidate signs in with; null when it is not known. */
|
|
700
|
+
username: string | null;
|
|
701
|
+
/** When the candidate last signed in; null when they never have. */
|
|
702
|
+
last_login_at: string | null;
|
|
697
703
|
/** When the candidate was last changed. */
|
|
698
704
|
updated_at: string | null;
|
|
699
705
|
};
|
|
700
706
|
export type HubCandidateDetail = {
|
|
701
707
|
/** The uuid that identifies this person in every portal API. Use it in paths and filters of the other APIs. */
|
|
702
708
|
candidate_ref: string;
|
|
709
|
+
/** The candidate's id in the HB Portal: the number the old API called `candidate_id`, and the `portal_id` of the Online Training service. It is not the Hub's own id (which is never exposed), and it is for matching… */
|
|
710
|
+
hb_candidate_id: number | null;
|
|
703
711
|
/** The candidate's first name. */
|
|
704
712
|
first_name: string;
|
|
705
713
|
/** The candidate's last name. */
|
|
@@ -726,6 +734,10 @@ export type HubCandidateDetail = {
|
|
|
726
734
|
next_expiry_date: string | null;
|
|
727
735
|
/** When the candidate was added to Hub. */
|
|
728
736
|
added_at: string | null;
|
|
737
|
+
/** The username the candidate signs in with; null when it is not known. */
|
|
738
|
+
username: string | null;
|
|
739
|
+
/** When the candidate last signed in; null when they never have. */
|
|
740
|
+
last_login_at: string | null;
|
|
729
741
|
/** When the candidate was last changed. */
|
|
730
742
|
updated_at: string | null;
|
|
731
743
|
/** How many of the candidate's items are in each state. */
|
|
@@ -1396,8 +1408,10 @@ export type OtAssignment = {
|
|
|
1396
1408
|
credits_charged: number;
|
|
1397
1409
|
/** The candidate as they are after the call: every field of a row of `GET /candidates`. */
|
|
1398
1410
|
candidate: {
|
|
1399
|
-
/** The candidate's Hub uuid (`candidate_ref`)
|
|
1411
|
+
/** The candidate's Hub uuid (`candidate_ref`), the id every call takes. Candidates are created and edited in the Hub core API. */
|
|
1400
1412
|
candidate_ref: string | null;
|
|
1413
|
+
/** The candidate's id in the HB Portal: the number the old API called `candidate_id`. It is for matching records you already hold; `candidate_ref` is what every API call takes. */
|
|
1414
|
+
hb_candidate_id: number;
|
|
1401
1415
|
/** The candidate's first name. */
|
|
1402
1416
|
first_name: string;
|
|
1403
1417
|
/** The candidate's last name. */
|
|
@@ -1431,8 +1445,10 @@ export type OtAssignment = {
|
|
|
1431
1445
|
};
|
|
1432
1446
|
};
|
|
1433
1447
|
export type OtCandidate = {
|
|
1434
|
-
/** The candidate's Hub uuid (`candidate_ref`)
|
|
1448
|
+
/** The candidate's Hub uuid (`candidate_ref`), the id every call takes. Candidates are created and edited in the Hub core API. */
|
|
1435
1449
|
candidate_ref: string | null;
|
|
1450
|
+
/** The candidate's id in the HB Portal: the number the old API called `candidate_id`. It is for matching records you already hold; `candidate_ref` is what every API call takes. */
|
|
1451
|
+
hb_candidate_id: number;
|
|
1436
1452
|
/** The candidate's first name. */
|
|
1437
1453
|
first_name: string;
|
|
1438
1454
|
/** The candidate's last name. */
|
|
@@ -1465,8 +1481,10 @@ export type OtCandidate = {
|
|
|
1465
1481
|
expires_at: string | null;
|
|
1466
1482
|
};
|
|
1467
1483
|
export type OtCandidateDetail = {
|
|
1468
|
-
/** The candidate's Hub uuid (`candidate_ref`)
|
|
1484
|
+
/** The candidate's Hub uuid (`candidate_ref`), the id every call takes. Candidates are created and edited in the Hub core API. */
|
|
1469
1485
|
candidate_ref: string | null;
|
|
1486
|
+
/** The candidate's id in the HB Portal: the number the old API called `candidate_id`. It is for matching records you already hold; `candidate_ref` is what every API call takes. */
|
|
1487
|
+
hb_candidate_id: number;
|
|
1470
1488
|
/** The candidate's first name. */
|
|
1471
1489
|
first_name: string;
|
|
1472
1490
|
/** The candidate's last name. */
|
|
@@ -2479,16 +2497,6 @@ export type RefReferee = {
|
|
|
2479
2497
|
status_label: string;
|
|
2480
2498
|
/** The simpler status the Hub screens show a client: `received`, `rejected`, `expired`, `overdue`, `legacy` or `requested`. */
|
|
2481
2499
|
display_status: string;
|
|
2482
|
-
/** The score of the reference: the weighted average of the scored questions, rounded to two decimals. Null when the client does not use scoring, when the form has no scoring criteria, or when the answers did not match… */
|
|
2483
|
-
score: number | null;
|
|
2484
|
-
/** How the score was reached: one item per scored question with its `label`, the `value` answered, the `raw_score`, the `weight` and the `weighted_score`. Empty when the client does not use scoring or the reference is… */
|
|
2485
|
-
score_breakdown: {
|
|
2486
|
-
label: string;
|
|
2487
|
-
value: unknown;
|
|
2488
|
-
raw_score: number;
|
|
2489
|
-
weight: number;
|
|
2490
|
-
weighted_score: number;
|
|
2491
|
-
}[];
|
|
2492
2500
|
/** The reason the referee gave for declining, in their own words. It is set only when `status` is `declined` and the referee wrote one; null otherwise. It is free text from a third party: show it as plain text. It is… */
|
|
2493
2501
|
decline_reason: string | null;
|
|
2494
2502
|
/** The answers the referee gave, in the order recorded. Each has the question's `field_code` (the question id on the form), its `label` (the question text; the `field_code` again when the form no longer has that… */
|
|
@@ -4348,8 +4356,6 @@ export type WebhookReferencesReferenceSubmittedData = {
|
|
|
4348
4356
|
reference_request_uuid: string;
|
|
4349
4357
|
/** The candidate's `candidate_ref` (the Hub uuid the APIs use). The candidate's name and email are never in the webhook; read them with `GET /api/v2/references/requests/{uuid}` or the Hub core API. Always present: a… */
|
|
4350
4358
|
candidate_ref: string;
|
|
4351
|
-
/** The score of the reference as a decimal string with two decimals (for example `"4.25"`: a string, not a JSON number), as stored by the references engine. Null when the client does not use scoring or the answers could… */
|
|
4352
|
-
score: string | null;
|
|
4353
4359
|
/** When the referee submitted the reference, ISO 8601 UTC with a `Z`. */
|
|
4354
4360
|
submitted_at: string;
|
|
4355
4361
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@healthier-business/hub-sdk",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "The official JavaScript and TypeScript SDK for the Healthier Business Hub API v2: automatic tokens, typed resources for every portal, signed webhooks and embeddable courses, tests and OH forms.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Sanchit Patil",
|