@choosemycompany/lib 0.10.0 → 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/README.md CHANGED
@@ -80,7 +80,6 @@ If the version check fails before the publish, nothing is published: delete the
80
80
 
81
81
  A hotfix follows the same steps from `origin/main` instead of `origin/develop`: `hotfix_X_Y_Z` carries the fix, the patch bump and its `CHANGELOG.md` section, then the pull request to `main`, the tag, and the realignment of `develop`.
82
82
 
83
- ## Notable API changes
83
+ ## Documentation
84
84
 
85
- - `useStore`: unified signature absorbing the `workspace` variant (search, filters, a fourth `FilterItem` generic). Public method: `isPending(key)`. `getViewKey` sorts keys to guarantee a deterministic cache.
86
- - `usePrimaryTypeTranslation(primaryTypes)`: now receives the list of primary types as an argument instead of importing it from commercial's `@/entities/form`.
85
+ The composables are documented in [`docs/`](docs/README.md) — [`useStore`](docs/useStore.md) and its [reference](docs/reference-usestore.md), [`useHttp`](docs/useHttp.md), [`useAuthSession`](docs/useAuthSession.md). What each version changes is in [`CHANGELOG.md`](CHANGELOG.md); moving an app from `0.x` to `1.0` follows [`docs/migration-1.0.md`](docs/migration-1.0.md).
@@ -122,4 +122,9 @@ export type MandeErrorBody = {
122
122
  */
123
123
  export type MandeError = Error & {
124
124
  body?: MandeErrorBody;
125
+ /**
126
+ * The `Response` that carried the failure, which `mande` attaches to every
127
+ * HTTP error. Absent on a network failure (`TypeError`) or an abort.
128
+ */
129
+ response?: Response;
125
130
  };
package/dist/index.d.ts CHANGED
@@ -9,7 +9,10 @@
9
9
  * {@link useHttp}: thin `mande` wrapper bound to one of them;
10
10
  * {@link buildUrl}: resolves the `{name}` placeholders of a URI template.
11
11
  * - **Store** — {@link useStore}, {@link getViewKey}: typed cache for `retrieve` /
12
- * `list` workflows with single-flight, per-key errors, and CRUD mutations.
12
+ * `list` workflows, with pending state and errors addressed by a typed scope
13
+ * and queried by partial filter, single-flight reads, and CRUD mutations;
14
+ * {@link StoreResetError} and {@link MissingItemIdError}, the errors a caller
15
+ * tells apart with `instanceof`.
13
16
  * - **i18n** — locale-aware translators for plain strings, country names,
14
17
  * region resolution, and rich tagged messages.
15
18
  * - **UI** — small DOM / window-aware helpers: outside-click detection, responsive
@@ -24,7 +27,9 @@ export { useHttp } from './http/useHttp';
24
27
  export { configureHttp, type HttpConfig } from './http/config';
25
28
  export { buildUrl } from './http/buildUrl';
26
29
  export { useAuthSession } from './auth/useAuthSession';
27
- export { useStore, getViewKey, CREATE_PENDING_KEY, type Store } from './store/useStore';
30
+ export { useStore, getViewKey, type Store, type StoreState } from './store/useStore';
31
+ export { StoreResetError } from './store/StoreResetError';
32
+ export { MissingItemIdError } from './store/MissingItemIdError';
28
33
  export { useClickOutside } from './ui/useClickOutside';
29
34
  export { useCountriesTranslation, type CountryCodes } from './i18n/useCountriesTranslation';
30
35
  export { showAndThrowError } from './errors/useErrorHandling';
@@ -35,7 +40,7 @@ export { useLocaleHelpers } from './i18n/useLocaleHelpers';
35
40
  export { useParseTranslation } from './i18n/useParseTranslation';
36
41
  export { useResponsiveSize } from './ui/useResponsiveSize';
37
42
  export { useTranslate } from './i18n/useTranslate';
38
- export type { StoreOptions, RetrieveOptions, ListOptions, ViewKeyParams, View, ViewOptions, } from './store/types';
43
+ export type { StoreOptions, RetrieveOptions, ListOptions, RemoveItemOptions, ViewKeyParams, View, IdKey, PendingKind, PendingScope, PendingFilter, MutatingFilter, QueryingFilter, MutateOptions, MutateScope, MutationName, CreateOptions, PendingMode, WithPendingOptions, StoreError, DataScope, } from './store/types';
39
44
  export type { PaginatedQuery, Pagination, ListResponse, RetrieveResponse, HttpResponse, RequestOptions, ErrorItem, MandeError, MandeErrorBody, } from './http/types';
40
45
  export type { SessionExpiryReason } from './auth/types';
41
46
  export type { Language, Translation, InternationalizedRoute, } from './i18n/types';