@ahoo-wang/wow-view-store 9.9.0 → 10.0.0-alpha.4
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 +84 -82
- package/README.zh-CN.md +61 -66
- package/dist/datasetWordings.d.ts +24 -25
- package/dist/errors.d.ts +54 -73
- package/dist/generated/index.d.ts +1 -0
- package/dist/generated/view-store/boundedContext.d.ts +36 -0
- package/dist/generated/view-store/dataset_wording/aggregate.d.ts +17 -0
- package/dist/generated/view-store/dataset_wording/commandClient.d.ts +32 -0
- package/dist/generated/view-store/dataset_wording/index.d.ts +3 -0
- package/dist/generated/view-store/dataset_wording/queryClient.d.ts +18 -0
- package/dist/generated/view-store/index.d.ts +5 -0
- package/dist/generated/view-store/types.d.ts +175 -0
- package/dist/generated/view-store/view/aggregate.d.ts +17 -0
- package/dist/generated/view-store/view/commandClient.d.ts +65 -0
- package/dist/generated/view-store/view/index.d.ts +3 -0
- package/dist/generated/view-store/view/queryClient.d.ts +18 -0
- package/dist/generated/view-store/view_preferences/aggregate.d.ts +17 -0
- package/dist/generated/view-store/view_preferences/commandClient.d.ts +22 -0
- package/dist/generated/view-store/view_preferences/index.d.ts +3 -0
- package/dist/generated/view-store/view_preferences/queryClient.d.ts +18 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.es.js +567 -490
- package/dist/index.es.js.map +1 -1
- package/dist/paths.d.ts +0 -32
- package/dist/remembered.d.ts +9 -0
- package/dist/source.d.ts +47 -0
- package/dist/systemViews.d.ts +21 -0
- package/dist/views.d.ts +49 -0
- package/dist/wire.d.ts +20 -73
- package/dist/wowViewStore.d.ts +111 -159
- package/package.json +7 -7
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Hop } from '@ahoo-wang/wow-client';
|
|
2
|
+
/**
|
|
3
|
+
* The bounded context `view-store`.
|
|
4
|
+
* The view engine's saved views, view preferences and dataset wording
|
|
5
|
+
*/
|
|
6
|
+
export declare const VIEW_STORE_BOUNDED_CONTEXT = "view-store";
|
|
7
|
+
/** The domain error codes of `view-store`, each a problem's `code` with the status the Manifest gives it. */
|
|
8
|
+
export declare const ViewStoreErrorCodes: {
|
|
9
|
+
/** 400: The request carries no CoSec-App-Id. */
|
|
10
|
+
readonly APP_REQUIRED: "view-store.app-required";
|
|
11
|
+
/** 400: The request is not a valid write: its config, title, preferences or wording. */
|
|
12
|
+
readonly INVALID: "view-store.invalid";
|
|
13
|
+
/** 404: The aggregate belongs to another application, which reads as none. */
|
|
14
|
+
readonly NOT_FOUND: "view-store.not-found";
|
|
15
|
+
/** 400: A view is saved by an owner: a user, (shared), or (system) under (platform). */
|
|
16
|
+
readonly OWNER_REQUIRED: "view-store.owner-required";
|
|
17
|
+
/** 409: A shared dashboard shows the view, which stays shared. */
|
|
18
|
+
readonly REFERENCED_BY_SHARED_DASHBOARD: "view-store.referenced-by-shared-dashboard";
|
|
19
|
+
/** 403: A system view never moves audience: it is neither shared nor claimed. */
|
|
20
|
+
readonly SYSTEM_VIEW_READ_ONLY: "view-store.system-view-read-only";
|
|
21
|
+
};
|
|
22
|
+
/** A {@link ViewStoreErrorCodes} value. */
|
|
23
|
+
export type ViewStoreErrorCode = (typeof ViewStoreErrorCodes)[keyof typeof ViewStoreErrorCodes];
|
|
24
|
+
/** The subscriptions of `view-store` a `handled` hop names. */
|
|
25
|
+
export type ViewStoreSubscription = 'ViewAudienceSaga.onAudienceChanged';
|
|
26
|
+
/** The hops of a wait chain (`Wow-Wait`) in `view-store`. */
|
|
27
|
+
export declare const viewStoreWait: {
|
|
28
|
+
/** Until a command of `view-store` passed admission. */
|
|
29
|
+
readonly accepted: () => Hop;
|
|
30
|
+
/** Until a command's events are appended to the log of `view-store`. */
|
|
31
|
+
readonly committed: () => Hop;
|
|
32
|
+
/** Until the snapshot of `view-store` holds the commit. */
|
|
33
|
+
readonly snapshot: () => Hop;
|
|
34
|
+
/** Until a subscription of `view-store` handled the commit. */
|
|
35
|
+
readonly handled: (subscription: ViewStoreSubscription) => Hop;
|
|
36
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EventView, SystemEvent } from '@ahoo-wang/wow-client';
|
|
2
|
+
import { DatasetWordingCleared, DatasetWordingSet } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The aggregate `view-store.dataset_wording`.
|
|
5
|
+
* A tenant's wording over one dataset in one application
|
|
6
|
+
*/
|
|
7
|
+
export declare const DatasetWordingAggregate: {
|
|
8
|
+
readonly context: "view-store";
|
|
9
|
+
readonly name: "dataset_wording";
|
|
10
|
+
readonly path: "/view-store/dataset_wording";
|
|
11
|
+
readonly ownership: "TENANT";
|
|
12
|
+
readonly snapshot: true;
|
|
13
|
+
};
|
|
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';
|
|
16
|
+
/** 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
|
+
export type DatasetWordingEvent = EventView<'view-store.dataset_wording.DatasetWordingCleared', DatasetWordingCleared> | EventView<'view-store.dataset_wording.DatasetWordingSet', DatasetWordingSet> | SystemEvent;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { CommandGateway, CommandResult, CommandResultStream, CreateCommandOptions, WowClientOptions } from '@ahoo-wang/wow-client';
|
|
2
|
+
import { ClearDatasetWording, SetDatasetWording } from '../types.js';
|
|
3
|
+
/** The command routes of `view-store.dataset_wording`. */
|
|
4
|
+
export declare const DatasetWordingCommandPaths: {
|
|
5
|
+
readonly CLEAR_DATASET_WORDING: "/view-store/dataset_wording/{id}/clear-dataset-wording";
|
|
6
|
+
readonly CLEAR_DATASET_WORDING_WITHOUT_ID: "/view-store/dataset_wording/clear-dataset-wording";
|
|
7
|
+
readonly SET_DATASET_WORDING: "/view-store/dataset_wording/{id}/set-dataset-wording";
|
|
8
|
+
readonly SET_DATASET_WORDING_WITHOUT_ID: "/view-store/dataset_wording/set-dataset-wording";
|
|
9
|
+
};
|
|
10
|
+
/** Sends the commands of `view-store.dataset_wording`; a command that did not succeed rejects with a `WowProblemError` holding its result. */
|
|
11
|
+
export declare class DatasetWordingCommandClient {
|
|
12
|
+
readonly gateway: CommandGateway;
|
|
13
|
+
/** @param options - How the service is reached */
|
|
14
|
+
constructor(options?: WowClientOptions);
|
|
15
|
+
/**
|
|
16
|
+
* Clear the wording of a dataset
|
|
17
|
+
* `ClearDatasetWording`: `POST /view-store/dataset_wording/{id}/clear-dataset-wording`, `POST /view-store/dataset_wording/clear-dataset-wording`.
|
|
18
|
+
* Produces `DatasetWordingCleared`.
|
|
19
|
+
*/
|
|
20
|
+
clearDatasetWording(body: ClearDatasetWording, options?: CreateCommandOptions): Promise<CommandResult>;
|
|
21
|
+
/** `ClearDatasetWording`, answered as one result per hop of its wait (`text/event-stream`). */
|
|
22
|
+
clearDatasetWordingStream(body: ClearDatasetWording, options?: CreateCommandOptions): Promise<CommandResultStream>;
|
|
23
|
+
/**
|
|
24
|
+
* Set the wording of a dataset
|
|
25
|
+
* `SetDatasetWording`: `POST /view-store/dataset_wording/{id}/set-dataset-wording`, `POST /view-store/dataset_wording/set-dataset-wording`.
|
|
26
|
+
* Creates the aggregate, or acts on the one that exists.
|
|
27
|
+
* Produces `DatasetWordingSet`.
|
|
28
|
+
*/
|
|
29
|
+
setDatasetWording(body: SetDatasetWording, options?: CreateCommandOptions): Promise<CommandResult>;
|
|
30
|
+
/** `SetDatasetWording`, answered as one result per hop of its wait (`text/event-stream`). */
|
|
31
|
+
setDatasetWordingStream(body: SetDatasetWording, options?: CreateCommandOptions): Promise<CommandResultStream>;
|
|
32
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EventQueryClient, SnapshotQueryClient, StateClient, WowClientOptions } from '@ahoo-wang/wow-client';
|
|
2
|
+
import { DatasetWordingState } from '../types.js';
|
|
3
|
+
import { DatasetWordingEvent, DatasetWordingStateField } from './aggregate.js';
|
|
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> {
|
|
6
|
+
/** @param options - How the service is reached */
|
|
7
|
+
constructor(options?: WowClientOptions);
|
|
8
|
+
}
|
|
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> {
|
|
11
|
+
/** @param options - How the service is reached */
|
|
12
|
+
constructor(options?: WowClientOptions);
|
|
13
|
+
}
|
|
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> {
|
|
16
|
+
/** @param options - How the service is reached */
|
|
17
|
+
constructor(options?: WowClientOptions);
|
|
18
|
+
}
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gives the aggregate to the owner ownerId.
|
|
3
|
+
* - key: `me.ahoo.wow.api.lifecycle.TransferOwner`
|
|
4
|
+
*/
|
|
5
|
+
export interface ApiLifecycleTransferOwner {
|
|
6
|
+
ownerId: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Make a shared view personal
|
|
10
|
+
* - key: `me.ahoo.wow.viewstore.api.view.ClaimView`
|
|
11
|
+
*/
|
|
12
|
+
export type ClaimView = Record<string, unknown>;
|
|
13
|
+
/**
|
|
14
|
+
* Clear the wording of a dataset
|
|
15
|
+
* - key: `me.ahoo.wow.viewstore.api.wording.ClearDatasetWording`
|
|
16
|
+
*/
|
|
17
|
+
export interface ClearDatasetWording {
|
|
18
|
+
dataset: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Create a view
|
|
22
|
+
* - key: `me.ahoo.wow.viewstore.api.view.CreateView`
|
|
23
|
+
*/
|
|
24
|
+
export interface CreateView {
|
|
25
|
+
config: Record<string, unknown>;
|
|
26
|
+
definitionId: string;
|
|
27
|
+
title: string;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* A dataset's wording was cleared
|
|
31
|
+
* - key: `me.ahoo.wow.viewstore.api.wording.DatasetWordingCleared`
|
|
32
|
+
*/
|
|
33
|
+
export type DatasetWordingCleared = Record<string, unknown>;
|
|
34
|
+
/**
|
|
35
|
+
* A dataset's wording was set
|
|
36
|
+
* - key: `me.ahoo.wow.viewstore.api.wording.DatasetWordingSet`
|
|
37
|
+
*/
|
|
38
|
+
export interface DatasetWordingSet {
|
|
39
|
+
appId: string;
|
|
40
|
+
dataset: string;
|
|
41
|
+
fields?: null | Record<string, unknown>;
|
|
42
|
+
recordNoun?: string | null;
|
|
43
|
+
title?: string | null;
|
|
44
|
+
}
|
|
45
|
+
/** - key: `me.ahoo.wow.viewstore.domain.wording.DatasetWordingState` */
|
|
46
|
+
export interface DatasetWordingState {
|
|
47
|
+
appId: string;
|
|
48
|
+
dataset: string;
|
|
49
|
+
fields?: null | Record<string, unknown>;
|
|
50
|
+
recordNoun?: string | null;
|
|
51
|
+
title?: string | null;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Rename a view
|
|
55
|
+
* - key: `me.ahoo.wow.viewstore.api.view.RenameView`
|
|
56
|
+
*/
|
|
57
|
+
export interface RenameView {
|
|
58
|
+
title: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Save a view's config
|
|
62
|
+
* - key: `me.ahoo.wow.viewstore.api.view.SaveView`
|
|
63
|
+
*/
|
|
64
|
+
export interface SaveView {
|
|
65
|
+
config: Record<string, unknown>;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Set the wording of a dataset
|
|
69
|
+
* - key: `me.ahoo.wow.viewstore.api.wording.SetDatasetWording`
|
|
70
|
+
*/
|
|
71
|
+
export interface SetDatasetWording {
|
|
72
|
+
dataset: string;
|
|
73
|
+
fields?: null | Record<string, unknown>;
|
|
74
|
+
recordNoun?: string | null;
|
|
75
|
+
title?: string | null;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Set the view preferences of a definition
|
|
79
|
+
* - key: `me.ahoo.wow.viewstore.api.preferences.SetViewPreferences`
|
|
80
|
+
*/
|
|
81
|
+
export interface SetViewPreferences {
|
|
82
|
+
autoRun?: boolean | null;
|
|
83
|
+
defaultInstanceId?: string | null;
|
|
84
|
+
definitionId: string;
|
|
85
|
+
lastTabs?: Record<string, string> | null;
|
|
86
|
+
order?: string[];
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Make a view shared
|
|
90
|
+
* - key: `me.ahoo.wow.viewstore.api.view.ShareView`
|
|
91
|
+
*/
|
|
92
|
+
export type ShareView = Record<string, unknown>;
|
|
93
|
+
/** - key: `me.ahoo.wow.viewstore.api.ViewAudience` */
|
|
94
|
+
export type ViewAudience = 'personal' | 'shared' | 'system';
|
|
95
|
+
/**
|
|
96
|
+
* A 9.x view moved to another audience; history only, never produced
|
|
97
|
+
* - key: `me.ahoo.wow.viewstore.api.view.ViewAudienceChanged`
|
|
98
|
+
*/
|
|
99
|
+
export interface ViewAudienceChanged {
|
|
100
|
+
audience: ViewAudience;
|
|
101
|
+
toOwnerId: string;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* A shared view was made personal to toOwnerId, who becomes its owner
|
|
105
|
+
* - key: `me.ahoo.wow.viewstore.api.view.ViewClaimed`
|
|
106
|
+
*/
|
|
107
|
+
export interface ViewClaimed {
|
|
108
|
+
toOwnerId: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* A view was saved
|
|
112
|
+
* - key: `me.ahoo.wow.viewstore.api.view.ViewCreated`
|
|
113
|
+
*/
|
|
114
|
+
export interface ViewCreated {
|
|
115
|
+
appId: string;
|
|
116
|
+
audience: ViewAudience;
|
|
117
|
+
config: Record<string, unknown>;
|
|
118
|
+
definitionId: string;
|
|
119
|
+
kind: ViewKind;
|
|
120
|
+
title: string;
|
|
121
|
+
}
|
|
122
|
+
/** - key: `me.ahoo.wow.viewstore.api.ViewKind` */
|
|
123
|
+
export type ViewKind = 'record' | 'analysis' | 'dashboard';
|
|
124
|
+
/**
|
|
125
|
+
* A definition's view preferences were set
|
|
126
|
+
* - key: `me.ahoo.wow.viewstore.api.preferences.ViewPreferencesSet`
|
|
127
|
+
*/
|
|
128
|
+
export interface ViewPreferencesSet {
|
|
129
|
+
appId: string;
|
|
130
|
+
autoRun?: boolean | null;
|
|
131
|
+
defaultInstanceId?: string | null;
|
|
132
|
+
definitionId: string;
|
|
133
|
+
lastTabs?: Record<string, string> | null;
|
|
134
|
+
order: string[];
|
|
135
|
+
}
|
|
136
|
+
/** - key: `me.ahoo.wow.viewstore.domain.preferences.ViewPreferencesState` */
|
|
137
|
+
export interface ViewPreferencesState {
|
|
138
|
+
appId: string;
|
|
139
|
+
autoRun?: boolean | null;
|
|
140
|
+
defaultInstanceId?: string | null;
|
|
141
|
+
definitionId: string;
|
|
142
|
+
lastTabs?: Record<string, string> | null;
|
|
143
|
+
order: string[];
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* A view was renamed
|
|
147
|
+
* - key: `me.ahoo.wow.viewstore.api.view.ViewRenamed`
|
|
148
|
+
*/
|
|
149
|
+
export interface ViewRenamed {
|
|
150
|
+
title: string;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* A view's config was overwritten
|
|
154
|
+
* - key: `me.ahoo.wow.viewstore.api.view.ViewSaved`
|
|
155
|
+
*/
|
|
156
|
+
export interface ViewSaved {
|
|
157
|
+
config: Record<string, unknown>;
|
|
158
|
+
kind: ViewKind;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* A view was made shared; its owner becomes (shared)
|
|
162
|
+
* - key: `me.ahoo.wow.viewstore.api.view.ViewShared`
|
|
163
|
+
*/
|
|
164
|
+
export type ViewShared = Record<string, unknown>;
|
|
165
|
+
/** - key: `me.ahoo.wow.viewstore.domain.view.ViewState` */
|
|
166
|
+
export interface ViewState {
|
|
167
|
+
appId: string;
|
|
168
|
+
audience: ViewAudience;
|
|
169
|
+
config: Record<string, unknown>;
|
|
170
|
+
definitionId: string;
|
|
171
|
+
kind: ViewKind;
|
|
172
|
+
title: string;
|
|
173
|
+
}
|
|
174
|
+
/** - key: `wow.lifecycle.TransferOwner` */
|
|
175
|
+
export type WowLifecycleTransferOwner = ApiLifecycleTransferOwner;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EventView, SystemEvent } from '@ahoo-wang/wow-client';
|
|
2
|
+
import { ViewAudienceChanged, ViewClaimed, ViewCreated, ViewRenamed, ViewSaved, ViewShared } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The aggregate `view-store.view`.
|
|
5
|
+
* A saved view of the view engine: a record view, an analysis view or a dashboard
|
|
6
|
+
*/
|
|
7
|
+
export declare const ViewAggregate: {
|
|
8
|
+
readonly context: "view-store";
|
|
9
|
+
readonly name: "view";
|
|
10
|
+
readonly path: "/view-store/view";
|
|
11
|
+
readonly ownership: "OWNER";
|
|
12
|
+
readonly snapshot: true;
|
|
13
|
+
};
|
|
14
|
+
/** The `state.*` paths of `view`'s snapshots a query filters, sorts and projects on. */
|
|
15
|
+
export type ViewStateField = 'state.appId' | 'state.audience' | 'state.config' | 'state.definitionId' | 'state.kind' | 'state.title';
|
|
16
|
+
/** 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
|
+
export type ViewEvent = EventView<'view-store.view.ViewAudienceChanged', ViewAudienceChanged> | EventView<'view-store.view.ViewClaimed', ViewClaimed> | EventView<'view-store.view.ViewCreated', ViewCreated> | EventView<'view-store.view.ViewRenamed', ViewRenamed> | EventView<'view-store.view.ViewSaved', ViewSaved> | EventView<'view-store.view.ViewShared', ViewShared> | SystemEvent;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { CommandGateway, CommandOptions, CommandResult, CommandResultStream, CreateCommandOptions, WowClientOptions } from '@ahoo-wang/wow-client';
|
|
2
|
+
import { ClaimView, CreateView, RenameView, SaveView, ShareView, WowLifecycleTransferOwner } from '../types.js';
|
|
3
|
+
/** The command routes of `view-store.view`. */
|
|
4
|
+
export declare const ViewCommandPaths: {
|
|
5
|
+
readonly CLAIM_VIEW: "/view-store/view/{id}/claim-view";
|
|
6
|
+
readonly CREATE_VIEW: "/view-store/view/{id}/create-view";
|
|
7
|
+
readonly CREATE_VIEW_WITHOUT_ID: "/view-store/view/create-view";
|
|
8
|
+
readonly RENAME_VIEW: "/view-store/view/{id}/rename-view";
|
|
9
|
+
readonly SAVE_VIEW: "/view-store/view/{id}/save-view";
|
|
10
|
+
readonly SHARE_VIEW: "/view-store/view/{id}/share-view";
|
|
11
|
+
};
|
|
12
|
+
/** Sends the commands of `view-store.view`; a command that did not succeed rejects with a `WowProblemError` holding its result. */
|
|
13
|
+
export declare class ViewCommandClient {
|
|
14
|
+
readonly gateway: CommandGateway;
|
|
15
|
+
/** @param options - How the service is reached */
|
|
16
|
+
constructor(options?: WowClientOptions);
|
|
17
|
+
/**
|
|
18
|
+
* Make a shared view personal
|
|
19
|
+
* `ClaimView`: `POST /view-store/view/{id}/claim-view`.
|
|
20
|
+
* Produces `ViewClaimed`.
|
|
21
|
+
*/
|
|
22
|
+
claimView(id: string, body?: ClaimView, options?: CommandOptions): Promise<CommandResult>;
|
|
23
|
+
/** `ClaimView`, answered as one result per hop of its wait (`text/event-stream`). */
|
|
24
|
+
claimViewStream(id: string, body?: ClaimView, options?: CommandOptions): Promise<CommandResultStream>;
|
|
25
|
+
/**
|
|
26
|
+
* Create a view
|
|
27
|
+
* `CreateView`: `POST /view-store/view/{id}/create-view`, `POST /view-store/view/create-view`.
|
|
28
|
+
* Creates the aggregate.
|
|
29
|
+
* Produces `ViewCreated`.
|
|
30
|
+
*/
|
|
31
|
+
createView(body: CreateView, options?: CreateCommandOptions): Promise<CommandResult>;
|
|
32
|
+
/** `CreateView`, answered as one result per hop of its wait (`text/event-stream`). */
|
|
33
|
+
createViewStream(body: CreateView, options?: CreateCommandOptions): Promise<CommandResultStream>;
|
|
34
|
+
/**
|
|
35
|
+
* Rename a view
|
|
36
|
+
* `RenameView`: `POST /view-store/view/{id}/rename-view`.
|
|
37
|
+
* Produces `ViewRenamed`.
|
|
38
|
+
*/
|
|
39
|
+
renameView(id: string, body: RenameView, options?: CommandOptions): Promise<CommandResult>;
|
|
40
|
+
/** `RenameView`, answered as one result per hop of its wait (`text/event-stream`). */
|
|
41
|
+
renameViewStream(id: string, body: RenameView, options?: CommandOptions): Promise<CommandResultStream>;
|
|
42
|
+
/**
|
|
43
|
+
* Save a view's config
|
|
44
|
+
* `SaveView`: `POST /view-store/view/{id}/save-view`.
|
|
45
|
+
* Produces `ViewSaved`.
|
|
46
|
+
*/
|
|
47
|
+
saveView(id: string, body: SaveView, options?: CommandOptions): Promise<CommandResult>;
|
|
48
|
+
/** `SaveView`, answered as one result per hop of its wait (`text/event-stream`). */
|
|
49
|
+
saveViewStream(id: string, body: SaveView, options?: CommandOptions): Promise<CommandResultStream>;
|
|
50
|
+
/**
|
|
51
|
+
* Make a view shared
|
|
52
|
+
* `ShareView`: `POST /view-store/view/{id}/share-view`.
|
|
53
|
+
* Produces `ViewShared`.
|
|
54
|
+
*/
|
|
55
|
+
shareView(id: string, body?: ShareView, options?: CommandOptions): Promise<CommandResult>;
|
|
56
|
+
/** `ShareView`, answered as one result per hop of its wait (`text/event-stream`). */
|
|
57
|
+
shareViewStream(id: string, body?: ShareView, options?: CommandOptions): Promise<CommandResultStream>;
|
|
58
|
+
/**
|
|
59
|
+
* Marks the aggregate deleted; its events stay in the log.
|
|
60
|
+
* The lifecycle command `wow.lifecycle.DeleteAggregate`.
|
|
61
|
+
*/
|
|
62
|
+
deleteAggregate(id: string, options?: CommandOptions): Promise<CommandResult>;
|
|
63
|
+
/** The lifecycle command `wow.lifecycle.TransferOwner`. */
|
|
64
|
+
transferOwner(id: string, body: WowLifecycleTransferOwner, options?: CommandOptions): Promise<CommandResult>;
|
|
65
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EventQueryClient, SnapshotQueryClient, StateClient, WowClientOptions } from '@ahoo-wang/wow-client';
|
|
2
|
+
import { ViewState } from '../types.js';
|
|
3
|
+
import { ViewEvent, ViewStateField } from './aggregate.js';
|
|
4
|
+
/** Queries the snapshots of `view-store.view`: `POST /view-store/view/snapshot/query`. */
|
|
5
|
+
export declare class ViewSnapshotQueryClient extends SnapshotQueryClient<ViewState, ViewStateField> {
|
|
6
|
+
/** @param options - How the service is reached */
|
|
7
|
+
constructor(options?: WowClientOptions);
|
|
8
|
+
}
|
|
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> {
|
|
11
|
+
/** @param options - How the service is reached */
|
|
12
|
+
constructor(options?: WowClientOptions);
|
|
13
|
+
}
|
|
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> {
|
|
16
|
+
/** @param options - How the service is reached */
|
|
17
|
+
constructor(options?: WowClientOptions);
|
|
18
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EventView, SystemEvent } from '@ahoo-wang/wow-client';
|
|
2
|
+
import { ViewPreferencesSet } from '../types.js';
|
|
3
|
+
/**
|
|
4
|
+
* The aggregate `view-store.view_preferences`.
|
|
5
|
+
* One owner's view preferences for one definition in one application
|
|
6
|
+
*/
|
|
7
|
+
export declare const ViewPreferencesAggregate: {
|
|
8
|
+
readonly context: "view-store";
|
|
9
|
+
readonly name: "view_preferences";
|
|
10
|
+
readonly path: "/view-store/view_preferences";
|
|
11
|
+
readonly ownership: "OWNER";
|
|
12
|
+
readonly snapshot: true;
|
|
13
|
+
};
|
|
14
|
+
/** The `state.*` paths of `view_preferences`'s snapshots a query filters, sorts and projects on. */
|
|
15
|
+
export type ViewPreferencesStateField = 'state.appId' | 'state.autoRun' | 'state.defaultInstanceId' | 'state.definitionId' | 'state.lastTabs' | 'state.order';
|
|
16
|
+
/** 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
|
+
export type ViewPreferencesEvent = EventView<'view-store.view_preferences.ViewPreferencesSet', ViewPreferencesSet> | SystemEvent;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CommandGateway, CommandResult, CommandResultStream, CreateCommandOptions, WowClientOptions } from '@ahoo-wang/wow-client';
|
|
2
|
+
import { SetViewPreferences } from '../types.js';
|
|
3
|
+
/** The command routes of `view-store.view_preferences`. */
|
|
4
|
+
export declare const ViewPreferencesCommandPaths: {
|
|
5
|
+
readonly SET_VIEW_PREFERENCES: "/view-store/view_preferences/{id}/set-view-preferences";
|
|
6
|
+
readonly SET_VIEW_PREFERENCES_WITHOUT_ID: "/view-store/view_preferences/set-view-preferences";
|
|
7
|
+
};
|
|
8
|
+
/** Sends the commands of `view-store.view_preferences`; a command that did not succeed rejects with a `WowProblemError` holding its result. */
|
|
9
|
+
export declare class ViewPreferencesCommandClient {
|
|
10
|
+
readonly gateway: CommandGateway;
|
|
11
|
+
/** @param options - How the service is reached */
|
|
12
|
+
constructor(options?: WowClientOptions);
|
|
13
|
+
/**
|
|
14
|
+
* Set the view preferences of a definition
|
|
15
|
+
* `SetViewPreferences`: `POST /view-store/view_preferences/{id}/set-view-preferences`, `POST /view-store/view_preferences/set-view-preferences`.
|
|
16
|
+
* Creates the aggregate, or acts on the one that exists.
|
|
17
|
+
* Produces `ViewPreferencesSet`.
|
|
18
|
+
*/
|
|
19
|
+
setViewPreferences(body: SetViewPreferences, options?: CreateCommandOptions): Promise<CommandResult>;
|
|
20
|
+
/** `SetViewPreferences`, answered as one result per hop of its wait (`text/event-stream`). */
|
|
21
|
+
setViewPreferencesStream(body: SetViewPreferences, options?: CreateCommandOptions): Promise<CommandResultStream>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EventQueryClient, SnapshotQueryClient, StateClient, WowClientOptions } from '@ahoo-wang/wow-client';
|
|
2
|
+
import { ViewPreferencesState } from '../types.js';
|
|
3
|
+
import { ViewPreferencesEvent, ViewPreferencesStateField } from './aggregate.js';
|
|
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> {
|
|
6
|
+
/** @param options - How the service is reached */
|
|
7
|
+
constructor(options?: WowClientOptions);
|
|
8
|
+
}
|
|
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> {
|
|
11
|
+
/** @param options - How the service is reached */
|
|
12
|
+
constructor(options?: WowClientOptions);
|
|
13
|
+
}
|
|
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> {
|
|
16
|
+
/** @param options - How the service is reached */
|
|
17
|
+
constructor(options?: WowClientOptions);
|
|
18
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { WowViewStore, type WowViewStoreOptions } from './wowViewStore.js';
|
|
2
|
-
export { SHARED_OWNER_ID, SYSTEM_OWNER_ID, SYSTEM_TENANT_ID } from './paths.js';
|
|
3
|
-
export { WowViewStoreErrorCodes } from './errors.js';
|
|
4
2
|
export { WowDatasetWordings, type WowDatasetWordingsOptions, } from './datasetWordings.js';
|
|
3
|
+
export { WowViewStoreErrorCodes } from './errors.js';
|
|
4
|
+
export { SHARED_SCOPE, SYSTEM_SCOPE } from './wire.js';
|
|
5
|
+
export { datasetCatalogOf, viewSourceOf } from './source.js';
|
|
6
|
+
export { SHARED_OWNER_ID, SYSTEM_OWNER_ID, SYSTEM_TENANT_ID } from './paths.js';
|