@prometheus-ags/entity-graph-core 3.2.0 → 4.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.
@@ -1,990 +0,0 @@
1
- import * as zustand_vanilla from 'zustand/vanilla';
2
-
3
- /**
4
- * Typed errors used throughout 2.0 to drive retry policy and consumer
5
- * UI decisions.
6
- *
7
- * Why two classes (not a discriminator field):
8
- * - `instanceof` checks are zero-cost at runtime and survive bundler
9
- * minification of property names.
10
- * - Consumers can write `if (error instanceof TerminalError) renderInline()`
11
- * without importing a type-narrowing helper.
12
- * - The engine's retry policy is one `instanceof TransientError` check.
13
- *
14
- * 4xx → `TerminalError` (no retry — the request is structurally wrong:
15
- * unauthorized, not-found, schema mismatch, validation failure).
16
- *
17
- * 5xx + network failures → `TransientError` (engine retries with
18
- * exponential backoff up to `maxRetries`).
19
- *
20
- * Custom transports can throw either class. The default REST helper
21
- * (`makeRestTransport`) maps HTTP status codes to the appropriate
22
- * class automatically.
23
- *
24
- * Both classes preserve the original error via the standard
25
- * `cause` option so stack traces survive the boundary.
26
- */
27
- interface EntityErrorOptions {
28
- /** HTTP status if the underlying transport was HTTP. */
29
- status?: number;
30
- /** Original thrown value (`Error`, `Response`, anything). */
31
- cause?: unknown;
32
- }
33
- /**
34
- * Permanent failure — do not retry. The request will not succeed by
35
- * trying again with the same inputs.
36
- *
37
- * Typical sources: HTTP 4xx, missing tables, validation errors,
38
- * permission denied, schema mismatches.
39
- */
40
- declare class TerminalError extends Error {
41
- readonly kind: "terminal";
42
- readonly status?: number;
43
- constructor(message: string, opts?: EntityErrorOptions);
44
- }
45
- /**
46
- * Temporary failure — safe to retry. The engine will retry with
47
- * exponential backoff up to the configured `maxRetries`.
48
- *
49
- * Typical sources: HTTP 5xx, network timeouts, fetch rejections,
50
- * dropped sockets.
51
- */
52
- declare class TransientError extends Error {
53
- readonly kind: "transient";
54
- readonly status?: number;
55
- constructor(message: string, opts?: EntityErrorOptions);
56
- }
57
- /**
58
- * Union of every typed error the library raises. Use on consumer-side
59
- * `error` props when both classes are possible.
60
- */
61
- type EntityError = TerminalError | TransientError;
62
- /**
63
- * Convert an unknown thrown value into a typed entity error.
64
- *
65
- * - Already-typed errors pass through.
66
- * - HTTP-status-bearing errors become Terminal (4xx) or Transient (5xx).
67
- * - `AbortError` / `DOMException` "AbortError" → Terminal (caller
68
- * cancelled; not worth retrying).
69
- * - Everything else → Transient (assume retryable; better than
70
- * accidentally permanently failing on a one-off network blip).
71
- */
72
- declare function toEntityError(err: unknown): EntityError;
73
-
74
- /**
75
- * Transport-agnostic comparison operators. Same spec can compile to REST, SQL, GraphQL, or local JS (`evaluator`).
76
- * `custom` opts out of automatic serialization — use for predicates only the client can evaluate.
77
- */
78
- type FilterOperator = "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "in" | "nin" | "contains" | "startsWith" | "endsWith" | "isNull" | "isNotNull" | "between" | "arrayContains" | "arrayOverlaps" | "matches" | "custom";
79
- /** Atomic filter: field path, operator, optional value, and optional JS predicate for `custom`. */
80
- interface FilterClause {
81
- field: string;
82
- op: FilterOperator;
83
- value?: unknown;
84
- predicate?: (fieldValue: unknown, entity: Record<string, unknown>) => boolean;
85
- }
86
- type FilterLogic = "and" | "or";
87
- /** Nested boolean group so you can express `(A AND B) OR C` without losing structure when compiling to backends. */
88
- interface FilterGroup {
89
- logic: FilterLogic;
90
- clauses: Array<FilterClause | FilterGroup>;
91
- }
92
- /** Top-level filter: flat AND list of clauses, or a recursive `FilterGroup`. */
93
- type FilterSpec = FilterGroup | FilterClause[];
94
- type SortDirection = "asc" | "desc";
95
- /** Single sort key with optional null ordering and custom comparator for local sort parity with remote semantics. */
96
- interface SortClause {
97
- field: string;
98
- direction: SortDirection;
99
- nulls?: "first" | "last";
100
- comparator?: (a: unknown, b: unknown) => number;
101
- }
102
- /** Ordered multi-key sort (stable application in `compareEntities`). */
103
- type SortSpec = SortClause[];
104
- /**
105
- * Everything `useEntityView` needs to describe a virtualized collection: filters, sorts, and simple multi-field search.
106
- * One descriptor can drive local evaluation, remote query compilation, or hybrid mode.
107
- */
108
- interface ViewDescriptor {
109
- filter?: FilterSpec;
110
- sort?: SortSpec;
111
- search?: {
112
- query: string;
113
- fields: string[];
114
- minChars?: number;
115
- };
116
- }
117
- /**
118
- * How complete local graph data is relative to the view: **local** (all in memory), **remote** (server must filter/sort), **hybrid** (show local fast + remote reconcile).
119
- */
120
- type CompletenessMode = "local" | "remote" | "hybrid";
121
- /**
122
- * Compile a view to flat REST query params (`sort`, `q`, and `field[op]=value` keys). Skips `custom` clauses — those cannot be expressed as strings.
123
- */
124
- declare function toRestParams(view: ViewDescriptor): Record<string, string>;
125
- /**
126
- * Compile a view to parameterized SQL fragments for server-side filtering/sorting. Unknown ops become `TRUE` — validate or restrict ops at the edge.
127
- */
128
- declare function toSQLClauses(view: ViewDescriptor): {
129
- where: string;
130
- orderBy: string;
131
- params: unknown[];
132
- };
133
- /**
134
- * Produce a GraphQL-variable-shaped object from a view (Hasura/Postgraphile-style `_op` maps). Intended as a starting point — wire to your actual schema.
135
- */
136
- declare function toGraphQLVariables(view: ViewDescriptor): {
137
- where?: Record<string, unknown>;
138
- orderBy?: Array<Record<string, unknown>>;
139
- search?: string;
140
- };
141
-
142
- /**
143
- * Normalize nested `FilterGroup` trees to a flat clause list for compilers that only understand atomic predicates.
144
- */
145
- declare function flattenClauses(filter: FilterSpec): FilterClause[];
146
- /** True if any clause requires client-side `predicate` logic — forces local/hybrid evaluation paths that cannot be pushed to generic REST/SQL. */
147
- declare function hasCustomPredicates(filter: FilterSpec): boolean;
148
-
149
- /** Logical entity kind (e.g. `"Post"`). Used to partition the normalized graph. */
150
- type EntityType = string;
151
- /** Primary key for an entity within its `type`. Lists and relations reference this, not row copies. */
152
- type EntityId = string;
153
- /** Stable string key for a list query (often `JSON.stringify`-shaped). Lists store IDs only under this key. */
154
- type QueryKey = string;
155
- /** Provenance of the latest known entity state. */
156
- type SyncOrigin = "server" | "client" | "optimistic";
157
- /** Optional sync-facing metadata kept outside canonical entity payloads. */
158
- interface EntitySyncMetadata {
159
- synced: boolean;
160
- origin: SyncOrigin;
161
- updatedAt: number | null;
162
- }
163
- /** Snapshot shape returned by sync-aware reads and graph-native query helpers. */
164
- type EntitySnapshot<T extends object> = T & {
165
- $synced: boolean;
166
- $origin: SyncOrigin;
167
- $updatedAt: number | null;
168
- };
169
- /**
170
- * Fetch/cache metadata for a single entity instance (`type:id`).
171
- * Separates transport concerns from canonical `entities` data so hooks can show spinners and stale-while-revalidate without mutating server-shaped fields.
172
- */
173
- interface EntityState {
174
- isFetching: boolean;
175
- lastFetched: number | null;
176
- error: string | null;
177
- stale: boolean;
178
- }
179
- /**
180
- * Ordered **IDs** for a list query plus pagination metadata — never embedded entity payloads.
181
- * Cross-view reactivity depends on this: when `entities[type][id]` updates, every list containing that id re-resolves rows from the graph.
182
- */
183
- interface ListState {
184
- ids: EntityId[];
185
- total: number | null;
186
- nextCursor: string | null;
187
- prevCursor: string | null;
188
- hasNextPage: boolean;
189
- hasPrevPage: boolean;
190
- isFetching: boolean;
191
- isFetchingMore: boolean;
192
- error: string | null;
193
- /**
194
- * Typed error instance for 2.0 hooks (`useEntities`, `useEntityQuery`).
195
- * Carries `TerminalError` / `TransientError` so consumers can
196
- * `instanceof`-check the failure mode without parsing the string in
197
- * `error`. Both fields are written together by `setListError`; the
198
- * string `error` field remains for back-compat with 1.x consumers.
199
- */
200
- lastError: EntityError | null;
201
- lastFetched: number | null;
202
- stale: boolean;
203
- currentPage: number | null;
204
- pageSize: number | null;
205
- }
206
- /** Pagination and lifecycle metadata accepted by successful list writes. */
207
- type ListResultMeta = Partial<Omit<ListState, "ids" | "isFetching" | "isFetchingMore" | "error" | "stale">>;
208
- /** One list projection updated as part of an atomic fetched-list ingestion. */
209
- interface FetchedListTarget {
210
- key: QueryKey;
211
- mode?: "replace" | "append";
212
- meta?: ListResultMeta;
213
- /** Override list membership when the transport derives ids separately. */
214
- ids?: EntityId[];
215
- }
216
- /** Additional normalized entity rows committed with the primary fetched list. */
217
- interface FetchedEntityBatch {
218
- type: EntityType;
219
- entries: Array<{
220
- id: EntityId;
221
- data: Record<string, unknown>;
222
- }>;
223
- }
224
- /** Incrementally project fetched rows into an existing view-backed list. */
225
- interface FetchedListProjection {
226
- key: QueryKey;
227
- view: ViewDescriptor;
228
- /** Complete the projection's fetch lifecycle without replacing its ids. */
229
- completeFetch?: boolean;
230
- }
231
- /** Additional graph projections completed by one fetched-list response. */
232
- interface IngestFetchedListOptions {
233
- lists?: FetchedListTarget[];
234
- /** Side-descriptor rows that must commit or fail with the primary batch. */
235
- sideBatches?: FetchedEntityBatch[];
236
- /** View-backed lists that receive matching fetched ids in the same publication. */
237
- projections?: FetchedListProjection[];
238
- /** List fetch flags to clear without replacing their existing ids or metadata. */
239
- finishListFetches?: QueryKey[];
240
- }
241
- /**
242
- * Stable fallbacks for missing `lists[key]` / `entityStates[key]` slots.
243
- * Inline `?? { ... }` defaults allocate new objects every `getSnapshot` call and trigger React 19
244
- * “getSnapshot should be cached” / maximum update depth errors with `useSyncExternalStore`.
245
- */
246
- declare const EMPTY_IDS: EntityId[];
247
- declare const EMPTY_ENTITY_STATE: EntityState;
248
- declare const EMPTY_SYNC_METADATA: EntitySyncMetadata;
249
- declare const EMPTY_LIST_STATE: ListState;
250
- /**
251
- * Canonical Zustand store: **entities** (server truth), **patches** (UI-only overlay), **lists** (id order + list meta), and **entityStates** (per-entity fetch state).
252
- * Framework bindings subscribe to the vanilla store; stores, adapters, and
253
- * engines can read it synchronously through `graphStore.getState()`.
254
- */
255
- interface GraphState {
256
- /** Normalized server-confirmed records. Mutate only via upsert/replace/remove — not from components. */
257
- entities: Record<EntityType, Record<EntityId, Record<string, unknown>>>;
258
- /** Local-only fields merged at read time (`readEntity` / hooks). Never send patches to the server. */
259
- patches: Record<EntityType, Record<EntityId, Record<string, unknown>>>;
260
- /** Per-entity fetch lifecycle keyed as `${type}:${id}`. */
261
- entityStates: Record<string, EntityState>;
262
- /** Optional sync/provenance state layered beside the canonical entity payload. */
263
- syncMetadata: Record<string, EntitySyncMetadata>;
264
- /** List slots keyed by serialized query keys. Values hold id arrays and pagination — not entity clones. */
265
- lists: Record<QueryKey, ListState>;
266
- /**
267
- * Shallow-merge `data` into the canonical entity. Use when the API returns partial updates or normalized fragments.
268
- * @param type - Entity kind
269
- * @param id - Entity id
270
- * @param data - Fields to merge into existing canonical data
271
- */
272
- upsertEntity: (type: EntityType, id: EntityId, data: Record<string, unknown>) => void;
273
- /**
274
- * Batch upsert for list endpoints — avoids N separate writes when hydrating many rows at once.
275
- * @param type - Entity kind
276
- * @param entries - Pairs of id + partial/full payloads to merge
277
- */
278
- upsertEntities: (type: EntityType, entries: Array<{
279
- id: EntityId;
280
- data: Record<string, unknown>;
281
- }>) => void;
282
- /**
283
- * Merge one fetched page, mark every row fetched, and update its list
284
- * projections in one Zustand publication.
285
- */
286
- ingestFetchedList: (type: EntityType, entries: Array<{
287
- id: EntityId;
288
- data: Record<string, unknown>;
289
- }>, options?: IngestFetchedListOptions) => void;
290
- /**
291
- * Replace the canonical entity entirely (no merge). Use when the server returns a full snapshot and partial merge would leave stale keys behind.
292
- */
293
- replaceEntity: (type: EntityType, id: EntityId, data: Record<string, unknown>) => void;
294
- /** Remove canonical entity, its patches, and its entityState. Does not remove the id from lists — use `removeIdFromAllLists` if needed. */
295
- removeEntity: (type: EntityType, id: EntityId) => void;
296
- /**
297
- * Merge UI-only fields into `patches` so every subscriber sees selection, expansion, optimistic toggles, etc., without forking canonical data.
298
- */
299
- patchEntity: (type: EntityType, id: EntityId, patch: Record<string, unknown>) => void;
300
- /** Remove specific patch keys; other patch keys remain. */
301
- unpatchEntity: (type: EntityType, id: EntityId, keys: string[]) => void;
302
- /** Drop all patches for an entity (e.g. after successful mutation when server data is authoritative). */
303
- clearPatch: (type: EntityType, id: EntityId) => void;
304
- /** Reflect in-flight GET for a single entity (deduped fetches in the engine still flip this once per logical request). */
305
- setEntityFetching: (type: EntityType, id: EntityId, fetching: boolean) => void;
306
- /** Persist terminal fetch failure message and clear fetching — hooks surface `error` while leaving prior data if any. */
307
- setEntityError: (type: EntityType, id: EntityId, error: string | null) => void;
308
- /** Mark entity successfully loaded; clears error, fetching, stale, and updates `lastFetched`. */
309
- setEntityFetched: (type: EntityType, id: EntityId) => void;
310
- /** Drive background revalidation: when true, hooks refetch while still showing cached `readEntity` data. */
311
- setEntityStale: (type: EntityType, id: EntityId, stale: boolean) => void;
312
- /** Merge sync metadata for one entity without polluting canonical server fields. */
313
- setEntitySyncMetadata: (type: EntityType, id: EntityId, metadata: Partial<EntitySyncMetadata>) => void;
314
- /** Clear sync metadata for one entity. */
315
- clearEntitySyncMetadata: (type: EntityType, id: EntityId) => void;
316
- /**
317
- * Replace list ids and merge pagination meta after a primary list fetch (not load-more).
318
- * Resets fetching flags and clears list error on success path (engine calls this after normalize).
319
- */
320
- setListResult: (key: QueryKey, ids: EntityId[], meta: Partial<Omit<ListState, "ids" | "isFetching" | "isFetchingMore" | "error" | "stale">>) => void;
321
- /** Append unique ids (e.g. infinite scroll) while merging meta; dedupes id order. */
322
- appendListResult: (key: QueryKey, ids: EntityId[], meta: Partial<Omit<ListState, "ids" | "isFetching" | "isFetchingMore" | "error" | "stale">>) => void;
323
- /** Prepend ids (e.g. “new item at top”) with optional meta merge. */
324
- prependListResult: (key: QueryKey, ids: EntityId[], meta?: Partial<ListState>) => void;
325
- /** After deletes, keep every list consistent by removing an id everywhere it appears and decrementing `total` when tracked. */
326
- removeIdFromAllLists: (type: EntityType, id: EntityId) => void;
327
- /**
328
- * Insert or move an id in one list. If the id already exists, it is removed first then re-inserted at `position`.
329
- * @param position - `"start"`, `"end"`, or numeric index
330
- */
331
- insertIdInList: (key: QueryKey, id: EntityId, position: "start" | "end" | number) => void;
332
- /** Initial or full list fetch in progress (not page-2+). */
333
- setListFetching: (key: QueryKey, fetching: boolean) => void;
334
- /** Pagination / “load more” in progress for the same list key. */
335
- setListFetchingMore: (key: QueryKey, fetchingMore: boolean) => void;
336
- /**
337
- * Record list fetch failure; clears both fetching flags.
338
- * The optional `typed` argument is the typed `EntityError` instance
339
- * (used by 2.0 hooks); when omitted only the string `error` field is
340
- * populated (back-compat with 1.x callers).
341
- */
342
- setListError: (key: QueryKey, error: string | null, typed?: EntityError | null) => void;
343
- /** Mark a list query stale so hooks can refetch without discarding current ids (stale-while-revalidate). */
344
- setListStale: (key: QueryKey, stale: boolean) => void;
345
- /**
346
- * Mark one or all entities of a type stale for subscriber-driven refetch. Does not delete data.
347
- * @param id - Omit to stale every entity of `type`
348
- */
349
- invalidateEntity: (type: EntityType, id?: EntityId) => void;
350
- /**
351
- * Mark lists stale by key prefix or custom predicate so the next access triggers background refresh without dropping ids immediately.
352
- */
353
- invalidateLists: (matcher: string | ((key: QueryKey) => boolean)) => void;
354
- /** Convenience: stale all entities of a type and lists whose keys start with `type`. */
355
- invalidateType: (type: EntityType) => void;
356
- /**
357
- * Single read path: `{ ...entities[type][id], ...patches[type][id] }` or null if no canonical row exists.
358
- * @returns Merged view suitable for rendering; not a deep clone
359
- */
360
- readEntity: <T = Record<string, unknown>>(type: EntityType, id: EntityId) => T | null;
361
- /**
362
- * Sync-aware read path: canonical entity + patches + virtual sync metadata (`$synced`, `$origin`, `$updatedAt`).
363
- */
364
- readEntitySnapshot: <T = Record<string, unknown>>(type: EntityType, id: EntityId) => EntitySnapshot<T & Record<string, unknown>> | null;
365
- }
366
- /** Creates an isolated, framework-neutral entity graph store. */
367
- declare function createGraphStore(): Omit<Omit<zustand_vanilla.StoreApi<GraphState>, "subscribe"> & {
368
- subscribe: {
369
- (listener: (selectedState: GraphState, previousSelectedState: GraphState) => void): () => void;
370
- <U>(selector: (state: GraphState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
371
- equalityFn?: ((a: U, b: U) => boolean) | undefined;
372
- fireImmediately?: boolean;
373
- } | undefined): () => void;
374
- };
375
- }, "setState"> & {
376
- setState(nextStateOrUpdater: GraphState | Partial<GraphState> | ((state: {
377
- entities: {
378
- [x: string]: {
379
- [x: string]: {
380
- [x: string]: unknown;
381
- };
382
- };
383
- };
384
- patches: {
385
- [x: string]: {
386
- [x: string]: {
387
- [x: string]: unknown;
388
- };
389
- };
390
- };
391
- entityStates: {
392
- [x: string]: {
393
- isFetching: boolean;
394
- lastFetched: number | null;
395
- error: string | null;
396
- stale: boolean;
397
- };
398
- };
399
- syncMetadata: {
400
- [x: string]: {
401
- synced: boolean;
402
- origin: SyncOrigin;
403
- updatedAt: number | null;
404
- };
405
- };
406
- lists: {
407
- [x: string]: {
408
- ids: string[];
409
- total: number | null;
410
- nextCursor: string | null;
411
- prevCursor: string | null;
412
- hasNextPage: boolean;
413
- hasPrevPage: boolean;
414
- isFetching: boolean;
415
- isFetchingMore: boolean;
416
- error: string | null;
417
- lastError: {
418
- kind: "terminal";
419
- status?: number | undefined;
420
- name: string;
421
- message: string;
422
- stack?: string | undefined;
423
- cause?: unknown;
424
- } | {
425
- kind: "transient";
426
- status?: number | undefined;
427
- name: string;
428
- message: string;
429
- stack?: string | undefined;
430
- cause?: unknown;
431
- } | null;
432
- lastFetched: number | null;
433
- stale: boolean;
434
- currentPage: number | null;
435
- pageSize: number | null;
436
- };
437
- };
438
- upsertEntity: (type: EntityType, id: EntityId, data: Record<string, unknown>) => void;
439
- upsertEntities: (type: EntityType, entries: Array<{
440
- id: EntityId;
441
- data: Record<string, unknown>;
442
- }>) => void;
443
- ingestFetchedList: (type: EntityType, entries: Array<{
444
- id: EntityId;
445
- data: Record<string, unknown>;
446
- }>, options?: IngestFetchedListOptions) => void;
447
- replaceEntity: (type: EntityType, id: EntityId, data: Record<string, unknown>) => void;
448
- removeEntity: (type: EntityType, id: EntityId) => void;
449
- patchEntity: (type: EntityType, id: EntityId, patch: Record<string, unknown>) => void;
450
- unpatchEntity: (type: EntityType, id: EntityId, keys: string[]) => void;
451
- clearPatch: (type: EntityType, id: EntityId) => void;
452
- setEntityFetching: (type: EntityType, id: EntityId, fetching: boolean) => void;
453
- setEntityError: (type: EntityType, id: EntityId, error: string | null) => void;
454
- setEntityFetched: (type: EntityType, id: EntityId) => void;
455
- setEntityStale: (type: EntityType, id: EntityId, stale: boolean) => void;
456
- setEntitySyncMetadata: (type: EntityType, id: EntityId, metadata: Partial<EntitySyncMetadata>) => void;
457
- clearEntitySyncMetadata: (type: EntityType, id: EntityId) => void;
458
- setListResult: (key: QueryKey, ids: EntityId[], meta: Partial<Omit<ListState, "ids" | "isFetching" | "isFetchingMore" | "error" | "stale">>) => void;
459
- appendListResult: (key: QueryKey, ids: EntityId[], meta: Partial<Omit<ListState, "ids" | "isFetching" | "isFetchingMore" | "error" | "stale">>) => void;
460
- prependListResult: (key: QueryKey, ids: EntityId[], meta?: Partial<ListState>) => void;
461
- removeIdFromAllLists: (type: EntityType, id: EntityId) => void;
462
- insertIdInList: (key: QueryKey, id: EntityId, position: "start" | "end" | number) => void;
463
- setListFetching: (key: QueryKey, fetching: boolean) => void;
464
- setListFetchingMore: (key: QueryKey, fetchingMore: boolean) => void;
465
- setListError: (key: QueryKey, error: string | null, typed?: EntityError | null) => void;
466
- setListStale: (key: QueryKey, stale: boolean) => void;
467
- invalidateEntity: (type: EntityType, id?: EntityId) => void;
468
- invalidateLists: (matcher: string | ((key: QueryKey) => boolean)) => void;
469
- invalidateType: (type: EntityType) => void;
470
- readEntity: <T = Record<string, unknown>>(type: EntityType, id: EntityId) => T | null;
471
- readEntitySnapshot: <T = Record<string, unknown>>(type: EntityType, id: EntityId) => EntitySnapshot<T & Record<string, unknown>> | null;
472
- }) => void), shouldReplace?: false): void;
473
- setState(nextStateOrUpdater: GraphState | ((state: {
474
- entities: {
475
- [x: string]: {
476
- [x: string]: {
477
- [x: string]: unknown;
478
- };
479
- };
480
- };
481
- patches: {
482
- [x: string]: {
483
- [x: string]: {
484
- [x: string]: unknown;
485
- };
486
- };
487
- };
488
- entityStates: {
489
- [x: string]: {
490
- isFetching: boolean;
491
- lastFetched: number | null;
492
- error: string | null;
493
- stale: boolean;
494
- };
495
- };
496
- syncMetadata: {
497
- [x: string]: {
498
- synced: boolean;
499
- origin: SyncOrigin;
500
- updatedAt: number | null;
501
- };
502
- };
503
- lists: {
504
- [x: string]: {
505
- ids: string[];
506
- total: number | null;
507
- nextCursor: string | null;
508
- prevCursor: string | null;
509
- hasNextPage: boolean;
510
- hasPrevPage: boolean;
511
- isFetching: boolean;
512
- isFetchingMore: boolean;
513
- error: string | null;
514
- lastError: {
515
- kind: "terminal";
516
- status?: number | undefined;
517
- name: string;
518
- message: string;
519
- stack?: string | undefined;
520
- cause?: unknown;
521
- } | {
522
- kind: "transient";
523
- status?: number | undefined;
524
- name: string;
525
- message: string;
526
- stack?: string | undefined;
527
- cause?: unknown;
528
- } | null;
529
- lastFetched: number | null;
530
- stale: boolean;
531
- currentPage: number | null;
532
- pageSize: number | null;
533
- };
534
- };
535
- upsertEntity: (type: EntityType, id: EntityId, data: Record<string, unknown>) => void;
536
- upsertEntities: (type: EntityType, entries: Array<{
537
- id: EntityId;
538
- data: Record<string, unknown>;
539
- }>) => void;
540
- ingestFetchedList: (type: EntityType, entries: Array<{
541
- id: EntityId;
542
- data: Record<string, unknown>;
543
- }>, options?: IngestFetchedListOptions) => void;
544
- replaceEntity: (type: EntityType, id: EntityId, data: Record<string, unknown>) => void;
545
- removeEntity: (type: EntityType, id: EntityId) => void;
546
- patchEntity: (type: EntityType, id: EntityId, patch: Record<string, unknown>) => void;
547
- unpatchEntity: (type: EntityType, id: EntityId, keys: string[]) => void;
548
- clearPatch: (type: EntityType, id: EntityId) => void;
549
- setEntityFetching: (type: EntityType, id: EntityId, fetching: boolean) => void;
550
- setEntityError: (type: EntityType, id: EntityId, error: string | null) => void;
551
- setEntityFetched: (type: EntityType, id: EntityId) => void;
552
- setEntityStale: (type: EntityType, id: EntityId, stale: boolean) => void;
553
- setEntitySyncMetadata: (type: EntityType, id: EntityId, metadata: Partial<EntitySyncMetadata>) => void;
554
- clearEntitySyncMetadata: (type: EntityType, id: EntityId) => void;
555
- setListResult: (key: QueryKey, ids: EntityId[], meta: Partial<Omit<ListState, "ids" | "isFetching" | "isFetchingMore" | "error" | "stale">>) => void;
556
- appendListResult: (key: QueryKey, ids: EntityId[], meta: Partial<Omit<ListState, "ids" | "isFetching" | "isFetchingMore" | "error" | "stale">>) => void;
557
- prependListResult: (key: QueryKey, ids: EntityId[], meta?: Partial<ListState>) => void;
558
- removeIdFromAllLists: (type: EntityType, id: EntityId) => void;
559
- insertIdInList: (key: QueryKey, id: EntityId, position: "start" | "end" | number) => void;
560
- setListFetching: (key: QueryKey, fetching: boolean) => void;
561
- setListFetchingMore: (key: QueryKey, fetchingMore: boolean) => void;
562
- setListError: (key: QueryKey, error: string | null, typed?: EntityError | null) => void;
563
- setListStale: (key: QueryKey, stale: boolean) => void;
564
- invalidateEntity: (type: EntityType, id?: EntityId) => void;
565
- invalidateLists: (matcher: string | ((key: QueryKey) => boolean)) => void;
566
- invalidateType: (type: EntityType) => void;
567
- readEntity: <T = Record<string, unknown>>(type: EntityType, id: EntityId) => T | null;
568
- readEntitySnapshot: <T = Record<string, unknown>>(type: EntityType, id: EntityId) => EntitySnapshot<T & Record<string, unknown>> | null;
569
- }) => void), shouldReplace: true): void;
570
- };
571
- /**
572
- * Default process-wide entity graph store. Framework bindings subscribe to
573
- * this vanilla store; non-React consumers use its `getState`, `setState`, and
574
- * `subscribe` methods directly.
575
- */
576
- declare const graphStore: Omit<Omit<zustand_vanilla.StoreApi<GraphState>, "subscribe"> & {
577
- subscribe: {
578
- (listener: (selectedState: GraphState, previousSelectedState: GraphState) => void): () => void;
579
- <U>(selector: (state: GraphState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
580
- equalityFn?: ((a: U, b: U) => boolean) | undefined;
581
- fireImmediately?: boolean;
582
- } | undefined): () => void;
583
- };
584
- }, "setState"> & {
585
- setState(nextStateOrUpdater: GraphState | Partial<GraphState> | ((state: {
586
- entities: {
587
- [x: string]: {
588
- [x: string]: {
589
- [x: string]: unknown;
590
- };
591
- };
592
- };
593
- patches: {
594
- [x: string]: {
595
- [x: string]: {
596
- [x: string]: unknown;
597
- };
598
- };
599
- };
600
- entityStates: {
601
- [x: string]: {
602
- isFetching: boolean;
603
- lastFetched: number | null;
604
- error: string | null;
605
- stale: boolean;
606
- };
607
- };
608
- syncMetadata: {
609
- [x: string]: {
610
- synced: boolean;
611
- origin: SyncOrigin;
612
- updatedAt: number | null;
613
- };
614
- };
615
- lists: {
616
- [x: string]: {
617
- ids: string[];
618
- total: number | null;
619
- nextCursor: string | null;
620
- prevCursor: string | null;
621
- hasNextPage: boolean;
622
- hasPrevPage: boolean;
623
- isFetching: boolean;
624
- isFetchingMore: boolean;
625
- error: string | null;
626
- lastError: {
627
- kind: "terminal";
628
- status?: number | undefined;
629
- name: string;
630
- message: string;
631
- stack?: string | undefined;
632
- cause?: unknown;
633
- } | {
634
- kind: "transient";
635
- status?: number | undefined;
636
- name: string;
637
- message: string;
638
- stack?: string | undefined;
639
- cause?: unknown;
640
- } | null;
641
- lastFetched: number | null;
642
- stale: boolean;
643
- currentPage: number | null;
644
- pageSize: number | null;
645
- };
646
- };
647
- upsertEntity: (type: EntityType, id: EntityId, data: Record<string, unknown>) => void;
648
- upsertEntities: (type: EntityType, entries: Array<{
649
- id: EntityId;
650
- data: Record<string, unknown>;
651
- }>) => void;
652
- ingestFetchedList: (type: EntityType, entries: Array<{
653
- id: EntityId;
654
- data: Record<string, unknown>;
655
- }>, options?: IngestFetchedListOptions) => void;
656
- replaceEntity: (type: EntityType, id: EntityId, data: Record<string, unknown>) => void;
657
- removeEntity: (type: EntityType, id: EntityId) => void;
658
- patchEntity: (type: EntityType, id: EntityId, patch: Record<string, unknown>) => void;
659
- unpatchEntity: (type: EntityType, id: EntityId, keys: string[]) => void;
660
- clearPatch: (type: EntityType, id: EntityId) => void;
661
- setEntityFetching: (type: EntityType, id: EntityId, fetching: boolean) => void;
662
- setEntityError: (type: EntityType, id: EntityId, error: string | null) => void;
663
- setEntityFetched: (type: EntityType, id: EntityId) => void;
664
- setEntityStale: (type: EntityType, id: EntityId, stale: boolean) => void;
665
- setEntitySyncMetadata: (type: EntityType, id: EntityId, metadata: Partial<EntitySyncMetadata>) => void;
666
- clearEntitySyncMetadata: (type: EntityType, id: EntityId) => void;
667
- setListResult: (key: QueryKey, ids: EntityId[], meta: Partial<Omit<ListState, "ids" | "isFetching" | "isFetchingMore" | "error" | "stale">>) => void;
668
- appendListResult: (key: QueryKey, ids: EntityId[], meta: Partial<Omit<ListState, "ids" | "isFetching" | "isFetchingMore" | "error" | "stale">>) => void;
669
- prependListResult: (key: QueryKey, ids: EntityId[], meta?: Partial<ListState>) => void;
670
- removeIdFromAllLists: (type: EntityType, id: EntityId) => void;
671
- insertIdInList: (key: QueryKey, id: EntityId, position: "start" | "end" | number) => void;
672
- setListFetching: (key: QueryKey, fetching: boolean) => void;
673
- setListFetchingMore: (key: QueryKey, fetchingMore: boolean) => void;
674
- setListError: (key: QueryKey, error: string | null, typed?: EntityError | null) => void;
675
- setListStale: (key: QueryKey, stale: boolean) => void;
676
- invalidateEntity: (type: EntityType, id?: EntityId) => void;
677
- invalidateLists: (matcher: string | ((key: QueryKey) => boolean)) => void;
678
- invalidateType: (type: EntityType) => void;
679
- readEntity: <T = Record<string, unknown>>(type: EntityType, id: EntityId) => T | null;
680
- readEntitySnapshot: <T = Record<string, unknown>>(type: EntityType, id: EntityId) => EntitySnapshot<T & Record<string, unknown>> | null;
681
- }) => void), shouldReplace?: false): void;
682
- setState(nextStateOrUpdater: GraphState | ((state: {
683
- entities: {
684
- [x: string]: {
685
- [x: string]: {
686
- [x: string]: unknown;
687
- };
688
- };
689
- };
690
- patches: {
691
- [x: string]: {
692
- [x: string]: {
693
- [x: string]: unknown;
694
- };
695
- };
696
- };
697
- entityStates: {
698
- [x: string]: {
699
- isFetching: boolean;
700
- lastFetched: number | null;
701
- error: string | null;
702
- stale: boolean;
703
- };
704
- };
705
- syncMetadata: {
706
- [x: string]: {
707
- synced: boolean;
708
- origin: SyncOrigin;
709
- updatedAt: number | null;
710
- };
711
- };
712
- lists: {
713
- [x: string]: {
714
- ids: string[];
715
- total: number | null;
716
- nextCursor: string | null;
717
- prevCursor: string | null;
718
- hasNextPage: boolean;
719
- hasPrevPage: boolean;
720
- isFetching: boolean;
721
- isFetchingMore: boolean;
722
- error: string | null;
723
- lastError: {
724
- kind: "terminal";
725
- status?: number | undefined;
726
- name: string;
727
- message: string;
728
- stack?: string | undefined;
729
- cause?: unknown;
730
- } | {
731
- kind: "transient";
732
- status?: number | undefined;
733
- name: string;
734
- message: string;
735
- stack?: string | undefined;
736
- cause?: unknown;
737
- } | null;
738
- lastFetched: number | null;
739
- stale: boolean;
740
- currentPage: number | null;
741
- pageSize: number | null;
742
- };
743
- };
744
- upsertEntity: (type: EntityType, id: EntityId, data: Record<string, unknown>) => void;
745
- upsertEntities: (type: EntityType, entries: Array<{
746
- id: EntityId;
747
- data: Record<string, unknown>;
748
- }>) => void;
749
- ingestFetchedList: (type: EntityType, entries: Array<{
750
- id: EntityId;
751
- data: Record<string, unknown>;
752
- }>, options?: IngestFetchedListOptions) => void;
753
- replaceEntity: (type: EntityType, id: EntityId, data: Record<string, unknown>) => void;
754
- removeEntity: (type: EntityType, id: EntityId) => void;
755
- patchEntity: (type: EntityType, id: EntityId, patch: Record<string, unknown>) => void;
756
- unpatchEntity: (type: EntityType, id: EntityId, keys: string[]) => void;
757
- clearPatch: (type: EntityType, id: EntityId) => void;
758
- setEntityFetching: (type: EntityType, id: EntityId, fetching: boolean) => void;
759
- setEntityError: (type: EntityType, id: EntityId, error: string | null) => void;
760
- setEntityFetched: (type: EntityType, id: EntityId) => void;
761
- setEntityStale: (type: EntityType, id: EntityId, stale: boolean) => void;
762
- setEntitySyncMetadata: (type: EntityType, id: EntityId, metadata: Partial<EntitySyncMetadata>) => void;
763
- clearEntitySyncMetadata: (type: EntityType, id: EntityId) => void;
764
- setListResult: (key: QueryKey, ids: EntityId[], meta: Partial<Omit<ListState, "ids" | "isFetching" | "isFetchingMore" | "error" | "stale">>) => void;
765
- appendListResult: (key: QueryKey, ids: EntityId[], meta: Partial<Omit<ListState, "ids" | "isFetching" | "isFetchingMore" | "error" | "stale">>) => void;
766
- prependListResult: (key: QueryKey, ids: EntityId[], meta?: Partial<ListState>) => void;
767
- removeIdFromAllLists: (type: EntityType, id: EntityId) => void;
768
- insertIdInList: (key: QueryKey, id: EntityId, position: "start" | "end" | number) => void;
769
- setListFetching: (key: QueryKey, fetching: boolean) => void;
770
- setListFetchingMore: (key: QueryKey, fetchingMore: boolean) => void;
771
- setListError: (key: QueryKey, error: string | null, typed?: EntityError | null) => void;
772
- setListStale: (key: QueryKey, stale: boolean) => void;
773
- invalidateEntity: (type: EntityType, id?: EntityId) => void;
774
- invalidateLists: (matcher: string | ((key: QueryKey) => boolean)) => void;
775
- invalidateType: (type: EntityType) => void;
776
- readEntity: <T = Record<string, unknown>>(type: EntityType, id: EntityId) => T | null;
777
- readEntitySnapshot: <T = Record<string, unknown>>(type: EntityType, id: EntityId) => EntitySnapshot<T & Record<string, unknown>> | null;
778
- }) => void), shouldReplace: true): void;
779
- };
780
- type GraphStore = ReturnType<typeof createGraphStore>;
781
- /**
782
- * @deprecated Import `graphStore` from core, or `useGraphStore` from the React
783
- * binding. This StoreApi-shaped alias remains for non-React 2.x migrations.
784
- */
785
- declare const useGraphStore: Omit<Omit<zustand_vanilla.StoreApi<GraphState>, "subscribe"> & {
786
- subscribe: {
787
- (listener: (selectedState: GraphState, previousSelectedState: GraphState) => void): () => void;
788
- <U>(selector: (state: GraphState) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
789
- equalityFn?: ((a: U, b: U) => boolean) | undefined;
790
- fireImmediately?: boolean;
791
- } | undefined): () => void;
792
- };
793
- }, "setState"> & {
794
- setState(nextStateOrUpdater: GraphState | Partial<GraphState> | ((state: {
795
- entities: {
796
- [x: string]: {
797
- [x: string]: {
798
- [x: string]: unknown;
799
- };
800
- };
801
- };
802
- patches: {
803
- [x: string]: {
804
- [x: string]: {
805
- [x: string]: unknown;
806
- };
807
- };
808
- };
809
- entityStates: {
810
- [x: string]: {
811
- isFetching: boolean;
812
- lastFetched: number | null;
813
- error: string | null;
814
- stale: boolean;
815
- };
816
- };
817
- syncMetadata: {
818
- [x: string]: {
819
- synced: boolean;
820
- origin: SyncOrigin;
821
- updatedAt: number | null;
822
- };
823
- };
824
- lists: {
825
- [x: string]: {
826
- ids: string[];
827
- total: number | null;
828
- nextCursor: string | null;
829
- prevCursor: string | null;
830
- hasNextPage: boolean;
831
- hasPrevPage: boolean;
832
- isFetching: boolean;
833
- isFetchingMore: boolean;
834
- error: string | null;
835
- lastError: {
836
- kind: "terminal";
837
- status?: number | undefined;
838
- name: string;
839
- message: string;
840
- stack?: string | undefined;
841
- cause?: unknown;
842
- } | {
843
- kind: "transient";
844
- status?: number | undefined;
845
- name: string;
846
- message: string;
847
- stack?: string | undefined;
848
- cause?: unknown;
849
- } | null;
850
- lastFetched: number | null;
851
- stale: boolean;
852
- currentPage: number | null;
853
- pageSize: number | null;
854
- };
855
- };
856
- upsertEntity: (type: EntityType, id: EntityId, data: Record<string, unknown>) => void;
857
- upsertEntities: (type: EntityType, entries: Array<{
858
- id: EntityId;
859
- data: Record<string, unknown>;
860
- }>) => void;
861
- ingestFetchedList: (type: EntityType, entries: Array<{
862
- id: EntityId;
863
- data: Record<string, unknown>;
864
- }>, options?: IngestFetchedListOptions) => void;
865
- replaceEntity: (type: EntityType, id: EntityId, data: Record<string, unknown>) => void;
866
- removeEntity: (type: EntityType, id: EntityId) => void;
867
- patchEntity: (type: EntityType, id: EntityId, patch: Record<string, unknown>) => void;
868
- unpatchEntity: (type: EntityType, id: EntityId, keys: string[]) => void;
869
- clearPatch: (type: EntityType, id: EntityId) => void;
870
- setEntityFetching: (type: EntityType, id: EntityId, fetching: boolean) => void;
871
- setEntityError: (type: EntityType, id: EntityId, error: string | null) => void;
872
- setEntityFetched: (type: EntityType, id: EntityId) => void;
873
- setEntityStale: (type: EntityType, id: EntityId, stale: boolean) => void;
874
- setEntitySyncMetadata: (type: EntityType, id: EntityId, metadata: Partial<EntitySyncMetadata>) => void;
875
- clearEntitySyncMetadata: (type: EntityType, id: EntityId) => void;
876
- setListResult: (key: QueryKey, ids: EntityId[], meta: Partial<Omit<ListState, "ids" | "isFetching" | "isFetchingMore" | "error" | "stale">>) => void;
877
- appendListResult: (key: QueryKey, ids: EntityId[], meta: Partial<Omit<ListState, "ids" | "isFetching" | "isFetchingMore" | "error" | "stale">>) => void;
878
- prependListResult: (key: QueryKey, ids: EntityId[], meta?: Partial<ListState>) => void;
879
- removeIdFromAllLists: (type: EntityType, id: EntityId) => void;
880
- insertIdInList: (key: QueryKey, id: EntityId, position: "start" | "end" | number) => void;
881
- setListFetching: (key: QueryKey, fetching: boolean) => void;
882
- setListFetchingMore: (key: QueryKey, fetchingMore: boolean) => void;
883
- setListError: (key: QueryKey, error: string | null, typed?: EntityError | null) => void;
884
- setListStale: (key: QueryKey, stale: boolean) => void;
885
- invalidateEntity: (type: EntityType, id?: EntityId) => void;
886
- invalidateLists: (matcher: string | ((key: QueryKey) => boolean)) => void;
887
- invalidateType: (type: EntityType) => void;
888
- readEntity: <T = Record<string, unknown>>(type: EntityType, id: EntityId) => T | null;
889
- readEntitySnapshot: <T = Record<string, unknown>>(type: EntityType, id: EntityId) => EntitySnapshot<T & Record<string, unknown>> | null;
890
- }) => void), shouldReplace?: false): void;
891
- setState(nextStateOrUpdater: GraphState | ((state: {
892
- entities: {
893
- [x: string]: {
894
- [x: string]: {
895
- [x: string]: unknown;
896
- };
897
- };
898
- };
899
- patches: {
900
- [x: string]: {
901
- [x: string]: {
902
- [x: string]: unknown;
903
- };
904
- };
905
- };
906
- entityStates: {
907
- [x: string]: {
908
- isFetching: boolean;
909
- lastFetched: number | null;
910
- error: string | null;
911
- stale: boolean;
912
- };
913
- };
914
- syncMetadata: {
915
- [x: string]: {
916
- synced: boolean;
917
- origin: SyncOrigin;
918
- updatedAt: number | null;
919
- };
920
- };
921
- lists: {
922
- [x: string]: {
923
- ids: string[];
924
- total: number | null;
925
- nextCursor: string | null;
926
- prevCursor: string | null;
927
- hasNextPage: boolean;
928
- hasPrevPage: boolean;
929
- isFetching: boolean;
930
- isFetchingMore: boolean;
931
- error: string | null;
932
- lastError: {
933
- kind: "terminal";
934
- status?: number | undefined;
935
- name: string;
936
- message: string;
937
- stack?: string | undefined;
938
- cause?: unknown;
939
- } | {
940
- kind: "transient";
941
- status?: number | undefined;
942
- name: string;
943
- message: string;
944
- stack?: string | undefined;
945
- cause?: unknown;
946
- } | null;
947
- lastFetched: number | null;
948
- stale: boolean;
949
- currentPage: number | null;
950
- pageSize: number | null;
951
- };
952
- };
953
- upsertEntity: (type: EntityType, id: EntityId, data: Record<string, unknown>) => void;
954
- upsertEntities: (type: EntityType, entries: Array<{
955
- id: EntityId;
956
- data: Record<string, unknown>;
957
- }>) => void;
958
- ingestFetchedList: (type: EntityType, entries: Array<{
959
- id: EntityId;
960
- data: Record<string, unknown>;
961
- }>, options?: IngestFetchedListOptions) => void;
962
- replaceEntity: (type: EntityType, id: EntityId, data: Record<string, unknown>) => void;
963
- removeEntity: (type: EntityType, id: EntityId) => void;
964
- patchEntity: (type: EntityType, id: EntityId, patch: Record<string, unknown>) => void;
965
- unpatchEntity: (type: EntityType, id: EntityId, keys: string[]) => void;
966
- clearPatch: (type: EntityType, id: EntityId) => void;
967
- setEntityFetching: (type: EntityType, id: EntityId, fetching: boolean) => void;
968
- setEntityError: (type: EntityType, id: EntityId, error: string | null) => void;
969
- setEntityFetched: (type: EntityType, id: EntityId) => void;
970
- setEntityStale: (type: EntityType, id: EntityId, stale: boolean) => void;
971
- setEntitySyncMetadata: (type: EntityType, id: EntityId, metadata: Partial<EntitySyncMetadata>) => void;
972
- clearEntitySyncMetadata: (type: EntityType, id: EntityId) => void;
973
- setListResult: (key: QueryKey, ids: EntityId[], meta: Partial<Omit<ListState, "ids" | "isFetching" | "isFetchingMore" | "error" | "stale">>) => void;
974
- appendListResult: (key: QueryKey, ids: EntityId[], meta: Partial<Omit<ListState, "ids" | "isFetching" | "isFetchingMore" | "error" | "stale">>) => void;
975
- prependListResult: (key: QueryKey, ids: EntityId[], meta?: Partial<ListState>) => void;
976
- removeIdFromAllLists: (type: EntityType, id: EntityId) => void;
977
- insertIdInList: (key: QueryKey, id: EntityId, position: "start" | "end" | number) => void;
978
- setListFetching: (key: QueryKey, fetching: boolean) => void;
979
- setListFetchingMore: (key: QueryKey, fetchingMore: boolean) => void;
980
- setListError: (key: QueryKey, error: string | null, typed?: EntityError | null) => void;
981
- setListStale: (key: QueryKey, stale: boolean) => void;
982
- invalidateEntity: (type: EntityType, id?: EntityId) => void;
983
- invalidateLists: (matcher: string | ((key: QueryKey) => boolean)) => void;
984
- invalidateType: (type: EntityType) => void;
985
- readEntity: <T = Record<string, unknown>>(type: EntityType, id: EntityId) => T | null;
986
- readEntitySnapshot: <T = Record<string, unknown>>(type: EntityType, id: EntityId) => EntitySnapshot<T & Record<string, unknown>> | null;
987
- }) => void), shouldReplace: true): void;
988
- };
989
-
990
- export { hasCustomPredicates as A, toEntityError as B, type CompletenessMode as C, toGraphQLVariables as D, type EntityType as E, type FilterSpec as F, type GraphStore as G, toRestParams as H, type IngestFetchedListOptions as I, toSQLClauses as J, type ListResultMeta as L, type QueryKey as Q, type SortSpec as S, TerminalError as T, type ViewDescriptor as V, type EntityId as a, type SyncOrigin as b, type EntitySnapshot as c, type EntitySyncMetadata as d, EMPTY_ENTITY_STATE as e, EMPTY_IDS as f, graphStore as g, EMPTY_LIST_STATE as h, EMPTY_SYNC_METADATA as i, type EntityError as j, type EntityErrorOptions as k, type EntityState as l, type FetchedEntityBatch as m, type FetchedListProjection as n, type FetchedListTarget as o, type FilterClause as p, type FilterGroup as q, type FilterOperator as r, type GraphState as s, type ListState as t, useGraphStore as u, type SortClause as v, type SortDirection as w, TransientError as x, createGraphStore as y, flattenClauses as z };