@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.
- package/lib/{chunk-UT7ADSEJ.mjs → chunk-AOSEKL7U.mjs} +15 -8
- package/lib/chunk-AOSEKL7U.mjs.map +1 -0
- package/lib/pre-token-generation.handler.js +14 -7
- package/lib/pre-token-generation.handler.js.map +1 -1
- package/lib/pre-token-generation.handler.mjs +1 -1
- package/lib/provision-default-workspace.handler.js +14 -7
- package/lib/provision-default-workspace.handler.js.map +1 -1
- package/lib/provision-default-workspace.handler.mjs +1 -1
- package/lib/rest-api-lambda.handler.js +14 -7
- package/lib/rest-api-lambda.handler.js.map +1 -1
- package/lib/rest-api-lambda.handler.mjs +1 -1
- package/package.json +3 -3
- package/lib/chunk-UT7ADSEJ.mjs.map +0 -1
|
@@ -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
|
|
2435
|
-
const
|
|
2436
|
-
if (!
|
|
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:
|
|
2441
|
-
cognitoSub:
|
|
2442
|
-
resource:
|
|
2443
|
-
|
|
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
|
|