@openhi/constructs 0.0.144 → 0.0.145

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.
@@ -10,7 +10,7 @@ import {
10
10
  findUserBySubOperation,
11
11
  idFromReference,
12
12
  parseUserResource
13
- } from "./chunk-UT7ADSEJ.mjs";
13
+ } from "./chunk-AOSEKL7U.mjs";
14
14
  import "./chunk-MVQWAIMC.mjs";
15
15
  import "./chunk-FYHBHHWK.mjs";
16
16
  import {
@@ -7639,16 +7639,23 @@ function getCognitoSubFromRequest(req) {
7639
7639
  async function findUserBySubOperation(params) {
7640
7640
  const { cognitoSub, tableName } = params;
7641
7641
  const service = getDynamoControlService(tableName);
7642
- const result = await service.entities.user.query.gsi2({ cognitoSub }).go({ limit: 1 });
7643
- const item = result.data?.[0];
7644
- if (!item) {
7642
+ const indexResult = await service.entities.user.query.gsi2({ cognitoSub }).go({ limit: 1, attributes: ["id"] });
7643
+ const indexItem = indexResult.data?.[0];
7644
+ if (!indexItem) {
7645
+ return void 0;
7646
+ }
7647
+ const canonical = await service.entities.user.get({ id: indexItem.id, sk: "CURRENT" }).go();
7648
+ const row = canonical.data;
7649
+ if (!row) {
7645
7650
  return void 0;
7646
7651
  }
7647
7652
  return {
7648
- id: item.id,
7649
- cognitoSub: item.cognitoSub,
7650
- resource: item.resource,
7651
- vid: item.vid
7653
+ id: row.id,
7654
+ cognitoSub: row.cognitoSub,
7655
+ resource: row.resource,
7656
+ summary: row.summary,
7657
+ vid: row.vid,
7658
+ lastUpdated: row.lastUpdated
7652
7659
  };
7653
7660
  }
7654
7661