@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.
Files changed (207) hide show
  1. package/build/browser.d.ts +12 -5
  2. package/build/browser.js +2 -3
  3. package/build/browser.js.map +1 -1
  4. package/build/index.d.ts +12 -5
  5. package/build/index.js +2 -4
  6. package/build/index.js.map +1 -1
  7. package/build/src/events/BaseEvents.d.ts +137 -18
  8. package/build/src/events/BaseEvents.js.map +1 -1
  9. package/build/src/events/EventTypes.d.ts +0 -14
  10. package/build/src/events/EventTypes.js +0 -2
  11. package/build/src/events/EventTypes.js.map +1 -1
  12. package/build/src/events/Events.d.ts +1 -5
  13. package/build/src/events/Events.js +0 -2
  14. package/build/src/events/Events.js.map +1 -1
  15. package/build/src/events/transport/TransportEventTypes.d.ts +0 -1
  16. package/build/src/events/transport/TransportEventTypes.js +0 -1
  17. package/build/src/events/transport/TransportEventTypes.js.map +1 -1
  18. package/build/src/events/transport/TransportEvents.d.ts +0 -8
  19. package/build/src/events/transport/TransportEvents.js +0 -11
  20. package/build/src/events/transport/TransportEvents.js.map +1 -1
  21. package/build/src/mocking/ProjectMock.d.ts +0 -3
  22. package/build/src/mocking/ProjectMock.js +0 -3
  23. package/build/src/mocking/ProjectMock.js.map +1 -1
  24. package/build/src/mocking/lib/History.js +5 -0
  25. package/build/src/mocking/lib/History.js.map +1 -1
  26. package/build/src/models/{Workspace.d.ts → Folder.d.ts} +7 -7
  27. package/build/src/models/{Workspace.js → Folder.js} +5 -5
  28. package/build/src/models/Folder.js.map +1 -0
  29. package/build/src/models/HttpHistory.d.ts +38 -43
  30. package/build/src/models/HttpHistory.js +27 -34
  31. package/build/src/models/HttpHistory.js.map +1 -1
  32. package/build/src/models/HttpProject.d.ts +0 -2
  33. package/build/src/models/HttpProject.js +0 -27
  34. package/build/src/models/HttpProject.js.map +1 -1
  35. package/build/src/models/Project.d.ts +0 -8
  36. package/build/src/models/Project.js +0 -4
  37. package/build/src/models/Project.js.map +1 -1
  38. package/build/src/models/ProjectFolder.d.ts +0 -2
  39. package/build/src/models/ProjectFolder.js +0 -14
  40. package/build/src/models/ProjectFolder.js.map +1 -1
  41. package/build/src/models/ProjectItem.d.ts +0 -2
  42. package/build/src/models/ProjectItem.js +0 -20
  43. package/build/src/models/ProjectItem.js.map +1 -1
  44. package/build/src/models/ProjectRequest.d.ts +2 -3
  45. package/build/src/models/ProjectRequest.js.map +1 -1
  46. package/build/src/models/RequestConfig.d.ts +1 -1
  47. package/build/src/models/Space.d.ts +25 -0
  48. package/build/src/models/Space.js +76 -0
  49. package/build/src/models/Space.js.map +1 -0
  50. package/build/src/models/TrashEntry.d.ts +27 -0
  51. package/build/src/models/TrashEntry.js +2 -0
  52. package/build/src/models/TrashEntry.js.map +1 -0
  53. package/build/src/models/store/Backend.d.ts +0 -315
  54. package/build/src/models/store/Backend.js +0 -1
  55. package/build/src/models/store/Backend.js.map +1 -1
  56. package/build/src/models/store/File.d.ts +31 -1
  57. package/build/src/models/store/File.js +6 -6
  58. package/build/src/models/store/File.js.map +1 -1
  59. package/build/src/proxy/HttpProjectProxy.d.ts +4 -0
  60. package/build/src/proxy/HttpProjectProxy.js +10 -2
  61. package/build/src/proxy/HttpProjectProxy.js.map +1 -1
  62. package/build/src/proxy/ProxyService.d.ts +0 -10
  63. package/build/src/proxy/ProxyService.js +0 -14
  64. package/build/src/proxy/ProxyService.js.map +1 -1
  65. package/build/src/runtime/node/InteropInterfaces.d.ts +1 -2
  66. package/build/src/runtime/node/ProjectParallelRunner.d.ts +2 -3
  67. package/build/src/runtime/node/ProjectParallelRunner.js.map +1 -1
  68. package/build/src/runtime/node/ProjectRequestRunner.d.ts +7 -8
  69. package/build/src/runtime/node/ProjectRequestRunner.js +2 -3
  70. package/build/src/runtime/node/ProjectRequestRunner.js.map +1 -1
  71. package/build/src/runtime/node/ProjectRunner.d.ts +3 -4
  72. package/build/src/runtime/node/ProjectRunner.js.map +1 -1
  73. package/build/src/runtime/node/ProjectRunnerWorker.js +0 -4
  74. package/build/src/runtime/node/ProjectRunnerWorker.js.map +1 -1
  75. package/build/src/runtime/store/CertificatesSdk.d.ts +46 -0
  76. package/build/src/runtime/store/CertificatesSdk.js +227 -0
  77. package/build/src/runtime/store/CertificatesSdk.js.map +1 -0
  78. package/build/src/runtime/store/FilesSdk.d.ts +21 -16
  79. package/build/src/runtime/store/FilesSdk.js +75 -23
  80. package/build/src/runtime/store/FilesSdk.js.map +1 -1
  81. package/build/src/runtime/store/HistorySdk.d.ts +11 -8
  82. package/build/src/runtime/store/HistorySdk.js +140 -17
  83. package/build/src/runtime/store/HistorySdk.js.map +1 -1
  84. package/build/src/runtime/store/RevisionsSdk.d.ts +12 -0
  85. package/build/src/runtime/store/RevisionsSdk.js +43 -0
  86. package/build/src/runtime/store/RevisionsSdk.js.map +1 -0
  87. package/build/src/runtime/store/RouteBuilder.d.ts +16 -18
  88. package/build/src/runtime/store/RouteBuilder.js +33 -60
  89. package/build/src/runtime/store/RouteBuilder.js.map +1 -1
  90. package/build/src/runtime/store/Sdk.d.ts +10 -7
  91. package/build/src/runtime/store/Sdk.js +12 -5
  92. package/build/src/runtime/store/Sdk.js.map +1 -1
  93. package/build/src/runtime/store/SdkBase.js.map +1 -1
  94. package/build/src/runtime/store/SharedSdk.d.ts +2 -2
  95. package/build/src/runtime/store/SharedSdk.js.map +1 -1
  96. package/build/src/runtime/store/SpacesSdk.d.ts +29 -0
  97. package/build/src/runtime/store/SpacesSdk.js +135 -0
  98. package/build/src/runtime/store/SpacesSdk.js.map +1 -0
  99. package/build/src/runtime/store/TrashSdk.d.ts +35 -0
  100. package/build/src/runtime/store/TrashSdk.js +155 -0
  101. package/build/src/runtime/store/TrashSdk.js.map +1 -0
  102. package/build/src/runtime/store/UsersSdk.d.ts +2 -2
  103. package/build/src/runtime/store/UsersSdk.js.map +1 -1
  104. package/build/src/runtime/store/interfaces/ApiClientStore.d.ts +30 -0
  105. package/build/src/runtime/store/interfaces/ApiClientStore.js +2 -0
  106. package/build/src/runtime/store/interfaces/ApiClientStore.js.map +1 -0
  107. package/build/src/runtime/store/interfaces/Certificates.d.ts +49 -0
  108. package/build/src/runtime/store/interfaces/Certificates.js +2 -0
  109. package/build/src/runtime/store/interfaces/Certificates.js.map +1 -0
  110. package/build/src/runtime/store/interfaces/Files.d.ts +63 -0
  111. package/build/src/runtime/store/interfaces/Files.js +2 -0
  112. package/build/src/runtime/store/interfaces/Files.js.map +1 -0
  113. package/build/src/runtime/store/interfaces/History.d.ts +63 -0
  114. package/build/src/runtime/store/interfaces/History.js +2 -0
  115. package/build/src/runtime/store/interfaces/History.js.map +1 -0
  116. package/build/src/runtime/store/interfaces/Media.d.ts +42 -0
  117. package/build/src/runtime/store/interfaces/Media.js +2 -0
  118. package/build/src/runtime/store/interfaces/Media.js.map +1 -0
  119. package/build/src/runtime/store/interfaces/Revisions.d.ts +25 -0
  120. package/build/src/runtime/store/interfaces/Revisions.js +2 -0
  121. package/build/src/runtime/store/interfaces/Revisions.js.map +1 -0
  122. package/build/src/runtime/store/interfaces/Spaces.d.ts +42 -0
  123. package/build/src/runtime/store/interfaces/Spaces.js +2 -0
  124. package/build/src/runtime/store/interfaces/Spaces.js.map +1 -0
  125. package/build/src/runtime/store/interfaces/Trash.d.ts +38 -0
  126. package/build/src/runtime/store/interfaces/Trash.js +2 -0
  127. package/build/src/runtime/store/interfaces/Trash.js.map +1 -0
  128. package/package.json +1 -1
  129. package/src/events/BaseEvents.ts +148 -18
  130. package/src/events/EventTypes.ts +0 -2
  131. package/src/events/Events.ts +0 -2
  132. package/src/events/transport/TransportEventTypes.ts +0 -1
  133. package/src/events/transport/TransportEvents.ts +0 -13
  134. package/src/mocking/ProjectMock.ts +0 -4
  135. package/src/mocking/lib/History.ts +5 -0
  136. package/src/models/{Workspace.ts → Folder.ts} +12 -12
  137. package/src/models/HttpHistory.ts +53 -63
  138. package/src/models/HttpProject.ts +0 -29
  139. package/src/models/Project.ts +0 -8
  140. package/src/models/ProjectFolder.ts +0 -16
  141. package/src/models/ProjectItem.ts +0 -18
  142. package/src/models/ProjectRequest.ts +3 -4
  143. package/src/models/RequestConfig.ts +1 -1
  144. package/src/models/Space.ts +91 -0
  145. package/src/models/TrashEntry.ts +29 -0
  146. package/src/models/store/Backend.ts +0 -342
  147. package/src/models/store/File.ts +39 -6
  148. package/src/proxy/HttpProjectProxy.ts +14 -2
  149. package/src/proxy/ProxyService.ts +0 -15
  150. package/src/proxy/readme.md +0 -1
  151. package/src/runtime/node/InteropInterfaces.ts +1 -2
  152. package/src/runtime/node/ProjectParallelRunner.ts +2 -3
  153. package/src/runtime/node/ProjectRequestRunner.ts +13 -14
  154. package/src/runtime/node/ProjectRunner.ts +3 -4
  155. package/src/runtime/node/ProjectRunnerWorker.ts +1 -4
  156. package/src/runtime/store/CertificatesSdk.ts +231 -0
  157. package/src/runtime/store/FilesSdk.ts +88 -35
  158. package/src/runtime/store/HistorySdk.ts +145 -33
  159. package/src/runtime/store/RevisionsSdk.ts +44 -0
  160. package/src/runtime/store/RouteBuilder.ts +37 -69
  161. package/src/runtime/store/Sdk.ts +17 -7
  162. package/src/runtime/store/SdkBase.ts +1 -1
  163. package/src/runtime/store/SharedSdk.ts +3 -3
  164. package/src/runtime/store/SpacesSdk.ts +136 -0
  165. package/src/runtime/store/TrashSdk.ts +159 -0
  166. package/src/runtime/store/UsersSdk.ts +3 -3
  167. package/src/runtime/store/interfaces/ApiClientStore.ts +39 -0
  168. package/src/runtime/store/interfaces/Certificates.ts +56 -0
  169. package/src/runtime/store/interfaces/Files.ts +70 -0
  170. package/src/runtime/store/interfaces/History.ts +64 -0
  171. package/src/runtime/store/interfaces/Media.ts +46 -0
  172. package/src/runtime/store/interfaces/Revisions.ts +27 -0
  173. package/src/runtime/store/interfaces/Spaces.ts +48 -0
  174. package/src/runtime/store/interfaces/Trash.ts +42 -0
  175. package/build/src/events/models/ClientCertificateEvents.d.ts +0 -54
  176. package/build/src/events/models/ClientCertificateEvents.js +0 -78
  177. package/build/src/events/models/ClientCertificateEvents.js.map +0 -1
  178. package/build/src/events/models/ModelEventTypes.d.ts +0 -13
  179. package/build/src/events/models/ModelEventTypes.js +0 -14
  180. package/build/src/events/models/ModelEventTypes.js.map +0 -1
  181. package/build/src/events/models/ModelEvents.d.ts +0 -4
  182. package/build/src/events/models/ModelEvents.js +0 -5
  183. package/build/src/events/models/ModelEvents.js.map +0 -1
  184. package/build/src/mocking/lib/App.d.ts +0 -36
  185. package/build/src/mocking/lib/App.js +0 -70
  186. package/build/src/mocking/lib/App.js.map +0 -1
  187. package/build/src/models/AppProject.d.ts +0 -817
  188. package/build/src/models/AppProject.js +0 -1721
  189. package/build/src/models/AppProject.js.map +0 -1
  190. package/build/src/models/AppRequest.d.ts +0 -69
  191. package/build/src/models/AppRequest.js +0 -150
  192. package/build/src/models/AppRequest.js.map +0 -1
  193. package/build/src/models/Workspace.js.map +0 -1
  194. package/build/src/proxy/AppProjectProxy.d.ts +0 -28
  195. package/build/src/proxy/AppProjectProxy.js +0 -107
  196. package/build/src/proxy/AppProjectProxy.js.map +0 -1
  197. package/build/src/runtime/store/AppSdk.d.ts +0 -213
  198. package/build/src/runtime/store/AppSdk.js +0 -836
  199. package/build/src/runtime/store/AppSdk.js.map +0 -1
  200. package/src/events/models/ClientCertificateEvents.ts +0 -85
  201. package/src/events/models/ModelEventTypes.ts +0 -13
  202. package/src/events/models/ModelEvents.ts +0 -5
  203. package/src/mocking/lib/App.ts +0 -101
  204. package/src/models/AppProject.ts +0 -2188
  205. package/src/models/AppRequest.ts +0 -176
  206. package/src/proxy/AppProjectProxy.ts +0 -126
  207. package/src/runtime/store/AppSdk.ts +0 -842
@@ -16,7 +16,6 @@ import v4 from '../lib/uuid.js';
16
16
  import { ARCSavedRequest, ARCHistoryRequest } from './legacy/request/ArcRequest.js';
17
17
  import { ArcLegacyProject, ARCProject } from './legacy/models/ArcLegacyProject.js';
18
18
  import { PostmanDataTransformer } from './transformers/PostmanDataTransformer.js';
19
- import { IAppProject } from './AppProject.js';
20
19
  import { Certificate, HttpCertificate } from './ClientCertificate.js';
21
20
  import { ICCAuthorization } from './Authorization.js';
22
21
 
@@ -352,34 +351,6 @@ export class HttpProject extends ProjectParent {
352
351
  return HttpProject.fromName(name);
353
352
  }
354
353
 
355
- static fromAppProject(init: IAppProject): HttpProject {
356
- const result = new HttpProject();
357
- const { definitions = {}, items, info, key = v4() } = init;
358
- result.key = key;
359
- result.info = new Thing(info);
360
- if (Array.isArray(items)) {
361
- result.items = items.map(i => ProjectItem.fromAppProject(result, i));
362
- }
363
- if (Array.isArray(definitions.environments)) {
364
- result.definitions.environments = definitions.environments.map(i => new Environment(i));
365
- }
366
- if (Array.isArray(definitions.requests)) {
367
- result.definitions.requests = definitions.requests.map(i => {
368
- const instance = new ProjectRequest(result, i);
369
- instance.attachedCallback();
370
- return instance;
371
- });
372
- }
373
- if (Array.isArray(definitions.folders)) {
374
- result.definitions.folders = definitions.folders.map(i => {
375
- const instance = ProjectFolder.fromAppProject(result, i);
376
- instance.attachedCallback();
377
- return instance;
378
- });
379
- }
380
- return result;
381
- }
382
-
383
354
  /**
384
355
  * @param input The project definition used to restore the state.
385
356
  * @param environments Optional list of environments to use with this project. It overrides environments stored in the project definition.
@@ -8,10 +8,6 @@ export const Kind = 'Core#Project';
8
8
  /**
9
9
  * This model represents a meta data for an HTTP project stored with the data store.
10
10
  * This does not include the HTTP project entity, though, it is referenced through the same key.
11
- *
12
- * A concept of a project is similar to a Workspace. It is an object that is rendered in the UIs
13
- * like a workspace but has a different meaning. On the store side, when listing workspace items,
14
- * both spaces and projects are returned in a single query.
15
11
  */
16
12
  export interface IProject extends IFile {
17
13
  kind: typeof Kind;
@@ -20,10 +16,6 @@ export interface IProject extends IFile {
20
16
  /**
21
17
  * This model represents a meta data for an HTTP project stored with the data store.
22
18
  * This does not include the HTTP project entity, though, it is referenced through the same key.
23
- *
24
- * A concept of a project is similar to a Workspace. It is an object that is rendered in the UIs
25
- * like a workspace but has a different meaning. On the store side, when listing workspace items,
26
- * both spaces and projects are returned in a single query.
27
19
  */
28
20
  export class Project extends File {
29
21
  override kind = Kind;
@@ -6,7 +6,6 @@ import { HttpProject, IEnvironmentCreateOptions } from './HttpProject.js';
6
6
  import { IThing, Thing, Kind as ThingKind } from './Thing.js';
7
7
  import { Environment, IEnvironment } from './Environment.js';
8
8
  import v4 from '../lib/uuid.js';
9
- import { IAppProjectParent } from './AppProject.js';
10
9
 
11
10
  export const Kind = 'Core#ProjectFolder';
12
11
  export const DefaultFolderName = 'New folder';
@@ -95,21 +94,6 @@ export class ProjectFolder extends ProjectParent {
95
94
  */
96
95
  created = 0;
97
96
 
98
- static fromAppProject(project: HttpProject, init: IAppProjectParent): ProjectFolder {
99
- const result = new ProjectFolder(project);
100
- const { key = v4(), created = Date.now(), updated = Date.now(), items, info } = init;
101
- result.key = key;
102
- result.created = created;
103
- result.updated = updated;
104
- if (info) {
105
- result.info = new Thing(info);
106
- }
107
- if (Array.isArray(items)) {
108
- result.items = items.map(i => ProjectItem.fromAppProject(project, i));
109
- }
110
- return result;
111
- }
112
-
113
97
  constructor(project: HttpProject, input?: string | IProjectFolder) {
114
98
  super();
115
99
  this.project = project;
@@ -2,7 +2,6 @@ import { Kind as ProjectFolderKind, ProjectFolder } from './ProjectFolder.js';
2
2
  import { Kind as ProjectRequestKind, ProjectRequest } from './ProjectRequest.js';
3
3
  import { Kind as EnvironmentKind, Environment } from './Environment.js';
4
4
  import { HttpProject } from './HttpProject.js';
5
- import { AppProjectFolderKind, AppProjectRequestKind, IAppProjectItem } from './AppProject.js';
6
5
 
7
6
  type Kind = typeof ProjectFolderKind | typeof ProjectRequestKind | typeof EnvironmentKind;
8
7
 
@@ -75,23 +74,6 @@ export class ProjectItem {
75
74
  return item;
76
75
  }
77
76
 
78
- static fromAppProject(project: HttpProject, item: IAppProjectItem): ProjectItem {
79
- let kind: Kind;
80
- if (item.kind === AppProjectFolderKind) {
81
- kind = ProjectFolderKind
82
- } else if (item.kind === AppProjectRequestKind) {
83
- kind = ProjectRequestKind
84
- } else if (item.kind === EnvironmentKind) {
85
- kind = EnvironmentKind
86
- } else {
87
- throw new Error(`Invalid item kind: ${item.kind}`);
88
- }
89
- return new ProjectItem(project, {
90
- kind,
91
- key: item.key,
92
- });
93
- }
94
-
95
77
  /**
96
78
  * @param project The top-most project.
97
79
  * @param input The project item definition used to restore the state.
@@ -5,7 +5,6 @@ import { IHttpRequest, Kind as HttpRequestKind } from './HttpRequest.js';
5
5
  import { HttpProject } from './HttpProject.js';
6
6
  import v4 from '../lib/uuid.js';
7
7
  import { IRequest, Request } from './Request.js';
8
- import { IAppProjectRequest } from './AppProject.js';
9
8
  import { Environment } from './Environment.js';
10
9
  import { Property } from './Property.js';
11
10
  import { Server } from './Server.js';
@@ -198,10 +197,10 @@ export class ProjectRequest extends Request implements ProjectDefinitionProperty
198
197
  return result;
199
198
  }
200
199
 
201
- constructor(project: HttpProject, input?: string | IProjectRequest | IAppProjectRequest) {
200
+ constructor(project: HttpProject, input?: string | IProjectRequest) {
202
201
  super(input);
203
202
  this.project = project;
204
- let init: IProjectRequest | IAppProjectRequest;
203
+ let init: IProjectRequest;
205
204
  if (typeof input === 'string') {
206
205
  init = JSON.parse(input);
207
206
  } else if (typeof input === 'object') {
@@ -227,7 +226,7 @@ export class ProjectRequest extends Request implements ProjectDefinitionProperty
227
226
  this.new(init);
228
227
  }
229
228
 
230
- override new(init: IProjectRequest | IAppProjectRequest): void {
229
+ override new(init: IProjectRequest): void {
231
230
  super.new(init);
232
231
 
233
232
  const { key, environment } = init as IProjectRequest;
@@ -82,7 +82,7 @@ export interface IRequestConfig extends IRequestBaseConfig {
82
82
  ignoreSessionCookies?: boolean;
83
83
  /**
84
84
  * A list of variables to use with the request.
85
- * Note, request variables override application and workspace variables.
85
+ * Note, request variables override application and Folder variables.
86
86
  */
87
87
  variables?: IProperty[];
88
88
  }
@@ -0,0 +1,91 @@
1
+ import { Kind as ThingKind } from "./Thing.js";
2
+ import v4 from '../lib/uuid.js';
3
+ import { DefaultOwner, File, IFile } from "./store/File.js";
4
+
5
+ export const Kind = 'Core#Space';
6
+
7
+ /**
8
+ * The definition of a space (or workspace).
9
+ * A space is the parent container keeping all the data the user sees in the application.
10
+ * By changing space the user has completely different set of data.
11
+ *
12
+ * This has the same properties as a file stored in a filesystem and as such is represented.
13
+ */
14
+ export interface ISpace extends IFile {
15
+ kind: typeof Kind;
16
+ }
17
+
18
+ /**
19
+ * The definition of a space (or workspace).
20
+ * A space is the parent container keeping all the data the user sees in the application.
21
+ * By changing space the user has completely different set of data.
22
+ */
23
+ export class Space extends File {
24
+ override kind = Kind;
25
+
26
+ static fromName(name: string): Space {
27
+ const init: ISpace = {
28
+ kind: Kind,
29
+ key: v4(),
30
+ info: {
31
+ kind: ThingKind,
32
+ name,
33
+ },
34
+ lastModified: { user: '', time: 0, byMe: false },
35
+ owner: DefaultOwner,
36
+ parents: [],
37
+ permissionIds: [],
38
+ permissions: [],
39
+ };
40
+ return new Space(init);
41
+ }
42
+
43
+ constructor(input?: string | ISpace) {
44
+ super();
45
+ let init: ISpace;
46
+ if (typeof input === 'string') {
47
+ init = JSON.parse(input);
48
+ } else if (typeof input === 'object') {
49
+ init = input;
50
+ } else {
51
+ init = {
52
+ kind: Kind,
53
+ key: v4(),
54
+ info: {
55
+ kind: ThingKind,
56
+ name: '',
57
+ },
58
+ owner: DefaultOwner,
59
+ parents: [],
60
+ permissionIds: [],
61
+ permissions: [],
62
+ lastModified: { user: '', time: 0, byMe: false },
63
+ };
64
+ }
65
+ this.new(init);
66
+ }
67
+
68
+ override new(init: ISpace): void {
69
+ if (!Space.isProject(init)) {
70
+ throw new Error(`Not a project file.`);
71
+ }
72
+ super.new(init);
73
+ this.kind = Kind;
74
+ }
75
+
76
+ static isProject(input: unknown): boolean {
77
+ const typed = input as ISpace;
78
+ if (!input || typed.kind !== Kind) {
79
+ return false;
80
+ }
81
+ return true;
82
+ }
83
+
84
+ override toJSON(): ISpace {
85
+ const result: ISpace = {
86
+ ...super.toJSON(),
87
+ kind: Kind,
88
+ };
89
+ return result;
90
+ }
91
+ }
@@ -0,0 +1,29 @@
1
+ import { IDeletion } from "./store/Deletion.js";
2
+
3
+ export interface TrashEntryCreate {
4
+ /**
5
+ * The store key of the object that has been deleted.
6
+ */
7
+ file: string;
8
+ /**
9
+ * The kind of the delete object.
10
+ */
11
+ kind: string;
12
+ /**
13
+ * The name of the deleted object.
14
+ *
15
+ * If the object does not have a name then it shouldn't be here.
16
+ */
17
+ name: string;
18
+ }
19
+
20
+ export interface TrashEntry extends TrashEntryCreate {
21
+ /**
22
+ * The key of the trash entry.
23
+ */
24
+ key: string;
25
+ /**
26
+ * The delete info.
27
+ */
28
+ info: IDeletion;
29
+ }
@@ -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
- }