@opra/common 0.25.4 → 0.26.0
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/browser.js +1843 -1355
- package/cjs/document/api-document.js +16 -220
- package/cjs/document/data-type/complex-type-class.js +41 -19
- package/cjs/document/data-type/complex-type.js +1 -1
- package/cjs/document/data-type/data-type.js +2 -1
- package/cjs/document/data-type/enum-type-class.js +15 -12
- package/cjs/document/data-type/enum-type.js +28 -14
- package/cjs/document/data-type/field-class.js +21 -3
- package/cjs/document/data-type/field-decorator.js +0 -19
- package/cjs/document/data-type/mapped-type-class.js +8 -10
- package/cjs/document/data-type/mapped-type.js +1 -1
- package/cjs/document/data-type/simple-type-class.js +17 -8
- package/cjs/document/data-type/simple-type.js +1 -1
- package/cjs/document/data-type/union-type-class.js +15 -13
- package/cjs/document/document-base.js +24 -0
- package/cjs/document/factory/api-document-factory.js +231 -0
- package/cjs/document/factory/type-document-factory.js +324 -0
- package/cjs/document/index.js +7 -1
- package/cjs/document/resource/action-decorator.js +27 -0
- package/cjs/document/resource/collection-class.js +95 -44
- package/cjs/document/resource/collection-decorator.js +182 -0
- package/cjs/document/resource/collection.js +4 -4
- package/cjs/document/resource/container-class.js +82 -0
- package/cjs/document/resource/container-decorator.js +24 -0
- package/cjs/document/resource/container.js +29 -0
- package/cjs/document/resource/crud-resource.js +31 -0
- package/cjs/document/resource/endpoint.js +28 -21
- package/cjs/document/resource/operation-decorator.js +27 -0
- package/cjs/document/resource/parameter.js +51 -0
- package/cjs/document/{decorators/resource.decorator.js → resource/resource-decorator.js} +9 -14
- package/cjs/document/resource/resource.js +20 -5
- package/cjs/document/resource/singleton-class.js +60 -40
- package/cjs/document/resource/singleton-decorator.js +57 -0
- package/cjs/document/resource/singleton.js +4 -4
- package/cjs/document/resource/storage-class.js +11 -17
- package/cjs/document/resource/storage-decorator.js +66 -0
- package/cjs/document/resource/storage.js +3 -3
- package/cjs/document/type-document.js +195 -0
- package/cjs/exception/http-errors/internal-server.error.js +1 -0
- package/cjs/exception/opra-exception.js +18 -12
- package/cjs/exception/wrap-exception.js +2 -1
- package/cjs/helpers/responsive-map.js +3 -3
- package/cjs/http/opra-url-path.js +5 -1
- package/cjs/schema/document/document-base.interface.js +2 -0
- package/cjs/schema/document/type-document.interface.js +2 -0
- package/cjs/schema/opra-schema.ns.js +3 -1
- package/cjs/schema/type-guards.js +3 -3
- package/esm/document/api-document.js +16 -220
- package/esm/document/data-type/complex-type-class.js +40 -19
- package/esm/document/data-type/complex-type.js +1 -1
- package/esm/document/data-type/data-type.js +2 -1
- package/esm/document/data-type/enum-type-class.js +15 -12
- package/esm/document/data-type/enum-type.js +26 -12
- package/esm/document/data-type/field-class.js +20 -3
- package/esm/document/data-type/field-decorator.js +0 -19
- package/esm/document/data-type/mapped-type-class.js +9 -11
- package/esm/document/data-type/mapped-type.js +1 -1
- package/esm/document/data-type/simple-type-class.js +15 -6
- package/esm/document/data-type/simple-type.js +1 -1
- package/esm/document/data-type/union-type-class.js +11 -9
- package/esm/document/document-base.js +20 -0
- package/esm/document/factory/api-document-factory.js +227 -0
- package/esm/document/factory/type-document-factory.js +320 -0
- package/esm/document/index.js +7 -1
- package/esm/document/resource/action-decorator.js +23 -0
- package/esm/document/resource/collection-class.js +95 -44
- package/esm/document/resource/collection-decorator.js +178 -0
- package/esm/document/resource/collection.js +4 -4
- package/esm/document/resource/container-class.js +78 -0
- package/esm/document/resource/container-decorator.js +20 -0
- package/esm/document/resource/container.js +25 -0
- package/esm/document/resource/crud-resource.js +27 -0
- package/esm/document/resource/endpoint.js +27 -21
- package/esm/document/resource/operation-decorator.js +23 -0
- package/esm/document/resource/parameter.js +46 -0
- package/esm/document/resource/resource-decorator.js +28 -0
- package/esm/document/resource/resource.js +20 -5
- package/esm/document/resource/singleton-class.js +58 -38
- package/esm/document/resource/singleton-decorator.js +53 -0
- package/esm/document/resource/singleton.js +4 -4
- package/esm/document/resource/storage-class.js +9 -15
- package/esm/document/resource/storage-decorator.js +62 -0
- package/esm/document/resource/storage.js +3 -3
- package/esm/document/type-document.js +191 -0
- package/esm/exception/http-errors/internal-server.error.js +1 -0
- package/esm/exception/opra-exception.js +18 -12
- package/esm/exception/wrap-exception.js +2 -1
- package/esm/helpers/responsive-map.js +3 -3
- package/esm/http/opra-url-path.js +4 -1
- package/esm/schema/document/document-base.interface.js +1 -0
- package/esm/schema/document/type-document.interface.js +1 -0
- package/esm/schema/opra-schema.ns.js +3 -1
- package/esm/schema/type-guards.js +1 -1
- package/package.json +2 -2
- package/types/document/api-document.d.ts +32 -73
- package/types/document/data-type/complex-type-class.d.ts +5 -5
- package/types/document/data-type/complex-type.d.ts +8 -3
- package/types/document/{decorators → data-type}/complex-type.decorator.d.ts +1 -1
- package/types/document/data-type/data-type.d.ts +11 -1
- package/types/document/data-type/enum-type-class.d.ts +6 -6
- package/types/document/data-type/enum-type.d.ts +12 -6
- package/types/document/data-type/field-class.d.ts +9 -1
- package/types/document/data-type/field-decorator.d.ts +1 -1
- package/types/document/data-type/field.d.ts +4 -3
- package/types/document/data-type/mapped-type-class.d.ts +5 -9
- package/types/document/data-type/mapped-type.d.ts +6 -7
- package/types/document/data-type/simple-type-class.d.ts +6 -3
- package/types/document/{decorators → data-type}/simple-type.decorator.d.ts +1 -1
- package/types/document/data-type/union-type-class.d.ts +2 -8
- package/types/document/data-type/union-type.d.ts +7 -6
- package/types/document/document-base.d.ts +10 -0
- package/types/document/factory/api-document-factory.d.ts +50 -0
- package/types/document/factory/type-document-factory.d.ts +56 -0
- package/types/document/index.d.ts +7 -1
- package/types/document/resource/action-decorator.d.ts +6 -0
- package/types/document/resource/collection-class.d.ts +17 -12
- package/types/document/resource/collection-decorator.d.ts +192 -0
- package/types/document/resource/collection.d.ts +11 -19
- package/types/document/resource/container-class.d.ts +66 -0
- package/types/document/resource/container-decorator.d.ts +37 -0
- package/types/document/resource/container.d.ts +25 -0
- package/types/document/resource/crud-resource.d.ts +16 -0
- package/types/document/resource/endpoint.d.ts +26 -19
- package/types/document/resource/operation-decorator.d.ts +6 -0
- package/types/document/resource/parameter.d.ts +35 -0
- package/types/document/resource/resource-decorator.d.ts +32 -0
- package/types/document/resource/resource.d.ts +15 -13
- package/types/document/resource/singleton-class.d.ts +15 -14
- package/types/document/resource/singleton-decorator.d.ts +125 -0
- package/types/document/resource/singleton.d.ts +11 -16
- package/types/document/resource/storage-class.d.ts +13 -6
- package/types/document/resource/storage-decorator.d.ts +98 -0
- package/types/document/resource/storage.d.ts +9 -12
- package/types/document/type-document.d.ts +68 -0
- package/types/exception/opra-exception.d.ts +1 -1
- package/types/http/opra-url-path.d.ts +2 -1
- package/types/schema/data-type/complex-type.interface.d.ts +1 -1
- package/types/schema/data-type/data-type.interface.d.ts +3 -3
- package/types/schema/data-type/enum-type.interface.d.ts +6 -7
- package/types/schema/data-type/mapped-type.interface.d.ts +4 -3
- package/types/schema/data-type/simple-type.interface.d.ts +3 -3
- package/types/schema/data-type/union-type.interface.d.ts +6 -4
- package/types/schema/document/api-document.interface.d.ts +11 -0
- package/types/schema/document/document-base.interface.d.ts +24 -0
- package/types/schema/document/type-document.interface.d.ts +6 -0
- package/types/schema/opra-schema.ns.d.ts +3 -1
- package/types/schema/resource/collection.interface.d.ts +31 -31
- package/types/schema/resource/container.interface.d.ts +4 -3
- package/types/schema/resource/resource.interface.d.ts +1 -1
- package/types/schema/resource/singleton.interface.d.ts +15 -10
- package/types/schema/resource/storage.interface.d.ts +49 -45
- package/types/schema/type-guards.d.ts +3 -2
- package/cjs/document/decorators/collection-decorator.js +0 -38
- package/cjs/document/decorators/singleton.decorator.js +0 -36
- package/cjs/document/decorators/storage.decorator.js +0 -35
- package/cjs/document/factory/add-references.js +0 -20
- package/cjs/document/factory/create-document.js +0 -83
- package/cjs/document/factory/factory.js +0 -66
- package/cjs/document/factory/import-resource-class.js +0 -54
- package/cjs/document/factory/import-type-class.js +0 -146
- package/cjs/document/factory/index.js +0 -4
- package/cjs/document/factory/process-resources.js +0 -70
- package/cjs/document/factory/process-types.js +0 -191
- package/cjs/document/utils/generate-codec.js +0 -39
- package/esm/document/decorators/collection-decorator.js +0 -34
- package/esm/document/decorators/resource.decorator.js +0 -33
- package/esm/document/decorators/singleton.decorator.js +0 -32
- package/esm/document/decorators/storage.decorator.js +0 -31
- package/esm/document/factory/add-references.js +0 -16
- package/esm/document/factory/create-document.js +0 -77
- package/esm/document/factory/factory.js +0 -62
- package/esm/document/factory/import-resource-class.js +0 -48
- package/esm/document/factory/import-type-class.js +0 -136
- package/esm/document/factory/index.js +0 -1
- package/esm/document/factory/process-resources.js +0 -63
- package/esm/document/factory/process-types.js +0 -185
- package/esm/document/utils/generate-codec.js +0 -33
- package/types/document/decorators/collection-decorator.d.ts +0 -30
- package/types/document/decorators/resource.decorator.d.ts +0 -9
- package/types/document/decorators/singleton.decorator.d.ts +0 -25
- package/types/document/decorators/storage.decorator.d.ts +0 -22
- package/types/document/factory/add-references.d.ts +0 -4
- package/types/document/factory/create-document.d.ts +0 -12
- package/types/document/factory/factory.d.ts +0 -63
- package/types/document/factory/import-resource-class.d.ts +0 -10
- package/types/document/factory/import-type-class.d.ts +0 -17
- package/types/document/factory/index.d.ts +0 -1
- package/types/document/factory/process-resources.d.ts +0 -9
- package/types/document/factory/process-types.d.ts +0 -6
- package/types/document/utils/generate-codec.d.ts +0 -10
- package/types/schema/document.interface.d.ts +0 -34
- /package/cjs/document/{decorators → data-type}/complex-type.decorator.js +0 -0
- /package/cjs/document/{decorators → data-type}/simple-type.decorator.js +0 -0
- /package/cjs/schema/{document.interface.js → document/api-document.interface.js} +0 -0
- /package/esm/document/{decorators → data-type}/complex-type.decorator.js +0 -0
- /package/esm/document/{decorators → data-type}/simple-type.decorator.js +0 -0
- /package/esm/schema/{document.interface.js → document/api-document.interface.js} +0 -0
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { StrictOmit } from 'ts-gems';
|
|
2
|
-
import { TypeThunkAsync } from '../../types.js';
|
|
3
|
-
import { Resource } from '../resource/resource.js';
|
|
4
|
-
import type { Singleton } from '../resource/singleton.js';
|
|
5
|
-
import { ResourceDecorator } from './resource.decorator.js';
|
|
6
|
-
type ErrorMessage<T, Error> = [T] extends [never] ? Error : T;
|
|
7
|
-
declare const operationProperties: readonly ["create", "delete", "get", "update"];
|
|
8
|
-
type OperationProperties = typeof operationProperties[number];
|
|
9
|
-
export declare function SingletonDecorator(type: TypeThunkAsync | string, options?: Singleton.DecoratorOptions): ClassDecorator;
|
|
10
|
-
export declare namespace SingletonDecorator {
|
|
11
|
-
var Create: (options?: unknown) => (target: Object, propertyKey: string | symbol) => void;
|
|
12
|
-
var Get: (options?: unknown) => (target: Object, propertyKey: string | symbol) => void;
|
|
13
|
-
var Delete: (options?: unknown) => (target: Object, propertyKey: string | symbol) => void;
|
|
14
|
-
var Update: (options?: unknown) => (target: Object, propertyKey: string | symbol) => void;
|
|
15
|
-
var Action: (options: any) => PropertyDecorator;
|
|
16
|
-
}
|
|
17
|
-
export interface SingletonDecorator extends StrictOmit<ResourceDecorator, 'Action'> {
|
|
18
|
-
(type: TypeThunkAsync | string, options?: Singleton.DecoratorOptions): ClassDecorator;
|
|
19
|
-
Action: (options?: Resource.ActionOptions) => (<T, K extends keyof T>(target: T, propertyKey: ErrorMessage<Exclude<K, OperationProperties>, `'${string & K}' property is reserved for operation endpoints and can not be used for actions`>) => void);
|
|
20
|
-
Create: (options?: Singleton.CreateEndpointOptions) => ((target: Object, propertyKey: 'create') => void);
|
|
21
|
-
Delete: (options?: Singleton.DeleteEndpointOptions) => ((target: Object, propertyKey: 'delete') => void);
|
|
22
|
-
Get: (options?: Singleton.GetEndpointOptions) => ((target: Object, propertyKey: 'get') => void);
|
|
23
|
-
Update: (options?: Singleton.UpdateEndpointOptions) => ((target: Object, propertyKey: 'update') => void);
|
|
24
|
-
}
|
|
25
|
-
export {};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { StrictOmit } from 'ts-gems';
|
|
2
|
-
import { Resource } from '../resource/resource.js';
|
|
3
|
-
import type { Storage } from '../resource/storage.js';
|
|
4
|
-
import { ResourceDecorator } from './resource.decorator.js';
|
|
5
|
-
type ErrorMessage<T, Error> = [T] extends [never] ? Error : T;
|
|
6
|
-
declare const operationProperties: readonly ["delete", "get", "post"];
|
|
7
|
-
type OperationProperties = typeof operationProperties[number];
|
|
8
|
-
export declare function StorageDecorator(options?: Storage.DecoratorOptions): ClassDecorator;
|
|
9
|
-
export declare namespace StorageDecorator {
|
|
10
|
-
var Delete: (options?: unknown) => (target: Object, propertyKey: string | symbol) => void;
|
|
11
|
-
var Get: (options?: unknown) => (target: Object, propertyKey: string | symbol) => void;
|
|
12
|
-
var Post: (options?: unknown) => (target: Object, propertyKey: string | symbol) => void;
|
|
13
|
-
var Action: (options: any) => PropertyDecorator;
|
|
14
|
-
}
|
|
15
|
-
export interface StorageDecorator extends StrictOmit<ResourceDecorator, 'Action'> {
|
|
16
|
-
(options?: Storage.DecoratorOptions): ClassDecorator;
|
|
17
|
-
Action: (options?: Resource.ActionOptions) => (<T, K extends keyof T>(target: T, propertyKey: ErrorMessage<Exclude<K, OperationProperties>, `'${string & K}' property is reserved for operation endpoints and can not be used for actions`>) => void);
|
|
18
|
-
Delete: (options?: Storage.DeleteEndpointOptions) => ((target: Object, propertyKey: 'delete') => void);
|
|
19
|
-
Get: (options?: Storage.GetEndpointOptions) => ((target: Object, propertyKey: 'get') => void);
|
|
20
|
-
Post: (options?: Storage.PostEndpointOptions) => ((target: Object, propertyKey: 'post') => void);
|
|
21
|
-
}
|
|
22
|
-
export {};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { OpraSchema } from '../../schema/index.js';
|
|
2
|
-
import { ApiDocument } from '../api-document.js';
|
|
3
|
-
import type { DocumentFactory } from './factory.js';
|
|
4
|
-
export declare function addReferences(this: DocumentFactory, references: Record<string, string | OpraSchema.ApiDocument | ApiDocument>): Promise<void>;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { ApiDocument } from '../api-document.js';
|
|
2
|
-
import type { DocumentFactory } from './factory.js';
|
|
3
|
-
export declare function createDocument(this: DocumentFactory, init: DocumentFactory.InitArguments, options?: {
|
|
4
|
-
noBuiltinTypes?: boolean;
|
|
5
|
-
}): Promise<ApiDocument>;
|
|
6
|
-
/**
|
|
7
|
-
*
|
|
8
|
-
* @param url
|
|
9
|
-
* @protected
|
|
10
|
-
*/
|
|
11
|
-
export declare function createDocumentFromUrl(this: DocumentFactory, url: string): Promise<ApiDocument>;
|
|
12
|
-
export declare function createBuiltinTypeDocument(this: DocumentFactory): Promise<ApiDocument>;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { StrictOmit, Type } from 'ts-gems';
|
|
2
|
-
import { ResponsiveMap } from '../../helpers/index.js';
|
|
3
|
-
import { OpraSchema } from '../../schema/index.js';
|
|
4
|
-
import { ThunkAsync } from '../../types.js';
|
|
5
|
-
import { ApiDocument } from '../api-document.js';
|
|
6
|
-
import { addReferences } from './add-references.js';
|
|
7
|
-
import { createBuiltinTypeDocument, createDocument, createDocumentFromUrl } from './create-document.js';
|
|
8
|
-
import { extractCollectionSchema, extractSingletonSchema, importResourceClass } from './import-resource-class.js';
|
|
9
|
-
import { extractComplexTypeSchema, extractEnumTypeSchema, extractFieldSchema, extractMappedTypeSchema, extractSimpleTypeSchema, extractUnionTypeSchema, importTypeClass } from './import-type-class.js';
|
|
10
|
-
import { createCollectionResource, createSingletonResource, createStorageResource, processSourceQueue } from './process-resources.js';
|
|
11
|
-
import { addDataType, createDataTypeInstance, processTypes } from './process-types.js';
|
|
12
|
-
/**
|
|
13
|
-
* @namespace DocumentFactory
|
|
14
|
-
*/
|
|
15
|
-
export declare namespace DocumentFactory {
|
|
16
|
-
interface InitArguments extends StrictOmit<OpraSchema.ApiDocument, 'references' | 'types' | 'resources'> {
|
|
17
|
-
references?: Record<string, string | OpraSchema.ApiDocument | ApiDocument>;
|
|
18
|
-
resources?: ThunkAsync<Type | object>[] | Record<OpraSchema.Resource.Name, OpraSchema.Resource>;
|
|
19
|
-
types?: ThunkAsync<Type | OpraSchema.EnumThunk>[] | Record<string, OpraSchema.DataType>;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* @class DocumentFactory
|
|
24
|
-
*/
|
|
25
|
-
export declare class DocumentFactory {
|
|
26
|
-
static designTypeMap: Map<Function | Type<any>, string>;
|
|
27
|
-
protected document: ApiDocument;
|
|
28
|
-
protected typeQueue: ResponsiveMap<OpraSchema.DataType>;
|
|
29
|
-
protected sourceQueue: ResponsiveMap<OpraSchema.Resource>;
|
|
30
|
-
protected circularRefs: ResponsiveMap<any>;
|
|
31
|
-
protected curPath: string[];
|
|
32
|
-
protected cache: Map<any, any>;
|
|
33
|
-
protected createDocument: typeof createDocument;
|
|
34
|
-
protected createDocumentFromUrl: typeof createDocumentFromUrl;
|
|
35
|
-
protected createBuiltinTypeDocument: typeof createBuiltinTypeDocument;
|
|
36
|
-
protected addReferences: typeof addReferences;
|
|
37
|
-
protected importTypeClass: typeof importTypeClass;
|
|
38
|
-
protected extractSimpleTypeSchema: typeof extractSimpleTypeSchema;
|
|
39
|
-
protected extractComplexTypeSchema: typeof extractComplexTypeSchema;
|
|
40
|
-
protected extractMappedTypeSchema: typeof extractMappedTypeSchema;
|
|
41
|
-
protected extractUnionTypeSchema: typeof extractUnionTypeSchema;
|
|
42
|
-
protected extractEnumTypeSchema: typeof extractEnumTypeSchema;
|
|
43
|
-
protected extractFieldSchema: typeof extractFieldSchema;
|
|
44
|
-
protected processTypes: typeof processTypes;
|
|
45
|
-
protected createDataTypeInstance: typeof createDataTypeInstance;
|
|
46
|
-
protected addDataType: typeof addDataType;
|
|
47
|
-
protected importSourceClass: typeof importResourceClass;
|
|
48
|
-
protected extractSingletonSchema: typeof extractSingletonSchema;
|
|
49
|
-
protected extractCollectionSchema: typeof extractCollectionSchema;
|
|
50
|
-
protected processSourceQueue: typeof processSourceQueue;
|
|
51
|
-
protected createCollectionSource: typeof createCollectionResource;
|
|
52
|
-
protected createSingletonSource: typeof createSingletonResource;
|
|
53
|
-
protected createFileSource: typeof createStorageResource;
|
|
54
|
-
/**
|
|
55
|
-
* Creates ApiDocument instance from given schema object
|
|
56
|
-
* @param init
|
|
57
|
-
*/
|
|
58
|
-
static createDocument(init: DocumentFactory.InitArguments): Promise<ApiDocument>;
|
|
59
|
-
/**
|
|
60
|
-
* Downloads schema from the given URL and creates the document instance * @param url
|
|
61
|
-
*/
|
|
62
|
-
static createDocumentFromUrl(url: string): Promise<ApiDocument>;
|
|
63
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import 'reflect-metadata';
|
|
2
|
-
import { Type } from 'ts-gems';
|
|
3
|
-
import { OpraSchema } from '../../schema/index.js';
|
|
4
|
-
import type { ThunkAsync } from '../../types.js';
|
|
5
|
-
import type { Collection } from '../resource/collection.js';
|
|
6
|
-
import type { Singleton } from '../resource/singleton.js';
|
|
7
|
-
import type { DocumentFactory } from './factory.js';
|
|
8
|
-
export declare function importResourceClass(this: DocumentFactory, thunk: ThunkAsync<Type | object>): Promise<void>;
|
|
9
|
-
export declare function extractSingletonSchema(this: DocumentFactory, target: OpraSchema.Singleton, ctor: Type, metadata: Singleton.Metadata, controller: object | Type): Promise<void>;
|
|
10
|
-
export declare function extractCollectionSchema(this: DocumentFactory, target: OpraSchema.Collection, ctor: Type, metadata: Collection.Metadata, controller: object | Type): Promise<void>;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Type } from 'ts-gems';
|
|
2
|
-
import { OpraSchema } from '../../schema/index.js';
|
|
3
|
-
import type { ThunkAsync } from '../../types.js';
|
|
4
|
-
import type { ComplexType } from '../data-type/complex-type.js';
|
|
5
|
-
import type { EnumType } from '../data-type/enum-type.js';
|
|
6
|
-
import type { ApiField } from '../data-type/field.js';
|
|
7
|
-
import type { MappedType } from '../data-type/mapped-type.js';
|
|
8
|
-
import type { SimpleType } from '../data-type/simple-type.js';
|
|
9
|
-
import type { UnionType } from '../data-type/union-type.js';
|
|
10
|
-
import type { DocumentFactory } from './factory.js';
|
|
11
|
-
export declare function importTypeClass(this: DocumentFactory, typeThunk: ThunkAsync<Type | OpraSchema.EnumThunk>): Promise<string | OpraSchema.DataType>;
|
|
12
|
-
export declare function extractSimpleTypeSchema(this: DocumentFactory, target: OpraSchema.SimpleType, ctor: Type, metadata: SimpleType.Metadata): Promise<void>;
|
|
13
|
-
export declare function extractComplexTypeSchema(this: DocumentFactory, target: OpraSchema.ComplexType, ctor: Type, metadata: ComplexType.Metadata): Promise<void>;
|
|
14
|
-
export declare function extractMappedTypeSchema(this: DocumentFactory, target: OpraSchema.MappedType, ctor: Type, metadata: MappedType.Metadata): Promise<void>;
|
|
15
|
-
export declare function extractUnionTypeSchema(this: DocumentFactory, target: OpraSchema.UnionType, ctor: Type, metadata: UnionType.Metadata): Promise<void>;
|
|
16
|
-
export declare function extractEnumTypeSchema(this: DocumentFactory, target: OpraSchema.EnumType, enumObject: any, metadata: EnumType.Metadata): Promise<void>;
|
|
17
|
-
export declare function extractFieldSchema(this: DocumentFactory, target: OpraSchema.Field, ctor: Type, metadata: ApiField.Metadata, name: string): Promise<void>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './factory.js';
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { OpraSchema } from '../../schema/index.js';
|
|
2
|
-
import { Collection } from '../resource/collection.js';
|
|
3
|
-
import { Singleton } from '../resource/singleton.js';
|
|
4
|
-
import { Storage } from '../resource/storage.js';
|
|
5
|
-
import type { DocumentFactory } from './factory.js';
|
|
6
|
-
export declare function processSourceQueue(this: DocumentFactory): Promise<void>;
|
|
7
|
-
export declare function createCollectionResource(this: DocumentFactory, name: string, schema: OpraSchema.Collection): Promise<Collection>;
|
|
8
|
-
export declare function createSingletonResource(this: DocumentFactory, name: string, schema: OpraSchema.Singleton): Promise<Singleton>;
|
|
9
|
-
export declare function createStorageResource(this: DocumentFactory, name: string, schema: OpraSchema.Storage): Promise<Storage>;
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { OpraSchema } from '../../schema/index.js';
|
|
2
|
-
import { DataType } from '../data-type/data-type.js';
|
|
3
|
-
import type { DocumentFactory } from './factory.js';
|
|
4
|
-
export declare function processTypes(this: DocumentFactory): Promise<void>;
|
|
5
|
-
export declare function createDataTypeInstance(this: DocumentFactory, kind: OpraSchema.DataType.Kind, name?: string): DataType;
|
|
6
|
-
export declare function addDataType(this: DocumentFactory, schemaOrName: OpraSchema.DataType | string): DataType;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import * as vg from 'valgen';
|
|
2
|
-
import { ComplexType } from '../data-type/complex-type.js';
|
|
3
|
-
import { MappedType } from '../data-type/mapped-type.js';
|
|
4
|
-
import { UnionType } from '../data-type/union-type.js';
|
|
5
|
-
export interface GenerateDecoderOptions {
|
|
6
|
-
omit?: string[];
|
|
7
|
-
partial?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export declare function generateCodec(type: ComplexType, codec: 'decode' | 'encode', options: GenerateDecoderOptions): vg.Validator<any, any>;
|
|
10
|
-
export declare function _generateCodec(type: ComplexType | MappedType | UnionType, codec: 'decode' | 'encode', options: GenerateDecoderOptions): vg.Validator<any, any>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { SpecVersion } from './constants.js';
|
|
2
|
-
import type { DataType } from './data-type/data-type.interface.js';
|
|
3
|
-
import type { Resource } from './resource/resource.interface';
|
|
4
|
-
export interface ApiDocument {
|
|
5
|
-
version: SpecVersion;
|
|
6
|
-
url?: string;
|
|
7
|
-
info: DocumentInfo;
|
|
8
|
-
references?: Record<string, string | ApiDocument>;
|
|
9
|
-
types?: Record<DataType.Name, DataType>;
|
|
10
|
-
resources?: Record<Resource.Name, Resource>;
|
|
11
|
-
servers?: ServerInfo[];
|
|
12
|
-
}
|
|
13
|
-
export type DocumentInfo = {
|
|
14
|
-
title: string;
|
|
15
|
-
version: string;
|
|
16
|
-
description?: string;
|
|
17
|
-
termsOfService?: string;
|
|
18
|
-
contact?: ContactPerson[];
|
|
19
|
-
license?: LicenseInfo;
|
|
20
|
-
};
|
|
21
|
-
export type ServerInfo = {
|
|
22
|
-
url: string;
|
|
23
|
-
description?: string;
|
|
24
|
-
};
|
|
25
|
-
export type ContactPerson = {
|
|
26
|
-
name?: string;
|
|
27
|
-
email?: string;
|
|
28
|
-
url?: string;
|
|
29
|
-
};
|
|
30
|
-
export type LicenseInfo = {
|
|
31
|
-
name: string;
|
|
32
|
-
url?: string;
|
|
33
|
-
content?: string;
|
|
34
|
-
};
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|