@lafken/dynamo 0.11.8 → 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,5 +1,5 @@
|
|
|
1
1
|
import 'reflect-metadata';
|
|
2
|
-
import type { DeepPartial, DynamoTableNames, FieldTypes, OnlyNumber, OnlyNumberString, ResourceOutputType } from '@lafken/common';
|
|
2
|
+
import type { DeepPartial, DynamoReferenceNames, DynamoTableNames, FieldTypes, OnlyNumber, OnlyNumberString, ResourceOutputType } from '@lafken/common';
|
|
3
3
|
/**
|
|
4
4
|
* Internal metadata keys used to store DynamoDB table configuration
|
|
5
5
|
* via `Reflect.defineMetadata`.
|
|
@@ -309,6 +309,15 @@ export interface TableBase<T extends Function> {
|
|
|
309
309
|
* }
|
|
310
310
|
*/
|
|
311
311
|
outputs?: ResourceOutputType<TableOutputAttributes>;
|
|
312
|
+
/**
|
|
313
|
+
* Registers this Table as a named global reference, allowing other resources
|
|
314
|
+
* to access its attributes (e.g. ARN) by reference name.
|
|
315
|
+
*
|
|
316
|
+
* @example
|
|
317
|
+
* // Register the API under a reference name
|
|
318
|
+
* ref: 'order'
|
|
319
|
+
*/
|
|
320
|
+
ref?: DynamoReferenceNames;
|
|
312
321
|
}
|
|
313
322
|
export interface TableProvisioned<T extends Function> extends TableBase<T>, ReadWriteCapacity {
|
|
314
323
|
billingMode: 'provisioned';
|
|
@@ -2,8 +2,8 @@ import { DataAwsDynamodbTable } from '@cdktn/provider-aws/lib/data-aws-dynamodb-
|
|
|
2
2
|
import type { Construct } from 'constructs';
|
|
3
3
|
import type { ExternalTableMetadata } from '../../../main';
|
|
4
4
|
declare const ExternalTable_base: (new (...args: any[]) => {
|
|
5
|
-
|
|
6
|
-
|
|
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 ExternalTable extends resolver_1.lafkenResource.make(data_aws_dynamodb_tab
|
|
|
9
9
|
super(scope, `${name}-table`, {
|
|
10
10
|
name,
|
|
11
11
|
});
|
|
12
|
-
|
|
12
|
+
if (props.ref) {
|
|
13
|
+
this.register('dynamo', props.ref);
|
|
14
|
+
}
|
|
13
15
|
}
|
|
14
16
|
}
|
|
15
17
|
exports.ExternalTable = ExternalTable;
|
|
@@ -2,8 +2,8 @@ import { DynamodbTable } from '@cdktn/provider-aws/lib/dynamodb-table';
|
|
|
2
2
|
import type { Construct } from 'constructs';
|
|
3
3
|
import type { InternalTableProps } from '../table.types';
|
|
4
4
|
declare const InternalTable_base: (new (...args: any[]) => {
|
|
5
|
-
|
|
6
|
-
|
|
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;
|
|
@@ -39,7 +39,9 @@ class InternalTable extends resolver_1.lafkenResource.make(dynamodb_table_1.Dyna
|
|
|
39
39
|
...InternalTable.getBillingModeProps(modelProps),
|
|
40
40
|
replica: modelProps.replica,
|
|
41
41
|
});
|
|
42
|
-
|
|
42
|
+
if (modelProps.ref) {
|
|
43
|
+
this.register('dynamo', modelProps.ref);
|
|
44
|
+
}
|
|
43
45
|
if (modelProps.stream?.enabled) {
|
|
44
46
|
const defaultBus = new data_aws_cloudwatch_event_bus_1.DataAwsCloudwatchEventBus(this, 'DefaultBus', {
|
|
45
47
|
name: 'default',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lafken/dynamo",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.9",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Define DynamoDB tables using TypeScript decorators - type-safe, declarative infrastructure with Lafken",
|
|
6
6
|
"keywords": [
|
|
@@ -56,32 +56,32 @@
|
|
|
56
56
|
"lib"
|
|
57
57
|
],
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@aws-sdk/client-dynamodb": "^3.
|
|
59
|
+
"@aws-sdk/client-dynamodb": "^3.1037.0",
|
|
60
60
|
"@aws-sdk/util-dynamodb": "^3.996.2",
|
|
61
61
|
"aws-xray-sdk": "^3.12.0",
|
|
62
62
|
"reflect-metadata": "^0.2.2",
|
|
63
|
-
"@lafken/resolver": "0.11.
|
|
63
|
+
"@lafken/resolver": "0.11.9"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
66
|
-
"@cdktn/provider-aws": "^23.
|
|
67
|
-
"@swc/core": "^1.15.
|
|
68
|
-
"@swc/helpers": "^0.5.
|
|
69
|
-
"@vitest/runner": "^4.1.
|
|
66
|
+
"@cdktn/provider-aws": "^23.9.0",
|
|
67
|
+
"@swc/core": "^1.15.30",
|
|
68
|
+
"@swc/helpers": "^0.5.21",
|
|
69
|
+
"@vitest/runner": "^4.1.5",
|
|
70
70
|
"aws-sdk-client-mock": "^4.1.0",
|
|
71
71
|
"aws-sdk-client-mock-vitest": "^7.0.1",
|
|
72
72
|
"cdktn": "^0.22.1",
|
|
73
73
|
"cdktn-vitest": "^1.0.0",
|
|
74
74
|
"constructs": "^10.6.0",
|
|
75
|
-
"typescript": "6.0.
|
|
75
|
+
"typescript": "6.0.3",
|
|
76
76
|
"unplugin-swc": "^1.5.9",
|
|
77
|
-
"vitest": "^4.1.
|
|
78
|
-
"@lafken/common": "0.11.
|
|
77
|
+
"vitest": "^4.1.5",
|
|
78
|
+
"@lafken/common": "0.11.9"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
81
|
"@cdktn/provider-aws": ">=23.0.0",
|
|
82
82
|
"cdktn": ">=0.22.0",
|
|
83
83
|
"constructs": "^10.4.5",
|
|
84
|
-
"@lafken/common": "0.11.
|
|
84
|
+
"@lafken/common": "0.11.9"
|
|
85
85
|
},
|
|
86
86
|
"engines": {
|
|
87
87
|
"node": ">=20.19"
|