@lafken/bucket 0.11.7 → 0.11.9

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,4 +1,4 @@
1
- import type { BucketNames, OnlyOne, ResourceOutputType } from '@lafken/common';
1
+ import type { BucketNames, BucketReferenceNames, OnlyOne, ResourceOutputType } from '@lafken/common';
2
2
  import 'reflect-metadata';
3
3
  export declare enum BucketMetadataKeys {
4
4
  bucket = "s3:bucket"
@@ -117,6 +117,15 @@ export interface BaseBucketProps {
117
117
  * monitoring.
118
118
  */
119
119
  tracing?: boolean;
120
+ /**
121
+ * Registers this Bucket as a named global reference, allowing other resources
122
+ * to access its attributes (e.g. ARN) by reference name.
123
+ *
124
+ * @example
125
+ * // Register the API under a reference name
126
+ * ref: 'orders'
127
+ */
128
+ ref?: BucketReferenceNames;
120
129
  }
121
130
  export interface InternalBucketProps extends BaseBucketProps {
122
131
  isExternal?: never;
@@ -2,8 +2,8 @@ import { DataAwsS3Bucket } from '@cdktn/provider-aws/lib/data-aws-s3-bucket';
2
2
  import type { Construct } from 'constructs';
3
3
  import type { ExternalBucketMetadataProps } from '../../../main';
4
4
  declare const ExternalBucket_base: (new (...args: any[]) => {
5
- isGlobal(module: import("@lafken/common").ModuleGlobalReferenceNames | (string & {}), id: string): void;
6
- isDependent(resolveDependency: () => void): void;
5
+ register(namespaces: import("@lafken/common").RegisterNamespaces | (string & {}), id: string): void;
6
+ onResolve(callback: () => void): void;
7
7
  readonly node: import("constructs").Node;
8
8
  with(...mixins: import("constructs").IMixin[]): import("constructs").IConstruct;
9
9
  toString(): string;
@@ -9,7 +9,9 @@ class ExternalBucket extends resolver_1.lafkenResource.make(data_aws_s3_bucket_1
9
9
  super(scope, `${name}-bucket`, {
10
10
  bucket: name,
11
11
  });
12
- this.isGlobal('bucket', name);
12
+ if (props.ref) {
13
+ this.register('bucket', props.ref);
14
+ }
13
15
  }
14
16
  }
15
17
  exports.ExternalBucket = ExternalBucket;
@@ -2,8 +2,8 @@ import { S3Bucket } from '@cdktn/provider-aws/lib/s3-bucket';
2
2
  import type { Construct } from 'constructs';
3
3
  import type { InternalBucketMetadataProps } from '../../../main';
4
4
  declare const InternalBucket_base: (new (...args: any[]) => {
5
- isGlobal(module: import("@lafken/common").ModuleGlobalReferenceNames | (string & {}), id: string): void;
6
- isDependent(resolveDependency: () => void): void;
5
+ register(namespaces: import("@lafken/common").RegisterNamespaces | (string & {}), id: string): void;
6
+ onResolve(callback: () => void): void;
7
7
  readonly node: import("constructs").Node;
8
8
  with(...mixins: import("constructs").IMixin[]): import("constructs").IConstruct;
9
9
  toString(): string;
@@ -20,7 +20,9 @@ class InternalBucket extends resolver_1.lafkenResource.make(s3_bucket_1.S3Bucket
20
20
  ...(props.tags || {}),
21
21
  },
22
22
  });
23
- this.isGlobal('bucket', name);
23
+ if (props.ref) {
24
+ this.register('bucket', props.ref);
25
+ }
24
26
  if (eventBridgeEnabled ?? props.eventBridgeEnabled) {
25
27
  new s3_bucket_notification_1.S3BucketNotification(this, `${name}-notification`, {
26
28
  bucket: this.id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lafken/bucket",
3
- "version": "0.11.7",
3
+ "version": "0.11.9",
4
4
  "private": false,
5
5
  "description": "Define S3 buckets using TypeScript decorators - automatic infrastructure generation with Lafken",
6
6
  "keywords": [
@@ -58,27 +58,27 @@
58
58
  "dependencies": {
59
59
  "aws-xray-sdk": "^3.12.0",
60
60
  "reflect-metadata": "^0.2.2",
61
- "@lafken/resolver": "0.11.7"
61
+ "@lafken/resolver": "0.11.9"
62
62
  },
63
63
  "devDependencies": {
64
- "@aws-sdk/client-s3": "^3.1020.0",
65
- "@cdktn/provider-aws": "^23.5.0",
66
- "@swc/core": "^1.15.21",
67
- "@swc/helpers": "^0.5.20",
68
- "@vitest/runner": "^4.1.2",
64
+ "@aws-sdk/client-s3": "^3.1037.0",
65
+ "@cdktn/provider-aws": "^23.9.0",
66
+ "@swc/core": "^1.15.30",
67
+ "@swc/helpers": "^0.5.21",
68
+ "@vitest/runner": "^4.1.5",
69
69
  "cdktn": "^0.22.1",
70
70
  "cdktn-vitest": "^1.0.0",
71
71
  "constructs": "^10.6.0",
72
- "typescript": "6.0.2",
72
+ "typescript": "6.0.3",
73
73
  "unplugin-swc": "^1.5.9",
74
- "vitest": "^4.1.2",
75
- "@lafken/common": "0.11.7"
74
+ "vitest": "^4.1.5",
75
+ "@lafken/common": "0.11.9"
76
76
  },
77
77
  "peerDependencies": {
78
78
  "@cdktn/provider-aws": ">=23.0.0",
79
79
  "cdktn": ">=0.22.0",
80
80
  "constructs": "^10.4.5",
81
- "@lafken/common": "0.11.7"
81
+ "@lafken/common": "0.11.9"
82
82
  },
83
83
  "engines": {
84
84
  "node": ">=20.19"