@api-client/core 0.9.14 → 0.9.16
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
|
/**
|
|
@@ -73,58 +79,93 @@ export interface IBackendInfo {
|
|
|
73
79
|
socket?: string;
|
|
74
80
|
};
|
|
75
81
|
}
|
|
82
|
+
export type AltType = 'media' | 'meta';
|
|
83
|
+
export declare enum BackendCommandType {
|
|
84
|
+
observe = 0,
|
|
85
|
+
unobserve = 1
|
|
86
|
+
}
|
|
87
|
+
export declare const BackendCommandKind = "Core#BackendCommand";
|
|
76
88
|
export interface IBackendCommand {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
*/
|
|
80
|
-
path?: string;
|
|
81
|
-
/**
|
|
82
|
-
* The operation to perform
|
|
83
|
-
*/
|
|
84
|
-
operation: 'delete' | 'patch' | 'create';
|
|
85
|
-
/**
|
|
86
|
-
* The command data.
|
|
87
|
-
*/
|
|
88
|
-
value?: unknown;
|
|
89
|
+
kind: typeof BackendCommandKind;
|
|
90
|
+
cmd: BackendCommandType;
|
|
89
91
|
}
|
|
90
|
-
export interface
|
|
91
|
-
|
|
92
|
-
* The message type. Usually it is an `event`, meaning, a data change notification.
|
|
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;
|
|
92
|
+
export interface IBackendObserveCommand extends IBackendCommand {
|
|
93
|
+
path: string;
|
|
101
94
|
}
|
|
102
|
-
export interface
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
*
|
|
106
|
-
* Note, `updated` is when the entire object must be revalidated in the opposite
|
|
107
|
-
* to `patch` where the patch should be applied to the object.
|
|
108
|
-
*
|
|
109
|
-
* - created - when an entity was created
|
|
110
|
-
* - patch - when a patch operation was applied to an entity
|
|
111
|
-
* - deleted - when an entity was deleted
|
|
112
|
-
* - access-granted - when access to an entity was granted. This also includes when the access level change.
|
|
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
|
-
*/
|
|
95
|
+
export interface BroadcastEvent {
|
|
96
|
+
type: 'event';
|
|
97
|
+
operation: string;
|
|
121
98
|
kind: string;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
99
|
+
key: string;
|
|
100
|
+
path: string;
|
|
101
|
+
space: string;
|
|
102
|
+
}
|
|
103
|
+
export interface BackendErrorEvent {
|
|
104
|
+
type: 'error';
|
|
105
|
+
cause: string;
|
|
106
|
+
time: number;
|
|
107
|
+
}
|
|
108
|
+
export interface BroadcastCreatedEvent extends BroadcastEvent {
|
|
109
|
+
operation: 'created';
|
|
110
|
+
data: unknown;
|
|
111
|
+
}
|
|
112
|
+
export interface FileCreatedBroadcastEvent extends BroadcastCreatedEvent {
|
|
129
113
|
parent?: string;
|
|
114
|
+
data: unknown;
|
|
115
|
+
alt: AltType;
|
|
116
|
+
}
|
|
117
|
+
export interface FileMetaCreatedBroadcastEvent extends FileCreatedBroadcastEvent {
|
|
118
|
+
data: IFile;
|
|
119
|
+
alt: 'meta';
|
|
120
|
+
}
|
|
121
|
+
export interface FileMediaCreatedBroadcastEvent extends FileCreatedBroadcastEvent {
|
|
122
|
+
alt: 'media';
|
|
123
|
+
}
|
|
124
|
+
export interface HistoryCreatedBroadcastEvent extends BroadcastCreatedEvent {
|
|
125
|
+
project: string;
|
|
126
|
+
request: string;
|
|
127
|
+
app: string;
|
|
128
|
+
kind: typeof HttpHistoryKind;
|
|
129
|
+
data: IHttpHistory;
|
|
130
|
+
}
|
|
131
|
+
export interface FileRevisionCreatedBroadcastEvent extends BroadcastCreatedEvent {
|
|
132
|
+
parent: string;
|
|
133
|
+
data: IRevision;
|
|
134
|
+
alt: AltType;
|
|
135
|
+
}
|
|
136
|
+
export interface ProjectExecutionCreatedBroadcastEvent extends BroadcastCreatedEvent {
|
|
137
|
+
project: string;
|
|
138
|
+
kind: typeof ProjectExecutionKind;
|
|
139
|
+
}
|
|
140
|
+
export interface BroadcastPatchEvent extends BroadcastEvent {
|
|
141
|
+
operation: 'patch';
|
|
142
|
+
data: IPatchRevision;
|
|
143
|
+
}
|
|
144
|
+
export interface FilePatchBroadcastEvent extends BroadcastPatchEvent {
|
|
145
|
+
parent?: string;
|
|
146
|
+
alt: AltType;
|
|
147
|
+
}
|
|
148
|
+
export interface AccessBroadcastEvent extends BroadcastEvent {
|
|
149
|
+
operation: 'access-granted' | 'access-removed';
|
|
150
|
+
data?: IPermission;
|
|
151
|
+
}
|
|
152
|
+
export interface FileAccessBroadcastEvent extends AccessBroadcastEvent {
|
|
153
|
+
parent?: string;
|
|
154
|
+
}
|
|
155
|
+
export interface DeletedBroadcastEvent extends BroadcastEvent {
|
|
156
|
+
operation: 'deleted';
|
|
157
|
+
}
|
|
158
|
+
export interface FileDeletedBroadcastEvent extends DeletedBroadcastEvent {
|
|
159
|
+
parent?: string;
|
|
160
|
+
alt: AltType;
|
|
161
|
+
}
|
|
162
|
+
export interface ProjectExecutionDeleteBroadcastEvent extends DeletedBroadcastEvent {
|
|
163
|
+
project: string;
|
|
164
|
+
}
|
|
165
|
+
export interface HistoryDeletedBroadcastEvent extends DeletedBroadcastEvent {
|
|
166
|
+
project: string;
|
|
167
|
+
request: string;
|
|
168
|
+
}
|
|
169
|
+
export interface ClearedBroadcastEvent extends BroadcastEvent {
|
|
170
|
+
operation: 'cleared';
|
|
130
171
|
}
|
|
@@ -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":"AA0FA,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
|
|
|
@@ -79,60 +86,119 @@ export interface IBackendInfo {
|
|
|
79
86
|
}
|
|
80
87
|
}
|
|
81
88
|
|
|
89
|
+
export type AltType = 'media' | 'meta';
|
|
90
|
+
|
|
91
|
+
export enum BackendCommandType {
|
|
92
|
+
observe,
|
|
93
|
+
unobserve,
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export const BackendCommandKind = 'Core#BackendCommand';
|
|
97
|
+
|
|
82
98
|
export interface IBackendCommand {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
*/
|
|
86
|
-
path?: string;
|
|
87
|
-
/**
|
|
88
|
-
* The operation to perform
|
|
89
|
-
*/
|
|
90
|
-
operation: 'delete' | 'patch' | 'create';
|
|
91
|
-
/**
|
|
92
|
-
* The command data.
|
|
93
|
-
*/
|
|
94
|
-
value?: unknown;
|
|
99
|
+
kind: typeof BackendCommandKind;
|
|
100
|
+
cmd: BackendCommandType;
|
|
95
101
|
}
|
|
96
102
|
|
|
97
|
-
export interface
|
|
98
|
-
|
|
99
|
-
* The message type. Usually it is an `event`, meaning, a data change notification.
|
|
100
|
-
*/
|
|
101
|
-
type: 'event';
|
|
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;
|
|
103
|
+
export interface IBackendObserveCommand extends IBackendCommand {
|
|
104
|
+
path: string; // includes query parameters
|
|
108
105
|
}
|
|
109
106
|
|
|
110
|
-
export interface
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
*
|
|
114
|
-
* Note, `updated` is when the entire object must be revalidated in the opposite
|
|
115
|
-
* to `patch` where the patch should be applied to the object.
|
|
116
|
-
*
|
|
117
|
-
* - created - when an entity was created
|
|
118
|
-
* - patch - when a patch operation was applied to an entity
|
|
119
|
-
* - deleted - when an entity was deleted
|
|
120
|
-
* - access-granted - when access to an entity was granted. This also includes when the access level change.
|
|
121
|
-
* - access-removed - when access to an entity was removed.
|
|
122
|
-
* - updated - used in special cases as most communication uses patch. Informs the whole object was updated.
|
|
123
|
-
* - cleared - when the data store was cleared and all entities destroyed.
|
|
124
|
-
*/
|
|
125
|
-
operation: 'created' | 'patch' | 'deleted' | 'access-granted' | 'access-removed' | 'updated' | 'cleared';
|
|
126
|
-
/**
|
|
127
|
-
* The kind of data that has been changed.
|
|
128
|
-
*/
|
|
107
|
+
export interface BroadcastEvent {
|
|
108
|
+
type: 'event';
|
|
109
|
+
operation: string;
|
|
129
110
|
kind: string;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
111
|
+
key: string;
|
|
112
|
+
path: string;
|
|
113
|
+
space: string; // empty string for `/spaces`
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export interface BackendErrorEvent {
|
|
117
|
+
type: 'error';
|
|
118
|
+
cause: string;
|
|
119
|
+
time: number;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface BroadcastCreatedEvent extends BroadcastEvent {
|
|
123
|
+
operation: 'created';
|
|
124
|
+
data: unknown;
|
|
125
|
+
// path: string; -> /files, /certificates, /history, /project/executions, /spaces, /trash
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
export interface FileCreatedBroadcastEvent extends BroadcastCreatedEvent {
|
|
129
|
+
parent?: string;
|
|
130
|
+
data: unknown;
|
|
131
|
+
alt: AltType;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
export interface FileMetaCreatedBroadcastEvent extends FileCreatedBroadcastEvent {
|
|
135
|
+
data: IFile;
|
|
136
|
+
alt: 'meta';
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
export interface FileMediaCreatedBroadcastEvent extends FileCreatedBroadcastEvent {
|
|
140
|
+
alt: 'media';
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export interface HistoryCreatedBroadcastEvent extends BroadcastCreatedEvent {
|
|
144
|
+
project: string;
|
|
145
|
+
request: string;
|
|
146
|
+
app: string;
|
|
147
|
+
kind: typeof HttpHistoryKind;
|
|
148
|
+
data: IHttpHistory;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export interface FileRevisionCreatedBroadcastEvent extends BroadcastCreatedEvent {
|
|
152
|
+
parent: string;
|
|
153
|
+
data: IRevision;
|
|
154
|
+
alt: AltType;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export interface ProjectExecutionCreatedBroadcastEvent extends BroadcastCreatedEvent {
|
|
158
|
+
project: string;
|
|
159
|
+
kind: typeof ProjectExecutionKind;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export interface BroadcastPatchEvent extends BroadcastEvent {
|
|
163
|
+
operation: 'patch';
|
|
164
|
+
data: IPatchRevision;
|
|
165
|
+
// path: string; -> /files, /spaces
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
export interface FilePatchBroadcastEvent extends BroadcastPatchEvent {
|
|
137
169
|
parent?: string;
|
|
170
|
+
alt: AltType;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export interface AccessBroadcastEvent extends BroadcastEvent {
|
|
174
|
+
operation: 'access-granted' | 'access-removed';
|
|
175
|
+
data?: IPermission;
|
|
176
|
+
// path: string; -> /files, /spaces, /spaces
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export interface FileAccessBroadcastEvent extends AccessBroadcastEvent {
|
|
180
|
+
parent?: string;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export interface DeletedBroadcastEvent extends BroadcastEvent {
|
|
184
|
+
operation: 'deleted',
|
|
185
|
+
// path: string; -> /files, /certificates, /history, /project/executions, /spaces, /trash
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export interface FileDeletedBroadcastEvent extends DeletedBroadcastEvent {
|
|
189
|
+
parent?: string;
|
|
190
|
+
alt: AltType;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export interface ProjectExecutionDeleteBroadcastEvent extends DeletedBroadcastEvent {
|
|
194
|
+
project: string;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export interface HistoryDeletedBroadcastEvent extends DeletedBroadcastEvent {
|
|
198
|
+
project: string;
|
|
199
|
+
request: string;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export interface ClearedBroadcastEvent extends BroadcastEvent {
|
|
203
|
+
operation: 'cleared';
|
|
138
204
|
}
|