@ahoo-wang/wow-view-store 10.0.0-alpha.7 → 10.0.0-beta.2

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.
@@ -30,8 +30,17 @@ export declare class WowDatasetWordings implements DatasetWordingStore {
30
30
  * Every dataset's wording of the caller's tenant and application, by
31
31
  * dataset. A cleared one is listed too, saying nothing: its revision is
32
32
  * what the next write expects.
33
+ *
34
+ * Read whole, a page at a time by the snapshot model's cursor, oldest
35
+ * first, until the service has no next page. A wording left unread would
36
+ * read as never written — revision `'0'` — and every save of it would be
37
+ * refused as a conflict nobody could clear (#5546); the port promises
38
+ * every dataset's, so no count of them cuts it short. The caller's signal
39
+ * stops the reading between pages and within one.
33
40
  */
34
41
  list({ signal }?: ReadOptions): Promise<ReadonlyMap<string, StoredDatasetWording>>;
42
+ /** One page of the wordings, the one after `cursor`; the first without one. */
43
+ private page;
35
44
  /**
36
45
  * Writes a dataset's wording at the expected `revision` (`'0'` for one never
37
46
  * written), whole: what it leaves out is no longer said. Answers the new
@@ -53,6 +53,8 @@ export declare const viewStoreWait: {
53
53
  readonly committed: () => Hop;
54
54
  /** Until the snapshot of `view-store` holds the commit. */
55
55
  readonly snapshot: () => Hop;
56
+ /** Until the store the snapshot queries of `view-store` read holds the commit. */
57
+ readonly queryable: () => Hop;
56
58
  /** Until a subscription of `view-store` handled the commit. */
57
59
  readonly handled: (subscription: ViewStoreSubscription) => Hop;
58
60
  };
@@ -12,6 +12,10 @@ export declare const DatasetWordingAggregate: {
12
12
  readonly snapshot: true;
13
13
  };
14
14
  /** The `state.*` paths of `dataset_wording`'s snapshots a query filters, sorts and projects on. */
15
- export type DatasetWordingStateField = 'state.appId' | 'state.dataset' | 'state.fields' | 'state.recordNoun' | 'state.title';
15
+ export type DatasetWordingStateField = 'state.appId' | 'state.dataset' | 'state.fields' | 'state.isEmpty' | 'state.recordNoun' | 'state.title';
16
+ /** The access attributes of `view-store.dataset_wording` (`@Access`) by name, as its records carry them: a single one's value or null, a multiple one's values. A record written before an attribute was declared lacks it. */
17
+ export type DatasetWordingAccess = {
18
+ readonly appId?: string | null;
19
+ };
16
20
  /** The events of `dataset_wording`, named as the server sends them, `view-store.dataset_wording.<Event>` at its current revision (the `events` query upgrades older records), and the system events every aggregate has. */
17
21
  export type DatasetWordingEvent = CommittedEvent<'view-store.dataset_wording.DatasetWordingCleared', DatasetWordingCleared> | CommittedEvent<'view-store.dataset_wording.DatasetWordingSet', DatasetWordingSet> | SystemEvent;
@@ -1,18 +1,18 @@
1
1
  import { EventQueryClient, SnapshotQueryClient, StateClient, WowClientOptions } from '@ahoo-wang/wow-client';
2
2
  import { DatasetWordingState } from '../types.js';
3
- import { DatasetWordingEvent, DatasetWordingStateField } from './aggregate.js';
3
+ import { DatasetWordingAccess, DatasetWordingEvent, DatasetWordingStateField } from './aggregate.js';
4
4
  /** Queries the snapshots of `view-store.dataset_wording`: `POST /view-store/dataset_wording/snapshot/query`. */
5
- export declare class DatasetWordingSnapshotQueryClient extends SnapshotQueryClient<DatasetWordingState, DatasetWordingStateField> {
5
+ export declare class DatasetWordingSnapshotQueryClient extends SnapshotQueryClient<DatasetWordingState, DatasetWordingStateField, DatasetWordingAccess> {
6
6
  /** @param options - How the service is reached */
7
7
  constructor(options?: WowClientOptions);
8
8
  }
9
9
  /** Queries the event streams of `view-store.dataset_wording`, one record per commit: `POST /view-store/dataset_wording/events/query`. */
10
- export declare class DatasetWordingEventQueryClient extends EventQueryClient<DatasetWordingEvent> {
10
+ export declare class DatasetWordingEventQueryClient extends EventQueryClient<DatasetWordingEvent, DatasetWordingAccess> {
11
11
  /** @param options - How the service is reached */
12
12
  constructor(options?: WowClientOptions);
13
13
  }
14
14
  /** Reads the states of `view-store.dataset_wording`, at a version or a time, and their traces: `GET /view-store/dataset_wording/{id}/state`. */
15
- export declare class DatasetWordingStateClient extends StateClient<DatasetWordingState, DatasetWordingEvent> {
15
+ export declare class DatasetWordingStateClient extends StateClient<DatasetWordingState, DatasetWordingEvent, DatasetWordingAccess> {
16
16
  /** @param options - How the service is reached */
17
17
  constructor(options?: WowClientOptions);
18
18
  }
@@ -47,6 +47,7 @@ export interface DatasetWordingState {
47
47
  appId: string;
48
48
  dataset: string;
49
49
  fields?: Record<string, unknown> | null;
50
+ isEmpty: boolean;
50
51
  recordNoun?: string | null;
51
52
  title?: string | null;
52
53
  }
@@ -13,5 +13,9 @@ export declare const ViewAggregate: {
13
13
  };
14
14
  /** The `state.*` paths of `view`'s snapshots a query filters, sorts and projects on. */
15
15
  export type ViewStateField = 'state.appId' | 'state.audience' | 'state.config' | 'state.definitionId' | 'state.kind' | 'state.title';
16
+ /** The access attributes of `view-store.view` (`@Access`) by name, as its records carry them: a single one's value or null, a multiple one's values. A record written before an attribute was declared lacks it. */
17
+ export type ViewAccess = {
18
+ readonly appId?: string | null;
19
+ };
16
20
  /** The events of `view`, named as the server sends them, `view-store.view.<Event>` at its current revision (the `events` query upgrades older records), and the system events every aggregate has. */
17
21
  export type ViewEvent = CommittedEvent<'view-store.view.ViewAudienceChanged', ViewAudienceChanged> | CommittedEvent<'view-store.view.ViewClaimed', ViewClaimed> | CommittedEvent<'view-store.view.ViewCreated', ViewCreated> | CommittedEvent<'view-store.view.ViewRenamed', ViewRenamed> | CommittedEvent<'view-store.view.ViewSaved', ViewSaved> | CommittedEvent<'view-store.view.ViewShared', ViewShared> | SystemEvent;
@@ -1,18 +1,18 @@
1
1
  import { EventQueryClient, SnapshotQueryClient, StateClient, WowClientOptions } from '@ahoo-wang/wow-client';
2
2
  import { ViewState } from '../types.js';
3
- import { ViewEvent, ViewStateField } from './aggregate.js';
3
+ import { ViewAccess, ViewEvent, ViewStateField } from './aggregate.js';
4
4
  /** Queries the snapshots of `view-store.view`: `POST /view-store/view/snapshot/query`. */
5
- export declare class ViewSnapshotQueryClient extends SnapshotQueryClient<ViewState, ViewStateField> {
5
+ export declare class ViewSnapshotQueryClient extends SnapshotQueryClient<ViewState, ViewStateField, ViewAccess> {
6
6
  /** @param options - How the service is reached */
7
7
  constructor(options?: WowClientOptions);
8
8
  }
9
9
  /** Queries the event streams of `view-store.view`, one record per commit: `POST /view-store/view/events/query`. */
10
- export declare class ViewEventQueryClient extends EventQueryClient<ViewEvent> {
10
+ export declare class ViewEventQueryClient extends EventQueryClient<ViewEvent, ViewAccess> {
11
11
  /** @param options - How the service is reached */
12
12
  constructor(options?: WowClientOptions);
13
13
  }
14
14
  /** Reads the states of `view-store.view`, at a version or a time, and their traces: `GET /view-store/view/{id}/state`. */
15
- export declare class ViewStateClient extends StateClient<ViewState, ViewEvent> {
15
+ export declare class ViewStateClient extends StateClient<ViewState, ViewEvent, ViewAccess> {
16
16
  /** @param options - How the service is reached */
17
17
  constructor(options?: WowClientOptions);
18
18
  }
@@ -13,5 +13,9 @@ export declare const ViewPreferencesAggregate: {
13
13
  };
14
14
  /** The `state.*` paths of `view_preferences`'s snapshots a query filters, sorts and projects on. */
15
15
  export type ViewPreferencesStateField = 'state.appId' | 'state.autoRun' | 'state.defaultInstanceId' | 'state.definitionId' | 'state.lastTabs' | 'state.order';
16
+ /** The access attributes of `view-store.view_preferences` (`@Access`) by name, as its records carry them: a single one's value or null, a multiple one's values. A record written before an attribute was declared lacks it. */
17
+ export type ViewPreferencesAccess = {
18
+ readonly appId?: string | null;
19
+ };
16
20
  /** The events of `view_preferences`, named as the server sends them, `view-store.view_preferences.<Event>` at its current revision (the `events` query upgrades older records), and the system events every aggregate has. */
17
21
  export type ViewPreferencesEvent = CommittedEvent<'view-store.view_preferences.ViewPreferencesSet', ViewPreferencesSet> | SystemEvent;
@@ -1,18 +1,18 @@
1
1
  import { EventQueryClient, SnapshotQueryClient, StateClient, WowClientOptions } from '@ahoo-wang/wow-client';
2
2
  import { ViewPreferencesState } from '../types.js';
3
- import { ViewPreferencesEvent, ViewPreferencesStateField } from './aggregate.js';
3
+ import { ViewPreferencesAccess, ViewPreferencesEvent, ViewPreferencesStateField } from './aggregate.js';
4
4
  /** Queries the snapshots of `view-store.view_preferences`: `POST /view-store/view_preferences/snapshot/query`. */
5
- export declare class ViewPreferencesSnapshotQueryClient extends SnapshotQueryClient<ViewPreferencesState, ViewPreferencesStateField> {
5
+ export declare class ViewPreferencesSnapshotQueryClient extends SnapshotQueryClient<ViewPreferencesState, ViewPreferencesStateField, ViewPreferencesAccess> {
6
6
  /** @param options - How the service is reached */
7
7
  constructor(options?: WowClientOptions);
8
8
  }
9
9
  /** Queries the event streams of `view-store.view_preferences`, one record per commit: `POST /view-store/view_preferences/events/query`. */
10
- export declare class ViewPreferencesEventQueryClient extends EventQueryClient<ViewPreferencesEvent> {
10
+ export declare class ViewPreferencesEventQueryClient extends EventQueryClient<ViewPreferencesEvent, ViewPreferencesAccess> {
11
11
  /** @param options - How the service is reached */
12
12
  constructor(options?: WowClientOptions);
13
13
  }
14
14
  /** Reads the states of `view-store.view_preferences`, at a version or a time, and their traces: `GET /view-store/view_preferences/{id}/state`. */
15
- export declare class ViewPreferencesStateClient extends StateClient<ViewPreferencesState, ViewPreferencesEvent> {
15
+ export declare class ViewPreferencesStateClient extends StateClient<ViewPreferencesState, ViewPreferencesEvent, ViewPreferencesAccess> {
16
16
  /** @param options - How the service is reached */
17
17
  constructor(options?: WowClientOptions);
18
18
  }