@exabugs/dynamodb-client 0.3.1 → 0.3.3
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/CHANGELOG.md +32 -1
- package/dist/server/handler.cjs +2 -2
- package/dist/shadows/schema.d.ts +5 -2
- package/dist/shadows/schema.d.ts.map +1 -1
- package/package.json +1 -1
- package/terraform/main.tf +5 -1
- package/terraform/variables.tf +32 -2
package/CHANGELOG.md
CHANGED
|
@@ -7,7 +7,38 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
-
## [0.3.
|
|
10
|
+
## [0.3.3] - 2024-12-02
|
|
11
|
+
|
|
12
|
+
### Fixed
|
|
13
|
+
|
|
14
|
+
- **Types**: Made `shadows` property optional in `ResourceSchema` interface
|
|
15
|
+
- Allows schemas without `shadows.sortableFields` definition
|
|
16
|
+
- Maintains backward compatibility with v0.2.x schemas
|
|
17
|
+
- All fields are automatically shadowed in v0.3.x
|
|
18
|
+
|
|
19
|
+
## [0.3.2] - 2024-12-02
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- **Shadow Configuration**: Simplified shadow configuration (auto-shadow simplification)
|
|
24
|
+
- Removed `shadow.config.json` file requirement
|
|
25
|
+
- Removed `generate-shadow-config` CLI tool
|
|
26
|
+
- All fields are now automatically shadowed without configuration
|
|
27
|
+
- Simplified package structure and build process
|
|
28
|
+
|
|
29
|
+
## [0.3.1] - 2024-12-02
|
|
30
|
+
|
|
31
|
+
### Fixed
|
|
32
|
+
|
|
33
|
+
- **Build**: Fixed TypeScript compilation errors
|
|
34
|
+
- Fixed syntax errors in timestamps.ts and validation.ts
|
|
35
|
+
- Updated ShadowConfig type imports
|
|
36
|
+
- Removed unused getResourceSchema calls
|
|
37
|
+
- **ESLint**: Fixed ESLint parsing errors for test files
|
|
38
|
+
- Added separate ESLint configuration for test files
|
|
39
|
+
- Configured `project: false` for test files excluded from tsconfig.json
|
|
40
|
+
|
|
41
|
+
## [0.3.0] - 2024-12-01
|
|
11
42
|
|
|
12
43
|
### Added
|
|
13
44
|
|
package/dist/server/handler.cjs
CHANGED
package/dist/shadows/schema.d.ts
CHANGED
|
@@ -18,14 +18,17 @@ export interface ShadowFieldDefinition {
|
|
|
18
18
|
* リソーススキーマの定義
|
|
19
19
|
*
|
|
20
20
|
* @template T - リソースの型(例: Article, Task など)
|
|
21
|
+
*
|
|
22
|
+
* @exabugs/dynamodb-client v0.3.x では、シャドウ設定は環境変数ベースになりました。
|
|
23
|
+
* shadows プロパティは後方互換性のために残されていますが、省略可能です。
|
|
21
24
|
*/
|
|
22
25
|
export interface ResourceSchema<T = any> {
|
|
23
26
|
/** リソース名(複数形、例: "articles", "tasks") */
|
|
24
27
|
resource: string;
|
|
25
28
|
/** リソースの型定義(型チェック用) */
|
|
26
29
|
type: T;
|
|
27
|
-
/**
|
|
28
|
-
shadows
|
|
30
|
+
/** シャドー設定(省略可、v0.3.x では不要) */
|
|
31
|
+
shadows?: {
|
|
29
32
|
/** ソート可能なフィールドの定義 */
|
|
30
33
|
sortableFields: Record<string, ShadowFieldDefinition>;
|
|
31
34
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/shadows/schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,eAAe,CAAC;CACvB;AAED
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/shadows/schema.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,SAAS,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,eAAe,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,cAAc,CAAC,CAAC,GAAG,GAAG;IACrC,wCAAwC;IACxC,QAAQ,EAAE,MAAM,CAAC;IAEjB,uBAAuB;IACvB,IAAI,EAAE,CAAC,CAAC;IAER,8BAA8B;IAC9B,OAAO,CAAC,EAAE;QACR,qBAAqB;QACrB,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,qBAAqB,CAAC,CAAC;KACvD,CAAC;IAEF,2BAA2B;IAC3B,YAAY,CAAC,EAAE;QACb,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,KAAK,GAAG,MAAM,CAAC;KACvB,CAAC;IAEF,kBAAkB;IAClB,GAAG,CAAC,EAAE;QACJ,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,eAAe;IACf,QAAQ,EAAE;QACR,oBAAoB;QACpB,UAAU,EAAE;YACV,SAAS,EAAE,MAAM,CAAC;YAClB,SAAS,EAAE,MAAM,CAAC;SACnB,CAAC;KACH,CAAC;IAEF,kBAAkB;IAClB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;CAC3C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exabugs/dynamodb-client",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "DynamoDB Single-Table Client SDK with MongoDB-like API, Shadow Records, and Lambda implementation for serverless applications",
|
|
5
5
|
"author": "exabugs",
|
|
6
6
|
"license": "MIT",
|
package/terraform/main.tf
CHANGED
|
@@ -110,8 +110,12 @@ resource "aws_lambda_function" "records" {
|
|
|
110
110
|
COGNITO_USER_POOL_ID = var.cognito_user_pool_id
|
|
111
111
|
COGNITO_CLIENT_ID = var.cognito_client_id
|
|
112
112
|
COGNITO_REGION = var.region
|
|
113
|
-
SHADOW_CONFIG = var.shadow_config
|
|
114
113
|
LOG_LEVEL = var.log_level
|
|
114
|
+
# シャドウ設定(環境変数ベース)
|
|
115
|
+
SHADOW_CREATED_AT_FIELD = var.shadow_created_at_field
|
|
116
|
+
SHADOW_UPDATED_AT_FIELD = var.shadow_updated_at_field
|
|
117
|
+
SHADOW_STRING_MAX_BYTES = var.shadow_string_max_bytes
|
|
118
|
+
SHADOW_NUMBER_PADDING = var.shadow_number_padding
|
|
115
119
|
}
|
|
116
120
|
}
|
|
117
121
|
|
package/terraform/variables.tf
CHANGED
|
@@ -53,7 +53,37 @@ variable "log_level" {
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
# シャドウ設定(環境変数ベース)
|
|
57
|
+
variable "shadow_created_at_field" {
|
|
58
|
+
description = "作成日時フィールド名"
|
|
58
59
|
type = string
|
|
60
|
+
default = "createdAt"
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
variable "shadow_updated_at_field" {
|
|
64
|
+
description = "更新日時フィールド名"
|
|
65
|
+
type = string
|
|
66
|
+
default = "updatedAt"
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
variable "shadow_string_max_bytes" {
|
|
70
|
+
description = "プリミティブ型の最大バイト数(array/objectは2倍)"
|
|
71
|
+
type = number
|
|
72
|
+
default = 100
|
|
73
|
+
|
|
74
|
+
validation {
|
|
75
|
+
condition = var.shadow_string_max_bytes > 0
|
|
76
|
+
error_message = "shadow_string_max_bytes は正の整数である必要があります。"
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
variable "shadow_number_padding" {
|
|
81
|
+
description = "数値のパディング桁数"
|
|
82
|
+
type = number
|
|
83
|
+
default = 15
|
|
84
|
+
|
|
85
|
+
validation {
|
|
86
|
+
condition = var.shadow_number_padding > 0 && var.shadow_number_padding <= 15
|
|
87
|
+
error_message = "shadow_number_padding は 1 から 15 の間である必要があります。"
|
|
88
|
+
}
|
|
59
89
|
}
|