@jaypie/constructs 1.2.15 → 1.2.17

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.
@@ -1,9 +1,9 @@
1
1
  export { CDK } from "./constants";
2
2
  export { JaypieAccountLoggingBucket, JaypieAccountLoggingBucketProps, } from "./JaypieAccountLoggingBucket";
3
- export { JaypieApiGateway, JaypieApiGatewayProps, } from "./JaypieApiGateway";
3
+ export { JaypieApiGateway, JaypieApiGatewayProps } from "./JaypieApiGateway";
4
4
  export { JaypieAppStack } from "./JaypieAppStack";
5
5
  export { JaypieBucketQueuedLambda } from "./JaypieBucketQueuedLambda";
6
- export { JaypieCertificate, JaypieCertificateProps, } from "./JaypieCertificate";
6
+ export { JaypieCertificate, JaypieCertificateProps } from "./JaypieCertificate";
7
7
  export { JaypieDatadogBucket, JaypieDatadogBucketProps, } from "./JaypieDatadogBucket";
8
8
  export { JaypieDatadogForwarder, JaypieDatadogForwarderProps, } from "./JaypieDatadogForwarder";
9
9
  export { JaypieDatadogSecret } from "./JaypieDatadogSecret";
@@ -113,5 +113,6 @@ export declare class JaypieCertificate extends Construct implements acm.ICertifi
113
113
  region: string;
114
114
  };
115
115
  applyRemovalPolicy(policy: RemovalPolicy): void;
116
+ get certificateRef(): acm.CertificateReference;
116
117
  metricDaysToExpiry(props?: import("aws-cdk-lib/aws-cloudwatch").MetricOptions): import("aws-cdk-lib/aws-cloudwatch").Metric;
117
118
  }
@@ -61,11 +61,11 @@ export interface JaypieDistributionProps extends Omit<cloudfront.DistributionPro
61
61
  */
62
62
  host?: string | HostConfig;
63
63
  /**
64
- * Invoke mode for Lambda Function URLs.
65
- * Use RESPONSE_STREAM for streaming responses with createLambdaStreamHandler.
66
- * @default InvokeMode.BUFFERED
64
+ * Enable response streaming for Lambda Function URLs.
65
+ * Use with createLambdaStreamHandler for SSE/streaming responses.
66
+ * @default false
67
67
  */
68
- invokeMode?: lambda.InvokeMode;
68
+ streaming?: boolean;
69
69
  /**
70
70
  * Origin read timeout - how long CloudFront waits for a response from the origin.
71
71
  * This is the maximum time allowed for the origin to respond.
@@ -98,7 +98,6 @@ export declare class JaypieDistribution extends Construct implements cloudfront.
98
98
  private isIOrigin;
99
99
  private isIFunctionUrl;
100
100
  private isIFunction;
101
- private hasInvokeMode;
102
101
  private isExportNameObject;
103
102
  private resolveLogBucket;
104
103
  get env(): {
@@ -105,6 +105,7 @@ export declare class JaypieDynamoDb extends Construct implements dynamodb.ITable
105
105
  get tableArn(): string;
106
106
  get tableId(): string | undefined;
107
107
  get tableName(): string;
108
+ get tableRef(): dynamodb.TableReference;
108
109
  get tableStreamArn(): string | undefined;
109
110
  get encryptionKey(): import("aws-cdk-lib/aws-kms").IKey | undefined;
110
111
  applyRemovalPolicy(policy: RemovalPolicy): void;
@@ -25,8 +25,9 @@ export declare class JaypieEnvSecret extends Construct implements ISecret {
25
25
  };
26
26
  applyRemovalPolicy(policy: RemovalPolicy): void;
27
27
  get secretArn(): string;
28
- get secretName(): string;
29
28
  get secretFullArn(): string | undefined;
29
+ get secretName(): string;
30
+ get secretRef(): secretsmanager.SecretReference;
30
31
  get encryptionKey(): IKey | undefined;
31
32
  get secretValue(): SecretValue;
32
33
  secretValueFromJson(key: string): SecretValue;
@@ -1,9 +1,9 @@
1
1
  export { CDK } from "./constants";
2
2
  export { JaypieAccountLoggingBucket, JaypieAccountLoggingBucketProps, } from "./JaypieAccountLoggingBucket";
3
- export { JaypieApiGateway, JaypieApiGatewayProps, } from "./JaypieApiGateway";
3
+ export { JaypieApiGateway, JaypieApiGatewayProps } from "./JaypieApiGateway";
4
4
  export { JaypieAppStack } from "./JaypieAppStack";
5
5
  export { JaypieBucketQueuedLambda } from "./JaypieBucketQueuedLambda";
6
- export { JaypieCertificate, JaypieCertificateProps, } from "./JaypieCertificate";
6
+ export { JaypieCertificate, JaypieCertificateProps } from "./JaypieCertificate";
7
7
  export { JaypieDatadogBucket, JaypieDatadogBucketProps, } from "./JaypieDatadogBucket";
8
8
  export { JaypieDatadogForwarder, JaypieDatadogForwarderProps, } from "./JaypieDatadogForwarder";
9
9
  export { JaypieDatadogSecret } from "./JaypieDatadogSecret";
package/dist/esm/index.js CHANGED
@@ -967,11 +967,14 @@ class JaypieEnvSecret extends Construct {
967
967
  get secretArn() {
968
968
  return this._secret.secretArn;
969
969
  }
970
+ get secretFullArn() {
971
+ return this._secret.secretFullArn;
972
+ }
970
973
  get secretName() {
971
974
  return this._secret.secretName;
972
975
  }
973
- get secretFullArn() {
974
- return this._secret.secretFullArn;
976
+ get secretRef() {
977
+ return this._secret.secretRef;
975
978
  }
976
979
  get encryptionKey() {
977
980
  return this._secret.encryptionKey;
@@ -2128,6 +2131,9 @@ class JaypieCertificate extends Construct {
2128
2131
  this.certificate.applyRemovalPolicy(policy);
2129
2132
  }
2130
2133
  // ICertificate implementation
2134
+ get certificateRef() {
2135
+ return this.certificate.certificateRef;
2136
+ }
2131
2137
  metricDaysToExpiry(props) {
2132
2138
  return this.certificate.metricDaysToExpiry(props);
2133
2139
  }
@@ -2317,7 +2323,7 @@ class JaypieDatadogSecret extends JaypieEnvSecret {
2317
2323
  class JaypieDistribution extends Construct {
2318
2324
  constructor(scope, id, props) {
2319
2325
  super(scope, id);
2320
- const { certificate: certificateProp = true, defaultBehavior: propsDefaultBehavior, destination: destinationProp = true, handler, host: propsHost, invokeMode = lambda.InvokeMode.BUFFERED, logBucket: logBucketProp, originReadTimeout = Duration.seconds(CDK$2.DURATION.CLOUDFRONT_API), roleTag = CDK$2.ROLE.API, zone: propsZone, ...distributionProps } = props;
2326
+ const { certificate: certificateProp = true, defaultBehavior: propsDefaultBehavior, destination: destinationProp = true, handler, host: propsHost, logBucket: logBucketProp, originReadTimeout = Duration.seconds(CDK$2.DURATION.CLOUDFRONT_API), roleTag = CDK$2.ROLE.API, streaming = false, zone: propsZone, ...distributionProps } = props;
2321
2327
  // Validate environment variables
2322
2328
  if (process.env.CDK_ENV_API_SUBDOMAIN &&
2323
2329
  !isValidSubdomain(process.env.CDK_ENV_API_SUBDOMAIN)) {
@@ -2371,13 +2377,9 @@ class JaypieDistribution extends Construct {
2371
2377
  // IFunction before IFunctionUrl (IFunction doesn't have functionUrlId)
2372
2378
  let origin;
2373
2379
  if (handler) {
2374
- // Auto-detect invoke mode from handler if it has an invokeMode property
2375
- // Explicit invokeMode prop takes precedence over auto-detection
2376
- const resolvedInvokeMode = invokeMode !== lambda.InvokeMode.BUFFERED
2377
- ? invokeMode // Explicit non-default value, use it
2378
- : this.hasInvokeMode(handler)
2379
- ? handler.invokeMode // Auto-detect from handler
2380
- : invokeMode; // Use default BUFFERED
2380
+ const resolvedInvokeMode = streaming
2381
+ ? lambda.InvokeMode.RESPONSE_STREAM
2382
+ : lambda.InvokeMode.BUFFERED;
2381
2383
  if (this.isIFunction(handler)) {
2382
2384
  // Create FunctionUrl for the Lambda function
2383
2385
  const functionUrl = new lambda.FunctionUrl(this, "FunctionUrl", {
@@ -2531,13 +2533,6 @@ class JaypieDistribution extends Construct {
2531
2533
  "functionName" in handler &&
2532
2534
  !("url" in handler));
2533
2535
  }
2534
- hasInvokeMode(handler) {
2535
- // Check if handler has an invokeMode property for streaming support
2536
- return (typeof handler === "object" &&
2537
- handler !== null &&
2538
- "invokeMode" in handler &&
2539
- typeof handler.invokeMode === "string");
2540
- }
2541
2536
  isExportNameObject(value) {
2542
2537
  return (typeof value === "object" &&
2543
2538
  value !== null &&
@@ -2804,6 +2799,9 @@ class JaypieDynamoDb extends Construct {
2804
2799
  get tableName() {
2805
2800
  return this._table.tableName;
2806
2801
  }
2802
+ get tableRef() {
2803
+ return this._table.tableRef;
2804
+ }
2807
2805
  get tableStreamArn() {
2808
2806
  return this._table.tableStreamArn;
2809
2807
  }
@@ -3898,6 +3896,10 @@ class JaypieWebDeploymentBucket extends Construct {
3898
3896
  new CfnOutput(this, "DestinationBucketDeployRoleArn", {
3899
3897
  value: bucketDeployRole.roleArn,
3900
3898
  });
3899
+ // Output the bucket name for workflows
3900
+ new CfnOutput(this, "DestinationBucketName", {
3901
+ value: this.bucket.bucketName,
3902
+ });
3901
3903
  }
3902
3904
  // Create CloudFront distribution and certificate if host and zone are provided
3903
3905
  if (host && zone) {
@@ -3951,6 +3953,10 @@ class JaypieWebDeploymentBucket extends Construct {
3951
3953
  });
3952
3954
  Tags.of(record).add(CDK$2.TAG.ROLE, CDK$2.ROLE.NETWORKING);
3953
3955
  this.distributionDomainName = this.distribution.distributionDomainName;
3956
+ // Output the distribution ID for cache invalidation
3957
+ new CfnOutput(this, "DistributionId", {
3958
+ value: this.distribution.distributionId,
3959
+ });
3954
3960
  }
3955
3961
  }
3956
3962
  // Implement remaining IBucket methods by delegating to the bucket