@microtronics/studio-cli 0.3.2 → 0.3.3
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/CHANGELOG.md +8 -0
- package/dist/studio-cli.d.ts +479 -0
- package/out/FS.d.ts.map +1 -0
- package/out/FS.js +60 -0
- package/out/api.d.ts.map +1 -0
- package/out/api.js +10 -0
- package/out/cliFS.d.ts.map +1 -0
- package/out/cliFS.js +47 -0
- package/out/dependencies.d.ts.map +1 -0
- package/out/dependencies.js +342 -0
- package/out/main.d.ts.map +1 -0
- package/out/main.js +56 -0
- package/out/manifest.d.ts.map +1 -0
- package/out/manifest.js +30 -0
- package/out/registryAPI.d.ts.map +1 -0
- package/out/registryAPI.js +68 -0
- package/out/typings/registry.d.ts.map +1 -0
- package/out/typings/registry.js +7 -0
- package/package.json +5 -2
- package/test-results.xml +0 -53
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
+
## 0.3.3 (2024-11-26)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **studio-cli:** run npm build during prepublish ([5046b47](https://bitbucket.org/microtronics-core/vscode-studio/commits/5046b47956c97a0f53598cf35adcbd33b276398f))
|
|
9
|
+
* **studio-cli:** run npm build during prepublish ([58e099e](https://bitbucket.org/microtronics-core/vscode-studio/commits/58e099ed57ea6986019e026d68e950ce8eb447b4))
|
|
10
|
+
|
|
3
11
|
## 0.3.2 (2024-11-26)
|
|
4
12
|
|
|
5
13
|
|
|
@@ -0,0 +1,479 @@
|
|
|
1
|
+
import { SemVer } from 'semver';
|
|
2
|
+
import { URI } from 'vscode-uri';
|
|
3
|
+
|
|
4
|
+
declare interface components {
|
|
5
|
+
schemas: {
|
|
6
|
+
/** @default 25 */
|
|
7
|
+
PaginationLimit: number;
|
|
8
|
+
ResultMeta: {
|
|
9
|
+
/** @description Pagination information */
|
|
10
|
+
resultSet?: {
|
|
11
|
+
/** @description The total amount of entities in the database */
|
|
12
|
+
total: number;
|
|
13
|
+
/** @description The number of entities in the data array */
|
|
14
|
+
count: number;
|
|
15
|
+
/** @description The current offset of entities */
|
|
16
|
+
offset: number;
|
|
17
|
+
limit: components["schemas"]["PaginationLimit"];
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
LibraryInformationBase: {
|
|
21
|
+
name: components["parameters"]["LibraryId"];
|
|
22
|
+
/** @description Short description what this library does */
|
|
23
|
+
description: string;
|
|
24
|
+
publisherId: components["parameters"]["PublisherId"];
|
|
25
|
+
};
|
|
26
|
+
LibraryListInformation: components["schemas"]["LibraryInformationBase"] & {
|
|
27
|
+
version: components["schemas"]["LibraryVersion"];
|
|
28
|
+
};
|
|
29
|
+
LibraryDetailInformation: components["schemas"]["LibraryInformationBase"] & {
|
|
30
|
+
versions?: components["schemas"]["LibraryVersion"][];
|
|
31
|
+
};
|
|
32
|
+
LibraryVersion: {
|
|
33
|
+
/**
|
|
34
|
+
* @description Version name
|
|
35
|
+
* @example 0.4.1
|
|
36
|
+
*/
|
|
37
|
+
name: string;
|
|
38
|
+
/**
|
|
39
|
+
* Format: date-time
|
|
40
|
+
* @description Time when this version was released
|
|
41
|
+
*/
|
|
42
|
+
releasedAt: string;
|
|
43
|
+
files: components["schemas"]["LibraryDownloadFile"][];
|
|
44
|
+
};
|
|
45
|
+
LibraryDownloadFile: {
|
|
46
|
+
name: components["parameters"]["LibraryFileName"];
|
|
47
|
+
/** @description Url to retrieve this file */
|
|
48
|
+
downloadUrl: string;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* @description The target backend this project was developed for
|
|
52
|
+
* @enum {string}
|
|
53
|
+
*/
|
|
54
|
+
TargetSystem: "myDatanet" | "ONE" | "MT360";
|
|
55
|
+
NewApplication: {
|
|
56
|
+
/** @description The project name */
|
|
57
|
+
name: string;
|
|
58
|
+
/** @description Short description what this library does */
|
|
59
|
+
description: string;
|
|
60
|
+
targetSystem: components["schemas"]["TargetSystem"];
|
|
61
|
+
/** @description ONE specific parameter for the organizationId */
|
|
62
|
+
organizationId?: string;
|
|
63
|
+
/**
|
|
64
|
+
* @description Defines which servers are allowed to see this application. If null, the application wont be shared with anyone
|
|
65
|
+
* @default null
|
|
66
|
+
*/
|
|
67
|
+
allowedBackends: ("*" | string[]) | null;
|
|
68
|
+
};
|
|
69
|
+
ApplicationInformationBase: {
|
|
70
|
+
/** @description The actual released version of the application */
|
|
71
|
+
version: number;
|
|
72
|
+
publisherId: components["parameters"]["PublisherId"];
|
|
73
|
+
} & components["schemas"]["NewApplication"];
|
|
74
|
+
ApplicationListInformation: {
|
|
75
|
+
id: components["parameters"]["ApplicationId"];
|
|
76
|
+
/** @description The project name */
|
|
77
|
+
name: string;
|
|
78
|
+
/** @description Short description what this library does */
|
|
79
|
+
description: string;
|
|
80
|
+
publisherId: components["parameters"]["PublisherId"];
|
|
81
|
+
};
|
|
82
|
+
ApplicationDetailInformation: components["schemas"]["ApplicationInformationBase"] & {
|
|
83
|
+
versions: components["schemas"]["ApplicationVersion"][];
|
|
84
|
+
};
|
|
85
|
+
ApplicationVersion: {
|
|
86
|
+
/** @description The name of the application when this version wos released */
|
|
87
|
+
name: string;
|
|
88
|
+
/** @description The version number */
|
|
89
|
+
version: number;
|
|
90
|
+
/**
|
|
91
|
+
* Format: date-time
|
|
92
|
+
* @description Date when this version was published
|
|
93
|
+
*/
|
|
94
|
+
versionStamp: string;
|
|
95
|
+
phase: components["schemas"]["ReleasePhases"];
|
|
96
|
+
/**
|
|
97
|
+
* Format: date-time
|
|
98
|
+
* @description Date when the release phase was changed
|
|
99
|
+
*/
|
|
100
|
+
phaseStamp: string;
|
|
101
|
+
files: components["schemas"]["ApplicationDownloadFile"][];
|
|
102
|
+
};
|
|
103
|
+
ApplicationDownloadFile: {
|
|
104
|
+
name: components["parameters"]["ApplicationFileName"];
|
|
105
|
+
/** @description Url to retrieve this file */
|
|
106
|
+
downloadUrl: string;
|
|
107
|
+
};
|
|
108
|
+
/** @description Information about the new version */
|
|
109
|
+
ApplicationTagInformation: {
|
|
110
|
+
name: string;
|
|
111
|
+
abstract: string;
|
|
112
|
+
phase: components["schemas"]["ReleasePhases"];
|
|
113
|
+
/** @enum {string} */
|
|
114
|
+
pov_location: "$embedded" | "$pure";
|
|
115
|
+
version: number;
|
|
116
|
+
};
|
|
117
|
+
ApplicationVersionUpdate: {
|
|
118
|
+
phase: components["schemas"]["ReleasePhases"];
|
|
119
|
+
};
|
|
120
|
+
/**
|
|
121
|
+
* @description The released phase
|
|
122
|
+
* @enum {string}
|
|
123
|
+
*/
|
|
124
|
+
ReleasePhases: "passive" | "stage" | "release" | "withdrawn";
|
|
125
|
+
NewPublisher: {
|
|
126
|
+
/** @description Unique id of the publisher. Can not be changed afterwards. Can only contain 'A' through 'Z', 'a' through 'z', '0' through '9' and '-'. The publisher ID must start with an alphabetic or numeric character. */
|
|
127
|
+
id: string;
|
|
128
|
+
/** @description The name of the publisher. Your company / brand name is recommended. Should not contain following chars ';', '=', '[', ']', '@', '|', '\"', '%', '\', '/', ',', '>'. */
|
|
129
|
+
name: string;
|
|
130
|
+
};
|
|
131
|
+
Publisher: {
|
|
132
|
+
/** @description The unique id of the publisher */
|
|
133
|
+
id: string;
|
|
134
|
+
/** @description The name of the publisher */
|
|
135
|
+
name: string;
|
|
136
|
+
};
|
|
137
|
+
/**
|
|
138
|
+
* @description <ul> <li><b>Reader</b>: The user can view, but cannot publish or manage. <li><b>Contributor</b>: The user can publish, but cannot edit publisher settings or manage access. <li><b>Owner</b>: The user can publish, edit publisher settings, and manage access.. </ul>
|
|
139
|
+
* @enum {string}
|
|
140
|
+
*/
|
|
141
|
+
MemberRole: "owner" | "contributor" | "reader";
|
|
142
|
+
NewPublisherMember: {
|
|
143
|
+
id: components["parameters"]["MemberId"];
|
|
144
|
+
role: components["schemas"]["MemberRole"];
|
|
145
|
+
};
|
|
146
|
+
PublisherMember: {
|
|
147
|
+
id: components["parameters"]["MemberId"];
|
|
148
|
+
/** @description Name of the member/user */
|
|
149
|
+
name: string;
|
|
150
|
+
role: components["schemas"]["MemberRole"];
|
|
151
|
+
};
|
|
152
|
+
ChangePublisherRole: {
|
|
153
|
+
role: components["schemas"]["MemberRole"];
|
|
154
|
+
};
|
|
155
|
+
PublisherMemberListInformation: {
|
|
156
|
+
meta?: components["schemas"]["ResultMeta"];
|
|
157
|
+
data?: components["schemas"]["PublisherMember"][];
|
|
158
|
+
};
|
|
159
|
+
CloudStudioApplicationAssign: {
|
|
160
|
+
/** @description Unique id of the application (rmstore id) */
|
|
161
|
+
id: string;
|
|
162
|
+
/** @description The current project name */
|
|
163
|
+
name: string;
|
|
164
|
+
targetSystem: components["schemas"]["TargetSystem"];
|
|
165
|
+
/** @description Short project description */
|
|
166
|
+
description: string;
|
|
167
|
+
};
|
|
168
|
+
ApiToken: {
|
|
169
|
+
/** @description Unique id of the token */
|
|
170
|
+
id: string;
|
|
171
|
+
/** @description Clear name of the token declared by the user */
|
|
172
|
+
label: string;
|
|
173
|
+
/**
|
|
174
|
+
* Format: date-time
|
|
175
|
+
* @description Date when the token was created
|
|
176
|
+
*/
|
|
177
|
+
createdAt: string;
|
|
178
|
+
};
|
|
179
|
+
NewApiToken: {
|
|
180
|
+
/** @description The name of the token */
|
|
181
|
+
label: string;
|
|
182
|
+
};
|
|
183
|
+
ApiTokenCreated: {
|
|
184
|
+
/** @description The newly created api token */
|
|
185
|
+
token: string;
|
|
186
|
+
} & components["schemas"]["ApiToken"];
|
|
187
|
+
ErrorResponse: {
|
|
188
|
+
/** @description Information about what went/is wrong */
|
|
189
|
+
reason: string;
|
|
190
|
+
};
|
|
191
|
+
};
|
|
192
|
+
responses: never;
|
|
193
|
+
parameters: {
|
|
194
|
+
/** @description Limit the amount of entities that will be returned in the data array */
|
|
195
|
+
PaginationLimit: components["schemas"]["PaginationLimit"];
|
|
196
|
+
/** @description Set the offset to skip the given amount of entities in the database */
|
|
197
|
+
PaginationOffset: number;
|
|
198
|
+
/** @description Id of the publisher */
|
|
199
|
+
PublisherIdQuery: string;
|
|
200
|
+
/** @description Id of the publisher */
|
|
201
|
+
PublisherId: string;
|
|
202
|
+
/** @description Unique library id for this publisher */
|
|
203
|
+
LibraryId: string;
|
|
204
|
+
/** @description version of the library. Formatted as semantic version */
|
|
205
|
+
LibraryVersion: string;
|
|
206
|
+
/** @description Filename that can be fetched */
|
|
207
|
+
LibraryFileName: "library.tar.gz" | "README.md" | "CHANGELOG.md" | "studio.json";
|
|
208
|
+
/** @description Unique library id for this publisher */
|
|
209
|
+
ApplicationId: string;
|
|
210
|
+
/** @description version of the application. */
|
|
211
|
+
ApplicationVersion: number;
|
|
212
|
+
/** @description version of the library. Formatted as semantic version */
|
|
213
|
+
ApplicationFileName: "release-notes.md";
|
|
214
|
+
/** @description User Id */
|
|
215
|
+
MemberId: string;
|
|
216
|
+
/** @description User Id */
|
|
217
|
+
UserId: string;
|
|
218
|
+
/** @description Id of theapi token */
|
|
219
|
+
TokenId: string;
|
|
220
|
+
};
|
|
221
|
+
requestBodies: never;
|
|
222
|
+
headers: never;
|
|
223
|
+
pathItems: never;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export declare namespace Dependencies {
|
|
227
|
+
/**
|
|
228
|
+
* Removes the caret-range constraint from the version
|
|
229
|
+
* @public
|
|
230
|
+
* @param version
|
|
231
|
+
*/
|
|
232
|
+
export function rangeToVersion(version: string): string;
|
|
233
|
+
/**
|
|
234
|
+
* Validate if the given version satisfies the semver-range
|
|
235
|
+
* @param libName
|
|
236
|
+
* @param v1
|
|
237
|
+
* @param range
|
|
238
|
+
* @private
|
|
239
|
+
*/
|
|
240
|
+
export function satisfiesSemverRange(libName: string, v1: SemVer | string, range: string): void;
|
|
241
|
+
/**
|
|
242
|
+
* Build a dependency tree based on the manifest file and a list of dependencies that should be added
|
|
243
|
+
* @param cwd
|
|
244
|
+
* @param fs
|
|
245
|
+
* @param dependenciesToAdd
|
|
246
|
+
* @param development
|
|
247
|
+
*/
|
|
248
|
+
export function validateDependencyTree(cwd: URI, fs: LocalFS, dependenciesToAdd?: Manifest.Dependencies, development?: boolean): Promise<Manifest.Dependencies>;
|
|
249
|
+
/**
|
|
250
|
+
* Validate if the given dependency is already installed
|
|
251
|
+
* @param cwd
|
|
252
|
+
* @param fs
|
|
253
|
+
* @param publisherId
|
|
254
|
+
* @param libraryName
|
|
255
|
+
* @param libraryVersion
|
|
256
|
+
*/
|
|
257
|
+
export function isDependencyInstalled(cwd: URI, fs: LocalFS, publisherId: string, libraryName: string, libraryVersion: string): Promise<boolean>;
|
|
258
|
+
/**
|
|
259
|
+
* Remove installed dependency from the libdeps directory
|
|
260
|
+
* @param cwd
|
|
261
|
+
* @param fs
|
|
262
|
+
* @param libraryName
|
|
263
|
+
*/
|
|
264
|
+
export function removeExisting(cwd: URI, fs: LocalFS, libraryName: string): Promise<void>;
|
|
265
|
+
/**
|
|
266
|
+
* Extract the given library.tar.gz array buffer
|
|
267
|
+
* @param cwd
|
|
268
|
+
* @param fs
|
|
269
|
+
* @param libraryName
|
|
270
|
+
* @param archiveBuffer
|
|
271
|
+
*/
|
|
272
|
+
export function extractLibraryContent(cwd: URI, fs: LocalFS, libraryName: string, archiveBuffer: ArrayBuffer): Promise<void>;
|
|
273
|
+
/**
|
|
274
|
+
* Install the given library with the version that the semver range accepts
|
|
275
|
+
* @param cwd
|
|
276
|
+
* @param fs
|
|
277
|
+
* @param token
|
|
278
|
+
* @param publisherIdName
|
|
279
|
+
* @param version
|
|
280
|
+
* @param development - install as development dependency
|
|
281
|
+
*/
|
|
282
|
+
export function installDependency(cwd: URI, fs: LocalFS, token: string | null, publisherIdName: string, version: string | null, development?: boolean): Promise<undefined>;
|
|
283
|
+
/**
|
|
284
|
+
* Install all dependencies that are referenced within the studio manifest
|
|
285
|
+
* @param cwd
|
|
286
|
+
* @param fs
|
|
287
|
+
* @param token
|
|
288
|
+
*/
|
|
289
|
+
export function installDependencies(cwd: URI, fs: LocalFS, token: string | null): Promise<void>;
|
|
290
|
+
/**
|
|
291
|
+
* Uninstall the given library
|
|
292
|
+
* Validates if the library is any sub-dependency of any other library
|
|
293
|
+
* @param cwd
|
|
294
|
+
* @param fs
|
|
295
|
+
* @param publisherId
|
|
296
|
+
* @param libraryName
|
|
297
|
+
*/
|
|
298
|
+
export function uninstallDependency(cwd: URI, fs: LocalFS, publisherId: string, libraryName: string): Promise<void>;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/**
|
|
302
|
+
* Permissions of a file.
|
|
303
|
+
*/
|
|
304
|
+
declare enum FilePermission {
|
|
305
|
+
/**
|
|
306
|
+
* The file is readonly.
|
|
307
|
+
*
|
|
308
|
+
* *Note:* All `FileStat` from a `FileSystemProvider` that is registered with
|
|
309
|
+
* the option `isReadonly: true` will be implicitly handled as if `FilePermission.Readonly`
|
|
310
|
+
* is set. As a consequence, it is not possible to have a readonly file system provider
|
|
311
|
+
* registered where some `FileStat` are not readonly.
|
|
312
|
+
*/
|
|
313
|
+
Readonly = 1
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/**
|
|
317
|
+
* The `FileStat`-type represents metadata about a file
|
|
318
|
+
*/
|
|
319
|
+
declare interface FileStat {
|
|
320
|
+
/**
|
|
321
|
+
* The type of the file, e.g. is a regular file, a directory, or symbolic link
|
|
322
|
+
* to a file.
|
|
323
|
+
*
|
|
324
|
+
* *Note:* This value might be a bitmask, e.g. `FileType.File | FileType.SymbolicLink`.
|
|
325
|
+
*/
|
|
326
|
+
type: FileType;
|
|
327
|
+
/**
|
|
328
|
+
* The creation timestamp in milliseconds elapsed since January 1, 1970 00:00:00 UTC.
|
|
329
|
+
*/
|
|
330
|
+
ctime: number;
|
|
331
|
+
/**
|
|
332
|
+
* The modification timestamp in milliseconds elapsed since January 1, 1970 00:00:00 UTC.
|
|
333
|
+
*
|
|
334
|
+
* *Note:* If the file changed, it is important to provide an updated `mtime` that advanced
|
|
335
|
+
* from the previous value. Otherwise there may be optimizations in place that will not show
|
|
336
|
+
* the updated file contents in an editor for example.
|
|
337
|
+
*/
|
|
338
|
+
mtime: number;
|
|
339
|
+
/**
|
|
340
|
+
* The size in bytes.
|
|
341
|
+
*
|
|
342
|
+
* *Note:* If the file changed, it is important to provide an updated `size`. Otherwise there
|
|
343
|
+
* may be optimizations in place that will not show the updated file contents in an editor for
|
|
344
|
+
* example.
|
|
345
|
+
*/
|
|
346
|
+
size: number;
|
|
347
|
+
/**
|
|
348
|
+
* The permissions of the file, e.g. whether the file is readonly.
|
|
349
|
+
*
|
|
350
|
+
* *Note:* This value might be a bitmask, e.g. `FilePermission.Readonly | FilePermission.Other`.
|
|
351
|
+
*/
|
|
352
|
+
permissions?: FilePermission;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
/**
|
|
356
|
+
* Enumeration of file types. The types `File` and `Directory` can also be
|
|
357
|
+
* a symbolic links, in that case use `FileType.File | FileType.SymbolicLink` and
|
|
358
|
+
* `FileType.Directory | FileType.SymbolicLink`.
|
|
359
|
+
*/
|
|
360
|
+
declare enum FileType {
|
|
361
|
+
/**
|
|
362
|
+
* The file type is unknown.
|
|
363
|
+
*/
|
|
364
|
+
Unknown = 0,
|
|
365
|
+
/**
|
|
366
|
+
* A regular file.
|
|
367
|
+
*/
|
|
368
|
+
File = 1,
|
|
369
|
+
/**
|
|
370
|
+
* A directory.
|
|
371
|
+
*/
|
|
372
|
+
Directory = 2,
|
|
373
|
+
/**
|
|
374
|
+
* A symbolic link to a file.
|
|
375
|
+
*/
|
|
376
|
+
SymbolicLink = 64
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
declare interface LocalFS {
|
|
380
|
+
/**
|
|
381
|
+
* Filesystem rm function. It has to remove files or paths recursive
|
|
382
|
+
* @param path
|
|
383
|
+
*/
|
|
384
|
+
rm: (path: URI) => Promise<any>;
|
|
385
|
+
/**
|
|
386
|
+
* Filesystem write function.
|
|
387
|
+
* @param path
|
|
388
|
+
* @param content
|
|
389
|
+
*/
|
|
390
|
+
writeFile: (path: URI, content: Uint8Array | string) => Promise<any>;
|
|
391
|
+
/**
|
|
392
|
+
* Filesystem read function.
|
|
393
|
+
* @param path
|
|
394
|
+
*/
|
|
395
|
+
readFile: (path: URI) => Promise<Uint8Array>;
|
|
396
|
+
stat: (path: URI) => Promise<FileStat | null>;
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
export declare namespace Manifest {
|
|
400
|
+
export interface Manifest {
|
|
401
|
+
version: string;
|
|
402
|
+
name: string;
|
|
403
|
+
publisher: string;
|
|
404
|
+
description: string;
|
|
405
|
+
legacyProject?: boolean;
|
|
406
|
+
icon?: string;
|
|
407
|
+
dpid?: string;
|
|
408
|
+
engines?: {
|
|
409
|
+
backend?: string;
|
|
410
|
+
hwfw?: string[];
|
|
411
|
+
productId?: string[];
|
|
412
|
+
};
|
|
413
|
+
library?: boolean;
|
|
414
|
+
libraryDependencies?: Dependencies;
|
|
415
|
+
libraryDevDependencies?: Dependencies;
|
|
416
|
+
/**
|
|
417
|
+
* @deprecated replaced with libraryDependencies
|
|
418
|
+
*/
|
|
419
|
+
libdeps?: string[];
|
|
420
|
+
dlo?: {
|
|
421
|
+
mainFile: string;
|
|
422
|
+
compileOptions: string[];
|
|
423
|
+
};
|
|
424
|
+
registry?: {
|
|
425
|
+
id?: string;
|
|
426
|
+
allowedBackends?: null | '*' | string[];
|
|
427
|
+
target?: 'myDatanet' | 'ONE' | 'MT360';
|
|
428
|
+
};
|
|
429
|
+
/**
|
|
430
|
+
* @deprecated moved to registry
|
|
431
|
+
*/
|
|
432
|
+
target?: 'myDatanet' | 'ONE' | 'MT360';
|
|
433
|
+
pov?: {
|
|
434
|
+
details?: ApmPartScripts;
|
|
435
|
+
};
|
|
436
|
+
blo?: ApmPartScripts;
|
|
437
|
+
}
|
|
438
|
+
export interface Dependencies {
|
|
439
|
+
[key: string]: string;
|
|
440
|
+
}
|
|
441
|
+
export interface ApmPartScripts {
|
|
442
|
+
buildCommand: string;
|
|
443
|
+
workingPath: string;
|
|
444
|
+
}
|
|
445
|
+
/**
|
|
446
|
+
* Read the studio.json manifest and parse it
|
|
447
|
+
* @param cwd
|
|
448
|
+
* @param fs
|
|
449
|
+
*/
|
|
450
|
+
export function read(cwd: URI, fs: LocalFS): Promise<Manifest>;
|
|
451
|
+
/**
|
|
452
|
+
* Write the manifest to the workspace
|
|
453
|
+
* @param cwd
|
|
454
|
+
* @param fs
|
|
455
|
+
* @param manifest
|
|
456
|
+
*/
|
|
457
|
+
export function write(cwd: URI, fs: LocalFS, manifest: Manifest): Promise<Manifest>;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
export declare namespace Registry {
|
|
461
|
+
/**
|
|
462
|
+
* Get the actual api url based on the STUDIO_ENV
|
|
463
|
+
*/
|
|
464
|
+
const getAPIUrl: () => {
|
|
465
|
+
baseUrl: string;
|
|
466
|
+
};
|
|
467
|
+
export type LibraryProfile = components['schemas']['LibraryDetailInformation'];
|
|
468
|
+
export type LibraryVersion = components['schemas']['LibraryVersion'];
|
|
469
|
+
/**
|
|
470
|
+
* Fetch the library profile of the given library
|
|
471
|
+
* @param token
|
|
472
|
+
* @param publisherId
|
|
473
|
+
* @param libraryId
|
|
474
|
+
*/
|
|
475
|
+
export function getLibraryProfile(token: string | null, publisherId: string, libraryId: string): Promise<LibraryProfile>;
|
|
476
|
+
export function fetchLibraryContent(token: string | null, contentURL: string, json?: boolean): Promise<any>;
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
export { }
|
package/out/FS.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FS.d.ts","sourceRoot":"","sources":["../src/FS.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAEjC,MAAM,WAAW,OAAO;IACvB;;;OAGG;IACH,EAAE,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAChC;;;;OAIG;IACH,SAAS,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,GAAG,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACrE;;;OAGG;IACH,QAAQ,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;IAC7C,IAAI,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,OAAO,CAAC,QAAQ,GAAG,IAAI,CAAC,CAAC;CAC9C;AACD;;;;GAIG;AACH,oBAAY,QAAQ;IACnB;;OAEG;IACH,OAAO,IAAI;IACX;;OAEG;IACH,IAAI,IAAI;IACR;;OAEG;IACH,SAAS,IAAI;IACb;;OAEG;IACH,YAAY,KAAK;CACjB;AAED;;GAEG;AACH,oBAAY,cAAc;IACzB;;;;;;;OAOG;IACH,QAAQ,IAAI;CACZ;AAED;;GAEG;AACH,MAAM,WAAW,QAAQ;IACxB;;;;;OAKG;IACH,IAAI,EAAE,QAAQ,CAAC;IACf;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,IAAI,EAAE,MAAM,CAAC;IACb;;;;OAIG;IACH,WAAW,CAAC,EAAE,cAAc,CAAC;CAC7B;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,UAAU,GAAG,GAAG,UAazD"}
|
package/out/FS.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FilePermission = exports.FileType = void 0;
|
|
4
|
+
exports.convertBlobToString = convertBlobToString;
|
|
5
|
+
/**
|
|
6
|
+
* Enumeration of file types. The types `File` and `Directory` can also be
|
|
7
|
+
* a symbolic links, in that case use `FileType.File | FileType.SymbolicLink` and
|
|
8
|
+
* `FileType.Directory | FileType.SymbolicLink`.
|
|
9
|
+
*/
|
|
10
|
+
var FileType;
|
|
11
|
+
(function (FileType) {
|
|
12
|
+
/**
|
|
13
|
+
* The file type is unknown.
|
|
14
|
+
*/
|
|
15
|
+
FileType[FileType["Unknown"] = 0] = "Unknown";
|
|
16
|
+
/**
|
|
17
|
+
* A regular file.
|
|
18
|
+
*/
|
|
19
|
+
FileType[FileType["File"] = 1] = "File";
|
|
20
|
+
/**
|
|
21
|
+
* A directory.
|
|
22
|
+
*/
|
|
23
|
+
FileType[FileType["Directory"] = 2] = "Directory";
|
|
24
|
+
/**
|
|
25
|
+
* A symbolic link to a file.
|
|
26
|
+
*/
|
|
27
|
+
FileType[FileType["SymbolicLink"] = 64] = "SymbolicLink";
|
|
28
|
+
})(FileType || (exports.FileType = FileType = {}));
|
|
29
|
+
/**
|
|
30
|
+
* Permissions of a file.
|
|
31
|
+
*/
|
|
32
|
+
var FilePermission;
|
|
33
|
+
(function (FilePermission) {
|
|
34
|
+
/**
|
|
35
|
+
* The file is readonly.
|
|
36
|
+
*
|
|
37
|
+
* *Note:* All `FileStat` from a `FileSystemProvider` that is registered with
|
|
38
|
+
* the option `isReadonly: true` will be implicitly handled as if `FilePermission.Readonly`
|
|
39
|
+
* is set. As a consequence, it is not possible to have a readonly file system provider
|
|
40
|
+
* registered where some `FileStat` are not readonly.
|
|
41
|
+
*/
|
|
42
|
+
FilePermission[FilePermission["Readonly"] = 1] = "Readonly";
|
|
43
|
+
})(FilePermission || (exports.FilePermission = FilePermission = {}));
|
|
44
|
+
function convertBlobToString(blob) {
|
|
45
|
+
try {
|
|
46
|
+
let binaryData = null;
|
|
47
|
+
// if vscode runs in desktop mode, the blob is a serialized buffer
|
|
48
|
+
if (blob?.type === 'Buffer') {
|
|
49
|
+
binaryData = Uint8Array.from(blob.data);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
binaryData = blob;
|
|
53
|
+
}
|
|
54
|
+
return new TextDecoder('utf8').decode(binaryData);
|
|
55
|
+
}
|
|
56
|
+
catch (e) {
|
|
57
|
+
return '';
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
//# sourceMappingURL=FS.js.map
|
package/out/api.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC"}
|
package/out/api.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Registry = exports.Manifest = exports.Dependencies = void 0;
|
|
4
|
+
const dependencies_1 = require("./dependencies");
|
|
5
|
+
Object.defineProperty(exports, "Dependencies", { enumerable: true, get: function () { return dependencies_1.Dependencies; } });
|
|
6
|
+
const manifest_1 = require("./manifest");
|
|
7
|
+
Object.defineProperty(exports, "Manifest", { enumerable: true, get: function () { return manifest_1.Manifest; } });
|
|
8
|
+
const registryAPI_1 = require("./registryAPI");
|
|
9
|
+
Object.defineProperty(exports, "Registry", { enumerable: true, get: function () { return registryAPI_1.Registry; } });
|
|
10
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cliFS.d.ts","sourceRoot":"","sources":["../src/cliFS.ts"],"names":[],"mappings":"AACA,OAAO,EAAsB,OAAO,EAAE,MAAM,MAAM,CAAC;AAInD,eAAO,MAAM,KAAK,EAAE,OAmCnB,CAAC"}
|
package/out/cliFS.js
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.cliFS = void 0;
|
|
7
|
+
const promises_1 = __importDefault(require("node:fs/promises"));
|
|
8
|
+
const FS_1 = require("./FS");
|
|
9
|
+
const vscode_uri_1 = require("vscode-uri");
|
|
10
|
+
var dirname = vscode_uri_1.Utils.dirname;
|
|
11
|
+
exports.cliFS = {
|
|
12
|
+
readFile(path) {
|
|
13
|
+
return promises_1.default.readFile(path.fsPath);
|
|
14
|
+
},
|
|
15
|
+
async rm(path) {
|
|
16
|
+
if (await this.stat(path)) {
|
|
17
|
+
return promises_1.default.rm(path.fsPath, { recursive: true });
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
async stat(path) {
|
|
21
|
+
try {
|
|
22
|
+
const stat = await promises_1.default.stat(path.fsPath);
|
|
23
|
+
const fileType = (stat.isDirectory() ? FS_1.FileType.Directory : 0) |
|
|
24
|
+
(stat.isFile() ? FS_1.FileType.File : 0) |
|
|
25
|
+
(stat.isSymbolicLink() ? FS_1.FileType.SymbolicLink : 0);
|
|
26
|
+
return {
|
|
27
|
+
ctime: stat.ctimeMs,
|
|
28
|
+
mtime: stat.mtimeMs,
|
|
29
|
+
permissions: undefined,
|
|
30
|
+
size: stat.size,
|
|
31
|
+
type: fileType
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
catch (e) {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
async writeFile(path, content) {
|
|
39
|
+
if (typeof content === 'string') {
|
|
40
|
+
content = new TextEncoder().encode(content);
|
|
41
|
+
}
|
|
42
|
+
const dirPath = dirname(path);
|
|
43
|
+
await promises_1.default.mkdir(dirPath.fsPath, { recursive: true });
|
|
44
|
+
return promises_1.default.writeFile(path.fsPath, content, { flag: 'w' });
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=cliFS.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependencies.d.ts","sourceRoot":"","sources":["../src/dependencies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAS,MAAM,YAAY,CAAC;AACxC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAMhC,eAAO,MAAM,QAAQ,oBAAoB,CAAC;AAE1C,yBAAiB,YAAY,CAAC;IAC7B;;;;OAIG;IACH,SAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,UAM7C;IAED;;;;;;OAMG;IACH,SAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,EAAE,KAAK,EAAE,MAAM,QAKvF;IAED;;;;;;OAMG;IACH,SAAsB,sBAAsB,CAC3C,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,OAAO,EACX,iBAAiB,GAAE,QAAQ,CAAC,YAAiB,EAC7C,WAAW,UAAQ,kCAgCnB;IAED;;;;;;;OAOG;IACH,SAAsB,qBAAqB,CAC1C,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,OAAO,EACX,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,MAAM,oBActB;IAED;;;;;OAKG;IACH,SAAsB,cAAc,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAK9E;IAED;;;;;;OAMG;IACH,SAAsB,qBAAqB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,WAAW,iBAYjH;IAED;;;;;;;;OAQG;IACH,SAAsB,iBAAiB,CACtC,GAAG,EAAE,GAAG,EACR,EAAE,EAAE,OAAO,EACX,KAAK,EAAE,MAAM,GAAG,IAAI,EACpB,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,WAAW,UAAQ,GACjB,OAAO,CAAC,SAAS,CAAC,CA2DpB;IAED;;;;;OAKG;IACH,SAAsB,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,iBAapF;IAED;;;;;;;OAOG;IACH,SAAsB,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,iBAmBxG;CACD"}
|