@api-client/core 0.9.14 → 0.9.15
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,3 +1,9 @@
|
|
|
1
|
+
import { IPatchRevision } from "../../events/BaseEvents.js";
|
|
2
|
+
import { IHttpHistory, Kind as HttpHistoryKind } from "../HttpHistory.js";
|
|
3
|
+
import { Kind as ProjectExecutionKind } from "../ProjectExecution.js";
|
|
4
|
+
import { IFile } from "./File.js";
|
|
5
|
+
import { IPermission } from "./Permission.js";
|
|
6
|
+
import { IRevision } from "./Revision.js";
|
|
1
7
|
export type BackendMode = 'single-user' | 'multi-user';
|
|
2
8
|
export interface IBackendInfo {
|
|
3
9
|
/**
|
|
@@ -87,44 +93,93 @@ export interface IBackendCommand {
|
|
|
87
93
|
*/
|
|
88
94
|
value?: unknown;
|
|
89
95
|
}
|
|
90
|
-
export
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
type: 'event';
|
|
95
|
-
/**
|
|
96
|
-
* In most cases an event has data associated with it like the created object or
|
|
97
|
-
* the patch that has been applied to the object.
|
|
98
|
-
* Not set for events related to deleting an object.
|
|
99
|
-
*/
|
|
100
|
-
data?: unknown;
|
|
96
|
+
export type AltType = 'media' | 'meta';
|
|
97
|
+
export declare enum BackendCommandType {
|
|
98
|
+
observe = 0,
|
|
99
|
+
unobserve = 1
|
|
101
100
|
}
|
|
102
|
-
export
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
* - access-removed - when access to an entity was removed.
|
|
114
|
-
* - updated - used in special cases as most communication uses patch. Informs the whole object was updated.
|
|
115
|
-
* - cleared - when the data store was cleared and all entities destroyed.
|
|
116
|
-
*/
|
|
117
|
-
operation: 'created' | 'patch' | 'deleted' | 'access-granted' | 'access-removed' | 'updated' | 'cleared';
|
|
118
|
-
/**
|
|
119
|
-
* The kind of data that has been changed.
|
|
120
|
-
*/
|
|
101
|
+
export declare const BackendCommandKind = "Core#BackendCommand";
|
|
102
|
+
export interface IBackendCommand {
|
|
103
|
+
kind: typeof BackendCommandKind;
|
|
104
|
+
cmd: BackendCommandType;
|
|
105
|
+
}
|
|
106
|
+
export interface IBackendObserveCommand extends IBackendCommand {
|
|
107
|
+
path: string;
|
|
108
|
+
}
|
|
109
|
+
export interface BroadcastEvent {
|
|
110
|
+
type: 'event';
|
|
111
|
+
operation: string;
|
|
121
112
|
kind: string;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
113
|
+
key: string;
|
|
114
|
+
path: string;
|
|
115
|
+
space: string;
|
|
116
|
+
}
|
|
117
|
+
export interface BackendErrorEvent {
|
|
118
|
+
type: 'error';
|
|
119
|
+
cause: string;
|
|
120
|
+
time: number;
|
|
121
|
+
}
|
|
122
|
+
export interface BroadcastCreatedEvent extends BroadcastEvent {
|
|
123
|
+
operation: 'created';
|
|
124
|
+
data: unknown;
|
|
125
|
+
}
|
|
126
|
+
export interface FileCreatedBroadcastEvent extends BroadcastCreatedEvent {
|
|
127
|
+
parent?: string;
|
|
128
|
+
data: unknown;
|
|
129
|
+
alt: AltType;
|
|
130
|
+
}
|
|
131
|
+
export interface FileMetaCreatedBroadcastEvent extends FileCreatedBroadcastEvent {
|
|
132
|
+
data: IFile;
|
|
133
|
+
alt: 'meta';
|
|
134
|
+
}
|
|
135
|
+
export interface FileMediaCreatedBroadcastEvent extends FileCreatedBroadcastEvent {
|
|
136
|
+
alt: 'media';
|
|
137
|
+
}
|
|
138
|
+
export interface HistoryCreatedBroadcastEvent extends BroadcastCreatedEvent {
|
|
139
|
+
project: string;
|
|
140
|
+
request: string;
|
|
141
|
+
app: string;
|
|
142
|
+
kind: typeof HttpHistoryKind;
|
|
143
|
+
data: IHttpHistory;
|
|
144
|
+
}
|
|
145
|
+
export interface FileRevisionCreatedBroadcastEvent extends BroadcastCreatedEvent {
|
|
146
|
+
parent: string;
|
|
147
|
+
data: IRevision;
|
|
148
|
+
alt: AltType;
|
|
149
|
+
}
|
|
150
|
+
export interface ProjectExecutionCreatedBroadcastEvent extends BroadcastCreatedEvent {
|
|
151
|
+
project: string;
|
|
152
|
+
kind: typeof ProjectExecutionKind;
|
|
153
|
+
}
|
|
154
|
+
export interface BroadcastPatchEvent extends BroadcastEvent {
|
|
155
|
+
operation: 'patch';
|
|
156
|
+
data: IPatchRevision;
|
|
157
|
+
}
|
|
158
|
+
export interface FilePatchBroadcastEvent extends BroadcastPatchEvent {
|
|
129
159
|
parent?: string;
|
|
160
|
+
alt: AltType;
|
|
161
|
+
}
|
|
162
|
+
export interface AccessBroadcastEvent extends BroadcastEvent {
|
|
163
|
+
operation: 'access-granted' | 'access-removed';
|
|
164
|
+
data?: IPermission;
|
|
165
|
+
}
|
|
166
|
+
export interface FileAccessBroadcastEvent extends AccessBroadcastEvent {
|
|
167
|
+
parent?: string;
|
|
168
|
+
}
|
|
169
|
+
export interface DeletedBroadcastEvent extends BroadcastEvent {
|
|
170
|
+
operation: 'deleted';
|
|
171
|
+
}
|
|
172
|
+
export interface FileDeletedBroadcastEvent extends DeletedBroadcastEvent {
|
|
173
|
+
parent?: string;
|
|
174
|
+
alt: AltType;
|
|
175
|
+
}
|
|
176
|
+
export interface ProjectExecutionDeleteBroadcastEvent extends DeletedBroadcastEvent {
|
|
177
|
+
project: string;
|
|
178
|
+
}
|
|
179
|
+
export interface HistoryDeletedBroadcastEvent extends DeletedBroadcastEvent {
|
|
180
|
+
project: string;
|
|
181
|
+
request: string;
|
|
182
|
+
}
|
|
183
|
+
export interface ClearedBroadcastEvent extends BroadcastEvent {
|
|
184
|
+
operation: 'cleared';
|
|
130
185
|
}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export var BackendCommandType;
|
|
2
|
+
(function (BackendCommandType) {
|
|
3
|
+
BackendCommandType[BackendCommandType["observe"] = 0] = "observe";
|
|
4
|
+
BackendCommandType[BackendCommandType["unobserve"] = 1] = "unobserve";
|
|
5
|
+
})(BackendCommandType || (BackendCommandType = {}));
|
|
6
|
+
export const BackendCommandKind = 'Core#BackendCommand';
|
|
2
7
|
//# sourceMappingURL=Backend.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Backend.js","sourceRoot":"","sources":["../../../../src/models/store/Backend.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"Backend.js","sourceRoot":"","sources":["../../../../src/models/store/Backend.ts"],"names":[],"mappings":"AAyGA,MAAM,CAAN,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC5B,iEAAO,CAAA;IACP,qEAAS,CAAA;AACX,CAAC,EAHW,kBAAkB,KAAlB,kBAAkB,QAG7B;AAED,MAAM,CAAC,MAAM,kBAAkB,GAAG,qBAAqB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
import { IPatchRevision } from "../../events/BaseEvents.js";
|
|
2
|
+
import { IHttpHistory, Kind as HttpHistoryKind } from "../HttpHistory.js";
|
|
3
|
+
import { Kind as ProjectExecutionKind } from "../ProjectExecution.js";
|
|
4
|
+
import { IFile } from "./File.js";
|
|
5
|
+
import { IPermission } from "./Permission.js";
|
|
6
|
+
import { IRevision } from "./Revision.js";
|
|
7
|
+
|
|
1
8
|
/* eslint-disable import/export */
|
|
2
9
|
export type BackendMode = 'single-user' | 'multi-user';
|
|
3
10
|
|
|
@@ -94,45 +101,119 @@ export interface IBackendCommand {
|
|
|
94
101
|
value?: unknown;
|
|
95
102
|
}
|
|
96
103
|
|
|
97
|
-
export
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* In most cases an event has data associated with it like the created object or
|
|
104
|
-
* the patch that has been applied to the object.
|
|
105
|
-
* Not set for events related to deleting an object.
|
|
106
|
-
*/
|
|
107
|
-
data?: unknown;
|
|
104
|
+
export type AltType = 'media' | 'meta';
|
|
105
|
+
|
|
106
|
+
export enum BackendCommandType {
|
|
107
|
+
observe,
|
|
108
|
+
unobserve,
|
|
108
109
|
}
|
|
109
110
|
|
|
110
|
-
export
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
*/
|
|
125
|
-
operation: 'created' | 'patch' | 'deleted' | 'access-granted' | 'access-removed' | 'updated' | 'cleared';
|
|
126
|
-
/**
|
|
127
|
-
* The kind of data that has been changed.
|
|
128
|
-
*/
|
|
111
|
+
export const BackendCommandKind = 'Core#BackendCommand';
|
|
112
|
+
|
|
113
|
+
export interface IBackendCommand {
|
|
114
|
+
kind: typeof BackendCommandKind;
|
|
115
|
+
cmd: BackendCommandType;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface IBackendObserveCommand extends IBackendCommand {
|
|
119
|
+
path: string; // includes query parameters
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface BroadcastEvent {
|
|
123
|
+
type: 'event';
|
|
124
|
+
operation: string;
|
|
129
125
|
kind: string;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
126
|
+
key: string;
|
|
127
|
+
path: string;
|
|
128
|
+
space: string; // empty string for `/spaces`
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface BackendErrorEvent {
|
|
132
|
+
type: 'error';
|
|
133
|
+
cause: string;
|
|
134
|
+
time: number;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface BroadcastCreatedEvent extends BroadcastEvent {
|
|
138
|
+
operation: 'created';
|
|
139
|
+
data: unknown;
|
|
140
|
+
// path: string; -> /files, /certificates, /history, /project/executions, /spaces, /trash
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface FileCreatedBroadcastEvent extends BroadcastCreatedEvent {
|
|
137
144
|
parent?: string;
|
|
145
|
+
data: unknown;
|
|
146
|
+
alt: AltType;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export interface FileMetaCreatedBroadcastEvent extends FileCreatedBroadcastEvent {
|
|
150
|
+
data: IFile;
|
|
151
|
+
alt: 'meta';
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export interface FileMediaCreatedBroadcastEvent extends FileCreatedBroadcastEvent {
|
|
155
|
+
alt: 'media';
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface HistoryCreatedBroadcastEvent extends BroadcastCreatedEvent {
|
|
159
|
+
project: string;
|
|
160
|
+
request: string;
|
|
161
|
+
app: string;
|
|
162
|
+
kind: typeof HttpHistoryKind;
|
|
163
|
+
data: IHttpHistory;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
export interface FileRevisionCreatedBroadcastEvent extends BroadcastCreatedEvent {
|
|
167
|
+
parent: string;
|
|
168
|
+
data: IRevision;
|
|
169
|
+
alt: AltType;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
export interface ProjectExecutionCreatedBroadcastEvent extends BroadcastCreatedEvent {
|
|
173
|
+
project: string;
|
|
174
|
+
kind: typeof ProjectExecutionKind;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export interface BroadcastPatchEvent extends BroadcastEvent {
|
|
178
|
+
operation: 'patch';
|
|
179
|
+
data: IPatchRevision;
|
|
180
|
+
// path: string; -> /files, /spaces
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export interface FilePatchBroadcastEvent extends BroadcastPatchEvent {
|
|
184
|
+
parent?: string;
|
|
185
|
+
alt: AltType;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface AccessBroadcastEvent extends BroadcastEvent {
|
|
189
|
+
operation: 'access-granted' | 'access-removed';
|
|
190
|
+
data?: IPermission;
|
|
191
|
+
// path: string; -> /files, /spaces, /spaces
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export interface FileAccessBroadcastEvent extends AccessBroadcastEvent {
|
|
195
|
+
parent?: string;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
export interface DeletedBroadcastEvent extends BroadcastEvent {
|
|
199
|
+
operation: 'deleted',
|
|
200
|
+
// path: string; -> /files, /certificates, /history, /project/executions, /spaces, /trash
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export interface FileDeletedBroadcastEvent extends DeletedBroadcastEvent {
|
|
204
|
+
parent?: string;
|
|
205
|
+
alt: AltType;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
export interface ProjectExecutionDeleteBroadcastEvent extends DeletedBroadcastEvent {
|
|
209
|
+
project: string;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
export interface HistoryDeletedBroadcastEvent extends DeletedBroadcastEvent {
|
|
213
|
+
project: string;
|
|
214
|
+
request: string;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export interface ClearedBroadcastEvent extends BroadcastEvent {
|
|
218
|
+
operation: 'cleared';
|
|
138
219
|
}
|