@opra/common 1.5.3 → 1.5.5
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/index.cjs +4 -4
- package/browser/index.mjs +4 -4
- package/cjs/document/common/document-node.js +2 -2
- package/cjs/document/data-type/api-field.js +37 -1
- package/cjs/document/data-type/complex-type-base.js +16 -13
- package/cjs/document/data-type/data-type.js +5 -1
- package/cjs/document/decorators/api-field-decorator.js +17 -28
- package/cjs/document/factory/data-type.factory.js +1 -0
- package/cjs/document/utils/test-scope-match.js +1 -1
- package/esm/document/common/document-node.js +2 -2
- package/esm/document/data-type/api-field.js +37 -1
- package/esm/document/data-type/complex-type-base.js +16 -13
- package/esm/document/data-type/data-type.js +5 -1
- package/esm/document/decorators/api-field-decorator.js +17 -28
- package/esm/document/factory/data-type.factory.js +1 -0
- package/esm/document/utils/test-scope-match.js +1 -1
- package/package.json +1 -1
- package/types/document/common/document-node.d.ts +8 -8
- package/types/document/data-type/api-field.d.ts +7 -5
- package/types/document/data-type/complex-type-base.d.ts +2 -2
- package/types/document/data-type/data-type.d.ts +2 -3
- package/types/document/decorators/api-field-decorator.d.ts +11 -0
- package/types/document/factory/data-type.factory.d.ts +1 -1
- package/types/filter/filter-rules.d.ts +2 -2
|
@@ -13,13 +13,12 @@ import { nodeInspectCustom } from '../utils/inspect.util.js';
|
|
|
13
13
|
export declare namespace DataType {
|
|
14
14
|
interface Metadata extends DataTypeBase {
|
|
15
15
|
name?: string;
|
|
16
|
+
scopePattern?: (string | RegExp) | (string | RegExp)[];
|
|
16
17
|
}
|
|
17
18
|
interface Options extends Partial<StrictOmit<Metadata, 'kind' | 'examples'>> {
|
|
18
19
|
embedded?: boolean;
|
|
19
|
-
scopePattern?: (string | RegExp) | (string | RegExp)[];
|
|
20
20
|
}
|
|
21
21
|
interface InitArguments extends DataType.Metadata {
|
|
22
|
-
scopePattern?: (string | RegExp)[];
|
|
23
22
|
}
|
|
24
23
|
interface GenerateCodecOptions extends ValidationOptions {
|
|
25
24
|
documentElement?: DocumentElement;
|
|
@@ -61,7 +60,7 @@ declare abstract class DataTypeClass extends DocumentElement {
|
|
|
61
60
|
abstract generateCodec(codec: 'encode' | 'decode', options?: DataType.GenerateCodecOptions): Validator;
|
|
62
61
|
get embedded(): any;
|
|
63
62
|
abstract extendsFrom(baseType: DataType | string | Type | object): boolean;
|
|
64
|
-
inScope(scope?: string): boolean;
|
|
63
|
+
inScope(scope?: string | '*'): boolean;
|
|
65
64
|
toJSON(options?: ApiDocument.ExportOptions): OpraSchema.DataType;
|
|
66
65
|
toString(): string;
|
|
67
66
|
protected abstract _locateBase(callback: (base: DataType) => boolean): DataType | undefined;
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
+
import { StrictOmit } from 'ts-gems';
|
|
1
2
|
import type { ApiField } from '../data-type/api-field.js';
|
|
2
3
|
export interface ApiFieldDecorator extends PropertyDecorator {
|
|
4
|
+
/**
|
|
5
|
+
* Overrides the default settings of an API field with specified options.
|
|
6
|
+
*
|
|
7
|
+
* @param {string | RegExp | (string | RegExp)[]} scopePattern - A pattern or array of patterns that defines the scope
|
|
8
|
+
* within which the override applies. Patterns can be strings or regular expressions.
|
|
9
|
+
* @param {StrictOmit<ApiField.Options, 'isArray' | 'type' | 'scopePattern'>} options - Configuration options to override
|
|
10
|
+
* the default API field behavior, excluding the properties 'isArray', 'type', and 'scopePattern'.
|
|
11
|
+
* @return {ApiFieldDecorator} The decorated API field after applying the override configuration.
|
|
12
|
+
*/
|
|
13
|
+
Override(scopePattern: (string | RegExp) | (string | RegExp)[], options: StrictOmit<ApiField.Options, 'isArray' | 'type' | 'scopePattern'>): ApiFieldDecorator;
|
|
3
14
|
}
|
|
4
15
|
export interface ApiFieldDecoratorFactory {
|
|
5
16
|
(options?: ApiField.Options): ApiFieldDecorator;
|
|
@@ -90,7 +90,7 @@ export declare class DataTypeFactory {
|
|
|
90
90
|
* @protected
|
|
91
91
|
*/
|
|
92
92
|
protected static _importDataTypeArgs(context: DataTypeFactory.Context, owner: DocumentElement, thunk: string | Type | OpraSchema.DataType | object): Promise<DataTypeFactory.DataTypeInitArguments | string | void>;
|
|
93
|
-
protected static _prepareDataTypeArgs(context: DataTypeFactory.Context, initArgs: DataTypeFactory.DataTypeInitArguments, metadata: OpraSchema.DataTypeBase): Promise<void>;
|
|
93
|
+
protected static _prepareDataTypeArgs(context: DataTypeFactory.Context, initArgs: DataTypeFactory.DataTypeInitArguments, metadata: OpraSchema.DataTypeBase | DataType.Metadata): Promise<void>;
|
|
94
94
|
protected static _prepareComplexTypeArgs(context: DataTypeFactory.Context, owner: DocumentElement, initArgs: DataTypeFactory.ComplexTypeInit, metadata: ComplexType.Metadata | OpraSchema.ComplexType): Promise<void>;
|
|
95
95
|
protected static _prepareEnumTypeArgs(context: DataTypeFactory.Context, owner: DocumentElement, initArgs: DataTypeFactory.EnumTypeInit, metadata: EnumType.Metadata | OpraSchema.EnumType): Promise<void>;
|
|
96
96
|
protected static _prepareSimpleTypeArgs(context: DataTypeFactory.Context, owner: DocumentElement, initArgs: DataTypeFactory.SimpleTypeInit, metadata: SimpleType.Metadata | OpraSchema.SimpleType): Promise<void>;
|
|
@@ -21,8 +21,8 @@ export declare class FilterRules {
|
|
|
21
21
|
set(fieldName: string, options?: Partial<StrictOmit<FilterRules.Rule, 'operators'>> & {
|
|
22
22
|
operators?: ComparisonOperator[] | string;
|
|
23
23
|
}): void;
|
|
24
|
-
normalizeFilter(filter: OpraSchema.Field.QualifiedName | Expression, currentType?: ComplexType, scope?:
|
|
25
|
-
protected normalizeFilterAst(ast: Expression, stack: Expression[], currentType?: ComplexType, scope?: string): Expression | undefined;
|
|
24
|
+
normalizeFilter(filter: OpraSchema.Field.QualifiedName | Expression, currentType?: ComplexType, scope?: string | '*'): Expression | undefined;
|
|
25
|
+
protected normalizeFilterAst(ast: Expression, stack: Expression[], currentType?: ComplexType, scope?: string | '*'): Expression | undefined;
|
|
26
26
|
toJSON(): Record<string, FilterRules.Rule>;
|
|
27
27
|
[Symbol.iterator](): IterableIterator<[string, FilterRules.Rule]>;
|
|
28
28
|
}
|