@openhi/constructs 0.0.151 → 0.0.153

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/index.js CHANGED
@@ -3101,11 +3101,15 @@ var OpenHiGlobalService = _OpenHiGlobalService;
3101
3101
  // src/workflows/control-plane/seed-demo-data/events.ts
3102
3102
  var import_types = require("@openhi/types");
3103
3103
  var import_workflows2 = __toESM(require_lib2());
3104
+
3105
+ // src/data/operations/control/membership-constraints/platform-scope-tenant-id.ts
3106
+ var PLATFORM_SCOPE_TENANT_ID = "platform";
3107
+
3108
+ // src/workflows/control-plane/seed-demo-data/events.ts
3104
3109
  var SEED_DEMO_DATA_CONSUMER_NAME = "seed-demo-data";
3105
3110
  var DEMO_URN_SYSTEM = "urn:openhi:demo";
3106
3111
  var OPENHI_RESOURCE_URN_SYSTEM = "http://openhi.org/";
3107
3112
  var DEMO_PERIOD = { start: "2026-01-01T00:00:00Z" };
3108
- var PLATFORM_SCOPE_TENANT_ID = "platform";
3109
3113
  var PLACEHOLDER_TENANT_ID = "placeholder-tenant-id";
3110
3114
  var PLACEHOLDER_WORKSPACE_ID = "placeholder-workspace-id";
3111
3115
  var DEV_USERS = [
@@ -3620,9 +3624,9 @@ var import_aws_lambda_nodejs8 = require("aws-cdk-lib/aws-lambda-nodejs");
3620
3624
  var import_constructs13 = require("constructs");
3621
3625
 
3622
3626
  // src/workflows/control-plane/seed-demo-data/seed-demo-data.handler.ts
3623
- var import_node_crypto = require("crypto");
3624
3627
  var import_client_cognito_identity_provider = require("@aws-sdk/client-cognito-identity-provider");
3625
3628
  var import_client_dynamodb2 = require("@aws-sdk/client-dynamodb");
3629
+ var import_client_ssm = require("@aws-sdk/client-ssm");
3626
3630
  var import_types12 = require("@openhi/types");
3627
3631
  var import_workflows3 = __toESM(require_lib2());
3628
3632
 
@@ -6522,7 +6526,7 @@ var SeedDemoDataLambda = class extends import_constructs13.Construct {
6522
6526
  this.lambda.addToRolePolicy(
6523
6527
  new import_aws_iam3.PolicyStatement({
6524
6528
  effect: import_aws_iam3.Effect.ALLOW,
6525
- actions: ["dynamodb:PutItem", "dynamodb:UpdateItem"],
6529
+ actions: ["dynamodb:PutItem", "dynamodb:UpdateItem", "dynamodb:Query"],
6526
6530
  resources: [props.dataStoreTable.tableArn]
6527
6531
  })
6528
6532
  );
@@ -6543,6 +6547,32 @@ var SeedDemoDataLambda = class extends import_constructs13.Construct {
6543
6547
  ]
6544
6548
  })
6545
6549
  );
6550
+ this.lambda.addToRolePolicy(
6551
+ new import_aws_iam3.PolicyStatement({
6552
+ effect: import_aws_iam3.Effect.ALLOW,
6553
+ actions: ["ssm:GetParameter"],
6554
+ resources: [
6555
+ import_aws_cdk_lib13.Stack.of(this).formatArn({
6556
+ service: "ssm",
6557
+ resource: "parameter",
6558
+ resourceName: "openhi/seed/users/*/password"
6559
+ })
6560
+ ]
6561
+ })
6562
+ );
6563
+ this.lambda.addToRolePolicy(
6564
+ new import_aws_iam3.PolicyStatement({
6565
+ effect: import_aws_iam3.Effect.ALLOW,
6566
+ actions: ["kms:Decrypt"],
6567
+ resources: [
6568
+ import_aws_cdk_lib13.Stack.of(this).formatArn({
6569
+ service: "kms",
6570
+ resource: "alias",
6571
+ resourceName: "aws/ssm"
6572
+ })
6573
+ ]
6574
+ })
6575
+ );
6546
6576
  this.rule = new import_aws_events6.Rule(this, "rule", {
6547
6577
  eventBus: props.controlEventBus,
6548
6578
  eventPattern: {
@@ -6784,6 +6814,7 @@ var OpenHiDataService = _OpenHiDataService;
6784
6814
 
6785
6815
  // src/services/open-hi-website-service.ts
6786
6816
  var import_config6 = __toESM(require_lib());
6817
+ var import_aws_cdk_lib15 = require("aws-cdk-lib");
6787
6818
  var import_aws_s32 = require("aws-cdk-lib/aws-s3");
6788
6819
 
6789
6820
  // src/services/open-hi-rest-api-service.ts
@@ -7360,6 +7391,7 @@ var _OpenHiWebsiteService = class _OpenHiWebsiteService extends OpenHiService {
7360
7391
  const isReleaseBranch = this.branchName === this.defaultReleaseBranch;
7361
7392
  const hostedZone = this.createHostedZone();
7362
7393
  this.fullDomain = this.computeFullDomain(hostedZone);
7394
+ this.createAdminConsoleEndpointOutput();
7363
7395
  const shouldCreateHostingInfra = props.createHostingInfrastructure ?? isReleaseBranch;
7364
7396
  if (shouldCreateHostingInfra) {
7365
7397
  const certificate = this.createCertificate();
@@ -7499,6 +7531,25 @@ var _OpenHiWebsiteService = class _OpenHiWebsiteService extends OpenHiService {
7499
7531
  description: "Full website domain (e.g. www.example.com)"
7500
7532
  });
7501
7533
  }
7534
+ /**
7535
+ * Adds a CloudFormation `AdminConsoleEndpoint` output exposing the
7536
+ * admin-console invocation URL (`https://<fullDomain>`) on every
7537
+ * deploy of this stack — release-branch and per-PR alike. The
7538
+ * configulator `aws-deploy-workflow` filters CFN outputs by the
7539
+ * `Endpoint$` logical-id suffix to surface them in the GitHub
7540
+ * Actions run summary and sticky PR comment, so the logical id is
7541
+ * pinned via {@link CfnOutput.overrideLogicalId} to keep the
7542
+ * literal key stable across synths.
7543
+ */
7544
+ createAdminConsoleEndpointOutput() {
7545
+ const output = new import_aws_cdk_lib15.CfnOutput(this, "admin-console-endpoint-output", {
7546
+ value: `https://${this.fullDomain}`,
7547
+ description: "Admin console endpoint for this deploy (https://<fullDomain>). Surfaced by the deploy workflow's sticky PR comment and job summary."
7548
+ });
7549
+ output.overrideLogicalId(
7550
+ _OpenHiWebsiteService.ADMIN_CONSOLE_ENDPOINT_OUTPUT_NAME
7551
+ );
7552
+ }
7502
7553
  /**
7503
7554
  * Creates the StaticContent uploader. Receives the resolved static-hosting
7504
7555
  * bucket from the constructor — on the release-branch deploy this is the
@@ -7565,6 +7616,15 @@ _OpenHiWebsiteService.SERVICE_TYPE = "website";
7565
7616
  * `www-<childZonePrefix>.<zone>`.
7566
7617
  */
7567
7618
  _OpenHiWebsiteService.DEFAULT_DOMAIN_PREFIX = "www";
7619
+ /**
7620
+ * CloudFormation logical key for the admin-console endpoint `CfnOutput`.
7621
+ * The configulator deploy workflow filters outputs whose logical id
7622
+ * matches the `Endpoint$` regex to surface them in the GitHub Actions
7623
+ * run summary and sticky PR comment, so the suffix must be `Endpoint`.
7624
+ * The logical id is pinned via {@link CfnOutput.overrideLogicalId} so
7625
+ * it does not pick up a synth-time hash suffix.
7626
+ */
7627
+ _OpenHiWebsiteService.ADMIN_CONSOLE_ENDPOINT_OUTPUT_NAME = "AdminConsoleEndpoint";
7568
7628
  var OpenHiWebsiteService = _OpenHiWebsiteService;
7569
7629
 
7570
7630
  // src/workflows/control-plane/user-onboarding/events.ts
@@ -7595,7 +7655,7 @@ var buildProvisionDefaultWorkspaceRequestedDetail = (event) => {
7595
7655
  // src/workflows/control-plane/user-onboarding/provision-default-workspace-lambda.ts
7596
7656
  var import_node_fs11 = __toESM(require("fs"));
7597
7657
  var import_node_path11 = __toESM(require("path"));
7598
- var import_aws_cdk_lib15 = require("aws-cdk-lib");
7658
+ var import_aws_cdk_lib16 = require("aws-cdk-lib");
7599
7659
  var import_aws_events8 = require("aws-cdk-lib/aws-events");
7600
7660
  var import_aws_events_targets4 = require("aws-cdk-lib/aws-events-targets");
7601
7661
  var import_aws_iam6 = require("aws-cdk-lib/aws-iam");
@@ -7642,7 +7702,7 @@ var ProvisionDefaultWorkspaceLambda = class extends import_constructs20.Construc
7642
7702
  targets: [
7643
7703
  new import_aws_events_targets4.LambdaFunction(this.lambda, {
7644
7704
  retryAttempts: 2,
7645
- maxEventAge: import_aws_cdk_lib15.Duration.hours(2)
7705
+ maxEventAge: import_aws_cdk_lib16.Duration.hours(2)
7646
7706
  })
7647
7707
  ]
7648
7708
  });
@@ -8081,7 +8141,7 @@ var OWNING_DELETE_OPS_EVENT_BUS_ENV_VAR = "OWNING_DELETE_OPS_EVENT_BUS_NAME";
8081
8141
  // src/workflows/control-plane/owning-delete-cascade/owning-delete-cascade-lambdas.ts
8082
8142
  var import_node_fs12 = __toESM(require("fs"));
8083
8143
  var import_node_path12 = __toESM(require("path"));
8084
- var import_aws_cdk_lib16 = require("aws-cdk-lib");
8144
+ var import_aws_cdk_lib17 = require("aws-cdk-lib");
8085
8145
  var import_aws_iam8 = require("aws-cdk-lib/aws-iam");
8086
8146
  var import_aws_lambda13 = require("aws-cdk-lib/aws-lambda");
8087
8147
  var import_aws_lambda_nodejs13 = require("aws-cdk-lib/aws-lambda-nodejs");
@@ -8105,7 +8165,7 @@ var OwningDeleteCascadeLambdas = class extends import_constructs22.Construct {
8105
8165
  entry: listResolved.entry,
8106
8166
  runtime: import_aws_lambda13.Runtime.NODEJS_LATEST,
8107
8167
  memorySize: 512,
8108
- timeout: import_aws_cdk_lib16.Duration.minutes(1),
8168
+ timeout: import_aws_cdk_lib17.Duration.minutes(1),
8109
8169
  environment: {
8110
8170
  DYNAMO_TABLE_NAME: props.dataStoreTable.tableName
8111
8171
  }
@@ -8119,7 +8179,7 @@ var OwningDeleteCascadeLambdas = class extends import_constructs22.Construct {
8119
8179
  entry: deleteResolved.entry,
8120
8180
  runtime: import_aws_lambda13.Runtime.NODEJS_LATEST,
8121
8181
  memorySize: 512,
8122
- timeout: import_aws_cdk_lib16.Duration.minutes(1),
8182
+ timeout: import_aws_cdk_lib17.Duration.minutes(1),
8123
8183
  environment: {
8124
8184
  DYNAMO_TABLE_NAME: props.dataStoreTable.tableName
8125
8185
  }
@@ -8138,7 +8198,7 @@ var OwningDeleteCascadeLambdas = class extends import_constructs22.Construct {
8138
8198
  entry: finalizeResolved.entry,
8139
8199
  runtime: import_aws_lambda13.Runtime.NODEJS_LATEST,
8140
8200
  memorySize: 512,
8141
- timeout: import_aws_cdk_lib16.Duration.minutes(1),
8201
+ timeout: import_aws_cdk_lib17.Duration.minutes(1),
8142
8202
  environment: {
8143
8203
  DYNAMO_TABLE_NAME: props.dataStoreTable.tableName,
8144
8204
  [OWNING_DELETE_OPS_EVENT_BUS_ENV_VAR]: props.opsEventBus.eventBusName
@@ -8156,7 +8216,7 @@ var OwningDeleteCascadeLambdas = class extends import_constructs22.Construct {
8156
8216
  };
8157
8217
 
8158
8218
  // src/workflows/control-plane/owning-delete-cascade/owning-delete-cascade-workflow.ts
8159
- var import_aws_cdk_lib17 = require("aws-cdk-lib");
8219
+ var import_aws_cdk_lib18 = require("aws-cdk-lib");
8160
8220
  var import_aws_events9 = require("aws-cdk-lib/aws-events");
8161
8221
  var import_aws_events_targets5 = require("aws-cdk-lib/aws-events-targets");
8162
8222
  var import_aws_stepfunctions = require("aws-cdk-lib/aws-stepfunctions");
@@ -8271,7 +8331,7 @@ var OwningDeleteCascadeWorkflow = class extends import_constructs23.Construct {
8271
8331
  }
8272
8332
  });
8273
8333
  const interPageWait = new import_aws_stepfunctions.Wait(this, "inter-page-wait", {
8274
- time: import_aws_stepfunctions.WaitTime.duration(import_aws_cdk_lib17.Duration.seconds(0))
8334
+ time: import_aws_stepfunctions.WaitTime.duration(import_aws_cdk_lib18.Duration.seconds(0))
8275
8335
  });
8276
8336
  const isExhausted = new import_aws_stepfunctions.Choice(this, "is-exhausted");
8277
8337
  const finalize = new import_aws_stepfunctions_tasks.LambdaInvoke(this, "finalize", {
@@ -8302,7 +8362,7 @@ var OwningDeleteCascadeWorkflow = class extends import_constructs23.Construct {
8302
8362
  // Long timeout because real-world cascades can run minutes when
8303
8363
  // a workspace has thousands of members. The stuck-cascade alarm
8304
8364
  // fires at 15 minutes; the state machine itself does not abort.
8305
- timeout: import_aws_cdk_lib17.Duration.hours(2)
8365
+ timeout: import_aws_cdk_lib18.Duration.hours(2)
8306
8366
  });
8307
8367
  this.rule = new import_aws_events9.Rule(this, "rule", {
8308
8368
  eventBus: props.dataEventBus,
@@ -8313,7 +8373,7 @@ var OwningDeleteCascadeWorkflow = class extends import_constructs23.Construct {
8313
8373
  targets: [
8314
8374
  new import_aws_events_targets5.SfnStateMachine(this.stateMachine, {
8315
8375
  retryAttempts: 2,
8316
- maxEventAge: import_aws_cdk_lib17.Duration.hours(2)
8376
+ maxEventAge: import_aws_cdk_lib18.Duration.hours(2)
8317
8377
  })
8318
8378
  ]
8319
8379
  });
@@ -8331,7 +8391,7 @@ var RENAME_CASCADE_OPS_EVENT_BUS_ENV_VAR = "RENAME_CASCADE_OPS_EVENT_BUS_NAME";
8331
8391
  // src/workflows/control-plane/rename-cascade/rename-cascade-lambdas.ts
8332
8392
  var import_node_fs13 = __toESM(require("fs"));
8333
8393
  var import_node_path13 = __toESM(require("path"));
8334
- var import_aws_cdk_lib18 = require("aws-cdk-lib");
8394
+ var import_aws_cdk_lib19 = require("aws-cdk-lib");
8335
8395
  var import_aws_iam9 = require("aws-cdk-lib/aws-iam");
8336
8396
  var import_aws_lambda14 = require("aws-cdk-lib/aws-lambda");
8337
8397
  var import_aws_lambda_nodejs14 = require("aws-cdk-lib/aws-lambda-nodejs");
@@ -8355,7 +8415,7 @@ var RenameCascadeLambdas = class extends import_constructs24.Construct {
8355
8415
  entry: listResolved.entry,
8356
8416
  runtime: import_aws_lambda14.Runtime.NODEJS_LATEST,
8357
8417
  memorySize: 512,
8358
- timeout: import_aws_cdk_lib18.Duration.minutes(1),
8418
+ timeout: import_aws_cdk_lib19.Duration.minutes(1),
8359
8419
  environment: {
8360
8420
  DYNAMO_TABLE_NAME: props.dataStoreTable.tableName
8361
8421
  }
@@ -8369,7 +8429,7 @@ var RenameCascadeLambdas = class extends import_constructs24.Construct {
8369
8429
  entry: rewriteResolved.entry,
8370
8430
  runtime: import_aws_lambda14.Runtime.NODEJS_LATEST,
8371
8431
  memorySize: 512,
8372
- timeout: import_aws_cdk_lib18.Duration.minutes(1),
8432
+ timeout: import_aws_cdk_lib19.Duration.minutes(1),
8373
8433
  environment: {
8374
8434
  DYNAMO_TABLE_NAME: props.dataStoreTable.tableName
8375
8435
  }
@@ -8388,7 +8448,7 @@ var RenameCascadeLambdas = class extends import_constructs24.Construct {
8388
8448
  entry: finalizeResolved.entry,
8389
8449
  runtime: import_aws_lambda14.Runtime.NODEJS_LATEST,
8390
8450
  memorySize: 512,
8391
- timeout: import_aws_cdk_lib18.Duration.minutes(1),
8451
+ timeout: import_aws_cdk_lib19.Duration.minutes(1),
8392
8452
  environment: {
8393
8453
  [RENAME_CASCADE_OPS_EVENT_BUS_ENV_VAR]: props.opsEventBus.eventBusName
8394
8454
  }
@@ -8404,7 +8464,7 @@ var RenameCascadeLambdas = class extends import_constructs24.Construct {
8404
8464
  };
8405
8465
 
8406
8466
  // src/workflows/control-plane/rename-cascade/rename-cascade-workflow.ts
8407
- var import_aws_cdk_lib19 = require("aws-cdk-lib");
8467
+ var import_aws_cdk_lib20 = require("aws-cdk-lib");
8408
8468
  var import_aws_events10 = require("aws-cdk-lib/aws-events");
8409
8469
  var import_aws_events_targets6 = require("aws-cdk-lib/aws-events-targets");
8410
8470
  var import_aws_stepfunctions2 = require("aws-cdk-lib/aws-stepfunctions");
@@ -8554,7 +8614,7 @@ var RenameCascadeWorkflow = class extends import_constructs25.Construct {
8554
8614
  // Long timeout — large renames may rewrite thousands of rows;
8555
8615
  // the `CascadeSlow` alarm fires at 300s p99 but the state
8556
8616
  // machine itself does not abort.
8557
- timeout: import_aws_cdk_lib19.Duration.hours(2)
8617
+ timeout: import_aws_cdk_lib20.Duration.hours(2)
8558
8618
  });
8559
8619
  this.rule = new import_aws_events10.Rule(this, "rule", {
8560
8620
  eventBus: props.dataEventBus,
@@ -8565,7 +8625,7 @@ var RenameCascadeWorkflow = class extends import_constructs25.Construct {
8565
8625
  targets: [
8566
8626
  new import_aws_events_targets6.SfnStateMachine(this.stateMachine, {
8567
8627
  retryAttempts: 2,
8568
- maxEventAge: import_aws_cdk_lib19.Duration.hours(2)
8628
+ maxEventAge: import_aws_cdk_lib20.Duration.hours(2)
8569
8629
  })
8570
8630
  ]
8571
8631
  });