@openhi/constructs 0.0.144 → 0.0.146

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.
@@ -7,7 +7,7 @@ import {
7
7
  findUserBySubOperation,
8
8
  idFromReference,
9
9
  parseUserResource
10
- } from "./chunk-UT7ADSEJ.mjs";
10
+ } from "./chunk-AOSEKL7U.mjs";
11
11
  import "./chunk-MVQWAIMC.mjs";
12
12
  import "./chunk-FYHBHHWK.mjs";
13
13
  import "./chunk-VZCPGQXA.mjs";
@@ -2431,16 +2431,23 @@ var import_types9 = require("@openhi/types");
2431
2431
  async function findUserBySubOperation(params) {
2432
2432
  const { cognitoSub, tableName } = params;
2433
2433
  const service = getDynamoControlService(tableName);
2434
- const result = await service.entities.user.query.gsi2({ cognitoSub }).go({ limit: 1 });
2435
- const item = result.data?.[0];
2436
- if (!item) {
2434
+ const indexResult = await service.entities.user.query.gsi2({ cognitoSub }).go({ limit: 1, attributes: ["id"] });
2435
+ const indexItem = indexResult.data?.[0];
2436
+ if (!indexItem) {
2437
+ return void 0;
2438
+ }
2439
+ const canonical = await service.entities.user.get({ id: indexItem.id, sk: "CURRENT" }).go();
2440
+ const row = canonical.data;
2441
+ if (!row) {
2437
2442
  return void 0;
2438
2443
  }
2439
2444
  return {
2440
- id: item.id,
2441
- cognitoSub: item.cognitoSub,
2442
- resource: item.resource,
2443
- vid: item.vid
2445
+ id: row.id,
2446
+ cognitoSub: row.cognitoSub,
2447
+ resource: row.resource,
2448
+ summary: row.summary,
2449
+ vid: row.vid,
2450
+ lastUpdated: row.lastUpdated
2444
2451
  };
2445
2452
  }
2446
2453