oc 0.49.8 → 0.49.9
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/dist/cli/commands.d.ts +163 -163
- package/dist/cli/commands.js +162 -162
- package/dist/cli/domain/clean.d.ts +2 -2
- package/dist/cli/domain/clean.js +24 -24
- package/dist/cli/domain/get-components-by-dir.d.ts +1 -1
- package/dist/cli/domain/get-components-by-dir.js +41 -41
- package/dist/cli/domain/get-mocked-plugins.d.ts +10 -10
- package/dist/cli/domain/get-mocked-plugins.js +89 -89
- package/dist/cli/domain/handle-dependencies/ensure-compiler-is-declared-as-devDependency.d.ts +6 -6
- package/dist/cli/domain/handle-dependencies/ensure-compiler-is-declared-as-devDependency.js +16 -16
- package/dist/cli/domain/handle-dependencies/get-compiler.d.ts +10 -10
- package/dist/cli/domain/handle-dependencies/get-compiler.js +28 -28
- package/dist/cli/domain/handle-dependencies/get-missing-dependencies.d.ts +1 -1
- package/dist/cli/domain/handle-dependencies/get-missing-dependencies.js +18 -18
- package/dist/cli/domain/handle-dependencies/index.d.ts +10 -10
- package/dist/cli/domain/handle-dependencies/index.js +70 -70
- package/dist/cli/domain/handle-dependencies/install-compiler.d.ts +8 -8
- package/dist/cli/domain/handle-dependencies/install-compiler.js +54 -54
- package/dist/cli/domain/handle-dependencies/install-missing-dependencies.d.ts +5 -5
- package/dist/cli/domain/handle-dependencies/install-missing-dependencies.js +59 -59
- package/dist/cli/domain/handle-dependencies/link-missing-dependencies.d.ts +6 -6
- package/dist/cli/domain/handle-dependencies/link-missing-dependencies.js +32 -32
- package/dist/cli/domain/handle-dependencies/require-template.d.ts +17 -17
- package/dist/cli/domain/handle-dependencies/require-template.js +34 -34
- package/dist/cli/domain/init-template/index.d.ts +10 -10
- package/dist/cli/domain/init-template/index.js +40 -40
- package/dist/cli/domain/init-template/install-template.d.ts +11 -11
- package/dist/cli/domain/init-template/install-template.js +54 -54
- package/dist/cli/domain/init-template/scaffold.d.ts +11 -11
- package/dist/cli/domain/init-template/scaffold.js +30 -30
- package/dist/cli/domain/local.d.ts +2 -2
- package/dist/cli/domain/local.js +82 -82
- package/dist/cli/domain/mock.d.ts +5 -5
- package/dist/cli/domain/mock.js +33 -33
- package/dist/cli/domain/package-components.d.ts +9 -9
- package/dist/cli/domain/package-components.js +67 -67
- package/dist/cli/domain/registry.d.ts +6 -6
- package/dist/cli/domain/registry.js +136 -136
- package/dist/cli/domain/url-parser.d.ts +14 -14
- package/dist/cli/domain/url-parser.js +31 -31
- package/dist/cli/domain/watch.d.ts +1 -1
- package/dist/cli/domain/watch.js +29 -29
- package/dist/cli/facade/clean.d.ts +16 -16
- package/dist/cli/facade/clean.js +58 -58
- package/dist/cli/facade/dev.d.ts +114 -114
- package/dist/cli/facade/dev.js +176 -176
- package/dist/cli/facade/init.d.ts +18 -18
- package/dist/cli/facade/init.js +39 -39
- package/dist/cli/facade/mock.d.ts +18 -18
- package/dist/cli/facade/mock.js +12 -12
- package/dist/cli/facade/package.d.ts +18 -18
- package/dist/cli/facade/package.js +49 -49
- package/dist/cli/facade/preview.d.ts +14 -14
- package/dist/cli/facade/preview.js +20 -20
- package/dist/cli/facade/publish.d.ts +23 -23
- package/dist/cli/facade/publish.js +145 -145
- package/dist/cli/facade/registry-add.d.ts +14 -14
- package/dist/cli/facade/registry-add.js +18 -18
- package/dist/cli/facade/registry-ls.d.ts +10 -10
- package/dist/cli/facade/registry-ls.js +27 -27
- package/dist/cli/facade/registry-remove.d.ts +14 -14
- package/dist/cli/facade/registry-remove.js +18 -18
- package/dist/cli/facade/registry.d.ts +5 -5
- package/dist/cli/facade/registry.js +9 -9
- package/dist/cli/index.d.ts +1 -1
- package/dist/cli/index.js +91 -91
- package/dist/cli/logger.d.ts +8 -8
- package/dist/cli/logger.js +19 -19
- package/dist/cli/programmatic-api.d.ts +84 -84
- package/dist/cli/programmatic-api.js +66 -66
- package/dist/cli/validate-command.d.ts +2 -2
- package/dist/cli/validate-command.js +18 -18
- package/dist/components/oc-client/_package/package.json +1 -1
- package/dist/components/oc-client/package.json +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +12 -12
- package/dist/oc-cli.d.ts +2 -2
- package/dist/oc-cli.js +3 -3
- package/dist/registry/app-start.d.ts +2 -2
- package/dist/registry/app-start.js +44 -44
- package/dist/registry/domain/authentication.d.ts +7 -7
- package/dist/registry/domain/authentication.js +53 -53
- package/dist/registry/domain/components-cache/components-list.d.ts +8 -8
- package/dist/registry/domain/components-cache/components-list.js +50 -50
- package/dist/registry/domain/components-cache/index.d.ts +7 -7
- package/dist/registry/domain/components-cache/index.js +76 -76
- package/dist/registry/domain/components-details.d.ts +6 -6
- package/dist/registry/domain/components-details.js +64 -64
- package/dist/registry/domain/events-handler.d.ts +40 -40
- package/dist/registry/domain/events-handler.js +37 -37
- package/dist/registry/domain/extract-package.d.ts +8 -8
- package/dist/registry/domain/extract-package.js +26 -26
- package/dist/registry/domain/get-package-json-from-temp-dir.d.ts +2 -2
- package/dist/registry/domain/get-package-json-from-temp-dir.js +11 -11
- package/dist/registry/domain/nested-renderer.d.ts +14 -14
- package/dist/registry/domain/nested-renderer.js +59 -59
- package/dist/registry/domain/options-sanitiser.d.ts +6 -6
- package/dist/registry/domain/options-sanitiser.js +106 -106
- package/dist/registry/domain/plugins-initialiser.d.ts +3 -3
- package/dist/registry/domain/plugins-initialiser.js +95 -95
- package/dist/registry/domain/register-templates.d.ts +5 -5
- package/dist/registry/domain/register-templates.js +30 -30
- package/dist/registry/domain/repository.d.ts +2 -2
- package/dist/registry/domain/repository.js +237 -237
- package/dist/registry/domain/require-wrapper.d.ts +2 -2
- package/dist/registry/domain/require-wrapper.js +33 -33
- package/dist/registry/domain/sanitiser.d.ts +2 -2
- package/dist/registry/domain/sanitiser.js +52 -52
- package/dist/registry/domain/storage-adapter.d.ts +10 -10
- package/dist/registry/domain/storage-adapter.js +55 -55
- package/dist/registry/domain/url-builder.d.ts +10 -10
- package/dist/registry/domain/url-builder.js +60 -60
- package/dist/registry/domain/validators/component-parameters.d.ts +11 -11
- package/dist/registry/domain/validators/component-parameters.js +79 -79
- package/dist/registry/domain/validators/index.d.ts +16 -16
- package/dist/registry/domain/validators/index.js +29 -29
- package/dist/registry/domain/validators/node-version.d.ts +15 -15
- package/dist/registry/domain/validators/node-version.js +40 -40
- package/dist/registry/domain/validators/oc-cli-version.d.ts +15 -15
- package/dist/registry/domain/validators/oc-cli-version.js +34 -34
- package/dist/registry/domain/validators/package-json-validator.d.ts +13 -13
- package/dist/registry/domain/validators/package-json-validator.js +23 -23
- package/dist/registry/domain/validators/plugins-requirements.d.ts +9 -9
- package/dist/registry/domain/validators/plugins-requirements.js +22 -22
- package/dist/registry/domain/validators/registry-configuration.d.ts +9 -9
- package/dist/registry/domain/validators/registry-configuration.js +113 -113
- package/dist/registry/domain/validators/uploaded-package.d.ts +14 -14
- package/dist/registry/domain/validators/uploaded-package.js +25 -25
- package/dist/registry/domain/version-handler.d.ts +2 -2
- package/dist/registry/domain/version-handler.js +22 -22
- package/dist/registry/index.d.ts +48 -48
- package/dist/registry/index.js +107 -107
- package/dist/registry/middleware/base-url-handler.d.ts +2 -2
- package/dist/registry/middleware/base-url-handler.js +12 -12
- package/dist/registry/middleware/cors.d.ts +2 -2
- package/dist/registry/middleware/cors.js +11 -11
- package/dist/registry/middleware/discovery-handler.d.ts +2 -2
- package/dist/registry/middleware/discovery-handler.js +15 -15
- package/dist/registry/middleware/file-uploads.d.ts +2 -2
- package/dist/registry/middleware/file-uploads.js +23 -23
- package/dist/registry/middleware/index.d.ts +7 -7
- package/dist/registry/middleware/index.js +51 -51
- package/dist/registry/middleware/request-handler.d.ts +2 -2
- package/dist/registry/middleware/request-handler.js +30 -30
- package/dist/registry/router.d.ts +3 -3
- package/dist/registry/router.js +56 -56
- package/dist/registry/routes/component-info.d.ts +3 -3
- package/dist/registry/routes/component-info.js +90 -90
- package/dist/registry/routes/component-preview.d.ts +3 -3
- package/dist/registry/routes/component-preview.js +68 -68
- package/dist/registry/routes/component.d.ts +3 -3
- package/dist/registry/routes/component.js +43 -43
- package/dist/registry/routes/components.d.ts +3 -3
- package/dist/registry/routes/components.js +78 -78
- package/dist/registry/routes/dependencies.d.ts +3 -3
- package/dist/registry/routes/dependencies.js +28 -28
- package/dist/registry/routes/helpers/apply-default-values.d.ts +2 -2
- package/dist/registry/routes/helpers/apply-default-values.js +13 -13
- package/dist/registry/routes/helpers/get-available-dependencies.d.ts +8 -8
- package/dist/registry/routes/helpers/get-available-dependencies.js +24 -24
- package/dist/registry/routes/helpers/get-component-fallback.d.ts +17 -17
- package/dist/registry/routes/helpers/get-component-fallback.js +91 -91
- package/dist/registry/routes/helpers/get-component-retrieving-info.d.ts +20 -20
- package/dist/registry/routes/helpers/get-component-retrieving-info.js +24 -24
- package/dist/registry/routes/helpers/get-component.d.ts +33 -33
- package/dist/registry/routes/helpers/get-component.js +406 -406
- package/dist/registry/routes/helpers/get-components-history.d.ts +8 -8
- package/dist/registry/routes/helpers/get-components-history.js +28 -28
- package/dist/registry/routes/helpers/is-url-discoverable.d.ts +3 -3
- package/dist/registry/routes/helpers/is-url-discoverable.js +22 -22
- package/dist/registry/routes/index.d.ts +3 -3
- package/dist/registry/routes/index.js +93 -93
- package/dist/registry/routes/plugins.d.ts +3 -3
- package/dist/registry/routes/plugins.js +17 -17
- package/dist/registry/routes/publish.d.ts +3 -3
- package/dist/registry/routes/publish.js +97 -97
- package/dist/registry/routes/static-redirector.d.ts +3 -3
- package/dist/registry/routes/static-redirector.js +63 -63
- package/dist/registry/views/index.d.ts +2 -2
- package/dist/registry/views/index.js +39 -39
- package/dist/registry/views/info.d.ts +16 -16
- package/dist/registry/views/info.js +39 -39
- package/dist/registry/views/partials/component-author.d.ts +8 -8
- package/dist/registry/views/partials/component-author.js +20 -20
- package/dist/registry/views/partials/component-parameters.d.ts +5 -5
- package/dist/registry/views/partials/component-parameters.js +24 -24
- package/dist/registry/views/partials/component-state.d.ts +5 -5
- package/dist/registry/views/partials/component-state.js +6 -6
- package/dist/registry/views/partials/component-versions.d.ts +5 -5
- package/dist/registry/views/partials/component-versions.js +9 -9
- package/dist/registry/views/partials/components-dependencies.d.ts +2 -2
- package/dist/registry/views/partials/components-dependencies.js +12 -12
- package/dist/registry/views/partials/components-history.d.ts +2 -2
- package/dist/registry/views/partials/components-history.js +10 -10
- package/dist/registry/views/partials/components-list.d.ts +2 -2
- package/dist/registry/views/partials/components-list.js +26 -26
- package/dist/registry/views/partials/components-plugins.d.ts +2 -2
- package/dist/registry/views/partials/components-plugins.js +8 -8
- package/dist/registry/views/partials/components-templates.d.ts +2 -2
- package/dist/registry/views/partials/components-templates.js +14 -14
- package/dist/registry/views/partials/layout.d.ts +8 -8
- package/dist/registry/views/partials/layout.js +11 -11
- package/dist/registry/views/partials/property.d.ts +2 -2
- package/dist/registry/views/partials/property.js +11 -11
- package/dist/registry/views/partials/selected-checkbox.d.ts +4 -4
- package/dist/registry/views/partials/selected-checkbox.js +7 -7
- package/dist/registry/views/preview.d.ts +8 -8
- package/dist/registry/views/preview.js +9 -9
- package/dist/registry/views/static/index.d.ts +2 -2
- package/dist/registry/views/static/index.js +3 -3
- package/dist/registry/views/static/info.d.ts +2 -2
- package/dist/registry/views/static/info.js +3 -3
- package/dist/registry/views/static/style.d.ts +2 -2
- package/dist/registry/views/static/style.js +3 -3
- package/dist/resources/index.d.ts +134 -134
- package/dist/resources/index.js +145 -145
- package/dist/resources/settings.d.ts +17 -17
- package/dist/resources/settings.js +18 -18
- package/dist/types.d.ts +287 -287
- package/dist/types.js +2 -2
- package/dist/utils/clean-require.d.ts +16 -16
- package/dist/utils/clean-require.js +18 -18
- package/dist/utils/date-stringify.d.ts +1 -1
- package/dist/utils/date-stringify.js +22 -22
- package/dist/utils/error-to-string.d.ts +1 -1
- package/dist/utils/error-to-string.js +15 -15
- package/dist/utils/is-template-legacy.d.ts +3 -3
- package/dist/utils/is-template-legacy.js +6 -6
- package/dist/utils/is-template-valid.d.ts +4 -4
- package/dist/utils/is-template-valid.js +12 -12
- package/dist/utils/module-exists.d.ts +1 -1
- package/dist/utils/module-exists.js +15 -15
- package/dist/utils/npm-utils.d.ts +20 -20
- package/dist/utils/npm-utils.js +74 -74
- package/dist/utils/put.d.ts +2 -2
- package/dist/utils/put.js +29 -29
- package/dist/utils/strip-version.d.ts +1 -1
- package/dist/utils/strip-version.js +11 -11
- package/logintervals.md +1 -1
- package/package.json +1 -1
- package/src/cli/facade/dev.ts +1 -1
- package/src/components/oc-client/_package/package.json +1 -1
- package/src/components/oc-client/package.json +1 -1
- package/src/oc-cli.js +0 -0
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.default = {
|
|
4
|
-
configFile: {
|
|
5
|
-
src: './oc.json'
|
|
6
|
-
},
|
|
7
|
-
filesToIgnoreOnDevWatch: /temp\/__oc|node_modules|package\.tar\.gz|_package|\.sw[op]|\.git\/|\.idea\/|\.DS_Store|oc\.json/,
|
|
8
|
-
maxLoopIterations: 1e9,
|
|
9
|
-
registry: {
|
|
10
|
-
acceptRenderedHeader: 'application/vnd.oc.rendered+json',
|
|
11
|
-
acceptUnrenderedHeader: 'application/vnd.oc.unrendered+json',
|
|
12
|
-
acceptInfoHeader: 'application/vnd.oc.info+json',
|
|
13
|
-
componentInfoPath: '/~info',
|
|
14
|
-
componentPreviewPath: '/~preview',
|
|
15
|
-
defaultTempPath: './temp/',
|
|
16
|
-
localStaticRedirectorPath: 'static/'
|
|
17
|
-
}
|
|
18
|
-
};
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = {
|
|
4
|
+
configFile: {
|
|
5
|
+
src: './oc.json'
|
|
6
|
+
},
|
|
7
|
+
filesToIgnoreOnDevWatch: /temp\/__oc|node_modules|package\.tar\.gz|_package|\.sw[op]|\.git\/|\.idea\/|\.DS_Store|oc\.json/,
|
|
8
|
+
maxLoopIterations: 1e9,
|
|
9
|
+
registry: {
|
|
10
|
+
acceptRenderedHeader: 'application/vnd.oc.rendered+json',
|
|
11
|
+
acceptUnrenderedHeader: 'application/vnd.oc.unrendered+json',
|
|
12
|
+
acceptInfoHeader: 'application/vnd.oc.info+json',
|
|
13
|
+
componentInfoPath: '/~info',
|
|
14
|
+
componentPreviewPath: '/~preview',
|
|
15
|
+
defaultTempPath: './temp/',
|
|
16
|
+
localStaticRedirectorPath: 'static/'
|
|
17
|
+
}
|
|
18
|
+
};
|
package/dist/types.d.ts
CHANGED
|
@@ -1,287 +1,287 @@
|
|
|
1
|
-
import { NextFunction, Request, Response } from 'express';
|
|
2
|
-
import { Logger } from './cli/logger';
|
|
3
|
-
import { PackageJson } from 'type-fest';
|
|
4
|
-
export interface Author {
|
|
5
|
-
email?: string;
|
|
6
|
-
name?: string;
|
|
7
|
-
url?: string;
|
|
8
|
-
}
|
|
9
|
-
interface ComponentList {
|
|
10
|
-
author: Author;
|
|
11
|
-
name: string;
|
|
12
|
-
state: string;
|
|
13
|
-
}
|
|
14
|
-
interface ComponentHistory {
|
|
15
|
-
name: string;
|
|
16
|
-
publishDate: string;
|
|
17
|
-
version: string;
|
|
18
|
-
}
|
|
19
|
-
export interface TemplateInfo {
|
|
20
|
-
externals: Array<{
|
|
21
|
-
name: string;
|
|
22
|
-
global: string | string[];
|
|
23
|
-
url: string;
|
|
24
|
-
}>;
|
|
25
|
-
type: string;
|
|
26
|
-
version: string;
|
|
27
|
-
}
|
|
28
|
-
export interface ComponentsDetails {
|
|
29
|
-
components: {
|
|
30
|
-
[componentName: string]: {
|
|
31
|
-
[componentVersion: string]: {
|
|
32
|
-
publishDate: number;
|
|
33
|
-
};
|
|
34
|
-
};
|
|
35
|
-
};
|
|
36
|
-
lastEdit: number;
|
|
37
|
-
}
|
|
38
|
-
export interface ComponentsList {
|
|
39
|
-
components: Record<string, string[]>;
|
|
40
|
-
lastEdit: number;
|
|
41
|
-
}
|
|
42
|
-
export interface OcJsonConfig {
|
|
43
|
-
registries?: string[];
|
|
44
|
-
mocks?: {
|
|
45
|
-
plugins?: {
|
|
46
|
-
dynamic?: Record<string, string>;
|
|
47
|
-
static?: Record<string, string>;
|
|
48
|
-
};
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
export interface OcParameter {
|
|
52
|
-
default?: string | boolean | number;
|
|
53
|
-
description?: string;
|
|
54
|
-
example?: string;
|
|
55
|
-
mandatory?: boolean;
|
|
56
|
-
type: 'string' | 'boolean' | 'number';
|
|
57
|
-
}
|
|
58
|
-
interface OcConfiguration {
|
|
59
|
-
container?: boolean;
|
|
60
|
-
date: number;
|
|
61
|
-
files: {
|
|
62
|
-
dataProvider: {
|
|
63
|
-
hashKey: string;
|
|
64
|
-
src: string;
|
|
65
|
-
type: string;
|
|
66
|
-
};
|
|
67
|
-
static: string[];
|
|
68
|
-
template: {
|
|
69
|
-
hashKey: string;
|
|
70
|
-
src: string;
|
|
71
|
-
type: string;
|
|
72
|
-
version: string;
|
|
73
|
-
};
|
|
74
|
-
};
|
|
75
|
-
packaged: boolean;
|
|
76
|
-
parameters: Record<string, OcParameter>;
|
|
77
|
-
plugins?: string[];
|
|
78
|
-
renderInfo?: boolean;
|
|
79
|
-
state?: 'deprecated' | 'experimental';
|
|
80
|
-
stringifiedDate: string;
|
|
81
|
-
version: string;
|
|
82
|
-
}
|
|
83
|
-
export interface Component extends PackageJson {
|
|
84
|
-
allVersions: string[];
|
|
85
|
-
name: string;
|
|
86
|
-
oc: OcConfiguration;
|
|
87
|
-
version: string;
|
|
88
|
-
}
|
|
89
|
-
export interface ParsedComponent extends Omit<Component, 'author'> {
|
|
90
|
-
author: Author;
|
|
91
|
-
}
|
|
92
|
-
export interface VM {
|
|
93
|
-
availableDependencies: Array<{
|
|
94
|
-
core: boolean;
|
|
95
|
-
name: string;
|
|
96
|
-
version: string;
|
|
97
|
-
link: string;
|
|
98
|
-
}>;
|
|
99
|
-
availablePlugins: Record<string, (...args: unknown[]) => void>;
|
|
100
|
-
components: ParsedComponent[];
|
|
101
|
-
componentsHistory?: ComponentHistory[];
|
|
102
|
-
componentsList: ComponentList[];
|
|
103
|
-
componentsReleases: number;
|
|
104
|
-
href: string;
|
|
105
|
-
ocVersion: string;
|
|
106
|
-
q: string;
|
|
107
|
-
stateCounts: {
|
|
108
|
-
deprecated?: number;
|
|
109
|
-
experimental?: number;
|
|
110
|
-
};
|
|
111
|
-
templates: TemplateInfo[];
|
|
112
|
-
title: string;
|
|
113
|
-
type: 'oc-registry' | 'oc-registry-local';
|
|
114
|
-
}
|
|
115
|
-
export declare type Authentication<T = any> = {
|
|
116
|
-
validate: (config: T) => {
|
|
117
|
-
isValid: boolean;
|
|
118
|
-
message: string;
|
|
119
|
-
};
|
|
120
|
-
middleware: (config: T) => any;
|
|
121
|
-
};
|
|
122
|
-
export declare type PublishAuthConfig = {
|
|
123
|
-
type: 'basic';
|
|
124
|
-
username: string;
|
|
125
|
-
password: string;
|
|
126
|
-
} | ({
|
|
127
|
-
type: string | Authentication;
|
|
128
|
-
} & Record<string, any>);
|
|
129
|
-
export interface Config {
|
|
130
|
-
baseUrl: string;
|
|
131
|
-
baseUrlFunc?: (opts: {
|
|
132
|
-
host?: string;
|
|
133
|
-
secure: boolean;
|
|
134
|
-
}) => string;
|
|
135
|
-
beforePublish: (req: Request, res: Response, next: NextFunction) => void;
|
|
136
|
-
customHeadersToSkipOnWeakVersion: string[];
|
|
137
|
-
dependencies: string[];
|
|
138
|
-
discovery: boolean;
|
|
139
|
-
discoveryFunc?: (opts: {
|
|
140
|
-
host?: string;
|
|
141
|
-
secure: boolean;
|
|
142
|
-
}) => boolean;
|
|
143
|
-
env: Record<string, string>;
|
|
144
|
-
executionTimeout?: number;
|
|
145
|
-
fallbackRegistryUrl: string;
|
|
146
|
-
hotReloading: boolean;
|
|
147
|
-
keepAliveTimeout?: number;
|
|
148
|
-
liveReloadPort: number;
|
|
149
|
-
components?: string[];
|
|
150
|
-
local: boolean;
|
|
151
|
-
path: string;
|
|
152
|
-
plugins: Record<string, (...args: unknown[]) => void>;
|
|
153
|
-
pollingInterval: number;
|
|
154
|
-
port: number | string;
|
|
155
|
-
postRequestPayloadSize?: number;
|
|
156
|
-
prefix: string;
|
|
157
|
-
publishAuth?: PublishAuthConfig;
|
|
158
|
-
publishValidation: (data: unknown) => {
|
|
159
|
-
isValid: boolean;
|
|
160
|
-
error?: string;
|
|
161
|
-
} | boolean;
|
|
162
|
-
refreshInterval?: number;
|
|
163
|
-
routes?: Array<{
|
|
164
|
-
route: string;
|
|
165
|
-
method: string;
|
|
166
|
-
handler: (req: Request, res: Response) => void;
|
|
167
|
-
}>;
|
|
168
|
-
s3?: {
|
|
169
|
-
bucket: string;
|
|
170
|
-
region: string;
|
|
171
|
-
key?: string;
|
|
172
|
-
secret?: string;
|
|
173
|
-
componentsDir: string;
|
|
174
|
-
};
|
|
175
|
-
storage: {
|
|
176
|
-
adapter: any;
|
|
177
|
-
options: Record<string, any> & {
|
|
178
|
-
componentsDir: string;
|
|
179
|
-
};
|
|
180
|
-
};
|
|
181
|
-
tempDir: string;
|
|
182
|
-
templates: any[];
|
|
183
|
-
timeout: number;
|
|
184
|
-
verbosity: number;
|
|
185
|
-
}
|
|
186
|
-
declare type CompiledTemplate = (model: unknown) => string;
|
|
187
|
-
interface CompilerOptions {
|
|
188
|
-
componentPackage: PackageJson & {
|
|
189
|
-
oc: OcConfiguration;
|
|
190
|
-
};
|
|
191
|
-
componentPath: string;
|
|
192
|
-
minify: boolean;
|
|
193
|
-
ocPackage: PackageJson;
|
|
194
|
-
production: boolean;
|
|
195
|
-
publishPath: string;
|
|
196
|
-
verbose: boolean;
|
|
197
|
-
watch: boolean;
|
|
198
|
-
}
|
|
199
|
-
export interface Template {
|
|
200
|
-
compile?: (options: CompilerOptions, cb: (err: Error | null) => void) => void;
|
|
201
|
-
getCompiledTemplate: (templateString: string, key: string, context?: Record<string, unknown>) => CompiledTemplate;
|
|
202
|
-
getInfo: () => TemplateInfo;
|
|
203
|
-
render: (options: {
|
|
204
|
-
model: unknown;
|
|
205
|
-
template: CompiledTemplate;
|
|
206
|
-
}, cb: (err: Error | null, data: string) => void) => void;
|
|
207
|
-
}
|
|
208
|
-
export interface Plugin {
|
|
209
|
-
callback?: (error: unknown) => void;
|
|
210
|
-
description?: string;
|
|
211
|
-
name: string;
|
|
212
|
-
options?: any;
|
|
213
|
-
register: {
|
|
214
|
-
register: (options: unknown, dependencies: unknown, next: (error?: unknown) => void) => void;
|
|
215
|
-
execute: (...args: unknown[]) => unknown;
|
|
216
|
-
dependencies?: string[];
|
|
217
|
-
};
|
|
218
|
-
}
|
|
219
|
-
export interface RegistryCli {
|
|
220
|
-
add(registry: string): Promise<void>;
|
|
221
|
-
get(): Promise<string[]>;
|
|
222
|
-
getApiComponentByHref(href: string): Promise<Component>;
|
|
223
|
-
getComponentPreviewUrlByUrl(componentHref: string): Promise<string>;
|
|
224
|
-
putComponent(options: {
|
|
225
|
-
username?: string;
|
|
226
|
-
password?: string;
|
|
227
|
-
route: string;
|
|
228
|
-
path: string;
|
|
229
|
-
}): Promise<void>;
|
|
230
|
-
remove(registry: string): Promise<void>;
|
|
231
|
-
}
|
|
232
|
-
export interface Local {
|
|
233
|
-
clean: {
|
|
234
|
-
fetchList: (dirPath: string) => Promise<string[]>;
|
|
235
|
-
remove: (list: string[]) => Promise<void>;
|
|
236
|
-
};
|
|
237
|
-
cleanup: (compressedPackagePath: string) => Promise<void>;
|
|
238
|
-
compress: (input: string, output: string) => Promise<void>;
|
|
239
|
-
getComponentsByDir: (componentsDir: string, componentsToRun?: string[]) => Promise<string[]>;
|
|
240
|
-
init: (options: {
|
|
241
|
-
componentName: string;
|
|
242
|
-
logger: Logger;
|
|
243
|
-
componentPath: string;
|
|
244
|
-
templateType: string;
|
|
245
|
-
}) => Promise<void>;
|
|
246
|
-
mock: (params: {
|
|
247
|
-
targetType: string;
|
|
248
|
-
targetValue: string;
|
|
249
|
-
targetName: string;
|
|
250
|
-
}) => Promise<void>;
|
|
251
|
-
package: (options: {
|
|
252
|
-
componentPath: string;
|
|
253
|
-
minify?: boolean;
|
|
254
|
-
verbose?: boolean;
|
|
255
|
-
production?: boolean;
|
|
256
|
-
}) => Promise<Component>;
|
|
257
|
-
}
|
|
258
|
-
export interface Repository {
|
|
259
|
-
getCompiledView(componentName: string, componentVersion: string): Promise<string>;
|
|
260
|
-
getComponent(componentName: string, componentVersion?: string): Promise<Component>;
|
|
261
|
-
getComponentInfo(componentName: string, componentVersion: string): Promise<Component>;
|
|
262
|
-
getComponentPath(componentName: string, componentVersion: string): void;
|
|
263
|
-
getComponents(): Promise<string[]>;
|
|
264
|
-
getComponentsDetails(): Promise<ComponentsDetails>;
|
|
265
|
-
getComponentVersions(componentName: string): Promise<string[]>;
|
|
266
|
-
getDataProvider(componentName: string, componentVersion: string): Promise<{
|
|
267
|
-
content: string;
|
|
268
|
-
filePath: string;
|
|
269
|
-
}>;
|
|
270
|
-
getStaticClientMapPath: () => string;
|
|
271
|
-
getStaticClientPath: () => string;
|
|
272
|
-
getStaticFilePath: (componentName: string, componentVersion: string, filePath: string) => string;
|
|
273
|
-
getTemplate: (type: string) => Template;
|
|
274
|
-
getTemplatesInfo: () => TemplateInfo[];
|
|
275
|
-
init(): Promise<ComponentsList>;
|
|
276
|
-
publishComponent(pkgDetails: any, componentName: string, componentVersion: string): Promise<ComponentsDetails>;
|
|
277
|
-
}
|
|
278
|
-
declare global {
|
|
279
|
-
namespace Express {
|
|
280
|
-
interface Response {
|
|
281
|
-
conf: Config;
|
|
282
|
-
errorCode?: string;
|
|
283
|
-
errorDetails?: string;
|
|
284
|
-
}
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
export {};
|
|
1
|
+
import { NextFunction, Request, Response } from 'express';
|
|
2
|
+
import { Logger } from './cli/logger';
|
|
3
|
+
import { PackageJson } from 'type-fest';
|
|
4
|
+
export interface Author {
|
|
5
|
+
email?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
url?: string;
|
|
8
|
+
}
|
|
9
|
+
interface ComponentList {
|
|
10
|
+
author: Author;
|
|
11
|
+
name: string;
|
|
12
|
+
state: string;
|
|
13
|
+
}
|
|
14
|
+
interface ComponentHistory {
|
|
15
|
+
name: string;
|
|
16
|
+
publishDate: string;
|
|
17
|
+
version: string;
|
|
18
|
+
}
|
|
19
|
+
export interface TemplateInfo {
|
|
20
|
+
externals: Array<{
|
|
21
|
+
name: string;
|
|
22
|
+
global: string | string[];
|
|
23
|
+
url: string;
|
|
24
|
+
}>;
|
|
25
|
+
type: string;
|
|
26
|
+
version: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ComponentsDetails {
|
|
29
|
+
components: {
|
|
30
|
+
[componentName: string]: {
|
|
31
|
+
[componentVersion: string]: {
|
|
32
|
+
publishDate: number;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
lastEdit: number;
|
|
37
|
+
}
|
|
38
|
+
export interface ComponentsList {
|
|
39
|
+
components: Record<string, string[]>;
|
|
40
|
+
lastEdit: number;
|
|
41
|
+
}
|
|
42
|
+
export interface OcJsonConfig {
|
|
43
|
+
registries?: string[];
|
|
44
|
+
mocks?: {
|
|
45
|
+
plugins?: {
|
|
46
|
+
dynamic?: Record<string, string>;
|
|
47
|
+
static?: Record<string, string>;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
export interface OcParameter {
|
|
52
|
+
default?: string | boolean | number;
|
|
53
|
+
description?: string;
|
|
54
|
+
example?: string;
|
|
55
|
+
mandatory?: boolean;
|
|
56
|
+
type: 'string' | 'boolean' | 'number';
|
|
57
|
+
}
|
|
58
|
+
interface OcConfiguration {
|
|
59
|
+
container?: boolean;
|
|
60
|
+
date: number;
|
|
61
|
+
files: {
|
|
62
|
+
dataProvider: {
|
|
63
|
+
hashKey: string;
|
|
64
|
+
src: string;
|
|
65
|
+
type: string;
|
|
66
|
+
};
|
|
67
|
+
static: string[];
|
|
68
|
+
template: {
|
|
69
|
+
hashKey: string;
|
|
70
|
+
src: string;
|
|
71
|
+
type: string;
|
|
72
|
+
version: string;
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
packaged: boolean;
|
|
76
|
+
parameters: Record<string, OcParameter>;
|
|
77
|
+
plugins?: string[];
|
|
78
|
+
renderInfo?: boolean;
|
|
79
|
+
state?: 'deprecated' | 'experimental';
|
|
80
|
+
stringifiedDate: string;
|
|
81
|
+
version: string;
|
|
82
|
+
}
|
|
83
|
+
export interface Component extends PackageJson {
|
|
84
|
+
allVersions: string[];
|
|
85
|
+
name: string;
|
|
86
|
+
oc: OcConfiguration;
|
|
87
|
+
version: string;
|
|
88
|
+
}
|
|
89
|
+
export interface ParsedComponent extends Omit<Component, 'author'> {
|
|
90
|
+
author: Author;
|
|
91
|
+
}
|
|
92
|
+
export interface VM {
|
|
93
|
+
availableDependencies: Array<{
|
|
94
|
+
core: boolean;
|
|
95
|
+
name: string;
|
|
96
|
+
version: string;
|
|
97
|
+
link: string;
|
|
98
|
+
}>;
|
|
99
|
+
availablePlugins: Record<string, (...args: unknown[]) => void>;
|
|
100
|
+
components: ParsedComponent[];
|
|
101
|
+
componentsHistory?: ComponentHistory[];
|
|
102
|
+
componentsList: ComponentList[];
|
|
103
|
+
componentsReleases: number;
|
|
104
|
+
href: string;
|
|
105
|
+
ocVersion: string;
|
|
106
|
+
q: string;
|
|
107
|
+
stateCounts: {
|
|
108
|
+
deprecated?: number;
|
|
109
|
+
experimental?: number;
|
|
110
|
+
};
|
|
111
|
+
templates: TemplateInfo[];
|
|
112
|
+
title: string;
|
|
113
|
+
type: 'oc-registry' | 'oc-registry-local';
|
|
114
|
+
}
|
|
115
|
+
export declare type Authentication<T = any> = {
|
|
116
|
+
validate: (config: T) => {
|
|
117
|
+
isValid: boolean;
|
|
118
|
+
message: string;
|
|
119
|
+
};
|
|
120
|
+
middleware: (config: T) => any;
|
|
121
|
+
};
|
|
122
|
+
export declare type PublishAuthConfig = {
|
|
123
|
+
type: 'basic';
|
|
124
|
+
username: string;
|
|
125
|
+
password: string;
|
|
126
|
+
} | ({
|
|
127
|
+
type: string | Authentication;
|
|
128
|
+
} & Record<string, any>);
|
|
129
|
+
export interface Config {
|
|
130
|
+
baseUrl: string;
|
|
131
|
+
baseUrlFunc?: (opts: {
|
|
132
|
+
host?: string;
|
|
133
|
+
secure: boolean;
|
|
134
|
+
}) => string;
|
|
135
|
+
beforePublish: (req: Request, res: Response, next: NextFunction) => void;
|
|
136
|
+
customHeadersToSkipOnWeakVersion: string[];
|
|
137
|
+
dependencies: string[];
|
|
138
|
+
discovery: boolean;
|
|
139
|
+
discoveryFunc?: (opts: {
|
|
140
|
+
host?: string;
|
|
141
|
+
secure: boolean;
|
|
142
|
+
}) => boolean;
|
|
143
|
+
env: Record<string, string>;
|
|
144
|
+
executionTimeout?: number;
|
|
145
|
+
fallbackRegistryUrl: string;
|
|
146
|
+
hotReloading: boolean;
|
|
147
|
+
keepAliveTimeout?: number;
|
|
148
|
+
liveReloadPort: number;
|
|
149
|
+
components?: string[];
|
|
150
|
+
local: boolean;
|
|
151
|
+
path: string;
|
|
152
|
+
plugins: Record<string, (...args: unknown[]) => void>;
|
|
153
|
+
pollingInterval: number;
|
|
154
|
+
port: number | string;
|
|
155
|
+
postRequestPayloadSize?: number;
|
|
156
|
+
prefix: string;
|
|
157
|
+
publishAuth?: PublishAuthConfig;
|
|
158
|
+
publishValidation: (data: unknown) => {
|
|
159
|
+
isValid: boolean;
|
|
160
|
+
error?: string;
|
|
161
|
+
} | boolean;
|
|
162
|
+
refreshInterval?: number;
|
|
163
|
+
routes?: Array<{
|
|
164
|
+
route: string;
|
|
165
|
+
method: string;
|
|
166
|
+
handler: (req: Request, res: Response) => void;
|
|
167
|
+
}>;
|
|
168
|
+
s3?: {
|
|
169
|
+
bucket: string;
|
|
170
|
+
region: string;
|
|
171
|
+
key?: string;
|
|
172
|
+
secret?: string;
|
|
173
|
+
componentsDir: string;
|
|
174
|
+
};
|
|
175
|
+
storage: {
|
|
176
|
+
adapter: any;
|
|
177
|
+
options: Record<string, any> & {
|
|
178
|
+
componentsDir: string;
|
|
179
|
+
};
|
|
180
|
+
};
|
|
181
|
+
tempDir: string;
|
|
182
|
+
templates: any[];
|
|
183
|
+
timeout: number;
|
|
184
|
+
verbosity: number;
|
|
185
|
+
}
|
|
186
|
+
declare type CompiledTemplate = (model: unknown) => string;
|
|
187
|
+
interface CompilerOptions {
|
|
188
|
+
componentPackage: PackageJson & {
|
|
189
|
+
oc: OcConfiguration;
|
|
190
|
+
};
|
|
191
|
+
componentPath: string;
|
|
192
|
+
minify: boolean;
|
|
193
|
+
ocPackage: PackageJson;
|
|
194
|
+
production: boolean;
|
|
195
|
+
publishPath: string;
|
|
196
|
+
verbose: boolean;
|
|
197
|
+
watch: boolean;
|
|
198
|
+
}
|
|
199
|
+
export interface Template {
|
|
200
|
+
compile?: (options: CompilerOptions, cb: (err: Error | null) => void) => void;
|
|
201
|
+
getCompiledTemplate: (templateString: string, key: string, context?: Record<string, unknown>) => CompiledTemplate;
|
|
202
|
+
getInfo: () => TemplateInfo;
|
|
203
|
+
render: (options: {
|
|
204
|
+
model: unknown;
|
|
205
|
+
template: CompiledTemplate;
|
|
206
|
+
}, cb: (err: Error | null, data: string) => void) => void;
|
|
207
|
+
}
|
|
208
|
+
export interface Plugin {
|
|
209
|
+
callback?: (error: unknown) => void;
|
|
210
|
+
description?: string;
|
|
211
|
+
name: string;
|
|
212
|
+
options?: any;
|
|
213
|
+
register: {
|
|
214
|
+
register: (options: unknown, dependencies: unknown, next: (error?: unknown) => void) => void;
|
|
215
|
+
execute: (...args: unknown[]) => unknown;
|
|
216
|
+
dependencies?: string[];
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
export interface RegistryCli {
|
|
220
|
+
add(registry: string): Promise<void>;
|
|
221
|
+
get(): Promise<string[]>;
|
|
222
|
+
getApiComponentByHref(href: string): Promise<Component>;
|
|
223
|
+
getComponentPreviewUrlByUrl(componentHref: string): Promise<string>;
|
|
224
|
+
putComponent(options: {
|
|
225
|
+
username?: string;
|
|
226
|
+
password?: string;
|
|
227
|
+
route: string;
|
|
228
|
+
path: string;
|
|
229
|
+
}): Promise<void>;
|
|
230
|
+
remove(registry: string): Promise<void>;
|
|
231
|
+
}
|
|
232
|
+
export interface Local {
|
|
233
|
+
clean: {
|
|
234
|
+
fetchList: (dirPath: string) => Promise<string[]>;
|
|
235
|
+
remove: (list: string[]) => Promise<void>;
|
|
236
|
+
};
|
|
237
|
+
cleanup: (compressedPackagePath: string) => Promise<void>;
|
|
238
|
+
compress: (input: string, output: string) => Promise<void>;
|
|
239
|
+
getComponentsByDir: (componentsDir: string, componentsToRun?: string[]) => Promise<string[]>;
|
|
240
|
+
init: (options: {
|
|
241
|
+
componentName: string;
|
|
242
|
+
logger: Logger;
|
|
243
|
+
componentPath: string;
|
|
244
|
+
templateType: string;
|
|
245
|
+
}) => Promise<void>;
|
|
246
|
+
mock: (params: {
|
|
247
|
+
targetType: string;
|
|
248
|
+
targetValue: string;
|
|
249
|
+
targetName: string;
|
|
250
|
+
}) => Promise<void>;
|
|
251
|
+
package: (options: {
|
|
252
|
+
componentPath: string;
|
|
253
|
+
minify?: boolean;
|
|
254
|
+
verbose?: boolean;
|
|
255
|
+
production?: boolean;
|
|
256
|
+
}) => Promise<Component>;
|
|
257
|
+
}
|
|
258
|
+
export interface Repository {
|
|
259
|
+
getCompiledView(componentName: string, componentVersion: string): Promise<string>;
|
|
260
|
+
getComponent(componentName: string, componentVersion?: string): Promise<Component>;
|
|
261
|
+
getComponentInfo(componentName: string, componentVersion: string): Promise<Component>;
|
|
262
|
+
getComponentPath(componentName: string, componentVersion: string): void;
|
|
263
|
+
getComponents(): Promise<string[]>;
|
|
264
|
+
getComponentsDetails(): Promise<ComponentsDetails>;
|
|
265
|
+
getComponentVersions(componentName: string): Promise<string[]>;
|
|
266
|
+
getDataProvider(componentName: string, componentVersion: string): Promise<{
|
|
267
|
+
content: string;
|
|
268
|
+
filePath: string;
|
|
269
|
+
}>;
|
|
270
|
+
getStaticClientMapPath: () => string;
|
|
271
|
+
getStaticClientPath: () => string;
|
|
272
|
+
getStaticFilePath: (componentName: string, componentVersion: string, filePath: string) => string;
|
|
273
|
+
getTemplate: (type: string) => Template;
|
|
274
|
+
getTemplatesInfo: () => TemplateInfo[];
|
|
275
|
+
init(): Promise<ComponentsList>;
|
|
276
|
+
publishComponent(pkgDetails: any, componentName: string, componentVersion: string): Promise<ComponentsDetails>;
|
|
277
|
+
}
|
|
278
|
+
declare global {
|
|
279
|
+
namespace Express {
|
|
280
|
+
interface Response {
|
|
281
|
+
conf: Config;
|
|
282
|
+
errorCode?: string;
|
|
283
|
+
errorDetails?: string;
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
export {};
|
package/dist/types.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
export default function cleanRequire(path: string, opts: {
|
|
2
|
-
justTry: true;
|
|
3
|
-
resolve: true;
|
|
4
|
-
}): string | undefined;
|
|
5
|
-
export default function cleanRequire(path: string, opts: {
|
|
6
|
-
justTry?: false;
|
|
7
|
-
resolve: true;
|
|
8
|
-
}): string;
|
|
9
|
-
export default function cleanRequire<T = unknown>(path: string, opts: {
|
|
10
|
-
justTry: true;
|
|
11
|
-
resolve?: false;
|
|
12
|
-
}): T | undefined;
|
|
13
|
-
export default function cleanRequire<T = unknown>(path: string, opts: {
|
|
14
|
-
justTry?: false;
|
|
15
|
-
resolve?: false;
|
|
16
|
-
}): T;
|
|
1
|
+
export default function cleanRequire(path: string, opts: {
|
|
2
|
+
justTry: true;
|
|
3
|
+
resolve: true;
|
|
4
|
+
}): string | undefined;
|
|
5
|
+
export default function cleanRequire(path: string, opts: {
|
|
6
|
+
justTry?: false;
|
|
7
|
+
resolve: true;
|
|
8
|
+
}): string;
|
|
9
|
+
export default function cleanRequire<T = unknown>(path: string, opts: {
|
|
10
|
+
justTry: true;
|
|
11
|
+
resolve?: false;
|
|
12
|
+
}): T | undefined;
|
|
13
|
+
export default function cleanRequire<T = unknown>(path: string, opts: {
|
|
14
|
+
justTry?: false;
|
|
15
|
+
resolve?: false;
|
|
16
|
+
}): T;
|