@theia/ovsx-client 1.67.0-next.56 → 1.67.0-next.59
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/lib/index.d.ts +7 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +33 -0
- package/lib/index.js.map +1 -0
- package/lib/ovsx-api-filter.d.ts +37 -0
- package/lib/ovsx-api-filter.d.ts.map +1 -0
- package/lib/ovsx-api-filter.js +117 -0
- package/lib/ovsx-api-filter.js.map +1 -0
- package/lib/ovsx-http-client.d.ts +21 -0
- package/lib/ovsx-http-client.d.ts.map +1 -0
- package/lib/ovsx-http-client.js +84 -0
- package/lib/ovsx-http-client.js.map +1 -0
- package/lib/ovsx-router-client.d.ts +69 -0
- package/lib/ovsx-router-client.d.ts.map +1 -0
- package/lib/ovsx-router-client.js +175 -0
- package/lib/ovsx-router-client.js.map +1 -0
- package/lib/ovsx-router-client.spec.d.ts +2 -0
- package/lib/ovsx-router-client.spec.d.ts.map +1 -0
- package/lib/ovsx-router-client.spec.js +108 -0
- package/lib/ovsx-router-client.spec.js.map +1 -0
- package/lib/ovsx-router-filters/abstract-reg-exp-filter.d.ts +6 -0
- package/lib/ovsx-router-filters/abstract-reg-exp-filter.d.ts.map +1 -0
- package/lib/ovsx-router-filters/abstract-reg-exp-filter.js +28 -0
- package/lib/ovsx-router-filters/abstract-reg-exp-filter.js.map +1 -0
- package/lib/ovsx-router-filters/extension-id-matches-filter.d.ts +8 -0
- package/lib/ovsx-router-filters/extension-id-matches-filter.d.ts.map +1 -0
- package/lib/ovsx-router-filters/extension-id-matches-filter.js +34 -0
- package/lib/ovsx-router-filters/extension-id-matches-filter.js.map +1 -0
- package/lib/ovsx-router-filters/index.d.ts +3 -0
- package/lib/ovsx-router-filters/index.d.ts.map +1 -0
- package/lib/ovsx-router-filters/index.js +23 -0
- package/lib/ovsx-router-filters/index.js.map +1 -0
- package/lib/ovsx-router-filters/request-contains-filter.d.ts +9 -0
- package/lib/ovsx-router-filters/request-contains-filter.d.ts.map +1 -0
- package/lib/ovsx-router-filters/request-contains-filter.js +36 -0
- package/lib/ovsx-router-filters/request-contains-filter.js.map +1 -0
- package/lib/ovsx-types.d.ts +245 -0
- package/lib/ovsx-types.d.ts.map +1 -0
- package/lib/ovsx-types.js +75 -0
- package/lib/ovsx-types.js.map +1 -0
- package/lib/test/ovsx-mock-client.d.ts +44 -0
- package/lib/test/ovsx-mock-client.d.ts.map +1 -0
- package/lib/test/ovsx-mock-client.js +174 -0
- package/lib/test/ovsx-mock-client.js.map +1 -0
- package/lib/test/ovsx-router-client.spec-data.d.ts +11 -0
- package/lib/test/ovsx-router-client.spec-data.d.ts.map +1 -0
- package/lib/test/ovsx-router-client.spec-data.js +67 -0
- package/lib/test/ovsx-router-client.spec-data.js.map +1 -0
- package/lib/types.d.ts +2 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +18 -0
- package/lib/types.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2023 Ericsson and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
/* eslint-disable no-null/no-null */
|
|
19
|
+
const ovsx_router_client_1 = require("./ovsx-router-client");
|
|
20
|
+
const ovsx_router_client_spec_data_1 = require("./test/ovsx-router-client.spec-data");
|
|
21
|
+
const ovsx_types_1 = require("./ovsx-types");
|
|
22
|
+
const assert = require("assert");
|
|
23
|
+
describe('OVSXRouterClient', async () => {
|
|
24
|
+
const router = await ovsx_router_client_1.OVSXRouterClient.FromConfig({
|
|
25
|
+
registries: ovsx_router_client_spec_data_1.registries,
|
|
26
|
+
use: ['internal', 'public', 'third'],
|
|
27
|
+
rules: [{
|
|
28
|
+
ifRequestContains: /\btestFullStop\b/.source,
|
|
29
|
+
use: null,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
ifRequestContains: /\bsecret\b/.source,
|
|
33
|
+
use: 'internal'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
ifExtensionIdMatches: /^some\./.source,
|
|
37
|
+
use: 'internal'
|
|
38
|
+
}]
|
|
39
|
+
}, ovsx_router_client_spec_data_1.testClientProvider, ovsx_router_client_spec_data_1.filterFactories);
|
|
40
|
+
it('test query agglomeration', async () => {
|
|
41
|
+
const result = await router.query({ namespaceName: 'other' });
|
|
42
|
+
assert.deepStrictEqual(result.extensions.map(ovsx_types_1.ExtensionLike.id), [
|
|
43
|
+
// note the order: plugins from "internal" first then from "public"
|
|
44
|
+
'other.d',
|
|
45
|
+
'other.e'
|
|
46
|
+
]);
|
|
47
|
+
});
|
|
48
|
+
it('test query request filtering', async () => {
|
|
49
|
+
const result = await router.query({ namespaceName: 'secret' });
|
|
50
|
+
assert.deepStrictEqual(result.extensions.map(ovsx_types_1.ExtensionLike.id), [
|
|
51
|
+
// 'secret.w' from 'public' shouldn't be returned
|
|
52
|
+
'secret.x',
|
|
53
|
+
'secret.y',
|
|
54
|
+
'secret.z'
|
|
55
|
+
]);
|
|
56
|
+
});
|
|
57
|
+
it('test query result filtering', async () => {
|
|
58
|
+
const result = await router.query({ namespaceName: 'some' });
|
|
59
|
+
assert.deepStrictEqual(result.extensions.map(ovsx_types_1.ExtensionLike.idWithVersion), [
|
|
60
|
+
// no entry for the `some` namespace should be returned from the `public` registry
|
|
61
|
+
'some.a@1.0.0'
|
|
62
|
+
]);
|
|
63
|
+
});
|
|
64
|
+
it('test query full stop', async () => {
|
|
65
|
+
const result = await router.query({ extensionId: 'testFullStop.c' });
|
|
66
|
+
assert.deepStrictEqual(result.extensions.length, 0);
|
|
67
|
+
});
|
|
68
|
+
it('test search agglomeration', async () => {
|
|
69
|
+
const result = await router.search({ query: 'other.' });
|
|
70
|
+
assert.deepStrictEqual(result.extensions.map(ovsx_types_1.ExtensionLike.id), [
|
|
71
|
+
// note the order: plugins from "internal" first then from "public"
|
|
72
|
+
'other.d',
|
|
73
|
+
'other.e'
|
|
74
|
+
]);
|
|
75
|
+
});
|
|
76
|
+
it('test search request filtering', async () => {
|
|
77
|
+
const result = await router.search({ query: 'secret.' });
|
|
78
|
+
assert.deepStrictEqual(result.extensions.map(ovsx_types_1.ExtensionLike.id), [
|
|
79
|
+
// 'secret.w' from 'public' shouldn't be returned
|
|
80
|
+
'secret.x',
|
|
81
|
+
'secret.y',
|
|
82
|
+
'secret.z'
|
|
83
|
+
]);
|
|
84
|
+
});
|
|
85
|
+
it('test search result filtering', async () => {
|
|
86
|
+
const result = await router.search({ query: 'some.' });
|
|
87
|
+
assert.deepStrictEqual(result.extensions.map(ovsx_types_1.ExtensionLike.idWithVersion), [
|
|
88
|
+
// no entry for the `some` namespace should be returned from the `public` registry
|
|
89
|
+
'some.a@1.0.0'
|
|
90
|
+
]);
|
|
91
|
+
});
|
|
92
|
+
it('test search full stop', async () => {
|
|
93
|
+
const result = await router.search({ query: 'testFullStop.c' });
|
|
94
|
+
assert.deepStrictEqual(result.extensions.length, 0);
|
|
95
|
+
});
|
|
96
|
+
it('test config with unknown conditions', async () => {
|
|
97
|
+
const clientPromise = ovsx_router_client_1.OVSXRouterClient.FromConfig({
|
|
98
|
+
use: 'not relevant',
|
|
99
|
+
rules: [{
|
|
100
|
+
ifRequestContains: /.*/.source,
|
|
101
|
+
unknownCondition: /should cause an error to be thrown/.source,
|
|
102
|
+
use: ['internal', 'public']
|
|
103
|
+
}]
|
|
104
|
+
}, ovsx_router_client_spec_data_1.testClientProvider, ovsx_router_client_spec_data_1.filterFactories);
|
|
105
|
+
assert.rejects(clientPromise, /^Error: unknown conditions:/);
|
|
106
|
+
});
|
|
107
|
+
});
|
|
108
|
+
//# sourceMappingURL=ovsx-router-client.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ovsx-router-client.spec.js","sourceRoot":"","sources":["../src/ovsx-router-client.spec.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;AAEhF,oCAAoC;AAEpC,6DAAwD;AACxD,sFAAsG;AACtG,6CAA6C;AAC7C,iCAAkC;AAElC,QAAQ,CAAC,kBAAkB,EAAE,KAAK,IAAI,EAAE;IAEpC,MAAM,MAAM,GAAG,MAAM,qCAAgB,CAAC,UAAU,CAC5C;QACI,UAAU,EAAV,yCAAU;QACV,GAAG,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,OAAO,CAAC;QACpC,KAAK,EAAE,CAAC;gBACJ,iBAAiB,EAAE,kBAAkB,CAAC,MAAM;gBAC5C,GAAG,EAAE,IAAI;aACZ;YACD;gBACI,iBAAiB,EAAE,YAAY,CAAC,MAAM;gBACtC,GAAG,EAAE,UAAU;aAClB;YACD;gBACI,oBAAoB,EAAE,SAAS,CAAC,MAAM;gBACtC,GAAG,EAAE,UAAU;aAClB,CAAC;KACL,EACD,iDAAkB,EAClB,8CAAe,CAClB,CAAC;IAEF,EAAE,CAAC,0B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qC,EAAE,KAAK,IAAI,EAAE;QACjD,MAAM,aAAa,GAAG,qCAAgB,CAAC,UAAU,CAC7C;YACI,GAAG,EAAE,cAAc;YACnB,KAAK,EAAE,CAAC;oBACJ,iBAAiB,EAAE,IAAI,CAAC,MAAM;oBAC9B,gBAAgB,EAAE,oCAAoC,CAAC,MAAM;oBAC7D,GAAG,EAAE,CAAC,UAAU,EAAE,QAAQ,CAAC;iBAC9B,CAAC;SACL,EACD,iDAAkB,EAClB,8CAAe,CAClB,CAAC;QACF,MAAM,CAAC,OAAO,CAAC,aAAa,EAAE,6BAA6B,CAAC,CAAC;IACjE,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstract-reg-exp-filter.d.ts","sourceRoot":"","sources":["../../src/ovsx-router-filters/abstract-reg-exp-filter.ts"],"names":[],"mappings":"AAgBA,8BAAsB,oBAAoB;IAGlC,SAAS,CAAC,MAAM,EAAE,MAAM;gBAAd,MAAM,EAAE,MAAM;IAG5B,SAAS,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO;CAG1C"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2023 Ericsson and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.AbstractRegExpFilter = void 0;
|
|
19
|
+
class AbstractRegExpFilter {
|
|
20
|
+
constructor(regExp) {
|
|
21
|
+
this.regExp = regExp;
|
|
22
|
+
}
|
|
23
|
+
test(value) {
|
|
24
|
+
return typeof value === 'string' && this.regExp.test(value);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.AbstractRegExpFilter = AbstractRegExpFilter;
|
|
28
|
+
//# sourceMappingURL=abstract-reg-exp-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstract-reg-exp-filter.js","sourceRoot":"","sources":["../../src/ovsx-router-filters/abstract-reg-exp-filter.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,MAAsB,oBAAoB;IAEtC,YACc,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IACxB,CAAC;IAEK,IAAI,CAAC,KAAc;QACzB,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChE,CAAC;CACJ;AATD,oDASC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { OVSXRouterFilter } from '../ovsx-router-client';
|
|
2
|
+
import { ExtensionLike } from '../ovsx-types';
|
|
3
|
+
import { AbstractRegExpFilter } from './abstract-reg-exp-filter';
|
|
4
|
+
export declare const ExtensionIdMatchesFilterFactory: import("../ovsx-router-client").OVSXRouterFilterFactory;
|
|
5
|
+
export declare class ExtensionIdMatchesFilter extends AbstractRegExpFilter implements OVSXRouterFilter {
|
|
6
|
+
filterExtension(extension: ExtensionLike): boolean;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=extension-id-matches-filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-id-matches-filter.d.ts","sourceRoot":"","sources":["../../src/ovsx-router-filters/extension-id-matches-filter.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAuB,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,eAAO,MAAM,+BAA+B,yDAK1C,CAAC;AAEH,qBAAa,wBAAyB,SAAQ,oBAAqB,YAAW,gBAAgB;IAC1F,eAAe,CAAC,SAAS,EAAE,aAAa,GAAG,OAAO;CAGrD"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2023 Ericsson and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.ExtensionIdMatchesFilter = exports.ExtensionIdMatchesFilterFactory = void 0;
|
|
19
|
+
const ovsx_router_client_1 = require("../ovsx-router-client");
|
|
20
|
+
const ovsx_types_1 = require("../ovsx-types");
|
|
21
|
+
const abstract_reg_exp_filter_1 = require("./abstract-reg-exp-filter");
|
|
22
|
+
exports.ExtensionIdMatchesFilterFactory = (0, ovsx_router_client_1.createFilterFactory)('ifExtensionIdMatches', ifExtensionIdMatches => {
|
|
23
|
+
if (typeof ifExtensionIdMatches !== 'string') {
|
|
24
|
+
throw new TypeError(`expected a string, got: ${typeof ifExtensionIdMatches}`);
|
|
25
|
+
}
|
|
26
|
+
return new ExtensionIdMatchesFilter(new RegExp(ifExtensionIdMatches, 'i'));
|
|
27
|
+
});
|
|
28
|
+
class ExtensionIdMatchesFilter extends abstract_reg_exp_filter_1.AbstractRegExpFilter {
|
|
29
|
+
filterExtension(extension) {
|
|
30
|
+
return this.test(ovsx_types_1.ExtensionLike.id(extension));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
exports.ExtensionIdMatchesFilter = ExtensionIdMatchesFilter;
|
|
34
|
+
//# sourceMappingURL=extension-id-matches-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extension-id-matches-filter.js","sourceRoot":"","sources":["../../src/ovsx-router-filters/extension-id-matches-filter.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,8DAA8E;AAC9E,8CAA8C;AAC9C,uEAAiE;AAEpD,QAAA,+BAA+B,GAAG,IAAA,wCAAmB,EAAC,sBAAsB,EAAE,oBAAoB,CAAC,EAAE;IAC9G,IAAI,OAAO,oBAAoB,KAAK,QAAQ,EAAE,CAAC;QAC3C,MAAM,IAAI,SAAS,CAAC,2BAA2B,OAAO,oBAAoB,EAAE,CAAC,CAAC;IAClF,CAAC;IACD,OAAO,IAAI,wBAAwB,CAAC,IAAI,MAAM,CAAC,oBAAoB,EAAE,GAAG,CAAC,CAAC,CAAC;AAC/E,CAAC,CAAC,CAAC;AAEH,MAAa,wBAAyB,SAAQ,8CAAoB;IAC9D,eAAe,CAAC,SAAwB;QACpC,OAAO,IAAI,CAAC,IAAI,CAAC,0BAAa,CAAC,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAClD,CAAC;CACJ;AAJD,4DAIC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/ovsx-router-filters/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,+BAA+B,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2023 Ericsson and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.RequestContainsFilterFactory = exports.ExtensionIdMatchesFilterFactory = void 0;
|
|
19
|
+
var extension_id_matches_filter_1 = require("./extension-id-matches-filter");
|
|
20
|
+
Object.defineProperty(exports, "ExtensionIdMatchesFilterFactory", { enumerable: true, get: function () { return extension_id_matches_filter_1.ExtensionIdMatchesFilterFactory; } });
|
|
21
|
+
var request_contains_filter_1 = require("./request-contains-filter");
|
|
22
|
+
Object.defineProperty(exports, "RequestContainsFilterFactory", { enumerable: true, get: function () { return request_contains_filter_1.RequestContainsFilterFactory; } });
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ovsx-router-filters/index.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,6EAAgF;AAAvE,8IAAA,+BAA+B,OAAA;AACxC,qEAAyE;AAAhE,uIAAA,4BAA4B,OAAA"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { OVSXRouterFilter } from '../ovsx-router-client';
|
|
2
|
+
import { VSXQueryOptions, VSXSearchOptions } from '../ovsx-types';
|
|
3
|
+
import { AbstractRegExpFilter } from './abstract-reg-exp-filter';
|
|
4
|
+
export declare const RequestContainsFilterFactory: import("../ovsx-router-client").OVSXRouterFilterFactory;
|
|
5
|
+
export declare class RequestContainsFilter extends AbstractRegExpFilter implements OVSXRouterFilter {
|
|
6
|
+
filterSearchOptions(searchOptions?: VSXSearchOptions): boolean;
|
|
7
|
+
filterQueryOptions(queryOptions?: VSXQueryOptions): boolean;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=request-contains-filter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-contains-filter.d.ts","sourceRoot":"","sources":["../../src/ovsx-router-filters/request-contains-filter.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAuB,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAEjE,eAAO,MAAM,4BAA4B,yDAKvC,CAAC;AAEH,qBAAa,qBAAsB,SAAQ,oBAAqB,YAAW,gBAAgB;IACvF,mBAAmB,CAAC,aAAa,CAAC,EAAE,gBAAgB,GAAG,OAAO;IAG9D,kBAAkB,CAAC,YAAY,CAAC,EAAE,eAAe,GAAG,OAAO;CAG9D"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2023 Ericsson and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.RequestContainsFilter = exports.RequestContainsFilterFactory = void 0;
|
|
19
|
+
const ovsx_router_client_1 = require("../ovsx-router-client");
|
|
20
|
+
const abstract_reg_exp_filter_1 = require("./abstract-reg-exp-filter");
|
|
21
|
+
exports.RequestContainsFilterFactory = (0, ovsx_router_client_1.createFilterFactory)('ifRequestContains', ifRequestContains => {
|
|
22
|
+
if (typeof ifRequestContains !== 'string') {
|
|
23
|
+
throw new TypeError(`expected a string, got: ${typeof ifRequestContains}`);
|
|
24
|
+
}
|
|
25
|
+
return new RequestContainsFilter(new RegExp(ifRequestContains, 'i'));
|
|
26
|
+
});
|
|
27
|
+
class RequestContainsFilter extends abstract_reg_exp_filter_1.AbstractRegExpFilter {
|
|
28
|
+
filterSearchOptions(searchOptions) {
|
|
29
|
+
return !searchOptions || this.test(searchOptions.query) || this.test(searchOptions.category);
|
|
30
|
+
}
|
|
31
|
+
filterQueryOptions(queryOptions) {
|
|
32
|
+
return !queryOptions || Object.values(queryOptions).some(this.test, this);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.RequestContainsFilter = RequestContainsFilter;
|
|
36
|
+
//# sourceMappingURL=request-contains-filter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"request-contains-filter.js","sourceRoot":"","sources":["../../src/ovsx-router-filters/request-contains-filter.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,0CAA0C;AAC1C,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAEhF,8DAA8E;AAE9E,uEAAiE;AAEpD,QAAA,4BAA4B,GAAG,IAAA,wCAAmB,EAAC,mBAAmB,EAAE,iBAAiB,CAAC,EAAE;IACrG,IAAI,OAAO,iBAAiB,KAAK,QAAQ,EAAE,CAAC;QACxC,MAAM,IAAI,SAAS,CAAC,2BAA2B,OAAO,iBAAiB,EAAE,CAAC,CAAC;IAC/E,CAAC;IACD,OAAO,IAAI,qBAAqB,CAAC,IAAI,MAAM,CAAC,iBAAiB,EAAE,GAAG,CAAC,CAAC,CAAC;AACzE,CAAC,CAAC,CAAC;AAEH,MAAa,qBAAsB,SAAQ,8CAAoB;IAC3D,mBAAmB,CAAC,aAAgC;QAChD,OAAO,CAAC,aAAa,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,CAAC;IACjG,CAAC;IACD,kBAAkB,CAAC,YAA8B;QAC7C,OAAO,CAAC,YAAY,IAAI,MAAM,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC9E,CAAC;CACJ;AAPD,sDAOC"}
|
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import { MaybePromise } from './types';
|
|
2
|
+
export interface ExtensionLike {
|
|
3
|
+
name: string;
|
|
4
|
+
namespace: string;
|
|
5
|
+
version?: string;
|
|
6
|
+
}
|
|
7
|
+
export declare namespace ExtensionLike {
|
|
8
|
+
function id<T extends ExtensionLike>(extension: T): `${string}.${string}`;
|
|
9
|
+
function idWithVersion<T extends ExtensionLike>(extension: T): `${string}.${string}@${string}`;
|
|
10
|
+
function fromId(id: string): ExtensionLike;
|
|
11
|
+
}
|
|
12
|
+
export interface OVSXClient {
|
|
13
|
+
/**
|
|
14
|
+
* GET https://openvsx.org/api/-/search
|
|
15
|
+
*/
|
|
16
|
+
search(searchOptions?: VSXSearchOptions): Promise<VSXSearchResult>;
|
|
17
|
+
/**
|
|
18
|
+
* GET https://openvsx.org/api/v2/-/query
|
|
19
|
+
*
|
|
20
|
+
* Fetch one or all versions of an extension.
|
|
21
|
+
*/
|
|
22
|
+
query(queryOptions?: VSXQueryOptions): Promise<VSXQueryResult>;
|
|
23
|
+
}
|
|
24
|
+
/** @deprecated since 1.31.0 use {@link VSXSearchOptions} instead */
|
|
25
|
+
export type VSXSearchParam = VSXSearchOptions;
|
|
26
|
+
/**
|
|
27
|
+
* The possible options when performing a search.
|
|
28
|
+
*
|
|
29
|
+
* For available options, and default values consult the `swagger`: https://open-vsx.org/swagger-ui/index.html.
|
|
30
|
+
*
|
|
31
|
+
* Should be aligned with https://github.com/eclipse/openvsx/blob/b5694a712e07d266801394916bac30609e16d77b/server/src/main/java/org/eclipse/openvsx/RegistryAPI.java#L246-L266
|
|
32
|
+
*/
|
|
33
|
+
export interface VSXSearchOptions {
|
|
34
|
+
/**
|
|
35
|
+
* The query text for searching.
|
|
36
|
+
*/
|
|
37
|
+
query?: string;
|
|
38
|
+
/**
|
|
39
|
+
* The extension category.
|
|
40
|
+
*/
|
|
41
|
+
category?: string;
|
|
42
|
+
/**
|
|
43
|
+
* The maximum number of entries to return.
|
|
44
|
+
*/
|
|
45
|
+
size?: number;
|
|
46
|
+
/**
|
|
47
|
+
* The number of entries to skip (usually a multiple of the page size).
|
|
48
|
+
*/
|
|
49
|
+
offset?: number;
|
|
50
|
+
/**
|
|
51
|
+
* The sort order.
|
|
52
|
+
*/
|
|
53
|
+
sortOrder?: 'asc' | 'desc';
|
|
54
|
+
/**
|
|
55
|
+
* The sort key.
|
|
56
|
+
*/
|
|
57
|
+
sortBy?: 'averageRating' | 'downloadCount' | 'relevance' | 'timestamp';
|
|
58
|
+
/**
|
|
59
|
+
* By default an OpenVSX registry will return the last known version of
|
|
60
|
+
* extensions. Setting this field to `true` will have the registry specify
|
|
61
|
+
* the {@link VSXExtensionRaw.allVersions} field which references all known
|
|
62
|
+
* versions for each returned extension.
|
|
63
|
+
*
|
|
64
|
+
* @default false
|
|
65
|
+
*/
|
|
66
|
+
includeAllVersions?: boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Should be aligned with https://github.com/eclipse/openvsx/blob/e8f64fe145fc05d2de1469735d50a7a90e400bc4/server/src/main/java/org/eclipse/openvsx/json/SearchResultJson.java
|
|
70
|
+
*/
|
|
71
|
+
export interface VSXSearchResult {
|
|
72
|
+
offset: number;
|
|
73
|
+
extensions: VSXSearchEntry[];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The possible options when performing a search.
|
|
77
|
+
*
|
|
78
|
+
* For available options, and default values consult the `swagger`: https://open-vsx.org/swagger-ui/index.html.
|
|
79
|
+
*
|
|
80
|
+
* Should be aligned with https://github.com/eclipse/openvsx/blob/b5694a712e07d266801394916bac30609e16d77b/server/src/main/java/org/eclipse/openvsx/json/QueryParamJson.java#L18-L46
|
|
81
|
+
*/
|
|
82
|
+
export interface VSXQueryOptions {
|
|
83
|
+
namespaceName?: string;
|
|
84
|
+
extensionName?: string;
|
|
85
|
+
extensionVersion?: string;
|
|
86
|
+
extensionId?: string;
|
|
87
|
+
extensionUuid?: string;
|
|
88
|
+
namespaceUuid?: string;
|
|
89
|
+
includeAllVersions?: boolean | 'links';
|
|
90
|
+
targetPlatform?: VSXTargetPlatform;
|
|
91
|
+
size?: number;
|
|
92
|
+
offset?: number;
|
|
93
|
+
}
|
|
94
|
+
export type VSXTargetPlatform = 'universal' | 'web' | 'win32-x64' | 'win32-ia32' | 'win32-arm64' | 'darwin-x64' | 'darwin-arm64' | 'linux-x64' | 'linux-arm64' | 'linux-armhf' | 'alpine-x64' | 'alpine-arm64' | (string & {});
|
|
95
|
+
export interface VSXQueryResult {
|
|
96
|
+
success?: string;
|
|
97
|
+
warning?: string;
|
|
98
|
+
error?: string;
|
|
99
|
+
offset: number;
|
|
100
|
+
totalSize: number;
|
|
101
|
+
extensions: VSXExtensionRaw[];
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* This type describes the data as found in {@link VSXSearchEntry.allVersions}.
|
|
105
|
+
*
|
|
106
|
+
* Note that this type only represents one version of a given plugin, despite the name.
|
|
107
|
+
*/
|
|
108
|
+
export interface VSXAllVersions {
|
|
109
|
+
url: string;
|
|
110
|
+
version: string;
|
|
111
|
+
engines?: {
|
|
112
|
+
[version: string]: string;
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Should be aligned with https://github.com/eclipse/openvsx/blob/master/server/src/main/java/org/eclipse/openvsx/json/SearchEntryJson.java
|
|
117
|
+
*/
|
|
118
|
+
export interface VSXSearchEntry {
|
|
119
|
+
url: string;
|
|
120
|
+
files: {
|
|
121
|
+
download: string;
|
|
122
|
+
manifest?: string;
|
|
123
|
+
readme?: string;
|
|
124
|
+
license?: string;
|
|
125
|
+
icon?: string;
|
|
126
|
+
};
|
|
127
|
+
name: string;
|
|
128
|
+
namespace: string;
|
|
129
|
+
version: string;
|
|
130
|
+
timestamp: string;
|
|
131
|
+
averageRating?: number;
|
|
132
|
+
downloadCount: number;
|
|
133
|
+
displayName?: string;
|
|
134
|
+
description?: string;
|
|
135
|
+
/**
|
|
136
|
+
* May be undefined when {@link VSXSearchOptions.includeAllVersions} is
|
|
137
|
+
* `false` or `undefined`.
|
|
138
|
+
*/
|
|
139
|
+
allVersions?: VSXAllVersions[];
|
|
140
|
+
}
|
|
141
|
+
export type VSXExtensionNamespaceAccess = 'public' | 'restricted';
|
|
142
|
+
/**
|
|
143
|
+
* Should be aligned with https://github.com/eclipse/openvsx/blob/master/server/src/main/java/org/eclipse/openvsx/json/UserJson.java
|
|
144
|
+
*/
|
|
145
|
+
export interface VSXUser {
|
|
146
|
+
loginName: string;
|
|
147
|
+
homepage?: string;
|
|
148
|
+
}
|
|
149
|
+
export interface VSXExtensionRawFiles {
|
|
150
|
+
download: string;
|
|
151
|
+
readme?: string;
|
|
152
|
+
license?: string;
|
|
153
|
+
icon?: string;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Should be aligned with https://github.com/eclipse/openvsx/blob/master/server/src/main/java/org/eclipse/openvsx/json/ExtensionJson.java
|
|
157
|
+
*/
|
|
158
|
+
export interface VSXExtensionRaw {
|
|
159
|
+
error?: string;
|
|
160
|
+
namespaceUrl: string;
|
|
161
|
+
reviewsUrl: string;
|
|
162
|
+
name: string;
|
|
163
|
+
namespace: string;
|
|
164
|
+
targetPlatform?: VSXTargetPlatform;
|
|
165
|
+
publishedBy: VSXUser;
|
|
166
|
+
preRelease: boolean;
|
|
167
|
+
namespaceAccess: VSXExtensionNamespaceAccess;
|
|
168
|
+
files: VSXExtensionRawFiles;
|
|
169
|
+
allVersions: {
|
|
170
|
+
[version: string]: string;
|
|
171
|
+
};
|
|
172
|
+
allVersionsUrl?: string;
|
|
173
|
+
averageRating?: number;
|
|
174
|
+
downloadCount: number;
|
|
175
|
+
reviewCount: number;
|
|
176
|
+
version: string;
|
|
177
|
+
timestamp: string;
|
|
178
|
+
preview?: boolean;
|
|
179
|
+
verified?: boolean;
|
|
180
|
+
displayName?: string;
|
|
181
|
+
namespaceDisplayName: string;
|
|
182
|
+
description?: string;
|
|
183
|
+
categories?: string[];
|
|
184
|
+
extensionKind?: string[];
|
|
185
|
+
tags?: string[];
|
|
186
|
+
license?: string;
|
|
187
|
+
homepage?: string;
|
|
188
|
+
repository?: string;
|
|
189
|
+
sponsorLink?: string;
|
|
190
|
+
bugs?: string;
|
|
191
|
+
markdown?: string;
|
|
192
|
+
galleryColor?: string;
|
|
193
|
+
galleryTheme?: string;
|
|
194
|
+
localizedLanguages?: string[];
|
|
195
|
+
qna?: string;
|
|
196
|
+
badges?: VSXBadge[];
|
|
197
|
+
dependencies?: VSXExtensionReference[];
|
|
198
|
+
bundledExtensions?: VSXExtensionReference[];
|
|
199
|
+
allTargetPlatformVersions?: VSXTargetPlatforms[];
|
|
200
|
+
url?: string;
|
|
201
|
+
engines?: {
|
|
202
|
+
[engine: string]: string;
|
|
203
|
+
};
|
|
204
|
+
}
|
|
205
|
+
export interface VSXBadge {
|
|
206
|
+
url?: string;
|
|
207
|
+
href?: string;
|
|
208
|
+
description?: string;
|
|
209
|
+
}
|
|
210
|
+
export interface VSXExtensionReference {
|
|
211
|
+
url: string;
|
|
212
|
+
namespace: string;
|
|
213
|
+
extension: string;
|
|
214
|
+
}
|
|
215
|
+
export interface VSXTargetPlatforms {
|
|
216
|
+
version: string;
|
|
217
|
+
targetPlatforms: VSXTargetPlatform[];
|
|
218
|
+
}
|
|
219
|
+
export interface VSXResponseError extends Error {
|
|
220
|
+
statusCode: number;
|
|
221
|
+
}
|
|
222
|
+
export declare namespace VSXResponseError {
|
|
223
|
+
function is(error: unknown): error is VSXResponseError;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Builtin namespaces maintained by the framework.
|
|
227
|
+
*/
|
|
228
|
+
export declare namespace VSXBuiltinNamespaces {
|
|
229
|
+
/**
|
|
230
|
+
* Namespace for individual vscode builtin extensions.
|
|
231
|
+
*/
|
|
232
|
+
const VSCODE = "vscode";
|
|
233
|
+
/**
|
|
234
|
+
* Namespace for vscode builtin extension packs.
|
|
235
|
+
* - corresponds to: https://github.com/eclipse-theia/vscode-builtin-extensions/blob/af9cfeb2ea23e1668a8340c1c2fb5afd56be07d7/src/create-extension-pack.js#L45
|
|
236
|
+
*/
|
|
237
|
+
const THEIA = "eclipse-theia";
|
|
238
|
+
/**
|
|
239
|
+
* Determines if the extension namespace is a builtin maintained by the framework.
|
|
240
|
+
* @param namespace the extension namespace to verify.
|
|
241
|
+
*/
|
|
242
|
+
function is(namespace: string): boolean;
|
|
243
|
+
}
|
|
244
|
+
export type OVSXClientProvider = (uri: string) => MaybePromise<OVSXClient>;
|
|
245
|
+
//# sourceMappingURL=ovsx-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ovsx-types.d.ts","sourceRoot":"","sources":["../src/ovsx-types.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AACD,yBAAiB,aAAa,CAAC;IAC3B,SAAgB,EAAE,CAAC,CAAC,SAAS,aAAa,EAAE,SAAS,EAAE,CAAC,GAAG,GAAG,MAAM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OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,iBAAiB,EAAE,CAAC;CACxC;AAED,MAAM,WAAW,gBAAiB,SAAQ,KAAK;IAC3C,UAAU,EAAE,MAAM,CAAC;CACtB;AAED,yBAAiB,gBAAgB,CAAC;IAC9B,SAAgB,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,gBAAgB,CAE5D;CACJ;AAED;;GAEG;AACH,yBAAiB,oBAAoB,CAAC;IAElC;;OAEG;IACI,MAAM,MAAM,WAAW,CAAC;IAE/B;;;OAGG;IACI,MAAM,KAAK,kBAAkB,CAAC;IAErC;;;OAGG;IACH,SAAgB,EAAE,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAG7C;CACJ;AAED,MAAM,MAAM,kBAAkB,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,YAAY,CAAC,UAAU,CAAC,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// *****************************************************************************
|
|
3
|
+
// Copyright (C) 2020 TypeFox and others.
|
|
4
|
+
//
|
|
5
|
+
// This program and the accompanying materials are made available under the
|
|
6
|
+
// terms of the Eclipse Public License v. 2.0 which is available at
|
|
7
|
+
// http://www.eclipse.org/legal/epl-2.0.
|
|
8
|
+
//
|
|
9
|
+
// This Source Code may also be made available under the following Secondary
|
|
10
|
+
// Licenses when the conditions for such availability set forth in the Eclipse
|
|
11
|
+
// Public License v. 2.0 are satisfied: GNU General Public License, version 2
|
|
12
|
+
// with the GNU Classpath Exception which is available at
|
|
13
|
+
// https://www.gnu.org/software/classpath/license.html.
|
|
14
|
+
//
|
|
15
|
+
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-only WITH Classpath-exception-2.0
|
|
16
|
+
// *****************************************************************************
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.VSXBuiltinNamespaces = exports.VSXResponseError = exports.ExtensionLike = void 0;
|
|
19
|
+
var ExtensionLike;
|
|
20
|
+
(function (ExtensionLike) {
|
|
21
|
+
function id(extension) {
|
|
22
|
+
return `${extension.namespace}.${extension.name}`;
|
|
23
|
+
}
|
|
24
|
+
ExtensionLike.id = id;
|
|
25
|
+
function idWithVersion(extension) {
|
|
26
|
+
if (!extension.version) {
|
|
27
|
+
throw new Error(`no valid "version" value provided for "${id(extension)}"`);
|
|
28
|
+
}
|
|
29
|
+
return `${id(extension)}@${extension.version}`;
|
|
30
|
+
}
|
|
31
|
+
ExtensionLike.idWithVersion = idWithVersion;
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-shadow
|
|
33
|
+
function fromId(id) {
|
|
34
|
+
const [left, version] = id.split('@', 2);
|
|
35
|
+
const [namespace, name] = left.split('.', 2);
|
|
36
|
+
return {
|
|
37
|
+
name,
|
|
38
|
+
namespace,
|
|
39
|
+
version
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
ExtensionLike.fromId = fromId;
|
|
43
|
+
})(ExtensionLike || (exports.ExtensionLike = ExtensionLike = {}));
|
|
44
|
+
var VSXResponseError;
|
|
45
|
+
(function (VSXResponseError) {
|
|
46
|
+
function is(error) {
|
|
47
|
+
return !!error && typeof error === 'object' && typeof error.statusCode === 'number';
|
|
48
|
+
}
|
|
49
|
+
VSXResponseError.is = is;
|
|
50
|
+
})(VSXResponseError || (exports.VSXResponseError = VSXResponseError = {}));
|
|
51
|
+
/**
|
|
52
|
+
* Builtin namespaces maintained by the framework.
|
|
53
|
+
*/
|
|
54
|
+
var VSXBuiltinNamespaces;
|
|
55
|
+
(function (VSXBuiltinNamespaces) {
|
|
56
|
+
/**
|
|
57
|
+
* Namespace for individual vscode builtin extensions.
|
|
58
|
+
*/
|
|
59
|
+
VSXBuiltinNamespaces.VSCODE = 'vscode';
|
|
60
|
+
/**
|
|
61
|
+
* Namespace for vscode builtin extension packs.
|
|
62
|
+
* - corresponds to: https://github.com/eclipse-theia/vscode-builtin-extensions/blob/af9cfeb2ea23e1668a8340c1c2fb5afd56be07d7/src/create-extension-pack.js#L45
|
|
63
|
+
*/
|
|
64
|
+
VSXBuiltinNamespaces.THEIA = 'eclipse-theia';
|
|
65
|
+
/**
|
|
66
|
+
* Determines if the extension namespace is a builtin maintained by the framework.
|
|
67
|
+
* @param namespace the extension namespace to verify.
|
|
68
|
+
*/
|
|
69
|
+
function is(namespace) {
|
|
70
|
+
return namespace === VSXBuiltinNamespaces.VSCODE
|
|
71
|
+
|| namespace === VSXBuiltinNamespaces.THEIA;
|
|
72
|
+
}
|
|
73
|
+
VSXBuiltinNamespaces.is = is;
|
|
74
|
+
})(VSXBuiltinNamespaces || (exports.VSXBuiltinNamespaces = VSXBuiltinNamespaces = {}));
|
|
75
|
+
//# sourceMappingURL=ovsx-types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ovsx-types.js","sourceRoot":"","sources":["../src/ovsx-types.ts"],"names":[],"mappings":";AAAA,gFAAgF;AAChF,yCAAyC;AACzC,EAAE;AACF,2EAA2E;AAC3E,mEAAmE;AACnE,wCAAwC;AACxC,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,6EAA6E;AAC7E,yDAAyD;AACzD,uDAAuD;AACvD,EAAE;AACF,gFAAgF;AAChF,gFAAgF;;;AAShF,IAAiB,aAAa,CAoB7B;AApBD,WAAiB,aAAa;IAC1B,SAAgB,EAAE,CAA0B,SAAY;QACpD,OAAO,GAAG,SAAS,CAAC,SAAS,IAAI,SAAS,CAAC,IAAI,EAAE,CAAC;IACtD,CAAC;IAFe,gBAAE,KAEjB,CAAA;IACD,SAAgB,aAAa,CAA0B,SAAY;QAC/D,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;YACrB,MAAM,IAAI,KAAK,CAAC,0CAA0C,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;QAChF,CAAC;QACD,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,SAAS,CAAC,OAAO,EAAE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