@api-client/core 0.8.21 → 0.9.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.
- package/build/browser.d.ts +12 -5
- package/build/browser.js +2 -3
- package/build/browser.js.map +1 -1
- package/build/index.d.ts +12 -5
- package/build/index.js +2 -4
- package/build/index.js.map +1 -1
- package/build/src/events/BaseEvents.d.ts +125 -18
- package/build/src/events/BaseEvents.js.map +1 -1
- package/build/src/events/EventTypes.d.ts +0 -14
- package/build/src/events/EventTypes.js +0 -2
- package/build/src/events/EventTypes.js.map +1 -1
- package/build/src/events/Events.d.ts +1 -5
- package/build/src/events/Events.js +0 -2
- package/build/src/events/Events.js.map +1 -1
- package/build/src/events/transport/TransportEventTypes.d.ts +0 -1
- package/build/src/events/transport/TransportEventTypes.js +0 -1
- package/build/src/events/transport/TransportEventTypes.js.map +1 -1
- package/build/src/events/transport/TransportEvents.d.ts +0 -8
- package/build/src/events/transport/TransportEvents.js +0 -11
- package/build/src/events/transport/TransportEvents.js.map +1 -1
- package/build/src/mocking/ProjectMock.d.ts +0 -3
- package/build/src/mocking/ProjectMock.js +0 -3
- package/build/src/mocking/ProjectMock.js.map +1 -1
- package/build/src/mocking/lib/History.js +5 -0
- package/build/src/mocking/lib/History.js.map +1 -1
- package/build/src/models/{Workspace.d.ts → Folder.d.ts} +7 -7
- package/build/src/models/{Workspace.js → Folder.js} +5 -5
- package/build/src/models/Folder.js.map +1 -0
- package/build/src/models/HttpHistory.d.ts +38 -43
- package/build/src/models/HttpHistory.js +27 -34
- package/build/src/models/HttpHistory.js.map +1 -1
- package/build/src/models/HttpProject.d.ts +0 -2
- package/build/src/models/HttpProject.js +0 -27
- package/build/src/models/HttpProject.js.map +1 -1
- package/build/src/models/Project.d.ts +0 -8
- package/build/src/models/Project.js +0 -4
- package/build/src/models/Project.js.map +1 -1
- package/build/src/models/ProjectFolder.d.ts +0 -2
- package/build/src/models/ProjectFolder.js +0 -14
- package/build/src/models/ProjectFolder.js.map +1 -1
- package/build/src/models/ProjectItem.d.ts +0 -2
- package/build/src/models/ProjectItem.js +0 -20
- package/build/src/models/ProjectItem.js.map +1 -1
- package/build/src/models/ProjectRequest.d.ts +2 -3
- package/build/src/models/ProjectRequest.js.map +1 -1
- package/build/src/models/RequestConfig.d.ts +1 -1
- package/build/src/models/Space.d.ts +42 -0
- package/build/src/models/Space.js +81 -0
- package/build/src/models/Space.js.map +1 -0
- package/build/src/models/TrashEntry.d.ts +27 -0
- package/build/src/models/TrashEntry.js +2 -0
- package/build/src/models/TrashEntry.js.map +1 -0
- package/build/src/models/data/DataAssociation.d.ts +22 -5
- package/build/src/models/data/DataAssociation.js +29 -11
- package/build/src/models/data/DataAssociation.js.map +1 -1
- package/build/src/models/data/DataEntity.d.ts +12 -1
- package/build/src/models/data/DataEntity.js +49 -10
- package/build/src/models/data/DataEntity.js.map +1 -1
- package/build/src/models/data/DataNamespace.d.ts +34 -1
- package/build/src/models/data/DataNamespace.js +75 -1
- package/build/src/models/data/DataNamespace.js.map +1 -1
- package/build/src/models/store/Backend.d.ts +0 -315
- package/build/src/models/store/Backend.js +0 -1
- package/build/src/models/store/Backend.js.map +1 -1
- package/build/src/models/store/File.d.ts +30 -0
- package/build/src/models/store/File.js +5 -5
- package/build/src/models/store/File.js.map +1 -1
- package/build/src/proxy/ProxyService.d.ts +0 -10
- package/build/src/proxy/ProxyService.js +0 -14
- package/build/src/proxy/ProxyService.js.map +1 -1
- package/build/src/runtime/node/InteropInterfaces.d.ts +1 -2
- package/build/src/runtime/node/ProjectParallelRunner.d.ts +2 -3
- package/build/src/runtime/node/ProjectParallelRunner.js.map +1 -1
- package/build/src/runtime/node/ProjectRequestRunner.d.ts +7 -8
- package/build/src/runtime/node/ProjectRequestRunner.js +2 -3
- package/build/src/runtime/node/ProjectRequestRunner.js.map +1 -1
- package/build/src/runtime/node/ProjectRunner.d.ts +3 -4
- package/build/src/runtime/node/ProjectRunner.js.map +1 -1
- package/build/src/runtime/node/ProjectRunnerWorker.js +0 -4
- package/build/src/runtime/node/ProjectRunnerWorker.js.map +1 -1
- package/build/src/runtime/store/CertificatesSdk.d.ts +46 -0
- package/build/src/runtime/store/CertificatesSdk.js +227 -0
- package/build/src/runtime/store/CertificatesSdk.js.map +1 -0
- package/build/src/runtime/store/FilesSdk.d.ts +14 -9
- package/build/src/runtime/store/FilesSdk.js +60 -16
- package/build/src/runtime/store/FilesSdk.js.map +1 -1
- package/build/src/runtime/store/HistorySdk.d.ts +11 -8
- package/build/src/runtime/store/HistorySdk.js +140 -17
- package/build/src/runtime/store/HistorySdk.js.map +1 -1
- package/build/src/runtime/store/RevisionsSdk.d.ts +12 -0
- package/build/src/runtime/store/RevisionsSdk.js +43 -0
- package/build/src/runtime/store/RevisionsSdk.js.map +1 -0
- package/build/src/runtime/store/RouteBuilder.d.ts +16 -18
- package/build/src/runtime/store/RouteBuilder.js +33 -60
- package/build/src/runtime/store/RouteBuilder.js.map +1 -1
- package/build/src/runtime/store/Sdk.d.ts +10 -7
- package/build/src/runtime/store/Sdk.js +12 -5
- package/build/src/runtime/store/Sdk.js.map +1 -1
- package/build/src/runtime/store/SdkBase.js.map +1 -1
- package/build/src/runtime/store/SharedSdk.d.ts +2 -2
- package/build/src/runtime/store/SharedSdk.js.map +1 -1
- package/build/src/runtime/store/SpacesSdk.d.ts +29 -0
- package/build/src/runtime/store/SpacesSdk.js +135 -0
- package/build/src/runtime/store/SpacesSdk.js.map +1 -0
- package/build/src/runtime/store/TrashSdk.d.ts +35 -0
- package/build/src/runtime/store/TrashSdk.js +155 -0
- package/build/src/runtime/store/TrashSdk.js.map +1 -0
- package/build/src/runtime/store/UsersSdk.d.ts +2 -2
- package/build/src/runtime/store/UsersSdk.js.map +1 -1
- package/build/src/runtime/store/interfaces/ApiClientStore.d.ts +30 -0
- package/build/src/runtime/store/interfaces/ApiClientStore.js +2 -0
- package/build/src/runtime/store/interfaces/ApiClientStore.js.map +1 -0
- package/build/src/runtime/store/interfaces/Certificates.d.ts +49 -0
- package/build/src/runtime/store/interfaces/Certificates.js +2 -0
- package/build/src/runtime/store/interfaces/Certificates.js.map +1 -0
- package/build/src/runtime/store/interfaces/Files.d.ts +63 -0
- package/build/src/runtime/store/interfaces/Files.js +2 -0
- package/build/src/runtime/store/interfaces/Files.js.map +1 -0
- package/build/src/runtime/store/interfaces/History.d.ts +63 -0
- package/build/src/runtime/store/interfaces/History.js +2 -0
- package/build/src/runtime/store/interfaces/History.js.map +1 -0
- package/build/src/runtime/store/interfaces/Media.d.ts +42 -0
- package/build/src/runtime/store/interfaces/Media.js +2 -0
- package/build/src/runtime/store/interfaces/Media.js.map +1 -0
- package/build/src/runtime/store/interfaces/Revisions.d.ts +25 -0
- package/build/src/runtime/store/interfaces/Revisions.js +2 -0
- package/build/src/runtime/store/interfaces/Revisions.js.map +1 -0
- package/build/src/runtime/store/interfaces/Spaces.d.ts +42 -0
- package/build/src/runtime/store/interfaces/Spaces.js +2 -0
- package/build/src/runtime/store/interfaces/Spaces.js.map +1 -0
- package/build/src/runtime/store/interfaces/Trash.d.ts +38 -0
- package/build/src/runtime/store/interfaces/Trash.js +2 -0
- package/build/src/runtime/store/interfaces/Trash.js.map +1 -0
- package/package.json +12 -12
- package/src/events/BaseEvents.ts +136 -18
- package/src/events/EventTypes.ts +0 -2
- package/src/events/Events.ts +0 -2
- package/src/events/transport/TransportEventTypes.ts +0 -1
- package/src/events/transport/TransportEvents.ts +0 -13
- package/src/mocking/ProjectMock.ts +0 -4
- package/src/mocking/lib/History.ts +5 -0
- package/src/models/{Workspace.ts → Folder.ts} +12 -12
- package/src/models/HttpHistory.ts +53 -63
- package/src/models/HttpProject.ts +0 -29
- package/src/models/Project.ts +0 -8
- package/src/models/ProjectFolder.ts +0 -16
- package/src/models/ProjectItem.ts +0 -18
- package/src/models/ProjectRequest.ts +3 -4
- package/src/models/RequestConfig.ts +1 -1
- package/src/models/Space.ts +105 -0
- package/src/models/TrashEntry.ts +29 -0
- package/src/models/data/DataAssociation.ts +50 -15
- package/src/models/data/DataEntity.ts +51 -10
- package/src/models/data/DataNamespace.ts +78 -2
- package/src/models/store/Backend.ts +0 -342
- package/src/models/store/File.ts +38 -5
- package/src/proxy/ProxyService.ts +0 -15
- package/src/proxy/readme.md +0 -1
- package/src/runtime/node/InteropInterfaces.ts +1 -2
- package/src/runtime/node/ProjectParallelRunner.ts +2 -3
- package/src/runtime/node/ProjectRequestRunner.ts +13 -14
- package/src/runtime/node/ProjectRunner.ts +3 -4
- package/src/runtime/node/ProjectRunnerWorker.ts +1 -4
- package/src/runtime/store/CertificatesSdk.ts +231 -0
- package/src/runtime/store/FilesSdk.ts +71 -26
- package/src/runtime/store/HistorySdk.ts +145 -33
- package/src/runtime/store/RevisionsSdk.ts +44 -0
- package/src/runtime/store/RouteBuilder.ts +37 -69
- package/src/runtime/store/Sdk.ts +17 -7
- package/src/runtime/store/SdkBase.ts +1 -1
- package/src/runtime/store/SharedSdk.ts +3 -3
- package/src/runtime/store/SpacesSdk.ts +136 -0
- package/src/runtime/store/TrashSdk.ts +159 -0
- package/src/runtime/store/UsersSdk.ts +3 -3
- package/src/runtime/store/interfaces/ApiClientStore.ts +39 -0
- package/src/runtime/store/interfaces/Certificates.ts +56 -0
- package/src/runtime/store/interfaces/Files.ts +70 -0
- package/src/runtime/store/interfaces/History.ts +64 -0
- package/src/runtime/store/interfaces/Media.ts +46 -0
- package/src/runtime/store/interfaces/Revisions.ts +27 -0
- package/src/runtime/store/interfaces/Spaces.ts +48 -0
- package/src/runtime/store/interfaces/Trash.ts +42 -0
- package/build/src/events/models/ClientCertificateEvents.d.ts +0 -54
- package/build/src/events/models/ClientCertificateEvents.js +0 -78
- package/build/src/events/models/ClientCertificateEvents.js.map +0 -1
- package/build/src/events/models/ModelEventTypes.d.ts +0 -13
- package/build/src/events/models/ModelEventTypes.js +0 -14
- package/build/src/events/models/ModelEventTypes.js.map +0 -1
- package/build/src/events/models/ModelEvents.d.ts +0 -4
- package/build/src/events/models/ModelEvents.js +0 -5
- package/build/src/events/models/ModelEvents.js.map +0 -1
- package/build/src/mocking/lib/App.d.ts +0 -36
- package/build/src/mocking/lib/App.js +0 -70
- package/build/src/mocking/lib/App.js.map +0 -1
- package/build/src/models/AppProject.d.ts +0 -817
- package/build/src/models/AppProject.js +0 -1721
- package/build/src/models/AppProject.js.map +0 -1
- package/build/src/models/AppRequest.d.ts +0 -69
- package/build/src/models/AppRequest.js +0 -150
- package/build/src/models/AppRequest.js.map +0 -1
- package/build/src/models/Workspace.js.map +0 -1
- package/build/src/proxy/AppProjectProxy.d.ts +0 -28
- package/build/src/proxy/AppProjectProxy.js +0 -107
- package/build/src/proxy/AppProjectProxy.js.map +0 -1
- package/build/src/runtime/store/AppSdk.d.ts +0 -213
- package/build/src/runtime/store/AppSdk.js +0 -836
- package/build/src/runtime/store/AppSdk.js.map +0 -1
- package/src/events/models/ClientCertificateEvents.ts +0 -85
- package/src/events/models/ModelEventTypes.ts +0 -13
- package/src/events/models/ModelEvents.ts +0 -5
- package/src/mocking/lib/App.ts +0 -101
- package/src/models/AppProject.ts +0 -2188
- package/src/models/AppRequest.ts +0 -176
- package/src/proxy/AppProjectProxy.ts +0 -126
- package/src/runtime/store/AppSdk.ts +0 -842
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
/* eslint-disable import/export */
|
|
2
|
-
|
|
3
|
-
import { JsonPatch } from '@api-client/json'
|
|
4
|
-
import { AccessOperation } from './Permission.js';
|
|
5
|
-
|
|
6
2
|
export type BackendMode = 'single-user' | 'multi-user';
|
|
7
3
|
|
|
8
4
|
export interface IBackendInfo {
|
|
@@ -140,341 +136,3 @@ export interface IBackendEvent extends IBackendMessage {
|
|
|
140
136
|
*/
|
|
141
137
|
parent?: string;
|
|
142
138
|
}
|
|
143
|
-
|
|
144
|
-
export interface IListResponse<T = unknown> {
|
|
145
|
-
/**
|
|
146
|
-
* The cursor to use with the next query.
|
|
147
|
-
* Not set when no more results.
|
|
148
|
-
*/
|
|
149
|
-
cursor?: string;
|
|
150
|
-
/**
|
|
151
|
-
* The list of objects returned from the store.
|
|
152
|
-
*/
|
|
153
|
-
items: T[];
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
export interface IQueryResponse<T = unknown> {
|
|
157
|
-
/**
|
|
158
|
-
* An ordered list of results.
|
|
159
|
-
*/
|
|
160
|
-
items: IQueryResult<T>[];
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
export interface IQueryResult<T = unknown> {
|
|
164
|
-
/**
|
|
165
|
-
* The document.
|
|
166
|
-
*/
|
|
167
|
-
doc: T;
|
|
168
|
-
/**
|
|
169
|
-
* The list of indexes where this document was found.
|
|
170
|
-
*/
|
|
171
|
-
index: string[];
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
export interface IListOptions {
|
|
175
|
-
/**
|
|
176
|
-
* Page cursor to use with the query.
|
|
177
|
-
*/
|
|
178
|
-
cursor?: string;
|
|
179
|
-
/**
|
|
180
|
-
* Number of items in the result.
|
|
181
|
-
* Ignored when `cursor` is set.
|
|
182
|
-
*
|
|
183
|
-
* Note, when changing the number of items in the result
|
|
184
|
-
* you need to start listing over again.
|
|
185
|
-
*/
|
|
186
|
-
limit?: number;
|
|
187
|
-
/**
|
|
188
|
-
* Supported by some endpoints. When set it performs a query on the data store.
|
|
189
|
-
*/
|
|
190
|
-
query?: string;
|
|
191
|
-
/**
|
|
192
|
-
* Only with the `query` property. Tells the system in which fields to search for the query term.
|
|
193
|
-
*/
|
|
194
|
-
queryField?: string[];
|
|
195
|
-
/**
|
|
196
|
-
* General purpose type property to filer the results.
|
|
197
|
-
* This is used, for example, by the history store to list history for a specific type of requests,
|
|
198
|
-
*/
|
|
199
|
-
type?: string;
|
|
200
|
-
/**
|
|
201
|
-
* Whether the list should contain children of a parent.
|
|
202
|
-
* This is a key of the parent.
|
|
203
|
-
*/
|
|
204
|
-
parent?: string;
|
|
205
|
-
/**
|
|
206
|
-
* Used when synchronizing data in the local store with the data stored in the net-store.
|
|
207
|
-
* The timestamp when the last synchronization was performed. The resulting array will contain only items that
|
|
208
|
-
* have been updated since that date.
|
|
209
|
-
*/
|
|
210
|
-
since?: number;
|
|
211
|
-
}
|
|
212
|
-
|
|
213
|
-
export interface ICursorOptions {
|
|
214
|
-
/**
|
|
215
|
-
* Page cursor to use with the query.
|
|
216
|
-
*/
|
|
217
|
-
cursor?: string;
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
/**
|
|
221
|
-
* Listing options for the HTTP history.
|
|
222
|
-
*/
|
|
223
|
-
export type HistoryListOptions = IHistorySpaceListOptions | IHistoryProjectListOptions | IHistoryRequestListOptions | IHistoryUserListOptions | IHistoryAppListOptions;
|
|
224
|
-
|
|
225
|
-
/**
|
|
226
|
-
* Query options to list history for a user space.
|
|
227
|
-
* The user has to have access to the user space to read / create / delete the history.
|
|
228
|
-
*/
|
|
229
|
-
export interface IHistorySpaceListOptions extends IListOptions {
|
|
230
|
-
type: 'space';
|
|
231
|
-
/**
|
|
232
|
-
* The id of the space.
|
|
233
|
-
*/
|
|
234
|
-
id: string;
|
|
235
|
-
/**
|
|
236
|
-
* Whether to limit the list of results to the history that belongs to the current user.
|
|
237
|
-
*/
|
|
238
|
-
user?: boolean;
|
|
239
|
-
}
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* Query options to list history for an HTTP project.
|
|
243
|
-
* The user has to have access to the parent user space to read / create / delete the history.
|
|
244
|
-
*/
|
|
245
|
-
export interface IHistoryProjectListOptions extends IListOptions {
|
|
246
|
-
type: 'project';
|
|
247
|
-
/**
|
|
248
|
-
* The id of the project.
|
|
249
|
-
*/
|
|
250
|
-
id: string;
|
|
251
|
-
/**
|
|
252
|
-
* Whether to limit the list of results to the history that belongs to the current user.
|
|
253
|
-
*/
|
|
254
|
-
user?: boolean;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Query options to list history for a request in a project.
|
|
259
|
-
* The user has to have access to the parent user space to read / create / delete the history.
|
|
260
|
-
*/
|
|
261
|
-
export interface IHistoryRequestListOptions extends IListOptions {
|
|
262
|
-
type: 'request';
|
|
263
|
-
/**
|
|
264
|
-
* The id of the project that contains the request.
|
|
265
|
-
*/
|
|
266
|
-
project: string;
|
|
267
|
-
/**
|
|
268
|
-
* The id of the request.
|
|
269
|
-
*/
|
|
270
|
-
id: string;
|
|
271
|
-
/**
|
|
272
|
-
* Whether to limit the list of results to the history that belongs to the current user.
|
|
273
|
-
*/
|
|
274
|
-
user?: boolean;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* Query options to list history for a user. This targets lists all user history. If you need to
|
|
279
|
-
* filter the user history use other interfaces with the `user` flag set.
|
|
280
|
-
*/
|
|
281
|
-
export interface IHistoryUserListOptions extends IListOptions {
|
|
282
|
-
type: 'user';
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* Query options to list history for a history object that was created by an application that has no concept
|
|
287
|
-
* of user spaces. In this case the queries are always made against the current user.
|
|
288
|
-
*/
|
|
289
|
-
export interface IHistoryAppListOptions extends IListOptions {
|
|
290
|
-
type: 'app';
|
|
291
|
-
/**
|
|
292
|
-
* The id of the application.
|
|
293
|
-
* These queries are always made for a user.
|
|
294
|
-
*/
|
|
295
|
-
id: string;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
export interface IPatchBase {
|
|
299
|
-
/**
|
|
300
|
-
* Auto generated by the client sending the PATCH.
|
|
301
|
-
*/
|
|
302
|
-
id: string;
|
|
303
|
-
/**
|
|
304
|
-
* The application id that generated the patch.
|
|
305
|
-
* This is a string that is assigned to each application in the suite.
|
|
306
|
-
* External applications need to use a constant string for their apps.
|
|
307
|
-
*/
|
|
308
|
-
app: string;
|
|
309
|
-
/**
|
|
310
|
-
* The version of the application that generated the patch.
|
|
311
|
-
* This can and will be used to handle potential differences between suite applications.
|
|
312
|
-
*/
|
|
313
|
-
appVersion: string;
|
|
314
|
-
/**
|
|
315
|
-
* The patch generated by the client.
|
|
316
|
-
*/
|
|
317
|
-
patch: unknown;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
/**
|
|
321
|
-
* An interface describing a schema to be sent to the server
|
|
322
|
-
* when making a patch of a file.
|
|
323
|
-
*/
|
|
324
|
-
export interface IPatchInfo extends IPatchBase {
|
|
325
|
-
/**
|
|
326
|
-
* The patch generated by the client.
|
|
327
|
-
*/
|
|
328
|
-
patch: JsonPatch;
|
|
329
|
-
}
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* An interface describing a schema to be sent to the server
|
|
333
|
-
* when making a patch with user access to a file.
|
|
334
|
-
*/
|
|
335
|
-
export interface IAccessPatchInfo extends IPatchBase {
|
|
336
|
-
/**
|
|
337
|
-
* The patch generated by the client.
|
|
338
|
-
*/
|
|
339
|
-
patch: AccessOperation[];
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
/**
|
|
343
|
-
* A schema sent by the store server in a response to the patch request.
|
|
344
|
-
* It contains an information about the applied patch, the reverse operation associated with it,
|
|
345
|
-
* application information, and the generated by the client patch id.
|
|
346
|
-
*/
|
|
347
|
-
export interface IPatchRevision extends IPatchInfo {
|
|
348
|
-
/**
|
|
349
|
-
* The patch to apply to the object to revert the changes.
|
|
350
|
-
*/
|
|
351
|
-
revert: JsonPatch;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
/**
|
|
355
|
-
* Describes a batch read operation body.
|
|
356
|
-
*/
|
|
357
|
-
export interface IBatchRead {
|
|
358
|
-
/**
|
|
359
|
-
* The keys of the items to read. The response has the ordered list of results.
|
|
360
|
-
*/
|
|
361
|
-
items: string[];
|
|
362
|
-
}
|
|
363
|
-
|
|
364
|
-
/**
|
|
365
|
-
* Describes a result of the batch read operation body.
|
|
366
|
-
*/
|
|
367
|
-
export interface IBatchReadResult<T = unknown> {
|
|
368
|
-
/**
|
|
369
|
-
* The ordered list of read entities.
|
|
370
|
-
* Each element can be null/undefined when the item cannot be read.
|
|
371
|
-
*
|
|
372
|
-
* The batch operation does not return specific errors. Use the direct read operation
|
|
373
|
-
* for the detailed error.
|
|
374
|
-
*/
|
|
375
|
-
items: (T | null | undefined)[];
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
/**
|
|
379
|
-
* Describes a batch update/create operation body.
|
|
380
|
-
*/
|
|
381
|
-
export interface IBatchUpdate<T = unknown> {
|
|
382
|
-
/**
|
|
383
|
-
* The items to add or update in a batch operation.
|
|
384
|
-
*/
|
|
385
|
-
items: T[];
|
|
386
|
-
/**
|
|
387
|
-
* The optional key of the parent object of the created/updated items.
|
|
388
|
-
*/
|
|
389
|
-
parent?: string;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
/**
|
|
393
|
-
* Describes a result of the batch update/create operation body.
|
|
394
|
-
*/
|
|
395
|
-
export interface IBatchUpdateResult<T = unknown> {
|
|
396
|
-
/**
|
|
397
|
-
* The ordered list of create/update result for each item.
|
|
398
|
-
*/
|
|
399
|
-
items: T[];
|
|
400
|
-
/**
|
|
401
|
-
* The optional key of the parent object of the created/updated items.
|
|
402
|
-
*/
|
|
403
|
-
parent?: string;
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
/**
|
|
407
|
-
* Describes a batch delete operation body.
|
|
408
|
-
*/
|
|
409
|
-
export interface IBatchDelete {
|
|
410
|
-
/**
|
|
411
|
-
* The list of keys of items to delete.
|
|
412
|
-
*/
|
|
413
|
-
items: string[];
|
|
414
|
-
/**
|
|
415
|
-
* The optional key of the parent object of the deleted items.
|
|
416
|
-
* Not used by the store but reported back through the events.
|
|
417
|
-
*/
|
|
418
|
-
parent?: string;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
/**
|
|
422
|
-
* Describes a result of the batch delete operation.
|
|
423
|
-
*/
|
|
424
|
-
export interface IBatchDeleteResult {
|
|
425
|
-
/**
|
|
426
|
-
* The ordered list of delete result for each item.
|
|
427
|
-
*
|
|
428
|
-
* The batch operation does not return specific errors. Use the direct delete operation
|
|
429
|
-
* for the detailed error.
|
|
430
|
-
*/
|
|
431
|
-
items: (IDeleteRecord | undefined | null)[];
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
export interface IDeleteRecord {
|
|
435
|
-
/**
|
|
436
|
-
* The key of the removed object.
|
|
437
|
-
*/
|
|
438
|
-
key: string;
|
|
439
|
-
/**
|
|
440
|
-
* The key of the parent object, if applicable.
|
|
441
|
-
*/
|
|
442
|
-
parent?: string;
|
|
443
|
-
}
|
|
444
|
-
|
|
445
|
-
/**
|
|
446
|
-
* Describes a batch undelete operation body.
|
|
447
|
-
*/
|
|
448
|
-
export interface IBatchUndelete {
|
|
449
|
-
/**
|
|
450
|
-
* The list of keys of the items to undelete.
|
|
451
|
-
*/
|
|
452
|
-
items: string[];
|
|
453
|
-
/**
|
|
454
|
-
* The optional key of the parent object of the deleted items.
|
|
455
|
-
*/
|
|
456
|
-
parent?: string;
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
export interface IRevertResult<T = unknown> {
|
|
460
|
-
/**
|
|
461
|
-
* The data kind of the changed item.
|
|
462
|
-
*/
|
|
463
|
-
kind?: string;
|
|
464
|
-
/**
|
|
465
|
-
* The key of the changed object.
|
|
466
|
-
*/
|
|
467
|
-
key: string;
|
|
468
|
-
/**
|
|
469
|
-
* The updated object.
|
|
470
|
-
*/
|
|
471
|
-
item?: T;
|
|
472
|
-
/**
|
|
473
|
-
* Optionally, when relevant, the key of the parent of the changed object.
|
|
474
|
-
*/
|
|
475
|
-
parent?: string;
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
export interface IRevertResponse<T = unknown> {
|
|
479
|
-
items: (IRevertResult<T> | undefined)[];
|
|
480
|
-
}
|
package/src/models/store/File.ts
CHANGED
|
@@ -6,10 +6,43 @@ import { IThing, Thing } from '../Thing.js';
|
|
|
6
6
|
import v4 from '../../lib/uuid.js';
|
|
7
7
|
import { ICapabilities } from './Capabilities.js';
|
|
8
8
|
// this causes error
|
|
9
|
-
// import { Kind as
|
|
9
|
+
// import { Kind as FolderKind } from '../Folder.js';
|
|
10
10
|
|
|
11
11
|
export const DefaultOwner = 'default';
|
|
12
12
|
|
|
13
|
+
export interface FileAddOptions {
|
|
14
|
+
/**
|
|
15
|
+
* The parent folder where to put the file.
|
|
16
|
+
* The `parents` array is always cleared from the file object before adding it to the store.
|
|
17
|
+
*/
|
|
18
|
+
parent?: string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface MediaReadOptions {
|
|
22
|
+
/**
|
|
23
|
+
* When set it reads the file that was marked as `_deleted`. By default it throws when file was deleted.
|
|
24
|
+
*/
|
|
25
|
+
deleted?: boolean;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* A breadcrumb when creating the breadcrumb list for a file.
|
|
30
|
+
*/
|
|
31
|
+
export interface FileBreadcrumb {
|
|
32
|
+
/**
|
|
33
|
+
* The datastore key of the object.
|
|
34
|
+
*/
|
|
35
|
+
key: string;
|
|
36
|
+
/**
|
|
37
|
+
* THe kind of the object.
|
|
38
|
+
*/
|
|
39
|
+
kind: string;
|
|
40
|
+
/**
|
|
41
|
+
* The name of the object.
|
|
42
|
+
*/
|
|
43
|
+
name: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
13
46
|
export interface IStoredFile {
|
|
14
47
|
/**
|
|
15
48
|
* The kind of the File
|
|
@@ -354,15 +387,15 @@ export class StoredFile {
|
|
|
354
387
|
canUntrash: isOwner,
|
|
355
388
|
canReadMedia: false,
|
|
356
389
|
};
|
|
357
|
-
// Do not use the `
|
|
390
|
+
// Do not use the `FolderKind` reference here as it's circular and creates
|
|
358
391
|
// an error.
|
|
359
|
-
if (file.kind === 'Core#
|
|
392
|
+
if (file.kind === 'Core#Folder' && isWriter) {
|
|
360
393
|
result.canAddChildren = true;
|
|
361
394
|
}
|
|
362
|
-
if (file.kind === 'Core#
|
|
395
|
+
if (file.kind === 'Core#Folder') {
|
|
363
396
|
result.canListChildren = isReader;
|
|
364
397
|
}
|
|
365
|
-
if (file.kind !== 'Core#
|
|
398
|
+
if (file.kind !== 'Core#Folder') {
|
|
366
399
|
result.canReadMedia = isReader;
|
|
367
400
|
}
|
|
368
401
|
return result;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { IProjectExecutionLog } from "../runtime/reporters/Reporter.js";
|
|
2
2
|
import { IRequestLog } from "../models/RequestLog.js";
|
|
3
|
-
import AppProjectProxy, { IAppProjectProxyInit } from "./AppProjectProxy.js";
|
|
4
3
|
import HttpProjectProxy, { IHttpProjectProxyInit, IHttpProjectStoreProxyInit } from "./HttpProjectProxy.js";
|
|
5
4
|
import { IProxyResult } from "./Proxy.js";
|
|
6
5
|
import RequestProxy, { IRequestProxyInit } from "./RequestProxy.js";
|
|
@@ -31,18 +30,4 @@ export default class ProxyService {
|
|
|
31
30
|
await proxy.configure(init, token, storeUri);
|
|
32
31
|
return proxy.execute();
|
|
33
32
|
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Executes an AppProject.
|
|
37
|
-
*
|
|
38
|
-
* @param token The user access token to read data from the store.
|
|
39
|
-
* @param storeUri The store's base URI.
|
|
40
|
-
* @param init The project run configuration.
|
|
41
|
-
* @returns The key under which the proxy is cached.
|
|
42
|
-
*/
|
|
43
|
-
async proxyAppProject(token: string, storeUri: string, init: IAppProjectProxyInit): Promise<IProxyResult<IProjectExecutionLog>> {
|
|
44
|
-
const proxy = new AppProjectProxy();
|
|
45
|
-
await proxy.configure(init, token, storeUri);
|
|
46
|
-
return proxy.execute() as Promise<IProxyResult<IProjectExecutionLog>>;
|
|
47
|
-
}
|
|
48
33
|
}
|
package/src/proxy/readme.md
CHANGED
|
@@ -4,6 +4,5 @@ The libraries to create an HTTP/Socket proxy for API things (projects, requests)
|
|
|
4
4
|
|
|
5
5
|
## Libraries
|
|
6
6
|
|
|
7
|
-
- `AppProjectProxy` - a class that runs request from an `AppProject`
|
|
8
7
|
- `HttpProjectProxy` - a class that runs request from an `HttpProject`
|
|
9
8
|
- `RequestProxy` - a class that runs a single request as `HttpRequest`
|
|
@@ -4,7 +4,6 @@ import { Environment } from '../../models/Environment.js';
|
|
|
4
4
|
import { Logger } from '../../lib/logging/Logger.js';
|
|
5
5
|
import { IRequestLog } from '../../models/RequestLog.js';
|
|
6
6
|
import { CookieJar } from '../../cookies/CookieJar.js';
|
|
7
|
-
import { IAppProject } from 'browser.js';
|
|
8
7
|
|
|
9
8
|
export interface IRequestRunnerOptions {
|
|
10
9
|
/**
|
|
@@ -72,7 +71,7 @@ export interface IProjectParallelRunnerOptions extends IProjectRunnerOptions {
|
|
|
72
71
|
}
|
|
73
72
|
|
|
74
73
|
export interface IProjectParallelWorkerOptions extends IProjectRunnerOptions {
|
|
75
|
-
project: IHttpProject
|
|
74
|
+
project: IHttpProject;
|
|
76
75
|
}
|
|
77
76
|
|
|
78
77
|
export interface IProjectRunnerOptions {
|
|
@@ -3,7 +3,6 @@ import { cpus } from 'os';
|
|
|
3
3
|
import { dirname, join } from 'path';
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
5
|
import { HttpProject } from '../../models/HttpProject.js';
|
|
6
|
-
import { AppProject } from '../../models/AppProject.js';
|
|
7
6
|
import { IProjectExecutionLog, IProjectExecutionIteration } from '../reporters/Reporter.js';
|
|
8
7
|
import { BaseRunner } from './BaseRunner.js';
|
|
9
8
|
import { State } from './enums.js';
|
|
@@ -67,13 +66,13 @@ export interface ProjectParallelRunner {
|
|
|
67
66
|
* change. This event can be user to refresh the UI to reflect the newest state.
|
|
68
67
|
*/
|
|
69
68
|
export class ProjectParallelRunner extends BaseRunner {
|
|
70
|
-
project: HttpProject
|
|
69
|
+
project: HttpProject;
|
|
71
70
|
options: IProjectParallelRunnerOptions;
|
|
72
71
|
workers: WorkerInfoInternal[] = [];
|
|
73
72
|
private mainResolver?: (report: IProjectExecutionLog) => void;
|
|
74
73
|
private mainRejecter?: (err: Error) => void;
|
|
75
74
|
|
|
76
|
-
constructor(project: HttpProject
|
|
75
|
+
constructor(project: HttpProject, opts: IProjectParallelRunnerOptions = {}) {
|
|
77
76
|
super();
|
|
78
77
|
this.project = project;
|
|
79
78
|
this.options = opts;
|
|
@@ -14,7 +14,6 @@ import { IProjectExecutionResult, IRequestRunnerOptions, IRequestRunnerRunOption
|
|
|
14
14
|
import { State } from './enums.js';
|
|
15
15
|
import { HttpRequestRunner } from '../http-runner/HttpRequestRunner.js';
|
|
16
16
|
import { CookieJar } from '../../cookies/CookieJar.js';
|
|
17
|
-
import { AppProject, AppProjectFolder, AppProjectFolderKind, AppProjectItem, AppProjectRequest, AppProjectRequestKind } from '../../models/AppProject.js';
|
|
18
17
|
import { ProjectItem } from '../../models/ProjectItem.js';
|
|
19
18
|
|
|
20
19
|
export interface ProjectRequestRunner {
|
|
@@ -53,7 +52,7 @@ export interface ProjectRequestRunner {
|
|
|
53
52
|
*/
|
|
54
53
|
export class ProjectRequestRunner extends EventEmitter {
|
|
55
54
|
logger?: Logger;
|
|
56
|
-
project: HttpProject
|
|
55
|
+
project: HttpProject;
|
|
57
56
|
/**
|
|
58
57
|
* An instance of a cookie jar (store) to put/read cookies.
|
|
59
58
|
*/
|
|
@@ -73,7 +72,7 @@ export class ProjectRequestRunner extends EventEmitter {
|
|
|
73
72
|
return this._state;
|
|
74
73
|
}
|
|
75
74
|
|
|
76
|
-
constructor(project: HttpProject
|
|
75
|
+
constructor(project: HttpProject, opts: IRequestRunnerOptions = {}) {
|
|
77
76
|
super();
|
|
78
77
|
this.project = project;
|
|
79
78
|
this.logger = opts.logger;
|
|
@@ -126,32 +125,32 @@ export class ProjectRequestRunner extends EventEmitter {
|
|
|
126
125
|
}
|
|
127
126
|
}
|
|
128
127
|
|
|
129
|
-
protected async * _runIterator(items:
|
|
128
|
+
protected async * _runIterator(items: ProjectItem[], variables: Record<string, string>, options: IRequestRunnerRunOptions): AsyncGenerator<IRunResult> {
|
|
130
129
|
for (const item of items) {
|
|
131
130
|
const current = item.getItem();
|
|
132
131
|
if (!current) {
|
|
133
132
|
continue;
|
|
134
133
|
}
|
|
135
|
-
if (current.kind ===
|
|
134
|
+
if (current.kind === ProjectRequestKind) {
|
|
136
135
|
if (Array.isArray(options.ignore) && options.ignore.includes(current.key)) {
|
|
137
136
|
continue;
|
|
138
137
|
}
|
|
139
138
|
if (Array.isArray(options.requests) && !options.requests.includes(current.key) && !options.requests.includes(current.info.name || '')) {
|
|
140
139
|
continue;
|
|
141
140
|
}
|
|
142
|
-
const info = await this._runItem(current as
|
|
141
|
+
const info = await this._runItem(current as ProjectRequest, variables);
|
|
143
142
|
yield info;
|
|
144
|
-
} else if (current.kind === ProjectFolderKind
|
|
143
|
+
} else if (current.kind === ProjectFolderKind) {
|
|
145
144
|
if (!options.recursive) {
|
|
146
145
|
continue;
|
|
147
146
|
}
|
|
148
|
-
const parent = current as ProjectFolder
|
|
147
|
+
const parent = current as ProjectFolder;
|
|
149
148
|
// make a copy so the variables executed in the encapsulated environment won't leak out to the current environment.
|
|
150
149
|
let encapsulated = false;
|
|
151
150
|
// we restore the `baseUri` after exiting the folder.
|
|
152
151
|
const currentBaseUri = variables.baseUri;
|
|
153
152
|
const { items: parentItems } = parent;
|
|
154
|
-
const envItem = (parentItems as
|
|
153
|
+
const envItem = (parentItems as ProjectItem[]).find(i => i.kind === EnvironmentKind);
|
|
155
154
|
let parentVariables: Record<string, string> = {};
|
|
156
155
|
let childVariables = variables;
|
|
157
156
|
if (envItem) {
|
|
@@ -214,7 +213,7 @@ export class ProjectRequestRunner extends EventEmitter {
|
|
|
214
213
|
}
|
|
215
214
|
}
|
|
216
215
|
|
|
217
|
-
private async _runItem(request: ProjectRequest
|
|
216
|
+
private async _runItem(request: ProjectRequest, variables: Record<string, string>): Promise<IRunResult> {
|
|
218
217
|
if (this._state === State.Aborted) {
|
|
219
218
|
throw new Error(`The execution has been aborted.`);
|
|
220
219
|
}
|
|
@@ -226,7 +225,7 @@ export class ProjectRequestRunner extends EventEmitter {
|
|
|
226
225
|
return info;
|
|
227
226
|
}
|
|
228
227
|
|
|
229
|
-
protected async execute(request: ProjectRequest
|
|
228
|
+
protected async execute(request: ProjectRequest, variables: Record<string, string>): Promise<IRunResult> {
|
|
230
229
|
const config = request.getConfig();
|
|
231
230
|
const factory = new HttpRequestRunner();
|
|
232
231
|
factory.variables = variables;
|
|
@@ -285,14 +284,14 @@ export class ProjectRequestRunner extends EventEmitter {
|
|
|
285
284
|
return info;
|
|
286
285
|
}
|
|
287
286
|
|
|
288
|
-
protected async getVariables(parent: HttpProject |
|
|
287
|
+
protected async getVariables(parent: HttpProject | ProjectFolder): Promise<Record<string, string>> {
|
|
289
288
|
if (this.masterEnvironment) {
|
|
290
289
|
return this.applyVariables([this.masterEnvironment]);
|
|
291
290
|
}
|
|
292
291
|
return this.createEnvironment(parent);
|
|
293
292
|
}
|
|
294
293
|
|
|
295
|
-
protected async createEnvironment(parent: HttpProject |
|
|
294
|
+
protected async createEnvironment(parent: HttpProject | ProjectFolder): Promise<Record<string, string>> {
|
|
296
295
|
const envs = await this.readEnvironments(parent);
|
|
297
296
|
return this.applyVariables(envs);
|
|
298
297
|
}
|
|
@@ -300,7 +299,7 @@ export class ProjectRequestRunner extends EventEmitter {
|
|
|
300
299
|
/**
|
|
301
300
|
* Reads the list of the environments to apply to this runtime.
|
|
302
301
|
*/
|
|
303
|
-
protected async readEnvironments(parent: HttpProject |
|
|
302
|
+
protected async readEnvironments(parent: HttpProject | ProjectFolder): Promise<Environment[]> {
|
|
304
303
|
const folderKey = parent.kind === ProjectFolderKind ? (parent as ProjectFolder).key : undefined;
|
|
305
304
|
return this.project.readEnvironments({ parent: folderKey });
|
|
306
305
|
}
|
|
@@ -11,9 +11,8 @@ import { pathExists, readJson } from '../../lib/fs/Fs.js';
|
|
|
11
11
|
import { BaseRunner } from './BaseRunner.js';
|
|
12
12
|
import { IProjectRunnerOptions, IRequestRunnerOptions } from './InteropInterfaces.js';
|
|
13
13
|
import { State } from './enums.js';
|
|
14
|
-
import { AppProject, AppProjectFolder } from '../../models/AppProject.js';
|
|
15
14
|
|
|
16
|
-
type ProjectParent = HttpProject | ProjectFolder
|
|
15
|
+
type ProjectParent = HttpProject | ProjectFolder;
|
|
17
16
|
|
|
18
17
|
export interface ProjectRunner {
|
|
19
18
|
/**
|
|
@@ -90,7 +89,7 @@ export abstract class ProjectRunner extends BaseRunner {
|
|
|
90
89
|
/**
|
|
91
90
|
* The HTTP project to run requests from.
|
|
92
91
|
*/
|
|
93
|
-
project?: HttpProject
|
|
92
|
+
project?: HttpProject;
|
|
94
93
|
/**
|
|
95
94
|
* The execution options for the project.
|
|
96
95
|
*/
|
|
@@ -173,7 +172,7 @@ export abstract class ProjectRunner extends BaseRunner {
|
|
|
173
172
|
* A required step before running the project.
|
|
174
173
|
* It configures the execution context. It may throw an error when configuration is not valid.
|
|
175
174
|
*/
|
|
176
|
-
async configure(project: HttpProject
|
|
175
|
+
async configure(project: HttpProject, opts: IProjectRunnerOptions = {}): Promise<void> {
|
|
177
176
|
this.project = project;
|
|
178
177
|
this.options = opts || {};
|
|
179
178
|
if (typeof this.options.iterations === 'number' && this.options.iterations >= 0) {
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
import process from 'process';
|
|
4
4
|
import cluster from 'cluster';
|
|
5
5
|
import { HttpProject, Kind as HttpProjectKind } from '../../models/HttpProject.js';
|
|
6
|
-
import { AppProject, AppProjectKind } from '../../models/AppProject.js';
|
|
7
6
|
import { IProjectExecutionLog } from '../reporters/Reporter.js';
|
|
8
7
|
import { IWorkerMessage } from './ProjectParallelRunner.js';
|
|
9
8
|
import { IProjectParallelWorkerOptions } from './InteropInterfaces.js';
|
|
@@ -33,11 +32,9 @@ class ProjectExeWorker extends ProjectRunner {
|
|
|
33
32
|
options.cookies = new InMemoryCookieJar();
|
|
34
33
|
try {
|
|
35
34
|
const schema = options.project;
|
|
36
|
-
let project: HttpProject
|
|
35
|
+
let project: HttpProject;
|
|
37
36
|
if (schema.kind === HttpProjectKind) {
|
|
38
37
|
project = new HttpProject(schema);
|
|
39
|
-
} else if (schema.kind === AppProjectKind) {
|
|
40
|
-
project = new AppProject(schema);
|
|
41
38
|
} else {
|
|
42
39
|
throw new Error(`Unknown project kind: ${schema.kind}`);
|
|
43
40
|
}
|