redis-om-type 1.0.0

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 ADDED
@@ -0,0 +1,168 @@
1
+ # Changelog
2
+
3
+ *Functional* changes to the public interface of Redis OM for Node.js will be listed here, by version. *Non-functional* changes may also be included, if they are particulary noteworthy or might impact developers using Redis OM.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## 1.0.0 - 2026-04-07
8
+
9
+ Initial release of **redis-om-type** on npm: TypeScript-based Node.js library for Redis with object mapping and additional utilities (aligned with Redis OM for Node.js capabilities; see repository for upstream lineage).
10
+
11
+ ## 0.4.3 - 2023-10-30
12
+ ### Fixed
13
+ - Fixed issue with change of casing in error message in RediSearch when calling `.dropIndex` on *Repository*
14
+
15
+ ### Added
16
+ - Add `.expireAt` method to *Repository*
17
+ - Add fuzz matching for 'text' type
18
+
19
+ ## 0.4.2 - 2023-07-26
20
+ ### Fixed
21
+ - Fixed issue with TAGs not properl;y escaping question marks
22
+
23
+ ## 0.4.1 - 2023-07-26
24
+ ### Added
25
+ - Added new type of `number[]` which works just like `number` but against an array of them
26
+
27
+ ## 0.4.0 - 2023-07-06
28
+ ### Added
29
+ - Added methods to *Repository* to allow you to provide your own *entityId* instead of relying on a generated one.
30
+ - Added support for Redis clustering by passing in a Node Redis connection created with `createCluster`.
31
+ - Added better and more meaningful exceptions.
32
+
33
+ ### Changed
34
+ - *Schema* now supports nested JSON via the `path` option.
35
+ - *Schema* now supports specifying the field for a Hash via the `field` option.
36
+ - *Schema* now supports `async` functions for *IdStrategy* allowing you to slow down your saves with I/O calls to generate IDs.
37
+ - *Repository* now allows adding Entities with properties that are not in the *Schema*. These can even be nested if you are using JSON.
38
+ - *Repository* can be now be constructed directly with `new` in addition to being created from a *Client* via `.fetchRepository`.
39
+ - *Repository* can now directly be handed an open Node Redis connection. No need to create a *Client* instance.
40
+ - *Client* deprecated in favor of using Node Redis connections.
41
+
42
+ ### Removed
43
+ - *Breaking Change* Removed *Entity* class. While still a type, it's no longer a class and is mostly just an alias for a JavaScript object.
44
+ - *Breaking Change* Removed `.execute` method on *Client*. Use Node Redis instead.
45
+ - *Breaking Change* Removed `.createEntity` and `.createAndSave` methods on *Repository*. Entities are simply JavaScript objects—to create one just create a JavaScript object and call `.save`.
46
+ - As *Entity* is no longer a class, custom methods on an *Entity* are no longer supported.
47
+
48
+ ### Fixed
49
+ - Corrected parsing where empty arrays were saved to a Hash as an empty String.
50
+ - Special characters can now, correctly, be field names
51
+
52
+
53
+ ## 0.3.6 - 2022-07-12
54
+ ### Changed
55
+ - *Breaking Change* Removed `.fetchMany` and replaced it with a variadic version of `.fetch`.
56
+ - Assorted internal cleanup.
57
+ - Changed test suite to use vitest.
58
+
59
+ ## 0.3.5 - 2022-06-21
60
+ ### Added
61
+ - Added additional field attributes to control RediSearch indexing behavior.
62
+ - Added search methods to retreive just key name or just *entityIds* instead of the entire entity. Methods include: `.returnAllKeys`, `.returnAllIds`, `.returnFirstKey`, `.returnFirstId`, `.returnPageOfKeys`, `.returnPageOfIds`, `.returnMinKey`, `.returnMinId`, `.returnMaxKey`, `.returnMaxId`
63
+ - Added `.fetchMany` to *Repository* which variadicly takes multiple *entityIds* and returns an array of fetch entities.
64
+
65
+ ### Changed
66
+ - Search methods that return a single item (like `.first`, `.min`, etc.) and can return *null* are now marked as returning *null* for TypeScript users.
67
+ - Repository `.remove` method is now variadic and takes one or more *entityIds* to remove.
68
+
69
+ ## 0.3.4 - 2022-06-07
70
+ ### Changed
71
+ - Added validation for 'point' fields. Throws error when provided invalid longitude or latitude.
72
+
73
+ ### Fixed
74
+ - Fixed missing dependency for tslib.
75
+
76
+
77
+ ## 0.3.3 - 2022-05-05
78
+ ### Changed
79
+ - Reverted breaking change that changed field `type` from 'string[]' to 'array'. The correct field type is 'string[]'.
80
+
81
+
82
+ ## 0.3.2 - 2022-05-03
83
+ ### Changed
84
+ - *Breaking Change*: Date values are stored in EPOCH seconds to align with [date/time APPLY functions](https://redis.io/docs/stack/search/reference/aggregations/#list-of-datetime-apply-functions).
85
+
86
+ ## 0.3.1 - 2022-05-02
87
+ ### Fixed
88
+ - Fixed error when reading `point` containing negative value from HASH.
89
+
90
+
91
+ ## 0.3.0 - 2022-04-28
92
+ ### Changed
93
+ - Internal changes in preparation for adding embeddable objects.
94
+ - Performance improvements.
95
+ - Renamed and reorganized some types that might affect TypeScript users.
96
+ - Removed support for Node 12.
97
+ - Changed examples in README to assume top-level awaits are available.
98
+
99
+ ### Fixed
100
+ - Fixed error in sample code when calling `.use`.
101
+
102
+
103
+ ## 0.2.1 - 2022-03-30
104
+ ### Added
105
+ - Added limited ability to sort search results using `.sortBy`.
106
+ - Added `.min` and `.max` which returns the *Entity* with the minimum or maximum value for a provided field.
107
+
108
+ ## 0.2.0 - 2022-02-25
109
+ ### Added
110
+ - Added 'point' data type that represents a spot on the globe.
111
+ - Added 'date' data type with UNIX, ISO-8601, and JavaScript flavors.
112
+ - Perform radius searches on 'point' data type using `.inRadius`.
113
+ - Perform searches on 'date' data type using `.before`, `.after`, etc.
114
+ - Issue raw RediSearch commands using `Repository.searchRaw`.
115
+ - Attach existing Node Redis connections using `.use` on *Client*. Handy if you need to do raw Redis stuff too!
116
+ - Added `.keyName` property on *Entity* that lets you to get the Redis keyname storing that *Entity*.
117
+ - Added `.expire` method to *Repository* allowing you to expire an *Entity*.
118
+
119
+ ### Changed
120
+ - String fields and searches can now be set to numbers or booleans and will be coerced to a string.
121
+ - Calls to `.createIndex` will automatically reindex if the index has changed and will do nothing if the index has not changed.
122
+ - *Breaking Change*: Changed 'array' type in Schema definitions to 'string[]' in preparation for adding other types of arrays.
123
+ - *Breaking Change*: Split 'string' type into 'string' and 'text' types, representing string values that support `.eq` searches and text values that support `.match` searches.
124
+ - *Breaking Change*: Removed the `textSearch` property from strings as it was no longer needed with 'string' and 'text' types replacing it.
125
+ - *Breaking Change*: *Schema* data structure now defaults to JSON instead of HASH.
126
+
127
+ ### Fixed
128
+ - Wildcard searches on text fields no longer fail.
129
+ - Tag searches now escape slash and backslash characters.
130
+
131
+ ### Removed
132
+ - *Breaking Change*: `Repository` constructor cannot be directly called. Use `client.fetchRepository` instead.
133
+
134
+
135
+ ## 0.1.7 - 2022-01-07
136
+ ### Added
137
+ - Added `.isOpen` to *Client*
138
+
139
+ ### Changed
140
+ - *Client* no longer errors when opened or closed if already opened or closed.
141
+ - Update table of contents in README.
142
+
143
+
144
+ ## 0.1.6 - 2022-01-05
145
+ ### Added
146
+ - Added `.return.first` and `.returnFirst` methods to search. Sometimes you really can eat just one.
147
+
148
+ ### Fixed
149
+ - *Entity* now has a better default JSON serialization output.
150
+
151
+
152
+ ## 0.1.5 - 2021-12-23
153
+ ### Added
154
+ - Added ability to pass in initial values when creating an *Entity* with `.createEntity`.
155
+ - Added `.createAndSave` method to Repository that does exactly what you think it does.
156
+
157
+ ### Changed
158
+ - More fluent interface on `.return.all`, `return.page`, and `return.count` on *Search*.
159
+ - Replace `.return` with `.returnPage` in *Search* class.
160
+
161
+
162
+ ## 0.1.4 - 2021-12-17
163
+ ### Added
164
+ - This CHANGELOG file because communicating changes matters.
165
+ - Ability to specify and override default stop word behavior when defining a *Schema*.
166
+
167
+ ### Fixed
168
+ - Doing an exact match with a stop word used to generate a cryptic error. RediSearch does not permit searching for stop words within an exact match. This error was captured, and a better error is presented that directs the user to either change their stop words or not use stop words in their query.
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2022 Redis Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person
4
+ obtaining a copy of this software and associated documentation
5
+ files (the "Software"), to deal in the Software without
6
+ restriction, including without limitation the rights to use,
7
+ copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the
9
+ Software is furnished to do so, subject to the following
10
+ conditions:
11
+
12
+ The above copyright notice and this permission notice shall be
13
+ included in all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
17
+ OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
18
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
19
+ HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
20
+ WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22
+ OTHER DEALINGS IN THE SOFTWARE.