@lafken/dynamo 0.13.4 → 0.14.1

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.
@@ -74,6 +74,7 @@ class InternalTable extends resolver_1.lafkenResource.make(dynamodb_table_1.Dyna
74
74
  source: this.streamArn,
75
75
  target: defaultBus.arn,
76
76
  desiredState: 'RUNNING',
77
+ dependsOn: [role],
77
78
  sourceParameters: {
78
79
  dynamodbStreamParameters: {
79
80
  startingPosition: 'LATEST',
@@ -158,34 +159,21 @@ class InternalTable extends resolver_1.lafkenResource.make(dynamodb_table_1.Dyna
158
159
  for (const attribute of [...partitionKeys, ...sortKeys]) {
159
160
  indexAttributes.add(attribute);
160
161
  }
161
- const isMultiAttribute = partitionKeys.length > 1 || sortKeys.length > 1;
162
- if (isMultiAttribute) {
163
- if (partitionKeys.length > 4 || sortKeys.length > 4) {
164
- throw new Error(`A multi-attribute index supports up to 4 partition and 4 sort attributes. Check the index "${index.name}".`);
165
- }
166
- globalIndexes.push({
167
- name: index.name,
168
- keySchema: [
169
- ...partitionKeys.map((attributeName) => ({
170
- attributeName,
171
- keyType: 'HASH',
172
- })),
173
- ...sortKeys.map((attributeName) => ({
174
- attributeName,
175
- keyType: 'RANGE',
176
- })),
177
- ],
178
- projectionType,
179
- nonKeyAttributes,
180
- readCapacity: index.readCapacity,
181
- writeCapacity: index.writeCapacity,
182
- });
183
- continue;
162
+ if (partitionKeys.length > 4 || sortKeys.length > 4) {
163
+ throw new Error(`A multi-attribute index supports up to 4 partition and 4 sort attributes. Check the index "${index.name}".`);
184
164
  }
185
165
  globalIndexes.push({
186
166
  name: index.name,
187
- hashKey: partitionKeys[0],
188
- rangeKey: sortKeys[0],
167
+ keySchema: [
168
+ ...partitionKeys.map((attributeName) => ({
169
+ attributeName,
170
+ keyType: 'HASH',
171
+ })),
172
+ ...sortKeys.map((attributeName) => ({
173
+ attributeName,
174
+ keyType: 'RANGE',
175
+ })),
176
+ ],
189
177
  projectionType,
190
178
  nonKeyAttributes,
191
179
  readCapacity: index.readCapacity,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lafken/dynamo",
3
- "version": "0.13.4",
3
+ "version": "0.14.1",
4
4
  "private": false,
5
5
  "description": "Define DynamoDB tables using TypeScript decorators - type-safe, declarative infrastructure with Lafken",
6
6
  "keywords": [
@@ -56,30 +56,30 @@
56
56
  "lib"
57
57
  ],
58
58
  "dependencies": {
59
- "@aws-sdk/client-dynamodb": "^3.1090.0",
59
+ "@aws-sdk/client-dynamodb": "^3.1106.0",
60
60
  "@aws-sdk/util-dynamodb": "^3.996.7",
61
61
  "reflect-metadata": "^0.2.2",
62
- "@lafken/resolver": "0.13.4"
62
+ "@lafken/resolver": "0.14.1"
63
63
  },
64
64
  "devDependencies": {
65
- "@cdktn/provider-aws": "^24.11.0",
66
- "@swc/core": "^1.15.43",
65
+ "@cdktn/provider-aws": "^25.0.0",
66
+ "@swc/core": "^1.15.47",
67
67
  "@swc/helpers": "^0.5.23",
68
68
  "@vitest/runner": "^4.1.10",
69
69
  "aws-sdk-client-mock": "^4.1.0",
70
- "cdktn": "^0.23.4",
70
+ "cdktn": "^0.24.0",
71
71
  "cdktn-vitest": "^1.0.0",
72
- "constructs": "^10.7.0",
72
+ "constructs": "^10.8.0",
73
73
  "typescript": "7.0.2",
74
- "unplugin-swc": "^1.5.9",
74
+ "unplugin-swc": "^1.5.10",
75
75
  "vitest": "^4.1.10",
76
- "@lafken/common": "0.13.4"
76
+ "@lafken/common": "0.14.1"
77
77
  },
78
78
  "peerDependencies": {
79
79
  "@cdktn/provider-aws": ">=23.0.0",
80
80
  "cdktn": ">=0.22.0",
81
- "constructs": "^10.4.5",
82
- "@lafken/common": "0.13.4"
81
+ "constructs": ">=10.7.0",
82
+ "@lafken/common": "0.14.1"
83
83
  },
84
84
  "engines": {
85
85
  "node": ">=20.19"