@api-client/core 0.9.16 → 0.9.18
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 +1 -0
- package/build/browser.js +1 -0
- package/build/browser.js.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/index.js.map +1 -1
- package/build/src/models/CertificateFile.d.ts +14 -0
- package/build/src/models/CertificateFile.js +65 -0
- package/build/src/models/CertificateFile.js.map +1 -0
- package/build/src/models/Folder.js +3 -18
- package/build/src/models/Folder.js.map +1 -1
- package/build/src/models/Project.d.ts +1 -1
- package/build/src/models/Project.js +6 -9
- package/build/src/models/Project.js.map +1 -1
- package/build/src/models/Space.js +3 -19
- package/build/src/models/Space.js.map +1 -1
- package/build/src/models/data/DataFile.js +5 -8
- package/build/src/models/data/DataFile.js.map +1 -1
- package/build/src/models/store/Backend.d.ts +15 -15
- package/build/src/models/store/File.d.ts +7 -0
- package/build/src/models/store/File.js +21 -0
- package/build/src/models/store/File.js.map +1 -1
- package/build/src/runtime/store/CertificatesSdk.d.ts +7 -7
- package/build/src/runtime/store/CertificatesSdk.js +7 -11
- package/build/src/runtime/store/CertificatesSdk.js.map +1 -1
- package/build/src/runtime/store/FilesSdk.d.ts +2 -16
- package/build/src/runtime/store/FilesSdk.js +0 -27
- package/build/src/runtime/store/FilesSdk.js.map +1 -1
- package/build/src/runtime/store/HistorySdk.d.ts +0 -7
- package/build/src/runtime/store/HistorySdk.js +0 -11
- package/build/src/runtime/store/HistorySdk.js.map +1 -1
- package/build/src/runtime/store/ProjectExecutionsSdk.d.ts +0 -7
- package/build/src/runtime/store/ProjectExecutionsSdk.js +0 -11
- package/build/src/runtime/store/ProjectExecutionsSdk.js.map +1 -1
- package/build/src/runtime/store/Sdk.d.ts +3 -0
- package/build/src/runtime/store/Sdk.js +6 -0
- package/build/src/runtime/store/Sdk.js.map +1 -1
- package/data/models/example-generator-api.json +6 -6
- package/package.json +1 -1
- package/src/models/CertificateFile.ts +74 -0
- package/src/models/Folder.ts +4 -19
- package/src/models/Project.ts +6 -9
- package/src/models/Space.ts +4 -20
- package/src/models/data/DataFile.ts +5 -8
- package/src/models/store/Backend.ts +17 -16
- package/src/models/store/File.ts +22 -0
- package/src/runtime/store/CertificatesSdk.ts +7 -13
- package/src/runtime/store/FilesSdk.ts +2 -31
- package/src/runtime/store/HistorySdk.ts +0 -13
- package/src/runtime/store/ProjectExecutionsSdk.ts +0 -13
- package/src/runtime/store/Sdk.ts +6 -0
package/src/models/Project.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IFile, File, DefaultOwner } from "./store/File.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Thing } from './Thing.js';
|
|
3
3
|
import { HttpProject, IHttpProject } from './HttpProject.js';
|
|
4
4
|
import v4 from '../lib/uuid.js';
|
|
5
5
|
|
|
@@ -20,7 +20,7 @@ export interface IProject extends IFile {
|
|
|
20
20
|
export class Project extends File {
|
|
21
21
|
override kind = Kind;
|
|
22
22
|
|
|
23
|
-
static fromProject(project: HttpProject | IHttpProject): Project {
|
|
23
|
+
static fromProject(project: HttpProject | IHttpProject, owner = DefaultOwner): Project {
|
|
24
24
|
let final: IHttpProject;
|
|
25
25
|
if (typeof (project as HttpProject).toJSON === 'function') {
|
|
26
26
|
final = (project as HttpProject).toJSON();
|
|
@@ -29,10 +29,10 @@ export class Project extends File {
|
|
|
29
29
|
}
|
|
30
30
|
const init: IProject = {
|
|
31
31
|
kind: Kind,
|
|
32
|
-
key:
|
|
32
|
+
key: project.key,
|
|
33
33
|
info: { ...final.info },
|
|
34
|
-
lastModified: { user:
|
|
35
|
-
owner
|
|
34
|
+
lastModified: { user: owner, time: 0, byMe: false },
|
|
35
|
+
owner,
|
|
36
36
|
parents: [],
|
|
37
37
|
permissionIds: [],
|
|
38
38
|
permissions: [],
|
|
@@ -51,10 +51,7 @@ export class Project extends File {
|
|
|
51
51
|
init = {
|
|
52
52
|
kind: Kind,
|
|
53
53
|
key: v4(),
|
|
54
|
-
info:
|
|
55
|
-
kind: ThingKind,
|
|
56
|
-
name: '',
|
|
57
|
-
},
|
|
54
|
+
info: Thing.fromName('').toJSON(),
|
|
58
55
|
owner: DefaultOwner,
|
|
59
56
|
parents: [],
|
|
60
57
|
permissionIds: [],
|
package/src/models/Space.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Thing } from "./Thing.js";
|
|
2
2
|
import v4 from '../lib/uuid.js';
|
|
3
3
|
import { DefaultOwner, File, IFile } from "./store/File.js";
|
|
4
4
|
|
|
@@ -23,21 +23,8 @@ export interface ISpace extends IFile {
|
|
|
23
23
|
export class Space extends File {
|
|
24
24
|
override kind = Kind;
|
|
25
25
|
|
|
26
|
-
static fromName(name: string, owner = DefaultOwner): Space {
|
|
27
|
-
|
|
28
|
-
kind: Kind,
|
|
29
|
-
key: v4(),
|
|
30
|
-
info: {
|
|
31
|
-
kind: ThingKind,
|
|
32
|
-
name,
|
|
33
|
-
},
|
|
34
|
-
lastModified: { user: '', time: 0, byMe: false },
|
|
35
|
-
owner,
|
|
36
|
-
parents: [],
|
|
37
|
-
permissionIds: [],
|
|
38
|
-
permissions: [],
|
|
39
|
-
};
|
|
40
|
-
return new Space(init);
|
|
26
|
+
static override fromName(name: string, owner = DefaultOwner): Space {
|
|
27
|
+
return super.fromName(name, owner, Kind) as Space;
|
|
41
28
|
}
|
|
42
29
|
|
|
43
30
|
constructor(input?: string | ISpace) {
|
|
@@ -51,10 +38,7 @@ export class Space extends File {
|
|
|
51
38
|
init = {
|
|
52
39
|
kind: Kind,
|
|
53
40
|
key: v4(),
|
|
54
|
-
info:
|
|
55
|
-
kind: ThingKind,
|
|
56
|
-
name: '',
|
|
57
|
-
},
|
|
41
|
+
info: Thing.fromName('').toJSON(),
|
|
58
42
|
owner: DefaultOwner,
|
|
59
43
|
parents: [],
|
|
60
44
|
permissionIds: [],
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import v4 from "../../lib/uuid.js";
|
|
2
2
|
import { File, IFile, DefaultOwner } from "../store/File.js";
|
|
3
|
-
import {
|
|
3
|
+
import { Thing } from '../Thing.js';
|
|
4
4
|
import { DataNamespace, IDataNamespace } from "./DataNamespace.js";
|
|
5
5
|
|
|
6
6
|
export const Kind = 'Core#DataFile';
|
|
@@ -21,7 +21,7 @@ export class DataFile extends File {
|
|
|
21
21
|
* @param input The data namespace instance or schema.
|
|
22
22
|
* @param owner Optional owner to set.
|
|
23
23
|
*/
|
|
24
|
-
static fromDataNamespace(input: DataNamespace | IDataNamespace, owner
|
|
24
|
+
static fromDataNamespace(input: DataNamespace | IDataNamespace, owner = DefaultOwner): DataFile {
|
|
25
25
|
let final: IDataNamespace;
|
|
26
26
|
if (typeof (input as DataNamespace).toJSON === 'function') {
|
|
27
27
|
final = (input as DataNamespace).toJSON();
|
|
@@ -32,8 +32,8 @@ export class DataFile extends File {
|
|
|
32
32
|
kind: Kind,
|
|
33
33
|
key: final.key,
|
|
34
34
|
info: { ...final.info },
|
|
35
|
-
lastModified: { user:
|
|
36
|
-
owner
|
|
35
|
+
lastModified: { user: owner, time: 0, byMe: false },
|
|
36
|
+
owner,
|
|
37
37
|
parents: [],
|
|
38
38
|
permissionIds: [],
|
|
39
39
|
permissions: [],
|
|
@@ -52,10 +52,7 @@ export class DataFile extends File {
|
|
|
52
52
|
init = {
|
|
53
53
|
kind: Kind,
|
|
54
54
|
key: v4(),
|
|
55
|
-
info:
|
|
56
|
-
kind: ThingKind,
|
|
57
|
-
name: '',
|
|
58
|
-
},
|
|
55
|
+
info: Thing.fromName('').toJSON(),
|
|
59
56
|
owner: DefaultOwner,
|
|
60
57
|
parents: [],
|
|
61
58
|
permissionIds: [],
|
|
@@ -119,16 +119,26 @@ export interface BackendErrorEvent {
|
|
|
119
119
|
time: number;
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
+
export interface ClearedBroadcastEvent {
|
|
123
|
+
type: 'event';
|
|
124
|
+
operation: 'cleared';
|
|
125
|
+
name: string;
|
|
126
|
+
space: string;
|
|
127
|
+
path: string;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface BroadcastFileData {
|
|
131
|
+
parent?: string;
|
|
132
|
+
alt: AltType;
|
|
133
|
+
}
|
|
134
|
+
|
|
122
135
|
export interface BroadcastCreatedEvent extends BroadcastEvent {
|
|
123
136
|
operation: 'created';
|
|
124
137
|
data: unknown;
|
|
125
138
|
// path: string; -> /files, /certificates, /history, /project/executions, /spaces, /trash
|
|
126
139
|
}
|
|
127
140
|
|
|
128
|
-
export interface FileCreatedBroadcastEvent extends BroadcastCreatedEvent {
|
|
129
|
-
parent?: string;
|
|
130
|
-
data: unknown;
|
|
131
|
-
alt: AltType;
|
|
141
|
+
export interface FileCreatedBroadcastEvent extends BroadcastCreatedEvent, BroadcastFileData {
|
|
132
142
|
}
|
|
133
143
|
|
|
134
144
|
export interface FileMetaCreatedBroadcastEvent extends FileCreatedBroadcastEvent {
|
|
@@ -148,10 +158,9 @@ export interface HistoryCreatedBroadcastEvent extends BroadcastCreatedEvent {
|
|
|
148
158
|
data: IHttpHistory;
|
|
149
159
|
}
|
|
150
160
|
|
|
151
|
-
export interface FileRevisionCreatedBroadcastEvent extends BroadcastCreatedEvent {
|
|
161
|
+
export interface FileRevisionCreatedBroadcastEvent extends BroadcastCreatedEvent, BroadcastFileData {
|
|
152
162
|
parent: string;
|
|
153
163
|
data: IRevision;
|
|
154
|
-
alt: AltType;
|
|
155
164
|
}
|
|
156
165
|
|
|
157
166
|
export interface ProjectExecutionCreatedBroadcastEvent extends BroadcastCreatedEvent {
|
|
@@ -165,9 +174,7 @@ export interface BroadcastPatchEvent extends BroadcastEvent {
|
|
|
165
174
|
// path: string; -> /files, /spaces
|
|
166
175
|
}
|
|
167
176
|
|
|
168
|
-
export interface FilePatchBroadcastEvent extends BroadcastPatchEvent {
|
|
169
|
-
parent?: string;
|
|
170
|
-
alt: AltType;
|
|
177
|
+
export interface FilePatchBroadcastEvent extends BroadcastPatchEvent, BroadcastFileData {
|
|
171
178
|
}
|
|
172
179
|
|
|
173
180
|
export interface AccessBroadcastEvent extends BroadcastEvent {
|
|
@@ -185,9 +192,7 @@ export interface DeletedBroadcastEvent extends BroadcastEvent {
|
|
|
185
192
|
// path: string; -> /files, /certificates, /history, /project/executions, /spaces, /trash
|
|
186
193
|
}
|
|
187
194
|
|
|
188
|
-
export interface FileDeletedBroadcastEvent extends DeletedBroadcastEvent {
|
|
189
|
-
parent?: string;
|
|
190
|
-
alt: AltType;
|
|
195
|
+
export interface FileDeletedBroadcastEvent extends DeletedBroadcastEvent, BroadcastFileData {
|
|
191
196
|
}
|
|
192
197
|
|
|
193
198
|
export interface ProjectExecutionDeleteBroadcastEvent extends DeletedBroadcastEvent {
|
|
@@ -198,7 +203,3 @@ export interface HistoryDeletedBroadcastEvent extends DeletedBroadcastEvent {
|
|
|
198
203
|
project: string;
|
|
199
204
|
request: string;
|
|
200
205
|
}
|
|
201
|
-
|
|
202
|
-
export interface ClearedBroadcastEvent extends BroadcastEvent {
|
|
203
|
-
operation: 'cleared';
|
|
204
|
-
}
|
package/src/models/store/File.ts
CHANGED
|
@@ -504,4 +504,26 @@ export class File extends StoredFile {
|
|
|
504
504
|
};
|
|
505
505
|
return result;
|
|
506
506
|
}
|
|
507
|
+
|
|
508
|
+
/**
|
|
509
|
+
* Creates a new Space object from a name.
|
|
510
|
+
*
|
|
511
|
+
* @param name The name to set.
|
|
512
|
+
* @param owner The user id that is the owner of the space.
|
|
513
|
+
*/
|
|
514
|
+
static fromName(name: string, owner = DefaultOwner, kind = ''): File {
|
|
515
|
+
const key = v4();
|
|
516
|
+
const definition = new File();
|
|
517
|
+
definition.new({
|
|
518
|
+
key,
|
|
519
|
+
kind,
|
|
520
|
+
info: Thing.fromName(name).toJSON(),
|
|
521
|
+
owner,
|
|
522
|
+
parents: [],
|
|
523
|
+
permissionIds: [],
|
|
524
|
+
permissions: [],
|
|
525
|
+
lastModified: { user: owner, time: 0, byMe: false },
|
|
526
|
+
})
|
|
527
|
+
return definition;
|
|
528
|
+
}
|
|
507
529
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import WebSocketNode from 'ws';
|
|
2
1
|
import { SdkBase, E_RESPONSE_STATUS, E_RESPONSE_NO_VALUE, E_INVALID_JSON, E_RESPONSE_UNKNOWN, ISdkRequestOptions } from './SdkBase.js';
|
|
3
2
|
import { RouteBuilder } from './RouteBuilder.js';
|
|
4
3
|
import { ContextChangeRecord, ContextDeleteRecord, ContextListResult, ContextSpaceListOptions, IBulkOperationResult } from '../../events/BaseEvents.js';
|
|
@@ -11,6 +10,7 @@ export class CertificatesSdk extends SdkBase {
|
|
|
11
10
|
*
|
|
12
11
|
* @param value The value to insert.
|
|
13
12
|
* @param space The parent space of the certificate.
|
|
13
|
+
* @deprecated Use the `files` to store certificates.
|
|
14
14
|
*/
|
|
15
15
|
async add(value: HttpCertificate, space: string, request: ISdkRequestOptions = {}): Promise<ContextChangeRecord<HttpCertificate>> {
|
|
16
16
|
const token = request.token || this.sdk.token;
|
|
@@ -49,6 +49,7 @@ export class CertificatesSdk extends SdkBase {
|
|
|
49
49
|
* @param value The lits of certificates to add.
|
|
50
50
|
* @param space The parent workspace
|
|
51
51
|
* @returns The list of inserted certificates. `undefined` when there was an error inserting a certificate.
|
|
52
|
+
* @deprecated Use the `files` to store certificates.
|
|
52
53
|
*/
|
|
53
54
|
async addBulk(values: HttpCertificate[], space: string, request: ISdkRequestOptions = {}): Promise<IBulkOperationResult<ContextChangeRecord<HttpCertificate>>> {
|
|
54
55
|
const token = request.token || this.sdk.token;
|
|
@@ -84,6 +85,7 @@ export class CertificatesSdk extends SdkBase {
|
|
|
84
85
|
|
|
85
86
|
/**
|
|
86
87
|
* @param key The key of the certificate to read.
|
|
88
|
+
* @deprecated Use the `files` to store certificates.
|
|
87
89
|
*/
|
|
88
90
|
async read(key: string, request: ISdkRequestOptions = {}): Promise<HttpCertificate> {
|
|
89
91
|
const token = request.token || this.sdk.token;
|
|
@@ -120,6 +122,7 @@ export class CertificatesSdk extends SdkBase {
|
|
|
120
122
|
*
|
|
121
123
|
* @param space The parent space of the certificate.
|
|
122
124
|
* @param options The list query options.
|
|
125
|
+
* @deprecated Use the `files` to store certificates.
|
|
123
126
|
*/
|
|
124
127
|
async list(options?: ContextSpaceListOptions, request: ISdkRequestOptions = {}): Promise<ContextListResult<HttpCertificate>> {
|
|
125
128
|
const token = request.token || this.sdk.token;
|
|
@@ -156,6 +159,7 @@ export class CertificatesSdk extends SdkBase {
|
|
|
156
159
|
* Marks the certificate as deleted.
|
|
157
160
|
*
|
|
158
161
|
* @param key The key of the certificate to delete.
|
|
162
|
+
* @deprecated Use the `files` to store certificates.
|
|
159
163
|
*/
|
|
160
164
|
async delete(key: string, request: ISdkRequestOptions = {}): Promise<void> {
|
|
161
165
|
const token = request.token || this.sdk.token;
|
|
@@ -177,6 +181,7 @@ export class CertificatesSdk extends SdkBase {
|
|
|
177
181
|
/**
|
|
178
182
|
* Removed certificates in a bulk operation.
|
|
179
183
|
* @param keys The list of certificate keys to delete.
|
|
184
|
+
* @deprecated Use the `files` to store certificates.
|
|
180
185
|
*/
|
|
181
186
|
async deleteBulk(keys: string[], request: ISdkRequestOptions = {}): Promise<IBulkOperationResult<ContextDeleteRecord>> {
|
|
182
187
|
const token = request.token || this.sdk.token;
|
|
@@ -212,6 +217,7 @@ export class CertificatesSdk extends SdkBase {
|
|
|
212
217
|
/**
|
|
213
218
|
* Removes all certificates from the store for the given workspace.
|
|
214
219
|
* @param space The parent workspace key
|
|
220
|
+
* @deprecated Use the `files` to store certificates.
|
|
215
221
|
*/
|
|
216
222
|
async empty(space: string, request: ISdkRequestOptions = {}): Promise<void> {
|
|
217
223
|
const token = request.token || this.sdk.token;
|
|
@@ -229,16 +235,4 @@ export class CertificatesSdk extends SdkBase {
|
|
|
229
235
|
throw e;
|
|
230
236
|
}
|
|
231
237
|
}
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* Creates a WS client that listens to the certificate events.
|
|
235
|
-
* @param space The parent space.
|
|
236
|
-
* @param request Optional request options.
|
|
237
|
-
*/
|
|
238
|
-
async observe(space: string, request: ISdkRequestOptions = {}): Promise<WebSocketNode | WebSocket> {
|
|
239
|
-
const token = request.token || this.sdk.token;
|
|
240
|
-
const url = this.sdk.getUrl(RouteBuilder.certificates());
|
|
241
|
-
url.searchParams.set('space', space);
|
|
242
|
-
return this.sdk.ws.createAndConnect(url.toString(), token);
|
|
243
|
-
}
|
|
244
238
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import WebSocketNode from 'ws';
|
|
2
1
|
import { SdkBase, E_RESPONSE_STATUS, E_RESPONSE_NO_VALUE, E_INVALID_JSON, E_RESPONSE_UNKNOWN, ISdkRequestOptions } from './SdkBase.js';
|
|
3
2
|
import { RouteBuilder } from './RouteBuilder.js';
|
|
4
3
|
import { IUser } from '../../models/store/User.js';
|
|
@@ -6,6 +5,7 @@ import { FileBreadcrumb, IFile } from '../../models/store/File.js';
|
|
|
6
5
|
import { Kind as ProjectKind } from '../../models/Project.js';
|
|
7
6
|
import { Kind as FolderKind } from '../../models/Folder.js';
|
|
8
7
|
import { Kind as DataNamespaceKind } from '../../models/data/DataNamespace.js';
|
|
8
|
+
import { Kind as CertificateFileKind } from '../../models/CertificateFile.js';
|
|
9
9
|
import { SdkError } from './Errors.js';
|
|
10
10
|
import {
|
|
11
11
|
ContextListResult,
|
|
@@ -41,7 +41,7 @@ export interface IFileCreateOptions extends IMetaCreateOptions, IMediaCreateOpti
|
|
|
41
41
|
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
export type ListFileKind = typeof ProjectKind | typeof FolderKind | typeof DataNamespaceKind;
|
|
44
|
+
export type ListFileKind = typeof ProjectKind | typeof FolderKind | typeof DataNamespaceKind | typeof CertificateFileKind;
|
|
45
45
|
|
|
46
46
|
/**
|
|
47
47
|
* In the store, the file is represented by the meta and the media.
|
|
@@ -493,35 +493,6 @@ export class FilesSdk extends SdkBase {
|
|
|
493
493
|
return data;
|
|
494
494
|
}
|
|
495
495
|
|
|
496
|
-
/**
|
|
497
|
-
* Creates a WS client that listens to the files events.
|
|
498
|
-
* @param space The parent space.
|
|
499
|
-
* @param request Optional request options.
|
|
500
|
-
*/
|
|
501
|
-
async observeFiles(space: string, request: ISdkRequestOptions = {}): Promise<WebSocketNode | WebSocket> {
|
|
502
|
-
const token = request.token || this.sdk.token;
|
|
503
|
-
const url = this.sdk.getUrl(RouteBuilder.files());
|
|
504
|
-
url.searchParams.set('space', space);
|
|
505
|
-
return this.sdk.ws.createAndConnect(url.toString(), token);
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
/**
|
|
509
|
-
* Creates a WS client that listens to the file events.
|
|
510
|
-
*
|
|
511
|
-
* @param key The file key to observe
|
|
512
|
-
* @param media Whether to observe changes to the file media instead of meta.
|
|
513
|
-
* @param request Optional request options.
|
|
514
|
-
*/
|
|
515
|
-
async observeFile(space: string, key: string, media?: boolean, request: ISdkRequestOptions = {}): Promise<WebSocketNode | WebSocket> {
|
|
516
|
-
const token = request.token || this.sdk.token;
|
|
517
|
-
const url = this.sdk.getUrl(RouteBuilder.file(key));
|
|
518
|
-
url.searchParams.set('space', space);
|
|
519
|
-
if (media) {
|
|
520
|
-
url.searchParams.set('alt', 'media');
|
|
521
|
-
}
|
|
522
|
-
return this.sdk.ws.createAndConnect(url.toString(), token);
|
|
523
|
-
}
|
|
524
|
-
|
|
525
496
|
/**
|
|
526
497
|
* Lists breadcrumbs to the file.
|
|
527
498
|
* @param key The lowest file in the hierarchy
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import WebSocketNode from 'ws';
|
|
2
1
|
import { SdkBase, E_RESPONSE_STATUS, E_RESPONSE_NO_VALUE, E_INVALID_JSON, E_RESPONSE_UNKNOWN, ISdkRequestOptions } from './SdkBase.js';
|
|
3
2
|
import { RouteBuilder } from './RouteBuilder.js';
|
|
4
3
|
import { IHttpHistory, IHttpHistoryBulkAdd, Kind as HttpHistoryKind } from '../../models/HttpHistory.js';
|
|
@@ -292,16 +291,4 @@ export class HistorySdk extends SdkBase {
|
|
|
292
291
|
throw e;
|
|
293
292
|
}
|
|
294
293
|
}
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* Creates a WS client that listens to the certificate events.
|
|
298
|
-
* @param space The parent space.
|
|
299
|
-
* @param request Optional request options.
|
|
300
|
-
*/
|
|
301
|
-
async observe(space: string, request: ISdkRequestOptions = {}): Promise<WebSocketNode | WebSocket> {
|
|
302
|
-
const token = request.token || this.sdk.token;
|
|
303
|
-
const url = this.sdk.getUrl(RouteBuilder.history());
|
|
304
|
-
url.searchParams.set('space', space);
|
|
305
|
-
return this.sdk.ws.createAndConnect(url.toString(), token);
|
|
306
|
-
}
|
|
307
294
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import WebSocketNode from 'ws';
|
|
2
1
|
import { SdkBase, E_RESPONSE_UNKNOWN, ISdkRequestOptions } from './SdkBase.js';
|
|
3
2
|
import { RouteBuilder } from './RouteBuilder.js';
|
|
4
3
|
import { ContextChangeRecord, ContextDeleteRecord, ContextListResult, IBulkOperationResult, IProjectExecutionListOptions } from '../../events/BaseEvents.js';
|
|
@@ -120,16 +119,4 @@ export class ProjectExecutionSdk extends SdkBase {
|
|
|
120
119
|
url.searchParams.set('folder', folder);
|
|
121
120
|
await this.genericDelete(url, request);
|
|
122
121
|
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Creates a WS client that listens to the certificate events.
|
|
126
|
-
* @param space The parent space.
|
|
127
|
-
* @param request Optional request options.
|
|
128
|
-
*/
|
|
129
|
-
async observe(space: string, request: ISdkRequestOptions = {}): Promise<WebSocketNode | WebSocket> {
|
|
130
|
-
const token = request.token || this.sdk.token;
|
|
131
|
-
const url = this.sdk.getUrl(RouteBuilder.projectExecutions());
|
|
132
|
-
url.searchParams.set('space', space);
|
|
133
|
-
return this.sdk.ws.createAndConnect(url.toString(), token);
|
|
134
|
-
}
|
|
135
122
|
}
|
package/src/runtime/store/Sdk.ts
CHANGED
|
@@ -56,6 +56,9 @@ export abstract class Sdk {
|
|
|
56
56
|
*/
|
|
57
57
|
shared = new SharedSdk(this);
|
|
58
58
|
|
|
59
|
+
/**
|
|
60
|
+
* @deprecated Use the `files` to store certificates.
|
|
61
|
+
*/
|
|
59
62
|
certificates = new CertificatesSdk(this);
|
|
60
63
|
|
|
61
64
|
revisions = new RevisionsSdk(this);
|
|
@@ -117,6 +120,9 @@ export abstract class Sdk {
|
|
|
117
120
|
* @param path The path to the endpoint, without the base path.
|
|
118
121
|
*/
|
|
119
122
|
getUrl(path='/'): URL {
|
|
123
|
+
if (path.startsWith('http:') || path.startsWith('https:')) {
|
|
124
|
+
return new URL(path);
|
|
125
|
+
}
|
|
120
126
|
const { baseUri, basePath='' } = this;
|
|
121
127
|
let userPath = path;
|
|
122
128
|
if (basePath && userPath.startsWith(basePath)) {
|