ovsx 0.5.0 → 0.5.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/CHANGELOG.md +63 -63
- package/README.md +48 -48
- package/lib/check-license.d.ts +12 -12
- package/lib/check-license.js +110 -110
- package/lib/create-namespace.d.ts +20 -20
- package/lib/create-namespace.js +43 -43
- package/lib/get.d.ts +36 -36
- package/lib/get.js +122 -122
- package/lib/index.d.ts +15 -15
- package/lib/index.js +23 -23
- package/lib/main.d.ts +10 -10
- package/lib/main.js +93 -93
- package/lib/ovsx +10 -10
- package/lib/publish.d.ts +39 -39
- package/lib/publish.js +94 -94
- package/lib/registry.d.ts +130 -130
- package/lib/registry.js +201 -201
- package/lib/util.d.ts +35 -35
- package/lib/util.js +183 -183
- package/package.json +67 -67
- package/src/ovsx +10 -10
package/lib/publish.d.ts
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import { RegistryOptions } from './registry';
|
|
2
|
-
/**
|
|
3
|
-
* Publishes an extension.
|
|
4
|
-
*/
|
|
5
|
-
export declare function publish(options?: PublishOptions): Promise<void>;
|
|
6
|
-
interface PublishCommonOptions extends RegistryOptions {
|
|
7
|
-
/**
|
|
8
|
-
* Path to the vsix file to be published. Cannot be used together with `packagePath`.
|
|
9
|
-
*/
|
|
10
|
-
extensionFile?: string;
|
|
11
|
-
/**
|
|
12
|
-
* The base URL for links detected in Markdown files. Only valid with `packagePath`.
|
|
13
|
-
*/
|
|
14
|
-
baseContentUrl?: string;
|
|
15
|
-
/**
|
|
16
|
-
* The base URL for images detected in Markdown files. Only valid with `packagePath`.
|
|
17
|
-
*/
|
|
18
|
-
baseImagesUrl?: string;
|
|
19
|
-
/**
|
|
20
|
-
* Should use `yarn` instead of `npm`. Only valid with `packagePath`.
|
|
21
|
-
*/
|
|
22
|
-
yarn?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* Mark this package as a pre-release. Only valid with `packagePath`.
|
|
25
|
-
*/
|
|
26
|
-
preRelease?: boolean;
|
|
27
|
-
}
|
|
28
|
-
export interface PublishOptions extends PublishCommonOptions {
|
|
29
|
-
/**
|
|
30
|
-
* Target architectures.
|
|
31
|
-
*/
|
|
32
|
-
targets?: string[];
|
|
33
|
-
/**
|
|
34
|
-
* Paths to the extension to be packaged and published. Cannot be used together
|
|
35
|
-
* with `extensionFile`.
|
|
36
|
-
*/
|
|
37
|
-
packagePath?: string[];
|
|
38
|
-
}
|
|
39
|
-
export {};
|
|
1
|
+
import { RegistryOptions } from './registry';
|
|
2
|
+
/**
|
|
3
|
+
* Publishes an extension.
|
|
4
|
+
*/
|
|
5
|
+
export declare function publish(options?: PublishOptions): Promise<void>;
|
|
6
|
+
interface PublishCommonOptions extends RegistryOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Path to the vsix file to be published. Cannot be used together with `packagePath`.
|
|
9
|
+
*/
|
|
10
|
+
extensionFile?: string;
|
|
11
|
+
/**
|
|
12
|
+
* The base URL for links detected in Markdown files. Only valid with `packagePath`.
|
|
13
|
+
*/
|
|
14
|
+
baseContentUrl?: string;
|
|
15
|
+
/**
|
|
16
|
+
* The base URL for images detected in Markdown files. Only valid with `packagePath`.
|
|
17
|
+
*/
|
|
18
|
+
baseImagesUrl?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Should use `yarn` instead of `npm`. Only valid with `packagePath`.
|
|
21
|
+
*/
|
|
22
|
+
yarn?: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Mark this package as a pre-release. Only valid with `packagePath`.
|
|
25
|
+
*/
|
|
26
|
+
preRelease?: boolean;
|
|
27
|
+
}
|
|
28
|
+
export interface PublishOptions extends PublishCommonOptions {
|
|
29
|
+
/**
|
|
30
|
+
* Target architectures.
|
|
31
|
+
*/
|
|
32
|
+
targets?: string[];
|
|
33
|
+
/**
|
|
34
|
+
* Paths to the extension to be packaged and published. Cannot be used together
|
|
35
|
+
* with `extensionFile`.
|
|
36
|
+
*/
|
|
37
|
+
packagePath?: string[];
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
40
40
|
//# sourceMappingURL=publish.d.ts.map
|
package/lib/publish.js
CHANGED
|
@@ -1,95 +1,95 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
/********************************************************************************
|
|
13
|
-
* Copyright (c) 2019 TypeFox and others
|
|
14
|
-
*
|
|
15
|
-
* This program and the accompanying materials are made available under the
|
|
16
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
17
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
18
|
-
*
|
|
19
|
-
* SPDX-License-Identifier: EPL-2.0
|
|
20
|
-
********************************************************************************/
|
|
21
|
-
const vsce_1 = require("vsce");
|
|
22
|
-
const util_1 = require("./util");
|
|
23
|
-
const registry_1 = require("./registry");
|
|
24
|
-
const check_license_1 = require("./check-license");
|
|
25
|
-
/**
|
|
26
|
-
* Publishes an extension.
|
|
27
|
-
*/
|
|
28
|
-
function publish(options = {}) {
|
|
29
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
-
util_1.addEnvOptions(options);
|
|
31
|
-
const internalPublishOptions = [];
|
|
32
|
-
const packagePaths = options.packagePath || [undefined];
|
|
33
|
-
const targets = options.targets || [undefined];
|
|
34
|
-
for (const packagePath of packagePaths) {
|
|
35
|
-
for (const target of targets) {
|
|
36
|
-
internalPublishOptions.push(Object.assign(Object.assign({}, options), { packagePath: packagePath, target: target }));
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
yield Promise.all(internalPublishOptions.map(publishOptions => doPublish(publishOptions)));
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
exports.publish = publish;
|
|
43
|
-
function doPublish(options = {}) {
|
|
44
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
if (!options.pat) {
|
|
46
|
-
throw new Error("A personal access token must be given with the option '--pat'.");
|
|
47
|
-
}
|
|
48
|
-
// if the packagePath is a link to a vsix, don't need to package it
|
|
49
|
-
if (options.packagePath && options.packagePath.endsWith('.vsix')) {
|
|
50
|
-
options.extensionFile = options.packagePath;
|
|
51
|
-
delete options.packagePath;
|
|
52
|
-
delete options.target;
|
|
53
|
-
}
|
|
54
|
-
const registry = new registry_1.Registry(options);
|
|
55
|
-
if (!options.extensionFile) {
|
|
56
|
-
yield packageExtension(options, registry);
|
|
57
|
-
console.log(); // new line
|
|
58
|
-
}
|
|
59
|
-
else if (options.preRelease) {
|
|
60
|
-
console.warn("Ignoring option '--pre-release' for prepackaged extension.");
|
|
61
|
-
}
|
|
62
|
-
const extension = yield registry.publish(options.extensionFile, options.pat);
|
|
63
|
-
if (extension.error) {
|
|
64
|
-
throw new Error(extension.error);
|
|
65
|
-
}
|
|
66
|
-
const name = `${extension.namespace}.${extension.name}`;
|
|
67
|
-
let description = `${name} v${extension.version}`;
|
|
68
|
-
if (options.target) {
|
|
69
|
-
description += `@${options.target}`;
|
|
70
|
-
}
|
|
71
|
-
console.log(`\ud83d\ude80 Published ${description}`);
|
|
72
|
-
if (extension.warning) {
|
|
73
|
-
console.log(`\n!! ${extension.warning}`);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
function packageExtension(options, registry) {
|
|
78
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
-
if (registry.requiresLicense) {
|
|
80
|
-
yield check_license_1.checkLicense(options.packagePath);
|
|
81
|
-
}
|
|
82
|
-
options.extensionFile = yield util_1.createTempFile({ postfix: '.vsix' });
|
|
83
|
-
const createVSIXOptions = {
|
|
84
|
-
target: options.target,
|
|
85
|
-
cwd: options.packagePath,
|
|
86
|
-
packagePath: options.extensionFile,
|
|
87
|
-
baseContentUrl: options.baseContentUrl,
|
|
88
|
-
baseImagesUrl: options.baseImagesUrl,
|
|
89
|
-
useYarn: options.yarn,
|
|
90
|
-
preRelease: options.preRelease
|
|
91
|
-
};
|
|
92
|
-
yield vsce_1.createVSIX(createVSIXOptions);
|
|
93
|
-
});
|
|
94
|
-
}
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
/********************************************************************************
|
|
13
|
+
* Copyright (c) 2019 TypeFox and others
|
|
14
|
+
*
|
|
15
|
+
* This program and the accompanying materials are made available under the
|
|
16
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
17
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
18
|
+
*
|
|
19
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
20
|
+
********************************************************************************/
|
|
21
|
+
const vsce_1 = require("vsce");
|
|
22
|
+
const util_1 = require("./util");
|
|
23
|
+
const registry_1 = require("./registry");
|
|
24
|
+
const check_license_1 = require("./check-license");
|
|
25
|
+
/**
|
|
26
|
+
* Publishes an extension.
|
|
27
|
+
*/
|
|
28
|
+
function publish(options = {}) {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
util_1.addEnvOptions(options);
|
|
31
|
+
const internalPublishOptions = [];
|
|
32
|
+
const packagePaths = options.packagePath || [undefined];
|
|
33
|
+
const targets = options.targets || [undefined];
|
|
34
|
+
for (const packagePath of packagePaths) {
|
|
35
|
+
for (const target of targets) {
|
|
36
|
+
internalPublishOptions.push(Object.assign(Object.assign({}, options), { packagePath: packagePath, target: target }));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
yield Promise.all(internalPublishOptions.map(publishOptions => doPublish(publishOptions)));
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
exports.publish = publish;
|
|
43
|
+
function doPublish(options = {}) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
if (!options.pat) {
|
|
46
|
+
throw new Error("A personal access token must be given with the option '--pat'.");
|
|
47
|
+
}
|
|
48
|
+
// if the packagePath is a link to a vsix, don't need to package it
|
|
49
|
+
if (options.packagePath && options.packagePath.endsWith('.vsix')) {
|
|
50
|
+
options.extensionFile = options.packagePath;
|
|
51
|
+
delete options.packagePath;
|
|
52
|
+
delete options.target;
|
|
53
|
+
}
|
|
54
|
+
const registry = new registry_1.Registry(options);
|
|
55
|
+
if (!options.extensionFile) {
|
|
56
|
+
yield packageExtension(options, registry);
|
|
57
|
+
console.log(); // new line
|
|
58
|
+
}
|
|
59
|
+
else if (options.preRelease) {
|
|
60
|
+
console.warn("Ignoring option '--pre-release' for prepackaged extension.");
|
|
61
|
+
}
|
|
62
|
+
const extension = yield registry.publish(options.extensionFile, options.pat);
|
|
63
|
+
if (extension.error) {
|
|
64
|
+
throw new Error(extension.error);
|
|
65
|
+
}
|
|
66
|
+
const name = `${extension.namespace}.${extension.name}`;
|
|
67
|
+
let description = `${name} v${extension.version}`;
|
|
68
|
+
if (options.target) {
|
|
69
|
+
description += `@${options.target}`;
|
|
70
|
+
}
|
|
71
|
+
console.log(`\ud83d\ude80 Published ${description}`);
|
|
72
|
+
if (extension.warning) {
|
|
73
|
+
console.log(`\n!! ${extension.warning}`);
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function packageExtension(options, registry) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
if (registry.requiresLicense) {
|
|
80
|
+
yield check_license_1.checkLicense(options.packagePath);
|
|
81
|
+
}
|
|
82
|
+
options.extensionFile = yield util_1.createTempFile({ postfix: '.vsix' });
|
|
83
|
+
const createVSIXOptions = {
|
|
84
|
+
target: options.target,
|
|
85
|
+
cwd: options.packagePath,
|
|
86
|
+
packagePath: options.extensionFile,
|
|
87
|
+
baseContentUrl: options.baseContentUrl,
|
|
88
|
+
baseImagesUrl: options.baseImagesUrl,
|
|
89
|
+
useYarn: options.yarn,
|
|
90
|
+
preRelease: options.preRelease
|
|
91
|
+
};
|
|
92
|
+
yield vsce_1.createVSIX(createVSIXOptions);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
95
|
//# sourceMappingURL=publish.js.map
|
package/lib/registry.d.ts
CHANGED
|
@@ -1,131 +1,131 @@
|
|
|
1
|
-
/********************************************************************************
|
|
2
|
-
* Copyright (c) 2019 TypeFox and others
|
|
3
|
-
*
|
|
4
|
-
* This program and the accompanying materials are made available under the
|
|
5
|
-
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
-
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
-
*
|
|
8
|
-
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
-
********************************************************************************/
|
|
10
|
-
/// <reference types="node" />
|
|
11
|
-
import * as http from 'http';
|
|
12
|
-
export declare const DEFAULT_URL = "https://open-vsx.org";
|
|
13
|
-
export declare const DEFAULT_NAMESPACE_SIZE = 1024;
|
|
14
|
-
export declare const DEFAULT_PUBLISH_SIZE: number;
|
|
15
|
-
export declare class Registry {
|
|
16
|
-
readonly url: string;
|
|
17
|
-
readonly maxNamespaceSize: number;
|
|
18
|
-
readonly maxPublishSize: number;
|
|
19
|
-
readonly username?: string;
|
|
20
|
-
readonly password?: string;
|
|
21
|
-
constructor(options?: RegistryOptions);
|
|
22
|
-
get requiresLicense(): boolean;
|
|
23
|
-
createNamespace(name: string, pat: string): Promise<Response>;
|
|
24
|
-
publish(file: string, pat: string): Promise<Extension>;
|
|
25
|
-
getMetadata(namespace: string, extension: string, target?: string): Promise<Extension>;
|
|
26
|
-
download(file: string, url: URL): Promise<void>;
|
|
27
|
-
getJson<T extends Response>(url: URL): Promise<T>;
|
|
28
|
-
post<T extends Response>(content: string | Buffer | Uint8Array, url: URL, headers?: http.OutgoingHttpHeaders, maxBodyLength?: number): Promise<T>;
|
|
29
|
-
postFile<T extends Response>(file: string, url: URL, headers?: http.OutgoingHttpHeaders, maxBodyLength?: number): Promise<T>;
|
|
30
|
-
private getUrl;
|
|
31
|
-
private getProtocol;
|
|
32
|
-
private getRequestOptions;
|
|
33
|
-
private getJsonResponse;
|
|
34
|
-
}
|
|
35
|
-
export interface RegistryOptions {
|
|
36
|
-
/**
|
|
37
|
-
* The base URL of the registry API.
|
|
38
|
-
*/
|
|
39
|
-
registryUrl?: string;
|
|
40
|
-
/**
|
|
41
|
-
* Personal access token.
|
|
42
|
-
*/
|
|
43
|
-
pat?: string;
|
|
44
|
-
/**
|
|
45
|
-
* User name for basic authentication.
|
|
46
|
-
*/
|
|
47
|
-
username?: string;
|
|
48
|
-
/**
|
|
49
|
-
* Password for basic authentication.
|
|
50
|
-
*/
|
|
51
|
-
password?: string;
|
|
52
|
-
/**
|
|
53
|
-
* Maximal request body size for creating namespaces.
|
|
54
|
-
*/
|
|
55
|
-
maxNamespaceSize?: number;
|
|
56
|
-
/**
|
|
57
|
-
* Maximal request body size for publishing.
|
|
58
|
-
*/
|
|
59
|
-
maxPublishSize?: number;
|
|
60
|
-
}
|
|
61
|
-
export interface Response {
|
|
62
|
-
success?: string;
|
|
63
|
-
warning?: string;
|
|
64
|
-
error?: string;
|
|
65
|
-
}
|
|
66
|
-
export interface Extension extends Response {
|
|
67
|
-
namespaceUrl: string;
|
|
68
|
-
reviewsUrl: string;
|
|
69
|
-
files: {
|
|
70
|
-
[type: string]: string;
|
|
71
|
-
};
|
|
72
|
-
name: string;
|
|
73
|
-
namespace: string;
|
|
74
|
-
version: string;
|
|
75
|
-
targetPlatform: string;
|
|
76
|
-
publishedBy: UserData;
|
|
77
|
-
verified: boolean;
|
|
78
|
-
allVersions: {
|
|
79
|
-
[version: string]: string;
|
|
80
|
-
};
|
|
81
|
-
averageRating?: number;
|
|
82
|
-
downloadCount: number;
|
|
83
|
-
reviewCount: number;
|
|
84
|
-
versionAlias: string[];
|
|
85
|
-
timestamp: string;
|
|
86
|
-
preview?: boolean;
|
|
87
|
-
displayName?: string;
|
|
88
|
-
description?: string;
|
|
89
|
-
engines?: {
|
|
90
|
-
[engine: string]: string;
|
|
91
|
-
};
|
|
92
|
-
categories?: string[];
|
|
93
|
-
tags?: string[];
|
|
94
|
-
license?: string;
|
|
95
|
-
homepage?: string;
|
|
96
|
-
repository?: string;
|
|
97
|
-
bugs?: string;
|
|
98
|
-
markdown?: string;
|
|
99
|
-
galleryColor?: string;
|
|
100
|
-
galleryTheme?: string;
|
|
101
|
-
qna?: string;
|
|
102
|
-
badges?: Badge[];
|
|
103
|
-
dependencies?: ExtensionReference[];
|
|
104
|
-
bundledExtensions?: ExtensionReference[];
|
|
105
|
-
}
|
|
106
|
-
export interface UserData {
|
|
107
|
-
loginName: string;
|
|
108
|
-
fullName?: string;
|
|
109
|
-
avatarUrl?: string;
|
|
110
|
-
homepage?: string;
|
|
111
|
-
}
|
|
112
|
-
export interface Badge {
|
|
113
|
-
url: string;
|
|
114
|
-
href: string;
|
|
115
|
-
description: string;
|
|
116
|
-
}
|
|
117
|
-
export interface ExtensionReference {
|
|
118
|
-
url: string;
|
|
119
|
-
namespace: string;
|
|
120
|
-
extension: string;
|
|
121
|
-
version?: string;
|
|
122
|
-
}
|
|
123
|
-
export interface ErrorResponse {
|
|
124
|
-
error: string;
|
|
125
|
-
message: string;
|
|
126
|
-
status: number;
|
|
127
|
-
path?: string;
|
|
128
|
-
timestamp?: string;
|
|
129
|
-
trace?: string;
|
|
130
|
-
}
|
|
1
|
+
/********************************************************************************
|
|
2
|
+
* Copyright (c) 2019 TypeFox and others
|
|
3
|
+
*
|
|
4
|
+
* This program and the accompanying materials are made available under the
|
|
5
|
+
* terms of the Eclipse Public License v. 2.0 which is available at
|
|
6
|
+
* http://www.eclipse.org/legal/epl-2.0.
|
|
7
|
+
*
|
|
8
|
+
* SPDX-License-Identifier: EPL-2.0
|
|
9
|
+
********************************************************************************/
|
|
10
|
+
/// <reference types="node" />
|
|
11
|
+
import * as http from 'http';
|
|
12
|
+
export declare const DEFAULT_URL = "https://open-vsx.org";
|
|
13
|
+
export declare const DEFAULT_NAMESPACE_SIZE = 1024;
|
|
14
|
+
export declare const DEFAULT_PUBLISH_SIZE: number;
|
|
15
|
+
export declare class Registry {
|
|
16
|
+
readonly url: string;
|
|
17
|
+
readonly maxNamespaceSize: number;
|
|
18
|
+
readonly maxPublishSize: number;
|
|
19
|
+
readonly username?: string;
|
|
20
|
+
readonly password?: string;
|
|
21
|
+
constructor(options?: RegistryOptions);
|
|
22
|
+
get requiresLicense(): boolean;
|
|
23
|
+
createNamespace(name: string, pat: string): Promise<Response>;
|
|
24
|
+
publish(file: string, pat: string): Promise<Extension>;
|
|
25
|
+
getMetadata(namespace: string, extension: string, target?: string): Promise<Extension>;
|
|
26
|
+
download(file: string, url: URL): Promise<void>;
|
|
27
|
+
getJson<T extends Response>(url: URL): Promise<T>;
|
|
28
|
+
post<T extends Response>(content: string | Buffer | Uint8Array, url: URL, headers?: http.OutgoingHttpHeaders, maxBodyLength?: number): Promise<T>;
|
|
29
|
+
postFile<T extends Response>(file: string, url: URL, headers?: http.OutgoingHttpHeaders, maxBodyLength?: number): Promise<T>;
|
|
30
|
+
private getUrl;
|
|
31
|
+
private getProtocol;
|
|
32
|
+
private getRequestOptions;
|
|
33
|
+
private getJsonResponse;
|
|
34
|
+
}
|
|
35
|
+
export interface RegistryOptions {
|
|
36
|
+
/**
|
|
37
|
+
* The base URL of the registry API.
|
|
38
|
+
*/
|
|
39
|
+
registryUrl?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Personal access token.
|
|
42
|
+
*/
|
|
43
|
+
pat?: string;
|
|
44
|
+
/**
|
|
45
|
+
* User name for basic authentication.
|
|
46
|
+
*/
|
|
47
|
+
username?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Password for basic authentication.
|
|
50
|
+
*/
|
|
51
|
+
password?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Maximal request body size for creating namespaces.
|
|
54
|
+
*/
|
|
55
|
+
maxNamespaceSize?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Maximal request body size for publishing.
|
|
58
|
+
*/
|
|
59
|
+
maxPublishSize?: number;
|
|
60
|
+
}
|
|
61
|
+
export interface Response {
|
|
62
|
+
success?: string;
|
|
63
|
+
warning?: string;
|
|
64
|
+
error?: string;
|
|
65
|
+
}
|
|
66
|
+
export interface Extension extends Response {
|
|
67
|
+
namespaceUrl: string;
|
|
68
|
+
reviewsUrl: string;
|
|
69
|
+
files: {
|
|
70
|
+
[type: string]: string;
|
|
71
|
+
};
|
|
72
|
+
name: string;
|
|
73
|
+
namespace: string;
|
|
74
|
+
version: string;
|
|
75
|
+
targetPlatform: string;
|
|
76
|
+
publishedBy: UserData;
|
|
77
|
+
verified: boolean;
|
|
78
|
+
allVersions: {
|
|
79
|
+
[version: string]: string;
|
|
80
|
+
};
|
|
81
|
+
averageRating?: number;
|
|
82
|
+
downloadCount: number;
|
|
83
|
+
reviewCount: number;
|
|
84
|
+
versionAlias: string[];
|
|
85
|
+
timestamp: string;
|
|
86
|
+
preview?: boolean;
|
|
87
|
+
displayName?: string;
|
|
88
|
+
description?: string;
|
|
89
|
+
engines?: {
|
|
90
|
+
[engine: string]: string;
|
|
91
|
+
};
|
|
92
|
+
categories?: string[];
|
|
93
|
+
tags?: string[];
|
|
94
|
+
license?: string;
|
|
95
|
+
homepage?: string;
|
|
96
|
+
repository?: string;
|
|
97
|
+
bugs?: string;
|
|
98
|
+
markdown?: string;
|
|
99
|
+
galleryColor?: string;
|
|
100
|
+
galleryTheme?: string;
|
|
101
|
+
qna?: string;
|
|
102
|
+
badges?: Badge[];
|
|
103
|
+
dependencies?: ExtensionReference[];
|
|
104
|
+
bundledExtensions?: ExtensionReference[];
|
|
105
|
+
}
|
|
106
|
+
export interface UserData {
|
|
107
|
+
loginName: string;
|
|
108
|
+
fullName?: string;
|
|
109
|
+
avatarUrl?: string;
|
|
110
|
+
homepage?: string;
|
|
111
|
+
}
|
|
112
|
+
export interface Badge {
|
|
113
|
+
url: string;
|
|
114
|
+
href: string;
|
|
115
|
+
description: string;
|
|
116
|
+
}
|
|
117
|
+
export interface ExtensionReference {
|
|
118
|
+
url: string;
|
|
119
|
+
namespace: string;
|
|
120
|
+
extension: string;
|
|
121
|
+
version?: string;
|
|
122
|
+
}
|
|
123
|
+
export interface ErrorResponse {
|
|
124
|
+
error: string;
|
|
125
|
+
message: string;
|
|
126
|
+
status: number;
|
|
127
|
+
path?: string;
|
|
128
|
+
timestamp?: string;
|
|
129
|
+
trace?: string;
|
|
130
|
+
}
|
|
131
131
|
//# sourceMappingURL=registry.d.ts.map
|