@openhi/constructs 0.0.131 → 0.0.132

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.mjs CHANGED
@@ -2876,9 +2876,9 @@ var _OpenHiRestApiService = class _OpenHiRestApiService extends OpenHiService {
2876
2876
  this.validateConfig(props);
2877
2877
  const hostedZone = this.createHostedZone();
2878
2878
  const certificate = this.createCertificate();
2879
- const apiDomainName = this.createApiDomainNameString(hostedZone);
2880
- this.createRestApiBaseUrlParameter(apiDomainName);
2881
- this.createRestApiDomainNameParameter(apiDomainName);
2879
+ this.apiDomainName = this.createApiDomainNameString(hostedZone);
2880
+ this.createRestApiBaseUrlParameter(this.apiDomainName);
2881
+ this.createRestApiDomainNameParameter(this.apiDomainName);
2882
2882
  const domainName = this.createDomainName(hostedZone, certificate);
2883
2883
  this.rootHttpApi = this.createRootHttpApi(domainName);
2884
2884
  this.createRestApiLambdaAndRoutes(hostedZone, domainName);
@@ -3142,7 +3142,8 @@ var _OpenHiRestApiService = class _OpenHiRestApiService extends OpenHiService {
3142
3142
  * The three Cognito IDs are resolved via SSM lookups against the auth
3143
3143
  * stack from a dedicated sub-scope (`runtime-config`) so they don't
3144
3144
  * collide with the user-pool / user-pool-client constructs already
3145
- * created in {@link createRootHttpApi}.
3145
+ * created in {@link createRootHttpApi}. `apiBaseUrl` is derived from
3146
+ * this stack's own custom domain so callers don't have to hardcode it.
3146
3147
  */
3147
3148
  resolveRuntimeConfigEnvVars() {
3148
3149
  if (this.props.runtimeConfig === void 0) {
@@ -3157,7 +3158,7 @@ var _OpenHiRestApiService = class _OpenHiRestApiService extends OpenHiService {
3157
3158
  OPENHI_RUNTIME_CONFIG_COGNITO_USER_POOL_CLIENT_ID: userPoolClient.userPoolClientId,
3158
3159
  OPENHI_RUNTIME_CONFIG_COGNITO_DOMAIN_URL: cognitoDomainUrl,
3159
3160
  OPENHI_RUNTIME_CONFIG_COGNITO_REDIRECT_URI: this.props.runtimeConfig.cognitoRedirectUri,
3160
- OPENHI_RUNTIME_CONFIG_API_BASE_URL: this.props.runtimeConfig.apiBaseUrl
3161
+ OPENHI_RUNTIME_CONFIG_API_BASE_URL: `https://${this.apiDomainName}`
3161
3162
  };
3162
3163
  }
3163
3164
  };