oc 0.49.6 → 0.49.7
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 +4 -0
- package/dist/components/oc-client/_package/package.json +1 -1
- package/dist/components/oc-client/package.json +1 -1
- package/dist/registry/domain/authentication.d.ts +2 -3
- package/dist/registry/domain/authentication.js +4 -1
- package/dist/registry/views/info.js +5 -2
- package/dist/registry/views/static/info.d.ts +1 -1
- package/dist/registry/views/static/info.js +12 -1
- package/dist/types.d.ts +15 -5
- package/logintervals.md +1 -1
- package/package.json +1 -1
- package/src/components/oc-client/_package/package.json +1 -1
- package/src/components/oc-client/package.json +1 -1
- package/src/registry/domain/authentication.ts +5 -13
- package/src/registry/views/info.ts +5 -2
- package/src/registry/views/static/info.ts +12 -1
- package/src/types.ts +17 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
## Change Log
|
|
2
2
|
|
|
3
|
+
### v0.49.7
|
|
4
|
+
- [#1283](https://github.com/opencomponents/oc/pull/1283) add "open" link to component preview page
|
|
5
|
+
- [#1279](https://github.com/opencomponents/oc/pull/1279) improve auth flexibility allowing to pass any library on type field
|
|
6
|
+
|
|
3
7
|
### v0.49.6
|
|
4
8
|
- [#1282](https://github.com/opencomponents/oc/pull/1282) Minor logging improvements
|
|
5
9
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"oc-client","description":"The OpenComponents client-side javascript client","version":"0.49.
|
|
1
|
+
{"name":"oc-client","description":"The OpenComponents client-side javascript client","version":"0.49.7","repository":"https://github.com/opencomponents/oc/tree/master/components/oc-client","author":"Matteo Figus <matteofigus@gmail.com>","oc":{"container":false,"renderInfo":false,"minify":false,"parameters":{},"files":{"template":{"type":"oc-template-es6","hashKey":"4bdbbf7249b210dee9a729e8a611eac3dc5eae82","src":"template.js","version":"1.0.7"},"static":["src"],"dataProvider":{"type":"node.js","hashKey":"96eb8b28d43ce2093e13753e54d3f2f938dd0f7d","src":"server.js"}},"version":"0.49.7","packaged":true,"date":1639558995829},"devDependencies":{"oc-template-es6-compiler":"^1.0.1"}}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oc-client",
|
|
3
3
|
"description": "The OpenComponents client-side javascript client",
|
|
4
|
-
"version": "0.49.
|
|
4
|
+
"version": "0.49.7",
|
|
5
5
|
"repository": "https://github.com/opencomponents/oc/tree/master/components/oc-client",
|
|
6
6
|
"author": "Matteo Figus <matteofigus@gmail.com>",
|
|
7
7
|
"oc": {
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { RequestHandler } from 'express';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}): {
|
|
2
|
+
import { PublishAuthConfig } from '../../types';
|
|
3
|
+
export declare function validate(authConfig: PublishAuthConfig): {
|
|
5
4
|
isValid: boolean;
|
|
6
5
|
message: string;
|
|
7
6
|
};
|
|
@@ -26,7 +26,10 @@ const builtin = {
|
|
|
26
26
|
};
|
|
27
27
|
let scheme;
|
|
28
28
|
function validate(authConfig) {
|
|
29
|
-
if (
|
|
29
|
+
if (typeof authConfig.type !== 'string') {
|
|
30
|
+
scheme = authConfig.type;
|
|
31
|
+
}
|
|
32
|
+
else if (builtin[authConfig.type]) {
|
|
30
33
|
scheme = builtin[authConfig.type];
|
|
31
34
|
}
|
|
32
35
|
else {
|
|
@@ -55,8 +55,11 @@ function info(vm) {
|
|
|
55
55
|
<div class="field"><p>Accept-Language header:</p></div>
|
|
56
56
|
<input class="w-100" id="lang" type="text" value="*" />
|
|
57
57
|
<h3>
|
|
58
|
-
Preview
|
|
59
|
-
<a class="refresh-preview" href="#refresh">
|
|
58
|
+
Preview (
|
|
59
|
+
<a class="refresh-preview" href="#refresh">Refresh</a>
|
|
60
|
+
|
|
|
61
|
+
<a class="open-preview" href="#open">Open</a>
|
|
62
|
+
)
|
|
60
63
|
</h3>
|
|
61
64
|
<iframe class="preview" src="~preview/${sandBoxDefaultQs}"></iframe>`;
|
|
62
65
|
const scripts = `<script>var thisComponentHref="${href}${component.name}/";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "\nvar oc = oc || {};\noc.cmd = oc.cmd || [];\n\noc.cmd.push(function() {\n $('#versions').change(function() {\n window.location = thisComponentHref + $(this).val() + '/~info';\n });\n\n
|
|
1
|
+
declare const _default: "\nvar oc = oc || {};\noc.cmd = oc.cmd || [];\n\noc.cmd.push(function() {\n $('#versions').change(function() {\n window.location = thisComponentHref + $(this).val() + '/~info';\n });\n\n var refreshPreview = function() {\n var splitted = $('#href')\n .val()\n .split('?'),\n url = splitted[0],\n lang = $('#lang').val();\n\n if (url.slice(-1) !== '/') {\n url += '/';\n }\n\n url = url.replace('http://', '//').replace('https://', '//');\n url += '~preview/?__ocAcceptLanguage=' + lang + '&';\n\n if (splitted.length > 1) {\n url += splitted[1];\n }\n\n $('.preview').attr('src', url);\n\n return false;\n };\n $('.refresh-preview').click(refreshPreview);\n\n $('.open-preview').click(function() {\n refreshPreview();\n var url = $('.preview').attr('src');\n\n window.open(url, '_blank');\n return false;\n });\n\n\n});";
|
|
2
2
|
export default _default;
|
|
@@ -9,7 +9,7 @@ oc.cmd.push(function() {
|
|
|
9
9
|
window.location = thisComponentHref + $(this).val() + '/~info';
|
|
10
10
|
});
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
var refreshPreview = function() {
|
|
13
13
|
var splitted = $('#href')
|
|
14
14
|
.val()
|
|
15
15
|
.split('?'),
|
|
@@ -29,6 +29,17 @@ oc.cmd.push(function() {
|
|
|
29
29
|
|
|
30
30
|
$('.preview').attr('src', url);
|
|
31
31
|
|
|
32
|
+
return false;
|
|
33
|
+
};
|
|
34
|
+
$('.refresh-preview').click(refreshPreview);
|
|
35
|
+
|
|
36
|
+
$('.open-preview').click(function() {
|
|
37
|
+
refreshPreview();
|
|
38
|
+
var url = $('.preview').attr('src');
|
|
39
|
+
|
|
40
|
+
window.open(url, '_blank');
|
|
32
41
|
return false;
|
|
33
42
|
});
|
|
43
|
+
|
|
44
|
+
|
|
34
45
|
});`;
|
package/dist/types.d.ts
CHANGED
|
@@ -104,6 +104,20 @@ export interface VM {
|
|
|
104
104
|
title: string;
|
|
105
105
|
type: 'oc-registry' | 'oc-registry-local';
|
|
106
106
|
}
|
|
107
|
+
export declare type Authentication<T = any> = {
|
|
108
|
+
validate: (config: T) => {
|
|
109
|
+
isValid: boolean;
|
|
110
|
+
message: string;
|
|
111
|
+
};
|
|
112
|
+
middleware: (config: T) => any;
|
|
113
|
+
};
|
|
114
|
+
export declare type PublishAuthConfig = {
|
|
115
|
+
type: 'basic';
|
|
116
|
+
username: string;
|
|
117
|
+
password: string;
|
|
118
|
+
} | ({
|
|
119
|
+
type: string | Authentication;
|
|
120
|
+
} & Record<string, any>);
|
|
107
121
|
export interface Config {
|
|
108
122
|
baseUrl: string;
|
|
109
123
|
baseUrlFunc?: (opts: {
|
|
@@ -132,11 +146,7 @@ export interface Config {
|
|
|
132
146
|
port: number | string;
|
|
133
147
|
postRequestPayloadSize?: number;
|
|
134
148
|
prefix: string;
|
|
135
|
-
publishAuth?:
|
|
136
|
-
type: string;
|
|
137
|
-
username: string;
|
|
138
|
-
password: string;
|
|
139
|
-
};
|
|
149
|
+
publishAuth?: PublishAuthConfig;
|
|
140
150
|
publishValidation: (data: unknown) => {
|
|
141
151
|
isValid: boolean;
|
|
142
152
|
error?: string;
|
package/logintervals.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"to":"v0.49.6","from":"v0.49.5"},{"to":"v0.49.5","from":"v0.49.4"},{"to":"v0.49.4","from":"v0.49.3"},{"to":"v0.49.3","from":"v0.49.2"},{"to":"v0.49.2","from":"v0.49.1"},{"to":"v0.49.1","from":"v0.49.0"},{"to":"v0.49.0","from":"v0.48.23"},{"to":"v0.48.23","from":"v0.48.22"},{"to":"v0.48.22","from":"v0.48.21"},{"to":"v0.48.21","from":"v0.48.19"},{"to":"v0.48.19","from":"v0.48.18"},{"to":"v0.48.18","from":"v0.48.17"},{"to":"v0.48.17","from":"v0.48.16"},{"to":"v0.48.16","from":"v0.48.15"},{"to":"v0.48.15","from":"v0.48.14"},{"to":"v0.48.14","from":"v0.48.13"},{"to":"v0.48.13","from":"v0.48.12"},{"to":"v0.48.12","from":"v0.48.11"},{"to":"v0.48.11","from":"v0.48.10"},{"to":"v0.48.10","from":"v0.48.9"},{"to":"v0.48.9","from":"v0.48.7"},{"to":"v0.48.7","from":"v0.48.6"},{"to":"v0.48.6","from":"v0.48.5"},{"to":"v0.48.5","from":"v0.48.4"},{"to":"v0.48.4","from":"v0.48.3"},{"to":"v0.48.3","from":"v0.48.2"},{"to":"v0.48.2","from":"v0.48.1"},{"to":"v0.48.1","from":"v0.48.0"},{"to":"v0.48.0","from":"v0.47.1"},{"to":"v0.47.1","from":"v0.47.0"},{"to":"v0.47.0","from":"v0.46.0"},{"to":"v0.46.0","from":"v0.45.4"},{"to":"v0.45.4","from":"v0.45.3"},{"to":"v0.45.3","from":"v0.45.2"},{"to":"v0.45.2","from":"v0.45.1"},{"to":"v0.45.1","from":"v0.45.0"},{"to":"v0.45.0","from":"v0.44.13"},{"to":"v0.44.13","from":"v0.44.12"},{"to":"v0.44.12","from":"v0.44.11"},{"to":"v0.44.11","from":"v0.44.10"},{"to":"v0.44.10","from":"v0.44.9"},{"to":"v0.44.9","from":"v0.44.8"},{"to":"v0.44.8","from":"v0.44.7"},{"to":"v0.44.7","from":"v0.44.6"},{"to":"v0.44.6","from":"v0.44.5"},{"to":"v0.44.5","from":"v0.44.4"},{"to":"v0.44.4","from":"v0.44.3"},{"to":"v0.44.3","from":"v0.44.2"},{"to":"v0.44.2","from":"v0.44.1"},{"to":"v0.44.1","from":"v0.44.0"},{"to":"v0.44.0","from":"v0.43.2"},{"to":"v0.43.2","from":"v0.43.1"},{"to":"v0.43.1","from":"v0.43.0"},{"to":"v0.43.0","from":"v0.42.26"},{"to":"v0.42.26","from":"v0.42.25"},{"to":"v0.42.25","from":"v0.42.24"},{"to":"v0.42.24","from":"v0.42.23"},{"to":"v0.42.23","from":"v0.42.22"},{"to":"v0.42.22","from":"v0.42.21"},{"to":"v0.42.21","from":"v0.42.20"},{"to":"v0.42.20","from":"v0.42.19"},{"to":"v0.42.19","from":"v0.42.18"},{"to":"v0.42.18","from":"v0.42.17"},{"to":"v0.42.17","from":"v0.42.16"},{"to":"v0.42.16","from":"v0.42.15"},{"to":"v0.42.15","from":"v0.42.14"},{"to":"v0.42.14","from":"v0.42.13"},{"to":"v0.42.13","from":"v0.42.12"},{"to":"v0.42.12","from":"v0.42.10"},{"to":"v0.42.10","from":"v0.42.9"},{"to":"v0.42.9","from":"v0.42.8"},{"to":"v0.42.8","from":"v0.42.7"},{"to":"v0.42.7","from":"v0.42.6"},{"to":"v0.42.6","from":"v0.42.5"},{"to":"v0.42.5","from":"v0.42.4"},{"to":"v0.42.4","from":"v0.42.3"},{"to":"v0.42.3","from":"v0.42.2"},{"to":"v0.42.2","from":"v0.42.1"},{"to":"v0.42.1","from":"v0.42.0"},{"to":"v0.42.0","from":"v0.41.16"},{"to":"v0.41.16","from":"v0.41.15"},{"to":"v0.41.15","from":"v0.41.14"},{"to":"v0.41.14","from":"v0.41.13"},{"to":"v0.41.13","from":"v0.41.12"},{"to":"v0.41.12","from":"v0.41.11"},{"to":"v0.41.11","from":"v0.41.10"},{"to":"v0.41.10","from":"v0.41.9"},{"to":"v0.41.9","from":"v0.41.8"},{"to":"v0.41.8","from":"v0.41.7"},{"to":"v0.41.7","from":"v0.41.6"},{"to":"v0.41.6","from":"v0.41.5"},{"to":"v0.41.5","from":"v0.41.4"},{"to":"v0.41.4","from":"v0.41.3"},{"to":"v0.41.3","from":"v0.41.2"},{"to":"v0.41.2","from":"v0.41.1"},{"to":"v0.41.1","from":"v0.41.0"},{"to":"v0.41.0","from":"v0.40.10"},{"to":"v0.40.10","from":"v0.40.9"},{"to":"v0.40.9","from":"v0.40.8"},{"to":"v0.40.8","from":"v0.40.7"},{"to":"v0.40.7","from":"v0.40.6"},{"to":"v0.40.6","from":"v0.40.5"},{"to":"v0.40.5","from":"v0.40.4"},{"to":"v0.40.4","from":"v0.40.3"},{"to":"v0.40.3","from":"v0.40.2"},{"to":"v0.40.2","from":"v0.40.1"},{"to":"v0.40.1","from":"v0.40.0"},{"to":"v0.40.0","from":"v0.39.8"},{"to":"v0.39.8","from":"v0.39.7"},{"to":"v0.39.7","from":"v0.39.6"},{"to":"v0.39.6","from":"v0.39.5"},{"to":"v0.39.5","from":"v0.39.4"},{"to":"v0.39.4","from":"v0.39.3"},{"to":"v0.39.3","from":"v0.39.2"},{"to":"v0.39.2","from":"v0.39.1"},{"to":"v0.39.1","from":"v0.39.0"},{"to":"v0.39.0","from":"v0.38.8"},{"to":"v0.38.8","from":"v0.38.7"},{"to":"v0.38.7","from":"v0.38.6"},{"to":"v0.38.6","from":"v0.38.5"},{"to":"v0.38.5","from":"v0.38.4"},{"to":"v0.38.4","from":"v0.38.3"},{"to":"v0.38.3","from":"v0.38.2"},{"to":"v0.38.2","from":"v0.38.1"},{"to":"v0.38.1","from":"v0.38.0"},{"to":"v0.38.0","from":"v0.37.11"},{"to":"v0.37.11","from":"v0.37.10"},{"to":"v0.37.10","from":"v0.37.9"},{"to":"v0.37.9","from":"v0.37.8"},{"to":"v0.37.8","from":"v0.37.7"},{"to":"v0.37.7","from":"v0.37.6"},{"to":"v0.37.6","from":"v0.37.5"},{"to":"v0.37.5","from":"v0.37.4"},{"to":"v0.37.4","from":"v0.37.3"},{"to":"v0.37.3","from":"v0.37.2"},{"to":"v0.37.2","from":"v0.37.1"},{"to":"v0.37.1","from":"v0.37.0"},{"to":"v0.37.0","from":"v0.36.28"},{"to":"v0.36.28","from":"v0.36.27"},{"to":"v0.36.27","from":"v0.36.26"},{"to":"v0.36.26","from":"v0.36.25"},{"to":"v0.36.25","from":"v0.36.24"},{"to":"v0.36.24","from":"v0.36.23"},{"to":"v0.36.23","from":"v0.36.22"},{"to":"v0.36.22","from":"v0.36.21"},{"to":"v0.36.21","from":"v0.36.20"},{"to":"v0.36.20","from":"v0.36.19"},{"to":"v0.36.19","from":"v0.36.18"},{"to":"v0.36.18","from":"v0.36.17"},{"to":"v0.36.17","from":"v0.36.16"},{"to":"v0.36.16","from":"v0.36.15"},{"to":"v0.36.15","from":"v0.36.14"},{"to":"v0.36.14","from":"v0.36.13"},{"to":"v0.36.13","from":"v0.36.12"},{"to":"v0.36.12","from":"v0.36.11"},{"to":"v0.36.11","from":"v0.36.10"},{"to":"v0.36.10","from":"v0.36.9"},{"to":"v0.36.9","from":"v0.36.8"},{"to":"v0.36.8","from":"v0.36.7"},{"to":"v0.36.7","from":"v0.36.6"},{"to":"v0.36.6","from":"v0.36.5"},{"to":"v0.36.5","from":"v0.36.4"},{"to":"v0.36.4","from":"v0.36.3"},{"to":"v0.36.3","from":"v0.36.2"},{"to":"v0.36.2","from":"v0.36.1"},{"to":"v0.36.1","from":"v0.36.0"},{"to":"v0.36.0","from":"v0.35.6"},{"to":"v0.35.6","from":"v0.35.5"},{"to":"v0.35.5","from":"v0.35.4"},{"to":"v0.35.4","from":"v0.35.3"},{"to":"v0.35.3","from":"v0.35.2"},{"to":"v0.35.2","from":"v0.35.1"},{"to":"v0.35.1","from":"v0.35.0"},{"to":"v0.35.0","from":"v0.34.8"},{"to":"v0.34.8","from":"v0.34.7"},{"to":"v0.34.7","from":"v0.34.6"},{"to":"v0.34.6","from":"v0.34.5"},{"to":"v0.34.5","from":"v0.34.4"},{"to":"v0.34.4","from":"v0.34.3"},{"to":"v0.34.3","from":"v0.34.2"},{"to":"v0.34.2","from":"v0.34.1"},{"to":"v0.34.1","from":"v0.34.0"},{"to":"v0.34.0","from":"v0.33.31"},{"to":"v0.33.31","from":"v0.33.30"},{"to":"v0.33.30","from":"v0.33.29"},{"to":"v0.33.29","from":"v0.33.28"},{"to":"v0.33.28","from":"v0.33.27"},{"to":"v0.33.27","from":"v0.33.26"},{"to":"v0.33.26","from":"v0.33.25"},{"to":"v0.33.25","from":"v0.33.24"},{"to":"v0.33.24","from":"v0.33.23"},{"to":"v0.33.23","from":"v0.33.22"},{"to":"v0.33.22","from":"v0.33.21"},{"to":"v0.33.21","from":"v0.33.20"},{"to":"v0.33.20","from":"v0.33.19"},{"to":"v0.33.19","from":"v0.33.18"},{"to":"v0.33.18","from":"v0.33.17"},{"to":"v0.33.17","from":"v0.33.16"},{"to":"v0.33.16","from":"v0.33.15"},{"to":"v0.33.15","from":"v0.33.14"},{"to":"v0.33.14","from":"v0.33.13"},{"to":"v0.33.13","from":"v0.33.12"},{"to":"v0.33.12","from":"v0.33.11"},{"to":"v0.33.11","from":"v0.33.10"},{"to":"v0.33.10","from":"v0.33.9"},{"to":"v0.33.9","from":"v0.33.8"},{"to":"v0.33.8","from":"v0.33.7"},{"to":"v0.33.7","from":"v0.33.6"},{"to":"v0.33.6","from":"v0.33.5"},{"to":"v0.33.5","from":"v0.33.4"},{"to":"v0.33.4","from":"v0.33.3"},{"to":"v0.33.3","from":"v0.33.2"},{"to":"v0.33.2","from":"v0.33.1"},{"to":"v0.33.1","from":"v0.33.0"},{"to":"v0.33.0","from":"v0.32.6"},{"to":"v0.32.6","from":"v0.32.5"},{"to":"v0.32.5","from":"v0.32.4"},{"to":"v0.32.4","from":"v0.32.3"},{"to":"v0.32.3","from":"v0.32.2"},{"to":"v0.32.2","from":"v0.32.1"},{"to":"v0.32.1","from":"v0.32.0"},{"to":"v0.32.0","from":"v0.31.2"},{"to":"v0.31.2","from":"v0.31.1"},{"to":"v0.31.1","from":"v0.31.0"},{"to":"v0.31.0","from":"v0.30.9"},{"to":"v0.30.9","from":"v0.30.8"},{"to":"v0.30.8","from":"v0.30.7"},{"to":"v0.30.7","from":"v0.30.6"},{"to":"v0.30.6","from":"v0.30.5"},{"to":"v0.30.5","from":"v0.30.4"},{"to":"v0.30.4","from":"v0.30.3"},{"to":"v0.30.3","from":"v0.30.2"},{"to":"v0.30.2","from":"v0.30.1"},{"to":"v0.30.1","from":"v0.30.0"},{"to":"v0.30.0","from":"v0.29.4"},{"to":"v0.29.4","from":"v0.29.3"},{"to":"v0.29.3","from":"v0.29.2"},{"to":"v0.29.2","from":"v0.29.1"},{"to":"v0.29.1","from":"v0.29.0"},{"to":"v0.29.0","from":"v0.28.9"},{"to":"v0.28.9","from":"v0.28.8"},{"to":"v0.28.8","from":"v0.28.7"},{"to":"v0.28.7","from":"v0.28.6"},{"to":"v0.28.6","from":"v0.28.5"},{"to":"v0.28.5","from":"v0.28.4"},{"to":"v0.28.4","from":"v0.28.3"},{"to":"v0.28.3","from":"v0.28.2"},{"to":"v0.28.2","from":"v0.28.1"},{"to":"v0.28.1","from":"v0.28.0"},{"to":"v0.28.0","from":"v0.27.9"},{"to":"v0.27.9","from":"v0.27.8"},{"to":"v0.27.8","from":"v0.27.7"},{"to":"v0.27.7","from":"v0.27.6"},{"to":"v0.27.6","from":"v0.27.5"},{"to":"v0.27.5","from":"v0.27.4"},{"to":"v0.27.4","from":"v0.27.3"},{"to":"v0.27.3","from":"v0.27.2"},{"to":"v0.27.2","from":"v0.27.1"},{"to":"v0.27.1","from":"v0.27.0"},{"to":"v0.27.0","from":"v0.26.2"},{"to":"v0.26.2","from":"v0.26.1"},{"to":"v0.26.1","from":"v0.26.0"},{"to":"v0.26.0","from":"v0.25.0"},{"to":"v0.25.0","from":"v0.24.1"},{"to":"v0.24.1","from":"v0.24.0"},{"to":"v0.24.0","from":"v0.23.7"},{"to":"v0.23.7","from":"v0.23.6"},{"to":"v0.23.6","from":"v0.23.5"},{"to":"v0.23.5","from":"v0.23.4"},{"to":"v0.23.4","from":"v0.23.3"},{"to":"v0.23.3","from":"v0.23.2"},{"to":"v0.23.2","from":"v0.23.1"},{"to":"v0.23.1","from":"v0.23.0"},{"to":"v0.23.0","from":"v0.22.3"},{"to":"v0.22.3","from":"v0.22.2"},{"to":"v0.22.2","from":"v0.22.1"},{"to":"v0.22.1","from":"v0.22.0"},{"to":"v0.22.0","from":"v0.21.0"},{"to":"v0.21.0","from":"v0.20.5"},{"to":"v0.20.5","from":"v0.20.4"},{"to":"v0.20.4","from":"v0.20.3"},{"to":"v0.20.3","from":"v0.20.2"},{"to":"v0.20.2","from":"v0.20.1"},{"to":"v0.20.1","from":"v0.20.0"},{"to":"v0.20.0","from":"v0.19.5"},{"to":"v0.19.5","from":"v0.19.4"},{"to":"v0.19.4","from":"v0.19.3"},{"to":"v0.19.3","from":"v0.19.2"},{"to":"v0.19.2","from":"v0.19.1"},{"to":"v0.19.1","from":"v0.19.0"},{"to":"v0.19.0","from":"6181a540729a7179d7a9d41489dfc241335cf1b5"}]
|
|
1
|
+
[{"to":"v0.49.7","from":"v0.49.6"},{"to":"v0.49.6","from":"v0.49.5"},{"to":"v0.49.5","from":"v0.49.4"},{"to":"v0.49.4","from":"v0.49.3"},{"to":"v0.49.3","from":"v0.49.2"},{"to":"v0.49.2","from":"v0.49.1"},{"to":"v0.49.1","from":"v0.49.0"},{"to":"v0.49.0","from":"v0.48.23"},{"to":"v0.48.23","from":"v0.48.22"},{"to":"v0.48.22","from":"v0.48.21"},{"to":"v0.48.21","from":"v0.48.19"},{"to":"v0.48.19","from":"v0.48.18"},{"to":"v0.48.18","from":"v0.48.17"},{"to":"v0.48.17","from":"v0.48.16"},{"to":"v0.48.16","from":"v0.48.15"},{"to":"v0.48.15","from":"v0.48.14"},{"to":"v0.48.14","from":"v0.48.13"},{"to":"v0.48.13","from":"v0.48.12"},{"to":"v0.48.12","from":"v0.48.11"},{"to":"v0.48.11","from":"v0.48.10"},{"to":"v0.48.10","from":"v0.48.9"},{"to":"v0.48.9","from":"v0.48.7"},{"to":"v0.48.7","from":"v0.48.6"},{"to":"v0.48.6","from":"v0.48.5"},{"to":"v0.48.5","from":"v0.48.4"},{"to":"v0.48.4","from":"v0.48.3"},{"to":"v0.48.3","from":"v0.48.2"},{"to":"v0.48.2","from":"v0.48.1"},{"to":"v0.48.1","from":"v0.48.0"},{"to":"v0.48.0","from":"v0.47.1"},{"to":"v0.47.1","from":"v0.47.0"},{"to":"v0.47.0","from":"v0.46.0"},{"to":"v0.46.0","from":"v0.45.4"},{"to":"v0.45.4","from":"v0.45.3"},{"to":"v0.45.3","from":"v0.45.2"},{"to":"v0.45.2","from":"v0.45.1"},{"to":"v0.45.1","from":"v0.45.0"},{"to":"v0.45.0","from":"v0.44.13"},{"to":"v0.44.13","from":"v0.44.12"},{"to":"v0.44.12","from":"v0.44.11"},{"to":"v0.44.11","from":"v0.44.10"},{"to":"v0.44.10","from":"v0.44.9"},{"to":"v0.44.9","from":"v0.44.8"},{"to":"v0.44.8","from":"v0.44.7"},{"to":"v0.44.7","from":"v0.44.6"},{"to":"v0.44.6","from":"v0.44.5"},{"to":"v0.44.5","from":"v0.44.4"},{"to":"v0.44.4","from":"v0.44.3"},{"to":"v0.44.3","from":"v0.44.2"},{"to":"v0.44.2","from":"v0.44.1"},{"to":"v0.44.1","from":"v0.44.0"},{"to":"v0.44.0","from":"v0.43.2"},{"to":"v0.43.2","from":"v0.43.1"},{"to":"v0.43.1","from":"v0.43.0"},{"to":"v0.43.0","from":"v0.42.26"},{"to":"v0.42.26","from":"v0.42.25"},{"to":"v0.42.25","from":"v0.42.24"},{"to":"v0.42.24","from":"v0.42.23"},{"to":"v0.42.23","from":"v0.42.22"},{"to":"v0.42.22","from":"v0.42.21"},{"to":"v0.42.21","from":"v0.42.20"},{"to":"v0.42.20","from":"v0.42.19"},{"to":"v0.42.19","from":"v0.42.18"},{"to":"v0.42.18","from":"v0.42.17"},{"to":"v0.42.17","from":"v0.42.16"},{"to":"v0.42.16","from":"v0.42.15"},{"to":"v0.42.15","from":"v0.42.14"},{"to":"v0.42.14","from":"v0.42.13"},{"to":"v0.42.13","from":"v0.42.12"},{"to":"v0.42.12","from":"v0.42.10"},{"to":"v0.42.10","from":"v0.42.9"},{"to":"v0.42.9","from":"v0.42.8"},{"to":"v0.42.8","from":"v0.42.7"},{"to":"v0.42.7","from":"v0.42.6"},{"to":"v0.42.6","from":"v0.42.5"},{"to":"v0.42.5","from":"v0.42.4"},{"to":"v0.42.4","from":"v0.42.3"},{"to":"v0.42.3","from":"v0.42.2"},{"to":"v0.42.2","from":"v0.42.1"},{"to":"v0.42.1","from":"v0.42.0"},{"to":"v0.42.0","from":"v0.41.16"},{"to":"v0.41.16","from":"v0.41.15"},{"to":"v0.41.15","from":"v0.41.14"},{"to":"v0.41.14","from":"v0.41.13"},{"to":"v0.41.13","from":"v0.41.12"},{"to":"v0.41.12","from":"v0.41.11"},{"to":"v0.41.11","from":"v0.41.10"},{"to":"v0.41.10","from":"v0.41.9"},{"to":"v0.41.9","from":"v0.41.8"},{"to":"v0.41.8","from":"v0.41.7"},{"to":"v0.41.7","from":"v0.41.6"},{"to":"v0.41.6","from":"v0.41.5"},{"to":"v0.41.5","from":"v0.41.4"},{"to":"v0.41.4","from":"v0.41.3"},{"to":"v0.41.3","from":"v0.41.2"},{"to":"v0.41.2","from":"v0.41.1"},{"to":"v0.41.1","from":"v0.41.0"},{"to":"v0.41.0","from":"v0.40.10"},{"to":"v0.40.10","from":"v0.40.9"},{"to":"v0.40.9","from":"v0.40.8"},{"to":"v0.40.8","from":"v0.40.7"},{"to":"v0.40.7","from":"v0.40.6"},{"to":"v0.40.6","from":"v0.40.5"},{"to":"v0.40.5","from":"v0.40.4"},{"to":"v0.40.4","from":"v0.40.3"},{"to":"v0.40.3","from":"v0.40.2"},{"to":"v0.40.2","from":"v0.40.1"},{"to":"v0.40.1","from":"v0.40.0"},{"to":"v0.40.0","from":"v0.39.8"},{"to":"v0.39.8","from":"v0.39.7"},{"to":"v0.39.7","from":"v0.39.6"},{"to":"v0.39.6","from":"v0.39.5"},{"to":"v0.39.5","from":"v0.39.4"},{"to":"v0.39.4","from":"v0.39.3"},{"to":"v0.39.3","from":"v0.39.2"},{"to":"v0.39.2","from":"v0.39.1"},{"to":"v0.39.1","from":"v0.39.0"},{"to":"v0.39.0","from":"v0.38.8"},{"to":"v0.38.8","from":"v0.38.7"},{"to":"v0.38.7","from":"v0.38.6"},{"to":"v0.38.6","from":"v0.38.5"},{"to":"v0.38.5","from":"v0.38.4"},{"to":"v0.38.4","from":"v0.38.3"},{"to":"v0.38.3","from":"v0.38.2"},{"to":"v0.38.2","from":"v0.38.1"},{"to":"v0.38.1","from":"v0.38.0"},{"to":"v0.38.0","from":"v0.37.11"},{"to":"v0.37.11","from":"v0.37.10"},{"to":"v0.37.10","from":"v0.37.9"},{"to":"v0.37.9","from":"v0.37.8"},{"to":"v0.37.8","from":"v0.37.7"},{"to":"v0.37.7","from":"v0.37.6"},{"to":"v0.37.6","from":"v0.37.5"},{"to":"v0.37.5","from":"v0.37.4"},{"to":"v0.37.4","from":"v0.37.3"},{"to":"v0.37.3","from":"v0.37.2"},{"to":"v0.37.2","from":"v0.37.1"},{"to":"v0.37.1","from":"v0.37.0"},{"to":"v0.37.0","from":"v0.36.28"},{"to":"v0.36.28","from":"v0.36.27"},{"to":"v0.36.27","from":"v0.36.26"},{"to":"v0.36.26","from":"v0.36.25"},{"to":"v0.36.25","from":"v0.36.24"},{"to":"v0.36.24","from":"v0.36.23"},{"to":"v0.36.23","from":"v0.36.22"},{"to":"v0.36.22","from":"v0.36.21"},{"to":"v0.36.21","from":"v0.36.20"},{"to":"v0.36.20","from":"v0.36.19"},{"to":"v0.36.19","from":"v0.36.18"},{"to":"v0.36.18","from":"v0.36.17"},{"to":"v0.36.17","from":"v0.36.16"},{"to":"v0.36.16","from":"v0.36.15"},{"to":"v0.36.15","from":"v0.36.14"},{"to":"v0.36.14","from":"v0.36.13"},{"to":"v0.36.13","from":"v0.36.12"},{"to":"v0.36.12","from":"v0.36.11"},{"to":"v0.36.11","from":"v0.36.10"},{"to":"v0.36.10","from":"v0.36.9"},{"to":"v0.36.9","from":"v0.36.8"},{"to":"v0.36.8","from":"v0.36.7"},{"to":"v0.36.7","from":"v0.36.6"},{"to":"v0.36.6","from":"v0.36.5"},{"to":"v0.36.5","from":"v0.36.4"},{"to":"v0.36.4","from":"v0.36.3"},{"to":"v0.36.3","from":"v0.36.2"},{"to":"v0.36.2","from":"v0.36.1"},{"to":"v0.36.1","from":"v0.36.0"},{"to":"v0.36.0","from":"v0.35.6"},{"to":"v0.35.6","from":"v0.35.5"},{"to":"v0.35.5","from":"v0.35.4"},{"to":"v0.35.4","from":"v0.35.3"},{"to":"v0.35.3","from":"v0.35.2"},{"to":"v0.35.2","from":"v0.35.1"},{"to":"v0.35.1","from":"v0.35.0"},{"to":"v0.35.0","from":"v0.34.8"},{"to":"v0.34.8","from":"v0.34.7"},{"to":"v0.34.7","from":"v0.34.6"},{"to":"v0.34.6","from":"v0.34.5"},{"to":"v0.34.5","from":"v0.34.4"},{"to":"v0.34.4","from":"v0.34.3"},{"to":"v0.34.3","from":"v0.34.2"},{"to":"v0.34.2","from":"v0.34.1"},{"to":"v0.34.1","from":"v0.34.0"},{"to":"v0.34.0","from":"v0.33.31"},{"to":"v0.33.31","from":"v0.33.30"},{"to":"v0.33.30","from":"v0.33.29"},{"to":"v0.33.29","from":"v0.33.28"},{"to":"v0.33.28","from":"v0.33.27"},{"to":"v0.33.27","from":"v0.33.26"},{"to":"v0.33.26","from":"v0.33.25"},{"to":"v0.33.25","from":"v0.33.24"},{"to":"v0.33.24","from":"v0.33.23"},{"to":"v0.33.23","from":"v0.33.22"},{"to":"v0.33.22","from":"v0.33.21"},{"to":"v0.33.21","from":"v0.33.20"},{"to":"v0.33.20","from":"v0.33.19"},{"to":"v0.33.19","from":"v0.33.18"},{"to":"v0.33.18","from":"v0.33.17"},{"to":"v0.33.17","from":"v0.33.16"},{"to":"v0.33.16","from":"v0.33.15"},{"to":"v0.33.15","from":"v0.33.14"},{"to":"v0.33.14","from":"v0.33.13"},{"to":"v0.33.13","from":"v0.33.12"},{"to":"v0.33.12","from":"v0.33.11"},{"to":"v0.33.11","from":"v0.33.10"},{"to":"v0.33.10","from":"v0.33.9"},{"to":"v0.33.9","from":"v0.33.8"},{"to":"v0.33.8","from":"v0.33.7"},{"to":"v0.33.7","from":"v0.33.6"},{"to":"v0.33.6","from":"v0.33.5"},{"to":"v0.33.5","from":"v0.33.4"},{"to":"v0.33.4","from":"v0.33.3"},{"to":"v0.33.3","from":"v0.33.2"},{"to":"v0.33.2","from":"v0.33.1"},{"to":"v0.33.1","from":"v0.33.0"},{"to":"v0.33.0","from":"v0.32.6"},{"to":"v0.32.6","from":"v0.32.5"},{"to":"v0.32.5","from":"v0.32.4"},{"to":"v0.32.4","from":"v0.32.3"},{"to":"v0.32.3","from":"v0.32.2"},{"to":"v0.32.2","from":"v0.32.1"},{"to":"v0.32.1","from":"v0.32.0"},{"to":"v0.32.0","from":"v0.31.2"},{"to":"v0.31.2","from":"v0.31.1"},{"to":"v0.31.1","from":"v0.31.0"},{"to":"v0.31.0","from":"v0.30.9"},{"to":"v0.30.9","from":"v0.30.8"},{"to":"v0.30.8","from":"v0.30.7"},{"to":"v0.30.7","from":"v0.30.6"},{"to":"v0.30.6","from":"v0.30.5"},{"to":"v0.30.5","from":"v0.30.4"},{"to":"v0.30.4","from":"v0.30.3"},{"to":"v0.30.3","from":"v0.30.2"},{"to":"v0.30.2","from":"v0.30.1"},{"to":"v0.30.1","from":"v0.30.0"},{"to":"v0.30.0","from":"v0.29.4"},{"to":"v0.29.4","from":"v0.29.3"},{"to":"v0.29.3","from":"v0.29.2"},{"to":"v0.29.2","from":"v0.29.1"},{"to":"v0.29.1","from":"v0.29.0"},{"to":"v0.29.0","from":"v0.28.9"},{"to":"v0.28.9","from":"v0.28.8"},{"to":"v0.28.8","from":"v0.28.7"},{"to":"v0.28.7","from":"v0.28.6"},{"to":"v0.28.6","from":"v0.28.5"},{"to":"v0.28.5","from":"v0.28.4"},{"to":"v0.28.4","from":"v0.28.3"},{"to":"v0.28.3","from":"v0.28.2"},{"to":"v0.28.2","from":"v0.28.1"},{"to":"v0.28.1","from":"v0.28.0"},{"to":"v0.28.0","from":"v0.27.9"},{"to":"v0.27.9","from":"v0.27.8"},{"to":"v0.27.8","from":"v0.27.7"},{"to":"v0.27.7","from":"v0.27.6"},{"to":"v0.27.6","from":"v0.27.5"},{"to":"v0.27.5","from":"v0.27.4"},{"to":"v0.27.4","from":"v0.27.3"},{"to":"v0.27.3","from":"v0.27.2"},{"to":"v0.27.2","from":"v0.27.1"},{"to":"v0.27.1","from":"v0.27.0"},{"to":"v0.27.0","from":"v0.26.2"},{"to":"v0.26.2","from":"v0.26.1"},{"to":"v0.26.1","from":"v0.26.0"},{"to":"v0.26.0","from":"v0.25.0"},{"to":"v0.25.0","from":"v0.24.1"},{"to":"v0.24.1","from":"v0.24.0"},{"to":"v0.24.0","from":"v0.23.7"},{"to":"v0.23.7","from":"v0.23.6"},{"to":"v0.23.6","from":"v0.23.5"},{"to":"v0.23.5","from":"v0.23.4"},{"to":"v0.23.4","from":"v0.23.3"},{"to":"v0.23.3","from":"v0.23.2"},{"to":"v0.23.2","from":"v0.23.1"},{"to":"v0.23.1","from":"v0.23.0"},{"to":"v0.23.0","from":"v0.22.3"},{"to":"v0.22.3","from":"v0.22.2"},{"to":"v0.22.2","from":"v0.22.1"},{"to":"v0.22.1","from":"v0.22.0"},{"to":"v0.22.0","from":"v0.21.0"},{"to":"v0.21.0","from":"v0.20.5"},{"to":"v0.20.5","from":"v0.20.4"},{"to":"v0.20.4","from":"v0.20.3"},{"to":"v0.20.3","from":"v0.20.2"},{"to":"v0.20.2","from":"v0.20.1"},{"to":"v0.20.1","from":"v0.20.0"},{"to":"v0.20.0","from":"v0.19.5"},{"to":"v0.19.5","from":"v0.19.4"},{"to":"v0.19.4","from":"v0.19.3"},{"to":"v0.19.3","from":"v0.19.2"},{"to":"v0.19.2","from":"v0.19.1"},{"to":"v0.19.1","from":"v0.19.0"},{"to":"v0.19.0","from":"6181a540729a7179d7a9d41489dfc241335cf1b5"}]
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"oc-client","description":"The OpenComponents client-side javascript client","version":"0.49.
|
|
1
|
+
{"name":"oc-client","description":"The OpenComponents client-side javascript client","version":"0.49.7","repository":"https://github.com/opencomponents/oc/tree/master/components/oc-client","author":"Matteo Figus <matteofigus@gmail.com>","oc":{"container":false,"renderInfo":false,"minify":false,"parameters":{},"files":{"template":{"type":"oc-template-es6","hashKey":"4bdbbf7249b210dee9a729e8a611eac3dc5eae82","src":"template.js","version":"1.0.7"},"static":["src"],"dataProvider":{"type":"node.js","hashKey":"96eb8b28d43ce2093e13753e54d3f2f938dd0f7d","src":"server.js"}},"version":"0.49.7","packaged":true,"date":1639558995829},"devDependencies":{"oc-template-es6-compiler":"^1.0.1"}}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oc-client",
|
|
3
3
|
"description": "The OpenComponents client-side javascript client",
|
|
4
|
-
"version": "0.49.
|
|
4
|
+
"version": "0.49.7",
|
|
5
5
|
"repository": "https://github.com/opencomponents/oc/tree/master/components/oc-client",
|
|
6
6
|
"author": "Matteo Figus <matteofigus@gmail.com>",
|
|
7
7
|
"oc": {
|
|
@@ -2,17 +2,7 @@ import basicAuth from 'basic-auth-connect';
|
|
|
2
2
|
import { RequestHandler } from 'express';
|
|
3
3
|
|
|
4
4
|
import strings from '../../resources/';
|
|
5
|
-
|
|
6
|
-
type Validate<T = unknown> = (config: T) => {
|
|
7
|
-
isValid: boolean;
|
|
8
|
-
message: string;
|
|
9
|
-
};
|
|
10
|
-
type Middleware<T> = (config: T) => any;
|
|
11
|
-
|
|
12
|
-
type Authentication<T = any> = {
|
|
13
|
-
validate: Validate<T>;
|
|
14
|
-
middleware: Middleware<T>;
|
|
15
|
-
};
|
|
5
|
+
import { Authentication, PublishAuthConfig } from '../../types';
|
|
16
6
|
|
|
17
7
|
const basicAuthentication: Authentication<{
|
|
18
8
|
username: string;
|
|
@@ -40,8 +30,10 @@ const builtin: Record<string, Authentication> = {
|
|
|
40
30
|
|
|
41
31
|
let scheme: Authentication;
|
|
42
32
|
|
|
43
|
-
export function validate(authConfig:
|
|
44
|
-
if (
|
|
33
|
+
export function validate(authConfig: PublishAuthConfig) {
|
|
34
|
+
if (typeof authConfig.type !== 'string') {
|
|
35
|
+
scheme = authConfig.type;
|
|
36
|
+
} else if (builtin[authConfig.type]) {
|
|
45
37
|
scheme = builtin[authConfig.type];
|
|
46
38
|
} else {
|
|
47
39
|
const moduleName = `oc-auth-${authConfig.type}`;
|
|
@@ -73,8 +73,11 @@ export default function info(vm: Vm): string {
|
|
|
73
73
|
<div class="field"><p>Accept-Language header:</p></div>
|
|
74
74
|
<input class="w-100" id="lang" type="text" value="*" />
|
|
75
75
|
<h3>
|
|
76
|
-
Preview
|
|
77
|
-
<a class="refresh-preview" href="#refresh">
|
|
76
|
+
Preview (
|
|
77
|
+
<a class="refresh-preview" href="#refresh">Refresh</a>
|
|
78
|
+
|
|
|
79
|
+
<a class="open-preview" href="#open">Open</a>
|
|
80
|
+
)
|
|
78
81
|
</h3>
|
|
79
82
|
<iframe class="preview" src="~preview/${sandBoxDefaultQs}"></iframe>`;
|
|
80
83
|
|
|
@@ -7,7 +7,7 @@ oc.cmd.push(function() {
|
|
|
7
7
|
window.location = thisComponentHref + $(this).val() + '/~info';
|
|
8
8
|
});
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
var refreshPreview = function() {
|
|
11
11
|
var splitted = $('#href')
|
|
12
12
|
.val()
|
|
13
13
|
.split('?'),
|
|
@@ -27,6 +27,17 @@ oc.cmd.push(function() {
|
|
|
27
27
|
|
|
28
28
|
$('.preview').attr('src', url);
|
|
29
29
|
|
|
30
|
+
return false;
|
|
31
|
+
};
|
|
32
|
+
$('.refresh-preview').click(refreshPreview);
|
|
33
|
+
|
|
34
|
+
$('.open-preview').click(function() {
|
|
35
|
+
refreshPreview();
|
|
36
|
+
var url = $('.preview').attr('src');
|
|
37
|
+
|
|
38
|
+
window.open(url, '_blank');
|
|
30
39
|
return false;
|
|
31
40
|
});
|
|
41
|
+
|
|
42
|
+
|
|
32
43
|
});`;
|
package/src/types.ts
CHANGED
|
@@ -113,6 +113,22 @@ export interface VM {
|
|
|
113
113
|
type: 'oc-registry' | 'oc-registry-local';
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
+
export type Authentication<T = any> = {
|
|
117
|
+
validate: (config: T) => {
|
|
118
|
+
isValid: boolean;
|
|
119
|
+
message: string;
|
|
120
|
+
};
|
|
121
|
+
middleware: (config: T) => any;
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
export type PublishAuthConfig =
|
|
125
|
+
| {
|
|
126
|
+
type: 'basic';
|
|
127
|
+
username: string;
|
|
128
|
+
password: string;
|
|
129
|
+
}
|
|
130
|
+
| ({ type: string | Authentication } & Record<string, any>);
|
|
131
|
+
|
|
116
132
|
export interface Config {
|
|
117
133
|
baseUrl: string;
|
|
118
134
|
baseUrlFunc?: (opts: { host?: string; secure: boolean }) => string;
|
|
@@ -135,11 +151,7 @@ export interface Config {
|
|
|
135
151
|
port: number | string;
|
|
136
152
|
postRequestPayloadSize?: number;
|
|
137
153
|
prefix: string;
|
|
138
|
-
publishAuth?:
|
|
139
|
-
type: string;
|
|
140
|
-
username: string;
|
|
141
|
-
password: string;
|
|
142
|
-
};
|
|
154
|
+
publishAuth?: PublishAuthConfig;
|
|
143
155
|
publishValidation: (data: unknown) =>
|
|
144
156
|
| {
|
|
145
157
|
isValid: boolean;
|