@arcaelas/dynamite 1.0.10 → 1.0.13

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.
Files changed (105) hide show
  1. package/LICENSE.txt +32 -0
  2. package/README.txt +206 -0
  3. package/package.json +5 -4
  4. package/src/@types/index.d.ts +96 -0
  5. package/src/@types/index.js +9 -0
  6. package/{build/src → src}/core/client.d.ts +4 -0
  7. package/{build/src → src}/core/client.js +14 -2
  8. package/src/core/table.d.ts +98 -0
  9. package/src/core/table.js +459 -0
  10. package/src/core/wrapper.d.ts +17 -0
  11. package/src/core/wrapper.js +46 -0
  12. package/src/decorators/belongs_to.d.ts +1 -0
  13. package/src/decorators/belongs_to.js +24 -0
  14. package/src/decorators/created_at.d.ts +1 -0
  15. package/{build/src → src}/decorators/created_at.js +0 -7
  16. package/src/decorators/default.d.ts +1 -0
  17. package/{build/src → src}/decorators/default.js +2 -12
  18. package/src/decorators/has_many.d.ts +1 -0
  19. package/src/decorators/has_many.js +24 -0
  20. package/{build/src → src}/decorators/index.d.ts +4 -1
  21. package/src/decorators/index.js +36 -0
  22. package/src/decorators/index_sort.d.ts +12 -0
  23. package/src/decorators/index_sort.js +43 -0
  24. package/src/decorators/mutate.d.ts +2 -0
  25. package/{build/src → src}/decorators/mutate.js +2 -11
  26. package/src/decorators/name.d.ts +1 -0
  27. package/src/decorators/name.js +28 -0
  28. package/src/decorators/not_null.d.ts +1 -0
  29. package/{build/src → src}/decorators/not_null.js +0 -7
  30. package/src/decorators/primary_key.d.ts +6 -0
  31. package/src/decorators/primary_key.js +30 -0
  32. package/src/decorators/updated_at.d.ts +12 -0
  33. package/src/decorators/updated_at.js +26 -0
  34. package/src/decorators/validate.d.ts +1 -0
  35. package/{build/src → src}/decorators/validate.js +0 -7
  36. package/{build/src → src}/index.d.ts +9 -0
  37. package/{build/src → src}/index.js +14 -5
  38. package/{build/src → src}/utils/batch-relations.js +2 -1
  39. package/src/utils/circular-detector.d.ts +82 -0
  40. package/src/utils/circular-detector.js +209 -0
  41. package/src/utils/memory-manager.d.ts +42 -0
  42. package/src/utils/memory-manager.js +108 -0
  43. package/{build/src → src}/utils/projection.js +3 -2
  44. package/src/utils/relations.d.ts +17 -0
  45. package/src/utils/relations.js +166 -0
  46. package/src/utils/security-validator.d.ts +49 -0
  47. package/src/utils/security-validator.js +152 -0
  48. package/src/utils/throttle-manager.d.ts +78 -0
  49. package/src/utils/throttle-manager.js +196 -0
  50. package/src/utils/transaction-manager.d.ts +88 -0
  51. package/src/utils/transaction-manager.js +298 -0
  52. package/build/__tests__/crud.spec.d.ts +0 -7
  53. package/build/__tests__/crud.spec.js +0 -287
  54. package/build/__tests__/crud.spec.js.map +0 -1
  55. package/build/__tests__/debug-decorators.spec.d.ts +0 -7
  56. package/build/__tests__/debug-decorators.spec.js +0 -143
  57. package/build/__tests__/debug-decorators.spec.js.map +0 -1
  58. package/build/__tests__/decorators.spec.d.ts +0 -7
  59. package/build/__tests__/decorators.spec.js +0 -203
  60. package/build/__tests__/decorators.spec.js.map +0 -1
  61. package/build/__tests__/instance-crud.spec.d.ts +0 -7
  62. package/build/__tests__/instance-crud.spec.js +0 -184
  63. package/build/__tests__/instance-crud.spec.js.map +0 -1
  64. package/build/src/core/client.js.map +0 -1
  65. package/build/src/core/table.d.ts +0 -164
  66. package/build/src/core/table.js +0 -406
  67. package/build/src/core/table.js.map +0 -1
  68. package/build/src/core/wrapper.d.ts +0 -54
  69. package/build/src/core/wrapper.js +0 -27
  70. package/build/src/core/wrapper.js.map +0 -1
  71. package/build/src/decorators/created_at.d.ts +0 -8
  72. package/build/src/decorators/created_at.js.map +0 -1
  73. package/build/src/decorators/default.d.ts +0 -8
  74. package/build/src/decorators/default.js.map +0 -1
  75. package/build/src/decorators/index.js +0 -26
  76. package/build/src/decorators/index.js.map +0 -1
  77. package/build/src/decorators/index_sort.d.ts +0 -8
  78. package/build/src/decorators/index_sort.js +0 -30
  79. package/build/src/decorators/index_sort.js.map +0 -1
  80. package/build/src/decorators/mutate.d.ts +0 -9
  81. package/build/src/decorators/mutate.js.map +0 -1
  82. package/build/src/decorators/name.d.ts +0 -8
  83. package/build/src/decorators/name.js +0 -42
  84. package/build/src/decorators/name.js.map +0 -1
  85. package/build/src/decorators/not_null.d.ts +0 -8
  86. package/build/src/decorators/not_null.js.map +0 -1
  87. package/build/src/decorators/primary_key.d.ts +0 -8
  88. package/build/src/decorators/primary_key.js +0 -26
  89. package/build/src/decorators/primary_key.js.map +0 -1
  90. package/build/src/decorators/updated_at.d.ts +0 -8
  91. package/build/src/decorators/updated_at.js +0 -18
  92. package/build/src/decorators/updated_at.js.map +0 -1
  93. package/build/src/decorators/validate.d.ts +0 -8
  94. package/build/src/decorators/validate.js.map +0 -1
  95. package/build/src/index.js.map +0 -1
  96. package/build/src/utils/batch-relations.js.map +0 -1
  97. package/build/src/utils/naming.js.map +0 -1
  98. package/build/src/utils/projection.js.map +0 -1
  99. package/build/src/utils/relations.d.ts +0 -23
  100. package/build/src/utils/relations.js +0 -205
  101. package/build/src/utils/relations.js.map +0 -1
  102. /package/{build/src → src}/utils/batch-relations.d.ts +0 -0
  103. /package/{build/src → src}/utils/naming.d.ts +0 -0
  104. /package/{build/src → src}/utils/naming.js +0 -0
  105. /package/{build/src → src}/utils/projection.d.ts +0 -0
package/LICENSE.txt ADDED
@@ -0,0 +1,32 @@
1
+ Amazon DynamoDB Local License Agreement
2
+ THIS LICENSE AGREEMENT (“LICENSE”) GOVERNS YOUR USE OF THE DYNAMODB LOCAL SOFTWARE (TOGETHER WITH ANY UPDATES AND ENHANCEMENTS TO IT, AND ACCOMPANYING DOCUMENTATION, THE “SOFTWARE”). IF YOU INSTALL OR USE THE SOFTWARE, YOU WILL BE BOUND BY THIS LICENSE. UNLESS OTHERWISE DEFINED IN THIS LICENSE, CAPTIALIZED TERMS WILL HAVE THE SAME MEANING AS SET FORTH IN THE AWS CUSTOMER AGREEMENT POSTED AT AWS.AMAZON.COM/AGREEMENT (THE “AWS AGREEMENT”).
3
+ AWS Licensor
4
+ If the geographic location associated with your AWS account is any country within Europe, the Middle East, or Africa (“EMEA”), then Amazon Web Services EMEA SARL (“AWS Europe”) grants this License. If the geographic location associated with your AWS account is any country outside of EMEA, then Amazon Web Services, Inc. (“AWS, Inc.”) grants this License. “AWS Europe” and “AWS, Inc.” are individually referred to herein as an “AWS Licensor”.
5
+ No Agency
6
+ This License forms a separate agreement between you and AWS Licensor without any further action required by the parties. AWS Licensor grants this License in its own capacity and no other party is acting as agent of AWS Licensor or has capacity to bind AWS Licensor.
7
+ License
8
+ AWS Licensor or its licensors own all right, title, and interest in and to the Software and all related technology and intellectual property rights. Subject to the terms of this License and the AWS Agreement, AWS Licensor hereby grants you a personal, limited, nonexclusive, non-transferable, non-sublicenseable license to (a) install the Software on computer equipment owned or controlled by you and (b) use the Software solely (i) for your internal business purposes and (ii) in connection with the Services. You may not use the Software if you do not have an AWS account in good standing. Some components of the Software may also be governed by applicable open-source software licenses located in the software component's source code. Your license rights with respect to these individual components are defined by the applicable open-source software license, and nothing in this License will restrict, limit, or otherwise affect any rights or obligations you may have, or conditions to which you may be subject, under such open-source software licenses.
9
+ Limitations
10
+ You may not, and you will not encourage, assist, or authorize any other person to, (a) incorporate any portion of it into your own programs or compile any portion of it in combination with your own programs; or (b) sell, rent, lease, lend, loan, distribute, act as a service bureau, publicly communicate, transform, or sub-license the Software or otherwise assign any rights to the Software in whole or in part; (c) modify, alter, tamper with, repair, or otherwise create derivative works of the Software, or (d) reverse engineer, disassemble, or decompile the Software or apply any other process or procedure to derive the source code of any software included in the Software. All rights granted to you are conditioned on your continued compliance this License, and will immediately and automatically terminate if you do not comply with any term or condition of this License or the AWS Agreement, including any failure to remit timely payment for the Software or the Service.
11
+ Reservation of Rights
12
+ You may not use the Software for any illegal purpose. The Software is the intellectual property of AWS Licensor or its licensors. The structure, organization, and code of the Software are valuable trade secrets and confidential information of AWS Licensor. The Software is protected by law, including without limitation copyright laws and international treaty provisions. Except for the rights explicitly granted to you in this License, all right, title and interest in the Software are reserved and retained by AWS Licensor and its licensors. You do not acquire any intellectual property or other rights in the Software as a result of downloading the Software.
13
+ Updates
14
+ In order to keep the Software up to date, AWS Licensor may offer automatic or manual updates at any time. If AWS Licensor elects to provide maintenance or support of any kind, AWS Licensor may terminate that maintenance or support at any time without notice to you.
15
+ Termination
16
+ You may terminate this License at any time by uninstalling or destroying all copies of the Software that are in your possession or control. Your rights under this License will automatically terminate without notice if you fail to comply with any of its terms or fail to make timely payment. In the case of termination, you must cease all use and destroy all copies of the Software. AWS Licensor may modify, suspend, discontinue, or terminate your right to use part or all of the Software at any time without notice to you, and in that event AWS Licensor may modify the Software to make it inoperable. AWS Licensor will not be liable to you should it exercise those rights. AWS Licensor’s failure to insist upon or enforce your strict compliance with this License will not constitute a waiver of any of its rights.
17
+ Disclaimer of Warranties and Limitation of Liability
18
+ a. YOU EXPRESSLY ACKNOWLEDGE AND AGREE THAT INSTALLATION AND USE OF, AND ANY OTHER ACCESS TO, THE APPLICATION IS AT YOUR SOLE RISK. THE APPLICATION IS DELIVERED TO YOU “AS IS” WITH ALL FAULTS AND WITHOUT WARRANTY OF ANY KIND, AND AWS LICENSOR, ITS LICENSORS AND DISTRIBUTORS, AND EACH OF THEIR RESPECTIVE AFFILIATES AND SUPPLIERS (COLLECTIVELY, THE “RELEASED PARTIES”) DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, ACCURACY, QUIET ENJOYMENT, AND NON-INFRINGEMENT. NO ORAL OR WRITTEN INFORMATION OR ADVICE GIVEN BY A RELEASED PARTY OR AN AUTHORIZED REPRESENTATIVE OF A RELEASED PARTY WILL CREATE A WARRANTY. THE LAWS OF CERTAIN JURISDICTIONS DO NOT ALLOW THE DISCLAIMER OF IMPLIED WARRANTIES. IF THESE LAWS APPLY TO YOU, SOME OR ALL OF THE ABOVE DISCLAIMERS, EXCLUSIONS, OR LIMITATIONS MAY NOT APPLY TO YOU, AND YOU MAY HAVE ADDITIONAL RIGHTS.
19
+ b. TO THE EXTENT NOT PROHIBITED BY LAW, NO RELEASED PARTY WILL BE LIABLE TO YOU FOR ANY INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR BREACH OF ANY EXPRESS OR IMPLIED WARRANTY, BREACH OF CONTRACT, NEGLIGENCE, STRICT LIABILITY, OR ANY OTHER LEGAL THEORY RELATED TO THE APPLICATION, INCLUDING WITHOUT LIMITATION ANY DAMAGES ARISING OUT OF LOSS OF PROFITS, REVENUE, DATA, OR USE OF THE APPLICATION, EVEN IF A RELEASED PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. IN ANY CASE, ANY RELEASED PARTY’S AGGREGATE LIABILITY UNDER THIS LICENSE WILL BE LIMITED TO $50.00. THE LAWS OF CERTAIN JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES. IF THESE LAWS APPLY TO YOU, SOME OR ALL OF THE ABOVE EXCLUSIONS OR LIMITATIONS MAY NOT APPLY TO YOU, AND YOU MAY HAVE ADDITIONAL RIGHTS.
20
+ Indemnification
21
+ You are liable for and will defend, indemnify, and hold harmless the Released Parties and their officers, directors, agents, and employees, from and against any liability, loss, damage, cost, or expense (including reasonable attorneys’ fees) arising out of your use of the Software, violation of this License, violation of applicable law, or violation of any right of any person or entity, including without limitation intellectual property rights.
22
+ Export Regulations
23
+ You will comply with all export and re-export restrictions and regulations of the United States Department of Commerce and other United States and foreign agencies and authorities that may apply to the Software, and not to transfer, or encourage, assist, or authorize the transfer of the Software to a prohibited country or otherwise in violation of any applicable restrictions or regulations.
24
+ U.S. Government End Users
25
+ The Software is provided to the U.S. Government as “commercial items,” “commercial computer software,” “commercial computer software documentation,” and “technical data” with the same rights and restrictions generally applicable to the Software. If you are using the Software on behalf of the U.S. Government and these terms fail to meet the U.S. Government’s needs or are inconsistent in any respect with federal law, you will immediately discontinue your use of the Software. The terms “commercial item,” “commercial computer software,” “commercial computer software documentation,” and “technical data” are defined in the Federal Acquisition Regulation and the Defense Federal Acquisition Regulation Supplement.
26
+ Amendment
27
+ AWS Licensor may amend this License at its sole discretion by posting the revised terms on the AWS website (aws.amazon.com) or within the Software. Your continued use of the Software after any amendment's effective date evidences your agreement to be bound by it.
28
+ Conflicts
29
+ The terms of this License govern the Software and any updates or upgrades to the Software that AWS Licensor may provide that replace or supplement the original Software, unless the update or upgrade is accompanied by a separate license, in which case the terms of that license will govern.
30
+
31
+ Note
32
+ Other license terms may apply to certain, identified software files contained within or distributed with the accompanying software if such terms are included in the file THIRD-PARTY-LICENSES.txt. Such other license terms will then apply in lieu of the terms of the software license above.
package/README.txt ADDED
@@ -0,0 +1,206 @@
1
+ README
2
+ ========
3
+
4
+ For an overview of DynamoDB Local please refer to the documentation at http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tools.DynamoDBLocal.html
5
+
6
+
7
+ Release Notes
8
+ -----------------------------
9
+ 2025-06-26 (3.0.0)
10
+ * Migrating from AWS SDK Java V1 to V2
11
+ * Updated package structure from com.amazonaws.services.dynamodbv2 to software.amazon.dynamodb.services
12
+ * Removed AWS SDK Java V1 dependencies
13
+
14
+ 2025-02-25 (2.6.0)
15
+ * Added support for using Table ARN as table name in several DynamoDB APIs
16
+ * Fixing CreateStreamTable bug on high performance machines, such as Mac M3
17
+ * Upgrading Dependencies to fix vulnerability issues (CVE-2022-49043,CVE-2024-56732, CVE-2020-29582, CVE-2025-21502, CVE-2024-50602, CVE-2025-24970, CVE-2025-25193)
18
+
19
+ 2024-12-12 (2.5.4)
20
+ * Upgrading to Jetty 12.0.14 (Resolves CVE-2024-6763, CVE-2024-8184, CVE-2024-47535)
21
+
22
+ 2024-11-06 (2.5.3)
23
+ * Upgrading Jackson Dependencies to 2.17.x in Log4j Core (Resolves CVE-2022-1471)
24
+
25
+ 2024-06-20 (2.5.2)
26
+ * Bug fix for workflow when update table tries to update table with Billing Mode Ondemand to Provisioned With GSI
27
+
28
+ 2024-06-05 (2.5.1)
29
+ * Fixing a couple of bugs related to OndemandThroughPut
30
+
31
+ 2024-05-28 (2.5.0)
32
+ * Adding support for OndemandThroughPut
33
+ * Adding Telemetry to Embedded Mode
34
+ * Support for ReturnValuesOnConditionCheckFailure for BatchExecuteStatement and ExecuteTransactionRequest
35
+ * Fixing the SDKv2 translation for ConditionalCheckException
36
+
37
+ 2024-04-16 (2.4.0)
38
+ * Support for ReturnValuesOnConditionCheckFailure - Embedded Mode
39
+ * Fix for TrimmedDataAccessException for Operation on Multiple Streams
40
+ * Fixing exception transalation for SDKv2 in Embedded Mode
41
+
42
+ 2024-03-14 (2.3.0)
43
+ * Uprading to Jetty 12.0.2
44
+ * Upgrading to JDK 17
45
+ * Upgrading ANTLR4 to 4.10.1
46
+
47
+ 2024-01-04 (2.2.1)
48
+ * Fixed a bug for Handling of segments in parallel scan
49
+
50
+ 2023-12-14 (2.2.0)
51
+ * Added support of Table delete protection
52
+ * Added support for ReturnValuesOnConditionCheckFailure
53
+ * Added Support for -Version flag
54
+
55
+ 2023-09-28 (2.1.0)
56
+ * Adding Telemetry to DynamoDB Local
57
+ * Dynamically Copy SQLLite Native Libraries for Maven projects
58
+ * Removed io.github.ganadist.sqlite4java library from Maven dependency
59
+ * Upgrading the GoogleGuava to 32.1.1-jre
60
+
61
+ 2023-06-28 (2.0.0)
62
+ * Migrating from javax to jakarta namespace and JDK11 Support
63
+ * Fix for handling invalid access and secret key while server startup
64
+ * Fixing Maven identified vulnerabilities by updating dependencies
65
+
66
+ 2023-06-28 (1.23.0)
67
+ * Fix for handling invalid access and secret key while server startup
68
+ * Fixing Maven identified vulnerabilities by updating dependencies
69
+
70
+ 2023-06-08 (1.22.0)
71
+ * Optimize IN clause for PartiQL
72
+ * Support for Limit Operation
73
+ * M1 support for Maven projects
74
+
75
+ 2023-1-26 (1.21.0)
76
+ * Matching Expection for Duplicate items with Web Service for batch-execute-statement operation
77
+ * Increase max number of actions to 100
78
+ * Upgrading Open JDK on docker to openjdk11
79
+
80
+ 2022-9-12 (1.20.0)
81
+
82
+ * Fixed path traversal issue
83
+ * Updated Jetty dependency to 9.4.48.v20220622
84
+ * Added M1 support
85
+
86
+ 2022-7-27 (1.19.0)
87
+
88
+ * Updated IonSQLSandbox dependency to version 6.x
89
+ * Updated KotlinStdlib dependency to version 1.6.x
90
+
91
+ 2022-1-10 (1.18.0)
92
+
93
+ * Updated log4j-core dependency to version 2.17.1.
94
+ * Updated Jackson-core and related libraries from 2.10.x to 2.12.0
95
+
96
+ 2021-12-16 (1.17.2)
97
+
98
+ * Updated log4j-core dependency to version 2.16.
99
+
100
+ 2021-12-10 (1.17.1)
101
+
102
+ * Updated log4j-core dependency to patch zero-day exploit to prevent remote code execution - Log4Shell: RCE 0-day. Applied internal patch for 2.13.3 for log4j-core by removing JndiLookup class.
103
+
104
+ 2021-10-08 (1.17.0)
105
+
106
+ * Update the AWS SDK dependency to AWS SDK for Java 1.12.x
107
+ * Update License.txt file
108
+ * Deprecated Javascript Web Shell
109
+
110
+ 2021-05-03 (1.16.0)
111
+
112
+ * Improve the performance of DynamoDbLocal by reducing buffer size to 1KB from 16MB which reduces overall heap memory usage
113
+ * Add a CORS header to DynamoDB local API responses in the case of error responses, which solves the issue of returning generic ResourceNotFoundException for all errors
114
+ * Add support for AWS SDK for Java 2.0
115
+ * Fix wording of the exception messages shown when incorrect attribute definitions are passed in the create table command
116
+ 2021-02-08 (1.15.0)
117
+
118
+ * Add support for PartiQL Select, Update, Insert, Delete Statements
119
+ * Add support for batch reads and writes using PartiQL
120
+ * Add support for transactional reads or writes using PartiQL
121
+ * Fix the shardIterator format to keep the streamArn as part one and serial number as part two to sync with DynamoDB Streams
122
+ * Update the Jackson library dependency from 2.6 to 2.10
123
+ * Fix the error structure difference for message key name in TransactionCanceledException
124
+ * Suppress “Logging initialized” log message shown at server startup
125
+
126
+ 2020-12-21 (1.13.6)
127
+
128
+ * Fix the XSS security issue in the DynamoDB JavaScript shell by sanitizing the input and output data
129
+ * Add the log4j-core library dependency with the version update from 2.8 to 2.13.3
130
+ * Fix the describe-stream CLI for the option, —exclusive-start-shard-id, to return basic streaminfo instead of RESOURCE_NOT_FOUND, if the requested shard-id does not match
131
+ * Fix GSI input to not mutate while creating a table with billing mode set to PAY_PER_REQUEST
132
+ * Update the Jetty library dependency version to 9.4.18.v20190429
133
+
134
+ 2020-10-13 (1.13.5)
135
+
136
+ * Align error message with Amazon DynamoDB service for empty sets attributes, empty value attributes, and when invalid BETWEEN condition operator range is given
137
+ * Update log4j-api library dependency version to 2.13.3
138
+ * Remove dependency on log4j-core 2.6.2
139
+ * Provide support for multi-arch docker images with arm64 and amd64 architectures
140
+
141
+ 2020-09-14 (1.13.4)
142
+
143
+ * Fixes an issue where the “begins_with” conditional function was not working correctly with Binary types for Java versions 9 and later.
144
+
145
+ 2020-08-24 (1.13.3)
146
+
147
+ * Fix issues in the begins_with function in key conditions for binary range keys in the Query API.
148
+
149
+ 2020-07-22 (1.13.2)
150
+
151
+ * Fix notarization issue caused by running DynamoDB local on macOS Catalina.
152
+ * Bug fix to return only the requested item attributes when a global secondary index is queried with specific attributes.
153
+
154
+ 2020-05-29 (1.13.1)
155
+
156
+ * Bugfix to throw validation error when gsi is queried with non projected attribute
157
+ * Bugfix to throw validation error when gsi with projection type other than ALL is queried with option Select as ALL_ATTRIBUTES
158
+
159
+ 2020-05-20 (1.13.0)
160
+
161
+ * Support up to 25 unique items and 4 MB of data per TransactWriteItems and TransactGetItems request
162
+ * Support empty values for non-key String and Binary attributes
163
+ * Fix warning log messages when DB is reinitialized
164
+ * Fix error messaging for inconsistent type validations
165
+ * Add shutdownNow API for DynamoDB Local embedded mode
166
+ * Update AWS SDK for Java to version 1.11.780
167
+
168
+ 2020-01-16 (1.12.0)
169
+
170
+ * Bugfixes
171
+ * Notarization for running on MacOS Catalina
172
+
173
+ 2019-02-06 (1.11.477)
174
+
175
+ * Bugfixes
176
+
177
+ 2019-02-04 (1.11.475)
178
+
179
+ * Add on-demand implementation
180
+ * Add support for 20 GSIs (up from 5)
181
+ * Add transaction API implementation
182
+ * Update AWS SDK for Java to version 1.11.475
183
+
184
+ 2017-04-13 (1.11.119)
185
+
186
+ * Add TTL implementation
187
+ * Update AWS SDK for Java to version 1.11.119
188
+
189
+ 2017-01-24 (1.11.86)
190
+
191
+ * Implement waiters() method in LocalDynamoDBClient
192
+ * Update AWS SDK for Java to version 1.11.86
193
+ * Enable WARN logging for SQLite
194
+
195
+ 2016-05-17_1.0
196
+
197
+ * Bug fix for Query validation preventing primary key attributes in query filter expressions
198
+
199
+ Running DynamoDB Local
200
+ ---------------------------------------------------------------
201
+
202
+ java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar [options]
203
+
204
+ For more information on available options, run with the -help option:
205
+
206
+ java -Djava.library.path=./DynamoDBLocal_lib -jar DynamoDBLocal.jar -help
package/package.json CHANGED
@@ -27,14 +27,15 @@
27
27
  "typescript": "^5.8.3"
28
28
  },
29
29
  "files": [
30
- "build/",
31
30
  "*.md",
32
31
  "*.json",
32
+ "src/**/*.js",
33
+ "src/**/*.d.ts",
33
34
  "!tsconfig.json"
34
35
  ],
35
36
  "homepage": "https://github.com/arcaelas/dynamite",
36
37
  "license": "ISC",
37
- "main": "build/index.js",
38
+ "main": "src/index.js",
38
39
  "name": "@arcaelas/dynamite",
39
40
  "publishConfig": {
40
41
  "access": "public",
@@ -49,7 +50,7 @@
49
50
  "build": "tsc && tsc-alias",
50
51
  "prepublishOnly": "yarn test && yarn build && npm version patch",
51
52
  "commit": "npm publish --access=public",
52
- "postpublish": "rm -rf build"
53
+ "postpublish": "find src __tests__ -type f -name '*.js' -o -name '*.d.ts' -o -name '*.map' | xargs rm"
53
54
  },
54
- "version": "1.0.10"
55
+ "version": "1.0.13"
55
56
  }
@@ -0,0 +1,96 @@
1
+ export declare const HasManyBrand: unique symbol;
2
+ export declare const BelongsToBrand: unique symbol;
3
+ export declare const NonAttributeBrand: unique symbol;
4
+ export declare const CreationOptionalBrand: unique symbol;
5
+ export type HasMany<T> = T[] & {
6
+ [HasManyBrand]?: true;
7
+ };
8
+ export type BelongsTo<T> = (T | null) & {
9
+ [BelongsToBrand]?: true;
10
+ };
11
+ export type NonAttribute<T> = T & {
12
+ [NonAttributeBrand]?: true;
13
+ };
14
+ export type CreationOptional<T> = T & {
15
+ [CreationOptionalBrand]?: true;
16
+ };
17
+ export type InferAttributes<T> = {
18
+ [K in keyof T as T[K] extends (...args: any[]) => any ? never : T[K] extends {
19
+ [HasManyBrand]?: true;
20
+ } ? never : T[K] extends {
21
+ [BelongsToBrand]?: true;
22
+ } ? never : T[K] extends {
23
+ [NonAttributeBrand]?: true;
24
+ } ? never : K]: T[K];
25
+ };
26
+ export type FilterableAttributes<T> = {
27
+ [K in keyof InferAttributes<T>]: InferAttributes<T>[K];
28
+ };
29
+ type SelectResult<T, A extends keyof T> = Pick<T, A>;
30
+ type ResolveIncludeType<T, K extends keyof T> = T[K] extends HasMany<infer U> ? U[] : T[K] extends BelongsTo<infer U> ? U | null : never;
31
+ export type IncludeOptions = {
32
+ where?: Record<string, any>;
33
+ attributes?: string[];
34
+ limit?: number;
35
+ skip?: number;
36
+ order?: "ASC" | "DESC";
37
+ };
38
+ export type QueryResult<T, A extends keyof T = keyof T, I extends Record<string, any> = {}> = SelectResult<T & {
39
+ [K in keyof I]: K extends keyof T ? ResolveIncludeType<T, K> : never;
40
+ }, A>;
41
+ export type WhereOptions<T> = {
42
+ where?: Partial<FilterableAttributes<T>>;
43
+ skip?: number;
44
+ limit?: number;
45
+ order?: "ASC" | "DESC";
46
+ attributes?: (keyof FilterableAttributes<T>)[];
47
+ include?: {
48
+ [K in keyof T]?: T[K] extends HasMany<any> | BelongsTo<any> ? IncludeOptions | {} : never;
49
+ };
50
+ };
51
+ export type WhereOptionsWithoutWhere<T> = Omit<WhereOptions<T>, "where">;
52
+ export type QueryOperator = "=" | "!=" | "<" | "<=" | ">" | ">=" | "in" | "not-in" | "contains" | "begins-with";
53
+ export interface Column {
54
+ name: string;
55
+ default?: any | (() => any);
56
+ mutate?: ((value: any) => any)[];
57
+ validate?: ((value: any) => boolean | string)[];
58
+ index?: true;
59
+ indexSort?: true;
60
+ primaryKey?: boolean;
61
+ nullable?: boolean;
62
+ unique?: true;
63
+ createdAt?: boolean;
64
+ updatedAt?: boolean;
65
+ }
66
+ export interface RelationMetadata {
67
+ type: "hasMany" | "belongsTo";
68
+ targetModel: () => any;
69
+ foreignKey: string;
70
+ localKey?: string;
71
+ }
72
+ export interface WrapperEntry {
73
+ name: string;
74
+ columns: Map<string | symbol, Column>;
75
+ relations: Map<string | symbol, RelationMetadata>;
76
+ }
77
+ export type IncludeRelationOptions = {
78
+ where?: Record<string, any>;
79
+ attributes?: string[];
80
+ order?: "ASC" | "DESC";
81
+ skip?: number;
82
+ limit?: number;
83
+ include?: Record<string, IncludeRelationOptions | true>;
84
+ };
85
+ export type WhereQueryOptions<T> = {
86
+ order?: "ASC" | "DESC";
87
+ skip?: number;
88
+ limit?: number;
89
+ attributes?: (keyof InferAttributes<T>)[];
90
+ include?: {
91
+ [K in keyof T]?: T[K] extends HasMany<any> | BelongsTo<any> ? IncludeRelationOptions | true : never;
92
+ };
93
+ };
94
+ export type Mutate = (value: any) => any;
95
+ export type Validate = (value: any) => boolean | string;
96
+ export {};
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ /*
3
+ @file index.ts
4
+ @descripcion Tipos públicos de Dynamite ORM
5
+ @autor Miguel Alejandro
6
+ @fecha 2025-08-07
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ //# sourceMappingURL=index.js.map
@@ -63,3 +63,7 @@ export declare const getGlobalClient: () => DynamoDBClient;
63
63
  * Check if global client is available
64
64
  */
65
65
  export declare const hasGlobalClient: () => boolean;
66
+ /**
67
+ * Require global client for Table operations (throws if not available)
68
+ */
69
+ export declare const requireClient: () => DynamoDBClient;
@@ -9,7 +9,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
9
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.hasGlobalClient = exports.getGlobalClient = exports.setGlobalClient = exports.Dynamite = void 0;
12
+ exports.requireClient = exports.hasGlobalClient = exports.getGlobalClient = exports.setGlobalClient = exports.Dynamite = void 0;
13
13
  const client_dynamodb_1 = require("@aws-sdk/client-dynamodb");
14
14
  const wrapper_1 = __importDefault(require("./wrapper"));
15
15
  /**
@@ -147,6 +147,18 @@ exports.getGlobalClient = getGlobalClient;
147
147
  /**
148
148
  * Check if global client is available
149
149
  */
150
- const hasGlobalClient = () => globalClient !== undefined;
150
+ const hasGlobalClient = () => {
151
+ return globalClient !== undefined;
152
+ };
151
153
  exports.hasGlobalClient = hasGlobalClient;
154
+ /**
155
+ * Require global client for Table operations (throws if not available)
156
+ */
157
+ const requireClient = () => {
158
+ if (!globalClient) {
159
+ throw new Error("DynamoDB client no configurado. Use Dynamite.connect() primero.");
160
+ }
161
+ return globalClient;
162
+ };
163
+ exports.requireClient = requireClient;
152
164
  //# sourceMappingURL=client.js.map
@@ -0,0 +1,98 @@
1
+ /**
2
+ * @file table.ts
3
+ * @descripcion Clase Table rediseñada con API completa y tipado estricto
4
+ * @autor Miguel Alejandro
5
+ * @fecha 2025-07-30
6
+ */
7
+ import type { InferAttributes, QueryOperator, WrapperEntry, WhereQueryOptions } from "../@types/index";
8
+ import { STORE } from "./wrapper";
9
+ export default class Table<T = any> {
10
+ protected [STORE]: {
11
+ [K in keyof T]?: T[K];
12
+ };
13
+ constructor(data: InferAttributes<T>);
14
+ /** Serializar instancia a JSON plano */
15
+ toJSON(): Record<string, any>;
16
+ /** Guardar instancia (crear o actualizar) */
17
+ save(): Promise<this>;
18
+ /** Actualizar instancia */
19
+ update(patch: Partial<InferAttributes<T>>): Promise<this>;
20
+ /** Eliminar instancia */
21
+ destroy(): Promise<null>;
22
+ /**
23
+ * Crear un nuevo registro en la base de datos
24
+ */
25
+ static create<M extends Table>(this: {
26
+ new (data: InferAttributes<M>): M;
27
+ prototype: M;
28
+ }, data: InferAttributes<M>): Promise<M>;
29
+ /**
30
+ * Actualizar registros en la base de datos
31
+ * @param updates - Campos a actualizar. Los campos con valor `undefined` se ignoran.
32
+ * @param filters - Filtros para seleccionar los registros a actualizar
33
+ * @returns Número de registros actualizados
34
+ */
35
+ static update<M extends Table>(this: {
36
+ new (data: InferAttributes<M>): M;
37
+ prototype: M;
38
+ }, updates: Partial<InferAttributes<M>>, filters: Partial<InferAttributes<M>>): Promise<number>;
39
+ /**
40
+ * Eliminar registros de la base de datos
41
+ */
42
+ static delete<M extends Table>(this: {
43
+ new (data: InferAttributes<M>): M;
44
+ prototype: M;
45
+ }, filters: Partial<InferAttributes<M>>): Promise<number>;
46
+ /** Filtrar registros por campo igual a valor */
47
+ static where<M extends Table, K extends keyof InferAttributes<M>>(this: {
48
+ new (data: InferAttributes<M>): M;
49
+ prototype: M;
50
+ }, field: K, value: InferAttributes<M>[K] | InferAttributes<M>[K][]): Promise<M[]>;
51
+ /** Filtrar registros por campo con operador específico */
52
+ static where<M extends Table, K extends keyof InferAttributes<M>>(this: {
53
+ new (data: InferAttributes<M>): M;
54
+ prototype: M;
55
+ }, field: K, operator: QueryOperator, value: InferAttributes<M>[K] | InferAttributes<M>[K][]): Promise<M[]>;
56
+ /** Filtrar registros por múltiples campos (AND) */
57
+ static where<M extends Table>(this: {
58
+ new (data: InferAttributes<M>): M;
59
+ prototype: M;
60
+ }, filters: Partial<InferAttributes<M>>): Promise<M[]>;
61
+ /** Filtrar registros con opciones avanzadas */
62
+ static where<M extends Table>(this: {
63
+ new (data: InferAttributes<M>): M;
64
+ prototype: M;
65
+ }, filters: Partial<InferAttributes<M>>, options: WhereQueryOptions<M>): Promise<M[]>;
66
+ /**
67
+ * Obtener el primer registro que coincida con los filtros
68
+ */
69
+ static first<M extends Table, K extends keyof InferAttributes<M>>(this: {
70
+ new (data: InferAttributes<M>): M;
71
+ prototype: M;
72
+ }, field: K, value: InferAttributes<M>[K]): Promise<M | undefined>;
73
+ static first<M extends Table, K extends keyof InferAttributes<M>>(this: {
74
+ new (data: InferAttributes<M>): M;
75
+ prototype: M;
76
+ }, field: K, operator: QueryOperator, value: InferAttributes<M>[K] | InferAttributes<M>[K][]): Promise<M | undefined>;
77
+ static first<M extends Table>(this: {
78
+ new (data: InferAttributes<M>): M;
79
+ prototype: M;
80
+ }, filters: Partial<InferAttributes<M>>): Promise<M | undefined>;
81
+ /**
82
+ * Obtener el último registro que coincida con los filtros
83
+ */
84
+ static last<M extends Table, K extends keyof InferAttributes<M>>(this: {
85
+ new (data: InferAttributes<M>): M;
86
+ prototype: M;
87
+ }, field: K, value: InferAttributes<M>[K]): Promise<M | undefined>;
88
+ static last<M extends Table, K extends keyof InferAttributes<M>>(this: {
89
+ new (data: InferAttributes<M>): M;
90
+ prototype: M;
91
+ }, field: K, operator: QueryOperator, value: InferAttributes<M>[K] | InferAttributes<M>[K][]): Promise<M | undefined>;
92
+ static last<M extends Table>(this: {
93
+ new (data: InferAttributes<M>): M;
94
+ prototype: M;
95
+ }, filters: Partial<InferAttributes<M>>): Promise<M | undefined>;
96
+ }
97
+ export { STORE };
98
+ export type { WrapperEntry };