@healthier-business/hub-sdk 0.4.2 → 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.
@@ -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`). The portal's own integer id is never exposed. Candidates are created and edited in the Hub core API. */
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`). The portal's own integer id is never exposed. Candidates are created and edited in the Hub core API. */
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`). The portal's own integer id is never exposed. Candidates are created and edited in the Hub core API. */
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. */
@@ -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`). The portal's own integer id is never exposed. Candidates are created and edited in the Hub core API. */
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`). The portal's own integer id is never exposed. Candidates are created and edited in the Hub core API. */
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`). The portal's own integer id is never exposed. Candidates are created and edited in the Hub core API. */
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. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@healthier-business/hub-sdk",
3
- "version": "0.4.2",
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",