@opra/client 0.11.2 → 0.11.4
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/package.json +23 -2
- package/typings/client-error.d.ts +1 -1
- package/typings/common/constants.d.ts +0 -0
- package/typings/common/exception/enums/issue-severity.enum.d.ts +13 -0
- package/typings/common/exception/error-issue.d.ts +9 -0
- package/typings/common/exception/http-errors/bad-request.error.d.ts +10 -0
- package/typings/common/exception/http-errors/failed-dependency.error.d.ts +9 -0
- package/typings/common/exception/http-errors/forbidden.error.d.ts +11 -0
- package/typings/common/exception/http-errors/internal-server.error.d.ts +9 -0
- package/typings/common/exception/http-errors/method-not-allowed.error.d.ts +10 -0
- package/typings/common/exception/http-errors/not-acceptable.error.d.ts +10 -0
- package/typings/common/exception/http-errors/not-found.error.d.ts +13 -0
- package/typings/common/exception/http-errors/unauthorized.error.d.ts +10 -0
- package/typings/common/exception/http-errors/unprocessable-entity.error.d.ts +9 -0
- package/typings/common/exception/index.d.ts +15 -0
- package/typings/common/exception/opra-exception.d.ts +15 -0
- package/typings/common/exception/resource-errors/resource-conflict.error.d.ts +5 -0
- package/typings/common/exception/resource-errors/resource-not-found.error.d.ts +4 -0
- package/typings/common/exception/wrap-exception.d.ts +2 -0
- package/typings/common/filter/antlr/OpraFilterLexer.d.ts +77 -0
- package/typings/common/filter/antlr/OpraFilterListener.d.ts +430 -0
- package/typings/common/filter/antlr/OpraFilterParser.d.ts +437 -0
- package/typings/common/filter/antlr/OpraFilterVisitor.d.ts +260 -0
- package/typings/common/filter/ast/abstract/ast.d.ts +5 -0
- package/typings/common/filter/ast/abstract/expression.d.ts +3 -0
- package/typings/common/filter/ast/abstract/literal.d.ts +6 -0
- package/typings/common/filter/ast/abstract/term.d.ts +3 -0
- package/typings/common/filter/ast/expressions/arithmetic-expression.d.ts +13 -0
- package/typings/common/filter/ast/expressions/array-expression.d.ts +7 -0
- package/typings/common/filter/ast/expressions/comparison-expression.d.ts +10 -0
- package/typings/common/filter/ast/expressions/logical-expression.d.ts +8 -0
- package/typings/common/filter/ast/expressions/parentheses-expression.d.ts +6 -0
- package/typings/common/filter/ast/index.d.ts +16 -0
- package/typings/common/filter/ast/terms/boolean-literal.d.ts +5 -0
- package/typings/common/filter/ast/terms/date-literal.d.ts +6 -0
- package/typings/common/filter/ast/terms/external-constant.d.ts +5 -0
- package/typings/common/filter/ast/terms/null-literal.d.ts +5 -0
- package/typings/common/filter/ast/terms/number-literal.d.ts +6 -0
- package/typings/common/filter/ast/terms/qualified-identifier.d.ts +4 -0
- package/typings/common/filter/ast/terms/string-literal.d.ts +5 -0
- package/typings/common/filter/ast/terms/time-literal.d.ts +6 -0
- package/typings/common/filter/build.d.ts +31 -0
- package/typings/common/filter/errors.d.ts +18 -0
- package/typings/common/filter/filter-tree-visitor.d.ts +32 -0
- package/typings/common/filter/index.d.ts +5 -0
- package/typings/common/filter/opra-error-listener.d.ts +8 -0
- package/typings/common/filter/parse.d.ts +2 -0
- package/typings/common/filter/utils.d.ts +2 -0
- package/typings/common/helpers/index.d.ts +1 -0
- package/typings/common/helpers/responsive-map.d.ts +18 -0
- package/typings/common/http/enums/http-headers.enum.d.ts +379 -0
- package/typings/common/http/enums/http-status.enum.d.ts +290 -0
- package/typings/common/http/http-request.d.ts +34 -0
- package/typings/common/http/index.d.ts +6 -0
- package/typings/common/http/interfaces/client-http-headers.interface.d.ts +65 -0
- package/typings/common/http/interfaces/server-http-headers.interface.d.ts +1 -0
- package/typings/common/http/multipart/batch-multipart.d.ts +31 -0
- package/typings/common/http/multipart/http-request-content.d.ts +8 -0
- package/typings/common/http/multipart/http-response-content.d.ts +7 -0
- package/typings/common/http/multipart/index.d.ts +1 -0
- package/typings/common/http/utils/normalize-headers.d.ts +1 -0
- package/typings/common/i18n/i18n.d.ts +28 -0
- package/typings/common/i18n/index.d.ts +5 -0
- package/typings/common/i18n/string-utils.d.ts +2 -0
- package/typings/common/i18n/translate.d.ts +4 -0
- package/typings/common/index.d.ts +10 -0
- package/typings/common/schema/constants.d.ts +8 -0
- package/typings/common/schema/decorators/opr-collection-resource.decorator.d.ts +8 -0
- package/typings/common/schema/decorators/opr-complex-type.decorator.d.ts +6 -0
- package/typings/common/schema/decorators/opr-field.decorator.d.ts +3 -0
- package/typings/common/schema/decorators/opr-resolver.decorator.d.ts +8 -0
- package/typings/common/schema/decorators/opr-simple-type.decorator.d.ts +6 -0
- package/typings/common/schema/decorators/opr-singleton-resource.decorator.d.ts +8 -0
- package/typings/common/schema/implementation/data-type/builtin/any.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin/base64-binary.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin/bigint.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin/boolean.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin/date-string.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin/date.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin/guid.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin/integer.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin/number.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin/object.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin/string.type.d.ts +2 -0
- package/typings/common/schema/implementation/data-type/builtin-data-types.d.ts +4 -0
- package/typings/common/schema/implementation/data-type/complex-type.d.ts +29 -0
- package/typings/common/schema/implementation/data-type/data-type.d.ts +16 -0
- package/typings/common/schema/implementation/data-type/simple-type.d.ts +12 -0
- package/typings/common/schema/implementation/data-type/union-type.d.ts +16 -0
- package/typings/common/schema/implementation/document-builder.d.ts +16 -0
- package/typings/common/schema/implementation/opra-document.d.ts +44 -0
- package/typings/common/schema/implementation/query/collection-count-query.d.ts +14 -0
- package/typings/common/schema/implementation/query/collection-create-query.d.ts +18 -0
- package/typings/common/schema/implementation/query/collection-delete-many-query.d.ts +14 -0
- package/typings/common/schema/implementation/query/collection-delete-query.d.ts +10 -0
- package/typings/common/schema/implementation/query/collection-get-query.d.ts +21 -0
- package/typings/common/schema/implementation/query/collection-search-query.d.ts +30 -0
- package/typings/common/schema/implementation/query/collection-update-many-query.d.ts +15 -0
- package/typings/common/schema/implementation/query/collection-update-query.d.ts +19 -0
- package/typings/common/schema/implementation/query/field-get-query.d.ts +30 -0
- package/typings/common/schema/implementation/query/index.d.ts +27 -0
- package/typings/common/schema/implementation/query/singleton-get-query.d.ts +20 -0
- package/typings/common/schema/implementation/resource/collection-resource-info.d.ts +19 -0
- package/typings/common/schema/implementation/resource/container-resource-info.d.ts +13 -0
- package/typings/common/schema/implementation/resource/resource-info.d.ts +17 -0
- package/typings/common/schema/implementation/resource/singleton-resource-info.d.ts +14 -0
- package/typings/common/schema/implementation/schema-builder/extract-resource-metadata.util.d.ts +3 -0
- package/typings/common/schema/implementation/schema-builder/extract-type-metadata.util.d.ts +4 -0
- package/typings/common/schema/index.d.ts +25 -0
- package/typings/common/schema/interfaces/child-field-query.interface.d.ts +4 -0
- package/typings/common/schema/interfaces/data-type.metadata.d.ts +18 -0
- package/typings/common/schema/interfaces/resource-container.interface.d.ts +8 -0
- package/typings/common/schema/interfaces/resource.metadata.d.ts +18 -0
- package/typings/common/schema/opra-schema.definition.d.ts +178 -0
- package/typings/common/schema/type-helpers/extend-type.helper.d.ts +3 -0
- package/typings/common/schema/type-helpers/mixin-type.helper.d.ts +2 -0
- package/typings/common/schema/type-helpers/mixin.utils.d.ts +3 -0
- package/typings/common/schema/types.d.ts +14 -0
- package/typings/common/schema/utils/class.utils.d.ts +2 -0
- package/typings/common/schema/utils/clone-object.util.d.ts +1 -0
- package/typings/common/schema/utils/inspect.util.d.ts +4 -0
- package/typings/common/schema/utils/normalize-field-array.util.d.ts +3 -0
- package/typings/common/schema/utils/path-to-tree.util.d.ts +4 -0
- package/typings/common/schema/utils/string-compare.util.d.ts +1 -0
- package/typings/common/url/formats/boolean-format.d.ts +5 -0
- package/typings/common/url/formats/date-format.d.ts +16 -0
- package/typings/common/url/formats/filter-format.d.ts +6 -0
- package/typings/common/url/formats/format.d.ts +4 -0
- package/typings/common/url/formats/integer-format.d.ts +9 -0
- package/typings/common/url/formats/number-format.d.ts +12 -0
- package/typings/common/url/formats/string-format.d.ts +14 -0
- package/typings/common/url/index.d.ts +5 -0
- package/typings/common/url/opra-url-path-component.d.ts +15 -0
- package/typings/common/url/opra-url-path.d.ts +30 -0
- package/typings/common/url/opra-url-search-params.d.ts +44 -0
- package/typings/common/url/opra-url.d.ts +79 -0
- package/typings/common/url/utils/path-utils.d.ts +8 -0
- package/typings/common/utils/index.d.ts +3 -0
- package/typings/common/utils/is-url.d.ts +1 -0
- package/typings/common/utils/path-to-tree.d.ts +4 -0
- package/typings/common/utils/type-guards.d.ts +9 -0
- package/typings/http/http-client.d.ts +1 -1
- package/typings/http/http-collection-service.d.ts +1 -1
- package/typings/http/http-request.d.ts +1 -1
- package/typings/http/http-singleton-service.d.ts +1 -1
- package/typings/http/http-types.d.ts +1 -1
- package/typings/http/requests/batch-request.d.ts +1 -1
- package/typings/http/requests/collection-create-request.d.ts +1 -1
- package/typings/http/requests/collection-delete-many-request.d.ts +1 -1
- package/typings/http/requests/collection-delete-request.d.ts +1 -1
- package/typings/http/requests/collection-get-request.d.ts +1 -1
- package/typings/http/requests/collection-search-request.d.ts +1 -1
- package/typings/http/requests/collection-update-many-request.d.ts +1 -1
- package/typings/http/requests/collection-update-request.d.ts +1 -1
- package/typings/http/requests/http-singleton-get-request.d.ts +1 -1
- package/typings/interfaces/http-options.interface.d.ts +1 -1
- package/typings/interfaces/http-request-config.interface.d.ts +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Expression } from '../abstract/expression.js';
|
|
2
|
+
export declare type ArithmeticOperator = '+' | '-' | '*' | '/';
|
|
3
|
+
export declare class ArithmeticExpression extends Expression {
|
|
4
|
+
items: ArithmeticExpressionItem[];
|
|
5
|
+
constructor();
|
|
6
|
+
append(op: ArithmeticOperator, expression: Expression): this;
|
|
7
|
+
toString(): string;
|
|
8
|
+
}
|
|
9
|
+
export declare class ArithmeticExpressionItem {
|
|
10
|
+
op: ArithmeticOperator;
|
|
11
|
+
expression: Expression;
|
|
12
|
+
constructor(o: ArithmeticExpressionItem);
|
|
13
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { StrictOmit } from 'ts-gems';
|
|
2
|
+
import { Expression } from '../abstract/expression.js';
|
|
3
|
+
export declare type ComparisonOperator = '<=' | '<' | '>' | '>=' | '=' | '!=' | 'in' | '!in' | 'like' | '!like' | 'ilike' | '!ilike';
|
|
4
|
+
export declare class ComparisonExpression extends Expression {
|
|
5
|
+
op: ComparisonOperator;
|
|
6
|
+
left: Expression;
|
|
7
|
+
right: Expression;
|
|
8
|
+
constructor(o: StrictOmit<ComparisonExpression, 'kind'>);
|
|
9
|
+
toString(): string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Expression } from '../abstract/expression.js';
|
|
2
|
+
export declare type LogicalOperator = 'and' | 'or';
|
|
3
|
+
export declare class LogicalExpression extends Expression {
|
|
4
|
+
op: LogicalOperator;
|
|
5
|
+
items: Expression[];
|
|
6
|
+
constructor(o: Omit<LogicalExpression, 'kind'>);
|
|
7
|
+
toString(): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from './abstract/ast.js';
|
|
2
|
+
export * from './abstract/expression.js';
|
|
3
|
+
export * from './abstract/literal.js';
|
|
4
|
+
export * from './abstract/term.js';
|
|
5
|
+
export * from './expressions/arithmetic-expression.js';
|
|
6
|
+
export * from './expressions/array-expression.js';
|
|
7
|
+
export * from './expressions/comparison-expression.js';
|
|
8
|
+
export * from './expressions/logical-expression.js';
|
|
9
|
+
export * from './expressions/parentheses-expression.js';
|
|
10
|
+
export * from './terms/boolean-literal.js';
|
|
11
|
+
export * from './terms/date-literal.js';
|
|
12
|
+
export * from './terms/null-literal.js';
|
|
13
|
+
export * from './terms/number-literal.js';
|
|
14
|
+
export * from './terms/qualified-identifier.js';
|
|
15
|
+
export * from './terms/string-literal.js';
|
|
16
|
+
export * from './terms/time-literal.js';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ArithmeticExpression, ArrayExpression, ComparisonExpression, DateLiteral, Expression, LogicalExpression, NumberLiteral, ParenthesesExpression, QualifiedIdentifier, TimeLiteral } from './ast/index.js';
|
|
2
|
+
declare type _EntryValue = Expression | string | number | bigint | boolean | null | Date;
|
|
3
|
+
export declare type EntryValue = _EntryValue | _EntryValue[];
|
|
4
|
+
export declare function $or(...items: Expression[]): LogicalExpression;
|
|
5
|
+
export declare function $and(...items: Expression[]): LogicalExpression;
|
|
6
|
+
export declare function $date(v: string): DateLiteral;
|
|
7
|
+
export declare function $time(v: string): TimeLiteral;
|
|
8
|
+
export declare function $number(v: string | number | bigint): NumberLiteral;
|
|
9
|
+
export declare function $array(...items: EntryValue[]): ArrayExpression;
|
|
10
|
+
export declare function $field(v: string): QualifiedIdentifier;
|
|
11
|
+
export declare function $eq(left: EntryValue, right: EntryValue): ComparisonExpression;
|
|
12
|
+
export declare function $ne(left: EntryValue, right: EntryValue): ComparisonExpression;
|
|
13
|
+
export declare function $gt(left: EntryValue, right: EntryValue): ComparisonExpression;
|
|
14
|
+
export declare function $gte(left: EntryValue, right: EntryValue): ComparisonExpression;
|
|
15
|
+
export declare function $lt(left: EntryValue, right: EntryValue): ComparisonExpression;
|
|
16
|
+
export declare function $lte(left: EntryValue, right: EntryValue): ComparisonExpression;
|
|
17
|
+
export declare function $in(left: EntryValue, right: EntryValue): ComparisonExpression;
|
|
18
|
+
export declare function $notIn(left: EntryValue, right: EntryValue): ComparisonExpression;
|
|
19
|
+
export declare function $like(left: EntryValue, right: EntryValue): ComparisonExpression;
|
|
20
|
+
export declare function $notLike(left: _EntryValue, right: _EntryValue): ComparisonExpression;
|
|
21
|
+
export declare function $ilike(left: _EntryValue, right: _EntryValue): ComparisonExpression;
|
|
22
|
+
export declare function $notILike(left: _EntryValue, right: _EntryValue): ComparisonExpression;
|
|
23
|
+
export declare function $paren(expression: Expression): ParenthesesExpression;
|
|
24
|
+
declare type MathExpression = ArithmeticExpression & {
|
|
25
|
+
add(expression: EntryValue): MathExpression;
|
|
26
|
+
sub(expression: EntryValue): MathExpression;
|
|
27
|
+
mul(expression: EntryValue): MathExpression;
|
|
28
|
+
div(expression: EntryValue): MathExpression;
|
|
29
|
+
};
|
|
30
|
+
export declare function $arithmetic(n: EntryValue): MathExpression;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RecognitionException } from 'antlr4';
|
|
2
|
+
import { Recognizer } from 'antlr4/src/antlr4/Recognizer';
|
|
3
|
+
export declare class SyntaxError extends TypeError {
|
|
4
|
+
}
|
|
5
|
+
export declare class ValidationError extends TypeError {
|
|
6
|
+
}
|
|
7
|
+
export declare class FilterParseError extends Error {
|
|
8
|
+
recognizer: Recognizer<any>;
|
|
9
|
+
offendingSymbol: any | undefined;
|
|
10
|
+
line: number;
|
|
11
|
+
e: RecognitionException | undefined;
|
|
12
|
+
constructor(message: string, args: {
|
|
13
|
+
recognizer: Recognizer<any>;
|
|
14
|
+
offendingSymbol: any | undefined;
|
|
15
|
+
line: number;
|
|
16
|
+
e: RecognitionException | undefined;
|
|
17
|
+
});
|
|
18
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ParseTreeVisitor as TParseTreeVisitor } from 'antlr4';
|
|
2
|
+
import { ArithmeticExpressionContext, ArrayExpressionContext, BooleanLiteralContext, ComparisonExpressionContext, DateLiteralContext, DateTimeLiteralContext, ExternalConstantTermContext, IdentifierContext, LogicalExpressionContext, NumberLiteralContext, ParenthesizedExpressionContext, PolarityExpressionContext, QualifiedIdentifierTermContext, RootContext, StringLiteralContext, TimeLiteralContext } from './antlr/OpraFilterParser.js';
|
|
3
|
+
import OpraFilterVisitor from './antlr/OpraFilterVisitor.js';
|
|
4
|
+
import { ArithmeticExpression, ArrayExpression, BooleanLiteral, DateLiteral, LogicalExpression, NullLiteral, NumberLiteral, ParenthesesExpression, QualifiedIdentifier, StringLiteral, TimeLiteral } from './ast/index.js';
|
|
5
|
+
import { ExternalConstant } from './ast/terms/external-constant.js';
|
|
6
|
+
declare const ParseTreeVisitor: typeof TParseTreeVisitor;
|
|
7
|
+
export declare class FilterTreeVisitor extends ParseTreeVisitor<any> implements OpraFilterVisitor<any> {
|
|
8
|
+
private _timeZone?;
|
|
9
|
+
constructor(options?: {
|
|
10
|
+
timeZone?: string;
|
|
11
|
+
});
|
|
12
|
+
protected defaultResult(): any;
|
|
13
|
+
visitRoot(ctx: RootContext): any;
|
|
14
|
+
visitIdentifier(ctx: IdentifierContext): string;
|
|
15
|
+
visitNullLiteral(): NullLiteral;
|
|
16
|
+
visitBooleanLiteral(ctx: BooleanLiteralContext): BooleanLiteral;
|
|
17
|
+
visitNumberLiteral(ctx: NumberLiteralContext): NumberLiteral;
|
|
18
|
+
visitStringLiteral(ctx: StringLiteralContext): StringLiteral;
|
|
19
|
+
visitInfinityLiteral(): NumberLiteral;
|
|
20
|
+
visitDateLiteral(ctx: DateLiteralContext): DateLiteral;
|
|
21
|
+
visitDateTimeLiteral(ctx: DateTimeLiteralContext): DateLiteral;
|
|
22
|
+
visitTimeLiteral(ctx: TimeLiteralContext): TimeLiteral;
|
|
23
|
+
visitQualifiedIdentifierTerm(ctx: QualifiedIdentifierTermContext): QualifiedIdentifier;
|
|
24
|
+
visitPolarityExpression(ctx: PolarityExpressionContext): any;
|
|
25
|
+
visitExternalConstantTerm(ctx: ExternalConstantTermContext): ExternalConstant;
|
|
26
|
+
visitParenthesizedExpression(ctx: ParenthesizedExpressionContext): ParenthesesExpression;
|
|
27
|
+
visitArrayExpression(ctx: ArrayExpressionContext): ArrayExpression;
|
|
28
|
+
visitComparisonExpression(ctx: ComparisonExpressionContext): any;
|
|
29
|
+
visitLogicalExpression(ctx: LogicalExpressionContext): LogicalExpression;
|
|
30
|
+
visitArithmeticExpression(ctx: ArithmeticExpressionContext): ArithmeticExpression;
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ErrorListener, RecognitionException } from 'antlr4';
|
|
2
|
+
import { Recognizer } from 'antlr4/src/antlr4/Recognizer';
|
|
3
|
+
import { FilterParseError } from './errors.js';
|
|
4
|
+
export declare class OpraErrorListener extends ErrorListener<any> {
|
|
5
|
+
errors: FilterParseError[];
|
|
6
|
+
constructor(errors: FilterParseError[]);
|
|
7
|
+
syntaxError(recognizer: Recognizer<any>, offendingSymbol: any, line: number, column: number, msg: string, e: RecognitionException): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './responsive-map.js';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare class ResponsiveMap<K, V> extends Map<K, V> {
|
|
2
|
+
private _keyMap;
|
|
3
|
+
private _keyOrder;
|
|
4
|
+
private _wellKnownKeyMap;
|
|
5
|
+
constructor(data?: any, wellKnownKeys?: string[]);
|
|
6
|
+
clear(): void;
|
|
7
|
+
get(key: K): V | undefined;
|
|
8
|
+
has(key: K): boolean;
|
|
9
|
+
set(key: K, value: V): this;
|
|
10
|
+
keys(): IterableIterator<K>;
|
|
11
|
+
values(): IterableIterator<V>;
|
|
12
|
+
entries(): IterableIterator<[K, V]>;
|
|
13
|
+
delete(key: K): boolean;
|
|
14
|
+
sort(compareFn?: (a: K, b: K) => number): this;
|
|
15
|
+
[Symbol.iterator](): IterableIterator<[K, V]>;
|
|
16
|
+
protected _getOriginalKey(key: K): K;
|
|
17
|
+
protected _getLowerKey(key: K): K;
|
|
18
|
+
}
|