@theia/ovsx-client 1.48.1 → 1.48.2
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/README.md +61 -61
- package/lib/index.d.ts +6 -6
- package/lib/index.js +30 -30
- package/lib/ovsx-api-filter.d.ts +30 -30
- package/lib/ovsx-api-filter.js +73 -73
- package/lib/ovsx-http-client.d.ts +17 -17
- package/lib/ovsx-http-client.js +82 -82
- package/lib/ovsx-mock-client.d.ts +43 -43
- package/lib/ovsx-mock-client.js +168 -168
- package/lib/ovsx-router-client.d.ts +68 -68
- package/lib/ovsx-router-client.js +169 -169
- package/lib/ovsx-router-client.spec-data.d.ts +10 -10
- package/lib/ovsx-router-client.spec-data.js +66 -66
- package/lib/ovsx-router-client.spec.d.ts +1 -1
- package/lib/ovsx-router-client.spec.js +107 -107
- package/lib/ovsx-router-filters/abstract-reg-exp-filter.d.ts +5 -5
- package/lib/ovsx-router-filters/abstract-reg-exp-filter.js +27 -27
- package/lib/ovsx-router-filters/extension-id-matches-filter.d.ts +7 -7
- package/lib/ovsx-router-filters/extension-id-matches-filter.js +33 -33
- package/lib/ovsx-router-filters/index.d.ts +2 -2
- package/lib/ovsx-router-filters/index.js +22 -22
- package/lib/ovsx-router-filters/request-contains-filter.d.ts +8 -8
- package/lib/ovsx-router-filters/request-contains-filter.js +35 -35
- package/lib/ovsx-types.d.ts +212 -212
- package/lib/ovsx-types.js +74 -74
- package/lib/types.d.ts +1 -1
- package/lib/types.js +17 -17
- package/package.json +3 -3
- package/src/index.ts +22 -22
- package/src/ovsx-api-filter.ts +91 -91
- package/src/ovsx-http-client.ts +85 -85
- package/src/ovsx-mock-client.ts +182 -182
- package/src/ovsx-router-client.spec-data.ts +68 -68
- package/src/ovsx-router-client.spec.ts +126 -126
- package/src/ovsx-router-client.ts +248 -248
- package/src/ovsx-router-filters/abstract-reg-exp-filter.ts +26 -26
- package/src/ovsx-router-filters/extension-id-matches-filter.ts +32 -32
- package/src/ovsx-router-filters/index.ts +18 -18
- package/src/ovsx-router-filters/request-contains-filter.ts +35 -35
- package/src/ovsx-types.ts +268 -268
- package/src/types.ts +17 -17
|
@@ -1,108 +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("./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
|
-
});
|
|
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("./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
108
|
//# sourceMappingURL=ovsx-router-client.spec.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare abstract class AbstractRegExpFilter {
|
|
2
|
-
protected regExp: RegExp;
|
|
3
|
-
constructor(regExp: RegExp);
|
|
4
|
-
protected test(value: unknown): boolean;
|
|
5
|
-
}
|
|
1
|
+
export declare abstract class AbstractRegExpFilter {
|
|
2
|
+
protected regExp: RegExp;
|
|
3
|
+
constructor(regExp: RegExp);
|
|
4
|
+
protected test(value: unknown): boolean;
|
|
5
|
+
}
|
|
6
6
|
//# sourceMappingURL=abstract-reg-exp-filter.d.ts.map
|
|
@@ -1,28 +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;
|
|
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
28
|
//# sourceMappingURL=abstract-reg-exp-filter.js.map
|
|
@@ -1,8 +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
|
-
}
|
|
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
8
|
//# sourceMappingURL=extension-id-matches-filter.d.ts.map
|
|
@@ -1,34 +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;
|
|
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
34
|
//# sourceMappingURL=extension-id-matches-filter.js.map
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { ExtensionIdMatchesFilterFactory } from './extension-id-matches-filter';
|
|
2
|
-
export { RequestContainsFilterFactory } from './request-contains-filter';
|
|
1
|
+
export { ExtensionIdMatchesFilterFactory } from './extension-id-matches-filter';
|
|
2
|
+
export { RequestContainsFilterFactory } from './request-contains-filter';
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,23 +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; } });
|
|
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
23
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,9 +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
|
-
}
|
|
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
9
|
//# sourceMappingURL=request-contains-filter.d.ts.map
|
|
@@ -1,36 +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;
|
|
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
36
|
//# sourceMappingURL=request-contains-filter.js.map
|