- Suppress rate limiting errors thrown by the getCachedOrFetch() method when many calls are made within 1 second to the cache. The cache should not preclude the fetched item from returning. This can happen, for example, when trying to get a user from the DB and cache it for subsequent calls. If too many calls come in at once, the first may not have time to cache its result before the next call comes in. Cloudflare KV will throw a 429 as it sees multiple writes to the same key within 1s. (5e4b1aa7)
- Support bulk deletes in BaseCache using the KV API in favor of bindings (326fccae)
- Fixed bug where privacy masking would throw an error if the field targeted was undefined (c9d71505)
- New base middleware class provides utilities to traverse a model's ancestors looking for a particular condition to be met. (4acbdfd1)
- "Private" and "System" flags in the prop decorator now support functions. (427f00bb)
- //github.com/cloudflare-extension/unconventional (2665970a)
- "Private" and "System" flags in the prop decorator now support functions. (427f00bb)
- //github.com/cloudflare-extension/unconventional (2665970a)
- "Private" and "System" flags in the prop decorator now support functions. (427f00bb)
- //github.com/cloudflare-extension/unconventional (2665970a)
- Add maskPrivate method to Base Model, which can be used by the BaseController's maskPrivateFields method (5099e232)
- Fix timestamp pollution of parent models. (e443297)
- Make createdAt and updatedAt field names customizable (e.g. created_at and updated_at). (d05b6bf)
- Add Truncate and Increment/Decrement methods to BaseModel. (de7020e)
- Allow BaseModel.id to be either a number or a UUID. (980a8200)
- BaseService.getAll() will now return all records if limit < 0 (6f048439)
- BaseModel can now support circular dependencies in its relations, e.g. if
User HasOne Animal
andAnimal BelongsToOne User
. (7a0ed60)
Example:
Set the model field to () => User
instead of User
.
@prop<typeof User>({ relation: { type: RelationType.BelongsTo, model: () => User, from: "user_id", to: "id" } })
public owner?: User;
- The type of
BaseModel.id
changed fromnumber
tostring | number
to allow for GUIDs as primary keys. (23a70a6 )