Skip to content

Commit fa29d20

Browse files
authoredFeb 14, 2022
feat: 0.9.0 (#196)
## Refactor * refactor(internal): renamed memorised ids name in factory * This will reduce the likelihood of clashing with user's code ## Performance * perf(internal): removed repeated calls in factory builder `getKey` method ## Fix * fix(internal): prevent losing error name when mangling code * fix(factory): ensured states are only called once * fix(model)!: `exists` now accepts any string id as valid * So long the string has length * fix(factory)!: factory now respects the model's key type * fix(attributes)!: recursively transform keys on mass-assignment * On outgoing object keys were recursively set back to `serverAttributeCasing`. * Now the incoming object keys behave the same way and are set to `attributeCasing`. * Bringing it the behaviour in line with expectations. * fix(attributes): added SimpleAttributes type * This type is same as Attributes except it does not include Models and ModelCollections Resolves #183 * fix(timestamps): added missing deletedAt value in FormData * fix(attributes)!: updated attributeCasing modifier type to protected * just like `serverAttributeCasing` this isn't expected to be used outside of the class. * fix(model-collection): fixed `toJSON` return type * Type information got lost when using return type of model type argument's `toJSON` ## Feature * feat(factory): added factory type argument to factory builder * feat(model): added keyType getter * This change allows for custom string ids that are not uuids and the factory to set keys as string * feat(model): improved `getKey` typing * It now returns the correct type based on the type argument or `keyType` return value * feat(model-collection): improved `modelKeys` return value * Changes missed from 6c54090 * feat(api-calls): improved `call` method signature with overrides * feat(attributes): added `RawAttributes` type * This utility type helps describe the raw json version of the model. * feat(factory): improved raw method typings * feat(factory): added `attributes` method * feat(collection): added missing array methods * feat(factory): added missing type export * Missed in 5c191a2 * feat: added `PartialSome` utility type ## Documentation * docs(factory): give more helpful error messages in case of mangling * docs(factory): added tip for factory files and improved interface doc * docs(model): updated examples to use `create` * Missed updating when moved to the `create` method * docs(model): updated documentation around mass assignment * docs: simplified custom collection extending recipe * docs(api-calls): fixed wording * docs(attributes): formatted inline comment * docs(timestamps): added comment ## Testing * test(factory): added test for states application order * test: improved test helpers * test(model-collection): fixed typing error in test * test(factory): reset state after testing * test(attributes): corrected test block name ## Chore * chore: incremented version * chore: updated test tsconfig * chore: removed unused type import * chore(deps-dev): updated dependencies * @commitlint/config-conventional * @commitlint/prompt-cli * @commitlint/types * @typescript-eslint/eslint-plugin * @typescript-eslint/parser * commitlint * eslint * lint-staged * rollup ## Continuous Integration * ci: ensure `.nojekyll` exists ## Refactor * refactor(api-calls): `customHeaders` type DRY-ed by adding a type ## Style * style: fixed code style issues
1 parent 8828051 commit fa29d20

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1413
-893
lines changed
 

‎.github/workflows/deploy-api-docs.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ jobs:
2424
git add -f assets
2525
git add -f classes
2626
git add -f interfaces
27-
git add -f '.nojekyll'
27+
touch .nojekyll
28+
git add -f .nojekyll
2829
git add -f index.html
2930
git add -f modules.html
3031
git commit -m "Updates from ${{ github.ref }}" --no-verify

‎docs/calliope/api-calls.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ The `loading` property indicates whether there is an ongoing request on the mode
1414

1515
#### serverAttributeCasing
1616

17-
The `serverAttributeCasing` is a getter which similarly to [attributeCasing](./attributes.md#attributecasing) casts the request keys to the given casing on outgoing requests. The valid values are `'snake'` or `'camel'` with `'snake'` being the default value.
17+
The `serverAttributeCasing` is a getter which similarly to [attributeCasing](./attributes.md#attributecasing) casts the request keys recursively to the given casing on outgoing requests. The valid values are `'snake'` or `'camel'` with `'snake'` being the default value.
1818

1919
#### _lastSyncedAt
2020

21-
The `_lastSyncedAt` or `_last_synced_at` (naming subject to [attributeCasing](./attributes.md#attributecasing)) attribute is a getter attribute that is set only when the model data has been fetched, [saved](./readme.md#save) or [refreshed](./readme.md#refresh). It is type subject to the [datetime](./attributes.md#datetime) setting, with the value of when was the last time the data has been loaded from the backend.
21+
The `_lastSyncedAt` or `_last_synced_at` (naming subject to [attributeCasing](./attributes.md#attributecasing)) attribute is a getter attribute that is set only when the model data has been fetched, [saved](./readme.md#save) or [refreshed](./readme.md#refresh). Its type subject to the [datetime](./attributes.md#datetime) setting, with the value of when was the last time the data has been loaded from the backend.
2222

2323
## Methods
2424

0 commit comments

Comments
 (0)
Please sign in to comment.