@api-client/core 0.8.22 → 0.9.1
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 +137 -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 +25 -0
- package/build/src/models/Space.js +76 -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/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 +31 -1
- package/build/src/models/store/File.js +6 -6
- package/build/src/models/store/File.js.map +1 -1
- package/build/src/proxy/HttpProjectProxy.d.ts +4 -0
- package/build/src/proxy/HttpProjectProxy.js +10 -2
- package/build/src/proxy/HttpProjectProxy.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 +21 -16
- package/build/src/runtime/store/FilesSdk.js +75 -23
- 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 +1 -1
- package/src/events/BaseEvents.ts +148 -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 +91 -0
- package/src/models/TrashEntry.ts +29 -0
- package/src/models/store/Backend.ts +0 -342
- package/src/models/store/File.ts +39 -6
- package/src/proxy/HttpProjectProxy.ts +14 -2
- 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 +88 -35
- 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
package/src/events/BaseEvents.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { JsonPatch } from '@api-client/json'
|
|
1
2
|
import CustomEvent from './CustomEvent.js';
|
|
2
|
-
import {
|
|
3
|
+
import { AccessOperation } from '../models/store/Permission.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Base event detail definition for the events that returns a `result`
|
|
@@ -48,7 +49,7 @@ export interface ContextReadEventDetail {
|
|
|
48
49
|
/**
|
|
49
50
|
* An event to be used to read a state from a context provider.
|
|
50
51
|
*/
|
|
51
|
-
export class ContextReadEvent<T> extends ContextEvent<ContextReadEventDetail, T> {
|
|
52
|
+
export class ContextReadEvent<T> extends ContextEvent<ContextReadEventDetail, T | null | undefined> {
|
|
52
53
|
/**
|
|
53
54
|
* @param type The type of the event
|
|
54
55
|
* @param key The domain key of the object to read
|
|
@@ -73,7 +74,7 @@ export interface ContextReadBulkEventDetail {
|
|
|
73
74
|
/**
|
|
74
75
|
* An event to be used to read a list of object from the API store.
|
|
75
76
|
*/
|
|
76
|
-
export class ContextReadBulkEvent<T> extends ContextEvent<ContextReadBulkEventDetail, T
|
|
77
|
+
export class ContextReadBulkEvent<T> extends ContextEvent<ContextReadBulkEventDetail, IBulkOperationResult<(T | null | undefined)>> {
|
|
77
78
|
/**
|
|
78
79
|
* @param type The type of the event
|
|
79
80
|
* @param keys The list of domain keys to read. These must be of the same domain type.
|
|
@@ -105,6 +106,10 @@ export interface ContextChangeRecord<T> {
|
|
|
105
106
|
* Optionally, when relevant, the key of the parent of the changed object.
|
|
106
107
|
*/
|
|
107
108
|
parent?: string;
|
|
109
|
+
/**
|
|
110
|
+
* The parent space.
|
|
111
|
+
*/
|
|
112
|
+
space?: string;
|
|
108
113
|
}
|
|
109
114
|
|
|
110
115
|
export interface ContextDeleteEventDetail {
|
|
@@ -116,6 +121,10 @@ export interface ContextDeleteEventDetail {
|
|
|
116
121
|
* The key of the parent object, if applicable.
|
|
117
122
|
*/
|
|
118
123
|
parent?: string;
|
|
124
|
+
/**
|
|
125
|
+
* The parent space.
|
|
126
|
+
*/
|
|
127
|
+
space?: string;
|
|
119
128
|
}
|
|
120
129
|
|
|
121
130
|
export interface ContextDeleteBulkEventDetail {
|
|
@@ -127,6 +136,10 @@ export interface ContextDeleteBulkEventDetail {
|
|
|
127
136
|
* The key of the parent object, if applicable.
|
|
128
137
|
*/
|
|
129
138
|
parent?: string;
|
|
139
|
+
/**
|
|
140
|
+
* The parent space.
|
|
141
|
+
*/
|
|
142
|
+
space?: string;
|
|
130
143
|
}
|
|
131
144
|
|
|
132
145
|
/**
|
|
@@ -144,10 +157,23 @@ export class ContextDeleteEvent extends ContextEvent<ContextDeleteEventDetail, C
|
|
|
144
157
|
}
|
|
145
158
|
}
|
|
146
159
|
|
|
160
|
+
/**
|
|
161
|
+
* Describes a result of the batch delete operation.
|
|
162
|
+
*/
|
|
163
|
+
export interface IBulkOperationResult<T> {
|
|
164
|
+
/**
|
|
165
|
+
* The ordered list of delete result for each item.
|
|
166
|
+
*
|
|
167
|
+
* The batch operation does not return specific errors. Use the direct delete operation
|
|
168
|
+
* for the detailed error.
|
|
169
|
+
*/
|
|
170
|
+
items: (T | undefined | null)[];
|
|
171
|
+
}
|
|
172
|
+
|
|
147
173
|
/**
|
|
148
174
|
* An event to be used to delete a number of entities in the context provider.
|
|
149
175
|
*/
|
|
150
|
-
export class ContextDeleteBulkEvent extends ContextEvent<ContextDeleteBulkEventDetail, ContextDeleteRecord
|
|
176
|
+
export class ContextDeleteBulkEvent extends ContextEvent<ContextDeleteBulkEventDetail, IBulkOperationResult<ContextDeleteRecord>> {
|
|
151
177
|
/**
|
|
152
178
|
* An event to be used to delete a number of entities in the context provider.
|
|
153
179
|
* @param type The type of the event to dispatch.
|
|
@@ -178,7 +204,7 @@ export interface ContextDeleteRecord {
|
|
|
178
204
|
/**
|
|
179
205
|
* An event dispatched to the context store to restore previously deleted items.
|
|
180
206
|
*/
|
|
181
|
-
export class ContextRestoreEvent<T> extends ContextEvent<{ records: ContextDeleteRecord[] },
|
|
207
|
+
export class ContextRestoreEvent<T> extends ContextEvent<{ records: ContextDeleteRecord[] }, IBulkOperationResult<ContextChangeRecord<T>>> {
|
|
182
208
|
/**
|
|
183
209
|
* An event dispatched to the context store to restore previously deleted items.
|
|
184
210
|
*
|
|
@@ -242,7 +268,7 @@ export interface ContextUpdateEventDetail<T> {
|
|
|
242
268
|
parent?: string;
|
|
243
269
|
}
|
|
244
270
|
|
|
245
|
-
export interface ContextUpdateBulkEventDetail<T> {
|
|
271
|
+
export interface ContextUpdateBulkEventDetail<T = unknown> {
|
|
246
272
|
/**
|
|
247
273
|
* The list of context store objects to be updated by the context provider.
|
|
248
274
|
*/
|
|
@@ -282,7 +308,7 @@ export class ContextUpdateEvent<T extends object, U = T> extends ContextEvent<Co
|
|
|
282
308
|
* @template T The object that is being updated.
|
|
283
309
|
* @template U The object that is returned by the context store after updating. By default it is the `T`.
|
|
284
310
|
*/
|
|
285
|
-
export class ContextUpdateBulkEvent<T extends object, U = T> extends ContextEvent<ContextUpdateBulkEventDetail<T>, ContextChangeRecord<U
|
|
311
|
+
export class ContextUpdateBulkEvent<T extends object, U = T> extends ContextEvent<ContextUpdateBulkEventDetail<T>, IBulkOperationResult<ContextChangeRecord<U>>> {
|
|
286
312
|
/**
|
|
287
313
|
* An event that is dispatched to update the entire object in the store.
|
|
288
314
|
* This is equivalent to PUT operation in REST HTTP.
|
|
@@ -299,12 +325,6 @@ export class ContextUpdateBulkEvent<T extends object, U = T> extends ContextEven
|
|
|
299
325
|
* Data store query result object.
|
|
300
326
|
*/
|
|
301
327
|
export interface ContextListResult<T> {
|
|
302
|
-
/**
|
|
303
|
-
* Next page token to be used with pagination.
|
|
304
|
-
* It is not set when the query has not returned any results.
|
|
305
|
-
* @deprecated Use `cursor` instead.
|
|
306
|
-
*/
|
|
307
|
-
nextPageToken?: string;
|
|
308
328
|
/**
|
|
309
329
|
* The cursor to use with the next query. It has the list state encoded in it.
|
|
310
330
|
*/
|
|
@@ -324,11 +344,6 @@ export interface ContextListOptions {
|
|
|
324
344
|
* The number of results per the page.
|
|
325
345
|
*/
|
|
326
346
|
limit?: number;
|
|
327
|
-
/**
|
|
328
|
-
* A string that should be used with the pagination.
|
|
329
|
-
* @deprecated Use `cursor` instead.
|
|
330
|
-
*/
|
|
331
|
-
nextPageToken?: string;
|
|
332
347
|
/**
|
|
333
348
|
* Page cursor to use with the query. This is returned by the
|
|
334
349
|
*/
|
|
@@ -349,6 +364,10 @@ export interface ContextListOptions {
|
|
|
349
364
|
* Whether to use the `descending` order.
|
|
350
365
|
*/
|
|
351
366
|
descending?: boolean;
|
|
367
|
+
/**
|
|
368
|
+
* The name of the field to order then results.
|
|
369
|
+
*/
|
|
370
|
+
orderField?: string;
|
|
352
371
|
/**
|
|
353
372
|
* General purpose type property to filer the results.
|
|
354
373
|
* This is used, for example, by the history store to list history for a specific type of requests,
|
|
@@ -362,6 +381,13 @@ export interface ContextListOptions {
|
|
|
362
381
|
since?: number;
|
|
363
382
|
}
|
|
364
383
|
|
|
384
|
+
export interface ContextSpaceListOptions extends ContextListOptions {
|
|
385
|
+
/**
|
|
386
|
+
* The identifier of the parent space (or organization).
|
|
387
|
+
*/
|
|
388
|
+
space: string;
|
|
389
|
+
}
|
|
390
|
+
|
|
365
391
|
export class ContextListEvent<T> extends ContextEvent<ContextListOptions, ContextListResult<T>> {
|
|
366
392
|
/**
|
|
367
393
|
* @param type The type of the event
|
|
@@ -397,6 +423,24 @@ export interface IQueryDetail {
|
|
|
397
423
|
detailed?: boolean;
|
|
398
424
|
}
|
|
399
425
|
|
|
426
|
+
export interface IQueryResponse<T = unknown> {
|
|
427
|
+
/**
|
|
428
|
+
* An ordered list of results.
|
|
429
|
+
*/
|
|
430
|
+
items: IQueryResult<T>[];
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
export interface IQueryResult<T = unknown> {
|
|
434
|
+
/**
|
|
435
|
+
* The document.
|
|
436
|
+
*/
|
|
437
|
+
doc: T;
|
|
438
|
+
/**
|
|
439
|
+
* The list of indexes where this document was found.
|
|
440
|
+
*/
|
|
441
|
+
index: string[];
|
|
442
|
+
}
|
|
443
|
+
|
|
400
444
|
/**
|
|
401
445
|
* An event dispatched to the context store to perform a query operation.
|
|
402
446
|
* If the context store supports the query operation, it should use the definition of `IQueryDetail` to perform the query.
|
|
@@ -421,3 +465,89 @@ export class ContextQueryEvent<T = unknown> extends ContextEvent<IQueryDetail, I
|
|
|
421
465
|
super(type, opts);
|
|
422
466
|
}
|
|
423
467
|
}
|
|
468
|
+
|
|
469
|
+
/**
|
|
470
|
+
* Query options to list history for a request in a project.
|
|
471
|
+
* The user has to have access to the parent user space to read / create / delete the history.
|
|
472
|
+
*/
|
|
473
|
+
export interface IHistoryRequestListOptions extends ContextListOptions {
|
|
474
|
+
type: 'request';
|
|
475
|
+
/**
|
|
476
|
+
* The key of the parent space.
|
|
477
|
+
*/
|
|
478
|
+
space: string;
|
|
479
|
+
/**
|
|
480
|
+
* The id of the project that contains the request.
|
|
481
|
+
*/
|
|
482
|
+
project: string;
|
|
483
|
+
/**
|
|
484
|
+
* The id of the request.
|
|
485
|
+
*/
|
|
486
|
+
id: string;
|
|
487
|
+
/**
|
|
488
|
+
* Whether to limit the list of results to the history that belongs to the current user.
|
|
489
|
+
*/
|
|
490
|
+
user?: boolean;
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
/**
|
|
494
|
+
* Listing options for the HTTP history.
|
|
495
|
+
*/
|
|
496
|
+
export type HistoryListOptions = IHistoryRequestListOptions;
|
|
497
|
+
|
|
498
|
+
|
|
499
|
+
export interface IPatchBase {
|
|
500
|
+
/**
|
|
501
|
+
* Auto generated by the client sending the PATCH.
|
|
502
|
+
*/
|
|
503
|
+
id: string;
|
|
504
|
+
/**
|
|
505
|
+
* The application id that generated the patch.
|
|
506
|
+
* This is a string that is assigned to each application in the suite.
|
|
507
|
+
* External applications need to use a constant string for their apps.
|
|
508
|
+
*/
|
|
509
|
+
app: string;
|
|
510
|
+
/**
|
|
511
|
+
* The version of the application that generated the patch.
|
|
512
|
+
* This can and will be used to handle potential differences between suite applications.
|
|
513
|
+
*/
|
|
514
|
+
appVersion: string;
|
|
515
|
+
/**
|
|
516
|
+
* The patch generated by the client.
|
|
517
|
+
*/
|
|
518
|
+
patch: unknown;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
/**
|
|
522
|
+
* An interface describing a schema to be sent to the server
|
|
523
|
+
* when making a patch of a file.
|
|
524
|
+
*/
|
|
525
|
+
export interface IPatchInfo extends IPatchBase {
|
|
526
|
+
/**
|
|
527
|
+
* The patch generated by the client.
|
|
528
|
+
*/
|
|
529
|
+
patch: JsonPatch;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
/**
|
|
533
|
+
* An interface describing a schema to be sent to the server
|
|
534
|
+
* when making a patch with user access to a file.
|
|
535
|
+
*/
|
|
536
|
+
export interface IAccessPatchInfo extends IPatchBase {
|
|
537
|
+
/**
|
|
538
|
+
* The patch generated by the client.
|
|
539
|
+
*/
|
|
540
|
+
patch: AccessOperation[];
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* A schema sent by the store server in a response to the patch request.
|
|
545
|
+
* It contains an information about the applied patch, the reverse operation associated with it,
|
|
546
|
+
* application information, and the generated by the client patch id.
|
|
547
|
+
*/
|
|
548
|
+
export interface IPatchRevision extends IPatchInfo {
|
|
549
|
+
/**
|
|
550
|
+
* The patch to apply to the object to revert the changes.
|
|
551
|
+
*/
|
|
552
|
+
revert: JsonPatch;
|
|
553
|
+
}
|
package/src/events/EventTypes.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ModelEventTypes } from './models/ModelEventTypes.js';
|
|
2
1
|
import { CookieEventTypes } from './cookies/CookieEventTypes.js';
|
|
3
2
|
import { AuthorizationEventTypes } from './authorization/AuthorizationEventTypes.js';
|
|
4
3
|
import { EncryptionEventTypes } from './encryption/EncryptionEventTypes.js';
|
|
@@ -14,7 +13,6 @@ export const EventTypes = Object.freeze({
|
|
|
14
13
|
Authorization: AuthorizationEventTypes,
|
|
15
14
|
Cookie: CookieEventTypes,
|
|
16
15
|
Encryption: EncryptionEventTypes,
|
|
17
|
-
Model: ModelEventTypes,
|
|
18
16
|
Process: ProcessEventTypes,
|
|
19
17
|
Reporting: ReportingEventTypes,
|
|
20
18
|
Telemetry: TelemetryEventTypes,
|
package/src/events/Events.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ModelEvents } from './models/ModelEvents.js';
|
|
2
1
|
import { CookieEvents } from './cookies/CookieEvents.js';
|
|
3
2
|
import { AuthorizationEvents } from './authorization/AuthorizationEvents.js';
|
|
4
3
|
import { EncryptionEvents } from './encryption/EncryptionEvents.js';
|
|
@@ -14,7 +13,6 @@ export const Events = Object.freeze({
|
|
|
14
13
|
Authorization: AuthorizationEvents,
|
|
15
14
|
Cookie: CookieEvents,
|
|
16
15
|
Encryption: EncryptionEvents,
|
|
17
|
-
Model: ModelEvents,
|
|
18
16
|
Process: ProcessEvents,
|
|
19
17
|
Reporting: ReportingEvents,
|
|
20
18
|
Telemetry: TelemetryEvents,
|
|
@@ -7,7 +7,6 @@ import { TransportEventTypes } from "./TransportEventTypes.js";
|
|
|
7
7
|
import { IProjectExecutionLog } from "../../runtime/reporters/Reporter.js";
|
|
8
8
|
import { IRequestProxyInit } from "../../proxy/RequestProxy.js";
|
|
9
9
|
import { IHttpProjectProxyInit, IHttpProjectStoreProxyInit } from "../../proxy/HttpProjectProxy.js";
|
|
10
|
-
import { IAppProjectProxyInit } from "../../proxy/AppProjectProxy.js";
|
|
11
10
|
import { IProxyResult } from "../../proxy/Proxy.js";
|
|
12
11
|
|
|
13
12
|
export interface IHttpRequestDetail {
|
|
@@ -45,18 +44,6 @@ export const TransportEvent = Object.freeze({
|
|
|
45
44
|
target.dispatchEvent(e);
|
|
46
45
|
return e.detail.result;
|
|
47
46
|
},
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* For both the project or a folder (since it's all single configuration.)
|
|
51
|
-
*
|
|
52
|
-
* @param target The events target
|
|
53
|
-
* @param init The project execution configuration
|
|
54
|
-
*/
|
|
55
|
-
appProject: async (init: IAppProjectProxyInit, target: EventTarget = window): Promise<IProxyResult<IProjectExecutionLog> | undefined> => {
|
|
56
|
-
const e = new ContextEvent<IAppProjectProxyInit, IProxyResult<IProjectExecutionLog>>(TransportEventTypes.Core.appProject, init);
|
|
57
|
-
target.dispatchEvent(e);
|
|
58
|
-
return e.detail.result;
|
|
59
|
-
},
|
|
60
47
|
}),
|
|
61
48
|
/**
|
|
62
49
|
* Transport via the native platform's bindings.
|
|
@@ -6,13 +6,11 @@ import { History } from './lib/History.js';
|
|
|
6
6
|
import { Url } from './lib/Url.js';
|
|
7
7
|
import { Certificates } from './lib/Certificates.js';
|
|
8
8
|
import { HostRules } from './lib/HostRules.js';
|
|
9
|
-
import { App } from './lib/App.js';
|
|
10
9
|
|
|
11
10
|
export { IRequestLogInit } from './lib/Request.js';
|
|
12
11
|
export { IResponseInit } from './lib/Response.js';
|
|
13
12
|
export { IUserInit } from './lib/User.js';
|
|
14
13
|
export { IHttpHistoryInit, IHttpHistoryListInit } from './lib/History.js';
|
|
15
|
-
export { IAppRequestInit } from './lib/App.js';
|
|
16
14
|
|
|
17
15
|
export class ProjectMock extends DataMock {
|
|
18
16
|
projectRequest: Request;
|
|
@@ -22,7 +20,6 @@ export class ProjectMock extends DataMock {
|
|
|
22
20
|
url: Url;
|
|
23
21
|
certificates: Certificates;
|
|
24
22
|
hostRules: HostRules;
|
|
25
|
-
app: App;
|
|
26
23
|
|
|
27
24
|
/**
|
|
28
25
|
* @param init The library init options.
|
|
@@ -36,6 +33,5 @@ export class ProjectMock extends DataMock {
|
|
|
36
33
|
this.url = new Url(init);
|
|
37
34
|
this.certificates = new Certificates(init);
|
|
38
35
|
this.hostRules = new HostRules(init);
|
|
39
|
-
this.app = new App(init);
|
|
40
36
|
}
|
|
41
37
|
}
|
|
@@ -2,14 +2,14 @@ import { IFile, File, DefaultOwner } from "./store/File.js";
|
|
|
2
2
|
import { Thing, Kind as ThingKind } from './Thing.js';
|
|
3
3
|
import v4 from '../lib/uuid.js';
|
|
4
4
|
|
|
5
|
-
export const Kind = 'Core#
|
|
5
|
+
export const Kind = 'Core#Folder';
|
|
6
6
|
/**
|
|
7
7
|
* A definition of the working space for users.
|
|
8
8
|
*
|
|
9
9
|
* A working space is a logical container in the data store
|
|
10
10
|
* created by the system users, where they can store their projects and other data.
|
|
11
11
|
*/
|
|
12
|
-
export interface
|
|
12
|
+
export interface IFolder extends IFile {
|
|
13
13
|
kind: typeof Kind;
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -19,7 +19,7 @@ export interface IWorkspace extends IFile {
|
|
|
19
19
|
* A working space is a logical container in the data store
|
|
20
20
|
* created by the system users, where they can store their projects and other data.
|
|
21
21
|
*/
|
|
22
|
-
export class
|
|
22
|
+
export class Folder extends File {
|
|
23
23
|
override kind = Kind;
|
|
24
24
|
|
|
25
25
|
/**
|
|
@@ -28,10 +28,10 @@ export class Workspace extends File {
|
|
|
28
28
|
* @param name The name to set.
|
|
29
29
|
* @param owner The user id that is the owner of the space.
|
|
30
30
|
*/
|
|
31
|
-
static fromName(name: string, owner = DefaultOwner):
|
|
31
|
+
static fromName(name: string, owner = DefaultOwner): Folder {
|
|
32
32
|
const key = v4();
|
|
33
33
|
const info = new Thing({ kind: ThingKind, name });
|
|
34
|
-
const definition = new
|
|
34
|
+
const definition = new Folder({
|
|
35
35
|
key,
|
|
36
36
|
kind: Kind,
|
|
37
37
|
info: info.toJSON(),
|
|
@@ -47,9 +47,9 @@ export class Workspace extends File {
|
|
|
47
47
|
/**
|
|
48
48
|
* @param input The environment definition used to restore the state.
|
|
49
49
|
*/
|
|
50
|
-
constructor(input?: string |
|
|
50
|
+
constructor(input?: string | IFolder) {
|
|
51
51
|
super();
|
|
52
|
-
let init:
|
|
52
|
+
let init: IFolder;
|
|
53
53
|
if (typeof input === 'string') {
|
|
54
54
|
init = JSON.parse(input);
|
|
55
55
|
} else if (typeof input === 'object') {
|
|
@@ -77,8 +77,8 @@ export class Workspace extends File {
|
|
|
77
77
|
*
|
|
78
78
|
* Note, this throws an error when the environment is not a space.
|
|
79
79
|
*/
|
|
80
|
-
override new(init:
|
|
81
|
-
if (!
|
|
80
|
+
override new(init: IFolder): void {
|
|
81
|
+
if (!Folder.isWorkspace(init)) {
|
|
82
82
|
throw new Error(`Not a space.`);
|
|
83
83
|
}
|
|
84
84
|
super.new(init);
|
|
@@ -89,15 +89,15 @@ export class Workspace extends File {
|
|
|
89
89
|
* Checks whether the input is a definition of an user space.
|
|
90
90
|
*/
|
|
91
91
|
static isWorkspace(input: unknown): boolean {
|
|
92
|
-
const typed = input as
|
|
92
|
+
const typed = input as IFolder;
|
|
93
93
|
if (!input || typed.kind !== Kind) {
|
|
94
94
|
return false;
|
|
95
95
|
}
|
|
96
96
|
return true;
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
override toJSON():
|
|
100
|
-
const result:
|
|
99
|
+
override toJSON(): IFolder {
|
|
100
|
+
const result: IFolder = {
|
|
101
101
|
...super.toJSON(),
|
|
102
102
|
kind: Kind,
|
|
103
103
|
};
|
|
@@ -4,41 +4,38 @@ export const Kind = 'Core#HttpHistory';
|
|
|
4
4
|
export const createdSymbol = Symbol('created');
|
|
5
5
|
export const midnightSymbol = Symbol('midnight');
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* An HTTP history log.
|
|
9
|
+
* It's a definition of a HTTP requests history made in an app.
|
|
10
|
+
*/
|
|
7
11
|
export interface IHttpHistory {
|
|
8
12
|
kind: typeof Kind;
|
|
9
13
|
/**
|
|
10
|
-
* The
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* Note for data store implementations. This must be a URL-safe value so the id should be encoded if needed.
|
|
14
|
-
*
|
|
15
|
-
* @readonly
|
|
14
|
+
* The key of the history entry. The application must
|
|
15
|
+
* revalidate the local copy of the record as the store may change the key.
|
|
16
16
|
*/
|
|
17
|
-
key
|
|
17
|
+
key: string;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* The key of the parent workspace.
|
|
20
20
|
*/
|
|
21
|
-
space
|
|
21
|
+
space: string;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* The key of the project the request belongs to.
|
|
24
24
|
*/
|
|
25
|
-
project
|
|
25
|
+
project: string;
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* The application id that generated the history entry.
|
|
28
28
|
*/
|
|
29
|
-
app
|
|
29
|
+
app: string;
|
|
30
30
|
/**
|
|
31
|
-
* The
|
|
32
|
-
* Note, the default API Client's store automatically adds the user information to the record overriding any pre-set user id, making it a read-only
|
|
33
|
-
* value.
|
|
34
|
-
*
|
|
35
|
-
* @readonly
|
|
31
|
+
* The key of the request that generated the history entry.
|
|
36
32
|
*/
|
|
37
|
-
|
|
33
|
+
request: string;
|
|
38
34
|
/**
|
|
39
|
-
* The
|
|
35
|
+
* The user id that made that request.
|
|
36
|
+
* This is only available when the store support multi-user environment.
|
|
40
37
|
*/
|
|
41
|
-
|
|
38
|
+
user?: string;
|
|
42
39
|
/**
|
|
43
40
|
* The request log.
|
|
44
41
|
*/
|
|
@@ -62,21 +59,21 @@ export interface IHttpHistory {
|
|
|
62
59
|
*/
|
|
63
60
|
export interface IHttpHistoryBulkAdd {
|
|
64
61
|
/**
|
|
65
|
-
*
|
|
62
|
+
* The key of the parent workspace.
|
|
66
63
|
*/
|
|
67
|
-
space
|
|
64
|
+
space: string;
|
|
68
65
|
/**
|
|
69
|
-
*
|
|
66
|
+
* The key of the project the request belongs to.
|
|
70
67
|
*/
|
|
71
|
-
project
|
|
68
|
+
project: string;
|
|
72
69
|
/**
|
|
73
|
-
*
|
|
70
|
+
* The application id that generated the history entry.
|
|
74
71
|
*/
|
|
75
|
-
app
|
|
72
|
+
app: string;
|
|
76
73
|
/**
|
|
77
|
-
* The
|
|
74
|
+
* The key of the request that generated the history entry.
|
|
78
75
|
*/
|
|
79
|
-
request
|
|
76
|
+
request: string;
|
|
80
77
|
/**
|
|
81
78
|
* The list of request logs.
|
|
82
79
|
*/
|
|
@@ -96,33 +93,31 @@ export class HttpHistory {
|
|
|
96
93
|
|
|
97
94
|
kind = Kind;
|
|
98
95
|
/**
|
|
99
|
-
* The
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
* Note for data store implementations. This must be a URL-safe value so the id should be encoded if needed.
|
|
96
|
+
* The key of the history entry. The application must
|
|
97
|
+
* revalidate the local copy of the record as the store may change the key.
|
|
103
98
|
*/
|
|
104
|
-
key
|
|
99
|
+
key = '';
|
|
105
100
|
/**
|
|
106
|
-
*
|
|
101
|
+
* The key of the parent workspace.
|
|
107
102
|
*/
|
|
108
|
-
space
|
|
103
|
+
space = '';
|
|
109
104
|
/**
|
|
110
|
-
*
|
|
105
|
+
* The key of the project the request belongs to.
|
|
111
106
|
*/
|
|
112
|
-
project
|
|
107
|
+
project = '';
|
|
113
108
|
/**
|
|
114
|
-
*
|
|
109
|
+
* The application id that generated the history entry.
|
|
115
110
|
*/
|
|
116
|
-
app
|
|
111
|
+
app = '';
|
|
117
112
|
/**
|
|
118
113
|
* The user id that made that request.
|
|
119
|
-
*
|
|
114
|
+
* This is only available when the store support multi-user environment.
|
|
120
115
|
*/
|
|
121
116
|
user = '';
|
|
122
117
|
/**
|
|
123
|
-
* The
|
|
118
|
+
* The key of the request that generated the history entry.
|
|
124
119
|
*/
|
|
125
|
-
request
|
|
120
|
+
request = '';
|
|
126
121
|
/**
|
|
127
122
|
* The execution log of the HTTP request with a response.
|
|
128
123
|
*/
|
|
@@ -182,6 +177,11 @@ export class HttpHistory {
|
|
|
182
177
|
kind: Kind,
|
|
183
178
|
created: now,
|
|
184
179
|
user: '',
|
|
180
|
+
app: '',
|
|
181
|
+
key: '',
|
|
182
|
+
project: '',
|
|
183
|
+
request: '',
|
|
184
|
+
space: '',
|
|
185
185
|
log: {
|
|
186
186
|
kind: RequestLogKind,
|
|
187
187
|
},
|
|
@@ -197,12 +197,12 @@ export class HttpHistory {
|
|
|
197
197
|
if (key) {
|
|
198
198
|
this.key = key;
|
|
199
199
|
} else {
|
|
200
|
-
this.key =
|
|
200
|
+
this.key = '';
|
|
201
201
|
}
|
|
202
202
|
if (app) {
|
|
203
203
|
this.app = app;
|
|
204
204
|
} else {
|
|
205
|
-
this.app =
|
|
205
|
+
this.app = '';
|
|
206
206
|
}
|
|
207
207
|
if (midnight) {
|
|
208
208
|
this.midnight = midnight;
|
|
@@ -210,17 +210,17 @@ export class HttpHistory {
|
|
|
210
210
|
if (space) {
|
|
211
211
|
this.space = space;
|
|
212
212
|
} else {
|
|
213
|
-
this.space =
|
|
213
|
+
this.space = '';
|
|
214
214
|
}
|
|
215
215
|
if (project) {
|
|
216
216
|
this.project = project;
|
|
217
217
|
} else {
|
|
218
|
-
this.project =
|
|
218
|
+
this.project = '';
|
|
219
219
|
}
|
|
220
220
|
if (request) {
|
|
221
221
|
this.request = request;
|
|
222
222
|
} else {
|
|
223
|
-
this.request =
|
|
223
|
+
this.request = '';
|
|
224
224
|
}
|
|
225
225
|
if (user) {
|
|
226
226
|
this.user = user;
|
|
@@ -236,22 +236,12 @@ export class HttpHistory {
|
|
|
236
236
|
midnight: this.midnight,
|
|
237
237
|
log: this.log.toJSON(),
|
|
238
238
|
user: this.user,
|
|
239
|
+
key: this.key,
|
|
240
|
+
space: this.space,
|
|
241
|
+
project: this.project,
|
|
242
|
+
request: this.request,
|
|
243
|
+
app: this.app,
|
|
239
244
|
};
|
|
240
|
-
if (this.key) {
|
|
241
|
-
result.key = this.key;
|
|
242
|
-
}
|
|
243
|
-
if (this.space) {
|
|
244
|
-
result.space = this.space;
|
|
245
|
-
}
|
|
246
|
-
if (this.project) {
|
|
247
|
-
result.project = this.project;
|
|
248
|
-
}
|
|
249
|
-
if (this.request) {
|
|
250
|
-
result.request = this.request;
|
|
251
|
-
}
|
|
252
|
-
if (this.app) {
|
|
253
|
-
result.app = this.app;
|
|
254
|
-
}
|
|
255
245
|
return result;
|
|
256
246
|
}
|
|
257
247
|
|