@openhi/constructs 0.0.85 → 0.0.87
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-SWSN6GDD.mjs → chunk-CEOAGPYY.mjs} +1 -5
- package/lib/chunk-CEOAGPYY.mjs.map +1 -0
- package/lib/chunk-X5MHU7DA.mjs +298 -0
- package/lib/chunk-X5MHU7DA.mjs.map +1 -0
- package/lib/data-store-postgres-replication.handler.d.mts +55 -0
- package/lib/data-store-postgres-replication.handler.d.ts +55 -0
- package/lib/data-store-postgres-replication.handler.js +448 -0
- package/lib/data-store-postgres-replication.handler.js.map +1 -0
- package/lib/data-store-postgres-replication.handler.mjs +313 -0
- package/lib/data-store-postgres-replication.handler.mjs.map +1 -0
- package/lib/firehose-archive-transform.handler.js +0 -4
- package/lib/firehose-archive-transform.handler.js.map +1 -1
- package/lib/firehose-archive-transform.handler.mjs +5 -290
- package/lib/firehose-archive-transform.handler.mjs.map +1 -1
- package/lib/index.d.mts +230 -5
- package/lib/index.d.ts +231 -6
- package/lib/index.js +489 -117
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +468 -97
- package/lib/index.mjs.map +1 -1
- package/lib/post-authentication.handler.d.mts +5 -0
- package/lib/post-authentication.handler.d.ts +5 -0
- package/lib/post-authentication.handler.js +45 -0
- package/lib/post-authentication.handler.js.map +1 -0
- package/lib/post-authentication.handler.mjs +25 -0
- package/lib/post-authentication.handler.mjs.map +1 -0
- package/lib/rest-api-lambda.handler.js +636 -153
- package/lib/rest-api-lambda.handler.js.map +1 -1
- package/lib/rest-api-lambda.handler.mjs +639 -153
- package/lib/rest-api-lambda.handler.mjs.map +1 -1
- package/package.json +20 -11
- package/scripts/generate-operations.js +2 -2
- package/scripts/generate-routes.js +1 -1
- package/lib/chunk-SWSN6GDD.mjs.map +0 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/components/cognito/post-authentication.handler.ts
|
|
21
|
+
var post_authentication_handler_exports = {};
|
|
22
|
+
__export(post_authentication_handler_exports, {
|
|
23
|
+
handler: () => handler
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(post_authentication_handler_exports);
|
|
26
|
+
var import_client_cognito_identity_provider = require("@aws-sdk/client-cognito-identity-provider");
|
|
27
|
+
var client = new import_client_cognito_identity_provider.CognitoIdentityProviderClient({});
|
|
28
|
+
var handler = async (event, _context) => {
|
|
29
|
+
try {
|
|
30
|
+
await client.send(
|
|
31
|
+
new import_client_cognito_identity_provider.AdminUserGlobalSignOutCommand({
|
|
32
|
+
UserPoolId: event.userPoolId,
|
|
33
|
+
Username: event.userName
|
|
34
|
+
})
|
|
35
|
+
);
|
|
36
|
+
} catch (err) {
|
|
37
|
+
console.warn("AdminUserGlobalSignOut failed; continuing sign-in", err);
|
|
38
|
+
}
|
|
39
|
+
return event;
|
|
40
|
+
};
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
handler
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=post-authentication.handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/cognito/post-authentication.handler.ts"],"sourcesContent":["import {\n AdminUserGlobalSignOutCommand,\n CognitoIdentityProviderClient,\n} from \"@aws-sdk/client-cognito-identity-provider\";\nimport type {\n Context,\n PostAuthenticationTriggerEvent,\n PostAuthenticationTriggerHandler,\n} from \"aws-lambda\";\n\n/**\n * @see sites/www-docs/content/packages/@openhi/constructs/components/cognito/post-authentication-lambda.md\n *\n * Cognito Post Authentication trigger.\n *\n * Enforces single-device-per-user sessions (ADR 2026-03-17-01) by calling\n * AdminUserGlobalSignOut on every sign-in. Post Authentication fires only\n * on sign-in (not on token refresh), so any existing sessions on other\n * devices are revoked exactly when a new device authenticates.\n *\n * Authentication must not fail because of a sign-out failure: errors are\n * logged and the event is returned unchanged.\n */\nconst client = new CognitoIdentityProviderClient({});\n\nexport const handler: PostAuthenticationTriggerHandler = async (\n event: PostAuthenticationTriggerEvent,\n _context: Context,\n): Promise<PostAuthenticationTriggerEvent> => {\n try {\n await client.send(\n new AdminUserGlobalSignOutCommand({\n UserPoolId: event.userPoolId,\n Username: event.userName,\n }),\n );\n } catch (err) {\n console.warn(\"AdminUserGlobalSignOut failed; continuing sign-in\", err);\n }\n return event;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8CAGO;AAoBP,IAAM,SAAS,IAAI,sEAA8B,CAAC,CAAC;AAE5C,IAAM,UAA4C,OACvD,OACA,aAC4C;AAC5C,MAAI;AACF,UAAM,OAAO;AAAA,MACX,IAAI,sEAA8B;AAAA,QAChC,YAAY,MAAM;AAAA,QAClB,UAAU,MAAM;AAAA,MAClB,CAAC;AAAA,IACH;AAAA,EACF,SAAS,KAAK;AACZ,YAAQ,KAAK,qDAAqD,GAAG;AAAA,EACvE;AACA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "./chunk-LZOMFHX3.mjs";
|
|
2
|
+
|
|
3
|
+
// src/components/cognito/post-authentication.handler.ts
|
|
4
|
+
import {
|
|
5
|
+
AdminUserGlobalSignOutCommand,
|
|
6
|
+
CognitoIdentityProviderClient
|
|
7
|
+
} from "@aws-sdk/client-cognito-identity-provider";
|
|
8
|
+
var client = new CognitoIdentityProviderClient({});
|
|
9
|
+
var handler = async (event, _context) => {
|
|
10
|
+
try {
|
|
11
|
+
await client.send(
|
|
12
|
+
new AdminUserGlobalSignOutCommand({
|
|
13
|
+
UserPoolId: event.userPoolId,
|
|
14
|
+
Username: event.userName
|
|
15
|
+
})
|
|
16
|
+
);
|
|
17
|
+
} catch (err) {
|
|
18
|
+
console.warn("AdminUserGlobalSignOut failed; continuing sign-in", err);
|
|
19
|
+
}
|
|
20
|
+
return event;
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
handler
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=post-authentication.handler.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/components/cognito/post-authentication.handler.ts"],"sourcesContent":["import {\n AdminUserGlobalSignOutCommand,\n CognitoIdentityProviderClient,\n} from \"@aws-sdk/client-cognito-identity-provider\";\nimport type {\n Context,\n PostAuthenticationTriggerEvent,\n PostAuthenticationTriggerHandler,\n} from \"aws-lambda\";\n\n/**\n * @see sites/www-docs/content/packages/@openhi/constructs/components/cognito/post-authentication-lambda.md\n *\n * Cognito Post Authentication trigger.\n *\n * Enforces single-device-per-user sessions (ADR 2026-03-17-01) by calling\n * AdminUserGlobalSignOut on every sign-in. Post Authentication fires only\n * on sign-in (not on token refresh), so any existing sessions on other\n * devices are revoked exactly when a new device authenticates.\n *\n * Authentication must not fail because of a sign-out failure: errors are\n * logged and the event is returned unchanged.\n */\nconst client = new CognitoIdentityProviderClient({});\n\nexport const handler: PostAuthenticationTriggerHandler = async (\n event: PostAuthenticationTriggerEvent,\n _context: Context,\n): Promise<PostAuthenticationTriggerEvent> => {\n try {\n await client.send(\n new AdminUserGlobalSignOutCommand({\n UserPoolId: event.userPoolId,\n Username: event.userName,\n }),\n );\n } catch (err) {\n console.warn(\"AdminUserGlobalSignOut failed; continuing sign-in\", err);\n }\n return event;\n};\n"],"mappings":";;;AAAA;AAAA,EACE;AAAA,EACA;AAAA,OACK;AAoBP,IAAM,SAAS,IAAI,8BAA8B,CAAC,CAAC;AAE5C,IAAM,UAA4C,OACvD,OACA,aAC4C;AAC5C,MAAI;AACF,UAAM,OAAO;AAAA,MACX,IAAI,8BAA8B;AAAA,QAChC,YAAY,MAAM;AAAA,QAClB,UAAU,MAAM;AAAA,MAClB,CAAC;AAAA,IACH;AAAA,EACF,SAAS,KAAK;AACZ,YAAQ,KAAK,qDAAqD,GAAG;AAAA,EACvE;AACA,SAAO;AACT;","names":[]}
|