oc 0.50.57-beta.0 → 0.50.57-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/oc-client/_package/package.json +38 -1
- package/dist/components/oc-client/_package/server.js +1 -1
- package/dist/components/oc-client/package.json +1 -1
- package/dist/registry/domain/http-server/types.d.ts +7 -0
- package/dist/registry/domain/options-sanitiser.d.ts +3 -2
- package/dist/registry/index.d.ts +2 -1
- package/dist/types.d.ts +4 -4
- package/package.json +1 -1
|
@@ -1 +1,38 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "oc-client",
|
|
3
|
+
"description": "The OpenComponents client-side javascript client",
|
|
4
|
+
"version": "0.50.57-beta.1",
|
|
5
|
+
"repository": "https://github.com/opencomponents/oc/tree/master/components/oc-client",
|
|
6
|
+
"author": "Matteo Figus <matteofigus@gmail.com>",
|
|
7
|
+
"oc": {
|
|
8
|
+
"container": false,
|
|
9
|
+
"renderInfo": false,
|
|
10
|
+
"minify": false,
|
|
11
|
+
"parameters": {},
|
|
12
|
+
"files": {
|
|
13
|
+
"template": {
|
|
14
|
+
"type": "oc-template-es6",
|
|
15
|
+
"hashKey": "c4abb6bf4dc6657fb718a45b64bd6b2cb92e874a",
|
|
16
|
+
"src": "template.js",
|
|
17
|
+
"version": "2.0.0",
|
|
18
|
+
"minOcVersion": "0.50.18",
|
|
19
|
+
"size": 2752
|
|
20
|
+
},
|
|
21
|
+
"static": [
|
|
22
|
+
"src"
|
|
23
|
+
],
|
|
24
|
+
"dataProvider": {
|
|
25
|
+
"type": "node.js",
|
|
26
|
+
"hashKey": "6cbed49c98638244527a3246e34d95c7d1ed4143",
|
|
27
|
+
"src": "server.js",
|
|
28
|
+
"size": 651
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"version": "0.50.57-beta.1",
|
|
32
|
+
"packaged": true,
|
|
33
|
+
"date": 1783598247425
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"oc-template-es6-compiler": "^8.0.0"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=(t,
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=(t,a)=>{const{staticPath:e,templates:s}=t;return a(null,{staticPath:e,templates:s})},r=(t,a)=>{o(t,(e,s,i={})=>{if(e)return a(e);if(s==null)return a(null,{__oc_emptyResponse:!0});const n=t.action?s:Object.assign({},s,{_staticPath:t.staticPath,_baseUrl:t.baseUrl,_componentName:"oc-client",_componentVersion:"0.50.57-beta.1"}),c=t.staticPath.indexOf("http")===0?t.staticPath:"https:"+t.staticPath;return a(null,Object.assign({},{component:{key:"c4abb6bf4dc6657fb718a45b64bd6b2cb92e874a",src:c+"template.js",props:n,esm:!1,development:void 0}}))})};exports.data=r;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oc-client",
|
|
3
3
|
"description": "The OpenComponents client-side javascript client",
|
|
4
|
-
"version": "0.50.
|
|
4
|
+
"version": "0.50.57-beta.1",
|
|
5
5
|
"repository": "https://github.com/opencomponents/oc/tree/master/components/oc-client",
|
|
6
6
|
"author": "Matteo Figus <matteofigus@gmail.com>",
|
|
7
7
|
"oc": {
|
|
@@ -68,6 +68,13 @@ export interface OcResponse {
|
|
|
68
68
|
}
|
|
69
69
|
export type OcHandler = (req: OcRequest, res: OcResponse) => void | Promise<void>;
|
|
70
70
|
export type ExpressMiddleware = (req: any, res: any, next: (err?: unknown) => void) => void;
|
|
71
|
+
export type HttpServerAdapterFactory<TOptions = unknown> = {
|
|
72
|
+
(options?: unknown): HttpServerAdapter;
|
|
73
|
+
readonly __serverAdapterOptions?: TOptions;
|
|
74
|
+
};
|
|
75
|
+
export type HttpServerAdapterOptions<TAdapter> = TAdapter extends {
|
|
76
|
+
readonly __serverAdapterOptions?: infer TOptions;
|
|
77
|
+
} ? TOptions : TAdapter extends (options?: infer TOptions) => HttpServerAdapter ? TOptions : unknown;
|
|
71
78
|
export interface HttpServerAdapter {
|
|
72
79
|
name: string;
|
|
73
80
|
enableBodyParser(opts: {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { compileSync } from 'oc-client-browser';
|
|
2
2
|
import type { Config } from '../../types';
|
|
3
|
+
import type { HttpServerAdapterFactory } from './http-server/types';
|
|
3
4
|
type CompileOptions = Omit<Exclude<Parameters<typeof compileSync>[0], undefined>, 'templates'>;
|
|
4
|
-
export interface RegistryOptions<T = any> extends Partial<Omit<Config<T>, 'beforePublish' | 'discovery' | 'plugins'>> {
|
|
5
|
+
export interface RegistryOptions<T = any, TServerAdapter extends HttpServerAdapterFactory = HttpServerAdapterFactory> extends Partial<Omit<Config<T, TServerAdapter>, 'beforePublish' | 'discovery' | 'plugins'>> {
|
|
5
6
|
/**
|
|
6
7
|
* Configuration object to enable/disable the HTML discovery page and the API
|
|
7
8
|
*
|
|
@@ -28,5 +29,5 @@ export interface RegistryOptions<T = any> extends Partial<Omit<Config<T>, 'befor
|
|
|
28
29
|
*/
|
|
29
30
|
compileClient?: boolean | CompileOptions;
|
|
30
31
|
}
|
|
31
|
-
export default function optionsSanitiser(input: RegistryOptions): Config;
|
|
32
|
+
export default function optionsSanitiser<T = any, TServerAdapter extends HttpServerAdapterFactory = HttpServerAdapterFactory>(input: RegistryOptions<T, TServerAdapter>): Config;
|
|
32
33
|
export {};
|
package/dist/registry/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type http from 'node:http';
|
|
2
2
|
import type express from 'express';
|
|
3
3
|
import type { Plugin } from '../types';
|
|
4
|
+
import type { HttpServerAdapterFactory } from './domain/http-server/types';
|
|
4
5
|
import { RegistryOptions } from './domain/options-sanitiser';
|
|
5
6
|
export { RegistryOptions };
|
|
6
|
-
export default function registry<T = any>(inputOptions: RegistryOptions<T>): {
|
|
7
|
+
export default function registry<T = any, TServerAdapter extends HttpServerAdapterFactory = HttpServerAdapterFactory>(inputOptions: RegistryOptions<T, TServerAdapter>): {
|
|
7
8
|
close: (callback: (err?: Error | undefined | string) => void) => void;
|
|
8
9
|
on: <T_1 extends keyof {
|
|
9
10
|
error: {
|
package/dist/types.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { NextFunction, Request, Response } from 'express';
|
|
|
2
2
|
import type { MetadataStore as MetadataStoreType } from 'oc-metadata-adapters-utils';
|
|
3
3
|
import type { StorageAdapter } from 'oc-storage-adapters-utils';
|
|
4
4
|
import type { PackageJson } from 'type-fest';
|
|
5
|
-
import type {
|
|
5
|
+
import type { HttpServerAdapterFactory, HttpServerAdapterOptions } from './registry/domain/http-server/types';
|
|
6
6
|
export type { ComponentRow, MetadataStore } from 'oc-metadata-adapters-utils';
|
|
7
7
|
type Middleware = (req: Request, res: Response, next: NextFunction) => void;
|
|
8
8
|
export interface Author {
|
|
@@ -180,7 +180,7 @@ export type PublishAuthConfig = {
|
|
|
180
180
|
} | ({
|
|
181
181
|
type: string | Authentication;
|
|
182
182
|
} & Record<string, any>);
|
|
183
|
-
export interface Config<T = any> {
|
|
183
|
+
export interface Config<T = any, TServerAdapter extends HttpServerAdapterFactory = HttpServerAdapterFactory> {
|
|
184
184
|
/**
|
|
185
185
|
* Public base URL where the registry is reachable by consumers.
|
|
186
186
|
*
|
|
@@ -425,8 +425,8 @@ export interface Config<T = any> {
|
|
|
425
425
|
* Low-level HTTP server adapter used by the registry.
|
|
426
426
|
*/
|
|
427
427
|
server: {
|
|
428
|
-
adapter:
|
|
429
|
-
options?:
|
|
428
|
+
adapter: TServerAdapter;
|
|
429
|
+
options?: HttpServerAdapterOptions<TServerAdapter>;
|
|
430
430
|
};
|
|
431
431
|
/**
|
|
432
432
|
* Directory used by the registry for temporary files.
|